From: Andrea Amorese Date: Wed, 26 Jan 2022 09:17:28 +0000 (+0100) Subject: Built motion from commit ea15ccfd.|2.6.0 X-Git-Url: http://repos.xcallymotion.com/base//%22?a=commitdiff_plain;h=b35f8b37b0026f41e502f988bcca2371430b7973;p=motion2.git Built motion from commit ea15ccfd.|2.6.0 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 3a4c844..fadebc2 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-26T08:50:52.226Z", + "time": "2022-01-26T09:06:26.251Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index d45fa46..46c0148 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-26T08:50:52.226Z", + "time": "2022-01-26T09:06:26.251Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 513634d..c820b7f 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 _0xfac1=['browser','bot','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[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','action','STRING','contactManager','integration','motionbar','urlForward'];(function(_0x1192d3,_0x340266){var _0xbc85aa=function(_0x5192d6){while(--_0x5192d6){_0x1192d3['push'](_0x1192d3['shift']());}};_0xbc85aa(++_0x340266);}(_0xfac1,0x16f));var _0x1fac=function(_0x44bf54,_0x5be3d6){_0x44bf54=_0x44bf54-0x0;var _0x2c4a96=_0xfac1[_0x44bf54];return _0x2c4a96;};'use strict';var Sequelize=require('sequelize');module[_0x1fac('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x29938a){return this['getDataValue'](_0x1fac('0x1'));}},'action':{'type':Sequelize[_0x1fac('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1fac('0x3'),_0x1fac('0x4'),_0x1fac('0x5'),'jscripty',_0x1fac('0x6'),_0x1fac('0x7'),_0x1fac('0x8'),'script']],'msg':_0x1fac('0x9')}},'comment':_0x1fac('0x9')},'data1':{'type':Sequelize[_0x1fac('0x2')](0x1000),'comment':_0x1fac('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x1fac('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x1fac('0xc')},'data4':{'type':Sequelize[_0x1fac('0x2')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x1fac('0x2')](0x1000),'comments':_0x1fac('0xd')},'data6':{'type':Sequelize[_0x1fac('0x2')],'comments':_0x1fac('0xe')},'data7':{'type':Sequelize[_0x1fac('0xf')],'comments':_0x1fac('0x10')}}; \ No newline at end of file +var _0x0178=['action','STRING','contactManager','integration','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','TEXT','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x2a5353,_0x8afbe8){var _0x14eddc=function(_0x5b33f2){while(--_0x5b33f2){_0x2a5353['push'](_0x2a5353['shift']());}};_0x14eddc(++_0x8afbe8);}(_0x0178,0xce));var _0x8017=function(_0x8b499c,_0x2557a4){_0x8b499c=_0x8b499c-0x0;var _0x580def=_0x0178[_0x8b499c];return _0x580def;};'use strict';var Sequelize=require(_0x8017('0x0'));module[_0x8017('0x1')]={'name':{'type':Sequelize[_0x8017('0x2')],'get':function(_0x1d75ed){return this[_0x8017('0x3')](_0x8017('0x4'));}},'action':{'type':Sequelize[_0x8017('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8017('0x6'),_0x8017('0x7'),'motionbar','jscripty',_0x8017('0x8'),_0x8017('0x9'),'bot',_0x8017('0xa')]],'msg':_0x8017('0xb')}},'comment':_0x8017('0xb')},'data1':{'type':Sequelize[_0x8017('0x5')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x8017('0x5')](0x1000),'comment':_0x8017('0xc')},'data3':{'type':Sequelize[_0x8017('0x5')](0x1000),'comment':_0x8017('0xd')},'data4':{'type':Sequelize[_0x8017('0x5')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x8017('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x8017('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x8017('0xe')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 2c6d3b6..b0f70b3 100644 --- a/server/api/action/action.controller.js +++ b/server/api/action/action.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4eb2=['zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','destroy','then','stack','name','send','update','body','find','params','catch','Action','rimraf'];(function(_0x37998f,_0x1e2475){var _0x35a99d=function(_0x4d40c7){while(--_0x4d40c7){_0x37998f['push'](_0x37998f['shift']());}};_0x35a99d(++_0x1e2475);}(_0x4eb2,0xe0));var _0x24eb=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x4eb2[_0x288f5e];return _0x476cc9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x24eb('0x0'));var zipdir=require(_0x24eb('0x1'));var jsonpatch=require(_0x24eb('0x2'));var rp=require('request-promise');var moment=require(_0x24eb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x24eb('0x4'));var util=require(_0x24eb('0x5'));var path=require(_0x24eb('0x6'));var sox=require(_0x24eb('0x7'));var csv=require(_0x24eb('0x8'));var ejs=require(_0x24eb('0x9'));var fs=require('fs');var fs_extra=require(_0x24eb('0xa'));var _=require(_0x24eb('0xb'));var squel=require('squel');var crypto=require(_0x24eb('0xc'));var jsforce=require(_0x24eb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x24eb('0x8'));var querystring=require(_0x24eb('0xe'));var Papa=require('papaparse');var Redis=require(_0x24eb('0xf'));var authService=require(_0x24eb('0x10'));var qs=require(_0x24eb('0x11'));var as=require(_0x24eb('0x12'));var hardwareService=require(_0x24eb('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x24eb('0x14'));var config=require(_0x24eb('0x15'));var licenseUtil=require(_0x24eb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19dab8,_0x286828){_0x286828=_0x286828||0xcc;return function(_0x2b4a97){if(_0x2b4a97){return _0x19dab8[_0x24eb('0x17')](_0x286828);}return _0x19dab8[_0x24eb('0x18')](_0x286828)[_0x24eb('0x19')]();};}function respondWithResult(_0x2e905e,_0x3a44cb){_0x3a44cb=_0x3a44cb||0xc8;return function(_0x56bf05){if(_0x56bf05){return _0x2e905e[_0x24eb('0x18')](_0x3a44cb)[_0x24eb('0x1a')](_0x56bf05);}};}function respondWithFilteredResult(_0x5cb0b0,_0x138e65){return function(_0x55fa8a){if(_0x55fa8a){var _0x2cea93=typeof _0x138e65[_0x24eb('0x1b')]===_0x24eb('0x1c')&&typeof _0x138e65[_0x24eb('0x1d')]===_0x24eb('0x1c');var _0x242102=_0x55fa8a[_0x24eb('0x1e')];var _0xc760ce=_0x2cea93?0x0:_0x138e65[_0x24eb('0x1b')];var _0x1d2f35=_0x2cea93?_0x55fa8a[_0x24eb('0x1e')]:_0x138e65[_0x24eb('0x1b')]+_0x138e65[_0x24eb('0x1d')];var _0x37854b;if(_0x1d2f35>=_0x242102){_0x1d2f35=_0x242102;_0x37854b=0xc8;}else{_0x37854b=0xce;}_0x5cb0b0['status'](_0x37854b);return _0x5cb0b0['set'](_0x24eb('0x1f'),_0xc760ce+'-'+_0x1d2f35+'/'+_0x242102)[_0x24eb('0x1a')](_0x55fa8a);}return null;};}function patchUpdates(_0x5c7b7c){return function(_0x4b2492){try{jsonpatch['apply'](_0x4b2492,_0x5c7b7c,!![]);}catch(_0x20227d){return BPromise[_0x24eb('0x20')](_0x20227d);}return _0x4b2492[_0x24eb('0x21')]();};}function saveUpdates(_0x5b22a6,_0x18af23){return function(_0x1ee442){if(_0x1ee442){return _0x1ee442['update'](_0x5b22a6)['then'](function(_0x25862f){return _0x25862f;});}return null;};}function removeEntity(_0x5812a3,_0x3855a1){return function(_0x24a577){if(_0x24a577){return _0x24a577[_0x24eb('0x22')]()[_0x24eb('0x23')](function(){_0x5812a3[_0x24eb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38c54d,_0x1f866f){return function(_0x483e75){if(!_0x483e75){_0x38c54d[_0x24eb('0x17')](0x194);}return _0x483e75;};}function handleError(_0x1bbd71,_0x279c59){_0x279c59=_0x279c59||0x1f4;return function(_0x4bbab9){logger['error'](_0x4bbab9[_0x24eb('0x24')]);if(_0x4bbab9[_0x24eb('0x25')]){delete _0x4bbab9[_0x24eb('0x25')];}_0x1bbd71[_0x24eb('0x18')](_0x279c59)[_0x24eb('0x26')](_0x4bbab9);};}exports[_0x24eb('0x27')]=function(_0x417356,_0x2ed3fa){if(_0x417356[_0x24eb('0x28')]['id']){delete _0x417356[_0x24eb('0x28')]['id'];}return db['Action'][_0x24eb('0x29')]({'where':{'id':_0x417356[_0x24eb('0x2a')]['id']}})[_0x24eb('0x23')](handleEntityNotFound(_0x2ed3fa,null))[_0x24eb('0x23')](saveUpdates(_0x417356[_0x24eb('0x28')],null))[_0x24eb('0x23')](respondWithResult(_0x2ed3fa,null))[_0x24eb('0x2b')](handleError(_0x2ed3fa,null));};exports[_0x24eb('0x22')]=function(_0x342a3c,_0xd398){return db[_0x24eb('0x2c')]['find']({'where':{'id':_0x342a3c[_0x24eb('0x2a')]['id']}})[_0x24eb('0x23')](handleEntityNotFound(_0xd398,null))[_0x24eb('0x23')](removeEntity(_0xd398,null))[_0x24eb('0x2b')](handleError(_0xd398,null));}; \ No newline at end of file +var _0x5a24=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','find','params','Action','catch','eml-format'];(function(_0xf13ca6,_0x5735ea){var _0x4a4387=function(_0x103f67){while(--_0x103f67){_0xf13ca6['push'](_0xf13ca6['shift']());}};_0x4a4387(++_0x5735ea);}(_0x5a24,0x12b));var _0x45a2=function(_0x2fb5c7,_0x490b22){_0x2fb5c7=_0x2fb5c7-0x0;var _0x4eebe2=_0x5a24[_0x2fb5c7];return _0x4eebe2;};'use strict';var emlformat=require(_0x45a2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x45a2('0x1'));var jsonpatch=require(_0x45a2('0x2'));var rp=require(_0x45a2('0x3'));var moment=require(_0x45a2('0x4'));var BPromise=require(_0x45a2('0x5'));var Mustache=require('mustache');var util=require(_0x45a2('0x6'));var path=require(_0x45a2('0x7'));var sox=require(_0x45a2('0x8'));var csv=require(_0x45a2('0x9'));var ejs=require(_0x45a2('0xa'));var fs=require('fs');var fs_extra=require(_0x45a2('0xb'));var _=require(_0x45a2('0xc'));var squel=require(_0x45a2('0xd'));var crypto=require(_0x45a2('0xe'));var jsforce=require(_0x45a2('0xf'));var deskjs=require(_0x45a2('0x10'));var toCsv=require(_0x45a2('0x9'));var querystring=require('querystring');var Papa=require(_0x45a2('0x11'));var Redis=require(_0x45a2('0x12'));var authService=require(_0x45a2('0x13'));var qs=require(_0x45a2('0x14'));var as=require(_0x45a2('0x15'));var hardwareService=require(_0x45a2('0x16'));var logger=require(_0x45a2('0x17'))(_0x45a2('0x18'));var utils=require(_0x45a2('0x19'));var config=require(_0x45a2('0x1a'));var licenseUtil=require(_0x45a2('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32a690,_0x560bd2){_0x560bd2=_0x560bd2||0xcc;return function(_0x510735){if(_0x510735){return _0x32a690[_0x45a2('0x1c')](_0x560bd2);}return _0x32a690[_0x45a2('0x1d')](_0x560bd2)['end']();};}function respondWithResult(_0x1e0169,_0x23bb9f){_0x23bb9f=_0x23bb9f||0xc8;return function(_0x275f63){if(_0x275f63){return _0x1e0169[_0x45a2('0x1d')](_0x23bb9f)['json'](_0x275f63);}};}function respondWithFilteredResult(_0x2be0a4,_0x25bcb2){return function(_0x510a06){if(_0x510a06){var _0x55143f=typeof _0x25bcb2[_0x45a2('0x1e')]==='undefined'&&typeof _0x25bcb2[_0x45a2('0x1f')]===_0x45a2('0x20');var _0x468b5b=_0x510a06[_0x45a2('0x21')];var _0x47eb95=_0x55143f?0x0:_0x25bcb2[_0x45a2('0x1e')];var _0x304471=_0x55143f?_0x510a06[_0x45a2('0x21')]:_0x25bcb2[_0x45a2('0x1e')]+_0x25bcb2[_0x45a2('0x1f')];var _0x29ee2c;if(_0x304471>=_0x468b5b){_0x304471=_0x468b5b;_0x29ee2c=0xc8;}else{_0x29ee2c=0xce;}_0x2be0a4[_0x45a2('0x1d')](_0x29ee2c);return _0x2be0a4[_0x45a2('0x22')](_0x45a2('0x23'),_0x47eb95+'-'+_0x304471+'/'+_0x468b5b)['json'](_0x510a06);}return null;};}function patchUpdates(_0xb31f3b){return function(_0x36f401){try{jsonpatch['apply'](_0x36f401,_0xb31f3b,!![]);}catch(_0x286e7c){return BPromise[_0x45a2('0x24')](_0x286e7c);}return _0x36f401[_0x45a2('0x25')]();};}function saveUpdates(_0x367532,_0x479db6){return function(_0x19c412){if(_0x19c412){return _0x19c412[_0x45a2('0x26')](_0x367532)[_0x45a2('0x27')](function(_0x11e384){return _0x11e384;});}return null;};}function removeEntity(_0x1ff623,_0xafd98f){return function(_0x1768dc){if(_0x1768dc){return _0x1768dc[_0x45a2('0x28')]()[_0x45a2('0x27')](function(){_0x1ff623['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x140b1d,_0x504046){return function(_0x1f5a5b){if(!_0x1f5a5b){_0x140b1d[_0x45a2('0x1c')](0x194);}return _0x1f5a5b;};}function handleError(_0x5734f2,_0x4d9bbe){_0x4d9bbe=_0x4d9bbe||0x1f4;return function(_0x44d43f){logger[_0x45a2('0x29')](_0x44d43f[_0x45a2('0x2a')]);if(_0x44d43f['name']){delete _0x44d43f[_0x45a2('0x2b')];}_0x5734f2[_0x45a2('0x1d')](_0x4d9bbe)[_0x45a2('0x2c')](_0x44d43f);};}exports[_0x45a2('0x26')]=function(_0x14911a,_0x78da16){if(_0x14911a[_0x45a2('0x2d')]['id']){delete _0x14911a[_0x45a2('0x2d')]['id'];}return db['Action'][_0x45a2('0x2e')]({'where':{'id':_0x14911a[_0x45a2('0x2f')]['id']}})['then'](handleEntityNotFound(_0x78da16,null))[_0x45a2('0x27')](saveUpdates(_0x14911a[_0x45a2('0x2d')],null))[_0x45a2('0x27')](respondWithResult(_0x78da16,null))['catch'](handleError(_0x78da16,null));};exports['destroy']=function(_0x376c33,_0x37e4d1){return db[_0x45a2('0x30')][_0x45a2('0x2e')]({'where':{'id':_0x376c33[_0x45a2('0x2f')]['id']}})[_0x45a2('0x27')](handleEntityNotFound(_0x37e4d1,null))['then'](removeEntity(_0x37e4d1,null))[_0x45a2('0x31')](handleError(_0x37e4d1,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index f9f3438..bc8cb5d 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 _0xc343=['../../config/logger','api','moment','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xc343,0x173));var _0x3c34=function(_0x46d48a,_0x36bc6e){_0x46d48a=_0x46d48a-0x0;var _0x1f8883=_0xc343[_0x46d48a];return _0x1f8883;};'use strict';var _=require(_0x3c34('0x0'));var util=require('util');var logger=require(_0x3c34('0x1'))(_0x3c34('0x2'));var moment=require(_0x3c34('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c34('0x4'));var rimraf=require(_0x3c34('0x5'));var config=require(_0x3c34('0x6'));var attributes=require(_0x3c34('0x7'));module[_0x3c34('0x8')]=function(_0x37ddf8,_0x401457){return _0x37ddf8[_0x3c34('0x9')](_0x3c34('0xa'),attributes,{'tableName':_0x3c34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe60=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./action.attributes','exports','define','Action','tools_actions'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xbe60,0x1bc));var _0x0be6=function(_0x57c8a1,_0x3ae71c){_0x57c8a1=_0x57c8a1-0x0;var _0x305355=_0xbe60[_0x57c8a1];return _0x305355;};'use strict';var _=require(_0x0be6('0x0'));var util=require(_0x0be6('0x1'));var logger=require(_0x0be6('0x2'))(_0x0be6('0x3'));var moment=require('moment');var BPromise=require(_0x0be6('0x4'));var rp=require(_0x0be6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0be6('0x6'));var config=require('../../config/environment');var attributes=require(_0x0be6('0x7'));module[_0x0be6('0x8')]=function(_0x5d7e81,_0xeb8019){return _0x5d7e81[_0x0be6('0x9')](_0x0be6('0xa'),attributes,{'tableName':_0x0be6('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 7dad8f4..5c66de1 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x53ec,0x192));var _0xc53e=function(_0x120da6,_0x15f450){_0x120da6=_0x120da6-0x0;var _0x3d6c07=_0x53ec[_0x120da6];return _0x3d6c07;};'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')]('Action,\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 +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x9df3d8,_0x4074e3){var _0x366da1=function(_0x5af940){while(--_0x5af940){_0x9df3d8['push'](_0x9df3d8['shift']());}};_0x366da1(++_0x4074e3);}(_0xf494,0x1c6));var _0x4f49=function(_0x3b61b4,_0x5a975e){_0x3b61b4=_0x3b61b4-0x0;var _0x31dbfb=_0xf494[_0x3b61b4];return _0x31dbfb;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index bba9dbb..ac8ab5f 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 _0xf888=['update','delete','/:id','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put'];(function(_0x48b10d,_0x48c262){var _0x566bac=function(_0x4e6051){while(--_0x4e6051){_0x48b10d['push'](_0x48b10d['shift']());}};_0x566bac(++_0x48c262);}(_0xf888,0xd4));var _0x8f88=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xf888[_0x369151];return _0x4292d5;};'use strict';var multer=require('multer');var util=require(_0x8f88('0x0'));var path=require('path');var timeout=require(_0x8f88('0x1'));var express=require(_0x8f88('0x2'));var router=express[_0x8f88('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8f88('0x4'));var interaction=require(_0x8f88('0x5'));var config=require(_0x8f88('0x6'));var controller=require(_0x8f88('0x7'));router[_0x8f88('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8f88('0x9')]);router[_0x8f88('0xa')](_0x8f88('0xb'),auth['isAuthenticated'](),controller[_0x8f88('0xc')]);module['exports']=router; \ No newline at end of file +var _0xb3b4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','destroy','exports','multer','util','path'];(function(_0x502d90,_0x147708){var _0x40d080=function(_0x5ab3d7){while(--_0x5ab3d7){_0x502d90['push'](_0x502d90['shift']());}};_0x40d080(++_0x147708);}(_0xb3b4,0xa7));var _0x4b3b=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xb3b4[_0x1eda20];return _0x31b953;};'use strict';var multer=require(_0x4b3b('0x0'));var util=require(_0x4b3b('0x1'));var path=require(_0x4b3b('0x2'));var timeout=require(_0x4b3b('0x3'));var express=require(_0x4b3b('0x4'));var router=express[_0x4b3b('0x5')]();var fs_extra=require(_0x4b3b('0x6'));var auth=require(_0x4b3b('0x7'));var interaction=require(_0x4b3b('0x8'));var config=require(_0x4b3b('0x9'));var controller=require(_0x4b3b('0xa'));router[_0x4b3b('0xb')](_0x4b3b('0xc'),auth[_0x4b3b('0xd')](),controller[_0x4b3b('0xe')]);router['delete'](_0x4b3b('0xc'),auth[_0x4b3b('0xd')](),controller[_0x4b3b('0xf')]);module[_0x4b3b('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 080edab..b973bfd 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 _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7da7,0x10d));var _0x77da=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0x7da7[_0x2eec1f];return _0x543075;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4819=['TEXT','exports','STRING'];(function(_0xf2f332,_0x299fbf){var _0x56cce3=function(_0x5f37e0){while(--_0x5f37e0){_0xf2f332['push'](_0xf2f332['shift']());}};_0x56cce3(++_0x299fbf);}(_0x4819,0xcd));var _0x9481=function(_0x52a12a,_0x19ffde){_0x52a12a=_0x52a12a-0x0;var _0xf034fb=_0x4819[_0x52a12a];return _0xf034fb;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index f931423..bb27643 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 _0x84ce=['hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','intersection','length','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','destroy','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','replace','format','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','IS\x20EMPTY','condition','table','metric','groupBy','alias','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','model','keys','query','filters','attributes','fields'];(function(_0x3ae4bf,_0x554978){var _0x27f7dd=function(_0x406997){while(--_0x406997){_0x3ae4bf['push'](_0x3ae4bf['shift']());}};_0x27f7dd(++_0x554978);}(_0x84ce,0x6d));var _0xe84c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x84ce[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xe84c('0x0'));var rimraf=require(_0xe84c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe84c('0x2'));var moment=require(_0xe84c('0x3'));var BPromise=require(_0xe84c('0x4'));var Mustache=require(_0xe84c('0x5'));var util=require(_0xe84c('0x6'));var path=require(_0xe84c('0x7'));var sox=require(_0xe84c('0x8'));var csv=require(_0xe84c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe84c('0xa'));var squel=require(_0xe84c('0xb'));var crypto=require('crypto');var jsforce=require(_0xe84c('0xc'));var deskjs=require(_0xe84c('0xd'));var toCsv=require(_0xe84c('0x9'));var querystring=require(_0xe84c('0xe'));var Papa=require(_0xe84c('0xf'));var Redis=require('ioredis');var authService=require(_0xe84c('0x10'));var qs=require(_0xe84c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe84c('0x12'));var logger=require(_0xe84c('0x13'))(_0xe84c('0x14'));var utils=require(_0xe84c('0x15'));var config=require(_0xe84c('0x16'));var licenseUtil=require(_0xe84c('0x17'));var db=require(_0xe84c('0x18'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x491914,_0x4f3d5e){_0x4f3d5e=_0x4f3d5e||0xcc;return function(_0x592b68){if(_0x592b68){return _0x491914[_0xe84c('0x19')](_0x4f3d5e);}return _0x491914['status'](_0x4f3d5e)[_0xe84c('0x1a')]();};}function respondWithResult(_0x157cd1,_0x14801d){_0x14801d=_0x14801d||0xc8;return function(_0x5367e6){if(_0x5367e6){return _0x157cd1[_0xe84c('0x1b')](_0x14801d)[_0xe84c('0x1c')](_0x5367e6);}};}function respondWithFilteredResult(_0x796089,_0x641309){return function(_0x10fdde){if(_0x10fdde){var _0x544d32=typeof _0x641309[_0xe84c('0x1d')]==='undefined'&&typeof _0x641309['limit']===_0xe84c('0x1e');var _0x7c41d1=_0x10fdde['count'];var _0x41a81d=_0x544d32?0x0:_0x641309[_0xe84c('0x1d')];var _0x1591b9=_0x544d32?_0x10fdde[_0xe84c('0x1f')]:_0x641309[_0xe84c('0x1d')]+_0x641309['limit'];var _0x3cf728;if(_0x1591b9>=_0x7c41d1){_0x1591b9=_0x7c41d1;_0x3cf728=0xc8;}else{_0x3cf728=0xce;}_0x796089[_0xe84c('0x1b')](_0x3cf728);return _0x796089[_0xe84c('0x20')](_0xe84c('0x21'),_0x41a81d+'-'+_0x1591b9+'/'+_0x7c41d1)[_0xe84c('0x1c')](_0x10fdde);}return null;};}function patchUpdates(_0x3ab8ab){return function(_0x166fd4){try{jsonpatch[_0xe84c('0x22')](_0x166fd4,_0x3ab8ab,!![]);}catch(_0x5c0169){return BPromise[_0xe84c('0x23')](_0x5c0169);}return _0x166fd4['save']();};}function saveUpdates(_0x527e80,_0x4a4efc){return function(_0x3a867c){if(_0x3a867c){return _0x3a867c[_0xe84c('0x24')](_0x527e80)[_0xe84c('0x25')](function(_0x172272){return _0x172272;});}return null;};}function removeEntity(_0x40300f,_0x389ad1){return function(_0x20f798){if(_0x20f798){return _0x20f798['destroy']()[_0xe84c('0x25')](function(){var _0x5ceaca=_0x20f798['get']({'plain':!![]});var _0x5e76d7=_0xe84c('0x26');return db[_0xe84c('0x27')]['destroy']({'where':{'type':_0x5e76d7,'resourceId':_0x5ceaca['id']}})[_0xe84c('0x25')](function(){return _0x20f798;});})[_0xe84c('0x25')](function(){_0x40300f[_0xe84c('0x1b')](0xcc)[_0xe84c('0x1a')]();});}};}function handleEntityNotFound(_0x6d5673,_0x2faf2b){return function(_0x5966c1){if(!_0x5966c1){_0x6d5673['sendStatus'](0x194);}return _0x5966c1;};}function handleError(_0x36dda8,_0x48f0e2){_0x48f0e2=_0x48f0e2||0x1f4;return function(_0x3771c3){logger[_0xe84c('0x28')](_0x3771c3[_0xe84c('0x29')]);if(_0x3771c3[_0xe84c('0x2a')]){delete _0x3771c3[_0xe84c('0x2a')];}_0x36dda8[_0xe84c('0x1b')](_0x48f0e2)[_0xe84c('0x2b')](_0x3771c3);};}exports[_0xe84c('0x2c')]=function(_0xa0269,_0x103e97){var _0x5149d4={},_0x1a26ef={},_0x2eb698={'count':0x0,'rows':[]};var _0xb2af7e=_[_0xe84c('0x2d')](db[_0xe84c('0x2e')]['rawAttributes'],function(_0x2a48c6){return{'name':_0x2a48c6[_0xe84c('0x2f')],'type':_0x2a48c6[_0xe84c('0x30')]['key']};});_0x1a26ef[_0xe84c('0x31')]=_[_0xe84c('0x2d')](_0xb2af7e,'name');_0x1a26ef['query']=_[_0xe84c('0x32')](_0xa0269[_0xe84c('0x33')]);_0x1a26ef[_0xe84c('0x34')]=_['intersection'](_0x1a26ef[_0xe84c('0x31')],_0x1a26ef[_0xe84c('0x33')]);_0x5149d4[_0xe84c('0x35')]=_['intersection'](_0x1a26ef[_0xe84c('0x31')],qs[_0xe84c('0x36')](_0xa0269[_0xe84c('0x33')][_0xe84c('0x36')]));_0x5149d4[_0xe84c('0x35')]=_0x5149d4['attributes']['length']?_0x5149d4[_0xe84c('0x35')]:_0x1a26ef[_0xe84c('0x31')];if(!_0xa0269[_0xe84c('0x33')][_0xe84c('0x37')](_0xe84c('0x38'))){_0x5149d4[_0xe84c('0x39')]=qs[_0xe84c('0x39')](_0xa0269[_0xe84c('0x33')]['limit']);_0x5149d4[_0xe84c('0x1d')]=qs['offset'](_0xa0269[_0xe84c('0x33')][_0xe84c('0x1d')]);}_0x5149d4[_0xe84c('0x3a')]=qs[_0xe84c('0x3b')](_0xa0269[_0xe84c('0x33')]['sort']);_0x5149d4['where']=qs[_0xe84c('0x34')](_['pick'](_0xa0269[_0xe84c('0x33')],_0x1a26ef['filters']),_0xb2af7e);if(_0xa0269['query'][_0xe84c('0x3c')]){_0x5149d4[_0xe84c('0x3d')]=_[_0xe84c('0x3e')](_0x5149d4['where'],{'$or':_[_0xe84c('0x2d')](_0xb2af7e,function(_0x120d10){if(_0x120d10[_0xe84c('0x30')]!==_0xe84c('0x3f')){var _0x5167b3={};_0x5167b3[_0x120d10[_0xe84c('0x2a')]]={'$like':'%'+_0xa0269[_0xe84c('0x33')][_0xe84c('0x3c')]+'%'};return _0x5167b3;}})});}_0x5149d4=_[_0xe84c('0x3e')]({},_0x5149d4,_0xa0269[_0xe84c('0x40')]);var _0x493a03={'where':_0x5149d4[_0xe84c('0x3d')]};return db['AnalyticCustomReport'][_0xe84c('0x1f')](_0x493a03)['then'](function(_0x5a0629){_0x2eb698[_0xe84c('0x1f')]=_0x5a0629;if(_0xa0269[_0xe84c('0x33')][_0xe84c('0x41')]){_0x5149d4['include']=[{'all':!![]}];}return db[_0xe84c('0x2e')][_0xe84c('0x42')](_0x5149d4);})['then'](function(_0x197981){_0x2eb698['rows']=_0x197981;return _0x2eb698;})[_0xe84c('0x25')](respondWithFilteredResult(_0x103e97,_0x5149d4))['catch'](handleError(_0x103e97,null));};exports[_0xe84c('0x43')]=function(_0x2bfe07,_0x27934c){var _0x462b12={'raw':![],'where':{'id':_0x2bfe07[_0xe84c('0x44')]['id']}},_0x30addf={};_0x30addf['model']=_[_0xe84c('0x32')](db['AnalyticCustomReport'][_0xe84c('0x45')]);_0x30addf['query']=_['keys'](_0x2bfe07[_0xe84c('0x33')]);_0x30addf[_0xe84c('0x34')]=_['intersection'](_0x30addf[_0xe84c('0x31')],_0x30addf[_0xe84c('0x33')]);_0x462b12[_0xe84c('0x35')]=_[_0xe84c('0x46')](_0x30addf[_0xe84c('0x31')],qs['fields'](_0x2bfe07[_0xe84c('0x33')][_0xe84c('0x36')]));_0x462b12[_0xe84c('0x35')]=_0x462b12[_0xe84c('0x35')][_0xe84c('0x47')]?_0x462b12[_0xe84c('0x35')]:_0x30addf['model'];if(_0x2bfe07['query'][_0xe84c('0x41')]){_0x462b12['include']=[{'all':!![]}];}_0x462b12=_[_0xe84c('0x3e')]({},_0x462b12,_0x2bfe07[_0xe84c('0x40')]);return db['AnalyticCustomReport'][_0xe84c('0x48')](_0x462b12)['then'](handleEntityNotFound(_0x27934c,null))[_0xe84c('0x25')](respondWithResult(_0x27934c,null))[_0xe84c('0x49')](handleError(_0x27934c,null));};exports[_0xe84c('0x4a')]=function(_0x12930a,_0xbea67e){return db[_0xe84c('0x2e')]['create'](_0x12930a[_0xe84c('0x4b')],{})[_0xe84c('0x25')](function(_0x3ed0b7){var _0xcab615=_0x12930a[_0xe84c('0x4c')][_0xe84c('0x4d')]({'plain':!![]});if(!_0xcab615)throw new Error(_0xe84c('0x4e'));if(_0xcab615['role']===_0xe84c('0x4c')){var _0x313ba9=_0x3ed0b7[_0xe84c('0x4d')]({'plain':!![]});var _0x46a268=_0xe84c('0x4f');return db[_0xe84c('0x50')][_0xe84c('0x48')]({'where':{'name':_0x46a268,'userProfileId':_0xcab615[_0xe84c('0x51')]},'raw':!![]})['then'](function(_0xb06667){if(_0xb06667&&_0xb06667['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x313ba9['name'],'resourceId':_0x313ba9['id'],'type':'CustomReports','sectionId':_0xb06667['id']},{})[_0xe84c('0x25')](function(){return _0x3ed0b7;});}else{return _0x3ed0b7;}})['catch'](function(_0x1ca4d1){logger[_0xe84c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ca4d1);throw _0x1ca4d1;});}return _0x3ed0b7;})[_0xe84c('0x25')](respondWithResult(_0xbea67e,0xc9))[_0xe84c('0x49')](handleError(_0xbea67e,null));};exports[_0xe84c('0x24')]=function(_0x13dc82,_0x13c615){if(_0x13dc82[_0xe84c('0x4b')]['id']){delete _0x13dc82[_0xe84c('0x4b')]['id'];}return db['AnalyticCustomReport'][_0xe84c('0x48')]({'where':{'id':_0x13dc82[_0xe84c('0x44')]['id']}})[_0xe84c('0x25')](handleEntityNotFound(_0x13c615,null))[_0xe84c('0x25')](saveUpdates(_0x13dc82[_0xe84c('0x4b')],null))[_0xe84c('0x25')](respondWithResult(_0x13c615,null))['catch'](handleError(_0x13c615,null));};exports[_0xe84c('0x52')]=function(_0x19c995,_0x1bb30e){return db[_0xe84c('0x2e')][_0xe84c('0x48')]({'where':{'id':_0x19c995[_0xe84c('0x44')]['id']}})[_0xe84c('0x25')](handleEntityNotFound(_0x1bb30e,null))[_0xe84c('0x25')](removeEntity(_0x1bb30e,null))[_0xe84c('0x49')](handleError(_0x1bb30e,null));};exports[_0xe84c('0x53')]=function(_0x284ad4,_0x4e5167){var _0xed39fa=0xa;var _0x5d2fc5=[_0xe84c('0x54'),_0xe84c('0x55'),_0xe84c('0x56'),_0xe84c('0x57')];var _0x308bd9={'SUM':_0xe84c('0x58'),'COUNT':_0xe84c('0x59'),'COUNT DISTINCT':_0xe84c('0x5a'),'MAX':_0xe84c('0x5b'),'MIN':_0xe84c('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xe84c('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2c19cb={'SEC_TO_TIME':_0xe84c('0x5e'),'DATE':_0xe84c('0x5f'),'HOUR':_0xe84c('0x60'),'ROUND':_0xe84c('0x61'),'UNIX_TIMESTAMP':_0xe84c('0x62')};var _0x4d1cf0=function(_0x1f44aa){return!_[_0xe84c('0x63')]([_0xe84c('0x64'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xe84c('0x65')],_0x1f44aa);};var _0x192aa4=function(_0xb9d316){if(!_0xb9d316||!_0xb9d316[_0xe84c('0x66')]['length']){return'';}for(var _0x38be3d='(',_0x4e0370=0x0;_0x4e0370<_0xb9d316[_0xe84c('0x66')][_0xe84c('0x47')];_0x4e0370+=0x1){_0x4e0370>0x0&&(_0x38be3d+='\x20'+_0xb9d316[_0xe84c('0x67')]+'\x20');_0x38be3d+=_0xb9d316[_0xe84c('0x66')][_0x4e0370][_0xe84c('0x68')]?_0x192aa4(_0xb9d316[_0xe84c('0x66')][_0x4e0370][_0xe84c('0x68')]):_0xb9d316[_0xe84c('0x66')][_0x4e0370][_0xe84c('0x69')]+'\x20'+_0xb9d316[_0xe84c('0x66')][_0x4e0370]['condition']+(_0x4d1cf0(_0xb9d316['rules'][_0x4e0370]['condition'])?'\x20'+_0xb9d316[_0xe84c('0x66')][_0x4e0370][_0xe84c('0x6a')]:'');}return _0x38be3d+')';};var _0x183f22={'where':{'id':_0x284ad4['params']['id']}},_0x2ad669,_0x4c479d,_0x419475,_0x479b54,_0x145783;_0x183f22=_['merge']({},_0x183f22,_0x284ad4[_0xe84c('0x40')]);return db[_0xe84c('0x2e')][_0xe84c('0x48')](_0x183f22)[_0xe84c('0x25')](function(_0x49c675){if(_0x49c675){_0x2ad669=_0x49c675;return _0x49c675['getFields']();}return null;})[_0xe84c('0x25')](function(_0x3d0580){if(_0x3d0580){if(!_0x3d0580[_0xe84c('0x47')]){throw new db[(_0xe84c('0x6b'))][(_0xe84c('0x6c'))](_0xe84c('0x6d'),0x193);}_0x4c479d=_0x3d0580;return db[_0xe84c('0x6e')][_0xe84c('0x42')]({'raw':!![]});}return null;})[_0xe84c('0x25')](function(_0x4873fc){if(_0x4873fc){_0x419475=_[_0xe84c('0x6f')](_0x4873fc,'id');var _0x5adb4c;var _0x4fe9be=squel[_0xe84c('0x70')]();_0x4fe9be[_0xe84c('0x71')](_0x2ad669['table']);for(var _0x535efe=0x0;_0x535efe<_0x4c479d[_0xe84c('0x47')];_0x535efe+=0x1){_0x5adb4c=_0x4c479d[_0x535efe][_0xe84c('0x72')]?_0x419475[_0x4c479d[_0x535efe][_0xe84c('0x72')]]['metric']:_0x4c479d[_0x535efe][_0xe84c('0x69')];_0x5adb4c=_0x4c479d[_0x535efe][_0xe84c('0x73')]?_[_0xe84c('0x74')](_0x308bd9[_0x4c479d[_0x535efe][_0xe84c('0x73')]],'%s',_0x5adb4c):_0x5adb4c;_0x5adb4c=_0x4c479d[_0x535efe][_0xe84c('0x75')]?_[_0xe84c('0x74')](_0x2c19cb[_0x4c479d[_0x535efe]['format']],'%s',_0x5adb4c):_0x5adb4c;if(_0x4c479d[_0x535efe]['groupBy']){_0x4fe9be[_0xe84c('0x68')](_0x5adb4c);}_0x4c479d[_0x535efe][_0xe84c('0x76')]&&_0x4fe9be[_0xe84c('0x3a')](_0x5adb4c,_0x4c479d[_0x535efe][_0xe84c('0x76')]===_0xe84c('0x77')?![]:!![]);_0x4fe9be[_0xe84c('0x69')](_0x5adb4c,_0x4c479d[_0x535efe]['alias']||_0x5adb4c);}if(_0x2ad669['joins']){_0x2ad669[_0xe84c('0x78')]=JSON[_0xe84c('0x79')](_0x2ad669[_0xe84c('0x78')]);for(var _0x1b9378=0x0;_0x1b9378<_0x2ad669[_0xe84c('0x78')]['length'];_0x1b9378+=0x1){if(_0x2ad669[_0xe84c('0x78')][_0x1b9378][_0xe84c('0x30')]&&_[_0xe84c('0x63')](_0x5d2fc5,_0x2ad669['joins'][_0x1b9378][_0xe84c('0x30')])&&_0x2ad669[_0xe84c('0x78')][_0x1b9378][_0xe84c('0x7a')]&&_0x2ad669[_0xe84c('0x78')][_0x1b9378][_0xe84c('0x7b')]&&_0x2ad669['joins'][_0x1b9378][_0xe84c('0x7c')]){_0x4fe9be[_0x2ad669['joins'][_0x1b9378][_0xe84c('0x30')]](_0x2ad669['joins'][_0x1b9378][_0xe84c('0x7b')],null,util[_0xe84c('0x75')](_0xe84c('0x7d'),_0x2ad669['table'],_0x2ad669[_0xe84c('0x78')][_0x1b9378][_0xe84c('0x7a')],_0x2ad669['joins'][_0x1b9378][_0xe84c('0x7b')],_0x2ad669[_0xe84c('0x78')][_0x1b9378]['foreignKey']));}}}if(_0x2ad669[_0xe84c('0x7e')]){_0x2ad669[_0xe84c('0x7e')]=JSON[_0xe84c('0x79')](_0x2ad669['conditions']);_0x4fe9be[_0xe84c('0x3d')](_0x192aa4(_0x2ad669[_0xe84c('0x7e')][_0xe84c('0x68')]));}_0x145783=_0x4fe9be['clone']();_0x4fe9be[_0xe84c('0x39')](_0xed39fa);_0x4fe9be[_0xe84c('0x1d')](0x0);logger[_0xe84c('0x7f')](_0xe84c('0x80'),_0x4fe9be[_0xe84c('0x81')]());return dbH[_0xe84c('0x82')][_0xe84c('0x33')](_0x4fe9be[_0xe84c('0x81')](),{'type':dbH[_0xe84c('0x82')]['QueryTypes'][_0xe84c('0x83')]});}})[_0xe84c('0x25')](respondWithResult(_0x4e5167,null))['catch'](handleError(_0x4e5167,null));};function runReport(_0xed2b2c,_0x5a0ad5,_0x211c4a){var _0x29e1c4=_0x5a0ad5[_0xe84c('0x2a')];var _0x3914ba=0xa;var _0x3285f3=['join',_0xe84c('0x55'),_0xe84c('0x56'),_0xe84c('0x57')];var _0x2479d9={'SUM':'SUM(%s)','COUNT':_0xe84c('0x59'),'COUNT DISTINCT':_0xe84c('0x5a'),'MAX':_0xe84c('0x5b'),'MIN':'MIN(%s)','AVG':_0xe84c('0x84'),'GROUP_CONCAT':_0xe84c('0x5d'),'GROUP_CONCAT ASC':_0xe84c('0x85'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5722fd={'SEC_TO_TIME':_0xe84c('0x5e'),'DATE':_0xe84c('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe84c('0x61'),'UNIX_TIMESTAMP':_0xe84c('0x62')};var _0xa0a884=function(_0x1b7584){return!_[_0xe84c('0x63')]([_0xe84c('0x64'),_0xe84c('0x86'),_0xe84c('0x87'),_0xe84c('0x65')],_0x1b7584);};var _0x43175f=function(_0x5662dd){if(!_0x5662dd||!_0x5662dd[_0xe84c('0x66')][_0xe84c('0x47')]){return'';}for(var _0x43b18c='(',_0x2a8293=0x0;_0x2a8293<_0x5662dd[_0xe84c('0x66')][_0xe84c('0x47')];_0x2a8293+=0x1){_0x2a8293>0x0&&(_0x43b18c+='\x20'+_0x5662dd[_0xe84c('0x67')]+'\x20');_0x43b18c+=_0x5662dd['rules'][_0x2a8293][_0xe84c('0x68')]?_0x43175f(_0x5662dd[_0xe84c('0x66')][_0x2a8293][_0xe84c('0x68')]):_0x5662dd['rules'][_0x2a8293][_0xe84c('0x69')]+'\x20'+_0x5662dd['rules'][_0x2a8293][_0xe84c('0x88')]+(_0xa0a884(_0x5662dd['rules'][_0x2a8293][_0xe84c('0x88')])?'\x20'+_0x5662dd[_0xe84c('0x66')][_0x2a8293][_0xe84c('0x6a')]:'');}return _0x43b18c+')';};var _0x1be935={'where':{'id':_0xed2b2c['id']}},_0x4e8ae1,_0x274e8e,_0x5c3f43,_0x32014d,_0x3aace7;_0x1be935=_[_0xe84c('0x3e')]({},_0x1be935,_0x211c4a);return db[_0xe84c('0x2e')][_0xe84c('0x48')](_0x1be935)[_0xe84c('0x25')](function(_0x4fffd7){if(_0x4fffd7){_0x4e8ae1=_0x4fffd7;return _0x4fffd7['getFields']();}return null;})['then'](function(_0x354cce){if(_0x354cce){if(!_0x354cce['length']){throw new db[(_0xe84c('0x6b'))][(_0xe84c('0x6c'))](_0xe84c('0x6d'),0x193);}_0x274e8e=_0x354cce;return db['AnalyticMetric'][_0xe84c('0x42')]({'raw':!![]});}return null;})['then'](function(_0x3b0659){if(_0x3b0659){_0x5c3f43=_[_0xe84c('0x6f')](_0x3b0659,'id');var _0x41e79e;var _0x5e2b01=squel[_0xe84c('0x70')]();_0x5e2b01[_0xe84c('0x71')](_0x4e8ae1[_0xe84c('0x89')]);for(var _0x543aac=0x0;_0x543aac<_0x274e8e[_0xe84c('0x47')];_0x543aac+=0x1){_0x41e79e=_0x274e8e[_0x543aac][_0xe84c('0x72')]?_0x5c3f43[_0x274e8e[_0x543aac]['MetricId']][_0xe84c('0x8a')]:_0x274e8e[_0x543aac][_0xe84c('0x69')];_0x41e79e=_0x274e8e[_0x543aac][_0xe84c('0x73')]?_['replace'](_0x2479d9[_0x274e8e[_0x543aac][_0xe84c('0x73')]],'%s',_0x41e79e):_0x41e79e;_0x41e79e=_0x274e8e[_0x543aac]['format']?_['replace'](_0x5722fd[_0x274e8e[_0x543aac][_0xe84c('0x75')]],'%s',_0x41e79e):_0x41e79e;if(_0x274e8e[_0x543aac][_0xe84c('0x8b')]){_0x5e2b01['group'](_0x41e79e);}_0x274e8e[_0x543aac][_0xe84c('0x76')]&&_0x5e2b01['order'](_0x41e79e,_0x274e8e[_0x543aac][_0xe84c('0x76')]==='DESC'?![]:!![]);_0x5e2b01[_0xe84c('0x69')](_0x41e79e,_0x274e8e[_0x543aac][_0xe84c('0x8c')]||_0x41e79e);}if(_0x4e8ae1['joins']){_0x4e8ae1[_0xe84c('0x78')]=JSON[_0xe84c('0x79')](_0x4e8ae1[_0xe84c('0x78')]);for(var _0x35c9ed=0x0;_0x35c9ed<_0x4e8ae1[_0xe84c('0x78')][_0xe84c('0x47')];_0x35c9ed+=0x1){if(_0x4e8ae1['joins'][_0x35c9ed][_0xe84c('0x30')]&&_['includes'](_0x3285f3,_0x4e8ae1[_0xe84c('0x78')][_0x35c9ed][_0xe84c('0x30')])&&_0x4e8ae1[_0xe84c('0x78')][_0x35c9ed][_0xe84c('0x7a')]&&_0x4e8ae1['joins'][_0x35c9ed]['foreignTable']&&_0x4e8ae1['joins'][_0x35c9ed]['foreignKey']){_0x5e2b01[_0x4e8ae1[_0xe84c('0x78')][_0x35c9ed][_0xe84c('0x30')]](_0x4e8ae1[_0xe84c('0x78')][_0x35c9ed][_0xe84c('0x7b')],null,util[_0xe84c('0x75')]('%s.%s\x20=\x20%s.%s',_0x4e8ae1[_0xe84c('0x89')],_0x4e8ae1[_0xe84c('0x78')][_0x35c9ed][_0xe84c('0x7a')],_0x4e8ae1[_0xe84c('0x78')][_0x35c9ed][_0xe84c('0x7b')],_0x4e8ae1['joins'][_0x35c9ed][_0xe84c('0x7c')]));}}}if(_0x4e8ae1[_0xe84c('0x7e')]){_0x4e8ae1[_0xe84c('0x7e')]=JSON['parse'](_0x4e8ae1[_0xe84c('0x7e')]);_0x5e2b01['where'](_0x43175f(_0x4e8ae1[_0xe84c('0x7e')][_0xe84c('0x68')]));}_0x3aace7=_0x5e2b01[_0xe84c('0x8d')]();_0x5e2b01[_0xe84c('0x39')](_0x3914ba);_0x5e2b01[_0xe84c('0x1d')](0x0);return;}})[_0xe84c('0x25')](function(){if(_0x5a0ad5[_0xe84c('0x8e')]===_0xe84c('0x8f')){return null;}var _0x5191c1=_[_0xe84c('0x3e')](_0x5a0ad5,{'name':_0x5a0ad5[_0xe84c('0x90')]||_0x5a0ad5[_0xe84c('0x2a')]||_0x4e8ae1['name'],'basename':_0x29e1c4,'savename':util[_0xe84c('0x75')](_0xe84c('0x91'),_0x5a0ad5[_0xe84c('0x2a')]||_0x4e8ae1[_0xe84c('0x2a')],require(_0xe84c('0x92'))[_0xe84c('0x93')](0x4),_0x5a0ad5[_0xe84c('0x8e')]||_0xe84c('0x94')),'reportId':_0x4e8ae1['id'],'reportType':_0xe84c('0x95')});return db['AnalyticExtractedReport']['create'](_0x5191c1,{'raw':!![]});})[_0xe84c('0x25')](function(_0x208b34){if(_0x4e8ae1[_0xe84c('0x89')]==='cdr'){_0x3aace7[_0xe84c('0x3d')](_0x4e8ae1['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5a0ad5[_0xe84c('0x96')],_0x5a0ad5[_0xe84c('0x97')]);}else{_0x3aace7[_0xe84c('0x3d')](_0x4e8ae1[_0xe84c('0x89')]+_0xe84c('0x98'),_0x5a0ad5[_0xe84c('0x96')],_0x5a0ad5[_0xe84c('0x97')]);}if(_0x208b34){logger[_0xe84c('0x99')](_0xe84c('0x9a'),_0x3aace7[_0xe84c('0x81')]());require(_0xe84c('0x9b'))[_0xe84c('0x9c')](path[_0xe84c('0x54')](__dirname,'../../components/export/',_0x208b34[_0xe84c('0x8e')]),[_0x208b34['id'],_0x3aace7[_0xe84c('0x81')](),path[_0xe84c('0x54')](__dirname,_0xe84c('0x9d'),_0x208b34[_0xe84c('0x9e')]),_0x29e1c4]);return _0x208b34;}else{var _0x5253e9=squel[_0xe84c('0x70')]();_0x5253e9[_0xe84c('0x71')]('('+_0x3aace7[_0xe84c('0x81')]()+')',_0xe84c('0x9f'));_0x5253e9[_0xe84c('0x69')](_0xe84c('0xa0'),'count');_0x3aace7[_0xe84c('0x39')](_0x5a0ad5[_0xe84c('0x39')]||_0x3914ba);_0x3aace7[_0xe84c('0x1d')](_0x5a0ad5[_0xe84c('0x1d')]||0x0);return dbH[_0xe84c('0x82')]['query'](_0x5253e9[_0xe84c('0x81')](),{'type':dbH[_0xe84c('0x82')]['QueryTypes'][_0xe84c('0x83')]})[_0xe84c('0x25')](function(_0x4c48d3){if(!_0x4c48d3['length']){_0x32014d=0x0;}else{_0x32014d=_0x4c48d3[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3aace7[_0xe84c('0x81')](),{'type':dbH[_0xe84c('0x82')][_0xe84c('0xa1')]['SELECT']});})[_0xe84c('0x25')](function(_0x52b6f7){return{'rows':_0x52b6f7||[],'count':_0x32014d};});}});}exports['run']=function(_0x3783d4,_0x3c3270){return runReport(_0x3783d4[_0xe84c('0x44')],_0x3783d4[_0xe84c('0x33')],_0x3783d4['options'])[_0xe84c('0x25')](respondWithResult(_0x3c3270,null))[_0xe84c('0x49')](handleError(_0x3c3270,null));};exports[_0xe84c('0xa2')]=runReport;exports['query']=function(_0x178388,_0x3ad8f3){var _0x21aac9=0xa;var _0x2505f9=['join',_0xe84c('0x55'),_0xe84c('0x56'),_0xe84c('0x57')];var _0x5a7823={'SUM':_0xe84c('0x58'),'COUNT':_0xe84c('0x59'),'COUNT DISTINCT':_0xe84c('0x5a'),'MAX':_0xe84c('0x5b'),'MIN':'MIN(%s)','AVG':_0xe84c('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe84c('0x85'),'GROUP_CONCAT DESC':_0xe84c('0xa3')};var _0x2ac654={'SEC_TO_TIME':_0xe84c('0x5e'),'DATE':_0xe84c('0x5f'),'HOUR':_0xe84c('0x60'),'ROUND':_0xe84c('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x239cc9=function(_0x432f6e){return!_['includes']([_0xe84c('0x64'),_0xe84c('0x86'),_0xe84c('0x87'),'IS\x20NOT\x20EMPTY'],_0x432f6e);};var _0x29b5b0=function(_0x118e91){if(!_0x118e91||!_0x118e91[_0xe84c('0x66')][_0xe84c('0x47')]){return'';}for(var _0x33e8c5='(',_0x51b5d9=0x0;_0x51b5d9<_0x118e91[_0xe84c('0x66')][_0xe84c('0x47')];_0x51b5d9+=0x1){_0x51b5d9>0x0&&(_0x33e8c5+='\x20'+_0x118e91[_0xe84c('0x67')]+'\x20');_0x33e8c5+=_0x118e91[_0xe84c('0x66')][_0x51b5d9][_0xe84c('0x68')]?_0x29b5b0(_0x118e91['rules'][_0x51b5d9]['group']):_0x118e91[_0xe84c('0x66')][_0x51b5d9][_0xe84c('0x69')]+'\x20'+_0x118e91[_0xe84c('0x66')][_0x51b5d9][_0xe84c('0x88')]+(_0x239cc9(_0x118e91[_0xe84c('0x66')][_0x51b5d9][_0xe84c('0x88')])?'\x20'+_0x118e91[_0xe84c('0x66')][_0x51b5d9][_0xe84c('0x6a')]:'');}return _0x33e8c5+')';};var _0x416137={'where':{'id':_0x178388[_0xe84c('0x44')]['id']}},_0xc55af3,_0x57ef70,_0x9de037,_0x2907d4,_0x5845f0;_0x416137=_[_0xe84c('0x3e')]({},_0x416137,_0x178388[_0xe84c('0x40')]);return db['AnalyticCustomReport'][_0xe84c('0x48')](_0x416137)[_0xe84c('0x25')](function(_0x1d1854){if(_0x1d1854){_0xc55af3=_0x1d1854;return _0x1d1854['getFields']();}return null;})[_0xe84c('0x25')](function(_0x2fa706){if(_0x2fa706){if(!_0x2fa706[_0xe84c('0x47')]){throw new db[(_0xe84c('0x6b'))][(_0xe84c('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x57ef70=_0x2fa706;return db[_0xe84c('0x6e')][_0xe84c('0x42')]({'raw':!![]});}return null;})[_0xe84c('0x25')](function(_0x11aeba){if(_0x11aeba){_0x9de037=_[_0xe84c('0x6f')](_0x11aeba,'id');var _0x7228e1;var _0x55fbf4=squel['select']();_0x55fbf4[_0xe84c('0x71')](_0xc55af3[_0xe84c('0x89')]);for(var _0x2d6ea3=0x0;_0x2d6ea3<_0x57ef70[_0xe84c('0x47')];_0x2d6ea3+=0x1){_0x7228e1=_0x57ef70[_0x2d6ea3][_0xe84c('0x72')]?_0x9de037[_0x57ef70[_0x2d6ea3][_0xe84c('0x72')]][_0xe84c('0x8a')]:_0x57ef70[_0x2d6ea3]['field'];_0x7228e1=_0x57ef70[_0x2d6ea3]['function']?_[_0xe84c('0x74')](_0x5a7823[_0x57ef70[_0x2d6ea3][_0xe84c('0x73')]],'%s',_0x7228e1):_0x7228e1;_0x7228e1=_0x57ef70[_0x2d6ea3][_0xe84c('0x75')]?_[_0xe84c('0x74')](_0x2ac654[_0x57ef70[_0x2d6ea3]['format']],'%s',_0x7228e1):_0x7228e1;if(_0x57ef70[_0x2d6ea3][_0xe84c('0x8b')]){_0x55fbf4['group'](_0x7228e1);}_0x57ef70[_0x2d6ea3]['orderBy']&&_0x55fbf4[_0xe84c('0x3a')](_0x7228e1,_0x57ef70[_0x2d6ea3][_0xe84c('0x76')]===_0xe84c('0x77')?![]:!![]);_0x55fbf4[_0xe84c('0x69')](_0x7228e1,_0x57ef70[_0x2d6ea3]['alias']||_0x7228e1);}if(_0xc55af3[_0xe84c('0x78')]){_0xc55af3['joins']=JSON[_0xe84c('0x79')](_0xc55af3['joins']);for(var _0x2898e1=0x0;_0x2898e1<_0xc55af3['joins']['length'];_0x2898e1+=0x1){if(_0xc55af3[_0xe84c('0x78')][_0x2898e1][_0xe84c('0x30')]&&_[_0xe84c('0x63')](_0x2505f9,_0xc55af3['joins'][_0x2898e1][_0xe84c('0x30')])&&_0xc55af3[_0xe84c('0x78')][_0x2898e1][_0xe84c('0x7a')]&&_0xc55af3[_0xe84c('0x78')][_0x2898e1][_0xe84c('0x7b')]&&_0xc55af3[_0xe84c('0x78')][_0x2898e1][_0xe84c('0x7c')]){_0x55fbf4[_0xc55af3[_0xe84c('0x78')][_0x2898e1][_0xe84c('0x30')]](_0xc55af3[_0xe84c('0x78')][_0x2898e1][_0xe84c('0x7b')],null,util[_0xe84c('0x75')](_0xe84c('0x7d'),_0xc55af3[_0xe84c('0x89')],_0xc55af3[_0xe84c('0x78')][_0x2898e1][_0xe84c('0x7a')],_0xc55af3['joins'][_0x2898e1][_0xe84c('0x7b')],_0xc55af3[_0xe84c('0x78')][_0x2898e1][_0xe84c('0x7c')]));}}}if(_0xc55af3[_0xe84c('0x7e')]){_0xc55af3[_0xe84c('0x7e')]=JSON['parse'](_0xc55af3[_0xe84c('0x7e')]);_0x55fbf4[_0xe84c('0x3d')](_0x29b5b0(_0xc55af3[_0xe84c('0x7e')][_0xe84c('0x68')]));}_0x5845f0=_0x55fbf4[_0xe84c('0x8d')]();_0x55fbf4[_0xe84c('0x39')](_0x21aac9);_0x55fbf4[_0xe84c('0x1d')](0x0);logger[_0xe84c('0x7f')](_0xe84c('0x80'),_0x55fbf4[_0xe84c('0x81')]());return dbH[_0xe84c('0x82')]['query'](_0x55fbf4[_0xe84c('0x81')](),{'type':dbH[_0xe84c('0x82')][_0xe84c('0xa1')]['SELECT']});}})[_0xe84c('0x25')](function(){return{'sql':_0x5845f0['toString']()};})['then'](respondWithResult(_0x3ad8f3,null))[_0xe84c('0x49')](handleError(_0x3ad8f3,null));}; \ No newline at end of file +var _0xab45=['includes','IS\x20EMPTY','getFields','Sequelize','AnalyticMetric','groupBy','alias','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','ValidationErrorItem','keyBy','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','ejs','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','then','destroy','CustomReports','UserProfileResource','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%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)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','function','replace','format','orderBy','DESC','parse','joins','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','AVG(%s)','DATE(%s)'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0xab45,0xc4));var _0x5ab4=function(_0x2390e5,_0x369025){_0x2390e5=_0x2390e5-0x0;var _0xa6038f=_0xab45[_0x2390e5];return _0xa6038f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ab4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ab4('0x1'));var rp=require(_0x5ab4('0x2'));var moment=require('moment');var BPromise=require(_0x5ab4('0x3'));var Mustache=require(_0x5ab4('0x4'));var util=require('util');var path=require(_0x5ab4('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5ab4('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5ab4('0x7'));var crypto=require(_0x5ab4('0x8'));var jsforce=require(_0x5ab4('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x5ab4('0xa'));var querystring=require(_0x5ab4('0xb'));var Papa=require('papaparse');var Redis=require(_0x5ab4('0xc'));var authService=require(_0x5ab4('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5ab4('0xe'));var hardwareService=require(_0x5ab4('0xf'));var logger=require(_0x5ab4('0x10'))('api');var utils=require(_0x5ab4('0x11'));var config=require(_0x5ab4('0x12'));var licenseUtil=require(_0x5ab4('0x13'));var db=require(_0x5ab4('0x14'))['db'];var dbH=require('../../mysqldb')[_0x5ab4('0x15')];function respondWithStatusCode(_0x17d1c8,_0x14d1d7){_0x14d1d7=_0x14d1d7||0xcc;return function(_0x16ee35){if(_0x16ee35){return _0x17d1c8[_0x5ab4('0x16')](_0x14d1d7);}return _0x17d1c8[_0x5ab4('0x17')](_0x14d1d7)[_0x5ab4('0x18')]();};}function respondWithResult(_0x5dacd8,_0x3d4f92){_0x3d4f92=_0x3d4f92||0xc8;return function(_0x24cac9){if(_0x24cac9){return _0x5dacd8[_0x5ab4('0x17')](_0x3d4f92)[_0x5ab4('0x19')](_0x24cac9);}};}function respondWithFilteredResult(_0x45f7af,_0xeecd5){return function(_0x353845){if(_0x353845){var _0x544b36=typeof _0xeecd5['offset']===_0x5ab4('0x1a')&&typeof _0xeecd5[_0x5ab4('0x1b')]===_0x5ab4('0x1a');var _0x9a0f65=_0x353845['count'];var _0x50142b=_0x544b36?0x0:_0xeecd5[_0x5ab4('0x1c')];var _0x3fa704=_0x544b36?_0x353845['count']:_0xeecd5[_0x5ab4('0x1c')]+_0xeecd5[_0x5ab4('0x1b')];var _0x474935;if(_0x3fa704>=_0x9a0f65){_0x3fa704=_0x9a0f65;_0x474935=0xc8;}else{_0x474935=0xce;}_0x45f7af[_0x5ab4('0x17')](_0x474935);return _0x45f7af[_0x5ab4('0x1d')](_0x5ab4('0x1e'),_0x50142b+'-'+_0x3fa704+'/'+_0x9a0f65)['json'](_0x353845);}return null;};}function patchUpdates(_0x6e51c7){return function(_0x442e85){try{jsonpatch[_0x5ab4('0x1f')](_0x442e85,_0x6e51c7,!![]);}catch(_0x26eb11){return BPromise['reject'](_0x26eb11);}return _0x442e85['save']();};}function saveUpdates(_0x191fc4,_0x5b399b){return function(_0x5f0372){if(_0x5f0372){return _0x5f0372['update'](_0x191fc4)[_0x5ab4('0x20')](function(_0x380ac5){return _0x380ac5;});}return null;};}function removeEntity(_0x47f43d,_0x4c4e6e){return function(_0x27532a){if(_0x27532a){return _0x27532a[_0x5ab4('0x21')]()[_0x5ab4('0x20')](function(){var _0x45b9ee=_0x27532a['get']({'plain':!![]});var _0x472c6f=_0x5ab4('0x22');return db[_0x5ab4('0x23')][_0x5ab4('0x21')]({'where':{'type':_0x472c6f,'resourceId':_0x45b9ee['id']}})[_0x5ab4('0x20')](function(){return _0x27532a;});})[_0x5ab4('0x20')](function(){_0x47f43d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35da55,_0x40700e){return function(_0x61178c){if(!_0x61178c){_0x35da55[_0x5ab4('0x16')](0x194);}return _0x61178c;};}function handleError(_0x1bc612,_0x536bd8){_0x536bd8=_0x536bd8||0x1f4;return function(_0x5b8b27){logger[_0x5ab4('0x24')](_0x5b8b27['stack']);if(_0x5b8b27[_0x5ab4('0x25')]){delete _0x5b8b27[_0x5ab4('0x25')];}_0x1bc612['status'](_0x536bd8)[_0x5ab4('0x26')](_0x5b8b27);};}exports[_0x5ab4('0x27')]=function(_0x4ad93f,_0xb5e069){var _0xec2eae={},_0x5eae1b={},_0x429f3b={'count':0x0,'rows':[]};var _0x2d7b9a=_[_0x5ab4('0x28')](db[_0x5ab4('0x29')][_0x5ab4('0x2a')],function(_0x5337f9){return{'name':_0x5337f9[_0x5ab4('0x2b')],'type':_0x5337f9[_0x5ab4('0x2c')]['key']};});_0x5eae1b[_0x5ab4('0x2d')]=_[_0x5ab4('0x28')](_0x2d7b9a,_0x5ab4('0x25'));_0x5eae1b[_0x5ab4('0x2e')]=_['keys'](_0x4ad93f[_0x5ab4('0x2e')]);_0x5eae1b['filters']=_[_0x5ab4('0x2f')](_0x5eae1b[_0x5ab4('0x2d')],_0x5eae1b[_0x5ab4('0x2e')]);_0xec2eae[_0x5ab4('0x30')]=_['intersection'](_0x5eae1b[_0x5ab4('0x2d')],qs['fields'](_0x4ad93f['query'][_0x5ab4('0x31')]));_0xec2eae[_0x5ab4('0x30')]=_0xec2eae[_0x5ab4('0x30')][_0x5ab4('0x32')]?_0xec2eae[_0x5ab4('0x30')]:_0x5eae1b[_0x5ab4('0x2d')];if(!_0x4ad93f[_0x5ab4('0x2e')][_0x5ab4('0x33')](_0x5ab4('0x34'))){_0xec2eae[_0x5ab4('0x1b')]=qs[_0x5ab4('0x1b')](_0x4ad93f[_0x5ab4('0x2e')][_0x5ab4('0x1b')]);_0xec2eae[_0x5ab4('0x1c')]=qs[_0x5ab4('0x1c')](_0x4ad93f[_0x5ab4('0x2e')]['offset']);}_0xec2eae[_0x5ab4('0x35')]=qs['sort'](_0x4ad93f[_0x5ab4('0x2e')][_0x5ab4('0x36')]);_0xec2eae['where']=qs[_0x5ab4('0x37')](_[_0x5ab4('0x38')](_0x4ad93f['query'],_0x5eae1b[_0x5ab4('0x37')]),_0x2d7b9a);if(_0x4ad93f['query'][_0x5ab4('0x39')]){_0xec2eae[_0x5ab4('0x3a')]=_[_0x5ab4('0x3b')](_0xec2eae[_0x5ab4('0x3a')],{'$or':_['map'](_0x2d7b9a,function(_0x2f3bfd){if(_0x2f3bfd[_0x5ab4('0x2c')]!==_0x5ab4('0x3c')){var _0x515869={};_0x515869[_0x2f3bfd[_0x5ab4('0x25')]]={'$like':'%'+_0x4ad93f[_0x5ab4('0x2e')][_0x5ab4('0x39')]+'%'};return _0x515869;}})});}_0xec2eae=_['merge']({},_0xec2eae,_0x4ad93f[_0x5ab4('0x3d')]);var _0x4c8d28={'where':_0xec2eae[_0x5ab4('0x3a')]};return db['AnalyticCustomReport']['count'](_0x4c8d28)[_0x5ab4('0x20')](function(_0x2bc1a0){_0x429f3b[_0x5ab4('0x3e')]=_0x2bc1a0;if(_0x4ad93f[_0x5ab4('0x2e')][_0x5ab4('0x3f')]){_0xec2eae[_0x5ab4('0x40')]=[{'all':!![]}];}return db[_0x5ab4('0x29')][_0x5ab4('0x41')](_0xec2eae);})[_0x5ab4('0x20')](function(_0x649a0e){_0x429f3b[_0x5ab4('0x42')]=_0x649a0e;return _0x429f3b;})['then'](respondWithFilteredResult(_0xb5e069,_0xec2eae))[_0x5ab4('0x43')](handleError(_0xb5e069,null));};exports[_0x5ab4('0x44')]=function(_0x12c8dd,_0x1db71d){var _0x19032c={'raw':![],'where':{'id':_0x12c8dd[_0x5ab4('0x45')]['id']}},_0x5e2423={};_0x5e2423[_0x5ab4('0x2d')]=_[_0x5ab4('0x46')](db[_0x5ab4('0x29')]['rawAttributes']);_0x5e2423[_0x5ab4('0x2e')]=_['keys'](_0x12c8dd['query']);_0x5e2423[_0x5ab4('0x37')]=_[_0x5ab4('0x2f')](_0x5e2423[_0x5ab4('0x2d')],_0x5e2423['query']);_0x19032c[_0x5ab4('0x30')]=_[_0x5ab4('0x2f')](_0x5e2423[_0x5ab4('0x2d')],qs[_0x5ab4('0x31')](_0x12c8dd[_0x5ab4('0x2e')][_0x5ab4('0x31')]));_0x19032c[_0x5ab4('0x30')]=_0x19032c['attributes']['length']?_0x19032c[_0x5ab4('0x30')]:_0x5e2423[_0x5ab4('0x2d')];if(_0x12c8dd[_0x5ab4('0x2e')][_0x5ab4('0x3f')]){_0x19032c['include']=[{'all':!![]}];}_0x19032c=_['merge']({},_0x19032c,_0x12c8dd[_0x5ab4('0x3d')]);return db[_0x5ab4('0x29')][_0x5ab4('0x47')](_0x19032c)[_0x5ab4('0x20')](handleEntityNotFound(_0x1db71d,null))[_0x5ab4('0x20')](respondWithResult(_0x1db71d,null))[_0x5ab4('0x43')](handleError(_0x1db71d,null));};exports[_0x5ab4('0x48')]=function(_0x277e5f,_0x4e1a1b){return db[_0x5ab4('0x29')][_0x5ab4('0x48')](_0x277e5f[_0x5ab4('0x49')],{})[_0x5ab4('0x20')](function(_0x6b6499){var _0x2d64d6=_0x277e5f[_0x5ab4('0x4a')][_0x5ab4('0x4b')]({'plain':!![]});if(!_0x2d64d6)throw new Error(_0x5ab4('0x4c'));if(_0x2d64d6[_0x5ab4('0x4d')]==='user'){var _0x35128e=_0x6b6499[_0x5ab4('0x4b')]({'plain':!![]});var _0x2d7c3f=_0x5ab4('0x4e');return db[_0x5ab4('0x4f')]['find']({'where':{'name':_0x2d7c3f,'userProfileId':_0x2d64d6[_0x5ab4('0x50')]},'raw':!![]})[_0x5ab4('0x20')](function(_0x263f79){if(_0x263f79&&_0x263f79[_0x5ab4('0x51')]===0x0){return db[_0x5ab4('0x23')][_0x5ab4('0x48')]({'name':_0x35128e['name'],'resourceId':_0x35128e['id'],'type':_0x5ab4('0x22'),'sectionId':_0x263f79['id']},{})[_0x5ab4('0x20')](function(){return _0x6b6499;});}else{return _0x6b6499;}})[_0x5ab4('0x43')](function(_0x234b1d){logger[_0x5ab4('0x24')](_0x5ab4('0x52'),_0x234b1d);throw _0x234b1d;});}return _0x6b6499;})[_0x5ab4('0x20')](respondWithResult(_0x4e1a1b,0xc9))[_0x5ab4('0x43')](handleError(_0x4e1a1b,null));};exports['update']=function(_0x36e824,_0x565ffa){if(_0x36e824['body']['id']){delete _0x36e824[_0x5ab4('0x49')]['id'];}return db[_0x5ab4('0x29')][_0x5ab4('0x47')]({'where':{'id':_0x36e824[_0x5ab4('0x45')]['id']}})[_0x5ab4('0x20')](handleEntityNotFound(_0x565ffa,null))[_0x5ab4('0x20')](saveUpdates(_0x36e824['body'],null))['then'](respondWithResult(_0x565ffa,null))[_0x5ab4('0x43')](handleError(_0x565ffa,null));};exports[_0x5ab4('0x21')]=function(_0x3d4142,_0x53887c){return db['AnalyticCustomReport'][_0x5ab4('0x47')]({'where':{'id':_0x3d4142['params']['id']}})[_0x5ab4('0x20')](handleEntityNotFound(_0x53887c,null))[_0x5ab4('0x20')](removeEntity(_0x53887c,null))[_0x5ab4('0x43')](handleError(_0x53887c,null));};exports[_0x5ab4('0x53')]=function(_0x3b8d7b,_0x19de8e){var _0x4aa97e=0xa;var _0xcc129=[_0x5ab4('0x54'),_0x5ab4('0x55'),_0x5ab4('0x56'),_0x5ab4('0x57')];var _0x557b13={'SUM':_0x5ab4('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5ab4('0x59'),'MAX':_0x5ab4('0x5a'),'MIN':_0x5ab4('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5ab4('0x5c'),'GROUP_CONCAT ASC':_0x5ab4('0x5d'),'GROUP_CONCAT DESC':_0x5ab4('0x5e')};var _0x19a63b={'SEC_TO_TIME':_0x5ab4('0x5f'),'DATE':'DATE(%s)','HOUR':_0x5ab4('0x60'),'ROUND':_0x5ab4('0x61'),'UNIX_TIMESTAMP':_0x5ab4('0x62')};var _0x52c74f=function(_0x54c83e){return!_['includes']([_0x5ab4('0x63'),_0x5ab4('0x64'),'IS\x20EMPTY',_0x5ab4('0x65')],_0x54c83e);};var _0x20a7e0=function(_0x23b151){if(!_0x23b151||!_0x23b151['rules'][_0x5ab4('0x32')]){return'';}for(var _0x36f700='(',_0x3adb3f=0x0;_0x3adb3f<_0x23b151[_0x5ab4('0x66')][_0x5ab4('0x32')];_0x3adb3f+=0x1){_0x3adb3f>0x0&&(_0x36f700+='\x20'+_0x23b151[_0x5ab4('0x67')]+'\x20');_0x36f700+=_0x23b151[_0x5ab4('0x66')][_0x3adb3f][_0x5ab4('0x68')]?_0x20a7e0(_0x23b151[_0x5ab4('0x66')][_0x3adb3f][_0x5ab4('0x68')]):_0x23b151[_0x5ab4('0x66')][_0x3adb3f][_0x5ab4('0x69')]+'\x20'+_0x23b151['rules'][_0x3adb3f]['condition']+(_0x52c74f(_0x23b151['rules'][_0x3adb3f][_0x5ab4('0x6a')])?'\x20'+_0x23b151[_0x5ab4('0x66')][_0x3adb3f][_0x5ab4('0x6b')]:'');}return _0x36f700+')';};var _0x313469={'where':{'id':_0x3b8d7b[_0x5ab4('0x45')]['id']}},_0x2fc07f,_0x1fe3e4,_0x54bec4,_0x37a0db,_0x3e4391;_0x313469=_['merge']({},_0x313469,_0x3b8d7b['options']);return db[_0x5ab4('0x29')][_0x5ab4('0x47')](_0x313469)[_0x5ab4('0x20')](function(_0x546c2d){if(_0x546c2d){_0x2fc07f=_0x546c2d;return _0x546c2d['getFields']();}return null;})[_0x5ab4('0x20')](function(_0x1facea){if(_0x1facea){if(!_0x1facea[_0x5ab4('0x32')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5ab4('0x6c'),0x193);}_0x1fe3e4=_0x1facea;return db['AnalyticMetric'][_0x5ab4('0x41')]({'raw':!![]});}return null;})[_0x5ab4('0x20')](function(_0x386ab2){if(_0x386ab2){_0x54bec4=_['keyBy'](_0x386ab2,'id');var _0x17ce8e;var _0x3cf72d=squel[_0x5ab4('0x6d')]();_0x3cf72d[_0x5ab4('0x6e')](_0x2fc07f[_0x5ab4('0x6f')]);for(var _0x20f668=0x0;_0x20f668<_0x1fe3e4[_0x5ab4('0x32')];_0x20f668+=0x1){_0x17ce8e=_0x1fe3e4[_0x20f668]['MetricId']?_0x54bec4[_0x1fe3e4[_0x20f668][_0x5ab4('0x70')]]['metric']:_0x1fe3e4[_0x20f668][_0x5ab4('0x69')];_0x17ce8e=_0x1fe3e4[_0x20f668][_0x5ab4('0x71')]?_[_0x5ab4('0x72')](_0x557b13[_0x1fe3e4[_0x20f668][_0x5ab4('0x71')]],'%s',_0x17ce8e):_0x17ce8e;_0x17ce8e=_0x1fe3e4[_0x20f668][_0x5ab4('0x73')]?_[_0x5ab4('0x72')](_0x19a63b[_0x1fe3e4[_0x20f668]['format']],'%s',_0x17ce8e):_0x17ce8e;if(_0x1fe3e4[_0x20f668]['groupBy']){_0x3cf72d[_0x5ab4('0x68')](_0x17ce8e);}_0x1fe3e4[_0x20f668]['orderBy']&&_0x3cf72d['order'](_0x17ce8e,_0x1fe3e4[_0x20f668][_0x5ab4('0x74')]===_0x5ab4('0x75')?![]:!![]);_0x3cf72d['field'](_0x17ce8e,_0x1fe3e4[_0x20f668]['alias']||_0x17ce8e);}if(_0x2fc07f['joins']){_0x2fc07f['joins']=JSON[_0x5ab4('0x76')](_0x2fc07f[_0x5ab4('0x77')]);for(var _0x158299=0x0;_0x158299<_0x2fc07f[_0x5ab4('0x77')][_0x5ab4('0x32')];_0x158299+=0x1){if(_0x2fc07f[_0x5ab4('0x77')][_0x158299]['type']&&_['includes'](_0xcc129,_0x2fc07f['joins'][_0x158299]['type'])&&_0x2fc07f[_0x5ab4('0x77')][_0x158299]['parentKey']&&_0x2fc07f['joins'][_0x158299][_0x5ab4('0x78')]&&_0x2fc07f[_0x5ab4('0x77')][_0x158299]['foreignKey']){_0x3cf72d[_0x2fc07f[_0x5ab4('0x77')][_0x158299]['type']](_0x2fc07f[_0x5ab4('0x77')][_0x158299][_0x5ab4('0x78')],null,util[_0x5ab4('0x73')](_0x5ab4('0x79'),_0x2fc07f['table'],_0x2fc07f[_0x5ab4('0x77')][_0x158299][_0x5ab4('0x7a')],_0x2fc07f[_0x5ab4('0x77')][_0x158299][_0x5ab4('0x78')],_0x2fc07f[_0x5ab4('0x77')][_0x158299]['foreignKey']));}}}if(_0x2fc07f[_0x5ab4('0x7b')]){_0x2fc07f[_0x5ab4('0x7b')]=JSON[_0x5ab4('0x76')](_0x2fc07f[_0x5ab4('0x7b')]);_0x3cf72d[_0x5ab4('0x3a')](_0x20a7e0(_0x2fc07f[_0x5ab4('0x7b')][_0x5ab4('0x68')]));}_0x3e4391=_0x3cf72d[_0x5ab4('0x7c')]();_0x3cf72d['limit'](_0x4aa97e);_0x3cf72d[_0x5ab4('0x1c')](0x0);logger[_0x5ab4('0x7d')](_0x5ab4('0x7e'),_0x3cf72d['toString']());return dbH[_0x5ab4('0x7f')][_0x5ab4('0x2e')](_0x3cf72d[_0x5ab4('0x80')](),{'type':dbH[_0x5ab4('0x7f')][_0x5ab4('0x81')][_0x5ab4('0x82')]});}})['then'](respondWithResult(_0x19de8e,null))[_0x5ab4('0x43')](handleError(_0x19de8e,null));};function runReport(_0x5a86ea,_0x1c425d,_0xc78139){var _0x465548=_0x1c425d[_0x5ab4('0x25')];var _0x2c9fe6=0xa;var _0x107eec=[_0x5ab4('0x54'),_0x5ab4('0x55'),_0x5ab4('0x56'),_0x5ab4('0x57')];var _0x32c658={'SUM':_0x5ab4('0x58'),'COUNT':_0x5ab4('0x83'),'COUNT DISTINCT':_0x5ab4('0x59'),'MAX':'MAX(%s)','MIN':_0x5ab4('0x5b'),'AVG':_0x5ab4('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5ab4('0x5d'),'GROUP_CONCAT DESC':_0x5ab4('0x5e')};var _0x1a8e3d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5ab4('0x85'),'HOUR':_0x5ab4('0x60'),'ROUND':_0x5ab4('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2fe304=function(_0x624c5c){return!_[_0x5ab4('0x86')]([_0x5ab4('0x63'),'IS\x20NOT\x20NULL',_0x5ab4('0x87'),'IS\x20NOT\x20EMPTY'],_0x624c5c);};var _0x51d37e=function(_0x4f3904){if(!_0x4f3904||!_0x4f3904[_0x5ab4('0x66')][_0x5ab4('0x32')]){return'';}for(var _0x1529a8='(',_0x541c3d=0x0;_0x541c3d<_0x4f3904[_0x5ab4('0x66')]['length'];_0x541c3d+=0x1){_0x541c3d>0x0&&(_0x1529a8+='\x20'+_0x4f3904['operator']+'\x20');_0x1529a8+=_0x4f3904['rules'][_0x541c3d][_0x5ab4('0x68')]?_0x51d37e(_0x4f3904[_0x5ab4('0x66')][_0x541c3d][_0x5ab4('0x68')]):_0x4f3904[_0x5ab4('0x66')][_0x541c3d][_0x5ab4('0x69')]+'\x20'+_0x4f3904['rules'][_0x541c3d][_0x5ab4('0x6a')]+(_0x2fe304(_0x4f3904[_0x5ab4('0x66')][_0x541c3d]['condition'])?'\x20'+_0x4f3904[_0x5ab4('0x66')][_0x541c3d][_0x5ab4('0x6b')]:'');}return _0x1529a8+')';};var _0x10197e={'where':{'id':_0x5a86ea['id']}},_0x2be2fe,_0x47704a,_0x19435f,_0x10e0b9,_0x588b97;_0x10197e=_[_0x5ab4('0x3b')]({},_0x10197e,_0xc78139);return db[_0x5ab4('0x29')][_0x5ab4('0x47')](_0x10197e)[_0x5ab4('0x20')](function(_0x119885){if(_0x119885){_0x2be2fe=_0x119885;return _0x119885[_0x5ab4('0x88')]();}return null;})[_0x5ab4('0x20')](function(_0x4c55e5){if(_0x4c55e5){if(!_0x4c55e5[_0x5ab4('0x32')]){throw new db[(_0x5ab4('0x89'))]['ValidationErrorItem'](_0x5ab4('0x6c'),0x193);}_0x47704a=_0x4c55e5;return db[_0x5ab4('0x8a')][_0x5ab4('0x41')]({'raw':!![]});}return null;})[_0x5ab4('0x20')](function(_0x48435f){if(_0x48435f){_0x19435f=_['keyBy'](_0x48435f,'id');var _0x389a81;var _0x4cc4e0=squel[_0x5ab4('0x6d')]();_0x4cc4e0['from'](_0x2be2fe[_0x5ab4('0x6f')]);for(var _0x4d01da=0x0;_0x4d01da<_0x47704a[_0x5ab4('0x32')];_0x4d01da+=0x1){_0x389a81=_0x47704a[_0x4d01da][_0x5ab4('0x70')]?_0x19435f[_0x47704a[_0x4d01da][_0x5ab4('0x70')]]['metric']:_0x47704a[_0x4d01da]['field'];_0x389a81=_0x47704a[_0x4d01da][_0x5ab4('0x71')]?_['replace'](_0x32c658[_0x47704a[_0x4d01da]['function']],'%s',_0x389a81):_0x389a81;_0x389a81=_0x47704a[_0x4d01da]['format']?_['replace'](_0x1a8e3d[_0x47704a[_0x4d01da][_0x5ab4('0x73')]],'%s',_0x389a81):_0x389a81;if(_0x47704a[_0x4d01da][_0x5ab4('0x8b')]){_0x4cc4e0[_0x5ab4('0x68')](_0x389a81);}_0x47704a[_0x4d01da]['orderBy']&&_0x4cc4e0[_0x5ab4('0x35')](_0x389a81,_0x47704a[_0x4d01da][_0x5ab4('0x74')]===_0x5ab4('0x75')?![]:!![]);_0x4cc4e0['field'](_0x389a81,_0x47704a[_0x4d01da][_0x5ab4('0x8c')]||_0x389a81);}if(_0x2be2fe[_0x5ab4('0x77')]){_0x2be2fe[_0x5ab4('0x77')]=JSON[_0x5ab4('0x76')](_0x2be2fe['joins']);for(var _0x63b9e0=0x0;_0x63b9e0<_0x2be2fe[_0x5ab4('0x77')][_0x5ab4('0x32')];_0x63b9e0+=0x1){if(_0x2be2fe['joins'][_0x63b9e0][_0x5ab4('0x2c')]&&_[_0x5ab4('0x86')](_0x107eec,_0x2be2fe[_0x5ab4('0x77')][_0x63b9e0][_0x5ab4('0x2c')])&&_0x2be2fe[_0x5ab4('0x77')][_0x63b9e0][_0x5ab4('0x7a')]&&_0x2be2fe[_0x5ab4('0x77')][_0x63b9e0][_0x5ab4('0x78')]&&_0x2be2fe[_0x5ab4('0x77')][_0x63b9e0][_0x5ab4('0x8d')]){_0x4cc4e0[_0x2be2fe[_0x5ab4('0x77')][_0x63b9e0][_0x5ab4('0x2c')]](_0x2be2fe[_0x5ab4('0x77')][_0x63b9e0][_0x5ab4('0x78')],null,util['format'](_0x5ab4('0x79'),_0x2be2fe['table'],_0x2be2fe['joins'][_0x63b9e0][_0x5ab4('0x7a')],_0x2be2fe[_0x5ab4('0x77')][_0x63b9e0][_0x5ab4('0x78')],_0x2be2fe[_0x5ab4('0x77')][_0x63b9e0][_0x5ab4('0x8d')]));}}}if(_0x2be2fe[_0x5ab4('0x7b')]){_0x2be2fe['conditions']=JSON['parse'](_0x2be2fe[_0x5ab4('0x7b')]);_0x4cc4e0['where'](_0x51d37e(_0x2be2fe[_0x5ab4('0x7b')][_0x5ab4('0x68')]));}_0x588b97=_0x4cc4e0[_0x5ab4('0x7c')]();_0x4cc4e0['limit'](_0x2c9fe6);_0x4cc4e0[_0x5ab4('0x1c')](0x0);return;}})[_0x5ab4('0x20')](function(){if(_0x1c425d[_0x5ab4('0x8e')]===_0x5ab4('0x8f')){return null;}var _0x3de513=_['merge'](_0x1c425d,{'name':_0x1c425d[_0x5ab4('0x90')]||_0x1c425d[_0x5ab4('0x25')]||_0x2be2fe[_0x5ab4('0x25')],'basename':_0x465548,'savename':util[_0x5ab4('0x73')](_0x5ab4('0x91'),_0x1c425d[_0x5ab4('0x25')]||_0x2be2fe[_0x5ab4('0x25')],require(_0x5ab4('0x92'))[_0x5ab4('0x93')](0x4),_0x1c425d[_0x5ab4('0x8e')]||_0x5ab4('0x94')),'reportId':_0x2be2fe['id'],'reportType':_0x5ab4('0x95')});return db['AnalyticExtractedReport']['create'](_0x3de513,{'raw':!![]});})[_0x5ab4('0x20')](function(_0x537ede){if(_0x2be2fe[_0x5ab4('0x6f')]===_0x5ab4('0x96')){_0x588b97[_0x5ab4('0x3a')](_0x2be2fe[_0x5ab4('0x6f')]+_0x5ab4('0x97'),_0x1c425d['startDate'],_0x1c425d[_0x5ab4('0x98')]);}else{_0x588b97[_0x5ab4('0x3a')](_0x2be2fe['table']+_0x5ab4('0x99'),_0x1c425d['startDate'],_0x1c425d['endDate']);}if(_0x537ede){logger[_0x5ab4('0x9a')](_0x5ab4('0x9b'),_0x588b97[_0x5ab4('0x80')]());require(_0x5ab4('0x9c'))[_0x5ab4('0x9d')](path[_0x5ab4('0x54')](__dirname,_0x5ab4('0x9e'),_0x537ede[_0x5ab4('0x8e')]),[_0x537ede['id'],_0x588b97['toString'](),path[_0x5ab4('0x54')](__dirname,_0x5ab4('0x9f'),_0x537ede[_0x5ab4('0xa0')]),_0x465548]);return _0x537ede;}else{var _0x3385e5=squel[_0x5ab4('0x6d')]();_0x3385e5[_0x5ab4('0x6e')]('('+_0x588b97[_0x5ab4('0x80')]()+')',_0x5ab4('0xa1'));_0x3385e5[_0x5ab4('0x69')](_0x5ab4('0xa2'),_0x5ab4('0x3e'));_0x588b97[_0x5ab4('0x1b')](_0x1c425d[_0x5ab4('0x1b')]||_0x2c9fe6);_0x588b97[_0x5ab4('0x1c')](_0x1c425d[_0x5ab4('0x1c')]||0x0);return dbH['sequelize'][_0x5ab4('0x2e')](_0x3385e5[_0x5ab4('0x80')](),{'type':dbH[_0x5ab4('0x7f')]['QueryTypes'][_0x5ab4('0x82')]})[_0x5ab4('0x20')](function(_0x4b14ba){if(!_0x4b14ba['length']){_0x10e0b9=0x0;}else{_0x10e0b9=_0x4b14ba[0x0][_0x5ab4('0x3e')]||0x0;}return dbH[_0x5ab4('0x7f')][_0x5ab4('0x2e')](_0x588b97['toString'](),{'type':dbH[_0x5ab4('0x7f')][_0x5ab4('0x81')]['SELECT']});})[_0x5ab4('0x20')](function(_0xf31538){return{'rows':_0xf31538||[],'count':_0x10e0b9};});}});}exports['run']=function(_0x7cc095,_0x51bbc7){return runReport(_0x7cc095[_0x5ab4('0x45')],_0x7cc095[_0x5ab4('0x2e')],_0x7cc095[_0x5ab4('0x3d')])['then'](respondWithResult(_0x51bbc7,null))['catch'](handleError(_0x51bbc7,null));};exports['runReport']=runReport;exports[_0x5ab4('0x2e')]=function(_0x296845,_0x2b3b34){var _0x569d86=0xa;var _0x103eb4=[_0x5ab4('0x54'),_0x5ab4('0x55'),'right_join',_0x5ab4('0x57')];var _0x359053={'SUM':_0x5ab4('0x58'),'COUNT':_0x5ab4('0x83'),'COUNT DISTINCT':_0x5ab4('0x59'),'MAX':_0x5ab4('0x5a'),'MIN':'MIN(%s)','AVG':_0x5ab4('0x84'),'GROUP_CONCAT':_0x5ab4('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x5ab4('0x5e')};var _0x87b342={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x5ab4('0x60'),'ROUND':_0x5ab4('0x61'),'UNIX_TIMESTAMP':_0x5ab4('0x62')};var _0x1345a4=function(_0x302bac){return!_[_0x5ab4('0x86')]([_0x5ab4('0x63'),_0x5ab4('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x302bac);};var _0x5ce35a=function(_0x2213fa){if(!_0x2213fa||!_0x2213fa['rules']['length']){return'';}for(var _0x15ce77='(',_0x1bc843=0x0;_0x1bc843<_0x2213fa[_0x5ab4('0x66')][_0x5ab4('0x32')];_0x1bc843+=0x1){_0x1bc843>0x0&&(_0x15ce77+='\x20'+_0x2213fa[_0x5ab4('0x67')]+'\x20');_0x15ce77+=_0x2213fa['rules'][_0x1bc843][_0x5ab4('0x68')]?_0x5ce35a(_0x2213fa[_0x5ab4('0x66')][_0x1bc843][_0x5ab4('0x68')]):_0x2213fa['rules'][_0x1bc843][_0x5ab4('0x69')]+'\x20'+_0x2213fa[_0x5ab4('0x66')][_0x1bc843][_0x5ab4('0x6a')]+(_0x1345a4(_0x2213fa[_0x5ab4('0x66')][_0x1bc843]['condition'])?'\x20'+_0x2213fa[_0x5ab4('0x66')][_0x1bc843][_0x5ab4('0x6b')]:'');}return _0x15ce77+')';};var _0x24133c={'where':{'id':_0x296845['params']['id']}},_0x5dae00,_0xbf411d,_0x42c35d,_0x130941,_0x1ab612;_0x24133c=_[_0x5ab4('0x3b')]({},_0x24133c,_0x296845['options']);return db[_0x5ab4('0x29')][_0x5ab4('0x47')](_0x24133c)[_0x5ab4('0x20')](function(_0x1f0585){if(_0x1f0585){_0x5dae00=_0x1f0585;return _0x1f0585[_0x5ab4('0x88')]();}return null;})[_0x5ab4('0x20')](function(_0x3cec3c){if(_0x3cec3c){if(!_0x3cec3c[_0x5ab4('0x32')]){throw new db[(_0x5ab4('0x89'))][(_0x5ab4('0xa3'))](_0x5ab4('0x6c'),0x193);}_0xbf411d=_0x3cec3c;return db['AnalyticMetric'][_0x5ab4('0x41')]({'raw':!![]});}return null;})['then'](function(_0x356c06){if(_0x356c06){_0x42c35d=_[_0x5ab4('0xa4')](_0x356c06,'id');var _0x331181;var _0x221d2f=squel[_0x5ab4('0x6d')]();_0x221d2f['from'](_0x5dae00['table']);for(var _0x2cde90=0x0;_0x2cde90<_0xbf411d[_0x5ab4('0x32')];_0x2cde90+=0x1){_0x331181=_0xbf411d[_0x2cde90]['MetricId']?_0x42c35d[_0xbf411d[_0x2cde90][_0x5ab4('0x70')]]['metric']:_0xbf411d[_0x2cde90][_0x5ab4('0x69')];_0x331181=_0xbf411d[_0x2cde90][_0x5ab4('0x71')]?_['replace'](_0x359053[_0xbf411d[_0x2cde90]['function']],'%s',_0x331181):_0x331181;_0x331181=_0xbf411d[_0x2cde90][_0x5ab4('0x73')]?_[_0x5ab4('0x72')](_0x87b342[_0xbf411d[_0x2cde90]['format']],'%s',_0x331181):_0x331181;if(_0xbf411d[_0x2cde90]['groupBy']){_0x221d2f[_0x5ab4('0x68')](_0x331181);}_0xbf411d[_0x2cde90][_0x5ab4('0x74')]&&_0x221d2f[_0x5ab4('0x35')](_0x331181,_0xbf411d[_0x2cde90][_0x5ab4('0x74')]===_0x5ab4('0x75')?![]:!![]);_0x221d2f[_0x5ab4('0x69')](_0x331181,_0xbf411d[_0x2cde90][_0x5ab4('0x8c')]||_0x331181);}if(_0x5dae00['joins']){_0x5dae00[_0x5ab4('0x77')]=JSON[_0x5ab4('0x76')](_0x5dae00['joins']);for(var _0x58b8e2=0x0;_0x58b8e2<_0x5dae00[_0x5ab4('0x77')]['length'];_0x58b8e2+=0x1){if(_0x5dae00[_0x5ab4('0x77')][_0x58b8e2][_0x5ab4('0x2c')]&&_[_0x5ab4('0x86')](_0x103eb4,_0x5dae00[_0x5ab4('0x77')][_0x58b8e2][_0x5ab4('0x2c')])&&_0x5dae00[_0x5ab4('0x77')][_0x58b8e2][_0x5ab4('0x7a')]&&_0x5dae00[_0x5ab4('0x77')][_0x58b8e2][_0x5ab4('0x78')]&&_0x5dae00[_0x5ab4('0x77')][_0x58b8e2][_0x5ab4('0x8d')]){_0x221d2f[_0x5dae00[_0x5ab4('0x77')][_0x58b8e2][_0x5ab4('0x2c')]](_0x5dae00[_0x5ab4('0x77')][_0x58b8e2][_0x5ab4('0x78')],null,util[_0x5ab4('0x73')]('%s.%s\x20=\x20%s.%s',_0x5dae00['table'],_0x5dae00[_0x5ab4('0x77')][_0x58b8e2][_0x5ab4('0x7a')],_0x5dae00['joins'][_0x58b8e2][_0x5ab4('0x78')],_0x5dae00[_0x5ab4('0x77')][_0x58b8e2][_0x5ab4('0x8d')]));}}}if(_0x5dae00[_0x5ab4('0x7b')]){_0x5dae00[_0x5ab4('0x7b')]=JSON['parse'](_0x5dae00['conditions']);_0x221d2f['where'](_0x5ce35a(_0x5dae00[_0x5ab4('0x7b')][_0x5ab4('0x68')]));}_0x1ab612=_0x221d2f[_0x5ab4('0x7c')]();_0x221d2f[_0x5ab4('0x1b')](_0x569d86);_0x221d2f[_0x5ab4('0x1c')](0x0);logger['debug']('Limited\x20Query:',_0x221d2f[_0x5ab4('0x80')]());return dbH[_0x5ab4('0x7f')][_0x5ab4('0x2e')](_0x221d2f[_0x5ab4('0x80')](),{'type':dbH['sequelize'][_0x5ab4('0x81')][_0x5ab4('0x82')]});}})['then'](function(){return{'sql':_0x1ab612[_0x5ab4('0x80')]()};})[_0x5ab4('0x20')](respondWithResult(_0x2b3b34,null))[_0x5ab4('0x43')](handleError(_0x2b3b34,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index df88686..0c8f06d 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 _0xe845=['util','api','moment','bluebird','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x212a5d,_0x8925a5){var _0x39f0cd=function(_0x265af7){while(--_0x265af7){_0x212a5d['push'](_0x212a5d['shift']());}};_0x39f0cd(++_0x8925a5);}(_0xe845,0x1a3));var _0x5e84=function(_0x46543b,_0x313b48){_0x46543b=_0x46543b-0x0;var _0x426e4e=_0xe845[_0x46543b];return _0x426e4e;};'use strict';var _=require(_0x5e84('0x0'));var util=require(_0x5e84('0x1'));var logger=require('../../config/logger')(_0x5e84('0x2'));var moment=require(_0x5e84('0x3'));var BPromise=require(_0x5e84('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e84('0x5'));var rimraf=require('rimraf');var config=require(_0x5e84('0x6'));var attributes=require(_0x5e84('0x7'));module[_0x5e84('0x8')]=function(_0xc8f0d2,_0x4f8c09){return _0xc8f0d2[_0x5e84('0x9')](_0x5e84('0xa'),attributes,{'tableName':_0x5e84('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b89=['../../config/logger','api','moment','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','util'];(function(_0xb1c479,_0xaa6368){var _0x359e87=function(_0x2bb9a0){while(--_0x2bb9a0){_0xb1c479['push'](_0xb1c479['shift']());}};_0x359e87(++_0xaa6368);}(_0x2b89,0x10d));var _0x92b8=function(_0x18f6fa,_0x1bf166){_0x18f6fa=_0x18f6fa-0x0;var _0x3f73d1=_0x2b89[_0x18f6fa];return _0x3f73d1;};'use strict';var _=require('lodash');var util=require(_0x92b8('0x0'));var logger=require(_0x92b8('0x1'))(_0x92b8('0x2'));var moment=require(_0x92b8('0x3'));var BPromise=require('bluebird');var rp=require(_0x92b8('0x4'));var fs=require('fs');var path=require(_0x92b8('0x5'));var rimraf=require(_0x92b8('0x6'));var config=require('../../config/environment');var attributes=require(_0x92b8('0x7'));module[_0x92b8('0x8')]=function(_0x17b1c8,_0x419960){return _0x17b1c8['define']('AnalyticCustomReport',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 f2e6c3e..6ee720b 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 _0x19de=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent'];(function(_0x187e82,_0x5254eb){var _0x58625e=function(_0x59d14d){while(--_0x59d14d){_0x187e82['push'](_0x187e82['shift']());}};_0x58625e(++_0x5254eb);}(_0x19de,0x97));var _0xe19d=function(_0x201232,_0x4c74fb){_0x201232=_0x201232-0x0;var _0x44285b=_0x19de[_0x201232];return _0x44285b;};'use strict';var _=require(_0xe19d('0x0'));var util=require(_0xe19d('0x1'));var moment=require('moment');var BPromise=require(_0xe19d('0x2'));var rs=require(_0xe19d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe19d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe19d('0x5')][_0xe19d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4eb705,_0x2754c0,_0x5004b3){return new BPromise(function(_0x16a860,_0x3fa6a7){return client[_0xe19d('0x7')](_0x4eb705,_0x5004b3)['then'](function(_0x51fc02){logger[_0xe19d('0x8')](_0xe19d('0x9'),_0x2754c0,_0xe19d('0xa'));logger[_0xe19d('0xb')](_0xe19d('0xc'),_0x2754c0,_0xe19d('0xa'),JSON[_0xe19d('0xd')](_0x51fc02));if(_0x51fc02[_0xe19d('0xe')]){if(_0x51fc02[_0xe19d('0xe')]['code']===0x1f4){logger[_0xe19d('0xe')](_0xe19d('0x9'),_0x2754c0,_0x51fc02[_0xe19d('0xe')][_0xe19d('0xf')]);return _0x3fa6a7(_0x51fc02[_0xe19d('0xe')][_0xe19d('0xf')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x2754c0,_0x51fc02[_0xe19d('0xe')][_0xe19d('0xf')]);return _0x16a860(_0x51fc02[_0xe19d('0xe')]['message']);}else{logger[_0xe19d('0x8')](_0xe19d('0x9'),_0x2754c0,_0xe19d('0xa'));_0x16a860(_0x51fc02[_0xe19d('0x10')][_0xe19d('0xf')]);}})[_0xe19d('0x11')](function(_0x2d85cf){logger[_0xe19d('0xe')](_0xe19d('0x9'),_0x2754c0,_0x2d85cf);_0x3fa6a7(_0x2d85cf);});});} \ No newline at end of file +var _0x52fa=['error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x533085,_0x46f36f){var _0x3e3706=function(_0x244318){while(--_0x244318){_0x533085['push'](_0x533085['shift']());}};_0x3e3706(++_0x46f36f);}(_0x52fa,0xac));var _0xa52f=function(_0x5e4284,_0xfca9c8){_0x5e4284=_0x5e4284-0x0;var _0x3c70b6=_0x52fa[_0x5e4284];return _0x3c70b6;};'use strict';var _=require('lodash');var util=require(_0xa52f('0x0'));var moment=require(_0xa52f('0x1'));var BPromise=require(_0xa52f('0x2'));var rs=require(_0xa52f('0x3'));var fs=require('fs');var Redis=require(_0xa52f('0x4'));var db=require(_0xa52f('0x5'))['db'];var utils=require(_0xa52f('0x6'));var logger=require(_0xa52f('0x7'))('rpc');var config=require(_0xa52f('0x8'));var jayson=require(_0xa52f('0x9'));var client=jayson[_0xa52f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x530256,_0x2750e0,_0x499102){return new BPromise(function(_0x3ebc40,_0x50ac2b){return client['request'](_0x530256,_0x499102)['then'](function(_0x38cb49){logger[_0xa52f('0xb')](_0xa52f('0xc'),_0x2750e0,'request\x20sent');logger[_0xa52f('0xd')](_0xa52f('0xe'),_0x2750e0,_0xa52f('0xf'),JSON[_0xa52f('0x10')](_0x38cb49));if(_0x38cb49[_0xa52f('0x11')]){if(_0x38cb49[_0xa52f('0x11')][_0xa52f('0x12')]===0x1f4){logger['error'](_0xa52f('0xc'),_0x2750e0,_0x38cb49['error'][_0xa52f('0x13')]);return _0x50ac2b(_0x38cb49[_0xa52f('0x11')][_0xa52f('0x13')]);}logger[_0xa52f('0x11')](_0xa52f('0xc'),_0x2750e0,_0x38cb49[_0xa52f('0x11')][_0xa52f('0x13')]);return _0x3ebc40(_0x38cb49[_0xa52f('0x11')]['message']);}else{logger[_0xa52f('0xb')](_0xa52f('0xc'),_0x2750e0,'request\x20sent');_0x3ebc40(_0x38cb49['result'][_0xa52f('0x13')]);}})[_0xa52f('0x14')](function(_0x2f7d7b){logger[_0xa52f('0x11')](_0xa52f('0xc'),_0x2750e0,_0x2f7d7b);_0x50ac2b(_0x2f7d7b);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 262e442..3a4a780 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 _0x24f7=['../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1af19f,_0x146cb6){var _0x2bd46e=function(_0x52475f){while(--_0x52475f){_0x1af19f['push'](_0x1af19f['shift']());}};_0x2bd46e(++_0x146cb6);}(_0x24f7,0x94));var _0x724f=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x24f7[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x724f('0x0'));var path=require(_0x724f('0x1'));var timeout=require(_0x724f('0x2'));var express=require(_0x724f('0x3'));var router=express[_0x724f('0x4')]();var fs_extra=require(_0x724f('0x5'));var auth=require(_0x724f('0x6'));var interaction=require(_0x724f('0x7'));var config=require(_0x724f('0x8'));var controller=require(_0x724f('0x9'));router[_0x724f('0xa')]('/',auth[_0x724f('0xb')](),controller[_0x724f('0xc')]);router['get'](_0x724f('0xd'),auth[_0x724f('0xb')](),controller[_0x724f('0xe')]);router[_0x724f('0xa')](_0x724f('0xf'),auth[_0x724f('0xb')](),controller[_0x724f('0x10')]);router[_0x724f('0xa')](_0x724f('0x11'),auth[_0x724f('0xb')](),controller['run']);router[_0x724f('0xa')](_0x724f('0x12'),auth[_0x724f('0xb')](),controller[_0x724f('0x13')]);router['post']('/',auth[_0x724f('0xb')](),controller[_0x724f('0x14')]);router[_0x724f('0x15')]('/:id',auth[_0x724f('0xb')](),controller[_0x724f('0x16')]);router[_0x724f('0x17')](_0x724f('0xd'),auth[_0x724f('0xb')](),controller[_0x724f('0x18')]);module[_0x724f('0x19')]=router; \ No newline at end of file +var _0x6d01=['/:id/run','query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x6d01,0x71));var _0x16d0=function(_0x4d1b0a,_0x14bbf8){_0x4d1b0a=_0x4d1b0a-0x0;var _0x48adbf=_0x6d01[_0x4d1b0a];return _0x48adbf;};'use strict';var multer=require(_0x16d0('0x0'));var util=require(_0x16d0('0x1'));var path=require(_0x16d0('0x2'));var timeout=require(_0x16d0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x16d0('0x4'));var interaction=require(_0x16d0('0x5'));var config=require(_0x16d0('0x6'));var controller=require('./analyticCustomReport.controller');router[_0x16d0('0x7')]('/',auth[_0x16d0('0x8')](),controller[_0x16d0('0x9')]);router['get'](_0x16d0('0xa'),auth['isAuthenticated'](),controller[_0x16d0('0xb')]);router['get'](_0x16d0('0xc'),auth['isAuthenticated'](),controller['preview']);router['get'](_0x16d0('0xd'),auth[_0x16d0('0x8')](),controller['run']);router['get']('/:id/query',auth[_0x16d0('0x8')](),controller[_0x16d0('0xe')]);router[_0x16d0('0xf')]('/',auth['isAuthenticated'](),controller[_0x16d0('0x10')]);router[_0x16d0('0x11')](_0x16d0('0xa'),auth[_0x16d0('0x8')](),controller[_0x16d0('0x12')]);router[_0x16d0('0x13')](_0x16d0('0xa'),auth['isAuthenticated'](),controller[_0x16d0('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index e5c6bb2..c1844a2 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 _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x2dd947,_0x5c42f4){var _0x219eb2=function(_0x1cb98a){while(--_0x1cb98a){_0x2dd947['push'](_0x2dd947['shift']());}};_0x219eb2(++_0x5c42f4);}(_0xeda8,0x104));var _0x8eda=function(_0x44fc3d,_0x52022c){_0x44fc3d=_0x44fc3d-0x0;var _0x3f747f=_0xeda8[_0x44fc3d];return _0x3f747f;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}}; \ No newline at end of file +var _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0xe50213,_0x33d3a7){var _0x580080=function(_0x23587a){while(--_0x23587a){_0xe50213['push'](_0xe50213['shift']());}};_0x580080(++_0x33d3a7);}(_0x814b,0x1a2));var _0xb814=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0x814b[_0x5a5395];return _0x4da43d;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index ccc28b9..b30d867 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 _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x2ef3,0xba));var _0x32ef=function(_0x8f4e29,_0x28d2ad){_0x8f4e29=_0x8f4e29-0x0;var _0x434826=_0x2ef3[_0x8f4e29];return _0x434826;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));}; \ No newline at end of file +var _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x1e46a5,_0x5b094e){var _0x35a2cf=function(_0x5e7c65){while(--_0x5e7c65){_0x1e46a5['push'](_0x1e46a5['shift']());}};_0x35a2cf(++_0x5b094e);}(_0x4819,0xcd));var _0x9481=function(_0x49a17d,_0x38066e){_0x49a17d=_0x49a17d-0x0;var _0x1810c0=_0x4819[_0x49a17d];return _0x1810c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index f12849f..8faae59 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 _0x6984=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2a1275,_0x48e738){var _0x1f1d2e=function(_0x179ffc){while(--_0x179ffc){_0x2a1275['push'](_0x2a1275['shift']());}};_0x1f1d2e(++_0x48e738);}(_0x6984,0x132));var _0x4698=function(_0x308b7e,_0x17b63e){_0x308b7e=_0x308b7e-0x0;var _0x2179e3=_0x6984[_0x308b7e];return _0x2179e3;};'use strict';var _=require(_0x4698('0x0'));var util=require(_0x4698('0x1'));var logger=require('../../config/logger')(_0x4698('0x2'));var moment=require(_0x4698('0x3'));var BPromise=require(_0x4698('0x4'));var rp=require(_0x4698('0x5'));var fs=require('fs');var path=require(_0x4698('0x6'));var rimraf=require(_0x4698('0x7'));var config=require(_0x4698('0x8'));var attributes=require(_0x4698('0x9'));module[_0x4698('0xa')]=function(_0x6a2fec,_0x271ee2){return _0x6a2fec['define']('AnalyticDefaultReport',attributes,{'tableName':_0x4698('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca25=['util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x57b57e,_0x2d7e58){var _0x6d4b40=function(_0x39914d){while(--_0x39914d){_0x57b57e['push'](_0x57b57e['shift']());}};_0x6d4b40(++_0x2d7e58);}(_0xca25,0x1ac));var _0x5ca2=function(_0xf351f3,_0x4a90f4){_0xf351f3=_0xf351f3-0x0;var _0x21d574=_0xca25[_0xf351f3];return _0x21d574;};'use strict';var _=require(_0x5ca2('0x0'));var util=require(_0x5ca2('0x1'));var logger=require('../../config/logger')(_0x5ca2('0x2'));var moment=require(_0x5ca2('0x3'));var BPromise=require(_0x5ca2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ca2('0x5'));var rimraf=require(_0x5ca2('0x6'));var config=require(_0x5ca2('0x7'));var attributes=require(_0x5ca2('0x8'));module[_0x5ca2('0x9')]=function(_0x4ce3be,_0x406b8f){return _0x4ce3be[_0x5ca2('0xa')](_0x5ca2('0xb'),attributes,{'tableName':_0x5ca2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 28e5f6c..e9a7d93 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 _0xdc0d=['../../config/utils','../../config/logger','../../config/environment','client','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','bluebird','randomstring','../../mysqldb'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0xdc0d,0xe6));var _0xddc0=function(_0x40da36,_0x3012f0){_0x40da36=_0x40da36-0x0;var _0x36d3d0=_0xdc0d[_0x40da36];return _0x36d3d0;};'use strict';var _=require('lodash');var util=require(_0xddc0('0x0'));var moment=require('moment');var BPromise=require(_0xddc0('0x1'));var rs=require(_0xddc0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddc0('0x3'))['db'];var utils=require(_0xddc0('0x4'));var logger=require(_0xddc0('0x5'))('rpc');var config=require(_0xddc0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xddc0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7fd01e,_0x3ecd6f,_0xd48497){return new BPromise(function(_0x286788,_0x1fc4f2){return client['request'](_0x7fd01e,_0xd48497)[_0xddc0('0x8')](function(_0x855bb5){logger[_0xddc0('0x9')](_0xddc0('0xa'),_0x3ecd6f,_0xddc0('0xb'));logger[_0xddc0('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3ecd6f,'request\x20sent',JSON[_0xddc0('0xd')](_0x855bb5));if(_0x855bb5[_0xddc0('0xe')]){if(_0x855bb5['error'][_0xddc0('0xf')]===0x1f4){logger['error'](_0xddc0('0xa'),_0x3ecd6f,_0x855bb5[_0xddc0('0xe')][_0xddc0('0x10')]);return _0x1fc4f2(_0x855bb5[_0xddc0('0xe')][_0xddc0('0x10')]);}logger[_0xddc0('0xe')](_0xddc0('0xa'),_0x3ecd6f,_0x855bb5['error'][_0xddc0('0x10')]);return _0x286788(_0x855bb5[_0xddc0('0xe')]['message']);}else{logger[_0xddc0('0x9')](_0xddc0('0xa'),_0x3ecd6f,_0xddc0('0xb'));_0x286788(_0x855bb5['result'][_0xddc0('0x10')]);}})[_0xddc0('0x11')](function(_0x35d6ac){logger[_0xddc0('0xe')](_0xddc0('0xa'),_0x3ecd6f,_0x35d6ac);_0x1fc4f2(_0x35d6ac);});});} \ No newline at end of file +var _0x7cae=['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','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3d3b05,_0x334c57){var _0x2c6ca3=function(_0x3fd1cc){while(--_0x3fd1cc){_0x3d3b05['push'](_0x3d3b05['shift']());}};_0x2c6ca3(++_0x334c57);}(_0x7cae,0x69));var _0xe7ca=function(_0x21e97b,_0x65a77f){_0x21e97b=_0x21e97b-0x0;var _0x10ba44=_0x7cae[_0x21e97b];return _0x10ba44;};'use strict';var _=require(_0xe7ca('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe7ca('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7ca('0x2'))['db'];var utils=require(_0xe7ca('0x3'));var logger=require(_0xe7ca('0x4'))(_0xe7ca('0x5'));var config=require(_0xe7ca('0x6'));var jayson=require(_0xe7ca('0x7'));var client=jayson[_0xe7ca('0x8')][_0xe7ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11e924,_0x1ddd2d,_0x4e996e){return new BPromise(function(_0x473b90,_0x1ace4b){return client[_0xe7ca('0xa')](_0x11e924,_0x4e996e)[_0xe7ca('0xb')](function(_0x5c53a1){logger['info'](_0xe7ca('0xc'),_0x1ddd2d,_0xe7ca('0xd'));logger[_0xe7ca('0xe')](_0xe7ca('0xf'),_0x1ddd2d,_0xe7ca('0xd'),JSON[_0xe7ca('0x10')](_0x5c53a1));if(_0x5c53a1[_0xe7ca('0x11')]){if(_0x5c53a1[_0xe7ca('0x11')][_0xe7ca('0x12')]===0x1f4){logger[_0xe7ca('0x11')](_0xe7ca('0xc'),_0x1ddd2d,_0x5c53a1[_0xe7ca('0x11')]['message']);return _0x1ace4b(_0x5c53a1['error'][_0xe7ca('0x13')]);}logger[_0xe7ca('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ddd2d,_0x5c53a1['error'][_0xe7ca('0x13')]);return _0x473b90(_0x5c53a1['error'][_0xe7ca('0x13')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ddd2d,_0xe7ca('0xd'));_0x473b90(_0x5c53a1[_0xe7ca('0x14')][_0xe7ca('0x13')]);}})[_0xe7ca('0x15')](function(_0x209590){logger[_0xe7ca('0x11')](_0xe7ca('0xc'),_0x1ddd2d,_0x209590);_0x1ace4b(_0x209590);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index e6cc8e3..384ff24 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 _0x3dc5=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','index','/:id','show','isAuthenticated','preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','exports','multer'];(function(_0xa121d2,_0x53bf78){var _0x4fd840=function(_0x2a0092){while(--_0x2a0092){_0xa121d2['push'](_0xa121d2['shift']());}};_0x4fd840(++_0x53bf78);}(_0x3dc5,0x107));var _0x53dc=function(_0x144b45,_0x4c9997){_0x144b45=_0x144b45-0x0;var _0x37452e=_0x3dc5[_0x144b45];return _0x37452e;};'use strict';var multer=require(_0x53dc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x53dc('0x1'));var express=require(_0x53dc('0x2'));var router=express[_0x53dc('0x3')]();var fs_extra=require(_0x53dc('0x4'));var auth=require(_0x53dc('0x5'));var interaction=require(_0x53dc('0x6'));var config=require('../../config/environment');var controller=require(_0x53dc('0x7'));router[_0x53dc('0x8')]('/',auth['isAuthenticated'](),controller[_0x53dc('0x9')]);router['get'](_0x53dc('0xa'),auth['isAuthenticated'](),controller[_0x53dc('0xb')]);router['get']('/:id/preview',auth[_0x53dc('0xc')](),controller[_0x53dc('0xd')]);router[_0x53dc('0x8')](_0x53dc('0xe'),auth[_0x53dc('0xc')](),controller[_0x53dc('0xf')]);router[_0x53dc('0x8')](_0x53dc('0x10'),auth[_0x53dc('0xc')](),controller['query']);router[_0x53dc('0x11')]('/',auth[_0x53dc('0xc')](),controller[_0x53dc('0x12')]);router[_0x53dc('0x13')]('/:id',auth[_0x53dc('0xc')](),controller[_0x53dc('0x14')]);router[_0x53dc('0x15')](_0x53dc('0xa'),auth[_0x53dc('0xc')](),controller[_0x53dc('0x16')]);module[_0x53dc('0x17')]=router; \ No newline at end of file +var _0x2a64=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','query','post','create','put','/:id','update'];(function(_0x3b78a7,_0x176b87){var _0x1ba416=function(_0x18f8b8){while(--_0x18f8b8){_0x3b78a7['push'](_0x3b78a7['shift']());}};_0x1ba416(++_0x176b87);}(_0x2a64,0xc1));var _0x42a6=function(_0x40eb53,_0x56448f){_0x40eb53=_0x40eb53-0x0;var _0x50698a=_0x2a64[_0x40eb53];return _0x50698a;};'use strict';var multer=require(_0x42a6('0x0'));var util=require(_0x42a6('0x1'));var path=require(_0x42a6('0x2'));var timeout=require(_0x42a6('0x3'));var express=require('express');var router=express[_0x42a6('0x4')]();var fs_extra=require(_0x42a6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x42a6('0x6'));var config=require(_0x42a6('0x7'));var controller=require(_0x42a6('0x8'));router[_0x42a6('0x9')]('/',auth[_0x42a6('0xa')](),controller[_0x42a6('0xb')]);router['get']('/:id',auth[_0x42a6('0xa')](),controller[_0x42a6('0xc')]);router['get'](_0x42a6('0xd'),auth[_0x42a6('0xa')](),controller[_0x42a6('0xe')]);router[_0x42a6('0x9')](_0x42a6('0xf'),auth[_0x42a6('0xa')](),controller[_0x42a6('0x10')]);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0x42a6('0x11')]);router[_0x42a6('0x12')]('/',auth[_0x42a6('0xa')](),controller[_0x42a6('0x13')]);router[_0x42a6('0x14')](_0x42a6('0x15'),auth[_0x42a6('0xa')](),controller[_0x42a6('0x16')]);router['delete']('/:id',auth[_0x42a6('0xa')](),controller['destroy']);module[_0x42a6('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 939e5fe..a1f3999 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 _0x2d3f=['sequelize','STRING','csv','pdf','xlsx','DATE','ENUM','manual','scheduled'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x2d3f,0xb4));var _0xf2d3=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x2d3f[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require(_0xf2d3('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0xf2d3('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xf2d3('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xf2d3('0x2'),_0xf2d3('0x3'),_0xf2d3('0x4')),'allowNull':![],'defaultValue':_0xf2d3('0x2')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xf2d3('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xf2d3('0x6')](_0xf2d3('0x7'),_0xf2d3('0x8')),'allowNull':![],'defaultValue':_0xf2d3('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcd2d=['sequelize','moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x324355,_0x4b7794){var _0x655caa=function(_0x64943f){while(--_0x64943f){_0x324355['push'](_0x324355['shift']());}};_0x655caa(++_0x4b7794);}(_0xcd2d,0x12b));var _0xdcd2=function(_0x7df98e,_0x220a4c){_0x7df98e=_0x7df98e-0x0;var _0x3103e0=_0xcd2d[_0x7df98e];return _0x3103e0;};'use strict';var Sequelize=require(_0xdcd2('0x0'));var moment=require(_0xdcd2('0x1'));module[_0xdcd2('0x2')]={'name':{'type':Sequelize[_0xdcd2('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xdcd2('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xdcd2('0x4')](_0xdcd2('0x5'),_0xdcd2('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0xdcd2('0x5')},'savename':{'type':Sequelize[_0xdcd2('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xdcd2('0x7')]},'endDate':{'type':Sequelize[_0xdcd2('0x7')]},'status':{'type':Sequelize[_0xdcd2('0x3')],'defaultValue':_0xdcd2('0x8')},'type':{'type':Sequelize[_0xdcd2('0x4')](_0xdcd2('0x9'),_0xdcd2('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xdcd2('0xb')](0xb)[_0xdcd2('0xc')]},'reportType':{'type':Sequelize[_0xdcd2('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 019b39c..5543677 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 _0x5ebb=['user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','toLowerCase','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','map','query','keys','model','attributes','intersection','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','fields','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x2df82b,_0x276f89){var _0x3a49ac=function(_0x2698f2){while(--_0x2698f2){_0x2df82b['push'](_0x2df82b['shift']());}};_0x3a49ac(++_0x276f89);}(_0x5ebb,0x6c));var _0xb5eb=function(_0x9875f2,_0x5df566){_0x9875f2=_0x9875f2-0x0;var _0x57c331=_0x5ebb[_0x9875f2];return _0x57c331;};'use strict';var emlformat=require(_0xb5eb('0x0'));var rimraf=require(_0xb5eb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb5eb('0x2'));var moment=require(_0xb5eb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb5eb('0x4'));var util=require('util');var path=require(_0xb5eb('0x5'));var sox=require(_0xb5eb('0x6'));var csv=require(_0xb5eb('0x7'));var ejs=require(_0xb5eb('0x8'));var fs=require('fs');var fs_extra=require(_0xb5eb('0x9'));var _=require(_0xb5eb('0xa'));var squel=require(_0xb5eb('0xb'));var crypto=require(_0xb5eb('0xc'));var jsforce=require(_0xb5eb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb5eb('0x7'));var querystring=require('querystring');var Papa=require(_0xb5eb('0xe'));var Redis=require(_0xb5eb('0xf'));var authService=require(_0xb5eb('0x10'));var qs=require(_0xb5eb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5eb('0x12'));var logger=require(_0xb5eb('0x13'))('api');var utils=require(_0xb5eb('0x14'));var config=require(_0xb5eb('0x15'));var licenseUtil=require(_0xb5eb('0x16'));var db=require(_0xb5eb('0x17'))['db'];function respondWithStatusCode(_0x558eb5,_0x4eb584){_0x4eb584=_0x4eb584||0xcc;return function(_0x4fe761){if(_0x4fe761){return _0x558eb5['sendStatus'](_0x4eb584);}return _0x558eb5['status'](_0x4eb584)[_0xb5eb('0x18')]();};}function respondWithResult(_0xca8941,_0x2002c4){_0x2002c4=_0x2002c4||0xc8;return function(_0xace2a4){if(_0xace2a4){return _0xca8941[_0xb5eb('0x19')](_0x2002c4)[_0xb5eb('0x1a')](_0xace2a4);}};}function respondWithFilteredResult(_0x445b77,_0x47ddd0){return function(_0x2de3b7){if(_0x2de3b7){var _0x2133ca=typeof _0x47ddd0[_0xb5eb('0x1b')]===_0xb5eb('0x1c')&&typeof _0x47ddd0[_0xb5eb('0x1d')]===_0xb5eb('0x1c');var _0xed1fd9=_0x2de3b7[_0xb5eb('0x1e')];var _0x28fe34=_0x2133ca?0x0:_0x47ddd0[_0xb5eb('0x1b')];var _0x5b3c45=_0x2133ca?_0x2de3b7[_0xb5eb('0x1e')]:_0x47ddd0[_0xb5eb('0x1b')]+_0x47ddd0[_0xb5eb('0x1d')];var _0x577f11;if(_0x5b3c45>=_0xed1fd9){_0x5b3c45=_0xed1fd9;_0x577f11=0xc8;}else{_0x577f11=0xce;}_0x445b77['status'](_0x577f11);return _0x445b77[_0xb5eb('0x1f')](_0xb5eb('0x20'),_0x28fe34+'-'+_0x5b3c45+'/'+_0xed1fd9)[_0xb5eb('0x1a')](_0x2de3b7);}return null;};}function patchUpdates(_0x231d17){return function(_0x33a069){try{jsonpatch['apply'](_0x33a069,_0x231d17,!![]);}catch(_0x510c83){return BPromise[_0xb5eb('0x21')](_0x510c83);}return _0x33a069[_0xb5eb('0x22')]();};}function saveUpdates(_0x27f4e6,_0x412582){return function(_0x1f079e){if(_0x1f079e){return _0x1f079e[_0xb5eb('0x23')](_0x27f4e6)[_0xb5eb('0x24')](function(_0x1a2fb7){return _0x1a2fb7;});}return null;};}function removeEntity(_0x26a7e8,_0x332b60){return function(_0x2a6ff8){if(_0x2a6ff8){return _0x2a6ff8[_0xb5eb('0x25')]()['then'](function(){var _0x53d908=_0x2a6ff8[_0xb5eb('0x26')]({'plain':!![]});var _0x29ba5d=_0xb5eb('0x27');return db[_0xb5eb('0x28')][_0xb5eb('0x25')]({'where':{'type':_0x29ba5d,'resourceId':_0x53d908['id']}})['then'](function(){return _0x2a6ff8;});})['then'](function(){_0x26a7e8[_0xb5eb('0x19')](0xcc)[_0xb5eb('0x18')]();});}};}function handleEntityNotFound(_0x182230,_0x42437c){return function(_0x14cbbb){if(!_0x14cbbb){_0x182230[_0xb5eb('0x29')](0x194);}return _0x14cbbb;};}function handleError(_0x35ad72,_0x3747e1){_0x3747e1=_0x3747e1||0x1f4;return function(_0x1e2db2){logger[_0xb5eb('0x2a')](_0x1e2db2['stack']);if(_0x1e2db2[_0xb5eb('0x2b')]){delete _0x1e2db2[_0xb5eb('0x2b')];}_0x35ad72['status'](_0x3747e1)[_0xb5eb('0x2c')](_0x1e2db2);};}exports[_0xb5eb('0x2d')]=function(_0x261f77,_0x3b89ed){var _0x51be11={},_0x33cf3b={},_0xfb76aa={'count':0x0,'rows':[]};var _0x5cd7f1=_['map'](db[_0xb5eb('0x2e')][_0xb5eb('0x2f')],function(_0x508192){return{'name':_0x508192[_0xb5eb('0x30')],'type':_0x508192[_0xb5eb('0x31')]['key']};});_0x33cf3b['model']=_[_0xb5eb('0x32')](_0x5cd7f1,_0xb5eb('0x2b'));_0x33cf3b[_0xb5eb('0x33')]=_[_0xb5eb('0x34')](_0x261f77[_0xb5eb('0x33')]);_0x33cf3b['filters']=_['intersection'](_0x33cf3b[_0xb5eb('0x35')],_0x33cf3b['query']);_0x51be11[_0xb5eb('0x36')]=_[_0xb5eb('0x37')](_0x33cf3b[_0xb5eb('0x35')],qs['fields'](_0x261f77[_0xb5eb('0x33')]['fields']));_0x51be11['attributes']=_0x51be11[_0xb5eb('0x36')]['length']?_0x51be11[_0xb5eb('0x36')]:_0x33cf3b[_0xb5eb('0x35')];if(!_0x261f77[_0xb5eb('0x33')]['hasOwnProperty']('nolimit')){_0x51be11[_0xb5eb('0x1d')]=qs[_0xb5eb('0x1d')](_0x261f77[_0xb5eb('0x33')]['limit']);_0x51be11[_0xb5eb('0x1b')]=qs['offset'](_0x261f77[_0xb5eb('0x33')][_0xb5eb('0x1b')]);}_0x51be11[_0xb5eb('0x38')]=qs[_0xb5eb('0x39')](_0x261f77[_0xb5eb('0x33')]['sort']);_0x51be11[_0xb5eb('0x3a')]=qs[_0xb5eb('0x3b')](_[_0xb5eb('0x3c')](_0x261f77[_0xb5eb('0x33')],_0x33cf3b['filters']),_0x5cd7f1);if(_0x261f77[_0xb5eb('0x33')][_0xb5eb('0x3d')]){_0x51be11[_0xb5eb('0x3a')]=_[_0xb5eb('0x3e')](_0x51be11[_0xb5eb('0x3a')],{'$or':_[_0xb5eb('0x32')](_0x5cd7f1,function(_0x35961b){if(_0x35961b[_0xb5eb('0x31')]!==_0xb5eb('0x3f')){var _0x196035={};_0x196035[_0x35961b['name']]={'$like':'%'+_0x261f77[_0xb5eb('0x33')]['filter']+'%'};return _0x196035;}})});}_0x51be11=_[_0xb5eb('0x3e')]({},_0x51be11,_0x261f77['options']);var _0x2a9546={'where':_0x51be11[_0xb5eb('0x3a')]};return db[_0xb5eb('0x2e')]['count'](_0x2a9546)[_0xb5eb('0x24')](function(_0x17296f){_0xfb76aa[_0xb5eb('0x1e')]=_0x17296f;if(_0x261f77[_0xb5eb('0x33')][_0xb5eb('0x40')]){_0x51be11['include']=[{'all':!![]}];}return db[_0xb5eb('0x2e')]['findAll'](_0x51be11);})[_0xb5eb('0x24')](function(_0x2a4be8){_0xfb76aa[_0xb5eb('0x41')]=_0x2a4be8;return _0xfb76aa;})['then'](respondWithFilteredResult(_0x3b89ed,_0x51be11))[_0xb5eb('0x42')](handleError(_0x3b89ed,null));};exports[_0xb5eb('0x43')]=function(_0x2fb2c0,_0x3f35d0){var _0x5721e0={'raw':!![],'where':{'id':_0x2fb2c0['params']['id']}},_0x5ca5d0={};_0x5ca5d0[_0xb5eb('0x35')]=_[_0xb5eb('0x34')](db[_0xb5eb('0x2e')]['rawAttributes']);_0x5ca5d0[_0xb5eb('0x33')]=_[_0xb5eb('0x34')](_0x2fb2c0[_0xb5eb('0x33')]);_0x5ca5d0[_0xb5eb('0x3b')]=_[_0xb5eb('0x37')](_0x5ca5d0['model'],_0x5ca5d0[_0xb5eb('0x33')]);_0x5721e0['attributes']=_['intersection'](_0x5ca5d0[_0xb5eb('0x35')],qs[_0xb5eb('0x44')](_0x2fb2c0['query']['fields']));_0x5721e0[_0xb5eb('0x36')]=_0x5721e0[_0xb5eb('0x36')]['length']?_0x5721e0['attributes']:_0x5ca5d0[_0xb5eb('0x35')];if(_0x2fb2c0[_0xb5eb('0x33')]['includeAll']){_0x5721e0[_0xb5eb('0x45')]=[{'all':!![]}];}_0x5721e0=_[_0xb5eb('0x3e')]({},_0x5721e0,_0x2fb2c0[_0xb5eb('0x46')]);return db[_0xb5eb('0x2e')][_0xb5eb('0x47')](_0x5721e0)[_0xb5eb('0x24')](handleEntityNotFound(_0x3f35d0,null))['then'](respondWithResult(_0x3f35d0,null))[_0xb5eb('0x42')](handleError(_0x3f35d0,null));};exports['create']=function(_0x5b39c0,_0x1eca6c){return db['AnalyticExtractedReport'][_0xb5eb('0x48')](_0x5b39c0[_0xb5eb('0x49')],{})[_0xb5eb('0x24')](function(_0x741566){var _0x420887=_0x5b39c0['user'][_0xb5eb('0x26')]({'plain':!![]});if(!_0x420887)throw new Error(_0xb5eb('0x4a'));if(_0x420887[_0xb5eb('0x4b')]===_0xb5eb('0x4c')){var _0x511913=_0x741566['get']({'plain':!![]});var _0x4ab9ff=_0xb5eb('0x27');return db['UserProfileSection'][_0xb5eb('0x47')]({'where':{'name':_0x4ab9ff,'userProfileId':_0x420887['userProfileId']},'raw':!![]})[_0xb5eb('0x24')](function(_0x3bf1fc){if(_0x3bf1fc&&_0x3bf1fc['autoAssociation']===0x0){return db['UserProfileResource'][_0xb5eb('0x48')]({'name':_0x511913[_0xb5eb('0x2b')],'resourceId':_0x511913['id'],'type':_0x3bf1fc['name'],'sectionId':_0x3bf1fc['id']},{})[_0xb5eb('0x24')](function(){return _0x741566;});}else{return _0x741566;}})[_0xb5eb('0x42')](function(_0x42f915){logger[_0xb5eb('0x2a')](_0xb5eb('0x4d'),_0x42f915);throw _0x42f915;});}return _0x741566;})[_0xb5eb('0x24')](respondWithResult(_0x1eca6c,0xc9))['catch'](handleError(_0x1eca6c,null));};exports[_0xb5eb('0x23')]=function(_0x57aa5e,_0x181426){if(_0x57aa5e[_0xb5eb('0x49')]['id']){delete _0x57aa5e[_0xb5eb('0x49')]['id'];}return db[_0xb5eb('0x2e')][_0xb5eb('0x47')]({'where':{'id':_0x57aa5e[_0xb5eb('0x4e')]['id']}})['then'](handleEntityNotFound(_0x181426,null))['then'](saveUpdates(_0x57aa5e['body'],null))[_0xb5eb('0x24')](respondWithResult(_0x181426,null))[_0xb5eb('0x42')](handleError(_0x181426,null));};exports[_0xb5eb('0x25')]=function(_0x144fee,_0x1c5f1b){return db[_0xb5eb('0x2e')][_0xb5eb('0x47')]({'where':{'id':_0x144fee['params']['id']}})[_0xb5eb('0x24')](handleEntityNotFound(_0x1c5f1b,null))[_0xb5eb('0x24')](removeEntity(_0x1c5f1b,null))[_0xb5eb('0x42')](handleError(_0x1c5f1b,null));};exports[_0xb5eb('0x4f')]=function(_0x32a4b9,_0xe6c7e7,_0x39aa0b){return db['AnalyticExtractedReport'][_0xb5eb('0x47')]({'where':{'id':_0x32a4b9[_0xb5eb('0x4e')]['id']},'attributes':[_0xb5eb('0x2b'),_0xb5eb('0x50'),'savename',_0xb5eb('0x51')],'raw':!![]})[_0xb5eb('0x24')](handleEntityNotFound(_0xe6c7e7,null))[_0xb5eb('0x24')](function(_0x40b140){if(_0x40b140){if(!fs[_0xb5eb('0x52')](path[_0xb5eb('0x53')](config[_0xb5eb('0x54')],_0xb5eb('0x55'),_0x40b140[_0xb5eb('0x56')]))){throw new db[(_0xb5eb('0x57'))]['ValidationError'](_0xb5eb('0x58'));}if(_0x32a4b9[_0xb5eb('0x33')][_0xb5eb('0x59')]){return _0xe6c7e7[_0xb5eb('0x29')](0xc8);}return _0xe6c7e7['download'](path[_0xb5eb('0x53')](config[_0xb5eb('0x54')],_0xb5eb('0x55'),_0x40b140[_0xb5eb('0x56')]),util[_0xb5eb('0x5a')]('%s.%s',_0x40b140[_0xb5eb('0x50')]||_0x40b140['name'],_0x40b140[_0xb5eb('0x51')][_0xb5eb('0x5b')]()));}})[_0xb5eb('0x42')](handleError(_0xe6c7e7,null));}; \ No newline at end of file +var _0x6061=['reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','sendStatus','download','format','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../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'];(function(_0x4432e0,_0x5b332d){var _0x29e13f=function(_0x5b71e8){while(--_0x5b71e8){_0x4432e0['push'](_0x4432e0['shift']());}};_0x29e13f(++_0x5b332d);}(_0x6061,0x16b));var _0x1606=function(_0x545485,_0x2c64b1){_0x545485=_0x545485-0x0;var _0x260fb0=_0x6061[_0x545485];return _0x260fb0;};'use strict';var emlformat=require(_0x1606('0x0'));var rimraf=require(_0x1606('0x1'));var zipdir=require(_0x1606('0x2'));var jsonpatch=require(_0x1606('0x3'));var rp=require(_0x1606('0x4'));var moment=require('moment');var BPromise=require(_0x1606('0x5'));var Mustache=require(_0x1606('0x6'));var util=require(_0x1606('0x7'));var path=require(_0x1606('0x8'));var sox=require(_0x1606('0x9'));var csv=require(_0x1606('0xa'));var ejs=require(_0x1606('0xb'));var fs=require('fs');var fs_extra=require(_0x1606('0xc'));var _=require(_0x1606('0xd'));var squel=require(_0x1606('0xe'));var crypto=require(_0x1606('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x1606('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1606('0x11'));var Redis=require(_0x1606('0x12'));var authService=require(_0x1606('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1606('0x14'));var hardwareService=require(_0x1606('0x15'));var logger=require(_0x1606('0x16'))('api');var utils=require(_0x1606('0x17'));var config=require(_0x1606('0x18'));var licenseUtil=require(_0x1606('0x19'));var db=require(_0x1606('0x1a'))['db'];function respondWithStatusCode(_0x5ad981,_0x38b428){_0x38b428=_0x38b428||0xcc;return function(_0x150d74){if(_0x150d74){return _0x5ad981['sendStatus'](_0x38b428);}return _0x5ad981[_0x1606('0x1b')](_0x38b428)[_0x1606('0x1c')]();};}function respondWithResult(_0x3a9604,_0x2b8ba0){_0x2b8ba0=_0x2b8ba0||0xc8;return function(_0x29ff0a){if(_0x29ff0a){return _0x3a9604[_0x1606('0x1b')](_0x2b8ba0)['json'](_0x29ff0a);}};}function respondWithFilteredResult(_0x2964e7,_0x56da97){return function(_0x30df8d){if(_0x30df8d){var _0x194f6b=typeof _0x56da97[_0x1606('0x1d')]===_0x1606('0x1e')&&typeof _0x56da97[_0x1606('0x1f')]==='undefined';var _0x1938a7=_0x30df8d[_0x1606('0x20')];var _0x4f0971=_0x194f6b?0x0:_0x56da97[_0x1606('0x1d')];var _0xb30dd2=_0x194f6b?_0x30df8d[_0x1606('0x20')]:_0x56da97[_0x1606('0x1d')]+_0x56da97[_0x1606('0x1f')];var _0x2a6b4e;if(_0xb30dd2>=_0x1938a7){_0xb30dd2=_0x1938a7;_0x2a6b4e=0xc8;}else{_0x2a6b4e=0xce;}_0x2964e7[_0x1606('0x1b')](_0x2a6b4e);return _0x2964e7[_0x1606('0x21')](_0x1606('0x22'),_0x4f0971+'-'+_0xb30dd2+'/'+_0x1938a7)[_0x1606('0x23')](_0x30df8d);}return null;};}function patchUpdates(_0x5cca18){return function(_0x188f27){try{jsonpatch[_0x1606('0x24')](_0x188f27,_0x5cca18,!![]);}catch(_0x354a2a){return BPromise[_0x1606('0x25')](_0x354a2a);}return _0x188f27[_0x1606('0x26')]();};}function saveUpdates(_0x31f182,_0x36decc){return function(_0xd85f30){if(_0xd85f30){return _0xd85f30[_0x1606('0x27')](_0x31f182)['then'](function(_0x54ef36){return _0x54ef36;});}return null;};}function removeEntity(_0x4d872f,_0x5ea195){return function(_0x337251){if(_0x337251){return _0x337251[_0x1606('0x28')]()[_0x1606('0x29')](function(){var _0x38c5db=_0x337251[_0x1606('0x2a')]({'plain':!![]});var _0xbb6060='ExtractedReports';return db[_0x1606('0x2b')][_0x1606('0x28')]({'where':{'type':_0xbb6060,'resourceId':_0x38c5db['id']}})[_0x1606('0x29')](function(){return _0x337251;});})['then'](function(){_0x4d872f['status'](0xcc)[_0x1606('0x1c')]();});}};}function handleEntityNotFound(_0x39f7e6,_0x440355){return function(_0x334580){if(!_0x334580){_0x39f7e6['sendStatus'](0x194);}return _0x334580;};}function handleError(_0x3ef738,_0x2c7a36){_0x2c7a36=_0x2c7a36||0x1f4;return function(_0x148b19){logger[_0x1606('0x2c')](_0x148b19[_0x1606('0x2d')]);if(_0x148b19[_0x1606('0x2e')]){delete _0x148b19[_0x1606('0x2e')];}_0x3ef738[_0x1606('0x1b')](_0x2c7a36)['send'](_0x148b19);};}exports[_0x1606('0x2f')]=function(_0x288d68,_0x27fb87){var _0x245a5a={},_0x106105={},_0x5c6b96={'count':0x0,'rows':[]};var _0x189e34=_[_0x1606('0x30')](db[_0x1606('0x31')][_0x1606('0x32')],function(_0x37add3){return{'name':_0x37add3[_0x1606('0x33')],'type':_0x37add3[_0x1606('0x34')]['key']};});_0x106105['model']=_[_0x1606('0x30')](_0x189e34,'name');_0x106105[_0x1606('0x35')]=_['keys'](_0x288d68['query']);_0x106105[_0x1606('0x36')]=_['intersection'](_0x106105['model'],_0x106105[_0x1606('0x35')]);_0x245a5a[_0x1606('0x37')]=_[_0x1606('0x38')](_0x106105[_0x1606('0x39')],qs[_0x1606('0x3a')](_0x288d68['query'][_0x1606('0x3a')]));_0x245a5a[_0x1606('0x37')]=_0x245a5a[_0x1606('0x37')][_0x1606('0x3b')]?_0x245a5a[_0x1606('0x37')]:_0x106105[_0x1606('0x39')];if(!_0x288d68[_0x1606('0x35')][_0x1606('0x3c')](_0x1606('0x3d'))){_0x245a5a['limit']=qs[_0x1606('0x1f')](_0x288d68['query']['limit']);_0x245a5a[_0x1606('0x1d')]=qs[_0x1606('0x1d')](_0x288d68[_0x1606('0x35')][_0x1606('0x1d')]);}_0x245a5a[_0x1606('0x3e')]=qs[_0x1606('0x3f')](_0x288d68['query'][_0x1606('0x3f')]);_0x245a5a[_0x1606('0x40')]=qs[_0x1606('0x36')](_[_0x1606('0x41')](_0x288d68['query'],_0x106105['filters']),_0x189e34);if(_0x288d68[_0x1606('0x35')][_0x1606('0x42')]){_0x245a5a['where']=_[_0x1606('0x43')](_0x245a5a[_0x1606('0x40')],{'$or':_[_0x1606('0x30')](_0x189e34,function(_0x207794){if(_0x207794[_0x1606('0x34')]!==_0x1606('0x44')){var _0x400af7={};_0x400af7[_0x207794[_0x1606('0x2e')]]={'$like':'%'+_0x288d68['query'][_0x1606('0x42')]+'%'};return _0x400af7;}})});}_0x245a5a=_[_0x1606('0x43')]({},_0x245a5a,_0x288d68['options']);var _0x1b9ba4={'where':_0x245a5a[_0x1606('0x40')]};return db[_0x1606('0x31')]['count'](_0x1b9ba4)[_0x1606('0x29')](function(_0x1993d4){_0x5c6b96[_0x1606('0x20')]=_0x1993d4;if(_0x288d68[_0x1606('0x35')][_0x1606('0x45')]){_0x245a5a[_0x1606('0x46')]=[{'all':!![]}];}return db[_0x1606('0x31')][_0x1606('0x47')](_0x245a5a);})['then'](function(_0x42cd7a){_0x5c6b96[_0x1606('0x48')]=_0x42cd7a;return _0x5c6b96;})[_0x1606('0x29')](respondWithFilteredResult(_0x27fb87,_0x245a5a))[_0x1606('0x49')](handleError(_0x27fb87,null));};exports['show']=function(_0x1b63ab,_0x3d874d){var _0x127ccc={'raw':!![],'where':{'id':_0x1b63ab['params']['id']}},_0x15a88c={};_0x15a88c[_0x1606('0x39')]=_[_0x1606('0x4a')](db['AnalyticExtractedReport']['rawAttributes']);_0x15a88c[_0x1606('0x35')]=_[_0x1606('0x4a')](_0x1b63ab[_0x1606('0x35')]);_0x15a88c[_0x1606('0x36')]=_['intersection'](_0x15a88c['model'],_0x15a88c['query']);_0x127ccc[_0x1606('0x37')]=_['intersection'](_0x15a88c['model'],qs[_0x1606('0x3a')](_0x1b63ab[_0x1606('0x35')][_0x1606('0x3a')]));_0x127ccc[_0x1606('0x37')]=_0x127ccc[_0x1606('0x37')][_0x1606('0x3b')]?_0x127ccc[_0x1606('0x37')]:_0x15a88c[_0x1606('0x39')];if(_0x1b63ab[_0x1606('0x35')][_0x1606('0x45')]){_0x127ccc['include']=[{'all':!![]}];}_0x127ccc=_[_0x1606('0x43')]({},_0x127ccc,_0x1b63ab['options']);return db[_0x1606('0x31')][_0x1606('0x4b')](_0x127ccc)[_0x1606('0x29')](handleEntityNotFound(_0x3d874d,null))['then'](respondWithResult(_0x3d874d,null))[_0x1606('0x49')](handleError(_0x3d874d,null));};exports['create']=function(_0x55a563,_0x21daae){return db['AnalyticExtractedReport'][_0x1606('0x4c')](_0x55a563[_0x1606('0x4d')],{})[_0x1606('0x29')](function(_0x211cbe){var _0x3cb011=_0x55a563[_0x1606('0x4e')]['get']({'plain':!![]});if(!_0x3cb011)throw new Error(_0x1606('0x4f'));if(_0x3cb011[_0x1606('0x50')]===_0x1606('0x4e')){var _0x1a376f=_0x211cbe[_0x1606('0x2a')]({'plain':!![]});var _0x3d30ae=_0x1606('0x51');return db[_0x1606('0x52')][_0x1606('0x4b')]({'where':{'name':_0x3d30ae,'userProfileId':_0x3cb011['userProfileId']},'raw':!![]})[_0x1606('0x29')](function(_0x4f119e){if(_0x4f119e&&_0x4f119e['autoAssociation']===0x0){return db['UserProfileResource'][_0x1606('0x4c')]({'name':_0x1a376f[_0x1606('0x2e')],'resourceId':_0x1a376f['id'],'type':_0x4f119e['name'],'sectionId':_0x4f119e['id']},{})['then'](function(){return _0x211cbe;});}else{return _0x211cbe;}})[_0x1606('0x49')](function(_0x16f835){logger[_0x1606('0x2c')](_0x1606('0x53'),_0x16f835);throw _0x16f835;});}return _0x211cbe;})[_0x1606('0x29')](respondWithResult(_0x21daae,0xc9))[_0x1606('0x49')](handleError(_0x21daae,null));};exports[_0x1606('0x27')]=function(_0x5552a0,_0xbd90b4){if(_0x5552a0['body']['id']){delete _0x5552a0['body']['id'];}return db[_0x1606('0x31')]['find']({'where':{'id':_0x5552a0[_0x1606('0x54')]['id']}})['then'](handleEntityNotFound(_0xbd90b4,null))[_0x1606('0x29')](saveUpdates(_0x5552a0[_0x1606('0x4d')],null))['then'](respondWithResult(_0xbd90b4,null))[_0x1606('0x49')](handleError(_0xbd90b4,null));};exports[_0x1606('0x28')]=function(_0x623fc6,_0x5cf7fc){return db[_0x1606('0x31')][_0x1606('0x4b')]({'where':{'id':_0x623fc6[_0x1606('0x54')]['id']}})[_0x1606('0x29')](handleEntityNotFound(_0x5cf7fc,null))[_0x1606('0x29')](removeEntity(_0x5cf7fc,null))[_0x1606('0x49')](handleError(_0x5cf7fc,null));};exports['download']=function(_0x206995,_0x239755,_0x37885d){return db[_0x1606('0x31')][_0x1606('0x4b')]({'where':{'id':_0x206995[_0x1606('0x54')]['id']},'attributes':[_0x1606('0x2e'),_0x1606('0x55'),_0x1606('0x56'),'output'],'raw':!![]})[_0x1606('0x29')](handleEntityNotFound(_0x239755,null))[_0x1606('0x29')](function(_0x4ef536){if(_0x4ef536){if(!fs[_0x1606('0x57')](path[_0x1606('0x58')](config[_0x1606('0x59')],_0x1606('0x5a'),_0x4ef536[_0x1606('0x56')]))){throw new db[(_0x1606('0x5b'))][(_0x1606('0x5c'))](_0x1606('0x5d'));}if(_0x206995['query']['exists']){return _0x239755[_0x1606('0x5e')](0xc8);}return _0x239755[_0x1606('0x5f')](path[_0x1606('0x58')](config['root'],_0x1606('0x5a'),_0x4ef536['savename']),util[_0x1606('0x60')](_0x1606('0x61'),_0x4ef536[_0x1606('0x55')]||_0x4ef536['name'],_0x4ef536[_0x1606('0x62')][_0x1606('0x63')]()));}})[_0x1606('0x49')](handleError(_0x239755,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 85667a3..5b46499 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 _0xe534=['api','moment','bluebird','rimraf','../../config/environment','define','AnalyticExtractedReport','lodash','util'];(function(_0x2bc0f5,_0x44f336){var _0x42c6ac=function(_0x3b323a){while(--_0x3b323a){_0x2bc0f5['push'](_0x2bc0f5['shift']());}};_0x42c6ac(++_0x44f336);}(_0xe534,0x1c9));var _0x4e53=function(_0xf2ebb7,_0x2ce8cf){_0xf2ebb7=_0xf2ebb7-0x0;var _0x2c49a9=_0xe534[_0xf2ebb7];return _0x2c49a9;};'use strict';var _=require(_0x4e53('0x0'));var util=require(_0x4e53('0x1'));var logger=require('../../config/logger')(_0x4e53('0x2'));var moment=require(_0x4e53('0x3'));var BPromise=require(_0x4e53('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4e53('0x5'));var config=require(_0x4e53('0x6'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x305892,_0x347e44){return _0x305892[_0x4e53('0x7')](_0x4e53('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc26c=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xc26c,0x104));var _0xcc26=function(_0x445219,_0x1230b0){_0x445219=_0x445219-0x0;var _0x343a3a=_0xc26c[_0x445219];return _0x343a3a;};'use strict';var _=require('lodash');var util=require(_0xcc26('0x0'));var logger=require(_0xcc26('0x1'))(_0xcc26('0x2'));var moment=require(_0xcc26('0x3'));var BPromise=require(_0xcc26('0x4'));var rp=require(_0xcc26('0x5'));var fs=require('fs');var path=require(_0xcc26('0x6'));var rimraf=require(_0xcc26('0x7'));var config=require(_0xcc26('0x8'));var attributes=require(_0xcc26('0x9'));module[_0xcc26('0xa')]=function(_0x200f15,_0x215b14){return _0x200f15[_0xcc26('0xb')](_0xcc26('0xc'),attributes,{'tableName':_0xcc26('0xd'),'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 b8dc2de..e6f0b9f 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 _0x6db8=['then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x229e83,_0x45bb4c){var _0xcf5783=function(_0x766d8c){while(--_0x766d8c){_0x229e83['push'](_0x229e83['shift']());}};_0xcf5783(++_0x45bb4c);}(_0x6db8,0x1d3));var _0x86db=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0x6db8[_0x51674a];return _0x13fca6;};'use strict';var _=require(_0x86db('0x0'));var util=require(_0x86db('0x1'));var moment=require(_0x86db('0x2'));var BPromise=require(_0x86db('0x3'));var rs=require(_0x86db('0x4'));var fs=require('fs');var Redis=require(_0x86db('0x5'));var db=require(_0x86db('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x86db('0x7'))('rpc');var config=require(_0x86db('0x8'));var jayson=require(_0x86db('0x9'));var client=jayson[_0x86db('0xa')][_0x86db('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x549139,_0x5c50c4,_0x2f231c){return new BPromise(function(_0x1f8695,_0x44f946){return client[_0x86db('0xc')](_0x549139,_0x2f231c)[_0x86db('0xd')](function(_0x25bfa){logger[_0x86db('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5c50c4,_0x86db('0xf'));logger[_0x86db('0x10')](_0x86db('0x11'),_0x5c50c4,_0x86db('0xf'),JSON['stringify'](_0x25bfa));if(_0x25bfa[_0x86db('0x12')]){if(_0x25bfa[_0x86db('0x12')][_0x86db('0x13')]===0x1f4){logger[_0x86db('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5c50c4,_0x25bfa[_0x86db('0x12')][_0x86db('0x14')]);return _0x44f946(_0x25bfa['error'][_0x86db('0x14')]);}logger['error'](_0x86db('0x15'),_0x5c50c4,_0x25bfa[_0x86db('0x12')][_0x86db('0x14')]);return _0x1f8695(_0x25bfa[_0x86db('0x12')][_0x86db('0x14')]);}else{logger['info'](_0x86db('0x15'),_0x5c50c4,_0x86db('0xf'));_0x1f8695(_0x25bfa[_0x86db('0x16')][_0x86db('0x14')]);}})[_0x86db('0x17')](function(_0x252c1c){logger[_0x86db('0x12')](_0x86db('0x15'),_0x5c50c4,_0x252c1c);_0x44f946(_0x252c1c);});});} \ No newline at end of file +var _0x13cc=['../../config/environment','client','request','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticExtractedReport,\x20%s,\x20%s','info','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3f6fe6,_0x52243c){var _0xebbe7f=function(_0x49adff){while(--_0x49adff){_0x3f6fe6['push'](_0x3f6fe6['shift']());}};_0xebbe7f(++_0x52243c);}(_0x13cc,0x161));var _0xc13c=function(_0x15f4ad,_0xabccd2){_0x15f4ad=_0x15f4ad-0x0;var _0x21d9d0=_0x13cc[_0x15f4ad];return _0x21d9d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc13c('0x0'));var BPromise=require(_0xc13c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc13c('0x2'));var db=require(_0xc13c('0x3'))['db'];var utils=require(_0xc13c('0x4'));var logger=require(_0xc13c('0x5'))(_0xc13c('0x6'));var config=require(_0xc13c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc13c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b0b4,_0x41b41b,_0x4889d6){return new BPromise(function(_0x318eab,_0x3570f3){return client[_0xc13c('0x9')](_0x18b0b4,_0x4889d6)[_0xc13c('0xa')](function(_0x5ee2aa){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x41b41b,_0xc13c('0xb'));logger[_0xc13c('0xc')](_0xc13c('0xd'),_0x41b41b,_0xc13c('0xb'),JSON[_0xc13c('0xe')](_0x5ee2aa));if(_0x5ee2aa['error']){if(_0x5ee2aa[_0xc13c('0xf')]['code']===0x1f4){logger[_0xc13c('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x41b41b,_0x5ee2aa['error'][_0xc13c('0x10')]);return _0x3570f3(_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);}logger[_0xc13c('0xf')](_0xc13c('0x11'),_0x41b41b,_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);return _0x318eab(_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);}else{logger[_0xc13c('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x41b41b,_0xc13c('0xb'));_0x318eab(_0x5ee2aa[_0xc13c('0x13')][_0xc13c('0x10')]);}})['catch'](function(_0x93cb3b){logger[_0xc13c('0xf')](_0xc13c('0x11'),_0x41b41b,_0x93cb3b);_0x3570f3(_0x93cb3b);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 00bca61..c57391a 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 _0xbc33=['show','download','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x3fa62b,_0x52a8c5){var _0x534df7=function(_0x4fdb0a){while(--_0x4fdb0a){_0x3fa62b['push'](_0x3fa62b['shift']());}};_0x534df7(++_0x52a8c5);}(_0xbc33,0x1c1));var _0x3bc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc33[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3bc3('0x0'));var util=require(_0x3bc3('0x1'));var path=require(_0x3bc3('0x2'));var timeout=require(_0x3bc3('0x3'));var express=require(_0x3bc3('0x4'));var router=express[_0x3bc3('0x5')]();var fs_extra=require(_0x3bc3('0x6'));var auth=require(_0x3bc3('0x7'));var interaction=require(_0x3bc3('0x8'));var config=require('../../config/environment');var controller=require(_0x3bc3('0x9'));router[_0x3bc3('0xa')]('/',auth[_0x3bc3('0xb')](),controller[_0x3bc3('0xc')]);router[_0x3bc3('0xa')]('/:id',auth[_0x3bc3('0xb')](),controller[_0x3bc3('0xd')]);router[_0x3bc3('0xa')]('/:id/download',auth[_0x3bc3('0xb')](),controller[_0x3bc3('0xe')]);router[_0x3bc3('0xf')]('/',auth[_0x3bc3('0xb')](),controller[_0x3bc3('0x10')]);router[_0x3bc3('0x11')](_0x3bc3('0x12'),auth[_0x3bc3('0xb')](),controller['update']);router[_0x3bc3('0x13')](_0x3bc3('0x12'),auth[_0x3bc3('0xb')](),controller[_0x3bc3('0x14')]);module[_0x3bc3('0x15')]=router; \ No newline at end of file +var _0x79cf=['download','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download'];(function(_0x3bf605,_0x4a2a33){var _0x1f6c36=function(_0x34a6a4){while(--_0x34a6a4){_0x3bf605['push'](_0x3bf605['shift']());}};_0x1f6c36(++_0x4a2a33);}(_0x79cf,0xce));var _0xf79c=function(_0x448517,_0x30afcd){_0x448517=_0x448517-0x0;var _0x3b7ec4=_0x79cf[_0x448517];return _0x3b7ec4;};'use strict';var multer=require('multer');var util=require(_0xf79c('0x0'));var path=require(_0xf79c('0x1'));var timeout=require(_0xf79c('0x2'));var express=require(_0xf79c('0x3'));var router=express[_0xf79c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf79c('0x5'));var interaction=require(_0xf79c('0x6'));var config=require(_0xf79c('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0xf79c('0x8')]('/',auth['isAuthenticated'](),controller[_0xf79c('0x9')]);router['get'](_0xf79c('0xa'),auth[_0xf79c('0xb')](),controller[_0xf79c('0xc')]);router[_0xf79c('0x8')](_0xf79c('0xd'),auth[_0xf79c('0xb')](),controller[_0xf79c('0xe')]);router[_0xf79c('0xf')]('/',auth[_0xf79c('0xb')](),controller[_0xf79c('0x10')]);router[_0xf79c('0x11')](_0xf79c('0xa'),auth[_0xf79c('0xb')](),controller['update']);router[_0xf79c('0x12')](_0xf79c('0xa'),auth[_0xf79c('0xb')](),controller[_0xf79c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 0e4fc36..d8081ab 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 _0x1a4a=['STRING','BOOLEAN'];(function(_0x568772,_0x2f76c8){var _0x98dcc6=function(_0x321d1f){while(--_0x321d1f){_0x568772['push'](_0x568772['shift']());}};_0x98dcc6(++_0x2f76c8);}(_0x1a4a,0x164));var _0xa1a4=function(_0x37b205,_0x247aae){_0x37b205=_0x37b205-0x0;var _0x39ab8c=_0x1a4a[_0x37b205];return _0x39ab8c;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xa1a4('0x0')]},'function':{'type':Sequelize[_0xa1a4('0x0')]},'format':{'type':Sequelize[_0xa1a4('0x0')]},'groupBy':{'type':Sequelize[_0xa1a4('0x1')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa1a4('0x0')]},'custom':{'type':Sequelize[_0xa1a4('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x9cff=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0x9cff,0x1ab));var _0xf9cf=function(_0xde346d,_0x408453){_0xde346d=_0xde346d-0x0;var _0x4ea0db=_0x9cff[_0xde346d];return _0x4ea0db;};'use strict';var Sequelize=require(_0xf9cf('0x0'));module[_0xf9cf('0x1')]={'field':{'type':Sequelize[_0xf9cf('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xf9cf('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xf9cf('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xf9cf('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index a6196e6..61a60e6 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 _0xf1ad=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','then','destroy','stack','name','send','index','map','AnalyticFieldReport','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','bulkCreate','params','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x4ee0f4,_0x4c67bd){var _0x57fae5=function(_0x4a73b1){while(--_0x4a73b1){_0x4ee0f4['push'](_0x4ee0f4['shift']());}};_0x57fae5(++_0x4c67bd);}(_0xf1ad,0xe2));var _0xdf1a=function(_0x5b69a4,_0x2b8ee5){_0x5b69a4=_0x5b69a4-0x0;var _0x5cc057=_0xf1ad[_0x5b69a4];return _0x5cc057;};'use strict';var emlformat=require(_0xdf1a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdf1a('0x1'));var rp=require(_0xdf1a('0x2'));var moment=require(_0xdf1a('0x3'));var BPromise=require(_0xdf1a('0x4'));var Mustache=require(_0xdf1a('0x5'));var util=require(_0xdf1a('0x6'));var path=require(_0xdf1a('0x7'));var sox=require(_0xdf1a('0x8'));var csv=require(_0xdf1a('0x9'));var ejs=require(_0xdf1a('0xa'));var fs=require('fs');var fs_extra=require(_0xdf1a('0xb'));var _=require(_0xdf1a('0xc'));var squel=require('squel');var crypto=require(_0xdf1a('0xd'));var jsforce=require(_0xdf1a('0xe'));var deskjs=require(_0xdf1a('0xf'));var toCsv=require(_0xdf1a('0x9'));var querystring=require(_0xdf1a('0x10'));var Papa=require(_0xdf1a('0x11'));var Redis=require(_0xdf1a('0x12'));var authService=require(_0xdf1a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf1a('0x14'));var logger=require('../../config/logger')(_0xdf1a('0x15'));var utils=require(_0xdf1a('0x16'));var config=require(_0xdf1a('0x17'));var licenseUtil=require(_0xdf1a('0x18'));var db=require(_0xdf1a('0x19'))['db'];function respondWithStatusCode(_0x4bae18,_0x263a73){_0x263a73=_0x263a73||0xcc;return function(_0x4a54b7){if(_0x4a54b7){return _0x4bae18[_0xdf1a('0x1a')](_0x263a73);}return _0x4bae18['status'](_0x263a73)[_0xdf1a('0x1b')]();};}function respondWithResult(_0x27b449,_0x5ac57d){_0x5ac57d=_0x5ac57d||0xc8;return function(_0x457e46){if(_0x457e46){return _0x27b449[_0xdf1a('0x1c')](_0x5ac57d)[_0xdf1a('0x1d')](_0x457e46);}};}function respondWithFilteredResult(_0x4aa1d4,_0x46f171){return function(_0x582b5e){if(_0x582b5e){var _0xb87f18=typeof _0x46f171[_0xdf1a('0x1e')]===_0xdf1a('0x1f')&&typeof _0x46f171['limit']===_0xdf1a('0x1f');var _0x4776fa=_0x582b5e[_0xdf1a('0x20')];var _0x8df3e1=_0xb87f18?0x0:_0x46f171[_0xdf1a('0x1e')];var _0x5c3b76=_0xb87f18?_0x582b5e['count']:_0x46f171[_0xdf1a('0x1e')]+_0x46f171[_0xdf1a('0x21')];var _0x5bcd50;if(_0x5c3b76>=_0x4776fa){_0x5c3b76=_0x4776fa;_0x5bcd50=0xc8;}else{_0x5bcd50=0xce;}_0x4aa1d4[_0xdf1a('0x1c')](_0x5bcd50);return _0x4aa1d4[_0xdf1a('0x22')]('Content-Range',_0x8df3e1+'-'+_0x5c3b76+'/'+_0x4776fa)[_0xdf1a('0x1d')](_0x582b5e);}return null;};}function patchUpdates(_0x266225){return function(_0xece5c3){try{jsonpatch[_0xdf1a('0x23')](_0xece5c3,_0x266225,!![]);}catch(_0x26bf7f){return BPromise['reject'](_0x26bf7f);}return _0xece5c3['save']();};}function saveUpdates(_0x4cfc11,_0x3b8eb3){return function(_0xbec111){if(_0xbec111){return _0xbec111['update'](_0x4cfc11)[_0xdf1a('0x24')](function(_0xad4412){return _0xad4412;});}return null;};}function removeEntity(_0x433636,_0x8b9a97){return function(_0x4aad63){if(_0x4aad63){return _0x4aad63[_0xdf1a('0x25')]()[_0xdf1a('0x24')](function(){_0x433636[_0xdf1a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2669a4,_0x18eeae){return function(_0x4ebf0b){if(!_0x4ebf0b){_0x2669a4[_0xdf1a('0x1a')](0x194);}return _0x4ebf0b;};}function handleError(_0x2965dd,_0x4a1f16){_0x4a1f16=_0x4a1f16||0x1f4;return function(_0x55a28a){logger['error'](_0x55a28a[_0xdf1a('0x26')]);if(_0x55a28a[_0xdf1a('0x27')]){delete _0x55a28a[_0xdf1a('0x27')];}_0x2965dd[_0xdf1a('0x1c')](_0x4a1f16)[_0xdf1a('0x28')](_0x55a28a);};}exports[_0xdf1a('0x29')]=function(_0x3103c7,_0x3e7809){var _0x369755={},_0x5492b0={},_0x4e2181={'count':0x0,'rows':[]};var _0x207b01=_[_0xdf1a('0x2a')](db[_0xdf1a('0x2b')]['rawAttributes'],function(_0x30e1d7){return{'name':_0x30e1d7[_0xdf1a('0x2c')],'type':_0x30e1d7['type']['key']};});_0x5492b0['model']=_[_0xdf1a('0x2a')](_0x207b01,_0xdf1a('0x27'));_0x5492b0[_0xdf1a('0x2d')]=_[_0xdf1a('0x2e')](_0x3103c7['query']);_0x5492b0[_0xdf1a('0x2f')]=_[_0xdf1a('0x30')](_0x5492b0[_0xdf1a('0x31')],_0x5492b0[_0xdf1a('0x2d')]);_0x369755[_0xdf1a('0x32')]=_[_0xdf1a('0x30')](_0x5492b0[_0xdf1a('0x31')],qs[_0xdf1a('0x33')](_0x3103c7[_0xdf1a('0x2d')][_0xdf1a('0x33')]));_0x369755[_0xdf1a('0x32')]=_0x369755[_0xdf1a('0x32')][_0xdf1a('0x34')]?_0x369755[_0xdf1a('0x32')]:_0x5492b0[_0xdf1a('0x31')];if(!_0x3103c7[_0xdf1a('0x2d')][_0xdf1a('0x35')](_0xdf1a('0x36'))){_0x369755['limit']=qs['limit'](_0x3103c7['query']['limit']);_0x369755[_0xdf1a('0x1e')]=qs[_0xdf1a('0x1e')](_0x3103c7[_0xdf1a('0x2d')][_0xdf1a('0x1e')]);}_0x369755[_0xdf1a('0x37')]=qs[_0xdf1a('0x38')](_0x3103c7['query'][_0xdf1a('0x38')]);_0x369755['where']=qs[_0xdf1a('0x2f')](_[_0xdf1a('0x39')](_0x3103c7[_0xdf1a('0x2d')],_0x5492b0[_0xdf1a('0x2f')]),_0x207b01);if(_0x3103c7[_0xdf1a('0x2d')]['filter']){_0x369755[_0xdf1a('0x3a')]=_[_0xdf1a('0x3b')](_0x369755[_0xdf1a('0x3a')],{'$or':_[_0xdf1a('0x2a')](_0x207b01,function(_0x5cb539){if(_0x5cb539[_0xdf1a('0x3c')]!==_0xdf1a('0x3d')){var _0xbbeafa={};_0xbbeafa[_0x5cb539[_0xdf1a('0x27')]]={'$like':'%'+_0x3103c7[_0xdf1a('0x2d')][_0xdf1a('0x3e')]+'%'};return _0xbbeafa;}})});}_0x369755=_[_0xdf1a('0x3b')]({},_0x369755,_0x3103c7[_0xdf1a('0x3f')]);var _0x1685a4={'where':_0x369755['where']};return db['AnalyticFieldReport']['count'](_0x1685a4)[_0xdf1a('0x24')](function(_0x599566){_0x4e2181['count']=_0x599566;if(_0x3103c7[_0xdf1a('0x2d')][_0xdf1a('0x40')]){_0x369755[_0xdf1a('0x41')]=[{'all':!![]}];}return db[_0xdf1a('0x2b')][_0xdf1a('0x42')](_0x369755);})[_0xdf1a('0x24')](function(_0x5b801a){_0x4e2181[_0xdf1a('0x43')]=_0x5b801a;return _0x4e2181;})[_0xdf1a('0x24')](respondWithFilteredResult(_0x3e7809,_0x369755))[_0xdf1a('0x44')](handleError(_0x3e7809,null));};exports[_0xdf1a('0x45')]=function(_0x24dc33,_0x2cad84){var _0x55fd15={'raw':![],'where':{'id':_0x24dc33['params']['id']}},_0x2b1cc3={};_0x2b1cc3[_0xdf1a('0x31')]=_[_0xdf1a('0x2e')](db['AnalyticFieldReport']['rawAttributes']);_0x2b1cc3[_0xdf1a('0x2d')]=_[_0xdf1a('0x2e')](_0x24dc33[_0xdf1a('0x2d')]);_0x2b1cc3[_0xdf1a('0x2f')]=_[_0xdf1a('0x30')](_0x2b1cc3[_0xdf1a('0x31')],_0x2b1cc3['query']);_0x55fd15[_0xdf1a('0x32')]=_[_0xdf1a('0x30')](_0x2b1cc3[_0xdf1a('0x31')],qs[_0xdf1a('0x33')](_0x24dc33['query'][_0xdf1a('0x33')]));_0x55fd15['attributes']=_0x55fd15['attributes'][_0xdf1a('0x34')]?_0x55fd15[_0xdf1a('0x32')]:_0x2b1cc3[_0xdf1a('0x31')];if(_0x24dc33['query'][_0xdf1a('0x40')]){_0x55fd15[_0xdf1a('0x41')]=[{'all':!![]}];}_0x55fd15=_['merge']({},_0x55fd15,_0x24dc33['options']);return db[_0xdf1a('0x2b')][_0xdf1a('0x46')](_0x55fd15)[_0xdf1a('0x24')](handleEntityNotFound(_0x2cad84,null))[_0xdf1a('0x24')](respondWithResult(_0x2cad84,null))['catch'](handleError(_0x2cad84,null));};exports[_0xdf1a('0x47')]=function(_0x2ee028,_0x309c36){return db[_0xdf1a('0x2b')][_0xdf1a('0x47')](_0x2ee028[_0xdf1a('0x48')],{})[_0xdf1a('0x24')](respondWithResult(_0x309c36,0xc9))[_0xdf1a('0x44')](handleError(_0x309c36,null));};exports[_0xdf1a('0x49')]=function(_0x3581f3,_0x1a05b6){return db[_0xdf1a('0x2b')][_0xdf1a('0x49')](_0x3581f3[_0xdf1a('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1a05b6,0xc9))[_0xdf1a('0x44')](handleError(_0x1a05b6,null));};exports['update']=function(_0x659279,_0x308ed2){if(_0x659279[_0xdf1a('0x48')]['id']){delete _0x659279[_0xdf1a('0x48')]['id'];}return db['AnalyticFieldReport'][_0xdf1a('0x46')]({'where':{'id':_0x659279[_0xdf1a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x308ed2,null))[_0xdf1a('0x24')](saveUpdates(_0x659279[_0xdf1a('0x48')],null))[_0xdf1a('0x24')](respondWithResult(_0x308ed2,null))[_0xdf1a('0x44')](handleError(_0x308ed2,null));};exports[_0xdf1a('0x25')]=function(_0x1c8164,_0x272e28){return db[_0xdf1a('0x2b')][_0xdf1a('0x46')]({'where':{'id':_0x1c8164['params']['id']}})[_0xdf1a('0x24')](handleEntityNotFound(_0x272e28,null))[_0xdf1a('0x24')](removeEntity(_0x272e28,null))['catch'](handleError(_0x272e28,null));};exports['bulkDestroy']=function(_0x3d5472,_0x4b563f){return db[_0xdf1a('0x2b')][_0xdf1a('0x25')]({'where':{'id':_0x3d5472[_0xdf1a('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xdf1a('0x24')](respondWithResult(_0x4b563f,0xcc))[_0xdf1a('0x44')](handleError(_0x4b563f,null));};exports[_0xdf1a('0x4b')]=function(_0x5396fa,_0x59e91c,_0x1a5a6e){return db[_0xdf1a('0x4c')][_0xdf1a('0x4d')]({'where':{'id':_0x5396fa[_0xdf1a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x59e91c,null))[_0xdf1a('0x24')](function(_0x85fad){if(_0x85fad){return db[_0xdf1a('0x4e')][_0xdf1a('0x4f')](function(_0x164f73){return db[_0xdf1a('0x2b')]['destroy']({'where':{'CustomReportId':_0x5396fa[_0xdf1a('0x4a')]['id']},'transaction':_0x164f73})[_0xdf1a('0x24')](function(_0x26079d){var _0x287a35=_[_0xdf1a('0x2a')](_0x5396fa[_0xdf1a('0x48')],function(_0x5713cb){delete _0x5713cb['id'];_0x5713cb[_0xdf1a('0x50')]=_0x5396fa['params']['id'];return _0x5713cb;});return db[_0xdf1a('0x2b')][_0xdf1a('0x49')](_0x287a35,{'transaction':_0x164f73});});})[_0xdf1a('0x24')](function(){return db[_0xdf1a('0x2b')][_0xdf1a('0x42')]({'where':{'CustomReportId':_0x5396fa[_0xdf1a('0x4a')]['id']}});});}})['then'](respondWithResult(_0x59e91c,null))[_0xdf1a('0x44')](handleError(_0x59e91c,null));}; \ No newline at end of file +var _0x050a=['limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','AnalyticFieldReport','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','create','body','bulkCreate','find','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','rimraf','zip-dir','request-promise','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','offset'];(function(_0x41b986,_0x5a1dc2){var _0x5ede09=function(_0x2b91ff){while(--_0x2b91ff){_0x41b986['push'](_0x41b986['shift']());}};_0x5ede09(++_0x5a1dc2);}(_0x050a,0x1c9));var _0xa050=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x050a[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa050('0x0'));var zipdir=require(_0xa050('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa050('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa050('0x3'));var path=require(_0xa050('0x4'));var sox=require('sox');var csv=require(_0xa050('0x5'));var ejs=require(_0xa050('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa050('0x7'));var squel=require(_0xa050('0x8'));var crypto=require(_0xa050('0x9'));var jsforce=require(_0xa050('0xa'));var deskjs=require(_0xa050('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa050('0xc'));var Redis=require('ioredis');var authService=require(_0xa050('0xd'));var qs=require(_0xa050('0xe'));var as=require(_0xa050('0xf'));var hardwareService=require(_0xa050('0x10'));var logger=require('../../config/logger')(_0xa050('0x11'));var utils=require(_0xa050('0x12'));var config=require(_0xa050('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa050('0x14'))['db'];function respondWithStatusCode(_0x42a5a8,_0x4ff1ef){_0x4ff1ef=_0x4ff1ef||0xcc;return function(_0x13f9d2){if(_0x13f9d2){return _0x42a5a8['sendStatus'](_0x4ff1ef);}return _0x42a5a8[_0xa050('0x15')](_0x4ff1ef)['end']();};}function respondWithResult(_0x408c22,_0x38461d){_0x38461d=_0x38461d||0xc8;return function(_0x54d97e){if(_0x54d97e){return _0x408c22[_0xa050('0x15')](_0x38461d)['json'](_0x54d97e);}};}function respondWithFilteredResult(_0x6f4364,_0x5145a4){return function(_0x14e35f){if(_0x14e35f){var _0x333265=typeof _0x5145a4[_0xa050('0x16')]==='undefined'&&typeof _0x5145a4[_0xa050('0x17')]==='undefined';var _0x1977d5=_0x14e35f[_0xa050('0x18')];var _0xf4cf79=_0x333265?0x0:_0x5145a4[_0xa050('0x16')];var _0x67eda1=_0x333265?_0x14e35f[_0xa050('0x18')]:_0x5145a4['offset']+_0x5145a4['limit'];var _0x4554e0;if(_0x67eda1>=_0x1977d5){_0x67eda1=_0x1977d5;_0x4554e0=0xc8;}else{_0x4554e0=0xce;}_0x6f4364[_0xa050('0x15')](_0x4554e0);return _0x6f4364[_0xa050('0x19')](_0xa050('0x1a'),_0xf4cf79+'-'+_0x67eda1+'/'+_0x1977d5)[_0xa050('0x1b')](_0x14e35f);}return null;};}function patchUpdates(_0x35f56e){return function(_0x1b298e){try{jsonpatch[_0xa050('0x1c')](_0x1b298e,_0x35f56e,!![]);}catch(_0x3c9b21){return BPromise[_0xa050('0x1d')](_0x3c9b21);}return _0x1b298e[_0xa050('0x1e')]();};}function saveUpdates(_0x59dcf7,_0x28bade){return function(_0x1eae7f){if(_0x1eae7f){return _0x1eae7f[_0xa050('0x1f')](_0x59dcf7)[_0xa050('0x20')](function(_0x2b405e){return _0x2b405e;});}return null;};}function removeEntity(_0x25ce0c,_0x319f65){return function(_0x454bc3){if(_0x454bc3){return _0x454bc3['destroy']()[_0xa050('0x20')](function(){_0x25ce0c[_0xa050('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x339dba,_0x3ea498){return function(_0x1cdd61){if(!_0x1cdd61){_0x339dba[_0xa050('0x21')](0x194);}return _0x1cdd61;};}function handleError(_0x28caec,_0x3f8703){_0x3f8703=_0x3f8703||0x1f4;return function(_0x111035){logger[_0xa050('0x22')](_0x111035[_0xa050('0x23')]);if(_0x111035[_0xa050('0x24')]){delete _0x111035[_0xa050('0x24')];}_0x28caec[_0xa050('0x15')](_0x3f8703)[_0xa050('0x25')](_0x111035);};}exports[_0xa050('0x26')]=function(_0x2cd15b,_0x40573b){var _0xc5ae43={},_0x44b187={},_0x3490ac={'count':0x0,'rows':[]};var _0x5ee031=_['map'](db[_0xa050('0x27')]['rawAttributes'],function(_0x5929f8){return{'name':_0x5929f8['fieldName'],'type':_0x5929f8['type']['key']};});_0x44b187[_0xa050('0x28')]=_['map'](_0x5ee031,'name');_0x44b187[_0xa050('0x29')]=_['keys'](_0x2cd15b[_0xa050('0x29')]);_0x44b187[_0xa050('0x2a')]=_[_0xa050('0x2b')](_0x44b187[_0xa050('0x28')],_0x44b187[_0xa050('0x29')]);_0xc5ae43[_0xa050('0x2c')]=_[_0xa050('0x2b')](_0x44b187[_0xa050('0x28')],qs[_0xa050('0x2d')](_0x2cd15b[_0xa050('0x29')][_0xa050('0x2d')]));_0xc5ae43['attributes']=_0xc5ae43[_0xa050('0x2c')][_0xa050('0x2e')]?_0xc5ae43[_0xa050('0x2c')]:_0x44b187[_0xa050('0x28')];if(!_0x2cd15b[_0xa050('0x29')][_0xa050('0x2f')](_0xa050('0x30'))){_0xc5ae43[_0xa050('0x17')]=qs[_0xa050('0x17')](_0x2cd15b[_0xa050('0x29')]['limit']);_0xc5ae43[_0xa050('0x16')]=qs[_0xa050('0x16')](_0x2cd15b[_0xa050('0x29')][_0xa050('0x16')]);}_0xc5ae43[_0xa050('0x31')]=qs['sort'](_0x2cd15b['query'][_0xa050('0x32')]);_0xc5ae43[_0xa050('0x33')]=qs[_0xa050('0x2a')](_[_0xa050('0x34')](_0x2cd15b[_0xa050('0x29')],_0x44b187['filters']),_0x5ee031);if(_0x2cd15b['query'][_0xa050('0x35')]){_0xc5ae43['where']=_[_0xa050('0x36')](_0xc5ae43[_0xa050('0x33')],{'$or':_[_0xa050('0x37')](_0x5ee031,function(_0xf85942){if(_0xf85942[_0xa050('0x38')]!=='VIRTUAL'){var _0x411e6f={};_0x411e6f[_0xf85942[_0xa050('0x24')]]={'$like':'%'+_0x2cd15b[_0xa050('0x29')][_0xa050('0x35')]+'%'};return _0x411e6f;}})});}_0xc5ae43=_['merge']({},_0xc5ae43,_0x2cd15b[_0xa050('0x39')]);var _0x3063f5={'where':_0xc5ae43[_0xa050('0x33')]};return db['AnalyticFieldReport'][_0xa050('0x18')](_0x3063f5)['then'](function(_0x20dc52){_0x3490ac[_0xa050('0x18')]=_0x20dc52;if(_0x2cd15b['query'][_0xa050('0x3a')]){_0xc5ae43['include']=[{'all':!![]}];}return db[_0xa050('0x27')]['findAll'](_0xc5ae43);})[_0xa050('0x20')](function(_0x14c28a){_0x3490ac[_0xa050('0x3b')]=_0x14c28a;return _0x3490ac;})[_0xa050('0x20')](respondWithFilteredResult(_0x40573b,_0xc5ae43))[_0xa050('0x3c')](handleError(_0x40573b,null));};exports[_0xa050('0x3d')]=function(_0x19c036,_0x434dd5){var _0x2f3278={'raw':![],'where':{'id':_0x19c036[_0xa050('0x3e')]['id']}},_0x13a00a={};_0x13a00a[_0xa050('0x28')]=_[_0xa050('0x3f')](db[_0xa050('0x27')][_0xa050('0x40')]);_0x13a00a[_0xa050('0x29')]=_[_0xa050('0x3f')](_0x19c036['query']);_0x13a00a[_0xa050('0x2a')]=_[_0xa050('0x2b')](_0x13a00a[_0xa050('0x28')],_0x13a00a[_0xa050('0x29')]);_0x2f3278['attributes']=_['intersection'](_0x13a00a[_0xa050('0x28')],qs['fields'](_0x19c036['query'][_0xa050('0x2d')]));_0x2f3278[_0xa050('0x2c')]=_0x2f3278['attributes']['length']?_0x2f3278[_0xa050('0x2c')]:_0x13a00a[_0xa050('0x28')];if(_0x19c036[_0xa050('0x29')][_0xa050('0x3a')]){_0x2f3278[_0xa050('0x41')]=[{'all':!![]}];}_0x2f3278=_[_0xa050('0x36')]({},_0x2f3278,_0x19c036[_0xa050('0x39')]);return db[_0xa050('0x27')]['find'](_0x2f3278)['then'](handleEntityNotFound(_0x434dd5,null))[_0xa050('0x20')](respondWithResult(_0x434dd5,null))[_0xa050('0x3c')](handleError(_0x434dd5,null));};exports[_0xa050('0x42')]=function(_0x2ac54d,_0x4b1828){return db['AnalyticFieldReport']['create'](_0x2ac54d[_0xa050('0x43')],{})['then'](respondWithResult(_0x4b1828,0xc9))['catch'](handleError(_0x4b1828,null));};exports['bulkCreate']=function(_0x564523,_0x19f08f){return db[_0xa050('0x27')][_0xa050('0x44')](_0x564523[_0xa050('0x43')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x19f08f,0xc9))[_0xa050('0x3c')](handleError(_0x19f08f,null));};exports['update']=function(_0x3cc794,_0x511e69){if(_0x3cc794[_0xa050('0x43')]['id']){delete _0x3cc794['body']['id'];}return db[_0xa050('0x27')][_0xa050('0x45')]({'where':{'id':_0x3cc794['params']['id']}})[_0xa050('0x20')](handleEntityNotFound(_0x511e69,null))[_0xa050('0x20')](saveUpdates(_0x3cc794[_0xa050('0x43')],null))[_0xa050('0x20')](respondWithResult(_0x511e69,null))['catch'](handleError(_0x511e69,null));};exports[_0xa050('0x46')]=function(_0x2ee91c,_0x10ebc6){return db[_0xa050('0x27')][_0xa050('0x45')]({'where':{'id':_0x2ee91c[_0xa050('0x3e')]['id']}})[_0xa050('0x20')](handleEntityNotFound(_0x10ebc6,null))[_0xa050('0x20')](removeEntity(_0x10ebc6,null))[_0xa050('0x3c')](handleError(_0x10ebc6,null));};exports[_0xa050('0x47')]=function(_0x1f402b,_0x2cf7ec){return db['AnalyticFieldReport'][_0xa050('0x46')]({'where':{'id':_0x1f402b[_0xa050('0x29')][_0xa050('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0xa050('0x20')](respondWithResult(_0x2cf7ec,0xcc))['catch'](handleError(_0x2cf7ec,null));};exports[_0xa050('0x49')]=function(_0x38ebca,_0x25ba24,_0xfad29c){return db[_0xa050('0x4a')][_0xa050('0x4b')]({'where':{'id':_0x38ebca[_0xa050('0x3e')]['id']}})[_0xa050('0x20')](handleEntityNotFound(_0x25ba24,null))[_0xa050('0x20')](function(_0x54832f){if(_0x54832f){return db[_0xa050('0x4c')][_0xa050('0x4d')](function(_0x1d3934){return db[_0xa050('0x27')][_0xa050('0x46')]({'where':{'CustomReportId':_0x38ebca[_0xa050('0x3e')]['id']},'transaction':_0x1d3934})['then'](function(_0xccc2ac){var _0x2de85d=_['map'](_0x38ebca[_0xa050('0x43')],function(_0x43c919){delete _0x43c919['id'];_0x43c919[_0xa050('0x4e')]=_0x38ebca[_0xa050('0x3e')]['id'];return _0x43c919;});return db[_0xa050('0x27')][_0xa050('0x44')](_0x2de85d,{'transaction':_0x1d3934});});})[_0xa050('0x20')](function(){return db['AnalyticFieldReport'][_0xa050('0x4f')]({'where':{'CustomReportId':_0x38ebca[_0xa050('0x3e')]['id']}});});}})[_0xa050('0x20')](respondWithResult(_0x25ba24,null))['catch'](handleError(_0x25ba24,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 6bfd22c..419862d 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 _0x1a27=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','path','rimraf'];(function(_0x50746d,_0x4158db){var _0x44d576=function(_0x866f48){while(--_0x866f48){_0x50746d['push'](_0x50746d['shift']());}};_0x44d576(++_0x4158db);}(_0x1a27,0xa2));var _0x71a2=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x1a27[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x71a2('0x0'));var util=require('util');var logger=require(_0x71a2('0x1'))(_0x71a2('0x2'));var moment=require(_0x71a2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x71a2('0x4'));var rimraf=require(_0x71a2('0x5'));var config=require(_0x71a2('0x6'));var attributes=require(_0x71a2('0x7'));module[_0x71a2('0x8')]=function(_0x2aafd3,_0x3ecb74){return _0x2aafd3[_0x71a2('0x9')](_0x71a2('0xa'),attributes,{'tableName':_0x71a2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad1d=['rimraf','../../config/environment','exports','define','lodash','util','api','moment','request-promise','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xad1d,0xc2));var _0xdad1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xad1d[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xdad1('0x0'));var util=require(_0xdad1('0x1'));var logger=require('../../config/logger')(_0xdad1('0x2'));var moment=require(_0xdad1('0x3'));var BPromise=require('bluebird');var rp=require(_0xdad1('0x4'));var fs=require('fs');var path=require(_0xdad1('0x5'));var rimraf=require(_0xdad1('0x6'));var config=require(_0xdad1('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0xdad1('0x8')]=function(_0x166a72,_0x136c63){return _0x166a72[_0xdad1('0x9')]('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 a8d9a80..f1730a9 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 _0x234c=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1d23dc,_0x4637ea){var _0x2f34dc=function(_0x15360a){while(--_0x15360a){_0x1d23dc['push'](_0x1d23dc['shift']());}};_0x2f34dc(++_0x4637ea);}(_0x234c,0x87));var _0xc234=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x234c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc234('0x0'));var util=require(_0xc234('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc234('0x2'));var fs=require('fs');var Redis=require(_0xc234('0x3'));var db=require(_0xc234('0x4'))['db'];var utils=require(_0xc234('0x5'));var logger=require(_0xc234('0x6'))(_0xc234('0x7'));var config=require(_0xc234('0x8'));var jayson=require(_0xc234('0x9'));var client=jayson['client'][_0xc234('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dd9fb,_0x5af6d1,_0x5a5d12){return new BPromise(function(_0xb50aae,_0x22633c){return client[_0xc234('0xb')](_0x3dd9fb,_0x5a5d12)['then'](function(_0x146692){logger[_0xc234('0xc')](_0xc234('0xd'),_0x5af6d1,_0xc234('0xe'));logger['debug'](_0xc234('0xf'),_0x5af6d1,'request\x20sent',JSON[_0xc234('0x10')](_0x146692));if(_0x146692[_0xc234('0x11')]){if(_0x146692[_0xc234('0x11')][_0xc234('0x12')]===0x1f4){logger[_0xc234('0x11')](_0xc234('0xd'),_0x5af6d1,_0x146692[_0xc234('0x11')]['message']);return _0x22633c(_0x146692['error'][_0xc234('0x13')]);}logger[_0xc234('0x11')](_0xc234('0xd'),_0x5af6d1,_0x146692[_0xc234('0x11')][_0xc234('0x13')]);return _0xb50aae(_0x146692[_0xc234('0x11')][_0xc234('0x13')]);}else{logger['info'](_0xc234('0xd'),_0x5af6d1,_0xc234('0xe'));_0xb50aae(_0x146692[_0xc234('0x14')]['message']);}})[_0xc234('0x15')](function(_0x4318e5){logger[_0xc234('0x11')](_0xc234('0xd'),_0x5af6d1,_0x4318e5);_0x22633c(_0x4318e5);});});} \ No newline at end of file +var _0xcc90=['request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xcc90,0x165));var _0x0cc9=function(_0x24cba9,_0x12f3b7){_0x24cba9=_0x24cba9-0x0;var _0x376d70=_0xcc90[_0x24cba9];return _0x376d70;};'use strict';var _=require(_0x0cc9('0x0'));var util=require(_0x0cc9('0x1'));var moment=require(_0x0cc9('0x2'));var BPromise=require(_0x0cc9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cc9('0x4'))['db'];var utils=require(_0x0cc9('0x5'));var logger=require(_0x0cc9('0x6'))(_0x0cc9('0x7'));var config=require(_0x0cc9('0x8'));var jayson=require(_0x0cc9('0x9'));var client=jayson[_0x0cc9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x543d9e,_0x356397,_0x42e553){return new BPromise(function(_0x2f3811,_0x13e4ea){return client[_0x0cc9('0xb')](_0x543d9e,_0x42e553)[_0x0cc9('0xc')](function(_0x3ff3f2){logger[_0x0cc9('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x356397,_0x0cc9('0xe'));logger[_0x0cc9('0xf')](_0x0cc9('0x10'),_0x356397,_0x0cc9('0xe'),JSON[_0x0cc9('0x11')](_0x3ff3f2));if(_0x3ff3f2['error']){if(_0x3ff3f2[_0x0cc9('0x12')][_0x0cc9('0x13')]===0x1f4){logger['error'](_0x0cc9('0x14'),_0x356397,_0x3ff3f2[_0x0cc9('0x12')]['message']);return _0x13e4ea(_0x3ff3f2[_0x0cc9('0x12')][_0x0cc9('0x15')]);}logger[_0x0cc9('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x356397,_0x3ff3f2['error'][_0x0cc9('0x15')]);return _0x2f3811(_0x3ff3f2[_0x0cc9('0x12')]['message']);}else{logger[_0x0cc9('0xd')](_0x0cc9('0x14'),_0x356397,'request\x20sent');_0x2f3811(_0x3ff3f2[_0x0cc9('0x16')][_0x0cc9('0x15')]);}})['catch'](function(_0x22c5c4){logger[_0x0cc9('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x356397,_0x22c5c4);_0x13e4ea(_0x22c5c4);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index ed81fdf..c33c2a4 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(_0x59460f,_0x6111f6){var _0x4f2922=function(_0x3e981b){while(--_0x3e981b){_0x59460f['push'](_0x59460f['shift']());}};_0x4f2922(++_0x6111f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x5a5f78,_0x4439d0){var _0xcf607f=function(_0x3b947f){while(--_0x3b947f){_0x5a5f78['push'](_0x5a5f78['shift']());}};_0xcf607f(++_0x4439d0);}(_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['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 4b5c10e..627eeb4 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 _0xe890=['name','TEXT','STRING'];(function(_0x5e31f1,_0x3ac6e6){var _0x1059af=function(_0x599660){while(--_0x599660){_0x5e31f1['push'](_0x5e31f1['shift']());}};_0x1059af(++_0x3ac6e6);}(_0xe890,0x1a6));var _0x0e89=function(_0x3fa834,_0x20776b){_0x3fa834=_0x3fa834-0x0;var _0x5de924=_0xe890[_0x3fa834];return _0x5de924;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0e89('0x0')],'allowNull':![],'unique':_0x0e89('0x1')},'table':{'type':Sequelize[_0x0e89('0x0')]},'metric':{'type':Sequelize[_0x0e89('0x2')]},'description':{'type':Sequelize[_0x0e89('0x0')]}}; \ No newline at end of file +var _0x7d80=['name','TEXT','exports','STRING'];(function(_0x1b40b5,_0x25e063){var _0x5f0a6e=function(_0x22af6d){while(--_0x22af6d){_0x1b40b5['push'](_0x1b40b5['shift']());}};_0x5f0a6e(++_0x25e063);}(_0x7d80,0x17a));var _0x07d8=function(_0x2045c7,_0x3e2324){_0x2045c7=_0x2045c7-0x0;var _0x5e53e1=_0x7d80[_0x2045c7];return _0x5e53e1;};'use strict';var Sequelize=require('sequelize');module[_0x07d8('0x0')]={'name':{'type':Sequelize[_0x07d8('0x1')],'allowNull':![],'unique':_0x07d8('0x2')},'table':{'type':Sequelize[_0x07d8('0x1')]},'metric':{'type':Sequelize[_0x07d8('0x3')]},'description':{'type':Sequelize[_0x07d8('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 77c1570..c538353 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 _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','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','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x52a3cc,_0x50fe3f){var _0x55b25f=function(_0xdf5ff0){while(--_0xdf5ff0){_0x52a3cc['push'](_0x52a3cc['shift']());}};_0x55b25f(++_0x50fe3f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x24ca[_0x2ed8f3];return _0x525a55;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));}; \ No newline at end of file +var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','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','sendStatus','end','status','json'];(function(_0x5ab7d2,_0x608bdb){var _0x12af06=function(_0x43c2e1){while(--_0x43c2e1){_0x5ab7d2['push'](_0x5ab7d2['shift']());}};_0x12af06(++_0x608bdb);}(_0xe5b3,0x133));var _0x3e5b=function(_0x2e2768,_0x5d6ccd){_0x2e2768=_0x2e2768-0x0;var _0x483254=_0xe5b3[_0x2e2768];return _0x483254;};'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'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 4f2a529..c70ddad 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 _0x8b8e=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x1d2fd9,_0xe4736a){var _0x5d98b6=function(_0x436d0d){while(--_0x436d0d){_0x1d2fd9['push'](_0x1d2fd9['shift']());}};_0x5d98b6(++_0xe4736a);}(_0x8b8e,0x108));var _0xe8b8=function(_0x580e45,_0x4007a5){_0x580e45=_0x580e45-0x0;var _0x1b4239=_0x8b8e[_0x580e45];return _0x1b4239;};'use strict';var _=require(_0xe8b8('0x0'));var util=require('util');var logger=require(_0xe8b8('0x1'))('api');var moment=require(_0xe8b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8b8('0x3'));var rimraf=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var attributes=require(_0xe8b8('0x6'));module[_0xe8b8('0x7')]=function(_0x3f5dd7,_0x1c0548){return _0x3f5dd7[_0xe8b8('0x8')](_0xe8b8('0x9'),attributes,{'tableName':_0xe8b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82c4=['AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./analyticMetric.attributes','define'];(function(_0x2af6e9,_0x315547){var _0x5ae10e=function(_0x2702eb){while(--_0x2702eb){_0x2af6e9['push'](_0x2af6e9['shift']());}};_0x5ae10e(++_0x315547);}(_0x82c4,0x1ca));var _0x482c=function(_0x5a0e32,_0x347ae2){_0x5a0e32=_0x5a0e32-0x0;var _0xea8f24=_0x82c4[_0x5a0e32];return _0xea8f24;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));module['exports']=function(_0x477cf4,_0x5d7c76){return _0x477cf4[_0x482c('0x9')](_0x482c('0xa'),attributes,{'tableName':_0x482c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 9d6b406..d1dfb47 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 _0x2e12=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x2fb572,_0x5cd07c){var _0x3a2b77=function(_0x311479){while(--_0x311479){_0x2fb572['push'](_0x2fb572['shift']());}};_0x3a2b77(++_0x5cd07c);}(_0x2e12,0x141));var _0x22e1=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x2e12[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0x22e1('0x0'));var util=require('util');var moment=require(_0x22e1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x22e1('0x2'));var db=require(_0x22e1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x22e1('0x4'))(_0x22e1('0x5'));var config=require(_0x22e1('0x6'));var jayson=require(_0x22e1('0x7'));var client=jayson[_0x22e1('0x8')][_0x22e1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22f99c,_0x30f064,_0x549b57){return new BPromise(function(_0x302469,_0x2a379a){return client[_0x22e1('0xa')](_0x22f99c,_0x549b57)[_0x22e1('0xb')](function(_0x29939c){logger[_0x22e1('0xc')](_0x22e1('0xd'),_0x30f064,_0x22e1('0xe'));logger['debug'](_0x22e1('0xf'),_0x30f064,_0x22e1('0xe'),JSON[_0x22e1('0x10')](_0x29939c));if(_0x29939c[_0x22e1('0x11')]){if(_0x29939c[_0x22e1('0x11')][_0x22e1('0x12')]===0x1f4){logger[_0x22e1('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x30f064,_0x29939c[_0x22e1('0x11')]['message']);return _0x2a379a(_0x29939c[_0x22e1('0x11')]['message']);}logger[_0x22e1('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x30f064,_0x29939c[_0x22e1('0x11')][_0x22e1('0x13')]);return _0x302469(_0x29939c[_0x22e1('0x11')][_0x22e1('0x13')]);}else{logger[_0x22e1('0xc')](_0x22e1('0xd'),_0x30f064,_0x22e1('0xe'));_0x302469(_0x29939c['result'][_0x22e1('0x13')]);}})[_0x22e1('0x14')](function(_0xb7c0c4){logger[_0x22e1('0x11')](_0x22e1('0xd'),_0x30f064,_0xb7c0c4);_0x2a379a(_0xb7c0c4);});});} \ No newline at end of file +var _0x20fb=['jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0x20fb,0xfd));var _0xb20f=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x20fb[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require('lodash');var util=require(_0xb20f('0x0'));var moment=require(_0xb20f('0x1'));var BPromise=require(_0xb20f('0x2'));var rs=require(_0xb20f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb20f('0x4'));var logger=require('../../config/logger')(_0xb20f('0x5'));var config=require(_0xb20f('0x6'));var jayson=require(_0xb20f('0x7'));var client=jayson[_0xb20f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x239d3c,_0x1d07e6,_0xc1b3a6){return new BPromise(function(_0xf09d4,_0x3ad78d){return client[_0xb20f('0x9')](_0x239d3c,_0xc1b3a6)[_0xb20f('0xa')](function(_0x4a117b){logger[_0xb20f('0xb')](_0xb20f('0xc'),_0x1d07e6,'request\x20sent');logger['debug'](_0xb20f('0xd'),_0x1d07e6,_0xb20f('0xe'),JSON[_0xb20f('0xf')](_0x4a117b));if(_0x4a117b[_0xb20f('0x10')]){if(_0x4a117b[_0xb20f('0x10')][_0xb20f('0x11')]===0x1f4){logger[_0xb20f('0x10')](_0xb20f('0xc'),_0x1d07e6,_0x4a117b['error']['message']);return _0x3ad78d(_0x4a117b[_0xb20f('0x10')][_0xb20f('0x12')]);}logger[_0xb20f('0x10')](_0xb20f('0xc'),_0x1d07e6,_0x4a117b[_0xb20f('0x10')]['message']);return _0xf09d4(_0x4a117b[_0xb20f('0x10')][_0xb20f('0x12')]);}else{logger[_0xb20f('0xb')](_0xb20f('0xc'),_0x1d07e6,_0xb20f('0xe'));_0xf09d4(_0x4a117b['result'][_0xb20f('0x12')]);}})[_0xb20f('0x13')](function(_0x570310){logger[_0xb20f('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x1d07e6,_0x570310);_0x3ad78d(_0x570310);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index d8c510b..6232b90 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 _0x78e0=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x15cf0d,_0x3ebfe8){var _0x4864d4=function(_0x24f7fd){while(--_0x24f7fd){_0x15cf0d['push'](_0x15cf0d['shift']());}};_0x4864d4(++_0x3ebfe8);}(_0x78e0,0x13e));var _0x078e=function(_0x5e8c0f,_0x1f20d9){_0x5e8c0f=_0x5e8c0f-0x0;var _0x568dbe=_0x78e0[_0x5e8c0f];return _0x568dbe;};'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')]('/',auth[_0x078e('0xa')](),controller[_0x078e('0xb')]);router[_0x078e('0x9')]('/:id',auth[_0x078e('0xa')](),controller[_0x078e('0xc')]);router[_0x078e('0xd')]('/',auth[_0x078e('0xa')](),controller[_0x078e('0xe')]);router[_0x078e('0xf')](_0x078e('0x10'),auth['isAuthenticated'](),controller[_0x078e('0x11')]);router[_0x078e('0x12')](_0x078e('0x10'),auth[_0x078e('0xa')](),controller[_0x078e('0x13')]);module[_0x078e('0x14')]=router; \ No newline at end of file +var _0x448b=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0x448b,0x125));var _0xb448=function(_0x4c55ba,_0x542e34){_0x4c55ba=_0x4c55ba-0x0;var _0x5ac408=_0x448b[_0x4c55ba];return _0x5ac408;};'use strict';var multer=require(_0xb448('0x0'));var util=require(_0xb448('0x1'));var path=require(_0xb448('0x2'));var timeout=require(_0xb448('0x3'));var express=require(_0xb448('0x4'));var router=express[_0xb448('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb448('0x6'));var interaction=require(_0xb448('0x7'));var config=require(_0xb448('0x8'));var controller=require(_0xb448('0x9'));router[_0xb448('0xa')]('/',auth[_0xb448('0xb')](),controller[_0xb448('0xc')]);router['get'](_0xb448('0xd'),auth[_0xb448('0xb')](),controller[_0xb448('0xe')]);router[_0xb448('0xf')]('/',auth[_0xb448('0xb')](),controller[_0xb448('0x10')]);router[_0xb448('0x11')](_0xb448('0xd'),auth['isAuthenticated'](),controller[_0xb448('0x12')]);router[_0xb448('0x13')](_0xb448('0xd'),auth[_0xb448('0xb')](),controller[_0xb448('0x14')]);module[_0xb448('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 8ca561c..92a927c 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 _0x05cd=['TEXT','sequelize','exports'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x05cd,0x1bd));var _0xd05c=function(_0x16545f,_0x10adb1){_0x16545f=_0x16545f-0x0;var _0x4db039=_0x05cd[_0x16545f];return _0x4db039;};'use strict';var Sequelize=require(_0xd05c('0x0'));module[_0xd05c('0x1')]={'tree':{'type':Sequelize[_0xd05c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x80d1=['exports','TEXT','sequelize'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x80d1,0x1d0));var _0x180d=function(_0x5202c8,_0x30468f){_0x5202c8=_0x5202c8-0x0;var _0x3d318d=_0x80d1[_0x5202c8];return _0x3d318d;};'use strict';var Sequelize=require(_0x180d('0x0'));module[_0x180d('0x1')]={'tree':{'type':Sequelize[_0x180d('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 5bd3834..26a1d7d 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 _0xd1e3=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','rawAttributes','keys','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd1e3,0x15f));var _0x3d1e=function(_0x54b749,_0x45913f){_0x54b749=_0x54b749-0x0;var _0x5a1b77=_0xd1e3[_0x54b749];return _0x5a1b77;};'use strict';var emlformat=require(_0x3d1e('0x0'));var rimraf=require(_0x3d1e('0x1'));var zipdir=require(_0x3d1e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3d1e('0x3'));var moment=require(_0x3d1e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3d1e('0x5'));var sox=require(_0x3d1e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d1e('0x7'));var _=require(_0x3d1e('0x8'));var squel=require('squel');var crypto=require(_0x3d1e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3d1e('0xa'));var toCsv=require(_0x3d1e('0xb'));var querystring=require(_0x3d1e('0xc'));var Papa=require('papaparse');var Redis=require(_0x3d1e('0xd'));var authService=require(_0x3d1e('0xe'));var qs=require(_0x3d1e('0xf'));var as=require(_0x3d1e('0x10'));var hardwareService=require(_0x3d1e('0x11'));var logger=require(_0x3d1e('0x12'))(_0x3d1e('0x13'));var utils=require(_0x3d1e('0x14'));var config=require(_0x3d1e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d1e('0x16'))['db'];function respondWithStatusCode(_0x116255,_0x4df691){_0x4df691=_0x4df691||0xcc;return function(_0x4ec761){if(_0x4ec761){return _0x116255[_0x3d1e('0x17')](_0x4df691);}return _0x116255[_0x3d1e('0x18')](_0x4df691)[_0x3d1e('0x19')]();};}function respondWithResult(_0x1c7823,_0x5e587d){_0x5e587d=_0x5e587d||0xc8;return function(_0x2529b0){if(_0x2529b0){return _0x1c7823['status'](_0x5e587d)[_0x3d1e('0x1a')](_0x2529b0);}};}function respondWithFilteredResult(_0x41df22,_0x19f9ae){return function(_0x480a49){if(_0x480a49){var _0x3c56fa=typeof _0x19f9ae['offset']===_0x3d1e('0x1b')&&typeof _0x19f9ae[_0x3d1e('0x1c')]===_0x3d1e('0x1b');var _0x2728bf=_0x480a49[_0x3d1e('0x1d')];var _0x4c441f=_0x3c56fa?0x0:_0x19f9ae[_0x3d1e('0x1e')];var _0x1e8de3=_0x3c56fa?_0x480a49[_0x3d1e('0x1d')]:_0x19f9ae[_0x3d1e('0x1e')]+_0x19f9ae[_0x3d1e('0x1c')];var _0x76074e;if(_0x1e8de3>=_0x2728bf){_0x1e8de3=_0x2728bf;_0x76074e=0xc8;}else{_0x76074e=0xce;}_0x41df22[_0x3d1e('0x18')](_0x76074e);return _0x41df22['set'](_0x3d1e('0x1f'),_0x4c441f+'-'+_0x1e8de3+'/'+_0x2728bf)[_0x3d1e('0x1a')](_0x480a49);}return null;};}function patchUpdates(_0x4af102){return function(_0x5c783f){try{jsonpatch[_0x3d1e('0x20')](_0x5c783f,_0x4af102,!![]);}catch(_0x4e80fe){return BPromise[_0x3d1e('0x21')](_0x4e80fe);}return _0x5c783f[_0x3d1e('0x22')]();};}function saveUpdates(_0x48f826,_0x2c45cb){return function(_0x57f058){if(_0x57f058){return _0x57f058[_0x3d1e('0x23')](_0x48f826)[_0x3d1e('0x24')](function(_0x1d818f){return _0x1d818f;});}return null;};}function removeEntity(_0x2576cf,_0x180521){return function(_0x500b2a){if(_0x500b2a){return _0x500b2a[_0x3d1e('0x25')]()['then'](function(){_0x2576cf[_0x3d1e('0x18')](0xcc)[_0x3d1e('0x19')]();});}};}function handleEntityNotFound(_0x2bf1d2,_0xa19acb){return function(_0x11a72a){if(!_0x11a72a){_0x2bf1d2[_0x3d1e('0x17')](0x194);}return _0x11a72a;};}function handleError(_0x309797,_0x44c95d){_0x44c95d=_0x44c95d||0x1f4;return function(_0x319cdc){logger[_0x3d1e('0x26')](_0x319cdc[_0x3d1e('0x27')]);if(_0x319cdc[_0x3d1e('0x28')]){delete _0x319cdc['name'];}_0x309797['status'](_0x44c95d)[_0x3d1e('0x29')](_0x319cdc);};}exports[_0x3d1e('0x2a')]=function(_0x3f29ff,_0x2545a3){var _0x21b3d3={},_0x46d413={},_0x4f4858={'count':0x0,'rows':[]};var _0x15f9e7=_[_0x3d1e('0x2b')](db[_0x3d1e('0x2c')]['rawAttributes'],function(_0x55cfc2){return{'name':_0x55cfc2[_0x3d1e('0x2d')],'type':_0x55cfc2[_0x3d1e('0x2e')]['key']};});_0x46d413['model']=_['map'](_0x15f9e7,_0x3d1e('0x28'));_0x46d413[_0x3d1e('0x2f')]=_['keys'](_0x3f29ff['query']);_0x46d413[_0x3d1e('0x30')]=_['intersection'](_0x46d413[_0x3d1e('0x31')],_0x46d413[_0x3d1e('0x2f')]);_0x21b3d3[_0x3d1e('0x32')]=_[_0x3d1e('0x33')](_0x46d413[_0x3d1e('0x31')],qs[_0x3d1e('0x34')](_0x3f29ff['query'][_0x3d1e('0x34')]));_0x21b3d3[_0x3d1e('0x32')]=_0x21b3d3[_0x3d1e('0x32')][_0x3d1e('0x35')]?_0x21b3d3[_0x3d1e('0x32')]:_0x46d413[_0x3d1e('0x31')];if(!_0x3f29ff['query'][_0x3d1e('0x36')](_0x3d1e('0x37'))){_0x21b3d3[_0x3d1e('0x1c')]=qs[_0x3d1e('0x1c')](_0x3f29ff['query'][_0x3d1e('0x1c')]);_0x21b3d3[_0x3d1e('0x1e')]=qs['offset'](_0x3f29ff[_0x3d1e('0x2f')][_0x3d1e('0x1e')]);}_0x21b3d3[_0x3d1e('0x38')]=qs[_0x3d1e('0x39')](_0x3f29ff[_0x3d1e('0x2f')][_0x3d1e('0x39')]);_0x21b3d3[_0x3d1e('0x3a')]=qs['filters'](_[_0x3d1e('0x3b')](_0x3f29ff[_0x3d1e('0x2f')],_0x46d413[_0x3d1e('0x30')]),_0x15f9e7);if(_0x3f29ff[_0x3d1e('0x2f')][_0x3d1e('0x3c')]){_0x21b3d3[_0x3d1e('0x3a')]=_['merge'](_0x21b3d3['where'],{'$or':_['map'](_0x15f9e7,function(_0x9b36a6){if(_0x9b36a6[_0x3d1e('0x2e')]!=='VIRTUAL'){var _0x386633={};_0x386633[_0x9b36a6[_0x3d1e('0x28')]]={'$like':'%'+_0x3f29ff[_0x3d1e('0x2f')]['filter']+'%'};return _0x386633;}})});}_0x21b3d3=_[_0x3d1e('0x3d')]({},_0x21b3d3,_0x3f29ff[_0x3d1e('0x3e')]);var _0x38a7c1={'where':_0x21b3d3['where']};return db[_0x3d1e('0x2c')]['count'](_0x38a7c1)[_0x3d1e('0x24')](function(_0x50df8b){_0x4f4858['count']=_0x50df8b;if(_0x3f29ff[_0x3d1e('0x2f')][_0x3d1e('0x3f')]){_0x21b3d3[_0x3d1e('0x40')]=[{'all':!![]}];}return db[_0x3d1e('0x2c')]['findAll'](_0x21b3d3);})[_0x3d1e('0x24')](function(_0xdbc46b){_0x4f4858[_0x3d1e('0x41')]=_0xdbc46b;return _0x4f4858;})[_0x3d1e('0x24')](respondWithFilteredResult(_0x2545a3,_0x21b3d3))[_0x3d1e('0x42')](handleError(_0x2545a3,null));};exports[_0x3d1e('0x43')]=function(_0x2174e9,_0x19182e){var _0x3f655f={'raw':!![],'where':{'id':_0x2174e9['params']['id']}},_0x3d9944={};_0x3d9944[_0x3d1e('0x31')]=_['keys'](db[_0x3d1e('0x2c')][_0x3d1e('0x44')]);_0x3d9944[_0x3d1e('0x2f')]=_[_0x3d1e('0x45')](_0x2174e9[_0x3d1e('0x2f')]);_0x3d9944[_0x3d1e('0x30')]=_['intersection'](_0x3d9944[_0x3d1e('0x31')],_0x3d9944[_0x3d1e('0x2f')]);_0x3f655f['attributes']=_[_0x3d1e('0x33')](_0x3d9944['model'],qs['fields'](_0x2174e9['query'][_0x3d1e('0x34')]));_0x3f655f['attributes']=_0x3f655f['attributes'][_0x3d1e('0x35')]?_0x3f655f[_0x3d1e('0x32')]:_0x3d9944[_0x3d1e('0x31')];if(_0x2174e9[_0x3d1e('0x2f')][_0x3d1e('0x3f')]){_0x3f655f[_0x3d1e('0x40')]=[{'all':!![]}];}_0x3f655f=_['merge']({},_0x3f655f,_0x2174e9['options']);return db['AnalyticTreeReport'][_0x3d1e('0x46')](_0x3f655f)[_0x3d1e('0x24')](handleEntityNotFound(_0x19182e,null))[_0x3d1e('0x24')](respondWithResult(_0x19182e,null))['catch'](handleError(_0x19182e,null));};exports[_0x3d1e('0x47')]=function(_0x1d1ac1,_0x36745b){return db[_0x3d1e('0x2c')][_0x3d1e('0x47')](_0x1d1ac1[_0x3d1e('0x48')],{})['then'](respondWithResult(_0x36745b,0xc9))[_0x3d1e('0x42')](handleError(_0x36745b,null));};exports[_0x3d1e('0x23')]=function(_0x19a97d,_0x4330da){if(_0x19a97d[_0x3d1e('0x48')]['id']){delete _0x19a97d[_0x3d1e('0x48')]['id'];}return db['AnalyticTreeReport'][_0x3d1e('0x46')]({'where':{'id':_0x19a97d[_0x3d1e('0x49')]['id']}})[_0x3d1e('0x24')](handleEntityNotFound(_0x4330da,null))[_0x3d1e('0x24')](saveUpdates(_0x19a97d[_0x3d1e('0x48')],null))[_0x3d1e('0x24')](respondWithResult(_0x4330da,null))[_0x3d1e('0x42')](handleError(_0x4330da,null));};exports[_0x3d1e('0x25')]=function(_0x5622c8,_0x35c46f){return db[_0x3d1e('0x2c')][_0x3d1e('0x46')]({'where':{'id':_0x5622c8[_0x3d1e('0x49')]['id']}})['then'](handleEntityNotFound(_0x35c46f,null))['then'](removeEntity(_0x35c46f,null))[_0x3d1e('0x42')](handleError(_0x35c46f,null));}; \ No newline at end of file +var _0xbde1=['destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','keys','include','body','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then'];(function(_0x1700e2,_0x51a6e8){var _0x27a26c=function(_0xfd54d5){while(--_0xfd54d5){_0x1700e2['push'](_0x1700e2['shift']());}};_0x27a26c(++_0x51a6e8);}(_0xbde1,0x18b));var _0x1bde=function(_0x1f156c,_0x144663){_0x1f156c=_0x1f156c-0x0;var _0x30697a=_0xbde1[_0x1f156c];return _0x30697a;};'use strict';var emlformat=require(_0x1bde('0x0'));var rimraf=require(_0x1bde('0x1'));var zipdir=require(_0x1bde('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1bde('0x3'));var BPromise=require(_0x1bde('0x4'));var Mustache=require(_0x1bde('0x5'));var util=require(_0x1bde('0x6'));var path=require(_0x1bde('0x7'));var sox=require(_0x1bde('0x8'));var csv=require(_0x1bde('0x9'));var ejs=require(_0x1bde('0xa'));var fs=require('fs');var fs_extra=require(_0x1bde('0xb'));var _=require(_0x1bde('0xc'));var squel=require(_0x1bde('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1bde('0xe'));var toCsv=require(_0x1bde('0x9'));var querystring=require('querystring');var Papa=require(_0x1bde('0xf'));var Redis=require(_0x1bde('0x10'));var authService=require(_0x1bde('0x11'));var qs=require(_0x1bde('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1bde('0x13'))(_0x1bde('0x14'));var utils=require('../../config/utils');var config=require(_0x1bde('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1bde('0x16'))['db'];function respondWithStatusCode(_0x4f3c0e,_0x14230d){_0x14230d=_0x14230d||0xcc;return function(_0x351a65){if(_0x351a65){return _0x4f3c0e[_0x1bde('0x17')](_0x14230d);}return _0x4f3c0e['status'](_0x14230d)[_0x1bde('0x18')]();};}function respondWithResult(_0x161b25,_0x24b1fb){_0x24b1fb=_0x24b1fb||0xc8;return function(_0x576b9e){if(_0x576b9e){return _0x161b25[_0x1bde('0x19')](_0x24b1fb)[_0x1bde('0x1a')](_0x576b9e);}};}function respondWithFilteredResult(_0x4c2ecd,_0x2fc555){return function(_0x244578){if(_0x244578){var _0x303003=typeof _0x2fc555['offset']===_0x1bde('0x1b')&&typeof _0x2fc555[_0x1bde('0x1c')]===_0x1bde('0x1b');var _0x199335=_0x244578[_0x1bde('0x1d')];var _0x2d5c71=_0x303003?0x0:_0x2fc555[_0x1bde('0x1e')];var _0x5aad6e=_0x303003?_0x244578[_0x1bde('0x1d')]:_0x2fc555['offset']+_0x2fc555[_0x1bde('0x1c')];var _0x3e929c;if(_0x5aad6e>=_0x199335){_0x5aad6e=_0x199335;_0x3e929c=0xc8;}else{_0x3e929c=0xce;}_0x4c2ecd['status'](_0x3e929c);return _0x4c2ecd[_0x1bde('0x1f')](_0x1bde('0x20'),_0x2d5c71+'-'+_0x5aad6e+'/'+_0x199335)[_0x1bde('0x1a')](_0x244578);}return null;};}function patchUpdates(_0x26cc4f){return function(_0x47e2c2){try{jsonpatch[_0x1bde('0x21')](_0x47e2c2,_0x26cc4f,!![]);}catch(_0x1d0890){return BPromise['reject'](_0x1d0890);}return _0x47e2c2[_0x1bde('0x22')]();};}function saveUpdates(_0x669d69,_0x38d51a){return function(_0x4a4f1){if(_0x4a4f1){return _0x4a4f1[_0x1bde('0x23')](_0x669d69)[_0x1bde('0x24')](function(_0x43187e){return _0x43187e;});}return null;};}function removeEntity(_0x246aca,_0x42e851){return function(_0x32738e){if(_0x32738e){return _0x32738e[_0x1bde('0x25')]()[_0x1bde('0x24')](function(){_0x246aca[_0x1bde('0x19')](0xcc)[_0x1bde('0x18')]();});}};}function handleEntityNotFound(_0x13959b,_0xc216d2){return function(_0x4f9e17){if(!_0x4f9e17){_0x13959b['sendStatus'](0x194);}return _0x4f9e17;};}function handleError(_0xb07961,_0x12968a){_0x12968a=_0x12968a||0x1f4;return function(_0x5f3651){logger[_0x1bde('0x26')](_0x5f3651[_0x1bde('0x27')]);if(_0x5f3651[_0x1bde('0x28')]){delete _0x5f3651[_0x1bde('0x28')];}_0xb07961[_0x1bde('0x19')](_0x12968a)[_0x1bde('0x29')](_0x5f3651);};}exports[_0x1bde('0x2a')]=function(_0x1674dc,_0x5198e7){var _0x54b9e6={},_0xf220d4={},_0x3ca447={'count':0x0,'rows':[]};var _0x145909=_['map'](db[_0x1bde('0x2b')][_0x1bde('0x2c')],function(_0x2d6d62){return{'name':_0x2d6d62['fieldName'],'type':_0x2d6d62[_0x1bde('0x2d')][_0x1bde('0x2e')]};});_0xf220d4[_0x1bde('0x2f')]=_[_0x1bde('0x30')](_0x145909,_0x1bde('0x28'));_0xf220d4[_0x1bde('0x31')]=_['keys'](_0x1674dc[_0x1bde('0x31')]);_0xf220d4[_0x1bde('0x32')]=_[_0x1bde('0x33')](_0xf220d4[_0x1bde('0x2f')],_0xf220d4[_0x1bde('0x31')]);_0x54b9e6[_0x1bde('0x34')]=_[_0x1bde('0x33')](_0xf220d4[_0x1bde('0x2f')],qs[_0x1bde('0x35')](_0x1674dc[_0x1bde('0x31')]['fields']));_0x54b9e6[_0x1bde('0x34')]=_0x54b9e6[_0x1bde('0x34')][_0x1bde('0x36')]?_0x54b9e6[_0x1bde('0x34')]:_0xf220d4[_0x1bde('0x2f')];if(!_0x1674dc[_0x1bde('0x31')][_0x1bde('0x37')](_0x1bde('0x38'))){_0x54b9e6[_0x1bde('0x1c')]=qs[_0x1bde('0x1c')](_0x1674dc[_0x1bde('0x31')][_0x1bde('0x1c')]);_0x54b9e6[_0x1bde('0x1e')]=qs['offset'](_0x1674dc['query'][_0x1bde('0x1e')]);}_0x54b9e6['order']=qs[_0x1bde('0x39')](_0x1674dc['query'][_0x1bde('0x39')]);_0x54b9e6[_0x1bde('0x3a')]=qs[_0x1bde('0x32')](_[_0x1bde('0x3b')](_0x1674dc['query'],_0xf220d4[_0x1bde('0x32')]),_0x145909);if(_0x1674dc['query'][_0x1bde('0x3c')]){_0x54b9e6[_0x1bde('0x3a')]=_[_0x1bde('0x3d')](_0x54b9e6[_0x1bde('0x3a')],{'$or':_['map'](_0x145909,function(_0x3cd17b){if(_0x3cd17b[_0x1bde('0x2d')]!==_0x1bde('0x3e')){var _0x3cb0f6={};_0x3cb0f6[_0x3cd17b[_0x1bde('0x28')]]={'$like':'%'+_0x1674dc[_0x1bde('0x31')][_0x1bde('0x3c')]+'%'};return _0x3cb0f6;}})});}_0x54b9e6=_[_0x1bde('0x3d')]({},_0x54b9e6,_0x1674dc[_0x1bde('0x3f')]);var _0x93c4f8={'where':_0x54b9e6[_0x1bde('0x3a')]};return db[_0x1bde('0x2b')]['count'](_0x93c4f8)[_0x1bde('0x24')](function(_0x3f978c){_0x3ca447[_0x1bde('0x1d')]=_0x3f978c;if(_0x1674dc['query'][_0x1bde('0x40')]){_0x54b9e6['include']=[{'all':!![]}];}return db[_0x1bde('0x2b')]['findAll'](_0x54b9e6);})['then'](function(_0x368d4c){_0x3ca447[_0x1bde('0x41')]=_0x368d4c;return _0x3ca447;})[_0x1bde('0x24')](respondWithFilteredResult(_0x5198e7,_0x54b9e6))[_0x1bde('0x42')](handleError(_0x5198e7,null));};exports['show']=function(_0x353bd3,_0xfd02de){var _0x1e7ed3={'raw':!![],'where':{'id':_0x353bd3[_0x1bde('0x43')]['id']}},_0x4ad179={};_0x4ad179[_0x1bde('0x2f')]=_[_0x1bde('0x44')](db[_0x1bde('0x2b')][_0x1bde('0x2c')]);_0x4ad179[_0x1bde('0x31')]=_[_0x1bde('0x44')](_0x353bd3[_0x1bde('0x31')]);_0x4ad179[_0x1bde('0x32')]=_[_0x1bde('0x33')](_0x4ad179[_0x1bde('0x2f')],_0x4ad179[_0x1bde('0x31')]);_0x1e7ed3['attributes']=_[_0x1bde('0x33')](_0x4ad179[_0x1bde('0x2f')],qs[_0x1bde('0x35')](_0x353bd3[_0x1bde('0x31')][_0x1bde('0x35')]));_0x1e7ed3[_0x1bde('0x34')]=_0x1e7ed3['attributes'][_0x1bde('0x36')]?_0x1e7ed3[_0x1bde('0x34')]:_0x4ad179[_0x1bde('0x2f')];if(_0x353bd3['query'][_0x1bde('0x40')]){_0x1e7ed3[_0x1bde('0x45')]=[{'all':!![]}];}_0x1e7ed3=_['merge']({},_0x1e7ed3,_0x353bd3[_0x1bde('0x3f')]);return db[_0x1bde('0x2b')]['find'](_0x1e7ed3)['then'](handleEntityNotFound(_0xfd02de,null))['then'](respondWithResult(_0xfd02de,null))[_0x1bde('0x42')](handleError(_0xfd02de,null));};exports['create']=function(_0x5d5a58,_0x3712f3){return db[_0x1bde('0x2b')]['create'](_0x5d5a58['body'],{})['then'](respondWithResult(_0x3712f3,0xc9))[_0x1bde('0x42')](handleError(_0x3712f3,null));};exports[_0x1bde('0x23')]=function(_0x3455a5,_0x32490a){if(_0x3455a5[_0x1bde('0x46')]['id']){delete _0x3455a5[_0x1bde('0x46')]['id'];}return db['AnalyticTreeReport'][_0x1bde('0x47')]({'where':{'id':_0x3455a5['params']['id']}})[_0x1bde('0x24')](handleEntityNotFound(_0x32490a,null))[_0x1bde('0x24')](saveUpdates(_0x3455a5['body'],null))[_0x1bde('0x24')](respondWithResult(_0x32490a,null))[_0x1bde('0x42')](handleError(_0x32490a,null));};exports[_0x1bde('0x25')]=function(_0x374cbc,_0x6d3abb){return db[_0x1bde('0x2b')]['find']({'where':{'id':_0x374cbc[_0x1bde('0x43')]['id']}})[_0x1bde('0x24')](handleEntityNotFound(_0x6d3abb,null))[_0x1bde('0x24')](removeEntity(_0x6d3abb,null))['catch'](handleError(_0x6d3abb,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 4f43be8..3840d73 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 _0x0be2=['exports','AnalyticTreeReport','lodash','util','../../config/logger','api','moment','bluebird','path','./analyticTreeReport.attributes'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0x0be2,0x1d8));var _0x20be=function(_0x2442b9,_0x3d87e9){_0x2442b9=_0x2442b9-0x0;var _0x31b571=_0x0be2[_0x2442b9];return _0x31b571;};'use strict';var _=require(_0x20be('0x0'));var util=require(_0x20be('0x1'));var logger=require(_0x20be('0x2'))(_0x20be('0x3'));var moment=require(_0x20be('0x4'));var BPromise=require(_0x20be('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20be('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x20be('0x7'));module[_0x20be('0x8')]=function(_0x213a32,_0x577d34){return _0x213a32['define'](_0x20be('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5841=['request-promise','path','../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3fb07b,_0x2920ca){var _0x15cdb4=function(_0x93d9d5){while(--_0x93d9d5){_0x3fb07b['push'](_0x3fb07b['shift']());}};_0x15cdb4(++_0x2920ca);}(_0x5841,0x16e));var _0x1584=function(_0x4b4fab,_0x175057){_0x4b4fab=_0x4b4fab-0x0;var _0x1ba16c=_0x5841[_0x4b4fab];return _0x1ba16c;};'use strict';var _=require(_0x1584('0x0'));var util=require(_0x1584('0x1'));var logger=require(_0x1584('0x2'))(_0x1584('0x3'));var moment=require(_0x1584('0x4'));var BPromise=require(_0x1584('0x5'));var rp=require(_0x1584('0x6'));var fs=require('fs');var path=require(_0x1584('0x7'));var rimraf=require('rimraf');var config=require(_0x1584('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0x1584('0x9')]=function(_0x31c816,_0x5a4b60){return _0x31c816['define'](_0x1584('0xa'),attributes,{'tableName':_0x1584('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index ea37690..6472a81 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1824a0,_0x458127){var _0x2077bf=function(_0x37d545){while(--_0x37d545){_0x1824a0['push'](_0x1824a0['shift']());}};_0x2077bf(++_0x458127);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x454bd3,_0x3e4d94){var _0x4eb066=function(_0x4478fa){while(--_0x4478fa){_0x454bd3['push'](_0x454bd3['shift']());}};_0x4eb066(++_0x3e4d94);}(_0xadb5,0xad));var _0x5adb=function(_0x151d15,_0x4740f5){_0x151d15=_0x151d15-0x0;var _0x7af97f=_0xadb5[_0x151d15];return _0x7af97f;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 4555257..3ffc8b1 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 _0x0771=['isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','show','post','create'];(function(_0x467488,_0x38c7ae){var _0x56107f=function(_0x4992b3){while(--_0x4992b3){_0x467488['push'](_0x467488['shift']());}};_0x56107f(++_0x38c7ae);}(_0x0771,0x17f));var _0x1077=function(_0x1df9f4,_0x27c693){_0x1df9f4=_0x1df9f4-0x0;var _0x29f9c5=_0x0771[_0x1df9f4];return _0x29f9c5;};'use strict';var multer=require(_0x1077('0x0'));var util=require(_0x1077('0x1'));var path=require(_0x1077('0x2'));var timeout=require(_0x1077('0x3'));var express=require(_0x1077('0x4'));var router=express['Router']();var fs_extra=require(_0x1077('0x5'));var auth=require(_0x1077('0x6'));var interaction=require(_0x1077('0x7'));var config=require(_0x1077('0x8'));var controller=require(_0x1077('0x9'));router[_0x1077('0xa')]('/',auth['isAuthenticated'](),controller[_0x1077('0xb')]);router['get'](_0x1077('0xc'),auth['isAuthenticated'](),controller[_0x1077('0xd')]);router[_0x1077('0xe')]('/',auth['isAuthenticated'](),controller[_0x1077('0xf')]);router['put'](_0x1077('0xc'),auth[_0x1077('0x10')](),controller[_0x1077('0x11')]);router[_0x1077('0x12')](_0x1077('0xc'),auth['isAuthenticated'](),controller[_0x1077('0x13')]);module[_0x1077('0x14')]=router; \ No newline at end of file +var _0xe4ae=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','/:id','update'];(function(_0x4629ed,_0x59ef85){var _0x52ca04=function(_0x59dc63){while(--_0x59dc63){_0x4629ed['push'](_0x4629ed['shift']());}};_0x52ca04(++_0x59ef85);}(_0xe4ae,0x101));var _0xee4a=function(_0x5cd8fa,_0x3f5270){_0x5cd8fa=_0x5cd8fa-0x0;var _0x3fd21c=_0xe4ae[_0x5cd8fa];return _0x3fd21c;};'use strict';var multer=require(_0xee4a('0x0'));var util=require(_0xee4a('0x1'));var path=require('path');var timeout=require(_0xee4a('0x2'));var express=require(_0xee4a('0x3'));var router=express['Router']();var fs_extra=require(_0xee4a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xee4a('0x5'));var config=require(_0xee4a('0x6'));var controller=require('./analyticTreeReport.controller');router[_0xee4a('0x7')]('/',auth[_0xee4a('0x8')](),controller[_0xee4a('0x9')]);router[_0xee4a('0x7')]('/:id',auth[_0xee4a('0x8')](),controller['show']);router[_0xee4a('0xa')]('/',auth[_0xee4a('0x8')](),controller[_0xee4a('0xb')]);router[_0xee4a('0xc')](_0xee4a('0xd'),auth[_0xee4a('0x8')](),controller[_0xee4a('0xe')]);router['delete'](_0xee4a('0xd'),auth[_0xee4a('0x8')](),controller[_0xee4a('0xf')]);module[_0xee4a('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index f70ccd6..1980112 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 _0xb205=['sequelize','exports','STRING'];(function(_0x25aaec,_0x159e5b){var _0x293c2f=function(_0x3cd42a){while(--_0x3cd42a){_0x25aaec['push'](_0x25aaec['shift']());}};_0x293c2f(++_0x159e5b);}(_0xb205,0xf0));var _0x5b20=function(_0x2a5afc,_0x516e8c){_0x2a5afc=_0x2a5afc-0x0;var _0x49640c=_0xb205[_0x2a5afc];return _0x49640c;};'use strict';var Sequelize=require(_0x5b20('0x0'));module[_0x5b20('0x1')]={'name':{'type':Sequelize[_0x5b20('0x2')]},'basename':{'type':Sequelize[_0x5b20('0x2')]},'type':{'type':Sequelize[_0x5b20('0x2')]}}; \ No newline at end of file +var _0x9ade=['exports','STRING','sequelize'];(function(_0x4a5460,_0x1f18d2){var _0x554d80=function(_0x1c19d6){while(--_0x1c19d6){_0x4a5460['push'](_0x4a5460['shift']());}};_0x554d80(++_0x1f18d2);}(_0x9ade,0x107));var _0xe9ad=function(_0x1d128e,_0x2c87de){_0x1d128e=_0x1d128e-0x0;var _0x3d5236=_0x9ade[_0x1d128e];return _0x3d5236;};'use strict';var Sequelize=require(_0xe9ad('0x0'));module[_0xe9ad('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe9ad('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index d44ffb9..4e438ad 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 _0x7411=['clone','get','createdAt','updatedAt','omit','body','create','update','basename','file','filename','mimetype','download','ChatOfflineMessageId','root','server/files/attachments/','join','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','includeAll','options','find'];(function(_0x54115f,_0x11c5ae){var _0x58196a=function(_0x102832){while(--_0x102832){_0x54115f['push'](_0x54115f['shift']());}};_0x58196a(++_0x11c5ae);}(_0x7411,0xc5));var _0x1741=function(_0x22072d,_0x2d614b){_0x22072d=_0x22072d-0x0;var _0x217c72=_0x7411[_0x22072d];return _0x217c72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1741('0x0'));var zipdir=require(_0x1741('0x1'));var jsonpatch=require(_0x1741('0x2'));var rp=require('request-promise');var moment=require(_0x1741('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1741('0x4'));var util=require(_0x1741('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x1741('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1741('0x7'));var _=require(_0x1741('0x8'));var squel=require('squel');var crypto=require(_0x1741('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1741('0xa'));var toCsv=require('to-csv');var querystring=require(_0x1741('0xb'));var Papa=require(_0x1741('0xc'));var Redis=require(_0x1741('0xd'));var authService=require(_0x1741('0xe'));var qs=require(_0x1741('0xf'));var as=require(_0x1741('0x10'));var hardwareService=require(_0x1741('0x11'));var logger=require(_0x1741('0x12'))(_0x1741('0x13'));var utils=require(_0x1741('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1741('0x15'));var db=require(_0x1741('0x16'))['db'];function respondWithStatusCode(_0x5c9b45,_0x4e6506){_0x4e6506=_0x4e6506||0xcc;return function(_0x4939c7){if(_0x4939c7){return _0x5c9b45['sendStatus'](_0x4e6506);}return _0x5c9b45[_0x1741('0x17')](_0x4e6506)[_0x1741('0x18')]();};}function respondWithResult(_0x3cfe28,_0x2c4d73){_0x2c4d73=_0x2c4d73||0xc8;return function(_0x3b72b0){if(_0x3b72b0){return _0x3cfe28[_0x1741('0x17')](_0x2c4d73)[_0x1741('0x19')](_0x3b72b0);}};}function respondWithFilteredResult(_0x17b2df,_0x6ed293){return function(_0x106a88){if(_0x106a88){var _0x17b113=typeof _0x6ed293[_0x1741('0x1a')]===_0x1741('0x1b')&&typeof _0x6ed293[_0x1741('0x1c')]===_0x1741('0x1b');var _0x3c2038=_0x106a88['count'];var _0x48e6fe=_0x17b113?0x0:_0x6ed293['offset'];var _0x2ee90e=_0x17b113?_0x106a88[_0x1741('0x1d')]:_0x6ed293[_0x1741('0x1a')]+_0x6ed293[_0x1741('0x1c')];var _0x35622a;if(_0x2ee90e>=_0x3c2038){_0x2ee90e=_0x3c2038;_0x35622a=0xc8;}else{_0x35622a=0xce;}_0x17b2df[_0x1741('0x17')](_0x35622a);return _0x17b2df[_0x1741('0x1e')](_0x1741('0x1f'),_0x48e6fe+'-'+_0x2ee90e+'/'+_0x3c2038)[_0x1741('0x19')](_0x106a88);}return null;};}function patchUpdates(_0x1de4df){return function(_0x1bd59c){try{jsonpatch['apply'](_0x1bd59c,_0x1de4df,!![]);}catch(_0x92504b){return BPromise[_0x1741('0x20')](_0x92504b);}return _0x1bd59c[_0x1741('0x21')]();};}function saveUpdates(_0x4e58a3,_0x1019c5){return function(_0x307205){if(_0x307205){return _0x307205['update'](_0x4e58a3)[_0x1741('0x22')](function(_0x44f8cd){return _0x44f8cd;});}return null;};}function removeEntity(_0x568d4b,_0x50c140){return function(_0x8bc236){if(_0x8bc236){return _0x8bc236[_0x1741('0x23')]()[_0x1741('0x22')](function(){_0x568d4b[_0x1741('0x17')](0xcc)[_0x1741('0x18')]();});}};}function handleEntityNotFound(_0x21451a,_0x48c6e9){return function(_0x4dee12){if(!_0x4dee12){_0x21451a[_0x1741('0x24')](0x194);}return _0x4dee12;};}function handleError(_0x4caf0b,_0x1417cd){_0x1417cd=_0x1417cd||0x1f4;return function(_0x3d73e1){logger[_0x1741('0x25')](_0x3d73e1[_0x1741('0x26')]);if(_0x3d73e1[_0x1741('0x27')]){delete _0x3d73e1['name'];}_0x4caf0b[_0x1741('0x17')](_0x1417cd)[_0x1741('0x28')](_0x3d73e1);};}exports[_0x1741('0x29')]=function(_0x26d64e,_0x33a8c5){var _0x46ddf8={},_0x5898af={},_0x2790e6={'count':0x0,'rows':[]};var _0x13b47e=_[_0x1741('0x2a')](db[_0x1741('0x2b')][_0x1741('0x2c')],function(_0x3d197d){return{'name':_0x3d197d[_0x1741('0x2d')],'type':_0x3d197d[_0x1741('0x2e')][_0x1741('0x2f')]};});_0x5898af[_0x1741('0x30')]=_[_0x1741('0x2a')](_0x13b47e,_0x1741('0x27'));_0x5898af[_0x1741('0x31')]=_[_0x1741('0x32')](_0x26d64e[_0x1741('0x31')]);_0x5898af['filters']=_[_0x1741('0x33')](_0x5898af[_0x1741('0x30')],_0x5898af[_0x1741('0x31')]);_0x46ddf8[_0x1741('0x34')]=_[_0x1741('0x33')](_0x5898af[_0x1741('0x30')],qs[_0x1741('0x35')](_0x26d64e[_0x1741('0x31')][_0x1741('0x35')]));_0x46ddf8[_0x1741('0x34')]=_0x46ddf8['attributes'][_0x1741('0x36')]?_0x46ddf8[_0x1741('0x34')]:_0x5898af['model'];if(!_0x26d64e[_0x1741('0x31')][_0x1741('0x37')](_0x1741('0x38'))){_0x46ddf8[_0x1741('0x1c')]=qs[_0x1741('0x1c')](_0x26d64e[_0x1741('0x31')][_0x1741('0x1c')]);_0x46ddf8[_0x1741('0x1a')]=qs[_0x1741('0x1a')](_0x26d64e[_0x1741('0x31')][_0x1741('0x1a')]);}_0x46ddf8[_0x1741('0x39')]=qs[_0x1741('0x3a')](_0x26d64e['query'][_0x1741('0x3a')]);_0x46ddf8[_0x1741('0x3b')]=qs[_0x1741('0x3c')](_[_0x1741('0x3d')](_0x26d64e[_0x1741('0x31')],_0x5898af[_0x1741('0x3c')]),_0x13b47e);if(_0x26d64e['query'][_0x1741('0x3e')]){_0x46ddf8['where']=_[_0x1741('0x3f')](_0x46ddf8['where'],{'$or':_['map'](_0x13b47e,function(_0x546cd){if(_0x546cd['type']!==_0x1741('0x40')){var _0x1724bc={};_0x1724bc[_0x546cd[_0x1741('0x27')]]={'$like':'%'+_0x26d64e[_0x1741('0x31')]['filter']+'%'};return _0x1724bc;}})});}_0x46ddf8=_[_0x1741('0x3f')]({},_0x46ddf8,_0x26d64e['options']);var _0xf947b={'where':_0x46ddf8[_0x1741('0x3b')]};return db[_0x1741('0x2b')]['count'](_0xf947b)[_0x1741('0x22')](function(_0x2debaf){_0x2790e6[_0x1741('0x1d')]=_0x2debaf;if(_0x26d64e['query']['includeAll']){_0x46ddf8[_0x1741('0x41')]=[{'all':!![]}];}return db[_0x1741('0x2b')]['findAll'](_0x46ddf8);})[_0x1741('0x22')](function(_0x55c9e0){_0x2790e6[_0x1741('0x42')]=_0x55c9e0;return _0x2790e6;})[_0x1741('0x22')](respondWithFilteredResult(_0x33a8c5,_0x46ddf8))[_0x1741('0x43')](handleError(_0x33a8c5,null));};exports[_0x1741('0x44')]=function(_0x4bb113,_0x4da46a){var _0xb64e18={'raw':!![],'where':{'id':_0x4bb113[_0x1741('0x45')]['id']}},_0x26ac0b={};_0x26ac0b['model']=_[_0x1741('0x32')](db[_0x1741('0x2b')][_0x1741('0x2c')]);_0x26ac0b[_0x1741('0x31')]=_[_0x1741('0x32')](_0x4bb113[_0x1741('0x31')]);_0x26ac0b[_0x1741('0x3c')]=_[_0x1741('0x33')](_0x26ac0b[_0x1741('0x30')],_0x26ac0b[_0x1741('0x31')]);_0xb64e18[_0x1741('0x34')]=_[_0x1741('0x33')](_0x26ac0b['model'],qs[_0x1741('0x35')](_0x4bb113[_0x1741('0x31')][_0x1741('0x35')]));_0xb64e18[_0x1741('0x34')]=_0xb64e18[_0x1741('0x34')][_0x1741('0x36')]?_0xb64e18[_0x1741('0x34')]:_0x26ac0b[_0x1741('0x30')];if(_0x4bb113[_0x1741('0x31')][_0x1741('0x46')]){_0xb64e18[_0x1741('0x41')]=[{'all':!![]}];}_0xb64e18=_['merge']({},_0xb64e18,_0x4bb113[_0x1741('0x47')]);return db[_0x1741('0x2b')][_0x1741('0x48')](_0xb64e18)[_0x1741('0x22')](handleEntityNotFound(_0x4da46a,null))['then'](respondWithResult(_0x4da46a,null))[_0x1741('0x43')](handleError(_0x4da46a,null));};exports[_0x1741('0x49')]=function(_0x53ac0a,_0x13513b){var _0x2eec97={'where':{'id':_0x53ac0a[_0x1741('0x45')]['id']}},_0x402772={};_0x402772[_0x1741('0x30')]=_[_0x1741('0x32')](db['Attachment']['rawAttributes']);_0x2eec97[_0x1741('0x34')]=_[_0x1741('0x33')](_0x402772[_0x1741('0x30')],qs[_0x1741('0x35')](_0x53ac0a['query'][_0x1741('0x35')]));_0x2eec97[_0x1741('0x34')]=_0x2eec97[_0x1741('0x34')][_0x1741('0x36')]?_0x2eec97['attributes']:_0x402772[_0x1741('0x30')];if(_0x53ac0a[_0x1741('0x31')][_0x1741('0x46')]){_0x2eec97[_0x1741('0x41')]=[{'all':!![]}];}_0x2eec97=_['merge']({},_0x2eec97,_0x53ac0a[_0x1741('0x47')]);return db[_0x1741('0x2b')][_0x1741('0x48')](_0x2eec97)['then'](handleEntityNotFound(_0x13513b,null))[_0x1741('0x22')](function(_0x5afd5d){if(_0x5afd5d){var _0x59b46c=_0x5afd5d[_0x1741('0x4a')]({'plain':!![]});_0x59b46c=qs['omit'](_0x59b46c,['id',_0x1741('0x4b'),_0x1741('0x4c')]);_0x53ac0a['body']=_[_0x1741('0x4d')](_0x53ac0a[_0x1741('0x4e')],['id',_0x1741('0x4b'),_0x1741('0x4c')]);return db['Attachment'][_0x1741('0x4f')](_['merge'](_0x59b46c,_0x53ac0a[_0x1741('0x4e')]),{'include':_0x53ac0a[_0x1741('0x31')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x1741('0x22')](respondWithResult(_0x13513b,0xc9))[_0x1741('0x43')](handleError(_0x13513b,null));};exports[_0x1741('0x50')]=function(_0x722f50,_0x1a727f){if(_0x722f50[_0x1741('0x4e')]['id']){delete _0x722f50[_0x1741('0x4e')]['id'];}return db[_0x1741('0x2b')][_0x1741('0x48')]({'where':{'id':_0x722f50[_0x1741('0x45')]['id']}})[_0x1741('0x22')](handleEntityNotFound(_0x1a727f,null))['then'](saveUpdates(_0x722f50[_0x1741('0x4e')],null))[_0x1741('0x22')](respondWithResult(_0x1a727f,null))[_0x1741('0x43')](handleError(_0x1a727f,null));};exports[_0x1741('0x23')]=function(_0xd2aa42,_0x250b99){return db['Attachment'][_0x1741('0x48')]({'where':{'id':_0xd2aa42[_0x1741('0x45')]['id']}})[_0x1741('0x22')](handleEntityNotFound(_0x250b99,null))[_0x1741('0x22')](removeEntity(_0x250b99,null))[_0x1741('0x43')](handleError(_0x250b99,null));};exports[_0x1741('0x4f')]=function(_0x2779b4,_0x2e0b5f,_0x56fd4c){_0x2779b4[_0x1741('0x4e')][_0x1741('0x27')]=_0x2779b4['file']['originalname'];_0x2779b4[_0x1741('0x4e')][_0x1741('0x51')]=_0x2779b4[_0x1741('0x52')][_0x1741('0x53')];_0x2779b4[_0x1741('0x4e')][_0x1741('0x2e')]=_0x2779b4['file'][_0x1741('0x54')];return db[_0x1741('0x2b')]['create'](_0x2779b4[_0x1741('0x4e')])[_0x1741('0x22')](respondWithResult(_0x2e0b5f,0xc9))[_0x1741('0x43')](handleError(_0x2e0b5f,null));};exports[_0x1741('0x55')]=function(_0x4a2561,_0x243b3c,_0x2f53b7){return db['Attachment']['findOne']({'where':{'id':_0x4a2561[_0x1741('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x243b3c,null))[_0x1741('0x22')](function(_0x319168){if(_0x319168){var _0x452ee6=_0x319168[_0x1741('0x56')]!==null;var _0x44f79c=path['join'](config[_0x1741('0x57')],_0x1741('0x58'));if(_0x452ee6){_0x44f79c=path[_0x1741('0x59')](_0x44f79c,'offline-chat/');}var _0xb7fbd1=path[_0x1741('0x59')](_0x44f79c,_0x319168[_0x1741('0x51')]);return _0x243b3c[_0x1741('0x55')](_0xb7fbd1);}})[_0x1741('0x43')](handleError(_0x243b3c,null));}; \ No newline at end of file +var _0xda61=['util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','then','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','clone','include','omit','createdAt','updatedAt','body','create','update','find','destroy','basename','file','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x337748,_0x402b05){var _0x3bb03f=function(_0x2fcdf4){while(--_0x2fcdf4){_0x337748['push'](_0x337748['shift']());}};_0x3bb03f(++_0x402b05);}(_0xda61,0xf6));var _0x1da6=function(_0x1c421a,_0x25363c){_0x1c421a=_0x1c421a-0x0;var _0x314869=_0xda61[_0x1c421a];return _0x314869;};'use strict';var emlformat=require(_0x1da6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1da6('0x1'));var jsonpatch=require(_0x1da6('0x2'));var rp=require(_0x1da6('0x3'));var moment=require('moment');var BPromise=require(_0x1da6('0x4'));var Mustache=require(_0x1da6('0x5'));var util=require(_0x1da6('0x6'));var path=require(_0x1da6('0x7'));var sox=require('sox');var csv=require(_0x1da6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1da6('0x9'));var _=require(_0x1da6('0xa'));var squel=require(_0x1da6('0xb'));var crypto=require(_0x1da6('0xc'));var jsforce=require(_0x1da6('0xd'));var deskjs=require(_0x1da6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1da6('0xf'));var Papa=require('papaparse');var Redis=require(_0x1da6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1da6('0x11'));var as=require(_0x1da6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1da6('0x13'));var utils=require(_0x1da6('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1da6('0x15'))['db'];function respondWithStatusCode(_0x253c0d,_0x22b87e){_0x22b87e=_0x22b87e||0xcc;return function(_0x2c7c8b){if(_0x2c7c8b){return _0x253c0d[_0x1da6('0x16')](_0x22b87e);}return _0x253c0d['status'](_0x22b87e)[_0x1da6('0x17')]();};}function respondWithResult(_0x4ef0c6,_0x2e11d7){_0x2e11d7=_0x2e11d7||0xc8;return function(_0x33363b){if(_0x33363b){return _0x4ef0c6[_0x1da6('0x18')](_0x2e11d7)['json'](_0x33363b);}};}function respondWithFilteredResult(_0x24bb19,_0x928ad5){return function(_0x30f95d){if(_0x30f95d){var _0x573193=typeof _0x928ad5[_0x1da6('0x19')]===_0x1da6('0x1a')&&typeof _0x928ad5[_0x1da6('0x1b')]===_0x1da6('0x1a');var _0x367d05=_0x30f95d[_0x1da6('0x1c')];var _0x3ce2aa=_0x573193?0x0:_0x928ad5[_0x1da6('0x19')];var _0x35137e=_0x573193?_0x30f95d['count']:_0x928ad5['offset']+_0x928ad5[_0x1da6('0x1b')];var _0x205236;if(_0x35137e>=_0x367d05){_0x35137e=_0x367d05;_0x205236=0xc8;}else{_0x205236=0xce;}_0x24bb19[_0x1da6('0x18')](_0x205236);return _0x24bb19[_0x1da6('0x1d')]('Content-Range',_0x3ce2aa+'-'+_0x35137e+'/'+_0x367d05)[_0x1da6('0x1e')](_0x30f95d);}return null;};}function patchUpdates(_0x5c0036){return function(_0x18079e){try{jsonpatch[_0x1da6('0x1f')](_0x18079e,_0x5c0036,!![]);}catch(_0x180737){return BPromise[_0x1da6('0x20')](_0x180737);}return _0x18079e[_0x1da6('0x21')]();};}function saveUpdates(_0x3bdb0f,_0x568931){return function(_0x497b57){if(_0x497b57){return _0x497b57['update'](_0x3bdb0f)[_0x1da6('0x22')](function(_0x2c589b){return _0x2c589b;});}return null;};}function removeEntity(_0x4fc383,_0x57619f){return function(_0x2a53b3){if(_0x2a53b3){return _0x2a53b3['destroy']()['then'](function(){_0x4fc383[_0x1da6('0x18')](0xcc)[_0x1da6('0x17')]();});}};}function handleEntityNotFound(_0x187f8d,_0x184c82){return function(_0x4e9cce){if(!_0x4e9cce){_0x187f8d['sendStatus'](0x194);}return _0x4e9cce;};}function handleError(_0x5179fe,_0x440c87){_0x440c87=_0x440c87||0x1f4;return function(_0x2a8cda){logger[_0x1da6('0x23')](_0x2a8cda[_0x1da6('0x24')]);if(_0x2a8cda[_0x1da6('0x25')]){delete _0x2a8cda['name'];}_0x5179fe[_0x1da6('0x18')](_0x440c87)[_0x1da6('0x26')](_0x2a8cda);};}exports[_0x1da6('0x27')]=function(_0x153aa2,_0x55c035){var _0x2d9223={},_0x169638={},_0x54037f={'count':0x0,'rows':[]};var _0x330942=_['map'](db[_0x1da6('0x28')][_0x1da6('0x29')],function(_0xea19f8){return{'name':_0xea19f8[_0x1da6('0x2a')],'type':_0xea19f8[_0x1da6('0x2b')]['key']};});_0x169638['model']=_[_0x1da6('0x2c')](_0x330942,_0x1da6('0x25'));_0x169638[_0x1da6('0x2d')]=_[_0x1da6('0x2e')](_0x153aa2['query']);_0x169638[_0x1da6('0x2f')]=_[_0x1da6('0x30')](_0x169638[_0x1da6('0x31')],_0x169638['query']);_0x2d9223[_0x1da6('0x32')]=_['intersection'](_0x169638[_0x1da6('0x31')],qs[_0x1da6('0x33')](_0x153aa2[_0x1da6('0x2d')][_0x1da6('0x33')]));_0x2d9223[_0x1da6('0x32')]=_0x2d9223[_0x1da6('0x32')][_0x1da6('0x34')]?_0x2d9223[_0x1da6('0x32')]:_0x169638[_0x1da6('0x31')];if(!_0x153aa2['query']['hasOwnProperty'](_0x1da6('0x35'))){_0x2d9223['limit']=qs[_0x1da6('0x1b')](_0x153aa2[_0x1da6('0x2d')][_0x1da6('0x1b')]);_0x2d9223['offset']=qs[_0x1da6('0x19')](_0x153aa2[_0x1da6('0x2d')][_0x1da6('0x19')]);}_0x2d9223[_0x1da6('0x36')]=qs[_0x1da6('0x37')](_0x153aa2[_0x1da6('0x2d')][_0x1da6('0x37')]);_0x2d9223[_0x1da6('0x38')]=qs[_0x1da6('0x2f')](_['pick'](_0x153aa2[_0x1da6('0x2d')],_0x169638['filters']),_0x330942);if(_0x153aa2['query'][_0x1da6('0x39')]){_0x2d9223[_0x1da6('0x38')]=_[_0x1da6('0x3a')](_0x2d9223[_0x1da6('0x38')],{'$or':_[_0x1da6('0x2c')](_0x330942,function(_0x29d72f){if(_0x29d72f[_0x1da6('0x2b')]!==_0x1da6('0x3b')){var _0x17d2b3={};_0x17d2b3[_0x29d72f[_0x1da6('0x25')]]={'$like':'%'+_0x153aa2['query'][_0x1da6('0x39')]+'%'};return _0x17d2b3;}})});}_0x2d9223=_[_0x1da6('0x3a')]({},_0x2d9223,_0x153aa2['options']);var _0x3b617c={'where':_0x2d9223[_0x1da6('0x38')]};return db[_0x1da6('0x28')][_0x1da6('0x1c')](_0x3b617c)['then'](function(_0x3ca006){_0x54037f[_0x1da6('0x1c')]=_0x3ca006;if(_0x153aa2['query'][_0x1da6('0x3c')]){_0x2d9223['include']=[{'all':!![]}];}return db[_0x1da6('0x28')][_0x1da6('0x3d')](_0x2d9223);})[_0x1da6('0x22')](function(_0x51c008){_0x54037f[_0x1da6('0x3e')]=_0x51c008;return _0x54037f;})[_0x1da6('0x22')](respondWithFilteredResult(_0x55c035,_0x2d9223))[_0x1da6('0x3f')](handleError(_0x55c035,null));};exports[_0x1da6('0x40')]=function(_0x141ae9,_0x37f22e){var _0xfba861={'raw':!![],'where':{'id':_0x141ae9[_0x1da6('0x41')]['id']}},_0x7455af={};_0x7455af['model']=_[_0x1da6('0x2e')](db[_0x1da6('0x28')][_0x1da6('0x29')]);_0x7455af[_0x1da6('0x2d')]=_[_0x1da6('0x2e')](_0x141ae9[_0x1da6('0x2d')]);_0x7455af['filters']=_[_0x1da6('0x30')](_0x7455af[_0x1da6('0x31')],_0x7455af[_0x1da6('0x2d')]);_0xfba861[_0x1da6('0x32')]=_['intersection'](_0x7455af[_0x1da6('0x31')],qs[_0x1da6('0x33')](_0x141ae9[_0x1da6('0x2d')][_0x1da6('0x33')]));_0xfba861[_0x1da6('0x32')]=_0xfba861[_0x1da6('0x32')][_0x1da6('0x34')]?_0xfba861[_0x1da6('0x32')]:_0x7455af[_0x1da6('0x31')];if(_0x141ae9[_0x1da6('0x2d')]['includeAll']){_0xfba861['include']=[{'all':!![]}];}_0xfba861=_[_0x1da6('0x3a')]({},_0xfba861,_0x141ae9['options']);return db[_0x1da6('0x28')]['find'](_0xfba861)[_0x1da6('0x22')](handleEntityNotFound(_0x37f22e,null))[_0x1da6('0x22')](respondWithResult(_0x37f22e,null))['catch'](handleError(_0x37f22e,null));};exports[_0x1da6('0x42')]=function(_0x110a27,_0x4454fc){var _0x2d8076={'where':{'id':_0x110a27['params']['id']}},_0x183a93={};_0x183a93[_0x1da6('0x31')]=_[_0x1da6('0x2e')](db[_0x1da6('0x28')][_0x1da6('0x29')]);_0x2d8076['attributes']=_[_0x1da6('0x30')](_0x183a93[_0x1da6('0x31')],qs[_0x1da6('0x33')](_0x110a27[_0x1da6('0x2d')]['fields']));_0x2d8076[_0x1da6('0x32')]=_0x2d8076[_0x1da6('0x32')][_0x1da6('0x34')]?_0x2d8076[_0x1da6('0x32')]:_0x183a93[_0x1da6('0x31')];if(_0x110a27['query']['includeAll']){_0x2d8076[_0x1da6('0x43')]=[{'all':!![]}];}_0x2d8076=_['merge']({},_0x2d8076,_0x110a27['options']);return db[_0x1da6('0x28')]['find'](_0x2d8076)[_0x1da6('0x22')](handleEntityNotFound(_0x4454fc,null))[_0x1da6('0x22')](function(_0x299c36){if(_0x299c36){var _0x3debad=_0x299c36['get']({'plain':!![]});_0x3debad=qs[_0x1da6('0x44')](_0x3debad,['id',_0x1da6('0x45'),_0x1da6('0x46')]);_0x110a27['body']=_[_0x1da6('0x44')](_0x110a27[_0x1da6('0x47')],['id',_0x1da6('0x45'),_0x1da6('0x46')]);return db[_0x1da6('0x28')][_0x1da6('0x48')](_[_0x1da6('0x3a')](_0x3debad,_0x110a27['body']),{'include':_0x110a27[_0x1da6('0x2d')][_0x1da6('0x3c')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4454fc,0xc9))[_0x1da6('0x3f')](handleError(_0x4454fc,null));};exports[_0x1da6('0x49')]=function(_0x5224d8,_0x3c293e){if(_0x5224d8[_0x1da6('0x47')]['id']){delete _0x5224d8['body']['id'];}return db[_0x1da6('0x28')][_0x1da6('0x4a')]({'where':{'id':_0x5224d8[_0x1da6('0x41')]['id']}})['then'](handleEntityNotFound(_0x3c293e,null))['then'](saveUpdates(_0x5224d8[_0x1da6('0x47')],null))[_0x1da6('0x22')](respondWithResult(_0x3c293e,null))[_0x1da6('0x3f')](handleError(_0x3c293e,null));};exports[_0x1da6('0x4b')]=function(_0x4c1b6d,_0xdde2f2){return db['Attachment'][_0x1da6('0x4a')]({'where':{'id':_0x4c1b6d[_0x1da6('0x41')]['id']}})[_0x1da6('0x22')](handleEntityNotFound(_0xdde2f2,null))['then'](removeEntity(_0xdde2f2,null))[_0x1da6('0x3f')](handleError(_0xdde2f2,null));};exports[_0x1da6('0x48')]=function(_0x4b0c8a,_0x2af69e,_0x3252d9){_0x4b0c8a['body'][_0x1da6('0x25')]=_0x4b0c8a['file']['originalname'];_0x4b0c8a[_0x1da6('0x47')][_0x1da6('0x4c')]=_0x4b0c8a[_0x1da6('0x4d')]['filename'];_0x4b0c8a[_0x1da6('0x47')][_0x1da6('0x2b')]=_0x4b0c8a[_0x1da6('0x4d')][_0x1da6('0x4e')];return db[_0x1da6('0x28')][_0x1da6('0x48')](_0x4b0c8a['body'])[_0x1da6('0x22')](respondWithResult(_0x2af69e,0xc9))['catch'](handleError(_0x2af69e,null));};exports[_0x1da6('0x4f')]=function(_0x48124a,_0x57b10f,_0x413496){return db[_0x1da6('0x28')]['findOne']({'where':{'id':_0x48124a[_0x1da6('0x41')]['id']},'raw':!![]})[_0x1da6('0x22')](handleEntityNotFound(_0x57b10f,null))[_0x1da6('0x22')](function(_0x4235c1){if(_0x4235c1){var _0x35c136=_0x4235c1[_0x1da6('0x50')]!==null;var _0x1b54e7=path[_0x1da6('0x51')](config[_0x1da6('0x52')],_0x1da6('0x53'));if(_0x35c136){_0x1b54e7=path[_0x1da6('0x51')](_0x1b54e7,'offline-chat/');}var _0x2ec377=path['join'](_0x1b54e7,_0x4235c1[_0x1da6('0x4c')]);return _0x57b10f[_0x1da6('0x4f')](_0x2ec377);}})[_0x1da6('0x3f')](handleError(_0x57b10f,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 0c2288c..907f5bf 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 _0x1662=['./attachment.attributes','define','Attachment','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x30e987,_0x307779){var _0x1de789=function(_0x4ee1ea){while(--_0x4ee1ea){_0x30e987['push'](_0x30e987['shift']());}};_0x1de789(++_0x307779);}(_0x1662,0x1b1));var _0x2166=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x1662[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x2166('0x0'));var util=require(_0x2166('0x1'));var logger=require(_0x2166('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2166('0x3'));var rp=require(_0x2166('0x4'));var fs=require('fs');var path=require(_0x2166('0x5'));var rimraf=require(_0x2166('0x6'));var config=require('../../config/environment');var attributes=require(_0x2166('0x7'));module['exports']=function(_0x53cacb,_0x26f10d){return _0x53cacb[_0x2166('0x8')](_0x2166('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59d6=['moment','path','../../config/environment','exports','Attachment','attachments','lodash','util','../../config/logger','api'];(function(_0x3727ae,_0x165f88){var _0x1c3f01=function(_0x5cd5a5){while(--_0x5cd5a5){_0x3727ae['push'](_0x3727ae['shift']());}};_0x1c3f01(++_0x165f88);}(_0x59d6,0x10a));var _0x659d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x59d6[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x659d('0x0'));var util=require(_0x659d('0x1'));var logger=require(_0x659d('0x2'))(_0x659d('0x3'));var moment=require(_0x659d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x659d('0x5'));var rimraf=require('rimraf');var config=require(_0x659d('0x6'));var attributes=require('./attachment.attributes');module[_0x659d('0x7')]=function(_0x4323c0,_0x32f2a7){return _0x4323c0['define'](_0x659d('0x8'),attributes,{'tableName':_0x659d('0x9'),'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 47730f1..7e2dce4 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 _0x1b73=['jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','options','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1b73,0x1d5));var _0x31b7=function(_0x3d47d2,_0x179c2a){_0x3d47d2=_0x3d47d2-0x0;var _0x195eea=_0x1b73[_0x3d47d2];return _0x195eea;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var moment=require(_0x31b7('0x1'));var BPromise=require(_0x31b7('0x2'));var rs=require(_0x31b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x31b7('0x5'))(_0x31b7('0x6'));var config=require('../../config/environment');var jayson=require(_0x31b7('0x7'));var client=jayson[_0x31b7('0x8')][_0x31b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x502838,_0x445dbe,_0x1a730f){return new BPromise(function(_0x86ef8e,_0x19b92a){return client[_0x31b7('0xa')](_0x502838,_0x1a730f)[_0x31b7('0xb')](function(_0x3d2b41){logger['info'](_0x31b7('0xc'),_0x445dbe,_0x31b7('0xd'));logger[_0x31b7('0xe')](_0x31b7('0xf'),_0x445dbe,_0x31b7('0xd'),JSON[_0x31b7('0x10')](_0x3d2b41));if(_0x3d2b41[_0x31b7('0x11')]){if(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x12')]===0x1f4){logger[_0x31b7('0x11')]('Attachment,\x20%s,\x20%s',_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x19b92a(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);}logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x86ef8e(_0x3d2b41[_0x31b7('0x11')]['message']);}else{logger[_0x31b7('0x14')]('Attachment,\x20%s,\x20%s',_0x445dbe,_0x31b7('0xd'));_0x86ef8e(_0x3d2b41[_0x31b7('0x15')]['message']);}})[_0x31b7('0x16')](function(_0x3c71ae){logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3c71ae);_0x19b92a(_0x3c71ae);});});}exports[_0x31b7('0x17')]=function(_0x5f3245){var _0x223f9f=this;return new Promise(function(_0x437eba,_0x1dc28c){return db[_0x31b7('0x18')][_0x31b7('0x19')](_0x5f3245['body'],{'raw':_0x5f3245[_0x31b7('0x1a')]?_0x5f3245[_0x31b7('0x1a')][_0x31b7('0x1b')]===undefined?!![]:![]:!![]})[_0x31b7('0xb')](function(_0x5b56bc){logger[_0x31b7('0x14')](_0x31b7('0x17'),_0x5f3245);logger[_0x31b7('0xe')](_0x31b7('0x17'),_0x5f3245,JSON['stringify'](_0x5b56bc));_0x437eba(_0x5b56bc);})[_0x31b7('0x16')](function(_0x20cb03){logger[_0x31b7('0x11')](_0x31b7('0x17'),_0x20cb03[_0x31b7('0x13')],_0x5f3245);_0x1dc28c(_0x223f9f[_0x31b7('0x11')](0x1f4,_0x20cb03[_0x31b7('0x13')]));});});}; \ No newline at end of file +var _0xeddd=['../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateAttachment','Attachment','create','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0xeddd,0x69));var _0xdedd=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xeddd[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xdedd('0x0'));var util=require(_0xdedd('0x1'));var moment=require(_0xdedd('0x2'));var BPromise=require(_0xdedd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdedd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdedd('0x5'));var logger=require(_0xdedd('0x6'))('rpc');var config=require(_0xdedd('0x7'));var jayson=require(_0xdedd('0x8'));var client=jayson[_0xdedd('0x9')][_0xdedd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x102b00,_0x41d72f,_0x2aa946){return new BPromise(function(_0x260839,_0x3cc017){return client[_0xdedd('0xb')](_0x102b00,_0x2aa946)[_0xdedd('0xc')](function(_0x429585){logger['info'](_0xdedd('0xd'),_0x41d72f,_0xdedd('0xe'));logger[_0xdedd('0xf')](_0xdedd('0x10'),_0x41d72f,'request\x20sent',JSON[_0xdedd('0x11')](_0x429585));if(_0x429585[_0xdedd('0x12')]){if(_0x429585[_0xdedd('0x12')][_0xdedd('0x13')]===0x1f4){logger[_0xdedd('0x12')](_0xdedd('0xd'),_0x41d72f,_0x429585[_0xdedd('0x12')][_0xdedd('0x14')]);return _0x3cc017(_0x429585[_0xdedd('0x12')][_0xdedd('0x14')]);}logger[_0xdedd('0x12')](_0xdedd('0xd'),_0x41d72f,_0x429585[_0xdedd('0x12')][_0xdedd('0x14')]);return _0x260839(_0x429585[_0xdedd('0x12')][_0xdedd('0x14')]);}else{logger[_0xdedd('0x15')](_0xdedd('0xd'),_0x41d72f,_0xdedd('0xe'));_0x260839(_0x429585['result'][_0xdedd('0x14')]);}})[_0xdedd('0x16')](function(_0x588ce7){logger[_0xdedd('0x12')](_0xdedd('0xd'),_0x41d72f,_0x588ce7);_0x3cc017(_0x588ce7);});});}exports[_0xdedd('0x17')]=function(_0x4b16bb){var _0x43611b=this;return new Promise(function(_0x24e331,_0x4054b0){return db[_0xdedd('0x18')][_0xdedd('0x19')](_0x4b16bb['body'],{'raw':_0x4b16bb[_0xdedd('0x1a')]?_0x4b16bb[_0xdedd('0x1a')][_0xdedd('0x1b')]===undefined?!![]:![]:!![]})[_0xdedd('0xc')](function(_0x1213d6){logger[_0xdedd('0x15')](_0xdedd('0x17'),_0x4b16bb);logger[_0xdedd('0xf')](_0xdedd('0x17'),_0x4b16bb,JSON['stringify'](_0x1213d6));_0x24e331(_0x1213d6);})['catch'](function(_0x538dc1){logger['error'](_0xdedd('0x17'),_0x538dc1[_0xdedd('0x14')],_0x4b16bb);_0x4054b0(_0x43611b[_0xdedd('0x12')](0x1f4,_0x538dc1[_0xdedd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index ff74890..f531ec0 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x2f359d,_0x40c991){var _0x148f1a=function(_0xdc22e3){while(--_0xdc22e3){_0x2f359d['push'](_0x2f359d['shift']());}};_0x148f1a(++_0x40c991);}(_0x757a,0xde));var _0xa757=function(_0x4aa36e,_0x5acdf7){_0x4aa36e=_0x4aa36e-0x0;var _0x2555b9=_0x757a[_0x4aa36e];return _0x2555b9;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file +var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x214353,_0x4cfa98){var _0x2ad9f2=function(_0x54eec8){while(--_0x54eec8){_0x214353['push'](_0x214353['shift']());}};_0x2ad9f2(++_0x4cfa98);}(_0x757a,0xde));var _0xa757=function(_0x508cc1,_0x46d674){_0x508cc1=_0x508cc1-0x0;var _0x4d6d44=_0x757a[_0x508cc1];return _0x4d6d44;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 587c7dd..c27bfae 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 _0xd4f4=['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','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','blocked','blockedAt','admin','user','agent','add','minutes','clearBlockUser','getLicense','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','use','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','activedirectory','undefined','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect'];(function(_0x99e075,_0x211213){var _0x1a81ba=function(_0x216dcd){while(--_0x216dcd){_0x99e075['push'](_0x99e075['shift']());}};_0x1a81ba(++_0x211213);}(_0xd4f4,0x175));var _0x4d4f=function(_0x2bcf21,_0x30271a){_0x2bcf21=_0x2bcf21-0x0;var _0x70c751=_0xd4f4[_0x2bcf21];return _0x70c751;};'use strict';var passport=require(_0x4d4f('0x0'));var LocalStrategy=require(_0x4d4f('0x1'))[_0x4d4f('0x2')];var moment=require('moment');var ActiveDirectory=require(_0x4d4f('0x3'));var BPromise=require(_0x4d4f('0x4'));var util=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var authService=require(_0x4d4f('0x7'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0xa32514){var _0x23c886=![];if(typeof _0xa32514[_0x4d4f('0x8')]!==_0x4d4f('0x9')){_0x23c886=_0xa32514[_0x4d4f('0x8')]['baseDN']&&_0xa32514[_0x4d4f('0x8')]['url']&&_0xa32514['activedirectory']['domain'];}return _0x23c886;}function adAuthenticate(_0x4d55b9,_0x541267,_0x14da84){return new BPromise(function(_0x57cb1f,_0x2b20fd){try{var _0x615021=new ActiveDirectory(_0x4d55b9);_0x615021[_0x4d4f('0xa')](_0x541267,_0x14da84,function(_0x40c1c9,_0x206667){if(_0x40c1c9){logger[_0x4d4f('0xb')](_0x4d4f('0xc'),_0x541267,util[_0x4d4f('0xd')](_0x40c1c9,{'showHidden':![],'depth':null}));_0x2b20fd('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x206667){logger[_0x4d4f('0xb')](_0x4d4f('0xe'),_0x541267);_0x2b20fd(_0x4d4f('0xf'));}else{_0x57cb1f(_0x206667);}});}catch(_0x56c9c1){_0x2b20fd(_0x56c9c1);}});}function ActiveDirectoryAuthenticate(_0x2fd865,_0x229c69,_0x1a10a0,_0x4bfed2){var _0x516862,_0x36a906;if(!isActiveDirectoryConfigured(config)){logger[_0x4d4f('0xb')](_0x4d4f('0x10'),_0x229c69);return _0x4bfed2(null,![],{'message':_0x4d4f('0xf')});}return db[_0x4d4f('0x11')][_0x4d4f('0x12')]({'where':{'id':0x1},'attributes':[_0x4d4f('0x13'),_0x4d4f('0x14')],'raw':!![]})[_0x4d4f('0x15')](function(_0x302a14){_0x516862=_0x302a14;if(!_0x516862[_0x4d4f('0x13')]){logger['error'](_0x4d4f('0x16'),_0x229c69);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x2fd865[_0x4d4f('0x12')]({'logging':!![],'attributes':['id',_0x4d4f('0x17'),'password',_0x4d4f('0x18'),_0x4d4f('0x19'),'disabled',_0x4d4f('0x1a'),_0x4d4f('0x1b'),'online'],'where':{'name':_0x229c69,'role':{'$or':[_0x4d4f('0x1c'),_0x4d4f('0x1d'),_0x4d4f('0x1e')]},'adSsoEnabled':!![]}});})[_0x4d4f('0x15')](function(_0x58b78d){if(!_0x58b78d||_0x58b78d&&_0x58b78d['name']!==_0x229c69){throw new Error(_0x4d4f('0xf'));}_0x36a906=_0x58b78d;var _0x233a82=_0x36a906[_0x4d4f('0x17')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0x4d4f('0x8')],_0x233a82,_0x1a10a0);})[_0x4d4f('0x15')](function(_0x1c768e){if(_0x36a906['disabled']){throw new Error(_0x4d4f('0xf'));}if(_0x516862[_0x4d4f('0x14')]>0x0){if(_0x36a906[_0x4d4f('0x1a')]){if(moment(_0x36a906[_0x4d4f('0x1b')])[_0x4d4f('0x1f')](_0x516862['blockDuration'],_0x4d4f('0x20'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x4d4f('0x21')](_0x36a906,0x0,![],null)['then'](function(){return utils['getLicense'](_0x36a906);})[_0x4d4f('0x15')](function(){return _0x4bfed2(null,_0x36a906);});}else{return utils['getLicense'](_0x36a906)[_0x4d4f('0x15')](function(){return _0x4bfed2(null,_0x36a906);});}}else{return utils[_0x4d4f('0x22')](_0x36a906)[_0x4d4f('0x15')](function(){return _0x4bfed2(null,_0x36a906);});}})['catch'](function(_0x9f391a){return _0x4bfed2(null,![],_0x9f391a);});}function handleError(_0x4a6872,_0x3daeaf,_0x2316fb){return _0x4a6872['status'](_0x3daeaf||0x1f4)[_0x4d4f('0x23')]({'message':_0x2316fb?_0x2316fb[_0x4d4f('0x24')]||_0x2316fb:''});}exports[_0x4d4f('0x25')]=function(_0x8bd742,_0x420110,_0x267258){passport['authenticate'](_0x4d4f('0x26'),function(_0x509c00,_0x702196,_0x311e7c){var _0x5172ee=_0x509c00||_0x311e7c;if(_0x5172ee){return handleError(_0x420110,0x191,_0x5172ee);}if(!_0x702196){return handleError(_0x420110,0x194,{'message':_0x4d4f('0x27')});}else{var _0x5b1827={'payload':{'id':_0x702196['id'],'role':_0x702196[_0x4d4f('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5b1827)[_0x4d4f('0x15')](function(_0x4e0c8f){_0x420110['json']({'id':_0x702196['id'],'token':_0x4e0c8f,'statusCall':'','isAlreadyLogged':_0x702196[_0x4d4f('0x28')]});});}})(_0x8bd742,_0x420110,_0x267258);};passport[_0x4d4f('0x29')](_0x4d4f('0x26'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x3930ee,_0x4370f4,_0x271864){return ActiveDirectoryAuthenticate(db[_0x4d4f('0x2a')],_0x3930ee,_0x4370f4,_0x271864);})); \ No newline at end of file +var _0x3747=['online','admin','user','agent','add','minutes','clearBlockUser','getLicense','catch','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','disabled','blocked','blockedAt'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0x3747,0x198));var _0x7374=function(_0xa9a962,_0x527c23){_0xa9a962=_0xa9a962-0x0;var _0xde5975=_0x3747[_0xa9a962];return _0xde5975;};'use strict';var passport=require(_0x7374('0x0'));var LocalStrategy=require(_0x7374('0x1'))[_0x7374('0x2')];var moment=require(_0x7374('0x3'));var ActiveDirectory=require(_0x7374('0x4'));var BPromise=require(_0x7374('0x5'));var util=require(_0x7374('0x6'));var db=require(_0x7374('0x7'))['db'];var authService=require(_0x7374('0x8'));var utils=require(_0x7374('0x9'));var config=require(_0x7374('0xa'));var logger=require('../../config/logger')(_0x7374('0xb'));function isActiveDirectoryConfigured(_0x1f17e2){var _0x4a1b67=![];if(typeof _0x1f17e2[_0x7374('0xc')]!==_0x7374('0xd')){_0x4a1b67=_0x1f17e2[_0x7374('0xc')][_0x7374('0xe')]&&_0x1f17e2['activedirectory']['url']&&_0x1f17e2['activedirectory'][_0x7374('0xf')];}return _0x4a1b67;}function adAuthenticate(_0x222c4b,_0x455463,_0x1da586){return new BPromise(function(_0x1385ed,_0x462581){try{var _0x4c3ea3=new ActiveDirectory(_0x222c4b);_0x4c3ea3[_0x7374('0x10')](_0x455463,_0x1da586,function(_0x3f6dbf,_0x4563c5){if(_0x3f6dbf){logger[_0x7374('0x11')](_0x7374('0x12'),_0x455463,util['inspect'](_0x3f6dbf,{'showHidden':![],'depth':null}));_0x462581(_0x7374('0x13'));}else if(!_0x4563c5){logger[_0x7374('0x11')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x455463);_0x462581(_0x7374('0x13'));}else{_0x1385ed(_0x4563c5);}});}catch(_0x142fc1){_0x462581(_0x142fc1);}});}function ActiveDirectoryAuthenticate(_0x754fb6,_0x5ccc61,_0x5b9c4b,_0x35d8e7){var _0x4f69b5,_0x481c1b;if(!isActiveDirectoryConfigured(config)){logger[_0x7374('0x11')](_0x7374('0x14'),_0x5ccc61);return _0x35d8e7(null,![],{'message':_0x7374('0x13')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x7374('0x15')],'raw':!![]})[_0x7374('0x16')](function(_0x1d9343){_0x4f69b5=_0x1d9343;if(!_0x4f69b5[_0x7374('0x17')]){logger[_0x7374('0x11')](_0x7374('0x18'),_0x5ccc61);throw new Error(_0x7374('0x13'));}return _0x754fb6[_0x7374('0x19')]({'logging':!![],'attributes':['id',_0x7374('0x1a'),_0x7374('0x1b'),_0x7374('0x1c'),_0x7374('0x1d'),_0x7374('0x1e'),_0x7374('0x1f'),_0x7374('0x20'),_0x7374('0x21')],'where':{'name':_0x5ccc61,'role':{'$or':[_0x7374('0x22'),_0x7374('0x23'),_0x7374('0x24')]},'adSsoEnabled':!![]}});})[_0x7374('0x16')](function(_0x5a39f9){if(!_0x5a39f9||_0x5a39f9&&_0x5a39f9[_0x7374('0x1a')]!==_0x5ccc61){throw new Error(_0x7374('0x13'));}_0x481c1b=_0x5a39f9;var _0x5c56f6=_0x481c1b[_0x7374('0x1a')]+'@'+config[_0x7374('0xc')][_0x7374('0xf')];return adAuthenticate(config[_0x7374('0xc')],_0x5c56f6,_0x5b9c4b);})[_0x7374('0x16')](function(_0x90a818){if(_0x481c1b[_0x7374('0x1e')]){throw new Error(_0x7374('0x13'));}if(_0x4f69b5[_0x7374('0x15')]>0x0){if(_0x481c1b['blocked']){if(moment(_0x481c1b['blockedAt'])[_0x7374('0x25')](_0x4f69b5['blockDuration'],_0x7374('0x26'))>moment()){throw new Error(_0x7374('0x13'));}return utils[_0x7374('0x27')](_0x481c1b,0x0,![],null)['then'](function(){return utils['getLicense'](_0x481c1b);})[_0x7374('0x16')](function(){return _0x35d8e7(null,_0x481c1b);});}else{return utils[_0x7374('0x28')](_0x481c1b)[_0x7374('0x16')](function(){return _0x35d8e7(null,_0x481c1b);});}}else{return utils['getLicense'](_0x481c1b)[_0x7374('0x16')](function(){return _0x35d8e7(null,_0x481c1b);});}})[_0x7374('0x29')](function(_0x8e9edf){return _0x35d8e7(null,![],_0x8e9edf);});}function handleError(_0xc5d8a1,_0x2ca5d6,_0x51fc1c){return _0xc5d8a1['status'](_0x2ca5d6||0x1f4)['send']({'message':_0x51fc1c?_0x51fc1c['message']||_0x51fc1c:''});}exports[_0x7374('0x2a')]=function(_0x35f955,_0xac8c8a,_0x342fa4){passport[_0x7374('0x10')](_0x7374('0x2b'),function(_0x4f96ed,_0x3c0176,_0x2437e6){var _0x32b278=_0x4f96ed||_0x2437e6;if(_0x32b278){return handleError(_0xac8c8a,0x191,_0x32b278);}if(!_0x3c0176){return handleError(_0xac8c8a,0x194,{'message':_0x7374('0x2c')});}else{var _0x2576b8={'payload':{'id':_0x3c0176['id'],'role':_0x3c0176['role']},'options':{'expiresIn':0x15180}};return authService[_0x7374('0x2d')](_0x2576b8)['then'](function(_0x3a301e){_0xac8c8a[_0x7374('0x2e')]({'id':_0x3c0176['id'],'token':_0x3a301e,'statusCall':'','isAlreadyLogged':_0x3c0176[_0x7374('0x21')]});});}})(_0x35f955,_0xac8c8a,_0x342fa4);};passport[_0x7374('0x2f')](_0x7374('0x2b'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x38dae9,_0x1ad2b7,_0x4549ad){return ActiveDirectoryAuthenticate(db[_0x7374('0x30')],_0x38dae9,_0x1ad2b7,_0x4549ad);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 0df2b94..0b6802d 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 _0x81eb=['login','./authActiveDirectory.controller','post'];(function(_0x54228f,_0x538ea5){var _0x27ea2d=function(_0x325185){while(--_0x325185){_0x54228f['push'](_0x54228f['shift']());}};_0x27ea2d(++_0x538ea5);}(_0x81eb,0x1d5));var _0xb81e=function(_0x2855af,_0x346a9d){_0x2855af=_0x2855af-0x0;var _0x489525=_0x81eb[_0x2855af];return _0x489525;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xb81e('0x0'));router[_0xb81e('0x1')]('/',controller[_0xb81e('0x2')]);module['exports']=router; \ No newline at end of file +var _0x5de0=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_0x5de0,0x10b));var _0x05de=function(_0x593b03,_0x2ceb59){_0x593b03=_0x593b03-0x0;var _0x2461c1=_0x5de0[_0x593b03];return _0x2461c1;};'use strict';var express=require(_0x05de('0x0'));var router=express[_0x05de('0x1')]();var controller=require(_0x05de('0x2'));router[_0x05de('0x3')]('/',controller[_0x05de('0x4')]);module[_0x05de('0x5')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 23daeda..1d60bb8 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(_0x5dca5e,_0x5a5d1b){var _0x4bf076=function(_0x209f76){while(--_0x209f76){_0x5dca5e['push'](_0x5dca5e['shift']());}};_0x4bf076(++_0x5a5d1b);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x13ca44,_0x56a27d){var _0x62f21f=function(_0x199d67){while(--_0x199d67){_0x13ca44['push'](_0x13ca44['shift']());}};_0x62f21f(++_0x56a27d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index cd10de1..b82eb1e 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 _0x8c5c=['exports','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie'];(function(_0x53f0db,_0x35c67c){var _0xae0a5c=function(_0x4bd6fb){while(--_0x4bd6fb){_0x53f0db['push'](_0x53f0db['shift']());}};_0xae0a5c(++_0x35c67c);}(_0x8c5c,0x83));var _0xc8c5=function(_0x44fcde,_0x275914){_0x44fcde=_0x44fcde-0x0;var _0x5a008f=_0x8c5c[_0x44fcde];return _0x5a008f;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require(_0xc8c5('0x0'));var userController=require(_0xc8c5('0x1'));var authService=require(_0xc8c5('0x2'));router['get']('/',controller['login']);router[_0xc8c5('0x3')](_0xc8c5('0x4'),controller[_0xc8c5('0x5')],authService[_0xc8c5('0x6')],userController[_0xc8c5('0x7')],authService[_0xc8c5('0x8')]);module[_0xc8c5('0x9')]=router; \ No newline at end of file +var _0x12c0=['isMiddleware','setTokenCookie','exports','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback'];(function(_0x58bdcd,_0x20597a){var _0x19357e=function(_0x440aba){while(--_0x440aba){_0x58bdcd['push'](_0x58bdcd['shift']());}};_0x19357e(++_0x20597a);}(_0x12c0,0x1d7));var _0x012c=function(_0x5c3a5d,_0x3a43d6){_0x5c3a5d=_0x5c3a5d-0x0;var _0x1ee0bb=_0x12c0[_0x5c3a5d];return _0x1ee0bb;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require(_0x012c('0x0'));var userController=require(_0x012c('0x1'));var authService=require(_0x012c('0x2'));router[_0x012c('0x3')]('/',controller[_0x012c('0x4')]);router['get']('/callback',controller[_0x012c('0x5')],authService[_0x012c('0x6')],userController[_0x012c('0x4')],authService[_0x012c('0x7')]);module[_0x012c('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 2628589..afac7da 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 _0x58c4=['Setting','User','disabled','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','client','http','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','blockedAt','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','local-login','role','signToken','json','online','forgot','body','generate','trim','toLowerCase'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0x58c4,0xbc));var _0x458c=function(_0x539eeb,_0x48786e){_0x539eeb=_0x539eeb-0x0;var _0x16a71b=_0x58c4[_0x539eeb];return _0x16a71b;};'use strict';var util=require(_0x458c('0x0'));var passport=require(_0x458c('0x1'));var LocalStrategy=require(_0x458c('0x2'))[_0x458c('0x3')];var jayson=require(_0x458c('0x4'));var _=require(_0x458c('0x5'));var rs=require('randomstring');var moment=require(_0x458c('0x6'));var db=require(_0x458c('0x7'))['db'];var authService=require(_0x458c('0x8'));var utils=require('../../config/utils');var client=jayson[_0x458c('0x9')][_0x458c('0xa')]({'port':0x232b});function localAuthenticate(_0x2fdd76,_0x14f9e2,_0x20e215,_0x2911ff){var _0x4e11df,_0x5e53c0;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x458c('0xb'),_0x458c('0xc')],'raw':!![]})[_0x458c('0xd')](function(_0x12117b){_0x4e11df=_0x12117b;return _0x2fdd76[_0x458c('0xe')]({'attributes':['id',_0x458c('0xf'),_0x458c('0x10'),_0x458c('0x11'),'role','disabled','blocked','blockedAt',_0x458c('0x12')],'where':{'name':_0x14f9e2,'role':{'$or':[_0x458c('0x13'),_0x458c('0x14'),'agent']}}});})[_0x458c('0xd')](function(_0x180118){if(!_0x180118||_0x180118&&_0x180118['name']!==_0x14f9e2){throw new Error(_0x458c('0x15'));}else{_0x5e53c0=_0x180118;return _0x5e53c0;}})[_0x458c('0xd')](function(){_0x5e53c0[_0x458c('0x16')](_0x20e215,function(_0xf136c1,_0x2f492a){var _0x1f2a53=_0x5e53c0[_0x458c('0x12')]+0x1;if(_0xf136c1){return _0x2911ff(_0xf136c1);}else if(!_0x2f492a){if(_0x5e53c0['disabled']){return _0x2911ff(null,![],{'message':_0x458c('0x15')});}else if(_0x4e11df[_0x458c('0xb')]>0x0){if(_0x5e53c0[_0x458c('0x17')]){if(_0x4e11df[_0x458c('0xc')]>0x0){if(moment(_0x5e53c0[_0x458c('0x18')])['add'](_0x4e11df[_0x458c('0xc')],_0x458c('0x19'))>moment()){return _0x2911ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x458c('0x1a')](_0x5e53c0,_0x1f2a53,![],null)[_0x458c('0xd')](function(){return _0x2911ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2911ff(null,![],{'message':_0x458c('0x15')});}}else{if(_0x1f2a53>=_0x4e11df[_0x458c('0xb')]){return utils[_0x458c('0x1a')](_0x5e53c0,0x0,!![],moment())[_0x458c('0xd')](function(){return _0x2911ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x458c('0x1a')](_0x5e53c0,_0x1f2a53,![],null)[_0x458c('0xd')](function(){return _0x2911ff(null,![],{'message':_0x458c('0x15')});});}}}else{return _0x2911ff(null,![],{'message':_0x458c('0x15')});}}else{if(_0x5e53c0['disabled']){return _0x2911ff(null,![],{'message':_0x458c('0x15')});}else if(_0x4e11df[_0x458c('0xb')]>0x0){if(_0x5e53c0[_0x458c('0x17')]){if(_0x4e11df['blockDuration']>0x0){if(moment(_0x5e53c0['blockedAt'])[_0x458c('0x1b')](_0x4e11df[_0x458c('0xc')],_0x458c('0x19'))>moment()){return _0x2911ff(null,![],{'message':_0x458c('0x15')});}else{return utils[_0x458c('0x1a')](_0x5e53c0,0x0,![],null)['then'](function(){return utils[_0x458c('0x1c')](_0x5e53c0);})[_0x458c('0xd')](function(){return _0x2911ff(null,_0x5e53c0);});}}else{return _0x2911ff(null,![],{'message':_0x458c('0x15')});}}else{return utils[_0x458c('0x1a')](_0x5e53c0,0x0,![],null)[_0x458c('0xd')](function(){return utils[_0x458c('0x1c')](_0x5e53c0);})[_0x458c('0xd')](function(){return _0x2911ff(null,_0x5e53c0);})[_0x458c('0x1d')](function(_0xe6d04a){return _0x2911ff(null,![],_0xe6d04a);});}}else{if(_0x5e53c0['blocked']){return _0x2911ff(null,![],{'message':_0x458c('0x15')});}else{return utils[_0x458c('0x1c')](_0x5e53c0)[_0x458c('0xd')](function(){return _0x2911ff(null,_0x5e53c0);});}}}});})[_0x458c('0x1d')](function(_0xc4c61a){return _0x2911ff(null,![],_0xc4c61a);});}function sendServiceMail(_0x368f78){return db[_0x458c('0x1e')][_0x458c('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x458c('0xf'),_0x458c('0x20')],'include':[{'model':db[_0x458c('0x21')],'as':_0x458c('0x22')}]})[_0x458c('0xd')](function(_0x4d3ff){if(!_0x4d3ff){throw new Error(_0x458c('0x23'));}var _0x5a0dfe={'tls':{'rejectUnauthorized':![]}};if(_0x4d3ff[_0x458c('0x22')][_0x458c('0x24')]){_0x5a0dfe[_0x458c('0x24')]=_0x4d3ff['Smtp']['service'];}else{_0x5a0dfe[_0x458c('0x25')]=_0x4d3ff['Smtp'][_0x458c('0x25')];_0x5a0dfe[_0x458c('0x26')]=_0x4d3ff[_0x458c('0x22')][_0x458c('0x26')];_0x5a0dfe[_0x458c('0x27')]=_0x4d3ff[_0x458c('0x22')][_0x458c('0x27')];}if(_0x4d3ff['Smtp']['authentication']){_0x5a0dfe[_0x458c('0x28')]={'user':_0x4d3ff['Smtp'][_0x458c('0x14')],'pass':_0x4d3ff[_0x458c('0x22')]['pass']};}var _0x44e696={'account':_0x5a0dfe,'message':_[_0x458c('0x29')]({'from':util[_0x458c('0x2a')]('\x22%s\x22\x20<%s>',_0x4d3ff[_0x458c('0xf')],_0x4d3ff[_0x458c('0x20')]||_0x4d3ff[_0x458c('0x22')][_0x458c('0x14')])},_0x368f78)};return client[_0x458c('0x2b')](_0x458c('0x2c'),_0x44e696);})['then'](function(_0x4776ea){if(_0x4776ea[_0x458c('0x2d')]){throw new Error(util[_0x458c('0x2a')](_0x458c('0x2e'),_0x4776ea[_0x458c('0x2d')]['message']||JSON[_0x458c('0x2f')](_0x4776ea['error'])));}return!![];});}function handleError(_0x396859,_0x1846d9,_0x5dfc90){return _0x396859[_0x458c('0x30')](_0x1846d9||0x1f4)[_0x458c('0x31')]({'message':_0x5dfc90?_0x5dfc90[_0x458c('0x32')]||_0x5dfc90:''});}exports['login']=function(_0x3608cb,_0xc623cb,_0x1e5095){passport[_0x458c('0x16')](_0x458c('0x33'),function(_0x4a9283,_0x3c37b7,_0xb3afa8){var _0x8106fb=_0x4a9283||_0xb3afa8;if(_0x8106fb){return handleError(_0xc623cb,0x191,_0x8106fb);}if(!_0x3c37b7){return handleError(_0xc623cb,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x324ade={'payload':{'id':_0x3c37b7['id'],'role':_0x3c37b7[_0x458c('0x34')]},'options':{'expiresIn':0x15180}};return authService[_0x458c('0x35')](_0x324ade)[_0x458c('0xd')](function(_0x4d9bc0){_0xc623cb[_0x458c('0x36')]({'id':_0x3c37b7['id'],'token':_0x4d9bc0,'statusCall':'','isAlreadyLogged':_0x3c37b7[_0x458c('0x37')]});});}})(_0x3608cb,_0xc623cb,_0x1e5095);};exports[_0x458c('0x38')]=function(_0xceccab,_0x384a3c,_0x79e68b){if(!_0xceccab[_0x458c('0x39')]['email']){return handleError(_0x384a3c,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1fa558=rs[_0x458c('0x3a')]();_0xceccab['body'][_0x458c('0x20')]=_0xceccab['body'][_0x458c('0x20')][_0x458c('0x3b')]()[_0x458c('0x3c')]();var _0x2f5a44;return db[_0x458c('0x3d')][_0x458c('0xe')]({'where':{'id':0x1},'attributes':[_0x458c('0xb'),'blockDuration'],'raw':!![]})[_0x458c('0xd')](function(_0x1f362c){_0x2f5a44=_0x1f362c;return db[_0x458c('0x3e')]['find']({'where':{'email':_0xceccab[_0x458c('0x39')]['email']}});})['then'](function(_0x44bab9){if(!_0x44bab9){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x44bab9[_0x458c('0x3f')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x44bab9[_0x458c('0x17')]){if(moment(_0x44bab9[_0x458c('0x18')])[_0x458c('0x1b')](_0x2f5a44['blockDuration'],_0x458c('0x19'))>moment()){throw new Error(_0x458c('0x40'));}else{_0x44bab9[_0x458c('0x17')]=![];_0x44bab9['blockedAt']=null;}}_0x44bab9[_0x458c('0x41')]=_0x1fa558;_0x44bab9[_0x458c('0x42')]=Date[_0x458c('0x43')]()+0x36ee80;return _0x44bab9[_0x458c('0x44')]();})['then'](function(){return sendServiceMail({'to':_0xceccab[_0x458c('0x39')][_0x458c('0x20')],'subject':_0x458c('0x45'),'text':_0x458c('0x46')+_0x458c('0x47')+'https://'+_0xceccab[_0x458c('0x48')]['host']+_0x458c('0x49')+_0x1fa558+'\x0a\x0a'+_0x458c('0x4a')});})[_0x458c('0xd')](function(){_0x384a3c[_0x458c('0x30')](0xc8)[_0x458c('0x31')]({'message':'Reset\x20Email\x20sent!'});})[_0x458c('0x1d')](function(_0x2c7c3d){return handleError(_0x384a3c,0x1f4,_0x2c7c3d);});};exports['reset']=function(_0xfc6675,_0x167cda,_0x5dd54e){return db['User'][_0x458c('0x1f')]({'where':{'resetPasswordToken':_0xfc6675['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x458c('0xd')](function(_0x5c68b6){if(!_0x5c68b6){throw new Error(_0x458c('0x4b'));}return db[_0x458c('0x3d')]['findOne']({'attributes':['id',_0x458c('0x4c'),'enforcePasswordHistory',_0x458c('0x4d')]})[_0x458c('0xd')](function(_0x4b1471){if(_0x4b1471[_0x458c('0x4c')])authService[_0x458c('0x4e')](_0xfc6675[_0x458c('0x39')][_0x458c('0x10')]);if(!_0x4b1471[_0x458c('0x4f')]||!_0x5c68b6['previousPasswords'])return _0x5c68b6;authService['validatePasswordHistory'](_0xfc6675['body'][_0x458c('0x10')],_0x5c68b6[_0x458c('0x50')],_0x4b1471[_0x458c('0x4d')]);return _0x5c68b6;})['then'](function(){_0x5c68b6[_0x458c('0x10')]=_0xfc6675[_0x458c('0x39')][_0x458c('0x10')];_0x5c68b6[_0x458c('0x41')]=null;_0x5c68b6[_0x458c('0x42')]=null;return _0x5c68b6[_0x458c('0x44')]();});})[_0x458c('0xd')](function(){_0x167cda[_0x458c('0x30')](0xc8)[_0x458c('0x31')]({'message':_0x458c('0x51')});})[_0x458c('0x1d')](function(_0x3d3de8){return handleError(_0x167cda,0x1f4,_0x3d3de8);});};passport[_0x458c('0x52')](_0x458c('0x33'),new LocalStrategy({'usernameField':'name','passwordField':_0x458c('0x10')},function(_0x12bec8,_0x4f1e01,_0x5e7917){return localAuthenticate(db[_0x458c('0x3e')],_0x12bec8,_0x4f1e01,_0x5e7917);})); \ No newline at end of file +var _0xc234=['authentication','auth','pass','merge','\x22%s\x22\x20<%s>','SendMail','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','local-login','role','json','online','forgot','generate','body','trim','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','Reset\x20Email\x20sent!','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','password','resetPasswordToken','Password\x20reset!','use','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','disabled','blocked','blockedAt','loginAttempts','user','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','port','secure'];(function(_0x40b8f8,_0x271ad2){var _0x50bb90=function(_0x163671){while(--_0x163671){_0x40b8f8['push'](_0x40b8f8['shift']());}};_0x50bb90(++_0x271ad2);}(_0xc234,0x7f));var _0x4c23=function(_0x299410,_0x1bc43d){_0x299410=_0x299410-0x0;var _0x5c3f5b=_0xc234[_0x299410];return _0x5c3f5b;};'use strict';var util=require('util');var passport=require(_0x4c23('0x0'));var LocalStrategy=require(_0x4c23('0x1'))['Strategy'];var jayson=require(_0x4c23('0x2'));var _=require(_0x4c23('0x3'));var rs=require(_0x4c23('0x4'));var moment=require(_0x4c23('0x5'));var db=require(_0x4c23('0x6'))['db'];var authService=require(_0x4c23('0x7'));var utils=require(_0x4c23('0x8'));var client=jayson[_0x4c23('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x1aff39,_0x4b1c09,_0x3dc42b,_0x44d13d){var _0xa2297d,_0x49a163;return db[_0x4c23('0xa')][_0x4c23('0xb')]({'where':{'id':0x1},'attributes':[_0x4c23('0xc'),_0x4c23('0xd')],'raw':!![]})['then'](function(_0x464858){_0xa2297d=_0x464858;return _0x1aff39[_0x4c23('0xb')]({'attributes':['id',_0x4c23('0xe'),'password',_0x4c23('0xf'),'role',_0x4c23('0x10'),_0x4c23('0x11'),_0x4c23('0x12'),_0x4c23('0x13')],'where':{'name':_0x4b1c09,'role':{'$or':['admin',_0x4c23('0x14'),_0x4c23('0x15')]}}});})[_0x4c23('0x16')](function(_0xac4b10){if(!_0xac4b10||_0xac4b10&&_0xac4b10['name']!==_0x4b1c09){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x49a163=_0xac4b10;return _0x49a163;}})['then'](function(){_0x49a163[_0x4c23('0x17')](_0x3dc42b,function(_0x470343,_0x4e68cb){var _0x95baf5=_0x49a163[_0x4c23('0x13')]+0x1;if(_0x470343){return _0x44d13d(_0x470343);}else if(!_0x4e68cb){if(_0x49a163[_0x4c23('0x10')]){return _0x44d13d(null,![],{'message':_0x4c23('0x18')});}else if(_0xa2297d[_0x4c23('0xc')]>0x0){if(_0x49a163[_0x4c23('0x11')]){if(_0xa2297d['blockDuration']>0x0){if(moment(_0x49a163['blockedAt'])[_0x4c23('0x19')](_0xa2297d[_0x4c23('0xd')],_0x4c23('0x1a'))>moment()){return _0x44d13d(null,![],{'message':_0x4c23('0x18')});}else{return utils[_0x4c23('0x1b')](_0x49a163,_0x95baf5,![],null)[_0x4c23('0x16')](function(){return _0x44d13d(null,![],{'message':_0x4c23('0x18')});});}}else{return _0x44d13d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x95baf5>=_0xa2297d[_0x4c23('0xc')]){return utils['clearBlockUser'](_0x49a163,0x0,!![],moment())['then'](function(){return _0x44d13d(null,![],{'message':_0x4c23('0x18')});});}else{return utils['clearBlockUser'](_0x49a163,_0x95baf5,![],null)[_0x4c23('0x16')](function(){return _0x44d13d(null,![],{'message':_0x4c23('0x18')});});}}}else{return _0x44d13d(null,![],{'message':_0x4c23('0x18')});}}else{if(_0x49a163['disabled']){return _0x44d13d(null,![],{'message':_0x4c23('0x18')});}else if(_0xa2297d[_0x4c23('0xc')]>0x0){if(_0x49a163[_0x4c23('0x11')]){if(_0xa2297d[_0x4c23('0xd')]>0x0){if(moment(_0x49a163['blockedAt'])['add'](_0xa2297d['blockDuration'],_0x4c23('0x1a'))>moment()){return _0x44d13d(null,![],{'message':_0x4c23('0x18')});}else{return utils[_0x4c23('0x1b')](_0x49a163,0x0,![],null)[_0x4c23('0x16')](function(){return utils[_0x4c23('0x1c')](_0x49a163);})['then'](function(){return _0x44d13d(null,_0x49a163);});}}else{return _0x44d13d(null,![],{'message':_0x4c23('0x18')});}}else{return utils[_0x4c23('0x1b')](_0x49a163,0x0,![],null)['then'](function(){return utils[_0x4c23('0x1c')](_0x49a163);})[_0x4c23('0x16')](function(){return _0x44d13d(null,_0x49a163);})[_0x4c23('0x1d')](function(_0xf7d5fd){return _0x44d13d(null,![],_0xf7d5fd);});}}else{if(_0x49a163[_0x4c23('0x11')]){return _0x44d13d(null,![],{'message':_0x4c23('0x18')});}else{return utils[_0x4c23('0x1c')](_0x49a163)[_0x4c23('0x16')](function(){return _0x44d13d(null,_0x49a163);});}}}});})[_0x4c23('0x1d')](function(_0x588959){return _0x44d13d(null,![],_0x588959);});}function sendServiceMail(_0x521500){return db[_0x4c23('0x1e')][_0x4c23('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x4c23('0x20')],'include':[{'model':db[_0x4c23('0x21')],'as':_0x4c23('0x22')}]})['then'](function(_0x57eec2){if(!_0x57eec2){throw new Error(_0x4c23('0x23'));}var _0x5026e5={'tls':{'rejectUnauthorized':![]}};if(_0x57eec2[_0x4c23('0x22')][_0x4c23('0x24')]){_0x5026e5[_0x4c23('0x24')]=_0x57eec2['Smtp']['service'];}else{_0x5026e5['host']=_0x57eec2['Smtp']['host'];_0x5026e5[_0x4c23('0x25')]=_0x57eec2['Smtp'][_0x4c23('0x25')];_0x5026e5[_0x4c23('0x26')]=_0x57eec2['Smtp'][_0x4c23('0x26')];}if(_0x57eec2[_0x4c23('0x22')][_0x4c23('0x27')]){_0x5026e5[_0x4c23('0x28')]={'user':_0x57eec2[_0x4c23('0x22')][_0x4c23('0x14')],'pass':_0x57eec2[_0x4c23('0x22')][_0x4c23('0x29')]};}var _0x1fe303={'account':_0x5026e5,'message':_[_0x4c23('0x2a')]({'from':util['format'](_0x4c23('0x2b'),_0x57eec2[_0x4c23('0xe')],_0x57eec2[_0x4c23('0x20')]||_0x57eec2[_0x4c23('0x22')]['user'])},_0x521500)};return client['request'](_0x4c23('0x2c'),_0x1fe303);})[_0x4c23('0x16')](function(_0x4c6dd6){if(_0x4c6dd6['error']){throw new Error(util[_0x4c23('0x2d')](_0x4c23('0x2e'),_0x4c6dd6[_0x4c23('0x2f')][_0x4c23('0x30')]||JSON[_0x4c23('0x31')](_0x4c6dd6[_0x4c23('0x2f')])));}return!![];});}function handleError(_0x48feea,_0x85c4cf,_0x52219a){return _0x48feea[_0x4c23('0x32')](_0x85c4cf||0x1f4)[_0x4c23('0x33')]({'message':_0x52219a?_0x52219a[_0x4c23('0x30')]||_0x52219a:''});}exports['login']=function(_0x3011fa,_0x6c1c8c,_0x550d15){passport[_0x4c23('0x17')](_0x4c23('0x34'),function(_0x456c3f,_0x352738,_0x42ff8a){var _0x2fc448=_0x456c3f||_0x42ff8a;if(_0x2fc448){return handleError(_0x6c1c8c,0x191,_0x2fc448);}if(!_0x352738){return handleError(_0x6c1c8c,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2e681b={'payload':{'id':_0x352738['id'],'role':_0x352738[_0x4c23('0x35')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e681b)[_0x4c23('0x16')](function(_0x1a08f4){_0x6c1c8c[_0x4c23('0x36')]({'id':_0x352738['id'],'token':_0x1a08f4,'statusCall':'','isAlreadyLogged':_0x352738[_0x4c23('0x37')]});});}})(_0x3011fa,_0x6c1c8c,_0x550d15);};exports[_0x4c23('0x38')]=function(_0x15eaa5,_0x5441ed,_0x2da808){if(!_0x15eaa5['body'][_0x4c23('0x20')]){return handleError(_0x5441ed,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xbc48e6=rs[_0x4c23('0x39')]();_0x15eaa5[_0x4c23('0x3a')][_0x4c23('0x20')]=_0x15eaa5[_0x4c23('0x3a')]['email'][_0x4c23('0x3b')]()['toLowerCase']();var _0x27837b;return db[_0x4c23('0xa')][_0x4c23('0xb')]({'where':{'id':0x1},'attributes':[_0x4c23('0xc'),'blockDuration'],'raw':!![]})['then'](function(_0x94f77a){_0x27837b=_0x94f77a;return db[_0x4c23('0x3c')][_0x4c23('0x1f')]({'where':{'email':_0x15eaa5[_0x4c23('0x3a')]['email']}});})['then'](function(_0x15c134){if(!_0x15c134){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x15c134[_0x4c23('0x10')]){throw new Error(_0x4c23('0x3d'));}if(_0x15c134['blocked']){if(moment(_0x15c134[_0x4c23('0x12')])['add'](_0x27837b[_0x4c23('0xd')],_0x4c23('0x1a'))>moment()){throw new Error(_0x4c23('0x3e'));}else{_0x15c134[_0x4c23('0x11')]=![];_0x15c134[_0x4c23('0x12')]=null;}}_0x15c134['resetPasswordToken']=_0xbc48e6;_0x15c134[_0x4c23('0x3f')]=Date['now']()+0x36ee80;return _0x15c134[_0x4c23('0x40')]();})[_0x4c23('0x16')](function(){return sendServiceMail({'to':_0x15eaa5['body'][_0x4c23('0x20')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x4c23('0x41')+_0x4c23('0x42')+_0x4c23('0x43')+_0x15eaa5['headers']['host']+_0x4c23('0x44')+_0xbc48e6+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x4c23('0x16')](function(){_0x5441ed[_0x4c23('0x32')](0xc8)[_0x4c23('0x33')]({'message':_0x4c23('0x45')});})[_0x4c23('0x1d')](function(_0x580b03){return handleError(_0x5441ed,0x1f4,_0x580b03);});};exports[_0x4c23('0x46')]=function(_0x142b8d,_0x560d2a,_0x5206bb){return db[_0x4c23('0x3c')]['find']({'where':{'resetPasswordToken':_0x142b8d[_0x4c23('0x47')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x4c23('0x16')](function(_0x57490a){if(!_0x57490a){throw new Error(_0x4c23('0x48'));}return db[_0x4c23('0xa')]['findOne']({'attributes':['id',_0x4c23('0x49'),_0x4c23('0x4a'),_0x4c23('0x4b')]})[_0x4c23('0x16')](function(_0x50cb5d){if(_0x50cb5d[_0x4c23('0x49')])authService[_0x4c23('0x4c')](_0x142b8d[_0x4c23('0x3a')]['password']);if(!_0x50cb5d[_0x4c23('0x4a')]||!_0x57490a[_0x4c23('0x4d')])return _0x57490a;authService[_0x4c23('0x4e')](_0x142b8d['body']['password'],_0x57490a[_0x4c23('0x4d')],_0x50cb5d[_0x4c23('0x4b')]);return _0x57490a;})[_0x4c23('0x16')](function(){_0x57490a[_0x4c23('0x4f')]=_0x142b8d[_0x4c23('0x3a')][_0x4c23('0x4f')];_0x57490a[_0x4c23('0x50')]=null;_0x57490a['resetPasswordExpires']=null;return _0x57490a['save']();});})[_0x4c23('0x16')](function(){_0x560d2a[_0x4c23('0x32')](0xc8)['send']({'message':_0x4c23('0x51')});})[_0x4c23('0x1d')](function(_0x12625a){return handleError(_0x560d2a,0x1f4,_0x12625a);});};passport[_0x4c23('0x52')]('local-login',new LocalStrategy({'usernameField':_0x4c23('0xe'),'passwordField':_0x4c23('0x4f')},function(_0x5b950c,_0x2a5969,_0x952244){return localAuthenticate(db['User'],_0x5b950c,_0x2a5969,_0x952244);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 94c9c1a..56ffe6b 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 _0x49cb=['./authLocal.controller','post','login','/forgot','reset','exports','Router'];(function(_0xc12236,_0x2ee7b8){var _0x2bedb1=function(_0x4331ed){while(--_0x4331ed){_0xc12236['push'](_0xc12236['shift']());}};_0x2bedb1(++_0x2ee7b8);}(_0x49cb,0xbc));var _0xb49c=function(_0x440fca,_0x5d70a3){_0x440fca=_0x440fca-0x0;var _0x403ba1=_0x49cb[_0x440fca];return _0x403ba1;};'use strict';var express=require('express');var router=express[_0xb49c('0x0')]();var controller=require(_0xb49c('0x1'));router[_0xb49c('0x2')]('/',controller[_0xb49c('0x3')]);router[_0xb49c('0x2')](_0xb49c('0x4'),controller['forgot']);router[_0xb49c('0x2')]('/reset/:token',controller[_0xb49c('0x5')]);module[_0xb49c('0x6')]=router; \ No newline at end of file +var _0x9f22=['/reset/:token','reset','exports','express','./authLocal.controller','post','forgot'];(function(_0x32f476,_0x5002e9){var _0x435b18=function(_0x208563){while(--_0x208563){_0x32f476['push'](_0x32f476['shift']());}};_0x435b18(++_0x5002e9);}(_0x9f22,0x130));var _0x29f2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9f22[_0x397e5f];return _0x5302b8;};'use strict';var express=require(_0x29f2('0x0'));var router=express['Router']();var controller=require(_0x29f2('0x1'));router[_0x29f2('0x2')]('/',controller['login']);router['post']('/forgot',controller[_0x29f2('0x3')]);router[_0x29f2('0x2')](_0x29f2('0x4'),controller[_0x29f2('0x5')]);module[_0x29f2('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index a5c6298..bdc2e9c 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 _0x3d1b=['INTEGER','STRING'];(function(_0x4a8072,_0x435bab){var _0x11a4fe=function(_0x24b69a){while(--_0x24b69a){_0x4a8072['push'](_0x4a8072['shift']());}};_0x11a4fe(++_0x435bab);}(_0x3d1b,0x17b));var _0xb3d1=function(_0x44ff3a,_0x46f40d){_0x44ff3a=_0x44ff3a-0x0;var _0x333bc1=_0x3d1b[_0x44ff3a];return _0x333bc1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xb3d1('0x0')]},'description':{'type':Sequelize[_0xb3d1('0x0')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb3d1('0x1')],'defaultValue':0xa}}; \ No newline at end of file +var _0xfae1=['STRING','INTEGER','sequelize','exports'];(function(_0x174b19,_0x159c5d){var _0x32ac4a=function(_0x36c8d9){while(--_0x36c8d9){_0x174b19['push'](_0x174b19['shift']());}};_0x32ac4a(++_0x159c5d);}(_0xfae1,0xc6));var _0x1fae=function(_0xf0a2b5,_0x494499){_0xf0a2b5=_0xf0a2b5-0x0;var _0x56b380=_0xfae1[_0xf0a2b5];return _0x56b380;};'use strict';var Sequelize=require(_0x1fae('0x0'));module[_0x1fae('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x1fae('0x2')]},'description':{'type':Sequelize[_0x1fae('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1fae('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 b5f465c..24c8d93 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 _0x671c=['addConditions','Condition','ids','omit','findOne','getConditions','Action','getActions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','update','then','destroy','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body'];(function(_0x3b9a7a,_0xd9912c){var _0x5b9815=function(_0x5b7c98){while(--_0x5b7c98){_0x3b9a7a['push'](_0x3b9a7a['shift']());}};_0x5b9815(++_0xd9912c);}(_0x671c,0xff));var _0xc671=function(_0x2db24f,_0x340858){_0x2db24f=_0x2db24f-0x0;var _0x2c571c=_0x671c[_0x2db24f];return _0x2c571c;};'use strict';var emlformat=require(_0xc671('0x0'));var rimraf=require(_0xc671('0x1'));var zipdir=require(_0xc671('0x2'));var jsonpatch=require(_0xc671('0x3'));var rp=require('request-promise');var moment=require(_0xc671('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc671('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc671('0x6'));var ejs=require(_0xc671('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc671('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc671('0x9'));var deskjs=require(_0xc671('0xa'));var toCsv=require(_0xc671('0x6'));var querystring=require(_0xc671('0xb'));var Papa=require(_0xc671('0xc'));var Redis=require(_0xc671('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc671('0xe'));var as=require(_0xc671('0xf'));var hardwareService=require(_0xc671('0x10'));var logger=require(_0xc671('0x11'))(_0xc671('0x12'));var utils=require(_0xc671('0x13'));var config=require(_0xc671('0x14'));var licenseUtil=require(_0xc671('0x15'));var db=require(_0xc671('0x16'))['db'];function respondWithStatusCode(_0x35d7cb,_0x3780f7){_0x3780f7=_0x3780f7||0xcc;return function(_0x3cfac8){if(_0x3cfac8){return _0x35d7cb[_0xc671('0x17')](_0x3780f7);}return _0x35d7cb['status'](_0x3780f7)[_0xc671('0x18')]();};}function respondWithResult(_0x35e65c,_0x533e63){_0x533e63=_0x533e63||0xc8;return function(_0x50a101){if(_0x50a101){return _0x35e65c[_0xc671('0x19')](_0x533e63)[_0xc671('0x1a')](_0x50a101);}};}function respondWithFilteredResult(_0x2cdeb9,_0x22d112){return function(_0x29163e){if(_0x29163e){var _0x19a6ba=typeof _0x22d112[_0xc671('0x1b')]===_0xc671('0x1c')&&typeof _0x22d112['limit']===_0xc671('0x1c');var _0x1b8bae=_0x29163e['count'];var _0x475fa0=_0x19a6ba?0x0:_0x22d112[_0xc671('0x1b')];var _0x25388a=_0x19a6ba?_0x29163e[_0xc671('0x1d')]:_0x22d112[_0xc671('0x1b')]+_0x22d112[_0xc671('0x1e')];var _0x14f04f;if(_0x25388a>=_0x1b8bae){_0x25388a=_0x1b8bae;_0x14f04f=0xc8;}else{_0x14f04f=0xce;}_0x2cdeb9[_0xc671('0x19')](_0x14f04f);return _0x2cdeb9[_0xc671('0x1f')]('Content-Range',_0x475fa0+'-'+_0x25388a+'/'+_0x1b8bae)['json'](_0x29163e);}return null;};}function patchUpdates(_0x1141d7){return function(_0x3d8c7c){try{jsonpatch[_0xc671('0x20')](_0x3d8c7c,_0x1141d7,!![]);}catch(_0x487a95){return BPromise['reject'](_0x487a95);}return _0x3d8c7c['save']();};}function saveUpdates(_0x3cab83,_0xd1a70b){return function(_0x5b4bef){if(_0x5b4bef){return _0x5b4bef[_0xc671('0x21')](_0x3cab83)[_0xc671('0x22')](function(_0x47c38b){return _0x47c38b;});}return null;};}function removeEntity(_0x10293c,_0x1882cc){return function(_0x424e6b){if(_0x424e6b){return _0x424e6b[_0xc671('0x23')]()[_0xc671('0x22')](function(){_0x10293c[_0xc671('0x19')](0xcc)[_0xc671('0x18')]();});}};}function handleEntityNotFound(_0x3df049,_0x1b03c3){return function(_0x31bd36){if(!_0x31bd36){_0x3df049[_0xc671('0x17')](0x194);}return _0x31bd36;};}function handleError(_0x213272,_0x5c06e1){_0x5c06e1=_0x5c06e1||0x1f4;return function(_0x5355b2){logger[_0xc671('0x24')](_0x5355b2[_0xc671('0x25')]);if(_0x5355b2[_0xc671('0x26')]){delete _0x5355b2[_0xc671('0x26')];}_0x213272['status'](_0x5c06e1)['send'](_0x5355b2);};}exports[_0xc671('0x27')]=function(_0x199352,_0x58e08a){var _0x5b10a7={},_0xef0c68={},_0x464bf0={'count':0x0,'rows':[]};var _0x3148af=_[_0xc671('0x28')](db[_0xc671('0x29')][_0xc671('0x2a')],function(_0x474d06){return{'name':_0x474d06[_0xc671('0x2b')],'type':_0x474d06[_0xc671('0x2c')][_0xc671('0x2d')]};});_0xef0c68[_0xc671('0x2e')]=_[_0xc671('0x28')](_0x3148af,_0xc671('0x26'));_0xef0c68[_0xc671('0x2f')]=_['keys'](_0x199352[_0xc671('0x2f')]);_0xef0c68['filters']=_[_0xc671('0x30')](_0xef0c68[_0xc671('0x2e')],_0xef0c68[_0xc671('0x2f')]);_0x5b10a7[_0xc671('0x31')]=_[_0xc671('0x30')](_0xef0c68[_0xc671('0x2e')],qs[_0xc671('0x32')](_0x199352['query'][_0xc671('0x32')]));_0x5b10a7[_0xc671('0x31')]=_0x5b10a7[_0xc671('0x31')]['length']?_0x5b10a7['attributes']:_0xef0c68['model'];if(!_0x199352[_0xc671('0x2f')][_0xc671('0x33')]('nolimit')){_0x5b10a7['limit']=qs['limit'](_0x199352[_0xc671('0x2f')]['limit']);_0x5b10a7[_0xc671('0x1b')]=qs[_0xc671('0x1b')](_0x199352[_0xc671('0x2f')][_0xc671('0x1b')]);}_0x5b10a7[_0xc671('0x34')]=qs[_0xc671('0x35')](_0x199352['query'][_0xc671('0x35')]);_0x5b10a7[_0xc671('0x36')]=qs[_0xc671('0x37')](_[_0xc671('0x38')](_0x199352[_0xc671('0x2f')],_0xef0c68[_0xc671('0x37')]),_0x3148af);if(_0x199352[_0xc671('0x2f')][_0xc671('0x39')]){_0x5b10a7[_0xc671('0x36')]=_['merge'](_0x5b10a7[_0xc671('0x36')],{'$or':_['map'](_0x3148af,function(_0x39d2ab){if(_0x39d2ab['type']!==_0xc671('0x3a')){var _0x1529a7={};_0x1529a7[_0x39d2ab[_0xc671('0x26')]]={'$like':'%'+_0x199352['query']['filter']+'%'};return _0x1529a7;}})});}_0x5b10a7=_[_0xc671('0x3b')]({},_0x5b10a7,_0x199352[_0xc671('0x3c')]);var _0x175ab2={'where':_0x5b10a7[_0xc671('0x36')]};return db[_0xc671('0x29')][_0xc671('0x1d')](_0x175ab2)['then'](function(_0x127a34){_0x464bf0['count']=_0x127a34;if(_0x199352[_0xc671('0x2f')][_0xc671('0x3d')]){_0x5b10a7[_0xc671('0x3e')]=[{'all':!![]}];}return db['Automation'][_0xc671('0x3f')](_0x5b10a7);})[_0xc671('0x22')](function(_0x9aa1a3){_0x464bf0[_0xc671('0x40')]=_0x9aa1a3;return _0x464bf0;})[_0xc671('0x22')](respondWithFilteredResult(_0x58e08a,_0x5b10a7))[_0xc671('0x41')](handleError(_0x58e08a,null));};exports[_0xc671('0x42')]=function(_0x3cff55,_0x3ad52a){var _0x41949c={'raw':![],'where':{'id':_0x3cff55[_0xc671('0x43')]['id']}},_0x4aa564={};_0x4aa564['model']=_[_0xc671('0x44')](db[_0xc671('0x29')][_0xc671('0x2a')]);_0x4aa564[_0xc671('0x2f')]=_[_0xc671('0x44')](_0x3cff55[_0xc671('0x2f')]);_0x4aa564[_0xc671('0x37')]=_[_0xc671('0x30')](_0x4aa564[_0xc671('0x2e')],_0x4aa564[_0xc671('0x2f')]);_0x41949c[_0xc671('0x31')]=_[_0xc671('0x30')](_0x4aa564[_0xc671('0x2e')],qs[_0xc671('0x32')](_0x3cff55[_0xc671('0x2f')][_0xc671('0x32')]));_0x41949c[_0xc671('0x31')]=_0x41949c[_0xc671('0x31')][_0xc671('0x45')]?_0x41949c['attributes']:_0x4aa564[_0xc671('0x2e')];if(_0x3cff55[_0xc671('0x2f')][_0xc671('0x3d')]){_0x41949c[_0xc671('0x3e')]=[{'all':!![]}];}_0x41949c=_[_0xc671('0x3b')]({},_0x41949c,_0x3cff55['options']);return db['Automation'][_0xc671('0x46')](_0x41949c)[_0xc671('0x22')](handleEntityNotFound(_0x3ad52a,null))[_0xc671('0x22')](respondWithResult(_0x3ad52a,null))[_0xc671('0x41')](handleError(_0x3ad52a,null));};exports[_0xc671('0x47')]=function(_0x23c666,_0x22e3d4){return db['Automation']['create'](_0x23c666[_0xc671('0x48')],{})['then'](respondWithResult(_0x22e3d4,0xc9))['catch'](handleError(_0x22e3d4,null));};exports[_0xc671('0x21')]=function(_0x1a46d2,_0x1e1b87){if(_0x1a46d2[_0xc671('0x48')]['id']){delete _0x1a46d2[_0xc671('0x48')]['id'];}return db[_0xc671('0x29')][_0xc671('0x46')]({'where':{'id':_0x1a46d2['params']['id']}})[_0xc671('0x22')](handleEntityNotFound(_0x1e1b87,null))[_0xc671('0x22')](saveUpdates(_0x1a46d2[_0xc671('0x48')],null))[_0xc671('0x22')](respondWithResult(_0x1e1b87,null))[_0xc671('0x41')](handleError(_0x1e1b87,null));};exports[_0xc671('0x23')]=function(_0x292d16,_0x287024){return db[_0xc671('0x29')][_0xc671('0x46')]({'where':{'id':_0x292d16[_0xc671('0x43')]['id']}})['then'](handleEntityNotFound(_0x287024,null))[_0xc671('0x22')](removeEntity(_0x287024,null))[_0xc671('0x41')](handleError(_0x287024,null));};exports[_0xc671('0x49')]=function(_0x1038f7,_0x348f1e,_0x35a024){return db[_0xc671('0x4a')][_0xc671('0x46')]({'where':{'id':_0x1038f7[_0xc671('0x43')]['id']}})[_0xc671('0x22')](handleEntityNotFound(_0x348f1e,null))[_0xc671('0x22')](function(_0x3938ea){if(_0x3938ea){return _0x3938ea[_0xc671('0x49')](_0x1038f7[_0xc671('0x48')][_0xc671('0x4b')],_[_0xc671('0x4c')](_0x1038f7[_0xc671('0x48')],[_0xc671('0x4b'),'id'])||{});}})[_0xc671('0x22')](respondWithResult(_0x348f1e,null))[_0xc671('0x41')](handleError(_0x348f1e,null));};exports['getConditions']=function(_0x2c0d8c,_0x10f8cd,_0xd50f74){var _0x4b69fa={};var _0x40299a={};var _0x223be7;var _0x26ff8e;return db[_0xc671('0x29')][_0xc671('0x4d')]({'where':{'id':_0x2c0d8c[_0xc671('0x43')]['id']}})['then'](handleEntityNotFound(_0x10f8cd,null))[_0xc671('0x22')](function(_0x282212){if(_0x282212){_0x223be7=_0x282212;_0x40299a[_0xc671('0x2e')]=_[_0xc671('0x44')](db[_0xc671('0x4a')][_0xc671('0x2a')]);_0x40299a['query']=_[_0xc671('0x44')](_0x2c0d8c[_0xc671('0x2f')]);_0x40299a[_0xc671('0x37')]=_[_0xc671('0x30')](_0x40299a[_0xc671('0x2e')],_0x40299a[_0xc671('0x2f')]);_0x4b69fa[_0xc671('0x31')]=_[_0xc671('0x30')](_0x40299a[_0xc671('0x2e')],qs[_0xc671('0x32')](_0x2c0d8c['query'][_0xc671('0x32')]));_0x4b69fa[_0xc671('0x31')]=_0x4b69fa[_0xc671('0x31')][_0xc671('0x45')]?_0x4b69fa[_0xc671('0x31')]:_0x40299a['model'];_0x4b69fa['order']=qs[_0xc671('0x35')](_0x2c0d8c[_0xc671('0x2f')][_0xc671('0x35')]);_0x4b69fa[_0xc671('0x36')]=qs[_0xc671('0x37')](_[_0xc671('0x38')](_0x2c0d8c[_0xc671('0x2f')],_0x40299a[_0xc671('0x37')]));if(_0x2c0d8c['query']['filter']){_0x4b69fa[_0xc671('0x36')]=_['merge'](_0x4b69fa['where'],{'$or':_[_0xc671('0x28')](_0x4b69fa[_0xc671('0x31')],function(_0x30db28){var _0x321daa={};_0x321daa[_0x30db28]={'$like':'%'+_0x2c0d8c['query'][_0xc671('0x39')]+'%'};return _0x321daa;})});}_0x4b69fa=_[_0xc671('0x3b')]({},_0x4b69fa,_0x2c0d8c['options']);return _0x223be7[_0xc671('0x4e')](_0x4b69fa);}})[_0xc671('0x22')](function(_0x27e0ac){if(_0x27e0ac){_0x26ff8e=_0x27e0ac[_0xc671('0x45')];if(!_0x2c0d8c[_0xc671('0x2f')][_0xc671('0x33')]('nolimit')){_0x4b69fa[_0xc671('0x1e')]=qs[_0xc671('0x1e')](_0x2c0d8c[_0xc671('0x2f')]['limit']);_0x4b69fa[_0xc671('0x1b')]=qs[_0xc671('0x1b')](_0x2c0d8c[_0xc671('0x2f')][_0xc671('0x1b')]);}return _0x223be7['getConditions'](_0x4b69fa);}})[_0xc671('0x22')](function(_0x4c4679){if(_0x4c4679){return _0x4c4679?{'count':_0x26ff8e,'rows':_0x4c4679}:null;}})[_0xc671('0x22')](respondWithResult(_0x10f8cd,null))[_0xc671('0x41')](handleError(_0x10f8cd,null));};exports['addActions']=function(_0x34c4ad,_0x4e2ebd,_0x42adc7){return db[_0xc671('0x4f')][_0xc671('0x46')]({'where':{'id':_0x34c4ad[_0xc671('0x43')]['id']}})[_0xc671('0x22')](handleEntityNotFound(_0x4e2ebd,null))[_0xc671('0x22')](function(_0x5ed75){if(_0x5ed75){return _0x5ed75['addActions'](_0x34c4ad['body'][_0xc671('0x4b')],_[_0xc671('0x4c')](_0x34c4ad['body'],[_0xc671('0x4b'),'id'])||{});}})[_0xc671('0x22')](respondWithResult(_0x4e2ebd,null))[_0xc671('0x41')](handleError(_0x4e2ebd,null));};exports[_0xc671('0x50')]=function(_0x6087cf,_0x4952f8,_0x3b73e4){var _0x514646={};var _0x32268c={};var _0x53c7eb;var _0x58429b;return db[_0xc671('0x29')][_0xc671('0x4d')]({'where':{'id':_0x6087cf['params']['id']}})[_0xc671('0x22')](handleEntityNotFound(_0x4952f8,null))[_0xc671('0x22')](function(_0x496127){if(_0x496127){_0x53c7eb=_0x496127;_0x32268c['model']=_['keys'](db['Action'][_0xc671('0x2a')]);_0x32268c[_0xc671('0x2f')]=_['keys'](_0x6087cf['query']);_0x32268c[_0xc671('0x37')]=_[_0xc671('0x30')](_0x32268c[_0xc671('0x2e')],_0x32268c[_0xc671('0x2f')]);_0x514646[_0xc671('0x31')]=_[_0xc671('0x30')](_0x32268c['model'],qs[_0xc671('0x32')](_0x6087cf[_0xc671('0x2f')][_0xc671('0x32')]));_0x514646['attributes']=_0x514646[_0xc671('0x31')][_0xc671('0x45')]?_0x514646[_0xc671('0x31')]:_0x32268c['model'];_0x514646[_0xc671('0x34')]=qs[_0xc671('0x35')](_0x6087cf[_0xc671('0x2f')][_0xc671('0x35')]);_0x514646[_0xc671('0x36')]=qs['filters'](_[_0xc671('0x38')](_0x6087cf[_0xc671('0x2f')],_0x32268c[_0xc671('0x37')]));if(_0x6087cf[_0xc671('0x2f')][_0xc671('0x39')]){_0x514646[_0xc671('0x36')]=_[_0xc671('0x3b')](_0x514646['where'],{'$or':_[_0xc671('0x28')](_0x514646['attributes'],function(_0x14f883){var _0x383635={};_0x383635[_0x14f883]={'$like':'%'+_0x6087cf['query'][_0xc671('0x39')]+'%'};return _0x383635;})});}_0x514646=_['merge']({},_0x514646,_0x6087cf['options']);return _0x53c7eb[_0xc671('0x50')](_0x514646);}})[_0xc671('0x22')](function(_0x577796){if(_0x577796){_0x58429b=_0x577796[_0xc671('0x45')];if(!_0x6087cf[_0xc671('0x2f')][_0xc671('0x33')](_0xc671('0x51'))){_0x514646[_0xc671('0x1e')]=qs[_0xc671('0x1e')](_0x6087cf[_0xc671('0x2f')]['limit']);_0x514646[_0xc671('0x1b')]=qs[_0xc671('0x1b')](_0x6087cf[_0xc671('0x2f')]['offset']);}return _0x53c7eb[_0xc671('0x50')](_0x514646);}})['then'](function(_0x30c629){if(_0x30c629){return _0x30c629?{'count':_0x58429b,'rows':_0x30c629}:null;}})[_0xc671('0x22')](respondWithResult(_0x4952f8,null))['catch'](handleError(_0x4952f8,null));}; \ No newline at end of file +var _0x0978=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','Automation','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','getActions','Action','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x0978,0xa9));var _0x8097=function(_0x247920,_0x1088f4){_0x247920=_0x247920-0x0;var _0xc423c4=_0x0978[_0x247920];return _0xc423c4;};'use strict';var emlformat=require(_0x8097('0x0'));var rimraf=require(_0x8097('0x1'));var zipdir=require(_0x8097('0x2'));var jsonpatch=require(_0x8097('0x3'));var rp=require('request-promise');var moment=require(_0x8097('0x4'));var BPromise=require(_0x8097('0x5'));var Mustache=require(_0x8097('0x6'));var util=require(_0x8097('0x7'));var path=require(_0x8097('0x8'));var sox=require(_0x8097('0x9'));var csv=require(_0x8097('0xa'));var ejs=require(_0x8097('0xb'));var fs=require('fs');var fs_extra=require(_0x8097('0xc'));var _=require(_0x8097('0xd'));var squel=require(_0x8097('0xe'));var crypto=require(_0x8097('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8097('0xa'));var querystring=require(_0x8097('0x10'));var Papa=require('papaparse');var Redis=require(_0x8097('0x11'));var authService=require(_0x8097('0x12'));var qs=require(_0x8097('0x13'));var as=require(_0x8097('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8097('0x15'))(_0x8097('0x16'));var utils=require(_0x8097('0x17'));var config=require(_0x8097('0x18'));var licenseUtil=require(_0x8097('0x19'));var db=require(_0x8097('0x1a'))['db'];function respondWithStatusCode(_0x44ee02,_0x266dc8){_0x266dc8=_0x266dc8||0xcc;return function(_0x24fc28){if(_0x24fc28){return _0x44ee02['sendStatus'](_0x266dc8);}return _0x44ee02[_0x8097('0x1b')](_0x266dc8)[_0x8097('0x1c')]();};}function respondWithResult(_0x3cddd4,_0x374b07){_0x374b07=_0x374b07||0xc8;return function(_0x275d1e){if(_0x275d1e){return _0x3cddd4['status'](_0x374b07)[_0x8097('0x1d')](_0x275d1e);}};}function respondWithFilteredResult(_0x2eefa3,_0x458399){return function(_0x58f0aa){if(_0x58f0aa){var _0x54ef45=typeof _0x458399[_0x8097('0x1e')]==='undefined'&&typeof _0x458399[_0x8097('0x1f')]===_0x8097('0x20');var _0x316f12=_0x58f0aa[_0x8097('0x21')];var _0xba5422=_0x54ef45?0x0:_0x458399[_0x8097('0x1e')];var _0x47cc9a=_0x54ef45?_0x58f0aa[_0x8097('0x21')]:_0x458399['offset']+_0x458399[_0x8097('0x1f')];var _0x2fbe62;if(_0x47cc9a>=_0x316f12){_0x47cc9a=_0x316f12;_0x2fbe62=0xc8;}else{_0x2fbe62=0xce;}_0x2eefa3[_0x8097('0x1b')](_0x2fbe62);return _0x2eefa3['set'](_0x8097('0x22'),_0xba5422+'-'+_0x47cc9a+'/'+_0x316f12)['json'](_0x58f0aa);}return null;};}function patchUpdates(_0x39d862){return function(_0x4e1d51){try{jsonpatch[_0x8097('0x23')](_0x4e1d51,_0x39d862,!![]);}catch(_0x2663e4){return BPromise[_0x8097('0x24')](_0x2663e4);}return _0x4e1d51[_0x8097('0x25')]();};}function saveUpdates(_0x56f6d5,_0x1b767d){return function(_0xeeed6d){if(_0xeeed6d){return _0xeeed6d[_0x8097('0x26')](_0x56f6d5)[_0x8097('0x27')](function(_0xdda2fc){return _0xdda2fc;});}return null;};}function removeEntity(_0xed881d,_0x107ccc){return function(_0x2d8748){if(_0x2d8748){return _0x2d8748[_0x8097('0x28')]()[_0x8097('0x27')](function(){_0xed881d['status'](0xcc)[_0x8097('0x1c')]();});}};}function handleEntityNotFound(_0x798521,_0x2f3063){return function(_0x3b54af){if(!_0x3b54af){_0x798521['sendStatus'](0x194);}return _0x3b54af;};}function handleError(_0x415ef1,_0x227684){_0x227684=_0x227684||0x1f4;return function(_0x4a9a85){logger[_0x8097('0x29')](_0x4a9a85[_0x8097('0x2a')]);if(_0x4a9a85[_0x8097('0x2b')]){delete _0x4a9a85[_0x8097('0x2b')];}_0x415ef1[_0x8097('0x1b')](_0x227684)[_0x8097('0x2c')](_0x4a9a85);};}exports[_0x8097('0x2d')]=function(_0x54d3dc,_0x9644d9){var _0x4e20b6={},_0x569906={},_0x47e75b={'count':0x0,'rows':[]};var _0x43598e=_[_0x8097('0x2e')](db['Automation']['rawAttributes'],function(_0x448e03){return{'name':_0x448e03['fieldName'],'type':_0x448e03[_0x8097('0x2f')][_0x8097('0x30')]};});_0x569906[_0x8097('0x31')]=_[_0x8097('0x2e')](_0x43598e,_0x8097('0x2b'));_0x569906[_0x8097('0x32')]=_[_0x8097('0x33')](_0x54d3dc[_0x8097('0x32')]);_0x569906[_0x8097('0x34')]=_[_0x8097('0x35')](_0x569906[_0x8097('0x31')],_0x569906[_0x8097('0x32')]);_0x4e20b6[_0x8097('0x36')]=_[_0x8097('0x35')](_0x569906['model'],qs[_0x8097('0x37')](_0x54d3dc[_0x8097('0x32')][_0x8097('0x37')]));_0x4e20b6[_0x8097('0x36')]=_0x4e20b6[_0x8097('0x36')][_0x8097('0x38')]?_0x4e20b6['attributes']:_0x569906['model'];if(!_0x54d3dc['query'][_0x8097('0x39')]('nolimit')){_0x4e20b6[_0x8097('0x1f')]=qs['limit'](_0x54d3dc['query'][_0x8097('0x1f')]);_0x4e20b6[_0x8097('0x1e')]=qs['offset'](_0x54d3dc[_0x8097('0x32')][_0x8097('0x1e')]);}_0x4e20b6[_0x8097('0x3a')]=qs[_0x8097('0x3b')](_0x54d3dc[_0x8097('0x32')][_0x8097('0x3b')]);_0x4e20b6['where']=qs[_0x8097('0x34')](_[_0x8097('0x3c')](_0x54d3dc[_0x8097('0x32')],_0x569906['filters']),_0x43598e);if(_0x54d3dc[_0x8097('0x32')][_0x8097('0x3d')]){_0x4e20b6[_0x8097('0x3e')]=_[_0x8097('0x3f')](_0x4e20b6[_0x8097('0x3e')],{'$or':_[_0x8097('0x2e')](_0x43598e,function(_0x4cb468){if(_0x4cb468['type']!==_0x8097('0x40')){var _0x4fb8cc={};_0x4fb8cc[_0x4cb468[_0x8097('0x2b')]]={'$like':'%'+_0x54d3dc[_0x8097('0x32')][_0x8097('0x3d')]+'%'};return _0x4fb8cc;}})});}_0x4e20b6=_['merge']({},_0x4e20b6,_0x54d3dc[_0x8097('0x41')]);var _0x417217={'where':_0x4e20b6[_0x8097('0x3e')]};return db[_0x8097('0x42')]['count'](_0x417217)['then'](function(_0x420cbb){_0x47e75b[_0x8097('0x21')]=_0x420cbb;if(_0x54d3dc['query'][_0x8097('0x43')]){_0x4e20b6['include']=[{'all':!![]}];}return db[_0x8097('0x42')]['findAll'](_0x4e20b6);})[_0x8097('0x27')](function(_0x3703bc){_0x47e75b[_0x8097('0x44')]=_0x3703bc;return _0x47e75b;})['then'](respondWithFilteredResult(_0x9644d9,_0x4e20b6))[_0x8097('0x45')](handleError(_0x9644d9,null));};exports[_0x8097('0x46')]=function(_0x5b606c,_0x1fd86b){var _0xea11b2={'raw':![],'where':{'id':_0x5b606c[_0x8097('0x47')]['id']}},_0x39d5a6={};_0x39d5a6[_0x8097('0x31')]=_[_0x8097('0x33')](db[_0x8097('0x42')][_0x8097('0x48')]);_0x39d5a6['query']=_[_0x8097('0x33')](_0x5b606c[_0x8097('0x32')]);_0x39d5a6[_0x8097('0x34')]=_[_0x8097('0x35')](_0x39d5a6['model'],_0x39d5a6[_0x8097('0x32')]);_0xea11b2[_0x8097('0x36')]=_[_0x8097('0x35')](_0x39d5a6[_0x8097('0x31')],qs[_0x8097('0x37')](_0x5b606c[_0x8097('0x32')][_0x8097('0x37')]));_0xea11b2['attributes']=_0xea11b2[_0x8097('0x36')]['length']?_0xea11b2[_0x8097('0x36')]:_0x39d5a6[_0x8097('0x31')];if(_0x5b606c[_0x8097('0x32')][_0x8097('0x43')]){_0xea11b2[_0x8097('0x49')]=[{'all':!![]}];}_0xea11b2=_[_0x8097('0x3f')]({},_0xea11b2,_0x5b606c[_0x8097('0x41')]);return db[_0x8097('0x42')][_0x8097('0x4a')](_0xea11b2)[_0x8097('0x27')](handleEntityNotFound(_0x1fd86b,null))[_0x8097('0x27')](respondWithResult(_0x1fd86b,null))[_0x8097('0x45')](handleError(_0x1fd86b,null));};exports[_0x8097('0x4b')]=function(_0x5bfbf9,_0x58f907){return db[_0x8097('0x42')][_0x8097('0x4b')](_0x5bfbf9[_0x8097('0x4c')],{})[_0x8097('0x27')](respondWithResult(_0x58f907,0xc9))[_0x8097('0x45')](handleError(_0x58f907,null));};exports['update']=function(_0x27f827,_0x5a41f5){if(_0x27f827[_0x8097('0x4c')]['id']){delete _0x27f827[_0x8097('0x4c')]['id'];}return db[_0x8097('0x42')]['find']({'where':{'id':_0x27f827[_0x8097('0x47')]['id']}})[_0x8097('0x27')](handleEntityNotFound(_0x5a41f5,null))[_0x8097('0x27')](saveUpdates(_0x27f827['body'],null))[_0x8097('0x27')](respondWithResult(_0x5a41f5,null))['catch'](handleError(_0x5a41f5,null));};exports[_0x8097('0x28')]=function(_0x51c408,_0x1d8627){return db[_0x8097('0x42')]['find']({'where':{'id':_0x51c408[_0x8097('0x47')]['id']}})[_0x8097('0x27')](handleEntityNotFound(_0x1d8627,null))['then'](removeEntity(_0x1d8627,null))[_0x8097('0x45')](handleError(_0x1d8627,null));};exports[_0x8097('0x4d')]=function(_0x284fbe,_0x308dbd,_0x4ccbaf){return db[_0x8097('0x4e')][_0x8097('0x4a')]({'where':{'id':_0x284fbe[_0x8097('0x47')]['id']}})[_0x8097('0x27')](handleEntityNotFound(_0x308dbd,null))['then'](function(_0x52fcb3){if(_0x52fcb3){return _0x52fcb3[_0x8097('0x4d')](_0x284fbe[_0x8097('0x4c')][_0x8097('0x4f')],_[_0x8097('0x50')](_0x284fbe[_0x8097('0x4c')],['ids','id'])||{});}})[_0x8097('0x27')](respondWithResult(_0x308dbd,null))[_0x8097('0x45')](handleError(_0x308dbd,null));};exports[_0x8097('0x51')]=function(_0x20a724,_0x5ef8f6,_0x3679a6){var _0x5c8ae4={};var _0x381c5f={};var _0x2b530d;var _0x454373;return db[_0x8097('0x42')][_0x8097('0x52')]({'where':{'id':_0x20a724[_0x8097('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ef8f6,null))[_0x8097('0x27')](function(_0x32908e){if(_0x32908e){_0x2b530d=_0x32908e;_0x381c5f[_0x8097('0x31')]=_[_0x8097('0x33')](db[_0x8097('0x4e')][_0x8097('0x48')]);_0x381c5f['query']=_[_0x8097('0x33')](_0x20a724[_0x8097('0x32')]);_0x381c5f['filters']=_[_0x8097('0x35')](_0x381c5f['model'],_0x381c5f[_0x8097('0x32')]);_0x5c8ae4['attributes']=_[_0x8097('0x35')](_0x381c5f[_0x8097('0x31')],qs[_0x8097('0x37')](_0x20a724[_0x8097('0x32')]['fields']));_0x5c8ae4[_0x8097('0x36')]=_0x5c8ae4[_0x8097('0x36')][_0x8097('0x38')]?_0x5c8ae4[_0x8097('0x36')]:_0x381c5f[_0x8097('0x31')];_0x5c8ae4[_0x8097('0x3a')]=qs[_0x8097('0x3b')](_0x20a724[_0x8097('0x32')][_0x8097('0x3b')]);_0x5c8ae4[_0x8097('0x3e')]=qs[_0x8097('0x34')](_[_0x8097('0x3c')](_0x20a724['query'],_0x381c5f[_0x8097('0x34')]));if(_0x20a724[_0x8097('0x32')][_0x8097('0x3d')]){_0x5c8ae4[_0x8097('0x3e')]=_[_0x8097('0x3f')](_0x5c8ae4[_0x8097('0x3e')],{'$or':_[_0x8097('0x2e')](_0x5c8ae4[_0x8097('0x36')],function(_0x35451d){var _0x4c2f55={};_0x4c2f55[_0x35451d]={'$like':'%'+_0x20a724['query'][_0x8097('0x3d')]+'%'};return _0x4c2f55;})});}_0x5c8ae4=_[_0x8097('0x3f')]({},_0x5c8ae4,_0x20a724[_0x8097('0x41')]);return _0x2b530d[_0x8097('0x51')](_0x5c8ae4);}})[_0x8097('0x27')](function(_0x57c0a5){if(_0x57c0a5){_0x454373=_0x57c0a5[_0x8097('0x38')];if(!_0x20a724[_0x8097('0x32')]['hasOwnProperty']('nolimit')){_0x5c8ae4[_0x8097('0x1f')]=qs[_0x8097('0x1f')](_0x20a724[_0x8097('0x32')][_0x8097('0x1f')]);_0x5c8ae4[_0x8097('0x1e')]=qs[_0x8097('0x1e')](_0x20a724['query'][_0x8097('0x1e')]);}return _0x2b530d[_0x8097('0x51')](_0x5c8ae4);}})[_0x8097('0x27')](function(_0x29f8d4){if(_0x29f8d4){return _0x29f8d4?{'count':_0x454373,'rows':_0x29f8d4}:null;}})[_0x8097('0x27')](respondWithResult(_0x5ef8f6,null))[_0x8097('0x45')](handleError(_0x5ef8f6,null));};exports[_0x8097('0x53')]=function(_0x66693b,_0x174f24,_0x2c3d77){return db['Action']['find']({'where':{'id':_0x66693b['params']['id']}})[_0x8097('0x27')](handleEntityNotFound(_0x174f24,null))[_0x8097('0x27')](function(_0x50d3cf){if(_0x50d3cf){return _0x50d3cf[_0x8097('0x53')](_0x66693b[_0x8097('0x4c')][_0x8097('0x4f')],_[_0x8097('0x50')](_0x66693b[_0x8097('0x4c')],[_0x8097('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x174f24,null))[_0x8097('0x45')](handleError(_0x174f24,null));};exports[_0x8097('0x54')]=function(_0x5b738c,_0x51fa41,_0x1745d2){var _0x577110={};var _0x4ea38={};var _0x214130;var _0x26f37e;return db[_0x8097('0x42')]['findOne']({'where':{'id':_0x5b738c[_0x8097('0x47')]['id']}})[_0x8097('0x27')](handleEntityNotFound(_0x51fa41,null))[_0x8097('0x27')](function(_0x22b23d){if(_0x22b23d){_0x214130=_0x22b23d;_0x4ea38['model']=_[_0x8097('0x33')](db[_0x8097('0x55')][_0x8097('0x48')]);_0x4ea38[_0x8097('0x32')]=_['keys'](_0x5b738c[_0x8097('0x32')]);_0x4ea38[_0x8097('0x34')]=_[_0x8097('0x35')](_0x4ea38['model'],_0x4ea38['query']);_0x577110['attributes']=_[_0x8097('0x35')](_0x4ea38[_0x8097('0x31')],qs[_0x8097('0x37')](_0x5b738c[_0x8097('0x32')][_0x8097('0x37')]));_0x577110[_0x8097('0x36')]=_0x577110[_0x8097('0x36')][_0x8097('0x38')]?_0x577110[_0x8097('0x36')]:_0x4ea38['model'];_0x577110['order']=qs[_0x8097('0x3b')](_0x5b738c['query'][_0x8097('0x3b')]);_0x577110[_0x8097('0x3e')]=qs['filters'](_[_0x8097('0x3c')](_0x5b738c[_0x8097('0x32')],_0x4ea38['filters']));if(_0x5b738c[_0x8097('0x32')][_0x8097('0x3d')]){_0x577110[_0x8097('0x3e')]=_[_0x8097('0x3f')](_0x577110[_0x8097('0x3e')],{'$or':_[_0x8097('0x2e')](_0x577110[_0x8097('0x36')],function(_0x2ef052){var _0x367d89={};_0x367d89[_0x2ef052]={'$like':'%'+_0x5b738c['query'][_0x8097('0x3d')]+'%'};return _0x367d89;})});}_0x577110=_[_0x8097('0x3f')]({},_0x577110,_0x5b738c[_0x8097('0x41')]);return _0x214130[_0x8097('0x54')](_0x577110);}})['then'](function(_0x308cbb){if(_0x308cbb){_0x26f37e=_0x308cbb[_0x8097('0x38')];if(!_0x5b738c[_0x8097('0x32')]['hasOwnProperty'](_0x8097('0x56'))){_0x577110[_0x8097('0x1f')]=qs[_0x8097('0x1f')](_0x5b738c[_0x8097('0x32')][_0x8097('0x1f')]);_0x577110[_0x8097('0x1e')]=qs['offset'](_0x5b738c['query'][_0x8097('0x1e')]);}return _0x214130[_0x8097('0x54')](_0x577110);}})[_0x8097('0x27')](function(_0x23715e){if(_0x23715e){return _0x23715e?{'count':_0x26f37e,'rows':_0x23715e}:null;}})[_0x8097('0x27')](respondWithResult(_0x51fa41,null))[_0x8097('0x45')](handleError(_0x51fa41,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 1e8bc5d..88d1e58 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 _0xb5d4=['exports','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5f5b80,_0x9d5100){var _0x484241=function(_0x2a5032){while(--_0x2a5032){_0x5f5b80['push'](_0x5f5b80['shift']());}};_0x484241(++_0x9d5100);}(_0xb5d4,0xff));var _0x4b5d=function(_0x3f9033,_0x171e08){_0x3f9033=_0x3f9033-0x0;var _0x2818b6=_0xb5d4[_0x3f9033];return _0x2818b6;};'use strict';var _=require(_0x4b5d('0x0'));var util=require(_0x4b5d('0x1'));var logger=require(_0x4b5d('0x2'))(_0x4b5d('0x3'));var moment=require(_0x4b5d('0x4'));var BPromise=require(_0x4b5d('0x5'));var rp=require(_0x4b5d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b5d('0x7'));var config=require(_0x4b5d('0x8'));var attributes=require('./automation.attributes');module[_0x4b5d('0x9')]=function(_0x4d5628,_0x4678c4){return _0x4d5628['define']('Automation',attributes,{'tableName':_0x4b5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2c3=['define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','./automation.attributes'];(function(_0xd73a50,_0xbe4f47){var _0x457b14=function(_0x3c0046){while(--_0x3c0046){_0xd73a50['push'](_0xd73a50['shift']());}};_0x457b14(++_0xbe4f47);}(_0xb2c3,0x189));var _0x3b2c=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0xb2c3[_0x22377a];return _0x36f105;};'use strict';var _=require(_0x3b2c('0x0'));var util=require(_0x3b2c('0x1'));var logger=require(_0x3b2c('0x2'))(_0x3b2c('0x3'));var moment=require(_0x3b2c('0x4'));var BPromise=require(_0x3b2c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3b2c('0x6'));module['exports']=function(_0x4c1d67,_0x8b9356){return _0x4c1d67[_0x3b2c('0x7')](_0x3b2c('0x8'),attributes,{'tableName':_0x3b2c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index d62ed8a..731990e 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 _0x349f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5963f2,_0x498793){var _0x2d5232=function(_0x5e1d5a){while(--_0x5e1d5a){_0x5963f2['push'](_0x5963f2['shift']());}};_0x2d5232(++_0x498793);}(_0x349f,0xa8));var _0xf349=function(_0x36dfb5,_0x39a2f4){_0x36dfb5=_0x36dfb5-0x0;var _0x1d5e5=_0x349f[_0x36dfb5];return _0x1d5e5;};'use strict';var _=require(_0xf349('0x0'));var util=require(_0xf349('0x1'));var moment=require(_0xf349('0x2'));var BPromise=require('bluebird');var rs=require(_0xf349('0x3'));var fs=require('fs');var Redis=require(_0xf349('0x4'));var db=require(_0xf349('0x5'))['db'];var utils=require(_0xf349('0x6'));var logger=require(_0xf349('0x7'))(_0xf349('0x8'));var config=require(_0xf349('0x9'));var jayson=require(_0xf349('0xa'));var client=jayson[_0xf349('0xb')][_0xf349('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c6f4c,_0x1bd44a,_0x23fb4b){return new BPromise(function(_0x6c6cd2,_0x21a480){return client[_0xf349('0xd')](_0x4c6f4c,_0x23fb4b)[_0xf349('0xe')](function(_0x3e2147){logger['info']('Automation,\x20%s,\x20%s',_0x1bd44a,_0xf349('0xf'));logger[_0xf349('0x10')](_0xf349('0x11'),_0x1bd44a,_0xf349('0xf'),JSON[_0xf349('0x12')](_0x3e2147));if(_0x3e2147['error']){if(_0x3e2147['error']['code']===0x1f4){logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x3e2147[_0xf349('0x13')][_0xf349('0x15')]);return _0x21a480(_0x3e2147[_0xf349('0x13')]['message']);}logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x3e2147['error'][_0xf349('0x15')]);return _0x6c6cd2(_0x3e2147[_0xf349('0x13')]['message']);}else{logger[_0xf349('0x16')]('Automation,\x20%s,\x20%s',_0x1bd44a,_0xf349('0xf'));_0x6c6cd2(_0x3e2147[_0xf349('0x17')][_0xf349('0x15')]);}})[_0xf349('0x18')](function(_0x14c06d){logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x14c06d);_0x21a480(_0x14c06d);});});} \ No newline at end of file +var _0x80cd=['client','http','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5e802e,_0x8d0759){var _0x50ffa4=function(_0x29f35b){while(--_0x29f35b){_0x5e802e['push'](_0x5e802e['shift']());}};_0x50ffa4(++_0x8d0759);}(_0x80cd,0x146));var _0xd80c=function(_0x4c184d,_0x4278ab){_0x4c184d=_0x4c184d-0x0;var _0x23d997=_0x80cd[_0x4c184d];return _0x23d997;};'use strict';var _=require('lodash');var util=require(_0xd80c('0x0'));var moment=require(_0xd80c('0x1'));var BPromise=require(_0xd80c('0x2'));var rs=require(_0xd80c('0x3'));var fs=require('fs');var Redis=require(_0xd80c('0x4'));var db=require(_0xd80c('0x5'))['db'];var utils=require(_0xd80c('0x6'));var logger=require(_0xd80c('0x7'))('rpc');var config=require(_0xd80c('0x8'));var jayson=require(_0xd80c('0x9'));var client=jayson[_0xd80c('0xa')][_0xd80c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x508e19,_0x343595,_0x20cd74){return new BPromise(function(_0x2dc89b,_0x3aa004){return client['request'](_0x508e19,_0x20cd74)[_0xd80c('0xc')](function(_0x588160){logger['info'](_0xd80c('0xd'),_0x343595,'request\x20sent');logger[_0xd80c('0xe')](_0xd80c('0xf'),_0x343595,_0xd80c('0x10'),JSON[_0xd80c('0x11')](_0x588160));if(_0x588160[_0xd80c('0x12')]){if(_0x588160[_0xd80c('0x12')][_0xd80c('0x13')]===0x1f4){logger['error'](_0xd80c('0xd'),_0x343595,_0x588160[_0xd80c('0x12')][_0xd80c('0x14')]);return _0x3aa004(_0x588160[_0xd80c('0x12')][_0xd80c('0x14')]);}logger[_0xd80c('0x12')](_0xd80c('0xd'),_0x343595,_0x588160[_0xd80c('0x12')][_0xd80c('0x14')]);return _0x2dc89b(_0x588160['error'][_0xd80c('0x14')]);}else{logger[_0xd80c('0x15')](_0xd80c('0xd'),_0x343595,_0xd80c('0x10'));_0x2dc89b(_0x588160[_0xd80c('0x16')]['message']);}})[_0xd80c('0x17')](function(_0xec332d){logger[_0xd80c('0x12')](_0xd80c('0xd'),_0x343595,_0xec332d);_0x3aa004(_0xec332d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index bdd940f..80e28a7 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 _0x535f=['/:id/actions','getActions','post','create','addActions','update','delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions'];(function(_0x2bcc09,_0x3c806e){var _0x15e884=function(_0x56b31b){while(--_0x56b31b){_0x2bcc09['push'](_0x2bcc09['shift']());}};_0x15e884(++_0x3c806e);}(_0x535f,0x160));var _0xf535=function(_0x191b48,_0x402e4e){_0x191b48=_0x191b48-0x0;var _0x2aff3c=_0x535f[_0x191b48];return _0x2aff3c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf535('0x0'));var timeout=require(_0xf535('0x1'));var express=require(_0xf535('0x2'));var router=express[_0xf535('0x3')]();var fs_extra=require(_0xf535('0x4'));var auth=require(_0xf535('0x5'));var interaction=require(_0xf535('0x6'));var config=require(_0xf535('0x7'));var controller=require(_0xf535('0x8'));router['get']('/',auth[_0xf535('0x9')](),controller[_0xf535('0xa')]);router[_0xf535('0xb')](_0xf535('0xc'),auth[_0xf535('0x9')](),controller[_0xf535('0xd')]);router[_0xf535('0xb')](_0xf535('0xe'),auth[_0xf535('0x9')](),controller[_0xf535('0xf')]);router[_0xf535('0xb')](_0xf535('0x10'),auth[_0xf535('0x9')](),controller[_0xf535('0x11')]);router[_0xf535('0x12')]('/',auth['isAuthenticated'](),controller[_0xf535('0x13')]);router[_0xf535('0x12')](_0xf535('0xe'),auth['isAuthenticated'](),controller['addConditions']);router['post']('/:id/actions',auth[_0xf535('0x9')](),controller[_0xf535('0x14')]);router['put'](_0xf535('0xc'),auth[_0xf535('0x9')](),controller[_0xf535('0x15')]);router[_0xf535('0x16')](_0xf535('0xc'),auth[_0xf535('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7aa2=['getActions','create','post','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','/:id/actions'];(function(_0x2a829f,_0x1b0c15){var _0x5737c3=function(_0x2376f9){while(--_0x2376f9){_0x2a829f['push'](_0x2a829f['shift']());}};_0x5737c3(++_0x1b0c15);}(_0x7aa2,0x132));var _0x27aa=function(_0x1eb82d,_0x1e23cb){_0x1eb82d=_0x1eb82d-0x0;var _0x2c9502=_0x7aa2[_0x1eb82d];return _0x2c9502;};'use strict';var multer=require(_0x27aa('0x0'));var util=require(_0x27aa('0x1'));var path=require(_0x27aa('0x2'));var timeout=require(_0x27aa('0x3'));var express=require(_0x27aa('0x4'));var router=express[_0x27aa('0x5')]();var fs_extra=require(_0x27aa('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x27aa('0x7'));var config=require(_0x27aa('0x8'));var controller=require(_0x27aa('0x9'));router['get']('/',auth[_0x27aa('0xa')](),controller[_0x27aa('0xb')]);router[_0x27aa('0xc')](_0x27aa('0xd'),auth[_0x27aa('0xa')](),controller[_0x27aa('0xe')]);router['get'](_0x27aa('0xf'),auth[_0x27aa('0xa')](),controller[_0x27aa('0x10')]);router[_0x27aa('0xc')](_0x27aa('0x11'),auth[_0x27aa('0xa')](),controller[_0x27aa('0x12')]);router['post']('/',auth[_0x27aa('0xa')](),controller[_0x27aa('0x13')]);router['post'](_0x27aa('0xf'),auth[_0x27aa('0xa')](),controller['addConditions']);router[_0x27aa('0x14')](_0x27aa('0x11'),auth[_0x27aa('0xa')](),controller[_0x27aa('0x15')]);router[_0x27aa('0x16')](_0x27aa('0xd'),auth[_0x27aa('0xa')](),controller[_0x27aa('0x17')]);router[_0x27aa('0x18')](_0x27aa('0xd'),auth[_0x27aa('0xa')](),controller[_0x27aa('0x19')]);module[_0x27aa('0x1a')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 85df609..234495d 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 _0xd71a=['UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','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)','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)','sequelize','STRING','name','ENUM','ivr','BOOLEAN'];(function(_0xe2b79a,_0x261908){var _0x528c94=function(_0x7ea447){while(--_0x7ea447){_0xe2b79a['push'](_0xe2b79a['shift']());}};_0x528c94(++_0x261908);}(_0xd71a,0x1f2));var _0xad71=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd71a[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xad71('0x0'));module['exports']={'name':{'type':Sequelize[_0xad71('0x1')],'unique':_0xad71('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xad71('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xad71('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xad71('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xad71('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xad71('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xad71('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xad71('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad71('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0xad71('0x8')](0x3)[_0xad71('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad71('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xad71('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad71('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xad71('0x8')](0x3)[_0xad71('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad71('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xad71('0x8')](0x5)[_0xad71('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad71('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xad71('0x8')](0x3)[_0xad71('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xad71('0x8')](0x5)[_0xad71('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad71('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xad71('0x8')](0x3)[_0xad71('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xad71('0x1')],'defaultValue':_0xad71('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xad71('0xf'),_0xad71('0x10'),_0xad71('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xad71('0x5')],'defaultValue':0x0,'comment':_0xad71('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xad71('0x8')](0x9)[_0xad71('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xad71('0x8')](0x9)[_0xad71('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xad71('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xad71('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xad71('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xad71('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xad71('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xad71('0x8')](0x9)[_0xad71('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xad71('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xad71('0x8')](0x9)[_0xad71('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xad71('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xad71('0x8')](0x9)[_0xad71('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xad71('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xad71('0x8')](0x5)[_0xad71('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xad71('0x8')](0x9)[_0xad71('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xad71('0x3')](_0xad71('0x19'),'ASC'),'defaultValue':_0xad71('0x19')},'dialPrefix':{'type':Sequelize[_0xad71('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xad71('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xad71('0x1a')},'dialCutDigit':{'type':Sequelize[_0xad71('0x8')](0x3)[_0xad71('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xad71('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xad71('0x8')](0x3)[_0xad71('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad71('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xad71('0x8')](0x5)[_0xad71('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xad71('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad71('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0xad71('0x8')](0x5)[_0xad71('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad71('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xad71('0x8')](0x3)[_0xad71('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad71('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad71('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0xad71('0x8')](0x3)[_0xad71('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad71('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0xad71('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad71('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xad71('0x8')](0x3)[_0xad71('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad71('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xad71('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0xf8a9=['Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ENUM','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x13b948,_0x2a5a86){var _0x2f0044=function(_0xc63313){while(--_0xc63313){_0x13b948['push'](_0x13b948['shift']());}};_0x2f0044(++_0x2a5a86);}(_0xf8a9,0xb1));var _0x9f8a=function(_0x588989,_0x1eda3e){_0x588989=_0x588989-0x0;var _0x351d0f=_0xf8a9[_0x588989];return _0x351d0f;};'use strict';var Sequelize=require(_0x9f8a('0x0'));module[_0x9f8a('0x1')]={'name':{'type':Sequelize[_0x9f8a('0x2')],'unique':_0x9f8a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x9f8a('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x9f8a('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x9f8a('0x5')](0x4)[_0x9f8a('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x9f8a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9f8a('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x9f8a('0x5')](0x3)[_0x9f8a('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9f8a('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9f8a('0x5')](0x3)[_0x9f8a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9f8a('0x5')](0x5)[_0x9f8a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9f8a('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0x9f8a('0x5')](0x3)[_0x9f8a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9f8a('0x9')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9f8a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9f8a('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9f8a('0x5')](0x3)[_0x9f8a('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9f8a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9f8a('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9f8a('0x5')](0x3)[_0x9f8a('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9f8a('0xc')},'dialTimezone':{'type':Sequelize[_0x9f8a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9f8a('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x9f8a('0xd'),_0x9f8a('0xe'),_0x9f8a('0xf')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9f8a('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0x9f8a('0x5')](0x9)[_0x9f8a('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x9f8a('0x5')](0x9)[_0x9f8a('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9f8a('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9f8a('0x5')](0x9)[_0x9f8a('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9f8a('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9f8a('0x5')](0x9)[_0x9f8a('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9f8a('0x12')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9f8a('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9f8a('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9f8a('0x5')](0x9)[_0x9f8a('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9f8a('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9f8a('0x5')](0x5)[_0x9f8a('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9f8a('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x9f8a('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9f8a('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9f8a('0x17')]('DESC',_0x9f8a('0x18')),'defaultValue':_0x9f8a('0x19')},'dialPrefix':{'type':Sequelize[_0x9f8a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9f8a('0x1a')},'dialCutDigit':{'type':Sequelize[_0x9f8a('0x5')](0x3)[_0x9f8a('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9f8a('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9f8a('0x5')](0x3)[_0x9f8a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9f8a('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9f8a('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9f8a('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x9f8a('0x5')](0x3)[_0x9f8a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9f8a('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9f8a('0x5')](0x3)[_0x9f8a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9f8a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9f8a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x9f8a('0x5')](0x5)[_0x9f8a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9f8a('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9f8a('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9f8a('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9f8a('0x5')](0x5)[_0x9f8a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9f8a('0x21')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 06a42d3..a1e2df2 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 _0x92a2=['createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CmHopper','order','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','select','field','NOW()','ContactId','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','cm_hopper_additional_phones','cmHopperId','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','update','then','destroy','get','IvrCampaigns','error','stack','name','send','Campaign','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','updatedAt'];(function(_0x2bdaa7,_0x520df7){var _0x331059=function(_0x1a0cd9){while(--_0x1a0cd9){_0x2bdaa7['push'](_0x2bdaa7['shift']());}};_0x331059(++_0x520df7);}(_0x92a2,0x1ee));var _0x292a=function(_0x9ef017,_0x41e0da){_0x9ef017=_0x9ef017-0x0;var _0x1d9b28=_0x92a2[_0x9ef017];return _0x1d9b28;};'use strict';var emlformat=require(_0x292a('0x0'));var rimraf=require(_0x292a('0x1'));var zipdir=require(_0x292a('0x2'));var jsonpatch=require(_0x292a('0x3'));var rp=require('request-promise');var moment=require(_0x292a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x292a('0x5'));var util=require(_0x292a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x292a('0x7'));var ejs=require(_0x292a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x292a('0x9'));var squel=require(_0x292a('0xa'));var crypto=require(_0x292a('0xb'));var jsforce=require(_0x292a('0xc'));var deskjs=require(_0x292a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x292a('0xe'));var Papa=require(_0x292a('0xf'));var Redis=require('ioredis');var authService=require(_0x292a('0x10'));var qs=require(_0x292a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x292a('0x12'));var logger=require('../../config/logger')(_0x292a('0x13'));var utils=require(_0x292a('0x14'));var config=require(_0x292a('0x15'));var licenseUtil=require(_0x292a('0x16'));var db=require(_0x292a('0x17'))['db'];function respondWithStatusCode(_0x466e2f,_0x3b659e){_0x3b659e=_0x3b659e||0xcc;return function(_0x54260f){if(_0x54260f){return _0x466e2f[_0x292a('0x18')](_0x3b659e);}return _0x466e2f[_0x292a('0x19')](_0x3b659e)[_0x292a('0x1a')]();};}function respondWithResult(_0x36d4e2,_0x179b2f){_0x179b2f=_0x179b2f||0xc8;return function(_0x21f30e){if(_0x21f30e){return _0x36d4e2['status'](_0x179b2f)[_0x292a('0x1b')](_0x21f30e);}};}function respondWithFilteredResult(_0x50b686,_0x2f389e){return function(_0x48963a){if(_0x48963a){var _0x16dfcf=typeof _0x2f389e['offset']==='undefined'&&typeof _0x2f389e[_0x292a('0x1c')]===_0x292a('0x1d');var _0x96610c=_0x48963a[_0x292a('0x1e')];var _0x63dfaf=_0x16dfcf?0x0:_0x2f389e[_0x292a('0x1f')];var _0x5d3e78=_0x16dfcf?_0x48963a[_0x292a('0x1e')]:_0x2f389e['offset']+_0x2f389e[_0x292a('0x1c')];var _0x2e8e65;if(_0x5d3e78>=_0x96610c){_0x5d3e78=_0x96610c;_0x2e8e65=0xc8;}else{_0x2e8e65=0xce;}_0x50b686[_0x292a('0x19')](_0x2e8e65);return _0x50b686[_0x292a('0x20')](_0x292a('0x21'),_0x63dfaf+'-'+_0x5d3e78+'/'+_0x96610c)[_0x292a('0x1b')](_0x48963a);}return null;};}function patchUpdates(_0x77573a){return function(_0x5f032b){try{jsonpatch['apply'](_0x5f032b,_0x77573a,!![]);}catch(_0x54c737){return BPromise['reject'](_0x54c737);}return _0x5f032b[_0x292a('0x22')]();};}function saveUpdates(_0x18a69e,_0x15bd27){return function(_0x37ad92){if(_0x37ad92){return _0x37ad92[_0x292a('0x23')](_0x18a69e)[_0x292a('0x24')](function(_0x1beb78){return _0x1beb78;});}return null;};}function removeEntity(_0x5e4dd1,_0x5184aa){return function(_0x3db23e){if(_0x3db23e){return _0x3db23e[_0x292a('0x25')]()[_0x292a('0x24')](function(){var _0x559582=_0x3db23e[_0x292a('0x26')]({'plain':!![]});var _0x2cb7fc=_0x292a('0x27');return db['UserProfileResource'][_0x292a('0x25')]({'where':{'type':_0x2cb7fc,'resourceId':_0x559582['id']}})['then'](function(){return _0x3db23e;});})[_0x292a('0x24')](function(){_0x5e4dd1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c2f06,_0x109334){return function(_0x4f0fc0){if(!_0x4f0fc0){_0x2c2f06['sendStatus'](0x194);}return _0x4f0fc0;};}function handleError(_0x2274d4,_0x2142d6){_0x2142d6=_0x2142d6||0x1f4;return function(_0x5887b6){logger[_0x292a('0x28')](_0x5887b6[_0x292a('0x29')]);if(_0x5887b6[_0x292a('0x2a')]){delete _0x5887b6['name'];}_0x2274d4[_0x292a('0x19')](_0x2142d6)[_0x292a('0x2b')](_0x5887b6);};}exports['index']=function(_0x103622,_0x421f5c){var _0x3f5052={},_0x5624b3={},_0x49f13c={'count':0x0,'rows':[]};var _0x95950c=_['map'](db[_0x292a('0x2c')]['rawAttributes'],function(_0x353cb8){return{'name':_0x353cb8[_0x292a('0x2d')],'type':_0x353cb8[_0x292a('0x2e')][_0x292a('0x2f')]};});_0x5624b3[_0x292a('0x30')]=_[_0x292a('0x31')](_0x95950c,_0x292a('0x2a'));_0x5624b3[_0x292a('0x32')]=_[_0x292a('0x33')](_0x103622[_0x292a('0x32')]);_0x5624b3[_0x292a('0x34')]=_[_0x292a('0x35')](_0x5624b3[_0x292a('0x30')],_0x5624b3[_0x292a('0x32')]);_0x3f5052[_0x292a('0x36')]=_[_0x292a('0x35')](_0x5624b3[_0x292a('0x30')],qs[_0x292a('0x37')](_0x103622[_0x292a('0x32')][_0x292a('0x37')]));_0x3f5052[_0x292a('0x36')]=_0x3f5052['attributes'][_0x292a('0x38')]?_0x3f5052['attributes']:_0x5624b3[_0x292a('0x30')];if(!_0x103622[_0x292a('0x32')][_0x292a('0x39')](_0x292a('0x3a'))){_0x3f5052[_0x292a('0x1c')]=qs[_0x292a('0x1c')](_0x103622['query'][_0x292a('0x1c')]);_0x3f5052[_0x292a('0x1f')]=qs[_0x292a('0x1f')](_0x103622[_0x292a('0x32')][_0x292a('0x1f')]);}_0x3f5052['order']=qs[_0x292a('0x3b')](_0x103622[_0x292a('0x32')][_0x292a('0x3b')]);_0x3f5052[_0x292a('0x3c')]=qs[_0x292a('0x34')](_[_0x292a('0x3d')](_0x103622[_0x292a('0x32')],_0x5624b3[_0x292a('0x34')]),_0x95950c);if(_0x103622['query']['filter']){_0x3f5052['where']=_[_0x292a('0x3e')](_0x3f5052[_0x292a('0x3c')],{'$or':_[_0x292a('0x31')](_0x95950c,function(_0x346f3e){if(_0x346f3e[_0x292a('0x2e')]!==_0x292a('0x3f')){var _0x215a7a={};_0x215a7a[_0x346f3e[_0x292a('0x2a')]]={'$like':'%'+_0x103622['query'][_0x292a('0x40')]+'%'};return _0x215a7a;}})});}_0x3f5052=_['merge']({},_0x3f5052,_0x103622[_0x292a('0x41')]);var _0x5b207d={'where':_0x3f5052[_0x292a('0x3c')]};return db[_0x292a('0x2c')]['count'](_0x5b207d)[_0x292a('0x24')](function(_0x30a4a5){_0x49f13c['count']=_0x30a4a5;if(_0x103622['query'][_0x292a('0x42')]){_0x3f5052[_0x292a('0x43')]=[{'all':!![]}];}return db[_0x292a('0x2c')][_0x292a('0x44')](_0x3f5052);})[_0x292a('0x24')](function(_0x2b5e9d){_0x49f13c[_0x292a('0x45')]=_0x2b5e9d;return _0x49f13c;})[_0x292a('0x24')](respondWithFilteredResult(_0x421f5c,_0x3f5052))[_0x292a('0x46')](handleError(_0x421f5c,null));};exports[_0x292a('0x47')]=function(_0x17ee9b,_0x21f191){var _0x57e503={'raw':![],'where':{'id':_0x17ee9b['params']['id']}},_0x168d31={};_0x168d31[_0x292a('0x30')]=_[_0x292a('0x33')](db[_0x292a('0x2c')][_0x292a('0x48')]);_0x168d31[_0x292a('0x32')]=_[_0x292a('0x33')](_0x17ee9b[_0x292a('0x32')]);_0x168d31[_0x292a('0x34')]=_[_0x292a('0x35')](_0x168d31[_0x292a('0x30')],_0x168d31[_0x292a('0x32')]);_0x57e503[_0x292a('0x36')]=_[_0x292a('0x35')](_0x168d31['model'],qs['fields'](_0x17ee9b[_0x292a('0x32')][_0x292a('0x37')]));_0x57e503[_0x292a('0x36')]=_0x57e503[_0x292a('0x36')][_0x292a('0x38')]?_0x57e503[_0x292a('0x36')]:_0x168d31['model'];if(_0x17ee9b[_0x292a('0x32')][_0x292a('0x42')]){_0x57e503[_0x292a('0x43')]=[{'all':!![]}];}_0x57e503=_[_0x292a('0x3e')]({},_0x57e503,_0x17ee9b['options']);return db[_0x292a('0x2c')][_0x292a('0x49')](_0x57e503)[_0x292a('0x24')](handleEntityNotFound(_0x21f191,null))[_0x292a('0x24')](respondWithResult(_0x21f191,null))['catch'](handleError(_0x21f191,null));};exports[_0x292a('0x4a')]=function(_0xe23f3b,_0x2eb0dc){return db['Campaign'][_0x292a('0x4a')](_0xe23f3b[_0x292a('0x4b')],{})[_0x292a('0x24')](function(_0x342eaa){var _0x11c74e=_0xe23f3b[_0x292a('0x4c')]['get']({'plain':!![]});if(!_0x11c74e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11c74e[_0x292a('0x4d')]===_0x292a('0x4c')){var _0x44939c=_0x342eaa[_0x292a('0x26')]({'plain':!![]});var _0x272890=_0x292a('0x27');return db[_0x292a('0x4e')][_0x292a('0x49')]({'where':{'name':_0x272890,'userProfileId':_0x11c74e[_0x292a('0x4f')]},'raw':!![]})[_0x292a('0x24')](function(_0x4c72b7){if(_0x4c72b7&&_0x4c72b7[_0x292a('0x50')]===0x0){return db[_0x292a('0x51')][_0x292a('0x4a')]({'name':_0x44939c[_0x292a('0x2a')],'resourceId':_0x44939c['id'],'type':_0x4c72b7[_0x292a('0x2a')],'sectionId':_0x4c72b7['id']},{})[_0x292a('0x24')](function(){return _0x342eaa;});}else{return _0x342eaa;}})[_0x292a('0x46')](function(_0x3bbce0){logger[_0x292a('0x28')](_0x292a('0x52'),_0x3bbce0);throw _0x3bbce0;});}return _0x342eaa;})[_0x292a('0x24')](respondWithResult(_0x2eb0dc,0xc9))['catch'](handleError(_0x2eb0dc,null));};exports['clone']=function(_0x4df4de,_0x26101b){var _0x26ba56={'where':{'id':_0x4df4de[_0x292a('0x53')]['id']}},_0x592b72={};_0x592b72[_0x292a('0x30')]=_[_0x292a('0x33')](db[_0x292a('0x2c')]['rawAttributes']);_0x26ba56[_0x292a('0x36')]=_[_0x292a('0x35')](_0x592b72[_0x292a('0x30')],qs[_0x292a('0x37')](_0x4df4de[_0x292a('0x32')][_0x292a('0x37')]));_0x26ba56['attributes']=_0x26ba56[_0x292a('0x36')][_0x292a('0x38')]?_0x26ba56[_0x292a('0x36')]:_0x592b72[_0x292a('0x30')];if(_0x4df4de[_0x292a('0x32')]['includeAll']){_0x26ba56[_0x292a('0x43')]=[{'all':!![]}];}_0x26ba56=_[_0x292a('0x3e')]({},_0x26ba56,_0x4df4de[_0x292a('0x41')]);return db[_0x292a('0x2c')][_0x292a('0x49')](_0x26ba56)[_0x292a('0x24')](handleEntityNotFound(_0x26101b,null))['then'](function(_0x2cfc30){if(_0x2cfc30){var _0xa3a3a2=_0x2cfc30['get']({'plain':!![]});_0xa3a3a2=qs[_0x292a('0x54')](_0xa3a3a2,['id','createdAt',_0x292a('0x55')]);_0x4df4de['body']=_[_0x292a('0x54')](_0x4df4de[_0x292a('0x4b')],['id',_0x292a('0x56'),'updatedAt']);return db['Campaign'][_0x292a('0x4a')](_[_0x292a('0x3e')](_0xa3a3a2,_0x4df4de[_0x292a('0x4b')]),{'include':_0x4df4de[_0x292a('0x32')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x6daff2){var _0x2f9bad=_0x4df4de[_0x292a('0x4c')][_0x292a('0x26')]({'plain':!![]});if(!_0x2f9bad)throw new Error(_0x292a('0x57'));if(_0x2f9bad[_0x292a('0x4d')]===_0x292a('0x4c')){var _0x3d9529=_0x6daff2[_0x292a('0x26')]({'plain':!![]});var _0x303067=_0x292a('0x27');return db[_0x292a('0x4e')]['find']({'where':{'name':_0x303067,'userProfileId':_0x2f9bad[_0x292a('0x4f')]},'raw':!![]})[_0x292a('0x24')](function(_0x3d4c1b){if(_0x3d4c1b&&_0x3d4c1b['autoAssociation']===0x0){return db[_0x292a('0x51')]['create']({'name':_0x3d9529[_0x292a('0x2a')],'resourceId':_0x3d9529['id'],'type':_0x3d4c1b['name'],'sectionId':_0x3d4c1b['id']},{})[_0x292a('0x24')](function(){return _0x6daff2;});}else{return _0x6daff2;}})[_0x292a('0x46')](function(_0x7c581b){logger['error'](_0x292a('0x52'),_0x7c581b);throw _0x7c581b;});}return _0x6daff2;});}})[_0x292a('0x24')](respondWithResult(_0x26101b,0xc9))[_0x292a('0x46')](handleError(_0x26101b,null));};exports[_0x292a('0x23')]=function(_0x4c23cd,_0x388068){if(_0x4c23cd[_0x292a('0x4b')]['id']){delete _0x4c23cd[_0x292a('0x4b')]['id'];}return db[_0x292a('0x2c')]['find']({'where':{'id':_0x4c23cd['params']['id']}})[_0x292a('0x24')](handleEntityNotFound(_0x388068,null))['then'](saveUpdates(_0x4c23cd[_0x292a('0x4b')],null))[_0x292a('0x24')](respondWithResult(_0x388068,null))[_0x292a('0x46')](handleError(_0x388068,null));};exports[_0x292a('0x25')]=function(_0x22b56c,_0x303517){return db[_0x292a('0x2c')]['find']({'where':{'id':_0x22b56c['params']['id']}})[_0x292a('0x24')](handleEntityNotFound(_0x303517,null))[_0x292a('0x24')](removeEntity(_0x303517,null))[_0x292a('0x46')](handleError(_0x303517,null));};exports[_0x292a('0x58')]=function(_0x21d89e,_0x3f8fc8,_0x41be31){var _0x464e59={'raw':!![],'where':{}};var _0x17c744={};var _0x50801a={'count':0x0,'rows':[]};return db[_0x292a('0x2c')][_0x292a('0x59')]({'where':{'id':_0x21d89e[_0x292a('0x53')]['id']}})[_0x292a('0x24')](handleEntityNotFound(_0x3f8fc8,null))[_0x292a('0x24')](function(_0x443ae4){if(_0x443ae4){_0x17c744['model']=_['keys'](db[_0x292a('0x5a')]['rawAttributes']);_0x17c744[_0x292a('0x32')]=_['keys'](_0x21d89e['query']);_0x17c744['filters']=_[_0x292a('0x35')](_0x17c744[_0x292a('0x30')],_0x17c744['query']);_0x464e59[_0x292a('0x36')]=_[_0x292a('0x35')](_0x17c744[_0x292a('0x30')],qs['fields'](_0x21d89e[_0x292a('0x32')][_0x292a('0x37')]));_0x464e59[_0x292a('0x36')]=_0x464e59[_0x292a('0x36')][_0x292a('0x38')]?_0x464e59['attributes']:_0x17c744['model'];if(!_0x21d89e['query'][_0x292a('0x39')](_0x292a('0x3a'))){_0x464e59[_0x292a('0x1c')]=qs['limit'](_0x21d89e['query'][_0x292a('0x1c')]);_0x464e59['offset']=qs[_0x292a('0x1f')](_0x21d89e['query'][_0x292a('0x1f')]);}_0x464e59[_0x292a('0x5b')]=qs[_0x292a('0x3b')](_0x21d89e['query']['sort']);_0x464e59['where']=qs['filters'](_[_0x292a('0x3d')](_0x21d89e['query'],_0x17c744['filters']));_0x464e59[_0x292a('0x3c')]['CampaignId']=_0x443ae4['id'];if(_0x21d89e['query']['filter']){_0x464e59[_0x292a('0x3c')]=_[_0x292a('0x3e')](_0x464e59['where'],{'$or':_[_0x292a('0x31')](_0x464e59[_0x292a('0x36')],function(_0x43e4d1){var _0x2afad9={};_0x2afad9[_0x43e4d1]={'$like':'%'+_0x21d89e['query'][_0x292a('0x40')]+'%'};return _0x2afad9;})});}_0x464e59=_[_0x292a('0x3e')]({},_0x464e59,_0x21d89e['options']);return db[_0x292a('0x5a')][_0x292a('0x1e')]({'where':_0x464e59[_0x292a('0x3c')]})[_0x292a('0x24')](function(_0x42c38f){_0x50801a[_0x292a('0x1e')]=_0x42c38f;if(_0x21d89e['query']['includeAll']){_0x464e59[_0x292a('0x43')]=[{'all':!![]}];}return db[_0x292a('0x5a')]['findAll'](_0x464e59);})[_0x292a('0x24')](function(_0x540b0c){_0x50801a[_0x292a('0x45')]=_0x540b0c;return _0x50801a;});}})['then'](respondWithFilteredResult(_0x3f8fc8,_0x464e59))[_0x292a('0x46')](handleError(_0x3f8fc8,null));};exports[_0x292a('0x5c')]=function(_0x2b6554,_0x3aa3bb,_0x283446){var _0x17436e={'raw':!![],'where':{}};var _0x58c295={};var _0x2768a8={'count':0x0,'rows':[]};return db['Campaign'][_0x292a('0x59')]({'where':{'id':_0x2b6554[_0x292a('0x53')]['id']}})[_0x292a('0x24')](handleEntityNotFound(_0x3aa3bb,null))['then'](function(_0x3384a6){if(_0x3384a6){_0x58c295['model']=_[_0x292a('0x33')](db[_0x292a('0x5d')][_0x292a('0x48')]);_0x58c295['query']=_['keys'](_0x2b6554[_0x292a('0x32')]);_0x58c295[_0x292a('0x34')]=_[_0x292a('0x35')](_0x58c295[_0x292a('0x30')],_0x58c295[_0x292a('0x32')]);_0x17436e[_0x292a('0x36')]=_[_0x292a('0x35')](_0x58c295[_0x292a('0x30')],qs[_0x292a('0x37')](_0x2b6554[_0x292a('0x32')]['fields']));_0x17436e[_0x292a('0x36')]=_0x17436e[_0x292a('0x36')][_0x292a('0x38')]?_0x17436e[_0x292a('0x36')]:_0x58c295[_0x292a('0x30')];if(!_0x2b6554[_0x292a('0x32')][_0x292a('0x39')]('nolimit')){_0x17436e[_0x292a('0x1c')]=qs[_0x292a('0x1c')](_0x2b6554[_0x292a('0x32')][_0x292a('0x1c')]);_0x17436e[_0x292a('0x1f')]=qs[_0x292a('0x1f')](_0x2b6554[_0x292a('0x32')][_0x292a('0x1f')]);}_0x17436e[_0x292a('0x5b')]=qs[_0x292a('0x3b')](_0x2b6554[_0x292a('0x32')][_0x292a('0x3b')]);_0x17436e[_0x292a('0x3c')]=qs['filters'](_[_0x292a('0x3d')](_0x2b6554[_0x292a('0x32')],_0x58c295[_0x292a('0x34')]));_0x17436e[_0x292a('0x3c')][_0x292a('0x5e')]=_0x3384a6['id'];if(_0x2b6554[_0x292a('0x32')][_0x292a('0x40')]){_0x17436e[_0x292a('0x3c')]=_['merge'](_0x17436e['where'],{'$or':_[_0x292a('0x31')](_0x17436e[_0x292a('0x36')],function(_0x47d0d5){var _0x56a1e9={};_0x56a1e9[_0x47d0d5]={'$like':'%'+_0x2b6554[_0x292a('0x32')][_0x292a('0x40')]+'%'};return _0x56a1e9;})});}_0x17436e=_[_0x292a('0x3e')]({},_0x17436e,_0x2b6554['options']);return db[_0x292a('0x5d')]['count']({'where':_0x17436e[_0x292a('0x3c')]})['then'](function(_0x3308df){_0x2768a8[_0x292a('0x1e')]=_0x3308df;if(_0x2b6554[_0x292a('0x32')][_0x292a('0x42')]){_0x17436e[_0x292a('0x43')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x17436e);})[_0x292a('0x24')](function(_0x5bb3db){_0x2768a8[_0x292a('0x45')]=_0x5bb3db;return _0x2768a8;});}})['then'](respondWithFilteredResult(_0x3aa3bb,_0x17436e))[_0x292a('0x46')](handleError(_0x3aa3bb,null));};exports[_0x292a('0x5f')]=function(_0x2c8e00,_0x5b6489,_0x1babf7){var _0x30c6be={'raw':!![],'where':{}};var _0x494e82={};var _0x1aa590={'count':0x0,'rows':[]};return db[_0x292a('0x2c')][_0x292a('0x59')]({'where':{'id':_0x2c8e00['params']['id']}})['then'](handleEntityNotFound(_0x5b6489,null))[_0x292a('0x24')](function(_0x3a8d6a){if(_0x3a8d6a){_0x494e82['model']=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x494e82[_0x292a('0x32')]=_[_0x292a('0x33')](_0x2c8e00['query']);_0x494e82[_0x292a('0x34')]=_[_0x292a('0x35')](_0x494e82[_0x292a('0x30')],_0x494e82[_0x292a('0x32')]);_0x30c6be[_0x292a('0x36')]=_[_0x292a('0x35')](_0x494e82[_0x292a('0x30')],qs[_0x292a('0x37')](_0x2c8e00[_0x292a('0x32')][_0x292a('0x37')]));_0x30c6be[_0x292a('0x36')]=_0x30c6be[_0x292a('0x36')][_0x292a('0x38')]?_0x30c6be['attributes']:_0x494e82[_0x292a('0x30')];if(!_0x2c8e00[_0x292a('0x32')]['hasOwnProperty']('nolimit')){_0x30c6be['limit']=qs['limit'](_0x2c8e00[_0x292a('0x32')][_0x292a('0x1c')]);_0x30c6be[_0x292a('0x1f')]=qs['offset'](_0x2c8e00[_0x292a('0x32')]['offset']);}_0x30c6be[_0x292a('0x5b')]=qs[_0x292a('0x3b')](_0x2c8e00[_0x292a('0x32')][_0x292a('0x3b')]);_0x30c6be[_0x292a('0x3c')]=qs['filters'](_[_0x292a('0x3d')](_0x2c8e00[_0x292a('0x32')],_0x494e82[_0x292a('0x34')]));_0x30c6be[_0x292a('0x3c')][_0x292a('0x5e')]=_0x3a8d6a['id'];if(_0x2c8e00[_0x292a('0x32')][_0x292a('0x40')]){_0x30c6be[_0x292a('0x3c')]=_[_0x292a('0x3e')](_0x30c6be[_0x292a('0x3c')],{'$or':_[_0x292a('0x31')](_0x30c6be[_0x292a('0x36')],function(_0xd8661c){var _0x5cae25={};_0x5cae25[_0xd8661c]={'$like':'%'+_0x2c8e00['query'][_0x292a('0x40')]+'%'};return _0x5cae25;})});}_0x30c6be=_['merge']({},_0x30c6be,_0x2c8e00[_0x292a('0x41')]);return db[_0x292a('0x60')][_0x292a('0x1e')]({'where':_0x30c6be['where']})['then'](function(_0x100175){_0x1aa590[_0x292a('0x1e')]=_0x100175;if(_0x2c8e00['query']['includeAll']){_0x30c6be['include']=[{'all':!![]}];}return db[_0x292a('0x60')]['findAll'](_0x30c6be);})[_0x292a('0x24')](function(_0x5dd30b){_0x1aa590[_0x292a('0x45')]=_0x5dd30b;return _0x1aa590;});}})[_0x292a('0x24')](respondWithFilteredResult(_0x5b6489,_0x30c6be))[_0x292a('0x46')](handleError(_0x5b6489,null));};exports[_0x292a('0x61')]=function(_0x8bab67,_0x3b3549,_0x400393){var _0x5af114={'raw':!![],'where':{}};var _0x355e18={};var _0x2ace9f={'count':0x0,'rows':[]};return db[_0x292a('0x2c')][_0x292a('0x59')]({'where':{'id':_0x8bab67[_0x292a('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b3549,null))['then'](function(_0x957f6){if(_0x957f6){_0x355e18[_0x292a('0x30')]=_[_0x292a('0x33')](db[_0x292a('0x62')][_0x292a('0x48')]);_0x355e18[_0x292a('0x32')]=_[_0x292a('0x33')](_0x8bab67[_0x292a('0x32')]);_0x355e18[_0x292a('0x34')]=_[_0x292a('0x35')](_0x355e18['model'],_0x355e18['query']);_0x5af114[_0x292a('0x36')]=_['intersection'](_0x355e18[_0x292a('0x30')],qs[_0x292a('0x37')](_0x8bab67['query'][_0x292a('0x37')]));_0x5af114['attributes']=_0x5af114[_0x292a('0x36')][_0x292a('0x38')]?_0x5af114[_0x292a('0x36')]:_0x355e18[_0x292a('0x30')];if(!_0x8bab67[_0x292a('0x32')][_0x292a('0x39')](_0x292a('0x3a'))){_0x5af114[_0x292a('0x1c')]=qs[_0x292a('0x1c')](_0x8bab67[_0x292a('0x32')][_0x292a('0x1c')]);_0x5af114[_0x292a('0x1f')]=qs[_0x292a('0x1f')](_0x8bab67[_0x292a('0x32')][_0x292a('0x1f')]);}_0x5af114[_0x292a('0x5b')]=qs[_0x292a('0x3b')](_0x8bab67[_0x292a('0x32')][_0x292a('0x3b')]);_0x5af114['where']=qs[_0x292a('0x34')](_[_0x292a('0x3d')](_0x8bab67['query'],_0x355e18[_0x292a('0x34')]));_0x5af114[_0x292a('0x3c')][_0x292a('0x5e')]=_0x957f6['id'];if(_0x8bab67[_0x292a('0x32')][_0x292a('0x40')]){_0x5af114['where']=_[_0x292a('0x3e')](_0x5af114['where'],{'$or':_[_0x292a('0x31')](_0x5af114[_0x292a('0x36')],function(_0x1e3e54){var _0x5d4bfb={};_0x5d4bfb[_0x1e3e54]={'$like':'%'+_0x8bab67[_0x292a('0x32')][_0x292a('0x40')]+'%'};return _0x5d4bfb;})});}_0x5af114=_['merge']({},_0x5af114,_0x8bab67[_0x292a('0x41')]);return db[_0x292a('0x62')][_0x292a('0x1e')]({'where':_0x5af114[_0x292a('0x3c')]})[_0x292a('0x24')](function(_0xc33062){_0x2ace9f[_0x292a('0x1e')]=_0xc33062;if(_0x8bab67['query']['includeAll']){_0x5af114[_0x292a('0x43')]=[{'all':!![]}];}return db[_0x292a('0x62')]['findAll'](_0x5af114);})['then'](function(_0x3deb8d){_0x2ace9f[_0x292a('0x45')]=_0x3deb8d;return _0x2ace9f;});}})[_0x292a('0x24')](respondWithFilteredResult(_0x3b3549,_0x5af114))['catch'](handleError(_0x3b3549,null));};exports['getLists']=function(_0x526d6d,_0x1acfa6,_0x3a12f4){var _0x29a09f={};var _0x241108={};var _0x1f84fb;var _0x250b91;return db[_0x292a('0x2c')]['findOne']({'where':{'id':_0x526d6d[_0x292a('0x53')]['id']}})[_0x292a('0x24')](handleEntityNotFound(_0x1acfa6,null))[_0x292a('0x24')](function(_0x54fe43){if(_0x54fe43){_0x1f84fb=_0x54fe43;_0x241108[_0x292a('0x30')]=_[_0x292a('0x33')](db[_0x292a('0x63')]['rawAttributes']);_0x241108[_0x292a('0x32')]=_[_0x292a('0x33')](_0x526d6d['query']);_0x241108[_0x292a('0x34')]=_[_0x292a('0x35')](_0x241108[_0x292a('0x30')],_0x241108[_0x292a('0x32')]);_0x29a09f[_0x292a('0x36')]=_['intersection'](_0x241108[_0x292a('0x30')],qs[_0x292a('0x37')](_0x526d6d['query']['fields']));_0x29a09f[_0x292a('0x36')]=_0x29a09f['attributes'][_0x292a('0x38')]?_0x29a09f[_0x292a('0x36')]:_0x241108[_0x292a('0x30')];_0x29a09f[_0x292a('0x5b')]=qs['sort'](_0x526d6d[_0x292a('0x32')][_0x292a('0x3b')]);_0x29a09f[_0x292a('0x3c')]=qs[_0x292a('0x34')](_[_0x292a('0x3d')](_0x526d6d[_0x292a('0x32')],_0x241108[_0x292a('0x34')]));if(_0x526d6d[_0x292a('0x32')][_0x292a('0x40')]){_0x29a09f[_0x292a('0x3c')]=_[_0x292a('0x3e')](_0x29a09f[_0x292a('0x3c')],{'$or':_[_0x292a('0x31')](_0x29a09f[_0x292a('0x36')],function(_0x857ba8){var _0x2141e6={};_0x2141e6[_0x857ba8]={'$like':'%'+_0x526d6d[_0x292a('0x32')][_0x292a('0x40')]+'%'};return _0x2141e6;})});}_0x29a09f=_[_0x292a('0x3e')]({},_0x29a09f,_0x526d6d[_0x292a('0x41')]);return _0x1f84fb[_0x292a('0x64')](_0x29a09f);}})[_0x292a('0x24')](function(_0x4afd18){if(_0x4afd18){_0x250b91=_0x4afd18[_0x292a('0x38')];if(!_0x526d6d[_0x292a('0x32')][_0x292a('0x39')](_0x292a('0x3a'))){_0x29a09f[_0x292a('0x1c')]=qs[_0x292a('0x1c')](_0x526d6d[_0x292a('0x32')]['limit']);_0x29a09f[_0x292a('0x1f')]=qs['offset'](_0x526d6d[_0x292a('0x32')][_0x292a('0x1f')]);}return _0x1f84fb['getLists'](_0x29a09f);}})[_0x292a('0x24')](function(_0xa21a45){if(_0xa21a45){return _0xa21a45?{'count':_0x250b91,'rows':_0xa21a45}:null;}})[_0x292a('0x24')](respondWithResult(_0x1acfa6,null))[_0x292a('0x46')](handleError(_0x1acfa6,null));};exports['addLists']=function(_0x4d8baf,_0xd6ca45,_0x43fbd5){var _0x30e1c5,_0x3ccfbd;var _0x3c495a=[];var _0x583220=moment()[_0x292a('0x65')](_0x292a('0x66'));return db[_0x292a('0x2c')][_0x292a('0x49')]({'where':{'id':_0x4d8baf[_0x292a('0x53')]['id']}})['then'](handleEntityNotFound(_0xd6ca45,null))[_0x292a('0x24')](function(_0x1651e6){if(_0x1651e6){_0x3ccfbd=_0x1651e6;return _0x1651e6[_0x292a('0x67')](_0x4d8baf[_0x292a('0x4b')]['ids'],_['omit'](_0x4d8baf['body'],[_0x292a('0x68'),'id'])||{});}return null;})['spread'](function(_0x3dd845){var _0x21b3b3;var _0x9f1d24;_0x30e1c5=_0x3dd845||[];var _0x1aaea9=[];if(_0x3dd845){for(var _0x176088=0x0;_0x176088<_0x3dd845['length'];_0x176088+=0x1){var _0x393c00=_0x3dd845[_0x176088][_0x292a('0x26')]({'plain':!![]});_0x3ccfbd[_0x292a('0x69')]=_0x4d8baf['body']['dialCheckDuplicateType']?_0x4d8baf[_0x292a('0x4b')][_0x292a('0x69')]:_0x3ccfbd[_0x292a('0x69')];switch(_0x3ccfbd[_0x292a('0x69')]){case _0x292a('0x6a'):_0x21b3b3=squel['insert']()[_0x292a('0x6b')](_0x292a('0x6c'))[_0x292a('0x6d')]([_0x292a('0x6e'),_0x292a('0x6f'),'ContactId','ListId',_0x292a('0x5e'),_0x292a('0x56'),_0x292a('0x55')],squel[_0x292a('0x70')]()[_0x292a('0x71')](_0x292a('0x6e'),_0x292a('0x6e'))[_0x292a('0x71')](_0x292a('0x72'),'scheduledAt')[_0x292a('0x71')]('id',_0x292a('0x73'))['field'](_0x393c00[_0x292a('0x74')][_0x292a('0x75')](),_0x292a('0x76'))[_0x292a('0x71')](_0x4d8baf['params']['id']['toString'](),_0x292a('0x5e'))[_0x292a('0x71')]('\x27'+_0x583220+'\x27',_0x292a('0x56'))[_0x292a('0x71')]('\x27'+_0x583220+'\x27',_0x292a('0x55'))[_0x292a('0x77')](_0x292a('0x78'))['where'](_0x292a('0x79'))[_0x292a('0x3c')](_0x292a('0x7a'),_0x393c00[_0x292a('0x74')][_0x292a('0x75')]())[_0x292a('0x3c')](_0x292a('0x7b'))[_0x292a('0x3c')](_0x292a('0x7c'),squel['select']()[_0x292a('0x71')]('COALESCE(calleridnum,\x27\x27)')[_0x292a('0x77')](_0x292a('0x7d'))[_0x292a('0x3c')](_0x292a('0x7e'),_0x4d8baf[_0x292a('0x53')]['id'][_0x292a('0x75')]()))['where'](_0x292a('0x7c'),squel[_0x292a('0x70')]()[_0x292a('0x71')](_0x292a('0x7f'))[_0x292a('0x77')](_0x292a('0x6c'))[_0x292a('0x3c')](_0x292a('0x7e'),_0x4d8baf[_0x292a('0x53')]['id'][_0x292a('0x75')]())))['toString']();break;case'onlyIfOpen':_0x21b3b3=squel[_0x292a('0x80')]()[_0x292a('0x6b')](_0x292a('0x6c'))[_0x292a('0x6d')](['phone',_0x292a('0x6f'),_0x292a('0x73'),_0x292a('0x76'),'CampaignId',_0x292a('0x56'),_0x292a('0x55')],squel[_0x292a('0x70')]()[_0x292a('0x71')]('phone',_0x292a('0x6e'))['field'](_0x292a('0x72'),'scheduledAt')[_0x292a('0x71')]('id','ContactId')[_0x292a('0x71')](_0x393c00['CmListId'][_0x292a('0x75')](),_0x292a('0x76'))['field'](_0x4d8baf[_0x292a('0x53')]['id'][_0x292a('0x75')](),_0x292a('0x5e'))['field']('\x27'+_0x583220+'\x27',_0x292a('0x56'))['field']('\x27'+_0x583220+'\x27',_0x292a('0x55'))[_0x292a('0x77')](_0x292a('0x78'))['where'](_0x292a('0x79'))['where'](_0x292a('0x7a'),_0x393c00[_0x292a('0x74')][_0x292a('0x75')]())[_0x292a('0x3c')](_0x292a('0x7b'))[_0x292a('0x3c')](_0x292a('0x7c'),squel[_0x292a('0x70')]()[_0x292a('0x71')](_0x292a('0x7f'))[_0x292a('0x77')]('cm_hopper')[_0x292a('0x3c')](_0x292a('0x7e'),_0x4d8baf[_0x292a('0x53')]['id'][_0x292a('0x75')]())))[_0x292a('0x75')]();break;default:_0x21b3b3=squel['insert']()[_0x292a('0x6b')]('cm_hopper')[_0x292a('0x6d')]([_0x292a('0x6e'),_0x292a('0x6f'),_0x292a('0x73'),_0x292a('0x76'),_0x292a('0x5e'),_0x292a('0x56'),'updatedAt'],squel[_0x292a('0x70')]()[_0x292a('0x71')](_0x292a('0x6e'),_0x292a('0x6e'))[_0x292a('0x71')]('NOW()',_0x292a('0x6f'))[_0x292a('0x71')]('id',_0x292a('0x73'))['field'](_0x393c00[_0x292a('0x74')][_0x292a('0x75')](),_0x292a('0x76'))['field'](_0x4d8baf['params']['id'][_0x292a('0x75')](),_0x292a('0x5e'))[_0x292a('0x71')]('\x27'+_0x583220+'\x27',_0x292a('0x56'))[_0x292a('0x71')]('\x27'+_0x583220+'\x27',_0x292a('0x55'))[_0x292a('0x77')]('cm_contacts')[_0x292a('0x3c')](_0x292a('0x79'))[_0x292a('0x3c')](_0x292a('0x7a'),_0x393c00['CmListId'][_0x292a('0x75')]())[_0x292a('0x3c')](_0x292a('0x7b')))['toString']();}_0x9f1d24=squel[_0x292a('0x80')]()['into'](_0x292a('0x81'))[_0x292a('0x6d')]([_0x292a('0x82'),_0x292a('0x6f'),_0x292a('0x6e'),'OrderBy','createdAt','updatedAt'],squel[_0x292a('0x70')]()[_0x292a('0x71')]('h.id','id')[_0x292a('0x71')](_0x292a('0x72'),_0x292a('0x6f'))[_0x292a('0x71')](_0x292a('0x83'),_0x292a('0x6e'))[_0x292a('0x71')](_0x292a('0x84'),_0x292a('0x85'))[_0x292a('0x71')]('\x27'+_0x583220+'\x27',_0x292a('0x56'))[_0x292a('0x71')]('\x27'+_0x583220+'\x27',_0x292a('0x55'))['from'](_0x292a('0x86'),'ci')['join'](_0x292a('0x6c'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x292a('0x87'),_0x393c00[_0x292a('0x74')][_0x292a('0x75')]())[_0x292a('0x3c')]('h.CampaignId=?',_0x4d8baf['params']['id'][_0x292a('0x75')]())[_0x292a('0x3c')]('h.createdAt\x20=\x20?',_0x583220))[_0x292a('0x75')]();_0x1aaea9[_0x292a('0x88')](db[_0x292a('0x89')][_0x292a('0x32')](_0x21b3b3));_0x3c495a[_0x292a('0x88')](db[_0x292a('0x89')][_0x292a('0x32')](_0x9f1d24));}return BPromise[_0x292a('0x8a')](_0x1aaea9);}})[_0x292a('0x24')](function(){return BPromise[_0x292a('0x8a')](_0x3c495a);})[_0x292a('0x24')](function(){return _0x30e1c5;})['then'](respondWithResult(_0xd6ca45,null))[_0x292a('0x46')](handleError(_0xd6ca45,null));};exports[_0x292a('0x8b')]=function(_0x1780e2,_0x4d52aa,_0xa010a7){return db[_0x292a('0x2c')][_0x292a('0x49')]({'where':{'id':_0x1780e2[_0x292a('0x53')]['id']}})[_0x292a('0x24')](handleEntityNotFound(_0x4d52aa,null))[_0x292a('0x24')](function(_0x4e17d5){if(_0x4e17d5){return _0x4e17d5['removeLists'](_0x1780e2['query'][_0x292a('0x68')]);}})[_0x292a('0x24')](function(_0x55b1c7){if(_0x55b1c7){return db[_0x292a('0x5a')][_0x292a('0x25')]({'where':{'ListId':_0x1780e2['query'][_0x292a('0x68')],'CampaignId':_0x1780e2[_0x292a('0x53')]['id']}})['then'](function(){return _0x55b1c7;});}})[_0x292a('0x24')](respondWithStatusCode(_0x4d52aa,null))[_0x292a('0x46')](handleError(_0x4d52aa,null));};exports['getBlackLists']=function(_0x595780,_0x31c786,_0x19526c){var _0xc666={};var _0x51299f={};var _0x3c92ac;var _0x391973;return db[_0x292a('0x2c')][_0x292a('0x59')]({'where':{'id':_0x595780[_0x292a('0x53')]['id']}})[_0x292a('0x24')](handleEntityNotFound(_0x31c786,null))['then'](function(_0x502592){if(_0x502592){_0x3c92ac=_0x502592;_0x51299f[_0x292a('0x30')]=_[_0x292a('0x33')](db['CmList'][_0x292a('0x48')]);_0x51299f[_0x292a('0x32')]=_['keys'](_0x595780[_0x292a('0x32')]);_0x51299f[_0x292a('0x34')]=_[_0x292a('0x35')](_0x51299f[_0x292a('0x30')],_0x51299f[_0x292a('0x32')]);_0xc666['attributes']=_[_0x292a('0x35')](_0x51299f[_0x292a('0x30')],qs[_0x292a('0x37')](_0x595780[_0x292a('0x32')][_0x292a('0x37')]));_0xc666['attributes']=_0xc666['attributes'][_0x292a('0x38')]?_0xc666[_0x292a('0x36')]:_0x51299f[_0x292a('0x30')];_0xc666[_0x292a('0x5b')]=qs[_0x292a('0x3b')](_0x595780['query'][_0x292a('0x3b')]);_0xc666['where']=qs[_0x292a('0x34')](_[_0x292a('0x3d')](_0x595780[_0x292a('0x32')],_0x51299f[_0x292a('0x34')]));if(_0x595780['query'][_0x292a('0x40')]){_0xc666[_0x292a('0x3c')]=_[_0x292a('0x3e')](_0xc666[_0x292a('0x3c')],{'$or':_[_0x292a('0x31')](_0xc666[_0x292a('0x36')],function(_0x3ffb0a){var _0x5f20a9={};_0x5f20a9[_0x3ffb0a]={'$like':'%'+_0x595780[_0x292a('0x32')]['filter']+'%'};return _0x5f20a9;})});}_0xc666=_[_0x292a('0x3e')]({},_0xc666,_0x595780['options']);return _0x3c92ac[_0x292a('0x8c')](_0xc666);}})[_0x292a('0x24')](function(_0x134d4b){if(_0x134d4b){_0x391973=_0x134d4b[_0x292a('0x38')];if(!_0x595780[_0x292a('0x32')][_0x292a('0x39')]('nolimit')){_0xc666[_0x292a('0x1c')]=qs[_0x292a('0x1c')](_0x595780['query'][_0x292a('0x1c')]);_0xc666[_0x292a('0x1f')]=qs[_0x292a('0x1f')](_0x595780[_0x292a('0x32')][_0x292a('0x1f')]);}return _0x3c92ac[_0x292a('0x8c')](_0xc666);}})[_0x292a('0x24')](function(_0x170625){if(_0x170625){return _0x170625?{'count':_0x391973,'rows':_0x170625}:null;}})[_0x292a('0x24')](respondWithResult(_0x31c786,null))[_0x292a('0x46')](handleError(_0x31c786,null));};exports[_0x292a('0x8d')]=function(_0x563d0d,_0x5c0347,_0x1c0ca2){var _0x493a02,_0x1399ef;var _0x35602a=[];var _0x446442=moment()[_0x292a('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x292a('0x2c')][_0x292a('0x49')]({'where':{'id':_0x563d0d['params']['id']}})[_0x292a('0x24')](handleEntityNotFound(_0x5c0347,null))[_0x292a('0x24')](function(_0xa199e2){if(_0xa199e2){_0x1399ef=_0xa199e2;return _0xa199e2[_0x292a('0x8d')](_0x563d0d[_0x292a('0x4b')]['ids'],_[_0x292a('0x54')](_0x563d0d[_0x292a('0x4b')],[_0x292a('0x68'),'id'])||{});}return null;})[_0x292a('0x8e')](function(_0xa6202c){var _0x24032f;var _0x3646bc;_0x493a02=_0xa6202c||[];var _0x4d7120=[];if(_0xa6202c){for(var _0xd9e8f0=0x0;_0xd9e8f0<_0xa6202c['length'];_0xd9e8f0+=0x1){var _0x34bcc7=_0xa6202c[_0xd9e8f0][_0x292a('0x26')]({'plain':!![]});_0x24032f=squel[_0x292a('0x80')]()[_0x292a('0x6b')](_0x292a('0x8f'))[_0x292a('0x6d')](['phone','ContactId',_0x292a('0x76'),_0x292a('0x5e'),_0x292a('0x56'),_0x292a('0x55')],squel[_0x292a('0x70')]()[_0x292a('0x71')](_0x292a('0x6e'),_0x292a('0x6e'))[_0x292a('0x71')]('id',_0x292a('0x73'))[_0x292a('0x71')](_0x34bcc7[_0x292a('0x74')][_0x292a('0x75')](),_0x292a('0x76'))[_0x292a('0x71')](_0x563d0d[_0x292a('0x53')]['id'][_0x292a('0x75')](),_0x292a('0x5e'))[_0x292a('0x71')]('NOW()',_0x292a('0x56'))['field'](_0x292a('0x72'),_0x292a('0x55'))[_0x292a('0x77')]('cm_contacts')[_0x292a('0x3c')]('deletedAt\x20IS\x20NULL')[_0x292a('0x3c')](_0x292a('0x7a'),_0x34bcc7[_0x292a('0x74')]['toString']())['where'](_0x292a('0x7b')))[_0x292a('0x75')]();_0x4d7120[_0x292a('0x88')](db['sequelize'][_0x292a('0x32')](_0x24032f));}return BPromise[_0x292a('0x8a')](_0x4d7120);}})[_0x292a('0x24')](function(){return _0x493a02;})[_0x292a('0x24')](respondWithResult(_0x5c0347,null))[_0x292a('0x46')](handleError(_0x5c0347,null));};exports[_0x292a('0x90')]=function(_0x480ec7,_0x36ac27,_0x3409c2){return db[_0x292a('0x2c')][_0x292a('0x49')]({'where':{'id':_0x480ec7[_0x292a('0x53')]['id']}})['then'](handleEntityNotFound(_0x36ac27,null))[_0x292a('0x24')](function(_0x1bc670){if(_0x1bc670){return _0x1bc670[_0x292a('0x90')](_0x480ec7['query']['ids']);}})['then'](function(_0x115e5b){if(_0x115e5b){return db[_0x292a('0x62')][_0x292a('0x25')]({'where':{'ListId':_0x480ec7['query'][_0x292a('0x68')],'CampaignId':_0x480ec7[_0x292a('0x53')]['id']}})[_0x292a('0x24')](function(){return _0x115e5b;});}})[_0x292a('0x24')](respondWithStatusCode(_0x36ac27,null))[_0x292a('0x46')](handleError(_0x36ac27,null));}; \ No newline at end of file +var _0x88c8=['sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','update','then','IvrCampaigns','UserProfileResource','destroy','end','error','stack','name','send','map','Campaign','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','count','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','clone','omit','createdAt','updatedAt','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','sort','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CampaignId','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','phone\x20IS\x20NOT\x20NULL','fromQuery','cm_hopper_additional_phones','ci.item','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x88c8,0x7a));var _0x888c=function(_0x4f242d,_0x28ae07){_0x4f242d=_0x4f242d-0x0;var _0x5e11b8=_0x88c8[_0x4f242d];return _0x5e11b8;};'use strict';var emlformat=require(_0x888c('0x0'));var rimraf=require(_0x888c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x888c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x888c('0x3'));var util=require(_0x888c('0x4'));var path=require('path');var sox=require(_0x888c('0x5'));var csv=require(_0x888c('0x6'));var ejs=require(_0x888c('0x7'));var fs=require('fs');var fs_extra=require(_0x888c('0x8'));var _=require(_0x888c('0x9'));var squel=require(_0x888c('0xa'));var crypto=require(_0x888c('0xb'));var jsforce=require(_0x888c('0xc'));var deskjs=require(_0x888c('0xd'));var toCsv=require(_0x888c('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x888c('0xe'));var authService=require(_0x888c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x888c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x888c('0x11'))(_0x888c('0x12'));var utils=require(_0x888c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x888c('0x14'));var db=require(_0x888c('0x15'))['db'];function respondWithStatusCode(_0x29a7fb,_0x2018a4){_0x2018a4=_0x2018a4||0xcc;return function(_0xe8b4f9){if(_0xe8b4f9){return _0x29a7fb[_0x888c('0x16')](_0x2018a4);}return _0x29a7fb[_0x888c('0x17')](_0x2018a4)['end']();};}function respondWithResult(_0x524085,_0x115ecd){_0x115ecd=_0x115ecd||0xc8;return function(_0xefa022){if(_0xefa022){return _0x524085[_0x888c('0x17')](_0x115ecd)[_0x888c('0x18')](_0xefa022);}};}function respondWithFilteredResult(_0x355924,_0x24ad88){return function(_0xb48d29){if(_0xb48d29){var _0x2f5c4e=typeof _0x24ad88[_0x888c('0x19')]===_0x888c('0x1a')&&typeof _0x24ad88[_0x888c('0x1b')]===_0x888c('0x1a');var _0x406a2f=_0xb48d29['count'];var _0x1fefb1=_0x2f5c4e?0x0:_0x24ad88['offset'];var _0x133947=_0x2f5c4e?_0xb48d29['count']:_0x24ad88[_0x888c('0x19')]+_0x24ad88[_0x888c('0x1b')];var _0x2fb1fb;if(_0x133947>=_0x406a2f){_0x133947=_0x406a2f;_0x2fb1fb=0xc8;}else{_0x2fb1fb=0xce;}_0x355924[_0x888c('0x17')](_0x2fb1fb);return _0x355924[_0x888c('0x1c')]('Content-Range',_0x1fefb1+'-'+_0x133947+'/'+_0x406a2f)[_0x888c('0x18')](_0xb48d29);}return null;};}function patchUpdates(_0xa1d889){return function(_0x21262c){try{jsonpatch[_0x888c('0x1d')](_0x21262c,_0xa1d889,!![]);}catch(_0x2195d3){return BPromise[_0x888c('0x1e')](_0x2195d3);}return _0x21262c[_0x888c('0x1f')]();};}function saveUpdates(_0x109934,_0x401ffe){return function(_0x246166){if(_0x246166){return _0x246166[_0x888c('0x20')](_0x109934)['then'](function(_0x3f3608){return _0x3f3608;});}return null;};}function removeEntity(_0x1f6ccb,_0x44b882){return function(_0x3f6376){if(_0x3f6376){return _0x3f6376['destroy']()[_0x888c('0x21')](function(){var _0x2f5790=_0x3f6376['get']({'plain':!![]});var _0xce2657=_0x888c('0x22');return db[_0x888c('0x23')][_0x888c('0x24')]({'where':{'type':_0xce2657,'resourceId':_0x2f5790['id']}})[_0x888c('0x21')](function(){return _0x3f6376;});})['then'](function(){_0x1f6ccb[_0x888c('0x17')](0xcc)[_0x888c('0x25')]();});}};}function handleEntityNotFound(_0x32d6da,_0x40388d){return function(_0x4ad064){if(!_0x4ad064){_0x32d6da[_0x888c('0x16')](0x194);}return _0x4ad064;};}function handleError(_0xf6c22d,_0x6431f){_0x6431f=_0x6431f||0x1f4;return function(_0x155623){logger[_0x888c('0x26')](_0x155623[_0x888c('0x27')]);if(_0x155623[_0x888c('0x28')]){delete _0x155623[_0x888c('0x28')];}_0xf6c22d[_0x888c('0x17')](_0x6431f)[_0x888c('0x29')](_0x155623);};}exports['index']=function(_0x56779e,_0x48c906){var _0x43d7a9={},_0x80a04e={},_0x1564b2={'count':0x0,'rows':[]};var _0x4c483b=_[_0x888c('0x2a')](db[_0x888c('0x2b')][_0x888c('0x2c')],function(_0x37d67f){return{'name':_0x37d67f[_0x888c('0x2d')],'type':_0x37d67f[_0x888c('0x2e')][_0x888c('0x2f')]};});_0x80a04e[_0x888c('0x30')]=_[_0x888c('0x2a')](_0x4c483b,_0x888c('0x28'));_0x80a04e['query']=_[_0x888c('0x31')](_0x56779e[_0x888c('0x32')]);_0x80a04e[_0x888c('0x33')]=_[_0x888c('0x34')](_0x80a04e[_0x888c('0x30')],_0x80a04e['query']);_0x43d7a9[_0x888c('0x35')]=_[_0x888c('0x34')](_0x80a04e[_0x888c('0x30')],qs[_0x888c('0x36')](_0x56779e['query'][_0x888c('0x36')]));_0x43d7a9[_0x888c('0x35')]=_0x43d7a9[_0x888c('0x35')][_0x888c('0x37')]?_0x43d7a9[_0x888c('0x35')]:_0x80a04e['model'];if(!_0x56779e[_0x888c('0x32')][_0x888c('0x38')](_0x888c('0x39'))){_0x43d7a9[_0x888c('0x1b')]=qs[_0x888c('0x1b')](_0x56779e[_0x888c('0x32')][_0x888c('0x1b')]);_0x43d7a9[_0x888c('0x19')]=qs['offset'](_0x56779e[_0x888c('0x32')][_0x888c('0x19')]);}_0x43d7a9[_0x888c('0x3a')]=qs['sort'](_0x56779e[_0x888c('0x32')]['sort']);_0x43d7a9[_0x888c('0x3b')]=qs[_0x888c('0x33')](_[_0x888c('0x3c')](_0x56779e['query'],_0x80a04e['filters']),_0x4c483b);if(_0x56779e[_0x888c('0x32')]['filter']){_0x43d7a9[_0x888c('0x3b')]=_[_0x888c('0x3d')](_0x43d7a9['where'],{'$or':_[_0x888c('0x2a')](_0x4c483b,function(_0x4414a9){if(_0x4414a9[_0x888c('0x2e')]!==_0x888c('0x3e')){var _0x4b8ff1={};_0x4b8ff1[_0x4414a9[_0x888c('0x28')]]={'$like':'%'+_0x56779e[_0x888c('0x32')][_0x888c('0x3f')]+'%'};return _0x4b8ff1;}})});}_0x43d7a9=_[_0x888c('0x3d')]({},_0x43d7a9,_0x56779e[_0x888c('0x40')]);var _0x4649c1={'where':_0x43d7a9['where']};return db[_0x888c('0x2b')][_0x888c('0x41')](_0x4649c1)[_0x888c('0x21')](function(_0x852003){_0x1564b2['count']=_0x852003;if(_0x56779e[_0x888c('0x32')][_0x888c('0x42')]){_0x43d7a9['include']=[{'all':!![]}];}return db['Campaign'][_0x888c('0x43')](_0x43d7a9);})[_0x888c('0x21')](function(_0x1e9be3){_0x1564b2[_0x888c('0x44')]=_0x1e9be3;return _0x1564b2;})[_0x888c('0x21')](respondWithFilteredResult(_0x48c906,_0x43d7a9))[_0x888c('0x45')](handleError(_0x48c906,null));};exports[_0x888c('0x46')]=function(_0x3c8fb5,_0x2eb8f6){var _0x3e1169={'raw':![],'where':{'id':_0x3c8fb5[_0x888c('0x47')]['id']}},_0x14c496={};_0x14c496['model']=_['keys'](db['Campaign'][_0x888c('0x2c')]);_0x14c496[_0x888c('0x32')]=_[_0x888c('0x31')](_0x3c8fb5[_0x888c('0x32')]);_0x14c496[_0x888c('0x33')]=_['intersection'](_0x14c496[_0x888c('0x30')],_0x14c496[_0x888c('0x32')]);_0x3e1169[_0x888c('0x35')]=_[_0x888c('0x34')](_0x14c496['model'],qs[_0x888c('0x36')](_0x3c8fb5[_0x888c('0x32')][_0x888c('0x36')]));_0x3e1169[_0x888c('0x35')]=_0x3e1169[_0x888c('0x35')]['length']?_0x3e1169[_0x888c('0x35')]:_0x14c496['model'];if(_0x3c8fb5[_0x888c('0x32')]['includeAll']){_0x3e1169[_0x888c('0x48')]=[{'all':!![]}];}_0x3e1169=_['merge']({},_0x3e1169,_0x3c8fb5[_0x888c('0x40')]);return db[_0x888c('0x2b')][_0x888c('0x49')](_0x3e1169)['then'](handleEntityNotFound(_0x2eb8f6,null))['then'](respondWithResult(_0x2eb8f6,null))[_0x888c('0x45')](handleError(_0x2eb8f6,null));};exports[_0x888c('0x4a')]=function(_0x26ef75,_0xaaa4e5){return db[_0x888c('0x2b')][_0x888c('0x4a')](_0x26ef75[_0x888c('0x4b')],{})[_0x888c('0x21')](function(_0x4a2824){var _0x557817=_0x26ef75[_0x888c('0x4c')][_0x888c('0x4d')]({'plain':!![]});if(!_0x557817)throw new Error(_0x888c('0x4e'));if(_0x557817[_0x888c('0x4f')]===_0x888c('0x4c')){var _0x184285=_0x4a2824['get']({'plain':!![]});var _0x550ab0=_0x888c('0x22');return db[_0x888c('0x50')][_0x888c('0x49')]({'where':{'name':_0x550ab0,'userProfileId':_0x557817[_0x888c('0x51')]},'raw':!![]})[_0x888c('0x21')](function(_0x3c64ec){if(_0x3c64ec&&_0x3c64ec['autoAssociation']===0x0){return db['UserProfileResource'][_0x888c('0x4a')]({'name':_0x184285['name'],'resourceId':_0x184285['id'],'type':_0x3c64ec['name'],'sectionId':_0x3c64ec['id']},{})[_0x888c('0x21')](function(){return _0x4a2824;});}else{return _0x4a2824;}})[_0x888c('0x45')](function(_0x14b207){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14b207);throw _0x14b207;});}return _0x4a2824;})['then'](respondWithResult(_0xaaa4e5,0xc9))[_0x888c('0x45')](handleError(_0xaaa4e5,null));};exports[_0x888c('0x52')]=function(_0x308e5f,_0x55dde0){var _0x40af32={'where':{'id':_0x308e5f['params']['id']}},_0xd5e382={};_0xd5e382['model']=_[_0x888c('0x31')](db[_0x888c('0x2b')][_0x888c('0x2c')]);_0x40af32['attributes']=_['intersection'](_0xd5e382[_0x888c('0x30')],qs[_0x888c('0x36')](_0x308e5f[_0x888c('0x32')]['fields']));_0x40af32[_0x888c('0x35')]=_0x40af32[_0x888c('0x35')][_0x888c('0x37')]?_0x40af32[_0x888c('0x35')]:_0xd5e382[_0x888c('0x30')];if(_0x308e5f['query'][_0x888c('0x42')]){_0x40af32[_0x888c('0x48')]=[{'all':!![]}];}_0x40af32=_[_0x888c('0x3d')]({},_0x40af32,_0x308e5f[_0x888c('0x40')]);return db[_0x888c('0x2b')][_0x888c('0x49')](_0x40af32)[_0x888c('0x21')](handleEntityNotFound(_0x55dde0,null))[_0x888c('0x21')](function(_0x4ea211){if(_0x4ea211){var _0x14322c=_0x4ea211[_0x888c('0x4d')]({'plain':!![]});_0x14322c=qs[_0x888c('0x53')](_0x14322c,['id',_0x888c('0x54'),'updatedAt']);_0x308e5f[_0x888c('0x4b')]=_[_0x888c('0x53')](_0x308e5f['body'],['id','createdAt',_0x888c('0x55')]);return db[_0x888c('0x2b')][_0x888c('0x4a')](_[_0x888c('0x3d')](_0x14322c,_0x308e5f[_0x888c('0x4b')]),{'include':_0x308e5f[_0x888c('0x32')][_0x888c('0x42')]?[{'all':!![]}]:undefined})[_0x888c('0x21')](function(_0x4f3121){var _0x523a20=_0x308e5f['user'][_0x888c('0x4d')]({'plain':!![]});if(!_0x523a20)throw new Error(_0x888c('0x4e'));if(_0x523a20['role']===_0x888c('0x4c')){var _0x1c416a=_0x4f3121[_0x888c('0x4d')]({'plain':!![]});var _0x4ea2bd=_0x888c('0x22');return db[_0x888c('0x50')][_0x888c('0x49')]({'where':{'name':_0x4ea2bd,'userProfileId':_0x523a20[_0x888c('0x51')]},'raw':!![]})['then'](function(_0xdcfa6b){if(_0xdcfa6b&&_0xdcfa6b[_0x888c('0x56')]===0x0){return db['UserProfileResource'][_0x888c('0x4a')]({'name':_0x1c416a[_0x888c('0x28')],'resourceId':_0x1c416a['id'],'type':_0xdcfa6b['name'],'sectionId':_0xdcfa6b['id']},{})['then'](function(){return _0x4f3121;});}else{return _0x4f3121;}})['catch'](function(_0x56dde2){logger[_0x888c('0x26')](_0x888c('0x57'),_0x56dde2);throw _0x56dde2;});}return _0x4f3121;});}})[_0x888c('0x21')](respondWithResult(_0x55dde0,0xc9))['catch'](handleError(_0x55dde0,null));};exports[_0x888c('0x20')]=function(_0x4bc11d,_0x1dc046){if(_0x4bc11d[_0x888c('0x4b')]['id']){delete _0x4bc11d[_0x888c('0x4b')]['id'];}return db['Campaign'][_0x888c('0x49')]({'where':{'id':_0x4bc11d[_0x888c('0x47')]['id']}})[_0x888c('0x21')](handleEntityNotFound(_0x1dc046,null))['then'](saveUpdates(_0x4bc11d[_0x888c('0x4b')],null))['then'](respondWithResult(_0x1dc046,null))[_0x888c('0x45')](handleError(_0x1dc046,null));};exports[_0x888c('0x24')]=function(_0xc28dc2,_0x8aca12){return db[_0x888c('0x2b')]['find']({'where':{'id':_0xc28dc2[_0x888c('0x47')]['id']}})[_0x888c('0x21')](handleEntityNotFound(_0x8aca12,null))[_0x888c('0x21')](removeEntity(_0x8aca12,null))[_0x888c('0x45')](handleError(_0x8aca12,null));};exports[_0x888c('0x58')]=function(_0x36e073,_0x684a41,_0x37ee7c){var _0xd6d0a0={'raw':!![],'where':{}};var _0x171041={};var _0x367b55={'count':0x0,'rows':[]};return db[_0x888c('0x2b')][_0x888c('0x59')]({'where':{'id':_0x36e073[_0x888c('0x47')]['id']}})[_0x888c('0x21')](handleEntityNotFound(_0x684a41,null))[_0x888c('0x21')](function(_0x2d0e5b){if(_0x2d0e5b){_0x171041[_0x888c('0x30')]=_[_0x888c('0x31')](db[_0x888c('0x5a')]['rawAttributes']);_0x171041[_0x888c('0x32')]=_['keys'](_0x36e073[_0x888c('0x32')]);_0x171041[_0x888c('0x33')]=_['intersection'](_0x171041[_0x888c('0x30')],_0x171041[_0x888c('0x32')]);_0xd6d0a0[_0x888c('0x35')]=_[_0x888c('0x34')](_0x171041['model'],qs[_0x888c('0x36')](_0x36e073[_0x888c('0x32')][_0x888c('0x36')]));_0xd6d0a0[_0x888c('0x35')]=_0xd6d0a0[_0x888c('0x35')][_0x888c('0x37')]?_0xd6d0a0[_0x888c('0x35')]:_0x171041['model'];if(!_0x36e073[_0x888c('0x32')][_0x888c('0x38')]('nolimit')){_0xd6d0a0['limit']=qs[_0x888c('0x1b')](_0x36e073[_0x888c('0x32')][_0x888c('0x1b')]);_0xd6d0a0[_0x888c('0x19')]=qs['offset'](_0x36e073['query'][_0x888c('0x19')]);}_0xd6d0a0[_0x888c('0x3a')]=qs[_0x888c('0x5b')](_0x36e073[_0x888c('0x32')]['sort']);_0xd6d0a0[_0x888c('0x3b')]=qs[_0x888c('0x33')](_[_0x888c('0x3c')](_0x36e073['query'],_0x171041[_0x888c('0x33')]));_0xd6d0a0[_0x888c('0x3b')]['CampaignId']=_0x2d0e5b['id'];if(_0x36e073['query']['filter']){_0xd6d0a0[_0x888c('0x3b')]=_[_0x888c('0x3d')](_0xd6d0a0[_0x888c('0x3b')],{'$or':_['map'](_0xd6d0a0['attributes'],function(_0x283b9b){var _0x54ac54={};_0x54ac54[_0x283b9b]={'$like':'%'+_0x36e073[_0x888c('0x32')]['filter']+'%'};return _0x54ac54;})});}_0xd6d0a0=_[_0x888c('0x3d')]({},_0xd6d0a0,_0x36e073[_0x888c('0x40')]);return db['CmHopper'][_0x888c('0x41')]({'where':_0xd6d0a0['where']})[_0x888c('0x21')](function(_0x2f87eb){_0x367b55['count']=_0x2f87eb;if(_0x36e073[_0x888c('0x32')][_0x888c('0x42')]){_0xd6d0a0[_0x888c('0x48')]=[{'all':!![]}];}return db[_0x888c('0x5a')]['findAll'](_0xd6d0a0);})[_0x888c('0x21')](function(_0x130e73){_0x367b55['rows']=_0x130e73;return _0x367b55;});}})['then'](respondWithFilteredResult(_0x684a41,_0xd6d0a0))['catch'](handleError(_0x684a41,null));};exports[_0x888c('0x5c')]=function(_0x1d5611,_0x211e89,_0x3711ec){var _0x445518={'raw':!![],'where':{}};var _0x3a5851={};var _0x4ec620={'count':0x0,'rows':[]};return db[_0x888c('0x2b')]['findOne']({'where':{'id':_0x1d5611[_0x888c('0x47')]['id']}})[_0x888c('0x21')](handleEntityNotFound(_0x211e89,null))[_0x888c('0x21')](function(_0x501ae1){if(_0x501ae1){_0x3a5851[_0x888c('0x30')]=_[_0x888c('0x31')](db['CmHopperHistory']['rawAttributes']);_0x3a5851['query']=_[_0x888c('0x31')](_0x1d5611[_0x888c('0x32')]);_0x3a5851['filters']=_[_0x888c('0x34')](_0x3a5851[_0x888c('0x30')],_0x3a5851[_0x888c('0x32')]);_0x445518['attributes']=_[_0x888c('0x34')](_0x3a5851['model'],qs['fields'](_0x1d5611[_0x888c('0x32')][_0x888c('0x36')]));_0x445518[_0x888c('0x35')]=_0x445518[_0x888c('0x35')][_0x888c('0x37')]?_0x445518[_0x888c('0x35')]:_0x3a5851[_0x888c('0x30')];if(!_0x1d5611[_0x888c('0x32')]['hasOwnProperty'](_0x888c('0x39'))){_0x445518[_0x888c('0x1b')]=qs[_0x888c('0x1b')](_0x1d5611[_0x888c('0x32')]['limit']);_0x445518['offset']=qs[_0x888c('0x19')](_0x1d5611['query'][_0x888c('0x19')]);}_0x445518['order']=qs[_0x888c('0x5b')](_0x1d5611['query'][_0x888c('0x5b')]);_0x445518[_0x888c('0x3b')]=qs[_0x888c('0x33')](_[_0x888c('0x3c')](_0x1d5611['query'],_0x3a5851[_0x888c('0x33')]));_0x445518[_0x888c('0x3b')]['CampaignId']=_0x501ae1['id'];if(_0x1d5611['query'][_0x888c('0x3f')]){_0x445518[_0x888c('0x3b')]=_['merge'](_0x445518['where'],{'$or':_[_0x888c('0x2a')](_0x445518[_0x888c('0x35')],function(_0x234c6e){var _0x1dffb4={};_0x1dffb4[_0x234c6e]={'$like':'%'+_0x1d5611[_0x888c('0x32')]['filter']+'%'};return _0x1dffb4;})});}_0x445518=_[_0x888c('0x3d')]({},_0x445518,_0x1d5611[_0x888c('0x40')]);return db[_0x888c('0x5d')][_0x888c('0x41')]({'where':_0x445518[_0x888c('0x3b')]})[_0x888c('0x21')](function(_0x42e3dc){_0x4ec620[_0x888c('0x41')]=_0x42e3dc;if(_0x1d5611['query'][_0x888c('0x42')]){_0x445518[_0x888c('0x48')]=[{'all':!![]}];}return db[_0x888c('0x5d')][_0x888c('0x43')](_0x445518);})[_0x888c('0x21')](function(_0x17f275){_0x4ec620['rows']=_0x17f275;return _0x4ec620;});}})[_0x888c('0x21')](respondWithFilteredResult(_0x211e89,_0x445518))[_0x888c('0x45')](handleError(_0x211e89,null));};exports['getHopperFinals']=function(_0x45850b,_0x34e2b7,_0xbf1c29){var _0x5246fc={'raw':!![],'where':{}};var _0x6cc1d1={};var _0x215995={'count':0x0,'rows':[]};return db[_0x888c('0x2b')][_0x888c('0x59')]({'where':{'id':_0x45850b[_0x888c('0x47')]['id']}})[_0x888c('0x21')](handleEntityNotFound(_0x34e2b7,null))[_0x888c('0x21')](function(_0x55f319){if(_0x55f319){_0x6cc1d1[_0x888c('0x30')]=_[_0x888c('0x31')](db[_0x888c('0x5e')][_0x888c('0x2c')]);_0x6cc1d1[_0x888c('0x32')]=_[_0x888c('0x31')](_0x45850b['query']);_0x6cc1d1[_0x888c('0x33')]=_['intersection'](_0x6cc1d1[_0x888c('0x30')],_0x6cc1d1[_0x888c('0x32')]);_0x5246fc[_0x888c('0x35')]=_[_0x888c('0x34')](_0x6cc1d1[_0x888c('0x30')],qs['fields'](_0x45850b['query'][_0x888c('0x36')]));_0x5246fc[_0x888c('0x35')]=_0x5246fc['attributes'][_0x888c('0x37')]?_0x5246fc[_0x888c('0x35')]:_0x6cc1d1[_0x888c('0x30')];if(!_0x45850b[_0x888c('0x32')]['hasOwnProperty'](_0x888c('0x39'))){_0x5246fc[_0x888c('0x1b')]=qs[_0x888c('0x1b')](_0x45850b[_0x888c('0x32')]['limit']);_0x5246fc[_0x888c('0x19')]=qs[_0x888c('0x19')](_0x45850b[_0x888c('0x32')][_0x888c('0x19')]);}_0x5246fc[_0x888c('0x3a')]=qs[_0x888c('0x5b')](_0x45850b[_0x888c('0x32')][_0x888c('0x5b')]);_0x5246fc[_0x888c('0x3b')]=qs['filters'](_[_0x888c('0x3c')](_0x45850b[_0x888c('0x32')],_0x6cc1d1['filters']));_0x5246fc[_0x888c('0x3b')]['CampaignId']=_0x55f319['id'];if(_0x45850b[_0x888c('0x32')][_0x888c('0x3f')]){_0x5246fc[_0x888c('0x3b')]=_[_0x888c('0x3d')](_0x5246fc['where'],{'$or':_[_0x888c('0x2a')](_0x5246fc['attributes'],function(_0x36e0f1){var _0x3af968={};_0x3af968[_0x36e0f1]={'$like':'%'+_0x45850b[_0x888c('0x32')][_0x888c('0x3f')]+'%'};return _0x3af968;})});}_0x5246fc=_[_0x888c('0x3d')]({},_0x5246fc,_0x45850b[_0x888c('0x40')]);return db[_0x888c('0x5e')]['count']({'where':_0x5246fc[_0x888c('0x3b')]})[_0x888c('0x21')](function(_0x12af53){_0x215995[_0x888c('0x41')]=_0x12af53;if(_0x45850b['query']['includeAll']){_0x5246fc[_0x888c('0x48')]=[{'all':!![]}];}return db[_0x888c('0x5e')]['findAll'](_0x5246fc);})[_0x888c('0x21')](function(_0x193240){_0x215995[_0x888c('0x44')]=_0x193240;return _0x215995;});}})[_0x888c('0x21')](respondWithFilteredResult(_0x34e2b7,_0x5246fc))['catch'](handleError(_0x34e2b7,null));};exports[_0x888c('0x5f')]=function(_0x28a042,_0x4a2201,_0x46c69){var _0x75a5f0={'raw':!![],'where':{}};var _0x3f566a={};var _0x164dd4={'count':0x0,'rows':[]};return db[_0x888c('0x2b')][_0x888c('0x59')]({'where':{'id':_0x28a042['params']['id']}})[_0x888c('0x21')](handleEntityNotFound(_0x4a2201,null))[_0x888c('0x21')](function(_0x12bd1e){if(_0x12bd1e){_0x3f566a[_0x888c('0x30')]=_[_0x888c('0x31')](db[_0x888c('0x60')][_0x888c('0x2c')]);_0x3f566a[_0x888c('0x32')]=_[_0x888c('0x31')](_0x28a042[_0x888c('0x32')]);_0x3f566a[_0x888c('0x33')]=_[_0x888c('0x34')](_0x3f566a[_0x888c('0x30')],_0x3f566a[_0x888c('0x32')]);_0x75a5f0[_0x888c('0x35')]=_[_0x888c('0x34')](_0x3f566a[_0x888c('0x30')],qs[_0x888c('0x36')](_0x28a042['query'][_0x888c('0x36')]));_0x75a5f0[_0x888c('0x35')]=_0x75a5f0['attributes'][_0x888c('0x37')]?_0x75a5f0[_0x888c('0x35')]:_0x3f566a[_0x888c('0x30')];if(!_0x28a042[_0x888c('0x32')]['hasOwnProperty'](_0x888c('0x39'))){_0x75a5f0[_0x888c('0x1b')]=qs[_0x888c('0x1b')](_0x28a042[_0x888c('0x32')][_0x888c('0x1b')]);_0x75a5f0[_0x888c('0x19')]=qs[_0x888c('0x19')](_0x28a042[_0x888c('0x32')][_0x888c('0x19')]);}_0x75a5f0['order']=qs[_0x888c('0x5b')](_0x28a042[_0x888c('0x32')]['sort']);_0x75a5f0[_0x888c('0x3b')]=qs['filters'](_['pick'](_0x28a042[_0x888c('0x32')],_0x3f566a[_0x888c('0x33')]));_0x75a5f0[_0x888c('0x3b')][_0x888c('0x61')]=_0x12bd1e['id'];if(_0x28a042[_0x888c('0x32')][_0x888c('0x3f')]){_0x75a5f0['where']=_[_0x888c('0x3d')](_0x75a5f0[_0x888c('0x3b')],{'$or':_[_0x888c('0x2a')](_0x75a5f0[_0x888c('0x35')],function(_0x52f6ab){var _0x11834f={};_0x11834f[_0x52f6ab]={'$like':'%'+_0x28a042[_0x888c('0x32')][_0x888c('0x3f')]+'%'};return _0x11834f;})});}_0x75a5f0=_[_0x888c('0x3d')]({},_0x75a5f0,_0x28a042[_0x888c('0x40')]);return db[_0x888c('0x60')][_0x888c('0x41')]({'where':_0x75a5f0[_0x888c('0x3b')]})[_0x888c('0x21')](function(_0x578f1b){_0x164dd4['count']=_0x578f1b;if(_0x28a042[_0x888c('0x32')][_0x888c('0x42')]){_0x75a5f0['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x888c('0x43')](_0x75a5f0);})[_0x888c('0x21')](function(_0x128620){_0x164dd4[_0x888c('0x44')]=_0x128620;return _0x164dd4;});}})[_0x888c('0x21')](respondWithFilteredResult(_0x4a2201,_0x75a5f0))[_0x888c('0x45')](handleError(_0x4a2201,null));};exports['getLists']=function(_0xcce80f,_0x1d60aa,_0x53b2ac){var _0x3bb8e2={};var _0x3dbaf3={};var _0x46fda5;var _0x18a9a6;return db['Campaign'][_0x888c('0x59')]({'where':{'id':_0xcce80f[_0x888c('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d60aa,null))[_0x888c('0x21')](function(_0x22d18b){if(_0x22d18b){_0x46fda5=_0x22d18b;_0x3dbaf3[_0x888c('0x30')]=_[_0x888c('0x31')](db[_0x888c('0x62')]['rawAttributes']);_0x3dbaf3[_0x888c('0x32')]=_[_0x888c('0x31')](_0xcce80f['query']);_0x3dbaf3['filters']=_[_0x888c('0x34')](_0x3dbaf3['model'],_0x3dbaf3[_0x888c('0x32')]);_0x3bb8e2[_0x888c('0x35')]=_[_0x888c('0x34')](_0x3dbaf3['model'],qs[_0x888c('0x36')](_0xcce80f[_0x888c('0x32')]['fields']));_0x3bb8e2[_0x888c('0x35')]=_0x3bb8e2[_0x888c('0x35')][_0x888c('0x37')]?_0x3bb8e2[_0x888c('0x35')]:_0x3dbaf3[_0x888c('0x30')];_0x3bb8e2[_0x888c('0x3a')]=qs['sort'](_0xcce80f[_0x888c('0x32')]['sort']);_0x3bb8e2[_0x888c('0x3b')]=qs[_0x888c('0x33')](_[_0x888c('0x3c')](_0xcce80f[_0x888c('0x32')],_0x3dbaf3[_0x888c('0x33')]));if(_0xcce80f['query']['filter']){_0x3bb8e2[_0x888c('0x3b')]=_['merge'](_0x3bb8e2[_0x888c('0x3b')],{'$or':_[_0x888c('0x2a')](_0x3bb8e2['attributes'],function(_0x4ea8d2){var _0x1763bf={};_0x1763bf[_0x4ea8d2]={'$like':'%'+_0xcce80f[_0x888c('0x32')][_0x888c('0x3f')]+'%'};return _0x1763bf;})});}_0x3bb8e2=_[_0x888c('0x3d')]({},_0x3bb8e2,_0xcce80f[_0x888c('0x40')]);return _0x46fda5[_0x888c('0x63')](_0x3bb8e2);}})['then'](function(_0x1a8f5f){if(_0x1a8f5f){_0x18a9a6=_0x1a8f5f[_0x888c('0x37')];if(!_0xcce80f[_0x888c('0x32')][_0x888c('0x38')]('nolimit')){_0x3bb8e2[_0x888c('0x1b')]=qs[_0x888c('0x1b')](_0xcce80f['query']['limit']);_0x3bb8e2['offset']=qs[_0x888c('0x19')](_0xcce80f[_0x888c('0x32')]['offset']);}return _0x46fda5[_0x888c('0x63')](_0x3bb8e2);}})[_0x888c('0x21')](function(_0x1c1104){if(_0x1c1104){return _0x1c1104?{'count':_0x18a9a6,'rows':_0x1c1104}:null;}})[_0x888c('0x21')](respondWithResult(_0x1d60aa,null))['catch'](handleError(_0x1d60aa,null));};exports[_0x888c('0x64')]=function(_0x385732,_0x28be34,_0x2445e5){var _0x565558,_0xe354be;var _0x248ed5=[];var _0x495246=moment()[_0x888c('0x65')](_0x888c('0x66'));return db['Campaign'][_0x888c('0x49')]({'where':{'id':_0x385732['params']['id']}})[_0x888c('0x21')](handleEntityNotFound(_0x28be34,null))['then'](function(_0x3b9fc4){if(_0x3b9fc4){_0xe354be=_0x3b9fc4;return _0x3b9fc4[_0x888c('0x64')](_0x385732[_0x888c('0x4b')][_0x888c('0x67')],_[_0x888c('0x53')](_0x385732['body'],[_0x888c('0x67'),'id'])||{});}return null;})[_0x888c('0x68')](function(_0x3ec045){var _0x5422bb;var _0xab63e8;_0x565558=_0x3ec045||[];var _0x3ac5d2=[];if(_0x3ec045){for(var _0x4f9e9f=0x0;_0x4f9e9f<_0x3ec045[_0x888c('0x37')];_0x4f9e9f+=0x1){var _0x138d4b=_0x3ec045[_0x4f9e9f]['get']({'plain':!![]});_0xe354be['dialCheckDuplicateType']=_0x385732[_0x888c('0x4b')][_0x888c('0x69')]?_0x385732[_0x888c('0x4b')][_0x888c('0x69')]:_0xe354be[_0x888c('0x69')];switch(_0xe354be[_0x888c('0x69')]){case _0x888c('0x6a'):_0x5422bb=squel[_0x888c('0x6b')]()[_0x888c('0x6c')]('cm_hopper')['fromQuery']([_0x888c('0x6d'),_0x888c('0x6e'),_0x888c('0x6f'),_0x888c('0x70'),_0x888c('0x61'),'createdAt',_0x888c('0x55')],squel['select']()[_0x888c('0x71')](_0x888c('0x6d'),_0x888c('0x6d'))[_0x888c('0x71')](_0x888c('0x72'),_0x888c('0x6e'))[_0x888c('0x71')]('id',_0x888c('0x6f'))[_0x888c('0x71')](_0x138d4b[_0x888c('0x73')]['toString'](),_0x888c('0x70'))[_0x888c('0x71')](_0x385732['params']['id'][_0x888c('0x74')](),_0x888c('0x61'))['field']('\x27'+_0x495246+'\x27',_0x888c('0x54'))[_0x888c('0x71')]('\x27'+_0x495246+'\x27',_0x888c('0x55'))[_0x888c('0x75')](_0x888c('0x76'))[_0x888c('0x3b')](_0x888c('0x77'))[_0x888c('0x3b')](_0x888c('0x78'),_0x138d4b['CmListId'][_0x888c('0x74')]())[_0x888c('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x888c('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x888c('0x79')]()[_0x888c('0x71')](_0x888c('0x7a'))[_0x888c('0x75')](_0x888c('0x7b'))['where'](_0x888c('0x7c'),_0x385732['params']['id'][_0x888c('0x74')]()))[_0x888c('0x3b')](_0x888c('0x7d'),squel[_0x888c('0x79')]()[_0x888c('0x71')](_0x888c('0x7e'))[_0x888c('0x75')](_0x888c('0x7f'))[_0x888c('0x3b')](_0x888c('0x7c'),_0x385732[_0x888c('0x47')]['id'][_0x888c('0x74')]())))[_0x888c('0x74')]();break;case'onlyIfOpen':_0x5422bb=squel[_0x888c('0x6b')]()[_0x888c('0x6c')](_0x888c('0x7f'))['fromQuery']([_0x888c('0x6d'),'scheduledAt','ContactId','ListId',_0x888c('0x61'),'createdAt',_0x888c('0x55')],squel[_0x888c('0x79')]()[_0x888c('0x71')](_0x888c('0x6d'),_0x888c('0x6d'))[_0x888c('0x71')]('NOW()','scheduledAt')['field']('id',_0x888c('0x6f'))[_0x888c('0x71')](_0x138d4b[_0x888c('0x73')][_0x888c('0x74')](),'ListId')[_0x888c('0x71')](_0x385732['params']['id'][_0x888c('0x74')](),'CampaignId')['field']('\x27'+_0x495246+'\x27','createdAt')[_0x888c('0x71')]('\x27'+_0x495246+'\x27','updatedAt')['from'](_0x888c('0x76'))[_0x888c('0x3b')](_0x888c('0x77'))['where'](_0x888c('0x78'),_0x138d4b[_0x888c('0x73')]['toString']())[_0x888c('0x3b')](_0x888c('0x80'))[_0x888c('0x3b')](_0x888c('0x7d'),squel[_0x888c('0x79')]()[_0x888c('0x71')](_0x888c('0x7e'))[_0x888c('0x75')](_0x888c('0x7f'))['where'](_0x888c('0x7c'),_0x385732['params']['id'][_0x888c('0x74')]())))[_0x888c('0x74')]();break;default:_0x5422bb=squel[_0x888c('0x6b')]()[_0x888c('0x6c')](_0x888c('0x7f'))[_0x888c('0x81')]([_0x888c('0x6d'),_0x888c('0x6e'),'ContactId',_0x888c('0x70'),_0x888c('0x61'),'createdAt',_0x888c('0x55')],squel[_0x888c('0x79')]()[_0x888c('0x71')](_0x888c('0x6d'),_0x888c('0x6d'))['field'](_0x888c('0x72'),_0x888c('0x6e'))['field']('id',_0x888c('0x6f'))[_0x888c('0x71')](_0x138d4b['CmListId'][_0x888c('0x74')](),'ListId')[_0x888c('0x71')](_0x385732[_0x888c('0x47')]['id'][_0x888c('0x74')](),_0x888c('0x61'))[_0x888c('0x71')]('\x27'+_0x495246+'\x27',_0x888c('0x54'))[_0x888c('0x71')]('\x27'+_0x495246+'\x27','updatedAt')['from'](_0x888c('0x76'))[_0x888c('0x3b')](_0x888c('0x77'))['where']('ListId\x20=\x20?',_0x138d4b['CmListId'][_0x888c('0x74')]())[_0x888c('0x3b')](_0x888c('0x80')))[_0x888c('0x74')]();}_0xab63e8=squel['insert']()[_0x888c('0x6c')](_0x888c('0x82'))[_0x888c('0x81')](['cmHopperId',_0x888c('0x6e'),_0x888c('0x6d'),'OrderBy',_0x888c('0x54'),_0x888c('0x55')],squel[_0x888c('0x79')]()[_0x888c('0x71')]('h.id','id')[_0x888c('0x71')](_0x888c('0x72'),'scheduledAt')[_0x888c('0x71')](_0x888c('0x83'),_0x888c('0x6d'))[_0x888c('0x71')]('ci.OrderBY','OrderBy')[_0x888c('0x71')]('\x27'+_0x495246+'\x27','createdAt')[_0x888c('0x71')]('\x27'+_0x495246+'\x27',_0x888c('0x55'))[_0x888c('0x75')](_0x888c('0x84'),'ci')[_0x888c('0x85')]('cm_hopper','h',_0x888c('0x86'))[_0x888c('0x3b')](_0x888c('0x87'),_0x138d4b[_0x888c('0x73')][_0x888c('0x74')]())[_0x888c('0x3b')]('h.CampaignId=?',_0x385732['params']['id']['toString']())['where']('h.createdAt\x20=\x20?',_0x495246))[_0x888c('0x74')]();_0x3ac5d2[_0x888c('0x88')](db[_0x888c('0x89')][_0x888c('0x32')](_0x5422bb));_0x248ed5[_0x888c('0x88')](db[_0x888c('0x89')][_0x888c('0x32')](_0xab63e8));}return BPromise['all'](_0x3ac5d2);}})[_0x888c('0x21')](function(){return BPromise['all'](_0x248ed5);})[_0x888c('0x21')](function(){return _0x565558;})[_0x888c('0x21')](respondWithResult(_0x28be34,null))[_0x888c('0x45')](handleError(_0x28be34,null));};exports[_0x888c('0x8a')]=function(_0x32f546,_0x3513ac,_0x5b0fca){return db[_0x888c('0x2b')][_0x888c('0x49')]({'where':{'id':_0x32f546[_0x888c('0x47')]['id']}})[_0x888c('0x21')](handleEntityNotFound(_0x3513ac,null))[_0x888c('0x21')](function(_0x2e6a39){if(_0x2e6a39){return _0x2e6a39['removeLists'](_0x32f546[_0x888c('0x32')][_0x888c('0x67')]);}})['then'](function(_0x559fbf){if(_0x559fbf){return db[_0x888c('0x5a')][_0x888c('0x24')]({'where':{'ListId':_0x32f546[_0x888c('0x32')][_0x888c('0x67')],'CampaignId':_0x32f546[_0x888c('0x47')]['id']}})[_0x888c('0x21')](function(){return _0x559fbf;});}})['then'](respondWithStatusCode(_0x3513ac,null))[_0x888c('0x45')](handleError(_0x3513ac,null));};exports[_0x888c('0x8b')]=function(_0x41edaa,_0x153987,_0x1c918f){var _0x30e25f={};var _0x5f22ba={};var _0x711026;var _0x599111;return db[_0x888c('0x2b')]['findOne']({'where':{'id':_0x41edaa[_0x888c('0x47')]['id']}})['then'](handleEntityNotFound(_0x153987,null))[_0x888c('0x21')](function(_0x5ead9d){if(_0x5ead9d){_0x711026=_0x5ead9d;_0x5f22ba[_0x888c('0x30')]=_[_0x888c('0x31')](db[_0x888c('0x62')][_0x888c('0x2c')]);_0x5f22ba[_0x888c('0x32')]=_[_0x888c('0x31')](_0x41edaa['query']);_0x5f22ba[_0x888c('0x33')]=_[_0x888c('0x34')](_0x5f22ba[_0x888c('0x30')],_0x5f22ba['query']);_0x30e25f[_0x888c('0x35')]=_[_0x888c('0x34')](_0x5f22ba[_0x888c('0x30')],qs[_0x888c('0x36')](_0x41edaa[_0x888c('0x32')][_0x888c('0x36')]));_0x30e25f[_0x888c('0x35')]=_0x30e25f[_0x888c('0x35')][_0x888c('0x37')]?_0x30e25f[_0x888c('0x35')]:_0x5f22ba[_0x888c('0x30')];_0x30e25f[_0x888c('0x3a')]=qs['sort'](_0x41edaa[_0x888c('0x32')][_0x888c('0x5b')]);_0x30e25f['where']=qs[_0x888c('0x33')](_[_0x888c('0x3c')](_0x41edaa['query'],_0x5f22ba[_0x888c('0x33')]));if(_0x41edaa[_0x888c('0x32')][_0x888c('0x3f')]){_0x30e25f[_0x888c('0x3b')]=_['merge'](_0x30e25f[_0x888c('0x3b')],{'$or':_[_0x888c('0x2a')](_0x30e25f[_0x888c('0x35')],function(_0x486f7a){var _0x382b04={};_0x382b04[_0x486f7a]={'$like':'%'+_0x41edaa[_0x888c('0x32')][_0x888c('0x3f')]+'%'};return _0x382b04;})});}_0x30e25f=_[_0x888c('0x3d')]({},_0x30e25f,_0x41edaa[_0x888c('0x40')]);return _0x711026[_0x888c('0x8b')](_0x30e25f);}})[_0x888c('0x21')](function(_0x5b6e28){if(_0x5b6e28){_0x599111=_0x5b6e28[_0x888c('0x37')];if(!_0x41edaa[_0x888c('0x32')][_0x888c('0x38')](_0x888c('0x39'))){_0x30e25f[_0x888c('0x1b')]=qs[_0x888c('0x1b')](_0x41edaa[_0x888c('0x32')][_0x888c('0x1b')]);_0x30e25f[_0x888c('0x19')]=qs['offset'](_0x41edaa[_0x888c('0x32')][_0x888c('0x19')]);}return _0x711026[_0x888c('0x8b')](_0x30e25f);}})[_0x888c('0x21')](function(_0x1bc54a){if(_0x1bc54a){return _0x1bc54a?{'count':_0x599111,'rows':_0x1bc54a}:null;}})['then'](respondWithResult(_0x153987,null))['catch'](handleError(_0x153987,null));};exports[_0x888c('0x8c')]=function(_0x1ea3b4,_0x40c024,_0x3300e4){var _0x51e381,_0x1407d2;var _0x2a91ba=[];var _0x4ca94f=moment()[_0x888c('0x65')](_0x888c('0x66'));return db[_0x888c('0x2b')][_0x888c('0x49')]({'where':{'id':_0x1ea3b4[_0x888c('0x47')]['id']}})['then'](handleEntityNotFound(_0x40c024,null))[_0x888c('0x21')](function(_0x25fa97){if(_0x25fa97){_0x1407d2=_0x25fa97;return _0x25fa97[_0x888c('0x8c')](_0x1ea3b4[_0x888c('0x4b')][_0x888c('0x67')],_[_0x888c('0x53')](_0x1ea3b4[_0x888c('0x4b')],['ids','id'])||{});}return null;})[_0x888c('0x68')](function(_0x37ae5e){var _0x1c4f1c;var _0x532ba0;_0x51e381=_0x37ae5e||[];var _0xd50cd8=[];if(_0x37ae5e){for(var _0x3bdd15=0x0;_0x3bdd15<_0x37ae5e['length'];_0x3bdd15+=0x1){var _0x4e9a2d=_0x37ae5e[_0x3bdd15][_0x888c('0x4d')]({'plain':!![]});_0x1c4f1c=squel[_0x888c('0x6b')]()[_0x888c('0x6c')](_0x888c('0x8d'))[_0x888c('0x81')]([_0x888c('0x6d'),'ContactId','ListId',_0x888c('0x61'),'createdAt',_0x888c('0x55')],squel['select']()[_0x888c('0x71')](_0x888c('0x6d'),_0x888c('0x6d'))[_0x888c('0x71')]('id',_0x888c('0x6f'))[_0x888c('0x71')](_0x4e9a2d[_0x888c('0x73')][_0x888c('0x74')](),_0x888c('0x70'))[_0x888c('0x71')](_0x1ea3b4[_0x888c('0x47')]['id'][_0x888c('0x74')](),_0x888c('0x61'))[_0x888c('0x71')]('NOW()',_0x888c('0x54'))['field'](_0x888c('0x72'),_0x888c('0x55'))['from'](_0x888c('0x76'))['where']('deletedAt\x20IS\x20NULL')[_0x888c('0x3b')](_0x888c('0x78'),_0x4e9a2d[_0x888c('0x73')][_0x888c('0x74')]())[_0x888c('0x3b')](_0x888c('0x80')))['toString']();_0xd50cd8[_0x888c('0x88')](db['sequelize']['query'](_0x1c4f1c));}return BPromise[_0x888c('0x8e')](_0xd50cd8);}})['then'](function(){return _0x51e381;})['then'](respondWithResult(_0x40c024,null))['catch'](handleError(_0x40c024,null));};exports[_0x888c('0x8f')]=function(_0x3cc3a1,_0x2a5fa9,_0x3881a5){return db[_0x888c('0x2b')][_0x888c('0x49')]({'where':{'id':_0x3cc3a1[_0x888c('0x47')]['id']}})[_0x888c('0x21')](handleEntityNotFound(_0x2a5fa9,null))[_0x888c('0x21')](function(_0xd5cd7f){if(_0xd5cd7f){return _0xd5cd7f[_0x888c('0x8f')](_0x3cc3a1[_0x888c('0x32')][_0x888c('0x67')]);}})['then'](function(_0x217c79){if(_0x217c79){return db['CmHopperBlack'][_0x888c('0x24')]({'where':{'ListId':_0x3cc3a1['query'][_0x888c('0x67')],'CampaignId':_0x3cc3a1[_0x888c('0x47')]['id']}})[_0x888c('0x21')](function(){return _0x217c79;});}})[_0x888c('0x21')](respondWithStatusCode(_0x2a5fa9,null))['catch'](handleError(_0x2a5fa9,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 5c937da..1b0b924 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 53573c4..2635418 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 _0x8369=['info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','findAll','options','where','attributes','include','map','model','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x48ccc1,_0x55e9cb){var _0x9ffe13=function(_0x323a36){while(--_0x323a36){_0x48ccc1['push'](_0x48ccc1['shift']());}};_0x9ffe13(++_0x55e9cb);}(_0x8369,0x10b));var _0x9836=function(_0x5694dd,_0x5abea1){_0x5694dd=_0x5694dd-0x0;var _0x4d2249=_0x8369[_0x5694dd];return _0x4d2249;};'use strict';var _=require(_0x9836('0x0'));var util=require(_0x9836('0x1'));var moment=require(_0x9836('0x2'));var BPromise=require(_0x9836('0x3'));var rs=require(_0x9836('0x4'));var fs=require('fs');var Redis=require(_0x9836('0x5'));var db=require(_0x9836('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9836('0x7'))('rpc');var config=require(_0x9836('0x8'));var jayson=require(_0x9836('0x9'));var client=jayson['client'][_0x9836('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e4979,_0x52ae78,_0x37214e){return new BPromise(function(_0x3007ed,_0x16db95){return client[_0x9836('0xb')](_0x2e4979,_0x37214e)['then'](function(_0x30bc66){logger[_0x9836('0xc')](_0x9836('0xd'),_0x52ae78,_0x9836('0xe'));logger['debug'](_0x9836('0xf'),_0x52ae78,_0x9836('0xe'),JSON[_0x9836('0x10')](_0x30bc66));if(_0x30bc66[_0x9836('0x11')]){if(_0x30bc66[_0x9836('0x11')]['code']===0x1f4){logger[_0x9836('0x11')](_0x9836('0xd'),_0x52ae78,_0x30bc66[_0x9836('0x11')][_0x9836('0x12')]);return _0x16db95(_0x30bc66[_0x9836('0x11')][_0x9836('0x12')]);}logger[_0x9836('0x11')](_0x9836('0xd'),_0x52ae78,_0x30bc66['error'][_0x9836('0x12')]);return _0x3007ed(_0x30bc66[_0x9836('0x11')][_0x9836('0x12')]);}else{logger['info'](_0x9836('0xd'),_0x52ae78,'request\x20sent');_0x3007ed(_0x30bc66[_0x9836('0x13')]['message']);}})[_0x9836('0x14')](function(_0x22f9b5){logger[_0x9836('0x11')](_0x9836('0xd'),_0x52ae78,_0x22f9b5);_0x16db95(_0x22f9b5);});});}exports[_0x9836('0x15')]=function(_0x2afe17){var _0x5d1d9c=this;return new Promise(function(_0x1b01b9,_0x45bd78){return db['Campaign'][_0x9836('0x16')]({'raw':_0x2afe17[_0x9836('0x17')]?_0x2afe17[_0x9836('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2afe17[_0x9836('0x17')]?_0x2afe17['options'][_0x9836('0x18')]||null:null,'attributes':_0x2afe17[_0x9836('0x17')]?_0x2afe17[_0x9836('0x17')][_0x9836('0x19')]||null:null,'limit':_0x2afe17[_0x9836('0x17')]?_0x2afe17['options']['limit']||null:null,'include':_0x2afe17['options']?_0x2afe17[_0x9836('0x17')][_0x9836('0x1a')]?_[_0x9836('0x1b')](_0x2afe17['options'][_0x9836('0x1a')],function(_0x20c4d3){return{'model':db[_0x20c4d3[_0x9836('0x1c')]],'as':_0x20c4d3['as'],'attributes':_0x20c4d3[_0x9836('0x19')],'include':_0x20c4d3['include']?_[_0x9836('0x1b')](_0x20c4d3[_0x9836('0x1a')],function(_0x3d9599){return{'model':db[_0x3d9599[_0x9836('0x1c')]],'as':_0x3d9599['as'],'attributes':_0x3d9599[_0x9836('0x19')],'include':_0x3d9599['include']?_[_0x9836('0x1b')](_0x3d9599[_0x9836('0x1a')],function(_0x5bb349){return{'model':db[_0x5bb349[_0x9836('0x1c')]],'as':_0x5bb349['as'],'attributes':_0x5bb349['attributes']};}):[]};}):[]};}):[]:[]})[_0x9836('0x1d')](function(_0x535e8c){logger['info']('GetCampaign',_0x2afe17);logger[_0x9836('0x1e')](_0x9836('0x15'),_0x2afe17,JSON[_0x9836('0x10')](_0x535e8c));_0x1b01b9(_0x535e8c);})[_0x9836('0x14')](function(_0x35bbda){logger[_0x9836('0x11')](_0x9836('0x15'),_0x35bbda['message'],_0x2afe17);_0x45bd78(_0x5d1d9c[_0x9836('0x11')](0x1f4,_0x35bbda[_0x9836('0x12')]));});});}; \ No newline at end of file +var _0xcea2=['rpc','../../config/environment','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','Campaign','findAll','options','where','attributes','limit','map','include','model','then','GetCampaign','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x1e224b,_0x2ca2c3){var _0x20cb8f=function(_0x34c47e){while(--_0x34c47e){_0x1e224b['push'](_0x1e224b['shift']());}};_0x20cb8f(++_0x2ca2c3);}(_0xcea2,0x15a));var _0x2cea=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xcea2[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x2cea('0x0'));var util=require('util');var moment=require(_0x2cea('0x1'));var BPromise=require('bluebird');var rs=require(_0x2cea('0x2'));var fs=require('fs');var Redis=require(_0x2cea('0x3'));var db=require(_0x2cea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cea('0x5'))(_0x2cea('0x6'));var config=require(_0x2cea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2cea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d69ff,_0xc04963,_0x805a1b){return new BPromise(function(_0x160cca,_0x11c5c0){return client[_0x2cea('0x9')](_0x2d69ff,_0x805a1b)['then'](function(_0x1f4d90){logger[_0x2cea('0xa')](_0x2cea('0xb'),_0xc04963,_0x2cea('0xc'));logger[_0x2cea('0xd')](_0x2cea('0xe'),_0xc04963,_0x2cea('0xc'),JSON[_0x2cea('0xf')](_0x1f4d90));if(_0x1f4d90['error']){if(_0x1f4d90['error'][_0x2cea('0x10')]===0x1f4){logger[_0x2cea('0x11')]('Campaign,\x20%s,\x20%s',_0xc04963,_0x1f4d90['error'][_0x2cea('0x12')]);return _0x11c5c0(_0x1f4d90['error'][_0x2cea('0x12')]);}logger[_0x2cea('0x11')](_0x2cea('0xb'),_0xc04963,_0x1f4d90['error']['message']);return _0x160cca(_0x1f4d90['error'][_0x2cea('0x12')]);}else{logger['info'](_0x2cea('0xb'),_0xc04963,_0x2cea('0xc'));_0x160cca(_0x1f4d90[_0x2cea('0x13')][_0x2cea('0x12')]);}})[_0x2cea('0x14')](function(_0x1bbfdb){logger[_0x2cea('0x11')](_0x2cea('0xb'),_0xc04963,_0x1bbfdb);_0x11c5c0(_0x1bbfdb);});});}exports['GetCampaign']=function(_0x19927a){var _0x464f7d=this;return new Promise(function(_0x20c46c,_0x43ae15){return db[_0x2cea('0x15')][_0x2cea('0x16')]({'raw':_0x19927a['options']?_0x19927a[_0x2cea('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x19927a[_0x2cea('0x17')]?_0x19927a[_0x2cea('0x17')][_0x2cea('0x18')]||null:null,'attributes':_0x19927a['options']?_0x19927a[_0x2cea('0x17')][_0x2cea('0x19')]||null:null,'limit':_0x19927a[_0x2cea('0x17')]?_0x19927a[_0x2cea('0x17')][_0x2cea('0x1a')]||null:null,'include':_0x19927a[_0x2cea('0x17')]?_0x19927a[_0x2cea('0x17')]['include']?_[_0x2cea('0x1b')](_0x19927a['options'][_0x2cea('0x1c')],function(_0x4926ff){return{'model':db[_0x4926ff[_0x2cea('0x1d')]],'as':_0x4926ff['as'],'attributes':_0x4926ff[_0x2cea('0x19')],'include':_0x4926ff['include']?_[_0x2cea('0x1b')](_0x4926ff[_0x2cea('0x1c')],function(_0x101314){return{'model':db[_0x101314[_0x2cea('0x1d')]],'as':_0x101314['as'],'attributes':_0x101314[_0x2cea('0x19')],'include':_0x101314[_0x2cea('0x1c')]?_['map'](_0x101314[_0x2cea('0x1c')],function(_0x32b6a3){return{'model':db[_0x32b6a3[_0x2cea('0x1d')]],'as':_0x32b6a3['as'],'attributes':_0x32b6a3[_0x2cea('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2cea('0x1e')](function(_0x3ea40c){logger[_0x2cea('0xa')](_0x2cea('0x1f'),_0x19927a);logger['debug'](_0x2cea('0x1f'),_0x19927a,JSON[_0x2cea('0xf')](_0x3ea40c));_0x20c46c(_0x3ea40c);})['catch'](function(_0xfeb8bd){logger[_0x2cea('0x11')](_0x2cea('0x1f'),_0xfeb8bd[_0x2cea('0x12')],_0x19927a);_0x43ae15(_0x464f7d['error'](0x1f4,_0xfeb8bd[_0x2cea('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index a4292ba..250c020 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 _0xe489=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','exports','multer','util'];(function(_0x228641,_0x25d636){var _0x5d5d78=function(_0x4d5c6c){while(--_0x4d5c6c){_0x228641['push'](_0x228641['shift']());}};_0x5d5d78(++_0x25d636);}(_0xe489,0x9e));var _0x9e48=function(_0x3ea4d8,_0x1f319b){_0x3ea4d8=_0x3ea4d8-0x0;var _0x25da6a=_0xe489[_0x3ea4d8];return _0x25da6a;};'use strict';var multer=require(_0x9e48('0x0'));var util=require(_0x9e48('0x1'));var path=require('path');var timeout=require(_0x9e48('0x2'));var express=require(_0x9e48('0x3'));var router=express[_0x9e48('0x4')]();var fs_extra=require(_0x9e48('0x5'));var auth=require(_0x9e48('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9e48('0x7'));router['get']('/',auth[_0x9e48('0x8')](),controller[_0x9e48('0x9')]);router[_0x9e48('0xa')](_0x9e48('0xb'),auth['isAuthenticated'](),controller[_0x9e48('0xc')]);router[_0x9e48('0xa')](_0x9e48('0xd'),auth[_0x9e48('0x8')](),controller[_0x9e48('0xe')]);router['get'](_0x9e48('0xf'),auth[_0x9e48('0x8')](),controller[_0x9e48('0x10')]);router[_0x9e48('0xa')]('/:id/hopper_finals',auth[_0x9e48('0x8')](),controller[_0x9e48('0x11')]);router[_0x9e48('0xa')](_0x9e48('0x12'),auth[_0x9e48('0x8')](),controller[_0x9e48('0x13')]);router[_0x9e48('0xa')](_0x9e48('0x14'),auth[_0x9e48('0x8')](),controller['getLists']);router['get'](_0x9e48('0x15'),auth[_0x9e48('0x8')](),controller['getBlackLists']);router['post']('/',auth[_0x9e48('0x8')](),controller['create']);router[_0x9e48('0x16')]('/:id/clone',auth[_0x9e48('0x8')](),controller[_0x9e48('0x17')]);router[_0x9e48('0x16')](_0x9e48('0x14'),auth['isAuthenticated'](),controller[_0x9e48('0x18')]);router[_0x9e48('0x16')]('/:id/blacklists',auth[_0x9e48('0x8')](),controller[_0x9e48('0x19')]);router[_0x9e48('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x9e48('0x1b')]);router[_0x9e48('0x1c')](_0x9e48('0xb'),auth['isAuthenticated'](),controller[_0x9e48('0x1d')]);router['delete']('/:id/lists',auth[_0x9e48('0x8')](),controller[_0x9e48('0x1e')]);router[_0x9e48('0x1c')](_0x9e48('0x15'),auth[_0x9e48('0x8')](),controller['removeBlackLists']);module[_0x9e48('0x1f')]=router; \ No newline at end of file +var _0x76c6=['getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','put','update','delete','removeLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black'];(function(_0x1364ef,_0x14c8b4){var _0x2b6e2a=function(_0x43376b){while(--_0x43376b){_0x1364ef['push'](_0x1364ef['shift']());}};_0x2b6e2a(++_0x14c8b4);}(_0x76c6,0x12f));var _0x676c=function(_0x3fd91f,_0x24a033){_0x3fd91f=_0x3fd91f-0x0;var _0x10a826=_0x76c6[_0x3fd91f];return _0x10a826;};'use strict';var multer=require('multer');var util=require(_0x676c('0x0'));var path=require(_0x676c('0x1'));var timeout=require(_0x676c('0x2'));var express=require(_0x676c('0x3'));var router=express[_0x676c('0x4')]();var fs_extra=require(_0x676c('0x5'));var auth=require(_0x676c('0x6'));var interaction=require(_0x676c('0x7'));var config=require('../../config/environment');var controller=require(_0x676c('0x8'));router['get']('/',auth[_0x676c('0x9')](),controller[_0x676c('0xa')]);router[_0x676c('0xb')](_0x676c('0xc'),auth[_0x676c('0x9')](),controller[_0x676c('0xd')]);router[_0x676c('0xb')](_0x676c('0xe'),auth[_0x676c('0x9')](),controller[_0x676c('0xf')]);router[_0x676c('0xb')](_0x676c('0x10'),auth[_0x676c('0x9')](),controller[_0x676c('0x11')]);router[_0x676c('0xb')](_0x676c('0x12'),auth[_0x676c('0x9')](),controller[_0x676c('0x13')]);router[_0x676c('0xb')](_0x676c('0x14'),auth[_0x676c('0x9')](),controller[_0x676c('0x15')]);router[_0x676c('0xb')]('/:id/lists',auth[_0x676c('0x9')](),controller[_0x676c('0x16')]);router['get'](_0x676c('0x17'),auth[_0x676c('0x9')](),controller[_0x676c('0x18')]);router[_0x676c('0x19')]('/',auth[_0x676c('0x9')](),controller[_0x676c('0x1a')]);router[_0x676c('0x19')](_0x676c('0x1b'),auth['isAuthenticated'](),controller[_0x676c('0x1c')]);router[_0x676c('0x19')](_0x676c('0x1d'),auth[_0x676c('0x9')](),controller[_0x676c('0x1e')]);router[_0x676c('0x19')](_0x676c('0x17'),auth[_0x676c('0x9')](),controller['addBlackLists']);router[_0x676c('0x1f')]('/:id',auth[_0x676c('0x9')](),controller[_0x676c('0x20')]);router[_0x676c('0x21')](_0x676c('0xc'),auth[_0x676c('0x9')](),controller['destroy']);router[_0x676c('0x21')](_0x676c('0x1d'),auth[_0x676c('0x9')](),controller[_0x676c('0x22')]);router[_0x676c('0x21')](_0x676c('0x17'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x676c('0x23')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 8d2cf83..27e866d 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 _0x3d4b=['exports','STRING','TEXT','VIRTUAL','key','sequelize'];(function(_0x15df79,_0x28a338){var _0x2893bb=function(_0x1afc4e){while(--_0x1afc4e){_0x15df79['push'](_0x15df79['shift']());}};_0x2893bb(++_0x28a338);}(_0x3d4b,0xfb));var _0xb3d4=function(_0x41911d,_0x4594b7){_0x41911d=_0x41911d-0x0;var _0x468552=_0x3d4b[_0x41911d];return _0x468552;};'use strict';var Sequelize=require(_0xb3d4('0x0'));module[_0xb3d4('0x1')]={'key':{'type':Sequelize[_0xb3d4('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb3d4('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xb3d4('0x2')]},'name':{'type':Sequelize[_0xb3d4('0x4')],'get':function(){return this['getDataValue'](_0xb3d4('0x5'));}}}; \ No newline at end of file +var _0xf123=['key','sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0xf123,0x190));var _0x3f12=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0xf123[_0x47a40b];return _0x19610c;};'use strict';var Sequelize=require(_0x3f12('0x0'));module[_0x3f12('0x1')]={'key':{'type':Sequelize[_0x3f12('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x3f12('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x3f12('0x4')],'get':function(){return this[_0x3f12('0x5')](_0x3f12('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 17668e3..92ffa54 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 _0x98e1=['save','update','then','destroy','get','error','stack','send','index','map','CannedAnswer','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','keys','include','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','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','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x24bcfa,_0x28f907){var _0x422b13=function(_0x56bb99){while(--_0x56bb99){_0x24bcfa['push'](_0x24bcfa['shift']());}};_0x422b13(++_0x28f907);}(_0x98e1,0x95));var _0x198e=function(_0x4cea81,_0x501ba4){_0x4cea81=_0x4cea81-0x0;var _0x1af84e=_0x98e1[_0x4cea81];return _0x1af84e;};'use strict';var emlformat=require(_0x198e('0x0'));var rimraf=require(_0x198e('0x1'));var zipdir=require(_0x198e('0x2'));var jsonpatch=require(_0x198e('0x3'));var rp=require('request-promise');var moment=require(_0x198e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x198e('0x5'));var util=require(_0x198e('0x6'));var path=require(_0x198e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x198e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x198e('0x9'));var crypto=require(_0x198e('0xa'));var jsforce=require(_0x198e('0xb'));var deskjs=require(_0x198e('0xc'));var toCsv=require(_0x198e('0xd'));var querystring=require(_0x198e('0xe'));var Papa=require(_0x198e('0xf'));var Redis=require(_0x198e('0x10'));var authService=require(_0x198e('0x11'));var qs=require(_0x198e('0x12'));var as=require(_0x198e('0x13'));var hardwareService=require(_0x198e('0x14'));var logger=require(_0x198e('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x198e('0x16'))['db'];function respondWithStatusCode(_0x2fa56,_0x952d31){_0x952d31=_0x952d31||0xcc;return function(_0x5879fc){if(_0x5879fc){return _0x2fa56[_0x198e('0x17')](_0x952d31);}return _0x2fa56[_0x198e('0x18')](_0x952d31)[_0x198e('0x19')]();};}function respondWithResult(_0x269e33,_0x5c845a){_0x5c845a=_0x5c845a||0xc8;return function(_0x130973){if(_0x130973){return _0x269e33[_0x198e('0x18')](_0x5c845a)['json'](_0x130973);}};}function respondWithFilteredResult(_0x48c708,_0x3a6d71){return function(_0x53239e){if(_0x53239e){var _0x1771d1=typeof _0x3a6d71[_0x198e('0x1a')]===_0x198e('0x1b')&&typeof _0x3a6d71[_0x198e('0x1c')]===_0x198e('0x1b');var _0x5837d0=_0x53239e[_0x198e('0x1d')];var _0x5972aa=_0x1771d1?0x0:_0x3a6d71[_0x198e('0x1a')];var _0x4a942e=_0x1771d1?_0x53239e[_0x198e('0x1d')]:_0x3a6d71[_0x198e('0x1a')]+_0x3a6d71['limit'];var _0x629c84;if(_0x4a942e>=_0x5837d0){_0x4a942e=_0x5837d0;_0x629c84=0xc8;}else{_0x629c84=0xce;}_0x48c708[_0x198e('0x18')](_0x629c84);return _0x48c708[_0x198e('0x1e')](_0x198e('0x1f'),_0x5972aa+'-'+_0x4a942e+'/'+_0x5837d0)[_0x198e('0x20')](_0x53239e);}return null;};}function patchUpdates(_0x1630e1){return function(_0x5475de){try{jsonpatch[_0x198e('0x21')](_0x5475de,_0x1630e1,!![]);}catch(_0x281150){return BPromise[_0x198e('0x22')](_0x281150);}return _0x5475de[_0x198e('0x23')]();};}function saveUpdates(_0x3ea034,_0x25cf3f){return function(_0x4cd022){if(_0x4cd022){return _0x4cd022[_0x198e('0x24')](_0x3ea034)[_0x198e('0x25')](function(_0x5b7756){return _0x5b7756;});}return null;};}function removeEntity(_0xeea785,_0x526e07){return function(_0x1d02f4){if(_0x1d02f4){return _0x1d02f4[_0x198e('0x26')]()['then'](function(){var _0x4757f6=_0x1d02f4[_0x198e('0x27')]({'plain':!![]});var _0x52a20a='CannedAnswers';return db['UserProfileResource']['destroy']({'where':{'type':_0x52a20a,'resourceId':_0x4757f6['id']}})[_0x198e('0x25')](function(){return _0x1d02f4;});})[_0x198e('0x25')](function(){_0xeea785[_0x198e('0x18')](0xcc)[_0x198e('0x19')]();});}};}function handleEntityNotFound(_0x3ef046,_0xa0abe2){return function(_0x286344){if(!_0x286344){_0x3ef046['sendStatus'](0x194);}return _0x286344;};}function handleError(_0x447700,_0xd4c996){_0xd4c996=_0xd4c996||0x1f4;return function(_0x247ca3){logger[_0x198e('0x28')](_0x247ca3[_0x198e('0x29')]);if(_0x247ca3['name']){delete _0x247ca3['name'];}_0x447700[_0x198e('0x18')](_0xd4c996)[_0x198e('0x2a')](_0x247ca3);};}exports[_0x198e('0x2b')]=function(_0x3453c5,_0x40d0ca){var _0x17835b={},_0xd6138c={},_0x38f281={'count':0x0,'rows':[]};var _0xf4bdb1=_[_0x198e('0x2c')](db[_0x198e('0x2d')][_0x198e('0x2e')],function(_0x2dbfcb){return{'name':_0x2dbfcb['fieldName'],'type':_0x2dbfcb[_0x198e('0x2f')][_0x198e('0x30')]};});_0xd6138c[_0x198e('0x31')]=_[_0x198e('0x2c')](_0xf4bdb1,_0x198e('0x32'));_0xd6138c[_0x198e('0x33')]=_['keys'](_0x3453c5['query']);_0xd6138c[_0x198e('0x34')]=_[_0x198e('0x35')](_0xd6138c[_0x198e('0x31')],_0xd6138c['query']);_0x17835b[_0x198e('0x36')]=_[_0x198e('0x35')](_0xd6138c[_0x198e('0x31')],qs[_0x198e('0x37')](_0x3453c5[_0x198e('0x33')]['fields']));_0x17835b[_0x198e('0x36')]=_0x17835b['attributes'][_0x198e('0x38')]?_0x17835b[_0x198e('0x36')]:_0xd6138c['model'];if(!_0x3453c5[_0x198e('0x33')][_0x198e('0x39')](_0x198e('0x3a'))){_0x17835b[_0x198e('0x1c')]=qs[_0x198e('0x1c')](_0x3453c5['query'][_0x198e('0x1c')]);_0x17835b['offset']=qs[_0x198e('0x1a')](_0x3453c5[_0x198e('0x33')][_0x198e('0x1a')]);}_0x17835b[_0x198e('0x3b')]=qs[_0x198e('0x3c')](_0x3453c5[_0x198e('0x33')][_0x198e('0x3c')]);_0x17835b[_0x198e('0x3d')]=qs['filters'](_[_0x198e('0x3e')](_0x3453c5[_0x198e('0x33')],_0xd6138c[_0x198e('0x34')]),_0xf4bdb1);if(_0x3453c5[_0x198e('0x33')]['filter']){_0x17835b[_0x198e('0x3d')]=_['merge'](_0x17835b['where'],{'$or':[{'key':{'$like':'%'+_0x3453c5['query']['filter']+'%'}},{'value':{'$like':'%'+_0x3453c5[_0x198e('0x33')][_0x198e('0x3f')]+'%'}}]});}_0x17835b=_[_0x198e('0x40')]({},_0x17835b,_0x3453c5['options']);var _0x66e9e8={'where':_0x17835b[_0x198e('0x3d')]};return db['CannedAnswer'][_0x198e('0x1d')](_0x66e9e8)[_0x198e('0x25')](function(_0xdac0ec){_0x38f281['count']=_0xdac0ec;if(_0x3453c5[_0x198e('0x33')][_0x198e('0x41')]){_0x17835b['include']=[{'all':!![]}];}return db[_0x198e('0x2d')][_0x198e('0x42')](_0x17835b);})[_0x198e('0x25')](function(_0x5e505a){_0x38f281[_0x198e('0x43')]=_0x5e505a;return _0x38f281;})['then'](respondWithFilteredResult(_0x40d0ca,_0x17835b))[_0x198e('0x44')](handleError(_0x40d0ca,null));};exports[_0x198e('0x45')]=function(_0x38ccfc,_0x3d3306){var _0x562ee5={'raw':!![],'where':{'id':_0x38ccfc[_0x198e('0x46')]['id']}},_0x4a8da3={};_0x4a8da3[_0x198e('0x31')]=_[_0x198e('0x47')](db[_0x198e('0x2d')][_0x198e('0x2e')]);_0x4a8da3['query']=_[_0x198e('0x47')](_0x38ccfc[_0x198e('0x33')]);_0x4a8da3[_0x198e('0x34')]=_['intersection'](_0x4a8da3[_0x198e('0x31')],_0x4a8da3[_0x198e('0x33')]);_0x562ee5[_0x198e('0x36')]=_[_0x198e('0x35')](_0x4a8da3['model'],qs['fields'](_0x38ccfc['query'][_0x198e('0x37')]));_0x562ee5[_0x198e('0x36')]=_0x562ee5['attributes'][_0x198e('0x38')]?_0x562ee5[_0x198e('0x36')]:_0x4a8da3['model'];if(_0x38ccfc['query'][_0x198e('0x41')]){_0x562ee5[_0x198e('0x48')]=[{'all':!![]}];}_0x562ee5=_[_0x198e('0x40')]({},_0x562ee5,_0x38ccfc[_0x198e('0x49')]);return db[_0x198e('0x2d')][_0x198e('0x4a')](_0x562ee5)['then'](handleEntityNotFound(_0x3d3306,null))[_0x198e('0x25')](respondWithResult(_0x3d3306,null))[_0x198e('0x44')](handleError(_0x3d3306,null));};exports[_0x198e('0x24')]=function(_0x288915,_0x335d00){if(_0x288915[_0x198e('0x4b')]['id']){delete _0x288915['body']['id'];}return db[_0x198e('0x2d')]['find']({'where':{'id':_0x288915[_0x198e('0x46')]['id']}})[_0x198e('0x25')](handleEntityNotFound(_0x335d00,null))[_0x198e('0x25')](saveUpdates(_0x288915['body'],null))[_0x198e('0x25')](respondWithResult(_0x335d00,null))['catch'](handleError(_0x335d00,null));};exports[_0x198e('0x26')]=function(_0x4ac547,_0x1607a3){return db['CannedAnswer']['find']({'where':{'id':_0x4ac547[_0x198e('0x46')]['id']}})[_0x198e('0x25')](handleEntityNotFound(_0x1607a3,null))[_0x198e('0x25')](removeEntity(_0x1607a3,null))[_0x198e('0x44')](handleError(_0x1607a3,null));};exports[_0x198e('0x4c')]=function(_0x50dbb9,_0x27ea79){var _0x1c782c={'key':_0x50dbb9[_0x198e('0x4b')]['key']};if(_0x50dbb9[_0x198e('0x4b')]['MailAccountId']){_0x1c782c[_0x198e('0x4d')]=_0x50dbb9[_0x198e('0x4b')][_0x198e('0x4d')];}else if(_0x50dbb9[_0x198e('0x4b')]['SmsAccountId']){_0x1c782c[_0x198e('0x4e')]=_0x50dbb9[_0x198e('0x4b')][_0x198e('0x4e')];}else if(_0x50dbb9['body']['OpenchannelAccountId']){_0x1c782c['OpenchannelAccountId']=_0x50dbb9['body'][_0x198e('0x4f')];}else if(_0x50dbb9[_0x198e('0x4b')][_0x198e('0x50')]){_0x1c782c[_0x198e('0x50')]=_0x50dbb9[_0x198e('0x4b')][_0x198e('0x50')];}return db[_0x198e('0x2d')][_0x198e('0x4a')]({'where':_0x1c782c})[_0x198e('0x25')](function(_0x296932){if(_0x296932){throw new db[(_0x198e('0x51'))][(_0x198e('0x52'))](_0x198e('0x53'));}return db[_0x198e('0x2d')][_0x198e('0x4c')](_0x50dbb9[_0x198e('0x4b')]);})[_0x198e('0x25')](function(_0x2513ef){var _0x4aaf66=_0x50dbb9[_0x198e('0x54')][_0x198e('0x27')]({'plain':!![]});if(!_0x4aaf66)throw new Error(_0x198e('0x55'));if(_0x4aaf66[_0x198e('0x56')]===_0x198e('0x54')){var _0x25fbcd=_0x2513ef['get']({'plain':!![]});return db[_0x198e('0x57')][_0x198e('0x4a')]({'where':{'name':_0x198e('0x58'),'userProfileId':_0x4aaf66[_0x198e('0x59')]},'raw':!![]})[_0x198e('0x25')](function(_0x234b1c){if(_0x234b1c&&_0x234b1c[_0x198e('0x5a')]===0x0){return db[_0x198e('0x5b')][_0x198e('0x4c')]({'name':_0x25fbcd[_0x198e('0x32')],'resourceId':_0x25fbcd['id'],'type':_0x234b1c['name'],'sectionId':_0x234b1c['id']},{})[_0x198e('0x25')](function(){return _0x2513ef;});}else{return _0x2513ef;}})['catch'](function(_0x570d3f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x570d3f);throw _0x570d3f;});}return _0x2513ef;})[_0x198e('0x25')](respondWithResult(_0x27ea79,0xc9))[_0x198e('0x44')](handleError(_0x27ea79,null));}; \ No newline at end of file +var _0x1d3d=['sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','mustache','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/license/util','sendStatus','end','undefined','limit','offset','count','status','set','Content-Range','json','apply','save','update','then','CannedAnswers','UserProfileResource','error','name','send','CannedAnswer','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x42871b,_0x50738e){var _0x14999c=function(_0x2eba58){while(--_0x2eba58){_0x42871b['push'](_0x42871b['shift']());}};_0x14999c(++_0x50738e);}(_0x1d3d,0xc6));var _0xd1d3=function(_0x5132e6,_0x5b0574){_0x5132e6=_0x5132e6-0x0;var _0x3cb11b=_0x1d3d[_0x5132e6];return _0x3cb11b;};'use strict';var emlformat=require(_0xd1d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd1d3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd1d3('0x2'));var moment=require(_0xd1d3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd1d3('0x4'));var util=require('util');var path=require('path');var sox=require(_0xd1d3('0x5'));var csv=require(_0xd1d3('0x6'));var ejs=require(_0xd1d3('0x7'));var fs=require('fs');var fs_extra=require(_0xd1d3('0x8'));var _=require(_0xd1d3('0x9'));var squel=require(_0xd1d3('0xa'));var crypto=require(_0xd1d3('0xb'));var jsforce=require(_0xd1d3('0xc'));var deskjs=require(_0xd1d3('0xd'));var toCsv=require(_0xd1d3('0x6'));var querystring=require(_0xd1d3('0xe'));var Papa=require(_0xd1d3('0xf'));var Redis=require('ioredis');var authService=require(_0xd1d3('0x10'));var qs=require(_0xd1d3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd1d3('0x12'));var logger=require(_0xd1d3('0x13'))(_0xd1d3('0x14'));var utils=require(_0xd1d3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd1d3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x239e73,_0x4bf5cb){_0x4bf5cb=_0x4bf5cb||0xcc;return function(_0x2afe27){if(_0x2afe27){return _0x239e73[_0xd1d3('0x17')](_0x4bf5cb);}return _0x239e73['status'](_0x4bf5cb)[_0xd1d3('0x18')]();};}function respondWithResult(_0x9acc7e,_0x5df183){_0x5df183=_0x5df183||0xc8;return function(_0x5ce834){if(_0x5ce834){return _0x9acc7e['status'](_0x5df183)['json'](_0x5ce834);}};}function respondWithFilteredResult(_0xe8c224,_0x58da4c){return function(_0x36aca2){if(_0x36aca2){var _0x3da955=typeof _0x58da4c['offset']===_0xd1d3('0x19')&&typeof _0x58da4c[_0xd1d3('0x1a')]==='undefined';var _0x2fb45c=_0x36aca2['count'];var _0x15335d=_0x3da955?0x0:_0x58da4c[_0xd1d3('0x1b')];var _0x11c533=_0x3da955?_0x36aca2[_0xd1d3('0x1c')]:_0x58da4c[_0xd1d3('0x1b')]+_0x58da4c['limit'];var _0xba92c1;if(_0x11c533>=_0x2fb45c){_0x11c533=_0x2fb45c;_0xba92c1=0xc8;}else{_0xba92c1=0xce;}_0xe8c224[_0xd1d3('0x1d')](_0xba92c1);return _0xe8c224[_0xd1d3('0x1e')](_0xd1d3('0x1f'),_0x15335d+'-'+_0x11c533+'/'+_0x2fb45c)[_0xd1d3('0x20')](_0x36aca2);}return null;};}function patchUpdates(_0x4cf1a1){return function(_0x96615b){try{jsonpatch[_0xd1d3('0x21')](_0x96615b,_0x4cf1a1,!![]);}catch(_0x152181){return BPromise['reject'](_0x152181);}return _0x96615b[_0xd1d3('0x22')]();};}function saveUpdates(_0x464503,_0x4c2802){return function(_0x4cee9e){if(_0x4cee9e){return _0x4cee9e[_0xd1d3('0x23')](_0x464503)[_0xd1d3('0x24')](function(_0x979dcf){return _0x979dcf;});}return null;};}function removeEntity(_0x3b0f86,_0x4875fe){return function(_0xe1ba20){if(_0xe1ba20){return _0xe1ba20['destroy']()[_0xd1d3('0x24')](function(){var _0x12ad98=_0xe1ba20['get']({'plain':!![]});var _0x271fcd=_0xd1d3('0x25');return db[_0xd1d3('0x26')]['destroy']({'where':{'type':_0x271fcd,'resourceId':_0x12ad98['id']}})[_0xd1d3('0x24')](function(){return _0xe1ba20;});})[_0xd1d3('0x24')](function(){_0x3b0f86[_0xd1d3('0x1d')](0xcc)[_0xd1d3('0x18')]();});}};}function handleEntityNotFound(_0x5a78ed,_0x2f6072){return function(_0x42fe24){if(!_0x42fe24){_0x5a78ed['sendStatus'](0x194);}return _0x42fe24;};}function handleError(_0x5d3bf3,_0x1bc478){_0x1bc478=_0x1bc478||0x1f4;return function(_0x2e4194){logger[_0xd1d3('0x27')](_0x2e4194['stack']);if(_0x2e4194[_0xd1d3('0x28')]){delete _0x2e4194[_0xd1d3('0x28')];}_0x5d3bf3[_0xd1d3('0x1d')](_0x1bc478)[_0xd1d3('0x29')](_0x2e4194);};}exports['index']=function(_0x5b6a2e,_0x368e49){var _0x142cc1={},_0x67c928={},_0x4d7a2b={'count':0x0,'rows':[]};var _0x1c7dc1=_['map'](db[_0xd1d3('0x2a')]['rawAttributes'],function(_0x4f0b51){return{'name':_0x4f0b51[_0xd1d3('0x2b')],'type':_0x4f0b51[_0xd1d3('0x2c')][_0xd1d3('0x2d')]};});_0x67c928[_0xd1d3('0x2e')]=_[_0xd1d3('0x2f')](_0x1c7dc1,'name');_0x67c928[_0xd1d3('0x30')]=_[_0xd1d3('0x31')](_0x5b6a2e['query']);_0x67c928[_0xd1d3('0x32')]=_[_0xd1d3('0x33')](_0x67c928[_0xd1d3('0x2e')],_0x67c928[_0xd1d3('0x30')]);_0x142cc1[_0xd1d3('0x34')]=_[_0xd1d3('0x33')](_0x67c928[_0xd1d3('0x2e')],qs[_0xd1d3('0x35')](_0x5b6a2e[_0xd1d3('0x30')]['fields']));_0x142cc1['attributes']=_0x142cc1[_0xd1d3('0x34')][_0xd1d3('0x36')]?_0x142cc1['attributes']:_0x67c928['model'];if(!_0x5b6a2e[_0xd1d3('0x30')]['hasOwnProperty'](_0xd1d3('0x37'))){_0x142cc1[_0xd1d3('0x1a')]=qs[_0xd1d3('0x1a')](_0x5b6a2e[_0xd1d3('0x30')][_0xd1d3('0x1a')]);_0x142cc1[_0xd1d3('0x1b')]=qs[_0xd1d3('0x1b')](_0x5b6a2e[_0xd1d3('0x30')][_0xd1d3('0x1b')]);}_0x142cc1[_0xd1d3('0x38')]=qs[_0xd1d3('0x39')](_0x5b6a2e['query'][_0xd1d3('0x39')]);_0x142cc1[_0xd1d3('0x3a')]=qs[_0xd1d3('0x32')](_[_0xd1d3('0x3b')](_0x5b6a2e[_0xd1d3('0x30')],_0x67c928[_0xd1d3('0x32')]),_0x1c7dc1);if(_0x5b6a2e[_0xd1d3('0x30')][_0xd1d3('0x3c')]){_0x142cc1[_0xd1d3('0x3a')]=_[_0xd1d3('0x3d')](_0x142cc1[_0xd1d3('0x3a')],{'$or':[{'key':{'$like':'%'+_0x5b6a2e['query'][_0xd1d3('0x3c')]+'%'}},{'value':{'$like':'%'+_0x5b6a2e['query'][_0xd1d3('0x3c')]+'%'}}]});}_0x142cc1=_[_0xd1d3('0x3d')]({},_0x142cc1,_0x5b6a2e[_0xd1d3('0x3e')]);var _0xb0a468={'where':_0x142cc1[_0xd1d3('0x3a')]};return db['CannedAnswer'][_0xd1d3('0x1c')](_0xb0a468)[_0xd1d3('0x24')](function(_0x50b732){_0x4d7a2b['count']=_0x50b732;if(_0x5b6a2e['query'][_0xd1d3('0x3f')]){_0x142cc1[_0xd1d3('0x40')]=[{'all':!![]}];}return db[_0xd1d3('0x2a')][_0xd1d3('0x41')](_0x142cc1);})[_0xd1d3('0x24')](function(_0xb32da1){_0x4d7a2b[_0xd1d3('0x42')]=_0xb32da1;return _0x4d7a2b;})[_0xd1d3('0x24')](respondWithFilteredResult(_0x368e49,_0x142cc1))[_0xd1d3('0x43')](handleError(_0x368e49,null));};exports[_0xd1d3('0x44')]=function(_0x395f39,_0x5d1b1a){var _0xe287fb={'raw':!![],'where':{'id':_0x395f39[_0xd1d3('0x45')]['id']}},_0x3d5e36={};_0x3d5e36[_0xd1d3('0x2e')]=_[_0xd1d3('0x31')](db[_0xd1d3('0x2a')]['rawAttributes']);_0x3d5e36[_0xd1d3('0x30')]=_[_0xd1d3('0x31')](_0x395f39[_0xd1d3('0x30')]);_0x3d5e36[_0xd1d3('0x32')]=_[_0xd1d3('0x33')](_0x3d5e36[_0xd1d3('0x2e')],_0x3d5e36[_0xd1d3('0x30')]);_0xe287fb[_0xd1d3('0x34')]=_[_0xd1d3('0x33')](_0x3d5e36['model'],qs[_0xd1d3('0x35')](_0x395f39[_0xd1d3('0x30')][_0xd1d3('0x35')]));_0xe287fb[_0xd1d3('0x34')]=_0xe287fb[_0xd1d3('0x34')][_0xd1d3('0x36')]?_0xe287fb[_0xd1d3('0x34')]:_0x3d5e36[_0xd1d3('0x2e')];if(_0x395f39[_0xd1d3('0x30')]['includeAll']){_0xe287fb[_0xd1d3('0x40')]=[{'all':!![]}];}_0xe287fb=_['merge']({},_0xe287fb,_0x395f39[_0xd1d3('0x3e')]);return db['CannedAnswer']['find'](_0xe287fb)[_0xd1d3('0x24')](handleEntityNotFound(_0x5d1b1a,null))[_0xd1d3('0x24')](respondWithResult(_0x5d1b1a,null))['catch'](handleError(_0x5d1b1a,null));};exports[_0xd1d3('0x23')]=function(_0x23960b,_0x1bf47b){if(_0x23960b['body']['id']){delete _0x23960b['body']['id'];}return db[_0xd1d3('0x2a')][_0xd1d3('0x46')]({'where':{'id':_0x23960b['params']['id']}})[_0xd1d3('0x24')](handleEntityNotFound(_0x1bf47b,null))[_0xd1d3('0x24')](saveUpdates(_0x23960b[_0xd1d3('0x47')],null))[_0xd1d3('0x24')](respondWithResult(_0x1bf47b,null))[_0xd1d3('0x43')](handleError(_0x1bf47b,null));};exports[_0xd1d3('0x48')]=function(_0x5cbc43,_0x191c41){return db[_0xd1d3('0x2a')]['find']({'where':{'id':_0x5cbc43[_0xd1d3('0x45')]['id']}})[_0xd1d3('0x24')](handleEntityNotFound(_0x191c41,null))[_0xd1d3('0x24')](removeEntity(_0x191c41,null))['catch'](handleError(_0x191c41,null));};exports[_0xd1d3('0x49')]=function(_0x165ca6,_0x595e85){var _0x14bdc2={'key':_0x165ca6[_0xd1d3('0x47')]['key']};if(_0x165ca6[_0xd1d3('0x47')]['MailAccountId']){_0x14bdc2[_0xd1d3('0x4a')]=_0x165ca6['body'][_0xd1d3('0x4a')];}else if(_0x165ca6[_0xd1d3('0x47')][_0xd1d3('0x4b')]){_0x14bdc2[_0xd1d3('0x4b')]=_0x165ca6[_0xd1d3('0x47')]['SmsAccountId'];}else if(_0x165ca6['body'][_0xd1d3('0x4c')]){_0x14bdc2['OpenchannelAccountId']=_0x165ca6[_0xd1d3('0x47')][_0xd1d3('0x4c')];}else if(_0x165ca6[_0xd1d3('0x47')]['ChatWebsiteId']){_0x14bdc2[_0xd1d3('0x4d')]=_0x165ca6[_0xd1d3('0x47')][_0xd1d3('0x4d')];}return db[_0xd1d3('0x2a')]['find']({'where':_0x14bdc2})['then'](function(_0x51e755){if(_0x51e755){throw new db['Sequelize'][(_0xd1d3('0x4e'))](_0xd1d3('0x4f'));}return db[_0xd1d3('0x2a')]['create'](_0x165ca6[_0xd1d3('0x47')]);})[_0xd1d3('0x24')](function(_0x29e916){var _0xd597d=_0x165ca6['user']['get']({'plain':!![]});if(!_0xd597d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd597d[_0xd1d3('0x50')]==='user'){var _0x3a80b6=_0x29e916[_0xd1d3('0x51')]({'plain':!![]});return db['UserProfileSection'][_0xd1d3('0x46')]({'where':{'name':_0xd1d3('0x25'),'userProfileId':_0xd597d[_0xd1d3('0x52')]},'raw':!![]})['then'](function(_0x2f02e9){if(_0x2f02e9&&_0x2f02e9[_0xd1d3('0x53')]===0x0){return db[_0xd1d3('0x26')][_0xd1d3('0x49')]({'name':_0x3a80b6['name'],'resourceId':_0x3a80b6['id'],'type':_0x2f02e9[_0xd1d3('0x28')],'sectionId':_0x2f02e9['id']},{})[_0xd1d3('0x24')](function(){return _0x29e916;});}else{return _0x29e916;}})['catch'](function(_0x4e4d24){logger[_0xd1d3('0x27')](_0xd1d3('0x54'),_0x4e4d24);throw _0x4e4d24;});}return _0x29e916;})[_0xd1d3('0x24')](respondWithResult(_0x595e85,0xc9))[_0xd1d3('0x43')](handleError(_0x595e85,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index b4484ba..d200528 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 _0xdc81=['bluebird','request-promise','rimraf','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x4dcbdd,_0x515c1b){var _0x13738a=function(_0x410a96){while(--_0x410a96){_0x4dcbdd['push'](_0x4dcbdd['shift']());}};_0x13738a(++_0x515c1b);}(_0xdc81,0x75));var _0x1dc8=function(_0x344669,_0x12d0e4){_0x344669=_0x344669-0x0;var _0x4d1457=_0xdc81[_0x344669];return _0x4d1457;};'use strict';var _=require(_0x1dc8('0x0'));var util=require(_0x1dc8('0x1'));var logger=require(_0x1dc8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1dc8('0x3'));var rp=require(_0x1dc8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1dc8('0x5'));var config=require('../../config/environment');var attributes=require(_0x1dc8('0x6'));module['exports']=function(_0x30d961,_0x384cca){return _0x30d961[_0x1dc8('0x7')](_0x1dc8('0x8'),attributes,{'tableName':_0x1dc8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1dc8('0xa'),'collate':_0x1dc8('0xb')});}; \ No newline at end of file +var _0xcd6a=['utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','./cannedAnswer.attributes','exports','CannedAnswer','utf8mb4'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcd6a,0xa6));var _0xacd6=function(_0x361b1b,_0x56af5b){_0x361b1b=_0x361b1b-0x0;var _0x17c591=_0xcd6a[_0x361b1b];return _0x17c591;};'use strict';var _=require('lodash');var util=require(_0xacd6('0x0'));var logger=require(_0xacd6('0x1'))(_0xacd6('0x2'));var moment=require('moment');var BPromise=require(_0xacd6('0x3'));var rp=require(_0xacd6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xacd6('0x5'));var config=require('../../config/environment');var attributes=require(_0xacd6('0x6'));module[_0xacd6('0x7')]=function(_0x18eeb4,_0x572297){return _0x18eeb4['define'](_0xacd6('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xacd6('0x9'),'collate':_0xacd6('0xa')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 490d2ae..61373ba 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(_0x464189,_0xf2ad38){var _0x533af7=function(_0x366c84){while(--_0x366c84){_0x464189['push'](_0x464189['shift']());}};_0x533af7(++_0xf2ad38);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x73de58,_0x373667){var _0x47fe5b=function(_0x32fdb5){while(--_0x32fdb5){_0x73de58['push'](_0x73de58['shift']());}};_0x47fe5b(++_0x373667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 0d64070..fe7a40b 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 _0xa378=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xa378,0xc1));var _0x8a37=function(_0x559322,_0x32938f){_0x559322=_0x559322-0x0;var _0x4caf3e=_0xa378[_0x559322];return _0x4caf3e;};'use strict';var multer=require(_0x8a37('0x0'));var util=require(_0x8a37('0x1'));var path=require(_0x8a37('0x2'));var timeout=require(_0x8a37('0x3'));var express=require(_0x8a37('0x4'));var router=express[_0x8a37('0x5')]();var fs_extra=require(_0x8a37('0x6'));var auth=require(_0x8a37('0x7'));var interaction=require(_0x8a37('0x8'));var config=require(_0x8a37('0x9'));var controller=require(_0x8a37('0xa'));router[_0x8a37('0xb')]('/',auth[_0x8a37('0xc')](),controller[_0x8a37('0xd')]);router[_0x8a37('0xb')](_0x8a37('0xe'),auth[_0x8a37('0xc')](),controller[_0x8a37('0xf')]);router['post']('/',auth[_0x8a37('0xc')](),controller[_0x8a37('0x10')]);router[_0x8a37('0x11')](_0x8a37('0xe'),auth['isAuthenticated'](),controller[_0x8a37('0x12')]);router[_0x8a37('0x13')](_0x8a37('0xe'),auth[_0x8a37('0xc')](),controller[_0x8a37('0x14')]);module['exports']=router; \ No newline at end of file +var _0x559a=['util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','post','put','update','destroy','exports'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x559a,0x1d1));var _0xa559=function(_0x63cffc,_0x4ff552){_0x63cffc=_0x63cffc-0x0;var _0x2f967b=_0x559a[_0x63cffc];return _0x2f967b;};'use strict';var multer=require('multer');var util=require(_0xa559('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa559('0x1'));var router=express[_0xa559('0x2')]();var fs_extra=require(_0xa559('0x3'));var auth=require(_0xa559('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa559('0x5'));var controller=require(_0xa559('0x6'));router[_0xa559('0x7')]('/',auth[_0xa559('0x8')](),controller['index']);router[_0xa559('0x7')](_0xa559('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xa559('0xa')]('/',auth[_0xa559('0x8')](),controller['create']);router[_0xa559('0xb')](_0xa559('0x9'),auth[_0xa559('0x8')](),controller[_0xa559('0xc')]);router['delete']('/:id',auth[_0xa559('0x8')](),controller[_0xa559('0xd')]);module[_0xa559('0xe')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 8c14070..c8f9073 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 _0x9000=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x1db8ba,_0x1ff844){var _0x140cb3=function(_0xa9dbba){while(--_0xa9dbba){_0x1db8ba['push'](_0x1db8ba['shift']());}};_0x140cb3(++_0x1ff844);}(_0x9000,0x19e));var _0x0900=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0x9000[_0x47a12a];return _0x30cd40;};'use strict';var Sequelize=require(_0x0900('0x0'));module[_0x0900('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x0900('0x2')},'clid':{'type':Sequelize[_0x0900('0x3')]},'src':{'type':Sequelize[_0x0900('0x3')]},'dst':{'type':Sequelize[_0x0900('0x3')]},'dcontext':{'type':Sequelize[_0x0900('0x3')]},'channel':{'type':Sequelize[_0x0900('0x3')]},'dstchannel':{'type':Sequelize[_0x0900('0x3')]},'lastapp':{'type':Sequelize[_0x0900('0x3')]},'lastdata':{'type':Sequelize[_0x0900('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0900('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0900('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0900('0x3')]},'userfield':{'type':Sequelize[_0x0900('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x0900('0x3')]},'peeraccount':{'type':Sequelize[_0x0900('0x3')]},'type':{'type':Sequelize[_0x0900('0x3')]},'tag':{'type':Sequelize[_0x0900('0x3')]}}; \ No newline at end of file +var _0xcea2=['STRING','INTEGER','sequelize','DATE'];(function(_0x3ba6e9,_0x1c7dc7){var _0x2e5a29=function(_0x1ff325){while(--_0x1ff325){_0x3ba6e9['push'](_0x3ba6e9['shift']());}};_0x2e5a29(++_0x1c7dc7);}(_0xcea2,0x15a));var _0x2cea=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xcea2[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0x2cea('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x2cea('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x2cea('0x2')]},'src':{'type':Sequelize[_0x2cea('0x2')]},'dst':{'type':Sequelize[_0x2cea('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2cea('0x2')]},'dstchannel':{'type':Sequelize[_0x2cea('0x2')]},'lastapp':{'type':Sequelize[_0x2cea('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x2cea('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2cea('0x2')]},'amaflags':{'type':Sequelize[_0x2cea('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2cea('0x2')]},'userfield':{'type':Sequelize[_0x2cea('0x2')]},'uniqueid':{'type':Sequelize[_0x2cea('0x2')]},'linkedid':{'type':Sequelize[_0x2cea('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x2cea('0x2')]},'type':{'type':Sequelize[_0x2cea('0x2')]},'tag':{'type':Sequelize[_0x2cea('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index ab402e8..8da0dc9 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 _0x86f4=['bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Cdr','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x28f2d6,_0x57dad5){var _0x4c030b=function(_0x54aa35){while(--_0x54aa35){_0x28f2d6['push'](_0x28f2d6['shift']());}};_0x4c030b(++_0x57dad5);}(_0x86f4,0x18a));var _0x486f=function(_0x4cf9a6,_0x59cde1){_0x4cf9a6=_0x4cf9a6-0x0;var _0x26bc64=_0x86f4[_0x4cf9a6];return _0x26bc64;};'use strict';var emlformat=require(_0x486f('0x0'));var rimraf=require(_0x486f('0x1'));var zipdir=require(_0x486f('0x2'));var jsonpatch=require(_0x486f('0x3'));var rp=require(_0x486f('0x4'));var moment=require(_0x486f('0x5'));var BPromise=require(_0x486f('0x6'));var Mustache=require('mustache');var util=require(_0x486f('0x7'));var path=require(_0x486f('0x8'));var sox=require('sox');var csv=require(_0x486f('0x9'));var ejs=require(_0x486f('0xa'));var fs=require('fs');var fs_extra=require(_0x486f('0xb'));var _=require(_0x486f('0xc'));var squel=require(_0x486f('0xd'));var crypto=require(_0x486f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x486f('0xf'));var toCsv=require(_0x486f('0x9'));var querystring=require(_0x486f('0x10'));var Papa=require(_0x486f('0x11'));var Redis=require(_0x486f('0x12'));var authService=require(_0x486f('0x13'));var qs=require(_0x486f('0x14'));var as=require(_0x486f('0x15'));var hardwareService=require(_0x486f('0x16'));var logger=require(_0x486f('0x17'))(_0x486f('0x18'));var utils=require(_0x486f('0x19'));var config=require(_0x486f('0x1a'));var licenseUtil=require(_0x486f('0x1b'));var db=require(_0x486f('0x1c'))['db'];function respondWithStatusCode(_0x4312fb,_0x1c4e55){_0x1c4e55=_0x1c4e55||0xcc;return function(_0x4eb4f9){if(_0x4eb4f9){return _0x4312fb[_0x486f('0x1d')](_0x1c4e55);}return _0x4312fb['status'](_0x1c4e55)[_0x486f('0x1e')]();};}function respondWithResult(_0x2cc608,_0x1ac871){_0x1ac871=_0x1ac871||0xc8;return function(_0x50bee8){if(_0x50bee8){return _0x2cc608['status'](_0x1ac871)[_0x486f('0x1f')](_0x50bee8);}};}function respondWithFilteredResult(_0x3a4fef,_0x51334f){return function(_0x16830e){if(_0x16830e){var _0x2ab753=typeof _0x51334f[_0x486f('0x20')]==='undefined'&&typeof _0x51334f['limit']===_0x486f('0x21');var _0x3eeae0=_0x16830e[_0x486f('0x22')];var _0x39bfac=_0x2ab753?0x0:_0x51334f['offset'];var _0x59deb8=_0x2ab753?_0x16830e[_0x486f('0x22')]:_0x51334f[_0x486f('0x20')]+_0x51334f[_0x486f('0x23')];var _0x20a1f7;if(_0x59deb8>=_0x3eeae0){_0x59deb8=_0x3eeae0;_0x20a1f7=0xc8;}else{_0x20a1f7=0xce;}_0x3a4fef[_0x486f('0x24')](_0x20a1f7);return _0x3a4fef[_0x486f('0x25')](_0x486f('0x26'),_0x39bfac+'-'+_0x59deb8+'/'+_0x3eeae0)[_0x486f('0x1f')](_0x16830e);}return null;};}function patchUpdates(_0xe0b1cc){return function(_0x3d79bc){try{jsonpatch[_0x486f('0x27')](_0x3d79bc,_0xe0b1cc,!![]);}catch(_0x4ccac0){return BPromise[_0x486f('0x28')](_0x4ccac0);}return _0x3d79bc[_0x486f('0x29')]();};}function saveUpdates(_0x26a909,_0x4a0eb5){return function(_0x4d784e){if(_0x4d784e){return _0x4d784e[_0x486f('0x2a')](_0x26a909)[_0x486f('0x2b')](function(_0x16a530){return _0x16a530;});}return null;};}function removeEntity(_0x14b309,_0x351f81){return function(_0x26822b){if(_0x26822b){return _0x26822b[_0x486f('0x2c')]()[_0x486f('0x2b')](function(){_0x14b309[_0x486f('0x24')](0xcc)[_0x486f('0x1e')]();});}};}function handleEntityNotFound(_0x2e983b,_0x71a26f){return function(_0x387462){if(!_0x387462){_0x2e983b[_0x486f('0x1d')](0x194);}return _0x387462;};}function handleError(_0x8b3277,_0x30b322){_0x30b322=_0x30b322||0x1f4;return function(_0x6f1e8e){logger[_0x486f('0x2d')](_0x6f1e8e[_0x486f('0x2e')]);if(_0x6f1e8e[_0x486f('0x2f')]){delete _0x6f1e8e[_0x486f('0x2f')];}_0x8b3277[_0x486f('0x24')](_0x30b322)['send'](_0x6f1e8e);};}exports['index']=function(_0x52fb3a,_0x5b4718){var _0x173512={},_0x5c994a={},_0x2003a3={'count':0x0,'rows':[]};var _0x3ffa45=_['map'](db[_0x486f('0x30')]['rawAttributes'],function(_0x1f9dee){return{'name':_0x1f9dee[_0x486f('0x31')],'type':_0x1f9dee[_0x486f('0x32')][_0x486f('0x33')]};});_0x5c994a[_0x486f('0x34')]=_[_0x486f('0x35')](_0x3ffa45,'name');_0x5c994a[_0x486f('0x36')]=_[_0x486f('0x37')](_0x52fb3a[_0x486f('0x36')]);_0x5c994a[_0x486f('0x38')]=_[_0x486f('0x39')](_0x5c994a[_0x486f('0x34')],_0x5c994a[_0x486f('0x36')]);_0x173512[_0x486f('0x3a')]=_['intersection'](_0x5c994a[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x52fb3a['query'][_0x486f('0x3b')]));_0x173512[_0x486f('0x3a')]=_0x173512[_0x486f('0x3a')][_0x486f('0x3c')]?_0x173512[_0x486f('0x3a')]:_0x5c994a['model'];if(!_0x52fb3a[_0x486f('0x36')][_0x486f('0x3d')](_0x486f('0x3e'))){_0x173512[_0x486f('0x23')]=qs[_0x486f('0x23')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x23')]);_0x173512['offset']=qs[_0x486f('0x20')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x20')]);}_0x173512['order']=qs['sort'](_0x52fb3a[_0x486f('0x36')][_0x486f('0x3f')]);_0x173512['where']=qs[_0x486f('0x38')](_['pick'](_0x52fb3a[_0x486f('0x36')],_0x5c994a[_0x486f('0x38')]),_0x3ffa45);if(_0x52fb3a['query']['filter']){_0x173512[_0x486f('0x40')]=_[_0x486f('0x41')](_0x173512[_0x486f('0x40')],{'$or':_[_0x486f('0x35')](_0x3ffa45,function(_0xdedd85){if(_0xdedd85[_0x486f('0x32')]!==_0x486f('0x42')){var _0x1742e0={};_0x1742e0[_0xdedd85[_0x486f('0x2f')]]={'$like':'%'+_0x52fb3a[_0x486f('0x36')][_0x486f('0x43')]+'%'};return _0x1742e0;}})});}_0x173512=_[_0x486f('0x41')]({},_0x173512,_0x52fb3a[_0x486f('0x44')]);var _0x43d9be={'where':_0x173512['where']};return db[_0x486f('0x30')][_0x486f('0x22')](_0x43d9be)['then'](function(_0x12f7dc){_0x2003a3[_0x486f('0x22')]=_0x12f7dc;if(_0x52fb3a[_0x486f('0x36')][_0x486f('0x45')]){_0x173512[_0x486f('0x46')]=[{'all':!![]}];}return db[_0x486f('0x30')][_0x486f('0x47')](_0x173512);})[_0x486f('0x2b')](function(_0x3205e0){_0x2003a3['rows']=_0x3205e0;return _0x2003a3;})['then'](respondWithFilteredResult(_0x5b4718,_0x173512))[_0x486f('0x48')](handleError(_0x5b4718,null));};exports[_0x486f('0x49')]=function(_0x3cf897,_0x42ef68){var _0x2937a6={'raw':!![],'where':{'id':_0x3cf897[_0x486f('0x4a')]['id']}},_0x250979={};_0x250979[_0x486f('0x34')]=_[_0x486f('0x37')](db['Cdr'][_0x486f('0x4b')]);_0x250979[_0x486f('0x36')]=_[_0x486f('0x37')](_0x3cf897[_0x486f('0x36')]);_0x250979['filters']=_[_0x486f('0x39')](_0x250979['model'],_0x250979[_0x486f('0x36')]);_0x2937a6[_0x486f('0x3a')]=_[_0x486f('0x39')](_0x250979[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x3cf897[_0x486f('0x36')]['fields']));_0x2937a6['attributes']=_0x2937a6[_0x486f('0x3a')][_0x486f('0x3c')]?_0x2937a6[_0x486f('0x3a')]:_0x250979[_0x486f('0x34')];if(_0x3cf897['query'][_0x486f('0x45')]){_0x2937a6[_0x486f('0x46')]=[{'all':!![]}];}_0x2937a6=_[_0x486f('0x41')]({},_0x2937a6,_0x3cf897['options']);return db[_0x486f('0x30')][_0x486f('0x4c')](_0x2937a6)[_0x486f('0x2b')](handleEntityNotFound(_0x42ef68,null))[_0x486f('0x2b')](respondWithResult(_0x42ef68,null))[_0x486f('0x48')](handleError(_0x42ef68,null));};exports[_0x486f('0x4d')]=function(_0xb65e98,_0x21f222){return db['Cdr'][_0x486f('0x4d')](_0xb65e98['body'],{})[_0x486f('0x2b')](respondWithResult(_0x21f222,0xc9))[_0x486f('0x48')](handleError(_0x21f222,null));};exports[_0x486f('0x2a')]=function(_0x1055cf,_0x34033e){if(_0x1055cf[_0x486f('0x4e')]['id']){delete _0x1055cf['body']['id'];}return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x1055cf[_0x486f('0x4a')]['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x34033e,null))[_0x486f('0x2b')](saveUpdates(_0x1055cf[_0x486f('0x4e')],null))[_0x486f('0x2b')](respondWithResult(_0x34033e,null))[_0x486f('0x48')](handleError(_0x34033e,null));};exports[_0x486f('0x2c')]=function(_0x5cd989,_0x300de9){return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x5cd989['params']['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x300de9,null))[_0x486f('0x2b')](removeEntity(_0x300de9,null))[_0x486f('0x48')](handleError(_0x300de9,null));};exports['describe']=function(_0x195c9c,_0x372d2f){return db[_0x486f('0x30')][_0x486f('0x4f')]()['then'](respondWithResult(_0x372d2f,null))['catch'](handleError(_0x372d2f,null));}; \ No newline at end of file +var _0x31c2=['then','destroy','error','name','send','index','map','Cdr','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update'];(function(_0x3c79d1,_0x1e55d4){var _0x1646e8=function(_0x278dfe){while(--_0x278dfe){_0x3c79d1['push'](_0x3c79d1['shift']());}};_0x1646e8(++_0x1e55d4);}(_0x31c2,0x1e1));var _0x231c=function(_0x5f0810,_0xda9a54){_0x5f0810=_0x5f0810-0x0;var _0x546d16=_0x31c2[_0x5f0810];return _0x546d16;};'use strict';var emlformat=require(_0x231c('0x0'));var rimraf=require(_0x231c('0x1'));var zipdir=require(_0x231c('0x2'));var jsonpatch=require(_0x231c('0x3'));var rp=require(_0x231c('0x4'));var moment=require(_0x231c('0x5'));var BPromise=require(_0x231c('0x6'));var Mustache=require(_0x231c('0x7'));var util=require('util');var path=require('path');var sox=require(_0x231c('0x8'));var csv=require(_0x231c('0x9'));var ejs=require(_0x231c('0xa'));var fs=require('fs');var fs_extra=require(_0x231c('0xb'));var _=require('lodash');var squel=require(_0x231c('0xc'));var crypto=require('crypto');var jsforce=require(_0x231c('0xd'));var deskjs=require(_0x231c('0xe'));var toCsv=require(_0x231c('0x9'));var querystring=require('querystring');var Papa=require(_0x231c('0xf'));var Redis=require(_0x231c('0x10'));var authService=require(_0x231c('0x11'));var qs=require(_0x231c('0x12'));var as=require(_0x231c('0x13'));var hardwareService=require(_0x231c('0x14'));var logger=require(_0x231c('0x15'))('api');var utils=require(_0x231c('0x16'));var config=require(_0x231c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x231c('0x18'))['db'];function respondWithStatusCode(_0x43c270,_0x871ed1){_0x871ed1=_0x871ed1||0xcc;return function(_0x1aa3fe){if(_0x1aa3fe){return _0x43c270[_0x231c('0x19')](_0x871ed1);}return _0x43c270[_0x231c('0x1a')](_0x871ed1)[_0x231c('0x1b')]();};}function respondWithResult(_0x3355f6,_0xc09de5){_0xc09de5=_0xc09de5||0xc8;return function(_0x311218){if(_0x311218){return _0x3355f6[_0x231c('0x1a')](_0xc09de5)[_0x231c('0x1c')](_0x311218);}};}function respondWithFilteredResult(_0xe37de8,_0x1f7764){return function(_0x12a6ad){if(_0x12a6ad){var _0x210f2e=typeof _0x1f7764[_0x231c('0x1d')]===_0x231c('0x1e')&&typeof _0x1f7764[_0x231c('0x1f')]===_0x231c('0x1e');var _0x51b8ca=_0x12a6ad[_0x231c('0x20')];var _0x341645=_0x210f2e?0x0:_0x1f7764[_0x231c('0x1d')];var _0xadea80=_0x210f2e?_0x12a6ad[_0x231c('0x20')]:_0x1f7764[_0x231c('0x1d')]+_0x1f7764[_0x231c('0x1f')];var _0x172d50;if(_0xadea80>=_0x51b8ca){_0xadea80=_0x51b8ca;_0x172d50=0xc8;}else{_0x172d50=0xce;}_0xe37de8[_0x231c('0x1a')](_0x172d50);return _0xe37de8[_0x231c('0x21')]('Content-Range',_0x341645+'-'+_0xadea80+'/'+_0x51b8ca)[_0x231c('0x1c')](_0x12a6ad);}return null;};}function patchUpdates(_0x5e8a53){return function(_0x872034){try{jsonpatch['apply'](_0x872034,_0x5e8a53,!![]);}catch(_0x42cca3){return BPromise[_0x231c('0x22')](_0x42cca3);}return _0x872034[_0x231c('0x23')]();};}function saveUpdates(_0x3267f9,_0x255671){return function(_0x309393){if(_0x309393){return _0x309393[_0x231c('0x24')](_0x3267f9)[_0x231c('0x25')](function(_0x54566f){return _0x54566f;});}return null;};}function removeEntity(_0x128112,_0x3336d8){return function(_0x4af49b){if(_0x4af49b){return _0x4af49b[_0x231c('0x26')]()[_0x231c('0x25')](function(){_0x128112['status'](0xcc)[_0x231c('0x1b')]();});}};}function handleEntityNotFound(_0x564939,_0x3ea0cd){return function(_0x454f70){if(!_0x454f70){_0x564939[_0x231c('0x19')](0x194);}return _0x454f70;};}function handleError(_0x2a673c,_0x449d74){_0x449d74=_0x449d74||0x1f4;return function(_0x131cfd){logger[_0x231c('0x27')](_0x131cfd['stack']);if(_0x131cfd[_0x231c('0x28')]){delete _0x131cfd[_0x231c('0x28')];}_0x2a673c['status'](_0x449d74)[_0x231c('0x29')](_0x131cfd);};}exports[_0x231c('0x2a')]=function(_0x45ced8,_0xeeddfc){var _0x271635={},_0x15a9bb={},_0x40f76e={'count':0x0,'rows':[]};var _0x4dfaa3=_[_0x231c('0x2b')](db[_0x231c('0x2c')]['rawAttributes'],function(_0x4be2e2){return{'name':_0x4be2e2['fieldName'],'type':_0x4be2e2[_0x231c('0x2d')]['key']};});_0x15a9bb[_0x231c('0x2e')]=_['map'](_0x4dfaa3,_0x231c('0x28'));_0x15a9bb[_0x231c('0x2f')]=_[_0x231c('0x30')](_0x45ced8[_0x231c('0x2f')]);_0x15a9bb['filters']=_[_0x231c('0x31')](_0x15a9bb[_0x231c('0x2e')],_0x15a9bb[_0x231c('0x2f')]);_0x271635[_0x231c('0x32')]=_[_0x231c('0x31')](_0x15a9bb[_0x231c('0x2e')],qs[_0x231c('0x33')](_0x45ced8[_0x231c('0x2f')]['fields']));_0x271635['attributes']=_0x271635[_0x231c('0x32')][_0x231c('0x34')]?_0x271635[_0x231c('0x32')]:_0x15a9bb[_0x231c('0x2e')];if(!_0x45ced8[_0x231c('0x2f')][_0x231c('0x35')]('nolimit')){_0x271635[_0x231c('0x1f')]=qs[_0x231c('0x1f')](_0x45ced8['query']['limit']);_0x271635[_0x231c('0x1d')]=qs['offset'](_0x45ced8[_0x231c('0x2f')]['offset']);}_0x271635[_0x231c('0x36')]=qs[_0x231c('0x37')](_0x45ced8['query'][_0x231c('0x37')]);_0x271635[_0x231c('0x38')]=qs[_0x231c('0x39')](_['pick'](_0x45ced8[_0x231c('0x2f')],_0x15a9bb[_0x231c('0x39')]),_0x4dfaa3);if(_0x45ced8[_0x231c('0x2f')][_0x231c('0x3a')]){_0x271635[_0x231c('0x38')]=_[_0x231c('0x3b')](_0x271635[_0x231c('0x38')],{'$or':_[_0x231c('0x2b')](_0x4dfaa3,function(_0x409b01){if(_0x409b01[_0x231c('0x2d')]!==_0x231c('0x3c')){var _0x2c8033={};_0x2c8033[_0x409b01[_0x231c('0x28')]]={'$like':'%'+_0x45ced8['query'][_0x231c('0x3a')]+'%'};return _0x2c8033;}})});}_0x271635=_[_0x231c('0x3b')]({},_0x271635,_0x45ced8[_0x231c('0x3d')]);var _0x2f763d={'where':_0x271635[_0x231c('0x38')]};return db['Cdr'][_0x231c('0x20')](_0x2f763d)[_0x231c('0x25')](function(_0x229953){_0x40f76e['count']=_0x229953;if(_0x45ced8[_0x231c('0x2f')][_0x231c('0x3e')]){_0x271635[_0x231c('0x3f')]=[{'all':!![]}];}return db[_0x231c('0x2c')][_0x231c('0x40')](_0x271635);})[_0x231c('0x25')](function(_0x5d46eb){_0x40f76e[_0x231c('0x41')]=_0x5d46eb;return _0x40f76e;})[_0x231c('0x25')](respondWithFilteredResult(_0xeeddfc,_0x271635))[_0x231c('0x42')](handleError(_0xeeddfc,null));};exports[_0x231c('0x43')]=function(_0x518011,_0x33396b){var _0x523339={'raw':!![],'where':{'id':_0x518011['params']['id']}},_0x26bfd2={};_0x26bfd2[_0x231c('0x2e')]=_[_0x231c('0x30')](db[_0x231c('0x2c')][_0x231c('0x44')]);_0x26bfd2[_0x231c('0x2f')]=_[_0x231c('0x30')](_0x518011['query']);_0x26bfd2[_0x231c('0x39')]=_[_0x231c('0x31')](_0x26bfd2[_0x231c('0x2e')],_0x26bfd2['query']);_0x523339[_0x231c('0x32')]=_[_0x231c('0x31')](_0x26bfd2[_0x231c('0x2e')],qs[_0x231c('0x33')](_0x518011['query'][_0x231c('0x33')]));_0x523339['attributes']=_0x523339[_0x231c('0x32')][_0x231c('0x34')]?_0x523339[_0x231c('0x32')]:_0x26bfd2[_0x231c('0x2e')];if(_0x518011[_0x231c('0x2f')][_0x231c('0x3e')]){_0x523339[_0x231c('0x3f')]=[{'all':!![]}];}_0x523339=_[_0x231c('0x3b')]({},_0x523339,_0x518011[_0x231c('0x3d')]);return db[_0x231c('0x2c')][_0x231c('0x45')](_0x523339)[_0x231c('0x25')](handleEntityNotFound(_0x33396b,null))[_0x231c('0x25')](respondWithResult(_0x33396b,null))[_0x231c('0x42')](handleError(_0x33396b,null));};exports['create']=function(_0x18aaca,_0x293de2){return db[_0x231c('0x2c')][_0x231c('0x46')](_0x18aaca[_0x231c('0x47')],{})['then'](respondWithResult(_0x293de2,0xc9))['catch'](handleError(_0x293de2,null));};exports[_0x231c('0x24')]=function(_0x56a885,_0x419f63){if(_0x56a885[_0x231c('0x47')]['id']){delete _0x56a885[_0x231c('0x47')]['id'];}return db['Cdr'][_0x231c('0x45')]({'where':{'id':_0x56a885['params']['id']}})[_0x231c('0x25')](handleEntityNotFound(_0x419f63,null))[_0x231c('0x25')](saveUpdates(_0x56a885['body'],null))[_0x231c('0x25')](respondWithResult(_0x419f63,null))[_0x231c('0x42')](handleError(_0x419f63,null));};exports[_0x231c('0x26')]=function(_0x5d2d20,_0x49baac){return db['Cdr'][_0x231c('0x45')]({'where':{'id':_0x5d2d20[_0x231c('0x48')]['id']}})[_0x231c('0x25')](handleEntityNotFound(_0x49baac,null))['then'](removeEntity(_0x49baac,null))[_0x231c('0x42')](handleError(_0x49baac,null));};exports[_0x231c('0x49')]=function(_0x4fd60b,_0xf225d0){return db[_0x231c('0x2c')][_0x231c('0x49')]()[_0x231c('0x25')](respondWithResult(_0xf225d0,null))[_0x231c('0x42')](handleError(_0xf225d0,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index d7b805b..5ab696c 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xba3b14,_0x2d8e37){var _0x267f5d=function(_0x5862bc){while(--_0x5862bc){_0xba3b14['push'](_0xba3b14['shift']());}};_0x267f5d(++_0x2d8e37);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x42e722,_0x5c0998){var _0x5efcd9=function(_0x2287bb){while(--_0x2287bb){_0x42e722['push'](_0x42e722['shift']());}};_0x5efcd9(++_0x5c0998);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 9254e44..42813fa 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 _0xac94=['debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xac94,0x15c));var _0x4ac9=function(_0x31bdc5,_0x48b434){_0x31bdc5=_0x31bdc5-0x0;var _0x597815=_0xac94[_0x31bdc5];return _0x597815;};'use strict';var _=require(_0x4ac9('0x0'));var util=require('util');var moment=require(_0x4ac9('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ac9('0x2'));var fs=require('fs');var Redis=require(_0x4ac9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ac9('0x4'));var logger=require(_0x4ac9('0x5'))('rpc');var config=require(_0x4ac9('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4ac9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x361fa5,_0x79d88d,_0x7ef336){return new BPromise(function(_0x2cd8f9,_0x12fd99){return client[_0x4ac9('0x8')](_0x361fa5,_0x7ef336)[_0x4ac9('0x9')](function(_0x535d53){logger[_0x4ac9('0xa')](_0x4ac9('0xb'),_0x79d88d,_0x4ac9('0xc'));logger[_0x4ac9('0xd')](_0x4ac9('0xe'),_0x79d88d,_0x4ac9('0xc'),JSON['stringify'](_0x535d53));if(_0x535d53[_0x4ac9('0xf')]){if(_0x535d53['error'][_0x4ac9('0x10')]===0x1f4){logger[_0x4ac9('0xf')](_0x4ac9('0xb'),_0x79d88d,_0x535d53[_0x4ac9('0xf')]['message']);return _0x12fd99(_0x535d53['error'][_0x4ac9('0x11')]);}logger['error'](_0x4ac9('0xb'),_0x79d88d,_0x535d53[_0x4ac9('0xf')][_0x4ac9('0x11')]);return _0x2cd8f9(_0x535d53['error'][_0x4ac9('0x11')]);}else{logger[_0x4ac9('0xa')](_0x4ac9('0xb'),_0x79d88d,_0x4ac9('0xc'));_0x2cd8f9(_0x535d53[_0x4ac9('0x12')]['message']);}})['catch'](function(_0x2cdc7e){logger[_0x4ac9('0xf')](_0x4ac9('0xb'),_0x79d88d,_0x2cdc7e);_0x12fd99(_0x2cdc7e);});});} \ No newline at end of file +var _0x584c=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x584c,0x1df));var _0xc584=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x584c[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0xc584('0x0'));var util=require(_0xc584('0x1'));var moment=require(_0xc584('0x2'));var BPromise=require(_0xc584('0x3'));var rs=require(_0xc584('0x4'));var fs=require('fs');var Redis=require(_0xc584('0x5'));var db=require(_0xc584('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc584('0x7'))(_0xc584('0x8'));var config=require(_0xc584('0x9'));var jayson=require(_0xc584('0xa'));var client=jayson[_0xc584('0xb')][_0xc584('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x572e58,_0x9023a4,_0x4a5674){return new BPromise(function(_0x2ae08e,_0x1be714){return client['request'](_0x572e58,_0x4a5674)[_0xc584('0xd')](function(_0xbade24){logger[_0xc584('0xe')](_0xc584('0xf'),_0x9023a4,_0xc584('0x10'));logger[_0xc584('0x11')](_0xc584('0x12'),_0x9023a4,_0xc584('0x10'),JSON['stringify'](_0xbade24));if(_0xbade24[_0xc584('0x13')]){if(_0xbade24[_0xc584('0x13')][_0xc584('0x14')]===0x1f4){logger[_0xc584('0x13')](_0xc584('0xf'),_0x9023a4,_0xbade24[_0xc584('0x13')][_0xc584('0x15')]);return _0x1be714(_0xbade24['error']['message']);}logger[_0xc584('0x13')](_0xc584('0xf'),_0x9023a4,_0xbade24['error'][_0xc584('0x15')]);return _0x2ae08e(_0xbade24['error'][_0xc584('0x15')]);}else{logger[_0xc584('0xe')](_0xc584('0xf'),_0x9023a4,_0xc584('0x10'));_0x2ae08e(_0xbade24['result']['message']);}})[_0xc584('0x16')](function(_0x4f61d7){logger[_0xc584('0x13')](_0xc584('0xf'),_0x9023a4,_0x4f61d7);_0x1be714(_0x4f61d7);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 01c168b..c8df3a3 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(_0x680b65,_0x5b2e9c){var _0x1c2053=function(_0x1128e0){while(--_0x1128e0){_0x680b65['push'](_0x680b65['shift']());}};_0x1c2053(++_0x5b2e9c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xcb228f,_0x5c6b29){var _0x24baa9=function(_0x3f7d58){while(--_0x3f7d58){_0xcb228f['push'](_0xcb228f['shift']());}};_0x24baa9(++_0x5c6b29);}(_0xb10b,0x12a));var _0xbb10=function(_0x5ee607,_0x5ef350){_0x5ee607=_0x5ee607-0x0;var _0x49a75a=_0xb10b[_0x5ee607];return _0x49a75a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index e49ae3b..c99c2e8 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 _0x2f56=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0x2f56,0xd7));var _0x62f5=function(_0x4fc16a,_0x48ded9){_0x4fc16a=_0x4fc16a-0x0;var _0x20118c=_0x2f56[_0x4fc16a];return _0x20118c;};'use strict';var Sequelize=require('sequelize');module[_0x62f5('0x0')]={'priority':{'type':Sequelize[_0x62f5('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x62f5('0x2')],'allowNull':![],'defaultValue':_0x62f5('0x3')},'appdata':{'type':Sequelize[_0x62f5('0x4')]()},'description':{'type':Sequelize[_0x62f5('0x2')]},'interval':{'type':Sequelize[_0x62f5('0x2')],'defaultValue':_0x62f5('0x5')}}; \ No newline at end of file +var _0x5609=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x383dbb,_0x17d41b){var _0x6e8bde=function(_0x2740f1){while(--_0x2740f1){_0x383dbb['push'](_0x383dbb['shift']());}};_0x6e8bde(++_0x17d41b);}(_0x5609,0x14d));var _0x9560=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5609[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0x9560('0x0'));module[_0x9560('0x1')]={'priority':{'type':Sequelize[_0x9560('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9560('0x3')],'allowNull':![],'defaultValue':_0x9560('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9560('0x3')]},'interval':{'type':Sequelize[_0x9560('0x3')],'defaultValue':_0x9560('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 8e760ce..329e59e 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 _0x2f72=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','show','model','keys','ChatApplication','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0x2f72,0x166));var _0x22f7=function(_0x14ec1c,_0x2c0e2b){_0x14ec1c=_0x14ec1c-0x0;var _0x35a2c2=_0x2f72[_0x14ec1c];return _0x35a2c2;};'use strict';var emlformat=require(_0x22f7('0x0'));var rimraf=require(_0x22f7('0x1'));var zipdir=require(_0x22f7('0x2'));var jsonpatch=require(_0x22f7('0x3'));var rp=require(_0x22f7('0x4'));var moment=require(_0x22f7('0x5'));var BPromise=require(_0x22f7('0x6'));var Mustache=require(_0x22f7('0x7'));var util=require('util');var path=require(_0x22f7('0x8'));var sox=require(_0x22f7('0x9'));var csv=require(_0x22f7('0xa'));var ejs=require(_0x22f7('0xb'));var fs=require('fs');var fs_extra=require(_0x22f7('0xc'));var _=require(_0x22f7('0xd'));var squel=require(_0x22f7('0xe'));var crypto=require(_0x22f7('0xf'));var jsforce=require(_0x22f7('0x10'));var deskjs=require(_0x22f7('0x11'));var toCsv=require(_0x22f7('0xa'));var querystring=require(_0x22f7('0x12'));var Papa=require(_0x22f7('0x13'));var Redis=require(_0x22f7('0x14'));var authService=require(_0x22f7('0x15'));var qs=require(_0x22f7('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x22f7('0x17'));var logger=require(_0x22f7('0x18'))('api');var utils=require(_0x22f7('0x19'));var config=require(_0x22f7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x22f7('0x1b'))['db'];function respondWithStatusCode(_0x5a4220,_0x1d69c4){_0x1d69c4=_0x1d69c4||0xcc;return function(_0x2d87bc){if(_0x2d87bc){return _0x5a4220['sendStatus'](_0x1d69c4);}return _0x5a4220[_0x22f7('0x1c')](_0x1d69c4)[_0x22f7('0x1d')]();};}function respondWithResult(_0xa4cc90,_0x379b18){_0x379b18=_0x379b18||0xc8;return function(_0x3ddaed){if(_0x3ddaed){return _0xa4cc90[_0x22f7('0x1c')](_0x379b18)[_0x22f7('0x1e')](_0x3ddaed);}};}function respondWithFilteredResult(_0x2e91d3,_0x159f04){return function(_0x2f0a74){if(_0x2f0a74){var _0x36c213=typeof _0x159f04[_0x22f7('0x1f')]===_0x22f7('0x20')&&typeof _0x159f04[_0x22f7('0x21')]===_0x22f7('0x20');var _0x56a1d3=_0x2f0a74[_0x22f7('0x22')];var _0x3894f4=_0x36c213?0x0:_0x159f04[_0x22f7('0x1f')];var _0x3f15b8=_0x36c213?_0x2f0a74[_0x22f7('0x22')]:_0x159f04[_0x22f7('0x1f')]+_0x159f04[_0x22f7('0x21')];var _0x4528f7;if(_0x3f15b8>=_0x56a1d3){_0x3f15b8=_0x56a1d3;_0x4528f7=0xc8;}else{_0x4528f7=0xce;}_0x2e91d3[_0x22f7('0x1c')](_0x4528f7);return _0x2e91d3['set'](_0x22f7('0x23'),_0x3894f4+'-'+_0x3f15b8+'/'+_0x56a1d3)[_0x22f7('0x1e')](_0x2f0a74);}return null;};}function patchUpdates(_0x1f363d){return function(_0x435eb6){try{jsonpatch['apply'](_0x435eb6,_0x1f363d,!![]);}catch(_0x707f2c){return BPromise[_0x22f7('0x24')](_0x707f2c);}return _0x435eb6[_0x22f7('0x25')]();};}function saveUpdates(_0x26214c,_0x352663){return function(_0x5d79cc){if(_0x5d79cc){return _0x5d79cc['update'](_0x26214c)[_0x22f7('0x26')](function(_0x56f180){return _0x56f180;});}return null;};}function removeEntity(_0x320dc1,_0x1545f5){return function(_0xc53928){if(_0xc53928){return _0xc53928[_0x22f7('0x27')]()[_0x22f7('0x26')](function(){_0x320dc1[_0x22f7('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39edc8,_0x48c489){return function(_0x580245){if(!_0x580245){_0x39edc8[_0x22f7('0x28')](0x194);}return _0x580245;};}function handleError(_0x3cee67,_0x3ad77d){_0x3ad77d=_0x3ad77d||0x1f4;return function(_0x52995c){logger[_0x22f7('0x29')](_0x52995c[_0x22f7('0x2a')]);if(_0x52995c['name']){delete _0x52995c[_0x22f7('0x2b')];}_0x3cee67[_0x22f7('0x1c')](_0x3ad77d)['send'](_0x52995c);};}exports[_0x22f7('0x2c')]=function(_0x5c4282,_0xa3346f){var _0xbf4c5c={'raw':!![],'where':{'id':_0x5c4282['params']['id']}},_0x14c71e={};_0x14c71e[_0x22f7('0x2d')]=_[_0x22f7('0x2e')](db[_0x22f7('0x2f')]['rawAttributes']);_0x14c71e['query']=_[_0x22f7('0x2e')](_0x5c4282[_0x22f7('0x30')]);_0x14c71e[_0x22f7('0x31')]=_['intersection'](_0x14c71e[_0x22f7('0x2d')],_0x14c71e[_0x22f7('0x30')]);_0xbf4c5c[_0x22f7('0x32')]=_[_0x22f7('0x33')](_0x14c71e['model'],qs[_0x22f7('0x34')](_0x5c4282[_0x22f7('0x30')][_0x22f7('0x34')]));_0xbf4c5c['attributes']=_0xbf4c5c[_0x22f7('0x32')][_0x22f7('0x35')]?_0xbf4c5c[_0x22f7('0x32')]:_0x14c71e[_0x22f7('0x2d')];if(_0x5c4282[_0x22f7('0x30')][_0x22f7('0x36')]){_0xbf4c5c[_0x22f7('0x37')]=[{'all':!![]}];}_0xbf4c5c=_[_0x22f7('0x38')]({},_0xbf4c5c,_0x5c4282[_0x22f7('0x39')]);return db[_0x22f7('0x2f')][_0x22f7('0x3a')](_0xbf4c5c)[_0x22f7('0x26')](handleEntityNotFound(_0xa3346f,null))[_0x22f7('0x26')](respondWithResult(_0xa3346f,null))[_0x22f7('0x3b')](handleError(_0xa3346f,null));};exports[_0x22f7('0x3c')]=function(_0x276b06,_0x3014c0){if(_0x276b06[_0x22f7('0x3d')]['id']){delete _0x276b06[_0x22f7('0x3d')]['id'];}return db[_0x22f7('0x2f')][_0x22f7('0x3a')]({'where':{'id':_0x276b06[_0x22f7('0x3e')]['id']}})[_0x22f7('0x26')](handleEntityNotFound(_0x3014c0,null))[_0x22f7('0x26')](saveUpdates(_0x276b06[_0x22f7('0x3d')],null))['then'](respondWithResult(_0x3014c0,null))[_0x22f7('0x3b')](handleError(_0x3014c0,null));};exports['destroy']=function(_0xae7703,_0x1fc93f){return db[_0x22f7('0x2f')][_0x22f7('0x3a')]({'where':{'id':_0xae7703['params']['id']}})[_0x22f7('0x26')](handleEntityNotFound(_0x1fc93f,null))[_0x22f7('0x26')](removeEntity(_0x1fc93f,null))['catch'](handleError(_0x1fc93f,null));}; \ No newline at end of file +var _0xe9ad=['fields','length','merge','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','model','attributes','intersection'];(function(_0x1d7ca0,_0x2cf461){var _0x406010=function(_0x4e9217){while(--_0x4e9217){_0x1d7ca0['push'](_0x1d7ca0['shift']());}};_0x406010(++_0x2cf461);}(_0xe9ad,0x82));var _0xde9a=function(_0x53b37c,_0x1e3dae){_0x53b37c=_0x53b37c-0x0;var _0x912a5=_0xe9ad[_0x53b37c];return _0x912a5;};'use strict';var emlformat=require(_0xde9a('0x0'));var rimraf=require(_0xde9a('0x1'));var zipdir=require(_0xde9a('0x2'));var jsonpatch=require(_0xde9a('0x3'));var rp=require(_0xde9a('0x4'));var moment=require(_0xde9a('0x5'));var BPromise=require(_0xde9a('0x6'));var Mustache=require('mustache');var util=require(_0xde9a('0x7'));var path=require(_0xde9a('0x8'));var sox=require(_0xde9a('0x9'));var csv=require(_0xde9a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde9a('0xb'));var _=require(_0xde9a('0xc'));var squel=require(_0xde9a('0xd'));var crypto=require('crypto');var jsforce=require(_0xde9a('0xe'));var deskjs=require(_0xde9a('0xf'));var toCsv=require(_0xde9a('0xa'));var querystring=require(_0xde9a('0x10'));var Papa=require(_0xde9a('0x11'));var Redis=require(_0xde9a('0x12'));var authService=require(_0xde9a('0x13'));var qs=require(_0xde9a('0x14'));var as=require(_0xde9a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xde9a('0x16'))(_0xde9a('0x17'));var utils=require(_0xde9a('0x18'));var config=require(_0xde9a('0x19'));var licenseUtil=require(_0xde9a('0x1a'));var db=require(_0xde9a('0x1b'))['db'];function respondWithStatusCode(_0x1cb3bd,_0x3a9b1a){_0x3a9b1a=_0x3a9b1a||0xcc;return function(_0xd81956){if(_0xd81956){return _0x1cb3bd['sendStatus'](_0x3a9b1a);}return _0x1cb3bd[_0xde9a('0x1c')](_0x3a9b1a)[_0xde9a('0x1d')]();};}function respondWithResult(_0x2f2e11,_0x267d5b){_0x267d5b=_0x267d5b||0xc8;return function(_0x1c1873){if(_0x1c1873){return _0x2f2e11[_0xde9a('0x1c')](_0x267d5b)[_0xde9a('0x1e')](_0x1c1873);}};}function respondWithFilteredResult(_0x432d3c,_0x3f0e39){return function(_0x474713){if(_0x474713){var _0x50ffb8=typeof _0x3f0e39[_0xde9a('0x1f')]===_0xde9a('0x20')&&typeof _0x3f0e39[_0xde9a('0x21')]===_0xde9a('0x20');var _0x454156=_0x474713['count'];var _0x12ba7f=_0x50ffb8?0x0:_0x3f0e39[_0xde9a('0x1f')];var _0x3b89ef=_0x50ffb8?_0x474713['count']:_0x3f0e39[_0xde9a('0x1f')]+_0x3f0e39['limit'];var _0x8f481a;if(_0x3b89ef>=_0x454156){_0x3b89ef=_0x454156;_0x8f481a=0xc8;}else{_0x8f481a=0xce;}_0x432d3c['status'](_0x8f481a);return _0x432d3c[_0xde9a('0x22')](_0xde9a('0x23'),_0x12ba7f+'-'+_0x3b89ef+'/'+_0x454156)[_0xde9a('0x1e')](_0x474713);}return null;};}function patchUpdates(_0x4add81){return function(_0x43b1bb){try{jsonpatch[_0xde9a('0x24')](_0x43b1bb,_0x4add81,!![]);}catch(_0x4e4e02){return BPromise['reject'](_0x4e4e02);}return _0x43b1bb[_0xde9a('0x25')]();};}function saveUpdates(_0x416b36,_0x56550b){return function(_0x290d8d){if(_0x290d8d){return _0x290d8d[_0xde9a('0x26')](_0x416b36)[_0xde9a('0x27')](function(_0x402b06){return _0x402b06;});}return null;};}function removeEntity(_0xa48b6b,_0x284c96){return function(_0x544f9d){if(_0x544f9d){return _0x544f9d[_0xde9a('0x28')]()[_0xde9a('0x27')](function(){_0xa48b6b[_0xde9a('0x1c')](0xcc)[_0xde9a('0x1d')]();});}};}function handleEntityNotFound(_0xfd4b9d,_0xdcc5d2){return function(_0xbc8e99){if(!_0xbc8e99){_0xfd4b9d[_0xde9a('0x29')](0x194);}return _0xbc8e99;};}function handleError(_0x125720,_0x490b11){_0x490b11=_0x490b11||0x1f4;return function(_0x5ab5e5){logger[_0xde9a('0x2a')](_0x5ab5e5[_0xde9a('0x2b')]);if(_0x5ab5e5[_0xde9a('0x2c')]){delete _0x5ab5e5[_0xde9a('0x2c')];}_0x125720['status'](_0x490b11)[_0xde9a('0x2d')](_0x5ab5e5);};}exports[_0xde9a('0x2e')]=function(_0x467ce2,_0x51806d){var _0x3bd254={'raw':!![],'where':{'id':_0x467ce2[_0xde9a('0x2f')]['id']}},_0x5890c5={};_0x5890c5['model']=_[_0xde9a('0x30')](db[_0xde9a('0x31')][_0xde9a('0x32')]);_0x5890c5[_0xde9a('0x33')]=_[_0xde9a('0x30')](_0x467ce2[_0xde9a('0x33')]);_0x5890c5[_0xde9a('0x34')]=_['intersection'](_0x5890c5[_0xde9a('0x35')],_0x5890c5[_0xde9a('0x33')]);_0x3bd254[_0xde9a('0x36')]=_[_0xde9a('0x37')](_0x5890c5[_0xde9a('0x35')],qs[_0xde9a('0x38')](_0x467ce2[_0xde9a('0x33')][_0xde9a('0x38')]));_0x3bd254[_0xde9a('0x36')]=_0x3bd254[_0xde9a('0x36')][_0xde9a('0x39')]?_0x3bd254[_0xde9a('0x36')]:_0x5890c5[_0xde9a('0x35')];if(_0x467ce2[_0xde9a('0x33')]['includeAll']){_0x3bd254['include']=[{'all':!![]}];}_0x3bd254=_[_0xde9a('0x3a')]({},_0x3bd254,_0x467ce2['options']);return db[_0xde9a('0x31')][_0xde9a('0x3b')](_0x3bd254)['then'](handleEntityNotFound(_0x51806d,null))[_0xde9a('0x27')](respondWithResult(_0x51806d,null))[_0xde9a('0x3c')](handleError(_0x51806d,null));};exports[_0xde9a('0x26')]=function(_0x4d45a2,_0x4f93d2){if(_0x4d45a2[_0xde9a('0x3d')]['id']){delete _0x4d45a2[_0xde9a('0x3d')]['id'];}return db['ChatApplication'][_0xde9a('0x3b')]({'where':{'id':_0x4d45a2[_0xde9a('0x2f')]['id']}})[_0xde9a('0x27')](handleEntityNotFound(_0x4f93d2,null))[_0xde9a('0x27')](saveUpdates(_0x4d45a2[_0xde9a('0x3d')],null))[_0xde9a('0x27')](respondWithResult(_0x4f93d2,null))[_0xde9a('0x3c')](handleError(_0x4f93d2,null));};exports[_0xde9a('0x28')]=function(_0x32c6f0,_0x463dc5){return db['ChatApplication'][_0xde9a('0x3b')]({'where':{'id':_0x32c6f0[_0xde9a('0x2f')]['id']}})[_0xde9a('0x27')](handleEntityNotFound(_0x463dc5,null))[_0xde9a('0x27')](removeEntity(_0x463dc5,null))['catch'](handleError(_0x463dc5,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 2cb1bd0..26d4760 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 _0x4fd9=['define','ChatApplication','chat_applications','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x1d0b1e,_0x1d05dd){var _0x437167=function(_0x4a4aee){while(--_0x4a4aee){_0x1d0b1e['push'](_0x1d0b1e['shift']());}};_0x437167(++_0x1d05dd);}(_0x4fd9,0xf1));var _0x94fd=function(_0x38531f,_0x2aaa57){_0x38531f=_0x38531f-0x0;var _0x47edbe=_0x4fd9[_0x38531f];return _0x47edbe;};'use strict';var _=require(_0x94fd('0x0'));var util=require(_0x94fd('0x1'));var logger=require(_0x94fd('0x2'))(_0x94fd('0x3'));var moment=require('moment');var BPromise=require(_0x94fd('0x4'));var rp=require(_0x94fd('0x5'));var fs=require('fs');var path=require(_0x94fd('0x6'));var rimraf=require(_0x94fd('0x7'));var config=require(_0x94fd('0x8'));var attributes=require(_0x94fd('0x9'));module[_0x94fd('0xa')]=function(_0x33b9ee,_0x38413f){return _0x33b9ee[_0x94fd('0xb')](_0x94fd('0xc'),attributes,{'tableName':_0x94fd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xcb3c=['../../config/logger','api','bluebird','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','lodash','util'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0xcb3c,0x150));var _0xccb3=function(_0x2cce72,_0x432665){_0x2cce72=_0x2cce72-0x0;var _0xe78e46=_0xcb3c[_0x2cce72];return _0xe78e46;};'use strict';var _=require(_0xccb3('0x0'));var util=require(_0xccb3('0x1'));var logger=require(_0xccb3('0x2'))(_0xccb3('0x3'));var moment=require('moment');var BPromise=require(_0xccb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xccb3('0x5'));var rimraf=require('rimraf');var config=require(_0xccb3('0x6'));var attributes=require(_0xccb3('0x7'));module[_0xccb3('0x8')]=function(_0x3c02f3,_0x56eec1){return _0x3c02f3[_0xccb3('0x9')](_0xccb3('0xa'),attributes,{'tableName':_0xccb3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xccb3('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 7cf6313..aa342c6 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 _0x6583=['then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x5676df,_0x14d122){var _0x1fb878=function(_0x84c80a){while(--_0x84c80a){_0x5676df['push'](_0x5676df['shift']());}};_0x1fb878(++_0x14d122);}(_0x6583,0x144));var _0x3658=function(_0x1df473,_0x1a6931){_0x1df473=_0x1df473-0x0;var _0x1bdd49=_0x6583[_0x1df473];return _0x1bdd49;};'use strict';var _=require(_0x3658('0x0'));var util=require(_0x3658('0x1'));var moment=require(_0x3658('0x2'));var BPromise=require('bluebird');var rs=require(_0x3658('0x3'));var fs=require('fs');var Redis=require(_0x3658('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3658('0x5'));var logger=require(_0x3658('0x6'))('rpc');var config=require(_0x3658('0x7'));var jayson=require(_0x3658('0x8'));var client=jayson[_0x3658('0x9')][_0x3658('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x642746,_0x29d862,_0x1e2ff4){return new BPromise(function(_0x2125b5,_0x4025ca){return client[_0x3658('0xb')](_0x642746,_0x1e2ff4)[_0x3658('0xc')](function(_0x167d0e){logger[_0x3658('0xd')](_0x3658('0xe'),_0x29d862,_0x3658('0xf'));logger[_0x3658('0x10')](_0x3658('0x11'),_0x29d862,_0x3658('0xf'),JSON[_0x3658('0x12')](_0x167d0e));if(_0x167d0e[_0x3658('0x13')]){if(_0x167d0e[_0x3658('0x13')][_0x3658('0x14')]===0x1f4){logger[_0x3658('0x13')](_0x3658('0xe'),_0x29d862,_0x167d0e['error'][_0x3658('0x15')]);return _0x4025ca(_0x167d0e['error'][_0x3658('0x15')]);}logger[_0x3658('0x13')](_0x3658('0xe'),_0x29d862,_0x167d0e[_0x3658('0x13')][_0x3658('0x15')]);return _0x2125b5(_0x167d0e[_0x3658('0x13')][_0x3658('0x15')]);}else{logger[_0x3658('0xd')](_0x3658('0xe'),_0x29d862,_0x3658('0xf'));_0x2125b5(_0x167d0e[_0x3658('0x16')][_0x3658('0x15')]);}})[_0x3658('0x17')](function(_0x41a046){logger[_0x3658('0x13')](_0x3658('0xe'),_0x29d862,_0x41a046);_0x4025ca(_0x41a046);});});} \ No newline at end of file +var _0xf713=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x43f92c,_0x291a47){var _0xca4547=function(_0x50b574){while(--_0x50b574){_0x43f92c['push'](_0x43f92c['shift']());}};_0xca4547(++_0x291a47);}(_0xf713,0x196));var _0x3f71=function(_0x3a723e,_0x59d99a){_0x3a723e=_0x3a723e-0x0;var _0x3e9c03=_0xf713[_0x3a723e];return _0x3e9c03;};'use strict';var _=require(_0x3f71('0x0'));var util=require(_0x3f71('0x1'));var moment=require(_0x3f71('0x2'));var BPromise=require(_0x3f71('0x3'));var rs=require(_0x3f71('0x4'));var fs=require('fs');var Redis=require(_0x3f71('0x5'));var db=require(_0x3f71('0x6'))['db'];var utils=require(_0x3f71('0x7'));var logger=require(_0x3f71('0x8'))(_0x3f71('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f71('0xa')][_0x3f71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d9d67,_0x490d90,_0xa6c678){return new BPromise(function(_0x3faddd,_0x3d65d5){return client[_0x3f71('0xc')](_0x3d9d67,_0xa6c678)[_0x3f71('0xd')](function(_0x383f3e){logger[_0x3f71('0xe')](_0x3f71('0xf'),_0x490d90,_0x3f71('0x10'));logger[_0x3f71('0x11')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x490d90,_0x3f71('0x10'),JSON['stringify'](_0x383f3e));if(_0x383f3e[_0x3f71('0x12')]){if(_0x383f3e[_0x3f71('0x12')][_0x3f71('0x13')]===0x1f4){logger['error'](_0x3f71('0xf'),_0x490d90,_0x383f3e[_0x3f71('0x12')][_0x3f71('0x14')]);return _0x3d65d5(_0x383f3e['error']['message']);}logger[_0x3f71('0x12')](_0x3f71('0xf'),_0x490d90,_0x383f3e[_0x3f71('0x12')][_0x3f71('0x14')]);return _0x3faddd(_0x383f3e[_0x3f71('0x12')][_0x3f71('0x14')]);}else{logger[_0x3f71('0xe')](_0x3f71('0xf'),_0x490d90,_0x3f71('0x10'));_0x3faddd(_0x383f3e['result']['message']);}})['catch'](function(_0xfcccda){logger[_0x3f71('0x12')](_0x3f71('0xf'),_0x490d90,_0xfcccda);_0x3d65d5(_0xfcccda);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 51f3a92..3ebe9db 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 _0xa99c=['show','put','/:id','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated'];(function(_0x5ce2b4,_0xfcd86d){var _0x62924a=function(_0x303843){while(--_0x303843){_0x5ce2b4['push'](_0x5ce2b4['shift']());}};_0x62924a(++_0xfcd86d);}(_0xa99c,0xc9));var _0xca99=function(_0x521ba2,_0x1fc36d){_0x521ba2=_0x521ba2-0x0;var _0x5d3e30=_0xa99c[_0x521ba2];return _0x5d3e30;};'use strict';var multer=require(_0xca99('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xca99('0x1'));var express=require(_0xca99('0x2'));var router=express[_0xca99('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xca99('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xca99('0x5'));var controller=require(_0xca99('0x6'));router[_0xca99('0x7')]('/:id',auth[_0xca99('0x8')](),controller[_0xca99('0x9')]);router[_0xca99('0xa')](_0xca99('0xb'),auth[_0xca99('0x8')](),controller['update']);router[_0xca99('0xc')](_0xca99('0xb'),auth['isAuthenticated'](),controller[_0xca99('0xd')]);module[_0xca99('0xe')]=router; \ No newline at end of file +var _0x84d9=['get','/:id','show','put','isAuthenticated','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x550cc8,_0x2ca666){var _0x15f05a=function(_0x3e6670){while(--_0x3e6670){_0x550cc8['push'](_0x550cc8['shift']());}};_0x15f05a(++_0x2ca666);}(_0x84d9,0x19c));var _0x984d=function(_0x35ed68,_0x4b920d){_0x35ed68=_0x35ed68-0x0;var _0x48f7f6=_0x84d9[_0x35ed68];return _0x48f7f6;};'use strict';var multer=require('multer');var util=require(_0x984d('0x0'));var path=require(_0x984d('0x1'));var timeout=require(_0x984d('0x2'));var express=require('express');var router=express[_0x984d('0x3')]();var fs_extra=require(_0x984d('0x4'));var auth=require(_0x984d('0x5'));var interaction=require(_0x984d('0x6'));var config=require(_0x984d('0x7'));var controller=require('./chatApplication.controller');router[_0x984d('0x8')](_0x984d('0x9'),auth['isAuthenticated'](),controller[_0x984d('0xa')]);router[_0x984d('0xb')](_0x984d('0x9'),auth[_0x984d('0xc')](),controller['update']);router['delete']('/:id',auth[_0x984d('0xc')](),controller[_0x984d('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 5a53c25..63268aa 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 _0xa0c8=['STRING','BOOLEAN','sequelize','exports'];(function(_0xb5f55f,_0x3c5056){var _0x334e78=function(_0x5541c7){while(--_0x5541c7){_0xb5f55f['push'](_0xb5f55f['shift']());}};_0x334e78(++_0x3c5056);}(_0xa0c8,0xf2));var _0x8a0c=function(_0x23da4d,_0x63498c){_0x23da4d=_0x23da4d-0x0;var _0x4ae55=_0xa0c8[_0x23da4d];return _0x4ae55;};'use strict';var Sequelize=require(_0x8a0c('0x0'));module[_0x8a0c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8a0c('0x2')]},'write':{'type':Sequelize[_0x8a0c('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x618a=['exports','STRING','BOOLEAN','sequelize'];(function(_0xadafdf,_0x506951){var _0x5d46f6=function(_0x111c23){while(--_0x111c23){_0xadafdf['push'](_0xadafdf['shift']());}};_0x5d46f6(++_0x506951);}(_0x618a,0xe3));var _0xa618=function(_0x1e0139,_0x4970a3){_0x1e0139=_0x1e0139-0x0;var _0xbfc2ba=_0x618a[_0x1e0139];return _0xbfc2ba;};'use strict';var Sequelize=require(_0xa618('0x0'));module[_0xa618('0x1')]={'name':{'type':Sequelize[_0xa618('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa618('0x2')]},'write':{'type':Sequelize[_0xa618('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 160237a..0a34d2a 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 _0x5644=['bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','error','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','includeAll','include','show','params','options','find','catch','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','omit','ids','getMembers','findOne','User','length','order','filter','removeMembers','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','fast-json-patch','request-promise','moment'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x5644,0x178));var _0x4564=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0x5644[_0x1fafa5];return _0xcf08c9;};'use strict';var emlformat=require(_0x4564('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4564('0x1'));var rp=require(_0x4564('0x2'));var moment=require(_0x4564('0x3'));var BPromise=require(_0x4564('0x4'));var Mustache=require(_0x4564('0x5'));var util=require('util');var path=require(_0x4564('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4564('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4564('0x8'));var squel=require(_0x4564('0x9'));var crypto=require(_0x4564('0xa'));var jsforce=require(_0x4564('0xb'));var deskjs=require(_0x4564('0xc'));var toCsv=require(_0x4564('0xd'));var querystring=require(_0x4564('0xe'));var Papa=require(_0x4564('0xf'));var Redis=require(_0x4564('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4564('0x11'));var hardwareService=require(_0x4564('0x12'));var logger=require(_0x4564('0x13'))(_0x4564('0x14'));var utils=require(_0x4564('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4564('0x16'));var db=require(_0x4564('0x17'))['db'];config[_0x4564('0x18')]=_[_0x4564('0x19')](config[_0x4564('0x18')],{'host':_0x4564('0x1a'),'port':0x18eb});var socket=require(_0x4564('0x1b'))(new Redis(config['redis']));require(_0x4564('0x1c'))[_0x4564('0x1d')](socket);function respondWithStatusCode(_0xb7ed22,_0x5bf062){_0x5bf062=_0x5bf062||0xcc;return function(_0x25a257){if(_0x25a257){return _0xb7ed22[_0x4564('0x1e')](_0x5bf062);}return _0xb7ed22[_0x4564('0x1f')](_0x5bf062)[_0x4564('0x20')]();};}function respondWithResult(_0x410501,_0x441b7b){_0x441b7b=_0x441b7b||0xc8;return function(_0x591969){if(_0x591969){return _0x410501[_0x4564('0x1f')](_0x441b7b)[_0x4564('0x21')](_0x591969);}};}function respondWithFilteredResult(_0xcb8637,_0x3bf602){return function(_0x16e153){if(_0x16e153){var _0x55d8a5=typeof _0x3bf602[_0x4564('0x22')]===_0x4564('0x23')&&typeof _0x3bf602['limit']===_0x4564('0x23');var _0x4abf30=_0x16e153[_0x4564('0x24')];var _0x76ba25=_0x55d8a5?0x0:_0x3bf602[_0x4564('0x22')];var _0x390c02=_0x55d8a5?_0x16e153['count']:_0x3bf602[_0x4564('0x22')]+_0x3bf602[_0x4564('0x25')];var _0x20dd0e;if(_0x390c02>=_0x4abf30){_0x390c02=_0x4abf30;_0x20dd0e=0xc8;}else{_0x20dd0e=0xce;}_0xcb8637['status'](_0x20dd0e);return _0xcb8637[_0x4564('0x26')]('Content-Range',_0x76ba25+'-'+_0x390c02+'/'+_0x4abf30)[_0x4564('0x21')](_0x16e153);}return null;};}function patchUpdates(_0x326ff6){return function(_0x3f3bb4){try{jsonpatch[_0x4564('0x27')](_0x3f3bb4,_0x326ff6,!![]);}catch(_0x89c39b){return BPromise[_0x4564('0x28')](_0x89c39b);}return _0x3f3bb4['save']();};}function saveUpdates(_0x407b32,_0x5951eb){return function(_0x29aa14){if(_0x29aa14){return _0x29aa14[_0x4564('0x29')](_0x407b32)[_0x4564('0x2a')](function(_0x593fbf){return _0x593fbf;});}return null;};}function removeEntity(_0x1c34c7,_0x2b632f){return function(_0x93c557){if(_0x93c557){return _0x93c557[_0x4564('0x2b')]()[_0x4564('0x2a')](function(){_0x1c34c7[_0x4564('0x1f')](0xcc)[_0x4564('0x20')]();});}};}function handleEntityNotFound(_0x1ca380,_0x260fe5){return function(_0x446099){if(!_0x446099){_0x1ca380['sendStatus'](0x194);}return _0x446099;};}function handleError(_0x35e05d,_0x1c9810){_0x1c9810=_0x1c9810||0x1f4;return function(_0x515c9e){logger[_0x4564('0x2c')](_0x515c9e['stack']);if(_0x515c9e['name']){delete _0x515c9e[_0x4564('0x2d')];}_0x35e05d[_0x4564('0x1f')](_0x1c9810)[_0x4564('0x2e')](_0x515c9e);};}exports[_0x4564('0x2f')]=function(_0x26a026,_0x1ea65a){var _0xf95cdf={},_0x448580={},_0x3da7fa={'count':0x0,'rows':[]};var _0x4e76d0=_['map'](db[_0x4564('0x30')][_0x4564('0x31')],function(_0x4706e1){return{'name':_0x4706e1[_0x4564('0x32')],'type':_0x4706e1[_0x4564('0x33')][_0x4564('0x34')]};});_0x448580[_0x4564('0x35')]=_[_0x4564('0x36')](_0x4e76d0,_0x4564('0x2d'));_0x448580[_0x4564('0x37')]=_[_0x4564('0x38')](_0x26a026[_0x4564('0x37')]);_0x448580[_0x4564('0x39')]=_[_0x4564('0x3a')](_0x448580[_0x4564('0x35')],_0x448580[_0x4564('0x37')]);_0xf95cdf[_0x4564('0x3b')]=_[_0x4564('0x3a')](_0x448580[_0x4564('0x35')],qs[_0x4564('0x3c')](_0x26a026[_0x4564('0x37')][_0x4564('0x3c')]));_0xf95cdf['attributes']=_0xf95cdf[_0x4564('0x3b')]['length']?_0xf95cdf[_0x4564('0x3b')]:_0x448580['model'];if(!_0x26a026['query'][_0x4564('0x3d')](_0x4564('0x3e'))){_0xf95cdf[_0x4564('0x25')]=qs[_0x4564('0x25')](_0x26a026[_0x4564('0x37')]['limit']);_0xf95cdf[_0x4564('0x22')]=qs[_0x4564('0x22')](_0x26a026[_0x4564('0x37')]['offset']);}_0xf95cdf['order']=qs[_0x4564('0x3f')](_0x26a026['query'][_0x4564('0x3f')]);_0xf95cdf[_0x4564('0x40')]=qs[_0x4564('0x39')](_['pick'](_0x26a026[_0x4564('0x37')],_0x448580[_0x4564('0x39')]),_0x4e76d0);if(_0x26a026[_0x4564('0x37')]['filter']){_0xf95cdf[_0x4564('0x40')]=_[_0x4564('0x41')](_0xf95cdf[_0x4564('0x40')],{'$or':_[_0x4564('0x36')](_0x4e76d0,function(_0x233ffa){if(_0x233ffa[_0x4564('0x33')]!==_0x4564('0x42')){var _0xeb780b={};_0xeb780b[_0x233ffa[_0x4564('0x2d')]]={'$like':'%'+_0x26a026[_0x4564('0x37')]['filter']+'%'};return _0xeb780b;}})});}_0xf95cdf=_[_0x4564('0x41')]({},_0xf95cdf,_0x26a026['options']);var _0x327fe1={'where':_0xf95cdf['where']};return db['ChatGroup'][_0x4564('0x24')](_0x327fe1)[_0x4564('0x2a')](function(_0x478b1f){_0x3da7fa[_0x4564('0x24')]=_0x478b1f;if(_0x26a026[_0x4564('0x37')][_0x4564('0x43')]){_0xf95cdf[_0x4564('0x44')]=[{'all':!![]}];}return db[_0x4564('0x30')]['findAll'](_0xf95cdf);})[_0x4564('0x2a')](function(_0x26cf54){_0x3da7fa['rows']=_0x26cf54;return _0x3da7fa;})[_0x4564('0x2a')](respondWithFilteredResult(_0x1ea65a,_0xf95cdf))['catch'](handleError(_0x1ea65a,null));};exports[_0x4564('0x45')]=function(_0x4c00bf,_0x16ea5b){var _0x588ce7={'raw':!![],'where':{'id':_0x4c00bf[_0x4564('0x46')]['id']}},_0x5e2eea={};_0x5e2eea[_0x4564('0x35')]=_[_0x4564('0x38')](db[_0x4564('0x30')][_0x4564('0x31')]);_0x5e2eea[_0x4564('0x37')]=_[_0x4564('0x38')](_0x4c00bf[_0x4564('0x37')]);_0x5e2eea['filters']=_[_0x4564('0x3a')](_0x5e2eea[_0x4564('0x35')],_0x5e2eea[_0x4564('0x37')]);_0x588ce7[_0x4564('0x3b')]=_[_0x4564('0x3a')](_0x5e2eea[_0x4564('0x35')],qs[_0x4564('0x3c')](_0x4c00bf[_0x4564('0x37')]['fields']));_0x588ce7['attributes']=_0x588ce7['attributes']['length']?_0x588ce7[_0x4564('0x3b')]:_0x5e2eea[_0x4564('0x35')];if(_0x4c00bf['query'][_0x4564('0x43')]){_0x588ce7['include']=[{'all':!![]}];}_0x588ce7=_[_0x4564('0x41')]({},_0x588ce7,_0x4c00bf[_0x4564('0x47')]);return db[_0x4564('0x30')][_0x4564('0x48')](_0x588ce7)[_0x4564('0x2a')](handleEntityNotFound(_0x16ea5b,null))[_0x4564('0x2a')](respondWithResult(_0x16ea5b,null))[_0x4564('0x49')](handleError(_0x16ea5b,null));};exports[_0x4564('0x4a')]=function(_0x8a92fb,_0x1bdbe3){return db[_0x4564('0x30')][_0x4564('0x4a')](_0x8a92fb['body'],{})['then'](respondWithResult(_0x1bdbe3,0xc9))[_0x4564('0x49')](handleError(_0x1bdbe3,null));};exports[_0x4564('0x29')]=function(_0x39a76f,_0x1b8e4d){if(_0x39a76f[_0x4564('0x4b')]['id']){delete _0x39a76f[_0x4564('0x4b')]['id'];}return db[_0x4564('0x30')][_0x4564('0x48')]({'where':{'id':_0x39a76f[_0x4564('0x46')]['id']}})[_0x4564('0x2a')](handleEntityNotFound(_0x1b8e4d,null))['then'](saveUpdates(_0x39a76f[_0x4564('0x4b')],null))[_0x4564('0x2a')](respondWithResult(_0x1b8e4d,null))[_0x4564('0x49')](handleError(_0x1b8e4d,null));};exports[_0x4564('0x2b')]=function(_0x2ee0e6,_0x25cdd7){return db[_0x4564('0x30')][_0x4564('0x48')]({'where':{'id':_0x2ee0e6[_0x4564('0x46')]['id']}})[_0x4564('0x2a')](handleEntityNotFound(_0x25cdd7,null))[_0x4564('0x2a')](removeEntity(_0x25cdd7,null))['catch'](handleError(_0x25cdd7,null));};exports[_0x4564('0x4c')]=function(_0x40910c,_0x36acd7){return db[_0x4564('0x30')][_0x4564('0x4c')]()[_0x4564('0x2a')](respondWithResult(_0x36acd7,null))['catch'](handleError(_0x36acd7,null));};exports[_0x4564('0x4d')]=function(_0x3ffc90,_0x3910fa,_0x1d503f){return db[_0x4564('0x4e')][_0x4564('0x24')]({'where':{'ChatGroupId':_0x3ffc90[_0x4564('0x46')]['id'],'ToId':_0x3ffc90['user']['id'],'read':![]}})[_0x4564('0x2a')](function(_0xdc3148){return{'id':_[_0x4564('0x4f')](_0x3ffc90[_0x4564('0x46')]['id']),'count':_0xdc3148};})[_0x4564('0x2a')](respondWithResult(_0x3910fa,null))[_0x4564('0x49')](handleError(_0x3910fa,null));};exports[_0x4564('0x50')]=function(_0x3ca3b1,_0x62a9b3,_0x5031f2){return db[_0x4564('0x30')][_0x4564('0x48')]({'where':{'id':_0x3ca3b1['params']['id']}})[_0x4564('0x2a')](handleEntityNotFound(_0x62a9b3,null))[_0x4564('0x2a')](function(_0x4d0160){if(_0x4d0160){return _0x4d0160[_0x4564('0x50')](_0x3ca3b1[_0x4564('0x4b')]['ids'],_[_0x4564('0x51')](_0x3ca3b1[_0x4564('0x4b')],[_0x4564('0x52'),'id'])||{});}})[_0x4564('0x2a')](respondWithResult(_0x62a9b3,null))[_0x4564('0x49')](handleError(_0x62a9b3,null));};exports[_0x4564('0x53')]=function(_0x4a0141,_0x560092,_0x5f5110){var _0x53a764={};var _0xde8e0c={};var _0xfaba74;var _0x3236f1;return db[_0x4564('0x30')][_0x4564('0x54')]({'where':{'id':_0x4a0141['params']['id']}})[_0x4564('0x2a')](handleEntityNotFound(_0x560092,null))['then'](function(_0x9b3020){if(_0x9b3020){_0xfaba74=_0x9b3020;_0xde8e0c['model']=_[_0x4564('0x38')](db[_0x4564('0x55')]['rawAttributes']);_0xde8e0c[_0x4564('0x37')]=_[_0x4564('0x38')](_0x4a0141['query']);_0xde8e0c[_0x4564('0x39')]=_[_0x4564('0x3a')](_0xde8e0c[_0x4564('0x35')],_0xde8e0c['query']);_0x53a764['attributes']=_['intersection'](_0xde8e0c[_0x4564('0x35')],qs[_0x4564('0x3c')](_0x4a0141[_0x4564('0x37')]['fields']));_0x53a764['attributes']=_0x53a764['attributes'][_0x4564('0x56')]?_0x53a764[_0x4564('0x3b')]:_0xde8e0c[_0x4564('0x35')];_0x53a764[_0x4564('0x57')]=qs[_0x4564('0x3f')](_0x4a0141['query'][_0x4564('0x3f')]);_0x53a764['where']=qs[_0x4564('0x39')](_['pick'](_0x4a0141['query'],_0xde8e0c[_0x4564('0x39')]));if(_0x4a0141[_0x4564('0x37')][_0x4564('0x58')]){_0x53a764['where']=_[_0x4564('0x41')](_0x53a764[_0x4564('0x40')],{'$or':_[_0x4564('0x36')](_0x53a764['attributes'],function(_0x5497c7){var _0x5a8499={};_0x5a8499[_0x5497c7]={'$like':'%'+_0x4a0141[_0x4564('0x37')][_0x4564('0x58')]+'%'};return _0x5a8499;})});}_0x53a764=_[_0x4564('0x41')]({},_0x53a764,_0x4a0141[_0x4564('0x47')]);return _0xfaba74[_0x4564('0x53')](_0x53a764);}})[_0x4564('0x2a')](function(_0x2da931){if(_0x2da931){_0x3236f1=_0x2da931[_0x4564('0x56')];if(!_0x4a0141[_0x4564('0x37')][_0x4564('0x3d')](_0x4564('0x3e'))){_0x53a764[_0x4564('0x25')]=qs['limit'](_0x4a0141[_0x4564('0x37')][_0x4564('0x25')]);_0x53a764[_0x4564('0x22')]=qs[_0x4564('0x22')](_0x4a0141['query'][_0x4564('0x22')]);}return _0xfaba74['getMembers'](_0x53a764);}})[_0x4564('0x2a')](function(_0x3cef3b){if(_0x3cef3b){return _0x3cef3b?{'count':_0x3236f1,'rows':_0x3cef3b}:null;}})[_0x4564('0x2a')](respondWithResult(_0x560092,null))['catch'](handleError(_0x560092,null));};exports[_0x4564('0x59')]=function(_0x3238b4,_0x45ada4,_0x4c22a7){return db[_0x4564('0x30')][_0x4564('0x48')]({'where':{'id':_0x3238b4[_0x4564('0x46')]['id']}})['then'](handleEntityNotFound(_0x45ada4,null))[_0x4564('0x2a')](function(_0x40b46a){if(_0x40b46a){return _0x40b46a['removeMembers'](_0x3238b4[_0x4564('0x37')]['ids']);}})[_0x4564('0x2a')](respondWithStatusCode(_0x45ada4,null))[_0x4564('0x49')](handleError(_0x45ada4,null));};exports['addMessage']=function(_0x2432b4,_0x3d64a3,_0x2557e8){if(_0x2432b4['body']['id']){delete _0x2432b4[_0x4564('0x4b')]['id'];}return db[_0x4564('0x30')][_0x4564('0x48')]({'where':{'id':_0x2432b4[_0x4564('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d64a3,null))[_0x4564('0x2a')](function(_0x59e9a7){if(_0x59e9a7){_0x2432b4[_0x4564('0x4b')][_0x4564('0x5a')]=_0x59e9a7['id'];return db[_0x4564('0x4e')][_0x4564('0x4a')](_0x2432b4['body']);}})['then'](respondWithResult(_0x3d64a3,null))[_0x4564('0x49')](handleError(_0x3d64a3,null));};exports['getMessages']=function(_0x48933e,_0x39fcbf,_0x8277d9){var _0x150367={};var _0x207e2a={};var _0x46e847;var _0x444640;return db[_0x4564('0x30')][_0x4564('0x54')]({'where':{'id':_0x48933e[_0x4564('0x46')]['id']}})[_0x4564('0x2a')](handleEntityNotFound(_0x39fcbf,null))[_0x4564('0x2a')](function(_0x5d48f0){if(_0x5d48f0){_0x46e847=_0x5d48f0;_0x207e2a[_0x4564('0x35')]=_[_0x4564('0x38')](db[_0x4564('0x4e')][_0x4564('0x31')]);_0x207e2a['query']=_['keys'](_0x48933e['query']);_0x207e2a[_0x4564('0x39')]=_[_0x4564('0x3a')](_0x207e2a['model'],_0x207e2a['query']);_0x150367['attributes']=_[_0x4564('0x3a')](_0x207e2a[_0x4564('0x35')],qs['fields'](_0x48933e[_0x4564('0x37')][_0x4564('0x3c')]));_0x150367['attributes']=_0x150367[_0x4564('0x3b')][_0x4564('0x56')]?_0x150367[_0x4564('0x3b')]:_0x207e2a['model'];_0x150367['order']=qs[_0x4564('0x3f')](_0x48933e[_0x4564('0x37')][_0x4564('0x3f')]);_0x150367[_0x4564('0x40')]=qs[_0x4564('0x39')](_['pick'](_0x48933e[_0x4564('0x37')],_0x207e2a['filters']));if(_0x48933e[_0x4564('0x37')][_0x4564('0x58')]){_0x150367['where']=_[_0x4564('0x41')](_0x150367[_0x4564('0x40')],{'$or':_['map'](_0x150367[_0x4564('0x3b')],function(_0x308487){var _0x118042={};_0x118042[_0x308487]={'$like':'%'+_0x48933e[_0x4564('0x37')][_0x4564('0x58')]+'%'};return _0x118042;})});}if(_0x48933e[_0x4564('0x37')][_0x4564('0x5b')]){var _0x2eeef5=_0x48933e[_0x4564('0x37')]['$gte'][_0x4564('0x5c')](',');var _0x15999f={};_0x15999f[_0x2eeef5[0x0]]={'$gte':moment(_0x2eeef5[0x1])[_0x4564('0x5d')](_0x4564('0x5e'))};_0x150367[_0x4564('0x40')]=_[_0x4564('0x41')](_0x150367['where'],_0x15999f);}_0x150367=_[_0x4564('0x41')]({},_0x150367,_0x48933e[_0x4564('0x47')]);return _0x46e847['getMessages'](_0x150367);}})[_0x4564('0x2a')](function(_0x37d709){if(_0x37d709){_0x444640=_0x37d709['length'];if(!_0x48933e[_0x4564('0x37')][_0x4564('0x3d')](_0x4564('0x3e'))){_0x150367['limit']=qs[_0x4564('0x25')](_0x48933e[_0x4564('0x37')][_0x4564('0x25')]);_0x150367['offset']=qs[_0x4564('0x22')](_0x48933e[_0x4564('0x37')][_0x4564('0x22')]);}return _0x46e847['getMessages'](_0x150367);}})[_0x4564('0x2a')](function(_0x1228fd){if(_0x1228fd){return _0x1228fd?{'count':_0x444640,'rows':_0x1228fd}:null;}})[_0x4564('0x2a')](respondWithResult(_0x39fcbf,null))[_0x4564('0x49')](handleError(_0x39fcbf,null));}; \ No newline at end of file +var _0x15b7=['key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','show','params','keys','includeAll','find','catch','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','getMessages','$gte','split','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName'];(function(_0x488909,_0x58b353){var _0x3694d2=function(_0x518ff7){while(--_0x518ff7){_0x488909['push'](_0x488909['shift']());}};_0x3694d2(++_0x58b353);}(_0x15b7,0xe4));var _0x715b=function(_0x98c7ad,_0x580505){_0x98c7ad=_0x98c7ad-0x0;var _0xdd0fa3=_0x15b7[_0x98c7ad];return _0xdd0fa3;};'use strict';var emlformat=require(_0x715b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x715b('0x1'));var jsonpatch=require(_0x715b('0x2'));var rp=require(_0x715b('0x3'));var moment=require(_0x715b('0x4'));var BPromise=require(_0x715b('0x5'));var Mustache=require(_0x715b('0x6'));var util=require(_0x715b('0x7'));var path=require('path');var sox=require(_0x715b('0x8'));var csv=require('to-csv');var ejs=require(_0x715b('0x9'));var fs=require('fs');var fs_extra=require(_0x715b('0xa'));var _=require(_0x715b('0xb'));var squel=require(_0x715b('0xc'));var crypto=require(_0x715b('0xd'));var jsforce=require(_0x715b('0xe'));var deskjs=require(_0x715b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x715b('0x10'));var Papa=require(_0x715b('0x11'));var Redis=require('ioredis');var authService=require(_0x715b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x715b('0x13'))(_0x715b('0x14'));var utils=require(_0x715b('0x15'));var config=require(_0x715b('0x16'));var licenseUtil=require(_0x715b('0x17'));var db=require(_0x715b('0x18'))['db'];config['redis']=_['defaults'](config[_0x715b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x715b('0x1a'))(new Redis(config[_0x715b('0x19')]));require(_0x715b('0x1b'))[_0x715b('0x1c')](socket);function respondWithStatusCode(_0x54557b,_0x2a5593){_0x2a5593=_0x2a5593||0xcc;return function(_0x126d88){if(_0x126d88){return _0x54557b['sendStatus'](_0x2a5593);}return _0x54557b[_0x715b('0x1d')](_0x2a5593)[_0x715b('0x1e')]();};}function respondWithResult(_0x3f28bd,_0x33e145){_0x33e145=_0x33e145||0xc8;return function(_0x2d2c59){if(_0x2d2c59){return _0x3f28bd[_0x715b('0x1d')](_0x33e145)[_0x715b('0x1f')](_0x2d2c59);}};}function respondWithFilteredResult(_0x26a6ce,_0x289c2a){return function(_0x22f871){if(_0x22f871){var _0x572e2d=typeof _0x289c2a[_0x715b('0x20')]===_0x715b('0x21')&&typeof _0x289c2a[_0x715b('0x22')]==='undefined';var _0x2cad04=_0x22f871['count'];var _0x4595e8=_0x572e2d?0x0:_0x289c2a[_0x715b('0x20')];var _0xd2fc73=_0x572e2d?_0x22f871[_0x715b('0x23')]:_0x289c2a['offset']+_0x289c2a[_0x715b('0x22')];var _0x4d8860;if(_0xd2fc73>=_0x2cad04){_0xd2fc73=_0x2cad04;_0x4d8860=0xc8;}else{_0x4d8860=0xce;}_0x26a6ce['status'](_0x4d8860);return _0x26a6ce['set'](_0x715b('0x24'),_0x4595e8+'-'+_0xd2fc73+'/'+_0x2cad04)['json'](_0x22f871);}return null;};}function patchUpdates(_0x218e78){return function(_0x31d6ad){try{jsonpatch['apply'](_0x31d6ad,_0x218e78,!![]);}catch(_0x37fd0b){return BPromise[_0x715b('0x25')](_0x37fd0b);}return _0x31d6ad['save']();};}function saveUpdates(_0x43a741,_0x1f245c){return function(_0xe29c50){if(_0xe29c50){return _0xe29c50[_0x715b('0x26')](_0x43a741)[_0x715b('0x27')](function(_0x51de99){return _0x51de99;});}return null;};}function removeEntity(_0x3522f1,_0x204170){return function(_0x4e51d5){if(_0x4e51d5){return _0x4e51d5[_0x715b('0x28')]()[_0x715b('0x27')](function(){_0x3522f1[_0x715b('0x1d')](0xcc)[_0x715b('0x1e')]();});}};}function handleEntityNotFound(_0x19fc09,_0x4b35b6){return function(_0x4db692){if(!_0x4db692){_0x19fc09[_0x715b('0x29')](0x194);}return _0x4db692;};}function handleError(_0x555005,_0x452600){_0x452600=_0x452600||0x1f4;return function(_0xf26564){logger[_0x715b('0x2a')](_0xf26564[_0x715b('0x2b')]);if(_0xf26564[_0x715b('0x2c')]){delete _0xf26564[_0x715b('0x2c')];}_0x555005[_0x715b('0x1d')](_0x452600)[_0x715b('0x2d')](_0xf26564);};}exports[_0x715b('0x2e')]=function(_0x19690a,_0x2621ef){var _0x14b7ea={},_0x59fcb8={},_0x5236a2={'count':0x0,'rows':[]};var _0x40bba9=_[_0x715b('0x2f')](db[_0x715b('0x30')][_0x715b('0x31')],function(_0x16d0fc){return{'name':_0x16d0fc[_0x715b('0x32')],'type':_0x16d0fc['type'][_0x715b('0x33')]};});_0x59fcb8[_0x715b('0x34')]=_[_0x715b('0x2f')](_0x40bba9,_0x715b('0x2c'));_0x59fcb8[_0x715b('0x35')]=_['keys'](_0x19690a['query']);_0x59fcb8[_0x715b('0x36')]=_['intersection'](_0x59fcb8[_0x715b('0x34')],_0x59fcb8[_0x715b('0x35')]);_0x14b7ea[_0x715b('0x37')]=_[_0x715b('0x38')](_0x59fcb8['model'],qs[_0x715b('0x39')](_0x19690a['query'][_0x715b('0x39')]));_0x14b7ea['attributes']=_0x14b7ea['attributes'][_0x715b('0x3a')]?_0x14b7ea[_0x715b('0x37')]:_0x59fcb8[_0x715b('0x34')];if(!_0x19690a[_0x715b('0x35')][_0x715b('0x3b')](_0x715b('0x3c'))){_0x14b7ea[_0x715b('0x22')]=qs['limit'](_0x19690a[_0x715b('0x35')][_0x715b('0x22')]);_0x14b7ea[_0x715b('0x20')]=qs['offset'](_0x19690a[_0x715b('0x35')][_0x715b('0x20')]);}_0x14b7ea[_0x715b('0x3d')]=qs[_0x715b('0x3e')](_0x19690a[_0x715b('0x35')][_0x715b('0x3e')]);_0x14b7ea[_0x715b('0x3f')]=qs[_0x715b('0x36')](_[_0x715b('0x40')](_0x19690a[_0x715b('0x35')],_0x59fcb8['filters']),_0x40bba9);if(_0x19690a['query'][_0x715b('0x41')]){_0x14b7ea['where']=_[_0x715b('0x42')](_0x14b7ea[_0x715b('0x3f')],{'$or':_[_0x715b('0x2f')](_0x40bba9,function(_0x1af1c1){if(_0x1af1c1['type']!=='VIRTUAL'){var _0x588468={};_0x588468[_0x1af1c1[_0x715b('0x2c')]]={'$like':'%'+_0x19690a[_0x715b('0x35')]['filter']+'%'};return _0x588468;}})});}_0x14b7ea=_['merge']({},_0x14b7ea,_0x19690a[_0x715b('0x43')]);var _0x589ef0={'where':_0x14b7ea[_0x715b('0x3f')]};return db[_0x715b('0x30')][_0x715b('0x23')](_0x589ef0)[_0x715b('0x27')](function(_0x22c997){_0x5236a2[_0x715b('0x23')]=_0x22c997;if(_0x19690a[_0x715b('0x35')]['includeAll']){_0x14b7ea['include']=[{'all':!![]}];}return db[_0x715b('0x30')][_0x715b('0x44')](_0x14b7ea);})[_0x715b('0x27')](function(_0x3efa3f){_0x5236a2[_0x715b('0x45')]=_0x3efa3f;return _0x5236a2;})[_0x715b('0x27')](respondWithFilteredResult(_0x2621ef,_0x14b7ea))['catch'](handleError(_0x2621ef,null));};exports[_0x715b('0x46')]=function(_0x334836,_0x50cf76){var _0x3c4434={'raw':!![],'where':{'id':_0x334836[_0x715b('0x47')]['id']}},_0x383280={};_0x383280['model']=_[_0x715b('0x48')](db[_0x715b('0x30')][_0x715b('0x31')]);_0x383280[_0x715b('0x35')]=_[_0x715b('0x48')](_0x334836[_0x715b('0x35')]);_0x383280['filters']=_[_0x715b('0x38')](_0x383280[_0x715b('0x34')],_0x383280[_0x715b('0x35')]);_0x3c4434[_0x715b('0x37')]=_[_0x715b('0x38')](_0x383280['model'],qs[_0x715b('0x39')](_0x334836[_0x715b('0x35')]['fields']));_0x3c4434[_0x715b('0x37')]=_0x3c4434[_0x715b('0x37')][_0x715b('0x3a')]?_0x3c4434[_0x715b('0x37')]:_0x383280['model'];if(_0x334836['query'][_0x715b('0x49')]){_0x3c4434['include']=[{'all':!![]}];}_0x3c4434=_['merge']({},_0x3c4434,_0x334836[_0x715b('0x43')]);return db[_0x715b('0x30')][_0x715b('0x4a')](_0x3c4434)[_0x715b('0x27')](handleEntityNotFound(_0x50cf76,null))[_0x715b('0x27')](respondWithResult(_0x50cf76,null))[_0x715b('0x4b')](handleError(_0x50cf76,null));};exports[_0x715b('0x4c')]=function(_0x19a152,_0x4db4d0){return db[_0x715b('0x30')][_0x715b('0x4c')](_0x19a152['body'],{})[_0x715b('0x27')](respondWithResult(_0x4db4d0,0xc9))['catch'](handleError(_0x4db4d0,null));};exports[_0x715b('0x26')]=function(_0x2fa100,_0x42b5d4){if(_0x2fa100['body']['id']){delete _0x2fa100['body']['id'];}return db[_0x715b('0x30')][_0x715b('0x4a')]({'where':{'id':_0x2fa100['params']['id']}})[_0x715b('0x27')](handleEntityNotFound(_0x42b5d4,null))[_0x715b('0x27')](saveUpdates(_0x2fa100[_0x715b('0x4d')],null))['then'](respondWithResult(_0x42b5d4,null))[_0x715b('0x4b')](handleError(_0x42b5d4,null));};exports['destroy']=function(_0x29cafc,_0x30b994){return db[_0x715b('0x30')][_0x715b('0x4a')]({'where':{'id':_0x29cafc[_0x715b('0x47')]['id']}})[_0x715b('0x27')](handleEntityNotFound(_0x30b994,null))['then'](removeEntity(_0x30b994,null))[_0x715b('0x4b')](handleError(_0x30b994,null));};exports[_0x715b('0x4e')]=function(_0x47dd3f,_0x16b18d){return db[_0x715b('0x30')][_0x715b('0x4e')]()[_0x715b('0x27')](respondWithResult(_0x16b18d,null))[_0x715b('0x4b')](handleError(_0x16b18d,null));};exports[_0x715b('0x4f')]=function(_0x2b63f5,_0x485213,_0x242557){return db[_0x715b('0x50')][_0x715b('0x23')]({'where':{'ChatGroupId':_0x2b63f5['params']['id'],'ToId':_0x2b63f5['user']['id'],'read':![]}})['then'](function(_0x4dc3aa){return{'id':_[_0x715b('0x51')](_0x2b63f5[_0x715b('0x47')]['id']),'count':_0x4dc3aa};})[_0x715b('0x27')](respondWithResult(_0x485213,null))[_0x715b('0x4b')](handleError(_0x485213,null));};exports[_0x715b('0x52')]=function(_0x4b44d3,_0x376961,_0x4f5e24){return db['ChatGroup'][_0x715b('0x4a')]({'where':{'id':_0x4b44d3[_0x715b('0x47')]['id']}})['then'](handleEntityNotFound(_0x376961,null))['then'](function(_0x215efa){if(_0x215efa){return _0x215efa[_0x715b('0x52')](_0x4b44d3[_0x715b('0x4d')][_0x715b('0x53')],_[_0x715b('0x54')](_0x4b44d3[_0x715b('0x4d')],[_0x715b('0x53'),'id'])||{});}})[_0x715b('0x27')](respondWithResult(_0x376961,null))[_0x715b('0x4b')](handleError(_0x376961,null));};exports[_0x715b('0x55')]=function(_0x2edd74,_0x20e9d0,_0x458501){var _0x2cdf97={};var _0x503f60={};var _0x4dee29;var _0x4dfcb4;return db[_0x715b('0x30')][_0x715b('0x56')]({'where':{'id':_0x2edd74[_0x715b('0x47')]['id']}})[_0x715b('0x27')](handleEntityNotFound(_0x20e9d0,null))[_0x715b('0x27')](function(_0x382f49){if(_0x382f49){_0x4dee29=_0x382f49;_0x503f60[_0x715b('0x34')]=_['keys'](db[_0x715b('0x57')][_0x715b('0x31')]);_0x503f60[_0x715b('0x35')]=_[_0x715b('0x48')](_0x2edd74['query']);_0x503f60[_0x715b('0x36')]=_[_0x715b('0x38')](_0x503f60[_0x715b('0x34')],_0x503f60[_0x715b('0x35')]);_0x2cdf97[_0x715b('0x37')]=_[_0x715b('0x38')](_0x503f60[_0x715b('0x34')],qs[_0x715b('0x39')](_0x2edd74[_0x715b('0x35')][_0x715b('0x39')]));_0x2cdf97['attributes']=_0x2cdf97[_0x715b('0x37')][_0x715b('0x3a')]?_0x2cdf97['attributes']:_0x503f60[_0x715b('0x34')];_0x2cdf97[_0x715b('0x3d')]=qs[_0x715b('0x3e')](_0x2edd74['query'][_0x715b('0x3e')]);_0x2cdf97[_0x715b('0x3f')]=qs[_0x715b('0x36')](_['pick'](_0x2edd74[_0x715b('0x35')],_0x503f60[_0x715b('0x36')]));if(_0x2edd74[_0x715b('0x35')]['filter']){_0x2cdf97[_0x715b('0x3f')]=_['merge'](_0x2cdf97[_0x715b('0x3f')],{'$or':_['map'](_0x2cdf97['attributes'],function(_0x4fbc32){var _0x56b391={};_0x56b391[_0x4fbc32]={'$like':'%'+_0x2edd74[_0x715b('0x35')]['filter']+'%'};return _0x56b391;})});}_0x2cdf97=_['merge']({},_0x2cdf97,_0x2edd74[_0x715b('0x43')]);return _0x4dee29[_0x715b('0x55')](_0x2cdf97);}})['then'](function(_0x2e517f){if(_0x2e517f){_0x4dfcb4=_0x2e517f[_0x715b('0x3a')];if(!_0x2edd74[_0x715b('0x35')][_0x715b('0x3b')]('nolimit')){_0x2cdf97['limit']=qs[_0x715b('0x22')](_0x2edd74[_0x715b('0x35')][_0x715b('0x22')]);_0x2cdf97['offset']=qs['offset'](_0x2edd74['query'][_0x715b('0x20')]);}return _0x4dee29[_0x715b('0x55')](_0x2cdf97);}})[_0x715b('0x27')](function(_0x573e05){if(_0x573e05){return _0x573e05?{'count':_0x4dfcb4,'rows':_0x573e05}:null;}})[_0x715b('0x27')](respondWithResult(_0x20e9d0,null))[_0x715b('0x4b')](handleError(_0x20e9d0,null));};exports[_0x715b('0x58')]=function(_0x45b15e,_0x41880e,_0x16b2c2){return db[_0x715b('0x30')]['find']({'where':{'id':_0x45b15e['params']['id']}})['then'](handleEntityNotFound(_0x41880e,null))[_0x715b('0x27')](function(_0x5ee6da){if(_0x5ee6da){return _0x5ee6da['removeMembers'](_0x45b15e['query'][_0x715b('0x53')]);}})[_0x715b('0x27')](respondWithStatusCode(_0x41880e,null))['catch'](handleError(_0x41880e,null));};exports[_0x715b('0x59')]=function(_0x5ae078,_0x3c55d4,_0x151931){if(_0x5ae078[_0x715b('0x4d')]['id']){delete _0x5ae078['body']['id'];}return db[_0x715b('0x30')][_0x715b('0x4a')]({'where':{'id':_0x5ae078[_0x715b('0x47')]['id']}})['then'](handleEntityNotFound(_0x3c55d4,null))['then'](function(_0x160b5d){if(_0x160b5d){_0x5ae078['body']['ChatGroupId']=_0x160b5d['id'];return db[_0x715b('0x50')][_0x715b('0x4c')](_0x5ae078[_0x715b('0x4d')]);}})[_0x715b('0x27')](respondWithResult(_0x3c55d4,null))['catch'](handleError(_0x3c55d4,null));};exports[_0x715b('0x5a')]=function(_0xde2558,_0x297cc1,_0xb4923c){var _0x44bf2d={};var _0x37761e={};var _0x12a765;var _0x1f869c;return db[_0x715b('0x30')]['findOne']({'where':{'id':_0xde2558[_0x715b('0x47')]['id']}})[_0x715b('0x27')](handleEntityNotFound(_0x297cc1,null))[_0x715b('0x27')](function(_0x200860){if(_0x200860){_0x12a765=_0x200860;_0x37761e[_0x715b('0x34')]=_['keys'](db['ChatInternalMessage'][_0x715b('0x31')]);_0x37761e['query']=_['keys'](_0xde2558[_0x715b('0x35')]);_0x37761e['filters']=_[_0x715b('0x38')](_0x37761e[_0x715b('0x34')],_0x37761e[_0x715b('0x35')]);_0x44bf2d[_0x715b('0x37')]=_['intersection'](_0x37761e[_0x715b('0x34')],qs['fields'](_0xde2558[_0x715b('0x35')][_0x715b('0x39')]));_0x44bf2d[_0x715b('0x37')]=_0x44bf2d[_0x715b('0x37')]['length']?_0x44bf2d[_0x715b('0x37')]:_0x37761e[_0x715b('0x34')];_0x44bf2d['order']=qs['sort'](_0xde2558['query'][_0x715b('0x3e')]);_0x44bf2d['where']=qs['filters'](_[_0x715b('0x40')](_0xde2558[_0x715b('0x35')],_0x37761e[_0x715b('0x36')]));if(_0xde2558[_0x715b('0x35')][_0x715b('0x41')]){_0x44bf2d[_0x715b('0x3f')]=_[_0x715b('0x42')](_0x44bf2d['where'],{'$or':_[_0x715b('0x2f')](_0x44bf2d[_0x715b('0x37')],function(_0x38fdf2){var _0x591561={};_0x591561[_0x38fdf2]={'$like':'%'+_0xde2558['query'][_0x715b('0x41')]+'%'};return _0x591561;})});}if(_0xde2558[_0x715b('0x35')][_0x715b('0x5b')]){var _0x3fc437=_0xde2558['query']['$gte'][_0x715b('0x5c')](',');var _0x7ba279={};_0x7ba279[_0x3fc437[0x0]]={'$gte':moment(_0x3fc437[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x44bf2d['where']=_[_0x715b('0x42')](_0x44bf2d['where'],_0x7ba279);}_0x44bf2d=_['merge']({},_0x44bf2d,_0xde2558['options']);return _0x12a765[_0x715b('0x5a')](_0x44bf2d);}})['then'](function(_0x32d9b5){if(_0x32d9b5){_0x1f869c=_0x32d9b5['length'];if(!_0xde2558[_0x715b('0x35')][_0x715b('0x3b')](_0x715b('0x3c'))){_0x44bf2d[_0x715b('0x22')]=qs[_0x715b('0x22')](_0xde2558[_0x715b('0x35')][_0x715b('0x22')]);_0x44bf2d[_0x715b('0x20')]=qs[_0x715b('0x20')](_0xde2558[_0x715b('0x35')][_0x715b('0x20')]);}return _0x12a765[_0x715b('0x5a')](_0x44bf2d);}})[_0x715b('0x27')](function(_0x419c98){if(_0x419c98){return _0x419c98?{'count':_0x1f869c,'rows':_0x419c98}:null;}})['then'](respondWithResult(_0x297cc1,null))[_0x715b('0x4b')](handleError(_0x297cc1,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 23178ec..fa2c845 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 _0xb7ac=['emit','hasOwnProperty','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove'];(function(_0x5bce57,_0x3eaa6f){var _0x1625b6=function(_0x3b590e){while(--_0x3b590e){_0x5bce57['push'](_0x5bce57['shift']());}};_0x1625b6(++_0x3eaa6f);}(_0xb7ac,0x18a));var _0xcb7a=function(_0x173107,_0x361e82){_0x173107=_0x173107-0x0;var _0x347b60=_0xb7ac[_0x173107];return _0x347b60;};'use strict';var EventEmitter=require(_0xcb7a('0x0'));var ChatGroup=require(_0xcb7a('0x1'))['db'][_0xcb7a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcb7a('0x3')](0x0);var events={'afterCreate':_0xcb7a('0x4'),'afterUpdate':'update','afterDestroy':_0xcb7a('0x5')};function emitEvent(_0x4817ac){return function(_0x41408c,_0xaa5a21,_0x50be72){ChatGroupEvents[_0xcb7a('0x6')](_0x4817ac+':'+_0x41408c['id'],_0x41408c);ChatGroupEvents[_0xcb7a('0x6')](_0x4817ac,_0x41408c);_0x50be72(null);};}for(var e in events){if(events[_0xcb7a('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x3e65=['setMaxListeners','save','remove','emit','exports','events','ChatGroup'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x3e65,0xde));var _0x53e6=function(_0x27b413,_0x2e351d){_0x27b413=_0x27b413-0x0;var _0x30fef4=_0x3e65[_0x27b413];return _0x30fef4;};'use strict';var EventEmitter=require(_0x53e6('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x53e6('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x53e6('0x2')](0x0);var events={'afterCreate':_0x53e6('0x3'),'afterUpdate':'update','afterDestroy':_0x53e6('0x4')};function emitEvent(_0x5bc7d2){return function(_0x15a5c8,_0x4de2aa,_0x375153){ChatGroupEvents[_0x53e6('0x5')](_0x5bc7d2+':'+_0x15a5c8['id'],_0x15a5c8);ChatGroupEvents[_0x53e6('0x5')](_0x5bc7d2,_0x15a5c8);_0x375153(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x53e6('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 a85c312..ab20afe 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 _0xf764=['lodash','../../config/logger','bluebird','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups'];(function(_0x3af28b,_0x3c8cb2){var _0x2b30ba=function(_0x1d511b){while(--_0x1d511b){_0x3af28b['push'](_0x3af28b['shift']());}};_0x2b30ba(++_0x3c8cb2);}(_0xf764,0x129));var _0x4f76=function(_0x5f6743,_0x11a61a){_0x5f6743=_0x5f6743-0x0;var _0x26c658=_0xf764[_0x5f6743];return _0x26c658;};'use strict';var _=require(_0x4f76('0x0'));var util=require('util');var logger=require(_0x4f76('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4f76('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4f76('0x3'));var config=require(_0x4f76('0x4'));var attributes=require('./chatGroup.attributes');module[_0x4f76('0x5')]=function(_0x22134e,_0x108949){return _0x22134e[_0x4f76('0x6')](_0x4f76('0x7'),attributes,{'tableName':_0x4f76('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f99=['chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup'];(function(_0xfbfc07,_0x3681b0){var _0x23b6e6=function(_0x2ca326){while(--_0x2ca326){_0xfbfc07['push'](_0xfbfc07['shift']());}};_0x23b6e6(++_0x3681b0);}(_0x5f99,0x1ae));var _0x95f9=function(_0x4ecc53,_0x1cc6e8){_0x4ecc53=_0x4ecc53-0x0;var _0x16a418=_0x5f99[_0x4ecc53];return _0x16a418;};'use strict';var _=require(_0x95f9('0x0'));var util=require(_0x95f9('0x1'));var logger=require(_0x95f9('0x2'))(_0x95f9('0x3'));var moment=require('moment');var BPromise=require(_0x95f9('0x4'));var rp=require(_0x95f9('0x5'));var fs=require('fs');var path=require(_0x95f9('0x6'));var rimraf=require(_0x95f9('0x7'));var config=require(_0x95f9('0x8'));var attributes=require(_0x95f9('0x9'));module['exports']=function(_0xc5da65,_0x1fb516){return _0xc5da65[_0x95f9('0xa')](_0x95f9('0xb'),attributes,{'tableName':_0x95f9('0xc'),'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 b2859fd..48f0f9f 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 _0x59c3=['redis','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4161d0,_0x4233b1){var _0x426f3b=function(_0x1efaf1){while(--_0x1efaf1){_0x4161d0['push'](_0x4161d0['shift']());}};_0x426f3b(++_0x4233b1);}(_0x59c3,0x133));var _0x359c=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x59c3[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x359c('0x0'));var util=require(_0x359c('0x1'));var moment=require(_0x359c('0x2'));var BPromise=require(_0x359c('0x3'));var rs=require(_0x359c('0x4'));var fs=require('fs');var Redis=require(_0x359c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x359c('0x6'));var logger=require(_0x359c('0x7'))(_0x359c('0x8'));var config=require(_0x359c('0x9'));var jayson=require(_0x359c('0xa'));var client=jayson[_0x359c('0xb')]['http']({'port':0x232a});config[_0x359c('0xc')]=_['defaults'](config[_0x359c('0xc')],{'host':_0x359c('0xd'),'port':0x18eb});var socket=require(_0x359c('0xe'))(new Redis(config[_0x359c('0xc')]));require('./chatGroup.socket')[_0x359c('0xf')](socket);function respondWithRpcPromise(_0x4d99d0,_0x15b56d,_0x1d7417){return new BPromise(function(_0xb48a01,_0x134c91){return client[_0x359c('0x10')](_0x4d99d0,_0x1d7417)[_0x359c('0x11')](function(_0x5567d7){logger[_0x359c('0x12')](_0x359c('0x13'),_0x15b56d,_0x359c('0x14'));logger[_0x359c('0x15')](_0x359c('0x16'),_0x15b56d,_0x359c('0x14'),JSON[_0x359c('0x17')](_0x5567d7));if(_0x5567d7[_0x359c('0x18')]){if(_0x5567d7[_0x359c('0x18')][_0x359c('0x19')]===0x1f4){logger[_0x359c('0x18')](_0x359c('0x13'),_0x15b56d,_0x5567d7['error'][_0x359c('0x1a')]);return _0x134c91(_0x5567d7[_0x359c('0x18')]['message']);}logger[_0x359c('0x18')](_0x359c('0x13'),_0x15b56d,_0x5567d7[_0x359c('0x18')][_0x359c('0x1a')]);return _0xb48a01(_0x5567d7[_0x359c('0x18')][_0x359c('0x1a')]);}else{logger[_0x359c('0x12')](_0x359c('0x13'),_0x15b56d,_0x359c('0x14'));_0xb48a01(_0x5567d7[_0x359c('0x1b')][_0x359c('0x1a')]);}})[_0x359c('0x1c')](function(_0x6fa3c0){logger[_0x359c('0x18')](_0x359c('0x13'),_0x15b56d,_0x6fa3c0);_0x134c91(_0x6fa3c0);});});} \ No newline at end of file +var _0x80d9=['localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0x80d9,0xb6));var _0x980d=function(_0x4d6887,_0x10fad1){_0x4d6887=_0x4d6887-0x0;var _0x503748=_0x80d9[_0x4d6887];return _0x503748;};'use strict';var _=require(_0x980d('0x0'));var util=require(_0x980d('0x1'));var moment=require(_0x980d('0x2'));var BPromise=require(_0x980d('0x3'));var rs=require(_0x980d('0x4'));var fs=require('fs');var Redis=require(_0x980d('0x5'));var db=require(_0x980d('0x6'))['db'];var utils=require(_0x980d('0x7'));var logger=require('../../config/logger')(_0x980d('0x8'));var config=require(_0x980d('0x9'));var jayson=require(_0x980d('0xa'));var client=jayson[_0x980d('0xb')][_0x980d('0xc')]({'port':0x232a});config[_0x980d('0xd')]=_['defaults'](config[_0x980d('0xd')],{'host':_0x980d('0xe'),'port':0x18eb});var socket=require(_0x980d('0xf'))(new Redis(config[_0x980d('0xd')]));require(_0x980d('0x10'))['register'](socket);function respondWithRpcPromise(_0x2b5c39,_0x27cdfa,_0x3a059a){return new BPromise(function(_0x340a8d,_0x135fee){return client[_0x980d('0x11')](_0x2b5c39,_0x3a059a)[_0x980d('0x12')](function(_0x4856e0){logger[_0x980d('0x13')](_0x980d('0x14'),_0x27cdfa,_0x980d('0x15'));logger['debug'](_0x980d('0x16'),_0x27cdfa,_0x980d('0x15'),JSON[_0x980d('0x17')](_0x4856e0));if(_0x4856e0[_0x980d('0x18')]){if(_0x4856e0[_0x980d('0x18')]['code']===0x1f4){logger[_0x980d('0x18')](_0x980d('0x14'),_0x27cdfa,_0x4856e0[_0x980d('0x18')][_0x980d('0x19')]);return _0x135fee(_0x4856e0[_0x980d('0x18')]['message']);}logger[_0x980d('0x18')](_0x980d('0x14'),_0x27cdfa,_0x4856e0['error'][_0x980d('0x19')]);return _0x340a8d(_0x4856e0[_0x980d('0x18')][_0x980d('0x19')]);}else{logger[_0x980d('0x13')](_0x980d('0x14'),_0x27cdfa,_0x980d('0x15'));_0x340a8d(_0x4856e0[_0x980d('0x1a')]['message']);}})[_0x980d('0x1b')](function(_0x1b2815){logger[_0x980d('0x18')]('ChatGroup,\x20%s,\x20%s',_0x27cdfa,_0x1b2815);_0x135fee(_0x1b2815);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 180eb29..18a5c4b 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 _0x0e74=['register','length','chatGroup:','./chatGroup.events','save','remove','removeListener'];(function(_0x388e37,_0x40009f){var _0x4886f2=function(_0x12e42b){while(--_0x12e42b){_0x388e37['push'](_0x388e37['shift']());}};_0x4886f2(++_0x40009f);}(_0x0e74,0xff));var _0x40e7=function(_0x496556,_0x3742a7){_0x496556=_0x496556-0x0;var _0x179755=_0x0e74[_0x496556];return _0x179755;};'use strict';var ChatGroupEvents=require(_0x40e7('0x0'));var events=[_0x40e7('0x1'),_0x40e7('0x2'),'update'];function createListener(_0x4287f1,_0x580f60){return function(_0x377bb5){_0x580f60['emit'](_0x4287f1,_0x377bb5);};}function removeListener(_0x597d7c,_0x351c7f){return function(){ChatGroupEvents[_0x40e7('0x3')](_0x597d7c,_0x351c7f);};}exports[_0x40e7('0x4')]=function(_0x30249d){for(var _0x57da45=0x0,_0x3fbd6a=events[_0x40e7('0x5')];_0x57da45<_0x3fbd6a;_0x57da45++){var _0x41218a=events[_0x57da45];var _0x465a1b=createListener(_0x40e7('0x6')+_0x41218a,_0x30249d);ChatGroupEvents['on'](_0x41218a,_0x465a1b);}}; \ No newline at end of file +var _0x0afe=['length','chatGroup:','./chatGroup.events','save','remove','removeListener','register'];(function(_0x597646,_0x3b7fa5){var _0x3d2ee8=function(_0x8fe622){while(--_0x8fe622){_0x597646['push'](_0x597646['shift']());}};_0x3d2ee8(++_0x3b7fa5);}(_0x0afe,0xbf));var _0xe0af=function(_0x5f20bc,_0x518cf7){_0x5f20bc=_0x5f20bc-0x0;var _0x56f81a=_0x0afe[_0x5f20bc];return _0x56f81a;};'use strict';var ChatGroupEvents=require(_0xe0af('0x0'));var events=[_0xe0af('0x1'),_0xe0af('0x2'),'update'];function createListener(_0x41b0a8,_0x44f5ce){return function(_0x4fbc31){_0x44f5ce['emit'](_0x41b0a8,_0x4fbc31);};}function removeListener(_0x1be16b,_0x30c9fb){return function(){ChatGroupEvents[_0xe0af('0x3')](_0x1be16b,_0x30c9fb);};}exports[_0xe0af('0x4')]=function(_0x49b2fc){for(var _0x2ec13e=0x0,_0x230219=events[_0xe0af('0x5')];_0x2ec13e<_0x230219;_0x2ec13e++){var _0x5b31d8=events[_0x2ec13e];var _0x28904e=createListener(_0xe0af('0x6')+_0x5b31d8,_0x49b2fc);ChatGroupEvents['on'](_0x5b31d8,_0x28904e);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index c635e59..9f73f81 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 _0x3563=['getMessages','post','create','addMessage','update','/:id','destroy','removeMembers','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','getUnread','/:id/members','getMembers','/:id/messages'];(function(_0x2228c6,_0x5dc541){var _0x4fff90=function(_0x430ca9){while(--_0x430ca9){_0x2228c6['push'](_0x2228c6['shift']());}};_0x4fff90(++_0x5dc541);}(_0x3563,0x11c));var _0x3356=function(_0x56a157,_0x1e2e6a){_0x56a157=_0x56a157-0x0;var _0x1a2e12=_0x3563[_0x56a157];return _0x1a2e12;};'use strict';var multer=require('multer');var util=require(_0x3356('0x0'));var path=require('path');var timeout=require(_0x3356('0x1'));var express=require(_0x3356('0x2'));var router=express['Router']();var fs_extra=require(_0x3356('0x3'));var auth=require(_0x3356('0x4'));var interaction=require(_0x3356('0x5'));var config=require(_0x3356('0x6'));var controller=require(_0x3356('0x7'));router[_0x3356('0x8')]('/',auth[_0x3356('0x9')](),controller['index']);router[_0x3356('0x8')](_0x3356('0xa'),auth[_0x3356('0x9')](),controller[_0x3356('0xb')]);router[_0x3356('0x8')]('/:id',auth[_0x3356('0x9')](),controller['show']);router[_0x3356('0x8')]('/:id/unread',auth[_0x3356('0x9')](),controller[_0x3356('0xc')]);router[_0x3356('0x8')](_0x3356('0xd'),auth[_0x3356('0x9')](),controller[_0x3356('0xe')]);router[_0x3356('0x8')](_0x3356('0xf'),auth[_0x3356('0x9')](),controller[_0x3356('0x10')]);router[_0x3356('0x11')]('/',auth['isAuthenticated'](),controller[_0x3356('0x12')]);router[_0x3356('0x11')]('/:id/members',auth[_0x3356('0x9')](),controller['addMembers']);router[_0x3356('0x11')](_0x3356('0xf'),auth[_0x3356('0x9')](),controller[_0x3356('0x13')]);router['put']('/:id',auth[_0x3356('0x9')](),controller[_0x3356('0x14')]);router['delete'](_0x3356('0x15'),auth['isAuthenticated'](),controller[_0x3356('0x16')]);router['delete'](_0x3356('0xd'),auth['isAuthenticated'](),controller[_0x3356('0x17')]);module[_0x3356('0x18')]=router; \ No newline at end of file +var _0xa4b4=['getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','update','destroy','removeMembers','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id/unread'];(function(_0x91188d,_0x2d2019){var _0x2f47ae=function(_0x10e0e8){while(--_0x10e0e8){_0x91188d['push'](_0x91188d['shift']());}};_0x2f47ae(++_0x2d2019);}(_0xa4b4,0x12a));var _0x4a4b=function(_0x1ca29f,_0x318ac5){_0x1ca29f=_0x1ca29f-0x0;var _0x576c3b=_0xa4b4[_0x1ca29f];return _0x576c3b;};'use strict';var multer=require('multer');var util=require(_0x4a4b('0x0'));var path=require(_0x4a4b('0x1'));var timeout=require(_0x4a4b('0x2'));var express=require(_0x4a4b('0x3'));var router=express['Router']();var fs_extra=require(_0x4a4b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4a4b('0x5'));var config=require(_0x4a4b('0x6'));var controller=require(_0x4a4b('0x7'));router[_0x4a4b('0x8')]('/',auth[_0x4a4b('0x9')](),controller[_0x4a4b('0xa')]);router[_0x4a4b('0x8')](_0x4a4b('0xb'),auth[_0x4a4b('0x9')](),controller[_0x4a4b('0xc')]);router[_0x4a4b('0x8')]('/:id',auth[_0x4a4b('0x9')](),controller['show']);router[_0x4a4b('0x8')](_0x4a4b('0xd'),auth[_0x4a4b('0x9')](),controller[_0x4a4b('0xe')]);router[_0x4a4b('0x8')](_0x4a4b('0xf'),auth[_0x4a4b('0x9')](),controller[_0x4a4b('0x10')]);router[_0x4a4b('0x8')](_0x4a4b('0x11'),auth[_0x4a4b('0x9')](),controller[_0x4a4b('0x12')]);router[_0x4a4b('0x13')]('/',auth[_0x4a4b('0x9')](),controller[_0x4a4b('0x14')]);router[_0x4a4b('0x13')](_0x4a4b('0xf'),auth[_0x4a4b('0x9')](),controller[_0x4a4b('0x15')]);router[_0x4a4b('0x13')](_0x4a4b('0x11'),auth['isAuthenticated'](),controller['addMessage']);router['put']('/:id',auth[_0x4a4b('0x9')](),controller[_0x4a4b('0x16')]);router['delete']('/:id',auth[_0x4a4b('0x9')](),controller[_0x4a4b('0x17')]);router['delete'](_0x4a4b('0xf'),auth[_0x4a4b('0x9')](),controller[_0x4a4b('0x18')]);module[_0x4a4b('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 6d51686..6a11e7c 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 _0xf996=['star','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','ENUM'];(function(_0x290fa6,_0x16d017){var _0x47f1f3=function(_0x2b5eb8){while(--_0x2b5eb8){_0x290fa6['push'](_0x290fa6['shift']());}};_0x47f1f3(++_0x16d017);}(_0xf996,0x74));var _0x6f99=function(_0x1a5b50,_0x178c12){_0x1a5b50=_0x1a5b50-0x0;var _0x1c325f=_0xf996[_0x1a5b50];return _0x1c325f;};'use strict';var Sequelize=require(_0x6f99('0x0'));module[_0x6f99('0x1')]={'closed':{'type':Sequelize[_0x6f99('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x6f99('0x3')]('star','thumb'),'defaultValue':_0x6f99('0x4')},'ratingMessage':{'type':Sequelize[_0x6f99('0x5')]},'pathTranscript':{'type':Sequelize[_0x6f99('0x5')]},'mailTranscript':{'type':Sequelize[_0x6f99('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6f99('0x7')]},'disposition':{'type':Sequelize[_0x6f99('0x6')]},'secondDisposition':{'type':Sequelize[_0x6f99('0x6')]},'thirdDisposition':{'type':Sequelize[_0x6f99('0x6')]},'note':{'type':Sequelize[_0x6f99('0x6')]},'browserName':{'type':Sequelize[_0x6f99('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x6f99('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x6f99('0x6')]},'deviceVendor':{'type':Sequelize[_0x6f99('0x6')]},'deviceType':{'type':Sequelize[_0x6f99('0x6')]},'referer':{'type':Sequelize[_0x6f99('0x5')]},'customerIp':{'type':Sequelize[_0x6f99('0x6')]},'formData':{'type':Sequelize[_0x6f99('0x5')](_0x6f99('0x8'))},'read1stAt':{'type':Sequelize[_0x6f99('0x7')]},'lastMsgAt':{'type':Sequelize[_0x6f99('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6f99('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x6f99('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf69c=['ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','long'];(function(_0xb09609,_0x1c4aed){var _0x1130da=function(_0x35e50b){while(--_0x35e50b){_0xb09609['push'](_0xb09609['shift']());}};_0x1130da(++_0x1c4aed);}(_0xf69c,0x1e2));var _0xcf69=function(_0x51057a,_0x2c8c27){_0x51057a=_0x51057a-0x0;var _0x3cbdaa=_0xf69c[_0x51057a];return _0x3cbdaa;};'use strict';var Sequelize=require(_0xcf69('0x0'));module[_0xcf69('0x1')]={'closed':{'type':Sequelize[_0xcf69('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xcf69('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xcf69('0x4'),_0xcf69('0x5')),'defaultValue':_0xcf69('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xcf69('0x6')]},'mailTranscript':{'type':Sequelize[_0xcf69('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xcf69('0x8')]},'disposition':{'type':Sequelize[_0xcf69('0x7')]},'secondDisposition':{'type':Sequelize[_0xcf69('0x7')]},'thirdDisposition':{'type':Sequelize[_0xcf69('0x7')]},'note':{'type':Sequelize[_0xcf69('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xcf69('0x7')]},'osName':{'type':Sequelize[_0xcf69('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xcf69('0x7')]},'deviceVendor':{'type':Sequelize[_0xcf69('0x7')]},'deviceType':{'type':Sequelize[_0xcf69('0x7')]},'referer':{'type':Sequelize[_0xcf69('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xcf69('0x6')](_0xcf69('0x9'))},'read1stAt':{'type':Sequelize[_0xcf69('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcf69('0xa')]('in',_0xcf69('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xcf69('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xcf69('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xcf69('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f44272e..2caab71 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 _0x048e=['filename','mimetype','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','close','mailTranscript','transcript-%s.txt','pathTranscript','Messages','ChatWebsite','format','%s%d','agentAlias','customer','Visitor','agentIdentifier','System','agent_alias','alias','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','addTags','spread','emit','removeTags','download','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Attachment','mkdirSync','Chat','Account','Owner','closedAt','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','direction','lastName','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','render','merge','contact','agent','interaction','account','map','fullname','Tags','TagIds','forEach','waiting','answered','unmanaged','abandoned','total','closed','talking','disposition','UserId','index','ChatInteraction','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','field','color','from','tools_tags','select','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','length','unreadMessages','value','having','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','body','compact','isEmpty','ChatWebsiteId','concat','createdAt','$gte','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','vidaooMetadata','metadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file'];(function(_0x4f3df8,_0x23d95d){var _0xd21ff1=function(_0xc31660){while(--_0xc31660){_0x4f3df8['push'](_0x4f3df8['shift']());}};_0xd21ff1(++_0x23d95d);}(_0x048e,0x193));var _0xe048=function(_0x3b7f91,_0x260ad7){_0x3b7f91=_0x3b7f91-0x0;var _0x34c1cc=_0x048e[_0x3b7f91];return _0x34c1cc;};'use strict';var emlformat=require(_0xe048('0x0'));var rimraf=require(_0xe048('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe048('0x2'));var rp=require('request-promise');var moment=require(_0xe048('0x3'));var BPromise=require(_0xe048('0x4'));var Mustache=require('mustache');var util=require(_0xe048('0x5'));var path=require(_0xe048('0x6'));var sox=require(_0xe048('0x7'));var csv=require(_0xe048('0x8'));var ejs=require(_0xe048('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe048('0xa'));var squel=require(_0xe048('0xb'));var crypto=require('crypto');var jsforce=require(_0xe048('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe048('0x8'));var querystring=require(_0xe048('0xd'));var Papa=require('papaparse');var Redis=require(_0xe048('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe048('0xf'));var as=require(_0xe048('0x10'));var pdf=require(_0xe048('0x11'));var hardwareService=require(_0xe048('0x12'));var logger=require(_0xe048('0x13'))(_0xe048('0x14'));var utils=require(_0xe048('0x15'));var config=require(_0xe048('0x16'));var licenseUtil=require(_0xe048('0x17'));var db=require(_0xe048('0x18'))['db'];config[_0xe048('0x19')]=_[_0xe048('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe048('0x19')]));require('./chatInteraction.socket')[_0xe048('0x1b')](socket);var jayson=require(_0xe048('0x1c'));var client=jayson[_0xe048('0x1d')]['http']({'port':0x232b});var client9004=jayson[_0xe048('0x1d')][_0xe048('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x59e309,_0x411dc4,_0x4b02ee,_0x158203){return new BPromise(function(_0x457122,_0x2ce42f){var _0x325c54=_0x158203||client;return _0x325c54[_0xe048('0x1f')](_0x59e309,_0x4b02ee)[_0xe048('0x20')](function(_0x3aa2ab){logger[_0xe048('0x21')](_0xe048('0x22'),_0x411dc4,_0xe048('0x23'));logger[_0xe048('0x24')](_0xe048('0x25'),_0x411dc4,_0xe048('0x23'),JSON[_0xe048('0x26')](_0x3aa2ab));if(_0x3aa2ab['error']){if(_0x3aa2ab['error'][_0xe048('0x27')]===0x1f4){logger[_0xe048('0x28')](_0xe048('0x22'),_0x411dc4,_0x3aa2ab[_0xe048('0x28')][_0xe048('0x29')]);return _0x2ce42f(_0x3aa2ab[_0xe048('0x28')][_0xe048('0x29')]);}logger[_0xe048('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x411dc4,_0x3aa2ab[_0xe048('0x28')][_0xe048('0x29')]);return _0x457122(_0x3aa2ab[_0xe048('0x28')][_0xe048('0x29')]);}else{logger[_0xe048('0x21')](_0xe048('0x22'),_0x411dc4,'request\x20sent');_0x457122(_0x3aa2ab['result'][_0xe048('0x29')]);}})[_0xe048('0x2a')](function(_0x5ca164){logger[_0xe048('0x28')](_0xe048('0x22'),_0x411dc4,_0x5ca164);_0x2ce42f(_0x5ca164);});});}function respondWithStatusCode(_0x172ff8,_0x57e92a){_0x57e92a=_0x57e92a||0xcc;return function(_0x37ea54){if(_0x37ea54){return _0x172ff8['sendStatus'](_0x57e92a);}return _0x172ff8[_0xe048('0x2b')](_0x57e92a)[_0xe048('0x2c')]();};}function respondWithResult(_0x4b6001,_0x10ce2a){_0x10ce2a=_0x10ce2a||0xc8;return function(_0x4c2fdf){if(_0x4c2fdf){return _0x4b6001[_0xe048('0x2b')](_0x10ce2a)[_0xe048('0x2d')](_0x4c2fdf);}};}function respondWithFilteredResult(_0x2478bb,_0x480249){return function(_0x255dd6){if(_0x255dd6){var _0x1a069b=typeof _0x480249[_0xe048('0x2e')]==='undefined'&&typeof _0x480249[_0xe048('0x2f')]==='undefined';var _0x8e0ae0=_0x255dd6[_0xe048('0x30')];var _0x8f8f23=_0x1a069b?0x0:_0x480249['offset'];var _0x3f1d2e=_0x1a069b?_0x255dd6['count']:_0x480249['offset']+_0x480249['limit'];var _0x576301;if(_0x3f1d2e>=_0x8e0ae0){_0x3f1d2e=_0x8e0ae0;_0x576301=0xc8;}else{_0x576301=0xce;}_0x2478bb['status'](_0x576301);return _0x2478bb[_0xe048('0x31')](_0xe048('0x32'),_0x8f8f23+'-'+_0x3f1d2e+'/'+_0x8e0ae0)['json'](_0x255dd6);}return null;};}function patchUpdates(_0x1bdaa8){return function(_0x351138){try{jsonpatch['apply'](_0x351138,_0x1bdaa8,!![]);}catch(_0x4b36b5){return BPromise[_0xe048('0x33')](_0x4b36b5);}return _0x351138[_0xe048('0x34')]();};}function saveUpdates(_0x39fd8b,_0x5dc3e5){return function(_0x58ecc4){if(_0x58ecc4){return _0x58ecc4[_0xe048('0x35')](_0x39fd8b)[_0xe048('0x20')](function(_0x45172a){return _0x45172a;});}return null;};}function removeEntity(_0x5eb8c8,_0x4d16d7){return function(_0x3ae22b){if(_0x3ae22b){return _0x3ae22b[_0xe048('0x36')]()[_0xe048('0x20')](function(){_0x5eb8c8[_0xe048('0x2b')](0xcc)[_0xe048('0x2c')]();});}};}function handleEntityNotFound(_0x44ece6,_0x3ed0de){return function(_0xa50a8e){if(!_0xa50a8e){_0x44ece6[_0xe048('0x37')](0x194);}return _0xa50a8e;};}function handleError(_0x2ba890,_0x2253e0){_0x2253e0=_0x2253e0||0x1f4;return function(_0x19985d){logger[_0xe048('0x28')](_0x19985d[_0xe048('0x38')]);if(_0x19985d['name']){delete _0x19985d[_0xe048('0x39')];}_0x2ba890[_0xe048('0x2b')](_0x2253e0)['send'](_0x19985d);};}function getMustacheRender(_0x1b4a35,_0x2f8995){return Mustache[_0xe048('0x3a')](_0x1b4a35,_[_0xe048('0x3b')](_0x2f8995['body'],{'contact':_0x2f8995[_0xe048('0x3c')],'message':_0x2f8995[_0xe048('0x29')],'agent':_0x2f8995[_0xe048('0x3d')],'interaction':_0x2f8995[_0xe048('0x3e')],'account':_0x2f8995[_0xe048('0x3f')]}))||'';}function getInteractionUsers(_0x9b22ac,_0x5763e2){return new BPromise(function(_0x41284c,_0x348cd4){try{if(_0x5763e2[_0x9b22ac['id']]){_0x9b22ac['Users']=_[_0xe048('0x40')](_0x5763e2[_0x9b22ac['id']],function(_0xa1f7d3){return{'id':_0xa1f7d3['id'],'fullname':_0xa1f7d3[_0xe048('0x41')]};});}}catch(_0x4edc0a){_0x348cd4(_0x4edc0a);}_0x41284c(_0x9b22ac);});}function getInteractionTags(_0x2b8622,_0x5db439){return new BPromise(function(_0x599a3b,_0x263cae){try{if(_0x2b8622['TagIds']){_0x2b8622[_0xe048('0x42')]=[];_0x2b8622[_0xe048('0x43')]['split'](',')[_0xe048('0x44')](function(_0x9fd7d2){_0x2b8622[_0xe048('0x42')]['push'](_0x5db439[_0x9fd7d2]);});}delete _0x2b8622[_0xe048('0x43')];}catch(_0x5db425){_0x263cae(_0x5db425);}_0x599a3b(_0x2b8622);});}function updateChatInteraction(_0x9449f0,_0x852adc,_0x5585e6){return new BPromise(function(_0x3ab48d,_0x33429d){return getInteractionUsers(_0x9449f0,_0x5585e6)[_0xe048('0x20')](function(_0x3869fa){return getInteractionTags(_0x3869fa,_0x852adc);})[_0xe048('0x20')](function(_0x42987a){return getStateInteraction(_0x42987a);})[_0xe048('0x20')](function(_0x1cb14b){_0x3ab48d(_0x1cb14b);})['catch'](function(_0x13ebe3){_0x33429d(_0x13ebe3);});});}function getStateInteraction(_0x18d287){return new BPromise(function(_0x21125d){_0x18d287[_0xe048('0x45')]=0x0;_0x18d287['talking']=0x0;_0x18d287[_0xe048('0x46')]=0x0;_0x18d287[_0xe048('0x47')]=0x0;_0x18d287[_0xe048('0x48')]=0x0;_0x18d287[_0xe048('0x49')]=0x0;if(!_0x18d287[_0xe048('0x4a')]&&!_0x18d287['UserId']){_0x18d287[_0xe048('0x45')]+=0x1;}if(!_0x18d287[_0xe048('0x4a')]&&_0x18d287['UserId']){_0x18d287[_0xe048('0x4b')]+=0x1;if(_0x18d287['waiting']){_0x18d287[_0xe048('0x45')]-=0x1;}}if(_0x18d287['closed']&&_0x18d287[_0xe048('0x4c')]===_0xe048('0x48')){_0x18d287[_0xe048('0x48')]+=0x1;if(_0x18d287['waiting']){_0x18d287['waiting']-=0x1;}}else if(_0x18d287[_0xe048('0x4a')]&&!_0x18d287[_0xe048('0x4d')]&&_0x18d287[_0xe048('0x4c')]){_0x18d287[_0xe048('0x47')]+=0x1;if(_0x18d287[_0xe048('0x45')]){_0x18d287[_0xe048('0x45')]-=0x1;}}else if(_0x18d287[_0xe048('0x4a')]&&_0x18d287[_0xe048('0x4d')]){_0x18d287[_0xe048('0x46')]+=0x1;if(_0x18d287[_0xe048('0x4b')]){_0x18d287[_0xe048('0x4b')]-=0x1;}}_0x18d287[_0xe048('0x49')]+=0x1;_0x21125d(_0x18d287);});}exports[_0xe048('0x4e')]=function(_0xed9abe,_0x4c7811){var _0x484faa={},_0x5bf7a6={},_0x353545={'count':0x0,'rows':[]};var _0x32bc36=_[_0xe048('0x40')](db[_0xe048('0x4f')][_0xe048('0x50')],function(_0x5e4169){return{'name':_0x5e4169[_0xe048('0x51')],'type':_0x5e4169['type']['key']};});_0x5bf7a6[_0xe048('0x52')]=_['map'](_0x32bc36,_0xe048('0x39'));_0x5bf7a6[_0xe048('0x53')]=_[_0xe048('0x54')](_0xed9abe['query']);_0x5bf7a6[_0xe048('0x55')]=_['intersection'](_0x5bf7a6[_0xe048('0x52')],_0x5bf7a6[_0xe048('0x53')]);_0x484faa[_0xe048('0x56')]=_[_0xe048('0x57')](_0x5bf7a6[_0xe048('0x52')],qs[_0xe048('0x58')](_0xed9abe[_0xe048('0x53')]['fields']));_0x484faa[_0xe048('0x56')]=_0x484faa['attributes']['length']?_0x484faa[_0xe048('0x56')]:_0x5bf7a6[_0xe048('0x52')];if(!_0xed9abe[_0xe048('0x53')][_0xe048('0x59')](_0xe048('0x5a'))){_0x484faa[_0xe048('0x2f')]=qs[_0xe048('0x2f')](_0xed9abe['query'][_0xe048('0x2f')]);_0x484faa[_0xe048('0x2e')]=qs[_0xe048('0x2e')](_0xed9abe[_0xe048('0x53')]['offset']);}_0x484faa[_0xe048('0x5b')]=qs[_0xe048('0x5c')](_0xed9abe[_0xe048('0x53')][_0xe048('0x5c')]);_0x484faa['where']=qs[_0xe048('0x55')](_[_0xe048('0x5d')](_0xed9abe[_0xe048('0x53')],_0x5bf7a6[_0xe048('0x55')]),_0x32bc36);var _0x19459c=[];var _0x58f98f=squel['select']()[_0xe048('0x5e')]('id')[_0xe048('0x5e')]('name')[_0xe048('0x5e')](_0xe048('0x5f'))[_0xe048('0x60')](_0xe048('0x61'));var _0xf65257=squel[_0xe048('0x62')]()[_0xe048('0x5e')](_0xe048('0x63'))['field']('u.fullname')[_0xe048('0x5e')](_0xe048('0x64'))[_0xe048('0x60')](_0xe048('0x65'),'ui')[_0xe048('0x66')](_0xe048('0x67'),'u',_0xe048('0x68'));var _0x2e19d2=squel[_0xe048('0x62')]()[_0xe048('0x60')](_0xe048('0x69'),'i')[_0xe048('0x66')](_0xe048('0x6a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xe048('0x67'),'o',_0xe048('0x6b'))[_0xe048('0x66')]('chat_websites','a',_0xe048('0x6c'))['left_join'](_0xe048('0x6d'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xe048('0x66')]('chat_interaction_has_tags','it',_0xe048('0x6e'))['left_join'](_0xe048('0x61'),'t',_0xe048('0x6f'));var _0x30f51e=squel[_0xe048('0x70')]();var _0x281398=[];var _0x47a828=squel[_0xe048('0x70')]();var _0x35f4eb;if(_0xed9abe[_0xe048('0x53')]['search']){_0x35f4eb=as[_0xe048('0x71')](_0xed9abe[_0xe048('0x53')][_0xe048('0x72')]);var _0x229135=_0x35f4eb[_0xe048('0x73')];for(var _0x5e6e7f=0x0;_0x5e6e7f<_0x35f4eb[_0xe048('0x74')][_0xe048('0x75')];_0x5e6e7f++){var _0x2c8235=_0x35f4eb[_0xe048('0x74')][_0x5e6e7f];var _0xc3884c='i';var _0x44e3a3=_['find'](_0x32bc36,[_0xe048('0x39'),_0x2c8235[_0xe048('0x5e')]]);if(!_0x44e3a3){switch(_0x2c8235[_0xe048('0x5e')]){case _0xe048('0x76'):if(_0x2c8235[_0xe048('0x77')]==0x1){_0x2e19d2['having']('`'+_0x2c8235[_0xe048('0x5e')]+'`\x20=\x200');}else{_0x2e19d2[_0xe048('0x78')]('`'+_0x2c8235[_0xe048('0x5e')]+'`\x20>\x200');}break;case _0xe048('0x79'):if(_0x2c8235['operator']===_0xe048('0x7a')){if(_0x2c8235[_0xe048('0x77')][_0xe048('0x7b')]('\x20')[_0xe048('0x75')]>0x1){_0x30f51e[_0x229135](_0xe048('0x7c'),qs[_0xe048('0x7d')](_0x2c8235[_0xe048('0x77')]),null);}else{var _0x39ca22='%'+_0x2c8235[_0xe048('0x77')]+'%';_0x30f51e[_0x229135](_0xe048('0x7e'),_0x39ca22,_0x39ca22,_0x39ca22);}}else{_0x44e3a3=_['find'](_0x32bc36,[_0xe048('0x39'),_0xe048('0x7f')]);_0x2c8235['field']=_0xe048('0x7f');_0x2fa21c=as[_0xe048('0x80')](_0xc3884c,_0x44e3a3[_0xe048('0x81')],_0x2c8235);_0x30f51e[_0x229135](_0x2fa21c[_0xe048('0x82')],_0x2fa21c[_0xe048('0x77')][_0xe048('0x83')],_0x2fa21c[_0xe048('0x77')][_0xe048('0x2c')]);}break;case _0xe048('0x84'):var _0x3e826d=_0x2c8235[_0xe048('0x77')][_0xe048('0x7b')](',')[_0xe048('0x40')](function(_0x415f19){return Number(_0x415f19);});_0x3e826d['forEach'](function(_0xf6d700){_0x47a828['or'](_0xe048('0x85'),'%,'+_0xf6d700+',%');});_0x281398=_[_0xe048('0x86')](_0x281398,_0x3e826d);break;case _0xe048('0x87'):if(_0x2c8235[_0xe048('0x88')]===_0xe048('0x7a')){_0x30f51e[_0x229135](_0xe048('0x89'),'%'+_0x2c8235[_0xe048('0x77')]+'%',null);}else{_0x44e3a3=_[_0xe048('0x8a')](_0x32bc36,[_0xe048('0x39'),'UserId']);_0x2c8235[_0xe048('0x5e')]='UserId';_0x2fa21c=as[_0xe048('0x80')](_0xc3884c,_0x44e3a3[_0xe048('0x81')],_0x2c8235);_0x30f51e[_0x229135](_0x2fa21c[_0xe048('0x82')],_0x2fa21c[_0xe048('0x77')][_0xe048('0x83')],_0x2fa21c[_0xe048('0x77')][_0xe048('0x2c')]);}break;case _0xe048('0x8b'):_0x2fa21c=as[_0xe048('0x80')]('me',null,_0x2c8235);_0x30f51e[_0x229135](_0x2fa21c[_0xe048('0x82')],_0x2fa21c[_0xe048('0x77')][_0xe048('0x83')],_0x2fa21c[_0xe048('0x77')][_0xe048('0x2c')]);break;}}else{var _0x2fa21c=as[_0xe048('0x80')](_0xc3884c,_0x44e3a3[_0xe048('0x81')],_0x2c8235);_0x30f51e[_0x229135](_0x2fa21c[_0xe048('0x82')],_0x2fa21c['value']['start'],_0x2fa21c['value'][_0xe048('0x2c')]);}}}else{var _0x15aa1b=_(_0xed9abe[_0xe048('0x53')])[_0xe048('0x54')]()[_0xe048('0x40')](function(_0x5063c2){return _['some'](_0x32bc36,['name',_0x5063c2])?_0x5063c2:undefined;})[_0xe048('0x8c')]()[_0xe048('0x77')]();if(!_[_0xe048('0x8d')](_0x15aa1b)){_0x15aa1b[_0xe048('0x44')](function(_0x209b8e){if(_0x209b8e===_0xe048('0x8e')){_0x2e19d2['where']('i.ChatWebsiteId\x20IN\x20?',[][_0xe048('0x8f')](_0xed9abe[_0xe048('0x53')][_0x209b8e]));}else if(_0x209b8e===_0xe048('0x90')){var _0x60078a=JSON['parse'](_0xed9abe[_0xe048('0x53')][_0x209b8e])[_0xe048('0x91')];var _0x34072f=JSON[_0xe048('0x92')](_0xed9abe[_0xe048('0x53')][_0x209b8e])[_0xe048('0x93')];_0x2e19d2[_0xe048('0x94')](_0xe048('0x95'),_0x60078a,_0x34072f);}else{if(_0xed9abe['query'][_0x209b8e]==='null'){_0x2e19d2[_0xe048('0x94')]('i.'+_0x209b8e+_0xe048('0x96'));}else{_0x2e19d2[_0xe048('0x94')]('i.'+_0x209b8e+_0xe048('0x97'),_0xed9abe[_0xe048('0x53')][_0x209b8e]);}}});}if(_0xed9abe[_0xe048('0x53')][_0xe048('0x98')]){if(_0xed9abe[_0xe048('0x53')][_0xe048('0x98')]==0x1){_0x2e19d2[_0xe048('0x78')](_0xe048('0x99'));}else{_0x2e19d2['having'](_0xe048('0x9a'));}}if(_0xed9abe[_0xe048('0x53')]['tag']){_0x281398=_[_0xe048('0x9b')](_0xed9abe[_0xe048('0x53')][_0xe048('0x9c')])?_0xed9abe[_0xe048('0x53')][_0xe048('0x9c')]:new Array(_0xed9abe[_0xe048('0x53')][_0xe048('0x9c')]);_0x281398[_0xe048('0x44')](function(_0x214236){_0x47a828['or'](_0xe048('0x85'),'%,'+_0x214236+',%');});}if(_0xed9abe[_0xe048('0x53')][_0xe048('0x9d')]){var _0x43af9b=_0xed9abe['query']['filter']['replace']('\x5c','\x5c\x5c')[_0xe048('0x9e')](/'/g,'\x27\x27');if(qs[_0xe048('0x9f')](_0x43af9b)){_0x30f51e['or'](_0xe048('0xa0'),_0x43af9b+'%');}else{_0x30f51e['or'](_0xe048('0xa1'),qs[_0xe048('0x7d')](_0x43af9b))['or'](_0xe048('0xa2'),_0x43af9b+'%');}}}_0x2e19d2[_0xe048('0x94')](_0x30f51e);_0x2e19d2[_0xe048('0xa3')](_0xe048('0xa4'));var _0xc25fff={'type':db[_0xe048('0xa5')][_0xe048('0xa6')][_0xe048('0xa7')],'raw':!![]};var _0x5bf5b8=_0x2e19d2[_0xe048('0xa8')]();_0x5bf5b8['field'](_0xe048('0xa4'));_0x5bf5b8['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe048('0x76'));if(_0x484faa[_0xe048('0x5b')]){_0x484faa['order'][_0xe048('0x44')](function(_0x1dbfd4){var _0x42b51a=_0x1dbfd4[0x0]===_0xe048('0xa9')?_0x1dbfd4[0x0]:'i.'+_0x1dbfd4[0x0];_0x2e19d2['order'](_0x42b51a,_0x1dbfd4[0x1]===_0xe048('0xaa')?![]:!![]);});}if(!_[_0xe048('0x8d')](_0x281398)){_0x2e19d2[_0xe048('0x78')](_0x47a828);_0x5bf5b8[_0xe048('0x94')](_0xe048('0xab'),_0x281398);}BPromise[_0xe048('0xac')]()['then'](function(){if(!_0x35f4eb){if(_0xed9abe['query'][_0xe048('0x8e')])return;_0x5bf5b8[_0xe048('0x94')](_0xe048('0xad'));_0x2e19d2[_0xe048('0x94')](_0xe048('0xad'));return;}if(_0xed9abe[_0xe048('0xae')]['role']!=='agent')return;return _0xed9abe['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xe048('0x20')](function(_0x4daa11){if(_[_0xe048('0x8d')](_0x4daa11)){_0x5bf5b8[_0xe048('0x94')](_0xe048('0xaf'));_0x2e19d2[_0xe048('0x94')](_0xe048('0xaf'));}else{_0x5bf5b8[_0xe048('0x94')](_0xe048('0xb0'),_[_0xe048('0x40')](_0x4daa11,'id'));_0x2e19d2['where'](_0xe048('0xb0'),_[_0xe048('0x40')](_0x4daa11,'id'));}});})[_0xe048('0x20')](function(){if(_0xed9abe[_0xe048('0xae')]['role']===_0xe048('0x3d')&&!_0x35f4eb&&!_0xed9abe[_0xe048('0x53')]['ChatWebsiteId'])return[];return db[_0xe048('0xb1')][_0xe048('0x53')](_0x5bf5b8[_0xe048('0xb2')](),_0xc25fff);})['then'](function(_0xd6a4b1){_0x353545['count']=_0xd6a4b1['length'];if(_0x353545[_0xe048('0x30')]===0x0)return[];return db[_0xe048('0xb1')][_0xe048('0x53')](_0x58f98f['toString'](),_0xc25fff)[_0xe048('0x20')](function(_0x58f775){_0x19459c=_[_0xe048('0xb3')](_0x58f775,'id');_0xc25fff=_[_0xe048('0x3b')](_0xc25fff,{'model':db[_0xe048('0x4f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xed9abe['query'][_0xe048('0x58')]){_0x484faa['attributes']['forEach'](function(_0x58514c){_0x2e19d2[_0xe048('0x5e')]('i.'+_0x58514c);});}else{_0x2e19d2['field'](_0xe048('0xb4'),'unreadMessages');_0x2e19d2[_0xe048('0x5e')](_0xe048('0xb5'),'Account.key');_0x2e19d2[_0xe048('0x5e')](_0xe048('0xb6'),'Account.mandatoryDisposition');_0x2e19d2[_0xe048('0x5e')]('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',_0xe048('0xa9'));_0x2e19d2['field']('i.*');_0x2e19d2[_0xe048('0x5e')](_0xe048('0xb7'),_0xe048('0xb8'));_0x2e19d2[_0xe048('0x5e')](_0xe048('0xb9'),_0xe048('0xba'));_0x2e19d2[_0xe048('0x5e')](_0xe048('0xbb'),'Contact.email');_0x2e19d2[_0xe048('0x5e')](_0xe048('0xbc'),_0xe048('0xbd'));_0x2e19d2[_0xe048('0x5e')](_0xe048('0xbe'),'Contact.mobile');_0x2e19d2['field'](_0xe048('0xbf'),_0xe048('0xc0'));_0x2e19d2[_0xe048('0x5e')]('o.fullname',_0xe048('0xc1'));_0x2e19d2['field'](_0xe048('0xc2'),_0xe048('0xc3'));_0x2e19d2[_0xe048('0x5e')](_0xe048('0xc4'),_0xe048('0x43'));}if(_0x484faa['limit'])_0x2e19d2[_0xe048('0x2f')](_0x484faa[_0xe048('0x2f')]);if(_0x484faa[_0xe048('0x2e')])_0x2e19d2[_0xe048('0x2e')](_0x484faa['offset']);return db[_0xe048('0xb1')][_0xe048('0x53')](_0x2e19d2['toString'](),_0xc25fff);})[_0xe048('0x20')](function(_0x24ae02){if(_0x24ae02['length']>0x0)_0xf65257[_0xe048('0x94')](_0xe048('0xc5'),_['map'](_0x24ae02,'id'));return db[_0xe048('0xb1')]['query'](_0xf65257[_0xe048('0xb2')](),_0xc25fff)[_0xe048('0x20')](function(_0x21a2b8){var _0x4130b9=_[_0xe048('0xc6')](_0x21a2b8,_0xe048('0xc7'));var _0x5a5595=[];_0x24ae02['forEach'](function(_0x4630bd){_0x5a5595[_0xe048('0xc8')](updateChatInteraction(_0x4630bd,_0x19459c,_0x4130b9));});return BPromise[_0xe048('0xc9')](_0x5a5595);});});})[_0xe048('0x20')](function(_0x3dba8c){_0x353545['rows']=_0x3dba8c;return _0x353545;})[_0xe048('0x20')](respondWithFilteredResult(_0x4c7811,_0x484faa))['catch'](handleError(_0x4c7811,null));};exports[_0xe048('0xca')]=function(_0x282b50,_0x12ca78){var _0x17f7fe={'raw':![],'where':{'id':_0x282b50[_0xe048('0xcb')]['id']}},_0x3c7c6e={};_0x3c7c6e[_0xe048('0x52')]=_[_0xe048('0x54')](db[_0xe048('0x4f')][_0xe048('0x50')]);_0x3c7c6e['query']=_[_0xe048('0x54')](_0x282b50[_0xe048('0x53')]);_0x3c7c6e[_0xe048('0x55')]=_['intersection'](_0x3c7c6e[_0xe048('0x52')],_0x3c7c6e[_0xe048('0x53')]);_0x17f7fe[_0xe048('0x56')]=_[_0xe048('0x57')](_0x3c7c6e[_0xe048('0x52')],qs[_0xe048('0x58')](_0x282b50['query']['fields']));_0x17f7fe[_0xe048('0x56')]=_0x17f7fe[_0xe048('0x56')][_0xe048('0x75')]?_0x17f7fe[_0xe048('0x56')]:_0x3c7c6e[_0xe048('0x52')];if(_0x282b50[_0xe048('0x53')][_0xe048('0xcc')]){_0x17f7fe[_0xe048('0xcd')]=[{'all':!![]}];}_0x17f7fe=_['merge']({},_0x17f7fe,_0x282b50[_0xe048('0xce')]);return db[_0xe048('0x4f')][_0xe048('0x8a')](_0x17f7fe)['then'](handleEntityNotFound(_0x12ca78,null))[_0xe048('0x20')](respondWithResult(_0x12ca78,null))[_0xe048('0x2a')](handleError(_0x12ca78,null));};exports['create']=function(_0x4b863b,_0x4652bb){return db[_0xe048('0x4f')][_0xe048('0xcf')](_0x4b863b[_0xe048('0x8b')],{})[_0xe048('0x20')](respondWithResult(_0x4652bb,0xc9))[_0xe048('0x2a')](handleError(_0x4652bb,null));};exports[_0xe048('0x35')]=function(_0xe453a6,_0x384169){if(_0xe453a6[_0xe048('0x8b')]['id']){delete _0xe453a6['body']['id'];}return db[_0xe048('0x4f')]['find']({'where':{'id':_0xe453a6[_0xe048('0xcb')]['id']}})['then'](handleEntityNotFound(_0x384169,null))['then'](saveUpdates(_0xe453a6['body'],null))['then'](respondWithResult(_0x384169,null))[_0xe048('0x2a')](handleError(_0x384169,null));};exports[_0xe048('0x36')]=function(_0x5c84a8,_0x297064){return db[_0xe048('0x4f')][_0xe048('0x8a')]({'where':{'id':_0x5c84a8['params']['id']}})[_0xe048('0x20')](handleEntityNotFound(_0x297064,null))['then'](removeEntity(_0x297064,null))[_0xe048('0x2a')](handleError(_0x297064,null));};exports['describe']=function(_0x527d0a,_0x12996a){return db['ChatInteraction'][_0xe048('0xd0')]()[_0xe048('0x20')](respondWithResult(_0x12996a,null))[_0xe048('0x2a')](handleError(_0x12996a,null));};exports[_0xe048('0xd1')]=function(_0x59a028,_0x5023bf){var _0x15a5ce=_0x59a028[_0xe048('0xcb')]['id'];var _0x509274;var _0x47284a;var _0x356070;return db[_0xe048('0x4f')]['findOne']({'where':{'id':_0x15a5ce}})[_0xe048('0x20')](function(_0xee5135){_0x509274=_0xee5135;return db['ChatWebsite'][_0xe048('0xd2')]({'where':{'id':_0xee5135['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xe048('0xd3'),_0xe048('0xd4'),_0xe048('0xd5'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x581ada){if(_0x581ada&&_0x581ada[_0xe048('0xd6')]&&_0x581ada[_0xe048('0xd3')]){_0x47284a=_0x581ada;var _0x3733d4={'interaction':{'id':_0x15a5ce},'agent':{'id':_0x59a028[_0xe048('0xae')]['id'],'name':_0x59a028['user'][_0xe048('0x39')],'fullname':_0x59a028['user']['fullname'],'email':_0x59a028[_0xe048('0xae')]['email']},'contact':_0x59a028[_0xe048('0x8b')][_0xe048('0x3c')],'account':_0x59a028[_0xe048('0x8b')]['account']};var _0xa333ec={'rejectUnauthorized':![],'method':_0xe048('0xd7'),'url':_0xe048('0xd8'),'headers':{'X-APIKEY':_0x581ada['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x59a028[_0xe048('0xae')][_0xe048('0xd9')]],'buttons':null,'topic':_0x47284a[_0xe048('0xd4')],'note':_[_0xe048('0xda')](_0x47284a[_0xe048('0xd5')])?null:getMustacheRender(_0x47284a[_0xe048('0xd5')],_0x3733d4),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xe048('0xda')](_0x47284a[_0xe048('0xdb')])){var _0x4a561c=getMustacheRender(_0x47284a['vidaooMetadata'],_0x3733d4);var _0x58eb26=JSON[_0xe048('0x92')](_0x4a561c);_0xa333ec[_0xe048('0x8b')][_0xe048('0xdc')]=_0x58eb26;}}catch(_0x5afc6c){throw new db['Sequelize']['ValidationError'](_0xe048('0xdd'));}return rp(_0xa333ec);}else{throw new db['Sequelize'][(_0xe048('0xde'))](_0xe048('0xdf'));}})[_0xe048('0x20')](function(_0x4ccf8c){_0x356070=_0x4ccf8c;if(_0x356070['id']){var _0x380f19={'body':_0x356070[_0xe048('0xe0')],'ChatWebsiteId':_0x47284a['id'],'ChatInteractionId':_0x509274['id'],'direction':_0xe048('0xe1'),'UserId':_0x59a028['user']['id']};return db[_0xe048('0xe2')][_0xe048('0xcf')](_0x380f19,{});}else{throw new db['Sequelize'][(_0xe048('0xde'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x509274[_0xe048('0xe3')]({'vidaooSessionId':_0x356070['id']});})[_0xe048('0x20')](respondWithResult(_0x5023bf,null))[_0xe048('0x2a')](handleError(_0x5023bf,null));};exports[_0xe048('0xe4')]=function(_0x208b8a,_0x4b42e6){if(_0x208b8a[_0xe048('0x8b')]['id']){delete _0x208b8a[_0xe048('0x8b')]['id'];}return db[_0xe048('0x4f')][_0xe048('0x8a')]({'where':{'id':_0x208b8a['params']['id']},'include':[{'model':db[_0xe048('0xe5')],'as':_0xe048('0x79')}]})['then'](handleEntityNotFound(_0x4b42e6,null))[_0xe048('0x20')](saveUpdates(_0x208b8a[_0xe048('0x8b')],null))[_0xe048('0x20')](respondWithResult(_0x4b42e6,null))[_0xe048('0x2a')](handleError(_0x4b42e6,null));};exports[_0xe048('0xe6')]=function(_0x52d64c,_0x2bffeb,_0x5aacc5){if(_0x52d64c[_0xe048('0x8b')]['id']){delete _0x52d64c[_0xe048('0x8b')]['id'];}return db[_0xe048('0x4f')][_0xe048('0x8a')]({'where':{'id':_0x52d64c[_0xe048('0xcb')]['id']}})[_0xe048('0x20')](function(_0x17b35d){if(!_0x17b35d){logger['error'](_0xe048('0xe7'),'abandon',0x194,_0xe048('0xe8'));_0x2bffeb[_0xe048('0x37')](0x194);}else{if(_0x17b35d[_0xe048('0x4d')]){throw new db[(_0xe048('0xa5'))][(_0xe048('0xde'))](_0xe048('0xe9'));}}return _0x17b35d;})[_0xe048('0x20')](function(_0x5e78f7){if(_0x5e78f7){return _0x5e78f7[_0xe048('0x35')]({'closed':_0x52d64c['body'][_0xe048('0x4a')],'disposition':_0x52d64c[_0xe048('0x8b')][_0xe048('0x4c')]})[_0xe048('0x20')](function(_0x59fa6d){return _0x59fa6d;});}})[_0xe048('0x20')](function(_0x36fc87){return respondWithRpcPromise(_0xe048('0xea'),_0xe048('0xe6'),_0x52d64c['body'],client9004);})['then'](respondWithResult(_0x2bffeb,null))[_0xe048('0x2a')](handleError(_0x2bffeb,null));};exports[_0xe048('0xeb')]=function(_0x423eff,_0x37f895,_0x557125){_0x423eff['body'][_0xe048('0x39')]=_0x423eff['file'][_0xe048('0xec')];_0x423eff[_0xe048('0x8b')][_0xe048('0xed')]=_0x423eff[_0xe048('0xee')][_0xe048('0xef')];_0x423eff[_0xe048('0x8b')][_0xe048('0x81')]=_0x423eff[_0xe048('0xee')][_0xe048('0xf0')];return db['Attachment']['create'](_0x423eff[_0xe048('0x8b')])[_0xe048('0x20')](respondWithResult(_0x37f895,0xc9))['catch'](handleError(_0x37f895,null));};exports[_0xe048('0xf1')]=function(_0x470e40,_0x51c53b,_0x45fb5e){return db[_0xe048('0x4f')][_0xe048('0xd2')]({'where':{'id':_0x470e40[_0xe048('0xcb')]['id']},'raw':!![]})[_0xe048('0x20')](handleEntityNotFound(_0x51c53b,null))[_0xe048('0x20')](function(_0x4c8903){if(_0x4c8903){if(_0x4c8903[_0xe048('0x4a')]){return _0x51c53b[_0xe048('0x2b')](0x193)[_0xe048('0x2d')]({'status':0x193,'message':_0xe048('0xf2')});}return db['Attachment']['findOne']({'where':{'id':_0x470e40[_0xe048('0x53')][_0xe048('0xf3')]},'raw':!![]})[_0xe048('0x20')](handleEntityNotFound(_0x51c53b,null));}})[_0xe048('0x20')](function(_0x1f14f8){if(_0x1f14f8){var _0x386209=_0x1f14f8[_0xe048('0xf4')]!==null;var _0x3d4699=path['join'](config[_0xe048('0xf5')],_0xe048('0xf6'));if(_0x386209){_0x3d4699=path[_0xe048('0xf7')](_0x3d4699,_0xe048('0xf8'));}var _0x52faa9=path['join'](_0x3d4699,_0x1f14f8[_0xe048('0xed')]);return _0x51c53b['download'](_0x52faa9);}})[_0xe048('0x2a')](handleError(_0x51c53b,null));};exports[_0xe048('0xf9')]=function(_0x564ab9,_0xd218ea){var _0x47c0a4=null;var _0x5e839d=null;var _0x426e30=null;var _0xb548bb=null;if(_0x564ab9[_0xe048('0x8b')]['id']){delete _0x564ab9[_0xe048('0x8b')]['id'];}if(_0x564ab9[_0xe048('0x8b')][_0xe048('0xfa')]){_0xb548bb=path[_0xe048('0xf7')](config[_0xe048('0xf5')],'server/files/chat/upload/',util['format'](_0xe048('0xfb'),Date['now']()));_0x564ab9[_0xe048('0x8b')][_0xe048('0xfc')]=_0xb548bb;}return db[_0xe048('0x4f')]['find']({'where':{'id':_0x564ab9[_0xe048('0xcb')]['id']},'include':[{'model':db[_0xe048('0xe2')],'as':_0xe048('0xfd'),'include':[{'model':db[_0xe048('0x87')],'as':_0xe048('0x87')}]}]})['then'](handleEntityNotFound(_0xd218ea,null))[_0xe048('0x20')](saveUpdates(_0x564ab9[_0xe048('0x8b')],null))[_0xe048('0x20')](function(_0x3f70b3){if(_0x3f70b3){_0x47c0a4=_0x3f70b3;return db[_0xe048('0xfe')][_0xe048('0x8a')]({'where':{'id':_0x47c0a4[_0xe048('0x8e')]}});}})[_0xe048('0x20')](function(_0x30bbd3){if(_0x30bbd3){_0x426e30=_0x30bbd3;return db[_0xe048('0xe5')]['find']({'where':{'id':_0x47c0a4[_0xe048('0x7f')]}});}})[_0xe048('0x20')](function(_0x63b005){if(_0x63b005){_0x5e839d=_0x63b005;if(_0xb548bb){var _0x316602=null;for(var _0x2043fa=0x1;_0x2043fa<_0x47c0a4[_0xe048('0xfd')]['length'];++_0x2043fa){_0x316602=_0x47c0a4[_0xe048('0xfd')][_0x2043fa];var _0x114648=_0x316602[_0xe048('0x4d')]?util[_0xe048('0xff')](_0xe048('0x100'),_0x426e30[_0xe048('0x101')],_0x316602['UserId']):'System';var _0x44b376=_0x564ab9[_0xe048('0x8b')][_0xe048('0x102')]||util[_0xe048('0xff')](_0xe048('0x100'),_0xe048('0x103'),_0x316602[_0xe048('0x7f')]);switch(_0x426e30[_0xe048('0x104')]){case'website_alias':_0x114648=_0x316602[_0xe048('0x4d')]?util['format']('%s%d',_0x426e30[_0xe048('0x101')],_0x316602[_0xe048('0x4d')]):_0xe048('0x105');break;case _0xe048('0x106'):_0x114648=_0x316602[_0xe048('0x4d')]?_0x316602[_0xe048('0x87')][_0xe048('0x107')]||_0x316602[_0xe048('0x87')][_0xe048('0x41')]:_0xe048('0x105');break;case'agent_fullname':_0x114648=_0x316602[_0xe048('0x4d')]?_0x316602['User'][_0xe048('0x41')]:_0xe048('0x105');break;default:_0x114648=_0x316602[_0xe048('0x4d')]?util[_0xe048('0xff')](_0xe048('0x100'),_0x426e30[_0xe048('0x101')],_0x316602['UserId']):_0xe048('0x105');}var _0x270cc5=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x316602[_0xe048('0x90')])[_0xe048('0xff')](_0xe048('0x108')),_0x316602['direction']==='in'?_0x44b376:_0x114648,_0x316602[_0xe048('0x8b')]);if(!_0x316602[_0xe048('0x109')]){fs[_0xe048('0x10a')](_0xb548bb,_0x270cc5);}}return db[_0xe048('0x10b')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe048('0x10c'),'raw':!![]}]});}}})['then'](function(_0x31eac4){if(_0x31eac4&&_0x31eac4[_0xe048('0x10c')]&&_0x564ab9[_0xe048('0x8b')]){var _0x30b47a={'tls':{'rejectUnauthorized':![]}};if(_0x31eac4[_0xe048('0x10c')][_0xe048('0x10d')]){_0x30b47a['service']=_0x31eac4[_0xe048('0x10c')][_0xe048('0x10d')];}else{_0x30b47a[_0xe048('0x10e')]=_0x31eac4[_0xe048('0x10c')][_0xe048('0x10e')];_0x30b47a[_0xe048('0x10f')]=_0x31eac4[_0xe048('0x10c')][_0xe048('0x10f')];_0x30b47a['secure']=_0x31eac4[_0xe048('0x10c')][_0xe048('0x110')];}if(_0x31eac4['Smtp']['authentication']){_0x30b47a[_0xe048('0x111')]={'user':_0x31eac4[_0xe048('0x10c')][_0xe048('0xae')],'pass':_0x31eac4[_0xe048('0x10c')][_0xe048('0x112')]};}return respondWithRpcPromise(_0xe048('0x113'),_0xe048('0x114'),{'account':_0x30b47a,'message':{'from':util['format'](_0xe048('0x115'),_0x31eac4[_0xe048('0x39')],_0x31eac4[_0xe048('0xd9')]||_0x31eac4[_0xe048('0x10c')][_0xe048('0xae')]),'to':_0x564ab9[_0xe048('0x8b')][_0xe048('0xfa')],'subject':_0xe048('0x116'),'text':util[_0xe048('0xff')](_0xe048('0x117'),_0x564ab9[_0xe048('0x8b')][_0xe048('0xfa')]),'attachments':[{'path':_0xb548bb}]}})[_0xe048('0x20')](function(){return _0x47c0a4;})[_0xe048('0x2a')](function(_0x3f9838){console[_0xe048('0x28')](_0x3f9838);});}else{return _0x47c0a4;}})[_0xe048('0x20')](respondWithStatusCode(_0xd218ea,0xc8))['catch'](handleError(_0xd218ea,null));};exports[_0xe048('0x118')]=function(_0x5f4c37,_0x35162c,_0x3bdae2){return db[_0xe048('0xe2')][_0xe048('0x8a')]({'where':{'id':_0x5f4c37[_0xe048('0xcb')]['id']}})[_0xe048('0x20')](handleEntityNotFound(_0x35162c,null))[_0xe048('0x20')](function(_0x4a6193){if(_0x4a6193){return _0x4a6193[_0xe048('0x118')](_0x5f4c37['body'][_0xe048('0x119')],_[_0xe048('0x11a')](_0x5f4c37[_0xe048('0x8b')],['ids','id'])||{});}})['then'](respondWithResult(_0x35162c,null))[_0xe048('0x2a')](handleError(_0x35162c,null));};exports[_0xe048('0x11b')]=function(_0x7789ee,_0x7b13d3,_0x4f268f){var _0x21c737={'raw':![],'where':{}};var _0x2d8f04={};var _0x25bb11={'count':0x0,'rows':[]};return db[_0xe048('0x4f')][_0xe048('0xd2')]({'where':{'id':_0x7789ee['params']['id']}})[_0xe048('0x20')](handleEntityNotFound(_0x7b13d3,null))['then'](function(_0x3916b3){if(_0x3916b3){_0x2d8f04[_0xe048('0x52')]=_[_0xe048('0x54')](db[_0xe048('0xe2')]['rawAttributes']);_0x2d8f04['query']=_['keys'](_0x7789ee[_0xe048('0x53')]);_0x2d8f04[_0xe048('0x55')]=_[_0xe048('0x57')](_0x2d8f04[_0xe048('0x52')],_0x2d8f04[_0xe048('0x53')]);_0x21c737[_0xe048('0x56')]=_[_0xe048('0x57')](_0x2d8f04[_0xe048('0x52')],qs[_0xe048('0x58')](_0x7789ee[_0xe048('0x53')][_0xe048('0x58')]));_0x21c737['attributes']=_0x21c737[_0xe048('0x56')][_0xe048('0x75')]?_0x21c737[_0xe048('0x56')]:_0x2d8f04[_0xe048('0x52')];if(!_0x7789ee[_0xe048('0x53')][_0xe048('0x59')]('nolimit')){_0x21c737[_0xe048('0x2f')]=qs[_0xe048('0x2f')](_0x7789ee[_0xe048('0x53')][_0xe048('0x2f')]);_0x21c737['offset']=qs[_0xe048('0x2e')](_0x7789ee[_0xe048('0x53')][_0xe048('0x2e')]);}_0x21c737['order']=qs[_0xe048('0x5c')](_0x7789ee['query'][_0xe048('0x5c')]);_0x21c737[_0xe048('0x94')]=qs[_0xe048('0x55')](_[_0xe048('0x5d')](_0x7789ee[_0xe048('0x53')],_0x2d8f04['filters']));_0x21c737[_0xe048('0x94')][_0xe048('0xc7')]=_0x3916b3['id'];if(_0x7789ee[_0xe048('0x53')][_0xe048('0x9d')]){_0x21c737[_0xe048('0x94')]=_['merge'](_0x21c737[_0xe048('0x94')],{'$or':_['map'](_0x21c737[_0xe048('0x56')],function(_0x41befd){var _0x515d00={};_0x515d00[_0x41befd]={'$like':'%'+_0x7789ee[_0xe048('0x53')][_0xe048('0x9d')]+'%'};return _0x515d00;})});}if(_0x7789ee[_0xe048('0x53')]['$gte']){var _0x249e0f=_0x7789ee[_0xe048('0x53')]['$gte'][_0xe048('0x7b')](',');var _0x1e662c={};_0x1e662c[_0x249e0f[0x0]]={'$gte':moment(_0x249e0f[0x1])['format'](_0xe048('0x11c'))};_0x21c737['where']=_[_0xe048('0x3b')](_0x21c737[_0xe048('0x94')],_0x1e662c);}_0x21c737=_[_0xe048('0x3b')]({},_0x21c737,_0x7789ee[_0xe048('0xce')]);return db[_0xe048('0xe2')]['count']({'where':_0x21c737[_0xe048('0x94')]})[_0xe048('0x20')](function(_0x29ec60){_0x25bb11[_0xe048('0x30')]=_0x29ec60;if(_0x7789ee[_0xe048('0x53')][_0xe048('0xcc')]){_0x21c737[_0xe048('0xcd')]=[{'all':!![]}];}return db[_0xe048('0xe2')][_0xe048('0x11d')](_0x21c737);})['then'](function(_0x424087){_0x25bb11['rows']=_0x424087;return _0x25bb11;});}})['then'](respondWithFilteredResult(_0x7b13d3,_0x21c737))[_0xe048('0x2a')](handleError(_0x7b13d3,null));};exports[_0xe048('0x11e')]=function(_0x568d12,_0x2b6e36,_0x55032e){var _0x4afc6d={'where':{}},_0xeb2a71={},_0x2a9d88={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x568d12[_0xe048('0xcb')]['id']}})[_0xe048('0x20')](handleEntityNotFound(_0x2b6e36,null))['then'](function(_0x5de5e3){if(_0x5de5e3){_0xeb2a71['model']=_[_0xe048('0x54')](db[_0xe048('0xe2')][_0xe048('0x50')]);_0xeb2a71[_0xe048('0x53')]=_['keys'](_0x568d12[_0xe048('0x53')]);_0xeb2a71['filters']=_[_0xe048('0x57')](_0xeb2a71[_0xe048('0x52')],_0xeb2a71[_0xe048('0x53')]);_0x4afc6d['attributes']=_[_0xe048('0x57')](_0xeb2a71[_0xe048('0x52')],qs['fields'](_0x568d12[_0xe048('0x53')]['fields']));_0x4afc6d['attributes']=_0x4afc6d[_0xe048('0x56')][_0xe048('0x75')]?_0x4afc6d[_0xe048('0x56')]:_0xeb2a71[_0xe048('0x52')];if(!_0x568d12[_0xe048('0x53')][_0xe048('0x59')](_0xe048('0x5a'))){_0x4afc6d[_0xe048('0x2f')]=qs[_0xe048('0x2f')](_0x568d12[_0xe048('0x53')][_0xe048('0x2f')]);_0x4afc6d[_0xe048('0x2e')]=qs[_0xe048('0x2e')](_0x568d12[_0xe048('0x53')]['offset']);}_0x4afc6d[_0xe048('0x5b')]=qs[_0xe048('0x5c')](_0x568d12[_0xe048('0x53')]['sort']);_0x4afc6d[_0xe048('0x94')]=qs[_0xe048('0x55')](_[_0xe048('0x5d')](_0x568d12[_0xe048('0x53')],_0xeb2a71[_0xe048('0x55')]));_0x4afc6d[_0xe048('0x94')][_0xe048('0xc7')]=_0x5de5e3['id'];if(_0x568d12[_0xe048('0x53')][_0xe048('0x9d')]){_0x4afc6d[_0xe048('0x94')]=_['merge'](_0x4afc6d[_0xe048('0x94')],{'$or':_['map'](_0x4afc6d[_0xe048('0x56')],function(_0x1cde80){var _0x5e6294={};_0x5e6294[_0x1cde80]={'$like':'%'+_0x568d12[_0xe048('0x53')][_0xe048('0x9d')]+'%'};return _0x5e6294;})});}_0x4afc6d[_0xe048('0x94')][_0xe048('0x109')]=![];if(_0x568d12[_0xe048('0x53')]['id']){_0x4afc6d[_0xe048('0x94')]['id']={'$gt':_0x568d12[_0xe048('0x53')]['id']};}_0x4afc6d=_[_0xe048('0x3b')]({},_0x4afc6d,_0x568d12['options']);return db[_0xe048('0xe2')][_0xe048('0x30')]({'where':_0x4afc6d[_0xe048('0x94')]})[_0xe048('0x20')](function(_0x3386cd){_0x2a9d88[_0xe048('0x30')]=_0x3386cd;_0x4afc6d[_0xe048('0xcd')]=[];if(_0x568d12['query']['includeAgent']){_0x4afc6d[_0xe048('0xcd')]['push']({'model':db[_0xe048('0x87')],'as':_0xe048('0x87'),'attributes':['id',_0xe048('0x41'),_0xe048('0x107')]});}if(_0x568d12['query'][_0xe048('0xcc')]){_0x4afc6d[_0xe048('0xcd')]=[{'all':!![]}];}return db[_0xe048('0xe2')][_0xe048('0x11d')](_0x4afc6d);})[_0xe048('0x20')](function(_0x305051){_0x2a9d88['rows']=_0x305051;return _0x2a9d88;});}})['then'](respondWithFilteredResult(_0x2b6e36,_0x4afc6d))['catch'](handleError(_0x2b6e36,null));};exports[_0xe048('0x11f')]=function(_0x4e4db6,_0x500f57,_0x29f249){return db[_0xe048('0x4f')]['find']({'where':{'id':_0x4e4db6[_0xe048('0xcb')]['id']}})['then'](handleEntityNotFound(_0x500f57,null))[_0xe048('0x20')](function(_0x33c2f5){if(_0x33c2f5){return _0x33c2f5['setTags'](_0x4e4db6['body']['ids'],_[_0xe048('0x11a')](_0x4e4db6[_0xe048('0x8b')],['ids','id'])||{})[_0xe048('0x120')](function(){return db['Tag'][_0xe048('0x11d')]({'attributes':['id',_0xe048('0x39'),_0xe048('0x5f')],'where':{'id':_0x4e4db6[_0xe048('0x8b')][_0xe048('0x119')]}});})[_0xe048('0x20')](function(_0x293450){socket[_0xe048('0x121')]('chatInteractionTags:save',{'id':Number(_0x4e4db6['params']['id']),'tags':_0x293450||[]});return{'id':Number(_0x4e4db6[_0xe048('0xcb')]['id']),'tags':_0x293450||[]};});}})[_0xe048('0x20')](respondWithResult(_0x500f57,null))[_0xe048('0x2a')](handleError(_0x500f57,null));};exports[_0xe048('0x122')]=function(_0x4d2ffa,_0x1b4667,_0x3fdcc8){return db[_0xe048('0x4f')][_0xe048('0x8a')]({'where':{'id':_0x4d2ffa['params']['id']}})[_0xe048('0x20')](handleEntityNotFound(_0x1b4667,null))['then'](function(_0x5ba467){if(_0x5ba467){return _0x5ba467[_0xe048('0x122')](_0x4d2ffa[_0xe048('0x53')]['ids']);}})[_0xe048('0x20')](respondWithStatusCode(_0x1b4667,null))[_0xe048('0x2a')](handleError(_0x1b4667,null));};exports[_0xe048('0x123')]=function(_0x6316e8,_0x50c51f){var _0x4a964f=moment()[_0xe048('0x124')]()[_0xe048('0xb2')]();var _0x31b8ac=path[_0xe048('0xf7')](config['root'],_0xe048('0x125'),_0xe048('0x126'),_0xe048('0x127'));var _0x29917f=path[_0xe048('0xf7')](config[_0xe048('0xf5')],_0xe048('0x125'),'files',_0xe048('0x128'));var _0x5dcb6e=path[_0xe048('0xf7')](_0x31b8ac,_0x4a964f);var _0x4a3610=util[_0xe048('0xff')](_0xe048('0x129'),_0x6316e8[_0xe048('0xcb')]['id'],_0x4a964f);var _0x221a76=path[_0xe048('0xf7')](_0x31b8ac,_0x4a3610);var _0xc8ecef=[];_0xc8ecef[_0xe048('0xc8')]({'model':db['User'],'as':_0xe048('0x87'),'attributes':['id',_0xe048('0x41')],'raw':!![]});_0xc8ecef[_0xe048('0xc8')]({'model':db['CmContact'],'as':_0xe048('0x79'),'attributes':['id',_0xe048('0x12a'),'lastName'],'raw':!![]});if(_0x6316e8[_0xe048('0x53')]['attachments']){_0xc8ecef['push']({'model':db[_0xe048('0x12b')],'as':_0xe048('0x12b'),'raw':!![]});}var _0x2bca7a=[{'model':db[_0xe048('0xe2')],'as':_0xe048('0xfd'),'attributes':['id','body',_0xe048('0x90'),'direction',_0xe048('0x109'),_0xe048('0x98')],'include':_0xc8ecef}];_0x2bca7a['push']({'model':db[_0xe048('0xfe')],'as':'Account','attributes':['id',_0xe048('0x39')]});_0x2bca7a[_0xe048('0xc8')]({'model':db[_0xe048('0x87')],'as':'Owner','attributes':['id','fullname']});return db[_0xe048('0x4f')][_0xe048('0x8a')]({'where':{'id':_0x6316e8[_0xe048('0xcb')]['id']},'include':_0x2bca7a})['then'](handleEntityNotFound(_0x50c51f,null))['then'](function(_0x5cbbc6){if(_0x5cbbc6){var _0x1cb64b=_0x5cbbc6['get']({'plain':!![]});fs[_0xe048('0x12c')](_0x5dcb6e);var _0x4bfdcd={'channel':_0xe048('0x12d'),'account':_0x1cb64b[_0xe048('0x12e')][_0xe048('0x39')],'agent':_0x1cb64b[_0xe048('0x12f')]?_0x1cb64b[_0xe048('0x12f')][_0xe048('0x41')]:'N.A.','createdAt':moment(_0x1cb64b[_0xe048('0x90')])[_0xe048('0xff')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe048('0xb2')](),'closedAt':_0x1cb64b[_0xe048('0x4a')]?moment(_0x1cb64b[_0xe048('0x130')])[_0xe048('0xff')](_0xe048('0x11c'))[_0xe048('0xb2')]():'','disposition':_0x1cb64b[_0xe048('0x4c')],'chatInfo':{'browser':_0x1cb64b['browserName'],'os':_0x1cb64b['osName'],'referer':_0x1cb64b['referer'],'customerIp':_0x1cb64b[_0xe048('0x131')],'customerPort':_0x1cb64b[_0xe048('0x132')]?_0x1cb64b[_0xe048('0x132')]:_0xe048('0x133')},'messages':_(_0x1cb64b[_0xe048('0xfd')])[_0xe048('0x134')]()[_0xe048('0x9d')]({'secret':![]})[_0xe048('0x40')](function(_0x583171){if(_0x583171[_0xe048('0x12b')]){var _0x4df6d5=path['join'](_0x29917f,_0x583171[_0xe048('0x12b')][_0xe048('0xed')]);if(fs[_0xe048('0x135')](_0x4df6d5)){fs[_0xe048('0x136')](_0x4df6d5)[_0xe048('0x137')](fs[_0xe048('0x138')](path['join'](_0x5dcb6e,_0x583171[_0xe048('0x12b')][_0xe048('0xed')])));}}return{'date':moment(_0x583171[_0xe048('0x90')])['format'](_0xe048('0x11c'))['toString'](),'sender':_0x583171[_0xe048('0x139')]===_0xe048('0xe1')?_0x583171[_0xe048('0x87')]?_0x583171[_0xe048('0x87')]['fullname']:_0xe048('0x105'):_0x583171[_0xe048('0x79')]['firstName']+(_0x583171[_0xe048('0x79')]['lastName']?'\x20'+_0x583171['Contact'][_0xe048('0x13a')]:''),'body':_0x583171[_0xe048('0x12b')]?_0x583171['Attachment'][_0xe048('0xed')]:_0x583171[_0xe048('0x8b')],'direction':_0x583171['direction']===_0xe048('0xe1')?'A':'C','secret':_0x583171['secret'],'read':_0x583171[_0xe048('0x98')],'attachment':_0x583171[_0xe048('0x12b')]};})['value']()};return ejs[_0xe048('0x13b')](path['join'](config[_0xe048('0xf5')],_0xe048('0x125'),_0xe048('0x13c'),_0xe048('0x13d')),{'interaction':_0x4bfdcd})[_0xe048('0x20')](function(_0x559469){var _0x1e582c=path['join'](_0x5dcb6e,'transcript-'+_0x1cb64b['id']+'-'+_0x4a964f+'.pdf');var _0x222a3d={'path':_0x1e582c,'channel':'Chat','interactionId':_0x1cb64b['id']};return pdf[_0xe048('0x13e')](_0x559469,_0x222a3d);})[_0xe048('0x20')](function(){return new BPromise(function(_0x439421,_0x49085c){zipdir(_0x5dcb6e,{'saveTo':_0x221a76},function(_0x59e169,_0x517dee){if(_0x59e169)return _0x49085c(_0x59e169);return _0x439421(_0x517dee);});})[_0xe048('0x20')](function(){return new BPromise(function(_0x2632d4,_0x370d24){rimraf(_0x5dcb6e,function(_0x223038){if(_0x223038)_0x370d24(_0x223038);return _0x2632d4();});});})[_0xe048('0x20')](function(){return _0x50c51f[_0xe048('0x123')](_0x221a76,_0x4a3610,function(_0xc92a57){if(_0xc92a57){console[_0xe048('0x13f')](_0xe048('0x140'),_0xc92a57);}else{fs['unlinkSync'](_0x221a76);}});});});}else{return _0x50c51f[_0xe048('0x37')](0xc8);}})[_0xe048('0x2a')](handleError(_0x50c51f,null));}; \ No newline at end of file +var _0x07d0=['https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','AbandonInteraction','originalname','basename','filename','mimetype','Attachment','findOne','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','ContactId','Messages','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','System','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','pass','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','pick','YYYY-MM-DD\x20HH:mm:ss','includeAgent','findAll','setTags','spread','emit','removeTags','download','unix','tmp','server','files','attachments','transcript-%d-%s.zip','firstName','Account','Owner','Chat','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','out','lastName','views','downloadInteraction.ejs','.pdf','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','end','json','offset','undefined','count','limit','status','set','Content-Range','reject','update','destroy','stack','name','send','render','merge','body','Users','fullname','TagIds','Tags','split','forEach','waiting','talking','answered','unmanaged','abandoned','total','closed','UserId','disposition','map','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','field','color','from','tools_tags','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','select','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','some','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','agent','sequelize','toString','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','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.*','Contact.firstName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','rows','show','ChatInteraction','include','options','create','params','describe','createVidaooSession','ChatWebsite','vidaooNote','vidaooMetadata','vidaooApiKey','vidaooEscalation','email','contact','account','POST'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0x07d0,0x65));var _0x007d=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x07d0[_0x2db12b];return _0x20990b;};'use strict';var emlformat=require(_0x007d('0x0'));var rimraf=require(_0x007d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x007d('0x2'));var rp=require(_0x007d('0x3'));var moment=require(_0x007d('0x4'));var BPromise=require(_0x007d('0x5'));var Mustache=require('mustache');var util=require(_0x007d('0x6'));var path=require(_0x007d('0x7'));var sox=require(_0x007d('0x8'));var csv=require(_0x007d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x007d('0xa'));var _=require('lodash');var squel=require(_0x007d('0xb'));var crypto=require(_0x007d('0xc'));var jsforce=require(_0x007d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x007d('0xe'));var Papa=require('papaparse');var Redis=require(_0x007d('0xf'));var authService=require(_0x007d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x007d('0x11'));var pdf=require(_0x007d('0x12'));var hardwareService=require(_0x007d('0x13'));var logger=require(_0x007d('0x14'))(_0x007d('0x15'));var utils=require(_0x007d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x007d('0x17'));var db=require(_0x007d('0x18'))['db'];config['redis']=_[_0x007d('0x19')](config[_0x007d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x007d('0x1b'))(new Redis(config[_0x007d('0x1a')]));require(_0x007d('0x1c'))['register'](socket);var jayson=require(_0x007d('0x1d'));var client=jayson[_0x007d('0x1e')][_0x007d('0x1f')]({'port':0x232b});var client9004=jayson['client'][_0x007d('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x5ddc88,_0x46fa19,_0x3bdbc7,_0x31f921){return new BPromise(function(_0x4da663,_0x306d4f){var _0x2d7efa=_0x31f921||client;return _0x2d7efa[_0x007d('0x20')](_0x5ddc88,_0x3bdbc7)[_0x007d('0x21')](function(_0x3026b8){logger[_0x007d('0x22')](_0x007d('0x23'),_0x46fa19,_0x007d('0x24'));logger[_0x007d('0x25')](_0x007d('0x26'),_0x46fa19,_0x007d('0x24'),JSON[_0x007d('0x27')](_0x3026b8));if(_0x3026b8[_0x007d('0x28')]){if(_0x3026b8[_0x007d('0x28')][_0x007d('0x29')]===0x1f4){logger[_0x007d('0x28')](_0x007d('0x23'),_0x46fa19,_0x3026b8[_0x007d('0x28')][_0x007d('0x2a')]);return _0x306d4f(_0x3026b8[_0x007d('0x28')][_0x007d('0x2a')]);}logger[_0x007d('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x46fa19,_0x3026b8['error'][_0x007d('0x2a')]);return _0x4da663(_0x3026b8[_0x007d('0x28')][_0x007d('0x2a')]);}else{logger[_0x007d('0x22')](_0x007d('0x23'),_0x46fa19,_0x007d('0x24'));_0x4da663(_0x3026b8['result'][_0x007d('0x2a')]);}})[_0x007d('0x2b')](function(_0x4c4913){logger['error'](_0x007d('0x23'),_0x46fa19,_0x4c4913);_0x306d4f(_0x4c4913);});});}function respondWithStatusCode(_0x2a8ad9,_0x4df618){_0x4df618=_0x4df618||0xcc;return function(_0x181f68){if(_0x181f68){return _0x2a8ad9['sendStatus'](_0x4df618);}return _0x2a8ad9['status'](_0x4df618)[_0x007d('0x2c')]();};}function respondWithResult(_0x4b574a,_0x3ccba6){_0x3ccba6=_0x3ccba6||0xc8;return function(_0x52bf4f){if(_0x52bf4f){return _0x4b574a['status'](_0x3ccba6)[_0x007d('0x2d')](_0x52bf4f);}};}function respondWithFilteredResult(_0x248d0d,_0x4f3e58){return function(_0x1ecf23){if(_0x1ecf23){var _0xf06b2c=typeof _0x4f3e58[_0x007d('0x2e')]===_0x007d('0x2f')&&typeof _0x4f3e58['limit']===_0x007d('0x2f');var _0x4b3962=_0x1ecf23['count'];var _0x31a0e7=_0xf06b2c?0x0:_0x4f3e58['offset'];var _0xbee5e4=_0xf06b2c?_0x1ecf23[_0x007d('0x30')]:_0x4f3e58[_0x007d('0x2e')]+_0x4f3e58[_0x007d('0x31')];var _0x398754;if(_0xbee5e4>=_0x4b3962){_0xbee5e4=_0x4b3962;_0x398754=0xc8;}else{_0x398754=0xce;}_0x248d0d[_0x007d('0x32')](_0x398754);return _0x248d0d[_0x007d('0x33')](_0x007d('0x34'),_0x31a0e7+'-'+_0xbee5e4+'/'+_0x4b3962)['json'](_0x1ecf23);}return null;};}function patchUpdates(_0x59f138){return function(_0x3c5787){try{jsonpatch['apply'](_0x3c5787,_0x59f138,!![]);}catch(_0x7a798d){return BPromise[_0x007d('0x35')](_0x7a798d);}return _0x3c5787['save']();};}function saveUpdates(_0x41ec62,_0x4a3220){return function(_0x477280){if(_0x477280){return _0x477280[_0x007d('0x36')](_0x41ec62)[_0x007d('0x21')](function(_0x5126a1){return _0x5126a1;});}return null;};}function removeEntity(_0x350c68,_0x372da6){return function(_0x32e106){if(_0x32e106){return _0x32e106[_0x007d('0x37')]()['then'](function(){_0x350c68[_0x007d('0x32')](0xcc)[_0x007d('0x2c')]();});}};}function handleEntityNotFound(_0x25bf8a,_0x1057c6){return function(_0x46364d){if(!_0x46364d){_0x25bf8a['sendStatus'](0x194);}return _0x46364d;};}function handleError(_0x577a20,_0x492850){_0x492850=_0x492850||0x1f4;return function(_0x4d5925){logger[_0x007d('0x28')](_0x4d5925[_0x007d('0x38')]);if(_0x4d5925['name']){delete _0x4d5925[_0x007d('0x39')];}_0x577a20[_0x007d('0x32')](_0x492850)[_0x007d('0x3a')](_0x4d5925);};}function getMustacheRender(_0x18637f,_0x17e1ca){return Mustache[_0x007d('0x3b')](_0x18637f,_[_0x007d('0x3c')](_0x17e1ca[_0x007d('0x3d')],{'contact':_0x17e1ca['contact'],'message':_0x17e1ca[_0x007d('0x2a')],'agent':_0x17e1ca['agent'],'interaction':_0x17e1ca['interaction'],'account':_0x17e1ca['account']}))||'';}function getInteractionUsers(_0x41291b,_0x242004){return new BPromise(function(_0xbdf3d,_0x444cab){try{if(_0x242004[_0x41291b['id']]){_0x41291b[_0x007d('0x3e')]=_['map'](_0x242004[_0x41291b['id']],function(_0x30083f){return{'id':_0x30083f['id'],'fullname':_0x30083f[_0x007d('0x3f')]};});}}catch(_0x46a790){_0x444cab(_0x46a790);}_0xbdf3d(_0x41291b);});}function getInteractionTags(_0x4ad719,_0x1258d1){return new BPromise(function(_0x1f8a27,_0x5523e5){try{if(_0x4ad719[_0x007d('0x40')]){_0x4ad719[_0x007d('0x41')]=[];_0x4ad719[_0x007d('0x40')][_0x007d('0x42')](',')[_0x007d('0x43')](function(_0x4b8442){_0x4ad719[_0x007d('0x41')]['push'](_0x1258d1[_0x4b8442]);});}delete _0x4ad719[_0x007d('0x40')];}catch(_0x1559a5){_0x5523e5(_0x1559a5);}_0x1f8a27(_0x4ad719);});}function updateChatInteraction(_0x432291,_0x5c4cc2,_0x4779ae){return new BPromise(function(_0x49ea0e,_0x57237c){return getInteractionUsers(_0x432291,_0x4779ae)[_0x007d('0x21')](function(_0x49c8ef){return getInteractionTags(_0x49c8ef,_0x5c4cc2);})[_0x007d('0x21')](function(_0x4991ea){return getStateInteraction(_0x4991ea);})[_0x007d('0x21')](function(_0x500e53){_0x49ea0e(_0x500e53);})[_0x007d('0x2b')](function(_0x27b626){_0x57237c(_0x27b626);});});}function getStateInteraction(_0x38bf97){return new BPromise(function(_0x346239){_0x38bf97[_0x007d('0x44')]=0x0;_0x38bf97[_0x007d('0x45')]=0x0;_0x38bf97[_0x007d('0x46')]=0x0;_0x38bf97[_0x007d('0x47')]=0x0;_0x38bf97[_0x007d('0x48')]=0x0;_0x38bf97[_0x007d('0x49')]=0x0;if(!_0x38bf97[_0x007d('0x4a')]&&!_0x38bf97[_0x007d('0x4b')]){_0x38bf97['waiting']+=0x1;}if(!_0x38bf97[_0x007d('0x4a')]&&_0x38bf97[_0x007d('0x4b')]){_0x38bf97[_0x007d('0x45')]+=0x1;if(_0x38bf97[_0x007d('0x44')]){_0x38bf97[_0x007d('0x44')]-=0x1;}}if(_0x38bf97[_0x007d('0x4a')]&&_0x38bf97[_0x007d('0x4c')]==='abandoned'){_0x38bf97['abandoned']+=0x1;if(_0x38bf97[_0x007d('0x44')]){_0x38bf97[_0x007d('0x44')]-=0x1;}}else if(_0x38bf97[_0x007d('0x4a')]&&!_0x38bf97[_0x007d('0x4b')]&&_0x38bf97[_0x007d('0x4c')]){_0x38bf97[_0x007d('0x47')]+=0x1;if(_0x38bf97[_0x007d('0x44')]){_0x38bf97[_0x007d('0x44')]-=0x1;}}else if(_0x38bf97[_0x007d('0x4a')]&&_0x38bf97[_0x007d('0x4b')]){_0x38bf97['answered']+=0x1;if(_0x38bf97[_0x007d('0x45')]){_0x38bf97[_0x007d('0x45')]-=0x1;}}_0x38bf97[_0x007d('0x49')]+=0x1;_0x346239(_0x38bf97);});}exports['index']=function(_0x31a552,_0xeb6e10){var _0x1b594d={},_0x5722ef={},_0x1cc91e={'count':0x0,'rows':[]};var _0x27b9db=_[_0x007d('0x4d')](db['ChatInteraction'][_0x007d('0x4e')],function(_0x47a98e){return{'name':_0x47a98e[_0x007d('0x4f')],'type':_0x47a98e[_0x007d('0x50')]['key']};});_0x5722ef[_0x007d('0x51')]=_[_0x007d('0x4d')](_0x27b9db,_0x007d('0x39'));_0x5722ef['query']=_[_0x007d('0x52')](_0x31a552['query']);_0x5722ef[_0x007d('0x53')]=_[_0x007d('0x54')](_0x5722ef[_0x007d('0x51')],_0x5722ef[_0x007d('0x55')]);_0x1b594d[_0x007d('0x56')]=_[_0x007d('0x54')](_0x5722ef[_0x007d('0x51')],qs['fields'](_0x31a552['query'][_0x007d('0x57')]));_0x1b594d[_0x007d('0x56')]=_0x1b594d[_0x007d('0x56')][_0x007d('0x58')]?_0x1b594d[_0x007d('0x56')]:_0x5722ef[_0x007d('0x51')];if(!_0x31a552['query'][_0x007d('0x59')](_0x007d('0x5a'))){_0x1b594d[_0x007d('0x31')]=qs[_0x007d('0x31')](_0x31a552['query']['limit']);_0x1b594d[_0x007d('0x2e')]=qs[_0x007d('0x2e')](_0x31a552['query'][_0x007d('0x2e')]);}_0x1b594d[_0x007d('0x5b')]=qs[_0x007d('0x5c')](_0x31a552['query']['sort']);_0x1b594d[_0x007d('0x5d')]=qs['filters'](_['pick'](_0x31a552[_0x007d('0x55')],_0x5722ef['filters']),_0x27b9db);var _0xfc623e=[];var _0x45f2d0=squel['select']()[_0x007d('0x5e')]('id')[_0x007d('0x5e')](_0x007d('0x39'))[_0x007d('0x5e')](_0x007d('0x5f'))[_0x007d('0x60')](_0x007d('0x61'));var _0x5445a6=squel['select']()[_0x007d('0x5e')](_0x007d('0x62'))[_0x007d('0x5e')](_0x007d('0x63'))[_0x007d('0x5e')]('ui.ChatInteractionId')[_0x007d('0x60')]('user_has_chat_interactions','ui')['left_join'](_0x007d('0x64'),'u',_0x007d('0x65'));var _0x1eb8f1=squel[_0x007d('0x66')]()['from'](_0x007d('0x67'),'i')[_0x007d('0x68')](_0x007d('0x69'),'c',_0x007d('0x6a'))['left_join'](_0x007d('0x64'),'o',_0x007d('0x6b'))[_0x007d('0x68')](_0x007d('0x6c'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x007d('0x68')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')['left_join']('chat_interaction_has_tags','it',_0x007d('0x6d'))['left_join'](_0x007d('0x61'),'t',_0x007d('0x6e'));var _0x388b89=squel[_0x007d('0x6f')]();var _0x3bbc0e=[];var _0x3667dc=squel[_0x007d('0x6f')]();var _0x48a883;if(_0x31a552['query']['search']){_0x48a883=as['parseSearch'](_0x31a552[_0x007d('0x55')][_0x007d('0x70')]);var _0x5ce815=_0x48a883['sqlOperator'];for(var _0x50d5f4=0x0;_0x50d5f4<_0x48a883[_0x007d('0x71')][_0x007d('0x58')];_0x50d5f4++){var _0x32f1cd=_0x48a883['conditions'][_0x50d5f4];var _0x47ca61='i';var _0xcbdd0e=_[_0x007d('0x72')](_0x27b9db,[_0x007d('0x39'),_0x32f1cd[_0x007d('0x5e')]]);if(!_0xcbdd0e){switch(_0x32f1cd[_0x007d('0x5e')]){case _0x007d('0x73'):if(_0x32f1cd[_0x007d('0x74')]==0x1){_0x1eb8f1[_0x007d('0x75')]('`'+_0x32f1cd['field']+_0x007d('0x76'));}else{_0x1eb8f1[_0x007d('0x75')]('`'+_0x32f1cd['field']+_0x007d('0x77'));}break;case _0x007d('0x78'):if(_0x32f1cd[_0x007d('0x79')]===_0x007d('0x7a')){if(_0x32f1cd[_0x007d('0x74')]['split']('\x20')[_0x007d('0x58')]>0x1){_0x388b89[_0x5ce815](_0x007d('0x7b'),qs[_0x007d('0x7c')](_0x32f1cd[_0x007d('0x74')]),null);}else{var _0x24e879='%'+_0x32f1cd[_0x007d('0x74')]+'%';_0x388b89[_0x5ce815](_0x007d('0x7d'),_0x24e879,_0x24e879,_0x24e879);}}else{_0xcbdd0e=_[_0x007d('0x72')](_0x27b9db,[_0x007d('0x39'),'ContactId']);_0x32f1cd[_0x007d('0x5e')]='ContactId';_0x5ae2f0=as[_0x007d('0x7e')](_0x47ca61,_0xcbdd0e[_0x007d('0x50')],_0x32f1cd);_0x388b89[_0x5ce815](_0x5ae2f0[_0x007d('0x7f')],_0x5ae2f0[_0x007d('0x74')][_0x007d('0x80')],_0x5ae2f0['value'][_0x007d('0x2c')]);}break;case _0x007d('0x81'):var _0x17facf=_0x32f1cd['value']['split'](',')['map'](function(_0x1cf64a){return Number(_0x1cf64a);});_0x17facf[_0x007d('0x43')](function(_0x31cfaa){_0x3667dc['or'](_0x007d('0x82'),'%,'+_0x31cfaa+',%');});_0x3bbc0e=_['union'](_0x3bbc0e,_0x17facf);break;case _0x007d('0x83'):if(_0x32f1cd[_0x007d('0x79')]===_0x007d('0x7a')){_0x388b89[_0x5ce815]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x32f1cd['value']+'%',null);}else{_0xcbdd0e=_[_0x007d('0x72')](_0x27b9db,[_0x007d('0x39'),_0x007d('0x4b')]);_0x32f1cd[_0x007d('0x5e')]=_0x007d('0x4b');_0x5ae2f0=as[_0x007d('0x7e')](_0x47ca61,_0xcbdd0e['type'],_0x32f1cd);_0x388b89[_0x5ce815](_0x5ae2f0[_0x007d('0x7f')],_0x5ae2f0[_0x007d('0x74')]['start'],_0x5ae2f0[_0x007d('0x74')]['end']);}break;case _0x007d('0x3d'):_0x5ae2f0=as[_0x007d('0x7e')]('me',null,_0x32f1cd);_0x388b89[_0x5ce815](_0x5ae2f0[_0x007d('0x7f')],_0x5ae2f0[_0x007d('0x74')]['start'],_0x5ae2f0['value'][_0x007d('0x2c')]);break;}}else{var _0x5ae2f0=as[_0x007d('0x7e')](_0x47ca61,_0xcbdd0e[_0x007d('0x50')],_0x32f1cd);_0x388b89[_0x5ce815](_0x5ae2f0[_0x007d('0x7f')],_0x5ae2f0[_0x007d('0x74')]['start'],_0x5ae2f0[_0x007d('0x74')][_0x007d('0x2c')]);}}}else{var _0x1f1ed7=_(_0x31a552['query'])[_0x007d('0x52')]()[_0x007d('0x4d')](function(_0x3f8840){return _[_0x007d('0x84')](_0x27b9db,[_0x007d('0x39'),_0x3f8840])?_0x3f8840:undefined;})['compact']()[_0x007d('0x74')]();if(!_[_0x007d('0x85')](_0x1f1ed7)){_0x1f1ed7['forEach'](function(_0x546340){if(_0x546340===_0x007d('0x86')){_0x1eb8f1[_0x007d('0x5d')]('i.ChatWebsiteId\x20IN\x20?',[][_0x007d('0x87')](_0x31a552[_0x007d('0x55')][_0x546340]));}else if(_0x546340===_0x007d('0x88')){var _0x43b8f6=JSON[_0x007d('0x89')](_0x31a552['query'][_0x546340])[_0x007d('0x8a')];var _0xfd7e0c=JSON['parse'](_0x31a552[_0x007d('0x55')][_0x546340])[_0x007d('0x8b')];_0x1eb8f1['where'](_0x007d('0x8c'),_0x43b8f6,_0xfd7e0c);}else{if(_0x31a552[_0x007d('0x55')][_0x546340]===_0x007d('0x8d')){_0x1eb8f1['where']('i.'+_0x546340+_0x007d('0x8e'));}else{_0x1eb8f1[_0x007d('0x5d')]('i.'+_0x546340+_0x007d('0x8f'),_0x31a552[_0x007d('0x55')][_0x546340]);}}});}if(_0x31a552[_0x007d('0x55')]['read']){if(_0x31a552[_0x007d('0x55')][_0x007d('0x90')]==0x1){_0x1eb8f1[_0x007d('0x75')](_0x007d('0x91'));}else{_0x1eb8f1[_0x007d('0x75')](_0x007d('0x92'));}}if(_0x31a552[_0x007d('0x55')][_0x007d('0x93')]){_0x3bbc0e=_[_0x007d('0x94')](_0x31a552[_0x007d('0x55')]['tag'])?_0x31a552[_0x007d('0x55')][_0x007d('0x93')]:new Array(_0x31a552['query'][_0x007d('0x93')]);_0x3bbc0e[_0x007d('0x43')](function(_0x98968e){_0x3667dc['or'](_0x007d('0x82'),'%,'+_0x98968e+',%');});}if(_0x31a552[_0x007d('0x55')][_0x007d('0x95')]){var _0x486936=_0x31a552[_0x007d('0x55')][_0x007d('0x95')][_0x007d('0x96')]('\x5c','\x5c\x5c')[_0x007d('0x96')](/'/g,'\x27\x27');if(qs[_0x007d('0x97')](_0x486936)){_0x388b89['or']('i.id\x20LIKE\x20?',_0x486936+'%');}else{_0x388b89['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x007d('0x7c')](_0x486936))['or'](_0x007d('0x98'),_0x486936+'%');}}}_0x1eb8f1[_0x007d('0x5d')](_0x388b89);_0x1eb8f1[_0x007d('0x99')](_0x007d('0x9a'));var _0x5befd2={'type':db[_0x007d('0x9b')][_0x007d('0x9c')][_0x007d('0x9d')],'raw':!![]};var _0x2cc4fd=_0x1eb8f1[_0x007d('0x9e')]();_0x2cc4fd[_0x007d('0x5e')](_0x007d('0x9a'));_0x2cc4fd[_0x007d('0x5e')](_0x007d('0x9f'),_0x007d('0x73'));if(_0x1b594d[_0x007d('0x5b')]){_0x1b594d[_0x007d('0x5b')]['forEach'](function(_0x58b9c7){var _0x199d0f=_0x58b9c7[0x0]===_0x007d('0xa0')?_0x58b9c7[0x0]:'i.'+_0x58b9c7[0x0];_0x1eb8f1[_0x007d('0x5b')](_0x199d0f,_0x58b9c7[0x1]==='DESC'?![]:!![]);});}if(!_[_0x007d('0x85')](_0x3bbc0e)){_0x1eb8f1[_0x007d('0x75')](_0x3667dc);_0x2cc4fd['where']('t.id\x20IN\x20?',_0x3bbc0e);}BPromise[_0x007d('0xa1')]()[_0x007d('0x21')](function(){if(!_0x48a883){if(_0x31a552['query'][_0x007d('0x86')])return;_0x2cc4fd[_0x007d('0x5d')](_0x007d('0xa2'));_0x1eb8f1['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x31a552['user'][_0x007d('0xa3')]!=='agent')return;return _0x31a552[_0x007d('0xa4')][_0x007d('0xa5')]({'attributes':['id'],'raw':!![]})[_0x007d('0x21')](function(_0x43ec2d){if(_[_0x007d('0x85')](_0x43ec2d)){_0x2cc4fd[_0x007d('0x5d')](_0x007d('0xa6'));_0x1eb8f1[_0x007d('0x5d')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x2cc4fd['where'](_0x007d('0xa7'),_[_0x007d('0x4d')](_0x43ec2d,'id'));_0x1eb8f1['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x007d('0x4d')](_0x43ec2d,'id'));}});})[_0x007d('0x21')](function(){if(_0x31a552[_0x007d('0xa4')][_0x007d('0xa3')]===_0x007d('0xa8')&&!_0x48a883&&!_0x31a552[_0x007d('0x55')][_0x007d('0x86')])return[];return db[_0x007d('0xa9')]['query'](_0x2cc4fd[_0x007d('0xaa')](),_0x5befd2);})[_0x007d('0x21')](function(_0x113594){_0x1cc91e[_0x007d('0x30')]=_0x113594[_0x007d('0x58')];if(_0x1cc91e['count']===0x0)return[];return db[_0x007d('0xa9')]['query'](_0x45f2d0[_0x007d('0xaa')](),_0x5befd2)[_0x007d('0x21')](function(_0x454c2e){_0xfc623e=_['keyBy'](_0x454c2e,'id');_0x5befd2=_['merge'](_0x5befd2,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x31a552[_0x007d('0x55')][_0x007d('0x57')]){_0x1b594d[_0x007d('0x56')][_0x007d('0x43')](function(_0x119c59){_0x1eb8f1[_0x007d('0x5e')]('i.'+_0x119c59);});}else{_0x1eb8f1['field'](_0x007d('0x9f'),_0x007d('0x73'));_0x1eb8f1['field'](_0x007d('0xab'),'Account.key');_0x1eb8f1[_0x007d('0x5e')](_0x007d('0xac'),_0x007d('0xad'));_0x1eb8f1[_0x007d('0x5e')](_0x007d('0xae'),_0x007d('0xa0'));_0x1eb8f1[_0x007d('0x5e')](_0x007d('0xaf'));_0x1eb8f1[_0x007d('0x5e')]('c.firstName',_0x007d('0xb0'));_0x1eb8f1['field']('c.lastName',_0x007d('0xb1'));_0x1eb8f1[_0x007d('0x5e')]('c.email','Contact.email');_0x1eb8f1['field'](_0x007d('0xb2'),_0x007d('0xb3'));_0x1eb8f1[_0x007d('0x5e')](_0x007d('0xb4'),_0x007d('0xb5'));_0x1eb8f1[_0x007d('0x5e')](_0x007d('0xb6'),_0x007d('0xb7'));_0x1eb8f1['field'](_0x007d('0xb8'),_0x007d('0xb9'));_0x1eb8f1[_0x007d('0x5e')](_0x007d('0xba'),_0x007d('0xbb'));_0x1eb8f1[_0x007d('0x5e')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x007d('0x40'));}if(_0x1b594d[_0x007d('0x31')])_0x1eb8f1['limit'](_0x1b594d['limit']);if(_0x1b594d[_0x007d('0x2e')])_0x1eb8f1[_0x007d('0x2e')](_0x1b594d['offset']);return db[_0x007d('0xa9')][_0x007d('0x55')](_0x1eb8f1[_0x007d('0xaa')](),_0x5befd2);})['then'](function(_0x5dabfb){if(_0x5dabfb['length']>0x0)_0x5445a6['where'](_0x007d('0xbc'),_['map'](_0x5dabfb,'id'));return db['sequelize'][_0x007d('0x55')](_0x5445a6[_0x007d('0xaa')](),_0x5befd2)[_0x007d('0x21')](function(_0x4438f4){var _0x568673=_['groupBy'](_0x4438f4,_0x007d('0xbd'));var _0x2392a1=[];_0x5dabfb[_0x007d('0x43')](function(_0x1a152b){_0x2392a1[_0x007d('0xbe')](updateChatInteraction(_0x1a152b,_0xfc623e,_0x568673));});return BPromise['all'](_0x2392a1);});});})[_0x007d('0x21')](function(_0x4a3728){_0x1cc91e[_0x007d('0xbf')]=_0x4a3728;return _0x1cc91e;})[_0x007d('0x21')](respondWithFilteredResult(_0xeb6e10,_0x1b594d))['catch'](handleError(_0xeb6e10,null));};exports[_0x007d('0xc0')]=function(_0x23a1aa,_0xae7aeb){var _0x3c467={'raw':![],'where':{'id':_0x23a1aa['params']['id']}},_0x4473db={};_0x4473db[_0x007d('0x51')]=_['keys'](db[_0x007d('0xc1')]['rawAttributes']);_0x4473db[_0x007d('0x55')]=_[_0x007d('0x52')](_0x23a1aa[_0x007d('0x55')]);_0x4473db[_0x007d('0x53')]=_[_0x007d('0x54')](_0x4473db['model'],_0x4473db[_0x007d('0x55')]);_0x3c467['attributes']=_[_0x007d('0x54')](_0x4473db['model'],qs[_0x007d('0x57')](_0x23a1aa['query'][_0x007d('0x57')]));_0x3c467[_0x007d('0x56')]=_0x3c467[_0x007d('0x56')]['length']?_0x3c467[_0x007d('0x56')]:_0x4473db[_0x007d('0x51')];if(_0x23a1aa['query']['includeAll']){_0x3c467[_0x007d('0xc2')]=[{'all':!![]}];}_0x3c467=_[_0x007d('0x3c')]({},_0x3c467,_0x23a1aa[_0x007d('0xc3')]);return db[_0x007d('0xc1')][_0x007d('0x72')](_0x3c467)[_0x007d('0x21')](handleEntityNotFound(_0xae7aeb,null))[_0x007d('0x21')](respondWithResult(_0xae7aeb,null))[_0x007d('0x2b')](handleError(_0xae7aeb,null));};exports[_0x007d('0xc4')]=function(_0x554dbf,_0x3a6f0e){return db['ChatInteraction'][_0x007d('0xc4')](_0x554dbf[_0x007d('0x3d')],{})[_0x007d('0x21')](respondWithResult(_0x3a6f0e,0xc9))[_0x007d('0x2b')](handleError(_0x3a6f0e,null));};exports['update']=function(_0x47d984,_0xe755a2){if(_0x47d984['body']['id']){delete _0x47d984['body']['id'];}return db[_0x007d('0xc1')][_0x007d('0x72')]({'where':{'id':_0x47d984[_0x007d('0xc5')]['id']}})[_0x007d('0x21')](handleEntityNotFound(_0xe755a2,null))[_0x007d('0x21')](saveUpdates(_0x47d984[_0x007d('0x3d')],null))['then'](respondWithResult(_0xe755a2,null))[_0x007d('0x2b')](handleError(_0xe755a2,null));};exports[_0x007d('0x37')]=function(_0x5ac55e,_0x5a96c4){return db[_0x007d('0xc1')][_0x007d('0x72')]({'where':{'id':_0x5ac55e[_0x007d('0xc5')]['id']}})[_0x007d('0x21')](handleEntityNotFound(_0x5a96c4,null))['then'](removeEntity(_0x5a96c4,null))[_0x007d('0x2b')](handleError(_0x5a96c4,null));};exports[_0x007d('0xc6')]=function(_0x391887,_0x2adbb8){return db[_0x007d('0xc1')]['describe']()['then'](respondWithResult(_0x2adbb8,null))[_0x007d('0x2b')](handleError(_0x2adbb8,null));};exports[_0x007d('0xc7')]=function(_0x53de51,_0x26f336){var _0x57a83f=_0x53de51[_0x007d('0xc5')]['id'];var _0x21695f;var _0x33f743;var _0x4df82c;return db['ChatInteraction']['findOne']({'where':{'id':_0x57a83f}})[_0x007d('0x21')](function(_0x5a12b2){_0x21695f=_0x5a12b2;return db[_0x007d('0xc8')]['findOne']({'where':{'id':_0x5a12b2['ChatWebsiteId']},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0x007d('0xc9'),_0x007d('0xca')],'raw':!![]});})['then'](function(_0xb1741d){if(_0xb1741d&&_0xb1741d[_0x007d('0xcb')]&&_0xb1741d[_0x007d('0xcc')]){_0x33f743=_0xb1741d;var _0x1efff7={'interaction':{'id':_0x57a83f},'agent':{'id':_0x53de51[_0x007d('0xa4')]['id'],'name':_0x53de51[_0x007d('0xa4')][_0x007d('0x39')],'fullname':_0x53de51[_0x007d('0xa4')]['fullname'],'email':_0x53de51['user'][_0x007d('0xcd')]},'contact':_0x53de51[_0x007d('0x3d')][_0x007d('0xce')],'account':_0x53de51[_0x007d('0x3d')][_0x007d('0xcf')]};var _0x10548f={'rejectUnauthorized':![],'method':_0x007d('0xd0'),'url':_0x007d('0xd1'),'headers':{'X-APIKEY':_0xb1741d[_0x007d('0xcb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x53de51[_0x007d('0xa4')][_0x007d('0xcd')]],'buttons':null,'topic':_0x33f743['vidaooTopic'],'note':_[_0x007d('0xd2')](_0x33f743[_0x007d('0xc9')])?null:getMustacheRender(_0x33f743[_0x007d('0xc9')],_0x1efff7),'metadata':null},'redirect':_0x007d('0xd3'),'json':!![]};try{if(!_['isNull'](_0x33f743['vidaooMetadata'])){var _0x4fa00=getMustacheRender(_0x33f743[_0x007d('0xca')],_0x1efff7);var _0x15f28e=JSON['parse'](_0x4fa00);_0x10548f[_0x007d('0x3d')][_0x007d('0xd4')]=_0x15f28e;}}catch(_0x129ea2){throw new db[(_0x007d('0x9b'))][(_0x007d('0xd5'))](_0x007d('0xd6'));}return rp(_0x10548f);}else{throw new db[(_0x007d('0x9b'))]['ValidationError'](_0x007d('0xd7'));}})[_0x007d('0x21')](function(_0x1d9782){_0x4df82c=_0x1d9782;if(_0x4df82c['id']){var _0x10cc5e={'body':_0x4df82c[_0x007d('0xd8')],'ChatWebsiteId':_0x33f743['id'],'ChatInteractionId':_0x21695f['id'],'direction':'out','UserId':_0x53de51['user']['id']};return db[_0x007d('0xd9')][_0x007d('0xc4')](_0x10cc5e,{});}else{throw new db[(_0x007d('0x9b'))][(_0x007d('0xd5'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x007d('0x21')](function(){return _0x21695f[_0x007d('0xda')]({'vidaooSessionId':_0x4df82c['id']});})['then'](respondWithResult(_0x26f336,null))[_0x007d('0x2b')](handleError(_0x26f336,null));};exports[_0x007d('0xdb')]=function(_0x451415,_0x1bd7c7){if(_0x451415[_0x007d('0x3d')]['id']){delete _0x451415[_0x007d('0x3d')]['id'];}return db[_0x007d('0xc1')][_0x007d('0x72')]({'where':{'id':_0x451415[_0x007d('0xc5')]['id']},'include':[{'model':db[_0x007d('0xdc')],'as':'Contact'}]})[_0x007d('0x21')](handleEntityNotFound(_0x1bd7c7,null))[_0x007d('0x21')](saveUpdates(_0x451415[_0x007d('0x3d')],null))['then'](respondWithResult(_0x1bd7c7,null))[_0x007d('0x2b')](handleError(_0x1bd7c7,null));};exports[_0x007d('0xdd')]=function(_0x2f4de7,_0xf1d5d1,_0x2a705c){if(_0x2f4de7[_0x007d('0x3d')]['id']){delete _0x2f4de7[_0x007d('0x3d')]['id'];}return db['ChatInteraction'][_0x007d('0x72')]({'where':{'id':_0x2f4de7[_0x007d('0xc5')]['id']}})[_0x007d('0x21')](function(_0x173667){if(!_0x173667){logger['error'](_0x007d('0xde'),_0x007d('0xdd'),0x194,_0x007d('0xdf'));_0xf1d5d1[_0x007d('0xe0')](0x194);}else{if(_0x173667[_0x007d('0x4b')]){throw new db[(_0x007d('0x9b'))][(_0x007d('0xd5'))](_0x007d('0xe1'));}}return _0x173667;})[_0x007d('0x21')](function(_0x29b52a){if(_0x29b52a){return _0x29b52a[_0x007d('0x36')]({'closed':_0x2f4de7[_0x007d('0x3d')][_0x007d('0x4a')],'disposition':_0x2f4de7[_0x007d('0x3d')][_0x007d('0x4c')]})[_0x007d('0x21')](function(_0x2e3cc4){return _0x2e3cc4;});}})[_0x007d('0x21')](function(_0x5555c2){return respondWithRpcPromise(_0x007d('0xe2'),_0x007d('0xdd'),_0x2f4de7[_0x007d('0x3d')],client9004);})[_0x007d('0x21')](respondWithResult(_0xf1d5d1,null))['catch'](handleError(_0xf1d5d1,null));};exports['attachmentUpload']=function(_0x17d2e9,_0x334ea5,_0x3636ae){_0x17d2e9[_0x007d('0x3d')]['name']=_0x17d2e9['file'][_0x007d('0xe3')];_0x17d2e9[_0x007d('0x3d')][_0x007d('0xe4')]=_0x17d2e9['file'][_0x007d('0xe5')];_0x17d2e9[_0x007d('0x3d')]['type']=_0x17d2e9['file'][_0x007d('0xe6')];return db[_0x007d('0xe7')][_0x007d('0xc4')](_0x17d2e9[_0x007d('0x3d')])['then'](respondWithResult(_0x334ea5,0xc9))[_0x007d('0x2b')](handleError(_0x334ea5,null));};exports['attachmentDownload']=function(_0x14f429,_0x4af9f0,_0x58d62e){return db[_0x007d('0xc1')][_0x007d('0xe8')]({'where':{'id':_0x14f429['params']['id']},'raw':!![]})[_0x007d('0x21')](handleEntityNotFound(_0x4af9f0,null))[_0x007d('0x21')](function(_0x2335ee){if(_0x2335ee){if(_0x2335ee[_0x007d('0x4a')]){return _0x4af9f0['status'](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x007d('0xe7')][_0x007d('0xe8')]({'where':{'id':_0x14f429[_0x007d('0x55')][_0x007d('0xe9')]},'raw':!![]})[_0x007d('0x21')](handleEntityNotFound(_0x4af9f0,null));}})['then'](function(_0x130f8a){if(_0x130f8a){var _0x5ddc01=_0x130f8a[_0x007d('0xea')]!==null;var _0xa872d2=path[_0x007d('0xeb')](config[_0x007d('0xec')],_0x007d('0xed'));if(_0x5ddc01){_0xa872d2=path[_0x007d('0xeb')](_0xa872d2,_0x007d('0xee'));}var _0x2cb366=path[_0x007d('0xeb')](_0xa872d2,_0x130f8a[_0x007d('0xe4')]);return _0x4af9f0['download'](_0x2cb366);}})[_0x007d('0x2b')](handleError(_0x4af9f0,null));};exports['close']=function(_0x556fa3,_0x16e209){var _0x1d5c62=null;var _0x243670=null;var _0x2df7a0=null;var _0x5c20b7=null;if(_0x556fa3[_0x007d('0x3d')]['id']){delete _0x556fa3[_0x007d('0x3d')]['id'];}if(_0x556fa3['body'][_0x007d('0xef')]){_0x5c20b7=path[_0x007d('0xeb')](config['root'],_0x007d('0xf0'),util[_0x007d('0xf1')](_0x007d('0xf2'),Date['now']()));_0x556fa3[_0x007d('0x3d')][_0x007d('0xf3')]=_0x5c20b7;}return db[_0x007d('0xc1')][_0x007d('0x72')]({'where':{'id':_0x556fa3[_0x007d('0xc5')]['id']},'include':[{'model':db[_0x007d('0xd9')],'as':'Messages','include':[{'model':db[_0x007d('0x83')],'as':_0x007d('0x83')}]}]})[_0x007d('0x21')](handleEntityNotFound(_0x16e209,null))[_0x007d('0x21')](saveUpdates(_0x556fa3[_0x007d('0x3d')],null))['then'](function(_0x7f92cd){if(_0x7f92cd){_0x1d5c62=_0x7f92cd;return db['ChatWebsite'][_0x007d('0x72')]({'where':{'id':_0x1d5c62[_0x007d('0x86')]}});}})[_0x007d('0x21')](function(_0x40484f){if(_0x40484f){_0x2df7a0=_0x40484f;return db[_0x007d('0xdc')][_0x007d('0x72')]({'where':{'id':_0x1d5c62[_0x007d('0xf4')]}});}})['then'](function(_0x3a7425){if(_0x3a7425){_0x243670=_0x3a7425;if(_0x5c20b7){var _0x4767f8=null;for(var _0x5a596f=0x1;_0x5a596f<_0x1d5c62['Messages'][_0x007d('0x58')];++_0x5a596f){_0x4767f8=_0x1d5c62[_0x007d('0xf5')][_0x5a596f];var _0x3a015f=_0x4767f8['UserId']?util[_0x007d('0xf1')](_0x007d('0xf6'),_0x2df7a0[_0x007d('0xf7')],_0x4767f8[_0x007d('0x4b')]):'System';var _0x353a1b=_0x556fa3['body'][_0x007d('0xf8')]||util[_0x007d('0xf1')](_0x007d('0xf6'),_0x007d('0xf9'),_0x4767f8[_0x007d('0xf4')]);switch(_0x2df7a0[_0x007d('0xfa')]){case _0x007d('0xfb'):_0x3a015f=_0x4767f8['UserId']?util[_0x007d('0xf1')]('%s%d',_0x2df7a0[_0x007d('0xf7')],_0x4767f8[_0x007d('0x4b')]):'System';break;case _0x007d('0xfc'):_0x3a015f=_0x4767f8[_0x007d('0x4b')]?_0x4767f8[_0x007d('0x83')][_0x007d('0xfd')]||_0x4767f8[_0x007d('0x83')]['fullname']:_0x007d('0xfe');break;case _0x007d('0xff'):_0x3a015f=_0x4767f8[_0x007d('0x4b')]?_0x4767f8[_0x007d('0x83')][_0x007d('0x3f')]:_0x007d('0xfe');break;default:_0x3a015f=_0x4767f8[_0x007d('0x4b')]?util[_0x007d('0xf1')](_0x007d('0xf6'),_0x2df7a0['agentAlias'],_0x4767f8['UserId']):_0x007d('0xfe');}var _0x1f3938=util[_0x007d('0xf1')](_0x007d('0x100'),moment(_0x4767f8[_0x007d('0x88')])[_0x007d('0xf1')](_0x007d('0x101')),_0x4767f8[_0x007d('0x102')]==='in'?_0x353a1b:_0x3a015f,_0x4767f8[_0x007d('0x3d')]);if(!_0x4767f8[_0x007d('0x103')]){fs[_0x007d('0x104')](_0x5c20b7,_0x1f3938);}}return db[_0x007d('0x105')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x007d('0x106')],'as':_0x007d('0x107'),'raw':!![]}]});}}})['then'](function(_0x426939){if(_0x426939&&_0x426939[_0x007d('0x107')]&&_0x556fa3['body']){var _0x382f2b={'tls':{'rejectUnauthorized':![]}};if(_0x426939['Smtp'][_0x007d('0x108')]){_0x382f2b['service']=_0x426939['Smtp'][_0x007d('0x108')];}else{_0x382f2b[_0x007d('0x109')]=_0x426939['Smtp'][_0x007d('0x109')];_0x382f2b[_0x007d('0x10a')]=_0x426939[_0x007d('0x107')][_0x007d('0x10a')];_0x382f2b[_0x007d('0x10b')]=_0x426939[_0x007d('0x107')][_0x007d('0x10b')];}if(_0x426939[_0x007d('0x107')]['authentication']){_0x382f2b['auth']={'user':_0x426939[_0x007d('0x107')][_0x007d('0xa4')],'pass':_0x426939[_0x007d('0x107')][_0x007d('0x10c')]};}return respondWithRpcPromise(_0x007d('0x10d'),_0x007d('0x10e'),{'account':_0x382f2b,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x426939['name'],_0x426939[_0x007d('0xcd')]||_0x426939[_0x007d('0x107')][_0x007d('0xa4')]),'to':_0x556fa3[_0x007d('0x3d')][_0x007d('0xef')],'subject':_0x007d('0x10f'),'text':util[_0x007d('0xf1')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x556fa3[_0x007d('0x3d')][_0x007d('0xef')]),'attachments':[{'path':_0x5c20b7}]}})['then'](function(){return _0x1d5c62;})[_0x007d('0x2b')](function(_0x18c3c9){console[_0x007d('0x28')](_0x18c3c9);});}else{return _0x1d5c62;}})[_0x007d('0x21')](respondWithStatusCode(_0x16e209,0xc8))[_0x007d('0x2b')](handleError(_0x16e209,null));};exports['addMessage']=function(_0x2c7174,_0x52399f,_0x5f1cdb){return db[_0x007d('0xd9')][_0x007d('0x72')]({'where':{'id':_0x2c7174[_0x007d('0xc5')]['id']}})[_0x007d('0x21')](handleEntityNotFound(_0x52399f,null))[_0x007d('0x21')](function(_0x31bddd){if(_0x31bddd){return _0x31bddd[_0x007d('0x110')](_0x2c7174[_0x007d('0x3d')][_0x007d('0x111')],_[_0x007d('0x112')](_0x2c7174[_0x007d('0x3d')],[_0x007d('0x111'),'id'])||{});}})['then'](respondWithResult(_0x52399f,null))[_0x007d('0x2b')](handleError(_0x52399f,null));};exports['getMessages']=function(_0x33f9dc,_0x3df673,_0x34e52c){var _0x4debd4={'raw':![],'where':{}};var _0x2f251b={};var _0xe2b029={'count':0x0,'rows':[]};return db[_0x007d('0xc1')][_0x007d('0xe8')]({'where':{'id':_0x33f9dc[_0x007d('0xc5')]['id']}})[_0x007d('0x21')](handleEntityNotFound(_0x3df673,null))['then'](function(_0x5388e7){if(_0x5388e7){_0x2f251b[_0x007d('0x51')]=_[_0x007d('0x52')](db[_0x007d('0xd9')][_0x007d('0x4e')]);_0x2f251b[_0x007d('0x55')]=_[_0x007d('0x52')](_0x33f9dc[_0x007d('0x55')]);_0x2f251b[_0x007d('0x53')]=_['intersection'](_0x2f251b[_0x007d('0x51')],_0x2f251b[_0x007d('0x55')]);_0x4debd4['attributes']=_[_0x007d('0x54')](_0x2f251b[_0x007d('0x51')],qs[_0x007d('0x57')](_0x33f9dc['query'][_0x007d('0x57')]));_0x4debd4['attributes']=_0x4debd4[_0x007d('0x56')][_0x007d('0x58')]?_0x4debd4[_0x007d('0x56')]:_0x2f251b[_0x007d('0x51')];if(!_0x33f9dc['query'][_0x007d('0x59')](_0x007d('0x5a'))){_0x4debd4[_0x007d('0x31')]=qs[_0x007d('0x31')](_0x33f9dc['query']['limit']);_0x4debd4['offset']=qs[_0x007d('0x2e')](_0x33f9dc[_0x007d('0x55')][_0x007d('0x2e')]);}_0x4debd4['order']=qs[_0x007d('0x5c')](_0x33f9dc[_0x007d('0x55')][_0x007d('0x5c')]);_0x4debd4[_0x007d('0x5d')]=qs['filters'](_[_0x007d('0x113')](_0x33f9dc[_0x007d('0x55')],_0x2f251b['filters']));_0x4debd4[_0x007d('0x5d')][_0x007d('0xbd')]=_0x5388e7['id'];if(_0x33f9dc[_0x007d('0x55')][_0x007d('0x95')]){_0x4debd4[_0x007d('0x5d')]=_[_0x007d('0x3c')](_0x4debd4[_0x007d('0x5d')],{'$or':_['map'](_0x4debd4[_0x007d('0x56')],function(_0x12993f){var _0x4014b9={};_0x4014b9[_0x12993f]={'$like':'%'+_0x33f9dc[_0x007d('0x55')][_0x007d('0x95')]+'%'};return _0x4014b9;})});}if(_0x33f9dc['query'][_0x007d('0x8a')]){var _0x2234ef=_0x33f9dc[_0x007d('0x55')][_0x007d('0x8a')][_0x007d('0x42')](',');var _0x1235ce={};_0x1235ce[_0x2234ef[0x0]]={'$gte':moment(_0x2234ef[0x1])['format'](_0x007d('0x114'))};_0x4debd4[_0x007d('0x5d')]=_[_0x007d('0x3c')](_0x4debd4['where'],_0x1235ce);}_0x4debd4=_['merge']({},_0x4debd4,_0x33f9dc[_0x007d('0xc3')]);return db[_0x007d('0xd9')][_0x007d('0x30')]({'where':_0x4debd4[_0x007d('0x5d')]})[_0x007d('0x21')](function(_0x4f057d){_0xe2b029[_0x007d('0x30')]=_0x4f057d;if(_0x33f9dc['query']['includeAll']){_0x4debd4[_0x007d('0xc2')]=[{'all':!![]}];}return db[_0x007d('0xd9')]['findAll'](_0x4debd4);})[_0x007d('0x21')](function(_0x5105bb){_0xe2b029[_0x007d('0xbf')]=_0x5105bb;return _0xe2b029;});}})[_0x007d('0x21')](respondWithFilteredResult(_0x3df673,_0x4debd4))[_0x007d('0x2b')](handleError(_0x3df673,null));};exports['getMyMessages']=function(_0x3abb4d,_0x9593a9,_0xce71e6){var _0x26f673={'where':{}},_0x24dc3c={},_0x3e16bb={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x007d('0xe8')]({'where':{'id':_0x3abb4d['params']['id']}})[_0x007d('0x21')](handleEntityNotFound(_0x9593a9,null))[_0x007d('0x21')](function(_0x45d278){if(_0x45d278){_0x24dc3c[_0x007d('0x51')]=_['keys'](db[_0x007d('0xd9')]['rawAttributes']);_0x24dc3c['query']=_['keys'](_0x3abb4d[_0x007d('0x55')]);_0x24dc3c[_0x007d('0x53')]=_[_0x007d('0x54')](_0x24dc3c[_0x007d('0x51')],_0x24dc3c[_0x007d('0x55')]);_0x26f673[_0x007d('0x56')]=_[_0x007d('0x54')](_0x24dc3c[_0x007d('0x51')],qs['fields'](_0x3abb4d[_0x007d('0x55')][_0x007d('0x57')]));_0x26f673[_0x007d('0x56')]=_0x26f673[_0x007d('0x56')][_0x007d('0x58')]?_0x26f673[_0x007d('0x56')]:_0x24dc3c[_0x007d('0x51')];if(!_0x3abb4d[_0x007d('0x55')][_0x007d('0x59')](_0x007d('0x5a'))){_0x26f673[_0x007d('0x31')]=qs[_0x007d('0x31')](_0x3abb4d[_0x007d('0x55')][_0x007d('0x31')]);_0x26f673[_0x007d('0x2e')]=qs['offset'](_0x3abb4d[_0x007d('0x55')][_0x007d('0x2e')]);}_0x26f673['order']=qs[_0x007d('0x5c')](_0x3abb4d[_0x007d('0x55')][_0x007d('0x5c')]);_0x26f673['where']=qs['filters'](_['pick'](_0x3abb4d[_0x007d('0x55')],_0x24dc3c[_0x007d('0x53')]));_0x26f673[_0x007d('0x5d')]['ChatInteractionId']=_0x45d278['id'];if(_0x3abb4d['query'][_0x007d('0x95')]){_0x26f673[_0x007d('0x5d')]=_['merge'](_0x26f673[_0x007d('0x5d')],{'$or':_[_0x007d('0x4d')](_0x26f673['attributes'],function(_0x548817){var _0x5330fa={};_0x5330fa[_0x548817]={'$like':'%'+_0x3abb4d[_0x007d('0x55')][_0x007d('0x95')]+'%'};return _0x5330fa;})});}_0x26f673['where'][_0x007d('0x103')]=![];if(_0x3abb4d[_0x007d('0x55')]['id']){_0x26f673['where']['id']={'$gt':_0x3abb4d[_0x007d('0x55')]['id']};}_0x26f673=_[_0x007d('0x3c')]({},_0x26f673,_0x3abb4d[_0x007d('0xc3')]);return db[_0x007d('0xd9')][_0x007d('0x30')]({'where':_0x26f673[_0x007d('0x5d')]})[_0x007d('0x21')](function(_0x14b214){_0x3e16bb[_0x007d('0x30')]=_0x14b214;_0x26f673[_0x007d('0xc2')]=[];if(_0x3abb4d[_0x007d('0x55')][_0x007d('0x115')]){_0x26f673[_0x007d('0xc2')][_0x007d('0xbe')]({'model':db[_0x007d('0x83')],'as':_0x007d('0x83'),'attributes':['id',_0x007d('0x3f'),_0x007d('0xfd')]});}if(_0x3abb4d[_0x007d('0x55')]['includeAll']){_0x26f673[_0x007d('0xc2')]=[{'all':!![]}];}return db['ChatMessage'][_0x007d('0x116')](_0x26f673);})[_0x007d('0x21')](function(_0x5f12ba){_0x3e16bb[_0x007d('0xbf')]=_0x5f12ba;return _0x3e16bb;});}})[_0x007d('0x21')](respondWithFilteredResult(_0x9593a9,_0x26f673))[_0x007d('0x2b')](handleError(_0x9593a9,null));};exports['addTags']=function(_0x4a634a,_0x7cb8f9,_0x2ade1f){return db['ChatInteraction'][_0x007d('0x72')]({'where':{'id':_0x4a634a[_0x007d('0xc5')]['id']}})[_0x007d('0x21')](handleEntityNotFound(_0x7cb8f9,null))[_0x007d('0x21')](function(_0x2ae50f){if(_0x2ae50f){return _0x2ae50f[_0x007d('0x117')](_0x4a634a[_0x007d('0x3d')][_0x007d('0x111')],_['omit'](_0x4a634a['body'],['ids','id'])||{})[_0x007d('0x118')](function(){return db[_0x007d('0x81')]['findAll']({'attributes':['id',_0x007d('0x39'),_0x007d('0x5f')],'where':{'id':_0x4a634a[_0x007d('0x3d')][_0x007d('0x111')]}});})[_0x007d('0x21')](function(_0x524bc4){socket[_0x007d('0x119')]('chatInteractionTags:save',{'id':Number(_0x4a634a[_0x007d('0xc5')]['id']),'tags':_0x524bc4||[]});return{'id':Number(_0x4a634a[_0x007d('0xc5')]['id']),'tags':_0x524bc4||[]};});}})[_0x007d('0x21')](respondWithResult(_0x7cb8f9,null))[_0x007d('0x2b')](handleError(_0x7cb8f9,null));};exports[_0x007d('0x11a')]=function(_0x55ce0b,_0x56204a,_0x288be5){return db[_0x007d('0xc1')][_0x007d('0x72')]({'where':{'id':_0x55ce0b[_0x007d('0xc5')]['id']}})['then'](handleEntityNotFound(_0x56204a,null))['then'](function(_0x14b7e0){if(_0x14b7e0){return _0x14b7e0[_0x007d('0x11a')](_0x55ce0b['query'][_0x007d('0x111')]);}})[_0x007d('0x21')](respondWithStatusCode(_0x56204a,null))['catch'](handleError(_0x56204a,null));};exports[_0x007d('0x11b')]=function(_0x4c73f0,_0x575416){var _0x185944=moment()[_0x007d('0x11c')]()[_0x007d('0xaa')]();var _0xf3882c=path['join'](config[_0x007d('0xec')],'server','files',_0x007d('0x11d'));var _0x371b56=path[_0x007d('0xeb')](config[_0x007d('0xec')],_0x007d('0x11e'),_0x007d('0x11f'),_0x007d('0x120'));var _0x79ac29=path['join'](_0xf3882c,_0x185944);var _0x2abb8a=util[_0x007d('0xf1')](_0x007d('0x121'),_0x4c73f0[_0x007d('0xc5')]['id'],_0x185944);var _0x3e38d2=path[_0x007d('0xeb')](_0xf3882c,_0x2abb8a);var _0x1ad3e1=[];_0x1ad3e1[_0x007d('0xbe')]({'model':db[_0x007d('0x83')],'as':'User','attributes':['id',_0x007d('0x3f')],'raw':!![]});_0x1ad3e1['push']({'model':db['CmContact'],'as':_0x007d('0x78'),'attributes':['id',_0x007d('0x122'),'lastName'],'raw':!![]});if(_0x4c73f0['query'][_0x007d('0x120')]){_0x1ad3e1[_0x007d('0xbe')]({'model':db[_0x007d('0xe7')],'as':_0x007d('0xe7'),'raw':!![]});}var _0x33e35b=[{'model':db[_0x007d('0xd9')],'as':_0x007d('0xf5'),'attributes':['id',_0x007d('0x3d'),_0x007d('0x88'),'direction',_0x007d('0x103'),_0x007d('0x90')],'include':_0x1ad3e1}];_0x33e35b[_0x007d('0xbe')]({'model':db['ChatWebsite'],'as':_0x007d('0x123'),'attributes':['id',_0x007d('0x39')]});_0x33e35b['push']({'model':db[_0x007d('0x83')],'as':_0x007d('0x124'),'attributes':['id',_0x007d('0x3f')]});return db[_0x007d('0xc1')][_0x007d('0x72')]({'where':{'id':_0x4c73f0[_0x007d('0xc5')]['id']},'include':_0x33e35b})[_0x007d('0x21')](handleEntityNotFound(_0x575416,null))['then'](function(_0x48018d){if(_0x48018d){var _0x548018=_0x48018d['get']({'plain':!![]});fs['mkdirSync'](_0x79ac29);var _0x29b8f6={'channel':_0x007d('0x125'),'account':_0x548018[_0x007d('0x123')]['name'],'agent':_0x548018['Owner']?_0x548018[_0x007d('0x124')][_0x007d('0x3f')]:'N.A.','createdAt':moment(_0x548018[_0x007d('0x88')])[_0x007d('0xf1')](_0x007d('0x114'))[_0x007d('0xaa')](),'closedAt':_0x548018['closed']?moment(_0x548018['closedAt'])[_0x007d('0xf1')](_0x007d('0x114'))[_0x007d('0xaa')]():'','disposition':_0x548018[_0x007d('0x4c')],'chatInfo':{'browser':_0x548018[_0x007d('0x126')],'os':_0x548018[_0x007d('0x127')],'referer':_0x548018[_0x007d('0x128')],'customerIp':_0x548018[_0x007d('0x129')],'customerPort':_0x548018['customerPort']?_0x548018[_0x007d('0x12a')]:'N.A.'},'messages':_(_0x548018['Messages'])[_0x007d('0x12b')]()[_0x007d('0x95')]({'secret':![]})[_0x007d('0x4d')](function(_0x46d182){if(_0x46d182['Attachment']){var _0x4ed659=path[_0x007d('0xeb')](_0x371b56,_0x46d182[_0x007d('0xe7')][_0x007d('0xe4')]);if(fs[_0x007d('0x12c')](_0x4ed659)){fs['createReadStream'](_0x4ed659)[_0x007d('0x12d')](fs[_0x007d('0x12e')](path[_0x007d('0xeb')](_0x79ac29,_0x46d182[_0x007d('0xe7')][_0x007d('0xe4')])));}}return{'date':moment(_0x46d182['createdAt'])[_0x007d('0xf1')](_0x007d('0x114'))[_0x007d('0xaa')](),'sender':_0x46d182['direction']===_0x007d('0x12f')?_0x46d182[_0x007d('0x83')]?_0x46d182['User']['fullname']:_0x007d('0xfe'):_0x46d182[_0x007d('0x78')][_0x007d('0x122')]+(_0x46d182[_0x007d('0x78')][_0x007d('0x130')]?'\x20'+_0x46d182['Contact'][_0x007d('0x130')]:''),'body':_0x46d182[_0x007d('0xe7')]?_0x46d182[_0x007d('0xe7')][_0x007d('0xe4')]:_0x46d182['body'],'direction':_0x46d182['direction']==='out'?'A':'C','secret':_0x46d182[_0x007d('0x103')],'read':_0x46d182[_0x007d('0x90')],'attachment':_0x46d182[_0x007d('0xe7')]};})[_0x007d('0x74')]()};return ejs['renderFile'](path[_0x007d('0xeb')](config[_0x007d('0xec')],'server',_0x007d('0x131'),_0x007d('0x132')),{'interaction':_0x29b8f6})[_0x007d('0x21')](function(_0x3026f0){var _0x3ac10c=path[_0x007d('0xeb')](_0x79ac29,'transcript-'+_0x548018['id']+'-'+_0x185944+_0x007d('0x133'));var _0x5106d2={'path':_0x3ac10c,'channel':_0x007d('0x125'),'interactionId':_0x548018['id']};return pdf['createPdfFromHTML'](_0x3026f0,_0x5106d2);})['then'](function(){return new BPromise(function(_0x2f9c56,_0x31688c){zipdir(_0x79ac29,{'saveTo':_0x3e38d2},function(_0x277e47,_0x40bb84){if(_0x277e47)return _0x31688c(_0x277e47);return _0x2f9c56(_0x40bb84);});})[_0x007d('0x21')](function(){return new BPromise(function(_0x5d3efe,_0x282545){rimraf(_0x79ac29,function(_0x85dad0){if(_0x85dad0)_0x282545(_0x85dad0);return _0x5d3efe();});});})['then'](function(){return _0x575416[_0x007d('0x11b')](_0x3e38d2,_0x2abb8a,function(_0x567265){if(_0x567265){console['log'](_0x007d('0x134'),_0x567265);}else{fs[_0x007d('0x135')](_0x3e38d2);}});});});}else{return _0x575416['sendStatus'](0xc8);}})['catch'](handleError(_0x575416,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 408ba46..1b98b3a 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 _0xcc58=['remove','getUsers','Users','map','findAll','then','setDataValue','emit','hook','exports','events','../../mysqldb','ChatMessage','save','update'];(function(_0x30e514,_0x2148ea){var _0x5be838=function(_0xd2ff6f){while(--_0xd2ff6f){_0x30e514['push'](_0x30e514['shift']());}};_0x5be838(++_0x2148ea);}(_0xcc58,0x1cc));var _0x8cc5=function(_0x1d1060,_0x515ae9){_0x1d1060=_0x1d1060-0x0;var _0x19d76f=_0xcc58[_0x1d1060];return _0x19d76f;};'use strict';var EventEmitter=require(_0x8cc5('0x0'));var ChatInteraction=require(_0x8cc5('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x8cc5('0x1'))['db'][_0x8cc5('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8cc5('0x3'),'afterUpdate':_0x8cc5('0x4'),'afterDestroy':_0x8cc5('0x5')};function emitEvent(_0x149eca){return function(_0x5b1c8f,_0x4d5535,_0x1a5183){_0x5b1c8f[_0x8cc5('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2ffee2){_0x5b1c8f['setDataValue'](_0x8cc5('0x7'),_0x2ffee2[_0x8cc5('0x8')](function(_0x12b646){return{'id':_0x12b646['id']};}));return ChatMessage[_0x8cc5('0x9')]({'where':{'ChatInteractionId':_0x5b1c8f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8cc5('0xa')](function(_0x106509){_0x5b1c8f[_0x8cc5('0xb')]('unreadMessages',_0x106509['length']);ChatInteractionEvents[_0x8cc5('0xc')](_0x149eca+':'+_0x5b1c8f['id'],_0x5b1c8f);ChatInteractionEvents['emit'](_0x149eca,_0x5b1c8f);_0x1a5183(null);})['catch'](_0x1a5183(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x8cc5('0xd')](e,emitEvent(event));}}module[_0x8cc5('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0x5ac7=['length','catch','hasOwnProperty','hook','events','ChatInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages'];(function(_0x1292fa,_0x3d64a4){var _0x5e4457=function(_0x37e1df){while(--_0x37e1df){_0x1292fa['push'](_0x1292fa['shift']());}};_0x5e4457(++_0x3d64a4);}(_0x5ac7,0x1ea));var _0x75ac=function(_0x1152de,_0x19aeff){_0x1152de=_0x1152de-0x0;var _0x39c275=_0x5ac7[_0x1152de];return _0x39c275;};'use strict';var EventEmitter=require(_0x75ac('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x75ac('0x1')];var ChatMessage=require(_0x75ac('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x75ac('0x3')](0x0);var events={'afterCreate':_0x75ac('0x4'),'afterUpdate':_0x75ac('0x5'),'afterDestroy':_0x75ac('0x6')};function emitEvent(_0x1d0c0f){return function(_0x2e6dcb,_0xc3cc96,_0x58b132){_0x2e6dcb[_0x75ac('0x7')]({'attributes':['id'],'raw':!![]})[_0x75ac('0x8')](function(_0x347152){_0x2e6dcb['setDataValue'](_0x75ac('0x9'),_0x347152[_0x75ac('0xa')](function(_0x243867){return{'id':_0x243867['id']};}));return ChatMessage[_0x75ac('0xb')]({'where':{'ChatInteractionId':_0x2e6dcb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x75ac('0x8')](function(_0x513fe7){_0x2e6dcb[_0x75ac('0xc')](_0x75ac('0xd'),_0x513fe7[_0x75ac('0xe')]);ChatInteractionEvents['emit'](_0x1d0c0f+':'+_0x2e6dcb['id'],_0x2e6dcb);ChatInteractionEvents['emit'](_0x1d0c0f,_0x2e6dcb);_0x58b132(null);})[_0x75ac('0xf')](_0x58b132(null));};}for(var e in events){if(events[_0x75ac('0x10')](e)){var event=events[e];ChatInteraction[_0x75ac('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 923e1e5..abddc1b 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 _0x7287=['request-promise','path','exports','define','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','api','moment','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7287,0x1f4));var _0x7728=function(_0x259651,_0x335c2f){_0x259651=_0x259651-0x0;var _0x1d6dd1=_0x7287[_0x259651];return _0x1d6dd1;};'use strict';var _=require(_0x7728('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7728('0x1'));var moment=require(_0x7728('0x2'));var BPromise=require(_0x7728('0x3'));var rp=require(_0x7728('0x4'));var fs=require('fs');var path=require(_0x7728('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x7728('0x6')]=function(_0x577cac,_0x4316e3){return _0x577cac[_0x7728('0x7')](_0x7728('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30af56,_0x3105ae,_0x1466c5){if(_0x30af56[_0x7728('0x9')](_0x7728('0xa'))){_0x30af56[_0x7728('0xb')]=moment()['format'](_0x7728('0xc'));}_0x1466c5(null,_0x30af56);}},'charset':'utf8mb4','collate':_0x7728('0xd')});}; \ No newline at end of file +var _0x9265=['util','moment','bluebird','request-promise','path','rimraf','exports','ChatInteraction','chat_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9265,0x185));var _0x5926=function(_0x9a089f,_0x206a3e){_0x9a089f=_0x9a089f-0x0;var _0x2728eb=_0x9265[_0x9a089f];return _0x2728eb;};'use strict';var _=require(_0x5926('0x0'));var util=require(_0x5926('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5926('0x2'));var BPromise=require(_0x5926('0x3'));var rp=require(_0x5926('0x4'));var fs=require('fs');var path=require(_0x5926('0x5'));var rimraf=require(_0x5926('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x5926('0x7')]=function(_0xd8a85d,_0x424f40){return _0xd8a85d['define'](_0x5926('0x8'),attributes,{'tableName':_0x5926('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x18a4c0,_0x1a083b,_0x8ae35f){if(_0x18a4c0[_0x5926('0xa')]('closed')){_0x18a4c0['closedAt']=moment()[_0x5926('0xb')](_0x5926('0xc'));}_0x8ae35f(null,_0x18a4c0);}},'charset':_0x5926('0xd'),'collate':_0x5926('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index e81930a..2d025e1 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 _0x8556=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateChatInteraction','ChatInteraction','update','body','options','AddTagsToChatInteraction','find','where','ids','omit','AddTags','catch','lodash','moment','ioredis'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x8556,0x135));var _0x6855=function(_0x22d300,_0x23c213){_0x22d300=_0x22d300-0x0;var _0x4d2a92=_0x8556[_0x22d300];return _0x4d2a92;};'use strict';var _=require(_0x6855('0x0'));var util=require('util');var moment=require(_0x6855('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6855('0x2'));var db=require(_0x6855('0x3'))['db'];var utils=require(_0x6855('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6855('0x5'));var jayson=require(_0x6855('0x6'));var client=jayson[_0x6855('0x7')][_0x6855('0x8')]({'port':0x232a});config['redis']=_[_0x6855('0x9')](config[_0x6855('0xa')],{'host':_0x6855('0xb'),'port':0x18eb});var socket=require(_0x6855('0xc'))(new Redis(config[_0x6855('0xa')]));require(_0x6855('0xd'))[_0x6855('0xe')](socket);function respondWithRpcPromise(_0x7c6b9,_0x532782,_0x4e13df){return new BPromise(function(_0x2d775d,_0xe25f50){return client[_0x6855('0xf')](_0x7c6b9,_0x4e13df)[_0x6855('0x10')](function(_0x41d3dc){logger['info'](_0x6855('0x11'),_0x532782,_0x6855('0x12'));logger[_0x6855('0x13')](_0x6855('0x14'),_0x532782,'request\x20sent',JSON[_0x6855('0x15')](_0x41d3dc));if(_0x41d3dc[_0x6855('0x16')]){if(_0x41d3dc['error'][_0x6855('0x17')]===0x1f4){logger[_0x6855('0x16')](_0x6855('0x11'),_0x532782,_0x41d3dc[_0x6855('0x16')][_0x6855('0x18')]);return _0xe25f50(_0x41d3dc['error'][_0x6855('0x18')]);}logger[_0x6855('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x532782,_0x41d3dc['error']['message']);return _0x2d775d(_0x41d3dc[_0x6855('0x16')][_0x6855('0x18')]);}else{logger[_0x6855('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x532782,_0x6855('0x12'));_0x2d775d(_0x41d3dc[_0x6855('0x1a')]['message']);}})['catch'](function(_0x18d0b4){logger[_0x6855('0x16')](_0x6855('0x11'),_0x532782,_0x18d0b4);_0xe25f50(_0x18d0b4);});});}exports[_0x6855('0x1b')]=function(_0x2e9446){var _0x200431=this;return new Promise(function(_0x8a4570,_0xdf4ecb){return db[_0x6855('0x1c')][_0x6855('0x1d')](_0x2e9446[_0x6855('0x1e')],{'raw':_0x2e9446[_0x6855('0x1f')]?_0x2e9446['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e9446[_0x6855('0x1f')]?_0x2e9446[_0x6855('0x1f')]['where']||null:null,'attributes':_0x2e9446[_0x6855('0x1f')]?_0x2e9446['options']['attributes']||null:null,'limit':_0x2e9446[_0x6855('0x1f')]?_0x2e9446[_0x6855('0x1f')]['limit']||null:null})[_0x6855('0x10')](function(_0x35d36d){logger[_0x6855('0x19')](_0x6855('0x1b'),_0x2e9446);logger[_0x6855('0x13')](_0x6855('0x1b'),_0x2e9446,JSON[_0x6855('0x15')](_0x35d36d));_0x8a4570(_0x35d36d);})['catch'](function(_0x19b2b0){logger['error'](_0x6855('0x1b'),_0x19b2b0['message'],_0x2e9446);_0xdf4ecb(_0x200431['error'](0x1f4,_0x19b2b0[_0x6855('0x18')]));});});};exports[_0x6855('0x20')]=function(_0x1a1f09){return new Promise(function(_0x2b3a85,_0x5a6e4c){return db[_0x6855('0x1c')][_0x6855('0x21')]({'where':_0x1a1f09[_0x6855('0x1f')]?_0x1a1f09['options'][_0x6855('0x22')]||null:null})[_0x6855('0x10')](function(_0x54fe12){if(_0x54fe12){return _0x54fe12['addTags'](_0x1a1f09['body'][_0x6855('0x23')],_[_0x6855('0x24')](_0x1a1f09[_0x6855('0x1e')],[_0x6855('0x23'),'id'])||{});}})['spread'](function(_0x13ff82){logger['info'](_0x6855('0x25'),_0x1a1f09);logger[_0x6855('0x13')](_0x6855('0x25'),_0x1a1f09,JSON[_0x6855('0x15')](_0x13ff82));_0x2b3a85(_0x13ff82);})[_0x6855('0x26')](function(_0x411908){logger[_0x6855('0x16')](_0x6855('0x25'),_0x411908['message'],_0x1a1f09);_0x5a6e4c(_this[_0x6855('0x16')](0x1f4,_0x411908[_0x6855('0x18')]));});});}; \ No newline at end of file +var _0x65b6=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','ChatInteraction','update','options','raw','where','limit','UpdateChatInteraction','catch','find','addTags','ids','omit','spread','AddTags','lodash','util'];(function(_0x1f7839,_0x2a26e6){var _0x36b42e=function(_0x553222){while(--_0x553222){_0x1f7839['push'](_0x1f7839['shift']());}};_0x36b42e(++_0x2a26e6);}(_0x65b6,0x82));var _0x665b=function(_0x1a2635,_0x2a33a8){_0x1a2635=_0x1a2635-0x0;var _0x2ccd92=_0x65b6[_0x1a2635];return _0x2ccd92;};'use strict';var _=require(_0x665b('0x0'));var util=require(_0x665b('0x1'));var moment=require(_0x665b('0x2'));var BPromise=require('bluebird');var rs=require(_0x665b('0x3'));var fs=require('fs');var Redis=require(_0x665b('0x4'));var db=require(_0x665b('0x5'))['db'];var utils=require(_0x665b('0x6'));var logger=require(_0x665b('0x7'))(_0x665b('0x8'));var config=require(_0x665b('0x9'));var jayson=require(_0x665b('0xa'));var client=jayson['client'][_0x665b('0xb')]({'port':0x232a});config[_0x665b('0xc')]=_[_0x665b('0xd')](config[_0x665b('0xc')],{'host':_0x665b('0xe'),'port':0x18eb});var socket=require(_0x665b('0xf'))(new Redis(config[_0x665b('0xc')]));require(_0x665b('0x10'))[_0x665b('0x11')](socket);function respondWithRpcPromise(_0x56bc77,_0x51d2b4,_0x6cf369){return new BPromise(function(_0x2bab5c,_0xf9cd50){return client[_0x665b('0x12')](_0x56bc77,_0x6cf369)[_0x665b('0x13')](function(_0x4689bd){logger[_0x665b('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x51d2b4,_0x665b('0x15'));logger[_0x665b('0x16')](_0x665b('0x17'),_0x51d2b4,_0x665b('0x15'),JSON[_0x665b('0x18')](_0x4689bd));if(_0x4689bd[_0x665b('0x19')]){if(_0x4689bd['error'][_0x665b('0x1a')]===0x1f4){logger[_0x665b('0x19')](_0x665b('0x1b'),_0x51d2b4,_0x4689bd[_0x665b('0x19')][_0x665b('0x1c')]);return _0xf9cd50(_0x4689bd['error']['message']);}logger[_0x665b('0x19')](_0x665b('0x1b'),_0x51d2b4,_0x4689bd[_0x665b('0x19')]['message']);return _0x2bab5c(_0x4689bd[_0x665b('0x19')][_0x665b('0x1c')]);}else{logger[_0x665b('0x14')](_0x665b('0x1b'),_0x51d2b4,_0x665b('0x15'));_0x2bab5c(_0x4689bd[_0x665b('0x1d')]['message']);}})['catch'](function(_0x51cdec){logger[_0x665b('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x51d2b4,_0x51cdec);_0xf9cd50(_0x51cdec);});});}exports['UpdateChatInteraction']=function(_0x2b1f50){var _0x123d89=this;return new Promise(function(_0x14ff02,_0x435e27){return db[_0x665b('0x1e')][_0x665b('0x1f')](_0x2b1f50['body'],{'raw':_0x2b1f50[_0x665b('0x20')]?_0x2b1f50[_0x665b('0x20')][_0x665b('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b1f50[_0x665b('0x20')]?_0x2b1f50[_0x665b('0x20')][_0x665b('0x22')]||null:null,'attributes':_0x2b1f50[_0x665b('0x20')]?_0x2b1f50[_0x665b('0x20')]['attributes']||null:null,'limit':_0x2b1f50[_0x665b('0x20')]?_0x2b1f50[_0x665b('0x20')][_0x665b('0x23')]||null:null})[_0x665b('0x13')](function(_0x50708c){logger[_0x665b('0x14')](_0x665b('0x24'),_0x2b1f50);logger[_0x665b('0x16')](_0x665b('0x24'),_0x2b1f50,JSON[_0x665b('0x18')](_0x50708c));_0x14ff02(_0x50708c);})[_0x665b('0x25')](function(_0x32206c){logger['error'](_0x665b('0x24'),_0x32206c[_0x665b('0x1c')],_0x2b1f50);_0x435e27(_0x123d89['error'](0x1f4,_0x32206c[_0x665b('0x1c')]));});});};exports['AddTagsToChatInteraction']=function(_0x3433c9){return new Promise(function(_0xa5f9db,_0x49c5f9){return db[_0x665b('0x1e')][_0x665b('0x26')]({'where':_0x3433c9[_0x665b('0x20')]?_0x3433c9[_0x665b('0x20')][_0x665b('0x22')]||null:null})[_0x665b('0x13')](function(_0x2272c5){if(_0x2272c5){return _0x2272c5[_0x665b('0x27')](_0x3433c9['body'][_0x665b('0x28')],_[_0x665b('0x29')](_0x3433c9['body'],[_0x665b('0x28'),'id'])||{});}})[_0x665b('0x2a')](function(_0x429801){logger[_0x665b('0x14')](_0x665b('0x2b'),_0x3433c9);logger[_0x665b('0x16')]('AddTags',_0x3433c9,JSON[_0x665b('0x18')](_0x429801));_0xa5f9db(_0x429801);})[_0x665b('0x25')](function(_0x1092cb){logger[_0x665b('0x19')](_0x665b('0x2b'),_0x1092cb[_0x665b('0x1c')],_0x3433c9);_0x49c5f9(_this['error'](0x1f4,_0x1092cb[_0x665b('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index ec30a8d..a893acd 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 _0x3c51=['emit','save','remove','update'];(function(_0xe206ed,_0x179821){var _0x4423ab=function(_0x2668d2){while(--_0x2668d2){_0xe206ed['push'](_0xe206ed['shift']());}};_0x4423ab(++_0x179821);}(_0x3c51,0x1b9));var _0x13c5=function(_0x312730,_0x2e6f8c){_0x312730=_0x312730-0x0;var _0x58d938=_0x3c51[_0x312730];return _0x58d938;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x13c5('0x0'),_0x13c5('0x1'),_0x13c5('0x2')];function createListener(_0x1235f1,_0x565b90){return function(_0x3aaa75){_0x565b90[_0x13c5('0x3')](_0x1235f1,_0x3aaa75);};}function removeListener(_0x35a067,_0x51b4e1){return function(){ChatInteractionEvents['removeListener'](_0x35a067,_0x51b4e1);};}exports['register']=function(_0x16699e){for(var _0x1f930e=0x0,_0x5d1654=events['length'];_0x1f930e<_0x5d1654;_0x1f930e++){var _0x3087c9=events[_0x1f930e];var _0x2e6ee6=createListener('chatInteraction:'+_0x3087c9,_0x16699e);ChatInteractionEvents['on'](_0x3087c9,_0x2e6ee6);}}; \ No newline at end of file +var _0x52cb=['update','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x104662,_0x53a7a7){var _0x19cba7=function(_0x5a76c0){while(--_0x5a76c0){_0x104662['push'](_0x104662['shift']());}};_0x19cba7(++_0x53a7a7);}(_0x52cb,0x1a2));var _0xb52c=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0x52cb[_0x218972];return _0x1bb1a8;};'use strict';var ChatInteractionEvents=require(_0xb52c('0x0'));var events=[_0xb52c('0x1'),'remove',_0xb52c('0x2')];function createListener(_0x3f7146,_0xc000d){return function(_0x1cc265){_0xc000d['emit'](_0x3f7146,_0x1cc265);};}function removeListener(_0x2fe947,_0x35a92d){return function(){ChatInteractionEvents[_0xb52c('0x3')](_0x2fe947,_0x35a92d);};}exports[_0xb52c('0x4')]=function(_0x304783){for(var _0x30fd4f=0x0,_0x2fe837=events[_0xb52c('0x5')];_0x30fd4f<_0x2fe837;_0x30fd4f++){var _0x2cbdf1=events[_0x30fd4f];var _0x14591f=createListener(_0xb52c('0x6')+_0x2cbdf1,_0x304783);ChatInteractionEvents['on'](_0x2cbdf1,_0x14591f);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index c110ba6..9fd8dc0 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 _0x2d44=['./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','tracked','chat','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x369d15,_0x2d1bfe){var _0x3ce2e1=function(_0x4ae07f){while(--_0x4ae07f){_0x369d15['push'](_0x369d15['shift']());}};_0x3ce2e1(++_0x2d1bfe);}(_0x2d44,0x173));var _0x42d4=function(_0x33fa9b,_0x43d82c){_0x33fa9b=_0x33fa9b-0x0;var _0x3de2f1=_0x2d44[_0x33fa9b];return _0x3de2f1;};'use strict';var multer=require(_0x42d4('0x0'));var util=require(_0x42d4('0x1'));var path=require(_0x42d4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x42d4('0x3')]();var fs_extra=require(_0x42d4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x42d4('0x5'));var config=require(_0x42d4('0x6'));var controller=require(_0x42d4('0x7'));router[_0x42d4('0x8')]('/',auth[_0x42d4('0x9')](),controller[_0x42d4('0xa')]);router[_0x42d4('0x8')](_0x42d4('0xb'),auth[_0x42d4('0x9')](),controller[_0x42d4('0xc')]);router[_0x42d4('0x8')]('/:id',auth[_0x42d4('0xd')](),controller[_0x42d4('0xe')]);router[_0x42d4('0x8')](_0x42d4('0xf'),auth[_0x42d4('0xd')](),controller['attachmentDownload']);router[_0x42d4('0x8')](_0x42d4('0x10'),auth[_0x42d4('0x9')](),controller['getMessages']);router['get'](_0x42d4('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x42d4('0x12')]);router['get'](_0x42d4('0x13'),auth['isAuthenticated'](),controller[_0x42d4('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x42d4('0x15')]);router[_0x42d4('0x16')](_0x42d4('0x17'),auth[_0x42d4('0x9')](),controller[_0x42d4('0x18')]);var upload=multer({'storage':multer[_0x42d4('0x19')]({'destination':function(_0x16380a,_0x1314d8,_0x21c674){_0x21c674(null,path[_0x42d4('0x1a')](config[_0x42d4('0x1b')],_0x42d4('0x1c')));},'filename':function(_0x4c2278,_0x24fd7a,_0xfb8526){_0xfb8526(null,util[_0x42d4('0x1d')](_0x42d4('0x1e'),Date[_0x42d4('0x1f')](),_0x24fd7a[_0x42d4('0x20')][_0x42d4('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x42d4('0x16')](_0x42d4('0x22'),upload[_0x42d4('0x23')]('file'),controller[_0x42d4('0x24')]);router[_0x42d4('0x16')](_0x42d4('0x10'),auth[_0x42d4('0xd')](),controller[_0x42d4('0x25')]);router['post']('/:id/tags',auth[_0x42d4('0x9')](),interaction[_0x42d4('0x26')](_0x42d4('0x27'),'chatinteraction:addtags'),controller[_0x42d4('0x28')]);router[_0x42d4('0x29')](_0x42d4('0x2a'),auth[_0x42d4('0x9')](),interaction[_0x42d4('0x26')]('chat',_0x42d4('0x2b')),controller[_0x42d4('0x2c')]);router['put'](_0x42d4('0x2d'),controller['customUpdate']);router[_0x42d4('0x29')](_0x42d4('0x2e'),auth[_0x42d4('0xd')](),controller['abandon']);router[_0x42d4('0x29')](_0x42d4('0x2f'),controller[_0x42d4('0x30')]);router[_0x42d4('0x31')](_0x42d4('0x2a'),auth[_0x42d4('0x9')](),interaction[_0x42d4('0x26')](_0x42d4('0x27'),_0x42d4('0x32')),controller[_0x42d4('0x33')]);router[_0x42d4('0x31')]('/:id/tags',auth[_0x42d4('0x9')](),controller[_0x42d4('0x34')]);module[_0x42d4('0x35')]=router; \ No newline at end of file +var _0xde1d=['/:id/attachment_download','/:id/messages','getMyMessages','download','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','chat','addTags','/:id','tracked','chatinteraction:update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','isChatInteractionAuthorized','show'];(function(_0x40e13e,_0x376d13){var _0x5db39e=function(_0x2dc3f6){while(--_0x2dc3f6){_0x40e13e['push'](_0x40e13e['shift']());}};_0x5db39e(++_0x376d13);}(_0xde1d,0x1ef));var _0xdde1=function(_0x133f81,_0x550e62){_0x133f81=_0x133f81-0x0;var _0x2eef30=_0xde1d[_0x133f81];return _0x2eef30;};'use strict';var multer=require(_0xdde1('0x0'));var util=require(_0xdde1('0x1'));var path=require(_0xdde1('0x2'));var timeout=require(_0xdde1('0x3'));var express=require('express');var router=express[_0xdde1('0x4')]();var fs_extra=require(_0xdde1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdde1('0x6'));var config=require(_0xdde1('0x7'));var controller=require(_0xdde1('0x8'));router['get']('/',auth[_0xdde1('0x9')](),controller[_0xdde1('0xa')]);router[_0xdde1('0xb')](_0xdde1('0xc'),auth[_0xdde1('0x9')](),controller['describe']);router[_0xdde1('0xb')]('/:id',auth[_0xdde1('0xd')](),controller[_0xdde1('0xe')]);router[_0xdde1('0xb')](_0xdde1('0xf'),auth[_0xdde1('0xd')](),controller['attachmentDownload']);router[_0xdde1('0xb')](_0xdde1('0x10'),auth[_0xdde1('0x9')](),controller['getMessages']);router[_0xdde1('0xb')]('/:id/my_messages',auth[_0xdde1('0xd')](),controller[_0xdde1('0x11')]);router[_0xdde1('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0xdde1('0x12')]);router[_0xdde1('0x13')]('/',auth[_0xdde1('0x9')](),controller[_0xdde1('0x14')]);router[_0xdde1('0x13')](_0xdde1('0x15'),auth[_0xdde1('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xdde1('0x16')]({'destination':function(_0x4bcb99,_0x26cc19,_0x1268bb){_0x1268bb(null,path[_0xdde1('0x17')](config[_0xdde1('0x18')],_0xdde1('0x19')));},'filename':function(_0x41ecf5,_0x2b077d,_0x15c8fd){_0x15c8fd(null,util[_0xdde1('0x1a')]('%s-%s',Date[_0xdde1('0x1b')](),_0x2b077d[_0xdde1('0x1c')][_0xdde1('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdde1('0x13')]('/:id/attachment_upload',upload[_0xdde1('0x1e')](_0xdde1('0x1f')),controller[_0xdde1('0x20')]);router['post'](_0xdde1('0x10'),auth[_0xdde1('0xd')](),controller[_0xdde1('0x21')]);router['post'](_0xdde1('0x22'),auth[_0xdde1('0x9')](),interaction['tracked'](_0xdde1('0x23'),'chatinteraction:addtags'),controller[_0xdde1('0x24')]);router['put'](_0xdde1('0x25'),auth[_0xdde1('0x9')](),interaction[_0xdde1('0x26')](_0xdde1('0x23'),_0xdde1('0x27')),controller['update']);router[_0xdde1('0x28')](_0xdde1('0x29'),controller[_0xdde1('0x2a')]);router[_0xdde1('0x28')](_0xdde1('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0xdde1('0x2c')]);router[_0xdde1('0x28')](_0xdde1('0x2d'),controller['close']);router[_0xdde1('0x2e')](_0xdde1('0x25'),auth[_0xdde1('0x9')](),interaction[_0xdde1('0x26')](_0xdde1('0x23'),_0xdde1('0x2f')),controller[_0xdde1('0x30')]);router[_0xdde1('0x2e')]('/:id/tags',auth[_0xdde1('0x9')](),controller[_0xdde1('0x31')]);module[_0xdde1('0x32')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 21a122c..1d11a91 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 _0xeb83=['exports','TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x28c5d1,_0x2688b9){var _0x19309f=function(_0x393348){while(--_0x393348){_0x28c5d1['push'](_0x28c5d1['shift']());}};_0x19309f(++_0x2688b9);}(_0xeb83,0x65));var _0x3eb8=function(_0x43fffe,_0x496436){_0x43fffe=_0x43fffe-0x0;var _0x2b8da4=_0xeb83[_0x43fffe];return _0x2b8da4;};'use strict';var Sequelize=require(_0x3eb8('0x0'));module[_0x3eb8('0x1')]={'body':{'type':Sequelize[_0x3eb8('0x2')](_0x3eb8('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3eb8('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3eb8('0x5')]}}; \ No newline at end of file +var _0x5fd7=['medium','BOOLEAN','INTEGER','exports','TEXT'];(function(_0x2d7c86,_0x1d450c){var _0x4cb66b=function(_0x2366eb){while(--_0x2366eb){_0x2d7c86['push'](_0x2d7c86['shift']());}};_0x4cb66b(++_0x1d450c);}(_0x5fd7,0xbc));var _0x75fd=function(_0x3167a2,_0x4f7866){_0x3167a2=_0x3167a2-0x0;var _0x4ce01c=_0x5fd7[_0x3167a2];return _0x4ce01c;};'use strict';var Sequelize=require('sequelize');module[_0x75fd('0x0')]={'body':{'type':Sequelize[_0x75fd('0x1')](_0x75fd('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x75fd('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x75fd('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 2c1cce3..fbff616 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 _0x7434=['map','ChatInternalMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','get','messages','lastMessage','lastMessageAt','getUsers','User','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','all','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','sendStatus','error','name','send'];(function(_0x25945f,_0x4201c2){var _0x36cc3e=function(_0x45186b){while(--_0x45186b){_0x25945f['push'](_0x25945f['shift']());}};_0x36cc3e(++_0x4201c2);}(_0x7434,0x1ef));var _0x4743=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7434[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4743('0x0'));var zipdir=require(_0x4743('0x1'));var jsonpatch=require(_0x4743('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4743('0x3'));var util=require(_0x4743('0x4'));var path=require(_0x4743('0x5'));var sox=require(_0x4743('0x6'));var csv=require(_0x4743('0x7'));var ejs=require(_0x4743('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4743('0x9'));var squel=require(_0x4743('0xa'));var crypto=require(_0x4743('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4743('0x7'));var querystring=require('querystring');var Papa=require(_0x4743('0xc'));var Redis=require(_0x4743('0xd'));var authService=require(_0x4743('0xe'));var qs=require(_0x4743('0xf'));var as=require(_0x4743('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4743('0x11'))(_0x4743('0x12'));var utils=require('../../config/utils');var config=require(_0x4743('0x13'));var licenseUtil=require(_0x4743('0x14'));var db=require(_0x4743('0x15'))['db'];config[_0x4743('0x16')]=_[_0x4743('0x17')](config['redis'],{'host':_0x4743('0x18'),'port':0x18eb});var socket=require(_0x4743('0x19'))(new Redis(config['redis']));require(_0x4743('0x1a'))[_0x4743('0x1b')](socket);function respondWithStatusCode(_0x1adb37,_0x42bdd6){_0x42bdd6=_0x42bdd6||0xcc;return function(_0x5779f){if(_0x5779f){return _0x1adb37['sendStatus'](_0x42bdd6);}return _0x1adb37[_0x4743('0x1c')](_0x42bdd6)[_0x4743('0x1d')]();};}function respondWithResult(_0x3e16d3,_0x14406f){_0x14406f=_0x14406f||0xc8;return function(_0x1340b0){if(_0x1340b0){return _0x3e16d3[_0x4743('0x1c')](_0x14406f)[_0x4743('0x1e')](_0x1340b0);}};}function respondWithFilteredResult(_0x538a1b,_0x1493ea){return function(_0x4806ef){if(_0x4806ef){var _0x4c88b4=typeof _0x1493ea[_0x4743('0x1f')]==='undefined'&&typeof _0x1493ea[_0x4743('0x20')]===_0x4743('0x21');var _0x11a507=_0x4806ef[_0x4743('0x22')];var _0x543839=_0x4c88b4?0x0:_0x1493ea[_0x4743('0x1f')];var _0x1f972f=_0x4c88b4?_0x4806ef['count']:_0x1493ea[_0x4743('0x1f')]+_0x1493ea['limit'];var _0x2f7bb6;if(_0x1f972f>=_0x11a507){_0x1f972f=_0x11a507;_0x2f7bb6=0xc8;}else{_0x2f7bb6=0xce;}_0x538a1b['status'](_0x2f7bb6);return _0x538a1b[_0x4743('0x23')](_0x4743('0x24'),_0x543839+'-'+_0x1f972f+'/'+_0x11a507)[_0x4743('0x1e')](_0x4806ef);}return null;};}function patchUpdates(_0x494680){return function(_0x2de525){try{jsonpatch['apply'](_0x2de525,_0x494680,!![]);}catch(_0x1438ad){return BPromise['reject'](_0x1438ad);}return _0x2de525[_0x4743('0x25')]();};}function saveUpdates(_0x1da64e,_0x5aa22e){return function(_0x249ace){if(_0x249ace){return _0x249ace[_0x4743('0x26')](_0x1da64e)[_0x4743('0x27')](function(_0x21adfb){return _0x21adfb;});}return null;};}function removeEntity(_0x464bfb,_0x21b11f){return function(_0x3d6785){if(_0x3d6785){return _0x3d6785[_0x4743('0x28')]()[_0x4743('0x27')](function(){_0x464bfb['status'](0xcc)[_0x4743('0x1d')]();});}};}function handleEntityNotFound(_0x2a8f35,_0x32d8a5){return function(_0x5b714e){if(!_0x5b714e){_0x2a8f35[_0x4743('0x29')](0x194);}return _0x5b714e;};}function handleError(_0x216415,_0xb408df){_0xb408df=_0xb408df||0x1f4;return function(_0x2d3ead){logger[_0x4743('0x2a')](_0x2d3ead['stack']);if(_0x2d3ead[_0x4743('0x2b')]){delete _0x2d3ead[_0x4743('0x2b')];}_0x216415['status'](_0xb408df)[_0x4743('0x2c')](_0x2d3ead);};}exports['index']=function(_0x136766,_0x5605d4){var _0x5694e0={},_0x3454a2={},_0x487c39={'count':0x0,'rows':[]};var _0x101775=_[_0x4743('0x2d')](db[_0x4743('0x2e')][_0x4743('0x2f')],function(_0x62ce88){return{'name':_0x62ce88['fieldName'],'type':_0x62ce88[_0x4743('0x30')][_0x4743('0x31')]};});_0x3454a2[_0x4743('0x32')]=_['map'](_0x101775,_0x4743('0x2b'));_0x3454a2[_0x4743('0x33')]=_[_0x4743('0x34')](_0x136766['query']);_0x3454a2[_0x4743('0x35')]=_[_0x4743('0x36')](_0x3454a2[_0x4743('0x32')],_0x3454a2[_0x4743('0x33')]);_0x5694e0['attributes']=_[_0x4743('0x36')](_0x3454a2['model'],qs[_0x4743('0x37')](_0x136766[_0x4743('0x33')][_0x4743('0x37')]));_0x5694e0[_0x4743('0x38')]=_0x5694e0[_0x4743('0x38')][_0x4743('0x39')]?_0x5694e0[_0x4743('0x38')]:_0x3454a2[_0x4743('0x32')];if(!_0x136766[_0x4743('0x33')][_0x4743('0x3a')]('nolimit')){_0x5694e0[_0x4743('0x20')]=qs['limit'](_0x136766[_0x4743('0x33')]['limit']);_0x5694e0[_0x4743('0x1f')]=qs[_0x4743('0x1f')](_0x136766[_0x4743('0x33')][_0x4743('0x1f')]);}_0x5694e0[_0x4743('0x3b')]=qs[_0x4743('0x3c')](_0x136766[_0x4743('0x33')][_0x4743('0x3c')]);_0x5694e0[_0x4743('0x3d')]=qs[_0x4743('0x35')](_[_0x4743('0x3e')](_0x136766[_0x4743('0x33')],_0x3454a2[_0x4743('0x35')]),_0x101775);if(_0x136766['query'][_0x4743('0x3f')]){_0x5694e0[_0x4743('0x3d')]=_['merge'](_0x5694e0[_0x4743('0x3d')],{'$or':_[_0x4743('0x2d')](_0x101775,function(_0x19626f){if(_0x19626f[_0x4743('0x30')]!=='VIRTUAL'){var _0x485d54={};_0x485d54[_0x19626f[_0x4743('0x2b')]]={'$like':'%'+_0x136766[_0x4743('0x33')][_0x4743('0x3f')]+'%'};return _0x485d54;}})});}_0x5694e0=_[_0x4743('0x40')]({},_0x5694e0,_0x136766[_0x4743('0x41')]);var _0x54e90b={'where':_0x5694e0[_0x4743('0x3d')]};return db[_0x4743('0x2e')][_0x4743('0x22')](_0x54e90b)[_0x4743('0x27')](function(_0x572595){_0x487c39[_0x4743('0x22')]=_0x572595;if(_0x136766[_0x4743('0x33')][_0x4743('0x42')]){_0x5694e0['include']=[{'all':!![]}];}return db[_0x4743('0x2e')][_0x4743('0x43')](_0x5694e0);})['then'](function(_0x42a8d3){_0x487c39[_0x4743('0x44')]=_0x42a8d3;return _0x487c39;})[_0x4743('0x27')](respondWithFilteredResult(_0x5605d4,_0x5694e0))[_0x4743('0x45')](handleError(_0x5605d4,null));};exports[_0x4743('0x46')]=function(_0x3db79d,_0x14bc58){var _0x180483={'raw':!![],'where':{'id':_0x3db79d[_0x4743('0x47')]['id']}},_0x44cc26={};_0x44cc26['model']=_['keys'](db['ChatInternalMessage'][_0x4743('0x2f')]);_0x44cc26[_0x4743('0x33')]=_[_0x4743('0x34')](_0x3db79d[_0x4743('0x33')]);_0x44cc26['filters']=_[_0x4743('0x36')](_0x44cc26['model'],_0x44cc26[_0x4743('0x33')]);_0x180483[_0x4743('0x38')]=_[_0x4743('0x36')](_0x44cc26['model'],qs['fields'](_0x3db79d[_0x4743('0x33')][_0x4743('0x37')]));_0x180483[_0x4743('0x38')]=_0x180483[_0x4743('0x38')][_0x4743('0x39')]?_0x180483[_0x4743('0x38')]:_0x44cc26[_0x4743('0x32')];if(_0x3db79d['query'][_0x4743('0x42')]){_0x180483[_0x4743('0x48')]=[{'all':!![]}];}_0x180483=_[_0x4743('0x40')]({},_0x180483,_0x3db79d[_0x4743('0x41')]);return db[_0x4743('0x2e')][_0x4743('0x49')](_0x180483)[_0x4743('0x27')](handleEntityNotFound(_0x14bc58,null))[_0x4743('0x27')](respondWithResult(_0x14bc58,null))['catch'](handleError(_0x14bc58,null));};exports[_0x4743('0x4a')]=function(_0x4d71c3,_0x39c380){return db[_0x4743('0x2e')][_0x4743('0x4a')](_0x4d71c3[_0x4743('0x4b')],{})['then'](respondWithResult(_0x39c380,0xc9))[_0x4743('0x45')](handleError(_0x39c380,null));};exports[_0x4743('0x26')]=function(_0x54ff12,_0x120226){if(_0x54ff12[_0x4743('0x4b')]['id']){delete _0x54ff12['body']['id'];}return db[_0x4743('0x2e')][_0x4743('0x49')]({'where':{'id':_0x54ff12[_0x4743('0x47')]['id']}})[_0x4743('0x27')](handleEntityNotFound(_0x120226,null))['then'](saveUpdates(_0x54ff12[_0x4743('0x4b')],null))['then'](respondWithResult(_0x120226,null))[_0x4743('0x45')](handleError(_0x120226,null));};exports[_0x4743('0x28')]=function(_0x1eaf8c,_0x368352){return db[_0x4743('0x2e')][_0x4743('0x49')]({'where':{'id':_0x1eaf8c['params']['id']}})[_0x4743('0x27')](handleEntityNotFound(_0x368352,null))['then'](removeEntity(_0x368352,null))[_0x4743('0x45')](handleError(_0x368352,null));};exports[_0x4743('0x4c')]=function(_0x42d2ba,_0x15b533){return db['ChatInternalMessage'][_0x4743('0x4c')]()[_0x4743('0x27')](respondWithResult(_0x15b533,null))['catch'](handleError(_0x15b533,null));};function wrapUser(_0x4116b9){return function(_0x2f29ef){var _0x3bf12e=_0x4116b9[_0x4743('0x4d')]({'plain':!![]});_0x3bf12e[_0x4743('0x4e')]=[];if(_0x2f29ef){_0x3bf12e['lastMessageAt']=_0x2f29ef['createdAt'];_0x3bf12e[_0x4743('0x4f')]=_0x2f29ef;}else{_0x3bf12e[_0x4743('0x50')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3bf12e[_0x4743('0x4f')]={};}return _0x3bf12e;};}exports[_0x4743('0x51')]=function(_0x23349d,_0x5bc105,_0x545ec7){var _0x5c05be=[];return db[_0x4743('0x52')]['findAll']({'where':{'role':[_0x4743('0x53'),_0x4743('0x54'),_0x4743('0x55')]},'attributes':['id',_0x4743('0x56'),_0x4743('0x2b'),_0x4743('0x57'),_0x4743('0x58'),_0x4743('0x59'),'online',_0x4743('0x5a'),_0x4743('0x5b'),_0x4743('0x5c')],'order':qs[_0x4743('0x3c')](_0x4743('0x5d')),'include':[{'model':db[_0x4743('0x5e')],'as':_0x4743('0x5f'),'attributes':['id',_0x4743('0x2b'),_0x4743('0x30')],'through':{'attributes':[]}}]})[_0x4743('0x27')](function(_0x29a940){if(_0x29a940){var _0x3723d0=_0x23349d[_0x4743('0x55')][_0x4743('0x4d')]({'plain':!![]});if(!_0x3723d0)throw new Error(_0x4743('0x60'));if(_0x3723d0[_0x4743('0x57')]==='user'){return db[_0x4743('0x61')][_0x4743('0x49')]({'where':{'name':_0x4743('0x62'),'userProfileId':_0x3723d0[_0x4743('0x63')]},'raw':!![]})[_0x4743('0x27')](function(_0x48b6f0){if(_0x48b6f0){if(_0x48b6f0[_0x4743('0x64')]===0x0){return db[_0x4743('0x65')]['findAll']({'where':{'sectionId':_0x48b6f0['id']},'raw':!![]})['then'](function(_0xc2b39e){var _0x2df2ea=[];if(_[_0x4743('0x66')](_0xc2b39e)){_0x2df2ea=_[_0x4743('0x3f')](_0x29a940,function(_0x3794fa){if(_0x3794fa[_0x4743('0x57')]!==_0x4743('0x53')){return _0x3794fa;}});return _0x2df2ea;}else{for(var _0x218547=0x0;_0x218547<_0x29a940[_0x4743('0x39')];_0x218547++){var _0x1bd467=_0x29a940[_0x218547];if(_0x1bd467[_0x4743('0x57')]==='agent'){var _0x2b7a5a=_[_0x4743('0x49')](_0xc2b39e,function(_0x35f151){return _0x35f151[_0x4743('0x67')]===_0x1bd467['id'];});if(_0x2b7a5a)_0x2df2ea[_0x4743('0x68')](_0x1bd467);}else{_0x2df2ea['push'](_0x1bd467);}}return _0x2df2ea;}});}else{return _0x29a940;}}else{var _0x43963b=_['filter'](_0x29a940,function(_0x350e5c){if(_0x350e5c['role']!=='agent'){return _0x350e5c;}});return _0x43963b;}});}else{return _0x29a940;}}})[_0x4743('0x27')](function(_0x19ce5d){var _0x5173cd=[];if(_0x19ce5d){_0x5c05be=_0x19ce5d;for(var _0x107577=0x0;_0x107577<_0x19ce5d['length'];_0x107577+=0x1){_0x5c05be[_0x107577][_0x4743('0x4e')]=[];_0x5173cd[_0x4743('0x68')](db[_0x4743('0x2e')]['find']({'where':{'FromId':[_0x23349d[_0x4743('0x55')]['id'],_0x19ce5d[_0x107577]['id']],'ToId':[_0x23349d[_0x4743('0x55')]['id'],_0x19ce5d[_0x107577]['id']],'ChatGroupId':null},'attributes':['id',_0x4743('0x69'),_0x4743('0x6a'),'ToId','read','body'],'order':qs[_0x4743('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x4743('0x27')](wrapUser(_0x19ce5d[_0x107577])));}return BPromise[_0x4743('0x6b')](_0x5173cd);}return[];})[_0x4743('0x27')](function(_0x15c148){return{'rows':_0x15c148,'count':_0x15c148['length']};})[_0x4743('0x27')](respondWithResult(_0x5bc105,null))[_0x4743('0x45')](handleError(_0x5bc105,null));}; \ No newline at end of file +var _0x37cc=['query','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','findAll','rows','catch','keys','length','includeAll','include','find','create','body','describe','get','messages','createdAt','lastMessage','format','getUsers','agent','admin','user','fullname','role','internal','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','update','destroy','then','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key'];(function(_0x5bbb1e,_0x353c6a){var _0x1a4081=function(_0x206d2d){while(--_0x206d2d){_0x5bbb1e['push'](_0x5bbb1e['shift']());}};_0x1a4081(++_0x353c6a);}(_0x37cc,0x1df));var _0xc37c=function(_0x30780e,_0x537b34){_0x30780e=_0x30780e-0x0;var _0x5b9129=_0x37cc[_0x30780e];return _0x5b9129;};'use strict';var emlformat=require(_0xc37c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc37c('0x1'));var jsonpatch=require(_0xc37c('0x2'));var rp=require(_0xc37c('0x3'));var moment=require(_0xc37c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc37c('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc37c('0x6'));var csv=require(_0xc37c('0x7'));var ejs=require(_0xc37c('0x8'));var fs=require('fs');var fs_extra=require(_0xc37c('0x9'));var _=require(_0xc37c('0xa'));var squel=require(_0xc37c('0xb'));var crypto=require(_0xc37c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc37c('0x7'));var querystring=require(_0xc37c('0xd'));var Papa=require('papaparse');var Redis=require(_0xc37c('0xe'));var authService=require(_0xc37c('0xf'));var qs=require(_0xc37c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc37c('0x11'));var logger=require(_0xc37c('0x12'))(_0xc37c('0x13'));var utils=require('../../config/utils');var config=require(_0xc37c('0x14'));var licenseUtil=require(_0xc37c('0x15'));var db=require(_0xc37c('0x16'))['db'];config[_0xc37c('0x17')]=_[_0xc37c('0x18')](config['redis'],{'host':_0xc37c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc37c('0x17')]));require(_0xc37c('0x1a'))[_0xc37c('0x1b')](socket);function respondWithStatusCode(_0x4faf1d,_0x3ab678){_0x3ab678=_0x3ab678||0xcc;return function(_0x455139){if(_0x455139){return _0x4faf1d[_0xc37c('0x1c')](_0x3ab678);}return _0x4faf1d[_0xc37c('0x1d')](_0x3ab678)[_0xc37c('0x1e')]();};}function respondWithResult(_0x24756a,_0x587823){_0x587823=_0x587823||0xc8;return function(_0x72fb78){if(_0x72fb78){return _0x24756a[_0xc37c('0x1d')](_0x587823)['json'](_0x72fb78);}};}function respondWithFilteredResult(_0x18b0eb,_0x5d472d){return function(_0x532e54){if(_0x532e54){var _0x1b15b7=typeof _0x5d472d['offset']===_0xc37c('0x1f')&&typeof _0x5d472d[_0xc37c('0x20')]===_0xc37c('0x1f');var _0x3a6490=_0x532e54['count'];var _0x56c569=_0x1b15b7?0x0:_0x5d472d[_0xc37c('0x21')];var _0x5a0b7d=_0x1b15b7?_0x532e54['count']:_0x5d472d[_0xc37c('0x21')]+_0x5d472d[_0xc37c('0x20')];var _0x25afb3;if(_0x5a0b7d>=_0x3a6490){_0x5a0b7d=_0x3a6490;_0x25afb3=0xc8;}else{_0x25afb3=0xce;}_0x18b0eb[_0xc37c('0x1d')](_0x25afb3);return _0x18b0eb[_0xc37c('0x22')](_0xc37c('0x23'),_0x56c569+'-'+_0x5a0b7d+'/'+_0x3a6490)[_0xc37c('0x24')](_0x532e54);}return null;};}function patchUpdates(_0x15c9b4){return function(_0x380dce){try{jsonpatch[_0xc37c('0x25')](_0x380dce,_0x15c9b4,!![]);}catch(_0xe17e3a){return BPromise[_0xc37c('0x26')](_0xe17e3a);}return _0x380dce['save']();};}function saveUpdates(_0x15199e,_0x11af63){return function(_0x38effc){if(_0x38effc){return _0x38effc[_0xc37c('0x27')](_0x15199e)['then'](function(_0x3ccf72){return _0x3ccf72;});}return null;};}function removeEntity(_0x4b3c01,_0x3e50ac){return function(_0x4c25e8){if(_0x4c25e8){return _0x4c25e8[_0xc37c('0x28')]()[_0xc37c('0x29')](function(){_0x4b3c01[_0xc37c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x65aa43,_0x4c72f6){return function(_0x3a1cd9){if(!_0x3a1cd9){_0x65aa43[_0xc37c('0x1c')](0x194);}return _0x3a1cd9;};}function handleError(_0x23aa42,_0x2ba026){_0x2ba026=_0x2ba026||0x1f4;return function(_0x38ba9b){logger['error'](_0x38ba9b['stack']);if(_0x38ba9b[_0xc37c('0x2a')]){delete _0x38ba9b[_0xc37c('0x2a')];}_0x23aa42[_0xc37c('0x1d')](_0x2ba026)[_0xc37c('0x2b')](_0x38ba9b);};}exports[_0xc37c('0x2c')]=function(_0x32c633,_0x1add69){var _0x595f7d={},_0x1d7111={},_0x2f2b6c={'count':0x0,'rows':[]};var _0x1f1efa=_[_0xc37c('0x2d')](db[_0xc37c('0x2e')][_0xc37c('0x2f')],function(_0x200aaf){return{'name':_0x200aaf[_0xc37c('0x30')],'type':_0x200aaf[_0xc37c('0x31')][_0xc37c('0x32')]};});_0x1d7111['model']=_[_0xc37c('0x2d')](_0x1f1efa,'name');_0x1d7111[_0xc37c('0x33')]=_['keys'](_0x32c633[_0xc37c('0x33')]);_0x1d7111['filters']=_['intersection'](_0x1d7111[_0xc37c('0x34')],_0x1d7111[_0xc37c('0x33')]);_0x595f7d[_0xc37c('0x35')]=_[_0xc37c('0x36')](_0x1d7111['model'],qs[_0xc37c('0x37')](_0x32c633[_0xc37c('0x33')][_0xc37c('0x37')]));_0x595f7d[_0xc37c('0x35')]=_0x595f7d[_0xc37c('0x35')]['length']?_0x595f7d[_0xc37c('0x35')]:_0x1d7111['model'];if(!_0x32c633[_0xc37c('0x33')][_0xc37c('0x38')](_0xc37c('0x39'))){_0x595f7d['limit']=qs[_0xc37c('0x20')](_0x32c633[_0xc37c('0x33')][_0xc37c('0x20')]);_0x595f7d['offset']=qs[_0xc37c('0x21')](_0x32c633[_0xc37c('0x33')][_0xc37c('0x21')]);}_0x595f7d['order']=qs[_0xc37c('0x3a')](_0x32c633[_0xc37c('0x33')][_0xc37c('0x3a')]);_0x595f7d['where']=qs[_0xc37c('0x3b')](_[_0xc37c('0x3c')](_0x32c633[_0xc37c('0x33')],_0x1d7111[_0xc37c('0x3b')]),_0x1f1efa);if(_0x32c633[_0xc37c('0x33')][_0xc37c('0x3d')]){_0x595f7d[_0xc37c('0x3e')]=_[_0xc37c('0x3f')](_0x595f7d[_0xc37c('0x3e')],{'$or':_[_0xc37c('0x2d')](_0x1f1efa,function(_0x24d2eb){if(_0x24d2eb[_0xc37c('0x31')]!==_0xc37c('0x40')){var _0x433c71={};_0x433c71[_0x24d2eb['name']]={'$like':'%'+_0x32c633[_0xc37c('0x33')][_0xc37c('0x3d')]+'%'};return _0x433c71;}})});}_0x595f7d=_[_0xc37c('0x3f')]({},_0x595f7d,_0x32c633[_0xc37c('0x41')]);var _0x366c81={'where':_0x595f7d[_0xc37c('0x3e')]};return db[_0xc37c('0x2e')][_0xc37c('0x42')](_0x366c81)[_0xc37c('0x29')](function(_0x3b302a){_0x2f2b6c[_0xc37c('0x42')]=_0x3b302a;if(_0x32c633[_0xc37c('0x33')]['includeAll']){_0x595f7d['include']=[{'all':!![]}];}return db[_0xc37c('0x2e')][_0xc37c('0x43')](_0x595f7d);})[_0xc37c('0x29')](function(_0x1ea6fc){_0x2f2b6c[_0xc37c('0x44')]=_0x1ea6fc;return _0x2f2b6c;})[_0xc37c('0x29')](respondWithFilteredResult(_0x1add69,_0x595f7d))[_0xc37c('0x45')](handleError(_0x1add69,null));};exports['show']=function(_0x4212d5,_0x1ecc17){var _0x27856a={'raw':!![],'where':{'id':_0x4212d5['params']['id']}},_0x5f50ee={};_0x5f50ee[_0xc37c('0x34')]=_[_0xc37c('0x46')](db[_0xc37c('0x2e')]['rawAttributes']);_0x5f50ee[_0xc37c('0x33')]=_[_0xc37c('0x46')](_0x4212d5['query']);_0x5f50ee[_0xc37c('0x3b')]=_[_0xc37c('0x36')](_0x5f50ee[_0xc37c('0x34')],_0x5f50ee[_0xc37c('0x33')]);_0x27856a['attributes']=_[_0xc37c('0x36')](_0x5f50ee[_0xc37c('0x34')],qs[_0xc37c('0x37')](_0x4212d5[_0xc37c('0x33')][_0xc37c('0x37')]));_0x27856a[_0xc37c('0x35')]=_0x27856a[_0xc37c('0x35')][_0xc37c('0x47')]?_0x27856a[_0xc37c('0x35')]:_0x5f50ee[_0xc37c('0x34')];if(_0x4212d5[_0xc37c('0x33')][_0xc37c('0x48')]){_0x27856a[_0xc37c('0x49')]=[{'all':!![]}];}_0x27856a=_[_0xc37c('0x3f')]({},_0x27856a,_0x4212d5[_0xc37c('0x41')]);return db[_0xc37c('0x2e')][_0xc37c('0x4a')](_0x27856a)['then'](handleEntityNotFound(_0x1ecc17,null))['then'](respondWithResult(_0x1ecc17,null))['catch'](handleError(_0x1ecc17,null));};exports[_0xc37c('0x4b')]=function(_0xa6e31f,_0x38ab71){return db[_0xc37c('0x2e')][_0xc37c('0x4b')](_0xa6e31f[_0xc37c('0x4c')],{})['then'](respondWithResult(_0x38ab71,0xc9))[_0xc37c('0x45')](handleError(_0x38ab71,null));};exports['update']=function(_0x561171,_0x2a1f03){if(_0x561171[_0xc37c('0x4c')]['id']){delete _0x561171[_0xc37c('0x4c')]['id'];}return db[_0xc37c('0x2e')][_0xc37c('0x4a')]({'where':{'id':_0x561171['params']['id']}})['then'](handleEntityNotFound(_0x2a1f03,null))[_0xc37c('0x29')](saveUpdates(_0x561171['body'],null))['then'](respondWithResult(_0x2a1f03,null))[_0xc37c('0x45')](handleError(_0x2a1f03,null));};exports[_0xc37c('0x28')]=function(_0xb46c67,_0x437b0){return db[_0xc37c('0x2e')][_0xc37c('0x4a')]({'where':{'id':_0xb46c67['params']['id']}})[_0xc37c('0x29')](handleEntityNotFound(_0x437b0,null))[_0xc37c('0x29')](removeEntity(_0x437b0,null))[_0xc37c('0x45')](handleError(_0x437b0,null));};exports[_0xc37c('0x4d')]=function(_0x3e97b5,_0x35884a){return db[_0xc37c('0x2e')]['describe']()[_0xc37c('0x29')](respondWithResult(_0x35884a,null))[_0xc37c('0x45')](handleError(_0x35884a,null));};function wrapUser(_0x3e817f){return function(_0x4e1b3f){var _0x139f13=_0x3e817f[_0xc37c('0x4e')]({'plain':!![]});_0x139f13[_0xc37c('0x4f')]=[];if(_0x4e1b3f){_0x139f13['lastMessageAt']=_0x4e1b3f[_0xc37c('0x50')];_0x139f13[_0xc37c('0x51')]=_0x4e1b3f;}else{_0x139f13['lastMessageAt']=moment(0x0)[_0xc37c('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x139f13[_0xc37c('0x51')]={};}return _0x139f13;};}exports[_0xc37c('0x53')]=function(_0x1e0346,_0x4a434a,_0xe2eac5){var _0x24c167=[];return db['User'][_0xc37c('0x43')]({'where':{'role':[_0xc37c('0x54'),_0xc37c('0x55'),_0xc37c('0x56')]},'attributes':['id',_0xc37c('0x57'),_0xc37c('0x2a'),_0xc37c('0x58'),'userpic',_0xc37c('0x59'),'online','lastLoginAt','allowmessenger',_0xc37c('0x5a')],'order':qs[_0xc37c('0x3a')](_0xc37c('0x5b')),'include':[{'model':db[_0xc37c('0x5c')],'as':'VoiceQueues','attributes':['id',_0xc37c('0x2a'),_0xc37c('0x31')],'through':{'attributes':[]}}]})[_0xc37c('0x29')](function(_0x4a747c){if(_0x4a747c){var _0x2b8146=_0x1e0346[_0xc37c('0x56')][_0xc37c('0x4e')]({'plain':!![]});if(!_0x2b8146)throw new Error(_0xc37c('0x5d'));if(_0x2b8146[_0xc37c('0x58')]===_0xc37c('0x56')){return db[_0xc37c('0x5e')][_0xc37c('0x4a')]({'where':{'name':_0xc37c('0x5f'),'userProfileId':_0x2b8146[_0xc37c('0x60')]},'raw':!![]})[_0xc37c('0x29')](function(_0x2fc6f6){if(_0x2fc6f6){if(_0x2fc6f6[_0xc37c('0x61')]===0x0){return db[_0xc37c('0x62')][_0xc37c('0x43')]({'where':{'sectionId':_0x2fc6f6['id']},'raw':!![]})[_0xc37c('0x29')](function(_0x3d2267){var _0x1d455=[];if(_[_0xc37c('0x63')](_0x3d2267)){_0x1d455=_['filter'](_0x4a747c,function(_0x3c3c22){if(_0x3c3c22['role']!=='agent'){return _0x3c3c22;}});return _0x1d455;}else{for(var _0x7f96df=0x0;_0x7f96df<_0x4a747c[_0xc37c('0x47')];_0x7f96df++){var _0x7fecf1=_0x4a747c[_0x7f96df];if(_0x7fecf1[_0xc37c('0x58')]===_0xc37c('0x54')){var _0x26b90a=_[_0xc37c('0x4a')](_0x3d2267,function(_0xa02497){return _0xa02497[_0xc37c('0x64')]===_0x7fecf1['id'];});if(_0x26b90a)_0x1d455[_0xc37c('0x65')](_0x7fecf1);}else{_0x1d455[_0xc37c('0x65')](_0x7fecf1);}}return _0x1d455;}});}else{return _0x4a747c;}}else{var _0x1ff865=_[_0xc37c('0x3d')](_0x4a747c,function(_0x410f74){if(_0x410f74[_0xc37c('0x58')]!==_0xc37c('0x54')){return _0x410f74;}});return _0x1ff865;}});}else{return _0x4a747c;}}})[_0xc37c('0x29')](function(_0x2a6e72){var _0x49dab0=[];if(_0x2a6e72){_0x24c167=_0x2a6e72;for(var _0x4c7d7c=0x0;_0x4c7d7c<_0x2a6e72[_0xc37c('0x47')];_0x4c7d7c+=0x1){_0x24c167[_0x4c7d7c]['messages']=[];_0x49dab0['push'](db[_0xc37c('0x2e')][_0xc37c('0x4a')]({'where':{'FromId':[_0x1e0346[_0xc37c('0x56')]['id'],_0x2a6e72[_0x4c7d7c]['id']],'ToId':[_0x1e0346[_0xc37c('0x56')]['id'],_0x2a6e72[_0x4c7d7c]['id']],'ChatGroupId':null},'attributes':['id',_0xc37c('0x50'),_0xc37c('0x66'),'ToId',_0xc37c('0x67'),'body'],'order':qs[_0xc37c('0x3a')](_0xc37c('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc37c('0x29')](wrapUser(_0x2a6e72[_0x4c7d7c])));}return BPromise[_0xc37c('0x69')](_0x49dab0);}return[];})['then'](function(_0x1c22a2){return{'rows':_0x1c22a2,'count':_0x1c22a2[_0xc37c('0x47')]};})[_0xc37c('0x29')](respondWithResult(_0x4a434a,null))[_0xc37c('0x45')](handleError(_0x4a434a,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index e1c749a..7ebb85e 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 _0xf534=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hook','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf534,0x9f));var _0x4f53=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf534[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x4f53('0x0'));var ChatInternalMessage=require(_0x4f53('0x1'))['db'][_0x4f53('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4f53('0x3')](0x0);var events={'afterCreate':_0x4f53('0x4'),'afterUpdate':'update','afterDestroy':_0x4f53('0x5')};function emitEvent(_0x9d558c){return function(_0x585266,_0x15f7e5,_0x1fe87f){ChatInternalMessageEvents[_0x4f53('0x6')](_0x9d558c+':'+_0x585266['id'],_0x585266);ChatInternalMessageEvents[_0x4f53('0x6')](_0x9d558c,_0x585266);_0x1fe87f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x4f53('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x0751=['events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x41894c,_0x25f3af){var _0x1c56f5=function(_0x3f8e29){while(--_0x3f8e29){_0x41894c['push'](_0x41894c['shift']());}};_0x1c56f5(++_0x25f3af);}(_0x0751,0x1e0));var _0x1075=function(_0x253834,_0x5bc6de){_0x253834=_0x253834-0x0;var _0xbfcd9c=_0x0751[_0x253834];return _0xbfcd9c;};'use strict';var EventEmitter=require(_0x1075('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x1075('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1075('0x2')](0x0);var events={'afterCreate':_0x1075('0x3'),'afterUpdate':_0x1075('0x4'),'afterDestroy':_0x1075('0x5')};function emitEvent(_0x224c8e){return function(_0x381997,_0x1f21dd,_0x3f7b34){ChatInternalMessageEvents['emit'](_0x224c8e+':'+_0x381997['id'],_0x381997);ChatInternalMessageEvents[_0x1075('0x6')](_0x224c8e,_0x381997);_0x3f7b34(null);};}for(var e in events){if(events[_0x1075('0x7')](e)){var event=events[e];ChatInternalMessage[_0x1075('0x8')](e,emitEvent(event));}}module[_0x1075('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index cf45454..10a2b6f 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 _0x8bb8=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x35eb06,_0x2b5aa8){var _0x274128=function(_0x1d4115){while(--_0x1d4115){_0x35eb06['push'](_0x35eb06['shift']());}};_0x274128(++_0x2b5aa8);}(_0x8bb8,0xd2));var _0x88bb=function(_0x582633,_0x481492){_0x582633=_0x582633-0x0;var _0x3dc1c6=_0x8bb8[_0x582633];return _0x3dc1c6;};'use strict';var _=require(_0x88bb('0x0'));var util=require('util');var logger=require(_0x88bb('0x1'))('api');var moment=require(_0x88bb('0x2'));var BPromise=require(_0x88bb('0x3'));var rp=require(_0x88bb('0x4'));var fs=require('fs');var path=require(_0x88bb('0x5'));var rimraf=require(_0x88bb('0x6'));var config=require(_0x88bb('0x7'));var attributes=require(_0x88bb('0x8'));module[_0x88bb('0x9')]=function(_0x482b6b,_0x35bf3e){return _0x482b6b[_0x88bb('0xa')](_0x88bb('0xb'),attributes,{'tableName':_0x88bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x88bb('0xd'),'collate':_0x88bb('0xe')});}; \ No newline at end of file +var _0xf24e=['lodash','util','../../config/logger','bluebird','path','../../config/environment','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x25be56,_0x170c8c){var _0x469c77=function(_0x2548ef){while(--_0x2548ef){_0x25be56['push'](_0x25be56['shift']());}};_0x469c77(++_0x170c8c);}(_0xf24e,0x136));var _0xef24=function(_0x45c981,_0x2ad2d4){_0x45c981=_0x45c981-0x0;var _0x4f62c8=_0xf24e[_0x45c981];return _0x4f62c8;};'use strict';var _=require(_0xef24('0x0'));var util=require(_0xef24('0x1'));var logger=require(_0xef24('0x2'))('api');var moment=require('moment');var BPromise=require(_0xef24('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef24('0x4'));var rimraf=require('rimraf');var config=require(_0xef24('0x5'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x1234cd,_0x4bed6a){return _0x1234cd[_0xef24('0x6')]('ChatInternalMessage',attributes,{'tableName':_0xef24('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xef24('0x8'),'collate':_0xef24('0x9')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index b32239a..28c78c3 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 _0x9deb=['catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0x9deb,0x12d));var _0xb9de=function(_0x3cd32a,_0x4bcb35){_0x3cd32a=_0x3cd32a-0x0;var _0x27fd1c=_0x9deb[_0x3cd32a];return _0x27fd1c;};'use strict';var _=require('lodash');var util=require(_0xb9de('0x0'));var moment=require('moment');var BPromise=require(_0xb9de('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb9de('0x2'));var db=require(_0xb9de('0x3'))['db'];var utils=require(_0xb9de('0x4'));var logger=require(_0xb9de('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb9de('0x6'));var client=jayson[_0xb9de('0x7')][_0xb9de('0x8')]({'port':0x232a});config[_0xb9de('0x9')]=_[_0xb9de('0xa')](config[_0xb9de('0x9')],{'host':_0xb9de('0xb'),'port':0x18eb});var socket=require(_0xb9de('0xc'))(new Redis(config[_0xb9de('0x9')]));require('./chatInternalMessage.socket')[_0xb9de('0xd')](socket);function respondWithRpcPromise(_0x1f720c,_0x35105a,_0x1a23c7){return new BPromise(function(_0x26d98e,_0x3cab6e){return client[_0xb9de('0xe')](_0x1f720c,_0x1a23c7)[_0xb9de('0xf')](function(_0x27a7e1){logger[_0xb9de('0x10')](_0xb9de('0x11'),_0x35105a,_0xb9de('0x12'));logger[_0xb9de('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x35105a,_0xb9de('0x12'),JSON[_0xb9de('0x14')](_0x27a7e1));if(_0x27a7e1['error']){if(_0x27a7e1['error'][_0xb9de('0x15')]===0x1f4){logger['error'](_0xb9de('0x11'),_0x35105a,_0x27a7e1[_0xb9de('0x16')]['message']);return _0x3cab6e(_0x27a7e1['error'][_0xb9de('0x17')]);}logger[_0xb9de('0x16')](_0xb9de('0x11'),_0x35105a,_0x27a7e1[_0xb9de('0x16')][_0xb9de('0x17')]);return _0x26d98e(_0x27a7e1[_0xb9de('0x16')][_0xb9de('0x17')]);}else{logger[_0xb9de('0x10')](_0xb9de('0x11'),_0x35105a,_0xb9de('0x12'));_0x26d98e(_0x27a7e1['result'][_0xb9de('0x17')]);}})[_0xb9de('0x18')](function(_0x2c3d0f){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x35105a,_0x2c3d0f);_0x3cab6e(_0x2c3d0f);});});} \ No newline at end of file +var _0xc906=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x2b3fc6,_0x3fd7f1){var _0x13a5a5=function(_0x27dc9e){while(--_0x27dc9e){_0x2b3fc6['push'](_0x2b3fc6['shift']());}};_0x13a5a5(++_0x3fd7f1);}(_0xc906,0x1ad));var _0x6c90=function(_0x3a9c46,_0x4a7f3f){_0x3a9c46=_0x3a9c46-0x0;var _0x2aee82=_0xc906[_0x3a9c46];return _0x2aee82;};'use strict';var _=require(_0x6c90('0x0'));var util=require(_0x6c90('0x1'));var moment=require('moment');var BPromise=require(_0x6c90('0x2'));var rs=require(_0x6c90('0x3'));var fs=require('fs');var Redis=require(_0x6c90('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c90('0x5'));var logger=require(_0x6c90('0x6'))(_0x6c90('0x7'));var config=require(_0x6c90('0x8'));var jayson=require(_0x6c90('0x9'));var client=jayson[_0x6c90('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x6c90('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6c90('0xc'))(new Redis(config[_0x6c90('0xb')]));require(_0x6c90('0xd'))[_0x6c90('0xe')](socket);function respondWithRpcPromise(_0x417974,_0x43e2bd,_0x252b10){return new BPromise(function(_0x7c8215,_0x1eba4b){return client[_0x6c90('0xf')](_0x417974,_0x252b10)[_0x6c90('0x10')](function(_0x441c1d){logger[_0x6c90('0x11')](_0x6c90('0x12'),_0x43e2bd,'request\x20sent');logger['debug'](_0x6c90('0x13'),_0x43e2bd,_0x6c90('0x14'),JSON[_0x6c90('0x15')](_0x441c1d));if(_0x441c1d[_0x6c90('0x16')]){if(_0x441c1d[_0x6c90('0x16')][_0x6c90('0x17')]===0x1f4){logger[_0x6c90('0x16')](_0x6c90('0x12'),_0x43e2bd,_0x441c1d[_0x6c90('0x16')][_0x6c90('0x18')]);return _0x1eba4b(_0x441c1d['error'][_0x6c90('0x18')]);}logger[_0x6c90('0x16')](_0x6c90('0x12'),_0x43e2bd,_0x441c1d[_0x6c90('0x16')]['message']);return _0x7c8215(_0x441c1d[_0x6c90('0x16')][_0x6c90('0x18')]);}else{logger['info'](_0x6c90('0x12'),_0x43e2bd,_0x6c90('0x14'));_0x7c8215(_0x441c1d[_0x6c90('0x19')][_0x6c90('0x18')]);}})[_0x6c90('0x1a')](function(_0x3442ac){logger['error'](_0x6c90('0x12'),_0x43e2bd,_0x3442ac);_0x1eba4b(_0x3442ac);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 2356343..6af99d2 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 _0x47a8=['chatInternalMessage:','./chatInternalMessage.events','update','emit','removeListener','register'];(function(_0xf15be4,_0x2c2591){var _0x2b6849=function(_0x544282){while(--_0x544282){_0xf15be4['push'](_0xf15be4['shift']());}};_0x2b6849(++_0x2c2591);}(_0x47a8,0xeb));var _0x847a=function(_0x5f7bcf,_0x362a4d){_0x5f7bcf=_0x5f7bcf-0x0;var _0x3e663a=_0x47a8[_0x5f7bcf];return _0x3e663a;};'use strict';var ChatInternalMessageEvents=require(_0x847a('0x0'));var events=['save','remove',_0x847a('0x1')];function createListener(_0x2f93d2,_0x53f484){return function(_0x3ed070){_0x53f484[_0x847a('0x2')](_0x2f93d2,_0x3ed070);};}function removeListener(_0x484faf,_0x31f453){return function(){ChatInternalMessageEvents[_0x847a('0x3')](_0x484faf,_0x31f453);};}exports[_0x847a('0x4')]=function(_0x27a586){for(var _0x5c8c5f=0x0,_0x5bef20=events['length'];_0x5c8c5f<_0x5bef20;_0x5c8c5f++){var _0x4889ed=events[_0x5c8c5f];var _0x332db0=createListener(_0x847a('0x5')+_0x4889ed,_0x27a586);ChatInternalMessageEvents['on'](_0x4889ed,_0x332db0);}}; \ No newline at end of file +var _0x2fa4=['length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','register'];(function(_0x199cd0,_0x42f22d){var _0xa2fe98=function(_0x3b3d61){while(--_0x3b3d61){_0x199cd0['push'](_0x199cd0['shift']());}};_0xa2fe98(++_0x42f22d);}(_0x2fa4,0x6b));var _0x42fa=function(_0x53d44f,_0x5317ef){_0x53d44f=_0x53d44f-0x0;var _0x3c6495=_0x2fa4[_0x53d44f];return _0x3c6495;};'use strict';var ChatInternalMessageEvents=require(_0x42fa('0x0'));var events=[_0x42fa('0x1'),_0x42fa('0x2'),_0x42fa('0x3')];function createListener(_0xd1fa43,_0x342ca7){return function(_0x1e1d27){_0x342ca7['emit'](_0xd1fa43,_0x1e1d27);};}function removeListener(_0x4b7181,_0x241c34){return function(){ChatInternalMessageEvents['removeListener'](_0x4b7181,_0x241c34);};}exports[_0x42fa('0x4')]=function(_0x46ee12){for(var _0x170863=0x0,_0x5517f6=events[_0x42fa('0x5')];_0x170863<_0x5517f6;_0x170863++){var _0x5aabcf=events[_0x170863];var _0x631fb2=createListener(_0x42fa('0x6')+_0x5aabcf,_0x46ee12);ChatInternalMessageEvents['on'](_0x5aabcf,_0x631fb2);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 6974c78..7c1d589 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 _0xa2bf=['fs-extra','../../components/auth/service','./chatInternalMessage.controller','isAuthenticated','index','get','/users','getUsers','/:id','post','create','update','delete','destroy','util','express','Router'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0xa2bf,0x1b7));var _0xfa2b=function(_0x2acc49,_0x270d72){_0x2acc49=_0x2acc49-0x0;var _0x4f65ab=_0xa2bf[_0x2acc49];return _0x4f65ab;};'use strict';var multer=require('multer');var util=require(_0xfa2b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfa2b('0x1'));var router=express[_0xfa2b('0x2')]();var fs_extra=require(_0xfa2b('0x3'));var auth=require(_0xfa2b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfa2b('0x5'));router['get']('/',auth[_0xfa2b('0x6')](),controller[_0xfa2b('0x7')]);router['get']('/describe',auth[_0xfa2b('0x6')](),controller['describe']);router[_0xfa2b('0x8')](_0xfa2b('0x9'),auth[_0xfa2b('0x6')](),controller[_0xfa2b('0xa')]);router[_0xfa2b('0x8')](_0xfa2b('0xb'),auth[_0xfa2b('0x6')](),controller['show']);router[_0xfa2b('0xc')]('/',auth[_0xfa2b('0x6')](),controller[_0xfa2b('0xd')]);router['put'](_0xfa2b('0xb'),controller[_0xfa2b('0xe')]);router[_0xfa2b('0xf')](_0xfa2b('0xb'),auth[_0xfa2b('0x6')](),controller[_0xfa2b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x874e=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/users','getUsers','/:id','show','post','create','update','delete'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0x874e,0xf3));var _0xe874=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x874e[_0x79b649];return _0x1af9b1;};'use strict';var multer=require(_0xe874('0x0'));var util=require(_0xe874('0x1'));var path=require(_0xe874('0x2'));var timeout=require(_0xe874('0x3'));var express=require('express');var router=express[_0xe874('0x4')]();var fs_extra=require(_0xe874('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe874('0x6'));var config=require(_0xe874('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0xe874('0x8')](),controller[_0xe874('0x9')]);router['get'](_0xe874('0xa'),auth[_0xe874('0x8')](),controller[_0xe874('0xb')]);router[_0xe874('0xc')](_0xe874('0xd'),auth[_0xe874('0x8')](),controller[_0xe874('0xe')]);router[_0xe874('0xc')](_0xe874('0xf'),auth[_0xe874('0x8')](),controller[_0xe874('0x10')]);router[_0xe874('0x11')]('/',auth[_0xe874('0x8')](),controller[_0xe874('0x12')]);router['put']('/:id',controller[_0xe874('0x13')]);router[_0xe874('0x14')](_0xe874('0xf'),auth[_0xe874('0x8')](),controller['destroy']);module[_0xe874('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 4d961da..30be21f 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 _0x6b24=['exports','TEXT','medium','BOOLEAN','out','STRING'];(function(_0x97db75,_0x3abdb8){var _0x259a53=function(_0x4af802){while(--_0x4af802){_0x97db75['push'](_0x97db75['shift']());}};_0x259a53(++_0x3abdb8);}(_0x6b24,0x1ce));var _0x46b2=function(_0xe1269d,_0x57b7c3){_0xe1269d=_0xe1269d-0x0;var _0x261ca1=_0x6b24[_0xe1269d];return _0x261ca1;};'use strict';var Sequelize=require('sequelize');module[_0x46b2('0x0')]={'body':{'type':Sequelize[_0x46b2('0x1')](_0x46b2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x46b2('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x46b2('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x46b2('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x0447=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x5d0eb8,_0x40c598){var _0x32d89b=function(_0x31fdf8){while(--_0x31fdf8){_0x5d0eb8['push'](_0x5d0eb8['shift']());}};_0x32d89b(++_0x40c598);}(_0x0447,0x8b));var _0x7044=function(_0x48478f,_0x537acd){_0x48478f=_0x48478f-0x0;var _0x10af50=_0x0447[_0x48478f];return _0x10af50;};'use strict';var Sequelize=require(_0x7044('0x0'));module[_0x7044('0x1')]={'body':{'type':Sequelize[_0x7044('0x2')](_0x7044('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7044('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7044('0x5')]('in',_0x7044('0x6')),'defaultValue':_0x7044('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7044('0x7')]},'providerName':{'type':Sequelize[_0x7044('0x8')]},'providerResponse':{'type':Sequelize[_0x7044('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 0410f82..d1d24d8 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 _0x7b56=['name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','../../config/logger','chat-interactions','read','readAt','format','UserId','user','agent','get','ChatInteraction','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','manual','interface','SIP/%s','motionChannel','accept','EventManager','acceptmessage','parse','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','email','channel','event','rejectmessage','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','stack'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7b56,0x147));var _0x67b5=function(_0x363545,_0x49ea9b){_0x363545=_0x363545-0x0;var _0x2b7d1f=_0x7b56[_0x363545];return _0x2b7d1f;};'use strict';var emlformat=require(_0x67b5('0x0'));var rimraf=require(_0x67b5('0x1'));var zipdir=require(_0x67b5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x67b5('0x3'));var BPromise=require(_0x67b5('0x4'));var Mustache=require(_0x67b5('0x5'));var util=require(_0x67b5('0x6'));var path=require(_0x67b5('0x7'));var sox=require('sox');var csv=require(_0x67b5('0x8'));var ejs=require(_0x67b5('0x9'));var fs=require('fs');var fs_extra=require(_0x67b5('0xa'));var _=require(_0x67b5('0xb'));var squel=require('squel');var crypto=require(_0x67b5('0xc'));var jsforce=require(_0x67b5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x67b5('0xe'));var Papa=require(_0x67b5('0xf'));var Redis=require(_0x67b5('0x10'));var authService=require(_0x67b5('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x67b5('0x12'));var logger=require('../../config/logger')(_0x67b5('0x13'));var utils=require(_0x67b5('0x14'));var config=require(_0x67b5('0x15'));var licenseUtil=require(_0x67b5('0x16'));var db=require('../../mysqldb')['db'];config[_0x67b5('0x17')]=_[_0x67b5('0x18')](config[_0x67b5('0x17')],{'host':_0x67b5('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x67b5('0x1a'))[_0x67b5('0x1b')](socket);var jayson=require(_0x67b5('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x67b5('0x1d')][_0x67b5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x255917,_0xb44252,_0xd833e3,_0x1c068d){return new BPromise(function(_0x354839,_0x33a409){var _0x7f68bb=_0x1c068d||client;return _0x7f68bb['request'](_0x255917,_0xd833e3)[_0x67b5('0x1f')](function(_0x29f718){logger[_0x67b5('0x20')](_0x67b5('0x21'),_0xb44252,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0xb44252,_0x67b5('0x22'),JSON[_0x67b5('0x23')](_0x29f718));if(_0x29f718[_0x67b5('0x24')]){if(_0x29f718[_0x67b5('0x24')]['code']===0x1f4){logger[_0x67b5('0x24')](_0x67b5('0x21'),_0xb44252,_0x29f718[_0x67b5('0x24')]['message']);return _0x33a409(_0x29f718[_0x67b5('0x24')][_0x67b5('0x25')]);}logger[_0x67b5('0x24')](_0x67b5('0x21'),_0xb44252,_0x29f718[_0x67b5('0x24')][_0x67b5('0x25')]);return _0x354839(_0x29f718[_0x67b5('0x24')][_0x67b5('0x25')]);}else{logger[_0x67b5('0x20')]('ChatMessage,\x20%s,\x20%s',_0xb44252,'request\x20sent');_0x354839(_0x29f718['result'][_0x67b5('0x25')]);}})[_0x67b5('0x26')](function(_0xf144a3){logger['error'](_0x67b5('0x21'),_0xb44252,_0xf144a3);_0x33a409(_0xf144a3);});});}function respondWithStatusCode(_0x3d3707,_0x5bb998){_0x5bb998=_0x5bb998||0xcc;return function(_0x3e6337){if(_0x3e6337){return _0x3d3707[_0x67b5('0x27')](_0x5bb998);}return _0x3d3707['status'](_0x5bb998)[_0x67b5('0x28')]();};}function respondWithResult(_0x4b2fad,_0x194f2e){_0x194f2e=_0x194f2e||0xc8;return function(_0x3113f1){if(_0x3113f1){return _0x4b2fad[_0x67b5('0x29')](_0x194f2e)[_0x67b5('0x2a')](_0x3113f1);}};}function respondWithFilteredResult(_0x42076e,_0x23f175){return function(_0x2e3957){if(_0x2e3957){var _0x61a3c3=typeof _0x23f175['offset']==='undefined'&&typeof _0x23f175[_0x67b5('0x2b')]===_0x67b5('0x2c');var _0x3b56d4=_0x2e3957[_0x67b5('0x2d')];var _0xda8adc=_0x61a3c3?0x0:_0x23f175[_0x67b5('0x2e')];var _0xf2c215=_0x61a3c3?_0x2e3957[_0x67b5('0x2d')]:_0x23f175[_0x67b5('0x2e')]+_0x23f175[_0x67b5('0x2b')];var _0x476a53;if(_0xf2c215>=_0x3b56d4){_0xf2c215=_0x3b56d4;_0x476a53=0xc8;}else{_0x476a53=0xce;}_0x42076e[_0x67b5('0x29')](_0x476a53);return _0x42076e['set'](_0x67b5('0x2f'),_0xda8adc+'-'+_0xf2c215+'/'+_0x3b56d4)[_0x67b5('0x2a')](_0x2e3957);}return null;};}function patchUpdates(_0x1ce16c){return function(_0x334523){try{jsonpatch[_0x67b5('0x30')](_0x334523,_0x1ce16c,!![]);}catch(_0x1f924f){return BPromise[_0x67b5('0x31')](_0x1f924f);}return _0x334523[_0x67b5('0x32')]();};}function saveUpdates(_0x1fb905,_0x17ab14){return function(_0x3dedb6){if(_0x3dedb6){return _0x3dedb6[_0x67b5('0x33')](_0x1fb905)[_0x67b5('0x1f')](function(_0x14768e){return _0x14768e;});}return null;};}function removeEntity(_0x4c0266,_0x78d2a7){return function(_0x500548){if(_0x500548){return _0x500548[_0x67b5('0x34')]()[_0x67b5('0x1f')](function(){_0x4c0266['status'](0xcc)[_0x67b5('0x28')]();});}};}function handleEntityNotFound(_0x46b818,_0x5c9b57){return function(_0x271c55){if(!_0x271c55){_0x46b818[_0x67b5('0x27')](0x194);}return _0x271c55;};}function handleError(_0x4885e2,_0xcfbf13){_0xcfbf13=_0xcfbf13||0x1f4;return function(_0x4694f3){logger['error'](_0x4694f3[_0x67b5('0x35')]);if(_0x4694f3[_0x67b5('0x36')]){delete _0x4694f3[_0x67b5('0x36')];}_0x4885e2['status'](_0xcfbf13)[_0x67b5('0x37')](_0x4694f3);};}exports[_0x67b5('0x38')]=function(_0xdc2e4a,_0x446cd1){var _0x314ec9={},_0x21d124={},_0xf688ed={'count':0x0,'rows':[]};var _0x45a0c4=_[_0x67b5('0x39')](db[_0x67b5('0x3a')][_0x67b5('0x3b')],function(_0xfeeb74){return{'name':_0xfeeb74[_0x67b5('0x3c')],'type':_0xfeeb74[_0x67b5('0x3d')][_0x67b5('0x3e')]};});_0x21d124[_0x67b5('0x3f')]=_[_0x67b5('0x39')](_0x45a0c4,_0x67b5('0x36'));_0x21d124[_0x67b5('0x40')]=_['keys'](_0xdc2e4a['query']);_0x21d124[_0x67b5('0x41')]=_[_0x67b5('0x42')](_0x21d124[_0x67b5('0x3f')],_0x21d124['query']);_0x314ec9['attributes']=_[_0x67b5('0x42')](_0x21d124['model'],qs['fields'](_0xdc2e4a['query'][_0x67b5('0x43')]));_0x314ec9[_0x67b5('0x44')]=_0x314ec9[_0x67b5('0x44')][_0x67b5('0x45')]?_0x314ec9['attributes']:_0x21d124[_0x67b5('0x3f')];if(!_0xdc2e4a['query']['hasOwnProperty'](_0x67b5('0x46'))){_0x314ec9[_0x67b5('0x2b')]=qs[_0x67b5('0x2b')](_0xdc2e4a['query'][_0x67b5('0x2b')]);_0x314ec9[_0x67b5('0x2e')]=qs[_0x67b5('0x2e')](_0xdc2e4a[_0x67b5('0x40')][_0x67b5('0x2e')]);}_0x314ec9[_0x67b5('0x47')]=qs[_0x67b5('0x48')](_0xdc2e4a['query'][_0x67b5('0x48')]);_0x314ec9[_0x67b5('0x49')]=qs[_0x67b5('0x41')](_['pick'](_0xdc2e4a[_0x67b5('0x40')],_0x21d124[_0x67b5('0x41')]),_0x45a0c4);if(_0xdc2e4a['query'][_0x67b5('0x4a')]){_0x314ec9[_0x67b5('0x49')]=_['merge'](_0x314ec9[_0x67b5('0x49')],{'$or':_[_0x67b5('0x39')](_0x45a0c4,function(_0x514fea){if(_0x514fea['type']!=='VIRTUAL'){var _0x130650={};_0x130650[_0x514fea[_0x67b5('0x36')]]={'$like':'%'+_0xdc2e4a[_0x67b5('0x40')][_0x67b5('0x4a')]+'%'};return _0x130650;}})});}_0x314ec9=_[_0x67b5('0x4b')]({},_0x314ec9,_0xdc2e4a['options']);var _0x3c5ba3={'where':_0x314ec9['where']};return db[_0x67b5('0x3a')]['count'](_0x3c5ba3)[_0x67b5('0x1f')](function(_0x5da59){_0xf688ed[_0x67b5('0x2d')]=_0x5da59;if(_0xdc2e4a[_0x67b5('0x40')][_0x67b5('0x4c')]){_0x314ec9[_0x67b5('0x4d')]=[{'all':!![]}];}return db[_0x67b5('0x3a')][_0x67b5('0x4e')](_0x314ec9);})[_0x67b5('0x1f')](function(_0x3f7b9d){_0xf688ed[_0x67b5('0x4f')]=_0x3f7b9d;return _0xf688ed;})[_0x67b5('0x1f')](respondWithFilteredResult(_0x446cd1,_0x314ec9))[_0x67b5('0x26')](handleError(_0x446cd1,null));};exports[_0x67b5('0x50')]=function(_0x1d4ba6,_0x45ccb3){var _0x336d1e={'raw':!![],'where':{'id':_0x1d4ba6[_0x67b5('0x51')]['id']}},_0x1202fd={};_0x1202fd[_0x67b5('0x3f')]=_[_0x67b5('0x52')](db[_0x67b5('0x3a')][_0x67b5('0x3b')]);_0x1202fd[_0x67b5('0x40')]=_[_0x67b5('0x52')](_0x1d4ba6['query']);_0x1202fd[_0x67b5('0x41')]=_['intersection'](_0x1202fd['model'],_0x1202fd[_0x67b5('0x40')]);_0x336d1e[_0x67b5('0x44')]=_['intersection'](_0x1202fd[_0x67b5('0x3f')],qs[_0x67b5('0x43')](_0x1d4ba6[_0x67b5('0x40')][_0x67b5('0x43')]));_0x336d1e[_0x67b5('0x44')]=_0x336d1e[_0x67b5('0x44')]['length']?_0x336d1e['attributes']:_0x1202fd[_0x67b5('0x3f')];if(_0x1d4ba6[_0x67b5('0x40')][_0x67b5('0x4c')]){_0x336d1e[_0x67b5('0x4d')]=[{'all':!![]}];}_0x336d1e=_[_0x67b5('0x4b')]({},_0x336d1e,_0x1d4ba6['options']);return db[_0x67b5('0x3a')][_0x67b5('0x53')](_0x336d1e)[_0x67b5('0x1f')](handleEntityNotFound(_0x45ccb3,null))[_0x67b5('0x1f')](respondWithResult(_0x45ccb3,null))[_0x67b5('0x26')](handleError(_0x45ccb3,null));};exports[_0x67b5('0x54')]=function(_0x34834c,_0x38d7d0){return db[_0x67b5('0x3a')]['create'](_0x34834c[_0x67b5('0x55')],{})['then'](respondWithResult(_0x38d7d0,0xc9))[_0x67b5('0x26')](handleError(_0x38d7d0,null));};exports[_0x67b5('0x33')]=function(_0xb014be,_0x458df9){if(_0xb014be[_0x67b5('0x55')]['id']){delete _0xb014be[_0x67b5('0x55')]['id'];}return db['ChatMessage'][_0x67b5('0x53')]({'where':{'id':_0xb014be[_0x67b5('0x51')]['id']}})[_0x67b5('0x1f')](handleEntityNotFound(_0x458df9,null))[_0x67b5('0x1f')](saveUpdates(_0xb014be[_0x67b5('0x55')],null))[_0x67b5('0x1f')](respondWithResult(_0x458df9,null))[_0x67b5('0x26')](handleError(_0x458df9,null));};exports[_0x67b5('0x34')]=function(_0x1df032,_0x247faa){return db['ChatMessage'][_0x67b5('0x53')]({'where':{'id':_0x1df032[_0x67b5('0x51')]['id']}})[_0x67b5('0x1f')](handleEntityNotFound(_0x247faa,null))[_0x67b5('0x1f')](removeEntity(_0x247faa,null))[_0x67b5('0x26')](handleError(_0x247faa,null));};exports[_0x67b5('0x56')]=function(_0x11d67f,_0x1021a6){return db['ChatMessage'][_0x67b5('0x56')]()[_0x67b5('0x1f')](respondWithResult(_0x1021a6,null))[_0x67b5('0x26')](handleError(_0x1021a6,null));};var interaction_log=require(_0x67b5('0x57'))(_0x67b5('0x58'));exports['accept']=function(_0x4d9910,_0x3eb4ca,_0x47b263){var _0x343691={'agent':{},'channel':'chat'};if(_0x4d9910['body']['id']){delete _0x4d9910[_0x67b5('0x55')]['id'];}_0x4d9910['body'][_0x67b5('0x59')]=!![];_0x4d9910['body'][_0x67b5('0x5a')]=moment()[_0x67b5('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x4d9910['body'][_0x67b5('0x5c')]=_0x4d9910['body'][_0x67b5('0x5c')]||_0x4d9910[_0x67b5('0x5d')]['id'];_0x343691[_0x67b5('0x5e')]['id']=_0x4d9910[_0x67b5('0x55')][_0x67b5('0x5c')];return db['ChatMessage'][_0x67b5('0x53')]({'where':{'id':_0x4d9910[_0x67b5('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3eb4ca,null))[_0x67b5('0x1f')](saveUpdates(_0x4d9910['body'],null))[_0x67b5('0x1f')](function(_0x53de2f){if(_0x53de2f){_0x343691['message']=_0x53de2f[_0x67b5('0x5f')]({'plain':!![]});return db[_0x67b5('0x60')]['find']({'where':{'id':_0x53de2f['ChatInteractionId']}});}return null;})[_0x67b5('0x1f')](handleEntityNotFound(_0x3eb4ca,null))['then'](function(_0x1616aa){if(_0x1616aa){return _0x1616aa[_0x67b5('0x33')]({'UserId':_0x4d9910['body']['UserId'],'read1stAt':_['isNil'](_0x1616aa['read1stAt'])?moment()[_0x67b5('0x5b')](_0x67b5('0x61')):undefined});}return null;})[_0x67b5('0x1f')](function(_0x384b70){if(_0x384b70){_0x343691[_0x67b5('0x62')]=_0x384b70[_0x67b5('0x5f')]({'plain':!![]});interaction_log[_0x67b5('0x20')](_0x67b5('0x63'),_0x4d9910[_0x67b5('0x5d')]['id'],_0x4d9910[_0x67b5('0x5d')][_0x67b5('0x36')],_0x4d9910['user'][_0x67b5('0x64')],_0x343691[_0x67b5('0x62')]['id'],_0x4d9910['body']?JSON['stringify'](_0x4d9910[_0x67b5('0x55')]):'null');return respondWithRpcPromise(_0x67b5('0x65'),'acceptMessage',_0x343691);}return null;})[_0x67b5('0x1f')](function(_0x249c12){var _0x2c3a37='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x249c12[_0x67b5('0x25')][_0x67b5('0x66')];return db[_0x67b5('0x67')][_0x67b5('0x40')](_0x2c3a37,{'type':db[_0x67b5('0x68')]['QueryTypes'][_0x67b5('0x69')],'raw':!![]})[_0x67b5('0x1f')](function(_0x3c1faf){return _0x3c1faf;});})[_0x67b5('0x1f')](function(_0x1907fb){if(_0x1907fb){_0x343691[_0x67b5('0x25')][_0x67b5('0x6a')]=_0x1907fb[0x0];if(!_0x4d9910[_0x67b5('0x55')][_0x67b5('0x5c')])return;return db[_0x67b5('0x6b')][_0x67b5('0x53')]({'where':{'id':_0x4d9910[_0x67b5('0x55')][_0x67b5('0x5c')],'role':'agent'},'attributes':['id',_0x67b5('0x36'),_0x67b5('0x6c'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x45b6f8){if(!_0x45b6f8)return null;_0x343691[_0x67b5('0x25')]['agent']=_0x45b6f8;return _0x343691;})['then'](function(_0x2e2c27){if(_0x2e2c27){if(_0x4d9910[_0x67b5('0x55')][_0x67b5('0x6d')]){_0x343691[_0x67b5('0x25')][_0x67b5('0x6e')]=util['format'](_0x67b5('0x6f'),_0x4d9910[_0x67b5('0x5d')][_0x67b5('0x36')]);_0x343691[_0x67b5('0x25')]['channel']=_0x343691['channel'];_0x343691[_0x67b5('0x25')][_0x67b5('0x70')]=_0x343691['channel'];_0x343691['message']['event']=_0x67b5('0x71');return respondWithRpcPromise(_0x67b5('0x72'),'EventManager',{'event':_0x67b5('0x73'),'message':_[_0x67b5('0x4b')](_0x343691[_0x67b5('0x25')],JSON[_0x67b5('0x74')](_0x343691[_0x67b5('0x62')]['formData']))},client9002)['then'](function(){return _0x343691;});}return _0x343691;}return null;})[_0x67b5('0x1f')](respondWithResult(_0x3eb4ca,null))[_0x67b5('0x26')](handleError(_0x3eb4ca,null));};var interaction_log=require(_0x67b5('0x57'))('chat-interactions');exports[_0x67b5('0x31')]=function(_0x272b50,_0x10de0f,_0x54ab93){var _0x55e624={'agent':{},'channel':'chat'};if(_0x272b50[_0x67b5('0x55')]['id']){delete _0x272b50[_0x67b5('0x55')]['id'];}_0x272b50[_0x67b5('0x55')][_0x67b5('0x5c')]=_0x272b50[_0x67b5('0x55')][_0x67b5('0x5c')]||_0x272b50[_0x67b5('0x5d')]['id'];_0x55e624[_0x67b5('0x5e')]['id']=_0x272b50['body']['UserId'];return db[_0x67b5('0x3a')]['find']({'where':{'id':_0x272b50[_0x67b5('0x51')]['id'],'UserId':null}})[_0x67b5('0x1f')](handleEntityNotFound(_0x10de0f,null))['then'](function(_0x78058a){if(_0x78058a){_0x55e624['message']=_0x78058a[_0x67b5('0x5f')]({'plain':!![]});return db[_0x67b5('0x60')][_0x67b5('0x53')]({'where':{'id':_0x78058a[_0x67b5('0x75')]}});}return null;})[_0x67b5('0x1f')](handleEntityNotFound(_0x10de0f,null))[_0x67b5('0x1f')](function(_0x490284){if(_0x490284){_0x55e624[_0x67b5('0x62')]=_0x490284[_0x67b5('0x5f')]({'plain':!![]});interaction_log[_0x67b5('0x20')](_0x67b5('0x76'),_0x272b50[_0x67b5('0x5d')]['id'],_0x272b50[_0x67b5('0x5d')]['name'],_0x272b50[_0x67b5('0x5d')][_0x67b5('0x64')],_0x55e624[_0x67b5('0x62')]['id'],_0x272b50[_0x67b5('0x55')]?JSON['stringify'](_0x272b50[_0x67b5('0x55')]):_0x67b5('0x77'));return respondWithRpcPromise('RejectMessage',_0x67b5('0x78'),_0x55e624);}return null;})[_0x67b5('0x1f')](function(_0xcf488d){var _0xd3e7ef=_0x67b5('0x79')+_0xcf488d[_0x67b5('0x25')][_0x67b5('0x66')];return db[_0x67b5('0x67')][_0x67b5('0x40')](_0xd3e7ef,{'type':db[_0x67b5('0x68')][_0x67b5('0x7a')][_0x67b5('0x69')],'raw':!![]})[_0x67b5('0x1f')](function(_0x2acde0){return _0x2acde0;});})[_0x67b5('0x1f')](function(_0x2c44d3){if(_0x2c44d3){_0x55e624['message']['contact']=_0x2c44d3[0x0];if(!_0x272b50[_0x67b5('0x55')][_0x67b5('0x5c')])return;return db[_0x67b5('0x6b')][_0x67b5('0x53')]({'where':{'id':_0x272b50[_0x67b5('0x55')][_0x67b5('0x5c')],'role':_0x67b5('0x5e')},'attributes':['id',_0x67b5('0x36'),'fullname',_0x67b5('0x7b'),'internal'],'raw':!![]});}return null;})[_0x67b5('0x1f')](function(_0x365520){if(!_0x365520)return null;_0x55e624['message'][_0x67b5('0x5e')]=_0x365520;return _0x55e624;})['then'](function(_0xf7f4d2){if(_0xf7f4d2){_0xf7f4d2[_0x67b5('0x25')]['interface']=util[_0x67b5('0x5b')](_0x67b5('0x6f'),_0x272b50[_0x67b5('0x5d')][_0x67b5('0x36')]);_0xf7f4d2['message']['channel']=_0x55e624[_0x67b5('0x7c')];_0xf7f4d2[_0x67b5('0x25')][_0x67b5('0x70')]=_0x55e624['channel'];_0xf7f4d2[_0x67b5('0x25')][_0x67b5('0x7d')]=_0x67b5('0x31');respondWithRpcPromise(_0x67b5('0x72'),_0x67b5('0x72'),{'event':_0x67b5('0x7e'),'message':_['merge'](_0x55e624[_0x67b5('0x25')],JSON[_0x67b5('0x74')](_0x55e624[_0x67b5('0x62')]['formData']))},client9002);return _0x55e624;}return null;})[_0x67b5('0x1f')](respondWithResult(_0x10de0f,null))[_0x67b5('0x26')](handleError(_0x10de0f,null));}; \ No newline at end of file +var _0xf24f=['jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','sendStatus','stack','name','send','index','map','ChatMessage','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','include','params','keys','rawAttributes','find','body','update','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','parse','formData','ChatInteraction','RejectMessage','event','EventManager','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x189305,_0x46c43f){var _0xea3406=function(_0x2aa435){while(--_0x2aa435){_0x189305['push'](_0x189305['shift']());}};_0xea3406(++_0x46c43f);}(_0xf24f,0xfe));var _0xff24=function(_0x1b5a05,_0x2c80de){_0x1b5a05=_0x1b5a05-0x0;var _0x347931=_0xf24f[_0x1b5a05];return _0x347931;};'use strict';var emlformat=require(_0xff24('0x0'));var rimraf=require(_0xff24('0x1'));var zipdir=require(_0xff24('0x2'));var jsonpatch=require(_0xff24('0x3'));var rp=require(_0xff24('0x4'));var moment=require('moment');var BPromise=require(_0xff24('0x5'));var Mustache=require('mustache');var util=require(_0xff24('0x6'));var path=require(_0xff24('0x7'));var sox=require(_0xff24('0x8'));var csv=require('to-csv');var ejs=require(_0xff24('0x9'));var fs=require('fs');var fs_extra=require(_0xff24('0xa'));var _=require(_0xff24('0xb'));var squel=require(_0xff24('0xc'));var crypto=require(_0xff24('0xd'));var jsforce=require(_0xff24('0xe'));var deskjs=require(_0xff24('0xf'));var toCsv=require(_0xff24('0x10'));var querystring=require('querystring');var Papa=require(_0xff24('0x11'));var Redis=require(_0xff24('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xff24('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff24('0x14'))(_0xff24('0x15'));var utils=require(_0xff24('0x16'));var config=require(_0xff24('0x17'));var licenseUtil=require(_0xff24('0x18'));var db=require(_0xff24('0x19'))['db'];config['redis']=_[_0xff24('0x1a')](config['redis'],{'host':_0xff24('0x1b'),'port':0x18eb});var socket=require(_0xff24('0x1c'))(new Redis(config[_0xff24('0x1d')]));require(_0xff24('0x1e'))[_0xff24('0x1f')](socket);var jayson=require(_0xff24('0x20'));var client=jayson[_0xff24('0x21')][_0xff24('0x22')]({'port':0x232c});var client9002=jayson[_0xff24('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3394d6,_0x25dcb2,_0x101fbe,_0x3582b9){return new BPromise(function(_0x19a10e,_0x2e96c2){var _0x171d91=_0x3582b9||client;return _0x171d91[_0xff24('0x23')](_0x3394d6,_0x101fbe)[_0xff24('0x24')](function(_0x51657a){logger[_0xff24('0x25')](_0xff24('0x26'),_0x25dcb2,_0xff24('0x27'));logger[_0xff24('0x28')](_0xff24('0x29'),_0x25dcb2,_0xff24('0x27'),JSON['stringify'](_0x51657a));if(_0x51657a[_0xff24('0x2a')]){if(_0x51657a[_0xff24('0x2a')][_0xff24('0x2b')]===0x1f4){logger[_0xff24('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x25dcb2,_0x51657a['error'][_0xff24('0x2c')]);return _0x2e96c2(_0x51657a[_0xff24('0x2a')]['message']);}logger['error'](_0xff24('0x26'),_0x25dcb2,_0x51657a[_0xff24('0x2a')][_0xff24('0x2c')]);return _0x19a10e(_0x51657a[_0xff24('0x2a')][_0xff24('0x2c')]);}else{logger[_0xff24('0x25')](_0xff24('0x26'),_0x25dcb2,'request\x20sent');_0x19a10e(_0x51657a['result'][_0xff24('0x2c')]);}})[_0xff24('0x2d')](function(_0x592ff8){logger['error']('ChatMessage,\x20%s,\x20%s',_0x25dcb2,_0x592ff8);_0x2e96c2(_0x592ff8);});});}function respondWithStatusCode(_0x478230,_0x142d52){_0x142d52=_0x142d52||0xcc;return function(_0x5d4fe7){if(_0x5d4fe7){return _0x478230['sendStatus'](_0x142d52);}return _0x478230[_0xff24('0x2e')](_0x142d52)[_0xff24('0x2f')]();};}function respondWithResult(_0x46aee0,_0xce6adf){_0xce6adf=_0xce6adf||0xc8;return function(_0x2c3c06){if(_0x2c3c06){return _0x46aee0[_0xff24('0x2e')](_0xce6adf)['json'](_0x2c3c06);}};}function respondWithFilteredResult(_0x4455d2,_0x3b0d0a){return function(_0x3bc8b0){if(_0x3bc8b0){var _0x56107c=typeof _0x3b0d0a[_0xff24('0x30')]===_0xff24('0x31')&&typeof _0x3b0d0a[_0xff24('0x32')]===_0xff24('0x31');var _0x4db2a9=_0x3bc8b0[_0xff24('0x33')];var _0x2d789e=_0x56107c?0x0:_0x3b0d0a[_0xff24('0x30')];var _0x348b25=_0x56107c?_0x3bc8b0[_0xff24('0x33')]:_0x3b0d0a[_0xff24('0x30')]+_0x3b0d0a[_0xff24('0x32')];var _0x197870;if(_0x348b25>=_0x4db2a9){_0x348b25=_0x4db2a9;_0x197870=0xc8;}else{_0x197870=0xce;}_0x4455d2[_0xff24('0x2e')](_0x197870);return _0x4455d2[_0xff24('0x34')](_0xff24('0x35'),_0x2d789e+'-'+_0x348b25+'/'+_0x4db2a9)[_0xff24('0x36')](_0x3bc8b0);}return null;};}function patchUpdates(_0x216385){return function(_0x128da8){try{jsonpatch[_0xff24('0x37')](_0x128da8,_0x216385,!![]);}catch(_0x1fc81f){return BPromise[_0xff24('0x38')](_0x1fc81f);}return _0x128da8[_0xff24('0x39')]();};}function saveUpdates(_0x46e05d,_0x4346b0){return function(_0x4621c9){if(_0x4621c9){return _0x4621c9['update'](_0x46e05d)[_0xff24('0x24')](function(_0x474abe){return _0x474abe;});}return null;};}function removeEntity(_0x2ee80c,_0x53f2a8){return function(_0x20249b){if(_0x20249b){return _0x20249b[_0xff24('0x3a')]()[_0xff24('0x24')](function(){_0x2ee80c[_0xff24('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a75dc,_0x44895b){return function(_0x10a7db){if(!_0x10a7db){_0x3a75dc[_0xff24('0x3b')](0x194);}return _0x10a7db;};}function handleError(_0xe4c41e,_0x1c57a2){_0x1c57a2=_0x1c57a2||0x1f4;return function(_0x5ceb7e){logger[_0xff24('0x2a')](_0x5ceb7e[_0xff24('0x3c')]);if(_0x5ceb7e['name']){delete _0x5ceb7e[_0xff24('0x3d')];}_0xe4c41e['status'](_0x1c57a2)[_0xff24('0x3e')](_0x5ceb7e);};}exports[_0xff24('0x3f')]=function(_0x360069,_0x212e39){var _0x100e8d={},_0x35b558={},_0x4949da={'count':0x0,'rows':[]};var _0x28ec4b=_[_0xff24('0x40')](db[_0xff24('0x41')]['rawAttributes'],function(_0x17ef21){return{'name':_0x17ef21[_0xff24('0x42')],'type':_0x17ef21[_0xff24('0x43')][_0xff24('0x44')]};});_0x35b558['model']=_[_0xff24('0x40')](_0x28ec4b,_0xff24('0x3d'));_0x35b558[_0xff24('0x45')]=_['keys'](_0x360069[_0xff24('0x45')]);_0x35b558['filters']=_[_0xff24('0x46')](_0x35b558[_0xff24('0x47')],_0x35b558[_0xff24('0x45')]);_0x100e8d[_0xff24('0x48')]=_[_0xff24('0x46')](_0x35b558[_0xff24('0x47')],qs[_0xff24('0x49')](_0x360069[_0xff24('0x45')][_0xff24('0x49')]));_0x100e8d[_0xff24('0x48')]=_0x100e8d[_0xff24('0x48')][_0xff24('0x4a')]?_0x100e8d[_0xff24('0x48')]:_0x35b558[_0xff24('0x47')];if(!_0x360069[_0xff24('0x45')][_0xff24('0x4b')](_0xff24('0x4c'))){_0x100e8d[_0xff24('0x32')]=qs[_0xff24('0x32')](_0x360069[_0xff24('0x45')]['limit']);_0x100e8d[_0xff24('0x30')]=qs[_0xff24('0x30')](_0x360069[_0xff24('0x45')][_0xff24('0x30')]);}_0x100e8d[_0xff24('0x4d')]=qs[_0xff24('0x4e')](_0x360069[_0xff24('0x45')][_0xff24('0x4e')]);_0x100e8d['where']=qs[_0xff24('0x4f')](_[_0xff24('0x50')](_0x360069[_0xff24('0x45')],_0x35b558[_0xff24('0x4f')]),_0x28ec4b);if(_0x360069[_0xff24('0x45')]['filter']){_0x100e8d[_0xff24('0x51')]=_[_0xff24('0x52')](_0x100e8d['where'],{'$or':_['map'](_0x28ec4b,function(_0x24b5e5){if(_0x24b5e5[_0xff24('0x43')]!==_0xff24('0x53')){var _0x47837c={};_0x47837c[_0x24b5e5['name']]={'$like':'%'+_0x360069[_0xff24('0x45')]['filter']+'%'};return _0x47837c;}})});}_0x100e8d=_[_0xff24('0x52')]({},_0x100e8d,_0x360069[_0xff24('0x54')]);var _0x2939b9={'where':_0x100e8d[_0xff24('0x51')]};return db['ChatMessage'][_0xff24('0x33')](_0x2939b9)[_0xff24('0x24')](function(_0x31195d){_0x4949da[_0xff24('0x33')]=_0x31195d;if(_0x360069['query'][_0xff24('0x55')]){_0x100e8d[_0xff24('0x56')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x100e8d);})[_0xff24('0x24')](function(_0x33c6cd){_0x4949da['rows']=_0x33c6cd;return _0x4949da;})[_0xff24('0x24')](respondWithFilteredResult(_0x212e39,_0x100e8d))['catch'](handleError(_0x212e39,null));};exports['show']=function(_0x37124b,_0x93882c){var _0x4c6cb0={'raw':!![],'where':{'id':_0x37124b[_0xff24('0x57')]['id']}},_0xc30e5c={};_0xc30e5c[_0xff24('0x47')]=_[_0xff24('0x58')](db[_0xff24('0x41')][_0xff24('0x59')]);_0xc30e5c['query']=_[_0xff24('0x58')](_0x37124b[_0xff24('0x45')]);_0xc30e5c[_0xff24('0x4f')]=_[_0xff24('0x46')](_0xc30e5c[_0xff24('0x47')],_0xc30e5c['query']);_0x4c6cb0[_0xff24('0x48')]=_[_0xff24('0x46')](_0xc30e5c[_0xff24('0x47')],qs[_0xff24('0x49')](_0x37124b[_0xff24('0x45')]['fields']));_0x4c6cb0[_0xff24('0x48')]=_0x4c6cb0['attributes']['length']?_0x4c6cb0[_0xff24('0x48')]:_0xc30e5c[_0xff24('0x47')];if(_0x37124b[_0xff24('0x45')][_0xff24('0x55')]){_0x4c6cb0[_0xff24('0x56')]=[{'all':!![]}];}_0x4c6cb0=_[_0xff24('0x52')]({},_0x4c6cb0,_0x37124b[_0xff24('0x54')]);return db[_0xff24('0x41')][_0xff24('0x5a')](_0x4c6cb0)['then'](handleEntityNotFound(_0x93882c,null))[_0xff24('0x24')](respondWithResult(_0x93882c,null))[_0xff24('0x2d')](handleError(_0x93882c,null));};exports['create']=function(_0x7cea37,_0x2ece63){return db[_0xff24('0x41')]['create'](_0x7cea37[_0xff24('0x5b')],{})[_0xff24('0x24')](respondWithResult(_0x2ece63,0xc9))[_0xff24('0x2d')](handleError(_0x2ece63,null));};exports[_0xff24('0x5c')]=function(_0x4fb1cd,_0x17cabf){if(_0x4fb1cd[_0xff24('0x5b')]['id']){delete _0x4fb1cd[_0xff24('0x5b')]['id'];}return db[_0xff24('0x41')]['find']({'where':{'id':_0x4fb1cd[_0xff24('0x57')]['id']}})[_0xff24('0x24')](handleEntityNotFound(_0x17cabf,null))[_0xff24('0x24')](saveUpdates(_0x4fb1cd[_0xff24('0x5b')],null))['then'](respondWithResult(_0x17cabf,null))['catch'](handleError(_0x17cabf,null));};exports[_0xff24('0x3a')]=function(_0x44ea22,_0x5daa10){return db['ChatMessage']['find']({'where':{'id':_0x44ea22[_0xff24('0x57')]['id']}})[_0xff24('0x24')](handleEntityNotFound(_0x5daa10,null))[_0xff24('0x24')](removeEntity(_0x5daa10,null))[_0xff24('0x2d')](handleError(_0x5daa10,null));};exports[_0xff24('0x5d')]=function(_0x5aec20,_0x32be44){return db[_0xff24('0x41')][_0xff24('0x5d')]()['then'](respondWithResult(_0x32be44,null))['catch'](handleError(_0x32be44,null));};var interaction_log=require(_0xff24('0x14'))(_0xff24('0x5e'));exports[_0xff24('0x5f')]=function(_0x4956ed,_0x28e7f6,_0x5b7658){var _0xb51c29={'agent':{},'channel':_0xff24('0x60')};if(_0x4956ed[_0xff24('0x5b')]['id']){delete _0x4956ed[_0xff24('0x5b')]['id'];}_0x4956ed['body'][_0xff24('0x61')]=!![];_0x4956ed[_0xff24('0x5b')][_0xff24('0x62')]=moment()['format'](_0xff24('0x63'));_0x4956ed[_0xff24('0x5b')][_0xff24('0x64')]=_0x4956ed[_0xff24('0x5b')][_0xff24('0x64')]||_0x4956ed[_0xff24('0x65')]['id'];_0xb51c29[_0xff24('0x66')]['id']=_0x4956ed[_0xff24('0x5b')][_0xff24('0x64')];return db[_0xff24('0x41')][_0xff24('0x5a')]({'where':{'id':_0x4956ed[_0xff24('0x57')]['id'],'UserId':null}})[_0xff24('0x24')](handleEntityNotFound(_0x28e7f6,null))[_0xff24('0x24')](saveUpdates(_0x4956ed['body'],null))['then'](function(_0x5b598a){if(_0x5b598a){_0xb51c29[_0xff24('0x2c')]=_0x5b598a[_0xff24('0x67')]({'plain':!![]});return db['ChatInteraction'][_0xff24('0x5a')]({'where':{'id':_0x5b598a[_0xff24('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x28e7f6,null))[_0xff24('0x24')](function(_0x581dba){if(_0x581dba){return _0x581dba[_0xff24('0x5c')]({'UserId':_0x4956ed[_0xff24('0x5b')]['UserId'],'read1stAt':_['isNil'](_0x581dba[_0xff24('0x69')])?moment()[_0xff24('0x6a')](_0xff24('0x63')):undefined});}return null;})['then'](function(_0xcfff2d){if(_0xcfff2d){_0xb51c29[_0xff24('0x6b')]=_0xcfff2d[_0xff24('0x67')]({'plain':!![]});interaction_log['info'](_0xff24('0x6c'),_0x4956ed[_0xff24('0x65')]['id'],_0x4956ed[_0xff24('0x65')][_0xff24('0x3d')],_0x4956ed[_0xff24('0x65')][_0xff24('0x6d')],_0xb51c29[_0xff24('0x6b')]['id'],_0x4956ed[_0xff24('0x5b')]?JSON[_0xff24('0x6e')](_0x4956ed[_0xff24('0x5b')]):_0xff24('0x6f'));return respondWithRpcPromise(_0xff24('0x70'),_0xff24('0x71'),_0xb51c29);}return null;})[_0xff24('0x24')](function(_0x20b494){var _0x5076a1=_0xff24('0x72')+_0x20b494[_0xff24('0x2c')][_0xff24('0x73')];return db[_0xff24('0x74')][_0xff24('0x45')](_0x5076a1,{'type':db[_0xff24('0x75')][_0xff24('0x76')]['SELECT'],'raw':!![]})[_0xff24('0x24')](function(_0xa5000b){return _0xa5000b;});})[_0xff24('0x24')](function(_0x396538){if(_0x396538){_0xb51c29[_0xff24('0x2c')][_0xff24('0x77')]=_0x396538[0x0];if(!_0x4956ed[_0xff24('0x5b')][_0xff24('0x64')])return;return db[_0xff24('0x78')][_0xff24('0x5a')]({'where':{'id':_0x4956ed[_0xff24('0x5b')][_0xff24('0x64')],'role':_0xff24('0x66')},'attributes':['id','name',_0xff24('0x79'),_0xff24('0x7a'),'internal'],'raw':!![]});}return null;})[_0xff24('0x24')](function(_0x143ffe){if(!_0x143ffe)return null;_0xb51c29[_0xff24('0x2c')][_0xff24('0x66')]=_0x143ffe;return _0xb51c29;})['then'](function(_0x3202de){if(_0x3202de){if(_0x4956ed[_0xff24('0x5b')][_0xff24('0x7b')]){_0xb51c29[_0xff24('0x2c')][_0xff24('0x7c')]=util['format'](_0xff24('0x7d'),_0x4956ed['user'][_0xff24('0x3d')]);_0xb51c29[_0xff24('0x2c')][_0xff24('0x7e')]=_0xb51c29[_0xff24('0x7e')];_0xb51c29[_0xff24('0x2c')][_0xff24('0x7f')]=_0xb51c29[_0xff24('0x7e')];_0xb51c29[_0xff24('0x2c')]['event']=_0xff24('0x5f');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_[_0xff24('0x52')](_0xb51c29[_0xff24('0x2c')],JSON[_0xff24('0x80')](_0xb51c29[_0xff24('0x6b')][_0xff24('0x81')]))},client9002)[_0xff24('0x24')](function(){return _0xb51c29;});}return _0xb51c29;}return null;})[_0xff24('0x24')](respondWithResult(_0x28e7f6,null))['catch'](handleError(_0x28e7f6,null));};var interaction_log=require(_0xff24('0x14'))(_0xff24('0x5e'));exports[_0xff24('0x38')]=function(_0x13c9e5,_0x2f3be8,_0x4baab1){var _0xb6419c={'agent':{},'channel':_0xff24('0x60')};if(_0x13c9e5[_0xff24('0x5b')]['id']){delete _0x13c9e5[_0xff24('0x5b')]['id'];}_0x13c9e5['body'][_0xff24('0x64')]=_0x13c9e5[_0xff24('0x5b')][_0xff24('0x64')]||_0x13c9e5[_0xff24('0x65')]['id'];_0xb6419c[_0xff24('0x66')]['id']=_0x13c9e5['body'][_0xff24('0x64')];return db[_0xff24('0x41')][_0xff24('0x5a')]({'where':{'id':_0x13c9e5[_0xff24('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f3be8,null))[_0xff24('0x24')](function(_0x1c8f96){if(_0x1c8f96){_0xb6419c[_0xff24('0x2c')]=_0x1c8f96[_0xff24('0x67')]({'plain':!![]});return db[_0xff24('0x82')][_0xff24('0x5a')]({'where':{'id':_0x1c8f96[_0xff24('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x2f3be8,null))['then'](function(_0x4c5a4b){if(_0x4c5a4b){_0xb6419c['interaction']=_0x4c5a4b[_0xff24('0x67')]({'plain':!![]});interaction_log[_0xff24('0x25')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x13c9e5[_0xff24('0x65')]['id'],_0x13c9e5['user'][_0xff24('0x3d')],_0x13c9e5[_0xff24('0x65')][_0xff24('0x6d')],_0xb6419c[_0xff24('0x6b')]['id'],_0x13c9e5[_0xff24('0x5b')]?JSON[_0xff24('0x6e')](_0x13c9e5[_0xff24('0x5b')]):_0xff24('0x6f'));return respondWithRpcPromise(_0xff24('0x83'),'rejectMessage',_0xb6419c);}return null;})[_0xff24('0x24')](function(_0x53b161){var _0x1ae455=_0xff24('0x72')+_0x53b161[_0xff24('0x2c')]['ContactId'];return db[_0xff24('0x74')]['query'](_0x1ae455,{'type':db[_0xff24('0x75')]['QueryTypes']['SELECT'],'raw':!![]})[_0xff24('0x24')](function(_0x34cfc6){return _0x34cfc6;});})['then'](function(_0x1ddab7){if(_0x1ddab7){_0xb6419c[_0xff24('0x2c')][_0xff24('0x77')]=_0x1ddab7[0x0];if(!_0x13c9e5[_0xff24('0x5b')]['UserId'])return;return db[_0xff24('0x78')]['find']({'where':{'id':_0x13c9e5[_0xff24('0x5b')][_0xff24('0x64')],'role':_0xff24('0x66')},'attributes':['id',_0xff24('0x3d'),_0xff24('0x79'),_0xff24('0x7a'),'internal'],'raw':!![]});}return null;})[_0xff24('0x24')](function(_0x5f3de5){if(!_0x5f3de5)return null;_0xb6419c[_0xff24('0x2c')][_0xff24('0x66')]=_0x5f3de5;return _0xb6419c;})['then'](function(_0x44f2ea){if(_0x44f2ea){_0x44f2ea[_0xff24('0x2c')][_0xff24('0x7c')]=util[_0xff24('0x6a')]('SIP/%s',_0x13c9e5[_0xff24('0x65')][_0xff24('0x3d')]);_0x44f2ea['message'][_0xff24('0x7e')]=_0xb6419c[_0xff24('0x7e')];_0x44f2ea[_0xff24('0x2c')][_0xff24('0x7f')]=_0xb6419c[_0xff24('0x7e')];_0x44f2ea[_0xff24('0x2c')][_0xff24('0x84')]=_0xff24('0x38');respondWithRpcPromise('EventManager',_0xff24('0x85'),{'event':'rejectmessage','message':_[_0xff24('0x52')](_0xb6419c[_0xff24('0x2c')],JSON[_0xff24('0x80')](_0xb6419c['interaction'][_0xff24('0x81')]))},client9002);return _0xb6419c;}return null;})[_0xff24('0x24')](respondWithResult(_0x2f3be8,null))['catch'](handleError(_0x2f3be8,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index dd66bbc..0e2178b 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 _0x9fde=['save','remove','emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x191409,_0x380aa3){var _0x3d2755=function(_0xadc453){while(--_0xadc453){_0x191409['push'](_0x191409['shift']());}};_0x3d2755(++_0x380aa3);}(_0x9fde,0x113));var _0xe9fd=function(_0xf0ec6e,_0xa183d3){_0xf0ec6e=_0xf0ec6e-0x0;var _0x8bbc27=_0x9fde[_0xf0ec6e];return _0x8bbc27;};'use strict';var EventEmitter=require(_0xe9fd('0x0'));var ChatMessage=require(_0xe9fd('0x1'))['db'][_0xe9fd('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe9fd('0x3')](0x0);var events={'afterCreate':_0xe9fd('0x4'),'afterUpdate':'update','afterDestroy':_0xe9fd('0x5')};function emitEvent(_0x4f2a1b){return function(_0x385cb1,_0x4a54a4,_0x539805){ChatMessageEvents[_0xe9fd('0x6')](_0x4f2a1b+':'+_0x385cb1['id'],_0x385cb1);ChatMessageEvents[_0xe9fd('0x6')](_0x4f2a1b,_0x385cb1);_0x539805(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xe9fd('0x7')](e,emitEvent(event));}}module[_0xe9fd('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x6c0f=['events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','exports'];(function(_0x5b984b,_0x355e68){var _0x52e07d=function(_0x5b5064){while(--_0x5b5064){_0x5b984b['push'](_0x5b984b['shift']());}};_0x52e07d(++_0x355e68);}(_0x6c0f,0x19d));var _0xf6c0=function(_0x243aaf,_0x17de07){_0x243aaf=_0x243aaf-0x0;var _0x29133f=_0x6c0f[_0x243aaf];return _0x29133f;};'use strict';var EventEmitter=require(_0xf6c0('0x0'));var ChatMessage=require(_0xf6c0('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf6c0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf6c0('0x3')};function emitEvent(_0x1617e9){return function(_0x5245ca,_0x586ce0,_0x3b1462){ChatMessageEvents[_0xf6c0('0x4')](_0x1617e9+':'+_0x5245ca['id'],_0x5245ca);ChatMessageEvents[_0xf6c0('0x4')](_0x1617e9,_0x5245ca);_0x3b1462(null);};}for(var e in events){if(events[_0xf6c0('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xf6c0('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 40e4277..5700c10 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 _0xb2e8=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatMessage','body','FULLTEXT','models','get','direction','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','toLowerCase','catch','error'];(function(_0xd3e4f0,_0x5197d9){var _0x3e82dd=function(_0x2a14e1){while(--_0x2a14e1){_0xd3e4f0['push'](_0xd3e4f0['shift']());}};_0x3e82dd(++_0x5197d9);}(_0xb2e8,0x1ef));var _0x8b2e=function(_0x266c0d,_0x204d8c){_0x266c0d=_0x266c0d-0x0;var _0x2809b3=_0xb2e8[_0x266c0d];return _0x2809b3;};'use strict';var _=require(_0x8b2e('0x0'));var util=require(_0x8b2e('0x1'));var logger=require(_0x8b2e('0x2'))(_0x8b2e('0x3'));var moment=require('moment');var BPromise=require(_0x8b2e('0x4'));var rp=require(_0x8b2e('0x5'));var fs=require('fs');var path=require(_0x8b2e('0x6'));var rimraf=require(_0x8b2e('0x7'));var config=require(_0x8b2e('0x8'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x4f9c07,_0xdcd4d7){return _0x4f9c07[_0x8b2e('0x9')](_0x8b2e('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x8b2e('0xb')],'type':_0x8b2e('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a207b,_0x321395,_0x515d7b){var _0x206ace=_0x4f9c07[_0x8b2e('0xd')];var _0x20cf6b=_0x5a207b[_0x8b2e('0xe')]({'plain':!![]});if(_0x20cf6b['direction']['toLowerCase']()==='in'||_0x20cf6b[_0x8b2e('0xf')]['toLowerCase']()==='out'&&!_0x20cf6b[_0x8b2e('0x10')]&&!_[_0x8b2e('0x11')](_0x20cf6b[_0x8b2e('0x12')])){_0x206ace[_0x8b2e('0x13')][_0x8b2e('0x14')]({'where':{'id':_0x20cf6b[_0x8b2e('0x15')]}})['then'](function(_0x44d570){if(_0x44d570){_0x44d570[_0x8b2e('0x16')]({'lastMsgAt':_0x20cf6b[_0x8b2e('0x17')],'lastMsgDirection':_0x20cf6b[_0x8b2e('0xf')][_0x8b2e('0x18')]()});}})[_0x8b2e('0x19')](function(_0x4ea870){console[_0x8b2e('0x1a')](_0x4ea870);});}_0x515d7b();}},'charset':_0x8b2e('0x1b'),'collate':_0x8b2e('0x1c')});}; \ No newline at end of file +var _0xcebf=['toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction'];(function(_0xd10f87,_0x23e287){var _0x50769d=function(_0x2e245e){while(--_0x2e245e){_0xd10f87['push'](_0xd10f87['shift']());}};_0x50769d(++_0x23e287);}(_0xcebf,0x1a0));var _0xfceb=function(_0x1beb7f,_0x1a5039){_0x1beb7f=_0x1beb7f-0x0;var _0x7b372f=_0xcebf[_0x1beb7f];return _0x7b372f;};'use strict';var _=require('lodash');var util=require(_0xfceb('0x0'));var logger=require(_0xfceb('0x1'))(_0xfceb('0x2'));var moment=require(_0xfceb('0x3'));var BPromise=require(_0xfceb('0x4'));var rp=require(_0xfceb('0x5'));var fs=require('fs');var path=require(_0xfceb('0x6'));var rimraf=require(_0xfceb('0x7'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0xfceb('0x8')]=function(_0x7cd28d,_0x54b077){return _0x7cd28d[_0xfceb('0x9')](_0xfceb('0xa'),attributes,{'tableName':_0xfceb('0xb'),'paranoid':![],'indexes':[{'name':_0xfceb('0xc'),'fields':[_0xfceb('0xd')],'type':_0xfceb('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4abbae,_0x6c902e,_0x13a2f9){var _0x8ab13=_0x7cd28d[_0xfceb('0xf')];var _0x387da0=_0x4abbae[_0xfceb('0x10')]({'plain':!![]});if(_0x387da0[_0xfceb('0x11')][_0xfceb('0x12')]()==='in'||_0x387da0[_0xfceb('0x11')]['toLowerCase']()===_0xfceb('0x13')&&!_0x387da0[_0xfceb('0x14')]&&!_['isNil'](_0x387da0[_0xfceb('0x15')])){_0x8ab13[_0xfceb('0x16')][_0xfceb('0x17')]({'where':{'id':_0x387da0[_0xfceb('0x18')]}})[_0xfceb('0x19')](function(_0x4aff91){if(_0x4aff91){_0x4aff91[_0xfceb('0x1a')]({'lastMsgAt':_0x387da0['createdAt'],'lastMsgDirection':_0x387da0['direction'][_0xfceb('0x12')]()});}})[_0xfceb('0x1b')](function(_0x462a2b){console[_0xfceb('0x1c')](_0x462a2b);});}_0x13a2f9();}},'charset':_0xfceb('0x1d'),'collate':_0xfceb('0x1e')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 3ba988e..61069cb 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 _0xd349=['raw','CreateChatMessage','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatMessage.socket','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatMessage','body','options'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xd349,0x122));var _0x9d34=function(_0x4c9bad,_0x5f7f1f){_0x4c9bad=_0x4c9bad-0x0;var _0x2e81f3=_0xd349[_0x4c9bad];return _0x2e81f3;};'use strict';var _=require(_0x9d34('0x0'));var util=require('util');var moment=require(_0x9d34('0x1'));var BPromise=require(_0x9d34('0x2'));var rs=require(_0x9d34('0x3'));var fs=require('fs');var Redis=require(_0x9d34('0x4'));var db=require(_0x9d34('0x5'))['db'];var utils=require(_0x9d34('0x6'));var logger=require(_0x9d34('0x7'))(_0x9d34('0x8'));var config=require(_0x9d34('0x9'));var jayson=require(_0x9d34('0xa'));var client=jayson[_0x9d34('0xb')]['http']({'port':0x232a});config[_0x9d34('0xc')]=_[_0x9d34('0xd')](config[_0x9d34('0xc')],{'host':_0x9d34('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9d34('0xf'))['register'](socket);function respondWithRpcPromise(_0x3bfa39,_0x4853f3,_0x7f8e24){return new BPromise(function(_0x5245fe,_0x2840e5){return client['request'](_0x3bfa39,_0x7f8e24)[_0x9d34('0x10')](function(_0x1bf068){logger[_0x9d34('0x11')](_0x9d34('0x12'),_0x4853f3,_0x9d34('0x13'));logger[_0x9d34('0x14')](_0x9d34('0x15'),_0x4853f3,_0x9d34('0x13'),JSON[_0x9d34('0x16')](_0x1bf068));if(_0x1bf068[_0x9d34('0x17')]){if(_0x1bf068['error']['code']===0x1f4){logger[_0x9d34('0x17')](_0x9d34('0x12'),_0x4853f3,_0x1bf068[_0x9d34('0x17')]['message']);return _0x2840e5(_0x1bf068['error'][_0x9d34('0x18')]);}logger[_0x9d34('0x17')]('ChatMessage,\x20%s,\x20%s',_0x4853f3,_0x1bf068['error'][_0x9d34('0x18')]);return _0x5245fe(_0x1bf068[_0x9d34('0x17')]['message']);}else{logger[_0x9d34('0x11')](_0x9d34('0x12'),_0x4853f3,_0x9d34('0x13'));_0x5245fe(_0x1bf068[_0x9d34('0x19')][_0x9d34('0x18')]);}})[_0x9d34('0x1a')](function(_0x5ce4eb){logger[_0x9d34('0x17')](_0x9d34('0x12'),_0x4853f3,_0x5ce4eb);_0x2840e5(_0x5ce4eb);});});}exports['CreateChatMessage']=function(_0x5911ab){var _0x20521b=this;return new Promise(function(_0x1a6431,_0x512d3f){return db[_0x9d34('0x1b')]['create'](_0x5911ab[_0x9d34('0x1c')],{'raw':_0x5911ab[_0x9d34('0x1d')]?_0x5911ab['options'][_0x9d34('0x1e')]===undefined?!![]:![]:!![]})[_0x9d34('0x10')](function(_0x4622d0){logger[_0x9d34('0x11')](_0x9d34('0x1f'),_0x5911ab);logger[_0x9d34('0x14')](_0x9d34('0x1f'),_0x5911ab,JSON[_0x9d34('0x16')](_0x4622d0));_0x1a6431(_0x4622d0);})['catch'](function(_0x4a75cd){logger['error'](_0x9d34('0x1f'),_0x4a75cd[_0x9d34('0x18')],_0x5911ab);_0x512d3f(_0x20521b[_0x9d34('0x17')](0x1f4,_0x4a75cd[_0x9d34('0x18')]));});});}; \ No newline at end of file +var _0x6d84=['debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','ChatMessage','create','body','options','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3423eb,_0x139bdf){var _0x203dba=function(_0x2ef1b8){while(--_0x2ef1b8){_0x3423eb['push'](_0x3423eb['shift']());}};_0x203dba(++_0x139bdf);}(_0x6d84,0x90));var _0x46d8=function(_0x32d71a,_0xa64abd){_0x32d71a=_0x32d71a-0x0;var _0x5e2cb1=_0x6d84[_0x32d71a];return _0x5e2cb1;};'use strict';var _=require(_0x46d8('0x0'));var util=require(_0x46d8('0x1'));var moment=require(_0x46d8('0x2'));var BPromise=require(_0x46d8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46d8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x46d8('0x5'))(_0x46d8('0x6'));var config=require(_0x46d8('0x7'));var jayson=require(_0x46d8('0x8'));var client=jayson[_0x46d8('0x9')][_0x46d8('0xa')]({'port':0x232a});config[_0x46d8('0xb')]=_[_0x46d8('0xc')](config[_0x46d8('0xb')],{'host':_0x46d8('0xd'),'port':0x18eb});var socket=require(_0x46d8('0xe'))(new Redis(config[_0x46d8('0xb')]));require(_0x46d8('0xf'))[_0x46d8('0x10')](socket);function respondWithRpcPromise(_0x216b44,_0x4d2a7b,_0x2a459f){return new BPromise(function(_0x3f0d53,_0x537e63){return client['request'](_0x216b44,_0x2a459f)[_0x46d8('0x11')](function(_0x2056a2){logger[_0x46d8('0x12')](_0x46d8('0x13'),_0x4d2a7b,_0x46d8('0x14'));logger[_0x46d8('0x15')](_0x46d8('0x16'),_0x4d2a7b,'request\x20sent',JSON[_0x46d8('0x17')](_0x2056a2));if(_0x2056a2['error']){if(_0x2056a2[_0x46d8('0x18')][_0x46d8('0x19')]===0x1f4){logger[_0x46d8('0x18')](_0x46d8('0x13'),_0x4d2a7b,_0x2056a2[_0x46d8('0x18')]['message']);return _0x537e63(_0x2056a2[_0x46d8('0x18')][_0x46d8('0x1a')]);}logger[_0x46d8('0x18')](_0x46d8('0x13'),_0x4d2a7b,_0x2056a2[_0x46d8('0x18')]['message']);return _0x3f0d53(_0x2056a2[_0x46d8('0x18')]['message']);}else{logger[_0x46d8('0x12')](_0x46d8('0x13'),_0x4d2a7b,_0x46d8('0x14'));_0x3f0d53(_0x2056a2[_0x46d8('0x1b')][_0x46d8('0x1a')]);}})['catch'](function(_0x33096c){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4d2a7b,_0x33096c);_0x537e63(_0x33096c);});});}exports[_0x46d8('0x1c')]=function(_0x5ad126){var _0x192ad5=this;return new Promise(function(_0xbe3489,_0x1a7570){return db[_0x46d8('0x1d')][_0x46d8('0x1e')](_0x5ad126[_0x46d8('0x1f')],{'raw':_0x5ad126[_0x46d8('0x20')]?_0x5ad126[_0x46d8('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x46d8('0x11')](function(_0x17d720){logger[_0x46d8('0x12')](_0x46d8('0x1c'),_0x5ad126);logger['debug'](_0x46d8('0x1c'),_0x5ad126,JSON[_0x46d8('0x17')](_0x17d720));_0xbe3489(_0x17d720);})['catch'](function(_0x54b55a){logger[_0x46d8('0x18')](_0x46d8('0x1c'),_0x54b55a[_0x46d8('0x1a')],_0x5ad126);_0x1a7570(_0x192ad5[_0x46d8('0x18')](0x1f4,_0x54b55a[_0x46d8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index e9bbc49..c9a0f2a 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 _0xa786=['removeListener','register','length','chatMessage:','remove','update','emit'];(function(_0x7159ee,_0x5665a1){var _0x40e6f0=function(_0x1e2584){while(--_0x1e2584){_0x7159ee['push'](_0x7159ee['shift']());}};_0x40e6f0(++_0x5665a1);}(_0xa786,0x1d2));var _0x6a78=function(_0x5b01a7,_0xa94ab3){_0x5b01a7=_0x5b01a7-0x0;var _0x4518a6=_0xa786[_0x5b01a7];return _0x4518a6;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x6a78('0x0'),_0x6a78('0x1')];function createListener(_0x96d812,_0x2c7e2a){return function(_0x22723f){_0x2c7e2a[_0x6a78('0x2')](_0x96d812,_0x22723f);};}function removeListener(_0x34b520,_0x521b4a){return function(){ChatMessageEvents[_0x6a78('0x3')](_0x34b520,_0x521b4a);};}exports[_0x6a78('0x4')]=function(_0xc0be8b){for(var _0x45470e=0x0,_0x28d286=events[_0x6a78('0x5')];_0x45470e<_0x28d286;_0x45470e++){var _0x2b8c4c=events[_0x45470e];var _0x2a6de6=createListener(_0x6a78('0x6')+_0x2b8c4c,_0xc0be8b);ChatMessageEvents['on'](_0x2b8c4c,_0x2a6de6);}}; \ No newline at end of file +var _0xdd0c=['save','remove','update','emit','removeListener','register','length'];(function(_0x3620a2,_0x345770){var _0x3ecc4f=function(_0x2892d9){while(--_0x2892d9){_0x3620a2['push'](_0x3620a2['shift']());}};_0x3ecc4f(++_0x345770);}(_0xdd0c,0x165));var _0xcdd0=function(_0xd1d583,_0xbe4851){_0xd1d583=_0xd1d583-0x0;var _0x434d34=_0xdd0c[_0xd1d583];return _0x434d34;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xcdd0('0x0'),_0xcdd0('0x1'),_0xcdd0('0x2')];function createListener(_0x5e3ada,_0xe8ed9){return function(_0x5b86cb){_0xe8ed9[_0xcdd0('0x3')](_0x5e3ada,_0x5b86cb);};}function removeListener(_0x159e38,_0x432716){return function(){ChatMessageEvents[_0xcdd0('0x4')](_0x159e38,_0x432716);};}exports[_0xcdd0('0x5')]=function(_0x5ae472){for(var _0x2b33fc=0x0,_0x1b6f5d=events[_0xcdd0('0x6')];_0x2b33fc<_0x1b6f5d;_0x2b33fc++){var _0x15c402=events[_0x2b33fc];var _0x337496=createListener('chatMessage:'+_0x15c402,_0x5ae472);ChatMessageEvents['on'](_0x15c402,_0x337496);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index d519e1d..9f58097 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 _0x33a6=['/describe','/:id','tracked','chat','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index'];(function(_0x1346e5,_0x1620ff){var _0x51a66b=function(_0x280a97){while(--_0x280a97){_0x1346e5['push'](_0x1346e5['shift']());}};_0x51a66b(++_0x1620ff);}(_0x33a6,0x81));var _0x633a=function(_0x8398ce,_0x53a89d){_0x8398ce=_0x8398ce-0x0;var _0x57bc15=_0x33a6[_0x8398ce];return _0x57bc15;};'use strict';var multer=require('multer');var util=require(_0x633a('0x0'));var path=require('path');var timeout=require(_0x633a('0x1'));var express=require('express');var router=express[_0x633a('0x2')]();var fs_extra=require(_0x633a('0x3'));var auth=require(_0x633a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x633a('0x5'));router[_0x633a('0x6')]('/',auth[_0x633a('0x7')](),controller[_0x633a('0x8')]);router[_0x633a('0x6')](_0x633a('0x9'),auth[_0x633a('0x7')](),controller['describe']);router[_0x633a('0x6')](_0x633a('0xa'),auth[_0x633a('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0x633a('0xb')](_0x633a('0xc'),'chatmessage:create'),controller[_0x633a('0xd')]);router[_0x633a('0xe')]('/:id',controller[_0x633a('0xf')]);router[_0x633a('0xe')](_0x633a('0x10'),auth[_0x633a('0x7')](),controller[_0x633a('0x11')]);router[_0x633a('0xe')](_0x633a('0x12'),auth[_0x633a('0x7')](),controller[_0x633a('0x13')]);router[_0x633a('0x14')](_0x633a('0xa'),auth[_0x633a('0x7')](),controller[_0x633a('0x15')]);module[_0x633a('0x16')]=router; \ No newline at end of file +var _0x26d8=['reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','tracked','chat','create','put','/:id/accept','accept','/:id/reject'];(function(_0x359848,_0x4e288e){var _0x3943d2=function(_0x231872){while(--_0x231872){_0x359848['push'](_0x359848['shift']());}};_0x3943d2(++_0x4e288e);}(_0x26d8,0x19b));var _0x826d=function(_0x4df232,_0x1fcd0d){_0x4df232=_0x4df232-0x0;var _0x2b3cad=_0x26d8[_0x4df232];return _0x2b3cad;};'use strict';var multer=require(_0x826d('0x0'));var util=require(_0x826d('0x1'));var path=require(_0x826d('0x2'));var timeout=require(_0x826d('0x3'));var express=require(_0x826d('0x4'));var router=express[_0x826d('0x5')]();var fs_extra=require(_0x826d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x826d('0x7'));router['get']('/',auth[_0x826d('0x8')](),controller[_0x826d('0x9')]);router[_0x826d('0xa')](_0x826d('0xb'),auth[_0x826d('0x8')](),controller[_0x826d('0xc')]);router[_0x826d('0xa')](_0x826d('0xd'),auth[_0x826d('0x8')](),controller['show']);router['post']('/',auth[_0x826d('0x8')](),interaction[_0x826d('0xe')](_0x826d('0xf'),'chatmessage:create'),controller[_0x826d('0x10')]);router['put'](_0x826d('0xd'),controller['update']);router[_0x826d('0x11')](_0x826d('0x12'),auth[_0x826d('0x8')](),controller[_0x826d('0x13')]);router[_0x826d('0x11')](_0x826d('0x14'),auth[_0x826d('0x8')](),controller[_0x826d('0x15')]);router[_0x826d('0x16')](_0x826d('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x826d('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 01a9a74..3dd6186 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(_0x148c38,_0x3f9f5c){var _0x2572f5=function(_0x128879){while(--_0x128879){_0x148c38['push'](_0x148c38['shift']());}};_0x2572f5(++_0x3f9f5c);}(_0xadb5,0xad));var _0x5adb=function(_0x1cf4be,_0x341fb1){_0x1cf4be=_0x1cf4be-0x0;var _0x4b942a=_0xadb5[_0x1cf4be];return _0x4b942a;};'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 _0x0b0e=['medium','sequelize','TEXT'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x0b0e[_0x2ed8f3];return _0x525a55;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 1030225..de4d938 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4e45b7,_0x2b6fbd){var _0x5fd596=function(_0x5e7270){while(--_0x5e7270){_0x4e45b7['push'](_0x4e45b7['shift']());}};_0x5fd596(++_0x2b6fbd);}(_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['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0xcb7f61,_0x1a672c){var _0x5091dc=function(_0x3d9b2d){while(--_0x3d9b2d){_0xcb7f61['push'](_0xcb7f61['shift']());}};_0x5091dc(++_0x1a672c);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index af5ed49..22470cd 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 _0xc319=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','save'];(function(_0x4b871b,_0x571683){var _0x396278=function(_0x559d1f){while(--_0x559d1f){_0x4b871b['push'](_0x4b871b['shift']());}};_0x396278(++_0x571683);}(_0xc319,0x12e));var _0x9c31=function(_0x4b1caa,_0x18fffa){_0x4b1caa=_0x4b1caa-0x0;var _0x29ae17=_0xc319[_0x4b1caa];return _0x29ae17;};'use strict';var EventEmitter=require(_0x9c31('0x0'));var ChatOfflineMessage=require(_0x9c31('0x1'))['db'][_0x9c31('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9c31('0x3'),'afterUpdate':_0x9c31('0x4'),'afterDestroy':'remove'};function emitEvent(_0x953a08){return function(_0x43faca,_0x16ed0c,_0x17d7dc){ChatOfflineMessageEvents['emit'](_0x953a08+':'+_0x43faca['id'],_0x43faca);ChatOfflineMessageEvents[_0x9c31('0x5')](_0x953a08,_0x43faca);_0x17d7dc(null);};}for(var e in events){if(events[_0x9c31('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x9c31('0x7')](e,emitEvent(event));}}module[_0x9c31('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x9c42=['../../mysqldb','ChatOfflineMessage','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x46a728,_0xcb3e1c){var _0xc7dca7=function(_0x5d29ff){while(--_0x5d29ff){_0x46a728['push'](_0x46a728['shift']());}};_0xc7dca7(++_0xcb3e1c);}(_0x9c42,0xf2));var _0x29c4=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0x9c42[_0x52666e];return _0x515330;};'use strict';var EventEmitter=require(_0x29c4('0x0'));var ChatOfflineMessage=require(_0x29c4('0x1'))['db'][_0x29c4('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x29c4('0x3')](0x0);var events={'afterCreate':_0x29c4('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1ea169){return function(_0x2c735d,_0x4d4d68,_0x479b64){ChatOfflineMessageEvents[_0x29c4('0x5')](_0x1ea169+':'+_0x2c735d['id'],_0x2c735d);ChatOfflineMessageEvents[_0x29c4('0x5')](_0x1ea169,_0x2c735d);_0x479b64(null);};}for(var e in events){if(events[_0x29c4('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x29c4('0x7')](e,emitEvent(event));}}module[_0x29c4('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index d861e0a..c4b658f 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 _0x4fec=['ChatOfflineMessage','chat_offline_messages','./chatOfflineMessage.attributes','exports'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x4fec,0x16e));var _0xc4fe=function(_0x4d934b,_0x52f8e9){_0x4d934b=_0x4d934b-0x0;var _0xc0338b=_0x4fec[_0x4d934b];return _0xc0338b;};'use strict';var attributes=require(_0xc4fe('0x0'));module[_0xc4fe('0x1')]=function(_0x5b770f){return _0x5b770f['define'](_0xc4fe('0x2'),attributes,{'tableName':_0xc4fe('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4217=['exports','define','ChatOfflineMessage','chat_offline_messages','./chatOfflineMessage.attributes'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x4217,0x68));var _0x7421=function(_0x2bdf92,_0x481715){_0x2bdf92=_0x2bdf92-0x0;var _0x48ff22=_0x4217[_0x2bdf92];return _0x48ff22;};'use strict';var attributes=require(_0x7421('0x0'));module[_0x7421('0x1')]=function(_0x391aac){return _0x391aac[_0x7421('0x2')](_0x7421('0x3'),attributes,{'tableName':_0x7421('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 5c71ad5..a4ae5f5 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 _0xba06=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0xace953,_0x338468){var _0x5b5c4b=function(_0x2bebce){while(--_0x2bebce){_0xace953['push'](_0xace953['shift']());}};_0x5b5c4b(++_0x338468);}(_0xba06,0xcf));var _0x6ba0=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xba06[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0x6ba0('0x0'));var util=require('util');var moment=require(_0x6ba0('0x1'));var BPromise=require(_0x6ba0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ba0('0x3'));var db=require(_0x6ba0('0x4'))['db'];var utils=require(_0x6ba0('0x5'));var logger=require(_0x6ba0('0x6'))(_0x6ba0('0x7'));var config=require(_0x6ba0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6ba0('0x9')][_0x6ba0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54a963,_0x53779d,_0x2bd1b2){return new BPromise(function(_0xaecd6f,_0x16392b){return client['request'](_0x54a963,_0x2bd1b2)[_0x6ba0('0xb')](function(_0x1bb9a1){logger['info'](_0x6ba0('0xc'),_0x53779d,_0x6ba0('0xd'));logger[_0x6ba0('0xe')](_0x6ba0('0xf'),_0x53779d,_0x6ba0('0xd'),JSON[_0x6ba0('0x10')](_0x1bb9a1));if(_0x1bb9a1[_0x6ba0('0x11')]){if(_0x1bb9a1[_0x6ba0('0x11')][_0x6ba0('0x12')]===0x1f4){logger[_0x6ba0('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x53779d,_0x1bb9a1[_0x6ba0('0x11')][_0x6ba0('0x13')]);return _0x16392b(_0x1bb9a1[_0x6ba0('0x11')][_0x6ba0('0x13')]);}logger[_0x6ba0('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x53779d,_0x1bb9a1['error'][_0x6ba0('0x13')]);return _0xaecd6f(_0x1bb9a1[_0x6ba0('0x11')][_0x6ba0('0x13')]);}else{logger[_0x6ba0('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x53779d,_0x6ba0('0xd'));_0xaecd6f(_0x1bb9a1[_0x6ba0('0x15')][_0x6ba0('0x13')]);}})[_0x6ba0('0x16')](function(_0x3608fb){logger[_0x6ba0('0x11')](_0x6ba0('0xc'),_0x53779d,_0x3608fb);_0x16392b(_0x3608fb);});});} \ No newline at end of file +var _0x2b6d=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x38c596,_0x520267){var _0x1c095f=function(_0x2cbc35){while(--_0x2cbc35){_0x38c596['push'](_0x38c596['shift']());}};_0x1c095f(++_0x520267);}(_0x2b6d,0x1d6));var _0xd2b6=function(_0x2c8749,_0x4d396c){_0x2c8749=_0x2c8749-0x0;var _0x36f666=_0x2b6d[_0x2c8749];return _0x36f666;};'use strict';var _=require(_0xd2b6('0x0'));var util=require(_0xd2b6('0x1'));var moment=require(_0xd2b6('0x2'));var BPromise=require('bluebird');var rs=require(_0xd2b6('0x3'));var fs=require('fs');var Redis=require(_0xd2b6('0x4'));var db=require(_0xd2b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2b6('0x6'))(_0xd2b6('0x7'));var config=require(_0xd2b6('0x8'));var jayson=require(_0xd2b6('0x9'));var client=jayson[_0xd2b6('0xa')][_0xd2b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3af77e,_0x11ffc6,_0x2f43bb){return new BPromise(function(_0x37ba35,_0x577d34){return client[_0xd2b6('0xc')](_0x3af77e,_0x2f43bb)[_0xd2b6('0xd')](function(_0x3f09c8){logger[_0xd2b6('0xe')](_0xd2b6('0xf'),_0x11ffc6,_0xd2b6('0x10'));logger[_0xd2b6('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x11ffc6,_0xd2b6('0x10'),JSON[_0xd2b6('0x12')](_0x3f09c8));if(_0x3f09c8[_0xd2b6('0x13')]){if(_0x3f09c8[_0xd2b6('0x13')][_0xd2b6('0x14')]===0x1f4){logger[_0xd2b6('0x13')](_0xd2b6('0xf'),_0x11ffc6,_0x3f09c8[_0xd2b6('0x13')][_0xd2b6('0x15')]);return _0x577d34(_0x3f09c8['error'][_0xd2b6('0x15')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x11ffc6,_0x3f09c8['error'][_0xd2b6('0x15')]);return _0x37ba35(_0x3f09c8[_0xd2b6('0x13')][_0xd2b6('0x15')]);}else{logger[_0xd2b6('0xe')](_0xd2b6('0xf'),_0x11ffc6,'request\x20sent');_0x37ba35(_0x3f09c8['result'][_0xd2b6('0x15')]);}})[_0xd2b6('0x16')](function(_0x4b73eb){logger[_0xd2b6('0x13')](_0xd2b6('0xf'),_0x11ffc6,_0x4b73eb);_0x577d34(_0x4b73eb);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 8c59f57..5c7a886 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 _0xc11a=['show','put','update','delete','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','/:id'];(function(_0xed065c,_0x49d06a){var _0x4f479e=function(_0x29f473){while(--_0x29f473){_0xed065c['push'](_0xed065c['shift']());}};_0x4f479e(++_0x49d06a);}(_0xc11a,0x18c));var _0xac11=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0xc11a[_0x117f4c];return _0x2b24e9;};'use strict';var multer=require('multer');var util=require(_0xac11('0x0'));var path=require(_0xac11('0x1'));var timeout=require(_0xac11('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xac11('0x3'));var auth=require(_0xac11('0x4'));var interaction=require(_0xac11('0x5'));var config=require(_0xac11('0x6'));var controller=require(_0xac11('0x7'));router[_0xac11('0x8')]('/',auth[_0xac11('0x9')](),controller['index']);router[_0xac11('0x8')]('/describe',auth[_0xac11('0x9')](),controller[_0xac11('0xa')]);router[_0xac11('0x8')](_0xac11('0xb'),auth[_0xac11('0x9')](),controller[_0xac11('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xac11('0xd')](_0xac11('0xb'),auth[_0xac11('0x9')](),controller[_0xac11('0xe')]);router[_0xac11('0xf')](_0xac11('0xb'),auth[_0xac11('0x9')](),controller[_0xac11('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc2c5=['destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','post','create','update','delete'];(function(_0x148f15,_0x166285){var _0x23b9cd=function(_0x143c37){while(--_0x143c37){_0x148f15['push'](_0x148f15['shift']());}};_0x23b9cd(++_0x166285);}(_0xc2c5,0x17e));var _0x5c2c=function(_0x58e84a,_0x57ed90){_0x58e84a=_0x58e84a-0x0;var _0x3b2e7f=_0xc2c5[_0x58e84a];return _0x3b2e7f;};'use strict';var multer=require(_0x5c2c('0x0'));var util=require('util');var path=require(_0x5c2c('0x1'));var timeout=require(_0x5c2c('0x2'));var express=require(_0x5c2c('0x3'));var router=express['Router']();var fs_extra=require(_0x5c2c('0x4'));var auth=require(_0x5c2c('0x5'));var interaction=require(_0x5c2c('0x6'));var config=require(_0x5c2c('0x7'));var controller=require('./chatOfflineMessage.controller');router[_0x5c2c('0x8')]('/',auth[_0x5c2c('0x9')](),controller['index']);router[_0x5c2c('0x8')](_0x5c2c('0xa'),auth['isAuthenticated'](),controller[_0x5c2c('0xb')]);router[_0x5c2c('0x8')](_0x5c2c('0xc'),auth[_0x5c2c('0x9')](),controller['show']);router[_0x5c2c('0xd')]('/',auth[_0x5c2c('0x9')](),controller[_0x5c2c('0xe')]);router['put'](_0x5c2c('0xc'),auth[_0x5c2c('0x9')](),controller[_0x5c2c('0xf')]);router[_0x5c2c('0x10')](_0x5c2c('0xc'),auth[_0x5c2c('0x9')](),controller[_0x5c2c('0x11')]);module[_0x5c2c('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 f528e08..5673b24 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 _0x3353=['ENUM','mouseOver','STRING','INTEGER','exports'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x3353,0x1bc));var _0x3335=function(_0x2128b9,_0x251a83){_0x2128b9=_0x2128b9-0x0;var _0x6b5faa=_0x3353[_0x2128b9];return _0x6b5faa;};'use strict';var Sequelize=require('sequelize');module[_0x3335('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3335('0x1')](_0x3335('0x2'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x3335('0x3')]},'timeout':{'type':Sequelize[_0x3335('0x4')]}}; \ No newline at end of file +var _0x8e60=['ENUM','mouseOver','timeout','STRING','INTEGER','sequelize','exports'];(function(_0x4bc413,_0x36b22d){var _0x155c86=function(_0xe7f17b){while(--_0xe7f17b){_0x4bc413['push'](_0x4bc413['shift']());}};_0x155c86(++_0x36b22d);}(_0x8e60,0x10f));var _0x08e6=function(_0x2fca92,_0x42aa4f){_0x2fca92=_0x2fca92-0x0;var _0x3138c7=_0x8e60[_0x2fca92];return _0x3138c7;};'use strict';var Sequelize=require(_0x08e6('0x0'));module[_0x08e6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x08e6('0x2')](_0x08e6('0x3'),_0x08e6('0x4')),'defaultValue':_0x08e6('0x3')},'selector':{'type':Sequelize[_0x08e6('0x5')]},'timeout':{'type':Sequelize[_0x08e6('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index c232765..9c97668 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 _0xadf0=['moment','bluebird','mustache','path','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xadf0,0x12d));var _0x0adf=function(_0x48d8d9,_0x2dbec9){_0x48d8d9=_0x48d8d9-0x0;var _0x1185ad=_0xadf0[_0x48d8d9];return _0x1185ad;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0adf('0x0'));var zipdir=require(_0x0adf('0x1'));var jsonpatch=require(_0x0adf('0x2'));var rp=require(_0x0adf('0x3'));var moment=require(_0x0adf('0x4'));var BPromise=require(_0x0adf('0x5'));var Mustache=require(_0x0adf('0x6'));var util=require('util');var path=require(_0x0adf('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0adf('0x8'));var squel=require(_0x0adf('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0adf('0xa'));var toCsv=require(_0x0adf('0xb'));var querystring=require('querystring');var Papa=require(_0x0adf('0xc'));var Redis=require(_0x0adf('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x0adf('0xe'));var as=require(_0x0adf('0xf'));var hardwareService=require(_0x0adf('0x10'));var logger=require('../../config/logger')(_0x0adf('0x11'));var utils=require(_0x0adf('0x12'));var config=require(_0x0adf('0x13'));var licenseUtil=require(_0x0adf('0x14'));var db=require(_0x0adf('0x15'))['db'];function respondWithStatusCode(_0x5cff44,_0x3b09f6){_0x3b09f6=_0x3b09f6||0xcc;return function(_0x3bd685){if(_0x3bd685){return _0x5cff44['sendStatus'](_0x3b09f6);}return _0x5cff44[_0x0adf('0x16')](_0x3b09f6)['end']();};}function respondWithResult(_0xb018be,_0x4d4f0d){_0x4d4f0d=_0x4d4f0d||0xc8;return function(_0x75ddac){if(_0x75ddac){return _0xb018be[_0x0adf('0x16')](_0x4d4f0d)[_0x0adf('0x17')](_0x75ddac);}};}function respondWithFilteredResult(_0x232cdc,_0x15dc48){return function(_0x2db0a2){if(_0x2db0a2){var _0x3c60e7=typeof _0x15dc48[_0x0adf('0x18')]==='undefined'&&typeof _0x15dc48[_0x0adf('0x19')]===_0x0adf('0x1a');var _0x4d4561=_0x2db0a2[_0x0adf('0x1b')];var _0x59c3b0=_0x3c60e7?0x0:_0x15dc48[_0x0adf('0x18')];var _0xb51a84=_0x3c60e7?_0x2db0a2[_0x0adf('0x1b')]:_0x15dc48[_0x0adf('0x18')]+_0x15dc48['limit'];var _0x1fe01a;if(_0xb51a84>=_0x4d4561){_0xb51a84=_0x4d4561;_0x1fe01a=0xc8;}else{_0x1fe01a=0xce;}_0x232cdc[_0x0adf('0x16')](_0x1fe01a);return _0x232cdc[_0x0adf('0x1c')](_0x0adf('0x1d'),_0x59c3b0+'-'+_0xb51a84+'/'+_0x4d4561)[_0x0adf('0x17')](_0x2db0a2);}return null;};}function patchUpdates(_0x42f1d6){return function(_0x536782){try{jsonpatch[_0x0adf('0x1e')](_0x536782,_0x42f1d6,!![]);}catch(_0x2deea7){return BPromise[_0x0adf('0x1f')](_0x2deea7);}return _0x536782[_0x0adf('0x20')]();};}function saveUpdates(_0x4d18c0,_0x1c1829){return function(_0xa39e65){if(_0xa39e65){return _0xa39e65[_0x0adf('0x21')](_0x4d18c0)['then'](function(_0x437764){return _0x437764;});}return null;};}function removeEntity(_0x41d0f8,_0x152694){return function(_0x4094ab){if(_0x4094ab){return _0x4094ab[_0x0adf('0x22')]()[_0x0adf('0x23')](function(){_0x41d0f8['status'](0xcc)[_0x0adf('0x24')]();});}};}function handleEntityNotFound(_0x314f00,_0x80f962){return function(_0x39a337){if(!_0x39a337){_0x314f00[_0x0adf('0x25')](0x194);}return _0x39a337;};}function handleError(_0x3cf1c8,_0x4b0076){_0x4b0076=_0x4b0076||0x1f4;return function(_0x306f94){logger[_0x0adf('0x26')](_0x306f94[_0x0adf('0x27')]);if(_0x306f94['name']){delete _0x306f94['name'];}_0x3cf1c8['status'](_0x4b0076)[_0x0adf('0x28')](_0x306f94);};}exports[_0x0adf('0x29')]=function(_0x364fcf,_0x2eb851){var _0x24e62a={'raw':!![],'where':{'id':_0x364fcf[_0x0adf('0x2a')]['id']}},_0x1bef27={};_0x1bef27[_0x0adf('0x2b')]=_[_0x0adf('0x2c')](db[_0x0adf('0x2d')][_0x0adf('0x2e')]);_0x1bef27[_0x0adf('0x2f')]=_[_0x0adf('0x2c')](_0x364fcf[_0x0adf('0x2f')]);_0x1bef27[_0x0adf('0x30')]=_['intersection'](_0x1bef27[_0x0adf('0x2b')],_0x1bef27[_0x0adf('0x2f')]);_0x24e62a[_0x0adf('0x31')]=_[_0x0adf('0x32')](_0x1bef27[_0x0adf('0x2b')],qs[_0x0adf('0x33')](_0x364fcf[_0x0adf('0x2f')]['fields']));_0x24e62a[_0x0adf('0x31')]=_0x24e62a['attributes'][_0x0adf('0x34')]?_0x24e62a[_0x0adf('0x31')]:_0x1bef27[_0x0adf('0x2b')];if(_0x364fcf[_0x0adf('0x2f')][_0x0adf('0x35')]){_0x24e62a[_0x0adf('0x36')]=[{'all':!![]}];}_0x24e62a=_[_0x0adf('0x37')]({},_0x24e62a,_0x364fcf[_0x0adf('0x38')]);return db[_0x0adf('0x2d')]['find'](_0x24e62a)[_0x0adf('0x23')](handleEntityNotFound(_0x2eb851,null))[_0x0adf('0x23')](respondWithResult(_0x2eb851,null))[_0x0adf('0x39')](handleError(_0x2eb851,null));};exports[_0x0adf('0x3a')]=function(_0x2301d0,_0x4cdf07){return db[_0x0adf('0x2d')][_0x0adf('0x3a')](_0x2301d0[_0x0adf('0x3b')],{})[_0x0adf('0x23')](respondWithResult(_0x4cdf07,0xc9))['catch'](handleError(_0x4cdf07,null));};exports['update']=function(_0x38f499,_0x139086){if(_0x38f499[_0x0adf('0x3b')]['id']){delete _0x38f499[_0x0adf('0x3b')]['id'];}return db[_0x0adf('0x2d')]['find']({'where':{'id':_0x38f499['params']['id']}})[_0x0adf('0x23')](handleEntityNotFound(_0x139086,null))[_0x0adf('0x23')](saveUpdates(_0x38f499['body'],null))['then'](respondWithResult(_0x139086,null))[_0x0adf('0x39')](handleError(_0x139086,null));};exports[_0x0adf('0x22')]=function(_0x9d5c10,_0x2b93f7){return db[_0x0adf('0x2d')][_0x0adf('0x3c')]({'where':{'id':_0x9d5c10[_0x0adf('0x2a')]['id']}})[_0x0adf('0x23')](handleEntityNotFound(_0x2b93f7,null))['then'](removeEntity(_0x2b93f7,null))[_0x0adf('0x39')](handleError(_0x2b93f7,null));}; \ No newline at end of file +var _0x269f=['create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','find','catch'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0x269f,0xee));var _0xf269=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x269f[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xf269('0x0'));var rimraf=require(_0xf269('0x1'));var zipdir=require(_0xf269('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf269('0x3'));var moment=require('moment');var BPromise=require(_0xf269('0x4'));var Mustache=require(_0xf269('0x5'));var util=require(_0xf269('0x6'));var path=require(_0xf269('0x7'));var sox=require(_0xf269('0x8'));var csv=require('to-csv');var ejs=require(_0xf269('0x9'));var fs=require('fs');var fs_extra=require(_0xf269('0xa'));var _=require(_0xf269('0xb'));var squel=require(_0xf269('0xc'));var crypto=require(_0xf269('0xd'));var jsforce=require(_0xf269('0xe'));var deskjs=require(_0xf269('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf269('0x10'));var Papa=require(_0xf269('0x11'));var Redis=require(_0xf269('0x12'));var authService=require(_0xf269('0x13'));var qs=require(_0xf269('0x14'));var as=require(_0xf269('0x15'));var hardwareService=require(_0xf269('0x16'));var logger=require(_0xf269('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x194d06,_0x36504a){_0x36504a=_0x36504a||0xcc;return function(_0x396a75){if(_0x396a75){return _0x194d06[_0xf269('0x18')](_0x36504a);}return _0x194d06[_0xf269('0x19')](_0x36504a)[_0xf269('0x1a')]();};}function respondWithResult(_0x2cf3f2,_0x34912d){_0x34912d=_0x34912d||0xc8;return function(_0x3e6198){if(_0x3e6198){return _0x2cf3f2[_0xf269('0x19')](_0x34912d)[_0xf269('0x1b')](_0x3e6198);}};}function respondWithFilteredResult(_0x2bdeb9,_0xfc8d78){return function(_0x2a240a){if(_0x2a240a){var _0x31201c=typeof _0xfc8d78[_0xf269('0x1c')]===_0xf269('0x1d')&&typeof _0xfc8d78[_0xf269('0x1e')]===_0xf269('0x1d');var _0x2910d0=_0x2a240a[_0xf269('0x1f')];var _0x1333ce=_0x31201c?0x0:_0xfc8d78['offset'];var _0x60f3b0=_0x31201c?_0x2a240a[_0xf269('0x1f')]:_0xfc8d78['offset']+_0xfc8d78['limit'];var _0x3a7f06;if(_0x60f3b0>=_0x2910d0){_0x60f3b0=_0x2910d0;_0x3a7f06=0xc8;}else{_0x3a7f06=0xce;}_0x2bdeb9['status'](_0x3a7f06);return _0x2bdeb9[_0xf269('0x20')]('Content-Range',_0x1333ce+'-'+_0x60f3b0+'/'+_0x2910d0)['json'](_0x2a240a);}return null;};}function patchUpdates(_0x4924d4){return function(_0x1d1847){try{jsonpatch[_0xf269('0x21')](_0x1d1847,_0x4924d4,!![]);}catch(_0x4cedf4){return BPromise[_0xf269('0x22')](_0x4cedf4);}return _0x1d1847[_0xf269('0x23')]();};}function saveUpdates(_0x5795cc,_0x9c9c7a){return function(_0x328973){if(_0x328973){return _0x328973[_0xf269('0x24')](_0x5795cc)[_0xf269('0x25')](function(_0x18f0db){return _0x18f0db;});}return null;};}function removeEntity(_0x30d9b0,_0x4d9776){return function(_0x9148c5){if(_0x9148c5){return _0x9148c5[_0xf269('0x26')]()['then'](function(){_0x30d9b0[_0xf269('0x19')](0xcc)[_0xf269('0x1a')]();});}};}function handleEntityNotFound(_0x100ce8,_0x3ac6fc){return function(_0x21e13f){if(!_0x21e13f){_0x100ce8['sendStatus'](0x194);}return _0x21e13f;};}function handleError(_0x523477,_0x9f558d){_0x9f558d=_0x9f558d||0x1f4;return function(_0x4087ef){logger[_0xf269('0x27')](_0x4087ef[_0xf269('0x28')]);if(_0x4087ef[_0xf269('0x29')]){delete _0x4087ef[_0xf269('0x29')];}_0x523477[_0xf269('0x19')](_0x9f558d)['send'](_0x4087ef);};}exports['show']=function(_0xeac015,_0x3e9ab9){var _0x261ccf={'raw':!![],'where':{'id':_0xeac015[_0xf269('0x2a')]['id']}},_0x43d6b8={};_0x43d6b8[_0xf269('0x2b')]=_[_0xf269('0x2c')](db[_0xf269('0x2d')][_0xf269('0x2e')]);_0x43d6b8[_0xf269('0x2f')]=_[_0xf269('0x2c')](_0xeac015[_0xf269('0x2f')]);_0x43d6b8['filters']=_['intersection'](_0x43d6b8[_0xf269('0x2b')],_0x43d6b8['query']);_0x261ccf[_0xf269('0x30')]=_[_0xf269('0x31')](_0x43d6b8[_0xf269('0x2b')],qs[_0xf269('0x32')](_0xeac015['query'][_0xf269('0x32')]));_0x261ccf[_0xf269('0x30')]=_0x261ccf[_0xf269('0x30')][_0xf269('0x33')]?_0x261ccf[_0xf269('0x30')]:_0x43d6b8[_0xf269('0x2b')];if(_0xeac015[_0xf269('0x2f')][_0xf269('0x34')]){_0x261ccf[_0xf269('0x35')]=[{'all':!![]}];}_0x261ccf=_[_0xf269('0x36')]({},_0x261ccf,_0xeac015['options']);return db[_0xf269('0x2d')][_0xf269('0x37')](_0x261ccf)['then'](handleEntityNotFound(_0x3e9ab9,null))['then'](respondWithResult(_0x3e9ab9,null))[_0xf269('0x38')](handleError(_0x3e9ab9,null));};exports[_0xf269('0x39')]=function(_0x5ce9fa,_0x2de42e){return db[_0xf269('0x2d')]['create'](_0x5ce9fa[_0xf269('0x3a')],{})[_0xf269('0x25')](respondWithResult(_0x2de42e,0xc9))[_0xf269('0x38')](handleError(_0x2de42e,null));};exports['update']=function(_0x30ea5e,_0x202103){if(_0x30ea5e[_0xf269('0x3a')]['id']){delete _0x30ea5e[_0xf269('0x3a')]['id'];}return db[_0xf269('0x2d')][_0xf269('0x37')]({'where':{'id':_0x30ea5e['params']['id']}})[_0xf269('0x25')](handleEntityNotFound(_0x202103,null))[_0xf269('0x25')](saveUpdates(_0x30ea5e[_0xf269('0x3a')],null))[_0xf269('0x25')](respondWithResult(_0x202103,null))[_0xf269('0x38')](handleError(_0x202103,null));};exports['destroy']=function(_0x406757,_0x22d0f2){return db[_0xf269('0x2d')][_0xf269('0x37')]({'where':{'id':_0x406757[_0xf269('0x2a')]['id']}})[_0xf269('0x25')](handleEntityNotFound(_0x22d0f2,null))['then'](removeEntity(_0x22d0f2,null))[_0xf269('0x38')](handleError(_0x22d0f2,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 4f59d5d..a4c76cb 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 _0xef81=['../../config/logger','moment','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xef81,0x13e));var _0x1ef8=function(_0xeb3883,_0x1381ff){_0xeb3883=_0xeb3883-0x0;var _0x1f5bb4=_0xef81[_0xeb3883];return _0x1f5bb4;};'use strict';var _=require(_0x1ef8('0x0'));var util=require('util');var logger=require(_0x1ef8('0x1'))('api');var moment=require(_0x1ef8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ef8('0x3'));var rimraf=require(_0x1ef8('0x4'));var config=require(_0x1ef8('0x5'));var attributes=require(_0x1ef8('0x6'));module[_0x1ef8('0x7')]=function(_0x3ea131,_0x2e155b){return _0x3ea131[_0x1ef8('0x8')](_0x1ef8('0x9'),attributes,{'tableName':_0x1ef8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc15b=['exports','define','ChatProactiveAction','lodash','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes'];(function(_0x53e97d,_0x554a9c){var _0x5c77f0=function(_0x2734fc){while(--_0x2734fc){_0x53e97d['push'](_0x53e97d['shift']());}};_0x5c77f0(++_0x554a9c);}(_0xc15b,0x111));var _0xbc15=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xc15b[_0x44a64f];return _0x52024b;};'use strict';var _=require(_0xbc15('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbc15('0x1'));var BPromise=require(_0xbc15('0x2'));var rp=require(_0xbc15('0x3'));var fs=require('fs');var path=require(_0xbc15('0x4'));var rimraf=require(_0xbc15('0x5'));var config=require('../../config/environment');var attributes=require(_0xbc15('0x6'));module[_0xbc15('0x7')]=function(_0x451757,_0x410925){return _0x451757[_0xbc15('0x8')](_0xbc15('0x9'),attributes,{'tableName':'chat_proactive_actions','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 e3cdd37..574a378 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 _0x09de=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x418fde,_0x5b195b){var _0x2eb1ee=function(_0x587ac9){while(--_0x587ac9){_0x418fde['push'](_0x418fde['shift']());}};_0x2eb1ee(++_0x5b195b);}(_0x09de,0x116));var _0xe09d=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x09de[_0x754ab4];return _0x34079a;};'use strict';var _=require(_0xe09d('0x0'));var util=require(_0xe09d('0x1'));var moment=require('moment');var BPromise=require(_0xe09d('0x2'));var rs=require(_0xe09d('0x3'));var fs=require('fs');var Redis=require(_0xe09d('0x4'));var db=require(_0xe09d('0x5'))['db'];var utils=require(_0xe09d('0x6'));var logger=require(_0xe09d('0x7'))(_0xe09d('0x8'));var config=require(_0xe09d('0x9'));var jayson=require(_0xe09d('0xa'));var client=jayson[_0xe09d('0xb')][_0xe09d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c0e05,_0x382933,_0x25c569){return new BPromise(function(_0x387631,_0x41ca59){return client[_0xe09d('0xd')](_0x3c0e05,_0x25c569)[_0xe09d('0xe')](function(_0x5160af){logger[_0xe09d('0xf')](_0xe09d('0x10'),_0x382933,_0xe09d('0x11'));logger[_0xe09d('0x12')](_0xe09d('0x13'),_0x382933,_0xe09d('0x11'),JSON[_0xe09d('0x14')](_0x5160af));if(_0x5160af[_0xe09d('0x15')]){if(_0x5160af[_0xe09d('0x15')][_0xe09d('0x16')]===0x1f4){logger['error'](_0xe09d('0x10'),_0x382933,_0x5160af[_0xe09d('0x15')]['message']);return _0x41ca59(_0x5160af[_0xe09d('0x15')][_0xe09d('0x17')]);}logger[_0xe09d('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x382933,_0x5160af[_0xe09d('0x15')]['message']);return _0x387631(_0x5160af[_0xe09d('0x15')][_0xe09d('0x17')]);}else{logger[_0xe09d('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x382933,_0xe09d('0x11'));_0x387631(_0x5160af[_0xe09d('0x18')]['message']);}})['catch'](function(_0x7ad906){logger[_0xe09d('0x15')](_0xe09d('0x10'),_0x382933,_0x7ad906);_0x41ca59(_0x7ad906);});});} \ No newline at end of file +var _0xe096=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x51de27,_0x3a683f){var _0x2a71f3=function(_0xd8482d){while(--_0xd8482d){_0x51de27['push'](_0x51de27['shift']());}};_0x2a71f3(++_0x3a683f);}(_0xe096,0x1a7));var _0x6e09=function(_0x591db7,_0x150445){_0x591db7=_0x591db7-0x0;var _0x4ad760=_0xe096[_0x591db7];return _0x4ad760;};'use strict';var _=require('lodash');var util=require(_0x6e09('0x0'));var moment=require(_0x6e09('0x1'));var BPromise=require(_0x6e09('0x2'));var rs=require(_0x6e09('0x3'));var fs=require('fs');var Redis=require(_0x6e09('0x4'));var db=require(_0x6e09('0x5'))['db'];var utils=require(_0x6e09('0x6'));var logger=require(_0x6e09('0x7'))(_0x6e09('0x8'));var config=require(_0x6e09('0x9'));var jayson=require(_0x6e09('0xa'));var client=jayson[_0x6e09('0xb')][_0x6e09('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x302004,_0x110ba4,_0x2c0d9b){return new BPromise(function(_0x56a52a,_0x2e59cd){return client['request'](_0x302004,_0x2c0d9b)[_0x6e09('0xd')](function(_0x1ac6b3){logger[_0x6e09('0xe')](_0x6e09('0xf'),_0x110ba4,_0x6e09('0x10'));logger[_0x6e09('0x11')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x110ba4,_0x6e09('0x10'),JSON['stringify'](_0x1ac6b3));if(_0x1ac6b3[_0x6e09('0x12')]){if(_0x1ac6b3[_0x6e09('0x12')][_0x6e09('0x13')]===0x1f4){logger[_0x6e09('0x12')](_0x6e09('0xf'),_0x110ba4,_0x1ac6b3[_0x6e09('0x12')][_0x6e09('0x14')]);return _0x2e59cd(_0x1ac6b3[_0x6e09('0x12')]['message']);}logger[_0x6e09('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x110ba4,_0x1ac6b3[_0x6e09('0x12')][_0x6e09('0x14')]);return _0x56a52a(_0x1ac6b3[_0x6e09('0x12')][_0x6e09('0x14')]);}else{logger[_0x6e09('0xe')](_0x6e09('0xf'),_0x110ba4,_0x6e09('0x10'));_0x56a52a(_0x1ac6b3[_0x6e09('0x15')][_0x6e09('0x14')]);}})[_0x6e09('0x16')](function(_0x2854d3){logger[_0x6e09('0x12')](_0x6e09('0xf'),_0x110ba4,_0x2854d3);_0x2e59cd(_0x2854d3);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 249600e..830cc27 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 _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x397c43,_0x5a0a0b){var _0x37e0bf=function(_0xbd8efa){while(--_0xbd8efa){_0x397c43['push'](_0x397c43['shift']());}};_0x37e0bf(++_0x5a0a0b);}(_0x33c5,0xe6));var _0x533c=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0x33c5[_0x5ec454];return _0x5ebf50;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2dcb13,_0x52a8c0){_0x2dcb13=_0x2dcb13-0x0;var _0x49a562=_0x8d0e[_0x2dcb13];return _0x49a562;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index f561079..f1c68b3 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 _0x72ad=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name','STRING'];(function(_0x48dacd,_0x117421){var _0x2e15d2=function(_0x38195e){while(--_0x38195e){_0x48dacd['push'](_0x48dacd['shift']());}};_0x2e15d2(++_0x117421);}(_0x72ad,0xf8));var _0xd72a=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x72ad[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0xd72a('0x0'));module[_0xd72a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd72a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd72a('0x3')]},'timeout':{'type':Sequelize[_0xd72a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd72a('0x5')](_0xd72a('0x6'),_0xd72a('0x7'),_0xd72a('0x8'))}}; \ No newline at end of file +var _0xb7f9=['name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x311b91,_0x5362f5){var _0x5ce828=function(_0x549c54){while(--_0x549c54){_0x311b91['push'](_0x311b91['shift']());}};_0x5ce828(++_0x5362f5);}(_0xb7f9,0x9f));var _0x9b7f=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0xb7f9[_0x46a38b];return _0x346e75;};'use strict';var Sequelize=require(_0x9b7f('0x0'));module[_0x9b7f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9b7f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9b7f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9b7f('0x4')](_0x9b7f('0x5'),_0x9b7f('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 9dc83d4..a83c9b5 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 _0x0d4c=['sequelize','toString','SELECT','includes','union','compact','value','isEmpty','addAgents','omit','removeAgents','isArray','userChatQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','json','offset','count','limit','reject','update','destroy','UserProfileResource','end','sendStatus','stack','send','index','map','ChatQueue','rawAttributes','type','key','model','name','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','intersection','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','User','findAndCountAll','agent','createdAt','format','%s/%s','SIP','chatPause','updatedAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push'];(function(_0x2f25c9,_0xabd53a){var _0x58c8f8=function(_0x5b45a4){while(--_0x5b45a4){_0x2f25c9['push'](_0x2f25c9['shift']());}};_0x58c8f8(++_0xabd53a);}(_0x0d4c,0x132));var _0xc0d4=function(_0xdb4fcf,_0x388da6){_0xdb4fcf=_0xdb4fcf-0x0;var _0x393525=_0x0d4c[_0xdb4fcf];return _0x393525;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc0d4('0x0'));var zipdir=require(_0xc0d4('0x1'));var jsonpatch=require(_0xc0d4('0x2'));var rp=require(_0xc0d4('0x3'));var moment=require(_0xc0d4('0x4'));var BPromise=require(_0xc0d4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc0d4('0x6'));var csv=require(_0xc0d4('0x7'));var ejs=require(_0xc0d4('0x8'));var fs=require('fs');var fs_extra=require(_0xc0d4('0x9'));var _=require(_0xc0d4('0xa'));var squel=require(_0xc0d4('0xb'));var crypto=require('crypto');var jsforce=require(_0xc0d4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc0d4('0x7'));var querystring=require('querystring');var Papa=require(_0xc0d4('0xd'));var Redis=require(_0xc0d4('0xe'));var authService=require(_0xc0d4('0xf'));var qs=require(_0xc0d4('0x10'));var as=require(_0xc0d4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc0d4('0x12'))(_0xc0d4('0x13'));var utils=require(_0xc0d4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc0d4('0x15'));var db=require(_0xc0d4('0x16'))['db'];config[_0xc0d4('0x17')]=_[_0xc0d4('0x18')](config[_0xc0d4('0x17')],{'host':_0xc0d4('0x19'),'port':0x18eb});var socket=require(_0xc0d4('0x1a'))(new Redis(config[_0xc0d4('0x17')]));require(_0xc0d4('0x1b'))[_0xc0d4('0x1c')](socket);var jayson=require(_0xc0d4('0x1d'));var client=jayson[_0xc0d4('0x1e')][_0xc0d4('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1a0031,_0x454460,_0x283626,_0x340067){return new BPromise(function(_0x46e2bb,_0x94444b){var _0x3b8ba9=_0x340067||client;return _0x3b8ba9[_0xc0d4('0x20')](_0x1a0031,_0x283626)[_0xc0d4('0x21')](function(_0x2184c7){logger['info'](_0xc0d4('0x22'),_0x454460,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x454460,'request\x20sent',JSON[_0xc0d4('0x23')](_0x2184c7));if(_0x2184c7[_0xc0d4('0x24')]){if(_0x2184c7[_0xc0d4('0x24')][_0xc0d4('0x25')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x454460,_0x2184c7[_0xc0d4('0x24')][_0xc0d4('0x26')]);return _0x94444b(_0x2184c7[_0xc0d4('0x24')][_0xc0d4('0x26')]);}logger[_0xc0d4('0x24')](_0xc0d4('0x22'),_0x454460,_0x2184c7[_0xc0d4('0x24')][_0xc0d4('0x26')]);return _0x46e2bb(_0x2184c7[_0xc0d4('0x24')][_0xc0d4('0x26')]);}else{logger['info'](_0xc0d4('0x22'),_0x454460,_0xc0d4('0x27'));_0x46e2bb(_0x2184c7[_0xc0d4('0x28')]['message']);}})[_0xc0d4('0x29')](function(_0xfd2b71){logger[_0xc0d4('0x24')](_0xc0d4('0x22'),_0x454460,_0xfd2b71);_0x94444b(_0xfd2b71);});});}function respondWithStatusCode(_0x46e911,_0x225cc5){_0x225cc5=_0x225cc5||0xcc;return function(_0x1351de){if(_0x1351de){return _0x46e911['sendStatus'](_0x225cc5);}return _0x46e911['status'](_0x225cc5)['end']();};}function respondWithResult(_0x5b4e2a,_0x534fe1){_0x534fe1=_0x534fe1||0xc8;return function(_0x1f0532){if(_0x1f0532){return _0x5b4e2a[_0xc0d4('0x2a')](_0x534fe1)[_0xc0d4('0x2b')](_0x1f0532);}};}function respondWithFilteredResult(_0x4452b5,_0x2481fe){return function(_0x4b4a1d){if(_0x4b4a1d){var _0x2c0ddc=typeof _0x2481fe[_0xc0d4('0x2c')]==='undefined'&&typeof _0x2481fe['limit']==='undefined';var _0x2326d6=_0x4b4a1d[_0xc0d4('0x2d')];var _0x522fbf=_0x2c0ddc?0x0:_0x2481fe['offset'];var _0x220e54=_0x2c0ddc?_0x4b4a1d[_0xc0d4('0x2d')]:_0x2481fe[_0xc0d4('0x2c')]+_0x2481fe[_0xc0d4('0x2e')];var _0x2f97fb;if(_0x220e54>=_0x2326d6){_0x220e54=_0x2326d6;_0x2f97fb=0xc8;}else{_0x2f97fb=0xce;}_0x4452b5['status'](_0x2f97fb);return _0x4452b5['set']('Content-Range',_0x522fbf+'-'+_0x220e54+'/'+_0x2326d6)[_0xc0d4('0x2b')](_0x4b4a1d);}return null;};}function patchUpdates(_0x1924f5){return function(_0x328806){try{jsonpatch['apply'](_0x328806,_0x1924f5,!![]);}catch(_0x5e058f){return BPromise[_0xc0d4('0x2f')](_0x5e058f);}return _0x328806['save']();};}function saveUpdates(_0x2261e2,_0x3b658b){return function(_0x326bc0){if(_0x326bc0){return _0x326bc0[_0xc0d4('0x30')](_0x2261e2)['then'](function(_0x575a10){return _0x575a10;});}return null;};}function removeEntity(_0x44b4f8,_0x33490d){return function(_0x441cd9){if(_0x441cd9){return _0x441cd9[_0xc0d4('0x31')]()['then'](function(){var _0xd53a99=_0x441cd9['get']({'plain':!![]});var _0x25ef9d='ChatQueues';return db[_0xc0d4('0x32')][_0xc0d4('0x31')]({'where':{'type':_0x25ef9d,'resourceId':_0xd53a99['id']}})['then'](function(){return _0x441cd9;});})[_0xc0d4('0x21')](function(){_0x44b4f8[_0xc0d4('0x2a')](0xcc)[_0xc0d4('0x33')]();});}};}function handleEntityNotFound(_0x4aa956,_0x1ebc58){return function(_0x9d0508){if(!_0x9d0508){_0x4aa956[_0xc0d4('0x34')](0x194);}return _0x9d0508;};}function handleError(_0x3943c0,_0x521c45){_0x521c45=_0x521c45||0x1f4;return function(_0x4282a0){logger[_0xc0d4('0x24')](_0x4282a0[_0xc0d4('0x35')]);if(_0x4282a0['name']){delete _0x4282a0['name'];}_0x3943c0['status'](_0x521c45)[_0xc0d4('0x36')](_0x4282a0);};}exports[_0xc0d4('0x37')]=function(_0x3f3457,_0x545057){var _0x36f334={},_0x93482f={},_0x1b2aaa={'count':0x0,'rows':[]};var _0x36f293=_[_0xc0d4('0x38')](db[_0xc0d4('0x39')][_0xc0d4('0x3a')],function(_0xab4852){return{'name':_0xab4852['fieldName'],'type':_0xab4852[_0xc0d4('0x3b')][_0xc0d4('0x3c')]};});_0x93482f[_0xc0d4('0x3d')]=_[_0xc0d4('0x38')](_0x36f293,_0xc0d4('0x3e'));_0x93482f[_0xc0d4('0x3f')]=_[_0xc0d4('0x40')](_0x3f3457['query']);_0x93482f[_0xc0d4('0x41')]=_['intersection'](_0x93482f[_0xc0d4('0x3d')],_0x93482f[_0xc0d4('0x3f')]);_0x36f334[_0xc0d4('0x42')]=_['intersection'](_0x93482f[_0xc0d4('0x3d')],qs[_0xc0d4('0x43')](_0x3f3457[_0xc0d4('0x3f')][_0xc0d4('0x43')]));_0x36f334['attributes']=_0x36f334[_0xc0d4('0x42')][_0xc0d4('0x44')]?_0x36f334[_0xc0d4('0x42')]:_0x93482f['model'];if(!_0x3f3457['query']['hasOwnProperty'](_0xc0d4('0x45'))){_0x36f334[_0xc0d4('0x2e')]=qs[_0xc0d4('0x2e')](_0x3f3457['query']['limit']);_0x36f334[_0xc0d4('0x2c')]=qs['offset'](_0x3f3457[_0xc0d4('0x3f')][_0xc0d4('0x2c')]);}_0x36f334['order']=qs[_0xc0d4('0x46')](_0x3f3457[_0xc0d4('0x3f')][_0xc0d4('0x46')]);_0x36f334[_0xc0d4('0x47')]=qs[_0xc0d4('0x41')](_[_0xc0d4('0x48')](_0x3f3457[_0xc0d4('0x3f')],_0x93482f[_0xc0d4('0x41')]),_0x36f293);if(_0x3f3457[_0xc0d4('0x3f')][_0xc0d4('0x49')]){_0x36f334[_0xc0d4('0x47')]=_[_0xc0d4('0x4a')](_0x36f334[_0xc0d4('0x47')],{'$or':_[_0xc0d4('0x38')](_0x36f293,function(_0xc583b3){if(_0xc583b3[_0xc0d4('0x3b')]!==_0xc0d4('0x4b')){var _0x5e3ebd={};_0x5e3ebd[_0xc583b3[_0xc0d4('0x3e')]]={'$like':'%'+_0x3f3457[_0xc0d4('0x3f')][_0xc0d4('0x49')]+'%'};return _0x5e3ebd;}})});}_0x36f334=_[_0xc0d4('0x4a')]({},_0x36f334,_0x3f3457[_0xc0d4('0x4c')]);var _0x2d58f1={'where':_0x36f334[_0xc0d4('0x47')]};return db[_0xc0d4('0x39')]['count'](_0x2d58f1)[_0xc0d4('0x21')](function(_0x17d267){_0x1b2aaa[_0xc0d4('0x2d')]=_0x17d267;if(_0x3f3457[_0xc0d4('0x3f')]['includeAll']){_0x36f334[_0xc0d4('0x4d')]=[{'all':!![]}];}return db[_0xc0d4('0x39')][_0xc0d4('0x4e')](_0x36f334);})[_0xc0d4('0x21')](function(_0x3d0b6d){_0x1b2aaa[_0xc0d4('0x4f')]=_0x3d0b6d;return _0x1b2aaa;})[_0xc0d4('0x21')](respondWithFilteredResult(_0x545057,_0x36f334))[_0xc0d4('0x29')](handleError(_0x545057,null));};exports['show']=function(_0x28b08c,_0x1c358f){var _0x127c67={'raw':!![],'where':{'id':_0x28b08c['params']['id']}},_0x2c7a6c={};_0x2c7a6c['model']=_[_0xc0d4('0x40')](db[_0xc0d4('0x39')][_0xc0d4('0x3a')]);_0x2c7a6c['query']=_[_0xc0d4('0x40')](_0x28b08c['query']);_0x2c7a6c[_0xc0d4('0x41')]=_['intersection'](_0x2c7a6c['model'],_0x2c7a6c[_0xc0d4('0x3f')]);_0x127c67[_0xc0d4('0x42')]=_[_0xc0d4('0x50')](_0x2c7a6c[_0xc0d4('0x3d')],qs[_0xc0d4('0x43')](_0x28b08c[_0xc0d4('0x3f')]['fields']));_0x127c67[_0xc0d4('0x42')]=_0x127c67['attributes'][_0xc0d4('0x44')]?_0x127c67[_0xc0d4('0x42')]:_0x2c7a6c['model'];if(_0x28b08c[_0xc0d4('0x3f')][_0xc0d4('0x51')]){_0x127c67[_0xc0d4('0x4d')]=[{'all':!![]}];}_0x127c67=_['merge']({},_0x127c67,_0x28b08c[_0xc0d4('0x4c')]);return db['ChatQueue'][_0xc0d4('0x52')](_0x127c67)[_0xc0d4('0x21')](handleEntityNotFound(_0x1c358f,null))[_0xc0d4('0x21')](respondWithResult(_0x1c358f,null))['catch'](handleError(_0x1c358f,null));};exports[_0xc0d4('0x53')]=function(_0x1f8a1b,_0x3b5635){return db[_0xc0d4('0x39')][_0xc0d4('0x53')](_0x1f8a1b[_0xc0d4('0x54')],{})[_0xc0d4('0x21')](function(_0x39e8c1){var _0x197c0a=_0x1f8a1b[_0xc0d4('0x55')][_0xc0d4('0x56')]({'plain':!![]});if(!_0x197c0a)throw new Error(_0xc0d4('0x57'));if(_0x197c0a['role']==='user'){var _0x31019d=_0x39e8c1['get']({'plain':!![]});var _0x423f96=_0xc0d4('0x58');return db[_0xc0d4('0x59')][_0xc0d4('0x52')]({'where':{'name':_0x423f96,'userProfileId':_0x197c0a[_0xc0d4('0x5a')]},'raw':!![]})[_0xc0d4('0x21')](function(_0x596a10){if(_0x596a10&&_0x596a10[_0xc0d4('0x5b')]===0x0){return db[_0xc0d4('0x32')][_0xc0d4('0x53')]({'name':_0x31019d[_0xc0d4('0x3e')],'resourceId':_0x31019d['id'],'type':_0x596a10[_0xc0d4('0x3e')],'sectionId':_0x596a10['id']},{})['then'](function(){return _0x39e8c1;});}else{return _0x39e8c1;}})[_0xc0d4('0x29')](function(_0x481172){logger['error'](_0xc0d4('0x5c'),_0x481172);throw _0x481172;});}return _0x39e8c1;})[_0xc0d4('0x21')](respondWithResult(_0x3b5635,0xc9))['catch'](handleError(_0x3b5635,null));};exports['update']=function(_0x2d3c6c,_0x56e3ad){if(_0x2d3c6c[_0xc0d4('0x54')]['id']){delete _0x2d3c6c[_0xc0d4('0x54')]['id'];}return db[_0xc0d4('0x39')][_0xc0d4('0x52')]({'where':{'id':_0x2d3c6c[_0xc0d4('0x5d')]['id']}})[_0xc0d4('0x21')](handleEntityNotFound(_0x56e3ad,null))['then'](saveUpdates(_0x2d3c6c[_0xc0d4('0x54')],null))[_0xc0d4('0x21')](respondWithResult(_0x56e3ad,null))[_0xc0d4('0x29')](handleError(_0x56e3ad,null));};exports[_0xc0d4('0x31')]=function(_0x4e930d,_0x19343d){return db[_0xc0d4('0x39')][_0xc0d4('0x52')]({'where':{'id':_0x4e930d[_0xc0d4('0x5d')]['id']}})[_0xc0d4('0x21')](handleEntityNotFound(_0x19343d,null))[_0xc0d4('0x21')](removeEntity(_0x19343d,null))[_0xc0d4('0x29')](handleError(_0x19343d,null));};exports[_0xc0d4('0x5e')]=function(_0x44b0ff,_0x4d3d75){return db[_0xc0d4('0x39')][_0xc0d4('0x5e')]()['then'](respondWithResult(_0x4d3d75,null))['catch'](handleError(_0x4d3d75,null));};exports[_0xc0d4('0x5f')]=function(_0x440a43,_0x2ff01d,_0x3aed77){var _0xa3cfba={'raw':!![],'where':{}},_0xe351fc={},_0x2285a4;return db[_0xc0d4('0x39')][_0xc0d4('0x60')]({'where':{'id':_0x440a43['params']['id']}})[_0xc0d4('0x21')](handleEntityNotFound(_0x2ff01d,null))[_0xc0d4('0x21')](function(_0x4e0661){if(_0x4e0661){_0x2285a4=_0x4e0661[_0xc0d4('0x56')]({'plain':!![]});_0xe351fc[_0xc0d4('0x3d')]=_[_0xc0d4('0x40')](db[_0xc0d4('0x61')][_0xc0d4('0x3a')]);_0xe351fc[_0xc0d4('0x3f')]=_[_0xc0d4('0x40')](_0x440a43[_0xc0d4('0x3f')]);_0xe351fc[_0xc0d4('0x41')]=_['intersection'](_0xe351fc[_0xc0d4('0x3d')],_0xe351fc[_0xc0d4('0x3f')]);_0xa3cfba['attributes']=_[_0xc0d4('0x50')](_0xe351fc[_0xc0d4('0x3d')],qs[_0xc0d4('0x43')](_0x440a43[_0xc0d4('0x3f')][_0xc0d4('0x43')]));_0xa3cfba[_0xc0d4('0x42')]=_0xa3cfba[_0xc0d4('0x42')][_0xc0d4('0x44')]?_0xa3cfba[_0xc0d4('0x42')]:_0xe351fc[_0xc0d4('0x3d')];if(!_0x440a43[_0xc0d4('0x3f')][_0xc0d4('0x62')](_0xc0d4('0x45'))){_0xa3cfba[_0xc0d4('0x2e')]=qs[_0xc0d4('0x2e')](_0x440a43['query'][_0xc0d4('0x2e')]);_0xa3cfba[_0xc0d4('0x2c')]=qs[_0xc0d4('0x2c')](_0x440a43[_0xc0d4('0x3f')][_0xc0d4('0x2c')]);}_0xa3cfba['order']=qs['sort'](_0x440a43[_0xc0d4('0x3f')][_0xc0d4('0x46')]);_0xa3cfba[_0xc0d4('0x47')]=qs[_0xc0d4('0x41')](_[_0xc0d4('0x48')](_0x440a43['query'],_0xe351fc[_0xc0d4('0x41')]));_0xa3cfba[_0xc0d4('0x47')][_0xc0d4('0x63')]=_0x4e0661['id'];if(_0x440a43[_0xc0d4('0x3f')][_0xc0d4('0x49')]){_0xa3cfba[_0xc0d4('0x47')]=_[_0xc0d4('0x4a')](_0xa3cfba[_0xc0d4('0x47')],{'$or':_[_0xc0d4('0x38')](_0xa3cfba[_0xc0d4('0x42')],function(_0x55ff11){var _0x66ffda={};_0x66ffda[_0x55ff11]={'$like':'%'+_0x440a43[_0xc0d4('0x3f')][_0xc0d4('0x49')]+'%'};return _0x66ffda;})});}_0xa3cfba=_[_0xc0d4('0x4a')]({},_0xa3cfba,_0x440a43['options']);return db[_0xc0d4('0x61')][_0xc0d4('0x4e')](_0xa3cfba);}})[_0xc0d4('0x21')](function(_0x104dbe){if(_0x104dbe){return db[_0xc0d4('0x64')][_0xc0d4('0x65')]({'where':{'id':_[_0xc0d4('0x38')](_0x104dbe,'UserId'),'role':_0xc0d4('0x66')},'attributes':['id',_0xc0d4('0x3e'),'chatPause','updatedAt',_0xc0d4('0x67')]});}})['then'](function(_0x2513db){if(_0x2513db){return{'count':_0x2513db[_0xc0d4('0x2d')],'rows':_[_0xc0d4('0x38')](_0x2513db[_0xc0d4('0x4f')],function(_0x263855){return{'membername':_0x263855[_0xc0d4('0x3e')],'UserId':_0x263855['id'],'queue_name':_0x2285a4['name'],'ChatQueueId':_0x2285a4['id'],'interface':util[_0xc0d4('0x68')](_0xc0d4('0x69'),_0xc0d4('0x6a'),_0x263855[_0xc0d4('0x3e')]),'penalty':0x0,'paused':_0x263855[_0xc0d4('0x6b')],'createdAt':_0x263855[_0xc0d4('0x67')],'updatedAt':_0x263855[_0xc0d4('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc0d4('0x21')](respondWithFilteredResult(_0x2ff01d,_0xa3cfba))[_0xc0d4('0x29')](handleError(_0x2ff01d,null));};exports['getTeams']=function(_0x38bf08,_0x3f25d8,_0x1b9f4e){var _0x10df9b={};var _0x360eef={};var _0x246e26;var _0x2aa07f;return db[_0xc0d4('0x39')][_0xc0d4('0x60')]({'where':{'id':_0x38bf08[_0xc0d4('0x5d')]['id']}})[_0xc0d4('0x21')](handleEntityNotFound(_0x3f25d8,null))[_0xc0d4('0x21')](function(_0xe8fa31){if(_0xe8fa31){_0x246e26=_0xe8fa31;_0x360eef[_0xc0d4('0x3d')]=_[_0xc0d4('0x40')](db[_0xc0d4('0x6d')]['rawAttributes']);_0x360eef[_0xc0d4('0x3f')]=_['keys'](_0x38bf08[_0xc0d4('0x3f')]);_0x360eef[_0xc0d4('0x41')]=_[_0xc0d4('0x50')](_0x360eef[_0xc0d4('0x3d')],_0x360eef['query']);_0x10df9b[_0xc0d4('0x42')]=_[_0xc0d4('0x50')](_0x360eef[_0xc0d4('0x3d')],qs[_0xc0d4('0x43')](_0x38bf08[_0xc0d4('0x3f')][_0xc0d4('0x43')]));_0x10df9b['attributes']=_0x10df9b[_0xc0d4('0x42')][_0xc0d4('0x44')]?_0x10df9b['attributes']:_0x360eef[_0xc0d4('0x3d')];_0x10df9b['order']=qs[_0xc0d4('0x46')](_0x38bf08['query'][_0xc0d4('0x46')]);_0x10df9b[_0xc0d4('0x47')]=qs[_0xc0d4('0x41')](_[_0xc0d4('0x48')](_0x38bf08[_0xc0d4('0x3f')],_0x360eef['filters']));if(_0x38bf08[_0xc0d4('0x3f')]['filter']){_0x10df9b[_0xc0d4('0x47')]=_[_0xc0d4('0x4a')](_0x10df9b['where'],{'$or':_[_0xc0d4('0x38')](_0x10df9b[_0xc0d4('0x42')],function(_0xdf5f43){var _0x104ae8={};_0x104ae8[_0xdf5f43]={'$like':'%'+_0x38bf08['query'][_0xc0d4('0x49')]+'%'};return _0x104ae8;})});}_0x10df9b=_[_0xc0d4('0x4a')]({},_0x10df9b,_0x38bf08[_0xc0d4('0x4c')]);return _0x246e26[_0xc0d4('0x6e')](_0x10df9b);}})['then'](function(_0x2a783e){if(_0x2a783e){_0x2aa07f=_0x2a783e[_0xc0d4('0x44')];if(!_0x38bf08[_0xc0d4('0x3f')][_0xc0d4('0x62')](_0xc0d4('0x45'))){_0x10df9b[_0xc0d4('0x2e')]=qs['limit'](_0x38bf08['query']['limit']);_0x10df9b[_0xc0d4('0x2c')]=qs[_0xc0d4('0x2c')](_0x38bf08[_0xc0d4('0x3f')]['offset']);}return _0x246e26[_0xc0d4('0x6e')](_0x10df9b);}})['then'](function(_0x5a2abc){if(_0x5a2abc){return _0x5a2abc?{'count':_0x2aa07f,'rows':_0x5a2abc}:null;}})[_0xc0d4('0x21')](respondWithResult(_0x3f25d8,null))[_0xc0d4('0x29')](handleError(_0x3f25d8,null));};exports[_0xc0d4('0x6f')]=function(_0x2749fa,_0x58b057,_0x258e1d){var _0x472a45=_0x2749fa[_0xc0d4('0x54')][_0xc0d4('0x70')];return db[_0xc0d4('0x6d')][_0xc0d4('0x4e')]({'where':{'id':_0x472a45},'attributes':['id'],'include':[{'model':db[_0xc0d4('0x64')],'as':_0xc0d4('0x71'),'attributes':['id',_0xc0d4('0x3e'),_0xc0d4('0x72'),_0xc0d4('0x73'),'interface'],'raw':!![]}]})[_0xc0d4('0x21')](function(_0x3e0349){if(_0x3e0349){var _0x1ce679=_['flatMap'](_0x3e0349,function(_0xcaae30){var _0x324dfe=_0xcaae30['get']({'plain':!![]});return _0x324dfe[_0xc0d4('0x71')];});return db[_0xc0d4('0x39')][_0xc0d4('0x52')]({'where':{'id':_0x2749fa[_0xc0d4('0x5d')]['id']}})[_0xc0d4('0x21')](function(_0x4646fb){return db['sequelize'][_0xc0d4('0x74')](function(_0x12edf3){return _0x4646fb['addTeams'](_0x472a45,{'transaction':_0x12edf3})[_0xc0d4('0x21')](function(){return BPromise[_0xc0d4('0x75')](_0x1ce679,function(_0x3c0c8c){return db['UserChatQueue'][_0xc0d4('0x76')]({'where':{'UserId':_0x3c0c8c['id'],'ChatQueueId':_0x2749fa['params']['id']},'transaction':_0x12edf3});});})[_0xc0d4('0x21')](function(){_0x1ce679[_0xc0d4('0x77')](function(_0x22927d){socket[_0xc0d4('0x78')](_0xc0d4('0x79'),{'UserId':_0x22927d['id'],'ChatQueueId':_0x4646fb['id']});});});});});}})[_0xc0d4('0x21')](respondWithStatusCode(_0x58b057,null))[_0xc0d4('0x29')](handleError(_0x58b057,null));};exports['removeTeams']=function(_0x5de4c2,_0x114ecb,_0x1d5f4d){return db[_0xc0d4('0x6d')][_0xc0d4('0x4e')]({'where':{'id':_0x5de4c2[_0xc0d4('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc0d4('0x71'),'attributes':['id'],'raw':!![]}]})[_0xc0d4('0x21')](handleEntityNotFound(_0x114ecb,null))['then'](function(_0x4fa8d2){var _0x31716d=_[_0xc0d4('0x38')](_0x4fa8d2,'id');var _0xf5f6a6=[];var _0x11ac07=[];var _0x460ee4=squel[_0xc0d4('0x7a')]();_0x460ee4[_0xc0d4('0x7b')](_0xc0d4('0x7c'))[_0xc0d4('0x7d')]('team_has_chat_queues','tq')[_0xc0d4('0x7e')](_0xc0d4('0x7f'),'ut',_0xc0d4('0x80'))[_0xc0d4('0x47')](_0xc0d4('0x81'),_0x5de4c2[_0xc0d4('0x5d')]['id']);for(var _0x8cb17a=0x0;_0x8cb17a<_0x4fa8d2[_0xc0d4('0x44')];_0x8cb17a+=0x1){let _0xe07c99=_0x4fa8d2[_0x8cb17a];for(var _0x32b807=0x0;_0x32b807<_0xe07c99['Agents']['length'];_0x32b807+=0x1){let _0x3afc05=_0xe07c99['Agents'][_0x32b807];var _0x336898=_0x460ee4['clone']();_0x336898[_0xc0d4('0x47')](_0xc0d4('0x82'),_0x3afc05['id']);_0x11ac07[_0xc0d4('0x83')](db[_0xc0d4('0x84')][_0xc0d4('0x3f')](_0x336898[_0xc0d4('0x85')](),{'type':db['sequelize']['QueryTypes'][_0xc0d4('0x86')]})[_0xc0d4('0x21')](function(_0x3a6531){if(_0x3a6531[_0xc0d4('0x44')]===0x1){return _0x3afc05['id'];}else{var _0x57d066=_['every'](_[_0xc0d4('0x38')](_0x3a6531,'TeamId'),function(_0x263e9d){return _[_0xc0d4('0x87')](_0x31716d,_0x263e9d);});if(_0x57d066){return _0x3afc05['id'];}}}));}}return BPromise['all'](_0x11ac07)[_0xc0d4('0x21')](function(_0x5912d6){_0xf5f6a6=_(_0xf5f6a6)[_0xc0d4('0x88')](_0x5912d6)[_0xc0d4('0x89')]()[_0xc0d4('0x8a')]();return db[_0xc0d4('0x39')]['find']({'where':{'id':_0x5de4c2[_0xc0d4('0x5d')]['id']}})[_0xc0d4('0x21')](function(_0x507fb7){return db[_0xc0d4('0x84')]['transaction'](function(_0x54284e){return _0x507fb7['removeTeams'](_0x5de4c2[_0xc0d4('0x3f')][_0xc0d4('0x70')],{'transaction':_0x54284e})['then'](function(){if(!_[_0xc0d4('0x8b')](_0xf5f6a6)){return _0x507fb7['removeAgents'](_0xf5f6a6,{'transaction':_0x54284e});}})[_0xc0d4('0x21')](function(){_0xf5f6a6['forEach'](function(_0x2ce4c1){socket[_0xc0d4('0x78')]('userChatQueue:remove',{'UserId':_0x2ce4c1,'ChatQueueId':_0x507fb7['id']});});});});});});})[_0xc0d4('0x21')](respondWithStatusCode(_0x114ecb,null))[_0xc0d4('0x29')](handleError(_0x114ecb,null));};exports['addAgents']=function(_0x5b9f2d,_0x35a56c,_0x46357a){return db[_0xc0d4('0x39')]['find']({'where':{'id':_0x5b9f2d[_0xc0d4('0x5d')]['id']}})[_0xc0d4('0x21')](handleEntityNotFound(_0x35a56c,null))[_0xc0d4('0x21')](function(_0x385380){if(_0x385380){return _0x385380[_0xc0d4('0x8c')](_0x5b9f2d[_0xc0d4('0x54')][_0xc0d4('0x70')],_[_0xc0d4('0x8d')](_0x5b9f2d[_0xc0d4('0x54')],[_0xc0d4('0x70'),'id'])||{})['spread'](function(_0x1cd8f0){for(var _0x3bc3ab=0x0;_0x3bc3ab<_0x5b9f2d[_0xc0d4('0x54')][_0xc0d4('0x70')][_0xc0d4('0x44')];_0x3bc3ab+=0x1){socket[_0xc0d4('0x78')](_0xc0d4('0x79'),{'UserId':Number(_0x5b9f2d['body'][_0xc0d4('0x70')][_0x3bc3ab]),'ChatQueueId':Number(_0x5b9f2d[_0xc0d4('0x5d')]['id'])});}return _0x1cd8f0;});}})[_0xc0d4('0x21')](respondWithResult(_0x35a56c,null))[_0xc0d4('0x29')](handleError(_0x35a56c,null));};exports[_0xc0d4('0x8e')]=function(_0x14e3ae,_0x37b25c,_0xfdfb89){return db[_0xc0d4('0x39')][_0xc0d4('0x52')]({'where':{'id':_0x14e3ae['params']['id']}})[_0xc0d4('0x21')](handleEntityNotFound(_0x37b25c,null))[_0xc0d4('0x21')](function(_0xfd9d1d){if(_0xfd9d1d){return _0xfd9d1d['removeAgents'](_0x14e3ae[_0xc0d4('0x3f')][_0xc0d4('0x70')])[_0xc0d4('0x21')](function(){if(_[_0xc0d4('0x8f')](_0x14e3ae[_0xc0d4('0x3f')][_0xc0d4('0x70')])){for(var _0x3d1c42=0x0;_0x3d1c42<_0x14e3ae['query'][_0xc0d4('0x70')]['length'];_0x3d1c42+=0x1){socket[_0xc0d4('0x78')]('userChatQueue:remove',{'UserId':Number(_0x14e3ae[_0xc0d4('0x3f')][_0xc0d4('0x70')][_0x3d1c42]),'ChatQueueId':Number(_0x14e3ae[_0xc0d4('0x5d')]['id'])});}}else{socket[_0xc0d4('0x78')](_0xc0d4('0x90'),{'UserId':Number(_0x14e3ae[_0xc0d4('0x3f')][_0xc0d4('0x70')]),'ChatQueueId':Number(_0x14e3ae[_0xc0d4('0x5d')]['id'])});}});}})[_0xc0d4('0x21')](respondWithStatusCode(_0x37b25c,null))[_0xc0d4('0x29')](handleError(_0x37b25c,null));};exports['getAgents']=function(_0x52dc9b,_0x5e6fb0,_0x384b5b){var _0x3098ea={};var _0x46e323={};var _0x44cd4d;var _0xdc846b;return db[_0xc0d4('0x39')][_0xc0d4('0x60')]({'where':{'id':_0x52dc9b[_0xc0d4('0x5d')]['id']}})[_0xc0d4('0x21')](handleEntityNotFound(_0x5e6fb0,null))['then'](function(_0x351993){if(_0x351993){_0x44cd4d=_0x351993;_0x46e323['model']=_[_0xc0d4('0x40')](db['User'][_0xc0d4('0x3a')]);_0x46e323['query']=_['keys'](_0x52dc9b[_0xc0d4('0x3f')]);_0x46e323[_0xc0d4('0x41')]=_[_0xc0d4('0x50')](_0x46e323[_0xc0d4('0x3d')],_0x46e323[_0xc0d4('0x3f')]);_0x3098ea[_0xc0d4('0x42')]=_[_0xc0d4('0x50')](_0x46e323['model'],qs[_0xc0d4('0x43')](_0x52dc9b['query'][_0xc0d4('0x43')]));_0x3098ea[_0xc0d4('0x42')]=_0x3098ea[_0xc0d4('0x42')][_0xc0d4('0x44')]?_0x3098ea['attributes']:_0x46e323[_0xc0d4('0x3d')];_0x3098ea['order']=qs['sort'](_0x52dc9b[_0xc0d4('0x3f')]['sort']);_0x3098ea[_0xc0d4('0x47')]=qs[_0xc0d4('0x41')](_[_0xc0d4('0x48')](_0x52dc9b[_0xc0d4('0x3f')],_0x46e323[_0xc0d4('0x41')]));if(_0x52dc9b['query'][_0xc0d4('0x49')]){_0x3098ea[_0xc0d4('0x47')]=_['merge'](_0x3098ea['where'],{'$or':_[_0xc0d4('0x38')](_0x3098ea['attributes'],function(_0x3380e7){var _0x31c746={};_0x31c746[_0x3380e7]={'$like':'%'+_0x52dc9b['query'][_0xc0d4('0x49')]+'%'};return _0x31c746;})});}_0x3098ea=_[_0xc0d4('0x4a')]({},_0x3098ea,_0x52dc9b[_0xc0d4('0x4c')]);return _0x44cd4d[_0xc0d4('0x91')](_0x3098ea);}})[_0xc0d4('0x21')](function(_0x26f29e){if(_0x26f29e){_0xdc846b=_0x26f29e[_0xc0d4('0x44')];if(!_0x52dc9b[_0xc0d4('0x3f')][_0xc0d4('0x62')]('nolimit')){_0x3098ea[_0xc0d4('0x2e')]=qs[_0xc0d4('0x2e')](_0x52dc9b[_0xc0d4('0x3f')][_0xc0d4('0x2e')]);_0x3098ea['offset']=qs[_0xc0d4('0x2c')](_0x52dc9b['query'][_0xc0d4('0x2c')]);}return _0x44cd4d['getAgents'](_0x3098ea);}})[_0xc0d4('0x21')](function(_0x1db647){if(_0x1db647){return _0x1db647?{'count':_0xdc846b,'rows':_0x1db647}:null;}})['then'](respondWithResult(_0x5e6fb0,null))['catch'](handleError(_0x5e6fb0,null));}; \ No newline at end of file +var _0x1578=['SELECT','every','TeamId','includes','union','compact','value','sequelize','isEmpty','userChatQueue:remove','addAgents','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','catch','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','hasOwnProperty','nolimit','sort','ChatQueueId','UserChatQueue','findAll','findAndCountAll','UserId','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','toString','QueryTypes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1578,0x1e2));var _0x8157=function(_0x21bb59,_0xb9bc94){_0x21bb59=_0x21bb59-0x0;var _0x5205fb=_0x1578[_0x21bb59];return _0x5205fb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8157('0x0'));var jsonpatch=require(_0x8157('0x1'));var rp=require(_0x8157('0x2'));var moment=require(_0x8157('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8157('0x4'));var util=require(_0x8157('0x5'));var path=require(_0x8157('0x6'));var sox=require(_0x8157('0x7'));var csv=require(_0x8157('0x8'));var ejs=require(_0x8157('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8157('0xa'));var squel=require('squel');var crypto=require(_0x8157('0xb'));var jsforce=require(_0x8157('0xc'));var deskjs=require(_0x8157('0xd'));var toCsv=require(_0x8157('0x8'));var querystring=require(_0x8157('0xe'));var Papa=require(_0x8157('0xf'));var Redis=require(_0x8157('0x10'));var authService=require(_0x8157('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8157('0x12'));var logger=require(_0x8157('0x13'))(_0x8157('0x14'));var utils=require(_0x8157('0x15'));var config=require(_0x8157('0x16'));var licenseUtil=require(_0x8157('0x17'));var db=require(_0x8157('0x18'))['db'];config['redis']=_['defaults'](config[_0x8157('0x19')],{'host':_0x8157('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8157('0x1b'))[_0x8157('0x1c')](socket);var jayson=require(_0x8157('0x1d'));var client=jayson[_0x8157('0x1e')][_0x8157('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2fb5af,_0x23bd2e,_0x536547,_0x44dcc4){return new BPromise(function(_0x53ce5c,_0x47cd50){var _0x2e1ad7=_0x44dcc4||client;return _0x2e1ad7[_0x8157('0x20')](_0x2fb5af,_0x536547)[_0x8157('0x21')](function(_0x54e467){logger[_0x8157('0x22')](_0x8157('0x23'),_0x23bd2e,_0x8157('0x24'));logger['debug'](_0x8157('0x25'),_0x23bd2e,_0x8157('0x24'),JSON['stringify'](_0x54e467));if(_0x54e467[_0x8157('0x26')]){if(_0x54e467[_0x8157('0x26')][_0x8157('0x27')]===0x1f4){logger[_0x8157('0x26')](_0x8157('0x23'),_0x23bd2e,_0x54e467['error'][_0x8157('0x28')]);return _0x47cd50(_0x54e467[_0x8157('0x26')][_0x8157('0x28')]);}logger[_0x8157('0x26')](_0x8157('0x23'),_0x23bd2e,_0x54e467[_0x8157('0x26')][_0x8157('0x28')]);return _0x53ce5c(_0x54e467[_0x8157('0x26')][_0x8157('0x28')]);}else{logger[_0x8157('0x22')](_0x8157('0x23'),_0x23bd2e,_0x8157('0x24'));_0x53ce5c(_0x54e467[_0x8157('0x29')]['message']);}})['catch'](function(_0x29592e){logger['error'](_0x8157('0x23'),_0x23bd2e,_0x29592e);_0x47cd50(_0x29592e);});});}function respondWithStatusCode(_0x264e5e,_0x4e9ee2){_0x4e9ee2=_0x4e9ee2||0xcc;return function(_0x1162b8){if(_0x1162b8){return _0x264e5e[_0x8157('0x2a')](_0x4e9ee2);}return _0x264e5e['status'](_0x4e9ee2)[_0x8157('0x2b')]();};}function respondWithResult(_0x522412,_0x2cddc1){_0x2cddc1=_0x2cddc1||0xc8;return function(_0x4f78d9){if(_0x4f78d9){return _0x522412[_0x8157('0x2c')](_0x2cddc1)[_0x8157('0x2d')](_0x4f78d9);}};}function respondWithFilteredResult(_0x4c31f5,_0x12a6fb){return function(_0x19bebe){if(_0x19bebe){var _0x4751fb=typeof _0x12a6fb[_0x8157('0x2e')]===_0x8157('0x2f')&&typeof _0x12a6fb[_0x8157('0x30')]===_0x8157('0x2f');var _0x274315=_0x19bebe['count'];var _0x101cce=_0x4751fb?0x0:_0x12a6fb[_0x8157('0x2e')];var _0x4337be=_0x4751fb?_0x19bebe['count']:_0x12a6fb['offset']+_0x12a6fb[_0x8157('0x30')];var _0x335035;if(_0x4337be>=_0x274315){_0x4337be=_0x274315;_0x335035=0xc8;}else{_0x335035=0xce;}_0x4c31f5[_0x8157('0x2c')](_0x335035);return _0x4c31f5[_0x8157('0x31')](_0x8157('0x32'),_0x101cce+'-'+_0x4337be+'/'+_0x274315)[_0x8157('0x2d')](_0x19bebe);}return null;};}function patchUpdates(_0x5c9378){return function(_0x803ef0){try{jsonpatch['apply'](_0x803ef0,_0x5c9378,!![]);}catch(_0x3c3820){return BPromise[_0x8157('0x33')](_0x3c3820);}return _0x803ef0[_0x8157('0x34')]();};}function saveUpdates(_0x20a2b0,_0x5d2d91){return function(_0x51168d){if(_0x51168d){return _0x51168d['update'](_0x20a2b0)[_0x8157('0x21')](function(_0x5c42d9){return _0x5c42d9;});}return null;};}function removeEntity(_0x57ae9a,_0x4ed63c){return function(_0x3278cf){if(_0x3278cf){return _0x3278cf[_0x8157('0x35')]()[_0x8157('0x21')](function(){var _0x397f6b=_0x3278cf[_0x8157('0x36')]({'plain':!![]});var _0x5588d6=_0x8157('0x37');return db[_0x8157('0x38')][_0x8157('0x35')]({'where':{'type':_0x5588d6,'resourceId':_0x397f6b['id']}})[_0x8157('0x21')](function(){return _0x3278cf;});})[_0x8157('0x21')](function(){_0x57ae9a['status'](0xcc)[_0x8157('0x2b')]();});}};}function handleEntityNotFound(_0x15caac,_0x5abe2f){return function(_0x557be3){if(!_0x557be3){_0x15caac[_0x8157('0x2a')](0x194);}return _0x557be3;};}function handleError(_0x15ca74,_0x27add3){_0x27add3=_0x27add3||0x1f4;return function(_0x39213a){logger[_0x8157('0x26')](_0x39213a[_0x8157('0x39')]);if(_0x39213a[_0x8157('0x3a')]){delete _0x39213a['name'];}_0x15ca74[_0x8157('0x2c')](_0x27add3)[_0x8157('0x3b')](_0x39213a);};}exports['index']=function(_0x6c77d1,_0xdae42a){var _0x5654a0={},_0x285b29={},_0x40229f={'count':0x0,'rows':[]};var _0x5a575b=_[_0x8157('0x3c')](db[_0x8157('0x3d')][_0x8157('0x3e')],function(_0x33d563){return{'name':_0x33d563[_0x8157('0x3f')],'type':_0x33d563[_0x8157('0x40')][_0x8157('0x41')]};});_0x285b29[_0x8157('0x42')]=_['map'](_0x5a575b,_0x8157('0x3a'));_0x285b29[_0x8157('0x43')]=_[_0x8157('0x44')](_0x6c77d1[_0x8157('0x43')]);_0x285b29[_0x8157('0x45')]=_[_0x8157('0x46')](_0x285b29['model'],_0x285b29[_0x8157('0x43')]);_0x5654a0[_0x8157('0x47')]=_[_0x8157('0x46')](_0x285b29[_0x8157('0x42')],qs[_0x8157('0x48')](_0x6c77d1[_0x8157('0x43')]['fields']));_0x5654a0[_0x8157('0x47')]=_0x5654a0[_0x8157('0x47')]['length']?_0x5654a0[_0x8157('0x47')]:_0x285b29[_0x8157('0x42')];if(!_0x6c77d1[_0x8157('0x43')]['hasOwnProperty']('nolimit')){_0x5654a0[_0x8157('0x30')]=qs[_0x8157('0x30')](_0x6c77d1[_0x8157('0x43')][_0x8157('0x30')]);_0x5654a0[_0x8157('0x2e')]=qs[_0x8157('0x2e')](_0x6c77d1[_0x8157('0x43')][_0x8157('0x2e')]);}_0x5654a0[_0x8157('0x49')]=qs['sort'](_0x6c77d1['query']['sort']);_0x5654a0['where']=qs[_0x8157('0x45')](_[_0x8157('0x4a')](_0x6c77d1[_0x8157('0x43')],_0x285b29[_0x8157('0x45')]),_0x5a575b);if(_0x6c77d1['query'][_0x8157('0x4b')]){_0x5654a0[_0x8157('0x4c')]=_[_0x8157('0x4d')](_0x5654a0[_0x8157('0x4c')],{'$or':_['map'](_0x5a575b,function(_0x2c3a02){if(_0x2c3a02[_0x8157('0x40')]!==_0x8157('0x4e')){var _0x5d78a0={};_0x5d78a0[_0x2c3a02[_0x8157('0x3a')]]={'$like':'%'+_0x6c77d1[_0x8157('0x43')][_0x8157('0x4b')]+'%'};return _0x5d78a0;}})});}_0x5654a0=_['merge']({},_0x5654a0,_0x6c77d1[_0x8157('0x4f')]);var _0x25088a={'where':_0x5654a0[_0x8157('0x4c')]};return db['ChatQueue'][_0x8157('0x50')](_0x25088a)[_0x8157('0x21')](function(_0x3495d8){_0x40229f['count']=_0x3495d8;if(_0x6c77d1[_0x8157('0x43')][_0x8157('0x51')]){_0x5654a0[_0x8157('0x52')]=[{'all':!![]}];}return db[_0x8157('0x3d')]['findAll'](_0x5654a0);})[_0x8157('0x21')](function(_0x1340d9){_0x40229f['rows']=_0x1340d9;return _0x40229f;})['then'](respondWithFilteredResult(_0xdae42a,_0x5654a0))[_0x8157('0x53')](handleError(_0xdae42a,null));};exports['show']=function(_0xb6d6df,_0x457e98){var _0x566c28={'raw':!![],'where':{'id':_0xb6d6df[_0x8157('0x54')]['id']}},_0x2b07ba={};_0x2b07ba[_0x8157('0x42')]=_['keys'](db['ChatQueue'][_0x8157('0x3e')]);_0x2b07ba[_0x8157('0x43')]=_[_0x8157('0x44')](_0xb6d6df[_0x8157('0x43')]);_0x2b07ba[_0x8157('0x45')]=_[_0x8157('0x46')](_0x2b07ba['model'],_0x2b07ba[_0x8157('0x43')]);_0x566c28[_0x8157('0x47')]=_['intersection'](_0x2b07ba[_0x8157('0x42')],qs[_0x8157('0x48')](_0xb6d6df[_0x8157('0x43')][_0x8157('0x48')]));_0x566c28[_0x8157('0x47')]=_0x566c28['attributes'][_0x8157('0x55')]?_0x566c28[_0x8157('0x47')]:_0x2b07ba[_0x8157('0x42')];if(_0xb6d6df[_0x8157('0x43')][_0x8157('0x51')]){_0x566c28['include']=[{'all':!![]}];}_0x566c28=_['merge']({},_0x566c28,_0xb6d6df[_0x8157('0x4f')]);return db['ChatQueue']['find'](_0x566c28)[_0x8157('0x21')](handleEntityNotFound(_0x457e98,null))[_0x8157('0x21')](respondWithResult(_0x457e98,null))[_0x8157('0x53')](handleError(_0x457e98,null));};exports[_0x8157('0x56')]=function(_0x478514,_0x3961a8){return db[_0x8157('0x3d')][_0x8157('0x56')](_0x478514[_0x8157('0x57')],{})[_0x8157('0x21')](function(_0x6d343){var _0x403bd2=_0x478514[_0x8157('0x58')][_0x8157('0x36')]({'plain':!![]});if(!_0x403bd2)throw new Error(_0x8157('0x59'));if(_0x403bd2[_0x8157('0x5a')]==='user'){var _0x10f38d=_0x6d343['get']({'plain':!![]});var _0x41f510=_0x8157('0x37');return db[_0x8157('0x5b')][_0x8157('0x5c')]({'where':{'name':_0x41f510,'userProfileId':_0x403bd2[_0x8157('0x5d')]},'raw':!![]})[_0x8157('0x21')](function(_0x5992df){if(_0x5992df&&_0x5992df['autoAssociation']===0x0){return db[_0x8157('0x38')][_0x8157('0x56')]({'name':_0x10f38d[_0x8157('0x3a')],'resourceId':_0x10f38d['id'],'type':_0x5992df['name'],'sectionId':_0x5992df['id']},{})[_0x8157('0x21')](function(){return _0x6d343;});}else{return _0x6d343;}})[_0x8157('0x53')](function(_0x3ee2c7){logger[_0x8157('0x26')](_0x8157('0x5e'),_0x3ee2c7);throw _0x3ee2c7;});}return _0x6d343;})[_0x8157('0x21')](respondWithResult(_0x3961a8,0xc9))[_0x8157('0x53')](handleError(_0x3961a8,null));};exports[_0x8157('0x5f')]=function(_0x428976,_0x141608){if(_0x428976[_0x8157('0x57')]['id']){delete _0x428976[_0x8157('0x57')]['id'];}return db[_0x8157('0x3d')][_0x8157('0x5c')]({'where':{'id':_0x428976[_0x8157('0x54')]['id']}})['then'](handleEntityNotFound(_0x141608,null))[_0x8157('0x21')](saveUpdates(_0x428976[_0x8157('0x57')],null))[_0x8157('0x21')](respondWithResult(_0x141608,null))[_0x8157('0x53')](handleError(_0x141608,null));};exports[_0x8157('0x35')]=function(_0x420d17,_0x21fffd){return db['ChatQueue'][_0x8157('0x5c')]({'where':{'id':_0x420d17[_0x8157('0x54')]['id']}})['then'](handleEntityNotFound(_0x21fffd,null))[_0x8157('0x21')](removeEntity(_0x21fffd,null))[_0x8157('0x53')](handleError(_0x21fffd,null));};exports['describe']=function(_0xe7f9ce,_0x2003e2){return db[_0x8157('0x3d')][_0x8157('0x60')]()[_0x8157('0x21')](respondWithResult(_0x2003e2,null))[_0x8157('0x53')](handleError(_0x2003e2,null));};exports[_0x8157('0x61')]=function(_0x23590d,_0x4c0b33,_0x328e01){var _0x383162={'raw':!![],'where':{}},_0x45a9a6={},_0x35f05b;return db[_0x8157('0x3d')][_0x8157('0x62')]({'where':{'id':_0x23590d['params']['id']}})['then'](handleEntityNotFound(_0x4c0b33,null))[_0x8157('0x21')](function(_0x5c2bb1){if(_0x5c2bb1){_0x35f05b=_0x5c2bb1[_0x8157('0x36')]({'plain':!![]});_0x45a9a6[_0x8157('0x42')]=_[_0x8157('0x44')](db['UserChatQueue'][_0x8157('0x3e')]);_0x45a9a6[_0x8157('0x43')]=_[_0x8157('0x44')](_0x23590d[_0x8157('0x43')]);_0x45a9a6[_0x8157('0x45')]=_[_0x8157('0x46')](_0x45a9a6[_0x8157('0x42')],_0x45a9a6['query']);_0x383162['attributes']=_['intersection'](_0x45a9a6['model'],qs['fields'](_0x23590d[_0x8157('0x43')][_0x8157('0x48')]));_0x383162[_0x8157('0x47')]=_0x383162[_0x8157('0x47')]['length']?_0x383162[_0x8157('0x47')]:_0x45a9a6[_0x8157('0x42')];if(!_0x23590d['query'][_0x8157('0x63')](_0x8157('0x64'))){_0x383162['limit']=qs[_0x8157('0x30')](_0x23590d[_0x8157('0x43')]['limit']);_0x383162[_0x8157('0x2e')]=qs['offset'](_0x23590d[_0x8157('0x43')][_0x8157('0x2e')]);}_0x383162[_0x8157('0x49')]=qs[_0x8157('0x65')](_0x23590d['query'][_0x8157('0x65')]);_0x383162['where']=qs[_0x8157('0x45')](_[_0x8157('0x4a')](_0x23590d['query'],_0x45a9a6[_0x8157('0x45')]));_0x383162[_0x8157('0x4c')][_0x8157('0x66')]=_0x5c2bb1['id'];if(_0x23590d[_0x8157('0x43')][_0x8157('0x4b')]){_0x383162['where']=_[_0x8157('0x4d')](_0x383162[_0x8157('0x4c')],{'$or':_[_0x8157('0x3c')](_0x383162[_0x8157('0x47')],function(_0x14c3ba){var _0x29a05f={};_0x29a05f[_0x14c3ba]={'$like':'%'+_0x23590d[_0x8157('0x43')]['filter']+'%'};return _0x29a05f;})});}_0x383162=_[_0x8157('0x4d')]({},_0x383162,_0x23590d['options']);return db[_0x8157('0x67')][_0x8157('0x68')](_0x383162);}})[_0x8157('0x21')](function(_0x172c01){if(_0x172c01){return db['User'][_0x8157('0x69')]({'where':{'id':_[_0x8157('0x3c')](_0x172c01,_0x8157('0x6a')),'role':'agent'},'attributes':['id',_0x8157('0x3a'),'chatPause',_0x8157('0x6b'),_0x8157('0x6c')]});}})[_0x8157('0x21')](function(_0x54edff){if(_0x54edff){return{'count':_0x54edff[_0x8157('0x50')],'rows':_[_0x8157('0x3c')](_0x54edff[_0x8157('0x6d')],function(_0x3f180e){return{'membername':_0x3f180e[_0x8157('0x3a')],'UserId':_0x3f180e['id'],'queue_name':_0x35f05b[_0x8157('0x3a')],'ChatQueueId':_0x35f05b['id'],'interface':util[_0x8157('0x6e')](_0x8157('0x6f'),_0x8157('0x70'),_0x3f180e[_0x8157('0x3a')]),'penalty':0x0,'paused':_0x3f180e['chatPause'],'createdAt':_0x3f180e[_0x8157('0x6c')],'updatedAt':_0x3f180e[_0x8157('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8157('0x21')](respondWithFilteredResult(_0x4c0b33,_0x383162))['catch'](handleError(_0x4c0b33,null));};exports[_0x8157('0x71')]=function(_0x5b1077,_0x18192e,_0x2c40ae){var _0x5f2e6c={};var _0x3132fa={};var _0x125a7a;var _0x5b1507;return db['ChatQueue'][_0x8157('0x62')]({'where':{'id':_0x5b1077[_0x8157('0x54')]['id']}})[_0x8157('0x21')](handleEntityNotFound(_0x18192e,null))['then'](function(_0x591052){if(_0x591052){_0x125a7a=_0x591052;_0x3132fa[_0x8157('0x42')]=_[_0x8157('0x44')](db[_0x8157('0x72')]['rawAttributes']);_0x3132fa['query']=_['keys'](_0x5b1077[_0x8157('0x43')]);_0x3132fa[_0x8157('0x45')]=_['intersection'](_0x3132fa[_0x8157('0x42')],_0x3132fa[_0x8157('0x43')]);_0x5f2e6c['attributes']=_[_0x8157('0x46')](_0x3132fa[_0x8157('0x42')],qs[_0x8157('0x48')](_0x5b1077[_0x8157('0x43')][_0x8157('0x48')]));_0x5f2e6c[_0x8157('0x47')]=_0x5f2e6c[_0x8157('0x47')][_0x8157('0x55')]?_0x5f2e6c[_0x8157('0x47')]:_0x3132fa['model'];_0x5f2e6c[_0x8157('0x49')]=qs[_0x8157('0x65')](_0x5b1077[_0x8157('0x43')][_0x8157('0x65')]);_0x5f2e6c['where']=qs['filters'](_[_0x8157('0x4a')](_0x5b1077[_0x8157('0x43')],_0x3132fa[_0x8157('0x45')]));if(_0x5b1077[_0x8157('0x43')][_0x8157('0x4b')]){_0x5f2e6c[_0x8157('0x4c')]=_[_0x8157('0x4d')](_0x5f2e6c[_0x8157('0x4c')],{'$or':_[_0x8157('0x3c')](_0x5f2e6c['attributes'],function(_0x5518cd){var _0x42ce53={};_0x42ce53[_0x5518cd]={'$like':'%'+_0x5b1077[_0x8157('0x43')][_0x8157('0x4b')]+'%'};return _0x42ce53;})});}_0x5f2e6c=_['merge']({},_0x5f2e6c,_0x5b1077['options']);return _0x125a7a[_0x8157('0x71')](_0x5f2e6c);}})[_0x8157('0x21')](function(_0x247dbe){if(_0x247dbe){_0x5b1507=_0x247dbe[_0x8157('0x55')];if(!_0x5b1077[_0x8157('0x43')]['hasOwnProperty'](_0x8157('0x64'))){_0x5f2e6c[_0x8157('0x30')]=qs[_0x8157('0x30')](_0x5b1077['query']['limit']);_0x5f2e6c[_0x8157('0x2e')]=qs[_0x8157('0x2e')](_0x5b1077['query'][_0x8157('0x2e')]);}return _0x125a7a[_0x8157('0x71')](_0x5f2e6c);}})['then'](function(_0x19d075){if(_0x19d075){return _0x19d075?{'count':_0x5b1507,'rows':_0x19d075}:null;}})[_0x8157('0x21')](respondWithResult(_0x18192e,null))[_0x8157('0x53')](handleError(_0x18192e,null));};exports[_0x8157('0x73')]=function(_0x4cfd73,_0x48b427,_0x5a118f){var _0xf22283=_0x4cfd73[_0x8157('0x57')][_0x8157('0x74')];return db[_0x8157('0x72')][_0x8157('0x68')]({'where':{'id':_0xf22283},'attributes':['id'],'include':[{'model':db[_0x8157('0x75')],'as':_0x8157('0x76'),'attributes':['id',_0x8157('0x3a'),_0x8157('0x77'),_0x8157('0x78'),_0x8157('0x79')],'raw':!![]}]})['then'](function(_0x2267c7){if(_0x2267c7){var _0x18e9f3=_[_0x8157('0x7a')](_0x2267c7,function(_0x1efff7){var _0x3815d7=_0x1efff7['get']({'plain':!![]});return _0x3815d7['Agents'];});return db[_0x8157('0x3d')][_0x8157('0x5c')]({'where':{'id':_0x4cfd73[_0x8157('0x54')]['id']}})[_0x8157('0x21')](function(_0x591ad2){return db['sequelize'][_0x8157('0x7b')](function(_0x2b2f72){return _0x591ad2[_0x8157('0x73')](_0xf22283,{'transaction':_0x2b2f72})['then'](function(){return BPromise[_0x8157('0x7c')](_0x18e9f3,function(_0x51421b){return db['UserChatQueue'][_0x8157('0x7d')]({'where':{'UserId':_0x51421b['id'],'ChatQueueId':_0x4cfd73[_0x8157('0x54')]['id']},'transaction':_0x2b2f72});});})['then'](function(){_0x18e9f3[_0x8157('0x7e')](function(_0xffd09a){socket[_0x8157('0x7f')](_0x8157('0x80'),{'UserId':_0xffd09a['id'],'ChatQueueId':_0x591ad2['id']});});});});});}})['then'](respondWithStatusCode(_0x48b427,null))[_0x8157('0x53')](handleError(_0x48b427,null));};exports[_0x8157('0x81')]=function(_0x159764,_0x29297f,_0x40b847){return db['Team'][_0x8157('0x68')]({'where':{'id':_0x159764['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x8157('0x75')],'as':_0x8157('0x76'),'attributes':['id'],'raw':!![]}]})[_0x8157('0x21')](handleEntityNotFound(_0x29297f,null))[_0x8157('0x21')](function(_0x5da071){var _0x532d51=_[_0x8157('0x3c')](_0x5da071,'id');var _0x35c24b=[];var _0x2949db=[];var _0x33ed82=squel[_0x8157('0x82')]();_0x33ed82[_0x8157('0x83')](_0x8157('0x84'))[_0x8157('0x85')](_0x8157('0x86'),'tq')[_0x8157('0x87')](_0x8157('0x88'),'ut',_0x8157('0x89'))[_0x8157('0x4c')](_0x8157('0x8a'),_0x159764[_0x8157('0x54')]['id']);for(var _0xbc3199=0x0;_0xbc3199<_0x5da071['length'];_0xbc3199+=0x1){let _0x4e3904=_0x5da071[_0xbc3199];for(var _0x4e1f6f=0x0;_0x4e1f6f<_0x4e3904[_0x8157('0x76')][_0x8157('0x55')];_0x4e1f6f+=0x1){let _0x4b27df=_0x4e3904[_0x8157('0x76')][_0x4e1f6f];var _0xd8a61b=_0x33ed82[_0x8157('0x8b')]();_0xd8a61b[_0x8157('0x4c')]('ut.UserId\x20=\x20?',_0x4b27df['id']);_0x2949db['push'](db['sequelize']['query'](_0xd8a61b[_0x8157('0x8c')](),{'type':db['sequelize'][_0x8157('0x8d')][_0x8157('0x8e')]})['then'](function(_0x2d7e02){if(_0x2d7e02['length']===0x1){return _0x4b27df['id'];}else{var _0x26e026=_[_0x8157('0x8f')](_[_0x8157('0x3c')](_0x2d7e02,_0x8157('0x90')),function(_0x294167){return _[_0x8157('0x91')](_0x532d51,_0x294167);});if(_0x26e026){return _0x4b27df['id'];}}}));}}return BPromise['all'](_0x2949db)['then'](function(_0x1c676b){_0x35c24b=_(_0x35c24b)[_0x8157('0x92')](_0x1c676b)[_0x8157('0x93')]()[_0x8157('0x94')]();return db['ChatQueue'][_0x8157('0x5c')]({'where':{'id':_0x159764[_0x8157('0x54')]['id']}})['then'](function(_0x57ae70){return db[_0x8157('0x95')]['transaction'](function(_0x257fad){return _0x57ae70['removeTeams'](_0x159764[_0x8157('0x43')][_0x8157('0x74')],{'transaction':_0x257fad})[_0x8157('0x21')](function(){if(!_[_0x8157('0x96')](_0x35c24b)){return _0x57ae70['removeAgents'](_0x35c24b,{'transaction':_0x257fad});}})[_0x8157('0x21')](function(){_0x35c24b[_0x8157('0x7e')](function(_0x11ed81){socket[_0x8157('0x7f')](_0x8157('0x97'),{'UserId':_0x11ed81,'ChatQueueId':_0x57ae70['id']});});});});});});})[_0x8157('0x21')](respondWithStatusCode(_0x29297f,null))[_0x8157('0x53')](handleError(_0x29297f,null));};exports[_0x8157('0x98')]=function(_0x32b606,_0x25be80,_0x488ef0){return db['ChatQueue'][_0x8157('0x5c')]({'where':{'id':_0x32b606['params']['id']}})[_0x8157('0x21')](handleEntityNotFound(_0x25be80,null))[_0x8157('0x21')](function(_0x3a1807){if(_0x3a1807){return _0x3a1807['addAgents'](_0x32b606['body']['ids'],_['omit'](_0x32b606['body'],[_0x8157('0x74'),'id'])||{})[_0x8157('0x99')](function(_0x1a8d99){for(var _0x15dff9=0x0;_0x15dff9<_0x32b606[_0x8157('0x57')][_0x8157('0x74')][_0x8157('0x55')];_0x15dff9+=0x1){socket['emit'](_0x8157('0x80'),{'UserId':Number(_0x32b606[_0x8157('0x57')]['ids'][_0x15dff9]),'ChatQueueId':Number(_0x32b606[_0x8157('0x54')]['id'])});}return _0x1a8d99;});}})[_0x8157('0x21')](respondWithResult(_0x25be80,null))[_0x8157('0x53')](handleError(_0x25be80,null));};exports['removeAgents']=function(_0x1b404d,_0x5e64d8,_0x21b870){return db[_0x8157('0x3d')][_0x8157('0x5c')]({'where':{'id':_0x1b404d[_0x8157('0x54')]['id']}})[_0x8157('0x21')](handleEntityNotFound(_0x5e64d8,null))[_0x8157('0x21')](function(_0xc7d872){if(_0xc7d872){return _0xc7d872['removeAgents'](_0x1b404d['query'][_0x8157('0x74')])[_0x8157('0x21')](function(){if(_[_0x8157('0x9a')](_0x1b404d[_0x8157('0x43')][_0x8157('0x74')])){for(var _0x4e6a46=0x0;_0x4e6a46<_0x1b404d[_0x8157('0x43')]['ids'][_0x8157('0x55')];_0x4e6a46+=0x1){socket[_0x8157('0x7f')](_0x8157('0x97'),{'UserId':Number(_0x1b404d['query']['ids'][_0x4e6a46]),'ChatQueueId':Number(_0x1b404d['params']['id'])});}}else{socket[_0x8157('0x7f')](_0x8157('0x97'),{'UserId':Number(_0x1b404d[_0x8157('0x43')]['ids']),'ChatQueueId':Number(_0x1b404d[_0x8157('0x54')]['id'])});}});}})[_0x8157('0x21')](respondWithStatusCode(_0x5e64d8,null))[_0x8157('0x53')](handleError(_0x5e64d8,null));};exports['getAgents']=function(_0x554851,_0x510509,_0x5c57ff){var _0x17f4d0={};var _0x4657a6={};var _0x1de9ff;var _0x2d3c7e;return db[_0x8157('0x3d')][_0x8157('0x62')]({'where':{'id':_0x554851[_0x8157('0x54')]['id']}})[_0x8157('0x21')](handleEntityNotFound(_0x510509,null))[_0x8157('0x21')](function(_0x3f9cbd){if(_0x3f9cbd){_0x1de9ff=_0x3f9cbd;_0x4657a6[_0x8157('0x42')]=_[_0x8157('0x44')](db['User'][_0x8157('0x3e')]);_0x4657a6[_0x8157('0x43')]=_['keys'](_0x554851['query']);_0x4657a6[_0x8157('0x45')]=_['intersection'](_0x4657a6[_0x8157('0x42')],_0x4657a6['query']);_0x17f4d0['attributes']=_[_0x8157('0x46')](_0x4657a6[_0x8157('0x42')],qs[_0x8157('0x48')](_0x554851['query']['fields']));_0x17f4d0['attributes']=_0x17f4d0[_0x8157('0x47')][_0x8157('0x55')]?_0x17f4d0[_0x8157('0x47')]:_0x4657a6[_0x8157('0x42')];_0x17f4d0[_0x8157('0x49')]=qs[_0x8157('0x65')](_0x554851['query'][_0x8157('0x65')]);_0x17f4d0[_0x8157('0x4c')]=qs[_0x8157('0x45')](_[_0x8157('0x4a')](_0x554851[_0x8157('0x43')],_0x4657a6['filters']));if(_0x554851[_0x8157('0x43')]['filter']){_0x17f4d0[_0x8157('0x4c')]=_[_0x8157('0x4d')](_0x17f4d0['where'],{'$or':_[_0x8157('0x3c')](_0x17f4d0[_0x8157('0x47')],function(_0xcce519){var _0x4ef81f={};_0x4ef81f[_0xcce519]={'$like':'%'+_0x554851[_0x8157('0x43')][_0x8157('0x4b')]+'%'};return _0x4ef81f;})});}_0x17f4d0=_[_0x8157('0x4d')]({},_0x17f4d0,_0x554851[_0x8157('0x4f')]);return _0x1de9ff[_0x8157('0x9b')](_0x17f4d0);}})['then'](function(_0x4ac157){if(_0x4ac157){_0x2d3c7e=_0x4ac157[_0x8157('0x55')];if(!_0x554851[_0x8157('0x43')][_0x8157('0x63')](_0x8157('0x64'))){_0x17f4d0[_0x8157('0x30')]=qs[_0x8157('0x30')](_0x554851['query'][_0x8157('0x30')]);_0x17f4d0['offset']=qs[_0x8157('0x2e')](_0x554851[_0x8157('0x43')][_0x8157('0x2e')]);}return _0x1de9ff[_0x8157('0x9b')](_0x17f4d0);}})[_0x8157('0x21')](function(_0x2ef817){if(_0x2ef817){return _0x2ef817?{'count':_0x2d3c7e,'rows':_0x2ef817}:null;}})['then'](respondWithResult(_0x510509,null))[_0x8157('0x53')](handleError(_0x510509,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 7043dd5..cca904d 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 _0x06fc=['emit','hasOwnProperty','hook','exports','ChatQueue','save','remove'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0x06fc,0x14d));var _0xc06f=function(_0x50ce4c,_0x5d55b0){_0x50ce4c=_0x50ce4c-0x0;var _0x8befb1=_0x06fc[_0x50ce4c];return _0x8befb1;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0xc06f('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc06f('0x1'),'afterUpdate':'update','afterDestroy':_0xc06f('0x2')};function emitEvent(_0x1e844f){return function(_0x6b9256,_0x32f353,_0x548aaf){ChatQueueEvents[_0xc06f('0x3')](_0x1e844f+':'+_0x6b9256['id'],_0x6b9256);ChatQueueEvents[_0xc06f('0x3')](_0x1e844f,_0x6b9256);_0x548aaf(null);};}for(var e in events){if(events[_0xc06f('0x4')](e)){var event=events[e];ChatQueue[_0xc06f('0x5')](e,emitEvent(event));}}module[_0xc06f('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0x331c=['../../mysqldb','update','remove','emit','hook','exports'];(function(_0x500bb5,_0x547f7c){var _0x798307=function(_0xe19ba8){while(--_0xe19ba8){_0x500bb5['push'](_0x500bb5['shift']());}};_0x798307(++_0x547f7c);}(_0x331c,0xe4));var _0xc331=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x331c[_0xf50820];return _0x2a9b10;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xc331('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc331('0x1'),'afterDestroy':_0xc331('0x2')};function emitEvent(_0x5b7216){return function(_0x211440,_0x169fcf,_0x434c03){ChatQueueEvents['emit'](_0x5b7216+':'+_0x211440['id'],_0x211440);ChatQueueEvents[_0xc331('0x3')](_0x5b7216,_0x211440);_0x434c03(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xc331('0x4')](e,emitEvent(event));}}module[_0xc331('0x5')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 6830381..70fecf6 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 _0x680f=['define','ChatQueue','chat_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes'];(function(_0x11fbe1,_0x1b092d){var _0x5ada74=function(_0x1ddfa5){while(--_0x1ddfa5){_0x11fbe1['push'](_0x11fbe1['shift']());}};_0x5ada74(++_0x1b092d);}(_0x680f,0x184));var _0xf680=function(_0x34c431,_0x29cce7){_0x34c431=_0x34c431-0x0;var _0x1fa6f4=_0x680f[_0x34c431];return _0x1fa6f4;};'use strict';var _=require(_0xf680('0x0'));var util=require('util');var logger=require(_0xf680('0x1'))('api');var moment=require(_0xf680('0x2'));var BPromise=require(_0xf680('0x3'));var rp=require(_0xf680('0x4'));var fs=require('fs');var path=require(_0xf680('0x5'));var rimraf=require(_0xf680('0x6'));var config=require('../../config/environment');var attributes=require(_0xf680('0x7'));module['exports']=function(_0x5994ab,_0x1788cd){return _0x5994ab[_0xf680('0x8')](_0xf680('0x9'),attributes,{'tableName':_0xf680('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ce2=['bluebird','request-promise','rimraf','../../config/environment','define','ChatQueue','lodash','util','api'];(function(_0x22a52d,_0x44dcef){var _0x366245=function(_0x212039){while(--_0x212039){_0x22a52d['push'](_0x22a52d['shift']());}};_0x366245(++_0x44dcef);}(_0x0ce2,0x84));var _0x20ce=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0ce2[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x20ce('0x0'));var util=require(_0x20ce('0x1'));var logger=require('../../config/logger')(_0x20ce('0x2'));var moment=require('moment');var BPromise=require(_0x20ce('0x3'));var rp=require(_0x20ce('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20ce('0x5'));var config=require(_0x20ce('0x6'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x321e78,_0x3952ed){return _0x321e78[_0x20ce('0x7')](_0x20ce('0x8'),attributes,{'tableName':'chat_queues','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 66cd307..bc4bff0 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 _0xc901=['localhost','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','catch','ShowChatQueue','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x484bbb,_0x1643d9){var _0x275422=function(_0x110516){while(--_0x110516){_0x484bbb['push'](_0x484bbb['shift']());}};_0x275422(++_0x1643d9);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});config[_0x1c90('0x9')]=_[_0x1c90('0xa')](config[_0x1c90('0x9')],{'host':_0x1c90('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c90('0x9')]));require(_0x1c90('0xc'))[_0x1c90('0xd')](socket);function respondWithRpcPromise(_0x1f2c61,_0x374852,_0x66c02){return new BPromise(function(_0x616ad0,_0x3890e1){return client['request'](_0x1f2c61,_0x66c02)['then'](function(_0x17d8ae){logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x374852,'request\x20sent');logger['debug'](_0x1c90('0x10'),_0x374852,_0x1c90('0x11'),JSON['stringify'](_0x17d8ae));if(_0x17d8ae[_0x1c90('0x12')]){if(_0x17d8ae[_0x1c90('0x12')][_0x1c90('0x13')]===0x1f4){logger['error'](_0x1c90('0xf'),_0x374852,_0x17d8ae['error'][_0x1c90('0x14')]);return _0x3890e1(_0x17d8ae[_0x1c90('0x12')][_0x1c90('0x14')]);}logger[_0x1c90('0x12')]('ChatQueue,\x20%s,\x20%s',_0x374852,_0x17d8ae[_0x1c90('0x12')]['message']);return _0x616ad0(_0x17d8ae[_0x1c90('0x12')][_0x1c90('0x14')]);}else{logger['info'](_0x1c90('0xf'),_0x374852,'request\x20sent');_0x616ad0(_0x17d8ae['result'][_0x1c90('0x14')]);}})['catch'](function(_0x341228){logger[_0x1c90('0x12')](_0x1c90('0xf'),_0x374852,_0x341228);_0x3890e1(_0x341228);});});}exports[_0x1c90('0x15')]=function(_0x559097){var _0x1cd89b=this;return new Promise(function(_0x5a9cc0,_0x525997){return db[_0x1c90('0x16')][_0x1c90('0x17')]({'raw':_0x559097['options']?_0x559097[_0x1c90('0x18')][_0x1c90('0x19')]===undefined?!![]:![]:!![],'where':_0x559097[_0x1c90('0x18')]?_0x559097[_0x1c90('0x18')][_0x1c90('0x1a')]||null:null,'attributes':_0x559097[_0x1c90('0x18')]?_0x559097['options'][_0x1c90('0x1b')]||null:null,'limit':_0x559097[_0x1c90('0x18')]?_0x559097[_0x1c90('0x18')][_0x1c90('0x1c')]||null:null,'include':_0x559097[_0x1c90('0x18')]?_0x559097[_0x1c90('0x18')][_0x1c90('0x1d')]?_['map'](_0x559097[_0x1c90('0x18')][_0x1c90('0x1d')],function(_0x3923a9){return{'model':db[_0x3923a9['model']],'as':_0x3923a9['as'],'attributes':_0x3923a9[_0x1c90('0x1b')],'include':_0x3923a9[_0x1c90('0x1d')]?_['map'](_0x3923a9[_0x1c90('0x1d')],function(_0x7e9044){return{'model':db[_0x7e9044['model']],'as':_0x7e9044['as'],'attributes':_0x7e9044[_0x1c90('0x1b')],'include':_0x7e9044[_0x1c90('0x1d')]?_[_0x1c90('0x1e')](_0x7e9044[_0x1c90('0x1d')],function(_0x395edb){return{'model':db[_0x395edb[_0x1c90('0x1f')]],'as':_0x395edb['as'],'attributes':_0x395edb[_0x1c90('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1c90('0x20')](function(_0x52c308){logger[_0x1c90('0xe')](_0x1c90('0x15'),_0x559097);logger[_0x1c90('0x21')](_0x1c90('0x15'),_0x559097,JSON[_0x1c90('0x22')](_0x52c308));_0x5a9cc0(_0x52c308);})[_0x1c90('0x23')](function(_0x32eaf3){logger[_0x1c90('0x12')](_0x1c90('0x15'),_0x32eaf3[_0x1c90('0x14')],_0x559097);_0x525997(_0x1cd89b[_0x1c90('0x12')](0x1f4,_0x32eaf3['message']));});});};exports[_0x1c90('0x24')]=function(_0xb74892){var _0x50ad09=this;return new Promise(function(_0x2b3ba1,_0x5193db){return db[_0x1c90('0x16')]['find']({'raw':_0xb74892[_0x1c90('0x18')]?_0xb74892['options'][_0x1c90('0x19')]===undefined?!![]:![]:!![],'where':_0xb74892[_0x1c90('0x18')]?_0xb74892['options'][_0x1c90('0x1a')]||null:null,'attributes':_0xb74892[_0x1c90('0x18')]?_0xb74892['options'][_0x1c90('0x1b')]||null:null,'include':_0xb74892[_0x1c90('0x18')]?_0xb74892[_0x1c90('0x18')][_0x1c90('0x1d')]?_[_0x1c90('0x1e')](_0xb74892['options']['include'],function(_0x4b5bd6){return{'model':db[_0x4b5bd6['model']],'as':_0x4b5bd6['as'],'attributes':_0x4b5bd6['attributes'],'include':_0x4b5bd6[_0x1c90('0x1d')]?_[_0x1c90('0x1e')](_0x4b5bd6[_0x1c90('0x1d')],function(_0x53d07d){return{'model':db[_0x53d07d[_0x1c90('0x1f')]],'as':_0x53d07d['as'],'attributes':_0x53d07d['attributes'],'include':_0x53d07d[_0x1c90('0x1d')]?_[_0x1c90('0x1e')](_0x53d07d['include'],function(_0x59ddbe){return{'model':db[_0x59ddbe[_0x1c90('0x1f')]],'as':_0x59ddbe['as'],'attributes':_0x59ddbe[_0x1c90('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1c90('0x20')](function(_0x42a730){logger[_0x1c90('0xe')](_0x1c90('0x24'),_0xb74892);logger[_0x1c90('0x21')]('ShowChatQueue',_0xb74892,JSON['stringify'](_0x42a730));_0x2b3ba1(_0x42a730);})[_0x1c90('0x23')](function(_0x221816){logger[_0x1c90('0x12')](_0x1c90('0x24'),_0x221816[_0x1c90('0x14')],_0xb74892);_0x5193db(_0x50ad09[_0x1c90('0x12')](0x1f4,_0x221816[_0x1c90('0x14')]));});});}; \ No newline at end of file +var _0x1e44=['error','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','include','map','model','ShowChatQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1e44,0xb3));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41e4('0x0'));var util=require(_0x41e4('0x1'));var moment=require(_0x41e4('0x2'));var BPromise=require('bluebird');var rs=require(_0x41e4('0x3'));var fs=require('fs');var Redis=require(_0x41e4('0x4'));var db=require(_0x41e4('0x5'))['db'];var utils=require(_0x41e4('0x6'));var logger=require('../../config/logger')(_0x41e4('0x7'));var config=require(_0x41e4('0x8'));var jayson=require(_0x41e4('0x9'));var client=jayson[_0x41e4('0xa')][_0x41e4('0xb')]({'port':0x232a});config[_0x41e4('0xc')]=_[_0x41e4('0xd')](config[_0x41e4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x41e4('0xe'))(new Redis(config[_0x41e4('0xc')]));require(_0x41e4('0xf'))[_0x41e4('0x10')](socket);function respondWithRpcPromise(_0x1afa1c,_0x318431,_0x1e1bd7){return new BPromise(function(_0x45565d,_0x5593cd){return client['request'](_0x1afa1c,_0x1e1bd7)[_0x41e4('0x11')](function(_0x5e8114){logger[_0x41e4('0x12')](_0x41e4('0x13'),_0x318431,_0x41e4('0x14'));logger[_0x41e4('0x15')](_0x41e4('0x16'),_0x318431,_0x41e4('0x14'),JSON[_0x41e4('0x17')](_0x5e8114));if(_0x5e8114['error']){if(_0x5e8114['error'][_0x41e4('0x18')]===0x1f4){logger['error'](_0x41e4('0x13'),_0x318431,_0x5e8114['error'][_0x41e4('0x19')]);return _0x5593cd(_0x5e8114[_0x41e4('0x1a')][_0x41e4('0x19')]);}logger['error'](_0x41e4('0x13'),_0x318431,_0x5e8114[_0x41e4('0x1a')]['message']);return _0x45565d(_0x5e8114[_0x41e4('0x1a')]['message']);}else{logger['info'](_0x41e4('0x13'),_0x318431,_0x41e4('0x14'));_0x45565d(_0x5e8114[_0x41e4('0x1b')][_0x41e4('0x19')]);}})[_0x41e4('0x1c')](function(_0x5ecc5c){logger['error'](_0x41e4('0x13'),_0x318431,_0x5ecc5c);_0x5593cd(_0x5ecc5c);});});}exports[_0x41e4('0x1d')]=function(_0x42230e){var _0x21dba8=this;return new Promise(function(_0xea1550,_0x35b386){return db[_0x41e4('0x1e')][_0x41e4('0x1f')]({'raw':_0x42230e['options']?_0x42230e[_0x41e4('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x42230e[_0x41e4('0x20')]?_0x42230e[_0x41e4('0x20')][_0x41e4('0x21')]||null:null,'attributes':_0x42230e[_0x41e4('0x20')]?_0x42230e[_0x41e4('0x20')][_0x41e4('0x22')]||null:null,'limit':_0x42230e['options']?_0x42230e[_0x41e4('0x20')]['limit']||null:null,'include':_0x42230e[_0x41e4('0x20')]?_0x42230e[_0x41e4('0x20')][_0x41e4('0x23')]?_[_0x41e4('0x24')](_0x42230e[_0x41e4('0x20')][_0x41e4('0x23')],function(_0x46a5d1){return{'model':db[_0x46a5d1[_0x41e4('0x25')]],'as':_0x46a5d1['as'],'attributes':_0x46a5d1[_0x41e4('0x22')],'include':_0x46a5d1[_0x41e4('0x23')]?_[_0x41e4('0x24')](_0x46a5d1[_0x41e4('0x23')],function(_0x1b33e8){return{'model':db[_0x1b33e8[_0x41e4('0x25')]],'as':_0x1b33e8['as'],'attributes':_0x1b33e8[_0x41e4('0x22')],'include':_0x1b33e8[_0x41e4('0x23')]?_[_0x41e4('0x24')](_0x1b33e8[_0x41e4('0x23')],function(_0xff795e){return{'model':db[_0xff795e[_0x41e4('0x25')]],'as':_0xff795e['as'],'attributes':_0xff795e[_0x41e4('0x22')]};}):[]};}):[]};}):[]:[]})[_0x41e4('0x11')](function(_0x46ba7c){logger[_0x41e4('0x12')]('GetChatQueue',_0x42230e);logger[_0x41e4('0x15')](_0x41e4('0x1d'),_0x42230e,JSON[_0x41e4('0x17')](_0x46ba7c));_0xea1550(_0x46ba7c);})[_0x41e4('0x1c')](function(_0x111c8e){logger[_0x41e4('0x1a')](_0x41e4('0x1d'),_0x111c8e['message'],_0x42230e);_0x35b386(_0x21dba8[_0x41e4('0x1a')](0x1f4,_0x111c8e[_0x41e4('0x19')]));});});};exports[_0x41e4('0x26')]=function(_0x5ee29e){var _0x43324c=this;return new Promise(function(_0x3a7520,_0x130ad0){return db['ChatQueue'][_0x41e4('0x27')]({'raw':_0x5ee29e[_0x41e4('0x20')]?_0x5ee29e[_0x41e4('0x20')][_0x41e4('0x28')]===undefined?!![]:![]:!![],'where':_0x5ee29e['options']?_0x5ee29e[_0x41e4('0x20')][_0x41e4('0x21')]||null:null,'attributes':_0x5ee29e[_0x41e4('0x20')]?_0x5ee29e[_0x41e4('0x20')][_0x41e4('0x22')]||null:null,'include':_0x5ee29e['options']?_0x5ee29e[_0x41e4('0x20')][_0x41e4('0x23')]?_[_0x41e4('0x24')](_0x5ee29e[_0x41e4('0x20')]['include'],function(_0x2831b7){return{'model':db[_0x2831b7[_0x41e4('0x25')]],'as':_0x2831b7['as'],'attributes':_0x2831b7[_0x41e4('0x22')],'include':_0x2831b7[_0x41e4('0x23')]?_['map'](_0x2831b7['include'],function(_0x5ef1c1){return{'model':db[_0x5ef1c1[_0x41e4('0x25')]],'as':_0x5ef1c1['as'],'attributes':_0x5ef1c1[_0x41e4('0x22')],'include':_0x5ef1c1['include']?_[_0x41e4('0x24')](_0x5ef1c1['include'],function(_0x4e73ac){return{'model':db[_0x4e73ac[_0x41e4('0x25')]],'as':_0x4e73ac['as'],'attributes':_0x4e73ac[_0x41e4('0x22')]};}):[]};}):[]};}):[]:[]})[_0x41e4('0x11')](function(_0x3de587){logger[_0x41e4('0x12')](_0x41e4('0x26'),_0x5ee29e);logger[_0x41e4('0x15')](_0x41e4('0x26'),_0x5ee29e,JSON[_0x41e4('0x17')](_0x3de587));_0x3a7520(_0x3de587);})['catch'](function(_0x51018a){logger['error'](_0x41e4('0x26'),_0x51018a['message'],_0x5ee29e);_0x130ad0(_0x43324c[_0x41e4('0x1a')](0x1f4,_0x51018a['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index ef3cbe5..37b4e5b 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 _0x4ea3=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x1a6a2c,_0x262aad){var _0x469627=function(_0x2392b5){while(--_0x2392b5){_0x1a6a2c['push'](_0x1a6a2c['shift']());}};_0x469627(++_0x262aad);}(_0x4ea3,0x70));var _0x34ea=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4ea3[_0x618414];return _0x21c19a;};'use strict';var ChatQueueEvents=require(_0x34ea('0x0'));var events=[_0x34ea('0x1'),_0x34ea('0x2'),_0x34ea('0x3')];function createListener(_0x588172,_0x374ec1){return function(_0x494b56){_0x374ec1[_0x34ea('0x4')](_0x588172,_0x494b56);};}function removeListener(_0x571f1b,_0x5e5a84){return function(){ChatQueueEvents[_0x34ea('0x5')](_0x571f1b,_0x5e5a84);};}exports[_0x34ea('0x6')]=function(_0x962596){for(var _0x123d48=0x0,_0x40434e=events[_0x34ea('0x7')];_0x123d48<_0x40434e;_0x123d48++){var _0x22b09e=events[_0x123d48];var _0x5bec7c=createListener(_0x34ea('0x8')+_0x22b09e,_0x962596);ChatQueueEvents['on'](_0x22b09e,_0x5bec7c);}}; \ No newline at end of file +var _0x0faf=['update','emit','removeListener','length','chatQueue:','./chatQueue.events','remove'];(function(_0x148f22,_0x5a5572){var _0x50ccfa=function(_0x22492f){while(--_0x22492f){_0x148f22['push'](_0x148f22['shift']());}};_0x50ccfa(++_0x5a5572);}(_0x0faf,0x132));var _0xf0fa=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0x0faf[_0x4aa838];return _0x3abff0;};'use strict';var ChatQueueEvents=require(_0xf0fa('0x0'));var events=['save',_0xf0fa('0x1'),_0xf0fa('0x2')];function createListener(_0x2c6207,_0x35a260){return function(_0xccb93e){_0x35a260[_0xf0fa('0x3')](_0x2c6207,_0xccb93e);};}function removeListener(_0x515b12,_0xc83253){return function(){ChatQueueEvents[_0xf0fa('0x4')](_0x515b12,_0xc83253);};}exports['register']=function(_0x3637a3){for(var _0x44ffa0=0x0,_0x25b5c4=events[_0xf0fa('0x5')];_0x44ffa0<_0x25b5c4;_0x44ffa0++){var _0x2db1d9=events[_0x44ffa0];var _0x587865=createListener(_0xf0fa('0x6')+_0x2db1d9,_0x3637a3);ChatQueueEvents['on'](_0x2db1d9,_0x587865);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 771fb25..a3934b5 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x5fc3,0xa8));var _0x35fc=function(_0x437d7f,_0x1feb46){_0x437d7f=_0x437d7f-0x0;var _0x31058c=_0x5fc3[_0x437d7f];return _0x31058c;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x206d66,_0x4c48e0){var _0x5c63db=function(_0x22fd00){while(--_0x22fd00){_0x206d66['push'](_0x206d66['shift']());}};_0x5c63db(++_0x4c48e0);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index a7d3b9f..c439711 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 _0x6bbb=['moment','STRING','DATE'];(function(_0x47dcb1,_0x2e7067){var _0x532b9f=function(_0x1f3fb5){while(--_0x1f3fb5){_0x47dcb1['push'](_0x47dcb1['shift']());}};_0x532b9f(++_0x2e7067);}(_0x6bbb,0x153));var _0xb6bb=function(_0x3005d5,_0xf588c7){_0x3005d5=_0x3005d5-0x0;var _0x547c7e=_0x6bbb[_0x3005d5];return _0x547c7e;};'use strict';var moment=require(_0xb6bb('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb6bb('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xb6bb('0x1')]},'joinAt':{'type':Sequelize[_0xb6bb('0x2')]},'leaveAt':{'type':Sequelize[_0xb6bb('0x2')]},'acceptAt':{'type':Sequelize[_0xb6bb('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb6bb('0x1')]}}; \ No newline at end of file +var _0xd619=['exports','STRING','DATE','moment','sequelize'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd619,0x18e));var _0x9d61=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xd619[_0x2f45ea];return _0x485a84;};'use strict';var moment=require(_0x9d61('0x0'));var Sequelize=require(_0x9d61('0x1'));module[_0x9d61('0x2')]={'uniqueid':{'type':Sequelize[_0x9d61('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9d61('0x3')]},'joinAt':{'type':Sequelize[_0x9d61('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9d61('0x4')]},'exitAt':{'type':Sequelize[_0x9d61('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index d683de3..96b5704 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 _0xe062=['show','params','keys','options','find','body','update','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','end','status','offset','limit','count','set','Content-Range','json','apply','then','destroy','sendStatus','error','name','index','map','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatQueueReport','includeAll','include','findAll','rows','catch'];(function(_0x4947f0,_0x138314){var _0x11ad58=function(_0x563cf1){while(--_0x563cf1){_0x4947f0['push'](_0x4947f0['shift']());}};_0x11ad58(++_0x138314);}(_0xe062,0x1b8));var _0x2e06=function(_0x368e84,_0x2cee37){_0x368e84=_0x368e84-0x0;var _0x47f13a=_0xe062[_0x368e84];return _0x47f13a;};'use strict';var emlformat=require(_0x2e06('0x0'));var rimraf=require(_0x2e06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2e06('0x2'));var moment=require(_0x2e06('0x3'));var BPromise=require(_0x2e06('0x4'));var Mustache=require(_0x2e06('0x5'));var util=require(_0x2e06('0x6'));var path=require(_0x2e06('0x7'));var sox=require(_0x2e06('0x8'));var csv=require(_0x2e06('0x9'));var ejs=require(_0x2e06('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(_0x2e06('0xb'));var deskjs=require(_0x2e06('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e06('0xd'));var Redis=require(_0x2e06('0xe'));var authService=require(_0x2e06('0xf'));var qs=require(_0x2e06('0x10'));var as=require(_0x2e06('0x11'));var hardwareService=require(_0x2e06('0x12'));var logger=require(_0x2e06('0x13'))(_0x2e06('0x14'));var utils=require(_0x2e06('0x15'));var config=require(_0x2e06('0x16'));var licenseUtil=require(_0x2e06('0x17'));var db=require(_0x2e06('0x18'))['db'];function respondWithStatusCode(_0x54d0f8,_0x37504e){_0x37504e=_0x37504e||0xcc;return function(_0x733017){if(_0x733017){return _0x54d0f8['sendStatus'](_0x37504e);}return _0x54d0f8['status'](_0x37504e)[_0x2e06('0x19')]();};}function respondWithResult(_0x45d9a7,_0x4d8ff3){_0x4d8ff3=_0x4d8ff3||0xc8;return function(_0x48d757){if(_0x48d757){return _0x45d9a7[_0x2e06('0x1a')](_0x4d8ff3)['json'](_0x48d757);}};}function respondWithFilteredResult(_0x4935b3,_0x982729){return function(_0xb1dfa9){if(_0xb1dfa9){var _0x501a19=typeof _0x982729[_0x2e06('0x1b')]==='undefined'&&typeof _0x982729[_0x2e06('0x1c')]==='undefined';var _0x15a25b=_0xb1dfa9[_0x2e06('0x1d')];var _0x2359e6=_0x501a19?0x0:_0x982729[_0x2e06('0x1b')];var _0x23e38b=_0x501a19?_0xb1dfa9[_0x2e06('0x1d')]:_0x982729[_0x2e06('0x1b')]+_0x982729['limit'];var _0x3dcf38;if(_0x23e38b>=_0x15a25b){_0x23e38b=_0x15a25b;_0x3dcf38=0xc8;}else{_0x3dcf38=0xce;}_0x4935b3[_0x2e06('0x1a')](_0x3dcf38);return _0x4935b3[_0x2e06('0x1e')](_0x2e06('0x1f'),_0x2359e6+'-'+_0x23e38b+'/'+_0x15a25b)[_0x2e06('0x20')](_0xb1dfa9);}return null;};}function patchUpdates(_0x43a978){return function(_0x10d4e3){try{jsonpatch[_0x2e06('0x21')](_0x10d4e3,_0x43a978,!![]);}catch(_0x13b89c){return BPromise['reject'](_0x13b89c);}return _0x10d4e3['save']();};}function saveUpdates(_0x52baf9,_0x5c2736){return function(_0x431a90){if(_0x431a90){return _0x431a90['update'](_0x52baf9)[_0x2e06('0x22')](function(_0x1c65c7){return _0x1c65c7;});}return null;};}function removeEntity(_0x569a45,_0x4e895f){return function(_0x1eba15){if(_0x1eba15){return _0x1eba15[_0x2e06('0x23')]()[_0x2e06('0x22')](function(){_0x569a45[_0x2e06('0x1a')](0xcc)[_0x2e06('0x19')]();});}};}function handleEntityNotFound(_0x367ac7,_0x58e0c6){return function(_0x4e0d68){if(!_0x4e0d68){_0x367ac7[_0x2e06('0x24')](0x194);}return _0x4e0d68;};}function handleError(_0x51e780,_0x427dac){_0x427dac=_0x427dac||0x1f4;return function(_0x4cd21d){logger[_0x2e06('0x25')](_0x4cd21d['stack']);if(_0x4cd21d[_0x2e06('0x26')]){delete _0x4cd21d[_0x2e06('0x26')];}_0x51e780['status'](_0x427dac)['send'](_0x4cd21d);};}exports[_0x2e06('0x27')]=function(_0x39d862,_0x37ede1){var _0x588cd6={},_0x5cd5b7={},_0x2bba8d={'count':0x0,'rows':[]};var _0x568fad=_[_0x2e06('0x28')](db['ChatQueueReport'][_0x2e06('0x29')],function(_0x35bf89){return{'name':_0x35bf89['fieldName'],'type':_0x35bf89['type']['key']};});_0x5cd5b7[_0x2e06('0x2a')]=_[_0x2e06('0x28')](_0x568fad,_0x2e06('0x26'));_0x5cd5b7[_0x2e06('0x2b')]=_['keys'](_0x39d862[_0x2e06('0x2b')]);_0x5cd5b7[_0x2e06('0x2c')]=_[_0x2e06('0x2d')](_0x5cd5b7['model'],_0x5cd5b7[_0x2e06('0x2b')]);_0x588cd6[_0x2e06('0x2e')]=_[_0x2e06('0x2d')](_0x5cd5b7['model'],qs['fields'](_0x39d862[_0x2e06('0x2b')][_0x2e06('0x2f')]));_0x588cd6[_0x2e06('0x2e')]=_0x588cd6[_0x2e06('0x2e')][_0x2e06('0x30')]?_0x588cd6['attributes']:_0x5cd5b7[_0x2e06('0x2a')];if(!_0x39d862['query'][_0x2e06('0x31')](_0x2e06('0x32'))){_0x588cd6[_0x2e06('0x1c')]=qs[_0x2e06('0x1c')](_0x39d862[_0x2e06('0x2b')]['limit']);_0x588cd6[_0x2e06('0x1b')]=qs[_0x2e06('0x1b')](_0x39d862['query'][_0x2e06('0x1b')]);}_0x588cd6[_0x2e06('0x33')]=qs[_0x2e06('0x34')](_0x39d862[_0x2e06('0x2b')][_0x2e06('0x34')]);_0x588cd6[_0x2e06('0x35')]=qs[_0x2e06('0x2c')](_[_0x2e06('0x36')](_0x39d862['query'],_0x5cd5b7[_0x2e06('0x2c')]),_0x568fad);if(_0x39d862[_0x2e06('0x2b')][_0x2e06('0x37')]){_0x588cd6[_0x2e06('0x35')]=_[_0x2e06('0x38')](_0x588cd6[_0x2e06('0x35')],{'$or':_[_0x2e06('0x28')](_0x568fad,function(_0x101142){if(_0x101142['type']!==_0x2e06('0x39')){var _0x4fe373={};_0x4fe373[_0x101142[_0x2e06('0x26')]]={'$like':'%'+_0x39d862[_0x2e06('0x2b')][_0x2e06('0x37')]+'%'};return _0x4fe373;}})});}_0x588cd6=_['merge']({},_0x588cd6,_0x39d862['options']);var _0x5a5fe2={'where':_0x588cd6['where']};return db[_0x2e06('0x3a')][_0x2e06('0x1d')](_0x5a5fe2)[_0x2e06('0x22')](function(_0x2cd56b){_0x2bba8d['count']=_0x2cd56b;if(_0x39d862[_0x2e06('0x2b')][_0x2e06('0x3b')]){_0x588cd6[_0x2e06('0x3c')]=[{'all':!![]}];}return db[_0x2e06('0x3a')][_0x2e06('0x3d')](_0x588cd6);})['then'](function(_0x2630b3){_0x2bba8d[_0x2e06('0x3e')]=_0x2630b3;return _0x2bba8d;})['then'](respondWithFilteredResult(_0x37ede1,_0x588cd6))[_0x2e06('0x3f')](handleError(_0x37ede1,null));};exports[_0x2e06('0x40')]=function(_0x18a663,_0x40fba2){var _0x46e2d2={'raw':!![],'where':{'id':_0x18a663[_0x2e06('0x41')]['id']}},_0x25eba3={};_0x25eba3[_0x2e06('0x2a')]=_[_0x2e06('0x42')](db[_0x2e06('0x3a')][_0x2e06('0x29')]);_0x25eba3['query']=_['keys'](_0x18a663[_0x2e06('0x2b')]);_0x25eba3['filters']=_['intersection'](_0x25eba3[_0x2e06('0x2a')],_0x25eba3[_0x2e06('0x2b')]);_0x46e2d2[_0x2e06('0x2e')]=_['intersection'](_0x25eba3[_0x2e06('0x2a')],qs[_0x2e06('0x2f')](_0x18a663['query'][_0x2e06('0x2f')]));_0x46e2d2[_0x2e06('0x2e')]=_0x46e2d2[_0x2e06('0x2e')][_0x2e06('0x30')]?_0x46e2d2[_0x2e06('0x2e')]:_0x25eba3[_0x2e06('0x2a')];if(_0x18a663['query'][_0x2e06('0x3b')]){_0x46e2d2['include']=[{'all':!![]}];}_0x46e2d2=_[_0x2e06('0x38')]({},_0x46e2d2,_0x18a663[_0x2e06('0x43')]);return db[_0x2e06('0x3a')][_0x2e06('0x44')](_0x46e2d2)[_0x2e06('0x22')](handleEntityNotFound(_0x40fba2,null))[_0x2e06('0x22')](respondWithResult(_0x40fba2,null))['catch'](handleError(_0x40fba2,null));};exports['create']=function(_0x1f8be4,_0x31dd08){return db[_0x2e06('0x3a')]['create'](_0x1f8be4[_0x2e06('0x45')],{})['then'](respondWithResult(_0x31dd08,0xc9))[_0x2e06('0x3f')](handleError(_0x31dd08,null));};exports[_0x2e06('0x46')]=function(_0x4cc187,_0x125b64){if(_0x4cc187[_0x2e06('0x45')]['id']){delete _0x4cc187[_0x2e06('0x45')]['id'];}return db[_0x2e06('0x3a')]['find']({'where':{'id':_0x4cc187['params']['id']}})['then'](handleEntityNotFound(_0x125b64,null))[_0x2e06('0x22')](saveUpdates(_0x4cc187[_0x2e06('0x45')],null))[_0x2e06('0x22')](respondWithResult(_0x125b64,null))[_0x2e06('0x3f')](handleError(_0x125b64,null));};exports[_0x2e06('0x23')]=function(_0x55ba55,_0x45e57f){return db[_0x2e06('0x3a')][_0x2e06('0x44')]({'where':{'id':_0x55ba55['params']['id']}})[_0x2e06('0x22')](handleEntityNotFound(_0x45e57f,null))[_0x2e06('0x22')](removeEntity(_0x45e57f,null))['catch'](handleError(_0x45e57f,null));};exports[_0x2e06('0x47')]=function(_0x1ac74f,_0x5b92fe){return db[_0x2e06('0x3a')][_0x2e06('0x47')]()[_0x2e06('0x22')](respondWithResult(_0x5b92fe,null))[_0x2e06('0x3f')](handleError(_0x5b92fe,null));}; \ No newline at end of file +var _0x41ec=['merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','ChatQueueReport','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','bluebird','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where'];(function(_0x1096ec,_0x614d45){var _0x7c6ba4=function(_0x4a2844){while(--_0x4a2844){_0x1096ec['push'](_0x1096ec['shift']());}};_0x7c6ba4(++_0x614d45);}(_0x41ec,0x143));var _0xc41e=function(_0x440197,_0x5282b9){_0x440197=_0x440197-0x0;var _0x4f70b2=_0x41ec[_0x440197];return _0x4f70b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc41e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc41e('0x1'));var rp=require(_0xc41e('0x2'));var moment=require('moment');var BPromise=require(_0xc41e('0x3'));var Mustache=require(_0xc41e('0x4'));var util=require(_0xc41e('0x5'));var path=require(_0xc41e('0x6'));var sox=require(_0xc41e('0x7'));var csv=require(_0xc41e('0x8'));var ejs=require(_0xc41e('0x9'));var fs=require('fs');var fs_extra=require(_0xc41e('0xa'));var _=require(_0xc41e('0xb'));var squel=require(_0xc41e('0xc'));var crypto=require(_0xc41e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc41e('0xe'));var toCsv=require(_0xc41e('0x8'));var querystring=require(_0xc41e('0xf'));var Papa=require(_0xc41e('0x10'));var Redis=require(_0xc41e('0x11'));var authService=require(_0xc41e('0x12'));var qs=require(_0xc41e('0x13'));var as=require(_0xc41e('0x14'));var hardwareService=require(_0xc41e('0x15'));var logger=require(_0xc41e('0x16'))(_0xc41e('0x17'));var utils=require('../../config/utils');var config=require(_0xc41e('0x18'));var licenseUtil=require(_0xc41e('0x19'));var db=require(_0xc41e('0x1a'))['db'];function respondWithStatusCode(_0x3d7280,_0x11a117){_0x11a117=_0x11a117||0xcc;return function(_0x433ca9){if(_0x433ca9){return _0x3d7280[_0xc41e('0x1b')](_0x11a117);}return _0x3d7280[_0xc41e('0x1c')](_0x11a117)['end']();};}function respondWithResult(_0x3b3900,_0x6b614a){_0x6b614a=_0x6b614a||0xc8;return function(_0xcd58a0){if(_0xcd58a0){return _0x3b3900[_0xc41e('0x1c')](_0x6b614a)['json'](_0xcd58a0);}};}function respondWithFilteredResult(_0x5c705e,_0x4f960d){return function(_0x28eb53){if(_0x28eb53){var _0x4293a5=typeof _0x4f960d['offset']===_0xc41e('0x1d')&&typeof _0x4f960d[_0xc41e('0x1e')]==='undefined';var _0x4e7aa3=_0x28eb53[_0xc41e('0x1f')];var _0x5c0517=_0x4293a5?0x0:_0x4f960d[_0xc41e('0x20')];var _0x23c9b6=_0x4293a5?_0x28eb53['count']:_0x4f960d[_0xc41e('0x20')]+_0x4f960d[_0xc41e('0x1e')];var _0xee0f01;if(_0x23c9b6>=_0x4e7aa3){_0x23c9b6=_0x4e7aa3;_0xee0f01=0xc8;}else{_0xee0f01=0xce;}_0x5c705e[_0xc41e('0x1c')](_0xee0f01);return _0x5c705e[_0xc41e('0x21')](_0xc41e('0x22'),_0x5c0517+'-'+_0x23c9b6+'/'+_0x4e7aa3)[_0xc41e('0x23')](_0x28eb53);}return null;};}function patchUpdates(_0x57e0c4){return function(_0x239c25){try{jsonpatch[_0xc41e('0x24')](_0x239c25,_0x57e0c4,!![]);}catch(_0x3f26d5){return BPromise['reject'](_0x3f26d5);}return _0x239c25[_0xc41e('0x25')]();};}function saveUpdates(_0x408d27,_0x814a72){return function(_0x490cc3){if(_0x490cc3){return _0x490cc3[_0xc41e('0x26')](_0x408d27)[_0xc41e('0x27')](function(_0x602bd7){return _0x602bd7;});}return null;};}function removeEntity(_0x4adaad,_0x5a06dd){return function(_0x4c20b1){if(_0x4c20b1){return _0x4c20b1[_0xc41e('0x28')]()[_0xc41e('0x27')](function(){_0x4adaad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a3e0d,_0x1c33a6){return function(_0x1ad4c7){if(!_0x1ad4c7){_0x5a3e0d[_0xc41e('0x1b')](0x194);}return _0x1ad4c7;};}function handleError(_0x467672,_0x1c6a2a){_0x1c6a2a=_0x1c6a2a||0x1f4;return function(_0x580b9e){logger[_0xc41e('0x29')](_0x580b9e[_0xc41e('0x2a')]);if(_0x580b9e[_0xc41e('0x2b')]){delete _0x580b9e['name'];}_0x467672[_0xc41e('0x1c')](_0x1c6a2a)[_0xc41e('0x2c')](_0x580b9e);};}exports['index']=function(_0x25b319,_0x12536e){var _0x5c2c62={},_0xcb3a15={},_0x2fa98a={'count':0x0,'rows':[]};var _0x17246e=_[_0xc41e('0x2d')](db['ChatQueueReport']['rawAttributes'],function(_0x541ac4){return{'name':_0x541ac4[_0xc41e('0x2e')],'type':_0x541ac4[_0xc41e('0x2f')][_0xc41e('0x30')]};});_0xcb3a15[_0xc41e('0x31')]=_[_0xc41e('0x2d')](_0x17246e,_0xc41e('0x2b'));_0xcb3a15[_0xc41e('0x32')]=_['keys'](_0x25b319[_0xc41e('0x32')]);_0xcb3a15[_0xc41e('0x33')]=_[_0xc41e('0x34')](_0xcb3a15['model'],_0xcb3a15[_0xc41e('0x32')]);_0x5c2c62['attributes']=_[_0xc41e('0x34')](_0xcb3a15[_0xc41e('0x31')],qs[_0xc41e('0x35')](_0x25b319[_0xc41e('0x32')]['fields']));_0x5c2c62['attributes']=_0x5c2c62[_0xc41e('0x36')][_0xc41e('0x37')]?_0x5c2c62[_0xc41e('0x36')]:_0xcb3a15[_0xc41e('0x31')];if(!_0x25b319[_0xc41e('0x32')][_0xc41e('0x38')]('nolimit')){_0x5c2c62[_0xc41e('0x1e')]=qs[_0xc41e('0x1e')](_0x25b319[_0xc41e('0x32')]['limit']);_0x5c2c62[_0xc41e('0x20')]=qs[_0xc41e('0x20')](_0x25b319['query'][_0xc41e('0x20')]);}_0x5c2c62[_0xc41e('0x39')]=qs[_0xc41e('0x3a')](_0x25b319[_0xc41e('0x32')][_0xc41e('0x3a')]);_0x5c2c62['where']=qs['filters'](_[_0xc41e('0x3b')](_0x25b319[_0xc41e('0x32')],_0xcb3a15[_0xc41e('0x33')]),_0x17246e);if(_0x25b319[_0xc41e('0x32')][_0xc41e('0x3c')]){_0x5c2c62[_0xc41e('0x3d')]=_[_0xc41e('0x3e')](_0x5c2c62[_0xc41e('0x3d')],{'$or':_[_0xc41e('0x2d')](_0x17246e,function(_0x4de59a){if(_0x4de59a['type']!==_0xc41e('0x3f')){var _0xfd6ff6={};_0xfd6ff6[_0x4de59a[_0xc41e('0x2b')]]={'$like':'%'+_0x25b319[_0xc41e('0x32')][_0xc41e('0x3c')]+'%'};return _0xfd6ff6;}})});}_0x5c2c62=_[_0xc41e('0x3e')]({},_0x5c2c62,_0x25b319[_0xc41e('0x40')]);var _0x150f30={'where':_0x5c2c62['where']};return db['ChatQueueReport'][_0xc41e('0x1f')](_0x150f30)[_0xc41e('0x27')](function(_0x10cfed){_0x2fa98a['count']=_0x10cfed;if(_0x25b319['query'][_0xc41e('0x41')]){_0x5c2c62['include']=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x5c2c62);})['then'](function(_0x3c30e2){_0x2fa98a[_0xc41e('0x42')]=_0x3c30e2;return _0x2fa98a;})[_0xc41e('0x27')](respondWithFilteredResult(_0x12536e,_0x5c2c62))[_0xc41e('0x43')](handleError(_0x12536e,null));};exports[_0xc41e('0x44')]=function(_0x206aa1,_0x4bb1f6){var _0x28d15d={'raw':!![],'where':{'id':_0x206aa1[_0xc41e('0x45')]['id']}},_0x1a3e67={};_0x1a3e67[_0xc41e('0x31')]=_[_0xc41e('0x46')](db[_0xc41e('0x47')]['rawAttributes']);_0x1a3e67[_0xc41e('0x32')]=_[_0xc41e('0x46')](_0x206aa1['query']);_0x1a3e67[_0xc41e('0x33')]=_[_0xc41e('0x34')](_0x1a3e67['model'],_0x1a3e67[_0xc41e('0x32')]);_0x28d15d['attributes']=_[_0xc41e('0x34')](_0x1a3e67[_0xc41e('0x31')],qs[_0xc41e('0x35')](_0x206aa1['query'][_0xc41e('0x35')]));_0x28d15d[_0xc41e('0x36')]=_0x28d15d['attributes']['length']?_0x28d15d['attributes']:_0x1a3e67['model'];if(_0x206aa1[_0xc41e('0x32')]['includeAll']){_0x28d15d[_0xc41e('0x48')]=[{'all':!![]}];}_0x28d15d=_['merge']({},_0x28d15d,_0x206aa1['options']);return db[_0xc41e('0x47')]['find'](_0x28d15d)[_0xc41e('0x27')](handleEntityNotFound(_0x4bb1f6,null))[_0xc41e('0x27')](respondWithResult(_0x4bb1f6,null))[_0xc41e('0x43')](handleError(_0x4bb1f6,null));};exports[_0xc41e('0x49')]=function(_0x46aef6,_0x31b393){return db[_0xc41e('0x47')][_0xc41e('0x49')](_0x46aef6[_0xc41e('0x4a')],{})[_0xc41e('0x27')](respondWithResult(_0x31b393,0xc9))[_0xc41e('0x43')](handleError(_0x31b393,null));};exports['update']=function(_0x4b67d4,_0x1cdf49){if(_0x4b67d4[_0xc41e('0x4a')]['id']){delete _0x4b67d4[_0xc41e('0x4a')]['id'];}return db['ChatQueueReport'][_0xc41e('0x4b')]({'where':{'id':_0x4b67d4[_0xc41e('0x45')]['id']}})[_0xc41e('0x27')](handleEntityNotFound(_0x1cdf49,null))[_0xc41e('0x27')](saveUpdates(_0x4b67d4[_0xc41e('0x4a')],null))[_0xc41e('0x27')](respondWithResult(_0x1cdf49,null))[_0xc41e('0x43')](handleError(_0x1cdf49,null));};exports['destroy']=function(_0x3c867a,_0x317eba){return db['ChatQueueReport']['find']({'where':{'id':_0x3c867a[_0xc41e('0x45')]['id']}})[_0xc41e('0x27')](handleEntityNotFound(_0x317eba,null))[_0xc41e('0x27')](removeEntity(_0x317eba,null))[_0xc41e('0x43')](handleError(_0x317eba,null));};exports[_0xc41e('0x4c')]=function(_0x53a799,_0x576831){return db[_0xc41e('0x47')]['describe']()[_0xc41e('0x27')](respondWithResult(_0x576831,null))['catch'](handleError(_0x576831,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index fe0ab87..2559ca4 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(_0x5e6cea,_0x24b02a){var _0x55a315=function(_0x395b80){while(--_0x395b80){_0x5e6cea['push'](_0x5e6cea['shift']());}};_0x55a315(++_0x24b02a);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e8461,_0x5e1500){_0x1e8461=_0x1e8461-0x0;var _0x528f4d=_0xb10b[_0x1e8461];return _0x528f4d;};'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(_0x5098bc,_0x766238){var _0x1aa55b=function(_0x1f442d){while(--_0x1f442d){_0x5098bc['push'](_0x5098bc['shift']());}};_0x1aa55b(++_0x766238);}(_0x757a,0xde));var _0xa757=function(_0x327b61,_0x2994a6){_0x327b61=_0x327b61-0x0;var _0x182ca2=_0x757a[_0x327b61];return _0x182ca2;};'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 5ffe21f..31f7a5c 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 _0xdcdb=['lodash','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','then','stringify','update','limit','UpdateChatQueueReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdcdb,0xae));var _0xbdcd=function(_0x25fcef,_0x45a4c5){_0x25fcef=_0x25fcef-0x0;var _0x291a24=_0xdcdb[_0x25fcef];return _0x291a24;};'use strict';var _=require(_0xbdcd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbdcd('0x1'));var rs=require(_0xbdcd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbdcd('0x3'));var logger=require('../../config/logger')(_0xbdcd('0x4'));var config=require(_0xbdcd('0x5'));var jayson=require(_0xbdcd('0x6'));var client=jayson[_0xbdcd('0x7')][_0xbdcd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe74983,_0x32dc57,_0x1e9e1d){return new BPromise(function(_0x2e3788,_0x2cdc6a){return client[_0xbdcd('0x9')](_0xe74983,_0x1e9e1d)['then'](function(_0x5d513e){logger[_0xbdcd('0xa')](_0xbdcd('0xb'),_0x32dc57,'request\x20sent');logger[_0xbdcd('0xc')](_0xbdcd('0xd'),_0x32dc57,'request\x20sent',JSON['stringify'](_0x5d513e));if(_0x5d513e[_0xbdcd('0xe')]){if(_0x5d513e['error'][_0xbdcd('0xf')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x32dc57,_0x5d513e['error'][_0xbdcd('0x10')]);return _0x2cdc6a(_0x5d513e[_0xbdcd('0xe')][_0xbdcd('0x10')]);}logger[_0xbdcd('0xe')](_0xbdcd('0xb'),_0x32dc57,_0x5d513e[_0xbdcd('0xe')][_0xbdcd('0x10')]);return _0x2e3788(_0x5d513e[_0xbdcd('0xe')]['message']);}else{logger[_0xbdcd('0xa')](_0xbdcd('0xb'),_0x32dc57,_0xbdcd('0x11'));_0x2e3788(_0x5d513e['result'][_0xbdcd('0x10')]);}})[_0xbdcd('0x12')](function(_0x14f3b5){logger[_0xbdcd('0xe')](_0xbdcd('0xb'),_0x32dc57,_0x14f3b5);_0x2cdc6a(_0x14f3b5);});});}exports[_0xbdcd('0x13')]=function(_0x28d59b){var _0x33162d=this;return new Promise(function(_0x3af56f,_0x47e439){return db[_0xbdcd('0x14')][_0xbdcd('0x15')](_0x28d59b[_0xbdcd('0x16')],{'raw':_0x28d59b[_0xbdcd('0x17')]?_0x28d59b[_0xbdcd('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xbdcd('0x18')](function(_0x32c95c){logger[_0xbdcd('0xa')]('CreateChatQueueReport',_0x28d59b);logger[_0xbdcd('0xc')]('CreateChatQueueReport',_0x28d59b,JSON[_0xbdcd('0x19')](_0x32c95c));_0x3af56f(_0x32c95c);})[_0xbdcd('0x12')](function(_0x391dab){logger[_0xbdcd('0xe')](_0xbdcd('0x13'),_0x391dab[_0xbdcd('0x10')],_0x28d59b);_0x47e439(_0x33162d['error'](0x1f4,_0x391dab[_0xbdcd('0x10')]));});});};exports['UpdateChatQueueReport']=function(_0x191aab){var _0x365a1d=this;return new Promise(function(_0x1c083f,_0x34e440){return db[_0xbdcd('0x14')][_0xbdcd('0x1a')](_0x191aab['body'],{'raw':_0x191aab[_0xbdcd('0x17')]?_0x191aab[_0xbdcd('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x191aab['options']?_0x191aab['options']['where']||null:null,'attributes':_0x191aab[_0xbdcd('0x17')]?_0x191aab['options']['attributes']||null:null,'limit':_0x191aab['options']?_0x191aab[_0xbdcd('0x17')][_0xbdcd('0x1b')]||null:null})['then'](function(_0x4dc131){logger[_0xbdcd('0xa')](_0xbdcd('0x1c'),_0x191aab);logger['debug'](_0xbdcd('0x1c'),_0x191aab,JSON[_0xbdcd('0x19')](_0x4dc131));_0x1c083f(_0x4dc131);})[_0xbdcd('0x12')](function(_0x538aef){logger[_0xbdcd('0xe')](_0xbdcd('0x1c'),_0x538aef[_0xbdcd('0x10')],_0x191aab);_0x34e440(_0x365a1d[_0xbdcd('0xe')](0x1f4,_0x538aef[_0xbdcd('0x10')]));});});}; \ No newline at end of file +var _0x34ea=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','debug','stringify','update','where','attributes','limit','UpdateChatQueueReport','util','bluebird'];(function(_0x10fb54,_0xdfc476){var _0x546821=function(_0x5a9d2d){while(--_0x5a9d2d){_0x10fb54['push'](_0x10fb54['shift']());}};_0x546821(++_0xdfc476);}(_0x34ea,0x148));var _0xa34e=function(_0x4acac7,_0x4ff81c){_0x4acac7=_0x4acac7-0x0;var _0x363d42=_0x34ea[_0x4acac7];return _0x363d42;};'use strict';var _=require('lodash');var util=require(_0xa34e('0x0'));var moment=require('moment');var BPromise=require(_0xa34e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa34e('0x2'));var logger=require(_0xa34e('0x3'))('rpc');var config=require(_0xa34e('0x4'));var jayson=require(_0xa34e('0x5'));var client=jayson['client'][_0xa34e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3e8ba7,_0x5819dd,_0x397e6e){return new BPromise(function(_0x56ca72,_0x421a76){return client[_0xa34e('0x7')](_0x3e8ba7,_0x397e6e)[_0xa34e('0x8')](function(_0x88cc8f){logger[_0xa34e('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x5819dd,_0xa34e('0xa'));logger['debug'](_0xa34e('0xb'),_0x5819dd,_0xa34e('0xa'),JSON['stringify'](_0x88cc8f));if(_0x88cc8f[_0xa34e('0xc')]){if(_0x88cc8f[_0xa34e('0xc')]['code']===0x1f4){logger[_0xa34e('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x5819dd,_0x88cc8f['error'][_0xa34e('0xd')]);return _0x421a76(_0x88cc8f[_0xa34e('0xc')]['message']);}logger[_0xa34e('0xc')](_0xa34e('0xe'),_0x5819dd,_0x88cc8f[_0xa34e('0xc')][_0xa34e('0xd')]);return _0x56ca72(_0x88cc8f[_0xa34e('0xc')][_0xa34e('0xd')]);}else{logger[_0xa34e('0x9')](_0xa34e('0xe'),_0x5819dd,_0xa34e('0xa'));_0x56ca72(_0x88cc8f[_0xa34e('0xf')][_0xa34e('0xd')]);}})[_0xa34e('0x10')](function(_0x4dd34c){logger[_0xa34e('0xc')](_0xa34e('0xe'),_0x5819dd,_0x4dd34c);_0x421a76(_0x4dd34c);});});}exports[_0xa34e('0x11')]=function(_0xd97dff){var _0x90b8b6=this;return new Promise(function(_0x599a66,_0x789def){return db[_0xa34e('0x12')][_0xa34e('0x13')](_0xd97dff[_0xa34e('0x14')],{'raw':_0xd97dff[_0xa34e('0x15')]?_0xd97dff[_0xa34e('0x15')][_0xa34e('0x16')]===undefined?!![]:![]:!![]})[_0xa34e('0x8')](function(_0x200c9a){logger[_0xa34e('0x9')](_0xa34e('0x11'),_0xd97dff);logger[_0xa34e('0x17')]('CreateChatQueueReport',_0xd97dff,JSON[_0xa34e('0x18')](_0x200c9a));_0x599a66(_0x200c9a);})[_0xa34e('0x10')](function(_0x30662d){logger[_0xa34e('0xc')](_0xa34e('0x11'),_0x30662d[_0xa34e('0xd')],_0xd97dff);_0x789def(_0x90b8b6['error'](0x1f4,_0x30662d[_0xa34e('0xd')]));});});};exports['UpdateChatQueueReport']=function(_0x1b471b){var _0xb1d50=this;return new Promise(function(_0xa3b5cc,_0x228b98){return db[_0xa34e('0x12')][_0xa34e('0x19')](_0x1b471b['body'],{'raw':_0x1b471b[_0xa34e('0x15')]?_0x1b471b[_0xa34e('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b471b['options']?_0x1b471b[_0xa34e('0x15')][_0xa34e('0x1a')]||null:null,'attributes':_0x1b471b['options']?_0x1b471b[_0xa34e('0x15')][_0xa34e('0x1b')]||null:null,'limit':_0x1b471b[_0xa34e('0x15')]?_0x1b471b[_0xa34e('0x15')][_0xa34e('0x1c')]||null:null})[_0xa34e('0x8')](function(_0x32da26){logger[_0xa34e('0x9')](_0xa34e('0x1d'),_0x1b471b);logger[_0xa34e('0x17')](_0xa34e('0x1d'),_0x1b471b,JSON[_0xa34e('0x18')](_0x32da26));_0xa3b5cc(_0x32da26);})[_0xa34e('0x10')](function(_0x35dc63){logger[_0xa34e('0xc')](_0xa34e('0x1d'),_0x35dc63[_0xa34e('0xd')],_0x1b471b);_0x228b98(_0xb1d50[_0xa34e('0xc')](0x1f4,_0x35dc63[_0xa34e('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index e8fbaed..20e4592 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 _0xdf72=['index','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x5721ec,_0x105f1f){var _0x39e329=function(_0x5dc688){while(--_0x5dc688){_0x5721ec['push'](_0x5721ec['shift']());}};_0x39e329(++_0x105f1f);}(_0xdf72,0x122));var _0x2df7=function(_0x4cb231,_0x3d3c5b){_0x4cb231=_0x4cb231-0x0;var _0x4d5063=_0xdf72[_0x4cb231];return _0x4d5063;};'use strict';var multer=require(_0x2df7('0x0'));var util=require('util');var path=require(_0x2df7('0x1'));var timeout=require('connect-timeout');var express=require(_0x2df7('0x2'));var router=express[_0x2df7('0x3')]();var fs_extra=require(_0x2df7('0x4'));var auth=require(_0x2df7('0x5'));var interaction=require(_0x2df7('0x6'));var config=require('../../config/environment');var controller=require(_0x2df7('0x7'));router[_0x2df7('0x8')]('/',auth[_0x2df7('0x9')](),controller[_0x2df7('0xa')]);router[_0x2df7('0x8')](_0x2df7('0xb'),auth[_0x2df7('0x9')](),controller[_0x2df7('0xc')]);router[_0x2df7('0x8')](_0x2df7('0xd'),auth[_0x2df7('0x9')](),controller[_0x2df7('0xe')]);router[_0x2df7('0xf')]('/',auth[_0x2df7('0x9')](),controller['create']);router[_0x2df7('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2df7('0x11')]);router['delete'](_0x2df7('0xd'),auth[_0x2df7('0x9')](),controller[_0x2df7('0x12')]);module[_0x2df7('0x13')]=router; \ No newline at end of file +var _0xc216=['fs-extra','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','util','path','connect-timeout','express'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc216,0xec));var _0x6c21=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xc216[_0x24237f];return _0x48298e;};'use strict';var multer=require('multer');var util=require(_0x6c21('0x0'));var path=require(_0x6c21('0x1'));var timeout=require(_0x6c21('0x2'));var express=require(_0x6c21('0x3'));var router=express['Router']();var fs_extra=require(_0x6c21('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6c21('0x5'));var controller=require('./chatQueueReport.controller');router[_0x6c21('0x6')]('/',auth[_0x6c21('0x7')](),controller['index']);router[_0x6c21('0x6')](_0x6c21('0x8'),auth['isAuthenticated'](),controller[_0x6c21('0x9')]);router[_0x6c21('0x6')](_0x6c21('0xa'),auth[_0x6c21('0x7')](),controller[_0x6c21('0xb')]);router[_0x6c21('0xc')]('/',auth['isAuthenticated'](),controller[_0x6c21('0xd')]);router[_0x6c21('0xe')](_0x6c21('0xa'),auth[_0x6c21('0x7')](),controller['update']);router[_0x6c21('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 953ab6c..f89368b 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(_0x53a74f,_0x23673c){var _0x1b2d5d=function(_0x49d69b){while(--_0x49d69b){_0x53a74f['push'](_0x53a74f['shift']());}};_0x1b2d5d(++_0x23673c);}(_0x008c,0x188));var _0xc008=function(_0x251b02,_0x38c0f7){_0x251b02=_0x251b02-0x0;var _0x14017c=_0x008c[_0x251b02];return _0x14017c;};'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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x342516,_0x390501){var _0x2d7865=function(_0x123f20){while(--_0x123f20){_0x342516['push'](_0x342516['shift']());}};_0x2d7865(++_0x390501);}(_0xaa88,0x137));var _0x8aa8=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0xaa88[_0x234ae1];return _0x227ba0;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 43edb10..6209275 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 _0x0a9c=['bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','map','name','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x1190c2,_0x2c078b){var _0x6ec988=function(_0x333cdf){while(--_0x333cdf){_0x1190c2['push'](_0x1190c2['shift']());}};_0x6ec988(++_0x2c078b);}(_0x0a9c,0x181));var _0xc0a9=function(_0x46872d,_0x468bec){_0x46872d=_0x46872d-0x0;var _0xf87e81=_0x0a9c[_0x46872d];return _0xf87e81;};'use strict';var emlformat=require(_0xc0a9('0x0'));var rimraf=require(_0xc0a9('0x1'));var zipdir=require(_0xc0a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc0a9('0x3'));var moment=require(_0xc0a9('0x4'));var BPromise=require(_0xc0a9('0x5'));var Mustache=require(_0xc0a9('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc0a9('0x7'));var csv=require(_0xc0a9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc0a9('0x9'));var _=require(_0xc0a9('0xa'));var squel=require(_0xc0a9('0xb'));var crypto=require(_0xc0a9('0xc'));var jsforce=require(_0xc0a9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc0a9('0x8'));var querystring=require(_0xc0a9('0xe'));var Papa=require(_0xc0a9('0xf'));var Redis=require(_0xc0a9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc0a9('0x11'));var as=require(_0xc0a9('0x12'));var hardwareService=require(_0xc0a9('0x13'));var logger=require(_0xc0a9('0x14'))(_0xc0a9('0x15'));var utils=require('../../config/utils');var config=require(_0xc0a9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc0a9('0x17'))['db'];function respondWithStatusCode(_0x12203d,_0x59b34a){_0x59b34a=_0x59b34a||0xcc;return function(_0x547e33){if(_0x547e33){return _0x12203d[_0xc0a9('0x18')](_0x59b34a);}return _0x12203d[_0xc0a9('0x19')](_0x59b34a)[_0xc0a9('0x1a')]();};}function respondWithResult(_0x232ff0,_0x1ec507){_0x1ec507=_0x1ec507||0xc8;return function(_0x4d2928){if(_0x4d2928){return _0x232ff0['status'](_0x1ec507)[_0xc0a9('0x1b')](_0x4d2928);}};}function respondWithFilteredResult(_0x209a1f,_0x43a458){return function(_0x3d83d6){if(_0x3d83d6){var _0xd9d245=typeof _0x43a458['offset']===_0xc0a9('0x1c')&&typeof _0x43a458['limit']===_0xc0a9('0x1c');var _0x229564=_0x3d83d6[_0xc0a9('0x1d')];var _0x22c24e=_0xd9d245?0x0:_0x43a458[_0xc0a9('0x1e')];var _0x5854e5=_0xd9d245?_0x3d83d6['count']:_0x43a458[_0xc0a9('0x1e')]+_0x43a458[_0xc0a9('0x1f')];var _0x1e9633;if(_0x5854e5>=_0x229564){_0x5854e5=_0x229564;_0x1e9633=0xc8;}else{_0x1e9633=0xce;}_0x209a1f[_0xc0a9('0x19')](_0x1e9633);return _0x209a1f[_0xc0a9('0x20')](_0xc0a9('0x21'),_0x22c24e+'-'+_0x5854e5+'/'+_0x229564)[_0xc0a9('0x1b')](_0x3d83d6);}return null;};}function patchUpdates(_0x92863c){return function(_0x3dc5fc){try{jsonpatch['apply'](_0x3dc5fc,_0x92863c,!![]);}catch(_0x2b394e){return BPromise[_0xc0a9('0x22')](_0x2b394e);}return _0x3dc5fc[_0xc0a9('0x23')]();};}function saveUpdates(_0x5277c0,_0x31f6f2){return function(_0x585e16){if(_0x585e16){return _0x585e16['update'](_0x5277c0)[_0xc0a9('0x24')](function(_0x17abe9){return _0x17abe9;});}return null;};}function removeEntity(_0x169953,_0x3f46f7){return function(_0x5ba974){if(_0x5ba974){return _0x5ba974[_0xc0a9('0x25')]()[_0xc0a9('0x24')](function(){_0x169953[_0xc0a9('0x19')](0xcc)[_0xc0a9('0x1a')]();});}};}function handleEntityNotFound(_0x21309b,_0x4c1892){return function(_0x4453a2){if(!_0x4453a2){_0x21309b[_0xc0a9('0x18')](0x194);}return _0x4453a2;};}function handleError(_0x50b18f,_0x52d024){_0x52d024=_0x52d024||0x1f4;return function(_0x53589a){logger[_0xc0a9('0x26')](_0x53589a[_0xc0a9('0x27')]);if(_0x53589a['name']){delete _0x53589a['name'];}_0x50b18f['status'](_0x52d024)[_0xc0a9('0x28')](_0x53589a);};}exports[_0xc0a9('0x29')]=function(_0x503db6,_0x4d9689){var _0xe7a123={},_0x4820e7={},_0x26e0be={'count':0x0,'rows':[]};var _0x49516c=_['map'](db[_0xc0a9('0x2a')][_0xc0a9('0x2b')],function(_0x522292){return{'name':_0x522292[_0xc0a9('0x2c')],'type':_0x522292[_0xc0a9('0x2d')][_0xc0a9('0x2e')]};});_0x4820e7['model']=_[_0xc0a9('0x2f')](_0x49516c,_0xc0a9('0x30'));_0x4820e7['query']=_[_0xc0a9('0x31')](_0x503db6[_0xc0a9('0x32')]);_0x4820e7[_0xc0a9('0x33')]=_[_0xc0a9('0x34')](_0x4820e7['model'],_0x4820e7[_0xc0a9('0x32')]);_0xe7a123[_0xc0a9('0x35')]=_[_0xc0a9('0x34')](_0x4820e7[_0xc0a9('0x36')],qs['fields'](_0x503db6[_0xc0a9('0x32')][_0xc0a9('0x37')]));_0xe7a123[_0xc0a9('0x35')]=_0xe7a123[_0xc0a9('0x35')][_0xc0a9('0x38')]?_0xe7a123[_0xc0a9('0x35')]:_0x4820e7[_0xc0a9('0x36')];if(!_0x503db6[_0xc0a9('0x32')]['hasOwnProperty'](_0xc0a9('0x39'))){_0xe7a123[_0xc0a9('0x1f')]=qs[_0xc0a9('0x1f')](_0x503db6[_0xc0a9('0x32')]['limit']);_0xe7a123[_0xc0a9('0x1e')]=qs[_0xc0a9('0x1e')](_0x503db6[_0xc0a9('0x32')][_0xc0a9('0x1e')]);}_0xe7a123[_0xc0a9('0x3a')]=qs[_0xc0a9('0x3b')](_0x503db6[_0xc0a9('0x32')][_0xc0a9('0x3b')]);_0xe7a123[_0xc0a9('0x3c')]=qs[_0xc0a9('0x33')](_[_0xc0a9('0x3d')](_0x503db6['query'],_0x4820e7[_0xc0a9('0x33')]),_0x49516c);if(_0x503db6[_0xc0a9('0x32')][_0xc0a9('0x3e')]){_0xe7a123[_0xc0a9('0x3c')]=_[_0xc0a9('0x3f')](_0xe7a123[_0xc0a9('0x3c')],{'$or':_['map'](_0x49516c,function(_0x5afe4a){if(_0x5afe4a['type']!==_0xc0a9('0x40')){var _0x41b4a6={};_0x41b4a6[_0x5afe4a['name']]={'$like':'%'+_0x503db6[_0xc0a9('0x32')][_0xc0a9('0x3e')]+'%'};return _0x41b4a6;}})});}_0xe7a123=_[_0xc0a9('0x3f')]({},_0xe7a123,_0x503db6[_0xc0a9('0x41')]);var _0x4b7732={'where':_0xe7a123[_0xc0a9('0x3c')]};return db[_0xc0a9('0x2a')][_0xc0a9('0x1d')](_0x4b7732)['then'](function(_0x4508fe){_0x26e0be['count']=_0x4508fe;if(_0x503db6['query'][_0xc0a9('0x42')]){_0xe7a123[_0xc0a9('0x43')]=[{'all':!![]}];}return db[_0xc0a9('0x2a')][_0xc0a9('0x44')](_0xe7a123);})[_0xc0a9('0x24')](function(_0x4897ce){_0x26e0be[_0xc0a9('0x45')]=_0x4897ce;return _0x26e0be;})[_0xc0a9('0x24')](respondWithFilteredResult(_0x4d9689,_0xe7a123))[_0xc0a9('0x46')](handleError(_0x4d9689,null));};exports[_0xc0a9('0x47')]=function(_0x16f6ef,_0x3da9bf){var _0xca7427={'raw':!![],'where':{'id':_0x16f6ef['params']['id']}},_0x2d2042={};_0x2d2042['model']=_[_0xc0a9('0x31')](db['ChatTransferReport'][_0xc0a9('0x2b')]);_0x2d2042[_0xc0a9('0x32')]=_[_0xc0a9('0x31')](_0x16f6ef[_0xc0a9('0x32')]);_0x2d2042['filters']=_[_0xc0a9('0x34')](_0x2d2042[_0xc0a9('0x36')],_0x2d2042[_0xc0a9('0x32')]);_0xca7427[_0xc0a9('0x35')]=_[_0xc0a9('0x34')](_0x2d2042[_0xc0a9('0x36')],qs[_0xc0a9('0x37')](_0x16f6ef[_0xc0a9('0x32')]['fields']));_0xca7427['attributes']=_0xca7427[_0xc0a9('0x35')][_0xc0a9('0x38')]?_0xca7427['attributes']:_0x2d2042['model'];if(_0x16f6ef[_0xc0a9('0x32')][_0xc0a9('0x42')]){_0xca7427['include']=[{'all':!![]}];}_0xca7427=_[_0xc0a9('0x3f')]({},_0xca7427,_0x16f6ef[_0xc0a9('0x41')]);return db['ChatTransferReport'][_0xc0a9('0x48')](_0xca7427)[_0xc0a9('0x24')](handleEntityNotFound(_0x3da9bf,null))[_0xc0a9('0x24')](respondWithResult(_0x3da9bf,null))[_0xc0a9('0x46')](handleError(_0x3da9bf,null));};exports[_0xc0a9('0x49')]=function(_0x366d19,_0x2f926a){return db['ChatTransferReport'][_0xc0a9('0x49')](_0x366d19[_0xc0a9('0x4a')],{})[_0xc0a9('0x24')](respondWithResult(_0x2f926a,0xc9))['catch'](handleError(_0x2f926a,null));};exports[_0xc0a9('0x4b')]=function(_0x4fe46b,_0x52fc62){if(_0x4fe46b[_0xc0a9('0x4a')]['id']){delete _0x4fe46b[_0xc0a9('0x4a')]['id'];}return db[_0xc0a9('0x2a')][_0xc0a9('0x48')]({'where':{'id':_0x4fe46b[_0xc0a9('0x4c')]['id']}})[_0xc0a9('0x24')](handleEntityNotFound(_0x52fc62,null))[_0xc0a9('0x24')](saveUpdates(_0x4fe46b[_0xc0a9('0x4a')],null))['then'](respondWithResult(_0x52fc62,null))['catch'](handleError(_0x52fc62,null));};exports[_0xc0a9('0x25')]=function(_0x13fda8,_0x17a2eb){return db['ChatTransferReport'][_0xc0a9('0x48')]({'where':{'id':_0x13fda8[_0xc0a9('0x4c')]['id']}})[_0xc0a9('0x24')](handleEntityNotFound(_0x17a2eb,null))[_0xc0a9('0x24')](removeEntity(_0x17a2eb,null))[_0xc0a9('0x46')](handleError(_0x17a2eb,null));};exports[_0xc0a9('0x4d')]=function(_0x3e0b24,_0x586a94){return db[_0xc0a9('0x2a')]['describe']()[_0xc0a9('0x24')](respondWithResult(_0x586a94,null))['catch'](handleError(_0x586a94,null));}; \ No newline at end of file +var _0x689f=['set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','map','VIRTUAL','filter','ChatTransferReport','includeAll','include','rows','catch','show','params','merge','find','create','body','update','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x689f,0x150));var _0xf689=function(_0x657a54,_0x42c3ec){_0x657a54=_0x657a54-0x0;var _0x4b15bb=_0x689f[_0x657a54];return _0x4b15bb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf689('0x0'));var jsonpatch=require(_0xf689('0x1'));var rp=require(_0xf689('0x2'));var moment=require(_0xf689('0x3'));var BPromise=require(_0xf689('0x4'));var Mustache=require('mustache');var util=require(_0xf689('0x5'));var path=require(_0xf689('0x6'));var sox=require('sox');var csv=require(_0xf689('0x7'));var ejs=require(_0xf689('0x8'));var fs=require('fs');var fs_extra=require(_0xf689('0x9'));var _=require(_0xf689('0xa'));var squel=require('squel');var crypto=require(_0xf689('0xb'));var jsforce=require(_0xf689('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf689('0x7'));var querystring=require('querystring');var Papa=require(_0xf689('0xd'));var Redis=require(_0xf689('0xe'));var authService=require(_0xf689('0xf'));var qs=require(_0xf689('0x10'));var as=require(_0xf689('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf689('0x12'));var utils=require(_0xf689('0x13'));var config=require(_0xf689('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf689('0x15'))['db'];function respondWithStatusCode(_0x1a2c63,_0x185de8){_0x185de8=_0x185de8||0xcc;return function(_0x545371){if(_0x545371){return _0x1a2c63[_0xf689('0x16')](_0x185de8);}return _0x1a2c63[_0xf689('0x17')](_0x185de8)[_0xf689('0x18')]();};}function respondWithResult(_0x11a75d,_0x4a8e83){_0x4a8e83=_0x4a8e83||0xc8;return function(_0x15800){if(_0x15800){return _0x11a75d[_0xf689('0x17')](_0x4a8e83)['json'](_0x15800);}};}function respondWithFilteredResult(_0x1013c7,_0x45d318){return function(_0x3a9afc){if(_0x3a9afc){var _0x2f739f=typeof _0x45d318[_0xf689('0x19')]===_0xf689('0x1a')&&typeof _0x45d318[_0xf689('0x1b')]===_0xf689('0x1a');var _0x3b2fec=_0x3a9afc[_0xf689('0x1c')];var _0x3c7202=_0x2f739f?0x0:_0x45d318[_0xf689('0x19')];var _0x34d816=_0x2f739f?_0x3a9afc[_0xf689('0x1c')]:_0x45d318[_0xf689('0x19')]+_0x45d318[_0xf689('0x1b')];var _0x535ce3;if(_0x34d816>=_0x3b2fec){_0x34d816=_0x3b2fec;_0x535ce3=0xc8;}else{_0x535ce3=0xce;}_0x1013c7[_0xf689('0x17')](_0x535ce3);return _0x1013c7[_0xf689('0x1d')](_0xf689('0x1e'),_0x3c7202+'-'+_0x34d816+'/'+_0x3b2fec)['json'](_0x3a9afc);}return null;};}function patchUpdates(_0xf2d595){return function(_0x1b7b79){try{jsonpatch[_0xf689('0x1f')](_0x1b7b79,_0xf2d595,!![]);}catch(_0x2902e1){return BPromise[_0xf689('0x20')](_0x2902e1);}return _0x1b7b79['save']();};}function saveUpdates(_0x25da76,_0x168868){return function(_0x1a8fb9){if(_0x1a8fb9){return _0x1a8fb9['update'](_0x25da76)[_0xf689('0x21')](function(_0x1803ff){return _0x1803ff;});}return null;};}function removeEntity(_0x155a90,_0x4e597d){return function(_0x5bb792){if(_0x5bb792){return _0x5bb792[_0xf689('0x22')]()[_0xf689('0x21')](function(){_0x155a90[_0xf689('0x17')](0xcc)[_0xf689('0x18')]();});}};}function handleEntityNotFound(_0x92b030,_0x59d6ab){return function(_0xf96b26){if(!_0xf96b26){_0x92b030[_0xf689('0x16')](0x194);}return _0xf96b26;};}function handleError(_0x444fb7,_0x5cbd9e){_0x5cbd9e=_0x5cbd9e||0x1f4;return function(_0x536783){logger[_0xf689('0x23')](_0x536783[_0xf689('0x24')]);if(_0x536783[_0xf689('0x25')]){delete _0x536783[_0xf689('0x25')];}_0x444fb7[_0xf689('0x17')](_0x5cbd9e)[_0xf689('0x26')](_0x536783);};}exports[_0xf689('0x27')]=function(_0x22f3ae,_0x172c62){var _0x257bdb={},_0xb7fc50={},_0x4a20b9={'count':0x0,'rows':[]};var _0xe7b686=_['map'](db['ChatTransferReport'][_0xf689('0x28')],function(_0x3b57ec){return{'name':_0x3b57ec['fieldName'],'type':_0x3b57ec[_0xf689('0x29')][_0xf689('0x2a')]};});_0xb7fc50[_0xf689('0x2b')]=_['map'](_0xe7b686,_0xf689('0x25'));_0xb7fc50[_0xf689('0x2c')]=_[_0xf689('0x2d')](_0x22f3ae[_0xf689('0x2c')]);_0xb7fc50[_0xf689('0x2e')]=_[_0xf689('0x2f')](_0xb7fc50['model'],_0xb7fc50[_0xf689('0x2c')]);_0x257bdb[_0xf689('0x30')]=_['intersection'](_0xb7fc50[_0xf689('0x2b')],qs[_0xf689('0x31')](_0x22f3ae['query'][_0xf689('0x31')]));_0x257bdb['attributes']=_0x257bdb[_0xf689('0x30')][_0xf689('0x32')]?_0x257bdb[_0xf689('0x30')]:_0xb7fc50['model'];if(!_0x22f3ae[_0xf689('0x2c')][_0xf689('0x33')](_0xf689('0x34'))){_0x257bdb[_0xf689('0x1b')]=qs['limit'](_0x22f3ae[_0xf689('0x2c')][_0xf689('0x1b')]);_0x257bdb[_0xf689('0x19')]=qs[_0xf689('0x19')](_0x22f3ae[_0xf689('0x2c')]['offset']);}_0x257bdb[_0xf689('0x35')]=qs[_0xf689('0x36')](_0x22f3ae['query'][_0xf689('0x36')]);_0x257bdb['where']=qs[_0xf689('0x2e')](_[_0xf689('0x37')](_0x22f3ae['query'],_0xb7fc50[_0xf689('0x2e')]),_0xe7b686);if(_0x22f3ae[_0xf689('0x2c')]['filter']){_0x257bdb[_0xf689('0x38')]=_['merge'](_0x257bdb[_0xf689('0x38')],{'$or':_[_0xf689('0x39')](_0xe7b686,function(_0x7d18f4){if(_0x7d18f4[_0xf689('0x29')]!==_0xf689('0x3a')){var _0x4ad5a8={};_0x4ad5a8[_0x7d18f4[_0xf689('0x25')]]={'$like':'%'+_0x22f3ae['query'][_0xf689('0x3b')]+'%'};return _0x4ad5a8;}})});}_0x257bdb=_['merge']({},_0x257bdb,_0x22f3ae['options']);var _0x5a9f1e={'where':_0x257bdb[_0xf689('0x38')]};return db[_0xf689('0x3c')][_0xf689('0x1c')](_0x5a9f1e)[_0xf689('0x21')](function(_0x36e8dc){_0x4a20b9[_0xf689('0x1c')]=_0x36e8dc;if(_0x22f3ae[_0xf689('0x2c')][_0xf689('0x3d')]){_0x257bdb[_0xf689('0x3e')]=[{'all':!![]}];}return db[_0xf689('0x3c')]['findAll'](_0x257bdb);})[_0xf689('0x21')](function(_0xd2c09b){_0x4a20b9[_0xf689('0x3f')]=_0xd2c09b;return _0x4a20b9;})[_0xf689('0x21')](respondWithFilteredResult(_0x172c62,_0x257bdb))[_0xf689('0x40')](handleError(_0x172c62,null));};exports[_0xf689('0x41')]=function(_0x42698a,_0x135e2c){var _0x5010a7={'raw':!![],'where':{'id':_0x42698a[_0xf689('0x42')]['id']}},_0x3f6e94={};_0x3f6e94[_0xf689('0x2b')]=_['keys'](db[_0xf689('0x3c')]['rawAttributes']);_0x3f6e94[_0xf689('0x2c')]=_['keys'](_0x42698a[_0xf689('0x2c')]);_0x3f6e94[_0xf689('0x2e')]=_[_0xf689('0x2f')](_0x3f6e94[_0xf689('0x2b')],_0x3f6e94[_0xf689('0x2c')]);_0x5010a7['attributes']=_[_0xf689('0x2f')](_0x3f6e94['model'],qs[_0xf689('0x31')](_0x42698a[_0xf689('0x2c')][_0xf689('0x31')]));_0x5010a7[_0xf689('0x30')]=_0x5010a7[_0xf689('0x30')][_0xf689('0x32')]?_0x5010a7[_0xf689('0x30')]:_0x3f6e94[_0xf689('0x2b')];if(_0x42698a['query'][_0xf689('0x3d')]){_0x5010a7[_0xf689('0x3e')]=[{'all':!![]}];}_0x5010a7=_[_0xf689('0x43')]({},_0x5010a7,_0x42698a['options']);return db[_0xf689('0x3c')][_0xf689('0x44')](_0x5010a7)[_0xf689('0x21')](handleEntityNotFound(_0x135e2c,null))[_0xf689('0x21')](respondWithResult(_0x135e2c,null))[_0xf689('0x40')](handleError(_0x135e2c,null));};exports['create']=function(_0x1d5e84,_0x2a0d23){return db[_0xf689('0x3c')][_0xf689('0x45')](_0x1d5e84[_0xf689('0x46')],{})[_0xf689('0x21')](respondWithResult(_0x2a0d23,0xc9))[_0xf689('0x40')](handleError(_0x2a0d23,null));};exports[_0xf689('0x47')]=function(_0x51e728,_0x57bd7e){if(_0x51e728[_0xf689('0x46')]['id']){delete _0x51e728[_0xf689('0x46')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x51e728[_0xf689('0x42')]['id']}})['then'](handleEntityNotFound(_0x57bd7e,null))['then'](saveUpdates(_0x51e728[_0xf689('0x46')],null))[_0xf689('0x21')](respondWithResult(_0x57bd7e,null))[_0xf689('0x40')](handleError(_0x57bd7e,null));};exports[_0xf689('0x22')]=function(_0x3ec16d,_0x18e3cc){return db['ChatTransferReport'][_0xf689('0x44')]({'where':{'id':_0x3ec16d[_0xf689('0x42')]['id']}})[_0xf689('0x21')](handleEntityNotFound(_0x18e3cc,null))['then'](removeEntity(_0x18e3cc,null))[_0xf689('0x40')](handleError(_0x18e3cc,null));};exports['describe']=function(_0x281632,_0xe61c38){return db[_0xf689('0x3c')][_0xf689('0x48')]()[_0xf689('0x21')](respondWithResult(_0xe61c38,null))[_0xf689('0x40')](handleError(_0xe61c38,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index f9165ed..dfd7ad0 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 _0x1090=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x3bb37b,_0x33d15d){var _0x97efd5=function(_0xce0d64){while(--_0xce0d64){_0x3bb37b['push'](_0x3bb37b['shift']());}};_0x97efd5(++_0x33d15d);}(_0x1090,0x8c));var _0x0109=function(_0x27acb7,_0x261ad9){_0x27acb7=_0x27acb7-0x0;var _0x2edb13=_0x1090[_0x27acb7];return _0x2edb13;};'use strict';var _=require(_0x0109('0x0'));var util=require(_0x0109('0x1'));var logger=require(_0x0109('0x2'))(_0x0109('0x3'));var moment=require(_0x0109('0x4'));var BPromise=require(_0x0109('0x5'));var rp=require(_0x0109('0x6'));var fs=require('fs');var path=require(_0x0109('0x7'));var rimraf=require(_0x0109('0x8'));var config=require(_0x0109('0x9'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x52b238,_0x57fee7){return _0x52b238[_0x0109('0xa')](_0x0109('0xb'),attributes,{'tableName':_0x0109('0xc'),'paranoid':![],'indexes':[{'name':_0x0109('0xd'),'fields':[_0x0109('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdc7=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid'];(function(_0x16056b,_0x27e794){var _0x534079=function(_0x5be1d7){while(--_0x5be1d7){_0x16056b['push'](_0x16056b['shift']());}};_0x534079(++_0x27e794);}(_0xfdc7,0x1a4));var _0x7fdc=function(_0x24f862,_0x4b645a){_0x24f862=_0x24f862-0x0;var _0x198aa4=_0xfdc7[_0x24f862];return _0x198aa4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7fdc('0x0'))(_0x7fdc('0x1'));var moment=require(_0x7fdc('0x2'));var BPromise=require(_0x7fdc('0x3'));var rp=require(_0x7fdc('0x4'));var fs=require('fs');var path=require(_0x7fdc('0x5'));var rimraf=require(_0x7fdc('0x6'));var config=require(_0x7fdc('0x7'));var attributes=require(_0x7fdc('0x8'));module[_0x7fdc('0x9')]=function(_0x3f5609,_0x461098){return _0x3f5609['define'](_0x7fdc('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x7fdc('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 456e0d0..ab93530 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 _0xfd64=['ChatTransferReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','debug','request\x20sent','stringify','error','code','message'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0xfd64,0x15c));var _0x4fd6=function(_0x4b1db4,_0x575b59){_0x4b1db4=_0x4b1db4-0x0;var _0x221ac7=_0xfd64[_0x4b1db4];return _0x221ac7;};'use strict';var _=require(_0x4fd6('0x0'));var util=require(_0x4fd6('0x1'));var moment=require(_0x4fd6('0x2'));var BPromise=require(_0x4fd6('0x3'));var rs=require(_0x4fd6('0x4'));var fs=require('fs');var Redis=require(_0x4fd6('0x5'));var db=require(_0x4fd6('0x6'))['db'];var utils=require(_0x4fd6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x4fd6('0x8'));var jayson=require(_0x4fd6('0x9'));var client=jayson['client'][_0x4fd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b93b0,_0x4f01b8,_0x3415a5){return new BPromise(function(_0x584a35,_0x18b9d8){return client[_0x4fd6('0xb')](_0x1b93b0,_0x3415a5)[_0x4fd6('0xc')](function(_0x931491){logger[_0x4fd6('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x4f01b8,'request\x20sent');logger[_0x4fd6('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4f01b8,_0x4fd6('0xf'),JSON[_0x4fd6('0x10')](_0x931491));if(_0x931491[_0x4fd6('0x11')]){if(_0x931491['error'][_0x4fd6('0x12')]===0x1f4){logger[_0x4fd6('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4f01b8,_0x931491[_0x4fd6('0x11')][_0x4fd6('0x13')]);return _0x18b9d8(_0x931491[_0x4fd6('0x11')][_0x4fd6('0x13')]);}logger[_0x4fd6('0x11')](_0x4fd6('0x14'),_0x4f01b8,_0x931491[_0x4fd6('0x11')][_0x4fd6('0x13')]);return _0x584a35(_0x931491[_0x4fd6('0x11')][_0x4fd6('0x13')]);}else{logger[_0x4fd6('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x4f01b8,_0x4fd6('0xf'));_0x584a35(_0x931491[_0x4fd6('0x15')][_0x4fd6('0x13')]);}})[_0x4fd6('0x16')](function(_0x411c0e){logger[_0x4fd6('0x11')](_0x4fd6('0x14'),_0x4f01b8,_0x411c0e);_0x18b9d8(_0x411c0e);});});} \ No newline at end of file +var _0x7425=['then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x344412,_0x313e02){var _0x1271ef=function(_0x247b53){while(--_0x247b53){_0x344412['push'](_0x344412['shift']());}};_0x1271ef(++_0x313e02);}(_0x7425,0x172));var _0x5742=function(_0x19515c,_0x12b7ec){_0x19515c=_0x19515c-0x0;var _0x268500=_0x7425[_0x19515c];return _0x268500;};'use strict';var _=require(_0x5742('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5742('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5742('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5742('0x3'))(_0x5742('0x4'));var config=require(_0x5742('0x5'));var jayson=require(_0x5742('0x6'));var client=jayson[_0x5742('0x7')][_0x5742('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2141ba,_0x473070,_0x4b97f7){return new BPromise(function(_0x2a129a,_0x53295a){return client[_0x5742('0x9')](_0x2141ba,_0x4b97f7)[_0x5742('0xa')](function(_0xbeb719){logger['info'](_0x5742('0xb'),_0x473070,_0x5742('0xc'));logger[_0x5742('0xd')](_0x5742('0xe'),_0x473070,_0x5742('0xc'),JSON['stringify'](_0xbeb719));if(_0xbeb719[_0x5742('0xf')]){if(_0xbeb719[_0x5742('0xf')]['code']===0x1f4){logger[_0x5742('0xf')](_0x5742('0xb'),_0x473070,_0xbeb719[_0x5742('0xf')][_0x5742('0x10')]);return _0x53295a(_0xbeb719[_0x5742('0xf')][_0x5742('0x10')]);}logger[_0x5742('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x473070,_0xbeb719[_0x5742('0xf')]['message']);return _0x2a129a(_0xbeb719[_0x5742('0xf')][_0x5742('0x10')]);}else{logger[_0x5742('0x11')](_0x5742('0xb'),_0x473070,_0x5742('0xc'));_0x2a129a(_0xbeb719[_0x5742('0x12')][_0x5742('0x10')]);}})[_0x5742('0x13')](function(_0x471bc4){logger['error'](_0x5742('0xb'),_0x473070,_0x471bc4);_0x53295a(_0x471bc4);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index dff6b27..593f35a 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 _0x4c33=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','describe','show','post','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express'];(function(_0x2a410b,_0x504e73){var _0x3053de=function(_0x152dc4){while(--_0x152dc4){_0x2a410b['push'](_0x2a410b['shift']());}};_0x3053de(++_0x504e73);}(_0x4c33,0x1dc));var _0x34c3=function(_0x86dbdc,_0x31693b){_0x86dbdc=_0x86dbdc-0x0;var _0x42c1fd=_0x4c33[_0x86dbdc];return _0x42c1fd;};'use strict';var multer=require('multer');var util=require(_0x34c3('0x0'));var path=require(_0x34c3('0x1'));var timeout=require(_0x34c3('0x2'));var express=require(_0x34c3('0x3'));var router=express[_0x34c3('0x4')]();var fs_extra=require(_0x34c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x34c3('0x6'));var config=require(_0x34c3('0x7'));var controller=require(_0x34c3('0x8'));router[_0x34c3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x34c3('0x9')]('/describe',auth[_0x34c3('0xa')](),controller[_0x34c3('0xb')]);router[_0x34c3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x34c3('0xc')]);router[_0x34c3('0xd')]('/',auth[_0x34c3('0xa')](),controller['create']);router[_0x34c3('0xe')]('/:id',auth[_0x34c3('0xa')](),controller[_0x34c3('0xf')]);router[_0x34c3('0x10')](_0x34c3('0x11'),auth['isAuthenticated'](),controller[_0x34c3('0x12')]);module[_0x34c3('0x13')]=router; \ No newline at end of file +var _0x9001=['post','create','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4bc353,_0x45ac4e){var _0xf4e316=function(_0x17578c){while(--_0x17578c){_0x4bc353['push'](_0x4bc353['shift']());}};_0xf4e316(++_0x45ac4e);}(_0x9001,0x130));var _0x1900=function(_0x4f1dc7,_0x2984e7){_0x4f1dc7=_0x4f1dc7-0x0;var _0x55d6ea=_0x9001[_0x4f1dc7];return _0x55d6ea;};'use strict';var multer=require('multer');var util=require(_0x1900('0x0'));var path=require(_0x1900('0x1'));var timeout=require(_0x1900('0x2'));var express=require(_0x1900('0x3'));var router=express[_0x1900('0x4')]();var fs_extra=require(_0x1900('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1900('0x6'));var config=require(_0x1900('0x7'));var controller=require(_0x1900('0x8'));router[_0x1900('0x9')]('/',auth[_0x1900('0xa')](),controller[_0x1900('0xb')]);router[_0x1900('0x9')](_0x1900('0xc'),auth[_0x1900('0xa')](),controller[_0x1900('0xd')]);router[_0x1900('0x9')](_0x1900('0xe'),auth[_0x1900('0xa')](),controller[_0x1900('0xf')]);router[_0x1900('0x10')]('/',auth[_0x1900('0xa')](),controller[_0x1900('0x11')]);router['put']('/:id',auth[_0x1900('0xa')](),controller[_0x1900('0x12')]);router['delete'](_0x1900('0xe'),auth[_0x1900('0xa')](),controller[_0x1900('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index aca4693..c283443 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 _0xd6be=['Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Send','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','TEXT','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat'];(function(_0x42853c,_0x283973){var _0x6de34c=function(_0x53667e){while(--_0x53667e){_0x42853c['push'](_0x42853c['shift']());}};_0x6de34c(++_0x283973);}(_0xd6be,0x14f));var _0xed6b=function(_0x3b99e6,_0x383d7a){_0x3b99e6=_0x3b99e6-0x0;var _0x267410=_0xd6be[_0x3b99e6];return _0x267410;};'use strict';var Sequelize=require(_0xed6b('0x0'));var rs=require('randomstring');module[_0xed6b('0x1')]={'name':{'type':Sequelize[_0xed6b('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xed6b('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0x4')},'key':{'type':Sequelize[_0xed6b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0x5')},'customerAlias':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xed6b('0x2')],'allowNull':![],'defaultValue':_0xed6b('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xed6b('0x2')],'allowNull':![],'defaultValue':_0xed6b('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xed6b('0x2')],'allowNull':![],'defaultValue':_0xed6b('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xed6b('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xed6b('0xa')](_0xed6b('0xb'),_0xed6b('0xc')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0xd')},'start_chat_button':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0xe')},'offline_chat_button':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xed6b('0xf')},'download_transcript':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xed6b('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xed6b('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xed6b('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xed6b('0x12')},'noteTitle':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0x13')},'placeholderMessage':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0x14')},'closingMessage':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0x15')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xed6b('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xed6b('0x17')},'ratingType':{'type':Sequelize[_0xed6b('0xa')](_0xed6b('0x18'),_0xed6b('0x19')),'defaultValue':_0xed6b('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xed6b('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xed6b('0x1a')]({'items':[{'type':_0xed6b('0x1b'),'variable':null,'config':{'placeholder':_0xed6b('0x1c'),'type':_0xed6b('0x1d'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xed6b('0x1b'),'props':{'title':_0xed6b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xed6b('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xed6b('0x1e')](_0xed6b('0x1f'))?JSON['parse'](this[_0xed6b('0x1e')](_0xed6b('0x1f'))):{};},'set':function(_0x223d29){return this['setDataValue'](_0xed6b('0x1f'),JSON[_0xed6b('0x1a')](_0x223d29));}},'offlineForm':{'type':Sequelize[_0xed6b('0x20')],'defaultValue':function(){return JSON[_0xed6b('0x1a')]({'items':[{'type':_0xed6b('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xed6b('0x4'),'type':_0xed6b('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0xed6b('0x21'),'helpText':_0xed6b('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xed6b('0x23'))?JSON['parse'](this['getDataValue']('offlineForm')):{};},'set':function(_0x47bdf4){return this[_0xed6b('0x24')](_0xed6b('0x23'),JSON['stringify'](_0x47bdf4));}},'token':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':function(){return rs[_0xed6b('0x25')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xed6b('0x2')]},'forwardOffline':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xed6b('0x2')]},'waitingTitle':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0x26')},'waitingMessage':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0x27')},'offlineMessageBody':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0x15')},'enableCustomerAttachment':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xed6b('0x20')]},'showAgentAvatar':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xed6b('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xed6b('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xed6b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xed6b('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0x2a')},'messagesAlignment':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0x2b')},'defaultTitle':{'type':Sequelize[_0xed6b('0x2')]},'customerAvatar':{'type':Sequelize[_0xed6b('0x20')]},'showCustomerAvatar':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xed6b('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xed6b('0x2')],'allowNull':![],'defaultValue':_0xed6b('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xed6b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':_0xed6b('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xed6b('0x8')],'comment':_0xed6b('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![],'comment':_0xed6b('0x2f'),'set':function(_0x2a9137){if(!_0x2a9137)this[_0xed6b('0x24')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x2a9137);}},'vidaooEscalation':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xed6b('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xed6b('0x30')},'vidaooNote':{'type':Sequelize[_0xed6b('0x2')],'defaultValue':function(){return _0xed6b('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xed6b('0x20')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xed6b('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xed6b('0x20')]}}; \ No newline at end of file +var _0x6303=['Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','parse','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'];(function(_0x458d68,_0x1dbe12){var _0x3e4a4b=function(_0x3f7b04){while(--_0x3f7b04){_0x458d68['push'](_0x458d68['shift']());}};_0x3e4a4b(++_0x1dbe12);}(_0x6303,0x15d));var _0x3630=function(_0x1ebd92,_0x363a1d){_0x1ebd92=_0x1ebd92-0x0;var _0x2c4308=_0x6303[_0x1ebd92];return _0x2c4308;};'use strict';var Sequelize=require(_0x3630('0x0'));var rs=require(_0x3630('0x1'));module[_0x3630('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x3630('0x3')],'allowNull':![],'unique':_0x3630('0x4')},'description':{'type':Sequelize[_0x3630('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3630('0x6')},'customerAlias':{'type':Sequelize[_0x3630('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3630('0x3')],'allowNull':![],'defaultValue':_0x3630('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3630('0x3')],'allowNull':![],'defaultValue':_0x3630('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3630('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3630('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3630('0x3')]},'animation':{'type':Sequelize[_0x3630('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3630('0xa')](_0x3630('0xb'),_0x3630('0xc')),'defaultValue':_0x3630('0xb')},'header_online':{'type':Sequelize[_0x3630('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x3630('0xd')},'offline_chat_button':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x3630('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3630('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3630('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x3630('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x13')},'noteTitle':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x14')},'placeholderMessage':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3630('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x3630('0xe')},'skipMessageButton':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x17')},'conditionAgreement':{'type':Sequelize[_0x3630('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3630('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3630('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x18')},'ratingType':{'type':Sequelize[_0x3630('0xa')](_0x3630('0x19'),_0x3630('0x1a')),'defaultValue':_0x3630('0x19')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3630('0x1b')]({'items':[{'type':_0x3630('0x1c'),'variable':null,'config':{'placeholder':_0x3630('0x1d'),'type':_0x3630('0x1e'),'required':!![]},'props':{'title':_0x3630('0x1d'),'helpText':''}},{'type':_0x3630('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x3630('0x5'),'type':_0x3630('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3630('0x1f')](_0x3630('0x20'))?JSON['parse'](this[_0x3630('0x1f')](_0x3630('0x20'))):{};},'set':function(_0x2e77a5){return this[_0x3630('0x21')](_0x3630('0x20'),JSON[_0x3630('0x1b')](_0x2e77a5));}},'offlineForm':{'type':Sequelize[_0x3630('0x10')],'defaultValue':function(){return JSON[_0x3630('0x1b')]({'items':[{'type':_0x3630('0x1c'),'props':{'title':_0x3630('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3630('0x5')},'variable':null},{'type':_0x3630('0x22'),'config':{'placeholder':_0x3630('0x23')},'props':{'title':'Comments','helpText':_0x3630('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x3630('0x1f')]('offlineForm')?JSON[_0x3630('0x25')](this[_0x3630('0x1f')]('offlineForm')):{};},'set':function(_0x206c8d){return this[_0x3630('0x21')](_0x3630('0x26'),JSON['stringify'](_0x206c8d));}},'token':{'type':Sequelize[_0x3630('0x3')],'defaultValue':function(){return rs[_0x3630('0x27')]();}},'autoclose':{'type':Sequelize[_0x3630('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3630('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3630('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3630('0x3')]},'waitingTitle':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x28')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3630('0x29')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x2a')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x2b')},'skipUnmanaged':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x17')},'sendUnmanaged':{'type':Sequelize[_0x3630('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x3630('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3630('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3630('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3630('0x10')],'defaultValue':function(){return _0x3630('0x2c');}},'notificationSound':{'type':Sequelize[_0x3630('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3630('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3630('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3630('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x2e')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x3630('0x3')],'defaultValue':_0x3630('0x2f')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3630('0x30')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x3630('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x3630('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3630('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3630('0x31'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3630('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3630('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3630('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3630('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3630('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3630('0x8')],'comment':_0x3630('0x32')},'mandatoryDisposition':{'type':Sequelize[_0x3630('0x9')],'defaultValue':![],'comment':_0x3630('0x33'),'set':function(_0x4d151f){if(!_0x4d151f)this['setDataValue'](_0x3630('0x34'),null);this[_0x3630('0x21')](_0x3630('0x35'),_0x4d151f);}},'vidaooEscalation':{'type':Sequelize[_0x3630('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3630('0x3')]},'vidaooTopic':{'type':Sequelize[_0x3630('0x3')],'allowNull':![],'defaultValue':_0x3630('0x36')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x3630('0x37');}},'vidaooMetadata':{'type':Sequelize[_0x3630('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3630('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 783f714..1fb2a32 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 _0x446c=['Interval','Intervals','getProactiveActions','increment','chatLicenseExceeded','all','remote','x-real-ip','connection','virtual','replace','render','verticalAlignment','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','bluebird','mustache','util','path','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','destroy','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','map','ChatWebsite','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','rows','show','mandatoryDispositionPause','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','params','ChatWebsiteId','findOne','Disposition','rawAttributes','hasOwnProperty','removeDispositions','ids','CannedAnswer','findAll','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','join','server/files/images/logos/','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','download','getCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','asc','defaults','from','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','get','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','readFileSync','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','forwardOffline','forwardOfflineAddress','Smtp','service','host','port','secure','authentication','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x446c,0x156));var _0xc446=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x446c[_0x277107];return _0x1da046;};'use strict';var BPromise=require(_0xc446('0x0'));var Mustache=require(_0xc446('0x1'));var util=require(_0xc446('0x2'));var path=require(_0xc446('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc446('0x4'));var _=require(_0xc446('0x5'));var querystring=require(_0xc446('0x6'));var Redis=require('ioredis');var qs=require(_0xc446('0x7'));var logger=require('../../config/logger')('api');var config=require(_0xc446('0x8'));var db=require(_0xc446('0x9'))['db'];config['redis']=_['defaults'](config[_0xc446('0xa')],{'host':_0xc446('0xb'),'port':0x18eb});var socket=require(_0xc446('0xc'))(new Redis(config[_0xc446('0xa')]));require(_0xc446('0xd'))['register'](socket);var htmlToText=require(_0xc446('0xe'));var jayson=require(_0xc446('0xf'));var client=jayson[_0xc446('0x10')][_0xc446('0x11')]({'port':0x232c});var client9002=jayson['client'][_0xc446('0x11')]({'port':0x232a});var client9003=jayson[_0xc446('0x10')][_0xc446('0x11')]({'port':0x232b});var client9001=jayson[_0xc446('0x10')][_0xc446('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x6a5c0f,_0x1a2099,_0x19083f,_0x22a70e){return new BPromise(function(_0x2bc17f,_0x89a7){var _0x306814=_0x22a70e||client;return _0x306814[_0xc446('0x12')](_0x6a5c0f,_0x19083f)[_0xc446('0x13')](function(_0x21d8e4){logger[_0xc446('0x14')](_0xc446('0x15'),_0x1a2099,_0xc446('0x16'));logger[_0xc446('0x17')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1a2099,_0xc446('0x16'),JSON[_0xc446('0x18')](_0x21d8e4));if(_0x21d8e4[_0xc446('0x19')]){if(_0x21d8e4[_0xc446('0x19')][_0xc446('0x1a')]===0x1f4){logger[_0xc446('0x19')](_0xc446('0x15'),_0x1a2099,_0x21d8e4[_0xc446('0x19')][_0xc446('0x1b')]);return _0x89a7(_0x21d8e4[_0xc446('0x19')]['message']);}logger[_0xc446('0x19')](_0xc446('0x15'),_0x1a2099,_0x21d8e4['error'][_0xc446('0x1b')]);return _0x2bc17f(_0x21d8e4[_0xc446('0x19')][_0xc446('0x1b')]);}else{logger[_0xc446('0x14')](_0xc446('0x15'),_0x1a2099,_0xc446('0x16'));_0x2bc17f(_0x21d8e4[_0xc446('0x1c')][_0xc446('0x1b')]);}})[_0xc446('0x1d')](function(_0x3eda0f){logger['error'](_0xc446('0x15'),_0x1a2099,_0x3eda0f);_0x89a7(_0x3eda0f);});});}function respondWithStatusCode(_0x1ea08b,_0x21dc0e){_0x21dc0e=_0x21dc0e||0xcc;return function(_0x5bbde7){if(_0x5bbde7){return _0x1ea08b[_0xc446('0x1e')](_0x21dc0e);}return _0x1ea08b[_0xc446('0x1f')](_0x21dc0e)[_0xc446('0x20')]();};}function respondWithResult(_0x1b785a,_0x380fd6){_0x380fd6=_0x380fd6||0xc8;return function(_0x189ee7){if(_0x189ee7){return _0x1b785a[_0xc446('0x1f')](_0x380fd6)[_0xc446('0x21')](_0x189ee7);}};}function respondWithFilteredResult(_0x25f58d,_0x438410){return function(_0x16133b){if(_0x16133b){var _0x1d1585=typeof _0x438410[_0xc446('0x22')]==='undefined'&&typeof _0x438410[_0xc446('0x23')]===_0xc446('0x24');var _0x3b0adf=_0x16133b[_0xc446('0x25')];var _0x215cd6=_0x1d1585?0x0:_0x438410[_0xc446('0x22')];var _0x5d5aa8=_0x1d1585?_0x16133b['count']:_0x438410[_0xc446('0x22')]+_0x438410[_0xc446('0x23')];var _0x19f57f;if(_0x5d5aa8>=_0x3b0adf){_0x5d5aa8=_0x3b0adf;_0x19f57f=0xc8;}else{_0x19f57f=0xce;}_0x25f58d[_0xc446('0x1f')](_0x19f57f);return _0x25f58d['set'](_0xc446('0x26'),_0x215cd6+'-'+_0x5d5aa8+'/'+_0x3b0adf)[_0xc446('0x21')](_0x16133b);}return null;};}function saveUpdates(_0x3a308a){return function(_0x16be29){if(_0x16be29){return _0x16be29[_0xc446('0x27')](_0x3a308a)[_0xc446('0x13')](function(_0x39302a){return _0x39302a;});}return null;};}function removeEntity(_0x45b7c4){return function(_0x300110){if(_0x300110){return _0x300110[_0xc446('0x28')]()['then'](function(){var _0x4aca0c=_0x300110['get']({'plain':!![]});var _0x32bbac=_0xc446('0x29');return db[_0xc446('0x2a')][_0xc446('0x28')]({'where':{'type':_0x32bbac,'resourceId':_0x4aca0c['id']}})[_0xc446('0x13')](function(){return _0x300110;});})[_0xc446('0x13')](function(){_0x45b7c4[_0xc446('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1567ca){return function(_0x12a69e){if(!_0x12a69e){_0x1567ca[_0xc446('0x1e')](0x194);}return _0x12a69e;};}function handleError(_0x21bca6,_0x964c61){_0x964c61=_0x964c61||0x1f4;return function(_0x510f39){logger[_0xc446('0x19')](_0x510f39[_0xc446('0x2b')]);if(_0x510f39[_0xc446('0x2c')]){delete _0x510f39[_0xc446('0x2c')];}_0x21bca6[_0xc446('0x1f')](_0x964c61)[_0xc446('0x2d')](_0x510f39);};}exports[_0xc446('0x2e')]=function(_0x22d5bd,_0x5c2bf3){var _0x513292={'include':[{'model':db[_0xc446('0x2f')],'as':'mandatoryDispositionPause'}]},_0x22ce00={},_0x396ec6={'count':0x0,'rows':[]};var _0x2b4dae=_[_0xc446('0x30')](db[_0xc446('0x31')]['rawAttributes'],function(_0x487818){return{'name':_0x487818['fieldName'],'type':_0x487818[_0xc446('0x32')]['key']};});_0x22ce00[_0xc446('0x33')]=_[_0xc446('0x30')](_0x2b4dae,'name');_0x22ce00[_0xc446('0x34')]=_[_0xc446('0x35')](_0x22d5bd[_0xc446('0x34')]);_0x22ce00[_0xc446('0x36')]=_['intersection'](_0x22ce00[_0xc446('0x33')],_0x22ce00[_0xc446('0x34')]);_0x513292['attributes']=_[_0xc446('0x37')](_0x22ce00[_0xc446('0x33')],qs[_0xc446('0x38')](_0x22d5bd[_0xc446('0x34')][_0xc446('0x38')]));_0x513292['attributes']=_0x513292[_0xc446('0x39')][_0xc446('0x3a')]?_0x513292[_0xc446('0x39')]:_0x22ce00[_0xc446('0x33')];if(!_0x22d5bd[_0xc446('0x34')]['hasOwnProperty'](_0xc446('0x3b'))){_0x513292[_0xc446('0x23')]=qs[_0xc446('0x23')](_0x22d5bd[_0xc446('0x34')][_0xc446('0x23')]);_0x513292['offset']=qs[_0xc446('0x22')](_0x22d5bd['query'][_0xc446('0x22')]);}_0x513292[_0xc446('0x3c')]=qs['sort'](_0x22d5bd[_0xc446('0x34')][_0xc446('0x3d')]);_0x513292[_0xc446('0x3e')]=qs[_0xc446('0x36')](_[_0xc446('0x3f')](_0x22d5bd[_0xc446('0x34')],_0x22ce00['filters']),_0x2b4dae);if(_0x22d5bd[_0xc446('0x34')][_0xc446('0x40')]){_0x513292[_0xc446('0x3e')]=_['merge'](_0x513292[_0xc446('0x3e')],{'$or':_[_0xc446('0x30')](_0x2b4dae,function(_0x864b27){if(_0x864b27[_0xc446('0x32')]!==_0xc446('0x41')){var _0x2a2aaa={};_0x2a2aaa[_0x864b27[_0xc446('0x2c')]]={'$like':'%'+_0x22d5bd[_0xc446('0x34')][_0xc446('0x40')]+'%'};return _0x2a2aaa;}})});}_0x513292=_[_0xc446('0x42')]({},_0x513292,_0x22d5bd[_0xc446('0x43')]);var _0x6bc8fd={'where':_0x513292[_0xc446('0x3e')]};return db[_0xc446('0x31')][_0xc446('0x25')](_0x6bc8fd)['then'](function(_0x4a9f08){_0x396ec6[_0xc446('0x25')]=_0x4a9f08;if(_0x22d5bd[_0xc446('0x34')]['includeAll']){_0x513292['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x513292);})[_0xc446('0x13')](function(_0x2b6bf3){_0x396ec6[_0xc446('0x44')]=_0x2b6bf3;return _0x396ec6;})[_0xc446('0x13')](respondWithFilteredResult(_0x5c2bf3,_0x513292))[_0xc446('0x1d')](handleError(_0x5c2bf3,null));};exports[_0xc446('0x45')]=function(_0x34f860,_0x21c41e){var _0x173652={'raw':![],'where':{'id':_0x34f860['params']['id']},'include':[{'model':db[_0xc446('0x2f')],'as':_0xc446('0x46')}]},_0x2114d2={};_0x2114d2[_0xc446('0x33')]=_['keys'](db[_0xc446('0x31')]['rawAttributes']);_0x2114d2[_0xc446('0x34')]=_[_0xc446('0x35')](_0x34f860[_0xc446('0x34')]);_0x2114d2[_0xc446('0x36')]=_[_0xc446('0x37')](_0x2114d2['model'],_0x2114d2[_0xc446('0x34')]);_0x173652['attributes']=_[_0xc446('0x37')](_0x2114d2['model'],qs[_0xc446('0x38')](_0x34f860['query'][_0xc446('0x38')]));_0x173652[_0xc446('0x39')]=_0x173652['attributes']['length']?_0x173652[_0xc446('0x39')]:_0x2114d2['model'];if(_0x34f860[_0xc446('0x34')][_0xc446('0x47')]){_0x173652[_0xc446('0x48')]=[{'all':!![]}];}_0x173652=_[_0xc446('0x42')]({},_0x173652,_0x34f860[_0xc446('0x43')]);return db[_0xc446('0x31')][_0xc446('0x49')](_0x173652)['then'](handleEntityNotFound(_0x21c41e,null))[_0xc446('0x13')](respondWithResult(_0x21c41e,null))[_0xc446('0x1d')](handleError(_0x21c41e,null));};exports[_0xc446('0x4a')]=function(_0x2d6762,_0x4cf59b){return db[_0xc446('0x31')][_0xc446('0x4a')](_0x2d6762[_0xc446('0x4b')],{})[_0xc446('0x13')](function(_0x3f86d6){var _0x1616d4=_0x2d6762[_0xc446('0x4c')]['get']({'plain':!![]});if(!_0x1616d4)throw new Error(_0xc446('0x4d'));if(_0x1616d4[_0xc446('0x4e')]===_0xc446('0x4c')){var _0xba94a8=_0x3f86d6['get']({'plain':!![]});var _0x48a5da=_0xc446('0x29');return db['UserProfileSection'][_0xc446('0x49')]({'where':{'name':_0x48a5da,'userProfileId':_0x1616d4[_0xc446('0x4f')]},'raw':!![]})[_0xc446('0x13')](function(_0x59e67e){if(_0x59e67e&&_0x59e67e[_0xc446('0x50')]===0x0){return db[_0xc446('0x2a')][_0xc446('0x4a')]({'name':_0xba94a8['name'],'resourceId':_0xba94a8['id'],'type':_0x59e67e['name'],'sectionId':_0x59e67e['id']},{})[_0xc446('0x13')](function(){return _0x3f86d6;});}else{return _0x3f86d6;}})[_0xc446('0x1d')](function(_0x425fb8){logger[_0xc446('0x19')](_0xc446('0x51'),_0x425fb8);throw _0x425fb8;});}return _0x3f86d6;})[_0xc446('0x13')](respondWithResult(_0x4cf59b,0xc9))[_0xc446('0x1d')](handleError(_0x4cf59b,null));};exports[_0xc446('0x27')]=function(_0x35ba56,_0x3d0031){if(_0x35ba56[_0xc446('0x4b')]['id']){delete _0x35ba56['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x35ba56['params']['id']},'include':[{'model':db['Pause'],'as':_0xc446('0x46')}]})[_0xc446('0x13')](handleEntityNotFound(_0x3d0031,null))[_0xc446('0x13')](saveUpdates(_0x35ba56[_0xc446('0x4b')],null))[_0xc446('0x13')](respondWithResult(_0x3d0031,null))['catch'](handleError(_0x3d0031,null));};exports[_0xc446('0x28')]=function(_0x5e0872,_0x3cec25){return db[_0xc446('0x31')][_0xc446('0x49')]({'where':{'id':_0x5e0872['params']['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x3cec25,null))['then'](removeEntity(_0x3cec25,null))[_0xc446('0x1d')](handleError(_0x3cec25,null));};exports[_0xc446('0x52')]=function(_0x4cf4f4,_0x3e73bf){return db[_0xc446('0x31')][_0xc446('0x52')]()[_0xc446('0x13')](respondWithResult(_0x3e73bf,null))['catch'](handleError(_0x3e73bf,null));};exports[_0xc446('0x53')]=function(_0x21267f,_0x31eb58){if(_0x21267f[_0xc446('0x4b')]['id']){delete _0x21267f['body']['id'];}return db['ChatWebsite'][_0xc446('0x49')]({'where':{'id':_0x21267f[_0xc446('0x54')]['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x31eb58,null))[_0xc446('0x13')](function(_0x18412d){if(_0x18412d){_0x21267f[_0xc446('0x4b')][_0xc446('0x55')]=_0x18412d['id'];return db['Disposition'][_0xc446('0x4a')](_0x21267f[_0xc446('0x4b')]);}})[_0xc446('0x13')](respondWithResult(_0x31eb58,null))['catch'](handleError(_0x31eb58,null));};exports['getDispositions']=function(_0x52db50,_0x4e4879){var _0x4adac8={'raw':![],'where':{}};var _0x19fa9f={};var _0x4fcda5={'count':0x0,'rows':[]};return db[_0xc446('0x31')][_0xc446('0x56')]({'where':{'id':_0x52db50[_0xc446('0x54')]['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x4e4879,null))[_0xc446('0x13')](function(_0x3630b6){if(_0x3630b6){_0x19fa9f[_0xc446('0x33')]=_[_0xc446('0x35')](db[_0xc446('0x57')][_0xc446('0x58')]);_0x19fa9f['query']=_[_0xc446('0x35')](_0x52db50[_0xc446('0x34')]);_0x19fa9f[_0xc446('0x36')]=_[_0xc446('0x37')](_0x19fa9f['model'],_0x19fa9f[_0xc446('0x34')]);_0x4adac8[_0xc446('0x39')]=_[_0xc446('0x37')](_0x19fa9f[_0xc446('0x33')],qs['fields'](_0x52db50['query'][_0xc446('0x38')]));_0x4adac8[_0xc446('0x39')]=_0x4adac8[_0xc446('0x39')]['length']?_0x4adac8['attributes']:_0x19fa9f[_0xc446('0x33')];if(!_0x52db50[_0xc446('0x34')][_0xc446('0x59')]('nolimit')){_0x4adac8[_0xc446('0x23')]=qs['limit'](_0x52db50[_0xc446('0x34')][_0xc446('0x23')]);_0x4adac8[_0xc446('0x22')]=qs[_0xc446('0x22')](_0x52db50[_0xc446('0x34')][_0xc446('0x22')]);}_0x4adac8[_0xc446('0x3c')]=qs['sort'](_0x52db50[_0xc446('0x34')][_0xc446('0x3d')]);_0x4adac8[_0xc446('0x3e')]=qs[_0xc446('0x36')](_[_0xc446('0x3f')](_0x52db50['query'],_0x19fa9f['filters']));_0x4adac8[_0xc446('0x3e')]['ChatWebsiteId']=_0x3630b6['id'];if(_0x52db50[_0xc446('0x34')][_0xc446('0x40')]){_0x4adac8[_0xc446('0x3e')]=_[_0xc446('0x42')](_0x4adac8['where'],{'$or':_[_0xc446('0x30')](_0x4adac8[_0xc446('0x39')],function(_0x272264){var _0x31979a={};_0x31979a[_0x272264]={'$like':'%'+_0x52db50[_0xc446('0x34')][_0xc446('0x40')]+'%'};return _0x31979a;})});}_0x4adac8=_[_0xc446('0x42')]({},_0x4adac8,_0x52db50[_0xc446('0x43')]);return db['Disposition']['count']({'where':_0x4adac8[_0xc446('0x3e')]})['then'](function(_0x597e8a){_0x4fcda5[_0xc446('0x25')]=_0x597e8a;if(_0x52db50[_0xc446('0x34')]['includeAll']){_0x4adac8[_0xc446('0x48')]=[{'all':!![]}];}return db[_0xc446('0x57')]['findAll'](_0x4adac8);})['then'](function(_0x1baf4a){_0x4fcda5[_0xc446('0x44')]=_0x1baf4a;return _0x4fcda5;});}})[_0xc446('0x13')](respondWithFilteredResult(_0x4e4879,_0x4adac8))[_0xc446('0x1d')](handleError(_0x4e4879,null));};exports['removeDispositions']=function(_0x38ee5c,_0x477919){return db[_0xc446('0x31')][_0xc446('0x49')]({'where':{'id':_0x38ee5c[_0xc446('0x54')]['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x477919,null))[_0xc446('0x13')](function(_0x4851ea){if(_0x4851ea){return _0x4851ea[_0xc446('0x5a')](_0x38ee5c[_0xc446('0x34')][_0xc446('0x5b')]);}})[_0xc446('0x13')](respondWithStatusCode(_0x477919,null))[_0xc446('0x1d')](handleError(_0x477919,null));};exports['addAnswer']=function(_0x498560,_0x41ca35){if(_0x498560['body']['id']){delete _0x498560['body']['id'];}return db[_0xc446('0x31')][_0xc446('0x49')]({'where':{'id':_0x498560['params']['id']}})['then'](handleEntityNotFound(_0x41ca35,null))[_0xc446('0x13')](function(_0x1df147){if(_0x1df147){_0x498560[_0xc446('0x4b')][_0xc446('0x55')]=_0x1df147['id'];return db[_0xc446('0x5c')][_0xc446('0x4a')](_0x498560[_0xc446('0x4b')]);}})[_0xc446('0x13')](respondWithResult(_0x41ca35,null))[_0xc446('0x1d')](handleError(_0x41ca35,null));};exports['getAnswers']=function(_0xce0f3c,_0x20642f){var _0x5e683e={'raw':![],'where':{}};var _0x4361e5={};var _0x464abf={'count':0x0,'rows':[]};return db[_0xc446('0x31')][_0xc446('0x56')]({'where':{'id':_0xce0f3c[_0xc446('0x54')]['id']}})['then'](handleEntityNotFound(_0x20642f,null))['then'](function(_0xbdd557){if(_0xbdd557){_0x4361e5[_0xc446('0x33')]=_[_0xc446('0x35')](db[_0xc446('0x5c')][_0xc446('0x58')]);_0x4361e5[_0xc446('0x34')]=_['keys'](_0xce0f3c[_0xc446('0x34')]);_0x4361e5[_0xc446('0x36')]=_[_0xc446('0x37')](_0x4361e5[_0xc446('0x33')],_0x4361e5[_0xc446('0x34')]);_0x5e683e[_0xc446('0x39')]=_[_0xc446('0x37')](_0x4361e5['model'],qs[_0xc446('0x38')](_0xce0f3c[_0xc446('0x34')]['fields']));_0x5e683e[_0xc446('0x39')]=_0x5e683e[_0xc446('0x39')]['length']?_0x5e683e[_0xc446('0x39')]:_0x4361e5[_0xc446('0x33')];if(!_0xce0f3c[_0xc446('0x34')]['hasOwnProperty'](_0xc446('0x3b'))){_0x5e683e[_0xc446('0x23')]=qs[_0xc446('0x23')](_0xce0f3c[_0xc446('0x34')][_0xc446('0x23')]);_0x5e683e[_0xc446('0x22')]=qs['offset'](_0xce0f3c[_0xc446('0x34')][_0xc446('0x22')]);}_0x5e683e['order']=qs[_0xc446('0x3d')](_0xce0f3c[_0xc446('0x34')][_0xc446('0x3d')]);_0x5e683e[_0xc446('0x3e')]=qs['filters'](_['pick'](_0xce0f3c[_0xc446('0x34')],_0x4361e5[_0xc446('0x36')]));_0x5e683e[_0xc446('0x3e')]['ChatWebsiteId']=_0xbdd557['id'];if(_0xce0f3c['query'][_0xc446('0x40')]){_0x5e683e[_0xc446('0x3e')]=_['merge'](_0x5e683e[_0xc446('0x3e')],{'$or':_[_0xc446('0x30')](_0x5e683e['attributes'],function(_0x223168){var _0x30528f={};_0x30528f[_0x223168]={'$like':'%'+_0xce0f3c['query'][_0xc446('0x40')]+'%'};return _0x30528f;})});}_0x5e683e=_[_0xc446('0x42')]({},_0x5e683e,_0xce0f3c[_0xc446('0x43')]);return db[_0xc446('0x5c')][_0xc446('0x25')]({'where':_0x5e683e['where']})[_0xc446('0x13')](function(_0x1a57fa){_0x464abf[_0xc446('0x25')]=_0x1a57fa;if(_0xce0f3c['query'][_0xc446('0x47')]){_0x5e683e[_0xc446('0x48')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc446('0x5d')](_0x5e683e);})['then'](function(_0x498e2c){_0x464abf['rows']=_0x498e2c;return _0x464abf;});}})[_0xc446('0x13')](respondWithFilteredResult(_0x20642f,_0x5e683e))[_0xc446('0x1d')](handleError(_0x20642f,null));};exports[_0xc446('0x5e')]=function(_0x28e17b,_0x36e722){return db['ChatWebsite'][_0xc446('0x49')]({'where':{'id':_0x28e17b[_0xc446('0x54')]['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x36e722,null))['then'](function(_0x526c8c){if(_0x526c8c){return _0x526c8c[_0xc446('0x5e')](_0x28e17b[_0xc446('0x34')]['ids']);}})[_0xc446('0x13')](respondWithStatusCode(_0x36e722,null))[_0xc446('0x1d')](handleError(_0x36e722,null));};exports[_0xc446('0x5f')]=function(_0x258dbd,_0x30ef3b){_0x258dbd[_0xc446('0x4b')][_0xc446('0x60')]=_0x258dbd[_0xc446('0x61')][_0xc446('0x62')];return db[_0xc446('0x31')][_0xc446('0x49')]({'where':{'id':_0x258dbd[_0xc446('0x54')]['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x30ef3b,null))[_0xc446('0x13')](saveUpdates(_0x258dbd[_0xc446('0x4b')],null))['then'](respondWithResult(_0x30ef3b,null))[_0xc446('0x1d')](handleError(_0x30ef3b,null));};exports['addAvatar']=function(_0x56ff12,_0x3411f9){_0x56ff12['body']['agentAvatar']=_0x56ff12[_0xc446('0x61')][_0xc446('0x62')];return db['ChatWebsite']['find']({'where':{'id':_0x56ff12['params']['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x3411f9,null))[_0xc446('0x13')](saveUpdates(_0x56ff12[_0xc446('0x4b')],null))[_0xc446('0x13')](respondWithResult(_0x3411f9,null))[_0xc446('0x1d')](handleError(_0x3411f9,null));};exports[_0xc446('0x63')]=function(_0x4f56be,_0x5f0012){_0x4f56be[_0xc446('0x4b')][_0xc446('0x64')]=_0x4f56be[_0xc446('0x61')][_0xc446('0x62')];return db[_0xc446('0x31')][_0xc446('0x49')]({'where':{'id':_0x4f56be[_0xc446('0x54')]['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x5f0012,null))['then'](saveUpdates(_0x4f56be['body'],null))[_0xc446('0x13')](respondWithResult(_0x5f0012,null))[_0xc446('0x1d')](handleError(_0x5f0012,null));};exports[_0xc446('0x65')]=function(_0x1fa8b1,_0x50a8b2){_0x1fa8b1[_0xc446('0x4b')][_0xc446('0x66')]=_0x1fa8b1['file'][_0xc446('0x62')];return db[_0xc446('0x31')][_0xc446('0x49')]({'where':{'id':_0x1fa8b1[_0xc446('0x54')]['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x50a8b2,null))[_0xc446('0x13')](saveUpdates(_0x1fa8b1['body'],null))[_0xc446('0x13')](respondWithResult(_0x50a8b2,null))['catch'](handleError(_0x50a8b2,null));};exports[_0xc446('0x67')]=function(_0x576b99,_0x3c747c){var _0x13ee0c=path['join'](config[_0xc446('0x68')],_0xc446('0x69'));var _0xdd82c3={'where':{'id':_0x576b99['params']['id']},'attributes':['id',_0xc446('0x60')],'raw':!![]};var _0x9eb55f=![];return require(_0xc446('0x6a'))[_0xc446('0x6b')]()[_0xc446('0x13')](function(_0x23e62f){if(_0x23e62f){_0x9eb55f=_0x23e62f[_0xc446('0x6c')];}})[_0xc446('0x13')](function(){return db[_0xc446('0x31')]['find'](_0xdd82c3);})[_0xc446('0x13')](handleEntityNotFound(_0x3c747c,null))[_0xc446('0x13')](function(_0x4130bc){if(_0x4130bc){if(!_[_0xc446('0x6d')](_0x4130bc[_0xc446('0x60')])){if(fs['existsSync'](path[_0xc446('0x6e')](config[_0xc446('0x68')],_0xc446('0x6f'),_0x4130bc['sitepic']))&&_0x9eb55f){_0x13ee0c=path[_0xc446('0x6e')](config[_0xc446('0x68')],_0xc446('0x6f'),_0x4130bc[_0xc446('0x60')]);}}return _0x3c747c['download'](_0x13ee0c);}})[_0xc446('0x1d')](handleError(_0x3c747c,null));};exports['getAvatar']=function(_0x4cd32c,_0x356818){var _0x278955=path[_0xc446('0x6e')](config[_0xc446('0x68')],_0xc446('0x70'));var _0x485ba7={'where':{'id':_0x4cd32c[_0xc446('0x54')]['id']},'attributes':['id',_0xc446('0x71')],'raw':!![]};return db[_0xc446('0x31')][_0xc446('0x49')](_0x485ba7)['then'](handleEntityNotFound(_0x356818,null))[_0xc446('0x13')](function(_0x4cdcd9){if(_0x4cdcd9){if(!_[_0xc446('0x6d')](_0x4cdcd9['agentAvatar'])){if(fs[_0xc446('0x72')](path['join'](config[_0xc446('0x68')],'server/files/images/avatars/',_0x4cdcd9[_0xc446('0x71')]))){_0x278955=path['join'](config[_0xc446('0x68')],_0xc446('0x73'),_0x4cdcd9['agentAvatar']);}}return _0x356818[_0xc446('0x74')](_0x278955);}})[_0xc446('0x1d')](handleError(_0x356818,null));};exports[_0xc446('0x75')]=function(_0x1425de,_0x327e5a){var _0x49bbe3=path[_0xc446('0x6e')](config[_0xc446('0x68')],'server/files/images/avatars/customer_avatar.png');var _0x157a68={'where':{'id':_0x1425de[_0xc446('0x54')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xc446('0x31')][_0xc446('0x49')](_0x157a68)['then'](handleEntityNotFound(_0x327e5a,null))[_0xc446('0x13')](function(_0x6ad5e6){if(_0x6ad5e6){if(!_[_0xc446('0x6d')](_0x6ad5e6[_0xc446('0x64')])){if(fs[_0xc446('0x72')](path[_0xc446('0x6e')](config[_0xc446('0x68')],_0xc446('0x73'),_0x6ad5e6[_0xc446('0x64')]))&&_0x6ad5e6['showCustomerAvatar']){_0x49bbe3=path[_0xc446('0x6e')](config[_0xc446('0x68')],'server/files/images/avatars/',_0x6ad5e6['customerAvatar']);}}return _0x327e5a['download'](_0x49bbe3);}})['catch'](handleError(_0x327e5a,null));};exports[_0xc446('0x76')]=function(_0x185820,_0x433afa){var _0x2e46a2=path['join'](config[_0xc446('0x68')],_0xc446('0x77'));var _0x11f269={'where':{'id':_0x185820['params']['id']},'attributes':['id',_0xc446('0x66')],'raw':!![]};return db['ChatWebsite'][_0xc446('0x49')](_0x11f269)[_0xc446('0x13')](handleEntityNotFound(_0x433afa,null))[_0xc446('0x13')](function(_0x485a42){if(_0x485a42){if(!_[_0xc446('0x6d')](_0x485a42[_0xc446('0x66')])){if(fs['existsSync'](path['join'](config[_0xc446('0x68')],_0xc446('0x73'),_0x485a42[_0xc446('0x66')]))){_0x2e46a2=path[_0xc446('0x6e')](config[_0xc446('0x68')],'server/files/images/avatars/',_0x485a42[_0xc446('0x66')]);}}return _0x433afa[_0xc446('0x74')](_0x2e46a2);}})[_0xc446('0x1d')](handleError(_0x433afa,null));};exports[_0xc446('0x78')]=function(_0x33fe0d,_0x4333ab){var _0x567043=require(_0xc446('0x79'));var _0x365eda=new _0x567043();var _0x3b93dc=_0x365eda[_0xc446('0x7a')](_0x33fe0d[_0xc446('0x7b')][_0xc446('0x7c')])[_0xc446('0x7d')]();var _0xc7de21={'body':_0x33fe0d[_0xc446('0x4b')],'channel':_0xc446('0x7e')};var _0x16ed64=[];var _0x1e69d9=[];var _0x524acb={};var _0x3be10c=![];return db[_0xc446('0x7f')][_0xc446('0x52')]()[_0xc446('0x13')](function(_0x134eba){if(!_0x134eba){throw new db[(_0xc446('0x80'))][(_0xc446('0x81'))](_0xc446('0x82'));}_0x16ed64=_[_0xc446('0x83')](_[_0xc446('0x35')](_0x134eba),[_0xc446('0x84'),_0xc446('0x85')]);_0x1e69d9=_['difference'](_[_0xc446('0x35')](_0x134eba),[_0xc446('0x84'),_0xc446('0x85'),_0xc446('0x86'),_0xc446('0x87')]);if(_0x33fe0d['body']['id']){delete _0x33fe0d[_0xc446('0x4b')]['id'];}if(_[_0xc446('0x6d')](_0x33fe0d['body']['from'])){throw new db['Sequelize'][(_0xc446('0x81'))](_0xc446('0x88'));}if(_[_0xc446('0x6d')](_0x33fe0d[_0xc446('0x4b')][_0xc446('0x4b')])||_0x33fe0d['body']['body']===''){throw new db[(_0xc446('0x80'))][(_0xc446('0x81'))](_0xc446('0x89'));}if(_['isNil'](_0x33fe0d[_0xc446('0x4b')][_0xc446('0x8a')])){throw new db['Sequelize'][(_0xc446('0x81'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1e69d9);}if(!_[_0xc446('0x8b')](_0x1e69d9,_0x33fe0d[_0xc446('0x4b')]['mapKey'])){throw new db[(_0xc446('0x80'))][(_0xc446('0x81'))](_0xc446('0x8c')+_0x1e69d9);}_0x524acb[_0x33fe0d[_0xc446('0x4b')]['mapKey']]=_0x33fe0d[_0xc446('0x4b')]['from'];})[_0xc446('0x13')](function(){return db[_0xc446('0x31')][_0xc446('0x49')]({'where':{'id':_0x33fe0d['params']['id']},'include':[{'model':db[_0xc446('0x8d')],'as':_0xc446('0x8e'),'include':[{'model':db['CmContact'],'as':_0xc446('0x8f'),'where':_0x524acb,'limit':0x1,'order':[[_0xc446('0x85'),_0xc446('0x90')]]}]},{'model':db[_0xc446('0x91')],'as':_0xc446('0x92')}]});})[_0xc446('0x13')](handleEntityNotFound(_0x4333ab,null))[_0xc446('0x13')](function(_0x510d9b){if(_0x510d9b&&_0x510d9b['List']){_0xc7de21[_0xc446('0x93')]=_0x510d9b;_0xc7de21[_0xc446('0x94')]=_0x510d9b['Applications'];_0xc7de21[_0xc446('0x95')]=_0x510d9b[_0xc446('0x8e')];_0xc7de21[_0xc446('0x94')]=_['orderBy'](_0xc7de21[_0xc446('0x94')],['priority'],[_0xc446('0x96')]);if(_0xc7de21[_0xc446('0x93')][_0xc446('0x92')]){delete _0xc7de21[_0xc446('0x93')]['Applications'];}if(_0xc7de21['account']['List']&&_0xc7de21['account'][_0xc446('0x8e')]['Contacts']['length']){return _0xc7de21[_0xc446('0x93')][_0xc446('0x8e')]['Contacts'][0x0];}var _0x1c28b1=_[_0xc446('0x97')](_0x33fe0d[_0xc446('0x4b')],{'firstName':_0x33fe0d[_0xc446('0x4b')][_0xc446('0x98')],'ListId':_0x510d9b[_0xc446('0x87')]});_0x1c28b1[_0x33fe0d[_0xc446('0x4b')]['mapKey']]=_0x33fe0d[_0xc446('0x4b')][_0xc446('0x98')];return db[_0xc446('0x7f')][_0xc446('0x4a')](_0x1c28b1,{'fields':_0x16ed64,'raw':!![]});}})[_0xc446('0x13')](handleEntityNotFound(_0x4333ab,null))[_0xc446('0x13')](function(_0x5b684a){_0xc7de21[_0xc446('0x99')]=_0x5b684a;var _0x1e63c4=_0x33fe0d[_0xc446('0x4b')][_0xc446('0x9a')];if(_0x33fe0d['headers']['cf-connecting-ip']){_0x1e63c4=_0x33fe0d['headers'][_0xc446('0x9b')];}else if(_0x33fe0d[_0xc446('0x7b')][_0xc446('0x9c')]){_0x1e63c4=_[_0xc446('0x9d')](_0x33fe0d['headers'][_0xc446('0x9c')][_0xc446('0x9e')](','));}if(_0x5b684a){var _0x20d3cb={'ContactId':_0x5b684a['id'],'ChatWebsiteId':_0x33fe0d[_0xc446('0x54')]['id'],'from':(_0x5b684a[_0xc446('0x9f')]||'')+'\x20'+(_0x5b684a[_0xc446('0xa0')]||''),'customerIp':_0x1e63c4,'customerPort':_0x33fe0d[_0xc446('0x7b')][_0xc446('0xa1')]?_0x33fe0d['headers'][_0xc446('0xa1')]:null,'referer':_0x33fe0d[_0xc446('0x4b')][_0xc446('0xa2')],'browserName':_0x3b93dc[_0xc446('0xa3')][_0xc446('0x2c')]&&_0x3b93dc['browser']['version']?util[_0xc446('0xa4')](_0xc446('0xa5'),_0x3b93dc['browser'][_0xc446('0x2c')],_0x3b93dc['browser']['version']):'unknown','browserVersion':_0x3b93dc['browser'][_0xc446('0xa6')]||'unknown','osName':util[_0xc446('0xa4')](_0xc446('0xa5'),_0x3b93dc['os'][_0xc446('0x2c')],_0x3b93dc['os'][_0xc446('0xa6')]),'osVersion':_0x3b93dc['os'][_0xc446('0xa6')],'deviceModel':_0x3b93dc[_0xc446('0xa7')][_0xc446('0x33')]&&_0x3b93dc['device'][_0xc446('0xa8')]?util[_0xc446('0xa4')]('%s\x20%s\x20%s',_0x3b93dc[_0xc446('0xa7')][_0xc446('0x33')],_0x3b93dc[_0xc446('0xa7')]['vendor'],_0x3b93dc[_0xc446('0xa7')]['type']):null,'deviceVendor':_0x3b93dc['device'][_0xc446('0xa8')],'deviceType':_0x3b93dc[_0xc446('0xa7')][_0xc446('0x32')],'formData':JSON[_0xc446('0x18')](_0x33fe0d[_0xc446('0x4b')])};var _0x195bf0={'ChatWebsiteId':_0x33fe0d[_0xc446('0x54')]['id'],'closed':![]};if(_0x33fe0d[_0xc446('0x4b')]['threadId']){_0x195bf0['threadId']=_0x33fe0d[_0xc446('0x4b')]['threadId'];return db['ChatInteraction']['find']({'where':_0x195bf0})[_0xc446('0x13')](function(_0x5b1bfa){if(_0x5b1bfa){return[_0x5b1bfa,![]];}_0x20d3cb[_0xc446('0xa9')]=_0x33fe0d[_0xc446('0x4b')][_0xc446('0xa9')];_0x20d3cb[_0xc446('0xaa')]=_0x33fe0d[_0xc446('0x4b')][_0xc446('0xaa')];return db[_0xc446('0xab')]['create'](_0x20d3cb)[_0xc446('0x13')](function(_0x3dc942){return[_0x3dc942,!![]];});});}_0x195bf0[_0xc446('0xac')]=_0x5b684a['id'];if(_0x33fe0d[_0xc446('0x4b')][_0xc446('0xad')]&&_0x33fe0d[_0xc446('0x4b')][_0xc446('0xad')]['id']){_0x195bf0['id']=_0x33fe0d[_0xc446('0x4b')][_0xc446('0xad')]['id'];return db[_0xc446('0xab')][_0xc446('0x49')]({'where':_0x195bf0})[_0xc446('0x13')](function(_0x93aa23){if(_0x93aa23){return[_0x93aa23,![]];}return db[_0xc446('0xab')][_0xc446('0x4a')](_0x20d3cb)[_0xc446('0x13')](function(_0x307ade){return[_0x307ade,!![]];});});}return db[_0xc446('0xab')][_0xc446('0x4a')](_0x20d3cb)[_0xc446('0x13')](function(_0x3885e9){return[_0x3885e9,!![]];});}})[_0xc446('0xae')](function(_0x2faaa7,_0x3c6989){if(_0x2faaa7){_0x3be10c=_0x3c6989;if(!_0x3c6989){var _0x1cdad7={'from':(_0xc7de21['contact'][_0xc446('0x9f')]||'')+'\x20'+(_0xc7de21[_0xc446('0x99')]['lastName']||'')};if(_0x33fe0d[_0xc446('0x4b')]['threadId']&&_0x33fe0d[_0xc446('0x4b')]['messageId']&&_0x33fe0d[_0xc446('0x4b')]['threadId']!=_0x33fe0d[_0xc446('0x4b')][_0xc446('0xaf')]){_0x1cdad7[_0xc446('0xa9')]=_0x33fe0d[_0xc446('0x4b')][_0xc446('0xaf')];}return _0x2faaa7[_0xc446('0x27')](_0x1cdad7);}else{return _0x2faaa7;}}})[_0xc446('0x13')](function(_0x588ce0){_0xc7de21[_0xc446('0xad')]=_0x588ce0[_0xc446('0xb0')]({'plain':!![]});_0xc7de21['interaction'][_0xc446('0xb1')]=_0x3be10c;if(_0xc7de21[_0xc446('0xad')][_0xc446('0xb1')]){if(_0xc7de21[_0xc446('0x93')][_0xc446('0xb2')]){_0xc7de21['applications'][_0xc446('0xb3')]({'id':0x0,'priority':_0xc7de21['applications'][_0xc446('0x3a')]+0x1,'app':_0xc446('0xb4'),'appdata':_0xc446('0xb5'),'interval':'*,*,*,*'});}}return db[_0xc446('0xb6')][_0xc446('0x4a')]({'body':_0x33fe0d[_0xc446('0x4b')][_0xc446('0x4b')],'ChatWebsiteId':_0x33fe0d[_0xc446('0x54')]['id'],'ChatInteractionId':_0x588ce0['id'],'direction':'in','ContactId':_0xc7de21[_0xc446('0x99')]['id'],'AttachmentId':_0x33fe0d[_0xc446('0x4b')][_0xc446('0xb7')]});})[_0xc446('0x13')](function(_0x111201){_0xc7de21[_0xc446('0x1b')]=_0x111201;if(_0xc7de21[_0xc446('0xad')][_0xc446('0xb8')]){return db[_0xc446('0xb9')][_0xc446('0x49')]({'attributes':['id','name'],'where':{'id':_0xc7de21[_0xc446('0xad')][_0xc446('0xb8')]}})['then'](function(_0x211378){if(_0x211378){_0xc7de21[_0xc446('0x94')][_0xc446('0xba')]({'id':0x0,'priority':0x0,'app':_0xc446('0xbb'),'appdata':_0x211378[_0xc446('0x2c')]+','+(_0xc7de21['account'][_0xc446('0xbc')]||0xa),'interval':_0xc446('0xbd')});_0xc7de21[_0xc446('0xbe')]=!![];}return respondWithRpcPromise(_0xc446('0xbf'),_0xc446('0xc0'),_0xc7de21);});}return respondWithRpcPromise(_0xc446('0xbf'),_0xc446('0xc0'),_0xc7de21);})[_0xc446('0x13')](function(_0x348c7c){respondWithRpcPromise(_0xc446('0xc1'),'EventManager',{'event':_0xc446('0x78'),'message':_0x348c7c},client9002);return _0x348c7c;})[_0xc446('0x13')](respondWithResult(_0x4333ab,null))['catch'](handleError(_0x4333ab,null));};exports['offline']=function(_0xd7b906,_0x5940ad){var _0x2728c3,_0x2dfdae,_0x105db0;var _0x21f3a4=[];var _0x264a42={};var _0x160a7f=_0xd7b906[_0xc446('0xc2')]||[];var _0xdd732d=[];var _0x1b7d03;return db[_0xc446('0x7f')]['describe']()[_0xc446('0x13')](function(_0x1eebf3){if(!_0x1eebf3){throw new db[(_0xc446('0x80'))]['ValidationError'](_0xc446('0x82'));}_0x21f3a4=_[_0xc446('0x83')](_['keys'](_0x1eebf3),[_0xc446('0x84'),'updatedAt',_0xc446('0x86'),'ListId']);if(_0xd7b906['body']['id']){delete _0xd7b906[_0xc446('0x4b')]['id'];}if(_[_0xc446('0x6d')](_0xd7b906['body'][_0xc446('0x98')])){throw _0x5940ad[_0xc446('0x1f')](0x1f4)[_0xc446('0x2d')](new db['Sequelize'][(_0xc446('0x81'))](_0xc446('0x88')));}if(_['isNil'](_0xd7b906[_0xc446('0x4b')][_0xc446('0x4b')])||_0xd7b906['body'][_0xc446('0x4b')]===''){throw _0x5940ad[_0xc446('0x1f')](0x1f4)['send'](new db[(_0xc446('0x80'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xc446('0x6d')](_0xd7b906[_0xc446('0x4b')]['mapKeyOffline'])){throw _0x5940ad[_0xc446('0x1f')](0x1f4)[_0xc446('0x2d')](new db[(_0xc446('0x80'))][(_0xc446('0x81'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x21f3a4));}if(!_['includes'](_0x21f3a4,_0xd7b906[_0xc446('0x4b')]['mapKeyOffline'])){throw _0x5940ad[_0xc446('0x1f')](0x1f4)[_0xc446('0x2d')](new db[(_0xc446('0x80'))][(_0xc446('0x81'))](_0xc446('0xc3')+_0x21f3a4));}_0x264a42[_0xd7b906[_0xc446('0x4b')][_0xc446('0xc4')]]=_0xd7b906[_0xc446('0x4b')][_0xc446('0x98')];})[_0xc446('0x13')](function(){return db[_0xc446('0x31')][_0xc446('0x49')]({'where':{'id':_0xd7b906[_0xc446('0x54')]['id']},'include':[{'model':db[_0xc446('0x8d')],'as':_0xc446('0x8e')},{'model':db['MailAccount'],'as':_0xc446('0xc5')}]});})[_0xc446('0x13')](handleEntityNotFound(_0x5940ad,null))[_0xc446('0x13')](function(_0xbd26d7){if(_0xbd26d7&&_0xbd26d7[_0xc446('0x8e')]){_0x2dfdae=_0xbd26d7;var _0x119e22=_[_0xc446('0x97')](_0xd7b906[_0xc446('0x4b')],{'firstName':_0xd7b906['body'][_0xc446('0x98')],'phone':_0xd7b906[_0xc446('0x4b')][_0xc446('0x98')],'ListId':_0xbd26d7[_0xc446('0x87')]});_0x119e22[_0xd7b906[_0xc446('0x4b')][_0xc446('0xc4')]]=_0xd7b906[_0xc446('0x4b')]['from'];return db[_0xc446('0x7f')]['findOrCreate']({'where':_0x264a42,'defaults':_0x119e22});}})[_0xc446('0xae')](function(_0x48e52f){if(_0x48e52f){_0x105db0=_0x48e52f;var _0x303e43=fs[_0xc446('0xc6')](path[_0xc446('0x6e')](config[_0xc446('0x68')],'server/files/templates/chatOfflineMessage.ejs'),_0xc446('0xc7'));var _0x3bf637=ejs['render'](_0x303e43,{'body':_[_0xc446('0xc8')](_0xd7b906[_0xc446('0x4b')][_0xc446('0x4b')]),'bodyTitle':_0x2dfdae[_0xc446('0xc9')]});return db[_0xc446('0xca')][_0xc446('0x4a')]({'body':_0x3bf637,'plainBody':htmlToText[_0xc446('0xcb')](_0x3bf637),'ContactId':_0x48e52f['id'],'ChatWebsiteId':_0x2dfdae['id']});}})['then'](function(_0x12ac23){_0x1b7d03=_0x12ac23;if(_0x160a7f[_0xc446('0x3a')]){var _0xf5f0be=_0x160a7f[_0xc446('0x30')](function(_0xc743e3){return{'name':_0xc743e3[_0xc446('0xcc')],'basename':_0xc743e3[_0xc446('0x62')],'type':_0xc743e3[_0xc446('0xcd')],'ChatOfflineMessageId':_0x12ac23['id']};});_0xdd732d=_0xf5f0be[_0xc446('0x30')](_0x5b90a0=>{var _0x58df1f={'filename':_0x5b90a0[_0xc446('0x2c')],'path':path['join'](config[_0xc446('0x68')],'server','files','attachments',_0xc446('0xce'),_0x5b90a0[_0xc446('0xcf')])};return _0x58df1f;});if(!_0x2dfdae[_0xc446('0xd0')]){return db[_0xc446('0xd1')]['transaction'](function(_0x5ead89){return db[_0xc446('0xd2')][_0xc446('0xd3')](_0xf5f0be,{'transaction':_0x5ead89});});}}})[_0xc446('0x13')](function(){if(_0x1b7d03){_0x2728c3=_0x1b7d03;return db[_0xc446('0xc5')][_0xc446('0x56')]({'where':{'active':!![]},'include':[{'model':db[_0xc446('0xd4')],'as':'Smtp','raw':!![]}]});}})[_0xc446('0x13')](function(_0x32c0c1){if(_0x32c0c1&&_0x32c0c1['Smtp']&&_0x2dfdae[_0xc446('0xd5')]&&_0x2dfdae[_0xc446('0xd6')]){var _0x3b6860={'tls':{'rejectUnauthorized':![]}};if(_0x32c0c1[_0xc446('0xd7')][_0xc446('0xd8')]){_0x3b6860['service']=_0x32c0c1['Smtp'][_0xc446('0xd8')];}else{_0x3b6860[_0xc446('0xd9')]=_0x32c0c1['Smtp']['host'];_0x3b6860['port']=_0x32c0c1['Smtp'][_0xc446('0xda')];_0x3b6860[_0xc446('0xdb')]=_0x32c0c1['Smtp']['secure'];}if(_0x32c0c1[_0xc446('0xd7')][_0xc446('0xdc')]){_0x3b6860['auth']={'user':_0x32c0c1[_0xc446('0xd7')][_0xc446('0x4c')],'pass':_0x32c0c1[_0xc446('0xd7')]['pass']};}return respondWithRpcPromise(_0xc446('0xdd'),_0xc446('0xde'),{'account':_0x3b6860,'message':{'from':util[_0xc446('0xa4')](_0xc446('0xdf'),_0x32c0c1[_0xc446('0x2c')],_0x32c0c1[_0xc446('0xe0')]||_0x32c0c1[_0xc446('0xd7')]['user']),'to':_0x2dfdae[_0xc446('0xd6')],'subject':_0x2dfdae[_0xc446('0xe1')],'html':_0x2728c3[_0xc446('0x4b')],'attachments':_0xdd732d}},client9003)['then'](function(){return _0x2728c3;})[_0xc446('0x1d')](function(_0x53482f){console[_0xc446('0x19')](_0x53482f);});}})['then'](function(){if(_0x2dfdae&&_0x2dfdae[_0xc446('0xd0')]&&_0x2dfdae[_0xc446('0xe2')]){var _0x208d35=[];if(_0x160a7f[_0xc446('0x3a')]){_0x208d35=_0x160a7f[_0xc446('0x30')](function(_0x3a877f){return{'name':_0x3a877f['originalname'],'basename':_0x3a877f[_0xc446('0x62')],'type':_0x3a877f[_0xc446('0xcd')],'ChatOfflineMessageId':_0x1b7d03['id']};});}var _0xb6eaee;if(!_[_0xc446('0x6d')](_0x2dfdae[_0xc446('0xe3')])){var _0x4e5248=_[_0xc446('0x30')](_0xd7b906[_0xc446('0x4b')],function(_0x52fbc2){return _0x52fbc2;});var _0x845e85=_[_0xc446('0xe4')](_0x4e5248)[0x0];var _0x502718=_[_0xc446('0xe5')](_0x845e85,function(_0x397ee0){return _0x397ee0;});_0xb6eaee=_0x502718[0x1][_0x2dfdae['subjectOffline']];}var _0xe3e6b4={'from':_0x105db0[_0xc446('0xe0')],'firstName':_0x105db0['firstName'],'lastName':_0x105db0[_0xc446('0xa0')],'mapKey':_0xc446('0xe0'),'message':{'from':_0x105db0[_0xc446('0xe0')],'to':_0x2dfdae['MailAccount'][_0xc446('0xe0')],'cc':'','subject':_[_0xc446('0x6d')](_0xb6eaee)?_0x2dfdae[_0xc446('0xe1')]:_0xb6eaee,'messageId':'','sentAt':new Date(),'attach':_0x208d35[_0xc446('0x3a')],'attachments':_0x208d35,'originChannel':_0xc446('0xe6'),'ChatWebsiteId':_0x2dfdae['id'],'ChatOfflineMessageId':_0x2728c3['id'],'originTo':_0x2dfdae['MailAccount'][_0xc446('0xe0')]},'body':_0x2728c3[_0xc446('0x4b')]};var _0x13458c={'account':{'id':_0x2dfdae['MailAccountId']},'body':_0xe3e6b4,'log':_0xc446('0xe7')};return respondWithRpcPromise(_0xc446('0xe7'),_0xc446('0xe8'),_0x13458c,client9001)[_0xc446('0x13')](function(){return _0x2728c3;})['catch'](function(_0x2fcb59){console[_0xc446('0x19')](_0x2fcb59);});}return;})[_0xc446('0x13')](function(){if(_0x2728c3){return _0x2728c3;}})[_0xc446('0x13')](respondWithResult(_0x5940ad,null))[_0xc446('0x1d')](function(_0x3b2fda){console[_0xc446('0x19')]('catch',_0x3b2fda);for(var _0x5ab765 of _0x160a7f){var _0x24ed62=path[_0xc446('0x6e')](config[_0xc446('0x68')],_0xc446('0xe9'),_0xc446('0xc2'),'attachments',_0xc446('0xce'),_0x5ab765['filename']);fs_extra[_0xc446('0xea')](_0x24ed62)['catch'](function(_0x533d08){console['error'](_0xc446('0xeb'),_0x24ed62,_0x533d08);});}});};exports[_0xc446('0xec')]=function(_0x2aa0ed,_0x3594fd){return db['ChatInteraction'][_0xc446('0x49')]({'where':{'id':_0x2aa0ed['params']['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x3594fd,null))['then'](function(_0x590593){if(_0x590593){return _0x590593[_0xc446('0xec')](_0x2aa0ed[_0xc446('0x4b')][_0xc446('0x5b')],_[_0xc446('0xed')](_0x2aa0ed[_0xc446('0x4b')],[_0xc446('0x5b'),'id'])||{});}})[_0xc446('0x13')](respondWithResult(_0x3594fd,null))[_0xc446('0x1d')](handleError(_0x3594fd,null));};exports[_0xc446('0xee')]=function(_0x269713,_0x2c8de4){var _0x540d55={'raw':![],'where':{}};var _0x3e0299={};var _0x5445e7={'count':0x0,'rows':[]};return db[_0xc446('0x31')][_0xc446('0x56')]({'where':{'id':_0x269713[_0xc446('0x54')]['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x2c8de4,null))[_0xc446('0x13')](function(_0x3c91a9){if(_0x3c91a9){_0x3e0299[_0xc446('0x33')]=_[_0xc446('0x35')](db[_0xc446('0xab')]['rawAttributes']);_0x3e0299[_0xc446('0x34')]=_[_0xc446('0x35')](_0x269713[_0xc446('0x34')]);_0x3e0299[_0xc446('0x36')]=_[_0xc446('0x37')](_0x3e0299[_0xc446('0x33')],_0x3e0299[_0xc446('0x34')]);_0x540d55[_0xc446('0x39')]=_[_0xc446('0x37')](_0x3e0299[_0xc446('0x33')],qs[_0xc446('0x38')](_0x269713[_0xc446('0x34')][_0xc446('0x38')]));_0x540d55['attributes']=_0x540d55[_0xc446('0x39')][_0xc446('0x3a')]?_0x540d55[_0xc446('0x39')]:_0x3e0299[_0xc446('0x33')];if(!_0x269713[_0xc446('0x34')][_0xc446('0x59')](_0xc446('0x3b'))){_0x540d55[_0xc446('0x23')]=qs[_0xc446('0x23')](_0x269713['query'][_0xc446('0x23')]);_0x540d55[_0xc446('0x22')]=qs[_0xc446('0x22')](_0x269713[_0xc446('0x34')][_0xc446('0x22')]);}_0x540d55[_0xc446('0x3c')]=qs[_0xc446('0x3d')](_0x269713['query']['sort']);_0x540d55[_0xc446('0x3e')]=qs[_0xc446('0x36')](_[_0xc446('0x3f')](_0x269713[_0xc446('0x34')],_0x3e0299[_0xc446('0x36')]));_0x540d55[_0xc446('0x3e')][_0xc446('0x55')]=_0x3c91a9['id'];if(_0x269713['query'][_0xc446('0x40')]){_0x540d55[_0xc446('0x3e')]=_[_0xc446('0x42')](_0x540d55['where'],{'$or':_['map'](_0x540d55[_0xc446('0x39')],function(_0x32bfe9){var _0x13893b={};_0x13893b[_0x32bfe9]={'$like':'%'+_0x269713[_0xc446('0x34')][_0xc446('0x40')]+'%'};return _0x13893b;})});}_0x540d55=_[_0xc446('0x42')]({},_0x540d55,_0x269713[_0xc446('0x43')]);return db['ChatInteraction'][_0xc446('0x25')]({'where':_0x540d55['where']})[_0xc446('0x13')](function(_0x4671af){_0x5445e7[_0xc446('0x25')]=_0x4671af;if(_0x269713['query']['includeAll']){_0x540d55[_0xc446('0x48')]=[{'model':db['CmContact'],'as':_0xc446('0xef'),'required':![]},{'model':db[_0xc446('0xb9')],'as':_0xc446('0xf0'),'attributes':['name','fullname',_0xc446('0xf1')],'required':![]},{'model':db[_0xc446('0xf2')],'as':_0xc446('0xf3'),'attributes':['id',_0xc446('0x2c'),_0xc446('0xf4')],'where':_0x269713[_0xc446('0x34')][_0xc446('0xf5')]?{'id':_0x269713[_0xc446('0x34')][_0xc446('0xf5')]}:undefined,'required':_0x269713[_0xc446('0x34')][_0xc446('0xf5')]?!![]:![]}];}return db['ChatInteraction'][_0xc446('0x5d')](_0x540d55);})[_0xc446('0x13')](function(_0x1e17e3){_0x5445e7[_0xc446('0x44')]=_0x1e17e3;return _0x5445e7;});}})[_0xc446('0x13')](respondWithFilteredResult(_0x2c8de4,_0x540d55))[_0xc446('0x1d')](handleError(_0x2c8de4,null));};function iftimePromise(_0x128b15,_0x11dcd1){return respondWithRpcPromise(_0xc446('0xf6'),'getSnippet',{'command':_0x11dcd1[_0xc446('0xf7')]?util[_0xc446('0xa4')](_0xc446('0xf8'),_0x128b15[_0xc446('0xf9')],_0x11dcd1[_0xc446('0xf7')]):util[_0xc446('0xa4')]('iftime\x20%s',_0x128b15[_0xc446('0xf9')])},client9002)[_0xc446('0x13')](function(_0x52cc05){var _0xd399d2=_0x52cc05&&_0x52cc05[_0xc446('0xfa')](_0xc446('0xfb'))>=0x0?!![]:![];logger[_0xc446('0x14')](_0xc446('0xfc'),_0x11dcd1['id'],_0x128b15['id'],_0x128b15[_0xc446('0xf9')],_0xd399d2?_0xc446('0xfd'):'OFFLINE',_0x11dcd1[_0xc446('0xf7')]?_0x11dcd1[_0xc446('0xf7')]:_0xc446('0xfe'));return _0xd399d2;})['catch'](function(_0x432306){logger[_0xc446('0x19')](_0xc446('0xfc'),_0x11dcd1['id'],_0x128b15['id'],_0x128b15[_0xc446('0xf9')],util[_0xc446('0xff')](_0x432306,{'showHidden':![],'depth':null}),_0x11dcd1[_0xc446('0xf7')]?_0x11dcd1['timezone']:_0xc446('0xfe'));return![];});}exports['getSnippet']=function(_0x1b44f4,_0x289e2c){var _0x468997=0x0;var _0x1d52d0=0x0;var _0x557caf=![];var _0x218a17;var _0x48ba3b;return db[_0xc446('0x31')][_0xc446('0x49')]({'where':{'id':_0x1b44f4['params']['id']},'include':[{'model':db[_0xc446('0x100')],'as':_0xc446('0x100'),'include':[{'model':db[_0xc446('0x100')],'as':_0xc446('0x101'),'attributes':['id',_0xc446('0xf9')],'raw':!![]}]}]})[_0xc446('0x13')](handleEntityNotFound(_0x289e2c,null))[_0xc446('0x13')](function(_0x480d9a){if(_0x480d9a){_0x218a17=_0x480d9a;return _0x480d9a[_0xc446('0x102')]({'raw':!![]});}})['then'](function(_0x749435){if(_0x218a17){if(_0x749435){_0x48ba3b=_0x749435;}}return require(_0xc446('0x6a'))[_0xc446('0x6b')]();})[_0xc446('0x13')](function(_0x3a1807){if(_0x3a1807){_0x1d52d0=_0x3a1807['virtual'];_0x557caf=_0x3a1807['custom'];}})['then'](function(){return db[_0xc446('0xab')]['count']({'where':{'closed':![]}});})[_0xc446('0x13')](function(_0x1ead90){_0x468997=_0x1ead90;if(_0x1d52d0&&_0x1ead90>_0x1d52d0){return db['License'][_0xc446('0x56')]({'where':{'id':0x1}})[_0xc446('0x13')](function(_0x2f8ae1){if(_0x2f8ae1){_0x2f8ae1[_0xc446('0x103')](_0xc446('0x104'));}});}})[_0xc446('0x13')](function(){if(_0x218a17[_0xc446('0x100')]&&_0x218a17['Interval'][_0xc446('0x101')]){var _0x26d37e=[];for(var _0x18402c=0x0;_0x18402c<_0x218a17[_0xc446('0x100')][_0xc446('0x101')]['length'];_0x18402c++){var _0x1a1d87=_0x218a17['Interval'][_0xc446('0x101')][_0x18402c][_0xc446('0xb0')]({'plain':!![]});_0x26d37e[_0xc446('0xb3')](iftimePromise(_0x1a1d87,_0x218a17));}return BPromise[_0xc446('0x105')](_0x26d37e)[_0xc446('0x13')](function(_0x199a43){return _['some'](_0x199a43);});}else{return!![];}})[_0xc446('0x13')](function(_0x2dfc83){var _0xcbe46a=fs['readFileSync'](path[_0xc446('0x6e')](config[_0xc446('0x68')],'server/files/chat/iframe.ejs'),_0xc446('0xc7'));var _0x176f06={'remote':_0x218a17[_0xc446('0x106')],'query':querystring[_0xc446('0x18')](_[_0xc446('0x42')](_0x218a17[_0xc446('0xb0')]({'plain':!![]}),{'customerIp':_0x1b44f4[_0xc446('0x7b')]['x-forwarded-for']||_0x1b44f4[_0xc446('0x7b')][_0xc446('0x107')]||_0x1b44f4[_0xc446('0x108')]['remoteAddress']||_0x1b44f4['ip'],'referer':_0x1b44f4[_0xc446('0x7b')][_0xc446('0xa2')],'openedInteractions':_0x468997,'maxInteractions':_0x1d52d0,'virtual':_0x557caf[_0xc446('0x109')],'online':_0x2dfc83,'custom':_0x557caf}))[_0xc446('0x10a')](/'/g,'\x5c\x27')};_0x289e2c[_0xc446('0x2d')](ejs['render'](Mustache[_0xc446('0x10b')](_0xcbe46a,_0x176f06),{'proactiveActions':_0x48ba3b,'alignment':_0x218a17['alignment'],'verticalAlignment':_0x218a17[_0xc446('0x10c')],'div_color':_0x218a17['color'],'labelText':_0x218a17['labelText'],'text_color':_0x218a17[_0xc446('0x10d')],'button_color':_0x218a17[_0xc446('0x10e')],'background_color':_0x218a17[_0xc446('0x10f')],'hideWhenOffline':_0x218a17[_0xc446('0x110')],'interval':_0x218a17[_0xc446('0x111')]}));})['catch'](handleError(_0x289e2c,null));};exports[_0xc446('0x112')]=function(_0x581519,_0x125c3c){var _0x2b1532=_0x581519[_0xc446('0x54')]['id'];var _0x2f6fa8=_0x581519[_0xc446('0x4b')];var _0x31b55e=0xc8;var _0xbe8a57=null;return db[_0xc446('0xd1')][_0xc446('0x113')]({'isolationLevel':db['sequelize'][_0xc446('0x114')][_0xc446('0x115')][_0xc446('0x116')]},function(_0x33d70c){return db[_0xc446('0x31')][_0xc446('0x56')]({'where':{'id':_0x2b1532},'transaction':_0x33d70c})[_0xc446('0x13')](function(_0x1d0e4e){if(_0x1d0e4e){return db[_0xc446('0x91')][_0xc446('0x28')]({'where':{'ChatWebsiteId':_0x2b1532},'transaction':_0x33d70c})[_0xc446('0x13')](function(){var _0x32bd45=_[_0xc446('0x30')](_0x2f6fa8,function(_0x20d672){_0x20d672[_0xc446('0x55')]=_0x2b1532;return _0x20d672;});return db[_0xc446('0x91')][_0xc446('0xd3')](_0x32bd45,{'transaction':_0x33d70c});});}else{_0x31b55e=0x194;_0xbe8a57=[];}});})[_0xc446('0x13')](function(){if(_0x31b55e!==0x194){return db[_0xc446('0x91')][_0xc446('0x117')]({'where':{'ChatWebsiteId':_0x2b1532},'order':_0xc446('0x118')})['then'](function(_0x3a2537){_0xbe8a57=_0x3a2537;});}})[_0xc446('0x1d')](function(_0x20cd3c){_0x31b55e=0x1f4;logger['error'](_0x20cd3c[_0xc446('0x2b')]);if(_0x20cd3c[_0xc446('0x2c')]){delete _0x20cd3c['name'];}_0xbe8a57=_0x20cd3c;})[_0xc446('0x119')](function(){if(_0xbe8a57===null){_0x125c3c[_0xc446('0x1e')](_0x31b55e);}else{if(_0x31b55e===0x1f4){_0x125c3c[_0xc446('0x1f')](_0x31b55e)[_0xc446('0x2d')](_0xbe8a57);}else{_0x125c3c[_0xc446('0x1f')](_0x31b55e)[_0xc446('0x21')](_0xbe8a57);}}});};exports[_0xc446('0x11a')]=function(_0x2e7bbe,_0xc2575){var _0x44668b={};var _0x3c76da={};var _0x2fe23f;var _0x112044;return db[_0xc446('0x31')][_0xc446('0x56')]({'where':{'id':_0x2e7bbe[_0xc446('0x54')]['id']}})['then'](handleEntityNotFound(_0xc2575,null))['then'](function(_0x1dd874){if(_0x1dd874){_0x2fe23f=_0x1dd874;_0x3c76da[_0xc446('0x33')]=_[_0xc446('0x35')](db[_0xc446('0x91')][_0xc446('0x58')]);_0x3c76da[_0xc446('0x34')]=_['keys'](_0x2e7bbe['query']);_0x3c76da['filters']=_[_0xc446('0x37')](_0x3c76da[_0xc446('0x33')],_0x3c76da[_0xc446('0x34')]);_0x44668b['attributes']=_[_0xc446('0x37')](_0x3c76da['model'],qs[_0xc446('0x38')](_0x2e7bbe[_0xc446('0x34')][_0xc446('0x38')]));_0x44668b[_0xc446('0x39')]=_0x44668b[_0xc446('0x39')][_0xc446('0x3a')]?_0x44668b[_0xc446('0x39')]:_0x3c76da['model'];_0x44668b[_0xc446('0x3c')]=qs[_0xc446('0x3d')](_0x2e7bbe[_0xc446('0x34')][_0xc446('0x3d')]);_0x44668b[_0xc446('0x3e')]=qs[_0xc446('0x36')](_[_0xc446('0x3f')](_0x2e7bbe[_0xc446('0x34')],_0x3c76da[_0xc446('0x36')]));if(_0x2e7bbe['query'][_0xc446('0x40')]){_0x44668b['where']=_['merge'](_0x44668b[_0xc446('0x3e')],{'$or':_[_0xc446('0x30')](_0x44668b[_0xc446('0x39')],function(_0x4d572f){var _0xf0f4b4={};_0xf0f4b4[_0x4d572f]={'$like':'%'+_0x2e7bbe[_0xc446('0x34')][_0xc446('0x40')]+'%'};return _0xf0f4b4;})});}_0x44668b=_['merge']({},_0x44668b,_0x2e7bbe['options']);return _0x2fe23f['getApplications'](_0x44668b);}})[_0xc446('0x13')](function(_0x1dff2e){if(_0x1dff2e){_0x112044=_0x1dff2e[_0xc446('0x3a')];if(!_0x2e7bbe[_0xc446('0x34')][_0xc446('0x59')](_0xc446('0x3b'))){_0x44668b[_0xc446('0x23')]=qs[_0xc446('0x23')](_0x2e7bbe[_0xc446('0x34')][_0xc446('0x23')]);_0x44668b['offset']=qs['offset'](_0x2e7bbe[_0xc446('0x34')][_0xc446('0x22')]);}return _0x2fe23f[_0xc446('0x11a')](_0x44668b);}})[_0xc446('0x13')](function(_0x56c5eb){if(_0x56c5eb){return _0x56c5eb?{'count':_0x112044,'rows':_0x56c5eb}:null;}})['then'](respondWithResult(_0xc2575,null))[_0xc446('0x1d')](handleError(_0xc2575,null));};exports[_0xc446('0x11b')]=function(_0x2728e3,_0x147a53){return db[_0xc446('0x11c')]['find']({'where':{'id':_0x2728e3[_0xc446('0x54')]['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x147a53,null))[_0xc446('0x13')](function(_0x316282){if(_0x316282){return _0x316282[_0xc446('0x11b')](_0x2728e3[_0xc446('0x4b')][_0xc446('0x5b')],_['omit'](_0x2728e3[_0xc446('0x4b')],[_0xc446('0x5b'),'id'])||{});}})[_0xc446('0x13')](respondWithResult(_0x147a53,null))[_0xc446('0x1d')](handleError(_0x147a53,null));};exports['getProactiveActions']=function(_0x4251b5,_0x50da29){var _0xc8e828={};var _0x204803={};var _0x599c75;var _0x4eeead;return db[_0xc446('0x31')][_0xc446('0x56')]({'where':{'id':_0x4251b5[_0xc446('0x54')]['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x50da29,null))['then'](function(_0x20ea1e){if(_0x20ea1e){_0x599c75=_0x20ea1e;_0x204803[_0xc446('0x33')]=_[_0xc446('0x35')](db[_0xc446('0x11d')][_0xc446('0x58')]);_0x204803['query']=_[_0xc446('0x35')](_0x4251b5[_0xc446('0x34')]);_0x204803[_0xc446('0x36')]=_[_0xc446('0x37')](_0x204803[_0xc446('0x33')],_0x204803[_0xc446('0x34')]);_0xc8e828['attributes']=_[_0xc446('0x37')](_0x204803[_0xc446('0x33')],qs[_0xc446('0x38')](_0x4251b5[_0xc446('0x34')][_0xc446('0x38')]));_0xc8e828[_0xc446('0x39')]=_0xc8e828[_0xc446('0x39')][_0xc446('0x3a')]?_0xc8e828[_0xc446('0x39')]:_0x204803[_0xc446('0x33')];_0xc8e828[_0xc446('0x3c')]=qs[_0xc446('0x3d')](_0x4251b5[_0xc446('0x34')][_0xc446('0x3d')]);_0xc8e828[_0xc446('0x3e')]=qs[_0xc446('0x36')](_[_0xc446('0x3f')](_0x4251b5[_0xc446('0x34')],_0x204803[_0xc446('0x36')]));if(_0x4251b5[_0xc446('0x34')][_0xc446('0x40')]){_0xc8e828[_0xc446('0x3e')]=_['merge'](_0xc8e828[_0xc446('0x3e')],{'$or':_[_0xc446('0x30')](_0xc8e828[_0xc446('0x39')],function(_0x3c9ec2){var _0x45b84a={};_0x45b84a[_0x3c9ec2]={'$like':'%'+_0x4251b5[_0xc446('0x34')][_0xc446('0x40')]+'%'};return _0x45b84a;})});}_0xc8e828=_[_0xc446('0x42')]({},_0xc8e828,_0x4251b5[_0xc446('0x43')]);return _0x599c75[_0xc446('0x102')](_0xc8e828);}})[_0xc446('0x13')](function(_0x44c80d){if(_0x44c80d){_0x4eeead=_0x44c80d['length'];if(!_0x4251b5[_0xc446('0x34')][_0xc446('0x59')](_0xc446('0x3b'))){_0xc8e828[_0xc446('0x23')]=qs[_0xc446('0x23')](_0x4251b5[_0xc446('0x34')]['limit']);_0xc8e828[_0xc446('0x22')]=qs[_0xc446('0x22')](_0x4251b5[_0xc446('0x34')]['offset']);}return _0x599c75[_0xc446('0x102')](_0xc8e828);}})[_0xc446('0x13')](function(_0x1ff2cf){if(_0x1ff2cf){return _0x1ff2cf?{'count':_0x4eeead,'rows':_0x1ff2cf}:null;}})[_0xc446('0x13')](respondWithResult(_0x50da29,null))[_0xc446('0x1d')](handleError(_0x50da29,null));};exports[_0xc446('0x11e')]=function(_0xc5b781,_0xb640b3){var _0x306297=_0xc5b781[_0xc446('0x34')]['online']===_0xc446('0x11f')?_0xc446('0x120'):'onlineForm';return db['ChatWebsite'][_0xc446('0x49')]({'attributes':['id',_0x306297],'where':{'id':_0xc5b781[_0xc446('0x54')]['id']}})[_0xc446('0x13')](handleEntityNotFound(_0xb640b3,null))['then'](function(_0x352829){if(_0x352829){var _0x1d7016=_0x352829[_0x306297];var _0x15aae7=_0x1d7016&&_0x1d7016[_0xc446('0x121')]?_0x1d7016[_0xc446('0x121')]:[];_0xb640b3[_0xc446('0x2d')]({'fromKey':_[_0xc446('0x6d')](_0x1d7016[_0xc446('0x122')])?undefined:_0x1d7016[_0xc446('0x122')],'count':_0x15aae7['length'],'rows':_0x15aae7});}})[_0xc446('0x1d')](handleError(_0xb640b3,null));};exports[_0xc446('0x123')]=function(_0x1b1fcb,_0x4eecd9){var _0x5eac92={'raw':![],'where':{}};var _0x47532e={};var _0x4adedd={'count':0x0,'rows':[]};return db[_0xc446('0x31')][_0xc446('0x56')]({'where':{'id':_0x1b1fcb[_0xc446('0x54')]['id']}})['then'](handleEntityNotFound(_0x4eecd9,null))['then'](function(_0x584046){if(_0x584046){_0x47532e['model']=_[_0xc446('0x35')](db[_0xc446('0xca')]['rawAttributes']);_0x47532e[_0xc446('0x34')]=_['keys'](_0x1b1fcb[_0xc446('0x34')]);_0x47532e[_0xc446('0x36')]=_[_0xc446('0x37')](_0x47532e[_0xc446('0x33')],_0x47532e[_0xc446('0x34')]);_0x5eac92[_0xc446('0x39')]=_[_0xc446('0x37')](_0x47532e['model'],qs[_0xc446('0x38')](_0x1b1fcb[_0xc446('0x34')]['fields']));_0x5eac92['attributes']=_0x5eac92[_0xc446('0x39')][_0xc446('0x3a')]?_0x5eac92[_0xc446('0x39')]:_0x47532e[_0xc446('0x33')];if(!_0x1b1fcb[_0xc446('0x34')][_0xc446('0x59')](_0xc446('0x3b'))){_0x5eac92[_0xc446('0x23')]=qs[_0xc446('0x23')](_0x1b1fcb[_0xc446('0x34')][_0xc446('0x23')]);_0x5eac92[_0xc446('0x22')]=qs[_0xc446('0x22')](_0x1b1fcb[_0xc446('0x34')]['offset']);}_0x5eac92[_0xc446('0x3c')]=qs[_0xc446('0x3d')](_0x1b1fcb[_0xc446('0x34')][_0xc446('0x3d')]);_0x5eac92[_0xc446('0x3e')]=qs[_0xc446('0x36')](_['pick'](_0x1b1fcb[_0xc446('0x34')],_0x47532e['filters']));_0x5eac92[_0xc446('0x3e')][_0xc446('0x55')]=_0x584046['id'];if(_0x1b1fcb[_0xc446('0x34')][_0xc446('0x40')]){_0x5eac92[_0xc446('0x3e')]=_[_0xc446('0x42')](_0x5eac92[_0xc446('0x3e')],{'$or':_[_0xc446('0x30')](_0x5eac92[_0xc446('0x39')],function(_0x3a37ab){var _0x108c1e={};_0x108c1e[_0x3a37ab]={'$like':'%'+_0x1b1fcb['query'][_0xc446('0x40')]+'%'};return _0x108c1e;})});}_0x5eac92=_[_0xc446('0x42')]({},_0x5eac92,_0x1b1fcb['options']);return db[_0xc446('0xca')][_0xc446('0x25')]({'where':_0x5eac92[_0xc446('0x3e')]})[_0xc446('0x13')](function(_0x5c98c1){_0x4adedd[_0xc446('0x25')]=_0x5c98c1;if(_0x1b1fcb[_0xc446('0x34')][_0xc446('0x47')]){_0x5eac92[_0xc446('0x48')]=[{'all':!![]}];}else{_0x5eac92[_0xc446('0x48')]=[{'model':db['CmContact'],'as':_0xc446('0xef'),'required':![]},{'model':db[_0xc446('0xd2')],'as':_0xc446('0x124'),'required':![]}];}return db[_0xc446('0xca')][_0xc446('0x5d')](_0x5eac92);})['then'](function(_0x817c82){_0x4adedd[_0xc446('0x44')]=_0x817c82;return _0x4adedd;});}})[_0xc446('0x13')](respondWithFilteredResult(_0x4eecd9,_0x5eac92))[_0xc446('0x1d')](handleError(_0x4eecd9,null));};exports[_0xc446('0x125')]=function(_0x47d8eb,_0x579f4b){return db[_0xc446('0x31')][_0xc446('0x49')]({'where':{'id':_0x47d8eb['params']['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x579f4b,null))[_0xc446('0x13')](function(_0x4277ab){if(_0x4277ab){return _0x4277ab[_0xc446('0x125')](_0x47d8eb['body'][_0xc446('0x5b')],_[_0xc446('0xed')](_0x47d8eb['body'],[_0xc446('0x5b'),'id'])||{})[_0xc446('0xae')](function(_0x24a1bd){for(var _0x4a3616=0x0;_0x4a3616<_0x47d8eb[_0xc446('0x4b')][_0xc446('0x5b')][_0xc446('0x3a')];_0x4a3616+=0x1){socket[_0xc446('0x126')](_0xc446('0x127'),{'UserId':Number(_0x47d8eb[_0xc446('0x4b')][_0xc446('0x5b')][_0x4a3616]),'ChatWebsiteId':Number(_0x47d8eb[_0xc446('0x54')]['id'])});}return _0x24a1bd;});}})[_0xc446('0x13')](respondWithResult(_0x579f4b,null))[_0xc446('0x1d')](handleError(_0x579f4b,null));};exports[_0xc446('0x128')]=function(_0x50b925,_0x2828d7){return db[_0xc446('0x31')][_0xc446('0x49')]({'where':{'id':_0x50b925['params']['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x2828d7,null))[_0xc446('0x13')](function(_0x9ed2ce){if(_0x9ed2ce){return _0x9ed2ce['removeAgents'](_0x50b925[_0xc446('0x34')][_0xc446('0x5b')])[_0xc446('0x13')](function(){if(_[_0xc446('0x129')](_0x50b925[_0xc446('0x34')][_0xc446('0x5b')])){for(var _0x415197=0x0;_0x415197<_0x50b925[_0xc446('0x34')][_0xc446('0x5b')][_0xc446('0x3a')];_0x415197+=0x1){socket[_0xc446('0x126')](_0xc446('0x12a'),{'UserId':Number(_0x50b925[_0xc446('0x34')][_0xc446('0x5b')][_0x415197]),'ChatWebsiteId':Number(_0x50b925[_0xc446('0x54')]['id'])});}}else{socket[_0xc446('0x126')](_0xc446('0x12a'),{'UserId':Number(_0x50b925['query'][_0xc446('0x5b')]),'ChatWebsiteId':Number(_0x50b925[_0xc446('0x54')]['id'])});}});}})[_0xc446('0x13')](respondWithStatusCode(_0x2828d7,null))[_0xc446('0x1d')](handleError(_0x2828d7,null));};exports['getAgents']=function(_0xde8c51,_0x9e43bd){var _0x2099e3={};var _0x5e5251={};var _0x13be92;var _0x4e57d0;return db[_0xc446('0x31')][_0xc446('0x56')]({'where':{'id':_0xde8c51[_0xc446('0x54')]['id']}})[_0xc446('0x13')](handleEntityNotFound(_0x9e43bd,null))[_0xc446('0x13')](function(_0x1a12dc){if(_0x1a12dc){_0x13be92=_0x1a12dc;_0x5e5251[_0xc446('0x33')]=_['keys'](db[_0xc446('0xb9')][_0xc446('0x58')]);_0x5e5251[_0xc446('0x34')]=_[_0xc446('0x35')](_0xde8c51[_0xc446('0x34')]);_0x5e5251[_0xc446('0x36')]=_['intersection'](_0x5e5251[_0xc446('0x33')],_0x5e5251[_0xc446('0x34')]);_0x2099e3[_0xc446('0x39')]=_['intersection'](_0x5e5251[_0xc446('0x33')],qs['fields'](_0xde8c51[_0xc446('0x34')][_0xc446('0x38')]));_0x2099e3['attributes']=_0x2099e3['attributes'][_0xc446('0x3a')]?_0x2099e3[_0xc446('0x39')]:_0x5e5251[_0xc446('0x33')];_0x2099e3[_0xc446('0x3c')]=qs[_0xc446('0x3d')](_0xde8c51[_0xc446('0x34')][_0xc446('0x3d')]);_0x2099e3[_0xc446('0x3e')]=qs[_0xc446('0x36')](_[_0xc446('0x3f')](_0xde8c51[_0xc446('0x34')],_0x5e5251[_0xc446('0x36')]));if(_0xde8c51[_0xc446('0x34')][_0xc446('0x40')]){_0x2099e3['where']=_[_0xc446('0x42')](_0x2099e3[_0xc446('0x3e')],{'$or':_[_0xc446('0x30')](_0x2099e3[_0xc446('0x39')],function(_0x3b3519){var _0x147089={};_0x147089[_0x3b3519]={'$like':'%'+_0xde8c51[_0xc446('0x34')][_0xc446('0x40')]+'%'};return _0x147089;})});}_0x2099e3=_['merge']({},_0x2099e3,_0xde8c51[_0xc446('0x43')]);return _0x13be92['getAgents'](_0x2099e3);}})[_0xc446('0x13')](function(_0x3bc4d2){if(_0x3bc4d2){_0x4e57d0=_0x3bc4d2[_0xc446('0x3a')];if(!_0xde8c51[_0xc446('0x34')][_0xc446('0x59')]('nolimit')){_0x2099e3[_0xc446('0x23')]=qs[_0xc446('0x23')](_0xde8c51[_0xc446('0x34')]['limit']);_0x2099e3[_0xc446('0x22')]=qs[_0xc446('0x22')](_0xde8c51[_0xc446('0x34')][_0xc446('0x22')]);}return _0x13be92['getAgents'](_0x2099e3);}})[_0xc446('0x13')](function(_0x443f97){if(_0x443f97){return _0x443f97?{'count':_0x4e57d0,'rows':_0x443f97}:null;}})[_0xc446('0x13')](respondWithResult(_0x9e43bd,null))[_0xc446('0x1d')](handleError(_0x9e43bd,null));}; \ No newline at end of file +var _0xdad2=['x-real-ip','connection','remoteAddress','replace','alignment','color','labelText','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','ISOLATION_LEVELS','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','omit','removeAgents','userChatWebsite:remove','emit','getAgents','mustache','util','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','then','get','ChatWebsites','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','type','merge','options','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','nolimit','sort','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','from','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','Applications','account','applications','orderBy','asc','Contacts','defaults','ListId','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','forcedOwnership','Start','startRouting','EventManager','offline','no\x20available\x20attributes','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','readFileSync','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','email','Chat','NotifyMailAccount','notifyMail','server','files','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','utf8','remote'];(function(_0x173d45,_0x3a055c){var _0x39aee9=function(_0x42f958){while(--_0x42f958){_0x173d45['push'](_0x173d45['shift']());}};_0x39aee9(++_0x3a055c);}(_0xdad2,0x14c));var _0x2dad=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xdad2[_0x59ee6f];return _0x4c0979;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x2dad('0x0'));var util=require(_0x2dad('0x1'));var path=require('path');var ejs=require(_0x2dad('0x2'));var fs=require('fs');var fs_extra=require(_0x2dad('0x3'));var _=require(_0x2dad('0x4'));var querystring=require('querystring');var Redis=require(_0x2dad('0x5'));var qs=require(_0x2dad('0x6'));var logger=require('../../config/logger')(_0x2dad('0x7'));var config=require(_0x2dad('0x8'));var db=require(_0x2dad('0x9'))['db'];config[_0x2dad('0xa')]=_['defaults'](config['redis'],{'host':_0x2dad('0xb'),'port':0x18eb});var socket=require(_0x2dad('0xc'))(new Redis(config[_0x2dad('0xa')]));require(_0x2dad('0xd'))[_0x2dad('0xe')](socket);var htmlToText=require(_0x2dad('0xf'));var jayson=require('jayson/promise');var client=jayson[_0x2dad('0x10')]['http']({'port':0x232c});var client9002=jayson[_0x2dad('0x10')][_0x2dad('0x11')]({'port':0x232a});var client9003=jayson['client'][_0x2dad('0x11')]({'port':0x232b});var client9001=jayson[_0x2dad('0x10')][_0x2dad('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x490d40,_0x39a4d5,_0x1d1f6a,_0x4aa814){return new BPromise(function(_0x137735,_0x2fabe2){var _0x3ca27e=_0x4aa814||client;return _0x3ca27e[_0x2dad('0x12')](_0x490d40,_0x1d1f6a)['then'](function(_0x711ee2){logger[_0x2dad('0x13')](_0x2dad('0x14'),_0x39a4d5,_0x2dad('0x15'));logger[_0x2dad('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x39a4d5,'request\x20sent',JSON[_0x2dad('0x17')](_0x711ee2));if(_0x711ee2['error']){if(_0x711ee2['error']['code']===0x1f4){logger[_0x2dad('0x18')](_0x2dad('0x14'),_0x39a4d5,_0x711ee2[_0x2dad('0x18')][_0x2dad('0x19')]);return _0x2fabe2(_0x711ee2[_0x2dad('0x18')]['message']);}logger[_0x2dad('0x18')](_0x2dad('0x14'),_0x39a4d5,_0x711ee2['error'][_0x2dad('0x19')]);return _0x137735(_0x711ee2['error']['message']);}else{logger[_0x2dad('0x13')](_0x2dad('0x14'),_0x39a4d5,_0x2dad('0x15'));_0x137735(_0x711ee2[_0x2dad('0x1a')][_0x2dad('0x19')]);}})[_0x2dad('0x1b')](function(_0x49624c){logger['error'](_0x2dad('0x14'),_0x39a4d5,_0x49624c);_0x2fabe2(_0x49624c);});});}function respondWithStatusCode(_0x5d66af,_0x53ee1d){_0x53ee1d=_0x53ee1d||0xcc;return function(_0x18a0f9){if(_0x18a0f9){return _0x5d66af[_0x2dad('0x1c')](_0x53ee1d);}return _0x5d66af[_0x2dad('0x1d')](_0x53ee1d)['end']();};}function respondWithResult(_0xebad04,_0x505216){_0x505216=_0x505216||0xc8;return function(_0x423c29){if(_0x423c29){return _0xebad04[_0x2dad('0x1d')](_0x505216)[_0x2dad('0x1e')](_0x423c29);}};}function respondWithFilteredResult(_0x546946,_0x42d345){return function(_0x30e0fe){if(_0x30e0fe){var _0xa8d751=typeof _0x42d345['offset']===_0x2dad('0x1f')&&typeof _0x42d345[_0x2dad('0x20')]===_0x2dad('0x1f');var _0x518ee2=_0x30e0fe[_0x2dad('0x21')];var _0x343905=_0xa8d751?0x0:_0x42d345[_0x2dad('0x22')];var _0x379961=_0xa8d751?_0x30e0fe[_0x2dad('0x21')]:_0x42d345[_0x2dad('0x22')]+_0x42d345[_0x2dad('0x20')];var _0x529e88;if(_0x379961>=_0x518ee2){_0x379961=_0x518ee2;_0x529e88=0xc8;}else{_0x529e88=0xce;}_0x546946[_0x2dad('0x1d')](_0x529e88);return _0x546946[_0x2dad('0x23')]('Content-Range',_0x343905+'-'+_0x379961+'/'+_0x518ee2)['json'](_0x30e0fe);}return null;};}function saveUpdates(_0x367bd0){return function(_0x224373){if(_0x224373){return _0x224373['update'](_0x367bd0)[_0x2dad('0x24')](function(_0x2f0a7a){return _0x2f0a7a;});}return null;};}function removeEntity(_0x2dd1dc){return function(_0x5334a5){if(_0x5334a5){return _0x5334a5['destroy']()[_0x2dad('0x24')](function(){var _0x305d12=_0x5334a5[_0x2dad('0x25')]({'plain':!![]});var _0x344ad3=_0x2dad('0x26');return db['UserProfileResource'][_0x2dad('0x27')]({'where':{'type':_0x344ad3,'resourceId':_0x305d12['id']}})['then'](function(){return _0x5334a5;});})[_0x2dad('0x24')](function(){_0x2dd1dc[_0x2dad('0x1d')](0xcc)[_0x2dad('0x28')]();});}};}function handleEntityNotFound(_0xcf033e){return function(_0x35cf62){if(!_0x35cf62){_0xcf033e[_0x2dad('0x1c')](0x194);}return _0x35cf62;};}function handleError(_0x35ad87,_0x37176c){_0x37176c=_0x37176c||0x1f4;return function(_0x3f8c85){logger[_0x2dad('0x18')](_0x3f8c85[_0x2dad('0x29')]);if(_0x3f8c85[_0x2dad('0x2a')]){delete _0x3f8c85[_0x2dad('0x2a')];}_0x35ad87[_0x2dad('0x1d')](_0x37176c)[_0x2dad('0x2b')](_0x3f8c85);};}exports[_0x2dad('0x2c')]=function(_0xb7c090,_0x347e76){var _0x543443={'include':[{'model':db[_0x2dad('0x2d')],'as':_0x2dad('0x2e')}]},_0x3cc928={},_0x5db147={'count':0x0,'rows':[]};var _0x4abb32=_[_0x2dad('0x2f')](db[_0x2dad('0x30')][_0x2dad('0x31')],function(_0x36a741){return{'name':_0x36a741['fieldName'],'type':_0x36a741['type'][_0x2dad('0x32')]};});_0x3cc928[_0x2dad('0x33')]=_[_0x2dad('0x2f')](_0x4abb32,_0x2dad('0x2a'));_0x3cc928[_0x2dad('0x34')]=_[_0x2dad('0x35')](_0xb7c090['query']);_0x3cc928[_0x2dad('0x36')]=_[_0x2dad('0x37')](_0x3cc928[_0x2dad('0x33')],_0x3cc928['query']);_0x543443[_0x2dad('0x38')]=_[_0x2dad('0x37')](_0x3cc928['model'],qs[_0x2dad('0x39')](_0xb7c090[_0x2dad('0x34')][_0x2dad('0x39')]));_0x543443[_0x2dad('0x38')]=_0x543443['attributes'][_0x2dad('0x3a')]?_0x543443[_0x2dad('0x38')]:_0x3cc928['model'];if(!_0xb7c090['query'][_0x2dad('0x3b')]('nolimit')){_0x543443[_0x2dad('0x20')]=qs[_0x2dad('0x20')](_0xb7c090['query']['limit']);_0x543443[_0x2dad('0x22')]=qs[_0x2dad('0x22')](_0xb7c090['query'][_0x2dad('0x22')]);}_0x543443[_0x2dad('0x3c')]=qs['sort'](_0xb7c090[_0x2dad('0x34')]['sort']);_0x543443[_0x2dad('0x3d')]=qs[_0x2dad('0x36')](_[_0x2dad('0x3e')](_0xb7c090['query'],_0x3cc928[_0x2dad('0x36')]),_0x4abb32);if(_0xb7c090[_0x2dad('0x34')][_0x2dad('0x3f')]){_0x543443[_0x2dad('0x3d')]=_['merge'](_0x543443[_0x2dad('0x3d')],{'$or':_[_0x2dad('0x2f')](_0x4abb32,function(_0x5e7f03){if(_0x5e7f03[_0x2dad('0x40')]!=='VIRTUAL'){var _0x535351={};_0x535351[_0x5e7f03[_0x2dad('0x2a')]]={'$like':'%'+_0xb7c090[_0x2dad('0x34')][_0x2dad('0x3f')]+'%'};return _0x535351;}})});}_0x543443=_[_0x2dad('0x41')]({},_0x543443,_0xb7c090[_0x2dad('0x42')]);var _0x37db80={'where':_0x543443[_0x2dad('0x3d')]};return db[_0x2dad('0x30')]['count'](_0x37db80)[_0x2dad('0x24')](function(_0x18017a){_0x5db147[_0x2dad('0x21')]=_0x18017a;if(_0xb7c090['query'][_0x2dad('0x43')]){_0x543443[_0x2dad('0x44')]=[{'all':!![]}];}return db[_0x2dad('0x30')][_0x2dad('0x45')](_0x543443);})[_0x2dad('0x24')](function(_0x595358){_0x5db147['rows']=_0x595358;return _0x5db147;})['then'](respondWithFilteredResult(_0x347e76,_0x543443))['catch'](handleError(_0x347e76,null));};exports[_0x2dad('0x46')]=function(_0x522ef4,_0x3fcd88){var _0x2cbb15={'raw':![],'where':{'id':_0x522ef4[_0x2dad('0x47')]['id']},'include':[{'model':db[_0x2dad('0x2d')],'as':'mandatoryDispositionPause'}]},_0x6f995b={};_0x6f995b[_0x2dad('0x33')]=_[_0x2dad('0x35')](db[_0x2dad('0x30')][_0x2dad('0x31')]);_0x6f995b['query']=_['keys'](_0x522ef4[_0x2dad('0x34')]);_0x6f995b['filters']=_[_0x2dad('0x37')](_0x6f995b[_0x2dad('0x33')],_0x6f995b['query']);_0x2cbb15[_0x2dad('0x38')]=_['intersection'](_0x6f995b[_0x2dad('0x33')],qs['fields'](_0x522ef4['query'][_0x2dad('0x39')]));_0x2cbb15[_0x2dad('0x38')]=_0x2cbb15['attributes'][_0x2dad('0x3a')]?_0x2cbb15[_0x2dad('0x38')]:_0x6f995b[_0x2dad('0x33')];if(_0x522ef4[_0x2dad('0x34')]['includeAll']){_0x2cbb15['include']=[{'all':!![]}];}_0x2cbb15=_[_0x2dad('0x41')]({},_0x2cbb15,_0x522ef4['options']);return db[_0x2dad('0x30')][_0x2dad('0x48')](_0x2cbb15)[_0x2dad('0x24')](handleEntityNotFound(_0x3fcd88,null))[_0x2dad('0x24')](respondWithResult(_0x3fcd88,null))[_0x2dad('0x1b')](handleError(_0x3fcd88,null));};exports[_0x2dad('0x49')]=function(_0x269c8d,_0x27be00){return db['ChatWebsite'][_0x2dad('0x49')](_0x269c8d[_0x2dad('0x4a')],{})['then'](function(_0x12f7d2){var _0x43463e=_0x269c8d[_0x2dad('0x4b')][_0x2dad('0x25')]({'plain':!![]});if(!_0x43463e)throw new Error(_0x2dad('0x4c'));if(_0x43463e[_0x2dad('0x4d')]===_0x2dad('0x4b')){var _0x37376e=_0x12f7d2[_0x2dad('0x25')]({'plain':!![]});var _0x1baaab=_0x2dad('0x26');return db[_0x2dad('0x4e')]['find']({'where':{'name':_0x1baaab,'userProfileId':_0x43463e[_0x2dad('0x4f')]},'raw':!![]})[_0x2dad('0x24')](function(_0x39a133){if(_0x39a133&&_0x39a133[_0x2dad('0x50')]===0x0){return db[_0x2dad('0x51')][_0x2dad('0x49')]({'name':_0x37376e[_0x2dad('0x2a')],'resourceId':_0x37376e['id'],'type':_0x39a133['name'],'sectionId':_0x39a133['id']},{})[_0x2dad('0x24')](function(){return _0x12f7d2;});}else{return _0x12f7d2;}})['catch'](function(_0x66da4d){logger[_0x2dad('0x18')](_0x2dad('0x52'),_0x66da4d);throw _0x66da4d;});}return _0x12f7d2;})[_0x2dad('0x24')](respondWithResult(_0x27be00,0xc9))[_0x2dad('0x1b')](handleError(_0x27be00,null));};exports[_0x2dad('0x53')]=function(_0x43a0d7,_0x188012){if(_0x43a0d7[_0x2dad('0x4a')]['id']){delete _0x43a0d7[_0x2dad('0x4a')]['id'];}return db[_0x2dad('0x30')][_0x2dad('0x48')]({'where':{'id':_0x43a0d7['params']['id']},'include':[{'model':db[_0x2dad('0x2d')],'as':_0x2dad('0x2e')}]})[_0x2dad('0x24')](handleEntityNotFound(_0x188012,null))[_0x2dad('0x24')](saveUpdates(_0x43a0d7[_0x2dad('0x4a')],null))[_0x2dad('0x24')](respondWithResult(_0x188012,null))[_0x2dad('0x1b')](handleError(_0x188012,null));};exports[_0x2dad('0x27')]=function(_0x5e781a,_0x42cb77){return db[_0x2dad('0x30')][_0x2dad('0x48')]({'where':{'id':_0x5e781a[_0x2dad('0x47')]['id']}})['then'](handleEntityNotFound(_0x42cb77,null))[_0x2dad('0x24')](removeEntity(_0x42cb77,null))[_0x2dad('0x1b')](handleError(_0x42cb77,null));};exports[_0x2dad('0x54')]=function(_0x9f5fa3,_0x286050){return db[_0x2dad('0x30')][_0x2dad('0x54')]()['then'](respondWithResult(_0x286050,null))['catch'](handleError(_0x286050,null));};exports[_0x2dad('0x55')]=function(_0x120fd2,_0x3b0836){if(_0x120fd2['body']['id']){delete _0x120fd2[_0x2dad('0x4a')]['id'];}return db[_0x2dad('0x30')][_0x2dad('0x48')]({'where':{'id':_0x120fd2[_0x2dad('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b0836,null))[_0x2dad('0x24')](function(_0x29fbc9){if(_0x29fbc9){_0x120fd2[_0x2dad('0x4a')][_0x2dad('0x56')]=_0x29fbc9['id'];return db['Disposition'][_0x2dad('0x49')](_0x120fd2['body']);}})['then'](respondWithResult(_0x3b0836,null))['catch'](handleError(_0x3b0836,null));};exports[_0x2dad('0x57')]=function(_0x337ae2,_0x680446){var _0x377b39={'raw':![],'where':{}};var _0xd18e9a={};var _0x31be88={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2dad('0x58')]({'where':{'id':_0x337ae2[_0x2dad('0x47')]['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x680446,null))['then'](function(_0x1673a6){if(_0x1673a6){_0xd18e9a['model']=_['keys'](db['Disposition'][_0x2dad('0x31')]);_0xd18e9a[_0x2dad('0x34')]=_[_0x2dad('0x35')](_0x337ae2[_0x2dad('0x34')]);_0xd18e9a[_0x2dad('0x36')]=_['intersection'](_0xd18e9a[_0x2dad('0x33')],_0xd18e9a[_0x2dad('0x34')]);_0x377b39[_0x2dad('0x38')]=_[_0x2dad('0x37')](_0xd18e9a[_0x2dad('0x33')],qs[_0x2dad('0x39')](_0x337ae2['query']['fields']));_0x377b39['attributes']=_0x377b39['attributes']['length']?_0x377b39[_0x2dad('0x38')]:_0xd18e9a[_0x2dad('0x33')];if(!_0x337ae2[_0x2dad('0x34')][_0x2dad('0x3b')](_0x2dad('0x59'))){_0x377b39['limit']=qs[_0x2dad('0x20')](_0x337ae2[_0x2dad('0x34')][_0x2dad('0x20')]);_0x377b39[_0x2dad('0x22')]=qs[_0x2dad('0x22')](_0x337ae2[_0x2dad('0x34')][_0x2dad('0x22')]);}_0x377b39[_0x2dad('0x3c')]=qs['sort'](_0x337ae2[_0x2dad('0x34')][_0x2dad('0x5a')]);_0x377b39[_0x2dad('0x3d')]=qs[_0x2dad('0x36')](_[_0x2dad('0x3e')](_0x337ae2[_0x2dad('0x34')],_0xd18e9a[_0x2dad('0x36')]));_0x377b39[_0x2dad('0x3d')][_0x2dad('0x56')]=_0x1673a6['id'];if(_0x337ae2[_0x2dad('0x34')]['filter']){_0x377b39[_0x2dad('0x3d')]=_[_0x2dad('0x41')](_0x377b39[_0x2dad('0x3d')],{'$or':_[_0x2dad('0x2f')](_0x377b39[_0x2dad('0x38')],function(_0x57d7ab){var _0x441e38={};_0x441e38[_0x57d7ab]={'$like':'%'+_0x337ae2['query'][_0x2dad('0x3f')]+'%'};return _0x441e38;})});}_0x377b39=_[_0x2dad('0x41')]({},_0x377b39,_0x337ae2[_0x2dad('0x42')]);return db[_0x2dad('0x5b')][_0x2dad('0x21')]({'where':_0x377b39[_0x2dad('0x3d')]})[_0x2dad('0x24')](function(_0x478b65){_0x31be88[_0x2dad('0x21')]=_0x478b65;if(_0x337ae2[_0x2dad('0x34')][_0x2dad('0x43')]){_0x377b39[_0x2dad('0x44')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x377b39);})[_0x2dad('0x24')](function(_0x369c5d){_0x31be88['rows']=_0x369c5d;return _0x31be88;});}})['then'](respondWithFilteredResult(_0x680446,_0x377b39))[_0x2dad('0x1b')](handleError(_0x680446,null));};exports[_0x2dad('0x5c')]=function(_0x11923b,_0x4c341a){return db['ChatWebsite']['find']({'where':{'id':_0x11923b[_0x2dad('0x47')]['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x4c341a,null))[_0x2dad('0x24')](function(_0x298bf4){if(_0x298bf4){return _0x298bf4['removeDispositions'](_0x11923b[_0x2dad('0x34')][_0x2dad('0x5d')]);}})['then'](respondWithStatusCode(_0x4c341a,null))[_0x2dad('0x1b')](handleError(_0x4c341a,null));};exports[_0x2dad('0x5e')]=function(_0x3e5b29,_0x346ee3){if(_0x3e5b29[_0x2dad('0x4a')]['id']){delete _0x3e5b29[_0x2dad('0x4a')]['id'];}return db[_0x2dad('0x30')][_0x2dad('0x48')]({'where':{'id':_0x3e5b29[_0x2dad('0x47')]['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x346ee3,null))[_0x2dad('0x24')](function(_0xf6923){if(_0xf6923){_0x3e5b29[_0x2dad('0x4a')][_0x2dad('0x56')]=_0xf6923['id'];return db[_0x2dad('0x5f')][_0x2dad('0x49')](_0x3e5b29[_0x2dad('0x4a')]);}})[_0x2dad('0x24')](respondWithResult(_0x346ee3,null))['catch'](handleError(_0x346ee3,null));};exports[_0x2dad('0x60')]=function(_0x7964a7,_0x305cab){var _0x45ae2c={'raw':![],'where':{}};var _0x226c3b={};var _0x37405b={'count':0x0,'rows':[]};return db[_0x2dad('0x30')][_0x2dad('0x58')]({'where':{'id':_0x7964a7[_0x2dad('0x47')]['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x305cab,null))['then'](function(_0x260193){if(_0x260193){_0x226c3b[_0x2dad('0x33')]=_['keys'](db['CannedAnswer'][_0x2dad('0x31')]);_0x226c3b['query']=_[_0x2dad('0x35')](_0x7964a7[_0x2dad('0x34')]);_0x226c3b[_0x2dad('0x36')]=_['intersection'](_0x226c3b[_0x2dad('0x33')],_0x226c3b['query']);_0x45ae2c[_0x2dad('0x38')]=_['intersection'](_0x226c3b['model'],qs['fields'](_0x7964a7[_0x2dad('0x34')][_0x2dad('0x39')]));_0x45ae2c[_0x2dad('0x38')]=_0x45ae2c['attributes'][_0x2dad('0x3a')]?_0x45ae2c[_0x2dad('0x38')]:_0x226c3b['model'];if(!_0x7964a7[_0x2dad('0x34')]['hasOwnProperty'](_0x2dad('0x59'))){_0x45ae2c[_0x2dad('0x20')]=qs[_0x2dad('0x20')](_0x7964a7[_0x2dad('0x34')][_0x2dad('0x20')]);_0x45ae2c[_0x2dad('0x22')]=qs[_0x2dad('0x22')](_0x7964a7[_0x2dad('0x34')]['offset']);}_0x45ae2c[_0x2dad('0x3c')]=qs['sort'](_0x7964a7[_0x2dad('0x34')]['sort']);_0x45ae2c[_0x2dad('0x3d')]=qs[_0x2dad('0x36')](_[_0x2dad('0x3e')](_0x7964a7[_0x2dad('0x34')],_0x226c3b[_0x2dad('0x36')]));_0x45ae2c[_0x2dad('0x3d')][_0x2dad('0x56')]=_0x260193['id'];if(_0x7964a7[_0x2dad('0x34')][_0x2dad('0x3f')]){_0x45ae2c[_0x2dad('0x3d')]=_['merge'](_0x45ae2c[_0x2dad('0x3d')],{'$or':_['map'](_0x45ae2c['attributes'],function(_0x4a8a7d){var _0x1ff09d={};_0x1ff09d[_0x4a8a7d]={'$like':'%'+_0x7964a7[_0x2dad('0x34')]['filter']+'%'};return _0x1ff09d;})});}_0x45ae2c=_['merge']({},_0x45ae2c,_0x7964a7[_0x2dad('0x42')]);return db['CannedAnswer'][_0x2dad('0x21')]({'where':_0x45ae2c['where']})[_0x2dad('0x24')](function(_0x128110){_0x37405b[_0x2dad('0x21')]=_0x128110;if(_0x7964a7[_0x2dad('0x34')][_0x2dad('0x43')]){_0x45ae2c[_0x2dad('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2dad('0x45')](_0x45ae2c);})['then'](function(_0x5618df){_0x37405b[_0x2dad('0x61')]=_0x5618df;return _0x37405b;});}})[_0x2dad('0x24')](respondWithFilteredResult(_0x305cab,_0x45ae2c))[_0x2dad('0x1b')](handleError(_0x305cab,null));};exports['removeAnswers']=function(_0x4887c1,_0x167861){return db['ChatWebsite'][_0x2dad('0x48')]({'where':{'id':_0x4887c1[_0x2dad('0x47')]['id']}})['then'](handleEntityNotFound(_0x167861,null))[_0x2dad('0x24')](function(_0x439857){if(_0x439857){return _0x439857[_0x2dad('0x62')](_0x4887c1[_0x2dad('0x34')]['ids']);}})[_0x2dad('0x24')](respondWithStatusCode(_0x167861,null))['catch'](handleError(_0x167861,null));};exports[_0x2dad('0x63')]=function(_0x2967e6,_0x13bb38){_0x2967e6[_0x2dad('0x4a')][_0x2dad('0x64')]=_0x2967e6[_0x2dad('0x65')][_0x2dad('0x66')];return db[_0x2dad('0x30')][_0x2dad('0x48')]({'where':{'id':_0x2967e6[_0x2dad('0x47')]['id']}})['then'](handleEntityNotFound(_0x13bb38,null))[_0x2dad('0x24')](saveUpdates(_0x2967e6['body'],null))[_0x2dad('0x24')](respondWithResult(_0x13bb38,null))['catch'](handleError(_0x13bb38,null));};exports[_0x2dad('0x67')]=function(_0x23ec66,_0x476d19){_0x23ec66[_0x2dad('0x4a')][_0x2dad('0x68')]=_0x23ec66[_0x2dad('0x65')]['filename'];return db['ChatWebsite'][_0x2dad('0x48')]({'where':{'id':_0x23ec66['params']['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x476d19,null))[_0x2dad('0x24')](saveUpdates(_0x23ec66[_0x2dad('0x4a')],null))[_0x2dad('0x24')](respondWithResult(_0x476d19,null))[_0x2dad('0x1b')](handleError(_0x476d19,null));};exports[_0x2dad('0x69')]=function(_0x266dbc,_0x566570){_0x266dbc[_0x2dad('0x4a')][_0x2dad('0x6a')]=_0x266dbc[_0x2dad('0x65')]['filename'];return db[_0x2dad('0x30')][_0x2dad('0x48')]({'where':{'id':_0x266dbc[_0x2dad('0x47')]['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x566570,null))[_0x2dad('0x24')](saveUpdates(_0x266dbc[_0x2dad('0x4a')],null))[_0x2dad('0x24')](respondWithResult(_0x566570,null))[_0x2dad('0x1b')](handleError(_0x566570,null));};exports[_0x2dad('0x6b')]=function(_0x52b8a6,_0x51e15c){_0x52b8a6['body']['systemAvatar']=_0x52b8a6[_0x2dad('0x65')][_0x2dad('0x66')];return db[_0x2dad('0x30')][_0x2dad('0x48')]({'where':{'id':_0x52b8a6[_0x2dad('0x47')]['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x51e15c,null))[_0x2dad('0x24')](saveUpdates(_0x52b8a6[_0x2dad('0x4a')],null))[_0x2dad('0x24')](respondWithResult(_0x51e15c,null))[_0x2dad('0x1b')](handleError(_0x51e15c,null));};exports['getLogo']=function(_0x5ac8de,_0x240acd){var _0xe68544=path[_0x2dad('0x6c')](config[_0x2dad('0x6d')],_0x2dad('0x6e'));var _0x3566e8={'where':{'id':_0x5ac8de['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x13201f=![];return require('../../config/license/util')[_0x2dad('0x6f')]()[_0x2dad('0x24')](function(_0xd8c40c){if(_0xd8c40c){_0x13201f=_0xd8c40c['custom'];}})[_0x2dad('0x24')](function(){return db[_0x2dad('0x30')][_0x2dad('0x48')](_0x3566e8);})['then'](handleEntityNotFound(_0x240acd,null))[_0x2dad('0x24')](function(_0x14ced5){if(_0x14ced5){if(!_[_0x2dad('0x70')](_0x14ced5['sitepic'])){if(fs[_0x2dad('0x71')](path['join'](config['root'],_0x2dad('0x72'),_0x14ced5['sitepic']))&&_0x13201f){_0xe68544=path[_0x2dad('0x6c')](config[_0x2dad('0x6d')],'server/files/images/logos/',_0x14ced5['sitepic']);}}return _0x240acd[_0x2dad('0x73')](_0xe68544);}})[_0x2dad('0x1b')](handleError(_0x240acd,null));};exports['getAvatar']=function(_0x2fbaf2,_0x50cf02){var _0x26d2cd=path[_0x2dad('0x6c')](config[_0x2dad('0x6d')],_0x2dad('0x74'));var _0x157f6b={'where':{'id':_0x2fbaf2[_0x2dad('0x47')]['id']},'attributes':['id',_0x2dad('0x68')],'raw':!![]};return db[_0x2dad('0x30')][_0x2dad('0x48')](_0x157f6b)[_0x2dad('0x24')](handleEntityNotFound(_0x50cf02,null))['then'](function(_0x4d13b7){if(_0x4d13b7){if(!_['isNil'](_0x4d13b7[_0x2dad('0x68')])){if(fs[_0x2dad('0x71')](path[_0x2dad('0x6c')](config[_0x2dad('0x6d')],'server/files/images/avatars/',_0x4d13b7[_0x2dad('0x68')]))){_0x26d2cd=path[_0x2dad('0x6c')](config[_0x2dad('0x6d')],_0x2dad('0x75'),_0x4d13b7[_0x2dad('0x68')]);}}return _0x50cf02[_0x2dad('0x73')](_0x26d2cd);}})[_0x2dad('0x1b')](handleError(_0x50cf02,null));};exports[_0x2dad('0x76')]=function(_0x119277,_0x55f705){var _0x59f4f0=path['join'](config[_0x2dad('0x6d')],'server/files/images/avatars/customer_avatar.png');var _0x462c96={'where':{'id':_0x119277['params']['id']},'attributes':['id',_0x2dad('0x6a'),_0x2dad('0x77')],'raw':!![]};return db[_0x2dad('0x30')][_0x2dad('0x48')](_0x462c96)[_0x2dad('0x24')](handleEntityNotFound(_0x55f705,null))[_0x2dad('0x24')](function(_0x1193a5){if(_0x1193a5){if(!_[_0x2dad('0x70')](_0x1193a5[_0x2dad('0x6a')])){if(fs[_0x2dad('0x71')](path[_0x2dad('0x6c')](config[_0x2dad('0x6d')],_0x2dad('0x75'),_0x1193a5['customerAvatar']))&&_0x1193a5[_0x2dad('0x77')]){_0x59f4f0=path[_0x2dad('0x6c')](config[_0x2dad('0x6d')],_0x2dad('0x75'),_0x1193a5[_0x2dad('0x6a')]);}}return _0x55f705[_0x2dad('0x73')](_0x59f4f0);}})[_0x2dad('0x1b')](handleError(_0x55f705,null));};exports[_0x2dad('0x78')]=function(_0x421049,_0x2a2630){var _0xa922f1=path[_0x2dad('0x6c')](config['root'],_0x2dad('0x79'));var _0x30edd6={'where':{'id':_0x421049[_0x2dad('0x47')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x2dad('0x48')](_0x30edd6)[_0x2dad('0x24')](handleEntityNotFound(_0x2a2630,null))[_0x2dad('0x24')](function(_0x57fbfb){if(_0x57fbfb){if(!_[_0x2dad('0x70')](_0x57fbfb[_0x2dad('0x7a')])){if(fs[_0x2dad('0x71')](path['join'](config[_0x2dad('0x6d')],_0x2dad('0x75'),_0x57fbfb[_0x2dad('0x7a')]))){_0xa922f1=path['join'](config['root'],_0x2dad('0x75'),_0x57fbfb[_0x2dad('0x7a')]);}}return _0x2a2630[_0x2dad('0x73')](_0xa922f1);}})[_0x2dad('0x1b')](handleError(_0x2a2630,null));};exports[_0x2dad('0x7b')]=function(_0x2fff58,_0x5539de){var _0x7e4162=require(_0x2dad('0x7c'));var _0x305ad0=new _0x7e4162();var _0x3a7269=_0x305ad0[_0x2dad('0x7d')](_0x2fff58[_0x2dad('0x7e')][_0x2dad('0x7f')])[_0x2dad('0x80')]();var _0x570d57={'body':_0x2fff58[_0x2dad('0x4a')],'channel':'chat'};var _0x3cce2e=[];var _0x3f5eac=[];var _0x4c3f9a={};var _0x52b83d=![];return db[_0x2dad('0x81')][_0x2dad('0x54')]()[_0x2dad('0x24')](function(_0x27bd16){if(!_0x27bd16){throw new db[(_0x2dad('0x82'))][(_0x2dad('0x83'))]('no\x20available\x20attributes');}_0x3cce2e=_[_0x2dad('0x84')](_[_0x2dad('0x35')](_0x27bd16),[_0x2dad('0x85'),_0x2dad('0x86')]);_0x3f5eac=_['difference'](_[_0x2dad('0x35')](_0x27bd16),[_0x2dad('0x85'),_0x2dad('0x86'),_0x2dad('0x87'),'ListId']);if(_0x2fff58[_0x2dad('0x4a')]['id']){delete _0x2fff58[_0x2dad('0x4a')]['id'];}if(_[_0x2dad('0x70')](_0x2fff58[_0x2dad('0x4a')][_0x2dad('0x88')])){throw new db[(_0x2dad('0x82'))][(_0x2dad('0x83'))]('from\x20is\x20mandatory');}if(_[_0x2dad('0x70')](_0x2fff58[_0x2dad('0x4a')]['body'])||_0x2fff58[_0x2dad('0x4a')][_0x2dad('0x4a')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2fff58[_0x2dad('0x4a')][_0x2dad('0x89')])){throw new db[(_0x2dad('0x82'))][(_0x2dad('0x83'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3f5eac);}if(!_[_0x2dad('0x8a')](_0x3f5eac,_0x2fff58[_0x2dad('0x4a')][_0x2dad('0x89')])){throw new db[(_0x2dad('0x82'))][(_0x2dad('0x83'))](_0x2dad('0x8b')+_0x3f5eac);}_0x4c3f9a[_0x2fff58[_0x2dad('0x4a')][_0x2dad('0x89')]]=_0x2fff58[_0x2dad('0x4a')]['from'];})[_0x2dad('0x24')](function(){return db[_0x2dad('0x30')][_0x2dad('0x48')]({'where':{'id':_0x2fff58[_0x2dad('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0x2dad('0x8c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4c3f9a,'limit':0x1,'order':[[_0x2dad('0x86'),_0x2dad('0x8d')]]}]},{'model':db[_0x2dad('0x8e')],'as':_0x2dad('0x8f')}]});})[_0x2dad('0x24')](handleEntityNotFound(_0x5539de,null))[_0x2dad('0x24')](function(_0x4f2851){if(_0x4f2851&&_0x4f2851[_0x2dad('0x8c')]){_0x570d57[_0x2dad('0x90')]=_0x4f2851;_0x570d57[_0x2dad('0x91')]=_0x4f2851[_0x2dad('0x8f')];_0x570d57['list']=_0x4f2851['List'];_0x570d57[_0x2dad('0x91')]=_[_0x2dad('0x92')](_0x570d57[_0x2dad('0x91')],['priority'],[_0x2dad('0x93')]);if(_0x570d57[_0x2dad('0x90')]['Applications']){delete _0x570d57[_0x2dad('0x90')][_0x2dad('0x8f')];}if(_0x570d57['account']['List']&&_0x570d57['account'][_0x2dad('0x8c')][_0x2dad('0x94')]['length']){return _0x570d57[_0x2dad('0x90')][_0x2dad('0x8c')][_0x2dad('0x94')][0x0];}var _0x3b6e0f=_[_0x2dad('0x95')](_0x2fff58[_0x2dad('0x4a')],{'firstName':_0x2fff58['body']['from'],'ListId':_0x4f2851[_0x2dad('0x96')]});_0x3b6e0f[_0x2fff58[_0x2dad('0x4a')]['mapKey']]=_0x2fff58[_0x2dad('0x4a')][_0x2dad('0x88')];return db[_0x2dad('0x81')]['create'](_0x3b6e0f,{'fields':_0x3cce2e,'raw':!![]});}})[_0x2dad('0x24')](handleEntityNotFound(_0x5539de,null))[_0x2dad('0x24')](function(_0x500541){_0x570d57['contact']=_0x500541;var _0xe7fc9d=_0x2fff58[_0x2dad('0x4a')][_0x2dad('0x97')];if(_0x2fff58[_0x2dad('0x7e')][_0x2dad('0x98')]){_0xe7fc9d=_0x2fff58[_0x2dad('0x7e')][_0x2dad('0x98')];}else if(_0x2fff58[_0x2dad('0x7e')]['x-forwarded-for']){_0xe7fc9d=_[_0x2dad('0x99')](_0x2fff58[_0x2dad('0x7e')][_0x2dad('0x9a')][_0x2dad('0x9b')](','));}if(_0x500541){var _0x2d6665={'ContactId':_0x500541['id'],'ChatWebsiteId':_0x2fff58[_0x2dad('0x47')]['id'],'from':(_0x500541[_0x2dad('0x9c')]||'')+'\x20'+(_0x500541[_0x2dad('0x9d')]||''),'customerIp':_0xe7fc9d,'customerPort':_0x2fff58[_0x2dad('0x7e')][_0x2dad('0x9e')]?_0x2fff58[_0x2dad('0x7e')][_0x2dad('0x9e')]:null,'referer':_0x2fff58[_0x2dad('0x4a')]['referer'],'browserName':_0x3a7269[_0x2dad('0x9f')][_0x2dad('0x2a')]&&_0x3a7269[_0x2dad('0x9f')]['version']?util[_0x2dad('0xa0')](_0x2dad('0xa1'),_0x3a7269[_0x2dad('0x9f')][_0x2dad('0x2a')],_0x3a7269[_0x2dad('0x9f')][_0x2dad('0xa2')]):_0x2dad('0xa3'),'browserVersion':_0x3a7269[_0x2dad('0x9f')][_0x2dad('0xa2')]||_0x2dad('0xa3'),'osName':util[_0x2dad('0xa0')](_0x2dad('0xa1'),_0x3a7269['os']['name'],_0x3a7269['os'][_0x2dad('0xa2')]),'osVersion':_0x3a7269['os'][_0x2dad('0xa2')],'deviceModel':_0x3a7269[_0x2dad('0xa4')]['model']&&_0x3a7269[_0x2dad('0xa4')][_0x2dad('0xa5')]?util['format'](_0x2dad('0xa6'),_0x3a7269[_0x2dad('0xa4')][_0x2dad('0x33')],_0x3a7269[_0x2dad('0xa4')][_0x2dad('0xa5')],_0x3a7269[_0x2dad('0xa4')][_0x2dad('0x40')]):null,'deviceVendor':_0x3a7269[_0x2dad('0xa4')][_0x2dad('0xa5')],'deviceType':_0x3a7269['device'][_0x2dad('0x40')],'formData':JSON[_0x2dad('0x17')](_0x2fff58[_0x2dad('0x4a')])};var _0x498509={'ChatWebsiteId':_0x2fff58[_0x2dad('0x47')]['id'],'closed':![]};if(_0x2fff58['body']['threadId']){_0x498509['threadId']=_0x2fff58[_0x2dad('0x4a')][_0x2dad('0xa7')];return db['ChatInteraction'][_0x2dad('0x48')]({'where':_0x498509})[_0x2dad('0x24')](function(_0x12778a){if(_0x12778a){return[_0x12778a,![]];}_0x2d6665[_0x2dad('0xa7')]=_0x2fff58[_0x2dad('0x4a')][_0x2dad('0xa7')];_0x2d6665[_0x2dad('0xa8')]=_0x2fff58['body'][_0x2dad('0xa8')];return db[_0x2dad('0xa9')][_0x2dad('0x49')](_0x2d6665)[_0x2dad('0x24')](function(_0x3d38c0){return[_0x3d38c0,!![]];});});}_0x498509[_0x2dad('0xaa')]=_0x500541['id'];if(_0x2fff58['body'][_0x2dad('0xab')]&&_0x2fff58[_0x2dad('0x4a')][_0x2dad('0xab')]['id']){_0x498509['id']=_0x2fff58[_0x2dad('0x4a')]['interaction']['id'];return db[_0x2dad('0xa9')]['find']({'where':_0x498509})[_0x2dad('0x24')](function(_0x16111c){if(_0x16111c){return[_0x16111c,![]];}return db[_0x2dad('0xa9')]['create'](_0x2d6665)[_0x2dad('0x24')](function(_0x34ed11){return[_0x34ed11,!![]];});});}return db[_0x2dad('0xa9')][_0x2dad('0x49')](_0x2d6665)[_0x2dad('0x24')](function(_0x55efa6){return[_0x55efa6,!![]];});}})[_0x2dad('0xac')](function(_0xa71cd1,_0x3a5864){if(_0xa71cd1){_0x52b83d=_0x3a5864;if(!_0x3a5864){var _0x1ca184={'from':(_0x570d57[_0x2dad('0xad')]['firstName']||'')+'\x20'+(_0x570d57[_0x2dad('0xad')][_0x2dad('0x9d')]||'')};if(_0x2fff58['body'][_0x2dad('0xa7')]&&_0x2fff58['body']['messageId']&&_0x2fff58[_0x2dad('0x4a')]['threadId']!=_0x2fff58['body'][_0x2dad('0xae')]){_0x1ca184[_0x2dad('0xa7')]=_0x2fff58['body'][_0x2dad('0xae')];}return _0xa71cd1[_0x2dad('0x53')](_0x1ca184);}else{return _0xa71cd1;}}})[_0x2dad('0x24')](function(_0x3a4927){_0x570d57[_0x2dad('0xab')]=_0x3a4927[_0x2dad('0x25')]({'plain':!![]});_0x570d57[_0x2dad('0xab')][_0x2dad('0xaf')]=_0x52b83d;if(_0x570d57[_0x2dad('0xab')][_0x2dad('0xaf')]){if(_0x570d57[_0x2dad('0x90')][_0x2dad('0xb0')]){_0x570d57[_0x2dad('0x91')][_0x2dad('0xb1')]({'id':0x0,'priority':_0x570d57['applications'][_0x2dad('0x3a')]+0x1,'app':_0x2dad('0xb2'),'appdata':_0x2dad('0xb3'),'interval':_0x2dad('0xb4')});}}return db[_0x2dad('0xb5')][_0x2dad('0x49')]({'body':_0x2fff58[_0x2dad('0x4a')][_0x2dad('0x4a')],'ChatWebsiteId':_0x2fff58[_0x2dad('0x47')]['id'],'ChatInteractionId':_0x3a4927['id'],'direction':'in','ContactId':_0x570d57[_0x2dad('0xad')]['id'],'AttachmentId':_0x2fff58[_0x2dad('0x4a')][_0x2dad('0xb6')]});})[_0x2dad('0x24')](function(_0x4a40c9){_0x570d57[_0x2dad('0x19')]=_0x4a40c9;if(_0x570d57[_0x2dad('0xab')][_0x2dad('0xb7')]){return db[_0x2dad('0xb8')][_0x2dad('0x48')]({'attributes':['id',_0x2dad('0x2a')],'where':{'id':_0x570d57['interaction'][_0x2dad('0xb7')]}})[_0x2dad('0x24')](function(_0x5f05fc){if(_0x5f05fc){_0x570d57['applications'][_0x2dad('0xb9')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5f05fc['name']+','+(_0x570d57[_0x2dad('0x90')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x570d57[_0x2dad('0xba')]=!![];}return respondWithRpcPromise(_0x2dad('0xbb'),'startRouting',_0x570d57);});}return respondWithRpcPromise(_0x2dad('0xbb'),_0x2dad('0xbc'),_0x570d57);})['then'](function(_0x133e1a){respondWithRpcPromise(_0x2dad('0xbd'),_0x2dad('0xbd'),{'event':_0x2dad('0x7b'),'message':_0x133e1a},client9002);return _0x133e1a;})[_0x2dad('0x24')](respondWithResult(_0x5539de,null))[_0x2dad('0x1b')](handleError(_0x5539de,null));};exports[_0x2dad('0xbe')]=function(_0x457de8,_0x3247b6){var _0xe0b971,_0x4a793f,_0x786a1b;var _0x5547cc=[];var _0x116c34={};var _0x4dfe60=_0x457de8['files']||[];var _0x2d36d8=[];var _0x340df9;return db[_0x2dad('0x81')][_0x2dad('0x54')]()[_0x2dad('0x24')](function(_0x3ee3e6){if(!_0x3ee3e6){throw new db[(_0x2dad('0x82'))][(_0x2dad('0x83'))](_0x2dad('0xbf'));}_0x5547cc=_[_0x2dad('0x84')](_['keys'](_0x3ee3e6),[_0x2dad('0x85'),'updatedAt','CompanyId',_0x2dad('0x96')]);if(_0x457de8['body']['id']){delete _0x457de8[_0x2dad('0x4a')]['id'];}if(_['isNil'](_0x457de8[_0x2dad('0x4a')][_0x2dad('0x88')])){throw _0x3247b6[_0x2dad('0x1d')](0x1f4)[_0x2dad('0x2b')](new db['Sequelize'][(_0x2dad('0x83'))](_0x2dad('0xc0')));}if(_[_0x2dad('0x70')](_0x457de8[_0x2dad('0x4a')][_0x2dad('0x4a')])||_0x457de8['body']['body']===''){throw _0x3247b6[_0x2dad('0x1d')](0x1f4)['send'](new db['Sequelize'][(_0x2dad('0x83'))](_0x2dad('0xc1')));}if(_[_0x2dad('0x70')](_0x457de8[_0x2dad('0x4a')][_0x2dad('0xc2')])){throw _0x3247b6[_0x2dad('0x1d')](0x1f4)[_0x2dad('0x2b')](new db[(_0x2dad('0x82'))]['ValidationError'](_0x2dad('0xc3')+_0x5547cc));}if(!_[_0x2dad('0x8a')](_0x5547cc,_0x457de8['body']['mapKeyOffline'])){throw _0x3247b6[_0x2dad('0x1d')](0x1f4)['send'](new db[(_0x2dad('0x82'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5547cc));}_0x116c34[_0x457de8['body'][_0x2dad('0xc2')]]=_0x457de8[_0x2dad('0x4a')][_0x2dad('0x88')];})[_0x2dad('0x24')](function(){return db[_0x2dad('0x30')][_0x2dad('0x48')]({'where':{'id':_0x457de8[_0x2dad('0x47')]['id']},'include':[{'model':db[_0x2dad('0xc4')],'as':'List'},{'model':db['MailAccount'],'as':_0x2dad('0xc5')}]});})['then'](handleEntityNotFound(_0x3247b6,null))[_0x2dad('0x24')](function(_0x518da2){if(_0x518da2&&_0x518da2[_0x2dad('0x8c')]){_0x4a793f=_0x518da2;var _0x8b00aa=_[_0x2dad('0x95')](_0x457de8[_0x2dad('0x4a')],{'firstName':_0x457de8[_0x2dad('0x4a')][_0x2dad('0x88')],'phone':_0x457de8[_0x2dad('0x4a')]['from'],'ListId':_0x518da2[_0x2dad('0x96')]});_0x8b00aa[_0x457de8[_0x2dad('0x4a')][_0x2dad('0xc2')]]=_0x457de8[_0x2dad('0x4a')][_0x2dad('0x88')];return db[_0x2dad('0x81')]['findOrCreate']({'where':_0x116c34,'defaults':_0x8b00aa});}})[_0x2dad('0xac')](function(_0x95de1e){if(_0x95de1e){_0x786a1b=_0x95de1e;var _0x13ce09=fs[_0x2dad('0xc6')](path[_0x2dad('0x6c')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x398aa5=ejs[_0x2dad('0xc7')](_0x13ce09,{'body':_[_0x2dad('0xc8')](_0x457de8[_0x2dad('0x4a')]['body']),'bodyTitle':_0x4a793f[_0x2dad('0xc9')]});return db[_0x2dad('0xca')][_0x2dad('0x49')]({'body':_0x398aa5,'plainBody':htmlToText[_0x2dad('0xcb')](_0x398aa5),'ContactId':_0x95de1e['id'],'ChatWebsiteId':_0x4a793f['id']});}})['then'](function(_0x3788b1){_0x340df9=_0x3788b1;if(_0x4dfe60['length']){var _0xc4be02=_0x4dfe60[_0x2dad('0x2f')](function(_0x5da6c8){return{'name':_0x5da6c8[_0x2dad('0xcc')],'basename':_0x5da6c8[_0x2dad('0x66')],'type':_0x5da6c8['mimetype'],'ChatOfflineMessageId':_0x3788b1['id']};});_0x2d36d8=_0xc4be02[_0x2dad('0x2f')](_0x167a19=>{var _0x129800={'filename':_0x167a19['name'],'path':path[_0x2dad('0x6c')](config['root'],'server','files',_0x2dad('0xcd'),'offline-chat',_0x167a19[_0x2dad('0xce')])};return _0x129800;});if(!_0x4a793f[_0x2dad('0xcf')]){return db[_0x2dad('0xd0')][_0x2dad('0xd1')](function(_0xd4c91f){return db[_0x2dad('0xd2')][_0x2dad('0xd3')](_0xc4be02,{'transaction':_0xd4c91f});});}}})[_0x2dad('0x24')](function(){if(_0x340df9){_0xe0b971=_0x340df9;return db[_0x2dad('0xc5')][_0x2dad('0x58')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2dad('0xd4'),'raw':!![]}]});}})[_0x2dad('0x24')](function(_0x1e5448){if(_0x1e5448&&_0x1e5448[_0x2dad('0xd4')]&&_0x4a793f[_0x2dad('0xd5')]&&_0x4a793f[_0x2dad('0xd6')]){var _0x144690={'tls':{'rejectUnauthorized':![]}};if(_0x1e5448['Smtp'][_0x2dad('0xd7')]){_0x144690['service']=_0x1e5448['Smtp'][_0x2dad('0xd7')];}else{_0x144690['host']=_0x1e5448[_0x2dad('0xd4')][_0x2dad('0xd8')];_0x144690['port']=_0x1e5448[_0x2dad('0xd4')][_0x2dad('0xd9')];_0x144690[_0x2dad('0xda')]=_0x1e5448[_0x2dad('0xd4')]['secure'];}if(_0x1e5448['Smtp'][_0x2dad('0xdb')]){_0x144690[_0x2dad('0xdc')]={'user':_0x1e5448[_0x2dad('0xd4')][_0x2dad('0x4b')],'pass':_0x1e5448[_0x2dad('0xd4')][_0x2dad('0xdd')]};}return respondWithRpcPromise('SendMail',_0x2dad('0xde'),{'account':_0x144690,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1e5448[_0x2dad('0x2a')],_0x1e5448['email']||_0x1e5448[_0x2dad('0xd4')][_0x2dad('0x4b')]),'to':_0x4a793f[_0x2dad('0xd6')],'subject':_0x4a793f[_0x2dad('0xdf')],'html':_0xe0b971['body'],'attachments':_0x2d36d8}},client9003)[_0x2dad('0x24')](function(){return _0xe0b971;})[_0x2dad('0x1b')](function(_0x2992fd){console['error'](_0x2992fd);});}})[_0x2dad('0x24')](function(){if(_0x4a793f&&_0x4a793f[_0x2dad('0xcf')]&&_0x4a793f[_0x2dad('0xe0')]){var _0x567b1d=[];if(_0x4dfe60[_0x2dad('0x3a')]){_0x567b1d=_0x4dfe60['map'](function(_0x4ef775){return{'name':_0x4ef775[_0x2dad('0xcc')],'basename':_0x4ef775['filename'],'type':_0x4ef775[_0x2dad('0xe1')],'ChatOfflineMessageId':_0x340df9['id']};});}var _0x3a0bd1;if(!_[_0x2dad('0x70')](_0x4a793f[_0x2dad('0xe2')])){var _0x3ee87f=_[_0x2dad('0x2f')](_0x457de8[_0x2dad('0x4a')],function(_0x38fd9b){return _0x38fd9b;});var _0x33f9f8=_[_0x2dad('0xe3')](_0x3ee87f)[0x0];var _0x498f64=_['mapValues'](_0x33f9f8,function(_0x15e1e2){return _0x15e1e2;});_0x3a0bd1=_0x498f64[0x1][_0x4a793f[_0x2dad('0xe2')]];}var _0x4163c9={'from':_0x786a1b[_0x2dad('0xe4')],'firstName':_0x786a1b[_0x2dad('0x9c')],'lastName':_0x786a1b['lastName'],'mapKey':_0x2dad('0xe4'),'message':{'from':_0x786a1b[_0x2dad('0xe4')],'to':_0x4a793f[_0x2dad('0xc5')][_0x2dad('0xe4')],'cc':'','subject':_['isNil'](_0x3a0bd1)?_0x4a793f['offlineMessageSubject']:_0x3a0bd1,'messageId':'','sentAt':new Date(),'attach':_0x567b1d['length'],'attachments':_0x567b1d,'originChannel':_0x2dad('0xe5'),'ChatWebsiteId':_0x4a793f['id'],'ChatOfflineMessageId':_0xe0b971['id'],'originTo':_0x4a793f['MailAccount']['email']},'body':_0xe0b971[_0x2dad('0x4a')]};var _0x8d8f9b={'account':{'id':_0x4a793f[_0x2dad('0xe0')]},'body':_0x4163c9,'log':_0x2dad('0xe6')};return respondWithRpcPromise(_0x2dad('0xe6'),_0x2dad('0xe7'),_0x8d8f9b,client9001)[_0x2dad('0x24')](function(){return _0xe0b971;})[_0x2dad('0x1b')](function(_0x546130){console[_0x2dad('0x18')](_0x546130);});}return;})['then'](function(){if(_0xe0b971){return _0xe0b971;}})['then'](respondWithResult(_0x3247b6,null))['catch'](function(_0x5629c3){console[_0x2dad('0x18')]('catch',_0x5629c3);for(var _0xc9eafa of _0x4dfe60){var _0x5c5137=path[_0x2dad('0x6c')](config[_0x2dad('0x6d')],_0x2dad('0xe8'),_0x2dad('0xe9'),_0x2dad('0xcd'),_0x2dad('0xea'),_0xc9eafa[_0x2dad('0x66')]);fs_extra[_0x2dad('0xeb')](_0x5c5137)[_0x2dad('0x1b')](function(_0x1a3471){console[_0x2dad('0x18')](_0x2dad('0xec'),_0x5c5137,_0x1a3471);});}});};exports[_0x2dad('0xed')]=function(_0x1abba6,_0x5506ee){return db['ChatInteraction'][_0x2dad('0x48')]({'where':{'id':_0x1abba6[_0x2dad('0x47')]['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x5506ee,null))[_0x2dad('0x24')](function(_0x40fd89){if(_0x40fd89){return _0x40fd89[_0x2dad('0xed')](_0x1abba6['body'][_0x2dad('0x5d')],_['omit'](_0x1abba6[_0x2dad('0x4a')],[_0x2dad('0x5d'),'id'])||{});}})[_0x2dad('0x24')](respondWithResult(_0x5506ee,null))[_0x2dad('0x1b')](handleError(_0x5506ee,null));};exports['getInteractions']=function(_0x1b9bca,_0x579f66){var _0x2774f8={'raw':![],'where':{}};var _0xcb3818={};var _0x1265cb={'count':0x0,'rows':[]};return db[_0x2dad('0x30')]['findOne']({'where':{'id':_0x1b9bca[_0x2dad('0x47')]['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x579f66,null))[_0x2dad('0x24')](function(_0x3385ce){if(_0x3385ce){_0xcb3818[_0x2dad('0x33')]=_[_0x2dad('0x35')](db[_0x2dad('0xa9')][_0x2dad('0x31')]);_0xcb3818[_0x2dad('0x34')]=_[_0x2dad('0x35')](_0x1b9bca[_0x2dad('0x34')]);_0xcb3818[_0x2dad('0x36')]=_[_0x2dad('0x37')](_0xcb3818['model'],_0xcb3818['query']);_0x2774f8[_0x2dad('0x38')]=_[_0x2dad('0x37')](_0xcb3818[_0x2dad('0x33')],qs[_0x2dad('0x39')](_0x1b9bca['query'][_0x2dad('0x39')]));_0x2774f8[_0x2dad('0x38')]=_0x2774f8[_0x2dad('0x38')][_0x2dad('0x3a')]?_0x2774f8[_0x2dad('0x38')]:_0xcb3818['model'];if(!_0x1b9bca[_0x2dad('0x34')][_0x2dad('0x3b')](_0x2dad('0x59'))){_0x2774f8['limit']=qs[_0x2dad('0x20')](_0x1b9bca[_0x2dad('0x34')][_0x2dad('0x20')]);_0x2774f8[_0x2dad('0x22')]=qs['offset'](_0x1b9bca[_0x2dad('0x34')][_0x2dad('0x22')]);}_0x2774f8[_0x2dad('0x3c')]=qs[_0x2dad('0x5a')](_0x1b9bca[_0x2dad('0x34')]['sort']);_0x2774f8[_0x2dad('0x3d')]=qs[_0x2dad('0x36')](_['pick'](_0x1b9bca[_0x2dad('0x34')],_0xcb3818['filters']));_0x2774f8[_0x2dad('0x3d')][_0x2dad('0x56')]=_0x3385ce['id'];if(_0x1b9bca[_0x2dad('0x34')]['filter']){_0x2774f8[_0x2dad('0x3d')]=_[_0x2dad('0x41')](_0x2774f8['where'],{'$or':_[_0x2dad('0x2f')](_0x2774f8['attributes'],function(_0x583d64){var _0x47f9a0={};_0x47f9a0[_0x583d64]={'$like':'%'+_0x1b9bca['query'][_0x2dad('0x3f')]+'%'};return _0x47f9a0;})});}_0x2774f8=_['merge']({},_0x2774f8,_0x1b9bca[_0x2dad('0x42')]);return db[_0x2dad('0xa9')]['count']({'where':_0x2774f8[_0x2dad('0x3d')]})['then'](function(_0x27c340){_0x1265cb[_0x2dad('0x21')]=_0x27c340;if(_0x1b9bca[_0x2dad('0x34')][_0x2dad('0x43')]){_0x2774f8[_0x2dad('0x44')]=[{'model':db[_0x2dad('0x81')],'as':_0x2dad('0xee'),'required':![]},{'model':db['User'],'as':_0x2dad('0xef'),'attributes':['name',_0x2dad('0xf0'),_0x2dad('0xf1')],'required':![]},{'model':db[_0x2dad('0xf2')],'as':_0x2dad('0xf3'),'attributes':['id',_0x2dad('0x2a'),'color'],'where':_0x1b9bca[_0x2dad('0x34')]['tag']?{'id':_0x1b9bca[_0x2dad('0x34')][_0x2dad('0xf4')]}:undefined,'required':_0x1b9bca[_0x2dad('0x34')][_0x2dad('0xf4')]?!![]:![]}];}return db['ChatInteraction'][_0x2dad('0x45')](_0x2774f8);})['then'](function(_0x16732e){_0x1265cb[_0x2dad('0x61')]=_0x16732e;return _0x1265cb;});}})[_0x2dad('0x24')](respondWithFilteredResult(_0x579f66,_0x2774f8))[_0x2dad('0x1b')](handleError(_0x579f66,null));};function iftimePromise(_0x5a83c3,_0x14afe8){return respondWithRpcPromise(_0x2dad('0xf5'),_0x2dad('0xf6'),{'command':_0x14afe8['timezone']?util[_0x2dad('0xa0')](_0x2dad('0xf7'),_0x5a83c3[_0x2dad('0xf8')],_0x14afe8[_0x2dad('0xf9')]):util[_0x2dad('0xa0')](_0x2dad('0xfa'),_0x5a83c3[_0x2dad('0xf8')])},client9002)[_0x2dad('0x24')](function(_0x5ca7e4){var _0x4f1487=_0x5ca7e4&&_0x5ca7e4[_0x2dad('0xfb')](_0x2dad('0xfc'))>=0x0?!![]:![];logger[_0x2dad('0x13')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x14afe8['id'],_0x5a83c3['id'],_0x5a83c3[_0x2dad('0xf8')],_0x4f1487?_0x2dad('0xfd'):_0x2dad('0xfe'),_0x14afe8[_0x2dad('0xf9')]?_0x14afe8[_0x2dad('0xf9')]:_0x2dad('0xff'));return _0x4f1487;})[_0x2dad('0x1b')](function(_0x6cdfe1){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x14afe8['id'],_0x5a83c3['id'],_0x5a83c3[_0x2dad('0xf8')],util['inspect'](_0x6cdfe1,{'showHidden':![],'depth':null}),_0x14afe8[_0x2dad('0xf9')]?_0x14afe8['timezone']:_0x2dad('0xff'));return![];});}exports[_0x2dad('0xf6')]=function(_0x1a1a7d,_0x47c78b){var _0x261ce8=0x0;var _0x4cf6fd=0x0;var _0x515920=![];var _0x329b4b;var _0x1bdbcb;return db['ChatWebsite'][_0x2dad('0x48')]({'where':{'id':_0x1a1a7d[_0x2dad('0x47')]['id']},'include':[{'model':db[_0x2dad('0x100')],'as':_0x2dad('0x100'),'include':[{'model':db['Interval'],'as':_0x2dad('0x101'),'attributes':['id',_0x2dad('0xf8')],'raw':!![]}]}]})[_0x2dad('0x24')](handleEntityNotFound(_0x47c78b,null))[_0x2dad('0x24')](function(_0x3e53be){if(_0x3e53be){_0x329b4b=_0x3e53be;return _0x3e53be[_0x2dad('0x102')]({'raw':!![]});}})[_0x2dad('0x24')](function(_0x51e32b){if(_0x329b4b){if(_0x51e32b){_0x1bdbcb=_0x51e32b;}}return require(_0x2dad('0x103'))[_0x2dad('0x6f')]();})['then'](function(_0x5b9689){if(_0x5b9689){_0x4cf6fd=_0x5b9689[_0x2dad('0x104')];_0x515920=_0x5b9689['custom'];}})[_0x2dad('0x24')](function(){return db['ChatInteraction'][_0x2dad('0x21')]({'where':{'closed':![]}});})[_0x2dad('0x24')](function(_0x58bff3){_0x261ce8=_0x58bff3;if(_0x4cf6fd&&_0x58bff3>_0x4cf6fd){return db['License'][_0x2dad('0x58')]({'where':{'id':0x1}})['then'](function(_0x1c97fe){if(_0x1c97fe){_0x1c97fe[_0x2dad('0x105')](_0x2dad('0x106'));}});}})[_0x2dad('0x24')](function(){if(_0x329b4b['Interval']&&_0x329b4b[_0x2dad('0x100')]['Intervals']){var _0x32b9b1=[];for(var _0x134c79=0x0;_0x134c79<_0x329b4b[_0x2dad('0x100')][_0x2dad('0x101')][_0x2dad('0x3a')];_0x134c79++){var _0xc1ff0e=_0x329b4b[_0x2dad('0x100')][_0x2dad('0x101')][_0x134c79][_0x2dad('0x25')]({'plain':!![]});_0x32b9b1['push'](iftimePromise(_0xc1ff0e,_0x329b4b));}return BPromise['all'](_0x32b9b1)['then'](function(_0x24700e){return _['some'](_0x24700e);});}else{return!![];}})['then'](function(_0x121bea){var _0x108479=fs[_0x2dad('0xc6')](path[_0x2dad('0x6c')](config[_0x2dad('0x6d')],_0x2dad('0x107')),_0x2dad('0x108'));var _0x3c7188={'remote':_0x329b4b[_0x2dad('0x109')],'query':querystring[_0x2dad('0x17')](_[_0x2dad('0x41')](_0x329b4b[_0x2dad('0x25')]({'plain':!![]}),{'customerIp':_0x1a1a7d[_0x2dad('0x7e')]['x-forwarded-for']||_0x1a1a7d[_0x2dad('0x7e')][_0x2dad('0x10a')]||_0x1a1a7d[_0x2dad('0x10b')][_0x2dad('0x10c')]||_0x1a1a7d['ip'],'referer':_0x1a1a7d['headers']['referer'],'openedInteractions':_0x261ce8,'maxInteractions':_0x4cf6fd,'virtual':_0x515920[_0x2dad('0x104')],'online':_0x121bea,'custom':_0x515920}))[_0x2dad('0x10d')](/'/g,'\x5c\x27')};_0x47c78b[_0x2dad('0x2b')](ejs['render'](Mustache[_0x2dad('0xc7')](_0x108479,_0x3c7188),{'proactiveActions':_0x1bdbcb,'alignment':_0x329b4b[_0x2dad('0x10e')],'verticalAlignment':_0x329b4b['verticalAlignment'],'div_color':_0x329b4b[_0x2dad('0x10f')],'labelText':_0x329b4b[_0x2dad('0x110')],'text_color':_0x329b4b[_0x2dad('0x111')],'button_color':_0x329b4b[_0x2dad('0x112')],'background_color':_0x329b4b[_0x2dad('0x113')],'hideWhenOffline':_0x329b4b[_0x2dad('0x114')],'interval':_0x329b4b[_0x2dad('0x115')]}));})['catch'](handleError(_0x47c78b,null));};exports['addApplications']=function(_0x295eaa,_0x2977ff){var _0x210bb8=_0x295eaa[_0x2dad('0x47')]['id'];var _0x4a505c=_0x295eaa[_0x2dad('0x4a')];var _0x347dfd=0xc8;var _0x3987b7=null;return db[_0x2dad('0xd0')]['transaction']({'isolationLevel':db['sequelize']['Transaction'][_0x2dad('0x116')]['READ_COMMITTED']},function(_0x4ec03f){return db['ChatWebsite'][_0x2dad('0x58')]({'where':{'id':_0x210bb8},'transaction':_0x4ec03f})[_0x2dad('0x24')](function(_0x5b07df){if(_0x5b07df){return db[_0x2dad('0x8e')]['destroy']({'where':{'ChatWebsiteId':_0x210bb8},'transaction':_0x4ec03f})['then'](function(){var _0x1ca70f=_[_0x2dad('0x2f')](_0x4a505c,function(_0x38c50b){_0x38c50b[_0x2dad('0x56')]=_0x210bb8;return _0x38c50b;});return db['ChatApplication'][_0x2dad('0xd3')](_0x1ca70f,{'transaction':_0x4ec03f});});}else{_0x347dfd=0x194;_0x3987b7=[];}});})[_0x2dad('0x24')](function(){if(_0x347dfd!==0x194){return db[_0x2dad('0x8e')][_0x2dad('0x117')]({'where':{'ChatWebsiteId':_0x210bb8},'order':_0x2dad('0x118')})['then'](function(_0x440648){_0x3987b7=_0x440648;});}})[_0x2dad('0x1b')](function(_0x20701d){_0x347dfd=0x1f4;logger['error'](_0x20701d[_0x2dad('0x29')]);if(_0x20701d[_0x2dad('0x2a')]){delete _0x20701d[_0x2dad('0x2a')];}_0x3987b7=_0x20701d;})[_0x2dad('0x119')](function(){if(_0x3987b7===null){_0x2977ff[_0x2dad('0x1c')](_0x347dfd);}else{if(_0x347dfd===0x1f4){_0x2977ff['status'](_0x347dfd)[_0x2dad('0x2b')](_0x3987b7);}else{_0x2977ff['status'](_0x347dfd)[_0x2dad('0x1e')](_0x3987b7);}}});};exports[_0x2dad('0x11a')]=function(_0x14673f,_0x384666){var _0x5549f2={};var _0x19687b={};var _0x2dabe5;var _0x3c75a8;return db[_0x2dad('0x30')][_0x2dad('0x58')]({'where':{'id':_0x14673f['params']['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x384666,null))[_0x2dad('0x24')](function(_0x12a662){if(_0x12a662){_0x2dabe5=_0x12a662;_0x19687b[_0x2dad('0x33')]=_[_0x2dad('0x35')](db['ChatApplication'][_0x2dad('0x31')]);_0x19687b[_0x2dad('0x34')]=_[_0x2dad('0x35')](_0x14673f[_0x2dad('0x34')]);_0x19687b[_0x2dad('0x36')]=_[_0x2dad('0x37')](_0x19687b[_0x2dad('0x33')],_0x19687b['query']);_0x5549f2['attributes']=_[_0x2dad('0x37')](_0x19687b[_0x2dad('0x33')],qs[_0x2dad('0x39')](_0x14673f['query'][_0x2dad('0x39')]));_0x5549f2[_0x2dad('0x38')]=_0x5549f2[_0x2dad('0x38')][_0x2dad('0x3a')]?_0x5549f2[_0x2dad('0x38')]:_0x19687b[_0x2dad('0x33')];_0x5549f2[_0x2dad('0x3c')]=qs[_0x2dad('0x5a')](_0x14673f[_0x2dad('0x34')][_0x2dad('0x5a')]);_0x5549f2[_0x2dad('0x3d')]=qs[_0x2dad('0x36')](_[_0x2dad('0x3e')](_0x14673f[_0x2dad('0x34')],_0x19687b[_0x2dad('0x36')]));if(_0x14673f['query']['filter']){_0x5549f2[_0x2dad('0x3d')]=_[_0x2dad('0x41')](_0x5549f2[_0x2dad('0x3d')],{'$or':_[_0x2dad('0x2f')](_0x5549f2['attributes'],function(_0x8b4865){var _0x2ad3d0={};_0x2ad3d0[_0x8b4865]={'$like':'%'+_0x14673f['query'][_0x2dad('0x3f')]+'%'};return _0x2ad3d0;})});}_0x5549f2=_[_0x2dad('0x41')]({},_0x5549f2,_0x14673f[_0x2dad('0x42')]);return _0x2dabe5[_0x2dad('0x11a')](_0x5549f2);}})[_0x2dad('0x24')](function(_0x2afba1){if(_0x2afba1){_0x3c75a8=_0x2afba1[_0x2dad('0x3a')];if(!_0x14673f[_0x2dad('0x34')]['hasOwnProperty'](_0x2dad('0x59'))){_0x5549f2[_0x2dad('0x20')]=qs[_0x2dad('0x20')](_0x14673f[_0x2dad('0x34')][_0x2dad('0x20')]);_0x5549f2['offset']=qs[_0x2dad('0x22')](_0x14673f[_0x2dad('0x34')]['offset']);}return _0x2dabe5['getApplications'](_0x5549f2);}})['then'](function(_0x250e13){if(_0x250e13){return _0x250e13?{'count':_0x3c75a8,'rows':_0x250e13}:null;}})[_0x2dad('0x24')](respondWithResult(_0x384666,null))[_0x2dad('0x1b')](handleError(_0x384666,null));};exports[_0x2dad('0x11b')]=function(_0x2b72f9,_0x3c1a16){return db[_0x2dad('0x11c')][_0x2dad('0x48')]({'where':{'id':_0x2b72f9[_0x2dad('0x47')]['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x3c1a16,null))['then'](function(_0x53a684){if(_0x53a684){return _0x53a684[_0x2dad('0x11b')](_0x2b72f9[_0x2dad('0x4a')][_0x2dad('0x5d')],_['omit'](_0x2b72f9[_0x2dad('0x4a')],[_0x2dad('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x3c1a16,null))[_0x2dad('0x1b')](handleError(_0x3c1a16,null));};exports['getProactiveActions']=function(_0x519f17,_0x786d80){var _0x2bfe5a={};var _0x13a3ed={};var _0x34be66;var _0x1c06e9;return db[_0x2dad('0x30')][_0x2dad('0x58')]({'where':{'id':_0x519f17[_0x2dad('0x47')]['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x786d80,null))[_0x2dad('0x24')](function(_0x4011fd){if(_0x4011fd){_0x34be66=_0x4011fd;_0x13a3ed[_0x2dad('0x33')]=_['keys'](db[_0x2dad('0x11d')][_0x2dad('0x31')]);_0x13a3ed['query']=_[_0x2dad('0x35')](_0x519f17['query']);_0x13a3ed[_0x2dad('0x36')]=_[_0x2dad('0x37')](_0x13a3ed['model'],_0x13a3ed[_0x2dad('0x34')]);_0x2bfe5a['attributes']=_[_0x2dad('0x37')](_0x13a3ed['model'],qs[_0x2dad('0x39')](_0x519f17[_0x2dad('0x34')][_0x2dad('0x39')]));_0x2bfe5a['attributes']=_0x2bfe5a['attributes'][_0x2dad('0x3a')]?_0x2bfe5a[_0x2dad('0x38')]:_0x13a3ed[_0x2dad('0x33')];_0x2bfe5a[_0x2dad('0x3c')]=qs['sort'](_0x519f17[_0x2dad('0x34')][_0x2dad('0x5a')]);_0x2bfe5a[_0x2dad('0x3d')]=qs[_0x2dad('0x36')](_['pick'](_0x519f17[_0x2dad('0x34')],_0x13a3ed[_0x2dad('0x36')]));if(_0x519f17[_0x2dad('0x34')]['filter']){_0x2bfe5a[_0x2dad('0x3d')]=_['merge'](_0x2bfe5a['where'],{'$or':_[_0x2dad('0x2f')](_0x2bfe5a['attributes'],function(_0x2ebafb){var _0x459f71={};_0x459f71[_0x2ebafb]={'$like':'%'+_0x519f17[_0x2dad('0x34')][_0x2dad('0x3f')]+'%'};return _0x459f71;})});}_0x2bfe5a=_[_0x2dad('0x41')]({},_0x2bfe5a,_0x519f17[_0x2dad('0x42')]);return _0x34be66[_0x2dad('0x102')](_0x2bfe5a);}})[_0x2dad('0x24')](function(_0x3bb493){if(_0x3bb493){_0x1c06e9=_0x3bb493['length'];if(!_0x519f17['query'][_0x2dad('0x3b')](_0x2dad('0x59'))){_0x2bfe5a['limit']=qs[_0x2dad('0x20')](_0x519f17[_0x2dad('0x34')][_0x2dad('0x20')]);_0x2bfe5a[_0x2dad('0x22')]=qs[_0x2dad('0x22')](_0x519f17[_0x2dad('0x34')]['offset']);}return _0x34be66[_0x2dad('0x102')](_0x2bfe5a);}})[_0x2dad('0x24')](function(_0x5c1688){if(_0x5c1688){return _0x5c1688?{'count':_0x1c06e9,'rows':_0x5c1688}:null;}})[_0x2dad('0x24')](respondWithResult(_0x786d80,null))[_0x2dad('0x1b')](handleError(_0x786d80,null));};exports[_0x2dad('0x11e')]=function(_0x206ddb,_0x2790db){var _0x3ff6ed=_0x206ddb['query'][_0x2dad('0x11f')]==='false'?_0x2dad('0x120'):'onlineForm';return db[_0x2dad('0x30')][_0x2dad('0x48')]({'attributes':['id',_0x3ff6ed],'where':{'id':_0x206ddb[_0x2dad('0x47')]['id']}})[_0x2dad('0x24')](handleEntityNotFound(_0x2790db,null))['then'](function(_0x50c789){if(_0x50c789){var _0x24d5de=_0x50c789[_0x3ff6ed];var _0x23041a=_0x24d5de&&_0x24d5de[_0x2dad('0x121')]?_0x24d5de[_0x2dad('0x121')]:[];_0x2790db[_0x2dad('0x2b')]({'fromKey':_[_0x2dad('0x70')](_0x24d5de[_0x2dad('0x122')])?undefined:_0x24d5de[_0x2dad('0x122')],'count':_0x23041a['length'],'rows':_0x23041a});}})[_0x2dad('0x1b')](handleError(_0x2790db,null));};exports[_0x2dad('0x123')]=function(_0x38d947,_0x1dc20a){var _0x1f5230={'raw':![],'where':{}};var _0x41b0b1={};var _0x14498d={'count':0x0,'rows':[]};return db[_0x2dad('0x30')][_0x2dad('0x58')]({'where':{'id':_0x38d947[_0x2dad('0x47')]['id']}})['then'](handleEntityNotFound(_0x1dc20a,null))['then'](function(_0x1aa251){if(_0x1aa251){_0x41b0b1[_0x2dad('0x33')]=_[_0x2dad('0x35')](db[_0x2dad('0xca')]['rawAttributes']);_0x41b0b1[_0x2dad('0x34')]=_['keys'](_0x38d947[_0x2dad('0x34')]);_0x41b0b1[_0x2dad('0x36')]=_[_0x2dad('0x37')](_0x41b0b1[_0x2dad('0x33')],_0x41b0b1[_0x2dad('0x34')]);_0x1f5230[_0x2dad('0x38')]=_[_0x2dad('0x37')](_0x41b0b1[_0x2dad('0x33')],qs[_0x2dad('0x39')](_0x38d947[_0x2dad('0x34')][_0x2dad('0x39')]));_0x1f5230[_0x2dad('0x38')]=_0x1f5230[_0x2dad('0x38')]['length']?_0x1f5230[_0x2dad('0x38')]:_0x41b0b1[_0x2dad('0x33')];if(!_0x38d947['query'][_0x2dad('0x3b')](_0x2dad('0x59'))){_0x1f5230['limit']=qs[_0x2dad('0x20')](_0x38d947[_0x2dad('0x34')][_0x2dad('0x20')]);_0x1f5230[_0x2dad('0x22')]=qs[_0x2dad('0x22')](_0x38d947[_0x2dad('0x34')][_0x2dad('0x22')]);}_0x1f5230[_0x2dad('0x3c')]=qs[_0x2dad('0x5a')](_0x38d947['query']['sort']);_0x1f5230[_0x2dad('0x3d')]=qs[_0x2dad('0x36')](_[_0x2dad('0x3e')](_0x38d947[_0x2dad('0x34')],_0x41b0b1[_0x2dad('0x36')]));_0x1f5230[_0x2dad('0x3d')][_0x2dad('0x56')]=_0x1aa251['id'];if(_0x38d947[_0x2dad('0x34')][_0x2dad('0x3f')]){_0x1f5230[_0x2dad('0x3d')]=_[_0x2dad('0x41')](_0x1f5230[_0x2dad('0x3d')],{'$or':_[_0x2dad('0x2f')](_0x1f5230[_0x2dad('0x38')],function(_0x575845){var _0x29e02e={};_0x29e02e[_0x575845]={'$like':'%'+_0x38d947['query']['filter']+'%'};return _0x29e02e;})});}_0x1f5230=_[_0x2dad('0x41')]({},_0x1f5230,_0x38d947['options']);return db[_0x2dad('0xca')]['count']({'where':_0x1f5230[_0x2dad('0x3d')]})['then'](function(_0x304e52){_0x14498d['count']=_0x304e52;if(_0x38d947[_0x2dad('0x34')][_0x2dad('0x43')]){_0x1f5230['include']=[{'all':!![]}];}else{_0x1f5230[_0x2dad('0x44')]=[{'model':db['CmContact'],'as':_0x2dad('0xee'),'required':![]},{'model':db[_0x2dad('0xd2')],'as':_0x2dad('0x124'),'required':![]}];}return db[_0x2dad('0xca')][_0x2dad('0x45')](_0x1f5230);})[_0x2dad('0x24')](function(_0x99c95d){_0x14498d['rows']=_0x99c95d;return _0x14498d;});}})[_0x2dad('0x24')](respondWithFilteredResult(_0x1dc20a,_0x1f5230))[_0x2dad('0x1b')](handleError(_0x1dc20a,null));};exports[_0x2dad('0x125')]=function(_0x54a6a1,_0x1c09a0){return db[_0x2dad('0x30')]['find']({'where':{'id':_0x54a6a1[_0x2dad('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c09a0,null))['then'](function(_0x5825f2){if(_0x5825f2){return _0x5825f2[_0x2dad('0x125')](_0x54a6a1['body'][_0x2dad('0x5d')],_[_0x2dad('0x126')](_0x54a6a1[_0x2dad('0x4a')],[_0x2dad('0x5d'),'id'])||{})[_0x2dad('0xac')](function(_0x5cba02){for(var _0x5a8d2d=0x0;_0x5a8d2d<_0x54a6a1['body']['ids'][_0x2dad('0x3a')];_0x5a8d2d+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x54a6a1[_0x2dad('0x4a')]['ids'][_0x5a8d2d]),'ChatWebsiteId':Number(_0x54a6a1['params']['id'])});}return _0x5cba02;});}})['then'](respondWithResult(_0x1c09a0,null))[_0x2dad('0x1b')](handleError(_0x1c09a0,null));};exports['removeAgents']=function(_0x5f414c,_0x2f1512){return db[_0x2dad('0x30')]['find']({'where':{'id':_0x5f414c[_0x2dad('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f1512,null))['then'](function(_0x3187ea){if(_0x3187ea){return _0x3187ea[_0x2dad('0x127')](_0x5f414c[_0x2dad('0x34')]['ids'])[_0x2dad('0x24')](function(){if(_['isArray'](_0x5f414c[_0x2dad('0x34')][_0x2dad('0x5d')])){for(var _0x5c994a=0x0;_0x5c994a<_0x5f414c['query']['ids'][_0x2dad('0x3a')];_0x5c994a+=0x1){socket['emit'](_0x2dad('0x128'),{'UserId':Number(_0x5f414c[_0x2dad('0x34')][_0x2dad('0x5d')][_0x5c994a]),'ChatWebsiteId':Number(_0x5f414c[_0x2dad('0x47')]['id'])});}}else{socket[_0x2dad('0x129')]('userChatWebsite:remove',{'UserId':Number(_0x5f414c[_0x2dad('0x34')][_0x2dad('0x5d')]),'ChatWebsiteId':Number(_0x5f414c[_0x2dad('0x47')]['id'])});}});}})[_0x2dad('0x24')](respondWithStatusCode(_0x2f1512,null))[_0x2dad('0x1b')](handleError(_0x2f1512,null));};exports[_0x2dad('0x12a')]=function(_0x385df6,_0x43e5f1){var _0x189a77={};var _0x8305ee={};var _0x428886;var _0x5b148f;return db[_0x2dad('0x30')][_0x2dad('0x58')]({'where':{'id':_0x385df6['params']['id']}})['then'](handleEntityNotFound(_0x43e5f1,null))['then'](function(_0x32c16c){if(_0x32c16c){_0x428886=_0x32c16c;_0x8305ee[_0x2dad('0x33')]=_[_0x2dad('0x35')](db[_0x2dad('0xb8')]['rawAttributes']);_0x8305ee['query']=_[_0x2dad('0x35')](_0x385df6['query']);_0x8305ee['filters']=_[_0x2dad('0x37')](_0x8305ee[_0x2dad('0x33')],_0x8305ee[_0x2dad('0x34')]);_0x189a77[_0x2dad('0x38')]=_[_0x2dad('0x37')](_0x8305ee[_0x2dad('0x33')],qs[_0x2dad('0x39')](_0x385df6[_0x2dad('0x34')][_0x2dad('0x39')]));_0x189a77[_0x2dad('0x38')]=_0x189a77[_0x2dad('0x38')][_0x2dad('0x3a')]?_0x189a77[_0x2dad('0x38')]:_0x8305ee['model'];_0x189a77[_0x2dad('0x3c')]=qs[_0x2dad('0x5a')](_0x385df6[_0x2dad('0x34')][_0x2dad('0x5a')]);_0x189a77[_0x2dad('0x3d')]=qs[_0x2dad('0x36')](_['pick'](_0x385df6[_0x2dad('0x34')],_0x8305ee[_0x2dad('0x36')]));if(_0x385df6[_0x2dad('0x34')]['filter']){_0x189a77['where']=_['merge'](_0x189a77['where'],{'$or':_['map'](_0x189a77[_0x2dad('0x38')],function(_0x43f9af){var _0x47a276={};_0x47a276[_0x43f9af]={'$like':'%'+_0x385df6[_0x2dad('0x34')][_0x2dad('0x3f')]+'%'};return _0x47a276;})});}_0x189a77=_[_0x2dad('0x41')]({},_0x189a77,_0x385df6['options']);return _0x428886[_0x2dad('0x12a')](_0x189a77);}})[_0x2dad('0x24')](function(_0x1bb9c5){if(_0x1bb9c5){_0x5b148f=_0x1bb9c5[_0x2dad('0x3a')];if(!_0x385df6[_0x2dad('0x34')][_0x2dad('0x3b')]('nolimit')){_0x189a77[_0x2dad('0x20')]=qs[_0x2dad('0x20')](_0x385df6['query'][_0x2dad('0x20')]);_0x189a77[_0x2dad('0x22')]=qs['offset'](_0x385df6[_0x2dad('0x34')][_0x2dad('0x22')]);}return _0x428886[_0x2dad('0x12a')](_0x189a77);}})['then'](function(_0x5ac0b2){if(_0x5ac0b2){return _0x5ac0b2?{'count':_0x5b148f,'rows':_0x5ac0b2}:null;}})[_0x2dad('0x24')](respondWithResult(_0x43e5f1,null))[_0x2dad('0x1b')](handleError(_0x43e5f1,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 94b6d0d..edfea2c 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 _0x17c4=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update'];(function(_0x328ac9,_0x2f7225){var _0x2b3a0a=function(_0x759e26){while(--_0x759e26){_0x328ac9['push'](_0x328ac9['shift']());}};_0x2b3a0a(++_0x2f7225);}(_0x17c4,0x102));var _0x417c=function(_0x864d71,_0x29fc0e){_0x864d71=_0x864d71-0x0;var _0x16995b=_0x17c4[_0x864d71];return _0x16995b;};'use strict';var EventEmitter=require(_0x417c('0x0'));var ChatWebsite=require(_0x417c('0x1'))['db'][_0x417c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x417c('0x3')](0x0);var events={'afterCreate':_0x417c('0x4'),'afterUpdate':_0x417c('0x5'),'afterDestroy':_0x417c('0x6')};function emitEvent(_0x74b351){return function(_0x212ac0,_0x413ee5,_0x33ae56){ChatWebsiteEvents['emit'](_0x74b351+':'+_0x212ac0['id'],_0x212ac0);ChatWebsiteEvents[_0x417c('0x7')](_0x74b351,_0x212ac0);_0x33ae56(null);};}for(var e in events){if(events[_0x417c('0x8')](e)){var event=events[e];ChatWebsite[_0x417c('0x9')](e,emitEvent(event));}}module[_0x417c('0xa')]=ChatWebsiteEvents; \ No newline at end of file +var _0xac9d=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x32e7d6,_0x682bc5){var _0x5427cf=function(_0x365c2d){while(--_0x365c2d){_0x32e7d6['push'](_0x32e7d6['shift']());}};_0x5427cf(++_0x682bc5);}(_0xac9d,0x14d));var _0xdac9=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0xac9d[_0x478c8a];return _0x3b6b3e;};'use strict';var EventEmitter=require(_0xdac9('0x0'));var ChatWebsite=require(_0xdac9('0x1'))['db'][_0xdac9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xdac9('0x3')](0x0);var events={'afterCreate':_0xdac9('0x4'),'afterUpdate':_0xdac9('0x5'),'afterDestroy':_0xdac9('0x6')};function emitEvent(_0x1b967e){return function(_0x51a5d7,_0x1c17a6,_0x5a984a){ChatWebsiteEvents[_0xdac9('0x7')](_0x1b967e+':'+_0x51a5d7['id'],_0x51a5d7);ChatWebsiteEvents[_0xdac9('0x7')](_0x1b967e,_0x51a5d7);_0x5a984a(null);};}for(var e in events){if(events[_0xdac9('0x8')](e)){var event=events[e];ChatWebsite[_0xdac9('0x9')](e,emitEvent(event));}}module[_0xdac9('0xa')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index c93327c..3f4636e 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 _0xbd2a=['../../config/logger','api','moment','path','rimraf','../../config/environment','define','ChatWebsite','chat_websites','util'];(function(_0x19c921,_0x15bc5b){var _0x35c4d8=function(_0x83f8af){while(--_0x83f8af){_0x19c921['push'](_0x19c921['shift']());}};_0x35c4d8(++_0x15bc5b);}(_0xbd2a,0x1b7));var _0xabd2=function(_0x28fde1,_0x339cff){_0x28fde1=_0x28fde1-0x0;var _0x11e772=_0xbd2a[_0x28fde1];return _0x11e772;};'use strict';var _=require('lodash');var util=require(_0xabd2('0x0'));var logger=require(_0xabd2('0x1'))(_0xabd2('0x2'));var moment=require(_0xabd2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xabd2('0x4'));var rimraf=require(_0xabd2('0x5'));var config=require(_0xabd2('0x6'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x5f7438,_0x3cddb3){return _0x5f7438[_0xabd2('0x7')](_0xabd2('0x8'),attributes,{'tableName':_0xabd2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b03=['request-promise','path','../../config/environment','exports','define','ChatWebsite','chat_websites','../../config/logger','api','moment','bluebird'];(function(_0x3dc4d6,_0x52fdf3){var _0x37f277=function(_0x10ffcd){while(--_0x10ffcd){_0x3dc4d6['push'](_0x3dc4d6['shift']());}};_0x37f277(++_0x52fdf3);}(_0x7b03,0x1d5));var _0x37b0=function(_0x241eb9,_0x5ccc3f){_0x241eb9=_0x241eb9-0x0;var _0x4f916b=_0x7b03[_0x241eb9];return _0x4f916b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x37b0('0x0'))(_0x37b0('0x1'));var moment=require(_0x37b0('0x2'));var BPromise=require(_0x37b0('0x3'));var rp=require(_0x37b0('0x4'));var fs=require('fs');var path=require(_0x37b0('0x5'));var rimraf=require('rimraf');var config=require(_0x37b0('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x37b0('0x7')]=function(_0x3659ad,_0x87f451){return _0x3659ad[_0x37b0('0x8')](_0x37b0('0x9'),attributes,{'tableName':_0x37b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index eed6957..33ec7b8 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 _0xa10c=['socket.io-emitter','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0xa10c,0x16b));var _0xca10=function(_0x2768cc,_0x4e4316){_0x2768cc=_0x2768cc-0x0;var _0x41f64c=_0xa10c[_0x2768cc];return _0x41f64c;};'use strict';var _=require(_0xca10('0x0'));var util=require(_0xca10('0x1'));var moment=require(_0xca10('0x2'));var BPromise=require(_0xca10('0x3'));var rs=require(_0xca10('0x4'));var fs=require('fs');var Redis=require(_0xca10('0x5'));var db=require(_0xca10('0x6'))['db'];var utils=require(_0xca10('0x7'));var logger=require(_0xca10('0x8'))(_0xca10('0x9'));var config=require('../../config/environment');var jayson=require(_0xca10('0xa'));var client=jayson['client'][_0xca10('0xb')]({'port':0x232a});config[_0xca10('0xc')]=_[_0xca10('0xd')](config['redis'],{'host':_0xca10('0xe'),'port':0x18eb});var socket=require(_0xca10('0xf'))(new Redis(config[_0xca10('0xc')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x58bdc2,_0x5dcf2c,_0x16d24c){return new BPromise(function(_0x5eb97b,_0x28cca6){return client[_0xca10('0x10')](_0x58bdc2,_0x16d24c)[_0xca10('0x11')](function(_0x395863){logger['info'](_0xca10('0x12'),_0x5dcf2c,_0xca10('0x13'));logger[_0xca10('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5dcf2c,'request\x20sent',JSON[_0xca10('0x15')](_0x395863));if(_0x395863['error']){if(_0x395863['error'][_0xca10('0x16')]===0x1f4){logger[_0xca10('0x17')](_0xca10('0x12'),_0x5dcf2c,_0x395863[_0xca10('0x17')][_0xca10('0x18')]);return _0x28cca6(_0x395863['error'][_0xca10('0x18')]);}logger[_0xca10('0x17')](_0xca10('0x12'),_0x5dcf2c,_0x395863[_0xca10('0x17')][_0xca10('0x18')]);return _0x5eb97b(_0x395863[_0xca10('0x17')][_0xca10('0x18')]);}else{logger[_0xca10('0x19')](_0xca10('0x12'),_0x5dcf2c,_0xca10('0x13'));_0x5eb97b(_0x395863[_0xca10('0x1a')][_0xca10('0x18')]);}})['catch'](function(_0x2f9538){logger[_0xca10('0x17')](_0xca10('0x12'),_0x5dcf2c,_0x2f9538);_0x28cca6(_0x2f9538);});});} \ No newline at end of file +var _0x52b8=['localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults'];(function(_0x1bb030,_0x27d05f){var _0x28ef4f=function(_0xb1150e){while(--_0xb1150e){_0x1bb030['push'](_0x1bb030['shift']());}};_0x28ef4f(++_0x27d05f);}(_0x52b8,0x13c));var _0x852b=function(_0xe806dc,_0x8b2fd1){_0xe806dc=_0xe806dc-0x0;var _0x15a396=_0x52b8[_0xe806dc];return _0x15a396;};'use strict';var _=require(_0x852b('0x0'));var util=require(_0x852b('0x1'));var moment=require(_0x852b('0x2'));var BPromise=require(_0x852b('0x3'));var rs=require(_0x852b('0x4'));var fs=require('fs');var Redis=require(_0x852b('0x5'));var db=require(_0x852b('0x6'))['db'];var utils=require(_0x852b('0x7'));var logger=require(_0x852b('0x8'))(_0x852b('0x9'));var config=require('../../config/environment');var jayson=require(_0x852b('0xa'));var client=jayson[_0x852b('0xb')]['http']({'port':0x232a});config[_0x852b('0xc')]=_[_0x852b('0xd')](config[_0x852b('0xc')],{'host':_0x852b('0xe'),'port':0x18eb});var socket=require(_0x852b('0xf'))(new Redis(config[_0x852b('0xc')]));require(_0x852b('0x10'))[_0x852b('0x11')](socket);function respondWithRpcPromise(_0xf0952b,_0x36dd72,_0x56ac15){return new BPromise(function(_0x51e379,_0x1590bb){return client[_0x852b('0x12')](_0xf0952b,_0x56ac15)[_0x852b('0x13')](function(_0x355608){logger[_0x852b('0x14')](_0x852b('0x15'),_0x36dd72,_0x852b('0x16'));logger[_0x852b('0x17')](_0x852b('0x18'),_0x36dd72,'request\x20sent',JSON['stringify'](_0x355608));if(_0x355608[_0x852b('0x19')]){if(_0x355608['error'][_0x852b('0x1a')]===0x1f4){logger[_0x852b('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x36dd72,_0x355608[_0x852b('0x19')][_0x852b('0x1b')]);return _0x1590bb(_0x355608[_0x852b('0x19')][_0x852b('0x1b')]);}logger[_0x852b('0x19')](_0x852b('0x15'),_0x36dd72,_0x355608['error'][_0x852b('0x1b')]);return _0x51e379(_0x355608[_0x852b('0x19')][_0x852b('0x1b')]);}else{logger[_0x852b('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x36dd72,_0x852b('0x16'));_0x51e379(_0x355608[_0x852b('0x1c')][_0x852b('0x1b')]);}})[_0x852b('0x1d')](function(_0x4261b1){logger[_0x852b('0x19')](_0x852b('0x15'),_0x36dd72,_0x4261b1);_0x1590bb(_0x4261b1);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 8539fe5..0d0c35a 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 _0x2d3f=['remove','update','emit'];(function(_0x590673,_0x3e366a){var _0x327344=function(_0xe1cb15){while(--_0xe1cb15){_0x590673['push'](_0x590673['shift']());}};_0x327344(++_0x3e366a);}(_0x2d3f,0xe1));var _0xf2d3=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x2d3f[_0x334841];return _0x5beb4b;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xf2d3('0x0'),_0xf2d3('0x1')];function createListener(_0x1772a4,_0x23ec36){return function(_0x2c50ad){_0x23ec36[_0xf2d3('0x2')](_0x1772a4,_0x2c50ad);};}function removeListener(_0x3f17b0,_0x1fadc5){return function(){ChatWebsiteEvents['removeListener'](_0x3f17b0,_0x1fadc5);};}exports['register']=function(_0x48076a){for(var _0x566cbc=0x0,_0x1d9149=events['length'];_0x566cbc<_0x1d9149;_0x566cbc++){var _0x2b453a=events[_0x566cbc];var _0x13d364=createListener('chatWebsite:'+_0x2b453a,_0x48076a);ChatWebsiteEvents['on'](_0x2b453a,_0x13d364);}}; \ No newline at end of file +var _0x6ad1=['remove','update','emit','removeListener','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x37512d,_0x2da3d9){var _0x2c356f=function(_0x5914ae){while(--_0x5914ae){_0x37512d['push'](_0x37512d['shift']());}};_0x2c356f(++_0x2da3d9);}(_0x6ad1,0xde));var _0x16ad=function(_0xc95ab8,_0x2985ac){_0xc95ab8=_0xc95ab8-0x0;var _0x2aed95=_0x6ad1[_0xc95ab8];return _0x2aed95;};'use strict';var ChatWebsiteEvents=require(_0x16ad('0x0'));var events=[_0x16ad('0x1'),_0x16ad('0x2'),_0x16ad('0x3')];function createListener(_0x50be0b,_0x49fe89){return function(_0x2363ea){_0x49fe89[_0x16ad('0x4')](_0x50be0b,_0x2363ea);};}function removeListener(_0x3a177d,_0x48aa25){return function(){ChatWebsiteEvents[_0x16ad('0x5')](_0x3a177d,_0x48aa25);};}exports['register']=function(_0x4d848e){for(var _0x24eaf4=0x0,_0x6b6320=events[_0x16ad('0x6')];_0x24eaf4<_0x6b6320;_0x24eaf4++){var _0xe68b7f=events[_0x24eaf4];var _0xac1e80=createListener(_0x16ad('0x7')+_0xe68b7f,_0x4d848e);ChatWebsiteEvents['on'](_0xe68b7f,_0xac1e80);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index bc27a3e..367ea47 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 _0xeef3=['addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','getInteractions','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','originalname','single','addLogo','join','now','/:id/avatar','file','addAvatar','server/files/images/avatars/','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','extname','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users'];(function(_0x6dae8e,_0x38297f){var _0x92fc06=function(_0x3760b2){while(--_0x3760b2){_0x6dae8e['push'](_0x6dae8e['shift']());}};_0x92fc06(++_0x38297f);}(_0xeef3,0xa5));var _0x3eef=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0xeef3[_0x43de22];return _0x4b15ee;};'use strict';var multer=require(_0x3eef('0x0'));var util=require(_0x3eef('0x1'));var path=require('path');var timeout=require(_0x3eef('0x2'));var express=require(_0x3eef('0x3'));var router=express[_0x3eef('0x4')]();var fs_extra=require(_0x3eef('0x5'));var auth=require(_0x3eef('0x6'));var interaction=require(_0x3eef('0x7'));var config=require(_0x3eef('0x8'));var controller=require(_0x3eef('0x9'));router[_0x3eef('0xa')]('/',auth[_0x3eef('0xb')](),controller[_0x3eef('0xc')]);router[_0x3eef('0xa')]('/describe',auth[_0x3eef('0xb')](),controller[_0x3eef('0xd')]);router[_0x3eef('0xa')](_0x3eef('0xe'),auth[_0x3eef('0xb')](),controller[_0x3eef('0xf')]);router['get'](_0x3eef('0x10'),auth[_0x3eef('0xb')](),controller[_0x3eef('0x11')]);router[_0x3eef('0xa')](_0x3eef('0x12'),auth[_0x3eef('0xb')](),controller[_0x3eef('0x13')]);router[_0x3eef('0xa')](_0x3eef('0x14'),controller[_0x3eef('0x15')]);router[_0x3eef('0xa')]('/:id/avatar',controller[_0x3eef('0x16')]);router['get'](_0x3eef('0x17'),controller[_0x3eef('0x18')]);router[_0x3eef('0xa')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0x3eef('0xa')](_0x3eef('0x19'),auth[_0x3eef('0xb')](),controller[_0x3eef('0x1a')]);router['get']('/:id/snippet',controller[_0x3eef('0x1b')]);router[_0x3eef('0xa')]('/:id/applications',auth['isAuthenticated'](),controller[_0x3eef('0x1c')]);router[_0x3eef('0xa')](_0x3eef('0x1d'),auth[_0x3eef('0xb')](),controller[_0x3eef('0x1e')]);router[_0x3eef('0xa')](_0x3eef('0x1f'),controller[_0x3eef('0x20')]);router[_0x3eef('0xa')](_0x3eef('0x21'),auth[_0x3eef('0xb')](),controller[_0x3eef('0x22')]);router[_0x3eef('0xa')]('/:id/users',auth[_0x3eef('0xb')](),controller[_0x3eef('0x23')]);router[_0x3eef('0x24')]('/',auth[_0x3eef('0xb')](),controller['create']);router[_0x3eef('0x24')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3eef('0x25')]);router[_0x3eef('0x24')](_0x3eef('0x12'),auth[_0x3eef('0xb')](),controller[_0x3eef('0x26')]);var upload=multer({'storage':multer[_0x3eef('0x27')]({'destination':function(_0x32afb8,_0x5aff9a,_0x407b00){_0x407b00(null,path['join'](config[_0x3eef('0x28')],_0x3eef('0x29')));},'filename':function(_0x1657aa,_0x18e8b5,_0x819872){_0x819872(null,util[_0x3eef('0x2a')](_0x3eef('0x2b'),Date['now'](),_0x18e8b5[_0x3eef('0x2c')]));}})});router['post'](_0x3eef('0x14'),upload[_0x3eef('0x2d')]('file'),controller[_0x3eef('0x2e')]);var upload=multer({'storage':multer[_0x3eef('0x27')]({'destination':function(_0xb841fb,_0x4da3a9,_0x193050){_0x193050(null,path[_0x3eef('0x2f')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x5d325b,_0x539e78,_0x2a8485){_0x2a8485(null,util[_0x3eef('0x2a')](_0x3eef('0x2b'),Date[_0x3eef('0x30')](),_0x539e78[_0x3eef('0x2c')]));}})});router[_0x3eef('0x24')](_0x3eef('0x31'),upload[_0x3eef('0x2d')](_0x3eef('0x32')),controller[_0x3eef('0x33')]);var upload=multer({'storage':multer[_0x3eef('0x27')]({'destination':function(_0x239968,_0x24a18b,_0x43a69c){_0x43a69c(null,path[_0x3eef('0x2f')](config['root'],_0x3eef('0x34')));},'filename':function(_0x96e9b5,_0xd86cf7,_0x48d400){_0x48d400(null,util[_0x3eef('0x2a')](_0x3eef('0x2b'),Date[_0x3eef('0x30')](),_0xd86cf7[_0x3eef('0x2c')]));}})});router[_0x3eef('0x24')](_0x3eef('0x17'),upload[_0x3eef('0x2d')](_0x3eef('0x32')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x3eef('0x27')]({'destination':function(_0x51fe08,_0x1fb46c,_0x16a2be){_0x16a2be(null,path[_0x3eef('0x2f')](config[_0x3eef('0x28')],'server/files/images/avatars/'));},'filename':function(_0x227afb,_0x3e809d,_0x4db4dc){_0x4db4dc(null,util['format']('%s-%s',Date['now'](),_0x3e809d[_0x3eef('0x2c')]));}})});router['post'](_0x3eef('0x35'),upload[_0x3eef('0x2d')]('file'),controller[_0x3eef('0x36')]);router['post'](_0x3eef('0x37'),controller[_0x3eef('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x3eef('0x27')]({'destination':function(_0x5564ad,_0x11320d,_0x2a8c6b){const _0xa29e66=path[_0x3eef('0x2f')](config[_0x3eef('0x28')],_0x3eef('0x39'),_0x3eef('0x3a'),_0x3eef('0x3b'));fs_extra['ensureDir'](_0xa29e66,function(){_0x2a8c6b(null,_0xa29e66);});},'filename':function(_0x25b684,_0x3971d3,_0x136602){const _0x2c50fe=_0x3971d3['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5b2bb6=path[_0x3eef('0x3c')](_0x2c50fe);const _0x7c8e7a=Date[_0x3eef('0x30')]()+'-'+_0x2c50fe[_0x3eef('0x3d')](_0x5b2bb6,'')+_0x5b2bb6;_0x136602(null,_0x7c8e7a);}})});router[_0x3eef('0x24')](_0x3eef('0x3e'),offlineUploadMulter[_0x3eef('0x3f')](),controller[_0x3eef('0x40')]);router[_0x3eef('0x24')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x3eef('0x41')]);router[_0x3eef('0x24')]('/:id/applications',auth['isAuthenticated'](),controller[_0x3eef('0x42')]);router[_0x3eef('0x24')](_0x3eef('0x1d'),auth[_0x3eef('0xb')](),controller[_0x3eef('0x43')]);router[_0x3eef('0x24')](_0x3eef('0x44'),auth[_0x3eef('0xb')](),controller[_0x3eef('0x45')]);router[_0x3eef('0x46')](_0x3eef('0xe'),auth[_0x3eef('0xb')](),controller[_0x3eef('0x47')]);router[_0x3eef('0x48')](_0x3eef('0xe'),auth[_0x3eef('0xb')](),controller[_0x3eef('0x49')]);router[_0x3eef('0x48')](_0x3eef('0x10'),auth['isAuthenticated'](),controller[_0x3eef('0x4a')]);router['delete'](_0x3eef('0x12'),auth[_0x3eef('0xb')](),controller[_0x3eef('0x4b')]);router['delete'](_0x3eef('0x44'),auth[_0x3eef('0xb')](),controller[_0x3eef('0x4c')]);module[_0x3eef('0x4d')]=router; \ No newline at end of file +var _0x162e=['getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','format','file','addAvatar','root','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','put','destroy','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar'];(function(_0x5117ac,_0x3161ce){var _0x46e8bf=function(_0x196461){while(--_0x196461){_0x5117ac['push'](_0x5117ac['shift']());}};_0x46e8bf(++_0x3161ce);}(_0x162e,0x19b));var _0xe162=function(_0x258c77,_0x144d59){_0x258c77=_0x258c77-0x0;var _0x56169e=_0x162e[_0x258c77];return _0x56169e;};'use strict';var multer=require(_0xe162('0x0'));var util=require(_0xe162('0x1'));var path=require(_0xe162('0x2'));var timeout=require(_0xe162('0x3'));var express=require(_0xe162('0x4'));var router=express['Router']();var fs_extra=require(_0xe162('0x5'));var auth=require(_0xe162('0x6'));var interaction=require(_0xe162('0x7'));var config=require('../../config/environment');var controller=require(_0xe162('0x8'));router[_0xe162('0x9')]('/',auth['isAuthenticated'](),controller[_0xe162('0xa')]);router['get'](_0xe162('0xb'),auth[_0xe162('0xc')](),controller[_0xe162('0xd')]);router[_0xe162('0x9')](_0xe162('0xe'),auth['isAuthenticated'](),controller[_0xe162('0xf')]);router[_0xe162('0x9')](_0xe162('0x10'),auth[_0xe162('0xc')](),controller[_0xe162('0x11')]);router[_0xe162('0x9')](_0xe162('0x12'),auth[_0xe162('0xc')](),controller['getAnswers']);router[_0xe162('0x9')](_0xe162('0x13'),controller[_0xe162('0x14')]);router[_0xe162('0x9')](_0xe162('0x15'),controller[_0xe162('0x16')]);router[_0xe162('0x9')](_0xe162('0x17'),controller[_0xe162('0x18')]);router[_0xe162('0x9')](_0xe162('0x19'),controller[_0xe162('0x1a')]);router[_0xe162('0x9')]('/:id/interactions',auth[_0xe162('0xc')](),controller[_0xe162('0x1b')]);router[_0xe162('0x9')]('/:id/snippet',controller[_0xe162('0x1c')]);router[_0xe162('0x9')](_0xe162('0x1d'),auth[_0xe162('0xc')](),controller[_0xe162('0x1e')]);router[_0xe162('0x9')](_0xe162('0x1f'),auth[_0xe162('0xc')](),controller[_0xe162('0x20')]);router[_0xe162('0x9')]('/:id/fields',controller['getFields']);router[_0xe162('0x9')](_0xe162('0x21'),auth['isAuthenticated'](),controller[_0xe162('0x22')]);router[_0xe162('0x9')](_0xe162('0x23'),auth['isAuthenticated'](),controller[_0xe162('0x24')]);router[_0xe162('0x25')]('/',auth[_0xe162('0xc')](),controller[_0xe162('0x26')]);router[_0xe162('0x25')](_0xe162('0x10'),auth[_0xe162('0xc')](),controller[_0xe162('0x27')]);router[_0xe162('0x25')]('/:id/canned_answers',auth[_0xe162('0xc')](),controller[_0xe162('0x28')]);var upload=multer({'storage':multer[_0xe162('0x29')]({'destination':function(_0x415832,_0xb456f,_0x372478){_0x372478(null,path[_0xe162('0x2a')](config['root'],_0xe162('0x2b')));},'filename':function(_0x25638c,_0x2f83c0,_0x220ed6){_0x220ed6(null,util['format'](_0xe162('0x2c'),Date[_0xe162('0x2d')](),_0x2f83c0[_0xe162('0x2e')]));}})});router[_0xe162('0x25')](_0xe162('0x13'),upload[_0xe162('0x2f')]('file'),controller[_0xe162('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x518ce3,_0x5074f2,_0x5aef51){_0x5aef51(null,path[_0xe162('0x2a')](config['root'],_0xe162('0x31')));},'filename':function(_0x223fec,_0x497298,_0x53c5a6){_0x53c5a6(null,util[_0xe162('0x32')](_0xe162('0x2c'),Date['now'](),_0x497298[_0xe162('0x2e')]));}})});router[_0xe162('0x25')]('/:id/avatar',upload[_0xe162('0x2f')](_0xe162('0x33')),controller[_0xe162('0x34')]);var upload=multer({'storage':multer[_0xe162('0x29')]({'destination':function(_0x1931d6,_0x43d3af,_0x1c73ed){_0x1c73ed(null,path[_0xe162('0x2a')](config[_0xe162('0x35')],'server/files/images/avatars/'));},'filename':function(_0x4c04cf,_0x3fc210,_0x3b4213){_0x3b4213(null,util[_0xe162('0x32')](_0xe162('0x2c'),Date['now'](),_0x3fc210[_0xe162('0x2e')]));}})});router['post'](_0xe162('0x17'),upload[_0xe162('0x2f')](_0xe162('0x33')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xe162('0x29')]({'destination':function(_0x513a4b,_0x5cc7cc,_0x10dd73){_0x10dd73(null,path[_0xe162('0x2a')](config[_0xe162('0x35')],_0xe162('0x31')));},'filename':function(_0x238340,_0x7ffcb2,_0x43a257){_0x43a257(null,util[_0xe162('0x32')](_0xe162('0x2c'),Date[_0xe162('0x2d')](),_0x7ffcb2[_0xe162('0x2e')]));}})});router[_0xe162('0x25')](_0xe162('0x19'),upload[_0xe162('0x2f')]('file'),controller[_0xe162('0x36')]);router[_0xe162('0x25')](_0xe162('0x37'),controller[_0xe162('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0xe162('0x29')]({'destination':function(_0x104620,_0xf9faad,_0x9e5f9c){const _0x2fd8e3=path[_0xe162('0x2a')](config[_0xe162('0x35')],'server/files',_0xe162('0x39'),_0xe162('0x3a'));fs_extra['ensureDir'](_0x2fd8e3,function(){_0x9e5f9c(null,_0x2fd8e3);});},'filename':function(_0x33db46,_0x44e06f,_0x56bfcc){const _0xee18ec=_0x44e06f['originalname'][_0xe162('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1e6814=path[_0xe162('0x3c')](_0xee18ec);const _0x239de4=Date[_0xe162('0x2d')]()+'-'+_0xee18ec[_0xe162('0x3b')](_0x1e6814,'')+_0x1e6814;_0x56bfcc(null,_0x239de4);}})});router[_0xe162('0x25')](_0xe162('0x3d'),offlineUploadMulter[_0xe162('0x3e')](),controller[_0xe162('0x3f')]);router[_0xe162('0x25')]('/:id/interactions',auth[_0xe162('0xc')](),controller[_0xe162('0x40')]);router[_0xe162('0x25')](_0xe162('0x1d'),auth[_0xe162('0xc')](),controller[_0xe162('0x41')]);router[_0xe162('0x25')]('/:id/proactive_actions',auth[_0xe162('0xc')](),controller['addProactiveActions']);router[_0xe162('0x25')](_0xe162('0x23'),auth['isAuthenticated'](),controller['addAgents']);router[_0xe162('0x42')](_0xe162('0xe'),auth[_0xe162('0xc')](),controller['update']);router['delete'](_0xe162('0xe'),auth['isAuthenticated'](),controller[_0xe162('0x43')]);router['delete'](_0xe162('0x10'),auth[_0xe162('0xc')](),controller[_0xe162('0x44')]);router[_0xe162('0x45')](_0xe162('0x12'),auth['isAuthenticated'](),controller[_0xe162('0x46')]);router[_0xe162('0x45')](_0xe162('0x23'),auth[_0xe162('0xc')](),controller[_0xe162('0x47')]);module[_0xe162('0x48')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index fc7bb4f..e9b3b2b 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 _0x9756=['env','production','app','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','../components/auth/service','../config/environment'];(function(_0x3b76f7,_0x566c53){var _0x43984e=function(_0x164f77){while(--_0x164f77){_0x3b76f7['push'](_0x3b76f7['shift']());}};_0x43984e(++_0x566c53);}(_0x9756,0xc4));var _0x6975=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x9756[_0x4ae6ef];return _0x3cbb4e;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x6975('0x0'));var config=require(_0x6975('0x1'));var router=express['Router']();var isProduction=config[_0x6975('0x2')]===_0x6975('0x3')||![];function clientSideLogs(_0x53e127,_0x42f378,_0x4e9687){var _0x48348a=_0x53e127[_0x6975('0x4')]['get']('client-side-logger');if(!_0x48348a){throw new Error(_0x6975('0x5'));}return beaverLogger[_0x6975('0x6')]({'uri':_0x6975('0x7'),'logger':_0x48348a,'enableCors':!isProduction})(_0x53e127,_0x42f378,_0x4e9687);}router[_0x6975('0x8')](auth[_0x6975('0x9')](),clientSideLogs);module[_0x6975('0xa')]=router; \ No newline at end of file +var _0x8862=['Router','env','production','get','client-side-logger','expressEndpoint','/client-logs','isAuthenticated','exports','beaver-logger/server','express'];(function(_0x8ee07f,_0x156d35){var _0x29cc4d=function(_0x51f430){while(--_0x51f430){_0x8ee07f['push'](_0x8ee07f['shift']());}};_0x29cc4d(++_0x156d35);}(_0x8862,0x1b6));var _0x2886=function(_0x3f09bb,_0x28bb27){_0x3f09bb=_0x3f09bb-0x0;var _0x542281=_0x8862[_0x3f09bb];return _0x542281;};var beaverLogger=require(_0x2886('0x0'));var express=require(_0x2886('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x2886('0x2')]();var isProduction=config[_0x2886('0x3')]===_0x2886('0x4')||![];function clientSideLogs(_0x8a4882,_0x549f19,_0x12175d){var _0x445f96=_0x8a4882['app'][_0x2886('0x5')](_0x2886('0x6'));if(!_0x445f96){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x2886('0x7')]({'uri':_0x2886('0x8'),'logger':_0x445f96,'enableCors':!isProduction})(_0x8a4882,_0x549f19,_0x12175d);}router['use'](auth[_0x2886('0x9')](),clientSideLogs);module[_0x2886('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 e92049c..1e58dc7 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 _0x6fb1=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','AmazonAWS','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x5a4150,_0x46c398){var _0x32c7e5=function(_0x48d4eb){while(--_0x48d4eb){_0x5a4150['push'](_0x5a4150['shift']());}};_0x32c7e5(++_0x46c398);}(_0x6fb1,0x9f));var _0x16fb=function(_0x44b364,_0x48a8ee){_0x44b364=_0x44b364-0x0;var _0xd48565=_0x6fb1[_0x44b364];return _0xd48565;};'use strict';var Sequelize=require(_0x16fb('0x0'));module[_0x16fb('0x1')]={'name':{'type':Sequelize[_0x16fb('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x16fb('0x3')](_0x16fb('0x4'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x16fb('0x3')](_0x16fb('0x5'),_0x16fb('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x16fb('0x7')},'data2':{'type':Sequelize[_0x16fb('0x2')],'comment':_0x16fb('0x8')},'data3':{'type':Sequelize[_0x16fb('0x2')],'comment':_0x16fb('0x9')},'data4':{'type':Sequelize[_0x16fb('0x2')],'comment':_0x16fb('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x16fb('0xb')],'comment':_0x16fb('0xc')},'data7':{'type':Sequelize[_0x16fb('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x6d56=['MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','Google'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x6d56,0xeb));var _0x66d5=function(_0x5430c7,_0x539556){_0x5430c7=_0x5430c7-0x0;var _0x3e23f9=_0x6d56[_0x5430c7];return _0x3e23f9;};'use strict';var Sequelize=require(_0x66d5('0x0'));module[_0x66d5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x66d5('0x2')](_0x66d5('0x3'),_0x66d5('0x4'),_0x66d5('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x66d5('0x2')](_0x66d5('0x6'),_0x66d5('0x7'))},'data1':{'type':Sequelize[_0x66d5('0x8')],'comment':_0x66d5('0x9')},'data2':{'type':Sequelize[_0x66d5('0x8')],'comment':_0x66d5('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0x66d5('0xb')},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x66d5('0xc')],'comment':_0x66d5('0xd')},'data6':{'type':Sequelize['TEXT'],'comment':_0x66d5('0xe')},'data7':{'type':Sequelize[_0x66d5('0xc')],'comment':_0x66d5('0xf')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index e042e2a..1f1aeab 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 _0x31a2=['../../components/encryptor','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','update','then','destroy','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','intersection','find','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','get','Invalid\x20state\x20parameter','from','ascii','parse','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','state','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs'];(function(_0x30bc97,_0x2db33a){var _0x146094=function(_0x19fcd0){while(--_0x19fcd0){_0x30bc97['push'](_0x30bc97['shift']());}};_0x146094(++_0x2db33a);}(_0x31a2,0x17d));var _0x231a=function(_0x47153d,_0x3f748d){_0x47153d=_0x47153d-0x0;var _0x18c36f=_0x31a2[_0x47153d];return _0x18c36f;};'use strict';var _=require(_0x231a('0x0'));var Redis=require(_0x231a('0x1'));var qs=require(_0x231a('0x2'));var encryptor=require(_0x231a('0x3'));var config=require('../../config/environment');var logger=require(_0x231a('0x4'))(_0x231a('0x5'));var db=require(_0x231a('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x231a('0x7')]=_['defaults'](config[_0x231a('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x231a('0x8'))(new Redis(config[_0x231a('0x7')]));var redis=new Redis(config[_0x231a('0x7')]);function respondWithStatusCode(_0x4cde25,_0x4873df){_0x4873df=_0x4873df||0xcc;return function(_0x111cff){if(_0x111cff){return _0x4cde25[_0x231a('0x9')](_0x4873df);}return _0x4cde25['status'](_0x4873df)[_0x231a('0xa')]();};}function respondWithResult(_0x1dea11,_0x5a74c0){_0x5a74c0=_0x5a74c0||0xc8;return function(_0x5094eb){if(_0x5094eb){return _0x1dea11['status'](_0x5a74c0)[_0x231a('0xb')](_0x5094eb);}};}function respondWithFilteredResult(_0x439bae,_0x205215){return function(_0x2e3d65){if(_0x2e3d65){var _0x31d902=typeof _0x205215[_0x231a('0xc')]===_0x231a('0xd')&&typeof _0x205215[_0x231a('0xe')]===_0x231a('0xd');var _0x4e1341=_0x2e3d65['count'];var _0x52c13e=_0x31d902?0x0:_0x205215[_0x231a('0xc')];var _0x23f872=_0x31d902?_0x2e3d65['count']:_0x205215[_0x231a('0xc')]+_0x205215[_0x231a('0xe')];var _0x5d227a;if(_0x23f872>=_0x4e1341){_0x23f872=_0x4e1341;_0x5d227a=0xc8;}else{_0x5d227a=0xce;}_0x439bae[_0x231a('0xf')](_0x5d227a);return _0x439bae[_0x231a('0x10')](_0x231a('0x11'),_0x52c13e+'-'+_0x23f872+'/'+_0x4e1341)[_0x231a('0xb')](_0x2e3d65);}return null;};}function saveUpdates(_0xa374c1){return function(_0x1839e5){if(_0x1839e5){return _0x1839e5[_0x231a('0x12')](_0xa374c1)[_0x231a('0x13')](function(_0x134074){return _0x134074;});}return null;};}function removeEntity(_0x1bdf51){return function(_0x285d15){if(_0x285d15){return _0x285d15[_0x231a('0x14')]()['then'](function(){_0x1bdf51['status'](0xcc)[_0x231a('0xa')]();});}};}function handleEntityNotFound(_0x1db363){return function(_0x342472){if(!_0x342472){_0x1db363[_0x231a('0x9')](0x194);}return _0x342472;};}function handleError(_0x22736f,_0x35c6a1){_0x35c6a1=_0x35c6a1||0x1f4;return function(_0x313751){logger['error'](_0x313751[_0x231a('0x15')]);if(_0x313751[_0x231a('0x16')]){delete _0x313751[_0x231a('0x16')];}_0x22736f[_0x231a('0xf')](_0x35c6a1)[_0x231a('0x17')](_0x313751);};}function maskClientSecret(_0x1124c4){return _[_0x231a('0x18')](_0x1124c4[_0x231a('0x19')](0x0,0x3),0x14,'*');}exports[_0x231a('0x1a')]=function(_0x445558,_0x403a5c){var _0x28e5d0={},_0x2ed729={},_0x5863a2={'count':0x0,'rows':[]};var _0x5b4f36=_[_0x231a('0x1b')](db[_0x231a('0x1c')][_0x231a('0x1d')],function(_0x10a7f9){return{'name':_0x10a7f9[_0x231a('0x1e')],'type':_0x10a7f9[_0x231a('0x1f')][_0x231a('0x20')]};});_0x2ed729[_0x231a('0x21')]=_[_0x231a('0x1b')](_0x5b4f36,'name');_0x2ed729[_0x231a('0x22')]=_['keys'](_0x445558[_0x231a('0x22')]);_0x2ed729[_0x231a('0x23')]=_['intersection'](_0x2ed729[_0x231a('0x21')],_0x2ed729[_0x231a('0x22')]);_0x28e5d0[_0x231a('0x24')]=_['intersection'](_0x2ed729[_0x231a('0x21')],qs[_0x231a('0x25')](_0x445558[_0x231a('0x22')][_0x231a('0x25')]));_0x28e5d0[_0x231a('0x24')]=_0x28e5d0[_0x231a('0x24')][_0x231a('0x26')]?_0x28e5d0[_0x231a('0x24')]:_0x2ed729[_0x231a('0x21')];if(!_0x445558[_0x231a('0x22')][_0x231a('0x27')](_0x231a('0x28'))){_0x28e5d0[_0x231a('0xe')]=qs[_0x231a('0xe')](_0x445558[_0x231a('0x22')][_0x231a('0xe')]);_0x28e5d0[_0x231a('0xc')]=qs[_0x231a('0xc')](_0x445558[_0x231a('0x22')][_0x231a('0xc')]);}_0x28e5d0[_0x231a('0x29')]=qs[_0x231a('0x2a')](_0x445558['query'][_0x231a('0x2a')]);_0x28e5d0[_0x231a('0x2b')]=qs['filters'](_[_0x231a('0x2c')](_0x445558['query'],_0x2ed729[_0x231a('0x23')]),_0x5b4f36);if(_0x445558['query'][_0x231a('0x2d')]){_0x28e5d0['where']=_[_0x231a('0x2e')](_0x28e5d0[_0x231a('0x2b')],{'$or':_[_0x231a('0x1b')](_0x5b4f36,function(_0x265aac){if(_0x265aac[_0x231a('0x1f')]!==_0x231a('0x2f')){var _0x1fa138={};_0x1fa138[_0x265aac['name']]={'$like':'%'+_0x445558[_0x231a('0x22')]['filter']+'%'};return _0x1fa138;}})});}_0x28e5d0=_[_0x231a('0x2e')]({},_0x28e5d0,_0x445558[_0x231a('0x30')]);var _0x13b1a1={'where':_0x28e5d0['where']};return db[_0x231a('0x1c')][_0x231a('0x31')](_0x13b1a1)[_0x231a('0x13')](function(_0x37e8ac){_0x5863a2[_0x231a('0x31')]=_0x37e8ac;if(_0x445558[_0x231a('0x22')][_0x231a('0x32')]){_0x28e5d0[_0x231a('0x33')]=[{'all':!![]}];}return db['CloudProvider'][_0x231a('0x34')](_0x28e5d0);})['then'](function(_0x501b9b){_0x5863a2[_0x231a('0x35')]=_[_0x231a('0x1b')](_0x501b9b,function(_0x1ae2cd){if(_0x1ae2cd[_0x231a('0x36')]===_0x231a('0x37')){var _0x51f69e=encryptor[_0x231a('0x38')](_0x1ae2cd['data3']);_0x1ae2cd[_0x231a('0x39')]=maskClientSecret(_0x51f69e);}return _0x1ae2cd;});return _0x5863a2;})[_0x231a('0x13')](respondWithFilteredResult(_0x403a5c,_0x28e5d0))[_0x231a('0x3a')](handleError(_0x403a5c,null));};exports[_0x231a('0x3b')]=function(_0x265d83,_0x2e861e){var _0x4bbea0={'raw':!![],'where':{'id':_0x265d83[_0x231a('0x3c')]['id']}},_0x4ea0e7={};_0x4ea0e7[_0x231a('0x21')]=_[_0x231a('0x3d')](db[_0x231a('0x1c')][_0x231a('0x1d')]);_0x4ea0e7['query']=_[_0x231a('0x3d')](_0x265d83[_0x231a('0x22')]);_0x4ea0e7['filters']=_[_0x231a('0x3e')](_0x4ea0e7[_0x231a('0x21')],_0x4ea0e7[_0x231a('0x22')]);_0x4bbea0[_0x231a('0x24')]=_[_0x231a('0x3e')](_0x4ea0e7[_0x231a('0x21')],qs['fields'](_0x265d83[_0x231a('0x22')][_0x231a('0x25')]));_0x4bbea0['attributes']=_0x4bbea0[_0x231a('0x24')]['length']?_0x4bbea0[_0x231a('0x24')]:_0x4ea0e7[_0x231a('0x21')];if(_0x265d83[_0x231a('0x22')][_0x231a('0x32')]){_0x4bbea0[_0x231a('0x33')]=[{'all':!![]}];}_0x4bbea0=_[_0x231a('0x2e')]({},_0x4bbea0,_0x265d83['options']);return db[_0x231a('0x1c')][_0x231a('0x3f')](_0x4bbea0)[_0x231a('0x13')](handleEntityNotFound(_0x2e861e,null))[_0x231a('0x13')](function(_0x233da7){if(_0x233da7[_0x231a('0x36')]==='MicrosoftAzure'){var _0x54635a=encryptor[_0x231a('0x38')](_0x233da7[_0x231a('0x39')]);_0x233da7[_0x231a('0x39')]=maskClientSecret(_0x54635a);}return _0x233da7;})[_0x231a('0x13')](respondWithResult(_0x2e861e,null))[_0x231a('0x3a')](handleError(_0x2e861e,null));};exports[_0x231a('0x40')]=function(_0x5648f8,_0x1fd951){if(!_0x5648f8[_0x231a('0x41')]['name'])throw new Error(_0x231a('0x42'));if(!_0x5648f8[_0x231a('0x41')][_0x231a('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x402e2c=db[_0x231a('0x1c')][_0x231a('0x1d')]['service'][_0x231a('0x43')];if(!_0x402e2c[_0x231a('0x44')](_0x5648f8['body'][_0x231a('0x36')]))throw new Error(_0x231a('0x45')+_0x402e2c['join'](',\x20'));if(_0x5648f8[_0x231a('0x41')]['service']===_0x231a('0x37')&&_0x5648f8[_0x231a('0x41')][_0x231a('0x39')]){_0x5648f8[_0x231a('0x41')]['data3']=encryptor['encryptString'](_0x5648f8[_0x231a('0x41')][_0x231a('0x39')]);}return db[_0x231a('0x1c')]['create'](_0x5648f8[_0x231a('0x41')],{})[_0x231a('0x13')](respondWithResult(_0x1fd951,0xc9))[_0x231a('0x3a')](handleError(_0x1fd951,null));};exports['update']=function(_0xd30896,_0xf535a3){if(_0xd30896[_0x231a('0x41')]['id']){delete _0xd30896['body']['id'];}return db['CloudProvider'][_0x231a('0x3f')]({'where':{'id':_0xd30896[_0x231a('0x3c')]['id']}})[_0x231a('0x13')](handleEntityNotFound(_0xf535a3,null))[_0x231a('0x13')](function(_0x22638e){if(_0x22638e[_0x231a('0x36')]===_0x231a('0x37')&&_0xd30896[_0x231a('0x41')]['data3']){_0xd30896[_0x231a('0x41')][_0x231a('0x39')]=encryptor['encryptString'](_0xd30896[_0x231a('0x41')]['data3']);}return _0x22638e;})[_0x231a('0x13')](saveUpdates(_0xd30896[_0x231a('0x41')],null))['then'](respondWithResult(_0xf535a3,null))[_0x231a('0x3a')](handleError(_0xf535a3,null));};exports[_0x231a('0x14')]=function(_0x514cb7,_0x17c105){return db[_0x231a('0x1c')][_0x231a('0x3f')]({'where':{'id':_0x514cb7['params']['id']}})['then'](handleEntityNotFound(_0x17c105,null))[_0x231a('0x13')](removeEntity(_0x17c105,null))['catch'](handleError(_0x17c105,null));};exports['oauth2MicrosoftAuthorize']=function(_0x5b0ef4,_0x32ce2a){return db[_0x231a('0x1c')]['findOne']({'where':{'id':_0x5b0ef4['params']['id']},'raw':!![]})['then'](function(_0x65c153){if(!_0x65c153)return _0x32ce2a['sendStatus'](0x194);return{'url':oauth[_0x231a('0x46')](_0x65c153,_0x5b0ef4['user']['id'])};})[_0x231a('0x13')](respondWithResult(_0x32ce2a,null))['catch'](handleError(_0x32ce2a,null));};exports[_0x231a('0x47')]=function(_0x24b43b,_0x2ddae8){var _0x448fda=_0x24b43b[_0x231a('0x41')];var _0x4143ab;var _0x5ba96f;if(_0x448fda[_0x231a('0x48')])throw _0x448fda;redis[_0x231a('0x49')](_0x448fda['state'])[_0x231a('0x13')](function(_0x4439e8){if(!_0x4439e8)throw new Error(_0x231a('0x4a'));_0x4143ab=JSON['parse'](_0x4439e8);var _0x282dc9=Buffer[_0x231a('0x4b')](_0x448fda['state'],'base64')['toString'](_0x231a('0x4c'));_0x5ba96f=JSON[_0x231a('0x4d')](_0x282dc9);if(!oauth['isValidIdToken'](_0x448fda[_0x231a('0x4e')],_0x4143ab[_0x231a('0x4f')]))throw new Error(_0x231a('0x50'));redis[_0x231a('0x51')](_0x448fda[_0x231a('0x52')]);return oauth['getOauth2MicrosoftAccessToken'](_0x448fda[_0x231a('0x53')],_0x4143ab);})['then'](function(_0x276196){_0x4143ab[_0x231a('0x54')]=_0x276196[_0x231a('0x55')];_0x4143ab[_0x231a('0x56')]=_0x276196[_0x231a('0x57')];return db[_0x231a('0x1c')][_0x231a('0x12')]({'data5':_0x4143ab[_0x231a('0x54')],'data6':_0x4143ab[_0x231a('0x56')]},{'where':{'id':_0x4143ab['id']}});})[_0x231a('0x13')](function(){oauth[_0x231a('0x58')](_0x4143ab);socket[_0x231a('0x59')](_0x231a('0x5a'),{'id':_0x5ba96f['id']});return;})[_0x231a('0x13')](respondWithStatusCode(_0x2ddae8,null))['catch'](function(_0x5abcbc){if(_0x5ba96f){socket[_0x231a('0x59')](_0x231a('0x5b'),{'id':_0x5ba96f['id']});}if(!_0x4143ab){logger['error'](_0x231a('0x5c'),_0x5abcbc);return _0x2ddae8[_0x231a('0xf')](0x1f4)['send'](_0x5abcbc[_0x231a('0x5d')]);}logger[_0x231a('0x48')](_0x231a('0x5e'),_0x4143ab['id'],JSON[_0x231a('0x5f')](_0x5abcbc));});}; \ No newline at end of file +var _0x2356=['type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','find','create','body','Name\x20parameter\x20not\x20specified','service','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','findOne','generateMicrosoftAuthorizationUrl','user','state','Invalid\x20state\x20parameter','parse','from','base64','toString','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','data6','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','offset','undefined','count','limit','Content-Range','json','update','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2356,0x1b1));var _0x6235=function(_0x34df53,_0x583165){_0x34df53=_0x34df53-0x0;var _0x540088=_0x2356[_0x34df53];return _0x540088;};'use strict';var _=require('lodash');var Redis=require(_0x6235('0x0'));var qs=require(_0x6235('0x1'));var encryptor=require(_0x6235('0x2'));var config=require(_0x6235('0x3'));var logger=require(_0x6235('0x4'))(_0x6235('0x5'));var db=require(_0x6235('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x6235('0x7')]=_[_0x6235('0x8')](config[_0x6235('0x7')],{'host':_0x6235('0x9'),'port':0x18eb});var socket=require(_0x6235('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0x6235('0x7')]);function respondWithStatusCode(_0x2d6543,_0x462664){_0x462664=_0x462664||0xcc;return function(_0x46aad4){if(_0x46aad4){return _0x2d6543['sendStatus'](_0x462664);}return _0x2d6543[_0x6235('0xb')](_0x462664)[_0x6235('0xc')]();};}function respondWithResult(_0x24587f,_0x4360be){_0x4360be=_0x4360be||0xc8;return function(_0x172b90){if(_0x172b90){return _0x24587f[_0x6235('0xb')](_0x4360be)['json'](_0x172b90);}};}function respondWithFilteredResult(_0x23a00e,_0xb23293){return function(_0x5b920c){if(_0x5b920c){var _0x102d7e=typeof _0xb23293[_0x6235('0xd')]===_0x6235('0xe')&&typeof _0xb23293['limit']==='undefined';var _0x31b3e2=_0x5b920c['count'];var _0x289d4c=_0x102d7e?0x0:_0xb23293['offset'];var _0x4764bb=_0x102d7e?_0x5b920c[_0x6235('0xf')]:_0xb23293['offset']+_0xb23293[_0x6235('0x10')];var _0x4ce6e0;if(_0x4764bb>=_0x31b3e2){_0x4764bb=_0x31b3e2;_0x4ce6e0=0xc8;}else{_0x4ce6e0=0xce;}_0x23a00e['status'](_0x4ce6e0);return _0x23a00e['set'](_0x6235('0x11'),_0x289d4c+'-'+_0x4764bb+'/'+_0x31b3e2)[_0x6235('0x12')](_0x5b920c);}return null;};}function saveUpdates(_0x482725){return function(_0x1f90d5){if(_0x1f90d5){return _0x1f90d5[_0x6235('0x13')](_0x482725)['then'](function(_0x34201b){return _0x34201b;});}return null;};}function removeEntity(_0x2f12b0){return function(_0x2a74df){if(_0x2a74df){return _0x2a74df['destroy']()['then'](function(){_0x2f12b0[_0x6235('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4373eb){return function(_0x142a14){if(!_0x142a14){_0x4373eb[_0x6235('0x14')](0x194);}return _0x142a14;};}function handleError(_0x87cc27,_0x503bd3){_0x503bd3=_0x503bd3||0x1f4;return function(_0x78c90c){logger[_0x6235('0x15')](_0x78c90c[_0x6235('0x16')]);if(_0x78c90c[_0x6235('0x17')]){delete _0x78c90c[_0x6235('0x17')];}_0x87cc27[_0x6235('0xb')](_0x503bd3)[_0x6235('0x18')](_0x78c90c);};}function maskClientSecret(_0x4a5bb1){return _[_0x6235('0x19')](_0x4a5bb1[_0x6235('0x1a')](0x0,0x3),0x14,'*');}exports[_0x6235('0x1b')]=function(_0x19b95a,_0x29fb6d){var _0x1e247b={},_0x1d67d9={},_0x1419c9={'count':0x0,'rows':[]};var _0x1e4900=_[_0x6235('0x1c')](db[_0x6235('0x1d')][_0x6235('0x1e')],function(_0x5d8fd5){return{'name':_0x5d8fd5[_0x6235('0x1f')],'type':_0x5d8fd5[_0x6235('0x20')][_0x6235('0x21')]};});_0x1d67d9[_0x6235('0x22')]=_[_0x6235('0x1c')](_0x1e4900,_0x6235('0x17'));_0x1d67d9['query']=_[_0x6235('0x23')](_0x19b95a['query']);_0x1d67d9[_0x6235('0x24')]=_[_0x6235('0x25')](_0x1d67d9[_0x6235('0x22')],_0x1d67d9[_0x6235('0x26')]);_0x1e247b[_0x6235('0x27')]=_[_0x6235('0x25')](_0x1d67d9[_0x6235('0x22')],qs[_0x6235('0x28')](_0x19b95a[_0x6235('0x26')][_0x6235('0x28')]));_0x1e247b[_0x6235('0x27')]=_0x1e247b['attributes'][_0x6235('0x29')]?_0x1e247b[_0x6235('0x27')]:_0x1d67d9[_0x6235('0x22')];if(!_0x19b95a[_0x6235('0x26')][_0x6235('0x2a')](_0x6235('0x2b'))){_0x1e247b[_0x6235('0x10')]=qs[_0x6235('0x10')](_0x19b95a[_0x6235('0x26')]['limit']);_0x1e247b[_0x6235('0xd')]=qs[_0x6235('0xd')](_0x19b95a['query'][_0x6235('0xd')]);}_0x1e247b[_0x6235('0x2c')]=qs[_0x6235('0x2d')](_0x19b95a['query'][_0x6235('0x2d')]);_0x1e247b[_0x6235('0x2e')]=qs[_0x6235('0x24')](_[_0x6235('0x2f')](_0x19b95a[_0x6235('0x26')],_0x1d67d9[_0x6235('0x24')]),_0x1e4900);if(_0x19b95a['query'][_0x6235('0x30')]){_0x1e247b[_0x6235('0x2e')]=_[_0x6235('0x31')](_0x1e247b['where'],{'$or':_[_0x6235('0x1c')](_0x1e4900,function(_0x2aed2a){if(_0x2aed2a[_0x6235('0x20')]!=='VIRTUAL'){var _0x2fb906={};_0x2fb906[_0x2aed2a['name']]={'$like':'%'+_0x19b95a[_0x6235('0x26')][_0x6235('0x30')]+'%'};return _0x2fb906;}})});}_0x1e247b=_[_0x6235('0x31')]({},_0x1e247b,_0x19b95a[_0x6235('0x32')]);var _0x37faab={'where':_0x1e247b[_0x6235('0x2e')]};return db[_0x6235('0x1d')][_0x6235('0xf')](_0x37faab)[_0x6235('0x33')](function(_0x2ab66d){_0x1419c9[_0x6235('0xf')]=_0x2ab66d;if(_0x19b95a['query'][_0x6235('0x34')]){_0x1e247b[_0x6235('0x35')]=[{'all':!![]}];}return db[_0x6235('0x1d')][_0x6235('0x36')](_0x1e247b);})[_0x6235('0x33')](function(_0x2b64ca){_0x1419c9[_0x6235('0x37')]=_[_0x6235('0x1c')](_0x2b64ca,function(_0x264bc4){if(_0x264bc4['service']===_0x6235('0x38')){var _0x2b4a18=encryptor[_0x6235('0x39')](_0x264bc4[_0x6235('0x3a')]);_0x264bc4[_0x6235('0x3a')]=maskClientSecret(_0x2b4a18);}return _0x264bc4;});return _0x1419c9;})[_0x6235('0x33')](respondWithFilteredResult(_0x29fb6d,_0x1e247b))[_0x6235('0x3b')](handleError(_0x29fb6d,null));};exports[_0x6235('0x3c')]=function(_0x37c7ea,_0x58559b){var _0x86523={'raw':!![],'where':{'id':_0x37c7ea[_0x6235('0x3d')]['id']}},_0x419db0={};_0x419db0[_0x6235('0x22')]=_['keys'](db[_0x6235('0x1d')]['rawAttributes']);_0x419db0['query']=_['keys'](_0x37c7ea[_0x6235('0x26')]);_0x419db0[_0x6235('0x24')]=_[_0x6235('0x25')](_0x419db0[_0x6235('0x22')],_0x419db0[_0x6235('0x26')]);_0x86523[_0x6235('0x27')]=_[_0x6235('0x25')](_0x419db0['model'],qs[_0x6235('0x28')](_0x37c7ea[_0x6235('0x26')]['fields']));_0x86523[_0x6235('0x27')]=_0x86523[_0x6235('0x27')][_0x6235('0x29')]?_0x86523[_0x6235('0x27')]:_0x419db0[_0x6235('0x22')];if(_0x37c7ea[_0x6235('0x26')]['includeAll']){_0x86523[_0x6235('0x35')]=[{'all':!![]}];}_0x86523=_[_0x6235('0x31')]({},_0x86523,_0x37c7ea['options']);return db[_0x6235('0x1d')][_0x6235('0x3e')](_0x86523)[_0x6235('0x33')](handleEntityNotFound(_0x58559b,null))[_0x6235('0x33')](function(_0x1dffe6){if(_0x1dffe6['service']===_0x6235('0x38')){var _0x5b01b2=encryptor[_0x6235('0x39')](_0x1dffe6['data3']);_0x1dffe6[_0x6235('0x3a')]=maskClientSecret(_0x5b01b2);}return _0x1dffe6;})[_0x6235('0x33')](respondWithResult(_0x58559b,null))['catch'](handleError(_0x58559b,null));};exports[_0x6235('0x3f')]=function(_0x29dd9f,_0x58847f){if(!_0x29dd9f[_0x6235('0x40')][_0x6235('0x17')])throw new Error(_0x6235('0x41'));if(!_0x29dd9f[_0x6235('0x40')][_0x6235('0x42')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x118e62=db['CloudProvider']['rawAttributes'][_0x6235('0x42')]['values'];if(!_0x118e62[_0x6235('0x43')](_0x29dd9f[_0x6235('0x40')][_0x6235('0x42')]))throw new Error(_0x6235('0x44')+_0x118e62['join'](',\x20'));if(_0x29dd9f[_0x6235('0x40')][_0x6235('0x42')]===_0x6235('0x38')&&_0x29dd9f['body'][_0x6235('0x3a')]){_0x29dd9f[_0x6235('0x40')][_0x6235('0x3a')]=encryptor[_0x6235('0x45')](_0x29dd9f[_0x6235('0x40')][_0x6235('0x3a')]);}return db['CloudProvider'][_0x6235('0x3f')](_0x29dd9f[_0x6235('0x40')],{})[_0x6235('0x33')](respondWithResult(_0x58847f,0xc9))[_0x6235('0x3b')](handleError(_0x58847f,null));};exports[_0x6235('0x13')]=function(_0x4d86d2,_0x2da64b){if(_0x4d86d2[_0x6235('0x40')]['id']){delete _0x4d86d2[_0x6235('0x40')]['id'];}return db[_0x6235('0x1d')]['find']({'where':{'id':_0x4d86d2[_0x6235('0x3d')]['id']}})[_0x6235('0x33')](handleEntityNotFound(_0x2da64b,null))['then'](function(_0x3eedaa){if(_0x3eedaa[_0x6235('0x42')]===_0x6235('0x38')&&_0x4d86d2['body'][_0x6235('0x3a')]){_0x4d86d2[_0x6235('0x40')]['data3']=encryptor['encryptString'](_0x4d86d2[_0x6235('0x40')][_0x6235('0x3a')]);}return _0x3eedaa;})[_0x6235('0x33')](saveUpdates(_0x4d86d2[_0x6235('0x40')],null))[_0x6235('0x33')](respondWithResult(_0x2da64b,null))[_0x6235('0x3b')](handleError(_0x2da64b,null));};exports['destroy']=function(_0xaa1a47,_0x27a222){return db['CloudProvider'][_0x6235('0x3e')]({'where':{'id':_0xaa1a47[_0x6235('0x3d')]['id']}})[_0x6235('0x33')](handleEntityNotFound(_0x27a222,null))[_0x6235('0x33')](removeEntity(_0x27a222,null))['catch'](handleError(_0x27a222,null));};exports['oauth2MicrosoftAuthorize']=function(_0x70375f,_0x3312c2){return db['CloudProvider'][_0x6235('0x46')]({'where':{'id':_0x70375f[_0x6235('0x3d')]['id']},'raw':!![]})[_0x6235('0x33')](function(_0x4cd452){if(!_0x4cd452)return _0x3312c2[_0x6235('0x14')](0x194);return{'url':oauth[_0x6235('0x47')](_0x4cd452,_0x70375f[_0x6235('0x48')]['id'])};})[_0x6235('0x33')](respondWithResult(_0x3312c2,null))[_0x6235('0x3b')](handleError(_0x3312c2,null));};exports['oauth2MicrosoftCallback']=function(_0x4f9757,_0x384bf2){var _0x1b4e4e=_0x4f9757['body'];var _0x36eaf2;var _0x5d270f;if(_0x1b4e4e[_0x6235('0x15')])throw _0x1b4e4e;redis['get'](_0x1b4e4e[_0x6235('0x49')])[_0x6235('0x33')](function(_0x1dd77b){if(!_0x1dd77b)throw new Error(_0x6235('0x4a'));_0x36eaf2=JSON[_0x6235('0x4b')](_0x1dd77b);var _0x4e3571=Buffer[_0x6235('0x4c')](_0x1b4e4e[_0x6235('0x49')],_0x6235('0x4d'))[_0x6235('0x4e')]('ascii');_0x5d270f=JSON[_0x6235('0x4b')](_0x4e3571);if(!oauth[_0x6235('0x4f')](_0x1b4e4e[_0x6235('0x50')],_0x36eaf2[_0x6235('0x51')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x6235('0x52')](_0x1b4e4e['state']);return oauth[_0x6235('0x53')](_0x1b4e4e[_0x6235('0x54')],_0x36eaf2);})['then'](function(_0x342039){_0x36eaf2[_0x6235('0x55')]=_0x342039['access_token'];_0x36eaf2[_0x6235('0x56')]=_0x342039['refresh_token'];return db[_0x6235('0x1d')][_0x6235('0x13')]({'data5':_0x36eaf2[_0x6235('0x55')],'data6':_0x36eaf2[_0x6235('0x56')]},{'where':{'id':_0x36eaf2['id']}});})[_0x6235('0x33')](function(){oauth[_0x6235('0x57')](_0x36eaf2);socket[_0x6235('0x58')](_0x6235('0x59'),{'id':_0x5d270f['id']});return;})['then'](respondWithStatusCode(_0x384bf2,null))['catch'](function(_0x3da8cc){if(_0x5d270f){socket[_0x6235('0x58')]('microsoftAuthorization:error',{'id':_0x5d270f['id']});}if(!_0x36eaf2){logger['error'](_0x6235('0x5a'),_0x3da8cc);return _0x384bf2[_0x6235('0xb')](0x1f4)[_0x6235('0x18')](_0x3da8cc['message']);}logger[_0x6235('0x15')](_0x6235('0x5b'),_0x36eaf2['id'],JSON[_0x6235('0x5c')](_0x3da8cc));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 09fb169..fa3a5f9 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 _0x475e=['define','CloudProvider','cloud_providers','util','moment','path','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x5bc76d,_0x3e2d1a){var _0x5dccab=function(_0x235fb3){while(--_0x235fb3){_0x5bc76d['push'](_0x5bc76d['shift']());}};_0x5dccab(++_0x3e2d1a);}(_0x475e,0x93));var _0xe475=function(_0x5748ae,_0x333131){_0x5748ae=_0x5748ae-0x0;var _0x17f13d=_0x475e[_0x5748ae];return _0x17f13d;};'use strict';var _=require('lodash');var util=require(_0xe475('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe475('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe475('0x2'));var rimraf=require('rimraf');var config=require(_0xe475('0x3'));var attributes=require(_0xe475('0x4'));module[_0xe475('0x5')]=function(_0x1b4181,_0x254705){return _0x1b4181[_0xe475('0x6')](_0xe475('0x7'),attributes,{'tableName':_0xe475('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf84c=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf84c,0x1b8));var _0xcf84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf84c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xcf84('0x0'));var logger=require(_0xcf84('0x1'))(_0xcf84('0x2'));var moment=require('moment');var BPromise=require(_0xcf84('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf84('0x4'));var rimraf=require(_0xcf84('0x5'));var config=require(_0xcf84('0x6'));var attributes=require(_0xcf84('0x7'));module['exports']=function(_0x158d88,_0x343eb8){return _0x158d88[_0xcf84('0x8')](_0xcf84('0x9'),attributes,{'tableName':_0xcf84('0xa'),'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 e699b11..9232373 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 _0x14d6=['data1','response_type','redirect_uri','data4','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','POST','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','../../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','/authorize','/token','map','type','Dynamics365','push','join','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id'];(function(_0x1ee58e,_0x36681f){var _0x49acff=function(_0x345c55){while(--_0x345c55){_0x1ee58e['push'](_0x1ee58e['shift']());}};_0x49acff(++_0x36681f);}(_0x14d6,0xc9));var _0x614d=function(_0x457ef8,_0x1a19ae){_0x457ef8=_0x457ef8-0x0;var _0x596c56=_0x14d6[_0x457ef8];return _0x596c56;};'use strict';var _=require(_0x614d('0x0'));var crypto=require(_0x614d('0x1'));var jwt=require(_0x614d('0x2'));var moment=require(_0x614d('0x3'));var Redis=require(_0x614d('0x4'));var rp=require(_0x614d('0x5'));var util=require(_0x614d('0x6'));var encryptor=require(_0x614d('0x7'));var config=require('../../config/environment');var logger=require(_0x614d('0x8'))('api');var schedule=require(_0x614d('0x9'));var db=require(_0x614d('0xa'))['db'];config[_0x614d('0xb')]=_['defaults'](config['redis'],{'host':_0x614d('0xc'),'port':0x18eb});var redis=new Redis(config[_0x614d('0xb')]);var MICROSOFT_AUTH_URL=_0x614d('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x614d('0xe'),_0x614d('0xf'),_0x614d('0x10'),_0x614d('0x11'),_0x614d('0x12'),'https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x614d('0xe'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x614d('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x614d('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x32297f){var _0x4e5637=_[_0x614d('0x15')](AZURE_AUTH_SCOPES[_0x32297f[_0x614d('0x16')]]);if(_0x32297f['type']===_0x614d('0x17'))_0x4e5637[_0x614d('0x18')](_0x32297f['data7']+'/.default');return _0x4e5637[_0x614d('0x19')]('\x20');}function getAccessTokenScope(_0x5076f5){if(_0x5076f5[_0x614d('0x16')]==='Outlook365')return _0x614d('0x12');if(_0x5076f5[_0x614d('0x16')]===_0x614d('0x17'))return _0x5076f5[_0x614d('0x1a')]+_0x614d('0x1b');}function generateMicrosoftAuthorizationUrl(_0x1d591a,_0x195f05){var _0x2ed182=MICROSOFT_AUTH_URL[_0x614d('0x1c')](_0x614d('0x1d'),_0x1d591a[_0x614d('0x1e')]);var _0x38deb6=[_0x614d('0x1f'),_0x614d('0x20')];var _0x1f1995=Buffer[_0x614d('0x21')](JSON[_0x614d('0x22')]({'id':_0x195f05}))[_0x614d('0x23')]('base64');var _0x599e95=crypto[_0x614d('0x24')](0x10)['toString'](_0x614d('0x25'));var _0x36c84d=getAuthorizationScopes(_0x1d591a);var _0x2bd7be=[{'key':_0x614d('0x26'),'value':_0x1d591a[_0x614d('0x27')]},{'key':_0x614d('0x28'),'value':encodeURIComponent(_0x38deb6['join']('\x20'))},{'key':_0x614d('0x29'),'value':_0x1d591a[_0x614d('0x2a')]},{'key':'response_mode','value':_0x614d('0x2b')},{'key':_0x614d('0x2c'),'value':encodeURIComponent(_0x36c84d)},{'key':_0x614d('0x2d'),'value':_0x1f1995},{'key':_0x614d('0x2e'),'value':_0x599e95},{'key':_0x614d('0x2f'),'value':'login'}];var _0x2bf40e=_0x2ed182+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x614d('0x15')](_0x2bd7be,function(_0x4ee0a1){return _0x4ee0a1[_0x614d('0x30')]+'='+_0x4ee0a1[_0x614d('0x31')];})[_0x614d('0x19')]('&');_0x1d591a[_0x614d('0x32')]={'issuer':_0x2ed182[_0x614d('0x1c')](_0x614d('0x33'),''),'audience':_0x1d591a[_0x614d('0x27')],'state':_0x1f1995,'nonce':_0x599e95};redis[_0x614d('0x34')](_0x1f1995,JSON[_0x614d('0x22')](_0x1d591a));return _0x2bf40e;}function isValidIdToken(_0x1be8d7,_0x238a7f){try{var _0x5965f0=jwt[_0x614d('0x35')](_0x1be8d7,{'complete':!![]});var _0x440272=_0x5965f0[_0x614d('0x36')];if(_0x440272[_0x614d('0x37')]!==_0x238a7f[_0x614d('0x38')])return![];if(_0x440272[_0x614d('0x39')]!==_0x238a7f[_0x614d('0x3a')])return![];if(_0x440272[_0x614d('0x2e')]!==_0x238a7f[_0x614d('0x2e')])return![];if(moment()['isAfter'](moment[_0x614d('0x3b')](_0x440272[_0x614d('0x3c')])))return![];return!![];}catch(_0x1d179f){throw _0x1d179f;}}function refreshOauth2MicrosoftAccessToken(_0x54386a){return Promise[_0x614d('0x3d')]()[_0x614d('0x3e')](function(){if(_0x54386a[_0x614d('0x3f')])return _0x54386a;return db[_0x614d('0x40')][_0x614d('0x41')]({'where':{'id':_0x54386a['id']},'raw':!![]});})[_0x614d('0x3e')](function(_0x4a5061){var _0x46e99b={'grant_type':_0x614d('0x42'),'refresh_token':_0x4a5061[_0x614d('0x43')],'scope':getAccessTokenScope(_0x4a5061),'redirect_uri':_0x4a5061[_0x614d('0x2a')],'client_id':_0x4a5061[_0x614d('0x27')],'client_secret':encryptor['decryptString'](_0x4a5061[_0x614d('0x3f')])};var _0x2c2af9={'method':_0x614d('0x44'),'uri':MICROSOFT_AUTH_URL['replace'](_0x614d('0x1d'),_0x4a5061[_0x614d('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x46e99b,'json':!![]};return rp(_0x2c2af9);})['then'](function(_0xc2479d){_0x54386a['data5']=_0xc2479d[_0x614d('0x45')];_0x54386a['data6']=_0xc2479d['refresh_token'];return db[_0x614d('0x40')]['update']({'data5':_0x54386a['data5'],'data6':_0x54386a[_0x614d('0x43')]},{'where':{'id':_0x54386a['id']}});})['then'](function(){return _0x54386a;})[_0x614d('0x46')](function(_0x3380f7){logger[_0x614d('0x47')](_0x614d('0x48'),_0x54386a['id'],_0x3380f7);});}function getOauth2MicrosoftAccessToken(_0x517a67,_0x5120c8){var _0x89d7e9={'grant_type':_0x614d('0x49'),'code':_0x517a67,'scope':getAccessTokenScope(_0x5120c8),'redirect_uri':_0x5120c8[_0x614d('0x2a')],'client_id':_0x5120c8[_0x614d('0x27')],'client_secret':encryptor[_0x614d('0x4a')](_0x5120c8['data3'])};var _0x2e67d8={'method':_0x614d('0x44'),'uri':MICROSOFT_AUTH_URL[_0x614d('0x1c')](_0x614d('0x1d'),_0x5120c8['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x89d7e9,'json':!![]};return rp(_0x2e67d8);}function startRefreshInterval(_0x5effd7){var _0x5581d1=schedule[_0x614d('0x4b')];if(_0x5581d1[_0x5effd7['id']])clearInterval(_0x5581d1[_0x5effd7['id']]);_0x5581d1[_0x5effd7['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5effd7['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x614d('0x4b')]=_0x5581d1;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x614d('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x614d('0x3e')](function(_0x1cb78){var _0x4d60ae=_0x1cb78[_0x614d('0x15')](function(_0x3235ff){return refreshOauth2MicrosoftAccessToken(_0x3235ff)[_0x614d('0x3e')](function(_0x18cbd1){startRefreshInterval(_0x18cbd1);});});return Promise[_0x614d('0x4d')](_0x4d60ae);})['catch'](function(_0xec42dd){var _0x1df113=_0xec42dd?util[_0x614d('0x4e')](_0xec42dd,{'showHidden':![],'depth':null}):'';logger[_0x614d('0x47')](_0x614d('0x4f'),_0x1df113);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x32f3=['/.default','data2','code','id_token','stringify','toString','base64','hex','client_id','response_type','join','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','key','replace','oauth2/','data1','set','payload','issuer','isAfter','unix','exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','decryptString','POST','{TENANT_ID}','access_token','data5','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data4','intervals','all','catch','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','Dynamics365','data7','type','Outlook365'];(function(_0xacc326,_0x56bc9f){var _0x37143f=function(_0x12526a){while(--_0x12526a){_0xacc326['push'](_0xacc326['shift']());}};_0x37143f(++_0x56bc9f);}(_0x32f3,0x10a));var _0x332f=function(_0x491cf5,_0x3a5308){_0x491cf5=_0x491cf5-0x0;var _0x17c70c=_0x32f3[_0x491cf5];return _0x17c70c;};'use strict';var _=require(_0x332f('0x0'));var crypto=require(_0x332f('0x1'));var jwt=require(_0x332f('0x2'));var moment=require('moment');var Redis=require(_0x332f('0x3'));var rp=require(_0x332f('0x4'));var util=require(_0x332f('0x5'));var encryptor=require(_0x332f('0x6'));var config=require(_0x332f('0x7'));var logger=require(_0x332f('0x8'))('api');var schedule=require(_0x332f('0x9'));var db=require(_0x332f('0xa'))['db'];config[_0x332f('0xb')]=_[_0x332f('0xc')](config['redis'],{'host':_0x332f('0xd'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x332f('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x332f('0xf'),'profile',_0x332f('0x10'),_0x332f('0x11'),_0x332f('0x12'),'https://outlook.office.com/POP.AccessAsUser.All',_0x332f('0x13')],'Dynamics365':['openid',_0x332f('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x332f('0x14');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x14d65c){var _0x1e62aa=_[_0x332f('0x15')](AZURE_AUTH_SCOPES[_0x14d65c['type']]);if(_0x14d65c['type']===_0x332f('0x16'))_0x1e62aa['push'](_0x14d65c[_0x332f('0x17')]+'/.default');return _0x1e62aa['join']('\x20');}function getAccessTokenScope(_0xac8e1c){if(_0xac8e1c[_0x332f('0x18')]===_0x332f('0x19'))return _0x332f('0x12');if(_0xac8e1c[_0x332f('0x18')]===_0x332f('0x16'))return _0xac8e1c[_0x332f('0x17')]+_0x332f('0x1a');}function generateMicrosoftAuthorizationUrl(_0x24cd0e,_0x255eb2){var _0x4d75a5=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x24cd0e[_0x332f('0x1b')]);var _0xaf7f9=[_0x332f('0x1c'),_0x332f('0x1d')];var _0x55a0f3=Buffer['from'](JSON[_0x332f('0x1e')]({'id':_0x255eb2}))[_0x332f('0x1f')](_0x332f('0x20'));var _0x4c0101=crypto['randomBytes'](0x10)['toString'](_0x332f('0x21'));var _0x4b4efc=getAuthorizationScopes(_0x24cd0e);var _0x3ca9ee=[{'key':_0x332f('0x22'),'value':_0x24cd0e['data1']},{'key':_0x332f('0x23'),'value':encodeURIComponent(_0xaf7f9[_0x332f('0x24')]('\x20'))},{'key':_0x332f('0x25'),'value':_0x24cd0e['data4']},{'key':_0x332f('0x26'),'value':_0x332f('0x27')},{'key':_0x332f('0x28'),'value':encodeURIComponent(_0x4b4efc)},{'key':_0x332f('0x29'),'value':_0x55a0f3},{'key':_0x332f('0x2a'),'value':_0x4c0101},{'key':_0x332f('0x2b'),'value':'login'}];var _0x446b5e=_0x4d75a5+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x332f('0x15')](_0x3ca9ee,function(_0x5903fc){return _0x5903fc[_0x332f('0x2c')]+'='+_0x5903fc['value'];})[_0x332f('0x24')]('&');_0x24cd0e['oauth2Claims']={'issuer':_0x4d75a5[_0x332f('0x2d')](_0x332f('0x2e'),''),'audience':_0x24cd0e[_0x332f('0x2f')],'state':_0x55a0f3,'nonce':_0x4c0101};redis[_0x332f('0x30')](_0x55a0f3,JSON[_0x332f('0x1e')](_0x24cd0e));return _0x446b5e;}function isValidIdToken(_0x519db1,_0x10dcca){try{var _0x467a6a=jwt['decode'](_0x519db1,{'complete':!![]});var _0x318323=_0x467a6a[_0x332f('0x31')];if(_0x318323['iss']!==_0x10dcca[_0x332f('0x32')])return![];if(_0x318323['aud']!==_0x10dcca['audience'])return![];if(_0x318323[_0x332f('0x2a')]!==_0x10dcca[_0x332f('0x2a')])return![];if(moment()[_0x332f('0x33')](moment[_0x332f('0x34')](_0x318323[_0x332f('0x35')])))return![];return!![];}catch(_0x4637ca){throw _0x4637ca;}}function refreshOauth2MicrosoftAccessToken(_0x10be28){return Promise[_0x332f('0x36')]()['then'](function(){if(_0x10be28[_0x332f('0x37')])return _0x10be28;return db[_0x332f('0x38')][_0x332f('0x39')]({'where':{'id':_0x10be28['id']},'raw':!![]});})[_0x332f('0x3a')](function(_0x1b84d4){var _0x95affb={'grant_type':_0x332f('0x3b'),'refresh_token':_0x1b84d4[_0x332f('0x3c')],'scope':getAccessTokenScope(_0x1b84d4),'redirect_uri':_0x1b84d4['data4'],'client_id':_0x1b84d4['data1'],'client_secret':encryptor[_0x332f('0x3d')](_0x1b84d4[_0x332f('0x37')])};var _0x42486b={'method':_0x332f('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0x332f('0x3f'),_0x1b84d4['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x95affb,'json':!![]};return rp(_0x42486b);})[_0x332f('0x3a')](function(_0x10d141){_0x10be28['data5']=_0x10d141[_0x332f('0x40')];_0x10be28[_0x332f('0x3c')]=_0x10d141[_0x332f('0x3b')];return db[_0x332f('0x38')]['update']({'data5':_0x10be28[_0x332f('0x41')],'data6':_0x10be28[_0x332f('0x3c')]},{'where':{'id':_0x10be28['id']}});})[_0x332f('0x3a')](function(){return _0x10be28;})['catch'](function(_0x525f36){logger['error'](_0x332f('0x42'),_0x10be28['id'],_0x525f36);});}function getOauth2MicrosoftAccessToken(_0x36adbc,_0x47894e){var _0x21fecd={'grant_type':'authorization_code','code':_0x36adbc,'scope':getAccessTokenScope(_0x47894e),'redirect_uri':_0x47894e[_0x332f('0x43')],'client_id':_0x47894e[_0x332f('0x2f')],'client_secret':encryptor['decryptString'](_0x47894e[_0x332f('0x37')])};var _0x27400b={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x332f('0x2d')]('{TENANT_ID}',_0x47894e[_0x332f('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x21fecd,'json':!![]};return rp(_0x27400b);}function startRefreshInterval(_0x13b497){var _0x50c0a5=schedule['intervals'];if(_0x50c0a5[_0x13b497['id']])clearInterval(_0x50c0a5[_0x13b497['id']]);_0x50c0a5[_0x13b497['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x13b497['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x332f('0x44')]=_0x50c0a5;}function startAllRefreshIntervals(){return db[_0x332f('0x38')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x332f('0x3a')](function(_0x4a2728){var _0x1d2a62=_0x4a2728[_0x332f('0x15')](function(_0x11eddf){return refreshOauth2MicrosoftAccessToken(_0x11eddf)[_0x332f('0x3a')](function(_0x3d655f){startRefreshInterval(_0x3d655f);});});return Promise[_0x332f('0x45')](_0x1d2a62);})[_0x332f('0x46')](function(_0x4e9ecb){var _0x3a7a0c=_0x4e9ecb?util['inspect'](_0x4e9ecb,{'showHidden':![],'depth':null}):'';logger[_0x332f('0x47')](_0x332f('0x48'),_0x3a7a0c);});}module['exports']={'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 52f4771..d489370 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 _0xa693=['util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x180a98,_0x10c65e){var _0x3cc63e=function(_0x475ee7){while(--_0x475ee7){_0x180a98['push'](_0x180a98['shift']());}};_0x3cc63e(++_0x10c65e);}(_0xa693,0xf1));var _0x3a69=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0xa693[_0x1b64dd];return _0xeb464c;};'use strict';var _=require(_0x3a69('0x0'));var util=require(_0x3a69('0x1'));var moment=require(_0x3a69('0x2'));var BPromise=require(_0x3a69('0x3'));var rs=require(_0x3a69('0x4'));var fs=require('fs');var Redis=require(_0x3a69('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a69('0x6'));var config=require(_0x3a69('0x7'));var jayson=require(_0x3a69('0x8'));var client=jayson[_0x3a69('0x9')][_0x3a69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x125226,_0x290e84,_0x5e7d90){return new BPromise(function(_0x1d564b,_0x2b8e2e){return client['request'](_0x125226,_0x5e7d90)['then'](function(_0x4e65a5){logger[_0x3a69('0xb')]('CloudProvider,\x20%s,\x20%s',_0x290e84,_0x3a69('0xc'));logger[_0x3a69('0xd')](_0x3a69('0xe'),_0x290e84,_0x3a69('0xc'),JSON[_0x3a69('0xf')](_0x4e65a5));if(_0x4e65a5['error']){if(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x11')]===0x1f4){logger['error'](_0x3a69('0x12'),_0x290e84,_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);return _0x2b8e2e(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);}logger[_0x3a69('0x10')](_0x3a69('0x12'),_0x290e84,_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);return _0x1d564b(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);}else{logger[_0x3a69('0xb')]('CloudProvider,\x20%s,\x20%s',_0x290e84,'request\x20sent');_0x1d564b(_0x4e65a5[_0x3a69('0x14')][_0x3a69('0x13')]);}})[_0x3a69('0x15')](function(_0x24fb29){logger[_0x3a69('0x10')](_0x3a69('0x12'),_0x290e84,_0x24fb29);_0x2b8e2e(_0x24fb29);});});} \ No newline at end of file +var _0x1c9a=['http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x1c9a,0x98));var _0xa1c9=function(_0x15b53c,_0x389a8b){_0x15b53c=_0x15b53c-0x0;var _0xde9485=_0x1c9a[_0x15b53c];return _0xde9485;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5448f2,_0x222624,_0x463c9c){return new BPromise(function(_0x3f07c2,_0x5059df){return client[_0xa1c9('0xa')](_0x5448f2,_0x463c9c)[_0xa1c9('0xb')](function(_0x24136d){logger[_0xa1c9('0xc')]('CloudProvider,\x20%s,\x20%s',_0x222624,_0xa1c9('0xd'));logger[_0xa1c9('0xe')](_0xa1c9('0xf'),_0x222624,_0xa1c9('0xd'),JSON[_0xa1c9('0x10')](_0x24136d));if(_0x24136d[_0xa1c9('0x11')]){if(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x5059df(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x222624,_0x24136d['error'][_0xa1c9('0x14')]);return _0x3f07c2(_0x24136d[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xc')](_0xa1c9('0x13'),_0x222624,_0xa1c9('0xd'));_0x3f07c2(_0x24136d[_0xa1c9('0x15')][_0xa1c9('0x14')]);}})[_0xa1c9('0x16')](function(_0x373f5d){logger['error'](_0xa1c9('0x13'),_0x222624,_0x373f5d);_0x5059df(_0x373f5d);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index deff989..e8f151a 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x16ac54,_0x50a6a3){var _0x1e5e5c=function(_0x5b4210){while(--_0x5b4210){_0x16ac54['push'](_0x16ac54['shift']());}};_0x1e5e5c(++_0x50a6a3);}(_0x2ef3,0xba));var _0x32ef=function(_0x552a95,_0x1db8f6){_0x552a95=_0x552a95-0x0;var _0x54537d=_0x2ef3[_0x552a95];return _0x54537d;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file +var _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x1af2a8,_0xec502b){var _0x490d13=function(_0x41d8fd){while(--_0x41d8fd){_0x1af2a8['push'](_0x1af2a8['shift']());}};_0x490d13(++_0xec502b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index aa21edb..02f06e6 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 _0x6abf=['STRING','name','sequelize'];(function(_0x365dbe,_0x162be2){var _0x405164=function(_0x476930){while(--_0x476930){_0x365dbe['push'](_0x365dbe['shift']());}};_0x405164(++_0x162be2);}(_0x6abf,0x1b5));var _0xf6ab=function(_0x24d439,_0x34e6d6){_0x24d439=_0x24d439-0x0;var _0x583977=_0x6abf[_0x24d439];return _0x583977;};'use strict';var Sequelize=require(_0xf6ab('0x0'));module['exports']={'name':{'type':Sequelize[_0xf6ab('0x1')],'unique':_0xf6ab('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf6ab('0x1')]},'companyId':{'type':Sequelize[_0xf6ab('0x1')]},'website':{'type':Sequelize[_0xf6ab('0x1')]},'phone':{'type':Sequelize[_0xf6ab('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xf6ab('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf6ab('0x1')]},'country':{'type':Sequelize[_0xf6ab('0x1')]},'email':{'type':Sequelize[_0xf6ab('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf6ab('0x1')]},'sStreet':{'type':Sequelize[_0xf6ab('0x1')]},'sPostalCode':{'type':Sequelize[_0xf6ab('0x1')]},'sCity':{'type':Sequelize[_0xf6ab('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xde0e=['name','sequelize','exports','STRING'];(function(_0x29cbb6,_0x4a52ce){var _0x485aab=function(_0x181047){while(--_0x181047){_0x29cbb6['push'](_0x29cbb6['shift']());}};_0x485aab(++_0x4a52ce);}(_0xde0e,0x145));var _0xede0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde0e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xede0('0x0'));module[_0xede0('0x1')]={'name':{'type':Sequelize[_0xede0('0x2')],'unique':_0xede0('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xede0('0x2')]},'companyId':{'type':Sequelize[_0xede0('0x2')]},'website':{'type':Sequelize[_0xede0('0x2')]},'phone':{'type':Sequelize[_0xede0('0x2')]},'fax':{'type':Sequelize[_0xede0('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xede0('0x2')]},'country':{'type':Sequelize[_0xede0('0x2')]},'email':{'type':Sequelize[_0xede0('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xede0('0x2')]},'sPostalCode':{'type':Sequelize[_0xede0('0x2')]},'sCity':{'type':Sequelize[_0xede0('0x2')]},'sCountry':{'type':Sequelize[_0xede0('0x2')]},'description':{'type':Sequelize[_0xede0('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 393436b..1296133 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 _0x3b1e=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','error','name','send','CmCompany','describe','model','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','includeAll','include','rows','catch','show','params','keys','rawAttributes','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addContacts','ids','omit','getContacts','findOne','CmContact','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel'];(function(_0x20cb20,_0x256051){var _0x2fcf4b=function(_0x26200b){while(--_0x26200b){_0x20cb20['push'](_0x20cb20['shift']());}};_0x2fcf4b(++_0x256051);}(_0x3b1e,0x1b6));var _0xe3b1=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3b1e[_0xfae23b];return _0x200640;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe3b1('0x0'));var jsonpatch=require(_0xe3b1('0x1'));var rp=require(_0xe3b1('0x2'));var moment=require(_0xe3b1('0x3'));var BPromise=require(_0xe3b1('0x4'));var Mustache=require(_0xe3b1('0x5'));var util=require(_0xe3b1('0x6'));var path=require(_0xe3b1('0x7'));var sox=require(_0xe3b1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe3b1('0x9'));var _=require(_0xe3b1('0xa'));var squel=require(_0xe3b1('0xb'));var crypto=require('crypto');var jsforce=require(_0xe3b1('0xc'));var deskjs=require(_0xe3b1('0xd'));var toCsv=require(_0xe3b1('0xe'));var querystring=require(_0xe3b1('0xf'));var Papa=require(_0xe3b1('0x10'));var Redis=require(_0xe3b1('0x11'));var authService=require(_0xe3b1('0x12'));var qs=require(_0xe3b1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3b1('0x14'));var logger=require(_0xe3b1('0x15'))(_0xe3b1('0x16'));var utils=require('../../config/utils');var config=require(_0xe3b1('0x17'));var licenseUtil=require(_0xe3b1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b8dc9,_0x4c208d){_0x4c208d=_0x4c208d||0xcc;return function(_0x5ac14f){if(_0x5ac14f){return _0x4b8dc9[_0xe3b1('0x19')](_0x4c208d);}return _0x4b8dc9[_0xe3b1('0x1a')](_0x4c208d)[_0xe3b1('0x1b')]();};}function respondWithResult(_0x306a63,_0xbc6f8e){_0xbc6f8e=_0xbc6f8e||0xc8;return function(_0x432d1b){if(_0x432d1b){return _0x306a63[_0xe3b1('0x1a')](_0xbc6f8e)[_0xe3b1('0x1c')](_0x432d1b);}};}function respondWithFilteredResult(_0x1e8b92,_0x187a2c){return function(_0x1418ac){if(_0x1418ac){var _0x4192f1=typeof _0x187a2c[_0xe3b1('0x1d')]===_0xe3b1('0x1e')&&typeof _0x187a2c[_0xe3b1('0x1f')]===_0xe3b1('0x1e');var _0x2c52b6=_0x1418ac['count'];var _0x42b2f3=_0x4192f1?0x0:_0x187a2c[_0xe3b1('0x1d')];var _0x174eb0=_0x4192f1?_0x1418ac[_0xe3b1('0x20')]:_0x187a2c[_0xe3b1('0x1d')]+_0x187a2c[_0xe3b1('0x1f')];var _0x849f34;if(_0x174eb0>=_0x2c52b6){_0x174eb0=_0x2c52b6;_0x849f34=0xc8;}else{_0x849f34=0xce;}_0x1e8b92[_0xe3b1('0x1a')](_0x849f34);return _0x1e8b92[_0xe3b1('0x21')](_0xe3b1('0x22'),_0x42b2f3+'-'+_0x174eb0+'/'+_0x2c52b6)[_0xe3b1('0x1c')](_0x1418ac);}return null;};}function patchUpdates(_0x527de3){return function(_0x17ee37){try{jsonpatch[_0xe3b1('0x23')](_0x17ee37,_0x527de3,!![]);}catch(_0x329e08){return BPromise[_0xe3b1('0x24')](_0x329e08);}return _0x17ee37[_0xe3b1('0x25')]();};}function saveUpdates(_0x544b8e,_0x173a63){return function(_0x281d2a){if(_0x281d2a){return _0x281d2a[_0xe3b1('0x26')](_0x544b8e)[_0xe3b1('0x27')](function(_0xa2f77e){return _0xa2f77e;});}return null;};}function removeEntity(_0x4976a5,_0x36868c){return function(_0x4b33ef){if(_0x4b33ef){return _0x4b33ef['destroy']()[_0xe3b1('0x27')](function(){var _0x2a320b=_0x4b33ef[_0xe3b1('0x28')]({'plain':!![]});var _0x2fefd1=_0xe3b1('0x29');return db[_0xe3b1('0x2a')]['destroy']({'where':{'type':_0x2fefd1,'resourceId':_0x2a320b['id']}})[_0xe3b1('0x27')](function(){return _0x4b33ef;});})['then'](function(){_0x4976a5[_0xe3b1('0x1a')](0xcc)[_0xe3b1('0x1b')]();});}};}function handleEntityNotFound(_0x384b91,_0x30469d){return function(_0x2ce91b){if(!_0x2ce91b){_0x384b91[_0xe3b1('0x19')](0x194);}return _0x2ce91b;};}function handleError(_0x2b069f,_0x27c0e1){_0x27c0e1=_0x27c0e1||0x1f4;return function(_0x286d25){logger[_0xe3b1('0x2b')](_0x286d25['stack']);if(_0x286d25[_0xe3b1('0x2c')]){delete _0x286d25[_0xe3b1('0x2c')];}_0x2b069f[_0xe3b1('0x1a')](_0x27c0e1)[_0xe3b1('0x2d')](_0x286d25);};}exports['index']=function(_0x457e3d,_0x431699){var _0x2d3bc9={},_0xb37395={},_0x3dd8c8={'count':0x0,'rows':[]};return db[_0xe3b1('0x2e')][_0xe3b1('0x2f')]()[_0xe3b1('0x27')](function(_0x32025e){_0xb37395[_0xe3b1('0x30')]=_['keys'](_0x32025e);_0xb37395[_0xe3b1('0x31')]=_['keys'](_0x457e3d[_0xe3b1('0x31')]);_0xb37395[_0xe3b1('0x32')]=_['intersection'](_0xb37395[_0xe3b1('0x30')],_0xb37395[_0xe3b1('0x31')]);_0x2d3bc9[_0xe3b1('0x33')]=_[_0xe3b1('0x34')](_0xb37395[_0xe3b1('0x30')],qs['fields'](_0x457e3d[_0xe3b1('0x31')]['fields']));_0x2d3bc9['attributes']=_0x2d3bc9[_0xe3b1('0x33')][_0xe3b1('0x35')]?_0x2d3bc9['attributes']:_0xb37395[_0xe3b1('0x30')];if(!_0x457e3d[_0xe3b1('0x31')][_0xe3b1('0x36')](_0xe3b1('0x37'))){_0x2d3bc9[_0xe3b1('0x1f')]=qs[_0xe3b1('0x1f')](_0x457e3d[_0xe3b1('0x31')]['limit']);_0x2d3bc9[_0xe3b1('0x1d')]=qs[_0xe3b1('0x1d')](_0x457e3d['query'][_0xe3b1('0x1d')]);}_0x2d3bc9[_0xe3b1('0x38')]=qs[_0xe3b1('0x39')](_0x457e3d['query']['sort']);_0x2d3bc9['where']=qs[_0xe3b1('0x32')](_[_0xe3b1('0x3a')](_0x457e3d['query'],_0xb37395[_0xe3b1('0x32')]),_0x32025e);if(_0x457e3d[_0xe3b1('0x31')][_0xe3b1('0x3b')]){_0x2d3bc9[_0xe3b1('0x3c')]=_[_0xe3b1('0x3d')](_0x2d3bc9[_0xe3b1('0x3c')],{'$or':_[_0xe3b1('0x3e')](_0x2d3bc9[_0xe3b1('0x33')],function(_0x564b49){var _0x58e8ec={};_0x58e8ec[_0x564b49]={'$like':'%'+_0x457e3d['query']['filter']+'%'};return _0x58e8ec;})});}_0x2d3bc9=_['merge']({},_0x2d3bc9,_0x457e3d['options']);var _0x422371={'where':_0x2d3bc9[_0xe3b1('0x3c')]};return db[_0xe3b1('0x2e')][_0xe3b1('0x20')](_0x422371)['then'](function(_0x47142e){_0x3dd8c8[_0xe3b1('0x20')]=_0x47142e;if(_0x457e3d[_0xe3b1('0x31')][_0xe3b1('0x3f')]){_0x2d3bc9[_0xe3b1('0x40')]=[{'all':!![]}];}return db[_0xe3b1('0x2e')]['findAll'](_0x2d3bc9);})['then'](function(_0x53d680){_0x3dd8c8[_0xe3b1('0x41')]=_0x53d680;return _0x3dd8c8;})['then'](respondWithFilteredResult(_0x431699,_0x2d3bc9))['catch'](handleError(_0x431699,null));})[_0xe3b1('0x42')](handleError(_0x431699,null));};exports[_0xe3b1('0x43')]=function(_0x2abfa4,_0x2c442a){var _0x15aac9={'raw':![],'where':{'id':_0x2abfa4[_0xe3b1('0x44')]['id']}},_0x2f8193={};_0x2f8193[_0xe3b1('0x30')]=_[_0xe3b1('0x45')](db[_0xe3b1('0x2e')][_0xe3b1('0x46')]);_0x2f8193[_0xe3b1('0x31')]=_['keys'](_0x2abfa4['query']);_0x2f8193[_0xe3b1('0x32')]=_['intersection'](_0x2f8193['model'],_0x2f8193['query']);_0x15aac9[_0xe3b1('0x33')]=_[_0xe3b1('0x34')](_0x2f8193['model'],qs['fields'](_0x2abfa4[_0xe3b1('0x31')][_0xe3b1('0x47')]));_0x15aac9[_0xe3b1('0x33')]=_0x15aac9[_0xe3b1('0x33')][_0xe3b1('0x35')]?_0x15aac9[_0xe3b1('0x33')]:_0x2f8193[_0xe3b1('0x30')];if(_0x2abfa4[_0xe3b1('0x31')][_0xe3b1('0x3f')]){_0x15aac9[_0xe3b1('0x40')]=[{'all':!![]}];}_0x15aac9=_['merge']({},_0x15aac9,_0x2abfa4[_0xe3b1('0x48')]);return db[_0xe3b1('0x2e')]['find'](_0x15aac9)[_0xe3b1('0x27')](handleEntityNotFound(_0x2c442a,null))['then'](respondWithResult(_0x2c442a,null))['catch'](handleError(_0x2c442a,null));};exports[_0xe3b1('0x49')]=function(_0x4d7827,_0x9262be){return db['CmCompany'][_0xe3b1('0x49')](_0x4d7827[_0xe3b1('0x4a')],{})[_0xe3b1('0x27')](function(_0xe0cf07){var _0x4213bf=_0x4d7827[_0xe3b1('0x4b')][_0xe3b1('0x28')]({'plain':!![]});if(!_0x4213bf)throw new Error(_0xe3b1('0x4c'));if(_0x4213bf[_0xe3b1('0x4d')]===_0xe3b1('0x4b')){var _0x2ca4e4=_0xe0cf07['get']({'plain':!![]});var _0xed3970='Companies';return db[_0xe3b1('0x4e')][_0xe3b1('0x4f')]({'where':{'name':_0xed3970,'userProfileId':_0x4213bf[_0xe3b1('0x50')]},'raw':!![]})[_0xe3b1('0x27')](function(_0x4b94ac){if(_0x4b94ac&&_0x4b94ac[_0xe3b1('0x51')]===0x0){return db[_0xe3b1('0x2a')][_0xe3b1('0x49')]({'name':_0x2ca4e4[_0xe3b1('0x2c')],'resourceId':_0x2ca4e4['id'],'type':_0x4b94ac['name'],'sectionId':_0x4b94ac['id']},{})[_0xe3b1('0x27')](function(){return _0xe0cf07;});}else{return _0xe0cf07;}})[_0xe3b1('0x42')](function(_0x399dc9){logger['error'](_0xe3b1('0x52'),_0x399dc9);throw _0x399dc9;});}return _0xe0cf07;})['then'](respondWithResult(_0x9262be,0xc9))[_0xe3b1('0x42')](handleError(_0x9262be,null));};exports[_0xe3b1('0x26')]=function(_0x3a7110,_0x28ccb8){if(_0x3a7110[_0xe3b1('0x4a')]['id']){delete _0x3a7110[_0xe3b1('0x4a')]['id'];}return db['CmCompany'][_0xe3b1('0x4f')]({'where':{'id':_0x3a7110['params']['id']}})[_0xe3b1('0x27')](handleEntityNotFound(_0x28ccb8,null))['then'](saveUpdates(_0x3a7110[_0xe3b1('0x4a')],null))[_0xe3b1('0x27')](respondWithResult(_0x28ccb8,null))[_0xe3b1('0x42')](handleError(_0x28ccb8,null));};exports[_0xe3b1('0x53')]=function(_0x4b8f55,_0x3232cd){return db[_0xe3b1('0x2e')]['find']({'where':{'id':_0x4b8f55[_0xe3b1('0x44')]['id']}})[_0xe3b1('0x27')](handleEntityNotFound(_0x3232cd,null))[_0xe3b1('0x27')](removeEntity(_0x3232cd,null))['catch'](handleError(_0x3232cd,null));};exports['describe']=function(_0x408ff6,_0x5a84f1){return db['CmCompany']['describe']()[_0xe3b1('0x27')](respondWithResult(_0x5a84f1,null))['catch'](handleError(_0x5a84f1,null));};exports[_0xe3b1('0x54')]=function(_0x438959,_0x4db872,_0x2297eb){return db['CmContact'][_0xe3b1('0x4f')]({'where':{'id':_0x438959['params']['id']}})['then'](handleEntityNotFound(_0x4db872,null))['then'](function(_0x35f135){if(_0x35f135){return _0x35f135[_0xe3b1('0x54')](_0x438959[_0xe3b1('0x4a')][_0xe3b1('0x55')],_[_0xe3b1('0x56')](_0x438959[_0xe3b1('0x4a')],[_0xe3b1('0x55'),'id'])||{});}})[_0xe3b1('0x27')](respondWithResult(_0x4db872,null))[_0xe3b1('0x42')](handleError(_0x4db872,null));};exports[_0xe3b1('0x57')]=function(_0x2925ef,_0xdf99eb,_0x3e3586){var _0xde524d={};var _0x4a783b={};var _0x1d910a;var _0x2e56c3;return db[_0xe3b1('0x2e')][_0xe3b1('0x58')]({'where':{'id':_0x2925ef[_0xe3b1('0x44')]['id']}})[_0xe3b1('0x27')](handleEntityNotFound(_0xdf99eb,null))[_0xe3b1('0x27')](function(_0x323072){if(_0x323072){_0x1d910a=_0x323072;_0x4a783b[_0xe3b1('0x30')]=_['keys'](db[_0xe3b1('0x59')][_0xe3b1('0x46')]);_0x4a783b[_0xe3b1('0x31')]=_[_0xe3b1('0x45')](_0x2925ef[_0xe3b1('0x31')]);_0x4a783b[_0xe3b1('0x32')]=_[_0xe3b1('0x34')](_0x4a783b[_0xe3b1('0x30')],_0x4a783b[_0xe3b1('0x31')]);_0xde524d[_0xe3b1('0x33')]=_[_0xe3b1('0x34')](_0x4a783b[_0xe3b1('0x30')],qs['fields'](_0x2925ef[_0xe3b1('0x31')][_0xe3b1('0x47')]));_0xde524d['attributes']=_0xde524d['attributes'][_0xe3b1('0x35')]?_0xde524d['attributes']:_0x4a783b['model'];_0xde524d[_0xe3b1('0x38')]=qs['sort'](_0x2925ef[_0xe3b1('0x31')][_0xe3b1('0x39')]);_0xde524d[_0xe3b1('0x3c')]=qs[_0xe3b1('0x32')](_[_0xe3b1('0x3a')](_0x2925ef[_0xe3b1('0x31')],_0x4a783b[_0xe3b1('0x32')]));if(_0x2925ef[_0xe3b1('0x31')][_0xe3b1('0x3b')]){_0xde524d[_0xe3b1('0x3c')]=_[_0xe3b1('0x3d')](_0xde524d['where'],{'$or':_['map'](_0xde524d[_0xe3b1('0x33')],function(_0x376f20){var _0x3ee1ed={};_0x3ee1ed[_0x376f20]={'$like':'%'+_0x2925ef[_0xe3b1('0x31')][_0xe3b1('0x3b')]+'%'};return _0x3ee1ed;})});}_0xde524d=_['merge']({},_0xde524d,_0x2925ef[_0xe3b1('0x48')]);return _0x1d910a[_0xe3b1('0x57')](_0xde524d);}})[_0xe3b1('0x27')](function(_0x5cdae5){if(_0x5cdae5){_0x2e56c3=_0x5cdae5[_0xe3b1('0x35')];if(!_0x2925ef[_0xe3b1('0x31')][_0xe3b1('0x36')]('nolimit')){_0xde524d[_0xe3b1('0x1f')]=qs[_0xe3b1('0x1f')](_0x2925ef['query'][_0xe3b1('0x1f')]);_0xde524d[_0xe3b1('0x1d')]=qs[_0xe3b1('0x1d')](_0x2925ef[_0xe3b1('0x31')]['offset']);}return _0x1d910a['getContacts'](_0xde524d);}})[_0xe3b1('0x27')](function(_0x52acaf){if(_0x52acaf){return _0x52acaf?{'count':_0x2e56c3,'rows':_0x52acaf}:null;}})['then'](respondWithResult(_0xdf99eb,null))[_0xe3b1('0x42')](handleError(_0xdf99eb,null));}; \ No newline at end of file +var _0xfa9a=['undefined','limit','set','apply','reject','save','update','destroy','Companies','UserProfileResource','then','stack','name','send','describe','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','CmCompany','count','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','findOne','map','getContacts','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa9a,0x1dd));var _0xafa9=function(_0x18f88d,_0x2c94a7){_0x18f88d=_0x18f88d-0x0;var _0x2d351e=_0xfa9a[_0x18f88d];return _0x2d351e;};'use strict';var emlformat=require(_0xafa9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xafa9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xafa9('0x2'));var BPromise=require(_0xafa9('0x3'));var Mustache=require(_0xafa9('0x4'));var util=require(_0xafa9('0x5'));var path=require(_0xafa9('0x6'));var sox=require(_0xafa9('0x7'));var csv=require(_0xafa9('0x8'));var ejs=require(_0xafa9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafa9('0xa'));var squel=require(_0xafa9('0xb'));var crypto=require(_0xafa9('0xc'));var jsforce=require(_0xafa9('0xd'));var deskjs=require(_0xafa9('0xe'));var toCsv=require(_0xafa9('0x8'));var querystring=require(_0xafa9('0xf'));var Papa=require(_0xafa9('0x10'));var Redis=require(_0xafa9('0x11'));var authService=require(_0xafa9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xafa9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xafa9('0x14'));var licenseUtil=require(_0xafa9('0x15'));var db=require(_0xafa9('0x16'))['db'];function respondWithStatusCode(_0x3c8ef2,_0xa97622){_0xa97622=_0xa97622||0xcc;return function(_0x3212ec){if(_0x3212ec){return _0x3c8ef2[_0xafa9('0x17')](_0xa97622);}return _0x3c8ef2[_0xafa9('0x18')](_0xa97622)['end']();};}function respondWithResult(_0x1655d5,_0x7a5df8){_0x7a5df8=_0x7a5df8||0xc8;return function(_0x120929){if(_0x120929){return _0x1655d5[_0xafa9('0x18')](_0x7a5df8)[_0xafa9('0x19')](_0x120929);}};}function respondWithFilteredResult(_0x2c4b1e,_0x56c300){return function(_0x52c332){if(_0x52c332){var _0x5ca1ea=typeof _0x56c300[_0xafa9('0x1a')]===_0xafa9('0x1b')&&typeof _0x56c300[_0xafa9('0x1c')]===_0xafa9('0x1b');var _0x5c7e93=_0x52c332['count'];var _0x27e158=_0x5ca1ea?0x0:_0x56c300[_0xafa9('0x1a')];var _0x5c65da=_0x5ca1ea?_0x52c332['count']:_0x56c300[_0xafa9('0x1a')]+_0x56c300[_0xafa9('0x1c')];var _0x53b622;if(_0x5c65da>=_0x5c7e93){_0x5c65da=_0x5c7e93;_0x53b622=0xc8;}else{_0x53b622=0xce;}_0x2c4b1e[_0xafa9('0x18')](_0x53b622);return _0x2c4b1e[_0xafa9('0x1d')]('Content-Range',_0x27e158+'-'+_0x5c65da+'/'+_0x5c7e93)['json'](_0x52c332);}return null;};}function patchUpdates(_0x1b2b9f){return function(_0x5651d0){try{jsonpatch[_0xafa9('0x1e')](_0x5651d0,_0x1b2b9f,!![]);}catch(_0x20a1f9){return BPromise[_0xafa9('0x1f')](_0x20a1f9);}return _0x5651d0[_0xafa9('0x20')]();};}function saveUpdates(_0x3d4446,_0x59115c){return function(_0x4eda70){if(_0x4eda70){return _0x4eda70[_0xafa9('0x21')](_0x3d4446)['then'](function(_0x47ef16){return _0x47ef16;});}return null;};}function removeEntity(_0x1912bc,_0x26e774){return function(_0x5d7243){if(_0x5d7243){return _0x5d7243[_0xafa9('0x22')]()['then'](function(){var _0x1db8b0=_0x5d7243['get']({'plain':!![]});var _0x33cd80=_0xafa9('0x23');return db[_0xafa9('0x24')][_0xafa9('0x22')]({'where':{'type':_0x33cd80,'resourceId':_0x1db8b0['id']}})['then'](function(){return _0x5d7243;});})[_0xafa9('0x25')](function(){_0x1912bc[_0xafa9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x283d04,_0x352764){return function(_0x505705){if(!_0x505705){_0x283d04[_0xafa9('0x17')](0x194);}return _0x505705;};}function handleError(_0x251ff3,_0x2feedc){_0x2feedc=_0x2feedc||0x1f4;return function(_0x4053f6){logger['error'](_0x4053f6[_0xafa9('0x26')]);if(_0x4053f6[_0xafa9('0x27')]){delete _0x4053f6[_0xafa9('0x27')];}_0x251ff3[_0xafa9('0x18')](_0x2feedc)[_0xafa9('0x28')](_0x4053f6);};}exports['index']=function(_0x4082fd,_0x43255d){var _0x513702={},_0xb215ff={},_0x4992dd={'count':0x0,'rows':[]};return db['CmCompany'][_0xafa9('0x29')]()[_0xafa9('0x25')](function(_0x169887){_0xb215ff[_0xafa9('0x2a')]=_['keys'](_0x169887);_0xb215ff[_0xafa9('0x2b')]=_[_0xafa9('0x2c')](_0x4082fd['query']);_0xb215ff['filters']=_['intersection'](_0xb215ff[_0xafa9('0x2a')],_0xb215ff[_0xafa9('0x2b')]);_0x513702[_0xafa9('0x2d')]=_[_0xafa9('0x2e')](_0xb215ff[_0xafa9('0x2a')],qs[_0xafa9('0x2f')](_0x4082fd[_0xafa9('0x2b')][_0xafa9('0x2f')]));_0x513702[_0xafa9('0x2d')]=_0x513702['attributes']['length']?_0x513702[_0xafa9('0x2d')]:_0xb215ff[_0xafa9('0x2a')];if(!_0x4082fd[_0xafa9('0x2b')][_0xafa9('0x30')](_0xafa9('0x31'))){_0x513702[_0xafa9('0x1c')]=qs[_0xafa9('0x1c')](_0x4082fd[_0xafa9('0x2b')][_0xafa9('0x1c')]);_0x513702[_0xafa9('0x1a')]=qs['offset'](_0x4082fd['query'][_0xafa9('0x1a')]);}_0x513702[_0xafa9('0x32')]=qs[_0xafa9('0x33')](_0x4082fd[_0xafa9('0x2b')][_0xafa9('0x33')]);_0x513702[_0xafa9('0x34')]=qs[_0xafa9('0x35')](_[_0xafa9('0x36')](_0x4082fd[_0xafa9('0x2b')],_0xb215ff['filters']),_0x169887);if(_0x4082fd[_0xafa9('0x2b')][_0xafa9('0x37')]){_0x513702[_0xafa9('0x34')]=_[_0xafa9('0x38')](_0x513702[_0xafa9('0x34')],{'$or':_['map'](_0x513702[_0xafa9('0x2d')],function(_0x18f136){var _0x1e5dab={};_0x1e5dab[_0x18f136]={'$like':'%'+_0x4082fd[_0xafa9('0x2b')]['filter']+'%'};return _0x1e5dab;})});}_0x513702=_[_0xafa9('0x38')]({},_0x513702,_0x4082fd[_0xafa9('0x39')]);var _0x2b91f2={'where':_0x513702[_0xafa9('0x34')]};return db[_0xafa9('0x3a')]['count'](_0x2b91f2)[_0xafa9('0x25')](function(_0x15a448){_0x4992dd[_0xafa9('0x3b')]=_0x15a448;if(_0x4082fd[_0xafa9('0x2b')][_0xafa9('0x3c')]){_0x513702[_0xafa9('0x3d')]=[{'all':!![]}];}return db[_0xafa9('0x3a')][_0xafa9('0x3e')](_0x513702);})['then'](function(_0x2d0a95){_0x4992dd[_0xafa9('0x3f')]=_0x2d0a95;return _0x4992dd;})[_0xafa9('0x25')](respondWithFilteredResult(_0x43255d,_0x513702))[_0xafa9('0x40')](handleError(_0x43255d,null));})[_0xafa9('0x40')](handleError(_0x43255d,null));};exports['show']=function(_0x18c494,_0x5464e1){var _0x2bfc0b={'raw':![],'where':{'id':_0x18c494[_0xafa9('0x41')]['id']}},_0x408c82={};_0x408c82['model']=_[_0xafa9('0x2c')](db[_0xafa9('0x3a')][_0xafa9('0x42')]);_0x408c82[_0xafa9('0x2b')]=_[_0xafa9('0x2c')](_0x18c494[_0xafa9('0x2b')]);_0x408c82[_0xafa9('0x35')]=_['intersection'](_0x408c82[_0xafa9('0x2a')],_0x408c82[_0xafa9('0x2b')]);_0x2bfc0b[_0xafa9('0x2d')]=_[_0xafa9('0x2e')](_0x408c82['model'],qs['fields'](_0x18c494[_0xafa9('0x2b')][_0xafa9('0x2f')]));_0x2bfc0b['attributes']=_0x2bfc0b[_0xafa9('0x2d')][_0xafa9('0x43')]?_0x2bfc0b[_0xafa9('0x2d')]:_0x408c82[_0xafa9('0x2a')];if(_0x18c494['query'][_0xafa9('0x3c')]){_0x2bfc0b['include']=[{'all':!![]}];}_0x2bfc0b=_[_0xafa9('0x38')]({},_0x2bfc0b,_0x18c494[_0xafa9('0x39')]);return db[_0xafa9('0x3a')][_0xafa9('0x44')](_0x2bfc0b)[_0xafa9('0x25')](handleEntityNotFound(_0x5464e1,null))[_0xafa9('0x25')](respondWithResult(_0x5464e1,null))[_0xafa9('0x40')](handleError(_0x5464e1,null));};exports[_0xafa9('0x45')]=function(_0x34e405,_0x3f916a){return db[_0xafa9('0x3a')][_0xafa9('0x45')](_0x34e405[_0xafa9('0x46')],{})[_0xafa9('0x25')](function(_0x172917){var _0x2d5368=_0x34e405['user'][_0xafa9('0x47')]({'plain':!![]});if(!_0x2d5368)throw new Error(_0xafa9('0x48'));if(_0x2d5368['role']==='user'){var _0x2e38e1=_0x172917[_0xafa9('0x47')]({'plain':!![]});var _0x19d61a=_0xafa9('0x23');return db['UserProfileSection'][_0xafa9('0x44')]({'where':{'name':_0x19d61a,'userProfileId':_0x2d5368[_0xafa9('0x49')]},'raw':!![]})[_0xafa9('0x25')](function(_0x4ba950){if(_0x4ba950&&_0x4ba950[_0xafa9('0x4a')]===0x0){return db[_0xafa9('0x24')][_0xafa9('0x45')]({'name':_0x2e38e1[_0xafa9('0x27')],'resourceId':_0x2e38e1['id'],'type':_0x4ba950['name'],'sectionId':_0x4ba950['id']},{})['then'](function(){return _0x172917;});}else{return _0x172917;}})['catch'](function(_0x33eadb){logger[_0xafa9('0x4b')](_0xafa9('0x4c'),_0x33eadb);throw _0x33eadb;});}return _0x172917;})[_0xafa9('0x25')](respondWithResult(_0x3f916a,0xc9))[_0xafa9('0x40')](handleError(_0x3f916a,null));};exports[_0xafa9('0x21')]=function(_0x2fdbaa,_0x1298d9){if(_0x2fdbaa['body']['id']){delete _0x2fdbaa[_0xafa9('0x46')]['id'];}return db[_0xafa9('0x3a')][_0xafa9('0x44')]({'where':{'id':_0x2fdbaa['params']['id']}})[_0xafa9('0x25')](handleEntityNotFound(_0x1298d9,null))[_0xafa9('0x25')](saveUpdates(_0x2fdbaa[_0xafa9('0x46')],null))['then'](respondWithResult(_0x1298d9,null))[_0xafa9('0x40')](handleError(_0x1298d9,null));};exports[_0xafa9('0x22')]=function(_0x136232,_0x426496){return db[_0xafa9('0x3a')][_0xafa9('0x44')]({'where':{'id':_0x136232[_0xafa9('0x41')]['id']}})[_0xafa9('0x25')](handleEntityNotFound(_0x426496,null))[_0xafa9('0x25')](removeEntity(_0x426496,null))[_0xafa9('0x40')](handleError(_0x426496,null));};exports[_0xafa9('0x29')]=function(_0x2d016c,_0x471425){return db['CmCompany'][_0xafa9('0x29')]()[_0xafa9('0x25')](respondWithResult(_0x471425,null))[_0xafa9('0x40')](handleError(_0x471425,null));};exports[_0xafa9('0x4d')]=function(_0x596971,_0x58bd4f,_0xed04c5){return db[_0xafa9('0x4e')][_0xafa9('0x44')]({'where':{'id':_0x596971[_0xafa9('0x41')]['id']}})['then'](handleEntityNotFound(_0x58bd4f,null))[_0xafa9('0x25')](function(_0x265871){if(_0x265871){return _0x265871[_0xafa9('0x4d')](_0x596971['body'][_0xafa9('0x4f')],_[_0xafa9('0x50')](_0x596971['body'],[_0xafa9('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x58bd4f,null))[_0xafa9('0x40')](handleError(_0x58bd4f,null));};exports['getContacts']=function(_0x849f70,_0x561e7d,_0x46d283){var _0x42416e={};var _0x2909f5={};var _0x585e5a;var _0x345d65;return db[_0xafa9('0x3a')][_0xafa9('0x51')]({'where':{'id':_0x849f70[_0xafa9('0x41')]['id']}})[_0xafa9('0x25')](handleEntityNotFound(_0x561e7d,null))[_0xafa9('0x25')](function(_0x28e10d){if(_0x28e10d){_0x585e5a=_0x28e10d;_0x2909f5['model']=_[_0xafa9('0x2c')](db[_0xafa9('0x4e')][_0xafa9('0x42')]);_0x2909f5[_0xafa9('0x2b')]=_[_0xafa9('0x2c')](_0x849f70['query']);_0x2909f5[_0xafa9('0x35')]=_[_0xafa9('0x2e')](_0x2909f5[_0xafa9('0x2a')],_0x2909f5[_0xafa9('0x2b')]);_0x42416e[_0xafa9('0x2d')]=_[_0xafa9('0x2e')](_0x2909f5[_0xafa9('0x2a')],qs[_0xafa9('0x2f')](_0x849f70[_0xafa9('0x2b')][_0xafa9('0x2f')]));_0x42416e[_0xafa9('0x2d')]=_0x42416e[_0xafa9('0x2d')][_0xafa9('0x43')]?_0x42416e[_0xafa9('0x2d')]:_0x2909f5[_0xafa9('0x2a')];_0x42416e[_0xafa9('0x32')]=qs['sort'](_0x849f70[_0xafa9('0x2b')][_0xafa9('0x33')]);_0x42416e['where']=qs[_0xafa9('0x35')](_['pick'](_0x849f70[_0xafa9('0x2b')],_0x2909f5[_0xafa9('0x35')]));if(_0x849f70[_0xafa9('0x2b')][_0xafa9('0x37')]){_0x42416e['where']=_[_0xafa9('0x38')](_0x42416e['where'],{'$or':_[_0xafa9('0x52')](_0x42416e[_0xafa9('0x2d')],function(_0x5946f0){var _0x874cd1={};_0x874cd1[_0x5946f0]={'$like':'%'+_0x849f70[_0xafa9('0x2b')]['filter']+'%'};return _0x874cd1;})});}_0x42416e=_[_0xafa9('0x38')]({},_0x42416e,_0x849f70['options']);return _0x585e5a[_0xafa9('0x53')](_0x42416e);}})[_0xafa9('0x25')](function(_0x52e62c){if(_0x52e62c){_0x345d65=_0x52e62c[_0xafa9('0x43')];if(!_0x849f70[_0xafa9('0x2b')][_0xafa9('0x30')](_0xafa9('0x31'))){_0x42416e[_0xafa9('0x1c')]=qs[_0xafa9('0x1c')](_0x849f70[_0xafa9('0x2b')]['limit']);_0x42416e[_0xafa9('0x1a')]=qs[_0xafa9('0x1a')](_0x849f70['query'][_0xafa9('0x1a')]);}return _0x585e5a[_0xafa9('0x53')](_0x42416e);}})['then'](function(_0x183ef4){if(_0x183ef4){return _0x183ef4?{'count':_0x345d65,'rows':_0x183ef4}:null;}})['then'](respondWithResult(_0x561e7d,null))['catch'](handleError(_0x561e7d,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index b7f58fe..b98bac4 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 _0xac24=['path','rimraf','../../config/environment','./cmCompany.attributes','exports','cm_companies','lodash','util','api','moment','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac24,0x124));var _0x4ac2=function(_0x3cd13f,_0x29c1fd){_0x3cd13f=_0x3cd13f-0x0;var _0x549f27=_0xac24[_0x3cd13f];return _0x549f27;};'use strict';var _=require(_0x4ac2('0x0'));var util=require(_0x4ac2('0x1'));var logger=require('../../config/logger')(_0x4ac2('0x2'));var moment=require(_0x4ac2('0x3'));var BPromise=require('bluebird');var rp=require(_0x4ac2('0x4'));var fs=require('fs');var path=require(_0x4ac2('0x5'));var rimraf=require(_0x4ac2('0x6'));var config=require(_0x4ac2('0x7'));var attributes=require(_0x4ac2('0x8'));module[_0x4ac2('0x9')]=function(_0x17afd1,_0xc264dc){return _0x17afd1['define']('CmCompany',attributes,{'tableName':_0x4ac2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0674=['moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','util','../../config/logger'];(function(_0x1046b8,_0x2dcf18){var _0x480e1d=function(_0x28c074){while(--_0x28c074){_0x1046b8['push'](_0x1046b8['shift']());}};_0x480e1d(++_0x2dcf18);}(_0x0674,0x148));var _0x4067=function(_0x414682,_0x560738){_0x414682=_0x414682-0x0;var _0x3d2eb6=_0x0674[_0x414682];return _0x3d2eb6;};'use strict';var _=require('lodash');var util=require(_0x4067('0x0'));var logger=require(_0x4067('0x1'))('api');var moment=require(_0x4067('0x2'));var BPromise=require('bluebird');var rp=require(_0x4067('0x3'));var fs=require('fs');var path=require(_0x4067('0x4'));var rimraf=require(_0x4067('0x5'));var config=require(_0x4067('0x6'));var attributes=require(_0x4067('0x7'));module[_0x4067('0x8')]=function(_0x11361b,_0x51800f){return _0x11361b[_0x4067('0x9')]('CmCompany',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 45995f1..85a5d1e 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 _0xdf5e=['error','CmCompany,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','debug','request\x20sent','stringify'];(function(_0x38de33,_0x4361bb){var _0x40f16d=function(_0x25975c){while(--_0x25975c){_0x38de33['push'](_0x38de33['shift']());}};_0x40f16d(++_0x4361bb);}(_0xdf5e,0x143));var _0xedf5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xdf5e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xedf5('0x0'));var util=require(_0xedf5('0x1'));var moment=require('moment');var BPromise=require(_0xedf5('0x2'));var rs=require(_0xedf5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedf5('0x4'))['db'];var utils=require(_0xedf5('0x5'));var logger=require(_0xedf5('0x6'))('rpc');var config=require(_0xedf5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xedf5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcb09a1,_0x11ca8e,_0xea2142){return new BPromise(function(_0x23b04b,_0x42a4ea){return client['request'](_0xcb09a1,_0xea2142)[_0xedf5('0x9')](function(_0xf69498){logger['info']('CmCompany,\x20%s,\x20%s',_0x11ca8e,'request\x20sent');logger[_0xedf5('0xa')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x11ca8e,_0xedf5('0xb'),JSON[_0xedf5('0xc')](_0xf69498));if(_0xf69498['error']){if(_0xf69498[_0xedf5('0xd')]['code']===0x1f4){logger['error'](_0xedf5('0xe'),_0x11ca8e,_0xf69498['error'][_0xedf5('0xf')]);return _0x42a4ea(_0xf69498[_0xedf5('0xd')][_0xedf5('0xf')]);}logger[_0xedf5('0xd')]('CmCompany,\x20%s,\x20%s',_0x11ca8e,_0xf69498[_0xedf5('0xd')][_0xedf5('0xf')]);return _0x23b04b(_0xf69498[_0xedf5('0xd')][_0xedf5('0xf')]);}else{logger['info'](_0xedf5('0xe'),_0x11ca8e,'request\x20sent');_0x23b04b(_0xf69498['result'][_0xedf5('0xf')]);}})['catch'](function(_0x17214c){logger[_0xedf5('0xd')](_0xedf5('0xe'),_0x11ca8e,_0x17214c);_0x42a4ea(_0x17214c);});});} \ No newline at end of file +var _0x970c=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request'];(function(_0x489d21,_0x1f75c2){var _0x38b054=function(_0x28ed22){while(--_0x28ed22){_0x489d21['push'](_0x489d21['shift']());}};_0x38b054(++_0x1f75c2);}(_0x970c,0xa1));var _0xc970=function(_0x3d1917,_0x1a3ce1){_0x3d1917=_0x3d1917-0x0;var _0x4465df=_0x970c[_0x3d1917];return _0x4465df;};'use strict';var _=require(_0xc970('0x0'));var util=require(_0xc970('0x1'));var moment=require(_0xc970('0x2'));var BPromise=require(_0xc970('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc970('0x4'))['db'];var utils=require(_0xc970('0x5'));var logger=require(_0xc970('0x6'))(_0xc970('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc970('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x230d8c,_0x28cf10,_0x4e5c77){return new BPromise(function(_0x577123,_0x5e5898){return client[_0xc970('0x9')](_0x230d8c,_0x4e5c77)['then'](function(_0x37b666){logger['info'](_0xc970('0xa'),_0x28cf10,_0xc970('0xb'));logger[_0xc970('0xc')](_0xc970('0xd'),_0x28cf10,'request\x20sent',JSON[_0xc970('0xe')](_0x37b666));if(_0x37b666[_0xc970('0xf')]){if(_0x37b666[_0xc970('0xf')][_0xc970('0x10')]===0x1f4){logger[_0xc970('0xf')](_0xc970('0xa'),_0x28cf10,_0x37b666[_0xc970('0xf')][_0xc970('0x11')]);return _0x5e5898(_0x37b666[_0xc970('0xf')][_0xc970('0x11')]);}logger[_0xc970('0xf')](_0xc970('0xa'),_0x28cf10,_0x37b666[_0xc970('0xf')]['message']);return _0x577123(_0x37b666[_0xc970('0xf')]['message']);}else{logger['info'](_0xc970('0xa'),_0x28cf10,_0xc970('0xb'));_0x577123(_0x37b666[_0xc970('0x12')]['message']);}})['catch'](function(_0x380603){logger[_0xc970('0xf')](_0xc970('0xa'),_0x28cf10,_0x380603);_0x5e5898(_0x380603);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index a378a20..66d3915 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 _0xaeec=['update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','create','/:id/contacts','addContacts','put'];(function(_0x21ae22,_0x54911f){var _0x1e610a=function(_0x1d2cef){while(--_0x1d2cef){_0x21ae22['push'](_0x21ae22['shift']());}};_0x1e610a(++_0x54911f);}(_0xaeec,0x137));var _0xcaee=function(_0x23d3c1,_0x30edb0){_0x23d3c1=_0x23d3c1-0x0;var _0xac1133=_0xaeec[_0x23d3c1];return _0xac1133;};'use strict';var multer=require('multer');var util=require(_0xcaee('0x0'));var path=require(_0xcaee('0x1'));var timeout=require(_0xcaee('0x2'));var express=require(_0xcaee('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcaee('0x4'));var interaction=require(_0xcaee('0x5'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0xcaee('0x6')]('/',auth[_0xcaee('0x7')](),controller[_0xcaee('0x8')]);router[_0xcaee('0x6')](_0xcaee('0x9'),auth[_0xcaee('0x7')](),controller[_0xcaee('0xa')]);router[_0xcaee('0x6')](_0xcaee('0xb'),auth['isAuthenticated'](),controller[_0xcaee('0xc')]);router[_0xcaee('0x6')]('/:id/contacts',auth[_0xcaee('0x7')](),controller[_0xcaee('0xd')]);router[_0xcaee('0xe')]('/',auth[_0xcaee('0x7')](),controller[_0xcaee('0xf')]);router[_0xcaee('0xe')](_0xcaee('0x10'),auth['isAuthenticated'](),controller[_0xcaee('0x11')]);router[_0xcaee('0x12')](_0xcaee('0xb'),auth[_0xcaee('0x7')](),controller[_0xcaee('0x13')]);router['delete']('/:id',auth[_0xcaee('0x7')](),controller[_0xcaee('0x14')]);module[_0xcaee('0x15')]=router; \ No newline at end of file +var _0xb918=['get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','post','create','addContacts','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb918,0x1ae));var _0x8b91=function(_0x403885,_0x2de2da){_0x403885=_0x403885-0x0;var _0x20e746=_0xb918[_0x403885];return _0x20e746;};'use strict';var multer=require(_0x8b91('0x0'));var util=require(_0x8b91('0x1'));var path=require('path');var timeout=require(_0x8b91('0x2'));var express=require(_0x8b91('0x3'));var router=express[_0x8b91('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8b91('0x5'));var interaction=require(_0x8b91('0x6'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x8b91('0x7')]('/',auth[_0x8b91('0x8')](),controller[_0x8b91('0x9')]);router[_0x8b91('0x7')](_0x8b91('0xa'),auth['isAuthenticated'](),controller[_0x8b91('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8b91('0xc')]);router['get'](_0x8b91('0xd'),auth[_0x8b91('0x8')](),controller[_0x8b91('0xe')]);router[_0x8b91('0xf')]('/',auth[_0x8b91('0x8')](),controller[_0x8b91('0x10')]);router[_0x8b91('0xf')]('/:id/contacts',auth[_0x8b91('0x8')](),controller[_0x8b91('0x11')]);router[_0x8b91('0x12')](_0x8b91('0x13'),auth[_0x8b91('0x8')](),controller['update']);router[_0x8b91('0x14')](_0x8b91('0x13'),auth[_0x8b91('0x8')](),controller[_0x8b91('0x15')]);module[_0x8b91('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 7c318ef..443bc0f 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 _0x7b28=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7b28,0x15d));var _0x87b2=function(_0x2e9217,_0x7e8135){_0x2e9217=_0x2e9217-0x0;var _0x5eb93a=_0x7b28[_0x2e9217];return _0x5eb93a;};'use strict';var _=require(_0x87b2('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0x87b2('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x87b2('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x87b2('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x87b2('0x1')]},'description':{'type':Sequelize[_0x87b2('0x2')]},'phone':{'type':Sequelize[_0x87b2('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x87b2('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x87b2('0x1')]},'facebook':{'type':Sequelize[_0x87b2('0x1')]},'fb_data':{'type':Sequelize[_0x87b2('0x1')]},'twitter':{'type':Sequelize[_0x87b2('0x1')]},'skype':{'type':Sequelize[_0x87b2('0x1')]},'teams':{'type':Sequelize[_0x87b2('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x87b2('0x1')]},'UserId':{'type':Sequelize[_0x87b2('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x87b2('0x1')]},'priority':{'type':Sequelize[_0x87b2('0x3')](0x2)[_0x87b2('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x87b2('0x5')],'defaultValue':Sequelize[_0x87b2('0x6')]},'dialTimezone':{'type':Sequelize[_0x87b2('0x1')]},'utcOffset':{'type':Sequelize[_0x87b2('0x3')]}}; \ No newline at end of file +var _0x2885=['TEXT','INTEGER','DATE','NOW','lodash','exports','STRING'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x2885,0xb3));var _0x5288=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x2885[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x5288('0x0'));var Sequelize=require('sequelize');module[_0x5288('0x1')]={'firstName':{'type':Sequelize[_0x5288('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5288('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x5288('0x2')]},'city':{'type':Sequelize[_0x5288('0x2')]},'country':{'type':Sequelize[_0x5288('0x2')]},'dateOfBirth':{'type':Sequelize[_0x5288('0x2')]},'description':{'type':Sequelize[_0x5288('0x3')]},'phone':{'type':Sequelize[_0x5288('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5288('0x2')]},'url':{'type':Sequelize[_0x5288('0x2')]},'facebook':{'type':Sequelize[_0x5288('0x2')]},'fb_data':{'type':Sequelize[_0x5288('0x2')]},'twitter':{'type':Sequelize[_0x5288('0x2')]},'skype':{'type':Sequelize[_0x5288('0x2')]},'teams':{'type':Sequelize[_0x5288('0x2')]},'viber':{'type':Sequelize[_0x5288('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x5288('0x2')]},'telegram':{'type':Sequelize[_0x5288('0x2')]},'UserId':{'type':Sequelize[_0x5288('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5288('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5288('0x5')],'defaultValue':Sequelize[_0x5288('0x6')]},'dialTimezone':{'type':Sequelize[_0x5288('0x2')]},'utcOffset':{'type':Sequelize[_0x5288('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index c5aeaaf..e2407e3 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 _0x34bd=['ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','FaxQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','spread','contact','Phones','ContactItemType','literal','Phones.OrderBy','$and','format','cf_%d','findAll','omit','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','findOne','options','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','PHONE','`ItemType`.OrderBy','CmHopperId','ItemType','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','toContactId','getHoppers','rawAttributes','getHopperHistories','ContactId','includeAll','include','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','createReadStream','parse','import','binding','socket_timestamp','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','importUpdates','../../components/import/cm/csvUpdates','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','whatsapp','voice','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userSecondDisposition','fullname','VoiceCallReport','findAndCountAll','startCase','Account','closed','closedAt','note','disposition','secondDisposition','thirdDisposition','UserId','Owner','DESC','browserName','customerIp','deviceModel','ratingMessage','ratingType','ratingValue','substatus','externalUrl','Interaction','flatten','sortBy','reverse','slice','moment','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','update','destroy','then','sendStatus','stack','name','index','describe','keys','startsWith','push','CmCustomField','trimStart','cf_','all','length','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','select','field','color','from','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','expr','search','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','datetime','buildExpression','type','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','where','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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?','c.id','Sequelize','QueryTypes','SELECT','clone','order','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','Tags','TagIds','rows','params','catch','tags','columnName','displayName','alias','values','body','get','mergeWith','isArray','join','info','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create'];(function(_0x220ae9,_0x1d9cfa){var _0x164801=function(_0x285bec){while(--_0x285bec){_0x220ae9['push'](_0x220ae9['shift']());}};_0x164801(++_0x1d9cfa);}(_0x34bd,0x1d2));var _0xd34b=function(_0xdf5fc5,_0x37255b){_0xdf5fc5=_0xdf5fc5-0x0;var _0x52f5a5=_0x34bd[_0xdf5fc5];return _0x52f5a5;};'use strict';var moment=require(_0xd34b('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xd34b('0x1'));var fs=require('fs');var _=require(_0xd34b('0x2'));var squel=require(_0xd34b('0x3'));var Papa=require(_0xd34b('0x4'));var Redis=require(_0xd34b('0x5'));var qs=require(_0xd34b('0x6'));var as=require(_0xd34b('0x7'));var logger=require('../../config/logger')(_0xd34b('0x8'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0xd34b('0x9')]=_[_0xd34b('0xa')](config[_0xd34b('0x9')],{'host':_0xd34b('0xb'),'port':0x18eb});var socket=require(_0xd34b('0xc'))(new Redis(config[_0xd34b('0x9')]));require(_0xd34b('0xd'))[_0xd34b('0xe')](socket);function respondWithResult(_0x460dcf,_0xa9672d){_0xa9672d=_0xa9672d||0xc8;return function(_0xb94ed2){if(_0xb94ed2){return _0x460dcf[_0xd34b('0xf')](_0xa9672d)['json'](_0xb94ed2);}};}function respondWithFilteredResult(_0x1f22e6,_0x52aba1){return function(_0x449bc1){if(_0x449bc1){var _0x2e0e8c=typeof _0x52aba1[_0xd34b('0x10')]===_0xd34b('0x11')&&typeof _0x52aba1[_0xd34b('0x12')]===_0xd34b('0x11');var _0x5b6e2d=_0x449bc1[_0xd34b('0x13')];var _0x3af475=_0x2e0e8c?0x0:_0x52aba1['offset'];var _0x14e108=_0x2e0e8c?_0x449bc1[_0xd34b('0x13')]:_0x52aba1[_0xd34b('0x10')]+_0x52aba1['limit'];var _0x326f00;if(_0x14e108>=_0x5b6e2d){_0x14e108=_0x5b6e2d;_0x326f00=0xc8;}else{_0x326f00=0xce;}_0x1f22e6[_0xd34b('0xf')](_0x326f00);return _0x1f22e6['set'](_0xd34b('0x14'),_0x3af475+'-'+_0x14e108+'/'+_0x5b6e2d)['json'](_0x449bc1);}return null;};}function saveUpdates(_0xe11907){return function(_0x438b61){if(_0x438b61){return _0x438b61[_0xd34b('0x15')](_0xe11907)['then'](function(_0x152c8d){return _0x152c8d;});}return null;};}function removeEntity(_0x193965){return function(_0x1bbbb1){if(_0x1bbbb1){return _0x1bbbb1[_0xd34b('0x16')]()[_0xd34b('0x17')](function(){_0x193965['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16cab0){return function(_0x327b91){if(!_0x327b91){_0x16cab0[_0xd34b('0x18')](0x194);}return _0x327b91;};}function handleError(_0x1e4523,_0x291a00){_0x291a00=_0x291a00||0x1f4;return function(_0x3152a9){logger['error'](_0x3152a9[_0xd34b('0x19')]);if(_0x3152a9[_0xd34b('0x1a')]){delete _0x3152a9[_0xd34b('0x1a')];}_0x1e4523[_0xd34b('0xf')](_0x291a00)['send'](_0x3152a9);};}exports[_0xd34b('0x1b')]=function(_0x259abb,_0x92bcb3){var _0x219673={},_0x3a0972={},_0x27eb68={'count':0x0,'rows':[]};return db['CmContact'][_0xd34b('0x1c')]()['then'](function(_0x2187c0){var _0x2ae0e1=[];for(var _0x54c88a=0x0;_0x54c88a0x1){_0x3f9aeb['or'](_0xd34b('0x56'),qs['getFullTextValue'](_0x371e25),null);}else{if(qs[_0xd34b('0x57')](_0x371e25)){_0x3f9aeb['or'](_0xd34b('0x58'),_0x371e25+'%');_0x3f9aeb['or'](_0xd34b('0x59'),_0x371e25+'%');_0x3f9aeb['or'](_0xd34b('0x5a'),_0x371e25+'%');_0x3f9aeb['or'](_0xd34b('0x5b'),_0x371e25+'%');}else if(qs[_0xd34b('0x5c')](_0x371e25)){_0x3f9aeb['or'](_0xd34b('0x5d'),_0x371e25+'%');}else{_0x3f9aeb['or']('c.firstName\x20LIKE\x20?','%'+_0x371e25+'%');_0x3f9aeb['or'](_0xd34b('0x5e'),'%'+_0x371e25+'%');_0x3f9aeb['or'](_0xd34b('0x5d'),'%'+_0x371e25+'%');}}}}_0x1538c3[_0xd34b('0x51')](_0x3f9aeb);_0x1538c3['group'](_0xd34b('0x5f'));var _0x184ac4={'type':db[_0xd34b('0x60')][_0xd34b('0x61')][_0xd34b('0x62')],'raw':!![]};var _0x29b4c0=_0x1538c3[_0xd34b('0x63')]()[_0xd34b('0x31')]('c.id');if(_0x219673[_0xd34b('0x64')]){_0x219673[_0xd34b('0x64')]['forEach'](function(_0x2a7d3f){_0x1538c3[_0xd34b('0x64')]('c.'+_0x2a7d3f[0x0],_0x2a7d3f[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x1c9365)){_0x1538c3[_0xd34b('0x65')](_0x158f43);_0x29b4c0[_0xd34b('0x51')](_0xd34b('0x66'),_0x1c9365);}BPromise[_0xd34b('0x67')]()['then'](function(){if(!_0x403279)return;if(_0x259abb[_0xd34b('0x68')][_0xd34b('0x69')]!==_0xd34b('0x6a'))return;if(!_[_0xd34b('0x6b')](_0x403279[_0xd34b('0x3d')],['field',_0xd34b('0x45')])){return _0x259abb[_0xd34b('0x68')][_0xd34b('0x6c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x6c120a){if(_[_0xd34b('0x4d')](_0x6c120a)){_0x29b4c0[_0xd34b('0x51')](_0xd34b('0x6d'));_0x1538c3[_0xd34b('0x51')](_0xd34b('0x6d'));}else{_0x29b4c0[_0xd34b('0x51')]('c.ListId\x20IN\x20?',_['map'](_0x6c120a,'id'));_0x1538c3[_0xd34b('0x51')]('c.ListId\x20IN\x20?',_[_0xd34b('0x42')](_0x6c120a,'id'));}});}})[_0xd34b('0x17')](function(){if(_0x259abb[_0xd34b('0x68')]['role']==='agent'&&!_0x403279&&!_0x259abb[_0xd34b('0x27')][_0xd34b('0x4e')])return[];return db[_0xd34b('0x6e')][_0xd34b('0x27')](_0x29b4c0['toString'](),_0x184ac4);})['then'](function(_0x453f66){_0x27eb68[_0xd34b('0x13')]=_0x453f66[_0xd34b('0x24')];if(_0x27eb68['count']===0x0)return[];return db['sequelize'][_0xd34b('0x27')](_0x54b77a[_0xd34b('0x6f')](),_0x184ac4)[_0xd34b('0x17')](function(_0x13a2d1){_0x52e966=_[_0xd34b('0x70')](_0x13a2d1,'id');_0x184ac4=_[_0xd34b('0x71')](_0x184ac4,{'model':db[_0xd34b('0x72')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x259abb[_0xd34b('0x27')][_0xd34b('0x2b')]){_0x219673[_0xd34b('0x2a')]['forEach'](function(_0x235a18){_0x1538c3[_0xd34b('0x31')]('c.'+_0x235a18);});}else{_0x1538c3[_0xd34b('0x31')](_0xd34b('0x5f'));_0x1538c3[_0xd34b('0x31')](_0xd34b('0x73'));_0x1538c3[_0xd34b('0x31')](_0xd34b('0x74'));_0x1538c3[_0xd34b('0x31')](_0xd34b('0x75'));_0x1538c3[_0xd34b('0x31')](_0xd34b('0x76'));_0x1538c3['field']('c.fax');_0x1538c3['field'](_0xd34b('0x77'));_0x1538c3['field'](_0xd34b('0x78'));_0x1538c3[_0xd34b('0x31')]('c.createdAt');_0x1538c3[_0xd34b('0x31')](_0xd34b('0x79'));_0x1538c3['field'](_0xd34b('0x7a'));_0x1538c3['field'](_0xd34b('0x7b'),'TagIds');}if(_0x219673[_0xd34b('0x12')])_0x1538c3[_0xd34b('0x12')](_0x219673[_0xd34b('0x12')]);if(_0x219673[_0xd34b('0x10')])_0x1538c3[_0xd34b('0x10')](_0x219673[_0xd34b('0x10')]);return db['sequelize']['query'](_0x1538c3['toString'](),_0x184ac4);});})[_0xd34b('0x17')](function(_0x2171fb){_0x2171fb[_0xd34b('0x43')](function(_0x2ab2ae){if(_0x2ab2ae['TagIds']){_0x2ab2ae[_0xd34b('0x7c')]=[];_0x2ab2ae[_0xd34b('0x7d')]['split'](',')['forEach'](function(_0x324fb6){_0x2ab2ae[_0xd34b('0x7c')][_0xd34b('0x1f')](_0x52e966[_0x324fb6]);});}delete _0x2ab2ae[_0xd34b('0x7d')];});_0x27eb68[_0xd34b('0x7e')]=_0x2171fb;return _0x27eb68;})[_0xd34b('0x17')](respondWithFilteredResult(_0x92bcb3,_0x219673));})['catch'](handleError(_0x92bcb3,null));};exports[_0xd34b('0x16')]=function(_0x55a73c,_0x4a6ba7){return db[_0xd34b('0x72')][_0xd34b('0x3e')]({'where':{'id':_0x55a73c[_0xd34b('0x7f')]['id']}})[_0xd34b('0x17')](handleEntityNotFound(_0x4a6ba7,null))[_0xd34b('0x17')](removeEntity(_0x4a6ba7,null))[_0xd34b('0x80')](handleError(_0x4a6ba7,null));};exports[_0xd34b('0x1c')]=function(_0x3c41f6,_0x26e7a2){return db[_0xd34b('0x72')][_0xd34b('0x1c')]()[_0xd34b('0x17')](function(_0x3ce0a1){delete _0x3ce0a1[_0xd34b('0x81')];for(var _0x57ff0b=0x0;_0x57ff0b0x0){return new Promise(function(_0xd02588,_0x530f33){var _0x35046e=[];for(var _0x17fd84=0x0;_0x17fd84<_0x5c58c7[_0xd34b('0x24')];_0x17fd84++){_0x35046e['push'](insertAdditionalPhones(_0x5c58c7[_0x17fd84][_0xd34b('0xab')],_0x5c58c7[_0x17fd84][_0xd34b('0xa6')]));}Promise[_0xd34b('0x23')](_0x35046e)[_0xd34b('0x17')](function(){_0xd02588(0x1);});})[_0xd34b('0x17')](function(){return{'success':_0x364c57,'failure':_0x5bdca1,'duplicates':_0x200c2f};});}else{return{'success':_0x364c57,'failure':_0x5bdca1,'duplicates':_0x200c2f};}}})[_0xd34b('0x17')](respondWithResult(_0x4fcceb,0xc9))['catch'](handleError(_0x4fcceb,null));};exports['show']=function(_0x5edcc9,_0x2c5b1a){var _0x48724a;return db[_0xd34b('0x72')][_0xd34b('0x1c')]()[_0xd34b('0x17')](function(_0xffb5bb){return db[_0xd34b('0x72')][_0xd34b('0x3e')]({'where':{'id':_0x5edcc9['params']['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id',_0xd34b('0x1a'),'color'],'required':_0x5edcc9[_0xd34b('0x27')][_0xd34b('0x54')]?!![]:![]},{'model':db[_0xd34b('0x9b')],'as':_0xd34b('0xac'),'where':{'CmContactId':_0x5edcc9[_0xd34b('0x7f')]['id']},'required':![],'include':[{'model':db[_0xd34b('0xad')],'as':'ItemType'}]}],'order':[db[_0xd34b('0x6e')][_0xd34b('0xae')](_0xd34b('0xaf'))],'attributes':_[_0xd34b('0x1d')](_0xffb5bb)});})[_0xd34b('0x17')](function(_0x5c7b1b){if(!_['isNil'](_0x5c7b1b)){_0x48724a=_0x5c7b1b[_0xd34b('0x87')]({'plain':!![]});var _0x5f7174={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5c7b1b&&_0x5c7b1b[_0xd34b('0x4e')]){if(_0x5c7b1b[_0xd34b('0x4e')]){_0x5f7174['where'][_0xd34b('0xb0')][_0xd34b('0x1f')]({'ListId':{'$ne':_0x5c7b1b[_0xd34b('0x4e')]}});}}return db[_0xd34b('0x20')]['findAll'](_0x5f7174);}})[_0xd34b('0x17')](function(_0x1d0334){if(!_[_0xd34b('0x4b')](_0x1d0334)){return _['omit'](_0x48724a,_[_0xd34b('0x42')](_0x1d0334,function(_0x2d6fb4){return util[_0xd34b('0xb1')](_0xd34b('0xb2'),_0x2d6fb4['id']);}));}})[_0xd34b('0x17')](handleEntityNotFound(_0x2c5b1a,null))[_0xd34b('0x17')](respondWithResult(_0x2c5b1a,null))['catch'](handleError(_0x2c5b1a,null));};exports[_0xd34b('0x15')]=function(_0x3546f7,_0xb1d91f){var _0x40aa3c;if(_0x3546f7[_0xd34b('0x86')]['id']){delete _0x3546f7['body']['id'];}if(!_[_0xd34b('0x4b')](_0x3546f7[_0xd34b('0x86')][_0xd34b('0xa3')])){var _0xedf3c0=_0x3546f7[_0xd34b('0x86')]['dialTimezone'];if(!_['isNil'](shared[_0xd34b('0xa4')][_0xedf3c0]))_0x3546f7[_0xd34b('0x86')][_0xd34b('0xa5')]=shared['timezones'][_0xedf3c0][_0xd34b('0xa5')];}return db[_0xd34b('0x72')]['find']({'where':{'id':_0x3546f7[_0xd34b('0x7f')]['id']}})['then'](handleEntityNotFound(_0xb1d91f,null))['then'](saveUpdates(_0x3546f7['body'],null))[_0xd34b('0x17')](function(_0x2c93b3){_0x40aa3c=_0x2c93b3;var _0x48fbcd={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2c93b3&&_0x2c93b3['ListId']){if(_0x2c93b3[_0xd34b('0x4e')]){_0x48fbcd[_0xd34b('0x51')][_0xd34b('0xb0')][_0xd34b('0x1f')]({'ListId':{'$ne':_0x2c93b3[_0xd34b('0x4e')]}});}}return db[_0xd34b('0x20')][_0xd34b('0xb3')](_0x48fbcd);})[_0xd34b('0x17')](function(_0x534f7e){if(_0x534f7e){return _[_0xd34b('0xb4')](_[_0xd34b('0xb5')](_0x3546f7[_0xd34b('0x86')],function(_0x5a993e,_0x2d84b4){return _[_0xd34b('0x1e')](_0x2d84b4,_0xd34b('0x22'));}),_['map'](_0x534f7e,function(_0x170de6){return util[_0xd34b('0xb1')](_0xd34b('0xb2'),_0x170de6['id']);}));}})[_0xd34b('0x17')](function(_0x4b2e11){if(_0x4b2e11&&!_[_0xd34b('0x4d')](_0x4b2e11)){var _0x94c6aa=squel[_0xd34b('0x15')]()[_0xd34b('0xb6')]('cm_contacts')[_0xd34b('0xb7')](_0x4b2e11)[_0xd34b('0x51')](_0xd34b('0xb8'),_0x3546f7[_0xd34b('0x7f')]['id'])[_0xd34b('0xb9')]();return db[_0xd34b('0x6e')][_0xd34b('0x27')](_0x94c6aa['text'],{'replacements':_0x94c6aa[_0xd34b('0x85')]});}})[_0xd34b('0x17')](function(){if(_0x3546f7['body'][_0xd34b('0xba')]&&_0x40aa3c){return db[_0xd34b('0x8c')]['update']({'phone':_0x3546f7[_0xd34b('0x86')][_0xd34b('0xba')],'OrderBy':0x0},{'where':{'ContactId':_0x40aa3c['id']}});}})['then'](function(){return _0x40aa3c;})[_0xd34b('0x17')](respondWithResult(_0xb1d91f,null))[_0xd34b('0x80')](handleError(_0xb1d91f,null));};exports[_0xd34b('0xbb')]=function(_0x5591cb,_0x2a2265){var _0x271891={};var _0x55edcc={};var _0x47ad28;var _0x16d692;return db[_0xd34b('0x72')][_0xd34b('0xbc')]({'where':{'id':_0x5591cb[_0xd34b('0x7f')]['id']}})[_0xd34b('0x17')](handleEntityNotFound(_0x2a2265,null))[_0xd34b('0x17')](function(_0x518f51){if(_0x518f51){_0x47ad28=_0x518f51;_0x55edcc[_0xd34b('0x26')]=_[_0xd34b('0x1d')](db[_0xd34b('0x3f')]['rawAttributes']);_0x55edcc[_0xd34b('0x27')]=_['keys'](_0x5591cb[_0xd34b('0x27')]);_0x55edcc[_0xd34b('0x28')]=_[_0xd34b('0x29')](_0x55edcc['model'],_0x55edcc[_0xd34b('0x27')]);_0x271891[_0xd34b('0x2a')]=_[_0xd34b('0x29')](_0x55edcc[_0xd34b('0x26')],qs[_0xd34b('0x2b')](_0x5591cb['query'][_0xd34b('0x2b')]));_0x271891[_0xd34b('0x2a')]=_0x271891[_0xd34b('0x2a')][_0xd34b('0x24')]?_0x271891[_0xd34b('0x2a')]:_0x55edcc[_0xd34b('0x26')];_0x271891[_0xd34b('0x64')]=qs[_0xd34b('0x2e')](_0x5591cb[_0xd34b('0x27')][_0xd34b('0x2e')]);_0x271891[_0xd34b('0x51')]=qs[_0xd34b('0x28')](_[_0xd34b('0x2f')](_0x5591cb[_0xd34b('0x27')],_0x55edcc[_0xd34b('0x28')]));if(_0x5591cb[_0xd34b('0x27')][_0xd34b('0x4a')]){_0x271891[_0xd34b('0x51')]=_[_0xd34b('0x71')](_0x271891[_0xd34b('0x51')],{'$or':_[_0xd34b('0x42')](_0x271891[_0xd34b('0x2a')],function(_0x4538d9){var _0x306077={};_0x306077[_0x4538d9]={'$like':'%'+_0x5591cb[_0xd34b('0x27')][_0xd34b('0x4a')]+'%'};return _0x306077;})});}_0x271891=_[_0xd34b('0x71')]({},_0x271891,_0x5591cb[_0xd34b('0xbd')]);return _0x47ad28['getTags'](_0x271891);}})[_0xd34b('0x17')](function(_0x4058bf){if(_0x4058bf){_0x16d692=_0x4058bf[_0xd34b('0x24')];if(!_0x5591cb[_0xd34b('0x27')][_0xd34b('0x2c')](_0xd34b('0x2d'))){_0x271891[_0xd34b('0x12')]=qs[_0xd34b('0x12')](_0x5591cb['query'][_0xd34b('0x12')]);_0x271891[_0xd34b('0x10')]=qs[_0xd34b('0x10')](_0x5591cb[_0xd34b('0x27')]['offset']);}return _0x47ad28['getTags'](_0x271891);}})[_0xd34b('0x17')](function(_0x3b9812){if(_0x3b9812){return _0x3b9812?{'count':_0x16d692,'rows':_0x3b9812}:null;}})[_0xd34b('0x17')](respondWithResult(_0x2a2265,null))[_0xd34b('0x80')](handleError(_0x2a2265,null));};exports[_0xd34b('0xbe')]=function(_0x39ad1f,_0x46ddac){if(_0x39ad1f[_0xd34b('0x86')]['id']){delete _0x39ad1f[_0xd34b('0x86')]['id'];}return db[_0xd34b('0x72')][_0xd34b('0xbc')]({'where':{'id':_0x39ad1f['params']['id']}})[_0xd34b('0x17')](handleEntityNotFound(_0x46ddac,null))[_0xd34b('0x17')](function(_0x476f57){if(_0x476f57){return _0x476f57[_0xd34b('0xbe')](_0x39ad1f[_0xd34b('0x86')][_0xd34b('0xbf')]||[]);}return null;})[_0xd34b('0x17')](respondWithResult(_0x46ddac,null))[_0xd34b('0x80')](handleError(_0x46ddac,null));};exports[_0xd34b('0xc0')]=function(_0x55309f,_0x59b181){var _0x954933=[];_0x954933[_0xd34b('0x1f')](addAdditionalPhones(_0x55309f[_0xd34b('0x86')]));Promise[_0xd34b('0x23')](_0x954933)[_0xd34b('0x17')](function(){_0x954933=[];_0x954933[_0xd34b('0x1f')](deleteCmHopperPhones(_0x55309f[_0xd34b('0x86')]['id']));_0x954933['push'](addCmHopperPhones(_0x55309f[_0xd34b('0x86')]['id']));Promise['all'](_0x954933)[_0xd34b('0x17')](function(){return[0x1];})[_0xd34b('0x17')](respondWithResult(_0x59b181,null));});};function addAdditionalPhones(_0x44044c){var _0x3fa752;return new Promise(function(_0x50d84d,_0x2d13b3){return db[_0xd34b('0x9b')]['destroy']({'where':{'CmContactId':_0x44044c['id']}})[_0xd34b('0x17')](function(){db[_0xd34b('0xad')][_0xd34b('0xb3')]({'raw':!![],'attributes':['id',_0xd34b('0xc1')]})[_0xd34b('0x17')](function(_0x14e055){var _0x4d1039=[];for(var _0x401f5d=0x0;_0x401f5d<_0x44044c[_0xd34b('0xc2')][_0xd34b('0x24')];_0x401f5d++){var _0x191a34=_0x44044c[_0xd34b('0xc3')]?_[_0xd34b('0x4b')](_0x44044c[_0xd34b('0xc3')][_0x401f5d])?'':_0x44044c[_0xd34b('0xc3')][_0x401f5d]:_0x44044c[_0xd34b('0xc2')][_0x401f5d][_0xd34b('0xc4')]?_0x44044c[_0xd34b('0xc2')][_0x401f5d][_0xd34b('0xc4')]:'';var _0x2152cb=_[_0xd34b('0x4b')](_0x44044c[_0xd34b('0xc2')][_0x401f5d][_0xd34b('0xc5')])?'':_0x44044c[_0xd34b('0xc2')][_0x401f5d][_0xd34b('0xc5')];var _0x19818d=_0x191a34+':'+_0x44044c[_0xd34b('0xc2')][_0x401f5d][_0xd34b('0xba')]+'§'+_0x2152cb;if(_[_0xd34b('0x4b')](_0x3fa752))_0x3fa752=_0x19818d;else _0x3fa752+=';'+_0x19818d;var _0x6faddf=null;if(_0x44044c[_0xd34b('0xc3')]){if(!_[_0xd34b('0x4b')](_0x44044c[_0xd34b('0xc3')][_0x401f5d])){var _0x1304d4=_['find'](_0x14e055,function(_0x4fe5ec){return _0x4fe5ec['id']===_0x44044c[_0xd34b('0xc3')][_0x401f5d];});if(!_['isNil'](_0x1304d4)){_0x6faddf=_0x1304d4[_0xd34b('0xc1')];}}}else{if(!_['isNil'](_0x44044c[_0xd34b('0xc2')][_0x401f5d])){var _0x1304d4=_[_0xd34b('0x3e')](_0x14e055,function(_0x36c979){return _0x36c979['id']===_0x44044c[_0xd34b('0xc2')][_0x401f5d][_0xd34b('0xc4')];});if(!_[_0xd34b('0x4b')](_0x1304d4)){_0x6faddf=_0x401f5d;}}}if(_[_0xd34b('0x4b')](_0x6faddf)){_0x6faddf=0x64;}_0x4d1039[_0xd34b('0x1f')](addAdditionalPhone(_0x44044c['id'],_0x44044c['items'][_0x401f5d][_0xd34b('0xba')],_0x44044c[_0xd34b('0xc3')]?_[_0xd34b('0x4b')](_0x44044c[_0xd34b('0xc3')][_0x401f5d])?null:_0x44044c[_0xd34b('0xc3')][_0x401f5d]:_0x44044c[_0xd34b('0xc2')][_0x401f5d][_0xd34b('0xc4')]?_0x44044c[_0xd34b('0xc2')][_0x401f5d][_0xd34b('0xc4')]:null,_0x6faddf,_0x2152cb));}Promise[_0xd34b('0x23')](_0x4d1039)[_0xd34b('0x17')](function(){db['CmContact'][_0xd34b('0x15')]({'AdditionalPhones':_0x3fa752},{'where':{'id':_0x44044c['id']}})[_0xd34b('0x17')](function(){_0x50d84d(0x1);});});});});});}function addAdditionalPhone(_0x5d1da1,_0x22e524,_0x222616,_0x4df4d2,_0x2bddcc){return db['CmContactHasItem'][_0xd34b('0x3e')]({'where':{'CmContactId':_0x5d1da1,'item':_0x22e524}})[_0xd34b('0x17')](function(_0x26ac28){if(_0x26ac28)logger[_0xd34b('0x8b')](_0xd34b('0xc6'),_0x26ac28);else{db[_0xd34b('0x9b')][_0xd34b('0x8f')]({'CmContactId':_0x5d1da1,'item':_0x22e524,'ItemTypeId':_0x222616,'OrderBy':_0x4df4d2,'ItemClass':'PHONE','description':_0x2bddcc});}});}function deletePhones(_0xa6500d){return db[_0xd34b('0x9b')][_0xd34b('0x16')]({'where':{'CmContactId':_0xa6500d}});}function deleteCmHopperPhones(_0x517f64){return new Promise(function(_0x5706cb,_0x2e2fa7){return db['CmHopper'][_0xd34b('0xb3')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x517f64}})[_0xd34b('0x17')](function(_0x57a2dd){db[_0xd34b('0xc7')][_0xd34b('0x16')]({'where':{'CmHopperId':{'$in':_[_0xd34b('0x42')](_0x57a2dd,'id')}}});})[_0xd34b('0x17')](function(){_0x5706cb(0x1);});});}function addCmHopperPhones(_0xa1959f){return new Promise(function(_0x3bb7a6,_0x13f671){return db[_0xd34b('0x8c')][_0xd34b('0xb3')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xa1959f}})[_0xd34b('0x17')](function(_0x29dd51){var _0x3b497d=[];_[_0xd34b('0x42')](_0x29dd51,function(_0x270161){_0x3b497d[_0xd34b('0x1f')](createCmHopperPhone(_0xa1959f,_0x270161['id']));});Promise[_0xd34b('0x23')](_0x3b497d)[_0xd34b('0x17')](function(){_0x3bb7a6(0x1);});});});}function createCmHopperPhone(_0x44d5bc,_0x396d60){return new Promise(function(_0x55fc61,_0x5892cc){db['CmContactHasItem'][_0xd34b('0xb3')]({'raw':!![],'attributes':[_0xd34b('0xc8'),_0xd34b('0xc1')],'where':{'CmContactId':_0x44d5bc,'ItemClass':_0xd34b('0xc9')},'include':[{'model':db[_0xd34b('0xad')],'attributes':['OrderBy'],'as':'ItemType'}],'order':[_0xd34b('0xc1'),db[_0xd34b('0x6e')][_0xd34b('0xae')](_0xd34b('0xca'))]})[_0xd34b('0x17')](function(_0x11c130){var _0x39e49c=0x1;var _0x5c32cb=_[_0xd34b('0x42')](_0x11c130,function(_0x5f223a){_0x5f223a[_0xd34b('0xcb')]=_0x396d60;_0x5f223a[_0xd34b('0xba')]=_0x5f223a[_0xd34b('0xc8')];_0x5f223a[_0xd34b('0xc1')]=_0x39e49c;delete _0x5f223a['ItemType.OrderBy'];_0x39e49c=_0x39e49c+0x1;return _0x5f223a;});return db['CmHopperAdditionalPhone'][_0xd34b('0xa7')](_0x5c32cb,{});})['then'](function(){_0x55fc61(0x1);});});}function insertAdditionalPhones(_0x3a99f3,_0x4768ae){return new Promise(function(_0x50cdfe,_0x262e44){var _0x203049=[];for(var _0x2c2047=0x0;_0x2c2047<_0x4768ae[_0xd34b('0x24')];_0x2c2047++){var _0x80c2b1=_0x4768ae[_0x2c2047];_0x203049[_0xd34b('0x1f')](parseContactItemType(_0x80c2b1));}Promise[_0xd34b('0x23')](_0x203049)['then'](function(){var _0x2ba780={'id':_0x3a99f3['id'],'items':_0x4768ae};return addAdditionalPhones(_0x2ba780)[_0xd34b('0x17')](function(_0x14dda1){return addCmHopperPhones(_0x3a99f3['id']);});})[_0xd34b('0x17')](function(){_0x50cdfe(_0x3a99f3);});});}function parseContactItemType(_0x482f88){return new Promise(function(_0x40b288,_0x437c1f){if(_0x482f88['hasOwnProperty']('ItemTypeId')){_0x40b288(_0x482f88);}else{return db[_0xd34b('0xad')][_0xd34b('0x3e')]({'where':{'name':_0x482f88[_0xd34b('0xcc')]}})['then'](function(_0x4f87bd){if(_[_0xd34b('0x4b')](_0x4f87bd))_0x482f88['ItemTypeId']=null;else _0x482f88['ItemTypeId']=_0x4f87bd['id'];_0x40b288(_0x482f88);});}});}exports[_0xd34b('0xcd')]=function(_0x521ca3,_0x3961ca){return db[_0xd34b('0x9b')][_0xd34b('0xb3')]({'raw':!![],'where':{'CmContactId':_0x521ca3['params']['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0xd34b('0xad')],'as':_0xd34b('0xcc')}],'order':[[db[_0xd34b('0x6e')][_0xd34b('0xae')](_0xd34b('0xca'))],[_0xd34b('0xc1')]]})[_0xd34b('0x17')](function(_0x381a50){return _0x381a50;})['then'](respondWithResult(_0x3961ca,null))[_0xd34b('0x80')](handleError(_0x3961ca,null));};exports[_0xd34b('0xce')]=function(_0x14ce50,_0x3d891e){return db[_0xd34b('0x9b')][_0xd34b('0xb3')]({'raw':!![],'where':{'CmContactId':_0x14ce50[_0xd34b('0x86')][_0xd34b('0xcf')]}})[_0xd34b('0x17')](function(_0x1a5b64){var _0x9df2f8=_[_0xd34b('0x42')](_0x1a5b64,function(_0x212aca){_0x212aca['CmContactId']=_0x14ce50[_0xd34b('0x86')]['toContactId'];return _0x212aca;});return db[_0xd34b('0x9b')][_0xd34b('0xa7')](_0x9df2f8,{});})[_0xd34b('0x17')](function(_0x37cd6b){return addCmHopperPhones(_0x14ce50[_0xd34b('0x86')][_0xd34b('0xd0')]);})[_0xd34b('0x17')](function(_0x3fa07b){return['ok'];})['then'](respondWithResult(_0x3d891e,null))['catch'](handleError(_0x3d891e,null));};exports['rescheduleAdditionalPhones']=function(_0xd1ba3e,_0x852f44){var _0x565da9=[];_0x565da9[_0xd34b('0x1f')](createCmHopperPhone(_0xd1ba3e['body']['id'],_0xd1ba3e[_0xd34b('0x86')]['hopperId']));Promise['all'](_0x565da9)[_0xd34b('0x17')](function(){return[0x1];})[_0xd34b('0x17')](respondWithResult(_0x852f44,null));};exports[_0xd34b('0xd1')]=function(_0x12ae8e,_0xabb222){var _0x2f1f48={'raw':![],'where':{}};var _0x32a370={};var _0x2aaa07={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x12ae8e['params']['id']}})[_0xd34b('0x17')](handleEntityNotFound(_0xabb222,null))['then'](function(_0x2691fa){if(_0x2691fa){_0x32a370[_0xd34b('0x26')]=_[_0xd34b('0x1d')](db[_0xd34b('0x8c')][_0xd34b('0xd2')]);_0x32a370['query']=_[_0xd34b('0x1d')](_0x12ae8e[_0xd34b('0x27')]);_0x32a370[_0xd34b('0x28')]=_[_0xd34b('0x29')](_0x32a370[_0xd34b('0x26')],_0x32a370[_0xd34b('0x27')]);_0x2f1f48[_0xd34b('0x2a')]=_[_0xd34b('0x29')](_0x32a370[_0xd34b('0x26')],qs['fields'](_0x12ae8e['query'][_0xd34b('0x2b')]));_0x2f1f48['attributes']=_0x2f1f48[_0xd34b('0x2a')]['length']?_0x2f1f48[_0xd34b('0x2a')]:_0x32a370[_0xd34b('0x26')];if(!_0x12ae8e[_0xd34b('0x27')][_0xd34b('0x2c')](_0xd34b('0x2d'))){_0x2f1f48[_0xd34b('0x12')]=qs['limit'](_0x12ae8e[_0xd34b('0x27')]['limit']);_0x2f1f48[_0xd34b('0x10')]=qs['offset'](_0x12ae8e[_0xd34b('0x27')][_0xd34b('0x10')]);}_0x2f1f48['order']=qs['sort'](_0x12ae8e[_0xd34b('0x27')][_0xd34b('0x2e')]);_0x2f1f48[_0xd34b('0x51')]=qs['filters'](_[_0xd34b('0x2f')](_0x12ae8e[_0xd34b('0x27')],_0x32a370[_0xd34b('0x28')]));_0x2f1f48[_0xd34b('0x51')]['ContactId']=_0x2691fa['id'];if(_0x12ae8e[_0xd34b('0x27')][_0xd34b('0x4a')]){_0x2f1f48[_0xd34b('0x51')]=_[_0xd34b('0x71')](_0x2f1f48['where'],{'$or':_[_0xd34b('0x42')](_0x2f1f48['attributes'],function(_0x347b0f){var _0x27b633={};_0x27b633[_0x347b0f]={'$like':'%'+_0x12ae8e[_0xd34b('0x27')][_0xd34b('0x4a')]+'%'};return _0x27b633;})});}_0x2f1f48=_[_0xd34b('0x71')]({},_0x2f1f48,_0x12ae8e['options']);return db[_0xd34b('0x8c')]['count']({'where':_0x2f1f48[_0xd34b('0x51')]})['then'](function(_0x1f30f2){_0x2aaa07['count']=_0x1f30f2;if(_0x12ae8e[_0xd34b('0x27')]['includeAll']){_0x2f1f48['include']=[{'all':!![]}];}return db[_0xd34b('0x8c')][_0xd34b('0xb3')](_0x2f1f48);})[_0xd34b('0x17')](function(_0x94f3c){_0x2aaa07[_0xd34b('0x7e')]=_0x94f3c;return _0x2aaa07;});}})[_0xd34b('0x17')](respondWithFilteredResult(_0xabb222,_0x2f1f48))[_0xd34b('0x80')](handleError(_0xabb222,null));};exports[_0xd34b('0xd3')]=function(_0x4cbde7,_0x230021){var _0x426268={'raw':!![],'where':{}};var _0x1567ab={};var _0x2cfe4c={'count':0x0,'rows':[]};return db['CmContact'][_0xd34b('0xbc')]({'where':{'id':_0x4cbde7['params']['id']}})['then'](handleEntityNotFound(_0x230021,null))['then'](function(_0x4e3507){if(_0x4e3507){_0x1567ab[_0xd34b('0x26')]=_[_0xd34b('0x1d')](db['CmHopperHistory']['rawAttributes']);_0x1567ab['query']=_[_0xd34b('0x1d')](_0x4cbde7['query']);_0x1567ab[_0xd34b('0x28')]=_[_0xd34b('0x29')](_0x1567ab[_0xd34b('0x26')],_0x1567ab[_0xd34b('0x27')]);_0x426268[_0xd34b('0x2a')]=_['intersection'](_0x1567ab[_0xd34b('0x26')],qs[_0xd34b('0x2b')](_0x4cbde7[_0xd34b('0x27')][_0xd34b('0x2b')]));_0x426268['attributes']=_0x426268[_0xd34b('0x2a')][_0xd34b('0x24')]?_0x426268[_0xd34b('0x2a')]:_0x1567ab[_0xd34b('0x26')];if(!_0x4cbde7[_0xd34b('0x27')][_0xd34b('0x2c')]('nolimit')){_0x426268['limit']=qs[_0xd34b('0x12')](_0x4cbde7['query'][_0xd34b('0x12')]);_0x426268[_0xd34b('0x10')]=qs['offset'](_0x4cbde7[_0xd34b('0x27')][_0xd34b('0x10')]);}_0x426268[_0xd34b('0x64')]=qs[_0xd34b('0x2e')](_0x4cbde7[_0xd34b('0x27')][_0xd34b('0x2e')]);_0x426268[_0xd34b('0x51')]=qs['filters'](_[_0xd34b('0x2f')](_0x4cbde7['query'],_0x1567ab[_0xd34b('0x28')]));_0x426268[_0xd34b('0x51')][_0xd34b('0xd4')]=_0x4e3507['id'];if(_0x4cbde7[_0xd34b('0x27')]['filter']){_0x426268[_0xd34b('0x51')]=_[_0xd34b('0x71')](_0x426268['where'],{'$or':_[_0xd34b('0x42')](_0x426268[_0xd34b('0x2a')],function(_0x3a3a15){var _0x42798e={};_0x42798e[_0x3a3a15]={'$like':'%'+_0x4cbde7[_0xd34b('0x27')]['filter']+'%'};return _0x42798e;})});}_0x426268=_[_0xd34b('0x71')]({},_0x426268,_0x4cbde7[_0xd34b('0xbd')]);return db[_0xd34b('0x9c')][_0xd34b('0x13')]({'where':_0x426268[_0xd34b('0x51')]})[_0xd34b('0x17')](function(_0x1d831d){_0x2cfe4c[_0xd34b('0x13')]=_0x1d831d;if(_0x4cbde7[_0xd34b('0x27')][_0xd34b('0xd5')]){_0x426268[_0xd34b('0xd6')]=[{'all':!![]}];}return db[_0xd34b('0x9c')]['findAll'](_0x426268);})[_0xd34b('0x17')](function(_0x24177b){_0x2cfe4c[_0xd34b('0x7e')]=_0x24177b;return _0x2cfe4c;});}})[_0xd34b('0x17')](respondWithFilteredResult(_0x230021,_0x426268))[_0xd34b('0x80')](handleError(_0x230021,null));};exports[_0xd34b('0xd7')]=function(_0xca3bc7,_0x2f69b6){var _0x2ce33a={'raw':!![],'where':{}};var _0x231203={};var _0x4f4bd7={'count':0x0,'rows':[]};return db['CmContact'][_0xd34b('0xbc')]({'where':{'id':_0xca3bc7[_0xd34b('0x7f')]['id']}})[_0xd34b('0x17')](handleEntityNotFound(_0x2f69b6,null))[_0xd34b('0x17')](function(_0xf92759){if(_0xf92759){_0x231203[_0xd34b('0x26')]=_[_0xd34b('0x1d')](db[_0xd34b('0xd8')][_0xd34b('0xd2')]);_0x231203[_0xd34b('0x27')]=_[_0xd34b('0x1d')](_0xca3bc7[_0xd34b('0x27')]);_0x231203['filters']=_['intersection'](_0x231203[_0xd34b('0x26')],_0x231203[_0xd34b('0x27')]);_0x2ce33a['attributes']=_[_0xd34b('0x29')](_0x231203[_0xd34b('0x26')],qs[_0xd34b('0x2b')](_0xca3bc7['query'][_0xd34b('0x2b')]));_0x2ce33a[_0xd34b('0x2a')]=_0x2ce33a[_0xd34b('0x2a')][_0xd34b('0x24')]?_0x2ce33a[_0xd34b('0x2a')]:_0x231203['model'];if(!_0xca3bc7['query'][_0xd34b('0x2c')](_0xd34b('0x2d'))){_0x2ce33a[_0xd34b('0x12')]=qs[_0xd34b('0x12')](_0xca3bc7[_0xd34b('0x27')]['limit']);_0x2ce33a[_0xd34b('0x10')]=qs[_0xd34b('0x10')](_0xca3bc7['query'][_0xd34b('0x10')]);}_0x2ce33a[_0xd34b('0x64')]=qs[_0xd34b('0x2e')](_0xca3bc7[_0xd34b('0x27')][_0xd34b('0x2e')]);_0x2ce33a[_0xd34b('0x51')]=qs[_0xd34b('0x28')](_[_0xd34b('0x2f')](_0xca3bc7['query'],_0x231203[_0xd34b('0x28')]));_0x2ce33a[_0xd34b('0x51')]['ContactId']=_0xf92759['id'];if(_0xca3bc7[_0xd34b('0x27')]['filter']){_0x2ce33a[_0xd34b('0x51')]=_[_0xd34b('0x71')](_0x2ce33a[_0xd34b('0x51')],{'$or':_['map'](_0x2ce33a[_0xd34b('0x2a')],function(_0x58c5f1){var _0xb9e597={};_0xb9e597[_0x58c5f1]={'$like':'%'+_0xca3bc7[_0xd34b('0x27')]['filter']+'%'};return _0xb9e597;})});}_0x2ce33a=_[_0xd34b('0x71')]({},_0x2ce33a,_0xca3bc7['options']);return db[_0xd34b('0xd8')][_0xd34b('0x13')]({'where':_0x2ce33a[_0xd34b('0x51')]})[_0xd34b('0x17')](function(_0x329df2){_0x4f4bd7[_0xd34b('0x13')]=_0x329df2;if(_0xca3bc7['query'][_0xd34b('0xd5')]){_0x2ce33a[_0xd34b('0xd6')]=[{'all':!![]}];}return db[_0xd34b('0xd8')][_0xd34b('0xb3')](_0x2ce33a);})['then'](function(_0x1abe44){_0x4f4bd7[_0xd34b('0x7e')]=_0x1abe44;return _0x4f4bd7;});}})[_0xd34b('0x17')](respondWithFilteredResult(_0x2f69b6,_0x2ce33a))['catch'](handleError(_0x2f69b6,null));};exports[_0xd34b('0xd9')]=function(_0x584047,_0x3b4559){var _0x5829d8={'raw':!![],'where':{}};var _0x1b5520={};var _0x21a606={'count':0x0,'rows':[]};return db[_0xd34b('0x72')][_0xd34b('0xbc')]({'where':{'id':_0x584047[_0xd34b('0x7f')]['id']}})[_0xd34b('0x17')](handleEntityNotFound(_0x3b4559,null))[_0xd34b('0x17')](function(_0x203fac){if(_0x203fac){_0x1b5520[_0xd34b('0x26')]=_['keys'](db[_0xd34b('0xa0')][_0xd34b('0xd2')]);_0x1b5520[_0xd34b('0x27')]=_[_0xd34b('0x1d')](_0x584047[_0xd34b('0x27')]);_0x1b5520[_0xd34b('0x28')]=_[_0xd34b('0x29')](_0x1b5520[_0xd34b('0x26')],_0x1b5520['query']);_0x5829d8[_0xd34b('0x2a')]=_[_0xd34b('0x29')](_0x1b5520[_0xd34b('0x26')],qs['fields'](_0x584047['query'][_0xd34b('0x2b')]));_0x5829d8[_0xd34b('0x2a')]=_0x5829d8[_0xd34b('0x2a')]['length']?_0x5829d8[_0xd34b('0x2a')]:_0x1b5520[_0xd34b('0x26')];if(!_0x584047['query']['hasOwnProperty'](_0xd34b('0x2d'))){_0x5829d8[_0xd34b('0x12')]=qs['limit'](_0x584047[_0xd34b('0x27')][_0xd34b('0x12')]);_0x5829d8['offset']=qs[_0xd34b('0x10')](_0x584047['query']['offset']);}_0x5829d8['order']=qs[_0xd34b('0x2e')](_0x584047[_0xd34b('0x27')]['sort']);_0x5829d8[_0xd34b('0x51')]=qs[_0xd34b('0x28')](_['pick'](_0x584047[_0xd34b('0x27')],_0x1b5520[_0xd34b('0x28')]));_0x5829d8[_0xd34b('0x51')][_0xd34b('0xd4')]=_0x203fac['id'];if(_0x584047[_0xd34b('0x27')]['filter']){_0x5829d8['where']=_[_0xd34b('0x71')](_0x5829d8[_0xd34b('0x51')],{'$or':_[_0xd34b('0x42')](_0x5829d8[_0xd34b('0x2a')],function(_0x5d2bb){var _0x808a1c={};_0x808a1c[_0x5d2bb]={'$like':'%'+_0x584047[_0xd34b('0x27')][_0xd34b('0x4a')]+'%'};return _0x808a1c;})});}_0x5829d8=_[_0xd34b('0x71')]({},_0x5829d8,_0x584047['options']);return db[_0xd34b('0xa0')]['count']({'where':_0x5829d8[_0xd34b('0x51')]})[_0xd34b('0x17')](function(_0x21ba52){_0x21a606['count']=_0x21ba52;if(_0x584047[_0xd34b('0x27')][_0xd34b('0xd5')]){_0x5829d8[_0xd34b('0xd6')]=[{'all':!![]}];}return db[_0xd34b('0xa0')]['findAll'](_0x5829d8);})[_0xd34b('0x17')](function(_0x1fc18f){_0x21a606[_0xd34b('0x7e')]=_0x1fc18f;return _0x21a606;});}})[_0xd34b('0x17')](respondWithFilteredResult(_0x3b4559,_0x5829d8))[_0xd34b('0x80')](handleError(_0x3b4559,null));};exports[_0xd34b('0xda')]=function(_0x141fba,_0x1a54e1){try{if(!_0x141fba['body'][_0xd34b('0x4e')]){throw new Error(_0xd34b('0xdb'));}if(!_0x141fba['body'][_0xd34b('0xdc')]){throw new Error(_0xd34b('0xdd'));}if(!_0x141fba[_0xd34b('0x86')][_0xd34b('0xde')]){throw new Error(_0xd34b('0xdf'));}if(!_0x141fba[_0xd34b('0x86')]['socket_timestamp']){throw new Error(_0xd34b('0xe0'));}var _0x2cf7d1=_0x141fba[_0xd34b('0x86')][_0xd34b('0xdc')]['split'](',');var _0x494c0b=_0x141fba[_0xd34b('0x86')][_0xd34b('0xde')][_0xd34b('0x41')](',');if(!_0x2cf7d1[_0xd34b('0x24')]||!_0x494c0b['length']||_0x2cf7d1[_0xd34b('0x24')]!==_0x494c0b[_0xd34b('0x24')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x141fba[_0xd34b('0x86')][_0xd34b('0x2b')]=_[_0xd34b('0xe1')](_0x2cf7d1,_0x494c0b);if(!_0x141fba[_0xd34b('0x86')][_0xd34b('0x2b')]['phone']){throw new Error(_0xd34b('0xe2'));}if(!_0x141fba[_0xd34b('0x86')][_0xd34b('0x2b')][_0xd34b('0xe3')]){throw new Error(_0xd34b('0xe4'));}var _0x1f3370=path[_0xd34b('0x8a')](config['root'],_0xd34b('0xe5'),_0x141fba[_0xd34b('0xe6')][_0xd34b('0xe7')]);fs[_0xd34b('0xe8')](_0x1f3370,parseInt('0777',0x8));var _0x43a308=require(_0xd34b('0xe9'))[_0xd34b('0xea')](path['join'](__dirname,_0xd34b('0xeb')),[_0x1f3370,_0x141fba['body'][_0xd34b('0xdc')],_0x141fba[_0xd34b('0x86')][_0xd34b('0xde')],_0x141fba['body'][_0xd34b('0x4e')],_0x141fba[_0xd34b('0x86')][_0xd34b('0xec')],_0x141fba[_0xd34b('0x86')][_0xd34b('0xa9')],_0x141fba[_0xd34b('0x86')]['socket_timestamp']]);return _0x1a54e1[_0xd34b('0xf')](0xc8)[_0xd34b('0xed')]({'message':_0xd34b('0xee'),'pid':_0x43a308[_0xd34b('0xef')]});}catch(_0x1cade6){return _0x1a54e1[_0xd34b('0xf')](0x1f4)[_0xd34b('0xf0')](_0x1cade6);}};exports['upload']=function(_0x14aaf5,_0x48f475){var _0x35bc25=fs[_0xd34b('0xf1')](_0x14aaf5[_0xd34b('0xe6')][_0xd34b('0x1')]);Papa[_0xd34b('0xf2')](_0x35bc25,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3db139){return _0x48f475[_0xd34b('0xf')](0xc8)[_0xd34b('0xed')]({'file':_0x14aaf5[_0xd34b('0xe6')],'fields':_0x3db139['meta'][_0xd34b('0x2b')]});}});};exports[_0xd34b('0xf3')]=function(_0xab824f,_0x308aa2){return db[_0xd34b('0x45')][_0xd34b('0xb3')]({'raw':!![],'attributes':['id'],'where':{'role':_0xd34b('0x6a')}})['then'](function(_0x3c17fa){var _0x4524c9=![];if(!_0xab824f[_0xd34b('0x86')][_0xd34b('0x4e')]){throw new Error(_0xd34b('0xdb'));}if(!_0xab824f[_0xd34b('0x86')][_0xd34b('0xf4')][_0xd34b('0xba')]){throw new Error(_0xd34b('0xe2'));}if(!_0xab824f[_0xd34b('0x86')][_0xd34b('0xf4')][_0xd34b('0xe3')]){throw new Error(_0xd34b('0xe4'));}if(!_0xab824f[_0xd34b('0x86')][_0xd34b('0xf5')]){throw new Error(_0xd34b('0xe0'));}var _0x54f643=require(_0xd34b('0xe9'))['fork'](path[_0xd34b('0x8a')](__dirname,_0xd34b('0xf6')),[_0xab824f[_0xd34b('0x7f')]['id'],JSON[_0xd34b('0xf7')](_0xab824f['body']),JSON[_0xd34b('0xf7')](_0x3c17fa)]);_0x54f643['on'](_0xd34b('0xf8'),function(){_0x4524c9=!![];return _0x308aa2[_0xd34b('0xf')](0xc8)[_0xd34b('0xed')]({'message':_0xd34b('0xf9'),'pid':_0x54f643[_0xd34b('0xef')]});});_0x54f643['on']('exit',function(_0x56ccd1){if(_0x56ccd1&&!_0x4524c9){return _0x308aa2['status'](0x1f4)[_0xd34b('0xed')]({'message':'error\x20child\x20process','pid':_0x54f643[_0xd34b('0xef')]});}});})['catch'](handleError(_0x308aa2,null));};exports[_0xd34b('0xfa')]=function(_0x14ad9c,_0x33788d,_0x15e653){return db[_0xd34b('0x45')][_0xd34b('0xb3')]({'raw':!![],'attributes':['id'],'where':{'role':_0xd34b('0x6a')}})[_0xd34b('0x17')](function(_0x3dbb88){var _0x1f6146=![];if(!_0x14ad9c['body'][_0xd34b('0x4e')]){throw new Error('No\x20ListId\x20specified');}if(!_0x14ad9c[_0xd34b('0x86')]['binding'][_0xd34b('0xba')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x14ad9c[_0xd34b('0x86')]['binding'][_0xd34b('0xe3')]){throw new Error(_0xd34b('0xe4'));}if(!_0x14ad9c['body'][_0xd34b('0xf5')]){throw new Error(_0xd34b('0xe0'));}var _0x400124=require(_0xd34b('0xe9'))['fork'](path[_0xd34b('0x8a')](__dirname,_0xd34b('0xfb')),[_0x14ad9c[_0xd34b('0x7f')]['id'],JSON['stringify'](_0x14ad9c[_0xd34b('0x86')]),JSON[_0xd34b('0xf7')](_0x3dbb88)]);_0x400124['on'](_0xd34b('0xf8'),function(_0x3d6a49){_0x1f6146=!![];return _0x33788d[_0xd34b('0xf')](0xc8)[_0xd34b('0xed')]({'message':_0xd34b('0xf9'),'pid':_0x400124[_0xd34b('0xef')]});});_0x400124['on'](_0xd34b('0xfc'),function(_0x170b0e){if(_0x170b0e&&!_0x1f6146){return _0x33788d[_0xd34b('0xf')](0x1f4)[_0xd34b('0xed')]({'message':_0xd34b('0xfd'),'pid':_0x400124[_0xd34b('0xef')]});}});})[_0xd34b('0x80')](handleError(_0x33788d,null));};exports[_0xd34b('0xfe')]=function(_0x423a96,_0x25d8c6){var _0x1540ba=[_0xd34b('0xff'),_0xd34b('0x100'),_0xd34b('0x101'),_0xd34b('0x102'),'fax',_0xd34b('0x103'),_0xd34b('0x104')];var _0x18fb1a={'offset':0x0,'order':qs[_0xd34b('0x2e')]('-createdAt')},_0x248c8c={'count':0x0,'rows':[]};Promise[_0xd34b('0x67')]()[_0xd34b('0x17')](function(){if(_0x423a96[_0xd34b('0x27')][_0xd34b('0x105')]){if(!_['includes'](_0x1540ba,_0x423a96[_0xd34b('0x27')][_0xd34b('0x105')][_0xd34b('0x106')]())){throw new Error(_0xd34b('0x107'));}_0x1540ba=[_0x423a96[_0xd34b('0x27')][_0xd34b('0x105')]['toLowerCase']()];}if(_0x423a96['query']['range']){try{var _0x1270ff=JSON[_0xd34b('0xf2')](_0x423a96[_0xd34b('0x27')][_0xd34b('0x108')]);if(!moment(_0x1270ff[_0xd34b('0x33')])['isValid']()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x1270ff['to'])[_0xd34b('0x109')]()){throw new Error(_0xd34b('0x10a'));}}catch(_0x3c98bf){throw new Error(_0xd34b('0x10b'));}}if(!_0x423a96[_0xd34b('0x27')][_0xd34b('0x2c')](_0xd34b('0x2d'))){_0x18fb1a[_0xd34b('0x12')]=qs[_0xd34b('0x12')](_0x423a96['query'][_0xd34b('0x12')]||0xa);_0x18fb1a[_0xd34b('0x10')]=qs[_0xd34b('0x10')](_0x423a96[_0xd34b('0x27')][_0xd34b('0x10')]);}var _0x213ad3=_0x1540ba[_0xd34b('0x42')](function(_0x1468f2){if(_0x1468f2===_0xd34b('0x104')){var _0x4f38f4={'attributes':['id',_0xd34b('0x10c'),_0xd34b('0x49'),_0xd34b('0x10d'),_0xd34b('0x10e'),_0xd34b('0x10f'),_0xd34b('0x110'),_0xd34b('0x111'),_0xd34b('0x112'),'note',_0xd34b('0x113'),_0xd34b('0x114'),_0xd34b('0x115'),'userThirdDisposition','UserId'],'where':{'ContactId':_0x423a96[_0xd34b('0x7f')]['id']},'include':[{'model':db[_0xd34b('0x45')],'as':_0xd34b('0x45'),'attributes':['id',_0xd34b('0x1a'),_0xd34b('0x116'),_0xd34b('0x84')]}],'order':[[_0xd34b('0x113'),'DESC']]};if(_0x423a96[_0xd34b('0x27')][_0xd34b('0x108')]){_0x4f38f4[_0xd34b('0x51')][_0xd34b('0x113')]={'$gte':_0x1270ff[_0xd34b('0x33')],'$lte':_0x1270ff['to']};}return db[_0xd34b('0x117')][_0xd34b('0x118')](_0x4f38f4)[_0xd34b('0x17')](function(_0x1109d5){_0x248c8c[_0xd34b('0x13')]+=_0x1109d5[_0xd34b('0x13')];return _[_0xd34b('0x42')](_0x1109d5[_0xd34b('0x7e')],function(_0x1ca14d){var _0x1480a6=_0x1ca14d[_0xd34b('0x87')]({'plain':!![]});_0x1480a6[_0xd34b('0x105')]=_0x1468f2;if(_0x1480a6[_0xd34b('0x45')]){_0x1480a6[_0xd34b('0x45')]={'id':_0x1480a6[_0xd34b('0x45')]['id'],'name':_0x1480a6[_0xd34b('0x45')][_0xd34b('0x1a')],'fullname':_0x1480a6[_0xd34b('0x45')][_0xd34b('0x116')],'alias':_0x1480a6[_0xd34b('0x45')]['alias']};}return _0x1480a6;});});}else{var _0x58f061=_[_0xd34b('0x119')](_0x1468f2)+(_0x1468f2===_0xd34b('0x100')?'Website':_0xd34b('0x11a'));var _0x53f185={'attributes':['id',_0xd34b('0x11b'),_0xd34b('0x11c'),_0xd34b('0x113'),_0xd34b('0x11d'),_0xd34b('0x11e'),_0xd34b('0x11f'),_0xd34b('0x120'),_0xd34b('0x121'),_0x58f061+'Id'],'where':{'ContactId':_0x423a96['params']['id']},'include':[{'model':db[_0x58f061],'as':_0xd34b('0x11a'),'attributes':['id',_0xd34b('0x1a'),'key']},{'model':db[_0xd34b('0x45')],'as':_0xd34b('0x122'),'attributes':['id',_0xd34b('0x1a'),_0xd34b('0x116')]},{'model':db[_0xd34b('0x3f')],'as':_0xd34b('0x7c'),'attributes':['id',_0xd34b('0x1a'),_0xd34b('0x32')],'through':{'attributes':[]}}],'order':[[_0xd34b('0x113'),_0xd34b('0x123')]]};if(_0x423a96[_0xd34b('0x27')][_0xd34b('0x108')]){_0x53f185[_0xd34b('0x51')][_0xd34b('0x113')]={'$gte':_0x1270ff[_0xd34b('0x33')],'$lte':_0x1270ff['to']};}switch(_0x1468f2){case _0xd34b('0x100'):_0x53f185[_0xd34b('0x2a')][_0xd34b('0x1f')](_0xd34b('0x124'),_0xd34b('0x125'),'customerPort',_0xd34b('0x126'),'osName',_0xd34b('0x127'),_0xd34b('0x128'),_0xd34b('0x129'),'referer');break;case _0xd34b('0xff'):_0x53f185['attributes'][_0xd34b('0x1f')]('subject',_0xd34b('0x12a'));break;case'openchannel':_0x53f185[_0xd34b('0x2a')]['push'](_0xd34b('0x12b'),'threadId');break;}return db[_[_0xd34b('0x119')](_0x1468f2)+_0xd34b('0x12c')][_0xd34b('0x118')](_0x53f185)[_0xd34b('0x17')](function(_0x54289c){_0x248c8c[_0xd34b('0x13')]+=_0x54289c[_0xd34b('0x13')];return _[_0xd34b('0x42')](_0x54289c['rows'],function(_0x157de0){var _0xc151d9=_0x157de0[_0xd34b('0x87')]({'plain':!![]});_0xc151d9['channel']=_0x1468f2;if(_0xc151d9[_0xd34b('0x122')]){_0xc151d9[_0xd34b('0x122')]={'id':_0xc151d9[_0xd34b('0x122')]['id'],'name':_0xc151d9[_0xd34b('0x122')][_0xd34b('0x1a')],'fullname':_0xc151d9[_0xd34b('0x122')][_0xd34b('0x116')]};}return _0xc151d9;});});}});return Promise[_0xd34b('0x23')](_0x213ad3);})[_0xd34b('0x17')](function(_0xc33ab1){return _(_0xc33ab1)[_0xd34b('0x12d')]()[_0xd34b('0x12e')]('createdAt')[_0xd34b('0x12f')]()[_0xd34b('0x40')]();})[_0xd34b('0x17')](function(_0x3b94c2){_0x248c8c['rows']=_0x18fb1a['limit']?_0x3b94c2[_0xd34b('0x130')](_0x18fb1a[_0xd34b('0x10')],_0x18fb1a[_0xd34b('0x10')]+_0x18fb1a['limit']):_0x3b94c2;return _0x248c8c;})[_0xd34b('0x17')](respondWithFilteredResult(_0x25d8c6,_0x18fb1a))[_0xd34b('0x80')](handleError(_0x25d8c6,null));}; \ No newline at end of file +var _0x7e22=['custom','values','merge','body','get','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','dialTimezone','timezones','additionalPhones','each','duplicates','$or','spread','contact','params','Phones','ContactItemType','ItemType','Phones.OrderBy','$and','format','cf_%d','utcOffset','omit','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','findOne','rawAttributes','pick','options','nolimit','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','literal','`ItemType`.OrderBy','CmHopperId','bulkCreate','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','ContactId','includeAll','rows','getHopperHistories','include','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','pid','upload','createReadStream','parse','meta','import','binding','firstName','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','mail','chat','openchannel','fax','whatsapp','-createdAt','channel','includes','toLowerCase','range','isValid','Invalid\x20createdAt\x20filter','voice','destination','callerid','starttime','endtime','duration','note','createdAt','userThirdDisposition','UserId','fullname','alias','findAndCountAll','Website','Account','closed','closedAt','disposition','thirdDisposition','key','Owner','browserName','customerPort','osName','ratingMessage','ratingType','referer','substatus','Interaction','flatten','sortBy','reverse','slice','moment','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/environment/shared','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','undefined','count','offset','limit','set','Content-Range','json','destroy','then','end','sendStatus','error','stack','send','index','describe','keys','cf_','push','trimStart','all','length','fieldType','model','query','filters','intersection','fields','attributes','order','sort','where','select','field','name','color','from','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','Tag','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','value','dateOfBirth','datetime','castTo','DATE','buildExpression','type','start','map','hasOwnProperty','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','tag','isArray','filter','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','SELECT','clone','c.id','DESC','having','resolve','user','role','agent','some','User','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','CmContact','c.lastName','c.phone','c.mobile','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','tags','startsWith','columnName','analytics','CmCustomField','findAll','displayName'];(function(_0x2e33c5,_0x1d1d38){var _0x33b7e5=function(_0xc04c36){while(--_0xc04c36){_0x2e33c5['push'](_0x2e33c5['shift']());}};_0x33b7e5(++_0x1d1d38);}(_0x7e22,0x1d8));var _0x27e2=function(_0x4036f3,_0x4a7ff8){_0x4036f3=_0x4036f3-0x0;var _0xb9177d=_0x7e22[_0x4036f3];return _0xb9177d;};'use strict';var moment=require(_0x27e2('0x0'));var BPromise=require('bluebird');var util=require(_0x27e2('0x1'));var path=require(_0x27e2('0x2'));var fs=require('fs');var _=require(_0x27e2('0x3'));var squel=require(_0x27e2('0x4'));var Papa=require(_0x27e2('0x5'));var Redis=require(_0x27e2('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0x27e2('0x7'));var logger=require('../../config/logger')(_0x27e2('0x8'));var config=require(_0x27e2('0x9'));var shared=require(_0x27e2('0xa'));var db=require(_0x27e2('0xb'))['db'];config['redis']=_[_0x27e2('0xc')](config[_0x27e2('0xd')],{'host':_0x27e2('0xe'),'port':0x18eb});var socket=require(_0x27e2('0xf'))(new Redis(config[_0x27e2('0xd')]));require(_0x27e2('0x10'))[_0x27e2('0x11')](socket);function respondWithResult(_0x256eac,_0x49d150){_0x49d150=_0x49d150||0xc8;return function(_0x3303bb){if(_0x3303bb){return _0x256eac[_0x27e2('0x12')](_0x49d150)['json'](_0x3303bb);}};}function respondWithFilteredResult(_0x1263c4,_0x281721){return function(_0x298536){if(_0x298536){var _0x1d6bc6=typeof _0x281721['offset']===_0x27e2('0x13')&&typeof _0x281721['limit']===_0x27e2('0x13');var _0x396d33=_0x298536[_0x27e2('0x14')];var _0x2f60b2=_0x1d6bc6?0x0:_0x281721[_0x27e2('0x15')];var _0x563b96=_0x1d6bc6?_0x298536[_0x27e2('0x14')]:_0x281721['offset']+_0x281721[_0x27e2('0x16')];var _0x5c625;if(_0x563b96>=_0x396d33){_0x563b96=_0x396d33;_0x5c625=0xc8;}else{_0x5c625=0xce;}_0x1263c4[_0x27e2('0x12')](_0x5c625);return _0x1263c4[_0x27e2('0x17')](_0x27e2('0x18'),_0x2f60b2+'-'+_0x563b96+'/'+_0x396d33)[_0x27e2('0x19')](_0x298536);}return null;};}function saveUpdates(_0x371885){return function(_0x18a838){if(_0x18a838){return _0x18a838['update'](_0x371885)['then'](function(_0x14ce22){return _0x14ce22;});}return null;};}function removeEntity(_0x1c5847){return function(_0x54e0d7){if(_0x54e0d7){return _0x54e0d7[_0x27e2('0x1a')]()[_0x27e2('0x1b')](function(){_0x1c5847[_0x27e2('0x12')](0xcc)[_0x27e2('0x1c')]();});}};}function handleEntityNotFound(_0x127d7e){return function(_0x502c9e){if(!_0x502c9e){_0x127d7e[_0x27e2('0x1d')](0x194);}return _0x502c9e;};}function handleError(_0x32be33,_0x74986d){_0x74986d=_0x74986d||0x1f4;return function(_0x4c3e17){logger[_0x27e2('0x1e')](_0x4c3e17[_0x27e2('0x1f')]);if(_0x4c3e17['name']){delete _0x4c3e17['name'];}_0x32be33[_0x27e2('0x12')](_0x74986d)[_0x27e2('0x20')](_0x4c3e17);};}exports[_0x27e2('0x21')]=function(_0x1aefa9,_0x2650c7){var _0xfa78e4={},_0x3cb5b1={},_0x566746={'count':0x0,'rows':[]};return db['CmContact'][_0x27e2('0x22')]()[_0x27e2('0x1b')](function(_0x38c02c){var _0x270cf3=[];for(var _0xe04676=0x0;_0xe046760x1){_0x81efa1['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x27e2('0x5c')](_0x172891),null);}else{if(qs[_0x27e2('0x5d')](_0x172891)){_0x81efa1['or'](_0x27e2('0x5e'),_0x172891+'%');_0x81efa1['or'](_0x27e2('0x5f'),_0x172891+'%');_0x81efa1['or'](_0x27e2('0x60'),_0x172891+'%');_0x81efa1['or'](_0x27e2('0x61'),_0x172891+'%');}else if(qs[_0x27e2('0x62')](_0x172891)){_0x81efa1['or']('c.email\x20LIKE\x20?',_0x172891+'%');}else{_0x81efa1['or'](_0x27e2('0x63'),'%'+_0x172891+'%');_0x81efa1['or']('c.lastName\x20LIKE\x20?','%'+_0x172891+'%');_0x81efa1['or'](_0x27e2('0x64'),'%'+_0x172891+'%');}}}}_0x387ea6[_0x27e2('0x32')](_0x81efa1);_0x387ea6[_0x27e2('0x65')]('c.id');var _0x42c70d={'type':db['Sequelize']['QueryTypes'][_0x27e2('0x66')],'raw':!![]};var _0x191a5f=_0x387ea6[_0x27e2('0x67')]()[_0x27e2('0x34')](_0x27e2('0x68'));if(_0xfa78e4[_0x27e2('0x30')]){_0xfa78e4[_0x27e2('0x30')][_0x27e2('0x46')](function(_0xf6355){_0x387ea6['order']('c.'+_0xf6355[0x0],_0xf6355[0x1]===_0x27e2('0x69')?![]:!![]);});}if(!_[_0x27e2('0x55')](_0x493765)){_0x387ea6[_0x27e2('0x6a')](_0xa8ad6);_0x191a5f[_0x27e2('0x32')]('t.id\x20IN\x20?',_0x493765);}BPromise[_0x27e2('0x6b')]()['then'](function(){if(!_0x395bf3)return;if(_0x1aefa9[_0x27e2('0x6c')][_0x27e2('0x6d')]!==_0x27e2('0x6e'))return;if(!_[_0x27e2('0x6f')](_0x395bf3[_0x27e2('0x42')],[_0x27e2('0x34'),_0x27e2('0x70')])){return _0x1aefa9[_0x27e2('0x6c')][_0x27e2('0x71')]({'attributes':['id'],'raw':!![]})[_0x27e2('0x1b')](function(_0x14f73f){if(_[_0x27e2('0x55')](_0x14f73f)){_0x191a5f[_0x27e2('0x32')](_0x27e2('0x72'));_0x387ea6['where'](_0x27e2('0x72'));}else{_0x191a5f['where']('c.ListId\x20IN\x20?',_[_0x27e2('0x51')](_0x14f73f,'id'));_0x387ea6['where'](_0x27e2('0x57'),_[_0x27e2('0x51')](_0x14f73f,'id'));}});}})[_0x27e2('0x1b')](function(){if(_0x1aefa9[_0x27e2('0x6c')][_0x27e2('0x6d')]===_0x27e2('0x6e')&&!_0x395bf3&&!_0x1aefa9[_0x27e2('0x2b')][_0x27e2('0x56')])return[];return db[_0x27e2('0x73')]['query'](_0x191a5f[_0x27e2('0x74')](),_0x42c70d);})[_0x27e2('0x1b')](function(_0x4b7039){_0x566746['count']=_0x4b7039[_0x27e2('0x28')];if(_0x566746[_0x27e2('0x14')]===0x0)return[];return db[_0x27e2('0x73')][_0x27e2('0x2b')](_0x2a07fa[_0x27e2('0x74')](),_0x42c70d)[_0x27e2('0x1b')](function(_0x39435b){_0x51a01d=_[_0x27e2('0x75')](_0x39435b,'id');_0x42c70d=_['merge'](_0x42c70d,{'model':db[_0x27e2('0x76')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1aefa9[_0x27e2('0x2b')][_0x27e2('0x2e')]){_0xfa78e4['attributes'][_0x27e2('0x46')](function(_0x32dc95){_0x387ea6[_0x27e2('0x34')]('c.'+_0x32dc95);});}else{_0x387ea6['field'](_0x27e2('0x68'));_0x387ea6[_0x27e2('0x34')]('c.firstName');_0x387ea6['field'](_0x27e2('0x77'));_0x387ea6[_0x27e2('0x34')](_0x27e2('0x78'));_0x387ea6[_0x27e2('0x34')](_0x27e2('0x79'));_0x387ea6['field']('c.fax');_0x387ea6[_0x27e2('0x34')]('c.email');_0x387ea6['field']('c.ListId');_0x387ea6[_0x27e2('0x34')](_0x27e2('0x7a'));_0x387ea6['field'](_0x27e2('0x7b'));_0x387ea6['field'](_0x27e2('0x7c'));_0x387ea6[_0x27e2('0x34')](_0x27e2('0x7d'),_0x27e2('0x7e'));}if(_0xfa78e4['limit'])_0x387ea6[_0x27e2('0x16')](_0xfa78e4[_0x27e2('0x16')]);if(_0xfa78e4['offset'])_0x387ea6[_0x27e2('0x15')](_0xfa78e4[_0x27e2('0x15')]);return db[_0x27e2('0x73')][_0x27e2('0x2b')](_0x387ea6['toString'](),_0x42c70d);});})[_0x27e2('0x1b')](function(_0x5c6c04){_0x5c6c04[_0x27e2('0x46')](function(_0x22c99f){if(_0x22c99f['TagIds']){_0x22c99f[_0x27e2('0x7f')]=[];_0x22c99f[_0x27e2('0x7e')][_0x27e2('0x45')](',')[_0x27e2('0x46')](function(_0x1a7839){_0x22c99f[_0x27e2('0x7f')][_0x27e2('0x25')](_0x51a01d[_0x1a7839]);});}delete _0x22c99f[_0x27e2('0x7e')];});_0x566746['rows']=_0x5c6c04;return _0x566746;})[_0x27e2('0x1b')](respondWithFilteredResult(_0x2650c7,_0xfa78e4));})[_0x27e2('0x80')](handleError(_0x2650c7,null));};exports[_0x27e2('0x1a')]=function(_0x219385,_0x54595d){return db[_0x27e2('0x76')][_0x27e2('0x43')]({'where':{'id':_0x219385['params']['id']}})[_0x27e2('0x1b')](handleEntityNotFound(_0x54595d,null))[_0x27e2('0x1b')](removeEntity(_0x54595d,null))[_0x27e2('0x80')](handleError(_0x54595d,null));};exports[_0x27e2('0x22')]=function(_0x3561f2,_0x3e312a){return db[_0x27e2('0x76')][_0x27e2('0x22')]()[_0x27e2('0x1b')](function(_0x1cc141){delete _0x1cc141[_0x27e2('0x81')];for(var _0x4e72ef=0x0;_0x4e72ef0x0){return new Promise(function(_0x5d0106,_0x35c446){var _0x4656fb=[];for(var _0x199e05=0x0;_0x199e05<_0x54cde7[_0x27e2('0x28')];_0x199e05++){_0x4656fb[_0x27e2('0x25')](insertAdditionalPhones(_0x54cde7[_0x199e05][_0x27e2('0xaf')],_0x54cde7[_0x199e05][_0x27e2('0xaa')]));}Promise[_0x27e2('0x27')](_0x4656fb)[_0x27e2('0x1b')](function(){_0x5d0106(0x1);});})[_0x27e2('0x1b')](function(){return{'success':_0x182991,'failure':_0x5eb53d,'duplicates':_0x27d7c6};});}else{return{'success':_0x182991,'failure':_0x5eb53d,'duplicates':_0x27d7c6};}}})['then'](respondWithResult(_0x588829,0xc9))['catch'](handleError(_0x588829,null));};exports['show']=function(_0x53cf25,_0x44d7f6){var _0x376295;return db[_0x27e2('0x76')][_0x27e2('0x22')]()['then'](function(_0x27ef2e){return db[_0x27e2('0x76')][_0x27e2('0x43')]({'where':{'id':_0x53cf25[_0x27e2('0xb0')]['id']},'include':[{'model':db[_0x27e2('0x44')],'as':'Tags','attributes':['id','name',_0x27e2('0x36')],'required':_0x53cf25[_0x27e2('0x2b')][_0x27e2('0x59')]?!![]:![]},{'model':db[_0x27e2('0x9e')],'as':_0x27e2('0xb1'),'where':{'CmContactId':_0x53cf25['params']['id']},'required':![],'include':[{'model':db[_0x27e2('0xb2')],'as':_0x27e2('0xb3')}]}],'order':[db['sequelize']['literal'](_0x27e2('0xb4'))],'attributes':_[_0x27e2('0x23')](_0x27ef2e)});})[_0x27e2('0x1b')](function(_0xafc9c1){if(!_[_0x27e2('0x53')](_0xafc9c1)){_0x376295=_0xafc9c1[_0x27e2('0x8c')]({'plain':!![]});var _0x263707={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xafc9c1&&_0xafc9c1[_0x27e2('0x56')]){if(_0xafc9c1[_0x27e2('0x56')]){_0x263707[_0x27e2('0x32')][_0x27e2('0xb5')][_0x27e2('0x25')]({'ListId':{'$ne':_0xafc9c1[_0x27e2('0x56')]}});}}return db['CmCustomField']['findAll'](_0x263707);}})['then'](function(_0x2de8de){if(!_[_0x27e2('0x53')](_0x2de8de)){return _['omit'](_0x376295,_[_0x27e2('0x51')](_0x2de8de,function(_0x2f6b20){return util[_0x27e2('0xb6')](_0x27e2('0xb7'),_0x2f6b20['id']);}));}})[_0x27e2('0x1b')](handleEntityNotFound(_0x44d7f6,null))[_0x27e2('0x1b')](respondWithResult(_0x44d7f6,null))[_0x27e2('0x80')](handleError(_0x44d7f6,null));};exports[_0x27e2('0x95')]=function(_0x25561d,_0x167d89){var _0x23ba54;if(_0x25561d[_0x27e2('0x8b')]['id']){delete _0x25561d[_0x27e2('0x8b')]['id'];}if(!_[_0x27e2('0x53')](_0x25561d[_0x27e2('0x8b')][_0x27e2('0xa8')])){var _0x200659=_0x25561d[_0x27e2('0x8b')][_0x27e2('0xa8')];if(!_[_0x27e2('0x53')](shared[_0x27e2('0xa9')][_0x200659]))_0x25561d[_0x27e2('0x8b')][_0x27e2('0xb8')]=shared['timezones'][_0x200659]['utcOffset'];}return db[_0x27e2('0x76')][_0x27e2('0x43')]({'where':{'id':_0x25561d[_0x27e2('0xb0')]['id']}})[_0x27e2('0x1b')](handleEntityNotFound(_0x167d89,null))[_0x27e2('0x1b')](saveUpdates(_0x25561d[_0x27e2('0x8b')],null))['then'](function(_0x37e9e3){_0x23ba54=_0x37e9e3;var _0x4daec5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x37e9e3&&_0x37e9e3[_0x27e2('0x56')]){if(_0x37e9e3[_0x27e2('0x56')]){_0x4daec5[_0x27e2('0x32')][_0x27e2('0xb5')][_0x27e2('0x25')]({'ListId':{'$ne':_0x37e9e3[_0x27e2('0x56')]}});}}return db['CmCustomField']['findAll'](_0x4daec5);})['then'](function(_0x596f9e){if(_0x596f9e){return _[_0x27e2('0xb9')](_['pickBy'](_0x25561d[_0x27e2('0x8b')],function(_0x3dee00,_0x214e36){return _[_0x27e2('0x82')](_0x214e36,_0x27e2('0x24'));}),_[_0x27e2('0x51')](_0x596f9e,function(_0x2e94a1){return util[_0x27e2('0xb6')](_0x27e2('0xb7'),_0x2e94a1['id']);}));}})[_0x27e2('0x1b')](function(_0x15e9a7){if(_0x15e9a7&&!_['isEmpty'](_0x15e9a7)){var _0x378b68=squel['update']()[_0x27e2('0xba')]('cm_contacts')[_0x27e2('0xbb')](_0x15e9a7)['where'](_0x27e2('0xbc'),_0x25561d[_0x27e2('0xb0')]['id'])[_0x27e2('0xbd')]();return db[_0x27e2('0x73')]['query'](_0x378b68[_0x27e2('0xbe')],{'replacements':_0x378b68[_0x27e2('0x89')]});}})[_0x27e2('0x1b')](function(){if(_0x25561d[_0x27e2('0x8b')][_0x27e2('0xbf')]&&_0x23ba54){return db['CmHopper']['update']({'phone':_0x25561d[_0x27e2('0x8b')][_0x27e2('0xbf')],'OrderBy':0x0},{'where':{'ContactId':_0x23ba54['id']}});}})[_0x27e2('0x1b')](function(){return _0x23ba54;})['then'](respondWithResult(_0x167d89,null))[_0x27e2('0x80')](handleError(_0x167d89,null));};exports[_0x27e2('0xc0')]=function(_0x3f93dd,_0x57fd67){var _0x37eaec={};var _0x1ad2ac={};var _0x332d08;var _0x4d3d7d;return db[_0x27e2('0x76')][_0x27e2('0xc1')]({'where':{'id':_0x3f93dd['params']['id']}})['then'](handleEntityNotFound(_0x57fd67,null))[_0x27e2('0x1b')](function(_0x43ffdd){if(_0x43ffdd){_0x332d08=_0x43ffdd;_0x1ad2ac['model']=_[_0x27e2('0x23')](db['Tag'][_0x27e2('0xc2')]);_0x1ad2ac[_0x27e2('0x2b')]=_[_0x27e2('0x23')](_0x3f93dd[_0x27e2('0x2b')]);_0x1ad2ac[_0x27e2('0x2c')]=_['intersection'](_0x1ad2ac[_0x27e2('0x2a')],_0x1ad2ac[_0x27e2('0x2b')]);_0x37eaec[_0x27e2('0x2f')]=_[_0x27e2('0x2d')](_0x1ad2ac[_0x27e2('0x2a')],qs[_0x27e2('0x2e')](_0x3f93dd[_0x27e2('0x2b')][_0x27e2('0x2e')]));_0x37eaec[_0x27e2('0x2f')]=_0x37eaec[_0x27e2('0x2f')][_0x27e2('0x28')]?_0x37eaec['attributes']:_0x1ad2ac['model'];_0x37eaec['order']=qs[_0x27e2('0x31')](_0x3f93dd[_0x27e2('0x2b')]['sort']);_0x37eaec['where']=qs[_0x27e2('0x2c')](_[_0x27e2('0xc3')](_0x3f93dd['query'],_0x1ad2ac[_0x27e2('0x2c')]));if(_0x3f93dd[_0x27e2('0x2b')]['filter']){_0x37eaec[_0x27e2('0x32')]=_[_0x27e2('0x8a')](_0x37eaec[_0x27e2('0x32')],{'$or':_[_0x27e2('0x51')](_0x37eaec[_0x27e2('0x2f')],function(_0x589526){var _0x465a31={};_0x465a31[_0x589526]={'$like':'%'+_0x3f93dd[_0x27e2('0x2b')]['filter']+'%'};return _0x465a31;})});}_0x37eaec=_['merge']({},_0x37eaec,_0x3f93dd[_0x27e2('0xc4')]);return _0x332d08[_0x27e2('0xc0')](_0x37eaec);}})[_0x27e2('0x1b')](function(_0x47adb5){if(_0x47adb5){_0x4d3d7d=_0x47adb5[_0x27e2('0x28')];if(!_0x3f93dd[_0x27e2('0x2b')][_0x27e2('0x52')](_0x27e2('0xc5'))){_0x37eaec[_0x27e2('0x16')]=qs[_0x27e2('0x16')](_0x3f93dd[_0x27e2('0x2b')][_0x27e2('0x16')]);_0x37eaec[_0x27e2('0x15')]=qs['offset'](_0x3f93dd[_0x27e2('0x2b')][_0x27e2('0x15')]);}return _0x332d08['getTags'](_0x37eaec);}})[_0x27e2('0x1b')](function(_0x2398c7){if(_0x2398c7){return _0x2398c7?{'count':_0x4d3d7d,'rows':_0x2398c7}:null;}})[_0x27e2('0x1b')](respondWithResult(_0x57fd67,null))[_0x27e2('0x80')](handleError(_0x57fd67,null));};exports['setTags']=function(_0x497daa,_0x4efdbe){if(_0x497daa[_0x27e2('0x8b')]['id']){delete _0x497daa[_0x27e2('0x8b')]['id'];}return db[_0x27e2('0x76')][_0x27e2('0xc1')]({'where':{'id':_0x497daa[_0x27e2('0xb0')]['id']}})[_0x27e2('0x1b')](handleEntityNotFound(_0x4efdbe,null))[_0x27e2('0x1b')](function(_0x10e08f){if(_0x10e08f){return _0x10e08f['setTags'](_0x497daa[_0x27e2('0x8b')][_0x27e2('0xc6')]||[]);}return null;})[_0x27e2('0x1b')](respondWithResult(_0x4efdbe,null))['catch'](handleError(_0x4efdbe,null));};exports[_0x27e2('0xc7')]=function(_0xdaa27b,_0x423ea2){var _0x3ec8fa=[];_0x3ec8fa['push'](addAdditionalPhones(_0xdaa27b[_0x27e2('0x8b')]));Promise['all'](_0x3ec8fa)[_0x27e2('0x1b')](function(){_0x3ec8fa=[];_0x3ec8fa[_0x27e2('0x25')](deleteCmHopperPhones(_0xdaa27b[_0x27e2('0x8b')]['id']));_0x3ec8fa[_0x27e2('0x25')](addCmHopperPhones(_0xdaa27b['body']['id']));Promise[_0x27e2('0x27')](_0x3ec8fa)[_0x27e2('0x1b')](function(){return[0x1];})[_0x27e2('0x1b')](respondWithResult(_0x423ea2,null));});};function addAdditionalPhones(_0xb06e49){var _0x1d6f11;return new Promise(function(_0x26ed5c,_0x4a6373){return db[_0x27e2('0x9e')][_0x27e2('0x1a')]({'where':{'CmContactId':_0xb06e49['id']}})[_0x27e2('0x1b')](function(){db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x27e2('0xc8')]})['then'](function(_0x4c65b9){var _0x4879e2=[];for(var _0x1ef1d5=0x0;_0x1ef1d5<_0xb06e49[_0x27e2('0xc9')][_0x27e2('0x28')];_0x1ef1d5++){var _0x59d873=_0xb06e49[_0x27e2('0xca')]?_[_0x27e2('0x53')](_0xb06e49['item_types'][_0x1ef1d5])?'':_0xb06e49['item_types'][_0x1ef1d5]:_0xb06e49[_0x27e2('0xc9')][_0x1ef1d5]['ItemTypeId']?_0xb06e49[_0x27e2('0xc9')][_0x1ef1d5][_0x27e2('0xcb')]:'';var _0x123404=_[_0x27e2('0x53')](_0xb06e49['items'][_0x1ef1d5][_0x27e2('0xcc')])?'':_0xb06e49[_0x27e2('0xc9')][_0x1ef1d5][_0x27e2('0xcc')];var _0x4aeb8e=_0x59d873+':'+_0xb06e49[_0x27e2('0xc9')][_0x1ef1d5][_0x27e2('0xbf')]+'§'+_0x123404;if(_[_0x27e2('0x53')](_0x1d6f11))_0x1d6f11=_0x4aeb8e;else _0x1d6f11+=';'+_0x4aeb8e;var _0x32e4aa=null;if(_0xb06e49[_0x27e2('0xca')]){if(!_[_0x27e2('0x53')](_0xb06e49[_0x27e2('0xca')][_0x1ef1d5])){var _0x22fa78=_[_0x27e2('0x43')](_0x4c65b9,function(_0x2d29b0){return _0x2d29b0['id']===_0xb06e49['item_types'][_0x1ef1d5];});if(!_[_0x27e2('0x53')](_0x22fa78)){_0x32e4aa=_0x22fa78[_0x27e2('0xc8')];}}}else{if(!_[_0x27e2('0x53')](_0xb06e49[_0x27e2('0xc9')][_0x1ef1d5])){var _0x22fa78=_[_0x27e2('0x43')](_0x4c65b9,function(_0xe457ee){return _0xe457ee['id']===_0xb06e49[_0x27e2('0xc9')][_0x1ef1d5][_0x27e2('0xcb')];});if(!_['isNil'](_0x22fa78)){_0x32e4aa=_0x1ef1d5;}}}if(_[_0x27e2('0x53')](_0x32e4aa)){_0x32e4aa=0x64;}_0x4879e2[_0x27e2('0x25')](addAdditionalPhone(_0xb06e49['id'],_0xb06e49[_0x27e2('0xc9')][_0x1ef1d5]['phone'],_0xb06e49['item_types']?_[_0x27e2('0x53')](_0xb06e49[_0x27e2('0xca')][_0x1ef1d5])?null:_0xb06e49[_0x27e2('0xca')][_0x1ef1d5]:_0xb06e49[_0x27e2('0xc9')][_0x1ef1d5][_0x27e2('0xcb')]?_0xb06e49['items'][_0x1ef1d5][_0x27e2('0xcb')]:null,_0x32e4aa,_0x123404));}Promise[_0x27e2('0x27')](_0x4879e2)[_0x27e2('0x1b')](function(){db[_0x27e2('0x76')][_0x27e2('0x95')]({'AdditionalPhones':_0x1d6f11},{'where':{'id':_0xb06e49['id']}})[_0x27e2('0x1b')](function(){_0x26ed5c(0x1);});});});});});}function addAdditionalPhone(_0x58314c,_0x3abedc,_0x5db72f,_0x15dc50,_0x2409f5){return db[_0x27e2('0x9e')][_0x27e2('0x43')]({'where':{'CmContactId':_0x58314c,'item':_0x3abedc}})[_0x27e2('0x1b')](function(_0x6e12f1){if(_0x6e12f1)logger[_0x27e2('0x8e')](_0x27e2('0xcd'),_0x6e12f1);else{db['CmContactHasItem'][_0x27e2('0x93')]({'CmContactId':_0x58314c,'item':_0x3abedc,'ItemTypeId':_0x5db72f,'OrderBy':_0x15dc50,'ItemClass':_0x27e2('0xce'),'description':_0x2409f5});}});}function deletePhones(_0x4e87ee){return db['CmContactHasItem'][_0x27e2('0x1a')]({'where':{'CmContactId':_0x4e87ee}});}function deleteCmHopperPhones(_0x134866){return new Promise(function(_0x36be41,_0x4b14e5){return db[_0x27e2('0x90')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x134866}})['then'](function(_0x2fe33f){db[_0x27e2('0xcf')][_0x27e2('0x1a')]({'where':{'CmHopperId':{'$in':_[_0x27e2('0x51')](_0x2fe33f,'id')}}});})[_0x27e2('0x1b')](function(){_0x36be41(0x1);});});}function addCmHopperPhones(_0x4972a4){return new Promise(function(_0x3e3403,_0x66de04){return db[_0x27e2('0x90')][_0x27e2('0x86')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4972a4}})[_0x27e2('0x1b')](function(_0x1f4cd3){var _0x125703=[];_['map'](_0x1f4cd3,function(_0x1298b4){_0x125703[_0x27e2('0x25')](createCmHopperPhone(_0x4972a4,_0x1298b4['id']));});Promise[_0x27e2('0x27')](_0x125703)[_0x27e2('0x1b')](function(){_0x3e3403(0x1);});});});}function createCmHopperPhone(_0x3060de,_0x6643c5){return new Promise(function(_0x5179e9,_0x3b302b){db[_0x27e2('0x9e')][_0x27e2('0x86')]({'raw':!![],'attributes':[_0x27e2('0xd0'),_0x27e2('0xc8')],'where':{'CmContactId':_0x3060de,'ItemClass':'PHONE'},'include':[{'model':db[_0x27e2('0xb2')],'attributes':[_0x27e2('0xc8')],'as':_0x27e2('0xb3')}],'order':['OrderBy',db[_0x27e2('0x73')][_0x27e2('0xd1')](_0x27e2('0xd2'))]})[_0x27e2('0x1b')](function(_0x1cd5c4){var _0x586600=0x1;var _0x47c029=_[_0x27e2('0x51')](_0x1cd5c4,function(_0x53eccf){_0x53eccf[_0x27e2('0xd3')]=_0x6643c5;_0x53eccf['phone']=_0x53eccf[_0x27e2('0xd0')];_0x53eccf[_0x27e2('0xc8')]=_0x586600;delete _0x53eccf['ItemType.OrderBy'];_0x586600=_0x586600+0x1;return _0x53eccf;});return db[_0x27e2('0xcf')][_0x27e2('0xd4')](_0x47c029,{});})[_0x27e2('0x1b')](function(){_0x5179e9(0x1);});});}function insertAdditionalPhones(_0x290354,_0x544849){return new Promise(function(_0x3e45d5,_0x3f4ee0){var _0x5acb5c=[];for(var _0x39c88a=0x0;_0x39c88a<_0x544849['length'];_0x39c88a++){var _0x49af82=_0x544849[_0x39c88a];_0x5acb5c[_0x27e2('0x25')](parseContactItemType(_0x49af82));}Promise[_0x27e2('0x27')](_0x5acb5c)[_0x27e2('0x1b')](function(){var _0x373f3a={'id':_0x290354['id'],'items':_0x544849};return addAdditionalPhones(_0x373f3a)[_0x27e2('0x1b')](function(_0x308f22){return addCmHopperPhones(_0x290354['id']);});})[_0x27e2('0x1b')](function(){_0x3e45d5(_0x290354);});});}function parseContactItemType(_0x3e7900){return new Promise(function(_0x16faa4,_0x2ddcd1){if(_0x3e7900[_0x27e2('0x52')](_0x27e2('0xcb'))){_0x16faa4(_0x3e7900);}else{return db[_0x27e2('0xb2')][_0x27e2('0x43')]({'where':{'name':_0x3e7900['ItemType']}})[_0x27e2('0x1b')](function(_0x2c5a52){if(_[_0x27e2('0x53')](_0x2c5a52))_0x3e7900[_0x27e2('0xcb')]=null;else _0x3e7900[_0x27e2('0xcb')]=_0x2c5a52['id'];_0x16faa4(_0x3e7900);});}});}exports[_0x27e2('0xd5')]=function(_0x276ee3,_0x551e4c){return db[_0x27e2('0x9e')][_0x27e2('0x86')]({'raw':!![],'where':{'CmContactId':_0x276ee3['params']['id'],'ItemClass':_0x27e2('0xce')},'include':[{'model':db[_0x27e2('0xb2')],'as':_0x27e2('0xb3')}],'order':[[db[_0x27e2('0x73')]['literal']('`ItemType`.OrderBy')],[_0x27e2('0xc8')]]})[_0x27e2('0x1b')](function(_0x306547){return _0x306547;})['then'](respondWithResult(_0x551e4c,null))[_0x27e2('0x80')](handleError(_0x551e4c,null));};exports[_0x27e2('0xd6')]=function(_0x40b3db,_0x8308ea){return db[_0x27e2('0x9e')][_0x27e2('0x86')]({'raw':!![],'where':{'CmContactId':_0x40b3db[_0x27e2('0x8b')][_0x27e2('0xd7')]}})['then'](function(_0x3cf40a){var _0x1b88b0=_[_0x27e2('0x51')](_0x3cf40a,function(_0x2cdcdb){_0x2cdcdb[_0x27e2('0xd8')]=_0x40b3db[_0x27e2('0x8b')][_0x27e2('0xd9')];return _0x2cdcdb;});return db['CmContactHasItem'][_0x27e2('0xd4')](_0x1b88b0,{});})['then'](function(_0x41e8a7){return addCmHopperPhones(_0x40b3db[_0x27e2('0x8b')]['toContactId']);})[_0x27e2('0x1b')](function(_0x3ccce8){return['ok'];})[_0x27e2('0x1b')](respondWithResult(_0x8308ea,null))[_0x27e2('0x80')](handleError(_0x8308ea,null));};exports[_0x27e2('0xda')]=function(_0x2aa0f5,_0x52704c){var _0x3b4d8a=[];_0x3b4d8a[_0x27e2('0x25')](createCmHopperPhone(_0x2aa0f5[_0x27e2('0x8b')]['id'],_0x2aa0f5[_0x27e2('0x8b')]['hopperId']));Promise[_0x27e2('0x27')](_0x3b4d8a)[_0x27e2('0x1b')](function(){return[0x1];})[_0x27e2('0x1b')](respondWithResult(_0x52704c,null));};exports[_0x27e2('0xdb')]=function(_0x217eb3,_0x5c0250){var _0x5e287f={'raw':![],'where':{}};var _0x20fd02={};var _0x23a66f={'count':0x0,'rows':[]};return db[_0x27e2('0x76')][_0x27e2('0xc1')]({'where':{'id':_0x217eb3['params']['id']}})['then'](handleEntityNotFound(_0x5c0250,null))[_0x27e2('0x1b')](function(_0x2ee36a){if(_0x2ee36a){_0x20fd02[_0x27e2('0x2a')]=_[_0x27e2('0x23')](db[_0x27e2('0x90')][_0x27e2('0xc2')]);_0x20fd02[_0x27e2('0x2b')]=_[_0x27e2('0x23')](_0x217eb3[_0x27e2('0x2b')]);_0x20fd02[_0x27e2('0x2c')]=_[_0x27e2('0x2d')](_0x20fd02[_0x27e2('0x2a')],_0x20fd02[_0x27e2('0x2b')]);_0x5e287f['attributes']=_[_0x27e2('0x2d')](_0x20fd02[_0x27e2('0x2a')],qs[_0x27e2('0x2e')](_0x217eb3['query'][_0x27e2('0x2e')]));_0x5e287f[_0x27e2('0x2f')]=_0x5e287f[_0x27e2('0x2f')][_0x27e2('0x28')]?_0x5e287f[_0x27e2('0x2f')]:_0x20fd02[_0x27e2('0x2a')];if(!_0x217eb3[_0x27e2('0x2b')][_0x27e2('0x52')](_0x27e2('0xc5'))){_0x5e287f['limit']=qs[_0x27e2('0x16')](_0x217eb3[_0x27e2('0x2b')][_0x27e2('0x16')]);_0x5e287f[_0x27e2('0x15')]=qs[_0x27e2('0x15')](_0x217eb3[_0x27e2('0x2b')]['offset']);}_0x5e287f['order']=qs[_0x27e2('0x31')](_0x217eb3[_0x27e2('0x2b')][_0x27e2('0x31')]);_0x5e287f[_0x27e2('0x32')]=qs[_0x27e2('0x2c')](_[_0x27e2('0xc3')](_0x217eb3[_0x27e2('0x2b')],_0x20fd02[_0x27e2('0x2c')]));_0x5e287f[_0x27e2('0x32')][_0x27e2('0xdc')]=_0x2ee36a['id'];if(_0x217eb3['query'][_0x27e2('0x5b')]){_0x5e287f[_0x27e2('0x32')]=_['merge'](_0x5e287f[_0x27e2('0x32')],{'$or':_['map'](_0x5e287f['attributes'],function(_0x302c9f){var _0x65eb0f={};_0x65eb0f[_0x302c9f]={'$like':'%'+_0x217eb3[_0x27e2('0x2b')][_0x27e2('0x5b')]+'%'};return _0x65eb0f;})});}_0x5e287f=_[_0x27e2('0x8a')]({},_0x5e287f,_0x217eb3[_0x27e2('0xc4')]);return db['CmHopper'][_0x27e2('0x14')]({'where':_0x5e287f[_0x27e2('0x32')]})[_0x27e2('0x1b')](function(_0x234020){_0x23a66f[_0x27e2('0x14')]=_0x234020;if(_0x217eb3[_0x27e2('0x2b')][_0x27e2('0xdd')]){_0x5e287f['include']=[{'all':!![]}];}return db[_0x27e2('0x90')][_0x27e2('0x86')](_0x5e287f);})[_0x27e2('0x1b')](function(_0x109802){_0x23a66f[_0x27e2('0xde')]=_0x109802;return _0x23a66f;});}})['then'](respondWithFilteredResult(_0x5c0250,_0x5e287f))[_0x27e2('0x80')](handleError(_0x5c0250,null));};exports[_0x27e2('0xdf')]=function(_0xf7ddc9,_0xb9e4af){var _0x45c444={'raw':!![],'where':{}};var _0x577a20={};var _0x4e8268={'count':0x0,'rows':[]};return db['CmContact'][_0x27e2('0xc1')]({'where':{'id':_0xf7ddc9['params']['id']}})[_0x27e2('0x1b')](handleEntityNotFound(_0xb9e4af,null))[_0x27e2('0x1b')](function(_0x193a25){if(_0x193a25){_0x577a20['model']=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x577a20['query']=_[_0x27e2('0x23')](_0xf7ddc9[_0x27e2('0x2b')]);_0x577a20[_0x27e2('0x2c')]=_[_0x27e2('0x2d')](_0x577a20[_0x27e2('0x2a')],_0x577a20[_0x27e2('0x2b')]);_0x45c444[_0x27e2('0x2f')]=_[_0x27e2('0x2d')](_0x577a20[_0x27e2('0x2a')],qs[_0x27e2('0x2e')](_0xf7ddc9[_0x27e2('0x2b')][_0x27e2('0x2e')]));_0x45c444[_0x27e2('0x2f')]=_0x45c444[_0x27e2('0x2f')][_0x27e2('0x28')]?_0x45c444[_0x27e2('0x2f')]:_0x577a20[_0x27e2('0x2a')];if(!_0xf7ddc9[_0x27e2('0x2b')][_0x27e2('0x52')](_0x27e2('0xc5'))){_0x45c444[_0x27e2('0x16')]=qs[_0x27e2('0x16')](_0xf7ddc9['query'][_0x27e2('0x16')]);_0x45c444[_0x27e2('0x15')]=qs['offset'](_0xf7ddc9['query']['offset']);}_0x45c444[_0x27e2('0x30')]=qs[_0x27e2('0x31')](_0xf7ddc9[_0x27e2('0x2b')]['sort']);_0x45c444[_0x27e2('0x32')]=qs[_0x27e2('0x2c')](_[_0x27e2('0xc3')](_0xf7ddc9[_0x27e2('0x2b')],_0x577a20[_0x27e2('0x2c')]));_0x45c444[_0x27e2('0x32')][_0x27e2('0xdc')]=_0x193a25['id'];if(_0xf7ddc9[_0x27e2('0x2b')][_0x27e2('0x5b')]){_0x45c444[_0x27e2('0x32')]=_[_0x27e2('0x8a')](_0x45c444[_0x27e2('0x32')],{'$or':_[_0x27e2('0x51')](_0x45c444[_0x27e2('0x2f')],function(_0x167fb1){var _0x18a3c3={};_0x18a3c3[_0x167fb1]={'$like':'%'+_0xf7ddc9['query'][_0x27e2('0x5b')]+'%'};return _0x18a3c3;})});}_0x45c444=_[_0x27e2('0x8a')]({},_0x45c444,_0xf7ddc9[_0x27e2('0xc4')]);return db[_0x27e2('0xa0')]['count']({'where':_0x45c444['where']})[_0x27e2('0x1b')](function(_0x179e59){_0x4e8268['count']=_0x179e59;if(_0xf7ddc9[_0x27e2('0x2b')][_0x27e2('0xdd')]){_0x45c444[_0x27e2('0xe0')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x27e2('0x86')](_0x45c444);})['then'](function(_0x3f57a3){_0x4e8268[_0x27e2('0xde')]=_0x3f57a3;return _0x4e8268;});}})[_0x27e2('0x1b')](respondWithFilteredResult(_0xb9e4af,_0x45c444))[_0x27e2('0x80')](handleError(_0xb9e4af,null));};exports[_0x27e2('0xe1')]=function(_0x58137e,_0x2066eb){var _0x8a5ca8={'raw':!![],'where':{}};var _0x2459d0={};var _0x428aae={'count':0x0,'rows':[]};return db[_0x27e2('0x76')][_0x27e2('0xc1')]({'where':{'id':_0x58137e['params']['id']}})[_0x27e2('0x1b')](handleEntityNotFound(_0x2066eb,null))[_0x27e2('0x1b')](function(_0x51eae0){if(_0x51eae0){_0x2459d0[_0x27e2('0x2a')]=_[_0x27e2('0x23')](db['CmHopperFinal'][_0x27e2('0xc2')]);_0x2459d0[_0x27e2('0x2b')]=_[_0x27e2('0x23')](_0x58137e[_0x27e2('0x2b')]);_0x2459d0[_0x27e2('0x2c')]=_[_0x27e2('0x2d')](_0x2459d0[_0x27e2('0x2a')],_0x2459d0['query']);_0x8a5ca8['attributes']=_[_0x27e2('0x2d')](_0x2459d0[_0x27e2('0x2a')],qs[_0x27e2('0x2e')](_0x58137e[_0x27e2('0x2b')][_0x27e2('0x2e')]));_0x8a5ca8[_0x27e2('0x2f')]=_0x8a5ca8[_0x27e2('0x2f')][_0x27e2('0x28')]?_0x8a5ca8['attributes']:_0x2459d0[_0x27e2('0x2a')];if(!_0x58137e['query'][_0x27e2('0x52')](_0x27e2('0xc5'))){_0x8a5ca8[_0x27e2('0x16')]=qs['limit'](_0x58137e['query'][_0x27e2('0x16')]);_0x8a5ca8[_0x27e2('0x15')]=qs[_0x27e2('0x15')](_0x58137e['query']['offset']);}_0x8a5ca8[_0x27e2('0x30')]=qs['sort'](_0x58137e[_0x27e2('0x2b')]['sort']);_0x8a5ca8['where']=qs[_0x27e2('0x2c')](_[_0x27e2('0xc3')](_0x58137e[_0x27e2('0x2b')],_0x2459d0[_0x27e2('0x2c')]));_0x8a5ca8[_0x27e2('0x32')][_0x27e2('0xdc')]=_0x51eae0['id'];if(_0x58137e[_0x27e2('0x2b')][_0x27e2('0x5b')]){_0x8a5ca8[_0x27e2('0x32')]=_[_0x27e2('0x8a')](_0x8a5ca8[_0x27e2('0x32')],{'$or':_[_0x27e2('0x51')](_0x8a5ca8[_0x27e2('0x2f')],function(_0x5a3f04){var _0x5a8656={};_0x5a8656[_0x5a3f04]={'$like':'%'+_0x58137e['query'][_0x27e2('0x5b')]+'%'};return _0x5a8656;})});}_0x8a5ca8=_[_0x27e2('0x8a')]({},_0x8a5ca8,_0x58137e['options']);return db[_0x27e2('0x9f')][_0x27e2('0x14')]({'where':_0x8a5ca8[_0x27e2('0x32')]})[_0x27e2('0x1b')](function(_0x4f98b2){_0x428aae[_0x27e2('0x14')]=_0x4f98b2;if(_0x58137e[_0x27e2('0x2b')][_0x27e2('0xdd')]){_0x8a5ca8[_0x27e2('0xe0')]=[{'all':!![]}];}return db[_0x27e2('0x9f')]['findAll'](_0x8a5ca8);})[_0x27e2('0x1b')](function(_0x29cc54){_0x428aae[_0x27e2('0xde')]=_0x29cc54;return _0x428aae;});}})[_0x27e2('0x1b')](respondWithFilteredResult(_0x2066eb,_0x8a5ca8))[_0x27e2('0x80')](handleError(_0x2066eb,null));};exports[_0x27e2('0xe2')]=function(_0x5cfc48,_0x32a13d){var _0x16d54c={'raw':!![],'where':{}};var _0x2ebb36={};var _0x480570={'count':0x0,'rows':[]};return db[_0x27e2('0x76')][_0x27e2('0xc1')]({'where':{'id':_0x5cfc48[_0x27e2('0xb0')]['id']}})[_0x27e2('0x1b')](handleEntityNotFound(_0x32a13d,null))[_0x27e2('0x1b')](function(_0x168840){if(_0x168840){_0x2ebb36[_0x27e2('0x2a')]=_[_0x27e2('0x23')](db['JscriptySessionReport']['rawAttributes']);_0x2ebb36[_0x27e2('0x2b')]=_['keys'](_0x5cfc48[_0x27e2('0x2b')]);_0x2ebb36[_0x27e2('0x2c')]=_['intersection'](_0x2ebb36[_0x27e2('0x2a')],_0x2ebb36['query']);_0x16d54c[_0x27e2('0x2f')]=_[_0x27e2('0x2d')](_0x2ebb36[_0x27e2('0x2a')],qs[_0x27e2('0x2e')](_0x5cfc48[_0x27e2('0x2b')][_0x27e2('0x2e')]));_0x16d54c[_0x27e2('0x2f')]=_0x16d54c[_0x27e2('0x2f')]['length']?_0x16d54c[_0x27e2('0x2f')]:_0x2ebb36[_0x27e2('0x2a')];if(!_0x5cfc48['query'][_0x27e2('0x52')](_0x27e2('0xc5'))){_0x16d54c[_0x27e2('0x16')]=qs[_0x27e2('0x16')](_0x5cfc48[_0x27e2('0x2b')][_0x27e2('0x16')]);_0x16d54c[_0x27e2('0x15')]=qs[_0x27e2('0x15')](_0x5cfc48[_0x27e2('0x2b')][_0x27e2('0x15')]);}_0x16d54c[_0x27e2('0x30')]=qs[_0x27e2('0x31')](_0x5cfc48[_0x27e2('0x2b')][_0x27e2('0x31')]);_0x16d54c[_0x27e2('0x32')]=qs[_0x27e2('0x2c')](_[_0x27e2('0xc3')](_0x5cfc48[_0x27e2('0x2b')],_0x2ebb36['filters']));_0x16d54c['where']['ContactId']=_0x168840['id'];if(_0x5cfc48['query'][_0x27e2('0x5b')]){_0x16d54c[_0x27e2('0x32')]=_[_0x27e2('0x8a')](_0x16d54c[_0x27e2('0x32')],{'$or':_[_0x27e2('0x51')](_0x16d54c[_0x27e2('0x2f')],function(_0x495aa7){var _0xab2d8a={};_0xab2d8a[_0x495aa7]={'$like':'%'+_0x5cfc48['query'][_0x27e2('0x5b')]+'%'};return _0xab2d8a;})});}_0x16d54c=_[_0x27e2('0x8a')]({},_0x16d54c,_0x5cfc48[_0x27e2('0xc4')]);return db[_0x27e2('0xa5')][_0x27e2('0x14')]({'where':_0x16d54c[_0x27e2('0x32')]})[_0x27e2('0x1b')](function(_0x2c283b){_0x480570['count']=_0x2c283b;if(_0x5cfc48[_0x27e2('0x2b')]['includeAll']){_0x16d54c['include']=[{'all':!![]}];}return db[_0x27e2('0xa5')]['findAll'](_0x16d54c);})[_0x27e2('0x1b')](function(_0xaa0e1e){_0x480570[_0x27e2('0xde')]=_0xaa0e1e;return _0x480570;});}})[_0x27e2('0x1b')](respondWithFilteredResult(_0x32a13d,_0x16d54c))[_0x27e2('0x80')](handleError(_0x32a13d,null));};exports['uploadCsv']=function(_0x55a09a,_0x2eb71f){try{if(!_0x55a09a['body'][_0x27e2('0x56')]){throw new Error(_0x27e2('0xe3'));}if(!_0x55a09a[_0x27e2('0x8b')][_0x27e2('0xe4')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x55a09a[_0x27e2('0x8b')][_0x27e2('0xe5')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x55a09a['body'][_0x27e2('0xe6')]){throw new Error(_0x27e2('0xe7'));}var _0x336fea=_0x55a09a[_0x27e2('0x8b')][_0x27e2('0xe4')]['split'](',');var _0x1c4b35=_0x55a09a['body'][_0x27e2('0xe5')]['split'](',');if(!_0x336fea[_0x27e2('0x28')]||!_0x1c4b35[_0x27e2('0x28')]||_0x336fea[_0x27e2('0x28')]!==_0x1c4b35[_0x27e2('0x28')]){throw new Error(_0x27e2('0xe8'));}_0x55a09a[_0x27e2('0x8b')][_0x27e2('0x2e')]=_[_0x27e2('0xe9')](_0x336fea,_0x1c4b35);if(!_0x55a09a[_0x27e2('0x8b')][_0x27e2('0x2e')]['phone']){throw new Error(_0x27e2('0xea'));}if(!_0x55a09a[_0x27e2('0x8b')][_0x27e2('0x2e')]['firstName']){throw new Error(_0x27e2('0xeb'));}var _0x462897=path['join'](config['root'],_0x27e2('0xec'),_0x55a09a[_0x27e2('0xed')][_0x27e2('0xee')]);fs[_0x27e2('0xef')](_0x462897,parseInt(_0x27e2('0xf0'),0x8));var _0x3ba78e=require(_0x27e2('0xf1'))[_0x27e2('0xf2')](path[_0x27e2('0x8d')](__dirname,_0x27e2('0xf3')),[_0x462897,_0x55a09a['body'][_0x27e2('0xe4')],_0x55a09a['body']['binding_values'],_0x55a09a[_0x27e2('0x8b')][_0x27e2('0x56')],_0x55a09a[_0x27e2('0x8b')]['CompanyId'],_0x55a09a[_0x27e2('0x8b')]['duplicates'],_0x55a09a['body'][_0x27e2('0xe6')]]);return _0x2eb71f[_0x27e2('0x12')](0xc8)[_0x27e2('0x19')]({'message':'File\x20uploaded\x20correctly!','pid':_0x3ba78e[_0x27e2('0xf4')]});}catch(_0x1c3307){return _0x2eb71f[_0x27e2('0x12')](0x1f4)[_0x27e2('0x20')](_0x1c3307);}};exports[_0x27e2('0xf5')]=function(_0x361139,_0x8bc05){var _0x44272=fs[_0x27e2('0xf6')](_0x361139[_0x27e2('0xed')][_0x27e2('0x2')]);Papa[_0x27e2('0xf7')](_0x44272,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c1819){return _0x8bc05['status'](0xc8)['json']({'file':_0x361139[_0x27e2('0xed')],'fields':_0x5c1819[_0x27e2('0xf8')][_0x27e2('0x2e')]});}});};exports[_0x27e2('0xf9')]=function(_0x5906b1,_0x21ab6f){return db[_0x27e2('0x70')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x27e2('0x6e')}})[_0x27e2('0x1b')](function(_0xa351fb){var _0x541eae=![];if(!_0x5906b1['body']['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x5906b1['body'][_0x27e2('0xfa')][_0x27e2('0xbf')]){throw new Error(_0x27e2('0xea'));}if(!_0x5906b1[_0x27e2('0x8b')][_0x27e2('0xfa')][_0x27e2('0xfb')]){throw new Error(_0x27e2('0xeb'));}if(!_0x5906b1[_0x27e2('0x8b')][_0x27e2('0xe6')]){throw new Error(_0x27e2('0xe7'));}var _0x5a6ba0=require(_0x27e2('0xf1'))[_0x27e2('0xf2')](path[_0x27e2('0x8d')](__dirname,_0x27e2('0xfc')),[_0x5906b1[_0x27e2('0xb0')]['id'],JSON[_0x27e2('0xfd')](_0x5906b1[_0x27e2('0x8b')]),JSON[_0x27e2('0xfd')](_0xa351fb)]);_0x5a6ba0['on'](_0x27e2('0xfe'),function(){_0x541eae=!![];return _0x21ab6f[_0x27e2('0x12')](0xc8)['json']({'message':_0x27e2('0xff'),'pid':_0x5a6ba0[_0x27e2('0xf4')]});});_0x5a6ba0['on'](_0x27e2('0x100'),function(_0x4c51e9){if(_0x4c51e9&&!_0x541eae){return _0x21ab6f[_0x27e2('0x12')](0x1f4)[_0x27e2('0x19')]({'message':_0x27e2('0x101'),'pid':_0x5a6ba0[_0x27e2('0xf4')]});}});})[_0x27e2('0x80')](handleError(_0x21ab6f,null));};exports[_0x27e2('0x102')]=function(_0x588751,_0xd6d1d0,_0x54beef){return db[_0x27e2('0x70')][_0x27e2('0x86')]({'raw':!![],'attributes':['id'],'where':{'role':_0x27e2('0x6e')}})[_0x27e2('0x1b')](function(_0x10b8b8){var _0x1a31a3=![];if(!_0x588751[_0x27e2('0x8b')][_0x27e2('0x56')]){throw new Error(_0x27e2('0xe3'));}if(!_0x588751[_0x27e2('0x8b')][_0x27e2('0xfa')]['phone']){throw new Error(_0x27e2('0xea'));}if(!_0x588751[_0x27e2('0x8b')][_0x27e2('0xfa')][_0x27e2('0xfb')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x588751['body'][_0x27e2('0xe6')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x5f1431=require('child_process')[_0x27e2('0xf2')](path[_0x27e2('0x8d')](__dirname,'../../components/import/cm/csvUpdates'),[_0x588751['params']['id'],JSON['stringify'](_0x588751[_0x27e2('0x8b')]),JSON[_0x27e2('0xfd')](_0x10b8b8)]);_0x5f1431['on'](_0x27e2('0xfe'),function(_0x157053){_0x1a31a3=!![];return _0xd6d1d0['status'](0xc8)[_0x27e2('0x19')]({'message':_0x27e2('0xff'),'pid':_0x5f1431[_0x27e2('0xf4')]});});_0x5f1431['on'](_0x27e2('0x100'),function(_0x5d142d){if(_0x5d142d&&!_0x1a31a3){return _0xd6d1d0[_0x27e2('0x12')](0x1f4)[_0x27e2('0x19')]({'message':_0x27e2('0x101'),'pid':_0x5f1431['pid']});}});})[_0x27e2('0x80')](handleError(_0xd6d1d0,null));};exports['getJourney']=function(_0x2bc986,_0x4055a5){var _0x3de567=[_0x27e2('0x103'),_0x27e2('0x104'),'sms',_0x27e2('0x105'),_0x27e2('0x106'),_0x27e2('0x107'),'voice'];var _0x3b42bf={'offset':0x0,'order':qs[_0x27e2('0x31')](_0x27e2('0x108'))},_0x4ffbf4={'count':0x0,'rows':[]};Promise[_0x27e2('0x6b')]()[_0x27e2('0x1b')](function(){if(_0x2bc986[_0x27e2('0x2b')][_0x27e2('0x109')]){if(!_[_0x27e2('0x10a')](_0x3de567,_0x2bc986['query'][_0x27e2('0x109')][_0x27e2('0x10b')]())){throw new Error('Invalid\x20channel');}_0x3de567=[_0x2bc986['query'][_0x27e2('0x109')][_0x27e2('0x10b')]()];}if(_0x2bc986[_0x27e2('0x2b')][_0x27e2('0x10c')]){try{var _0x92c71b=JSON[_0x27e2('0xf7')](_0x2bc986[_0x27e2('0x2b')]['range']);if(!moment(_0x92c71b['from'])['isValid']()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x92c71b['to'])[_0x27e2('0x10d')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x1771fb){throw new Error(_0x27e2('0x10e'));}}if(!_0x2bc986[_0x27e2('0x2b')][_0x27e2('0x52')]('nolimit')){_0x3b42bf[_0x27e2('0x16')]=qs['limit'](_0x2bc986[_0x27e2('0x2b')][_0x27e2('0x16')]||0xa);_0x3b42bf[_0x27e2('0x15')]=qs['offset'](_0x2bc986['query']['offset']);}var _0x39ae51=_0x3de567[_0x27e2('0x51')](function(_0x43fc9f){if(_0x43fc9f===_0x27e2('0x10f')){var _0x3c2d4d={'attributes':['id','uniqueid','type','source',_0x27e2('0x110'),_0x27e2('0x111'),_0x27e2('0x112'),_0x27e2('0x113'),_0x27e2('0x114'),_0x27e2('0x115'),_0x27e2('0x116'),'userDisposition','userSecondDisposition',_0x27e2('0x117'),_0x27e2('0x118')],'where':{'ContactId':_0x2bc986[_0x27e2('0xb0')]['id']},'include':[{'model':db[_0x27e2('0x70')],'as':_0x27e2('0x70'),'attributes':['id','name',_0x27e2('0x119'),_0x27e2('0x11a')]}],'order':[[_0x27e2('0x116'),_0x27e2('0x69')]]};if(_0x2bc986['query'][_0x27e2('0x10c')]){_0x3c2d4d[_0x27e2('0x32')]['createdAt']={'$gte':_0x92c71b['from'],'$lte':_0x92c71b['to']};}return db['VoiceCallReport'][_0x27e2('0x11b')](_0x3c2d4d)['then'](function(_0x49ef14){_0x4ffbf4[_0x27e2('0x14')]+=_0x49ef14[_0x27e2('0x14')];return _['map'](_0x49ef14[_0x27e2('0xde')],function(_0x2fbf5f){var _0x2d403d=_0x2fbf5f[_0x27e2('0x8c')]({'plain':!![]});_0x2d403d[_0x27e2('0x109')]=_0x43fc9f;if(_0x2d403d[_0x27e2('0x70')]){_0x2d403d[_0x27e2('0x70')]={'id':_0x2d403d[_0x27e2('0x70')]['id'],'name':_0x2d403d['User']['name'],'fullname':_0x2d403d[_0x27e2('0x70')][_0x27e2('0x119')],'alias':_0x2d403d[_0x27e2('0x70')]['alias']};}return _0x2d403d;});});}else{var _0x1138a1=_['startCase'](_0x43fc9f)+(_0x43fc9f===_0x27e2('0x104')?_0x27e2('0x11c'):_0x27e2('0x11d'));var _0x3ae15d={'attributes':['id',_0x27e2('0x11e'),_0x27e2('0x11f'),_0x27e2('0x116'),_0x27e2('0x115'),_0x27e2('0x120'),'secondDisposition',_0x27e2('0x121'),'UserId',_0x1138a1+'Id'],'where':{'ContactId':_0x2bc986[_0x27e2('0xb0')]['id']},'include':[{'model':db[_0x1138a1],'as':_0x27e2('0x11d'),'attributes':['id',_0x27e2('0x35'),_0x27e2('0x122')]},{'model':db[_0x27e2('0x70')],'as':_0x27e2('0x123'),'attributes':['id',_0x27e2('0x35'),_0x27e2('0x119')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x27e2('0x35'),_0x27e2('0x36')],'through':{'attributes':[]}}],'order':[['createdAt',_0x27e2('0x69')]]};if(_0x2bc986[_0x27e2('0x2b')][_0x27e2('0x10c')]){_0x3ae15d[_0x27e2('0x32')][_0x27e2('0x116')]={'$gte':_0x92c71b['from'],'$lte':_0x92c71b['to']};}switch(_0x43fc9f){case _0x27e2('0x104'):_0x3ae15d[_0x27e2('0x2f')][_0x27e2('0x25')](_0x27e2('0x124'),'customerIp',_0x27e2('0x125'),'deviceModel',_0x27e2('0x126'),_0x27e2('0x127'),_0x27e2('0x128'),'ratingValue',_0x27e2('0x129'));break;case _0x27e2('0x103'):_0x3ae15d[_0x27e2('0x2f')][_0x27e2('0x25')]('subject',_0x27e2('0x12a'));break;case _0x27e2('0x105'):_0x3ae15d['attributes'][_0x27e2('0x25')]('externalUrl','threadId');break;}return db[_['startCase'](_0x43fc9f)+_0x27e2('0x12b')][_0x27e2('0x11b')](_0x3ae15d)[_0x27e2('0x1b')](function(_0x1181e6){_0x4ffbf4[_0x27e2('0x14')]+=_0x1181e6[_0x27e2('0x14')];return _['map'](_0x1181e6[_0x27e2('0xde')],function(_0x3f4337){var _0x40a1aa=_0x3f4337[_0x27e2('0x8c')]({'plain':!![]});_0x40a1aa[_0x27e2('0x109')]=_0x43fc9f;if(_0x40a1aa['Owner']){_0x40a1aa[_0x27e2('0x123')]={'id':_0x40a1aa[_0x27e2('0x123')]['id'],'name':_0x40a1aa[_0x27e2('0x123')][_0x27e2('0x35')],'fullname':_0x40a1aa[_0x27e2('0x123')][_0x27e2('0x119')]};}return _0x40a1aa;});});}});return Promise['all'](_0x39ae51);})[_0x27e2('0x1b')](function(_0x248d27){return _(_0x248d27)[_0x27e2('0x12c')]()[_0x27e2('0x12d')]('createdAt')[_0x27e2('0x12e')]()[_0x27e2('0x49')]();})['then'](function(_0x2bbe38){_0x4ffbf4[_0x27e2('0xde')]=_0x3b42bf[_0x27e2('0x16')]?_0x2bbe38[_0x27e2('0x12f')](_0x3b42bf[_0x27e2('0x15')],_0x3b42bf['offset']+_0x3b42bf['limit']):_0x2bbe38;return _0x4ffbf4;})[_0x27e2('0x1b')](respondWithFilteredResult(_0x4055a5,_0x3b42bf))['catch'](handleError(_0x4055a5,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index bbdd4ba..8b35dc2 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 _0x8208=['events','CmContact','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x50885e,_0x4141cc){var _0x323f7b=function(_0x599143){while(--_0x599143){_0x50885e['push'](_0x50885e['shift']());}};_0x323f7b(++_0x4141cc);}(_0x8208,0xc6));var _0x8820=function(_0x1b9acf,_0x4c5e53){_0x1b9acf=_0x1b9acf-0x0;var _0x2b3421=_0x8208[_0x1b9acf];return _0x2b3421;};'use strict';var EventEmitter=require(_0x8820('0x0'));var CmContact=require('../../mysqldb')['db'][_0x8820('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x8820('0x2')](0x0);var events={'afterCreate':_0x8820('0x3'),'afterUpdate':_0x8820('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3551dd){return function(_0x1566c7,_0x496224,_0x495323){CmContactEvents[_0x8820('0x5')](_0x3551dd+':'+_0x1566c7['id'],_0x1566c7);CmContactEvents[_0x8820('0x5')](_0x3551dd,_0x1566c7);_0x495323(null);};}for(var e in events){if(events[_0x8820('0x6')](e)){var event=events[e];CmContact[_0x8820('0x7')](e,emitEvent(event));}}module[_0x8820('0x8')]=CmContactEvents; \ No newline at end of file +var _0x09bf=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09bf,0x1f0));var _0xf09b=function(_0x443285,_0x6e0652){_0x443285=_0x443285-0x0;var _0x22c69f=_0x09bf[_0x443285];return _0x22c69f;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xf09b('0x0'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xf09b('0x1')](0x0);var events={'afterCreate':_0xf09b('0x2'),'afterUpdate':_0xf09b('0x3'),'afterDestroy':_0xf09b('0x4')};function emitEvent(_0x5650af){return function(_0x1291a,_0x4d5ad8,_0x2ec129){CmContactEvents[_0xf09b('0x5')](_0x5650af+':'+_0x1291a['id'],_0x1291a);CmContactEvents[_0xf09b('0x5')](_0x5650af,_0x1291a);_0x2ec129(null);};}for(var e in events){if(events[_0xf09b('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xf09b('0x7')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 978e1bd..10fbbd6 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 _0x6cad=['message','always','onlyIfOpen','List\x20not\x20found','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','timezones','dialTimezone','utcOffset','add','minutes','format','then','ret','CmHopper','findOne','cmContact,\x20afterCreate\x20','create','ListId','priority','callbackUniqueid','catch','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','inspect','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s'];(function(_0x3ea6a2,_0x178338){var _0x557b1f=function(_0x18470e){while(--_0x18470e){_0x3ea6a2['push'](_0x3ea6a2['shift']());}};_0x557b1f(++_0x178338);}(_0x6cad,0xf4));var _0xd6ca=function(_0x3acb1a,_0x19eb95){_0x3acb1a=_0x3acb1a-0x0;var _0x4c96bb=_0x6cad[_0x3acb1a];return _0x4c96bb;};'use strict';var _=require(_0xd6ca('0x0'));var util=require(_0xd6ca('0x1'));var logger=require(_0xd6ca('0x2'))(_0xd6ca('0x3'));var moment=require(_0xd6ca('0x4'));var BPromise=require(_0xd6ca('0x5'));var rp=require(_0xd6ca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd6ca('0x7'));var shared=require(_0xd6ca('0x8'));var attributes=require(_0xd6ca('0x9'));module[_0xd6ca('0xa')]=function(_0x45456c,_0x5cc6c1){return _0x45456c[_0xd6ca('0xb')](_0xd6ca('0xc'),attributes,{'tableName':_0xd6ca('0xd'),'paranoid':!![],'indexes':[{'name':_0xd6ca('0xe'),'fields':[_0xd6ca('0xe')]},{'name':_0xd6ca('0xf'),'fields':[_0xd6ca('0x10'),'lastName',_0xd6ca('0xe'),_0xd6ca('0x11'),_0xd6ca('0x12'),_0xd6ca('0x13')],'type':_0xd6ca('0x14')}],'timestamps':!![],'charset':_0xd6ca('0x15'),'collate':_0xd6ca('0x16'),'hooks':{'afterCreate':function(_0x449f17,_0x2ae3cc,_0x50918c){var _0x22b15f=_0x45456c[_0xd6ca('0x17')];var _0x88b088=_0x449f17[_0xd6ca('0x18')]({'plain':!![]});function _0x240d32(){return function(_0x4f2470){logger[_0xd6ca('0x19')](_0xd6ca('0x1a'),_0xd6ca('0x1b'),util['inspect'](_0x4f2470,{'showHidden':![],'depth':null}));};}function _0xb2a8dc(_0x5a98bb,_0x211bd1){var _0x385df1=_0x211bd1[_0xd6ca('0x1c')]?_0x211bd1[_0xd6ca('0x1c')]:moment()['format'](_0xd6ca('0x1d'));return new BPromise(function(_0xb913a9,_0x125b0d){if(_[_0xd6ca('0x1e')](_0x211bd1['dialTimezone'])){_0xb913a9({'ret':_0x385df1});}else{_0x22b15f['VoiceQueue']['findOne']({'where':{'id':_0x5a98bb['id']}})['then'](function(_0x26ec82){if(!_[_0xd6ca('0x1e')](_0x26ec82)){var _0x188561=_0x26ec82['dialTimezone'];if(!_['isNil'](_0x188561)){var _0x12d619=shared[_0xd6ca('0x1f')];var _0x2afccd=_0x12d619[_0x188561];var _0x333983=_0x12d619[_0x211bd1[_0xd6ca('0x20')]];if(!_[_0xd6ca('0x1e')](_0x2afccd)&&!_[_0xd6ca('0x1e')](_0x333983)){var _0x4ded8b=_0x2afccd[_0xd6ca('0x21')]-_0x333983[_0xd6ca('0x21')];_0x385df1=_0x211bd1['scheduledat']?_0x211bd1[_0xd6ca('0x1c')]:moment();var _0x310fcc=moment(_0x385df1)[_0xd6ca('0x22')](_0x4ded8b,_0xd6ca('0x23'));_0xb913a9({'ret':_0x310fcc[_0xd6ca('0x24')](_0xd6ca('0x1d'))});}else _0xb913a9({'ret':_0x385df1});}else _0xb913a9({'ret':_0x385df1});}else{_0xb913a9({'ret':_0x385df1});}});}});return 0xa;}var _0x4fca43=function(_0x28627a){return new BPromise(function(_0x4fb841,_0x11f706){_0xb2a8dc(_0x28627a,_0x88b088)[_0xd6ca('0x25')](function(_0x1943b4){_0x88b088[_0xd6ca('0x1c')]=_0x1943b4[_0xd6ca('0x26')];_0x22b15f[_0xd6ca('0x27')][_0xd6ca('0x28')]({'where':{'phone':_0x88b088[_0xd6ca('0xe')],'VoiceQueueId':_0x28627a['id']}})[_0xd6ca('0x25')](function(_0x2e5421){if(!_[_0xd6ca('0x1e')](_0x2e5421)){throw new Error(_0xd6ca('0x29')+_0x88b088[_0xd6ca('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x28627a['id']);}return _0x22b15f[_0xd6ca('0x27')][_0xd6ca('0x2a')]({'phone':_0x88b088[_0xd6ca('0xe')],'ContactId':_0x88b088['id'],'ListId':_0x88b088[_0xd6ca('0x2b')],'priority':_0x88b088[_0xd6ca('0x2c')]?_0x88b088['priority']:0x2,'scheduledat':_0x88b088['scheduledat']?_0x88b088[_0xd6ca('0x1c')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x88b088[_0xd6ca('0x2d')]?!![]:![],'callbackuniqueid':_0x88b088['callbackUniqueid']?_0x88b088[_0xd6ca('0x2d')]:undefined,'callbackat':_0x88b088['callbackUniqueid']?moment()[_0xd6ca('0x24')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x28627a['id']});})[_0xd6ca('0x2e')](function(_0xc3c97b){_0x11f706(_0xc3c97b);});});});};var _0x5c4d82=function(_0xda22c0){return new BPromise(function(_0x7b3532,_0x4efd2d){_0xb2a8dc(_0xda22c0,_0x88b088)['then'](function(_0x38a065){_0x88b088['scheduledat']=_0x38a065[_0xd6ca('0x26')];_0x22b15f[_0xd6ca('0x27')]['findOne']({'where':{'phone':_0x88b088['phone'],'VoiceQueueId':_0xda22c0['id']}})[_0xd6ca('0x25')](function(_0x3137c0){if(!_[_0xd6ca('0x1e')](_0x3137c0)){throw new Error(_0xd6ca('0x29')+_0x88b088[_0xd6ca('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0xda22c0['id']);}return _0x22b15f[_0xd6ca('0x2f')][_0xd6ca('0x28')]({'where':{'calleridnum':_0x88b088[_0xd6ca('0xe')],'VoiceQueueId':_0xda22c0['id']}});})[_0xd6ca('0x25')](function(_0x2a22d8){if(!_[_0xd6ca('0x1e')](_0x2a22d8)){throw new Error(_0xd6ca('0x30')+_0x88b088[_0xd6ca('0xe')]+_0xd6ca('0x31')+_0xda22c0['id']);}return _0x22b15f[_0xd6ca('0x27')][_0xd6ca('0x2a')]({'phone':_0x88b088[_0xd6ca('0xe')],'ContactId':_0x88b088['id'],'ListId':_0x88b088[_0xd6ca('0x2b')],'priority':_0x88b088[_0xd6ca('0x2c')]?_0x88b088[_0xd6ca('0x2c')]:0x2,'scheduledat':_0x88b088[_0xd6ca('0x1c')]?_0x88b088['scheduledat']:moment()[_0xd6ca('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x88b088[_0xd6ca('0x2d')]?!![]:![],'callbackuniqueid':_0x88b088[_0xd6ca('0x2d')]?_0x88b088[_0xd6ca('0x2d')]:undefined,'callbackat':_0x88b088[_0xd6ca('0x2d')]?moment()['format'](_0xd6ca('0x1d')):undefined,'VoiceQueueId':_0xda22c0['id']});})[_0xd6ca('0x2e')](function(_0x134f46){_0x4efd2d(_0x134f46);});});});};function _0x569e79(){return function(_0x305e13){logger[_0xd6ca('0x19')](_0xd6ca('0x1a'),_0xd6ca('0x1b'),util[_0xd6ca('0x32')](_0x305e13,{'showHidden':![],'depth':null}));};}function _0x5851b2(_0x527b3f,_0x39509a){var _0x4d76a5=_0x39509a[_0xd6ca('0x1c')]?_0x39509a['scheduledat']:moment()[_0xd6ca('0x24')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x3ec441,_0x2db26e){if(_[_0xd6ca('0x1e')](_0x39509a['dialTimezone'])){_0x3ec441({'ret':_0x4d76a5});}else{_0x22b15f[_0xd6ca('0x33')][_0xd6ca('0x28')]({'where':{'id':_0x527b3f['id']}})[_0xd6ca('0x25')](function(_0x33ab5d){if(!_[_0xd6ca('0x1e')](_0x33ab5d)){var _0x1f318a=_0x33ab5d[_0xd6ca('0x20')];if(!_[_0xd6ca('0x1e')](_0x1f318a)){var _0x9e82d8=shared[_0xd6ca('0x1f')];var _0x2a5480=_0x9e82d8[_0x1f318a];var _0x5819d3=_0x9e82d8[_0x39509a[_0xd6ca('0x20')]];if(!_[_0xd6ca('0x1e')](_0x2a5480)&&!_[_0xd6ca('0x1e')](_0x5819d3)){var _0x2d0551=_0x2a5480[_0xd6ca('0x21')]-_0x5819d3[_0xd6ca('0x21')];_0x4d76a5=_0x39509a['scheduledat']?_0x39509a[_0xd6ca('0x1c')]:moment();var _0x1f9e3c=moment(_0x4d76a5)[_0xd6ca('0x22')](_0x2d0551,_0xd6ca('0x23'));_0x3ec441({'ret':_0x1f9e3c[_0xd6ca('0x24')](_0xd6ca('0x1d'))});}else _0x3ec441({'ret':_0x4d76a5});}else _0x3ec441({'ret':_0x4d76a5});}else{_0x3ec441({'ret':_0x4d76a5});}});}});return 0xa;}var _0x310fff=function(_0x5aa1fe){return new BPromise(function(_0x363f53,_0xa0e01){_0x5851b2(_0x5aa1fe,_0x88b088)[_0xd6ca('0x25')](function(_0x5b4712){_0x88b088[_0xd6ca('0x1c')]=_0x5b4712[_0xd6ca('0x26')];_0x22b15f['CmHopper'][_0xd6ca('0x28')]({'where':{'phone':_0x88b088[_0xd6ca('0xe')],'CampaignId':_0x5aa1fe['id']}})[_0xd6ca('0x25')](function(_0x2bedf8){if(!_[_0xd6ca('0x1e')](_0x2bedf8)){throw new Error(_0xd6ca('0x29')+_0x88b088[_0xd6ca('0xe')]+_0xd6ca('0x34')+_0x5aa1fe['id']);}return _0x22b15f[_0xd6ca('0x27')][_0xd6ca('0x2a')]({'phone':_0x88b088[_0xd6ca('0xe')],'ContactId':_0x88b088['id'],'ListId':_0x88b088[_0xd6ca('0x2b')],'priority':_0x88b088[_0xd6ca('0x2c')]?_0x88b088[_0xd6ca('0x2c')]:0x2,'scheduledat':_0x88b088[_0xd6ca('0x1c')]?_0x88b088[_0xd6ca('0x1c')]:moment()[_0xd6ca('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x88b088['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x88b088[_0xd6ca('0x2d')]?_0x88b088[_0xd6ca('0x2d')]:undefined,'callbackat':_0x88b088['callbackUniqueid']?moment()['format'](_0xd6ca('0x1d')):undefined,'CampaignId':_0x5aa1fe['id']});})[_0xd6ca('0x2e')](function(_0x5af27b){_0xa0e01(_0x5af27b);});});});};var _0x5dfa25=function(_0x144f30){return new BPromise(function(_0x139c28,_0x1084db){_0x5851b2(_0x144f30,_0x88b088)['then'](function(_0x1de19b){_0x88b088[_0xd6ca('0x1c')]=_0x1de19b[_0xd6ca('0x26')];_0x22b15f[_0xd6ca('0x27')][_0xd6ca('0x28')]({'where':{'phone':_0x88b088['phone'],'CampaignId':_0x144f30['id']}})[_0xd6ca('0x25')](function(_0x256fda){if(!_[_0xd6ca('0x1e')](_0x256fda)){throw new Error('cmContact,\x20afterCreate\x20'+_0x88b088[_0xd6ca('0xe')]+_0xd6ca('0x35')+_0x144f30['id']);}return _0x22b15f[_0xd6ca('0x2f')][_0xd6ca('0x28')]({'where':{'calleridnum':_0x88b088['phone'],'CampaignId':_0x144f30['id']}});})[_0xd6ca('0x25')](function(_0x287d7c){if(!_[_0xd6ca('0x1e')](_0x287d7c)){throw new Error(_0xd6ca('0x30')+_0x88b088[_0xd6ca('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x144f30['id']);}return _0x22b15f['CmHopper'][_0xd6ca('0x2a')]({'phone':_0x88b088[_0xd6ca('0xe')],'ContactId':_0x88b088['id'],'ListId':_0x88b088[_0xd6ca('0x2b')],'priority':_0x88b088['priority']?_0x88b088[_0xd6ca('0x2c')]:0x2,'scheduledat':_0x88b088['scheduledat']?_0x88b088[_0xd6ca('0x1c')]:moment()[_0xd6ca('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x88b088[_0xd6ca('0x2d')]?!![]:![],'callbackuniqueid':_0x88b088['callbackUniqueid']?_0x88b088[_0xd6ca('0x2d')]:undefined,'callbackat':_0x88b088[_0xd6ca('0x2d')]?moment()[_0xd6ca('0x24')](_0xd6ca('0x1d')):undefined,'CampaignId':_0x144f30['id']});})[_0xd6ca('0x2e')](function(_0xe84d02){_0x1084db(_0xe84d02);});});});};if(_0x88b088[_0xd6ca('0x2b')]){_0x22b15f[_0xd6ca('0x36')][_0xd6ca('0x37')]({'where':{'type':_0xd6ca('0x38')},'attributes':['id',_0xd6ca('0x39'),'dialTimezone'],'include':[{'model':_0x22b15f[_0xd6ca('0x3a')],'as':_0xd6ca('0x3b'),'where':{'id':_0x88b088[_0xd6ca('0x2b')]}}]})['then'](function(_0x287a6b){if(_0x287a6b){var _0x318df6=[];for(var _0x4dd124=0x0,_0x59730b;_0x4dd124<_0x287a6b[_0xd6ca('0x3c')];_0x4dd124+=0x1){_0x59730b=_0x287a6b[_0x4dd124]['get']({'plain':!![]});switch(_0x59730b[_0xd6ca('0x39')]){case'always':_0x5c4d82(_0x59730b)[_0xd6ca('0x2e')](_0x240d32());break;case'onlyIfOpen':_0x4fca43(_0x59730b)['catch'](_0x240d32());break;default:_0x5851b2(_0x59730b,_0x88b088)[_0xd6ca('0x25')](function(_0x19b03b){_0x88b088[_0xd6ca('0x1c')]=_0x19b03b[_0xd6ca('0x26')];_0x22b15f[_0xd6ca('0x27')][_0xd6ca('0x2a')]({'phone':_0x88b088[_0xd6ca('0xe')],'ContactId':_0x88b088['id'],'ListId':_0x88b088[_0xd6ca('0x2b')],'scheduledat':_0x88b088[_0xd6ca('0x1c')]?_0x88b088[_0xd6ca('0x1c')]:moment()[_0xd6ca('0x24')](_0xd6ca('0x1d')),'priority':_0x88b088[_0xd6ca('0x2c')]?_0x88b088['priority']:0x2,'callback':_0x88b088['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x88b088[_0xd6ca('0x2d')]?_0x88b088['callbackUniqueid']:undefined,'callbackat':_0x88b088[_0xd6ca('0x2d')]?moment()[_0xd6ca('0x24')](_0xd6ca('0x1d')):undefined,'VoiceQueueId':_0x59730b['id']})[_0xd6ca('0x2e')](_0x240d32());});}}}})[_0xd6ca('0x25')](function(){return _0x22b15f[_0xd6ca('0x36')][_0xd6ca('0x37')]({'where':{'type':_0xd6ca('0x38')},'attributes':['id'],'include':[{'model':_0x22b15f['CmList'],'as':_0xd6ca('0x3d'),'where':{'id':_0x88b088[_0xd6ca('0x2b')]}}]})['then'](function(_0xd5773a){if(_0xd5773a){var _0x4b9787=[];for(var _0x5b845c=0x0,_0x1ee826;_0x5b845c<_0xd5773a[_0xd6ca('0x3c')];_0x5b845c+=0x1){_0x1ee826=_0xd5773a[_0x5b845c][_0xd6ca('0x18')]({'plain':!![]});_0x22b15f[_0xd6ca('0x3e')][_0xd6ca('0x2a')]({'phone':_0x88b088[_0xd6ca('0xe')],'ContactId':_0x88b088['id'],'ListId':_0x88b088['ListId'],'VoiceQueueId':_0x1ee826['id']})['catch'](function(_0x5a8f43){logger[_0xd6ca('0x19')](_0xd6ca('0x3f'),_0xd6ca('0x1b'),_0x5a8f43[_0xd6ca('0x40')]);});}}});})['then'](function(){return _0x22b15f['Campaign'][_0xd6ca('0x37')]({'attributes':['id','dialCheckDuplicateType',_0xd6ca('0x20')],'include':[{'model':_0x22b15f[_0xd6ca('0x3a')],'as':'Lists','where':{'id':_0x88b088[_0xd6ca('0x2b')]}}]})[_0xd6ca('0x25')](function(_0x519900){if(_0x519900){var _0x497558=[];for(var _0x48461f=0x0,_0xd1a00b;_0x48461f<_0x519900[_0xd6ca('0x3c')];_0x48461f+=0x1){_0xd1a00b=_0x519900[_0x48461f][_0xd6ca('0x18')]({'plain':!![]});switch(_0xd1a00b['dialCheckDuplicateType']){case _0xd6ca('0x41'):_0x5dfa25(_0xd1a00b)[_0xd6ca('0x2e')](_0x569e79());break;case _0xd6ca('0x42'):_0x310fff(_0xd1a00b)[_0xd6ca('0x2e')](_0x569e79());break;default:_0x22b15f[_0xd6ca('0x27')][_0xd6ca('0x2a')]({'phone':_0x88b088[_0xd6ca('0xe')],'ContactId':_0x88b088['id'],'ListId':_0x88b088[_0xd6ca('0x2b')],'scheduledat':_0x88b088[_0xd6ca('0x1c')]?_0x88b088['scheduledat']:moment()[_0xd6ca('0x24')](_0xd6ca('0x1d')),'priority':_0x88b088[_0xd6ca('0x2c')]?_0x88b088['priority']:0x2,'callback':_0x88b088['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x88b088[_0xd6ca('0x2d')]?_0x88b088['callbackUniqueid']:undefined,'callbackat':_0x88b088['callbackUniqueid']?moment()[_0xd6ca('0x24')](_0xd6ca('0x1d')):undefined,'CampaignId':_0xd1a00b['id']})[_0xd6ca('0x2e')](_0x569e79());}}}});})[_0xd6ca('0x25')](function(){return _0x22b15f[_0xd6ca('0x33')][_0xd6ca('0x37')]({'attributes':['id'],'include':[{'model':_0x22b15f[_0xd6ca('0x3a')],'as':'BlackLists','where':{'id':_0x88b088[_0xd6ca('0x2b')]}}]})['then'](function(_0xd8ed3c){if(_0xd8ed3c){var _0x552d5f=[];for(var _0x4b7d5c=0x0,_0x56d8d1;_0x4b7d5c<_0xd8ed3c['length'];_0x4b7d5c+=0x1){_0x56d8d1=_0xd8ed3c[_0x4b7d5c][_0xd6ca('0x18')]({'plain':!![]});_0x22b15f[_0xd6ca('0x3e')][_0xd6ca('0x2a')]({'phone':_0x88b088[_0xd6ca('0xe')],'ContactId':_0x88b088['id'],'ListId':_0x88b088[_0xd6ca('0x2b')],'CampaignId':_0x56d8d1['id']})[_0xd6ca('0x2e')](function(_0x299ee3){logger[_0xd6ca('0x19')](_0xd6ca('0x3f'),_0xd6ca('0x1b'),_0x299ee3[_0xd6ca('0x40')]);});}}});})[_0xd6ca('0x25')](function(){_0x50918c();})['catch'](function(_0x2e7eb5){logger[_0xd6ca('0x19')](_0xd6ca('0x3f'),_0xd6ca('0x1b'),_0x2e7eb5[_0xd6ca('0x40')]);_0x50918c(_0x2e7eb5);});}else{_0x50918c(new Error(_0xd6ca('0x43')));}},'afterDestroy':function(_0x2cdd88,_0x49563b,_0x42a3d0){var _0x54c4f9=_0x45456c['models'];var _0x53dcae=_0x2cdd88[_0xd6ca('0x18')]({'plain':!![]});return _0x54c4f9['CmHopper'][_0xd6ca('0x37')]({'raw':!![],'where':{'ListId':_0x53dcae['ListId'],'ContactId':_0x53dcae['id']}})[_0xd6ca('0x25')](function(_0x31eb07){if(!_['isEmpty'](_0x31eb07)){var _0x4f1cfb=[];for(var _0x2f3cb4=0x0;_0x2f3cb4<_0x31eb07[_0xd6ca('0x3c')];_0x2f3cb4+=0x1){var _0xcc86a4=_0x54c4f9['CmHopper'][_0xd6ca('0x44')]({'where':{'ListId':_0x31eb07[_0x2f3cb4][_0xd6ca('0x2b')],'ContactId':_0x31eb07[_0x2f3cb4][_0xd6ca('0x45')],'VoiceQueueId':_0x31eb07[_0x2f3cb4][_0xd6ca('0x46')],'CampaignId':_0x31eb07[_0x2f3cb4][_0xd6ca('0x47')]}});_0x4f1cfb[_0xd6ca('0x48')](_0xcc86a4);}return BPromise[_0xd6ca('0x49')](_0x4f1cfb);}})[_0xd6ca('0x25')](function(_0x79c911){logger[_0xd6ca('0x4a')](_0xd6ca('0x4b'),util[_0xd6ca('0x32')](_0x79c911,{'showHidden':![],'depth':null}));_0x42a3d0();})[_0xd6ca('0x2e')](function(_0x2062cc){logger['error'](_0xd6ca('0x4c'),util[_0xd6ca('0x32')](_0x2062cc,{'showHidden':![],'depth':null}));_0x42a3d0(_0x2062cc);});}}});}; \ No newline at end of file +var _0xf007=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','Campaign','findAll','message','List\x20not\x20found','isEmpty','ContactId','VoiceQueueId','CampaignId','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','minutes','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','ret'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0xf007,0x13d));var _0x7f00=function(_0x5c6951,_0x507abb){_0x5c6951=_0x5c6951-0x0;var _0x5ee145=_0xf007[_0x5c6951];return _0x5ee145;};'use strict';var _=require(_0x7f00('0x0'));var util=require(_0x7f00('0x1'));var logger=require(_0x7f00('0x2'))('api');var moment=require(_0x7f00('0x3'));var BPromise=require(_0x7f00('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7f00('0x5'));var config=require(_0x7f00('0x6'));var shared=require(_0x7f00('0x7'));var attributes=require(_0x7f00('0x8'));module[_0x7f00('0x9')]=function(_0x3bbb4d,_0x404f0e){return _0x3bbb4d[_0x7f00('0xa')](_0x7f00('0xb'),attributes,{'tableName':_0x7f00('0xc'),'paranoid':!![],'indexes':[{'name':_0x7f00('0xd'),'fields':[_0x7f00('0xd')]},{'name':_0x7f00('0xe'),'fields':[_0x7f00('0xf'),'lastName',_0x7f00('0xd'),'mobile',_0x7f00('0x10'),_0x7f00('0x11')],'type':_0x7f00('0x12')}],'timestamps':!![],'charset':_0x7f00('0x13'),'collate':_0x7f00('0x14'),'hooks':{'afterCreate':function(_0x146fa2,_0x4acc4d,_0x30ae4d){var _0x167673=_0x3bbb4d[_0x7f00('0x15')];var _0x4ccb8b=_0x146fa2[_0x7f00('0x16')]({'plain':!![]});function _0x17ccff(){return function(_0x1c072d){logger[_0x7f00('0x17')](_0x7f00('0x18'),_0x7f00('0x19'),util[_0x7f00('0x1a')](_0x1c072d,{'showHidden':![],'depth':null}));};}function _0x8a35e6(_0x2f5455,_0x1ccfba){var _0x96c15=_0x1ccfba[_0x7f00('0x1b')]?_0x1ccfba['scheduledat']:moment()[_0x7f00('0x1c')](_0x7f00('0x1d'));return new BPromise(function(_0x42014f,_0x28f292){if(_[_0x7f00('0x1e')](_0x1ccfba[_0x7f00('0x1f')])){_0x42014f({'ret':_0x96c15});}else{_0x167673[_0x7f00('0x20')][_0x7f00('0x21')]({'where':{'id':_0x2f5455['id']}})[_0x7f00('0x22')](function(_0x46d640){if(!_[_0x7f00('0x1e')](_0x46d640)){var _0x4d4625=_0x46d640[_0x7f00('0x1f')];if(!_[_0x7f00('0x1e')](_0x4d4625)){var _0x28156a=shared[_0x7f00('0x23')];var _0x3824a2=_0x28156a[_0x4d4625];var _0x37ff3f=_0x28156a[_0x1ccfba[_0x7f00('0x1f')]];if(!_[_0x7f00('0x1e')](_0x3824a2)&&!_[_0x7f00('0x1e')](_0x37ff3f)){var _0x1f9b9b=_0x3824a2[_0x7f00('0x24')]-_0x37ff3f[_0x7f00('0x24')];_0x96c15=_0x1ccfba['scheduledat']?_0x1ccfba['scheduledat']:moment();var _0x1aa35d=moment(_0x96c15)[_0x7f00('0x25')](_0x1f9b9b,_0x7f00('0x26'));_0x42014f({'ret':_0x1aa35d['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x42014f({'ret':_0x96c15});}else _0x42014f({'ret':_0x96c15});}else{_0x42014f({'ret':_0x96c15});}});}});return 0xa;}var _0x28506e=function(_0x2cb586){return new BPromise(function(_0xb2115e,_0x3dc982){_0x8a35e6(_0x2cb586,_0x4ccb8b)['then'](function(_0xfbf300){_0x4ccb8b[_0x7f00('0x1b')]=_0xfbf300['ret'];_0x167673[_0x7f00('0x27')]['findOne']({'where':{'phone':_0x4ccb8b[_0x7f00('0xd')],'VoiceQueueId':_0x2cb586['id']}})[_0x7f00('0x22')](function(_0x34392e){if(!_['isNil'](_0x34392e)){throw new Error(_0x7f00('0x28')+_0x4ccb8b['phone']+_0x7f00('0x29')+_0x2cb586['id']);}return _0x167673['CmHopper'][_0x7f00('0x2a')]({'phone':_0x4ccb8b['phone'],'ContactId':_0x4ccb8b['id'],'ListId':_0x4ccb8b[_0x7f00('0x2b')],'priority':_0x4ccb8b[_0x7f00('0x2c')]?_0x4ccb8b['priority']:0x2,'scheduledat':_0x4ccb8b[_0x7f00('0x1b')]?_0x4ccb8b[_0x7f00('0x1b')]:moment()[_0x7f00('0x1c')](_0x7f00('0x1d')),'callback':_0x4ccb8b['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4ccb8b['callbackUniqueid']?_0x4ccb8b[_0x7f00('0x2d')]:undefined,'callbackat':_0x4ccb8b[_0x7f00('0x2d')]?moment()[_0x7f00('0x1c')](_0x7f00('0x1d')):undefined,'VoiceQueueId':_0x2cb586['id']});})[_0x7f00('0x2e')](function(_0x54cf7d){_0x3dc982(_0x54cf7d);});});});};var _0x16942e=function(_0x6ff981){return new BPromise(function(_0x31682b,_0x1186c3){_0x8a35e6(_0x6ff981,_0x4ccb8b)['then'](function(_0x51228b){_0x4ccb8b[_0x7f00('0x1b')]=_0x51228b[_0x7f00('0x2f')];_0x167673[_0x7f00('0x27')][_0x7f00('0x21')]({'where':{'phone':_0x4ccb8b[_0x7f00('0xd')],'VoiceQueueId':_0x6ff981['id']}})[_0x7f00('0x22')](function(_0xfdeb72){if(!_[_0x7f00('0x1e')](_0xfdeb72)){throw new Error(_0x7f00('0x28')+_0x4ccb8b[_0x7f00('0xd')]+_0x7f00('0x30')+_0x6ff981['id']);}return _0x167673[_0x7f00('0x31')]['findOne']({'where':{'calleridnum':_0x4ccb8b['phone'],'VoiceQueueId':_0x6ff981['id']}});})[_0x7f00('0x22')](function(_0x2d24c4){if(!_['isNil'](_0x2d24c4)){throw new Error(_0x7f00('0x32')+_0x4ccb8b['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x6ff981['id']);}return _0x167673[_0x7f00('0x27')][_0x7f00('0x2a')]({'phone':_0x4ccb8b[_0x7f00('0xd')],'ContactId':_0x4ccb8b['id'],'ListId':_0x4ccb8b['ListId'],'priority':_0x4ccb8b[_0x7f00('0x2c')]?_0x4ccb8b['priority']:0x2,'scheduledat':_0x4ccb8b['scheduledat']?_0x4ccb8b[_0x7f00('0x1b')]:moment()[_0x7f00('0x1c')](_0x7f00('0x1d')),'callback':_0x4ccb8b[_0x7f00('0x2d')]?!![]:![],'callbackuniqueid':_0x4ccb8b['callbackUniqueid']?_0x4ccb8b[_0x7f00('0x2d')]:undefined,'callbackat':_0x4ccb8b[_0x7f00('0x2d')]?moment()['format'](_0x7f00('0x1d')):undefined,'VoiceQueueId':_0x6ff981['id']});})[_0x7f00('0x2e')](function(_0x309368){_0x1186c3(_0x309368);});});});};function _0x3ea901(){return function(_0x2f5e38){logger['error'](_0x7f00('0x18'),_0x7f00('0x19'),util[_0x7f00('0x1a')](_0x2f5e38,{'showHidden':![],'depth':null}));};}function _0x51b424(_0x489b34,_0x45acab){var _0x26a5d6=_0x45acab[_0x7f00('0x1b')]?_0x45acab[_0x7f00('0x1b')]:moment()[_0x7f00('0x1c')](_0x7f00('0x1d'));return new BPromise(function(_0x54b3e1,_0x52df34){if(_[_0x7f00('0x1e')](_0x45acab['dialTimezone'])){_0x54b3e1({'ret':_0x26a5d6});}else{_0x167673['Campaign'][_0x7f00('0x21')]({'where':{'id':_0x489b34['id']}})[_0x7f00('0x22')](function(_0x5b414c){if(!_['isNil'](_0x5b414c)){var _0x1a7e36=_0x5b414c[_0x7f00('0x1f')];if(!_[_0x7f00('0x1e')](_0x1a7e36)){var _0xbf907b=shared[_0x7f00('0x23')];var _0x487be5=_0xbf907b[_0x1a7e36];var _0x216a63=_0xbf907b[_0x45acab[_0x7f00('0x1f')]];if(!_[_0x7f00('0x1e')](_0x487be5)&&!_['isNil'](_0x216a63)){var _0x1e87be=_0x487be5[_0x7f00('0x24')]-_0x216a63['utcOffset'];_0x26a5d6=_0x45acab[_0x7f00('0x1b')]?_0x45acab[_0x7f00('0x1b')]:moment();var _0x1f85e5=moment(_0x26a5d6)[_0x7f00('0x25')](_0x1e87be,_0x7f00('0x26'));_0x54b3e1({'ret':_0x1f85e5[_0x7f00('0x1c')](_0x7f00('0x1d'))});}else _0x54b3e1({'ret':_0x26a5d6});}else _0x54b3e1({'ret':_0x26a5d6});}else{_0x54b3e1({'ret':_0x26a5d6});}});}});return 0xa;}var _0x2ba592=function(_0x52339a){return new BPromise(function(_0x37c7de,_0x3579aa){_0x51b424(_0x52339a,_0x4ccb8b)[_0x7f00('0x22')](function(_0x4f1e20){_0x4ccb8b['scheduledat']=_0x4f1e20['ret'];_0x167673[_0x7f00('0x27')][_0x7f00('0x21')]({'where':{'phone':_0x4ccb8b[_0x7f00('0xd')],'CampaignId':_0x52339a['id']}})['then'](function(_0x52ece1){if(!_[_0x7f00('0x1e')](_0x52ece1)){throw new Error(_0x7f00('0x28')+_0x4ccb8b['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x52339a['id']);}return _0x167673[_0x7f00('0x27')][_0x7f00('0x2a')]({'phone':_0x4ccb8b[_0x7f00('0xd')],'ContactId':_0x4ccb8b['id'],'ListId':_0x4ccb8b[_0x7f00('0x2b')],'priority':_0x4ccb8b[_0x7f00('0x2c')]?_0x4ccb8b[_0x7f00('0x2c')]:0x2,'scheduledat':_0x4ccb8b[_0x7f00('0x1b')]?_0x4ccb8b[_0x7f00('0x1b')]:moment()['format'](_0x7f00('0x1d')),'callback':_0x4ccb8b['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4ccb8b[_0x7f00('0x2d')]?_0x4ccb8b[_0x7f00('0x2d')]:undefined,'callbackat':_0x4ccb8b[_0x7f00('0x2d')]?moment()[_0x7f00('0x1c')](_0x7f00('0x1d')):undefined,'CampaignId':_0x52339a['id']});})['catch'](function(_0x2a6968){_0x3579aa(_0x2a6968);});});});};var _0x35c335=function(_0x3301f0){return new BPromise(function(_0x3ae730,_0x36de14){_0x51b424(_0x3301f0,_0x4ccb8b)['then'](function(_0x3aa36f){_0x4ccb8b['scheduledat']=_0x3aa36f[_0x7f00('0x2f')];_0x167673[_0x7f00('0x27')][_0x7f00('0x21')]({'where':{'phone':_0x4ccb8b['phone'],'CampaignId':_0x3301f0['id']}})[_0x7f00('0x22')](function(_0xd5e0b){if(!_[_0x7f00('0x1e')](_0xd5e0b)){throw new Error(_0x7f00('0x28')+_0x4ccb8b[_0x7f00('0xd')]+_0x7f00('0x33')+_0x3301f0['id']);}return _0x167673['CmHopperFinal'][_0x7f00('0x21')]({'where':{'calleridnum':_0x4ccb8b[_0x7f00('0xd')],'CampaignId':_0x3301f0['id']}});})[_0x7f00('0x22')](function(_0xdfe657){if(!_[_0x7f00('0x1e')](_0xdfe657)){throw new Error(_0x7f00('0x32')+_0x4ccb8b['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x3301f0['id']);}return _0x167673[_0x7f00('0x27')]['create']({'phone':_0x4ccb8b[_0x7f00('0xd')],'ContactId':_0x4ccb8b['id'],'ListId':_0x4ccb8b[_0x7f00('0x2b')],'priority':_0x4ccb8b[_0x7f00('0x2c')]?_0x4ccb8b[_0x7f00('0x2c')]:0x2,'scheduledat':_0x4ccb8b[_0x7f00('0x1b')]?_0x4ccb8b[_0x7f00('0x1b')]:moment()[_0x7f00('0x1c')](_0x7f00('0x1d')),'callback':_0x4ccb8b[_0x7f00('0x2d')]?!![]:![],'callbackuniqueid':_0x4ccb8b['callbackUniqueid']?_0x4ccb8b[_0x7f00('0x2d')]:undefined,'callbackat':_0x4ccb8b['callbackUniqueid']?moment()[_0x7f00('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3301f0['id']});})[_0x7f00('0x2e')](function(_0x58f4f4){_0x36de14(_0x58f4f4);});});});};if(_0x4ccb8b[_0x7f00('0x2b')]){_0x167673[_0x7f00('0x20')]['findAll']({'where':{'type':_0x7f00('0x34')},'attributes':['id',_0x7f00('0x35'),_0x7f00('0x1f')],'include':[{'model':_0x167673[_0x7f00('0x36')],'as':_0x7f00('0x37'),'where':{'id':_0x4ccb8b[_0x7f00('0x2b')]}}]})[_0x7f00('0x22')](function(_0x29cdb9){if(_0x29cdb9){var _0x3e5f61=[];for(var _0xe64c7d=0x0,_0x590873;_0xe64c7d<_0x29cdb9[_0x7f00('0x38')];_0xe64c7d+=0x1){_0x590873=_0x29cdb9[_0xe64c7d][_0x7f00('0x16')]({'plain':!![]});switch(_0x590873[_0x7f00('0x35')]){case _0x7f00('0x39'):_0x16942e(_0x590873)[_0x7f00('0x2e')](_0x17ccff());break;case _0x7f00('0x3a'):_0x28506e(_0x590873)[_0x7f00('0x2e')](_0x17ccff());break;default:_0x51b424(_0x590873,_0x4ccb8b)[_0x7f00('0x22')](function(_0x558053){_0x4ccb8b[_0x7f00('0x1b')]=_0x558053['ret'];_0x167673[_0x7f00('0x27')][_0x7f00('0x2a')]({'phone':_0x4ccb8b[_0x7f00('0xd')],'ContactId':_0x4ccb8b['id'],'ListId':_0x4ccb8b[_0x7f00('0x2b')],'scheduledat':_0x4ccb8b[_0x7f00('0x1b')]?_0x4ccb8b[_0x7f00('0x1b')]:moment()['format'](_0x7f00('0x1d')),'priority':_0x4ccb8b[_0x7f00('0x2c')]?_0x4ccb8b[_0x7f00('0x2c')]:0x2,'callback':_0x4ccb8b['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4ccb8b[_0x7f00('0x2d')]?_0x4ccb8b[_0x7f00('0x2d')]:undefined,'callbackat':_0x4ccb8b[_0x7f00('0x2d')]?moment()[_0x7f00('0x1c')](_0x7f00('0x1d')):undefined,'VoiceQueueId':_0x590873['id']})[_0x7f00('0x2e')](_0x17ccff());});}}}})[_0x7f00('0x22')](function(){return _0x167673[_0x7f00('0x20')]['findAll']({'where':{'type':_0x7f00('0x34')},'attributes':['id'],'include':[{'model':_0x167673['CmList'],'as':_0x7f00('0x3b'),'where':{'id':_0x4ccb8b[_0x7f00('0x2b')]}}]})[_0x7f00('0x22')](function(_0x9a4001){if(_0x9a4001){var _0x4cf2e0=[];for(var _0x34ba4e=0x0,_0x59d012;_0x34ba4e<_0x9a4001[_0x7f00('0x38')];_0x34ba4e+=0x1){_0x59d012=_0x9a4001[_0x34ba4e][_0x7f00('0x16')]({'plain':!![]});_0x167673[_0x7f00('0x3c')][_0x7f00('0x2a')]({'phone':_0x4ccb8b[_0x7f00('0xd')],'ContactId':_0x4ccb8b['id'],'ListId':_0x4ccb8b[_0x7f00('0x2b')],'VoiceQueueId':_0x59d012['id']})[_0x7f00('0x2e')](function(_0x4db471){logger[_0x7f00('0x17')](_0x7f00('0x3d'),_0x7f00('0x19'),_0x4db471['message']);});}}});})[_0x7f00('0x22')](function(){return _0x167673[_0x7f00('0x3e')][_0x7f00('0x3f')]({'attributes':['id',_0x7f00('0x35'),_0x7f00('0x1f')],'include':[{'model':_0x167673[_0x7f00('0x36')],'as':_0x7f00('0x37'),'where':{'id':_0x4ccb8b[_0x7f00('0x2b')]}}]})['then'](function(_0x3cf7dc){if(_0x3cf7dc){var _0x146619=[];for(var _0x440843=0x0,_0xd54936;_0x440843<_0x3cf7dc['length'];_0x440843+=0x1){_0xd54936=_0x3cf7dc[_0x440843]['get']({'plain':!![]});switch(_0xd54936[_0x7f00('0x35')]){case _0x7f00('0x39'):_0x35c335(_0xd54936)[_0x7f00('0x2e')](_0x3ea901());break;case'onlyIfOpen':_0x2ba592(_0xd54936)[_0x7f00('0x2e')](_0x3ea901());break;default:_0x167673['CmHopper']['create']({'phone':_0x4ccb8b[_0x7f00('0xd')],'ContactId':_0x4ccb8b['id'],'ListId':_0x4ccb8b['ListId'],'scheduledat':_0x4ccb8b[_0x7f00('0x1b')]?_0x4ccb8b[_0x7f00('0x1b')]:moment()['format'](_0x7f00('0x1d')),'priority':_0x4ccb8b['priority']?_0x4ccb8b[_0x7f00('0x2c')]:0x2,'callback':_0x4ccb8b[_0x7f00('0x2d')]?!![]:![],'callbackuniqueid':_0x4ccb8b[_0x7f00('0x2d')]?_0x4ccb8b[_0x7f00('0x2d')]:undefined,'callbackat':_0x4ccb8b[_0x7f00('0x2d')]?moment()[_0x7f00('0x1c')](_0x7f00('0x1d')):undefined,'CampaignId':_0xd54936['id']})[_0x7f00('0x2e')](_0x3ea901());}}}});})[_0x7f00('0x22')](function(){return _0x167673['Campaign']['findAll']({'attributes':['id'],'include':[{'model':_0x167673[_0x7f00('0x36')],'as':_0x7f00('0x3b'),'where':{'id':_0x4ccb8b[_0x7f00('0x2b')]}}]})[_0x7f00('0x22')](function(_0x2e05f7){if(_0x2e05f7){var _0x4c41d5=[];for(var _0xa0f76f=0x0,_0x2447c0;_0xa0f76f<_0x2e05f7[_0x7f00('0x38')];_0xa0f76f+=0x1){_0x2447c0=_0x2e05f7[_0xa0f76f]['get']({'plain':!![]});_0x167673[_0x7f00('0x3c')][_0x7f00('0x2a')]({'phone':_0x4ccb8b[_0x7f00('0xd')],'ContactId':_0x4ccb8b['id'],'ListId':_0x4ccb8b[_0x7f00('0x2b')],'CampaignId':_0x2447c0['id']})[_0x7f00('0x2e')](function(_0x4b7ce1){logger[_0x7f00('0x17')](_0x7f00('0x3d'),'afterCreate',_0x4b7ce1['message']);});}}});})[_0x7f00('0x22')](function(){_0x30ae4d();})[_0x7f00('0x2e')](function(_0x2073b4){logger[_0x7f00('0x17')]('cmContact,\x20%s,\x20%s','afterCreate',_0x2073b4[_0x7f00('0x40')]);_0x30ae4d(_0x2073b4);});}else{_0x30ae4d(new Error(_0x7f00('0x41')));}},'afterDestroy':function(_0x1dd5dd,_0x4a1e1b,_0x55b6b4){var _0x1c4611=_0x3bbb4d[_0x7f00('0x15')];var _0x4a861e=_0x1dd5dd[_0x7f00('0x16')]({'plain':!![]});return _0x1c4611[_0x7f00('0x27')][_0x7f00('0x3f')]({'raw':!![],'where':{'ListId':_0x4a861e['ListId'],'ContactId':_0x4a861e['id']}})[_0x7f00('0x22')](function(_0x2951f2){if(!_[_0x7f00('0x42')](_0x2951f2)){var _0x485b06=[];for(var _0x4b1dc5=0x0;_0x4b1dc5<_0x2951f2['length'];_0x4b1dc5+=0x1){var _0x120f48=_0x1c4611[_0x7f00('0x27')]['destroy']({'where':{'ListId':_0x2951f2[_0x4b1dc5][_0x7f00('0x2b')],'ContactId':_0x2951f2[_0x4b1dc5][_0x7f00('0x43')],'VoiceQueueId':_0x2951f2[_0x4b1dc5][_0x7f00('0x44')],'CampaignId':_0x2951f2[_0x4b1dc5][_0x7f00('0x45')]}});_0x485b06['push'](_0x120f48);}return BPromise['all'](_0x485b06);}})[_0x7f00('0x22')](function(_0x2239f0){logger[_0x7f00('0x46')](_0x7f00('0x47'),util[_0x7f00('0x1a')](_0x2239f0,{'showHidden':![],'depth':null}));_0x55b6b4();})['catch'](function(_0x29ba62){logger[_0x7f00('0x17')](_0x7f00('0x48'),util[_0x7f00('0x1a')](_0x29ba62,{'showHidden':![],'depth':null}));_0x55b6b4(_0x29ba62);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 61c209a..feb2a89 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 _0x7217=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','attributes','limit','include','map','model','phone','length','CmContactHasItem','find','Contact','GetCmContact\x20debug\x20contactHasItems','isNil','CmContactId','GetCmContact\x20debug\x20found\x20contactId','create','body','keys','startsWith','update','table','cm_contacts','set','id\x20=\x20?','sequelize','CreateCmContact','lodash','moment','bluebird','randomstring','ioredis','squel'];(function(_0x5c1345,_0x40116e){var _0x1c070d=function(_0x1e862f){while(--_0x1e862f){_0x5c1345['push'](_0x5c1345['shift']());}};_0x1c070d(++_0x40116e);}(_0x7217,0x19e));var _0x7721=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x7217[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var squel=require(_0x7721('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7721('0x6'))(_0x7721('0x7'));var config=require(_0x7721('0x8'));var jayson=require(_0x7721('0x9'));var client=jayson[_0x7721('0xa')][_0x7721('0xb')]({'port':0x232a});config[_0x7721('0xc')]=_[_0x7721('0xd')](config[_0x7721('0xc')],{'host':_0x7721('0xe'),'port':0x18eb});var socket=require(_0x7721('0xf'))(new Redis(config[_0x7721('0xc')]));require(_0x7721('0x10'))[_0x7721('0x11')](socket);function respondWithRpcPromise(_0x2c3986,_0x578d59,_0x461d1a){return new BPromise(function(_0x29bc8f,_0x8729a6){return client[_0x7721('0x12')](_0x2c3986,_0x461d1a)[_0x7721('0x13')](function(_0x409b37){logger[_0x7721('0x14')](_0x7721('0x15'),_0x578d59,'request\x20sent');logger[_0x7721('0x16')](_0x7721('0x17'),_0x578d59,'request\x20sent',JSON[_0x7721('0x18')](_0x409b37));if(_0x409b37[_0x7721('0x19')]){if(_0x409b37[_0x7721('0x19')][_0x7721('0x1a')]===0x1f4){logger['error'](_0x7721('0x15'),_0x578d59,_0x409b37[_0x7721('0x19')]['message']);return _0x8729a6(_0x409b37['error']['message']);}logger[_0x7721('0x19')](_0x7721('0x15'),_0x578d59,_0x409b37[_0x7721('0x19')][_0x7721('0x1b')]);return _0x29bc8f(_0x409b37['error'][_0x7721('0x1b')]);}else{logger['info'](_0x7721('0x15'),_0x578d59,'request\x20sent');_0x29bc8f(_0x409b37[_0x7721('0x1c')][_0x7721('0x1b')]);}})[_0x7721('0x1d')](function(_0x3e140d){logger[_0x7721('0x19')](_0x7721('0x15'),_0x578d59,_0x3e140d);_0x8729a6(_0x3e140d);});});}exports[_0x7721('0x1e')]=function(_0x413263){var _0x3b29ac=this;return new Promise(function(_0xaeccc4,_0x4ce1db){return db[_0x7721('0x1f')][_0x7721('0x20')]({'raw':_0x413263[_0x7721('0x21')]?_0x413263[_0x7721('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x413263[_0x7721('0x21')]?_0x413263['options'][_0x7721('0x22')]||null:null,'attributes':_0x413263[_0x7721('0x21')]?_0x413263[_0x7721('0x21')][_0x7721('0x23')]||null:null,'limit':_0x413263[_0x7721('0x21')]?_0x413263[_0x7721('0x21')][_0x7721('0x24')]||null:null,'include':_0x413263['options']?_0x413263[_0x7721('0x21')][_0x7721('0x25')]?_[_0x7721('0x26')](_0x413263[_0x7721('0x21')][_0x7721('0x25')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x27')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x23')],'include':_0x16355a[_0x7721('0x25')]?_['map'](_0x16355a[_0x7721('0x25')],function(_0x5b0551){return{'model':db[_0x5b0551['model']],'as':_0x5b0551['as'],'attributes':_0x5b0551[_0x7721('0x23')],'include':_0x5b0551[_0x7721('0x25')]?_[_0x7721('0x26')](_0x5b0551[_0x7721('0x25')],function(_0x1ea4d){return{'model':db[_0x1ea4d[_0x7721('0x27')]],'as':_0x1ea4d['as'],'attributes':_0x1ea4d[_0x7721('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7721('0x13')](function(_0x5c54f0){logger[_0x7721('0x14')](_0x7721('0x1e'),_0x413263);logger['info']('GetCmContact\x20debug\x20contact',_0x413263,JSON[_0x7721('0x18')](_0x5c54f0));logger[_0x7721('0x14')]('GetCmContact\x20debug\x20PHONE',_0x413263[_0x7721('0x21')][_0x7721('0x28')]);logger[_0x7721('0x16')]('GetCmContact',_0x413263,JSON[_0x7721('0x18')](_0x5c54f0));if(_0x5c54f0[_0x7721('0x29')]==0x0){return db[_0x7721('0x2a')][_0x7721('0x2b')]({'raw':!![],'where':{'item':_0x413263[_0x7721('0x21')]['phone']},'include':[{'model':db[_0x7721('0x1f')],'as':_0x7721('0x2c')}]})[_0x7721('0x13')](function(_0x5c5b33){logger[_0x7721('0x14')](_0x7721('0x2d'),JSON['stringify'](_0x5c5b33));if(_[_0x7721('0x2e')](_0x5c5b33)){_0xaeccc4(_0x5c54f0);}else{var _0x5ce026=_0x5c5b33[_0x7721('0x2f')];logger[_0x7721('0x14')](_0x7721('0x30'),_0x413263,_0x5ce026);return db[_0x7721('0x1f')][_0x7721('0x20')]({'raw':!![],'where':{'id':_0x5ce026},'attributes':_0x413263[_0x7721('0x21')]?_0x413263[_0x7721('0x21')][_0x7721('0x23')]||null:null})[_0x7721('0x13')](function(_0x3a2eb7){logger[_0x7721('0x14')]('GetCmContact\x20debug\x20contact\x20from\x20additional',_0x413263,JSON[_0x7721('0x18')](_0x3a2eb7));_0xaeccc4(_0x3a2eb7);});}});}else{_0xaeccc4(_0x5c54f0);}})['catch'](function(_0x212384){logger[_0x7721('0x19')](_0x7721('0x1e'),_0x212384[_0x7721('0x1b')],_0x413263);_0x4ce1db(_0x3b29ac[_0x7721('0x19')](0x1f4,_0x212384[_0x7721('0x1b')]));});});};exports['CreateCmContact']=function(_0x557c34){var _0x4cadef=this;return new Promise(function(_0x539560,_0x18001c){return db[_0x7721('0x1f')][_0x7721('0x31')](_0x557c34[_0x7721('0x32')],{'raw':_0x557c34['options']?_0x557c34[_0x7721('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x7721('0x13')](function(_0x11f356){var _0x5a278e;for(var _0x2041a2=0x0;_0x2041a2{}\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(_0x4ad284,_0x280d19){var _0x5ae926=function(_0x2feeda){while(--_0x2feeda){_0x4ad284['push'](_0x4ad284['shift']());}};_0x5ae926(++_0x280d19);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 c84329c..e9640d4 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 _0x0624=['INTEGER','STRING','PHONE'];(function(_0x33760d,_0x313eaa){var _0x3ca23c=function(_0x58f827){while(--_0x58f827){_0x33760d['push'](_0x33760d['shift']());}};_0x3ca23c(++_0x313eaa);}(_0x0624,0x132));var _0x4062=function(_0x3c31f7,_0x5581b5){_0x3c31f7=_0x3c31f7-0x0;var _0x170731=_0x0624[_0x3c31f7];return _0x170731;};'use strict';var Sequelize=require('sequelize');module['exports']={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x4062('0x0')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x4062('0x1')],'defaultValue':_0x4062('0x2')},'OrderBy':{'type':Sequelize[_0x4062('0x0')],'defaultValue':null},'description':{'type':Sequelize[_0x4062('0x1')],'defaultValue':null}}; \ No newline at end of file +var _0xb7c8=['PHONE','exports','INTEGER','STRING'];(function(_0x5b2f78,_0x5b508c){var _0x38f628=function(_0x100a17){while(--_0x100a17){_0x5b2f78['push'](_0x5b2f78['shift']());}};_0x38f628(++_0x5b508c);}(_0xb7c8,0x119));var _0x8b7c=function(_0x68c3a7,_0x1743fa){_0x68c3a7=_0x68c3a7-0x0;var _0x302476=_0xb7c8[_0x68c3a7];return _0x302476;};'use strict';var Sequelize=require('sequelize');module[_0x8b7c('0x0')]={'CmContactId':{'type':Sequelize[_0x8b7c('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x8b7c('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x8b7c('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x8b7c('0x2')],'defaultValue':_0x8b7c('0x3')},'OrderBy':{'type':Sequelize[_0x8b7c('0x1')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'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 44006c1..aa5e3ed 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 _0xb437=['then','destroy','get','CmContactHasItems','UserProfileResource','error','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','find','create','body','user','UserProfileSection','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','lodash','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','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','save'];(function(_0x4af184,_0x88df32){var _0x5359d3=function(_0x4ff334){while(--_0x4ff334){_0x4af184['push'](_0x4af184['shift']());}};_0x5359d3(++_0x88df32);}(_0xb437,0x112));var _0x7b43=function(_0x118653,_0x50ef26){_0x118653=_0x118653-0x0;var _0xc11fa6=_0xb437[_0x118653];return _0xc11fa6;};'use strict';var emlformat=require(_0x7b43('0x0'));var rimraf=require(_0x7b43('0x1'));var zipdir=require(_0x7b43('0x2'));var jsonpatch=require(_0x7b43('0x3'));var rp=require(_0x7b43('0x4'));var moment=require(_0x7b43('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7b43('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7b43('0x7'));var csv=require('to-csv');var ejs=require(_0x7b43('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b43('0x9'));var squel=require('squel');var crypto=require(_0x7b43('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7b43('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7b43('0xc'));var Papa=require(_0x7b43('0xd'));var Redis=require(_0x7b43('0xe'));var authService=require(_0x7b43('0xf'));var qs=require(_0x7b43('0x10'));var as=require(_0x7b43('0x11'));var hardwareService=require(_0x7b43('0x12'));var logger=require(_0x7b43('0x13'))(_0x7b43('0x14'));var utils=require(_0x7b43('0x15'));var config=require(_0x7b43('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7b43('0x17'))['db'];function respondWithStatusCode(_0x557ab5,_0x386f44){_0x386f44=_0x386f44||0xcc;return function(_0x2c02c3){if(_0x2c02c3){return _0x557ab5[_0x7b43('0x18')](_0x386f44);}return _0x557ab5[_0x7b43('0x19')](_0x386f44)[_0x7b43('0x1a')]();};}function respondWithResult(_0x438683,_0x2f5323){_0x2f5323=_0x2f5323||0xc8;return function(_0x195145){if(_0x195145){return _0x438683[_0x7b43('0x19')](_0x2f5323)[_0x7b43('0x1b')](_0x195145);}};}function respondWithFilteredResult(_0x17d851,_0xfd6e79){return function(_0x48f687){if(_0x48f687){var _0x52b289=typeof _0xfd6e79[_0x7b43('0x1c')]==='undefined'&&typeof _0xfd6e79[_0x7b43('0x1d')]==='undefined';var _0x128226=_0x48f687[_0x7b43('0x1e')];var _0x64c8cf=_0x52b289?0x0:_0xfd6e79['offset'];var _0x4065fa=_0x52b289?_0x48f687[_0x7b43('0x1e')]:_0xfd6e79[_0x7b43('0x1c')]+_0xfd6e79[_0x7b43('0x1d')];var _0x2055a6;if(_0x4065fa>=_0x128226){_0x4065fa=_0x128226;_0x2055a6=0xc8;}else{_0x2055a6=0xce;}_0x17d851[_0x7b43('0x19')](_0x2055a6);return _0x17d851['set'](_0x7b43('0x1f'),_0x64c8cf+'-'+_0x4065fa+'/'+_0x128226)[_0x7b43('0x1b')](_0x48f687);}return null;};}function patchUpdates(_0x4a4344){return function(_0x16505f){try{jsonpatch[_0x7b43('0x20')](_0x16505f,_0x4a4344,!![]);}catch(_0x52ea24){return BPromise['reject'](_0x52ea24);}return _0x16505f[_0x7b43('0x21')]();};}function saveUpdates(_0x5cc0d4,_0x3cc229){return function(_0x30b0e6){if(_0x30b0e6){return _0x30b0e6['update'](_0x5cc0d4)[_0x7b43('0x22')](function(_0x2dc5ff){return _0x2dc5ff;});}return null;};}function removeEntity(_0x533517,_0x28a617){return function(_0x208461){if(_0x208461){return _0x208461[_0x7b43('0x23')]()[_0x7b43('0x22')](function(){var _0x3ebccb=_0x208461[_0x7b43('0x24')]({'plain':!![]});var _0x556a5b=_0x7b43('0x25');return db[_0x7b43('0x26')][_0x7b43('0x23')]({'where':{'type':_0x556a5b,'resourceId':_0x3ebccb['id']}})[_0x7b43('0x22')](function(){return _0x208461;});})[_0x7b43('0x22')](function(){_0x533517['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5e13,_0x4a51ab){return function(_0x4a4873){if(!_0x4a4873){_0x2a5e13['sendStatus'](0x194);}return _0x4a4873;};}function handleError(_0x125f4b,_0x5815a2){_0x5815a2=_0x5815a2||0x1f4;return function(_0x113e31){logger[_0x7b43('0x27')](_0x113e31['stack']);if(_0x113e31[_0x7b43('0x28')]){delete _0x113e31[_0x7b43('0x28')];}_0x125f4b[_0x7b43('0x19')](_0x5815a2)[_0x7b43('0x29')](_0x113e31);};}exports[_0x7b43('0x2a')]=function(_0x3635c7,_0xfc699d){var _0x292f5d={},_0x39b994={},_0x43390a={'count':0x0,'rows':[]};var _0x20af46=_[_0x7b43('0x2b')](db[_0x7b43('0x2c')][_0x7b43('0x2d')],function(_0x37e37d){return{'name':_0x37e37d[_0x7b43('0x2e')],'type':_0x37e37d[_0x7b43('0x2f')][_0x7b43('0x30')]};});_0x39b994[_0x7b43('0x31')]=_['map'](_0x20af46,'name');_0x39b994[_0x7b43('0x32')]=_[_0x7b43('0x33')](_0x3635c7[_0x7b43('0x32')]);_0x39b994[_0x7b43('0x34')]=_[_0x7b43('0x35')](_0x39b994[_0x7b43('0x31')],_0x39b994[_0x7b43('0x32')]);_0x292f5d[_0x7b43('0x36')]=_[_0x7b43('0x35')](_0x39b994[_0x7b43('0x31')],qs[_0x7b43('0x37')](_0x3635c7['query'][_0x7b43('0x37')]));_0x292f5d['attributes']=_0x292f5d['attributes'][_0x7b43('0x38')]?_0x292f5d['attributes']:_0x39b994[_0x7b43('0x31')];if(!_0x3635c7['query'][_0x7b43('0x39')](_0x7b43('0x3a'))){_0x292f5d[_0x7b43('0x1d')]=qs[_0x7b43('0x1d')](_0x3635c7[_0x7b43('0x32')][_0x7b43('0x1d')]);_0x292f5d[_0x7b43('0x1c')]=qs[_0x7b43('0x1c')](_0x3635c7[_0x7b43('0x32')]['offset']);}_0x292f5d[_0x7b43('0x3b')]=qs[_0x7b43('0x3c')](_0x3635c7[_0x7b43('0x32')][_0x7b43('0x3c')]);_0x292f5d[_0x7b43('0x3d')]=qs['filters'](_['pick'](_0x3635c7['query'],_0x39b994[_0x7b43('0x34')]),_0x20af46);if(_0x3635c7[_0x7b43('0x32')][_0x7b43('0x3e')]){_0x292f5d[_0x7b43('0x3d')]=_[_0x7b43('0x3f')](_0x292f5d['where'],{'$or':_[_0x7b43('0x2b')](_0x20af46,function(_0x5905f3){if(_0x5905f3[_0x7b43('0x2f')]!==_0x7b43('0x40')){var _0x22c041={};_0x22c041[_0x5905f3[_0x7b43('0x28')]]={'$like':'%'+_0x3635c7[_0x7b43('0x32')]['filter']+'%'};return _0x22c041;}})});}_0x292f5d=_['merge']({},_0x292f5d,_0x3635c7['options']);var _0x4e6ed8={'where':_0x292f5d[_0x7b43('0x3d')]};return db['CmContactHasItem'][_0x7b43('0x1e')](_0x4e6ed8)[_0x7b43('0x22')](function(_0x104df9){_0x43390a['count']=_0x104df9;if(_0x3635c7[_0x7b43('0x32')]['includeAll']){_0x292f5d[_0x7b43('0x41')]=[{'all':!![]}];}return db[_0x7b43('0x2c')][_0x7b43('0x42')](_0x292f5d);})['then'](function(_0x278de3){_0x43390a['rows']=_0x278de3;return _0x43390a;})[_0x7b43('0x22')](respondWithFilteredResult(_0xfc699d,_0x292f5d))[_0x7b43('0x43')](handleError(_0xfc699d,null));};exports[_0x7b43('0x44')]=function(_0x288f85,_0x391bf7){var _0x1fd4ea={'raw':!![],'where':{'id':_0x288f85[_0x7b43('0x45')]['id']}},_0x3b13d2={};_0x3b13d2[_0x7b43('0x31')]=_['keys'](db[_0x7b43('0x2c')][_0x7b43('0x2d')]);_0x3b13d2[_0x7b43('0x32')]=_[_0x7b43('0x33')](_0x288f85[_0x7b43('0x32')]);_0x3b13d2[_0x7b43('0x34')]=_[_0x7b43('0x35')](_0x3b13d2[_0x7b43('0x31')],_0x3b13d2[_0x7b43('0x32')]);_0x1fd4ea[_0x7b43('0x36')]=_[_0x7b43('0x35')](_0x3b13d2[_0x7b43('0x31')],qs[_0x7b43('0x37')](_0x288f85[_0x7b43('0x32')]['fields']));_0x1fd4ea['attributes']=_0x1fd4ea[_0x7b43('0x36')][_0x7b43('0x38')]?_0x1fd4ea[_0x7b43('0x36')]:_0x3b13d2[_0x7b43('0x31')];if(_0x288f85[_0x7b43('0x32')][_0x7b43('0x46')]){_0x1fd4ea['include']=[{'all':!![]}];}_0x1fd4ea=_[_0x7b43('0x3f')]({},_0x1fd4ea,_0x288f85[_0x7b43('0x47')]);return db[_0x7b43('0x2c')][_0x7b43('0x48')](_0x1fd4ea)[_0x7b43('0x22')](handleEntityNotFound(_0x391bf7,null))[_0x7b43('0x22')](respondWithResult(_0x391bf7,null))[_0x7b43('0x43')](handleError(_0x391bf7,null));};exports[_0x7b43('0x49')]=function(_0x52e4e8,_0x1b6654){return db[_0x7b43('0x2c')][_0x7b43('0x49')](_0x52e4e8[_0x7b43('0x4a')],{})[_0x7b43('0x22')](function(_0x176fda){var _0x4b34e2=_0x52e4e8[_0x7b43('0x4b')][_0x7b43('0x24')]({'plain':!![]});if(!_0x4b34e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b34e2['role']===_0x7b43('0x4b')){var _0xdc9e59=_0x176fda[_0x7b43('0x24')]({'plain':!![]});var _0x2e6ddc=_0x7b43('0x25');return db[_0x7b43('0x4c')][_0x7b43('0x48')]({'where':{'name':_0x2e6ddc,'userProfileId':_0x4b34e2['userProfileId']},'raw':!![]})[_0x7b43('0x22')](function(_0x3604f4){if(_0x3604f4&&_0x3604f4['autoAssociation']===0x0){return db['UserProfileResource'][_0x7b43('0x49')]({'name':_0xdc9e59[_0x7b43('0x28')],'resourceId':_0xdc9e59['id'],'type':_0x3604f4[_0x7b43('0x28')],'sectionId':_0x3604f4['id']},{})[_0x7b43('0x22')](function(){return _0x176fda;});}else{return _0x176fda;}})['catch'](function(_0x6f7994){logger[_0x7b43('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6f7994);throw _0x6f7994;});}return _0x176fda;})[_0x7b43('0x22')](respondWithResult(_0x1b6654,0xc9))[_0x7b43('0x43')](handleError(_0x1b6654,null));};exports['update']=function(_0x31bbe4,_0x2d6746){if(_0x31bbe4['body']['id']){delete _0x31bbe4['body']['id'];}return db[_0x7b43('0x2c')][_0x7b43('0x48')]({'where':{'id':_0x31bbe4[_0x7b43('0x45')]['id']}})[_0x7b43('0x22')](handleEntityNotFound(_0x2d6746,null))[_0x7b43('0x22')](saveUpdates(_0x31bbe4[_0x7b43('0x4a')],null))['then'](respondWithResult(_0x2d6746,null))[_0x7b43('0x43')](handleError(_0x2d6746,null));};exports[_0x7b43('0x23')]=function(_0x1b06c5,_0x33cdc5){return db[_0x7b43('0x2c')][_0x7b43('0x48')]({'where':{'id':_0x1b06c5[_0x7b43('0x45')]['id']}})[_0x7b43('0x22')](handleEntityNotFound(_0x33cdc5,null))[_0x7b43('0x22')](removeEntity(_0x33cdc5,null))['catch'](handleError(_0x33cdc5,null));}; \ No newline at end of file +var _0xef29=['util','path','to-csv','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','name','send','index','map','CmContactHasItem','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','findAll','params','length','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x58374f,_0x2a57b2){var _0xb465b3=function(_0x11ad48){while(--_0x11ad48){_0x58374f['push'](_0x58374f['shift']());}};_0xb465b3(++_0x2a57b2);}(_0xef29,0x99));var _0x9ef2=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xef29[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require(_0x9ef2('0x0'));var rimraf=require(_0x9ef2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ef2('0x2'));var rp=require(_0x9ef2('0x3'));var moment=require(_0x9ef2('0x4'));var BPromise=require(_0x9ef2('0x5'));var Mustache=require(_0x9ef2('0x6'));var util=require(_0x9ef2('0x7'));var path=require(_0x9ef2('0x8'));var sox=require('sox');var csv=require(_0x9ef2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9ef2('0xa'));var squel=require('squel');var crypto=require(_0x9ef2('0xb'));var jsforce=require(_0x9ef2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9ef2('0x9'));var querystring=require(_0x9ef2('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9ef2('0xe'));var qs=require(_0x9ef2('0xf'));var as=require(_0x9ef2('0x10'));var hardwareService=require(_0x9ef2('0x11'));var logger=require(_0x9ef2('0x12'))(_0x9ef2('0x13'));var utils=require(_0x9ef2('0x14'));var config=require(_0x9ef2('0x15'));var licenseUtil=require(_0x9ef2('0x16'));var db=require(_0x9ef2('0x17'))['db'];function respondWithStatusCode(_0x2b6501,_0xf71a67){_0xf71a67=_0xf71a67||0xcc;return function(_0x1e1d2d){if(_0x1e1d2d){return _0x2b6501['sendStatus'](_0xf71a67);}return _0x2b6501[_0x9ef2('0x18')](_0xf71a67)[_0x9ef2('0x19')]();};}function respondWithResult(_0x28510e,_0x77fd31){_0x77fd31=_0x77fd31||0xc8;return function(_0x294d28){if(_0x294d28){return _0x28510e[_0x9ef2('0x18')](_0x77fd31)[_0x9ef2('0x1a')](_0x294d28);}};}function respondWithFilteredResult(_0x5c4f1d,_0x32c4f0){return function(_0x43fdb3){if(_0x43fdb3){var _0x176a83=typeof _0x32c4f0[_0x9ef2('0x1b')]===_0x9ef2('0x1c')&&typeof _0x32c4f0[_0x9ef2('0x1d')]==='undefined';var _0x5de7f6=_0x43fdb3[_0x9ef2('0x1e')];var _0x1de703=_0x176a83?0x0:_0x32c4f0['offset'];var _0x495b37=_0x176a83?_0x43fdb3[_0x9ef2('0x1e')]:_0x32c4f0['offset']+_0x32c4f0[_0x9ef2('0x1d')];var _0x453fd6;if(_0x495b37>=_0x5de7f6){_0x495b37=_0x5de7f6;_0x453fd6=0xc8;}else{_0x453fd6=0xce;}_0x5c4f1d['status'](_0x453fd6);return _0x5c4f1d['set'](_0x9ef2('0x1f'),_0x1de703+'-'+_0x495b37+'/'+_0x5de7f6)[_0x9ef2('0x1a')](_0x43fdb3);}return null;};}function patchUpdates(_0x1ffdbf){return function(_0x1df32a){try{jsonpatch[_0x9ef2('0x20')](_0x1df32a,_0x1ffdbf,!![]);}catch(_0x541e4b){return BPromise['reject'](_0x541e4b);}return _0x1df32a[_0x9ef2('0x21')]();};}function saveUpdates(_0x69c0d4,_0xf46786){return function(_0x201764){if(_0x201764){return _0x201764[_0x9ef2('0x22')](_0x69c0d4)[_0x9ef2('0x23')](function(_0x13db10){return _0x13db10;});}return null;};}function removeEntity(_0x5ba100,_0x47fdde){return function(_0x23f251){if(_0x23f251){return _0x23f251[_0x9ef2('0x24')]()[_0x9ef2('0x23')](function(){var _0x5a7248=_0x23f251[_0x9ef2('0x25')]({'plain':!![]});var _0x3bd41e=_0x9ef2('0x26');return db[_0x9ef2('0x27')][_0x9ef2('0x24')]({'where':{'type':_0x3bd41e,'resourceId':_0x5a7248['id']}})[_0x9ef2('0x23')](function(){return _0x23f251;});})[_0x9ef2('0x23')](function(){_0x5ba100['status'](0xcc)[_0x9ef2('0x19')]();});}};}function handleEntityNotFound(_0x234a99,_0x146bdf){return function(_0x168133){if(!_0x168133){_0x234a99['sendStatus'](0x194);}return _0x168133;};}function handleError(_0x5f3c64,_0xa8f5df){_0xa8f5df=_0xa8f5df||0x1f4;return function(_0xd74edf){logger[_0x9ef2('0x28')](_0xd74edf[_0x9ef2('0x29')]);if(_0xd74edf['name']){delete _0xd74edf[_0x9ef2('0x2a')];}_0x5f3c64[_0x9ef2('0x18')](_0xa8f5df)[_0x9ef2('0x2b')](_0xd74edf);};}exports[_0x9ef2('0x2c')]=function(_0x4cd49b,_0x20a00b){var _0xb9e3f0={},_0x495663={},_0x3ef35b={'count':0x0,'rows':[]};var _0xe0aafc=_[_0x9ef2('0x2d')](db[_0x9ef2('0x2e')]['rawAttributes'],function(_0x5bfe57){return{'name':_0x5bfe57['fieldName'],'type':_0x5bfe57[_0x9ef2('0x2f')][_0x9ef2('0x30')]};});_0x495663[_0x9ef2('0x31')]=_[_0x9ef2('0x2d')](_0xe0aafc,_0x9ef2('0x2a'));_0x495663[_0x9ef2('0x32')]=_[_0x9ef2('0x33')](_0x4cd49b[_0x9ef2('0x32')]);_0x495663['filters']=_[_0x9ef2('0x34')](_0x495663[_0x9ef2('0x31')],_0x495663[_0x9ef2('0x32')]);_0xb9e3f0[_0x9ef2('0x35')]=_[_0x9ef2('0x34')](_0x495663[_0x9ef2('0x31')],qs[_0x9ef2('0x36')](_0x4cd49b['query'][_0x9ef2('0x36')]));_0xb9e3f0[_0x9ef2('0x35')]=_0xb9e3f0[_0x9ef2('0x35')]['length']?_0xb9e3f0[_0x9ef2('0x35')]:_0x495663[_0x9ef2('0x31')];if(!_0x4cd49b[_0x9ef2('0x32')][_0x9ef2('0x37')](_0x9ef2('0x38'))){_0xb9e3f0[_0x9ef2('0x1d')]=qs[_0x9ef2('0x1d')](_0x4cd49b[_0x9ef2('0x32')]['limit']);_0xb9e3f0[_0x9ef2('0x1b')]=qs[_0x9ef2('0x1b')](_0x4cd49b['query']['offset']);}_0xb9e3f0['order']=qs[_0x9ef2('0x39')](_0x4cd49b[_0x9ef2('0x32')]['sort']);_0xb9e3f0[_0x9ef2('0x3a')]=qs[_0x9ef2('0x3b')](_[_0x9ef2('0x3c')](_0x4cd49b['query'],_0x495663[_0x9ef2('0x3b')]),_0xe0aafc);if(_0x4cd49b['query'][_0x9ef2('0x3d')]){_0xb9e3f0[_0x9ef2('0x3a')]=_['merge'](_0xb9e3f0[_0x9ef2('0x3a')],{'$or':_[_0x9ef2('0x2d')](_0xe0aafc,function(_0x535722){if(_0x535722['type']!=='VIRTUAL'){var _0x108475={};_0x108475[_0x535722[_0x9ef2('0x2a')]]={'$like':'%'+_0x4cd49b['query'][_0x9ef2('0x3d')]+'%'};return _0x108475;}})});}_0xb9e3f0=_[_0x9ef2('0x3e')]({},_0xb9e3f0,_0x4cd49b['options']);var _0x4718f4={'where':_0xb9e3f0[_0x9ef2('0x3a')]};return db[_0x9ef2('0x2e')][_0x9ef2('0x1e')](_0x4718f4)[_0x9ef2('0x23')](function(_0x55dee5){_0x3ef35b[_0x9ef2('0x1e')]=_0x55dee5;if(_0x4cd49b[_0x9ef2('0x32')][_0x9ef2('0x3f')]){_0xb9e3f0[_0x9ef2('0x40')]=[{'all':!![]}];}return db[_0x9ef2('0x2e')][_0x9ef2('0x41')](_0xb9e3f0);})[_0x9ef2('0x23')](function(_0x26c46d){_0x3ef35b['rows']=_0x26c46d;return _0x3ef35b;})[_0x9ef2('0x23')](respondWithFilteredResult(_0x20a00b,_0xb9e3f0))['catch'](handleError(_0x20a00b,null));};exports['show']=function(_0x3839b5,_0x593e30){var _0x236935={'raw':!![],'where':{'id':_0x3839b5[_0x9ef2('0x42')]['id']}},_0x5ca9c9={};_0x5ca9c9[_0x9ef2('0x31')]=_[_0x9ef2('0x33')](db['CmContactHasItem']['rawAttributes']);_0x5ca9c9[_0x9ef2('0x32')]=_[_0x9ef2('0x33')](_0x3839b5[_0x9ef2('0x32')]);_0x5ca9c9[_0x9ef2('0x3b')]=_[_0x9ef2('0x34')](_0x5ca9c9[_0x9ef2('0x31')],_0x5ca9c9[_0x9ef2('0x32')]);_0x236935[_0x9ef2('0x35')]=_[_0x9ef2('0x34')](_0x5ca9c9[_0x9ef2('0x31')],qs[_0x9ef2('0x36')](_0x3839b5[_0x9ef2('0x32')][_0x9ef2('0x36')]));_0x236935[_0x9ef2('0x35')]=_0x236935[_0x9ef2('0x35')][_0x9ef2('0x43')]?_0x236935[_0x9ef2('0x35')]:_0x5ca9c9[_0x9ef2('0x31')];if(_0x3839b5['query']['includeAll']){_0x236935['include']=[{'all':!![]}];}_0x236935=_[_0x9ef2('0x3e')]({},_0x236935,_0x3839b5[_0x9ef2('0x44')]);return db[_0x9ef2('0x2e')]['find'](_0x236935)[_0x9ef2('0x23')](handleEntityNotFound(_0x593e30,null))['then'](respondWithResult(_0x593e30,null))['catch'](handleError(_0x593e30,null));};exports[_0x9ef2('0x45')]=function(_0x219246,_0x14239e){return db[_0x9ef2('0x2e')]['create'](_0x219246['body'],{})[_0x9ef2('0x23')](function(_0x233bb7){var _0x34d899=_0x219246[_0x9ef2('0x46')][_0x9ef2('0x25')]({'plain':!![]});if(!_0x34d899)throw new Error(_0x9ef2('0x47'));if(_0x34d899[_0x9ef2('0x48')]==='user'){var _0x2e0a41=_0x233bb7[_0x9ef2('0x25')]({'plain':!![]});var _0x3e60e9=_0x9ef2('0x26');return db[_0x9ef2('0x49')][_0x9ef2('0x4a')]({'where':{'name':_0x3e60e9,'userProfileId':_0x34d899[_0x9ef2('0x4b')]},'raw':!![]})[_0x9ef2('0x23')](function(_0x3cd9b2){if(_0x3cd9b2&&_0x3cd9b2[_0x9ef2('0x4c')]===0x0){return db['UserProfileResource'][_0x9ef2('0x45')]({'name':_0x2e0a41[_0x9ef2('0x2a')],'resourceId':_0x2e0a41['id'],'type':_0x3cd9b2[_0x9ef2('0x2a')],'sectionId':_0x3cd9b2['id']},{})[_0x9ef2('0x23')](function(){return _0x233bb7;});}else{return _0x233bb7;}})[_0x9ef2('0x4d')](function(_0xedc420){logger['error'](_0x9ef2('0x4e'),_0xedc420);throw _0xedc420;});}return _0x233bb7;})[_0x9ef2('0x23')](respondWithResult(_0x14239e,0xc9))[_0x9ef2('0x4d')](handleError(_0x14239e,null));};exports['update']=function(_0xc598e0,_0x3b1acd){if(_0xc598e0[_0x9ef2('0x4f')]['id']){delete _0xc598e0['body']['id'];}return db[_0x9ef2('0x2e')][_0x9ef2('0x4a')]({'where':{'id':_0xc598e0[_0x9ef2('0x42')]['id']}})['then'](handleEntityNotFound(_0x3b1acd,null))[_0x9ef2('0x23')](saveUpdates(_0xc598e0[_0x9ef2('0x4f')],null))['then'](respondWithResult(_0x3b1acd,null))['catch'](handleError(_0x3b1acd,null));};exports[_0x9ef2('0x24')]=function(_0x409f74,_0x155bc8){return db[_0x9ef2('0x2e')]['find']({'where':{'id':_0x409f74[_0x9ef2('0x42')]['id']}})['then'](handleEntityNotFound(_0x155bc8,null))[_0x9ef2('0x23')](removeEntity(_0x155bc8,null))[_0x9ef2('0x4d')](handleError(_0x155bc8,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 86bd410..9628f2d 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 _0x157e=['define','CmContactHasItem','cm_contact_has_items','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x47a894,_0x1a45ad){var _0x16e6e7=function(_0x13a9d7){while(--_0x13a9d7){_0x47a894['push'](_0x47a894['shift']());}};_0x16e6e7(++_0x1a45ad);}(_0x157e,0x121));var _0xe157=function(_0x25b022,_0x394a08){_0x25b022=_0x25b022-0x0;var _0x2e13a5=_0x157e[_0x25b022];return _0x2e13a5;};'use strict';var _=require(_0xe157('0x0'));var util=require('util');var logger=require(_0xe157('0x1'))(_0xe157('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe157('0x3'));var fs=require('fs');var path=require(_0xe157('0x4'));var rimraf=require(_0xe157('0x5'));var config=require(_0xe157('0x6'));var attributes=require(_0xe157('0x7'));module['exports']=function(_0xa6462c,_0x595297){return _0xa6462c[_0xe157('0x8')](_0xe157('0x9'),attributes,{'tableName':_0xe157('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57d5=['define','cm_contact_has_items','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports'];(function(_0x2cdb8f,_0x1e35f9){var _0x2040fa=function(_0xd6d153){while(--_0xd6d153){_0x2cdb8f['push'](_0x2cdb8f['shift']());}};_0x2040fa(++_0x1e35f9);}(_0x57d5,0x1b2));var _0x557d=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x57d5[_0x4f9b18];return _0x29f20c;};'use strict';var _=require('lodash');var util=require(_0x557d('0x0'));var logger=require(_0x557d('0x1'))('api');var moment=require(_0x557d('0x2'));var BPromise=require(_0x557d('0x3'));var rp=require(_0x557d('0x4'));var fs=require('fs');var path=require(_0x557d('0x5'));var rimraf=require(_0x557d('0x6'));var config=require(_0x557d('0x7'));var attributes=require(_0x557d('0x8'));module[_0x557d('0x9')]=function(_0x2e3fe8,_0x6e5c70){return _0x2e3fe8[_0x557d('0xa')]('CmContactHasItem',attributes,{'tableName':_0x557d('0xb'),'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 13610ab..b6b8eaa 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 _0xe7d3=['../../config/logger','rpc','../../config/environment','client','http','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x39793b,_0x4f383){var _0x359223=function(_0xb8c77a){while(--_0xb8c77a){_0x39793b['push'](_0x39793b['shift']());}};_0x359223(++_0x4f383);}(_0xe7d3,0x149));var _0x3e7d=function(_0x30dcdf,_0x51e5be){_0x30dcdf=_0x30dcdf-0x0;var _0x443fc3=_0xe7d3[_0x30dcdf];return _0x443fc3;};'use strict';var _=require(_0x3e7d('0x0'));var util=require(_0x3e7d('0x1'));var moment=require(_0x3e7d('0x2'));var BPromise=require(_0x3e7d('0x3'));var rs=require(_0x3e7d('0x4'));var fs=require('fs');var Redis=require(_0x3e7d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e7d('0x6'));var logger=require(_0x3e7d('0x7'))(_0x3e7d('0x8'));var config=require(_0x3e7d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3e7d('0xa')][_0x3e7d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2aa098,_0x3706a3,_0x13aa0e){return new BPromise(function(_0x231bbc,_0x162ebb){return client['request'](_0x2aa098,_0x13aa0e)['then'](function(_0x2ee919){logger[_0x3e7d('0xc')](_0x3e7d('0xd'),_0x3706a3,_0x3e7d('0xe'));logger[_0x3e7d('0xf')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x3706a3,'request\x20sent',JSON['stringify'](_0x2ee919));if(_0x2ee919['error']){if(_0x2ee919['error'][_0x3e7d('0x10')]===0x1f4){logger[_0x3e7d('0x11')](_0x3e7d('0xd'),_0x3706a3,_0x2ee919[_0x3e7d('0x11')][_0x3e7d('0x12')]);return _0x162ebb(_0x2ee919[_0x3e7d('0x11')][_0x3e7d('0x12')]);}logger[_0x3e7d('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x3706a3,_0x2ee919[_0x3e7d('0x11')]['message']);return _0x231bbc(_0x2ee919[_0x3e7d('0x11')][_0x3e7d('0x12')]);}else{logger['info'](_0x3e7d('0xd'),_0x3706a3,_0x3e7d('0xe'));_0x231bbc(_0x2ee919[_0x3e7d('0x13')]['message']);}})[_0x3e7d('0x14')](function(_0x4460cc){logger[_0x3e7d('0x11')](_0x3e7d('0xd'),_0x3706a3,_0x4460cc);_0x162ebb(_0x4460cc);});});} \ No newline at end of file +var _0x3fec=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x303a2e,_0x16d1dc){var _0x12c2ba=function(_0x61fdc0){while(--_0x61fdc0){_0x303a2e['push'](_0x303a2e['shift']());}};_0x12c2ba(++_0x16d1dc);}(_0x3fec,0x197));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc3fe('0x0'));var util=require(_0xc3fe('0x1'));var moment=require(_0xc3fe('0x2'));var BPromise=require(_0xc3fe('0x3'));var rs=require(_0xc3fe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc3fe('0x5'));var logger=require(_0xc3fe('0x6'))(_0xc3fe('0x7'));var config=require(_0xc3fe('0x8'));var jayson=require(_0xc3fe('0x9'));var client=jayson[_0xc3fe('0xa')][_0xc3fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50d24f,_0x23ea03,_0x57ffd6){return new BPromise(function(_0x33de81,_0x316b61){return client[_0xc3fe('0xc')](_0x50d24f,_0x57ffd6)[_0xc3fe('0xd')](function(_0x1f4a27){logger[_0xc3fe('0xe')](_0xc3fe('0xf'),_0x23ea03,_0xc3fe('0x10'));logger[_0xc3fe('0x11')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x23ea03,_0xc3fe('0x10'),JSON[_0xc3fe('0x12')](_0x1f4a27));if(_0x1f4a27[_0xc3fe('0x13')]){if(_0x1f4a27[_0xc3fe('0x13')][_0xc3fe('0x14')]===0x1f4){logger[_0xc3fe('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x23ea03,_0x1f4a27[_0xc3fe('0x13')][_0xc3fe('0x15')]);return _0x316b61(_0x1f4a27[_0xc3fe('0x13')][_0xc3fe('0x15')]);}logger['error'](_0xc3fe('0xf'),_0x23ea03,_0x1f4a27[_0xc3fe('0x13')][_0xc3fe('0x15')]);return _0x33de81(_0x1f4a27['error']['message']);}else{logger['info'](_0xc3fe('0xf'),_0x23ea03,'request\x20sent');_0x33de81(_0x1f4a27[_0xc3fe('0x16')][_0xc3fe('0x15')]);}})[_0xc3fe('0x17')](function(_0x2f774b){logger[_0xc3fe('0x13')](_0xc3fe('0xf'),_0x23ea03,_0x2f774b);_0x316b61(_0x2f774b);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 99db2e8..917b4ce 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 _0x734b=['../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','show','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x33670a,_0x55e188){var _0x36ad1d=function(_0x3cacbb){while(--_0x3cacbb){_0x33670a['push'](_0x33670a['shift']());}};_0x36ad1d(++_0x55e188);}(_0x734b,0x92));var _0xb734=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x734b[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0xb734('0x0'));var util=require(_0xb734('0x1'));var path=require(_0xb734('0x2'));var timeout=require(_0xb734('0x3'));var express=require(_0xb734('0x4'));var router=express['Router']();var fs_extra=require(_0xb734('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb734('0x6'));var config=require('../../config/environment');var controller=require(_0xb734('0x7'));router[_0xb734('0x8')]('/',auth[_0xb734('0x9')](),controller[_0xb734('0xa')]);router[_0xb734('0x8')]('/:id',auth[_0xb734('0x9')](),controller[_0xb734('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb734('0xc')]);router[_0xb734('0xd')]('/:id',auth[_0xb734('0x9')](),controller[_0xb734('0xe')]);router[_0xb734('0xf')](_0xb734('0x10'),auth[_0xb734('0x9')](),controller[_0xb734('0x11')]);module[_0xb734('0x12')]=router; \ No newline at end of file +var _0xc615=['../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x22185a,_0x2c9c0f){var _0x27e1f1=function(_0x9ed420){while(--_0x9ed420){_0x22185a['push'](_0x22185a['shift']());}};_0x27e1f1(++_0x2c9c0f);}(_0xc615,0x128));var _0x5c61=function(_0x1c156e,_0x3263a6){_0x1c156e=_0x1c156e-0x0;var _0x58fc22=_0xc615[_0x1c156e];return _0x58fc22;};'use strict';var multer=require(_0x5c61('0x0'));var util=require(_0x5c61('0x1'));var path=require(_0x5c61('0x2'));var timeout=require(_0x5c61('0x3'));var express=require(_0x5c61('0x4'));var router=express[_0x5c61('0x5')]();var fs_extra=require(_0x5c61('0x6'));var auth=require(_0x5c61('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5c61('0x8'));var controller=require(_0x5c61('0x9'));router[_0x5c61('0xa')]('/',auth[_0x5c61('0xb')](),controller[_0x5c61('0xc')]);router[_0x5c61('0xa')](_0x5c61('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x5c61('0xe')]('/',auth[_0x5c61('0xb')](),controller[_0x5c61('0xf')]);router['put'](_0x5c61('0xd'),auth[_0x5c61('0xb')](),controller['update']);router[_0x5c61('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5c61('0x11')]);module[_0x5c61('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 4d98e9c..85b40a9 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 _0xc3b8=['exports','getDataValue','alias','setDataValue','STRING','long','type','select','parse','values','isArray','stringify','BOOLEAN','sequelize','lodash'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xc3b8,0x1de));var _0x8c3b=function(_0x2d6577,_0x113a48){_0x2d6577=_0x2d6577-0x0;var _0x4dff72=_0xc3b8[_0x2d6577];return _0x4dff72;};'use strict';var Sequelize=require(_0x8c3b('0x0'));var _=require(_0x8c3b('0x1'));module[_0x8c3b('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4f001e){return this[_0x8c3b('0x3')](_0x8c3b('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x271568){this[_0x8c3b('0x5')](_0x8c3b('0x4'),_0x271568?_0x271568:this[_0x8c3b('0x3')]('name'));}},'type':{'type':Sequelize[_0x8c3b('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x8c3b('0x7')),'get':function(){if(this[_0x8c3b('0x3')](_0x8c3b('0x8'))===_0x8c3b('0x9')){return JSON[_0x8c3b('0xa')](this[_0x8c3b('0x3')](_0x8c3b('0xb')));}else{return this['getDataValue']('values');}},'set':function(_0x408296){if(Array[_0x8c3b('0xc')](_0x408296)){this[_0x8c3b('0x5')]('values',JSON[_0x8c3b('0xd')](_0x408296));}else{this['setDataValue'](_0x8c3b('0xb'),_0x408296);}}},'required':{'type':Sequelize[_0x8c3b('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x8c3b('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}}; \ No newline at end of file +var _0x90f9=['TEXT','long','type','select','parse','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','sequelize','getDataValue','STRING','alias','name'];(function(_0x427444,_0xf966d1){var _0x356dca=function(_0x28b183){while(--_0x28b183){_0x427444['push'](_0x427444['shift']());}};_0x356dca(++_0xf966d1);}(_0x90f9,0x8b));var _0x990f=function(_0x563318,_0x1ee60f){_0x563318=_0x563318-0x0;var _0x2f345c=_0x90f9[_0x563318];return _0x2f345c;};'use strict';var Sequelize=require(_0x990f('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x59cca6){return this[_0x990f('0x1')]('alias');}},'alias':{'type':Sequelize[_0x990f('0x2')],'allowNull':![],'set':function(_0x17edb4){this['setDataValue'](_0x990f('0x3'),_0x17edb4?_0x17edb4:this[_0x990f('0x1')](_0x990f('0x4')));}},'type':{'type':Sequelize[_0x990f('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0x990f('0x5')](_0x990f('0x6')),'get':function(){if(this['getDataValue'](_0x990f('0x7'))===_0x990f('0x8')){return JSON[_0x990f('0x9')](this[_0x990f('0x1')](_0x990f('0xa')));}else{return this['getDataValue'](_0x990f('0xa'));}},'set':function(_0x101e35){if(Array[_0x990f('0xb')](_0x101e35)){this[_0x990f('0xc')]('values',JSON[_0x990f('0xd')](_0x101e35));}else{this[_0x990f('0xc')](_0x990f('0xa'),_0x101e35);}}},'required':{'type':Sequelize[_0x990f('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x990f('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x990f('0xf')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 89b31a0..36e81e9 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 _0x8f81=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','then','rows','catch','show','params','intersection','length','find','body','create','sequelize','transaction','Sequelize','TEXT','switch','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x8f81,0x9d));var _0x18f8=function(_0x141966,_0x2b47fd){_0x141966=_0x141966-0x0;var _0x5bd6db=_0x8f81[_0x141966];return _0x5bd6db;};'use strict';var emlformat=require(_0x18f8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x18f8('0x1'));var rp=require('request-promise');var moment=require(_0x18f8('0x2'));var BPromise=require(_0x18f8('0x3'));var Mustache=require(_0x18f8('0x4'));var util=require(_0x18f8('0x5'));var path=require(_0x18f8('0x6'));var sox=require(_0x18f8('0x7'));var csv=require('to-csv');var ejs=require(_0x18f8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x18f8('0x9'));var squel=require(_0x18f8('0xa'));var crypto=require(_0x18f8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x18f8('0xc'));var toCsv=require(_0x18f8('0xd'));var querystring=require(_0x18f8('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x18f8('0xf'));var qs=require(_0x18f8('0x10'));var as=require(_0x18f8('0x11'));var hardwareService=require(_0x18f8('0x12'));var logger=require(_0x18f8('0x13'))(_0x18f8('0x14'));var utils=require(_0x18f8('0x15'));var config=require(_0x18f8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x18f8('0x17'))['db'];function respondWithStatusCode(_0x170f5e,_0x2c6799){_0x2c6799=_0x2c6799||0xcc;return function(_0x178747){if(_0x178747){return _0x170f5e[_0x18f8('0x18')](_0x2c6799);}return _0x170f5e['status'](_0x2c6799)[_0x18f8('0x19')]();};}function respondWithResult(_0x463284,_0x4ab09d){_0x4ab09d=_0x4ab09d||0xc8;return function(_0x43639e){if(_0x43639e){return _0x463284[_0x18f8('0x1a')](_0x4ab09d)[_0x18f8('0x1b')](_0x43639e);}};}function respondWithFilteredResult(_0x4bbb36,_0x18ddf0){return function(_0x8d4283){if(_0x8d4283){var _0x50e292=typeof _0x18ddf0[_0x18f8('0x1c')]==='undefined'&&typeof _0x18ddf0[_0x18f8('0x1d')]===_0x18f8('0x1e');var _0x2746bd=_0x8d4283[_0x18f8('0x1f')];var _0x190ae5=_0x50e292?0x0:_0x18ddf0[_0x18f8('0x1c')];var _0x4a7d14=_0x50e292?_0x8d4283[_0x18f8('0x1f')]:_0x18ddf0[_0x18f8('0x1c')]+_0x18ddf0['limit'];var _0x24e631;if(_0x4a7d14>=_0x2746bd){_0x4a7d14=_0x2746bd;_0x24e631=0xc8;}else{_0x24e631=0xce;}_0x4bbb36[_0x18f8('0x1a')](_0x24e631);return _0x4bbb36[_0x18f8('0x20')](_0x18f8('0x21'),_0x190ae5+'-'+_0x4a7d14+'/'+_0x2746bd)['json'](_0x8d4283);}return null;};}function patchUpdates(_0xb07c99){return function(_0x435d18){try{jsonpatch[_0x18f8('0x22')](_0x435d18,_0xb07c99,!![]);}catch(_0x5e67ec){return BPromise[_0x18f8('0x23')](_0x5e67ec);}return _0x435d18[_0x18f8('0x24')]();};}function saveUpdates(_0x2ee66a,_0xe2066a){return function(_0xcecad7){if(_0xcecad7){return _0xcecad7[_0x18f8('0x25')](_0x2ee66a)['then'](function(_0x4c88b1){return _0x4c88b1;});}return null;};}function removeEntity(_0x327d47,_0x24dece){return function(_0x466862){if(_0x466862){return _0x466862[_0x18f8('0x26')]()['then'](function(){_0x327d47[_0x18f8('0x1a')](0xcc)[_0x18f8('0x19')]();});}};}function handleEntityNotFound(_0x8e6c6,_0x542bb3){return function(_0x116f37){if(!_0x116f37){_0x8e6c6[_0x18f8('0x18')](0x194);}return _0x116f37;};}function handleError(_0x384164,_0x53bb5d){_0x53bb5d=_0x53bb5d||0x1f4;return function(_0x27f503){logger[_0x18f8('0x27')](_0x27f503[_0x18f8('0x28')]);if(_0x27f503[_0x18f8('0x29')]){delete _0x27f503[_0x18f8('0x29')];}_0x384164[_0x18f8('0x1a')](_0x53bb5d)[_0x18f8('0x2a')](_0x27f503);};}exports['index']=function(_0x3a1047,_0x52dd68){var _0x2f40de={},_0x26e105={},_0x43340b={'count':0x0,'rows':[]};var _0x40352c=_['map'](db[_0x18f8('0x2b')][_0x18f8('0x2c')],function(_0x1d908e){return{'name':_0x1d908e[_0x18f8('0x2d')],'type':_0x1d908e[_0x18f8('0x2e')][_0x18f8('0x2f')]};});_0x26e105[_0x18f8('0x30')]=_[_0x18f8('0x31')](_[_0x18f8('0x32')](_0x40352c,_0x18f8('0x29')),[_0x18f8('0x29')]);_0x26e105[_0x18f8('0x33')]=_[_0x18f8('0x34')](_0x3a1047[_0x18f8('0x33')]);_0x26e105[_0x18f8('0x35')]=_['intersection'](_0x26e105[_0x18f8('0x30')],_0x26e105[_0x18f8('0x33')]);_0x2f40de[_0x18f8('0x36')]=_['intersection'](_0x26e105[_0x18f8('0x30')],qs[_0x18f8('0x37')](_0x3a1047[_0x18f8('0x33')]['fields']));_0x2f40de['attributes']=_0x2f40de[_0x18f8('0x36')]['length']?_0x2f40de['attributes']:_0x26e105[_0x18f8('0x30')];if(!_0x3a1047[_0x18f8('0x33')]['hasOwnProperty'](_0x18f8('0x38'))){_0x2f40de['limit']=qs[_0x18f8('0x1d')](_0x3a1047[_0x18f8('0x33')][_0x18f8('0x1d')]);_0x2f40de[_0x18f8('0x1c')]=qs[_0x18f8('0x1c')](_0x3a1047[_0x18f8('0x33')][_0x18f8('0x1c')]);}_0x2f40de[_0x18f8('0x39')]=qs[_0x18f8('0x3a')](_0x3a1047[_0x18f8('0x33')][_0x18f8('0x3a')]);_0x2f40de[_0x18f8('0x3b')]=qs['filters'](_[_0x18f8('0x3c')](_0x3a1047[_0x18f8('0x33')],_0x26e105[_0x18f8('0x35')]),_0x40352c);if(_0x3a1047[_0x18f8('0x33')]['filter']){_0x2f40de[_0x18f8('0x3b')]=_[_0x18f8('0x3d')](_0x2f40de['where'],{'$or':_[_0x18f8('0x32')](_0x40352c,function(_0x37db2f){if(_0x37db2f[_0x18f8('0x2e')]!==_0x18f8('0x3e')){var _0x238578={};_0x238578[_0x37db2f[_0x18f8('0x29')]]={'$like':'%'+_0x3a1047[_0x18f8('0x33')][_0x18f8('0x3f')]+'%'};return _0x238578;}})});}_0x2f40de=_['merge']({},_0x2f40de,_0x3a1047[_0x18f8('0x40')]);var _0x18472b={'where':_0x2f40de['where']};return db['CmCustomField'][_0x18f8('0x1f')](_0x18472b)['then'](function(_0x21fc21){_0x43340b['count']=_0x21fc21;if(_0x3a1047['query'][_0x18f8('0x41')]){_0x2f40de[_0x18f8('0x42')]=[{'all':!![]}];}return db[_0x18f8('0x2b')][_0x18f8('0x43')](_0x2f40de);})[_0x18f8('0x44')](function(_0x42d80e){_0x43340b[_0x18f8('0x45')]=_0x42d80e;return _0x43340b;})[_0x18f8('0x44')](respondWithFilteredResult(_0x52dd68,_0x2f40de))[_0x18f8('0x46')](handleError(_0x52dd68,null));};exports[_0x18f8('0x47')]=function(_0x3b2046,_0x3126dd){var _0x52d996={'raw':!![],'where':{'id':_0x3b2046[_0x18f8('0x48')]['id']}},_0x2d672a={};_0x2d672a[_0x18f8('0x30')]=_[_0x18f8('0x34')](db['CmCustomField'][_0x18f8('0x2c')]);_0x2d672a[_0x18f8('0x33')]=_['keys'](_0x3b2046[_0x18f8('0x33')]);_0x2d672a[_0x18f8('0x35')]=_[_0x18f8('0x49')](_0x2d672a[_0x18f8('0x30')],_0x2d672a[_0x18f8('0x33')]);_0x52d996['attributes']=_[_0x18f8('0x49')](_0x2d672a[_0x18f8('0x30')],qs['fields'](_0x3b2046[_0x18f8('0x33')][_0x18f8('0x37')]));_0x52d996[_0x18f8('0x36')]=_0x52d996[_0x18f8('0x36')][_0x18f8('0x4a')]?_0x52d996[_0x18f8('0x36')]:_0x2d672a['model'];if(_0x3b2046[_0x18f8('0x33')][_0x18f8('0x41')]){_0x52d996[_0x18f8('0x42')]=[{'all':!![]}];}_0x52d996=_[_0x18f8('0x3d')]({},_0x52d996,_0x3b2046[_0x18f8('0x40')]);return db[_0x18f8('0x2b')][_0x18f8('0x4b')](_0x52d996)[_0x18f8('0x44')](handleEntityNotFound(_0x3126dd,null))[_0x18f8('0x44')](respondWithResult(_0x3126dd,null))[_0x18f8('0x46')](handleError(_0x3126dd,null));};exports[_0x18f8('0x25')]=function(_0x3ee757,_0x1327ac){if(_0x3ee757[_0x18f8('0x4c')]['id']){delete _0x3ee757['body']['id'];}return db[_0x18f8('0x2b')][_0x18f8('0x4b')]({'where':{'id':_0x3ee757[_0x18f8('0x48')]['id']}})[_0x18f8('0x44')](handleEntityNotFound(_0x1327ac,null))['then'](saveUpdates(_0x3ee757[_0x18f8('0x4c')],null))[_0x18f8('0x44')](respondWithResult(_0x1327ac,null))[_0x18f8('0x46')](handleError(_0x1327ac,null));};exports[_0x18f8('0x26')]=function(_0x2b9065,_0x1977e9){return db[_0x18f8('0x2b')]['find']({'where':{'id':_0x2b9065[_0x18f8('0x48')]['id']}})[_0x18f8('0x44')](handleEntityNotFound(_0x1977e9,null))[_0x18f8('0x44')](removeEntity(_0x1977e9,null))[_0x18f8('0x46')](handleError(_0x1977e9,null));};exports[_0x18f8('0x4d')]=function(_0x2dd021,_0x5e7654){var _0x4b551b;return db[_0x18f8('0x4e')][_0x18f8('0x4f')](function(_0x7621af){return db[_0x18f8('0x2b')][_0x18f8('0x4d')](_0x2dd021[_0x18f8('0x4c')],{'transaction':_0x7621af})[_0x18f8('0x44')](function(_0x4b9e8f){_0x4b551b=_0x4b9e8f;var _0xaec807={'type':db[_0x18f8('0x50')][_0x18f8('0x51')],'transaction':_0x7621af};switch(_0x2dd021[_0x18f8('0x4c')]['type']){case'text':_0xaec807[_0x18f8('0x2e')]=db['Sequelize'][_0x18f8('0x51')];break;case'number':_0xaec807[_0x18f8('0x2e')]=db['Sequelize']['INTEGER'];break;case _0x18f8('0x52'):_0xaec807[_0x18f8('0x2e')]=db[_0x18f8('0x50')]['BOOLEAN'];_0xaec807['defaultValue']=![];break;default:}return db[_0x18f8('0x4e')][_0x18f8('0x53')][_0x18f8('0x54')](_0x18f8('0x55'),util['format'](_0x18f8('0x56'),_0x4b551b['id']),_0xaec807);})['then'](function(){return _0x4b551b;});})['then'](respondWithResult(_0x5e7654,0xc9))['catch'](handleError(_0x5e7654,null));}; \ No newline at end of file +var _0x22df=['options','CmCustomField','includeAll','include','findAll','show','params','body','find','catch','create','sequelize','transaction','TEXT','number','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x2a4d34,_0x531aa){var _0xf16b51=function(_0x2a621c){while(--_0x2a621c){_0x2a4d34['push'](_0x2a4d34['shift']());}};_0xf16b51(++_0x531aa);}(_0x22df,0x11c));var _0xf22d=function(_0x3b2322,_0x3d5350){_0x3b2322=_0x3b2322-0x0;var _0x5c9382=_0x22df[_0x3b2322];return _0x5c9382;};'use strict';var emlformat=require(_0xf22d('0x0'));var rimraf=require(_0xf22d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf22d('0x2'));var rp=require(_0xf22d('0x3'));var moment=require(_0xf22d('0x4'));var BPromise=require(_0xf22d('0x5'));var Mustache=require(_0xf22d('0x6'));var util=require(_0xf22d('0x7'));var path=require(_0xf22d('0x8'));var sox=require(_0xf22d('0x9'));var csv=require(_0xf22d('0xa'));var ejs=require(_0xf22d('0xb'));var fs=require('fs');var fs_extra=require(_0xf22d('0xc'));var _=require(_0xf22d('0xd'));var squel=require(_0xf22d('0xe'));var crypto=require('crypto');var jsforce=require(_0xf22d('0xf'));var deskjs=require(_0xf22d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf22d('0x11'));var Papa=require(_0xf22d('0x12'));var Redis=require('ioredis');var authService=require(_0xf22d('0x13'));var qs=require(_0xf22d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf22d('0x15'));var logger=require(_0xf22d('0x16'))(_0xf22d('0x17'));var utils=require(_0xf22d('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25c97c,_0x42060a){_0x42060a=_0x42060a||0xcc;return function(_0x2cf75a){if(_0x2cf75a){return _0x25c97c['sendStatus'](_0x42060a);}return _0x25c97c[_0xf22d('0x19')](_0x42060a)[_0xf22d('0x1a')]();};}function respondWithResult(_0x58fa4e,_0x2afceb){_0x2afceb=_0x2afceb||0xc8;return function(_0xc56cc8){if(_0xc56cc8){return _0x58fa4e['status'](_0x2afceb)['json'](_0xc56cc8);}};}function respondWithFilteredResult(_0x8bb04f,_0x16b90f){return function(_0x5925b9){if(_0x5925b9){var _0xdf52a=typeof _0x16b90f[_0xf22d('0x1b')]===_0xf22d('0x1c')&&typeof _0x16b90f[_0xf22d('0x1d')]===_0xf22d('0x1c');var _0x1ffa12=_0x5925b9[_0xf22d('0x1e')];var _0x5d5b63=_0xdf52a?0x0:_0x16b90f[_0xf22d('0x1b')];var _0x435c79=_0xdf52a?_0x5925b9[_0xf22d('0x1e')]:_0x16b90f['offset']+_0x16b90f[_0xf22d('0x1d')];var _0x2594d1;if(_0x435c79>=_0x1ffa12){_0x435c79=_0x1ffa12;_0x2594d1=0xc8;}else{_0x2594d1=0xce;}_0x8bb04f[_0xf22d('0x19')](_0x2594d1);return _0x8bb04f[_0xf22d('0x1f')](_0xf22d('0x20'),_0x5d5b63+'-'+_0x435c79+'/'+_0x1ffa12)[_0xf22d('0x21')](_0x5925b9);}return null;};}function patchUpdates(_0x25e72a){return function(_0x18ed50){try{jsonpatch[_0xf22d('0x22')](_0x18ed50,_0x25e72a,!![]);}catch(_0x2f64f2){return BPromise[_0xf22d('0x23')](_0x2f64f2);}return _0x18ed50[_0xf22d('0x24')]();};}function saveUpdates(_0x4ab961,_0x5834d5){return function(_0x5c560f){if(_0x5c560f){return _0x5c560f[_0xf22d('0x25')](_0x4ab961)['then'](function(_0x9795d2){return _0x9795d2;});}return null;};}function removeEntity(_0x2ea732,_0x52f924){return function(_0x2dd3eb){if(_0x2dd3eb){return _0x2dd3eb[_0xf22d('0x26')]()[_0xf22d('0x27')](function(){_0x2ea732['status'](0xcc)[_0xf22d('0x1a')]();});}};}function handleEntityNotFound(_0x336fb3,_0x49add5){return function(_0x32fc3a){if(!_0x32fc3a){_0x336fb3['sendStatus'](0x194);}return _0x32fc3a;};}function handleError(_0x2a5e82,_0x389ac4){_0x389ac4=_0x389ac4||0x1f4;return function(_0x1fb156){logger[_0xf22d('0x28')](_0x1fb156[_0xf22d('0x29')]);if(_0x1fb156[_0xf22d('0x2a')]){delete _0x1fb156['name'];}_0x2a5e82['status'](_0x389ac4)[_0xf22d('0x2b')](_0x1fb156);};}exports[_0xf22d('0x2c')]=function(_0x5e175c,_0x148f55){var _0x1a6db7={},_0x11602d={},_0x76f0af={'count':0x0,'rows':[]};var _0x834291=_[_0xf22d('0x2d')](db['CmCustomField'][_0xf22d('0x2e')],function(_0x393233){return{'name':_0x393233[_0xf22d('0x2f')],'type':_0x393233[_0xf22d('0x30')][_0xf22d('0x31')]};});_0x11602d['model']=_[_0xf22d('0x32')](_[_0xf22d('0x2d')](_0x834291,_0xf22d('0x2a')),['name']);_0x11602d[_0xf22d('0x33')]=_[_0xf22d('0x34')](_0x5e175c['query']);_0x11602d[_0xf22d('0x35')]=_[_0xf22d('0x36')](_0x11602d[_0xf22d('0x37')],_0x11602d[_0xf22d('0x33')]);_0x1a6db7[_0xf22d('0x38')]=_['intersection'](_0x11602d['model'],qs[_0xf22d('0x39')](_0x5e175c[_0xf22d('0x33')][_0xf22d('0x39')]));_0x1a6db7[_0xf22d('0x38')]=_0x1a6db7[_0xf22d('0x38')][_0xf22d('0x3a')]?_0x1a6db7['attributes']:_0x11602d[_0xf22d('0x37')];if(!_0x5e175c[_0xf22d('0x33')][_0xf22d('0x3b')](_0xf22d('0x3c'))){_0x1a6db7[_0xf22d('0x1d')]=qs[_0xf22d('0x1d')](_0x5e175c[_0xf22d('0x33')][_0xf22d('0x1d')]);_0x1a6db7[_0xf22d('0x1b')]=qs[_0xf22d('0x1b')](_0x5e175c[_0xf22d('0x33')][_0xf22d('0x1b')]);}_0x1a6db7[_0xf22d('0x3d')]=qs[_0xf22d('0x3e')](_0x5e175c[_0xf22d('0x33')][_0xf22d('0x3e')]);_0x1a6db7[_0xf22d('0x3f')]=qs['filters'](_[_0xf22d('0x40')](_0x5e175c[_0xf22d('0x33')],_0x11602d[_0xf22d('0x35')]),_0x834291);if(_0x5e175c[_0xf22d('0x33')][_0xf22d('0x41')]){_0x1a6db7[_0xf22d('0x3f')]=_[_0xf22d('0x42')](_0x1a6db7['where'],{'$or':_['map'](_0x834291,function(_0x167249){if(_0x167249[_0xf22d('0x30')]!==_0xf22d('0x43')){var _0x431a4b={};_0x431a4b[_0x167249[_0xf22d('0x2a')]]={'$like':'%'+_0x5e175c[_0xf22d('0x33')][_0xf22d('0x41')]+'%'};return _0x431a4b;}})});}_0x1a6db7=_['merge']({},_0x1a6db7,_0x5e175c[_0xf22d('0x44')]);var _0x11904b={'where':_0x1a6db7[_0xf22d('0x3f')]};return db[_0xf22d('0x45')][_0xf22d('0x1e')](_0x11904b)[_0xf22d('0x27')](function(_0x15120c){_0x76f0af[_0xf22d('0x1e')]=_0x15120c;if(_0x5e175c[_0xf22d('0x33')][_0xf22d('0x46')]){_0x1a6db7[_0xf22d('0x47')]=[{'all':!![]}];}return db[_0xf22d('0x45')][_0xf22d('0x48')](_0x1a6db7);})['then'](function(_0x1c1502){_0x76f0af['rows']=_0x1c1502;return _0x76f0af;})[_0xf22d('0x27')](respondWithFilteredResult(_0x148f55,_0x1a6db7))['catch'](handleError(_0x148f55,null));};exports[_0xf22d('0x49')]=function(_0x269a72,_0x1864f0){var _0x124a35={'raw':!![],'where':{'id':_0x269a72[_0xf22d('0x4a')]['id']}},_0x1bd69b={};_0x1bd69b[_0xf22d('0x37')]=_[_0xf22d('0x34')](db[_0xf22d('0x45')][_0xf22d('0x2e')]);_0x1bd69b[_0xf22d('0x33')]=_[_0xf22d('0x34')](_0x269a72[_0xf22d('0x33')]);_0x1bd69b['filters']=_[_0xf22d('0x36')](_0x1bd69b[_0xf22d('0x37')],_0x1bd69b[_0xf22d('0x33')]);_0x124a35[_0xf22d('0x38')]=_[_0xf22d('0x36')](_0x1bd69b[_0xf22d('0x37')],qs['fields'](_0x269a72[_0xf22d('0x33')][_0xf22d('0x39')]));_0x124a35[_0xf22d('0x38')]=_0x124a35[_0xf22d('0x38')][_0xf22d('0x3a')]?_0x124a35[_0xf22d('0x38')]:_0x1bd69b[_0xf22d('0x37')];if(_0x269a72['query'][_0xf22d('0x46')]){_0x124a35[_0xf22d('0x47')]=[{'all':!![]}];}_0x124a35=_[_0xf22d('0x42')]({},_0x124a35,_0x269a72['options']);return db[_0xf22d('0x45')]['find'](_0x124a35)['then'](handleEntityNotFound(_0x1864f0,null))[_0xf22d('0x27')](respondWithResult(_0x1864f0,null))['catch'](handleError(_0x1864f0,null));};exports[_0xf22d('0x25')]=function(_0x208f88,_0x3c8286){if(_0x208f88['body']['id']){delete _0x208f88[_0xf22d('0x4b')]['id'];}return db[_0xf22d('0x45')][_0xf22d('0x4c')]({'where':{'id':_0x208f88['params']['id']}})[_0xf22d('0x27')](handleEntityNotFound(_0x3c8286,null))[_0xf22d('0x27')](saveUpdates(_0x208f88[_0xf22d('0x4b')],null))[_0xf22d('0x27')](respondWithResult(_0x3c8286,null))[_0xf22d('0x4d')](handleError(_0x3c8286,null));};exports[_0xf22d('0x26')]=function(_0x86d72c,_0x1a1927){return db['CmCustomField'][_0xf22d('0x4c')]({'where':{'id':_0x86d72c['params']['id']}})['then'](handleEntityNotFound(_0x1a1927,null))['then'](removeEntity(_0x1a1927,null))['catch'](handleError(_0x1a1927,null));};exports[_0xf22d('0x4e')]=function(_0x101a15,_0x34fe12){var _0x42996d;return db[_0xf22d('0x4f')][_0xf22d('0x50')](function(_0x3f17b4){return db[_0xf22d('0x45')]['create'](_0x101a15[_0xf22d('0x4b')],{'transaction':_0x3f17b4})[_0xf22d('0x27')](function(_0x5e571e){_0x42996d=_0x5e571e;var _0x3fffc0={'type':db['Sequelize']['TEXT'],'transaction':_0x3f17b4};switch(_0x101a15[_0xf22d('0x4b')][_0xf22d('0x30')]){case'text':_0x3fffc0[_0xf22d('0x30')]=db['Sequelize'][_0xf22d('0x51')];break;case _0xf22d('0x52'):_0x3fffc0[_0xf22d('0x30')]=db['Sequelize']['INTEGER'];break;case'switch':_0x3fffc0['type']=db['Sequelize']['BOOLEAN'];_0x3fffc0[_0xf22d('0x53')]=![];break;default:}return db[_0xf22d('0x4f')][_0xf22d('0x54')][_0xf22d('0x55')](_0xf22d('0x56'),util['format'](_0xf22d('0x57'),_0x42996d['id']),_0x3fffc0);})[_0xf22d('0x27')](function(){return _0x42996d;});})['then'](respondWithResult(_0x34fe12,0xc9))['catch'](handleError(_0x34fe12,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index e8215b7..eaa6190 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 _0x4003=['api','bluebird','request-promise','path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','lodash','../../config/logger'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0x4003,0x82));var _0x3400=function(_0x500b21,_0x49b9b2){_0x500b21=_0x500b21-0x0;var _0x5eb516=_0x4003[_0x500b21];return _0x5eb516;};'use strict';var _=require(_0x3400('0x0'));var util=require('util');var logger=require(_0x3400('0x1'))(_0x3400('0x2'));var moment=require('moment');var BPromise=require(_0x3400('0x3'));var rp=require(_0x3400('0x4'));var fs=require('fs');var path=require(_0x3400('0x5'));var rimraf=require(_0x3400('0x6'));var config=require('../../config/environment');var attributes=require(_0x3400('0x7'));module[_0x3400('0x8')]=function(_0x27e42f,_0x282207){return _0x27e42f[_0x3400('0x9')](_0x3400('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0fb=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','./cmCustomField.attributes','exports','define','CmCustomField'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe0fb,0x134));var _0xbe0f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe0fb[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xbe0f('0x0'));var util=require(_0xbe0f('0x1'));var logger=require(_0xbe0f('0x2'))('api');var moment=require(_0xbe0f('0x3'));var BPromise=require(_0xbe0f('0x4'));var rp=require(_0xbe0f('0x5'));var fs=require('fs');var path=require(_0xbe0f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe0f('0x7'));module[_0xbe0f('0x8')]=function(_0x57f757,_0x3f14c9){return _0x57f757[_0xbe0f('0x9')](_0xbe0f('0xa'),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 39c1749..74f07b6 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 _0x10f4=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x49a80a,_0x1c7872){var _0x1fb2d3=function(_0x1a9e91){while(--_0x1a9e91){_0x49a80a['push'](_0x49a80a['shift']());}};_0x1fb2d3(++_0x1c7872);}(_0x10f4,0xf1));var _0x410f=function(_0x5ec4eb,_0x2dc478){_0x5ec4eb=_0x5ec4eb-0x0;var _0x1f3253=_0x10f4[_0x5ec4eb];return _0x1f3253;};'use strict';var _=require(_0x410f('0x0'));var util=require(_0x410f('0x1'));var moment=require(_0x410f('0x2'));var BPromise=require(_0x410f('0x3'));var rs=require(_0x410f('0x4'));var fs=require('fs');var Redis=require(_0x410f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x410f('0x6'));var logger=require('../../config/logger')(_0x410f('0x7'));var config=require(_0x410f('0x8'));var jayson=require(_0x410f('0x9'));var client=jayson[_0x410f('0xa')][_0x410f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2217cd,_0x3f7818,_0x137023){return new BPromise(function(_0x8eb152,_0x4c10e9){return client['request'](_0x2217cd,_0x137023)[_0x410f('0xc')](function(_0x2556f5){logger[_0x410f('0xd')](_0x410f('0xe'),_0x3f7818,_0x410f('0xf'));logger[_0x410f('0x10')](_0x410f('0x11'),_0x3f7818,_0x410f('0xf'),JSON[_0x410f('0x12')](_0x2556f5));if(_0x2556f5[_0x410f('0x13')]){if(_0x2556f5[_0x410f('0x13')][_0x410f('0x14')]===0x1f4){logger[_0x410f('0x13')](_0x410f('0xe'),_0x3f7818,_0x2556f5['error'][_0x410f('0x15')]);return _0x4c10e9(_0x2556f5[_0x410f('0x13')][_0x410f('0x15')]);}logger[_0x410f('0x13')](_0x410f('0xe'),_0x3f7818,_0x2556f5['error']['message']);return _0x8eb152(_0x2556f5[_0x410f('0x13')][_0x410f('0x15')]);}else{logger[_0x410f('0xd')](_0x410f('0xe'),_0x3f7818,_0x410f('0xf'));_0x8eb152(_0x2556f5[_0x410f('0x16')][_0x410f('0x15')]);}})[_0x410f('0x17')](function(_0x2d6f23){logger['error']('CmCustomField,\x20%s,\x20%s',_0x3f7818,_0x2d6f23);_0x4c10e9(_0x2d6f23);});});} \ No newline at end of file +var _0xcf00=['info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','request'];(function(_0x5e6ebe,_0x373752){var _0x5d80a0=function(_0x145677){while(--_0x145677){_0x5e6ebe['push'](_0x5e6ebe['shift']());}};_0x5d80a0(++_0x373752);}(_0xcf00,0x1dd));var _0x0cf0=function(_0x1075a2,_0xb2f371){_0x1075a2=_0x1075a2-0x0;var _0x43f5f9=_0xcf00[_0x1075a2];return _0x43f5f9;};'use strict';var _=require(_0x0cf0('0x0'));var util=require(_0x0cf0('0x1'));var moment=require('moment');var BPromise=require(_0x0cf0('0x2'));var rs=require(_0x0cf0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0cf0('0x4'))['db'];var utils=require(_0x0cf0('0x5'));var logger=require(_0x0cf0('0x6'))(_0x0cf0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47adc6,_0x3a0b14,_0x2a3229){return new BPromise(function(_0x2c567c,_0x236652){return client[_0x0cf0('0x8')](_0x47adc6,_0x2a3229)['then'](function(_0x4f61ed){logger[_0x0cf0('0x9')](_0x0cf0('0xa'),_0x3a0b14,_0x0cf0('0xb'));logger['debug'](_0x0cf0('0xc'),_0x3a0b14,_0x0cf0('0xb'),JSON[_0x0cf0('0xd')](_0x4f61ed));if(_0x4f61ed[_0x0cf0('0xe')]){if(_0x4f61ed[_0x0cf0('0xe')][_0x0cf0('0xf')]===0x1f4){logger[_0x0cf0('0xe')](_0x0cf0('0xa'),_0x3a0b14,_0x4f61ed['error'][_0x0cf0('0x10')]);return _0x236652(_0x4f61ed['error'][_0x0cf0('0x10')]);}logger[_0x0cf0('0xe')](_0x0cf0('0xa'),_0x3a0b14,_0x4f61ed[_0x0cf0('0xe')][_0x0cf0('0x10')]);return _0x2c567c(_0x4f61ed[_0x0cf0('0xe')][_0x0cf0('0x10')]);}else{logger[_0x0cf0('0x9')](_0x0cf0('0xa'),_0x3a0b14,_0x0cf0('0xb'));_0x2c567c(_0x4f61ed[_0x0cf0('0x11')]['message']);}})['catch'](function(_0x49c0d1){logger[_0x0cf0('0xe')](_0x0cf0('0xa'),_0x3a0b14,_0x49c0d1);_0x236652(_0x49c0d1);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 3b33524..20d236a 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 _0xc95e=['index','get','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','./cmCustomField.controller','isAuthenticated'];(function(_0x5387f2,_0x11596b){var _0xe6d676=function(_0x4f2ee3){while(--_0x4f2ee3){_0x5387f2['push'](_0x5387f2['shift']());}};_0xe6d676(++_0x11596b);}(_0xc95e,0x14d));var _0xec95=function(_0x1df804,_0x337349){_0x1df804=_0x1df804-0x0;var _0x20eeb0=_0xc95e[_0x1df804];return _0x20eeb0;};'use strict';var multer=require(_0xec95('0x0'));var util=require(_0xec95('0x1'));var path=require('path');var timeout=require(_0xec95('0x2'));var express=require(_0xec95('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xec95('0x4'));var config=require('../../config/environment');var controller=require(_0xec95('0x5'));router['get']('/',auth[_0xec95('0x6')](),controller[_0xec95('0x7')]);router[_0xec95('0x8')](_0xec95('0x9'),auth['isAuthenticated'](),controller[_0xec95('0xa')]);router[_0xec95('0xb')]('/',auth[_0xec95('0x6')](),controller['create']);router[_0xec95('0xc')]('/:id',auth[_0xec95('0x6')](),controller[_0xec95('0xd')]);router[_0xec95('0xe')](_0xec95('0x9'),auth['isAuthenticated'](),controller[_0xec95('0xf')]);module[_0xec95('0x10')]=router; \ No newline at end of file +var _0xf518=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','exports','util','connect-timeout','express','Router'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf518,0xd4));var _0x8f51=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0xf518[_0xf2628e];return _0x13863a;};'use strict';var multer=require('multer');var util=require(_0x8f51('0x0'));var path=require('path');var timeout=require(_0x8f51('0x1'));var express=require(_0x8f51('0x2'));var router=express[_0x8f51('0x3')]();var fs_extra=require(_0x8f51('0x4'));var auth=require(_0x8f51('0x5'));var interaction=require(_0x8f51('0x6'));var config=require(_0x8f51('0x7'));var controller=require('./cmCustomField.controller');router[_0x8f51('0x8')]('/',auth[_0x8f51('0x9')](),controller[_0x8f51('0xa')]);router[_0x8f51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x8f51('0xb')]);router[_0x8f51('0xc')]('/',auth[_0x8f51('0x9')](),controller[_0x8f51('0xd')]);router[_0x8f51('0xe')](_0x8f51('0xf'),auth[_0x8f51('0x9')](),controller[_0x8f51('0x10')]);router['delete']('/:id',auth[_0x8f51('0x9')](),controller['destroy']);module[_0x8f51('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 51a5faa..df55a1b 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 _0xd2b9=['INTEGER','UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','format'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0xd2b9,0x1e0));var _0x9d2b=function(_0x79702,_0x34931c){_0x79702=_0x79702-0x0;var _0x417e6b=_0xd2b9[_0x79702];return _0x417e6b;};'use strict';var moment=require(_0x9d2b('0x0'));var Sequelize=require(_0x9d2b('0x1'));module['exports']={'phone':{'type':Sequelize[_0x9d2b('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x9d2b('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x9d2b('0x4')],'defaultValue':moment()[_0x9d2b('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x9d2b('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9d2b('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9d2b('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9d2b('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9d2b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9d2b('0x4')]},'priority':{'type':Sequelize[_0x9d2b('0x6')](0x2)[_0x9d2b('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9d2b('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9d2b('0x6')],'unique':_0x9d2b('0x8')},'ListId':{'type':Sequelize[_0x9d2b('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x9d2b('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x9d2b('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x9d2b('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x9d2b('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9d2b('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9d2b('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9d2b('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x9d2b('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x9d2b('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xeaf4=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeaf4,0xe1));var _0x4eaf=function(_0xe18c7,_0x516b7c){_0xe18c7=_0xe18c7-0x0;var _0x5f2874=_0xeaf4[_0xe18c7];return _0x5f2874;};'use strict';var moment=require(_0x4eaf('0x0'));var Sequelize=require(_0x4eaf('0x1'));module[_0x4eaf('0x2')]={'phone':{'type':Sequelize[_0x4eaf('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x4eaf('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x4eaf('0x5')],'defaultValue':moment()[_0x4eaf('0x6')](_0x4eaf('0x7'))},'countbusyretry':{'type':Sequelize[_0x4eaf('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4eaf('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4eaf('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x4eaf('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4eaf('0x5')]},'priority':{'type':Sequelize[_0x4eaf('0x8')](0x2)[_0x4eaf('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x4eaf('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x4eaf('0x8')],'unique':_0x4eaf('0xa')},'ListId':{'type':Sequelize[_0x4eaf('0x8')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x4eaf('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x4eaf('0x8')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x4eaf('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0x4eaf('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4eaf('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4eaf('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4eaf('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x4eaf('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4eaf('0x3')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 0b74056..cdbb5ad 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 _0xf45d=['map','fieldName','type','key','model','query','filters','intersection','concat','$or','$gt','$gte','$lt','$lte','$ne','$between','$notBetween','$in','$like','$overlap','$contains','$contained','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','CmHopper','includeAll','include','findAll','rows','show','params','keys','rawAttributes','merge','options','find','body','catch','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','createdAt','updatedAt','state','statedesc','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','create','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','value','direction','prev','isEmpty','hopperIds','ASC','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','recallme','UPDATE','Contact','CmCompany','CmList','List','Queue','dialActive','getPreviewRecall','getVoiceQueues','hopperId','scheduledat','LOCK','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','json','getTimezone','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','reject','update','then','destroy','end','error','stack','name'];(function(_0x41044a,_0x53583c){var _0x59b2c8=function(_0x5edaa9){while(--_0x5edaa9){_0x41044a['push'](_0x41044a['shift']());}};_0x59b2c8(++_0x53583c);}(_0xf45d,0x1a8));var _0xdf45=function(_0x1503c6,_0x3e1bab){_0x1503c6=_0x1503c6-0x0;var _0x403367=_0xf45d[_0x1503c6];return _0x403367;};'use strict';var emlformat=require(_0xdf45('0x0'));var rimraf=require(_0xdf45('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf45('0x2'));var rp=require(_0xdf45('0x3'));var moment=require(_0xdf45('0x4'));var BPromise=require(_0xdf45('0x5'));var Mustache=require(_0xdf45('0x6'));var util=require('util');var path=require(_0xdf45('0x7'));var sox=require(_0xdf45('0x8'));var csv=require(_0xdf45('0x9'));var ejs=require(_0xdf45('0xa'));var fs=require('fs');var fs_extra=require(_0xdf45('0xb'));var _=require(_0xdf45('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdf45('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdf45('0x9'));var querystring=require(_0xdf45('0xe'));var Papa=require(_0xdf45('0xf'));var Redis=require('ioredis');var authService=require(_0xdf45('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdf45('0x11'));var hardwareService=require(_0xdf45('0x12'));var logger=require(_0xdf45('0x13'))(_0xdf45('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var shared=require(_0xdf45('0x15'));var licenseUtil=require(_0xdf45('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1476e4,_0x4b58de){_0x4b58de=_0x4b58de||0xcc;return function(_0x2357ff){if(_0x2357ff){return _0x1476e4[_0xdf45('0x17')](_0x4b58de);}return _0x1476e4[_0xdf45('0x18')](_0x4b58de)['end']();};}function respondWithResult(_0x3717ec,_0x12897b){_0x12897b=_0x12897b||0xc8;return function(_0x5060c8){if(_0x5060c8){return _0x3717ec[_0xdf45('0x18')](_0x12897b)['json'](_0x5060c8);}};}function respondWithFilteredResult(_0x33d8b7,_0x17cc0f){return function(_0x33de40){if(_0x33de40){var _0x21a0b7=typeof _0x17cc0f[_0xdf45('0x19')]==='undefined'&&typeof _0x17cc0f[_0xdf45('0x1a')]===_0xdf45('0x1b');var _0x5b2f9c=_0x33de40[_0xdf45('0x1c')];var _0x176a70=_0x21a0b7?0x0:_0x17cc0f[_0xdf45('0x19')];var _0x425cbf=_0x21a0b7?_0x33de40[_0xdf45('0x1c')]:_0x17cc0f[_0xdf45('0x19')]+_0x17cc0f[_0xdf45('0x1a')];var _0xbd8f57;if(_0x425cbf>=_0x5b2f9c){_0x425cbf=_0x5b2f9c;_0xbd8f57=0xc8;}else{_0xbd8f57=0xce;}_0x33d8b7[_0xdf45('0x18')](_0xbd8f57);return _0x33d8b7[_0xdf45('0x1d')]('Content-Range',_0x176a70+'-'+_0x425cbf+'/'+_0x5b2f9c)['json'](_0x33de40);}return null;};}function patchUpdates(_0x56bc60){return function(_0x280c19){try{jsonpatch['apply'](_0x280c19,_0x56bc60,!![]);}catch(_0x25f0da){return BPromise[_0xdf45('0x1e')](_0x25f0da);}return _0x280c19['save']();};}function saveUpdates(_0x3396ed,_0x426745){return function(_0x4c4c25){if(_0x4c4c25){return _0x4c4c25[_0xdf45('0x1f')](_0x3396ed)[_0xdf45('0x20')](function(_0x162972){return _0x162972;});}return null;};}function removeEntity(_0x41ae91,_0x24aac5){return function(_0x58f4f4){if(_0x58f4f4){return _0x58f4f4[_0xdf45('0x21')]()[_0xdf45('0x20')](function(){_0x41ae91[_0xdf45('0x18')](0xcc)[_0xdf45('0x22')]();});}};}function handleEntityNotFound(_0x3a4c8e,_0x5d0773){return function(_0x51c24b){if(!_0x51c24b){_0x3a4c8e[_0xdf45('0x17')](0x194);}return _0x51c24b;};}function handleError(_0x553b92,_0x42301a){_0x42301a=_0x42301a||0x1f4;return function(_0x2d8c4a){logger[_0xdf45('0x23')](_0x2d8c4a[_0xdf45('0x24')]);if(_0x2d8c4a[_0xdf45('0x25')]){delete _0x2d8c4a['name'];}_0x553b92[_0xdf45('0x18')](_0x42301a)['send'](_0x2d8c4a);};}exports['index']=function(_0xe55284,_0x307fef){var _0x42b9ad={},_0xaf619b={},_0x5e9c9f={'count':0x0,'rows':[]};var _0x46ac0f=_[_0xdf45('0x26')](db['CmHopper']['rawAttributes'],function(_0x3b3e00){return{'name':_0x3b3e00[_0xdf45('0x27')],'type':_0x3b3e00[_0xdf45('0x28')][_0xdf45('0x29')]};});_0xaf619b[_0xdf45('0x2a')]=_['map'](_0x46ac0f,_0xdf45('0x25'));_0xaf619b['query']=_['keys'](_0xe55284[_0xdf45('0x2b')]);_0xaf619b[_0xdf45('0x2c')]=_[_0xdf45('0x2d')](_0xaf619b[_0xdf45('0x2a')],_0xaf619b[_0xdf45('0x2b')]);_0xaf619b[_0xdf45('0x2c')]=_[_0xdf45('0x2e')](_0xaf619b['filters'],['$and',_0xdf45('0x2f'),_0xdf45('0x30'),_0xdf45('0x31'),_0xdf45('0x32'),_0xdf45('0x33'),_0xdf45('0x34'),'$eq','$not',_0xdf45('0x35'),_0xdf45('0x36'),_0xdf45('0x37'),'$notIn',_0xdf45('0x38'),'$notLike','$iLike','$notILike',_0xdf45('0x38'),_0xdf45('0x39'),_0xdf45('0x3a'),_0xdf45('0x3b'),'$any']);_0x42b9ad[_0xdf45('0x3c')]=_[_0xdf45('0x2d')](_0xaf619b[_0xdf45('0x2a')],qs[_0xdf45('0x3d')](_0xe55284['query'][_0xdf45('0x3d')]));_0x42b9ad['attributes']=_0x42b9ad[_0xdf45('0x3c')][_0xdf45('0x3e')]?_0x42b9ad[_0xdf45('0x3c')]:_0xaf619b[_0xdf45('0x2a')];if(!_0xe55284['query']['hasOwnProperty'](_0xdf45('0x3f'))){_0x42b9ad[_0xdf45('0x1a')]=qs[_0xdf45('0x1a')](_0xe55284['query'][_0xdf45('0x1a')]);_0x42b9ad['offset']=qs[_0xdf45('0x19')](_0xe55284[_0xdf45('0x2b')][_0xdf45('0x19')]);}_0x42b9ad[_0xdf45('0x40')]=qs[_0xdf45('0x41')](_0xe55284[_0xdf45('0x2b')]['sort']);_0x42b9ad[_0xdf45('0x42')]=qs[_0xdf45('0x2c')](_[_0xdf45('0x43')](_0xe55284['query'],_0xaf619b['filters']),_0x46ac0f);if(_0xe55284[_0xdf45('0x2b')][_0xdf45('0x44')]){_0x42b9ad[_0xdf45('0x42')]=_['merge'](_0x42b9ad[_0xdf45('0x42')],{'$or':_['map'](_0x46ac0f,function(_0x5f522f){if(_0x5f522f[_0xdf45('0x28')]!==_0xdf45('0x45')){var _0x409bf8={};_0x409bf8[_0x5f522f[_0xdf45('0x25')]]={'$like':'%'+_0xe55284[_0xdf45('0x2b')]['filter']+'%'};return _0x409bf8;}})});}_0x42b9ad=_['merge']({},_0x42b9ad,_0xe55284['options']);var _0x2f7b38={'where':_0x42b9ad[_0xdf45('0x42')]};return db[_0xdf45('0x46')]['count'](_0x2f7b38)[_0xdf45('0x20')](function(_0x246577){_0x5e9c9f[_0xdf45('0x1c')]=_0x246577;if(_0xe55284[_0xdf45('0x2b')][_0xdf45('0x47')]){_0x42b9ad[_0xdf45('0x48')]=[{'all':!![]}];}return db[_0xdf45('0x46')][_0xdf45('0x49')](_0x42b9ad);})[_0xdf45('0x20')](function(_0x159672){_0x5e9c9f[_0xdf45('0x4a')]=_0x159672;return _0x5e9c9f;})[_0xdf45('0x20')](respondWithFilteredResult(_0x307fef,_0x42b9ad))['catch'](handleError(_0x307fef,null));};exports[_0xdf45('0x4b')]=function(_0x19a415,_0x5a214b){var _0x361fc4={'raw':!![],'where':{'id':_0x19a415[_0xdf45('0x4c')]['id']}},_0x4584ba={};_0x4584ba[_0xdf45('0x2a')]=_[_0xdf45('0x4d')](db[_0xdf45('0x46')][_0xdf45('0x4e')]);_0x4584ba['query']=_[_0xdf45('0x4d')](_0x19a415['query']);_0x4584ba[_0xdf45('0x2c')]=_['intersection'](_0x4584ba[_0xdf45('0x2a')],_0x4584ba['query']);_0x361fc4[_0xdf45('0x3c')]=_[_0xdf45('0x2d')](_0x4584ba[_0xdf45('0x2a')],qs['fields'](_0x19a415['query'][_0xdf45('0x3d')]));_0x361fc4[_0xdf45('0x3c')]=_0x361fc4[_0xdf45('0x3c')][_0xdf45('0x3e')]?_0x361fc4[_0xdf45('0x3c')]:_0x4584ba[_0xdf45('0x2a')];if(_0x19a415[_0xdf45('0x2b')][_0xdf45('0x47')]){_0x361fc4[_0xdf45('0x48')]=[{'all':!![]}];}_0x361fc4=_[_0xdf45('0x4f')]({},_0x361fc4,_0x19a415[_0xdf45('0x50')]);return db['CmHopper'][_0xdf45('0x51')](_0x361fc4)[_0xdf45('0x20')](handleEntityNotFound(_0x5a214b,null))[_0xdf45('0x20')](respondWithResult(_0x5a214b,null))['catch'](handleError(_0x5a214b,null));};exports['create']=function(_0x4fc2fa,_0x669581){return db['CmHopper']['create'](_0x4fc2fa[_0xdf45('0x52')],{})[_0xdf45('0x20')](respondWithResult(_0x669581,0xc9))['catch'](handleError(_0x669581,null));};exports[_0xdf45('0x1f')]=function(_0x1cd4d2,_0x471615){if(_0x1cd4d2[_0xdf45('0x52')]['id']){delete _0x1cd4d2[_0xdf45('0x52')]['id'];}return db[_0xdf45('0x46')][_0xdf45('0x51')]({'where':{'id':_0x1cd4d2[_0xdf45('0x4c')]['id']}})[_0xdf45('0x20')](handleEntityNotFound(_0x471615,null))[_0xdf45('0x20')](saveUpdates(_0x1cd4d2[_0xdf45('0x52')],null))['then'](respondWithResult(_0x471615,null))[_0xdf45('0x53')](handleError(_0x471615,null));};exports[_0xdf45('0x54')]=function(_0x344c28,_0x4538e3){return db['CmHopper'][_0xdf45('0x54')]()[_0xdf45('0x20')](respondWithResult(_0x4538e3,null))[_0xdf45('0x53')](handleError(_0x4538e3,null));};exports['destroy']=function(_0x40d6e4,_0x2224fa){var _0x298545;var _0x387ea8=_0x40d6e4['params']['id'];return db[_0xdf45('0x46')][_0xdf45('0x51')]({'where':{'id':_0x40d6e4[_0xdf45('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2224fa,null))[_0xdf45('0x20')](function(_0x54cae6){if(_0x54cae6){return _0x54cae6[_0xdf45('0x21')]()['then'](function(_0x5bfed0){return _0x5bfed0;});}})[_0xdf45('0x20')](function(_0x39db9f){_0x298545=_0x39db9f;if(_0x39db9f){if(_0x39db9f[_0xdf45('0x55')]||_0x39db9f[_0xdf45('0x56')]){return db[_0x39db9f[_0xdf45('0x55')]?_0xdf45('0x57'):_0xdf45('0x58')][_0xdf45('0x51')]({'where':{'id':_0x39db9f[_0xdf45('0x55')]?_0x39db9f['VoiceQueueId']:_0x39db9f[_0xdf45('0x56')]},'attributes':['id','name'],'raw':!![]});}}})[_0xdf45('0x20')](function(_0xf6bcd7){var _0x3680d0={};if(_0xf6bcd7){_[_0xdf45('0x4f')](_0x3680d0,_['omit'](_0x298545[_0xdf45('0x59')],[_0xdf45('0x5a'),_0xdf45('0x5b'),'id']));_0x3680d0[_0xdf45('0x5c')]=0x15;_0x3680d0[_0xdf45('0x5d')]='deleted';_0x3680d0['campaign']=_0xf6bcd7[_0xdf45('0x25')];_0x3680d0[_0xdf45('0x5e')]=_0x40d6e4[_0xdf45('0x5f')]['name'];_0x3680d0[_0xdf45('0x60')]=_0x40d6e4[_0xdf45('0x5f')]['id'];_0x3680d0['deleted']=!![];_0x3680d0['deletedat']=moment()[_0xdf45('0x61')](_0xdf45('0x62'));_0x3680d0['calleridnum']=_0x298545[_0xdf45('0x63')];_0x3680d0[_0xdf45('0x64')]=_0x298545['VoiceQueueId']?_0xdf45('0x65'):_0xdf45('0x66');return db[_0xdf45('0x67')][_0xdf45('0x51')]({'where':{'id':_0x3680d0[_0xdf45('0x68')]},'attributes':[_0xdf45('0x69'),_0xdf45('0x6a')]})[_0xdf45('0x20')](function(_0x2fd197){if(!_['isNil'](_0x2224fa)&&!_[_0xdf45('0x6b')](_0x2fd197['firstName'])){_0x3680d0[_0xdf45('0x6c')]=_0x2fd197[_0xdf45('0x69')];if(!_[_0xdf45('0x6b')](_0x2fd197[_0xdf45('0x6a')])){_0x3680d0[_0xdf45('0x6c')]+='\x20'+_0x2fd197[_0xdf45('0x6a')];}}})[_0xdf45('0x6d')](function(){return db[_0xdf45('0x6e')][_0xdf45('0x6f')](_0x3680d0);});}})[_0xdf45('0x20')](function(_0x2d518f){return db['CmHopperAdditionalPhone'][_0xdf45('0x21')]({'where':{'CmHopperId':_0x387ea8}});})['then'](function(){return _0x2224fa['status'](0xcc)[_0xdf45('0x22')]();})[_0xdf45('0x53')](handleError(_0x2224fa,null));};exports[_0xdf45('0x70')]=function(_0x58145e,_0x346655,_0x49be66){var _0x247304=[];return db['CmContact'][_0xdf45('0x54')]()[_0xdf45('0x20')](function(_0xba9703){_0x247304=_[_0xdf45('0x4d')](_0xba9703);return _0x58145e[_0xdf45('0x5f')]['getVoiceQueues']({'where':{'type':_0xdf45('0x71'),'dialActive':!![],'dialMethod':_0xdf45('0x72')},'attributes':['id',_0xdf45('0x73'),_0xdf45('0x74')],'raw':!![]});})[_0xdf45('0x20')](function(_0x2095a1){if(_0x2095a1&&_0x2095a1[_0xdf45('0x3e')]){return db['sequelize'][_0xdf45('0x75')](function(_0x78759e){var _0x5559f4={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xdf45('0x62'))},'VoiceQueueId':{'$in':_[_0xdf45('0x26')](_0x2095a1,'id')},'$or':[{'UserId':null},{'UserId':_0x58145e[_0xdf45('0x5f')]['id']}]};var _0x11030e={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2095a1)['filter']([_0xdf45('0x74'),0x0])[_0xdf45('0x26')]('id')[_0xdf45('0x76')]()},'$or':[{'UserId':null},{'UserId':_0x58145e['user']['id']}]};var _0x247dfd={'$or':[_0x5559f4,_0x11030e]};var _0x3c996e=[];if(_0x58145e[_0xdf45('0x52')]['direction']&&_0x58145e[_0xdf45('0x52')][_0xdf45('0x77')]===_0xdf45('0x78')){if(!_[_0xdf45('0x79')](_0x58145e[_0xdf45('0x52')]['hopperIds'])){_0x247dfd['id']={'$in':_0x58145e[_0xdf45('0x52')][_0xdf45('0x7a')]};}_0x3c996e=[['priority',_0xdf45('0x7b')],['scheduledAt',_0x2095a1[0x0]['dialOrderByScheduledAt']==='ASC'?_0xdf45('0x7c'):_0xdf45('0x7b')],db[_0xdf45('0x7d')]['literal'](_0xdf45('0x7e')),['id',_0xdf45('0x7c')]];}else{if(!_[_0xdf45('0x79')](_0x58145e['body'][_0xdf45('0x7a')])){_0x247dfd['id']={'$notIn':_0x58145e[_0xdf45('0x52')]['hopperIds']};}_0x3c996e=[[_0xdf45('0x7f'),_0xdf45('0x7c')],['scheduledAt',_0x2095a1[0x0]['dialOrderByScheduledAt']],db[_0xdf45('0x7d')][_0xdf45('0x80')](_0xdf45('0x81')),['id',_0xdf45('0x7b')]];}return db[_0xdf45('0x46')][_0xdf45('0x82')]({'attributes':['id','scheduledat',_0xdf45('0x63'),_0xdf45('0x83')],'where':_0x247dfd,'order':_0x3c996e,'transaction':_0x78759e,'lock':_0x78759e['LOCK'][_0xdf45('0x84')],'include':[{'model':db['CmContact'],'as':_0xdf45('0x85'),'attributes':_0x247304,'include':[{'model':db[_0xdf45('0x86')],'as':'Company','attributes':['id',_0xdf45('0x25')]}]},{'model':db[_0xdf45('0x87')],'as':_0xdf45('0x88'),'attributes':['id','name']},{'model':db[_0xdf45('0x57')],'as':_0xdf45('0x89'),'attributes':['id','name',_0xdf45('0x8a')]}]})[_0xdf45('0x20')](function(_0x2c7ffa){if(_0x2c7ffa){return _0x2c7ffa[_0xdf45('0x1f')]({'UserId':_0x58145e[_0xdf45('0x5f')]['id']},{'transaction':_0x78759e});}});});}})[_0xdf45('0x20')](handleEntityNotFound(_0x346655,null))['then'](respondWithResult(_0x346655,null))[_0xdf45('0x53')](handleError(_0x346655,null));};exports[_0xdf45('0x8b')]=function(_0x174a48,_0x1b7b91,_0x36d8e1){var _0x1c2d60=[];return db[_0xdf45('0x67')][_0xdf45('0x54')]()[_0xdf45('0x20')](function(_0xd026a9){_0x1c2d60=_[_0xdf45('0x4d')](_0xd026a9);return _0x174a48['user'][_0xdf45('0x8c')]({'where':{'type':_0xdf45('0x71'),'dialActive':!![],'dialMethod':_0xdf45('0x72')},'attributes':['id',_0xdf45('0x73'),_0xdf45('0x74')],'raw':!![]});})[_0xdf45('0x20')](function(_0x4d40e8){if(_0x4d40e8&&_0x4d40e8[_0xdf45('0x3e')]){return db[_0xdf45('0x7d')][_0xdf45('0x75')](function(_0x416ac4){var _0x3bb9f6={'active':![],'recallme':!![],'id':_0x174a48['body'][_0xdf45('0x8d')]};return db[_0xdf45('0x46')][_0xdf45('0x82')]({'attributes':['id',_0xdf45('0x8e'),_0xdf45('0x83')],'where':_0x3bb9f6,'transaction':_0x416ac4,'lock':_0x416ac4[_0xdf45('0x8f')]['UPDATE'],'include':[{'model':db[_0xdf45('0x67')],'as':_0xdf45('0x85'),'attributes':_0x1c2d60,'include':[{'model':db[_0xdf45('0x86')],'as':'Company','attributes':['id',_0xdf45('0x25')]}]},{'model':db[_0xdf45('0x87')],'as':_0xdf45('0x88'),'attributes':['id',_0xdf45('0x25')]},{'model':db[_0xdf45('0x57')],'as':_0xdf45('0x89'),'attributes':['id',_0xdf45('0x25'),_0xdf45('0x8a')]}]})[_0xdf45('0x20')](function(_0xe8f3c8){if(_0xe8f3c8){return _0xe8f3c8[_0xdf45('0x1f')]({'UserId':_0x174a48[_0xdf45('0x5f')]['id']},{'transaction':_0x416ac4});}});});}})[_0xdf45('0x20')](handleEntityNotFound(_0x1b7b91,null))[_0xdf45('0x20')](respondWithResult(_0x1b7b91,null))['catch'](handleError(_0x1b7b91,null));};exports[_0xdf45('0x90')]=function(_0xaf3ba5,_0x3ea8f2,_0x12f7d3){return _0xaf3ba5[_0xdf45('0x5f')][_0xdf45('0x8c')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xdf45('0x72')},'attributes':['id'],'raw':!![]})['then'](function(_0x5b2efe){if(_0x5b2efe&&_0x5b2efe[_0xdf45('0x3e')]){return db[_0xdf45('0x46')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xdf45('0x62'))},'VoiceQueueId':{'$in':_[_0xdf45('0x26')](_0x5b2efe,'id')},'$or':[{'UserId':null},{'UserId':_0xaf3ba5[_0xdf45('0x5f')]['id']}]}});}return 0x0;})[_0xdf45('0x20')](function(_0x45a4ed){if(!_[_0xdf45('0x6b')](_0x45a4ed)&&_[_0xdf45('0x91')](_0x45a4ed)){return _0x3ea8f2[_0xdf45('0x18')](0xc8)['json']({'contacts':_0x45a4ed});}else{logger['error'](_0xdf45('0x92'),'getOpenContacts',0x194,_0xdf45('0x93'));_0x3ea8f2['sendStatus'](0x194);}})[_0xdf45('0x53')](handleError(_0x3ea8f2,null));};exports[_0xdf45('0x94')]=function(_0x2beace,_0x1dbc7a,_0x31be84){var _0x266314=shared[_0xdf45('0x95')];var _0xf866ea=[];_[_0xdf45('0x26')](_0x266314,function(_0x1d587c){_0xf866ea[_0xdf45('0x96')]({'id':_0x1d587c[_0xdf45('0x25')],'name':_0x1d587c[_0xdf45('0x25')],'utcOffset':_0x1d587c[_0xdf45('0x97')]});});return _0x1dbc7a['status'](0xc8)[_0xdf45('0x98')]({'tz':_0xf866ea});};exports[_0xdf45('0x99')]=function(_0x2042db,_0x363fac,_0xd59f64){var _0xa48786=shared[_0xdf45('0x95')];var _0x3e7992={};if(!_[_0xdf45('0x6b')](_0xa48786[_0x2042db[_0xdf45('0x52')]['id']]))_0x3e7992=_0xa48786[_0x2042db['body']['id']];return _0x363fac['status'](0xc8)[_0xdf45('0x98')](_0x3e7992);}; \ No newline at end of file +var _0xa97c=['YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','phone','recallme','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','transaction','CmCompany','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','timezones','utcOffset','getTimezone','rimraf','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','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','index','map','CmHopper','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','concat','$and','$or','$gte','$lt','$lte','$ne','$eq','$between','$notIn','$like','$iLike','$notILike','$overlap','$contained','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','show','catch','create','body','find','params','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','createdAt','statedesc','deleted','campaign','membername','user','UserId','deletedat','format'];(function(_0x54c879,_0x54595a){var _0x10f4ea=function(_0x46cc4e){while(--_0x46cc4e){_0x54c879['push'](_0x54c879['shift']());}};_0x10f4ea(++_0x54595a);}(_0xa97c,0xd0));var _0xca97=function(_0x540f76,_0x52fb38){_0x540f76=_0x540f76-0x0;var _0x1e6091=_0xa97c[_0x540f76];return _0x1e6091;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca97('0x0'));var zipdir=require(_0xca97('0x1'));var jsonpatch=require(_0xca97('0x2'));var rp=require(_0xca97('0x3'));var moment=require(_0xca97('0x4'));var BPromise=require(_0xca97('0x5'));var Mustache=require(_0xca97('0x6'));var util=require(_0xca97('0x7'));var path=require(_0xca97('0x8'));var sox=require(_0xca97('0x9'));var csv=require(_0xca97('0xa'));var ejs=require(_0xca97('0xb'));var fs=require('fs');var fs_extra=require(_0xca97('0xc'));var _=require('lodash');var squel=require(_0xca97('0xd'));var crypto=require(_0xca97('0xe'));var jsforce=require(_0xca97('0xf'));var deskjs=require(_0xca97('0x10'));var toCsv=require(_0xca97('0xa'));var querystring=require(_0xca97('0x11'));var Papa=require(_0xca97('0x12'));var Redis=require(_0xca97('0x13'));var authService=require(_0xca97('0x14'));var qs=require(_0xca97('0x15'));var as=require(_0xca97('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xca97('0x17'));var config=require('../../config/environment');var shared=require(_0xca97('0x18'));var licenseUtil=require(_0xca97('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ecea8,_0x25ee68){_0x25ee68=_0x25ee68||0xcc;return function(_0x2fc57d){if(_0x2fc57d){return _0x1ecea8[_0xca97('0x1a')](_0x25ee68);}return _0x1ecea8[_0xca97('0x1b')](_0x25ee68)[_0xca97('0x1c')]();};}function respondWithResult(_0x4d344b,_0x50ae53){_0x50ae53=_0x50ae53||0xc8;return function(_0x263d38){if(_0x263d38){return _0x4d344b[_0xca97('0x1b')](_0x50ae53)[_0xca97('0x1d')](_0x263d38);}};}function respondWithFilteredResult(_0x55abad,_0x938696){return function(_0xe41019){if(_0xe41019){var _0x34147e=typeof _0x938696[_0xca97('0x1e')]===_0xca97('0x1f')&&typeof _0x938696[_0xca97('0x20')]==='undefined';var _0x204116=_0xe41019[_0xca97('0x21')];var _0x449a32=_0x34147e?0x0:_0x938696[_0xca97('0x1e')];var _0xcc2a70=_0x34147e?_0xe41019[_0xca97('0x21')]:_0x938696[_0xca97('0x1e')]+_0x938696['limit'];var _0x191a05;if(_0xcc2a70>=_0x204116){_0xcc2a70=_0x204116;_0x191a05=0xc8;}else{_0x191a05=0xce;}_0x55abad[_0xca97('0x1b')](_0x191a05);return _0x55abad['set']('Content-Range',_0x449a32+'-'+_0xcc2a70+'/'+_0x204116)[_0xca97('0x1d')](_0xe41019);}return null;};}function patchUpdates(_0x4e67d3){return function(_0x2b90d5){try{jsonpatch[_0xca97('0x22')](_0x2b90d5,_0x4e67d3,!![]);}catch(_0x59496a){return BPromise[_0xca97('0x23')](_0x59496a);}return _0x2b90d5['save']();};}function saveUpdates(_0x9b5b3b,_0x42a542){return function(_0x5f045b){if(_0x5f045b){return _0x5f045b[_0xca97('0x24')](_0x9b5b3b)[_0xca97('0x25')](function(_0x56e3e7){return _0x56e3e7;});}return null;};}function removeEntity(_0xb91710,_0x4e68f5){return function(_0x145aa3){if(_0x145aa3){return _0x145aa3[_0xca97('0x26')]()[_0xca97('0x25')](function(){_0xb91710['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e67d9,_0x31f589){return function(_0x5d85e4){if(!_0x5d85e4){_0x4e67d9[_0xca97('0x1a')](0x194);}return _0x5d85e4;};}function handleError(_0x5d24a8,_0x54c647){_0x54c647=_0x54c647||0x1f4;return function(_0x51f4d0){logger[_0xca97('0x27')](_0x51f4d0[_0xca97('0x28')]);if(_0x51f4d0[_0xca97('0x29')]){delete _0x51f4d0[_0xca97('0x29')];}_0x5d24a8['status'](_0x54c647)['send'](_0x51f4d0);};}exports[_0xca97('0x2a')]=function(_0x3bba46,_0x534e61){var _0x1ec2a9={},_0x567c10={},_0x1a2973={'count':0x0,'rows':[]};var _0x5e53bc=_[_0xca97('0x2b')](db[_0xca97('0x2c')][_0xca97('0x2d')],function(_0x1c5eec){return{'name':_0x1c5eec[_0xca97('0x2e')],'type':_0x1c5eec[_0xca97('0x2f')][_0xca97('0x30')]};});_0x567c10[_0xca97('0x31')]=_[_0xca97('0x2b')](_0x5e53bc,_0xca97('0x29'));_0x567c10['query']=_[_0xca97('0x32')](_0x3bba46['query']);_0x567c10[_0xca97('0x33')]=_[_0xca97('0x34')](_0x567c10[_0xca97('0x31')],_0x567c10[_0xca97('0x35')]);_0x567c10[_0xca97('0x33')]=_[_0xca97('0x36')](_0x567c10[_0xca97('0x33')],[_0xca97('0x37'),_0xca97('0x38'),'$gt',_0xca97('0x39'),_0xca97('0x3a'),_0xca97('0x3b'),_0xca97('0x3c'),_0xca97('0x3d'),'$not',_0xca97('0x3e'),'$notBetween','$in',_0xca97('0x3f'),_0xca97('0x40'),'$notLike',_0xca97('0x41'),_0xca97('0x42'),_0xca97('0x40'),_0xca97('0x43'),'$contains',_0xca97('0x44'),'$any']);_0x1ec2a9[_0xca97('0x45')]=_[_0xca97('0x34')](_0x567c10[_0xca97('0x31')],qs[_0xca97('0x46')](_0x3bba46[_0xca97('0x35')]['fields']));_0x1ec2a9['attributes']=_0x1ec2a9[_0xca97('0x45')][_0xca97('0x47')]?_0x1ec2a9[_0xca97('0x45')]:_0x567c10['model'];if(!_0x3bba46['query'][_0xca97('0x48')](_0xca97('0x49'))){_0x1ec2a9['limit']=qs[_0xca97('0x20')](_0x3bba46[_0xca97('0x35')]['limit']);_0x1ec2a9[_0xca97('0x1e')]=qs['offset'](_0x3bba46[_0xca97('0x35')][_0xca97('0x1e')]);}_0x1ec2a9[_0xca97('0x4a')]=qs['sort'](_0x3bba46[_0xca97('0x35')][_0xca97('0x4b')]);_0x1ec2a9[_0xca97('0x4c')]=qs['filters'](_['pick'](_0x3bba46[_0xca97('0x35')],_0x567c10[_0xca97('0x33')]),_0x5e53bc);if(_0x3bba46[_0xca97('0x35')][_0xca97('0x4d')]){_0x1ec2a9['where']=_[_0xca97('0x4e')](_0x1ec2a9[_0xca97('0x4c')],{'$or':_[_0xca97('0x2b')](_0x5e53bc,function(_0x56bec2){if(_0x56bec2[_0xca97('0x2f')]!=='VIRTUAL'){var _0x317a26={};_0x317a26[_0x56bec2[_0xca97('0x29')]]={'$like':'%'+_0x3bba46[_0xca97('0x35')][_0xca97('0x4d')]+'%'};return _0x317a26;}})});}_0x1ec2a9=_[_0xca97('0x4e')]({},_0x1ec2a9,_0x3bba46[_0xca97('0x4f')]);var _0x93ad8={'where':_0x1ec2a9[_0xca97('0x4c')]};return db[_0xca97('0x2c')][_0xca97('0x21')](_0x93ad8)[_0xca97('0x25')](function(_0x39e5b2){_0x1a2973[_0xca97('0x21')]=_0x39e5b2;if(_0x3bba46[_0xca97('0x35')][_0xca97('0x50')]){_0x1ec2a9[_0xca97('0x51')]=[{'all':!![]}];}return db[_0xca97('0x2c')]['findAll'](_0x1ec2a9);})[_0xca97('0x25')](function(_0x3f8b4c){_0x1a2973[_0xca97('0x52')]=_0x3f8b4c;return _0x1a2973;})[_0xca97('0x25')](respondWithFilteredResult(_0x534e61,_0x1ec2a9))['catch'](handleError(_0x534e61,null));};exports[_0xca97('0x53')]=function(_0x1ee848,_0x994766){var _0x43bbe7={'raw':!![],'where':{'id':_0x1ee848['params']['id']}},_0xdc5c7d={};_0xdc5c7d[_0xca97('0x31')]=_[_0xca97('0x32')](db[_0xca97('0x2c')][_0xca97('0x2d')]);_0xdc5c7d['query']=_[_0xca97('0x32')](_0x1ee848[_0xca97('0x35')]);_0xdc5c7d['filters']=_['intersection'](_0xdc5c7d[_0xca97('0x31')],_0xdc5c7d[_0xca97('0x35')]);_0x43bbe7['attributes']=_[_0xca97('0x34')](_0xdc5c7d[_0xca97('0x31')],qs['fields'](_0x1ee848[_0xca97('0x35')]['fields']));_0x43bbe7[_0xca97('0x45')]=_0x43bbe7['attributes']['length']?_0x43bbe7['attributes']:_0xdc5c7d['model'];if(_0x1ee848[_0xca97('0x35')]['includeAll']){_0x43bbe7['include']=[{'all':!![]}];}_0x43bbe7=_['merge']({},_0x43bbe7,_0x1ee848[_0xca97('0x4f')]);return db['CmHopper']['find'](_0x43bbe7)[_0xca97('0x25')](handleEntityNotFound(_0x994766,null))[_0xca97('0x25')](respondWithResult(_0x994766,null))[_0xca97('0x54')](handleError(_0x994766,null));};exports[_0xca97('0x55')]=function(_0x46c2ba,_0x2771e5){return db[_0xca97('0x2c')]['create'](_0x46c2ba['body'],{})[_0xca97('0x25')](respondWithResult(_0x2771e5,0xc9))[_0xca97('0x54')](handleError(_0x2771e5,null));};exports[_0xca97('0x24')]=function(_0x2584e3,_0x27eddc){if(_0x2584e3[_0xca97('0x56')]['id']){delete _0x2584e3['body']['id'];}return db[_0xca97('0x2c')][_0xca97('0x57')]({'where':{'id':_0x2584e3[_0xca97('0x58')]['id']}})[_0xca97('0x25')](handleEntityNotFound(_0x27eddc,null))['then'](saveUpdates(_0x2584e3[_0xca97('0x56')],null))[_0xca97('0x25')](respondWithResult(_0x27eddc,null))[_0xca97('0x54')](handleError(_0x27eddc,null));};exports[_0xca97('0x59')]=function(_0xb27a4e,_0xff7fe4){return db[_0xca97('0x2c')][_0xca97('0x59')]()[_0xca97('0x25')](respondWithResult(_0xff7fe4,null))[_0xca97('0x54')](handleError(_0xff7fe4,null));};exports['destroy']=function(_0x2bc266,_0x26edb4){var _0x8e2279;var _0x5b03df=_0x2bc266['params']['id'];return db[_0xca97('0x2c')][_0xca97('0x57')]({'where':{'id':_0x2bc266['params']['id']}})[_0xca97('0x25')](handleEntityNotFound(_0x26edb4,null))[_0xca97('0x25')](function(_0x3db3dc){if(_0x3db3dc){return _0x3db3dc[_0xca97('0x26')]()[_0xca97('0x25')](function(_0x1f3a88){return _0x1f3a88;});}})[_0xca97('0x25')](function(_0x4a3fa9){_0x8e2279=_0x4a3fa9;if(_0x4a3fa9){if(_0x4a3fa9[_0xca97('0x5a')]||_0x4a3fa9[_0xca97('0x5b')]){return db[_0x4a3fa9['VoiceQueueId']?_0xca97('0x5c'):_0xca97('0x5d')][_0xca97('0x57')]({'where':{'id':_0x4a3fa9['VoiceQueueId']?_0x4a3fa9[_0xca97('0x5a')]:_0x4a3fa9['CampaignId']},'attributes':['id',_0xca97('0x29')],'raw':!![]});}}})[_0xca97('0x25')](function(_0x1ca7db){var _0x359fb8={};if(_0x1ca7db){_['merge'](_0x359fb8,_['omit'](_0x8e2279[_0xca97('0x5e')],[_0xca97('0x5f'),'updatedAt','id']));_0x359fb8['state']=0x15;_0x359fb8[_0xca97('0x60')]=_0xca97('0x61');_0x359fb8[_0xca97('0x62')]=_0x1ca7db[_0xca97('0x29')];_0x359fb8[_0xca97('0x63')]=_0x2bc266[_0xca97('0x64')][_0xca97('0x29')];_0x359fb8[_0xca97('0x65')]=_0x2bc266[_0xca97('0x64')]['id'];_0x359fb8['deleted']=!![];_0x359fb8[_0xca97('0x66')]=moment()[_0xca97('0x67')](_0xca97('0x68'));_0x359fb8[_0xca97('0x69')]=_0x8e2279['phone'];_0x359fb8[_0xca97('0x6a')]=_0x8e2279['VoiceQueueId']?'queue':_0xca97('0x6b');return db[_0xca97('0x6c')]['find']({'where':{'id':_0x359fb8[_0xca97('0x6d')]},'attributes':[_0xca97('0x6e'),_0xca97('0x6f')]})['then'](function(_0x344f07){if(!_[_0xca97('0x70')](_0x26edb4)&&!_[_0xca97('0x70')](_0x344f07[_0xca97('0x6e')])){_0x359fb8[_0xca97('0x71')]=_0x344f07[_0xca97('0x6e')];if(!_[_0xca97('0x70')](_0x344f07['lastName'])){_0x359fb8[_0xca97('0x71')]+='\x20'+_0x344f07[_0xca97('0x6f')];}}})[_0xca97('0x72')](function(){return db['CmHopperFinal'][_0xca97('0x55')](_0x359fb8);});}})[_0xca97('0x25')](function(_0x19696f){return db[_0xca97('0x73')][_0xca97('0x26')]({'where':{'CmHopperId':_0x5b03df}});})[_0xca97('0x25')](function(){return _0x26edb4[_0xca97('0x1b')](0xcc)[_0xca97('0x1c')]();})[_0xca97('0x54')](handleError(_0x26edb4,null));};exports[_0xca97('0x74')]=function(_0x31604b,_0x113012,_0x5266fc){var _0x391c1a=[];return db[_0xca97('0x6c')][_0xca97('0x59')]()[_0xca97('0x25')](function(_0x3cb4c5){_0x391c1a=_[_0xca97('0x32')](_0x3cb4c5);return _0x31604b[_0xca97('0x64')][_0xca97('0x75')]({'where':{'type':_0xca97('0x76'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xca97('0x77'),_0xca97('0x78')],'raw':!![]});})[_0xca97('0x25')](function(_0x371081){if(_0x371081&&_0x371081[_0xca97('0x47')]){return db[_0xca97('0x79')]['transaction'](function(_0x5444cd){var _0x39bc65={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xca97('0x67')](_0xca97('0x68'))},'VoiceQueueId':{'$in':_[_0xca97('0x2b')](_0x371081,'id')},'$or':[{'UserId':null},{'UserId':_0x31604b[_0xca97('0x64')]['id']}]};var _0x1b7ef3={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x371081)[_0xca97('0x4d')]([_0xca97('0x78'),0x0])[_0xca97('0x2b')]('id')[_0xca97('0x7a')]()},'$or':[{'UserId':null},{'UserId':_0x31604b[_0xca97('0x64')]['id']}]};var _0x38ec1f={'$or':[_0x39bc65,_0x1b7ef3]};var _0x5dda0a=[];if(_0x31604b[_0xca97('0x56')][_0xca97('0x7b')]&&_0x31604b[_0xca97('0x56')][_0xca97('0x7b')]===_0xca97('0x7c')){if(!_[_0xca97('0x7d')](_0x31604b[_0xca97('0x56')][_0xca97('0x7e')])){_0x38ec1f['id']={'$in':_0x31604b['body'][_0xca97('0x7e')]};}_0x5dda0a=[[_0xca97('0x7f'),_0xca97('0x80')],[_0xca97('0x81'),_0x371081[0x0][_0xca97('0x77')]==='ASC'?_0xca97('0x82'):_0xca97('0x80')],db[_0xca97('0x79')][_0xca97('0x83')](_0xca97('0x84')),['id',_0xca97('0x82')]];}else{if(!_['isEmpty'](_0x31604b[_0xca97('0x56')]['hopperIds'])){_0x38ec1f['id']={'$notIn':_0x31604b[_0xca97('0x56')][_0xca97('0x7e')]};}_0x5dda0a=[['priority',_0xca97('0x82')],['scheduledAt',_0x371081[0x0][_0xca97('0x77')]],db[_0xca97('0x79')][_0xca97('0x83')](_0xca97('0x85')),['id',_0xca97('0x80')]];}return db['CmHopper'][_0xca97('0x86')]({'attributes':['id',_0xca97('0x87'),_0xca97('0x88'),_0xca97('0x89')],'where':_0x38ec1f,'order':_0x5dda0a,'transaction':_0x5444cd,'lock':_0x5444cd[_0xca97('0x8a')][_0xca97('0x8b')],'include':[{'model':db[_0xca97('0x6c')],'as':_0xca97('0x8c'),'attributes':_0x391c1a,'include':[{'model':db['CmCompany'],'as':_0xca97('0x8d'),'attributes':['id',_0xca97('0x29')]}]},{'model':db[_0xca97('0x8e')],'as':_0xca97('0x8f'),'attributes':['id',_0xca97('0x29')]},{'model':db[_0xca97('0x5c')],'as':_0xca97('0x90'),'attributes':['id',_0xca97('0x29'),_0xca97('0x91')]}]})[_0xca97('0x25')](function(_0x2cfa1e){if(_0x2cfa1e){return _0x2cfa1e[_0xca97('0x24')]({'UserId':_0x31604b[_0xca97('0x64')]['id']},{'transaction':_0x5444cd});}});});}})[_0xca97('0x25')](handleEntityNotFound(_0x113012,null))['then'](respondWithResult(_0x113012,null))[_0xca97('0x54')](handleError(_0x113012,null));};exports['getPreviewRecall']=function(_0x3975eb,_0x58a70d,_0x38833f){var _0x4c253e=[];return db['CmContact'][_0xca97('0x59')]()['then'](function(_0xb8ca0f){_0x4c253e=_[_0xca97('0x32')](_0xb8ca0f);return _0x3975eb[_0xca97('0x64')][_0xca97('0x75')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xca97('0x77'),_0xca97('0x78')],'raw':!![]});})[_0xca97('0x25')](function(_0xa67e40){if(_0xa67e40&&_0xa67e40['length']){return db['sequelize'][_0xca97('0x92')](function(_0x4f2f22){var _0x37e4e3={'active':![],'recallme':!![],'id':_0x3975eb['body']['hopperId']};return db[_0xca97('0x2c')]['findOne']({'attributes':['id',_0xca97('0x87'),_0xca97('0x89')],'where':_0x37e4e3,'transaction':_0x4f2f22,'lock':_0x4f2f22[_0xca97('0x8a')]['UPDATE'],'include':[{'model':db[_0xca97('0x6c')],'as':_0xca97('0x8c'),'attributes':_0x4c253e,'include':[{'model':db[_0xca97('0x93')],'as':_0xca97('0x8d'),'attributes':['id',_0xca97('0x29')]}]},{'model':db[_0xca97('0x8e')],'as':_0xca97('0x8f'),'attributes':['id','name']},{'model':db[_0xca97('0x5c')],'as':'Queue','attributes':['id','name',_0xca97('0x91')]}]})[_0xca97('0x25')](function(_0x1db071){if(_0x1db071){return _0x1db071['update']({'UserId':_0x3975eb[_0xca97('0x64')]['id']},{'transaction':_0x4f2f22});}});});}})[_0xca97('0x25')](handleEntityNotFound(_0x58a70d,null))[_0xca97('0x25')](respondWithResult(_0x58a70d,null))[_0xca97('0x54')](handleError(_0x58a70d,null));};exports['getOpenContacts']=function(_0x393589,_0xb02277,_0x34ec7e){return _0x393589[_0xca97('0x64')]['getVoiceQueues']({'where':{'type':_0xca97('0x76'),'dialActive':!![],'dialMethod':_0xca97('0x94')},'attributes':['id'],'raw':!![]})[_0xca97('0x25')](function(_0x2ba69d){if(_0x2ba69d&&_0x2ba69d['length']){return db[_0xca97('0x2c')][_0xca97('0x21')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xca97('0x67')](_0xca97('0x68'))},'VoiceQueueId':{'$in':_['map'](_0x2ba69d,'id')},'$or':[{'UserId':null},{'UserId':_0x393589[_0xca97('0x64')]['id']}]}});}return 0x0;})['then'](function(_0x2833ba){if(!_['isNil'](_0x2833ba)&&_[_0xca97('0x95')](_0x2833ba)){return _0xb02277[_0xca97('0x1b')](0xc8)['json']({'contacts':_0x2833ba});}else{logger['error'](_0xca97('0x96'),_0xca97('0x97'),0x194,_0xca97('0x98'));_0xb02277[_0xca97('0x1a')](0x194);}})[_0xca97('0x54')](handleError(_0xb02277,null));};exports['getTimezones']=function(_0x1e66ba,_0x49bd12,_0x438c17){var _0x3443f3=shared[_0xca97('0x99')];var _0x39ac4c=[];_['map'](_0x3443f3,function(_0x54a33e){_0x39ac4c['push']({'id':_0x54a33e[_0xca97('0x29')],'name':_0x54a33e[_0xca97('0x29')],'utcOffset':_0x54a33e[_0xca97('0x9a')]});});return _0x49bd12['status'](0xc8)[_0xca97('0x1d')]({'tz':_0x39ac4c});};exports[_0xca97('0x9b')]=function(_0x5716c3,_0x302110,_0x2fa798){var _0x33d6ed=shared[_0xca97('0x99')];var _0x75436c={};if(!_[_0xca97('0x70')](_0x33d6ed[_0x5716c3['body']['id']]))_0x75436c=_0x33d6ed[_0x5716c3[_0xca97('0x56')]['id']];return _0x302110['status'](0xc8)[_0xca97('0x1d')](_0x75436c);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index fb24e2f..70c2240 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 _0x71ab=['rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x71ab,0x64));var _0xb71a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x71ab[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xc')]},{'name':_0xb71a('0xd'),'fields':[_0xb71a('0xd')]},{'name':_0xb71a('0xe'),'fields':[_0xb71a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2fe=['CmHopper','scheduledat','phone','priority','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1a0011,_0x32b202){var _0x49bfb2=function(_0x2ecc23){while(--_0x2ecc23){_0x1a0011['push'](_0x1a0011['shift']());}};_0x49bfb2(++_0x32b202);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./cmHopper.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('0x9'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xee2f('0xa'),'fields':['scheduledat']},{'name':_0xee2f('0xb'),'fields':[_0xee2f('0xb')]},{'name':'priority','fields':[_0xee2f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 3bae2be..da9f05a 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 _0x2354=['CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UPDATE','GetCmHopperPreview','Contact','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','Agent','name','CmList','\x20MINUTE','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','twilio/lib/webhooks/webhooks','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetCmHopper','findAll','options','raw','where','attributes','include','model','map','then','catch','ShowCmHopper','CmHopper','find','debug','CreateCmHopper','create','body','UpdateCmHopper','update','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','LOCK','keys','User','length','UserId','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','CmHopperFinal'];(function(_0x4274b9,_0x1617e0){var _0x1b90e4=function(_0x2a4019){while(--_0x2a4019){_0x4274b9['push'](_0x4274b9['shift']());}};_0x1b90e4(++_0x1617e0);}(_0x2354,0xd5));var _0x4235=function(_0x444d3a,_0xdf118){_0x444d3a=_0x444d3a-0x0;var _0x35a0bf=_0x2354[_0x444d3a];return _0x35a0bf;};'use strict';var _=require(_0x4235('0x0'));var util=require(_0x4235('0x1'));var moment=require(_0x4235('0x2'));var BPromise=require(_0x4235('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4235('0x4'));var db=require(_0x4235('0x5'))['db'];var utils=require(_0x4235('0x6'));var logger=require(_0x4235('0x7'))(_0x4235('0x8'));var config=require(_0x4235('0x9'));var jayson=require(_0x4235('0xa'));const {validateExpressRequest}=require(_0x4235('0xb'));var client=jayson[_0x4235('0xc')][_0x4235('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x46973b,_0x21ef03,_0x2157dd){return new BPromise(function(_0x5c32c8,_0x38d803){return client[_0x4235('0xe')](_0x46973b,_0x2157dd)['then'](function(_0x4ee5b5){logger[_0x4235('0xf')](_0x4235('0x10'),_0x21ef03,_0x4235('0x11'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x21ef03,_0x4235('0x11'),JSON[_0x4235('0x12')](_0x4ee5b5));if(_0x4ee5b5[_0x4235('0x13')]){if(_0x4ee5b5['error'][_0x4235('0x14')]===0x1f4){logger[_0x4235('0x13')](_0x4235('0x10'),_0x21ef03,_0x4ee5b5[_0x4235('0x13')]['message']);return _0x38d803(_0x4ee5b5[_0x4235('0x13')][_0x4235('0x15')]);}logger[_0x4235('0x13')](_0x4235('0x10'),_0x21ef03,_0x4ee5b5[_0x4235('0x13')][_0x4235('0x15')]);return _0x5c32c8(_0x4ee5b5[_0x4235('0x13')][_0x4235('0x15')]);}else{logger['info'](_0x4235('0x10'),_0x21ef03,_0x4235('0x11'));_0x5c32c8(_0x4ee5b5[_0x4235('0x16')][_0x4235('0x15')]);}})['catch'](function(_0x24ee42){logger[_0x4235('0x13')](_0x4235('0x10'),_0x21ef03,_0x24ee42);_0x38d803(_0x24ee42);});});}exports[_0x4235('0x17')]=function(_0x11570d){var _0x2ac4f1=this;return new Promise(function(_0x220481,_0x167fd3){return db['CmHopper'][_0x4235('0x18')]({'raw':_0x11570d['options']?_0x11570d[_0x4235('0x19')][_0x4235('0x1a')]===undefined?!![]:![]:!![],'where':_0x11570d['options']?_0x11570d[_0x4235('0x19')][_0x4235('0x1b')]||null:null,'attributes':_0x11570d[_0x4235('0x19')]?_0x11570d[_0x4235('0x19')][_0x4235('0x1c')]||null:null,'limit':_0x11570d['options']?_0x11570d['options']['limit']||null:null,'include':_0x11570d['options']?_0x11570d[_0x4235('0x19')][_0x4235('0x1d')]?_['map'](_0x11570d['options'][_0x4235('0x1d')],function(_0x5250b3){return{'model':db[_0x5250b3[_0x4235('0x1e')]],'as':_0x5250b3['as'],'attributes':_0x5250b3[_0x4235('0x1c')],'include':_0x5250b3[_0x4235('0x1d')]?_['map'](_0x5250b3[_0x4235('0x1d')],function(_0x2c49a1){return{'model':db[_0x2c49a1[_0x4235('0x1e')]],'as':_0x2c49a1['as'],'attributes':_0x2c49a1[_0x4235('0x1c')],'include':_0x2c49a1['include']?_[_0x4235('0x1f')](_0x2c49a1['include'],function(_0x214f4e){return{'model':db[_0x214f4e[_0x4235('0x1e')]],'as':_0x214f4e['as'],'attributes':_0x214f4e['attributes']};}):[]};}):[]};}):[]:[]})[_0x4235('0x20')](function(_0x4dab88){logger[_0x4235('0xf')](_0x4235('0x17'),_0x11570d);logger['debug'](_0x4235('0x17'),_0x11570d,JSON[_0x4235('0x12')](_0x4dab88));_0x220481(_0x4dab88);})[_0x4235('0x21')](function(_0x548c49){logger['error'](_0x4235('0x17'),_0x548c49[_0x4235('0x15')],_0x11570d);_0x167fd3(_0x2ac4f1[_0x4235('0x13')](0x1f4,_0x548c49[_0x4235('0x15')]));});});};exports[_0x4235('0x22')]=function(_0x3632a7){var _0xa88fb6=this;return new Promise(function(_0x3f5293,_0x515e6e){return db[_0x4235('0x23')][_0x4235('0x24')]({'raw':_0x3632a7['options']?_0x3632a7[_0x4235('0x19')][_0x4235('0x1a')]===undefined?!![]:![]:!![],'where':_0x3632a7['options']?_0x3632a7[_0x4235('0x19')][_0x4235('0x1b')]||null:null,'attributes':_0x3632a7[_0x4235('0x19')]?_0x3632a7[_0x4235('0x19')][_0x4235('0x1c')]||null:null,'include':_0x3632a7[_0x4235('0x19')]?_0x3632a7[_0x4235('0x19')][_0x4235('0x1d')]?_['map'](_0x3632a7[_0x4235('0x19')]['include'],function(_0x5db96a){return{'model':db[_0x5db96a[_0x4235('0x1e')]],'as':_0x5db96a['as'],'attributes':_0x5db96a['attributes'],'include':_0x5db96a[_0x4235('0x1d')]?_[_0x4235('0x1f')](_0x5db96a[_0x4235('0x1d')],function(_0x2261ec){return{'model':db[_0x2261ec['model']],'as':_0x2261ec['as'],'attributes':_0x2261ec[_0x4235('0x1c')],'include':_0x2261ec[_0x4235('0x1d')]?_[_0x4235('0x1f')](_0x2261ec[_0x4235('0x1d')],function(_0x6ddb71){return{'model':db[_0x6ddb71['model']],'as':_0x6ddb71['as'],'attributes':_0x6ddb71['attributes']};}):[]};}):[]};}):[]:[]})[_0x4235('0x20')](function(_0x38d0dd){logger[_0x4235('0xf')](_0x4235('0x22'),_0x3632a7);logger[_0x4235('0x25')](_0x4235('0x22'),_0x3632a7,JSON['stringify'](_0x38d0dd));_0x3f5293(_0x38d0dd);})[_0x4235('0x21')](function(_0x129c5f){logger[_0x4235('0x13')]('ShowCmHopper',_0x129c5f[_0x4235('0x15')],_0x3632a7);_0x515e6e(_0xa88fb6[_0x4235('0x13')](0x1f4,_0x129c5f[_0x4235('0x15')]));});});};exports[_0x4235('0x26')]=function(_0x395f9a){var _0x4c0613=this;return new Promise(function(_0x16d6bd,_0x43ea82){return db[_0x4235('0x23')][_0x4235('0x27')](_0x395f9a[_0x4235('0x28')],{'raw':_0x395f9a[_0x4235('0x19')]?_0x395f9a[_0x4235('0x19')][_0x4235('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x49245b){logger[_0x4235('0xf')](_0x4235('0x26'),_0x395f9a);logger[_0x4235('0x25')](_0x4235('0x26'),_0x395f9a,JSON[_0x4235('0x12')](_0x49245b));_0x16d6bd(_0x49245b);})['catch'](function(_0x3b2b83){logger['error'](_0x4235('0x26'),_0x3b2b83[_0x4235('0x15')],_0x395f9a);_0x43ea82(_0x4c0613[_0x4235('0x13')](0x1f4,_0x3b2b83[_0x4235('0x15')]));});});};exports[_0x4235('0x29')]=function(_0x8ffbf8){var _0x175726=this;return new Promise(function(_0x46f924,_0x11fe30){return db[_0x4235('0x23')][_0x4235('0x2a')](_0x8ffbf8['body'],{'raw':_0x8ffbf8[_0x4235('0x19')]?_0x8ffbf8['options'][_0x4235('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8ffbf8[_0x4235('0x19')]?_0x8ffbf8[_0x4235('0x19')][_0x4235('0x1b')]||null:null,'attributes':_0x8ffbf8[_0x4235('0x19')]?_0x8ffbf8[_0x4235('0x19')]['attributes']||null:null,'limit':_0x8ffbf8[_0x4235('0x19')]?_0x8ffbf8[_0x4235('0x19')][_0x4235('0x2b')]||null:null})['then'](function(_0x25faea){logger[_0x4235('0xf')](_0x4235('0x29'),_0x8ffbf8);logger[_0x4235('0xf')](_0x4235('0x2c'),JSON[_0x4235('0x12')](_0x8ffbf8[_0x4235('0x19')][_0x4235('0x1b')]),_0x8ffbf8[_0x4235('0x28')]['active']);logger[_0x4235('0x25')](_0x4235('0x29'),_0x8ffbf8,JSON[_0x4235('0x12')](_0x25faea));_0x46f924(_0x25faea);})[_0x4235('0x21')](function(_0x246dc8){logger[_0x4235('0x13')](_0x4235('0x29'),_0x246dc8[_0x4235('0x15')],_0x8ffbf8);_0x11fe30(_0x175726[_0x4235('0x13')](0x1f4,_0x246dc8[_0x4235('0x15')]));});});};exports['DestroyCmHopper']=function(_0x747830){var _0x7dd78c=this;return new Promise(function(_0x4b0237,_0x5d21bc){return db[_0x4235('0x23')][_0x4235('0x2d')]({'where':_0x747830[_0x4235('0x19')]?_0x747830['options']['where']||null:null})[_0x4235('0x20')](function(_0x1fb781){logger[_0x4235('0xf')](_0x4235('0x2e'),_0x747830);logger[_0x4235('0x25')](_0x4235('0x2e'),_0x747830,JSON[_0x4235('0x12')](_0x1fb781));_0x4b0237(_0x1fb781);})[_0x4235('0x21')](function(_0x7d2fc4){logger[_0x4235('0x13')](_0x4235('0x2e'),_0x7d2fc4['message'],_0x747830);_0x5d21bc(_0x7dd78c[_0x4235('0x13')](0x1f4,_0x7d2fc4[_0x4235('0x15')]));});});};exports[_0x4235('0x2f')]=function(_0x3a6e60){var _0x36777e=this;return new Promise(function(_0x126dd2,_0x5048c2){return db[_0x4235('0x30')][_0x4235('0x31')]()[_0x4235('0x20')](function(_0x311b37){return db[_0x4235('0x32')][_0x4235('0x33')](function(_0x401d72){return db['CmHopper'][_0x4235('0x18')]({'where':_0x3a6e60[_0x4235('0x19')]?_0x3a6e60[_0x4235('0x19')][_0x4235('0x1b')]||null:null,'attributes':_0x3a6e60[_0x4235('0x19')]?_0x3a6e60['options']['attributes']||null:null,'limit':_0x3a6e60[_0x4235('0x19')]?_0x3a6e60[_0x4235('0x19')][_0x4235('0x2b')]||null:null,'order':_0x3a6e60[_0x4235('0x19')]?_0x3a6e60[_0x4235('0x19')]['order']||null:null,'transaction':_0x401d72,'lock':_0x401d72[_0x4235('0x34')]['UPDATE'],'include':[{'model':db[_0x4235('0x30')],'as':'Contact','attributes':_[_0x4235('0x35')](_0x311b37)},{'model':db[_0x4235('0x36')],'as':'Agent','attributes':['id','name','voicePause']}]})[_0x4235('0x20')](function(_0x549744){var _0x1d3d02=[];var _0x542a5a=[];for(var _0x3dd2b1=0x0;_0x3dd2b1<_0x549744[_0x4235('0x37')];_0x3dd2b1+=0x1){var _0x475650=_0x549744[_0x3dd2b1][_0x4235('0x38')];if(_0x475650===null){_0x1d3d02['push'](_0x549744[_0x3dd2b1][_0x4235('0x2a')](_0x3a6e60['body'],{'transaction':_0x401d72}));}else if(!_0x542a5a[_0x4235('0x39')](_0x475650)){_0x542a5a[_0x4235('0x3a')](_0x475650);_0x1d3d02[_0x4235('0x3a')](_0x549744[_0x3dd2b1][_0x4235('0x2a')](_0x3a6e60[_0x4235('0x28')],{'transaction':_0x401d72}));}}return BPromise[_0x4235('0x3b')](_0x1d3d02);});})[_0x4235('0x20')](function(_0x3b4f49){logger['info'](_0x4235('0x2f'),_0x3a6e60);if(_0x3b4f49[_0x4235('0x37')]>0x0){logger['info'](_0x4235('0x3c'),_0x3b4f49[0x0]['dataValues']['id'],_0x3b4f49[0x0][_0x4235('0x3d')][_0x4235('0x3e')],_0x3b4f49[0x0][_0x4235('0x3d')][_0x4235('0x3f')]);}logger['debug'](_0x4235('0x2f'),_0x3a6e60,JSON[_0x4235('0x12')](_0x3b4f49));_0x126dd2(_0x3b4f49);})[_0x4235('0x21')](function(_0x56c700){logger[_0x4235('0x13')](_0x4235('0x2f'),_0x56c700[_0x4235('0x15')],_0x3a6e60);_0x5048c2(_0x36777e[_0x4235('0x13')](0x1f4,_0x56c700[_0x4235('0x15')]));});});});};exports[_0x4235('0x40')]=function(_0x43a803){var _0x7fb10d=this;return new Promise(function(_0x43742a,_0x3d6661){return db[_0x4235('0x32')][_0x4235('0x33')](function(_0x53455b){return db[_0x4235('0x41')][_0x4235('0x27')](_0x43a803[_0x4235('0x28')],{'raw':_0x43a803[_0x4235('0x19')]?_0x43a803['options'][_0x4235('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x53455b})[_0x4235('0x20')](function(){logger[_0x4235('0xf')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x4235('0x12')](_0x43a803[_0x4235('0x19')][_0x4235('0x1b')]),_0x43a803[_0x4235('0x19')]['where']['active']);return db['CmHopper'][_0x4235('0x2d')]({'where':_0x43a803[_0x4235('0x19')]?_0x43a803[_0x4235('0x19')][_0x4235('0x1b')]||null:null,'transaction':_0x53455b});});})['then'](function(_0x1c8de8){logger['info'](_0x4235('0x40'),_0x43a803);logger[_0x4235('0x25')]('MoveContactManagedDialer',_0x43a803,JSON[_0x4235('0x12')](_0x1c8de8));_0x43742a(_0x1c8de8);})[_0x4235('0x21')](function(_0x186004){logger[_0x4235('0x13')]('MoveContactManagedDialer',_0x186004[_0x4235('0x15')],_0x43a803);_0x3d6661(_0x7fb10d[_0x4235('0x13')](0x1f4,_0x186004[_0x4235('0x15')]));});});};exports[_0x4235('0x42')]=function(_0xa9ee2e){var _0x2075d1=this;return new Promise(function(_0x2fe108,_0x11203b){return db['CmHopper'][_0x4235('0x18')]({'raw':_0xa9ee2e[_0x4235('0x19')]?_0xa9ee2e['options']['raw']===undefined?!![]:![]:!![],'where':_0xa9ee2e[_0x4235('0x19')]?_0xa9ee2e[_0x4235('0x19')][_0x4235('0x1b')]||null:null,'attributes':[[db[_0x4235('0x32')]['fn'](_0x4235('0x43'),db[_0x4235('0x32')]['fn']('IF',db['sequelize'][_0x4235('0x44')](_0x4235('0x45')+util[_0x4235('0x46')](_0x4235('0x47'),moment()[_0x4235('0x46')](_0x4235('0x48')))+_0x4235('0x49')))),_0x4235('0x4a')]]})[_0x4235('0x20')](function(_0x1ec4c8){logger[_0x4235('0xf')]('CountReScheduled',_0xa9ee2e);logger[_0x4235('0x25')](_0x4235('0x42'),_0xa9ee2e,JSON[_0x4235('0x12')](_0x1ec4c8));_0x2fe108(_0x1ec4c8);})[_0x4235('0x21')](function(_0xdc92d1){logger['error'](_0x4235('0x42'),_0xdc92d1[_0x4235('0x15')],_0xa9ee2e);_0x11203b(_0x2075d1['error'](0x1f4,_0xdc92d1[_0x4235('0x15')]));});});};exports[_0x4235('0x4b')]=function(_0x365ff5){var _0xeb56e=this;return new Promise(function(_0x2acbd1,_0x2a373b){return db['CmContact']['describe']()[_0x4235('0x20')](function(_0x413160){return db['sequelize'][_0x4235('0x33')](function(_0x368469){return db[_0x4235('0x23')][_0x4235('0x18')]({'where':_0x365ff5[_0x4235('0x19')]?_0x365ff5[_0x4235('0x19')][_0x4235('0x1b')]||null:null,'attributes':_0x365ff5[_0x4235('0x19')]?_0x365ff5[_0x4235('0x19')][_0x4235('0x1c')]||null:null,'limit':0x1,'order':_0x365ff5[_0x4235('0x19')]?_0x365ff5['options'][_0x4235('0x4c')]||null:null,'group':db['CmHopper'][_0x4235('0x38')],'transaction':_0x368469,'lock':_0x368469['LOCK'][_0x4235('0x4d')],'include':_0x365ff5[_0x4235('0x19')]?_0x365ff5[_0x4235('0x19')][_0x4235('0x1d')]?_['map'](_0x365ff5[_0x4235('0x19')][_0x4235('0x1d')],function(_0x2ddb13){return{'model':db[_0x2ddb13[_0x4235('0x1e')]],'as':_0x2ddb13['as'],'attributes':_0x2ddb13[_0x4235('0x1c')],'include':_0x2ddb13[_0x4235('0x1d')]?_[_0x4235('0x1f')](_0x2ddb13[_0x4235('0x1d')],function(_0x501e95){return{'model':db[_0x501e95['model']],'as':_0x501e95['as'],'attributes':_0x501e95[_0x4235('0x1c')],'include':_0x501e95[_0x4235('0x1d')]?_[_0x4235('0x1f')](_0x501e95[_0x4235('0x1d')],function(_0x274a37){return{'model':db[_0x274a37[_0x4235('0x1e')]],'as':_0x274a37['as'],'attributes':_0x274a37['attributes']};}):[]};}):[]};}):[]:[]})[_0x4235('0x20')](function(_0x295466){var _0x171517=[];for(var _0x53394e=0x0;_0x53394e<_0x295466['length'];_0x53394e+=0x1){_0x171517[_0x4235('0x3a')](_0x295466[_0x53394e][_0x4235('0x2a')](_0x365ff5[_0x4235('0x28')],{'transaction':_0x368469}));}return BPromise[_0x4235('0x3b')](_0x171517);});})[_0x4235('0x20')](function(_0x5aa7fa){logger[_0x4235('0xf')](_0x4235('0x4b'),_0x365ff5);logger[_0x4235('0x25')](_0x4235('0x4b'),_0x365ff5,JSON[_0x4235('0x12')](_0x5aa7fa));_0x2acbd1(_0x5aa7fa);})[_0x4235('0x21')](function(_0x35b5f9){logger['error'](_0x4235('0x4b'),_0x35b5f9[_0x4235('0x15')],_0x365ff5);_0x2a373b(_0xeb56e[_0x4235('0x13')](0x1f4,_0x35b5f9[_0x4235('0x15')]));});});});};exports[_0x4235('0x4e')]=function(_0x57bc60){var _0x4f7a6d=this;return new Promise(function(_0x466946,_0x396fdf){db['CmContact'][_0x4235('0x31')]()[_0x4235('0x20')](function(_0x213fc1){return db[_0x4235('0x23')][_0x4235('0x18')]({'raw':_0x57bc60[_0x4235('0x19')]?_0x57bc60['options'][_0x4235('0x1a')]===undefined?!![]:![]:!![],'where':_0x57bc60[_0x4235('0x19')]?_0x57bc60[_0x4235('0x19')][_0x4235('0x1b')]||null:null,'attributes':_0x57bc60['options']?_0x57bc60[_0x4235('0x19')][_0x4235('0x1c')]||null:null,'limit':_0x57bc60[_0x4235('0x19')]?_0x57bc60[_0x4235('0x19')]['limit']||null:null,'include':_0x57bc60['options']?_0x57bc60['options'][_0x4235('0x1d')]?_['map'](_0x57bc60['options'][_0x4235('0x1d')],function(_0x8fe3){return{'model':db[_0x8fe3[_0x4235('0x1e')]],'as':_0x8fe3['as'],'attributes':_0x8fe3['as']===_0x4235('0x4f')?_['keys'](_0x213fc1):_0x8fe3[_0x4235('0x1c')],'include':_0x8fe3[_0x4235('0x1d')]?_[_0x4235('0x1f')](_0x8fe3[_0x4235('0x1d')],function(_0x104155){return{'model':db[_0x104155[_0x4235('0x1e')]],'as':_0x104155['as'],'attributes':_0x104155['attributes'],'include':_0x104155['include']?_[_0x4235('0x1f')](_0x104155[_0x4235('0x1d')],function(_0x2544f1){return{'model':db[_0x2544f1['model']],'as':_0x2544f1['as'],'attributes':_0x2544f1[_0x4235('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dd712){logger[_0x4235('0xf')]('GetCmHopper',_0x57bc60);logger[_0x4235('0x25')](_0x4235('0x17'),_0x57bc60,JSON['stringify'](_0x3dd712));_0x466946(_0x3dd712);})[_0x4235('0x21')](function(_0x1e1b04){logger[_0x4235('0x13')](_0x4235('0x17'),_0x1e1b04[_0x4235('0x15')],_0x57bc60);_0x396fdf(_0x4f7a6d[_0x4235('0x13')](0x1f4,_0x1e1b04[_0x4235('0x15')]));});});});};exports[_0x4235('0x50')]=function(_0x14f5ba){var _0x5d11e3=this;return new Promise(function(_0x2a3c44,_0x2de9e2){return db[_0x4235('0x30')][_0x4235('0x51')]({'raw':!![],'where':{'phone':_0x14f5ba[_0x4235('0x19')][_0x4235('0x1b')]['phone']},'attributes':['id',_0x4235('0x52')],'order':[['id',_0x4235('0x53')]]})[_0x4235('0x20')](function(_0x48f115){logger[_0x4235('0xf')](_0x4235('0x54'),_0x14f5ba);logger[_0x4235('0x25')](_0x4235('0x54'),_0x14f5ba,JSON['stringify'](_0x48f115));_0x2a3c44(_0x48f115);})[_0x4235('0x21')](function(_0x2048dc){logger[_0x4235('0x13')](_0x4235('0x54'),_0x2048dc['message'],_0x14f5ba);_0x2de9e2(_0x5d11e3['error'](0x1f4,_0x2048dc[_0x4235('0x15')]));});});};exports[_0x4235('0x55')]=function(_0x4fc09d){var _0x3cb2b6=this;return new Promise(function(_0xf72477,_0x135207){return db['sequelize'][_0x4235('0x33')](function(_0x31854a){return db[_0x4235('0x23')][_0x4235('0x2a')]({'active':![]},{'where':{},'transaction':_0x31854a})[_0x4235('0x20')](function(_0x49fe91){logger[_0x4235('0xf')](_0x4235('0x55'),_0x4fc09d);logger['debug'](_0x4235('0x55'),_0x4fc09d,JSON[_0x4235('0x12')](_0x49fe91));_0xf72477(_0x49fe91);})['catch'](function(_0x271e85){logger[_0x4235('0x13')]('ResetActiveCalls',_0x271e85[_0x4235('0x15')],_0x4fc09d);_0x135207(_0x3cb2b6['error'](0x1f4,_0x271e85['message']));});});});};exports[_0x4235('0x56')]=function(_0x1f5dc2){var _0x4be3ca=this;var _0x95199b=_0x1f5dc2[_0x4235('0x28')][_0x4235('0x1b')][_0x4235('0x57')];var _0x598465=_0x1f5dc2[_0x4235('0x28')]['where'][_0x4235('0x58')];return new Promise(function(_0xf48867,_0x48d6fc){return db[_0x4235('0x23')][_0x4235('0x18')]({'where':{'voiceQueueId':_0x95199b,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db['sequelize'][_0x4235('0x44')]('NOW()\x20+\x20INTERVAL\x20'+_0x598465+'\x20MINUTE')}},'include':[{'model':db[_0x4235('0x30')],'as':_0x4235('0x4f')},{'model':db[_0x4235('0x36')],'as':_0x4235('0x59'),'attributes':['id',_0x4235('0x5a'),'voicePause']},{'model':db[_0x4235('0x5b')],'as':'List'}]})[_0x4235('0x20')](function(_0x3cf2a7){return db[_0x4235('0x32')][_0x4235('0x33')](function(_0x2da0c8){return db['CmHopper'][_0x4235('0x2a')]({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x95199b,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x4235('0x32')][_0x4235('0x44')]('NOW()\x20+\x20INTERVAL\x20'+_0x598465+_0x4235('0x5c'))}},'transaction':_0x2da0c8})[_0x4235('0x20')](function(_0x35dcae){_0xf48867(_0x3cf2a7);})['catch'](function(_0x5c2f6e){logger[_0x4235('0x13')](_0x4235('0x56'),_0x5c2f6e[_0x4235('0x15')],_0x1f5dc2);_0x48d6fc(validateExpressRequest);});});})[_0x4235('0x21')](function(_0x1b89d8){logger[_0x4235('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x1b89d8[_0x4235('0x15')],_0x1f5dc2);_0x48d6fc(_0x4be3ca['error'](0x1f4,_0x1b89d8[_0x4235('0x15')]));});});}; \ No newline at end of file +var _0x8a78=['message','result','catch','GetCmHopper','CmHopper','options','attributes','limit','include','model','map','debug','ShowCmHopper','find','raw','where','stringify','CreateCmHopper','create','body','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','findAll','order','LOCK','UPDATE','Contact','keys','name','length','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','active','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','UserId','GetContactRecallMe','GetCmHopperPreview','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueId','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','Agent','voicePause','CmList','List','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8a78,0x158));var _0x88a7=function(_0xc298ad,_0xea4dc2){_0xc298ad=_0xc298ad-0x0;var _0x11b2e6=_0x8a78[_0xc298ad];return _0x11b2e6;};'use strict';var _=require(_0x88a7('0x0'));var util=require(_0x88a7('0x1'));var moment=require(_0x88a7('0x2'));var BPromise=require(_0x88a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88a7('0x4'));var db=require(_0x88a7('0x5'))['db'];var utils=require(_0x88a7('0x6'));var logger=require(_0x88a7('0x7'))(_0x88a7('0x8'));var config=require('../../config/environment');var jayson=require(_0x88a7('0x9'));const {validateExpressRequest}=require('twilio/lib/webhooks/webhooks');var client=jayson[_0x88a7('0xa')][_0x88a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x118b71,_0x38201b,_0x585571){return new BPromise(function(_0xd25e66,_0x4092d8){return client[_0x88a7('0xc')](_0x118b71,_0x585571)[_0x88a7('0xd')](function(_0x3e67c2){logger[_0x88a7('0xe')](_0x88a7('0xf'),_0x38201b,_0x88a7('0x10'));logger['debug'](_0x88a7('0x11'),_0x38201b,_0x88a7('0x10'),JSON['stringify'](_0x3e67c2));if(_0x3e67c2[_0x88a7('0x12')]){if(_0x3e67c2['error'][_0x88a7('0x13')]===0x1f4){logger[_0x88a7('0x12')](_0x88a7('0xf'),_0x38201b,_0x3e67c2['error'][_0x88a7('0x14')]);return _0x4092d8(_0x3e67c2[_0x88a7('0x12')][_0x88a7('0x14')]);}logger['error'](_0x88a7('0xf'),_0x38201b,_0x3e67c2[_0x88a7('0x12')]['message']);return _0xd25e66(_0x3e67c2[_0x88a7('0x12')]['message']);}else{logger[_0x88a7('0xe')](_0x88a7('0xf'),_0x38201b,_0x88a7('0x10'));_0xd25e66(_0x3e67c2[_0x88a7('0x15')][_0x88a7('0x14')]);}})[_0x88a7('0x16')](function(_0x489c4c){logger['error'](_0x88a7('0xf'),_0x38201b,_0x489c4c);_0x4092d8(_0x489c4c);});});}exports[_0x88a7('0x17')]=function(_0x49a061){var _0x28c99f=this;return new Promise(function(_0x3086fd,_0x37b164){return db[_0x88a7('0x18')]['findAll']({'raw':_0x49a061['options']?_0x49a061[_0x88a7('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x49a061[_0x88a7('0x19')]?_0x49a061[_0x88a7('0x19')]['where']||null:null,'attributes':_0x49a061['options']?_0x49a061['options'][_0x88a7('0x1a')]||null:null,'limit':_0x49a061[_0x88a7('0x19')]?_0x49a061[_0x88a7('0x19')][_0x88a7('0x1b')]||null:null,'include':_0x49a061[_0x88a7('0x19')]?_0x49a061['options']['include']?_['map'](_0x49a061[_0x88a7('0x19')][_0x88a7('0x1c')],function(_0x31f895){return{'model':db[_0x31f895[_0x88a7('0x1d')]],'as':_0x31f895['as'],'attributes':_0x31f895[_0x88a7('0x1a')],'include':_0x31f895[_0x88a7('0x1c')]?_[_0x88a7('0x1e')](_0x31f895[_0x88a7('0x1c')],function(_0x192e95){return{'model':db[_0x192e95['model']],'as':_0x192e95['as'],'attributes':_0x192e95[_0x88a7('0x1a')],'include':_0x192e95[_0x88a7('0x1c')]?_[_0x88a7('0x1e')](_0x192e95[_0x88a7('0x1c')],function(_0x27408d){return{'model':db[_0x27408d[_0x88a7('0x1d')]],'as':_0x27408d['as'],'attributes':_0x27408d[_0x88a7('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59bbf4){logger[_0x88a7('0xe')](_0x88a7('0x17'),_0x49a061);logger[_0x88a7('0x1f')](_0x88a7('0x17'),_0x49a061,JSON['stringify'](_0x59bbf4));_0x3086fd(_0x59bbf4);})[_0x88a7('0x16')](function(_0x41fbe0){logger[_0x88a7('0x12')](_0x88a7('0x17'),_0x41fbe0[_0x88a7('0x14')],_0x49a061);_0x37b164(_0x28c99f[_0x88a7('0x12')](0x1f4,_0x41fbe0[_0x88a7('0x14')]));});});};exports[_0x88a7('0x20')]=function(_0x18b03e){var _0x34b0a2=this;return new Promise(function(_0x404cae,_0x4631bd){return db[_0x88a7('0x18')][_0x88a7('0x21')]({'raw':_0x18b03e[_0x88a7('0x19')]?_0x18b03e['options'][_0x88a7('0x22')]===undefined?!![]:![]:!![],'where':_0x18b03e['options']?_0x18b03e[_0x88a7('0x19')][_0x88a7('0x23')]||null:null,'attributes':_0x18b03e[_0x88a7('0x19')]?_0x18b03e[_0x88a7('0x19')][_0x88a7('0x1a')]||null:null,'include':_0x18b03e['options']?_0x18b03e[_0x88a7('0x19')][_0x88a7('0x1c')]?_[_0x88a7('0x1e')](_0x18b03e[_0x88a7('0x19')][_0x88a7('0x1c')],function(_0x2ebc70){return{'model':db[_0x2ebc70['model']],'as':_0x2ebc70['as'],'attributes':_0x2ebc70['attributes'],'include':_0x2ebc70[_0x88a7('0x1c')]?_[_0x88a7('0x1e')](_0x2ebc70[_0x88a7('0x1c')],function(_0x45827b){return{'model':db[_0x45827b[_0x88a7('0x1d')]],'as':_0x45827b['as'],'attributes':_0x45827b['attributes'],'include':_0x45827b[_0x88a7('0x1c')]?_[_0x88a7('0x1e')](_0x45827b['include'],function(_0x5e6ad7){return{'model':db[_0x5e6ad7['model']],'as':_0x5e6ad7['as'],'attributes':_0x5e6ad7[_0x88a7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x88a7('0xd')](function(_0xb49bf9){logger[_0x88a7('0xe')]('ShowCmHopper',_0x18b03e);logger[_0x88a7('0x1f')](_0x88a7('0x20'),_0x18b03e,JSON[_0x88a7('0x24')](_0xb49bf9));_0x404cae(_0xb49bf9);})[_0x88a7('0x16')](function(_0x2ac3f2){logger['error'](_0x88a7('0x20'),_0x2ac3f2['message'],_0x18b03e);_0x4631bd(_0x34b0a2['error'](0x1f4,_0x2ac3f2[_0x88a7('0x14')]));});});};exports[_0x88a7('0x25')]=function(_0xb12aa1){var _0x3f36d7=this;return new Promise(function(_0x16bac5,_0x34f0f6){return db[_0x88a7('0x18')][_0x88a7('0x26')](_0xb12aa1[_0x88a7('0x27')],{'raw':_0xb12aa1[_0x88a7('0x19')]?_0xb12aa1[_0x88a7('0x19')][_0x88a7('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x2db0ea){logger[_0x88a7('0xe')](_0x88a7('0x25'),_0xb12aa1);logger[_0x88a7('0x1f')](_0x88a7('0x25'),_0xb12aa1,JSON[_0x88a7('0x24')](_0x2db0ea));_0x16bac5(_0x2db0ea);})[_0x88a7('0x16')](function(_0x3f6446){logger[_0x88a7('0x12')](_0x88a7('0x25'),_0x3f6446[_0x88a7('0x14')],_0xb12aa1);_0x34f0f6(_0x3f36d7[_0x88a7('0x12')](0x1f4,_0x3f6446[_0x88a7('0x14')]));});});};exports['UpdateCmHopper']=function(_0x4896c1){var _0x57b4df=this;return new Promise(function(_0x232894,_0x2d8655){return db['CmHopper'][_0x88a7('0x28')](_0x4896c1[_0x88a7('0x27')],{'raw':_0x4896c1['options']?_0x4896c1[_0x88a7('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4896c1['options']?_0x4896c1[_0x88a7('0x19')]['where']||null:null,'attributes':_0x4896c1[_0x88a7('0x19')]?_0x4896c1['options'][_0x88a7('0x1a')]||null:null,'limit':_0x4896c1[_0x88a7('0x19')]?_0x4896c1[_0x88a7('0x19')][_0x88a7('0x1b')]||null:null})[_0x88a7('0xd')](function(_0x20d56e){logger[_0x88a7('0xe')](_0x88a7('0x29'),_0x4896c1);logger[_0x88a7('0xe')](_0x88a7('0x2a'),JSON['stringify'](_0x4896c1[_0x88a7('0x19')][_0x88a7('0x23')]),_0x4896c1[_0x88a7('0x27')]['active']);logger[_0x88a7('0x1f')](_0x88a7('0x29'),_0x4896c1,JSON[_0x88a7('0x24')](_0x20d56e));_0x232894(_0x20d56e);})[_0x88a7('0x16')](function(_0x438ca6){logger['error'](_0x88a7('0x29'),_0x438ca6[_0x88a7('0x14')],_0x4896c1);_0x2d8655(_0x57b4df[_0x88a7('0x12')](0x1f4,_0x438ca6['message']));});});};exports[_0x88a7('0x2b')]=function(_0x1c33ce){var _0x189a2b=this;return new Promise(function(_0x5a3ce8,_0x5be31f){return db['CmHopper'][_0x88a7('0x2c')]({'where':_0x1c33ce[_0x88a7('0x19')]?_0x1c33ce['options']['where']||null:null})[_0x88a7('0xd')](function(_0x127f0f){logger[_0x88a7('0xe')](_0x88a7('0x2b'),_0x1c33ce);logger[_0x88a7('0x1f')]('DestroyCmHopper',_0x1c33ce,JSON[_0x88a7('0x24')](_0x127f0f));_0x5a3ce8(_0x127f0f);})[_0x88a7('0x16')](function(_0x59eacd){logger[_0x88a7('0x12')](_0x88a7('0x2b'),_0x59eacd[_0x88a7('0x14')],_0x1c33ce);_0x5be31f(_0x189a2b[_0x88a7('0x12')](0x1f4,_0x59eacd[_0x88a7('0x14')]));});});};exports[_0x88a7('0x2d')]=function(_0x103d6e){var _0x5863f3=this;return new Promise(function(_0x44f1c2,_0x47b188){return db[_0x88a7('0x2e')][_0x88a7('0x2f')]()['then'](function(_0x55b132){return db[_0x88a7('0x30')]['transaction'](function(_0x57fc18){return db['CmHopper'][_0x88a7('0x31')]({'where':_0x103d6e[_0x88a7('0x19')]?_0x103d6e[_0x88a7('0x19')][_0x88a7('0x23')]||null:null,'attributes':_0x103d6e[_0x88a7('0x19')]?_0x103d6e[_0x88a7('0x19')][_0x88a7('0x1a')]||null:null,'limit':_0x103d6e[_0x88a7('0x19')]?_0x103d6e[_0x88a7('0x19')][_0x88a7('0x1b')]||null:null,'order':_0x103d6e[_0x88a7('0x19')]?_0x103d6e[_0x88a7('0x19')][_0x88a7('0x32')]||null:null,'transaction':_0x57fc18,'lock':_0x57fc18[_0x88a7('0x33')][_0x88a7('0x34')],'include':[{'model':db[_0x88a7('0x2e')],'as':_0x88a7('0x35'),'attributes':_[_0x88a7('0x36')](_0x55b132)},{'model':db['User'],'as':'Agent','attributes':['id',_0x88a7('0x37'),'voicePause']}]})['then'](function(_0x50c95c){var _0x27ee31=[];var _0x295d27=[];for(var _0x2cf247=0x0;_0x2cf247<_0x50c95c[_0x88a7('0x38')];_0x2cf247+=0x1){var _0xe04bf8=_0x50c95c[_0x2cf247]['UserId'];if(_0xe04bf8===null){_0x27ee31[_0x88a7('0x39')](_0x50c95c[_0x2cf247][_0x88a7('0x28')](_0x103d6e[_0x88a7('0x27')],{'transaction':_0x57fc18}));}else if(!_0x295d27[_0x88a7('0x3a')](_0xe04bf8)){_0x295d27['push'](_0xe04bf8);_0x27ee31[_0x88a7('0x39')](_0x50c95c[_0x2cf247][_0x88a7('0x28')](_0x103d6e[_0x88a7('0x27')],{'transaction':_0x57fc18}));}}return BPromise[_0x88a7('0x3b')](_0x27ee31);});})[_0x88a7('0xd')](function(_0x526658){logger[_0x88a7('0xe')]('GetContactDialer',_0x103d6e);if(_0x526658[_0x88a7('0x38')]>0x0){logger[_0x88a7('0xe')](_0x88a7('0x3c'),_0x526658[0x0][_0x88a7('0x3d')]['id'],_0x526658[0x0][_0x88a7('0x3d')]['ContactId'],_0x526658[0x0][_0x88a7('0x3d')][_0x88a7('0x3e')]);}logger[_0x88a7('0x1f')](_0x88a7('0x2d'),_0x103d6e,JSON[_0x88a7('0x24')](_0x526658));_0x44f1c2(_0x526658);})[_0x88a7('0x16')](function(_0xaf215f){logger['error'](_0x88a7('0x2d'),_0xaf215f['message'],_0x103d6e);_0x47b188(_0x5863f3[_0x88a7('0x12')](0x1f4,_0xaf215f[_0x88a7('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x26d2ca){var _0x54a061=this;return new Promise(function(_0x4c0f98,_0x3de059){return db[_0x88a7('0x30')][_0x88a7('0x3f')](function(_0x58e95a){return db[_0x88a7('0x40')]['create'](_0x26d2ca[_0x88a7('0x27')],{'raw':_0x26d2ca[_0x88a7('0x19')]?_0x26d2ca['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x58e95a})[_0x88a7('0xd')](function(){logger[_0x88a7('0xe')](_0x88a7('0x41'),JSON[_0x88a7('0x24')](_0x26d2ca[_0x88a7('0x19')]['where']),_0x26d2ca[_0x88a7('0x19')]['where'][_0x88a7('0x3e')]);return db[_0x88a7('0x18')][_0x88a7('0x2c')]({'where':_0x26d2ca[_0x88a7('0x19')]?_0x26d2ca[_0x88a7('0x19')][_0x88a7('0x23')]||null:null,'transaction':_0x58e95a});});})[_0x88a7('0xd')](function(_0x4a341f){logger[_0x88a7('0xe')](_0x88a7('0x42'),_0x26d2ca);logger['debug'](_0x88a7('0x42'),_0x26d2ca,JSON[_0x88a7('0x24')](_0x4a341f));_0x4c0f98(_0x4a341f);})[_0x88a7('0x16')](function(_0x64ca40){logger['error'](_0x88a7('0x42'),_0x64ca40[_0x88a7('0x14')],_0x26d2ca);_0x3de059(_0x54a061[_0x88a7('0x12')](0x1f4,_0x64ca40[_0x88a7('0x14')]));});});};exports[_0x88a7('0x43')]=function(_0x3d3d73){var _0x474f9a=this;return new Promise(function(_0x8bb981,_0x15a716){return db[_0x88a7('0x18')][_0x88a7('0x31')]({'raw':_0x3d3d73['options']?_0x3d3d73[_0x88a7('0x19')][_0x88a7('0x22')]===undefined?!![]:![]:!![],'where':_0x3d3d73['options']?_0x3d3d73[_0x88a7('0x19')]['where']||null:null,'attributes':[[db[_0x88a7('0x30')]['fn']('COUNT',db[_0x88a7('0x30')]['fn']('IF',db[_0x88a7('0x30')][_0x88a7('0x44')](_0x88a7('0x45')+util[_0x88a7('0x46')](_0x88a7('0x47'),moment()[_0x88a7('0x46')](_0x88a7('0x48')))+'\x20,\x201,\x20null'))),_0x88a7('0x49')]]})[_0x88a7('0xd')](function(_0x28e907){logger['info'](_0x88a7('0x43'),_0x3d3d73);logger[_0x88a7('0x1f')](_0x88a7('0x43'),_0x3d3d73,JSON['stringify'](_0x28e907));_0x8bb981(_0x28e907);})[_0x88a7('0x16')](function(_0x1b9c66){logger[_0x88a7('0x12')]('CountReScheduled',_0x1b9c66[_0x88a7('0x14')],_0x3d3d73);_0x15a716(_0x474f9a[_0x88a7('0x12')](0x1f4,_0x1b9c66[_0x88a7('0x14')]));});});};exports['GetContactRecallMe']=function(_0x5021d7){var _0x9bdda0=this;return new Promise(function(_0x41e9f0,_0x475233){return db[_0x88a7('0x2e')][_0x88a7('0x2f')]()[_0x88a7('0xd')](function(_0x335049){return db['sequelize'][_0x88a7('0x3f')](function(_0x521ac8){return db[_0x88a7('0x18')][_0x88a7('0x31')]({'where':_0x5021d7[_0x88a7('0x19')]?_0x5021d7[_0x88a7('0x19')][_0x88a7('0x23')]||null:null,'attributes':_0x5021d7[_0x88a7('0x19')]?_0x5021d7[_0x88a7('0x19')]['attributes']||null:null,'limit':0x1,'order':_0x5021d7[_0x88a7('0x19')]?_0x5021d7[_0x88a7('0x19')][_0x88a7('0x32')]||null:null,'group':db['CmHopper'][_0x88a7('0x4a')],'transaction':_0x521ac8,'lock':_0x521ac8[_0x88a7('0x33')][_0x88a7('0x34')],'include':_0x5021d7[_0x88a7('0x19')]?_0x5021d7[_0x88a7('0x19')][_0x88a7('0x1c')]?_[_0x88a7('0x1e')](_0x5021d7[_0x88a7('0x19')][_0x88a7('0x1c')],function(_0x47f015){return{'model':db[_0x47f015[_0x88a7('0x1d')]],'as':_0x47f015['as'],'attributes':_0x47f015[_0x88a7('0x1a')],'include':_0x47f015[_0x88a7('0x1c')]?_[_0x88a7('0x1e')](_0x47f015[_0x88a7('0x1c')],function(_0x54752c){return{'model':db[_0x54752c['model']],'as':_0x54752c['as'],'attributes':_0x54752c[_0x88a7('0x1a')],'include':_0x54752c[_0x88a7('0x1c')]?_[_0x88a7('0x1e')](_0x54752c['include'],function(_0x4422f0){return{'model':db[_0x4422f0['model']],'as':_0x4422f0['as'],'attributes':_0x4422f0[_0x88a7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x88a7('0xd')](function(_0x438f7a){var _0x3d5de1=[];for(var _0x2ae3b7=0x0;_0x2ae3b7<_0x438f7a['length'];_0x2ae3b7+=0x1){_0x3d5de1[_0x88a7('0x39')](_0x438f7a[_0x2ae3b7][_0x88a7('0x28')](_0x5021d7[_0x88a7('0x27')],{'transaction':_0x521ac8}));}return BPromise[_0x88a7('0x3b')](_0x3d5de1);});})[_0x88a7('0xd')](function(_0x504644){logger[_0x88a7('0xe')](_0x88a7('0x4b'),_0x5021d7);logger[_0x88a7('0x1f')]('GetContactRecallMe',_0x5021d7,JSON[_0x88a7('0x24')](_0x504644));_0x41e9f0(_0x504644);})['catch'](function(_0x412e52){logger[_0x88a7('0x12')](_0x88a7('0x4b'),_0x412e52[_0x88a7('0x14')],_0x5021d7);_0x475233(_0x9bdda0[_0x88a7('0x12')](0x1f4,_0x412e52[_0x88a7('0x14')]));});});});};exports[_0x88a7('0x4c')]=function(_0x47f5ca){var _0x1cafa2=this;return new Promise(function(_0x4ee23f,_0x529236){db[_0x88a7('0x2e')]['describe']()['then'](function(_0x2ff7fb){return db[_0x88a7('0x18')][_0x88a7('0x31')]({'raw':_0x47f5ca['options']?_0x47f5ca[_0x88a7('0x19')][_0x88a7('0x22')]===undefined?!![]:![]:!![],'where':_0x47f5ca[_0x88a7('0x19')]?_0x47f5ca[_0x88a7('0x19')][_0x88a7('0x23')]||null:null,'attributes':_0x47f5ca[_0x88a7('0x19')]?_0x47f5ca['options'][_0x88a7('0x1a')]||null:null,'limit':_0x47f5ca[_0x88a7('0x19')]?_0x47f5ca[_0x88a7('0x19')]['limit']||null:null,'include':_0x47f5ca['options']?_0x47f5ca['options']['include']?_[_0x88a7('0x1e')](_0x47f5ca['options'][_0x88a7('0x1c')],function(_0x21e064){return{'model':db[_0x21e064['model']],'as':_0x21e064['as'],'attributes':_0x21e064['as']===_0x88a7('0x35')?_[_0x88a7('0x36')](_0x2ff7fb):_0x21e064[_0x88a7('0x1a')],'include':_0x21e064[_0x88a7('0x1c')]?_['map'](_0x21e064[_0x88a7('0x1c')],function(_0x363344){return{'model':db[_0x363344[_0x88a7('0x1d')]],'as':_0x363344['as'],'attributes':_0x363344['attributes'],'include':_0x363344[_0x88a7('0x1c')]?_['map'](_0x363344[_0x88a7('0x1c')],function(_0x1c1498){return{'model':db[_0x1c1498[_0x88a7('0x1d')]],'as':_0x1c1498['as'],'attributes':_0x1c1498[_0x88a7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x88a7('0xd')](function(_0x5b6684){logger[_0x88a7('0xe')](_0x88a7('0x17'),_0x47f5ca);logger[_0x88a7('0x1f')]('GetCmHopper',_0x47f5ca,JSON[_0x88a7('0x24')](_0x5b6684));_0x4ee23f(_0x5b6684);})['catch'](function(_0x4b7df9){logger[_0x88a7('0x12')](_0x88a7('0x17'),_0x4b7df9[_0x88a7('0x14')],_0x47f5ca);_0x529236(_0x1cafa2[_0x88a7('0x12')](0x1f4,_0x4b7df9[_0x88a7('0x14')]));});});});};exports['GetContactByPhone']=function(_0x6898a1){var _0x1e23b0=this;return new Promise(function(_0x1c9e46,_0x523aa4){return db[_0x88a7('0x2e')][_0x88a7('0x4d')]({'raw':!![],'where':{'phone':_0x6898a1[_0x88a7('0x19')][_0x88a7('0x23')][_0x88a7('0x4e')]},'attributes':['id','dialTimezone'],'order':[['id',_0x88a7('0x4f')]]})[_0x88a7('0xd')](function(_0x5a83a7){logger[_0x88a7('0xe')](_0x88a7('0x50'),_0x6898a1);logger['debug'](_0x88a7('0x50'),_0x6898a1,JSON[_0x88a7('0x24')](_0x5a83a7));_0x1c9e46(_0x5a83a7);})[_0x88a7('0x16')](function(_0x4b202c){logger[_0x88a7('0x12')](_0x88a7('0x50'),_0x4b202c[_0x88a7('0x14')],_0x6898a1);_0x523aa4(_0x1e23b0['error'](0x1f4,_0x4b202c['message']));});});};exports['ResetActiveCalls']=function(_0x21b41d){var _0x55aa12=this;return new Promise(function(_0x34a8b0,_0x22bafe){return db[_0x88a7('0x30')][_0x88a7('0x3f')](function(_0x391880){return db['CmHopper'][_0x88a7('0x28')]({'active':![]},{'where':{},'transaction':_0x391880})['then'](function(_0x35705c){logger[_0x88a7('0xe')]('ResetActiveCalls',_0x21b41d);logger['debug'](_0x88a7('0x51'),_0x21b41d,JSON[_0x88a7('0x24')](_0x35705c));_0x34a8b0(_0x35705c);})[_0x88a7('0x16')](function(_0x25e222){logger[_0x88a7('0x12')](_0x88a7('0x51'),_0x25e222['message'],_0x21b41d);_0x22bafe(_0x55aa12[_0x88a7('0x12')](0x1f4,_0x25e222['message']));});});});};exports[_0x88a7('0x52')]=function(_0x416753){var _0x3a50b7=this;var _0x5af289=_0x416753[_0x88a7('0x27')][_0x88a7('0x23')][_0x88a7('0x53')];var _0x37b81c=_0x416753[_0x88a7('0x27')][_0x88a7('0x23')][_0x88a7('0x54')];return new Promise(function(_0x45d0dc,_0x431605){return db['CmHopper']['findAll']({'where':{'voiceQueueId':_0x5af289,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x88a7('0x30')]['literal'](_0x88a7('0x55')+_0x37b81c+_0x88a7('0x56'))}},'include':[{'model':db['CmContact'],'as':_0x88a7('0x35')},{'model':db['User'],'as':_0x88a7('0x57'),'attributes':['id',_0x88a7('0x37'),_0x88a7('0x58')]},{'model':db[_0x88a7('0x59')],'as':_0x88a7('0x5a')}]})[_0x88a7('0xd')](function(_0x210a84){return db[_0x88a7('0x30')][_0x88a7('0x3f')](function(_0x5ee45f){return db[_0x88a7('0x18')]['update']({'recallmeNotifiedDate':new Date()},{'where':{'voiceQueueId':_0x5af289,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$lte':db[_0x88a7('0x30')]['literal'](_0x88a7('0x55')+_0x37b81c+_0x88a7('0x56'))}},'transaction':_0x5ee45f})['then'](function(_0x4c1e95){_0x45d0dc(_0x210a84);})['catch'](function(_0x2b15d0){logger['error'](_0x88a7('0x52'),_0x2b15d0[_0x88a7('0x14')],_0x416753);_0x431605(validateExpressRequest);});});})['catch'](function(_0x52af30){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x52af30[_0x88a7('0x14')],_0x416753);_0x431605(_0x3a50b7[_0x88a7('0x12')](0x1f4,_0x52af30[_0x88a7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index f1744aa..0813c8a 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 _0x80ca=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','getOpenContacts','getTimezones','/:id','show','post','create','/preview','getPreview','getTimezone','/previewrecall','getPreviewRecall','put','update','delete','destroy','exports'];(function(_0x21a8e0,_0x318799){var _0x11589e=function(_0x2b5768){while(--_0x2b5768){_0x21a8e0['push'](_0x21a8e0['shift']());}};_0x11589e(++_0x318799);}(_0x80ca,0x7d));var _0xa80c=function(_0x5223c2,_0xe0d88f){_0x5223c2=_0x5223c2-0x0;var _0x10f398=_0x80ca[_0x5223c2];return _0x10f398;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa80c('0x0'));var timeout=require(_0xa80c('0x1'));var express=require('express');var router=express[_0xa80c('0x2')]();var fs_extra=require(_0xa80c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa80c('0x4'));var config=require('../../config/environment');var controller=require(_0xa80c('0x5'));router[_0xa80c('0x6')]('/',auth[_0xa80c('0x7')](),controller[_0xa80c('0x8')]);router[_0xa80c('0x6')]('/describe',auth[_0xa80c('0x7')](),controller['describe']);router[_0xa80c('0x6')]('/opencontacts',auth['isAuthenticated'](),controller[_0xa80c('0x9')]);router[_0xa80c('0x6')]('/timezones',auth[_0xa80c('0x7')](),controller[_0xa80c('0xa')]);router[_0xa80c('0x6')](_0xa80c('0xb'),auth[_0xa80c('0x7')](),controller[_0xa80c('0xc')]);router[_0xa80c('0xd')]('/',auth['isAuthenticated'](),controller[_0xa80c('0xe')]);router[_0xa80c('0xd')](_0xa80c('0xf'),auth[_0xa80c('0x7')](),controller[_0xa80c('0x10')]);router[_0xa80c('0xd')]('/timezone',auth[_0xa80c('0x7')](),controller[_0xa80c('0x11')]);router[_0xa80c('0xd')](_0xa80c('0x12'),auth[_0xa80c('0x7')](),controller[_0xa80c('0x13')]);router[_0xa80c('0x14')](_0xa80c('0xb'),auth[_0xa80c('0x7')](),controller[_0xa80c('0x15')]);router[_0xa80c('0x16')](_0xa80c('0xb'),auth[_0xa80c('0x7')](),controller[_0xa80c('0x17')]);module[_0xa80c('0x18')]=router; \ No newline at end of file +var _0xb285=['update','delete','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','/describe','isAuthenticated','describe','/opencontacts','/timezones','getTimezones','/:id','show','post','create','/preview','getPreview','/timezone','getTimezone','/previewrecall','getPreviewRecall','put'];(function(_0x5a5276,_0x262d69){var _0x3e8ee2=function(_0x151ce3){while(--_0x151ce3){_0x5a5276['push'](_0x5a5276['shift']());}};_0x3e8ee2(++_0x262d69);}(_0xb285,0x11a));var _0x5b28=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0xb285[_0x27beea];return _0x122645;};'use strict';var multer=require(_0x5b28('0x0'));var util=require(_0x5b28('0x1'));var path=require(_0x5b28('0x2'));var timeout=require('connect-timeout');var express=require(_0x5b28('0x3'));var router=express['Router']();var fs_extra=require(_0x5b28('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5b28('0x5'));var config=require(_0x5b28('0x6'));var controller=require(_0x5b28('0x7'));router[_0x5b28('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5b28('0x8')](_0x5b28('0x9'),auth[_0x5b28('0xa')](),controller[_0x5b28('0xb')]);router['get'](_0x5b28('0xc'),auth[_0x5b28('0xa')](),controller['getOpenContacts']);router['get'](_0x5b28('0xd'),auth['isAuthenticated'](),controller[_0x5b28('0xe')]);router[_0x5b28('0x8')](_0x5b28('0xf'),auth['isAuthenticated'](),controller[_0x5b28('0x10')]);router[_0x5b28('0x11')]('/',auth[_0x5b28('0xa')](),controller[_0x5b28('0x12')]);router[_0x5b28('0x11')](_0x5b28('0x13'),auth[_0x5b28('0xa')](),controller[_0x5b28('0x14')]);router[_0x5b28('0x11')](_0x5b28('0x15'),auth[_0x5b28('0xa')](),controller[_0x5b28('0x16')]);router[_0x5b28('0x11')](_0x5b28('0x17'),auth[_0x5b28('0xa')](),controller[_0x5b28('0x18')]);router[_0x5b28('0x19')]('/:id',auth[_0x5b28('0xa')](),controller[_0x5b28('0x1a')]);router[_0x5b28('0x1b')](_0x5b28('0xf'),auth[_0x5b28('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 590cee9..db7654b 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 _0xed8c=['format','exports','INTEGER','STRING','DATE'];(function(_0x837684,_0x800c0c){var _0x5f0881=function(_0x5937f6){while(--_0x5937f6){_0x837684['push'](_0x837684['shift']());}};_0x5f0881(++_0x800c0c);}(_0xed8c,0x74));var _0xced8=function(_0x85b54c,_0x3f6026){_0x85b54c=_0x85b54c-0x0;var _0x4990c1=_0xed8c[_0x85b54c];return _0x4990c1;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xced8('0x0')]={'CmHopperId':{'type':Sequelize[_0xced8('0x1')]},'phone':{'type':Sequelize[_0xced8('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xced8('0x3')],'defaultValue':moment()[_0xced8('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xced8('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xced8('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xced8('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xced8('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xced8('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xced8('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xaa98=['STRING','format','exports','INTEGER'];(function(_0x3d46c6,_0x43b3a1){var _0x375246=function(_0x1e8abf){while(--_0x1e8abf){_0x3d46c6['push'](_0x3d46c6['shift']());}};_0x375246(++_0x43b3a1);}(_0xaa98,0x17a));var _0x8aa9=function(_0x16fd58,_0x416fe9){_0x16fd58=_0x16fd58-0x0;var _0x445681=_0xaa98[_0x16fd58];return _0x445681;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x8aa9('0x0')]={'CmHopperId':{'type':Sequelize[_0x8aa9('0x1')]},'phone':{'type':Sequelize[_0x8aa9('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x8aa9('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x8aa9('0x3')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x8aa9('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8aa9('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8aa9('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x8aa9('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8aa9('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8aa9('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8aa9('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 13ec950..cf554b5 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 _0x6faf=['intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','CmHopperAdditionalPhone','includeAll','findAll','show','include','find','catch','create','user','role','userProfileId','autoAssociation','update','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes'];(function(_0x1ac6bf,_0x2c1d0f){var _0x597dad=function(_0xaec9e8){while(--_0xaec9e8){_0x1ac6bf['push'](_0x1ac6bf['shift']());}};_0x597dad(++_0x2c1d0f);}(_0x6faf,0x6d));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xf6fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6fa('0x1'));var jsonpatch=require(_0xf6fa('0x2'));var rp=require(_0xf6fa('0x3'));var moment=require(_0xf6fa('0x4'));var BPromise=require(_0xf6fa('0x5'));var Mustache=require(_0xf6fa('0x6'));var util=require(_0xf6fa('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf6fa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6fa('0x9'));var _=require(_0xf6fa('0xa'));var squel=require(_0xf6fa('0xb'));var crypto=require(_0xf6fa('0xc'));var jsforce=require(_0xf6fa('0xd'));var deskjs=require(_0xf6fa('0xe'));var toCsv=require(_0xf6fa('0x8'));var querystring=require('querystring');var Papa=require(_0xf6fa('0xf'));var Redis=require(_0xf6fa('0x10'));var authService=require(_0xf6fa('0x11'));var qs=require(_0xf6fa('0x12'));var as=require(_0xf6fa('0x13'));var hardwareService=require(_0xf6fa('0x14'));var logger=require(_0xf6fa('0x15'))(_0xf6fa('0x16'));var utils=require(_0xf6fa('0x17'));var config=require(_0xf6fa('0x18'));var licenseUtil=require(_0xf6fa('0x19'));var db=require(_0xf6fa('0x1a'))['db'];function respondWithStatusCode(_0x153d5b,_0x42c0ae){_0x42c0ae=_0x42c0ae||0xcc;return function(_0x5beafd){if(_0x5beafd){return _0x153d5b[_0xf6fa('0x1b')](_0x42c0ae);}return _0x153d5b[_0xf6fa('0x1c')](_0x42c0ae)[_0xf6fa('0x1d')]();};}function respondWithResult(_0x4f6f2,_0x867b11){_0x867b11=_0x867b11||0xc8;return function(_0x39739e){if(_0x39739e){return _0x4f6f2[_0xf6fa('0x1c')](_0x867b11)['json'](_0x39739e);}};}function respondWithFilteredResult(_0x54fa66,_0x2a52ee){return function(_0x287d97){if(_0x287d97){var _0x460bb3=typeof _0x2a52ee[_0xf6fa('0x1e')]===_0xf6fa('0x1f')&&typeof _0x2a52ee[_0xf6fa('0x20')]==='undefined';var _0x49f9c9=_0x287d97[_0xf6fa('0x21')];var _0xcbe698=_0x460bb3?0x0:_0x2a52ee[_0xf6fa('0x1e')];var _0xfb9fc=_0x460bb3?_0x287d97[_0xf6fa('0x21')]:_0x2a52ee['offset']+_0x2a52ee[_0xf6fa('0x20')];var _0x1ae6d2;if(_0xfb9fc>=_0x49f9c9){_0xfb9fc=_0x49f9c9;_0x1ae6d2=0xc8;}else{_0x1ae6d2=0xce;}_0x54fa66['status'](_0x1ae6d2);return _0x54fa66[_0xf6fa('0x22')]('Content-Range',_0xcbe698+'-'+_0xfb9fc+'/'+_0x49f9c9)['json'](_0x287d97);}return null;};}function patchUpdates(_0x1e2a54){return function(_0x1453db){try{jsonpatch[_0xf6fa('0x23')](_0x1453db,_0x1e2a54,!![]);}catch(_0x1307de){return BPromise[_0xf6fa('0x24')](_0x1307de);}return _0x1453db[_0xf6fa('0x25')]();};}function saveUpdates(_0x504c50,_0x4b8d1c){return function(_0x5e7cbc){if(_0x5e7cbc){return _0x5e7cbc['update'](_0x504c50)[_0xf6fa('0x26')](function(_0x224180){return _0x224180;});}return null;};}function removeEntity(_0x1f3b57,_0x2a7e7f){return function(_0x533a87){if(_0x533a87){return _0x533a87[_0xf6fa('0x27')]()[_0xf6fa('0x26')](function(){var _0x1e12c6=_0x533a87[_0xf6fa('0x28')]({'plain':!![]});var _0x45ea95='CmHopperAdditionalPhones';return db[_0xf6fa('0x29')]['destroy']({'where':{'type':_0x45ea95,'resourceId':_0x1e12c6['id']}})['then'](function(){return _0x533a87;});})[_0xf6fa('0x26')](function(){_0x1f3b57[_0xf6fa('0x1c')](0xcc)[_0xf6fa('0x1d')]();});}};}function handleEntityNotFound(_0x250be3,_0x52ba22){return function(_0x234553){if(!_0x234553){_0x250be3[_0xf6fa('0x1b')](0x194);}return _0x234553;};}function handleError(_0x12bd12,_0x17bb15){_0x17bb15=_0x17bb15||0x1f4;return function(_0xa8d4d7){logger[_0xf6fa('0x2a')](_0xa8d4d7[_0xf6fa('0x2b')]);if(_0xa8d4d7[_0xf6fa('0x2c')]){delete _0xa8d4d7['name'];}_0x12bd12[_0xf6fa('0x1c')](_0x17bb15)[_0xf6fa('0x2d')](_0xa8d4d7);};}exports[_0xf6fa('0x2e')]=function(_0x1fb732,_0x31b406){var _0x254d4c={},_0x2c4de6={},_0x4922d2={'count':0x0,'rows':[]};var _0x2c151c=_[_0xf6fa('0x2f')](db['CmHopperAdditionalPhone'][_0xf6fa('0x30')],function(_0x401c3a){return{'name':_0x401c3a[_0xf6fa('0x31')],'type':_0x401c3a[_0xf6fa('0x32')][_0xf6fa('0x33')]};});_0x2c4de6[_0xf6fa('0x34')]=_[_0xf6fa('0x2f')](_0x2c151c,_0xf6fa('0x2c'));_0x2c4de6[_0xf6fa('0x35')]=_[_0xf6fa('0x36')](_0x1fb732[_0xf6fa('0x35')]);_0x2c4de6[_0xf6fa('0x37')]=_['intersection'](_0x2c4de6[_0xf6fa('0x34')],_0x2c4de6[_0xf6fa('0x35')]);_0x254d4c[_0xf6fa('0x38')]=_[_0xf6fa('0x39')](_0x2c4de6[_0xf6fa('0x34')],qs[_0xf6fa('0x3a')](_0x1fb732[_0xf6fa('0x35')]['fields']));_0x254d4c[_0xf6fa('0x38')]=_0x254d4c[_0xf6fa('0x38')][_0xf6fa('0x3b')]?_0x254d4c[_0xf6fa('0x38')]:_0x2c4de6['model'];if(!_0x1fb732['query'][_0xf6fa('0x3c')](_0xf6fa('0x3d'))){_0x254d4c[_0xf6fa('0x20')]=qs[_0xf6fa('0x20')](_0x1fb732['query']['limit']);_0x254d4c[_0xf6fa('0x1e')]=qs[_0xf6fa('0x1e')](_0x1fb732[_0xf6fa('0x35')][_0xf6fa('0x1e')]);}_0x254d4c['order']=qs[_0xf6fa('0x3e')](_0x1fb732[_0xf6fa('0x35')][_0xf6fa('0x3e')]);_0x254d4c[_0xf6fa('0x3f')]=qs[_0xf6fa('0x37')](_['pick'](_0x1fb732[_0xf6fa('0x35')],_0x2c4de6['filters']),_0x2c151c);if(_0x1fb732['query'][_0xf6fa('0x40')]){_0x254d4c[_0xf6fa('0x3f')]=_[_0xf6fa('0x41')](_0x254d4c[_0xf6fa('0x3f')],{'$or':_[_0xf6fa('0x2f')](_0x2c151c,function(_0x55902b){if(_0x55902b[_0xf6fa('0x32')]!==_0xf6fa('0x42')){var _0x1580ce={};_0x1580ce[_0x55902b[_0xf6fa('0x2c')]]={'$like':'%'+_0x1fb732[_0xf6fa('0x35')][_0xf6fa('0x40')]+'%'};return _0x1580ce;}})});}_0x254d4c=_[_0xf6fa('0x41')]({},_0x254d4c,_0x1fb732[_0xf6fa('0x43')]);var _0x15a202={'where':_0x254d4c[_0xf6fa('0x3f')]};return db[_0xf6fa('0x44')][_0xf6fa('0x21')](_0x15a202)['then'](function(_0x1573db){_0x4922d2['count']=_0x1573db;if(_0x1fb732['query'][_0xf6fa('0x45')]){_0x254d4c['include']=[{'all':!![]}];}return db[_0xf6fa('0x44')][_0xf6fa('0x46')](_0x254d4c);})[_0xf6fa('0x26')](function(_0x4faffd){_0x4922d2['rows']=_0x4faffd;return _0x4922d2;})['then'](respondWithFilteredResult(_0x31b406,_0x254d4c))['catch'](handleError(_0x31b406,null));};exports[_0xf6fa('0x47')]=function(_0x2d8236,_0x291126){var _0x2c3687={'raw':!![],'where':{'id':_0x2d8236['params']['id']}},_0x3cab4d={};_0x3cab4d[_0xf6fa('0x34')]=_[_0xf6fa('0x36')](db['CmHopperAdditionalPhone'][_0xf6fa('0x30')]);_0x3cab4d[_0xf6fa('0x35')]=_['keys'](_0x2d8236[_0xf6fa('0x35')]);_0x3cab4d['filters']=_[_0xf6fa('0x39')](_0x3cab4d[_0xf6fa('0x34')],_0x3cab4d[_0xf6fa('0x35')]);_0x2c3687['attributes']=_['intersection'](_0x3cab4d[_0xf6fa('0x34')],qs[_0xf6fa('0x3a')](_0x2d8236[_0xf6fa('0x35')][_0xf6fa('0x3a')]));_0x2c3687[_0xf6fa('0x38')]=_0x2c3687[_0xf6fa('0x38')][_0xf6fa('0x3b')]?_0x2c3687[_0xf6fa('0x38')]:_0x3cab4d[_0xf6fa('0x34')];if(_0x2d8236[_0xf6fa('0x35')][_0xf6fa('0x45')]){_0x2c3687[_0xf6fa('0x48')]=[{'all':!![]}];}_0x2c3687=_[_0xf6fa('0x41')]({},_0x2c3687,_0x2d8236[_0xf6fa('0x43')]);return db[_0xf6fa('0x44')][_0xf6fa('0x49')](_0x2c3687)[_0xf6fa('0x26')](handleEntityNotFound(_0x291126,null))[_0xf6fa('0x26')](respondWithResult(_0x291126,null))[_0xf6fa('0x4a')](handleError(_0x291126,null));};exports['create']=function(_0x14e30c,_0x2a9f29){return db['CmHopperAdditionalPhone'][_0xf6fa('0x4b')](_0x14e30c['body'],{})[_0xf6fa('0x26')](function(_0x57ff4b){var _0x5b8a7c=_0x14e30c[_0xf6fa('0x4c')][_0xf6fa('0x28')]({'plain':!![]});if(!_0x5b8a7c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b8a7c[_0xf6fa('0x4d')]==='user'){var _0x43728c=_0x57ff4b[_0xf6fa('0x28')]({'plain':!![]});var _0x49c0e7='CmHopperAdditionalPhones';return db['UserProfileSection'][_0xf6fa('0x49')]({'where':{'name':_0x49c0e7,'userProfileId':_0x5b8a7c[_0xf6fa('0x4e')]},'raw':!![]})[_0xf6fa('0x26')](function(_0x48ef0f){if(_0x48ef0f&&_0x48ef0f[_0xf6fa('0x4f')]===0x0){return db[_0xf6fa('0x29')][_0xf6fa('0x4b')]({'name':_0x43728c[_0xf6fa('0x2c')],'resourceId':_0x43728c['id'],'type':_0x48ef0f[_0xf6fa('0x2c')],'sectionId':_0x48ef0f['id']},{})[_0xf6fa('0x26')](function(){return _0x57ff4b;});}else{return _0x57ff4b;}})[_0xf6fa('0x4a')](function(_0x460637){logger[_0xf6fa('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x460637);throw _0x460637;});}return _0x57ff4b;})[_0xf6fa('0x26')](respondWithResult(_0x2a9f29,0xc9))['catch'](handleError(_0x2a9f29,null));};exports[_0xf6fa('0x50')]=function(_0x41c797,_0x136e67){if(_0x41c797[_0xf6fa('0x51')]['id']){delete _0x41c797['body']['id'];}return db['CmHopperAdditionalPhone'][_0xf6fa('0x49')]({'where':{'id':_0x41c797[_0xf6fa('0x52')]['id']}})['then'](handleEntityNotFound(_0x136e67,null))[_0xf6fa('0x26')](saveUpdates(_0x41c797[_0xf6fa('0x51')],null))[_0xf6fa('0x26')](respondWithResult(_0x136e67,null))[_0xf6fa('0x4a')](handleError(_0x136e67,null));};exports[_0xf6fa('0x27')]=function(_0x589618,_0x5d690b){return db[_0xf6fa('0x44')][_0xf6fa('0x49')]({'where':{'id':_0x589618[_0xf6fa('0x52')]['id']}})['then'](handleEntityNotFound(_0x5d690b,null))[_0xf6fa('0x26')](removeEntity(_0x5d690b,null))['catch'](handleError(_0x5d690b,null));}; \ No newline at end of file +var _0xec21=['name','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','CmHopperAdditionalPhone','count','includeAll','findAll','rows','catch','params','include','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','Content-Range','json','apply','reject','save','update','then','get','CmHopperAdditionalPhones','UserProfileResource','destroy','error'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0xec21,0xba));var _0x1ec2=function(_0x3d1260,_0x1277bb){_0x3d1260=_0x3d1260-0x0;var _0x18c14b=_0xec21[_0x3d1260];return _0x18c14b;};'use strict';var emlformat=require(_0x1ec2('0x0'));var rimraf=require(_0x1ec2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1ec2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1ec2('0x3'));var util=require(_0x1ec2('0x4'));var path=require('path');var sox=require(_0x1ec2('0x5'));var csv=require(_0x1ec2('0x6'));var ejs=require(_0x1ec2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1ec2('0x8'));var crypto=require(_0x1ec2('0x9'));var jsforce=require(_0x1ec2('0xa'));var deskjs=require(_0x1ec2('0xb'));var toCsv=require(_0x1ec2('0x6'));var querystring=require('querystring');var Papa=require(_0x1ec2('0xc'));var Redis=require('ioredis');var authService=require(_0x1ec2('0xd'));var qs=require(_0x1ec2('0xe'));var as=require(_0x1ec2('0xf'));var hardwareService=require(_0x1ec2('0x10'));var logger=require('../../config/logger')(_0x1ec2('0x11'));var utils=require(_0x1ec2('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1ec2('0x13'));var db=require(_0x1ec2('0x14'))['db'];function respondWithStatusCode(_0x31859f,_0x4a0e3f){_0x4a0e3f=_0x4a0e3f||0xcc;return function(_0x566d93){if(_0x566d93){return _0x31859f[_0x1ec2('0x15')](_0x4a0e3f);}return _0x31859f['status'](_0x4a0e3f)[_0x1ec2('0x16')]();};}function respondWithResult(_0x4bfda6,_0x2bb22f){_0x2bb22f=_0x2bb22f||0xc8;return function(_0x41d88e){if(_0x41d88e){return _0x4bfda6[_0x1ec2('0x17')](_0x2bb22f)['json'](_0x41d88e);}};}function respondWithFilteredResult(_0x302af4,_0x868547){return function(_0x14dea6){if(_0x14dea6){var _0x3927c1=typeof _0x868547[_0x1ec2('0x18')]===_0x1ec2('0x19')&&typeof _0x868547[_0x1ec2('0x1a')]===_0x1ec2('0x19');var _0x5dab4e=_0x14dea6['count'];var _0x373ea8=_0x3927c1?0x0:_0x868547[_0x1ec2('0x18')];var _0x4f8715=_0x3927c1?_0x14dea6['count']:_0x868547[_0x1ec2('0x18')]+_0x868547[_0x1ec2('0x1a')];var _0x15cfe5;if(_0x4f8715>=_0x5dab4e){_0x4f8715=_0x5dab4e;_0x15cfe5=0xc8;}else{_0x15cfe5=0xce;}_0x302af4[_0x1ec2('0x17')](_0x15cfe5);return _0x302af4['set'](_0x1ec2('0x1b'),_0x373ea8+'-'+_0x4f8715+'/'+_0x5dab4e)[_0x1ec2('0x1c')](_0x14dea6);}return null;};}function patchUpdates(_0x32f18e){return function(_0x41143d){try{jsonpatch[_0x1ec2('0x1d')](_0x41143d,_0x32f18e,!![]);}catch(_0x8870ca){return BPromise[_0x1ec2('0x1e')](_0x8870ca);}return _0x41143d[_0x1ec2('0x1f')]();};}function saveUpdates(_0x396eb3,_0x1aa52c){return function(_0x5b9dee){if(_0x5b9dee){return _0x5b9dee[_0x1ec2('0x20')](_0x396eb3)[_0x1ec2('0x21')](function(_0x38549b){return _0x38549b;});}return null;};}function removeEntity(_0x5edf55,_0x452553){return function(_0x3e678b){if(_0x3e678b){return _0x3e678b['destroy']()[_0x1ec2('0x21')](function(){var _0xf89870=_0x3e678b[_0x1ec2('0x22')]({'plain':!![]});var _0x2ef88d=_0x1ec2('0x23');return db[_0x1ec2('0x24')][_0x1ec2('0x25')]({'where':{'type':_0x2ef88d,'resourceId':_0xf89870['id']}})[_0x1ec2('0x21')](function(){return _0x3e678b;});})[_0x1ec2('0x21')](function(){_0x5edf55[_0x1ec2('0x17')](0xcc)[_0x1ec2('0x16')]();});}};}function handleEntityNotFound(_0x3adc2b,_0xafbc54){return function(_0x19647d){if(!_0x19647d){_0x3adc2b[_0x1ec2('0x15')](0x194);}return _0x19647d;};}function handleError(_0x1471c2,_0x12c9e6){_0x12c9e6=_0x12c9e6||0x1f4;return function(_0x552458){logger[_0x1ec2('0x26')](_0x552458['stack']);if(_0x552458[_0x1ec2('0x27')]){delete _0x552458[_0x1ec2('0x27')];}_0x1471c2['status'](_0x12c9e6)['send'](_0x552458);};}exports['index']=function(_0x52bd4c,_0x2f5da7){var _0x549693={},_0x3b45ed={},_0x418376={'count':0x0,'rows':[]};var _0x2bd63d=_['map'](db['CmHopperAdditionalPhone'][_0x1ec2('0x28')],function(_0x16c9e1){return{'name':_0x16c9e1['fieldName'],'type':_0x16c9e1[_0x1ec2('0x29')][_0x1ec2('0x2a')]};});_0x3b45ed['model']=_['map'](_0x2bd63d,_0x1ec2('0x27'));_0x3b45ed[_0x1ec2('0x2b')]=_[_0x1ec2('0x2c')](_0x52bd4c[_0x1ec2('0x2b')]);_0x3b45ed[_0x1ec2('0x2d')]=_[_0x1ec2('0x2e')](_0x3b45ed['model'],_0x3b45ed[_0x1ec2('0x2b')]);_0x549693['attributes']=_[_0x1ec2('0x2e')](_0x3b45ed[_0x1ec2('0x2f')],qs['fields'](_0x52bd4c['query'][_0x1ec2('0x30')]));_0x549693['attributes']=_0x549693[_0x1ec2('0x31')][_0x1ec2('0x32')]?_0x549693[_0x1ec2('0x31')]:_0x3b45ed[_0x1ec2('0x2f')];if(!_0x52bd4c['query'][_0x1ec2('0x33')](_0x1ec2('0x34'))){_0x549693[_0x1ec2('0x1a')]=qs['limit'](_0x52bd4c[_0x1ec2('0x2b')]['limit']);_0x549693[_0x1ec2('0x18')]=qs[_0x1ec2('0x18')](_0x52bd4c[_0x1ec2('0x2b')][_0x1ec2('0x18')]);}_0x549693['order']=qs['sort'](_0x52bd4c['query'][_0x1ec2('0x35')]);_0x549693[_0x1ec2('0x36')]=qs[_0x1ec2('0x2d')](_['pick'](_0x52bd4c[_0x1ec2('0x2b')],_0x3b45ed[_0x1ec2('0x2d')]),_0x2bd63d);if(_0x52bd4c['query'][_0x1ec2('0x37')]){_0x549693[_0x1ec2('0x36')]=_[_0x1ec2('0x38')](_0x549693[_0x1ec2('0x36')],{'$or':_['map'](_0x2bd63d,function(_0x26d425){if(_0x26d425[_0x1ec2('0x29')]!==_0x1ec2('0x39')){var _0x5714d3={};_0x5714d3[_0x26d425[_0x1ec2('0x27')]]={'$like':'%'+_0x52bd4c[_0x1ec2('0x2b')][_0x1ec2('0x37')]+'%'};return _0x5714d3;}})});}_0x549693=_[_0x1ec2('0x38')]({},_0x549693,_0x52bd4c['options']);var _0x56f6a1={'where':_0x549693[_0x1ec2('0x36')]};return db[_0x1ec2('0x3a')]['count'](_0x56f6a1)[_0x1ec2('0x21')](function(_0x170493){_0x418376[_0x1ec2('0x3b')]=_0x170493;if(_0x52bd4c['query'][_0x1ec2('0x3c')]){_0x549693['include']=[{'all':!![]}];}return db[_0x1ec2('0x3a')][_0x1ec2('0x3d')](_0x549693);})[_0x1ec2('0x21')](function(_0x25f56a){_0x418376[_0x1ec2('0x3e')]=_0x25f56a;return _0x418376;})['then'](respondWithFilteredResult(_0x2f5da7,_0x549693))[_0x1ec2('0x3f')](handleError(_0x2f5da7,null));};exports['show']=function(_0x11850e,_0x2564c1){var _0x1c30a5={'raw':!![],'where':{'id':_0x11850e[_0x1ec2('0x40')]['id']}},_0x25e443={};_0x25e443[_0x1ec2('0x2f')]=_[_0x1ec2('0x2c')](db[_0x1ec2('0x3a')][_0x1ec2('0x28')]);_0x25e443[_0x1ec2('0x2b')]=_['keys'](_0x11850e[_0x1ec2('0x2b')]);_0x25e443[_0x1ec2('0x2d')]=_[_0x1ec2('0x2e')](_0x25e443['model'],_0x25e443[_0x1ec2('0x2b')]);_0x1c30a5[_0x1ec2('0x31')]=_[_0x1ec2('0x2e')](_0x25e443[_0x1ec2('0x2f')],qs[_0x1ec2('0x30')](_0x11850e[_0x1ec2('0x2b')][_0x1ec2('0x30')]));_0x1c30a5[_0x1ec2('0x31')]=_0x1c30a5['attributes'][_0x1ec2('0x32')]?_0x1c30a5['attributes']:_0x25e443[_0x1ec2('0x2f')];if(_0x11850e[_0x1ec2('0x2b')][_0x1ec2('0x3c')]){_0x1c30a5[_0x1ec2('0x41')]=[{'all':!![]}];}_0x1c30a5=_['merge']({},_0x1c30a5,_0x11850e[_0x1ec2('0x42')]);return db[_0x1ec2('0x3a')][_0x1ec2('0x43')](_0x1c30a5)['then'](handleEntityNotFound(_0x2564c1,null))['then'](respondWithResult(_0x2564c1,null))[_0x1ec2('0x3f')](handleError(_0x2564c1,null));};exports['create']=function(_0x44c885,_0x4b441c){return db[_0x1ec2('0x3a')][_0x1ec2('0x44')](_0x44c885[_0x1ec2('0x45')],{})['then'](function(_0x4d5e77){var _0x309630=_0x44c885['user'][_0x1ec2('0x22')]({'plain':!![]});if(!_0x309630)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x309630['role']===_0x1ec2('0x46')){var _0x24537b=_0x4d5e77[_0x1ec2('0x22')]({'plain':!![]});var _0x5d2856='CmHopperAdditionalPhones';return db[_0x1ec2('0x47')][_0x1ec2('0x43')]({'where':{'name':_0x5d2856,'userProfileId':_0x309630[_0x1ec2('0x48')]},'raw':!![]})[_0x1ec2('0x21')](function(_0xe55d80){if(_0xe55d80&&_0xe55d80[_0x1ec2('0x49')]===0x0){return db[_0x1ec2('0x24')][_0x1ec2('0x44')]({'name':_0x24537b['name'],'resourceId':_0x24537b['id'],'type':_0xe55d80[_0x1ec2('0x27')],'sectionId':_0xe55d80['id']},{})['then'](function(){return _0x4d5e77;});}else{return _0x4d5e77;}})['catch'](function(_0x2c6383){logger[_0x1ec2('0x26')](_0x1ec2('0x4a'),_0x2c6383);throw _0x2c6383;});}return _0x4d5e77;})[_0x1ec2('0x21')](respondWithResult(_0x4b441c,0xc9))[_0x1ec2('0x3f')](handleError(_0x4b441c,null));};exports[_0x1ec2('0x20')]=function(_0x473054,_0x1ca912){if(_0x473054[_0x1ec2('0x45')]['id']){delete _0x473054[_0x1ec2('0x45')]['id'];}return db['CmHopperAdditionalPhone'][_0x1ec2('0x43')]({'where':{'id':_0x473054[_0x1ec2('0x40')]['id']}})[_0x1ec2('0x21')](handleEntityNotFound(_0x1ca912,null))[_0x1ec2('0x21')](saveUpdates(_0x473054[_0x1ec2('0x45')],null))[_0x1ec2('0x21')](respondWithResult(_0x1ca912,null))[_0x1ec2('0x3f')](handleError(_0x1ca912,null));};exports[_0x1ec2('0x25')]=function(_0x2d261d,_0x27823b){return db[_0x1ec2('0x3a')][_0x1ec2('0x43')]({'where':{'id':_0x2d261d[_0x1ec2('0x40')]['id']}})['then'](handleEntityNotFound(_0x27823b,null))['then'](removeEntity(_0x27823b,null))[_0x1ec2('0x3f')](handleError(_0x27823b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index e01e161..339b546 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 _0x7793=['util','../../config/logger','moment','path','rimraf','./cmHopperAdditionalPhone.attributes','exports','define','cm_hopper_additional_phones'];(function(_0x52c66f,_0xddd637){var _0xbe925d=function(_0x945126){while(--_0x945126){_0x52c66f['push'](_0x52c66f['shift']());}};_0xbe925d(++_0xddd637);}(_0x7793,0x120));var _0x3779=function(_0x1745c5,_0x26b692){_0x1745c5=_0x1745c5-0x0;var _0x59df37=_0x7793[_0x1745c5];return _0x59df37;};'use strict';var _=require('lodash');var util=require(_0x3779('0x0'));var logger=require(_0x3779('0x1'))('api');var moment=require(_0x3779('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3779('0x3'));var rimraf=require(_0x3779('0x4'));var config=require('../../config/environment');var attributes=require(_0x3779('0x5'));module[_0x3779('0x6')]=function(_0x59dfb7,_0x25b30d){return _0x59dfb7[_0x3779('0x7')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x3779('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc96b=['./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x339ae2,_0x5a81e0){var _0xa99395=function(_0xd02902){while(--_0xd02902){_0x339ae2['push'](_0x339ae2['shift']());}};_0xa99395(++_0x5a81e0);}(_0xc96b,0x16d));var _0xbc96=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc96b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbc96('0x0'));var util=require(_0xbc96('0x1'));var logger=require(_0xbc96('0x2'))(_0xbc96('0x3'));var moment=require(_0xbc96('0x4'));var BPromise=require(_0xbc96('0x5'));var rp=require(_0xbc96('0x6'));var fs=require('fs');var path=require(_0xbc96('0x7'));var rimraf=require(_0xbc96('0x8'));var config=require(_0xbc96('0x9'));var attributes=require(_0xbc96('0xa'));module[_0xbc96('0xb')]=function(_0x32095b,_0x555175){return _0x32095b[_0xbc96('0xc')](_0xbc96('0xd'),attributes,{'tableName':_0xbc96('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index b9c5b0f..6c8d6ae 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 _0xf93f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','then','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','SwapAdditionalPhones','ListId','duration','waitTime','scheduledat','add','minutes','isNil','phone','updatedAt','createdAt','sequelize','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf93f,0x19e));var _0xff93=function(_0x277504,_0x41a682){_0x277504=_0x277504-0x0;var _0x1ff6a0=_0xf93f[_0x277504];return _0x1ff6a0;};'use strict';var _=require(_0xff93('0x0'));var util=require(_0xff93('0x1'));var moment=require(_0xff93('0x2'));var BPromise=require(_0xff93('0x3'));var rs=require(_0xff93('0x4'));var fs=require('fs');var Redis=require(_0xff93('0x5'));var db=require(_0xff93('0x6'))['db'];var utils=require(_0xff93('0x7'));var logger=require(_0xff93('0x8'))('rpc');var config=require(_0xff93('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xff93('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x248d6d,_0x2d254a,_0x135a7d){return new BPromise(function(_0x24e805,_0x11dc93){return client[_0xff93('0xb')](_0x248d6d,_0x135a7d)['then'](function(_0x1e4718){logger[_0xff93('0xc')](_0xff93('0xd'),_0x2d254a,_0xff93('0xe'));logger[_0xff93('0xf')](_0xff93('0x10'),_0x2d254a,_0xff93('0xe'),JSON[_0xff93('0x11')](_0x1e4718));if(_0x1e4718['error']){if(_0x1e4718[_0xff93('0x12')][_0xff93('0x13')]===0x1f4){logger[_0xff93('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2d254a,_0x1e4718[_0xff93('0x12')][_0xff93('0x14')]);return _0x11dc93(_0x1e4718['error'][_0xff93('0x14')]);}logger[_0xff93('0x12')](_0xff93('0xd'),_0x2d254a,_0x1e4718[_0xff93('0x12')][_0xff93('0x14')]);return _0x24e805(_0x1e4718['error'][_0xff93('0x14')]);}else{logger[_0xff93('0xc')](_0xff93('0xd'),_0x2d254a,_0xff93('0xe'));_0x24e805(_0x1e4718[_0xff93('0x15')][_0xff93('0x14')]);}})[_0xff93('0x16')](function(_0x1e40e5){logger[_0xff93('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x2d254a,_0x1e40e5);_0x11dc93(_0x1e40e5);});});}exports[_0xff93('0x17')]=function(_0x51cbac){var _0x2b21da=this;return new Promise(function(_0x365426,_0x33092c){return db[_0xff93('0x18')][_0xff93('0x19')]({'raw':!![],'where':{'ContactId':_0x51cbac[_0xff93('0x1a')][_0xff93('0x1b')],'ListId':_0x51cbac[_0xff93('0x1a')]['ListId'],'VoiceQueueId':_0x51cbac[_0xff93('0x1a')][_0xff93('0x1c')]===undefined?null:_0x51cbac[_0xff93('0x1a')][_0xff93('0x1c')],'CampaignId':_0x51cbac[_0xff93('0x1a')][_0xff93('0x1d')]===undefined?null:_0x51cbac[_0xff93('0x1a')][_0xff93('0x1d')]}})['then'](function(_0x1c6f84){if(_0x1c6f84!=null){return db[_0xff93('0x1e')][_0xff93('0x19')]({'raw':!![],'where':{'CmHopperId':_0x1c6f84['id'],'OrderBy':{'$gt':_0x1c6f84[_0xff93('0x1f')]}},'order':[[_0xff93('0x1f'),_0xff93('0x20')]]})[_0xff93('0x21')](function(_0x2de0b4){var _0x501549=0x0;if(_0x2de0b4){if(_0x2de0b4[_0xff93('0x22')]+_0x2de0b4[_0xff93('0x23')]+_0x2de0b4[_0xff93('0x24')]+_0x2de0b4[_0xff93('0x25')]+_0x2de0b4[_0xff93('0x26')]+_0x2de0b4[_0xff93('0x27')]+_0x2de0b4[_0xff93('0x28')]+_0x2de0b4[_0xff93('0x29')]<_0x51cbac[_0xff93('0x2a')][_0xff93('0x2b')])_0x501549=0x1;_0x365426({'additional':_0x501549});}else{return db['CmHopperAdditionalPhone'][_0xff93('0x19')]({'raw':!![],'where':{'CmHopperId':_0x1c6f84['id']},'order':[[_0xff93('0x1f'),_0xff93('0x20')]]})[_0xff93('0x21')](function(_0x5903e3){var _0x2f4dec=0x0;if(_0x5903e3){if(_0x5903e3[_0xff93('0x22')]+_0x5903e3[_0xff93('0x23')]+_0x5903e3[_0xff93('0x24')]+_0x5903e3['countnosuchnumberretry']+_0x5903e3[_0xff93('0x26')]+_0x5903e3[_0xff93('0x27')]+_0x5903e3[_0xff93('0x28')]+_0x5903e3[_0xff93('0x29')]<_0x51cbac[_0xff93('0x2a')][_0xff93('0x2b')])_0x2f4dec=0x1;_0x365426({'additional':_0x2f4dec});}else{_0x365426({'additional':0x0});}})[_0xff93('0x16')](function(_0x367d10){logger[_0xff93('0x12')]('VerifyAdditionalPhones',_0x367d10[_0xff93('0x14')]);_0x33092c(_0x2b21da['error'](0x1f4,_0x367d10[_0xff93('0x14')]));});}})[_0xff93('0x16')](function(_0x2f45eb){logger[_0xff93('0x12')](_0xff93('0x17'),_0x2f45eb[_0xff93('0x14')]);_0x33092c(_0x2b21da['error'](0x1f4,_0x2f45eb[_0xff93('0x14')]));});}else _0x365426({'additional':0x0});});});};exports[_0xff93('0x2c')]=function(_0xbd8081){var _0x588c80=this;return new Promise(function(_0x25477d,_0x91c921){return db[_0xff93('0x18')][_0xff93('0x19')]({'raw':!![],'where':{'ContactId':_0xbd8081[_0xff93('0x1a')][_0xff93('0x1b')],'ListId':_0xbd8081['body'][_0xff93('0x2d')],'VoiceQueueId':_0xbd8081[_0xff93('0x1a')][_0xff93('0x1c')]===undefined?null:_0xbd8081['body'][_0xff93('0x1c')],'CampaignId':_0xbd8081[_0xff93('0x1a')][_0xff93('0x1d')]===undefined?null:_0xbd8081['body']['CampaignId']}})[_0xff93('0x21')](function(_0x1c4826){if(_0x1c4826!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x1c4826['id'],'OrderBy':{'$gte':_0x1c4826[_0xff93('0x1f')]}},'order':[[_0xff93('0x1f'),'ASC']]})[_0xff93('0x21')](function(_0x1cdf87){if(_0x1cdf87)return activateAdditionalPhone(_0x1c4826,_0xbd8081['body'],_0x1cdf87,_0xbd8081[_0xff93('0x2e')],_0xbd8081[_0xff93('0x2f')])['then'](function(_0x511b02){_0x25477d(_0x511b02);});else{return db[_0xff93('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x1c4826['id']},'order':[[_0xff93('0x1f'),_0xff93('0x20')]]})[_0xff93('0x21')](function(_0x1fdcd1){if(_0x1fdcd1)return activateAdditionalPhone(_0x1c4826,_0xbd8081[_0xff93('0x1a')],_0x1fdcd1,_0xbd8081[_0xff93('0x2e')],_0xbd8081[_0xff93('0x2f')])['then'](function(_0x5c8b84){_0x25477d(_0x5c8b84);});else{_0x25477d({'id':_0x1c4826['id'],'phone':''});}})[_0xff93('0x16')](function(_0x425e21){logger[_0xff93('0x12')](_0xff93('0x17'),_0x425e21['message']);_0x91c921(_0x588c80[_0xff93('0x12')](0x1f4,_0x425e21[_0xff93('0x14')]));});}})['catch'](function(_0x1bf99b){logger['error'](_0xff93('0x17'),_0x1bf99b[_0xff93('0x14')]);_0x91c921(_0x588c80[_0xff93('0x12')](0x1f4,_0x1bf99b[_0xff93('0x14')]));});}else _0x25477d(0x1);});});};function activateAdditionalPhone(_0x48ab33,_0x3402e7,_0x51e762,_0x55e1be,_0x5a1102){return new Promise(function(_0x10a929,_0xa99d03){var _0x42246c;if(_['isNil'](_0x51e762['scheduledat'])){_0x51e762[_0xff93('0x30')]=moment();}if(moment()>moment(_0x51e762['scheduledat'])){_0x42246c=moment()[_0xff93('0x31')](_0x5a1102||0x3,_0xff93('0x32'));}else{if(_0x51e762[_0xff93('0x1f')]==0x0){_0x42246c=moment(_0x51e762[_0xff93('0x30')]);}else{_0x42246c=moment()[_0xff93('0x31')](_0x5a1102||0x3,_0xff93('0x32'));}}if(_[_0xff93('0x33')](_0x42246c)){_0x42246c=moment()[_0xff93('0x31')](_0x5a1102||0x3,_0xff93('0x32'));}var _0x2e218a={'phone':_0x48ab33[_0xff93('0x34')],'active':0x0,'OrderBy':_[_0xff93('0x33')](_0x48ab33['OrderBy'])?0x0:_0x48ab33['OrderBy'],'scheduledat':moment()['add'](_0x55e1be||0x1,'minutes'),'countbusyretry':_0x3402e7[_0xff93('0x22')],'countcongestionretry':_0x3402e7[_0xff93('0x23')],'countnoanswerretry':_0x3402e7[_0xff93('0x24')],'countnosuchnumberretry':_0x3402e7['countnosuchnumberretry'],'countdropretry':_0x3402e7['countdropretry'],'countabandonedretry':_0x3402e7[_0xff93('0x27')],'countmachineretry':_0x3402e7['countmachineretry'],'countagentrejectretry':_0x3402e7[_0xff93('0x29')],'createdAt':_0x3402e7['createdAt'],'updatedAt':_0x3402e7[_0xff93('0x35')]};var _0x130cdc={'CmHopperId':_0x48ab33['id'],'phone':_0x51e762['phone'],'active':0x0,'OrderBy':_[_0xff93('0x33')](_0x51e762['OrderBy'])?0x0:_0x51e762['OrderBy'],'scheduledat':_0x42246c,'countbusyretry':_0x51e762['countbusyretry'],'countcongestionretry':_0x51e762['countcongestionretry'],'countnoanswerretry':_0x51e762[_0xff93('0x24')],'countnosuchnumberretry':_0x51e762[_0xff93('0x25')],'countdropretry':_0x51e762[_0xff93('0x26')],'countabandonedretry':_0x51e762[_0xff93('0x27')],'countmachineretry':_0x51e762[_0xff93('0x28')],'countagentrejectretry':_0x51e762[_0xff93('0x29')],'createdAt':_0x51e762[_0xff93('0x36')],'updatedAt':_0x51e762[_0xff93('0x35')]};return db[_0xff93('0x37')]['transaction'](function(_0x3b669b){return db['CmHopperAdditionalPhone'][_0xff93('0x38')](_0x2e218a,{'where':{'id':_0x51e762['id']}},{'transaction':_0x3b669b})['then'](function(){return db[_0xff93('0x18')]['update'](_0x130cdc,{'where':{'id':_0x48ab33['id']}},{'transaction':_0x3b669b});});})[_0xff93('0x21')](function(_0x4f9e69){_0x10a929({'id':_0x48ab33['id'],'phone':_0x51e762[_0xff93('0x34')]});})[_0xff93('0x16')](function(_0x4b076a){logger[_0xff93('0x12')](_0xff93('0x39'),_0x4b076a['message']);_0xa99d03({'error':_0x4b076a[_0xff93('0x14')]});});});}exports[_0xff93('0x3a')]=function(_0x27db4a){var _0x477e77=this;return new Promise(function(_0x530dc3,_0x4c660b){return db[_0xff93('0x18')][_0xff93('0x38')](_0x27db4a[_0xff93('0x1a')][_0xff93('0x3b')],{'where':{'id':_0x27db4a[_0xff93('0x1a')]['id']}})[_0xff93('0x21')](function(_0x10e991){_0x530dc3(_0x10e991);})[_0xff93('0x16')](function(_0x46b37b){logger[_0xff93('0x12')](_0xff93('0x3a'),_0x46b37b[_0xff93('0x14')]);_0x4c660b(_0x477e77['error'](0x1f4,_0x46b37b['message']));});});}; \ No newline at end of file +var _0x1ed7=['createdAt','sequelize','transaction','update','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperAdditionalPhone,\x20%s,\x20%s','catch','findOne','body','ContactId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','countbusyretry','countcongestionretry','countmachineretry','entity','VerifyAdditionalPhones','CmHopper','duration','waitTime','isNil','scheduledat','add','minutes','phone','updatedAt'];(function(_0x4f98e5,_0x392e13){var _0x39cfdf=function(_0x3817ba){while(--_0x3817ba){_0x4f98e5['push'](_0x4f98e5['shift']());}};_0x39cfdf(++_0x392e13);}(_0x1ed7,0x6e));var _0x71ed=function(_0x10b315,_0x19d704){_0x10b315=_0x10b315-0x0;var _0x1200cf=_0x1ed7[_0x10b315];return _0x1200cf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x71ed('0x0'));var rs=require(_0x71ed('0x1'));var fs=require('fs');var Redis=require(_0x71ed('0x2'));var db=require(_0x71ed('0x3'))['db'];var utils=require(_0x71ed('0x4'));var logger=require('../../config/logger')(_0x71ed('0x5'));var config=require(_0x71ed('0x6'));var jayson=require(_0x71ed('0x7'));var client=jayson[_0x71ed('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x572ad8,_0x159d75,_0x1eaefe){return new BPromise(function(_0x1dfb6d,_0x3eedbe){return client[_0x71ed('0x9')](_0x572ad8,_0x1eaefe)[_0x71ed('0xa')](function(_0x585943){logger[_0x71ed('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x159d75,_0x71ed('0xc'));logger[_0x71ed('0xd')](_0x71ed('0xe'),_0x159d75,_0x71ed('0xc'),JSON[_0x71ed('0xf')](_0x585943));if(_0x585943[_0x71ed('0x10')]){if(_0x585943[_0x71ed('0x10')][_0x71ed('0x11')]===0x1f4){logger[_0x71ed('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x159d75,_0x585943[_0x71ed('0x10')][_0x71ed('0x12')]);return _0x3eedbe(_0x585943[_0x71ed('0x10')][_0x71ed('0x12')]);}logger['error'](_0x71ed('0x13'),_0x159d75,_0x585943[_0x71ed('0x10')]['message']);return _0x1dfb6d(_0x585943['error'][_0x71ed('0x12')]);}else{logger[_0x71ed('0xb')](_0x71ed('0x13'),_0x159d75,_0x71ed('0xc'));_0x1dfb6d(_0x585943['result'][_0x71ed('0x12')]);}})[_0x71ed('0x14')](function(_0x531d6f){logger[_0x71ed('0x10')](_0x71ed('0x13'),_0x159d75,_0x531d6f);_0x3eedbe(_0x531d6f);});});}exports['VerifyAdditionalPhones']=function(_0x4a9f42){var _0x5e1fd6=this;return new Promise(function(_0x1ce561,_0x3aebfa){return db['CmHopper'][_0x71ed('0x15')]({'raw':!![],'where':{'ContactId':_0x4a9f42[_0x71ed('0x16')][_0x71ed('0x17')],'ListId':_0x4a9f42[_0x71ed('0x16')]['ListId'],'VoiceQueueId':_0x4a9f42[_0x71ed('0x16')]['VoiceQueueId']===undefined?null:_0x4a9f42[_0x71ed('0x16')][_0x71ed('0x18')],'CampaignId':_0x4a9f42['body']['CampaignId']===undefined?null:_0x4a9f42[_0x71ed('0x16')][_0x71ed('0x19')]}})[_0x71ed('0xa')](function(_0x5a1c85){if(_0x5a1c85!=null){return db[_0x71ed('0x1a')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x5a1c85['id'],'OrderBy':{'$gt':_0x5a1c85[_0x71ed('0x1b')]}},'order':[[_0x71ed('0x1b'),_0x71ed('0x1c')]]})[_0x71ed('0xa')](function(_0x2c00f5){var _0xe974cc=0x0;if(_0x2c00f5){if(_0x2c00f5['countbusyretry']+_0x2c00f5['countcongestionretry']+_0x2c00f5[_0x71ed('0x1d')]+_0x2c00f5[_0x71ed('0x1e')]+_0x2c00f5[_0x71ed('0x1f')]+_0x2c00f5[_0x71ed('0x20')]+_0x2c00f5['countmachineretry']+_0x2c00f5[_0x71ed('0x21')]<_0x4a9f42['entity'][_0x71ed('0x22')])_0xe974cc=0x1;_0x1ce561({'additional':_0xe974cc});}else{return db['CmHopperAdditionalPhone'][_0x71ed('0x15')]({'raw':!![],'where':{'CmHopperId':_0x5a1c85['id']},'order':[[_0x71ed('0x1b'),'ASC']]})['then'](function(_0x26cdcf){var _0xff59b8=0x0;if(_0x26cdcf){if(_0x26cdcf[_0x71ed('0x23')]+_0x26cdcf[_0x71ed('0x24')]+_0x26cdcf['countnoanswerretry']+_0x26cdcf['countnosuchnumberretry']+_0x26cdcf[_0x71ed('0x1f')]+_0x26cdcf['countabandonedretry']+_0x26cdcf[_0x71ed('0x25')]+_0x26cdcf['countagentrejectretry']<_0x4a9f42[_0x71ed('0x26')][_0x71ed('0x22')])_0xff59b8=0x1;_0x1ce561({'additional':_0xff59b8});}else{_0x1ce561({'additional':0x0});}})[_0x71ed('0x14')](function(_0x33eb53){logger['error'](_0x71ed('0x27'),_0x33eb53[_0x71ed('0x12')]);_0x3aebfa(_0x5e1fd6['error'](0x1f4,_0x33eb53[_0x71ed('0x12')]));});}})[_0x71ed('0x14')](function(_0x46d80b){logger[_0x71ed('0x10')](_0x71ed('0x27'),_0x46d80b[_0x71ed('0x12')]);_0x3aebfa(_0x5e1fd6[_0x71ed('0x10')](0x1f4,_0x46d80b[_0x71ed('0x12')]));});}else _0x1ce561({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x2453ed){var _0x370a01=this;return new Promise(function(_0x654dd,_0x4a5001){return db[_0x71ed('0x28')][_0x71ed('0x15')]({'raw':!![],'where':{'ContactId':_0x2453ed[_0x71ed('0x16')]['ContactId'],'ListId':_0x2453ed[_0x71ed('0x16')]['ListId'],'VoiceQueueId':_0x2453ed['body'][_0x71ed('0x18')]===undefined?null:_0x2453ed[_0x71ed('0x16')][_0x71ed('0x18')],'CampaignId':_0x2453ed['body'][_0x71ed('0x19')]===undefined?null:_0x2453ed[_0x71ed('0x16')][_0x71ed('0x19')]}})[_0x71ed('0xa')](function(_0x5308d1){if(_0x5308d1!=null){return db[_0x71ed('0x1a')][_0x71ed('0x15')]({'raw':!![],'where':{'CmHopperId':_0x5308d1['id'],'OrderBy':{'$gte':_0x5308d1[_0x71ed('0x1b')]}},'order':[[_0x71ed('0x1b'),'ASC']]})['then'](function(_0x53a9a5){if(_0x53a9a5)return activateAdditionalPhone(_0x5308d1,_0x2453ed[_0x71ed('0x16')],_0x53a9a5,_0x2453ed[_0x71ed('0x29')],_0x2453ed[_0x71ed('0x2a')])[_0x71ed('0xa')](function(_0x3b2002){_0x654dd(_0x3b2002);});else{return db[_0x71ed('0x1a')][_0x71ed('0x15')]({'raw':!![],'where':{'CmHopperId':_0x5308d1['id']},'order':[['OrderBy','ASC']]})[_0x71ed('0xa')](function(_0x301fde){if(_0x301fde)return activateAdditionalPhone(_0x5308d1,_0x2453ed[_0x71ed('0x16')],_0x301fde,_0x2453ed[_0x71ed('0x29')],_0x2453ed[_0x71ed('0x2a')])['then'](function(_0x1aca84){_0x654dd(_0x1aca84);});else{_0x654dd({'id':_0x5308d1['id'],'phone':''});}})[_0x71ed('0x14')](function(_0x5c8633){logger[_0x71ed('0x10')](_0x71ed('0x27'),_0x5c8633[_0x71ed('0x12')]);_0x4a5001(_0x370a01[_0x71ed('0x10')](0x1f4,_0x5c8633[_0x71ed('0x12')]));});}})[_0x71ed('0x14')](function(_0x1baa77){logger[_0x71ed('0x10')](_0x71ed('0x27'),_0x1baa77[_0x71ed('0x12')]);_0x4a5001(_0x370a01['error'](0x1f4,_0x1baa77[_0x71ed('0x12')]));});}else _0x654dd(0x1);});});};function activateAdditionalPhone(_0x5a2312,_0x268452,_0x32bb0a,_0x152043,_0x530645){return new Promise(function(_0x18d389,_0x2fb2e1){var _0x5a3ae3;if(_[_0x71ed('0x2b')](_0x32bb0a[_0x71ed('0x2c')])){_0x32bb0a['scheduledat']=moment();}if(moment()>moment(_0x32bb0a[_0x71ed('0x2c')])){_0x5a3ae3=moment()[_0x71ed('0x2d')](_0x530645||0x3,'minutes');}else{if(_0x32bb0a[_0x71ed('0x1b')]==0x0){_0x5a3ae3=moment(_0x32bb0a[_0x71ed('0x2c')]);}else{_0x5a3ae3=moment()['add'](_0x530645||0x3,_0x71ed('0x2e'));}}if(_['isNil'](_0x5a3ae3)){_0x5a3ae3=moment()['add'](_0x530645||0x3,'minutes');}var _0x147d04={'phone':_0x5a2312[_0x71ed('0x2f')],'active':0x0,'OrderBy':_[_0x71ed('0x2b')](_0x5a2312['OrderBy'])?0x0:_0x5a2312[_0x71ed('0x1b')],'scheduledat':moment()[_0x71ed('0x2d')](_0x152043||0x1,_0x71ed('0x2e')),'countbusyretry':_0x268452[_0x71ed('0x23')],'countcongestionretry':_0x268452[_0x71ed('0x24')],'countnoanswerretry':_0x268452[_0x71ed('0x1d')],'countnosuchnumberretry':_0x268452[_0x71ed('0x1e')],'countdropretry':_0x268452['countdropretry'],'countabandonedretry':_0x268452[_0x71ed('0x20')],'countmachineretry':_0x268452[_0x71ed('0x25')],'countagentrejectretry':_0x268452[_0x71ed('0x21')],'createdAt':_0x268452['createdAt'],'updatedAt':_0x268452[_0x71ed('0x30')]};var _0x15ba45={'CmHopperId':_0x5a2312['id'],'phone':_0x32bb0a['phone'],'active':0x0,'OrderBy':_[_0x71ed('0x2b')](_0x32bb0a['OrderBy'])?0x0:_0x32bb0a[_0x71ed('0x1b')],'scheduledat':_0x5a3ae3,'countbusyretry':_0x32bb0a['countbusyretry'],'countcongestionretry':_0x32bb0a[_0x71ed('0x24')],'countnoanswerretry':_0x32bb0a['countnoanswerretry'],'countnosuchnumberretry':_0x32bb0a[_0x71ed('0x1e')],'countdropretry':_0x32bb0a[_0x71ed('0x1f')],'countabandonedretry':_0x32bb0a['countabandonedretry'],'countmachineretry':_0x32bb0a['countmachineretry'],'countagentrejectretry':_0x32bb0a[_0x71ed('0x21')],'createdAt':_0x32bb0a[_0x71ed('0x31')],'updatedAt':_0x32bb0a[_0x71ed('0x30')]};return db[_0x71ed('0x32')][_0x71ed('0x33')](function(_0x3d60b9){return db[_0x71ed('0x1a')][_0x71ed('0x34')](_0x147d04,{'where':{'id':_0x32bb0a['id']}},{'transaction':_0x3d60b9})[_0x71ed('0xa')](function(){return db['CmHopper'][_0x71ed('0x34')](_0x15ba45,{'where':{'id':_0x5a2312['id']}},{'transaction':_0x3d60b9});});})[_0x71ed('0xa')](function(_0x5749e2){_0x18d389({'id':_0x5a2312['id'],'phone':_0x32bb0a[_0x71ed('0x2f')]});})[_0x71ed('0x14')](function(_0x28533c){logger[_0x71ed('0x10')]('activateAdditionalPhone',_0x28533c[_0x71ed('0x12')]);_0x2fb2e1({'error':_0x28533c['message']});});});}exports['IncrementPreviewCounters']=function(_0x112608){var _0x13e64d=this;return new Promise(function(_0x174e48,_0x2d9b76){return db[_0x71ed('0x28')][_0x71ed('0x34')](_0x112608[_0x71ed('0x16')]['field'],{'where':{'id':_0x112608['body']['id']}})['then'](function(_0x10453b){_0x174e48(_0x10453b);})['catch'](function(_0x542fa2){logger['error']('IncrementPreviewCounters',_0x542fa2[_0x71ed('0x12')]);_0x2d9b76(_0x13e64d[_0x71ed('0x10')](0x1f4,_0x542fa2['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index c5d81a4..c386ea7 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 _0xa953=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','create','delete','destroy','exports'];(function(_0x35c86f,_0x399bc4){var _0x28c841=function(_0x13a582){while(--_0x13a582){_0x35c86f['push'](_0x35c86f['shift']());}};_0x28c841(++_0x399bc4);}(_0xa953,0x1d0));var _0x3a95=function(_0x53f218,_0x27514c){_0x53f218=_0x53f218-0x0;var _0x21890a=_0xa953[_0x53f218];return _0x21890a;};'use strict';var multer=require(_0x3a95('0x0'));var util=require(_0x3a95('0x1'));var path=require(_0x3a95('0x2'));var timeout=require(_0x3a95('0x3'));var express=require('express');var router=express[_0x3a95('0x4')]();var fs_extra=require(_0x3a95('0x5'));var auth=require(_0x3a95('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperAdditionalPhone.controller');router[_0x3a95('0x7')]('/',auth[_0x3a95('0x8')](),controller[_0x3a95('0x9')]);router[_0x3a95('0x7')](_0x3a95('0xa'),auth[_0x3a95('0x8')](),controller[_0x3a95('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3a95('0xc')]);router['put']('/:id',auth[_0x3a95('0x8')](),controller['update']);router[_0x3a95('0xd')](_0x3a95('0xa'),auth['isAuthenticated'](),controller[_0x3a95('0xe')]);module[_0x3a95('0xf')]=router; \ No newline at end of file +var _0x1d6a=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','show','post','create','delete','destroy'];(function(_0x9a5b2a,_0x2f6b38){var _0x543904=function(_0x1665f1){while(--_0x1665f1){_0x9a5b2a['push'](_0x9a5b2a['shift']());}};_0x543904(++_0x2f6b38);}(_0x1d6a,0x190));var _0xa1d6=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x1d6a[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0xa1d6('0x0'));var path=require(_0xa1d6('0x1'));var timeout=require(_0xa1d6('0x2'));var express=require('express');var router=express[_0xa1d6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa1d6('0x4'));var interaction=require(_0xa1d6('0x5'));var config=require(_0xa1d6('0x6'));var controller=require(_0xa1d6('0x7'));router[_0xa1d6('0x8')]('/',auth[_0xa1d6('0x9')](),controller['index']);router[_0xa1d6('0x8')](_0xa1d6('0xa'),auth['isAuthenticated'](),controller[_0xa1d6('0xb')]);router[_0xa1d6('0xc')]('/',auth[_0xa1d6('0x9')](),controller[_0xa1d6('0xd')]);router['put'](_0xa1d6('0xa'),auth[_0xa1d6('0x9')](),controller['update']);router[_0xa1d6('0xe')](_0xa1d6('0xa'),auth[_0xa1d6('0x9')](),controller[_0xa1d6('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 4e46479..1a9fc72 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 _0xa680=['moment','sequelize','INTEGER','contactListQueue'];(function(_0x5c95c2,_0x4f7869){var _0x1e51fb=function(_0x2e18ab){while(--_0x2e18ab){_0x5c95c2['push'](_0x5c95c2['shift']());}};_0x1e51fb(++_0x4f7869);}(_0xa680,0xb0));var _0x0a68=function(_0x5b5020,_0x3fecf0){_0x5b5020=_0x5b5020-0x0;var _0x232f09=_0xa680[_0x5b5020];return _0x232f09;};'use strict';var moment=require(_0x0a68('0x0'));var Sequelize=require(_0x0a68('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0a68('0x2')],'unique':_0x0a68('0x3')},'ListId':{'type':Sequelize[_0x0a68('0x2')],'unique':_0x0a68('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x0a68('0x3')}}; \ No newline at end of file +var _0xbfe8=['contactListQueue','sequelize','STRING','INTEGER'];(function(_0x29daac,_0x3067e2){var _0x1f337f=function(_0x1b49cd){while(--_0x1b49cd){_0x29daac['push'](_0x29daac['shift']());}};_0x1f337f(++_0x3067e2);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x35d8ef,_0x697773){_0x35d8ef=_0x35d8ef-0x0;var _0x4181ea=_0xbfe8[_0x35d8ef];return _0x4181ea;};'use strict';var moment=require('moment');var Sequelize=require(_0x8bfe('0x0'));module['exports']={'phone':{'type':Sequelize[_0x8bfe('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x8bfe('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x8bfe('0x3')},'VoiceQueueId':{'type':Sequelize[_0x8bfe('0x2')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index ab03720..2b705a8 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 _0xb7ae=['include','find','body','params','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','show'];(function(_0x44ab75,_0xc707dd){var _0x4f872a=function(_0x31aa4d){while(--_0x31aa4d){_0x44ab75['push'](_0x44ab75['shift']());}};_0x4f872a(++_0xc707dd);}(_0xb7ae,0xf3));var _0xeb7a=function(_0xe98c78,_0xdd66de){_0xe98c78=_0xe98c78-0x0;var _0xb81929=_0xb7ae[_0xe98c78];return _0xb81929;};'use strict';var emlformat=require(_0xeb7a('0x0'));var rimraf=require(_0xeb7a('0x1'));var zipdir=require(_0xeb7a('0x2'));var jsonpatch=require(_0xeb7a('0x3'));var rp=require(_0xeb7a('0x4'));var moment=require('moment');var BPromise=require(_0xeb7a('0x5'));var Mustache=require(_0xeb7a('0x6'));var util=require(_0xeb7a('0x7'));var path=require('path');var sox=require(_0xeb7a('0x8'));var csv=require(_0xeb7a('0x9'));var ejs=require(_0xeb7a('0xa'));var fs=require('fs');var fs_extra=require(_0xeb7a('0xb'));var _=require(_0xeb7a('0xc'));var squel=require('squel');var crypto=require(_0xeb7a('0xd'));var jsforce=require(_0xeb7a('0xe'));var deskjs=require(_0xeb7a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xeb7a('0x10'));var Papa=require(_0xeb7a('0x11'));var Redis=require(_0xeb7a('0x12'));var authService=require(_0xeb7a('0x13'));var qs=require(_0xeb7a('0x14'));var as=require(_0xeb7a('0x15'));var hardwareService=require(_0xeb7a('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xeb7a('0x17'));var config=require(_0xeb7a('0x18'));var licenseUtil=require(_0xeb7a('0x19'));var db=require(_0xeb7a('0x1a'))['db'];function respondWithStatusCode(_0x13bcf4,_0x203723){_0x203723=_0x203723||0xcc;return function(_0x166e4d){if(_0x166e4d){return _0x13bcf4['sendStatus'](_0x203723);}return _0x13bcf4[_0xeb7a('0x1b')](_0x203723)[_0xeb7a('0x1c')]();};}function respondWithResult(_0x4e86a7,_0x110acb){_0x110acb=_0x110acb||0xc8;return function(_0x186ea3){if(_0x186ea3){return _0x4e86a7['status'](_0x110acb)[_0xeb7a('0x1d')](_0x186ea3);}};}function respondWithFilteredResult(_0x5db84f,_0x5d953f){return function(_0x388666){if(_0x388666){var _0x5e6256=typeof _0x5d953f['offset']===_0xeb7a('0x1e')&&typeof _0x5d953f[_0xeb7a('0x1f')]===_0xeb7a('0x1e');var _0x2d92c7=_0x388666['count'];var _0x4be13e=_0x5e6256?0x0:_0x5d953f[_0xeb7a('0x20')];var _0x26bd85=_0x5e6256?_0x388666['count']:_0x5d953f['offset']+_0x5d953f[_0xeb7a('0x1f')];var _0x25a399;if(_0x26bd85>=_0x2d92c7){_0x26bd85=_0x2d92c7;_0x25a399=0xc8;}else{_0x25a399=0xce;}_0x5db84f[_0xeb7a('0x1b')](_0x25a399);return _0x5db84f[_0xeb7a('0x21')](_0xeb7a('0x22'),_0x4be13e+'-'+_0x26bd85+'/'+_0x2d92c7)[_0xeb7a('0x1d')](_0x388666);}return null;};}function patchUpdates(_0x29fa3f){return function(_0x120128){try{jsonpatch['apply'](_0x120128,_0x29fa3f,!![]);}catch(_0x431d4a){return BPromise[_0xeb7a('0x23')](_0x431d4a);}return _0x120128['save']();};}function saveUpdates(_0x5af915,_0xeab362){return function(_0x434aac){if(_0x434aac){return _0x434aac[_0xeb7a('0x24')](_0x5af915)[_0xeb7a('0x25')](function(_0x29db91){return _0x29db91;});}return null;};}function removeEntity(_0x44cefc,_0xfb62a5){return function(_0x4c4816){if(_0x4c4816){return _0x4c4816[_0xeb7a('0x26')]()[_0xeb7a('0x25')](function(){_0x44cefc[_0xeb7a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10b7d3,_0x1cf8f6){return function(_0x182335){if(!_0x182335){_0x10b7d3[_0xeb7a('0x27')](0x194);}return _0x182335;};}function handleError(_0x53ade4,_0x15199a){_0x15199a=_0x15199a||0x1f4;return function(_0x52e882){logger[_0xeb7a('0x28')](_0x52e882[_0xeb7a('0x29')]);if(_0x52e882[_0xeb7a('0x2a')]){delete _0x52e882[_0xeb7a('0x2a')];}_0x53ade4[_0xeb7a('0x1b')](_0x15199a)[_0xeb7a('0x2b')](_0x52e882);};}exports[_0xeb7a('0x2c')]=function(_0x3917eb,_0x2a492f){var _0x20a197={},_0x2d2f9f={},_0x567bbe={'count':0x0,'rows':[]};var _0x34b88b=_[_0xeb7a('0x2d')](db[_0xeb7a('0x2e')][_0xeb7a('0x2f')],function(_0x14e2e1){return{'name':_0x14e2e1[_0xeb7a('0x30')],'type':_0x14e2e1[_0xeb7a('0x31')][_0xeb7a('0x32')]};});_0x2d2f9f[_0xeb7a('0x33')]=_[_0xeb7a('0x2d')](_0x34b88b,_0xeb7a('0x2a'));_0x2d2f9f['query']=_[_0xeb7a('0x34')](_0x3917eb[_0xeb7a('0x35')]);_0x2d2f9f[_0xeb7a('0x36')]=_[_0xeb7a('0x37')](_0x2d2f9f['model'],_0x2d2f9f[_0xeb7a('0x35')]);_0x20a197[_0xeb7a('0x38')]=_[_0xeb7a('0x37')](_0x2d2f9f[_0xeb7a('0x33')],qs[_0xeb7a('0x39')](_0x3917eb[_0xeb7a('0x35')]['fields']));_0x20a197[_0xeb7a('0x38')]=_0x20a197[_0xeb7a('0x38')][_0xeb7a('0x3a')]?_0x20a197[_0xeb7a('0x38')]:_0x2d2f9f[_0xeb7a('0x33')];if(!_0x3917eb[_0xeb7a('0x35')]['hasOwnProperty'](_0xeb7a('0x3b'))){_0x20a197['limit']=qs[_0xeb7a('0x1f')](_0x3917eb[_0xeb7a('0x35')]['limit']);_0x20a197[_0xeb7a('0x20')]=qs[_0xeb7a('0x20')](_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x20')]);}_0x20a197[_0xeb7a('0x3c')]=qs[_0xeb7a('0x3d')](_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x3d')]);_0x20a197['where']=qs[_0xeb7a('0x36')](_[_0xeb7a('0x3e')](_0x3917eb['query'],_0x2d2f9f[_0xeb7a('0x36')]),_0x34b88b);if(_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x3f')]){_0x20a197[_0xeb7a('0x40')]=_[_0xeb7a('0x41')](_0x20a197[_0xeb7a('0x40')],{'$or':_[_0xeb7a('0x2d')](_0x34b88b,function(_0x573e30){if(_0x573e30[_0xeb7a('0x31')]!==_0xeb7a('0x42')){var _0x308a2e={};_0x308a2e[_0x573e30[_0xeb7a('0x2a')]]={'$like':'%'+_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x3f')]+'%'};return _0x308a2e;}})});}_0x20a197=_[_0xeb7a('0x41')]({},_0x20a197,_0x3917eb[_0xeb7a('0x43')]);var _0x414580={'where':_0x20a197[_0xeb7a('0x40')]};return db[_0xeb7a('0x2e')][_0xeb7a('0x44')](_0x414580)['then'](function(_0x2d3d4d){_0x567bbe[_0xeb7a('0x44')]=_0x2d3d4d;if(_0x3917eb[_0xeb7a('0x35')][_0xeb7a('0x45')]){_0x20a197['include']=[{'all':!![]}];}return db[_0xeb7a('0x2e')][_0xeb7a('0x46')](_0x20a197);})[_0xeb7a('0x25')](function(_0x1803d6){_0x567bbe[_0xeb7a('0x47')]=_0x1803d6;return _0x567bbe;})[_0xeb7a('0x25')](respondWithFilteredResult(_0x2a492f,_0x20a197))['catch'](handleError(_0x2a492f,null));};exports[_0xeb7a('0x48')]=function(_0x1b1575,_0x48d620){var _0x436346={'raw':!![],'where':{'id':_0x1b1575['params']['id']}},_0x58c004={};_0x58c004['model']=_[_0xeb7a('0x34')](db[_0xeb7a('0x2e')][_0xeb7a('0x2f')]);_0x58c004[_0xeb7a('0x35')]=_[_0xeb7a('0x34')](_0x1b1575[_0xeb7a('0x35')]);_0x58c004['filters']=_['intersection'](_0x58c004[_0xeb7a('0x33')],_0x58c004['query']);_0x436346[_0xeb7a('0x38')]=_[_0xeb7a('0x37')](_0x58c004[_0xeb7a('0x33')],qs[_0xeb7a('0x39')](_0x1b1575['query'][_0xeb7a('0x39')]));_0x436346[_0xeb7a('0x38')]=_0x436346[_0xeb7a('0x38')][_0xeb7a('0x3a')]?_0x436346['attributes']:_0x58c004[_0xeb7a('0x33')];if(_0x1b1575['query'][_0xeb7a('0x45')]){_0x436346[_0xeb7a('0x49')]=[{'all':!![]}];}_0x436346=_[_0xeb7a('0x41')]({},_0x436346,_0x1b1575[_0xeb7a('0x43')]);return db[_0xeb7a('0x2e')][_0xeb7a('0x4a')](_0x436346)[_0xeb7a('0x25')](handleEntityNotFound(_0x48d620,null))['then'](respondWithResult(_0x48d620,null))['catch'](handleError(_0x48d620,null));};exports[_0xeb7a('0x24')]=function(_0x3d48c8,_0x18c60f){if(_0x3d48c8[_0xeb7a('0x4b')]['id']){delete _0x3d48c8[_0xeb7a('0x4b')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x3d48c8[_0xeb7a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x18c60f,null))[_0xeb7a('0x25')](saveUpdates(_0x3d48c8[_0xeb7a('0x4b')],null))[_0xeb7a('0x25')](respondWithResult(_0x18c60f,null))[_0xeb7a('0x4d')](handleError(_0x18c60f,null));};exports[_0xeb7a('0x26')]=function(_0x287a18,_0x327f7c){return db[_0xeb7a('0x2e')][_0xeb7a('0x4a')]({'where':{'id':_0x287a18[_0xeb7a('0x4c')]['id']}})[_0xeb7a('0x25')](handleEntityNotFound(_0x327f7c,null))[_0xeb7a('0x25')](removeEntity(_0x327f7c,null))[_0xeb7a('0x4d')](handleError(_0x327f7c,null));};exports[_0xeb7a('0x4e')]=function(_0x55eb50,_0x46c1c8){return db[_0xeb7a('0x2e')][_0xeb7a('0x4e')]()[_0xeb7a('0x25')](respondWithResult(_0x46c1c8,null))[_0xeb7a('0x4d')](handleError(_0x46c1c8,null));}; \ No newline at end of file +var _0x0664=['offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','CmHopperBlack','rawAttributes','type','map','query','keys','filters','model','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','params','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x1626df,_0x138073){var _0x3afb4a=function(_0x31e5c5){while(--_0x31e5c5){_0x1626df['push'](_0x1626df['shift']());}};_0x3afb4a(++_0x138073);}(_0x0664,0x14f));var _0x4066=function(_0x2bc0b4,_0x1dc80d){_0x2bc0b4=_0x2bc0b4-0x0;var _0x19b4b9=_0x0664[_0x2bc0b4];return _0x19b4b9;};'use strict';var emlformat=require(_0x4066('0x0'));var rimraf=require(_0x4066('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4066('0x2'));var rp=require(_0x4066('0x3'));var moment=require('moment');var BPromise=require(_0x4066('0x4'));var Mustache=require('mustache');var util=require(_0x4066('0x5'));var path=require(_0x4066('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4066('0x7'));var fs=require('fs');var fs_extra=require(_0x4066('0x8'));var _=require(_0x4066('0x9'));var squel=require(_0x4066('0xa'));var crypto=require(_0x4066('0xb'));var jsforce=require(_0x4066('0xc'));var deskjs=require(_0x4066('0xd'));var toCsv=require(_0x4066('0xe'));var querystring=require('querystring');var Papa=require(_0x4066('0xf'));var Redis=require(_0x4066('0x10'));var authService=require(_0x4066('0x11'));var qs=require(_0x4066('0x12'));var as=require(_0x4066('0x13'));var hardwareService=require(_0x4066('0x14'));var logger=require(_0x4066('0x15'))(_0x4066('0x16'));var utils=require(_0x4066('0x17'));var config=require(_0x4066('0x18'));var licenseUtil=require(_0x4066('0x19'));var db=require(_0x4066('0x1a'))['db'];function respondWithStatusCode(_0x3dd6a8,_0x1beb96){_0x1beb96=_0x1beb96||0xcc;return function(_0x43091e){if(_0x43091e){return _0x3dd6a8[_0x4066('0x1b')](_0x1beb96);}return _0x3dd6a8['status'](_0x1beb96)[_0x4066('0x1c')]();};}function respondWithResult(_0x3a7a11,_0x4a4b20){_0x4a4b20=_0x4a4b20||0xc8;return function(_0x422305){if(_0x422305){return _0x3a7a11[_0x4066('0x1d')](_0x4a4b20)['json'](_0x422305);}};}function respondWithFilteredResult(_0x33397f,_0x53ea88){return function(_0x1d8e1d){if(_0x1d8e1d){var _0x235b81=typeof _0x53ea88[_0x4066('0x1e')]===_0x4066('0x1f')&&typeof _0x53ea88['limit']===_0x4066('0x1f');var _0x3bb632=_0x1d8e1d[_0x4066('0x20')];var _0x10c56e=_0x235b81?0x0:_0x53ea88[_0x4066('0x1e')];var _0x5789cc=_0x235b81?_0x1d8e1d['count']:_0x53ea88[_0x4066('0x1e')]+_0x53ea88[_0x4066('0x21')];var _0x1abaad;if(_0x5789cc>=_0x3bb632){_0x5789cc=_0x3bb632;_0x1abaad=0xc8;}else{_0x1abaad=0xce;}_0x33397f[_0x4066('0x1d')](_0x1abaad);return _0x33397f[_0x4066('0x22')](_0x4066('0x23'),_0x10c56e+'-'+_0x5789cc+'/'+_0x3bb632)['json'](_0x1d8e1d);}return null;};}function patchUpdates(_0x3915a8){return function(_0x3bd1f9){try{jsonpatch[_0x4066('0x24')](_0x3bd1f9,_0x3915a8,!![]);}catch(_0x52cb23){return BPromise[_0x4066('0x25')](_0x52cb23);}return _0x3bd1f9[_0x4066('0x26')]();};}function saveUpdates(_0x26dcfc,_0x394224){return function(_0x504ecc){if(_0x504ecc){return _0x504ecc[_0x4066('0x27')](_0x26dcfc)[_0x4066('0x28')](function(_0x53b40c){return _0x53b40c;});}return null;};}function removeEntity(_0x35ed06,_0x364b16){return function(_0x1b090e){if(_0x1b090e){return _0x1b090e[_0x4066('0x29')]()[_0x4066('0x28')](function(){_0x35ed06['status'](0xcc)[_0x4066('0x1c')]();});}};}function handleEntityNotFound(_0x47c09b,_0x5438eb){return function(_0x3ea0ed){if(!_0x3ea0ed){_0x47c09b[_0x4066('0x1b')](0x194);}return _0x3ea0ed;};}function handleError(_0x1ddb74,_0x455dad){_0x455dad=_0x455dad||0x1f4;return function(_0x5df641){logger[_0x4066('0x2a')](_0x5df641['stack']);if(_0x5df641[_0x4066('0x2b')]){delete _0x5df641['name'];}_0x1ddb74[_0x4066('0x1d')](_0x455dad)[_0x4066('0x2c')](_0x5df641);};}exports[_0x4066('0x2d')]=function(_0x2a0561,_0x53a1a7){var _0xed0265={},_0x53fc37={},_0x4a46ed={'count':0x0,'rows':[]};var _0x27e224=_['map'](db[_0x4066('0x2e')][_0x4066('0x2f')],function(_0x43fa42){return{'name':_0x43fa42['fieldName'],'type':_0x43fa42[_0x4066('0x30')]['key']};});_0x53fc37['model']=_[_0x4066('0x31')](_0x27e224,_0x4066('0x2b'));_0x53fc37[_0x4066('0x32')]=_[_0x4066('0x33')](_0x2a0561['query']);_0x53fc37[_0x4066('0x34')]=_['intersection'](_0x53fc37[_0x4066('0x35')],_0x53fc37[_0x4066('0x32')]);_0xed0265[_0x4066('0x36')]=_['intersection'](_0x53fc37[_0x4066('0x35')],qs[_0x4066('0x37')](_0x2a0561[_0x4066('0x32')][_0x4066('0x37')]));_0xed0265[_0x4066('0x36')]=_0xed0265[_0x4066('0x36')][_0x4066('0x38')]?_0xed0265[_0x4066('0x36')]:_0x53fc37[_0x4066('0x35')];if(!_0x2a0561[_0x4066('0x32')]['hasOwnProperty']('nolimit')){_0xed0265[_0x4066('0x21')]=qs['limit'](_0x2a0561[_0x4066('0x32')][_0x4066('0x21')]);_0xed0265['offset']=qs[_0x4066('0x1e')](_0x2a0561[_0x4066('0x32')]['offset']);}_0xed0265['order']=qs[_0x4066('0x39')](_0x2a0561[_0x4066('0x32')][_0x4066('0x39')]);_0xed0265[_0x4066('0x3a')]=qs[_0x4066('0x34')](_[_0x4066('0x3b')](_0x2a0561[_0x4066('0x32')],_0x53fc37[_0x4066('0x34')]),_0x27e224);if(_0x2a0561['query'][_0x4066('0x3c')]){_0xed0265['where']=_[_0x4066('0x3d')](_0xed0265[_0x4066('0x3a')],{'$or':_['map'](_0x27e224,function(_0x277e2c){if(_0x277e2c[_0x4066('0x30')]!==_0x4066('0x3e')){var _0x529697={};_0x529697[_0x277e2c[_0x4066('0x2b')]]={'$like':'%'+_0x2a0561['query'][_0x4066('0x3c')]+'%'};return _0x529697;}})});}_0xed0265=_[_0x4066('0x3d')]({},_0xed0265,_0x2a0561[_0x4066('0x3f')]);var _0x34572b={'where':_0xed0265[_0x4066('0x3a')]};return db[_0x4066('0x2e')][_0x4066('0x20')](_0x34572b)[_0x4066('0x28')](function(_0x20c75f){_0x4a46ed[_0x4066('0x20')]=_0x20c75f;if(_0x2a0561[_0x4066('0x32')][_0x4066('0x40')]){_0xed0265[_0x4066('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x4066('0x42')](_0xed0265);})['then'](function(_0x22a2f5){_0x4a46ed['rows']=_0x22a2f5;return _0x4a46ed;})[_0x4066('0x28')](respondWithFilteredResult(_0x53a1a7,_0xed0265))[_0x4066('0x43')](handleError(_0x53a1a7,null));};exports[_0x4066('0x44')]=function(_0x3d693c,_0x2ac5a2){var _0x1b7696={'raw':!![],'where':{'id':_0x3d693c['params']['id']}},_0x1cc5ad={};_0x1cc5ad[_0x4066('0x35')]=_[_0x4066('0x33')](db[_0x4066('0x2e')][_0x4066('0x2f')]);_0x1cc5ad[_0x4066('0x32')]=_['keys'](_0x3d693c['query']);_0x1cc5ad['filters']=_['intersection'](_0x1cc5ad[_0x4066('0x35')],_0x1cc5ad[_0x4066('0x32')]);_0x1b7696[_0x4066('0x36')]=_['intersection'](_0x1cc5ad[_0x4066('0x35')],qs[_0x4066('0x37')](_0x3d693c[_0x4066('0x32')]['fields']));_0x1b7696[_0x4066('0x36')]=_0x1b7696[_0x4066('0x36')][_0x4066('0x38')]?_0x1b7696[_0x4066('0x36')]:_0x1cc5ad[_0x4066('0x35')];if(_0x3d693c['query'][_0x4066('0x40')]){_0x1b7696[_0x4066('0x41')]=[{'all':!![]}];}_0x1b7696=_['merge']({},_0x1b7696,_0x3d693c['options']);return db[_0x4066('0x2e')][_0x4066('0x45')](_0x1b7696)[_0x4066('0x28')](handleEntityNotFound(_0x2ac5a2,null))['then'](respondWithResult(_0x2ac5a2,null))[_0x4066('0x43')](handleError(_0x2ac5a2,null));};exports[_0x4066('0x27')]=function(_0x33102b,_0x54a763){if(_0x33102b['body']['id']){delete _0x33102b['body']['id'];}return db[_0x4066('0x2e')][_0x4066('0x45')]({'where':{'id':_0x33102b[_0x4066('0x46')]['id']}})['then'](handleEntityNotFound(_0x54a763,null))[_0x4066('0x28')](saveUpdates(_0x33102b[_0x4066('0x47')],null))[_0x4066('0x28')](respondWithResult(_0x54a763,null))[_0x4066('0x43')](handleError(_0x54a763,null));};exports[_0x4066('0x29')]=function(_0x33b9ed,_0x68bf89){return db[_0x4066('0x2e')][_0x4066('0x45')]({'where':{'id':_0x33b9ed[_0x4066('0x46')]['id']}})['then'](handleEntityNotFound(_0x68bf89,null))['then'](removeEntity(_0x68bf89,null))['catch'](handleError(_0x68bf89,null));};exports[_0x4066('0x48')]=function(_0x56fd2a,_0x4492ca){return db[_0x4066('0x2e')][_0x4066('0x48')]()[_0x4066('0x28')](respondWithResult(_0x4492ca,null))['catch'](handleError(_0x4492ca,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 154e0fe..4e30973 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 _0x01ae=['exports','define','cm_hopper_black','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x01ae,0x1bb));var _0xe01a=function(_0x1663ae,_0x10484a){_0x1663ae=_0x1663ae-0x0;var _0x30ffb8=_0x01ae[_0x1663ae];return _0x30ffb8;};'use strict';var _=require(_0xe01a('0x0'));var util=require(_0xe01a('0x1'));var logger=require(_0xe01a('0x2'))('api');var moment=require(_0xe01a('0x3'));var BPromise=require('bluebird');var rp=require(_0xe01a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe01a('0x5'));var config=require(_0xe01a('0x6'));var attributes=require(_0xe01a('0x7'));module[_0xe01a('0x8')]=function(_0x39628c,_0x2297b8){return _0x39628c[_0xe01a('0x9')]('CmHopperBlack',attributes,{'tableName':_0xe01a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35d5=['util','../../config/logger','moment','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x2a3a82,_0x231059){var _0x1d13b8=function(_0x41fe91){while(--_0x41fe91){_0x2a3a82['push'](_0x2a3a82['shift']());}};_0x1d13b8(++_0x231059);}(_0x35d5,0x107));var _0x535d=function(_0x3d85a2,_0x30701f){_0x3d85a2=_0x3d85a2-0x0;var _0x4748d7=_0x35d5[_0x3d85a2];return _0x4748d7;};'use strict';var _=require(_0x535d('0x0'));var util=require(_0x535d('0x1'));var logger=require(_0x535d('0x2'))('api');var moment=require(_0x535d('0x3'));var BPromise=require('bluebird');var rp=require(_0x535d('0x4'));var fs=require('fs');var path=require(_0x535d('0x5'));var rimraf=require('rimraf');var config=require(_0x535d('0x6'));var attributes=require(_0x535d('0x7'));module[_0x535d('0x8')]=function(_0x47b4c1,_0x15a127){return _0x47b4c1['define'](_0x535d('0x9'),attributes,{'tableName':_0x535d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 4923541..1b529e3 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 _0x809e=['then','info','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','attributes','limit','include','map','model','update','body','where','UpdateCmHopperBlack','stringify','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x2fb7f1,_0xc91e51){var _0x1f167b=function(_0x590958){while(--_0x590958){_0x2fb7f1['push'](_0x2fb7f1['shift']());}};_0x1f167b(++_0xc91e51);}(_0x809e,0xb2));var _0xe809=function(_0x25c416,_0x73c781){_0x25c416=_0x25c416-0x0;var _0x11daf2=_0x809e[_0x25c416];return _0x11daf2;};'use strict';var _=require(_0xe809('0x0'));var util=require(_0xe809('0x1'));var moment=require(_0xe809('0x2'));var BPromise=require('bluebird');var rs=require(_0xe809('0x3'));var fs=require('fs');var Redis=require(_0xe809('0x4'));var db=require(_0xe809('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe809('0x6'))(_0xe809('0x7'));var config=require('../../config/environment');var jayson=require(_0xe809('0x8'));var client=jayson[_0xe809('0x9')][_0xe809('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56ebfc,_0x1c0b37,_0x12b682){return new BPromise(function(_0xb95acd,_0x2318b2){return client[_0xe809('0xb')](_0x56ebfc,_0x12b682)[_0xe809('0xc')](function(_0x29e388){logger[_0xe809('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x1c0b37,'request\x20sent');logger[_0xe809('0xe')](_0xe809('0xf'),_0x1c0b37,_0xe809('0x10'),JSON['stringify'](_0x29e388));if(_0x29e388[_0xe809('0x11')]){if(_0x29e388[_0xe809('0x11')]['code']===0x1f4){logger[_0xe809('0x11')](_0xe809('0x12'),_0x1c0b37,_0x29e388[_0xe809('0x11')]['message']);return _0x2318b2(_0x29e388[_0xe809('0x11')][_0xe809('0x13')]);}logger[_0xe809('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x1c0b37,_0x29e388[_0xe809('0x11')][_0xe809('0x13')]);return _0xb95acd(_0x29e388['error'][_0xe809('0x13')]);}else{logger['info'](_0xe809('0x12'),_0x1c0b37,'request\x20sent');_0xb95acd(_0x29e388[_0xe809('0x14')][_0xe809('0x13')]);}})[_0xe809('0x15')](function(_0x2d6ad4){logger['error'](_0xe809('0x12'),_0x1c0b37,_0x2d6ad4);_0x2318b2(_0x2d6ad4);});});}exports[_0xe809('0x16')]=function(_0xdbd41b){var _0x5869d2=this;return new Promise(function(_0x52e51a,_0x579666){return db[_0xe809('0x17')]['findAll']({'raw':_0xdbd41b[_0xe809('0x18')]?_0xdbd41b[_0xe809('0x18')][_0xe809('0x19')]===undefined?!![]:![]:!![],'where':_0xdbd41b[_0xe809('0x18')]?_0xdbd41b[_0xe809('0x18')]['where']||null:null,'attributes':_0xdbd41b['options']?_0xdbd41b['options'][_0xe809('0x1a')]||null:null,'limit':_0xdbd41b[_0xe809('0x18')]?_0xdbd41b['options'][_0xe809('0x1b')]||null:null,'include':_0xdbd41b['options']?_0xdbd41b[_0xe809('0x18')][_0xe809('0x1c')]?_['map'](_0xdbd41b[_0xe809('0x18')][_0xe809('0x1c')],function(_0xf3d292){return{'model':db[_0xf3d292['model']],'as':_0xf3d292['as'],'attributes':_0xf3d292[_0xe809('0x1a')],'include':_0xf3d292[_0xe809('0x1c')]?_[_0xe809('0x1d')](_0xf3d292[_0xe809('0x1c')],function(_0x478d39){return{'model':db[_0x478d39['model']],'as':_0x478d39['as'],'attributes':_0x478d39[_0xe809('0x1a')],'include':_0x478d39[_0xe809('0x1c')]?_[_0xe809('0x1d')](_0x478d39[_0xe809('0x1c')],function(_0x2726ac){return{'model':db[_0x2726ac[_0xe809('0x1e')]],'as':_0x2726ac['as'],'attributes':_0x2726ac[_0xe809('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe809('0xc')](function(_0x46c4fb){logger[_0xe809('0xd')]('GetCmHopperBlack',_0xdbd41b);logger[_0xe809('0xe')]('GetCmHopperBlack',_0xdbd41b,JSON['stringify'](_0x46c4fb));_0x52e51a(_0x46c4fb);})[_0xe809('0x15')](function(_0x4d0646){logger['error']('GetCmHopperBlack',_0x4d0646[_0xe809('0x13')],_0xdbd41b);_0x579666(_0x5869d2[_0xe809('0x11')](0x1f4,_0x4d0646[_0xe809('0x13')]));});});};exports['UpdateCmHopperBlack']=function(_0x106cac){var _0x19fced=this;return new Promise(function(_0x293359,_0x5e9789){return db['CmHopperBlack'][_0xe809('0x1f')](_0x106cac[_0xe809('0x20')],{'raw':_0x106cac[_0xe809('0x18')]?_0x106cac['options'][_0xe809('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x106cac[_0xe809('0x18')]?_0x106cac[_0xe809('0x18')][_0xe809('0x21')]||null:null,'attributes':_0x106cac[_0xe809('0x18')]?_0x106cac['options'][_0xe809('0x1a')]||null:null,'limit':_0x106cac[_0xe809('0x18')]?_0x106cac[_0xe809('0x18')][_0xe809('0x1b')]||null:null})[_0xe809('0xc')](function(_0x31be90){logger[_0xe809('0xd')](_0xe809('0x22'),_0x106cac);logger[_0xe809('0xe')](_0xe809('0x22'),_0x106cac,JSON[_0xe809('0x23')](_0x31be90));_0x293359(_0x31be90);})[_0xe809('0x15')](function(_0x263248){logger[_0xe809('0x11')](_0xe809('0x22'),_0x263248[_0xe809('0x13')],_0x106cac);_0x5e9789(_0x19fced['error'](0x1f4,_0x263248[_0xe809('0x13')]));});});};exports[_0xe809('0x24')]=function(_0x229ea9){var _0x42fe0d=this;return new Promise(function(_0x3d612b,_0x468985){return db['CmHopperBlack'][_0xe809('0x25')]({'where':_0x229ea9[_0xe809('0x18')]?_0x229ea9[_0xe809('0x18')][_0xe809('0x21')]||null:null})[_0xe809('0xc')](function(_0x5db4a7){logger[_0xe809('0xd')]('DestroyCmHopperBlack',_0x229ea9);logger[_0xe809('0xe')](_0xe809('0x24'),_0x229ea9,JSON[_0xe809('0x23')](_0x5db4a7));_0x3d612b(_0x5db4a7);})[_0xe809('0x15')](function(_0x1749d5){logger['error'](_0xe809('0x24'),_0x1749d5[_0xe809('0x13')],_0x229ea9);_0x468985(_0x42fe0d[_0xe809('0x11')](0x1f4,_0x1749d5[_0xe809('0x13')]));});});}; \ No newline at end of file +var _0x2fee=['request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperBlack,\x20%s,\x20%s','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','model','map','debug','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x44e8bb,_0x98dbe3){var _0x598d33=function(_0x7301e2){while(--_0x7301e2){_0x44e8bb['push'](_0x44e8bb['shift']());}};_0x598d33(++_0x98dbe3);}(_0x2fee,0xdd));var _0xe2fe=function(_0x395718,_0x20322d){_0x395718=_0x395718-0x0;var _0x3028b8=_0x2fee[_0x395718];return _0x3028b8;};'use strict';var _=require(_0xe2fe('0x0'));var util=require('util');var moment=require(_0xe2fe('0x1'));var BPromise=require('bluebird');var rs=require(_0xe2fe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2fe('0x3'))['db'];var utils=require(_0xe2fe('0x4'));var logger=require(_0xe2fe('0x5'))('rpc');var config=require(_0xe2fe('0x6'));var jayson=require(_0xe2fe('0x7'));var client=jayson[_0xe2fe('0x8')][_0xe2fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x336343,_0x3fdf70,_0x1446b7){return new BPromise(function(_0x1095e1,_0x50632f){return client[_0xe2fe('0xa')](_0x336343,_0x1446b7)[_0xe2fe('0xb')](function(_0x5a1e85){logger[_0xe2fe('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x3fdf70,_0xe2fe('0xd'));logger['debug'](_0xe2fe('0xe'),_0x3fdf70,'request\x20sent',JSON[_0xe2fe('0xf')](_0x5a1e85));if(_0x5a1e85[_0xe2fe('0x10')]){if(_0x5a1e85[_0xe2fe('0x10')][_0xe2fe('0x11')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x3fdf70,_0x5a1e85[_0xe2fe('0x10')][_0xe2fe('0x12')]);return _0x50632f(_0x5a1e85[_0xe2fe('0x10')][_0xe2fe('0x12')]);}logger[_0xe2fe('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x3fdf70,_0x5a1e85[_0xe2fe('0x10')][_0xe2fe('0x12')]);return _0x1095e1(_0x5a1e85[_0xe2fe('0x10')][_0xe2fe('0x12')]);}else{logger[_0xe2fe('0xc')](_0xe2fe('0x13'),_0x3fdf70,_0xe2fe('0xd'));_0x1095e1(_0x5a1e85[_0xe2fe('0x14')][_0xe2fe('0x12')]);}})[_0xe2fe('0x15')](function(_0x14e181){logger[_0xe2fe('0x10')](_0xe2fe('0x13'),_0x3fdf70,_0x14e181);_0x50632f(_0x14e181);});});}exports[_0xe2fe('0x16')]=function(_0x2a207c){var _0xe414ba=this;return new Promise(function(_0x5e3bc6,_0x5d2abc){return db[_0xe2fe('0x17')][_0xe2fe('0x18')]({'raw':_0x2a207c['options']?_0x2a207c[_0xe2fe('0x19')][_0xe2fe('0x1a')]===undefined?!![]:![]:!![],'where':_0x2a207c[_0xe2fe('0x19')]?_0x2a207c[_0xe2fe('0x19')][_0xe2fe('0x1b')]||null:null,'attributes':_0x2a207c[_0xe2fe('0x19')]?_0x2a207c[_0xe2fe('0x19')][_0xe2fe('0x1c')]||null:null,'limit':_0x2a207c[_0xe2fe('0x19')]?_0x2a207c[_0xe2fe('0x19')][_0xe2fe('0x1d')]||null:null,'include':_0x2a207c[_0xe2fe('0x19')]?_0x2a207c[_0xe2fe('0x19')][_0xe2fe('0x1e')]?_['map'](_0x2a207c[_0xe2fe('0x19')][_0xe2fe('0x1e')],function(_0x2aa001){return{'model':db[_0x2aa001[_0xe2fe('0x1f')]],'as':_0x2aa001['as'],'attributes':_0x2aa001[_0xe2fe('0x1c')],'include':_0x2aa001[_0xe2fe('0x1e')]?_[_0xe2fe('0x20')](_0x2aa001[_0xe2fe('0x1e')],function(_0x35c3fd){return{'model':db[_0x35c3fd['model']],'as':_0x35c3fd['as'],'attributes':_0x35c3fd['attributes'],'include':_0x35c3fd[_0xe2fe('0x1e')]?_[_0xe2fe('0x20')](_0x35c3fd['include'],function(_0x418339){return{'model':db[_0x418339[_0xe2fe('0x1f')]],'as':_0x418339['as'],'attributes':_0x418339[_0xe2fe('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe2fe('0xb')](function(_0xca820e){logger['info'](_0xe2fe('0x16'),_0x2a207c);logger[_0xe2fe('0x21')](_0xe2fe('0x16'),_0x2a207c,JSON['stringify'](_0xca820e));_0x5e3bc6(_0xca820e);})['catch'](function(_0x40307b){logger['error'](_0xe2fe('0x16'),_0x40307b[_0xe2fe('0x12')],_0x2a207c);_0x5d2abc(_0xe414ba[_0xe2fe('0x10')](0x1f4,_0x40307b[_0xe2fe('0x12')]));});});};exports[_0xe2fe('0x22')]=function(_0x58564f){var _0x23e932=this;return new Promise(function(_0x4d7d9e,_0x8ad74b){return db['CmHopperBlack'][_0xe2fe('0x23')](_0x58564f[_0xe2fe('0x24')],{'raw':_0x58564f[_0xe2fe('0x19')]?_0x58564f[_0xe2fe('0x19')][_0xe2fe('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58564f[_0xe2fe('0x19')]?_0x58564f[_0xe2fe('0x19')][_0xe2fe('0x1b')]||null:null,'attributes':_0x58564f[_0xe2fe('0x19')]?_0x58564f[_0xe2fe('0x19')][_0xe2fe('0x1c')]||null:null,'limit':_0x58564f[_0xe2fe('0x19')]?_0x58564f['options'][_0xe2fe('0x1d')]||null:null})[_0xe2fe('0xb')](function(_0x5323c7){logger['info'](_0xe2fe('0x22'),_0x58564f);logger[_0xe2fe('0x21')]('UpdateCmHopperBlack',_0x58564f,JSON['stringify'](_0x5323c7));_0x4d7d9e(_0x5323c7);})['catch'](function(_0x30f095){logger['error'](_0xe2fe('0x22'),_0x30f095[_0xe2fe('0x12')],_0x58564f);_0x8ad74b(_0x23e932['error'](0x1f4,_0x30f095[_0xe2fe('0x12')]));});});};exports[_0xe2fe('0x25')]=function(_0x36febf){var _0x5b1336=this;return new Promise(function(_0x48f81f,_0x26bb25){return db['CmHopperBlack'][_0xe2fe('0x26')]({'where':_0x36febf[_0xe2fe('0x19')]?_0x36febf['options'][_0xe2fe('0x1b')]||null:null})[_0xe2fe('0xb')](function(_0x360718){logger['info'](_0xe2fe('0x25'),_0x36febf);logger['debug'](_0xe2fe('0x25'),_0x36febf,JSON[_0xe2fe('0xf')](_0x360718));_0x48f81f(_0x360718);})[_0xe2fe('0x15')](function(_0x5021ee){logger['error'](_0xe2fe('0x25'),_0x5021ee['message'],_0x36febf);_0x26bb25(_0x5b1336[_0xe2fe('0x10')](0x1f4,_0x5021ee[_0xe2fe('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index b277c35..747edd5 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 _0x32f4=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','show','put','/:id','delete','exports'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x32f4,0x154));var _0x432f=function(_0x505eb5,_0x195087){_0x505eb5=_0x505eb5-0x0;var _0x17cd53=_0x32f4[_0x505eb5];return _0x17cd53;};'use strict';var multer=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var path=require(_0x432f('0x2'));var timeout=require(_0x432f('0x3'));var express=require('express');var router=express[_0x432f('0x4')]();var fs_extra=require(_0x432f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var controller=require(_0x432f('0x8'));router[_0x432f('0x9')]('/',auth[_0x432f('0xa')](),controller['index']);router['get'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['describe']);router[_0x432f('0x9')]('/:id',auth[_0x432f('0xa')](),controller[_0x432f('0xc')]);router[_0x432f('0xd')](_0x432f('0xe'),auth[_0x432f('0xa')](),controller['update']);router[_0x432f('0xf')]('/:id',auth[_0x432f('0xa')](),controller['destroy']);module[_0x432f('0x10')]=router; \ No newline at end of file +var _0x187d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','update','delete','destroy','exports'];(function(_0x1e21ec,_0xac0400){var _0x2c2198=function(_0x2dc2d2){while(--_0x2dc2d2){_0x1e21ec['push'](_0x1e21ec['shift']());}};_0x2c2198(++_0xac0400);}(_0x187d,0x93));var _0xd187=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x187d[_0x28d18d];return _0x470640;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xe'),auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')]('/:id',auth[_0xd187('0x9')](),controller[_0xd187('0x13')]);module[_0xd187('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 5480213..904b4fd 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 _0x7971=['moment','INTEGER','DATE','STRING','getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize'];(function(_0x3d7a9f,_0x3420f1){var _0x1878d8=function(_0x307e49){while(--_0x307e49){_0x3d7a9f['push'](_0x3d7a9f['shift']());}};_0x1878d8(++_0x3420f1);}(_0x7971,0xe3));var _0x1797=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x7971[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0x1797('0x0'));var moment=require(_0x1797('0x1'));module['exports']={'state':{'type':Sequelize[_0x1797('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x1797('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1797('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x1797('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1797('0x4')]},'calleridname':{'type':Sequelize[_0x1797('0x4')]},'starttime':{'type':Sequelize[_0x1797('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x1797('0x3')]},'droptime':{'type':Sequelize[_0x1797('0x3')]},'endtime':{'type':Sequelize[_0x1797('0x3')]},'ringtime':{'type':Sequelize[_0x1797('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1797('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1797('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x1797('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x1797('0x4')]},'disposition':{'type':Sequelize[_0x1797('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1797('0x4')]},'dispositionat':{'type':Sequelize[_0x1797('0x3')],'set':function(_0x9b5441){var _0x44ea04=this[_0x1797('0x5')](_0x1797('0x6'));if(_0x44ea04&&_0x9b5441){this[_0x1797('0x7')](_0x1797('0x8'),moment(_0x9b5441)[_0x1797('0x9')](moment(_0x44ea04),_0x1797('0xa')));}}},'amd':{'type':Sequelize[_0x1797('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x1797('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x1797('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x1797('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x1797('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1797('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1797('0x3')]},'deleted':{'type':Sequelize[_0x1797('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x1797('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1797('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1797('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1797('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1797('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x11f5=['DATE','getDataValue','seconds','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x49dca3,_0x5228d8){var _0x2b9243=function(_0x36d8cf){while(--_0x36d8cf){_0x49dca3['push'](_0x49dca3['shift']());}};_0x2b9243(++_0x5228d8);}(_0x11f5,0x1ac));var _0x511f=function(_0x1b1d2f,_0x393cad){_0x1b1d2f=_0x1b1d2f-0x0;var _0x528383=_0x11f5[_0x1b1d2f];return _0x528383;};'use strict';var Sequelize=require(_0x511f('0x0'));var moment=require('moment');module[_0x511f('0x1')]={'state':{'type':Sequelize[_0x511f('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x511f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x511f('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x511f('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x511f('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x511f('0x3')]},'originatecalleridname':{'type':Sequelize[_0x511f('0x3')]},'calleridnum':{'type':Sequelize[_0x511f('0x3')]},'calleridname':{'type':Sequelize[_0x511f('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x511f('0x4')]},'answertime':{'type':Sequelize[_0x511f('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x511f('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x511f('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x511f('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x511f('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x511f('0x3')]},'campaign':{'type':Sequelize[_0x511f('0x3')]},'campaigntype':{'type':Sequelize[_0x511f('0x3')]},'membername':{'type':Sequelize[_0x511f('0x3')]},'reason':{'type':Sequelize[_0x511f('0x3')]},'disposition':{'type':Sequelize[_0x511f('0x3')]},'secondDisposition':{'type':Sequelize[_0x511f('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x511f('0x4')],'set':function(_0x2e5bd7){var _0x2bf3bb=this[_0x511f('0x5')]('endtime');if(_0x2bf3bb&&_0x2e5bd7){this['setDataValue']('followuptime',moment(_0x2e5bd7)['diff'](moment(_0x2bf3bb),_0x511f('0x6')));}}},'amd':{'type':Sequelize[_0x511f('0x7')],'defaultValue':![]},'fax':{'type':Sequelize[_0x511f('0x7')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x511f('0x7')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x511f('0x7')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x511f('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x511f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x511f('0x4')]},'deleted':{'type':Sequelize[_0x511f('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x511f('0x4')]},'recallme':{'type':Sequelize[_0x511f('0x7')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x511f('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x511f('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x511f('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x511f('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x511f('0x2')],'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 a4adf28..484c2ac 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 _0x5fab=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','CmHopperFinal','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','describe','body','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','select','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','NOW()','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','Campaign','insert','CampaignId','createdAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x4139f1,_0x562255){var _0x3b0271=function(_0x153380){while(--_0x153380){_0x4139f1['push'](_0x4139f1['shift']());}};_0x3b0271(++_0x562255);}(_0x5fab,0x177));var _0xb5fa=function(_0x50424f,_0x50aa88){_0x50424f=_0x50424f-0x0;var _0xd5e2de=_0x5fab[_0x50424f];return _0xd5e2de;};'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['CmHopperFinal'][_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')]()[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,null))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x42a359,_0x3a39f2){if(_0x42a359['body']['uniqueid']){delete _0x42a359[_0xb5fa('0x4d')]['uniqueid'];}return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')]({'where':{'uniqueid':_0x42a359['params']['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x3a39f2,null))[_0xb5fa('0x43')](saveUpdates(_0x42a359[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x3a39f2,null))[_0xb5fa('0x4b')](handleError(_0x3a39f2,null));};exports[_0xb5fa('0x4e')]=function(_0x51d5f7,_0x27a651,_0x4fd5bf){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x51d5f7[_0xb5fa('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x58')))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5a')))),'dropContacts'],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),_0xb5fa('0x5f')]]})[_0xb5fa('0x43')](handleEntityNotFound(_0x27a651,null))[_0xb5fa('0x43')](respondWithResult(_0x27a651,null))[_0xb5fa('0x4b')](handleError(_0x27a651,null));};exports[_0xb5fa('0x60')]=function(_0x18cde9,_0x40d7d5,_0xd2ba4e){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'CampaignId':_0x18cde9[_0xb5fa('0x46')]['id']},'attributes':[[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db['sequelize']['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x208,\x201,\x20null'))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb5fa('0x61')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x62')))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),'answeringMachine']]})[_0xb5fa('0x43')](handleEntityNotFound(_0x40d7d5,null))[_0xb5fa('0x43')](respondWithResult(_0x40d7d5,null))[_0xb5fa('0x4b')](handleError(_0x40d7d5,null));};exports[_0xb5fa('0x63')]=function(_0x339dfb,_0x56e6b0,_0x1585cd){return db['VoiceQueue'][_0xb5fa('0x4a')]({'where':{'id':_0x339dfb[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x56e6b0,null))[_0xb5fa('0x43')](function(_0x5e44d8){var _0x4d1117;if(_0x5e44d8){_0x4d1117=squel['insert']()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')]([_0xb5fa('0x67'),_0xb5fa('0x68'),_0xb5fa('0x69'),'ListId',_0xb5fa('0x6a'),'createdAt','updatedAt'],squel[_0xb5fa('0x6b')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))['field'](_0xb5fa('0x70'),_0xb5fa('0x6a'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'createdAt')[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x72'))[_0xb5fa('0x73')](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb['params']['id'][_0xb5fa('0x76')]())['where'](_0xb5fa('0x77'),_0x339dfb[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))['from'](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb[_0xb5fa('0x46')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')](_0xb5fa('0x74'))['where']('VoiceQueueId\x20=\x20?',_0x339dfb[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db[_0xb5fa('0x50')]['query'](_0x4d1117);}return[];})[_0xb5fa('0x43')](respondWithResult(_0x56e6b0,null))[_0xb5fa('0x4b')](handleError(_0x56e6b0,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x5e6852,_0x391412,_0x3150ac){return db[_0xb5fa('0x7d')][_0xb5fa('0x4a')]({'where':{'id':_0x5e6852[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x391412,null))[_0xb5fa('0x43')](function(_0x25b278){var _0x1a0255;if(_0x25b278){_0x1a0255=squel[_0xb5fa('0x7e')]()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')](['phone','scheduledAt',_0xb5fa('0x69'),'ListId',_0xb5fa('0x7f'),_0xb5fa('0x80'),'updatedAt'],squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')]('ANY_VALUE(calleridnum)',_0xb5fa('0x67'))[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))[_0xb5fa('0x6c')](_0xb5fa('0x81'),_0xb5fa('0x7f'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x80'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'updatedAt')['from'](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x77'),_0x5e6852[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))[_0xb5fa('0x73')](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]()))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')]('cm_hopper_final')[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db['sequelize'][_0xb5fa('0x33')](_0x1a0255);}return[];})['then'](respondWithResult(_0x391412,null))['catch'](handleError(_0x391412,null));};exports[_0xb5fa('0x83')]=function(_0x27dbe8,_0x2faf23,_0x4d607d){return db[_0xb5fa('0x84')][_0xb5fa('0x85')]({'where':{'VoiceQueueId':_0x27dbe8[_0xb5fa('0x4d')]['VoiceQueueId'],'CampaignId':_0x27dbe8[_0xb5fa('0x4d')][_0xb5fa('0x7f')],'ContactId':_0x27dbe8['body'][_0xb5fa('0x69')]}})[_0xb5fa('0x43')](handleEntityNotFound(_0x2faf23,null))[_0xb5fa('0x43')](function(_0xf15d5c){if(_0xf15d5c){return _0xf15d5c;}return null;})[_0xb5fa('0x43')](respondWithResult(_0x2faf23,null))[_0xb5fa('0x4b')](handleError(_0x2faf23,null));}; \ No newline at end of file +var _0x4975=['ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','CmHopperFinal','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','noAnswerContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','ANY_VALUE(calleridnum)','phone','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','select'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4975,0x86));var _0x5497=function(_0x5b137f,_0x8b6f3a){_0x5b137f=_0x5b137f-0x0;var _0x2667cc=_0x4975[_0x5b137f];return _0x2667cc;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['CmHopperFinal']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':!![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['CmHopperFinal'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['describe']()[_0x5497('0x24')](respondWithResult(_0x466287,null))[_0x5497('0x40')](handleError(_0x466287,null));};exports[_0x5497('0x23')]=function(_0x52a189,_0x3e4da2){if(_0x52a189['body'][_0x5497('0x46')]){delete _0x52a189[_0x5497('0x47')][_0x5497('0x46')];}return db['CmHopperFinal'][_0x5497('0x44')]({'where':{'uniqueid':_0x52a189[_0x5497('0x42')]['id']}})['then'](handleEntityNotFound(_0x3e4da2,null))[_0x5497('0x24')](saveUpdates(_0x52a189['body'],null))[_0x5497('0x24')](respondWithResult(_0x3e4da2,null))['catch'](handleError(_0x3e4da2,null));};exports[_0x5497('0x48')]=function(_0x400860,_0x26fd9f,_0xf07541){return db[_0x5497('0x3b')][_0x5497('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x400860[_0x5497('0x42')]['id']},'attributes':[[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x4a')))),_0x5497('0x4b')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),_0x5497('0x4e')],[db['sequelize']['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize'][_0x5497('0x4d')]('`state`\x20=\x208,\x201,\x20null'))),_0x5497('0x4f')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x50')))),_0x5497('0x51')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x52')))),_0x5497('0x53')],[db['sequelize']['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x5497('0x54')))),_0x5497('0x55')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x56')))),_0x5497('0x57')]]})[_0x5497('0x24')](handleEntityNotFound(_0x26fd9f,null))[_0x5497('0x24')](respondWithResult(_0x26fd9f,null))[_0x5497('0x40')](handleError(_0x26fd9f,null));};exports[_0x5497('0x58')]=function(_0x573f93,_0x18b30c,_0x3b0350){return db[_0x5497('0x3b')][_0x5497('0x3f')]({'raw':![],'where':{'CampaignId':_0x573f93['params']['id']},'attributes':[[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')]['literal'](_0x5497('0x4a')))),_0x5497('0x4b')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x5497('0x4e')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x59')))),_0x5497('0x5a')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')]['literal'](_0x5497('0x5b')))),_0x5497('0x4f')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5497('0x51')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5497('0x53')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x54')))),_0x5497('0x55')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x56')))),_0x5497('0x57')]]})['then'](handleEntityNotFound(_0x18b30c,null))[_0x5497('0x24')](respondWithResult(_0x18b30c,null))[_0x5497('0x40')](handleError(_0x18b30c,null));};exports[_0x5497('0x5c')]=function(_0x4ef195,_0x5794ff,_0x589008){return db[_0x5497('0x5d')][_0x5497('0x44')]({'where':{'id':_0x4ef195['params']['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x5794ff,null))[_0x5497('0x24')](function(_0x21c715){var _0x286af8;if(_0x21c715){_0x286af8=squel['insert']()[_0x5497('0x5e')](_0x5497('0x5f'))[_0x5497('0x60')](['phone',_0x5497('0x61'),_0x5497('0x62'),'ListId',_0x5497('0x63'),_0x5497('0x64'),_0x5497('0x65')],squel['select']()['field'](_0x5497('0x66'),_0x5497('0x67'))[_0x5497('0x68')](_0x5497('0x69'),_0x5497('0x61'))[_0x5497('0x68')](_0x5497('0x6a'),'ContactId')['field'](_0x5497('0x6b'),_0x5497('0x6c'))['field'](_0x5497('0x6d'),_0x5497('0x63'))[_0x5497('0x68')]('NOW()',_0x5497('0x64'))[_0x5497('0x68')]('NOW()',_0x5497('0x65'))[_0x5497('0x6e')](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195['params']['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x72'),_0x4ef195[_0x5497('0x47')][_0x5497('0x73')]['toString']())[_0x5497('0x37')](_0x5497('0x74'))[_0x5497('0x37')](_0x5497('0x75'),squel['select']()[_0x5497('0x68')](_0x5497('0x67'))['from'](_0x5497('0x5f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195[_0x5497('0x42')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x5497('0x76'))[_0x5497('0x6e')](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195['params']['id']['toString']())[_0x5497('0x37')](_0x5497('0x77')))[_0x5497('0x78')](_0x5497('0x62')))[_0x5497('0x71')]();return db[_0x5497('0x49')][_0x5497('0x2c')](_0x286af8);}return[];})[_0x5497('0x24')](respondWithResult(_0x5794ff,null))[_0x5497('0x40')](handleError(_0x5794ff,null));};exports[_0x5497('0x79')]=function(_0x4c41c4,_0x1515f1,_0x4118ec){return db[_0x5497('0x7a')][_0x5497('0x44')]({'where':{'id':_0x4c41c4[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x1515f1,null))['then'](function(_0x1ef7fc){var _0x5903b7;if(_0x1ef7fc){_0x5903b7=squel[_0x5497('0x7b')]()[_0x5497('0x5e')](_0x5497('0x5f'))['fromQuery'](['phone',_0x5497('0x61'),_0x5497('0x62'),_0x5497('0x6c'),_0x5497('0x7c'),_0x5497('0x64'),_0x5497('0x65')],squel[_0x5497('0x7d')]()[_0x5497('0x68')]('ANY_VALUE(calleridnum)','phone')['field'](_0x5497('0x69'),_0x5497('0x61'))[_0x5497('0x68')](_0x5497('0x6a'),'ContactId')['field'](_0x5497('0x6b'),_0x5497('0x6c'))['field'](_0x5497('0x7e'),_0x5497('0x7c'))[_0x5497('0x68')](_0x5497('0x69'),'createdAt')['field']('NOW()','updatedAt')['from'](_0x5497('0x6f'))['where'](_0x5497('0x7f'),_0x4c41c4['params']['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x72'),_0x4c41c4[_0x5497('0x47')][_0x5497('0x73')][_0x5497('0x71')]())['where'](_0x5497('0x74'))['where'](_0x5497('0x75'),squel[_0x5497('0x7d')]()[_0x5497('0x68')](_0x5497('0x67'))[_0x5497('0x6e')](_0x5497('0x5f'))[_0x5497('0x37')](_0x5497('0x7f'),_0x4c41c4[_0x5497('0x42')]['id'][_0x5497('0x71')]()))['where'](_0x5497('0x75'),squel['select']()[_0x5497('0x68')](_0x5497('0x76'))['from'](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x7f'),_0x4c41c4[_0x5497('0x42')]['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x77')))[_0x5497('0x78')](_0x5497('0x62')))[_0x5497('0x71')]();return db[_0x5497('0x49')][_0x5497('0x2c')](_0x5903b7);}return[];})[_0x5497('0x24')](respondWithResult(_0x1515f1,null))[_0x5497('0x40')](handleError(_0x1515f1,null));};exports['checkContactHopper']=function(_0x37c17e,_0x163b5b,_0x3a31be){return db[_0x5497('0x80')][_0x5497('0x81')]({'where':{'VoiceQueueId':_0x37c17e['body'][_0x5497('0x63')],'CampaignId':_0x37c17e[_0x5497('0x47')]['CampaignId'],'ContactId':_0x37c17e['body'][_0x5497('0x62')]}})[_0x5497('0x24')](handleEntityNotFound(_0x163b5b,null))[_0x5497('0x24')](function(_0x14f693){if(_0x14f693){return _0x14f693;}return null;})[_0x5497('0x24')](respondWithResult(_0x163b5b,null))['catch'](handleError(_0x163b5b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 23e59db..23d9478 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 _0xdda2=['cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','exports','define','CmHopperFinal'];(function(_0x566b9e,_0x317a77){var _0x2b9e96=function(_0x1b817f){while(--_0x1b817f){_0x566b9e['push'](_0x566b9e['shift']());}};_0x2b9e96(++_0x317a77);}(_0xdda2,0x147));var _0x2dda=function(_0x5360be,_0x316f8a){_0x5360be=_0x5360be-0x0;var _0x5bf98a=_0xdda2[_0x5360be];return _0x5bf98a;};'use strict';var _=require(_0x2dda('0x0'));var util=require(_0x2dda('0x1'));var logger=require(_0x2dda('0x2'))('api');var moment=require(_0x2dda('0x3'));var BPromise=require(_0x2dda('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2dda('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x2dda('0x6')]=function(_0x1e747c,_0x432cd1){return _0x1e747c[_0x2dda('0x7')](_0x2dda('0x8'),attributes,{'tableName':_0x2dda('0x9'),'paranoid':![],'indexes':[{'name':_0x2dda('0xa'),'fields':[_0x2dda('0xa')]},{'name':_0x2dda('0xb'),'fields':[_0x2dda('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e02=['bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','calleridnum','uniqueid','util','../../config/logger','moment'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x4e02,0x105));var _0x24e0=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x4e02[_0x4ca6a4];return _0x120555;};'use strict';var _=require('lodash');var util=require(_0x24e0('0x0'));var logger=require(_0x24e0('0x1'))('api');var moment=require(_0x24e0('0x2'));var BPromise=require(_0x24e0('0x3'));var rp=require(_0x24e0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x24e0('0x5'));var config=require(_0x24e0('0x6'));var attributes=require(_0x24e0('0x7'));module[_0x24e0('0x8')]=function(_0xe45b1f,_0x25c6f7){return _0xe45b1f['define'](_0x24e0('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x24e0('0xa'),'fields':[_0x24e0('0xa')]},{'name':'uniqueid','fields':[_0x24e0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index f9191af..aa93a96 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x2f246a,_0x17bd49){var _0x3ef081=function(_0x180c55){while(--_0x180c55){_0x2f246a['push'](_0x2f246a['shift']());}};_0x3ef081(++_0x17bd49);}(_0xb10b,0x12a));var _0xbb10=function(_0x487131,_0x2c86e8){_0x487131=_0x487131-0x0;var _0xf320ff=_0xb10b[_0x487131];return _0xf320ff;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x1de3ce,_0x57c0ad){var _0x669651=function(_0x94f9f4){while(--_0x94f9f4){_0x1de3ce['push'](_0x1de3ce['shift']());}};_0x669651(++_0x57c0ad);}(_0xb10b,0x12a));var _0xbb10=function(_0x2de9a5,_0x1bbbd1){_0x2de9a5=_0x2de9a5-0x0;var _0xddd28a=_0xb10b[_0x2de9a5];return _0xddd28a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index e757977..18ca157 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 _0x2d12=['../../config/environment','./cmHopperFinal.controller','get','/describe','isAuthenticated','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','/:id','update','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xad4c8e,_0x1f6fff){var _0x5ee12d=function(_0x53f9b3){while(--_0x53f9b3){_0xad4c8e['push'](_0xad4c8e['shift']());}};_0x5ee12d(++_0x1f6fff);}(_0x2d12,0x198));var _0x22d1=function(_0x14d2ef,_0xb564b9){_0x14d2ef=_0x14d2ef-0x0;var _0x55c4c6=_0x2d12[_0x14d2ef];return _0x55c4c6;};'use strict';var multer=require('multer');var util=require(_0x22d1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x22d1('0x1'));var router=express[_0x22d1('0x2')]();var fs_extra=require(_0x22d1('0x3'));var auth=require(_0x22d1('0x4'));var interaction=require(_0x22d1('0x5'));var config=require(_0x22d1('0x6'));var controller=require(_0x22d1('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x22d1('0x8')](_0x22d1('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x22d1('0x8')]('/:id',auth[_0x22d1('0xa')](),controller['show']);router['get']('/voice/queue/countAttributes/:id',auth[_0x22d1('0xa')](),controller[_0x22d1('0xb')]);router[_0x22d1('0x8')](_0x22d1('0xc'),auth['isAuthenticated'](),controller[_0x22d1('0xd')]);router[_0x22d1('0xe')](_0x22d1('0xf'),auth['isAuthenticated'](),controller[_0x22d1('0x10')]);router['post'](_0x22d1('0x11'),auth[_0x22d1('0xa')](),controller[_0x22d1('0x12')]);router['post']('/checkContactHopper',auth[_0x22d1('0xa')](),controller[_0x22d1('0x13')]);router[_0x22d1('0x14')](_0x22d1('0x15'),auth[_0x22d1('0xa')](),controller[_0x22d1('0x16')]);module['exports']=router; \ No newline at end of file +var _0x21ec=['exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update'];(function(_0x556361,_0x3b94ba){var _0x183ffd=function(_0x2344b3){while(--_0x2344b3){_0x556361['push'](_0x556361['shift']());}};_0x183ffd(++_0x3b94ba);}(_0x21ec,0xb0));var _0xc21e=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x21ec[_0x4a3898];return _0x25ceb0;};'use strict';var multer=require(_0xc21e('0x0'));var util=require('util');var path=require(_0xc21e('0x1'));var timeout=require(_0xc21e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc21e('0x3'));var auth=require(_0xc21e('0x4'));var interaction=require(_0xc21e('0x5'));var config=require(_0xc21e('0x6'));var controller=require(_0xc21e('0x7'));router[_0xc21e('0x8')]('/',auth[_0xc21e('0x9')](),controller[_0xc21e('0xa')]);router[_0xc21e('0x8')]('/describe',auth[_0xc21e('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc21e('0xb')]);router[_0xc21e('0x8')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0xc21e('0xc')]);router['get'](_0xc21e('0xd'),auth[_0xc21e('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xc21e('0xe')](_0xc21e('0xf'),auth['isAuthenticated'](),controller[_0xc21e('0x10')]);router[_0xc21e('0xe')](_0xc21e('0x11'),auth[_0xc21e('0x9')](),controller[_0xc21e('0x12')]);router[_0xc21e('0xe')](_0xc21e('0x13'),auth['isAuthenticated'](),controller[_0xc21e('0x14')]);router[_0xc21e('0x15')](_0xc21e('0x16'),auth['isAuthenticated'](),controller[_0xc21e('0x17')]);module[_0xc21e('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 e897a0e..36e3ba4 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 _0x29b3=['INTEGER','DATE','STRING','BOOLEAN','sequelize','exports'];(function(_0x463ed0,_0x2bbc2d){var _0x121ec3=function(_0x5e6fe0){while(--_0x5e6fe0){_0x463ed0['push'](_0x463ed0['shift']());}};_0x121ec3(++_0x2bbc2d);}(_0x29b3,0x160));var _0x329b=function(_0x2d7bf0,_0x8112a3){_0x2d7bf0=_0x2d7bf0-0x0;var _0x1ae927=_0x29b3[_0x2d7bf0];return _0x1ae927;};'use strict';var Sequelize=require(_0x329b('0x0'));module[_0x329b('0x1')]={'state':{'type':Sequelize[_0x329b('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x329b('0x3')]},'countbusyretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x329b('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x329b('0x4')]},'originatecalleridname':{'type':Sequelize[_0x329b('0x4')]},'calleridnum':{'type':Sequelize[_0x329b('0x4')]},'calleridname':{'type':Sequelize[_0x329b('0x4')]},'starttime':{'type':Sequelize[_0x329b('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x329b('0x3')]},'droptime':{'type':Sequelize[_0x329b('0x3')]},'endtime':{'type':Sequelize[_0x329b('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x329b('0x4')]},'campaigntype':{'type':Sequelize[_0x329b('0x4')]},'membername':{'type':Sequelize[_0x329b('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x329b('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x329b('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x329b('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x329b('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x329b('0x3')]},'edited':{'type':Sequelize[_0x329b('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x329b('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x329b('0x4')]}}; \ No newline at end of file +var _0x7c71=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x53c9f9,_0x3c6abf){var _0x577b4b=function(_0x59d11c){while(--_0x59d11c){_0x53c9f9['push'](_0x53c9f9['shift']());}};_0x577b4b(++_0x3c6abf);}(_0x7c71,0x177));var _0x17c7=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x7c71[_0x15ca1a];return _0x507626;};'use strict';var Sequelize=require(_0x17c7('0x0'));module[_0x17c7('0x1')]={'state':{'type':Sequelize[_0x17c7('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x17c7('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x17c7('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x17c7('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x17c7('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x17c7('0x3')]},'originatecalleridname':{'type':Sequelize[_0x17c7('0x3')]},'calleridnum':{'type':Sequelize[_0x17c7('0x3')]},'calleridname':{'type':Sequelize[_0x17c7('0x3')]},'starttime':{'type':Sequelize[_0x17c7('0x4')]},'responsetime':{'type':Sequelize[_0x17c7('0x4')]},'answertime':{'type':Sequelize[_0x17c7('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x17c7('0x4')]},'ringtime':{'type':Sequelize[_0x17c7('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x17c7('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x17c7('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x17c7('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x17c7('0x3')]},'campaign':{'type':Sequelize[_0x17c7('0x3')]},'campaigntype':{'type':Sequelize[_0x17c7('0x3')]},'membername':{'type':Sequelize[_0x17c7('0x3')]},'reason':{'type':Sequelize[_0x17c7('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x17c7('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x17c7('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x17c7('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x17c7('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x17c7('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x17c7('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x17c7('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x17c7('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 2f7f75f..687b625 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 _0x6a7e=['order','sort','where','filters','filter','merge','VIRTUAL','options','CmHopperHistory','findAll','rows','catch','show','params','intersection','includeAll','include','find','describe','uniqueid','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','status','error','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x4cc49b,_0x59264d){var _0x1d8202=function(_0x52cab5){while(--_0x52cab5){_0x4cc49b['push'](_0x4cc49b['shift']());}};_0x1d8202(++_0x59264d);}(_0x6a7e,0xf0));var _0xe6a7=function(_0x5e46f0,_0x4e15c9){_0x5e46f0=_0x5e46f0-0x0;var _0x3ef5bb=_0x6a7e[_0x5e46f0];return _0x3ef5bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe6a7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6a7('0x1'));var rp=require('request-promise');var moment=require(_0xe6a7('0x2'));var BPromise=require(_0xe6a7('0x3'));var Mustache=require(_0xe6a7('0x4'));var util=require(_0xe6a7('0x5'));var path=require(_0xe6a7('0x6'));var sox=require('sox');var csv=require(_0xe6a7('0x7'));var ejs=require(_0xe6a7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe6a7('0x9'));var squel=require(_0xe6a7('0xa'));var crypto=require(_0xe6a7('0xb'));var jsforce=require(_0xe6a7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe6a7('0x7'));var querystring=require('querystring');var Papa=require(_0xe6a7('0xd'));var Redis=require(_0xe6a7('0xe'));var authService=require(_0xe6a7('0xf'));var qs=require(_0xe6a7('0x10'));var as=require(_0xe6a7('0x11'));var hardwareService=require(_0xe6a7('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xe6a7('0x13'));var config=require(_0xe6a7('0x14'));var licenseUtil=require(_0xe6a7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41265d,_0x3d297c){_0x3d297c=_0x3d297c||0xcc;return function(_0x25d9ab){if(_0x25d9ab){return _0x41265d[_0xe6a7('0x16')](_0x3d297c);}return _0x41265d['status'](_0x3d297c)[_0xe6a7('0x17')]();};}function respondWithResult(_0x3efd05,_0x154316){_0x154316=_0x154316||0xc8;return function(_0x4f0464){if(_0x4f0464){return _0x3efd05['status'](_0x154316)[_0xe6a7('0x18')](_0x4f0464);}};}function respondWithFilteredResult(_0xaafae9,_0x480193){return function(_0x4d363d){if(_0x4d363d){var _0x5701e8=typeof _0x480193[_0xe6a7('0x19')]===_0xe6a7('0x1a')&&typeof _0x480193['limit']==='undefined';var _0x124923=_0x4d363d[_0xe6a7('0x1b')];var _0x43b927=_0x5701e8?0x0:_0x480193[_0xe6a7('0x19')];var _0x1b8c1b=_0x5701e8?_0x4d363d['count']:_0x480193[_0xe6a7('0x19')]+_0x480193['limit'];var _0x1dda74;if(_0x1b8c1b>=_0x124923){_0x1b8c1b=_0x124923;_0x1dda74=0xc8;}else{_0x1dda74=0xce;}_0xaafae9['status'](_0x1dda74);return _0xaafae9[_0xe6a7('0x1c')](_0xe6a7('0x1d'),_0x43b927+'-'+_0x1b8c1b+'/'+_0x124923)[_0xe6a7('0x18')](_0x4d363d);}return null;};}function patchUpdates(_0x386c23){return function(_0x352bda){try{jsonpatch[_0xe6a7('0x1e')](_0x352bda,_0x386c23,!![]);}catch(_0x43b355){return BPromise['reject'](_0x43b355);}return _0x352bda['save']();};}function saveUpdates(_0x4372d4,_0x21cfb5){return function(_0x2024cc){if(_0x2024cc){return _0x2024cc[_0xe6a7('0x1f')](_0x4372d4)[_0xe6a7('0x20')](function(_0x51ff40){return _0x51ff40;});}return null;};}function removeEntity(_0x174988,_0x48ec5e){return function(_0x2caa30){if(_0x2caa30){return _0x2caa30[_0xe6a7('0x21')]()['then'](function(){_0x174988[_0xe6a7('0x22')](0xcc)[_0xe6a7('0x17')]();});}};}function handleEntityNotFound(_0x3a5c68,_0xa409be){return function(_0x9b206){if(!_0x9b206){_0x3a5c68['sendStatus'](0x194);}return _0x9b206;};}function handleError(_0x3a3089,_0x44a0eb){_0x44a0eb=_0x44a0eb||0x1f4;return function(_0x2fbc7b){logger[_0xe6a7('0x23')](_0x2fbc7b['stack']);if(_0x2fbc7b['name']){delete _0x2fbc7b[_0xe6a7('0x24')];}_0x3a3089[_0xe6a7('0x22')](_0x44a0eb)['send'](_0x2fbc7b);};}exports[_0xe6a7('0x25')]=function(_0x3a60e4,_0x58c113){var _0x89cdbf={},_0x1ecc08={},_0x31e4d5={'count':0x0,'rows':[]};var _0x3a877c=_['map'](db['CmHopperHistory'][_0xe6a7('0x26')],function(_0x56c1cd){return{'name':_0x56c1cd[_0xe6a7('0x27')],'type':_0x56c1cd[_0xe6a7('0x28')][_0xe6a7('0x29')]};});_0x1ecc08[_0xe6a7('0x2a')]=_[_0xe6a7('0x2b')](_0x3a877c,'name');_0x1ecc08[_0xe6a7('0x2c')]=_[_0xe6a7('0x2d')](_0x3a60e4[_0xe6a7('0x2c')]);_0x1ecc08['filters']=_['intersection'](_0x1ecc08[_0xe6a7('0x2a')],_0x1ecc08[_0xe6a7('0x2c')]);_0x89cdbf[_0xe6a7('0x2e')]=_['intersection'](_0x1ecc08[_0xe6a7('0x2a')],qs[_0xe6a7('0x2f')](_0x3a60e4[_0xe6a7('0x2c')]['fields']));_0x89cdbf[_0xe6a7('0x2e')]=_0x89cdbf[_0xe6a7('0x2e')][_0xe6a7('0x30')]?_0x89cdbf['attributes']:_0x1ecc08[_0xe6a7('0x2a')];if(!_0x3a60e4['query'][_0xe6a7('0x31')](_0xe6a7('0x32'))){_0x89cdbf[_0xe6a7('0x33')]=qs['limit'](_0x3a60e4['query'][_0xe6a7('0x33')]);_0x89cdbf[_0xe6a7('0x19')]=qs[_0xe6a7('0x19')](_0x3a60e4[_0xe6a7('0x2c')][_0xe6a7('0x19')]);}_0x89cdbf[_0xe6a7('0x34')]=qs['sort'](_0x3a60e4[_0xe6a7('0x2c')][_0xe6a7('0x35')]);_0x89cdbf[_0xe6a7('0x36')]=qs['filters'](_['pick'](_0x3a60e4['query'],_0x1ecc08[_0xe6a7('0x37')]),_0x3a877c);if(_0x3a60e4[_0xe6a7('0x2c')][_0xe6a7('0x38')]){_0x89cdbf['where']=_[_0xe6a7('0x39')](_0x89cdbf[_0xe6a7('0x36')],{'$or':_['map'](_0x3a877c,function(_0x170d79){if(_0x170d79[_0xe6a7('0x28')]!==_0xe6a7('0x3a')){var _0x2ec4b0={};_0x2ec4b0[_0x170d79['name']]={'$like':'%'+_0x3a60e4['query'][_0xe6a7('0x38')]+'%'};return _0x2ec4b0;}})});}_0x89cdbf=_[_0xe6a7('0x39')]({},_0x89cdbf,_0x3a60e4[_0xe6a7('0x3b')]);var _0x2e6fe4={'where':_0x89cdbf['where']};return db[_0xe6a7('0x3c')][_0xe6a7('0x1b')](_0x2e6fe4)['then'](function(_0x4228f7){_0x31e4d5[_0xe6a7('0x1b')]=_0x4228f7;if(_0x3a60e4[_0xe6a7('0x2c')]['includeAll']){_0x89cdbf['include']=[{'all':!![]}];}return db[_0xe6a7('0x3c')][_0xe6a7('0x3d')](_0x89cdbf);})[_0xe6a7('0x20')](function(_0x5220d7){_0x31e4d5[_0xe6a7('0x3e')]=_0x5220d7;return _0x31e4d5;})['then'](respondWithFilteredResult(_0x58c113,_0x89cdbf))[_0xe6a7('0x3f')](handleError(_0x58c113,null));};exports[_0xe6a7('0x40')]=function(_0x56172f,_0xeb5b3e){var _0x45688f={'raw':!![],'where':{'id':_0x56172f[_0xe6a7('0x41')]['id']}},_0x12e0c3={};_0x12e0c3['model']=_[_0xe6a7('0x2d')](db[_0xe6a7('0x3c')]['rawAttributes']);_0x12e0c3[_0xe6a7('0x2c')]=_[_0xe6a7('0x2d')](_0x56172f['query']);_0x12e0c3['filters']=_[_0xe6a7('0x42')](_0x12e0c3[_0xe6a7('0x2a')],_0x12e0c3[_0xe6a7('0x2c')]);_0x45688f[_0xe6a7('0x2e')]=_[_0xe6a7('0x42')](_0x12e0c3['model'],qs[_0xe6a7('0x2f')](_0x56172f[_0xe6a7('0x2c')][_0xe6a7('0x2f')]));_0x45688f[_0xe6a7('0x2e')]=_0x45688f[_0xe6a7('0x2e')]['length']?_0x45688f[_0xe6a7('0x2e')]:_0x12e0c3[_0xe6a7('0x2a')];if(_0x56172f[_0xe6a7('0x2c')][_0xe6a7('0x43')]){_0x45688f[_0xe6a7('0x44')]=[{'all':!![]}];}_0x45688f=_[_0xe6a7('0x39')]({},_0x45688f,_0x56172f['options']);return db['CmHopperHistory'][_0xe6a7('0x45')](_0x45688f)['then'](handleEntityNotFound(_0xeb5b3e,null))['then'](respondWithResult(_0xeb5b3e,null))[_0xe6a7('0x3f')](handleError(_0xeb5b3e,null));};exports['create']=function(_0x4a8ac5,_0x3d917a){return db['CmHopperHistory']['create'](_0x4a8ac5['body'],{})[_0xe6a7('0x20')](respondWithResult(_0x3d917a,0xc9))[_0xe6a7('0x3f')](handleError(_0x3d917a,null));};exports[_0xe6a7('0x46')]=function(_0xe7f5ba,_0x5f20a8){return db['CmHopperHistory'][_0xe6a7('0x46')]()[_0xe6a7('0x20')](respondWithResult(_0x5f20a8,null))[_0xe6a7('0x3f')](handleError(_0x5f20a8,null));};exports['update']=function(_0x599d76,_0x208fe6){if(_0x599d76['body'][_0xe6a7('0x47')]){delete _0x599d76[_0xe6a7('0x48')][_0xe6a7('0x47')];}return db[_0xe6a7('0x3c')][_0xe6a7('0x45')]({'where':{'uniqueid':_0x599d76[_0xe6a7('0x41')]['id']}})[_0xe6a7('0x20')](handleEntityNotFound(_0x208fe6,null))[_0xe6a7('0x20')](saveUpdates(_0x599d76[_0xe6a7('0x48')],null))[_0xe6a7('0x20')](respondWithResult(_0x208fe6,null))[_0xe6a7('0x3f')](handleError(_0x208fe6,null));}; \ No newline at end of file +var _0xda1b=['nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','body','describe','update','uniqueid','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','end','error','stack','name','index','map','CmHopperHistory','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x9edfd5,_0x286486){var _0x330738=function(_0x4aceb3){while(--_0x4aceb3){_0x9edfd5['push'](_0x9edfd5['shift']());}};_0x330738(++_0x286486);}(_0xda1b,0xaa));var _0xbda1=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xda1b[_0x5f309e];return _0x487b5e;};'use strict';var emlformat=require(_0xbda1('0x0'));var rimraf=require(_0xbda1('0x1'));var zipdir=require(_0xbda1('0x2'));var jsonpatch=require(_0xbda1('0x3'));var rp=require(_0xbda1('0x4'));var moment=require('moment');var BPromise=require(_0xbda1('0x5'));var Mustache=require('mustache');var util=require(_0xbda1('0x6'));var path=require(_0xbda1('0x7'));var sox=require('sox');var csv=require(_0xbda1('0x8'));var ejs=require(_0xbda1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbda1('0xa'));var crypto=require(_0xbda1('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbda1('0x8'));var querystring=require(_0xbda1('0xc'));var Papa=require(_0xbda1('0xd'));var Redis=require(_0xbda1('0xe'));var authService=require(_0xbda1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbda1('0x10'));var hardwareService=require(_0xbda1('0x11'));var logger=require(_0xbda1('0x12'))(_0xbda1('0x13'));var utils=require(_0xbda1('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbda1('0x15'))['db'];function respondWithStatusCode(_0x106b33,_0x38455f){_0x38455f=_0x38455f||0xcc;return function(_0x371c6b){if(_0x371c6b){return _0x106b33[_0xbda1('0x16')](_0x38455f);}return _0x106b33[_0xbda1('0x17')](_0x38455f)['end']();};}function respondWithResult(_0x4b573a,_0x44d5c3){_0x44d5c3=_0x44d5c3||0xc8;return function(_0x4f322a){if(_0x4f322a){return _0x4b573a[_0xbda1('0x17')](_0x44d5c3)['json'](_0x4f322a);}};}function respondWithFilteredResult(_0x44507c,_0x154bf2){return function(_0x31374a){if(_0x31374a){var _0x4080bb=typeof _0x154bf2[_0xbda1('0x18')]===_0xbda1('0x19')&&typeof _0x154bf2['limit']===_0xbda1('0x19');var _0x5ec291=_0x31374a[_0xbda1('0x1a')];var _0xdacdca=_0x4080bb?0x0:_0x154bf2[_0xbda1('0x18')];var _0x444cfc=_0x4080bb?_0x31374a['count']:_0x154bf2[_0xbda1('0x18')]+_0x154bf2[_0xbda1('0x1b')];var _0x424ca6;if(_0x444cfc>=_0x5ec291){_0x444cfc=_0x5ec291;_0x424ca6=0xc8;}else{_0x424ca6=0xce;}_0x44507c[_0xbda1('0x17')](_0x424ca6);return _0x44507c[_0xbda1('0x1c')](_0xbda1('0x1d'),_0xdacdca+'-'+_0x444cfc+'/'+_0x5ec291)['json'](_0x31374a);}return null;};}function patchUpdates(_0x5932f5){return function(_0x1fb077){try{jsonpatch['apply'](_0x1fb077,_0x5932f5,!![]);}catch(_0x45cbb2){return BPromise[_0xbda1('0x1e')](_0x45cbb2);}return _0x1fb077[_0xbda1('0x1f')]();};}function saveUpdates(_0x21af54,_0x5d136e){return function(_0x188af1){if(_0x188af1){return _0x188af1['update'](_0x21af54)[_0xbda1('0x20')](function(_0xda7d87){return _0xda7d87;});}return null;};}function removeEntity(_0x351e29,_0x29f5b7){return function(_0x1edc07){if(_0x1edc07){return _0x1edc07[_0xbda1('0x21')]()['then'](function(){_0x351e29[_0xbda1('0x17')](0xcc)[_0xbda1('0x22')]();});}};}function handleEntityNotFound(_0xa4224d,_0x3438ac){return function(_0x578168){if(!_0x578168){_0xa4224d[_0xbda1('0x16')](0x194);}return _0x578168;};}function handleError(_0x24cb91,_0x2586a5){_0x2586a5=_0x2586a5||0x1f4;return function(_0x583d2f){logger[_0xbda1('0x23')](_0x583d2f[_0xbda1('0x24')]);if(_0x583d2f[_0xbda1('0x25')]){delete _0x583d2f['name'];}_0x24cb91['status'](_0x2586a5)['send'](_0x583d2f);};}exports[_0xbda1('0x26')]=function(_0x3084e6,_0x2486c9){var _0x278cd1={},_0x2f0ad3={},_0x24c04b={'count':0x0,'rows':[]};var _0x4278fe=_[_0xbda1('0x27')](db[_0xbda1('0x28')][_0xbda1('0x29')],function(_0x5f53d8){return{'name':_0x5f53d8['fieldName'],'type':_0x5f53d8['type'][_0xbda1('0x2a')]};});_0x2f0ad3['model']=_[_0xbda1('0x27')](_0x4278fe,'name');_0x2f0ad3[_0xbda1('0x2b')]=_[_0xbda1('0x2c')](_0x3084e6[_0xbda1('0x2b')]);_0x2f0ad3[_0xbda1('0x2d')]=_[_0xbda1('0x2e')](_0x2f0ad3[_0xbda1('0x2f')],_0x2f0ad3[_0xbda1('0x2b')]);_0x278cd1[_0xbda1('0x30')]=_[_0xbda1('0x2e')](_0x2f0ad3[_0xbda1('0x2f')],qs[_0xbda1('0x31')](_0x3084e6['query'][_0xbda1('0x31')]));_0x278cd1[_0xbda1('0x30')]=_0x278cd1['attributes'][_0xbda1('0x32')]?_0x278cd1[_0xbda1('0x30')]:_0x2f0ad3[_0xbda1('0x2f')];if(!_0x3084e6[_0xbda1('0x2b')][_0xbda1('0x33')](_0xbda1('0x34'))){_0x278cd1[_0xbda1('0x1b')]=qs[_0xbda1('0x1b')](_0x3084e6[_0xbda1('0x2b')]['limit']);_0x278cd1['offset']=qs['offset'](_0x3084e6[_0xbda1('0x2b')][_0xbda1('0x18')]);}_0x278cd1[_0xbda1('0x35')]=qs[_0xbda1('0x36')](_0x3084e6['query']['sort']);_0x278cd1[_0xbda1('0x37')]=qs['filters'](_[_0xbda1('0x38')](_0x3084e6[_0xbda1('0x2b')],_0x2f0ad3[_0xbda1('0x2d')]),_0x4278fe);if(_0x3084e6['query'][_0xbda1('0x39')]){_0x278cd1[_0xbda1('0x37')]=_[_0xbda1('0x3a')](_0x278cd1['where'],{'$or':_[_0xbda1('0x27')](_0x4278fe,function(_0x3cddab){if(_0x3cddab[_0xbda1('0x3b')]!==_0xbda1('0x3c')){var _0x44508c={};_0x44508c[_0x3cddab['name']]={'$like':'%'+_0x3084e6[_0xbda1('0x2b')][_0xbda1('0x39')]+'%'};return _0x44508c;}})});}_0x278cd1=_[_0xbda1('0x3a')]({},_0x278cd1,_0x3084e6[_0xbda1('0x3d')]);var _0x1712ab={'where':_0x278cd1['where']};return db[_0xbda1('0x28')][_0xbda1('0x1a')](_0x1712ab)[_0xbda1('0x20')](function(_0x7e4437){_0x24c04b[_0xbda1('0x1a')]=_0x7e4437;if(_0x3084e6['query'][_0xbda1('0x3e')]){_0x278cd1[_0xbda1('0x3f')]=[{'all':!![]}];}return db[_0xbda1('0x28')][_0xbda1('0x40')](_0x278cd1);})[_0xbda1('0x20')](function(_0x3cee8){_0x24c04b[_0xbda1('0x41')]=_0x3cee8;return _0x24c04b;})['then'](respondWithFilteredResult(_0x2486c9,_0x278cd1))['catch'](handleError(_0x2486c9,null));};exports['show']=function(_0x271dc8,_0x182171){var _0x37e776={'raw':!![],'where':{'id':_0x271dc8[_0xbda1('0x42')]['id']}},_0x4d96dc={};_0x4d96dc[_0xbda1('0x2f')]=_[_0xbda1('0x2c')](db[_0xbda1('0x28')][_0xbda1('0x29')]);_0x4d96dc[_0xbda1('0x2b')]=_['keys'](_0x271dc8[_0xbda1('0x2b')]);_0x4d96dc[_0xbda1('0x2d')]=_[_0xbda1('0x2e')](_0x4d96dc[_0xbda1('0x2f')],_0x4d96dc[_0xbda1('0x2b')]);_0x37e776['attributes']=_[_0xbda1('0x2e')](_0x4d96dc[_0xbda1('0x2f')],qs[_0xbda1('0x31')](_0x271dc8[_0xbda1('0x2b')]['fields']));_0x37e776[_0xbda1('0x30')]=_0x37e776[_0xbda1('0x30')]['length']?_0x37e776[_0xbda1('0x30')]:_0x4d96dc[_0xbda1('0x2f')];if(_0x271dc8[_0xbda1('0x2b')][_0xbda1('0x3e')]){_0x37e776[_0xbda1('0x3f')]=[{'all':!![]}];}_0x37e776=_[_0xbda1('0x3a')]({},_0x37e776,_0x271dc8['options']);return db[_0xbda1('0x28')]['find'](_0x37e776)['then'](handleEntityNotFound(_0x182171,null))[_0xbda1('0x20')](respondWithResult(_0x182171,null))[_0xbda1('0x43')](handleError(_0x182171,null));};exports[_0xbda1('0x44')]=function(_0x38b940,_0x37aa4f){return db[_0xbda1('0x28')][_0xbda1('0x44')](_0x38b940[_0xbda1('0x45')],{})[_0xbda1('0x20')](respondWithResult(_0x37aa4f,0xc9))[_0xbda1('0x43')](handleError(_0x37aa4f,null));};exports[_0xbda1('0x46')]=function(_0x8a5ac9,_0x5d51d4){return db[_0xbda1('0x28')][_0xbda1('0x46')]()[_0xbda1('0x20')](respondWithResult(_0x5d51d4,null))[_0xbda1('0x43')](handleError(_0x5d51d4,null));};exports[_0xbda1('0x47')]=function(_0x1fcadf,_0xa06510){if(_0x1fcadf['body'][_0xbda1('0x48')]){delete _0x1fcadf['body'][_0xbda1('0x48')];}return db['CmHopperHistory'][_0xbda1('0x49')]({'where':{'uniqueid':_0x1fcadf[_0xbda1('0x42')]['id']}})['then'](handleEntityNotFound(_0xa06510,null))['then'](saveUpdates(_0x1fcadf[_0xbda1('0x45')],null))[_0xbda1('0x20')](respondWithResult(_0xa06510,null))[_0xbda1('0x43')](handleError(_0xa06510,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 9123de8..96ea8f1 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 _0x9264=['api','request-promise','../../config/environment','define','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4926('0x0'));var util=require(_0x4926('0x1'));var logger=require(_0x4926('0x2'))(_0x4926('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4926('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4926('0x5'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x54e5ea,_0x3ee7b4){return _0x54e5ea[_0x4926('0x6')]('CmHopperHistory',attributes,{'tableName':_0x4926('0x7'),'paranoid':![],'indexes':[{'name':_0x4926('0x8'),'fields':['endtime']},{'name':_0x4926('0x9'),'fields':[_0x4926('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0137=['../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x370fc9,_0x4b1f71){var _0x21c87a=function(_0x2d2167){while(--_0x2d2167){_0x370fc9['push'](_0x370fc9['shift']());}};_0x21c87a(++_0x4b1f71);}(_0x0137,0x1d8));var _0x7013=function(_0x57d867,_0x2ee50b){_0x57d867=_0x57d867-0x0;var _0x33d270=_0x0137[_0x57d867];return _0x33d270;};'use strict';var _=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var logger=require(_0x7013('0x2'))(_0x7013('0x3'));var moment=require(_0x7013('0x4'));var BPromise=require('bluebird');var rp=require(_0x7013('0x5'));var fs=require('fs');var path=require(_0x7013('0x6'));var rimraf=require(_0x7013('0x7'));var config=require(_0x7013('0x8'));var attributes=require(_0x7013('0x9'));module[_0x7013('0xa')]=function(_0x50b822,_0x24cb85){return _0x50b822[_0x7013('0xb')]('CmHopperHistory',attributes,{'tableName':_0x7013('0xc'),'paranoid':![],'indexes':[{'name':_0x7013('0xd'),'fields':[_0x7013('0xd')]},{'name':'uniqueid','fields':[_0x7013('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index d13db0f..375f94b 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js +++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97a8=['`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','then','col','ivrTotalCallsDays','GetCampaignHopperHistory','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','catch','CreateCmHopperHistory','body','options','raw','stringify','AvgHandleTime','CmHopperHistory','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls'];(function(_0x240d5d,_0x10d7d0){var _0x6bb6b4=function(_0x48004c){while(--_0x48004c){_0x240d5d['push'](_0x240d5d['shift']());}};_0x6bb6b4(++_0x10d7d0);}(_0x97a8,0xe3));var _0x897a=function(_0x36b864,_0x3e7699){_0x36b864=_0x36b864-0x0;var _0x4ab1b3=_0x97a8[_0x36b864];return _0x4ab1b3;};'use strict';var _=require('lodash');var util=require(_0x897a('0x0'));var moment=require(_0x897a('0x1'));var BPromise=require(_0x897a('0x2'));var rs=require(_0x897a('0x3'));var fs=require('fs');var Redis=require(_0x897a('0x4'));var db=require(_0x897a('0x5'))['db'];var utils=require(_0x897a('0x6'));var logger=require('../../config/logger')(_0x897a('0x7'));var config=require(_0x897a('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59b9f1,_0x3eb794,_0x128644){return new BPromise(function(_0x3cd748,_0x364c09){return client[_0x897a('0x9')](_0x59b9f1,_0x128644)['then'](function(_0x18ecde){logger[_0x897a('0xa')](_0x897a('0xb'),_0x3eb794,_0x897a('0xc'));logger[_0x897a('0xd')](_0x897a('0xe'),_0x3eb794,_0x897a('0xc'),JSON['stringify'](_0x18ecde));if(_0x18ecde['error']){if(_0x18ecde['error']['code']===0x1f4){logger[_0x897a('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x3eb794,_0x18ecde[_0x897a('0xf')][_0x897a('0x10')]);return _0x364c09(_0x18ecde[_0x897a('0xf')][_0x897a('0x10')]);}logger['error'](_0x897a('0xb'),_0x3eb794,_0x18ecde[_0x897a('0xf')][_0x897a('0x10')]);return _0x3cd748(_0x18ecde[_0x897a('0xf')]['message']);}else{logger['info'](_0x897a('0xb'),_0x3eb794,_0x897a('0xc'));_0x3cd748(_0x18ecde['result'][_0x897a('0x10')]);}})[_0x897a('0x11')](function(_0xaf826e){logger[_0x897a('0xf')](_0x897a('0xb'),_0x3eb794,_0xaf826e);_0x364c09(_0xaf826e);});});}exports[_0x897a('0x12')]=function(_0x10047d){var _0x1011b4=this;return new Promise(function(_0x2646cb,_0x2d96a){return db['CmHopperHistory']['create'](_0x10047d[_0x897a('0x13')],{'raw':_0x10047d[_0x897a('0x14')]?_0x10047d[_0x897a('0x14')][_0x897a('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x73e29d){logger[_0x897a('0xa')](_0x897a('0x12'),_0x10047d);logger[_0x897a('0xd')]('CreateCmHopperHistory',_0x10047d,JSON[_0x897a('0x16')](_0x73e29d));_0x2646cb(_0x73e29d);})[_0x897a('0x11')](function(_0x584b3b){logger[_0x897a('0xf')]('CreateCmHopperHistory',_0x584b3b[_0x897a('0x10')],_0x10047d);_0x2d96a(_0x1011b4[_0x897a('0xf')](0x1f4,_0x584b3b[_0x897a('0x10')]));});});};exports[_0x897a('0x17')]=function(_0x22e77a){var _0x48b8fd=this;return new Promise(function(_0x3873b7,_0x2feb39){return db[_0x897a('0x18')][_0x897a('0x19')]({'raw':_0x22e77a[_0x897a('0x14')]?_0x22e77a[_0x897a('0x14')][_0x897a('0x15')]===undefined?!![]:![]:!![],'where':_0x22e77a[_0x897a('0x14')]?_0x22e77a[_0x897a('0x14')][_0x897a('0x1a')]||null:null,'attributes':[[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['col']('id')),_0x897a('0x1d')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x1f')))),_0x897a('0x20')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')]['literal'](_0x897a('0x21')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x22')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x897a('0x1b')]['fn'](_0x897a('0x23'),db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x897a('0x1b')]['fn'](_0x897a('0x23'),db[_0x897a('0x1b')]['fn']('IF',db['sequelize'][_0x897a('0x1e')](_0x897a('0x24')))),_0x897a('0x25')]]})['then'](function(_0x2eef3f){logger[_0x897a('0xa')]('AvgHandleTime',_0x22e77a);logger['debug'](_0x897a('0x17'),_0x22e77a,JSON['stringify'](_0x2eef3f));_0x3873b7(_0x2eef3f);})['catch'](function(_0x348d4a){logger[_0x897a('0xf')](_0x897a('0x17'),_0x348d4a[_0x897a('0x10')],_0x22e77a);_0x2feb39(_0x48b8fd['error'](0x1f4,_0x348d4a['message']));});});};exports[_0x897a('0x26')]=function(_0x1f2044){var _0x473191=this;return new Promise(function(_0x1cb85d,_0x388b76){return db['CmHopperHistory'][_0x897a('0x19')]({'raw':_0x1f2044[_0x897a('0x14')]?_0x1f2044['options'][_0x897a('0x15')]===undefined?!![]:![]:!![],'where':_0x1f2044['options']?_0x1f2044[_0x897a('0x14')][_0x897a('0x1a')]||null:null,'attributes':[[_0x897a('0x27'),_0x897a('0x28')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x29')))),'outboundNoSuchCallsDay'],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')]['literal'](_0x897a('0x2a')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x1f')))),_0x897a('0x2b')],[db[_0x897a('0x1b')]['fn']('COUNT',db[_0x897a('0x1b')]['fn']('IF',db['sequelize'][_0x897a('0x1e')](_0x897a('0x2c')))),'outboundBusyCallsDay'],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x2d')))),'outboundCongestionCallsDay'],[db['sequelize']['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x2e')))),_0x897a('0x2f')],[db[_0x897a('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x30')))),_0x897a('0x31')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x32')))),_0x897a('0x33')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x34')))),_0x897a('0x35')],[db['sequelize']['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['fn']('IF',db['sequelize']['literal'](_0x897a('0x36')))),_0x897a('0x37')],[db['sequelize']['fn']('COUNT',db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')]['literal'](_0x897a('0x38')))),_0x897a('0x39')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')]['literal'](_0x897a('0x3a')))),_0x897a('0x3b')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')]['literal'](_0x897a('0x3c')))),_0x897a('0x39')],[db[_0x897a('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x897a('0x27')]})[_0x897a('0x3d')](function(_0x17e3eb){logger[_0x897a('0xa')](_0x897a('0x26'),_0x1f2044);logger['debug'](_0x897a('0x26'),_0x1f2044,JSON[_0x897a('0x16')](_0x17e3eb));_0x1cb85d(_0x17e3eb);})[_0x897a('0x11')](function(_0x2e9df4){logger[_0x897a('0xf')]('GetVoiceQueueHopperHistory',_0x2e9df4[_0x897a('0x10')],_0x1f2044);_0x388b76(_0x473191[_0x897a('0xf')](0x1f4,_0x2e9df4[_0x897a('0x10')]));});});};exports['GetCampaignHopperHistory']=function(_0x3cf53f){var _0x485cca=this;return new Promise(function(_0x181d71,_0x5165bd){return db[_0x897a('0x18')][_0x897a('0x19')]({'raw':_0x3cf53f[_0x897a('0x14')]?_0x3cf53f[_0x897a('0x14')][_0x897a('0x15')]===undefined?!![]:![]:!![],'where':_0x3cf53f[_0x897a('0x14')]?_0x3cf53f[_0x897a('0x14')][_0x897a('0x1a')]||null:null,'attributes':[[_0x897a('0x27'),_0x897a('0x28')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')][_0x897a('0x3e')]('id')),_0x897a('0x3f')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x1f')))),'ivrAnswerCallsDay']],'group':[_0x897a('0x27')]})[_0x897a('0x3d')](function(_0x5e6acd){logger['info'](_0x897a('0x40'),_0x3cf53f);logger['debug'](_0x897a('0x40'),_0x3cf53f,JSON[_0x897a('0x16')](_0x5e6acd));_0x181d71(_0x5e6acd);})['catch'](function(_0x426cab){logger[_0x897a('0xf')](_0x897a('0x40'),_0x426cab[_0x897a('0x10')],_0x3cf53f);_0x5165bd(_0x485cca[_0x897a('0xf')](0x1f4,_0x426cab[_0x897a('0x10')]));});});}; \ No newline at end of file +var _0xe348=['outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','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','campaign','GetCampaignHopperHistory','col','ivrTotalCallsDays','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateCmHopperHistory','AvgHandleTime','findAll','where','COUNT','sequelize','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','literal','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null'];(function(_0x19685d,_0x76d4e6){var _0x2a66d9=function(_0x34b8ca){while(--_0x34b8ca){_0x19685d['push'](_0x19685d['shift']());}};_0x2a66d9(++_0x76d4e6);}(_0xe348,0x137));var _0x8e34=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xe348[_0xa8883];return _0x479426;};'use strict';var _=require(_0x8e34('0x0'));var util=require(_0x8e34('0x1'));var moment=require('moment');var BPromise=require(_0x8e34('0x2'));var rs=require(_0x8e34('0x3'));var fs=require('fs');var Redis=require(_0x8e34('0x4'));var db=require(_0x8e34('0x5'))['db'];var utils=require(_0x8e34('0x6'));var logger=require(_0x8e34('0x7'))(_0x8e34('0x8'));var config=require('../../config/environment');var jayson=require(_0x8e34('0x9'));var client=jayson[_0x8e34('0xa')][_0x8e34('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e8565,_0x1a5573,_0x5b4bbe){return new BPromise(function(_0x161e98,_0x41e8a8){return client['request'](_0x4e8565,_0x5b4bbe)[_0x8e34('0xc')](function(_0x3ee4d8){logger[_0x8e34('0xd')](_0x8e34('0xe'),_0x1a5573,_0x8e34('0xf'));logger[_0x8e34('0x10')](_0x8e34('0x11'),_0x1a5573,_0x8e34('0xf'),JSON[_0x8e34('0x12')](_0x3ee4d8));if(_0x3ee4d8[_0x8e34('0x13')]){if(_0x3ee4d8['error'][_0x8e34('0x14')]===0x1f4){logger[_0x8e34('0x13')](_0x8e34('0xe'),_0x1a5573,_0x3ee4d8[_0x8e34('0x13')][_0x8e34('0x15')]);return _0x41e8a8(_0x3ee4d8[_0x8e34('0x13')][_0x8e34('0x15')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x1a5573,_0x3ee4d8[_0x8e34('0x13')][_0x8e34('0x15')]);return _0x161e98(_0x3ee4d8[_0x8e34('0x13')][_0x8e34('0x15')]);}else{logger[_0x8e34('0xd')](_0x8e34('0xe'),_0x1a5573,'request\x20sent');_0x161e98(_0x3ee4d8[_0x8e34('0x16')]['message']);}})[_0x8e34('0x17')](function(_0x1b8ade){logger['error'](_0x8e34('0xe'),_0x1a5573,_0x1b8ade);_0x41e8a8(_0x1b8ade);});});}exports['CreateCmHopperHistory']=function(_0x2f174a){var _0x4a398c=this;return new Promise(function(_0x425ec1,_0x5e9b4c){return db['CmHopperHistory'][_0x8e34('0x18')](_0x2f174a[_0x8e34('0x19')],{'raw':_0x2f174a[_0x8e34('0x1a')]?_0x2f174a[_0x8e34('0x1a')][_0x8e34('0x1b')]===undefined?!![]:![]:!![]})[_0x8e34('0xc')](function(_0x5f5616){logger[_0x8e34('0xd')](_0x8e34('0x1c'),_0x2f174a);logger['debug'](_0x8e34('0x1c'),_0x2f174a,JSON[_0x8e34('0x12')](_0x5f5616));_0x425ec1(_0x5f5616);})[_0x8e34('0x17')](function(_0x1746bf){logger[_0x8e34('0x13')](_0x8e34('0x1c'),_0x1746bf['message'],_0x2f174a);_0x5e9b4c(_0x4a398c[_0x8e34('0x13')](0x1f4,_0x1746bf[_0x8e34('0x15')]));});});};exports[_0x8e34('0x1d')]=function(_0x150472){var _0x42e9f0=this;return new Promise(function(_0x36c1ef,_0x1ef7d1){return db['CmHopperHistory'][_0x8e34('0x1e')]({'raw':_0x150472[_0x8e34('0x1a')]?_0x150472[_0x8e34('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x150472['options']?_0x150472[_0x8e34('0x1a')][_0x8e34('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x8e34('0x20'),db[_0x8e34('0x21')]['col']('id')),_0x8e34('0x22')],[db['sequelize']['fn'](_0x8e34('0x20'),db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')]['literal'](_0x8e34('0x23')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0x8e34('0x20'),db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x8e34('0x24')],[db['sequelize']['fn'](_0x8e34('0x20'),db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')][_0x8e34('0x25')](_0x8e34('0x26')))),_0x8e34('0x27')],[db[_0x8e34('0x21')]['fn'](_0x8e34('0x28'),db['sequelize']['fn']('IF',db['sequelize'][_0x8e34('0x25')](_0x8e34('0x29')))),_0x8e34('0x2a')],[db['sequelize']['fn'](_0x8e34('0x28'),db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')][_0x8e34('0x25')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x8e34('0x2b')]]})['then'](function(_0x2055cc){logger[_0x8e34('0xd')](_0x8e34('0x1d'),_0x150472);logger[_0x8e34('0x10')](_0x8e34('0x1d'),_0x150472,JSON[_0x8e34('0x12')](_0x2055cc));_0x36c1ef(_0x2055cc);})[_0x8e34('0x17')](function(_0x536d42){logger[_0x8e34('0x13')](_0x8e34('0x1d'),_0x536d42[_0x8e34('0x15')],_0x150472);_0x1ef7d1(_0x42e9f0[_0x8e34('0x13')](0x1f4,_0x536d42[_0x8e34('0x15')]));});});};exports[_0x8e34('0x2c')]=function(_0x1c5284){var _0x2425ef=this;return new Promise(function(_0x499b14,_0x204287){return db[_0x8e34('0x2d')][_0x8e34('0x1e')]({'raw':_0x1c5284[_0x8e34('0x1a')]?_0x1c5284['options'][_0x8e34('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c5284[_0x8e34('0x1a')]?_0x1c5284[_0x8e34('0x1a')][_0x8e34('0x1f')]||null:null,'attributes':[['campaign',_0x8e34('0x2e')],[db[_0x8e34('0x21')]['fn'](_0x8e34('0x20'),db[_0x8e34('0x21')]['fn']('IF',db['sequelize'][_0x8e34('0x25')](_0x8e34('0x2f')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn'](_0x8e34('0x20'),db['sequelize']['fn']('IF',db[_0x8e34('0x21')][_0x8e34('0x25')](_0x8e34('0x30')))),_0x8e34('0x31')],[db[_0x8e34('0x21')]['fn']('COUNT',db[_0x8e34('0x21')]['fn']('IF',db['sequelize'][_0x8e34('0x25')](_0x8e34('0x23')))),_0x8e34('0x32')],[db[_0x8e34('0x21')]['fn']('COUNT',db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')][_0x8e34('0x25')](_0x8e34('0x33')))),_0x8e34('0x34')],[db['sequelize']['fn'](_0x8e34('0x20'),db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')][_0x8e34('0x25')](_0x8e34('0x35')))),_0x8e34('0x36')],[db[_0x8e34('0x21')]['fn']('COUNT',db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')][_0x8e34('0x25')](_0x8e34('0x37')))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn']('COUNT',db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')][_0x8e34('0x25')](_0x8e34('0x38')))),_0x8e34('0x39')],[db[_0x8e34('0x21')]['fn'](_0x8e34('0x20'),db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')][_0x8e34('0x25')](_0x8e34('0x3a')))),_0x8e34('0x3b')],[db[_0x8e34('0x21')]['fn']('COUNT',db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')][_0x8e34('0x25')]('`state`\x20=\x2013,\x201,\x20null'))),_0x8e34('0x3c')],[db[_0x8e34('0x21')]['fn'](_0x8e34('0x20'),db['sequelize']['fn']('IF',db[_0x8e34('0x21')][_0x8e34('0x25')]('`state`\x20=\x2014,\x201,\x20null'))),_0x8e34('0x3d')],[db[_0x8e34('0x21')]['fn'](_0x8e34('0x20'),db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')][_0x8e34('0x25')](_0x8e34('0x3e')))),_0x8e34('0x3f')],[db[_0x8e34('0x21')]['fn'](_0x8e34('0x20'),db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')][_0x8e34('0x25')](_0x8e34('0x40')))),'outboundAnswerAgiCallsDay'],[db[_0x8e34('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x8e34('0x25')](_0x8e34('0x41')))),'outboundRejectCallsDay'],[db[_0x8e34('0x21')]['fn'](_0x8e34('0x20'),db[_0x8e34('0x21')]['fn']('IF',db[_0x8e34('0x21')]['literal'](_0x8e34('0x42')))),_0x8e34('0x43')]],'group':[_0x8e34('0x44')]})[_0x8e34('0xc')](function(_0x5bf1fe){logger[_0x8e34('0xd')](_0x8e34('0x2c'),_0x1c5284);logger[_0x8e34('0x10')](_0x8e34('0x2c'),_0x1c5284,JSON['stringify'](_0x5bf1fe));_0x499b14(_0x5bf1fe);})[_0x8e34('0x17')](function(_0x44e28b){logger[_0x8e34('0x13')](_0x8e34('0x2c'),_0x44e28b[_0x8e34('0x15')],_0x1c5284);_0x204287(_0x2425ef[_0x8e34('0x13')](0x1f4,_0x44e28b[_0x8e34('0x15')]));});});};exports[_0x8e34('0x45')]=function(_0x1e0871){var _0xfd3d3a=this;return new Promise(function(_0x3d3b04,_0x3b3423){return db[_0x8e34('0x2d')][_0x8e34('0x1e')]({'raw':_0x1e0871['options']?_0x1e0871[_0x8e34('0x1a')][_0x8e34('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e0871[_0x8e34('0x1a')]?_0x1e0871[_0x8e34('0x1a')][_0x8e34('0x1f')]||null:null,'attributes':[['campaign',_0x8e34('0x2e')],[db[_0x8e34('0x21')]['fn']('COUNT',db['sequelize'][_0x8e34('0x46')]('id')),_0x8e34('0x47')],[db[_0x8e34('0x21')]['fn'](_0x8e34('0x20'),db[_0x8e34('0x21')]['fn']('IF',db['sequelize'][_0x8e34('0x25')](_0x8e34('0x23')))),'ivrAnswerCallsDay']],'group':[_0x8e34('0x44')]})[_0x8e34('0xc')](function(_0x198bd7){logger[_0x8e34('0xd')](_0x8e34('0x45'),_0x1e0871);logger['debug'](_0x8e34('0x45'),_0x1e0871,JSON['stringify'](_0x198bd7));_0x3d3b04(_0x198bd7);})[_0x8e34('0x17')](function(_0x5d93af){logger[_0x8e34('0x13')](_0x8e34('0x45'),_0x5d93af[_0x8e34('0x15')],_0x1e0871);_0x3b3423(_0xfd3d3a[_0x8e34('0x13')](0x1f4,_0x5d93af[_0x8e34('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 3176286..9e052a5 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 _0x284c=['create','put','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x9c58a4,_0x9d2333){var _0x2f95dd=function(_0x661a58){while(--_0x661a58){_0x9c58a4['push'](_0x9c58a4['shift']());}};_0x2f95dd(++_0x9d2333);}(_0x284c,0xe7));var _0xc284=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x284c[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xc284('0x0'));var util=require(_0xc284('0x1'));var path=require(_0xc284('0x2'));var timeout=require(_0xc284('0x3'));var express=require(_0xc284('0x4'));var router=express['Router']();var fs_extra=require(_0xc284('0x5'));var auth=require(_0xc284('0x6'));var interaction=require(_0xc284('0x7'));var config=require('../../config/environment');var controller=require(_0xc284('0x8'));router[_0xc284('0x9')]('/',auth[_0xc284('0xa')](),controller[_0xc284('0xb')]);router[_0xc284('0x9')]('/describe',auth[_0xc284('0xa')](),controller[_0xc284('0xc')]);router[_0xc284('0x9')](_0xc284('0xd'),auth[_0xc284('0xa')](),controller[_0xc284('0xe')]);router[_0xc284('0xf')]('/',auth[_0xc284('0xa')](),controller[_0xc284('0x10')]);router[_0xc284('0x11')](_0xc284('0xd'),auth[_0xc284('0xa')](),controller['update']);module[_0xc284('0x12')]=router; \ No newline at end of file +var _0xbe84=['create','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x58c6a9,_0x3a0caf){var _0x394f21=function(_0x37ddc2){while(--_0x37ddc2){_0x58c6a9['push'](_0x58c6a9['shift']());}};_0x394f21(++_0x3a0caf);}(_0xbe84,0xed));var _0x4be8=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xbe84[_0xd1d19a];return _0x52a79d;};'use strict';var multer=require(_0x4be8('0x0'));var util=require('util');var path=require(_0x4be8('0x1'));var timeout=require('connect-timeout');var express=require(_0x4be8('0x2'));var router=express[_0x4be8('0x3')]();var fs_extra=require(_0x4be8('0x4'));var auth=require(_0x4be8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4be8('0x6'));var controller=require('./cmHopperHistory.controller');router[_0x4be8('0x7')]('/',auth[_0x4be8('0x8')](),controller[_0x4be8('0x9')]);router[_0x4be8('0x7')](_0x4be8('0xa'),auth['isAuthenticated'](),controller[_0x4be8('0xb')]);router[_0x4be8('0x7')](_0x4be8('0xc'),auth[_0x4be8('0x8')](),controller[_0x4be8('0xd')]);router[_0x4be8('0xe')]('/',auth[_0x4be8('0x8')](),controller[_0x4be8('0xf')]);router['put'](_0x4be8('0xc'),auth[_0x4be8('0x8')](),controller[_0x4be8('0x10')]);module[_0x4be8('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index fb5a43f..f50a38a 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 _0x8403=['name','sequelize','exports','STRING'];(function(_0x84fd2,_0x1c6bdd){var _0x3e869e=function(_0x2f60ee){while(--_0x2f60ee){_0x84fd2['push'](_0x84fd2['shift']());}};_0x3e869e(++_0x1c6bdd);}(_0x8403,0x1a5));var _0x3840=function(_0x1994d7,_0x52ab9c){_0x1994d7=_0x1994d7-0x0;var _0x5f4e57=_0x8403[_0x1994d7];return _0x5f4e57;};'use strict';var Sequelize=require(_0x3840('0x0'));module[_0x3840('0x1')]={'name':{'type':Sequelize[_0x3840('0x2')],'unique':_0x3840('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3840('0x2')]},'dialPrefix':{'type':Sequelize[_0x3840('0x2')]}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING','name'];(function(_0x33daaa,_0x140943){var _0x372794=function(_0x52a9d9){while(--_0x52a9d9){_0x33daaa['push'](_0x33daaa['shift']());}};_0x372794(++_0x140943);}(_0x34e8,0x12c));var _0x834e=function(_0x43b52f,_0x364fb3){_0x43b52f=_0x43b52f-0x0;var _0x18f5f5=_0x34e8[_0x43b52f];return _0x18f5f5;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'unique':_0x834e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x834e('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index f946691..f841f09 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 _0xa9e0=['set','apply','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','CmList','includeAll','include','findAll','catch','show','params','create','body','role','user','get','Lists','UserProfileSection','find','autoAssociation','describe','ListId','getDispositions','Disposition','hasOwnProperty','rows','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','success','errors','getContacts','CmCustomField','CustomFields','concat','cf_%d','pick','raw','ContactItemType','OrderBy','alias','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','field','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','select','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','format','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findOne','findAndCountAll','addAgents','omit','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','spread','message','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','redis','defaults','localhost','./cmList.socket','register','status','offset','undefined','limit','count'];(function(_0x4c3afd,_0x3e7a45){var _0x4e2ef3=function(_0x426053){while(--_0x426053){_0x4c3afd['push'](_0x4c3afd['shift']());}};_0x4e2ef3(++_0x3e7a45);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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'];var csv_results;config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=typeof _0x5a0a06[_0x0a9e('0x1b')]===_0x0a9e('0x1c')&&typeof _0x5a0a06[_0x0a9e('0x1d')]===_0x0a9e('0x1c');var _0x530eb7=_0x459eb1[_0x0a9e('0x1e')];var _0x1314ae=_0x478723?0x0:_0x5a0a06[_0x0a9e('0x1b')];var _0x1c696a=_0x478723?_0x459eb1[_0x0a9e('0x1e')]:_0x5a0a06['offset']+_0x5a0a06[_0x0a9e('0x1d')];var _0x155cce;if(_0x1c696a>=_0x530eb7){_0x1c696a=_0x530eb7;_0x155cce=0xc8;}else{_0x155cce=0xce;}_0x225616['status'](_0x155cce);return _0x225616[_0x0a9e('0x1f')]('Content-Range',_0x1314ae+'-'+_0x1c696a+'/'+_0x530eb7)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x3a02e1){return function(_0x432e56){try{jsonpatch[_0x0a9e('0x20')](_0x432e56,_0x3a02e1,!![]);}catch(_0x30bae6){return BPromise['reject'](_0x30bae6);}return _0x432e56[_0x0a9e('0x21')]();};}function saveUpdates(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x22')](_0x2fb0e4)[_0x0a9e('0x23')](function(_0x16b1ca){return _0x16b1ca;});}return null;};}function removeEntity(_0x5ea472,_0x59181e){return function(_0x197ec0){if(_0x197ec0){return _0x197ec0[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x33161b=_0x197ec0['get']({'plain':!![]});var _0x384319='Lists';return db[_0x0a9e('0x25')]['destroy']({'where':{'type':_0x384319,'resourceId':_0x33161b['id']}})[_0x0a9e('0x23')](function(){return _0x197ec0;});})[_0x0a9e('0x23')](function(){_0x5ea472[_0x0a9e('0x1a')](0xcc)[_0x0a9e('0x26')]();});}};}function handleEntityNotFound(_0x140511,_0x1538a4){return function(_0x11c3b6){if(!_0x11c3b6){_0x140511[_0x0a9e('0x27')](0x194);}return _0x11c3b6;};}function handleError(_0x5a101a,_0x3652a7){_0x3652a7=_0x3652a7||0x1f4;return function(_0x468813){logger[_0x0a9e('0x28')](_0x468813[_0x0a9e('0x29')]);if(_0x468813['name']){delete _0x468813[_0x0a9e('0x2a')];}_0x5a101a[_0x0a9e('0x1a')](_0x3652a7)[_0x0a9e('0x2b')](_0x468813);};}exports[_0x0a9e('0x2c')]=function(_0x58b06f,_0x563b45){var _0x296f41={},_0x2e8759={},_0x1dbde2={'count':0x0,'rows':[]};var _0x540530=_[_0x0a9e('0x2d')](db['CmList'][_0x0a9e('0x2e')],function(_0x3ae878){return{'name':_0x3ae878[_0x0a9e('0x2f')],'type':_0x3ae878[_0x0a9e('0x30')][_0x0a9e('0x31')]};});_0x2e8759['model']=_[_0x0a9e('0x2d')](_0x540530,_0x0a9e('0x2a'));_0x2e8759[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x58b06f[_0x0a9e('0x32')]);_0x2e8759[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2e8759[_0x0a9e('0x36')],_0x2e8759['query']);_0x296f41[_0x0a9e('0x37')]=_['intersection'](_0x2e8759[_0x0a9e('0x36')],qs[_0x0a9e('0x38')](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x296f41['attributes']=_0x296f41[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x296f41[_0x0a9e('0x37')]:_0x2e8759[_0x0a9e('0x36')];if(!_0x58b06f['query']['hasOwnProperty'](_0x0a9e('0x3a'))){_0x296f41['limit']=qs[_0x0a9e('0x1d')](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x296f41[_0x0a9e('0x1b')]=qs['offset'](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}_0x296f41[_0x0a9e('0x3b')]=qs['sort'](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0x296f41[_0x0a9e('0x3d')]=qs['filters'](_['pick'](_0x58b06f[_0x0a9e('0x32')],_0x2e8759[_0x0a9e('0x34')]),_0x540530);if(_0x58b06f['query'][_0x0a9e('0x3e')]){_0x296f41[_0x0a9e('0x3d')]=_[_0x0a9e('0x3f')](_0x296f41[_0x0a9e('0x3d')],{'$or':_['map'](_0x540530,function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x30')]!==_0x0a9e('0x40')){var _0x53f3ee={};_0x53f3ee[_0x5a594b[_0x0a9e('0x2a')]]={'$like':'%'+_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x3e')]+'%'};return _0x53f3ee;}})});}_0x296f41=_['merge']({},_0x296f41,_0x58b06f[_0x0a9e('0x41')]);var _0x2cfea9={'where':_0x296f41[_0x0a9e('0x3d')]};return db[_0x0a9e('0x42')][_0x0a9e('0x1e')](_0x2cfea9)[_0x0a9e('0x23')](function(_0x2881b3){_0x1dbde2[_0x0a9e('0x1e')]=_0x2881b3;if(_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x43')]){_0x296f41[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x42')][_0x0a9e('0x45')](_0x296f41);})[_0x0a9e('0x23')](function(_0x37f6cc){_0x1dbde2['rows']=_0x37f6cc;return _0x1dbde2;})['then'](respondWithFilteredResult(_0x563b45,_0x296f41))[_0x0a9e('0x46')](handleError(_0x563b45,null));};exports[_0x0a9e('0x47')]=function(_0x405c8f,_0x315881){var _0x1a69dd={'raw':![],'where':{'id':_0x405c8f[_0x0a9e('0x48')]['id']}},_0xc9a702={};_0xc9a702[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db[_0x0a9e('0x42')][_0x0a9e('0x2e')]);_0xc9a702[_0x0a9e('0x32')]=_['keys'](_0x405c8f[_0x0a9e('0x32')]);_0xc9a702[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0xc9a702[_0x0a9e('0x36')],_0xc9a702[_0x0a9e('0x32')]);_0x1a69dd[_0x0a9e('0x37')]=_[_0x0a9e('0x35')](_0xc9a702[_0x0a9e('0x36')],qs['fields'](_0x405c8f[_0x0a9e('0x32')]['fields']));_0x1a69dd[_0x0a9e('0x37')]=_0x1a69dd[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x1a69dd['attributes']:_0xc9a702[_0x0a9e('0x36')];if(_0x405c8f[_0x0a9e('0x32')][_0x0a9e('0x43')]){_0x1a69dd[_0x0a9e('0x44')]=[{'all':!![]}];}_0x1a69dd=_[_0x0a9e('0x3f')]({},_0x1a69dd,_0x405c8f[_0x0a9e('0x41')]);return db[_0x0a9e('0x42')]['find'](_0x1a69dd)[_0x0a9e('0x23')](handleEntityNotFound(_0x315881,null))[_0x0a9e('0x23')](respondWithResult(_0x315881,null))[_0x0a9e('0x46')](handleError(_0x315881,null));};exports[_0x0a9e('0x49')]=function(_0x409789,_0x992c77){return db[_0x0a9e('0x42')][_0x0a9e('0x49')](_0x409789[_0x0a9e('0x4a')],{})['then'](function(_0xe401a){var _0x3fe430=_0x409789['user']['get']({'plain':!![]});if(!_0x3fe430)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fe430[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){var _0x37edaa=_0xe401a[_0x0a9e('0x4d')]({'plain':!![]});var _0x61bb17=_0x0a9e('0x4e');return db[_0x0a9e('0x4f')][_0x0a9e('0x50')]({'where':{'name':_0x61bb17,'userProfileId':_0x3fe430['userProfileId']},'raw':!![]})['then'](function(_0x53975a){if(_0x53975a&&_0x53975a[_0x0a9e('0x51')]===0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x49')]({'name':_0x37edaa['name'],'resourceId':_0x37edaa['id'],'type':_0x53975a[_0x0a9e('0x2a')],'sectionId':_0x53975a['id']},{})[_0x0a9e('0x23')](function(){return _0xe401a;});}else{return _0xe401a;}})['catch'](function(_0x5a88da){logger[_0x0a9e('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a88da);throw _0x5a88da;});}return _0xe401a;})[_0x0a9e('0x23')](respondWithResult(_0x992c77,0xc9))['catch'](handleError(_0x992c77,null));};exports[_0x0a9e('0x22')]=function(_0x3c20b2,_0x439340){if(_0x3c20b2['body']['id']){delete _0x3c20b2[_0x0a9e('0x4a')]['id'];}return db[_0x0a9e('0x42')]['find']({'where':{'id':_0x3c20b2['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x439340,null))[_0x0a9e('0x23')](saveUpdates(_0x3c20b2['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x439340,null))['catch'](handleError(_0x439340,null));};exports[_0x0a9e('0x24')]=function(_0x523cd2,_0xe22ccc){return db['CmList']['find']({'where':{'id':_0x523cd2['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0xe22ccc,null))['then'](removeEntity(_0xe22ccc,null))[_0x0a9e('0x46')](handleError(_0xe22ccc,null));};exports[_0x0a9e('0x52')]=function(_0x3cfd00,_0x19b4df){return db[_0x0a9e('0x42')][_0x0a9e('0x52')]()[_0x0a9e('0x23')](respondWithResult(_0x19b4df,null))[_0x0a9e('0x46')](handleError(_0x19b4df,null));};exports['addDisposition']=function(_0x1c693e,_0x121cef,_0x2642bb){if(_0x1c693e[_0x0a9e('0x4a')]['id']){delete _0x1c693e[_0x0a9e('0x4a')]['id'];}return db[_0x0a9e('0x42')]['find']({'where':{'id':_0x1c693e[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x121cef,null))['then'](function(_0x3649cc){if(_0x3649cc){_0x1c693e['body'][_0x0a9e('0x53')]=_0x3649cc['id'];return db['Disposition']['create'](_0x1c693e['body']);}})[_0x0a9e('0x23')](respondWithResult(_0x121cef,null))['catch'](handleError(_0x121cef,null));};exports[_0x0a9e('0x54')]=function(_0x1fc70e,_0x261adb,_0x7be420){var _0x1cca9f={'raw':![],'where':{}};var _0x26d7db={};var _0x49eed0={'count':0x0,'rows':[]};return db[_0x0a9e('0x42')]['findOne']({'where':{'id':_0x1fc70e[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x261adb,null))[_0x0a9e('0x23')](function(_0x5adf8f){if(_0x5adf8f){_0x26d7db[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db[_0x0a9e('0x55')][_0x0a9e('0x2e')]);_0x26d7db['query']=_[_0x0a9e('0x33')](_0x1fc70e[_0x0a9e('0x32')]);_0x26d7db['filters']=_[_0x0a9e('0x35')](_0x26d7db[_0x0a9e('0x36')],_0x26d7db[_0x0a9e('0x32')]);_0x1cca9f[_0x0a9e('0x37')]=_[_0x0a9e('0x35')](_0x26d7db['model'],qs[_0x0a9e('0x38')](_0x1fc70e[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x1cca9f['attributes']=_0x1cca9f[_0x0a9e('0x37')]['length']?_0x1cca9f['attributes']:_0x26d7db[_0x0a9e('0x36')];if(!_0x1fc70e[_0x0a9e('0x32')][_0x0a9e('0x56')](_0x0a9e('0x3a'))){_0x1cca9f[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x1fc70e[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x1cca9f[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x1fc70e[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}_0x1cca9f[_0x0a9e('0x3b')]=qs[_0x0a9e('0x3c')](_0x1fc70e[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0x1cca9f[_0x0a9e('0x3d')]=qs[_0x0a9e('0x34')](_['pick'](_0x1fc70e[_0x0a9e('0x32')],_0x26d7db[_0x0a9e('0x34')]));_0x1cca9f[_0x0a9e('0x3d')]['ListId']=_0x5adf8f['id'];if(_0x1fc70e[_0x0a9e('0x32')][_0x0a9e('0x3e')]){_0x1cca9f['where']=_[_0x0a9e('0x3f')](_0x1cca9f[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x2d')](_0x1cca9f[_0x0a9e('0x37')],function(_0x13b5c0){var _0x4a43a8={};_0x4a43a8[_0x13b5c0]={'$like':'%'+_0x1fc70e['query']['filter']+'%'};return _0x4a43a8;})});}_0x1cca9f=_[_0x0a9e('0x3f')]({},_0x1cca9f,_0x1fc70e[_0x0a9e('0x41')]);return db[_0x0a9e('0x55')][_0x0a9e('0x1e')]({'where':_0x1cca9f[_0x0a9e('0x3d')]})[_0x0a9e('0x23')](function(_0xeef20){_0x49eed0[_0x0a9e('0x1e')]=_0xeef20;if(_0x1fc70e['query'][_0x0a9e('0x43')]){_0x1cca9f[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x55')]['findAll'](_0x1cca9f);})[_0x0a9e('0x23')](function(_0x583b2e){_0x49eed0[_0x0a9e('0x57')]=_0x583b2e;return _0x49eed0;});}})[_0x0a9e('0x23')](respondWithFilteredResult(_0x261adb,_0x1cca9f))['catch'](handleError(_0x261adb,null));};exports[_0x0a9e('0x58')]=function(_0x75912a,_0x2cc7a7,_0x317c0c){return db['CmList'][_0x0a9e('0x50')]({'where':{'id':_0x75912a[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2cc7a7,null))[_0x0a9e('0x23')](function(_0x5b7fc3){if(_0x5b7fc3){return _0x5b7fc3[_0x0a9e('0x58')](_0x75912a[_0x0a9e('0x32')][_0x0a9e('0x59')]);}})[_0x0a9e('0x23')](respondWithStatusCode(_0x2cc7a7,null))['catch'](handleError(_0x2cc7a7,null));};exports[_0x0a9e('0x5a')]=function(_0x3511c9,_0x30a4c7,_0xf410e5){return db[_0x0a9e('0x42')][_0x0a9e('0x50')]({'where':{'id':_0x3511c9[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x30a4c7,null))[_0x0a9e('0x23')](function(_0x336dc3){if(_0x336dc3){var _0xc4c230=[];var _0x1f10ef={'success':[],'errors':[]};return db[_0x0a9e('0x5b')][_0x0a9e('0x52')]()['then'](function(_0xf4120f){if(_0x3511c9[_0x0a9e('0x4a')][_0x0a9e('0x5c')]&&_['isArray'](_0x3511c9[_0x0a9e('0x4a')][_0x0a9e('0x5c')])){if(_0x3511c9[_0x0a9e('0x4a')][_0x0a9e('0x5c')]['length']){_0x3511c9['body'][_0x0a9e('0x5c')]=_0x3511c9[_0x0a9e('0x4a')]['tags'][_0x0a9e('0x5d')](';')+';';}else{_0x3511c9['body'][_0x0a9e('0x5c')]=null;}}else{_0x3511c9[_0x0a9e('0x4a')]['tags']=null;}if(_0x3511c9[_0x0a9e('0x4a')]&&_[_0x0a9e('0x5e')](_0x3511c9[_0x0a9e('0x4a')])){for(var _0x42b959=0x0;_0x42b959<_0x3511c9[_0x0a9e('0x4a')][_0x0a9e('0x39')];_0x42b959+=0x1){_0x3511c9[_0x0a9e('0x4a')][_0x42b959]['ListId']=_0x3511c9[_0x0a9e('0x48')]['id'];_0xc4c230[_0x0a9e('0x5f')](_0x3511c9[_0x0a9e('0x4a')][_0x42b959]);}return BPromise[_0x0a9e('0x60')](_0xc4c230,function(_0x492543){return db[_0x0a9e('0x5b')][_0x0a9e('0x49')](_['omit'](_0x492543,[_0x0a9e('0x59'),'id'])||{},{'fields':_['keys'](_0xf4120f),'raw':!![]})[_0x0a9e('0x23')](function(_0x2bb25a){_0x1f10ef[_0x0a9e('0x61')][_0x0a9e('0x5f')](_0x2bb25a['dataValues']);})['catch'](function(_0x353384){_0x1f10ef[_0x0a9e('0x62')][_0x0a9e('0x5f')]({'data':_0x492543,'error':_0x353384['message']});});})[_0x0a9e('0x23')](function(_0x36e975){return _0x1f10ef;})['catch'](function(_0x4e46b2){return _0x4e46b2;});}else{_0x30a4c7[_0x0a9e('0x1a')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x30a4c7,null))[_0x0a9e('0x46')](handleError(_0x30a4c7,null));};exports[_0x0a9e('0x63')]=function(_0x9044fe,_0x3bfadf,_0x3c6dd6){var _0x2600de;return db['CmList'][_0x0a9e('0x50')]({'where':{'id':_0x9044fe['params']['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':_0x0a9e('0x65')}]})[_0x0a9e('0x23')](handleEntityNotFound(_0x3bfadf,null))[_0x0a9e('0x23')](function(_0x50f8d7){if(_0x50f8d7){_0x2600de=_0x50f8d7;return db[_0x0a9e('0x5b')][_0x0a9e('0x2e')];}})[_0x0a9e('0x23')](function(_0x5b74c3){if(_0x5b74c3){var _0xb6e411={};var _0x21e592={};_0x21e592[_0x0a9e('0x36')]=_[_0x0a9e('0x66')](_[_0x0a9e('0x33')](_0x5b74c3),_[_0x0a9e('0x2d')](_0x2600de[_0x0a9e('0x65')],function(_0x11ac43){return util['format'](_0x0a9e('0x67'),_0x11ac43['id']);}));_0x21e592[_0x0a9e('0x32')]=_['keys'](_0x9044fe[_0x0a9e('0x32')]);_0x21e592[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x21e592['model'],_0x21e592[_0x0a9e('0x32')]);_0xb6e411['attributes']=_[_0x0a9e('0x35')](_0x21e592[_0x0a9e('0x36')],qs[_0x0a9e('0x38')](_0x9044fe[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0xb6e411[_0x0a9e('0x37')]=_0xb6e411[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0xb6e411['attributes']:_0x21e592[_0x0a9e('0x36')];if(!_0x9044fe[_0x0a9e('0x32')][_0x0a9e('0x56')](_0x0a9e('0x3a'))){_0xb6e411[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x9044fe[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0xb6e411[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x9044fe[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}_0xb6e411[_0x0a9e('0x3b')]=qs['sort'](_0x9044fe[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0xb6e411[_0x0a9e('0x3d')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x68')](_0x9044fe['query'],_0x21e592[_0x0a9e('0x34')]));_0xb6e411[_0x0a9e('0x69')]=!![];if(_0x9044fe['query'][_0x0a9e('0x3e')]){_0xb6e411['where']=_[_0x0a9e('0x3f')](_0xb6e411[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x2d')](_0xb6e411[_0x0a9e('0x37')],function(_0x4f4d2d){var _0x3ceba6={};_0x3ceba6[_0x4f4d2d]={'$like':'%'+_0x9044fe['query'][_0x0a9e('0x3e')]+'%'};return _0x3ceba6;})});}_0xb6e411=_[_0x0a9e('0x3f')]({},_0xb6e411,_0x9044fe['options']);return _0x2600de[_0x0a9e('0x63')](_0xb6e411);}})[_0x0a9e('0x23')](respondWithResult(_0x3bfadf,null))[_0x0a9e('0x46')](handleError(_0x3bfadf,null));};exports['getContactsCsv']=function(_0x4c788f,_0x1b82b7,_0x6ba2be){var _0x1707dc;var _0x413190;var _0x3f2f40;var _0x2450a8=_0x4c788f[_0x0a9e('0x48')]['id'];csv_results=[];return db[_0x0a9e('0x6a')][_0x0a9e('0x45')]({'attributes':['id','name'],'raw':!![],'order':[_0x0a9e('0x6b')]})['then'](function(_0x287324){_0x1707dc=_0x287324;var _0x2f7791=_[_0x0a9e('0x33')](db[_0x0a9e('0x5b')][_0x0a9e('0x2e')]);return db['CmCustomField'][_0x0a9e('0x45')]({'raw':!![],'attributes':['id',_0x0a9e('0x6c')]})[_0x0a9e('0x23')](function(_0x2aa5f2){_0x413190=_0x2aa5f2;var _0x2263f1=squel['select']()['fields'](_0x2f7791)[_0x0a9e('0x6d')]('cm_contacts','c')[_0x0a9e('0x3d')](_0x0a9e('0x6e'),_0x2450a8)[_0x0a9e('0x3d')](_0x0a9e('0x6f'))[_0x0a9e('0x70')]();for(var _0x5c689c=0x0;_0x5c689c<_0x413190['length'];_0x5c689c++){_0x2263f1['field'](_0x0a9e('0x71')+_0x413190[_0x5c689c]['id'],'customField_'+_0x413190[_0x5c689c][_0x0a9e('0x6c')]);}for(var _0x5c689c=0x0;_0x5c689c<_0x1707dc[_0x0a9e('0x39')];_0x5c689c++){_0x2263f1['field'](squel['select']()[_0x0a9e('0x72')](_0x0a9e('0x73'))['from'](_0x0a9e('0x74'))[_0x0a9e('0x3d')](_0x0a9e('0x75'),_0x1707dc[_0x5c689c]['id'])[_0x0a9e('0x3d')](_0x0a9e('0x76')),'additionalPhone_'+_0x1707dc[_0x5c689c]['name']);_0x2263f1[_0x0a9e('0x72')](squel[_0x0a9e('0x77')]()[_0x0a9e('0x72')](_0x0a9e('0x78'))[_0x0a9e('0x6d')]('cm_contact_has_items')[_0x0a9e('0x3d')](_0x0a9e('0x75'),_0x1707dc[_0x5c689c]['id'])['where'](_0x0a9e('0x76')),_0x0a9e('0x79')+_0x1707dc[_0x5c689c][_0x0a9e('0x2a')]);}var _0x2427d5=[];_0x2427d5[_0x0a9e('0x5f')](_0x2263f1[_0x0a9e('0x7a')]());BPromise[_0x0a9e('0x60')](_0x2427d5,handleQuery)[_0x0a9e('0x23')](function(_0x40dd2a){handleQuery(_0x2263f1[_0x0a9e('0x7a')]());var _0x4bdebb=csv_results[0x0];if(!_[_0x0a9e('0x7b')](_0x4bdebb)){var _0x301047=toCsv(_0x4bdebb);var _0x2ada60=Date[_0x0a9e('0x7c')]();fs[_0x0a9e('0x7d')](util['format']('/tmp/list_%d_%s.csv',_0x2450a8,_0x2ada60),_0x301047);_0x1b82b7[_0x0a9e('0x7e')](_0x0a9e('0x7f'),_0x0a9e('0x80')+util[_0x0a9e('0x81')](_0x0a9e('0x82'),_0x2450a8,_0x2ada60));_0x1b82b7['setHeader'](_0x0a9e('0x83'),_0x0a9e('0x84'));return _0x1b82b7[_0x0a9e('0x85')](util['format'](_0x0a9e('0x86'),_0x2450a8,_0x2ada60));}else{return _0x1b82b7['sendStatus'](0xcc);}});});});};exports[_0x0a9e('0x87')]=function(_0x4799d4,_0x25b745,_0x42b833){var _0xe339b1;delete _0x4799d4['body']['id'];return db[_0x0a9e('0x42')]['findOne']({'where':{'id':_0x4799d4[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x25b745,null))[_0x0a9e('0x23')](function(_0x6c47cd){if(_0x6c47cd){return db[_0x0a9e('0x88')][_0x0a9e('0x89')](function(_0x4014c7){return db[_0x0a9e('0x64')][_0x0a9e('0x49')](_0x4799d4[_0x0a9e('0x4a')],{'transaction':_0x4014c7})[_0x0a9e('0x23')](function(_0xc876d4){_0xe339b1=_0xc876d4;return _0x6c47cd[_0x0a9e('0x8a')](_0xc876d4,{'transaction':_0x4014c7});})[_0x0a9e('0x23')](function(){var _0x98c62c={'type':db[_0x0a9e('0x8b')]['TEXT'],'transaction':_0x4014c7};switch(_0x4799d4['body'][_0x0a9e('0x30')]){case'text':_0x98c62c[_0x0a9e('0x30')]=db[_0x0a9e('0x8b')]['TEXT'];break;case _0x0a9e('0x8c'):_0x98c62c[_0x0a9e('0x30')]=db[_0x0a9e('0x8b')][_0x0a9e('0x8d')];break;case'switch':_0x98c62c[_0x0a9e('0x30')]=db[_0x0a9e('0x8b')][_0x0a9e('0x8e')];_0x98c62c[_0x0a9e('0x8f')]=![];break;default:}return db['sequelize'][_0x0a9e('0x90')][_0x0a9e('0x91')](_0x0a9e('0x92'),util['format'](_0x0a9e('0x93'),_0xe339b1['id']),_0x98c62c);})[_0x0a9e('0x23')](function(){return _0xe339b1;});});}})[_0x0a9e('0x23')](respondWithResult(_0x25b745,null))['catch'](handleError(_0x25b745,null));};exports[_0x0a9e('0x94')]=function(_0x4394bb,_0x1d9b57,_0x1a7f58){var _0x2394d3={};var _0x555780={};var _0x3211d2;var _0x289e65;return db['CmList'][_0x0a9e('0x95')]({'where':{'id':_0x4394bb[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x1d9b57,null))['then'](function(_0x5c3b6f){if(_0x5c3b6f){_0x3211d2=_0x5c3b6f;_0x555780['model']=_[_0x0a9e('0x33')](db[_0x0a9e('0x64')]['rawAttributes']);_0x555780[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x4394bb[_0x0a9e('0x32')]);_0x555780['filters']=_[_0x0a9e('0x35')](_0x555780[_0x0a9e('0x36')],_0x555780[_0x0a9e('0x32')]);_0x2394d3[_0x0a9e('0x37')]=_[_0x0a9e('0x35')](_0x555780[_0x0a9e('0x36')],qs[_0x0a9e('0x38')](_0x4394bb[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x2394d3['attributes']=_0x2394d3[_0x0a9e('0x37')]['length']?_0x2394d3[_0x0a9e('0x37')]:_0x555780[_0x0a9e('0x36')];_0x2394d3[_0x0a9e('0x3b')]=qs[_0x0a9e('0x3c')](_0x4394bb[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0x2394d3['where']=qs[_0x0a9e('0x34')](_[_0x0a9e('0x68')](_0x4394bb[_0x0a9e('0x32')],_0x555780[_0x0a9e('0x34')]));_0x2394d3['where']=_[_0x0a9e('0x3f')](_0x2394d3[_0x0a9e('0x3d')],{'$or':[{'ListId':_0x5c3b6f['id']},{'ListId':null}]});if(_0x4394bb[_0x0a9e('0x32')][_0x0a9e('0x3e')]){_0x2394d3[_0x0a9e('0x3d')]=_[_0x0a9e('0x3f')](_0x2394d3[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x2d')](_0x2394d3[_0x0a9e('0x37')],function(_0x3539b7){var _0x57f0ad={};_0x57f0ad[_0x3539b7]={'$like':'%'+_0x4394bb[_0x0a9e('0x32')][_0x0a9e('0x3e')]+'%'};return _0x57f0ad;})});}_0x2394d3=_[_0x0a9e('0x3f')]({},_0x2394d3,_0x4394bb[_0x0a9e('0x41')]);return db[_0x0a9e('0x64')][_0x0a9e('0x96')](_0x2394d3);}})[_0x0a9e('0x23')](respondWithResult(_0x1d9b57,null))[_0x0a9e('0x46')](handleError(_0x1d9b57,null));};exports['getGlobalCustomFields']=function(_0x3b581c,_0xd2391){return db[_0x0a9e('0x64')]['findAndCountAll']({'where':{'ListId':null}})[_0x0a9e('0x23')](handleEntityNotFound(_0xd2391,null))[_0x0a9e('0x23')](function(_0xb0af1e){return _0xb0af1e;})[_0x0a9e('0x23')](respondWithResult(_0xd2391,null))[_0x0a9e('0x46')](handleError(_0xd2391,null));};exports[_0x0a9e('0x97')]=function(_0x424f1b,_0x336a19,_0x401601){return db[_0x0a9e('0x42')]['find']({'where':{'id':_0x424f1b[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x336a19,null))[_0x0a9e('0x23')](function(_0x3db98f){if(_0x3db98f){return _0x3db98f[_0x0a9e('0x97')](_0x424f1b[_0x0a9e('0x4a')]['ids'],_[_0x0a9e('0x98')](_0x424f1b['body'],['ids','id'])||{})['spread'](function(_0x19e4e6){for(var _0x3fa3f2=0x0;_0x3fa3f2<_0x424f1b[_0x0a9e('0x4a')][_0x0a9e('0x59')]['length'];_0x3fa3f2+=0x1){socket[_0x0a9e('0x99')](_0x0a9e('0x9a'),{'UserId':Number(_0x424f1b[_0x0a9e('0x4a')][_0x0a9e('0x59')][_0x3fa3f2]),'CmListId':Number(_0x424f1b[_0x0a9e('0x48')]['id'])});}return _0x19e4e6;});}})['then'](respondWithResult(_0x336a19,null))['catch'](handleError(_0x336a19,null));};exports[_0x0a9e('0x9b')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x42')][_0x0a9e('0x50')]({'where':{'id':_0x33bcb2[_0x0a9e('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x23')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0x9b')](_0x33bcb2['query'][_0x0a9e('0x59')])[_0x0a9e('0x23')](function(){if(_[_0x0a9e('0x5e')](_0x33bcb2['query']['ids'])){for(var _0x53ef46=0x0;_0x53ef46<_0x33bcb2[_0x0a9e('0x32')][_0x0a9e('0x59')][_0x0a9e('0x39')];_0x53ef46+=0x1){socket[_0x0a9e('0x99')]('userCmList:remove',{'UserId':Number(_0x33bcb2[_0x0a9e('0x32')]['ids'][_0x53ef46]),'CmListId':Number(_0x33bcb2[_0x0a9e('0x48')]['id'])});}}else{socket[_0x0a9e('0x99')](_0x0a9e('0x9c'),{'UserId':Number(_0x33bcb2['query'][_0x0a9e('0x59')]),'CmListId':Number(_0x33bcb2[_0x0a9e('0x48')]['id'])});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x2a293f,null))['catch'](handleError(_0x2a293f,null));};exports[_0x0a9e('0x9d')]=function(_0x4f2594,_0x1b637c,_0x5c57e1){var _0x41b90a={};var _0x57b7d4={};var _0xb14971;var _0x37215d;return db[_0x0a9e('0x42')][_0x0a9e('0x95')]({'where':{'id':_0x4f2594[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x1b637c,null))[_0x0a9e('0x23')](function(_0x5acdc9){if(_0x5acdc9){_0xb14971=_0x5acdc9;_0x57b7d4[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db['User'][_0x0a9e('0x2e')]);_0x57b7d4[_0x0a9e('0x32')]=_['keys'](_0x4f2594[_0x0a9e('0x32')]);_0x57b7d4[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x57b7d4['model'],_0x57b7d4[_0x0a9e('0x32')]);_0x41b90a[_0x0a9e('0x37')]=_[_0x0a9e('0x35')](_0x57b7d4[_0x0a9e('0x36')],qs[_0x0a9e('0x38')](_0x4f2594[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x41b90a[_0x0a9e('0x37')]=_0x41b90a[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x41b90a['attributes']:_0x57b7d4[_0x0a9e('0x36')];_0x41b90a['order']=qs[_0x0a9e('0x3c')](_0x4f2594[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0x41b90a[_0x0a9e('0x3d')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x68')](_0x4f2594['query'],_0x57b7d4[_0x0a9e('0x34')]));if(_0x4f2594[_0x0a9e('0x32')][_0x0a9e('0x3e')]){_0x41b90a['where']=_[_0x0a9e('0x3f')](_0x41b90a[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x2d')](_0x41b90a[_0x0a9e('0x37')],function(_0x31e1e0){var _0x1d0a78={};_0x1d0a78[_0x31e1e0]={'$like':'%'+_0x4f2594[_0x0a9e('0x32')]['filter']+'%'};return _0x1d0a78;})});}_0x41b90a=_[_0x0a9e('0x3f')]({},_0x41b90a,_0x4f2594[_0x0a9e('0x41')]);return _0xb14971[_0x0a9e('0x9d')](_0x41b90a);}})[_0x0a9e('0x23')](function(_0x3de77e){if(_0x3de77e){_0x37215d=_0x3de77e[_0x0a9e('0x39')];if(!_0x4f2594[_0x0a9e('0x32')]['hasOwnProperty']('nolimit')){_0x41b90a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x4f2594[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x41b90a[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x4f2594[_0x0a9e('0x32')]['offset']);}return _0xb14971[_0x0a9e('0x9d')](_0x41b90a);}})[_0x0a9e('0x23')](function(_0x2d8e91){if(_0x2d8e91){return _0x2d8e91?{'count':_0x37215d,'rows':_0x2d8e91}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x1b637c,null))[_0x0a9e('0x46')](handleError(_0x1b637c,null));};function handleQuery(_0x3c6082){logger[_0x0a9e('0x9e')](_0x3c6082);return db['sequelize'][_0x0a9e('0x32')](_0x3c6082)[_0x0a9e('0x9f')](function(_0x231826){csv_results['push'](_0x231826);})[_0x0a9e('0x46')](function(_0x387817){logger[_0x0a9e('0x28')](_0x387817[_0x0a9e('0xa0')]);});} \ No newline at end of file +var _0xa9e0=['set','apply','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','CmList','includeAll','include','findAll','catch','show','params','create','body','role','user','get','Lists','UserProfileSection','find','autoAssociation','describe','ListId','getDispositions','Disposition','hasOwnProperty','rows','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','push','each','success','errors','getContacts','CmCustomField','CustomFields','concat','cf_%d','pick','raw','ContactItemType','OrderBy','alias','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','field','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','select','description','description_additionalPhone_','toString','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','format','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findOne','findAndCountAll','addAgents','omit','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','info','spread','message','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','redis','defaults','localhost','./cmList.socket','register','status','offset','undefined','limit','count'];(function(_0x19a2eb,_0x2df439){var _0x3c8514=function(_0x2b6204){while(--_0x2b6204){_0x19a2eb['push'](_0x19a2eb['shift']());}};_0x3c8514(++_0x2df439);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];var csv_results;config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=typeof _0x5a0a06[_0x0a9e('0x1b')]===_0x0a9e('0x1c')&&typeof _0x5a0a06[_0x0a9e('0x1d')]===_0x0a9e('0x1c');var _0x530eb7=_0x459eb1[_0x0a9e('0x1e')];var _0x1314ae=_0x478723?0x0:_0x5a0a06[_0x0a9e('0x1b')];var _0x1c696a=_0x478723?_0x459eb1[_0x0a9e('0x1e')]:_0x5a0a06['offset']+_0x5a0a06[_0x0a9e('0x1d')];var _0x155cce;if(_0x1c696a>=_0x530eb7){_0x1c696a=_0x530eb7;_0x155cce=0xc8;}else{_0x155cce=0xce;}_0x225616['status'](_0x155cce);return _0x225616[_0x0a9e('0x1f')]('Content-Range',_0x1314ae+'-'+_0x1c696a+'/'+_0x530eb7)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x3a02e1){return function(_0x432e56){try{jsonpatch[_0x0a9e('0x20')](_0x432e56,_0x3a02e1,!![]);}catch(_0x30bae6){return BPromise['reject'](_0x30bae6);}return _0x432e56[_0x0a9e('0x21')]();};}function saveUpdates(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x22')](_0x2fb0e4)[_0x0a9e('0x23')](function(_0x16b1ca){return _0x16b1ca;});}return null;};}function removeEntity(_0x5ea472,_0x59181e){return function(_0x197ec0){if(_0x197ec0){return _0x197ec0[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x33161b=_0x197ec0['get']({'plain':!![]});var _0x384319='Lists';return db[_0x0a9e('0x25')]['destroy']({'where':{'type':_0x384319,'resourceId':_0x33161b['id']}})[_0x0a9e('0x23')](function(){return _0x197ec0;});})[_0x0a9e('0x23')](function(){_0x5ea472[_0x0a9e('0x1a')](0xcc)[_0x0a9e('0x26')]();});}};}function handleEntityNotFound(_0x140511,_0x1538a4){return function(_0x11c3b6){if(!_0x11c3b6){_0x140511[_0x0a9e('0x27')](0x194);}return _0x11c3b6;};}function handleError(_0x5a101a,_0x3652a7){_0x3652a7=_0x3652a7||0x1f4;return function(_0x468813){logger[_0x0a9e('0x28')](_0x468813[_0x0a9e('0x29')]);if(_0x468813['name']){delete _0x468813[_0x0a9e('0x2a')];}_0x5a101a[_0x0a9e('0x1a')](_0x3652a7)[_0x0a9e('0x2b')](_0x468813);};}exports[_0x0a9e('0x2c')]=function(_0x58b06f,_0x563b45){var _0x296f41={},_0x2e8759={},_0x1dbde2={'count':0x0,'rows':[]};var _0x540530=_[_0x0a9e('0x2d')](db['CmList'][_0x0a9e('0x2e')],function(_0x3ae878){return{'name':_0x3ae878[_0x0a9e('0x2f')],'type':_0x3ae878[_0x0a9e('0x30')][_0x0a9e('0x31')]};});_0x2e8759['model']=_[_0x0a9e('0x2d')](_0x540530,_0x0a9e('0x2a'));_0x2e8759[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x58b06f[_0x0a9e('0x32')]);_0x2e8759[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2e8759[_0x0a9e('0x36')],_0x2e8759['query']);_0x296f41[_0x0a9e('0x37')]=_['intersection'](_0x2e8759[_0x0a9e('0x36')],qs[_0x0a9e('0x38')](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x296f41['attributes']=_0x296f41[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x296f41[_0x0a9e('0x37')]:_0x2e8759[_0x0a9e('0x36')];if(!_0x58b06f['query']['hasOwnProperty'](_0x0a9e('0x3a'))){_0x296f41['limit']=qs[_0x0a9e('0x1d')](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x296f41[_0x0a9e('0x1b')]=qs['offset'](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}_0x296f41[_0x0a9e('0x3b')]=qs['sort'](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0x296f41[_0x0a9e('0x3d')]=qs['filters'](_['pick'](_0x58b06f[_0x0a9e('0x32')],_0x2e8759[_0x0a9e('0x34')]),_0x540530);if(_0x58b06f['query'][_0x0a9e('0x3e')]){_0x296f41[_0x0a9e('0x3d')]=_[_0x0a9e('0x3f')](_0x296f41[_0x0a9e('0x3d')],{'$or':_['map'](_0x540530,function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x30')]!==_0x0a9e('0x40')){var _0x53f3ee={};_0x53f3ee[_0x5a594b[_0x0a9e('0x2a')]]={'$like':'%'+_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x3e')]+'%'};return _0x53f3ee;}})});}_0x296f41=_['merge']({},_0x296f41,_0x58b06f[_0x0a9e('0x41')]);var _0x2cfea9={'where':_0x296f41[_0x0a9e('0x3d')]};return db[_0x0a9e('0x42')][_0x0a9e('0x1e')](_0x2cfea9)[_0x0a9e('0x23')](function(_0x2881b3){_0x1dbde2[_0x0a9e('0x1e')]=_0x2881b3;if(_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x43')]){_0x296f41[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x42')][_0x0a9e('0x45')](_0x296f41);})[_0x0a9e('0x23')](function(_0x37f6cc){_0x1dbde2['rows']=_0x37f6cc;return _0x1dbde2;})['then'](respondWithFilteredResult(_0x563b45,_0x296f41))[_0x0a9e('0x46')](handleError(_0x563b45,null));};exports[_0x0a9e('0x47')]=function(_0x405c8f,_0x315881){var _0x1a69dd={'raw':![],'where':{'id':_0x405c8f[_0x0a9e('0x48')]['id']}},_0xc9a702={};_0xc9a702[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db[_0x0a9e('0x42')][_0x0a9e('0x2e')]);_0xc9a702[_0x0a9e('0x32')]=_['keys'](_0x405c8f[_0x0a9e('0x32')]);_0xc9a702[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0xc9a702[_0x0a9e('0x36')],_0xc9a702[_0x0a9e('0x32')]);_0x1a69dd[_0x0a9e('0x37')]=_[_0x0a9e('0x35')](_0xc9a702[_0x0a9e('0x36')],qs['fields'](_0x405c8f[_0x0a9e('0x32')]['fields']));_0x1a69dd[_0x0a9e('0x37')]=_0x1a69dd[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x1a69dd['attributes']:_0xc9a702[_0x0a9e('0x36')];if(_0x405c8f[_0x0a9e('0x32')][_0x0a9e('0x43')]){_0x1a69dd[_0x0a9e('0x44')]=[{'all':!![]}];}_0x1a69dd=_[_0x0a9e('0x3f')]({},_0x1a69dd,_0x405c8f[_0x0a9e('0x41')]);return db[_0x0a9e('0x42')]['find'](_0x1a69dd)[_0x0a9e('0x23')](handleEntityNotFound(_0x315881,null))[_0x0a9e('0x23')](respondWithResult(_0x315881,null))[_0x0a9e('0x46')](handleError(_0x315881,null));};exports[_0x0a9e('0x49')]=function(_0x409789,_0x992c77){return db[_0x0a9e('0x42')][_0x0a9e('0x49')](_0x409789[_0x0a9e('0x4a')],{})['then'](function(_0xe401a){var _0x3fe430=_0x409789['user']['get']({'plain':!![]});if(!_0x3fe430)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fe430[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){var _0x37edaa=_0xe401a[_0x0a9e('0x4d')]({'plain':!![]});var _0x61bb17=_0x0a9e('0x4e');return db[_0x0a9e('0x4f')][_0x0a9e('0x50')]({'where':{'name':_0x61bb17,'userProfileId':_0x3fe430['userProfileId']},'raw':!![]})['then'](function(_0x53975a){if(_0x53975a&&_0x53975a[_0x0a9e('0x51')]===0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x49')]({'name':_0x37edaa['name'],'resourceId':_0x37edaa['id'],'type':_0x53975a[_0x0a9e('0x2a')],'sectionId':_0x53975a['id']},{})[_0x0a9e('0x23')](function(){return _0xe401a;});}else{return _0xe401a;}})['catch'](function(_0x5a88da){logger[_0x0a9e('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a88da);throw _0x5a88da;});}return _0xe401a;})[_0x0a9e('0x23')](respondWithResult(_0x992c77,0xc9))['catch'](handleError(_0x992c77,null));};exports[_0x0a9e('0x22')]=function(_0x3c20b2,_0x439340){if(_0x3c20b2['body']['id']){delete _0x3c20b2[_0x0a9e('0x4a')]['id'];}return db[_0x0a9e('0x42')]['find']({'where':{'id':_0x3c20b2['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x439340,null))[_0x0a9e('0x23')](saveUpdates(_0x3c20b2['body'],null))[_0x0a9e('0x23')](respondWithResult(_0x439340,null))['catch'](handleError(_0x439340,null));};exports[_0x0a9e('0x24')]=function(_0x523cd2,_0xe22ccc){return db['CmList']['find']({'where':{'id':_0x523cd2['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0xe22ccc,null))['then'](removeEntity(_0xe22ccc,null))[_0x0a9e('0x46')](handleError(_0xe22ccc,null));};exports[_0x0a9e('0x52')]=function(_0x3cfd00,_0x19b4df){return db[_0x0a9e('0x42')][_0x0a9e('0x52')]()[_0x0a9e('0x23')](respondWithResult(_0x19b4df,null))[_0x0a9e('0x46')](handleError(_0x19b4df,null));};exports['addDisposition']=function(_0x1c693e,_0x121cef,_0x2642bb){if(_0x1c693e[_0x0a9e('0x4a')]['id']){delete _0x1c693e[_0x0a9e('0x4a')]['id'];}return db[_0x0a9e('0x42')]['find']({'where':{'id':_0x1c693e[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x121cef,null))['then'](function(_0x3649cc){if(_0x3649cc){_0x1c693e['body'][_0x0a9e('0x53')]=_0x3649cc['id'];return db['Disposition']['create'](_0x1c693e['body']);}})[_0x0a9e('0x23')](respondWithResult(_0x121cef,null))['catch'](handleError(_0x121cef,null));};exports[_0x0a9e('0x54')]=function(_0x1fc70e,_0x261adb,_0x7be420){var _0x1cca9f={'raw':![],'where':{}};var _0x26d7db={};var _0x49eed0={'count':0x0,'rows':[]};return db[_0x0a9e('0x42')]['findOne']({'where':{'id':_0x1fc70e[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x261adb,null))[_0x0a9e('0x23')](function(_0x5adf8f){if(_0x5adf8f){_0x26d7db[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db[_0x0a9e('0x55')][_0x0a9e('0x2e')]);_0x26d7db['query']=_[_0x0a9e('0x33')](_0x1fc70e[_0x0a9e('0x32')]);_0x26d7db['filters']=_[_0x0a9e('0x35')](_0x26d7db[_0x0a9e('0x36')],_0x26d7db[_0x0a9e('0x32')]);_0x1cca9f[_0x0a9e('0x37')]=_[_0x0a9e('0x35')](_0x26d7db['model'],qs[_0x0a9e('0x38')](_0x1fc70e[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x1cca9f['attributes']=_0x1cca9f[_0x0a9e('0x37')]['length']?_0x1cca9f['attributes']:_0x26d7db[_0x0a9e('0x36')];if(!_0x1fc70e[_0x0a9e('0x32')][_0x0a9e('0x56')](_0x0a9e('0x3a'))){_0x1cca9f[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x1fc70e[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x1cca9f[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x1fc70e[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}_0x1cca9f[_0x0a9e('0x3b')]=qs[_0x0a9e('0x3c')](_0x1fc70e[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0x1cca9f[_0x0a9e('0x3d')]=qs[_0x0a9e('0x34')](_['pick'](_0x1fc70e[_0x0a9e('0x32')],_0x26d7db[_0x0a9e('0x34')]));_0x1cca9f[_0x0a9e('0x3d')]['ListId']=_0x5adf8f['id'];if(_0x1fc70e[_0x0a9e('0x32')][_0x0a9e('0x3e')]){_0x1cca9f['where']=_[_0x0a9e('0x3f')](_0x1cca9f[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x2d')](_0x1cca9f[_0x0a9e('0x37')],function(_0x13b5c0){var _0x4a43a8={};_0x4a43a8[_0x13b5c0]={'$like':'%'+_0x1fc70e['query']['filter']+'%'};return _0x4a43a8;})});}_0x1cca9f=_[_0x0a9e('0x3f')]({},_0x1cca9f,_0x1fc70e[_0x0a9e('0x41')]);return db[_0x0a9e('0x55')][_0x0a9e('0x1e')]({'where':_0x1cca9f[_0x0a9e('0x3d')]})[_0x0a9e('0x23')](function(_0xeef20){_0x49eed0[_0x0a9e('0x1e')]=_0xeef20;if(_0x1fc70e['query'][_0x0a9e('0x43')]){_0x1cca9f[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x55')]['findAll'](_0x1cca9f);})[_0x0a9e('0x23')](function(_0x583b2e){_0x49eed0[_0x0a9e('0x57')]=_0x583b2e;return _0x49eed0;});}})[_0x0a9e('0x23')](respondWithFilteredResult(_0x261adb,_0x1cca9f))['catch'](handleError(_0x261adb,null));};exports[_0x0a9e('0x58')]=function(_0x75912a,_0x2cc7a7,_0x317c0c){return db['CmList'][_0x0a9e('0x50')]({'where':{'id':_0x75912a[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x2cc7a7,null))[_0x0a9e('0x23')](function(_0x5b7fc3){if(_0x5b7fc3){return _0x5b7fc3[_0x0a9e('0x58')](_0x75912a[_0x0a9e('0x32')][_0x0a9e('0x59')]);}})[_0x0a9e('0x23')](respondWithStatusCode(_0x2cc7a7,null))['catch'](handleError(_0x2cc7a7,null));};exports[_0x0a9e('0x5a')]=function(_0x3511c9,_0x30a4c7,_0xf410e5){return db[_0x0a9e('0x42')][_0x0a9e('0x50')]({'where':{'id':_0x3511c9[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x30a4c7,null))[_0x0a9e('0x23')](function(_0x336dc3){if(_0x336dc3){var _0xc4c230=[];var _0x1f10ef={'success':[],'errors':[]};return db[_0x0a9e('0x5b')][_0x0a9e('0x52')]()['then'](function(_0xf4120f){if(_0x3511c9[_0x0a9e('0x4a')][_0x0a9e('0x5c')]&&_['isArray'](_0x3511c9[_0x0a9e('0x4a')][_0x0a9e('0x5c')])){if(_0x3511c9[_0x0a9e('0x4a')][_0x0a9e('0x5c')]['length']){_0x3511c9['body'][_0x0a9e('0x5c')]=_0x3511c9[_0x0a9e('0x4a')]['tags'][_0x0a9e('0x5d')](';')+';';}else{_0x3511c9['body'][_0x0a9e('0x5c')]=null;}}else{_0x3511c9[_0x0a9e('0x4a')]['tags']=null;}if(_0x3511c9[_0x0a9e('0x4a')]&&_[_0x0a9e('0x5e')](_0x3511c9[_0x0a9e('0x4a')])){for(var _0x42b959=0x0;_0x42b959<_0x3511c9[_0x0a9e('0x4a')][_0x0a9e('0x39')];_0x42b959+=0x1){_0x3511c9[_0x0a9e('0x4a')][_0x42b959]['ListId']=_0x3511c9[_0x0a9e('0x48')]['id'];_0xc4c230[_0x0a9e('0x5f')](_0x3511c9[_0x0a9e('0x4a')][_0x42b959]);}return BPromise[_0x0a9e('0x60')](_0xc4c230,function(_0x492543){return db[_0x0a9e('0x5b')][_0x0a9e('0x49')](_['omit'](_0x492543,[_0x0a9e('0x59'),'id'])||{},{'fields':_['keys'](_0xf4120f),'raw':!![]})[_0x0a9e('0x23')](function(_0x2bb25a){_0x1f10ef[_0x0a9e('0x61')][_0x0a9e('0x5f')](_0x2bb25a['dataValues']);})['catch'](function(_0x353384){_0x1f10ef[_0x0a9e('0x62')][_0x0a9e('0x5f')]({'data':_0x492543,'error':_0x353384['message']});});})[_0x0a9e('0x23')](function(_0x36e975){return _0x1f10ef;})['catch'](function(_0x4e46b2){return _0x4e46b2;});}else{_0x30a4c7[_0x0a9e('0x1a')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x30a4c7,null))[_0x0a9e('0x46')](handleError(_0x30a4c7,null));};exports[_0x0a9e('0x63')]=function(_0x9044fe,_0x3bfadf,_0x3c6dd6){var _0x2600de;return db['CmList'][_0x0a9e('0x50')]({'where':{'id':_0x9044fe['params']['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':_0x0a9e('0x65')}]})[_0x0a9e('0x23')](handleEntityNotFound(_0x3bfadf,null))[_0x0a9e('0x23')](function(_0x50f8d7){if(_0x50f8d7){_0x2600de=_0x50f8d7;return db[_0x0a9e('0x5b')][_0x0a9e('0x2e')];}})[_0x0a9e('0x23')](function(_0x5b74c3){if(_0x5b74c3){var _0xb6e411={};var _0x21e592={};_0x21e592[_0x0a9e('0x36')]=_[_0x0a9e('0x66')](_[_0x0a9e('0x33')](_0x5b74c3),_[_0x0a9e('0x2d')](_0x2600de[_0x0a9e('0x65')],function(_0x11ac43){return util['format'](_0x0a9e('0x67'),_0x11ac43['id']);}));_0x21e592[_0x0a9e('0x32')]=_['keys'](_0x9044fe[_0x0a9e('0x32')]);_0x21e592[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x21e592['model'],_0x21e592[_0x0a9e('0x32')]);_0xb6e411['attributes']=_[_0x0a9e('0x35')](_0x21e592[_0x0a9e('0x36')],qs[_0x0a9e('0x38')](_0x9044fe[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0xb6e411[_0x0a9e('0x37')]=_0xb6e411[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0xb6e411['attributes']:_0x21e592[_0x0a9e('0x36')];if(!_0x9044fe[_0x0a9e('0x32')][_0x0a9e('0x56')](_0x0a9e('0x3a'))){_0xb6e411[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x9044fe[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0xb6e411[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x9044fe[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}_0xb6e411[_0x0a9e('0x3b')]=qs['sort'](_0x9044fe[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0xb6e411[_0x0a9e('0x3d')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x68')](_0x9044fe['query'],_0x21e592[_0x0a9e('0x34')]));_0xb6e411[_0x0a9e('0x69')]=!![];if(_0x9044fe['query'][_0x0a9e('0x3e')]){_0xb6e411['where']=_[_0x0a9e('0x3f')](_0xb6e411[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x2d')](_0xb6e411[_0x0a9e('0x37')],function(_0x4f4d2d){var _0x3ceba6={};_0x3ceba6[_0x4f4d2d]={'$like':'%'+_0x9044fe['query'][_0x0a9e('0x3e')]+'%'};return _0x3ceba6;})});}_0xb6e411=_[_0x0a9e('0x3f')]({},_0xb6e411,_0x9044fe['options']);return _0x2600de[_0x0a9e('0x63')](_0xb6e411);}})[_0x0a9e('0x23')](respondWithResult(_0x3bfadf,null))[_0x0a9e('0x46')](handleError(_0x3bfadf,null));};exports['getContactsCsv']=function(_0x4c788f,_0x1b82b7,_0x6ba2be){var _0x1707dc;var _0x413190;var _0x3f2f40;var _0x2450a8=_0x4c788f[_0x0a9e('0x48')]['id'];csv_results=[];return db[_0x0a9e('0x6a')][_0x0a9e('0x45')]({'attributes':['id','name'],'raw':!![],'order':[_0x0a9e('0x6b')]})['then'](function(_0x287324){_0x1707dc=_0x287324;var _0x2f7791=_[_0x0a9e('0x33')](db[_0x0a9e('0x5b')][_0x0a9e('0x2e')]);return db['CmCustomField'][_0x0a9e('0x45')]({'raw':!![],'attributes':['id',_0x0a9e('0x6c')]})[_0x0a9e('0x23')](function(_0x2aa5f2){_0x413190=_0x2aa5f2;var _0x2263f1=squel['select']()['fields'](_0x2f7791)[_0x0a9e('0x6d')]('cm_contacts','c')[_0x0a9e('0x3d')](_0x0a9e('0x6e'),_0x2450a8)[_0x0a9e('0x3d')](_0x0a9e('0x6f'))[_0x0a9e('0x70')]();for(var _0x5c689c=0x0;_0x5c689c<_0x413190['length'];_0x5c689c++){_0x2263f1['field'](_0x0a9e('0x71')+_0x413190[_0x5c689c]['id'],'customField_'+_0x413190[_0x5c689c][_0x0a9e('0x6c')]);}for(var _0x5c689c=0x0;_0x5c689c<_0x1707dc[_0x0a9e('0x39')];_0x5c689c++){_0x2263f1['field'](squel['select']()[_0x0a9e('0x72')](_0x0a9e('0x73'))['from'](_0x0a9e('0x74'))[_0x0a9e('0x3d')](_0x0a9e('0x75'),_0x1707dc[_0x5c689c]['id'])[_0x0a9e('0x3d')](_0x0a9e('0x76')),'additionalPhone_'+_0x1707dc[_0x5c689c]['name']);_0x2263f1[_0x0a9e('0x72')](squel[_0x0a9e('0x77')]()[_0x0a9e('0x72')](_0x0a9e('0x78'))[_0x0a9e('0x6d')]('cm_contact_has_items')[_0x0a9e('0x3d')](_0x0a9e('0x75'),_0x1707dc[_0x5c689c]['id'])['where'](_0x0a9e('0x76')),_0x0a9e('0x79')+_0x1707dc[_0x5c689c][_0x0a9e('0x2a')]);}var _0x2427d5=[];_0x2427d5[_0x0a9e('0x5f')](_0x2263f1[_0x0a9e('0x7a')]());BPromise[_0x0a9e('0x60')](_0x2427d5,handleQuery)[_0x0a9e('0x23')](function(_0x40dd2a){handleQuery(_0x2263f1[_0x0a9e('0x7a')]());var _0x4bdebb=csv_results[0x0];if(!_[_0x0a9e('0x7b')](_0x4bdebb)){var _0x301047=toCsv(_0x4bdebb);var _0x2ada60=Date[_0x0a9e('0x7c')]();fs[_0x0a9e('0x7d')](util['format']('/tmp/list_%d_%s.csv',_0x2450a8,_0x2ada60),_0x301047);_0x1b82b7[_0x0a9e('0x7e')](_0x0a9e('0x7f'),_0x0a9e('0x80')+util[_0x0a9e('0x81')](_0x0a9e('0x82'),_0x2450a8,_0x2ada60));_0x1b82b7['setHeader'](_0x0a9e('0x83'),_0x0a9e('0x84'));return _0x1b82b7[_0x0a9e('0x85')](util['format'](_0x0a9e('0x86'),_0x2450a8,_0x2ada60));}else{return _0x1b82b7['sendStatus'](0xcc);}});});});};exports[_0x0a9e('0x87')]=function(_0x4799d4,_0x25b745,_0x42b833){var _0xe339b1;delete _0x4799d4['body']['id'];return db[_0x0a9e('0x42')]['findOne']({'where':{'id':_0x4799d4[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x25b745,null))[_0x0a9e('0x23')](function(_0x6c47cd){if(_0x6c47cd){return db[_0x0a9e('0x88')][_0x0a9e('0x89')](function(_0x4014c7){return db[_0x0a9e('0x64')][_0x0a9e('0x49')](_0x4799d4[_0x0a9e('0x4a')],{'transaction':_0x4014c7})[_0x0a9e('0x23')](function(_0xc876d4){_0xe339b1=_0xc876d4;return _0x6c47cd[_0x0a9e('0x8a')](_0xc876d4,{'transaction':_0x4014c7});})[_0x0a9e('0x23')](function(){var _0x98c62c={'type':db[_0x0a9e('0x8b')]['TEXT'],'transaction':_0x4014c7};switch(_0x4799d4['body'][_0x0a9e('0x30')]){case'text':_0x98c62c[_0x0a9e('0x30')]=db[_0x0a9e('0x8b')]['TEXT'];break;case _0x0a9e('0x8c'):_0x98c62c[_0x0a9e('0x30')]=db[_0x0a9e('0x8b')][_0x0a9e('0x8d')];break;case'switch':_0x98c62c[_0x0a9e('0x30')]=db[_0x0a9e('0x8b')][_0x0a9e('0x8e')];_0x98c62c[_0x0a9e('0x8f')]=![];break;default:}return db['sequelize'][_0x0a9e('0x90')][_0x0a9e('0x91')](_0x0a9e('0x92'),util['format'](_0x0a9e('0x93'),_0xe339b1['id']),_0x98c62c);})[_0x0a9e('0x23')](function(){return _0xe339b1;});});}})[_0x0a9e('0x23')](respondWithResult(_0x25b745,null))['catch'](handleError(_0x25b745,null));};exports[_0x0a9e('0x94')]=function(_0x4394bb,_0x1d9b57,_0x1a7f58){var _0x2394d3={};var _0x555780={};var _0x3211d2;var _0x289e65;return db['CmList'][_0x0a9e('0x95')]({'where':{'id':_0x4394bb[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x1d9b57,null))['then'](function(_0x5c3b6f){if(_0x5c3b6f){_0x3211d2=_0x5c3b6f;_0x555780['model']=_[_0x0a9e('0x33')](db[_0x0a9e('0x64')]['rawAttributes']);_0x555780[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x4394bb[_0x0a9e('0x32')]);_0x555780['filters']=_[_0x0a9e('0x35')](_0x555780[_0x0a9e('0x36')],_0x555780[_0x0a9e('0x32')]);_0x2394d3[_0x0a9e('0x37')]=_[_0x0a9e('0x35')](_0x555780[_0x0a9e('0x36')],qs[_0x0a9e('0x38')](_0x4394bb[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x2394d3['attributes']=_0x2394d3[_0x0a9e('0x37')]['length']?_0x2394d3[_0x0a9e('0x37')]:_0x555780[_0x0a9e('0x36')];_0x2394d3[_0x0a9e('0x3b')]=qs[_0x0a9e('0x3c')](_0x4394bb[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0x2394d3['where']=qs[_0x0a9e('0x34')](_[_0x0a9e('0x68')](_0x4394bb[_0x0a9e('0x32')],_0x555780[_0x0a9e('0x34')]));_0x2394d3['where']=_[_0x0a9e('0x3f')](_0x2394d3[_0x0a9e('0x3d')],{'$or':[{'ListId':_0x5c3b6f['id']},{'ListId':null}]});if(_0x4394bb[_0x0a9e('0x32')][_0x0a9e('0x3e')]){_0x2394d3[_0x0a9e('0x3d')]=_[_0x0a9e('0x3f')](_0x2394d3[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x2d')](_0x2394d3[_0x0a9e('0x37')],function(_0x3539b7){var _0x57f0ad={};_0x57f0ad[_0x3539b7]={'$like':'%'+_0x4394bb[_0x0a9e('0x32')][_0x0a9e('0x3e')]+'%'};return _0x57f0ad;})});}_0x2394d3=_[_0x0a9e('0x3f')]({},_0x2394d3,_0x4394bb[_0x0a9e('0x41')]);return db[_0x0a9e('0x64')][_0x0a9e('0x96')](_0x2394d3);}})[_0x0a9e('0x23')](respondWithResult(_0x1d9b57,null))[_0x0a9e('0x46')](handleError(_0x1d9b57,null));};exports['getGlobalCustomFields']=function(_0x3b581c,_0xd2391){return db[_0x0a9e('0x64')]['findAndCountAll']({'where':{'ListId':null}})[_0x0a9e('0x23')](handleEntityNotFound(_0xd2391,null))[_0x0a9e('0x23')](function(_0xb0af1e){return _0xb0af1e;})[_0x0a9e('0x23')](respondWithResult(_0xd2391,null))[_0x0a9e('0x46')](handleError(_0xd2391,null));};exports[_0x0a9e('0x97')]=function(_0x424f1b,_0x336a19,_0x401601){return db[_0x0a9e('0x42')]['find']({'where':{'id':_0x424f1b[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x336a19,null))[_0x0a9e('0x23')](function(_0x3db98f){if(_0x3db98f){return _0x3db98f[_0x0a9e('0x97')](_0x424f1b[_0x0a9e('0x4a')]['ids'],_[_0x0a9e('0x98')](_0x424f1b['body'],['ids','id'])||{})['spread'](function(_0x19e4e6){for(var _0x3fa3f2=0x0;_0x3fa3f2<_0x424f1b[_0x0a9e('0x4a')][_0x0a9e('0x59')]['length'];_0x3fa3f2+=0x1){socket[_0x0a9e('0x99')](_0x0a9e('0x9a'),{'UserId':Number(_0x424f1b[_0x0a9e('0x4a')][_0x0a9e('0x59')][_0x3fa3f2]),'CmListId':Number(_0x424f1b[_0x0a9e('0x48')]['id'])});}return _0x19e4e6;});}})['then'](respondWithResult(_0x336a19,null))['catch'](handleError(_0x336a19,null));};exports[_0x0a9e('0x9b')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x42')][_0x0a9e('0x50')]({'where':{'id':_0x33bcb2[_0x0a9e('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x23')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0x9b')](_0x33bcb2['query'][_0x0a9e('0x59')])[_0x0a9e('0x23')](function(){if(_[_0x0a9e('0x5e')](_0x33bcb2['query']['ids'])){for(var _0x53ef46=0x0;_0x53ef46<_0x33bcb2[_0x0a9e('0x32')][_0x0a9e('0x59')][_0x0a9e('0x39')];_0x53ef46+=0x1){socket[_0x0a9e('0x99')]('userCmList:remove',{'UserId':Number(_0x33bcb2[_0x0a9e('0x32')]['ids'][_0x53ef46]),'CmListId':Number(_0x33bcb2[_0x0a9e('0x48')]['id'])});}}else{socket[_0x0a9e('0x99')](_0x0a9e('0x9c'),{'UserId':Number(_0x33bcb2['query'][_0x0a9e('0x59')]),'CmListId':Number(_0x33bcb2[_0x0a9e('0x48')]['id'])});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x2a293f,null))['catch'](handleError(_0x2a293f,null));};exports[_0x0a9e('0x9d')]=function(_0x4f2594,_0x1b637c,_0x5c57e1){var _0x41b90a={};var _0x57b7d4={};var _0xb14971;var _0x37215d;return db[_0x0a9e('0x42')][_0x0a9e('0x95')]({'where':{'id':_0x4f2594[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x1b637c,null))[_0x0a9e('0x23')](function(_0x5acdc9){if(_0x5acdc9){_0xb14971=_0x5acdc9;_0x57b7d4[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db['User'][_0x0a9e('0x2e')]);_0x57b7d4[_0x0a9e('0x32')]=_['keys'](_0x4f2594[_0x0a9e('0x32')]);_0x57b7d4[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x57b7d4['model'],_0x57b7d4[_0x0a9e('0x32')]);_0x41b90a[_0x0a9e('0x37')]=_[_0x0a9e('0x35')](_0x57b7d4[_0x0a9e('0x36')],qs[_0x0a9e('0x38')](_0x4f2594[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x41b90a[_0x0a9e('0x37')]=_0x41b90a[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x41b90a['attributes']:_0x57b7d4[_0x0a9e('0x36')];_0x41b90a['order']=qs[_0x0a9e('0x3c')](_0x4f2594[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0x41b90a[_0x0a9e('0x3d')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x68')](_0x4f2594['query'],_0x57b7d4[_0x0a9e('0x34')]));if(_0x4f2594[_0x0a9e('0x32')][_0x0a9e('0x3e')]){_0x41b90a['where']=_[_0x0a9e('0x3f')](_0x41b90a[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x2d')](_0x41b90a[_0x0a9e('0x37')],function(_0x31e1e0){var _0x1d0a78={};_0x1d0a78[_0x31e1e0]={'$like':'%'+_0x4f2594[_0x0a9e('0x32')]['filter']+'%'};return _0x1d0a78;})});}_0x41b90a=_[_0x0a9e('0x3f')]({},_0x41b90a,_0x4f2594[_0x0a9e('0x41')]);return _0xb14971[_0x0a9e('0x9d')](_0x41b90a);}})[_0x0a9e('0x23')](function(_0x3de77e){if(_0x3de77e){_0x37215d=_0x3de77e[_0x0a9e('0x39')];if(!_0x4f2594[_0x0a9e('0x32')]['hasOwnProperty']('nolimit')){_0x41b90a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x4f2594[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x41b90a[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x4f2594[_0x0a9e('0x32')]['offset']);}return _0xb14971[_0x0a9e('0x9d')](_0x41b90a);}})[_0x0a9e('0x23')](function(_0x2d8e91){if(_0x2d8e91){return _0x2d8e91?{'count':_0x37215d,'rows':_0x2d8e91}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x1b637c,null))[_0x0a9e('0x46')](handleError(_0x1b637c,null));};function handleQuery(_0x3c6082){logger[_0x0a9e('0x9e')](_0x3c6082);return db['sequelize'][_0x0a9e('0x32')](_0x3c6082)[_0x0a9e('0x9f')](function(_0x231826){csv_results['push'](_0x231826);})[_0x0a9e('0x46')](function(_0x387817){logger[_0x0a9e('0x28')](_0x387817[_0x0a9e('0xa0')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index c711ea6..4c63445 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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x319cb9,_0x4b8d35){var _0x1735fc=function(_0x43b061){while(--_0x43b061){_0x319cb9['push'](_0x319cb9['shift']());}};_0x1735fc(++_0x4b8d35);}(_0x5fc3,0xa8));var _0x35fc=function(_0x10c51f,_0x11270f){_0x10c51f=_0x10c51f-0x0;var _0x56a0cd=_0x5fc3[_0x10c51f];return _0x56a0cd;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x5ce5e7,_0x495679){var _0x2bef07=function(_0x6c3061){while(--_0x6c3061){_0x5ce5e7['push'](_0x5ce5e7['shift']());}};_0x2bef07(++_0x495679);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 9c3fb43..04a5cf1 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 _0x55e0=['./cmList.attributes','exports','define','cm_lists','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x55e0,0xdc));var _0x055e=function(_0x4e7912,_0x35439c){_0x4e7912=_0x4e7912-0x0;var _0x20add9=_0x55e0[_0x4e7912];return _0x20add9;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x055e('0x4'));var fs=require('fs');var path=require(_0x055e('0x5'));var rimraf=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var attributes=require(_0x055e('0x8'));module[_0x055e('0x9')]=function(_0x490ee1,_0x5239f6){return _0x490ee1[_0x055e('0xa')]('CmList',attributes,{'tableName':_0x055e('0xb'),'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(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x4ea3,0x70));var _0x34ea=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4ea3[_0x3947c9];return _0x2e7871;};'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 fe5a3d6..5bdc578 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 _0x7011=['request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','register'];(function(_0xf1f37e,_0x159a20){var _0x2e3a6d=function(_0x4163cd){while(--_0x4163cd){_0xf1f37e['push'](_0xf1f37e['shift']());}};_0x2e3a6d(++_0x159a20);}(_0x7011,0x7c));var _0x1701=function(_0x3541da,_0x5b2254){_0x3541da=_0x3541da-0x0;var _0xa24cff=_0x7011[_0x3541da];return _0xa24cff;};'use strict';var _=require('lodash');var util=require(_0x1701('0x0'));var moment=require(_0x1701('0x1'));var BPromise=require(_0x1701('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1701('0x3'));var db=require(_0x1701('0x4'))['db'];var utils=require(_0x1701('0x5'));var logger=require(_0x1701('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1701('0x7'));var client=jayson[_0x1701('0x8')][_0x1701('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1701('0xa')],{'host':_0x1701('0xb'),'port':0x18eb});var socket=require(_0x1701('0xc'))(new Redis(config[_0x1701('0xa')]));require('./cmList.socket')[_0x1701('0xd')](socket);function respondWithRpcPromise(_0x35e3fa,_0x24fdc8,_0x4998cb){return new BPromise(function(_0x2955aa,_0x43c08d){return client[_0x1701('0xe')](_0x35e3fa,_0x4998cb)['then'](function(_0x380e1c){logger[_0x1701('0xf')](_0x1701('0x10'),_0x24fdc8,_0x1701('0x11'));logger[_0x1701('0x12')](_0x1701('0x13'),_0x24fdc8,_0x1701('0x11'),JSON['stringify'](_0x380e1c));if(_0x380e1c[_0x1701('0x14')]){if(_0x380e1c['error'][_0x1701('0x15')]===0x1f4){logger[_0x1701('0x14')](_0x1701('0x10'),_0x24fdc8,_0x380e1c['error'][_0x1701('0x16')]);return _0x43c08d(_0x380e1c[_0x1701('0x14')][_0x1701('0x16')]);}logger[_0x1701('0x14')](_0x1701('0x10'),_0x24fdc8,_0x380e1c[_0x1701('0x14')]['message']);return _0x2955aa(_0x380e1c['error']['message']);}else{logger[_0x1701('0xf')](_0x1701('0x10'),_0x24fdc8,_0x1701('0x11'));_0x2955aa(_0x380e1c['result'][_0x1701('0x16')]);}})['catch'](function(_0x537844){logger[_0x1701('0x14')](_0x1701('0x10'),_0x24fdc8,_0x537844);_0x43c08d(_0x537844);});});} \ No newline at end of file +var _0x9224=['defaults','socket.io-emitter','./cmList.socket','register','request','then','info','request\x20sent','debug','stringify','error','CmList,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x436a1a,_0x1c6be0){var _0x8e1d7b=function(_0x514831){while(--_0x514831){_0x436a1a['push'](_0x436a1a['shift']());}};_0x8e1d7b(++_0x1c6be0);}(_0x9224,0x138));var _0x4922=function(_0x22419d,_0x4c6974){_0x22419d=_0x22419d-0x0;var _0x169dde=_0x9224[_0x22419d];return _0x169dde;};'use strict';var _=require('lodash');var util=require(_0x4922('0x0'));var moment=require(_0x4922('0x1'));var BPromise=require(_0x4922('0x2'));var rs=require(_0x4922('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4922('0x4'))['db'];var utils=require(_0x4922('0x5'));var logger=require(_0x4922('0x6'))(_0x4922('0x7'));var config=require(_0x4922('0x8'));var jayson=require(_0x4922('0x9'));var client=jayson[_0x4922('0xa')]['http']({'port':0x232a});config[_0x4922('0xb')]=_[_0x4922('0xc')](config[_0x4922('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4922('0xd'))(new Redis(config[_0x4922('0xb')]));require(_0x4922('0xe'))[_0x4922('0xf')](socket);function respondWithRpcPromise(_0x170c91,_0x22ccde,_0x3363f6){return new BPromise(function(_0x439bab,_0x36c87e){return client[_0x4922('0x10')](_0x170c91,_0x3363f6)[_0x4922('0x11')](function(_0x23e16c){logger[_0x4922('0x12')]('CmList,\x20%s,\x20%s',_0x22ccde,_0x4922('0x13'));logger[_0x4922('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x22ccde,'request\x20sent',JSON[_0x4922('0x15')](_0x23e16c));if(_0x23e16c[_0x4922('0x16')]){if(_0x23e16c['error']['code']===0x1f4){logger[_0x4922('0x16')](_0x4922('0x17'),_0x22ccde,_0x23e16c['error']['message']);return _0x36c87e(_0x23e16c[_0x4922('0x16')][_0x4922('0x18')]);}logger[_0x4922('0x16')](_0x4922('0x17'),_0x22ccde,_0x23e16c[_0x4922('0x16')][_0x4922('0x18')]);return _0x439bab(_0x23e16c[_0x4922('0x16')][_0x4922('0x18')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x22ccde,_0x4922('0x13'));_0x439bab(_0x23e16c[_0x4922('0x19')][_0x4922('0x18')]);}})[_0x4922('0x1a')](function(_0x514986){logger[_0x4922('0x16')](_0x4922('0x17'),_0x22ccde,_0x514986);_0x36c87e(_0x514986);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 2826dd4..b69136a 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 _0x8ec9=['update','emit','removeListener','register','length','cmList:','./cmList.events','save','remove'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8ec9,0x8d));var _0x98ec=function(_0x21b630,_0x592871){_0x21b630=_0x21b630-0x0;var _0xa1d618=_0x8ec9[_0x21b630];return _0xa1d618;};'use strict';var CmListEvents=require(_0x98ec('0x0'));var events=[_0x98ec('0x1'),_0x98ec('0x2'),_0x98ec('0x3')];function createListener(_0x4c3cc3,_0x38b22d){return function(_0x40f0f9){_0x38b22d[_0x98ec('0x4')](_0x4c3cc3,_0x40f0f9);};}function removeListener(_0x2aa10a,_0x1f340c){return function(){CmListEvents[_0x98ec('0x5')](_0x2aa10a,_0x1f340c);};}exports[_0x98ec('0x6')]=function(_0x336337){for(var _0x31f950=0x0,_0x5b0972=events[_0x98ec('0x7')];_0x31f950<_0x5b0972;_0x31f950++){var _0x50a22e=events[_0x31f950];var _0x1cc675=createListener(_0x98ec('0x8')+_0x50a22e,_0x336337);CmListEvents['on'](_0x50a22e,_0x1cc675);}}; \ No newline at end of file +var _0xd0d6=['remove','update','emit','removeListener','register','length','cmList:','./cmList.events','save'];(function(_0x1f25f4,_0x1b01a8){var _0xdfa7cb=function(_0xdde183){while(--_0xdde183){_0x1f25f4['push'](_0x1f25f4['shift']());}};_0xdfa7cb(++_0x1b01a8);}(_0xd0d6,0x166));var _0x6d0d=function(_0xb9987d,_0x13f033){_0xb9987d=_0xb9987d-0x0;var _0x4406b4=_0xd0d6[_0xb9987d];return _0x4406b4;};'use strict';var CmListEvents=require(_0x6d0d('0x0'));var events=[_0x6d0d('0x1'),_0x6d0d('0x2'),_0x6d0d('0x3')];function createListener(_0x133f54,_0x4bb45a){return function(_0x26cd0c){_0x4bb45a[_0x6d0d('0x4')](_0x133f54,_0x26cd0c);};}function removeListener(_0x2cc27a,_0x39e82f){return function(){CmListEvents[_0x6d0d('0x5')](_0x2cc27a,_0x39e82f);};}exports[_0x6d0d('0x6')]=function(_0x41ad87){for(var _0x993560=0x0,_0x843656=events[_0x6d0d('0x7')];_0x993560<_0x843656;_0x993560++){var _0x35bce9=events[_0x993560];var _0xba3df2=createListener(_0x6d0d('0x8')+_0x35bce9,_0x41ad87);CmListEvents['on'](_0x35bce9,_0xba3df2);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index b5c2040..3a1cfd3 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 _0x7383=['index','/describe','describe','/global_fields','getGlobalCustomFields','show','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','put','/:id','update','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x36734a,_0xdd12e1){var _0x565da1=function(_0x4e27d3){while(--_0x4e27d3){_0x36734a['push'](_0x36734a['shift']());}};_0x565da1(++_0xdd12e1);}(_0x7383,0x1b1));var _0x3738=function(_0x3434d7,_0x4d4eb0){_0x3434d7=_0x3434d7-0x0;var _0x51eebd=_0x7383[_0x3434d7];return _0x51eebd;};'use strict';var multer=require(_0x3738('0x0'));var util=require(_0x3738('0x1'));var path=require(_0x3738('0x2'));var timeout=require(_0x3738('0x3'));var express=require(_0x3738('0x4'));var router=express[_0x3738('0x5')]();var fs_extra=require(_0x3738('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3738('0x7'));var config=require(_0x3738('0x8'));var controller=require('./cmList.controller');router[_0x3738('0x9')]('/',auth[_0x3738('0xa')](),controller[_0x3738('0xb')]);router[_0x3738('0x9')](_0x3738('0xc'),auth[_0x3738('0xa')](),controller[_0x3738('0xd')]);router[_0x3738('0x9')](_0x3738('0xe'),auth[_0x3738('0xa')](),controller[_0x3738('0xf')]);router[_0x3738('0x9')]('/:id',auth[_0x3738('0xa')](),controller[_0x3738('0x10')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3738('0x11')]);router[_0x3738('0x9')](_0x3738('0x12'),auth[_0x3738('0xa')](),controller['getContacts']);router[_0x3738('0x9')](_0x3738('0x13'),auth[_0x3738('0xa')](),controller[_0x3738('0x14')]);router[_0x3738('0x9')](_0x3738('0x15'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x3738('0x9')](_0x3738('0x16'),auth[_0x3738('0xa')](),controller['getAgents']);router[_0x3738('0x17')]('/',auth['isAuthenticated'](),controller[_0x3738('0x18')]);router[_0x3738('0x17')](_0x3738('0x19'),auth['isAuthenticated'](),controller[_0x3738('0x1a')]);router[_0x3738('0x17')](_0x3738('0x12'),auth[_0x3738('0xa')](),controller[_0x3738('0x1b')]);router[_0x3738('0x17')]('/:id/fields',auth[_0x3738('0xa')](),controller[_0x3738('0x1c')]);router[_0x3738('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x3738('0x1d')]);router[_0x3738('0x1e')](_0x3738('0x1f'),auth['isAuthenticated'](),controller[_0x3738('0x20')]);router['delete']('/:id',auth[_0x3738('0xa')](),controller[_0x3738('0x21')]);router['delete']('/:id/dispositions',auth[_0x3738('0xa')](),controller[_0x3738('0x22')]);router['delete'](_0x3738('0x16'),auth[_0x3738('0xa')](),controller[_0x3738('0x23')]);module[_0x3738('0x24')]=router; \ No newline at end of file +var _0xc910=['multer','util','path','connect-timeout','Router','../../config/environment','./cmList.controller','get','/describe','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','addDisposition','put','update','destroy','delete','removeAgents'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xc910,0x140));var _0x0c91=function(_0x1cc450,_0x13625e){_0x1cc450=_0x1cc450-0x0;var _0x4573e7=_0xc910[_0x1cc450];return _0x4573e7;};'use strict';var multer=require(_0x0c91('0x0'));var util=require(_0x0c91('0x1'));var path=require(_0x0c91('0x2'));var timeout=require(_0x0c91('0x3'));var express=require('express');var router=express[_0x0c91('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0c91('0x5'));var controller=require(_0x0c91('0x6'));router[_0x0c91('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0c91('0x8'),auth[_0x0c91('0x9')](),controller[_0x0c91('0xa')]);router['get'](_0x0c91('0xb'),auth['isAuthenticated'](),controller[_0x0c91('0xc')]);router[_0x0c91('0x7')](_0x0c91('0xd'),auth['isAuthenticated'](),controller[_0x0c91('0xe')]);router['get'](_0x0c91('0xf'),auth[_0x0c91('0x9')](),controller[_0x0c91('0x10')]);router[_0x0c91('0x7')](_0x0c91('0x11'),auth[_0x0c91('0x9')](),controller[_0x0c91('0x12')]);router[_0x0c91('0x7')](_0x0c91('0x13'),auth['isAuthenticated'](),controller[_0x0c91('0x14')]);router[_0x0c91('0x7')](_0x0c91('0x15'),auth['isAuthenticated'](),controller[_0x0c91('0x16')]);router['get'](_0x0c91('0x17'),auth[_0x0c91('0x9')](),controller['getAgents']);router[_0x0c91('0x18')]('/',auth[_0x0c91('0x9')](),controller[_0x0c91('0x19')]);router[_0x0c91('0x18')](_0x0c91('0xf'),auth[_0x0c91('0x9')](),controller[_0x0c91('0x1a')]);router[_0x0c91('0x18')](_0x0c91('0x11'),auth[_0x0c91('0x9')](),controller['addContacts']);router[_0x0c91('0x18')](_0x0c91('0x15'),auth[_0x0c91('0x9')](),controller['addCustomField']);router[_0x0c91('0x18')](_0x0c91('0x17'),auth[_0x0c91('0x9')](),controller['addAgents']);router[_0x0c91('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x0c91('0x1c')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0c91('0x1d')]);router[_0x0c91('0x1e')](_0x0c91('0xf'),auth[_0x0c91('0x9')](),controller['removeDispositions']);router['delete'](_0x0c91('0x17'),auth[_0x0c91('0x9')](),controller[_0x0c91('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 6cfa0b7..81e3268 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 _0x3ecb=['getDataValue','field','STRING','VIRTUAL'];(function(_0x39f79d,_0x52f433){var _0x38218e=function(_0x201f58){while(--_0x201f58){_0x39f79d['push'](_0x39f79d['shift']());}};_0x38218e(++_0x52f433);}(_0x3ecb,0x11f));var _0xb3ec=function(_0x3699b0,_0x485ab1){_0x3699b0=_0x3699b0-0x0;var _0x454067=_0x3ecb[_0x3699b0];return _0x454067;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb3ec('0x0')],'get':function(_0x32bea3){return this[_0xb3ec('0x1')](_0xb3ec('0x2'));}},'field':{'type':Sequelize[_0xb3ec('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xb3ec('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xb3ec('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0xb3c3=['VIRTUAL','getDataValue','STRING','sequelize','exports'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xb3c3,0x19d));var _0x3b3c=function(_0x3d9f55,_0x7e644c){_0x3d9f55=_0x3d9f55-0x0;var _0xac766c=_0xb3c3[_0x3d9f55];return _0xac766c;};'use strict';var Sequelize=require(_0x3b3c('0x0'));module[_0x3b3c('0x1')]={'name':{'type':Sequelize[_0x3b3c('0x2')],'get':function(_0x2caab3){return this[_0x3b3c('0x3')]('field');}},'field':{'type':Sequelize[_0x3b3c('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3b3c('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 2455fc5..0235005 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x1292a7,_0x58f9f5){var _0x11a86e=function(_0x386f34){while(--_0x386f34){_0x1292a7['push'](_0x1292a7['shift']());}};_0x11a86e(++_0x58f9f5);}(_0x7a54,0x106));var _0x47a5=function(_0x349ba6,_0x20f4e7){_0x349ba6=_0x349ba6-0x0;var _0x25fcc5=_0x7a54[_0x349ba6];return _0x25fcc5;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x316c9e,_0x44fc83){var _0x3a65b9=function(_0x1b3cbb){while(--_0x1b3cbb){_0x316c9e['push'](_0x316c9e['shift']());}};_0x3a65b9(++_0x44fc83);}(_0x7a54,0x106));var _0x47a5=function(_0x4a3271,_0x5e02a6){_0x4a3271=_0x4a3271-0x0;var _0xb8fa5e=_0x7a54[_0x4a3271];return _0xb8fa5e;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index f41b81b..3ca2cca 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 _0xffa6=['tools_conditions','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./condition.attributes','define'];(function(_0x3743e1,_0x392551){var _0x253a42=function(_0x1ba037){while(--_0x1ba037){_0x3743e1['push'](_0x3743e1['shift']());}};_0x253a42(++_0x392551);}(_0xffa6,0x1cf));var _0x6ffa=function(_0xe32f10,_0x163fcc){_0xe32f10=_0xe32f10-0x0;var _0x55980c=_0xffa6[_0xe32f10];return _0x55980c;};'use strict';var _=require('lodash');var util=require(_0x6ffa('0x0'));var logger=require(_0x6ffa('0x1'))(_0x6ffa('0x2'));var moment=require(_0x6ffa('0x3'));var BPromise=require(_0x6ffa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ffa('0x5'));var rimraf=require(_0x6ffa('0x6'));var config=require(_0x6ffa('0x7'));var attributes=require(_0x6ffa('0x8'));module['exports']=function(_0x3cb090,_0x480848){return _0x3cb090[_0x6ffa('0x9')]('Condition',attributes,{'tableName':_0x6ffa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a12=['exports','define','Condition','tools_conditions','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./condition.attributes'];(function(_0x382a36,_0x5f2c45){var _0x51cff0=function(_0x45ab88){while(--_0x45ab88){_0x382a36['push'](_0x382a36['shift']());}};_0x51cff0(++_0x5f2c45);}(_0x8a12,0x18a));var _0x28a1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8a12[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x28a1('0x0'));var util=require(_0x28a1('0x1'));var logger=require('../../config/logger')(_0x28a1('0x2'));var moment=require(_0x28a1('0x3'));var BPromise=require('bluebird');var rp=require(_0x28a1('0x4'));var fs=require('fs');var path=require(_0x28a1('0x5'));var rimraf=require(_0x28a1('0x6'));var config=require(_0x28a1('0x7'));var attributes=require(_0x28a1('0x8'));module[_0x28a1('0x9')]=function(_0x3e5f1,_0x341c83){return _0x3e5f1[_0x28a1('0xa')](_0x28a1('0xb'),attributes,{'tableName':_0x28a1('0xc'),'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 7dbe91e..e78601b 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 _0x39d3=['moment','ioredis','../../config/utils','../../config/environment','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4f6526,_0x4be2af){var _0x4024ae=function(_0x521be5){while(--_0x521be5){_0x4f6526['push'](_0x4f6526['shift']());}};_0x4024ae(++_0x4be2af);}(_0x39d3,0x1a0));var _0x339d=function(_0x15a13f,_0x5da778){_0x15a13f=_0x15a13f-0x0;var _0x46d4a8=_0x39d3[_0x15a13f];return _0x46d4a8;};'use strict';var _=require(_0x339d('0x0'));var util=require(_0x339d('0x1'));var moment=require(_0x339d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x339d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x339d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x339d('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x339d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3aa948,_0x18a41d,_0x151189){return new BPromise(function(_0x1a353c,_0x30a19){return client['request'](_0x3aa948,_0x151189)[_0x339d('0x7')](function(_0x132706){logger[_0x339d('0x8')](_0x339d('0x9'),_0x18a41d,_0x339d('0xa'));logger[_0x339d('0xb')](_0x339d('0xc'),_0x18a41d,_0x339d('0xa'),JSON[_0x339d('0xd')](_0x132706));if(_0x132706[_0x339d('0xe')]){if(_0x132706[_0x339d('0xe')][_0x339d('0xf')]===0x1f4){logger[_0x339d('0xe')](_0x339d('0x9'),_0x18a41d,_0x132706[_0x339d('0xe')][_0x339d('0x10')]);return _0x30a19(_0x132706[_0x339d('0xe')]['message']);}logger[_0x339d('0xe')](_0x339d('0x9'),_0x18a41d,_0x132706[_0x339d('0xe')][_0x339d('0x10')]);return _0x1a353c(_0x132706[_0x339d('0xe')][_0x339d('0x10')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x18a41d,_0x339d('0xa'));_0x1a353c(_0x132706[_0x339d('0x11')][_0x339d('0x10')]);}})[_0x339d('0x12')](function(_0x44ff32){logger['error']('Condition,\x20%s,\x20%s',_0x18a41d,_0x44ff32);_0x30a19(_0x44ff32);});});} \ No newline at end of file +var _0x18e7=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x580cf8,_0x26751e){var _0xcc9a9e=function(_0x5a67ad){while(--_0x5a67ad){_0x580cf8['push'](_0x580cf8['shift']());}};_0xcc9a9e(++_0x26751e);}(_0x18e7,0x1cc));var _0x718e=function(_0x1e72aa,_0x3a3073){_0x1e72aa=_0x1e72aa-0x0;var _0x458adf=_0x18e7[_0x1e72aa];return _0x458adf;};'use strict';var _=require(_0x718e('0x0'));var util=require('util');var moment=require(_0x718e('0x1'));var BPromise=require(_0x718e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x718e('0x3'));var db=require(_0x718e('0x4'))['db'];var utils=require(_0x718e('0x5'));var logger=require(_0x718e('0x6'))(_0x718e('0x7'));var config=require(_0x718e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x718e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d74ad,_0xfb8470,_0xd465f7){return new BPromise(function(_0x2551fb,_0x47fff3){return client[_0x718e('0xa')](_0x3d74ad,_0xd465f7)['then'](function(_0xc05bef){logger[_0x718e('0xb')](_0x718e('0xc'),_0xfb8470,_0x718e('0xd'));logger[_0x718e('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0xfb8470,_0x718e('0xd'),JSON[_0x718e('0xf')](_0xc05bef));if(_0xc05bef[_0x718e('0x10')]){if(_0xc05bef['error'][_0x718e('0x11')]===0x1f4){logger[_0x718e('0x10')](_0x718e('0xc'),_0xfb8470,_0xc05bef[_0x718e('0x10')]['message']);return _0x47fff3(_0xc05bef[_0x718e('0x10')][_0x718e('0x12')]);}logger[_0x718e('0x10')](_0x718e('0xc'),_0xfb8470,_0xc05bef[_0x718e('0x10')][_0x718e('0x12')]);return _0x2551fb(_0xc05bef[_0x718e('0x10')][_0x718e('0x12')]);}else{logger[_0x718e('0xb')](_0x718e('0xc'),_0xfb8470,_0x718e('0xd'));_0x2551fb(_0xc05bef[_0x718e('0x13')][_0x718e('0x12')]);}})[_0x718e('0x14')](function(_0x2c58a2){logger['error'](_0x718e('0xc'),_0xfb8470,_0x2c58a2);_0x47fff3(_0x2c58a2);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 712ce10..1cc74ce 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 _0xef46=['exports','path','connect-timeout','express','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update','delete','destroy'];(function(_0x2621ac,_0x4d8774){var _0x57bc8c=function(_0x2cdfef){while(--_0x2cdfef){_0x2621ac['push'](_0x2621ac['shift']());}};_0x57bc8c(++_0x4d8774);}(_0xef46,0x1da));var _0x6ef4=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xef46[_0x42245d];return _0x4b211a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6ef4('0x0'));var timeout=require(_0x6ef4('0x1'));var express=require(_0x6ef4('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6ef4('0x3'));var config=require(_0x6ef4('0x4'));var controller=require('./condition.controller');router['put'](_0x6ef4('0x5'),auth[_0x6ef4('0x6')](),controller[_0x6ef4('0x7')]);router[_0x6ef4('0x8')]('/:id',auth[_0x6ef4('0x6')](),controller[_0x6ef4('0x9')]);module[_0x6ef4('0xa')]=router; \ No newline at end of file +var _0x56f0=['isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','put','/:id'];(function(_0x2cacef,_0xba1573){var _0x289ba6=function(_0x4ac8b9){while(--_0x4ac8b9){_0x2cacef['push'](_0x2cacef['shift']());}};_0x289ba6(++_0xba1573);}(_0x56f0,0x145));var _0x056f=function(_0x1aa13e,_0x12a40b){_0x1aa13e=_0x1aa13e-0x0;var _0x1144bd=_0x56f0[_0x1aa13e];return _0x1144bd;};'use strict';var multer=require(_0x056f('0x0'));var util=require(_0x056f('0x1'));var path=require('path');var timeout=require(_0x056f('0x2'));var express=require(_0x056f('0x3'));var router=express[_0x056f('0x4')]();var fs_extra=require(_0x056f('0x5'));var auth=require(_0x056f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x056f('0x7'));var controller=require(_0x056f('0x8'));router[_0x056f('0x9')](_0x056f('0xa'),auth[_0x056f('0xb')](),controller[_0x056f('0xc')]);router[_0x056f('0xd')](_0x056f('0xa'),auth['isAuthenticated'](),controller[_0x056f('0xe')]);module[_0x056f('0xf')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 08d3b6e..4e80749 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 _0x5774=['INTEGER','STRING','sequelize','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5774,0x172));var _0x4577=function(_0x4c27d0,_0x4ed2f8){_0x4c27d0=_0x4c27d0-0x0;var _0x433718=_0x5774[_0x4c27d0];return _0x433718;};'use strict';var Sequelize=require(_0x4577('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4577('0x1')},'OrderBy':{'type':Sequelize[_0x4577('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x4577('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0xf54b=['name','INTEGER','exports','STRING'];(function(_0x52bdfe,_0x5282ec){var _0x5c6df7=function(_0x2355bb){while(--_0x2355bb){_0x52bdfe['push'](_0x52bdfe['shift']());}};_0x5c6df7(++_0x5282ec);}(_0xf54b,0xf2));var _0xbf54=function(_0x4d58ce,_0x47fb4f){_0x4d58ce=_0x4d58ce-0x0;var _0x504769=_0xf54b[_0x4d58ce];return _0x504769;};'use strict';var Sequelize=require('sequelize');module[_0xbf54('0x0')]={'name':{'type':Sequelize[_0xbf54('0x1')],'allowNull':![],'unique':_0xbf54('0x2')},'OrderBy':{'type':Sequelize[_0xbf54('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xbf54('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 653e768..923cc7b 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 _0x5eb8=['role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','ContactItemTypes','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','ContactItemType','findAll','rows','catch','show','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x591e50,_0x56cd06){var _0x227604=function(_0x18af52){while(--_0x18af52){_0x591e50['push'](_0x591e50['shift']());}};_0x227604(++_0x56cd06);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1c4409,_0x3b2e8f){_0x1c4409=_0x1c4409-0x0;var _0x356d8f=_0x5eb8[_0x1c4409];return _0x356d8f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];function respondWithStatusCode(_0x784583,_0x2f42ba){_0x2f42ba=_0x2f42ba||0xcc;return function(_0x259f72){if(_0x259f72){return _0x784583['sendStatus'](_0x2f42ba);}return _0x784583['status'](_0x2f42ba)[_0x85eb('0x19')]();};}function respondWithResult(_0x5c760a,_0x18ca53){_0x18ca53=_0x18ca53||0xc8;return function(_0x23a82a){if(_0x23a82a){return _0x5c760a[_0x85eb('0x1a')](_0x18ca53)[_0x85eb('0x1b')](_0x23a82a);}};}function respondWithFilteredResult(_0x183b0c,_0x49efdf){return function(_0x2e5c0a){if(_0x2e5c0a){var _0x59237b=typeof _0x49efdf[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x49efdf[_0x85eb('0x1e')]===_0x85eb('0x1d');var _0x5dbeda=_0x2e5c0a['count'];var _0x50d2a8=_0x59237b?0x0:_0x49efdf[_0x85eb('0x1c')];var _0x39ca96=_0x59237b?_0x2e5c0a[_0x85eb('0x1f')]:_0x49efdf[_0x85eb('0x1c')]+_0x49efdf[_0x85eb('0x1e')];var _0x34f875;if(_0x39ca96>=_0x5dbeda){_0x39ca96=_0x5dbeda;_0x34f875=0xc8;}else{_0x34f875=0xce;}_0x183b0c['status'](_0x34f875);return _0x183b0c[_0x85eb('0x20')](_0x85eb('0x21'),_0x50d2a8+'-'+_0x39ca96+'/'+_0x5dbeda)[_0x85eb('0x1b')](_0x2e5c0a);}return null;};}function patchUpdates(_0x4e8041){return function(_0x4b4b38){try{jsonpatch['apply'](_0x4b4b38,_0x4e8041,!![]);}catch(_0x55b9e4){return BPromise[_0x85eb('0x22')](_0x55b9e4);}return _0x4b4b38[_0x85eb('0x23')]();};}function saveUpdates(_0x329fc5,_0x255ca7){return function(_0x465c74){if(_0x465c74){return _0x465c74[_0x85eb('0x24')](_0x329fc5)['then'](function(_0x5491d5){return _0x5491d5;});}return null;};}function removeEntity(_0x5b48d9,_0x298e84){return function(_0x1426c8){if(_0x1426c8){return _0x1426c8[_0x85eb('0x25')]()[_0x85eb('0x26')](function(){var _0x312b3e=_0x1426c8[_0x85eb('0x27')]({'plain':!![]});var _0x5dfc96=_0x85eb('0x28');return db[_0x85eb('0x29')][_0x85eb('0x25')]({'where':{'type':_0x5dfc96,'resourceId':_0x312b3e['id']}})[_0x85eb('0x26')](function(){return _0x1426c8;});})[_0x85eb('0x26')](function(){_0x5b48d9['status'](0xcc)[_0x85eb('0x19')]();});}};}function handleEntityNotFound(_0x792d3a,_0x291557){return function(_0x3e7eb9){if(!_0x3e7eb9){_0x792d3a[_0x85eb('0x2a')](0x194);}return _0x3e7eb9;};}function handleError(_0x29d262,_0x50541a){_0x50541a=_0x50541a||0x1f4;return function(_0x562792){logger[_0x85eb('0x2b')](_0x562792['stack']);if(_0x562792[_0x85eb('0x2c')]){delete _0x562792['name'];}_0x29d262[_0x85eb('0x1a')](_0x50541a)[_0x85eb('0x2d')](_0x562792);};}exports[_0x85eb('0x2e')]=function(_0x1d9278,_0xa67e1c){var _0xf4ac13={},_0x41ed76={},_0x5decd5={'count':0x0,'rows':[]};var _0x237f19=_[_0x85eb('0x2f')](db['ContactItemType'][_0x85eb('0x30')],function(_0x5af2de){return{'name':_0x5af2de['fieldName'],'type':_0x5af2de[_0x85eb('0x31')][_0x85eb('0x32')]};});_0x41ed76[_0x85eb('0x33')]=_[_0x85eb('0x2f')](_0x237f19,_0x85eb('0x2c'));_0x41ed76[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x1d9278[_0x85eb('0x34')]);_0x41ed76[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x41ed76['model'],_0x41ed76[_0x85eb('0x34')]);_0xf4ac13[_0x85eb('0x38')]=_['intersection'](_0x41ed76['model'],qs[_0x85eb('0x39')](_0x1d9278[_0x85eb('0x34')][_0x85eb('0x39')]));_0xf4ac13[_0x85eb('0x38')]=_0xf4ac13[_0x85eb('0x38')][_0x85eb('0x3a')]?_0xf4ac13[_0x85eb('0x38')]:_0x41ed76[_0x85eb('0x33')];if(!_0x1d9278[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0xf4ac13[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x1d9278[_0x85eb('0x34')]['limit']);_0xf4ac13[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x1d9278['query']['offset']);}_0xf4ac13[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x1d9278['query'][_0x85eb('0x3e')]);_0xf4ac13['where']=qs[_0x85eb('0x36')](_['pick'](_0x1d9278[_0x85eb('0x34')],_0x41ed76['filters']),_0x237f19);if(_0x1d9278[_0x85eb('0x34')]['filter']){_0xf4ac13[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0xf4ac13['where'],{'$or':_[_0x85eb('0x2f')](_0x237f19,function(_0x5a1c15){if(_0x5a1c15[_0x85eb('0x31')]!==_0x85eb('0x41')){var _0x5c0156={};_0x5c0156[_0x5a1c15[_0x85eb('0x2c')]]={'$like':'%'+_0x1d9278['query']['filter']+'%'};return _0x5c0156;}})});}_0xf4ac13=_[_0x85eb('0x40')]({},_0xf4ac13,_0x1d9278['options']);var _0x17cc20={'where':_0xf4ac13[_0x85eb('0x3f')]};return db['ContactItemType']['count'](_0x17cc20)[_0x85eb('0x26')](function(_0x422ec3){_0x5decd5['count']=_0x422ec3;if(_0x1d9278['query'][_0x85eb('0x42')]){_0xf4ac13[_0x85eb('0x43')]=[{'all':!![]}];}return db[_0x85eb('0x44')][_0x85eb('0x45')](_0xf4ac13);})[_0x85eb('0x26')](function(_0x5b7411){_0x5decd5[_0x85eb('0x46')]=_0x5b7411;return _0x5decd5;})[_0x85eb('0x26')](respondWithFilteredResult(_0xa67e1c,_0xf4ac13))[_0x85eb('0x47')](handleError(_0xa67e1c,null));};exports[_0x85eb('0x48')]=function(_0x2ed39d,_0xbc43a7){var _0x40e2a2={'raw':!![],'where':{'id':_0x2ed39d[_0x85eb('0x49')]['id']}},_0x3e11a8={};_0x3e11a8['model']=_[_0x85eb('0x35')](db[_0x85eb('0x44')]['rawAttributes']);_0x3e11a8[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x2ed39d[_0x85eb('0x34')]);_0x3e11a8[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],_0x3e11a8['query']);_0x40e2a2[_0x85eb('0x38')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x39')]));_0x40e2a2[_0x85eb('0x38')]=_0x40e2a2[_0x85eb('0x38')]['length']?_0x40e2a2[_0x85eb('0x38')]:_0x3e11a8[_0x85eb('0x33')];if(_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x42')]){_0x40e2a2[_0x85eb('0x43')]=[{'all':!![]}];}_0x40e2a2=_[_0x85eb('0x40')]({},_0x40e2a2,_0x2ed39d[_0x85eb('0x4a')]);return db[_0x85eb('0x44')][_0x85eb('0x4b')](_0x40e2a2)[_0x85eb('0x26')](handleEntityNotFound(_0xbc43a7,null))[_0x85eb('0x26')](respondWithResult(_0xbc43a7,null))[_0x85eb('0x47')](handleError(_0xbc43a7,null));};exports['create']=function(_0x11da79,_0x2c951b){return db[_0x85eb('0x44')]['create'](_0x11da79[_0x85eb('0x4c')],{})[_0x85eb('0x26')](function(_0x2cf928){var _0xd2f302=_0x11da79[_0x85eb('0x4d')]['get']({'plain':!![]});if(!_0xd2f302)throw new Error(_0x85eb('0x4e'));if(_0xd2f302[_0x85eb('0x4f')]===_0x85eb('0x4d')){var _0x50e264=_0x2cf928[_0x85eb('0x27')]({'plain':!![]});var _0x4550fd=_0x85eb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4550fd,'userProfileId':_0xd2f302[_0x85eb('0x50')]},'raw':!![]})['then'](function(_0x5ed98a){if(_0x5ed98a&&_0x5ed98a[_0x85eb('0x51')]===0x0){return db['UserProfileResource'][_0x85eb('0x52')]({'name':_0x50e264[_0x85eb('0x2c')],'resourceId':_0x50e264['id'],'type':_0x5ed98a['name'],'sectionId':_0x5ed98a['id']},{})['then'](function(){return _0x2cf928;});}else{return _0x2cf928;}})[_0x85eb('0x47')](function(_0x249511){logger[_0x85eb('0x2b')](_0x85eb('0x53'),_0x249511);throw _0x249511;});}return _0x2cf928;})[_0x85eb('0x26')](respondWithResult(_0x2c951b,0xc9))['catch'](handleError(_0x2c951b,null));};exports[_0x85eb('0x24')]=function(_0x30062e,_0x270bb2){if(_0x30062e[_0x85eb('0x4c')]['id']){delete _0x30062e[_0x85eb('0x4c')]['id'];}return db['ContactItemType'][_0x85eb('0x4b')]({'where':{'id':_0x30062e['params']['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x270bb2,null))[_0x85eb('0x26')](saveUpdates(_0x30062e['body'],null))[_0x85eb('0x26')](respondWithResult(_0x270bb2,null))[_0x85eb('0x47')](handleError(_0x270bb2,null));};exports[_0x85eb('0x25')]=function(_0x26e04a,_0x214ef7){return db[_0x85eb('0x44')]['find']({'where':{'id':_0x26e04a[_0x85eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x214ef7,null))[_0x85eb('0x26')](db[_0x85eb('0x54')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x26e04a[_0x85eb('0x49')]['id']}}))[_0x85eb('0x26')](removeEntity(_0x214ef7,null))['catch'](handleError(_0x214ef7,null));}; \ No newline at end of file +var _0x781d=['find','CmContactHasItem','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','get','stack','name','send','index','ContactItemType','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3da901,_0x498bec){var _0xda8ce8=function(_0x1c57c7){while(--_0x1c57c7){_0x3da901['push'](_0x3da901['shift']());}};_0xda8ce8(++_0x498bec);}(_0x781d,0x14a));var _0xd781=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x781d[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){var _0x221f14=_0x31bf57[_0xd781('0x27')]({'plain':!![]});var _0x10940b='ContactItemTypes';return db['UserProfileResource'][_0xd781('0x25')]({'where':{'type':_0x10940b,'resourceId':_0x221f14['id']}})[_0xd781('0x26')](function(){return _0x31bf57;});})[_0xd781('0x26')](function(){_0x101480['status'](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x5a431b,_0x47c609){return function(_0x1e29c8){if(!_0x1e29c8){_0x5a431b['sendStatus'](0x194);}return _0x1e29c8;};}function handleError(_0x3e868,_0x123a6a){_0x123a6a=_0x123a6a||0x1f4;return function(_0x5c3848){logger['error'](_0x5c3848[_0xd781('0x28')]);if(_0x5c3848['name']){delete _0x5c3848[_0xd781('0x29')];}_0x3e868['status'](_0x123a6a)[_0xd781('0x2a')](_0x5c3848);};}exports[_0xd781('0x2b')]=function(_0x556127,_0x54521e){var _0x432d14={},_0x29e81a={},_0x1c7d83={'count':0x0,'rows':[]};var _0x5a389c=_['map'](db[_0xd781('0x2c')][_0xd781('0x2d')],function(_0x36a889){return{'name':_0x36a889['fieldName'],'type':_0x36a889['type'][_0xd781('0x2e')]};});_0x29e81a[_0xd781('0x2f')]=_['map'](_0x5a389c,_0xd781('0x29'));_0x29e81a[_0xd781('0x30')]=_['keys'](_0x556127[_0xd781('0x30')]);_0x29e81a[_0xd781('0x31')]=_[_0xd781('0x32')](_0x29e81a[_0xd781('0x2f')],_0x29e81a['query']);_0x432d14[_0xd781('0x33')]=_[_0xd781('0x32')](_0x29e81a[_0xd781('0x2f')],qs[_0xd781('0x34')](_0x556127['query'][_0xd781('0x34')]));_0x432d14[_0xd781('0x33')]=_0x432d14['attributes'][_0xd781('0x35')]?_0x432d14['attributes']:_0x29e81a[_0xd781('0x2f')];if(!_0x556127[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x36'))){_0x432d14[_0xd781('0x1e')]=qs['limit'](_0x556127[_0xd781('0x30')]['limit']);_0x432d14[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x556127['query'][_0xd781('0x1c')]);}_0x432d14[_0xd781('0x37')]=qs['sort'](_0x556127[_0xd781('0x30')][_0xd781('0x38')]);_0x432d14[_0xd781('0x39')]=qs['filters'](_[_0xd781('0x3a')](_0x556127[_0xd781('0x30')],_0x29e81a[_0xd781('0x31')]),_0x5a389c);if(_0x556127[_0xd781('0x30')][_0xd781('0x3b')]){_0x432d14[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x432d14[_0xd781('0x39')],{'$or':_[_0xd781('0x3d')](_0x5a389c,function(_0x5c6026){if(_0x5c6026[_0xd781('0x3e')]!=='VIRTUAL'){var _0x2504ac={};_0x2504ac[_0x5c6026[_0xd781('0x29')]]={'$like':'%'+_0x556127['query'][_0xd781('0x3b')]+'%'};return _0x2504ac;}})});}_0x432d14=_[_0xd781('0x3c')]({},_0x432d14,_0x556127[_0xd781('0x3f')]);var _0x402c9c={'where':_0x432d14['where']};return db[_0xd781('0x2c')]['count'](_0x402c9c)[_0xd781('0x26')](function(_0xcdaacf){_0x1c7d83['count']=_0xcdaacf;if(_0x556127['query'][_0xd781('0x40')]){_0x432d14[_0xd781('0x41')]=[{'all':!![]}];}return db[_0xd781('0x2c')][_0xd781('0x42')](_0x432d14);})['then'](function(_0x46e7f6){_0x1c7d83[_0xd781('0x43')]=_0x46e7f6;return _0x1c7d83;})['then'](respondWithFilteredResult(_0x54521e,_0x432d14))['catch'](handleError(_0x54521e,null));};exports[_0xd781('0x44')]=function(_0x1d901e,_0xaa552){var _0x4e2eea={'raw':!![],'where':{'id':_0x1d901e[_0xd781('0x45')]['id']}},_0x594f85={};_0x594f85[_0xd781('0x2f')]=_[_0xd781('0x46')](db[_0xd781('0x2c')][_0xd781('0x2d')]);_0x594f85[_0xd781('0x30')]=_['keys'](_0x1d901e['query']);_0x594f85[_0xd781('0x31')]=_[_0xd781('0x32')](_0x594f85[_0xd781('0x2f')],_0x594f85[_0xd781('0x30')]);_0x4e2eea[_0xd781('0x33')]=_['intersection'](_0x594f85[_0xd781('0x2f')],qs[_0xd781('0x34')](_0x1d901e[_0xd781('0x30')]['fields']));_0x4e2eea[_0xd781('0x33')]=_0x4e2eea[_0xd781('0x33')][_0xd781('0x35')]?_0x4e2eea['attributes']:_0x594f85[_0xd781('0x2f')];if(_0x1d901e[_0xd781('0x30')]['includeAll']){_0x4e2eea['include']=[{'all':!![]}];}_0x4e2eea=_[_0xd781('0x3c')]({},_0x4e2eea,_0x1d901e[_0xd781('0x3f')]);return db[_0xd781('0x2c')]['find'](_0x4e2eea)[_0xd781('0x26')](handleEntityNotFound(_0xaa552,null))[_0xd781('0x26')](respondWithResult(_0xaa552,null))[_0xd781('0x47')](handleError(_0xaa552,null));};exports[_0xd781('0x48')]=function(_0x336d30,_0x3828ad){return db[_0xd781('0x2c')]['create'](_0x336d30[_0xd781('0x49')],{})[_0xd781('0x26')](function(_0x1d54bd){var _0x4c7cb6=_0x336d30[_0xd781('0x4a')][_0xd781('0x27')]({'plain':!![]});if(!_0x4c7cb6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c7cb6[_0xd781('0x4b')]===_0xd781('0x4a')){var _0x41caac=_0x1d54bd[_0xd781('0x27')]({'plain':!![]});var _0x42a2f9='ContactItemTypes';return db[_0xd781('0x4c')]['find']({'where':{'name':_0x42a2f9,'userProfileId':_0x4c7cb6[_0xd781('0x4d')]},'raw':!![]})['then'](function(_0x2ce1f6){if(_0x2ce1f6&&_0x2ce1f6[_0xd781('0x4e')]===0x0){return db['UserProfileResource'][_0xd781('0x48')]({'name':_0x41caac['name'],'resourceId':_0x41caac['id'],'type':_0x2ce1f6['name'],'sectionId':_0x2ce1f6['id']},{})['then'](function(){return _0x1d54bd;});}else{return _0x1d54bd;}})[_0xd781('0x47')](function(_0x174fcd){logger['error'](_0xd781('0x4f'),_0x174fcd);throw _0x174fcd;});}return _0x1d54bd;})['then'](respondWithResult(_0x3828ad,0xc9))[_0xd781('0x47')](handleError(_0x3828ad,null));};exports[_0xd781('0x24')]=function(_0x39d47d,_0x19a6c2){if(_0x39d47d['body']['id']){delete _0x39d47d[_0xd781('0x49')]['id'];}return db['ContactItemType'][_0xd781('0x50')]({'where':{'id':_0x39d47d['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x19a6c2,null))[_0xd781('0x26')](saveUpdates(_0x39d47d['body'],null))[_0xd781('0x26')](respondWithResult(_0x19a6c2,null))[_0xd781('0x47')](handleError(_0x19a6c2,null));};exports[_0xd781('0x25')]=function(_0x32fd9f,_0xfc466c){return db[_0xd781('0x2c')]['find']({'where':{'id':_0x32fd9f['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0xfc466c,null))[_0xd781('0x26')](db[_0xd781('0x51')][_0xd781('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x32fd9f['params']['id']}}))[_0xd781('0x26')](removeEntity(_0xfc466c,null))['catch'](handleError(_0xfc466c,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 2d44fb8..36b598a 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 _0x219a=['lodash','util','../../config/logger','moment','path','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types'];(function(_0x467488,_0x38c7ae){var _0x56107f=function(_0x4992b3){while(--_0x4992b3){_0x467488['push'](_0x467488['shift']());}};_0x56107f(++_0x38c7ae);}(_0x219a,0x79));var _0xa219=function(_0x4ce532,_0x44e4ea){_0x4ce532=_0x4ce532-0x0;var _0x2ec187=_0x219a[_0x4ce532];return _0x2ec187;};'use strict';var _=require(_0xa219('0x0'));var util=require(_0xa219('0x1'));var logger=require(_0xa219('0x2'))('api');var moment=require(_0xa219('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa219('0x4'));var rimraf=require('rimraf');var config=require(_0xa219('0x5'));var attributes=require(_0xa219('0x6'));module[_0xa219('0x7')]=function(_0x1e7a37,_0x8c593){return _0x1e7a37[_0xa219('0x8')](_0xa219('0x9'),attributes,{'tableName':_0xa219('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1e4=['exports','ContactItemType','tools_contact_item_types','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x4ff3e2,_0x2eb869){var _0x216c24=function(_0x3509c7){while(--_0x3509c7){_0x4ff3e2['push'](_0x4ff3e2['shift']());}};_0x216c24(++_0x2eb869);}(_0xc1e4,0xa3));var _0x4c1e=function(_0x381470,_0x36679d){_0x381470=_0x381470-0x0;var _0x4e636d=_0xc1e4[_0x381470];return _0x4e636d;};'use strict';var _=require(_0x4c1e('0x0'));var util=require(_0x4c1e('0x1'));var logger=require('../../config/logger')(_0x4c1e('0x2'));var moment=require(_0x4c1e('0x3'));var BPromise=require(_0x4c1e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c1e('0x5'));var rimraf=require(_0x4c1e('0x6'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module[_0x4c1e('0x7')]=function(_0x32f1ad,_0x5794eb){return _0x32f1ad['define'](_0x4c1e('0x8'),attributes,{'tableName':_0x4c1e('0x9'),'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 3870d84..d11ab32 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 _0x1667=['then','info','ContactItemType,\x20%s,\x20%s','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0xe93a28,_0x3bd27e){var _0x8e547f=function(_0x342d35){while(--_0x342d35){_0xe93a28['push'](_0xe93a28['shift']());}};_0x8e547f(++_0x3bd27e);}(_0x1667,0xfd));var _0x7166=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x1667[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0x7166('0x0'));var util=require(_0x7166('0x1'));var moment=require(_0x7166('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7166('0x3'));var db=require(_0x7166('0x4'))['db'];var utils=require(_0x7166('0x5'));var logger=require(_0x7166('0x6'))('rpc');var config=require(_0x7166('0x7'));var jayson=require(_0x7166('0x8'));var client=jayson[_0x7166('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x479d81,_0x2ff9e5,_0x2cbc6c){return new BPromise(function(_0x2f43be,_0x43ed93){return client[_0x7166('0xa')](_0x479d81,_0x2cbc6c)[_0x7166('0xb')](function(_0x59ac5c){logger[_0x7166('0xc')](_0x7166('0xd'),_0x2ff9e5,'request\x20sent');logger['debug'](_0x7166('0xe'),_0x2ff9e5,_0x7166('0xf'),JSON[_0x7166('0x10')](_0x59ac5c));if(_0x59ac5c['error']){if(_0x59ac5c[_0x7166('0x11')][_0x7166('0x12')]===0x1f4){logger['error'](_0x7166('0xd'),_0x2ff9e5,_0x59ac5c[_0x7166('0x11')][_0x7166('0x13')]);return _0x43ed93(_0x59ac5c['error'][_0x7166('0x13')]);}logger[_0x7166('0x11')](_0x7166('0xd'),_0x2ff9e5,_0x59ac5c[_0x7166('0x11')][_0x7166('0x13')]);return _0x2f43be(_0x59ac5c['error'][_0x7166('0x13')]);}else{logger[_0x7166('0xc')](_0x7166('0xd'),_0x2ff9e5,_0x7166('0xf'));_0x2f43be(_0x59ac5c[_0x7166('0x14')]['message']);}})[_0x7166('0x15')](function(_0x4cbdeb){logger[_0x7166('0x11')](_0x7166('0xd'),_0x2ff9e5,_0x4cbdeb);_0x43ed93(_0x4cbdeb);});});} \ No newline at end of file +var _0xc521=['code','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5a0383,_0x312ffe){var _0x1adda7=function(_0x1a0cf5){while(--_0x1a0cf5){_0x5a0383['push'](_0x5a0383['shift']());}};_0x1adda7(++_0x312ffe);}(_0xc521,0xbd));var _0x1c52=function(_0x2571e2,_0x547809){_0x2571e2=_0x2571e2-0x0;var _0x29c6c7=_0xc521[_0x2571e2];return _0x29c6c7;};'use strict';var _=require(_0x1c52('0x0'));var util=require(_0x1c52('0x1'));var moment=require(_0x1c52('0x2'));var BPromise=require(_0x1c52('0x3'));var rs=require(_0x1c52('0x4'));var fs=require('fs');var Redis=require(_0x1c52('0x5'));var db=require(_0x1c52('0x6'))['db'];var utils=require(_0x1c52('0x7'));var logger=require(_0x1c52('0x8'))(_0x1c52('0x9'));var config=require(_0x1c52('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1c52('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d74cf,_0x447f4d,_0x4f337c){return new BPromise(function(_0x3d64aa,_0x49cf7b){return client['request'](_0x3d74cf,_0x4f337c)[_0x1c52('0xc')](function(_0x47c887){logger['info']('ContactItemType,\x20%s,\x20%s',_0x447f4d,_0x1c52('0xd'));logger[_0x1c52('0xe')](_0x1c52('0xf'),_0x447f4d,'request\x20sent',JSON[_0x1c52('0x10')](_0x47c887));if(_0x47c887[_0x1c52('0x11')]){if(_0x47c887[_0x1c52('0x11')][_0x1c52('0x12')]===0x1f4){logger[_0x1c52('0x11')](_0x1c52('0x13'),_0x447f4d,_0x47c887[_0x1c52('0x11')][_0x1c52('0x14')]);return _0x49cf7b(_0x47c887[_0x1c52('0x11')][_0x1c52('0x14')]);}logger[_0x1c52('0x11')]('ContactItemType,\x20%s,\x20%s',_0x447f4d,_0x47c887[_0x1c52('0x11')]['message']);return _0x3d64aa(_0x47c887['error'][_0x1c52('0x14')]);}else{logger['info'](_0x1c52('0x13'),_0x447f4d,'request\x20sent');_0x3d64aa(_0x47c887[_0x1c52('0x15')][_0x1c52('0x14')]);}})[_0x1c52('0x16')](function(_0x4d1770){logger[_0x1c52('0x11')](_0x1c52('0x13'),_0x447f4d,_0x4d1770);_0x49cf7b(_0x4d1770);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 7264489..e3be67e 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 _0xc11b=['delete','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','/:id','post','create','put'];(function(_0x5e6209,_0x5f1f8b){var _0x39bd66=function(_0x3a3e97){while(--_0x3a3e97){_0x5e6209['push'](_0x5e6209['shift']());}};_0x39bd66(++_0x5f1f8b);}(_0xc11b,0x142));var _0xbc11=function(_0x1d37b3,_0x3a2ee9){_0x1d37b3=_0x1d37b3-0x0;var _0x1c7bf9=_0xc11b[_0x1d37b3];return _0x1c7bf9;};'use strict';var multer=require('multer');var util=require(_0xbc11('0x0'));var path=require(_0xbc11('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbc11('0x2')]();var fs_extra=require(_0xbc11('0x3'));var auth=require(_0xbc11('0x4'));var interaction=require(_0xbc11('0x5'));var config=require(_0xbc11('0x6'));var controller=require(_0xbc11('0x7'));router[_0xbc11('0x8')]('/',auth[_0xbc11('0x9')](),controller['index']);router['get'](_0xbc11('0xa'),auth[_0xbc11('0x9')](),controller['show']);router[_0xbc11('0xb')]('/',auth[_0xbc11('0x9')](),controller[_0xbc11('0xc')]);router[_0xbc11('0xd')](_0xbc11('0xa'),auth[_0xbc11('0x9')](),controller['update']);router[_0xbc11('0xe')](_0xbc11('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xbc11('0xf')]=router; \ No newline at end of file +var _0x744b=['delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','put'];(function(_0x5ec2a5,_0x53f90c){var _0x27a436=function(_0x291525){while(--_0x291525){_0x5ec2a5['push'](_0x5ec2a5['shift']());}};_0x27a436(++_0x53f90c);}(_0x744b,0x142));var _0xb744=function(_0x2e1907,_0x229a70){_0x2e1907=_0x2e1907-0x0;var _0x401555=_0x744b[_0x2e1907];return _0x401555;};'use strict';var multer=require(_0xb744('0x0'));var util=require(_0xb744('0x1'));var path=require(_0xb744('0x2'));var timeout=require(_0xb744('0x3'));var express=require(_0xb744('0x4'));var router=express['Router']();var fs_extra=require(_0xb744('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb744('0x6'));var config=require('../../config/environment');var controller=require('./contactItemType.controller');router[_0xb744('0x7')]('/',auth[_0xb744('0x8')](),controller['index']);router[_0xb744('0x7')](_0xb744('0x9'),auth[_0xb744('0x8')](),controller[_0xb744('0xa')]);router[_0xb744('0xb')]('/',auth[_0xb744('0x8')](),controller[_0xb744('0xc')]);router[_0xb744('0xd')](_0xb744('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xb744('0xe')](_0xb744('0x9'),auth[_0xb744('0x8')](),controller[_0xb744('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index db69b2b..8c8c61c 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 _0xb7e7=['STRING','sequelize'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xb7e7[_0x1cb18a];return _0x22442e;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x4a5f7d,_0x310d5e){var _0x5d3052=function(_0x57c9cf){while(--_0x57c9cf){_0x4a5f7d['push'](_0x4a5f7d['shift']());}};_0x5d3052(++_0x310d5e);}(_0x757a,0xde));var _0xa757=function(_0x421023,_0x3c5370){_0x421023=_0x421023-0x0;var _0x5b323a=_0x757a[_0x421023];return _0x5b323a;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index b9a9679..97af0df 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 _0x71a4=['0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','voice','web-report','attrReport','attrRefresh','stringify','addItem','DashboardId','DashboardItem','findOne','order','getItems','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','get','CustomDashboards','UserProfileResource','destroy','end','error','stack','name','index','Dashboard','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone'];(function(_0x3f465d,_0xbd2037){var _0x121ad1=function(_0x5b13d6){while(--_0x5b13d6){_0x3f465d['push'](_0x3f465d['shift']());}};_0x121ad1(++_0xbd2037);}(_0x71a4,0x196));var _0x471a=function(_0x5aebd4,_0x3e93b3){_0x5aebd4=_0x5aebd4-0x0;var _0x539a0f=_0x71a4[_0x5aebd4];return _0x539a0f;};'use strict';var emlformat=require(_0x471a('0x0'));var rimraf=require(_0x471a('0x1'));var zipdir=require(_0x471a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x471a('0x3'));var moment=require(_0x471a('0x4'));var BPromise=require(_0x471a('0x5'));var Mustache=require(_0x471a('0x6'));var util=require(_0x471a('0x7'));var path=require(_0x471a('0x8'));var sox=require(_0x471a('0x9'));var csv=require(_0x471a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x471a('0xb'));var squel=require('squel');var crypto=require(_0x471a('0xc'));var jsforce=require(_0x471a('0xd'));var deskjs=require(_0x471a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x471a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x471a('0x10'));var logger=require('../../config/logger')(_0x471a('0x11'));var utils=require(_0x471a('0x12'));var config=require(_0x471a('0x13'));var licenseUtil=require(_0x471a('0x14'));var db=require(_0x471a('0x15'))['db'];config[_0x471a('0x16')]=_[_0x471a('0x17')](config['redis'],{'host':_0x471a('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x471a('0x16')]));require('./dashboard.socket')[_0x471a('0x19')](socket);function respondWithStatusCode(_0x7d8947,_0xdb14f3){_0xdb14f3=_0xdb14f3||0xcc;return function(_0x30f978){if(_0x30f978){return _0x7d8947[_0x471a('0x1a')](_0xdb14f3);}return _0x7d8947[_0x471a('0x1b')](_0xdb14f3)['end']();};}function respondWithResult(_0x46b902,_0x5cf889){_0x5cf889=_0x5cf889||0xc8;return function(_0x4d9944){if(_0x4d9944){return _0x46b902[_0x471a('0x1b')](_0x5cf889)[_0x471a('0x1c')](_0x4d9944);}};}function respondWithFilteredResult(_0x169725,_0x5cd0c5){return function(_0x1f2840){if(_0x1f2840){var _0xc8e15c=typeof _0x5cd0c5[_0x471a('0x1d')]===_0x471a('0x1e')&&typeof _0x5cd0c5[_0x471a('0x1f')]===_0x471a('0x1e');var _0x5c1808=_0x1f2840['count'];var _0x518765=_0xc8e15c?0x0:_0x5cd0c5['offset'];var _0x343e60=_0xc8e15c?_0x1f2840[_0x471a('0x20')]:_0x5cd0c5[_0x471a('0x1d')]+_0x5cd0c5[_0x471a('0x1f')];var _0x5f43d8;if(_0x343e60>=_0x5c1808){_0x343e60=_0x5c1808;_0x5f43d8=0xc8;}else{_0x5f43d8=0xce;}_0x169725[_0x471a('0x1b')](_0x5f43d8);return _0x169725[_0x471a('0x21')](_0x471a('0x22'),_0x518765+'-'+_0x343e60+'/'+_0x5c1808)['json'](_0x1f2840);}return null;};}function patchUpdates(_0x1ce444){return function(_0x205edf){try{jsonpatch[_0x471a('0x23')](_0x205edf,_0x1ce444,!![]);}catch(_0x5df816){return BPromise['reject'](_0x5df816);}return _0x205edf['save']();};}function saveUpdates(_0xaa01a,_0x76ffa4){return function(_0x3c856d){if(_0x3c856d){return _0x3c856d[_0x471a('0x24')](_0xaa01a)[_0x471a('0x25')](function(_0x4ab1ce){return _0x4ab1ce;});}return null;};}function removeEntity(_0x31ba2d,_0x2e88d3){return function(_0x59a1ee){if(_0x59a1ee){return _0x59a1ee['destroy']()['then'](function(){var _0x2c24e1=_0x59a1ee[_0x471a('0x26')]({'plain':!![]});var _0x24d296=_0x471a('0x27');return db[_0x471a('0x28')][_0x471a('0x29')]({'where':{'type':_0x24d296,'resourceId':_0x2c24e1['id']}})[_0x471a('0x25')](function(){return _0x59a1ee;});})[_0x471a('0x25')](function(){_0x31ba2d[_0x471a('0x1b')](0xcc)[_0x471a('0x2a')]();});}};}function handleEntityNotFound(_0x2b06cd,_0x18174a){return function(_0x18e0c5){if(!_0x18e0c5){_0x2b06cd[_0x471a('0x1a')](0x194);}return _0x18e0c5;};}function handleError(_0x579331,_0x46e7cf){_0x46e7cf=_0x46e7cf||0x1f4;return function(_0x337870){logger[_0x471a('0x2b')](_0x337870[_0x471a('0x2c')]);if(_0x337870[_0x471a('0x2d')]){delete _0x337870['name'];}_0x579331[_0x471a('0x1b')](_0x46e7cf)['send'](_0x337870);};}exports[_0x471a('0x2e')]=function(_0x1885d0,_0x1b042b){var _0x2d90ba={},_0x546970={},_0x44b9fa={'count':0x0,'rows':[]};var _0x24b607=_['map'](db[_0x471a('0x2f')]['rawAttributes'],function(_0x44bf66){return{'name':_0x44bf66[_0x471a('0x30')],'type':_0x44bf66[_0x471a('0x31')][_0x471a('0x32')]};});_0x546970[_0x471a('0x33')]=_[_0x471a('0x34')](_0x24b607,_0x471a('0x2d'));_0x546970[_0x471a('0x35')]=_[_0x471a('0x36')](_0x1885d0[_0x471a('0x35')]);_0x546970['filters']=_[_0x471a('0x37')](_0x546970[_0x471a('0x33')],_0x546970[_0x471a('0x35')]);_0x2d90ba[_0x471a('0x38')]=_['intersection'](_0x546970[_0x471a('0x33')],qs[_0x471a('0x39')](_0x1885d0[_0x471a('0x35')][_0x471a('0x39')]));_0x2d90ba[_0x471a('0x38')]=_0x2d90ba['attributes'][_0x471a('0x3a')]?_0x2d90ba[_0x471a('0x38')]:_0x546970[_0x471a('0x33')];if(!_0x1885d0[_0x471a('0x35')]['hasOwnProperty'](_0x471a('0x3b'))){_0x2d90ba[_0x471a('0x1f')]=qs['limit'](_0x1885d0['query']['limit']);_0x2d90ba[_0x471a('0x1d')]=qs[_0x471a('0x1d')](_0x1885d0[_0x471a('0x35')][_0x471a('0x1d')]);}_0x2d90ba['order']=qs[_0x471a('0x3c')](_0x1885d0['query'][_0x471a('0x3c')]);_0x2d90ba['where']=qs[_0x471a('0x3d')](_[_0x471a('0x3e')](_0x1885d0[_0x471a('0x35')],_0x546970[_0x471a('0x3d')]),_0x24b607);if(_0x1885d0[_0x471a('0x35')][_0x471a('0x3f')]){_0x2d90ba[_0x471a('0x40')]=_[_0x471a('0x41')](_0x2d90ba['where'],{'$or':_[_0x471a('0x34')](_0x24b607,function(_0x16bc27){if(_0x16bc27[_0x471a('0x31')]!==_0x471a('0x42')){var _0x5a1de9={};_0x5a1de9[_0x16bc27['name']]={'$like':'%'+_0x1885d0[_0x471a('0x35')]['filter']+'%'};return _0x5a1de9;}})});}_0x2d90ba=_[_0x471a('0x41')]({},_0x2d90ba,_0x1885d0[_0x471a('0x43')]);var _0x374f7f={'where':_0x2d90ba['where']};return db['Dashboard'][_0x471a('0x20')](_0x374f7f)[_0x471a('0x25')](function(_0xf39c75){_0x44b9fa[_0x471a('0x20')]=_0xf39c75;if(_0x1885d0[_0x471a('0x35')][_0x471a('0x44')]){_0x2d90ba[_0x471a('0x45')]=[{'all':!![]}];}return db['Dashboard'][_0x471a('0x46')](_0x2d90ba);})[_0x471a('0x25')](function(_0x5423e5){_0x44b9fa[_0x471a('0x47')]=_0x5423e5;return _0x44b9fa;})[_0x471a('0x25')](respondWithFilteredResult(_0x1b042b,_0x2d90ba))[_0x471a('0x48')](handleError(_0x1b042b,null));};exports[_0x471a('0x49')]=function(_0x160d7d,_0x3979f8){var _0x1f29ee={'raw':![],'where':{'id':_0x160d7d[_0x471a('0x4a')]['id']}},_0x2c9b42={};_0x2c9b42[_0x471a('0x33')]=_[_0x471a('0x36')](db[_0x471a('0x2f')][_0x471a('0x4b')]);_0x2c9b42[_0x471a('0x35')]=_[_0x471a('0x36')](_0x160d7d[_0x471a('0x35')]);_0x2c9b42[_0x471a('0x3d')]=_[_0x471a('0x37')](_0x2c9b42['model'],_0x2c9b42[_0x471a('0x35')]);_0x1f29ee[_0x471a('0x38')]=_[_0x471a('0x37')](_0x2c9b42['model'],qs[_0x471a('0x39')](_0x160d7d[_0x471a('0x35')]['fields']));_0x1f29ee[_0x471a('0x38')]=_0x1f29ee[_0x471a('0x38')]['length']?_0x1f29ee[_0x471a('0x38')]:_0x2c9b42[_0x471a('0x33')];if(_0x160d7d[_0x471a('0x35')][_0x471a('0x44')]){_0x1f29ee['include']=[{'all':!![]}];}_0x1f29ee=_[_0x471a('0x41')]({},_0x1f29ee,_0x160d7d[_0x471a('0x43')]);return db[_0x471a('0x2f')][_0x471a('0x4c')](_0x1f29ee)['then'](handleEntityNotFound(_0x3979f8,null))[_0x471a('0x25')](respondWithResult(_0x3979f8,null))['catch'](handleError(_0x3979f8,null));};exports[_0x471a('0x4d')]=function(_0x5bed6c,_0x34e753){return db[_0x471a('0x2f')][_0x471a('0x4d')](_0x5bed6c[_0x471a('0x4e')],{})[_0x471a('0x25')](function(_0x80961){var _0xb9dfb2=_0x5bed6c[_0x471a('0x4f')]['get']({'plain':!![]});if(!_0xb9dfb2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb9dfb2['role']===_0x471a('0x4f')){var _0x52848a=_0x80961[_0x471a('0x26')]({'plain':!![]});var _0x51aacd=_0x471a('0x27');return db['UserProfileSection'][_0x471a('0x4c')]({'where':{'name':_0x51aacd,'userProfileId':_0xb9dfb2[_0x471a('0x50')]},'raw':!![]})[_0x471a('0x25')](function(_0x4ad7cc){if(_0x4ad7cc&&_0x4ad7cc[_0x471a('0x51')]===0x0){return db[_0x471a('0x28')][_0x471a('0x4d')]({'name':_0x52848a[_0x471a('0x2d')],'resourceId':_0x52848a['id'],'type':_0x4ad7cc[_0x471a('0x2d')],'sectionId':_0x4ad7cc['id']},{})[_0x471a('0x25')](function(){return _0x80961;});}else{return _0x80961;}})[_0x471a('0x48')](function(_0x4a0fed){logger[_0x471a('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a0fed);throw _0x4a0fed;});}return _0x80961;})[_0x471a('0x25')](respondWithResult(_0x34e753,0xc9))[_0x471a('0x48')](handleError(_0x34e753,null));};exports[_0x471a('0x52')]=function(_0x147a1b,_0xcc8f74){var _0x51161b={'where':{'id':_0x147a1b[_0x471a('0x4a')]['id']}},_0x2e1640={};_0x2e1640[_0x471a('0x33')]=_[_0x471a('0x36')](db[_0x471a('0x2f')][_0x471a('0x4b')]);_0x51161b[_0x471a('0x38')]=_[_0x471a('0x37')](_0x2e1640[_0x471a('0x33')],qs[_0x471a('0x39')](_0x147a1b[_0x471a('0x35')][_0x471a('0x39')]));_0x51161b['attributes']=_0x51161b[_0x471a('0x38')]['length']?_0x51161b[_0x471a('0x38')]:_0x2e1640[_0x471a('0x33')];if(_0x147a1b[_0x471a('0x35')][_0x471a('0x44')]){_0x51161b['include']=[{'all':!![]}];}_0x51161b=_[_0x471a('0x41')]({},_0x51161b,_0x147a1b[_0x471a('0x43')]);return db['Dashboard']['find'](_0x51161b)['then'](handleEntityNotFound(_0xcc8f74,null))[_0x471a('0x25')](function(_0xf77ab0){if(_0xf77ab0){var _0x54b9db=_0xf77ab0[_0x471a('0x26')]({'plain':!![]});_0x54b9db=qs[_0x471a('0x53')](_0x54b9db,['id',_0x471a('0x54'),'updatedAt']);_0x147a1b['body']=_['omit'](_0x147a1b[_0x471a('0x4e')],['id',_0x471a('0x54'),_0x471a('0x55')]);return db[_0x471a('0x2f')]['create'](_[_0x471a('0x41')](_0x54b9db,_0x147a1b[_0x471a('0x4e')]),{'include':_0x147a1b[_0x471a('0x35')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3f387c){var _0x185f6d=_0x147a1b[_0x471a('0x4f')][_0x471a('0x26')]({'plain':!![]});if(!_0x185f6d)throw new Error(_0x471a('0x56'));if(_0x185f6d[_0x471a('0x57')]===_0x471a('0x4f')){var _0x4e4609=_0x3f387c[_0x471a('0x26')]({'plain':!![]});var _0x34d331='CustomDashboards';return db[_0x471a('0x58')][_0x471a('0x4c')]({'where':{'name':_0x34d331,'userProfileId':_0x185f6d[_0x471a('0x50')]},'raw':!![]})[_0x471a('0x25')](function(_0x10690e){if(_0x10690e&&_0x10690e[_0x471a('0x51')]===0x0){return db[_0x471a('0x28')][_0x471a('0x4d')]({'name':_0x4e4609[_0x471a('0x2d')],'resourceId':_0x4e4609['id'],'type':_0x10690e[_0x471a('0x2d')],'sectionId':_0x10690e['id']},{})['then'](function(){return _0x3f387c;});}else{return _0x3f387c;}})[_0x471a('0x48')](function(_0x1b9da8){logger[_0x471a('0x2b')](_0x471a('0x59'),_0x1b9da8);throw _0x1b9da8;});}return _0x3f387c;});}})[_0x471a('0x25')](respondWithResult(_0xcc8f74,0xc9))[_0x471a('0x48')](handleError(_0xcc8f74,null));};exports[_0x471a('0x24')]=function(_0x23811d,_0x1a6311){if(_0x23811d['body']['id']){delete _0x23811d['body']['id'];}return db[_0x471a('0x2f')][_0x471a('0x4c')]({'where':{'id':_0x23811d[_0x471a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1a6311,null))[_0x471a('0x25')](saveUpdates(_0x23811d['body'],null))[_0x471a('0x25')](respondWithResult(_0x1a6311,null))[_0x471a('0x48')](handleError(_0x1a6311,null));};exports[_0x471a('0x29')]=function(_0xe72480,_0x564803){return db[_0x471a('0x2f')]['find']({'where':{'id':_0xe72480[_0x471a('0x4a')]['id']}})[_0x471a('0x25')](handleEntityNotFound(_0x564803,null))[_0x471a('0x25')](removeEntity(_0x564803,null))[_0x471a('0x48')](handleError(_0x564803,null));};function widgetAttributes(_0x4ec83e){try{switch(_0x4ec83e[_0x471a('0x31')]){case _0x471a('0x5a'):return[{'name':'attrUrl','value':_0x4ec83e['attrUrl']||(_0x4ec83e['attrs']&&_0x4ec83e[_0x471a('0x5b')][0x0]?_0x4ec83e[_0x471a('0x5b')][0x0][_0x471a('0x5c')]:undefined)||'https://'}];case _0x471a('0x5d'):return[{'name':_0x471a('0x5e'),'value':_0x4ec83e['attrPath']||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x0]?_0x4ec83e[_0x471a('0x5b')][0x0][_0x471a('0x5c')]:undefined)||''}];case'clock':return[{'name':_0x471a('0x5f'),'value':_0x4ec83e[_0x471a('0x5f')]||(_0x4ec83e['attrs']&&_0x4ec83e[_0x471a('0x5b')][0x0]?_0x4ec83e['attrs'][0x0][_0x471a('0x5c')]:undefined)||_0x471a('0x60')},{'name':_0x471a('0x61'),'value':_0x4ec83e[_0x471a('0x61')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x1]?_0x4ec83e[_0x471a('0x5b')][0x1][_0x471a('0x5c')]:undefined)||_0x471a('0x62')},{'name':_0x471a('0x63'),'value':_0x4ec83e['attrFontSize']||(_0x4ec83e['attrs']&&_0x4ec83e[_0x471a('0x5b')][0x2]?_0x4ec83e[_0x471a('0x5b')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x471a('0x64'),'value':_0x4ec83e[_0x471a('0x64')]||(_0x4ec83e['attrs']&&_0x4ec83e[_0x471a('0x5b')][0x0]?_0x4ec83e[_0x471a('0x5b')][0x0][_0x471a('0x5c')]:undefined)||'total'},{'name':_0x471a('0x65'),'value':_0x4ec83e[_0x471a('0x65')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x1]?_0x4ec83e['attrs'][0x1][_0x471a('0x5c')]:undefined)||[]},{'name':'attrFontSize','value':_0x4ec83e[_0x471a('0x63')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x2]?_0x4ec83e[_0x471a('0x5b')][0x2][_0x471a('0x5c')]:undefined)||0x14},{'name':'attrChannel','value':_0x4ec83e[_0x471a('0x66')]||(_0x4ec83e['attrs']&&_0x4ec83e[_0x471a('0x5b')][0x3]?_0x4ec83e['attrs'][0x3]['value']:undefined)||'voice'},{'name':_0x471a('0x67'),'value':_0x4ec83e[_0x471a('0x67')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x4]?_0x4ec83e[_0x471a('0x5b')][0x4][_0x471a('0x5c')]:undefined)||''},{'name':_0x471a('0x68'),'value':_0x4ec83e[_0x471a('0x68')]||(_0x4ec83e['attrs']&&_0x4ec83e['attrs'][0x5]?_0x4ec83e[_0x471a('0x5b')][0x5]['value']:undefined)||''},{'name':_0x471a('0x69'),'value':_0x4ec83e['attrSmsAccounts']||(_0x4ec83e['attrs']&&_0x4ec83e[_0x471a('0x5b')][0x6]?_0x4ec83e['attrs'][0x6]['value']:undefined)||''},{'name':_0x471a('0x6a'),'value':_0x4ec83e[_0x471a('0x6a')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x7]?_0x4ec83e['attrs'][0x7][_0x471a('0x5c')]:undefined)||''},{'name':_0x471a('0x6b'),'value':_0x4ec83e[_0x471a('0x6b')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x8]?_0x4ec83e[_0x471a('0x5b')][0x8][_0x471a('0x5c')]:undefined)||''},{'name':_0x471a('0x6c'),'value':_0x4ec83e[_0x471a('0x6c')]||(_0x4ec83e['attrs']&&_0x4ec83e[_0x471a('0x5b')][0x9]?_0x4ec83e['attrs'][0x9][_0x471a('0x5c')]:undefined)||''}];case _0x471a('0x6d'):case _0x471a('0x6e'):return[{'name':_0x471a('0x6f'),'value':_0x4ec83e[_0x471a('0x6f')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e['attrs'][0x0]?_0x4ec83e[_0x471a('0x5b')][0x0]['value']:undefined)||_0x471a('0x70')},{'name':_0x471a('0x71'),'value':_0x4ec83e[_0x471a('0x71')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x1]?_0x4ec83e[_0x471a('0x5b')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x4ec83e[_0x471a('0x72')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x2]?_0x4ec83e[_0x471a('0x5b')][0x2][_0x471a('0x5c')]:undefined)||null},{'name':_0x471a('0x65'),'value':_0x4ec83e[_0x471a('0x65')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x3]?_0x4ec83e[_0x471a('0x5b')][0x3][_0x471a('0x5c')]:undefined)||[]},{'name':_0x471a('0x66'),'value':_0x4ec83e['attrChannel']||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x4]?_0x4ec83e['attrs'][0x4][_0x471a('0x5c')]:undefined)||_0x471a('0x73')},{'name':'attrEmailAccounts','value':_0x4ec83e[_0x471a('0x67')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x5]?_0x4ec83e[_0x471a('0x5b')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x4ec83e[_0x471a('0x68')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x6]?_0x4ec83e[_0x471a('0x5b')][0x6][_0x471a('0x5c')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x4ec83e[_0x471a('0x69')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x7]?_0x4ec83e[_0x471a('0x5b')][0x7][_0x471a('0x5c')]:undefined)||''},{'name':_0x471a('0x6a'),'value':_0x4ec83e[_0x471a('0x6a')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x8]?_0x4ec83e[_0x471a('0x5b')][0x8]['value']:undefined)||''},{'name':_0x471a('0x6b'),'value':_0x4ec83e[_0x471a('0x6b')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e['attrs'][0x9]?_0x4ec83e['attrs'][0x9][_0x471a('0x5c')]:undefined)||''},{'name':_0x471a('0x6c'),'value':_0x4ec83e[_0x471a('0x6c')]||(_0x4ec83e['attrs']&&_0x4ec83e['attrs'][0xa]?_0x4ec83e['attrs'][0xa]['value']:undefined)||''}];case _0x471a('0x74'):return[{'name':_0x471a('0x75'),'type':_0x4ec83e['reportType']||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x0]?_0x4ec83e[_0x471a('0x5b')][0x0][_0x471a('0x31')]:undefined)||null,'value':_0x4ec83e['attrReport']||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e['attrs'][0x0]?_0x4ec83e[_0x471a('0x5b')][0x0]['value']:undefined)||null},{'name':_0x471a('0x76'),'value':_0x4ec83e[_0x471a('0x76')]||(_0x4ec83e[_0x471a('0x5b')]&&_0x4ec83e[_0x471a('0x5b')][0x1]?_0x4ec83e[_0x471a('0x5b')][0x1][_0x471a('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x41ba85){logger['error']('widgetAttributes:\x20%s',JSON[_0x471a('0x77')](_0x41ba85));return[];}}exports[_0x471a('0x78')]=function(_0x1076ff,_0x5d4e29,_0x33b936){if(_0x1076ff['body']['id']){delete _0x1076ff['body']['id'];}return db[_0x471a('0x2f')][_0x471a('0x4c')]({'where':{'id':_0x1076ff[_0x471a('0x4a')]['id']}})[_0x471a('0x25')](handleEntityNotFound(_0x5d4e29,null))[_0x471a('0x25')](function(_0x396244){if(_0x396244){_0x1076ff[_0x471a('0x4e')][_0x471a('0x79')]=_0x396244['id'];_0x1076ff[_0x471a('0x4e')][_0x471a('0x5b')]=widgetAttributes(_0x1076ff[_0x471a('0x4e')]);return db[_0x471a('0x7a')]['create'](_0x1076ff['body']);}})[_0x471a('0x25')](respondWithResult(_0x5d4e29,null))[_0x471a('0x48')](handleError(_0x5d4e29,null));};exports['getItems']=function(_0x3bf329,_0x3deb4f,_0xf2f673){var _0x4f077a={};var _0x2adf51={};var _0x2b4614;var _0x784826;return db[_0x471a('0x2f')][_0x471a('0x7b')]({'where':{'id':_0x3bf329[_0x471a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3deb4f,null))[_0x471a('0x25')](function(_0x41d541){if(_0x41d541){_0x2b4614=_0x41d541;_0x2adf51[_0x471a('0x33')]=_[_0x471a('0x36')](db[_0x471a('0x7a')][_0x471a('0x4b')]);_0x2adf51[_0x471a('0x35')]=_[_0x471a('0x36')](_0x3bf329['query']);_0x2adf51[_0x471a('0x3d')]=_[_0x471a('0x37')](_0x2adf51[_0x471a('0x33')],_0x2adf51['query']);_0x4f077a['attributes']=_['intersection'](_0x2adf51[_0x471a('0x33')],qs[_0x471a('0x39')](_0x3bf329['query'][_0x471a('0x39')]));_0x4f077a['attributes']=_0x4f077a[_0x471a('0x38')]['length']?_0x4f077a[_0x471a('0x38')]:_0x2adf51[_0x471a('0x33')];_0x4f077a[_0x471a('0x7c')]=qs['sort'](_0x3bf329[_0x471a('0x35')][_0x471a('0x3c')]);_0x4f077a['where']=qs[_0x471a('0x3d')](_[_0x471a('0x3e')](_0x3bf329[_0x471a('0x35')],_0x2adf51[_0x471a('0x3d')]));if(_0x3bf329[_0x471a('0x35')][_0x471a('0x3f')]){_0x4f077a['where']=_[_0x471a('0x41')](_0x4f077a['where'],{'$or':_['map'](_0x4f077a[_0x471a('0x38')],function(_0x10606e){var _0x39bddc={};_0x39bddc[_0x10606e]={'$like':'%'+_0x3bf329[_0x471a('0x35')][_0x471a('0x3f')]+'%'};return _0x39bddc;})});}_0x4f077a=_['merge']({},_0x4f077a,_0x3bf329[_0x471a('0x43')]);return _0x2b4614[_0x471a('0x7d')](_0x4f077a);}})[_0x471a('0x25')](function(_0xf73b45){if(_0xf73b45){_0x784826=_0xf73b45[_0x471a('0x3a')];if(!_0x3bf329['query']['hasOwnProperty']('nolimit')){_0x4f077a[_0x471a('0x1f')]=qs[_0x471a('0x1f')](_0x3bf329[_0x471a('0x35')]['limit']);_0x4f077a[_0x471a('0x1d')]=qs['offset'](_0x3bf329[_0x471a('0x35')][_0x471a('0x1d')]);}return _0x2b4614[_0x471a('0x7d')](_0x4f077a);}})['then'](function(_0x41b109){if(_0x41b109){return _0x41b109?{'count':_0x784826,'rows':_0x41b109}:null;}})[_0x471a('0x25')](respondWithResult(_0x3deb4f,null))[_0x471a('0x48')](handleError(_0x3deb4f,null));}; \ No newline at end of file +var _0xbb11=['redis','defaults','socket.io-emitter','sendStatus','json','offset','undefined','limit','count','Content-Range','save','destroy','get','CustomDashboards','UserProfileResource','then','status','end','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','autoAssociation','update','iframe','attrUrl','attrs','https://','value','clock','attrTimezone','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','sort','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x791b75,_0x764053){var _0x51e3d6=function(_0xacf5df){while(--_0xacf5df){_0x791b75['push'](_0x791b75['shift']());}};_0x51e3d6(++_0x764053);}(_0xbb11,0x64));var _0x1bb1=function(_0x2a0b35,_0x287480){_0x2a0b35=_0x2a0b35-0x0;var _0x425aba=_0xbb11[_0x2a0b35];return _0x425aba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1bb1('0x0'));var zipdir=require(_0x1bb1('0x1'));var jsonpatch=require(_0x1bb1('0x2'));var rp=require(_0x1bb1('0x3'));var moment=require(_0x1bb1('0x4'));var BPromise=require(_0x1bb1('0x5'));var Mustache=require(_0x1bb1('0x6'));var util=require(_0x1bb1('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x1bb1('0x8'));var ejs=require(_0x1bb1('0x9'));var fs=require('fs');var fs_extra=require(_0x1bb1('0xa'));var _=require('lodash');var squel=require(_0x1bb1('0xb'));var crypto=require(_0x1bb1('0xc'));var jsforce=require(_0x1bb1('0xd'));var deskjs=require(_0x1bb1('0xe'));var toCsv=require(_0x1bb1('0x8'));var querystring=require(_0x1bb1('0xf'));var Papa=require(_0x1bb1('0x10'));var Redis=require('ioredis');var authService=require(_0x1bb1('0x11'));var qs=require(_0x1bb1('0x12'));var as=require(_0x1bb1('0x13'));var hardwareService=require(_0x1bb1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1bb1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1bb1('0x16'));var db=require(_0x1bb1('0x17'))['db'];config[_0x1bb1('0x18')]=_[_0x1bb1('0x19')](config[_0x1bb1('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1bb1('0x1a'))(new Redis(config[_0x1bb1('0x18')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x4dad5a,_0x3008b3){_0x3008b3=_0x3008b3||0xcc;return function(_0x2cffa0){if(_0x2cffa0){return _0x4dad5a[_0x1bb1('0x1b')](_0x3008b3);}return _0x4dad5a['status'](_0x3008b3)['end']();};}function respondWithResult(_0x2c9337,_0x349cc6){_0x349cc6=_0x349cc6||0xc8;return function(_0xb36c46){if(_0xb36c46){return _0x2c9337['status'](_0x349cc6)[_0x1bb1('0x1c')](_0xb36c46);}};}function respondWithFilteredResult(_0x973b94,_0x28378a){return function(_0x445102){if(_0x445102){var _0x484ae2=typeof _0x28378a[_0x1bb1('0x1d')]===_0x1bb1('0x1e')&&typeof _0x28378a[_0x1bb1('0x1f')]===_0x1bb1('0x1e');var _0xbf97f9=_0x445102[_0x1bb1('0x20')];var _0x2d0e77=_0x484ae2?0x0:_0x28378a['offset'];var _0x33ca29=_0x484ae2?_0x445102[_0x1bb1('0x20')]:_0x28378a[_0x1bb1('0x1d')]+_0x28378a[_0x1bb1('0x1f')];var _0x2ded2e;if(_0x33ca29>=_0xbf97f9){_0x33ca29=_0xbf97f9;_0x2ded2e=0xc8;}else{_0x2ded2e=0xce;}_0x973b94['status'](_0x2ded2e);return _0x973b94['set'](_0x1bb1('0x21'),_0x2d0e77+'-'+_0x33ca29+'/'+_0xbf97f9)['json'](_0x445102);}return null;};}function patchUpdates(_0x133bea){return function(_0x2c37c9){try{jsonpatch['apply'](_0x2c37c9,_0x133bea,!![]);}catch(_0x559532){return BPromise['reject'](_0x559532);}return _0x2c37c9[_0x1bb1('0x22')]();};}function saveUpdates(_0x33faef,_0x4382c7){return function(_0x4f0b74){if(_0x4f0b74){return _0x4f0b74['update'](_0x33faef)['then'](function(_0x5ea0d0){return _0x5ea0d0;});}return null;};}function removeEntity(_0x5662b3,_0x13adbb){return function(_0x15ac67){if(_0x15ac67){return _0x15ac67[_0x1bb1('0x23')]()['then'](function(){var _0x5d282d=_0x15ac67[_0x1bb1('0x24')]({'plain':!![]});var _0x3fd2f0=_0x1bb1('0x25');return db[_0x1bb1('0x26')][_0x1bb1('0x23')]({'where':{'type':_0x3fd2f0,'resourceId':_0x5d282d['id']}})['then'](function(){return _0x15ac67;});})[_0x1bb1('0x27')](function(){_0x5662b3[_0x1bb1('0x28')](0xcc)[_0x1bb1('0x29')]();});}};}function handleEntityNotFound(_0x389d79,_0x485213){return function(_0x20f3b4){if(!_0x20f3b4){_0x389d79[_0x1bb1('0x1b')](0x194);}return _0x20f3b4;};}function handleError(_0xf76f0b,_0x1190b2){_0x1190b2=_0x1190b2||0x1f4;return function(_0x59794c){logger['error'](_0x59794c[_0x1bb1('0x2a')]);if(_0x59794c['name']){delete _0x59794c[_0x1bb1('0x2b')];}_0xf76f0b['status'](_0x1190b2)[_0x1bb1('0x2c')](_0x59794c);};}exports[_0x1bb1('0x2d')]=function(_0xffdf4a,_0x47965e){var _0x38423e={},_0x17abf2={},_0x39c976={'count':0x0,'rows':[]};var _0x5eafc9=_[_0x1bb1('0x2e')](db[_0x1bb1('0x2f')][_0x1bb1('0x30')],function(_0x44a263){return{'name':_0x44a263[_0x1bb1('0x31')],'type':_0x44a263[_0x1bb1('0x32')]['key']};});_0x17abf2[_0x1bb1('0x33')]=_[_0x1bb1('0x2e')](_0x5eafc9,_0x1bb1('0x2b'));_0x17abf2[_0x1bb1('0x34')]=_[_0x1bb1('0x35')](_0xffdf4a['query']);_0x17abf2[_0x1bb1('0x36')]=_[_0x1bb1('0x37')](_0x17abf2[_0x1bb1('0x33')],_0x17abf2[_0x1bb1('0x34')]);_0x38423e[_0x1bb1('0x38')]=_['intersection'](_0x17abf2['model'],qs[_0x1bb1('0x39')](_0xffdf4a['query'][_0x1bb1('0x39')]));_0x38423e[_0x1bb1('0x38')]=_0x38423e[_0x1bb1('0x38')]['length']?_0x38423e[_0x1bb1('0x38')]:_0x17abf2[_0x1bb1('0x33')];if(!_0xffdf4a[_0x1bb1('0x34')]['hasOwnProperty'](_0x1bb1('0x3a'))){_0x38423e[_0x1bb1('0x1f')]=qs[_0x1bb1('0x1f')](_0xffdf4a[_0x1bb1('0x34')][_0x1bb1('0x1f')]);_0x38423e[_0x1bb1('0x1d')]=qs[_0x1bb1('0x1d')](_0xffdf4a[_0x1bb1('0x34')][_0x1bb1('0x1d')]);}_0x38423e[_0x1bb1('0x3b')]=qs['sort'](_0xffdf4a['query']['sort']);_0x38423e['where']=qs[_0x1bb1('0x36')](_[_0x1bb1('0x3c')](_0xffdf4a[_0x1bb1('0x34')],_0x17abf2[_0x1bb1('0x36')]),_0x5eafc9);if(_0xffdf4a[_0x1bb1('0x34')][_0x1bb1('0x3d')]){_0x38423e[_0x1bb1('0x3e')]=_[_0x1bb1('0x3f')](_0x38423e[_0x1bb1('0x3e')],{'$or':_[_0x1bb1('0x2e')](_0x5eafc9,function(_0x449e92){if(_0x449e92[_0x1bb1('0x32')]!==_0x1bb1('0x40')){var _0x2651fe={};_0x2651fe[_0x449e92[_0x1bb1('0x2b')]]={'$like':'%'+_0xffdf4a[_0x1bb1('0x34')][_0x1bb1('0x3d')]+'%'};return _0x2651fe;}})});}_0x38423e=_[_0x1bb1('0x3f')]({},_0x38423e,_0xffdf4a[_0x1bb1('0x41')]);var _0x5e2996={'where':_0x38423e['where']};return db[_0x1bb1('0x2f')]['count'](_0x5e2996)[_0x1bb1('0x27')](function(_0x3772c4){_0x39c976['count']=_0x3772c4;if(_0xffdf4a[_0x1bb1('0x34')][_0x1bb1('0x42')]){_0x38423e[_0x1bb1('0x43')]=[{'all':!![]}];}return db[_0x1bb1('0x2f')][_0x1bb1('0x44')](_0x38423e);})[_0x1bb1('0x27')](function(_0x46b5f8){_0x39c976[_0x1bb1('0x45')]=_0x46b5f8;return _0x39c976;})[_0x1bb1('0x27')](respondWithFilteredResult(_0x47965e,_0x38423e))[_0x1bb1('0x46')](handleError(_0x47965e,null));};exports[_0x1bb1('0x47')]=function(_0x278b13,_0x42b1fc){var _0x198866={'raw':![],'where':{'id':_0x278b13[_0x1bb1('0x48')]['id']}},_0x3337a3={};_0x3337a3[_0x1bb1('0x33')]=_[_0x1bb1('0x35')](db[_0x1bb1('0x2f')][_0x1bb1('0x30')]);_0x3337a3['query']=_[_0x1bb1('0x35')](_0x278b13[_0x1bb1('0x34')]);_0x3337a3['filters']=_['intersection'](_0x3337a3['model'],_0x3337a3[_0x1bb1('0x34')]);_0x198866[_0x1bb1('0x38')]=_['intersection'](_0x3337a3['model'],qs[_0x1bb1('0x39')](_0x278b13[_0x1bb1('0x34')][_0x1bb1('0x39')]));_0x198866[_0x1bb1('0x38')]=_0x198866[_0x1bb1('0x38')][_0x1bb1('0x49')]?_0x198866['attributes']:_0x3337a3[_0x1bb1('0x33')];if(_0x278b13[_0x1bb1('0x34')][_0x1bb1('0x42')]){_0x198866[_0x1bb1('0x43')]=[{'all':!![]}];}_0x198866=_[_0x1bb1('0x3f')]({},_0x198866,_0x278b13[_0x1bb1('0x41')]);return db[_0x1bb1('0x2f')][_0x1bb1('0x4a')](_0x198866)['then'](handleEntityNotFound(_0x42b1fc,null))[_0x1bb1('0x27')](respondWithResult(_0x42b1fc,null))['catch'](handleError(_0x42b1fc,null));};exports[_0x1bb1('0x4b')]=function(_0x365625,_0x5b0931){return db[_0x1bb1('0x2f')][_0x1bb1('0x4b')](_0x365625[_0x1bb1('0x4c')],{})[_0x1bb1('0x27')](function(_0x1ed1ec){var _0xae8612=_0x365625[_0x1bb1('0x4d')]['get']({'plain':!![]});if(!_0xae8612)throw new Error(_0x1bb1('0x4e'));if(_0xae8612[_0x1bb1('0x4f')]===_0x1bb1('0x4d')){var _0x40b0b6=_0x1ed1ec[_0x1bb1('0x24')]({'plain':!![]});var _0x3acd02=_0x1bb1('0x25');return db[_0x1bb1('0x50')][_0x1bb1('0x4a')]({'where':{'name':_0x3acd02,'userProfileId':_0xae8612[_0x1bb1('0x51')]},'raw':!![]})[_0x1bb1('0x27')](function(_0xa8ded1){if(_0xa8ded1&&_0xa8ded1['autoAssociation']===0x0){return db[_0x1bb1('0x26')]['create']({'name':_0x40b0b6['name'],'resourceId':_0x40b0b6['id'],'type':_0xa8ded1[_0x1bb1('0x2b')],'sectionId':_0xa8ded1['id']},{})['then'](function(){return _0x1ed1ec;});}else{return _0x1ed1ec;}})[_0x1bb1('0x46')](function(_0x21707a){logger[_0x1bb1('0x52')](_0x1bb1('0x53'),_0x21707a);throw _0x21707a;});}return _0x1ed1ec;})[_0x1bb1('0x27')](respondWithResult(_0x5b0931,0xc9))[_0x1bb1('0x46')](handleError(_0x5b0931,null));};exports[_0x1bb1('0x54')]=function(_0x429511,_0x302113){var _0x4233fc={'where':{'id':_0x429511['params']['id']}},_0x5af5f2={};_0x5af5f2[_0x1bb1('0x33')]=_[_0x1bb1('0x35')](db[_0x1bb1('0x2f')]['rawAttributes']);_0x4233fc['attributes']=_[_0x1bb1('0x37')](_0x5af5f2[_0x1bb1('0x33')],qs['fields'](_0x429511[_0x1bb1('0x34')][_0x1bb1('0x39')]));_0x4233fc[_0x1bb1('0x38')]=_0x4233fc[_0x1bb1('0x38')][_0x1bb1('0x49')]?_0x4233fc[_0x1bb1('0x38')]:_0x5af5f2[_0x1bb1('0x33')];if(_0x429511[_0x1bb1('0x34')][_0x1bb1('0x42')]){_0x4233fc['include']=[{'all':!![]}];}_0x4233fc=_[_0x1bb1('0x3f')]({},_0x4233fc,_0x429511[_0x1bb1('0x41')]);return db['Dashboard'][_0x1bb1('0x4a')](_0x4233fc)['then'](handleEntityNotFound(_0x302113,null))[_0x1bb1('0x27')](function(_0x848079){if(_0x848079){var _0x35c65e=_0x848079['get']({'plain':!![]});_0x35c65e=qs[_0x1bb1('0x55')](_0x35c65e,['id','createdAt',_0x1bb1('0x56')]);_0x429511[_0x1bb1('0x4c')]=_[_0x1bb1('0x55')](_0x429511[_0x1bb1('0x4c')],['id',_0x1bb1('0x57'),_0x1bb1('0x56')]);return db[_0x1bb1('0x2f')][_0x1bb1('0x4b')](_['merge'](_0x35c65e,_0x429511[_0x1bb1('0x4c')]),{'include':_0x429511[_0x1bb1('0x34')][_0x1bb1('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x1ed92e){var _0x411697=_0x429511[_0x1bb1('0x4d')][_0x1bb1('0x24')]({'plain':!![]});if(!_0x411697)throw new Error(_0x1bb1('0x4e'));if(_0x411697[_0x1bb1('0x4f')]===_0x1bb1('0x4d')){var _0x41b198=_0x1ed92e['get']({'plain':!![]});var _0x2166b7=_0x1bb1('0x25');return db[_0x1bb1('0x50')][_0x1bb1('0x4a')]({'where':{'name':_0x2166b7,'userProfileId':_0x411697[_0x1bb1('0x51')]},'raw':!![]})['then'](function(_0x1b19a3){if(_0x1b19a3&&_0x1b19a3[_0x1bb1('0x58')]===0x0){return db[_0x1bb1('0x26')][_0x1bb1('0x4b')]({'name':_0x41b198[_0x1bb1('0x2b')],'resourceId':_0x41b198['id'],'type':_0x1b19a3[_0x1bb1('0x2b')],'sectionId':_0x1b19a3['id']},{})['then'](function(){return _0x1ed92e;});}else{return _0x1ed92e;}})[_0x1bb1('0x46')](function(_0x4ce92f){logger[_0x1bb1('0x52')](_0x1bb1('0x53'),_0x4ce92f);throw _0x4ce92f;});}return _0x1ed92e;});}})[_0x1bb1('0x27')](respondWithResult(_0x302113,0xc9))[_0x1bb1('0x46')](handleError(_0x302113,null));};exports[_0x1bb1('0x59')]=function(_0x4009ab,_0x1b9dbf){if(_0x4009ab['body']['id']){delete _0x4009ab[_0x1bb1('0x4c')]['id'];}return db[_0x1bb1('0x2f')][_0x1bb1('0x4a')]({'where':{'id':_0x4009ab[_0x1bb1('0x48')]['id']}})[_0x1bb1('0x27')](handleEntityNotFound(_0x1b9dbf,null))[_0x1bb1('0x27')](saveUpdates(_0x4009ab[_0x1bb1('0x4c')],null))[_0x1bb1('0x27')](respondWithResult(_0x1b9dbf,null))[_0x1bb1('0x46')](handleError(_0x1b9dbf,null));};exports[_0x1bb1('0x23')]=function(_0x467ce1,_0x140971){return db[_0x1bb1('0x2f')][_0x1bb1('0x4a')]({'where':{'id':_0x467ce1[_0x1bb1('0x48')]['id']}})['then'](handleEntityNotFound(_0x140971,null))[_0x1bb1('0x27')](removeEntity(_0x140971,null))['catch'](handleError(_0x140971,null));};function widgetAttributes(_0x442d4a){try{switch(_0x442d4a[_0x1bb1('0x32')]){case _0x1bb1('0x5a'):return[{'name':_0x1bb1('0x5b'),'value':_0x442d4a[_0x1bb1('0x5b')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x0]?_0x442d4a[_0x1bb1('0x5c')][0x0]['value']:undefined)||_0x1bb1('0x5d')}];case'custom':return[{'name':'attrPath','value':_0x442d4a['attrPath']||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x0]?_0x442d4a[_0x1bb1('0x5c')][0x0][_0x1bb1('0x5e')]:undefined)||''}];case _0x1bb1('0x5f'):return[{'name':'attrHourFormat','value':_0x442d4a['attrHourFormat']||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x0]?_0x442d4a[_0x1bb1('0x5c')][0x0][_0x1bb1('0x5e')]:undefined)||'HH:mm:ss'},{'name':_0x1bb1('0x60'),'value':_0x442d4a[_0x1bb1('0x60')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x1]?_0x442d4a[_0x1bb1('0x5c')][0x1][_0x1bb1('0x5e')]:undefined)||'0.00'},{'name':_0x1bb1('0x61'),'value':_0x442d4a[_0x1bb1('0x61')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x2]?_0x442d4a[_0x1bb1('0x5c')][0x2][_0x1bb1('0x5e')]:undefined)||0xc}];case'counter':return[{'name':_0x1bb1('0x62'),'value':_0x442d4a[_0x1bb1('0x62')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a['attrs'][0x0]?_0x442d4a[_0x1bb1('0x5c')][0x0][_0x1bb1('0x5e')]:undefined)||'total'},{'name':_0x1bb1('0x63'),'value':_0x442d4a[_0x1bb1('0x63')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x1]?_0x442d4a[_0x1bb1('0x5c')][0x1]['value']:undefined)||[]},{'name':_0x1bb1('0x61'),'value':_0x442d4a['attrFontSize']||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x2]?_0x442d4a[_0x1bb1('0x5c')][0x2][_0x1bb1('0x5e')]:undefined)||0x14},{'name':_0x1bb1('0x64'),'value':_0x442d4a[_0x1bb1('0x64')]||(_0x442d4a['attrs']&&_0x442d4a['attrs'][0x3]?_0x442d4a['attrs'][0x3][_0x1bb1('0x5e')]:undefined)||_0x1bb1('0x65')},{'name':_0x1bb1('0x66'),'value':_0x442d4a[_0x1bb1('0x66')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x4]?_0x442d4a[_0x1bb1('0x5c')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x442d4a[_0x1bb1('0x67')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x5]?_0x442d4a[_0x1bb1('0x5c')][0x5][_0x1bb1('0x5e')]:undefined)||''},{'name':_0x1bb1('0x68'),'value':_0x442d4a[_0x1bb1('0x68')]||(_0x442d4a['attrs']&&_0x442d4a[_0x1bb1('0x5c')][0x6]?_0x442d4a[_0x1bb1('0x5c')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x442d4a[_0x1bb1('0x69')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x7]?_0x442d4a[_0x1bb1('0x5c')][0x7][_0x1bb1('0x5e')]:undefined)||''},{'name':_0x1bb1('0x6a'),'value':_0x442d4a[_0x1bb1('0x6a')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a['attrs'][0x8]?_0x442d4a['attrs'][0x8][_0x1bb1('0x5e')]:undefined)||''},{'name':_0x1bb1('0x6b'),'value':_0x442d4a[_0x1bb1('0x6b')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x9]?_0x442d4a[_0x1bb1('0x5c')][0x9][_0x1bb1('0x5e')]:undefined)||''}];case _0x1bb1('0x6c'):case'pie-chart':return[{'name':_0x1bb1('0x6d'),'value':_0x442d4a[_0x1bb1('0x6d')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x0]?_0x442d4a[_0x1bb1('0x5c')][0x0]['value']:undefined)||_0x1bb1('0x6e')},{'name':'attrSerie2','value':_0x442d4a[_0x1bb1('0x6f')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x1]?_0x442d4a[_0x1bb1('0x5c')][0x1][_0x1bb1('0x5e')]:undefined)||null},{'name':'attrSerie3','value':_0x442d4a[_0x1bb1('0x70')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a['attrs'][0x2]?_0x442d4a[_0x1bb1('0x5c')][0x2][_0x1bb1('0x5e')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x442d4a['attrVoiceQueues']||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x3]?_0x442d4a[_0x1bb1('0x5c')][0x3][_0x1bb1('0x5e')]:undefined)||[]},{'name':_0x1bb1('0x64'),'value':_0x442d4a['attrChannel']||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a['attrs'][0x4]?_0x442d4a[_0x1bb1('0x5c')][0x4][_0x1bb1('0x5e')]:undefined)||_0x1bb1('0x65')},{'name':_0x1bb1('0x66'),'value':_0x442d4a[_0x1bb1('0x66')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x5]?_0x442d4a[_0x1bb1('0x5c')][0x5][_0x1bb1('0x5e')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x442d4a['attrFaxAccounts']||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x6]?_0x442d4a[_0x1bb1('0x5c')][0x6][_0x1bb1('0x5e')]:undefined)||''},{'name':_0x1bb1('0x68'),'value':_0x442d4a[_0x1bb1('0x68')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x7]?_0x442d4a['attrs'][0x7]['value']:undefined)||''},{'name':_0x1bb1('0x69'),'value':_0x442d4a[_0x1bb1('0x69')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x8]?_0x442d4a[_0x1bb1('0x5c')][0x8][_0x1bb1('0x5e')]:undefined)||''},{'name':_0x1bb1('0x6a'),'value':_0x442d4a['attrWhatsappAccounts']||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x9]?_0x442d4a[_0x1bb1('0x5c')][0x9][_0x1bb1('0x5e')]:undefined)||''},{'name':_0x1bb1('0x6b'),'value':_0x442d4a[_0x1bb1('0x6b')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0xa]?_0x442d4a[_0x1bb1('0x5c')][0xa][_0x1bb1('0x5e')]:undefined)||''}];case _0x1bb1('0x71'):return[{'name':'attrReport','type':_0x442d4a[_0x1bb1('0x72')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x0]?_0x442d4a[_0x1bb1('0x5c')][0x0][_0x1bb1('0x32')]:undefined)||null,'value':_0x442d4a['attrReport']||(_0x442d4a['attrs']&&_0x442d4a[_0x1bb1('0x5c')][0x0]?_0x442d4a['attrs'][0x0]['value']:undefined)||null},{'name':_0x1bb1('0x73'),'value':_0x442d4a[_0x1bb1('0x73')]||(_0x442d4a[_0x1bb1('0x5c')]&&_0x442d4a[_0x1bb1('0x5c')][0x1]?_0x442d4a[_0x1bb1('0x5c')][0x1][_0x1bb1('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x5c402c){logger['error']('widgetAttributes:\x20%s',JSON[_0x1bb1('0x74')](_0x5c402c));return[];}}exports[_0x1bb1('0x75')]=function(_0x3757b9,_0x17422e,_0x2ecfac){if(_0x3757b9[_0x1bb1('0x4c')]['id']){delete _0x3757b9[_0x1bb1('0x4c')]['id'];}return db[_0x1bb1('0x2f')][_0x1bb1('0x4a')]({'where':{'id':_0x3757b9[_0x1bb1('0x48')]['id']}})[_0x1bb1('0x27')](handleEntityNotFound(_0x17422e,null))[_0x1bb1('0x27')](function(_0x41f4a7){if(_0x41f4a7){_0x3757b9['body'][_0x1bb1('0x76')]=_0x41f4a7['id'];_0x3757b9[_0x1bb1('0x4c')][_0x1bb1('0x5c')]=widgetAttributes(_0x3757b9[_0x1bb1('0x4c')]);return db['DashboardItem']['create'](_0x3757b9[_0x1bb1('0x4c')]);}})[_0x1bb1('0x27')](respondWithResult(_0x17422e,null))[_0x1bb1('0x46')](handleError(_0x17422e,null));};exports[_0x1bb1('0x77')]=function(_0x489bad,_0x125586,_0x429752){var _0x2f9711={};var _0x37ec2={};var _0x109313;var _0x3ede59;return db['Dashboard'][_0x1bb1('0x78')]({'where':{'id':_0x489bad[_0x1bb1('0x48')]['id']}})['then'](handleEntityNotFound(_0x125586,null))[_0x1bb1('0x27')](function(_0xc9af0c){if(_0xc9af0c){_0x109313=_0xc9af0c;_0x37ec2[_0x1bb1('0x33')]=_[_0x1bb1('0x35')](db[_0x1bb1('0x79')]['rawAttributes']);_0x37ec2[_0x1bb1('0x34')]=_['keys'](_0x489bad[_0x1bb1('0x34')]);_0x37ec2[_0x1bb1('0x36')]=_[_0x1bb1('0x37')](_0x37ec2[_0x1bb1('0x33')],_0x37ec2['query']);_0x2f9711[_0x1bb1('0x38')]=_['intersection'](_0x37ec2[_0x1bb1('0x33')],qs[_0x1bb1('0x39')](_0x489bad[_0x1bb1('0x34')][_0x1bb1('0x39')]));_0x2f9711[_0x1bb1('0x38')]=_0x2f9711[_0x1bb1('0x38')][_0x1bb1('0x49')]?_0x2f9711[_0x1bb1('0x38')]:_0x37ec2[_0x1bb1('0x33')];_0x2f9711[_0x1bb1('0x3b')]=qs[_0x1bb1('0x7a')](_0x489bad[_0x1bb1('0x34')][_0x1bb1('0x7a')]);_0x2f9711[_0x1bb1('0x3e')]=qs[_0x1bb1('0x36')](_[_0x1bb1('0x3c')](_0x489bad[_0x1bb1('0x34')],_0x37ec2[_0x1bb1('0x36')]));if(_0x489bad[_0x1bb1('0x34')][_0x1bb1('0x3d')]){_0x2f9711[_0x1bb1('0x3e')]=_['merge'](_0x2f9711[_0x1bb1('0x3e')],{'$or':_['map'](_0x2f9711[_0x1bb1('0x38')],function(_0x59f5df){var _0x2408c2={};_0x2408c2[_0x59f5df]={'$like':'%'+_0x489bad[_0x1bb1('0x34')][_0x1bb1('0x3d')]+'%'};return _0x2408c2;})});}_0x2f9711=_[_0x1bb1('0x3f')]({},_0x2f9711,_0x489bad[_0x1bb1('0x41')]);return _0x109313[_0x1bb1('0x77')](_0x2f9711);}})[_0x1bb1('0x27')](function(_0x2a7178){if(_0x2a7178){_0x3ede59=_0x2a7178[_0x1bb1('0x49')];if(!_0x489bad[_0x1bb1('0x34')][_0x1bb1('0x7b')]('nolimit')){_0x2f9711[_0x1bb1('0x1f')]=qs[_0x1bb1('0x1f')](_0x489bad['query'][_0x1bb1('0x1f')]);_0x2f9711[_0x1bb1('0x1d')]=qs[_0x1bb1('0x1d')](_0x489bad[_0x1bb1('0x34')][_0x1bb1('0x1d')]);}return _0x109313[_0x1bb1('0x77')](_0x2f9711);}})['then'](function(_0x1471f7){if(_0x1471f7){return _0x1471f7?{'count':_0x3ede59,'rows':_0x1471f7}:null;}})[_0x1bb1('0x27')](respondWithResult(_0x125586,null))[_0x1bb1('0x46')](handleError(_0x125586,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 1801248..989e2b0 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 _0x007d=['hasOwnProperty','hook','exports','../../mysqldb','Dashboard','setMaxListeners','save','remove','emit'];(function(_0x58dd22,_0x13c07d){var _0x3dd1da=function(_0x330115){while(--_0x330115){_0x58dd22['push'](_0x58dd22['shift']());}};_0x3dd1da(++_0x13c07d);}(_0x007d,0xff));var _0xd007=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x007d[_0x57b54c];return _0x59cc19;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xd007('0x0'))['db'][_0xd007('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd007('0x2')](0x0);var events={'afterCreate':_0xd007('0x3'),'afterUpdate':'update','afterDestroy':_0xd007('0x4')};function emitEvent(_0x3ca797){return function(_0xd29a1,_0x3cb5e8,_0x7e6b8d){DashboardEvents[_0xd007('0x5')](_0x3ca797+':'+_0xd29a1['id'],_0xd29a1);DashboardEvents[_0xd007('0x5')](_0x3ca797,_0xd29a1);_0x7e6b8d(null);};}for(var e in events){if(events[_0xd007('0x6')](e)){var event=events[e];Dashboard[_0xd007('0x7')](e,emitEvent(event));}}module[_0xd007('0x8')]=DashboardEvents; \ No newline at end of file +var _0xa98b=['emit','hasOwnProperty','hook','exports','events','Dashboard','setMaxListeners','save','update','remove'];(function(_0x4ef7e2,_0x257e37){var _0x84fa8=function(_0x2c967b){while(--_0x2c967b){_0x4ef7e2['push'](_0x4ef7e2['shift']());}};_0x84fa8(++_0x257e37);}(_0xa98b,0x158));var _0xba98=function(_0x542196,_0x173d58){_0x542196=_0x542196-0x0;var _0xe83001=_0xa98b[_0x542196];return _0xe83001;};'use strict';var EventEmitter=require(_0xba98('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xba98('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xba98('0x2')](0x0);var events={'afterCreate':_0xba98('0x3'),'afterUpdate':_0xba98('0x4'),'afterDestroy':_0xba98('0x5')};function emitEvent(_0x46b881){return function(_0x150e17,_0x59ecbf,_0x290bff){DashboardEvents[_0xba98('0x6')](_0x46b881+':'+_0x150e17['id'],_0x150e17);DashboardEvents[_0xba98('0x6')](_0x46b881,_0x150e17);_0x290bff(null);};}for(var e in events){if(events[_0xba98('0x7')](e)){var event=events[e];Dashboard[_0xba98('0x8')](e,emitEvent(event));}}module[_0xba98('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 1e7abbd..79a61ec 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 _0xa508=['dashboards','lodash','util','api','moment','path','rimraf','../../config/environment','exports','Dashboard'];(function(_0x533e4e,_0x4eba54){var _0x1f14bb=function(_0x33a485){while(--_0x33a485){_0x533e4e['push'](_0x533e4e['shift']());}};_0x1f14bb(++_0x4eba54);}(_0xa508,0x187));var _0x8a50=function(_0x4a6c46,_0x25a939){_0x4a6c46=_0x4a6c46-0x0;var _0x41a676=_0xa508[_0x4a6c46];return _0x41a676;};'use strict';var _=require(_0x8a50('0x0'));var util=require(_0x8a50('0x1'));var logger=require('../../config/logger')(_0x8a50('0x2'));var moment=require(_0x8a50('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a50('0x4'));var rimraf=require(_0x8a50('0x5'));var config=require(_0x8a50('0x6'));var attributes=require('./dashboard.attributes');module[_0x8a50('0x7')]=function(_0x297214,_0x47d62f){return _0x297214['define'](_0x8a50('0x8'),attributes,{'tableName':_0x8a50('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a7f=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Dashboard','dashboards'];(function(_0x3f4c75,_0x36af7b){var _0x36096f=function(_0x62fa3){while(--_0x62fa3){_0x3f4c75['push'](_0x3f4c75['shift']());}};_0x36096f(++_0x36af7b);}(_0x0a7f,0xe6));var _0xf0a7=function(_0x63b6d3,_0x13c87d){_0x63b6d3=_0x63b6d3-0x0;var _0x41a70c=_0x0a7f[_0x63b6d3];return _0x41a70c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf0a7('0x0'))('api');var moment=require(_0xf0a7('0x1'));var BPromise=require(_0xf0a7('0x2'));var rp=require(_0xf0a7('0x3'));var fs=require('fs');var path=require(_0xf0a7('0x4'));var rimraf=require(_0xf0a7('0x5'));var config=require(_0xf0a7('0x6'));var attributes=require('./dashboard.attributes');module[_0xf0a7('0x7')]=function(_0x191298,_0x501ef2){return _0x191298['define'](_0xf0a7('0x8'),attributes,{'tableName':_0xf0a7('0x9'),'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 7fc2f8b..56f9fb1 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 _0x1749=['randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x1749,0xfa));var _0x9174=function(_0x4ef5a4,_0x209764){_0x4ef5a4=_0x4ef5a4-0x0;var _0x1fae06=_0x1749[_0x4ef5a4];return _0x1fae06;};'use strict';var _=require(_0x9174('0x0'));var util=require(_0x9174('0x1'));var moment=require('moment');var BPromise=require(_0x9174('0x2'));var rs=require(_0x9174('0x3'));var fs=require('fs');var Redis=require(_0x9174('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9174('0x5'));var config=require(_0x9174('0x6'));var jayson=require(_0x9174('0x7'));var client=jayson[_0x9174('0x8')]['http']({'port':0x232a});config['redis']=_[_0x9174('0x9')](config[_0x9174('0xa')],{'host':_0x9174('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9174('0xa')]));require(_0x9174('0xc'))['register'](socket);function respondWithRpcPromise(_0x5e3b34,_0x4047b4,_0x420aa4){return new BPromise(function(_0x51c587,_0x22a0b3){return client[_0x9174('0xd')](_0x5e3b34,_0x420aa4)[_0x9174('0xe')](function(_0x3c35da){logger[_0x9174('0xf')](_0x9174('0x10'),_0x4047b4,_0x9174('0x11'));logger['debug'](_0x9174('0x12'),_0x4047b4,_0x9174('0x11'),JSON['stringify'](_0x3c35da));if(_0x3c35da['error']){if(_0x3c35da[_0x9174('0x13')]['code']===0x1f4){logger[_0x9174('0x13')]('Dashboard,\x20%s,\x20%s',_0x4047b4,_0x3c35da[_0x9174('0x13')]['message']);return _0x22a0b3(_0x3c35da[_0x9174('0x13')][_0x9174('0x14')]);}logger[_0x9174('0x13')]('Dashboard,\x20%s,\x20%s',_0x4047b4,_0x3c35da['error'][_0x9174('0x14')]);return _0x51c587(_0x3c35da[_0x9174('0x13')][_0x9174('0x14')]);}else{logger[_0x9174('0xf')]('Dashboard,\x20%s,\x20%s',_0x4047b4,_0x9174('0x11'));_0x51c587(_0x3c35da[_0x9174('0x15')][_0x9174('0x14')]);}})[_0x9174('0x16')](function(_0x1eeb61){logger[_0x9174('0x13')](_0x9174('0x10'),_0x4047b4,_0x1eeb61);_0x22a0b3(_0x1eeb61);});});} \ No newline at end of file +var _0xf2c0=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xf2c0,0x186));var _0x0f2c=function(_0x335db8,_0x2d0dc2){_0x335db8=_0x335db8-0x0;var _0x224b29=_0xf2c0[_0x335db8];return _0x224b29;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0f2c('0x0'));var BPromise=require(_0x0f2c('0x1'));var rs=require(_0x0f2c('0x2'));var fs=require('fs');var Redis=require(_0x0f2c('0x3'));var db=require(_0x0f2c('0x4'))['db'];var utils=require(_0x0f2c('0x5'));var logger=require(_0x0f2c('0x6'))(_0x0f2c('0x7'));var config=require(_0x0f2c('0x8'));var jayson=require(_0x0f2c('0x9'));var client=jayson[_0x0f2c('0xa')][_0x0f2c('0xb')]({'port':0x232a});config[_0x0f2c('0xc')]=_[_0x0f2c('0xd')](config[_0x0f2c('0xc')],{'host':_0x0f2c('0xe'),'port':0x18eb});var socket=require(_0x0f2c('0xf'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x3a9f4c,_0x1339db,_0x56c336){return new BPromise(function(_0x1e2989,_0x162094){return client['request'](_0x3a9f4c,_0x56c336)[_0x0f2c('0x10')](function(_0x4e14ac){logger[_0x0f2c('0x11')](_0x0f2c('0x12'),_0x1339db,_0x0f2c('0x13'));logger[_0x0f2c('0x14')](_0x0f2c('0x15'),_0x1339db,_0x0f2c('0x13'),JSON[_0x0f2c('0x16')](_0x4e14ac));if(_0x4e14ac[_0x0f2c('0x17')]){if(_0x4e14ac['error'][_0x0f2c('0x18')]===0x1f4){logger[_0x0f2c('0x17')](_0x0f2c('0x12'),_0x1339db,_0x4e14ac[_0x0f2c('0x17')][_0x0f2c('0x19')]);return _0x162094(_0x4e14ac[_0x0f2c('0x17')][_0x0f2c('0x19')]);}logger[_0x0f2c('0x17')](_0x0f2c('0x12'),_0x1339db,_0x4e14ac['error']['message']);return _0x1e2989(_0x4e14ac[_0x0f2c('0x17')][_0x0f2c('0x19')]);}else{logger[_0x0f2c('0x11')](_0x0f2c('0x12'),_0x1339db,_0x0f2c('0x13'));_0x1e2989(_0x4e14ac[_0x0f2c('0x1a')][_0x0f2c('0x19')]);}})[_0x0f2c('0x1b')](function(_0x51b137){logger[_0x0f2c('0x17')](_0x0f2c('0x12'),_0x1339db,_0x51b137);_0x162094(_0x51b137);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 3f5e03a..582dacf 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 _0x9f4e=['dashboard:','./dashboard.events','save','update','emit','register','length'];(function(_0x2a31f5,_0x382ae0){var _0x2a04ab=function(_0x704aea){while(--_0x704aea){_0x2a31f5['push'](_0x2a31f5['shift']());}};_0x2a04ab(++_0x382ae0);}(_0x9f4e,0x1ac));var _0xe9f4=function(_0x5bfb78,_0x22e3ff){_0x5bfb78=_0x5bfb78-0x0;var _0x4efd00=_0x9f4e[_0x5bfb78];return _0x4efd00;};'use strict';var DashboardEvents=require(_0xe9f4('0x0'));var events=[_0xe9f4('0x1'),'remove',_0xe9f4('0x2')];function createListener(_0xadf154,_0x59fa9a){return function(_0x12cc21){_0x59fa9a[_0xe9f4('0x3')](_0xadf154,_0x12cc21);};}function removeListener(_0x5791c1,_0x349ac6){return function(){DashboardEvents['removeListener'](_0x5791c1,_0x349ac6);};}exports[_0xe9f4('0x4')]=function(_0x2612ef){for(var _0x8135e=0x0,_0x2d0a59=events[_0xe9f4('0x5')];_0x8135e<_0x2d0a59;_0x8135e++){var _0x490e2e=events[_0x8135e];var _0x550ffd=createListener(_0xe9f4('0x6')+_0x490e2e,_0x2612ef);DashboardEvents['on'](_0x490e2e,_0x550ffd);}}; \ No newline at end of file +var _0x60f7=['save','remove','emit','removeListener','register','length','dashboard:','./dashboard.events'];(function(_0x166781,_0x5436fe){var _0x322be6=function(_0x26b7a6){while(--_0x26b7a6){_0x166781['push'](_0x166781['shift']());}};_0x322be6(++_0x5436fe);}(_0x60f7,0x1cf));var _0x760f=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x60f7[_0x4c12ec];return _0x3ae42c;};'use strict';var DashboardEvents=require(_0x760f('0x0'));var events=[_0x760f('0x1'),_0x760f('0x2'),'update'];function createListener(_0x44eeb4,_0x20fa42){return function(_0x5b19a1){_0x20fa42[_0x760f('0x3')](_0x44eeb4,_0x5b19a1);};}function removeListener(_0x120537,_0x74059e){return function(){DashboardEvents[_0x760f('0x4')](_0x120537,_0x74059e);};}exports[_0x760f('0x5')]=function(_0x4a300d){for(var _0x3ddedd=0x0,_0x24c927=events[_0x760f('0x6')];_0x3ddedd<_0x24c927;_0x3ddedd++){var _0x345d46=events[_0x3ddedd];var _0x12ace1=createListener(_0x760f('0x7')+_0x345d46,_0x4a300d);DashboardEvents['on'](_0x345d46,_0x12ace1);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index f4a48b1..d264516 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 _0x4d87=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','isAuthenticated','get','/:id','show','getItems','post','clone','/:id/items','addItem','put','update','delete'];(function(_0x3697e7,_0x29659f){var _0x2c313a=function(_0x336402){while(--_0x336402){_0x3697e7['push'](_0x3697e7['shift']());}};_0x2c313a(++_0x29659f);}(_0x4d87,0x161));var _0x74d8=function(_0x542c94,_0x1c3319){_0x542c94=_0x542c94-0x0;var _0x92adf3=_0x4d87[_0x542c94];return _0x92adf3;};'use strict';var multer=require('multer');var util=require(_0x74d8('0x0'));var path=require(_0x74d8('0x1'));var timeout=require(_0x74d8('0x2'));var express=require(_0x74d8('0x3'));var router=express[_0x74d8('0x4')]();var fs_extra=require(_0x74d8('0x5'));var auth=require(_0x74d8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x74d8('0x7'));var controller=require(_0x74d8('0x8'));router['get']('/',auth[_0x74d8('0x9')](),controller['index']);router[_0x74d8('0xa')](_0x74d8('0xb'),auth['isAuthenticated'](),controller[_0x74d8('0xc')]);router[_0x74d8('0xa')]('/:id/items',auth[_0x74d8('0x9')](),controller[_0x74d8('0xd')]);router[_0x74d8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/clone',auth[_0x74d8('0x9')](),controller[_0x74d8('0xf')]);router[_0x74d8('0xe')](_0x74d8('0x10'),auth[_0x74d8('0x9')](),controller[_0x74d8('0x11')]);router[_0x74d8('0x12')](_0x74d8('0xb'),auth[_0x74d8('0x9')](),controller[_0x74d8('0x13')]);router[_0x74d8('0x14')](_0x74d8('0xb'),auth[_0x74d8('0x9')](),controller[_0x74d8('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5da0=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','/:id/items','put','update','destroy','exports','multer'];(function(_0x198127,_0x536320){var _0x822398=function(_0x55aa02){while(--_0x55aa02){_0x198127['push'](_0x198127['shift']());}};_0x822398(++_0x536320);}(_0x5da0,0x83));var _0x05da=function(_0x23aefd,_0x59c912){_0x23aefd=_0x23aefd-0x0;var _0x3d535c=_0x5da0[_0x23aefd];return _0x3d535c;};'use strict';var multer=require(_0x05da('0x0'));var util=require(_0x05da('0x1'));var path=require(_0x05da('0x2'));var timeout=require(_0x05da('0x3'));var express=require(_0x05da('0x4'));var router=express['Router']();var fs_extra=require(_0x05da('0x5'));var auth=require(_0x05da('0x6'));var interaction=require(_0x05da('0x7'));var config=require(_0x05da('0x8'));var controller=require(_0x05da('0x9'));router[_0x05da('0xa')]('/',auth[_0x05da('0xb')](),controller[_0x05da('0xc')]);router['get'](_0x05da('0xd'),auth['isAuthenticated'](),controller[_0x05da('0xe')]);router[_0x05da('0xa')]('/:id/items',auth[_0x05da('0xb')](),controller['getItems']);router[_0x05da('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x05da('0xf')](_0x05da('0x10'),auth[_0x05da('0xb')](),controller['clone']);router[_0x05da('0xf')](_0x05da('0x11'),auth['isAuthenticated'](),controller['addItem']);router[_0x05da('0x12')](_0x05da('0xd'),auth[_0x05da('0xb')](),controller[_0x05da('0x13')]);router['delete'](_0x05da('0xd'),auth[_0x05da('0xb')](),controller[_0x05da('0x14')]);module[_0x05da('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 59e6dcd..2aeaaf4 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 _0x187d=['stringify','INTEGER','#ffffff','sequelize','lodash','exports','STRING','TEXT','long','getDataValue','attrs','setDataValue'];(function(_0x858cf9,_0x95a863){var _0xc8d6c4=function(_0x1ad60d){while(--_0x1ad60d){_0x858cf9['push'](_0x858cf9['shift']());}};_0xc8d6c4(++_0x95a863);}(_0x187d,0x93));var _0xd187=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x187d[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require(_0xd187('0x0'));var squel=require('squel');var _=require(_0xd187('0x1'));module[_0xd187('0x2')]={'title':{'type':Sequelize[_0xd187('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd187('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xd187('0x4')](_0xd187('0x5')),'get':function(){try{return JSON['parse'](this[_0xd187('0x6')](_0xd187('0x7')));}catch(_0x4ebc8d){return[];}},'set':function(_0x1d2533){try{this[_0xd187('0x8')](_0xd187('0x7'),JSON[_0xd187('0x9')](_0x1d2533));}catch(_0x28ce2f){this[_0xd187('0x8')](_0xd187('0x7'),JSON[_0xd187('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xd187('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd187('0xa')]},'col':{'type':Sequelize[_0xd187('0xa')]},'background':{'type':Sequelize[_0xd187('0x3')],'allowNull':![],'defaultValue':_0xd187('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xd187('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd187('0x3')]},'titleFontSize':{'type':Sequelize[_0xd187('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x01d9=['INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x901d('0x0'));var squel=require(_0x901d('0x1'));var _=require(_0x901d('0x2'));module[_0x901d('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x901d('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x901d('0x5')](_0x901d('0x6')),'get':function(){try{return JSON[_0x901d('0x7')](this[_0x901d('0x8')](_0x901d('0x9')));}catch(_0xb96b86){return[];}},'set':function(_0x4e7842){try{this[_0x901d('0xa')](_0x901d('0x9'),JSON[_0x901d('0xb')](_0x4e7842));}catch(_0x12c39f){this[_0x901d('0xa')](_0x901d('0x9'),JSON[_0x901d('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0x901d('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x901d('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x901d('0xc')]},'col':{'type':Sequelize[_0x901d('0xc')]},'background':{'type':Sequelize[_0x901d('0x4')],'allowNull':![],'defaultValue':_0x901d('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x901d('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x901d('0xc')],'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 1a246b5..760c184 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 _0x872a=['destroy','error','name','send','params','keys','DashboardItem','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','catch','type','attrUrl','attrs','value','custom','attrPath','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','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','body','create','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x872a,0x100));var _0xa872=function(_0x1011d6,_0x373e4c){_0x1011d6=_0x1011d6-0x0;var _0x51a88e=_0x872a[_0x1011d6];return _0x51a88e;};'use strict';var emlformat=require(_0xa872('0x0'));var rimraf=require(_0xa872('0x1'));var zipdir=require(_0xa872('0x2'));var jsonpatch=require(_0xa872('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa872('0x4'));var util=require(_0xa872('0x5'));var path=require(_0xa872('0x6'));var sox=require(_0xa872('0x7'));var csv=require(_0xa872('0x8'));var ejs=require(_0xa872('0x9'));var fs=require('fs');var fs_extra=require(_0xa872('0xa'));var _=require('lodash');var squel=require(_0xa872('0xb'));var crypto=require(_0xa872('0xc'));var jsforce=require(_0xa872('0xd'));var deskjs=require(_0xa872('0xe'));var toCsv=require(_0xa872('0x8'));var querystring=require(_0xa872('0xf'));var Papa=require(_0xa872('0x10'));var Redis=require(_0xa872('0x11'));var authService=require(_0xa872('0x12'));var qs=require(_0xa872('0x13'));var as=require(_0xa872('0x14'));var hardwareService=require(_0xa872('0x15'));var logger=require(_0xa872('0x16'))(_0xa872('0x17'));var utils=require('../../config/utils');var config=require(_0xa872('0x18'));var licenseUtil=require(_0xa872('0x19'));var db=require(_0xa872('0x1a'))['db'];config['redis']=_[_0xa872('0x1b')](config[_0xa872('0x1c')],{'host':_0xa872('0x1d'),'port':0x18eb});var socket=require(_0xa872('0x1e'))(new Redis(config[_0xa872('0x1c')]));require('./dashboardItem.socket')[_0xa872('0x1f')](socket);function respondWithStatusCode(_0x5cd621,_0x3f1bd6){_0x3f1bd6=_0x3f1bd6||0xcc;return function(_0x2cb82e){if(_0x2cb82e){return _0x5cd621[_0xa872('0x20')](_0x3f1bd6);}return _0x5cd621[_0xa872('0x21')](_0x3f1bd6)['end']();};}function respondWithResult(_0x2619b1,_0xb8c0a2){_0xb8c0a2=_0xb8c0a2||0xc8;return function(_0x54a74e){if(_0x54a74e){return _0x2619b1[_0xa872('0x21')](_0xb8c0a2)[_0xa872('0x22')](_0x54a74e);}};}function respondWithFilteredResult(_0x3f5dc6,_0x5d68e4){return function(_0xa61ab3){if(_0xa61ab3){var _0x377107=typeof _0x5d68e4[_0xa872('0x23')]===_0xa872('0x24')&&typeof _0x5d68e4[_0xa872('0x25')]==='undefined';var _0x26cc07=_0xa61ab3['count'];var _0x28adef=_0x377107?0x0:_0x5d68e4['offset'];var _0x382146=_0x377107?_0xa61ab3['count']:_0x5d68e4[_0xa872('0x23')]+_0x5d68e4['limit'];var _0xe589b5;if(_0x382146>=_0x26cc07){_0x382146=_0x26cc07;_0xe589b5=0xc8;}else{_0xe589b5=0xce;}_0x3f5dc6[_0xa872('0x21')](_0xe589b5);return _0x3f5dc6['set'](_0xa872('0x26'),_0x28adef+'-'+_0x382146+'/'+_0x26cc07)[_0xa872('0x22')](_0xa61ab3);}return null;};}function patchUpdates(_0x5ad012){return function(_0x346466){try{jsonpatch[_0xa872('0x27')](_0x346466,_0x5ad012,!![]);}catch(_0x1b24f7){return BPromise[_0xa872('0x28')](_0x1b24f7);}return _0x346466[_0xa872('0x29')]();};}function saveUpdates(_0x28db80,_0x24c301){return function(_0x562988){if(_0x562988){return _0x562988[_0xa872('0x2a')](_0x28db80)[_0xa872('0x2b')](function(_0x28876a){return _0x28876a;});}return null;};}function removeEntity(_0x180dfb,_0x2cc427){return function(_0x2024ac){if(_0x2024ac){return _0x2024ac[_0xa872('0x2c')]()['then'](function(){_0x180dfb[_0xa872('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dd475,_0x4053c0){return function(_0x1e24c7){if(!_0x1e24c7){_0x1dd475['sendStatus'](0x194);}return _0x1e24c7;};}function handleError(_0x149f8d,_0x7c7f13){_0x7c7f13=_0x7c7f13||0x1f4;return function(_0x25322d){logger[_0xa872('0x2d')](_0x25322d['stack']);if(_0x25322d[_0xa872('0x2e')]){delete _0x25322d['name'];}_0x149f8d['status'](_0x7c7f13)[_0xa872('0x2f')](_0x25322d);};}exports['show']=function(_0x215a61,_0x408bdf){var _0x45131d={'raw':![],'where':{'id':_0x215a61[_0xa872('0x30')]['id']}},_0x252831={};_0x252831['model']=_[_0xa872('0x31')](db[_0xa872('0x32')][_0xa872('0x33')]);_0x252831['query']=_[_0xa872('0x31')](_0x215a61[_0xa872('0x34')]);_0x252831[_0xa872('0x35')]=_[_0xa872('0x36')](_0x252831[_0xa872('0x37')],_0x252831[_0xa872('0x34')]);_0x45131d['attributes']=_[_0xa872('0x36')](_0x252831[_0xa872('0x37')],qs[_0xa872('0x38')](_0x215a61[_0xa872('0x34')]['fields']));_0x45131d[_0xa872('0x39')]=_0x45131d[_0xa872('0x39')][_0xa872('0x3a')]?_0x45131d[_0xa872('0x39')]:_0x252831[_0xa872('0x37')];if(_0x215a61[_0xa872('0x34')][_0xa872('0x3b')]){_0x45131d[_0xa872('0x3c')]=[{'all':!![]}];}_0x45131d=_[_0xa872('0x3d')]({},_0x45131d,_0x215a61[_0xa872('0x3e')]);return db[_0xa872('0x32')][_0xa872('0x3f')](_0x45131d)[_0xa872('0x2b')](handleEntityNotFound(_0x408bdf,null))[_0xa872('0x2b')](respondWithResult(_0x408bdf,null))[_0xa872('0x40')](handleError(_0x408bdf,null));};exports[_0xa872('0x2c')]=function(_0x2dfaff,_0x1e0d39){return db[_0xa872('0x32')]['find']({'where':{'id':_0x2dfaff['params']['id']}})['then'](handleEntityNotFound(_0x1e0d39,null))['then'](removeEntity(_0x1e0d39,null))[_0xa872('0x40')](handleError(_0x1e0d39,null));};function widgetAttributes(_0x113c70){try{switch(_0x113c70[_0xa872('0x41')]){case'iframe':return[{'name':_0xa872('0x42'),'value':_0x113c70[_0xa872('0x42')]||(_0x113c70['attrs']&&_0x113c70[_0xa872('0x43')][0x0]?_0x113c70[_0xa872('0x43')][0x0][_0xa872('0x44')]:undefined)||'https://'}];case _0xa872('0x45'):return[{'name':_0xa872('0x46'),'value':_0x113c70[_0xa872('0x46')]||(_0x113c70['attrs']&&_0x113c70[_0xa872('0x43')][0x0]?_0x113c70[_0xa872('0x43')][0x0][_0xa872('0x44')]:undefined)||''}];case _0xa872('0x47'):return[{'name':_0xa872('0x48'),'value':_0x113c70[_0xa872('0x48')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70['attrs'][0x0]?_0x113c70['attrs'][0x0][_0xa872('0x44')]:undefined)||_0xa872('0x49')},{'name':_0xa872('0x4a'),'value':_0x113c70['attrTimezone']||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x1]?_0x113c70['attrs'][0x1]['value']:undefined)||_0xa872('0x4b')},{'name':_0xa872('0x4c'),'value':_0x113c70[_0xa872('0x4c')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70['attrs'][0x2]?_0x113c70[_0xa872('0x43')][0x2][_0xa872('0x44')]:undefined)||0xc}];case'counter':return[{'name':_0xa872('0x4d'),'value':_0x113c70['attrMetric']||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x0]?_0x113c70[_0xa872('0x43')][0x0][_0xa872('0x44')]:undefined)||_0xa872('0x4e')},{'name':_0xa872('0x4f'),'value':_0x113c70[_0xa872('0x4f')]||(_0x113c70['attrs']&&_0x113c70[_0xa872('0x43')][0x1]?_0x113c70[_0xa872('0x43')][0x1]['value']:undefined)||[]},{'name':_0xa872('0x4c'),'value':_0x113c70['attrFontSize']||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x2]?_0x113c70['attrs'][0x2][_0xa872('0x44')]:undefined)||0x14},{'name':_0xa872('0x50'),'value':_0x113c70['attrChannel']||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x3]?_0x113c70[_0xa872('0x43')][0x3][_0xa872('0x44')]:undefined)||_0xa872('0x51')},{'name':'attrEmailAccounts','value':_0x113c70[_0xa872('0x52')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x4]?_0x113c70['attrs'][0x4][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x53'),'value':_0x113c70['attrFaxAccounts']||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x5]?_0x113c70[_0xa872('0x43')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x113c70[_0xa872('0x54')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x6]?_0x113c70['attrs'][0x6][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x55'),'value':_0x113c70['attrOpenchannelAccounts']||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x7]?_0x113c70['attrs'][0x7][_0xa872('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x113c70[_0xa872('0x56')]||(_0x113c70['attrs']&&_0x113c70[_0xa872('0x43')][0x8]?_0x113c70[_0xa872('0x43')][0x8][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x57'),'value':_0x113c70[_0xa872('0x57')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x9]?_0x113c70[_0xa872('0x43')][0x9][_0xa872('0x44')]:undefined)||''}];case _0xa872('0x58'):case _0xa872('0x59'):return[{'name':_0xa872('0x5a'),'value':_0x113c70[_0xa872('0x5a')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70['attrs'][0x0]?_0x113c70['attrs'][0x0][_0xa872('0x44')]:undefined)||_0xa872('0x4e')},{'name':_0xa872('0x5b'),'value':_0x113c70['attrSerie2']||(_0x113c70['attrs']&&_0x113c70[_0xa872('0x43')][0x1]?_0x113c70[_0xa872('0x43')][0x1][_0xa872('0x44')]:undefined)||null},{'name':_0xa872('0x5c'),'value':_0x113c70[_0xa872('0x5c')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x2]?_0x113c70[_0xa872('0x43')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x113c70[_0xa872('0x4f')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x3]?_0x113c70[_0xa872('0x43')][0x3][_0xa872('0x44')]:undefined)||[]},{'name':_0xa872('0x50'),'value':_0x113c70[_0xa872('0x50')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x4]?_0x113c70['attrs'][0x4][_0xa872('0x44')]:undefined)||_0xa872('0x51')},{'name':_0xa872('0x52'),'value':_0x113c70[_0xa872('0x52')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x5]?_0x113c70['attrs'][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x113c70[_0xa872('0x53')]||(_0x113c70['attrs']&&_0x113c70['attrs'][0x6]?_0x113c70[_0xa872('0x43')][0x6][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x54'),'value':_0x113c70[_0xa872('0x54')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70['attrs'][0x7]?_0x113c70[_0xa872('0x43')][0x7][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x55'),'value':_0x113c70[_0xa872('0x55')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x8]?_0x113c70[_0xa872('0x43')][0x8][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x56'),'value':_0x113c70[_0xa872('0x56')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70['attrs'][0x9]?_0x113c70[_0xa872('0x43')][0x9][_0xa872('0x44')]:undefined)||''},{'name':_0xa872('0x57'),'value':_0x113c70[_0xa872('0x57')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0xa]?_0x113c70['attrs'][0xa][_0xa872('0x44')]:undefined)||''}];case _0xa872('0x5d'):return[{'name':_0xa872('0x5e'),'type':_0x113c70[_0xa872('0x5f')]||(_0x113c70['attrs']&&_0x113c70[_0xa872('0x43')][0x0]?_0x113c70['attrs'][0x0][_0xa872('0x41')]:undefined)||null,'value':_0x113c70['attrReport']||(_0x113c70[_0xa872('0x43')]&&_0x113c70['attrs'][0x0]?_0x113c70[_0xa872('0x43')][0x0][_0xa872('0x44')]:undefined)||null},{'name':_0xa872('0x60'),'value':_0x113c70[_0xa872('0x60')]||(_0x113c70[_0xa872('0x43')]&&_0x113c70[_0xa872('0x43')][0x1]?_0x113c70[_0xa872('0x43')][0x1][_0xa872('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x2f0403){logger[_0xa872('0x2d')]('widgetAttributes:\x20%s',JSON[_0xa872('0x61')](_0x2f0403));return[];}}exports['create']=function(_0x361739,_0x63b1a4){if(_0x361739[_0xa872('0x62')]){_0x361739[_0xa872('0x62')]['attrs']=widgetAttributes(_0x361739[_0xa872('0x62')]);}return db[_0xa872('0x32')][_0xa872('0x63')](_0x361739['body'],{})[_0xa872('0x2b')](respondWithResult(_0x63b1a4,0xc9))['catch'](handleError(_0x63b1a4,null));};exports[_0xa872('0x2a')]=function(_0x21a20b,_0x229ca4){if(_0x21a20b[_0xa872('0x62')]['id']){delete _0x21a20b[_0xa872('0x62')]['id'];}_0x21a20b[_0xa872('0x62')][_0xa872('0x43')]=widgetAttributes(_0x21a20b[_0xa872('0x62')]);return db[_0xa872('0x32')][_0xa872('0x3f')]({'where':{'id':_0x21a20b[_0xa872('0x30')]['id']}})[_0xa872('0x2b')](handleEntityNotFound(_0x229ca4,null))['then'](saveUpdates(_0x21a20b[_0xa872('0x62')],null))['then'](respondWithResult(_0x229ca4,null))[_0xa872('0x40')](handleError(_0x229ca4,null));}; \ No newline at end of file +var _0x195f=['./dashboardItem.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','options','find','catch','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','reportType','type','attrReport','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','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','defaults','redis','socket.io-emitter'];(function(_0x3af270,_0x5675b4){var _0x1dc18a=function(_0x310711){while(--_0x310711){_0x3af270['push'](_0x3af270['shift']());}};_0x1dc18a(++_0x5675b4);}(_0x195f,0x113));var _0xf195=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x195f[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xf195('0x0'));var rimraf=require(_0xf195('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf195('0x2'));var rp=require(_0xf195('0x3'));var moment=require('moment');var BPromise=require(_0xf195('0x4'));var Mustache=require('mustache');var util=require(_0xf195('0x5'));var path=require(_0xf195('0x6'));var sox=require(_0xf195('0x7'));var csv=require(_0xf195('0x8'));var ejs=require(_0xf195('0x9'));var fs=require('fs');var fs_extra=require(_0xf195('0xa'));var _=require(_0xf195('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf195('0xc'));var deskjs=require(_0xf195('0xd'));var toCsv=require(_0xf195('0x8'));var querystring=require(_0xf195('0xe'));var Papa=require(_0xf195('0xf'));var Redis=require(_0xf195('0x10'));var authService=require(_0xf195('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf195('0x12'));var hardwareService=require(_0xf195('0x13'));var logger=require(_0xf195('0x14'))('api');var utils=require(_0xf195('0x15'));var config=require(_0xf195('0x16'));var licenseUtil=require(_0xf195('0x17'));var db=require(_0xf195('0x18'))['db'];config['redis']=_[_0xf195('0x19')](config[_0xf195('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xf195('0x1b'))(new Redis(config['redis']));require(_0xf195('0x1c'))[_0xf195('0x1d')](socket);function respondWithStatusCode(_0x345a44,_0x41a77d){_0x41a77d=_0x41a77d||0xcc;return function(_0x27ac95){if(_0x27ac95){return _0x345a44[_0xf195('0x1e')](_0x41a77d);}return _0x345a44[_0xf195('0x1f')](_0x41a77d)[_0xf195('0x20')]();};}function respondWithResult(_0x4c1956,_0x56c2d7){_0x56c2d7=_0x56c2d7||0xc8;return function(_0x15590e){if(_0x15590e){return _0x4c1956[_0xf195('0x1f')](_0x56c2d7)[_0xf195('0x21')](_0x15590e);}};}function respondWithFilteredResult(_0x321bd7,_0x52b7c1){return function(_0x374fc6){if(_0x374fc6){var _0x1ae33e=typeof _0x52b7c1['offset']===_0xf195('0x22')&&typeof _0x52b7c1[_0xf195('0x23')]==='undefined';var _0x15acd6=_0x374fc6[_0xf195('0x24')];var _0x5a2bd4=_0x1ae33e?0x0:_0x52b7c1[_0xf195('0x25')];var _0x26dfea=_0x1ae33e?_0x374fc6[_0xf195('0x24')]:_0x52b7c1[_0xf195('0x25')]+_0x52b7c1['limit'];var _0x5933f0;if(_0x26dfea>=_0x15acd6){_0x26dfea=_0x15acd6;_0x5933f0=0xc8;}else{_0x5933f0=0xce;}_0x321bd7['status'](_0x5933f0);return _0x321bd7[_0xf195('0x26')](_0xf195('0x27'),_0x5a2bd4+'-'+_0x26dfea+'/'+_0x15acd6)[_0xf195('0x21')](_0x374fc6);}return null;};}function patchUpdates(_0x785aae){return function(_0x1c72f5){try{jsonpatch[_0xf195('0x28')](_0x1c72f5,_0x785aae,!![]);}catch(_0x3d3d14){return BPromise[_0xf195('0x29')](_0x3d3d14);}return _0x1c72f5[_0xf195('0x2a')]();};}function saveUpdates(_0x255d58,_0x45ebf9){return function(_0x1481ae){if(_0x1481ae){return _0x1481ae['update'](_0x255d58)[_0xf195('0x2b')](function(_0x246750){return _0x246750;});}return null;};}function removeEntity(_0x3dddd3,_0x2ae42e){return function(_0x221439){if(_0x221439){return _0x221439[_0xf195('0x2c')]()[_0xf195('0x2b')](function(){_0x3dddd3[_0xf195('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x583255,_0x190b43){return function(_0x37d9e9){if(!_0x37d9e9){_0x583255[_0xf195('0x1e')](0x194);}return _0x37d9e9;};}function handleError(_0x5e853d,_0x292a7a){_0x292a7a=_0x292a7a||0x1f4;return function(_0x37b3c6){logger[_0xf195('0x2d')](_0x37b3c6[_0xf195('0x2e')]);if(_0x37b3c6[_0xf195('0x2f')]){delete _0x37b3c6[_0xf195('0x2f')];}_0x5e853d[_0xf195('0x1f')](_0x292a7a)[_0xf195('0x30')](_0x37b3c6);};}exports[_0xf195('0x31')]=function(_0x2a3522,_0xdb8e93){var _0x245a06={'raw':![],'where':{'id':_0x2a3522[_0xf195('0x32')]['id']}},_0x20e0e3={};_0x20e0e3[_0xf195('0x33')]=_['keys'](db[_0xf195('0x34')][_0xf195('0x35')]);_0x20e0e3[_0xf195('0x36')]=_[_0xf195('0x37')](_0x2a3522[_0xf195('0x36')]);_0x20e0e3[_0xf195('0x38')]=_[_0xf195('0x39')](_0x20e0e3[_0xf195('0x33')],_0x20e0e3[_0xf195('0x36')]);_0x245a06[_0xf195('0x3a')]=_[_0xf195('0x39')](_0x20e0e3[_0xf195('0x33')],qs[_0xf195('0x3b')](_0x2a3522[_0xf195('0x36')][_0xf195('0x3b')]));_0x245a06[_0xf195('0x3a')]=_0x245a06[_0xf195('0x3a')]['length']?_0x245a06[_0xf195('0x3a')]:_0x20e0e3[_0xf195('0x33')];if(_0x2a3522[_0xf195('0x36')][_0xf195('0x3c')]){_0x245a06[_0xf195('0x3d')]=[{'all':!![]}];}_0x245a06=_['merge']({},_0x245a06,_0x2a3522[_0xf195('0x3e')]);return db[_0xf195('0x34')][_0xf195('0x3f')](_0x245a06)['then'](handleEntityNotFound(_0xdb8e93,null))['then'](respondWithResult(_0xdb8e93,null))[_0xf195('0x40')](handleError(_0xdb8e93,null));};exports[_0xf195('0x2c')]=function(_0x2814f6,_0xef4f39){return db[_0xf195('0x34')][_0xf195('0x3f')]({'where':{'id':_0x2814f6[_0xf195('0x32')]['id']}})[_0xf195('0x2b')](handleEntityNotFound(_0xef4f39,null))[_0xf195('0x2b')](removeEntity(_0xef4f39,null))[_0xf195('0x40')](handleError(_0xef4f39,null));};function widgetAttributes(_0x481537){try{switch(_0x481537['type']){case _0xf195('0x41'):return[{'name':_0xf195('0x42'),'value':_0x481537[_0xf195('0x42')]||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x0]?_0x481537[_0xf195('0x43')][0x0][_0xf195('0x44')]:undefined)||_0xf195('0x45')}];case'custom':return[{'name':_0xf195('0x46'),'value':_0x481537['attrPath']||(_0x481537['attrs']&&_0x481537[_0xf195('0x43')][0x0]?_0x481537[_0xf195('0x43')][0x0][_0xf195('0x44')]:undefined)||''}];case _0xf195('0x47'):return[{'name':_0xf195('0x48'),'value':_0x481537[_0xf195('0x48')]||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x0]?_0x481537[_0xf195('0x43')][0x0][_0xf195('0x44')]:undefined)||_0xf195('0x49')},{'name':_0xf195('0x4a'),'value':_0x481537[_0xf195('0x4a')]||(_0x481537[_0xf195('0x43')]&&_0x481537['attrs'][0x1]?_0x481537['attrs'][0x1][_0xf195('0x44')]:undefined)||_0xf195('0x4b')},{'name':_0xf195('0x4c'),'value':_0x481537[_0xf195('0x4c')]||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x2]?_0x481537[_0xf195('0x43')][0x2][_0xf195('0x44')]:undefined)||0xc}];case'counter':return[{'name':_0xf195('0x4d'),'value':_0x481537[_0xf195('0x4d')]||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x0]?_0x481537[_0xf195('0x43')][0x0][_0xf195('0x44')]:undefined)||_0xf195('0x4e')},{'name':'attrVoiceQueues','value':_0x481537[_0xf195('0x4f')]||(_0x481537[_0xf195('0x43')]&&_0x481537['attrs'][0x1]?_0x481537[_0xf195('0x43')][0x1]['value']:undefined)||[]},{'name':_0xf195('0x4c'),'value':_0x481537[_0xf195('0x4c')]||(_0x481537[_0xf195('0x43')]&&_0x481537['attrs'][0x2]?_0x481537[_0xf195('0x43')][0x2][_0xf195('0x44')]:undefined)||0x14},{'name':'attrChannel','value':_0x481537[_0xf195('0x50')]||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x3]?_0x481537[_0xf195('0x43')][0x3][_0xf195('0x44')]:undefined)||'voice'},{'name':_0xf195('0x51'),'value':_0x481537[_0xf195('0x51')]||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x4]?_0x481537[_0xf195('0x43')][0x4][_0xf195('0x44')]:undefined)||''},{'name':_0xf195('0x52'),'value':_0x481537[_0xf195('0x52')]||(_0x481537['attrs']&&_0x481537[_0xf195('0x43')][0x5]?_0x481537['attrs'][0x5][_0xf195('0x44')]:undefined)||''},{'name':_0xf195('0x53'),'value':_0x481537[_0xf195('0x53')]||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x6]?_0x481537[_0xf195('0x43')][0x6][_0xf195('0x44')]:undefined)||''},{'name':_0xf195('0x54'),'value':_0x481537['attrOpenchannelAccounts']||(_0x481537[_0xf195('0x43')]&&_0x481537['attrs'][0x7]?_0x481537[_0xf195('0x43')][0x7][_0xf195('0x44')]:undefined)||''},{'name':_0xf195('0x55'),'value':_0x481537[_0xf195('0x55')]||(_0x481537[_0xf195('0x43')]&&_0x481537['attrs'][0x8]?_0x481537[_0xf195('0x43')][0x8][_0xf195('0x44')]:undefined)||''},{'name':_0xf195('0x56'),'value':_0x481537[_0xf195('0x56')]||(_0x481537['attrs']&&_0x481537[_0xf195('0x43')][0x9]?_0x481537[_0xf195('0x43')][0x9]['value']:undefined)||''}];case _0xf195('0x57'):case _0xf195('0x58'):return[{'name':_0xf195('0x59'),'value':_0x481537[_0xf195('0x59')]||(_0x481537[_0xf195('0x43')]&&_0x481537['attrs'][0x0]?_0x481537[_0xf195('0x43')][0x0]['value']:undefined)||_0xf195('0x4e')},{'name':_0xf195('0x5a'),'value':_0x481537[_0xf195('0x5a')]||(_0x481537[_0xf195('0x43')]&&_0x481537['attrs'][0x1]?_0x481537[_0xf195('0x43')][0x1][_0xf195('0x44')]:undefined)||null},{'name':_0xf195('0x5b'),'value':_0x481537['attrSerie3']||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x2]?_0x481537[_0xf195('0x43')][0x2][_0xf195('0x44')]:undefined)||null},{'name':_0xf195('0x4f'),'value':_0x481537[_0xf195('0x4f')]||(_0x481537['attrs']&&_0x481537[_0xf195('0x43')][0x3]?_0x481537['attrs'][0x3][_0xf195('0x44')]:undefined)||[]},{'name':_0xf195('0x50'),'value':_0x481537[_0xf195('0x50')]||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x4]?_0x481537['attrs'][0x4][_0xf195('0x44')]:undefined)||_0xf195('0x5c')},{'name':_0xf195('0x51'),'value':_0x481537[_0xf195('0x51')]||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x5]?_0x481537[_0xf195('0x43')][0x5][_0xf195('0x44')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x481537[_0xf195('0x52')]||(_0x481537['attrs']&&_0x481537[_0xf195('0x43')][0x6]?_0x481537[_0xf195('0x43')][0x6][_0xf195('0x44')]:undefined)||''},{'name':_0xf195('0x53'),'value':_0x481537[_0xf195('0x53')]||(_0x481537['attrs']&&_0x481537[_0xf195('0x43')][0x7]?_0x481537[_0xf195('0x43')][0x7][_0xf195('0x44')]:undefined)||''},{'name':_0xf195('0x54'),'value':_0x481537[_0xf195('0x54')]||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x8]?_0x481537[_0xf195('0x43')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x481537[_0xf195('0x55')]||(_0x481537['attrs']&&_0x481537[_0xf195('0x43')][0x9]?_0x481537['attrs'][0x9][_0xf195('0x44')]:undefined)||''},{'name':_0xf195('0x56'),'value':_0x481537[_0xf195('0x56')]||(_0x481537['attrs']&&_0x481537['attrs'][0xa]?_0x481537[_0xf195('0x43')][0xa][_0xf195('0x44')]:undefined)||''}];case _0xf195('0x5d'):return[{'name':'attrReport','type':_0x481537[_0xf195('0x5e')]||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x0]?_0x481537[_0xf195('0x43')][0x0][_0xf195('0x5f')]:undefined)||null,'value':_0x481537[_0xf195('0x60')]||(_0x481537[_0xf195('0x43')]&&_0x481537['attrs'][0x0]?_0x481537[_0xf195('0x43')][0x0][_0xf195('0x44')]:undefined)||null},{'name':'attrRefresh','value':_0x481537['attrRefresh']||(_0x481537[_0xf195('0x43')]&&_0x481537[_0xf195('0x43')][0x1]?_0x481537[_0xf195('0x43')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x16cc75){logger['error'](_0xf195('0x61'),JSON[_0xf195('0x62')](_0x16cc75));return[];}}exports[_0xf195('0x63')]=function(_0x308aaf,_0x3f4a51){if(_0x308aaf['body']){_0x308aaf[_0xf195('0x64')][_0xf195('0x43')]=widgetAttributes(_0x308aaf[_0xf195('0x64')]);}return db['DashboardItem'][_0xf195('0x63')](_0x308aaf['body'],{})[_0xf195('0x2b')](respondWithResult(_0x3f4a51,0xc9))[_0xf195('0x40')](handleError(_0x3f4a51,null));};exports['update']=function(_0x2230f2,_0x3fae3a){if(_0x2230f2['body']['id']){delete _0x2230f2[_0xf195('0x64')]['id'];}_0x2230f2[_0xf195('0x64')]['attrs']=widgetAttributes(_0x2230f2[_0xf195('0x64')]);return db[_0xf195('0x34')][_0xf195('0x3f')]({'where':{'id':_0x2230f2[_0xf195('0x32')]['id']}})[_0xf195('0x2b')](handleEntityNotFound(_0x3fae3a,null))['then'](saveUpdates(_0x2230f2['body'],null))[_0xf195('0x2b')](respondWithResult(_0x3fae3a,null))[_0xf195('0x40')](handleError(_0x3fae3a,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index a569b83..5eb674e 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 _0x3757=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4e18a6,_0x56f050){var _0x28e4b4=function(_0x240b18){while(--_0x240b18){_0x4e18a6['push'](_0x4e18a6['shift']());}};_0x28e4b4(++_0x56f050);}(_0x3757,0x15f));var _0x7375=function(_0x536930,_0x311c0a){_0x536930=_0x536930-0x0;var _0x4c6561=_0x3757[_0x536930];return _0x4c6561;};'use strict';var EventEmitter=require(_0x7375('0x0'));var DashboardItem=require(_0x7375('0x1'))['db'][_0x7375('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7375('0x3')](0x0);var events={'afterCreate':_0x7375('0x4'),'afterUpdate':_0x7375('0x5'),'afterDestroy':_0x7375('0x6')};function emitEvent(_0x5ce1e6){return function(_0x575a38,_0x45d2de,_0x4c11cc){DashboardItemEvents['emit'](_0x5ce1e6+':'+_0x575a38['id'],_0x575a38);DashboardItemEvents[_0x7375('0x7')](_0x5ce1e6,_0x575a38);_0x4c11cc(null);};}for(var e in events){if(events[_0x7375('0x8')](e)){var event=events[e];DashboardItem[_0x7375('0x9')](e,emitEvent(event));}}module[_0x7375('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0x4628=['remove','emit','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x4628,0xd3));var _0x8462=function(_0x57a4f0,_0x534004){_0x57a4f0=_0x57a4f0-0x0;var _0x2b6993=_0x4628[_0x57a4f0];return _0x2b6993;};'use strict';var EventEmitter=require(_0x8462('0x0'));var DashboardItem=require(_0x8462('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x8462('0x2')](0x0);var events={'afterCreate':_0x8462('0x3'),'afterUpdate':_0x8462('0x4'),'afterDestroy':_0x8462('0x5')};function emitEvent(_0x337b21){return function(_0x5f1fdb,_0x1ebadd,_0x85915a){DashboardItemEvents[_0x8462('0x6')](_0x337b21+':'+_0x5f1fdb['id'],_0x5f1fdb);DashboardItemEvents[_0x8462('0x6')](_0x337b21,_0x5f1fdb);_0x85915a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x8462('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 978ddce..6a2fd04 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 _0xbe43=['rimraf','./dashboardItem.attributes','define','lodash','moment','bluebird','request-promise','path'];(function(_0x1bb9f1,_0x177f95){var _0x471a6a=function(_0x240a8c){while(--_0x240a8c){_0x1bb9f1['push'](_0x1bb9f1['shift']());}};_0x471a6a(++_0x177f95);}(_0xbe43,0xbb));var _0x3be4=function(_0x3b9baf,_0x415479){_0x3b9baf=_0x3b9baf-0x0;var _0x330c5b=_0xbe43[_0x3b9baf];return _0x330c5b;};'use strict';var _=require(_0x3be4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3be4('0x1'));var BPromise=require(_0x3be4('0x2'));var rp=require(_0x3be4('0x3'));var fs=require('fs');var path=require(_0x3be4('0x4'));var rimraf=require(_0x3be4('0x5'));var config=require('../../config/environment');var attributes=require(_0x3be4('0x6'));module['exports']=function(_0x185d4d,_0x2d8ea3){return _0x185d4d[_0x3be4('0x7')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4cc=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','dashboard_items'];(function(_0x356b73,_0x17774c){var _0x1965e0=function(_0x4fb907){while(--_0x4fb907){_0x356b73['push'](_0x356b73['shift']());}};_0x1965e0(++_0x17774c);}(_0xd4cc,0x114));var _0xcd4c=function(_0x1c3b40,_0x581b78){_0x1c3b40=_0x1c3b40-0x0;var _0x470677=_0xd4cc[_0x1c3b40];return _0x470677;};'use strict';var _=require(_0xcd4c('0x0'));var util=require(_0xcd4c('0x1'));var logger=require(_0xcd4c('0x2'))('api');var moment=require(_0xcd4c('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd4c('0x4'));var fs=require('fs');var path=require(_0xcd4c('0x5'));var rimraf=require(_0xcd4c('0x6'));var config=require(_0xcd4c('0x7'));var attributes=require(_0xcd4c('0x8'));module[_0xcd4c('0x9')]=function(_0x2d7040,_0x10dd24){return _0x2d7040[_0xcd4c('0xa')]('DashboardItem',attributes,{'tableName':_0xcd4c('0xb'),'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 a86faac..5df88e1 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 _0x0e3f=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x4413ba,_0x14f6c6){var _0xbef917=function(_0x21065a){while(--_0x21065a){_0x4413ba['push'](_0x4413ba['shift']());}};_0xbef917(++_0x14f6c6);}(_0x0e3f,0x101));var _0xf0e3=function(_0x79cd61,_0x4b88ea){_0x79cd61=_0x79cd61-0x0;var _0x524e86=_0x0e3f[_0x79cd61];return _0x524e86;};'use strict';var _=require(_0xf0e3('0x0'));var util=require(_0xf0e3('0x1'));var moment=require(_0xf0e3('0x2'));var BPromise=require(_0xf0e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0e3('0x4'));var db=require(_0xf0e3('0x5'))['db'];var utils=require(_0xf0e3('0x6'));var logger=require(_0xf0e3('0x7'))(_0xf0e3('0x8'));var config=require(_0xf0e3('0x9'));var jayson=require(_0xf0e3('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xf0e3('0xb'),'port':0x18eb});var socket=require(_0xf0e3('0xc'))(new Redis(config['redis']));require(_0xf0e3('0xd'))[_0xf0e3('0xe')](socket);function respondWithRpcPromise(_0x3935a8,_0x301f69,_0x3ac40b){return new BPromise(function(_0x149d35,_0x1f3f59){return client[_0xf0e3('0xf')](_0x3935a8,_0x3ac40b)[_0xf0e3('0x10')](function(_0x1b2c4f){logger[_0xf0e3('0x11')](_0xf0e3('0x12'),_0x301f69,_0xf0e3('0x13'));logger['debug'](_0xf0e3('0x14'),_0x301f69,'request\x20sent',JSON['stringify'](_0x1b2c4f));if(_0x1b2c4f[_0xf0e3('0x15')]){if(_0x1b2c4f['error'][_0xf0e3('0x16')]===0x1f4){logger[_0xf0e3('0x15')](_0xf0e3('0x12'),_0x301f69,_0x1b2c4f[_0xf0e3('0x15')]['message']);return _0x1f3f59(_0x1b2c4f[_0xf0e3('0x15')][_0xf0e3('0x17')]);}logger[_0xf0e3('0x15')](_0xf0e3('0x12'),_0x301f69,_0x1b2c4f[_0xf0e3('0x15')][_0xf0e3('0x17')]);return _0x149d35(_0x1b2c4f[_0xf0e3('0x15')][_0xf0e3('0x17')]);}else{logger[_0xf0e3('0x11')](_0xf0e3('0x12'),_0x301f69,_0xf0e3('0x13'));_0x149d35(_0x1b2c4f[_0xf0e3('0x18')][_0xf0e3('0x17')]);}})[_0xf0e3('0x19')](function(_0x36d5e3){logger[_0xf0e3('0x15')](_0xf0e3('0x12'),_0x301f69,_0x36d5e3);_0x1f3f59(_0x36d5e3);});});} \ No newline at end of file +var _0x88da=['../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x53ffe9,_0x367829){var _0xc6597e=function(_0x49ea9a){while(--_0x49ea9a){_0x53ffe9['push'](_0x53ffe9['shift']());}};_0xc6597e(++_0x367829);}(_0x88da,0xf5));var _0xa88d=function(_0x16bf81,_0x30750b){_0x16bf81=_0x16bf81-0x0;var _0x56dc74=_0x88da[_0x16bf81];return _0x56dc74;};'use strict';var _=require('lodash');var util=require(_0xa88d('0x0'));var moment=require(_0xa88d('0x1'));var BPromise=require('bluebird');var rs=require(_0xa88d('0x2'));var fs=require('fs');var Redis=require(_0xa88d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa88d('0x4'));var logger=require(_0xa88d('0x5'))(_0xa88d('0x6'));var config=require(_0xa88d('0x7'));var jayson=require(_0xa88d('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xa88d('0x9')]=_[_0xa88d('0xa')](config[_0xa88d('0x9')],{'host':_0xa88d('0xb'),'port':0x18eb});var socket=require(_0xa88d('0xc'))(new Redis(config[_0xa88d('0x9')]));require(_0xa88d('0xd'))[_0xa88d('0xe')](socket);function respondWithRpcPromise(_0x353026,_0x109532,_0x2ec5e0){return new BPromise(function(_0x1c4ec7,_0x4b68c4){return client[_0xa88d('0xf')](_0x353026,_0x2ec5e0)[_0xa88d('0x10')](function(_0x475e99){logger[_0xa88d('0x11')](_0xa88d('0x12'),_0x109532,_0xa88d('0x13'));logger[_0xa88d('0x14')](_0xa88d('0x15'),_0x109532,_0xa88d('0x13'),JSON[_0xa88d('0x16')](_0x475e99));if(_0x475e99['error']){if(_0x475e99[_0xa88d('0x17')][_0xa88d('0x18')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x109532,_0x475e99[_0xa88d('0x17')]['message']);return _0x4b68c4(_0x475e99[_0xa88d('0x17')][_0xa88d('0x19')]);}logger[_0xa88d('0x17')](_0xa88d('0x12'),_0x109532,_0x475e99[_0xa88d('0x17')][_0xa88d('0x19')]);return _0x1c4ec7(_0x475e99[_0xa88d('0x17')]['message']);}else{logger[_0xa88d('0x11')](_0xa88d('0x12'),_0x109532,_0xa88d('0x13'));_0x1c4ec7(_0x475e99[_0xa88d('0x1a')][_0xa88d('0x19')]);}})[_0xa88d('0x1b')](function(_0x2cbd05){logger[_0xa88d('0x17')](_0xa88d('0x12'),_0x109532,_0x2cbd05);_0x4b68c4(_0x2cbd05);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 8d9402a..76dffd2 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 _0x96e3=['remove','update','removeListener','register','length','./dashboardItem.events','save'];(function(_0x12ece7,_0xe4520c){var _0x155242=function(_0x505bd1){while(--_0x505bd1){_0x12ece7['push'](_0x12ece7['shift']());}};_0x155242(++_0xe4520c);}(_0x96e3,0x124));var _0x396e=function(_0xa1c364,_0xe8c7bd){_0xa1c364=_0xa1c364-0x0;var _0x490fbb=_0x96e3[_0xa1c364];return _0x490fbb;};'use strict';var DashboardItemEvents=require(_0x396e('0x0'));var events=[_0x396e('0x1'),_0x396e('0x2'),_0x396e('0x3')];function createListener(_0x2bbf41,_0x4c35f8){return function(_0x3c9abd){_0x4c35f8['emit'](_0x2bbf41,_0x3c9abd);};}function removeListener(_0x455db4,_0x4ab756){return function(){DashboardItemEvents[_0x396e('0x4')](_0x455db4,_0x4ab756);};}exports[_0x396e('0x5')]=function(_0xb331df){for(var _0x46ea4c=0x0,_0x578749=events[_0x396e('0x6')];_0x46ea4c<_0x578749;_0x46ea4c++){var _0x4e3ac=events[_0x46ea4c];var _0x390080=createListener('dashboardItem:'+_0x4e3ac,_0xb331df);DashboardItemEvents['on'](_0x4e3ac,_0x390080);}}; \ No newline at end of file +var _0x1b6b=['./dashboardItem.events','save','emit','removeListener','register','length','dashboardItem:'];(function(_0x1b0de5,_0x33bba2){var _0x4b9a1c=function(_0xd172e3){while(--_0xd172e3){_0x1b0de5['push'](_0x1b0de5['shift']());}};_0x4b9a1c(++_0x33bba2);}(_0x1b6b,0x17a));var _0xb1b6=function(_0x6d34dc,_0x4939fc){_0x6d34dc=_0x6d34dc-0x0;var _0x1d5d8e=_0x1b6b[_0x6d34dc];return _0x1d5d8e;};'use strict';var DashboardItemEvents=require(_0xb1b6('0x0'));var events=[_0xb1b6('0x1'),'remove','update'];function createListener(_0x3c3a92,_0x3134e4){return function(_0x3c7558){_0x3134e4[_0xb1b6('0x2')](_0x3c3a92,_0x3c7558);};}function removeListener(_0x1b99bf,_0x14477c){return function(){DashboardItemEvents[_0xb1b6('0x3')](_0x1b99bf,_0x14477c);};}exports[_0xb1b6('0x4')]=function(_0x96d5b9){for(var _0x3d7493=0x0,_0x31c15f=events[_0xb1b6('0x5')];_0x3d7493<_0x31c15f;_0x3d7493++){var _0x757b45=events[_0x3d7493];var _0x6e9ed1=createListener(_0xb1b6('0x6')+_0x757b45,_0x96d5b9);DashboardItemEvents['on'](_0x757b45,_0x6e9ed1);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 3c7533b..e341564 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 _0x0d49=['isAuthenticated','show','create','put','update','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x0d49,0xe2));var _0x90d4=function(_0x5a9c90,_0x3c6dd1){_0x5a9c90=_0x5a9c90-0x0;var _0xef7709=_0x0d49[_0x5a9c90];return _0xef7709;};'use strict';var multer=require(_0x90d4('0x0'));var util=require(_0x90d4('0x1'));var path=require('path');var timeout=require(_0x90d4('0x2'));var express=require(_0x90d4('0x3'));var router=express[_0x90d4('0x4')]();var fs_extra=require(_0x90d4('0x5'));var auth=require(_0x90d4('0x6'));var interaction=require(_0x90d4('0x7'));var config=require(_0x90d4('0x8'));var controller=require(_0x90d4('0x9'));router[_0x90d4('0xa')](_0x90d4('0xb'),auth[_0x90d4('0xc')](),controller[_0x90d4('0xd')]);router['post']('/',auth[_0x90d4('0xc')](),controller[_0x90d4('0xe')]);router[_0x90d4('0xf')]('/:id',auth[_0x90d4('0xc')](),controller[_0x90d4('0x10')]);router['delete'](_0x90d4('0xb'),auth[_0x90d4('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9249=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','create','put','/:id','delete','destroy','util','path'];(function(_0x3f4a1e,_0x47d489){var _0x29c1a1=function(_0x18cec2){while(--_0x18cec2){_0x3f4a1e['push'](_0x3f4a1e['shift']());}};_0x29c1a1(++_0x47d489);}(_0x9249,0x85));var _0x9924=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x9249[_0x413feb];return _0x40ee88;};'use strict';var multer=require('multer');var util=require(_0x9924('0x0'));var path=require(_0x9924('0x1'));var timeout=require('connect-timeout');var express=require(_0x9924('0x2'));var router=express[_0x9924('0x3')]();var fs_extra=require(_0x9924('0x4'));var auth=require(_0x9924('0x5'));var interaction=require(_0x9924('0x6'));var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router[_0x9924('0x7')]('/:id',auth[_0x9924('0x8')](),controller[_0x9924('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9924('0xa')]);router[_0x9924('0xb')](_0x9924('0xc'),auth[_0x9924('0x8')](),controller['update']);router[_0x9924('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x9924('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 279cc7a..7809447 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 _0xdff3=['sequelize','first','second','third','STRING'];(function(_0x582b0f,_0x35a9de){var _0x4658f0=function(_0x106924){while(--_0x106924){_0x582b0f['push'](_0x582b0f['shift']());}};_0x4658f0(++_0x35a9de);}(_0xdff3,0x1c7));var _0x3dff=function(_0x2d3076,_0x2f8210){_0x2d3076=_0x2d3076-0x0;var _0x43c92d=_0xdff3[_0x2d3076];return _0x43c92d;};'use strict';var Sequelize=require(_0x3dff('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x3dff('0x1'),_0x3dff('0x2'),_0x3dff('0x3')),'allowNull':![],'defaultValue':_0x3dff('0x1')},'description':{'type':Sequelize[_0x3dff('0x4')]}}; \ No newline at end of file +var _0x57d4=['exports','STRING','second','third','sequelize'];(function(_0x3771c9,_0x2a0328){var _0x4cee1e=function(_0xa7830f){while(--_0xa7830f){_0x3771c9['push'](_0x3771c9['shift']());}};_0x4cee1e(++_0x2a0328);}(_0x57d4,0xd6));var _0x457d=function(_0x3ea7df,_0x4bc93d){_0x3ea7df=_0x3ea7df-0x0;var _0x5bc0fa=_0x57d4[_0x3ea7df];return _0x5bc0fa;};'use strict';var Sequelize=require(_0x457d('0x0'));module[_0x457d('0x1')]={'name':{'type':Sequelize[_0x457d('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0x457d('0x3'),_0x457d('0x4')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x457d('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index b014a4b..cf1aa23 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 _0x933c=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','then','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring'];(function(_0x401ea5,_0xbd0f9){var _0x2b5536=function(_0x5da0be){while(--_0x5da0be){_0x401ea5['push'](_0x401ea5['shift']());}};_0x2b5536(++_0xbd0f9);}(_0x933c,0x99));var _0xc933=function(_0x2ad7d9,_0x231946){_0x2ad7d9=_0x2ad7d9-0x0;var _0x57c524=_0x933c[_0x2ad7d9];return _0x57c524;};'use strict';var emlformat=require(_0xc933('0x0'));var rimraf=require(_0xc933('0x1'));var zipdir=require(_0xc933('0x2'));var jsonpatch=require(_0xc933('0x3'));var rp=require(_0xc933('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc933('0x5'));var util=require(_0xc933('0x6'));var path=require(_0xc933('0x7'));var sox=require(_0xc933('0x8'));var csv=require(_0xc933('0x9'));var ejs=require(_0xc933('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc933('0xb'));var squel=require('squel');var crypto=require(_0xc933('0xc'));var jsforce=require(_0xc933('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc933('0xe'));var Papa=require(_0xc933('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc933('0x10'));var as=require(_0xc933('0x11'));var hardwareService=require(_0xc933('0x12'));var logger=require(_0xc933('0x13'))(_0xc933('0x14'));var utils=require(_0xc933('0x15'));var config=require(_0xc933('0x16'));var licenseUtil=require(_0xc933('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4928e5,_0x2c855a){_0x2c855a=_0x2c855a||0xcc;return function(_0x475cce){if(_0x475cce){return _0x4928e5[_0xc933('0x18')](_0x2c855a);}return _0x4928e5[_0xc933('0x19')](_0x2c855a)[_0xc933('0x1a')]();};}function respondWithResult(_0x4c2fad,_0x1d8c1c){_0x1d8c1c=_0x1d8c1c||0xc8;return function(_0x5b6f32){if(_0x5b6f32){return _0x4c2fad[_0xc933('0x19')](_0x1d8c1c)[_0xc933('0x1b')](_0x5b6f32);}};}function respondWithFilteredResult(_0x106146,_0x2f5784){return function(_0x490452){if(_0x490452){var _0x12a97b=typeof _0x2f5784['offset']==='undefined'&&typeof _0x2f5784[_0xc933('0x1c')]===_0xc933('0x1d');var _0xb76659=_0x490452[_0xc933('0x1e')];var _0x1611a7=_0x12a97b?0x0:_0x2f5784[_0xc933('0x1f')];var _0x186b19=_0x12a97b?_0x490452[_0xc933('0x1e')]:_0x2f5784[_0xc933('0x1f')]+_0x2f5784[_0xc933('0x1c')];var _0x5a1552;if(_0x186b19>=_0xb76659){_0x186b19=_0xb76659;_0x5a1552=0xc8;}else{_0x5a1552=0xce;}_0x106146[_0xc933('0x19')](_0x5a1552);return _0x106146[_0xc933('0x20')](_0xc933('0x21'),_0x1611a7+'-'+_0x186b19+'/'+_0xb76659)[_0xc933('0x1b')](_0x490452);}return null;};}function patchUpdates(_0x1f57db){return function(_0x318370){try{jsonpatch[_0xc933('0x22')](_0x318370,_0x1f57db,!![]);}catch(_0x20f024){return BPromise['reject'](_0x20f024);}return _0x318370[_0xc933('0x23')]();};}function saveUpdates(_0x2d7d7f,_0x176a2c){return function(_0x1113df){if(_0x1113df){return _0x1113df[_0xc933('0x24')](_0x2d7d7f)['then'](function(_0x1abfae){return _0x1abfae;});}return null;};}function removeEntity(_0x36f828,_0x3411ce){return function(_0x2a259c){if(_0x2a259c){return _0x2a259c[_0xc933('0x25')]()['then'](function(){var _0xec50a0=_0x2a259c[_0xc933('0x26')]({'plain':!![]});var _0x5ede22='Dispositions';return db[_0xc933('0x27')][_0xc933('0x25')]({'where':{'type':_0x5ede22,'resourceId':_0xec50a0['id']}})[_0xc933('0x28')](function(){return _0x2a259c;});})[_0xc933('0x28')](function(){_0x36f828['status'](0xcc)[_0xc933('0x1a')]();});}};}function handleEntityNotFound(_0xcdcca5,_0x519ede){return function(_0x1a9004){if(!_0x1a9004){_0xcdcca5[_0xc933('0x18')](0x194);}return _0x1a9004;};}function handleError(_0x53373a,_0x50805b){_0x50805b=_0x50805b||0x1f4;return function(_0x4628ec){logger['error'](_0x4628ec[_0xc933('0x29')]);if(_0x4628ec[_0xc933('0x2a')]){delete _0x4628ec['name'];}_0x53373a[_0xc933('0x19')](_0x50805b)[_0xc933('0x2b')](_0x4628ec);};}exports[_0xc933('0x2c')]=function(_0x5055c7,_0x1a72b0){var _0x39e652={},_0x457683={},_0x5ab52a={'count':0x0,'rows':[]};var _0x129af4=_[_0xc933('0x2d')](db[_0xc933('0x2e')][_0xc933('0x2f')],function(_0x322332){return{'name':_0x322332[_0xc933('0x30')],'type':_0x322332[_0xc933('0x31')][_0xc933('0x32')]};});_0x457683[_0xc933('0x33')]=_[_0xc933('0x2d')](_0x129af4,'name');_0x457683[_0xc933('0x34')]=_[_0xc933('0x35')](_0x5055c7[_0xc933('0x34')]);_0x457683[_0xc933('0x36')]=_['intersection'](_0x457683['model'],_0x457683[_0xc933('0x34')]);_0x39e652[_0xc933('0x37')]=_[_0xc933('0x38')](_0x457683['model'],qs[_0xc933('0x39')](_0x5055c7[_0xc933('0x34')][_0xc933('0x39')]));_0x39e652[_0xc933('0x37')]=_0x39e652[_0xc933('0x37')][_0xc933('0x3a')]?_0x39e652[_0xc933('0x37')]:_0x457683[_0xc933('0x33')];if(!_0x5055c7[_0xc933('0x34')]['hasOwnProperty'](_0xc933('0x3b'))){_0x39e652[_0xc933('0x1c')]=qs[_0xc933('0x1c')](_0x5055c7[_0xc933('0x34')]['limit']);_0x39e652[_0xc933('0x1f')]=qs[_0xc933('0x1f')](_0x5055c7[_0xc933('0x34')][_0xc933('0x1f')]);}_0x39e652[_0xc933('0x3c')]=qs[_0xc933('0x3d')](_0x5055c7[_0xc933('0x34')][_0xc933('0x3d')]);_0x39e652[_0xc933('0x3e')]=qs[_0xc933('0x36')](_['pick'](_0x5055c7[_0xc933('0x34')],_0x457683[_0xc933('0x36')]),_0x129af4);if(_0x5055c7[_0xc933('0x34')][_0xc933('0x3f')]){_0x39e652['where']=_[_0xc933('0x40')](_0x39e652['where'],{'$or':_[_0xc933('0x2d')](_0x129af4,function(_0x5d148d){if(_0x5d148d[_0xc933('0x31')]!=='VIRTUAL'){var _0x280f20={};_0x280f20[_0x5d148d['name']]={'$like':'%'+_0x5055c7['query'][_0xc933('0x3f')]+'%'};return _0x280f20;}})});}_0x39e652=_[_0xc933('0x40')]({},_0x39e652,_0x5055c7[_0xc933('0x41')]);var _0x560ae9={'where':_0x39e652[_0xc933('0x3e')]};return db[_0xc933('0x2e')][_0xc933('0x1e')](_0x560ae9)['then'](function(_0x387271){_0x5ab52a[_0xc933('0x1e')]=_0x387271;if(_0x5055c7[_0xc933('0x34')][_0xc933('0x42')]){_0x39e652[_0xc933('0x43')]=[{'all':!![]}];}return db[_0xc933('0x2e')][_0xc933('0x44')](_0x39e652);})['then'](function(_0x1974a0){_0x5ab52a[_0xc933('0x45')]=_0x1974a0;return _0x5ab52a;})['then'](respondWithFilteredResult(_0x1a72b0,_0x39e652))[_0xc933('0x46')](handleError(_0x1a72b0,null));};exports[_0xc933('0x47')]=function(_0x211259,_0x204c4b){var _0x375738={'raw':!![],'where':{'id':_0x211259[_0xc933('0x48')]['id']}},_0x3ecb80={};_0x3ecb80[_0xc933('0x33')]=_[_0xc933('0x35')](db[_0xc933('0x2e')]['rawAttributes']);_0x3ecb80[_0xc933('0x34')]=_[_0xc933('0x35')](_0x211259[_0xc933('0x34')]);_0x3ecb80[_0xc933('0x36')]=_[_0xc933('0x38')](_0x3ecb80[_0xc933('0x33')],_0x3ecb80[_0xc933('0x34')]);_0x375738[_0xc933('0x37')]=_['intersection'](_0x3ecb80[_0xc933('0x33')],qs[_0xc933('0x39')](_0x211259[_0xc933('0x34')]['fields']));_0x375738[_0xc933('0x37')]=_0x375738[_0xc933('0x37')][_0xc933('0x3a')]?_0x375738[_0xc933('0x37')]:_0x3ecb80[_0xc933('0x33')];if(_0x211259[_0xc933('0x34')][_0xc933('0x42')]){_0x375738[_0xc933('0x43')]=[{'all':!![]}];}_0x375738=_['merge']({},_0x375738,_0x211259['options']);return db[_0xc933('0x2e')][_0xc933('0x49')](_0x375738)['then'](handleEntityNotFound(_0x204c4b,null))[_0xc933('0x28')](respondWithResult(_0x204c4b,null))[_0xc933('0x46')](handleError(_0x204c4b,null));};exports[_0xc933('0x4a')]=function(_0x72884f,_0x1ac447){return db['Disposition'][_0xc933('0x4a')](_0x72884f['body'],{})['then'](function(_0x16b159){var _0x4c4944=_0x72884f[_0xc933('0x4b')][_0xc933('0x26')]({'plain':!![]});if(!_0x4c4944)throw new Error(_0xc933('0x4c'));if(_0x4c4944[_0xc933('0x4d')]===_0xc933('0x4b')){var _0x5a2e8e=_0x16b159[_0xc933('0x26')]({'plain':!![]});var _0x4cbe44=_0xc933('0x4e');return db[_0xc933('0x4f')][_0xc933('0x49')]({'where':{'name':_0x4cbe44,'userProfileId':_0x4c4944[_0xc933('0x50')]},'raw':!![]})[_0xc933('0x28')](function(_0x4b0215){if(_0x4b0215&&_0x4b0215['autoAssociation']===0x0){return db['UserProfileResource'][_0xc933('0x4a')]({'name':_0x5a2e8e[_0xc933('0x2a')],'resourceId':_0x5a2e8e['id'],'type':_0x4b0215[_0xc933('0x2a')],'sectionId':_0x4b0215['id']},{})['then'](function(){return _0x16b159;});}else{return _0x16b159;}})[_0xc933('0x46')](function(_0xb64873){logger[_0xc933('0x51')](_0xc933('0x52'),_0xb64873);throw _0xb64873;});}return _0x16b159;})[_0xc933('0x28')](respondWithResult(_0x1ac447,0xc9))[_0xc933('0x46')](handleError(_0x1ac447,null));};exports['update']=function(_0x34cbfd,_0x1ef265){if(_0x34cbfd['body']['id']){delete _0x34cbfd[_0xc933('0x53')]['id'];}return db[_0xc933('0x2e')][_0xc933('0x49')]({'where':{'id':_0x34cbfd[_0xc933('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ef265,null))[_0xc933('0x28')](saveUpdates(_0x34cbfd[_0xc933('0x53')],null))[_0xc933('0x28')](respondWithResult(_0x1ef265,null))['catch'](handleError(_0x1ef265,null));};exports[_0xc933('0x25')]=function(_0x52ade7,_0x1a201e){return db[_0xc933('0x2e')][_0xc933('0x49')]({'where':{'id':_0x52ade7['params']['id']}})[_0xc933('0x28')](handleEntityNotFound(_0x1a201e,null))[_0xc933('0x28')](removeEntity(_0x1a201e,null))[_0xc933('0x46')](handleError(_0x1a201e,null));}; \ No newline at end of file +var _0xbe25=['end','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus'];(function(_0x372cd6,_0x44d6b7){var _0x20b281=function(_0x28117d){while(--_0x28117d){_0x372cd6['push'](_0x372cd6['shift']());}};_0x20b281(++_0x44d6b7);}(_0xbe25,0x1c9));var _0x5be2=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xbe25[_0x4b2436];return _0x4f5ab2;};'use strict';var emlformat=require(_0x5be2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5be2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5be2('0x2'));var moment=require(_0x5be2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5be2('0x4'));var util=require(_0x5be2('0x5'));var path=require(_0x5be2('0x6'));var sox=require(_0x5be2('0x7'));var csv=require(_0x5be2('0x8'));var ejs=require(_0x5be2('0x9'));var fs=require('fs');var fs_extra=require(_0x5be2('0xa'));var _=require(_0x5be2('0xb'));var squel=require('squel');var crypto=require(_0x5be2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5be2('0xd'));var toCsv=require(_0x5be2('0x8'));var querystring=require('querystring');var Papa=require(_0x5be2('0xe'));var Redis=require('ioredis');var authService=require(_0x5be2('0xf'));var qs=require(_0x5be2('0x10'));var as=require(_0x5be2('0x11'));var hardwareService=require(_0x5be2('0x12'));var logger=require(_0x5be2('0x13'))(_0x5be2('0x14'));var utils=require(_0x5be2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ab389,_0x124275){_0x124275=_0x124275||0xcc;return function(_0x63cfbe){if(_0x63cfbe){return _0x2ab389[_0x5be2('0x16')](_0x124275);}return _0x2ab389['status'](_0x124275)[_0x5be2('0x17')]();};}function respondWithResult(_0x176a93,_0x1c9634){_0x1c9634=_0x1c9634||0xc8;return function(_0xcdbbf4){if(_0xcdbbf4){return _0x176a93[_0x5be2('0x18')](_0x1c9634)[_0x5be2('0x19')](_0xcdbbf4);}};}function respondWithFilteredResult(_0x21655c,_0x361cfe){return function(_0xe999fb){if(_0xe999fb){var _0x35373e=typeof _0x361cfe[_0x5be2('0x1a')]===_0x5be2('0x1b')&&typeof _0x361cfe['limit']===_0x5be2('0x1b');var _0x16dcbb=_0xe999fb[_0x5be2('0x1c')];var _0x5caa4c=_0x35373e?0x0:_0x361cfe[_0x5be2('0x1a')];var _0x3aa842=_0x35373e?_0xe999fb[_0x5be2('0x1c')]:_0x361cfe['offset']+_0x361cfe[_0x5be2('0x1d')];var _0x180cdd;if(_0x3aa842>=_0x16dcbb){_0x3aa842=_0x16dcbb;_0x180cdd=0xc8;}else{_0x180cdd=0xce;}_0x21655c[_0x5be2('0x18')](_0x180cdd);return _0x21655c[_0x5be2('0x1e')]('Content-Range',_0x5caa4c+'-'+_0x3aa842+'/'+_0x16dcbb)[_0x5be2('0x19')](_0xe999fb);}return null;};}function patchUpdates(_0x2e36f4){return function(_0x37394a){try{jsonpatch[_0x5be2('0x1f')](_0x37394a,_0x2e36f4,!![]);}catch(_0x2197fe){return BPromise[_0x5be2('0x20')](_0x2197fe);}return _0x37394a['save']();};}function saveUpdates(_0x18301e,_0x2c5628){return function(_0x15b907){if(_0x15b907){return _0x15b907[_0x5be2('0x21')](_0x18301e)[_0x5be2('0x22')](function(_0xeae4ce){return _0xeae4ce;});}return null;};}function removeEntity(_0x3b28f2,_0x209946){return function(_0x222a94){if(_0x222a94){return _0x222a94[_0x5be2('0x23')]()[_0x5be2('0x22')](function(){var _0x20151e=_0x222a94[_0x5be2('0x24')]({'plain':!![]});var _0x3c9fd9=_0x5be2('0x25');return db[_0x5be2('0x26')][_0x5be2('0x23')]({'where':{'type':_0x3c9fd9,'resourceId':_0x20151e['id']}})[_0x5be2('0x22')](function(){return _0x222a94;});})[_0x5be2('0x22')](function(){_0x3b28f2[_0x5be2('0x18')](0xcc)[_0x5be2('0x17')]();});}};}function handleEntityNotFound(_0x13f116,_0x4d92b7){return function(_0x5428d1){if(!_0x5428d1){_0x13f116[_0x5be2('0x16')](0x194);}return _0x5428d1;};}function handleError(_0x159419,_0x17912d){_0x17912d=_0x17912d||0x1f4;return function(_0x50c149){logger[_0x5be2('0x27')](_0x50c149[_0x5be2('0x28')]);if(_0x50c149[_0x5be2('0x29')]){delete _0x50c149[_0x5be2('0x29')];}_0x159419[_0x5be2('0x18')](_0x17912d)[_0x5be2('0x2a')](_0x50c149);};}exports[_0x5be2('0x2b')]=function(_0x462b71,_0x1e12b7){var _0x4518a3={},_0x1edd9e={},_0x3bd8d0={'count':0x0,'rows':[]};var _0x271f42=_[_0x5be2('0x2c')](db[_0x5be2('0x2d')][_0x5be2('0x2e')],function(_0x50a9fd){return{'name':_0x50a9fd['fieldName'],'type':_0x50a9fd['type'][_0x5be2('0x2f')]};});_0x1edd9e[_0x5be2('0x30')]=_[_0x5be2('0x2c')](_0x271f42,_0x5be2('0x29'));_0x1edd9e[_0x5be2('0x31')]=_[_0x5be2('0x32')](_0x462b71['query']);_0x1edd9e[_0x5be2('0x33')]=_[_0x5be2('0x34')](_0x1edd9e[_0x5be2('0x30')],_0x1edd9e['query']);_0x4518a3[_0x5be2('0x35')]=_['intersection'](_0x1edd9e[_0x5be2('0x30')],qs[_0x5be2('0x36')](_0x462b71[_0x5be2('0x31')]['fields']));_0x4518a3[_0x5be2('0x35')]=_0x4518a3['attributes'][_0x5be2('0x37')]?_0x4518a3[_0x5be2('0x35')]:_0x1edd9e[_0x5be2('0x30')];if(!_0x462b71[_0x5be2('0x31')]['hasOwnProperty'](_0x5be2('0x38'))){_0x4518a3[_0x5be2('0x1d')]=qs[_0x5be2('0x1d')](_0x462b71[_0x5be2('0x31')]['limit']);_0x4518a3['offset']=qs[_0x5be2('0x1a')](_0x462b71[_0x5be2('0x31')]['offset']);}_0x4518a3[_0x5be2('0x39')]=qs[_0x5be2('0x3a')](_0x462b71[_0x5be2('0x31')]['sort']);_0x4518a3[_0x5be2('0x3b')]=qs[_0x5be2('0x33')](_['pick'](_0x462b71[_0x5be2('0x31')],_0x1edd9e['filters']),_0x271f42);if(_0x462b71[_0x5be2('0x31')][_0x5be2('0x3c')]){_0x4518a3[_0x5be2('0x3b')]=_[_0x5be2('0x3d')](_0x4518a3['where'],{'$or':_['map'](_0x271f42,function(_0x146e1b){if(_0x146e1b[_0x5be2('0x3e')]!==_0x5be2('0x3f')){var _0x56c838={};_0x56c838[_0x146e1b['name']]={'$like':'%'+_0x462b71[_0x5be2('0x31')][_0x5be2('0x3c')]+'%'};return _0x56c838;}})});}_0x4518a3=_['merge']({},_0x4518a3,_0x462b71['options']);var _0x70cacc={'where':_0x4518a3[_0x5be2('0x3b')]};return db[_0x5be2('0x2d')][_0x5be2('0x1c')](_0x70cacc)[_0x5be2('0x22')](function(_0xcadd95){_0x3bd8d0[_0x5be2('0x1c')]=_0xcadd95;if(_0x462b71[_0x5be2('0x31')][_0x5be2('0x40')]){_0x4518a3['include']=[{'all':!![]}];}return db[_0x5be2('0x2d')][_0x5be2('0x41')](_0x4518a3);})['then'](function(_0x28df6){_0x3bd8d0[_0x5be2('0x42')]=_0x28df6;return _0x3bd8d0;})[_0x5be2('0x22')](respondWithFilteredResult(_0x1e12b7,_0x4518a3))[_0x5be2('0x43')](handleError(_0x1e12b7,null));};exports[_0x5be2('0x44')]=function(_0x3eaf04,_0x2323af){var _0x574612={'raw':!![],'where':{'id':_0x3eaf04[_0x5be2('0x45')]['id']}},_0x372412={};_0x372412[_0x5be2('0x30')]=_[_0x5be2('0x32')](db[_0x5be2('0x2d')][_0x5be2('0x2e')]);_0x372412['query']=_[_0x5be2('0x32')](_0x3eaf04[_0x5be2('0x31')]);_0x372412[_0x5be2('0x33')]=_[_0x5be2('0x34')](_0x372412[_0x5be2('0x30')],_0x372412['query']);_0x574612[_0x5be2('0x35')]=_[_0x5be2('0x34')](_0x372412[_0x5be2('0x30')],qs[_0x5be2('0x36')](_0x3eaf04[_0x5be2('0x31')]['fields']));_0x574612[_0x5be2('0x35')]=_0x574612['attributes'][_0x5be2('0x37')]?_0x574612[_0x5be2('0x35')]:_0x372412[_0x5be2('0x30')];if(_0x3eaf04[_0x5be2('0x31')][_0x5be2('0x40')]){_0x574612[_0x5be2('0x46')]=[{'all':!![]}];}_0x574612=_[_0x5be2('0x3d')]({},_0x574612,_0x3eaf04['options']);return db['Disposition'][_0x5be2('0x47')](_0x574612)[_0x5be2('0x22')](handleEntityNotFound(_0x2323af,null))['then'](respondWithResult(_0x2323af,null))[_0x5be2('0x43')](handleError(_0x2323af,null));};exports[_0x5be2('0x48')]=function(_0x3e4a48,_0x1dc4b2){return db['Disposition'][_0x5be2('0x48')](_0x3e4a48[_0x5be2('0x49')],{})['then'](function(_0x4e2bf8){var _0x16379c=_0x3e4a48[_0x5be2('0x4a')][_0x5be2('0x24')]({'plain':!![]});if(!_0x16379c)throw new Error(_0x5be2('0x4b'));if(_0x16379c[_0x5be2('0x4c')]===_0x5be2('0x4a')){var _0x7da408=_0x4e2bf8[_0x5be2('0x24')]({'plain':!![]});var _0xebe513=_0x5be2('0x25');return db['UserProfileSection'][_0x5be2('0x47')]({'where':{'name':_0xebe513,'userProfileId':_0x16379c[_0x5be2('0x4d')]},'raw':!![]})['then'](function(_0x2fc75e){if(_0x2fc75e&&_0x2fc75e[_0x5be2('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x7da408[_0x5be2('0x29')],'resourceId':_0x7da408['id'],'type':_0x2fc75e[_0x5be2('0x29')],'sectionId':_0x2fc75e['id']},{})[_0x5be2('0x22')](function(){return _0x4e2bf8;});}else{return _0x4e2bf8;}})['catch'](function(_0x454ce1){logger[_0x5be2('0x27')](_0x5be2('0x4f'),_0x454ce1);throw _0x454ce1;});}return _0x4e2bf8;})['then'](respondWithResult(_0x1dc4b2,0xc9))[_0x5be2('0x43')](handleError(_0x1dc4b2,null));};exports[_0x5be2('0x21')]=function(_0x3d072c,_0x2ac7a6){if(_0x3d072c['body']['id']){delete _0x3d072c[_0x5be2('0x49')]['id'];}return db[_0x5be2('0x2d')][_0x5be2('0x47')]({'where':{'id':_0x3d072c[_0x5be2('0x45')]['id']}})[_0x5be2('0x22')](handleEntityNotFound(_0x2ac7a6,null))[_0x5be2('0x22')](saveUpdates(_0x3d072c['body'],null))[_0x5be2('0x22')](respondWithResult(_0x2ac7a6,null))[_0x5be2('0x43')](handleError(_0x2ac7a6,null));};exports[_0x5be2('0x23')]=function(_0x3275fe,_0x378f59){return db[_0x5be2('0x2d')][_0x5be2('0x47')]({'where':{'id':_0x3275fe[_0x5be2('0x45')]['id']}})['then'](handleEntityNotFound(_0x378f59,null))['then'](removeEntity(_0x378f59,null))[_0x5be2('0x43')](handleError(_0x378f59,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 6681783..0521af6 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 _0xed66=['WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','name_voice','name_chat','name','ChatWebsiteId','MailAccountId','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xed66,0xc7));var _0x6ed6=function(_0x103965,_0x1b794e){_0x103965=_0x103965-0x0;var _0x40c90b=_0xed66[_0x103965];return _0x40c90b;};'use strict';var _=require(_0x6ed6('0x0'));var util=require('util');var logger=require(_0x6ed6('0x1'))(_0x6ed6('0x2'));var moment=require(_0x6ed6('0x3'));var BPromise=require(_0x6ed6('0x4'));var rp=require(_0x6ed6('0x5'));var fs=require('fs');var path=require(_0x6ed6('0x6'));var rimraf=require(_0x6ed6('0x7'));var config=require(_0x6ed6('0x8'));var attributes=require(_0x6ed6('0x9'));module['exports']=function(_0x131af5,_0x29f686){return _0x131af5[_0x6ed6('0xa')](_0x6ed6('0xb'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x6ed6('0xc'),'fields':['name','ListId']},{'unique':!![],'name':_0x6ed6('0xd'),'fields':[_0x6ed6('0xe'),_0x6ed6('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x6ed6('0xe'),_0x6ed6('0x10')]},{'unique':!![],'name':'name_sms','fields':['name',_0x6ed6('0x11')]},{'unique':!![],'name':'name_fax','fields':['name',_0x6ed6('0x12')]},{'unique':!![],'name':_0x6ed6('0x13'),'fields':[_0x6ed6('0xe'),_0x6ed6('0x14')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x6ed6('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4be7=['./disposition.attributes','exports','define','Disposition','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_whatsapp','WhatsappAccountId','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4be7,0x93));var _0x74be=function(_0x2e846d,_0x370cd6){_0x2e846d=_0x2e846d-0x0;var _0x10a6ab=_0x4be7[_0x2e846d];return _0x10a6ab;};'use strict';var _=require('lodash');var util=require(_0x74be('0x0'));var logger=require('../../config/logger')(_0x74be('0x1'));var moment=require('moment');var BPromise=require(_0x74be('0x2'));var rp=require(_0x74be('0x3'));var fs=require('fs');var path=require(_0x74be('0x4'));var rimraf=require(_0x74be('0x5'));var config=require(_0x74be('0x6'));var attributes=require(_0x74be('0x7'));module[_0x74be('0x8')]=function(_0x178f9e,_0x47555e){return _0x178f9e[_0x74be('0x9')](_0x74be('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x74be('0xb'),_0x74be('0xc')]},{'unique':!![],'name':_0x74be('0xd'),'fields':[_0x74be('0xb'),_0x74be('0xe')]},{'unique':!![],'name':_0x74be('0xf'),'fields':[_0x74be('0xb'),_0x74be('0x10')]},{'unique':!![],'name':_0x74be('0x11'),'fields':[_0x74be('0xb'),_0x74be('0x12')]},{'unique':!![],'name':'name_fax','fields':[_0x74be('0xb'),_0x74be('0x13')]},{'unique':!![],'name':'name_openchannel','fields':[_0x74be('0xb'),'OpenchannelAccountId']},{'unique':!![],'name':_0x74be('0x14'),'fields':[_0x74be('0xb'),_0x74be('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index d7ef177..9d48b34 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(_0x3275ee,_0x2e86ce){var _0x556d8c=function(_0x393ebb){while(--_0x393ebb){_0x3275ee['push'](_0x3275ee['shift']());}};_0x556d8c(++_0x2e86ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x382b04,_0x342877){var _0x4c5188=function(_0x43b43f){while(--_0x43b43f){_0x382b04['push'](_0x382b04['shift']());}};_0x4c5188(++_0x342877);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 81667d1..50be6ca 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 _0x8399=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','index','show','post','isAuthenticated','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3659ee,_0x5ad5fb){var _0x345901=function(_0x22fa23){while(--_0x22fa23){_0x3659ee['push'](_0x3659ee['shift']());}};_0x345901(++_0x5ad5fb);}(_0x8399,0x150));var _0x9839=function(_0x869785,_0x2c769b){_0x869785=_0x869785-0x0;var _0x4ddf6a=_0x8399[_0x869785];return _0x4ddf6a;};'use strict';var multer=require(_0x9839('0x0'));var util=require(_0x9839('0x1'));var path=require(_0x9839('0x2'));var timeout=require(_0x9839('0x3'));var express=require('express');var router=express[_0x9839('0x4')]();var fs_extra=require(_0x9839('0x5'));var auth=require(_0x9839('0x6'));var interaction=require(_0x9839('0x7'));var config=require(_0x9839('0x8'));var controller=require(_0x9839('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x9839('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9839('0xb')]);router[_0x9839('0xc')]('/',auth[_0x9839('0xd')](),controller[_0x9839('0xe')]);router[_0x9839('0xf')]('/:id',auth[_0x9839('0xd')](),controller[_0x9839('0x10')]);router['delete'](_0x9839('0x11'),auth[_0x9839('0xd')](),controller[_0x9839('0x12')]);module[_0x9839('0x13')]=router; \ No newline at end of file +var _0x1499=['./disposition.controller','get','/:id','isAuthenticated','show','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x56b35c,_0x59fb99){var _0xae5768=function(_0x4bf57e){while(--_0x4bf57e){_0x56b35c['push'](_0x56b35c['shift']());}};_0xae5768(++_0x59fb99);}(_0x1499,0x118));var _0x9149=function(_0x4583a0,_0x50c521){_0x4583a0=_0x4583a0-0x0;var _0x1453e9=_0x1499[_0x4583a0];return _0x1453e9;};'use strict';var multer=require(_0x9149('0x0'));var util=require(_0x9149('0x1'));var path=require(_0x9149('0x2'));var timeout=require(_0x9149('0x3'));var express=require(_0x9149('0x4'));var router=express[_0x9149('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9149('0x6'));var config=require(_0x9149('0x7'));var controller=require(_0x9149('0x8'));router[_0x9149('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9149('0x9')](_0x9149('0xa'),auth[_0x9149('0xb')](),controller[_0x9149('0xc')]);router['post']('/',auth[_0x9149('0xb')](),controller['create']);router['put'](_0x9149('0xa'),auth[_0x9149('0xb')](),controller[_0x9149('0xd')]);router['delete'](_0x9149('0xa'),auth[_0x9149('0xb')](),controller[_0x9149('0xe')]);module[_0x9149('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 7d8e750..715a292 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 _0x4c60=['STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800','7200','9600','12000','14400','2400','INTEGER','SIP','DADHI','KHOMP','TEXT','BOOLEAN','setDataValue','sequelize','exports'];(function(_0x249d99,_0x16b584){var _0x5bfb05=function(_0x4f4d67){while(--_0x4f4d67){_0x249d99['push'](_0x249d99['shift']());}};_0x5bfb05(++_0x16b584);}(_0x4c60,0x166));var _0x04c6=function(_0x41bdd9,_0x4a92f1){_0x41bdd9=_0x41bdd9-0x0;var _0x23894a=_0x4c60[_0x41bdd9];return _0x23894a;};'use strict';var Sequelize=require(_0x04c6('0x0'));module[_0x04c6('0x1')]={'name':{'type':Sequelize[_0x04c6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x04c6('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x04c6('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x04c6('0x4')},'localstationid':{'type':Sequelize[_0x04c6('0x2')],'unique':_0x04c6('0x5')},'minrate':{'type':Sequelize[_0x04c6('0x6')]('2400',_0x04c6('0x7'),_0x04c6('0x8'),_0x04c6('0x9'),_0x04c6('0xa'),_0x04c6('0xb')),'defaultValue':_0x04c6('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0x04c6('0xc'),_0x04c6('0x7'),_0x04c6('0x8'),_0x04c6('0x9'),_0x04c6('0xa'),'14400'),'defaultValue':_0x04c6('0xb')},'modem':{'type':Sequelize[_0x04c6('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x04c6('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x04c6('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x04c6('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x04c6('0x6')](_0x04c6('0xe'),'IAX',_0x04c6('0xf'),_0x04c6('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x04c6('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x04c6('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[_0x04c6('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x04c6('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x04c6('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x04c6('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x04c6('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x04c6('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x04c6('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x37cf3c){if(!_0x37cf3c)this[_0x04c6('0x13')]('mandatoryDispositionPauseId',null);this[_0x04c6('0x13')]('mandatoryDisposition',_0x37cf3c);}}}; \ No newline at end of file +var _0x8f64=['14400','v17,v27,v29','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','ENUM','localstationid','4800','7200','9600','12000','2400'];(function(_0x398b7c,_0x139757){var _0x32146f=function(_0x119f33){while(--_0x119f33){_0x398b7c['push'](_0x398b7c['shift']());}};_0x32146f(++_0x139757);}(_0x8f64,0xbd));var _0x48f6=function(_0x2e2fd4,_0xf80b13){_0x2e2fd4=_0x2e2fd4-0x0;var _0x182699=_0x8f64[_0x2e2fd4];return _0x182699;};'use strict';var Sequelize=require('sequelize');module[_0x48f6('0x0')]={'name':{'type':Sequelize[_0x48f6('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x48f6('0x1')]},'ecm':{'type':Sequelize[_0x48f6('0x2')]('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x48f6('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x48f6('0x1')],'unique':_0x48f6('0x3')},'minrate':{'type':Sequelize[_0x48f6('0x2')]('2400',_0x48f6('0x4'),_0x48f6('0x5'),_0x48f6('0x6'),_0x48f6('0x7'),'14400'),'defaultValue':_0x48f6('0x4')},'maxrate':{'type':Sequelize[_0x48f6('0x2')](_0x48f6('0x8'),_0x48f6('0x4'),_0x48f6('0x5'),_0x48f6('0x6'),_0x48f6('0x7'),_0x48f6('0x9')),'defaultValue':_0x48f6('0x9')},'modem':{'type':Sequelize[_0x48f6('0x1')],'defaultValue':_0x48f6('0xa')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x48f6('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x48f6('0x2')](_0x48f6('0xb'),_0x48f6('0xc'),_0x48f6('0xd'),_0x48f6('0xe')),'defaultValue':_0x48f6('0xb')},'key':{'type':Sequelize[_0x48f6('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x48f6('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x48f6('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x48f6('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x48f6('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x48f6('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x48f6('0x11')],'allowNull':!![],'defaultValue':null,'comment':_0x48f6('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x48f6('0x10')],'defaultValue':![],'comment':_0x48f6('0x13'),'set':function(_0x591209){if(!_0x591209)this[_0x48f6('0x14')]('mandatoryDispositionPauseId',null);this[_0x48f6('0x14')](_0x48f6('0x15'),_0x591209);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index e9efec1..3c24311 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 _0xd57c=['user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','FaxInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','stack','finally','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','key','createdAt','updatedAt','TrunkId','ListId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','name','send','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','show','params','Pause','length','find','create','body'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0xd57c,0x1e9));var _0xcd57=function(_0x254744,_0x219e6b){_0x254744=_0x254744-0x0;var _0x2a6a96=_0xd57c[_0x254744];return _0x2a6a96;};'use strict';var emlformat=require(_0xcd57('0x0'));var rimraf=require(_0xcd57('0x1'));var zipdir=require(_0xcd57('0x2'));var jsonpatch=require(_0xcd57('0x3'));var rp=require(_0xcd57('0x4'));var moment=require(_0xcd57('0x5'));var BPromise=require(_0xcd57('0x6'));var Mustache=require('mustache');var util=require(_0xcd57('0x7'));var path=require(_0xcd57('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcd57('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd57('0xa'));var squel=require(_0xcd57('0xb'));var crypto=require('crypto');var jsforce=require(_0xcd57('0xc'));var deskjs=require(_0xcd57('0xd'));var toCsv=require(_0xcd57('0xe'));var querystring=require('querystring');var Papa=require(_0xcd57('0xf'));var Redis=require(_0xcd57('0x10'));var authService=require(_0xcd57('0x11'));var qs=require(_0xcd57('0x12'));var as=require(_0xcd57('0x13'));var hardwareService=require(_0xcd57('0x14'));var logger=require(_0xcd57('0x15'))('api');var utils=require(_0xcd57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xcd57('0x17')],{'host':_0xcd57('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcd57('0x17')]));require(_0xcd57('0x19'))[_0xcd57('0x1a')](socket);var jayson=require(_0xcd57('0x1b'));var client=jayson[_0xcd57('0x1c')][_0xcd57('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xcd57('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3b0c43,_0x8296b4,_0x1fb189,_0x4cbc71){return new BPromise(function(_0x1839cd,_0xc7d126){var _0x5a063a=_0x4cbc71||client;return _0x5a063a[_0xcd57('0x1e')](_0x3b0c43,_0x1fb189)[_0xcd57('0x1f')](function(_0x2fc19c){logger[_0xcd57('0x20')]('FaxAccount,\x20%s,\x20%s',_0x8296b4,'request\x20sent');logger['debug'](_0xcd57('0x21'),_0x8296b4,_0xcd57('0x22'),JSON[_0xcd57('0x23')](_0x2fc19c));if(_0x2fc19c['error']){if(_0x2fc19c['error'][_0xcd57('0x24')]===0x1f4){logger[_0xcd57('0x25')](_0xcd57('0x26'),_0x8296b4,_0x2fc19c[_0xcd57('0x25')]['message']);return _0xc7d126(_0x2fc19c[_0xcd57('0x25')]['message']);}logger[_0xcd57('0x25')]('FaxAccount,\x20%s,\x20%s',_0x8296b4,_0x2fc19c[_0xcd57('0x25')]['message']);return _0x1839cd(_0x2fc19c[_0xcd57('0x25')][_0xcd57('0x27')]);}else{logger[_0xcd57('0x20')](_0xcd57('0x26'),_0x8296b4,_0xcd57('0x22'));_0x1839cd(_0x2fc19c[_0xcd57('0x28')]['message']);}})[_0xcd57('0x29')](function(_0x1f4868){logger[_0xcd57('0x25')](_0xcd57('0x26'),_0x8296b4,_0x1f4868);_0xc7d126(_0x1f4868);});});}function respondWithStatusCode(_0x579184,_0xff2097){_0xff2097=_0xff2097||0xcc;return function(_0xdc59d4){if(_0xdc59d4){return _0x579184[_0xcd57('0x2a')](_0xff2097);}return _0x579184[_0xcd57('0x2b')](_0xff2097)[_0xcd57('0x2c')]();};}function respondWithResult(_0x183dec,_0x39f80a){_0x39f80a=_0x39f80a||0xc8;return function(_0x11daf4){if(_0x11daf4){return _0x183dec['status'](_0x39f80a)['json'](_0x11daf4);}};}function respondWithFilteredResult(_0x91665,_0x3847b9){return function(_0x39538f){if(_0x39538f){var _0x2c1d8a=typeof _0x3847b9[_0xcd57('0x2d')]===_0xcd57('0x2e')&&typeof _0x3847b9[_0xcd57('0x2f')]===_0xcd57('0x2e');var _0xb23e73=_0x39538f[_0xcd57('0x30')];var _0x647405=_0x2c1d8a?0x0:_0x3847b9[_0xcd57('0x2d')];var _0x24eb40=_0x2c1d8a?_0x39538f[_0xcd57('0x30')]:_0x3847b9[_0xcd57('0x2d')]+_0x3847b9[_0xcd57('0x2f')];var _0x55d2a8;if(_0x24eb40>=_0xb23e73){_0x24eb40=_0xb23e73;_0x55d2a8=0xc8;}else{_0x55d2a8=0xce;}_0x91665[_0xcd57('0x2b')](_0x55d2a8);return _0x91665[_0xcd57('0x31')](_0xcd57('0x32'),_0x647405+'-'+_0x24eb40+'/'+_0xb23e73)[_0xcd57('0x33')](_0x39538f);}return null;};}function patchUpdates(_0x2d9549){return function(_0x5164fc){try{jsonpatch['apply'](_0x5164fc,_0x2d9549,!![]);}catch(_0x5c162f){return BPromise[_0xcd57('0x34')](_0x5c162f);}return _0x5164fc[_0xcd57('0x35')]();};}function saveUpdates(_0x294b16,_0x589d89){return function(_0xa3fa89){if(_0xa3fa89){return _0xa3fa89[_0xcd57('0x36')](_0x294b16)[_0xcd57('0x1f')](function(_0x5042c0){return _0x5042c0;});}return null;};}function removeEntity(_0x45c139,_0x1ebdc2){return function(_0x42f9fa){if(_0x42f9fa){return _0x42f9fa[_0xcd57('0x37')]()[_0xcd57('0x1f')](function(){var _0x42601a=_0x42f9fa[_0xcd57('0x38')]({'plain':!![]});var _0x2e7f3d=_0xcd57('0x39');return db[_0xcd57('0x3a')][_0xcd57('0x37')]({'where':{'type':_0x2e7f3d,'resourceId':_0x42601a['id']}})[_0xcd57('0x1f')](function(){return _0x42f9fa;});})[_0xcd57('0x1f')](function(){_0x45c139['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x215205,_0x187b08){return function(_0x284ced){if(!_0x284ced){_0x215205[_0xcd57('0x2a')](0x194);}return _0x284ced;};}function handleError(_0x5b5a22,_0x500ea5){_0x500ea5=_0x500ea5||0x1f4;return function(_0x1ccb62){logger['error'](_0x1ccb62['stack']);if(_0x1ccb62[_0xcd57('0x3b')]){delete _0x1ccb62['name'];}_0x5b5a22['status'](_0x500ea5)[_0xcd57('0x3c')](_0x1ccb62);};}exports['index']=function(_0x17df9a,_0x493c3a){var _0x4ad857={'include':[{'model':db['Pause'],'as':_0xcd57('0x3d')}]},_0x93ffd9={},_0x4765eb={'count':0x0,'rows':[]};var _0x174b66=_[_0xcd57('0x3e')](db[_0xcd57('0x3f')][_0xcd57('0x40')],function(_0x217980){return{'name':_0x217980[_0xcd57('0x41')],'type':_0x217980[_0xcd57('0x42')]['key']};});_0x93ffd9[_0xcd57('0x43')]=_['map'](_0x174b66,'name');_0x93ffd9['query']=_[_0xcd57('0x44')](_0x17df9a[_0xcd57('0x45')]);_0x93ffd9[_0xcd57('0x46')]=_[_0xcd57('0x47')](_0x93ffd9[_0xcd57('0x43')],_0x93ffd9[_0xcd57('0x45')]);_0x4ad857[_0xcd57('0x48')]=_[_0xcd57('0x47')](_0x93ffd9[_0xcd57('0x43')],qs[_0xcd57('0x49')](_0x17df9a[_0xcd57('0x45')]['fields']));_0x4ad857['attributes']=_0x4ad857['attributes']['length']?_0x4ad857[_0xcd57('0x48')]:_0x93ffd9[_0xcd57('0x43')];if(!_0x17df9a[_0xcd57('0x45')][_0xcd57('0x4a')](_0xcd57('0x4b'))){_0x4ad857[_0xcd57('0x2f')]=qs[_0xcd57('0x2f')](_0x17df9a[_0xcd57('0x45')][_0xcd57('0x2f')]);_0x4ad857[_0xcd57('0x2d')]=qs['offset'](_0x17df9a[_0xcd57('0x45')][_0xcd57('0x2d')]);}_0x4ad857['order']=qs[_0xcd57('0x4c')](_0x17df9a[_0xcd57('0x45')][_0xcd57('0x4c')]);_0x4ad857['where']=qs[_0xcd57('0x46')](_[_0xcd57('0x4d')](_0x17df9a[_0xcd57('0x45')],_0x93ffd9[_0xcd57('0x46')]),_0x174b66);if(_0x17df9a[_0xcd57('0x45')]['filter']){_0x4ad857[_0xcd57('0x4e')]=_[_0xcd57('0x4f')](_0x4ad857[_0xcd57('0x4e')],{'$or':_['map'](_0x174b66,function(_0x5bd33e){if(_0x5bd33e['type']!=='VIRTUAL'){var _0x451a46={};_0x451a46[_0x5bd33e[_0xcd57('0x3b')]]={'$like':'%'+_0x17df9a[_0xcd57('0x45')][_0xcd57('0x50')]+'%'};return _0x451a46;}})});}_0x4ad857=_[_0xcd57('0x4f')]({},_0x4ad857,_0x17df9a[_0xcd57('0x51')]);var _0xfd08={'where':_0x4ad857[_0xcd57('0x4e')]};return db[_0xcd57('0x3f')][_0xcd57('0x30')](_0xfd08)[_0xcd57('0x1f')](function(_0x455779){_0x4765eb[_0xcd57('0x30')]=_0x455779;if(_0x17df9a[_0xcd57('0x45')][_0xcd57('0x52')]){_0x4ad857[_0xcd57('0x53')]=[{'all':!![]}];}return db[_0xcd57('0x3f')][_0xcd57('0x54')](_0x4ad857);})[_0xcd57('0x1f')](function(_0x47120d){_0x4765eb[_0xcd57('0x55')]=_0x47120d;return _0x4765eb;})[_0xcd57('0x1f')](respondWithFilteredResult(_0x493c3a,_0x4ad857))[_0xcd57('0x29')](handleError(_0x493c3a,null));};exports[_0xcd57('0x56')]=function(_0x5a7ade,_0x3ab734){var _0x3a9c00={'raw':![],'where':{'id':_0x5a7ade[_0xcd57('0x57')]['id']},'include':[{'model':db[_0xcd57('0x58')],'as':'mandatoryDispositionPause'}]},_0x1aa16f={};_0x1aa16f['model']=_['keys'](db['FaxAccount'][_0xcd57('0x40')]);_0x1aa16f[_0xcd57('0x45')]=_['keys'](_0x5a7ade[_0xcd57('0x45')]);_0x1aa16f['filters']=_[_0xcd57('0x47')](_0x1aa16f['model'],_0x1aa16f[_0xcd57('0x45')]);_0x3a9c00[_0xcd57('0x48')]=_['intersection'](_0x1aa16f['model'],qs[_0xcd57('0x49')](_0x5a7ade[_0xcd57('0x45')][_0xcd57('0x49')]));_0x3a9c00[_0xcd57('0x48')]=_0x3a9c00[_0xcd57('0x48')][_0xcd57('0x59')]?_0x3a9c00[_0xcd57('0x48')]:_0x1aa16f[_0xcd57('0x43')];if(_0x5a7ade[_0xcd57('0x45')][_0xcd57('0x52')]){_0x3a9c00[_0xcd57('0x53')]=[{'all':!![]}];}_0x3a9c00=_['merge']({},_0x3a9c00,_0x5a7ade[_0xcd57('0x51')]);return db['FaxAccount'][_0xcd57('0x5a')](_0x3a9c00)['then'](handleEntityNotFound(_0x3ab734,null))[_0xcd57('0x1f')](respondWithResult(_0x3ab734,null))[_0xcd57('0x29')](handleError(_0x3ab734,null));};exports[_0xcd57('0x5b')]=function(_0x3af285,_0x1ceab6){return db[_0xcd57('0x3f')][_0xcd57('0x5b')](_0x3af285[_0xcd57('0x5c')],{})['then'](function(_0x41e219){var _0x2434f0=_0x3af285[_0xcd57('0x5d')][_0xcd57('0x38')]({'plain':!![]});if(!_0x2434f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2434f0[_0xcd57('0x5e')]===_0xcd57('0x5d')){var _0x2a84c5=_0x41e219[_0xcd57('0x38')]({'plain':!![]});var _0x12c12d=_0xcd57('0x39');return db['UserProfileSection'][_0xcd57('0x5a')]({'where':{'name':_0x12c12d,'userProfileId':_0x2434f0[_0xcd57('0x5f')]},'raw':!![]})[_0xcd57('0x1f')](function(_0x57c3a0){if(_0x57c3a0&&_0x57c3a0[_0xcd57('0x60')]===0x0){return db[_0xcd57('0x3a')][_0xcd57('0x5b')]({'name':_0x2a84c5[_0xcd57('0x3b')],'resourceId':_0x2a84c5['id'],'type':_0x57c3a0[_0xcd57('0x3b')],'sectionId':_0x57c3a0['id']},{})[_0xcd57('0x1f')](function(){return _0x41e219;});}else{return _0x41e219;}})[_0xcd57('0x29')](function(_0x4be953){logger[_0xcd57('0x25')](_0xcd57('0x61'),_0x4be953);throw _0x4be953;});}return _0x41e219;})[_0xcd57('0x1f')](respondWithResult(_0x1ceab6,0xc9))[_0xcd57('0x29')](handleError(_0x1ceab6,null));};exports[_0xcd57('0x36')]=function(_0x420e92,_0x5c5d81){if(_0x420e92[_0xcd57('0x5c')]['id']){delete _0x420e92['body']['id'];}return db[_0xcd57('0x3f')][_0xcd57('0x5a')]({'where':{'id':_0x420e92[_0xcd57('0x57')]['id']},'include':[{'model':db[_0xcd57('0x58')],'as':_0xcd57('0x3d')}]})[_0xcd57('0x1f')](handleEntityNotFound(_0x5c5d81,null))[_0xcd57('0x1f')](saveUpdates(_0x420e92[_0xcd57('0x5c')],null))['then'](respondWithResult(_0x5c5d81,null))[_0xcd57('0x29')](handleError(_0x5c5d81,null));};exports[_0xcd57('0x37')]=function(_0xce44fd,_0x3921d4){return db[_0xcd57('0x3f')][_0xcd57('0x5a')]({'where':{'id':_0xce44fd[_0xcd57('0x57')]['id']}})[_0xcd57('0x1f')](handleEntityNotFound(_0x3921d4,null))[_0xcd57('0x1f')](removeEntity(_0x3921d4,null))['catch'](handleError(_0x3921d4,null));};exports[_0xcd57('0x62')]=function(_0x25f314,_0x43b592){return db[_0xcd57('0x3f')][_0xcd57('0x62')]()[_0xcd57('0x1f')](respondWithResult(_0x43b592,null))[_0xcd57('0x29')](handleError(_0x43b592,null));};exports[_0xcd57('0x63')]=function(_0x48594a,_0x5bbc6f,_0x5b0dba){if(_0x48594a[_0xcd57('0x5c')]['id']){delete _0x48594a[_0xcd57('0x5c')]['id'];}return db[_0xcd57('0x3f')][_0xcd57('0x5a')]({'where':{'id':_0x48594a['params']['id']}})[_0xcd57('0x1f')](handleEntityNotFound(_0x5bbc6f,null))[_0xcd57('0x1f')](function(_0x11ab47){if(_0x11ab47){_0x48594a[_0xcd57('0x5c')][_0xcd57('0x64')]=_0x11ab47['id'];return db[_0xcd57('0x65')][_0xcd57('0x5b')](_0x48594a['body']);}})[_0xcd57('0x1f')](respondWithResult(_0x5bbc6f,null))[_0xcd57('0x29')](handleError(_0x5bbc6f,null));};exports[_0xcd57('0x66')]=function(_0x138c7e,_0xb8dea9,_0x81e1a5){var _0x2b8631={'raw':![],'where':{}};var _0x3e0aaa={};var _0x321ba8={'count':0x0,'rows':[]};return db['FaxAccount'][_0xcd57('0x67')]({'where':{'id':_0x138c7e[_0xcd57('0x57')]['id']}})[_0xcd57('0x1f')](handleEntityNotFound(_0xb8dea9,null))[_0xcd57('0x1f')](function(_0x4d686f){if(_0x4d686f){_0x3e0aaa['model']=_[_0xcd57('0x44')](db[_0xcd57('0x65')][_0xcd57('0x40')]);_0x3e0aaa[_0xcd57('0x45')]=_[_0xcd57('0x44')](_0x138c7e['query']);_0x3e0aaa['filters']=_[_0xcd57('0x47')](_0x3e0aaa[_0xcd57('0x43')],_0x3e0aaa['query']);_0x2b8631[_0xcd57('0x48')]=_[_0xcd57('0x47')](_0x3e0aaa[_0xcd57('0x43')],qs['fields'](_0x138c7e[_0xcd57('0x45')]['fields']));_0x2b8631[_0xcd57('0x48')]=_0x2b8631[_0xcd57('0x48')][_0xcd57('0x59')]?_0x2b8631['attributes']:_0x3e0aaa[_0xcd57('0x43')];if(!_0x138c7e['query']['hasOwnProperty']('nolimit')){_0x2b8631['limit']=qs[_0xcd57('0x2f')](_0x138c7e[_0xcd57('0x45')][_0xcd57('0x2f')]);_0x2b8631['offset']=qs[_0xcd57('0x2d')](_0x138c7e[_0xcd57('0x45')][_0xcd57('0x2d')]);}_0x2b8631['order']=qs[_0xcd57('0x4c')](_0x138c7e[_0xcd57('0x45')][_0xcd57('0x4c')]);_0x2b8631['where']=qs[_0xcd57('0x46')](_['pick'](_0x138c7e['query'],_0x3e0aaa[_0xcd57('0x46')]));_0x2b8631[_0xcd57('0x4e')][_0xcd57('0x64')]=_0x4d686f['id'];if(_0x138c7e[_0xcd57('0x45')]['filter']){_0x2b8631[_0xcd57('0x4e')]=_[_0xcd57('0x4f')](_0x2b8631[_0xcd57('0x4e')],{'$or':_['map'](_0x2b8631[_0xcd57('0x48')],function(_0x52a87e){var _0x2a7d55={};_0x2a7d55[_0x52a87e]={'$like':'%'+_0x138c7e[_0xcd57('0x45')][_0xcd57('0x50')]+'%'};return _0x2a7d55;})});}_0x2b8631=_[_0xcd57('0x4f')]({},_0x2b8631,_0x138c7e['options']);return db['Disposition'][_0xcd57('0x30')]({'where':_0x2b8631[_0xcd57('0x4e')]})[_0xcd57('0x1f')](function(_0x1b0754){_0x321ba8[_0xcd57('0x30')]=_0x1b0754;if(_0x138c7e[_0xcd57('0x45')]['includeAll']){_0x2b8631[_0xcd57('0x53')]=[{'all':!![]}];}return db[_0xcd57('0x65')][_0xcd57('0x54')](_0x2b8631);})['then'](function(_0x5dc7c8){_0x321ba8[_0xcd57('0x55')]=_0x5dc7c8;return _0x321ba8;});}})[_0xcd57('0x1f')](respondWithFilteredResult(_0xb8dea9,_0x2b8631))[_0xcd57('0x29')](handleError(_0xb8dea9,null));};exports[_0xcd57('0x68')]=function(_0x2cc751,_0x35b18d,_0xbd3a6a){return db[_0xcd57('0x3f')]['find']({'where':{'id':_0x2cc751['params']['id']}})[_0xcd57('0x1f')](handleEntityNotFound(_0x35b18d,null))[_0xcd57('0x1f')](function(_0x2a0958){if(_0x2a0958){return _0x2a0958['removeDispositions'](_0x2cc751[_0xcd57('0x45')][_0xcd57('0x69')]);}})[_0xcd57('0x1f')](respondWithStatusCode(_0x35b18d,null))[_0xcd57('0x29')](handleError(_0x35b18d,null));};exports[_0xcd57('0x6a')]=function(_0x26b50b,_0x3f64e3,_0x4ca587){if(_0x26b50b[_0xcd57('0x5c')]['id']){delete _0x26b50b['body']['id'];}return db[_0xcd57('0x3f')]['find']({'where':{'id':_0x26b50b['params']['id']}})[_0xcd57('0x1f')](handleEntityNotFound(_0x3f64e3,null))['then'](function(_0x41715e){if(_0x41715e){_0x26b50b[_0xcd57('0x5c')][_0xcd57('0x64')]=_0x41715e['id'];return db[_0xcd57('0x6b')][_0xcd57('0x5b')](_0x26b50b[_0xcd57('0x5c')]);}})[_0xcd57('0x1f')](respondWithResult(_0x3f64e3,null))[_0xcd57('0x29')](handleError(_0x3f64e3,null));};exports[_0xcd57('0x6c')]=function(_0x7a9c37,_0x5dc8fd,_0x451205){var _0xbf9960={'raw':![],'where':{}};var _0x581b81={};var _0x5516cb={'count':0x0,'rows':[]};return db['FaxAccount'][_0xcd57('0x67')]({'where':{'id':_0x7a9c37[_0xcd57('0x57')]['id']}})['then'](handleEntityNotFound(_0x5dc8fd,null))[_0xcd57('0x1f')](function(_0x1f8115){if(_0x1f8115){_0x581b81[_0xcd57('0x43')]=_[_0xcd57('0x44')](db[_0xcd57('0x6b')][_0xcd57('0x40')]);_0x581b81['query']=_[_0xcd57('0x44')](_0x7a9c37[_0xcd57('0x45')]);_0x581b81[_0xcd57('0x46')]=_[_0xcd57('0x47')](_0x581b81[_0xcd57('0x43')],_0x581b81[_0xcd57('0x45')]);_0xbf9960[_0xcd57('0x48')]=_['intersection'](_0x581b81[_0xcd57('0x43')],qs['fields'](_0x7a9c37[_0xcd57('0x45')][_0xcd57('0x49')]));_0xbf9960['attributes']=_0xbf9960[_0xcd57('0x48')][_0xcd57('0x59')]?_0xbf9960[_0xcd57('0x48')]:_0x581b81[_0xcd57('0x43')];if(!_0x7a9c37[_0xcd57('0x45')][_0xcd57('0x4a')](_0xcd57('0x4b'))){_0xbf9960[_0xcd57('0x2f')]=qs[_0xcd57('0x2f')](_0x7a9c37[_0xcd57('0x45')][_0xcd57('0x2f')]);_0xbf9960[_0xcd57('0x2d')]=qs[_0xcd57('0x2d')](_0x7a9c37[_0xcd57('0x45')][_0xcd57('0x2d')]);}_0xbf9960[_0xcd57('0x6d')]=qs['sort'](_0x7a9c37['query']['sort']);_0xbf9960[_0xcd57('0x4e')]=qs[_0xcd57('0x46')](_[_0xcd57('0x4d')](_0x7a9c37['query'],_0x581b81[_0xcd57('0x46')]));_0xbf9960['where'][_0xcd57('0x64')]=_0x1f8115['id'];if(_0x7a9c37[_0xcd57('0x45')][_0xcd57('0x50')]){_0xbf9960[_0xcd57('0x4e')]=_[_0xcd57('0x4f')](_0xbf9960['where'],{'$or':_[_0xcd57('0x3e')](_0xbf9960[_0xcd57('0x48')],function(_0x25ceba){var _0x15d82b={};_0x15d82b[_0x25ceba]={'$like':'%'+_0x7a9c37[_0xcd57('0x45')]['filter']+'%'};return _0x15d82b;})});}_0xbf9960=_['merge']({},_0xbf9960,_0x7a9c37[_0xcd57('0x51')]);return db[_0xcd57('0x6b')][_0xcd57('0x30')]({'where':_0xbf9960[_0xcd57('0x4e')]})[_0xcd57('0x1f')](function(_0x12eb1e){_0x5516cb[_0xcd57('0x30')]=_0x12eb1e;if(_0x7a9c37[_0xcd57('0x45')][_0xcd57('0x52')]){_0xbf9960[_0xcd57('0x53')]=[{'all':!![]}];}return db[_0xcd57('0x6b')]['findAll'](_0xbf9960);})[_0xcd57('0x1f')](function(_0x368b94){_0x5516cb[_0xcd57('0x55')]=_0x368b94;return _0x5516cb;});}})['then'](respondWithFilteredResult(_0x5dc8fd,_0xbf9960))[_0xcd57('0x29')](handleError(_0x5dc8fd,null));};exports['removeAnswers']=function(_0x48eb81,_0x427b51,_0x1f6add){return db[_0xcd57('0x3f')][_0xcd57('0x5a')]({'where':{'id':_0x48eb81['params']['id']}})[_0xcd57('0x1f')](handleEntityNotFound(_0x427b51,null))[_0xcd57('0x1f')](function(_0x12c6be){if(_0x12c6be){return _0x12c6be['removeAnswers'](_0x48eb81[_0xcd57('0x45')][_0xcd57('0x69')]);}})[_0xcd57('0x1f')](respondWithStatusCode(_0x427b51,null))[_0xcd57('0x29')](handleError(_0x427b51,null));};exports['addInteraction']=function(_0x58746c,_0x3122bb,_0x258082){return db[_0xcd57('0x6e')][_0xcd57('0x5a')]({'where':{'id':_0x58746c[_0xcd57('0x57')]['id']}})[_0xcd57('0x1f')](handleEntityNotFound(_0x3122bb,null))[_0xcd57('0x1f')](function(_0x41279f){if(_0x41279f){return _0x41279f['addInteraction'](_0x58746c[_0xcd57('0x5c')]['ids'],_[_0xcd57('0x6f')](_0x58746c[_0xcd57('0x5c')],[_0xcd57('0x69'),'id'])||{});}})[_0xcd57('0x1f')](respondWithResult(_0x3122bb,null))[_0xcd57('0x29')](handleError(_0x3122bb,null));};exports['getInteractions']=function(_0x296eb9,_0x574eea,_0x11cc7e){var _0x551cb8={'raw':![],'where':{}};var _0x35198b={};var _0x25f4f0={'count':0x0,'rows':[]};return db[_0xcd57('0x3f')][_0xcd57('0x67')]({'where':{'id':_0x296eb9[_0xcd57('0x57')]['id']}})['then'](handleEntityNotFound(_0x574eea,null))['then'](function(_0x47a242){if(_0x47a242){_0x35198b['model']=_[_0xcd57('0x44')](db[_0xcd57('0x6e')][_0xcd57('0x40')]);_0x35198b['query']=_['keys'](_0x296eb9[_0xcd57('0x45')]);_0x35198b['filters']=_[_0xcd57('0x47')](_0x35198b[_0xcd57('0x43')],_0x35198b[_0xcd57('0x45')]);_0x551cb8['attributes']=_['intersection'](_0x35198b[_0xcd57('0x43')],qs[_0xcd57('0x49')](_0x296eb9[_0xcd57('0x45')][_0xcd57('0x49')]));_0x551cb8[_0xcd57('0x48')]=_0x551cb8[_0xcd57('0x48')][_0xcd57('0x59')]?_0x551cb8[_0xcd57('0x48')]:_0x35198b[_0xcd57('0x43')];if(!_0x296eb9['query'][_0xcd57('0x4a')]('nolimit')){_0x551cb8[_0xcd57('0x2f')]=qs[_0xcd57('0x2f')](_0x296eb9[_0xcd57('0x45')][_0xcd57('0x2f')]);_0x551cb8[_0xcd57('0x2d')]=qs[_0xcd57('0x2d')](_0x296eb9['query'][_0xcd57('0x2d')]);}_0x551cb8['order']=qs[_0xcd57('0x4c')](_0x296eb9[_0xcd57('0x45')][_0xcd57('0x4c')]);_0x551cb8['where']=qs[_0xcd57('0x46')](_[_0xcd57('0x4d')](_0x296eb9[_0xcd57('0x45')],_0x35198b[_0xcd57('0x46')]));_0x551cb8[_0xcd57('0x4e')][_0xcd57('0x64')]=_0x47a242['id'];if(_0x296eb9['query']['filter']){_0x551cb8[_0xcd57('0x4e')]=_[_0xcd57('0x4f')](_0x551cb8['where'],{'$or':_[_0xcd57('0x3e')](_0x551cb8[_0xcd57('0x48')],function(_0x66f805){var _0x236eb8={};_0x236eb8[_0x66f805]={'$like':'%'+_0x296eb9[_0xcd57('0x45')][_0xcd57('0x50')]+'%'};return _0x236eb8;})});}_0x551cb8=_[_0xcd57('0x4f')]({},_0x551cb8,_0x296eb9[_0xcd57('0x51')]);return db[_0xcd57('0x6e')][_0xcd57('0x30')]({'where':_0x551cb8['where']})[_0xcd57('0x1f')](function(_0x3bba49){_0x25f4f0[_0xcd57('0x30')]=_0x3bba49;if(_0x296eb9[_0xcd57('0x45')]['includeAll']){_0x551cb8[_0xcd57('0x53')]=[{'model':db[_0xcd57('0x70')],'as':_0xcd57('0x71'),'required':![]},{'model':db[_0xcd57('0x72')],'as':_0xcd57('0x73'),'attributes':['name',_0xcd57('0x74'),_0xcd57('0x75')],'required':![]},{'model':db[_0xcd57('0x76')],'as':'Tags','attributes':['id','name',_0xcd57('0x77')],'where':_0x296eb9['query'][_0xcd57('0x78')]?{'id':_0x296eb9[_0xcd57('0x45')][_0xcd57('0x78')]}:undefined,'required':_0x296eb9[_0xcd57('0x45')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0xcd57('0x54')](_0x551cb8);})[_0xcd57('0x1f')](function(_0x2b8de0){_0x25f4f0['rows']=_0x2b8de0;return _0x25f4f0;});}})[_0xcd57('0x1f')](respondWithFilteredResult(_0x574eea,_0x551cb8))[_0xcd57('0x29')](handleError(_0x574eea,null));};exports['addApplications']=function(_0x49d0a2,_0xa58924){var _0x364651=_0x49d0a2['params']['id'];var _0x1a0b0f=_0x49d0a2['body'];var _0x2ccb7f=0xc8;var _0x3b15a6=null;return db[_0xcd57('0x79')][_0xcd57('0x7a')]({'isolationLevel':db[_0xcd57('0x79')]['Transaction'][_0xcd57('0x7b')][_0xcd57('0x7c')]},function(_0x322c46){return db[_0xcd57('0x3f')][_0xcd57('0x67')]({'where':{'id':_0x364651},'transaction':_0x322c46})['then'](function(_0x505dd2){if(_0x505dd2){return db['FaxApplication'][_0xcd57('0x37')]({'where':{'FaxAccountId':_0x364651},'transaction':_0x322c46})[_0xcd57('0x1f')](function(){var _0x26e77e=_[_0xcd57('0x3e')](_0x1a0b0f,function(_0x3d706f){_0x3d706f['FaxAccountId']=_0x364651;return _0x3d706f;});return db[_0xcd57('0x7d')]['bulkCreate'](_0x26e77e,{'transaction':_0x322c46});});}else{_0x2ccb7f=0x194;_0x3b15a6=[];}});})[_0xcd57('0x1f')](function(){if(_0x2ccb7f!==0x194){return db[_0xcd57('0x7d')][_0xcd57('0x7e')]({'where':{'FaxAccountId':_0x364651},'order':_0xcd57('0x7f')})[_0xcd57('0x1f')](function(_0x1b1fc5){_0x3b15a6=_0x1b1fc5;});}})['catch'](function(_0x1f7b6b){_0x2ccb7f=0x1f4;logger['error'](_0x1f7b6b[_0xcd57('0x80')]);if(_0x1f7b6b[_0xcd57('0x3b')]){delete _0x1f7b6b['name'];}_0x3b15a6=_0x1f7b6b;})[_0xcd57('0x81')](function(){if(_0x3b15a6===null){_0xa58924[_0xcd57('0x2a')](_0x2ccb7f);}else{if(_0x2ccb7f===0x1f4){_0xa58924[_0xcd57('0x2b')](_0x2ccb7f)[_0xcd57('0x3c')](_0x3b15a6);}else{_0xa58924[_0xcd57('0x2b')](_0x2ccb7f)['json'](_0x3b15a6);}}});};exports[_0xcd57('0x82')]=function(_0x3255a7,_0x2bd425,_0x22840f){var _0x52dc86={};var _0x1f6c2d={};var _0x3f68bb;var _0x219800;return db['FaxAccount'][_0xcd57('0x67')]({'where':{'id':_0x3255a7[_0xcd57('0x57')]['id']}})['then'](handleEntityNotFound(_0x2bd425,null))['then'](function(_0x4c88ed){if(_0x4c88ed){_0x3f68bb=_0x4c88ed;_0x1f6c2d[_0xcd57('0x43')]=_['keys'](db['FaxApplication']['rawAttributes']);_0x1f6c2d[_0xcd57('0x45')]=_['keys'](_0x3255a7[_0xcd57('0x45')]);_0x1f6c2d[_0xcd57('0x46')]=_[_0xcd57('0x47')](_0x1f6c2d['model'],_0x1f6c2d[_0xcd57('0x45')]);_0x52dc86[_0xcd57('0x48')]=_[_0xcd57('0x47')](_0x1f6c2d[_0xcd57('0x43')],qs[_0xcd57('0x49')](_0x3255a7[_0xcd57('0x45')]['fields']));_0x52dc86[_0xcd57('0x48')]=_0x52dc86[_0xcd57('0x48')][_0xcd57('0x59')]?_0x52dc86[_0xcd57('0x48')]:_0x1f6c2d[_0xcd57('0x43')];_0x52dc86[_0xcd57('0x6d')]=qs[_0xcd57('0x4c')](_0x3255a7[_0xcd57('0x45')]['sort']);_0x52dc86[_0xcd57('0x4e')]=qs[_0xcd57('0x46')](_['pick'](_0x3255a7[_0xcd57('0x45')],_0x1f6c2d['filters']));if(_0x3255a7[_0xcd57('0x45')][_0xcd57('0x50')]){_0x52dc86[_0xcd57('0x4e')]=_[_0xcd57('0x4f')](_0x52dc86[_0xcd57('0x4e')],{'$or':_[_0xcd57('0x3e')](_0x52dc86[_0xcd57('0x48')],function(_0x26fea4){var _0x308f86={};_0x308f86[_0x26fea4]={'$like':'%'+_0x3255a7[_0xcd57('0x45')][_0xcd57('0x50')]+'%'};return _0x308f86;})});}_0x52dc86=_[_0xcd57('0x4f')]({},_0x52dc86,_0x3255a7[_0xcd57('0x51')]);return _0x3f68bb[_0xcd57('0x82')](_0x52dc86);}})['then'](function(_0x302e89){if(_0x302e89){_0x219800=_0x302e89[_0xcd57('0x59')];if(!_0x3255a7['query'][_0xcd57('0x4a')]('nolimit')){_0x52dc86[_0xcd57('0x2f')]=qs[_0xcd57('0x2f')](_0x3255a7[_0xcd57('0x45')][_0xcd57('0x2f')]);_0x52dc86[_0xcd57('0x2d')]=qs[_0xcd57('0x2d')](_0x3255a7['query'][_0xcd57('0x2d')]);}return _0x3f68bb[_0xcd57('0x82')](_0x52dc86);}})[_0xcd57('0x1f')](function(_0x265817){if(_0x265817){return _0x265817?{'count':_0x219800,'rows':_0x265817}:null;}})['then'](respondWithResult(_0x2bd425,null))[_0xcd57('0x29')](handleError(_0x2bd425,null));};function Extension(_0x443ab6,_0x5bf9e3,_0x388799,_0x4de9bc){this[_0xcd57('0x83')]=_0xcd57('0x84');this[_0xcd57('0x85')]=_0x443ab6[_0xcd57('0x86')];this[_0xcd57('0x87')]=_0x4de9bc;this[_0xcd57('0x42')]='system';this[_0xcd57('0x88')]=_0xcd57('0x89');this[_0xcd57('0x64')]=_0x443ab6['id'];this[_0xcd57('0x7f')]=_0x5bf9e3;this[_0xcd57('0x8a')]=_0x388799;}function createExtensionsReciveFax(_0x289a5e){var _0x29d826=0x1;var _0x6a5940=[];_0x6a5940['push'](new Extension(_0x289a5e,_0x29d826,'','Answer'));_0x29d826+=0x1;_0x6a5940[_0xcd57('0x8b')](new Extension(_0x289a5e,_0x29d826,_0xcd57('0x8c'),_0xcd57('0x8d')));_0x29d826+=0x1;for(var _0x187295 in _0x289a5e){if(_0x289a5e[_0xcd57('0x4a')](_0x187295)&&(_0x187295===_0xcd57('0x8e')||_0x187295===_0xcd57('0x86')||_0x187295===_0xcd57('0x8f')||_0x187295===_0xcd57('0x90')||_0x187295===_0xcd57('0x91')||_0x187295===_0xcd57('0x92')||_0x187295===_0xcd57('0x93')||_0x187295===_0xcd57('0x94')||_0x187295===_0xcd57('0x95'))){_0x6a5940['push'](new Extension(_0x289a5e,_0x29d826,_0xcd57('0x96')+_0x187295+')='+_0x289a5e[_0x187295],'Set'));_0x29d826+=0x1;}}_0x6a5940[_0xcd57('0x8b')](new Extension(_0x289a5e,_0x29d826,'6',_0xcd57('0x97')));_0x29d826+=0x1;_0x6a5940[_0xcd57('0x8b')](new Extension(_0x289a5e,_0x29d826,'/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',_0xcd57('0x98')));_0x29d826=0x0;return _0x6a5940;}exports[_0xcd57('0x99')]=function(_0x235dbe,_0x188eec,_0x523142){var _0x52c401;return db['sequelize'][_0xcd57('0x7a')](function(_0x5316b5){return db['FaxAccount']['create'](_0x235dbe[_0xcd57('0x5c')],{'transaction':_0x5316b5})[_0xcd57('0x1f')](function(_0x521517){_0x52c401=_0x521517[_0xcd57('0x38')]({'plain':!![]});return db[_0xcd57('0x9a')][_0xcd57('0x9b')](createExtensionsReciveFax(_0x52c401),{'transaction':_0x5316b5});});})[_0xcd57('0x1f')](function(){return _0x52c401;})[_0xcd57('0x1f')](respondWithResult(_0x188eec,null))[_0xcd57('0x29')](handleError(_0x188eec,null));};exports[_0xcd57('0x9c')]=function(_0x34f675,_0x3f8252,_0x18cb5d){var _0x55b777;return db[_0xcd57('0x79')]['transaction'](function(_0x1c9883){return db[_0xcd57('0x3f')]['update'](_0x34f675[_0xcd57('0x5c')],{'where':{'id':_0x34f675[_0xcd57('0x5c')]['id']},'transaction':_0x1c9883})[_0xcd57('0x1f')](function(_0x38c9c7){return db[_0xcd57('0x9a')][_0xcd57('0x37')]({'where':{'FaxAccountId':_0x34f675[_0xcd57('0x5c')]['id']},'transaction':_0x1c9883})[_0xcd57('0x1f')](function(_0x4fe8af){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x34f675[_0xcd57('0x5c')],[_0xcd57('0x9d'),_0xcd57('0x9e'),_0xcd57('0x9f'),_0xcd57('0xa0'),_0xcd57('0xa1'),_0xcd57('0xa2')])),{'transaction':_0x1c9883});});});})['then'](function(){return db['FaxAccount']['findById'](_0x34f675[_0xcd57('0x5c')]['id']);})[_0xcd57('0x1f')](respondWithResult(_0x3f8252,null))[_0xcd57('0x29')](handleError(_0x3f8252,null));};exports['getMessages']=function(_0xd5c793,_0x4250f0,_0x268a53){var _0x23f6c2={'raw':!![],'where':{}};var _0x2a5760={};var _0x32d80e={'count':0x0,'rows':[]};return db[_0xcd57('0x3f')][_0xcd57('0x67')]({'where':{'id':_0xd5c793[_0xcd57('0x57')]['id']}})[_0xcd57('0x1f')](handleEntityNotFound(_0x4250f0,null))[_0xcd57('0x1f')](function(_0x5ecc6a){if(_0x5ecc6a){_0x2a5760[_0xcd57('0x43')]=_[_0xcd57('0x44')](db['FaxMessage'][_0xcd57('0x40')]);_0x2a5760[_0xcd57('0x45')]=_[_0xcd57('0x44')](_0xd5c793[_0xcd57('0x45')]);_0x2a5760[_0xcd57('0x46')]=_[_0xcd57('0x47')](_0x2a5760[_0xcd57('0x43')],_0x2a5760['query']);_0x23f6c2[_0xcd57('0x48')]=_[_0xcd57('0x47')](_0x2a5760[_0xcd57('0x43')],qs[_0xcd57('0x49')](_0xd5c793[_0xcd57('0x45')][_0xcd57('0x49')]));_0x23f6c2[_0xcd57('0x48')]=_0x23f6c2['attributes']['length']?_0x23f6c2[_0xcd57('0x48')]:_0x2a5760[_0xcd57('0x43')];if(!_0xd5c793[_0xcd57('0x45')]['hasOwnProperty'](_0xcd57('0x4b'))){_0x23f6c2[_0xcd57('0x2f')]=qs['limit'](_0xd5c793['query']['limit']);_0x23f6c2['offset']=qs[_0xcd57('0x2d')](_0xd5c793[_0xcd57('0x45')][_0xcd57('0x2d')]);}_0x23f6c2[_0xcd57('0x6d')]=qs[_0xcd57('0x4c')](_0xd5c793['query'][_0xcd57('0x4c')]);_0x23f6c2['where']=qs['filters'](_['pick'](_0xd5c793['query'],_0x2a5760[_0xcd57('0x46')]));_0x23f6c2[_0xcd57('0x4e')][_0xcd57('0x64')]=_0x5ecc6a['id'];if(_0xd5c793[_0xcd57('0x45')][_0xcd57('0x50')]){_0x23f6c2['where']=_[_0xcd57('0x4f')](_0x23f6c2[_0xcd57('0x4e')],{'$or':_['map'](_0x23f6c2[_0xcd57('0x48')],function(_0x4df055){var _0x34aa18={};_0x34aa18[_0x4df055]={'$like':'%'+_0xd5c793['query'][_0xcd57('0x50')]+'%'};return _0x34aa18;})});}if(_0xd5c793['query'][_0xcd57('0xa3')]){var _0x67ff7f=_0xd5c793['query']['$gte'][_0xcd57('0xa4')](',');var _0x386ff7={};_0x386ff7[_0x67ff7f[0x0]]={'$gte':moment(_0x67ff7f[0x1])[_0xcd57('0xa5')](_0xcd57('0xa6'))};_0x23f6c2[_0xcd57('0x4e')]=_[_0xcd57('0x4f')](_0x23f6c2[_0xcd57('0x4e')],_0x386ff7);}_0x23f6c2=_[_0xcd57('0x4f')]({},_0x23f6c2,_0xd5c793['options']);return db[_0xcd57('0xa7')]['count']({'where':_0x23f6c2[_0xcd57('0x4e')]})[_0xcd57('0x1f')](function(_0x5c3762){_0x32d80e[_0xcd57('0x30')]=_0x5c3762;if(_0xd5c793['query'][_0xcd57('0x52')]){_0x23f6c2[_0xcd57('0x53')]=[{'all':!![]}];}return db[_0xcd57('0xa7')][_0xcd57('0x54')](_0x23f6c2);})[_0xcd57('0x1f')](function(_0x285597){_0x32d80e[_0xcd57('0x55')]=_0x285597;return _0x32d80e;});}})[_0xcd57('0x1f')](respondWithFilteredResult(_0x4250f0,_0x23f6c2))[_0xcd57('0x29')](handleError(_0x4250f0,null));};exports[_0xcd57('0x3c')]=function(_0x56c6d8,_0x9aed11,_0xdba1f0){var _0x2ecd6f,_0x20645c={},_0x397aa8;if(_0x56c6d8[_0xcd57('0x5c')]['to']){_0x397aa8=_0x56c6d8[_0xcd57('0x5c')]['to'][0x0];}return db['FaxAccount'][_0xcd57('0x5a')]({'where':{'id':_0x56c6d8[_0xcd57('0x57')]['id']},'include':[{'model':db[_0xcd57('0xa8')],'as':_0xcd57('0xa9'),'include':[{'model':db[_0xcd57('0x70')],'as':_0xcd57('0xaa'),'where':{'fax':_0x397aa8},'limit':0x1,'order':[[_0xcd57('0xa0'),_0xcd57('0xab')]]}]}]})[_0xcd57('0x1f')](handleEntityNotFound(_0x9aed11,null))[_0xcd57('0x1f')](function(_0x3e8158){_0x2ecd6f=_0x3e8158;if(_0x56c6d8[_0xcd57('0x5c')][_0xcd57('0xac')]&&_0x56c6d8['body'][_0xcd57('0xac')][_0xcd57('0x59')]){for(var _0x499ebf=0x0;_0x499ebf<_0x56c6d8['body'][_0xcd57('0xac')]['length'];_0x499ebf+=0x1){_0x56c6d8[_0xcd57('0x5c')]['attachments'][_0x499ebf]={'filename':_0x56c6d8['body']['attachments'][_0x499ebf][_0xcd57('0x3b')],'id':_0x56c6d8[_0xcd57('0x5c')][_0xcd57('0xac')][_0x499ebf]['id'],'path':path[_0xcd57('0xad')](config['root'],_0xcd57('0xae'),_0x56c6d8['body'][_0xcd57('0xac')][_0x499ebf][_0xcd57('0xaf')])};}}return respondWithRpcPromise('CheckAfterSend',_0xcd57('0xb0'),{'FaxAccountId':_['isNil'](_0x56c6d8['params']['id'])?undefined:_0x56c6d8[_0xcd57('0x57')]['id'],'path':_[_0xcd57('0xb1')](_0x56c6d8[_0xcd57('0x5c')][_0xcd57('0xac')][0x0][_0xcd57('0x8')])?undefined:_0x56c6d8[_0xcd57('0x5c')][_0xcd57('0xac')][0x0][_0xcd57('0x8')],'fax':_[_0xcd57('0xb1')](_0x56c6d8['body']['to'][0x0])?undefined:_0x56c6d8[_0xcd57('0x5c')]['to'][0x0]},client9002);})['then'](function(){if(_0x2ecd6f){if(_[_0xcd57('0xb1')](_0x56c6d8[_0xcd57('0x5c')][_0xcd57('0xb2')])){_0x56c6d8[_0xcd57('0x5c')]['from']=util[_0xcd57('0xa5')](_0xcd57('0xb3'),_0x2ecd6f[_0xcd57('0x3b')],_0x2ecd6f['fax']);}if(_0x2ecd6f['List']){if(_0x2ecd6f[_0xcd57('0xa9')][_0xcd57('0xaa')][_0xcd57('0x59')]){return _0x2ecd6f['List'][_0xcd57('0xaa')][0x0];}else{return db[_0xcd57('0x70')][_0xcd57('0x5b')](_['defaults'](_0x56c6d8[_0xcd57('0x5c')],{'firstName':_0x56c6d8['body']['to'][0x0],'phone':_0x56c6d8[_0xcd57('0x5c')]['to'][0x0],'fax':_0x56c6d8['body']['to'][0x0],'ListId':_0x2ecd6f[_0xcd57('0xa2')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xcd57('0xb4'));}})[_0xcd57('0x1f')](function(_0x1f9e4c){if(_0x1f9e4c){return db[_0xcd57('0x6e')][_0xcd57('0x5a')]({'where':{'ContactId':_0x1f9e4c['id'],'closed':![],'FaxAccountId':_0x2ecd6f['id']}})[_0xcd57('0x1f')](function(_0x342d85){if(_0x342d85){return[_0x342d85,![]];}return db[_0xcd57('0x6e')][_0xcd57('0x5b')]({'UserId':_0x56c6d8[_0xcd57('0x5d')]['id'],'ContactId':_0x1f9e4c['id'],'FaxAccountId':_0x2ecd6f['id'],'fax':_0x56c6d8[_0xcd57('0x5c')]['to'][0x0],'firstMsgDirection':_0xcd57('0xb5'),'Messages':[_[_0xcd57('0x4f')](_0x56c6d8['body'],{'read':![],'body':_0x56c6d8[_0xcd57('0x5c')][_0xcd57('0xac')][0x0][_0xcd57('0xb6')],'FaxAccountId':_0x2ecd6f['id'],'UserId':_0x56c6d8[_0xcd57('0x5d')]['id'],'ContactId':_0x1f9e4c['id'],'AttachmentId':_0x56c6d8[_0xcd57('0x5c')][_0xcd57('0xac')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0xcd57('0x1f')](function(_0x3db56a){return[_0x3db56a,!![]];});});}else{throw new Error(_0xcd57('0xb7'));}})[_0xcd57('0xb8')](function(_0x1894ba,_0x4288c5){if(_0x4288c5){return _0x1894ba;}return db['FaxMessage'][_0xcd57('0x5b')]({'direction':_0xcd57('0xb5'),'read':![],'body':_0x56c6d8[_0xcd57('0x5c')][_0xcd57('0xac')][0x0]['filename'],'FaxAccountId':_0x2ecd6f['id'],'FaxInteractionId':_0x1894ba['id'],'UserId':_0x56c6d8[_0xcd57('0x5d')]['id'],'ContactId':_0x1894ba['ContactId'],'AttachmentId':_0x56c6d8[_0xcd57('0x5c')]['attachments'][0x0]['id']})[_0xcd57('0x1f')](function(_0x3d731d){_0x1894ba[_0xcd57('0xb9')][_0xcd57('0xba')]=[];_0x1894ba[_0xcd57('0xb9')]['Messages'][_0xcd57('0x8b')](_0x3d731d['dataValues']);return _0x1894ba;});})[_0xcd57('0x1f')](function(_0x33d829){respondWithRpcPromise(_0xcd57('0xbb'),_0xcd57('0xbb'),{'FaxAccountId':_[_0xcd57('0xb1')](_0x56c6d8['params']['id'])?undefined:_0x56c6d8[_0xcd57('0x57')]['id'],'path':_[_0xcd57('0xb1')](_0x56c6d8[_0xcd57('0x5c')]['attachments'][0x0][_0xcd57('0x8')])?undefined:_0x56c6d8[_0xcd57('0x5c')][_0xcd57('0xac')][0x0][_0xcd57('0x8')],'fax':_['isNil'](_0x56c6d8['body']['to'][0x0])?undefined:_0x56c6d8['body']['to'][0x0],'AttachmentId':_0x56c6d8[_0xcd57('0x5c')][_0xcd57('0xac')][0x0]['id']},client9002)[_0xcd57('0x1f')](function(_0xa8de59){logger[_0xcd57('0x20')](_0xcd57('0xbc'),_0xa8de59);})[_0xcd57('0x29')](function(_0x230774){logger[_0xcd57('0x20')]('SendFaxRpc,\x20%s',_0x230774);});return _0x33d829;})[_0xcd57('0x1f')](respondWithResult(_0x9aed11,null))[_0xcd57('0x29')](handleError(_0x9aed11,null));};exports[_0xcd57('0xbd')]=function(_0x3653c5,_0x151da9,_0x2ca138){return db['FaxAccount'][_0xcd57('0x5a')]({'where':{'id':_0x3653c5['params']['id']}})[_0xcd57('0x1f')](handleEntityNotFound(_0x151da9,null))[_0xcd57('0x1f')](function(_0x4eac58){if(_0x4eac58){return _0x4eac58['addAgents'](_0x3653c5[_0xcd57('0x5c')]['ids'],_[_0xcd57('0x6f')](_0x3653c5[_0xcd57('0x5c')],[_0xcd57('0x69'),'id'])||{})[_0xcd57('0xb8')](function(_0x362bfd){for(var _0x200dc5=0x0;_0x200dc5<_0x3653c5[_0xcd57('0x5c')][_0xcd57('0x69')][_0xcd57('0x59')];_0x200dc5+=0x1){socket[_0xcd57('0xbe')]('userFaxAccount:save',{'UserId':Number(_0x3653c5[_0xcd57('0x5c')][_0xcd57('0x69')][_0x200dc5]),'FaxAccountId':Number(_0x3653c5[_0xcd57('0x57')]['id'])});}return _0x362bfd;});}})[_0xcd57('0x1f')](respondWithResult(_0x151da9,null))[_0xcd57('0x29')](handleError(_0x151da9,null));};exports[_0xcd57('0xbf')]=function(_0x1bd5b0,_0x3b27c6,_0x2dc6bc){return db[_0xcd57('0x3f')]['find']({'where':{'id':_0x1bd5b0['params']['id']}})[_0xcd57('0x1f')](handleEntityNotFound(_0x3b27c6,null))['then'](function(_0x5e3c77){if(_0x5e3c77){return _0x5e3c77['removeAgents'](_0x1bd5b0[_0xcd57('0x45')][_0xcd57('0x69')])[_0xcd57('0x1f')](function(){if(_[_0xcd57('0xc0')](_0x1bd5b0[_0xcd57('0x45')][_0xcd57('0x69')])){for(var _0x31baba=0x0;_0x31baba<_0x1bd5b0[_0xcd57('0x45')][_0xcd57('0x69')][_0xcd57('0x59')];_0x31baba+=0x1){socket[_0xcd57('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x1bd5b0[_0xcd57('0x45')]['ids'][_0x31baba]),'FaxAccountId':Number(_0x1bd5b0[_0xcd57('0x57')]['id'])});}}else{socket[_0xcd57('0xbe')]('userFaxAccount:remove',{'UserId':Number(_0x1bd5b0[_0xcd57('0x45')][_0xcd57('0x69')]),'FaxAccountId':Number(_0x1bd5b0[_0xcd57('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x3b27c6,null))[_0xcd57('0x29')](handleError(_0x3b27c6,null));};exports[_0xcd57('0xc1')]=function(_0x4f49e0,_0x48708c,_0x520878){var _0x3d049b={};var _0x267e55={};var _0x1b2ce8;var _0x3f9b58;return db[_0xcd57('0x3f')][_0xcd57('0x67')]({'where':{'id':_0x4f49e0[_0xcd57('0x57')]['id']}})[_0xcd57('0x1f')](handleEntityNotFound(_0x48708c,null))[_0xcd57('0x1f')](function(_0x25c453){if(_0x25c453){_0x1b2ce8=_0x25c453;_0x267e55[_0xcd57('0x43')]=_['keys'](db[_0xcd57('0x72')]['rawAttributes']);_0x267e55[_0xcd57('0x45')]=_['keys'](_0x4f49e0['query']);_0x267e55['filters']=_['intersection'](_0x267e55[_0xcd57('0x43')],_0x267e55['query']);_0x3d049b[_0xcd57('0x48')]=_[_0xcd57('0x47')](_0x267e55[_0xcd57('0x43')],qs[_0xcd57('0x49')](_0x4f49e0['query'][_0xcd57('0x49')]));_0x3d049b[_0xcd57('0x48')]=_0x3d049b[_0xcd57('0x48')][_0xcd57('0x59')]?_0x3d049b['attributes']:_0x267e55[_0xcd57('0x43')];_0x3d049b[_0xcd57('0x6d')]=qs[_0xcd57('0x4c')](_0x4f49e0[_0xcd57('0x45')][_0xcd57('0x4c')]);_0x3d049b['where']=qs[_0xcd57('0x46')](_[_0xcd57('0x4d')](_0x4f49e0[_0xcd57('0x45')],_0x267e55[_0xcd57('0x46')]));if(_0x4f49e0[_0xcd57('0x45')][_0xcd57('0x50')]){_0x3d049b[_0xcd57('0x4e')]=_[_0xcd57('0x4f')](_0x3d049b['where'],{'$or':_[_0xcd57('0x3e')](_0x3d049b['attributes'],function(_0x4bd741){var _0x6b0f5d={};_0x6b0f5d[_0x4bd741]={'$like':'%'+_0x4f49e0[_0xcd57('0x45')][_0xcd57('0x50')]+'%'};return _0x6b0f5d;})});}_0x3d049b=_[_0xcd57('0x4f')]({},_0x3d049b,_0x4f49e0[_0xcd57('0x51')]);return _0x1b2ce8[_0xcd57('0xc1')](_0x3d049b);}})[_0xcd57('0x1f')](function(_0xef7b77){if(_0xef7b77){_0x3f9b58=_0xef7b77[_0xcd57('0x59')];if(!_0x4f49e0[_0xcd57('0x45')]['hasOwnProperty'](_0xcd57('0x4b'))){_0x3d049b[_0xcd57('0x2f')]=qs['limit'](_0x4f49e0['query'][_0xcd57('0x2f')]);_0x3d049b['offset']=qs[_0xcd57('0x2d')](_0x4f49e0['query'][_0xcd57('0x2d')]);}return _0x1b2ce8[_0xcd57('0xc1')](_0x3d049b);}})[_0xcd57('0x1f')](function(_0x34aa71){if(_0x34aa71){return _0x34aa71?{'count':_0x3f9b58,'rows':_0x34aa71}:null;}})[_0xcd57('0x1f')](respondWithResult(_0x48708c,null))[_0xcd57('0x29')](handleError(_0x48708c,null));}; \ No newline at end of file +var _0x7c9a=['Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','send','getApplications','localstationid','app','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','minrate','modem','t38timeout','FAXOPT(','ReceiveFax','addAccountApplications','VoiceExtension','omit','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','format','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','info','result','catch','sendStatus','status','offset','count','limit','json','reject','save','get','destroy','end','name','index','Pause','map','FaxAccount','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','FaxAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction'];(function(_0x5dc728,_0x380b89){var _0x19c56d=function(_0x8e110a){while(--_0x8e110a){_0x5dc728['push'](_0x5dc728['shift']());}};_0x19c56d(++_0x380b89);}(_0x7c9a,0xfb));var _0xa7c9=function(_0x4df661,_0x481a9b){_0x4df661=_0x4df661-0x0;var _0x2ccd9c=_0x7c9a[_0x4df661];return _0x2ccd9c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7c9('0x0'));var zipdir=require(_0xa7c9('0x1'));var jsonpatch=require(_0xa7c9('0x2'));var rp=require(_0xa7c9('0x3'));var moment=require('moment');var BPromise=require(_0xa7c9('0x4'));var Mustache=require(_0xa7c9('0x5'));var util=require(_0xa7c9('0x6'));var path=require(_0xa7c9('0x7'));var sox=require(_0xa7c9('0x8'));var csv=require(_0xa7c9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa7c9('0xa'));var _=require(_0xa7c9('0xb'));var squel=require(_0xa7c9('0xc'));var crypto=require(_0xa7c9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa7c9('0xe'));var toCsv=require(_0xa7c9('0x9'));var querystring=require(_0xa7c9('0xf'));var Papa=require(_0xa7c9('0x10'));var Redis=require(_0xa7c9('0x11'));var authService=require(_0xa7c9('0x12'));var qs=require(_0xa7c9('0x13'));var as=require(_0xa7c9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa7c9('0x15'));var config=require(_0xa7c9('0x16'));var licenseUtil=require(_0xa7c9('0x17'));var db=require('../../mysqldb')['db'];config[_0xa7c9('0x18')]=_[_0xa7c9('0x19')](config[_0xa7c9('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xa7c9('0x1a'))(new Redis(config[_0xa7c9('0x18')]));require('./faxAccount.socket')[_0xa7c9('0x1b')](socket);var jayson=require(_0xa7c9('0x1c'));var client=jayson[_0xa7c9('0x1d')][_0xa7c9('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xa7c9('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x59d484,_0x3c3669,_0x9f2b80,_0x31d5e0){return new BPromise(function(_0x1119da,_0x44db9f){var _0xe8a700=_0x31d5e0||client;return _0xe8a700[_0xa7c9('0x1f')](_0x59d484,_0x9f2b80)[_0xa7c9('0x20')](function(_0x4f10da){logger['info']('FaxAccount,\x20%s,\x20%s',_0x3c3669,_0xa7c9('0x21'));logger[_0xa7c9('0x22')](_0xa7c9('0x23'),_0x3c3669,'request\x20sent',JSON[_0xa7c9('0x24')](_0x4f10da));if(_0x4f10da[_0xa7c9('0x25')]){if(_0x4f10da[_0xa7c9('0x25')][_0xa7c9('0x26')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x3c3669,_0x4f10da[_0xa7c9('0x25')]['message']);return _0x44db9f(_0x4f10da[_0xa7c9('0x25')][_0xa7c9('0x27')]);}logger[_0xa7c9('0x25')](_0xa7c9('0x28'),_0x3c3669,_0x4f10da[_0xa7c9('0x25')][_0xa7c9('0x27')]);return _0x1119da(_0x4f10da['error'][_0xa7c9('0x27')]);}else{logger[_0xa7c9('0x29')](_0xa7c9('0x28'),_0x3c3669,_0xa7c9('0x21'));_0x1119da(_0x4f10da[_0xa7c9('0x2a')]['message']);}})[_0xa7c9('0x2b')](function(_0xb8cf0b){logger[_0xa7c9('0x25')](_0xa7c9('0x28'),_0x3c3669,_0xb8cf0b);_0x44db9f(_0xb8cf0b);});});}function respondWithStatusCode(_0x2b1f87,_0x97dc80){_0x97dc80=_0x97dc80||0xcc;return function(_0x208cd0){if(_0x208cd0){return _0x2b1f87[_0xa7c9('0x2c')](_0x97dc80);}return _0x2b1f87[_0xa7c9('0x2d')](_0x97dc80)['end']();};}function respondWithResult(_0x51e877,_0x5286af){_0x5286af=_0x5286af||0xc8;return function(_0x74040e){if(_0x74040e){return _0x51e877[_0xa7c9('0x2d')](_0x5286af)['json'](_0x74040e);}};}function respondWithFilteredResult(_0x3f0ae4,_0x271b5d){return function(_0x12087d){if(_0x12087d){var _0x594464=typeof _0x271b5d[_0xa7c9('0x2e')]==='undefined'&&typeof _0x271b5d['limit']==='undefined';var _0x187cce=_0x12087d[_0xa7c9('0x2f')];var _0x1ec950=_0x594464?0x0:_0x271b5d['offset'];var _0x9563be=_0x594464?_0x12087d['count']:_0x271b5d[_0xa7c9('0x2e')]+_0x271b5d[_0xa7c9('0x30')];var _0x598992;if(_0x9563be>=_0x187cce){_0x9563be=_0x187cce;_0x598992=0xc8;}else{_0x598992=0xce;}_0x3f0ae4['status'](_0x598992);return _0x3f0ae4['set']('Content-Range',_0x1ec950+'-'+_0x9563be+'/'+_0x187cce)[_0xa7c9('0x31')](_0x12087d);}return null;};}function patchUpdates(_0x2169f3){return function(_0x4b2f95){try{jsonpatch['apply'](_0x4b2f95,_0x2169f3,!![]);}catch(_0x287ac8){return BPromise[_0xa7c9('0x32')](_0x287ac8);}return _0x4b2f95[_0xa7c9('0x33')]();};}function saveUpdates(_0x103ee6,_0x99bec6){return function(_0x542e85){if(_0x542e85){return _0x542e85['update'](_0x103ee6)[_0xa7c9('0x20')](function(_0x225ae0){return _0x225ae0;});}return null;};}function removeEntity(_0x3fdd73,_0x1c47fd){return function(_0xd686e2){if(_0xd686e2){return _0xd686e2['destroy']()[_0xa7c9('0x20')](function(){var _0xbc836a=_0xd686e2[_0xa7c9('0x34')]({'plain':!![]});var _0x25421c='FaxAccounts';return db['UserProfileResource'][_0xa7c9('0x35')]({'where':{'type':_0x25421c,'resourceId':_0xbc836a['id']}})[_0xa7c9('0x20')](function(){return _0xd686e2;});})['then'](function(){_0x3fdd73[_0xa7c9('0x2d')](0xcc)[_0xa7c9('0x36')]();});}};}function handleEntityNotFound(_0x1b74d4,_0x394bf0){return function(_0x5ef527){if(!_0x5ef527){_0x1b74d4[_0xa7c9('0x2c')](0x194);}return _0x5ef527;};}function handleError(_0x1ce78c,_0x1ec4f0){_0x1ec4f0=_0x1ec4f0||0x1f4;return function(_0x49ce99){logger[_0xa7c9('0x25')](_0x49ce99['stack']);if(_0x49ce99['name']){delete _0x49ce99[_0xa7c9('0x37')];}_0x1ce78c[_0xa7c9('0x2d')](_0x1ec4f0)['send'](_0x49ce99);};}exports[_0xa7c9('0x38')]=function(_0x1f2993,_0x46a7dd){var _0x59c26d={'include':[{'model':db[_0xa7c9('0x39')],'as':'mandatoryDispositionPause'}]},_0x2188b6={},_0x37367a={'count':0x0,'rows':[]};var _0x215810=_[_0xa7c9('0x3a')](db[_0xa7c9('0x3b')][_0xa7c9('0x3c')],function(_0x260c08){return{'name':_0x260c08['fieldName'],'type':_0x260c08[_0xa7c9('0x3d')][_0xa7c9('0x3e')]};});_0x2188b6[_0xa7c9('0x3f')]=_[_0xa7c9('0x3a')](_0x215810,_0xa7c9('0x37'));_0x2188b6['query']=_[_0xa7c9('0x40')](_0x1f2993[_0xa7c9('0x41')]);_0x2188b6[_0xa7c9('0x42')]=_['intersection'](_0x2188b6[_0xa7c9('0x3f')],_0x2188b6['query']);_0x59c26d[_0xa7c9('0x43')]=_[_0xa7c9('0x44')](_0x2188b6[_0xa7c9('0x3f')],qs[_0xa7c9('0x45')](_0x1f2993[_0xa7c9('0x41')]['fields']));_0x59c26d[_0xa7c9('0x43')]=_0x59c26d['attributes']['length']?_0x59c26d[_0xa7c9('0x43')]:_0x2188b6['model'];if(!_0x1f2993[_0xa7c9('0x41')][_0xa7c9('0x46')](_0xa7c9('0x47'))){_0x59c26d[_0xa7c9('0x30')]=qs['limit'](_0x1f2993[_0xa7c9('0x41')][_0xa7c9('0x30')]);_0x59c26d[_0xa7c9('0x2e')]=qs[_0xa7c9('0x2e')](_0x1f2993[_0xa7c9('0x41')][_0xa7c9('0x2e')]);}_0x59c26d['order']=qs[_0xa7c9('0x48')](_0x1f2993[_0xa7c9('0x41')][_0xa7c9('0x48')]);_0x59c26d[_0xa7c9('0x49')]=qs['filters'](_[_0xa7c9('0x4a')](_0x1f2993[_0xa7c9('0x41')],_0x2188b6[_0xa7c9('0x42')]),_0x215810);if(_0x1f2993[_0xa7c9('0x41')][_0xa7c9('0x4b')]){_0x59c26d[_0xa7c9('0x49')]=_[_0xa7c9('0x4c')](_0x59c26d['where'],{'$or':_[_0xa7c9('0x3a')](_0x215810,function(_0x4e82af){if(_0x4e82af[_0xa7c9('0x3d')]!==_0xa7c9('0x4d')){var _0x5aa71a={};_0x5aa71a[_0x4e82af['name']]={'$like':'%'+_0x1f2993['query'][_0xa7c9('0x4b')]+'%'};return _0x5aa71a;}})});}_0x59c26d=_[_0xa7c9('0x4c')]({},_0x59c26d,_0x1f2993[_0xa7c9('0x4e')]);var _0x1e2822={'where':_0x59c26d['where']};return db[_0xa7c9('0x3b')][_0xa7c9('0x2f')](_0x1e2822)['then'](function(_0x4cf916){_0x37367a[_0xa7c9('0x2f')]=_0x4cf916;if(_0x1f2993[_0xa7c9('0x41')][_0xa7c9('0x4f')]){_0x59c26d[_0xa7c9('0x50')]=[{'all':!![]}];}return db[_0xa7c9('0x3b')][_0xa7c9('0x51')](_0x59c26d);})[_0xa7c9('0x20')](function(_0x162cfd){_0x37367a[_0xa7c9('0x52')]=_0x162cfd;return _0x37367a;})[_0xa7c9('0x20')](respondWithFilteredResult(_0x46a7dd,_0x59c26d))[_0xa7c9('0x2b')](handleError(_0x46a7dd,null));};exports[_0xa7c9('0x53')]=function(_0x50e7f4,_0x49641b){var _0x1b36af={'raw':![],'where':{'id':_0x50e7f4['params']['id']},'include':[{'model':db[_0xa7c9('0x39')],'as':_0xa7c9('0x54')}]},_0xc23165={};_0xc23165[_0xa7c9('0x3f')]=_[_0xa7c9('0x40')](db[_0xa7c9('0x3b')][_0xa7c9('0x3c')]);_0xc23165[_0xa7c9('0x41')]=_[_0xa7c9('0x40')](_0x50e7f4[_0xa7c9('0x41')]);_0xc23165[_0xa7c9('0x42')]=_[_0xa7c9('0x44')](_0xc23165[_0xa7c9('0x3f')],_0xc23165[_0xa7c9('0x41')]);_0x1b36af[_0xa7c9('0x43')]=_[_0xa7c9('0x44')](_0xc23165['model'],qs[_0xa7c9('0x45')](_0x50e7f4[_0xa7c9('0x41')][_0xa7c9('0x45')]));_0x1b36af['attributes']=_0x1b36af[_0xa7c9('0x43')][_0xa7c9('0x55')]?_0x1b36af[_0xa7c9('0x43')]:_0xc23165[_0xa7c9('0x3f')];if(_0x50e7f4[_0xa7c9('0x41')][_0xa7c9('0x4f')]){_0x1b36af[_0xa7c9('0x50')]=[{'all':!![]}];}_0x1b36af=_[_0xa7c9('0x4c')]({},_0x1b36af,_0x50e7f4[_0xa7c9('0x4e')]);return db[_0xa7c9('0x3b')]['find'](_0x1b36af)['then'](handleEntityNotFound(_0x49641b,null))[_0xa7c9('0x20')](respondWithResult(_0x49641b,null))[_0xa7c9('0x2b')](handleError(_0x49641b,null));};exports[_0xa7c9('0x56')]=function(_0x4dd0b6,_0x31dc6b){return db[_0xa7c9('0x3b')][_0xa7c9('0x56')](_0x4dd0b6[_0xa7c9('0x57')],{})['then'](function(_0x1b1f70){var _0x24d336=_0x4dd0b6[_0xa7c9('0x58')][_0xa7c9('0x34')]({'plain':!![]});if(!_0x24d336)throw new Error(_0xa7c9('0x59'));if(_0x24d336[_0xa7c9('0x5a')]===_0xa7c9('0x58')){var _0x14898d=_0x1b1f70['get']({'plain':!![]});var _0x167756=_0xa7c9('0x5b');return db['UserProfileSection'][_0xa7c9('0x5c')]({'where':{'name':_0x167756,'userProfileId':_0x24d336[_0xa7c9('0x5d')]},'raw':!![]})[_0xa7c9('0x20')](function(_0x341cbb){if(_0x341cbb&&_0x341cbb[_0xa7c9('0x5e')]===0x0){return db[_0xa7c9('0x5f')][_0xa7c9('0x56')]({'name':_0x14898d[_0xa7c9('0x37')],'resourceId':_0x14898d['id'],'type':_0x341cbb[_0xa7c9('0x37')],'sectionId':_0x341cbb['id']},{})[_0xa7c9('0x20')](function(){return _0x1b1f70;});}else{return _0x1b1f70;}})[_0xa7c9('0x2b')](function(_0x13ec03){logger[_0xa7c9('0x25')](_0xa7c9('0x60'),_0x13ec03);throw _0x13ec03;});}return _0x1b1f70;})[_0xa7c9('0x20')](respondWithResult(_0x31dc6b,0xc9))[_0xa7c9('0x2b')](handleError(_0x31dc6b,null));};exports[_0xa7c9('0x61')]=function(_0x24c6fd,_0x47b480){if(_0x24c6fd['body']['id']){delete _0x24c6fd[_0xa7c9('0x57')]['id'];}return db[_0xa7c9('0x3b')][_0xa7c9('0x5c')]({'where':{'id':_0x24c6fd[_0xa7c9('0x62')]['id']},'include':[{'model':db[_0xa7c9('0x39')],'as':_0xa7c9('0x54')}]})[_0xa7c9('0x20')](handleEntityNotFound(_0x47b480,null))[_0xa7c9('0x20')](saveUpdates(_0x24c6fd[_0xa7c9('0x57')],null))[_0xa7c9('0x20')](respondWithResult(_0x47b480,null))[_0xa7c9('0x2b')](handleError(_0x47b480,null));};exports[_0xa7c9('0x35')]=function(_0x1f958d,_0x26a478){return db['FaxAccount']['find']({'where':{'id':_0x1f958d[_0xa7c9('0x62')]['id']}})[_0xa7c9('0x20')](handleEntityNotFound(_0x26a478,null))[_0xa7c9('0x20')](removeEntity(_0x26a478,null))[_0xa7c9('0x2b')](handleError(_0x26a478,null));};exports[_0xa7c9('0x63')]=function(_0x273204,_0x54975e){return db['FaxAccount']['describe']()[_0xa7c9('0x20')](respondWithResult(_0x54975e,null))[_0xa7c9('0x2b')](handleError(_0x54975e,null));};exports['addDisposition']=function(_0x175966,_0x4a9fc0,_0x376f04){if(_0x175966[_0xa7c9('0x57')]['id']){delete _0x175966[_0xa7c9('0x57')]['id'];}return db[_0xa7c9('0x3b')][_0xa7c9('0x5c')]({'where':{'id':_0x175966[_0xa7c9('0x62')]['id']}})[_0xa7c9('0x20')](handleEntityNotFound(_0x4a9fc0,null))['then'](function(_0x300b90){if(_0x300b90){_0x175966['body'][_0xa7c9('0x64')]=_0x300b90['id'];return db[_0xa7c9('0x65')][_0xa7c9('0x56')](_0x175966[_0xa7c9('0x57')]);}})['then'](respondWithResult(_0x4a9fc0,null))['catch'](handleError(_0x4a9fc0,null));};exports[_0xa7c9('0x66')]=function(_0x343622,_0x14deb1,_0x2893de){var _0x1ce396={'raw':![],'where':{}};var _0x191f06={};var _0x1922b8={'count':0x0,'rows':[]};return db['FaxAccount'][_0xa7c9('0x67')]({'where':{'id':_0x343622[_0xa7c9('0x62')]['id']}})[_0xa7c9('0x20')](handleEntityNotFound(_0x14deb1,null))[_0xa7c9('0x20')](function(_0x5b781b){if(_0x5b781b){_0x191f06['model']=_[_0xa7c9('0x40')](db['Disposition']['rawAttributes']);_0x191f06['query']=_[_0xa7c9('0x40')](_0x343622[_0xa7c9('0x41')]);_0x191f06[_0xa7c9('0x42')]=_[_0xa7c9('0x44')](_0x191f06[_0xa7c9('0x3f')],_0x191f06[_0xa7c9('0x41')]);_0x1ce396[_0xa7c9('0x43')]=_['intersection'](_0x191f06[_0xa7c9('0x3f')],qs['fields'](_0x343622[_0xa7c9('0x41')][_0xa7c9('0x45')]));_0x1ce396[_0xa7c9('0x43')]=_0x1ce396[_0xa7c9('0x43')]['length']?_0x1ce396[_0xa7c9('0x43')]:_0x191f06['model'];if(!_0x343622[_0xa7c9('0x41')][_0xa7c9('0x46')](_0xa7c9('0x47'))){_0x1ce396['limit']=qs[_0xa7c9('0x30')](_0x343622[_0xa7c9('0x41')][_0xa7c9('0x30')]);_0x1ce396[_0xa7c9('0x2e')]=qs[_0xa7c9('0x2e')](_0x343622['query'][_0xa7c9('0x2e')]);}_0x1ce396[_0xa7c9('0x68')]=qs['sort'](_0x343622[_0xa7c9('0x41')][_0xa7c9('0x48')]);_0x1ce396[_0xa7c9('0x49')]=qs[_0xa7c9('0x42')](_[_0xa7c9('0x4a')](_0x343622[_0xa7c9('0x41')],_0x191f06['filters']));_0x1ce396['where'][_0xa7c9('0x64')]=_0x5b781b['id'];if(_0x343622[_0xa7c9('0x41')][_0xa7c9('0x4b')]){_0x1ce396[_0xa7c9('0x49')]=_[_0xa7c9('0x4c')](_0x1ce396[_0xa7c9('0x49')],{'$or':_['map'](_0x1ce396['attributes'],function(_0xcea148){var _0x10ecb8={};_0x10ecb8[_0xcea148]={'$like':'%'+_0x343622[_0xa7c9('0x41')][_0xa7c9('0x4b')]+'%'};return _0x10ecb8;})});}_0x1ce396=_[_0xa7c9('0x4c')]({},_0x1ce396,_0x343622[_0xa7c9('0x4e')]);return db[_0xa7c9('0x65')][_0xa7c9('0x2f')]({'where':_0x1ce396[_0xa7c9('0x49')]})['then'](function(_0x2504e1){_0x1922b8[_0xa7c9('0x2f')]=_0x2504e1;if(_0x343622[_0xa7c9('0x41')]['includeAll']){_0x1ce396[_0xa7c9('0x50')]=[{'all':!![]}];}return db['Disposition'][_0xa7c9('0x51')](_0x1ce396);})[_0xa7c9('0x20')](function(_0x4fb8e0){_0x1922b8['rows']=_0x4fb8e0;return _0x1922b8;});}})['then'](respondWithFilteredResult(_0x14deb1,_0x1ce396))[_0xa7c9('0x2b')](handleError(_0x14deb1,null));};exports[_0xa7c9('0x69')]=function(_0x21b3ce,_0x2281d1,_0x4184ef){return db['FaxAccount'][_0xa7c9('0x5c')]({'where':{'id':_0x21b3ce[_0xa7c9('0x62')]['id']}})[_0xa7c9('0x20')](handleEntityNotFound(_0x2281d1,null))[_0xa7c9('0x20')](function(_0x1faeba){if(_0x1faeba){return _0x1faeba[_0xa7c9('0x69')](_0x21b3ce[_0xa7c9('0x41')][_0xa7c9('0x6a')]);}})['then'](respondWithStatusCode(_0x2281d1,null))['catch'](handleError(_0x2281d1,null));};exports[_0xa7c9('0x6b')]=function(_0x4801ff,_0x1fee4f,_0x2c3e71){if(_0x4801ff[_0xa7c9('0x57')]['id']){delete _0x4801ff[_0xa7c9('0x57')]['id'];}return db[_0xa7c9('0x3b')]['find']({'where':{'id':_0x4801ff[_0xa7c9('0x62')]['id']}})['then'](handleEntityNotFound(_0x1fee4f,null))[_0xa7c9('0x20')](function(_0x2e8574){if(_0x2e8574){_0x4801ff[_0xa7c9('0x57')][_0xa7c9('0x64')]=_0x2e8574['id'];return db[_0xa7c9('0x6c')]['create'](_0x4801ff[_0xa7c9('0x57')]);}})[_0xa7c9('0x20')](respondWithResult(_0x1fee4f,null))[_0xa7c9('0x2b')](handleError(_0x1fee4f,null));};exports['getAnswers']=function(_0x11f7e,_0x3749a1,_0x3613ff){var _0x28a486={'raw':![],'where':{}};var _0x28f909={};var _0x10ed25={'count':0x0,'rows':[]};return db[_0xa7c9('0x3b')][_0xa7c9('0x67')]({'where':{'id':_0x11f7e[_0xa7c9('0x62')]['id']}})[_0xa7c9('0x20')](handleEntityNotFound(_0x3749a1,null))[_0xa7c9('0x20')](function(_0x2437bd){if(_0x2437bd){_0x28f909['model']=_[_0xa7c9('0x40')](db[_0xa7c9('0x6c')][_0xa7c9('0x3c')]);_0x28f909[_0xa7c9('0x41')]=_[_0xa7c9('0x40')](_0x11f7e['query']);_0x28f909[_0xa7c9('0x42')]=_['intersection'](_0x28f909[_0xa7c9('0x3f')],_0x28f909[_0xa7c9('0x41')]);_0x28a486['attributes']=_['intersection'](_0x28f909[_0xa7c9('0x3f')],qs[_0xa7c9('0x45')](_0x11f7e['query']['fields']));_0x28a486[_0xa7c9('0x43')]=_0x28a486[_0xa7c9('0x43')][_0xa7c9('0x55')]?_0x28a486[_0xa7c9('0x43')]:_0x28f909['model'];if(!_0x11f7e[_0xa7c9('0x41')][_0xa7c9('0x46')](_0xa7c9('0x47'))){_0x28a486[_0xa7c9('0x30')]=qs[_0xa7c9('0x30')](_0x11f7e[_0xa7c9('0x41')][_0xa7c9('0x30')]);_0x28a486[_0xa7c9('0x2e')]=qs['offset'](_0x11f7e[_0xa7c9('0x41')][_0xa7c9('0x2e')]);}_0x28a486['order']=qs[_0xa7c9('0x48')](_0x11f7e[_0xa7c9('0x41')][_0xa7c9('0x48')]);_0x28a486[_0xa7c9('0x49')]=qs['filters'](_['pick'](_0x11f7e['query'],_0x28f909[_0xa7c9('0x42')]));_0x28a486[_0xa7c9('0x49')][_0xa7c9('0x64')]=_0x2437bd['id'];if(_0x11f7e['query'][_0xa7c9('0x4b')]){_0x28a486[_0xa7c9('0x49')]=_[_0xa7c9('0x4c')](_0x28a486[_0xa7c9('0x49')],{'$or':_[_0xa7c9('0x3a')](_0x28a486[_0xa7c9('0x43')],function(_0x37061d){var _0x4cbdc0={};_0x4cbdc0[_0x37061d]={'$like':'%'+_0x11f7e['query'][_0xa7c9('0x4b')]+'%'};return _0x4cbdc0;})});}_0x28a486=_[_0xa7c9('0x4c')]({},_0x28a486,_0x11f7e[_0xa7c9('0x4e')]);return db[_0xa7c9('0x6c')][_0xa7c9('0x2f')]({'where':_0x28a486[_0xa7c9('0x49')]})[_0xa7c9('0x20')](function(_0x5f241d){_0x10ed25[_0xa7c9('0x2f')]=_0x5f241d;if(_0x11f7e['query'][_0xa7c9('0x4f')]){_0x28a486[_0xa7c9('0x50')]=[{'all':!![]}];}return db[_0xa7c9('0x6c')]['findAll'](_0x28a486);})[_0xa7c9('0x20')](function(_0x1dcd76){_0x10ed25['rows']=_0x1dcd76;return _0x10ed25;});}})[_0xa7c9('0x20')](respondWithFilteredResult(_0x3749a1,_0x28a486))[_0xa7c9('0x2b')](handleError(_0x3749a1,null));};exports['removeAnswers']=function(_0x26282a,_0x2de526,_0x32086a){return db[_0xa7c9('0x3b')]['find']({'where':{'id':_0x26282a[_0xa7c9('0x62')]['id']}})[_0xa7c9('0x20')](handleEntityNotFound(_0x2de526,null))[_0xa7c9('0x20')](function(_0x12891b){if(_0x12891b){return _0x12891b[_0xa7c9('0x6d')](_0x26282a['query']['ids']);}})[_0xa7c9('0x20')](respondWithStatusCode(_0x2de526,null))[_0xa7c9('0x2b')](handleError(_0x2de526,null));};exports['addInteraction']=function(_0x2bc3eb,_0xea7b38,_0x44feac){return db[_0xa7c9('0x6e')]['find']({'where':{'id':_0x2bc3eb[_0xa7c9('0x62')]['id']}})[_0xa7c9('0x20')](handleEntityNotFound(_0xea7b38,null))[_0xa7c9('0x20')](function(_0x40f522){if(_0x40f522){return _0x40f522[_0xa7c9('0x6f')](_0x2bc3eb[_0xa7c9('0x57')][_0xa7c9('0x6a')],_['omit'](_0x2bc3eb[_0xa7c9('0x57')],[_0xa7c9('0x6a'),'id'])||{});}})[_0xa7c9('0x20')](respondWithResult(_0xea7b38,null))[_0xa7c9('0x2b')](handleError(_0xea7b38,null));};exports[_0xa7c9('0x70')]=function(_0x370909,_0x5c086a,_0x51fbb3){var _0x170479={'raw':![],'where':{}};var _0xa2ba2f={};var _0x43e953={'count':0x0,'rows':[]};return db[_0xa7c9('0x3b')][_0xa7c9('0x67')]({'where':{'id':_0x370909['params']['id']}})['then'](handleEntityNotFound(_0x5c086a,null))[_0xa7c9('0x20')](function(_0x5bd8a0){if(_0x5bd8a0){_0xa2ba2f[_0xa7c9('0x3f')]=_[_0xa7c9('0x40')](db[_0xa7c9('0x6e')][_0xa7c9('0x3c')]);_0xa2ba2f[_0xa7c9('0x41')]=_[_0xa7c9('0x40')](_0x370909[_0xa7c9('0x41')]);_0xa2ba2f[_0xa7c9('0x42')]=_['intersection'](_0xa2ba2f[_0xa7c9('0x3f')],_0xa2ba2f[_0xa7c9('0x41')]);_0x170479[_0xa7c9('0x43')]=_[_0xa7c9('0x44')](_0xa2ba2f['model'],qs['fields'](_0x370909['query'][_0xa7c9('0x45')]));_0x170479['attributes']=_0x170479[_0xa7c9('0x43')][_0xa7c9('0x55')]?_0x170479[_0xa7c9('0x43')]:_0xa2ba2f['model'];if(!_0x370909[_0xa7c9('0x41')][_0xa7c9('0x46')](_0xa7c9('0x47'))){_0x170479[_0xa7c9('0x30')]=qs[_0xa7c9('0x30')](_0x370909['query'][_0xa7c9('0x30')]);_0x170479['offset']=qs['offset'](_0x370909[_0xa7c9('0x41')][_0xa7c9('0x2e')]);}_0x170479[_0xa7c9('0x68')]=qs[_0xa7c9('0x48')](_0x370909[_0xa7c9('0x41')][_0xa7c9('0x48')]);_0x170479[_0xa7c9('0x49')]=qs[_0xa7c9('0x42')](_[_0xa7c9('0x4a')](_0x370909['query'],_0xa2ba2f[_0xa7c9('0x42')]));_0x170479['where'][_0xa7c9('0x64')]=_0x5bd8a0['id'];if(_0x370909['query'][_0xa7c9('0x4b')]){_0x170479[_0xa7c9('0x49')]=_[_0xa7c9('0x4c')](_0x170479['where'],{'$or':_['map'](_0x170479[_0xa7c9('0x43')],function(_0x52d3ae){var _0x545148={};_0x545148[_0x52d3ae]={'$like':'%'+_0x370909['query'][_0xa7c9('0x4b')]+'%'};return _0x545148;})});}_0x170479=_['merge']({},_0x170479,_0x370909[_0xa7c9('0x4e')]);return db[_0xa7c9('0x6e')]['count']({'where':_0x170479[_0xa7c9('0x49')]})['then'](function(_0x278739){_0x43e953[_0xa7c9('0x2f')]=_0x278739;if(_0x370909['query'][_0xa7c9('0x4f')]){_0x170479[_0xa7c9('0x50')]=[{'model':db[_0xa7c9('0x71')],'as':_0xa7c9('0x72'),'required':![]},{'model':db[_0xa7c9('0x73')],'as':_0xa7c9('0x74'),'attributes':[_0xa7c9('0x37'),_0xa7c9('0x75'),'internal'],'required':![]},{'model':db[_0xa7c9('0x76')],'as':_0xa7c9('0x77'),'attributes':['id','name',_0xa7c9('0x78')],'where':_0x370909[_0xa7c9('0x41')][_0xa7c9('0x79')]?{'id':_0x370909[_0xa7c9('0x41')]['tag']}:undefined,'required':_0x370909[_0xa7c9('0x41')][_0xa7c9('0x79')]?!![]:![]}];}return db[_0xa7c9('0x6e')]['findAll'](_0x170479);})[_0xa7c9('0x20')](function(_0x535ea3){_0x43e953[_0xa7c9('0x52')]=_0x535ea3;return _0x43e953;});}})['then'](respondWithFilteredResult(_0x5c086a,_0x170479))[_0xa7c9('0x2b')](handleError(_0x5c086a,null));};exports[_0xa7c9('0x7a')]=function(_0x5de265,_0x4c5ae8){var _0x3ff525=_0x5de265['params']['id'];var _0x241c53=_0x5de265[_0xa7c9('0x57')];var _0x110879=0xc8;var _0xbe9e4a=null;return db[_0xa7c9('0x7b')][_0xa7c9('0x7c')]({'isolationLevel':db[_0xa7c9('0x7b')][_0xa7c9('0x7d')][_0xa7c9('0x7e')][_0xa7c9('0x7f')]},function(_0x1f5641){return db[_0xa7c9('0x3b')]['findOne']({'where':{'id':_0x3ff525},'transaction':_0x1f5641})[_0xa7c9('0x20')](function(_0x47ef25){if(_0x47ef25){return db[_0xa7c9('0x80')][_0xa7c9('0x35')]({'where':{'FaxAccountId':_0x3ff525},'transaction':_0x1f5641})['then'](function(){var _0x1768c7=_[_0xa7c9('0x3a')](_0x241c53,function(_0xf2e602){_0xf2e602[_0xa7c9('0x64')]=_0x3ff525;return _0xf2e602;});return db['FaxApplication'][_0xa7c9('0x81')](_0x1768c7,{'transaction':_0x1f5641});});}else{_0x110879=0x194;_0xbe9e4a=[];}});})[_0xa7c9('0x20')](function(){if(_0x110879!==0x194){return db['FaxApplication'][_0xa7c9('0x82')]({'where':{'FaxAccountId':_0x3ff525},'order':_0xa7c9('0x83')})[_0xa7c9('0x20')](function(_0x315f6e){_0xbe9e4a=_0x315f6e;});}})[_0xa7c9('0x2b')](function(_0x24c5b4){_0x110879=0x1f4;logger['error'](_0x24c5b4['stack']);if(_0x24c5b4[_0xa7c9('0x37')]){delete _0x24c5b4['name'];}_0xbe9e4a=_0x24c5b4;})['finally'](function(){if(_0xbe9e4a===null){_0x4c5ae8['sendStatus'](_0x110879);}else{if(_0x110879===0x1f4){_0x4c5ae8['status'](_0x110879)[_0xa7c9('0x84')](_0xbe9e4a);}else{_0x4c5ae8['status'](_0x110879)[_0xa7c9('0x31')](_0xbe9e4a);}}});};exports[_0xa7c9('0x85')]=function(_0x30b47e,_0xd2be25,_0x57d847){var _0x333edb={};var _0x47714d={};var _0x5defcc;var _0x53d964;return db['FaxAccount']['findOne']({'where':{'id':_0x30b47e[_0xa7c9('0x62')]['id']}})[_0xa7c9('0x20')](handleEntityNotFound(_0xd2be25,null))[_0xa7c9('0x20')](function(_0x4e88ba){if(_0x4e88ba){_0x5defcc=_0x4e88ba;_0x47714d[_0xa7c9('0x3f')]=_['keys'](db[_0xa7c9('0x80')]['rawAttributes']);_0x47714d[_0xa7c9('0x41')]=_[_0xa7c9('0x40')](_0x30b47e[_0xa7c9('0x41')]);_0x47714d['filters']=_[_0xa7c9('0x44')](_0x47714d[_0xa7c9('0x3f')],_0x47714d[_0xa7c9('0x41')]);_0x333edb['attributes']=_['intersection'](_0x47714d['model'],qs[_0xa7c9('0x45')](_0x30b47e[_0xa7c9('0x41')]['fields']));_0x333edb[_0xa7c9('0x43')]=_0x333edb['attributes'][_0xa7c9('0x55')]?_0x333edb[_0xa7c9('0x43')]:_0x47714d[_0xa7c9('0x3f')];_0x333edb[_0xa7c9('0x68')]=qs[_0xa7c9('0x48')](_0x30b47e[_0xa7c9('0x41')]['sort']);_0x333edb[_0xa7c9('0x49')]=qs[_0xa7c9('0x42')](_[_0xa7c9('0x4a')](_0x30b47e[_0xa7c9('0x41')],_0x47714d[_0xa7c9('0x42')]));if(_0x30b47e[_0xa7c9('0x41')][_0xa7c9('0x4b')]){_0x333edb['where']=_['merge'](_0x333edb[_0xa7c9('0x49')],{'$or':_[_0xa7c9('0x3a')](_0x333edb[_0xa7c9('0x43')],function(_0x1b4d55){var _0x3353a7={};_0x3353a7[_0x1b4d55]={'$like':'%'+_0x30b47e[_0xa7c9('0x41')][_0xa7c9('0x4b')]+'%'};return _0x3353a7;})});}_0x333edb=_[_0xa7c9('0x4c')]({},_0x333edb,_0x30b47e[_0xa7c9('0x4e')]);return _0x5defcc[_0xa7c9('0x85')](_0x333edb);}})[_0xa7c9('0x20')](function(_0x275607){if(_0x275607){_0x53d964=_0x275607['length'];if(!_0x30b47e[_0xa7c9('0x41')][_0xa7c9('0x46')](_0xa7c9('0x47'))){_0x333edb[_0xa7c9('0x30')]=qs[_0xa7c9('0x30')](_0x30b47e['query'][_0xa7c9('0x30')]);_0x333edb[_0xa7c9('0x2e')]=qs['offset'](_0x30b47e[_0xa7c9('0x41')][_0xa7c9('0x2e')]);}return _0x5defcc[_0xa7c9('0x85')](_0x333edb);}})[_0xa7c9('0x20')](function(_0x959c62){if(_0x959c62){return _0x959c62?{'count':_0x53d964,'rows':_0x959c62}:null;}})[_0xa7c9('0x20')](respondWithResult(_0xd2be25,null))['catch'](handleError(_0xd2be25,null));};function Extension(_0x392818,_0x38a0ce,_0x11c867,_0x39c6fa){this['context']='from-voip-provider';this['exten']=_0x392818[_0xa7c9('0x86')];this[_0xa7c9('0x87')]=_0x39c6fa;this[_0xa7c9('0x3d')]='system';this['description']='Fax\x20Extension';this[_0xa7c9('0x64')]=_0x392818['id'];this[_0xa7c9('0x83')]=_0x38a0ce;this[_0xa7c9('0x88')]=_0x11c867;}function createExtensionsReciveFax(_0x5158e8){var _0xba59f1=0x1;var _0xef7d0f=[];_0xef7d0f[_0xa7c9('0x89')](new Extension(_0x5158e8,_0xba59f1,'',_0xa7c9('0x8a')));_0xba59f1+=0x1;_0xef7d0f[_0xa7c9('0x89')](new Extension(_0x5158e8,_0xba59f1,_0xa7c9('0x8b'),_0xa7c9('0x8c')));_0xba59f1+=0x1;for(var _0x589d63 in _0x5158e8){if(_0x5158e8[_0xa7c9('0x46')](_0x589d63)&&(_0x589d63===_0xa7c9('0x8d')||_0x589d63===_0xa7c9('0x86')||_0x589d63===_0xa7c9('0x8e')||_0x589d63==='faxdetect'||_0x589d63==='headerinfo'||_0x589d63==='maxrate'||_0x589d63===_0xa7c9('0x8f')||_0x589d63===_0xa7c9('0x90')||_0x589d63===_0xa7c9('0x91'))){_0xef7d0f['push'](new Extension(_0x5158e8,_0xba59f1,_0xa7c9('0x92')+_0x589d63+')='+_0x5158e8[_0x589d63],'Set'));_0xba59f1+=0x1;}}_0xef7d0f['push'](new Extension(_0x5158e8,_0xba59f1,'6','Wait'));_0xba59f1+=0x1;_0xef7d0f[_0xa7c9('0x89')](new Extension(_0x5158e8,_0xba59f1,'/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',_0xa7c9('0x93')));_0xba59f1=0x0;return _0xef7d0f;}exports[_0xa7c9('0x94')]=function(_0x57a5fa,_0x56977c,_0x4ba125){var _0x68281a;return db['sequelize'][_0xa7c9('0x7c')](function(_0x16870e){return db[_0xa7c9('0x3b')]['create'](_0x57a5fa['body'],{'transaction':_0x16870e})[_0xa7c9('0x20')](function(_0x40e22e){_0x68281a=_0x40e22e[_0xa7c9('0x34')]({'plain':!![]});return db['VoiceExtension'][_0xa7c9('0x81')](createExtensionsReciveFax(_0x68281a),{'transaction':_0x16870e});});})['then'](function(){return _0x68281a;})[_0xa7c9('0x20')](respondWithResult(_0x56977c,null))[_0xa7c9('0x2b')](handleError(_0x56977c,null));};exports['updateAccountApplications']=function(_0x56fd08,_0x2053c1,_0x55fde8){var _0x2cb8a5;return db['sequelize'][_0xa7c9('0x7c')](function(_0x4819e3){return db[_0xa7c9('0x3b')][_0xa7c9('0x61')](_0x56fd08[_0xa7c9('0x57')],{'where':{'id':_0x56fd08[_0xa7c9('0x57')]['id']},'transaction':_0x4819e3})[_0xa7c9('0x20')](function(_0x203f9d){return db[_0xa7c9('0x95')][_0xa7c9('0x35')]({'where':{'FaxAccountId':_0x56fd08[_0xa7c9('0x57')]['id']},'transaction':_0x4819e3})['then'](function(_0x5682d5){return db[_0xa7c9('0x95')][_0xa7c9('0x81')](createExtensionsReciveFax(_[_0xa7c9('0x96')](_0x56fd08[_0xa7c9('0x57')],['tech',_0xa7c9('0x3e'),_0xa7c9('0x97'),_0xa7c9('0x98'),_0xa7c9('0x99'),_0xa7c9('0x9a')])),{'transaction':_0x4819e3});});});})[_0xa7c9('0x20')](function(){return db[_0xa7c9('0x3b')][_0xa7c9('0x9b')](_0x56fd08[_0xa7c9('0x57')]['id']);})[_0xa7c9('0x20')](respondWithResult(_0x2053c1,null))[_0xa7c9('0x2b')](handleError(_0x2053c1,null));};exports[_0xa7c9('0x9c')]=function(_0x430ceb,_0x477cc0,_0xbcd361){var _0x3d1329={'raw':!![],'where':{}};var _0x51d3cf={};var _0x4124d8={'count':0x0,'rows':[]};return db[_0xa7c9('0x3b')][_0xa7c9('0x67')]({'where':{'id':_0x430ceb['params']['id']}})['then'](handleEntityNotFound(_0x477cc0,null))[_0xa7c9('0x20')](function(_0x450720){if(_0x450720){_0x51d3cf[_0xa7c9('0x3f')]=_[_0xa7c9('0x40')](db[_0xa7c9('0x9d')][_0xa7c9('0x3c')]);_0x51d3cf['query']=_[_0xa7c9('0x40')](_0x430ceb['query']);_0x51d3cf[_0xa7c9('0x42')]=_[_0xa7c9('0x44')](_0x51d3cf[_0xa7c9('0x3f')],_0x51d3cf[_0xa7c9('0x41')]);_0x3d1329[_0xa7c9('0x43')]=_['intersection'](_0x51d3cf[_0xa7c9('0x3f')],qs['fields'](_0x430ceb['query'][_0xa7c9('0x45')]));_0x3d1329[_0xa7c9('0x43')]=_0x3d1329['attributes'][_0xa7c9('0x55')]?_0x3d1329['attributes']:_0x51d3cf[_0xa7c9('0x3f')];if(!_0x430ceb[_0xa7c9('0x41')][_0xa7c9('0x46')](_0xa7c9('0x47'))){_0x3d1329['limit']=qs[_0xa7c9('0x30')](_0x430ceb[_0xa7c9('0x41')][_0xa7c9('0x30')]);_0x3d1329[_0xa7c9('0x2e')]=qs[_0xa7c9('0x2e')](_0x430ceb[_0xa7c9('0x41')]['offset']);}_0x3d1329['order']=qs[_0xa7c9('0x48')](_0x430ceb[_0xa7c9('0x41')][_0xa7c9('0x48')]);_0x3d1329['where']=qs['filters'](_['pick'](_0x430ceb[_0xa7c9('0x41')],_0x51d3cf[_0xa7c9('0x42')]));_0x3d1329['where']['FaxAccountId']=_0x450720['id'];if(_0x430ceb[_0xa7c9('0x41')][_0xa7c9('0x4b')]){_0x3d1329[_0xa7c9('0x49')]=_[_0xa7c9('0x4c')](_0x3d1329[_0xa7c9('0x49')],{'$or':_['map'](_0x3d1329[_0xa7c9('0x43')],function(_0x326d0e){var _0x51ce52={};_0x51ce52[_0x326d0e]={'$like':'%'+_0x430ceb[_0xa7c9('0x41')][_0xa7c9('0x4b')]+'%'};return _0x51ce52;})});}if(_0x430ceb[_0xa7c9('0x41')][_0xa7c9('0x9e')]){var _0x295367=_0x430ceb['query'][_0xa7c9('0x9e')][_0xa7c9('0x9f')](',');var _0x3da716={};_0x3da716[_0x295367[0x0]]={'$gte':moment(_0x295367[0x1])['format'](_0xa7c9('0xa0'))};_0x3d1329[_0xa7c9('0x49')]=_[_0xa7c9('0x4c')](_0x3d1329[_0xa7c9('0x49')],_0x3da716);}_0x3d1329=_[_0xa7c9('0x4c')]({},_0x3d1329,_0x430ceb['options']);return db[_0xa7c9('0x9d')][_0xa7c9('0x2f')]({'where':_0x3d1329['where']})[_0xa7c9('0x20')](function(_0x129320){_0x4124d8[_0xa7c9('0x2f')]=_0x129320;if(_0x430ceb[_0xa7c9('0x41')][_0xa7c9('0x4f')]){_0x3d1329['include']=[{'all':!![]}];}return db[_0xa7c9('0x9d')]['findAll'](_0x3d1329);})[_0xa7c9('0x20')](function(_0x4fae78){_0x4124d8['rows']=_0x4fae78;return _0x4124d8;});}})['then'](respondWithFilteredResult(_0x477cc0,_0x3d1329))[_0xa7c9('0x2b')](handleError(_0x477cc0,null));};exports[_0xa7c9('0x84')]=function(_0x1187d6,_0x1ca37b,_0xda81f4){var _0x3d97c8,_0x4d772e={},_0x7323c5;if(_0x1187d6[_0xa7c9('0x57')]['to']){_0x7323c5=_0x1187d6[_0xa7c9('0x57')]['to'][0x0];}return db[_0xa7c9('0x3b')][_0xa7c9('0x5c')]({'where':{'id':_0x1187d6[_0xa7c9('0x62')]['id']},'include':[{'model':db[_0xa7c9('0xa1')],'as':_0xa7c9('0xa2'),'include':[{'model':db[_0xa7c9('0x71')],'as':_0xa7c9('0xa3'),'where':{'fax':_0x7323c5},'limit':0x1,'order':[[_0xa7c9('0x98'),_0xa7c9('0xa4')]]}]}]})[_0xa7c9('0x20')](handleEntityNotFound(_0x1ca37b,null))['then'](function(_0x413f66){_0x3d97c8=_0x413f66;if(_0x1187d6[_0xa7c9('0x57')][_0xa7c9('0xa5')]&&_0x1187d6['body'][_0xa7c9('0xa5')]['length']){for(var _0x36b6b0=0x0;_0x36b6b0<_0x1187d6[_0xa7c9('0x57')]['attachments'][_0xa7c9('0x55')];_0x36b6b0+=0x1){_0x1187d6[_0xa7c9('0x57')][_0xa7c9('0xa5')][_0x36b6b0]={'filename':_0x1187d6[_0xa7c9('0x57')][_0xa7c9('0xa5')][_0x36b6b0][_0xa7c9('0x37')],'id':_0x1187d6['body'][_0xa7c9('0xa5')][_0x36b6b0]['id'],'path':path['join'](config['root'],_0xa7c9('0xa6'),_0x1187d6[_0xa7c9('0x57')][_0xa7c9('0xa5')][_0x36b6b0][_0xa7c9('0xa7')])};}}return respondWithRpcPromise('CheckAfterSend',_0xa7c9('0xa8'),{'FaxAccountId':_[_0xa7c9('0xa9')](_0x1187d6['params']['id'])?undefined:_0x1187d6[_0xa7c9('0x62')]['id'],'path':_[_0xa7c9('0xa9')](_0x1187d6[_0xa7c9('0x57')][_0xa7c9('0xa5')][0x0][_0xa7c9('0x7')])?undefined:_0x1187d6['body'][_0xa7c9('0xa5')][0x0][_0xa7c9('0x7')],'fax':_[_0xa7c9('0xa9')](_0x1187d6['body']['to'][0x0])?undefined:_0x1187d6['body']['to'][0x0]},client9002);})[_0xa7c9('0x20')](function(){if(_0x3d97c8){if(_['isNil'](_0x1187d6['body'][_0xa7c9('0xaa')])){_0x1187d6['body'][_0xa7c9('0xaa')]=util[_0xa7c9('0xab')]('\x22%s\x22\x20<%s>',_0x3d97c8[_0xa7c9('0x37')],_0x3d97c8['fax']);}if(_0x3d97c8[_0xa7c9('0xa2')]){if(_0x3d97c8[_0xa7c9('0xa2')][_0xa7c9('0xa3')][_0xa7c9('0x55')]){return _0x3d97c8[_0xa7c9('0xa2')][_0xa7c9('0xa3')][0x0];}else{return db[_0xa7c9('0x71')][_0xa7c9('0x56')](_[_0xa7c9('0x19')](_0x1187d6['body'],{'firstName':_0x1187d6[_0xa7c9('0x57')]['to'][0x0],'phone':_0x1187d6[_0xa7c9('0x57')]['to'][0x0],'fax':_0x1187d6['body']['to'][0x0],'ListId':_0x3d97c8[_0xa7c9('0x9a')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xa7c9('0x20')](function(_0x59008c){if(_0x59008c){return db[_0xa7c9('0x6e')]['find']({'where':{'ContactId':_0x59008c['id'],'closed':![],'FaxAccountId':_0x3d97c8['id']}})['then'](function(_0x1329a9){if(_0x1329a9){return[_0x1329a9,![]];}return db[_0xa7c9('0x6e')][_0xa7c9('0x56')]({'UserId':_0x1187d6[_0xa7c9('0x58')]['id'],'ContactId':_0x59008c['id'],'FaxAccountId':_0x3d97c8['id'],'fax':_0x1187d6[_0xa7c9('0x57')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xa7c9('0x4c')](_0x1187d6[_0xa7c9('0x57')],{'read':![],'body':_0x1187d6[_0xa7c9('0x57')]['attachments'][0x0][_0xa7c9('0xac')],'FaxAccountId':_0x3d97c8['id'],'UserId':_0x1187d6[_0xa7c9('0x58')]['id'],'ContactId':_0x59008c['id'],'AttachmentId':_0x1187d6[_0xa7c9('0x57')][_0xa7c9('0xa5')][0x0]['id']})]},{'include':[{'model':db[_0xa7c9('0x9d')],'as':_0xa7c9('0xad')}]})['then'](function(_0x2561f0){return[_0x2561f0,!![]];});});}else{throw new Error(_0xa7c9('0xae'));}})[_0xa7c9('0xaf')](function(_0x43ba73,_0x245a9c){if(_0x245a9c){return _0x43ba73;}return db[_0xa7c9('0x9d')][_0xa7c9('0x56')]({'direction':_0xa7c9('0xb0'),'read':![],'body':_0x1187d6[_0xa7c9('0x57')][_0xa7c9('0xa5')][0x0]['filename'],'FaxAccountId':_0x3d97c8['id'],'FaxInteractionId':_0x43ba73['id'],'UserId':_0x1187d6[_0xa7c9('0x58')]['id'],'ContactId':_0x43ba73[_0xa7c9('0xb1')],'AttachmentId':_0x1187d6[_0xa7c9('0x57')]['attachments'][0x0]['id']})[_0xa7c9('0x20')](function(_0xf12551){_0x43ba73['dataValues'][_0xa7c9('0xad')]=[];_0x43ba73[_0xa7c9('0xb2')]['Messages'][_0xa7c9('0x89')](_0xf12551[_0xa7c9('0xb2')]);return _0x43ba73;});})['then'](function(_0x182111){respondWithRpcPromise(_0xa7c9('0xb3'),'SendFax',{'FaxAccountId':_[_0xa7c9('0xa9')](_0x1187d6[_0xa7c9('0x62')]['id'])?undefined:_0x1187d6['params']['id'],'path':_['isNil'](_0x1187d6[_0xa7c9('0x57')]['attachments'][0x0][_0xa7c9('0x7')])?undefined:_0x1187d6[_0xa7c9('0x57')][_0xa7c9('0xa5')][0x0]['path'],'fax':_[_0xa7c9('0xa9')](_0x1187d6[_0xa7c9('0x57')]['to'][0x0])?undefined:_0x1187d6[_0xa7c9('0x57')]['to'][0x0],'AttachmentId':_0x1187d6[_0xa7c9('0x57')]['attachments'][0x0]['id']},client9002)['then'](function(_0x222389){logger['info'](_0xa7c9('0xb4'),_0x222389);})[_0xa7c9('0x2b')](function(_0xf1d403){logger['info']('SendFaxRpc,\x20%s',_0xf1d403);});return _0x182111;})[_0xa7c9('0x20')](respondWithResult(_0x1ca37b,null))[_0xa7c9('0x2b')](handleError(_0x1ca37b,null));};exports[_0xa7c9('0xb5')]=function(_0x213ec2,_0xc5871d,_0xa2beaf){return db[_0xa7c9('0x3b')][_0xa7c9('0x5c')]({'where':{'id':_0x213ec2[_0xa7c9('0x62')]['id']}})['then'](handleEntityNotFound(_0xc5871d,null))[_0xa7c9('0x20')](function(_0x4c2c65){if(_0x4c2c65){return _0x4c2c65[_0xa7c9('0xb5')](_0x213ec2[_0xa7c9('0x57')]['ids'],_['omit'](_0x213ec2['body'],[_0xa7c9('0x6a'),'id'])||{})[_0xa7c9('0xaf')](function(_0x50b94d){for(var _0x1e4526=0x0;_0x1e4526<_0x213ec2[_0xa7c9('0x57')][_0xa7c9('0x6a')]['length'];_0x1e4526+=0x1){socket['emit'](_0xa7c9('0xb6'),{'UserId':Number(_0x213ec2[_0xa7c9('0x57')]['ids'][_0x1e4526]),'FaxAccountId':Number(_0x213ec2[_0xa7c9('0x62')]['id'])});}return _0x50b94d;});}})[_0xa7c9('0x20')](respondWithResult(_0xc5871d,null))[_0xa7c9('0x2b')](handleError(_0xc5871d,null));};exports[_0xa7c9('0xb7')]=function(_0x6c58ff,_0xcf7146,_0x539d80){return db[_0xa7c9('0x3b')]['find']({'where':{'id':_0x6c58ff[_0xa7c9('0x62')]['id']}})[_0xa7c9('0x20')](handleEntityNotFound(_0xcf7146,null))['then'](function(_0xd59e1f){if(_0xd59e1f){return _0xd59e1f['removeAgents'](_0x6c58ff[_0xa7c9('0x41')][_0xa7c9('0x6a')])[_0xa7c9('0x20')](function(){if(_[_0xa7c9('0xb8')](_0x6c58ff[_0xa7c9('0x41')][_0xa7c9('0x6a')])){for(var _0x3930cc=0x0;_0x3930cc<_0x6c58ff[_0xa7c9('0x41')][_0xa7c9('0x6a')][_0xa7c9('0x55')];_0x3930cc+=0x1){socket[_0xa7c9('0xb9')](_0xa7c9('0xba'),{'UserId':Number(_0x6c58ff[_0xa7c9('0x41')][_0xa7c9('0x6a')][_0x3930cc]),'FaxAccountId':Number(_0x6c58ff[_0xa7c9('0x62')]['id'])});}}else{socket[_0xa7c9('0xb9')](_0xa7c9('0xba'),{'UserId':Number(_0x6c58ff[_0xa7c9('0x41')][_0xa7c9('0x6a')]),'FaxAccountId':Number(_0x6c58ff['params']['id'])});}});}})[_0xa7c9('0x20')](respondWithStatusCode(_0xcf7146,null))[_0xa7c9('0x2b')](handleError(_0xcf7146,null));};exports[_0xa7c9('0xbb')]=function(_0x15e1e4,_0x4c6d18,_0x53089c){var _0x8c3189={};var _0x106f1a={};var _0x1600af;var _0x296cf3;return db[_0xa7c9('0x3b')][_0xa7c9('0x67')]({'where':{'id':_0x15e1e4[_0xa7c9('0x62')]['id']}})[_0xa7c9('0x20')](handleEntityNotFound(_0x4c6d18,null))[_0xa7c9('0x20')](function(_0x27834a){if(_0x27834a){_0x1600af=_0x27834a;_0x106f1a[_0xa7c9('0x3f')]=_[_0xa7c9('0x40')](db[_0xa7c9('0x73')]['rawAttributes']);_0x106f1a[_0xa7c9('0x41')]=_[_0xa7c9('0x40')](_0x15e1e4[_0xa7c9('0x41')]);_0x106f1a[_0xa7c9('0x42')]=_['intersection'](_0x106f1a[_0xa7c9('0x3f')],_0x106f1a[_0xa7c9('0x41')]);_0x8c3189[_0xa7c9('0x43')]=_[_0xa7c9('0x44')](_0x106f1a[_0xa7c9('0x3f')],qs[_0xa7c9('0x45')](_0x15e1e4['query'][_0xa7c9('0x45')]));_0x8c3189[_0xa7c9('0x43')]=_0x8c3189[_0xa7c9('0x43')][_0xa7c9('0x55')]?_0x8c3189['attributes']:_0x106f1a[_0xa7c9('0x3f')];_0x8c3189[_0xa7c9('0x68')]=qs[_0xa7c9('0x48')](_0x15e1e4['query']['sort']);_0x8c3189[_0xa7c9('0x49')]=qs[_0xa7c9('0x42')](_[_0xa7c9('0x4a')](_0x15e1e4['query'],_0x106f1a['filters']));if(_0x15e1e4[_0xa7c9('0x41')][_0xa7c9('0x4b')]){_0x8c3189['where']=_[_0xa7c9('0x4c')](_0x8c3189[_0xa7c9('0x49')],{'$or':_['map'](_0x8c3189[_0xa7c9('0x43')],function(_0x2e08cd){var _0x56d67c={};_0x56d67c[_0x2e08cd]={'$like':'%'+_0x15e1e4[_0xa7c9('0x41')][_0xa7c9('0x4b')]+'%'};return _0x56d67c;})});}_0x8c3189=_[_0xa7c9('0x4c')]({},_0x8c3189,_0x15e1e4[_0xa7c9('0x4e')]);return _0x1600af[_0xa7c9('0xbb')](_0x8c3189);}})[_0xa7c9('0x20')](function(_0x564fcb){if(_0x564fcb){_0x296cf3=_0x564fcb[_0xa7c9('0x55')];if(!_0x15e1e4[_0xa7c9('0x41')][_0xa7c9('0x46')](_0xa7c9('0x47'))){_0x8c3189[_0xa7c9('0x30')]=qs[_0xa7c9('0x30')](_0x15e1e4[_0xa7c9('0x41')][_0xa7c9('0x30')]);_0x8c3189[_0xa7c9('0x2e')]=qs[_0xa7c9('0x2e')](_0x15e1e4['query'][_0xa7c9('0x2e')]);}return _0x1600af['getAgents'](_0x8c3189);}})[_0xa7c9('0x20')](function(_0xf3e77c){if(_0xf3e77c){return _0xf3e77c?{'count':_0x296cf3,'rows':_0xf3e77c}:null;}})['then'](respondWithResult(_0x4c6d18,null))[_0xa7c9('0x2b')](handleError(_0x4c6d18,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 38f27a0..13ab361 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 _0x1848=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0xbf171b,_0x21c916){var _0x21ab7e=function(_0x46a03d){while(--_0x46a03d){_0xbf171b['push'](_0xbf171b['shift']());}};_0x21ab7e(++_0x21c916);}(_0x1848,0x147));var _0x8184=function(_0x32277c,_0x59a6a6){_0x32277c=_0x32277c-0x0;var _0x2a4f49=_0x1848[_0x32277c];return _0x2a4f49;};'use strict';var EventEmitter=require(_0x8184('0x0'));var FaxAccount=require(_0x8184('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x8184('0x2')](0x0);var events={'afterCreate':_0x8184('0x3'),'afterUpdate':_0x8184('0x4'),'afterDestroy':_0x8184('0x5')};function emitEvent(_0x3c4523){return function(_0x366fe2,_0x14a662,_0x123845){FaxAccountEvents['emit'](_0x3c4523+':'+_0x366fe2['id'],_0x366fe2);FaxAccountEvents[_0x8184('0x6')](_0x3c4523,_0x366fe2);_0x123845(null);};}for(var e in events){if(events[_0x8184('0x7')](e)){var event=events[e];FaxAccount[_0x8184('0x8')](e,emitEvent(event));}}module[_0x8184('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x28f1=['exports','FaxAccount','save','emit','hasOwnProperty','hook'];(function(_0x3b9140,_0x16a1ce){var _0x24df3b=function(_0x31e262){while(--_0x31e262){_0x3b9140['push'](_0x3b9140['shift']());}};_0x24df3b(++_0x16a1ce);}(_0x28f1,0x1db));var _0x128f=function(_0x23bd8a,_0x21127d){_0x23bd8a=_0x23bd8a-0x0;var _0x3c1508=_0x28f1[_0x23bd8a];return _0x3c1508;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0x128f('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x128f('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3278ff){return function(_0x5e03c7,_0x397e04,_0x373dc2){FaxAccountEvents[_0x128f('0x2')](_0x3278ff+':'+_0x5e03c7['id'],_0x5e03c7);FaxAccountEvents[_0x128f('0x2')](_0x3278ff,_0x5e03c7);_0x373dc2(null);};}for(var e in events){if(events[_0x128f('0x3')](e)){var event=events[e];FaxAccount[_0x128f('0x4')](e,emitEvent(event));}}module[_0x128f('0x5')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 715cdc0..465c8f2 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 _0xd377=['../../config/environment','exports','define','fax_accounts','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4fed4f,_0x4ce44e){var _0x425dc6=function(_0x5eac81){while(--_0x5eac81){_0x4fed4f['push'](_0x4fed4f['shift']());}};_0x425dc6(++_0x4ce44e);}(_0xd377,0x88));var _0x7d37=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd377[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7d37('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7d37('0x1'));var moment=require(_0x7d37('0x2'));var BPromise=require(_0x7d37('0x3'));var rp=require(_0x7d37('0x4'));var fs=require('fs');var path=require(_0x7d37('0x5'));var rimraf=require(_0x7d37('0x6'));var config=require(_0x7d37('0x7'));var attributes=require('./faxAccount.attributes');module[_0x7d37('0x8')]=function(_0x1077f2,_0x325af8){return _0x1077f2[_0x7d37('0x9')]('FaxAccount',attributes,{'tableName':_0x7d37('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb66=['exports','FaxAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3f4a75,_0x3132ab){var _0x36808f=function(_0x218c5f){while(--_0x218c5f){_0x3f4a75['push'](_0x3f4a75['shift']());}};_0x36808f(++_0x3132ab);}(_0xdb66,0x1a4));var _0x6db6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xdb66[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x6db6('0x0'));var util=require(_0x6db6('0x1'));var logger=require(_0x6db6('0x2'))(_0x6db6('0x3'));var moment=require(_0x6db6('0x4'));var BPromise=require(_0x6db6('0x5'));var rp=require(_0x6db6('0x6'));var fs=require('fs');var path=require(_0x6db6('0x7'));var rimraf=require(_0x6db6('0x8'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0x6db6('0x9')]=function(_0x4c3ee3,_0x43fd76){return _0x4c3ee3['define'](_0x6db6('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 9b7579f..c98fba1 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 _0x30af=['defaults','localhost','./faxAccount.socket','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','fax','CmContact','ValidationError','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','body','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','find','account','CmList','Contacts','FaxApplication','List','Applications','applications','priority','asc','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','push','created','interaction','ContactId','AttachmentId','User','name','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x30af,0x1a0));var _0xf30a=function(_0x8b5d15,_0x27b4c0){_0x8b5d15=_0x8b5d15-0x0;var _0x4ba000=_0x30af[_0x8b5d15];return _0x4ba000;};'use strict';var _=require('lodash');var util=require(_0xf30a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf30a('0x1'));var db=require(_0xf30a('0x2'))['db'];var utils=require(_0xf30a('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf30a('0x4'));var jayson=require(_0xf30a('0x5'));var client=jayson[_0xf30a('0x6')][_0xf30a('0x7')]({'port':0x232c});config[_0xf30a('0x8')]=_[_0xf30a('0x9')](config[_0xf30a('0x8')],{'host':_0xf30a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf30a('0x8')]));require(_0xf30a('0xb'))[_0xf30a('0xc')](socket);function respondWithRpcPromise(_0xa5a103,_0x352917,_0x482af3){return new BPromise(function(_0x26fd57,_0x593fc2){return client[_0xf30a('0xd')](_0xa5a103,_0x482af3)[_0xf30a('0xe')](function(_0x2c6257){logger[_0xf30a('0xf')]('FaxAccount,\x20%s,\x20%s',_0x352917,_0xf30a('0x10'));logger[_0xf30a('0x11')](_0xf30a('0x12'),_0x352917,_0xf30a('0x10'),JSON[_0xf30a('0x13')](_0x2c6257));if(_0x2c6257[_0xf30a('0x14')]){if(_0x2c6257['error'][_0xf30a('0x15')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x352917,_0x2c6257[_0xf30a('0x14')][_0xf30a('0x16')]);return _0x593fc2(_0x2c6257['error'][_0xf30a('0x16')]);}logger[_0xf30a('0x14')]('FaxAccount,\x20%s,\x20%s',_0x352917,_0x2c6257[_0xf30a('0x14')]['message']);return _0x26fd57(_0x2c6257[_0xf30a('0x14')][_0xf30a('0x16')]);}else{logger[_0xf30a('0xf')](_0xf30a('0x17'),_0x352917,_0xf30a('0x10'));_0x26fd57(_0x2c6257[_0xf30a('0x18')][_0xf30a('0x16')]);}})[_0xf30a('0x19')](function(_0xb518a){logger[_0xf30a('0x14')](_0xf30a('0x17'),_0x352917,_0xb518a);_0x593fc2(_0xb518a);});});}exports[_0xf30a('0x1a')]=function(_0x51515b){var _0x136c00=this;return new Promise(function(_0x3983c5,_0x3c9b41){return db[_0xf30a('0x1b')][_0xf30a('0x1c')]({'raw':_0x51515b[_0xf30a('0x1d')]?_0x51515b[_0xf30a('0x1d')][_0xf30a('0x1e')]===undefined?!![]:![]:!![],'where':_0x51515b[_0xf30a('0x1d')]?_0x51515b[_0xf30a('0x1d')]['where']||null:null,'attributes':_0x51515b[_0xf30a('0x1d')]?_0x51515b['options'][_0xf30a('0x1f')]||null:null,'limit':_0x51515b[_0xf30a('0x1d')]?_0x51515b['options'][_0xf30a('0x20')]||null:null,'include':_0x51515b['options']?_0x51515b[_0xf30a('0x1d')][_0xf30a('0x21')]?_[_0xf30a('0x22')](_0x51515b[_0xf30a('0x1d')]['include'],function(_0x29acde){return{'model':db[_0x29acde[_0xf30a('0x23')]],'as':_0x29acde['as'],'attributes':_0x29acde[_0xf30a('0x1f')],'include':_0x29acde['include']?_[_0xf30a('0x22')](_0x29acde['include'],function(_0x3642df){return{'model':db[_0x3642df[_0xf30a('0x23')]],'as':_0x3642df['as'],'attributes':_0x3642df[_0xf30a('0x1f')],'include':_0x3642df[_0xf30a('0x21')]?_[_0xf30a('0x22')](_0x3642df[_0xf30a('0x21')],function(_0x2c418b){return{'model':db[_0x2c418b[_0xf30a('0x23')]],'as':_0x2c418b['as'],'attributes':_0x2c418b[_0xf30a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf30a('0xe')](function(_0x2f1cdb){logger[_0xf30a('0xf')](_0xf30a('0x1a'),_0x51515b);logger[_0xf30a('0x11')](_0xf30a('0x1a'),_0x51515b,JSON[_0xf30a('0x13')](_0x2f1cdb));_0x3983c5(_0x2f1cdb);})[_0xf30a('0x19')](function(_0x291319){logger['error'](_0xf30a('0x1a'),_0x291319[_0xf30a('0x16')],_0x51515b);_0x3c9b41(_0x136c00[_0xf30a('0x14')](0x1f4,_0x291319[_0xf30a('0x16')]));});});};exports['NotifyFaxAccount']=function(_0x433e30,_0x591c6a,_0x3bd21b){var _0xcd649e=this;return new Promise(function(_0x140251,_0x590c3e){var _0x153e63={'body':_0x433e30['body'],'channel':_0xf30a('0x24')};var _0x3d7c24=[];var _0x514ebc=[];var _0x21bad1={};return db[_0xf30a('0x25')]['describe']()['then'](function(_0x30fb42){if(!_0x30fb42){throw new db['Sequelize'][(_0xf30a('0x26'))](_0xf30a('0x27'));}_0x3d7c24=_[_0xf30a('0x28')](_[_0xf30a('0x29')](_0x30fb42),['createdAt',_0xf30a('0x2a')]);_0x514ebc=_['difference'](_[_0xf30a('0x29')](_0x30fb42),[_0xf30a('0x2b'),_0xf30a('0x2a'),_0xf30a('0x2c'),'ListId']);if(_0x433e30[_0xf30a('0x2d')]['id']){delete _0x433e30[_0xf30a('0x2d')]['id'];}if(_[_0xf30a('0x2e')](_0x433e30['body'][_0xf30a('0x2f')])){throw new db[(_0xf30a('0x30'))][(_0xf30a('0x26'))](_0xf30a('0x31'));}if(_['isNil'](_0x433e30['body']['body'])||_0x433e30['body'][_0xf30a('0x2d')]===''){throw new db[(_0xf30a('0x30'))]['ValidationError'](_0xf30a('0x32'));}if(_[_0xf30a('0x2e')](_0x433e30[_0xf30a('0x2d')][_0xf30a('0x33')])){throw new db[(_0xf30a('0x30'))][(_0xf30a('0x26'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x514ebc);}if(!_[_0xf30a('0x34')](_0x514ebc,_0x433e30[_0xf30a('0x2d')][_0xf30a('0x33')])){throw new db[(_0xf30a('0x30'))][(_0xf30a('0x26'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x514ebc);}_0x21bad1[_0x433e30[_0xf30a('0x2d')][_0xf30a('0x33')]]=_0x433e30['body'][_0xf30a('0x2f')];})[_0xf30a('0xe')](function(){return db[_0xf30a('0x1b')][_0xf30a('0x35')]({'where':{'id':_0x433e30[_0xf30a('0x36')]['id']},'include':[{'model':db[_0xf30a('0x37')],'as':'List','include':[{'model':db['CmContact'],'as':_0xf30a('0x38'),'where':_0x21bad1,'limit':0x1,'order':[[_0xf30a('0x2a'),'DESC']]}]},{'model':db[_0xf30a('0x39')],'as':'Applications'}]});})[_0xf30a('0xe')](function(_0x238df5){if(_0x238df5&&_0x238df5[_0xf30a('0x3a')]){var _0x18fdd5=_0x238df5['get']({'plain':!![]});_0x153e63[_0xf30a('0x36')]=_0x18fdd5;_0x153e63['applications']=_0x18fdd5[_0xf30a('0x3b')];_0x153e63['list']=_0x18fdd5['List'];_0x153e63[_0xf30a('0x3c')]=_['orderBy'](_0x153e63[_0xf30a('0x3c')],[_0xf30a('0x3d')],[_0xf30a('0x3e')]);if(_0x153e63[_0xf30a('0x36')]['Applications']){delete _0x153e63['account'][_0xf30a('0x3b')];}if(_0x153e63[_0xf30a('0x36')][_0xf30a('0x3a')]&&_0x153e63[_0xf30a('0x36')][_0xf30a('0x3a')]['Contacts'][_0xf30a('0x3f')]){return _0x153e63['account']['List'][_0xf30a('0x38')][0x0];}var _0x5277a7=_['defaults'](_0x433e30[_0xf30a('0x2d')],{'firstName':_0x433e30[_0xf30a('0x2d')]['from'],'ListId':_0x18fdd5[_0xf30a('0x40')]});_0x5277a7[_0x433e30[_0xf30a('0x2d')][_0xf30a('0x33')]]=_0x433e30['body']['from'];return db[_0xf30a('0x25')][_0xf30a('0x41')](_0x5277a7,{'fields':_0x3d7c24,'raw':!![]});}})[_0xf30a('0xe')](function(_0x5366e6){_0x153e63[_0xf30a('0x42')]=_0x5366e6;if(_0x5366e6){var _0x3d00c2={'ContactId':_0x5366e6['id'],'FaxAccountId':_0x433e30[_0xf30a('0x36')]['id'],'fax':_0x5366e6[_0xf30a('0x24')]};return db['FaxInteraction'][_0xf30a('0x35')]({'where':{'ContactId':_0x5366e6['id'],'closed':![],'FaxAccountId':_0x433e30['account']['id']}})[_0xf30a('0xe')](function(_0x1ab3e0){if(_0x1ab3e0){return[_0x1ab3e0,![]];}return db[_0xf30a('0x43')]['create'](_0x3d00c2)['then'](function(_0x372226){return[_0x372226,!![]];});});}else{throw new Error(_0xf30a('0x44'));}})[_0xf30a('0x45')](function(_0x218886,_0x3c2ad5){var _0x44e278=_0x218886[_0xf30a('0x46')]({'plain':!![]});if(_0x3c2ad5){if(_0x153e63[_0xf30a('0x36')]['autoclose']){_0x153e63['applications'][_0xf30a('0x47')]({'id':0x0,'priority':_0x153e63['applications'][_0xf30a('0x3f')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x44e278['created']=!![];}else{_0x44e278[_0xf30a('0x48')]=![];}_0x153e63[_0xf30a('0x49')]=_0x44e278;return db['FaxMessage'][_0xf30a('0x41')]({'body':_0x433e30[_0xf30a('0x2d')][_0xf30a('0x2d')],'FaxAccountId':_0x433e30[_0xf30a('0x36')]['id'],'FaxInteractionId':_0x218886['id'],'direction':'in','ContactId':_0x218886[_0xf30a('0x4a')],'AttachmentId':_0x433e30[_0xf30a('0x2d')][_0xf30a('0x4b')]});})['then'](function(_0x458168){_0x153e63[_0xf30a('0x16')]=_0x458168;if(_0x153e63[_0xf30a('0x49')]['UserId']){return db[_0xf30a('0x4c')][_0xf30a('0x35')]({'attributes':['id',_0xf30a('0x4d')],'where':{'id':_0x153e63['interaction'][_0xf30a('0x4e')]}})[_0xf30a('0xe')](function(_0x7f0a1a){if(_0x7f0a1a){_0x153e63['applications'][_0xf30a('0x4f')]({'id':0x0,'priority':0x0,'app':_0xf30a('0x50'),'appdata':_0x7f0a1a[_0xf30a('0x4d')]+','+(_0x153e63[_0xf30a('0x36')][_0xf30a('0x51')]||0xa),'interval':_0xf30a('0x52')});}return respondWithRpcPromise(_0xf30a('0x53'),_0xf30a('0x54'),_0x153e63);});}return respondWithRpcPromise('Start','startRouting',_0x153e63);})[_0xf30a('0xe')](function(_0x4d1344){_0x140251(_0x4d1344);})['catch'](function(_0x517961){_0x590c3e(_0xcd649e[_0xf30a('0x14')](0x1f4,_0x517961[_0xf30a('0x16')]));});});}; \ No newline at end of file +var _0x582d=['from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','close','unmanaged','*,*,*,*','created','interaction','ContactId','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./faxAccount.socket','request','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','stringify','catch','NotifyFaxAccount','body','fax','CmContact','describe','then','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil'];(function(_0x46b371,_0x5e1241){var _0x2eea12=function(_0x57ae83){while(--_0x57ae83){_0x46b371['push'](_0x46b371['shift']());}};_0x2eea12(++_0x5e1241);}(_0x582d,0x82));var _0xd582=function(_0x31496e,_0x49a4ce){_0x31496e=_0x31496e-0x0;var _0x5c3017=_0x582d[_0x31496e];return _0x5c3017;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd582('0x0'));var BPromise=require(_0xd582('0x1'));var rs=require(_0xd582('0x2'));var fs=require('fs');var Redis=require(_0xd582('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd582('0x4'));var logger=require(_0xd582('0x5'))(_0xd582('0x6'));var config=require(_0xd582('0x7'));var jayson=require(_0xd582('0x8'));var client=jayson[_0xd582('0x9')][_0xd582('0xa')]({'port':0x232c});config[_0xd582('0xb')]=_[_0xd582('0xc')](config[_0xd582('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd582('0xb')]));require(_0xd582('0xd'))['register'](socket);function respondWithRpcPromise(_0x510b7e,_0x443cf5,_0x38b0a9){return new BPromise(function(_0x4fdabd,_0x3ae487){return client[_0xd582('0xe')](_0x510b7e,_0x38b0a9)['then'](function(_0x546dc1){logger[_0xd582('0xf')](_0xd582('0x10'),_0x443cf5,'request\x20sent');logger[_0xd582('0x11')](_0xd582('0x12'),_0x443cf5,_0xd582('0x13'),JSON['stringify'](_0x546dc1));if(_0x546dc1[_0xd582('0x14')]){if(_0x546dc1[_0xd582('0x14')]['code']===0x1f4){logger[_0xd582('0x14')](_0xd582('0x10'),_0x443cf5,_0x546dc1['error'][_0xd582('0x15')]);return _0x3ae487(_0x546dc1[_0xd582('0x14')][_0xd582('0x15')]);}logger[_0xd582('0x14')](_0xd582('0x10'),_0x443cf5,_0x546dc1[_0xd582('0x14')][_0xd582('0x15')]);return _0x4fdabd(_0x546dc1[_0xd582('0x14')][_0xd582('0x15')]);}else{logger[_0xd582('0xf')](_0xd582('0x10'),_0x443cf5,_0xd582('0x13'));_0x4fdabd(_0x546dc1[_0xd582('0x16')][_0xd582('0x15')]);}})['catch'](function(_0x5ac8bd){logger[_0xd582('0x14')](_0xd582('0x10'),_0x443cf5,_0x5ac8bd);_0x3ae487(_0x5ac8bd);});});}exports['GetFaxAccount']=function(_0x3b40a7){var _0x98ef3d=this;return new Promise(function(_0x4402cc,_0x3acc31){return db[_0xd582('0x17')][_0xd582('0x18')]({'raw':_0x3b40a7[_0xd582('0x19')]?_0x3b40a7[_0xd582('0x19')][_0xd582('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b40a7['options']?_0x3b40a7['options'][_0xd582('0x1b')]||null:null,'attributes':_0x3b40a7[_0xd582('0x19')]?_0x3b40a7[_0xd582('0x19')][_0xd582('0x1c')]||null:null,'limit':_0x3b40a7[_0xd582('0x19')]?_0x3b40a7[_0xd582('0x19')][_0xd582('0x1d')]||null:null,'include':_0x3b40a7[_0xd582('0x19')]?_0x3b40a7['options'][_0xd582('0x1e')]?_[_0xd582('0x1f')](_0x3b40a7[_0xd582('0x19')][_0xd582('0x1e')],function(_0x50a2c){return{'model':db[_0x50a2c[_0xd582('0x20')]],'as':_0x50a2c['as'],'attributes':_0x50a2c[_0xd582('0x1c')],'include':_0x50a2c[_0xd582('0x1e')]?_['map'](_0x50a2c[_0xd582('0x1e')],function(_0x33b272){return{'model':db[_0x33b272[_0xd582('0x20')]],'as':_0x33b272['as'],'attributes':_0x33b272['attributes'],'include':_0x33b272[_0xd582('0x1e')]?_[_0xd582('0x1f')](_0x33b272[_0xd582('0x1e')],function(_0x354b31){return{'model':db[_0x354b31['model']],'as':_0x354b31['as'],'attributes':_0x354b31[_0xd582('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c7359){logger[_0xd582('0xf')]('GetFaxAccount',_0x3b40a7);logger['debug'](_0xd582('0x21'),_0x3b40a7,JSON[_0xd582('0x22')](_0x2c7359));_0x4402cc(_0x2c7359);})[_0xd582('0x23')](function(_0x5300e7){logger[_0xd582('0x14')]('GetFaxAccount',_0x5300e7[_0xd582('0x15')],_0x3b40a7);_0x3acc31(_0x98ef3d[_0xd582('0x14')](0x1f4,_0x5300e7['message']));});});};exports[_0xd582('0x24')]=function(_0x111230,_0x2eec5e,_0x1f7474){var _0x5c9fde=this;return new Promise(function(_0x2f2339,_0x476507){var _0x13e6cc={'body':_0x111230[_0xd582('0x25')],'channel':_0xd582('0x26')};var _0x5e5e2b=[];var _0x3e14ff=[];var _0x18a455={};return db[_0xd582('0x27')][_0xd582('0x28')]()[_0xd582('0x29')](function(_0x9f1138){if(!_0x9f1138){throw new db['Sequelize'][(_0xd582('0x2a'))](_0xd582('0x2b'));}_0x5e5e2b=_['difference'](_['keys'](_0x9f1138),[_0xd582('0x2c'),_0xd582('0x2d')]);_0x3e14ff=_[_0xd582('0x2e')](_['keys'](_0x9f1138),[_0xd582('0x2c'),_0xd582('0x2d'),_0xd582('0x2f'),_0xd582('0x30')]);if(_0x111230['body']['id']){delete _0x111230[_0xd582('0x25')]['id'];}if(_[_0xd582('0x31')](_0x111230['body'][_0xd582('0x32')])){throw new db['Sequelize'][(_0xd582('0x2a'))](_0xd582('0x33'));}if(_[_0xd582('0x31')](_0x111230['body'][_0xd582('0x25')])||_0x111230[_0xd582('0x25')][_0xd582('0x25')]===''){throw new db[(_0xd582('0x34'))][(_0xd582('0x2a'))](_0xd582('0x35'));}if(_[_0xd582('0x31')](_0x111230['body'][_0xd582('0x36')])){throw new db[(_0xd582('0x34'))][(_0xd582('0x2a'))](_0xd582('0x37')+_0x3e14ff);}if(!_[_0xd582('0x38')](_0x3e14ff,_0x111230[_0xd582('0x25')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xd582('0x39')+_0x3e14ff);}_0x18a455[_0x111230[_0xd582('0x25')]['mapKey']]=_0x111230[_0xd582('0x25')][_0xd582('0x32')];})['then'](function(){return db['FaxAccount'][_0xd582('0x3a')]({'where':{'id':_0x111230[_0xd582('0x3b')]['id']},'include':[{'model':db[_0xd582('0x3c')],'as':_0xd582('0x3d'),'include':[{'model':db[_0xd582('0x27')],'as':_0xd582('0x3e'),'where':_0x18a455,'limit':0x1,'order':[[_0xd582('0x2d'),_0xd582('0x3f')]]}]},{'model':db[_0xd582('0x40')],'as':_0xd582('0x41')}]});})[_0xd582('0x29')](function(_0x42036d){if(_0x42036d&&_0x42036d['List']){var _0x412b2e=_0x42036d[_0xd582('0x42')]({'plain':!![]});_0x13e6cc['account']=_0x412b2e;_0x13e6cc[_0xd582('0x43')]=_0x412b2e['Applications'];_0x13e6cc[_0xd582('0x44')]=_0x412b2e['List'];_0x13e6cc[_0xd582('0x43')]=_['orderBy'](_0x13e6cc['applications'],['priority'],[_0xd582('0x45')]);if(_0x13e6cc['account']['Applications']){delete _0x13e6cc['account'][_0xd582('0x41')];}if(_0x13e6cc['account'][_0xd582('0x3d')]&&_0x13e6cc[_0xd582('0x3b')][_0xd582('0x3d')][_0xd582('0x3e')][_0xd582('0x46')]){return _0x13e6cc[_0xd582('0x3b')][_0xd582('0x3d')]['Contacts'][0x0];}var _0x3ce6fc=_[_0xd582('0xc')](_0x111230[_0xd582('0x25')],{'firstName':_0x111230[_0xd582('0x25')][_0xd582('0x32')],'ListId':_0x412b2e[_0xd582('0x30')]});_0x3ce6fc[_0x111230['body'][_0xd582('0x36')]]=_0x111230[_0xd582('0x25')][_0xd582('0x32')];return db[_0xd582('0x27')][_0xd582('0x47')](_0x3ce6fc,{'fields':_0x5e5e2b,'raw':!![]});}})['then'](function(_0x5093cf){_0x13e6cc[_0xd582('0x48')]=_0x5093cf;if(_0x5093cf){var _0x3d4fed={'ContactId':_0x5093cf['id'],'FaxAccountId':_0x111230[_0xd582('0x3b')]['id'],'fax':_0x5093cf[_0xd582('0x26')]};return db[_0xd582('0x49')][_0xd582('0x3a')]({'where':{'ContactId':_0x5093cf['id'],'closed':![],'FaxAccountId':_0x111230[_0xd582('0x3b')]['id']}})[_0xd582('0x29')](function(_0xd7b78b){if(_0xd7b78b){return[_0xd7b78b,![]];}return db[_0xd582('0x49')]['create'](_0x3d4fed)[_0xd582('0x29')](function(_0x12b60d){return[_0x12b60d,!![]];});});}else{throw new Error(_0xd582('0x4a'));}})[_0xd582('0x4b')](function(_0x1dc97c,_0x2d6035){var _0x2e6ba4=_0x1dc97c['get']({'plain':!![]});if(_0x2d6035){if(_0x13e6cc[_0xd582('0x3b')][_0xd582('0x4c')]){_0x13e6cc[_0xd582('0x43')]['push']({'id':0x0,'priority':_0x13e6cc[_0xd582('0x43')]['length']+0x1,'app':_0xd582('0x4d'),'appdata':_0xd582('0x4e'),'interval':_0xd582('0x4f')});}_0x2e6ba4[_0xd582('0x50')]=!![];}else{_0x2e6ba4[_0xd582('0x50')]=![];}_0x13e6cc[_0xd582('0x51')]=_0x2e6ba4;return db['FaxMessage'][_0xd582('0x47')]({'body':_0x111230[_0xd582('0x25')]['body'],'FaxAccountId':_0x111230['account']['id'],'FaxInteractionId':_0x1dc97c['id'],'direction':'in','ContactId':_0x1dc97c[_0xd582('0x52')],'AttachmentId':_0x111230['body']['AttachmentId']});})[_0xd582('0x29')](function(_0x301225){_0x13e6cc[_0xd582('0x15')]=_0x301225;if(_0x13e6cc[_0xd582('0x51')][_0xd582('0x53')]){return db[_0xd582('0x54')][_0xd582('0x3a')]({'attributes':['id',_0xd582('0x55')],'where':{'id':_0x13e6cc[_0xd582('0x51')][_0xd582('0x53')]}})['then'](function(_0x1bbd1f){if(_0x1bbd1f){_0x13e6cc['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xd582('0x56'),'appdata':_0x1bbd1f[_0xd582('0x55')]+','+(_0x13e6cc[_0xd582('0x3b')][_0xd582('0x57')]||0xa),'interval':_0xd582('0x4f')});}return respondWithRpcPromise(_0xd582('0x58'),_0xd582('0x59'),_0x13e6cc);});}return respondWithRpcPromise(_0xd582('0x58'),_0xd582('0x59'),_0x13e6cc);})['then'](function(_0xf733ed){_0x2f2339(_0xf733ed);})['catch'](function(_0x1c8531){_0x476507(_0x5c9fde[_0xd582('0x14')](0x1f4,_0x1c8531['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 29a6eca..d6bdb6d 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 _0xe7d2=['emit','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x21497f,_0x4aba12){var _0x1bc094=function(_0x2b628a){while(--_0x2b628a){_0x21497f['push'](_0x21497f['shift']());}};_0x1bc094(++_0x4aba12);}(_0xe7d2,0x124));var _0x2e7d=function(_0x11505c,_0x3be5b7){_0x11505c=_0x11505c-0x0;var _0x389e04=_0xe7d2[_0x11505c];return _0x389e04;};'use strict';var FaxAccountEvents=require(_0x2e7d('0x0'));var events=[_0x2e7d('0x1'),_0x2e7d('0x2'),_0x2e7d('0x3')];function createListener(_0x27ea92,_0x272bb4){return function(_0x1e7f37){_0x272bb4[_0x2e7d('0x4')](_0x27ea92,_0x1e7f37);};}function removeListener(_0x2c7744,_0x2df1ef){return function(){FaxAccountEvents['removeListener'](_0x2c7744,_0x2df1ef);};}exports[_0x2e7d('0x5')]=function(_0x198ce2){for(var _0x5df641=0x0,_0x4f0a23=events[_0x2e7d('0x6')];_0x5df641<_0x4f0a23;_0x5df641++){var _0x289782=events[_0x5df641];var _0x98a161=createListener(_0x2e7d('0x7')+_0x289782,_0x198ce2);FaxAccountEvents['on'](_0x289782,_0x98a161);}}; \ No newline at end of file +var _0x8272=['update','emit','removeListener','register','faxAccount:','./faxAccount.events','remove'];(function(_0x507c4b,_0x36cc1a){var _0x1b8bb6=function(_0x5aa094){while(--_0x5aa094){_0x507c4b['push'](_0x507c4b['shift']());}};_0x1b8bb6(++_0x36cc1a);}(_0x8272,0x7c));var _0x2827=function(_0x5f5016,_0x423699){_0x5f5016=_0x5f5016-0x0;var _0x2b0254=_0x8272[_0x5f5016];return _0x2b0254;};'use strict';var FaxAccountEvents=require(_0x2827('0x0'));var events=['save',_0x2827('0x1'),_0x2827('0x2')];function createListener(_0x518f78,_0x5305e7){return function(_0x4dbcd3){_0x5305e7[_0x2827('0x3')](_0x518f78,_0x4dbcd3);};}function removeListener(_0x544dd0,_0x110ff7){return function(){FaxAccountEvents[_0x2827('0x4')](_0x544dd0,_0x110ff7);};}exports[_0x2827('0x5')]=function(_0x14d65b){for(var _0x4b0fbd=0x0,_0x367ea7=events['length'];_0x4b0fbd<_0x367ea7;_0x4b0fbd++){var _0x40a938=events[_0x4b0fbd];var _0x58d7e3=createListener(_0x2827('0x6')+_0x40a938,_0x14d65b);FaxAccountEvents['on'](_0x40a938,_0x58d7e3);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index d5585d2..9b968a3 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x396531,_0x245582){var _0x1ef51a=function(_0x45317d){while(--_0x45317d){_0x396531['push'](_0x396531['shift']());}};_0x1ef51a(++_0x245582);}(_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['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0xe33509,_0x213a9f){var _0x1fac1b=function(_0x5ba764){while(--_0x5ba764){_0xe33509['push'](_0xe33509['shift']());}};_0x1fac1b(++_0x213a9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 0ac908e..ee07543 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 _0xf513=['noop','sequelize','INTEGER','STRING'];(function(_0x300b3d,_0x5d10f4){var _0x54f986=function(_0x4b3b64){while(--_0x4b3b64){_0x300b3d['push'](_0x300b3d['shift']());}};_0x54f986(++_0x5d10f4);}(_0xf513,0x13d));var _0x3f51=function(_0x5b2589,_0x111e7d){_0x5b2589=_0x5b2589-0x0;var _0x33f63d=_0xf513[_0x5b2589];return _0x33f63d;};'use strict';var Sequelize=require(_0x3f51('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3f51('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3f51('0x2')],'allowNull':![],'defaultValue':_0x3f51('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3f51('0x2')]},'interval':{'type':Sequelize[_0x3f51('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xc39b=['STRING','*,*,*,*','exports','noop'];(function(_0x5ce6a2,_0x25e9f5){var _0xb75c7e=function(_0x2ba0cd){while(--_0x2ba0cd){_0x5ce6a2['push'](_0x5ce6a2['shift']());}};_0xb75c7e(++_0x25e9f5);}(_0xc39b,0xc6));var _0xbc39=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc39b[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require('sequelize');module[_0xbc39('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbc39('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xbc39('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbc39('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 4778382..b56d361 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 _0xa1b9=['body','update','find','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','squel','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','count','set','Content-Range','apply','reject','then','error','stack','name','send','FaxApplication','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','rawAttributes','include','merge'];(function(_0x3b25d2,_0x335bf9){var _0x44334b=function(_0x42a4e7){while(--_0x42a4e7){_0x3b25d2['push'](_0x3b25d2['shift']());}};_0x44334b(++_0x335bf9);}(_0xa1b9,0x1ed));var _0x9a1b=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa1b9[_0x25bea7];return _0x175952;};'use strict';var emlformat=require(_0x9a1b('0x0'));var rimraf=require(_0x9a1b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a1b('0x2'));var rp=require('request-promise');var moment=require(_0x9a1b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9a1b('0x4'));var util=require(_0x9a1b('0x5'));var path=require('path');var sox=require(_0x9a1b('0x6'));var csv=require(_0x9a1b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a1b('0x8'));var _=require('lodash');var squel=require(_0x9a1b('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9a1b('0x7'));var querystring=require(_0x9a1b('0xa'));var Papa=require(_0x9a1b('0xb'));var Redis=require(_0x9a1b('0xc'));var authService=require(_0x9a1b('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x9a1b('0xe'));var hardwareService=require(_0x9a1b('0xf'));var logger=require(_0x9a1b('0x10'))(_0x9a1b('0x11'));var utils=require(_0x9a1b('0x12'));var config=require(_0x9a1b('0x13'));var licenseUtil=require(_0x9a1b('0x14'));var db=require(_0x9a1b('0x15'))['db'];function respondWithStatusCode(_0x316a9d,_0x2fa83e){_0x2fa83e=_0x2fa83e||0xcc;return function(_0x3de1a2){if(_0x3de1a2){return _0x316a9d[_0x9a1b('0x16')](_0x2fa83e);}return _0x316a9d[_0x9a1b('0x17')](_0x2fa83e)[_0x9a1b('0x18')]();};}function respondWithResult(_0x4ac9f8,_0x2619d2){_0x2619d2=_0x2619d2||0xc8;return function(_0x211d02){if(_0x211d02){return _0x4ac9f8[_0x9a1b('0x17')](_0x2619d2)[_0x9a1b('0x19')](_0x211d02);}};}function respondWithFilteredResult(_0x5028ce,_0x42b0d7){return function(_0x179fa6){if(_0x179fa6){var _0x2c5910=typeof _0x42b0d7[_0x9a1b('0x1a')]===_0x9a1b('0x1b')&&typeof _0x42b0d7['limit']===_0x9a1b('0x1b');var _0x15ebcc=_0x179fa6[_0x9a1b('0x1c')];var _0x1a79af=_0x2c5910?0x0:_0x42b0d7[_0x9a1b('0x1a')];var _0x4e0419=_0x2c5910?_0x179fa6[_0x9a1b('0x1c')]:_0x42b0d7[_0x9a1b('0x1a')]+_0x42b0d7['limit'];var _0x12fcd2;if(_0x4e0419>=_0x15ebcc){_0x4e0419=_0x15ebcc;_0x12fcd2=0xc8;}else{_0x12fcd2=0xce;}_0x5028ce['status'](_0x12fcd2);return _0x5028ce[_0x9a1b('0x1d')](_0x9a1b('0x1e'),_0x1a79af+'-'+_0x4e0419+'/'+_0x15ebcc)[_0x9a1b('0x19')](_0x179fa6);}return null;};}function patchUpdates(_0x407028){return function(_0x114975){try{jsonpatch[_0x9a1b('0x1f')](_0x114975,_0x407028,!![]);}catch(_0x53cc8a){return BPromise[_0x9a1b('0x20')](_0x53cc8a);}return _0x114975['save']();};}function saveUpdates(_0x33e88d,_0xaa3ce0){return function(_0x2a84ff){if(_0x2a84ff){return _0x2a84ff['update'](_0x33e88d)[_0x9a1b('0x21')](function(_0x389de0){return _0x389de0;});}return null;};}function removeEntity(_0x50705c,_0x5daa78){return function(_0x56f5c4){if(_0x56f5c4){return _0x56f5c4['destroy']()[_0x9a1b('0x21')](function(){_0x50705c['status'](0xcc)[_0x9a1b('0x18')]();});}};}function handleEntityNotFound(_0x300bc6,_0x217f27){return function(_0x508d01){if(!_0x508d01){_0x300bc6[_0x9a1b('0x16')](0x194);}return _0x508d01;};}function handleError(_0x2606c8,_0xdde967){_0xdde967=_0xdde967||0x1f4;return function(_0x5e59fe){logger[_0x9a1b('0x22')](_0x5e59fe[_0x9a1b('0x23')]);if(_0x5e59fe['name']){delete _0x5e59fe[_0x9a1b('0x24')];}_0x2606c8[_0x9a1b('0x17')](_0xdde967)[_0x9a1b('0x25')](_0x5e59fe);};}exports['index']=function(_0x53a220,_0x17d110){var _0x262fec={},_0x204106={},_0x2b253c={'count':0x0,'rows':[]};var _0x236dca=_['map'](db[_0x9a1b('0x26')]['rawAttributes'],function(_0x4f3ad0){return{'name':_0x4f3ad0['fieldName'],'type':_0x4f3ad0[_0x9a1b('0x27')][_0x9a1b('0x28')]};});_0x204106[_0x9a1b('0x29')]=_[_0x9a1b('0x2a')](_0x236dca,_0x9a1b('0x24'));_0x204106[_0x9a1b('0x2b')]=_['keys'](_0x53a220['query']);_0x204106[_0x9a1b('0x2c')]=_['intersection'](_0x204106[_0x9a1b('0x29')],_0x204106[_0x9a1b('0x2b')]);_0x262fec['attributes']=_[_0x9a1b('0x2d')](_0x204106[_0x9a1b('0x29')],qs[_0x9a1b('0x2e')](_0x53a220[_0x9a1b('0x2b')][_0x9a1b('0x2e')]));_0x262fec[_0x9a1b('0x2f')]=_0x262fec[_0x9a1b('0x2f')][_0x9a1b('0x30')]?_0x262fec[_0x9a1b('0x2f')]:_0x204106[_0x9a1b('0x29')];if(!_0x53a220['query'][_0x9a1b('0x31')](_0x9a1b('0x32'))){_0x262fec[_0x9a1b('0x33')]=qs[_0x9a1b('0x33')](_0x53a220[_0x9a1b('0x2b')][_0x9a1b('0x33')]);_0x262fec[_0x9a1b('0x1a')]=qs[_0x9a1b('0x1a')](_0x53a220[_0x9a1b('0x2b')][_0x9a1b('0x1a')]);}_0x262fec['order']=qs[_0x9a1b('0x34')](_0x53a220[_0x9a1b('0x2b')][_0x9a1b('0x34')]);_0x262fec[_0x9a1b('0x35')]=qs['filters'](_[_0x9a1b('0x36')](_0x53a220[_0x9a1b('0x2b')],_0x204106[_0x9a1b('0x2c')]),_0x236dca);if(_0x53a220[_0x9a1b('0x2b')][_0x9a1b('0x37')]){_0x262fec['where']=_['merge'](_0x262fec[_0x9a1b('0x35')],{'$or':_[_0x9a1b('0x2a')](_0x236dca,function(_0x3c199a){if(_0x3c199a['type']!==_0x9a1b('0x38')){var _0x17adcc={};_0x17adcc[_0x3c199a[_0x9a1b('0x24')]]={'$like':'%'+_0x53a220[_0x9a1b('0x2b')][_0x9a1b('0x37')]+'%'};return _0x17adcc;}})});}_0x262fec=_['merge']({},_0x262fec,_0x53a220[_0x9a1b('0x39')]);var _0x4e7d33={'where':_0x262fec[_0x9a1b('0x35')]};return db[_0x9a1b('0x26')][_0x9a1b('0x1c')](_0x4e7d33)[_0x9a1b('0x21')](function(_0x101a41){_0x2b253c[_0x9a1b('0x1c')]=_0x101a41;if(_0x53a220['query'][_0x9a1b('0x3a')]){_0x262fec['include']=[{'all':!![]}];}return db[_0x9a1b('0x26')][_0x9a1b('0x3b')](_0x262fec);})['then'](function(_0x3dbcf3){_0x2b253c['rows']=_0x3dbcf3;return _0x2b253c;})[_0x9a1b('0x21')](respondWithFilteredResult(_0x17d110,_0x262fec))[_0x9a1b('0x3c')](handleError(_0x17d110,null));};exports[_0x9a1b('0x3d')]=function(_0x49bd5a,_0x173938){var _0xde32c1={'raw':!![],'where':{'id':_0x49bd5a[_0x9a1b('0x3e')]['id']}},_0x347678={};_0x347678['model']=_[_0x9a1b('0x3f')](db['FaxApplication'][_0x9a1b('0x40')]);_0x347678[_0x9a1b('0x2b')]=_['keys'](_0x49bd5a['query']);_0x347678[_0x9a1b('0x2c')]=_[_0x9a1b('0x2d')](_0x347678['model'],_0x347678[_0x9a1b('0x2b')]);_0xde32c1[_0x9a1b('0x2f')]=_['intersection'](_0x347678[_0x9a1b('0x29')],qs[_0x9a1b('0x2e')](_0x49bd5a['query'][_0x9a1b('0x2e')]));_0xde32c1['attributes']=_0xde32c1['attributes']['length']?_0xde32c1['attributes']:_0x347678['model'];if(_0x49bd5a[_0x9a1b('0x2b')][_0x9a1b('0x3a')]){_0xde32c1[_0x9a1b('0x41')]=[{'all':!![]}];}_0xde32c1=_[_0x9a1b('0x42')]({},_0xde32c1,_0x49bd5a['options']);return db[_0x9a1b('0x26')]['find'](_0xde32c1)[_0x9a1b('0x21')](handleEntityNotFound(_0x173938,null))[_0x9a1b('0x21')](respondWithResult(_0x173938,null))[_0x9a1b('0x3c')](handleError(_0x173938,null));};exports['create']=function(_0x48fad8,_0x11ae77){return db[_0x9a1b('0x26')]['create'](_0x48fad8[_0x9a1b('0x43')],{})[_0x9a1b('0x21')](respondWithResult(_0x11ae77,0xc9))['catch'](handleError(_0x11ae77,null));};exports[_0x9a1b('0x44')]=function(_0x189d18,_0xfe20a2){if(_0x189d18[_0x9a1b('0x43')]['id']){delete _0x189d18['body']['id'];}return db[_0x9a1b('0x26')]['find']({'where':{'id':_0x189d18[_0x9a1b('0x3e')]['id']}})[_0x9a1b('0x21')](handleEntityNotFound(_0xfe20a2,null))['then'](saveUpdates(_0x189d18[_0x9a1b('0x43')],null))['then'](respondWithResult(_0xfe20a2,null))[_0x9a1b('0x3c')](handleError(_0xfe20a2,null));};exports['destroy']=function(_0x431156,_0x595599){return db[_0x9a1b('0x26')][_0x9a1b('0x45')]({'where':{'id':_0x431156['params']['id']}})[_0x9a1b('0x21')](handleEntityNotFound(_0x595599,null))[_0x9a1b('0x21')](removeEntity(_0x595599,null))[_0x9a1b('0x3c')](handleError(_0x595599,null));}; \ No newline at end of file +var _0x4bd0=['FaxApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','params','rawAttributes','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','name','send','index','map'];(function(_0x2cb2e4,_0x250d15){var _0x22a0f5=function(_0x19e78c){while(--_0x19e78c){_0x2cb2e4['push'](_0x2cb2e4['shift']());}};_0x22a0f5(++_0x250d15);}(_0x4bd0,0x16d));var _0x04bd=function(_0x4e1bc0,_0x2fd996){_0x4e1bc0=_0x4e1bc0-0x0;var _0x151f70=_0x4bd0[_0x4e1bc0];return _0x151f70;};'use strict';var emlformat=require(_0x04bd('0x0'));var rimraf=require(_0x04bd('0x1'));var zipdir=require(_0x04bd('0x2'));var jsonpatch=require(_0x04bd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x04bd('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x04bd('0x5'));var sox=require(_0x04bd('0x6'));var csv=require(_0x04bd('0x7'));var ejs=require(_0x04bd('0x8'));var fs=require('fs');var fs_extra=require(_0x04bd('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x04bd('0xa'));var jsforce=require(_0x04bd('0xb'));var deskjs=require(_0x04bd('0xc'));var toCsv=require(_0x04bd('0x7'));var querystring=require('querystring');var Papa=require(_0x04bd('0xd'));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(_0x04bd('0xe'));var logger=require(_0x04bd('0xf'))(_0x04bd('0x10'));var utils=require('../../config/utils');var config=require(_0x04bd('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34b5b4,_0x15f8cd){_0x15f8cd=_0x15f8cd||0xcc;return function(_0x593913){if(_0x593913){return _0x34b5b4[_0x04bd('0x12')](_0x15f8cd);}return _0x34b5b4[_0x04bd('0x13')](_0x15f8cd)[_0x04bd('0x14')]();};}function respondWithResult(_0x31444d,_0x9ad09b){_0x9ad09b=_0x9ad09b||0xc8;return function(_0x59a53d){if(_0x59a53d){return _0x31444d[_0x04bd('0x13')](_0x9ad09b)['json'](_0x59a53d);}};}function respondWithFilteredResult(_0x2eabc3,_0x280418){return function(_0x2a3ff5){if(_0x2a3ff5){var _0x45437e=typeof _0x280418[_0x04bd('0x15')]===_0x04bd('0x16')&&typeof _0x280418[_0x04bd('0x17')]===_0x04bd('0x16');var _0x966f9=_0x2a3ff5[_0x04bd('0x18')];var _0x585768=_0x45437e?0x0:_0x280418['offset'];var _0x194142=_0x45437e?_0x2a3ff5[_0x04bd('0x18')]:_0x280418['offset']+_0x280418['limit'];var _0x13cfee;if(_0x194142>=_0x966f9){_0x194142=_0x966f9;_0x13cfee=0xc8;}else{_0x13cfee=0xce;}_0x2eabc3[_0x04bd('0x13')](_0x13cfee);return _0x2eabc3[_0x04bd('0x19')](_0x04bd('0x1a'),_0x585768+'-'+_0x194142+'/'+_0x966f9)[_0x04bd('0x1b')](_0x2a3ff5);}return null;};}function patchUpdates(_0xd8716a){return function(_0x324960){try{jsonpatch[_0x04bd('0x1c')](_0x324960,_0xd8716a,!![]);}catch(_0x4ba768){return BPromise[_0x04bd('0x1d')](_0x4ba768);}return _0x324960[_0x04bd('0x1e')]();};}function saveUpdates(_0x52071d,_0x143afa){return function(_0x287171){if(_0x287171){return _0x287171[_0x04bd('0x1f')](_0x52071d)[_0x04bd('0x20')](function(_0x227b5d){return _0x227b5d;});}return null;};}function removeEntity(_0x11b6de,_0x32b848){return function(_0x5f0afe){if(_0x5f0afe){return _0x5f0afe['destroy']()[_0x04bd('0x20')](function(){_0x11b6de[_0x04bd('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x202a16,_0x1fccd3){return function(_0x5129cf){if(!_0x5129cf){_0x202a16[_0x04bd('0x12')](0x194);}return _0x5129cf;};}function handleError(_0x264201,_0x587803){_0x587803=_0x587803||0x1f4;return function(_0x62b5c8){logger['error'](_0x62b5c8['stack']);if(_0x62b5c8[_0x04bd('0x21')]){delete _0x62b5c8[_0x04bd('0x21')];}_0x264201[_0x04bd('0x13')](_0x587803)[_0x04bd('0x22')](_0x62b5c8);};}exports[_0x04bd('0x23')]=function(_0x50cab6,_0x52a890){var _0x5245f3={},_0x22f11a={},_0x5de1b7={'count':0x0,'rows':[]};var _0x396572=_[_0x04bd('0x24')](db[_0x04bd('0x25')]['rawAttributes'],function(_0x4cd603){return{'name':_0x4cd603[_0x04bd('0x26')],'type':_0x4cd603[_0x04bd('0x27')][_0x04bd('0x28')]};});_0x22f11a[_0x04bd('0x29')]=_[_0x04bd('0x24')](_0x396572,'name');_0x22f11a[_0x04bd('0x2a')]=_[_0x04bd('0x2b')](_0x50cab6[_0x04bd('0x2a')]);_0x22f11a[_0x04bd('0x2c')]=_[_0x04bd('0x2d')](_0x22f11a[_0x04bd('0x29')],_0x22f11a[_0x04bd('0x2a')]);_0x5245f3[_0x04bd('0x2e')]=_[_0x04bd('0x2d')](_0x22f11a[_0x04bd('0x29')],qs['fields'](_0x50cab6[_0x04bd('0x2a')][_0x04bd('0x2f')]));_0x5245f3['attributes']=_0x5245f3[_0x04bd('0x2e')][_0x04bd('0x30')]?_0x5245f3['attributes']:_0x22f11a[_0x04bd('0x29')];if(!_0x50cab6['query'][_0x04bd('0x31')]('nolimit')){_0x5245f3[_0x04bd('0x17')]=qs['limit'](_0x50cab6[_0x04bd('0x2a')]['limit']);_0x5245f3[_0x04bd('0x15')]=qs[_0x04bd('0x15')](_0x50cab6['query'][_0x04bd('0x15')]);}_0x5245f3[_0x04bd('0x32')]=qs[_0x04bd('0x33')](_0x50cab6[_0x04bd('0x2a')]['sort']);_0x5245f3[_0x04bd('0x34')]=qs[_0x04bd('0x2c')](_['pick'](_0x50cab6[_0x04bd('0x2a')],_0x22f11a[_0x04bd('0x2c')]),_0x396572);if(_0x50cab6['query'][_0x04bd('0x35')]){_0x5245f3['where']=_[_0x04bd('0x36')](_0x5245f3['where'],{'$or':_[_0x04bd('0x24')](_0x396572,function(_0x5a421a){if(_0x5a421a['type']!==_0x04bd('0x37')){var _0x4d541f={};_0x4d541f[_0x5a421a[_0x04bd('0x21')]]={'$like':'%'+_0x50cab6[_0x04bd('0x2a')][_0x04bd('0x35')]+'%'};return _0x4d541f;}})});}_0x5245f3=_[_0x04bd('0x36')]({},_0x5245f3,_0x50cab6[_0x04bd('0x38')]);var _0x3e181e={'where':_0x5245f3[_0x04bd('0x34')]};return db['FaxApplication']['count'](_0x3e181e)[_0x04bd('0x20')](function(_0x478185){_0x5de1b7[_0x04bd('0x18')]=_0x478185;if(_0x50cab6[_0x04bd('0x2a')][_0x04bd('0x39')]){_0x5245f3[_0x04bd('0x3a')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x5245f3);})[_0x04bd('0x20')](function(_0x1241c5){_0x5de1b7['rows']=_0x1241c5;return _0x5de1b7;})[_0x04bd('0x20')](respondWithFilteredResult(_0x52a890,_0x5245f3))['catch'](handleError(_0x52a890,null));};exports[_0x04bd('0x3b')]=function(_0x5b0f07,_0x20ea9d){var _0x31c20c={'raw':!![],'where':{'id':_0x5b0f07[_0x04bd('0x3c')]['id']}},_0x7a19b1={};_0x7a19b1[_0x04bd('0x29')]=_[_0x04bd('0x2b')](db[_0x04bd('0x25')][_0x04bd('0x3d')]);_0x7a19b1[_0x04bd('0x2a')]=_[_0x04bd('0x2b')](_0x5b0f07[_0x04bd('0x2a')]);_0x7a19b1['filters']=_[_0x04bd('0x2d')](_0x7a19b1[_0x04bd('0x29')],_0x7a19b1[_0x04bd('0x2a')]);_0x31c20c[_0x04bd('0x2e')]=_['intersection'](_0x7a19b1[_0x04bd('0x29')],qs[_0x04bd('0x2f')](_0x5b0f07[_0x04bd('0x2a')][_0x04bd('0x2f')]));_0x31c20c['attributes']=_0x31c20c[_0x04bd('0x2e')][_0x04bd('0x30')]?_0x31c20c[_0x04bd('0x2e')]:_0x7a19b1['model'];if(_0x5b0f07[_0x04bd('0x2a')][_0x04bd('0x39')]){_0x31c20c[_0x04bd('0x3a')]=[{'all':!![]}];}_0x31c20c=_['merge']({},_0x31c20c,_0x5b0f07[_0x04bd('0x38')]);return db[_0x04bd('0x25')][_0x04bd('0x3e')](_0x31c20c)[_0x04bd('0x20')](handleEntityNotFound(_0x20ea9d,null))[_0x04bd('0x20')](respondWithResult(_0x20ea9d,null))[_0x04bd('0x3f')](handleError(_0x20ea9d,null));};exports[_0x04bd('0x40')]=function(_0x511836,_0x228667){return db['FaxApplication'][_0x04bd('0x40')](_0x511836[_0x04bd('0x41')],{})[_0x04bd('0x20')](respondWithResult(_0x228667,0xc9))['catch'](handleError(_0x228667,null));};exports[_0x04bd('0x1f')]=function(_0x31e24d,_0x442246){if(_0x31e24d['body']['id']){delete _0x31e24d['body']['id'];}return db[_0x04bd('0x25')]['find']({'where':{'id':_0x31e24d['params']['id']}})[_0x04bd('0x20')](handleEntityNotFound(_0x442246,null))[_0x04bd('0x20')](saveUpdates(_0x31e24d[_0x04bd('0x41')],null))['then'](respondWithResult(_0x442246,null))[_0x04bd('0x3f')](handleError(_0x442246,null));};exports[_0x04bd('0x42')]=function(_0x1b83dc,_0xdf6664){return db[_0x04bd('0x25')][_0x04bd('0x3e')]({'where':{'id':_0x1b83dc[_0x04bd('0x3c')]['id']}})[_0x04bd('0x20')](handleEntityNotFound(_0xdf6664,null))[_0x04bd('0x20')](removeEntity(_0xdf6664,null))[_0x04bd('0x3f')](handleError(_0xdf6664,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 8ed0953..e71f375 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 _0xe2d4=['../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird'];(function(_0x45c01a,_0x3c3971){var _0x342bda=function(_0x45d48a){while(--_0x45d48a){_0x45c01a['push'](_0x45c01a['shift']());}};_0x342bda(++_0x3c3971);}(_0xe2d4,0x9d));var _0x4e2d=function(_0x404aba,_0x203ee9){_0x404aba=_0x404aba-0x0;var _0x2b842b=_0xe2d4[_0x404aba];return _0x2b842b;};'use strict';var _=require('lodash');var util=require(_0x4e2d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4e2d('0x1'));var BPromise=require(_0x4e2d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4e2d('0x3'));var attributes=require(_0x4e2d('0x4'));module[_0x4e2d('0x5')]=function(_0x12583e,_0x43018b){return _0x12583e['define'](_0x4e2d('0x6'),attributes,{'tableName':_0x4e2d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4e2d('0x8'),'collate':_0x4e2d('0x9')});}; \ No newline at end of file +var _0xe73b=['exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','./faxApplication.attributes'];(function(_0x371f13,_0x3e89fc){var _0x50b54b=function(_0x1b902e){while(--_0x1b902e){_0x371f13['push'](_0x371f13['shift']());}};_0x50b54b(++_0x3e89fc);}(_0xe73b,0x1c0));var _0xbe73=function(_0x520e16,_0x545cb6){_0x520e16=_0x520e16-0x0;var _0x4771b5=_0xe73b[_0x520e16];return _0x4771b5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbe73('0x0'))('api');var moment=require(_0xbe73('0x1'));var BPromise=require(_0xbe73('0x2'));var rp=require(_0xbe73('0x3'));var fs=require('fs');var path=require(_0xbe73('0x4'));var rimraf=require(_0xbe73('0x5'));var config=require('../../config/environment');var attributes=require(_0xbe73('0x6'));module[_0xbe73('0x7')]=function(_0x3a3003,_0x1fe1c8){return _0x3a3003[_0xbe73('0x8')](_0xbe73('0x9'),attributes,{'tableName':_0xbe73('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbe73('0xb'),'collate':_0xbe73('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 2d8fabd..e8593e5 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 _0x1c7b=['options','raw','where','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateFaxApplication','FaxApplication','body'];(function(_0x356a22,_0x241023){var _0x3b9add=function(_0x22fc24){while(--_0x22fc24){_0x356a22['push'](_0x356a22['shift']());}};_0x3b9add(++_0x241023);}(_0x1c7b,0x1d4));var _0xb1c7=function(_0x4f985c,_0x1ad59d){_0x4f985c=_0x4f985c-0x0;var _0x4dc233=_0x1c7b[_0x4f985c];return _0x4dc233;};'use strict';var _=require(_0xb1c7('0x0'));var util=require(_0xb1c7('0x1'));var moment=require(_0xb1c7('0x2'));var BPromise=require(_0xb1c7('0x3'));var rs=require(_0xb1c7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1c7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb1c7('0x6'));var config=require(_0xb1c7('0x7'));var jayson=require(_0xb1c7('0x8'));var client=jayson[_0xb1c7('0x9')][_0xb1c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1baea7,_0x3bcdd9,_0x3d6190){return new BPromise(function(_0x50e706,_0x5bdf16){return client[_0xb1c7('0xb')](_0x1baea7,_0x3d6190)[_0xb1c7('0xc')](function(_0x4890f6){logger[_0xb1c7('0xd')](_0xb1c7('0xe'),_0x3bcdd9,_0xb1c7('0xf'));logger[_0xb1c7('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x3bcdd9,_0xb1c7('0xf'),JSON[_0xb1c7('0x11')](_0x4890f6));if(_0x4890f6[_0xb1c7('0x12')]){if(_0x4890f6[_0xb1c7('0x12')][_0xb1c7('0x13')]===0x1f4){logger[_0xb1c7('0x12')](_0xb1c7('0xe'),_0x3bcdd9,_0x4890f6[_0xb1c7('0x12')][_0xb1c7('0x14')]);return _0x5bdf16(_0x4890f6[_0xb1c7('0x12')]['message']);}logger[_0xb1c7('0x12')]('FaxApplication,\x20%s,\x20%s',_0x3bcdd9,_0x4890f6[_0xb1c7('0x12')][_0xb1c7('0x14')]);return _0x50e706(_0x4890f6[_0xb1c7('0x12')][_0xb1c7('0x14')]);}else{logger[_0xb1c7('0xd')](_0xb1c7('0xe'),_0x3bcdd9,'request\x20sent');_0x50e706(_0x4890f6['result']['message']);}})[_0xb1c7('0x15')](function(_0x2a0d6f){logger[_0xb1c7('0x12')](_0xb1c7('0xe'),_0x3bcdd9,_0x2a0d6f);_0x5bdf16(_0x2a0d6f);});});}exports[_0xb1c7('0x16')]=function(_0x8cbddb){var _0x3b1d76=this;return new Promise(function(_0x11d8d2,_0xa9fbc2){return db[_0xb1c7('0x17')]['update'](_0x8cbddb[_0xb1c7('0x18')],{'raw':_0x8cbddb[_0xb1c7('0x19')]?_0x8cbddb[_0xb1c7('0x19')][_0xb1c7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8cbddb[_0xb1c7('0x19')]?_0x8cbddb['options'][_0xb1c7('0x1b')]||null:null,'attributes':_0x8cbddb['options']?_0x8cbddb[_0xb1c7('0x19')]['attributes']||null:null,'limit':_0x8cbddb[_0xb1c7('0x19')]?_0x8cbddb[_0xb1c7('0x19')][_0xb1c7('0x1c')]||null:null})[_0xb1c7('0xc')](function(_0xa54ff0){logger[_0xb1c7('0xd')](_0xb1c7('0x16'),_0x8cbddb);logger[_0xb1c7('0x10')](_0xb1c7('0x16'),_0x8cbddb,JSON['stringify'](_0xa54ff0));_0x11d8d2(_0xa54ff0);})[_0xb1c7('0x15')](function(_0x18a302){logger[_0xb1c7('0x12')](_0xb1c7('0x16'),_0x18a302['message'],_0x8cbddb);_0xa9fbc2(_0x3b1d76[_0xb1c7('0x12')](0x1f4,_0x18a302['message']));});});}; \ No newline at end of file +var _0x3b70=['info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','catch','FaxApplication','update','body','options','raw','where','attributes','limit','UpdateFaxApplication','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4e14ea,_0x564c20){var _0x50c3cf=function(_0x20edb2){while(--_0x20edb2){_0x4e14ea['push'](_0x4e14ea['shift']());}};_0x50c3cf(++_0x564c20);}(_0x3b70,0x13c));var _0x03b7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3b70[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x03b7('0x0'));var util=require(_0x03b7('0x1'));var moment=require(_0x03b7('0x2'));var BPromise=require(_0x03b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03b7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x03b7('0x5'));var logger=require(_0x03b7('0x6'))(_0x03b7('0x7'));var config=require(_0x03b7('0x8'));var jayson=require(_0x03b7('0x9'));var client=jayson[_0x03b7('0xa')][_0x03b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfaec4d,_0x57edea,_0x44c2c1){return new BPromise(function(_0x2b423a,_0x335a1c){return client[_0x03b7('0xc')](_0xfaec4d,_0x44c2c1)[_0x03b7('0xd')](function(_0x5acb4e){logger[_0x03b7('0xe')]('FaxApplication,\x20%s,\x20%s',_0x57edea,_0x03b7('0xf'));logger[_0x03b7('0x10')](_0x03b7('0x11'),_0x57edea,_0x03b7('0xf'),JSON[_0x03b7('0x12')](_0x5acb4e));if(_0x5acb4e[_0x03b7('0x13')]){if(_0x5acb4e[_0x03b7('0x13')][_0x03b7('0x14')]===0x1f4){logger[_0x03b7('0x13')](_0x03b7('0x15'),_0x57edea,_0x5acb4e['error']['message']);return _0x335a1c(_0x5acb4e['error']['message']);}logger['error'](_0x03b7('0x15'),_0x57edea,_0x5acb4e['error']['message']);return _0x2b423a(_0x5acb4e[_0x03b7('0x13')][_0x03b7('0x16')]);}else{logger[_0x03b7('0xe')](_0x03b7('0x15'),_0x57edea,_0x03b7('0xf'));_0x2b423a(_0x5acb4e['result']['message']);}})[_0x03b7('0x17')](function(_0x3de96f){logger['error'](_0x03b7('0x15'),_0x57edea,_0x3de96f);_0x335a1c(_0x3de96f);});});}exports['UpdateFaxApplication']=function(_0x18b56f){var _0x2c5031=this;return new Promise(function(_0xbadb2a,_0x12f644){return db[_0x03b7('0x18')][_0x03b7('0x19')](_0x18b56f[_0x03b7('0x1a')],{'raw':_0x18b56f[_0x03b7('0x1b')]?_0x18b56f[_0x03b7('0x1b')][_0x03b7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18b56f['options']?_0x18b56f['options'][_0x03b7('0x1d')]||null:null,'attributes':_0x18b56f[_0x03b7('0x1b')]?_0x18b56f[_0x03b7('0x1b')][_0x03b7('0x1e')]||null:null,'limit':_0x18b56f['options']?_0x18b56f[_0x03b7('0x1b')][_0x03b7('0x1f')]||null:null})[_0x03b7('0xd')](function(_0x575474){logger[_0x03b7('0xe')]('UpdateFaxApplication',_0x18b56f);logger[_0x03b7('0x10')](_0x03b7('0x20'),_0x18b56f,JSON[_0x03b7('0x12')](_0x575474));_0xbadb2a(_0x575474);})[_0x03b7('0x17')](function(_0x3dd6d4){logger[_0x03b7('0x13')]('UpdateFaxApplication',_0x3dd6d4[_0x03b7('0x16')],_0x18b56f);_0x12f644(_0x2c5031[_0x03b7('0x13')](0x1f4,_0x3dd6d4[_0x03b7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 6af833d..3c824bc 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 _0x955f=['path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x955f,0x1eb));var _0xf955=function(_0x45b48f,_0x45522c){_0x45b48f=_0x45b48f-0x0;var _0x48c960=_0x955f[_0x45b48f];return _0x48c960;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./faxApplication.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['show']);router[_0xf955('0xb')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')](_0xf955('0xa'),auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['delete'](_0xf955('0xa'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);module[_0xf955('0x10')]=router; \ No newline at end of file +var _0xd7d1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x210f07,_0x9468bd){_0x210f07=_0x210f07-0x0;var _0x92a15f=_0xd7d1[_0x210f07];return _0x92a15f;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xf')]('/',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0x11')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router['delete'](_0x1d7d('0xd'),auth['isAuthenticated'](),controller[_0x1d7d('0x13')]);module[_0x1d7d('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index c015fea..dad7a73 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 _0x6589=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x39f34c,_0x24728c){var _0x19cbcc=function(_0x4c07f7){while(--_0x4c07f7){_0x39f34c['push'](_0x39f34c['shift']());}};_0x19cbcc(++_0x24728c);}(_0x6589,0xd7));var _0x9658=function(_0x2ae8ce,_0x2a5a1f){_0x2ae8ce=_0x2ae8ce-0x0;var _0x4bf686=_0x6589[_0x2ae8ce];return _0x4bf686;};'use strict';var Sequelize=require(_0x9658('0x0'));module[_0x9658('0x1')]={'closed':{'type':Sequelize[_0x9658('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9658('0x3')]},'disposition':{'type':Sequelize[_0x9658('0x4')]},'secondDisposition':{'type':Sequelize[_0x9658('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9658('0x4')]},'note':{'type':Sequelize[_0x9658('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x9658('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9658('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9658('0x5')]('in',_0x9658('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xc252=['BOOLEAN','DATE','STRING','out','ENUM','sequelize'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0xc252,0xf5));var _0x2c25=function(_0x3d279d,_0x21718b){_0x3d279d=_0x3d279d-0x0;var _0x5f4d3d=_0xc252[_0x3d279d];return _0x5f4d3d;};'use strict';var Sequelize=require(_0x2c25('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2c25('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2c25('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2c25('0x3')]},'note':{'type':Sequelize[_0x2c25('0x3')]},'read1stAt':{'type':Sequelize[_0x2c25('0x2')]},'fax':{'type':Sequelize[_0x2c25('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x2c25('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2c25('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x2c25('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index c2ff537..a68a61c 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 _0x162a=['index','FaxInteraction','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','from','tools_tags','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','FaxAccountId','where','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IN\x20?','agent','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','rows','show','params','includeAll','include','options','create','update','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','unix','join','server','files','attachments','transcript-%d-%s.zip','Messages','mkdirSync','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','download','log','err','unlinkSync','rimraf','request-promise','bluebird','mustache','util','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','offset','undefined','count','limit','set','apply','reject','save','then','destroy','sendStatus','error','stack','name','map','fullname','Tags','TagIds','split','forEach','catch','waiting','talking','answered','unmanaged','total','closed','UserId'];(function(_0x1ee938,_0x22267f){var _0x3ebf3b=function(_0x10611e){while(--_0x10611e){_0x1ee938['push'](_0x1ee938['shift']());}};_0x3ebf3b(++_0x22267f);}(_0x162a,0x17d));var _0xa162=function(_0x543e77,_0x4e41b1){_0x543e77=_0x543e77-0x0;var _0x545860=_0x162a[_0x543e77];return _0x545860;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa162('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa162('0x1'));var moment=require('moment');var BPromise=require(_0xa162('0x2'));var Mustache=require(_0xa162('0x3'));var util=require(_0xa162('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xa162('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa162('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa162('0x7'));var jsforce=require(_0xa162('0x8'));var deskjs=require(_0xa162('0x9'));var toCsv=require(_0xa162('0x5'));var querystring=require(_0xa162('0xa'));var Papa=require(_0xa162('0xb'));var Redis=require(_0xa162('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa162('0xd'));var hardwareService=require(_0xa162('0xe'));var logger=require(_0xa162('0xf'))(_0xa162('0x10'));var utils=require(_0xa162('0x11'));var config=require(_0xa162('0x12'));var licenseUtil=require(_0xa162('0x13'));var db=require(_0xa162('0x14'))['db'];config[_0xa162('0x15')]=_[_0xa162('0x16')](config[_0xa162('0x15')],{'host':_0xa162('0x17'),'port':0x18eb});var socket=require(_0xa162('0x18'))(new Redis(config[_0xa162('0x15')]));require(_0xa162('0x19'))[_0xa162('0x1a')](socket);function respondWithStatusCode(_0x1ac5fd,_0x125d6f){_0x125d6f=_0x125d6f||0xcc;return function(_0x2fc5ee){if(_0x2fc5ee){return _0x1ac5fd['sendStatus'](_0x125d6f);}return _0x1ac5fd[_0xa162('0x1b')](_0x125d6f)[_0xa162('0x1c')]();};}function respondWithResult(_0x6cc0e4,_0x150466){_0x150466=_0x150466||0xc8;return function(_0x17f2dc){if(_0x17f2dc){return _0x6cc0e4[_0xa162('0x1b')](_0x150466)['json'](_0x17f2dc);}};}function respondWithFilteredResult(_0x3d989a,_0x33a1dd){return function(_0x33e066){if(_0x33e066){var _0x3c2af6=typeof _0x33a1dd[_0xa162('0x1d')]==='undefined'&&typeof _0x33a1dd['limit']===_0xa162('0x1e');var _0x509a9b=_0x33e066[_0xa162('0x1f')];var _0x32784d=_0x3c2af6?0x0:_0x33a1dd[_0xa162('0x1d')];var _0x267bb6=_0x3c2af6?_0x33e066[_0xa162('0x1f')]:_0x33a1dd[_0xa162('0x1d')]+_0x33a1dd[_0xa162('0x20')];var _0x4f2fc2;if(_0x267bb6>=_0x509a9b){_0x267bb6=_0x509a9b;_0x4f2fc2=0xc8;}else{_0x4f2fc2=0xce;}_0x3d989a[_0xa162('0x1b')](_0x4f2fc2);return _0x3d989a[_0xa162('0x21')]('Content-Range',_0x32784d+'-'+_0x267bb6+'/'+_0x509a9b)['json'](_0x33e066);}return null;};}function patchUpdates(_0x3a46f1){return function(_0x413a1e){try{jsonpatch[_0xa162('0x22')](_0x413a1e,_0x3a46f1,!![]);}catch(_0x452720){return BPromise[_0xa162('0x23')](_0x452720);}return _0x413a1e[_0xa162('0x24')]();};}function saveUpdates(_0x5cb8e7,_0x228825){return function(_0x1e0dca){if(_0x1e0dca){return _0x1e0dca['update'](_0x5cb8e7)[_0xa162('0x25')](function(_0x75e913){return _0x75e913;});}return null;};}function removeEntity(_0x2749dc,_0x5d97b7){return function(_0x1c310e){if(_0x1c310e){return _0x1c310e[_0xa162('0x26')]()[_0xa162('0x25')](function(){_0x2749dc['status'](0xcc)[_0xa162('0x1c')]();});}};}function handleEntityNotFound(_0x19f39e,_0x506763){return function(_0x598321){if(!_0x598321){_0x19f39e[_0xa162('0x27')](0x194);}return _0x598321;};}function handleError(_0x5ad12e,_0x331238){_0x331238=_0x331238||0x1f4;return function(_0x3d6db5){logger[_0xa162('0x28')](_0x3d6db5[_0xa162('0x29')]);if(_0x3d6db5[_0xa162('0x2a')]){delete _0x3d6db5[_0xa162('0x2a')];}_0x5ad12e['status'](_0x331238)['send'](_0x3d6db5);};}function getInteractionUsers(_0x5663cf,_0x3fedf4){return new BPromise(function(_0x2476b3,_0x5e20fe){try{if(_0x3fedf4[_0x5663cf['id']]){_0x5663cf['Users']=_[_0xa162('0x2b')](_0x3fedf4[_0x5663cf['id']],function(_0x270ab){return{'id':_0x270ab['id'],'fullname':_0x270ab[_0xa162('0x2c')]};});}}catch(_0x597608){_0x5e20fe(_0x597608);}_0x2476b3(_0x5663cf);});}function getInteractionTags(_0x244b9b,_0x5bafb9){return new BPromise(function(_0x2a003d,_0x2f1046){try{if(_0x244b9b['TagIds']){_0x244b9b[_0xa162('0x2d')]=[];_0x244b9b[_0xa162('0x2e')][_0xa162('0x2f')](',')[_0xa162('0x30')](function(_0x473c9c){_0x244b9b[_0xa162('0x2d')]['push'](_0x5bafb9[_0x473c9c]);});}delete _0x244b9b[_0xa162('0x2e')];}catch(_0x24cc51){_0x2f1046(_0x24cc51);}_0x2a003d(_0x244b9b);});}function updateFaxInteraction(_0x42f7b8,_0x29bf63,_0x56622c){return new BPromise(function(_0x24fd61,_0x1737be){return getInteractionUsers(_0x42f7b8,_0x56622c)[_0xa162('0x25')](function(_0x3e318d){return getInteractionTags(_0x3e318d,_0x29bf63);})[_0xa162('0x25')](function(_0x19284){return getStateInteraction(_0x19284);})[_0xa162('0x25')](function(_0x106a4d){_0x24fd61(_0x106a4d);})[_0xa162('0x31')](function(_0x2d8905){_0x1737be(_0x2d8905);});});}function getStateInteraction(_0x5016ff){return new BPromise(function(_0x1e3aed){_0x5016ff[_0xa162('0x32')]=0x0;_0x5016ff[_0xa162('0x33')]=0x0;_0x5016ff[_0xa162('0x34')]=0x0;_0x5016ff[_0xa162('0x35')]=0x0;_0x5016ff[_0xa162('0x36')]=0x0;if(!_0x5016ff[_0xa162('0x37')]&&!_0x5016ff[_0xa162('0x38')]){_0x5016ff['waiting']+=0x1;}if(!_0x5016ff[_0xa162('0x37')]&&_0x5016ff[_0xa162('0x38')]){_0x5016ff[_0xa162('0x33')]+=0x1;if(_0x5016ff['waiting']){_0x5016ff[_0xa162('0x32')]-=0x1;}}if(_0x5016ff[_0xa162('0x37')]&&_0x5016ff[_0xa162('0x38')]){_0x5016ff[_0xa162('0x34')]+=0x1;if(_0x5016ff[_0xa162('0x33')]){_0x5016ff['talking']-=0x1;}}if(_0x5016ff[_0xa162('0x37')]&&!_0x5016ff['UserId']){_0x5016ff['unmanaged']+=0x1;if(_0x5016ff['waiting']){_0x5016ff[_0xa162('0x32')]-=0x1;}}_0x5016ff['total']+=0x1;_0x1e3aed(_0x5016ff);});}exports[_0xa162('0x39')]=function(_0x3e0fd4,_0x3531fd){var _0x253ec2={},_0x3ab84b={},_0x5bf78c={'count':0x0,'rows':[]};var _0x4e1413=_[_0xa162('0x2b')](db[_0xa162('0x3a')][_0xa162('0x3b')],function(_0x41e436){return{'name':_0x41e436['fieldName'],'type':_0x41e436[_0xa162('0x3c')]['key']};});_0x3ab84b['model']=_['map'](_0x4e1413,_0xa162('0x2a'));_0x3ab84b[_0xa162('0x3d')]=_[_0xa162('0x3e')](_0x3e0fd4[_0xa162('0x3d')]);_0x3ab84b[_0xa162('0x3f')]=_['intersection'](_0x3ab84b['model'],_0x3ab84b[_0xa162('0x3d')]);_0x253ec2['attributes']=_[_0xa162('0x40')](_0x3ab84b[_0xa162('0x41')],qs[_0xa162('0x42')](_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x42')]));_0x253ec2[_0xa162('0x43')]=_0x253ec2[_0xa162('0x43')][_0xa162('0x44')]?_0x253ec2[_0xa162('0x43')]:_0x3ab84b[_0xa162('0x41')];if(!_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x45')](_0xa162('0x46'))){_0x253ec2[_0xa162('0x20')]=qs[_0xa162('0x20')](_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x20')]);_0x253ec2[_0xa162('0x1d')]=qs[_0xa162('0x1d')](_0x3e0fd4['query']['offset']);}_0x253ec2['order']=qs[_0xa162('0x47')](_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x47')]);_0x253ec2['where']=qs[_0xa162('0x3f')](_[_0xa162('0x48')](_0x3e0fd4[_0xa162('0x3d')],_0x3ab84b[_0xa162('0x3f')]),_0x4e1413);var _0x287592=[];var _0x232324=squel[_0xa162('0x49')]()['field']('id')[_0xa162('0x4a')](_0xa162('0x2a'))[_0xa162('0x4a')]('color')[_0xa162('0x4b')](_0xa162('0x4c'));var _0x4bef86=squel[_0xa162('0x49')]()[_0xa162('0x4a')]('u.id')[_0xa162('0x4a')]('u.fullname')['field'](_0xa162('0x4d'))['from'](_0xa162('0x4e'),'ui')[_0xa162('0x4f')]('users','u',_0xa162('0x50'));var _0x21cfc2=squel[_0xa162('0x49')]()[_0xa162('0x4b')](_0xa162('0x51'),'i')[_0xa162('0x4f')](_0xa162('0x52'),'c',_0xa162('0x53'))['left_join'](_0xa162('0x54'),'o',_0xa162('0x55'))['left_join'](_0xa162('0x56'),'a',_0xa162('0x57'))[_0xa162('0x4f')](_0xa162('0x58'),'me',_0xa162('0x59'))[_0xa162('0x4f')](_0xa162('0x5a'),'it',_0xa162('0x5b'))[_0xa162('0x4f')](_0xa162('0x4c'),'t',_0xa162('0x5c'));var _0x33a6ba=squel['expr']();var _0x5b4930=[];var _0x44557a=squel[_0xa162('0x5d')]();var _0x5c1e65;if(_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x5e')]){_0x5c1e65=as['parseSearch'](_0x3e0fd4['query'][_0xa162('0x5e')]);var _0x345be0=_0x5c1e65[_0xa162('0x5f')];for(var _0xafba37=0x0;_0xafba37<_0x5c1e65[_0xa162('0x60')]['length'];_0xafba37++){var _0x32b92f=_0x5c1e65['conditions'][_0xafba37];var _0x43a25a='i';var _0x145915=_['find'](_0x4e1413,[_0xa162('0x2a'),_0x32b92f[_0xa162('0x4a')]]);if(!_0x145915){switch(_0x32b92f[_0xa162('0x4a')]){case _0xa162('0x61'):if(_0x32b92f[_0xa162('0x62')]==0x1){_0x21cfc2[_0xa162('0x63')]('`'+_0x32b92f[_0xa162('0x4a')]+_0xa162('0x64'));}else{_0x21cfc2[_0xa162('0x63')]('`'+_0x32b92f[_0xa162('0x4a')]+_0xa162('0x65'));}break;case _0xa162('0x66'):if(_0x32b92f[_0xa162('0x67')]===_0xa162('0x68')){if(_0x32b92f[_0xa162('0x62')][_0xa162('0x2f')]('\x20')['length']>0x1){_0x33a6ba[_0x345be0]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa162('0x69')](_0x32b92f[_0xa162('0x62')]),null);}else{var _0x1fab1f='%'+_0x32b92f['value']+'%';_0x33a6ba[_0x345be0](_0xa162('0x6a'),_0x1fab1f,_0x1fab1f,_0x1fab1f);}}else{_0x145915=_[_0xa162('0x6b')](_0x4e1413,[_0xa162('0x2a'),_0xa162('0x6c')]);_0x32b92f[_0xa162('0x4a')]=_0xa162('0x6c');_0xb2114=as[_0xa162('0x6d')](_0x43a25a,_0x145915['type'],_0x32b92f);_0x33a6ba[_0x345be0](_0xb2114[_0xa162('0x6e')],_0xb2114[_0xa162('0x62')][_0xa162('0x6f')],_0xb2114['value'][_0xa162('0x1c')]);}break;case _0xa162('0x70'):var _0x2650d6=_0x32b92f[_0xa162('0x62')][_0xa162('0x2f')](',')[_0xa162('0x2b')](function(_0x34d011){return Number(_0x34d011);});_0x2650d6[_0xa162('0x30')](function(_0x2b6b61){_0x44557a['or'](_0xa162('0x71'),'%,'+_0x2b6b61+',%');});_0x5b4930=_[_0xa162('0x72')](_0x5b4930,_0x2650d6);break;case'User':if(_0x32b92f['operator']===_0xa162('0x68')){_0x33a6ba[_0x345be0](_0xa162('0x73'),'%'+_0x32b92f[_0xa162('0x62')]+'%',null);}else{_0x145915=_[_0xa162('0x6b')](_0x4e1413,[_0xa162('0x2a'),'UserId']);_0x32b92f[_0xa162('0x4a')]=_0xa162('0x38');_0xb2114=as[_0xa162('0x6d')](_0x43a25a,_0x145915[_0xa162('0x3c')],_0x32b92f);_0x33a6ba[_0x345be0](_0xb2114['text'],_0xb2114['value'][_0xa162('0x6f')],_0xb2114['value']['end']);}break;case _0xa162('0x74'):_0xb2114=as['buildExpression']('me',null,_0x32b92f);_0x33a6ba[_0x345be0](_0xb2114[_0xa162('0x6e')],_0xb2114[_0xa162('0x62')][_0xa162('0x6f')],_0xb2114[_0xa162('0x62')][_0xa162('0x1c')]);break;}}else{var _0xb2114=as[_0xa162('0x6d')](_0x43a25a,_0x145915[_0xa162('0x3c')],_0x32b92f);_0x33a6ba[_0x345be0](_0xb2114[_0xa162('0x6e')],_0xb2114[_0xa162('0x62')][_0xa162('0x6f')],_0xb2114[_0xa162('0x62')][_0xa162('0x1c')]);}}}else{var _0x28852e=_(_0x3e0fd4[_0xa162('0x3d')])[_0xa162('0x3e')]()[_0xa162('0x2b')](function(_0x505cc5){return _[_0xa162('0x75')](_0x4e1413,[_0xa162('0x2a'),_0x505cc5])?_0x505cc5:undefined;})[_0xa162('0x76')]()[_0xa162('0x62')]();if(!_[_0xa162('0x77')](_0x28852e)){_0x28852e[_0xa162('0x30')](function(_0x4a272c){if(_0x4a272c===_0xa162('0x78')){_0x21cfc2[_0xa162('0x79')]('i.FaxAccountId\x20IN\x20?',[][_0xa162('0x7a')](_0x3e0fd4['query'][_0x4a272c]));}else if(_0x4a272c===_0xa162('0x7b')){var _0x282588=JSON['parse'](_0x3e0fd4[_0xa162('0x3d')][_0x4a272c])[_0xa162('0x7c')];var _0x5867b1=JSON['parse'](_0x3e0fd4[_0xa162('0x3d')][_0x4a272c])[_0xa162('0x7d')];_0x21cfc2[_0xa162('0x79')](_0xa162('0x7e'),_0x282588,_0x5867b1);}else{if(_0x3e0fd4[_0xa162('0x3d')][_0x4a272c]===_0xa162('0x7f')){_0x21cfc2[_0xa162('0x79')]('i.'+_0x4a272c+_0xa162('0x80'));}else{_0x21cfc2[_0xa162('0x79')]('i.'+_0x4a272c+'\x20=\x20?',_0x3e0fd4[_0xa162('0x3d')][_0x4a272c]);}}});}if(_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x81')]){if(_0x3e0fd4[_0xa162('0x3d')]['read']==0x1){_0x21cfc2[_0xa162('0x63')](_0xa162('0x82'));}else{_0x21cfc2[_0xa162('0x63')](_0xa162('0x83'));}}if(_0x3e0fd4[_0xa162('0x3d')]['tag']){_0x5b4930=_['isArray'](_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x84')])?_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x84')]:new Array(_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x84')]);_0x5b4930[_0xa162('0x30')](function(_0x51c07d){_0x44557a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x51c07d+',%');});}if(_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x85')]){var _0x2c144a=_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x85')][_0xa162('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xa162('0x87')](_0x2c144a)){_0x33a6ba['or'](_0xa162('0x88'),_0x2c144a+'%')['or']('i.fax\x20LIKE\x20?',_0x2c144a+'%');}_0x33a6ba['or'](_0xa162('0x89'),_0x2c144a+'%');}}_0x21cfc2[_0xa162('0x79')](_0x33a6ba);_0x21cfc2[_0xa162('0x8a')](_0xa162('0x8b'));var _0x2d2f53={'type':db['Sequelize']['QueryTypes'][_0xa162('0x8c')],'raw':!![]};var _0x405bc7=_0x21cfc2[_0xa162('0x8d')]();_0x405bc7[_0xa162('0x4a')](_0xa162('0x8b'));_0x405bc7['field'](_0xa162('0x8e'),_0xa162('0x61'));if(_0x253ec2[_0xa162('0x8f')]){_0x253ec2['order'][_0xa162('0x30')](function(_0x4b3194){var _0x2ab307=_0x4b3194[0x0]===_0xa162('0x90')?_0x4b3194[0x0]:'i.'+_0x4b3194[0x0];_0x21cfc2[_0xa162('0x8f')](_0x2ab307,_0x4b3194[0x1]===_0xa162('0x91')?![]:!![]);});}if(!_[_0xa162('0x77')](_0x5b4930)){_0x21cfc2[_0xa162('0x63')](_0x44557a);_0x405bc7[_0xa162('0x79')](_0xa162('0x92'),_0x5b4930);}BPromise[_0xa162('0x93')]()['then'](function(){if(!_0x5c1e65){if(_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x78')])return;_0x405bc7['where'](_0xa162('0x94'));_0x21cfc2[_0xa162('0x79')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3e0fd4[_0xa162('0x95')][_0xa162('0x96')]!=='agent')return;return _0x3e0fd4['user'][_0xa162('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x23d0d6){if(_[_0xa162('0x77')](_0x23d0d6)){_0x405bc7[_0xa162('0x79')]('i.FaxAccountId\x20IS\x20NULL');_0x21cfc2[_0xa162('0x79')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x405bc7['where'](_0xa162('0x98'),_[_0xa162('0x2b')](_0x23d0d6,'id'));_0x21cfc2[_0xa162('0x79')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x23d0d6,'id'));}});})[_0xa162('0x25')](function(){if(_0x3e0fd4['user'][_0xa162('0x96')]===_0xa162('0x99')&&!_0x5c1e65&&!_0x3e0fd4[_0xa162('0x3d')][_0xa162('0x78')])return[];return db[_0xa162('0x9a')][_0xa162('0x3d')](_0x405bc7[_0xa162('0x9b')](),_0x2d2f53);})[_0xa162('0x25')](function(_0x5e8a7c){_0x5bf78c['count']=_0x5e8a7c[_0xa162('0x44')];if(_0x5bf78c[_0xa162('0x1f')]===0x0)return[];return db[_0xa162('0x9a')]['query'](_0x232324['toString'](),_0x2d2f53)['then'](function(_0x4ee95b){_0x287592=_['keyBy'](_0x4ee95b,'id');_0x2d2f53=_[_0xa162('0x9c')](_0x2d2f53,{'model':db[_0xa162('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3e0fd4['query'][_0xa162('0x42')]){_0x253ec2[_0xa162('0x43')]['forEach'](function(_0x3891e4){_0x21cfc2[_0xa162('0x4a')]('i.'+_0x3891e4);});}else{_0x21cfc2[_0xa162('0x4a')](_0xa162('0x8e'),_0xa162('0x61'));_0x21cfc2['field'](_0xa162('0x9d'),_0xa162('0x9e'));_0x21cfc2[_0xa162('0x4a')](_0xa162('0x9f'),_0xa162('0xa0'));_0x21cfc2[_0xa162('0x4a')](_0xa162('0xa1'),_0xa162('0x90'));_0x21cfc2[_0xa162('0x4a')](_0xa162('0xa2'));_0x21cfc2[_0xa162('0x4a')](_0xa162('0xa3'),'Contact.firstName');_0x21cfc2[_0xa162('0x4a')](_0xa162('0xa4'),_0xa162('0xa5'));_0x21cfc2[_0xa162('0x4a')](_0xa162('0xa6'),_0xa162('0xa7'));_0x21cfc2[_0xa162('0x4a')]('c.phone','Contact.phone');_0x21cfc2['field'](_0xa162('0xa8'),_0xa162('0xa9'));_0x21cfc2[_0xa162('0x4a')](_0xa162('0xaa'),_0xa162('0xab'));_0x21cfc2[_0xa162('0x4a')](_0xa162('0xac'),'Owner.fullname');_0x21cfc2['field']('o.internal','Owner.internal');_0x21cfc2[_0xa162('0x4a')](_0xa162('0xad'),_0xa162('0x2e'));}if(_0x253ec2[_0xa162('0x20')])_0x21cfc2[_0xa162('0x20')](_0x253ec2['limit']);if(_0x253ec2[_0xa162('0x1d')])_0x21cfc2[_0xa162('0x1d')](_0x253ec2[_0xa162('0x1d')]);return db[_0xa162('0x9a')][_0xa162('0x3d')](_0x21cfc2[_0xa162('0x9b')](),_0x2d2f53);})[_0xa162('0x25')](function(_0x1ac90c){if(_0x1ac90c[_0xa162('0x44')]>0x0)_0x4bef86['where'](_0xa162('0xae'),_['map'](_0x1ac90c,'id'));return db[_0xa162('0x9a')][_0xa162('0x3d')](_0x4bef86['toString'](),_0x2d2f53)[_0xa162('0x25')](function(_0x3e8eb7){var _0x2b1d1e=_[_0xa162('0xaf')](_0x3e8eb7,_0xa162('0xb0'));var _0x86d280=[];_0x1ac90c[_0xa162('0x30')](function(_0x197732){_0x86d280[_0xa162('0xb1')](updateFaxInteraction(_0x197732,_0x287592,_0x2b1d1e));});return BPromise['all'](_0x86d280);});});})[_0xa162('0x25')](function(_0xa21d27){_0x5bf78c[_0xa162('0xb2')]=_0xa21d27;return _0x5bf78c;})['then'](respondWithFilteredResult(_0x3531fd,_0x253ec2))[_0xa162('0x31')](handleError(_0x3531fd,null));};exports[_0xa162('0xb3')]=function(_0xeba829,_0x29b43b){var _0x1ce98d={'raw':![],'where':{'id':_0xeba829[_0xa162('0xb4')]['id']}},_0x5c1728={};_0x5c1728[_0xa162('0x41')]=_[_0xa162('0x3e')](db[_0xa162('0x3a')]['rawAttributes']);_0x5c1728[_0xa162('0x3d')]=_[_0xa162('0x3e')](_0xeba829['query']);_0x5c1728[_0xa162('0x3f')]=_['intersection'](_0x5c1728['model'],_0x5c1728[_0xa162('0x3d')]);_0x1ce98d['attributes']=_[_0xa162('0x40')](_0x5c1728[_0xa162('0x41')],qs[_0xa162('0x42')](_0xeba829[_0xa162('0x3d')][_0xa162('0x42')]));_0x1ce98d[_0xa162('0x43')]=_0x1ce98d[_0xa162('0x43')][_0xa162('0x44')]?_0x1ce98d[_0xa162('0x43')]:_0x5c1728[_0xa162('0x41')];if(_0xeba829['query'][_0xa162('0xb5')]){_0x1ce98d[_0xa162('0xb6')]=[{'all':!![]}];}_0x1ce98d=_['merge']({},_0x1ce98d,_0xeba829[_0xa162('0xb7')]);return db[_0xa162('0x3a')]['find'](_0x1ce98d)['then'](handleEntityNotFound(_0x29b43b,null))['then'](respondWithResult(_0x29b43b,null))['catch'](handleError(_0x29b43b,null));};exports[_0xa162('0xb8')]=function(_0xc83285,_0x2ea7af){return db[_0xa162('0x3a')]['create'](_0xc83285[_0xa162('0x74')],{})['then'](respondWithResult(_0x2ea7af,0xc9))['catch'](handleError(_0x2ea7af,null));};exports[_0xa162('0xb9')]=function(_0x4b2e76,_0x355089){if(_0x4b2e76['body']['id']){delete _0x4b2e76[_0xa162('0x74')]['id'];}return db[_0xa162('0x3a')]['find']({'where':{'id':_0x4b2e76[_0xa162('0xb4')]['id']}})['then'](handleEntityNotFound(_0x355089,null))[_0xa162('0x25')](saveUpdates(_0x4b2e76[_0xa162('0x74')],null))[_0xa162('0x25')](respondWithResult(_0x355089,null))[_0xa162('0x31')](handleError(_0x355089,null));};exports['destroy']=function(_0x25b4bc,_0x387784){return db['FaxInteraction'][_0xa162('0x6b')]({'where':{'id':_0x25b4bc['params']['id']}})[_0xa162('0x25')](handleEntityNotFound(_0x387784,null))[_0xa162('0x25')](removeEntity(_0x387784,null))['catch'](handleError(_0x387784,null));};exports[_0xa162('0xba')]=function(_0x492b23,_0x5d464e){return db['FaxInteraction'][_0xa162('0xba')]()[_0xa162('0x25')](respondWithResult(_0x5d464e,null))[_0xa162('0x31')](handleError(_0x5d464e,null));};exports[_0xa162('0xbb')]=function(_0x2d0a3c,_0x373170,_0xb97a2e){return db[_0xa162('0xbc')][_0xa162('0x6b')]({'where':{'id':_0x2d0a3c[_0xa162('0xb4')]['id']}})[_0xa162('0x25')](handleEntityNotFound(_0x373170,null))[_0xa162('0x25')](function(_0x40417e){if(_0x40417e){return _0x40417e[_0xa162('0xbb')](_0x2d0a3c[_0xa162('0x74')][_0xa162('0xbd')],_[_0xa162('0xbe')](_0x2d0a3c[_0xa162('0x74')],[_0xa162('0xbd'),'id'])||{});}})[_0xa162('0x25')](respondWithResult(_0x373170,null))['catch'](handleError(_0x373170,null));};exports[_0xa162('0xbf')]=function(_0x169659,_0x4baafc,_0x156f09){var _0x498a12={'raw':![],'where':{}};var _0x102ef0={};var _0x7b669c={'count':0x0,'rows':[]};return db[_0xa162('0x3a')][_0xa162('0xc0')]({'where':{'id':_0x169659[_0xa162('0xb4')]['id']}})[_0xa162('0x25')](handleEntityNotFound(_0x4baafc,null))[_0xa162('0x25')](function(_0x2b0499){if(_0x2b0499){_0x102ef0[_0xa162('0x41')]=_[_0xa162('0x3e')](db[_0xa162('0xbc')][_0xa162('0x3b')]);_0x102ef0[_0xa162('0x3d')]=_[_0xa162('0x3e')](_0x169659['query']);_0x102ef0[_0xa162('0x3f')]=_[_0xa162('0x40')](_0x102ef0['model'],_0x102ef0['query']);_0x498a12[_0xa162('0x43')]=_[_0xa162('0x40')](_0x102ef0[_0xa162('0x41')],qs[_0xa162('0x42')](_0x169659[_0xa162('0x3d')][_0xa162('0x42')]));_0x498a12[_0xa162('0x43')]=_0x498a12[_0xa162('0x43')][_0xa162('0x44')]?_0x498a12[_0xa162('0x43')]:_0x102ef0[_0xa162('0x41')];if(!_0x169659[_0xa162('0x3d')][_0xa162('0x45')](_0xa162('0x46'))){_0x498a12[_0xa162('0x20')]=qs[_0xa162('0x20')](_0x169659['query'][_0xa162('0x20')]);_0x498a12['offset']=qs[_0xa162('0x1d')](_0x169659['query']['offset']);}_0x498a12[_0xa162('0x8f')]=qs[_0xa162('0x47')](_0x169659[_0xa162('0x3d')][_0xa162('0x47')]);_0x498a12[_0xa162('0x79')]=qs[_0xa162('0x3f')](_['pick'](_0x169659[_0xa162('0x3d')],_0x102ef0['filters']));_0x498a12[_0xa162('0x79')][_0xa162('0xb0')]=_0x2b0499['id'];if(_0x169659[_0xa162('0x3d')][_0xa162('0x85')]){_0x498a12[_0xa162('0x79')]=_['merge'](_0x498a12['where'],{'$or':_[_0xa162('0x2b')](_0x498a12['attributes'],function(_0x39acb2){var _0x4bf721={};_0x4bf721[_0x39acb2]={'$like':'%'+_0x169659[_0xa162('0x3d')][_0xa162('0x85')]+'%'};return _0x4bf721;})});}if(_0x169659[_0xa162('0x3d')][_0xa162('0x7c')]){var _0x12d83c=_0x169659[_0xa162('0x3d')][_0xa162('0x7c')]['split'](',');var _0x1124fb={};_0x1124fb[_0x12d83c[0x0]]={'$gte':moment(_0x12d83c[0x1])[_0xa162('0xc1')](_0xa162('0xc2'))};_0x498a12[_0xa162('0x79')]=_[_0xa162('0x9c')](_0x498a12[_0xa162('0x79')],_0x1124fb);}_0x498a12=_[_0xa162('0x9c')]({},_0x498a12,_0x169659[_0xa162('0xb7')]);return db[_0xa162('0xbc')][_0xa162('0x1f')]({'where':_0x498a12[_0xa162('0x79')]})[_0xa162('0x25')](function(_0x5e8d09){_0x7b669c[_0xa162('0x1f')]=_0x5e8d09;if(_0x169659[_0xa162('0x3d')]['includeAll']){_0x498a12[_0xa162('0xb6')]=[{'all':!![]}];}return db[_0xa162('0xbc')][_0xa162('0xc3')](_0x498a12);})[_0xa162('0x25')](function(_0x429458){_0x7b669c[_0xa162('0xb2')]=_0x429458;return _0x7b669c;});}})[_0xa162('0x25')](respondWithFilteredResult(_0x4baafc,_0x498a12))['catch'](handleError(_0x4baafc,null));};exports[_0xa162('0xc4')]=function(_0x345664,_0x1c60bb,_0x2328a5){return db[_0xa162('0x3a')][_0xa162('0x6b')]({'where':{'id':_0x345664[_0xa162('0xb4')]['id']}})[_0xa162('0x25')](handleEntityNotFound(_0x1c60bb,null))[_0xa162('0x25')](function(_0x457950){if(_0x457950){return _0x457950['setTags'](_0x345664[_0xa162('0x74')][_0xa162('0xbd')],_[_0xa162('0xbe')](_0x345664[_0xa162('0x74')],[_0xa162('0xbd'),'id'])||{})[_0xa162('0xc5')](function(){return db[_0xa162('0x70')][_0xa162('0xc3')]({'attributes':['id','name','color'],'where':{'id':_0x345664[_0xa162('0x74')][_0xa162('0xbd')]}});})['then'](function(_0x38e3a2){socket[_0xa162('0xc6')](_0xa162('0xc7'),{'id':Number(_0x345664['params']['id']),'tags':_0x38e3a2||[]});return{'id':Number(_0x345664[_0xa162('0xb4')]['id']),'tags':_0x38e3a2||[]};});}})['then'](respondWithResult(_0x1c60bb,null))['catch'](handleError(_0x1c60bb,null));};exports['removeTags']=function(_0x5f36e0,_0x4ba53d,_0x281ddf){return db['FaxInteraction']['find']({'where':{'id':_0x5f36e0[_0xa162('0xb4')]['id']}})[_0xa162('0x25')](handleEntityNotFound(_0x4ba53d,null))[_0xa162('0x25')](function(_0x4a9b00){if(_0x4a9b00){return _0x4a9b00[_0xa162('0xc8')](_0x5f36e0[_0xa162('0x3d')][_0xa162('0xbd')]);}})['then'](respondWithStatusCode(_0x4ba53d,null))[_0xa162('0x31')](handleError(_0x4ba53d,null));};exports['download']=function(_0x2b0fe1,_0x1eb414){var _0x39fc83=moment()[_0xa162('0xc9')]()[_0xa162('0x9b')]();var _0x757fc=path[_0xa162('0xca')](config['root'],_0xa162('0xcb'),_0xa162('0xcc'),'tmp');var _0x4dc6ec=path[_0xa162('0xca')](config['root'],'server',_0xa162('0xcc'),_0xa162('0xcd'));var _0x2f5ca7=path[_0xa162('0xca')](_0x757fc,_0x39fc83);var _0x21591c=util[_0xa162('0xc1')](_0xa162('0xce'),_0x2b0fe1['params']['id'],_0x39fc83);var _0x5f5498=path['join'](_0x757fc,_0x21591c);var _0x33562e=[];_0x33562e[_0xa162('0xb1')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0xae1e6a=[{'model':db[_0xa162('0xbc')],'as':_0xa162('0xcf'),'attributes':['id',_0xa162('0x74'),_0xa162('0x7b')],'include':_0x33562e}];return db[_0xa162('0x3a')]['find']({'where':{'id':_0x2b0fe1[_0xa162('0xb4')]['id']},'include':_0xae1e6a})['then'](handleEntityNotFound(_0x1eb414,null))[_0xa162('0x25')](function(_0x373f30){if(_0x373f30&&_0x373f30['Messages']){var _0x479884=_0x373f30['get']({'plain':!![]});fs[_0xa162('0xd0')](_0x2f5ca7);for(var _0xaf1abb=0x0;_0xaf1abb<_0x479884[_0xa162('0xcf')][_0xa162('0x44')];_0xaf1abb++){var _0x373b75=_0x479884['Messages'][_0xaf1abb][_0xa162('0xd1')];if(_0x373b75){var _0x43bf2f=path['join'](_0x4dc6ec,_0x373b75[_0xa162('0xd2')]);if(fs[_0xa162('0xd3')](_0x43bf2f)){fs[_0xa162('0xd4')](_0x43bf2f)[_0xa162('0xd5')](fs[_0xa162('0xd6')](path[_0xa162('0xca')](_0x2f5ca7,_0x373b75['basename'])));}}}return BPromise['resolve']()[_0xa162('0x25')](function(){return new BPromise(function(_0x185c41,_0x15e7e4){zipdir(_0x2f5ca7,{'saveTo':_0x5f5498},function(_0x2a2ebc,_0x1a8608){if(_0x2a2ebc)return _0x15e7e4(_0x2a2ebc);return _0x185c41(_0x1a8608);});})[_0xa162('0x25')](function(){return new BPromise(function(_0x18dd9e,_0x4c9464){rimraf(_0x2f5ca7,function(_0x687394){if(_0x687394)_0x4c9464(_0x687394);return _0x18dd9e();});});})['then'](function(){return _0x1eb414[_0xa162('0xd7')](_0x5f5498,_0x21591c,function(_0x5e6dd6){if(_0x5e6dd6){console[_0xa162('0xd8')](_0xa162('0xd9'),_0x5e6dd6);}else{fs[_0xa162('0xda')](_0x5f5498);}});});});}else{return _0x1eb414[_0xa162('0x27')](0xc8);}})['catch'](handleError(_0x1eb414,null));}; \ No newline at end of file +var _0xbe21=['attachments','Attachment','Messages','get','join','basename','existsSync','pipe','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','error','send','map','fullname','Tags','TagIds','forEach','push','catch','waiting','talking','unmanaged','total','closed','UserId','answered','FaxInteraction','rawAttributes','fieldName','key','model','name','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_messages','me.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','split','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','type','some','compact','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','count','keyBy','merge','a.key','Account.mandatoryDisposition','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','c.email','Contact.email','c.phone','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','show','params','include','options','create','body','destroy','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','FaxInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','removeTags','download','unix','root','tmp','files'];(function(_0x12826e,_0x139980){var _0x1f3722=function(_0xa794c){while(--_0xa794c){_0x12826e['push'](_0x12826e['shift']());}};_0x1f3722(++_0x139980);}(_0xbe21,0x1b6));var _0x1be2=function(_0x5831a3,_0x4463b7){_0x5831a3=_0x5831a3-0x0;var _0x198912=_0xbe21[_0x5831a3];return _0x198912;};'use strict';var emlformat=require(_0x1be2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1be2('0x1'));var jsonpatch=require(_0x1be2('0x2'));var rp=require(_0x1be2('0x3'));var moment=require('moment');var BPromise=require(_0x1be2('0x4'));var Mustache=require(_0x1be2('0x5'));var util=require('util');var path=require(_0x1be2('0x6'));var sox=require(_0x1be2('0x7'));var csv=require(_0x1be2('0x8'));var ejs=require(_0x1be2('0x9'));var fs=require('fs');var fs_extra=require(_0x1be2('0xa'));var _=require(_0x1be2('0xb'));var squel=require(_0x1be2('0xc'));var crypto=require('crypto');var jsforce=require(_0x1be2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1be2('0x8'));var querystring=require(_0x1be2('0xe'));var Papa=require(_0x1be2('0xf'));var Redis=require(_0x1be2('0x10'));var authService=require(_0x1be2('0x11'));var qs=require(_0x1be2('0x12'));var as=require(_0x1be2('0x13'));var hardwareService=require(_0x1be2('0x14'));var logger=require(_0x1be2('0x15'))(_0x1be2('0x16'));var utils=require('../../config/utils');var config=require(_0x1be2('0x17'));var licenseUtil=require(_0x1be2('0x18'));var db=require(_0x1be2('0x19'))['db'];config['redis']=_['defaults'](config[_0x1be2('0x1a')],{'host':_0x1be2('0x1b'),'port':0x18eb});var socket=require(_0x1be2('0x1c'))(new Redis(config[_0x1be2('0x1a')]));require('./faxInteraction.socket')[_0x1be2('0x1d')](socket);function respondWithStatusCode(_0xaff823,_0x51a12e){_0x51a12e=_0x51a12e||0xcc;return function(_0x2ac249){if(_0x2ac249){return _0xaff823[_0x1be2('0x1e')](_0x51a12e);}return _0xaff823[_0x1be2('0x1f')](_0x51a12e)[_0x1be2('0x20')]();};}function respondWithResult(_0x40b396,_0x920929){_0x920929=_0x920929||0xc8;return function(_0x54cbda){if(_0x54cbda){return _0x40b396[_0x1be2('0x1f')](_0x920929)[_0x1be2('0x21')](_0x54cbda);}};}function respondWithFilteredResult(_0x4b07db,_0x59b67a){return function(_0x27015d){if(_0x27015d){var _0x239bd8=typeof _0x59b67a[_0x1be2('0x22')]===_0x1be2('0x23')&&typeof _0x59b67a[_0x1be2('0x24')]===_0x1be2('0x23');var _0x301bca=_0x27015d['count'];var _0x3a6025=_0x239bd8?0x0:_0x59b67a[_0x1be2('0x22')];var _0x33dd75=_0x239bd8?_0x27015d['count']:_0x59b67a[_0x1be2('0x22')]+_0x59b67a[_0x1be2('0x24')];var _0x4f4e99;if(_0x33dd75>=_0x301bca){_0x33dd75=_0x301bca;_0x4f4e99=0xc8;}else{_0x4f4e99=0xce;}_0x4b07db['status'](_0x4f4e99);return _0x4b07db[_0x1be2('0x25')]('Content-Range',_0x3a6025+'-'+_0x33dd75+'/'+_0x301bca)[_0x1be2('0x21')](_0x27015d);}return null;};}function patchUpdates(_0x48bb56){return function(_0x454f07){try{jsonpatch[_0x1be2('0x26')](_0x454f07,_0x48bb56,!![]);}catch(_0x13ab19){return BPromise[_0x1be2('0x27')](_0x13ab19);}return _0x454f07[_0x1be2('0x28')]();};}function saveUpdates(_0x112814,_0x5b4889){return function(_0x3492b4){if(_0x3492b4){return _0x3492b4[_0x1be2('0x29')](_0x112814)[_0x1be2('0x2a')](function(_0x5693cd){return _0x5693cd;});}return null;};}function removeEntity(_0x491709,_0x1cf2b8){return function(_0x581b44){if(_0x581b44){return _0x581b44['destroy']()[_0x1be2('0x2a')](function(){_0x491709[_0x1be2('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48e99c,_0x5b6e04){return function(_0x1159df){if(!_0x1159df){_0x48e99c['sendStatus'](0x194);}return _0x1159df;};}function handleError(_0x3a60d4,_0x46c6b7){_0x46c6b7=_0x46c6b7||0x1f4;return function(_0x20174f){logger[_0x1be2('0x2b')](_0x20174f['stack']);if(_0x20174f['name']){delete _0x20174f['name'];}_0x3a60d4[_0x1be2('0x1f')](_0x46c6b7)[_0x1be2('0x2c')](_0x20174f);};}function getInteractionUsers(_0x5ba3ce,_0x4672fa){return new BPromise(function(_0x25addb,_0x2ba72e){try{if(_0x4672fa[_0x5ba3ce['id']]){_0x5ba3ce['Users']=_[_0x1be2('0x2d')](_0x4672fa[_0x5ba3ce['id']],function(_0x5e9b80){return{'id':_0x5e9b80['id'],'fullname':_0x5e9b80[_0x1be2('0x2e')]};});}}catch(_0x31bc1d){_0x2ba72e(_0x31bc1d);}_0x25addb(_0x5ba3ce);});}function getInteractionTags(_0x2399f1,_0x56be2d){return new BPromise(function(_0x39b88f,_0xe3ca75){try{if(_0x2399f1['TagIds']){_0x2399f1[_0x1be2('0x2f')]=[];_0x2399f1[_0x1be2('0x30')]['split'](',')[_0x1be2('0x31')](function(_0xe9e51a){_0x2399f1['Tags'][_0x1be2('0x32')](_0x56be2d[_0xe9e51a]);});}delete _0x2399f1['TagIds'];}catch(_0x15f9f0){_0xe3ca75(_0x15f9f0);}_0x39b88f(_0x2399f1);});}function updateFaxInteraction(_0x52ebc9,_0x492bc6,_0x29c2e8){return new BPromise(function(_0xc756f3,_0x483731){return getInteractionUsers(_0x52ebc9,_0x29c2e8)['then'](function(_0x3051b4){return getInteractionTags(_0x3051b4,_0x492bc6);})[_0x1be2('0x2a')](function(_0x424bbf){return getStateInteraction(_0x424bbf);})['then'](function(_0xd22c6e){_0xc756f3(_0xd22c6e);})[_0x1be2('0x33')](function(_0x5ea9c3){_0x483731(_0x5ea9c3);});});}function getStateInteraction(_0x1fbd5d){return new BPromise(function(_0x3df072){_0x1fbd5d[_0x1be2('0x34')]=0x0;_0x1fbd5d[_0x1be2('0x35')]=0x0;_0x1fbd5d['answered']=0x0;_0x1fbd5d[_0x1be2('0x36')]=0x0;_0x1fbd5d[_0x1be2('0x37')]=0x0;if(!_0x1fbd5d[_0x1be2('0x38')]&&!_0x1fbd5d[_0x1be2('0x39')]){_0x1fbd5d[_0x1be2('0x34')]+=0x1;}if(!_0x1fbd5d[_0x1be2('0x38')]&&_0x1fbd5d[_0x1be2('0x39')]){_0x1fbd5d[_0x1be2('0x35')]+=0x1;if(_0x1fbd5d[_0x1be2('0x34')]){_0x1fbd5d[_0x1be2('0x34')]-=0x1;}}if(_0x1fbd5d[_0x1be2('0x38')]&&_0x1fbd5d[_0x1be2('0x39')]){_0x1fbd5d[_0x1be2('0x3a')]+=0x1;if(_0x1fbd5d[_0x1be2('0x35')]){_0x1fbd5d[_0x1be2('0x35')]-=0x1;}}if(_0x1fbd5d[_0x1be2('0x38')]&&!_0x1fbd5d[_0x1be2('0x39')]){_0x1fbd5d[_0x1be2('0x36')]+=0x1;if(_0x1fbd5d[_0x1be2('0x34')]){_0x1fbd5d[_0x1be2('0x34')]-=0x1;}}_0x1fbd5d[_0x1be2('0x37')]+=0x1;_0x3df072(_0x1fbd5d);});}exports['index']=function(_0x5bb269,_0x12ed94){var _0x1877db={},_0x58ad75={},_0x47a846={'count':0x0,'rows':[]};var _0x5e0a5b=_[_0x1be2('0x2d')](db[_0x1be2('0x3b')][_0x1be2('0x3c')],function(_0x35a26d){return{'name':_0x35a26d[_0x1be2('0x3d')],'type':_0x35a26d['type'][_0x1be2('0x3e')]};});_0x58ad75[_0x1be2('0x3f')]=_[_0x1be2('0x2d')](_0x5e0a5b,_0x1be2('0x40'));_0x58ad75['query']=_[_0x1be2('0x41')](_0x5bb269[_0x1be2('0x42')]);_0x58ad75['filters']=_[_0x1be2('0x43')](_0x58ad75[_0x1be2('0x3f')],_0x58ad75[_0x1be2('0x42')]);_0x1877db['attributes']=_[_0x1be2('0x43')](_0x58ad75[_0x1be2('0x3f')],qs['fields'](_0x5bb269[_0x1be2('0x42')][_0x1be2('0x44')]));_0x1877db[_0x1be2('0x45')]=_0x1877db[_0x1be2('0x45')][_0x1be2('0x46')]?_0x1877db[_0x1be2('0x45')]:_0x58ad75['model'];if(!_0x5bb269[_0x1be2('0x42')][_0x1be2('0x47')](_0x1be2('0x48'))){_0x1877db[_0x1be2('0x24')]=qs[_0x1be2('0x24')](_0x5bb269[_0x1be2('0x42')][_0x1be2('0x24')]);_0x1877db['offset']=qs[_0x1be2('0x22')](_0x5bb269[_0x1be2('0x42')][_0x1be2('0x22')]);}_0x1877db['order']=qs[_0x1be2('0x49')](_0x5bb269['query'][_0x1be2('0x49')]);_0x1877db['where']=qs[_0x1be2('0x4a')](_['pick'](_0x5bb269[_0x1be2('0x42')],_0x58ad75['filters']),_0x5e0a5b);var _0x391aa4=[];var _0x163ff5=squel[_0x1be2('0x4b')]()[_0x1be2('0x4c')]('id')['field']('name')[_0x1be2('0x4c')](_0x1be2('0x4d'))[_0x1be2('0x4e')](_0x1be2('0x4f'));var _0x1902a7=squel['select']()[_0x1be2('0x4c')](_0x1be2('0x50'))['field'](_0x1be2('0x51'))[_0x1be2('0x4c')](_0x1be2('0x52'))[_0x1be2('0x4e')](_0x1be2('0x53'),'ui')[_0x1be2('0x54')](_0x1be2('0x55'),'u',_0x1be2('0x56'));var _0x59f9b6=squel['select']()[_0x1be2('0x4e')](_0x1be2('0x57'),'i')['left_join'](_0x1be2('0x58'),'c',_0x1be2('0x59'))['left_join'](_0x1be2('0x55'),'o',_0x1be2('0x5a'))[_0x1be2('0x54')]('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')['left_join'](_0x1be2('0x5b'),'me',_0x1be2('0x5c'))[_0x1be2('0x54')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0x1be2('0x54')](_0x1be2('0x4f'),'t','t.id\x20=\x20it.TagId');var _0x19d264=squel[_0x1be2('0x5d')]();var _0x5f0dc1=[];var _0x3c0a4a=squel[_0x1be2('0x5d')]();var _0x1c776c;if(_0x5bb269[_0x1be2('0x42')][_0x1be2('0x5e')]){_0x1c776c=as[_0x1be2('0x5f')](_0x5bb269[_0x1be2('0x42')][_0x1be2('0x5e')]);var _0x25a80b=_0x1c776c['sqlOperator'];for(var _0x13f93b=0x0;_0x13f93b<_0x1c776c[_0x1be2('0x60')][_0x1be2('0x46')];_0x13f93b++){var _0x4ec0ee=_0x1c776c[_0x1be2('0x60')][_0x13f93b];var _0x42267f='i';var _0x36e7aa=_[_0x1be2('0x61')](_0x5e0a5b,[_0x1be2('0x40'),_0x4ec0ee[_0x1be2('0x4c')]]);if(!_0x36e7aa){switch(_0x4ec0ee[_0x1be2('0x4c')]){case _0x1be2('0x62'):if(_0x4ec0ee[_0x1be2('0x63')]==0x1){_0x59f9b6['having']('`'+_0x4ec0ee[_0x1be2('0x4c')]+_0x1be2('0x64'));}else{_0x59f9b6[_0x1be2('0x65')]('`'+_0x4ec0ee[_0x1be2('0x4c')]+_0x1be2('0x66'));}break;case _0x1be2('0x67'):if(_0x4ec0ee[_0x1be2('0x68')]===_0x1be2('0x69')){if(_0x4ec0ee[_0x1be2('0x63')]['split']('\x20')[_0x1be2('0x46')]>0x1){_0x19d264[_0x25a80b](_0x1be2('0x6a'),qs['getFullTextValue'](_0x4ec0ee[_0x1be2('0x63')]),null);}else{var _0xa4637d='%'+_0x4ec0ee[_0x1be2('0x63')]+'%';_0x19d264[_0x25a80b](_0x1be2('0x6b'),_0xa4637d,_0xa4637d,_0xa4637d);}}else{_0x36e7aa=_[_0x1be2('0x61')](_0x5e0a5b,[_0x1be2('0x40'),_0x1be2('0x6c')]);_0x4ec0ee[_0x1be2('0x4c')]=_0x1be2('0x6c');_0x5ef13f=as['buildExpression'](_0x42267f,_0x36e7aa['type'],_0x4ec0ee);_0x19d264[_0x25a80b](_0x5ef13f[_0x1be2('0x6d')],_0x5ef13f[_0x1be2('0x63')]['start'],_0x5ef13f[_0x1be2('0x63')][_0x1be2('0x20')]);}break;case _0x1be2('0x6e'):var _0x6db990=_0x4ec0ee[_0x1be2('0x63')][_0x1be2('0x6f')](',')['map'](function(_0x212cb8){return Number(_0x212cb8);});_0x6db990['forEach'](function(_0x1e4cb2){_0x3c0a4a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1e4cb2+',%');});_0x5f0dc1=_[_0x1be2('0x70')](_0x5f0dc1,_0x6db990);break;case _0x1be2('0x71'):if(_0x4ec0ee[_0x1be2('0x68')]===_0x1be2('0x69')){_0x19d264[_0x25a80b](_0x1be2('0x72'),'%'+_0x4ec0ee[_0x1be2('0x63')]+'%',null);}else{_0x36e7aa=_[_0x1be2('0x61')](_0x5e0a5b,[_0x1be2('0x40'),'UserId']);_0x4ec0ee[_0x1be2('0x4c')]=_0x1be2('0x39');_0x5ef13f=as['buildExpression'](_0x42267f,_0x36e7aa['type'],_0x4ec0ee);_0x19d264[_0x25a80b](_0x5ef13f['text'],_0x5ef13f[_0x1be2('0x63')]['start'],_0x5ef13f[_0x1be2('0x63')][_0x1be2('0x20')]);}break;case'body':_0x5ef13f=as['buildExpression']('me',null,_0x4ec0ee);_0x19d264[_0x25a80b](_0x5ef13f[_0x1be2('0x6d')],_0x5ef13f[_0x1be2('0x63')]['start'],_0x5ef13f[_0x1be2('0x63')][_0x1be2('0x20')]);break;}}else{var _0x5ef13f=as[_0x1be2('0x73')](_0x42267f,_0x36e7aa[_0x1be2('0x74')],_0x4ec0ee);_0x19d264[_0x25a80b](_0x5ef13f[_0x1be2('0x6d')],_0x5ef13f[_0x1be2('0x63')]['start'],_0x5ef13f[_0x1be2('0x63')][_0x1be2('0x20')]);}}}else{var _0x17dd90=_(_0x5bb269[_0x1be2('0x42')])['keys']()['map'](function(_0x458340){return _[_0x1be2('0x75')](_0x5e0a5b,[_0x1be2('0x40'),_0x458340])?_0x458340:undefined;})[_0x1be2('0x76')]()[_0x1be2('0x63')]();if(!_[_0x1be2('0x77')](_0x17dd90)){_0x17dd90[_0x1be2('0x31')](function(_0x38829e){if(_0x38829e===_0x1be2('0x78')){_0x59f9b6[_0x1be2('0x79')](_0x1be2('0x7a'),[]['concat'](_0x5bb269[_0x1be2('0x42')][_0x38829e]));}else if(_0x38829e===_0x1be2('0x7b')){var _0x7a3a16=JSON[_0x1be2('0x7c')](_0x5bb269[_0x1be2('0x42')][_0x38829e])[_0x1be2('0x7d')];var _0x240907=JSON[_0x1be2('0x7c')](_0x5bb269[_0x1be2('0x42')][_0x38829e])[_0x1be2('0x7e')];_0x59f9b6[_0x1be2('0x79')](_0x1be2('0x7f'),_0x7a3a16,_0x240907);}else{if(_0x5bb269[_0x1be2('0x42')][_0x38829e]==='null'){_0x59f9b6[_0x1be2('0x79')]('i.'+_0x38829e+_0x1be2('0x80'));}else{_0x59f9b6['where']('i.'+_0x38829e+_0x1be2('0x81'),_0x5bb269[_0x1be2('0x42')][_0x38829e]);}}});}if(_0x5bb269['query']['read']){if(_0x5bb269[_0x1be2('0x42')][_0x1be2('0x82')]==0x1){_0x59f9b6[_0x1be2('0x65')]('`unreadMessages`\x20=\x200');}else{_0x59f9b6[_0x1be2('0x65')]('`unreadMessages`\x20>\x200');}}if(_0x5bb269[_0x1be2('0x42')][_0x1be2('0x83')]){_0x5f0dc1=_[_0x1be2('0x84')](_0x5bb269[_0x1be2('0x42')]['tag'])?_0x5bb269['query'][_0x1be2('0x83')]:new Array(_0x5bb269['query'][_0x1be2('0x83')]);_0x5f0dc1[_0x1be2('0x31')](function(_0x595918){_0x3c0a4a['or'](_0x1be2('0x85'),'%,'+_0x595918+',%');});}if(_0x5bb269[_0x1be2('0x42')][_0x1be2('0x86')]){var _0x431881=_0x5bb269[_0x1be2('0x42')][_0x1be2('0x86')][_0x1be2('0x87')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1be2('0x88')](_0x431881)){_0x19d264['or'](_0x1be2('0x89'),_0x431881+'%')['or']('i.fax\x20LIKE\x20?',_0x431881+'%');}_0x19d264['or'](_0x1be2('0x8a'),_0x431881+'%');}}_0x59f9b6[_0x1be2('0x79')](_0x19d264);_0x59f9b6[_0x1be2('0x8b')](_0x1be2('0x8c'));var _0x1996e6={'type':db['Sequelize'][_0x1be2('0x8d')]['SELECT'],'raw':!![]};var _0x329611=_0x59f9b6[_0x1be2('0x8e')]();_0x329611[_0x1be2('0x4c')](_0x1be2('0x8c'));_0x329611[_0x1be2('0x4c')](_0x1be2('0x8f'),_0x1be2('0x62'));if(_0x1877db['order']){_0x1877db[_0x1be2('0x90')]['forEach'](function(_0x3d76cf){var _0x4c3b0d=_0x3d76cf[0x0]===_0x1be2('0x91')?_0x3d76cf[0x0]:'i.'+_0x3d76cf[0x0];_0x59f9b6[_0x1be2('0x90')](_0x4c3b0d,_0x3d76cf[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x5f0dc1)){_0x59f9b6['having'](_0x3c0a4a);_0x329611[_0x1be2('0x79')](_0x1be2('0x92'),_0x5f0dc1);}BPromise[_0x1be2('0x93')]()[_0x1be2('0x2a')](function(){if(!_0x1c776c){if(_0x5bb269[_0x1be2('0x42')][_0x1be2('0x78')])return;_0x329611[_0x1be2('0x79')](_0x1be2('0x94'));_0x59f9b6[_0x1be2('0x79')](_0x1be2('0x94'));return;}if(_0x5bb269[_0x1be2('0x95')][_0x1be2('0x96')]!==_0x1be2('0x97'))return;return _0x5bb269[_0x1be2('0x95')][_0x1be2('0x98')]({'attributes':['id'],'raw':!![]})['then'](function(_0x11981e){if(_[_0x1be2('0x77')](_0x11981e)){_0x329611[_0x1be2('0x79')](_0x1be2('0x99'));_0x59f9b6[_0x1be2('0x79')](_0x1be2('0x99'));}else{_0x329611[_0x1be2('0x79')](_0x1be2('0x7a'),_[_0x1be2('0x2d')](_0x11981e,'id'));_0x59f9b6[_0x1be2('0x79')](_0x1be2('0x7a'),_[_0x1be2('0x2d')](_0x11981e,'id'));}});})[_0x1be2('0x2a')](function(){if(_0x5bb269[_0x1be2('0x95')][_0x1be2('0x96')]===_0x1be2('0x97')&&!_0x1c776c&&!_0x5bb269[_0x1be2('0x42')][_0x1be2('0x78')])return[];return db[_0x1be2('0x9a')]['query'](_0x329611['toString'](),_0x1996e6);})[_0x1be2('0x2a')](function(_0x4f104c){_0x47a846[_0x1be2('0x9b')]=_0x4f104c[_0x1be2('0x46')];if(_0x47a846[_0x1be2('0x9b')]===0x0)return[];return db[_0x1be2('0x9a')][_0x1be2('0x42')](_0x163ff5['toString'](),_0x1996e6)[_0x1be2('0x2a')](function(_0x924d31){_0x391aa4=_[_0x1be2('0x9c')](_0x924d31,'id');_0x1996e6=_[_0x1be2('0x9d')](_0x1996e6,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5bb269[_0x1be2('0x42')]['fields']){_0x1877db[_0x1be2('0x45')][_0x1be2('0x31')](function(_0x4d5282){_0x59f9b6['field']('i.'+_0x4d5282);});}else{_0x59f9b6[_0x1be2('0x4c')](_0x1be2('0x8f'),_0x1be2('0x62'));_0x59f9b6['field'](_0x1be2('0x9e'),'Account.key');_0x59f9b6[_0x1be2('0x4c')]('a.mandatoryDisposition',_0x1be2('0x9f'));_0x59f9b6[_0x1be2('0x4c')](_0x1be2('0xa0'),_0x1be2('0x91'));_0x59f9b6[_0x1be2('0x4c')]('i.*');_0x59f9b6[_0x1be2('0x4c')](_0x1be2('0xa1'),'Contact.firstName');_0x59f9b6['field'](_0x1be2('0xa2'),_0x1be2('0xa3'));_0x59f9b6[_0x1be2('0x4c')](_0x1be2('0xa4'),_0x1be2('0xa5'));_0x59f9b6[_0x1be2('0x4c')](_0x1be2('0xa6'),'Contact.phone');_0x59f9b6['field']('c.mobile',_0x1be2('0xa7'));_0x59f9b6[_0x1be2('0x4c')]('c.fax','Contact.fax');_0x59f9b6[_0x1be2('0x4c')](_0x1be2('0xa8'),_0x1be2('0xa9'));_0x59f9b6[_0x1be2('0x4c')](_0x1be2('0xaa'),_0x1be2('0xab'));_0x59f9b6[_0x1be2('0x4c')](_0x1be2('0xac'),_0x1be2('0x30'));}if(_0x1877db[_0x1be2('0x24')])_0x59f9b6[_0x1be2('0x24')](_0x1877db[_0x1be2('0x24')]);if(_0x1877db[_0x1be2('0x22')])_0x59f9b6['offset'](_0x1877db['offset']);return db[_0x1be2('0x9a')][_0x1be2('0x42')](_0x59f9b6[_0x1be2('0xad')](),_0x1996e6);})[_0x1be2('0x2a')](function(_0x25aa98){if(_0x25aa98[_0x1be2('0x46')]>0x0)_0x1902a7[_0x1be2('0x79')](_0x1be2('0xae'),_[_0x1be2('0x2d')](_0x25aa98,'id'));return db[_0x1be2('0x9a')][_0x1be2('0x42')](_0x1902a7['toString'](),_0x1996e6)[_0x1be2('0x2a')](function(_0x4012c2){var _0x3093d0=_[_0x1be2('0xaf')](_0x4012c2,'FaxInteractionId');var _0x45d9c4=[];_0x25aa98[_0x1be2('0x31')](function(_0x2261b4){_0x45d9c4[_0x1be2('0x32')](updateFaxInteraction(_0x2261b4,_0x391aa4,_0x3093d0));});return BPromise[_0x1be2('0xb0')](_0x45d9c4);});});})[_0x1be2('0x2a')](function(_0x2275f7){_0x47a846[_0x1be2('0xb1')]=_0x2275f7;return _0x47a846;})[_0x1be2('0x2a')](respondWithFilteredResult(_0x12ed94,_0x1877db))[_0x1be2('0x33')](handleError(_0x12ed94,null));};exports[_0x1be2('0xb2')]=function(_0x5133a4,_0xcb4827){var _0x1815b2={'raw':![],'where':{'id':_0x5133a4[_0x1be2('0xb3')]['id']}},_0x33eac8={};_0x33eac8[_0x1be2('0x3f')]=_[_0x1be2('0x41')](db[_0x1be2('0x3b')][_0x1be2('0x3c')]);_0x33eac8[_0x1be2('0x42')]=_[_0x1be2('0x41')](_0x5133a4['query']);_0x33eac8['filters']=_[_0x1be2('0x43')](_0x33eac8[_0x1be2('0x3f')],_0x33eac8[_0x1be2('0x42')]);_0x1815b2[_0x1be2('0x45')]=_['intersection'](_0x33eac8[_0x1be2('0x3f')],qs['fields'](_0x5133a4[_0x1be2('0x42')][_0x1be2('0x44')]));_0x1815b2[_0x1be2('0x45')]=_0x1815b2['attributes'][_0x1be2('0x46')]?_0x1815b2[_0x1be2('0x45')]:_0x33eac8[_0x1be2('0x3f')];if(_0x5133a4[_0x1be2('0x42')]['includeAll']){_0x1815b2[_0x1be2('0xb4')]=[{'all':!![]}];}_0x1815b2=_[_0x1be2('0x9d')]({},_0x1815b2,_0x5133a4[_0x1be2('0xb5')]);return db['FaxInteraction'][_0x1be2('0x61')](_0x1815b2)[_0x1be2('0x2a')](handleEntityNotFound(_0xcb4827,null))[_0x1be2('0x2a')](respondWithResult(_0xcb4827,null))[_0x1be2('0x33')](handleError(_0xcb4827,null));};exports[_0x1be2('0xb6')]=function(_0x39bbec,_0x2e9f9f){return db['FaxInteraction'][_0x1be2('0xb6')](_0x39bbec[_0x1be2('0xb7')],{})[_0x1be2('0x2a')](respondWithResult(_0x2e9f9f,0xc9))['catch'](handleError(_0x2e9f9f,null));};exports[_0x1be2('0x29')]=function(_0x39abd5,_0x407c44){if(_0x39abd5['body']['id']){delete _0x39abd5[_0x1be2('0xb7')]['id'];}return db[_0x1be2('0x3b')]['find']({'where':{'id':_0x39abd5['params']['id']}})[_0x1be2('0x2a')](handleEntityNotFound(_0x407c44,null))['then'](saveUpdates(_0x39abd5[_0x1be2('0xb7')],null))[_0x1be2('0x2a')](respondWithResult(_0x407c44,null))[_0x1be2('0x33')](handleError(_0x407c44,null));};exports[_0x1be2('0xb8')]=function(_0x44c725,_0x4f16c7){return db[_0x1be2('0x3b')][_0x1be2('0x61')]({'where':{'id':_0x44c725[_0x1be2('0xb3')]['id']}})['then'](handleEntityNotFound(_0x4f16c7,null))[_0x1be2('0x2a')](removeEntity(_0x4f16c7,null))['catch'](handleError(_0x4f16c7,null));};exports[_0x1be2('0xb9')]=function(_0x2bcc46,_0x29c505){return db[_0x1be2('0x3b')][_0x1be2('0xb9')]()[_0x1be2('0x2a')](respondWithResult(_0x29c505,null))['catch'](handleError(_0x29c505,null));};exports[_0x1be2('0xba')]=function(_0x457ea3,_0x4d4c1f,_0x29e237){return db[_0x1be2('0xbb')][_0x1be2('0x61')]({'where':{'id':_0x457ea3[_0x1be2('0xb3')]['id']}})[_0x1be2('0x2a')](handleEntityNotFound(_0x4d4c1f,null))[_0x1be2('0x2a')](function(_0x567cf5){if(_0x567cf5){return _0x567cf5[_0x1be2('0xba')](_0x457ea3['body']['ids'],_[_0x1be2('0xbc')](_0x457ea3['body'],[_0x1be2('0xbd'),'id'])||{});}})[_0x1be2('0x2a')](respondWithResult(_0x4d4c1f,null))['catch'](handleError(_0x4d4c1f,null));};exports[_0x1be2('0xbe')]=function(_0x497a74,_0x4cbc42,_0x23f502){var _0x16f0d4={'raw':![],'where':{}};var _0x3e09db={};var _0x2c5fe0={'count':0x0,'rows':[]};return db[_0x1be2('0x3b')][_0x1be2('0xbf')]({'where':{'id':_0x497a74[_0x1be2('0xb3')]['id']}})['then'](handleEntityNotFound(_0x4cbc42,null))[_0x1be2('0x2a')](function(_0x1e5b13){if(_0x1e5b13){_0x3e09db['model']=_[_0x1be2('0x41')](db['FaxMessage'][_0x1be2('0x3c')]);_0x3e09db[_0x1be2('0x42')]=_[_0x1be2('0x41')](_0x497a74[_0x1be2('0x42')]);_0x3e09db[_0x1be2('0x4a')]=_[_0x1be2('0x43')](_0x3e09db[_0x1be2('0x3f')],_0x3e09db[_0x1be2('0x42')]);_0x16f0d4[_0x1be2('0x45')]=_[_0x1be2('0x43')](_0x3e09db[_0x1be2('0x3f')],qs[_0x1be2('0x44')](_0x497a74['query'][_0x1be2('0x44')]));_0x16f0d4[_0x1be2('0x45')]=_0x16f0d4[_0x1be2('0x45')][_0x1be2('0x46')]?_0x16f0d4[_0x1be2('0x45')]:_0x3e09db[_0x1be2('0x3f')];if(!_0x497a74[_0x1be2('0x42')][_0x1be2('0x47')](_0x1be2('0x48'))){_0x16f0d4[_0x1be2('0x24')]=qs[_0x1be2('0x24')](_0x497a74[_0x1be2('0x42')][_0x1be2('0x24')]);_0x16f0d4[_0x1be2('0x22')]=qs['offset'](_0x497a74[_0x1be2('0x42')][_0x1be2('0x22')]);}_0x16f0d4[_0x1be2('0x90')]=qs[_0x1be2('0x49')](_0x497a74[_0x1be2('0x42')][_0x1be2('0x49')]);_0x16f0d4[_0x1be2('0x79')]=qs[_0x1be2('0x4a')](_['pick'](_0x497a74[_0x1be2('0x42')],_0x3e09db[_0x1be2('0x4a')]));_0x16f0d4['where'][_0x1be2('0xc0')]=_0x1e5b13['id'];if(_0x497a74[_0x1be2('0x42')][_0x1be2('0x86')]){_0x16f0d4['where']=_[_0x1be2('0x9d')](_0x16f0d4[_0x1be2('0x79')],{'$or':_[_0x1be2('0x2d')](_0x16f0d4[_0x1be2('0x45')],function(_0x4ffc){var _0x300551={};_0x300551[_0x4ffc]={'$like':'%'+_0x497a74[_0x1be2('0x42')][_0x1be2('0x86')]+'%'};return _0x300551;})});}if(_0x497a74[_0x1be2('0x42')][_0x1be2('0x7d')]){var _0x1ba763=_0x497a74[_0x1be2('0x42')][_0x1be2('0x7d')][_0x1be2('0x6f')](',');var _0x12810d={};_0x12810d[_0x1ba763[0x0]]={'$gte':moment(_0x1ba763[0x1])[_0x1be2('0xc1')](_0x1be2('0xc2'))};_0x16f0d4[_0x1be2('0x79')]=_[_0x1be2('0x9d')](_0x16f0d4['where'],_0x12810d);}_0x16f0d4=_['merge']({},_0x16f0d4,_0x497a74[_0x1be2('0xb5')]);return db[_0x1be2('0xbb')][_0x1be2('0x9b')]({'where':_0x16f0d4['where']})[_0x1be2('0x2a')](function(_0x3a0145){_0x2c5fe0[_0x1be2('0x9b')]=_0x3a0145;if(_0x497a74['query']['includeAll']){_0x16f0d4[_0x1be2('0xb4')]=[{'all':!![]}];}return db[_0x1be2('0xbb')]['findAll'](_0x16f0d4);})['then'](function(_0x407dfa){_0x2c5fe0[_0x1be2('0xb1')]=_0x407dfa;return _0x2c5fe0;});}})[_0x1be2('0x2a')](respondWithFilteredResult(_0x4cbc42,_0x16f0d4))['catch'](handleError(_0x4cbc42,null));};exports[_0x1be2('0xc3')]=function(_0x30b736,_0x5a0b9b,_0x1d9842){return db[_0x1be2('0x3b')][_0x1be2('0x61')]({'where':{'id':_0x30b736[_0x1be2('0xb3')]['id']}})['then'](handleEntityNotFound(_0x5a0b9b,null))[_0x1be2('0x2a')](function(_0x17bb8f){if(_0x17bb8f){return _0x17bb8f[_0x1be2('0xc4')](_0x30b736[_0x1be2('0xb7')][_0x1be2('0xbd')],_[_0x1be2('0xbc')](_0x30b736[_0x1be2('0xb7')],[_0x1be2('0xbd'),'id'])||{})[_0x1be2('0xc5')](function(){return db[_0x1be2('0x6e')]['findAll']({'attributes':['id',_0x1be2('0x40'),_0x1be2('0x4d')],'where':{'id':_0x30b736[_0x1be2('0xb7')][_0x1be2('0xbd')]}});})[_0x1be2('0x2a')](function(_0x27f72c){socket['emit']('faxInteractionTags:save',{'id':Number(_0x30b736[_0x1be2('0xb3')]['id']),'tags':_0x27f72c||[]});return{'id':Number(_0x30b736[_0x1be2('0xb3')]['id']),'tags':_0x27f72c||[]};});}})[_0x1be2('0x2a')](respondWithResult(_0x5a0b9b,null))[_0x1be2('0x33')](handleError(_0x5a0b9b,null));};exports[_0x1be2('0xc6')]=function(_0x7c793c,_0x158da6,_0xe9acde){return db['FaxInteraction'][_0x1be2('0x61')]({'where':{'id':_0x7c793c[_0x1be2('0xb3')]['id']}})[_0x1be2('0x2a')](handleEntityNotFound(_0x158da6,null))[_0x1be2('0x2a')](function(_0x229340){if(_0x229340){return _0x229340[_0x1be2('0xc6')](_0x7c793c[_0x1be2('0x42')][_0x1be2('0xbd')]);}})['then'](respondWithStatusCode(_0x158da6,null))[_0x1be2('0x33')](handleError(_0x158da6,null));};exports[_0x1be2('0xc7')]=function(_0x34f523,_0x1c9d37){var _0x41fc64=moment()[_0x1be2('0xc8')]()[_0x1be2('0xad')]();var _0x55f734=path['join'](config[_0x1be2('0xc9')],'server','files',_0x1be2('0xca'));var _0x12fb27=path['join'](config[_0x1be2('0xc9')],'server',_0x1be2('0xcb'),_0x1be2('0xcc'));var _0x48ccdb=path['join'](_0x55f734,_0x41fc64);var _0x282559=util[_0x1be2('0xc1')]('transcript-%d-%s.zip',_0x34f523[_0x1be2('0xb3')]['id'],_0x41fc64);var _0x1f893c=path['join'](_0x55f734,_0x282559);var _0x5c1c07=[];_0x5c1c07[_0x1be2('0x32')]({'model':db[_0x1be2('0xcd')],'as':'Attachment','raw':!![]});var _0x6cbb4c=[{'model':db[_0x1be2('0xbb')],'as':'Messages','attributes':['id','body',_0x1be2('0x7b')],'include':_0x5c1c07}];return db[_0x1be2('0x3b')][_0x1be2('0x61')]({'where':{'id':_0x34f523[_0x1be2('0xb3')]['id']},'include':_0x6cbb4c})['then'](handleEntityNotFound(_0x1c9d37,null))[_0x1be2('0x2a')](function(_0x329ae8){if(_0x329ae8&&_0x329ae8[_0x1be2('0xce')]){var _0xd99c5e=_0x329ae8[_0x1be2('0xcf')]({'plain':!![]});fs['mkdirSync'](_0x48ccdb);for(var _0x3ad1a7=0x0;_0x3ad1a7<_0xd99c5e[_0x1be2('0xce')][_0x1be2('0x46')];_0x3ad1a7++){var _0x2a13b3=_0xd99c5e[_0x1be2('0xce')][_0x3ad1a7][_0x1be2('0xcd')];if(_0x2a13b3){var _0x2eda15=path[_0x1be2('0xd0')](_0x12fb27,_0x2a13b3[_0x1be2('0xd1')]);if(fs[_0x1be2('0xd2')](_0x2eda15)){fs['createReadStream'](_0x2eda15)[_0x1be2('0xd3')](fs['createWriteStream'](path['join'](_0x48ccdb,_0x2a13b3[_0x1be2('0xd1')])));}}}return BPromise[_0x1be2('0x93')]()[_0x1be2('0x2a')](function(){return new BPromise(function(_0xfa3cd7,_0x44a735){zipdir(_0x48ccdb,{'saveTo':_0x1f893c},function(_0x7d304,_0x291052){if(_0x7d304)return _0x44a735(_0x7d304);return _0xfa3cd7(_0x291052);});})[_0x1be2('0x2a')](function(){return new BPromise(function(_0x3ef0fa,_0x5b6c05){rimraf(_0x48ccdb,function(_0x20e538){if(_0x20e538)_0x5b6c05(_0x20e538);return _0x3ef0fa();});});})[_0x1be2('0x2a')](function(){return _0x1c9d37[_0x1be2('0xc7')](_0x1f893c,_0x282559,function(_0x274dda){if(_0x274dda){console['log'](_0x1be2('0xd4'),_0x274dda);}else{fs[_0x1be2('0xd5')](_0x1f893c);}});});});}else{return _0x1c9d37['sendStatus'](0xc8);}})['catch'](handleError(_0x1c9d37,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 2b0ae5b..0e12fa1 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 _0x75eb=['setDataValue','length','emit','catch','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','Users','map','then'];(function(_0x350057,_0x3e6da0){var _0x299b58=function(_0x3ae018){while(--_0x3ae018){_0x350057['push'](_0x350057['shift']());}};_0x299b58(++_0x3e6da0);}(_0x75eb,0xe5));var _0xb75e=function(_0x438c54,_0x5f5678){_0x438c54=_0x438c54-0x0;var _0x3ee347=_0x75eb[_0x438c54];return _0x3ee347;};'use strict';var EventEmitter=require(_0xb75e('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xb75e('0x1'))['db'][_0xb75e('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb75e('0x3')](0x0);var events={'afterCreate':_0xb75e('0x4'),'afterUpdate':_0xb75e('0x5'),'afterDestroy':_0xb75e('0x6')};function emitEvent(_0x4e77a9){return function(_0x390fa6,_0x400704,_0x2a0358){_0x390fa6[_0xb75e('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x372d82){_0x390fa6['setDataValue'](_0xb75e('0x8'),_0x372d82[_0xb75e('0x9')](function(_0x51b3f9){return{'id':_0x51b3f9['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x390fa6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb75e('0xa')](function(_0x32cea8){_0x390fa6[_0xb75e('0xb')]('unreadMessages',_0x32cea8[_0xb75e('0xc')]);FaxInteractionEvents[_0xb75e('0xd')](_0x4e77a9+':'+_0x390fa6['id'],_0x390fa6);FaxInteractionEvents[_0xb75e('0xd')](_0x4e77a9,_0x390fa6);_0x2a0358(null);})[_0xb75e('0xe')](_0x2a0358(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xb75e('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x778f=['unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','then','setDataValue','Users','map'];(function(_0x5bf47a,_0x6ea2d1){var _0x1b57b8=function(_0x5183d8){while(--_0x5183d8){_0x5bf47a['push'](_0x5bf47a['shift']());}};_0x1b57b8(++_0x6ea2d1);}(_0x778f,0xe6));var _0xf778=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x778f[_0x59d89e];return _0x554e93;};'use strict';var EventEmitter=require(_0xf778('0x0'));var FaxInteraction=require(_0xf778('0x1'))['db'][_0xf778('0x2')];var FaxMessage=require(_0xf778('0x1'))['db'][_0xf778('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf778('0x4')](0x0);var events={'afterCreate':_0xf778('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4baeff){return function(_0x229cc5,_0x39af74,_0x2b4a95){_0x229cc5['getUsers']({'attributes':['id'],'raw':!![]})[_0xf778('0x6')](function(_0x1bef74){_0x229cc5[_0xf778('0x7')](_0xf778('0x8'),_0x1bef74[_0xf778('0x9')](function(_0x554c8f){return{'id':_0x554c8f['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x229cc5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4d4633){_0x229cc5['setDataValue'](_0xf778('0xa'),_0x4d4633['length']);FaxInteractionEvents['emit'](_0x4baeff+':'+_0x229cc5['id'],_0x229cc5);FaxInteractionEvents[_0xf778('0xb')](_0x4baeff,_0x229cc5);_0x2b4a95(null);})[_0xf778('0xc')](_0x2b4a95(null));};}for(var e in events){if(events[_0xf778('0xd')](e)){var event=events[e];FaxInteraction[_0xf778('0xe')](e,emitEvent(event));}}module[_0xf778('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index f4c9026..06c6061 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 _0xe6c0=['request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions','changed','closedAt','util','../../config/logger','api','bluebird'];(function(_0x4b6a59,_0x14892f){var _0x19f2f0=function(_0x16202c){while(--_0x16202c){_0x4b6a59['push'](_0x4b6a59['shift']());}};_0x19f2f0(++_0x14892f);}(_0xe6c0,0x88));var _0x0e6c=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xe6c0[_0x50007c];return _0x5c1ec7;};'use strict';var _=require('lodash');var util=require(_0x0e6c('0x0'));var logger=require(_0x0e6c('0x1'))(_0x0e6c('0x2'));var moment=require('moment');var BPromise=require(_0x0e6c('0x3'));var rp=require(_0x0e6c('0x4'));var fs=require('fs');var path=require(_0x0e6c('0x5'));var rimraf=require(_0x0e6c('0x6'));var config=require(_0x0e6c('0x7'));var attributes=require(_0x0e6c('0x8'));module[_0x0e6c('0x9')]=function(_0x11cfa0,_0x33988c){return _0x11cfa0[_0x0e6c('0xa')]('FaxInteraction',attributes,{'tableName':_0x0e6c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f1f0b,_0x6d6428,_0x50e647){if(_0x4f1f0b[_0x0e6c('0xc')]('closed')){_0x4f1f0b[_0x0e6c('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x50e647(null,_0x4f1f0b);}}});}; \ No newline at end of file +var _0x4a41=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x37a0ab,_0x34b900){var _0x13ca1d=function(_0x3c6a41){while(--_0x3c6a41){_0x37a0ab['push'](_0x37a0ab['shift']());}};_0x13ca1d(++_0x34b900);}(_0x4a41,0x1b8));var _0x14a4=function(_0x628d48,_0x304714){_0x628d48=_0x628d48-0x0;var _0x558cd7=_0x4a41[_0x628d48];return _0x558cd7;};'use strict';var _=require(_0x14a4('0x0'));var util=require(_0x14a4('0x1'));var logger=require(_0x14a4('0x2'))(_0x14a4('0x3'));var moment=require(_0x14a4('0x4'));var BPromise=require(_0x14a4('0x5'));var rp=require(_0x14a4('0x6'));var fs=require('fs');var path=require(_0x14a4('0x7'));var rimraf=require(_0x14a4('0x8'));var config=require(_0x14a4('0x9'));var attributes=require('./faxInteraction.attributes');module[_0x14a4('0xa')]=function(_0x5dbffc,_0x3ef4d9){return _0x5dbffc[_0x14a4('0xb')]('FaxInteraction',attributes,{'tableName':_0x14a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x23f6b6,_0x4c3eb2,_0x593323){if(_0x23f6b6[_0x14a4('0xd')](_0x14a4('0xe'))){_0x23f6b6[_0x14a4('0xf')]=moment()['format'](_0x14a4('0x10'));}_0x593323(null,_0x23f6b6);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 98ad830..1d0cf4a 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 _0x6eb3=['info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','limit','stringify','AddTagsToFaxInteraction','find','addTags','omit','ids','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then'];(function(_0x3608dc,_0x23f734){var _0x1f7b9a=function(_0xdd6552){while(--_0xdd6552){_0x3608dc['push'](_0x3608dc['shift']());}};_0x1f7b9a(++_0x23f734);}(_0x6eb3,0x146));var _0x36eb=function(_0x4ff539,_0x646234){_0x4ff539=_0x4ff539-0x0;var _0x3b3b77=_0x6eb3[_0x4ff539];return _0x3b3b77;};'use strict';var _=require(_0x36eb('0x0'));var util=require(_0x36eb('0x1'));var moment=require(_0x36eb('0x2'));var BPromise=require(_0x36eb('0x3'));var rs=require(_0x36eb('0x4'));var fs=require('fs');var Redis=require(_0x36eb('0x5'));var db=require(_0x36eb('0x6'))['db'];var utils=require(_0x36eb('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x36eb('0x8'));var jayson=require(_0x36eb('0x9'));var client=jayson['client'][_0x36eb('0xa')]({'port':0x232a});config[_0x36eb('0xb')]=_[_0x36eb('0xc')](config[_0x36eb('0xb')],{'host':_0x36eb('0xd'),'port':0x18eb});var socket=require(_0x36eb('0xe'))(new Redis(config[_0x36eb('0xb')]));require(_0x36eb('0xf'))[_0x36eb('0x10')](socket);function respondWithRpcPromise(_0x18c760,_0x333314,_0x53f9ad){return new BPromise(function(_0x30e5d8,_0x18c324){return client['request'](_0x18c760,_0x53f9ad)[_0x36eb('0x11')](function(_0x10498c){logger[_0x36eb('0x12')](_0x36eb('0x13'),_0x333314,_0x36eb('0x14'));logger[_0x36eb('0x15')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x333314,'request\x20sent',JSON['stringify'](_0x10498c));if(_0x10498c[_0x36eb('0x16')]){if(_0x10498c[_0x36eb('0x16')][_0x36eb('0x17')]===0x1f4){logger[_0x36eb('0x16')](_0x36eb('0x13'),_0x333314,_0x10498c[_0x36eb('0x16')][_0x36eb('0x18')]);return _0x18c324(_0x10498c[_0x36eb('0x16')][_0x36eb('0x18')]);}logger['error'](_0x36eb('0x13'),_0x333314,_0x10498c[_0x36eb('0x16')]['message']);return _0x30e5d8(_0x10498c[_0x36eb('0x16')][_0x36eb('0x18')]);}else{logger[_0x36eb('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x333314,'request\x20sent');_0x30e5d8(_0x10498c[_0x36eb('0x19')][_0x36eb('0x18')]);}})['catch'](function(_0x495e4c){logger[_0x36eb('0x16')](_0x36eb('0x13'),_0x333314,_0x495e4c);_0x18c324(_0x495e4c);});});}exports[_0x36eb('0x1a')]=function(_0x45817c){var _0x2d9020=this;return new Promise(function(_0x573bea,_0x56a156){return db[_0x36eb('0x1b')][_0x36eb('0x1c')](_0x45817c['body'],{'raw':_0x45817c[_0x36eb('0x1d')]?_0x45817c[_0x36eb('0x1d')][_0x36eb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45817c[_0x36eb('0x1d')]?_0x45817c['options'][_0x36eb('0x1f')]||null:null,'attributes':_0x45817c[_0x36eb('0x1d')]?_0x45817c['options'][_0x36eb('0x20')]||null:null,'limit':_0x45817c[_0x36eb('0x1d')]?_0x45817c[_0x36eb('0x1d')][_0x36eb('0x21')]||null:null})[_0x36eb('0x11')](function(_0x11f08){logger[_0x36eb('0x12')](_0x36eb('0x1a'),_0x45817c);logger[_0x36eb('0x15')](_0x36eb('0x1a'),_0x45817c,JSON[_0x36eb('0x22')](_0x11f08));_0x573bea(_0x11f08);})['catch'](function(_0xc41d64){logger[_0x36eb('0x16')](_0x36eb('0x1a'),_0xc41d64[_0x36eb('0x18')],_0x45817c);_0x56a156(_0x2d9020[_0x36eb('0x16')](0x1f4,_0xc41d64[_0x36eb('0x18')]));});});};exports[_0x36eb('0x23')]=function(_0x283006){return new Promise(function(_0x372f0a,_0x9c25bb){return db[_0x36eb('0x1b')][_0x36eb('0x24')]({'where':_0x283006[_0x36eb('0x1d')]?_0x283006['options']['where']||null:null})[_0x36eb('0x11')](function(_0x458b61){if(_0x458b61){return _0x458b61[_0x36eb('0x25')](_0x283006['body']['ids'],_[_0x36eb('0x26')](_0x283006['body'],[_0x36eb('0x27'),'id'])||{});}})[_0x36eb('0x28')](function(_0x3b4d90){logger[_0x36eb('0x12')](_0x36eb('0x29'),_0x283006);logger[_0x36eb('0x15')]('AddTags',_0x283006,JSON[_0x36eb('0x22')](_0x3b4d90));_0x372f0a(_0x3b4d90);})[_0x36eb('0x2a')](function(_0x53adf3){logger[_0x36eb('0x16')]('AddTags',_0x53adf3[_0x36eb('0x18')],_0x283006);_0x9c25bb(_this[_0x36eb('0x16')](0x1f4,_0x53adf3['message']));});});}; \ No newline at end of file +var _0xd199=['register','then','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','FaxInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateFaxInteraction','update','body','options','where','attributes','limit','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','omit','spread','AddTags','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x3e4d5b,_0x10ff2f){var _0xf2591e=function(_0x12edb7){while(--_0x12edb7){_0x3e4d5b['push'](_0x3e4d5b['shift']());}};_0xf2591e(++_0x10ff2f);}(_0xd199,0x1bf));var _0x9d19=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd199[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9d19('0x0'));var util=require(_0x9d19('0x1'));var moment=require(_0x9d19('0x2'));var BPromise=require(_0x9d19('0x3'));var rs=require(_0x9d19('0x4'));var fs=require('fs');var Redis=require(_0x9d19('0x5'));var db=require(_0x9d19('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9d19('0x7'));var jayson=require(_0x9d19('0x8'));var client=jayson[_0x9d19('0x9')][_0x9d19('0xa')]({'port':0x232a});config['redis']=_[_0x9d19('0xb')](config[_0x9d19('0xc')],{'host':_0x9d19('0xd'),'port':0x18eb});var socket=require(_0x9d19('0xe'))(new Redis(config[_0x9d19('0xc')]));require('./faxInteraction.socket')[_0x9d19('0xf')](socket);function respondWithRpcPromise(_0x5528fc,_0x389635,_0x308d4a){return new BPromise(function(_0x5c6dc1,_0xa07bec){return client['request'](_0x5528fc,_0x308d4a)[_0x9d19('0x10')](function(_0x2ceeee){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x389635,_0x9d19('0x11'));logger[_0x9d19('0x12')](_0x9d19('0x13'),_0x389635,_0x9d19('0x11'),JSON['stringify'](_0x2ceeee));if(_0x2ceeee[_0x9d19('0x14')]){if(_0x2ceeee[_0x9d19('0x14')]['code']===0x1f4){logger['error'](_0x9d19('0x15'),_0x389635,_0x2ceeee[_0x9d19('0x14')][_0x9d19('0x16')]);return _0xa07bec(_0x2ceeee[_0x9d19('0x14')][_0x9d19('0x16')]);}logger[_0x9d19('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x389635,_0x2ceeee['error']['message']);return _0x5c6dc1(_0x2ceeee[_0x9d19('0x14')][_0x9d19('0x16')]);}else{logger[_0x9d19('0x17')](_0x9d19('0x15'),_0x389635,_0x9d19('0x11'));_0x5c6dc1(_0x2ceeee[_0x9d19('0x18')]['message']);}})[_0x9d19('0x19')](function(_0x1a3cc1){logger['error'](_0x9d19('0x15'),_0x389635,_0x1a3cc1);_0xa07bec(_0x1a3cc1);});});}exports[_0x9d19('0x1a')]=function(_0x54c261){var _0x52ed8f=this;return new Promise(function(_0x938c25,_0x362a71){return db['FaxInteraction'][_0x9d19('0x1b')](_0x54c261[_0x9d19('0x1c')],{'raw':_0x54c261[_0x9d19('0x1d')]?_0x54c261['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54c261[_0x9d19('0x1d')]?_0x54c261[_0x9d19('0x1d')][_0x9d19('0x1e')]||null:null,'attributes':_0x54c261['options']?_0x54c261['options'][_0x9d19('0x1f')]||null:null,'limit':_0x54c261[_0x9d19('0x1d')]?_0x54c261[_0x9d19('0x1d')][_0x9d19('0x20')]||null:null})[_0x9d19('0x10')](function(_0x2ba142){logger[_0x9d19('0x17')](_0x9d19('0x1a'),_0x54c261);logger[_0x9d19('0x12')](_0x9d19('0x1a'),_0x54c261,JSON['stringify'](_0x2ba142));_0x938c25(_0x2ba142);})[_0x9d19('0x19')](function(_0x3a3fab){logger[_0x9d19('0x14')](_0x9d19('0x1a'),_0x3a3fab[_0x9d19('0x16')],_0x54c261);_0x362a71(_0x52ed8f[_0x9d19('0x14')](0x1f4,_0x3a3fab[_0x9d19('0x16')]));});});};exports[_0x9d19('0x21')]=function(_0x1fe0dc){return new Promise(function(_0x27a696,_0x55dc9d){return db[_0x9d19('0x22')][_0x9d19('0x23')]({'where':_0x1fe0dc['options']?_0x1fe0dc['options'][_0x9d19('0x1e')]||null:null})[_0x9d19('0x10')](function(_0x130be6){if(_0x130be6){return _0x130be6[_0x9d19('0x24')](_0x1fe0dc[_0x9d19('0x1c')][_0x9d19('0x25')],_[_0x9d19('0x26')](_0x1fe0dc[_0x9d19('0x1c')],[_0x9d19('0x25'),'id'])||{});}})[_0x9d19('0x27')](function(_0x4c3933){logger[_0x9d19('0x17')](_0x9d19('0x28'),_0x1fe0dc);logger[_0x9d19('0x12')]('AddTags',_0x1fe0dc,JSON[_0x9d19('0x29')](_0x4c3933));_0x27a696(_0x4c3933);})[_0x9d19('0x19')](function(_0x3c6d68){logger[_0x9d19('0x14')]('AddTags',_0x3c6d68[_0x9d19('0x16')],_0x1fe0dc);_0x55dc9d(_this['error'](0x1f4,_0x3c6d68[_0x9d19('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 5ce35b8..648890b 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 _0x170d=['remove','update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x170d,0x1c7));var _0xd170=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x170d[_0x42cae2];return _0x5f256f;};'use strict';var FaxInteractionEvents=require(_0xd170('0x0'));var events=['save',_0xd170('0x1'),_0xd170('0x2')];function createListener(_0x42e7da,_0x777bb0){return function(_0x3665f7){_0x777bb0[_0xd170('0x3')](_0x42e7da,_0x3665f7);};}function removeListener(_0x30a94d,_0x17ef88){return function(){FaxInteractionEvents[_0xd170('0x4')](_0x30a94d,_0x17ef88);};}exports[_0xd170('0x5')]=function(_0x202e33){for(var _0x53cc55=0x0,_0x15faf=events[_0xd170('0x6')];_0x53cc55<_0x15faf;_0x53cc55++){var _0x3cf4e5=events[_0x53cc55];var _0x4c5c3a=createListener(_0xd170('0x7')+_0x3cf4e5,_0x202e33);FaxInteractionEvents['on'](_0x3cf4e5,_0x4c5c3a);}}; \ No newline at end of file +var _0x8313=['faxInteraction:','./faxInteraction.events','remove','update','removeListener','register','length'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0x8313,0x94));var _0x3831=function(_0x233975,_0x808eff){_0x233975=_0x233975-0x0;var _0x3dd8fa=_0x8313[_0x233975];return _0x3dd8fa;};'use strict';var FaxInteractionEvents=require(_0x3831('0x0'));var events=['save',_0x3831('0x1'),_0x3831('0x2')];function createListener(_0x43ebd6,_0x590968){return function(_0x535895){_0x590968['emit'](_0x43ebd6,_0x535895);};}function removeListener(_0x15f267,_0x550367){return function(){FaxInteractionEvents[_0x3831('0x3')](_0x15f267,_0x550367);};}exports[_0x3831('0x4')]=function(_0x2b86f1){for(var _0x292f9b=0x0,_0x193fb3=events[_0x3831('0x5')];_0x292f9b<_0x193fb3;_0x292f9b++){var _0x4c5d53=events[_0x292f9b];var _0xaefad6=createListener(_0x3831('0x6')+_0x4c5d53,_0x2b86f1);FaxInteractionEvents['on'](_0x4c5d53,_0xaefad6);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 11c195c..7b1ed61 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 _0xfada=['describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','fax','addTags','update','delete','faxinteraction:destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','/describe'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0xfada,0x1d2));var _0xafad=function(_0x135181,_0x714103){_0x135181=_0x135181-0x0;var _0x55fc50=_0xfada[_0x135181];return _0x55fc50;};'use strict';var multer=require(_0xafad('0x0'));var util=require(_0xafad('0x1'));var path=require('path');var timeout=require(_0xafad('0x2'));var express=require(_0xafad('0x3'));var router=express['Router']();var fs_extra=require(_0xafad('0x4'));var auth=require(_0xafad('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0xafad('0x6')]('/',auth[_0xafad('0x7')](),controller['index']);router[_0xafad('0x6')](_0xafad('0x8'),auth[_0xafad('0x7')](),controller[_0xafad('0x9')]);router[_0xafad('0x6')](_0xafad('0xa'),auth['isAuthenticated'](),controller[_0xafad('0xb')]);router[_0xafad('0x6')](_0xafad('0xc'),auth[_0xafad('0x7')](),controller[_0xafad('0xd')]);router[_0xafad('0x6')](_0xafad('0xe'),auth[_0xafad('0x7')](),controller['download']);router[_0xafad('0xf')]('/',auth['isAuthenticated'](),controller[_0xafad('0x10')]);router[_0xafad('0xf')](_0xafad('0xc'),auth['isAuthenticated'](),controller[_0xafad('0x11')]);router['post'](_0xafad('0x12'),auth[_0xafad('0x7')](),interaction[_0xafad('0x13')](_0xafad('0x14'),'faxinteraction:addtags'),controller[_0xafad('0x15')]);router['put'](_0xafad('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0xafad('0x14'),'faxinteraction:update'),controller[_0xafad('0x16')]);router[_0xafad('0x17')](_0xafad('0xa'),auth[_0xafad('0x7')](),interaction[_0xafad('0x13')](_0xafad('0x14'),_0xafad('0x18')),controller['destroy']);router['delete'](_0xafad('0x12'),auth[_0xafad('0x7')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0xdd01=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','/:id/tags','tracked','fax','put','faxinteraction:update','update','destroy','removeTags'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xdd01,0x137));var _0x1dd0=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xdd01[_0x27af45];return _0x18df21;};'use strict';var multer=require('multer');var util=require(_0x1dd0('0x0'));var path=require(_0x1dd0('0x1'));var timeout=require(_0x1dd0('0x2'));var express=require(_0x1dd0('0x3'));var router=express['Router']();var fs_extra=require(_0x1dd0('0x4'));var auth=require(_0x1dd0('0x5'));var interaction=require(_0x1dd0('0x6'));var config=require(_0x1dd0('0x7'));var controller=require(_0x1dd0('0x8'));router[_0x1dd0('0x9')]('/',auth[_0x1dd0('0xa')](),controller[_0x1dd0('0xb')]);router[_0x1dd0('0x9')]('/describe',auth[_0x1dd0('0xa')](),controller[_0x1dd0('0xc')]);router[_0x1dd0('0x9')](_0x1dd0('0xd'),auth[_0x1dd0('0xa')](),controller[_0x1dd0('0xe')]);router[_0x1dd0('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1dd0('0xf')]);router['get'](_0x1dd0('0x10'),auth['isAuthenticated'](),controller[_0x1dd0('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1dd0('0x12')]);router[_0x1dd0('0x13')](_0x1dd0('0x14'),auth[_0x1dd0('0xa')](),controller[_0x1dd0('0x15')]);router['post'](_0x1dd0('0x16'),auth['isAuthenticated'](),interaction[_0x1dd0('0x17')](_0x1dd0('0x18'),'faxinteraction:addtags'),controller['addTags']);router[_0x1dd0('0x19')](_0x1dd0('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x1dd0('0x18'),_0x1dd0('0x1a')),controller[_0x1dd0('0x1b')]);router['delete'](_0x1dd0('0xd'),auth[_0x1dd0('0xa')](),interaction[_0x1dd0('0x17')]('fax','faxinteraction:destroy'),controller[_0x1dd0('0x1c')]);router['delete'](_0x1dd0('0x16'),auth['isAuthenticated'](),controller[_0x1dd0('0x1d')]);module[_0x1dd0('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 8381e34..0969640 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 _0x1da1=['sequelize','exports','TEXT','medium','BOOLEAN','out','DATE'];(function(_0x2c00d8,_0x595bba){var _0x475992=function(_0x29377c){while(--_0x29377c){_0x2c00d8['push'](_0x2c00d8['shift']());}};_0x475992(++_0x595bba);}(_0x1da1,0x1a4));var _0x11da=function(_0x118baf,_0x3d5c52){_0x118baf=_0x118baf-0x0;var _0x120749=_0x1da1[_0x118baf];return _0x120749;};'use strict';var Sequelize=require(_0x11da('0x0'));module[_0x11da('0x1')]={'body':{'type':Sequelize[_0x11da('0x2')](_0x11da('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x11da('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x11da('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x11da('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x11da('0x6')]}}; \ No newline at end of file +var _0x430e=['ENUM','out','DATE','exports','TEXT','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x430e,0x105));var _0xe430=function(_0x17fea7,_0x102927){_0x17fea7=_0x17fea7-0x0;var _0x3150c3=_0x430e[_0x17fea7];return _0x3150c3;};'use strict';var Sequelize=require('sequelize');module[_0xe430('0x0')]={'body':{'type':Sequelize[_0xe430('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe430('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe430('0x3')]('in',_0xe430('0x4')),'defaultValue':_0xe430('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xe430('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index b3f6ddd..bd13dd7 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 _0x9b60=['CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','basename','join','root','server','files','attachments','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','end','json','undefined','limit','count','offset','status','Content-Range','apply','reject','save','destroy','stack','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','fields','length','find','update','body','describe','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','fax-interactions','stringify','null','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','interface','rejectmessage','create'];(function(_0x558244,_0x5c564c){var _0x25a8ec=function(_0x1b96c3){while(--_0x1b96c3){_0x558244['push'](_0x558244['shift']());}};_0x25a8ec(++_0x5c564c);}(_0x9b60,0x12b));var _0x09b6=function(_0x2cd8b2,_0x55af4d){_0x2cd8b2=_0x2cd8b2-0x0;var _0x5155dd=_0x9b60[_0x2cd8b2];return _0x5155dd;};'use strict';var emlformat=require(_0x09b6('0x0'));var rimraf=require(_0x09b6('0x1'));var zipdir=require(_0x09b6('0x2'));var jsonpatch=require(_0x09b6('0x3'));var rp=require(_0x09b6('0x4'));var moment=require(_0x09b6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x09b6('0x6'));var util=require('util');var path=require(_0x09b6('0x7'));var sox=require(_0x09b6('0x8'));var csv=require(_0x09b6('0x9'));var ejs=require(_0x09b6('0xa'));var fs=require('fs');var fs_extra=require(_0x09b6('0xb'));var _=require('lodash');var squel=require(_0x09b6('0xc'));var crypto=require(_0x09b6('0xd'));var jsforce=require(_0x09b6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x09b6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x09b6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x09b6('0x10'));var as=require(_0x09b6('0x11'));var hardwareService=require(_0x09b6('0x12'));var logger=require(_0x09b6('0x13'))(_0x09b6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x09b6('0x15'));var db=require(_0x09b6('0x16'))['db'];config[_0x09b6('0x17')]=_[_0x09b6('0x18')](config[_0x09b6('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x09b6('0x19'))(new Redis(config[_0x09b6('0x17')]));require(_0x09b6('0x1a'))[_0x09b6('0x1b')](socket);var jayson=require(_0x09b6('0x1c'));var client=jayson[_0x09b6('0x1d')][_0x09b6('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x09b6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4653a7,_0x3dd852,_0x5de52f,_0x3c96ef){return new BPromise(function(_0x500768,_0x5c4304){var _0x105ebf=_0x3c96ef||client;return _0x105ebf[_0x09b6('0x1f')](_0x4653a7,_0x5de52f)[_0x09b6('0x20')](function(_0x3b5403){logger[_0x09b6('0x21')](_0x09b6('0x22'),_0x3dd852,_0x09b6('0x23'));logger[_0x09b6('0x24')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x3dd852,_0x09b6('0x23'),JSON['stringify'](_0x3b5403));if(_0x3b5403[_0x09b6('0x25')]){if(_0x3b5403[_0x09b6('0x25')][_0x09b6('0x26')]===0x1f4){logger['error'](_0x09b6('0x22'),_0x3dd852,_0x3b5403[_0x09b6('0x25')]['message']);return _0x5c4304(_0x3b5403[_0x09b6('0x25')]['message']);}logger[_0x09b6('0x25')](_0x09b6('0x22'),_0x3dd852,_0x3b5403['error']['message']);return _0x500768(_0x3b5403[_0x09b6('0x25')][_0x09b6('0x27')]);}else{logger[_0x09b6('0x21')](_0x09b6('0x22'),_0x3dd852,_0x09b6('0x23'));_0x500768(_0x3b5403[_0x09b6('0x28')][_0x09b6('0x27')]);}})[_0x09b6('0x29')](function(_0x1c37ec){logger[_0x09b6('0x25')](_0x09b6('0x22'),_0x3dd852,_0x1c37ec);_0x5c4304(_0x1c37ec);});});}function respondWithStatusCode(_0x43374c,_0x369848){_0x369848=_0x369848||0xcc;return function(_0x51af4b){if(_0x51af4b){return _0x43374c[_0x09b6('0x2a')](_0x369848);}return _0x43374c['status'](_0x369848)[_0x09b6('0x2b')]();};}function respondWithResult(_0x2c79d0,_0x2d4c25){_0x2d4c25=_0x2d4c25||0xc8;return function(_0x17c84c){if(_0x17c84c){return _0x2c79d0['status'](_0x2d4c25)[_0x09b6('0x2c')](_0x17c84c);}};}function respondWithFilteredResult(_0xe572cc,_0x260256){return function(_0x51f003){if(_0x51f003){var _0x218109=typeof _0x260256['offset']===_0x09b6('0x2d')&&typeof _0x260256[_0x09b6('0x2e')]===_0x09b6('0x2d');var _0x28537a=_0x51f003[_0x09b6('0x2f')];var _0x2ab4d1=_0x218109?0x0:_0x260256[_0x09b6('0x30')];var _0x38f263=_0x218109?_0x51f003['count']:_0x260256[_0x09b6('0x30')]+_0x260256[_0x09b6('0x2e')];var _0x507069;if(_0x38f263>=_0x28537a){_0x38f263=_0x28537a;_0x507069=0xc8;}else{_0x507069=0xce;}_0xe572cc[_0x09b6('0x31')](_0x507069);return _0xe572cc['set'](_0x09b6('0x32'),_0x2ab4d1+'-'+_0x38f263+'/'+_0x28537a)['json'](_0x51f003);}return null;};}function patchUpdates(_0x19c6e0){return function(_0x290c7e){try{jsonpatch[_0x09b6('0x33')](_0x290c7e,_0x19c6e0,!![]);}catch(_0x2e3dd9){return BPromise[_0x09b6('0x34')](_0x2e3dd9);}return _0x290c7e[_0x09b6('0x35')]();};}function saveUpdates(_0x183051,_0x2fc608){return function(_0x3bdab2){if(_0x3bdab2){return _0x3bdab2['update'](_0x183051)[_0x09b6('0x20')](function(_0xcdac50){return _0xcdac50;});}return null;};}function removeEntity(_0x2c5fce,_0x43ca8a){return function(_0x3c8137){if(_0x3c8137){return _0x3c8137[_0x09b6('0x36')]()[_0x09b6('0x20')](function(){_0x2c5fce['status'](0xcc)[_0x09b6('0x2b')]();});}};}function handleEntityNotFound(_0x122f47,_0x1a7127){return function(_0x5a98f6){if(!_0x5a98f6){_0x122f47['sendStatus'](0x194);}return _0x5a98f6;};}function handleError(_0x462544,_0x5eb6ab){_0x5eb6ab=_0x5eb6ab||0x1f4;return function(_0x3c2ee6){logger[_0x09b6('0x25')](_0x3c2ee6[_0x09b6('0x37')]);if(_0x3c2ee6['name']){delete _0x3c2ee6['name'];}_0x462544[_0x09b6('0x31')](_0x5eb6ab)['send'](_0x3c2ee6);};}exports[_0x09b6('0x38')]=function(_0x1172f6,_0x496655){var _0x5ece2f={},_0x17a738={},_0x47fd2c={'count':0x0,'rows':[]};var _0x4796f6=_[_0x09b6('0x39')](db[_0x09b6('0x3a')][_0x09b6('0x3b')],function(_0x55c026){return{'name':_0x55c026[_0x09b6('0x3c')],'type':_0x55c026[_0x09b6('0x3d')][_0x09b6('0x3e')]};});_0x17a738[_0x09b6('0x3f')]=_[_0x09b6('0x39')](_0x4796f6,_0x09b6('0x40'));_0x17a738[_0x09b6('0x41')]=_[_0x09b6('0x42')](_0x1172f6['query']);_0x17a738[_0x09b6('0x43')]=_[_0x09b6('0x44')](_0x17a738[_0x09b6('0x3f')],_0x17a738[_0x09b6('0x41')]);_0x5ece2f[_0x09b6('0x45')]=_['intersection'](_0x17a738['model'],qs['fields'](_0x1172f6[_0x09b6('0x41')]['fields']));_0x5ece2f[_0x09b6('0x45')]=_0x5ece2f['attributes']['length']?_0x5ece2f[_0x09b6('0x45')]:_0x17a738['model'];if(!_0x1172f6[_0x09b6('0x41')][_0x09b6('0x46')]('nolimit')){_0x5ece2f[_0x09b6('0x2e')]=qs[_0x09b6('0x2e')](_0x1172f6[_0x09b6('0x41')][_0x09b6('0x2e')]);_0x5ece2f['offset']=qs[_0x09b6('0x30')](_0x1172f6['query'][_0x09b6('0x30')]);}_0x5ece2f[_0x09b6('0x47')]=qs['sort'](_0x1172f6['query'][_0x09b6('0x48')]);_0x5ece2f[_0x09b6('0x49')]=qs[_0x09b6('0x43')](_[_0x09b6('0x4a')](_0x1172f6[_0x09b6('0x41')],_0x17a738[_0x09b6('0x43')]),_0x4796f6);if(_0x1172f6[_0x09b6('0x41')][_0x09b6('0x4b')]){_0x5ece2f[_0x09b6('0x49')]=_[_0x09b6('0x4c')](_0x5ece2f['where'],{'$or':_[_0x09b6('0x39')](_0x4796f6,function(_0x2a8282){if(_0x2a8282[_0x09b6('0x3d')]!=='VIRTUAL'){var _0x4c7542={};_0x4c7542[_0x2a8282[_0x09b6('0x40')]]={'$like':'%'+_0x1172f6['query'][_0x09b6('0x4b')]+'%'};return _0x4c7542;}})});}_0x5ece2f=_[_0x09b6('0x4c')]({},_0x5ece2f,_0x1172f6[_0x09b6('0x4d')]);var _0x5e37b7={'where':_0x5ece2f[_0x09b6('0x49')]};return db[_0x09b6('0x3a')][_0x09b6('0x2f')](_0x5e37b7)[_0x09b6('0x20')](function(_0x50e2dc){_0x47fd2c[_0x09b6('0x2f')]=_0x50e2dc;if(_0x1172f6[_0x09b6('0x41')][_0x09b6('0x4e')]){_0x5ece2f[_0x09b6('0x4f')]=[{'all':!![]}];}return db['FaxMessage'][_0x09b6('0x50')](_0x5ece2f);})['then'](function(_0x5d9751){_0x47fd2c['rows']=_0x5d9751;return _0x47fd2c;})[_0x09b6('0x20')](respondWithFilteredResult(_0x496655,_0x5ece2f))['catch'](handleError(_0x496655,null));};exports[_0x09b6('0x51')]=function(_0x4f009b,_0x3088f0){var _0x22644e={'raw':!![],'where':{'id':_0x4f009b[_0x09b6('0x52')]['id']}},_0x11806d={};_0x11806d[_0x09b6('0x3f')]=_[_0x09b6('0x42')](db[_0x09b6('0x3a')][_0x09b6('0x3b')]);_0x11806d[_0x09b6('0x41')]=_[_0x09b6('0x42')](_0x4f009b['query']);_0x11806d['filters']=_[_0x09b6('0x44')](_0x11806d[_0x09b6('0x3f')],_0x11806d[_0x09b6('0x41')]);_0x22644e['attributes']=_[_0x09b6('0x44')](_0x11806d['model'],qs[_0x09b6('0x53')](_0x4f009b[_0x09b6('0x41')]['fields']));_0x22644e[_0x09b6('0x45')]=_0x22644e[_0x09b6('0x45')][_0x09b6('0x54')]?_0x22644e['attributes']:_0x11806d['model'];if(_0x4f009b[_0x09b6('0x41')]['includeAll']){_0x22644e['include']=[{'all':!![]}];}_0x22644e=_[_0x09b6('0x4c')]({},_0x22644e,_0x4f009b['options']);return db[_0x09b6('0x3a')][_0x09b6('0x55')](_0x22644e)[_0x09b6('0x20')](handleEntityNotFound(_0x3088f0,null))[_0x09b6('0x20')](respondWithResult(_0x3088f0,null))['catch'](handleError(_0x3088f0,null));};exports[_0x09b6('0x56')]=function(_0x1930a4,_0x12430d){if(_0x1930a4[_0x09b6('0x57')]['id']){delete _0x1930a4['body']['id'];}return db[_0x09b6('0x3a')][_0x09b6('0x55')]({'where':{'id':_0x1930a4['params']['id']}})['then'](handleEntityNotFound(_0x12430d,null))[_0x09b6('0x20')](saveUpdates(_0x1930a4[_0x09b6('0x57')],null))[_0x09b6('0x20')](respondWithResult(_0x12430d,null))[_0x09b6('0x29')](handleError(_0x12430d,null));};exports['destroy']=function(_0x511985,_0x116c7c){return db[_0x09b6('0x3a')][_0x09b6('0x55')]({'where':{'id':_0x511985[_0x09b6('0x52')]['id']}})[_0x09b6('0x20')](handleEntityNotFound(_0x116c7c,null))[_0x09b6('0x20')](removeEntity(_0x116c7c,null))[_0x09b6('0x29')](handleError(_0x116c7c,null));};exports['describe']=function(_0x5642da,_0x4c68f6){return db[_0x09b6('0x3a')][_0x09b6('0x58')]()['then'](respondWithResult(_0x4c68f6,null))[_0x09b6('0x29')](handleError(_0x4c68f6,null));};var interaction_log=require(_0x09b6('0x13'))('fax-interactions');exports['accept']=function(_0x1ab81e,_0xdf4f9b,_0x5d899f){var _0x3f4c73={'agent':{},'channel':_0x09b6('0x59')};if(_0x1ab81e['body']['id']){delete _0x1ab81e[_0x09b6('0x57')]['id'];}_0x1ab81e[_0x09b6('0x57')][_0x09b6('0x5a')]=!![];_0x1ab81e[_0x09b6('0x57')][_0x09b6('0x5b')]=moment()[_0x09b6('0x5c')](_0x09b6('0x5d'));_0x1ab81e[_0x09b6('0x57')][_0x09b6('0x5e')]=_0x1ab81e[_0x09b6('0x57')]['UserId']||_0x1ab81e['user']['id'];_0x3f4c73[_0x09b6('0x5f')]['id']=_0x1ab81e['body'][_0x09b6('0x5e')];return db[_0x09b6('0x3a')][_0x09b6('0x55')]({'where':{'id':_0x1ab81e[_0x09b6('0x52')]['id'],'UserId':null}})[_0x09b6('0x20')](handleEntityNotFound(_0xdf4f9b,null))[_0x09b6('0x20')](saveUpdates(_0x1ab81e[_0x09b6('0x57')],null))[_0x09b6('0x20')](function(_0x2af122){if(_0x2af122){_0x3f4c73[_0x09b6('0x27')]=_0x2af122[_0x09b6('0x60')]({'plain':!![]});return db[_0x09b6('0x61')][_0x09b6('0x55')]({'where':{'id':_0x2af122[_0x09b6('0x62')]}});}return null;})[_0x09b6('0x20')](handleEntityNotFound(_0xdf4f9b,null))[_0x09b6('0x20')](function(_0x276bcd){if(_0x276bcd){return _0x276bcd[_0x09b6('0x56')]({'UserId':_0x1ab81e[_0x09b6('0x57')][_0x09b6('0x5e')],'read1stAt':_[_0x09b6('0x63')](_0x276bcd[_0x09b6('0x64')])?moment()[_0x09b6('0x5c')](_0x09b6('0x5d')):undefined});}return null;})[_0x09b6('0x20')](function(_0x197e57){if(_0x197e57){_0x3f4c73[_0x09b6('0x65')]=_0x197e57[_0x09b6('0x60')]({'plain':!![]});interaction_log[_0x09b6('0x21')](_0x09b6('0x66'),_0x1ab81e['user']['id'],_0x1ab81e[_0x09b6('0x67')][_0x09b6('0x40')],_0x1ab81e[_0x09b6('0x67')][_0x09b6('0x68')],_0x3f4c73[_0x09b6('0x65')]['id'],_0x1ab81e[_0x09b6('0x57')]?JSON['stringify'](_0x1ab81e[_0x09b6('0x57')]):'null');return respondWithRpcPromise(_0x09b6('0x69'),_0x09b6('0x6a'),_0x3f4c73);}return null;})[_0x09b6('0x20')](function(_0x26938e){var _0x48b374='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x26938e[_0x09b6('0x27')]['ContactId'];return db[_0x09b6('0x6b')]['query'](_0x48b374,{'type':db[_0x09b6('0x6c')][_0x09b6('0x6d')][_0x09b6('0x6e')],'raw':!![]})[_0x09b6('0x20')](function(_0x2e5405){return _0x2e5405;});})['then'](function(_0x28be85){if(_0x28be85){_0x3f4c73['message'][_0x09b6('0x6f')]=_0x28be85[0x0];if(!_0x1ab81e['body'][_0x09b6('0x5e')])return;return db[_0x09b6('0x70')][_0x09b6('0x55')]({'where':{'id':_0x1ab81e['body'][_0x09b6('0x5e')],'role':_0x09b6('0x5f')},'attributes':['id','name',_0x09b6('0x71'),_0x09b6('0x72'),_0x09b6('0x73')],'raw':!![]});}return null;})[_0x09b6('0x20')](function(_0x228ad6){if(!_0x228ad6)return null;_0x3f4c73[_0x09b6('0x27')][_0x09b6('0x5f')]=_0x228ad6;return _0x3f4c73;})[_0x09b6('0x20')](function(_0xedf000){if(_0xedf000){if(_0x1ab81e[_0x09b6('0x57')]['manual']){_0x3f4c73['message']['interface']=util[_0x09b6('0x5c')](_0x09b6('0x74'),_0x1ab81e['user'][_0x09b6('0x40')]);_0x3f4c73[_0x09b6('0x27')][_0x09b6('0x75')]=_0x3f4c73[_0x09b6('0x75')];_0x3f4c73[_0x09b6('0x27')][_0x09b6('0x76')]=_0x3f4c73['channel'];_0x3f4c73[_0x09b6('0x27')][_0x09b6('0x77')]='accept';return respondWithRpcPromise('EventManager',_0x09b6('0x78'),{'event':'acceptmessage','message':_0x3f4c73[_0x09b6('0x27')]},client9002)[_0x09b6('0x20')](function(){return _0x3f4c73;});}return _0x3f4c73;}return null;})[_0x09b6('0x20')](respondWithResult(_0xdf4f9b,null))[_0x09b6('0x29')](handleError(_0xdf4f9b,null));};var interaction_log=require(_0x09b6('0x13'))(_0x09b6('0x79'));exports[_0x09b6('0x34')]=function(_0x247b40,_0x1e3a44,_0x43b290){var _0x41e7fa={'agent':{},'channel':'fax'};if(_0x247b40['body']['id']){delete _0x247b40[_0x09b6('0x57')]['id'];}_0x247b40[_0x09b6('0x57')][_0x09b6('0x5e')]=_0x247b40[_0x09b6('0x57')][_0x09b6('0x5e')]||_0x247b40[_0x09b6('0x67')]['id'];_0x41e7fa[_0x09b6('0x5f')]['id']=_0x247b40[_0x09b6('0x57')]['UserId'];return db[_0x09b6('0x3a')][_0x09b6('0x55')]({'where':{'id':_0x247b40['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1e3a44,null))['then'](function(_0x2805e6){if(_0x2805e6){_0x41e7fa[_0x09b6('0x27')]=_0x2805e6[_0x09b6('0x60')]({'plain':!![]});return db[_0x09b6('0x61')][_0x09b6('0x55')]({'where':{'id':_0x2805e6[_0x09b6('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x1e3a44,null))['then'](function(_0x150d77){if(_0x150d77){_0x41e7fa[_0x09b6('0x65')]=_0x150d77[_0x09b6('0x60')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x247b40[_0x09b6('0x67')]['id'],_0x247b40['user']['name'],_0x247b40['user']['role'],_0x41e7fa[_0x09b6('0x65')]['id'],_0x247b40[_0x09b6('0x57')]?JSON[_0x09b6('0x7a')](_0x247b40[_0x09b6('0x57')]):_0x09b6('0x7b'));return respondWithRpcPromise('RejectMessage',_0x09b6('0x7c'),_0x41e7fa);}return null;})[_0x09b6('0x20')](function(_0x2412e6){var _0x3e1ac9=_0x09b6('0x7d')+_0x2412e6[_0x09b6('0x27')][_0x09b6('0x7e')];return db['sequelize'][_0x09b6('0x41')](_0x3e1ac9,{'type':db[_0x09b6('0x6c')][_0x09b6('0x6d')][_0x09b6('0x6e')],'raw':!![]})[_0x09b6('0x20')](function(_0x551467){return _0x551467;});})[_0x09b6('0x20')](function(_0x4a8934){if(_0x4a8934){_0x41e7fa[_0x09b6('0x27')][_0x09b6('0x6f')]=_0x4a8934[0x0];if(!_0x247b40[_0x09b6('0x57')][_0x09b6('0x5e')])return;return db['User'][_0x09b6('0x55')]({'where':{'id':_0x247b40[_0x09b6('0x57')][_0x09b6('0x5e')],'role':_0x09b6('0x5f')},'attributes':['id',_0x09b6('0x40'),_0x09b6('0x71'),_0x09b6('0x72'),_0x09b6('0x73')],'raw':!![]});}return null;})[_0x09b6('0x20')](function(_0x8ea078){if(!_0x8ea078)return null;_0x41e7fa[_0x09b6('0x27')][_0x09b6('0x5f')]=_0x8ea078;return _0x41e7fa;})[_0x09b6('0x20')](function(_0x375147){if(_0x375147){_0x375147[_0x09b6('0x27')][_0x09b6('0x7f')]=util[_0x09b6('0x5c')]('SIP/%s',_0x247b40['user'][_0x09b6('0x40')]);_0x375147[_0x09b6('0x27')][_0x09b6('0x75')]=_0x41e7fa[_0x09b6('0x75')];_0x375147[_0x09b6('0x27')][_0x09b6('0x76')]=_0x41e7fa[_0x09b6('0x75')];_0x375147[_0x09b6('0x27')][_0x09b6('0x77')]=_0x09b6('0x34');respondWithRpcPromise(_0x09b6('0x78'),_0x09b6('0x78'),{'event':_0x09b6('0x80'),'message':_0x375147['message']},client9002);return _0x41e7fa;}return null;})[_0x09b6('0x20')](respondWithResult(_0x1e3a44,null))['catch'](handleError(_0x1e3a44,null));};exports['create']=function(_0x3bb3b1,_0x569fa0){var _0x232c7f;return db[_0x09b6('0x3a')][_0x09b6('0x81')](_0x3bb3b1[_0x09b6('0x57')],{})[_0x09b6('0x20')](function(_0x2c29b8){_0x232c7f=_0x2c29b8;return db[_0x09b6('0x82')][_0x09b6('0x83')]({'where':{'id':_0x232c7f[_0x09b6('0x7e')]}});})['then'](function(_0x550955){if(_[_0x09b6('0x63')](_0x550955)){return;}else{_0x232c7f[_0x09b6('0x59')]=_0x550955[_0x09b6('0x59')];return db[_0x09b6('0x84')][_0x09b6('0x83')]({'where':{'id':_0x232c7f[_0x09b6('0x85')]}});}})['then'](function(_0x26fe29){return respondWithRpcPromise(_0x09b6('0x86'),_0x09b6('0x86'),{'FaxAccountId':_[_0x09b6('0x63')](_0x3bb3b1[_0x09b6('0x57')])?undefined:_0x3bb3b1[_0x09b6('0x57')][_0x09b6('0x87')],'path':_['isNil'](_0x26fe29)?undefined:util[_0x09b6('0x5c')]('/var/opt/motion2/server/files/attachments/%s',_0x26fe29[_0x09b6('0x88')]),'fax':_[_0x09b6('0x63')](_0x232c7f[_0x09b6('0x59')])?undefined:_0x232c7f[_0x09b6('0x59')],'AttachmentId':_0x232c7f[_0x09b6('0x85')]},client9002);})[_0x09b6('0x20')](respondWithResult(_0x569fa0,0xc9))['catch'](handleError(_0x569fa0,null));};exports['download']=function(_0x5534d3,_0x10c4ed){var _0x29b92d=path[_0x09b6('0x89')](config[_0x09b6('0x8a')],_0x09b6('0x8b'),_0x09b6('0x8c'),_0x09b6('0x8d'));return db['FaxMessage'][_0x09b6('0x55')]({'where':{'id':_0x5534d3[_0x09b6('0x52')]['id']},'include':[{'model':db[_0x09b6('0x84')],'as':_0x09b6('0x84')}]})[_0x09b6('0x20')](handleEntityNotFound(_0x10c4ed,null))[_0x09b6('0x20')](function(_0x171fcb){if(_0x171fcb){return _0x10c4ed[_0x09b6('0x8e')](path['join'](_0x29b92d,_0x171fcb[_0x09b6('0x84')][_0x09b6('0x88')]));}})[_0x09b6('0x29')](handleError(_0x10c4ed,null));}; \ No newline at end of file +var _0xfb1e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','stack','name','send','map','FaxMessage','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','params','update','body','find','destroy','describe','fax-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE: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','SELECT','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','fax','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','contact','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','eml-format','rimraf'];(function(_0x30781e,_0x48457f){var _0x22da8c=function(_0x80a5c7){while(--_0x80a5c7){_0x30781e['push'](_0x30781e['shift']());}};_0x22da8c(++_0x48457f);}(_0xfb1e,0x124));var _0xefb1=function(_0x44c995,_0x1c2add){_0x44c995=_0x44c995-0x0;var _0xa18619=_0xfb1e[_0x44c995];return _0xa18619;};'use strict';var emlformat=require(_0xefb1('0x0'));var rimraf=require(_0xefb1('0x1'));var zipdir=require(_0xefb1('0x2'));var jsonpatch=require(_0xefb1('0x3'));var rp=require(_0xefb1('0x4'));var moment=require(_0xefb1('0x5'));var BPromise=require(_0xefb1('0x6'));var Mustache=require('mustache');var util=require(_0xefb1('0x7'));var path=require(_0xefb1('0x8'));var sox=require(_0xefb1('0x9'));var csv=require(_0xefb1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xefb1('0xb'));var _=require(_0xefb1('0xc'));var squel=require(_0xefb1('0xd'));var crypto=require(_0xefb1('0xe'));var jsforce=require(_0xefb1('0xf'));var deskjs=require(_0xefb1('0x10'));var toCsv=require(_0xefb1('0xa'));var querystring=require(_0xefb1('0x11'));var Papa=require(_0xefb1('0x12'));var Redis=require(_0xefb1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xefb1('0x14'));var as=require(_0xefb1('0x15'));var hardwareService=require(_0xefb1('0x16'));var logger=require(_0xefb1('0x17'))(_0xefb1('0x18'));var utils=require(_0xefb1('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xefb1('0x1a'));var db=require(_0xefb1('0x1b'))['db'];config[_0xefb1('0x1c')]=_[_0xefb1('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xefb1('0x1e'))(new Redis(config[_0xefb1('0x1c')]));require(_0xefb1('0x1f'))[_0xefb1('0x20')](socket);var jayson=require(_0xefb1('0x21'));var client=jayson[_0xefb1('0x22')][_0xefb1('0x23')]({'port':0x232c});var client9002=jayson['client'][_0xefb1('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x3fa724,_0x549b1a,_0x79c3b,_0x2547be){return new BPromise(function(_0x3abe76,_0x50c2db){var _0x5009dd=_0x2547be||client;return _0x5009dd[_0xefb1('0x24')](_0x3fa724,_0x79c3b)['then'](function(_0x22c724){logger['info'](_0xefb1('0x25'),_0x549b1a,_0xefb1('0x26'));logger['debug'](_0xefb1('0x27'),_0x549b1a,_0xefb1('0x26'),JSON[_0xefb1('0x28')](_0x22c724));if(_0x22c724[_0xefb1('0x29')]){if(_0x22c724['error'][_0xefb1('0x2a')]===0x1f4){logger[_0xefb1('0x29')](_0xefb1('0x25'),_0x549b1a,_0x22c724[_0xefb1('0x29')][_0xefb1('0x2b')]);return _0x50c2db(_0x22c724['error'][_0xefb1('0x2b')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x549b1a,_0x22c724['error'][_0xefb1('0x2b')]);return _0x3abe76(_0x22c724[_0xefb1('0x29')][_0xefb1('0x2b')]);}else{logger['info'](_0xefb1('0x25'),_0x549b1a,_0xefb1('0x26'));_0x3abe76(_0x22c724[_0xefb1('0x2c')][_0xefb1('0x2b')]);}})[_0xefb1('0x2d')](function(_0x2bf228){logger[_0xefb1('0x29')]('FaxMessage,\x20%s,\x20%s',_0x549b1a,_0x2bf228);_0x50c2db(_0x2bf228);});});}function respondWithStatusCode(_0x5c3584,_0x2b9d70){_0x2b9d70=_0x2b9d70||0xcc;return function(_0x291af1){if(_0x291af1){return _0x5c3584[_0xefb1('0x2e')](_0x2b9d70);}return _0x5c3584[_0xefb1('0x2f')](_0x2b9d70)[_0xefb1('0x30')]();};}function respondWithResult(_0x2266bb,_0x2fea28){_0x2fea28=_0x2fea28||0xc8;return function(_0x2fb199){if(_0x2fb199){return _0x2266bb[_0xefb1('0x2f')](_0x2fea28)[_0xefb1('0x31')](_0x2fb199);}};}function respondWithFilteredResult(_0x11b61c,_0xc60683){return function(_0x560c7a){if(_0x560c7a){var _0x46a80b=typeof _0xc60683[_0xefb1('0x32')]==='undefined'&&typeof _0xc60683[_0xefb1('0x33')]===_0xefb1('0x34');var _0x52cff1=_0x560c7a[_0xefb1('0x35')];var _0x5bafd4=_0x46a80b?0x0:_0xc60683[_0xefb1('0x32')];var _0x2099ff=_0x46a80b?_0x560c7a['count']:_0xc60683[_0xefb1('0x32')]+_0xc60683[_0xefb1('0x33')];var _0x215019;if(_0x2099ff>=_0x52cff1){_0x2099ff=_0x52cff1;_0x215019=0xc8;}else{_0x215019=0xce;}_0x11b61c[_0xefb1('0x2f')](_0x215019);return _0x11b61c[_0xefb1('0x36')](_0xefb1('0x37'),_0x5bafd4+'-'+_0x2099ff+'/'+_0x52cff1)['json'](_0x560c7a);}return null;};}function patchUpdates(_0x4fe6cf){return function(_0x55139d){try{jsonpatch[_0xefb1('0x38')](_0x55139d,_0x4fe6cf,!![]);}catch(_0x250c37){return BPromise[_0xefb1('0x39')](_0x250c37);}return _0x55139d[_0xefb1('0x3a')]();};}function saveUpdates(_0x6b0fc2,_0x101cbd){return function(_0x1c6170){if(_0x1c6170){return _0x1c6170['update'](_0x6b0fc2)[_0xefb1('0x3b')](function(_0xad6ea3){return _0xad6ea3;});}return null;};}function removeEntity(_0x2ace7d,_0x55dadd){return function(_0x1cbb35){if(_0x1cbb35){return _0x1cbb35['destroy']()[_0xefb1('0x3b')](function(){_0x2ace7d['status'](0xcc)[_0xefb1('0x30')]();});}};}function handleEntityNotFound(_0x1ae00f,_0x1447ce){return function(_0x3ebc60){if(!_0x3ebc60){_0x1ae00f['sendStatus'](0x194);}return _0x3ebc60;};}function handleError(_0x8cf1a4,_0x1ce768){_0x1ce768=_0x1ce768||0x1f4;return function(_0xb14707){logger[_0xefb1('0x29')](_0xb14707[_0xefb1('0x3c')]);if(_0xb14707[_0xefb1('0x3d')]){delete _0xb14707[_0xefb1('0x3d')];}_0x8cf1a4[_0xefb1('0x2f')](_0x1ce768)[_0xefb1('0x3e')](_0xb14707);};}exports['index']=function(_0x4e67e1,_0x3d97dd){var _0x40b2aa={},_0x2c1c89={},_0x5f4d81={'count':0x0,'rows':[]};var _0x2e261a=_[_0xefb1('0x3f')](db[_0xefb1('0x40')][_0xefb1('0x41')],function(_0x35f0bf){return{'name':_0x35f0bf['fieldName'],'type':_0x35f0bf[_0xefb1('0x42')]['key']};});_0x2c1c89[_0xefb1('0x43')]=_[_0xefb1('0x3f')](_0x2e261a,'name');_0x2c1c89[_0xefb1('0x44')]=_[_0xefb1('0x45')](_0x4e67e1[_0xefb1('0x44')]);_0x2c1c89[_0xefb1('0x46')]=_['intersection'](_0x2c1c89['model'],_0x2c1c89['query']);_0x40b2aa[_0xefb1('0x47')]=_[_0xefb1('0x48')](_0x2c1c89[_0xefb1('0x43')],qs[_0xefb1('0x49')](_0x4e67e1[_0xefb1('0x44')]['fields']));_0x40b2aa[_0xefb1('0x47')]=_0x40b2aa['attributes'][_0xefb1('0x4a')]?_0x40b2aa[_0xefb1('0x47')]:_0x2c1c89[_0xefb1('0x43')];if(!_0x4e67e1[_0xefb1('0x44')][_0xefb1('0x4b')](_0xefb1('0x4c'))){_0x40b2aa[_0xefb1('0x33')]=qs['limit'](_0x4e67e1['query'][_0xefb1('0x33')]);_0x40b2aa[_0xefb1('0x32')]=qs[_0xefb1('0x32')](_0x4e67e1['query']['offset']);}_0x40b2aa[_0xefb1('0x4d')]=qs['sort'](_0x4e67e1[_0xefb1('0x44')][_0xefb1('0x4e')]);_0x40b2aa['where']=qs['filters'](_[_0xefb1('0x4f')](_0x4e67e1['query'],_0x2c1c89['filters']),_0x2e261a);if(_0x4e67e1[_0xefb1('0x44')][_0xefb1('0x50')]){_0x40b2aa[_0xefb1('0x51')]=_[_0xefb1('0x52')](_0x40b2aa[_0xefb1('0x51')],{'$or':_[_0xefb1('0x3f')](_0x2e261a,function(_0x3f92cd){if(_0x3f92cd[_0xefb1('0x42')]!==_0xefb1('0x53')){var _0x206b9f={};_0x206b9f[_0x3f92cd[_0xefb1('0x3d')]]={'$like':'%'+_0x4e67e1[_0xefb1('0x44')][_0xefb1('0x50')]+'%'};return _0x206b9f;}})});}_0x40b2aa=_[_0xefb1('0x52')]({},_0x40b2aa,_0x4e67e1[_0xefb1('0x54')]);var _0x1cf686={'where':_0x40b2aa['where']};return db['FaxMessage']['count'](_0x1cf686)[_0xefb1('0x3b')](function(_0x199387){_0x5f4d81[_0xefb1('0x35')]=_0x199387;if(_0x4e67e1['query'][_0xefb1('0x55')]){_0x40b2aa[_0xefb1('0x56')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x40b2aa);})[_0xefb1('0x3b')](function(_0x48431b){_0x5f4d81['rows']=_0x48431b;return _0x5f4d81;})['then'](respondWithFilteredResult(_0x3d97dd,_0x40b2aa))[_0xefb1('0x2d')](handleError(_0x3d97dd,null));};exports['show']=function(_0x210ff3,_0x2aae2c){var _0x5b143f={'raw':!![],'where':{'id':_0x210ff3[_0xefb1('0x57')]['id']}},_0xdf58e9={};_0xdf58e9[_0xefb1('0x43')]=_[_0xefb1('0x45')](db[_0xefb1('0x40')][_0xefb1('0x41')]);_0xdf58e9[_0xefb1('0x44')]=_[_0xefb1('0x45')](_0x210ff3[_0xefb1('0x44')]);_0xdf58e9[_0xefb1('0x46')]=_[_0xefb1('0x48')](_0xdf58e9['model'],_0xdf58e9[_0xefb1('0x44')]);_0x5b143f[_0xefb1('0x47')]=_[_0xefb1('0x48')](_0xdf58e9['model'],qs[_0xefb1('0x49')](_0x210ff3[_0xefb1('0x44')]['fields']));_0x5b143f[_0xefb1('0x47')]=_0x5b143f[_0xefb1('0x47')][_0xefb1('0x4a')]?_0x5b143f[_0xefb1('0x47')]:_0xdf58e9[_0xefb1('0x43')];if(_0x210ff3['query'][_0xefb1('0x55')]){_0x5b143f[_0xefb1('0x56')]=[{'all':!![]}];}_0x5b143f=_['merge']({},_0x5b143f,_0x210ff3[_0xefb1('0x54')]);return db[_0xefb1('0x40')]['find'](_0x5b143f)[_0xefb1('0x3b')](handleEntityNotFound(_0x2aae2c,null))[_0xefb1('0x3b')](respondWithResult(_0x2aae2c,null))[_0xefb1('0x2d')](handleError(_0x2aae2c,null));};exports[_0xefb1('0x58')]=function(_0x4911fd,_0x5a00db){if(_0x4911fd[_0xefb1('0x59')]['id']){delete _0x4911fd[_0xefb1('0x59')]['id'];}return db[_0xefb1('0x40')][_0xefb1('0x5a')]({'where':{'id':_0x4911fd[_0xefb1('0x57')]['id']}})[_0xefb1('0x3b')](handleEntityNotFound(_0x5a00db,null))['then'](saveUpdates(_0x4911fd[_0xefb1('0x59')],null))['then'](respondWithResult(_0x5a00db,null))[_0xefb1('0x2d')](handleError(_0x5a00db,null));};exports[_0xefb1('0x5b')]=function(_0x575b9e,_0x3e4f71){return db['FaxMessage'][_0xefb1('0x5a')]({'where':{'id':_0x575b9e[_0xefb1('0x57')]['id']}})['then'](handleEntityNotFound(_0x3e4f71,null))[_0xefb1('0x3b')](removeEntity(_0x3e4f71,null))[_0xefb1('0x2d')](handleError(_0x3e4f71,null));};exports[_0xefb1('0x5c')]=function(_0x330f93,_0x11be71){return db[_0xefb1('0x40')][_0xefb1('0x5c')]()[_0xefb1('0x3b')](respondWithResult(_0x11be71,null))[_0xefb1('0x2d')](handleError(_0x11be71,null));};var interaction_log=require(_0xefb1('0x17'))(_0xefb1('0x5d'));exports['accept']=function(_0x2c93fb,_0x5a3ed9,_0x5cf7de){var _0x46d9bf={'agent':{},'channel':'fax'};if(_0x2c93fb[_0xefb1('0x59')]['id']){delete _0x2c93fb[_0xefb1('0x59')]['id'];}_0x2c93fb['body'][_0xefb1('0x5e')]=!![];_0x2c93fb[_0xefb1('0x59')][_0xefb1('0x5f')]=moment()[_0xefb1('0x60')](_0xefb1('0x61'));_0x2c93fb[_0xefb1('0x59')][_0xefb1('0x62')]=_0x2c93fb[_0xefb1('0x59')]['UserId']||_0x2c93fb[_0xefb1('0x63')]['id'];_0x46d9bf['agent']['id']=_0x2c93fb[_0xefb1('0x59')][_0xefb1('0x62')];return db[_0xefb1('0x40')][_0xefb1('0x5a')]({'where':{'id':_0x2c93fb[_0xefb1('0x57')]['id'],'UserId':null}})[_0xefb1('0x3b')](handleEntityNotFound(_0x5a3ed9,null))['then'](saveUpdates(_0x2c93fb[_0xefb1('0x59')],null))['then'](function(_0x424f01){if(_0x424f01){_0x46d9bf[_0xefb1('0x2b')]=_0x424f01[_0xefb1('0x64')]({'plain':!![]});return db['FaxInteraction'][_0xefb1('0x5a')]({'where':{'id':_0x424f01[_0xefb1('0x65')]}});}return null;})[_0xefb1('0x3b')](handleEntityNotFound(_0x5a3ed9,null))['then'](function(_0x293ebb){if(_0x293ebb){return _0x293ebb[_0xefb1('0x58')]({'UserId':_0x2c93fb[_0xefb1('0x59')][_0xefb1('0x62')],'read1stAt':_[_0xefb1('0x66')](_0x293ebb[_0xefb1('0x67')])?moment()[_0xefb1('0x60')](_0xefb1('0x61')):undefined});}return null;})['then'](function(_0x3ebbf1){if(_0x3ebbf1){_0x46d9bf[_0xefb1('0x68')]=_0x3ebbf1[_0xefb1('0x64')]({'plain':!![]});interaction_log['info'](_0xefb1('0x69'),_0x2c93fb[_0xefb1('0x63')]['id'],_0x2c93fb[_0xefb1('0x63')]['name'],_0x2c93fb[_0xefb1('0x63')][_0xefb1('0x6a')],_0x46d9bf[_0xefb1('0x68')]['id'],_0x2c93fb[_0xefb1('0x59')]?JSON[_0xefb1('0x28')](_0x2c93fb[_0xefb1('0x59')]):_0xefb1('0x6b'));return respondWithRpcPromise(_0xefb1('0x6c'),_0xefb1('0x6d'),_0x46d9bf);}return null;})['then'](function(_0xebade3){var _0x12ec31=_0xefb1('0x6e')+_0xebade3[_0xefb1('0x2b')][_0xefb1('0x6f')];return db[_0xefb1('0x70')][_0xefb1('0x44')](_0x12ec31,{'type':db['Sequelize'][_0xefb1('0x71')][_0xefb1('0x72')],'raw':!![]})[_0xefb1('0x3b')](function(_0x5e86cd){return _0x5e86cd;});})[_0xefb1('0x3b')](function(_0x355da7){if(_0x355da7){_0x46d9bf['message']['contact']=_0x355da7[0x0];if(!_0x2c93fb[_0xefb1('0x59')][_0xefb1('0x62')])return;return db['User'][_0xefb1('0x5a')]({'where':{'id':_0x2c93fb[_0xefb1('0x59')][_0xefb1('0x62')],'role':_0xefb1('0x73')},'attributes':['id','name',_0xefb1('0x74'),_0xefb1('0x75'),_0xefb1('0x76')],'raw':!![]});}return null;})[_0xefb1('0x3b')](function(_0x5482a2){if(!_0x5482a2)return null;_0x46d9bf['message'][_0xefb1('0x73')]=_0x5482a2;return _0x46d9bf;})['then'](function(_0x1b3223){if(_0x1b3223){if(_0x2c93fb[_0xefb1('0x59')][_0xefb1('0x77')]){_0x46d9bf['message'][_0xefb1('0x78')]=util[_0xefb1('0x60')](_0xefb1('0x79'),_0x2c93fb['user'][_0xefb1('0x3d')]);_0x46d9bf[_0xefb1('0x2b')][_0xefb1('0x7a')]=_0x46d9bf[_0xefb1('0x7a')];_0x46d9bf['message'][_0xefb1('0x7b')]=_0x46d9bf['channel'];_0x46d9bf[_0xefb1('0x2b')][_0xefb1('0x7c')]=_0xefb1('0x7d');return respondWithRpcPromise('EventManager',_0xefb1('0x7e'),{'event':_0xefb1('0x7f'),'message':_0x46d9bf['message']},client9002)[_0xefb1('0x3b')](function(){return _0x46d9bf;});}return _0x46d9bf;}return null;})['then'](respondWithResult(_0x5a3ed9,null))[_0xefb1('0x2d')](handleError(_0x5a3ed9,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xefb1('0x39')]=function(_0x17b2c9,_0x9c8b6e,_0x27ef97){var _0x70a79a={'agent':{},'channel':_0xefb1('0x80')};if(_0x17b2c9[_0xefb1('0x59')]['id']){delete _0x17b2c9['body']['id'];}_0x17b2c9[_0xefb1('0x59')][_0xefb1('0x62')]=_0x17b2c9[_0xefb1('0x59')]['UserId']||_0x17b2c9['user']['id'];_0x70a79a['agent']['id']=_0x17b2c9[_0xefb1('0x59')][_0xefb1('0x62')];return db[_0xefb1('0x40')][_0xefb1('0x5a')]({'where':{'id':_0x17b2c9[_0xefb1('0x57')]['id'],'UserId':null}})[_0xefb1('0x3b')](handleEntityNotFound(_0x9c8b6e,null))['then'](function(_0xd3be3f){if(_0xd3be3f){_0x70a79a[_0xefb1('0x2b')]=_0xd3be3f[_0xefb1('0x64')]({'plain':!![]});return db[_0xefb1('0x81')][_0xefb1('0x5a')]({'where':{'id':_0xd3be3f['FaxInteractionId']}});}return null;})[_0xefb1('0x3b')](handleEntityNotFound(_0x9c8b6e,null))[_0xefb1('0x3b')](function(_0x31d84b){if(_0x31d84b){_0x70a79a[_0xefb1('0x68')]=_0x31d84b[_0xefb1('0x64')]({'plain':!![]});interaction_log['info'](_0xefb1('0x82'),_0x17b2c9[_0xefb1('0x63')]['id'],_0x17b2c9[_0xefb1('0x63')][_0xefb1('0x3d')],_0x17b2c9[_0xefb1('0x63')]['role'],_0x70a79a[_0xefb1('0x68')]['id'],_0x17b2c9[_0xefb1('0x59')]?JSON[_0xefb1('0x28')](_0x17b2c9[_0xefb1('0x59')]):_0xefb1('0x6b'));return respondWithRpcPromise(_0xefb1('0x83'),'rejectMessage',_0x70a79a);}return null;})[_0xefb1('0x3b')](function(_0x42c131){var _0x414e59='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x42c131[_0xefb1('0x2b')][_0xefb1('0x6f')];return db[_0xefb1('0x70')][_0xefb1('0x44')](_0x414e59,{'type':db['Sequelize'][_0xefb1('0x71')][_0xefb1('0x72')],'raw':!![]})[_0xefb1('0x3b')](function(_0x24ad5a){return _0x24ad5a;});})[_0xefb1('0x3b')](function(_0x204759){if(_0x204759){_0x70a79a['message'][_0xefb1('0x84')]=_0x204759[0x0];if(!_0x17b2c9['body'][_0xefb1('0x62')])return;return db['User']['find']({'where':{'id':_0x17b2c9[_0xefb1('0x59')]['UserId'],'role':_0xefb1('0x73')},'attributes':['id',_0xefb1('0x3d'),'fullname',_0xefb1('0x75'),_0xefb1('0x76')],'raw':!![]});}return null;})['then'](function(_0x1de158){if(!_0x1de158)return null;_0x70a79a[_0xefb1('0x2b')][_0xefb1('0x73')]=_0x1de158;return _0x70a79a;})[_0xefb1('0x3b')](function(_0x29439b){if(_0x29439b){_0x29439b[_0xefb1('0x2b')]['interface']=util[_0xefb1('0x60')]('SIP/%s',_0x17b2c9['user'][_0xefb1('0x3d')]);_0x29439b['message'][_0xefb1('0x7a')]=_0x70a79a[_0xefb1('0x7a')];_0x29439b[_0xefb1('0x2b')][_0xefb1('0x7b')]=_0x70a79a[_0xefb1('0x7a')];_0x29439b[_0xefb1('0x2b')][_0xefb1('0x7c')]=_0xefb1('0x39');respondWithRpcPromise(_0xefb1('0x7e'),_0xefb1('0x7e'),{'event':'rejectmessage','message':_0x29439b[_0xefb1('0x2b')]},client9002);return _0x70a79a;}return null;})['then'](respondWithResult(_0x9c8b6e,null))[_0xefb1('0x2d')](handleError(_0x9c8b6e,null));};exports['create']=function(_0x503d5a,_0x4021c0){var _0x2a985b;return db[_0xefb1('0x40')][_0xefb1('0x85')](_0x503d5a[_0xefb1('0x59')],{})['then'](function(_0x4ce7cc){_0x2a985b=_0x4ce7cc;return db[_0xefb1('0x86')][_0xefb1('0x87')]({'where':{'id':_0x2a985b[_0xefb1('0x6f')]}});})['then'](function(_0x1e6c66){if(_[_0xefb1('0x66')](_0x1e6c66)){return;}else{_0x2a985b[_0xefb1('0x80')]=_0x1e6c66[_0xefb1('0x80')];return db[_0xefb1('0x88')][_0xefb1('0x87')]({'where':{'id':_0x2a985b[_0xefb1('0x89')]}});}})['then'](function(_0x4baea4){return respondWithRpcPromise(_0xefb1('0x8a'),_0xefb1('0x8a'),{'FaxAccountId':_['isNil'](_0x503d5a['body'])?undefined:_0x503d5a[_0xefb1('0x59')][_0xefb1('0x8b')],'path':_[_0xefb1('0x66')](_0x4baea4)?undefined:util[_0xefb1('0x60')](_0xefb1('0x8c'),_0x4baea4[_0xefb1('0x8d')]),'fax':_[_0xefb1('0x66')](_0x2a985b[_0xefb1('0x80')])?undefined:_0x2a985b[_0xefb1('0x80')],'AttachmentId':_0x2a985b[_0xefb1('0x89')]},client9002);})[_0xefb1('0x3b')](respondWithResult(_0x4021c0,0xc9))[_0xefb1('0x2d')](handleError(_0x4021c0,null));};exports[_0xefb1('0x8e')]=function(_0x4d8280,_0x47287a){var _0xc48a0b=path[_0xefb1('0x8f')](config[_0xefb1('0x90')],_0xefb1('0x91'),_0xefb1('0x92'),'attachments');return db[_0xefb1('0x40')][_0xefb1('0x5a')]({'where':{'id':_0x4d8280['params']['id']},'include':[{'model':db[_0xefb1('0x88')],'as':'Attachment'}]})[_0xefb1('0x3b')](handleEntityNotFound(_0x47287a,null))[_0xefb1('0x3b')](function(_0x3322f3){if(_0x3322f3){return _0x47287a[_0xefb1('0x8e')](path[_0xefb1('0x8f')](_0xc48a0b,_0x3322f3['Attachment'][_0xefb1('0x8d')]));}})[_0xefb1('0x2d')](handleError(_0x47287a,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 8eb58df..29e90d0 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 _0xd8a5=['exports','events','FaxMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x3eca08,_0x11c502){var _0x1164c7=function(_0x3c9ef4){while(--_0x3c9ef4){_0x3eca08['push'](_0x3eca08['shift']());}};_0x1164c7(++_0x11c502);}(_0xd8a5,0x160));var _0x5d8a=function(_0x630ada,_0x299f07){_0x630ada=_0x630ada-0x0;var _0x17afff=_0xd8a5[_0x630ada];return _0x17afff;};'use strict';var EventEmitter=require(_0x5d8a('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x5d8a('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5d8a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5d8a('0x3'),'afterDestroy':_0x5d8a('0x4')};function emitEvent(_0x26e941){return function(_0x22863c,_0x821a16,_0x581cbc){FaxMessageEvents[_0x5d8a('0x5')](_0x26e941+':'+_0x22863c['id'],_0x22863c);FaxMessageEvents[_0x5d8a('0x5')](_0x26e941,_0x22863c);_0x581cbc(null);};}for(var e in events){if(events[_0x5d8a('0x6')](e)){var event=events[e];FaxMessage[_0x5d8a('0x7')](e,emitEvent(event));}}module[_0x5d8a('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x8ff3=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x387af5,_0x57853b){var _0x59b86e=function(_0x562d78){while(--_0x562d78){_0x387af5['push'](_0x387af5['shift']());}};_0x59b86e(++_0x57853b);}(_0x8ff3,0x72));var _0x38ff=function(_0x162b38,_0x543c5c){_0x162b38=_0x162b38-0x0;var _0x4d04a0=_0x8ff3[_0x162b38];return _0x4d04a0;};'use strict';var EventEmitter=require(_0x38ff('0x0'));var FaxMessage=require(_0x38ff('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x38ff('0x2')](0x0);var events={'afterCreate':_0x38ff('0x3'),'afterUpdate':_0x38ff('0x4'),'afterDestroy':_0x38ff('0x5')};function emitEvent(_0x33ac8d){return function(_0x5bf243,_0x5f377c,_0x35d87f){FaxMessageEvents['emit'](_0x33ac8d+':'+_0x5bf243['id'],_0x5bf243);FaxMessageEvents[_0x38ff('0x6')](_0x33ac8d,_0x5bf243);_0x35d87f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x38ff('0x7')](e,emitEvent(event));}}module[_0x38ff('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 bb7946d..019549e 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 _0x0ca1=['fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage'];(function(_0x2c5f39,_0x472a04){var _0x581642=function(_0x5e4a4e){while(--_0x5e4a4e){_0x2c5f39['push'](_0x2c5f39['shift']());}};_0x581642(++_0x472a04);}(_0x0ca1,0x12f));var _0x10ca=function(_0x5393c6,_0x404b24){_0x5393c6=_0x5393c6-0x0;var _0x578875=_0x0ca1[_0x5393c6];return _0x578875;};'use strict';var _=require('lodash');var util=require(_0x10ca('0x0'));var logger=require('../../config/logger')(_0x10ca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x10ca('0x2'));var fs=require('fs');var path=require(_0x10ca('0x3'));var rimraf=require(_0x10ca('0x4'));var config=require(_0x10ca('0x5'));var attributes=require(_0x10ca('0x6'));module[_0x10ca('0x7')]=function(_0x281580,_0x5020c4){return _0x281580['define'](_0x10ca('0x8'),attributes,{'tableName':_0x10ca('0x9'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x10ca('0xa')],'type':_0x10ca('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5cf3df,_0x8621c1,_0x2eead3){var _0x392d1d=_0x281580['models'];var _0x3025bb=_0x5cf3df[_0x10ca('0xc')]({'plain':!![]});if(_0x3025bb[_0x10ca('0xd')][_0x10ca('0xe')]()==='in'||_0x3025bb[_0x10ca('0xd')][_0x10ca('0xe')]()===_0x10ca('0xf')&&!_0x3025bb['secret']&&!_['isNil'](_0x3025bb[_0x10ca('0x10')])){_0x392d1d[_0x10ca('0x11')][_0x10ca('0x12')]({'where':{'id':_0x3025bb[_0x10ca('0x13')]}})[_0x10ca('0x14')](function(_0x3dddf9){if(_0x3dddf9){_0x3dddf9['update']({'lastMsgAt':_0x3025bb[_0x10ca('0x15')],'lastMsgDirection':_0x3025bb[_0x10ca('0xd')][_0x10ca('0xe')]()});}})[_0x10ca('0x16')](function(_0x4c2dec){console[_0x10ca('0x17')](_0x4c2dec);});}_0x2eead3();}},'charset':_0x10ca('0x18'),'collate':_0x10ca('0x19')});}; \ No newline at end of file +var _0x1d29=['FaxInteractionId','then','update','createdAt','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','FaxInteraction','findOne'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0x1d29,0x166));var _0x91d2=function(_0xb6c029,_0x289717){_0xb6c029=_0xb6c029-0x0;var _0x369954=_0x1d29[_0xb6c029];return _0x369954;};'use strict';var _=require(_0x91d2('0x0'));var util=require(_0x91d2('0x1'));var logger=require(_0x91d2('0x2'))(_0x91d2('0x3'));var moment=require(_0x91d2('0x4'));var BPromise=require(_0x91d2('0x5'));var rp=require(_0x91d2('0x6'));var fs=require('fs');var path=require(_0x91d2('0x7'));var rimraf=require(_0x91d2('0x8'));var config=require(_0x91d2('0x9'));var attributes=require(_0x91d2('0xa'));module[_0x91d2('0xb')]=function(_0x5c9900,_0x53b1e8){return _0x5c9900[_0x91d2('0xc')](_0x91d2('0xd'),attributes,{'tableName':_0x91d2('0xe'),'paranoid':![],'indexes':[{'name':_0x91d2('0xf'),'fields':[_0x91d2('0x10')],'type':_0x91d2('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a43da,_0x271d6d,_0x4c3211){var _0x4966d4=_0x5c9900[_0x91d2('0x12')];var _0x4424ec=_0x1a43da[_0x91d2('0x13')]({'plain':!![]});if(_0x4424ec[_0x91d2('0x14')][_0x91d2('0x15')]()==='in'||_0x4424ec[_0x91d2('0x14')][_0x91d2('0x15')]()==='out'&&!_0x4424ec[_0x91d2('0x16')]&&!_['isNil'](_0x4424ec[_0x91d2('0x17')])){_0x4966d4[_0x91d2('0x18')][_0x91d2('0x19')]({'where':{'id':_0x4424ec[_0x91d2('0x1a')]}})[_0x91d2('0x1b')](function(_0x4536bf){if(_0x4536bf){_0x4536bf[_0x91d2('0x1c')]({'lastMsgAt':_0x4424ec[_0x91d2('0x1d')],'lastMsgDirection':_0x4424ec[_0x91d2('0x14')][_0x91d2('0x15')]()});}})[_0x91d2('0x1e')](function(_0x53f403){console['error'](_0x53f403);});}_0x4c3211();}},'charset':_0x91d2('0x1f'),'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 5614458..2d66781 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 _0x425d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','body','options','raw','catch','UpdateFaxMessage','where','attributes','limit'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x425d,0x1e0));var _0xd425=function(_0x26bb41,_0x40ccd7){_0x26bb41=_0x26bb41-0x0;var _0x34d2fe=_0x425d[_0x26bb41];return _0x34d2fe;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var moment=require(_0xd425('0x1'));var BPromise=require(_0xd425('0x2'));var rs=require(_0xd425('0x3'));var fs=require('fs');var Redis=require(_0xd425('0x4'));var db=require(_0xd425('0x5'))['db'];var utils=require(_0xd425('0x6'));var logger=require(_0xd425('0x7'))('rpc');var config=require(_0xd425('0x8'));var jayson=require(_0xd425('0x9'));var client=jayson[_0xd425('0xa')][_0xd425('0xb')]({'port':0x232a});config[_0xd425('0xc')]=_[_0xd425('0xd')](config['redis'],{'host':_0xd425('0xe'),'port':0x18eb});var socket=require(_0xd425('0xf'))(new Redis(config[_0xd425('0xc')]));require(_0xd425('0x10'))[_0xd425('0x11')](socket);function respondWithRpcPromise(_0x2beb20,_0x30111e,_0x1969ba){return new BPromise(function(_0x3a7a01,_0x35a7f4){return client[_0xd425('0x12')](_0x2beb20,_0x1969ba)[_0xd425('0x13')](function(_0x26f6d2){logger[_0xd425('0x14')](_0xd425('0x15'),_0x30111e,_0xd425('0x16'));logger[_0xd425('0x17')](_0xd425('0x18'),_0x30111e,_0xd425('0x16'),JSON[_0xd425('0x19')](_0x26f6d2));if(_0x26f6d2['error']){if(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1b')]===0x1f4){logger[_0xd425('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);return _0x35a7f4(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);}logger[_0xd425('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);return _0x3a7a01(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);}else{logger['info'](_0xd425('0x15'),_0x30111e,_0xd425('0x16'));_0x3a7a01(_0x26f6d2[_0xd425('0x1d')][_0xd425('0x1c')]);}})['catch'](function(_0x58a0c1){logger['error']('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x58a0c1);_0x35a7f4(_0x58a0c1);});});}exports[_0xd425('0x1e')]=function(_0xb92870){var _0x3c98db=this;return new Promise(function(_0x5e797a,_0x355af0){return db[_0xd425('0x1f')]['create'](_0xb92870[_0xd425('0x20')],{'raw':_0xb92870[_0xd425('0x21')]?_0xb92870[_0xd425('0x21')][_0xd425('0x22')]===undefined?!![]:![]:!![]})[_0xd425('0x13')](function(_0xb240c4){logger[_0xd425('0x14')](_0xd425('0x1e'),_0xb92870);logger[_0xd425('0x17')](_0xd425('0x1e'),_0xb92870,JSON[_0xd425('0x19')](_0xb240c4));_0x5e797a(_0xb240c4);})[_0xd425('0x23')](function(_0x47f44a){logger[_0xd425('0x1a')](_0xd425('0x1e'),_0x47f44a[_0xd425('0x1c')],_0xb92870);_0x355af0(_0x3c98db[_0xd425('0x1a')](0x1f4,_0x47f44a[_0xd425('0x1c')]));});});};exports[_0xd425('0x24')]=function(_0x3c3402){var _0x577e4b=this;return new Promise(function(_0x12f951,_0x177de2){return db[_0xd425('0x1f')]['update'](_0x3c3402[_0xd425('0x20')],{'raw':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x25')]||null:null,'attributes':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x26')]||null:null,'limit':_0x3c3402['options']?_0x3c3402[_0xd425('0x21')][_0xd425('0x27')]||null:null})[_0xd425('0x13')](function(_0x3695dd){logger[_0xd425('0x14')](_0xd425('0x24'),_0x3c3402);logger[_0xd425('0x17')](_0xd425('0x24'),_0x3c3402,JSON[_0xd425('0x19')](_0x3695dd));_0x12f951(_0x3695dd);})[_0xd425('0x23')](function(_0x3583b0){logger['error'](_0xd425('0x24'),_0x3583b0[_0xd425('0x1c')],_0x3c3402);_0x177de2(_0x577e4b[_0xd425('0x1a')](0x1f4,_0x3583b0[_0xd425('0x1c')]));});});}; \ No newline at end of file +var _0x2d17=['create','catch','UpdateFaxMessage','FaxMessage','body','options','where','attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxMessage'];(function(_0x230f1d,_0x466a5f){var _0x1cfc95=function(_0x278bab){while(--_0x278bab){_0x230f1d['push'](_0x230f1d['shift']());}};_0x1cfc95(++_0x466a5f);}(_0x2d17,0x17e));var _0x72d1=function(_0x478ffb,_0x21616b){_0x478ffb=_0x478ffb-0x0;var _0x524b38=_0x2d17[_0x478ffb];return _0x524b38;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});config[_0x72d1('0x9')]=_['defaults'](config[_0x72d1('0x9')],{'host':_0x72d1('0xa'),'port':0x18eb});var socket=require(_0x72d1('0xb'))(new Redis(config['redis']));require(_0x72d1('0xc'))[_0x72d1('0xd')](socket);function respondWithRpcPromise(_0x283775,_0x593c91,_0x1d7520){return new BPromise(function(_0x3a35c6,_0x45eb4a){return client[_0x72d1('0xe')](_0x283775,_0x1d7520)[_0x72d1('0xf')](function(_0x3916f2){logger[_0x72d1('0x10')](_0x72d1('0x11'),_0x593c91,_0x72d1('0x12'));logger[_0x72d1('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'),JSON[_0x72d1('0x14')](_0x3916f2));if(_0x3916f2[_0x72d1('0x15')]){if(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x16')]===0x1f4){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);return _0x45eb4a(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);}logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2['error'][_0x72d1('0x17')]);return _0x3a35c6(_0x3916f2['error'][_0x72d1('0x17')]);}else{logger[_0x72d1('0x10')]('FaxMessage,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'));_0x3a35c6(_0x3916f2[_0x72d1('0x18')][_0x72d1('0x17')]);}})['catch'](function(_0x4925f6){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x4925f6);_0x45eb4a(_0x4925f6);});});}exports[_0x72d1('0x19')]=function(_0x1865c1){var _0x8d6890=this;return new Promise(function(_0x2253fd,_0x1e2411){return db['FaxMessage'][_0x72d1('0x1a')](_0x1865c1['body'],{'raw':_0x1865c1['options']?_0x1865c1['options']['raw']===undefined?!![]:![]:!![]})[_0x72d1('0xf')](function(_0x374602){logger['info'](_0x72d1('0x19'),_0x1865c1);logger[_0x72d1('0x13')](_0x72d1('0x19'),_0x1865c1,JSON[_0x72d1('0x14')](_0x374602));_0x2253fd(_0x374602);})[_0x72d1('0x1b')](function(_0x4e6acd){logger['error'](_0x72d1('0x19'),_0x4e6acd[_0x72d1('0x17')],_0x1865c1);_0x1e2411(_0x8d6890[_0x72d1('0x15')](0x1f4,_0x4e6acd[_0x72d1('0x17')]));});});};exports[_0x72d1('0x1c')]=function(_0x33d530){var _0x163bec=this;return new Promise(function(_0x589f7c,_0x57ec9e){return db[_0x72d1('0x1d')]['update'](_0x33d530[_0x72d1('0x1e')],{'raw':_0x33d530[_0x72d1('0x1f')]?_0x33d530[_0x72d1('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33d530[_0x72d1('0x1f')]?_0x33d530['options'][_0x72d1('0x20')]||null:null,'attributes':_0x33d530[_0x72d1('0x1f')]?_0x33d530[_0x72d1('0x1f')][_0x72d1('0x21')]||null:null,'limit':_0x33d530['options']?_0x33d530[_0x72d1('0x1f')]['limit']||null:null})[_0x72d1('0xf')](function(_0x32dc5e){logger['info'](_0x72d1('0x1c'),_0x33d530);logger[_0x72d1('0x13')](_0x72d1('0x1c'),_0x33d530,JSON[_0x72d1('0x14')](_0x32dc5e));_0x589f7c(_0x32dc5e);})[_0x72d1('0x1b')](function(_0x52511f){logger[_0x72d1('0x15')](_0x72d1('0x1c'),_0x52511f[_0x72d1('0x17')],_0x33d530);_0x57ec9e(_0x163bec['error'](0x1f4,_0x52511f[_0x72d1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index ae9abd2..514781d 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 _0x5d8b=['update','removeListener','register','./faxMessage.events','save','remove'];(function(_0x595d98,_0x29b0ae){var _0x90975f=function(_0x745334){while(--_0x745334){_0x595d98['push'](_0x595d98['shift']());}};_0x90975f(++_0x29b0ae);}(_0x5d8b,0x1a1));var _0xb5d8=function(_0x13b9f5,_0x16e537){_0x13b9f5=_0x13b9f5-0x0;var _0x3a3024=_0x5d8b[_0x13b9f5];return _0x3a3024;};'use strict';var FaxMessageEvents=require(_0xb5d8('0x0'));var events=[_0xb5d8('0x1'),_0xb5d8('0x2'),_0xb5d8('0x3')];function createListener(_0x316004,_0x249481){return function(_0x351082){_0x249481['emit'](_0x316004,_0x351082);};}function removeListener(_0x36e405,_0x235881){return function(){FaxMessageEvents[_0xb5d8('0x4')](_0x36e405,_0x235881);};}exports[_0xb5d8('0x5')]=function(_0x2f16ff){for(var _0x34bdcf=0x0,_0xa51025=events['length'];_0x34bdcf<_0xa51025;_0x34bdcf++){var _0x5319e0=events[_0x34bdcf];var _0x5e0497=createListener('faxMessage:'+_0x5319e0,_0x2f16ff);FaxMessageEvents['on'](_0x5319e0,_0x5e0497);}}; \ No newline at end of file +var _0x78b6=['remove','update','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save'];(function(_0x83560f,_0x3d005f){var _0x5d4a9f=function(_0x3530d1){while(--_0x3530d1){_0x83560f['push'](_0x83560f['shift']());}};_0x5d4a9f(++_0x3d005f);}(_0x78b6,0x8e));var _0x678b=function(_0x18e9a3,_0x276495){_0x18e9a3=_0x18e9a3-0x0;var _0x214569=_0x78b6[_0x18e9a3];return _0x214569;};'use strict';var FaxMessageEvents=require(_0x678b('0x0'));var events=[_0x678b('0x1'),_0x678b('0x2'),_0x678b('0x3')];function createListener(_0x46e1de,_0x5eadb2){return function(_0xf60dd9){_0x5eadb2[_0x678b('0x4')](_0x46e1de,_0xf60dd9);};}function removeListener(_0x1182e5,_0x914b0b){return function(){FaxMessageEvents[_0x678b('0x5')](_0x1182e5,_0x914b0b);};}exports[_0x678b('0x6')]=function(_0x2dddb2){for(var _0x2c9319=0x0,_0x307b92=events[_0x678b('0x7')];_0x2c9319<_0x307b92;_0x2c9319++){var _0xaca93=events[_0x2c9319];var _0x29c0ef=createListener(_0x678b('0x8')+_0xaca93,_0x2dddb2);FaxMessageEvents['on'](_0xaca93,_0x29c0ef);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index e150556..bf500d4 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 _0x97c1=['isAuthenticated','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','get','/describe'];(function(_0xfeb38b,_0x13dd88){var _0x2d0a9a=function(_0x1f9888){while(--_0x1f9888){_0xfeb38b['push'](_0xfeb38b['shift']());}};_0x2d0a9a(++_0x13dd88);}(_0x97c1,0xdf));var _0x197c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x97c1[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var path=require('path');var timeout=require(_0x197c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x197c('0x3'));var auth=require(_0x197c('0x4'));var interaction=require(_0x197c('0x5'));var config=require(_0x197c('0x6'));var controller=require(_0x197c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x197c('0x8')]);router[_0x197c('0x9')](_0x197c('0xa'),auth[_0x197c('0xb')](),controller['describe']);router['get'](_0x197c('0xc'),auth['isAuthenticated'](),controller[_0x197c('0xd')]);router[_0x197c('0x9')](_0x197c('0xe'),auth[_0x197c('0xb')](),controller['download']);router[_0x197c('0xf')]('/',auth[_0x197c('0xb')](),interaction[_0x197c('0x10')](_0x197c('0x11'),_0x197c('0x12')),controller['create']);router[_0x197c('0x13')](_0x197c('0xc'),auth[_0x197c('0xb')](),controller[_0x197c('0x14')]);router['put'](_0x197c('0x15'),auth[_0x197c('0xb')](),controller[_0x197c('0x16')]);router[_0x197c('0x13')](_0x197c('0x17'),auth[_0x197c('0xb')](),controller['reject']);router['delete'](_0x197c('0xc'),auth[_0x197c('0xb')](),controller[_0x197c('0x18')]);module[_0x197c('0x19')]=router; \ No newline at end of file +var _0x5db8=['download','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id/download'];(function(_0x250ebb,_0x33a65f){var _0x1225fb=function(_0x40172e){while(--_0x40172e){_0x250ebb['push'](_0x250ebb['shift']());}};_0x1225fb(++_0x33a65f);}(_0x5db8,0xbb));var _0x85db=function(_0x2906e6,_0x5ccd59){_0x2906e6=_0x2906e6-0x0;var _0x12517a=_0x5db8[_0x2906e6];return _0x12517a;};'use strict';var multer=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var path=require(_0x85db('0x2'));var timeout=require('connect-timeout');var express=require(_0x85db('0x3'));var router=express[_0x85db('0x4')]();var fs_extra=require(_0x85db('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x85db('0x6'));var controller=require(_0x85db('0x7'));router[_0x85db('0x8')]('/',auth[_0x85db('0x9')](),controller['index']);router['get'](_0x85db('0xa'),auth[_0x85db('0x9')](),controller[_0x85db('0xb')]);router[_0x85db('0x8')]('/:id',auth[_0x85db('0x9')](),controller['show']);router[_0x85db('0x8')](_0x85db('0xc'),auth[_0x85db('0x9')](),controller[_0x85db('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0x85db('0xe'),_0x85db('0xf')),controller['create']);router[_0x85db('0x10')]('/:id',auth[_0x85db('0x9')](),controller[_0x85db('0x11')]);router[_0x85db('0x10')](_0x85db('0x12'),auth[_0x85db('0x9')](),controller[_0x85db('0x13')]);router[_0x85db('0x10')](_0x85db('0x14'),auth[_0x85db('0x9')](),controller[_0x85db('0x15')]);router[_0x85db('0x16')](_0x85db('0x17'),auth[_0x85db('0x9')](),controller['destroy']);module[_0x85db('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index b85f1bc..54012fe 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 _0x67d5=['roundrobin','INTEGER','exports','STRING','ENUM','rrmemory','beepall'];(function(_0x39f6ef,_0x17cf66){var _0x924907=function(_0x1776fb){while(--_0x1776fb){_0x39f6ef['push'](_0x39f6ef['shift']());}};_0x924907(++_0x17cf66);}(_0x67d5,0x18a));var _0x567d=function(_0x3b9d54,_0x30aeca){_0x3b9d54=_0x3b9d54-0x0;var _0x3cdb9b=_0x67d5[_0x3b9d54];return _0x3cdb9b;};'use strict';var Sequelize=require('sequelize');module[_0x567d('0x0')]={'name':{'type':Sequelize[_0x567d('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x567d('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x567d('0x2')](_0x567d('0x3'),_0x567d('0x4'),_0x567d('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x567d('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9b9=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x188036,_0x520fc1){var _0x10e835=function(_0x590f64){while(--_0x590f64){_0x188036['push'](_0x188036['shift']());}};_0x10e835(++_0x520fc1);}(_0xa9b9,0x1c2));var _0x9a9b=function(_0xb2454d,_0x291753){_0xb2454d=_0xb2454d-0x0;var _0x5464fb=_0xa9b9[_0xb2454d];return _0x5464fb;};'use strict';var Sequelize=require(_0x9a9b('0x0'));module[_0x9a9b('0x1')]={'name':{'type':Sequelize[_0x9a9b('0x2')],'unique':_0x9a9b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9a9b('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9a9b('0x5')](_0x9a9b('0x6'),_0x9a9b('0x7'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x9a9b('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index d9479ed..ab5f068 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 _0x7854=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','getMembers','findOne','FaxQueueId','UserFaxQueue','User','findAndCountAll','UserId','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','userFaxQueue:save','ids','select','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','then','get','FaxQueues','error','stack','name','send','index','FaxQueue','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','findAll','catch','show','params','fields','includeAll','include'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x7854,0xcb));var _0x4785=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0x7854[_0x101802];return _0x5d61ce;};'use strict';var emlformat=require(_0x4785('0x0'));var rimraf=require(_0x4785('0x1'));var zipdir=require(_0x4785('0x2'));var jsonpatch=require(_0x4785('0x3'));var rp=require(_0x4785('0x4'));var moment=require('moment');var BPromise=require(_0x4785('0x5'));var Mustache=require(_0x4785('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4785('0x7'));var csv=require('to-csv');var ejs=require(_0x4785('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4785('0x9'));var squel=require(_0x4785('0xa'));var crypto=require(_0x4785('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4785('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4785('0xd'));var Redis=require(_0x4785('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4785('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4785('0x10'))(_0x4785('0x11'));var utils=require(_0x4785('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x4785('0x13'));var db=require(_0x4785('0x14'))['db'];config['redis']=_[_0x4785('0x15')](config[_0x4785('0x16')],{'host':_0x4785('0x17'),'port':0x18eb});var socket=require(_0x4785('0x18'))(new Redis(config[_0x4785('0x16')]));require('./faxQueue.socket')[_0x4785('0x19')](socket);function respondWithStatusCode(_0xe8e321,_0x1c4c67){_0x1c4c67=_0x1c4c67||0xcc;return function(_0x4f317a){if(_0x4f317a){return _0xe8e321[_0x4785('0x1a')](_0x1c4c67);}return _0xe8e321[_0x4785('0x1b')](_0x1c4c67)[_0x4785('0x1c')]();};}function respondWithResult(_0x34578f,_0x44034e){_0x44034e=_0x44034e||0xc8;return function(_0x204ab6){if(_0x204ab6){return _0x34578f['status'](_0x44034e)[_0x4785('0x1d')](_0x204ab6);}};}function respondWithFilteredResult(_0x33658d,_0x170af2){return function(_0x4ba399){if(_0x4ba399){var _0x2d9fcb=typeof _0x170af2[_0x4785('0x1e')]===_0x4785('0x1f')&&typeof _0x170af2['limit']===_0x4785('0x1f');var _0x46f79e=_0x4ba399[_0x4785('0x20')];var _0x503263=_0x2d9fcb?0x0:_0x170af2['offset'];var _0x31a309=_0x2d9fcb?_0x4ba399[_0x4785('0x20')]:_0x170af2[_0x4785('0x1e')]+_0x170af2[_0x4785('0x21')];var _0x2b8504;if(_0x31a309>=_0x46f79e){_0x31a309=_0x46f79e;_0x2b8504=0xc8;}else{_0x2b8504=0xce;}_0x33658d[_0x4785('0x1b')](_0x2b8504);return _0x33658d[_0x4785('0x22')](_0x4785('0x23'),_0x503263+'-'+_0x31a309+'/'+_0x46f79e)[_0x4785('0x1d')](_0x4ba399);}return null;};}function patchUpdates(_0x144d78){return function(_0x23ff28){try{jsonpatch[_0x4785('0x24')](_0x23ff28,_0x144d78,!![]);}catch(_0x192d45){return BPromise['reject'](_0x192d45);}return _0x23ff28[_0x4785('0x25')]();};}function saveUpdates(_0x446ba1,_0x5e5f17){return function(_0x83acdb){if(_0x83acdb){return _0x83acdb['update'](_0x446ba1)['then'](function(_0x151b71){return _0x151b71;});}return null;};}function removeEntity(_0x6cfd10,_0x1e96ed){return function(_0x19d62e){if(_0x19d62e){return _0x19d62e[_0x4785('0x26')]()[_0x4785('0x27')](function(){var _0x266bf0=_0x19d62e[_0x4785('0x28')]({'plain':!![]});var _0x1651fa=_0x4785('0x29');return db['UserProfileResource'][_0x4785('0x26')]({'where':{'type':_0x1651fa,'resourceId':_0x266bf0['id']}})['then'](function(){return _0x19d62e;});})[_0x4785('0x27')](function(){_0x6cfd10[_0x4785('0x1b')](0xcc)[_0x4785('0x1c')]();});}};}function handleEntityNotFound(_0x478a80,_0x2c271f){return function(_0x4955e9){if(!_0x4955e9){_0x478a80['sendStatus'](0x194);}return _0x4955e9;};}function handleError(_0x39409e,_0x68649a){_0x68649a=_0x68649a||0x1f4;return function(_0x10ef56){logger[_0x4785('0x2a')](_0x10ef56[_0x4785('0x2b')]);if(_0x10ef56['name']){delete _0x10ef56[_0x4785('0x2c')];}_0x39409e[_0x4785('0x1b')](_0x68649a)[_0x4785('0x2d')](_0x10ef56);};}exports[_0x4785('0x2e')]=function(_0x11b099,_0x54ed57){var _0x48c9ff={},_0x1c2689={},_0x5557ce={'count':0x0,'rows':[]};var _0x3e8350=_['map'](db[_0x4785('0x2f')][_0x4785('0x30')],function(_0x1a5db2){return{'name':_0x1a5db2[_0x4785('0x31')],'type':_0x1a5db2['type']['key']};});_0x1c2689[_0x4785('0x32')]=_[_0x4785('0x33')](_0x3e8350,_0x4785('0x2c'));_0x1c2689[_0x4785('0x34')]=_[_0x4785('0x35')](_0x11b099[_0x4785('0x34')]);_0x1c2689[_0x4785('0x36')]=_[_0x4785('0x37')](_0x1c2689[_0x4785('0x32')],_0x1c2689[_0x4785('0x34')]);_0x48c9ff[_0x4785('0x38')]=_[_0x4785('0x37')](_0x1c2689['model'],qs['fields'](_0x11b099[_0x4785('0x34')]['fields']));_0x48c9ff[_0x4785('0x38')]=_0x48c9ff[_0x4785('0x38')][_0x4785('0x39')]?_0x48c9ff[_0x4785('0x38')]:_0x1c2689[_0x4785('0x32')];if(!_0x11b099[_0x4785('0x34')][_0x4785('0x3a')](_0x4785('0x3b'))){_0x48c9ff[_0x4785('0x21')]=qs[_0x4785('0x21')](_0x11b099[_0x4785('0x34')][_0x4785('0x21')]);_0x48c9ff[_0x4785('0x1e')]=qs[_0x4785('0x1e')](_0x11b099[_0x4785('0x34')][_0x4785('0x1e')]);}_0x48c9ff[_0x4785('0x3c')]=qs['sort'](_0x11b099[_0x4785('0x34')][_0x4785('0x3d')]);_0x48c9ff[_0x4785('0x3e')]=qs[_0x4785('0x36')](_[_0x4785('0x3f')](_0x11b099[_0x4785('0x34')],_0x1c2689[_0x4785('0x36')]),_0x3e8350);if(_0x11b099['query'][_0x4785('0x40')]){_0x48c9ff[_0x4785('0x3e')]=_[_0x4785('0x41')](_0x48c9ff[_0x4785('0x3e')],{'$or':_[_0x4785('0x33')](_0x3e8350,function(_0x3c9637){if(_0x3c9637[_0x4785('0x42')]!=='VIRTUAL'){var _0x27d981={};_0x27d981[_0x3c9637['name']]={'$like':'%'+_0x11b099['query'][_0x4785('0x40')]+'%'};return _0x27d981;}})});}_0x48c9ff=_[_0x4785('0x41')]({},_0x48c9ff,_0x11b099[_0x4785('0x43')]);var _0x507901={'where':_0x48c9ff[_0x4785('0x3e')]};return db['FaxQueue'][_0x4785('0x20')](_0x507901)[_0x4785('0x27')](function(_0x46bc12){_0x5557ce['count']=_0x46bc12;if(_0x11b099['query']['includeAll']){_0x48c9ff['include']=[{'all':!![]}];}return db[_0x4785('0x2f')][_0x4785('0x44')](_0x48c9ff);})[_0x4785('0x27')](function(_0x296231){_0x5557ce['rows']=_0x296231;return _0x5557ce;})[_0x4785('0x27')](respondWithFilteredResult(_0x54ed57,_0x48c9ff))[_0x4785('0x45')](handleError(_0x54ed57,null));};exports[_0x4785('0x46')]=function(_0x5916e9,_0xd0c253){var _0x1f8317={'raw':!![],'where':{'id':_0x5916e9[_0x4785('0x47')]['id']}},_0x17ca07={};_0x17ca07[_0x4785('0x32')]=_['keys'](db['FaxQueue'][_0x4785('0x30')]);_0x17ca07[_0x4785('0x34')]=_[_0x4785('0x35')](_0x5916e9[_0x4785('0x34')]);_0x17ca07[_0x4785('0x36')]=_[_0x4785('0x37')](_0x17ca07['model'],_0x17ca07[_0x4785('0x34')]);_0x1f8317[_0x4785('0x38')]=_[_0x4785('0x37')](_0x17ca07[_0x4785('0x32')],qs['fields'](_0x5916e9[_0x4785('0x34')][_0x4785('0x48')]));_0x1f8317[_0x4785('0x38')]=_0x1f8317[_0x4785('0x38')][_0x4785('0x39')]?_0x1f8317[_0x4785('0x38')]:_0x17ca07['model'];if(_0x5916e9[_0x4785('0x34')][_0x4785('0x49')]){_0x1f8317[_0x4785('0x4a')]=[{'all':!![]}];}_0x1f8317=_[_0x4785('0x41')]({},_0x1f8317,_0x5916e9['options']);return db[_0x4785('0x2f')][_0x4785('0x4b')](_0x1f8317)['then'](handleEntityNotFound(_0xd0c253,null))[_0x4785('0x27')](respondWithResult(_0xd0c253,null))[_0x4785('0x45')](handleError(_0xd0c253,null));};exports[_0x4785('0x4c')]=function(_0x35b15e,_0x1d0853){return db[_0x4785('0x2f')][_0x4785('0x4c')](_0x35b15e[_0x4785('0x4d')],{})['then'](function(_0x5d269c){var _0x3eaf28=_0x35b15e['user']['get']({'plain':!![]});if(!_0x3eaf28)throw new Error(_0x4785('0x4e'));if(_0x3eaf28['role']===_0x4785('0x4f')){var _0x320ff3=_0x5d269c[_0x4785('0x28')]({'plain':!![]});var _0x2bb906='FaxQueues';return db[_0x4785('0x50')]['find']({'where':{'name':_0x2bb906,'userProfileId':_0x3eaf28[_0x4785('0x51')]},'raw':!![]})[_0x4785('0x27')](function(_0x3f4f53){if(_0x3f4f53&&_0x3f4f53[_0x4785('0x52')]===0x0){return db[_0x4785('0x53')][_0x4785('0x4c')]({'name':_0x320ff3[_0x4785('0x2c')],'resourceId':_0x320ff3['id'],'type':_0x3f4f53[_0x4785('0x2c')],'sectionId':_0x3f4f53['id']},{})[_0x4785('0x27')](function(){return _0x5d269c;});}else{return _0x5d269c;}})[_0x4785('0x45')](function(_0x18fa82){logger[_0x4785('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18fa82);throw _0x18fa82;});}return _0x5d269c;})[_0x4785('0x27')](respondWithResult(_0x1d0853,0xc9))[_0x4785('0x45')](handleError(_0x1d0853,null));};exports['update']=function(_0x299fa5,_0x5ea383){if(_0x299fa5[_0x4785('0x4d')]['id']){delete _0x299fa5[_0x4785('0x4d')]['id'];}return db[_0x4785('0x2f')][_0x4785('0x4b')]({'where':{'id':_0x299fa5['params']['id']}})[_0x4785('0x27')](handleEntityNotFound(_0x5ea383,null))[_0x4785('0x27')](saveUpdates(_0x299fa5[_0x4785('0x4d')],null))[_0x4785('0x27')](respondWithResult(_0x5ea383,null))[_0x4785('0x45')](handleError(_0x5ea383,null));};exports[_0x4785('0x26')]=function(_0x149260,_0xc19f95){return db[_0x4785('0x2f')][_0x4785('0x4b')]({'where':{'id':_0x149260[_0x4785('0x47')]['id']}})['then'](handleEntityNotFound(_0xc19f95,null))[_0x4785('0x27')](removeEntity(_0xc19f95,null))[_0x4785('0x45')](handleError(_0xc19f95,null));};exports['describe']=function(_0x31f141,_0x13a7eb){return db[_0x4785('0x2f')]['describe']()[_0x4785('0x27')](respondWithResult(_0x13a7eb,null))[_0x4785('0x45')](handleError(_0x13a7eb,null));};exports[_0x4785('0x54')]=function(_0x5b9d82,_0x39213e,_0x449408){var _0xd01486={'raw':!![],'where':{}},_0x211770={},_0x34a2e8;return db[_0x4785('0x2f')][_0x4785('0x55')]({'where':{'id':_0x5b9d82[_0x4785('0x47')]['id']}})['then'](handleEntityNotFound(_0x39213e,null))[_0x4785('0x27')](function(_0x19e667){if(_0x19e667){_0x34a2e8=_0x19e667['get']({'plain':!![]});_0x211770['model']=_[_0x4785('0x35')](db['UserFaxQueue'][_0x4785('0x30')]);_0x211770['query']=_['keys'](_0x5b9d82[_0x4785('0x34')]);_0x211770[_0x4785('0x36')]=_[_0x4785('0x37')](_0x211770['model'],_0x211770[_0x4785('0x34')]);_0xd01486[_0x4785('0x38')]=_[_0x4785('0x37')](_0x211770[_0x4785('0x32')],qs[_0x4785('0x48')](_0x5b9d82[_0x4785('0x34')]['fields']));_0xd01486[_0x4785('0x38')]=_0xd01486['attributes'][_0x4785('0x39')]?_0xd01486[_0x4785('0x38')]:_0x211770['model'];if(!_0x5b9d82[_0x4785('0x34')]['hasOwnProperty'](_0x4785('0x3b'))){_0xd01486[_0x4785('0x21')]=qs[_0x4785('0x21')](_0x5b9d82[_0x4785('0x34')]['limit']);_0xd01486[_0x4785('0x1e')]=qs[_0x4785('0x1e')](_0x5b9d82[_0x4785('0x34')][_0x4785('0x1e')]);}_0xd01486['order']=qs[_0x4785('0x3d')](_0x5b9d82[_0x4785('0x34')]['sort']);_0xd01486['where']=qs['filters'](_[_0x4785('0x3f')](_0x5b9d82['query'],_0x211770[_0x4785('0x36')]));_0xd01486[_0x4785('0x3e')][_0x4785('0x56')]=_0x19e667['id'];if(_0x5b9d82[_0x4785('0x34')]['filter']){_0xd01486[_0x4785('0x3e')]=_[_0x4785('0x41')](_0xd01486[_0x4785('0x3e')],{'$or':_[_0x4785('0x33')](_0xd01486[_0x4785('0x38')],function(_0x1505a7){var _0x4c9990={};_0x4c9990[_0x1505a7]={'$like':'%'+_0x5b9d82[_0x4785('0x34')][_0x4785('0x40')]+'%'};return _0x4c9990;})});}_0xd01486=_['merge']({},_0xd01486,_0x5b9d82[_0x4785('0x43')]);return db[_0x4785('0x57')][_0x4785('0x44')](_0xd01486);}})[_0x4785('0x27')](function(_0x1cf1ea){if(_0x1cf1ea){return db[_0x4785('0x58')][_0x4785('0x59')]({'where':{'id':_[_0x4785('0x33')](_0x1cf1ea,_0x4785('0x5a')),'role':'agent'},'attributes':['id',_0x4785('0x2c'),'faxPause',_0x4785('0x5b'),_0x4785('0x5c')]});}})[_0x4785('0x27')](function(_0x573c16){if(_0x573c16){return{'count':_0x573c16[_0x4785('0x20')],'rows':_[_0x4785('0x33')](_0x573c16[_0x4785('0x5d')],function(_0x1a5c88){return{'membername':_0x1a5c88[_0x4785('0x2c')],'UserId':_0x1a5c88['id'],'queue_name':_0x34a2e8[_0x4785('0x2c')],'FaxQueueId':_0x34a2e8['id'],'interface':util[_0x4785('0x5e')](_0x4785('0x5f'),'SIP',_0x1a5c88['name']),'penalty':0x0,'paused':_0x1a5c88['faxPause'],'createdAt':_0x1a5c88[_0x4785('0x5c')],'updatedAt':_0x1a5c88[_0x4785('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4785('0x27')](respondWithFilteredResult(_0x39213e,_0xd01486))[_0x4785('0x45')](handleError(_0x39213e,null));};exports[_0x4785('0x60')]=function(_0x2aedf9,_0x1bc46a,_0x2ff6c5){var _0x369b86={};var _0x2afe14={};var _0x5b6292;var _0x3b2216;return db[_0x4785('0x2f')]['findOne']({'where':{'id':_0x2aedf9[_0x4785('0x47')]['id']}})['then'](handleEntityNotFound(_0x1bc46a,null))[_0x4785('0x27')](function(_0x43bef1){if(_0x43bef1){_0x5b6292=_0x43bef1;_0x2afe14['model']=_[_0x4785('0x35')](db[_0x4785('0x61')][_0x4785('0x30')]);_0x2afe14['query']=_[_0x4785('0x35')](_0x2aedf9[_0x4785('0x34')]);_0x2afe14[_0x4785('0x36')]=_[_0x4785('0x37')](_0x2afe14['model'],_0x2afe14[_0x4785('0x34')]);_0x369b86[_0x4785('0x38')]=_['intersection'](_0x2afe14[_0x4785('0x32')],qs['fields'](_0x2aedf9[_0x4785('0x34')][_0x4785('0x48')]));_0x369b86[_0x4785('0x38')]=_0x369b86[_0x4785('0x38')][_0x4785('0x39')]?_0x369b86[_0x4785('0x38')]:_0x2afe14[_0x4785('0x32')];_0x369b86['order']=qs[_0x4785('0x3d')](_0x2aedf9['query']['sort']);_0x369b86[_0x4785('0x3e')]=qs[_0x4785('0x36')](_[_0x4785('0x3f')](_0x2aedf9[_0x4785('0x34')],_0x2afe14[_0x4785('0x36')]));if(_0x2aedf9['query'][_0x4785('0x40')]){_0x369b86['where']=_['merge'](_0x369b86[_0x4785('0x3e')],{'$or':_[_0x4785('0x33')](_0x369b86[_0x4785('0x38')],function(_0x2ea3ea){var _0x52b811={};_0x52b811[_0x2ea3ea]={'$like':'%'+_0x2aedf9[_0x4785('0x34')][_0x4785('0x40')]+'%'};return _0x52b811;})});}_0x369b86=_[_0x4785('0x41')]({},_0x369b86,_0x2aedf9['options']);return _0x5b6292[_0x4785('0x60')](_0x369b86);}})['then'](function(_0x132928){if(_0x132928){_0x3b2216=_0x132928['length'];if(!_0x2aedf9['query'][_0x4785('0x3a')](_0x4785('0x3b'))){_0x369b86['limit']=qs['limit'](_0x2aedf9['query'][_0x4785('0x21')]);_0x369b86['offset']=qs['offset'](_0x2aedf9[_0x4785('0x34')][_0x4785('0x1e')]);}return _0x5b6292['getTeams'](_0x369b86);}})[_0x4785('0x27')](function(_0x5b3d46){if(_0x5b3d46){return _0x5b3d46?{'count':_0x3b2216,'rows':_0x5b3d46}:null;}})[_0x4785('0x27')](respondWithResult(_0x1bc46a,null))[_0x4785('0x45')](handleError(_0x1bc46a,null));};exports['addTeams']=function(_0x86ac8f,_0x1226d9,_0x55fb56){var _0x4db7cc=_0x86ac8f[_0x4785('0x4d')]['ids'];return db[_0x4785('0x61')][_0x4785('0x44')]({'where':{'id':_0x4db7cc},'attributes':['id'],'include':[{'model':db[_0x4785('0x58')],'as':_0x4785('0x62'),'attributes':['id',_0x4785('0x2c'),_0x4785('0x63'),_0x4785('0x64'),_0x4785('0x65')],'raw':!![]}]})[_0x4785('0x27')](function(_0x48a483){if(_0x48a483){var _0x55b9df=_[_0x4785('0x66')](_0x48a483,function(_0x5582ea){var _0x3777a2=_0x5582ea[_0x4785('0x28')]({'plain':!![]});return _0x3777a2[_0x4785('0x62')];});return db['FaxQueue'][_0x4785('0x4b')]({'where':{'id':_0x86ac8f['params']['id']}})[_0x4785('0x27')](function(_0x3de7f3){return db[_0x4785('0x67')][_0x4785('0x68')](function(_0x4105e4){return _0x3de7f3[_0x4785('0x69')](_0x4db7cc,{'transaction':_0x4105e4})[_0x4785('0x27')](function(){return BPromise[_0x4785('0x6a')](_0x55b9df,function(_0x3ca2d9){return db[_0x4785('0x57')]['findOrCreate']({'where':{'UserId':_0x3ca2d9['id'],'FaxQueueId':_0x86ac8f[_0x4785('0x47')]['id']},'transaction':_0x4105e4});});})[_0x4785('0x27')](function(){_0x55b9df[_0x4785('0x6b')](function(_0xebca64){socket['emit'](_0x4785('0x6c'),{'UserId':_0xebca64['id'],'FaxQueueId':_0x3de7f3['id']});});});});});}})['then'](respondWithStatusCode(_0x1226d9,null))[_0x4785('0x45')](handleError(_0x1226d9,null));};exports['removeTeams']=function(_0x438a01,_0x2d192b,_0x8ea41a){return db[_0x4785('0x61')][_0x4785('0x44')]({'where':{'id':_0x438a01[_0x4785('0x34')][_0x4785('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x4785('0x58')],'as':_0x4785('0x62'),'attributes':['id'],'raw':!![]}]})[_0x4785('0x27')](handleEntityNotFound(_0x2d192b,null))['then'](function(_0xd54478){var _0x1d4ebd=_[_0x4785('0x33')](_0xd54478,'id');var _0x352735=[];var _0x2426c7=[];var _0x4ca563=squel[_0x4785('0x6e')]();_0x4ca563[_0x4785('0x6f')]('tq.TeamId')[_0x4785('0x70')](_0x4785('0x71'),'tq')[_0x4785('0x72')](_0x4785('0x73'),'ut',_0x4785('0x74'))['where']('FaxQueueId\x20=\x20?',_0x438a01[_0x4785('0x47')]['id']);for(var _0x2aa91b=0x0;_0x2aa91b<_0xd54478[_0x4785('0x39')];_0x2aa91b+=0x1){let _0x545c33=_0xd54478[_0x2aa91b];for(var _0x2c7d7f=0x0;_0x2c7d7f<_0x545c33[_0x4785('0x62')][_0x4785('0x39')];_0x2c7d7f+=0x1){let _0x4a561b=_0x545c33[_0x4785('0x62')][_0x2c7d7f];var _0x135531=_0x4ca563[_0x4785('0x75')]();_0x135531[_0x4785('0x3e')](_0x4785('0x76'),_0x4a561b['id']);_0x2426c7[_0x4785('0x77')](db[_0x4785('0x67')][_0x4785('0x34')](_0x135531[_0x4785('0x78')](),{'type':db[_0x4785('0x67')][_0x4785('0x79')][_0x4785('0x7a')]})[_0x4785('0x27')](function(_0xd93693){if(_0xd93693['length']===0x1){return _0x4a561b['id'];}else{var _0x15373d=_[_0x4785('0x7b')](_[_0x4785('0x33')](_0xd93693,_0x4785('0x7c')),function(_0x59d638){return _[_0x4785('0x7d')](_0x1d4ebd,_0x59d638);});if(_0x15373d){return _0x4a561b['id'];}}}));}}return BPromise[_0x4785('0x7e')](_0x2426c7)[_0x4785('0x27')](function(_0x215bb2){_0x352735=_(_0x352735)[_0x4785('0x7f')](_0x215bb2)[_0x4785('0x80')]()['value']();return db[_0x4785('0x2f')][_0x4785('0x4b')]({'where':{'id':_0x438a01[_0x4785('0x47')]['id']}})[_0x4785('0x27')](function(_0x294939){return db[_0x4785('0x67')]['transaction'](function(_0x14444b){return _0x294939[_0x4785('0x81')](_0x438a01[_0x4785('0x34')][_0x4785('0x6d')],{'transaction':_0x14444b})[_0x4785('0x27')](function(){if(!_[_0x4785('0x82')](_0x352735)){return _0x294939[_0x4785('0x83')](_0x352735,{'transaction':_0x14444b});}})[_0x4785('0x27')](function(){_0x352735['forEach'](function(_0xe631cf){socket[_0x4785('0x84')](_0x4785('0x85'),{'UserId':_0xe631cf,'FaxQueueId':_0x294939['id']});});});});});});})['then'](respondWithStatusCode(_0x2d192b,null))['catch'](handleError(_0x2d192b,null));};exports[_0x4785('0x86')]=function(_0x2eb16e,_0x32d8b4,_0x18cab6){return db[_0x4785('0x2f')][_0x4785('0x4b')]({'where':{'id':_0x2eb16e[_0x4785('0x47')]['id']}})[_0x4785('0x27')](handleEntityNotFound(_0x32d8b4,null))[_0x4785('0x27')](function(_0x280981){if(_0x280981){return _0x280981['addAgents'](_0x2eb16e[_0x4785('0x4d')][_0x4785('0x6d')],_[_0x4785('0x87')](_0x2eb16e[_0x4785('0x4d')],[_0x4785('0x6d'),'id'])||{})[_0x4785('0x88')](function(_0x410550){for(var _0x19abf7=0x0;_0x19abf7<_0x2eb16e[_0x4785('0x4d')][_0x4785('0x6d')]['length'];_0x19abf7+=0x1){socket[_0x4785('0x84')](_0x4785('0x6c'),{'UserId':Number(_0x2eb16e[_0x4785('0x4d')]['ids'][_0x19abf7]),'FaxQueueId':Number(_0x2eb16e[_0x4785('0x47')]['id'])});}return _0x410550;});}})[_0x4785('0x27')](respondWithResult(_0x32d8b4,null))['catch'](handleError(_0x32d8b4,null));};exports[_0x4785('0x83')]=function(_0x1836cb,_0x272b1f,_0x1cd8b3){return db[_0x4785('0x2f')][_0x4785('0x4b')]({'where':{'id':_0x1836cb[_0x4785('0x47')]['id']}})[_0x4785('0x27')](handleEntityNotFound(_0x272b1f,null))[_0x4785('0x27')](function(_0x482a59){if(_0x482a59){return _0x482a59[_0x4785('0x83')](_0x1836cb[_0x4785('0x34')][_0x4785('0x6d')])[_0x4785('0x27')](function(){if(_[_0x4785('0x89')](_0x1836cb[_0x4785('0x34')][_0x4785('0x6d')])){for(var _0x57b34d=0x0;_0x57b34d<_0x1836cb['query'][_0x4785('0x6d')]['length'];_0x57b34d+=0x1){socket[_0x4785('0x84')](_0x4785('0x85'),{'UserId':Number(_0x1836cb[_0x4785('0x34')][_0x4785('0x6d')][_0x57b34d]),'FaxQueueId':Number(_0x1836cb[_0x4785('0x47')]['id'])});}}else{socket[_0x4785('0x84')](_0x4785('0x85'),{'UserId':Number(_0x1836cb[_0x4785('0x34')][_0x4785('0x6d')]),'FaxQueueId':Number(_0x1836cb[_0x4785('0x47')]['id'])});}});}})[_0x4785('0x27')](respondWithStatusCode(_0x272b1f,null))[_0x4785('0x45')](handleError(_0x272b1f,null));};exports[_0x4785('0x8a')]=function(_0x1071fa,_0x3b1c3f,_0x4adc9c){var _0x4e8e85={};var _0x1293e1={};var _0x5d9714;var _0x190708;return db[_0x4785('0x2f')]['findOne']({'where':{'id':_0x1071fa[_0x4785('0x47')]['id']}})[_0x4785('0x27')](handleEntityNotFound(_0x3b1c3f,null))[_0x4785('0x27')](function(_0x125e17){if(_0x125e17){_0x5d9714=_0x125e17;_0x1293e1['model']=_[_0x4785('0x35')](db[_0x4785('0x58')]['rawAttributes']);_0x1293e1['query']=_['keys'](_0x1071fa[_0x4785('0x34')]);_0x1293e1[_0x4785('0x36')]=_[_0x4785('0x37')](_0x1293e1['model'],_0x1293e1[_0x4785('0x34')]);_0x4e8e85[_0x4785('0x38')]=_[_0x4785('0x37')](_0x1293e1[_0x4785('0x32')],qs[_0x4785('0x48')](_0x1071fa['query'][_0x4785('0x48')]));_0x4e8e85[_0x4785('0x38')]=_0x4e8e85['attributes']['length']?_0x4e8e85['attributes']:_0x1293e1[_0x4785('0x32')];_0x4e8e85['order']=qs[_0x4785('0x3d')](_0x1071fa[_0x4785('0x34')][_0x4785('0x3d')]);_0x4e8e85[_0x4785('0x3e')]=qs[_0x4785('0x36')](_['pick'](_0x1071fa[_0x4785('0x34')],_0x1293e1[_0x4785('0x36')]));if(_0x1071fa[_0x4785('0x34')][_0x4785('0x40')]){_0x4e8e85['where']=_['merge'](_0x4e8e85['where'],{'$or':_[_0x4785('0x33')](_0x4e8e85[_0x4785('0x38')],function(_0x1f3a97){var _0x28a627={};_0x28a627[_0x1f3a97]={'$like':'%'+_0x1071fa[_0x4785('0x34')][_0x4785('0x40')]+'%'};return _0x28a627;})});}_0x4e8e85=_[_0x4785('0x41')]({},_0x4e8e85,_0x1071fa[_0x4785('0x43')]);return _0x5d9714['getAgents'](_0x4e8e85);}})[_0x4785('0x27')](function(_0x33b856){if(_0x33b856){_0x190708=_0x33b856[_0x4785('0x39')];if(!_0x1071fa[_0x4785('0x34')]['hasOwnProperty'](_0x4785('0x3b'))){_0x4e8e85[_0x4785('0x21')]=qs['limit'](_0x1071fa[_0x4785('0x34')][_0x4785('0x21')]);_0x4e8e85['offset']=qs[_0x4785('0x1e')](_0x1071fa[_0x4785('0x34')]['offset']);}return _0x5d9714[_0x4785('0x8a')](_0x4e8e85);}})[_0x4785('0x27')](function(_0x4aa0d3){if(_0x4aa0d3){return _0x4aa0d3?{'count':_0x190708,'rows':_0x4aa0d3}:null;}})[_0x4785('0x27')](respondWithResult(_0x3b1c3f,null))[_0x4785('0x45')](handleError(_0x3b1c3f,null));}; \ No newline at end of file +var _0x91f0=['show','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','findOne','UserFaxQueue','hasOwnProperty','filters','pick','User','findAndCountAll','UserId','agent','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','SELECT','every','TeamId','includes','compact','value','isEmpty','addAgents','omit','userFaxQueue:save','removeAgents','isArray','userFaxQueue:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxQueue.socket','sendStatus','end','json','undefined','limit','count','offset','status','Content-Range','save','update','destroy','then','FaxQueues','UserProfileResource','name','send','index','map','FaxQueue','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch'];(function(_0x1e8074,_0x420771){var _0x5c0d69=function(_0x29caea){while(--_0x29caea){_0x1e8074['push'](_0x1e8074['shift']());}};_0x5c0d69(++_0x420771);}(_0x91f0,0x142));var _0x091f=function(_0x375ead,_0x143aa7){_0x375ead=_0x375ead-0x0;var _0xb673f9=_0x91f0[_0x375ead];return _0xb673f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x091f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x091f('0x1'));var rp=require(_0x091f('0x2'));var moment=require(_0x091f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x091f('0x4'));var util=require(_0x091f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x091f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x091f('0x7'));var squel=require(_0x091f('0x8'));var crypto=require(_0x091f('0x9'));var jsforce=require(_0x091f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x091f('0x6'));var querystring=require(_0x091f('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x091f('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x091f('0xd'));var hardwareService=require(_0x091f('0xe'));var logger=require(_0x091f('0xf'))(_0x091f('0x10'));var utils=require(_0x091f('0x11'));var config=require(_0x091f('0x12'));var licenseUtil=require(_0x091f('0x13'));var db=require(_0x091f('0x14'))['db'];config['redis']=_[_0x091f('0x15')](config[_0x091f('0x16')],{'host':_0x091f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x091f('0x16')]));require(_0x091f('0x18'))['register'](socket);function respondWithStatusCode(_0x5c00f6,_0x247773){_0x247773=_0x247773||0xcc;return function(_0x308bae){if(_0x308bae){return _0x5c00f6[_0x091f('0x19')](_0x247773);}return _0x5c00f6['status'](_0x247773)[_0x091f('0x1a')]();};}function respondWithResult(_0x579d87,_0x5aac2c){_0x5aac2c=_0x5aac2c||0xc8;return function(_0x1b7829){if(_0x1b7829){return _0x579d87['status'](_0x5aac2c)[_0x091f('0x1b')](_0x1b7829);}};}function respondWithFilteredResult(_0x2add79,_0x64aa5b){return function(_0x17bae9){if(_0x17bae9){var _0x1977c8=typeof _0x64aa5b['offset']===_0x091f('0x1c')&&typeof _0x64aa5b[_0x091f('0x1d')]===_0x091f('0x1c');var _0x2a066e=_0x17bae9[_0x091f('0x1e')];var _0x1eada1=_0x1977c8?0x0:_0x64aa5b['offset'];var _0x308aa2=_0x1977c8?_0x17bae9[_0x091f('0x1e')]:_0x64aa5b[_0x091f('0x1f')]+_0x64aa5b['limit'];var _0x42f192;if(_0x308aa2>=_0x2a066e){_0x308aa2=_0x2a066e;_0x42f192=0xc8;}else{_0x42f192=0xce;}_0x2add79[_0x091f('0x20')](_0x42f192);return _0x2add79['set'](_0x091f('0x21'),_0x1eada1+'-'+_0x308aa2+'/'+_0x2a066e)[_0x091f('0x1b')](_0x17bae9);}return null;};}function patchUpdates(_0x523c58){return function(_0x314f1c){try{jsonpatch['apply'](_0x314f1c,_0x523c58,!![]);}catch(_0x4b1852){return BPromise['reject'](_0x4b1852);}return _0x314f1c[_0x091f('0x22')]();};}function saveUpdates(_0x432d31,_0x495282){return function(_0x49b8ac){if(_0x49b8ac){return _0x49b8ac[_0x091f('0x23')](_0x432d31)['then'](function(_0x476f28){return _0x476f28;});}return null;};}function removeEntity(_0x21f72f,_0x6120c8){return function(_0x26a9c7){if(_0x26a9c7){return _0x26a9c7[_0x091f('0x24')]()[_0x091f('0x25')](function(){var _0x324e30=_0x26a9c7['get']({'plain':!![]});var _0x4dafc5=_0x091f('0x26');return db[_0x091f('0x27')][_0x091f('0x24')]({'where':{'type':_0x4dafc5,'resourceId':_0x324e30['id']}})[_0x091f('0x25')](function(){return _0x26a9c7;});})[_0x091f('0x25')](function(){_0x21f72f['status'](0xcc)[_0x091f('0x1a')]();});}};}function handleEntityNotFound(_0x38e5f1,_0x285f36){return function(_0x1b32d5){if(!_0x1b32d5){_0x38e5f1['sendStatus'](0x194);}return _0x1b32d5;};}function handleError(_0x3233b8,_0x4927a2){_0x4927a2=_0x4927a2||0x1f4;return function(_0x19f5d5){logger['error'](_0x19f5d5['stack']);if(_0x19f5d5[_0x091f('0x28')]){delete _0x19f5d5[_0x091f('0x28')];}_0x3233b8[_0x091f('0x20')](_0x4927a2)[_0x091f('0x29')](_0x19f5d5);};}exports[_0x091f('0x2a')]=function(_0x24c27f,_0x224f1d){var _0x385d21={},_0x220c6f={},_0x364541={'count':0x0,'rows':[]};var _0x48b19b=_[_0x091f('0x2b')](db[_0x091f('0x2c')][_0x091f('0x2d')],function(_0x22b8f7){return{'name':_0x22b8f7['fieldName'],'type':_0x22b8f7[_0x091f('0x2e')]['key']};});_0x220c6f[_0x091f('0x2f')]=_['map'](_0x48b19b,_0x091f('0x28'));_0x220c6f[_0x091f('0x30')]=_[_0x091f('0x31')](_0x24c27f['query']);_0x220c6f['filters']=_[_0x091f('0x32')](_0x220c6f['model'],_0x220c6f[_0x091f('0x30')]);_0x385d21['attributes']=_[_0x091f('0x32')](_0x220c6f['model'],qs[_0x091f('0x33')](_0x24c27f[_0x091f('0x30')][_0x091f('0x33')]));_0x385d21[_0x091f('0x34')]=_0x385d21[_0x091f('0x34')][_0x091f('0x35')]?_0x385d21[_0x091f('0x34')]:_0x220c6f[_0x091f('0x2f')];if(!_0x24c27f[_0x091f('0x30')]['hasOwnProperty'](_0x091f('0x36'))){_0x385d21[_0x091f('0x1d')]=qs['limit'](_0x24c27f[_0x091f('0x30')][_0x091f('0x1d')]);_0x385d21[_0x091f('0x1f')]=qs[_0x091f('0x1f')](_0x24c27f[_0x091f('0x30')][_0x091f('0x1f')]);}_0x385d21[_0x091f('0x37')]=qs[_0x091f('0x38')](_0x24c27f[_0x091f('0x30')][_0x091f('0x38')]);_0x385d21[_0x091f('0x39')]=qs['filters'](_['pick'](_0x24c27f[_0x091f('0x30')],_0x220c6f['filters']),_0x48b19b);if(_0x24c27f[_0x091f('0x30')][_0x091f('0x3a')]){_0x385d21[_0x091f('0x39')]=_[_0x091f('0x3b')](_0x385d21['where'],{'$or':_[_0x091f('0x2b')](_0x48b19b,function(_0x5a994b){if(_0x5a994b[_0x091f('0x2e')]!=='VIRTUAL'){var _0x37c29a={};_0x37c29a[_0x5a994b['name']]={'$like':'%'+_0x24c27f[_0x091f('0x30')][_0x091f('0x3a')]+'%'};return _0x37c29a;}})});}_0x385d21=_[_0x091f('0x3b')]({},_0x385d21,_0x24c27f['options']);var _0x47738e={'where':_0x385d21[_0x091f('0x39')]};return db['FaxQueue']['count'](_0x47738e)[_0x091f('0x25')](function(_0x445032){_0x364541[_0x091f('0x1e')]=_0x445032;if(_0x24c27f[_0x091f('0x30')][_0x091f('0x3c')]){_0x385d21[_0x091f('0x3d')]=[{'all':!![]}];}return db['FaxQueue'][_0x091f('0x3e')](_0x385d21);})['then'](function(_0x9aefd3){_0x364541[_0x091f('0x3f')]=_0x9aefd3;return _0x364541;})[_0x091f('0x25')](respondWithFilteredResult(_0x224f1d,_0x385d21))[_0x091f('0x40')](handleError(_0x224f1d,null));};exports[_0x091f('0x41')]=function(_0x71276a,_0x234500){var _0x5b9cd9={'raw':!![],'where':{'id':_0x71276a['params']['id']}},_0x3c20be={};_0x3c20be[_0x091f('0x2f')]=_['keys'](db[_0x091f('0x2c')]['rawAttributes']);_0x3c20be[_0x091f('0x30')]=_['keys'](_0x71276a[_0x091f('0x30')]);_0x3c20be['filters']=_[_0x091f('0x32')](_0x3c20be[_0x091f('0x2f')],_0x3c20be[_0x091f('0x30')]);_0x5b9cd9[_0x091f('0x34')]=_[_0x091f('0x32')](_0x3c20be[_0x091f('0x2f')],qs['fields'](_0x71276a[_0x091f('0x30')][_0x091f('0x33')]));_0x5b9cd9[_0x091f('0x34')]=_0x5b9cd9[_0x091f('0x34')]['length']?_0x5b9cd9['attributes']:_0x3c20be[_0x091f('0x2f')];if(_0x71276a['query'][_0x091f('0x3c')]){_0x5b9cd9[_0x091f('0x3d')]=[{'all':!![]}];}_0x5b9cd9=_[_0x091f('0x3b')]({},_0x5b9cd9,_0x71276a[_0x091f('0x42')]);return db['FaxQueue']['find'](_0x5b9cd9)['then'](handleEntityNotFound(_0x234500,null))[_0x091f('0x25')](respondWithResult(_0x234500,null))[_0x091f('0x40')](handleError(_0x234500,null));};exports[_0x091f('0x43')]=function(_0x3c8777,_0x50ac0a){return db[_0x091f('0x2c')][_0x091f('0x43')](_0x3c8777[_0x091f('0x44')],{})[_0x091f('0x25')](function(_0x4eeb8b){var _0x4f88bf=_0x3c8777['user']['get']({'plain':!![]});if(!_0x4f88bf)throw new Error(_0x091f('0x45'));if(_0x4f88bf[_0x091f('0x46')]===_0x091f('0x47')){var _0x346d0e=_0x4eeb8b[_0x091f('0x48')]({'plain':!![]});var _0x151b82=_0x091f('0x26');return db['UserProfileSection'][_0x091f('0x49')]({'where':{'name':_0x151b82,'userProfileId':_0x4f88bf[_0x091f('0x4a')]},'raw':!![]})[_0x091f('0x25')](function(_0x453b9c){if(_0x453b9c&&_0x453b9c[_0x091f('0x4b')]===0x0){return db[_0x091f('0x27')][_0x091f('0x43')]({'name':_0x346d0e[_0x091f('0x28')],'resourceId':_0x346d0e['id'],'type':_0x453b9c['name'],'sectionId':_0x453b9c['id']},{})['then'](function(){return _0x4eeb8b;});}else{return _0x4eeb8b;}})[_0x091f('0x40')](function(_0x72dd89){logger[_0x091f('0x4c')](_0x091f('0x4d'),_0x72dd89);throw _0x72dd89;});}return _0x4eeb8b;})[_0x091f('0x25')](respondWithResult(_0x50ac0a,0xc9))[_0x091f('0x40')](handleError(_0x50ac0a,null));};exports[_0x091f('0x23')]=function(_0x56a7a5,_0x147692){if(_0x56a7a5[_0x091f('0x44')]['id']){delete _0x56a7a5[_0x091f('0x44')]['id'];}return db[_0x091f('0x2c')][_0x091f('0x49')]({'where':{'id':_0x56a7a5['params']['id']}})[_0x091f('0x25')](handleEntityNotFound(_0x147692,null))[_0x091f('0x25')](saveUpdates(_0x56a7a5['body'],null))[_0x091f('0x25')](respondWithResult(_0x147692,null))[_0x091f('0x40')](handleError(_0x147692,null));};exports['destroy']=function(_0x59f4df,_0xe1e4c5){return db['FaxQueue'][_0x091f('0x49')]({'where':{'id':_0x59f4df[_0x091f('0x4e')]['id']}})[_0x091f('0x25')](handleEntityNotFound(_0xe1e4c5,null))[_0x091f('0x25')](removeEntity(_0xe1e4c5,null))['catch'](handleError(_0xe1e4c5,null));};exports['describe']=function(_0x14ca6d,_0x3bdffd){return db['FaxQueue']['describe']()['then'](respondWithResult(_0x3bdffd,null))[_0x091f('0x40')](handleError(_0x3bdffd,null));};exports[_0x091f('0x4f')]=function(_0x23dd7b,_0x215897,_0x23ea30){var _0x26b2e5={'raw':!![],'where':{}},_0x17eef9={},_0x36fdac;return db['FaxQueue'][_0x091f('0x50')]({'where':{'id':_0x23dd7b[_0x091f('0x4e')]['id']}})[_0x091f('0x25')](handleEntityNotFound(_0x215897,null))[_0x091f('0x25')](function(_0x559a6c){if(_0x559a6c){_0x36fdac=_0x559a6c['get']({'plain':!![]});_0x17eef9[_0x091f('0x2f')]=_[_0x091f('0x31')](db[_0x091f('0x51')][_0x091f('0x2d')]);_0x17eef9[_0x091f('0x30')]=_['keys'](_0x23dd7b['query']);_0x17eef9['filters']=_[_0x091f('0x32')](_0x17eef9[_0x091f('0x2f')],_0x17eef9[_0x091f('0x30')]);_0x26b2e5[_0x091f('0x34')]=_[_0x091f('0x32')](_0x17eef9[_0x091f('0x2f')],qs[_0x091f('0x33')](_0x23dd7b['query']['fields']));_0x26b2e5[_0x091f('0x34')]=_0x26b2e5[_0x091f('0x34')][_0x091f('0x35')]?_0x26b2e5[_0x091f('0x34')]:_0x17eef9['model'];if(!_0x23dd7b[_0x091f('0x30')][_0x091f('0x52')](_0x091f('0x36'))){_0x26b2e5[_0x091f('0x1d')]=qs[_0x091f('0x1d')](_0x23dd7b['query'][_0x091f('0x1d')]);_0x26b2e5['offset']=qs[_0x091f('0x1f')](_0x23dd7b[_0x091f('0x30')][_0x091f('0x1f')]);}_0x26b2e5[_0x091f('0x37')]=qs[_0x091f('0x38')](_0x23dd7b[_0x091f('0x30')][_0x091f('0x38')]);_0x26b2e5['where']=qs[_0x091f('0x53')](_[_0x091f('0x54')](_0x23dd7b[_0x091f('0x30')],_0x17eef9[_0x091f('0x53')]));_0x26b2e5[_0x091f('0x39')]['FaxQueueId']=_0x559a6c['id'];if(_0x23dd7b[_0x091f('0x30')][_0x091f('0x3a')]){_0x26b2e5[_0x091f('0x39')]=_[_0x091f('0x3b')](_0x26b2e5[_0x091f('0x39')],{'$or':_['map'](_0x26b2e5[_0x091f('0x34')],function(_0x456449){var _0x5c0a74={};_0x5c0a74[_0x456449]={'$like':'%'+_0x23dd7b[_0x091f('0x30')]['filter']+'%'};return _0x5c0a74;})});}_0x26b2e5=_[_0x091f('0x3b')]({},_0x26b2e5,_0x23dd7b[_0x091f('0x42')]);return db[_0x091f('0x51')]['findAll'](_0x26b2e5);}})['then'](function(_0x3ca3a1){if(_0x3ca3a1){return db[_0x091f('0x55')][_0x091f('0x56')]({'where':{'id':_[_0x091f('0x2b')](_0x3ca3a1,_0x091f('0x57')),'role':_0x091f('0x58')},'attributes':['id','name',_0x091f('0x59'),'updatedAt',_0x091f('0x5a')]});}})[_0x091f('0x25')](function(_0xc70531){if(_0xc70531){return{'count':_0xc70531[_0x091f('0x1e')],'rows':_['map'](_0xc70531[_0x091f('0x3f')],function(_0x2ec5ee){return{'membername':_0x2ec5ee[_0x091f('0x28')],'UserId':_0x2ec5ee['id'],'queue_name':_0x36fdac[_0x091f('0x28')],'FaxQueueId':_0x36fdac['id'],'interface':util[_0x091f('0x5b')](_0x091f('0x5c'),_0x091f('0x5d'),_0x2ec5ee[_0x091f('0x28')]),'penalty':0x0,'paused':_0x2ec5ee['faxPause'],'createdAt':_0x2ec5ee[_0x091f('0x5a')],'updatedAt':_0x2ec5ee[_0x091f('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x091f('0x25')](respondWithFilteredResult(_0x215897,_0x26b2e5))[_0x091f('0x40')](handleError(_0x215897,null));};exports[_0x091f('0x5f')]=function(_0x2a5874,_0x1ffe06,_0x594bb2){var _0x12f653={};var _0x461d45={};var _0x197475;var _0x3ac64f;return db['FaxQueue'][_0x091f('0x50')]({'where':{'id':_0x2a5874[_0x091f('0x4e')]['id']}})[_0x091f('0x25')](handleEntityNotFound(_0x1ffe06,null))[_0x091f('0x25')](function(_0x41e497){if(_0x41e497){_0x197475=_0x41e497;_0x461d45[_0x091f('0x2f')]=_['keys'](db[_0x091f('0x60')][_0x091f('0x2d')]);_0x461d45[_0x091f('0x30')]=_[_0x091f('0x31')](_0x2a5874[_0x091f('0x30')]);_0x461d45[_0x091f('0x53')]=_[_0x091f('0x32')](_0x461d45[_0x091f('0x2f')],_0x461d45[_0x091f('0x30')]);_0x12f653[_0x091f('0x34')]=_[_0x091f('0x32')](_0x461d45['model'],qs[_0x091f('0x33')](_0x2a5874[_0x091f('0x30')][_0x091f('0x33')]));_0x12f653[_0x091f('0x34')]=_0x12f653[_0x091f('0x34')]['length']?_0x12f653[_0x091f('0x34')]:_0x461d45[_0x091f('0x2f')];_0x12f653['order']=qs[_0x091f('0x38')](_0x2a5874[_0x091f('0x30')]['sort']);_0x12f653[_0x091f('0x39')]=qs['filters'](_[_0x091f('0x54')](_0x2a5874['query'],_0x461d45[_0x091f('0x53')]));if(_0x2a5874['query'][_0x091f('0x3a')]){_0x12f653[_0x091f('0x39')]=_[_0x091f('0x3b')](_0x12f653[_0x091f('0x39')],{'$or':_[_0x091f('0x2b')](_0x12f653[_0x091f('0x34')],function(_0x47d086){var _0x440154={};_0x440154[_0x47d086]={'$like':'%'+_0x2a5874[_0x091f('0x30')][_0x091f('0x3a')]+'%'};return _0x440154;})});}_0x12f653=_[_0x091f('0x3b')]({},_0x12f653,_0x2a5874[_0x091f('0x42')]);return _0x197475[_0x091f('0x5f')](_0x12f653);}})[_0x091f('0x25')](function(_0x52efe9){if(_0x52efe9){_0x3ac64f=_0x52efe9['length'];if(!_0x2a5874['query'][_0x091f('0x52')](_0x091f('0x36'))){_0x12f653['limit']=qs['limit'](_0x2a5874[_0x091f('0x30')][_0x091f('0x1d')]);_0x12f653[_0x091f('0x1f')]=qs[_0x091f('0x1f')](_0x2a5874[_0x091f('0x30')]['offset']);}return _0x197475[_0x091f('0x5f')](_0x12f653);}})[_0x091f('0x25')](function(_0x99467d){if(_0x99467d){return _0x99467d?{'count':_0x3ac64f,'rows':_0x99467d}:null;}})[_0x091f('0x25')](respondWithResult(_0x1ffe06,null))['catch'](handleError(_0x1ffe06,null));};exports['addTeams']=function(_0xa72191,_0x1010e8,_0x675faf){var _0x534362=_0xa72191[_0x091f('0x44')][_0x091f('0x61')];return db[_0x091f('0x60')]['findAll']({'where':{'id':_0x534362},'attributes':['id'],'include':[{'model':db['User'],'as':_0x091f('0x62'),'attributes':['id',_0x091f('0x28'),_0x091f('0x63'),_0x091f('0x64'),_0x091f('0x65')],'raw':!![]}]})[_0x091f('0x25')](function(_0x53c42b){if(_0x53c42b){var _0x2db215=_[_0x091f('0x66')](_0x53c42b,function(_0x488496){var _0x46fb36=_0x488496[_0x091f('0x48')]({'plain':!![]});return _0x46fb36[_0x091f('0x62')];});return db[_0x091f('0x2c')][_0x091f('0x49')]({'where':{'id':_0xa72191[_0x091f('0x4e')]['id']}})[_0x091f('0x25')](function(_0x421ec){return db[_0x091f('0x67')][_0x091f('0x68')](function(_0x1f092c){return _0x421ec['addTeams'](_0x534362,{'transaction':_0x1f092c})['then'](function(){return BPromise[_0x091f('0x69')](_0x2db215,function(_0x4870fa){return db[_0x091f('0x51')]['findOrCreate']({'where':{'UserId':_0x4870fa['id'],'FaxQueueId':_0xa72191['params']['id']},'transaction':_0x1f092c});});})[_0x091f('0x25')](function(){_0x2db215['forEach'](function(_0x58336c){socket[_0x091f('0x6a')]('userFaxQueue:save',{'UserId':_0x58336c['id'],'FaxQueueId':_0x421ec['id']});});});});});}})[_0x091f('0x25')](respondWithStatusCode(_0x1010e8,null))[_0x091f('0x40')](handleError(_0x1010e8,null));};exports[_0x091f('0x6b')]=function(_0x5648b3,_0x5b8524,_0x26e031){return db[_0x091f('0x60')][_0x091f('0x3e')]({'where':{'id':_0x5648b3[_0x091f('0x30')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x091f('0x62'),'attributes':['id'],'raw':!![]}]})[_0x091f('0x25')](handleEntityNotFound(_0x5b8524,null))[_0x091f('0x25')](function(_0x323136){var _0x168fcf=_[_0x091f('0x2b')](_0x323136,'id');var _0x389690=[];var _0x54b0e5=[];var _0x1cd2c8=squel[_0x091f('0x6c')]();_0x1cd2c8[_0x091f('0x6d')](_0x091f('0x6e'))['from']('team_has_fax_queues','tq')[_0x091f('0x6f')](_0x091f('0x70'),'ut',_0x091f('0x71'))[_0x091f('0x39')]('FaxQueueId\x20=\x20?',_0x5648b3['params']['id']);for(var _0x31f05d=0x0;_0x31f05d<_0x323136[_0x091f('0x35')];_0x31f05d+=0x1){let _0x4a2c65=_0x323136[_0x31f05d];for(var _0x575dff=0x0;_0x575dff<_0x4a2c65['Agents']['length'];_0x575dff+=0x1){let _0x12b7a5=_0x4a2c65['Agents'][_0x575dff];var _0x487312=_0x1cd2c8['clone']();_0x487312[_0x091f('0x39')](_0x091f('0x72'),_0x12b7a5['id']);_0x54b0e5['push'](db['sequelize']['query'](_0x487312['toString'](),{'type':db[_0x091f('0x67')]['QueryTypes'][_0x091f('0x73')]})[_0x091f('0x25')](function(_0x642eb3){if(_0x642eb3[_0x091f('0x35')]===0x1){return _0x12b7a5['id'];}else{var _0x3cd112=_[_0x091f('0x74')](_['map'](_0x642eb3,_0x091f('0x75')),function(_0x5a3a37){return _[_0x091f('0x76')](_0x168fcf,_0x5a3a37);});if(_0x3cd112){return _0x12b7a5['id'];}}}));}}return BPromise['all'](_0x54b0e5)[_0x091f('0x25')](function(_0x39920e){_0x389690=_(_0x389690)['union'](_0x39920e)[_0x091f('0x77')]()[_0x091f('0x78')]();return db[_0x091f('0x2c')][_0x091f('0x49')]({'where':{'id':_0x5648b3[_0x091f('0x4e')]['id']}})[_0x091f('0x25')](function(_0x4eaf3b){return db[_0x091f('0x67')][_0x091f('0x68')](function(_0x2d9652){return _0x4eaf3b[_0x091f('0x6b')](_0x5648b3[_0x091f('0x30')][_0x091f('0x61')],{'transaction':_0x2d9652})[_0x091f('0x25')](function(){if(!_[_0x091f('0x79')](_0x389690)){return _0x4eaf3b['removeAgents'](_0x389690,{'transaction':_0x2d9652});}})['then'](function(){_0x389690['forEach'](function(_0x42291f){socket['emit']('userFaxQueue:remove',{'UserId':_0x42291f,'FaxQueueId':_0x4eaf3b['id']});});});});});});})[_0x091f('0x25')](respondWithStatusCode(_0x5b8524,null))[_0x091f('0x40')](handleError(_0x5b8524,null));};exports[_0x091f('0x7a')]=function(_0x64f59a,_0x52195e,_0xbf85a6){return db['FaxQueue'][_0x091f('0x49')]({'where':{'id':_0x64f59a[_0x091f('0x4e')]['id']}})[_0x091f('0x25')](handleEntityNotFound(_0x52195e,null))[_0x091f('0x25')](function(_0xb31f8d){if(_0xb31f8d){return _0xb31f8d['addAgents'](_0x64f59a[_0x091f('0x44')][_0x091f('0x61')],_[_0x091f('0x7b')](_0x64f59a[_0x091f('0x44')],['ids','id'])||{})['spread'](function(_0x435ebd){for(var _0x45a5c7=0x0;_0x45a5c7<_0x64f59a[_0x091f('0x44')][_0x091f('0x61')]['length'];_0x45a5c7+=0x1){socket[_0x091f('0x6a')](_0x091f('0x7c'),{'UserId':Number(_0x64f59a[_0x091f('0x44')][_0x091f('0x61')][_0x45a5c7]),'FaxQueueId':Number(_0x64f59a[_0x091f('0x4e')]['id'])});}return _0x435ebd;});}})[_0x091f('0x25')](respondWithResult(_0x52195e,null))[_0x091f('0x40')](handleError(_0x52195e,null));};exports[_0x091f('0x7d')]=function(_0x2998b3,_0x136276,_0x4b486f){return db[_0x091f('0x2c')][_0x091f('0x49')]({'where':{'id':_0x2998b3[_0x091f('0x4e')]['id']}})[_0x091f('0x25')](handleEntityNotFound(_0x136276,null))[_0x091f('0x25')](function(_0x33f873){if(_0x33f873){return _0x33f873[_0x091f('0x7d')](_0x2998b3['query'][_0x091f('0x61')])[_0x091f('0x25')](function(){if(_[_0x091f('0x7e')](_0x2998b3[_0x091f('0x30')][_0x091f('0x61')])){for(var _0x14c37f=0x0;_0x14c37f<_0x2998b3[_0x091f('0x30')][_0x091f('0x61')][_0x091f('0x35')];_0x14c37f+=0x1){socket[_0x091f('0x6a')]('userFaxQueue:remove',{'UserId':Number(_0x2998b3['query']['ids'][_0x14c37f]),'FaxQueueId':Number(_0x2998b3[_0x091f('0x4e')]['id'])});}}else{socket[_0x091f('0x6a')](_0x091f('0x7f'),{'UserId':Number(_0x2998b3[_0x091f('0x30')]['ids']),'FaxQueueId':Number(_0x2998b3[_0x091f('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x136276,null))[_0x091f('0x40')](handleError(_0x136276,null));};exports['getAgents']=function(_0x100b52,_0x13500b,_0x492882){var _0xb9e947={};var _0xfa12a0={};var _0x10ac74;var _0x4a0fa0;return db[_0x091f('0x2c')][_0x091f('0x50')]({'where':{'id':_0x100b52[_0x091f('0x4e')]['id']}})[_0x091f('0x25')](handleEntityNotFound(_0x13500b,null))[_0x091f('0x25')](function(_0x34d97f){if(_0x34d97f){_0x10ac74=_0x34d97f;_0xfa12a0[_0x091f('0x2f')]=_[_0x091f('0x31')](db[_0x091f('0x55')]['rawAttributes']);_0xfa12a0[_0x091f('0x30')]=_[_0x091f('0x31')](_0x100b52['query']);_0xfa12a0[_0x091f('0x53')]=_['intersection'](_0xfa12a0[_0x091f('0x2f')],_0xfa12a0[_0x091f('0x30')]);_0xb9e947[_0x091f('0x34')]=_[_0x091f('0x32')](_0xfa12a0[_0x091f('0x2f')],qs[_0x091f('0x33')](_0x100b52[_0x091f('0x30')][_0x091f('0x33')]));_0xb9e947[_0x091f('0x34')]=_0xb9e947['attributes'][_0x091f('0x35')]?_0xb9e947[_0x091f('0x34')]:_0xfa12a0[_0x091f('0x2f')];_0xb9e947['order']=qs['sort'](_0x100b52['query'][_0x091f('0x38')]);_0xb9e947[_0x091f('0x39')]=qs[_0x091f('0x53')](_['pick'](_0x100b52[_0x091f('0x30')],_0xfa12a0[_0x091f('0x53')]));if(_0x100b52[_0x091f('0x30')]['filter']){_0xb9e947[_0x091f('0x39')]=_['merge'](_0xb9e947[_0x091f('0x39')],{'$or':_[_0x091f('0x2b')](_0xb9e947[_0x091f('0x34')],function(_0x191eaa){var _0x43302a={};_0x43302a[_0x191eaa]={'$like':'%'+_0x100b52[_0x091f('0x30')][_0x091f('0x3a')]+'%'};return _0x43302a;})});}_0xb9e947=_[_0x091f('0x3b')]({},_0xb9e947,_0x100b52[_0x091f('0x42')]);return _0x10ac74['getAgents'](_0xb9e947);}})[_0x091f('0x25')](function(_0x3bf944){if(_0x3bf944){_0x4a0fa0=_0x3bf944['length'];if(!_0x100b52[_0x091f('0x30')][_0x091f('0x52')](_0x091f('0x36'))){_0xb9e947[_0x091f('0x1d')]=qs[_0x091f('0x1d')](_0x100b52['query'][_0x091f('0x1d')]);_0xb9e947[_0x091f('0x1f')]=qs[_0x091f('0x1f')](_0x100b52[_0x091f('0x30')][_0x091f('0x1f')]);}return _0x10ac74[_0x091f('0x80')](_0xb9e947);}})[_0x091f('0x25')](function(_0x477306){if(_0x477306){return _0x477306?{'count':_0x4a0fa0,'rows':_0x477306}:null;}})['then'](respondWithResult(_0x13500b,null))[_0x091f('0x40')](handleError(_0x13500b,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index fb1b4e8..5cf6a50 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 _0x2471=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit'];(function(_0x26cd00,_0x4842ab){var _0x131c89=function(_0x49dfbe){while(--_0x49dfbe){_0x26cd00['push'](_0x26cd00['shift']());}};_0x131c89(++_0x4842ab);}(_0x2471,0xb3));var _0x1247=function(_0x38ae4f,_0x1d3180){_0x38ae4f=_0x38ae4f-0x0;var _0x1e92db=_0x2471[_0x38ae4f];return _0x1e92db;};'use strict';var EventEmitter=require(_0x1247('0x0'));var FaxQueue=require(_0x1247('0x1'))['db'][_0x1247('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x1247('0x3')](0x0);var events={'afterCreate':_0x1247('0x4'),'afterUpdate':_0x1247('0x5'),'afterDestroy':_0x1247('0x6')};function emitEvent(_0x3da4ab){return function(_0x5263b9,_0x1810ab,_0x126c38){FaxQueueEvents[_0x1247('0x7')](_0x3da4ab+':'+_0x5263b9['id'],_0x5263b9);FaxQueueEvents['emit'](_0x3da4ab,_0x5263b9);_0x126c38(null);};}for(var e in events){if(events[_0x1247('0x8')](e)){var event=events[e];FaxQueue[_0x1247('0x9')](e,emitEvent(event));}}module[_0x1247('0xa')]=FaxQueueEvents; \ No newline at end of file +var _0x125a=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','update'];(function(_0x6d2d32,_0x15e9a4){var _0x5ec8d7=function(_0x5b23a7){while(--_0x5b23a7){_0x6d2d32['push'](_0x6d2d32['shift']());}};_0x5ec8d7(++_0x15e9a4);}(_0x125a,0x1e5));var _0xa125=function(_0x3f9f9d,_0x923a36){_0x3f9f9d=_0x3f9f9d-0x0;var _0x3f9fc9=_0x125a[_0x3f9f9d];return _0x3f9fc9;};'use strict';var EventEmitter=require(_0xa125('0x0'));var FaxQueue=require(_0xa125('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa125('0x2'),'afterDestroy':_0xa125('0x3')};function emitEvent(_0x508d81){return function(_0x3996e8,_0xe2b956,_0x2983b2){FaxQueueEvents[_0xa125('0x4')](_0x508d81+':'+_0x3996e8['id'],_0x3996e8);FaxQueueEvents[_0xa125('0x4')](_0x508d81,_0x3996e8);_0x2983b2(null);};}for(var e in events){if(events[_0xa125('0x5')](e)){var event=events[e];FaxQueue[_0xa125('0x6')](e,emitEvent(event));}}module[_0xa125('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 521fbfc..01a6bee 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 _0x6db8=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','../../config/logger','api','moment','request-promise'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0x6db8,0xc7));var _0x86db=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0x6db8[_0x561771];return _0x54d16e;};'use strict';var _=require(_0x86db('0x0'));var util=require('util');var logger=require(_0x86db('0x1'))(_0x86db('0x2'));var moment=require(_0x86db('0x3'));var BPromise=require('bluebird');var rp=require(_0x86db('0x4'));var fs=require('fs');var path=require(_0x86db('0x5'));var rimraf=require(_0x86db('0x6'));var config=require(_0x86db('0x7'));var attributes=require(_0x86db('0x8'));module[_0x86db('0x9')]=function(_0x4f92c9,_0x52a57a){return _0x4f92c9[_0x86db('0xa')]('FaxQueue',attributes,{'tableName':_0x86db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdab=['fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxQueue.attributes','FaxQueue'];(function(_0x2f5361,_0x3b30bd){var _0x1bee07=function(_0x1e5753){while(--_0x1e5753){_0x2f5361['push'](_0x2f5361['shift']());}};_0x1bee07(++_0x3b30bd);}(_0xfdab,0xcd));var _0xbfda=function(_0x3093fd,_0x22a601){_0x3093fd=_0x3093fd-0x0;var _0x490262=_0xfdab[_0x3093fd];return _0x490262;};'use strict';var _=require(_0xbfda('0x0'));var util=require(_0xbfda('0x1'));var logger=require(_0xbfda('0x2'))(_0xbfda('0x3'));var moment=require(_0xbfda('0x4'));var BPromise=require(_0xbfda('0x5'));var rp=require(_0xbfda('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbfda('0x7'));var config=require(_0xbfda('0x8'));var attributes=require(_0xbfda('0x9'));module['exports']=function(_0x11b092,_0x22e82e){return _0x11b092['define'](_0xbfda('0xa'),attributes,{'tableName':_0xbfda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 7549f43..2e0b491 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 _0xf6b6=['defaults','localhost','socket.io-emitter','then','info','debug','request\x20sent','stringify','error','FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x11d541,_0xc8fe9){var _0x3e612a=function(_0x4f5e9d){while(--_0x4f5e9d){_0x11d541['push'](_0x11d541['shift']());}};_0x3e612a(++_0xc8fe9);}(_0xf6b6,0x18b));var _0x6f6b=function(_0x4f302f,_0x3a670e){_0x4f302f=_0x4f302f-0x0;var _0x1c95e9=_0xf6b6[_0x4f302f];return _0x1c95e9;};'use strict';var _=require(_0x6f6b('0x0'));var util=require(_0x6f6b('0x1'));var moment=require(_0x6f6b('0x2'));var BPromise=require(_0x6f6b('0x3'));var rs=require(_0x6f6b('0x4'));var fs=require('fs');var Redis=require(_0x6f6b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6f6b('0x6'));var config=require(_0x6f6b('0x7'));var jayson=require(_0x6f6b('0x8'));var client=jayson[_0x6f6b('0x9')][_0x6f6b('0xa')]({'port':0x232a});config[_0x6f6b('0xb')]=_[_0x6f6b('0xc')](config[_0x6f6b('0xb')],{'host':_0x6f6b('0xd'),'port':0x18eb});var socket=require(_0x6f6b('0xe'))(new Redis(config[_0x6f6b('0xb')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3b3f15,_0x1672d8,_0x23c0d3){return new BPromise(function(_0x24b0ae,_0xe1eb3d){return client['request'](_0x3b3f15,_0x23c0d3)[_0x6f6b('0xf')](function(_0x54fc53){logger[_0x6f6b('0x10')]('FaxQueue,\x20%s,\x20%s',_0x1672d8,'request\x20sent');logger[_0x6f6b('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x1672d8,_0x6f6b('0x12'),JSON[_0x6f6b('0x13')](_0x54fc53));if(_0x54fc53[_0x6f6b('0x14')]){if(_0x54fc53['error']['code']===0x1f4){logger['error'](_0x6f6b('0x15'),_0x1672d8,_0x54fc53[_0x6f6b('0x14')][_0x6f6b('0x16')]);return _0xe1eb3d(_0x54fc53[_0x6f6b('0x14')]['message']);}logger[_0x6f6b('0x14')]('FaxQueue,\x20%s,\x20%s',_0x1672d8,_0x54fc53[_0x6f6b('0x14')][_0x6f6b('0x16')]);return _0x24b0ae(_0x54fc53[_0x6f6b('0x14')][_0x6f6b('0x16')]);}else{logger[_0x6f6b('0x10')](_0x6f6b('0x15'),_0x1672d8,'request\x20sent');_0x24b0ae(_0x54fc53['result'][_0x6f6b('0x16')]);}})[_0x6f6b('0x17')](function(_0x664c61){logger[_0x6f6b('0x14')]('FaxQueue,\x20%s,\x20%s',_0x1672d8,_0x664c61);_0xe1eb3d(_0x664c61);});});}exports[_0x6f6b('0x18')]=function(_0x4dd269){var _0x5a3875=this;return new Promise(function(_0x51725a,_0x1fe942){return db[_0x6f6b('0x19')][_0x6f6b('0x1a')]({'raw':_0x4dd269[_0x6f6b('0x1b')]?_0x4dd269[_0x6f6b('0x1b')][_0x6f6b('0x1c')]===undefined?!![]:![]:!![],'where':_0x4dd269[_0x6f6b('0x1b')]?_0x4dd269[_0x6f6b('0x1b')][_0x6f6b('0x1d')]||null:null,'attributes':_0x4dd269[_0x6f6b('0x1b')]?_0x4dd269[_0x6f6b('0x1b')][_0x6f6b('0x1e')]||null:null,'limit':_0x4dd269[_0x6f6b('0x1b')]?_0x4dd269[_0x6f6b('0x1b')][_0x6f6b('0x1f')]||null:null,'include':_0x4dd269[_0x6f6b('0x1b')]?_0x4dd269[_0x6f6b('0x1b')][_0x6f6b('0x20')]?_[_0x6f6b('0x21')](_0x4dd269[_0x6f6b('0x1b')][_0x6f6b('0x20')],function(_0x3f34a0){return{'model':db[_0x3f34a0[_0x6f6b('0x22')]],'as':_0x3f34a0['as'],'attributes':_0x3f34a0[_0x6f6b('0x1e')],'include':_0x3f34a0[_0x6f6b('0x20')]?_[_0x6f6b('0x21')](_0x3f34a0[_0x6f6b('0x20')],function(_0x36404d){return{'model':db[_0x36404d[_0x6f6b('0x22')]],'as':_0x36404d['as'],'attributes':_0x36404d[_0x6f6b('0x1e')],'include':_0x36404d[_0x6f6b('0x20')]?_[_0x6f6b('0x21')](_0x36404d[_0x6f6b('0x20')],function(_0x236273){return{'model':db[_0x236273['model']],'as':_0x236273['as'],'attributes':_0x236273[_0x6f6b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6f6b('0xf')](function(_0x26011a){logger[_0x6f6b('0x10')](_0x6f6b('0x18'),_0x4dd269);logger['debug'](_0x6f6b('0x18'),_0x4dd269,JSON['stringify'](_0x26011a));_0x51725a(_0x26011a);})[_0x6f6b('0x17')](function(_0x225110){logger[_0x6f6b('0x14')](_0x6f6b('0x18'),_0x225110['message'],_0x4dd269);_0x1fe942(_0x5a3875[_0x6f6b('0x14')](0x1f4,_0x225110[_0x6f6b('0x16')]));});});};exports[_0x6f6b('0x23')]=function(_0x3ff543){var _0x328998=this;return new Promise(function(_0x19f4c2,_0x4420b9){return db['FaxQueue'][_0x6f6b('0x24')]({'raw':_0x3ff543[_0x6f6b('0x1b')]?_0x3ff543[_0x6f6b('0x1b')][_0x6f6b('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ff543['options']?_0x3ff543[_0x6f6b('0x1b')][_0x6f6b('0x1d')]||null:null,'attributes':_0x3ff543[_0x6f6b('0x1b')]?_0x3ff543[_0x6f6b('0x1b')][_0x6f6b('0x1e')]||null:null,'include':_0x3ff543[_0x6f6b('0x1b')]?_0x3ff543[_0x6f6b('0x1b')][_0x6f6b('0x20')]?_[_0x6f6b('0x21')](_0x3ff543[_0x6f6b('0x1b')][_0x6f6b('0x20')],function(_0x48a2cd){return{'model':db[_0x48a2cd['model']],'as':_0x48a2cd['as'],'attributes':_0x48a2cd['attributes'],'include':_0x48a2cd['include']?_['map'](_0x48a2cd[_0x6f6b('0x20')],function(_0x4db885){return{'model':db[_0x4db885[_0x6f6b('0x22')]],'as':_0x4db885['as'],'attributes':_0x4db885[_0x6f6b('0x1e')],'include':_0x4db885[_0x6f6b('0x20')]?_[_0x6f6b('0x21')](_0x4db885[_0x6f6b('0x20')],function(_0x42180b){return{'model':db[_0x42180b[_0x6f6b('0x22')]],'as':_0x42180b['as'],'attributes':_0x42180b['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f6b('0xf')](function(_0xd27e90){logger[_0x6f6b('0x10')](_0x6f6b('0x23'),_0x3ff543);logger[_0x6f6b('0x11')](_0x6f6b('0x23'),_0x3ff543,JSON['stringify'](_0xd27e90));_0x19f4c2(_0xd27e90);})[_0x6f6b('0x17')](function(_0x1f5d75){logger[_0x6f6b('0x14')](_0x6f6b('0x23'),_0x1f5d75[_0x6f6b('0x16')],_0x3ff543);_0x4420b9(_0x328998[_0x6f6b('0x14')](0x1f4,_0x1f5d75[_0x6f6b('0x16')]));});});}; \ No newline at end of file +var _0x4652=['raw','options','where','attributes','limit','map','include','model','GetFaxQueue','debug','ShowFaxQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueue,\x20%s,\x20%s','request\x20sent','result','catch','FaxQueue','findAll'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0x4652,0x153));var _0x2465=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4652[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x2465('0x0'));var util=require(_0x2465('0x1'));var moment=require(_0x2465('0x2'));var BPromise=require(_0x2465('0x3'));var rs=require(_0x2465('0x4'));var fs=require('fs');var Redis=require(_0x2465('0x5'));var db=require(_0x2465('0x6'))['db'];var utils=require(_0x2465('0x7'));var logger=require(_0x2465('0x8'))('rpc');var config=require(_0x2465('0x9'));var jayson=require(_0x2465('0xa'));var client=jayson[_0x2465('0xb')][_0x2465('0xc')]({'port':0x232a});config[_0x2465('0xd')]=_['defaults'](config['redis'],{'host':_0x2465('0xe'),'port':0x18eb});var socket=require(_0x2465('0xf'))(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x431ffc,_0x286624,_0x3e74c2){return new BPromise(function(_0x408544,_0x37e30e){return client[_0x2465('0x10')](_0x431ffc,_0x3e74c2)[_0x2465('0x11')](function(_0x2e059d){logger[_0x2465('0x12')]('FaxQueue,\x20%s,\x20%s',_0x286624,'request\x20sent');logger['debug'](_0x2465('0x13'),_0x286624,'request\x20sent',JSON[_0x2465('0x14')](_0x2e059d));if(_0x2e059d[_0x2465('0x15')]){if(_0x2e059d[_0x2465('0x15')][_0x2465('0x16')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x286624,_0x2e059d[_0x2465('0x15')][_0x2465('0x17')]);return _0x37e30e(_0x2e059d[_0x2465('0x15')][_0x2465('0x17')]);}logger[_0x2465('0x15')](_0x2465('0x18'),_0x286624,_0x2e059d[_0x2465('0x15')][_0x2465('0x17')]);return _0x408544(_0x2e059d['error']['message']);}else{logger['info'](_0x2465('0x18'),_0x286624,_0x2465('0x19'));_0x408544(_0x2e059d[_0x2465('0x1a')][_0x2465('0x17')]);}})[_0x2465('0x1b')](function(_0x3b56f7){logger[_0x2465('0x15')](_0x2465('0x18'),_0x286624,_0x3b56f7);_0x37e30e(_0x3b56f7);});});}exports['GetFaxQueue']=function(_0x48db6c){var _0x14a31f=this;return new Promise(function(_0x5976ac,_0x35d4b7){return db[_0x2465('0x1c')][_0x2465('0x1d')]({'raw':_0x48db6c['options']?_0x48db6c['options'][_0x2465('0x1e')]===undefined?!![]:![]:!![],'where':_0x48db6c[_0x2465('0x1f')]?_0x48db6c['options'][_0x2465('0x20')]||null:null,'attributes':_0x48db6c[_0x2465('0x1f')]?_0x48db6c[_0x2465('0x1f')][_0x2465('0x21')]||null:null,'limit':_0x48db6c[_0x2465('0x1f')]?_0x48db6c[_0x2465('0x1f')][_0x2465('0x22')]||null:null,'include':_0x48db6c[_0x2465('0x1f')]?_0x48db6c[_0x2465('0x1f')]['include']?_[_0x2465('0x23')](_0x48db6c[_0x2465('0x1f')][_0x2465('0x24')],function(_0x3b5e37){return{'model':db[_0x3b5e37['model']],'as':_0x3b5e37['as'],'attributes':_0x3b5e37['attributes'],'include':_0x3b5e37[_0x2465('0x24')]?_[_0x2465('0x23')](_0x3b5e37[_0x2465('0x24')],function(_0x2e14cf){return{'model':db[_0x2e14cf[_0x2465('0x25')]],'as':_0x2e14cf['as'],'attributes':_0x2e14cf[_0x2465('0x21')],'include':_0x2e14cf[_0x2465('0x24')]?_[_0x2465('0x23')](_0x2e14cf[_0x2465('0x24')],function(_0x31e304){return{'model':db[_0x31e304[_0x2465('0x25')]],'as':_0x31e304['as'],'attributes':_0x31e304[_0x2465('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2782a0){logger['info'](_0x2465('0x26'),_0x48db6c);logger[_0x2465('0x27')](_0x2465('0x26'),_0x48db6c,JSON[_0x2465('0x14')](_0x2782a0));_0x5976ac(_0x2782a0);})[_0x2465('0x1b')](function(_0x3209ba){logger['error'](_0x2465('0x26'),_0x3209ba['message'],_0x48db6c);_0x35d4b7(_0x14a31f['error'](0x1f4,_0x3209ba[_0x2465('0x17')]));});});};exports['ShowFaxQueue']=function(_0x3b5a22){var _0x2d988e=this;return new Promise(function(_0x5b5558,_0x3debc4){return db[_0x2465('0x1c')]['find']({'raw':_0x3b5a22[_0x2465('0x1f')]?_0x3b5a22[_0x2465('0x1f')][_0x2465('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b5a22[_0x2465('0x1f')]?_0x3b5a22['options']['where']||null:null,'attributes':_0x3b5a22[_0x2465('0x1f')]?_0x3b5a22[_0x2465('0x1f')][_0x2465('0x21')]||null:null,'include':_0x3b5a22[_0x2465('0x1f')]?_0x3b5a22[_0x2465('0x1f')][_0x2465('0x24')]?_['map'](_0x3b5a22[_0x2465('0x1f')][_0x2465('0x24')],function(_0x1050bc){return{'model':db[_0x1050bc[_0x2465('0x25')]],'as':_0x1050bc['as'],'attributes':_0x1050bc[_0x2465('0x21')],'include':_0x1050bc[_0x2465('0x24')]?_['map'](_0x1050bc[_0x2465('0x24')],function(_0x4c4fc3){return{'model':db[_0x4c4fc3[_0x2465('0x25')]],'as':_0x4c4fc3['as'],'attributes':_0x4c4fc3['attributes'],'include':_0x4c4fc3[_0x2465('0x24')]?_[_0x2465('0x23')](_0x4c4fc3[_0x2465('0x24')],function(_0x5e35bf){return{'model':db[_0x5e35bf[_0x2465('0x25')]],'as':_0x5e35bf['as'],'attributes':_0x5e35bf['attributes']};}):[]};}):[]};}):[]:[]})[_0x2465('0x11')](function(_0x3e8582){logger[_0x2465('0x12')](_0x2465('0x28'),_0x3b5a22);logger[_0x2465('0x27')](_0x2465('0x28'),_0x3b5a22,JSON[_0x2465('0x14')](_0x3e8582));_0x5b5558(_0x3e8582);})[_0x2465('0x1b')](function(_0x59253c){logger[_0x2465('0x15')](_0x2465('0x28'),_0x59253c[_0x2465('0x17')],_0x3b5a22);_0x3debc4(_0x2d988e[_0x2465('0x15')](0x1f4,_0x59253c[_0x2465('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index bf328cb..a4176e4 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 _0xc928=['register','length','./faxQueue.events','save','remove','update'];(function(_0x4c29cb,_0x404c78){var _0x4ed712=function(_0xceb303){while(--_0xceb303){_0x4c29cb['push'](_0x4c29cb['shift']());}};_0x4ed712(++_0x404c78);}(_0xc928,0xe0));var _0x8c92=function(_0x277cb1,_0x35d2c8){_0x277cb1=_0x277cb1-0x0;var _0x251e25=_0xc928[_0x277cb1];return _0x251e25;};'use strict';var FaxQueueEvents=require(_0x8c92('0x0'));var events=[_0x8c92('0x1'),_0x8c92('0x2'),_0x8c92('0x3')];function createListener(_0x15d6ed,_0xcb9f8){return function(_0x414322){_0xcb9f8['emit'](_0x15d6ed,_0x414322);};}function removeListener(_0x2e3aeb,_0x3f03bf){return function(){FaxQueueEvents['removeListener'](_0x2e3aeb,_0x3f03bf);};}exports[_0x8c92('0x4')]=function(_0x142f69){for(var _0x45d083=0x0,_0x10a6fa=events[_0x8c92('0x5')];_0x45d083<_0x10a6fa;_0x45d083++){var _0x45fb0e=events[_0x45d083];var _0x3b1cb7=createListener('faxQueue:'+_0x45fb0e,_0x142f69);FaxQueueEvents['on'](_0x45fb0e,_0x3b1cb7);}}; \ No newline at end of file +var _0xbac8=['./faxQueue.events','save','length','faxQueue:'];(function(_0x81fe53,_0x5b8f05){var _0x56f7a7=function(_0x1e7846){while(--_0x1e7846){_0x81fe53['push'](_0x81fe53['shift']());}};_0x56f7a7(++_0x5b8f05);}(_0xbac8,0x140));var _0x8bac=function(_0x1ed367,_0x2bb45d){_0x1ed367=_0x1ed367-0x0;var _0x214fdb=_0xbac8[_0x1ed367];return _0x214fdb;};'use strict';var FaxQueueEvents=require(_0x8bac('0x0'));var events=[_0x8bac('0x1'),'remove','update'];function createListener(_0x9c72e9,_0x1bc048){return function(_0x333437){_0x1bc048['emit'](_0x9c72e9,_0x333437);};}function removeListener(_0x3f0076,_0x10229f){return function(){FaxQueueEvents['removeListener'](_0x3f0076,_0x10229f);};}exports['register']=function(_0x28b1d1){for(var _0x36f5b4=0x0,_0x3e95bb=events[_0x8bac('0x2')];_0x36f5b4<_0x3e95bb;_0x36f5b4++){var _0x2e6c33=events[_0x36f5b4];var _0x3a315c=createListener(_0x8bac('0x3')+_0x2e6c33,_0x28b1d1);FaxQueueEvents['on'](_0x2e6c33,_0x3a315c);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 7e14058..a7de8fb 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 _0x6363=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0x6363,0x13a));var _0x3636=function(_0x2f6444,_0x186c57){_0x2f6444=_0x2f6444-0x0;var _0x25f7c8=_0x6363[_0x2f6444];return _0x25f7c8;};'use strict';var multer=require(_0x3636('0x0'));var util=require('util');var path=require(_0x3636('0x1'));var timeout=require(_0x3636('0x2'));var express=require(_0x3636('0x3'));var router=express[_0x3636('0x4')]();var fs_extra=require(_0x3636('0x5'));var auth=require(_0x3636('0x6'));var interaction=require(_0x3636('0x7'));var config=require(_0x3636('0x8'));var controller=require(_0x3636('0x9'));router[_0x3636('0xa')]('/',auth[_0x3636('0xb')](),controller[_0x3636('0xc')]);router[_0x3636('0xa')](_0x3636('0xd'),auth['isAuthenticated'](),controller[_0x3636('0xe')]);router['get'](_0x3636('0xf'),auth[_0x3636('0xb')](),controller[_0x3636('0x10')]);router[_0x3636('0xa')](_0x3636('0x11'),auth[_0x3636('0xb')](),controller[_0x3636('0x12')]);router[_0x3636('0xa')](_0x3636('0x13'),auth['isAuthenticated'](),controller['getTeams']);router[_0x3636('0xa')]('/:id/users',auth[_0x3636('0xb')](),controller[_0x3636('0x14')]);router[_0x3636('0x15')]('/',auth[_0x3636('0xb')](),controller[_0x3636('0x16')]);router[_0x3636('0x15')](_0x3636('0x13'),auth[_0x3636('0xb')](),controller[_0x3636('0x17')]);router[_0x3636('0x15')](_0x3636('0x18'),auth[_0x3636('0xb')](),controller[_0x3636('0x19')]);router[_0x3636('0x1a')](_0x3636('0xf'),auth[_0x3636('0xb')](),controller[_0x3636('0x1b')]);router['delete'](_0x3636('0xf'),auth[_0x3636('0xb')](),controller['destroy']);router[_0x3636('0x1c')]('/:id/teams',auth['isAuthenticated'](),controller[_0x3636('0x1d')]);router[_0x3636('0x1c')](_0x3636('0x18'),auth[_0x3636('0xb')](),controller[_0x3636('0x1e')]);module[_0x3636('0x1f')]=router; \ No newline at end of file +var _0xd9eb=['/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe'];(function(_0x41eeed,_0x3e4310){var _0x21c55a=function(_0x5102cf){while(--_0x5102cf){_0x41eeed['push'](_0x41eeed['shift']());}};_0x21c55a(++_0x3e4310);}(_0xd9eb,0xca));var _0xbd9e=function(_0x41b3d6,_0x21daa8){_0x41b3d6=_0x41b3d6-0x0;var _0x3e60ca=_0xd9eb[_0x41b3d6];return _0x3e60ca;};'use strict';var multer=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var path=require(_0xbd9e('0x2'));var timeout=require(_0xbd9e('0x3'));var express=require(_0xbd9e('0x4'));var router=express[_0xbd9e('0x5')]();var fs_extra=require(_0xbd9e('0x6'));var auth=require(_0xbd9e('0x7'));var interaction=require(_0xbd9e('0x8'));var config=require(_0xbd9e('0x9'));var controller=require(_0xbd9e('0xa'));router[_0xbd9e('0xb')]('/',auth[_0xbd9e('0xc')](),controller['index']);router[_0xbd9e('0xb')](_0xbd9e('0xd'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0xe')]);router[_0xbd9e('0xb')](_0xbd9e('0xf'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x10')]);router[_0xbd9e('0xb')](_0xbd9e('0x11'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x12')]);router['get'](_0xbd9e('0x13'),auth[_0xbd9e('0xc')](),controller['getTeams']);router[_0xbd9e('0xb')]('/:id/users',auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x14')]);router[_0xbd9e('0x15')]('/',auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x16')]);router[_0xbd9e('0x15')](_0xbd9e('0x13'),auth[_0xbd9e('0xc')](),controller['addTeams']);router[_0xbd9e('0x15')](_0xbd9e('0x17'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x18')]);router[_0xbd9e('0x19')](_0xbd9e('0xf'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x1a')]);router[_0xbd9e('0x1b')](_0xbd9e('0xf'),auth[_0xbd9e('0xc')](),controller['destroy']);router[_0xbd9e('0x1b')](_0xbd9e('0x13'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x1c')]);router[_0xbd9e('0x1b')]('/:id/users',auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x1d')]);module[_0xbd9e('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 6aa7ade..39eaece 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 _0xa97b=['STRING','DATE','moment','sequelize','exports'];(function(_0x4c463e,_0x4d76de){var _0x3d636e=function(_0x504aa2){while(--_0x504aa2){_0x4c463e['push'](_0x4c463e['shift']());}};_0x3d636e(++_0x4d76de);}(_0xa97b,0x75));var _0xba97=function(_0x29f9fa,_0x26b57a){_0x29f9fa=_0x29f9fa-0x0;var _0x1a3c6d=_0xa97b[_0x29f9fa];return _0x1a3c6d;};'use strict';var moment=require(_0xba97('0x0'));var Sequelize=require(_0xba97('0x1'));module[_0xba97('0x2')]={'uniqueid':{'type':Sequelize[_0xba97('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xba97('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xba97('0x4')]},'exitAt':{'type':Sequelize[_0xba97('0x4')]},'reason':{'type':Sequelize[_0xba97('0x3')]}}; \ No newline at end of file +var _0x89ca=['STRING','DATE','moment'];(function(_0x289eff,_0x492c32){var _0x2de8ce=function(_0x2da89e){while(--_0x2da89e){_0x289eff['push'](_0x289eff['shift']());}};_0x2de8ce(++_0x492c32);}(_0x89ca,0xe3));var _0xa89c=function(_0x32fad4,_0x51dd98){_0x32fad4=_0x32fad4-0x0;var _0x583237=_0x89ca[_0x32fad4];return _0x583237;};'use strict';var moment=require(_0xa89c('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xa89c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xa89c('0x1')]},'joinAt':{'type':Sequelize[_0xa89c('0x2')]},'leaveAt':{'type':Sequelize[_0xa89c('0x2')]},'acceptAt':{'type':Sequelize[_0xa89c('0x2')]},'exitAt':{'type':Sequelize[_0xa89c('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index f058fe6..9889fdc 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 _0xe3db=['count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FaxQueueReport','includeAll','include','rows','catch','length','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x582ccd,_0xa9ab43){var _0x11545d=function(_0x4010fa){while(--_0x4010fa){_0x582ccd['push'](_0x582ccd['shift']());}};_0x11545d(++_0xa9ab43);}(_0xe3db,0xc8));var _0xbe3d=function(_0x504ec7,_0x5905df){_0x504ec7=_0x504ec7-0x0;var _0x45782f=_0xe3db[_0x504ec7];return _0x45782f;};'use strict';var emlformat=require(_0xbe3d('0x0'));var rimraf=require(_0xbe3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe3d('0x2'));var rp=require(_0xbe3d('0x3'));var moment=require(_0xbe3d('0x4'));var BPromise=require(_0xbe3d('0x5'));var Mustache=require(_0xbe3d('0x6'));var util=require(_0xbe3d('0x7'));var path=require(_0xbe3d('0x8'));var sox=require(_0xbe3d('0x9'));var csv=require(_0xbe3d('0xa'));var ejs=require(_0xbe3d('0xb'));var fs=require('fs');var fs_extra=require(_0xbe3d('0xc'));var _=require('lodash');var squel=require(_0xbe3d('0xd'));var crypto=require(_0xbe3d('0xe'));var jsforce=require(_0xbe3d('0xf'));var deskjs=require(_0xbe3d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbe3d('0x11'));var Papa=require(_0xbe3d('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbe3d('0x13'));var as=require(_0xbe3d('0x14'));var hardwareService=require(_0xbe3d('0x15'));var logger=require(_0xbe3d('0x16'))(_0xbe3d('0x17'));var utils=require(_0xbe3d('0x18'));var config=require(_0xbe3d('0x19'));var licenseUtil=require(_0xbe3d('0x1a'));var db=require(_0xbe3d('0x1b'))['db'];function respondWithStatusCode(_0x276e4c,_0x4d25e7){_0x4d25e7=_0x4d25e7||0xcc;return function(_0x2fad2d){if(_0x2fad2d){return _0x276e4c['sendStatus'](_0x4d25e7);}return _0x276e4c[_0xbe3d('0x1c')](_0x4d25e7)[_0xbe3d('0x1d')]();};}function respondWithResult(_0x399333,_0x1a142b){_0x1a142b=_0x1a142b||0xc8;return function(_0x81f5c7){if(_0x81f5c7){return _0x399333[_0xbe3d('0x1c')](_0x1a142b)[_0xbe3d('0x1e')](_0x81f5c7);}};}function respondWithFilteredResult(_0x98ce08,_0x2bb8c2){return function(_0x1e8ecc){if(_0x1e8ecc){var _0x2a45ef=typeof _0x2bb8c2[_0xbe3d('0x1f')]===_0xbe3d('0x20')&&typeof _0x2bb8c2[_0xbe3d('0x21')]==='undefined';var _0x16f473=_0x1e8ecc[_0xbe3d('0x22')];var _0x1a5ab3=_0x2a45ef?0x0:_0x2bb8c2[_0xbe3d('0x1f')];var _0x3cf995=_0x2a45ef?_0x1e8ecc[_0xbe3d('0x22')]:_0x2bb8c2[_0xbe3d('0x1f')]+_0x2bb8c2[_0xbe3d('0x21')];var _0x309d6e;if(_0x3cf995>=_0x16f473){_0x3cf995=_0x16f473;_0x309d6e=0xc8;}else{_0x309d6e=0xce;}_0x98ce08['status'](_0x309d6e);return _0x98ce08[_0xbe3d('0x23')](_0xbe3d('0x24'),_0x1a5ab3+'-'+_0x3cf995+'/'+_0x16f473)[_0xbe3d('0x1e')](_0x1e8ecc);}return null;};}function patchUpdates(_0x1c802f){return function(_0x316a83){try{jsonpatch[_0xbe3d('0x25')](_0x316a83,_0x1c802f,!![]);}catch(_0x414d67){return BPromise[_0xbe3d('0x26')](_0x414d67);}return _0x316a83[_0xbe3d('0x27')]();};}function saveUpdates(_0x37b211,_0x2a44c0){return function(_0x5bdf63){if(_0x5bdf63){return _0x5bdf63[_0xbe3d('0x28')](_0x37b211)[_0xbe3d('0x29')](function(_0x4d8c93){return _0x4d8c93;});}return null;};}function removeEntity(_0x24501a,_0x4b755a){return function(_0x638959){if(_0x638959){return _0x638959[_0xbe3d('0x2a')]()['then'](function(){_0x24501a[_0xbe3d('0x1c')](0xcc)[_0xbe3d('0x1d')]();});}};}function handleEntityNotFound(_0x39c4d2,_0x14c93a){return function(_0x9ffc6a){if(!_0x9ffc6a){_0x39c4d2[_0xbe3d('0x2b')](0x194);}return _0x9ffc6a;};}function handleError(_0x2d59fa,_0x6198e2){_0x6198e2=_0x6198e2||0x1f4;return function(_0x446403){logger['error'](_0x446403[_0xbe3d('0x2c')]);if(_0x446403['name']){delete _0x446403[_0xbe3d('0x2d')];}_0x2d59fa['status'](_0x6198e2)[_0xbe3d('0x2e')](_0x446403);};}exports['index']=function(_0x77d2a7,_0x315b86){var _0x44c3dc={},_0xd349f1={},_0x1f839f={'count':0x0,'rows':[]};var _0x1921de=_[_0xbe3d('0x2f')](db['FaxQueueReport'][_0xbe3d('0x30')],function(_0x7e378b){return{'name':_0x7e378b['fieldName'],'type':_0x7e378b['type'][_0xbe3d('0x31')]};});_0xd349f1[_0xbe3d('0x32')]=_[_0xbe3d('0x2f')](_0x1921de,_0xbe3d('0x2d'));_0xd349f1[_0xbe3d('0x33')]=_[_0xbe3d('0x34')](_0x77d2a7[_0xbe3d('0x33')]);_0xd349f1[_0xbe3d('0x35')]=_['intersection'](_0xd349f1[_0xbe3d('0x32')],_0xd349f1[_0xbe3d('0x33')]);_0x44c3dc[_0xbe3d('0x36')]=_[_0xbe3d('0x37')](_0xd349f1[_0xbe3d('0x32')],qs['fields'](_0x77d2a7['query'][_0xbe3d('0x38')]));_0x44c3dc['attributes']=_0x44c3dc['attributes']['length']?_0x44c3dc[_0xbe3d('0x36')]:_0xd349f1[_0xbe3d('0x32')];if(!_0x77d2a7[_0xbe3d('0x33')]['hasOwnProperty'](_0xbe3d('0x39'))){_0x44c3dc[_0xbe3d('0x21')]=qs[_0xbe3d('0x21')](_0x77d2a7['query'][_0xbe3d('0x21')]);_0x44c3dc[_0xbe3d('0x1f')]=qs[_0xbe3d('0x1f')](_0x77d2a7[_0xbe3d('0x33')][_0xbe3d('0x1f')]);}_0x44c3dc[_0xbe3d('0x3a')]=qs[_0xbe3d('0x3b')](_0x77d2a7[_0xbe3d('0x33')][_0xbe3d('0x3b')]);_0x44c3dc[_0xbe3d('0x3c')]=qs[_0xbe3d('0x35')](_[_0xbe3d('0x3d')](_0x77d2a7['query'],_0xd349f1[_0xbe3d('0x35')]),_0x1921de);if(_0x77d2a7[_0xbe3d('0x33')][_0xbe3d('0x3e')]){_0x44c3dc[_0xbe3d('0x3c')]=_[_0xbe3d('0x3f')](_0x44c3dc[_0xbe3d('0x3c')],{'$or':_[_0xbe3d('0x2f')](_0x1921de,function(_0x168713){if(_0x168713[_0xbe3d('0x40')]!==_0xbe3d('0x41')){var _0x42adb8={};_0x42adb8[_0x168713[_0xbe3d('0x2d')]]={'$like':'%'+_0x77d2a7[_0xbe3d('0x33')]['filter']+'%'};return _0x42adb8;}})});}_0x44c3dc=_[_0xbe3d('0x3f')]({},_0x44c3dc,_0x77d2a7[_0xbe3d('0x42')]);var _0x169b2f={'where':_0x44c3dc['where']};return db[_0xbe3d('0x43')][_0xbe3d('0x22')](_0x169b2f)[_0xbe3d('0x29')](function(_0xc36af2){_0x1f839f[_0xbe3d('0x22')]=_0xc36af2;if(_0x77d2a7[_0xbe3d('0x33')][_0xbe3d('0x44')]){_0x44c3dc[_0xbe3d('0x45')]=[{'all':!![]}];}return db[_0xbe3d('0x43')]['findAll'](_0x44c3dc);})[_0xbe3d('0x29')](function(_0x2ad5c1){_0x1f839f[_0xbe3d('0x46')]=_0x2ad5c1;return _0x1f839f;})[_0xbe3d('0x29')](respondWithFilteredResult(_0x315b86,_0x44c3dc))[_0xbe3d('0x47')](handleError(_0x315b86,null));};exports['show']=function(_0x42ffbf,_0x49a663){var _0x393447={'raw':!![],'where':{'id':_0x42ffbf['params']['id']}},_0x56d6ab={};_0x56d6ab[_0xbe3d('0x32')]=_[_0xbe3d('0x34')](db[_0xbe3d('0x43')][_0xbe3d('0x30')]);_0x56d6ab[_0xbe3d('0x33')]=_[_0xbe3d('0x34')](_0x42ffbf[_0xbe3d('0x33')]);_0x56d6ab['filters']=_[_0xbe3d('0x37')](_0x56d6ab[_0xbe3d('0x32')],_0x56d6ab[_0xbe3d('0x33')]);_0x393447[_0xbe3d('0x36')]=_['intersection'](_0x56d6ab[_0xbe3d('0x32')],qs[_0xbe3d('0x38')](_0x42ffbf[_0xbe3d('0x33')][_0xbe3d('0x38')]));_0x393447[_0xbe3d('0x36')]=_0x393447[_0xbe3d('0x36')][_0xbe3d('0x48')]?_0x393447[_0xbe3d('0x36')]:_0x56d6ab[_0xbe3d('0x32')];if(_0x42ffbf[_0xbe3d('0x33')][_0xbe3d('0x44')]){_0x393447[_0xbe3d('0x45')]=[{'all':!![]}];}_0x393447=_['merge']({},_0x393447,_0x42ffbf[_0xbe3d('0x42')]);return db[_0xbe3d('0x43')][_0xbe3d('0x49')](_0x393447)['then'](handleEntityNotFound(_0x49a663,null))[_0xbe3d('0x29')](respondWithResult(_0x49a663,null))[_0xbe3d('0x47')](handleError(_0x49a663,null));};exports[_0xbe3d('0x4a')]=function(_0x4ebddc,_0x476b9a){return db[_0xbe3d('0x43')][_0xbe3d('0x4a')](_0x4ebddc['body'],{})[_0xbe3d('0x29')](respondWithResult(_0x476b9a,0xc9))['catch'](handleError(_0x476b9a,null));};exports['update']=function(_0x47476a,_0x1bc63b){if(_0x47476a[_0xbe3d('0x4b')]['id']){delete _0x47476a[_0xbe3d('0x4b')]['id'];}return db[_0xbe3d('0x43')]['find']({'where':{'id':_0x47476a[_0xbe3d('0x4c')]['id']}})[_0xbe3d('0x29')](handleEntityNotFound(_0x1bc63b,null))['then'](saveUpdates(_0x47476a[_0xbe3d('0x4b')],null))['then'](respondWithResult(_0x1bc63b,null))[_0xbe3d('0x47')](handleError(_0x1bc63b,null));};exports[_0xbe3d('0x2a')]=function(_0x4a28e7,_0x2a716a){return db[_0xbe3d('0x43')][_0xbe3d('0x49')]({'where':{'id':_0x4a28e7[_0xbe3d('0x4c')]['id']}})[_0xbe3d('0x29')](handleEntityNotFound(_0x2a716a,null))[_0xbe3d('0x29')](removeEntity(_0x2a716a,null))[_0xbe3d('0x47')](handleError(_0x2a716a,null));};exports['describe']=function(_0x10eca5,_0x37b4ab){return db[_0xbe3d('0x43')][_0xbe3d('0x4d')]()['then'](respondWithResult(_0x37b4ab,null))[_0xbe3d('0x47')](handleError(_0x37b4ab,null));}; \ No newline at end of file +var _0x68fc=['pick','type','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','params','destroy','find','describe','eml-format','rimraf','zip-dir','moment','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','end','error','name','send','map','FaxQueueReport','fieldName','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x68fc,0xa5));var _0xc68f=function(_0x3117b3,_0x46b3ab){_0x3117b3=_0x3117b3-0x0;var _0x4a3aaf=_0x68fc[_0x3117b3];return _0x4a3aaf;};'use strict';var emlformat=require(_0xc68f('0x0'));var rimraf=require(_0xc68f('0x1'));var zipdir=require(_0xc68f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc68f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc68f('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc68f('0x5'));var csv=require(_0xc68f('0x6'));var ejs=require(_0xc68f('0x7'));var fs=require('fs');var fs_extra=require(_0xc68f('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc68f('0x9'));var jsforce=require(_0xc68f('0xa'));var deskjs=require(_0xc68f('0xb'));var toCsv=require(_0xc68f('0x6'));var querystring=require(_0xc68f('0xc'));var Papa=require(_0xc68f('0xd'));var Redis=require(_0xc68f('0xe'));var authService=require(_0xc68f('0xf'));var qs=require(_0xc68f('0x10'));var as=require(_0xc68f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc68f('0x12'))(_0xc68f('0x13'));var utils=require(_0xc68f('0x14'));var config=require(_0xc68f('0x15'));var licenseUtil=require(_0xc68f('0x16'));var db=require(_0xc68f('0x17'))['db'];function respondWithStatusCode(_0x3ccebe,_0x41aeb8){_0x41aeb8=_0x41aeb8||0xcc;return function(_0x151bde){if(_0x151bde){return _0x3ccebe[_0xc68f('0x18')](_0x41aeb8);}return _0x3ccebe[_0xc68f('0x19')](_0x41aeb8)['end']();};}function respondWithResult(_0x2ea1c4,_0x90ccbd){_0x90ccbd=_0x90ccbd||0xc8;return function(_0x2b1d30){if(_0x2b1d30){return _0x2ea1c4[_0xc68f('0x19')](_0x90ccbd)[_0xc68f('0x1a')](_0x2b1d30);}};}function respondWithFilteredResult(_0x2673b4,_0x3d1406){return function(_0x209d16){if(_0x209d16){var _0x4648c6=typeof _0x3d1406['offset']==='undefined'&&typeof _0x3d1406[_0xc68f('0x1b')]===_0xc68f('0x1c');var _0x171eea=_0x209d16[_0xc68f('0x1d')];var _0x2d9d85=_0x4648c6?0x0:_0x3d1406[_0xc68f('0x1e')];var _0x50fab4=_0x4648c6?_0x209d16[_0xc68f('0x1d')]:_0x3d1406[_0xc68f('0x1e')]+_0x3d1406[_0xc68f('0x1b')];var _0x2c058c;if(_0x50fab4>=_0x171eea){_0x50fab4=_0x171eea;_0x2c058c=0xc8;}else{_0x2c058c=0xce;}_0x2673b4[_0xc68f('0x19')](_0x2c058c);return _0x2673b4[_0xc68f('0x1f')](_0xc68f('0x20'),_0x2d9d85+'-'+_0x50fab4+'/'+_0x171eea)[_0xc68f('0x1a')](_0x209d16);}return null;};}function patchUpdates(_0x582301){return function(_0xcc11a3){try{jsonpatch[_0xc68f('0x21')](_0xcc11a3,_0x582301,!![]);}catch(_0x2e27b9){return BPromise['reject'](_0x2e27b9);}return _0xcc11a3[_0xc68f('0x22')]();};}function saveUpdates(_0x1daac5,_0x116203){return function(_0x2064db){if(_0x2064db){return _0x2064db[_0xc68f('0x23')](_0x1daac5)[_0xc68f('0x24')](function(_0x2412a9){return _0x2412a9;});}return null;};}function removeEntity(_0x547d46,_0x38c3a0){return function(_0x288957){if(_0x288957){return _0x288957['destroy']()[_0xc68f('0x24')](function(){_0x547d46[_0xc68f('0x19')](0xcc)[_0xc68f('0x25')]();});}};}function handleEntityNotFound(_0x44c4b2,_0x39419a){return function(_0x48d797){if(!_0x48d797){_0x44c4b2[_0xc68f('0x18')](0x194);}return _0x48d797;};}function handleError(_0x417de2,_0x5d4632){_0x5d4632=_0x5d4632||0x1f4;return function(_0x38b935){logger[_0xc68f('0x26')](_0x38b935['stack']);if(_0x38b935[_0xc68f('0x27')]){delete _0x38b935[_0xc68f('0x27')];}_0x417de2[_0xc68f('0x19')](_0x5d4632)[_0xc68f('0x28')](_0x38b935);};}exports['index']=function(_0x477a1c,_0x1cc5b2){var _0x26003a={},_0x435482={},_0x1ba1ac={'count':0x0,'rows':[]};var _0x11b203=_[_0xc68f('0x29')](db[_0xc68f('0x2a')]['rawAttributes'],function(_0x37f947){return{'name':_0x37f947[_0xc68f('0x2b')],'type':_0x37f947['type'][_0xc68f('0x2c')]};});_0x435482[_0xc68f('0x2d')]=_[_0xc68f('0x29')](_0x11b203,_0xc68f('0x27'));_0x435482['query']=_[_0xc68f('0x2e')](_0x477a1c[_0xc68f('0x2f')]);_0x435482['filters']=_[_0xc68f('0x30')](_0x435482[_0xc68f('0x2d')],_0x435482[_0xc68f('0x2f')]);_0x26003a[_0xc68f('0x31')]=_[_0xc68f('0x30')](_0x435482['model'],qs['fields'](_0x477a1c[_0xc68f('0x2f')][_0xc68f('0x32')]));_0x26003a[_0xc68f('0x31')]=_0x26003a[_0xc68f('0x31')][_0xc68f('0x33')]?_0x26003a['attributes']:_0x435482['model'];if(!_0x477a1c[_0xc68f('0x2f')]['hasOwnProperty'](_0xc68f('0x34'))){_0x26003a[_0xc68f('0x1b')]=qs[_0xc68f('0x1b')](_0x477a1c[_0xc68f('0x2f')][_0xc68f('0x1b')]);_0x26003a[_0xc68f('0x1e')]=qs[_0xc68f('0x1e')](_0x477a1c['query'][_0xc68f('0x1e')]);}_0x26003a[_0xc68f('0x35')]=qs[_0xc68f('0x36')](_0x477a1c[_0xc68f('0x2f')][_0xc68f('0x36')]);_0x26003a[_0xc68f('0x37')]=qs[_0xc68f('0x38')](_[_0xc68f('0x39')](_0x477a1c[_0xc68f('0x2f')],_0x435482[_0xc68f('0x38')]),_0x11b203);if(_0x477a1c[_0xc68f('0x2f')]['filter']){_0x26003a['where']=_['merge'](_0x26003a[_0xc68f('0x37')],{'$or':_[_0xc68f('0x29')](_0x11b203,function(_0x268649){if(_0x268649[_0xc68f('0x3a')]!=='VIRTUAL'){var _0x10c664={};_0x10c664[_0x268649[_0xc68f('0x27')]]={'$like':'%'+_0x477a1c[_0xc68f('0x2f')]['filter']+'%'};return _0x10c664;}})});}_0x26003a=_[_0xc68f('0x3b')]({},_0x26003a,_0x477a1c[_0xc68f('0x3c')]);var _0x4a8883={'where':_0x26003a[_0xc68f('0x37')]};return db[_0xc68f('0x2a')][_0xc68f('0x1d')](_0x4a8883)['then'](function(_0x2702ac){_0x1ba1ac[_0xc68f('0x1d')]=_0x2702ac;if(_0x477a1c[_0xc68f('0x2f')][_0xc68f('0x3d')]){_0x26003a[_0xc68f('0x3e')]=[{'all':!![]}];}return db[_0xc68f('0x2a')][_0xc68f('0x3f')](_0x26003a);})['then'](function(_0x192942){_0x1ba1ac[_0xc68f('0x40')]=_0x192942;return _0x1ba1ac;})[_0xc68f('0x24')](respondWithFilteredResult(_0x1cc5b2,_0x26003a))[_0xc68f('0x41')](handleError(_0x1cc5b2,null));};exports[_0xc68f('0x42')]=function(_0x1e4f50,_0x1d4619){var _0x335b52={'raw':!![],'where':{'id':_0x1e4f50['params']['id']}},_0x1e8141={};_0x1e8141[_0xc68f('0x2d')]=_[_0xc68f('0x2e')](db[_0xc68f('0x2a')][_0xc68f('0x43')]);_0x1e8141[_0xc68f('0x2f')]=_[_0xc68f('0x2e')](_0x1e4f50[_0xc68f('0x2f')]);_0x1e8141['filters']=_[_0xc68f('0x30')](_0x1e8141['model'],_0x1e8141['query']);_0x335b52[_0xc68f('0x31')]=_[_0xc68f('0x30')](_0x1e8141['model'],qs['fields'](_0x1e4f50[_0xc68f('0x2f')][_0xc68f('0x32')]));_0x335b52[_0xc68f('0x31')]=_0x335b52[_0xc68f('0x31')][_0xc68f('0x33')]?_0x335b52[_0xc68f('0x31')]:_0x1e8141[_0xc68f('0x2d')];if(_0x1e4f50[_0xc68f('0x2f')][_0xc68f('0x3d')]){_0x335b52[_0xc68f('0x3e')]=[{'all':!![]}];}_0x335b52=_[_0xc68f('0x3b')]({},_0x335b52,_0x1e4f50['options']);return db[_0xc68f('0x2a')]['find'](_0x335b52)[_0xc68f('0x24')](handleEntityNotFound(_0x1d4619,null))[_0xc68f('0x24')](respondWithResult(_0x1d4619,null))['catch'](handleError(_0x1d4619,null));};exports[_0xc68f('0x44')]=function(_0x3f4537,_0x28e8ef){return db[_0xc68f('0x2a')][_0xc68f('0x44')](_0x3f4537[_0xc68f('0x45')],{})[_0xc68f('0x24')](respondWithResult(_0x28e8ef,0xc9))[_0xc68f('0x41')](handleError(_0x28e8ef,null));};exports['update']=function(_0x2920d5,_0x15eaa2){if(_0x2920d5[_0xc68f('0x45')]['id']){delete _0x2920d5['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x2920d5[_0xc68f('0x46')]['id']}})[_0xc68f('0x24')](handleEntityNotFound(_0x15eaa2,null))['then'](saveUpdates(_0x2920d5[_0xc68f('0x45')],null))['then'](respondWithResult(_0x15eaa2,null))[_0xc68f('0x41')](handleError(_0x15eaa2,null));};exports[_0xc68f('0x47')]=function(_0x44efa8,_0x26ac9a){return db[_0xc68f('0x2a')][_0xc68f('0x48')]({'where':{'id':_0x44efa8[_0xc68f('0x46')]['id']}})[_0xc68f('0x24')](handleEntityNotFound(_0x26ac9a,null))[_0xc68f('0x24')](removeEntity(_0x26ac9a,null))[_0xc68f('0x41')](handleError(_0x26ac9a,null));};exports[_0xc68f('0x49')]=function(_0x5e36c7,_0x2e4ebc){return db[_0xc68f('0x2a')]['describe']()['then'](respondWithResult(_0x2e4ebc,null))[_0xc68f('0x41')](handleError(_0x2e4ebc,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 631c789..4995bb6 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x5c77c0,_0x5ef41b){var _0x1b133d=function(_0x31d4e5){while(--_0x31d4e5){_0x5c77c0['push'](_0x5c77c0['shift']());}};_0x1b133d(++_0x5ef41b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5fc3[_0x167cc1];return _0x10bc4b;};'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 +var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x159e65,_0x1edeca){var _0x48bee0=function(_0x40b219){while(--_0x40b219){_0x159e65['push'](_0x159e65['shift']());}};_0x48bee0(++_0x1edeca);}(_0x53ec,0x192));var _0xc53e=function(_0x5ddafe,_0x1fb508){_0x5ddafe=_0x5ddafe-0x0;var _0x5e23aa=_0x53ec[_0x5ddafe];return _0x5e23aa;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 4a2a879..6a1eb51 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 _0x4f8a=['FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','FaxQueueReport','create','options','raw','CreateFaxQueueReport','catch','UpdateFaxQueueReport','update','where','attributes','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0xae40c9,_0x36b4ec){var _0x5c638d=function(_0x320b20){while(--_0x320b20){_0xae40c9['push'](_0xae40c9['shift']());}};_0x5c638d(++_0x36b4ec);}(_0x4f8a,0x127));var _0xa4f8=function(_0x1f2485,_0x3efba1){_0x1f2485=_0x1f2485-0x0;var _0x510fb3=_0x4f8a[_0x1f2485];return _0x510fb3;};'use strict';var _=require(_0xa4f8('0x0'));var util=require('util');var moment=require(_0xa4f8('0x1'));var BPromise=require(_0xa4f8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4f8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4f8('0x4'))(_0xa4f8('0x5'));var config=require(_0xa4f8('0x6'));var jayson=require(_0xa4f8('0x7'));var client=jayson[_0xa4f8('0x8')][_0xa4f8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf8eaa5,_0x3faab6,_0x130b18){return new BPromise(function(_0x323d29,_0x273f77){return client[_0xa4f8('0xa')](_0xf8eaa5,_0x130b18)[_0xa4f8('0xb')](function(_0x523beb){logger[_0xa4f8('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x3faab6,_0xa4f8('0xd'));logger[_0xa4f8('0xe')](_0xa4f8('0xf'),_0x3faab6,_0xa4f8('0xd'),JSON[_0xa4f8('0x10')](_0x523beb));if(_0x523beb['error']){if(_0x523beb[_0xa4f8('0x11')][_0xa4f8('0x12')]===0x1f4){logger[_0xa4f8('0x11')](_0xa4f8('0x13'),_0x3faab6,_0x523beb[_0xa4f8('0x11')][_0xa4f8('0x14')]);return _0x273f77(_0x523beb[_0xa4f8('0x11')][_0xa4f8('0x14')]);}logger[_0xa4f8('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x3faab6,_0x523beb[_0xa4f8('0x11')]['message']);return _0x323d29(_0x523beb['error'][_0xa4f8('0x14')]);}else{logger[_0xa4f8('0xc')](_0xa4f8('0x13'),_0x3faab6,_0xa4f8('0xd'));_0x323d29(_0x523beb['result'][_0xa4f8('0x14')]);}})['catch'](function(_0x548081){logger['error'](_0xa4f8('0x13'),_0x3faab6,_0x548081);_0x273f77(_0x548081);});});}exports['CreateFaxQueueReport']=function(_0x2a1b06){var _0x3c02f1=this;return new Promise(function(_0x4f939e,_0x3b7e7c){return db[_0xa4f8('0x15')][_0xa4f8('0x16')](_0x2a1b06['body'],{'raw':_0x2a1b06[_0xa4f8('0x17')]?_0x2a1b06[_0xa4f8('0x17')][_0xa4f8('0x18')]===undefined?!![]:![]:!![]})[_0xa4f8('0xb')](function(_0x4f360c){logger['info']('CreateFaxQueueReport',_0x2a1b06);logger[_0xa4f8('0xe')](_0xa4f8('0x19'),_0x2a1b06,JSON[_0xa4f8('0x10')](_0x4f360c));_0x4f939e(_0x4f360c);})[_0xa4f8('0x1a')](function(_0x2ddc64){logger[_0xa4f8('0x11')](_0xa4f8('0x19'),_0x2ddc64[_0xa4f8('0x14')],_0x2a1b06);_0x3b7e7c(_0x3c02f1[_0xa4f8('0x11')](0x1f4,_0x2ddc64['message']));});});};exports[_0xa4f8('0x1b')]=function(_0x27c655){var _0x32cf37=this;return new Promise(function(_0xed4453,_0x2436e9){return db['FaxQueueReport'][_0xa4f8('0x1c')](_0x27c655['body'],{'raw':_0x27c655[_0xa4f8('0x17')]?_0x27c655[_0xa4f8('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27c655['options']?_0x27c655[_0xa4f8('0x17')][_0xa4f8('0x1d')]||null:null,'attributes':_0x27c655[_0xa4f8('0x17')]?_0x27c655['options'][_0xa4f8('0x1e')]||null:null,'limit':_0x27c655[_0xa4f8('0x17')]?_0x27c655[_0xa4f8('0x17')]['limit']||null:null})[_0xa4f8('0xb')](function(_0x532fb1){logger[_0xa4f8('0xc')]('UpdateFaxQueueReport',_0x27c655);logger[_0xa4f8('0xe')](_0xa4f8('0x1b'),_0x27c655,JSON['stringify'](_0x532fb1));_0xed4453(_0x532fb1);})['catch'](function(_0x2f998e){logger[_0xa4f8('0x11')](_0xa4f8('0x1b'),_0x2f998e[_0xa4f8('0x14')],_0x27c655);_0x2436e9(_0x32cf37['error'](0x1f4,_0x2f998e[_0xa4f8('0x14')]));});});}; \ No newline at end of file +var _0x2571=['error','code','FaxQueueReport,\x20%s,\x20%s','message','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','then','catch','UpdateFaxQueueReport','update','where','attributes','limit','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x48ea8c,_0x5e36b9){var _0x338288=function(_0x4495f0){while(--_0x4495f0){_0x48ea8c['push'](_0x48ea8c['shift']());}};_0x338288(++_0x5e36b9);}(_0x2571,0x170));var _0x1257=function(_0x3cba1d,_0x2825ae){_0x3cba1d=_0x3cba1d-0x0;var _0x5f192b=_0x2571[_0x3cba1d];return _0x5f192b;};'use strict';var _=require('lodash');var util=require(_0x1257('0x0'));var moment=require(_0x1257('0x1'));var BPromise=require(_0x1257('0x2'));var rs=require(_0x1257('0x3'));var fs=require('fs');var Redis=require(_0x1257('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1257('0x5'));var logger=require(_0x1257('0x6'))(_0x1257('0x7'));var config=require(_0x1257('0x8'));var jayson=require(_0x1257('0x9'));var client=jayson[_0x1257('0xa')][_0x1257('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2889ef,_0x1bcec5,_0x30aeb9){return new BPromise(function(_0x35ab68,_0xc7b4ee){return client[_0x1257('0xc')](_0x2889ef,_0x30aeb9)['then'](function(_0x258422){logger[_0x1257('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x1bcec5,_0x1257('0xe'));logger['debug'](_0x1257('0xf'),_0x1bcec5,_0x1257('0xe'),JSON[_0x1257('0x10')](_0x258422));if(_0x258422[_0x1257('0x11')]){if(_0x258422[_0x1257('0x11')][_0x1257('0x12')]===0x1f4){logger[_0x1257('0x11')](_0x1257('0x13'),_0x1bcec5,_0x258422[_0x1257('0x11')]['message']);return _0xc7b4ee(_0x258422[_0x1257('0x11')][_0x1257('0x14')]);}logger[_0x1257('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x1bcec5,_0x258422[_0x1257('0x11')]['message']);return _0x35ab68(_0x258422[_0x1257('0x11')][_0x1257('0x14')]);}else{logger[_0x1257('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x1bcec5,'request\x20sent');_0x35ab68(_0x258422['result'][_0x1257('0x14')]);}})['catch'](function(_0x3b1ca1){logger[_0x1257('0x11')](_0x1257('0x13'),_0x1bcec5,_0x3b1ca1);_0xc7b4ee(_0x3b1ca1);});});}exports[_0x1257('0x15')]=function(_0x118a22){var _0x52a8b5=this;return new Promise(function(_0x2c3ccc,_0x4c572d){return db[_0x1257('0x16')][_0x1257('0x17')](_0x118a22[_0x1257('0x18')],{'raw':_0x118a22[_0x1257('0x19')]?_0x118a22[_0x1257('0x19')][_0x1257('0x1a')]===undefined?!![]:![]:!![]})[_0x1257('0x1b')](function(_0x281a06){logger['info'](_0x1257('0x15'),_0x118a22);logger['debug']('CreateFaxQueueReport',_0x118a22,JSON['stringify'](_0x281a06));_0x2c3ccc(_0x281a06);})[_0x1257('0x1c')](function(_0x4b663d){logger[_0x1257('0x11')](_0x1257('0x15'),_0x4b663d[_0x1257('0x14')],_0x118a22);_0x4c572d(_0x52a8b5[_0x1257('0x11')](0x1f4,_0x4b663d[_0x1257('0x14')]));});});};exports[_0x1257('0x1d')]=function(_0x4f653b){var _0x2f4cb5=this;return new Promise(function(_0x20eeb4,_0x2b162f){return db[_0x1257('0x16')][_0x1257('0x1e')](_0x4f653b['body'],{'raw':_0x4f653b[_0x1257('0x19')]?_0x4f653b['options'][_0x1257('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f653b[_0x1257('0x19')]?_0x4f653b['options'][_0x1257('0x1f')]||null:null,'attributes':_0x4f653b[_0x1257('0x19')]?_0x4f653b[_0x1257('0x19')][_0x1257('0x20')]||null:null,'limit':_0x4f653b[_0x1257('0x19')]?_0x4f653b[_0x1257('0x19')][_0x1257('0x21')]||null:null})[_0x1257('0x1b')](function(_0x5488db){logger[_0x1257('0xd')](_0x1257('0x1d'),_0x4f653b);logger[_0x1257('0x22')](_0x1257('0x1d'),_0x4f653b,JSON['stringify'](_0x5488db));_0x20eeb4(_0x5488db);})[_0x1257('0x1c')](function(_0x389380){logger[_0x1257('0x11')](_0x1257('0x1d'),_0x389380[_0x1257('0x14')],_0x4f653b);_0x2b162f(_0x2f4cb5[_0x1257('0x11')](0x1f4,_0x389380[_0x1257('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index cbacf48..12a7f34 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 _0x4ce6=['express','Router','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','util','path','connect-timeout'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x4ce6,0xf9));var _0x64ce=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x4ce6[_0x22f8ab];return _0x2a70e5;};'use strict';var multer=require('multer');var util=require(_0x64ce('0x0'));var path=require(_0x64ce('0x1'));var timeout=require(_0x64ce('0x2'));var express=require(_0x64ce('0x3'));var router=express[_0x64ce('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x64ce('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x64ce('0x6'));var controller=require(_0x64ce('0x7'));router[_0x64ce('0x8')]('/',auth[_0x64ce('0x9')](),controller[_0x64ce('0xa')]);router['get'](_0x64ce('0xb'),auth['isAuthenticated'](),controller[_0x64ce('0xc')]);router['get']('/:id',auth[_0x64ce('0x9')](),controller[_0x64ce('0xd')]);router[_0x64ce('0xe')]('/',auth[_0x64ce('0x9')](),controller[_0x64ce('0xf')]);router[_0x64ce('0x10')](_0x64ce('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x64ce('0x12')](_0x64ce('0x11'),auth[_0x64ce('0x9')](),controller[_0x64ce('0x13')]);module[_0x64ce('0x14')]=router; \ No newline at end of file +var _0x4b5c=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','/describe','isAuthenticated','show','post','create','put','update','destroy','exports'];(function(_0x189795,_0x27ec80){var _0x3c541e=function(_0x1e6e9e){while(--_0x1e6e9e){_0x189795['push'](_0x189795['shift']());}};_0x3c541e(++_0x27ec80);}(_0x4b5c,0x104));var _0xc4b5=function(_0x566cfa,_0x3a07c9){_0x566cfa=_0x566cfa-0x0;var _0x212f9d=_0x4b5c[_0x566cfa];return _0x212f9d;};'use strict';var multer=require(_0xc4b5('0x0'));var util=require(_0xc4b5('0x1'));var path=require('path');var timeout=require(_0xc4b5('0x2'));var express=require(_0xc4b5('0x3'));var router=express[_0xc4b5('0x4')]();var fs_extra=require(_0xc4b5('0x5'));var auth=require(_0xc4b5('0x6'));var interaction=require(_0xc4b5('0x7'));var config=require(_0xc4b5('0x8'));var controller=require(_0xc4b5('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc4b5('0xa')](_0xc4b5('0xb'),auth[_0xc4b5('0xc')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc4b5('0xd')]);router[_0xc4b5('0xe')]('/',auth['isAuthenticated'](),controller[_0xc4b5('0xf')]);router[_0xc4b5('0x10')]('/:id',auth[_0xc4b5('0xc')](),controller[_0xc4b5('0x11')]);router['delete']('/:id',auth[_0xc4b5('0xc')](),controller[_0xc4b5('0x12')]);module[_0xc4b5('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 41a8b62..1fdd6aa 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x144616,_0x1188de){var _0x100e2f=function(_0x35d543){while(--_0x35d543){_0x144616['push'](_0x144616['shift']());}};_0x100e2f(++_0x1188de);}(_0x34e8,0x12c));var _0x834e=function(_0x1440d6,_0x34a162){_0x1440d6=_0x1440d6-0x0;var _0x295162=_0x34e8[_0x1440d6];return _0x295162;};'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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x422996,_0x53659e){var _0x6f4ba9=function(_0x5cab27){while(--_0x5cab27){_0x422996['push'](_0x422996['shift']());}};_0x6f4ba9(++_0x53659e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x00bb[_0x5bd426];return _0x23a7eb;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index d0bd404..9b9077d 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 _0x0e37=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','FaxTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','type','VIRTUAL','filter','merge','options','findAll','catch','include','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0xd7b596,_0x36e554){var _0x46c4d5=function(_0x79fb4e){while(--_0x79fb4e){_0xd7b596['push'](_0xd7b596['shift']());}};_0x46c4d5(++_0x36e554);}(_0x0e37,0xd5));var _0x70e3=function(_0x41c9d3,_0x5a50c3){_0x41c9d3=_0x41c9d3-0x0;var _0x4440f4=_0x0e37[_0x41c9d3];return _0x4440f4;};'use strict';var emlformat=require(_0x70e3('0x0'));var rimraf=require(_0x70e3('0x1'));var zipdir=require(_0x70e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x70e3('0x3'));var Mustache=require(_0x70e3('0x4'));var util=require(_0x70e3('0x5'));var path=require(_0x70e3('0x6'));var sox=require(_0x70e3('0x7'));var csv=require(_0x70e3('0x8'));var ejs=require(_0x70e3('0x9'));var fs=require('fs');var fs_extra=require(_0x70e3('0xa'));var _=require('lodash');var squel=require(_0x70e3('0xb'));var crypto=require(_0x70e3('0xc'));var jsforce=require(_0x70e3('0xd'));var deskjs=require(_0x70e3('0xe'));var toCsv=require(_0x70e3('0x8'));var querystring=require(_0x70e3('0xf'));var Papa=require(_0x70e3('0x10'));var Redis=require(_0x70e3('0x11'));var authService=require(_0x70e3('0x12'));var qs=require(_0x70e3('0x13'));var as=require(_0x70e3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70e3('0x15'))(_0x70e3('0x16'));var utils=require(_0x70e3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x70e3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf2b73f,_0x3455c4){_0x3455c4=_0x3455c4||0xcc;return function(_0x1fd594){if(_0x1fd594){return _0xf2b73f['sendStatus'](_0x3455c4);}return _0xf2b73f[_0x70e3('0x19')](_0x3455c4)[_0x70e3('0x1a')]();};}function respondWithResult(_0xc0db1b,_0x363fcf){_0x363fcf=_0x363fcf||0xc8;return function(_0x5d763e){if(_0x5d763e){return _0xc0db1b[_0x70e3('0x19')](_0x363fcf)[_0x70e3('0x1b')](_0x5d763e);}};}function respondWithFilteredResult(_0x439870,_0x17179a){return function(_0x3b1aa6){if(_0x3b1aa6){var _0x559367=typeof _0x17179a[_0x70e3('0x1c')]===_0x70e3('0x1d')&&typeof _0x17179a[_0x70e3('0x1e')]===_0x70e3('0x1d');var _0x1cf64d=_0x3b1aa6[_0x70e3('0x1f')];var _0x51e605=_0x559367?0x0:_0x17179a['offset'];var _0x221aa0=_0x559367?_0x3b1aa6[_0x70e3('0x1f')]:_0x17179a[_0x70e3('0x1c')]+_0x17179a['limit'];var _0x31ec9f;if(_0x221aa0>=_0x1cf64d){_0x221aa0=_0x1cf64d;_0x31ec9f=0xc8;}else{_0x31ec9f=0xce;}_0x439870[_0x70e3('0x19')](_0x31ec9f);return _0x439870[_0x70e3('0x20')](_0x70e3('0x21'),_0x51e605+'-'+_0x221aa0+'/'+_0x1cf64d)[_0x70e3('0x1b')](_0x3b1aa6);}return null;};}function patchUpdates(_0x3f6a88){return function(_0x3bcf1e){try{jsonpatch['apply'](_0x3bcf1e,_0x3f6a88,!![]);}catch(_0x5b411f){return BPromise[_0x70e3('0x22')](_0x5b411f);}return _0x3bcf1e[_0x70e3('0x23')]();};}function saveUpdates(_0x9f244f,_0x46215d){return function(_0x481dad){if(_0x481dad){return _0x481dad['update'](_0x9f244f)[_0x70e3('0x24')](function(_0x2d4c11){return _0x2d4c11;});}return null;};}function removeEntity(_0xd583cf,_0x43a4cf){return function(_0x1aa349){if(_0x1aa349){return _0x1aa349[_0x70e3('0x25')]()[_0x70e3('0x24')](function(){_0xd583cf[_0x70e3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22c821,_0xa6c644){return function(_0x50d047){if(!_0x50d047){_0x22c821[_0x70e3('0x26')](0x194);}return _0x50d047;};}function handleError(_0xa4b9ea,_0x47394b){_0x47394b=_0x47394b||0x1f4;return function(_0x155fb1){logger[_0x70e3('0x27')](_0x155fb1[_0x70e3('0x28')]);if(_0x155fb1[_0x70e3('0x29')]){delete _0x155fb1['name'];}_0xa4b9ea[_0x70e3('0x19')](_0x47394b)[_0x70e3('0x2a')](_0x155fb1);};}exports[_0x70e3('0x2b')]=function(_0x1d426f,_0x5ed7a7){var _0x3ec0ce={},_0x2bb127={},_0x1332e0={'count':0x0,'rows':[]};var _0x1a0dd2=_['map'](db[_0x70e3('0x2c')][_0x70e3('0x2d')],function(_0x161579){return{'name':_0x161579[_0x70e3('0x2e')],'type':_0x161579['type'][_0x70e3('0x2f')]};});_0x2bb127[_0x70e3('0x30')]=_['map'](_0x1a0dd2,_0x70e3('0x29'));_0x2bb127[_0x70e3('0x31')]=_[_0x70e3('0x32')](_0x1d426f['query']);_0x2bb127[_0x70e3('0x33')]=_[_0x70e3('0x34')](_0x2bb127[_0x70e3('0x30')],_0x2bb127['query']);_0x3ec0ce[_0x70e3('0x35')]=_[_0x70e3('0x34')](_0x2bb127[_0x70e3('0x30')],qs['fields'](_0x1d426f[_0x70e3('0x31')][_0x70e3('0x36')]));_0x3ec0ce['attributes']=_0x3ec0ce[_0x70e3('0x35')][_0x70e3('0x37')]?_0x3ec0ce[_0x70e3('0x35')]:_0x2bb127[_0x70e3('0x30')];if(!_0x1d426f['query'][_0x70e3('0x38')](_0x70e3('0x39'))){_0x3ec0ce[_0x70e3('0x1e')]=qs[_0x70e3('0x1e')](_0x1d426f[_0x70e3('0x31')][_0x70e3('0x1e')]);_0x3ec0ce[_0x70e3('0x1c')]=qs['offset'](_0x1d426f['query'][_0x70e3('0x1c')]);}_0x3ec0ce['order']=qs[_0x70e3('0x3a')](_0x1d426f[_0x70e3('0x31')][_0x70e3('0x3a')]);_0x3ec0ce[_0x70e3('0x3b')]=qs[_0x70e3('0x33')](_[_0x70e3('0x3c')](_0x1d426f['query'],_0x2bb127[_0x70e3('0x33')]),_0x1a0dd2);if(_0x1d426f['query']['filter']){_0x3ec0ce[_0x70e3('0x3b')]=_['merge'](_0x3ec0ce['where'],{'$or':_[_0x70e3('0x3d')](_0x1a0dd2,function(_0x51f344){if(_0x51f344[_0x70e3('0x3e')]!==_0x70e3('0x3f')){var _0x1c4564={};_0x1c4564[_0x51f344[_0x70e3('0x29')]]={'$like':'%'+_0x1d426f[_0x70e3('0x31')][_0x70e3('0x40')]+'%'};return _0x1c4564;}})});}_0x3ec0ce=_[_0x70e3('0x41')]({},_0x3ec0ce,_0x1d426f[_0x70e3('0x42')]);var _0x37ac86={'where':_0x3ec0ce[_0x70e3('0x3b')]};return db[_0x70e3('0x2c')][_0x70e3('0x1f')](_0x37ac86)['then'](function(_0x49105a){_0x1332e0[_0x70e3('0x1f')]=_0x49105a;if(_0x1d426f[_0x70e3('0x31')]['includeAll']){_0x3ec0ce['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x70e3('0x43')](_0x3ec0ce);})[_0x70e3('0x24')](function(_0xdf4ac1){_0x1332e0['rows']=_0xdf4ac1;return _0x1332e0;})[_0x70e3('0x24')](respondWithFilteredResult(_0x5ed7a7,_0x3ec0ce))[_0x70e3('0x44')](handleError(_0x5ed7a7,null));};exports['show']=function(_0x1d021a,_0x159953){var _0x17bf2a={'raw':!![],'where':{'id':_0x1d021a['params']['id']}},_0x138def={};_0x138def[_0x70e3('0x30')]=_[_0x70e3('0x32')](db[_0x70e3('0x2c')][_0x70e3('0x2d')]);_0x138def[_0x70e3('0x31')]=_[_0x70e3('0x32')](_0x1d021a[_0x70e3('0x31')]);_0x138def[_0x70e3('0x33')]=_[_0x70e3('0x34')](_0x138def[_0x70e3('0x30')],_0x138def[_0x70e3('0x31')]);_0x17bf2a[_0x70e3('0x35')]=_[_0x70e3('0x34')](_0x138def[_0x70e3('0x30')],qs[_0x70e3('0x36')](_0x1d021a[_0x70e3('0x31')][_0x70e3('0x36')]));_0x17bf2a[_0x70e3('0x35')]=_0x17bf2a[_0x70e3('0x35')]['length']?_0x17bf2a[_0x70e3('0x35')]:_0x138def[_0x70e3('0x30')];if(_0x1d021a['query']['includeAll']){_0x17bf2a[_0x70e3('0x45')]=[{'all':!![]}];}_0x17bf2a=_[_0x70e3('0x41')]({},_0x17bf2a,_0x1d021a['options']);return db[_0x70e3('0x2c')][_0x70e3('0x46')](_0x17bf2a)['then'](handleEntityNotFound(_0x159953,null))[_0x70e3('0x24')](respondWithResult(_0x159953,null))['catch'](handleError(_0x159953,null));};exports[_0x70e3('0x47')]=function(_0x3cc5bb,_0xe3af4){return db['FaxTransferReport'][_0x70e3('0x47')](_0x3cc5bb[_0x70e3('0x48')],{})[_0x70e3('0x24')](respondWithResult(_0xe3af4,0xc9))[_0x70e3('0x44')](handleError(_0xe3af4,null));};exports[_0x70e3('0x49')]=function(_0x787a1f,_0x389b17){if(_0x787a1f[_0x70e3('0x48')]['id']){delete _0x787a1f['body']['id'];}return db[_0x70e3('0x2c')][_0x70e3('0x46')]({'where':{'id':_0x787a1f[_0x70e3('0x4a')]['id']}})[_0x70e3('0x24')](handleEntityNotFound(_0x389b17,null))[_0x70e3('0x24')](saveUpdates(_0x787a1f[_0x70e3('0x48')],null))[_0x70e3('0x24')](respondWithResult(_0x389b17,null))[_0x70e3('0x44')](handleError(_0x389b17,null));};exports[_0x70e3('0x25')]=function(_0x2d2d01,_0x25de94){return db[_0x70e3('0x2c')][_0x70e3('0x46')]({'where':{'id':_0x2d2d01[_0x70e3('0x4a')]['id']}})[_0x70e3('0x24')](handleEntityNotFound(_0x25de94,null))[_0x70e3('0x24')](removeEntity(_0x25de94,null))[_0x70e3('0x44')](handleError(_0x25de94,null));};exports[_0x70e3('0x4b')]=function(_0x4addf1,_0x366c78){return db[_0x70e3('0x2c')][_0x70e3('0x4b')]()[_0x70e3('0x24')](respondWithResult(_0x366c78,null))[_0x70e3('0x44')](handleError(_0x366c78,null));}; \ No newline at end of file +var _0x51d3=['offset','limit','set','Content-Range','save','update','then','error','stack','name','index','map','FaxTransferReport','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','ejs','fs-extra','lodash','squel','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','status','json','undefined','count'];(function(_0x30b9e3,_0x9a40cb){var _0x1bbab0=function(_0x3c475c){while(--_0x3c475c){_0x30b9e3['push'](_0x30b9e3['shift']());}};_0x1bbab0(++_0x9a40cb);}(_0x51d3,0x146));var _0x351d=function(_0x14d9fc,_0x343f3d){_0x14d9fc=_0x14d9fc-0x0;var _0x1020e2=_0x51d3[_0x14d9fc];return _0x1020e2;};'use strict';var emlformat=require(_0x351d('0x0'));var rimraf=require(_0x351d('0x1'));var zipdir=require(_0x351d('0x2'));var jsonpatch=require(_0x351d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x351d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x351d('0x5'));var sox=require(_0x351d('0x6'));var csv=require('to-csv');var ejs=require(_0x351d('0x7'));var fs=require('fs');var fs_extra=require(_0x351d('0x8'));var _=require(_0x351d('0x9'));var squel=require(_0x351d('0xa'));var crypto=require('crypto');var jsforce=require(_0x351d('0xb'));var deskjs=require(_0x351d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x351d('0xd'));var authService=require(_0x351d('0xe'));var qs=require(_0x351d('0xf'));var as=require(_0x351d('0x10'));var hardwareService=require(_0x351d('0x11'));var logger=require(_0x351d('0x12'))(_0x351d('0x13'));var utils=require(_0x351d('0x14'));var config=require(_0x351d('0x15'));var licenseUtil=require(_0x351d('0x16'));var db=require(_0x351d('0x17'))['db'];function respondWithStatusCode(_0x53ac2e,_0x5e9906){_0x5e9906=_0x5e9906||0xcc;return function(_0x6ec131){if(_0x6ec131){return _0x53ac2e[_0x351d('0x18')](_0x5e9906);}return _0x53ac2e[_0x351d('0x19')](_0x5e9906)['end']();};}function respondWithResult(_0x567604,_0x42a053){_0x42a053=_0x42a053||0xc8;return function(_0x4c9826){if(_0x4c9826){return _0x567604[_0x351d('0x19')](_0x42a053)[_0x351d('0x1a')](_0x4c9826);}};}function respondWithFilteredResult(_0x1e4152,_0x51e508){return function(_0x2ffd51){if(_0x2ffd51){var _0x2a6f40=typeof _0x51e508['offset']===_0x351d('0x1b')&&typeof _0x51e508['limit']===_0x351d('0x1b');var _0x56b301=_0x2ffd51['count'];var _0x1bdf43=_0x2a6f40?0x0:_0x51e508['offset'];var _0x1640a8=_0x2a6f40?_0x2ffd51[_0x351d('0x1c')]:_0x51e508[_0x351d('0x1d')]+_0x51e508[_0x351d('0x1e')];var _0x29c8d2;if(_0x1640a8>=_0x56b301){_0x1640a8=_0x56b301;_0x29c8d2=0xc8;}else{_0x29c8d2=0xce;}_0x1e4152['status'](_0x29c8d2);return _0x1e4152[_0x351d('0x1f')](_0x351d('0x20'),_0x1bdf43+'-'+_0x1640a8+'/'+_0x56b301)[_0x351d('0x1a')](_0x2ffd51);}return null;};}function patchUpdates(_0x196a08){return function(_0x4a395a){try{jsonpatch['apply'](_0x4a395a,_0x196a08,!![]);}catch(_0x5d9489){return BPromise['reject'](_0x5d9489);}return _0x4a395a[_0x351d('0x21')]();};}function saveUpdates(_0x319ccd,_0x85dba8){return function(_0x1a81e6){if(_0x1a81e6){return _0x1a81e6[_0x351d('0x22')](_0x319ccd)[_0x351d('0x23')](function(_0x29c177){return _0x29c177;});}return null;};}function removeEntity(_0x848a10,_0x4362e5){return function(_0x181b73){if(_0x181b73){return _0x181b73['destroy']()[_0x351d('0x23')](function(){_0x848a10[_0x351d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2403db,_0x260162){return function(_0x188c1a){if(!_0x188c1a){_0x2403db[_0x351d('0x18')](0x194);}return _0x188c1a;};}function handleError(_0x327741,_0x2a8179){_0x2a8179=_0x2a8179||0x1f4;return function(_0x2b1b75){logger[_0x351d('0x24')](_0x2b1b75[_0x351d('0x25')]);if(_0x2b1b75[_0x351d('0x26')]){delete _0x2b1b75['name'];}_0x327741[_0x351d('0x19')](_0x2a8179)['send'](_0x2b1b75);};}exports[_0x351d('0x27')]=function(_0x318c09,_0x2d7845){var _0xbd4ea4={},_0x5e6e2a={},_0x1e44e5={'count':0x0,'rows':[]};var _0x788400=_[_0x351d('0x28')](db[_0x351d('0x29')][_0x351d('0x2a')],function(_0x26c588){return{'name':_0x26c588['fieldName'],'type':_0x26c588['type'][_0x351d('0x2b')]};});_0x5e6e2a[_0x351d('0x2c')]=_[_0x351d('0x28')](_0x788400,_0x351d('0x26'));_0x5e6e2a['query']=_['keys'](_0x318c09[_0x351d('0x2d')]);_0x5e6e2a[_0x351d('0x2e')]=_[_0x351d('0x2f')](_0x5e6e2a['model'],_0x5e6e2a[_0x351d('0x2d')]);_0xbd4ea4['attributes']=_[_0x351d('0x2f')](_0x5e6e2a[_0x351d('0x2c')],qs['fields'](_0x318c09['query'][_0x351d('0x30')]));_0xbd4ea4[_0x351d('0x31')]=_0xbd4ea4['attributes'][_0x351d('0x32')]?_0xbd4ea4[_0x351d('0x31')]:_0x5e6e2a[_0x351d('0x2c')];if(!_0x318c09[_0x351d('0x2d')][_0x351d('0x33')](_0x351d('0x34'))){_0xbd4ea4[_0x351d('0x1e')]=qs['limit'](_0x318c09['query'][_0x351d('0x1e')]);_0xbd4ea4['offset']=qs[_0x351d('0x1d')](_0x318c09[_0x351d('0x2d')]['offset']);}_0xbd4ea4['order']=qs[_0x351d('0x35')](_0x318c09[_0x351d('0x2d')][_0x351d('0x35')]);_0xbd4ea4['where']=qs[_0x351d('0x2e')](_['pick'](_0x318c09[_0x351d('0x2d')],_0x5e6e2a['filters']),_0x788400);if(_0x318c09[_0x351d('0x2d')][_0x351d('0x36')]){_0xbd4ea4['where']=_['merge'](_0xbd4ea4[_0x351d('0x37')],{'$or':_['map'](_0x788400,function(_0x19360e){if(_0x19360e['type']!==_0x351d('0x38')){var _0x33c62e={};_0x33c62e[_0x19360e['name']]={'$like':'%'+_0x318c09['query'][_0x351d('0x36')]+'%'};return _0x33c62e;}})});}_0xbd4ea4=_[_0x351d('0x39')]({},_0xbd4ea4,_0x318c09[_0x351d('0x3a')]);var _0x2a10f9={'where':_0xbd4ea4[_0x351d('0x37')]};return db[_0x351d('0x29')][_0x351d('0x1c')](_0x2a10f9)['then'](function(_0x127981){_0x1e44e5[_0x351d('0x1c')]=_0x127981;if(_0x318c09[_0x351d('0x2d')][_0x351d('0x3b')]){_0xbd4ea4[_0x351d('0x3c')]=[{'all':!![]}];}return db[_0x351d('0x29')][_0x351d('0x3d')](_0xbd4ea4);})[_0x351d('0x23')](function(_0x560c9d){_0x1e44e5[_0x351d('0x3e')]=_0x560c9d;return _0x1e44e5;})['then'](respondWithFilteredResult(_0x2d7845,_0xbd4ea4))[_0x351d('0x3f')](handleError(_0x2d7845,null));};exports[_0x351d('0x40')]=function(_0x1a2e01,_0x2c7ba2){var _0x4cc5a4={'raw':!![],'where':{'id':_0x1a2e01[_0x351d('0x41')]['id']}},_0x2f7451={};_0x2f7451[_0x351d('0x2c')]=_['keys'](db[_0x351d('0x29')][_0x351d('0x2a')]);_0x2f7451[_0x351d('0x2d')]=_['keys'](_0x1a2e01['query']);_0x2f7451[_0x351d('0x2e')]=_[_0x351d('0x2f')](_0x2f7451[_0x351d('0x2c')],_0x2f7451[_0x351d('0x2d')]);_0x4cc5a4[_0x351d('0x31')]=_[_0x351d('0x2f')](_0x2f7451[_0x351d('0x2c')],qs[_0x351d('0x30')](_0x1a2e01[_0x351d('0x2d')][_0x351d('0x30')]));_0x4cc5a4[_0x351d('0x31')]=_0x4cc5a4[_0x351d('0x31')][_0x351d('0x32')]?_0x4cc5a4['attributes']:_0x2f7451[_0x351d('0x2c')];if(_0x1a2e01[_0x351d('0x2d')][_0x351d('0x3b')]){_0x4cc5a4[_0x351d('0x3c')]=[{'all':!![]}];}_0x4cc5a4=_[_0x351d('0x39')]({},_0x4cc5a4,_0x1a2e01[_0x351d('0x3a')]);return db[_0x351d('0x29')]['find'](_0x4cc5a4)[_0x351d('0x23')](handleEntityNotFound(_0x2c7ba2,null))[_0x351d('0x23')](respondWithResult(_0x2c7ba2,null))[_0x351d('0x3f')](handleError(_0x2c7ba2,null));};exports[_0x351d('0x42')]=function(_0x477a5a,_0x12b4ad){return db[_0x351d('0x29')]['create'](_0x477a5a[_0x351d('0x43')],{})[_0x351d('0x23')](respondWithResult(_0x12b4ad,0xc9))[_0x351d('0x3f')](handleError(_0x12b4ad,null));};exports[_0x351d('0x22')]=function(_0x371465,_0x244fcf){if(_0x371465[_0x351d('0x43')]['id']){delete _0x371465[_0x351d('0x43')]['id'];}return db[_0x351d('0x29')][_0x351d('0x44')]({'where':{'id':_0x371465[_0x351d('0x41')]['id']}})[_0x351d('0x23')](handleEntityNotFound(_0x244fcf,null))[_0x351d('0x23')](saveUpdates(_0x371465[_0x351d('0x43')],null))['then'](respondWithResult(_0x244fcf,null))[_0x351d('0x3f')](handleError(_0x244fcf,null));};exports[_0x351d('0x45')]=function(_0x54fd4d,_0x25508a){return db[_0x351d('0x29')]['find']({'where':{'id':_0x54fd4d[_0x351d('0x41')]['id']}})[_0x351d('0x23')](handleEntityNotFound(_0x25508a,null))[_0x351d('0x23')](removeEntity(_0x25508a,null))[_0x351d('0x3f')](handleError(_0x25508a,null));};exports[_0x351d('0x46')]=function(_0x411989,_0x57e4bf){return db[_0x351d('0x29')][_0x351d('0x46')]()[_0x351d('0x23')](respondWithResult(_0x57e4bf,null))[_0x351d('0x3f')](handleError(_0x57e4bf,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index f72671b..a3bdf6c 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 _0x1516=['path','rimraf','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2939dd,_0x1483ef){var _0x3e2363=function(_0x57a888){while(--_0x57a888){_0x2939dd['push'](_0x2939dd['shift']());}};_0x3e2363(++_0x1483ef);}(_0x1516,0xb0));var _0x6151=function(_0x7a15e5,_0x248a7d){_0x7a15e5=_0x7a15e5-0x0;var _0x2fefd3=_0x1516[_0x7a15e5];return _0x2fefd3;};'use strict';var _=require(_0x6151('0x0'));var util=require(_0x6151('0x1'));var logger=require(_0x6151('0x2'))('api');var moment=require(_0x6151('0x3'));var BPromise=require(_0x6151('0x4'));var rp=require(_0x6151('0x5'));var fs=require('fs');var path=require(_0x6151('0x6'));var rimraf=require(_0x6151('0x7'));var config=require('../../config/environment');var attributes=require(_0x6151('0x8'));module['exports']=function(_0x69f924,_0x2585cd){return _0x69f924[_0x6151('0x9')](_0x6151('0xa'),attributes,{'tableName':_0x6151('0xb'),'paranoid':![],'indexes':[{'name':_0x6151('0xc'),'fields':[_0x6151('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd125=['report_fax_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxTransferReport.attributes','define','FaxTransferReport'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0xd125,0x92));var _0x5d12=function(_0x2ad781,_0x5b9b39){_0x2ad781=_0x2ad781-0x0;var _0x35dc90=_0xd125[_0x2ad781];return _0x35dc90;};'use strict';var _=require('lodash');var util=require(_0x5d12('0x0'));var logger=require(_0x5d12('0x1'))(_0x5d12('0x2'));var moment=require(_0x5d12('0x3'));var BPromise=require(_0x5d12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d12('0x5'));var rimraf=require(_0x5d12('0x6'));var config=require('../../config/environment');var attributes=require(_0x5d12('0x7'));module['exports']=function(_0x41bae4,_0xe9bee9){return _0x41bae4[_0x5d12('0x8')](_0x5d12('0x9'),attributes,{'tableName':_0x5d12('0xa'),'paranoid':![],'indexes':[{'name':_0x5d12('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 192511a..c51ec98 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 _0xdd42=['FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xdd42,0x132));var _0x2dd4=function(_0x1080b4,_0xe40a25){_0x1080b4=_0x1080b4-0x0;var _0x400509=_0xdd42[_0x1080b4];return _0x400509;};'use strict';var _=require(_0x2dd4('0x0'));var util=require(_0x2dd4('0x1'));var moment=require(_0x2dd4('0x2'));var BPromise=require(_0x2dd4('0x3'));var rs=require(_0x2dd4('0x4'));var fs=require('fs');var Redis=require(_0x2dd4('0x5'));var db=require(_0x2dd4('0x6'))['db'];var utils=require(_0x2dd4('0x7'));var logger=require(_0x2dd4('0x8'))(_0x2dd4('0x9'));var config=require('../../config/environment');var jayson=require(_0x2dd4('0xa'));var client=jayson[_0x2dd4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3b60,_0x282173,_0x186ca6){return new BPromise(function(_0x1f21e0,_0x459bed){return client['request'](_0x4e3b60,_0x186ca6)[_0x2dd4('0xc')](function(_0x1fbd16){logger[_0x2dd4('0xd')](_0x2dd4('0xe'),_0x282173,_0x2dd4('0xf'));logger['debug'](_0x2dd4('0x10'),_0x282173,_0x2dd4('0xf'),JSON[_0x2dd4('0x11')](_0x1fbd16));if(_0x1fbd16['error']){if(_0x1fbd16['error'][_0x2dd4('0x12')]===0x1f4){logger['error'](_0x2dd4('0xe'),_0x282173,_0x1fbd16[_0x2dd4('0x13')]['message']);return _0x459bed(_0x1fbd16[_0x2dd4('0x13')][_0x2dd4('0x14')]);}logger[_0x2dd4('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x282173,_0x1fbd16['error'][_0x2dd4('0x14')]);return _0x1f21e0(_0x1fbd16[_0x2dd4('0x13')][_0x2dd4('0x14')]);}else{logger[_0x2dd4('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x282173,'request\x20sent');_0x1f21e0(_0x1fbd16[_0x2dd4('0x15')][_0x2dd4('0x14')]);}})[_0x2dd4('0x16')](function(_0x4f8be8){logger[_0x2dd4('0x13')](_0x2dd4('0xe'),_0x282173,_0x4f8be8);_0x459bed(_0x4f8be8);});});} \ No newline at end of file +var _0x874d=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x23f50a,_0x1e0fbc){var _0x3d48e2=function(_0x103d6e){while(--_0x103d6e){_0x23f50a['push'](_0x23f50a['shift']());}};_0x3d48e2(++_0x1e0fbc);}(_0x874d,0xa8));var _0xd874=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x874d[_0x4394b6];return _0x360244;};'use strict';var _=require(_0xd874('0x0'));var util=require(_0xd874('0x1'));var moment=require(_0xd874('0x2'));var BPromise=require(_0xd874('0x3'));var rs=require(_0xd874('0x4'));var fs=require('fs');var Redis=require(_0xd874('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd874('0x6'));var logger=require('../../config/logger')(_0xd874('0x7'));var config=require(_0xd874('0x8'));var jayson=require(_0xd874('0x9'));var client=jayson[_0xd874('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a1562,_0x31a616,_0x45c9ab){return new BPromise(function(_0x214dba,_0x5b69e9){return client[_0xd874('0xb')](_0x1a1562,_0x45c9ab)['then'](function(_0x77145a){logger[_0xd874('0xc')](_0xd874('0xd'),_0x31a616,_0xd874('0xe'));logger[_0xd874('0xf')](_0xd874('0x10'),_0x31a616,_0xd874('0xe'),JSON[_0xd874('0x11')](_0x77145a));if(_0x77145a['error']){if(_0x77145a['error']['code']===0x1f4){logger[_0xd874('0x12')](_0xd874('0xd'),_0x31a616,_0x77145a[_0xd874('0x12')][_0xd874('0x13')]);return _0x5b69e9(_0x77145a[_0xd874('0x12')][_0xd874('0x13')]);}logger[_0xd874('0x12')](_0xd874('0xd'),_0x31a616,_0x77145a[_0xd874('0x12')][_0xd874('0x13')]);return _0x214dba(_0x77145a[_0xd874('0x12')][_0xd874('0x13')]);}else{logger[_0xd874('0xc')](_0xd874('0xd'),_0x31a616,_0xd874('0xe'));_0x214dba(_0x77145a[_0xd874('0x14')][_0xd874('0x13')]);}})['catch'](function(_0xde2718){logger[_0xd874('0x12')](_0xd874('0xd'),_0x31a616,_0xde2718);_0x5b69e9(_0xde2718);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index a064092..619ca17 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 _0x5f55=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','multer','util','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x5f55,0x95));var _0x55f5=function(_0x1c7137,_0x4c7c26){_0x1c7137=_0x1c7137-0x0;var _0xeb4432=_0x5f55[_0x1c7137];return _0xeb4432;};'use strict';var multer=require(_0x55f5('0x0'));var util=require(_0x55f5('0x1'));var path=require(_0x55f5('0x2'));var timeout=require('connect-timeout');var express=require(_0x55f5('0x3'));var router=express[_0x55f5('0x4')]();var fs_extra=require(_0x55f5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x55f5('0x6'));var config=require(_0x55f5('0x7'));var controller=require(_0x55f5('0x8'));router[_0x55f5('0x9')]('/',auth[_0x55f5('0xa')](),controller['index']);router[_0x55f5('0x9')]('/describe',auth[_0x55f5('0xa')](),controller[_0x55f5('0xb')]);router[_0x55f5('0x9')](_0x55f5('0xc'),auth[_0x55f5('0xa')](),controller[_0x55f5('0xd')]);router[_0x55f5('0xe')]('/',auth[_0x55f5('0xa')](),controller[_0x55f5('0xf')]);router[_0x55f5('0x10')](_0x55f5('0xc'),auth[_0x55f5('0xa')](),controller[_0x55f5('0x11')]);router['delete'](_0x55f5('0xc'),auth[_0x55f5('0xa')](),controller[_0x55f5('0x12')]);module['exports']=router; \ No newline at end of file +var _0x189e=['connect-timeout','express','Router','../../components/auth/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','destroy','exports','util','path'];(function(_0x20bff0,_0x3c2ac9){var _0x5bb0d0=function(_0x16d9d7){while(--_0x16d9d7){_0x20bff0['push'](_0x20bff0['shift']());}};_0x5bb0d0(++_0x3c2ac9);}(_0x189e,0x11f));var _0xe189=function(_0x3c424f,_0x47c73e){_0x3c424f=_0x3c424f-0x0;var _0x590451=_0x189e[_0x3c424f];return _0x590451;};'use strict';var multer=require('multer');var util=require(_0xe189('0x0'));var path=require(_0xe189('0x1'));var timeout=require(_0xe189('0x2'));var express=require(_0xe189('0x3'));var router=express[_0xe189('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe189('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe189('0x6'));router[_0xe189('0x7')]('/',auth[_0xe189('0x8')](),controller[_0xe189('0x9')]);router['get'](_0xe189('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xe189('0x7')](_0xe189('0xb'),auth[_0xe189('0x8')](),controller[_0xe189('0xc')]);router[_0xe189('0xd')]('/',auth[_0xe189('0x8')](),controller[_0xe189('0xe')]);router['put'](_0xe189('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe189('0xb'),auth[_0xe189('0x8')](),controller[_0xe189('0xf')]);module[_0xe189('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index b892f58..ac1297b 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 _0x52bf=['get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated'];(function(_0x5ad059,_0x14f52c){var _0x548a8d=function(_0x365744){while(--_0x365744){_0x5ad059['push'](_0x5ad059['shift']());}};_0x548a8d(++_0x14f52c);}(_0x52bf,0x146));var _0xf52b=function(_0x5bcf44,_0x66d8c7){_0x5bcf44=_0x5bcf44-0x0;var _0x315c64=_0x52bf[_0x5bcf44];return _0x315c64;};'use strict';var multer=require(_0xf52b('0x0'));var util=require(_0xf52b('0x1'));var path=require(_0xf52b('0x2'));var timeout=require(_0xf52b('0x3'));var express=require(_0xf52b('0x4'));var router=express[_0xf52b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf52b('0x6'));var config=require(_0xf52b('0x7'));var controller=require(_0xf52b('0x8'));router['get']('/',auth[_0xf52b('0x9')](),controller['index']);router[_0xf52b('0xa')]('/:id',auth[_0xf52b('0x9')](),controller[_0xf52b('0xb')]);router[_0xf52b('0xa')](_0xf52b('0xc'),auth['isAuthenticated'](),controller[_0xf52b('0xd')]);router[_0xf52b('0xa')](_0xf52b('0xe'),auth[_0xf52b('0x9')](),controller[_0xf52b('0xf')]);router[_0xf52b('0x10')]('/',auth[_0xf52b('0x9')](),controller[_0xf52b('0x11')]);router[_0xf52b('0x10')](_0xf52b('0xc'),auth[_0xf52b('0x9')](),controller[_0xf52b('0x12')]);router[_0xf52b('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf52b('0x14')](_0xf52b('0x15'),auth[_0xf52b('0x9')](),controller[_0xf52b('0x16')]);module[_0xf52b('0x17')]=router; \ No newline at end of file +var _0x7c95=['isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','index','get','/:id'];(function(_0x714755,_0x316444){var _0x1cbb8a=function(_0x2c9653){while(--_0x2c9653){_0x714755['push'](_0x714755['shift']());}};_0x1cbb8a(++_0x316444);}(_0x7c95,0x1a3));var _0x57c9=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x7c95[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0x57c9('0x0'));var util=require(_0x57c9('0x1'));var path=require(_0x57c9('0x2'));var timeout=require(_0x57c9('0x3'));var express=require('express');var router=express[_0x57c9('0x4')]();var fs_extra=require(_0x57c9('0x5'));var auth=require(_0x57c9('0x6'));var interaction=require(_0x57c9('0x7'));var config=require(_0x57c9('0x8'));var controller=require(_0x57c9('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x57c9('0xa')]);router[_0x57c9('0xb')](_0x57c9('0xc'),auth[_0x57c9('0xd')](),controller[_0x57c9('0xe')]);router['get'](_0x57c9('0xf'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x57c9('0xb')](_0x57c9('0x10'),auth['isAuthenticated'](),controller[_0x57c9('0x11')]);router[_0x57c9('0x12')]('/',auth[_0x57c9('0xd')](),controller['create']);router[_0x57c9('0x12')]('/:id/configurations',auth[_0x57c9('0xd')](),controller[_0x57c9('0x13')]);router[_0x57c9('0x14')]('/:id',auth[_0x57c9('0xd')](),controller[_0x57c9('0x15')]);router[_0x57c9('0x16')](_0x57c9('0xc'),auth[_0x57c9('0xd')](),controller['destroy']);module[_0x57c9('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 79104d0..dd320a0 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 _0x8491=['STRING','integrationTab','newTab','sequelize','exports'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x8491,0xd0));var _0x1849=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x8491[_0x38ced4];return _0x547c07;};'use strict';var Sequelize=require(_0x1849('0x0'));module[_0x1849('0x1')]={'name':{'type':Sequelize[_0x1849('0x2')]},'description':{'type':Sequelize[_0x1849('0x2')]},'username':{'type':Sequelize[_0x1849('0x2')]},'remoteUri':{'type':Sequelize[_0x1849('0x2')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x1849('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x1849('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1849('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x1849('0x3'),_0x1849('0x4')),'defaultValue':_0x1849('0x3')}}; \ No newline at end of file +var _0x405e=['basic','ENUM','integrationTab','newTab','exports','STRING'];(function(_0x28f667,_0x33c890){var _0x432b4e=function(_0x1e593e){while(--_0x1e593e){_0x28f667['push'](_0x28f667['shift']());}};_0x432b4e(++_0x33c890);}(_0x405e,0x1cc));var _0xe405=function(_0x388fc1,_0x31de00){_0x388fc1=_0x388fc1-0x0;var _0x2c2219=_0x405e[_0x388fc1];return _0x2c2219;};'use strict';var Sequelize=require('sequelize');module[_0xe405('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe405('0x1')]},'username':{'type':Sequelize[_0xe405('0x1')]},'remoteUri':{'type':Sequelize[_0xe405('0x1')]},'authType':{'type':Sequelize['ENUM'](_0xe405('0x2')),'defaultValue':_0xe405('0x2')},'password':{'type':Sequelize[_0xe405('0x1')]},'consumerKey':{'type':Sequelize[_0xe405('0x1')]},'consumerSecret':{'type':Sequelize[_0xe405('0x1')]},'token':{'type':Sequelize[_0xe405('0x1')]},'tokenSecret':{'type':Sequelize[_0xe405('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe405('0x3')](_0xe405('0x4'),_0xe405('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 1d87835..afe36bb 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 _0xea4c=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','end','error','name','index','map','DeskAccount','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','username','consumerKey','tokenSecret','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','authType','Authorization','format','Basic\x20%s','%s:%s','password','base64','_embedded','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','fast-json-patch','bluebird','mustache'];(function(_0x30ec76,_0x317b54){var _0x3adacf=function(_0x33692a){while(--_0x33692a){_0x30ec76['push'](_0x30ec76['shift']());}};_0x3adacf(++_0x317b54);}(_0xea4c,0x148));var _0xcea4=function(_0x15c722,_0x56ac83){_0x15c722=_0x15c722-0x0;var _0x597e0c=_0xea4c[_0x15c722];return _0x597e0c;};'use strict';var emlformat=require(_0xcea4('0x0'));var rimraf=require(_0xcea4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcea4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcea4('0x3'));var Mustache=require(_0xcea4('0x4'));var util=require('util');var path=require(_0xcea4('0x5'));var sox=require(_0xcea4('0x6'));var csv=require(_0xcea4('0x7'));var ejs=require(_0xcea4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcea4('0x9'));var squel=require(_0xcea4('0xa'));var crypto=require(_0xcea4('0xb'));var jsforce=require(_0xcea4('0xc'));var deskjs=require(_0xcea4('0xd'));var toCsv=require(_0xcea4('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcea4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcea4('0xf'));var as=require(_0xcea4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcea4('0x11'))(_0xcea4('0x12'));var utils=require(_0xcea4('0x13'));var config=require(_0xcea4('0x14'));var licenseUtil=require(_0xcea4('0x15'));var db=require(_0xcea4('0x16'))['db'];var integrations=require(_0xcea4('0x17'));function respondWithStatusCode(_0x787bfa,_0x317752){_0x317752=_0x317752||0xcc;return function(_0x10e739){if(_0x10e739){return _0x787bfa[_0xcea4('0x18')](_0x317752);}return _0x787bfa['status'](_0x317752)['end']();};}function respondWithResult(_0x16a875,_0x24e58c){_0x24e58c=_0x24e58c||0xc8;return function(_0x870233){if(_0x870233){return _0x16a875[_0xcea4('0x19')](_0x24e58c)[_0xcea4('0x1a')](_0x870233);}};}function respondWithFilteredResult(_0x47239f,_0x531ecb){return function(_0x59af79){if(_0x59af79){var _0x41fed4=typeof _0x531ecb[_0xcea4('0x1b')]==='undefined'&&typeof _0x531ecb[_0xcea4('0x1c')]===_0xcea4('0x1d');var _0x2c0f70=_0x59af79[_0xcea4('0x1e')];var _0x3477f9=_0x41fed4?0x0:_0x531ecb[_0xcea4('0x1b')];var _0x1c3e6e=_0x41fed4?_0x59af79[_0xcea4('0x1e')]:_0x531ecb[_0xcea4('0x1b')]+_0x531ecb['limit'];var _0x22c6dc;if(_0x1c3e6e>=_0x2c0f70){_0x1c3e6e=_0x2c0f70;_0x22c6dc=0xc8;}else{_0x22c6dc=0xce;}_0x47239f['status'](_0x22c6dc);return _0x47239f[_0xcea4('0x1f')](_0xcea4('0x20'),_0x3477f9+'-'+_0x1c3e6e+'/'+_0x2c0f70)['json'](_0x59af79);}return null;};}function patchUpdates(_0x552fcc){return function(_0x235d2d){try{jsonpatch[_0xcea4('0x21')](_0x235d2d,_0x552fcc,!![]);}catch(_0x5254f7){return BPromise[_0xcea4('0x22')](_0x5254f7);}return _0x235d2d[_0xcea4('0x23')]();};}function saveUpdates(_0x564269,_0x38fcd7){return function(_0x4baaaa){if(_0x4baaaa){return _0x4baaaa[_0xcea4('0x24')](_0x564269)[_0xcea4('0x25')](function(_0x59693a){return _0x59693a;});}return null;};}function removeEntity(_0x232450,_0x3aeb5a){return function(_0x75490a){if(_0x75490a){return _0x75490a['destroy']()[_0xcea4('0x25')](function(){_0x232450[_0xcea4('0x19')](0xcc)[_0xcea4('0x26')]();});}};}function handleEntityNotFound(_0x48eab6,_0x2ec143){return function(_0x2256ad){if(!_0x2256ad){_0x48eab6['sendStatus'](0x194);}return _0x2256ad;};}function handleError(_0x4ba981,_0x11d7cc){_0x11d7cc=_0x11d7cc||0x1f4;return function(_0x2979fd){logger[_0xcea4('0x27')](_0x2979fd['stack']);if(_0x2979fd[_0xcea4('0x28')]){delete _0x2979fd[_0xcea4('0x28')];}_0x4ba981['status'](_0x11d7cc)['send'](_0x2979fd);};}exports[_0xcea4('0x29')]=function(_0x1d239c,_0x2f058c){var _0x3b2ceb={},_0x4e07ac={},_0x5d89bc={'count':0x0,'rows':[]};var _0x7ee1f2=_[_0xcea4('0x2a')](db[_0xcea4('0x2b')][_0xcea4('0x2c')],function(_0x826bb6){return{'name':_0x826bb6[_0xcea4('0x2d')],'type':_0x826bb6['type']['key']};});_0x4e07ac['model']=_[_0xcea4('0x2a')](_0x7ee1f2,_0xcea4('0x28'));_0x4e07ac[_0xcea4('0x2e')]=_[_0xcea4('0x2f')](_0x1d239c[_0xcea4('0x2e')]);_0x4e07ac[_0xcea4('0x30')]=_[_0xcea4('0x31')](_0x4e07ac['model'],_0x4e07ac[_0xcea4('0x2e')]);_0x3b2ceb['attributes']=_[_0xcea4('0x31')](_0x4e07ac[_0xcea4('0x32')],qs[_0xcea4('0x33')](_0x1d239c['query']['fields']));_0x3b2ceb[_0xcea4('0x34')]=_0x3b2ceb[_0xcea4('0x34')][_0xcea4('0x35')]?_0x3b2ceb['attributes']:_0x4e07ac[_0xcea4('0x32')];if(!_0x1d239c[_0xcea4('0x2e')][_0xcea4('0x36')](_0xcea4('0x37'))){_0x3b2ceb[_0xcea4('0x1c')]=qs[_0xcea4('0x1c')](_0x1d239c[_0xcea4('0x2e')][_0xcea4('0x1c')]);_0x3b2ceb[_0xcea4('0x1b')]=qs[_0xcea4('0x1b')](_0x1d239c['query'][_0xcea4('0x1b')]);}_0x3b2ceb[_0xcea4('0x38')]=qs['sort'](_0x1d239c[_0xcea4('0x2e')][_0xcea4('0x39')]);_0x3b2ceb[_0xcea4('0x3a')]=qs[_0xcea4('0x30')](_[_0xcea4('0x3b')](_0x1d239c['query'],_0x4e07ac[_0xcea4('0x30')]),_0x7ee1f2);if(_0x1d239c[_0xcea4('0x2e')][_0xcea4('0x3c')]){_0x3b2ceb[_0xcea4('0x3a')]=_[_0xcea4('0x3d')](_0x3b2ceb['where'],{'$or':_[_0xcea4('0x2a')](_0x7ee1f2,function(_0xb58d29){if(_0xb58d29['type']!==_0xcea4('0x3e')){var _0x5cf0fa={};_0x5cf0fa[_0xb58d29[_0xcea4('0x28')]]={'$like':'%'+_0x1d239c[_0xcea4('0x2e')][_0xcea4('0x3c')]+'%'};return _0x5cf0fa;}})});}_0x3b2ceb=_[_0xcea4('0x3d')]({},_0x3b2ceb,_0x1d239c[_0xcea4('0x3f')]);var _0x27e66f={'where':_0x3b2ceb[_0xcea4('0x3a')]};return db['DeskAccount'][_0xcea4('0x1e')](_0x27e66f)[_0xcea4('0x25')](function(_0x12014a){_0x5d89bc[_0xcea4('0x1e')]=_0x12014a;if(_0x1d239c[_0xcea4('0x2e')][_0xcea4('0x40')]){_0x3b2ceb[_0xcea4('0x41')]=[{'all':!![]}];}return db[_0xcea4('0x2b')]['findAll'](_0x3b2ceb);})[_0xcea4('0x25')](function(_0x4ab002){_0x5d89bc['rows']=_0x4ab002;return _0x5d89bc;})[_0xcea4('0x25')](respondWithFilteredResult(_0x2f058c,_0x3b2ceb))[_0xcea4('0x42')](handleError(_0x2f058c,null));};exports[_0xcea4('0x43')]=function(_0x268037,_0x3259c3){var _0x1d1bc9={'raw':![],'where':{'id':_0x268037[_0xcea4('0x44')]['id']}},_0x384851={};_0x384851['model']=_['keys'](db[_0xcea4('0x2b')]['rawAttributes']);_0x384851[_0xcea4('0x2e')]=_['keys'](_0x268037[_0xcea4('0x2e')]);_0x384851[_0xcea4('0x30')]=_[_0xcea4('0x31')](_0x384851[_0xcea4('0x32')],_0x384851[_0xcea4('0x2e')]);_0x1d1bc9[_0xcea4('0x34')]=_[_0xcea4('0x31')](_0x384851[_0xcea4('0x32')],qs['fields'](_0x268037[_0xcea4('0x2e')][_0xcea4('0x33')]));_0x1d1bc9['attributes']=_0x1d1bc9['attributes'][_0xcea4('0x35')]?_0x1d1bc9['attributes']:_0x384851[_0xcea4('0x32')];if(_0x268037[_0xcea4('0x2e')][_0xcea4('0x40')]){_0x1d1bc9[_0xcea4('0x41')]=[{'all':!![]}];}_0x1d1bc9=_[_0xcea4('0x3d')]({},_0x1d1bc9,_0x268037[_0xcea4('0x3f')]);return db[_0xcea4('0x2b')][_0xcea4('0x45')](_0x1d1bc9)['then'](handleEntityNotFound(_0x3259c3,null))['then'](respondWithResult(_0x3259c3,null))[_0xcea4('0x42')](handleError(_0x3259c3,null));};exports[_0xcea4('0x46')]=function(_0x3f7323,_0x33339d){return db[_0xcea4('0x2b')][_0xcea4('0x46')](_0x3f7323[_0xcea4('0x47')],{})[_0xcea4('0x25')](respondWithResult(_0x33339d,0xc9))[_0xcea4('0x42')](handleError(_0x33339d,null));};exports['update']=function(_0x3904f9,_0x1c17e3){if(_0x3904f9[_0xcea4('0x47')]['id']){delete _0x3904f9['body']['id'];}return db['DeskAccount'][_0xcea4('0x45')]({'where':{'id':_0x3904f9[_0xcea4('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c17e3,null))[_0xcea4('0x25')](saveUpdates(_0x3904f9[_0xcea4('0x47')],null))[_0xcea4('0x25')](respondWithResult(_0x1c17e3,null))[_0xcea4('0x42')](handleError(_0x1c17e3,null));};exports[_0xcea4('0x48')]=function(_0x3acac4,_0x5ad093){return db[_0xcea4('0x2b')][_0xcea4('0x45')]({'where':{'id':_0x3acac4[_0xcea4('0x44')]['id']}})[_0xcea4('0x25')](handleEntityNotFound(_0x5ad093,null))[_0xcea4('0x25')](removeEntity(_0x5ad093,null))[_0xcea4('0x42')](handleError(_0x5ad093,null));};exports[_0xcea4('0x49')]=function(_0x2263fa,_0x1fe5da,_0x2a0c32){var _0x573144={};var _0x2d1bfd={};var _0x186351;var _0x51461d;return db[_0xcea4('0x2b')][_0xcea4('0x4a')]({'where':{'id':_0x2263fa[_0xcea4('0x44')]['id']}})[_0xcea4('0x25')](handleEntityNotFound(_0x1fe5da,null))[_0xcea4('0x25')](function(_0x423c94){if(_0x423c94){_0x186351=_0x423c94;_0x2d1bfd[_0xcea4('0x32')]=_[_0xcea4('0x2f')](db[_0xcea4('0x4b')][_0xcea4('0x2c')]);_0x2d1bfd[_0xcea4('0x2e')]=_[_0xcea4('0x2f')](_0x2263fa[_0xcea4('0x2e')]);_0x2d1bfd[_0xcea4('0x30')]=_['intersection'](_0x2d1bfd['model'],_0x2d1bfd[_0xcea4('0x2e')]);_0x573144[_0xcea4('0x34')]=_[_0xcea4('0x31')](_0x2d1bfd['model'],qs[_0xcea4('0x33')](_0x2263fa[_0xcea4('0x2e')]['fields']));_0x573144[_0xcea4('0x34')]=_0x573144[_0xcea4('0x34')][_0xcea4('0x35')]?_0x573144[_0xcea4('0x34')]:_0x2d1bfd[_0xcea4('0x32')];_0x573144[_0xcea4('0x38')]=qs['sort'](_0x2263fa[_0xcea4('0x2e')]['sort']);_0x573144[_0xcea4('0x3a')]=qs['filters'](_[_0xcea4('0x3b')](_0x2263fa[_0xcea4('0x2e')],_0x2d1bfd[_0xcea4('0x30')]));if(_0x2263fa['query'][_0xcea4('0x3c')]){_0x573144[_0xcea4('0x3a')]=_[_0xcea4('0x3d')](_0x573144[_0xcea4('0x3a')],{'$or':_[_0xcea4('0x2a')](_0x573144[_0xcea4('0x34')],function(_0x1767cb){var _0x17d893={};_0x17d893[_0x1767cb]={'$like':'%'+_0x2263fa[_0xcea4('0x2e')]['filter']+'%'};return _0x17d893;})});}_0x573144=_[_0xcea4('0x3d')]({},_0x573144,_0x2263fa[_0xcea4('0x3f')]);return _0x186351[_0xcea4('0x49')](_0x573144);}})[_0xcea4('0x25')](function(_0x467a97){if(_0x467a97){_0x51461d=_0x467a97[_0xcea4('0x35')];if(!_0x2263fa['query']['hasOwnProperty'](_0xcea4('0x37'))){_0x573144['limit']=qs[_0xcea4('0x1c')](_0x2263fa[_0xcea4('0x2e')]['limit']);_0x573144['offset']=qs['offset'](_0x2263fa[_0xcea4('0x2e')][_0xcea4('0x1b')]);}return _0x186351[_0xcea4('0x49')](_0x573144);}})['then'](function(_0x14d76b){if(_0x14d76b){return _0x14d76b?{'count':_0x51461d,'rows':_0x14d76b}:null;}})['then'](respondWithResult(_0x1fe5da,null))[_0xcea4('0x42')](handleError(_0x1fe5da,null));};exports['addConfiguration']=function(_0x5573cb,_0x178748,_0x3d6ac3){if(_0x5573cb[_0xcea4('0x47')]['id']){delete _0x5573cb[_0xcea4('0x47')]['id'];}return db[_0xcea4('0x2b')][_0xcea4('0x4a')]({'where':{'id':_0x5573cb[_0xcea4('0x44')]['id']}})[_0xcea4('0x25')](handleEntityNotFound(_0x178748,null))[_0xcea4('0x25')](function(_0x29b069){if(_0x29b069){_0x5573cb['body'][_0xcea4('0x4c')]=_0x29b069['id'];_0x5573cb['body'][_0xcea4('0x4d')]=integrations[_0xcea4('0x4e')](_0x5573cb[_0xcea4('0x47')]['channel'],_0x5573cb[_0xcea4('0x47')][_0xcea4('0x4f')]);_0x5573cb[_0xcea4('0x47')][_0xcea4('0x50')]=integrations[_0xcea4('0x51')](_0x5573cb[_0xcea4('0x47')][_0xcea4('0x52')],_0x5573cb['body'][_0xcea4('0x4f')]);return db[_0xcea4('0x4b')][_0xcea4('0x46')](_0x5573cb[_0xcea4('0x47')],{'include':[{'model':db[_0xcea4('0x53')],'as':_0xcea4('0x4d')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x178748,null))[_0xcea4('0x42')](handleError(_0x178748,null));};exports[_0xcea4('0x54')]=function(_0xa19df,_0x5a1b52,_0x20c0df){var _0xd4b6b7=[{'name':_0xcea4('0x55'),'label':_0xcea4('0x55'),'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 _0x5ea938='';return db[_0xcea4('0x2b')][_0xcea4('0x4a')]({'where':{'id':_0xa19df['params']['id']},'attributes':['id',_0xcea4('0x56'),'authType',_0xcea4('0x57'),'password',_0xcea4('0x58'),'consumerSecret','token',_0xcea4('0x59')]})[_0xcea4('0x25')](handleEntityNotFound(_0x5a1b52,null))[_0xcea4('0x25')](function(_0x43df8c){if(_0x43df8c){_0x5ea938=_0x43df8c['remoteUri'];var _0x5a6962=_0x5ea938[_0xcea4('0x5a')](-0x1);if(_0x5a6962==='/'){_0x5ea938=_0x5ea938[_0xcea4('0x5b')](0x0,_0x5ea938[_0xcea4('0x5c')](_0x5a6962));}var _0x56f7c4={'method':_0xcea4('0x5d'),'uri':util['format'](_0xcea4('0x5e'),_0x5ea938),'headers':{'Content-Type':_0xcea4('0x5f'),'Accept':_0xcea4('0x5f')},'json':!![]};if(_0x43df8c[_0xcea4('0x60')]==='basic'){_0x56f7c4['headers'][_0xcea4('0x61')]=util[_0xcea4('0x62')](_0xcea4('0x63'),new Buffer(util[_0xcea4('0x62')](_0xcea4('0x64'),_0x43df8c[_0xcea4('0x57')],_0x43df8c[_0xcea4('0x65')]))['toString'](_0xcea4('0x66')));}return rp(_0x56f7c4)[_0xcea4('0x25')](function(_0x18e606){return _0xd4b6b7['concat'](_[_0xcea4('0x2a')](_0x18e606[_0xcea4('0x67')][_0xcea4('0x68')],function(_0x14b9b6){return{'id':_0x14b9b6[_0xcea4('0x28')],'name':_0x14b9b6[_0xcea4('0x28')],'type':_0x14b9b6['type'],'active':_0x14b9b6[_0xcea4('0x69')],'label':_0x14b9b6['label'],'custom':!![]};}));});}})['then'](function(_0x16eb2c){return{'count':_0x16eb2c[_0xcea4('0x35')],'rows':_0x16eb2c};})[_0xcea4('0x25')](respondWithResult(_0x5a1b52,null))[_0xcea4('0x42')](function(_0x342440){var _0x482212=_0xa19df['query'][_0xcea4('0x6a')]?0x1f4:_0x342440[_0xcea4('0x6b')]||0x1f4;logger['error'](_0xcea4('0x6c'),_0xcea4('0x54'),_0x482212,JSON[_0xcea4('0x6d')](_0x342440));delete _0x342440['name'];if(_0x482212===0x191){_0x482212=0x190;}_0x5a1b52[_0xcea4('0x19')](_0x482212)[_0xcea4('0x6e')](_0xa19df['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x342440[_0xcea4('0x6b')]}:_0x342440);});}; \ No newline at end of file +var _0x1f56=['desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','DeskAccount','includeAll','include','rows','catch','show','params','fields','length','find','create','update','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','priority','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','lastIndexOf','GET','format','application/json','authType','basic','headers','%s:%s','toString','base64','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce'];(function(_0x1145d7,_0x160a6f){var _0x3dae17=function(_0x48e79a){while(--_0x48e79a){_0x1145d7['push'](_0x1145d7['shift']());}};_0x3dae17(++_0x160a6f);}(_0x1f56,0xd2));var _0x61f5=function(_0x43de9d,_0x208bf1){_0x43de9d=_0x43de9d-0x0;var _0x3212b9=_0x1f56[_0x43de9d];return _0x3212b9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x61f5('0x0'));var jsonpatch=require(_0x61f5('0x1'));var rp=require(_0x61f5('0x2'));var moment=require(_0x61f5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x61f5('0x4'));var csv=require(_0x61f5('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x61f5('0x6'));var _=require('lodash');var squel=require(_0x61f5('0x7'));var crypto=require(_0x61f5('0x8'));var jsforce=require(_0x61f5('0x9'));var deskjs=require(_0x61f5('0xa'));var toCsv=require(_0x61f5('0x5'));var querystring=require('querystring');var Papa=require(_0x61f5('0xb'));var Redis=require('ioredis');var authService=require(_0x61f5('0xc'));var qs=require(_0x61f5('0xd'));var as=require(_0x61f5('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61f5('0xf'))(_0x61f5('0x10'));var utils=require(_0x61f5('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x61f5('0x12'));var db=require(_0x61f5('0x13'))['db'];var integrations=require(_0x61f5('0x14'));function respondWithStatusCode(_0x2d6c1c,_0x36477f){_0x36477f=_0x36477f||0xcc;return function(_0x58e812){if(_0x58e812){return _0x2d6c1c[_0x61f5('0x15')](_0x36477f);}return _0x2d6c1c[_0x61f5('0x16')](_0x36477f)[_0x61f5('0x17')]();};}function respondWithResult(_0x796c6f,_0x2d7d48){_0x2d7d48=_0x2d7d48||0xc8;return function(_0x247285){if(_0x247285){return _0x796c6f[_0x61f5('0x16')](_0x2d7d48)[_0x61f5('0x18')](_0x247285);}};}function respondWithFilteredResult(_0xc0c6e4,_0x183fba){return function(_0x41f64c){if(_0x41f64c){var _0x599541=typeof _0x183fba[_0x61f5('0x19')]===_0x61f5('0x1a')&&typeof _0x183fba[_0x61f5('0x1b')]===_0x61f5('0x1a');var _0x355c47=_0x41f64c[_0x61f5('0x1c')];var _0x428e4b=_0x599541?0x0:_0x183fba[_0x61f5('0x19')];var _0x1c2d12=_0x599541?_0x41f64c[_0x61f5('0x1c')]:_0x183fba[_0x61f5('0x19')]+_0x183fba[_0x61f5('0x1b')];var _0x339596;if(_0x1c2d12>=_0x355c47){_0x1c2d12=_0x355c47;_0x339596=0xc8;}else{_0x339596=0xce;}_0xc0c6e4['status'](_0x339596);return _0xc0c6e4['set']('Content-Range',_0x428e4b+'-'+_0x1c2d12+'/'+_0x355c47)[_0x61f5('0x18')](_0x41f64c);}return null;};}function patchUpdates(_0x31def3){return function(_0x27735c){try{jsonpatch[_0x61f5('0x1d')](_0x27735c,_0x31def3,!![]);}catch(_0x156e24){return BPromise['reject'](_0x156e24);}return _0x27735c[_0x61f5('0x1e')]();};}function saveUpdates(_0x2f60d7,_0x3548fd){return function(_0x3dad99){if(_0x3dad99){return _0x3dad99['update'](_0x2f60d7)[_0x61f5('0x1f')](function(_0x52217c){return _0x52217c;});}return null;};}function removeEntity(_0x5b6f52,_0x416cc6){return function(_0xdf2338){if(_0xdf2338){return _0xdf2338[_0x61f5('0x20')]()[_0x61f5('0x1f')](function(){_0x5b6f52[_0x61f5('0x16')](0xcc)[_0x61f5('0x17')]();});}};}function handleEntityNotFound(_0x6431ea,_0x28e403){return function(_0x591527){if(!_0x591527){_0x6431ea[_0x61f5('0x15')](0x194);}return _0x591527;};}function handleError(_0x1e5455,_0x7ab42a){_0x7ab42a=_0x7ab42a||0x1f4;return function(_0x54dcec){logger[_0x61f5('0x21')](_0x54dcec[_0x61f5('0x22')]);if(_0x54dcec[_0x61f5('0x23')]){delete _0x54dcec[_0x61f5('0x23')];}_0x1e5455['status'](_0x7ab42a)[_0x61f5('0x24')](_0x54dcec);};}exports[_0x61f5('0x25')]=function(_0x4c20ea,_0x2cd341){var _0x5445d1={},_0x367083={},_0x5aeb39={'count':0x0,'rows':[]};var _0x124c2d=_[_0x61f5('0x26')](db['DeskAccount'][_0x61f5('0x27')],function(_0x1f00e9){return{'name':_0x1f00e9[_0x61f5('0x28')],'type':_0x1f00e9['type']['key']};});_0x367083[_0x61f5('0x29')]=_[_0x61f5('0x26')](_0x124c2d,'name');_0x367083[_0x61f5('0x2a')]=_[_0x61f5('0x2b')](_0x4c20ea['query']);_0x367083[_0x61f5('0x2c')]=_[_0x61f5('0x2d')](_0x367083[_0x61f5('0x29')],_0x367083[_0x61f5('0x2a')]);_0x5445d1[_0x61f5('0x2e')]=_['intersection'](_0x367083['model'],qs['fields'](_0x4c20ea['query']['fields']));_0x5445d1[_0x61f5('0x2e')]=_0x5445d1['attributes']['length']?_0x5445d1[_0x61f5('0x2e')]:_0x367083[_0x61f5('0x29')];if(!_0x4c20ea[_0x61f5('0x2a')][_0x61f5('0x2f')](_0x61f5('0x30'))){_0x5445d1[_0x61f5('0x1b')]=qs[_0x61f5('0x1b')](_0x4c20ea['query'][_0x61f5('0x1b')]);_0x5445d1[_0x61f5('0x19')]=qs['offset'](_0x4c20ea[_0x61f5('0x2a')][_0x61f5('0x19')]);}_0x5445d1[_0x61f5('0x31')]=qs[_0x61f5('0x32')](_0x4c20ea[_0x61f5('0x2a')][_0x61f5('0x32')]);_0x5445d1[_0x61f5('0x33')]=qs[_0x61f5('0x2c')](_[_0x61f5('0x34')](_0x4c20ea[_0x61f5('0x2a')],_0x367083[_0x61f5('0x2c')]),_0x124c2d);if(_0x4c20ea['query'][_0x61f5('0x35')]){_0x5445d1[_0x61f5('0x33')]=_[_0x61f5('0x36')](_0x5445d1['where'],{'$or':_[_0x61f5('0x26')](_0x124c2d,function(_0x4b634e){if(_0x4b634e[_0x61f5('0x37')]!==_0x61f5('0x38')){var _0x4889c8={};_0x4889c8[_0x4b634e[_0x61f5('0x23')]]={'$like':'%'+_0x4c20ea[_0x61f5('0x2a')]['filter']+'%'};return _0x4889c8;}})});}_0x5445d1=_[_0x61f5('0x36')]({},_0x5445d1,_0x4c20ea[_0x61f5('0x39')]);var _0x32a8c1={'where':_0x5445d1[_0x61f5('0x33')]};return db[_0x61f5('0x3a')][_0x61f5('0x1c')](_0x32a8c1)[_0x61f5('0x1f')](function(_0x350499){_0x5aeb39[_0x61f5('0x1c')]=_0x350499;if(_0x4c20ea['query'][_0x61f5('0x3b')]){_0x5445d1[_0x61f5('0x3c')]=[{'all':!![]}];}return db[_0x61f5('0x3a')]['findAll'](_0x5445d1);})[_0x61f5('0x1f')](function(_0x3a9638){_0x5aeb39[_0x61f5('0x3d')]=_0x3a9638;return _0x5aeb39;})['then'](respondWithFilteredResult(_0x2cd341,_0x5445d1))[_0x61f5('0x3e')](handleError(_0x2cd341,null));};exports[_0x61f5('0x3f')]=function(_0x377577,_0xbe9fa3){var _0x5f48ea={'raw':![],'where':{'id':_0x377577[_0x61f5('0x40')]['id']}},_0x39cf34={};_0x39cf34[_0x61f5('0x29')]=_[_0x61f5('0x2b')](db['DeskAccount'][_0x61f5('0x27')]);_0x39cf34[_0x61f5('0x2a')]=_[_0x61f5('0x2b')](_0x377577[_0x61f5('0x2a')]);_0x39cf34[_0x61f5('0x2c')]=_[_0x61f5('0x2d')](_0x39cf34[_0x61f5('0x29')],_0x39cf34[_0x61f5('0x2a')]);_0x5f48ea[_0x61f5('0x2e')]=_[_0x61f5('0x2d')](_0x39cf34[_0x61f5('0x29')],qs[_0x61f5('0x41')](_0x377577[_0x61f5('0x2a')][_0x61f5('0x41')]));_0x5f48ea[_0x61f5('0x2e')]=_0x5f48ea['attributes'][_0x61f5('0x42')]?_0x5f48ea[_0x61f5('0x2e')]:_0x39cf34[_0x61f5('0x29')];if(_0x377577[_0x61f5('0x2a')][_0x61f5('0x3b')]){_0x5f48ea[_0x61f5('0x3c')]=[{'all':!![]}];}_0x5f48ea=_[_0x61f5('0x36')]({},_0x5f48ea,_0x377577[_0x61f5('0x39')]);return db['DeskAccount'][_0x61f5('0x43')](_0x5f48ea)[_0x61f5('0x1f')](handleEntityNotFound(_0xbe9fa3,null))[_0x61f5('0x1f')](respondWithResult(_0xbe9fa3,null))['catch'](handleError(_0xbe9fa3,null));};exports[_0x61f5('0x44')]=function(_0x2e7d20,_0x12eae2){return db[_0x61f5('0x3a')][_0x61f5('0x44')](_0x2e7d20['body'],{})[_0x61f5('0x1f')](respondWithResult(_0x12eae2,0xc9))[_0x61f5('0x3e')](handleError(_0x12eae2,null));};exports[_0x61f5('0x45')]=function(_0x38b73b,_0x1217fc){if(_0x38b73b['body']['id']){delete _0x38b73b['body']['id'];}return db[_0x61f5('0x3a')]['find']({'where':{'id':_0x38b73b[_0x61f5('0x40')]['id']}})[_0x61f5('0x1f')](handleEntityNotFound(_0x1217fc,null))[_0x61f5('0x1f')](saveUpdates(_0x38b73b[_0x61f5('0x46')],null))[_0x61f5('0x1f')](respondWithResult(_0x1217fc,null))[_0x61f5('0x3e')](handleError(_0x1217fc,null));};exports[_0x61f5('0x20')]=function(_0x2b9e53,_0x20d506){return db[_0x61f5('0x3a')][_0x61f5('0x43')]({'where':{'id':_0x2b9e53[_0x61f5('0x40')]['id']}})[_0x61f5('0x1f')](handleEntityNotFound(_0x20d506,null))[_0x61f5('0x1f')](removeEntity(_0x20d506,null))[_0x61f5('0x3e')](handleError(_0x20d506,null));};exports[_0x61f5('0x47')]=function(_0x14d3f8,_0xb188d8,_0x3d9113){var _0x1bb553={};var _0x1fb7b5={};var _0x404d1f;var _0x155cef;return db[_0x61f5('0x3a')][_0x61f5('0x48')]({'where':{'id':_0x14d3f8[_0x61f5('0x40')]['id']}})['then'](handleEntityNotFound(_0xb188d8,null))['then'](function(_0x902f9b){if(_0x902f9b){_0x404d1f=_0x902f9b;_0x1fb7b5['model']=_[_0x61f5('0x2b')](db[_0x61f5('0x49')]['rawAttributes']);_0x1fb7b5[_0x61f5('0x2a')]=_['keys'](_0x14d3f8[_0x61f5('0x2a')]);_0x1fb7b5[_0x61f5('0x2c')]=_['intersection'](_0x1fb7b5['model'],_0x1fb7b5[_0x61f5('0x2a')]);_0x1bb553[_0x61f5('0x2e')]=_[_0x61f5('0x2d')](_0x1fb7b5[_0x61f5('0x29')],qs['fields'](_0x14d3f8[_0x61f5('0x2a')][_0x61f5('0x41')]));_0x1bb553['attributes']=_0x1bb553[_0x61f5('0x2e')]['length']?_0x1bb553['attributes']:_0x1fb7b5['model'];_0x1bb553['order']=qs[_0x61f5('0x32')](_0x14d3f8['query'][_0x61f5('0x32')]);_0x1bb553['where']=qs['filters'](_[_0x61f5('0x34')](_0x14d3f8['query'],_0x1fb7b5['filters']));if(_0x14d3f8[_0x61f5('0x2a')][_0x61f5('0x35')]){_0x1bb553['where']=_['merge'](_0x1bb553[_0x61f5('0x33')],{'$or':_[_0x61f5('0x26')](_0x1bb553[_0x61f5('0x2e')],function(_0x3105d4){var _0x1568c3={};_0x1568c3[_0x3105d4]={'$like':'%'+_0x14d3f8[_0x61f5('0x2a')]['filter']+'%'};return _0x1568c3;})});}_0x1bb553=_[_0x61f5('0x36')]({},_0x1bb553,_0x14d3f8[_0x61f5('0x39')]);return _0x404d1f[_0x61f5('0x47')](_0x1bb553);}})[_0x61f5('0x1f')](function(_0x50fa89){if(_0x50fa89){_0x155cef=_0x50fa89[_0x61f5('0x42')];if(!_0x14d3f8['query']['hasOwnProperty']('nolimit')){_0x1bb553[_0x61f5('0x1b')]=qs[_0x61f5('0x1b')](_0x14d3f8[_0x61f5('0x2a')]['limit']);_0x1bb553['offset']=qs[_0x61f5('0x19')](_0x14d3f8[_0x61f5('0x2a')]['offset']);}return _0x404d1f['getConfigurations'](_0x1bb553);}})[_0x61f5('0x1f')](function(_0x1685e1){if(_0x1685e1){return _0x1685e1?{'count':_0x155cef,'rows':_0x1685e1}:null;}})[_0x61f5('0x1f')](respondWithResult(_0xb188d8,null))['catch'](handleError(_0xb188d8,null));};exports[_0x61f5('0x4a')]=function(_0x4dfa70,_0x2058e2,_0x1973fc){if(_0x4dfa70[_0x61f5('0x46')]['id']){delete _0x4dfa70[_0x61f5('0x46')]['id'];}return db[_0x61f5('0x3a')]['findOne']({'where':{'id':_0x4dfa70[_0x61f5('0x40')]['id']}})[_0x61f5('0x1f')](handleEntityNotFound(_0x2058e2,null))[_0x61f5('0x1f')](function(_0x255e91){if(_0x255e91){_0x4dfa70[_0x61f5('0x46')]['AccountId']=_0x255e91['id'];_0x4dfa70['body'][_0x61f5('0x4b')]=integrations[_0x61f5('0x4c')](_0x4dfa70['body'][_0x61f5('0x4d')],_0x4dfa70[_0x61f5('0x46')][_0x61f5('0x37')]);_0x4dfa70['body']['Descriptions']=integrations[_0x61f5('0x4e')](_0x4dfa70[_0x61f5('0x46')][_0x61f5('0x4d')],_0x4dfa70['body']['type']);return db[_0x61f5('0x49')][_0x61f5('0x44')](_0x4dfa70['body'],{'include':[{'model':db[_0x61f5('0x4f')],'as':'Subjects'},{'model':db[_0x61f5('0x4f')],'as':_0x61f5('0x50')}]});}return null;})[_0x61f5('0x1f')](respondWithResult(_0x2058e2,null))[_0x61f5('0x3e')](handleError(_0x2058e2,null));};exports['getFields']=function(_0x5e79a4,_0x490606,_0x45a1f0){var _0x50563c=[{'name':'priority','label':_0x61f5('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 _0x4fb746='';return db[_0x61f5('0x3a')][_0x61f5('0x48')]({'where':{'id':_0x5e79a4[_0x61f5('0x40')]['id']},'attributes':['id','remoteUri','authType',_0x61f5('0x52'),_0x61f5('0x53'),_0x61f5('0x54'),_0x61f5('0x55'),_0x61f5('0x56'),_0x61f5('0x57')]})[_0x61f5('0x1f')](handleEntityNotFound(_0x490606,null))[_0x61f5('0x1f')](function(_0x32fc4b){if(_0x32fc4b){_0x4fb746=_0x32fc4b[_0x61f5('0x58')];var _0x154fe7=_0x4fb746[_0x61f5('0x59')](-0x1);if(_0x154fe7==='/'){_0x4fb746=_0x4fb746['substring'](0x0,_0x4fb746[_0x61f5('0x5a')](_0x154fe7));}var _0x1c405d={'method':_0x61f5('0x5b'),'uri':util[_0x61f5('0x5c')]('%s/custom_fields',_0x4fb746),'headers':{'Content-Type':_0x61f5('0x5d'),'Accept':_0x61f5('0x5d')},'json':!![]};if(_0x32fc4b[_0x61f5('0x5e')]===_0x61f5('0x5f')){_0x1c405d[_0x61f5('0x60')]['Authorization']=util[_0x61f5('0x5c')]('Basic\x20%s',new Buffer(util[_0x61f5('0x5c')](_0x61f5('0x61'),_0x32fc4b[_0x61f5('0x52')],_0x32fc4b['password']))[_0x61f5('0x62')](_0x61f5('0x63')));}return rp(_0x1c405d)['then'](function(_0xd61944){return _0x50563c['concat'](_[_0x61f5('0x26')](_0xd61944[_0x61f5('0x64')][_0x61f5('0x65')],function(_0xfb710d){return{'id':_0xfb710d[_0x61f5('0x23')],'name':_0xfb710d['name'],'type':_0xfb710d[_0x61f5('0x37')],'active':_0xfb710d[_0x61f5('0x66')],'label':_0xfb710d[_0x61f5('0x67')],'custom':!![]};}));});}})[_0x61f5('0x1f')](function(_0x3d9a52){return{'count':_0x3d9a52[_0x61f5('0x42')],'rows':_0x3d9a52};})[_0x61f5('0x1f')](respondWithResult(_0x490606,null))[_0x61f5('0x3e')](function(_0x33e48b){var _0x17cfd0=_0x5e79a4[_0x61f5('0x2a')][_0x61f5('0x68')]?0x1f4:_0x33e48b[_0x61f5('0x69')]||0x1f4;logger[_0x61f5('0x21')](_0x61f5('0x6a'),_0x61f5('0x6b'),_0x17cfd0,JSON[_0x61f5('0x6c')](_0x33e48b));delete _0x33e48b[_0x61f5('0x23')];if(_0x17cfd0===0x191){_0x17cfd0=0x190;}_0x490606['status'](_0x17cfd0)[_0x61f5('0x24')](_0x5e79a4[_0x61f5('0x2a')][_0x61f5('0x68')]?{'message':_0x61f5('0x6d'),'statusCode':_0x33e48b[_0x61f5('0x69')]}:_0x33e48b);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 533a7ca..afc5d81 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 _0x5fc7=['bluebird','path','rimraf','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0xcaf591,_0x4ff9fe){var _0x43d9c7=function(_0x51e793){while(--_0x51e793){_0xcaf591['push'](_0xcaf591['shift']());}};_0x43d9c7(++_0x4ff9fe);}(_0x5fc7,0x103));var _0x75fc=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5fc7[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var logger=require(_0x75fc('0x2'))(_0x75fc('0x3'));var moment=require(_0x75fc('0x4'));var BPromise=require(_0x75fc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x75fc('0x6'));var rimraf=require(_0x75fc('0x7'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x75fc('0x8'));module[_0x75fc('0x9')]=function(_0x50e2dd,_0x4e78d2){return _0x50e2dd[_0x75fc('0xa')]('DeskAccount',attributes,{'tableName':_0x75fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x375c=['exports','define','DeskAccount','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x375c,0x92));var _0xc375=function(_0x813c33,_0x3f4957){_0x813c33=_0x813c33-0x0;var _0x1bca78=_0x375c[_0x813c33];return _0x1bca78;};'use strict';var _=require(_0xc375('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc375('0x1'));var moment=require('moment');var BPromise=require(_0xc375('0x2'));var rp=require(_0xc375('0x3'));var fs=require('fs');var path=require(_0xc375('0x4'));var rimraf=require(_0xc375('0x5'));var config=require(_0xc375('0x6'));var attributes=require(_0xc375('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xc375('0x8')]=function(_0x499ba1,_0x4d5261){return _0x499ba1[_0xc375('0x9')](_0xc375('0xa'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 4482c6a..3b5b4c5 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 _0xceeb=['DeskAccount','ShowDeskAccount','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug','error','message','DeskAccount,\x20%s,\x20%s','info','result','catch','GetDeskAccount','findAll','raw','options','where','attributes','limit','model','include','map','then'];(function(_0x15e0a0,_0x506b61){var _0x16c980=function(_0x3d690d){while(--_0x3d690d){_0x15e0a0['push'](_0x15e0a0['shift']());}};_0x16c980(++_0x506b61);}(_0xceeb,0x113));var _0xbcee=function(_0x2a18ee,_0x32b048){_0x2a18ee=_0x2a18ee-0x0;var _0xc38114=_0xceeb[_0x2a18ee];return _0xc38114;};'use strict';var _=require(_0xbcee('0x0'));var util=require('util');var moment=require(_0xbcee('0x1'));var BPromise=require(_0xbcee('0x2'));var rs=require(_0xbcee('0x3'));var fs=require('fs');var Redis=require(_0xbcee('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbcee('0x5'));var logger=require(_0xbcee('0x6'))(_0xbcee('0x7'));var config=require(_0xbcee('0x8'));var jayson=require(_0xbcee('0x9'));var client=jayson[_0xbcee('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe7d75b,_0x4ae228,_0x3600f1){return new BPromise(function(_0x37bf3d,_0x518278){return client[_0xbcee('0xb')](_0xe7d75b,_0x3600f1)['then'](function(_0x44c850){logger['info']('DeskAccount,\x20%s,\x20%s',_0x4ae228,_0xbcee('0xc'));logger[_0xbcee('0xd')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x4ae228,_0xbcee('0xc'),JSON['stringify'](_0x44c850));if(_0x44c850[_0xbcee('0xe')]){if(_0x44c850[_0xbcee('0xe')]['code']===0x1f4){logger[_0xbcee('0xe')]('DeskAccount,\x20%s,\x20%s',_0x4ae228,_0x44c850[_0xbcee('0xe')][_0xbcee('0xf')]);return _0x518278(_0x44c850[_0xbcee('0xe')]['message']);}logger[_0xbcee('0xe')](_0xbcee('0x10'),_0x4ae228,_0x44c850[_0xbcee('0xe')][_0xbcee('0xf')]);return _0x37bf3d(_0x44c850['error'][_0xbcee('0xf')]);}else{logger[_0xbcee('0x11')](_0xbcee('0x10'),_0x4ae228,_0xbcee('0xc'));_0x37bf3d(_0x44c850[_0xbcee('0x12')]['message']);}})[_0xbcee('0x13')](function(_0x24fab6){logger['error']('DeskAccount,\x20%s,\x20%s',_0x4ae228,_0x24fab6);_0x518278(_0x24fab6);});});}exports[_0xbcee('0x14')]=function(_0x135396){var _0x2a3a1e=this;return new Promise(function(_0x159585,_0x1a6598){return db['DeskAccount'][_0xbcee('0x15')]({'raw':_0x135396['options']?_0x135396['options'][_0xbcee('0x16')]===undefined?!![]:![]:!![],'where':_0x135396['options']?_0x135396[_0xbcee('0x17')][_0xbcee('0x18')]||null:null,'attributes':_0x135396[_0xbcee('0x17')]?_0x135396[_0xbcee('0x17')][_0xbcee('0x19')]||null:null,'limit':_0x135396['options']?_0x135396[_0xbcee('0x17')][_0xbcee('0x1a')]||null:null,'include':_0x135396[_0xbcee('0x17')]?_0x135396[_0xbcee('0x17')]['include']?_['map'](_0x135396[_0xbcee('0x17')]['include'],function(_0x3b325f){return{'model':db[_0x3b325f[_0xbcee('0x1b')]],'as':_0x3b325f['as'],'attributes':_0x3b325f['attributes'],'include':_0x3b325f[_0xbcee('0x1c')]?_[_0xbcee('0x1d')](_0x3b325f[_0xbcee('0x1c')],function(_0x4e82b2){return{'model':db[_0x4e82b2['model']],'as':_0x4e82b2['as'],'attributes':_0x4e82b2[_0xbcee('0x19')],'include':_0x4e82b2[_0xbcee('0x1c')]?_[_0xbcee('0x1d')](_0x4e82b2[_0xbcee('0x1c')],function(_0x4f8aa5){return{'model':db[_0x4f8aa5[_0xbcee('0x1b')]],'as':_0x4f8aa5['as'],'attributes':_0x4f8aa5['attributes']};}):[]};}):[]};}):[]:[]})[_0xbcee('0x1e')](function(_0xa1fd62){logger['info'](_0xbcee('0x14'),_0x135396);logger[_0xbcee('0xd')](_0xbcee('0x14'),_0x135396,JSON['stringify'](_0xa1fd62));_0x159585(_0xa1fd62);})[_0xbcee('0x13')](function(_0x3c6ea6){logger[_0xbcee('0xe')](_0xbcee('0x14'),_0x3c6ea6[_0xbcee('0xf')],_0x135396);_0x1a6598(_0x2a3a1e[_0xbcee('0xe')](0x1f4,_0x3c6ea6[_0xbcee('0xf')]));});});};exports['ShowDeskAccount']=function(_0x1ab5df){var _0x43c40f=this;return new Promise(function(_0x145762,_0x2a72a1){return db[_0xbcee('0x1f')]['find']({'raw':_0x1ab5df[_0xbcee('0x17')]?_0x1ab5df[_0xbcee('0x17')][_0xbcee('0x16')]===undefined?!![]:![]:!![],'where':_0x1ab5df[_0xbcee('0x17')]?_0x1ab5df[_0xbcee('0x17')][_0xbcee('0x18')]||null:null,'attributes':_0x1ab5df['options']?_0x1ab5df[_0xbcee('0x17')][_0xbcee('0x19')]||null:null,'include':_0x1ab5df['options']?_0x1ab5df[_0xbcee('0x17')]['include']?_['map'](_0x1ab5df[_0xbcee('0x17')]['include'],function(_0x4c5439){return{'model':db[_0x4c5439['model']],'as':_0x4c5439['as'],'attributes':_0x4c5439[_0xbcee('0x19')],'include':_0x4c5439['include']?_[_0xbcee('0x1d')](_0x4c5439[_0xbcee('0x1c')],function(_0x4fc67e){return{'model':db[_0x4fc67e['model']],'as':_0x4fc67e['as'],'attributes':_0x4fc67e['attributes'],'include':_0x4fc67e[_0xbcee('0x1c')]?_['map'](_0x4fc67e[_0xbcee('0x1c')],function(_0x442adc){return{'model':db[_0x442adc[_0xbcee('0x1b')]],'as':_0x442adc['as'],'attributes':_0x442adc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a138b){logger[_0xbcee('0x11')](_0xbcee('0x20'),_0x1ab5df);logger[_0xbcee('0xd')]('ShowDeskAccount',_0x1ab5df,JSON[_0xbcee('0x21')](_0x4a138b));_0x145762(_0x4a138b);})['catch'](function(_0x299bf6){logger['error'](_0xbcee('0x20'),_0x299bf6[_0xbcee('0xf')],_0x1ab5df);_0x2a72a1(_0x43c40f['error'](0x1f4,_0x299bf6[_0xbcee('0xf')]));});});}; \ No newline at end of file +var _0xcaa5=['map','model','debug','GetDeskAccount','find','ShowDeskAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','message','DeskAccount,\x20%s,\x20%s','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x4bc9b3,_0x298862){var _0x19da83=function(_0x46efbb){while(--_0x46efbb){_0x4bc9b3['push'](_0x4bc9b3['shift']());}};_0x19da83(++_0x298862);}(_0xcaa5,0xcc));var _0x5caa=function(_0x7f3667,_0x30c3f1){_0x7f3667=_0x7f3667-0x0;var _0x2c4c24=_0xcaa5[_0x7f3667];return _0x2c4c24;};'use strict';var _=require(_0x5caa('0x0'));var util=require(_0x5caa('0x1'));var moment=require(_0x5caa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5caa('0x3'));var db=require(_0x5caa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5caa('0x5'))(_0x5caa('0x6'));var config=require(_0x5caa('0x7'));var jayson=require(_0x5caa('0x8'));var client=jayson[_0x5caa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25326d,_0x3ce3cc,_0x370087){return new BPromise(function(_0xdc66b2,_0x511ef3){return client[_0x5caa('0xa')](_0x25326d,_0x370087)[_0x5caa('0xb')](function(_0xeb03aa){logger[_0x5caa('0xc')]('DeskAccount,\x20%s,\x20%s',_0x3ce3cc,_0x5caa('0xd'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x3ce3cc,_0x5caa('0xd'),JSON[_0x5caa('0xe')](_0xeb03aa));if(_0xeb03aa[_0x5caa('0xf')]){if(_0xeb03aa['error']['code']===0x1f4){logger[_0x5caa('0xf')]('DeskAccount,\x20%s,\x20%s',_0x3ce3cc,_0xeb03aa[_0x5caa('0xf')][_0x5caa('0x10')]);return _0x511ef3(_0xeb03aa[_0x5caa('0xf')][_0x5caa('0x10')]);}logger['error'](_0x5caa('0x11'),_0x3ce3cc,_0xeb03aa[_0x5caa('0xf')][_0x5caa('0x10')]);return _0xdc66b2(_0xeb03aa[_0x5caa('0xf')][_0x5caa('0x10')]);}else{logger[_0x5caa('0xc')](_0x5caa('0x11'),_0x3ce3cc,_0x5caa('0xd'));_0xdc66b2(_0xeb03aa['result'][_0x5caa('0x10')]);}})[_0x5caa('0x12')](function(_0x24d9ff){logger['error']('DeskAccount,\x20%s,\x20%s',_0x3ce3cc,_0x24d9ff);_0x511ef3(_0x24d9ff);});});}exports['GetDeskAccount']=function(_0x1fd454){var _0x291db2=this;return new Promise(function(_0x3156e5,_0x12380b){return db[_0x5caa('0x13')][_0x5caa('0x14')]({'raw':_0x1fd454['options']?_0x1fd454[_0x5caa('0x15')][_0x5caa('0x16')]===undefined?!![]:![]:!![],'where':_0x1fd454['options']?_0x1fd454[_0x5caa('0x15')][_0x5caa('0x17')]||null:null,'attributes':_0x1fd454['options']?_0x1fd454['options'][_0x5caa('0x18')]||null:null,'limit':_0x1fd454[_0x5caa('0x15')]?_0x1fd454['options'][_0x5caa('0x19')]||null:null,'include':_0x1fd454[_0x5caa('0x15')]?_0x1fd454[_0x5caa('0x15')][_0x5caa('0x1a')]?_[_0x5caa('0x1b')](_0x1fd454[_0x5caa('0x15')][_0x5caa('0x1a')],function(_0x5a1bd9){return{'model':db[_0x5a1bd9[_0x5caa('0x1c')]],'as':_0x5a1bd9['as'],'attributes':_0x5a1bd9[_0x5caa('0x18')],'include':_0x5a1bd9[_0x5caa('0x1a')]?_['map'](_0x5a1bd9[_0x5caa('0x1a')],function(_0x3cfebd){return{'model':db[_0x3cfebd[_0x5caa('0x1c')]],'as':_0x3cfebd['as'],'attributes':_0x3cfebd['attributes'],'include':_0x3cfebd['include']?_[_0x5caa('0x1b')](_0x3cfebd[_0x5caa('0x1a')],function(_0x596606){return{'model':db[_0x596606[_0x5caa('0x1c')]],'as':_0x596606['as'],'attributes':_0x596606[_0x5caa('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27c652){logger['info']('GetDeskAccount',_0x1fd454);logger[_0x5caa('0x1d')]('GetDeskAccount',_0x1fd454,JSON[_0x5caa('0xe')](_0x27c652));_0x3156e5(_0x27c652);})[_0x5caa('0x12')](function(_0x3304e3){logger[_0x5caa('0xf')](_0x5caa('0x1e'),_0x3304e3[_0x5caa('0x10')],_0x1fd454);_0x12380b(_0x291db2[_0x5caa('0xf')](0x1f4,_0x3304e3['message']));});});};exports['ShowDeskAccount']=function(_0x3be23b){var _0x58d707=this;return new Promise(function(_0x1e2dfc,_0x5e5e27){return db[_0x5caa('0x13')][_0x5caa('0x1f')]({'raw':_0x3be23b[_0x5caa('0x15')]?_0x3be23b[_0x5caa('0x15')][_0x5caa('0x16')]===undefined?!![]:![]:!![],'where':_0x3be23b[_0x5caa('0x15')]?_0x3be23b[_0x5caa('0x15')]['where']||null:null,'attributes':_0x3be23b[_0x5caa('0x15')]?_0x3be23b[_0x5caa('0x15')][_0x5caa('0x18')]||null:null,'include':_0x3be23b['options']?_0x3be23b[_0x5caa('0x15')]['include']?_[_0x5caa('0x1b')](_0x3be23b[_0x5caa('0x15')][_0x5caa('0x1a')],function(_0x5c4cf0){return{'model':db[_0x5c4cf0[_0x5caa('0x1c')]],'as':_0x5c4cf0['as'],'attributes':_0x5c4cf0['attributes'],'include':_0x5c4cf0['include']?_[_0x5caa('0x1b')](_0x5c4cf0[_0x5caa('0x1a')],function(_0x5ab2e5){return{'model':db[_0x5ab2e5[_0x5caa('0x1c')]],'as':_0x5ab2e5['as'],'attributes':_0x5ab2e5[_0x5caa('0x18')],'include':_0x5ab2e5[_0x5caa('0x1a')]?_[_0x5caa('0x1b')](_0x5ab2e5['include'],function(_0xe1ee20){return{'model':db[_0xe1ee20[_0x5caa('0x1c')]],'as':_0xe1ee20['as'],'attributes':_0xe1ee20[_0x5caa('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5caa('0xb')](function(_0x3579e7){logger['info'](_0x5caa('0x20'),_0x3be23b);logger['debug'](_0x5caa('0x20'),_0x3be23b,JSON[_0x5caa('0xe')](_0x3579e7));_0x1e2dfc(_0x3579e7);})[_0x5caa('0x12')](function(_0x41da3f){logger[_0x5caa('0xf')]('ShowDeskAccount',_0x41da3f['message'],_0x3be23b);_0x5e5e27(_0x58d707[_0x5caa('0xf')](0x1f4,_0x41da3f[_0x5caa('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 95e9d54..84604a1 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(_0x3b073c,_0x178aa3){var _0x482655=function(_0x1042bd){while(--_0x1042bd){_0x3b073c['push'](_0x3b073c['shift']());}};_0x482655(++_0x178aa3);}(_0x3e74,0x175));var _0x43e7=function(_0x2a54e7,_0x490837){_0x2a54e7=_0x2a54e7-0x0;var _0x49d06d=_0x3e74[_0x2a54e7];return _0x49d06d;};'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(_0x22342c,_0x218835){var _0xd3b434=function(_0x45b259){while(--_0x45b259){_0x22342c['push'](_0x22342c['shift']());}};_0xd3b434(++_0x218835);}(_0x55ca,0x126));var _0xa55c=function(_0x13c4f8,_0x433521){_0x13c4f8=_0x13c4f8-0x0;var _0x5a8f4b=_0x55ca[_0x13c4f8];return _0x5a8f4b;};'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 cbac911..15869ae 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 _0xf30f=['sequelize','exports','STRING'];(function(_0x15ea27,_0xf2e8c){var _0x2f65ca=function(_0x4bd588){while(--_0x4bd588){_0x15ea27['push'](_0x15ea27['shift']());}};_0x2f65ca(++_0xf2e8c);}(_0xf30f,0x14d));var _0xff30=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf30f[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xff30('0x0'));module[_0xff30('0x1')]={'name':{'type':Sequelize[_0xff30('0x2')]},'description':{'type':Sequelize[_0xff30('0x2')]}}; \ No newline at end of file +var _0x1e82=['exports','STRING','sequelize'];(function(_0x4a325a,_0x2c154c){var _0x2597a1=function(_0x437af3){while(--_0x437af3){_0x4a325a['push'](_0x4a325a['shift']());}};_0x2597a1(++_0x2c154c);}(_0x1e82,0x10d));var _0x21e8=function(_0x53d243,_0x576abf){_0x53d243=_0x53d243-0x0;var _0x28c6f6=_0x1e82[_0x53d243];return _0x28c6f6;};'use strict';var Sequelize=require(_0x21e8('0x0'));module[_0x21e8('0x1')]={'name':{'type':Sequelize[_0x21e8('0x2')]},'description':{'type':Sequelize[_0x21e8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 268a9d7..690b238 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 _0x65f8=['map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','DeskField','pick','getFields','getSubjects','order','nolimit','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','status','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','model'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x65f8,0xd2));var _0x865f=function(_0x216fde,_0x1759e0){_0x216fde=_0x216fde-0x0;var _0x5b34f0=_0x65f8[_0x216fde];return _0x5b34f0;};'use strict';var emlformat=require(_0x865f('0x0'));var rimraf=require(_0x865f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x865f('0x2'));var rp=require(_0x865f('0x3'));var moment=require(_0x865f('0x4'));var BPromise=require(_0x865f('0x5'));var Mustache=require(_0x865f('0x6'));var util=require('util');var path=require(_0x865f('0x7'));var sox=require(_0x865f('0x8'));var csv=require(_0x865f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x865f('0xa'));var _=require(_0x865f('0xb'));var squel=require(_0x865f('0xc'));var crypto=require(_0x865f('0xd'));var jsforce=require(_0x865f('0xe'));var deskjs=require(_0x865f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x865f('0x10'));var Papa=require(_0x865f('0x11'));var Redis=require(_0x865f('0x12'));var authService=require(_0x865f('0x13'));var qs=require(_0x865f('0x14'));var as=require(_0x865f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x865f('0x16'))('api');var utils=require(_0x865f('0x17'));var config=require(_0x865f('0x18'));var licenseUtil=require(_0x865f('0x19'));var db=require(_0x865f('0x1a'))['db'];function respondWithStatusCode(_0x749ed8,_0x219097){_0x219097=_0x219097||0xcc;return function(_0x3c9810){if(_0x3c9810){return _0x749ed8['sendStatus'](_0x219097);}return _0x749ed8['status'](_0x219097)[_0x865f('0x1b')]();};}function respondWithResult(_0x33e24b,_0x15d617){_0x15d617=_0x15d617||0xc8;return function(_0x4dc10c){if(_0x4dc10c){return _0x33e24b['status'](_0x15d617)[_0x865f('0x1c')](_0x4dc10c);}};}function respondWithFilteredResult(_0x5d5e28,_0x707adf){return function(_0x35e937){if(_0x35e937){var _0x27dfb3=typeof _0x707adf[_0x865f('0x1d')]==='undefined'&&typeof _0x707adf[_0x865f('0x1e')]===_0x865f('0x1f');var _0x3f9b82=_0x35e937[_0x865f('0x20')];var _0x54da3f=_0x27dfb3?0x0:_0x707adf['offset'];var _0x22be55=_0x27dfb3?_0x35e937[_0x865f('0x20')]:_0x707adf[_0x865f('0x1d')]+_0x707adf['limit'];var _0x14687f;if(_0x22be55>=_0x3f9b82){_0x22be55=_0x3f9b82;_0x14687f=0xc8;}else{_0x14687f=0xce;}_0x5d5e28[_0x865f('0x21')](_0x14687f);return _0x5d5e28['set'](_0x865f('0x22'),_0x54da3f+'-'+_0x22be55+'/'+_0x3f9b82)[_0x865f('0x1c')](_0x35e937);}return null;};}function patchUpdates(_0x5e4cca){return function(_0x100eed){try{jsonpatch[_0x865f('0x23')](_0x100eed,_0x5e4cca,!![]);}catch(_0x544ee3){return BPromise[_0x865f('0x24')](_0x544ee3);}return _0x100eed['save']();};}function saveUpdates(_0x578373,_0xf4397){return function(_0x3035a7){if(_0x3035a7){return _0x3035a7[_0x865f('0x25')](_0x578373)[_0x865f('0x26')](function(_0x3b65cd){return _0x3b65cd;});}return null;};}function removeEntity(_0x33eed0,_0x5704c6){return function(_0xadd113){if(_0xadd113){return _0xadd113[_0x865f('0x27')]()['then'](function(){_0x33eed0['status'](0xcc)[_0x865f('0x1b')]();});}};}function handleEntityNotFound(_0x5e11dd,_0x34d742){return function(_0x19485b){if(!_0x19485b){_0x5e11dd[_0x865f('0x28')](0x194);}return _0x19485b;};}function handleError(_0x28e027,_0x2e43be){_0x2e43be=_0x2e43be||0x1f4;return function(_0x3271a0){logger[_0x865f('0x29')](_0x3271a0[_0x865f('0x2a')]);if(_0x3271a0[_0x865f('0x2b')]){delete _0x3271a0[_0x865f('0x2b')];}_0x28e027['status'](_0x2e43be)[_0x865f('0x2c')](_0x3271a0);};}exports[_0x865f('0x2d')]=function(_0x173497,_0x30910a){var _0x3beb6e={},_0x1bbc5f={},_0x10b495={'count':0x0,'rows':[]};var _0x12a4d3=_['map'](db[_0x865f('0x2e')][_0x865f('0x2f')],function(_0x4786aa){return{'name':_0x4786aa[_0x865f('0x30')],'type':_0x4786aa[_0x865f('0x31')]['key']};});_0x1bbc5f[_0x865f('0x32')]=_[_0x865f('0x33')](_0x12a4d3,_0x865f('0x2b'));_0x1bbc5f[_0x865f('0x34')]=_[_0x865f('0x35')](_0x173497[_0x865f('0x34')]);_0x1bbc5f[_0x865f('0x36')]=_[_0x865f('0x37')](_0x1bbc5f[_0x865f('0x32')],_0x1bbc5f[_0x865f('0x34')]);_0x3beb6e[_0x865f('0x38')]=_[_0x865f('0x37')](_0x1bbc5f[_0x865f('0x32')],qs[_0x865f('0x39')](_0x173497[_0x865f('0x34')][_0x865f('0x39')]));_0x3beb6e[_0x865f('0x38')]=_0x3beb6e[_0x865f('0x38')][_0x865f('0x3a')]?_0x3beb6e['attributes']:_0x1bbc5f[_0x865f('0x32')];if(!_0x173497[_0x865f('0x34')][_0x865f('0x3b')]('nolimit')){_0x3beb6e[_0x865f('0x1e')]=qs[_0x865f('0x1e')](_0x173497[_0x865f('0x34')][_0x865f('0x1e')]);_0x3beb6e['offset']=qs[_0x865f('0x1d')](_0x173497[_0x865f('0x34')][_0x865f('0x1d')]);}_0x3beb6e['order']=qs[_0x865f('0x3c')](_0x173497['query'][_0x865f('0x3c')]);_0x3beb6e[_0x865f('0x3d')]=qs[_0x865f('0x36')](_['pick'](_0x173497[_0x865f('0x34')],_0x1bbc5f[_0x865f('0x36')]),_0x12a4d3);if(_0x173497[_0x865f('0x34')][_0x865f('0x3e')]){_0x3beb6e[_0x865f('0x3d')]=_['merge'](_0x3beb6e[_0x865f('0x3d')],{'$or':_[_0x865f('0x33')](_0x12a4d3,function(_0x30860c){if(_0x30860c['type']!=='VIRTUAL'){var _0x3d50de={};_0x3d50de[_0x30860c[_0x865f('0x2b')]]={'$like':'%'+_0x173497[_0x865f('0x34')]['filter']+'%'};return _0x3d50de;}})});}_0x3beb6e=_[_0x865f('0x3f')]({},_0x3beb6e,_0x173497[_0x865f('0x40')]);var _0x1eed40={'where':_0x3beb6e['where']};return db[_0x865f('0x2e')][_0x865f('0x20')](_0x1eed40)['then'](function(_0x5caa54){_0x10b495[_0x865f('0x20')]=_0x5caa54;if(_0x173497[_0x865f('0x34')][_0x865f('0x41')]){_0x3beb6e[_0x865f('0x42')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x865f('0x43')](_0x3beb6e);})[_0x865f('0x26')](function(_0x39895b){_0x10b495[_0x865f('0x44')]=_0x39895b;return _0x10b495;})[_0x865f('0x26')](respondWithFilteredResult(_0x30910a,_0x3beb6e))[_0x865f('0x45')](handleError(_0x30910a,null));};exports[_0x865f('0x46')]=function(_0x4dd56f,_0x592d44){var _0x1a7562={'raw':![],'where':{'id':_0x4dd56f[_0x865f('0x47')]['id']}},_0x3325bd={};_0x3325bd['model']=_[_0x865f('0x35')](db[_0x865f('0x2e')][_0x865f('0x2f')]);_0x3325bd[_0x865f('0x34')]=_['keys'](_0x4dd56f['query']);_0x3325bd[_0x865f('0x36')]=_['intersection'](_0x3325bd[_0x865f('0x32')],_0x3325bd['query']);_0x1a7562[_0x865f('0x38')]=_[_0x865f('0x37')](_0x3325bd[_0x865f('0x32')],qs[_0x865f('0x39')](_0x4dd56f[_0x865f('0x34')][_0x865f('0x39')]));_0x1a7562[_0x865f('0x38')]=_0x1a7562['attributes'][_0x865f('0x3a')]?_0x1a7562[_0x865f('0x38')]:_0x3325bd[_0x865f('0x32')];if(_0x4dd56f[_0x865f('0x34')][_0x865f('0x41')]){_0x1a7562['include']=[{'all':!![]}];}_0x1a7562=_[_0x865f('0x3f')]({},_0x1a7562,_0x4dd56f['options']);return db['DeskConfiguration'][_0x865f('0x48')](_0x1a7562)['then'](handleEntityNotFound(_0x592d44,null))[_0x865f('0x26')](respondWithResult(_0x592d44,null))['catch'](handleError(_0x592d44,null));};exports[_0x865f('0x49')]=function(_0x5a90bc,_0x1153ec){return db[_0x865f('0x2e')][_0x865f('0x49')](_0x5a90bc[_0x865f('0x4a')],{})[_0x865f('0x26')](respondWithResult(_0x1153ec,0xc9))[_0x865f('0x45')](handleError(_0x1153ec,null));};exports[_0x865f('0x25')]=function(_0x59ed43,_0x1f436b){if(_0x59ed43[_0x865f('0x4a')]['id']){delete _0x59ed43[_0x865f('0x4a')]['id'];}return db['DeskConfiguration'][_0x865f('0x48')]({'where':{'id':_0x59ed43[_0x865f('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f436b,null))['then'](saveUpdates(_0x59ed43[_0x865f('0x4a')],null))['then'](respondWithResult(_0x1f436b,null))['catch'](handleError(_0x1f436b,null));};exports[_0x865f('0x27')]=function(_0x51dfa5,_0x1e22f4){return db[_0x865f('0x2e')][_0x865f('0x48')]({'where':{'id':_0x51dfa5[_0x865f('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e22f4,null))[_0x865f('0x26')](removeEntity(_0x1e22f4,null))[_0x865f('0x45')](handleError(_0x1e22f4,null));};exports['getFields']=function(_0x352e3c,_0x4afccf,_0x4ee0c4){var _0x1a61c2={};var _0x225400={};var _0x534bf8;var _0x3ba1a0;return db['DeskConfiguration'][_0x865f('0x4b')]({'where':{'id':_0x352e3c[_0x865f('0x47')]['id']}})[_0x865f('0x26')](handleEntityNotFound(_0x4afccf,null))[_0x865f('0x26')](function(_0x20c4d0){if(_0x20c4d0){_0x534bf8=_0x20c4d0;_0x225400[_0x865f('0x32')]=_[_0x865f('0x35')](db[_0x865f('0x4c')][_0x865f('0x2f')]);_0x225400[_0x865f('0x34')]=_[_0x865f('0x35')](_0x352e3c[_0x865f('0x34')]);_0x225400['filters']=_['intersection'](_0x225400[_0x865f('0x32')],_0x225400[_0x865f('0x34')]);_0x1a61c2[_0x865f('0x38')]=_[_0x865f('0x37')](_0x225400[_0x865f('0x32')],qs[_0x865f('0x39')](_0x352e3c[_0x865f('0x34')][_0x865f('0x39')]));_0x1a61c2[_0x865f('0x38')]=_0x1a61c2[_0x865f('0x38')][_0x865f('0x3a')]?_0x1a61c2[_0x865f('0x38')]:_0x225400[_0x865f('0x32')];_0x1a61c2['order']=qs[_0x865f('0x3c')](_0x352e3c[_0x865f('0x34')]['sort']);_0x1a61c2[_0x865f('0x3d')]=qs[_0x865f('0x36')](_[_0x865f('0x4d')](_0x352e3c[_0x865f('0x34')],_0x225400[_0x865f('0x36')]));if(_0x352e3c[_0x865f('0x34')]['filter']){_0x1a61c2[_0x865f('0x3d')]=_[_0x865f('0x3f')](_0x1a61c2[_0x865f('0x3d')],{'$or':_['map'](_0x1a61c2[_0x865f('0x38')],function(_0x41b3da){var _0x2afc6e={};_0x2afc6e[_0x41b3da]={'$like':'%'+_0x352e3c[_0x865f('0x34')][_0x865f('0x3e')]+'%'};return _0x2afc6e;})});}_0x1a61c2=_[_0x865f('0x3f')]({},_0x1a61c2,_0x352e3c['options']);return _0x534bf8['getFields'](_0x1a61c2);}})[_0x865f('0x26')](function(_0x28daae){if(_0x28daae){_0x3ba1a0=_0x28daae[_0x865f('0x3a')];if(!_0x352e3c[_0x865f('0x34')][_0x865f('0x3b')]('nolimit')){_0x1a61c2[_0x865f('0x1e')]=qs[_0x865f('0x1e')](_0x352e3c[_0x865f('0x34')][_0x865f('0x1e')]);_0x1a61c2['offset']=qs[_0x865f('0x1d')](_0x352e3c[_0x865f('0x34')]['offset']);}return _0x534bf8[_0x865f('0x4e')](_0x1a61c2);}})['then'](function(_0x3e4c88){if(_0x3e4c88){return _0x3e4c88?{'count':_0x3ba1a0,'rows':_0x3e4c88}:null;}})[_0x865f('0x26')](respondWithResult(_0x4afccf,null))[_0x865f('0x45')](handleError(_0x4afccf,null));};exports[_0x865f('0x4f')]=function(_0x4bb188,_0x538d2f,_0x3da53a){var _0x4d7c0a={};var _0x4b896a={};var _0x9b6cc9;var _0x2bb31;return db[_0x865f('0x2e')]['findOne']({'where':{'id':_0x4bb188[_0x865f('0x47')]['id']}})['then'](handleEntityNotFound(_0x538d2f,null))[_0x865f('0x26')](function(_0xbaf480){if(_0xbaf480){_0x9b6cc9=_0xbaf480;_0x4b896a[_0x865f('0x32')]=_['keys'](db['DeskField']['rawAttributes']);_0x4b896a[_0x865f('0x34')]=_['keys'](_0x4bb188[_0x865f('0x34')]);_0x4b896a[_0x865f('0x36')]=_[_0x865f('0x37')](_0x4b896a[_0x865f('0x32')],_0x4b896a[_0x865f('0x34')]);_0x4d7c0a[_0x865f('0x38')]=_['intersection'](_0x4b896a[_0x865f('0x32')],qs[_0x865f('0x39')](_0x4bb188[_0x865f('0x34')]['fields']));_0x4d7c0a[_0x865f('0x38')]=_0x4d7c0a['attributes'][_0x865f('0x3a')]?_0x4d7c0a[_0x865f('0x38')]:_0x4b896a[_0x865f('0x32')];_0x4d7c0a[_0x865f('0x50')]=qs[_0x865f('0x3c')](_0x4bb188[_0x865f('0x34')][_0x865f('0x3c')]);_0x4d7c0a[_0x865f('0x3d')]=qs[_0x865f('0x36')](_[_0x865f('0x4d')](_0x4bb188[_0x865f('0x34')],_0x4b896a[_0x865f('0x36')]));if(_0x4bb188[_0x865f('0x34')]['filter']){_0x4d7c0a[_0x865f('0x3d')]=_['merge'](_0x4d7c0a[_0x865f('0x3d')],{'$or':_[_0x865f('0x33')](_0x4d7c0a['attributes'],function(_0xa254b6){var _0x53f807={};_0x53f807[_0xa254b6]={'$like':'%'+_0x4bb188[_0x865f('0x34')][_0x865f('0x3e')]+'%'};return _0x53f807;})});}_0x4d7c0a=_[_0x865f('0x3f')]({},_0x4d7c0a,_0x4bb188[_0x865f('0x40')]);return _0x9b6cc9[_0x865f('0x4f')](_0x4d7c0a);}})[_0x865f('0x26')](function(_0x556302){if(_0x556302){_0x2bb31=_0x556302[_0x865f('0x3a')];if(!_0x4bb188['query']['hasOwnProperty'](_0x865f('0x51'))){_0x4d7c0a[_0x865f('0x1e')]=qs[_0x865f('0x1e')](_0x4bb188[_0x865f('0x34')][_0x865f('0x1e')]);_0x4d7c0a[_0x865f('0x1d')]=qs['offset'](_0x4bb188[_0x865f('0x34')][_0x865f('0x1d')]);}return _0x9b6cc9[_0x865f('0x4f')](_0x4d7c0a);}})[_0x865f('0x26')](function(_0x41e7c1){if(_0x41e7c1){return _0x41e7c1?{'count':_0x2bb31,'rows':_0x41e7c1}:null;}})[_0x865f('0x26')](respondWithResult(_0x538d2f,null))[_0x865f('0x45')](handleError(_0x538d2f,null));};exports[_0x865f('0x52')]=function(_0x4f810c,_0x476271,_0x2ff451){var _0x56263c={};var _0x360346={};var _0x181453;var _0x5ab944;return db[_0x865f('0x2e')][_0x865f('0x4b')]({'where':{'id':_0x4f810c[_0x865f('0x47')]['id']}})['then'](handleEntityNotFound(_0x476271,null))[_0x865f('0x26')](function(_0x190333){if(_0x190333){_0x181453=_0x190333;_0x360346[_0x865f('0x32')]=_[_0x865f('0x35')](db[_0x865f('0x4c')][_0x865f('0x2f')]);_0x360346['query']=_[_0x865f('0x35')](_0x4f810c[_0x865f('0x34')]);_0x360346[_0x865f('0x36')]=_[_0x865f('0x37')](_0x360346['model'],_0x360346[_0x865f('0x34')]);_0x56263c[_0x865f('0x38')]=_[_0x865f('0x37')](_0x360346[_0x865f('0x32')],qs[_0x865f('0x39')](_0x4f810c[_0x865f('0x34')]['fields']));_0x56263c[_0x865f('0x38')]=_0x56263c[_0x865f('0x38')][_0x865f('0x3a')]?_0x56263c[_0x865f('0x38')]:_0x360346[_0x865f('0x32')];_0x56263c[_0x865f('0x50')]=qs[_0x865f('0x3c')](_0x4f810c['query'][_0x865f('0x3c')]);_0x56263c[_0x865f('0x3d')]=qs[_0x865f('0x36')](_[_0x865f('0x4d')](_0x4f810c[_0x865f('0x34')],_0x360346['filters']));if(_0x4f810c['query'][_0x865f('0x3e')]){_0x56263c[_0x865f('0x3d')]=_['merge'](_0x56263c[_0x865f('0x3d')],{'$or':_[_0x865f('0x33')](_0x56263c[_0x865f('0x38')],function(_0x4b506f){var _0x485a07={};_0x485a07[_0x4b506f]={'$like':'%'+_0x4f810c[_0x865f('0x34')][_0x865f('0x3e')]+'%'};return _0x485a07;})});}_0x56263c=_[_0x865f('0x3f')]({},_0x56263c,_0x4f810c[_0x865f('0x40')]);return _0x181453[_0x865f('0x52')](_0x56263c);}})[_0x865f('0x26')](function(_0x13937b){if(_0x13937b){_0x5ab944=_0x13937b[_0x865f('0x3a')];if(!_0x4f810c['query'][_0x865f('0x3b')](_0x865f('0x51'))){_0x56263c[_0x865f('0x1e')]=qs[_0x865f('0x1e')](_0x4f810c[_0x865f('0x34')]['limit']);_0x56263c[_0x865f('0x1d')]=qs[_0x865f('0x1d')](_0x4f810c[_0x865f('0x34')][_0x865f('0x1d')]);}return _0x181453[_0x865f('0x52')](_0x56263c);}})[_0x865f('0x26')](function(_0x41b074){if(_0x41b074){return _0x41b074?{'count':_0x5ab944,'rows':_0x41b074}:null;}})[_0x865f('0x26')](respondWithResult(_0x476271,null))[_0x865f('0x45')](handleError(_0x476271,null));};exports['getTags']=function(_0x1f2f1f,_0x50296d,_0x1e1cf3){var _0xb44ae7={};var _0x1ac4e3={};var _0x1db936;var _0x336b6b;return db[_0x865f('0x2e')][_0x865f('0x4b')]({'where':{'id':_0x1f2f1f[_0x865f('0x47')]['id']}})['then'](handleEntityNotFound(_0x50296d,null))[_0x865f('0x26')](function(_0x1e1e2d){if(_0x1e1e2d){_0x1db936=_0x1e1e2d;_0x1ac4e3['model']=_[_0x865f('0x35')](db[_0x865f('0x53')][_0x865f('0x2f')]);_0x1ac4e3[_0x865f('0x34')]=_[_0x865f('0x35')](_0x1f2f1f[_0x865f('0x34')]);_0x1ac4e3['filters']=_[_0x865f('0x37')](_0x1ac4e3[_0x865f('0x32')],_0x1ac4e3['query']);_0xb44ae7[_0x865f('0x38')]=_[_0x865f('0x37')](_0x1ac4e3[_0x865f('0x32')],qs['fields'](_0x1f2f1f[_0x865f('0x34')][_0x865f('0x39')]));_0xb44ae7[_0x865f('0x38')]=_0xb44ae7['attributes'][_0x865f('0x3a')]?_0xb44ae7[_0x865f('0x38')]:_0x1ac4e3[_0x865f('0x32')];_0xb44ae7[_0x865f('0x50')]=qs['sort'](_0x1f2f1f['query']['sort']);_0xb44ae7[_0x865f('0x3d')]=qs[_0x865f('0x36')](_[_0x865f('0x4d')](_0x1f2f1f[_0x865f('0x34')],_0x1ac4e3[_0x865f('0x36')]));if(_0x1f2f1f[_0x865f('0x34')][_0x865f('0x3e')]){_0xb44ae7['where']=_['merge'](_0xb44ae7[_0x865f('0x3d')],{'$or':_['map'](_0xb44ae7[_0x865f('0x38')],function(_0xe42c44){var _0xdfb51c={};_0xdfb51c[_0xe42c44]={'$like':'%'+_0x1f2f1f[_0x865f('0x34')][_0x865f('0x3e')]+'%'};return _0xdfb51c;})});}_0xb44ae7=_[_0x865f('0x3f')]({},_0xb44ae7,_0x1f2f1f[_0x865f('0x40')]);return _0x1db936[_0x865f('0x54')](_0xb44ae7);}})[_0x865f('0x26')](function(_0x24d278){if(_0x24d278){_0x336b6b=_0x24d278[_0x865f('0x3a')];if(!_0x1f2f1f[_0x865f('0x34')]['hasOwnProperty'](_0x865f('0x51'))){_0xb44ae7[_0x865f('0x1e')]=qs[_0x865f('0x1e')](_0x1f2f1f[_0x865f('0x34')][_0x865f('0x1e')]);_0xb44ae7[_0x865f('0x1d')]=qs['offset'](_0x1f2f1f[_0x865f('0x34')]['offset']);}return _0x1db936[_0x865f('0x54')](_0xb44ae7);}})[_0x865f('0x26')](function(_0x317db1){if(_0x317db1){return _0x317db1?{'count':_0x336b6b,'rows':_0x317db1}:null;}})[_0x865f('0x26')](respondWithResult(_0x50296d,null))[_0x865f('0x45')](handleError(_0x50296d,null));};exports[_0x865f('0x55')]=function(_0x19a836,_0x238157,_0x37cff9){if(_0x19a836[_0x865f('0x4a')]['id']){delete _0x19a836[_0x865f('0x4a')]['id'];}return db[_0x865f('0x2e')][_0x865f('0x4b')]({'where':{'id':_0x19a836[_0x865f('0x47')]['id']}})[_0x865f('0x26')](handleEntityNotFound(_0x238157,null))['then'](function(_0x1f35cc){if(_0x1f35cc){return _0x1f35cc[_0x865f('0x55')](_0x19a836[_0x865f('0x4a')][_0x865f('0x56')]||[]);}return null;})[_0x865f('0x26')](respondWithResult(_0x238157,null))[_0x865f('0x45')](handleError(_0x238157,null));}; \ No newline at end of file +var _0xc577=['hasOwnProperty','getSubjects','getDescriptions','DeskField','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','DeskConfiguration','includeAll','include','findAll','rows','catch','show','keys','options','create','body','update','find','params','destroy','getFields','findOne'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0xc577,0x1bb));var _0x7c57=function(_0x9c173a,_0x461c9c){_0x9c173a=_0x9c173a-0x0;var _0x88d611=_0xc577[_0x9c173a];return _0x88d611;};'use strict';var emlformat=require(_0x7c57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c57('0x1'));var jsonpatch=require(_0x7c57('0x2'));var rp=require(_0x7c57('0x3'));var moment=require(_0x7c57('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7c57('0x5'));var path=require(_0x7c57('0x6'));var sox=require('sox');var csv=require(_0x7c57('0x7'));var ejs=require(_0x7c57('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c57('0x9'));var squel=require(_0x7c57('0xa'));var crypto=require(_0x7c57('0xb'));var jsforce=require(_0x7c57('0xc'));var deskjs=require(_0x7c57('0xd'));var toCsv=require(_0x7c57('0x7'));var querystring=require(_0x7c57('0xe'));var Papa=require(_0x7c57('0xf'));var Redis=require(_0x7c57('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7c57('0x11'));var as=require(_0x7c57('0x12'));var hardwareService=require(_0x7c57('0x13'));var logger=require(_0x7c57('0x14'))(_0x7c57('0x15'));var utils=require('../../config/utils');var config=require(_0x7c57('0x16'));var licenseUtil=require(_0x7c57('0x17'));var db=require(_0x7c57('0x18'))['db'];function respondWithStatusCode(_0x2e3611,_0x574ffd){_0x574ffd=_0x574ffd||0xcc;return function(_0x2b905c){if(_0x2b905c){return _0x2e3611[_0x7c57('0x19')](_0x574ffd);}return _0x2e3611[_0x7c57('0x1a')](_0x574ffd)[_0x7c57('0x1b')]();};}function respondWithResult(_0x397ce5,_0x1c62f5){_0x1c62f5=_0x1c62f5||0xc8;return function(_0x5818e3){if(_0x5818e3){return _0x397ce5[_0x7c57('0x1a')](_0x1c62f5)[_0x7c57('0x1c')](_0x5818e3);}};}function respondWithFilteredResult(_0x56068d,_0x56bfb9){return function(_0x231b12){if(_0x231b12){var _0x47e3ba=typeof _0x56bfb9[_0x7c57('0x1d')]==='undefined'&&typeof _0x56bfb9[_0x7c57('0x1e')]===_0x7c57('0x1f');var _0x1c3cb6=_0x231b12[_0x7c57('0x20')];var _0x1c16da=_0x47e3ba?0x0:_0x56bfb9[_0x7c57('0x1d')];var _0x2ff345=_0x47e3ba?_0x231b12['count']:_0x56bfb9[_0x7c57('0x1d')]+_0x56bfb9['limit'];var _0x1903f5;if(_0x2ff345>=_0x1c3cb6){_0x2ff345=_0x1c3cb6;_0x1903f5=0xc8;}else{_0x1903f5=0xce;}_0x56068d[_0x7c57('0x1a')](_0x1903f5);return _0x56068d[_0x7c57('0x21')](_0x7c57('0x22'),_0x1c16da+'-'+_0x2ff345+'/'+_0x1c3cb6)[_0x7c57('0x1c')](_0x231b12);}return null;};}function patchUpdates(_0x39297d){return function(_0x5f33df){try{jsonpatch[_0x7c57('0x23')](_0x5f33df,_0x39297d,!![]);}catch(_0x1f1dd1){return BPromise[_0x7c57('0x24')](_0x1f1dd1);}return _0x5f33df[_0x7c57('0x25')]();};}function saveUpdates(_0x544eb6,_0x2a7dc6){return function(_0x58064c){if(_0x58064c){return _0x58064c['update'](_0x544eb6)[_0x7c57('0x26')](function(_0x13f350){return _0x13f350;});}return null;};}function removeEntity(_0x1c7d9d,_0x83a1a){return function(_0x5860dd){if(_0x5860dd){return _0x5860dd['destroy']()[_0x7c57('0x26')](function(){_0x1c7d9d[_0x7c57('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc550,_0x4ee9eb){return function(_0x1bd2be){if(!_0x1bd2be){_0x5cc550[_0x7c57('0x19')](0x194);}return _0x1bd2be;};}function handleError(_0x4faba0,_0x3bfe1a){_0x3bfe1a=_0x3bfe1a||0x1f4;return function(_0xb73917){logger['error'](_0xb73917[_0x7c57('0x27')]);if(_0xb73917[_0x7c57('0x28')]){delete _0xb73917[_0x7c57('0x28')];}_0x4faba0[_0x7c57('0x1a')](_0x3bfe1a)[_0x7c57('0x29')](_0xb73917);};}exports[_0x7c57('0x2a')]=function(_0x1a3b8a,_0x1be4b3){var _0xe6ad8f={},_0x4f4ddd={},_0x3e4d74={'count':0x0,'rows':[]};var _0x133b27=_[_0x7c57('0x2b')](db['DeskConfiguration'][_0x7c57('0x2c')],function(_0x1e4980){return{'name':_0x1e4980[_0x7c57('0x2d')],'type':_0x1e4980[_0x7c57('0x2e')]['key']};});_0x4f4ddd['model']=_[_0x7c57('0x2b')](_0x133b27,_0x7c57('0x28'));_0x4f4ddd[_0x7c57('0x2f')]=_['keys'](_0x1a3b8a['query']);_0x4f4ddd[_0x7c57('0x30')]=_[_0x7c57('0x31')](_0x4f4ddd[_0x7c57('0x32')],_0x4f4ddd['query']);_0xe6ad8f[_0x7c57('0x33')]=_[_0x7c57('0x31')](_0x4f4ddd[_0x7c57('0x32')],qs[_0x7c57('0x34')](_0x1a3b8a[_0x7c57('0x2f')][_0x7c57('0x34')]));_0xe6ad8f[_0x7c57('0x33')]=_0xe6ad8f[_0x7c57('0x33')][_0x7c57('0x35')]?_0xe6ad8f[_0x7c57('0x33')]:_0x4f4ddd['model'];if(!_0x1a3b8a['query']['hasOwnProperty'](_0x7c57('0x36'))){_0xe6ad8f['limit']=qs[_0x7c57('0x1e')](_0x1a3b8a[_0x7c57('0x2f')][_0x7c57('0x1e')]);_0xe6ad8f['offset']=qs[_0x7c57('0x1d')](_0x1a3b8a[_0x7c57('0x2f')][_0x7c57('0x1d')]);}_0xe6ad8f[_0x7c57('0x37')]=qs['sort'](_0x1a3b8a['query'][_0x7c57('0x38')]);_0xe6ad8f['where']=qs[_0x7c57('0x30')](_[_0x7c57('0x39')](_0x1a3b8a[_0x7c57('0x2f')],_0x4f4ddd[_0x7c57('0x30')]),_0x133b27);if(_0x1a3b8a[_0x7c57('0x2f')][_0x7c57('0x3a')]){_0xe6ad8f['where']=_[_0x7c57('0x3b')](_0xe6ad8f['where'],{'$or':_[_0x7c57('0x2b')](_0x133b27,function(_0x5a9d10){if(_0x5a9d10[_0x7c57('0x2e')]!==_0x7c57('0x3c')){var _0x2b7d66={};_0x2b7d66[_0x5a9d10['name']]={'$like':'%'+_0x1a3b8a[_0x7c57('0x2f')][_0x7c57('0x3a')]+'%'};return _0x2b7d66;}})});}_0xe6ad8f=_[_0x7c57('0x3b')]({},_0xe6ad8f,_0x1a3b8a['options']);var _0x2373a4={'where':_0xe6ad8f[_0x7c57('0x3d')]};return db[_0x7c57('0x3e')]['count'](_0x2373a4)[_0x7c57('0x26')](function(_0x1aed0){_0x3e4d74['count']=_0x1aed0;if(_0x1a3b8a[_0x7c57('0x2f')][_0x7c57('0x3f')]){_0xe6ad8f[_0x7c57('0x40')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x7c57('0x41')](_0xe6ad8f);})[_0x7c57('0x26')](function(_0xf5cf72){_0x3e4d74[_0x7c57('0x42')]=_0xf5cf72;return _0x3e4d74;})[_0x7c57('0x26')](respondWithFilteredResult(_0x1be4b3,_0xe6ad8f))[_0x7c57('0x43')](handleError(_0x1be4b3,null));};exports[_0x7c57('0x44')]=function(_0x203f9f,_0x416e6a){var _0x41c564={'raw':![],'where':{'id':_0x203f9f['params']['id']}},_0x47e6cb={};_0x47e6cb['model']=_['keys'](db[_0x7c57('0x3e')][_0x7c57('0x2c')]);_0x47e6cb['query']=_[_0x7c57('0x45')](_0x203f9f[_0x7c57('0x2f')]);_0x47e6cb[_0x7c57('0x30')]=_['intersection'](_0x47e6cb[_0x7c57('0x32')],_0x47e6cb['query']);_0x41c564[_0x7c57('0x33')]=_[_0x7c57('0x31')](_0x47e6cb['model'],qs[_0x7c57('0x34')](_0x203f9f[_0x7c57('0x2f')][_0x7c57('0x34')]));_0x41c564[_0x7c57('0x33')]=_0x41c564[_0x7c57('0x33')][_0x7c57('0x35')]?_0x41c564[_0x7c57('0x33')]:_0x47e6cb[_0x7c57('0x32')];if(_0x203f9f[_0x7c57('0x2f')][_0x7c57('0x3f')]){_0x41c564[_0x7c57('0x40')]=[{'all':!![]}];}_0x41c564=_[_0x7c57('0x3b')]({},_0x41c564,_0x203f9f[_0x7c57('0x46')]);return db[_0x7c57('0x3e')]['find'](_0x41c564)[_0x7c57('0x26')](handleEntityNotFound(_0x416e6a,null))['then'](respondWithResult(_0x416e6a,null))[_0x7c57('0x43')](handleError(_0x416e6a,null));};exports[_0x7c57('0x47')]=function(_0x32ac20,_0x2f97fe){return db[_0x7c57('0x3e')][_0x7c57('0x47')](_0x32ac20[_0x7c57('0x48')],{})[_0x7c57('0x26')](respondWithResult(_0x2f97fe,0xc9))[_0x7c57('0x43')](handleError(_0x2f97fe,null));};exports[_0x7c57('0x49')]=function(_0x5863ec,_0x51ce72){if(_0x5863ec[_0x7c57('0x48')]['id']){delete _0x5863ec[_0x7c57('0x48')]['id'];}return db['DeskConfiguration'][_0x7c57('0x4a')]({'where':{'id':_0x5863ec[_0x7c57('0x4b')]['id']}})[_0x7c57('0x26')](handleEntityNotFound(_0x51ce72,null))[_0x7c57('0x26')](saveUpdates(_0x5863ec[_0x7c57('0x48')],null))[_0x7c57('0x26')](respondWithResult(_0x51ce72,null))[_0x7c57('0x43')](handleError(_0x51ce72,null));};exports[_0x7c57('0x4c')]=function(_0x2fa185,_0xa2e7eb){return db['DeskConfiguration']['find']({'where':{'id':_0x2fa185[_0x7c57('0x4b')]['id']}})[_0x7c57('0x26')](handleEntityNotFound(_0xa2e7eb,null))[_0x7c57('0x26')](removeEntity(_0xa2e7eb,null))['catch'](handleError(_0xa2e7eb,null));};exports[_0x7c57('0x4d')]=function(_0x333023,_0x11120f,_0x58a334){var _0x2ce4b8={};var _0x49209f={};var _0x43f222;var _0x5afd44;return db[_0x7c57('0x3e')][_0x7c57('0x4e')]({'where':{'id':_0x333023[_0x7c57('0x4b')]['id']}})[_0x7c57('0x26')](handleEntityNotFound(_0x11120f,null))[_0x7c57('0x26')](function(_0x5ece7a){if(_0x5ece7a){_0x43f222=_0x5ece7a;_0x49209f[_0x7c57('0x32')]=_[_0x7c57('0x45')](db['DeskField'][_0x7c57('0x2c')]);_0x49209f[_0x7c57('0x2f')]=_[_0x7c57('0x45')](_0x333023[_0x7c57('0x2f')]);_0x49209f['filters']=_[_0x7c57('0x31')](_0x49209f[_0x7c57('0x32')],_0x49209f['query']);_0x2ce4b8[_0x7c57('0x33')]=_[_0x7c57('0x31')](_0x49209f[_0x7c57('0x32')],qs[_0x7c57('0x34')](_0x333023['query'][_0x7c57('0x34')]));_0x2ce4b8[_0x7c57('0x33')]=_0x2ce4b8[_0x7c57('0x33')][_0x7c57('0x35')]?_0x2ce4b8[_0x7c57('0x33')]:_0x49209f[_0x7c57('0x32')];_0x2ce4b8[_0x7c57('0x37')]=qs['sort'](_0x333023[_0x7c57('0x2f')]['sort']);_0x2ce4b8[_0x7c57('0x3d')]=qs[_0x7c57('0x30')](_['pick'](_0x333023[_0x7c57('0x2f')],_0x49209f[_0x7c57('0x30')]));if(_0x333023['query'][_0x7c57('0x3a')]){_0x2ce4b8[_0x7c57('0x3d')]=_[_0x7c57('0x3b')](_0x2ce4b8[_0x7c57('0x3d')],{'$or':_[_0x7c57('0x2b')](_0x2ce4b8['attributes'],function(_0x2482aa){var _0x2a19ba={};_0x2a19ba[_0x2482aa]={'$like':'%'+_0x333023[_0x7c57('0x2f')][_0x7c57('0x3a')]+'%'};return _0x2a19ba;})});}_0x2ce4b8=_[_0x7c57('0x3b')]({},_0x2ce4b8,_0x333023[_0x7c57('0x46')]);return _0x43f222[_0x7c57('0x4d')](_0x2ce4b8);}})[_0x7c57('0x26')](function(_0x5c0180){if(_0x5c0180){_0x5afd44=_0x5c0180[_0x7c57('0x35')];if(!_0x333023[_0x7c57('0x2f')][_0x7c57('0x4f')](_0x7c57('0x36'))){_0x2ce4b8[_0x7c57('0x1e')]=qs[_0x7c57('0x1e')](_0x333023['query'][_0x7c57('0x1e')]);_0x2ce4b8[_0x7c57('0x1d')]=qs[_0x7c57('0x1d')](_0x333023[_0x7c57('0x2f')][_0x7c57('0x1d')]);}return _0x43f222['getFields'](_0x2ce4b8);}})['then'](function(_0x1a71fd){if(_0x1a71fd){return _0x1a71fd?{'count':_0x5afd44,'rows':_0x1a71fd}:null;}})['then'](respondWithResult(_0x11120f,null))['catch'](handleError(_0x11120f,null));};exports[_0x7c57('0x50')]=function(_0x476e21,_0x10fe71,_0x3b6ea8){var _0x4508ac={};var _0x2cf1c1={};var _0x5be7c1;var _0x22de4a;return db[_0x7c57('0x3e')][_0x7c57('0x4e')]({'where':{'id':_0x476e21[_0x7c57('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10fe71,null))[_0x7c57('0x26')](function(_0x4c65b4){if(_0x4c65b4){_0x5be7c1=_0x4c65b4;_0x2cf1c1[_0x7c57('0x32')]=_[_0x7c57('0x45')](db['DeskField']['rawAttributes']);_0x2cf1c1['query']=_['keys'](_0x476e21['query']);_0x2cf1c1[_0x7c57('0x30')]=_['intersection'](_0x2cf1c1[_0x7c57('0x32')],_0x2cf1c1[_0x7c57('0x2f')]);_0x4508ac['attributes']=_['intersection'](_0x2cf1c1[_0x7c57('0x32')],qs[_0x7c57('0x34')](_0x476e21[_0x7c57('0x2f')][_0x7c57('0x34')]));_0x4508ac[_0x7c57('0x33')]=_0x4508ac[_0x7c57('0x33')][_0x7c57('0x35')]?_0x4508ac[_0x7c57('0x33')]:_0x2cf1c1[_0x7c57('0x32')];_0x4508ac['order']=qs[_0x7c57('0x38')](_0x476e21['query'][_0x7c57('0x38')]);_0x4508ac[_0x7c57('0x3d')]=qs[_0x7c57('0x30')](_[_0x7c57('0x39')](_0x476e21['query'],_0x2cf1c1['filters']));if(_0x476e21[_0x7c57('0x2f')][_0x7c57('0x3a')]){_0x4508ac[_0x7c57('0x3d')]=_[_0x7c57('0x3b')](_0x4508ac[_0x7c57('0x3d')],{'$or':_['map'](_0x4508ac['attributes'],function(_0x3cd9aa){var _0x4c79ba={};_0x4c79ba[_0x3cd9aa]={'$like':'%'+_0x476e21[_0x7c57('0x2f')][_0x7c57('0x3a')]+'%'};return _0x4c79ba;})});}_0x4508ac=_['merge']({},_0x4508ac,_0x476e21['options']);return _0x5be7c1[_0x7c57('0x50')](_0x4508ac);}})['then'](function(_0x1aecba){if(_0x1aecba){_0x22de4a=_0x1aecba[_0x7c57('0x35')];if(!_0x476e21[_0x7c57('0x2f')][_0x7c57('0x4f')]('nolimit')){_0x4508ac[_0x7c57('0x1e')]=qs[_0x7c57('0x1e')](_0x476e21[_0x7c57('0x2f')][_0x7c57('0x1e')]);_0x4508ac[_0x7c57('0x1d')]=qs['offset'](_0x476e21[_0x7c57('0x2f')][_0x7c57('0x1d')]);}return _0x5be7c1['getSubjects'](_0x4508ac);}})['then'](function(_0x401a71){if(_0x401a71){return _0x401a71?{'count':_0x22de4a,'rows':_0x401a71}:null;}})[_0x7c57('0x26')](respondWithResult(_0x10fe71,null))[_0x7c57('0x43')](handleError(_0x10fe71,null));};exports[_0x7c57('0x51')]=function(_0x5e0bdd,_0x4b2ffa,_0x22bf21){var _0x30f31b={};var _0x3469e9={};var _0x402e5c;var _0x5f7124;return db[_0x7c57('0x3e')]['findOne']({'where':{'id':_0x5e0bdd[_0x7c57('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4b2ffa,null))[_0x7c57('0x26')](function(_0x1f129f){if(_0x1f129f){_0x402e5c=_0x1f129f;_0x3469e9[_0x7c57('0x32')]=_[_0x7c57('0x45')](db[_0x7c57('0x52')][_0x7c57('0x2c')]);_0x3469e9[_0x7c57('0x2f')]=_[_0x7c57('0x45')](_0x5e0bdd[_0x7c57('0x2f')]);_0x3469e9[_0x7c57('0x30')]=_[_0x7c57('0x31')](_0x3469e9[_0x7c57('0x32')],_0x3469e9[_0x7c57('0x2f')]);_0x30f31b[_0x7c57('0x33')]=_['intersection'](_0x3469e9[_0x7c57('0x32')],qs[_0x7c57('0x34')](_0x5e0bdd['query'][_0x7c57('0x34')]));_0x30f31b[_0x7c57('0x33')]=_0x30f31b[_0x7c57('0x33')][_0x7c57('0x35')]?_0x30f31b[_0x7c57('0x33')]:_0x3469e9[_0x7c57('0x32')];_0x30f31b[_0x7c57('0x37')]=qs[_0x7c57('0x38')](_0x5e0bdd[_0x7c57('0x2f')][_0x7c57('0x38')]);_0x30f31b[_0x7c57('0x3d')]=qs[_0x7c57('0x30')](_[_0x7c57('0x39')](_0x5e0bdd[_0x7c57('0x2f')],_0x3469e9[_0x7c57('0x30')]));if(_0x5e0bdd['query'][_0x7c57('0x3a')]){_0x30f31b[_0x7c57('0x3d')]=_[_0x7c57('0x3b')](_0x30f31b[_0x7c57('0x3d')],{'$or':_[_0x7c57('0x2b')](_0x30f31b['attributes'],function(_0x337e09){var _0x4d88ac={};_0x4d88ac[_0x337e09]={'$like':'%'+_0x5e0bdd[_0x7c57('0x2f')][_0x7c57('0x3a')]+'%'};return _0x4d88ac;})});}_0x30f31b=_[_0x7c57('0x3b')]({},_0x30f31b,_0x5e0bdd['options']);return _0x402e5c[_0x7c57('0x51')](_0x30f31b);}})[_0x7c57('0x26')](function(_0x1e196b){if(_0x1e196b){_0x5f7124=_0x1e196b['length'];if(!_0x5e0bdd[_0x7c57('0x2f')][_0x7c57('0x4f')](_0x7c57('0x36'))){_0x30f31b[_0x7c57('0x1e')]=qs[_0x7c57('0x1e')](_0x5e0bdd[_0x7c57('0x2f')][_0x7c57('0x1e')]);_0x30f31b[_0x7c57('0x1d')]=qs['offset'](_0x5e0bdd['query'][_0x7c57('0x1d')]);}return _0x402e5c[_0x7c57('0x51')](_0x30f31b);}})['then'](function(_0x1a99d3){if(_0x1a99d3){return _0x1a99d3?{'count':_0x5f7124,'rows':_0x1a99d3}:null;}})[_0x7c57('0x26')](respondWithResult(_0x4b2ffa,null))[_0x7c57('0x43')](handleError(_0x4b2ffa,null));};exports[_0x7c57('0x53')]=function(_0x2748b1,_0x17a481,_0xb776f){var _0x1e12d6={};var _0x341e23={};var _0x22b65b;var _0x503883;return db[_0x7c57('0x3e')]['findOne']({'where':{'id':_0x2748b1[_0x7c57('0x4b')]['id']}})[_0x7c57('0x26')](handleEntityNotFound(_0x17a481,null))[_0x7c57('0x26')](function(_0x517e5d){if(_0x517e5d){_0x22b65b=_0x517e5d;_0x341e23['model']=_['keys'](db[_0x7c57('0x54')][_0x7c57('0x2c')]);_0x341e23[_0x7c57('0x2f')]=_[_0x7c57('0x45')](_0x2748b1[_0x7c57('0x2f')]);_0x341e23[_0x7c57('0x30')]=_[_0x7c57('0x31')](_0x341e23[_0x7c57('0x32')],_0x341e23['query']);_0x1e12d6[_0x7c57('0x33')]=_[_0x7c57('0x31')](_0x341e23[_0x7c57('0x32')],qs['fields'](_0x2748b1['query'][_0x7c57('0x34')]));_0x1e12d6['attributes']=_0x1e12d6[_0x7c57('0x33')][_0x7c57('0x35')]?_0x1e12d6[_0x7c57('0x33')]:_0x341e23[_0x7c57('0x32')];_0x1e12d6['order']=qs[_0x7c57('0x38')](_0x2748b1[_0x7c57('0x2f')][_0x7c57('0x38')]);_0x1e12d6['where']=qs['filters'](_[_0x7c57('0x39')](_0x2748b1[_0x7c57('0x2f')],_0x341e23[_0x7c57('0x30')]));if(_0x2748b1[_0x7c57('0x2f')][_0x7c57('0x3a')]){_0x1e12d6['where']=_[_0x7c57('0x3b')](_0x1e12d6[_0x7c57('0x3d')],{'$or':_[_0x7c57('0x2b')](_0x1e12d6[_0x7c57('0x33')],function(_0x212cb3){var _0x58e771={};_0x58e771[_0x212cb3]={'$like':'%'+_0x2748b1[_0x7c57('0x2f')][_0x7c57('0x3a')]+'%'};return _0x58e771;})});}_0x1e12d6=_[_0x7c57('0x3b')]({},_0x1e12d6,_0x2748b1[_0x7c57('0x46')]);return _0x22b65b['getTags'](_0x1e12d6);}})[_0x7c57('0x26')](function(_0x4d8dd3){if(_0x4d8dd3){_0x503883=_0x4d8dd3['length'];if(!_0x2748b1[_0x7c57('0x2f')][_0x7c57('0x4f')]('nolimit')){_0x1e12d6[_0x7c57('0x1e')]=qs['limit'](_0x2748b1[_0x7c57('0x2f')][_0x7c57('0x1e')]);_0x1e12d6['offset']=qs[_0x7c57('0x1d')](_0x2748b1[_0x7c57('0x2f')][_0x7c57('0x1d')]);}return _0x22b65b[_0x7c57('0x53')](_0x1e12d6);}})['then'](function(_0x58f2de){if(_0x58f2de){return _0x58f2de?{'count':_0x503883,'rows':_0x58f2de}:null;}})[_0x7c57('0x26')](respondWithResult(_0x17a481,null))[_0x7c57('0x43')](handleError(_0x17a481,null));};exports['setTags']=function(_0x396cde,_0x2c1e68,_0x272be3){if(_0x396cde['body']['id']){delete _0x396cde['body']['id'];}return db[_0x7c57('0x3e')][_0x7c57('0x4e')]({'where':{'id':_0x396cde['params']['id']}})[_0x7c57('0x26')](handleEntityNotFound(_0x2c1e68,null))[_0x7c57('0x26')](function(_0x578784){if(_0x578784){return _0x578784[_0x7c57('0x55')](_0x396cde['body'][_0x7c57('0x56')]||[]);}return null;})['then'](respondWithResult(_0x2c1e68,null))[_0x7c57('0x43')](handleError(_0x2c1e68,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index ad3dd2d..f23412f 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 _0xd159=['../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x2b4448,_0x5bcc69){var _0xb4b465=function(_0x5ac741){while(--_0x5ac741){_0x2b4448['push'](_0x2b4448['shift']());}};_0xb4b465(++_0x5bcc69);}(_0xd159,0x118));var _0x9d15=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd159[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x9d15('0x0'));var logger=require(_0x9d15('0x1'))(_0x9d15('0x2'));var moment=require(_0x9d15('0x3'));var BPromise=require('bluebird');var rp=require(_0x9d15('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d15('0x5'));var config=require(_0x9d15('0x6'));var attributes=require(_0x9d15('0x7'));module[_0x9d15('0x8')]=function(_0x5971d0,_0x15b650){return _0x5971d0['define'](_0x9d15('0x9'),attributes,{'tableName':_0x9d15('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2147=['exports','define','DeskConfiguration','int_desk_configurations','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1dcc26,_0x559fe7){var _0x21c51f=function(_0x5ecbdf){while(--_0x5ecbdf){_0x1dcc26['push'](_0x1dcc26['shift']());}};_0x21c51f(++_0x559fe7);}(_0x2147,0x7d));var _0x7214=function(_0x232cc4,_0x571cf7){_0x232cc4=_0x232cc4-0x0;var _0x1b3a60=_0x2147[_0x232cc4];return _0x1b3a60;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7214('0x0'))(_0x7214('0x1'));var moment=require(_0x7214('0x2'));var BPromise=require(_0x7214('0x3'));var rp=require(_0x7214('0x4'));var fs=require('fs');var path=require(_0x7214('0x5'));var rimraf=require('rimraf');var config=require(_0x7214('0x6'));var attributes=require('./intDeskConfiguration.attributes');module[_0x7214('0x7')]=function(_0x5bb448,_0x19c389){return _0x5bb448[_0x7214('0x8')](_0x7214('0x9'),attributes,{'tableName':_0x7214('0xa'),'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 449f118..5ad8df6 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 _0xe02a=['result','message','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error'];(function(_0xff7839,_0x2da380){var _0x16823e=function(_0xc29640){while(--_0xc29640){_0xff7839['push'](_0xff7839['shift']());}};_0x16823e(++_0x2da380);}(_0xe02a,0xa3));var _0xae02=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe02a[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xae02('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae02('0x1'));var db=require(_0xae02('0x2'))['db'];var utils=require(_0xae02('0x3'));var logger=require(_0xae02('0x4'))(_0xae02('0x5'));var config=require(_0xae02('0x6'));var jayson=require(_0xae02('0x7'));var client=jayson[_0xae02('0x8')][_0xae02('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ffda6,_0x1da455,_0x3e5ab1){return new BPromise(function(_0x24befe,_0x244971){return client[_0xae02('0xa')](_0x3ffda6,_0x3e5ab1)[_0xae02('0xb')](function(_0x3e0a15){logger[_0xae02('0xc')](_0xae02('0xd'),_0x1da455,_0xae02('0xe'));logger['debug'](_0xae02('0xf'),_0x1da455,'request\x20sent',JSON['stringify'](_0x3e0a15));if(_0x3e0a15[_0xae02('0x10')]){if(_0x3e0a15[_0xae02('0x10')]['code']===0x1f4){logger[_0xae02('0x10')](_0xae02('0xd'),_0x1da455,_0x3e0a15[_0xae02('0x10')]['message']);return _0x244971(_0x3e0a15[_0xae02('0x10')]['message']);}logger[_0xae02('0x10')](_0xae02('0xd'),_0x1da455,_0x3e0a15[_0xae02('0x10')]['message']);return _0x24befe(_0x3e0a15[_0xae02('0x10')]['message']);}else{logger[_0xae02('0xc')](_0xae02('0xd'),_0x1da455,_0xae02('0xe'));_0x24befe(_0x3e0a15[_0xae02('0x11')][_0xae02('0x12')]);}})[_0xae02('0x13')](function(_0x24dead){logger[_0xae02('0x10')](_0xae02('0xd'),_0x1da455,_0x24dead);_0x244971(_0x24dead);});});} \ No newline at end of file +var _0xaec5=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaec5,0x92));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5aec('0x0'));var util=require(_0x5aec('0x1'));var moment=require(_0x5aec('0x2'));var BPromise=require(_0x5aec('0x3'));var rs=require(_0x5aec('0x4'));var fs=require('fs');var Redis=require(_0x5aec('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5aec('0x6'));var logger=require(_0x5aec('0x7'))(_0x5aec('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x476951,_0x3dae8d,_0x215103){return new BPromise(function(_0x28c362,_0x55c01e){return client[_0x5aec('0x9')](_0x476951,_0x215103)[_0x5aec('0xa')](function(_0x5b5bb3){logger[_0x5aec('0xb')](_0x5aec('0xc'),_0x3dae8d,_0x5aec('0xd'));logger[_0x5aec('0xe')](_0x5aec('0xf'),_0x3dae8d,_0x5aec('0xd'),JSON[_0x5aec('0x10')](_0x5b5bb3));if(_0x5b5bb3['error']){if(_0x5b5bb3['error'][_0x5aec('0x11')]===0x1f4){logger[_0x5aec('0x12')](_0x5aec('0xc'),_0x3dae8d,_0x5b5bb3[_0x5aec('0x12')][_0x5aec('0x13')]);return _0x55c01e(_0x5b5bb3[_0x5aec('0x12')][_0x5aec('0x13')]);}logger[_0x5aec('0x12')](_0x5aec('0xc'),_0x3dae8d,_0x5b5bb3[_0x5aec('0x12')][_0x5aec('0x13')]);return _0x28c362(_0x5b5bb3['error'][_0x5aec('0x13')]);}else{logger[_0x5aec('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x3dae8d,_0x5aec('0xd'));_0x28c362(_0x5b5bb3['result'][_0x5aec('0x13')]);}})[_0x5aec('0x14')](function(_0x28f415){logger[_0x5aec('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x3dae8d,_0x28f415);_0x55c01e(_0x28f415);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 9611209..a674410 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 _0xa54e=['Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update','multer','util','connect-timeout'];(function(_0x25f3ca,_0x10782f){var _0x2dea0b=function(_0x420571){while(--_0x420571){_0x25f3ca['push'](_0x25f3ca['shift']());}};_0x2dea0b(++_0x10782f);}(_0xa54e,0x7d));var _0xea54=function(_0x218756,_0x419c39){_0x218756=_0x218756-0x0;var _0x1b90ec=_0xa54e[_0x218756];return _0x1b90ec;};'use strict';var multer=require(_0xea54('0x0'));var util=require(_0xea54('0x1'));var path=require('path');var timeout=require(_0xea54('0x2'));var express=require('express');var router=express[_0xea54('0x3')]();var fs_extra=require(_0xea54('0x4'));var auth=require(_0xea54('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea54('0x6'));var controller=require(_0xea54('0x7'));router[_0xea54('0x8')]('/',auth[_0xea54('0x9')](),controller[_0xea54('0xa')]);router['get'](_0xea54('0xb'),auth[_0xea54('0x9')](),controller[_0xea54('0xc')]);router[_0xea54('0xd')]('/',auth[_0xea54('0x9')](),controller['create']);router[_0xea54('0xe')](_0xea54('0xb'),auth[_0xea54('0x9')](),controller[_0xea54('0xf')]);router['delete'](_0xea54('0xb'),auth[_0xea54('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd1ca=['multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','post','create','put','/:id','update','delete','exports'];(function(_0x418dc2,_0x1d3010){var _0x2dfa1b=function(_0x5e1f56){while(--_0x5e1f56){_0x418dc2['push'](_0x418dc2['shift']());}};_0x2dfa1b(++_0x1d3010);}(_0xd1ca,0x140));var _0xad1c=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xd1ca[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xad1c('0x2')]();var fs_extra=require(_0xad1c('0x3'));var auth=require(_0xad1c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xad1c('0x5'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0xad1c('0x6')](),controller[_0xad1c('0x7')]);router[_0xad1c('0x8')]('/:id',auth[_0xad1c('0x6')](),controller['show']);router[_0xad1c('0x9')]('/',auth[_0xad1c('0x6')](),controller[_0xad1c('0xa')]);router[_0xad1c('0xb')](_0xad1c('0xc'),auth[_0xad1c('0x6')](),controller[_0xad1c('0xd')]);router[_0xad1c('0xe')](_0xad1c('0xc'),auth[_0xad1c('0x6')](),controller['destroy']);module[_0xad1c('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index d8e783e..db1db13 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 _0x06ae=['BOOLEAN','variable','customVariable','keyValue','picklist','string','STRING','ENUM'];(function(_0x3bdca4,_0x55d4ca){var _0x2091cf=function(_0x1879df){while(--_0x1879df){_0x3bdca4['push'](_0x3bdca4['shift']());}};_0x2091cf(++_0x55d4ca);}(_0x06ae,0x79));var _0xe06a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ae[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xe06a('0x0'),_0xe06a('0x1'),_0xe06a('0x2'),_0xe06a('0x3')),'defaultValue':_0xe06a('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe06a('0x5')]},'keyType':{'type':Sequelize[_0xe06a('0x6')]('string',_0xe06a('0x0'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe06a('0x5')]},'nameField':{'type':Sequelize[_0xe06a('0x5')]},'customField':{'type':Sequelize[_0xe06a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe06a('0x5')]}}; \ No newline at end of file +var _0xa27c=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x26221a,_0x46d354){var _0x227a3f=function(_0x4bc5e3){while(--_0x4bc5e3){_0x26221a['push'](_0x26221a['shift']());}};_0x227a3f(++_0x46d354);}(_0xa27c,0x8c));var _0xca27=function(_0x1d7343,_0x5784ca){_0x1d7343=_0x1d7343-0x0;var _0x25f115=_0xa27c[_0x1d7343];return _0x25f115;};'use strict';var Sequelize=require(_0xca27('0x0'));module[_0xca27('0x1')]={'type':{'type':Sequelize[_0xca27('0x2')](_0xca27('0x3'),_0xca27('0x4'),_0xca27('0x5'),_0xca27('0x6'),_0xca27('0x7')),'defaultValue':_0xca27('0x3')},'content':{'type':Sequelize[_0xca27('0x8')]},'key':{'type':Sequelize[_0xca27('0x8')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xca27('0x5'))},'keyContent':{'type':Sequelize[_0xca27('0x8')]},'idField':{'type':Sequelize[_0xca27('0x8')]},'nameField':{'type':Sequelize[_0xca27('0x8')]},'customField':{'type':Sequelize[_0xca27('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xca27('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 0d31c9f..232c1be 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 _0x29e8=['includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','crypto','desk.js','papaparse','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','update','then','destroy','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','options'];(function(_0x1b0659,_0x586a89){var _0x1e3bf6=function(_0x4fb9a2){while(--_0x4fb9a2){_0x1b0659['push'](_0x1b0659['shift']());}};_0x1e3bf6(++_0x586a89);}(_0x29e8,0x116));var _0x829e=function(_0x3ce849,_0x286805){_0x3ce849=_0x3ce849-0x0;var _0x20eea4=_0x29e8[_0x3ce849];return _0x20eea4;};'use strict';var emlformat=require(_0x829e('0x0'));var rimraf=require(_0x829e('0x1'));var zipdir=require(_0x829e('0x2'));var jsonpatch=require(_0x829e('0x3'));var rp=require('request-promise');var moment=require(_0x829e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x829e('0x5'));var util=require(_0x829e('0x6'));var path=require(_0x829e('0x7'));var sox=require(_0x829e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x829e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x829e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x829e('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x829e('0xc'));var Redis=require(_0x829e('0xd'));var authService=require(_0x829e('0xe'));var qs=require(_0x829e('0xf'));var as=require(_0x829e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x829e('0x11'))(_0x829e('0x12'));var utils=require(_0x829e('0x13'));var config=require(_0x829e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x829e('0x15'))['db'];function respondWithStatusCode(_0x74950b,_0x3a1697){_0x3a1697=_0x3a1697||0xcc;return function(_0x5b4107){if(_0x5b4107){return _0x74950b[_0x829e('0x16')](_0x3a1697);}return _0x74950b[_0x829e('0x17')](_0x3a1697)[_0x829e('0x18')]();};}function respondWithResult(_0x1f81bb,_0x2f7c64){_0x2f7c64=_0x2f7c64||0xc8;return function(_0x2162a8){if(_0x2162a8){return _0x1f81bb['status'](_0x2f7c64)[_0x829e('0x19')](_0x2162a8);}};}function respondWithFilteredResult(_0xc48685,_0x4b6de9){return function(_0x599f8b){if(_0x599f8b){var _0x39fd66=typeof _0x4b6de9[_0x829e('0x1a')]===_0x829e('0x1b')&&typeof _0x4b6de9['limit']==='undefined';var _0x8bdd5f=_0x599f8b['count'];var _0x2a7f8d=_0x39fd66?0x0:_0x4b6de9[_0x829e('0x1a')];var _0x5d43a0=_0x39fd66?_0x599f8b[_0x829e('0x1c')]:_0x4b6de9[_0x829e('0x1a')]+_0x4b6de9[_0x829e('0x1d')];var _0x22f012;if(_0x5d43a0>=_0x8bdd5f){_0x5d43a0=_0x8bdd5f;_0x22f012=0xc8;}else{_0x22f012=0xce;}_0xc48685['status'](_0x22f012);return _0xc48685['set']('Content-Range',_0x2a7f8d+'-'+_0x5d43a0+'/'+_0x8bdd5f)[_0x829e('0x19')](_0x599f8b);}return null;};}function patchUpdates(_0x44196d){return function(_0x370d2c){try{jsonpatch['apply'](_0x370d2c,_0x44196d,!![]);}catch(_0x5605dd){return BPromise['reject'](_0x5605dd);}return _0x370d2c['save']();};}function saveUpdates(_0x1fc75f,_0x30f9ca){return function(_0x4b5711){if(_0x4b5711){return _0x4b5711[_0x829e('0x1e')](_0x1fc75f)[_0x829e('0x1f')](function(_0x244b66){return _0x244b66;});}return null;};}function removeEntity(_0x5e264b,_0x1efdba){return function(_0x4e1082){if(_0x4e1082){return _0x4e1082[_0x829e('0x20')]()[_0x829e('0x1f')](function(){_0x5e264b[_0x829e('0x17')](0xcc)[_0x829e('0x18')]();});}};}function handleEntityNotFound(_0x37a6c1,_0x13adf6){return function(_0x108f15){if(!_0x108f15){_0x37a6c1[_0x829e('0x16')](0x194);}return _0x108f15;};}function handleError(_0xbe9590,_0x497128){_0x497128=_0x497128||0x1f4;return function(_0xfc8699){logger['error'](_0xfc8699['stack']);if(_0xfc8699[_0x829e('0x21')]){delete _0xfc8699[_0x829e('0x21')];}_0xbe9590[_0x829e('0x17')](_0x497128)[_0x829e('0x22')](_0xfc8699);};}exports[_0x829e('0x23')]=function(_0xffd177,_0x22572b){var _0x357f28={},_0x55c0e5={},_0x257e5a={'count':0x0,'rows':[]};var _0x3c23b6=_[_0x829e('0x24')](db[_0x829e('0x25')][_0x829e('0x26')],function(_0xa0c589){return{'name':_0xa0c589[_0x829e('0x27')],'type':_0xa0c589['type'][_0x829e('0x28')]};});_0x55c0e5[_0x829e('0x29')]=_['map'](_0x3c23b6,_0x829e('0x21'));_0x55c0e5['query']=_[_0x829e('0x2a')](_0xffd177['query']);_0x55c0e5['filters']=_[_0x829e('0x2b')](_0x55c0e5[_0x829e('0x29')],_0x55c0e5[_0x829e('0x2c')]);_0x357f28[_0x829e('0x2d')]=_[_0x829e('0x2b')](_0x55c0e5[_0x829e('0x29')],qs[_0x829e('0x2e')](_0xffd177[_0x829e('0x2c')][_0x829e('0x2e')]));_0x357f28[_0x829e('0x2d')]=_0x357f28[_0x829e('0x2d')][_0x829e('0x2f')]?_0x357f28['attributes']:_0x55c0e5[_0x829e('0x29')];if(!_0xffd177['query'][_0x829e('0x30')](_0x829e('0x31'))){_0x357f28[_0x829e('0x1d')]=qs[_0x829e('0x1d')](_0xffd177[_0x829e('0x2c')][_0x829e('0x1d')]);_0x357f28[_0x829e('0x1a')]=qs[_0x829e('0x1a')](_0xffd177[_0x829e('0x2c')][_0x829e('0x1a')]);}_0x357f28[_0x829e('0x32')]=qs[_0x829e('0x33')](_0xffd177[_0x829e('0x2c')][_0x829e('0x33')]);_0x357f28[_0x829e('0x34')]=qs['filters'](_['pick'](_0xffd177['query'],_0x55c0e5[_0x829e('0x35')]),_0x3c23b6);if(_0xffd177['query']['filter']){_0x357f28[_0x829e('0x34')]=_[_0x829e('0x36')](_0x357f28[_0x829e('0x34')],{'$or':_[_0x829e('0x24')](_0x3c23b6,function(_0x7c8f1b){if(_0x7c8f1b['type']!==_0x829e('0x37')){var _0x4ac416={};_0x4ac416[_0x7c8f1b[_0x829e('0x21')]]={'$like':'%'+_0xffd177[_0x829e('0x2c')]['filter']+'%'};return _0x4ac416;}})});}_0x357f28=_[_0x829e('0x36')]({},_0x357f28,_0xffd177[_0x829e('0x38')]);var _0x273dcb={'where':_0x357f28[_0x829e('0x34')]};return db[_0x829e('0x25')][_0x829e('0x1c')](_0x273dcb)[_0x829e('0x1f')](function(_0x397dec){_0x257e5a[_0x829e('0x1c')]=_0x397dec;if(_0xffd177[_0x829e('0x2c')][_0x829e('0x39')]){_0x357f28[_0x829e('0x3a')]=[{'all':!![]}];}return db[_0x829e('0x25')][_0x829e('0x3b')](_0x357f28);})[_0x829e('0x1f')](function(_0x132a2e){_0x257e5a[_0x829e('0x3c')]=_0x132a2e;return _0x257e5a;})[_0x829e('0x1f')](respondWithFilteredResult(_0x22572b,_0x357f28))[_0x829e('0x3d')](handleError(_0x22572b,null));};exports[_0x829e('0x3e')]=function(_0x118e0a,_0x50c4de){var _0x2997b9={'raw':!![],'where':{'id':_0x118e0a[_0x829e('0x3f')]['id']}},_0x37acd7={};_0x37acd7['model']=_[_0x829e('0x2a')](db[_0x829e('0x25')][_0x829e('0x26')]);_0x37acd7[_0x829e('0x2c')]=_[_0x829e('0x2a')](_0x118e0a[_0x829e('0x2c')]);_0x37acd7['filters']=_['intersection'](_0x37acd7[_0x829e('0x29')],_0x37acd7[_0x829e('0x2c')]);_0x2997b9[_0x829e('0x2d')]=_[_0x829e('0x2b')](_0x37acd7[_0x829e('0x29')],qs['fields'](_0x118e0a[_0x829e('0x2c')]['fields']));_0x2997b9['attributes']=_0x2997b9['attributes'][_0x829e('0x2f')]?_0x2997b9[_0x829e('0x2d')]:_0x37acd7[_0x829e('0x29')];if(_0x118e0a['query']['includeAll']){_0x2997b9[_0x829e('0x3a')]=[{'all':!![]}];}_0x2997b9=_['merge']({},_0x2997b9,_0x118e0a['options']);return db[_0x829e('0x25')][_0x829e('0x40')](_0x2997b9)[_0x829e('0x1f')](handleEntityNotFound(_0x50c4de,null))['then'](respondWithResult(_0x50c4de,null))[_0x829e('0x3d')](handleError(_0x50c4de,null));};exports[_0x829e('0x41')]=function(_0x55f2d5,_0x218fc3){return db[_0x829e('0x25')][_0x829e('0x41')](_0x55f2d5['body'],{})['then'](respondWithResult(_0x218fc3,0xc9))[_0x829e('0x3d')](handleError(_0x218fc3,null));};exports[_0x829e('0x1e')]=function(_0x38f8bf,_0x3f4655){if(_0x38f8bf[_0x829e('0x42')]['id']){delete _0x38f8bf[_0x829e('0x42')]['id'];}return db[_0x829e('0x25')][_0x829e('0x40')]({'where':{'id':_0x38f8bf[_0x829e('0x3f')]['id']}})[_0x829e('0x1f')](handleEntityNotFound(_0x3f4655,null))[_0x829e('0x1f')](saveUpdates(_0x38f8bf[_0x829e('0x42')],null))[_0x829e('0x1f')](respondWithResult(_0x3f4655,null))[_0x829e('0x3d')](handleError(_0x3f4655,null));};exports['destroy']=function(_0xbff9cc,_0x128f3a){return db[_0x829e('0x25')][_0x829e('0x40')]({'where':{'id':_0xbff9cc['params']['id']}})[_0x829e('0x1f')](handleEntityNotFound(_0x128f3a,null))['then'](removeEntity(_0x128f3a,null))['catch'](handleError(_0x128f3a,null));}; \ No newline at end of file +var _0x4a03=['../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x3bdebc,_0x557b51){var _0x57fb15=function(_0x434d5e){while(--_0x434d5e){_0x3bdebc['push'](_0x3bdebc['shift']());}};_0x57fb15(++_0x557b51);}(_0x4a03,0x16e));var _0x34a0=function(_0x168bb0,_0x3e7b13){_0x168bb0=_0x168bb0-0x0;var _0xf241b6=_0x4a03[_0x168bb0];return _0xf241b6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34a0('0x0'));var zipdir=require(_0x34a0('0x1'));var jsonpatch=require(_0x34a0('0x2'));var rp=require('request-promise');var moment=require(_0x34a0('0x3'));var BPromise=require(_0x34a0('0x4'));var Mustache=require(_0x34a0('0x5'));var util=require('util');var path=require(_0x34a0('0x6'));var sox=require(_0x34a0('0x7'));var csv=require('to-csv');var ejs=require(_0x34a0('0x8'));var fs=require('fs');var fs_extra=require(_0x34a0('0x9'));var _=require('lodash');var squel=require(_0x34a0('0xa'));var crypto=require(_0x34a0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x34a0('0xc'));var toCsv=require(_0x34a0('0xd'));var querystring=require(_0x34a0('0xe'));var Papa=require(_0x34a0('0xf'));var Redis=require(_0x34a0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x34a0('0x11'));var as=require(_0x34a0('0x12'));var hardwareService=require(_0x34a0('0x13'));var logger=require(_0x34a0('0x14'))(_0x34a0('0x15'));var utils=require(_0x34a0('0x16'));var config=require(_0x34a0('0x17'));var licenseUtil=require(_0x34a0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5506cb,_0x9e08fb){_0x9e08fb=_0x9e08fb||0xcc;return function(_0x220f9a){if(_0x220f9a){return _0x5506cb['sendStatus'](_0x9e08fb);}return _0x5506cb[_0x34a0('0x19')](_0x9e08fb)[_0x34a0('0x1a')]();};}function respondWithResult(_0x126d89,_0x46c0e2){_0x46c0e2=_0x46c0e2||0xc8;return function(_0x1b647a){if(_0x1b647a){return _0x126d89[_0x34a0('0x19')](_0x46c0e2)[_0x34a0('0x1b')](_0x1b647a);}};}function respondWithFilteredResult(_0x1f3d7a,_0x3fb308){return function(_0x22eac3){if(_0x22eac3){var _0x148042=typeof _0x3fb308[_0x34a0('0x1c')]===_0x34a0('0x1d')&&typeof _0x3fb308[_0x34a0('0x1e')]===_0x34a0('0x1d');var _0x1ae2a8=_0x22eac3[_0x34a0('0x1f')];var _0x224cca=_0x148042?0x0:_0x3fb308[_0x34a0('0x1c')];var _0x2c5325=_0x148042?_0x22eac3['count']:_0x3fb308[_0x34a0('0x1c')]+_0x3fb308[_0x34a0('0x1e')];var _0x1d00ef;if(_0x2c5325>=_0x1ae2a8){_0x2c5325=_0x1ae2a8;_0x1d00ef=0xc8;}else{_0x1d00ef=0xce;}_0x1f3d7a[_0x34a0('0x19')](_0x1d00ef);return _0x1f3d7a[_0x34a0('0x20')](_0x34a0('0x21'),_0x224cca+'-'+_0x2c5325+'/'+_0x1ae2a8)['json'](_0x22eac3);}return null;};}function patchUpdates(_0x120780){return function(_0x21aafb){try{jsonpatch[_0x34a0('0x22')](_0x21aafb,_0x120780,!![]);}catch(_0x3943e3){return BPromise[_0x34a0('0x23')](_0x3943e3);}return _0x21aafb[_0x34a0('0x24')]();};}function saveUpdates(_0x518a0c,_0x4358d2){return function(_0xd668e3){if(_0xd668e3){return _0xd668e3[_0x34a0('0x25')](_0x518a0c)[_0x34a0('0x26')](function(_0x412031){return _0x412031;});}return null;};}function removeEntity(_0xbc5c86,_0x5354c7){return function(_0x2a25dd){if(_0x2a25dd){return _0x2a25dd[_0x34a0('0x27')]()['then'](function(){_0xbc5c86[_0x34a0('0x19')](0xcc)[_0x34a0('0x1a')]();});}};}function handleEntityNotFound(_0x4fdbc3,_0x41e278){return function(_0x14b3e8){if(!_0x14b3e8){_0x4fdbc3[_0x34a0('0x28')](0x194);}return _0x14b3e8;};}function handleError(_0x213632,_0x79046f){_0x79046f=_0x79046f||0x1f4;return function(_0x5c49be){logger[_0x34a0('0x29')](_0x5c49be[_0x34a0('0x2a')]);if(_0x5c49be[_0x34a0('0x2b')]){delete _0x5c49be[_0x34a0('0x2b')];}_0x213632[_0x34a0('0x19')](_0x79046f)[_0x34a0('0x2c')](_0x5c49be);};}exports['index']=function(_0x55d52a,_0x2b4c60){var _0x599c30={},_0x333ecf={},_0x2b35c8={'count':0x0,'rows':[]};var _0x11d4d2=_[_0x34a0('0x2d')](db[_0x34a0('0x2e')][_0x34a0('0x2f')],function(_0x5821f1){return{'name':_0x5821f1[_0x34a0('0x30')],'type':_0x5821f1[_0x34a0('0x31')][_0x34a0('0x32')]};});_0x333ecf[_0x34a0('0x33')]=_[_0x34a0('0x2d')](_0x11d4d2,_0x34a0('0x2b'));_0x333ecf[_0x34a0('0x34')]=_[_0x34a0('0x35')](_0x55d52a[_0x34a0('0x34')]);_0x333ecf[_0x34a0('0x36')]=_[_0x34a0('0x37')](_0x333ecf[_0x34a0('0x33')],_0x333ecf[_0x34a0('0x34')]);_0x599c30[_0x34a0('0x38')]=_['intersection'](_0x333ecf[_0x34a0('0x33')],qs[_0x34a0('0x39')](_0x55d52a[_0x34a0('0x34')]['fields']));_0x599c30[_0x34a0('0x38')]=_0x599c30['attributes'][_0x34a0('0x3a')]?_0x599c30[_0x34a0('0x38')]:_0x333ecf[_0x34a0('0x33')];if(!_0x55d52a[_0x34a0('0x34')][_0x34a0('0x3b')](_0x34a0('0x3c'))){_0x599c30['limit']=qs[_0x34a0('0x1e')](_0x55d52a['query'][_0x34a0('0x1e')]);_0x599c30[_0x34a0('0x1c')]=qs[_0x34a0('0x1c')](_0x55d52a['query'][_0x34a0('0x1c')]);}_0x599c30[_0x34a0('0x3d')]=qs[_0x34a0('0x3e')](_0x55d52a[_0x34a0('0x34')]['sort']);_0x599c30['where']=qs[_0x34a0('0x36')](_[_0x34a0('0x3f')](_0x55d52a['query'],_0x333ecf[_0x34a0('0x36')]),_0x11d4d2);if(_0x55d52a[_0x34a0('0x34')]['filter']){_0x599c30['where']=_['merge'](_0x599c30['where'],{'$or':_[_0x34a0('0x2d')](_0x11d4d2,function(_0x371bd1){if(_0x371bd1[_0x34a0('0x31')]!==_0x34a0('0x40')){var _0x253045={};_0x253045[_0x371bd1[_0x34a0('0x2b')]]={'$like':'%'+_0x55d52a[_0x34a0('0x34')][_0x34a0('0x41')]+'%'};return _0x253045;}})});}_0x599c30=_[_0x34a0('0x42')]({},_0x599c30,_0x55d52a[_0x34a0('0x43')]);var _0x2952b4={'where':_0x599c30['where']};return db[_0x34a0('0x2e')]['count'](_0x2952b4)['then'](function(_0x152c28){_0x2b35c8[_0x34a0('0x1f')]=_0x152c28;if(_0x55d52a[_0x34a0('0x34')][_0x34a0('0x44')]){_0x599c30[_0x34a0('0x45')]=[{'all':!![]}];}return db[_0x34a0('0x2e')][_0x34a0('0x46')](_0x599c30);})[_0x34a0('0x26')](function(_0x3c736){_0x2b35c8[_0x34a0('0x47')]=_0x3c736;return _0x2b35c8;})[_0x34a0('0x26')](respondWithFilteredResult(_0x2b4c60,_0x599c30))[_0x34a0('0x48')](handleError(_0x2b4c60,null));};exports[_0x34a0('0x49')]=function(_0x442da2,_0x368af5){var _0x253018={'raw':!![],'where':{'id':_0x442da2[_0x34a0('0x4a')]['id']}},_0x5cddc3={};_0x5cddc3[_0x34a0('0x33')]=_['keys'](db[_0x34a0('0x2e')]['rawAttributes']);_0x5cddc3[_0x34a0('0x34')]=_[_0x34a0('0x35')](_0x442da2[_0x34a0('0x34')]);_0x5cddc3[_0x34a0('0x36')]=_['intersection'](_0x5cddc3['model'],_0x5cddc3['query']);_0x253018[_0x34a0('0x38')]=_[_0x34a0('0x37')](_0x5cddc3['model'],qs[_0x34a0('0x39')](_0x442da2[_0x34a0('0x34')][_0x34a0('0x39')]));_0x253018[_0x34a0('0x38')]=_0x253018[_0x34a0('0x38')][_0x34a0('0x3a')]?_0x253018[_0x34a0('0x38')]:_0x5cddc3[_0x34a0('0x33')];if(_0x442da2['query'][_0x34a0('0x44')]){_0x253018[_0x34a0('0x45')]=[{'all':!![]}];}_0x253018=_[_0x34a0('0x42')]({},_0x253018,_0x442da2[_0x34a0('0x43')]);return db[_0x34a0('0x2e')]['find'](_0x253018)[_0x34a0('0x26')](handleEntityNotFound(_0x368af5,null))[_0x34a0('0x26')](respondWithResult(_0x368af5,null))[_0x34a0('0x48')](handleError(_0x368af5,null));};exports[_0x34a0('0x4b')]=function(_0x3397b4,_0x3bfdf4){return db[_0x34a0('0x2e')][_0x34a0('0x4b')](_0x3397b4[_0x34a0('0x4c')],{})[_0x34a0('0x26')](respondWithResult(_0x3bfdf4,0xc9))['catch'](handleError(_0x3bfdf4,null));};exports[_0x34a0('0x25')]=function(_0x47cfd3,_0x1483c4){if(_0x47cfd3[_0x34a0('0x4c')]['id']){delete _0x47cfd3['body']['id'];}return db['DeskField'][_0x34a0('0x4d')]({'where':{'id':_0x47cfd3[_0x34a0('0x4a')]['id']}})[_0x34a0('0x26')](handleEntityNotFound(_0x1483c4,null))['then'](saveUpdates(_0x47cfd3['body'],null))['then'](respondWithResult(_0x1483c4,null))[_0x34a0('0x48')](handleError(_0x1483c4,null));};exports['destroy']=function(_0x1ae2a5,_0x2a5c03){return db[_0x34a0('0x2e')][_0x34a0('0x4d')]({'where':{'id':_0x1ae2a5[_0x34a0('0x4a')]['id']}})[_0x34a0('0x26')](handleEntityNotFound(_0x2a5c03,null))[_0x34a0('0x26')](removeEntity(_0x2a5c03,null))[_0x34a0('0x48')](handleError(_0x2a5c03,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 5698536..fe0ee94 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 _0x5d22=['DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intDeskField.attributes','exports'];(function(_0x527372,_0x173b25){var _0x4f88b2=function(_0x1d0bb6){while(--_0x1d0bb6){_0x527372['push'](_0x527372['shift']());}};_0x4f88b2(++_0x173b25);}(_0x5d22,0xf2));var _0x25d2=function(_0x6e0e97,_0x12d23d){_0x6e0e97=_0x6e0e97-0x0;var _0x5c84d6=_0x5d22[_0x6e0e97];return _0x5c84d6;};'use strict';var _=require(_0x25d2('0x0'));var util=require(_0x25d2('0x1'));var logger=require(_0x25d2('0x2'))(_0x25d2('0x3'));var moment=require(_0x25d2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x25d2('0x5'));var rimraf=require(_0x25d2('0x6'));var config=require(_0x25d2('0x7'));var attributes=require(_0x25d2('0x8'));module[_0x25d2('0x9')]=function(_0x4f7003,_0x489b22){return _0x4f7003['define'](_0x25d2('0xa'),attributes,{'tableName':_0x25d2('0xb'),'paranoid':![],'indexes':[{'name':_0x25d2('0xc'),'fields':['idField',_0x25d2('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8bb2=['./intDeskField.attributes','define','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','request-promise','path','../../config/environment'];(function(_0xec2241,_0x453d5c){var _0x201e24=function(_0x3988a5){while(--_0x3988a5){_0xec2241['push'](_0xec2241['shift']());}};_0x201e24(++_0x453d5c);}(_0x8bb2,0xf7));var _0x28bb=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0x8bb2[_0x4492af];return _0x216729;};'use strict';var _=require(_0x28bb('0x0'));var util=require(_0x28bb('0x1'));var logger=require(_0x28bb('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x28bb('0x3'));var fs=require('fs');var path=require(_0x28bb('0x4'));var rimraf=require('rimraf');var config=require(_0x28bb('0x5'));var attributes=require(_0x28bb('0x6'));module['exports']=function(_0x42d20c,_0x4baafd){return _0x42d20c[_0x28bb('0x7')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x28bb('0x8'),'fields':[_0x28bb('0x9'),_0x28bb('0xa')],'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 6c37d7f..e8d1419 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 _0xe8f6=['rpc','../../config/environment','client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x173336,_0x3f98c4){var _0x12dc79=function(_0xae7bf5){while(--_0xae7bf5){_0x173336['push'](_0x173336['shift']());}};_0x12dc79(++_0x3f98c4);}(_0xe8f6,0x1c7));var _0x6e8f=function(_0x1d312f,_0x5e43d8){_0x1d312f=_0x1d312f-0x0;var _0x16c419=_0xe8f6[_0x1d312f];return _0x16c419;};'use strict';var _=require(_0x6e8f('0x0'));var util=require(_0x6e8f('0x1'));var moment=require(_0x6e8f('0x2'));var BPromise=require(_0x6e8f('0x3'));var rs=require(_0x6e8f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e8f('0x5'))['db'];var utils=require(_0x6e8f('0x6'));var logger=require('../../config/logger')(_0x6e8f('0x7'));var config=require(_0x6e8f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6e8f('0x9')][_0x6e8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e548e,_0x43c371,_0x10dcd7){return new BPromise(function(_0x4817ef,_0x27333f){return client['request'](_0x5e548e,_0x10dcd7)[_0x6e8f('0xb')](function(_0x491eb6){logger[_0x6e8f('0xc')](_0x6e8f('0xd'),_0x43c371,_0x6e8f('0xe'));logger[_0x6e8f('0xf')](_0x6e8f('0x10'),_0x43c371,'request\x20sent',JSON[_0x6e8f('0x11')](_0x491eb6));if(_0x491eb6['error']){if(_0x491eb6[_0x6e8f('0x12')]['code']===0x1f4){logger[_0x6e8f('0x12')](_0x6e8f('0xd'),_0x43c371,_0x491eb6[_0x6e8f('0x12')][_0x6e8f('0x13')]);return _0x27333f(_0x491eb6[_0x6e8f('0x12')]['message']);}logger[_0x6e8f('0x12')](_0x6e8f('0xd'),_0x43c371,_0x491eb6[_0x6e8f('0x12')]['message']);return _0x4817ef(_0x491eb6['error'][_0x6e8f('0x13')]);}else{logger[_0x6e8f('0xc')](_0x6e8f('0xd'),_0x43c371,_0x6e8f('0xe'));_0x4817ef(_0x491eb6['result'][_0x6e8f('0x13')]);}})[_0x6e8f('0x14')](function(_0x7f65f9){logger['error']('DeskField,\x20%s,\x20%s',_0x43c371,_0x7f65f9);_0x27333f(_0x7f65f9);});});} \ No newline at end of file +var _0x083a=['message','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error'];(function(_0xfcc292,_0x5f2934){var _0x3467eb=function(_0x188966){while(--_0x188966){_0xfcc292['push'](_0xfcc292['shift']());}};_0x3467eb(++_0x5f2934);}(_0x083a,0x17d));var _0xa083=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x083a[_0x4a7631];return _0x1a5a6f;};'use strict';var _=require(_0xa083('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa083('0x1'));var rs=require(_0xa083('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa083('0x3'));var logger=require(_0xa083('0x4'))(_0xa083('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa083('0x6')][_0xa083('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fb1ae,_0x15b76d,_0x10070a){return new BPromise(function(_0x45064e,_0x3964f3){return client[_0xa083('0x8')](_0x2fb1ae,_0x10070a)[_0xa083('0x9')](function(_0x33f3c7){logger[_0xa083('0xa')](_0xa083('0xb'),_0x15b76d,_0xa083('0xc'));logger['debug'](_0xa083('0xd'),_0x15b76d,_0xa083('0xc'),JSON['stringify'](_0x33f3c7));if(_0x33f3c7[_0xa083('0xe')]){if(_0x33f3c7[_0xa083('0xe')]['code']===0x1f4){logger[_0xa083('0xe')](_0xa083('0xb'),_0x15b76d,_0x33f3c7[_0xa083('0xe')][_0xa083('0xf')]);return _0x3964f3(_0x33f3c7[_0xa083('0xe')]['message']);}logger['error'](_0xa083('0xb'),_0x15b76d,_0x33f3c7[_0xa083('0xe')][_0xa083('0xf')]);return _0x45064e(_0x33f3c7['error']['message']);}else{logger[_0xa083('0xa')](_0xa083('0xb'),_0x15b76d,'request\x20sent');_0x45064e(_0x33f3c7[_0xa083('0x10')][_0xa083('0xf')]);}})[_0xa083('0x11')](function(_0x47e997){logger[_0xa083('0xe')](_0xa083('0xb'),_0x15b76d,_0x47e997);_0x3964f3(_0x47e997);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 8d5994b..78d5b8c 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 _0x06ec=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','/:id'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x06ec,0x8b));var _0xc06e=function(_0x59b71e,_0x4cea97){_0x59b71e=_0x59b71e-0x0;var _0x8cbb2b=_0x06ec[_0x59b71e];return _0x8cbb2b;};'use strict';var multer=require(_0xc06e('0x0'));var util=require(_0xc06e('0x1'));var path=require(_0xc06e('0x2'));var timeout=require(_0xc06e('0x3'));var express=require(_0xc06e('0x4'));var router=express[_0xc06e('0x5')]();var fs_extra=require(_0xc06e('0x6'));var auth=require(_0xc06e('0x7'));var interaction=require(_0xc06e('0x8'));var config=require(_0xc06e('0x9'));var controller=require(_0xc06e('0xa'));router[_0xc06e('0xb')]('/',auth[_0xc06e('0xc')](),controller[_0xc06e('0xd')]);router[_0xc06e('0xb')]('/:id',auth[_0xc06e('0xc')](),controller[_0xc06e('0xe')]);router[_0xc06e('0xb')](_0xc06e('0xf'),auth[_0xc06e('0xc')](),controller[_0xc06e('0x10')]);router['get'](_0xc06e('0x11'),auth[_0xc06e('0xc')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0xc06e('0x12')]);router[_0xc06e('0x13')](_0xc06e('0xf'),auth[_0xc06e('0xc')](),controller[_0xc06e('0x14')]);router[_0xc06e('0x15')](_0xc06e('0x16'),auth[_0xc06e('0xc')](),controller[_0xc06e('0x17')]);router[_0xc06e('0x18')](_0xc06e('0x16'),auth[_0xc06e('0xc')](),controller[_0xc06e('0x19')]);module[_0xc06e('0x1a')]=router; \ No newline at end of file +var _0x7903=['./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x55fa03,_0xcb96c2){var _0x2cd7cd=function(_0x56611f){while(--_0x56611f){_0x55fa03['push'](_0x55fa03['shift']());}};_0x2cd7cd(++_0xcb96c2);}(_0x7903,0x82));var _0x3790=function(_0x27b9ea,_0x5a4739){_0x27b9ea=_0x27b9ea-0x0;var _0x14af85=_0x7903[_0x27b9ea];return _0x14af85;};'use strict';var multer=require(_0x3790('0x0'));var util=require(_0x3790('0x1'));var path=require(_0x3790('0x2'));var timeout=require('connect-timeout');var express=require(_0x3790('0x3'));var router=express[_0x3790('0x4')]();var fs_extra=require(_0x3790('0x5'));var auth=require(_0x3790('0x6'));var interaction=require(_0x3790('0x7'));var config=require('../../config/environment');var controller=require(_0x3790('0x8'));router[_0x3790('0x9')]('/',auth[_0x3790('0xa')](),controller[_0x3790('0xb')]);router[_0x3790('0x9')](_0x3790('0xc'),auth[_0x3790('0xa')](),controller[_0x3790('0xd')]);router[_0x3790('0x9')](_0x3790('0xe'),auth[_0x3790('0xa')](),controller[_0x3790('0xf')]);router[_0x3790('0x9')](_0x3790('0x10'),auth[_0x3790('0xa')](),controller['getFields']);router[_0x3790('0x11')]('/',auth['isAuthenticated'](),controller[_0x3790('0x12')]);router[_0x3790('0x11')](_0x3790('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x3790('0x13')](_0x3790('0xc'),auth[_0x3790('0xa')](),controller['update']);router[_0x3790('0x14')](_0x3790('0xc'),auth[_0x3790('0xa')](),controller[_0x3790('0x15')]);module[_0x3790('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 99ed69f..d6df741 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 _0x0c29=['BOOLEAN','STRING'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0x0c29,0xb7));var _0x90c2=function(_0x4178af,_0x388652){_0x4178af=_0x4178af-0x0;var _0x20f4b1=_0x0c29[_0x4178af];return _0x20f4b1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x90c2('0x0')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x90c2('0x0')]},'remoteUri':{'type':Sequelize[_0x90c2('0x0')]},'tenantId':{'type':Sequelize[_0x90c2('0x0')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x90c2('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x90c2('0x0')]},'modernAuthentication':{'type':Sequelize[_0x90c2('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc0a4=['exports','STRING','BOOLEAN'];(function(_0x5cee2c,_0xce0660){var _0x4b27a9=function(_0x3e9df8){while(--_0x3e9df8){_0x5cee2c['push'](_0x5cee2c['shift']());}};_0x4b27a9(++_0xce0660);}(_0xc0a4,0x147));var _0x4c0a=function(_0xcfc35c,_0x12c6c7){_0xcfc35c=_0xcfc35c-0x0;var _0x25f596=_0xc0a4[_0xcfc35c];return _0x25f596;};'use strict';var Sequelize=require('sequelize');module[_0x4c0a('0x0')]={'name':{'type':Sequelize[_0x4c0a('0x1')]},'username':{'type':Sequelize[_0x4c0a('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x4c0a('0x1')]},'tenantId':{'type':Sequelize[_0x4c0a('0x1')]},'clientId':{'type':Sequelize[_0x4c0a('0x1')]},'clientSecret':{'type':Sequelize[_0x4c0a('0x1')]},'serverUrl':{'type':Sequelize[_0x4c0a('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x4c0a('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index d77d5b9..629a7b8 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 _0x0d27=['modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','modernAuthentication','CloudProvider','data5','access_token','data7','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','true','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','then','destroy','end','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','catch','create','body','update','find','findOne','Dynamics365Configuration','getConfigurations','nolimit','addConfiguration','AccountId','getSubjects','type','Descriptions','getDescriptions','channel','Dynamics365Field','slice','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','PhoneCall','title','description','customerid','ownerid','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','followupby','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0d27,0x112));var _0x70d2=function(_0x4f0d29,_0x1ae609){_0x4f0d29=_0x4f0d29-0x0;var _0x1b76d3=_0x0d27[_0x4f0d29];return _0x1b76d3;};'use strict';var rp=require(_0x70d2('0x0'));var util=require(_0x70d2('0x1'));var _=require(_0x70d2('0x2'));var qs=require(_0x70d2('0x3'));var logger=require(_0x70d2('0x4'))(_0x70d2('0x5'));var db=require('../../mysqldb')['db'];var integrations=require(_0x70d2('0x6'));function respondWithResult(_0x4eba8a,_0x448edc){_0x448edc=_0x448edc||0xc8;return function(_0x4d2c04){if(_0x4d2c04){return _0x4eba8a[_0x70d2('0x7')](_0x448edc)[_0x70d2('0x8')](_0x4d2c04);}};}function respondWithFilteredResult(_0x5808ed,_0x209ce3){return function(_0x23a9e6){if(_0x23a9e6){var _0x529a84=typeof _0x209ce3[_0x70d2('0x9')]===_0x70d2('0xa')&&typeof _0x209ce3[_0x70d2('0xb')]==='undefined';var _0xeceab4=_0x23a9e6[_0x70d2('0xc')];var _0x27a70f=_0x529a84?0x0:_0x209ce3[_0x70d2('0x9')];var _0x9247a7=_0x529a84?_0x23a9e6[_0x70d2('0xc')]:_0x209ce3[_0x70d2('0x9')]+_0x209ce3[_0x70d2('0xb')];var _0x1f8bc6;if(_0x9247a7>=_0xeceab4){_0x9247a7=_0xeceab4;_0x1f8bc6=0xc8;}else{_0x1f8bc6=0xce;}_0x5808ed['status'](_0x1f8bc6);return _0x5808ed[_0x70d2('0xd')]('Content-Range',_0x27a70f+'-'+_0x9247a7+'/'+_0xeceab4)[_0x70d2('0x8')](_0x23a9e6);}return null;};}function saveUpdates(_0x224261){return function(_0x154163){if(_0x154163){return _0x154163['update'](_0x224261)[_0x70d2('0xe')](function(_0xf58aa4){return _0xf58aa4;});}return null;};}function removeEntity(_0x386351){return function(_0x5eec7a){if(_0x5eec7a){return _0x5eec7a[_0x70d2('0xf')]()[_0x70d2('0xe')](function(){_0x386351[_0x70d2('0x7')](0xcc)[_0x70d2('0x10')]();});}};}function handleEntityNotFound(_0x370b6c){return function(_0x2d1d47){if(!_0x2d1d47){_0x370b6c['sendStatus'](0x194);}return _0x2d1d47;};}function handleError(_0x165037,_0x56ceb8){_0x56ceb8=_0x56ceb8||0x1f4;return function(_0x10df14){logger[_0x70d2('0x11')](_0x10df14[_0x70d2('0x12')]);if(_0x10df14[_0x70d2('0x13')]){delete _0x10df14['name'];}_0x165037[_0x70d2('0x7')](_0x56ceb8)[_0x70d2('0x14')](_0x10df14);};}exports[_0x70d2('0x15')]=function(_0x11a2d1,_0x36d132){var _0x39e5ca={},_0x2b27ac={},_0x30a8b6={'count':0x0,'rows':[]};var _0x102843=_[_0x70d2('0x16')](db[_0x70d2('0x17')][_0x70d2('0x18')],function(_0x42d1cf){return{'name':_0x42d1cf[_0x70d2('0x19')],'type':_0x42d1cf['type'][_0x70d2('0x1a')]};});_0x2b27ac['model']=_[_0x70d2('0x16')](_0x102843,_0x70d2('0x13'));_0x2b27ac[_0x70d2('0x1b')]=_[_0x70d2('0x1c')](_0x11a2d1[_0x70d2('0x1b')]);_0x2b27ac[_0x70d2('0x1d')]=_[_0x70d2('0x1e')](_0x2b27ac['model'],_0x2b27ac[_0x70d2('0x1b')]);_0x39e5ca[_0x70d2('0x1f')]=_[_0x70d2('0x1e')](_0x2b27ac[_0x70d2('0x20')],qs[_0x70d2('0x21')](_0x11a2d1[_0x70d2('0x1b')][_0x70d2('0x21')]));_0x39e5ca['attributes']=_0x39e5ca[_0x70d2('0x1f')][_0x70d2('0x22')]?_0x39e5ca[_0x70d2('0x1f')]:_0x2b27ac[_0x70d2('0x20')];if(!_0x11a2d1[_0x70d2('0x1b')][_0x70d2('0x23')]('nolimit')){_0x39e5ca[_0x70d2('0xb')]=qs['limit'](_0x11a2d1[_0x70d2('0x1b')][_0x70d2('0xb')]);_0x39e5ca[_0x70d2('0x9')]=qs['offset'](_0x11a2d1[_0x70d2('0x1b')]['offset']);}_0x39e5ca[_0x70d2('0x24')]=qs[_0x70d2('0x25')](_0x11a2d1[_0x70d2('0x1b')][_0x70d2('0x25')]);_0x39e5ca[_0x70d2('0x26')]=qs[_0x70d2('0x1d')](_[_0x70d2('0x27')](_0x11a2d1[_0x70d2('0x1b')],_0x2b27ac['filters']),_0x102843);if(_0x11a2d1[_0x70d2('0x1b')]['filter']){_0x39e5ca[_0x70d2('0x26')]=_[_0x70d2('0x28')](_0x39e5ca[_0x70d2('0x26')],{'$or':_[_0x70d2('0x16')](_0x102843,function(_0xd250a7){if(_0xd250a7['type']!==_0x70d2('0x29')){var _0x13de69={};_0x13de69[_0xd250a7[_0x70d2('0x13')]]={'$like':'%'+_0x11a2d1[_0x70d2('0x1b')][_0x70d2('0x2a')]+'%'};return _0x13de69;}})});}_0x39e5ca=_['merge']({},_0x39e5ca,_0x11a2d1[_0x70d2('0x2b')]);var _0x459b42={'where':_0x39e5ca[_0x70d2('0x26')]};return db[_0x70d2('0x17')][_0x70d2('0xc')](_0x459b42)['then'](function(_0x1b6082){_0x30a8b6[_0x70d2('0xc')]=_0x1b6082;if(_0x11a2d1[_0x70d2('0x1b')][_0x70d2('0x2c')]){_0x39e5ca[_0x70d2('0x2d')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x70d2('0x2e')](_0x39e5ca);})[_0x70d2('0xe')](function(_0x402f9a){_0x30a8b6[_0x70d2('0x2f')]=_0x402f9a;return _0x30a8b6;})[_0x70d2('0xe')](respondWithFilteredResult(_0x36d132,_0x39e5ca))['catch'](handleError(_0x36d132,null));};exports[_0x70d2('0x30')]=function(_0x594cb7,_0x4a6609){var _0x1b78fc={'raw':![],'where':{'id':_0x594cb7[_0x70d2('0x31')]['id']}},_0x70c8a1={};_0x70c8a1[_0x70d2('0x20')]=_[_0x70d2('0x1c')](db[_0x70d2('0x17')][_0x70d2('0x18')]);_0x70c8a1['query']=_[_0x70d2('0x1c')](_0x594cb7[_0x70d2('0x1b')]);_0x70c8a1['filters']=_[_0x70d2('0x1e')](_0x70c8a1[_0x70d2('0x20')],_0x70c8a1[_0x70d2('0x1b')]);_0x1b78fc[_0x70d2('0x1f')]=_['intersection'](_0x70c8a1['model'],qs[_0x70d2('0x21')](_0x594cb7['query'][_0x70d2('0x21')]));_0x1b78fc[_0x70d2('0x1f')]=_0x1b78fc[_0x70d2('0x1f')]['length']?_0x1b78fc[_0x70d2('0x1f')]:_0x70c8a1[_0x70d2('0x20')];if(_0x594cb7['query'][_0x70d2('0x2c')]){_0x1b78fc[_0x70d2('0x2d')]=[{'all':!![]}];}_0x1b78fc=_[_0x70d2('0x28')]({},_0x1b78fc,_0x594cb7[_0x70d2('0x2b')]);return db[_0x70d2('0x17')]['find'](_0x1b78fc)[_0x70d2('0xe')](handleEntityNotFound(_0x4a6609,null))[_0x70d2('0xe')](respondWithResult(_0x4a6609,null))[_0x70d2('0x32')](handleError(_0x4a6609,null));};exports[_0x70d2('0x33')]=function(_0x572369,_0x1fd9c9){return db[_0x70d2('0x17')]['create'](_0x572369[_0x70d2('0x34')],{})[_0x70d2('0xe')](respondWithResult(_0x1fd9c9,0xc9))[_0x70d2('0x32')](handleError(_0x1fd9c9,null));};exports[_0x70d2('0x35')]=function(_0x3ec3ff,_0x2ae0a4){if(_0x3ec3ff[_0x70d2('0x34')]['id']){delete _0x3ec3ff[_0x70d2('0x34')]['id'];}return db['Dynamics365Account'][_0x70d2('0x36')]({'where':{'id':_0x3ec3ff[_0x70d2('0x31')]['id']}})['then'](handleEntityNotFound(_0x2ae0a4,null))[_0x70d2('0xe')](saveUpdates(_0x3ec3ff['body'],null))['then'](respondWithResult(_0x2ae0a4,null))[_0x70d2('0x32')](handleError(_0x2ae0a4,null));};exports[_0x70d2('0xf')]=function(_0x591170,_0x5d0f7c){return db[_0x70d2('0x17')]['find']({'where':{'id':_0x591170['params']['id']}})[_0x70d2('0xe')](handleEntityNotFound(_0x5d0f7c,null))[_0x70d2('0xe')](removeEntity(_0x5d0f7c,null))[_0x70d2('0x32')](handleError(_0x5d0f7c,null));};exports['getConfigurations']=function(_0x503697,_0x2e04a8){var _0x2a81da={};var _0xa66e08={};var _0x1e5e53;var _0x3f0bd8;return db[_0x70d2('0x17')][_0x70d2('0x37')]({'where':{'id':_0x503697[_0x70d2('0x31')]['id']}})[_0x70d2('0xe')](handleEntityNotFound(_0x2e04a8,null))['then'](function(_0x2625eb){if(_0x2625eb){_0x1e5e53=_0x2625eb;_0xa66e08['model']=_[_0x70d2('0x1c')](db[_0x70d2('0x38')]['rawAttributes']);_0xa66e08[_0x70d2('0x1b')]=_['keys'](_0x503697['query']);_0xa66e08[_0x70d2('0x1d')]=_[_0x70d2('0x1e')](_0xa66e08[_0x70d2('0x20')],_0xa66e08[_0x70d2('0x1b')]);_0x2a81da[_0x70d2('0x1f')]=_['intersection'](_0xa66e08[_0x70d2('0x20')],qs[_0x70d2('0x21')](_0x503697['query'][_0x70d2('0x21')]));_0x2a81da[_0x70d2('0x1f')]=_0x2a81da['attributes'][_0x70d2('0x22')]?_0x2a81da[_0x70d2('0x1f')]:_0xa66e08[_0x70d2('0x20')];_0x2a81da['order']=qs['sort'](_0x503697[_0x70d2('0x1b')][_0x70d2('0x25')]);_0x2a81da[_0x70d2('0x26')]=qs[_0x70d2('0x1d')](_[_0x70d2('0x27')](_0x503697['query'],_0xa66e08[_0x70d2('0x1d')]));if(_0x503697['query'][_0x70d2('0x2a')]){_0x2a81da[_0x70d2('0x26')]=_[_0x70d2('0x28')](_0x2a81da[_0x70d2('0x26')],{'$or':_[_0x70d2('0x16')](_0x2a81da['attributes'],function(_0x47345b){var _0x301f26={};_0x301f26[_0x47345b]={'$like':'%'+_0x503697[_0x70d2('0x1b')][_0x70d2('0x2a')]+'%'};return _0x301f26;})});}_0x2a81da=_[_0x70d2('0x28')]({},_0x2a81da,_0x503697[_0x70d2('0x2b')]);return _0x1e5e53[_0x70d2('0x39')](_0x2a81da);}})['then'](function(_0x1f313d){if(_0x1f313d){_0x3f0bd8=_0x1f313d['length'];if(!_0x503697[_0x70d2('0x1b')][_0x70d2('0x23')](_0x70d2('0x3a'))){_0x2a81da['limit']=qs[_0x70d2('0xb')](_0x503697[_0x70d2('0x1b')][_0x70d2('0xb')]);_0x2a81da[_0x70d2('0x9')]=qs[_0x70d2('0x9')](_0x503697[_0x70d2('0x1b')]['offset']);}return _0x1e5e53['getConfigurations'](_0x2a81da);}})[_0x70d2('0xe')](function(_0xbaf954){if(_0xbaf954){return _0xbaf954?{'count':_0x3f0bd8,'rows':_0xbaf954}:null;}})['then'](respondWithResult(_0x2e04a8,null))[_0x70d2('0x32')](handleError(_0x2e04a8,null));};exports[_0x70d2('0x3b')]=function(_0x4655ba,_0x111591){if(_0x4655ba['body']['id']){delete _0x4655ba['body']['id'];}return db[_0x70d2('0x17')][_0x70d2('0x37')]({'where':{'id':_0x4655ba[_0x70d2('0x31')]['id']}})[_0x70d2('0xe')](handleEntityNotFound(_0x111591,null))['then'](function(_0x5c55db){if(_0x5c55db){_0x4655ba[_0x70d2('0x34')][_0x70d2('0x3c')]=_0x5c55db['id'];_0x4655ba[_0x70d2('0x34')]['Subjects']=integrations[_0x70d2('0x3d')](_0x4655ba['body']['channel'],_0x4655ba['body'][_0x70d2('0x3e')]);_0x4655ba[_0x70d2('0x34')][_0x70d2('0x3f')]=integrations[_0x70d2('0x40')](_0x4655ba[_0x70d2('0x34')][_0x70d2('0x41')],_0x4655ba[_0x70d2('0x34')][_0x70d2('0x3e')]);return db[_0x70d2('0x38')][_0x70d2('0x33')](_0x4655ba['body'],{'include':[{'model':db[_0x70d2('0x42')],'as':'Subjects'},{'model':db[_0x70d2('0x42')],'as':_0x70d2('0x3f')}]});}return null;})[_0x70d2('0xe')](respondWithResult(_0x111591,null))['catch'](handleError(_0x111591,null));};function sanitizeRemoteUri(_0x295349){var _0xd459e6=_0x295349[_0x70d2('0x43')](-0x1);if(_0xd459e6==='/')return _0x295349['substring'](0x0,_0x295349[_0x70d2('0x44')](_0xd459e6));return _0x295349;}function getWebApiUrl(_0x5d129f){return util[_0x70d2('0x45')](_0x70d2('0x46'),_0x5d129f);}exports[_0x70d2('0x47')]=function(_0x44d96f,_0x34fa4d){var _0x5bdf93=_0x44d96f[_0x70d2('0x1b')][_0x70d2('0x48')];var _0x4a6067=_0x5bdf93===_0x70d2('0x49')?'Incident':_0x70d2('0x4a');var _0x7706cc='';var _0x35c58a='';var _0x2b3a46='';var _0x1e1bc4='';var _0x353a8e='';var _0x189894='';var _0x1788ac='';var _0x1787b4='';var _0x2f99e4=[_0x70d2('0x4b'),_0x70d2('0x4c'),_0x70d2('0x4d'),_0x70d2('0x4e'),'caseorigincode','subject',_0x70d2('0x4f'),_0x70d2('0x50'),_0x70d2('0x51'),_0x70d2('0x52')];var _0x3ef59c=['accountidname','accountidyominame','actualserviceunits',_0x70d2('0x53'),_0x70d2('0x54'),_0x70d2('0x55'),'contractdetailidname',_0x70d2('0x56'),_0x70d2('0x57'),_0x70d2('0x58'),'createdbyname',_0x70d2('0x59'),_0x70d2('0x5a'),_0x70d2('0x5b'),_0x70d2('0x5c'),_0x70d2('0x5d'),_0x70d2('0x5e'),_0x70d2('0x5f'),_0x70d2('0x60'),_0x70d2('0x61'),_0x70d2('0x62'),'entityimage_url',_0x70d2('0x63'),'exchangerate','firstresponsebykpiidname',_0x70d2('0x64'),_0x70d2('0x65'),'influencescore','kbarticleidname',_0x70d2('0x66'),_0x70d2('0x67'),_0x70d2('0x68'),_0x70d2('0x69'),_0x70d2('0x6a'),_0x70d2('0x6b'),'modifiedon',_0x70d2('0x6c'),_0x70d2('0x6d'),_0x70d2('0x6e'),_0x70d2('0x6f'),'numberofchildincidents',_0x70d2('0x70'),_0x70d2('0x71'),'owneridname',_0x70d2('0x72'),_0x70d2('0x73'),_0x70d2('0x74'),_0x70d2('0x75'),_0x70d2('0x76'),_0x70d2('0x77'),_0x70d2('0x78'),_0x70d2('0x79'),'resolveby','resolvebykpiidname',_0x70d2('0x7a'),_0x70d2('0x7b'),_0x70d2('0x7c'),_0x70d2('0x7d'),_0x70d2('0x7e'),'slaname','socialprofileidname',_0x70d2('0x7f'),_0x70d2('0x80'),_0x70d2('0x81'),'ticketnumber',_0x70d2('0x82'),_0x70d2('0x83'),_0x70d2('0x84'),_0x70d2('0x85'),_0x70d2('0x86')];var _0x2702c3=_0x2f99e4[_0x70d2('0x87')](_0x3ef59c);return db[_0x70d2('0x17')][_0x70d2('0x37')]({'where':{'id':_0x44d96f[_0x70d2('0x31')]['id']},'attributes':['id',_0x70d2('0x88'),_0x70d2('0x89'),_0x70d2('0x8a'),'tenantId',_0x70d2('0x8b'),'clientSecret',_0x70d2('0x8c')],'include':[{'model':db[_0x70d2('0x8d')],'as':_0x70d2('0x8d'),'attributes':['id',_0x70d2('0x8e'),'data7']}]})[_0x70d2('0xe')](handleEntityNotFound(_0x34fa4d,null))[_0x70d2('0xe')](function(_0x5e02a0){if(_0x5e02a0){if(_0x5e02a0['modernAuthentication']){_0x5e02a0[_0x70d2('0x8f')]=_0x5e02a0['CloudProvider'][_0x70d2('0x8e')];_0x1787b4=sanitizeRemoteUri(_0x5e02a0[_0x70d2('0x8d')][_0x70d2('0x90')]);_0x1788ac=getWebApiUrl(_0x1787b4);return _0x5e02a0;}_0x1787b4=sanitizeRemoteUri(_0x5e02a0[_0x70d2('0x8a')]);_0x1788ac=getWebApiUrl(_0x1787b4);var _0x4b9bda={'method':_0x70d2('0x91'),'uri':_0x70d2('0x92')+_0x5e02a0[_0x70d2('0x93')]+_0x70d2('0x94'),'form':{'client_id':_0x5e02a0[_0x70d2('0x8b')],'resource':_0x1787b4,'username':_0x5e02a0[_0x70d2('0x88')],'password':_0x5e02a0[_0x70d2('0x89')],'grant_type':_0x70d2('0x89'),'client_secret':_0x5e02a0[_0x70d2('0x95')]},'json':!![]};return rp(_0x4b9bda);}})[_0x70d2('0xe')](function(_0xbd8d1a){_0x189894=_0xbd8d1a[_0x70d2('0x8f')];var _0x1eb8c0={'method':_0x70d2('0x96'),'uri':encodeURI(_0x1788ac+_0x70d2('0x97')+_0x4a6067+'\x27'),'headers':{'Authorization':_0x70d2('0x98')+_0x189894,'If-None-Match':null,'OData-Version':_0x70d2('0x99')},'json':!![]};return rp(_0x1eb8c0);})['then'](function(_0x2b0529){var _0x1c337f=_0x2b0529['value'][0x0];var _0x1f14c4=_0x1c337f[_0x70d2('0x9a')];var _0x365407={'method':_0x70d2('0x96'),'uri':_0x1788ac+_0x70d2('0x9b')+_0x1f14c4+_0x70d2('0x9c'),'headers':{'Authorization':'Bearer\x20'+_0x189894,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x365407);})[_0x70d2('0xe')](function(_0x225f41){_0x7706cc=_0x225f41;_0x35c58a=_0x7706cc[_0x70d2('0x9d')];_0x35c58a=_[_0x70d2('0x9e')](_0x35c58a,function(_0x32816d){return!_0x2702c3['includes'](_0x32816d[_0x70d2('0x9f')]);});var _0x24dce5=[];var _0x5ca4a5=[];_0x35c58a[_0x70d2('0xa0')](function(_0x728561){if(_0x728561[_0x70d2('0xa1')]){var _0x5ef8ce=_0x728561['@odata.type'][_0x70d2('0xa2')](_0x728561[_0x70d2('0xa1')]['lastIndexOf']('.')+0x1);if(_0x5ef8ce===_0x70d2('0xa3')){_0x24dce5[_0x70d2('0xa4')](getSelectList(_0x1788ac,_0x5bdf93,_0x5ca4a5,_0x7706cc[_0x70d2('0x9a')],_0x728561[_0x70d2('0x9a')],_0x189894));}}});return Promise[_0x70d2('0xa5')](_0x24dce5);})[_0x70d2('0xe')](function(_0x46220c){_0x2b3a46=_0x46220c[0x0];var _0x270299=[];var _0x187d27=[];_0x35c58a['forEach'](function(_0x118cb6){if(!_['isNil'](_0x118cb6[_0x70d2('0xa1')])){var _0x23c574=_0x118cb6[_0x70d2('0xa1')][_0x70d2('0xa2')](_0x118cb6[_0x70d2('0xa1')][_0x70d2('0x44')]('.')+0x1);if(_0x23c574==='BooleanAttributeMetadata'){_0x270299[_0x70d2('0xa4')](getBooleanList(_0x1788ac,_0x5bdf93,_0x187d27,_0x7706cc[_0x70d2('0x9a')],_0x118cb6['MetadataId'],_0x189894));}}});return Promise[_0x70d2('0xa5')](_0x270299);})[_0x70d2('0xe')](function(_0x29812f){_0x1e1bc4=_0x29812f[0x0];var _0x29da61=[];var _0x56cc00=[];_0x35c58a['forEach'](function(_0x3ec2a2){if(_0x3ec2a2[_0x70d2('0xa1')]){var _0x19d64b=_0x3ec2a2[_0x70d2('0xa1')][_0x70d2('0xa2')](_0x3ec2a2['@odata.type'][_0x70d2('0x44')]('.')+0x1);if(_0x19d64b===_0x70d2('0xa6')||_0x19d64b===_0x70d2('0xa7')||_0x19d64b===_0x70d2('0xa8')||_0x19d64b===_0x70d2('0xa9')||_0x19d64b===_0x70d2('0xaa')||_0x19d64b===_0x70d2('0xab')||_0x19d64b===_0x70d2('0xac')||_0x19d64b===_0x70d2('0xad')||_0x19d64b===_0x70d2('0xae')||_0x19d64b===_0x70d2('0xaf')){_0x29da61['push'](getInputList(_0x1788ac,_0x5bdf93,_0x19d64b,_0x56cc00,_0x7706cc[_0x70d2('0x9a')],_0x3ec2a2[_0x70d2('0x9a')],_0x189894));}}});return Promise['all'](_0x29da61);})[_0x70d2('0xe')](function(_0x4ab7d0){_0x353a8e=_0x4ab7d0[0x0];var _0x18011c=_0x2b3a46[_0x70d2('0x87')](_0x1e1bc4)['concat'](_0x353a8e);var _0x199bdd={'count':_0x18011c[_0x70d2('0x22')],'rows':_0x18011c};return _0x199bdd;})[_0x70d2('0xe')](respondWithResult(_0x34fa4d,null))[_0x70d2('0x32')](function(_0x54edd6){var _0xbba15=_0x44d96f[_0x70d2('0x1b')]['test']?0x1f4:_0x54edd6[_0x70d2('0xb0')]||0x1f4;logger[_0x70d2('0x11')](_0x54edd6[_0x70d2('0x12')]);delete _0x54edd6[_0x70d2('0x13')];if(_0xbba15===0x191){_0xbba15=0x190;}_0x34fa4d[_0x70d2('0x7')](_0xbba15)[_0x70d2('0x14')](_0x44d96f[_0x70d2('0x1b')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x54edd6[_0x70d2('0xb0')]}:_0x54edd6);});};function getSelectList(_0x347e88,_0x1da094,_0x3bbd2c,_0x59153a,_0x306404,_0x491697){var _0x5c2895={'method':_0x70d2('0x96'),'uri':_0x347e88+_0x70d2('0x9b')+_0x59153a+_0x70d2('0xb1')+_0x306404+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x70d2('0xb2'),'headers':{'Authorization':_0x70d2('0x98')+_0x491697,'If-None-Match':null,'OData-Version':_0x70d2('0x99')},'json':!![]};return rp(_0x5c2895)[_0x70d2('0xe')](function(_0x3f76cb){var _0x26927c=[];var _0x26a7e7=_0x3f76cb[_0x70d2('0xb3')][_0x70d2('0xb4')];_0x26a7e7['forEach'](function(_0x5e8892){_0x26927c['push']({'name':_0x5e8892[_0x70d2('0xb5')]['UserLocalizedLabel'][_0x70d2('0xb5')],'value':String(_0x5e8892[_0x70d2('0xb6')])});});var _0x4961d2={'id':_0x1da094+'_'+_0x3f76cb[_0x70d2('0x9f')],'name':_0x3f76cb['DisplayName']['UserLocalizedLabel'][_0x70d2('0xb5')],'custom':![],'options':_0x26927c};_0x3bbd2c[_0x70d2('0xa4')](_0x4961d2);return _0x3bbd2c;});}function getBooleanList(_0x3e677f,_0x4afdd3,_0xa456c8,_0x1fe2b3,_0x495181,_0x27963b){var _0x2120cb={'method':_0x70d2('0x96'),'uri':_0x3e677f+_0x70d2('0x9b')+_0x1fe2b3+_0x70d2('0xb1')+_0x495181+_0x70d2('0xb7'),'headers':{'Authorization':_0x70d2('0x98')+_0x27963b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2120cb)[_0x70d2('0xe')](function(_0x41c059){var _0x3a19c2=[];_0x3a19c2[_0x70d2('0xa4')]({'name':_0x41c059[_0x70d2('0xb3')][_0x70d2('0xb8')][_0x70d2('0xb5')][_0x70d2('0xb9')]['Label'],'value':_0x70d2('0xba')},{'name':_0x41c059[_0x70d2('0xb3')]['FalseOption'][_0x70d2('0xb5')][_0x70d2('0xb9')]['Label'],'value':_0x70d2('0xbb')});var _0x40d7ac={'id':_0x4afdd3+'_'+_0x41c059[_0x70d2('0x9f')],'name':_0x41c059[_0x70d2('0xbc')][_0x70d2('0xb9')]['Label'],'custom':![],'options':_0x3a19c2};_0xa456c8[_0x70d2('0xa4')](_0x40d7ac);return _0xa456c8;});}function getInputList(_0x520677,_0x5c316d,_0x54cbfa,_0x318e2b,_0x562647,_0x54bd03,_0x509ced){var _0x3bae13={'method':'GET','uri':_0x520677+_0x70d2('0x9b')+_0x562647+_0x70d2('0xb1')+_0x54bd03+_0x70d2('0xbd')+_0x54cbfa+_0x70d2('0xbe'),'headers':{'Authorization':_0x70d2('0x98')+_0x509ced,'If-None-Match':null,'OData-Version':_0x70d2('0x99')},'json':!![]};return rp(_0x3bae13)['then'](function(_0x37f735){var _0xbe2943={'id':_0x5c316d+'_'+_0x37f735[_0x70d2('0x9f')],'name':_0x37f735[_0x70d2('0xbc')]['UserLocalizedLabel']?_0x37f735[_0x70d2('0xbc')][_0x70d2('0xb9')]['Label']:_0x37f735[_0x70d2('0x9f')],'custom':![],'options':[]};_0x318e2b[_0x70d2('0xa4')](_0xbe2943);return _0x318e2b;});} \ No newline at end of file +var _0x4fc2=['actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statuscode','ticketnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','findOne','password','remoteUri','clientSecret','modernAuthentication','CloudProvider','data5','access_token','data7','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','all','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','UserLocalizedLabel','Label','Value','DisplayName','TrueOption','false',')/Microsoft.Dynamics.CRM.','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','status','end','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','type','includeAll','findAll','rows','show','params','keys','include','options','find','create','body','catch','getConfigurations','Dynamics365Configuration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','accountidname','accountidyominame'];(function(_0x27b127,_0x4dd728){var _0x16f9ed=function(_0x5cfb99){while(--_0x5cfb99){_0x27b127['push'](_0x27b127['shift']());}};_0x16f9ed(++_0x4dd728);}(_0x4fc2,0x111));var _0x24fc=function(_0x4ec64d,_0x248423){_0x4ec64d=_0x4ec64d-0x0;var _0x246fc8=_0x4fc2[_0x4ec64d];return _0x246fc8;};'use strict';var rp=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var _=require(_0x24fc('0x2'));var qs=require(_0x24fc('0x3'));var logger=require('../../config/logger')(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var integrations=require(_0x24fc('0x6'));function respondWithResult(_0x541ad2,_0x126d90){_0x126d90=_0x126d90||0xc8;return function(_0x3772eb){if(_0x3772eb){return _0x541ad2['status'](_0x126d90)[_0x24fc('0x7')](_0x3772eb);}};}function respondWithFilteredResult(_0x12d602,_0x4889f4){return function(_0x115851){if(_0x115851){var _0x22a0c8=typeof _0x4889f4[_0x24fc('0x8')]===_0x24fc('0x9')&&typeof _0x4889f4[_0x24fc('0xa')]===_0x24fc('0x9');var _0x5afdf1=_0x115851[_0x24fc('0xb')];var _0x1819a5=_0x22a0c8?0x0:_0x4889f4[_0x24fc('0x8')];var _0x133438=_0x22a0c8?_0x115851[_0x24fc('0xb')]:_0x4889f4[_0x24fc('0x8')]+_0x4889f4[_0x24fc('0xa')];var _0x9a1673;if(_0x133438>=_0x5afdf1){_0x133438=_0x5afdf1;_0x9a1673=0xc8;}else{_0x9a1673=0xce;}_0x12d602['status'](_0x9a1673);return _0x12d602[_0x24fc('0xc')](_0x24fc('0xd'),_0x1819a5+'-'+_0x133438+'/'+_0x5afdf1)['json'](_0x115851);}return null;};}function saveUpdates(_0x306873){return function(_0x76cb25){if(_0x76cb25){return _0x76cb25[_0x24fc('0xe')](_0x306873)[_0x24fc('0xf')](function(_0x30f19b){return _0x30f19b;});}return null;};}function removeEntity(_0x326276){return function(_0x537b5c){if(_0x537b5c){return _0x537b5c[_0x24fc('0x10')]()[_0x24fc('0xf')](function(){_0x326276[_0x24fc('0x11')](0xcc)[_0x24fc('0x12')]();});}};}function handleEntityNotFound(_0x4acd36){return function(_0x2ac989){if(!_0x2ac989){_0x4acd36['sendStatus'](0x194);}return _0x2ac989;};}function handleError(_0x4af098,_0x3385c7){_0x3385c7=_0x3385c7||0x1f4;return function(_0x218fb6){logger[_0x24fc('0x13')](_0x218fb6[_0x24fc('0x14')]);if(_0x218fb6['name']){delete _0x218fb6[_0x24fc('0x15')];}_0x4af098[_0x24fc('0x11')](_0x3385c7)[_0x24fc('0x16')](_0x218fb6);};}exports[_0x24fc('0x17')]=function(_0x4c5a43,_0x5eabee){var _0x4073e0={},_0x304881={},_0x5b0516={'count':0x0,'rows':[]};var _0x32a57d=_[_0x24fc('0x18')](db[_0x24fc('0x19')][_0x24fc('0x1a')],function(_0x49a0ba){return{'name':_0x49a0ba[_0x24fc('0x1b')],'type':_0x49a0ba['type'][_0x24fc('0x1c')]};});_0x304881['model']=_[_0x24fc('0x18')](_0x32a57d,_0x24fc('0x15'));_0x304881[_0x24fc('0x1d')]=_['keys'](_0x4c5a43[_0x24fc('0x1d')]);_0x304881['filters']=_[_0x24fc('0x1e')](_0x304881[_0x24fc('0x1f')],_0x304881[_0x24fc('0x1d')]);_0x4073e0[_0x24fc('0x20')]=_[_0x24fc('0x1e')](_0x304881[_0x24fc('0x1f')],qs[_0x24fc('0x21')](_0x4c5a43[_0x24fc('0x1d')][_0x24fc('0x21')]));_0x4073e0[_0x24fc('0x20')]=_0x4073e0['attributes'][_0x24fc('0x22')]?_0x4073e0[_0x24fc('0x20')]:_0x304881[_0x24fc('0x1f')];if(!_0x4c5a43['query'][_0x24fc('0x23')](_0x24fc('0x24'))){_0x4073e0[_0x24fc('0xa')]=qs[_0x24fc('0xa')](_0x4c5a43[_0x24fc('0x1d')][_0x24fc('0xa')]);_0x4073e0['offset']=qs[_0x24fc('0x8')](_0x4c5a43[_0x24fc('0x1d')][_0x24fc('0x8')]);}_0x4073e0[_0x24fc('0x25')]=qs[_0x24fc('0x26')](_0x4c5a43['query']['sort']);_0x4073e0['where']=qs[_0x24fc('0x27')](_['pick'](_0x4c5a43[_0x24fc('0x1d')],_0x304881[_0x24fc('0x27')]),_0x32a57d);if(_0x4c5a43[_0x24fc('0x1d')][_0x24fc('0x28')]){_0x4073e0['where']=_[_0x24fc('0x29')](_0x4073e0[_0x24fc('0x2a')],{'$or':_['map'](_0x32a57d,function(_0xf46cd5){if(_0xf46cd5[_0x24fc('0x2b')]!=='VIRTUAL'){var _0x48c62a={};_0x48c62a[_0xf46cd5[_0x24fc('0x15')]]={'$like':'%'+_0x4c5a43['query'][_0x24fc('0x28')]+'%'};return _0x48c62a;}})});}_0x4073e0=_[_0x24fc('0x29')]({},_0x4073e0,_0x4c5a43['options']);var _0x2ae896={'where':_0x4073e0[_0x24fc('0x2a')]};return db[_0x24fc('0x19')][_0x24fc('0xb')](_0x2ae896)[_0x24fc('0xf')](function(_0x1e205d){_0x5b0516[_0x24fc('0xb')]=_0x1e205d;if(_0x4c5a43[_0x24fc('0x1d')][_0x24fc('0x2c')]){_0x4073e0['include']=[{'all':!![]}];}return db[_0x24fc('0x19')][_0x24fc('0x2d')](_0x4073e0);})[_0x24fc('0xf')](function(_0x316aa2){_0x5b0516[_0x24fc('0x2e')]=_0x316aa2;return _0x5b0516;})['then'](respondWithFilteredResult(_0x5eabee,_0x4073e0))['catch'](handleError(_0x5eabee,null));};exports[_0x24fc('0x2f')]=function(_0x5d48fe,_0x22ef18){var _0x38798d={'raw':![],'where':{'id':_0x5d48fe[_0x24fc('0x30')]['id']}},_0x10399f={};_0x10399f['model']=_[_0x24fc('0x31')](db['Dynamics365Account'][_0x24fc('0x1a')]);_0x10399f[_0x24fc('0x1d')]=_[_0x24fc('0x31')](_0x5d48fe[_0x24fc('0x1d')]);_0x10399f[_0x24fc('0x27')]=_['intersection'](_0x10399f[_0x24fc('0x1f')],_0x10399f[_0x24fc('0x1d')]);_0x38798d[_0x24fc('0x20')]=_[_0x24fc('0x1e')](_0x10399f['model'],qs[_0x24fc('0x21')](_0x5d48fe[_0x24fc('0x1d')]['fields']));_0x38798d[_0x24fc('0x20')]=_0x38798d['attributes'][_0x24fc('0x22')]?_0x38798d[_0x24fc('0x20')]:_0x10399f[_0x24fc('0x1f')];if(_0x5d48fe[_0x24fc('0x1d')][_0x24fc('0x2c')]){_0x38798d[_0x24fc('0x32')]=[{'all':!![]}];}_0x38798d=_[_0x24fc('0x29')]({},_0x38798d,_0x5d48fe[_0x24fc('0x33')]);return db['Dynamics365Account'][_0x24fc('0x34')](_0x38798d)[_0x24fc('0xf')](handleEntityNotFound(_0x22ef18,null))[_0x24fc('0xf')](respondWithResult(_0x22ef18,null))['catch'](handleError(_0x22ef18,null));};exports[_0x24fc('0x35')]=function(_0x1e3b52,_0x4ae4a7){return db[_0x24fc('0x19')][_0x24fc('0x35')](_0x1e3b52[_0x24fc('0x36')],{})['then'](respondWithResult(_0x4ae4a7,0xc9))[_0x24fc('0x37')](handleError(_0x4ae4a7,null));};exports[_0x24fc('0xe')]=function(_0x585e48,_0x35ccef){if(_0x585e48[_0x24fc('0x36')]['id']){delete _0x585e48[_0x24fc('0x36')]['id'];}return db[_0x24fc('0x19')]['find']({'where':{'id':_0x585e48[_0x24fc('0x30')]['id']}})[_0x24fc('0xf')](handleEntityNotFound(_0x35ccef,null))[_0x24fc('0xf')](saveUpdates(_0x585e48[_0x24fc('0x36')],null))[_0x24fc('0xf')](respondWithResult(_0x35ccef,null))['catch'](handleError(_0x35ccef,null));};exports[_0x24fc('0x10')]=function(_0x1b9c90,_0x17f683){return db[_0x24fc('0x19')]['find']({'where':{'id':_0x1b9c90[_0x24fc('0x30')]['id']}})[_0x24fc('0xf')](handleEntityNotFound(_0x17f683,null))['then'](removeEntity(_0x17f683,null))['catch'](handleError(_0x17f683,null));};exports[_0x24fc('0x38')]=function(_0x5ddde2,_0x5e2979){var _0x3380b2={};var _0x5879c2={};var _0x281194;var _0x264854;return db[_0x24fc('0x19')]['findOne']({'where':{'id':_0x5ddde2[_0x24fc('0x30')]['id']}})[_0x24fc('0xf')](handleEntityNotFound(_0x5e2979,null))[_0x24fc('0xf')](function(_0x1ad8d6){if(_0x1ad8d6){_0x281194=_0x1ad8d6;_0x5879c2[_0x24fc('0x1f')]=_[_0x24fc('0x31')](db[_0x24fc('0x39')][_0x24fc('0x1a')]);_0x5879c2['query']=_['keys'](_0x5ddde2[_0x24fc('0x1d')]);_0x5879c2[_0x24fc('0x27')]=_[_0x24fc('0x1e')](_0x5879c2['model'],_0x5879c2['query']);_0x3380b2[_0x24fc('0x20')]=_[_0x24fc('0x1e')](_0x5879c2[_0x24fc('0x1f')],qs[_0x24fc('0x21')](_0x5ddde2[_0x24fc('0x1d')][_0x24fc('0x21')]));_0x3380b2[_0x24fc('0x20')]=_0x3380b2[_0x24fc('0x20')][_0x24fc('0x22')]?_0x3380b2[_0x24fc('0x20')]:_0x5879c2[_0x24fc('0x1f')];_0x3380b2[_0x24fc('0x25')]=qs['sort'](_0x5ddde2[_0x24fc('0x1d')][_0x24fc('0x26')]);_0x3380b2[_0x24fc('0x2a')]=qs[_0x24fc('0x27')](_[_0x24fc('0x3a')](_0x5ddde2['query'],_0x5879c2[_0x24fc('0x27')]));if(_0x5ddde2['query'][_0x24fc('0x28')]){_0x3380b2[_0x24fc('0x2a')]=_[_0x24fc('0x29')](_0x3380b2[_0x24fc('0x2a')],{'$or':_[_0x24fc('0x18')](_0x3380b2[_0x24fc('0x20')],function(_0x4c9216){var _0xb1fb56={};_0xb1fb56[_0x4c9216]={'$like':'%'+_0x5ddde2[_0x24fc('0x1d')][_0x24fc('0x28')]+'%'};return _0xb1fb56;})});}_0x3380b2=_[_0x24fc('0x29')]({},_0x3380b2,_0x5ddde2[_0x24fc('0x33')]);return _0x281194[_0x24fc('0x38')](_0x3380b2);}})['then'](function(_0x36d500){if(_0x36d500){_0x264854=_0x36d500[_0x24fc('0x22')];if(!_0x5ddde2[_0x24fc('0x1d')][_0x24fc('0x23')](_0x24fc('0x24'))){_0x3380b2[_0x24fc('0xa')]=qs[_0x24fc('0xa')](_0x5ddde2['query'][_0x24fc('0xa')]);_0x3380b2[_0x24fc('0x8')]=qs['offset'](_0x5ddde2[_0x24fc('0x1d')][_0x24fc('0x8')]);}return _0x281194[_0x24fc('0x38')](_0x3380b2);}})[_0x24fc('0xf')](function(_0x36e159){if(_0x36e159){return _0x36e159?{'count':_0x264854,'rows':_0x36e159}:null;}})[_0x24fc('0xf')](respondWithResult(_0x5e2979,null))['catch'](handleError(_0x5e2979,null));};exports[_0x24fc('0x3b')]=function(_0x4a0524,_0x3e9644){if(_0x4a0524[_0x24fc('0x36')]['id']){delete _0x4a0524['body']['id'];}return db[_0x24fc('0x19')]['findOne']({'where':{'id':_0x4a0524[_0x24fc('0x30')]['id']}})['then'](handleEntityNotFound(_0x3e9644,null))[_0x24fc('0xf')](function(_0x27b612){if(_0x27b612){_0x4a0524['body'][_0x24fc('0x3c')]=_0x27b612['id'];_0x4a0524['body'][_0x24fc('0x3d')]=integrations[_0x24fc('0x3e')](_0x4a0524['body'][_0x24fc('0x3f')],_0x4a0524[_0x24fc('0x36')][_0x24fc('0x2b')]);_0x4a0524[_0x24fc('0x36')][_0x24fc('0x40')]=integrations['getDescriptions'](_0x4a0524[_0x24fc('0x36')][_0x24fc('0x3f')],_0x4a0524[_0x24fc('0x36')][_0x24fc('0x2b')]);return db[_0x24fc('0x39')]['create'](_0x4a0524['body'],{'include':[{'model':db[_0x24fc('0x41')],'as':_0x24fc('0x3d')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x24fc('0xf')](respondWithResult(_0x3e9644,null))[_0x24fc('0x37')](handleError(_0x3e9644,null));};function sanitizeRemoteUri(_0x28ef6a){var _0x1c47cd=_0x28ef6a['slice'](-0x1);if(_0x1c47cd==='/')return _0x28ef6a[_0x24fc('0x42')](0x0,_0x28ef6a[_0x24fc('0x43')](_0x1c47cd));return _0x28ef6a;}function getWebApiUrl(_0x14427b){return util[_0x24fc('0x44')](_0x24fc('0x45'),_0x14427b);}exports[_0x24fc('0x46')]=function(_0x26ac2e,_0xa80507){var _0xbe136e=_0x26ac2e[_0x24fc('0x1d')][_0x24fc('0x47')];var _0x456690=_0xbe136e===_0x24fc('0x48')?_0x24fc('0x49'):_0x24fc('0x4a');var _0x54ead5='';var _0xd53778='';var _0x3cff00='';var _0x46af2a='';var _0x223ca7='';var _0x3354f5='';var _0x2eb6dc='';var _0x10d148='';var _0x4659f9=['title',_0x24fc('0x4b'),_0x24fc('0x4c'),_0x24fc('0x4d'),_0x24fc('0x4e'),'subject',_0x24fc('0x4f'),_0x24fc('0x50'),'directioncode','phonecall_activity_parties'];var _0x4f97b7=[_0x24fc('0x51'),_0x24fc('0x52'),_0x24fc('0x53'),_0x24fc('0x54'),_0x24fc('0x55'),_0x24fc('0x56'),'contractdetailidname',_0x24fc('0x57'),_0x24fc('0x58'),'createdbyexternalpartyyominame','createdbyname',_0x24fc('0x59'),_0x24fc('0x5a'),_0x24fc('0x5b'),'createdonbehalfbyyominame',_0x24fc('0x5c'),_0x24fc('0x5d'),_0x24fc('0x5e'),'emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon',_0x24fc('0x5f'),_0x24fc('0x60'),_0x24fc('0x61'),_0x24fc('0x62'),'influencescore',_0x24fc('0x63'),'lastonholdtime',_0x24fc('0x64'),'modifiedbyexternalpartyname',_0x24fc('0x65'),_0x24fc('0x66'),_0x24fc('0x67'),_0x24fc('0x68'),_0x24fc('0x69'),_0x24fc('0x6a'),_0x24fc('0x6b'),'msdyn_iotalertname',_0x24fc('0x6c'),_0x24fc('0x6d'),_0x24fc('0x6e'),'owneridname','owneridtype',_0x24fc('0x6f'),_0x24fc('0x70'),'primarycontactidname',_0x24fc('0x71'),_0x24fc('0x72'),'productidname',_0x24fc('0x73'),_0x24fc('0x74'),'resolvebykpiidname',_0x24fc('0x75'),_0x24fc('0x76'),_0x24fc('0x77'),_0x24fc('0x78'),_0x24fc('0x79'),_0x24fc('0x7a'),'socialprofileidname','statecode',_0x24fc('0x7b'),'subjectidname',_0x24fc('0x7c'),'timezoneruleversionnumber','transactioncurrencyidname',_0x24fc('0x7d'),_0x24fc('0x7e'),_0x24fc('0x7f')];var _0x22235d=_0x4659f9[_0x24fc('0x80')](_0x4f97b7);return db[_0x24fc('0x19')][_0x24fc('0x81')]({'where':{'id':_0x26ac2e[_0x24fc('0x30')]['id']},'attributes':['id','username',_0x24fc('0x82'),_0x24fc('0x83'),'tenantId','clientId',_0x24fc('0x84'),_0x24fc('0x85')],'include':[{'model':db[_0x24fc('0x86')],'as':_0x24fc('0x86'),'attributes':['id',_0x24fc('0x87'),'data7']}]})[_0x24fc('0xf')](handleEntityNotFound(_0xa80507,null))[_0x24fc('0xf')](function(_0x5ca35b){if(_0x5ca35b){if(_0x5ca35b[_0x24fc('0x85')]){_0x5ca35b[_0x24fc('0x88')]=_0x5ca35b[_0x24fc('0x86')]['data5'];_0x10d148=sanitizeRemoteUri(_0x5ca35b[_0x24fc('0x86')][_0x24fc('0x89')]);_0x2eb6dc=getWebApiUrl(_0x10d148);return _0x5ca35b;}_0x10d148=sanitizeRemoteUri(_0x5ca35b[_0x24fc('0x83')]);_0x2eb6dc=getWebApiUrl(_0x10d148);var _0x2c573b={'method':_0x24fc('0x8a'),'uri':_0x24fc('0x8b')+_0x5ca35b[_0x24fc('0x8c')]+_0x24fc('0x8d'),'form':{'client_id':_0x5ca35b[_0x24fc('0x8e')],'resource':_0x10d148,'username':_0x5ca35b['username'],'password':_0x5ca35b[_0x24fc('0x82')],'grant_type':_0x24fc('0x82'),'client_secret':_0x5ca35b[_0x24fc('0x84')]},'json':!![]};return rp(_0x2c573b);}})['then'](function(_0x5dbdb8){_0x3354f5=_0x5dbdb8['access_token'];var _0x1c6e01={'method':'GET','uri':encodeURI(_0x2eb6dc+_0x24fc('0x8f')+_0x456690+'\x27'),'headers':{'Authorization':_0x24fc('0x90')+_0x3354f5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1c6e01);})[_0x24fc('0xf')](function(_0x559692){var _0x41cef7=_0x559692['value'][0x0];var _0x24e912=_0x41cef7[_0x24fc('0x91')];var _0x1ef6f3={'method':_0x24fc('0x92'),'uri':_0x2eb6dc+_0x24fc('0x93')+_0x24e912+_0x24fc('0x94'),'headers':{'Authorization':'Bearer\x20'+_0x3354f5,'If-None-Match':null,'OData-Version':_0x24fc('0x95')},'json':!![]};return rp(_0x1ef6f3);})[_0x24fc('0xf')](function(_0xfc3b92){_0x54ead5=_0xfc3b92;_0xd53778=_0x54ead5[_0x24fc('0x96')];_0xd53778=_[_0x24fc('0x97')](_0xd53778,function(_0x328d4d){return!_0x22235d[_0x24fc('0x98')](_0x328d4d[_0x24fc('0x99')]);});var _0x1b3db1=[];var _0x5f4ec2=[];_0xd53778[_0x24fc('0x9a')](function(_0x211295){if(_0x211295[_0x24fc('0x9b')]){var _0x30ed50=_0x211295['@odata.type'][_0x24fc('0x42')](_0x211295[_0x24fc('0x9b')][_0x24fc('0x43')]('.')+0x1);if(_0x30ed50==='PicklistAttributeMetadata'){_0x1b3db1[_0x24fc('0x9c')](getSelectList(_0x2eb6dc,_0xbe136e,_0x5f4ec2,_0x54ead5['MetadataId'],_0x211295['MetadataId'],_0x3354f5));}}});return Promise['all'](_0x1b3db1);})[_0x24fc('0xf')](function(_0x49c35c){_0x3cff00=_0x49c35c[0x0];var _0x29f1c1=[];var _0x1236ab=[];_0xd53778[_0x24fc('0x9a')](function(_0x10abf7){if(!_['isNil'](_0x10abf7[_0x24fc('0x9b')])){var _0x315ce4=_0x10abf7[_0x24fc('0x9b')][_0x24fc('0x42')](_0x10abf7[_0x24fc('0x9b')]['lastIndexOf']('.')+0x1);if(_0x315ce4===_0x24fc('0x9d')){_0x29f1c1[_0x24fc('0x9c')](getBooleanList(_0x2eb6dc,_0xbe136e,_0x1236ab,_0x54ead5[_0x24fc('0x91')],_0x10abf7[_0x24fc('0x91')],_0x3354f5));}}});return Promise['all'](_0x29f1c1);})['then'](function(_0x2bf22b){_0x46af2a=_0x2bf22b[0x0];var _0x4216da=[];var _0x24e27e=[];_0xd53778[_0x24fc('0x9a')](function(_0x1f263c){if(_0x1f263c['@odata.type']){var _0x44e610=_0x1f263c[_0x24fc('0x9b')][_0x24fc('0x42')](_0x1f263c['@odata.type'][_0x24fc('0x43')]('.')+0x1);if(_0x44e610===_0x24fc('0x9e')||_0x44e610===_0x24fc('0x9f')||_0x44e610===_0x24fc('0xa0')||_0x44e610===_0x24fc('0xa1')||_0x44e610==='MemoAttributeMetadata'||_0x44e610==='DateTimeAttributeMetadata'||_0x44e610==='StatusAttributeMetadata'||_0x44e610===_0x24fc('0xa2')||_0x44e610===_0x24fc('0xa3')||_0x44e610===_0x24fc('0xa4')){_0x4216da[_0x24fc('0x9c')](getInputList(_0x2eb6dc,_0xbe136e,_0x44e610,_0x24e27e,_0x54ead5[_0x24fc('0x91')],_0x1f263c[_0x24fc('0x91')],_0x3354f5));}}});return Promise[_0x24fc('0xa5')](_0x4216da);})[_0x24fc('0xf')](function(_0x382a1c){_0x223ca7=_0x382a1c[0x0];var _0xfe780b=_0x3cff00[_0x24fc('0x80')](_0x46af2a)[_0x24fc('0x80')](_0x223ca7);var _0x5d01ab={'count':_0xfe780b['length'],'rows':_0xfe780b};return _0x5d01ab;})[_0x24fc('0xf')](respondWithResult(_0xa80507,null))['catch'](function(_0x46be68){var _0x13a54e=_0x26ac2e[_0x24fc('0x1d')][_0x24fc('0xa6')]?0x1f4:_0x46be68[_0x24fc('0xa7')]||0x1f4;logger[_0x24fc('0x13')](_0x46be68[_0x24fc('0x14')]);delete _0x46be68[_0x24fc('0x15')];if(_0x13a54e===0x191){_0x13a54e=0x190;}_0xa80507[_0x24fc('0x11')](_0x13a54e)['send'](_0x26ac2e[_0x24fc('0x1d')][_0x24fc('0xa6')]?{'message':'Wrong\x20credentials','statusCode':_0x46be68['statusCode']}:_0x46be68);});};function getSelectList(_0xbad618,_0x62aab6,_0x5407a9,_0x45e87a,_0x9cecee,_0x6d6162){var _0x5331c9={'method':_0x24fc('0x92'),'uri':_0xbad618+_0x24fc('0x93')+_0x45e87a+_0x24fc('0xa8')+_0x9cecee+_0x24fc('0xa9')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x24fc('0x90')+_0x6d6162,'If-None-Match':null,'OData-Version':_0x24fc('0x95')},'json':!![]};return rp(_0x5331c9)[_0x24fc('0xf')](function(_0x57b679){var _0xa8768e=[];var _0x238e55=_0x57b679[_0x24fc('0xaa')]['Options'];_0x238e55[_0x24fc('0x9a')](function(_0x123ffd){_0xa8768e['push']({'name':_0x123ffd['Label'][_0x24fc('0xab')][_0x24fc('0xac')],'value':String(_0x123ffd[_0x24fc('0xad')])});});var _0x2029cd={'id':_0x62aab6+'_'+_0x57b679[_0x24fc('0x99')],'name':_0x57b679[_0x24fc('0xae')]['UserLocalizedLabel'][_0x24fc('0xac')],'custom':![],'options':_0xa8768e};_0x5407a9[_0x24fc('0x9c')](_0x2029cd);return _0x5407a9;});}function getBooleanList(_0x17a6a9,_0xdfa562,_0x6f8974,_0x39994e,_0x478e0c,_0x4018d3){var _0x4a2522={'method':'GET','uri':_0x17a6a9+_0x24fc('0x93')+_0x39994e+_0x24fc('0xa8')+_0x478e0c+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x24fc('0x90')+_0x4018d3,'If-None-Match':null,'OData-Version':_0x24fc('0x95')},'json':!![]};return rp(_0x4a2522)[_0x24fc('0xf')](function(_0x41d9c7){var _0x5d35ad=[];_0x5d35ad[_0x24fc('0x9c')]({'name':_0x41d9c7[_0x24fc('0xaa')][_0x24fc('0xaf')][_0x24fc('0xac')][_0x24fc('0xab')][_0x24fc('0xac')],'value':'true'},{'name':_0x41d9c7['OptionSet']['FalseOption'][_0x24fc('0xac')][_0x24fc('0xab')]['Label'],'value':_0x24fc('0xb0')});var _0x259d4f={'id':_0xdfa562+'_'+_0x41d9c7[_0x24fc('0x99')],'name':_0x41d9c7['DisplayName'][_0x24fc('0xab')][_0x24fc('0xac')],'custom':![],'options':_0x5d35ad};_0x6f8974['push'](_0x259d4f);return _0x6f8974;});}function getInputList(_0x57f986,_0x33c581,_0x613c11,_0x2cb370,_0x480c24,_0x2e4e38,_0x4bb9cd){var _0x525f0b={'method':_0x24fc('0x92'),'uri':_0x57f986+'EntityDefinitions('+_0x480c24+')/Attributes('+_0x2e4e38+_0x24fc('0xb1')+_0x613c11+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x24fc('0x90')+_0x4bb9cd,'If-None-Match':null,'OData-Version':_0x24fc('0x95')},'json':!![]};return rp(_0x525f0b)[_0x24fc('0xf')](function(_0x11eaeb){var _0x4ae346={'id':_0x33c581+'_'+_0x11eaeb[_0x24fc('0x99')],'name':_0x11eaeb[_0x24fc('0xae')]['UserLocalizedLabel']?_0x11eaeb[_0x24fc('0xae')][_0x24fc('0xab')][_0x24fc('0xac')]:_0x11eaeb[_0x24fc('0x99')],'custom':![],'options':[]};_0x2cb370[_0x24fc('0x9c')](_0x4ae346);return _0x2cb370;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index c4b8cc0..5351359 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 _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0xe74201,_0x29a624){var _0x13cefd=function(_0x1f8c39){while(--_0x1f8c39){_0xe74201['push'](_0xe74201['shift']());}};_0x13cefd(++_0x29a624);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','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(_0xaee1a5,_0x2b59e7){var _0x26a39d=function(_0x30159f){while(--_0x30159f){_0xaee1a5['push'](_0xaee1a5['shift']());}};_0x26a39d(++_0x2b59e7);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./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 f48736a..e30f03b 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 _0x4ab5=['debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','options','attributes','include','model','map','ShowDynamics365Account','find','raw','where','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s'];(function(_0x53aca7,_0x3e4af9){var _0x4a8592=function(_0x1f2f5a){while(--_0x1f2f5a){_0x53aca7['push'](_0x53aca7['shift']());}};_0x4a8592(++_0x3e4af9);}(_0x4ab5,0x1a0));var _0x54ab=function(_0x1551ed,_0x5cc3ce){_0x1551ed=_0x1551ed-0x0;var _0x499928=_0x4ab5[_0x1551ed];return _0x499928;};'use strict';var _=require(_0x54ab('0x0'));var util=require(_0x54ab('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x54ab('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54ab('0x3'))['db'];var utils=require(_0x54ab('0x4'));var logger=require(_0x54ab('0x5'))(_0x54ab('0x6'));var config=require('../../config/environment');var jayson=require(_0x54ab('0x7'));var client=jayson[_0x54ab('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad8b7,_0xf6bc08,_0x4b4285){return new BPromise(function(_0x72300e,_0x2d3ec8){return client[_0x54ab('0x9')](_0x1ad8b7,_0x4b4285)[_0x54ab('0xa')](function(_0xdeb4eb){logger[_0x54ab('0xb')](_0x54ab('0xc'),_0xf6bc08,'request\x20sent');logger[_0x54ab('0xd')](_0x54ab('0xe'),_0xf6bc08,_0x54ab('0xf'),JSON[_0x54ab('0x10')](_0xdeb4eb));if(_0xdeb4eb[_0x54ab('0x11')]){if(_0xdeb4eb[_0x54ab('0x11')][_0x54ab('0x12')]===0x1f4){logger[_0x54ab('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0xf6bc08,_0xdeb4eb[_0x54ab('0x11')][_0x54ab('0x13')]);return _0x2d3ec8(_0xdeb4eb[_0x54ab('0x11')][_0x54ab('0x13')]);}logger[_0x54ab('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0xf6bc08,_0xdeb4eb[_0x54ab('0x11')][_0x54ab('0x13')]);return _0x72300e(_0xdeb4eb['error']['message']);}else{logger[_0x54ab('0xb')](_0x54ab('0xc'),_0xf6bc08,'request\x20sent');_0x72300e(_0xdeb4eb[_0x54ab('0x14')]['message']);}})[_0x54ab('0x15')](function(_0x48717c){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0xf6bc08,_0x48717c);_0x2d3ec8(_0x48717c);});});}exports[_0x54ab('0x16')]=function(_0x5a21ae){var _0x403092=this;return new Promise(function(_0x39bb92,_0x493b28){return db[_0x54ab('0x17')]['findAll']({'raw':_0x5a21ae[_0x54ab('0x18')]?_0x5a21ae[_0x54ab('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5a21ae[_0x54ab('0x18')]?_0x5a21ae[_0x54ab('0x18')]['where']||null:null,'attributes':_0x5a21ae[_0x54ab('0x18')]?_0x5a21ae['options'][_0x54ab('0x19')]||null:null,'limit':_0x5a21ae['options']?_0x5a21ae[_0x54ab('0x18')]['limit']||null:null,'include':_0x5a21ae[_0x54ab('0x18')]?_0x5a21ae['options'][_0x54ab('0x1a')]?_['map'](_0x5a21ae[_0x54ab('0x18')][_0x54ab('0x1a')],function(_0x33a738){return{'model':db[_0x33a738[_0x54ab('0x1b')]],'as':_0x33a738['as'],'attributes':_0x33a738['attributes'],'include':_0x33a738[_0x54ab('0x1a')]?_[_0x54ab('0x1c')](_0x33a738[_0x54ab('0x1a')],function(_0x3f3960){return{'model':db[_0x3f3960[_0x54ab('0x1b')]],'as':_0x3f3960['as'],'attributes':_0x3f3960['attributes'],'include':_0x3f3960[_0x54ab('0x1a')]?_[_0x54ab('0x1c')](_0x3f3960[_0x54ab('0x1a')],function(_0x2229e7){return{'model':db[_0x2229e7[_0x54ab('0x1b')]],'as':_0x2229e7['as'],'attributes':_0x2229e7[_0x54ab('0x19')]};}):[]};}):[]};}):[]:[]})[_0x54ab('0xa')](function(_0x263650){logger[_0x54ab('0xb')]('GetDynamics365Account',_0x5a21ae);logger[_0x54ab('0xd')](_0x54ab('0x16'),_0x5a21ae,JSON['stringify'](_0x263650));_0x39bb92(_0x263650);})[_0x54ab('0x15')](function(_0x59d8dc){logger[_0x54ab('0x11')](_0x54ab('0x16'),_0x59d8dc['message'],_0x5a21ae);_0x493b28(_0x403092[_0x54ab('0x11')](0x1f4,_0x59d8dc['message']));});});};exports[_0x54ab('0x1d')]=function(_0x284f30){var _0x3c75ce=this;return new Promise(function(_0x5b8ee3,_0x1fa0f4){return db['Dynamics365Account'][_0x54ab('0x1e')]({'raw':_0x284f30['options']?_0x284f30[_0x54ab('0x18')][_0x54ab('0x1f')]===undefined?!![]:![]:!![],'where':_0x284f30[_0x54ab('0x18')]?_0x284f30[_0x54ab('0x18')][_0x54ab('0x20')]||null:null,'attributes':_0x284f30[_0x54ab('0x18')]?_0x284f30[_0x54ab('0x18')]['attributes']||null:null,'include':_0x284f30[_0x54ab('0x18')]?_0x284f30[_0x54ab('0x18')]['include']?_[_0x54ab('0x1c')](_0x284f30[_0x54ab('0x18')][_0x54ab('0x1a')],function(_0x5de5ca){return{'model':db[_0x5de5ca[_0x54ab('0x1b')]],'as':_0x5de5ca['as'],'attributes':_0x5de5ca['attributes'],'include':_0x5de5ca[_0x54ab('0x1a')]?_[_0x54ab('0x1c')](_0x5de5ca[_0x54ab('0x1a')],function(_0x38ad48){return{'model':db[_0x38ad48['model']],'as':_0x38ad48['as'],'attributes':_0x38ad48[_0x54ab('0x19')],'include':_0x38ad48[_0x54ab('0x1a')]?_[_0x54ab('0x1c')](_0x38ad48[_0x54ab('0x1a')],function(_0x4733f2){return{'model':db[_0x4733f2[_0x54ab('0x1b')]],'as':_0x4733f2['as'],'attributes':_0x4733f2[_0x54ab('0x19')]};}):[]};}):[]};}):[]:[]})[_0x54ab('0xa')](function(_0x48c38c){logger['info'](_0x54ab('0x1d'),_0x284f30);logger[_0x54ab('0xd')](_0x54ab('0x1d'),_0x284f30,JSON[_0x54ab('0x10')](_0x48c38c));_0x5b8ee3(_0x48c38c);})['catch'](function(_0x431a78){logger[_0x54ab('0x11')](_0x54ab('0x1d'),_0x431a78[_0x54ab('0x13')],_0x284f30);_0x1fa0f4(_0x3c75ce[_0x54ab('0x11')](0x1f4,_0x431a78[_0x54ab('0x13')]));});});}; \ No newline at end of file +var _0xf5ab=['jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','error','code','message','result','Dynamics365Account','options','raw','where','attributes','include','map','model','debug','GetDynamics365Account','stringify','find','ShowDynamics365Account','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x54e5e9,_0x269f98){var _0x38f8f9=function(_0x400bf2){while(--_0x400bf2){_0x54e5e9['push'](_0x54e5e9['shift']());}};_0x38f8f9(++_0x269f98);}(_0xf5ab,0x100));var _0xbf5a=function(_0xcabaa2,_0x2607f1){_0xcabaa2=_0xcabaa2-0x0;var _0x35f97c=_0xf5ab[_0xcabaa2];return _0x35f97c;};'use strict';var _=require(_0xbf5a('0x0'));var util=require(_0xbf5a('0x1'));var moment=require(_0xbf5a('0x2'));var BPromise=require(_0xbf5a('0x3'));var rs=require(_0xbf5a('0x4'));var fs=require('fs');var Redis=require(_0xbf5a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf5a('0x6'))(_0xbf5a('0x7'));var config=require('../../config/environment');var jayson=require(_0xbf5a('0x8'));var client=jayson[_0xbf5a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a8dd6,_0x3a044d,_0x37edf6){return new BPromise(function(_0x4a8904,_0x1fb38a){return client[_0xbf5a('0xa')](_0x1a8dd6,_0x37edf6)[_0xbf5a('0xb')](function(_0x65c83e){logger[_0xbf5a('0xc')](_0xbf5a('0xd'),_0x3a044d,_0xbf5a('0xe'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x3a044d,_0xbf5a('0xe'),JSON['stringify'](_0x65c83e));if(_0x65c83e[_0xbf5a('0xf')]){if(_0x65c83e[_0xbf5a('0xf')][_0xbf5a('0x10')]===0x1f4){logger['error'](_0xbf5a('0xd'),_0x3a044d,_0x65c83e[_0xbf5a('0xf')]['message']);return _0x1fb38a(_0x65c83e[_0xbf5a('0xf')]['message']);}logger[_0xbf5a('0xf')](_0xbf5a('0xd'),_0x3a044d,_0x65c83e[_0xbf5a('0xf')][_0xbf5a('0x11')]);return _0x4a8904(_0x65c83e[_0xbf5a('0xf')][_0xbf5a('0x11')]);}else{logger[_0xbf5a('0xc')](_0xbf5a('0xd'),_0x3a044d,_0xbf5a('0xe'));_0x4a8904(_0x65c83e[_0xbf5a('0x12')]['message']);}})['catch'](function(_0x103cf3){logger[_0xbf5a('0xf')](_0xbf5a('0xd'),_0x3a044d,_0x103cf3);_0x1fb38a(_0x103cf3);});});}exports['GetDynamics365Account']=function(_0x52f69c){var _0x46d41a=this;return new Promise(function(_0x5f56b4,_0x4a5668){return db[_0xbf5a('0x13')]['findAll']({'raw':_0x52f69c[_0xbf5a('0x14')]?_0x52f69c[_0xbf5a('0x14')][_0xbf5a('0x15')]===undefined?!![]:![]:!![],'where':_0x52f69c[_0xbf5a('0x14')]?_0x52f69c[_0xbf5a('0x14')][_0xbf5a('0x16')]||null:null,'attributes':_0x52f69c[_0xbf5a('0x14')]?_0x52f69c[_0xbf5a('0x14')][_0xbf5a('0x17')]||null:null,'limit':_0x52f69c[_0xbf5a('0x14')]?_0x52f69c[_0xbf5a('0x14')]['limit']||null:null,'include':_0x52f69c[_0xbf5a('0x14')]?_0x52f69c[_0xbf5a('0x14')][_0xbf5a('0x18')]?_[_0xbf5a('0x19')](_0x52f69c[_0xbf5a('0x14')][_0xbf5a('0x18')],function(_0x23e7d4){return{'model':db[_0x23e7d4[_0xbf5a('0x1a')]],'as':_0x23e7d4['as'],'attributes':_0x23e7d4[_0xbf5a('0x17')],'include':_0x23e7d4[_0xbf5a('0x18')]?_[_0xbf5a('0x19')](_0x23e7d4[_0xbf5a('0x18')],function(_0x5970d0){return{'model':db[_0x5970d0[_0xbf5a('0x1a')]],'as':_0x5970d0['as'],'attributes':_0x5970d0[_0xbf5a('0x17')],'include':_0x5970d0[_0xbf5a('0x18')]?_[_0xbf5a('0x19')](_0x5970d0[_0xbf5a('0x18')],function(_0x3c6479){return{'model':db[_0x3c6479[_0xbf5a('0x1a')]],'as':_0x3c6479['as'],'attributes':_0x3c6479[_0xbf5a('0x17')]};}):[]};}):[]};}):[]:[]})[_0xbf5a('0xb')](function(_0x1d6a73){logger[_0xbf5a('0xc')]('GetDynamics365Account',_0x52f69c);logger[_0xbf5a('0x1b')](_0xbf5a('0x1c'),_0x52f69c,JSON[_0xbf5a('0x1d')](_0x1d6a73));_0x5f56b4(_0x1d6a73);})['catch'](function(_0x15a177){logger[_0xbf5a('0xf')](_0xbf5a('0x1c'),_0x15a177[_0xbf5a('0x11')],_0x52f69c);_0x4a5668(_0x46d41a[_0xbf5a('0xf')](0x1f4,_0x15a177[_0xbf5a('0x11')]));});});};exports['ShowDynamics365Account']=function(_0x1cf167){var _0x1e1edb=this;return new Promise(function(_0x4631f7,_0x15deea){return db[_0xbf5a('0x13')][_0xbf5a('0x1e')]({'raw':_0x1cf167[_0xbf5a('0x14')]?_0x1cf167[_0xbf5a('0x14')][_0xbf5a('0x15')]===undefined?!![]:![]:!![],'where':_0x1cf167[_0xbf5a('0x14')]?_0x1cf167[_0xbf5a('0x14')][_0xbf5a('0x16')]||null:null,'attributes':_0x1cf167[_0xbf5a('0x14')]?_0x1cf167['options'][_0xbf5a('0x17')]||null:null,'include':_0x1cf167[_0xbf5a('0x14')]?_0x1cf167[_0xbf5a('0x14')][_0xbf5a('0x18')]?_[_0xbf5a('0x19')](_0x1cf167[_0xbf5a('0x14')][_0xbf5a('0x18')],function(_0x264cc6){return{'model':db[_0x264cc6[_0xbf5a('0x1a')]],'as':_0x264cc6['as'],'attributes':_0x264cc6[_0xbf5a('0x17')],'include':_0x264cc6[_0xbf5a('0x18')]?_['map'](_0x264cc6[_0xbf5a('0x18')],function(_0x3bce60){return{'model':db[_0x3bce60[_0xbf5a('0x1a')]],'as':_0x3bce60['as'],'attributes':_0x3bce60[_0xbf5a('0x17')],'include':_0x3bce60[_0xbf5a('0x18')]?_[_0xbf5a('0x19')](_0x3bce60[_0xbf5a('0x18')],function(_0x34ab90){return{'model':db[_0x34ab90[_0xbf5a('0x1a')]],'as':_0x34ab90['as'],'attributes':_0x34ab90['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf5a('0xb')](function(_0x45f1fb){logger['info'](_0xbf5a('0x1f'),_0x1cf167);logger[_0xbf5a('0x1b')](_0xbf5a('0x1f'),_0x1cf167,JSON[_0xbf5a('0x1d')](_0x45f1fb));_0x4631f7(_0x45f1fb);})[_0xbf5a('0x20')](function(_0x3b3838){logger[_0xbf5a('0xf')](_0xbf5a('0x1f'),_0x3b3838[_0xbf5a('0x11')],_0x1cf167);_0x15deea(_0x1e1edb[_0xbf5a('0xf')](0x1f4,_0x3b3838[_0xbf5a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 641c4c3..460e7e9 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 _0x8c7d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','getFields','/:id/subjects','getDescriptions','post','put','update','delete','multer','path','express'];(function(_0x20ebb5,_0x237d88){var _0x487182=function(_0xaa5491){while(--_0xaa5491){_0x20ebb5['push'](_0x20ebb5['shift']());}};_0x487182(++_0x237d88);}(_0x8c7d,0xe1));var _0xd8c7=function(_0x23f598,_0x711504){_0x23f598=_0x23f598-0x0;var _0x2b2b5b=_0x8c7d[_0x23f598];return _0x2b2b5b;};'use strict';var multer=require(_0xd8c7('0x0'));var util=require('util');var path=require(_0xd8c7('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8c7('0x2'));var router=express[_0xd8c7('0x3')]();var fs_extra=require(_0xd8c7('0x4'));var auth=require(_0xd8c7('0x5'));var interaction=require(_0xd8c7('0x6'));var config=require(_0xd8c7('0x7'));var controller=require(_0xd8c7('0x8'));router[_0xd8c7('0x9')]('/',auth[_0xd8c7('0xa')](),controller['index']);router['get'](_0xd8c7('0xb'),auth[_0xd8c7('0xa')](),controller['show']);router[_0xd8c7('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xd8c7('0xc')]);router[_0xd8c7('0x9')](_0xd8c7('0xd'),auth[_0xd8c7('0xa')](),controller['getSubjects']);router[_0xd8c7('0x9')]('/:id/descriptions',auth[_0xd8c7('0xa')](),controller[_0xd8c7('0xe')]);router[_0xd8c7('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd8c7('0x10')](_0xd8c7('0xb'),auth[_0xd8c7('0xa')](),controller[_0xd8c7('0x11')]);router[_0xd8c7('0x12')]('/:id',auth[_0xd8c7('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe306=['express','Router','fs-extra','isAuthenticated','index','/:id','show','get','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x1e8fd2,_0x2ab84b){var _0x389a37=function(_0x21fb8c){while(--_0x21fb8c){_0x1e8fd2['push'](_0x1e8fd2['shift']());}};_0x389a37(++_0x2ab84b);}(_0xe306,0xad));var _0x6e30=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0xe306[_0x1d6a82];return _0x5834ac;};'use strict';var multer=require(_0x6e30('0x0'));var util=require(_0x6e30('0x1'));var path=require('path');var timeout=require(_0x6e30('0x2'));var express=require(_0x6e30('0x3'));var router=express[_0x6e30('0x4')]();var fs_extra=require(_0x6e30('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0x6e30('0x6')](),controller[_0x6e30('0x7')]);router['get'](_0x6e30('0x8'),auth['isAuthenticated'](),controller[_0x6e30('0x9')]);router[_0x6e30('0xa')](_0x6e30('0xb'),auth[_0x6e30('0x6')](),controller['getFields']);router[_0x6e30('0xa')](_0x6e30('0xc'),auth['isAuthenticated'](),controller[_0x6e30('0xd')]);router[_0x6e30('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x6e30('0xe')]);router[_0x6e30('0xf')]('/',auth[_0x6e30('0x6')](),controller[_0x6e30('0x10')]);router[_0x6e30('0x11')](_0x6e30('0x8'),auth[_0x6e30('0x6')](),controller[_0x6e30('0x12')]);router[_0x6e30('0x13')]('/:id',auth[_0x6e30('0x6')](),controller[_0x6e30('0x14')]);module[_0x6e30('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 81be072..956b3d8 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 _0xa388=['phonecall','contact','sequelize','exports','STRING','ENUM'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0xa388,0x104));var _0x8a38=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa388[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8a38('0x0'));module[_0x8a38('0x1')]={'name':{'type':Sequelize[_0x8a38('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x8a38('0x3')]('incident',_0x8a38('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x8a38('0x3')](_0x8a38('0x5'),'nothing'),'defaultValue':_0x8a38('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x6c39=['exports','STRING','incident','phonecall','ENUM','contact','nothing','sequelize'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0x6c39,0x12f));var _0x96c3=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x6c39[_0x220f3f];return _0x1f170e;};'use strict';var Sequelize=require(_0x96c3('0x0'));module[_0x96c3('0x1')]={'name':{'type':Sequelize[_0x96c3('0x2')]},'description':{'type':Sequelize[_0x96c3('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x96c3('0x3'),_0x96c3('0x4')),'defaultValue':_0x96c3('0x3')},'moduleCreate':{'type':Sequelize[_0x96c3('0x5')](_0x96c3('0x6'),_0x96c3('0x7')),'defaultValue':_0x96c3('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 8536abb..9428a63 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 _0xff07=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','offset','count','Content-Range','json','apply','save','update','then','end','error','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','length','include','merge','find','create','catch','body','destroy','getFields','findOne','Dynamics365Field','pick','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0xff07,0x96));var _0x7ff0=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0xff07[_0x154192];return _0x3c2792;};'use strict';var emlformat=require(_0x7ff0('0x0'));var rimraf=require(_0x7ff0('0x1'));var zipdir=require(_0x7ff0('0x2'));var jsonpatch=require(_0x7ff0('0x3'));var rp=require('request-promise');var moment=require(_0x7ff0('0x4'));var BPromise=require(_0x7ff0('0x5'));var Mustache=require(_0x7ff0('0x6'));var util=require(_0x7ff0('0x7'));var path=require(_0x7ff0('0x8'));var sox=require(_0x7ff0('0x9'));var csv=require(_0x7ff0('0xa'));var ejs=require(_0x7ff0('0xb'));var fs=require('fs');var fs_extra=require(_0x7ff0('0xc'));var _=require(_0x7ff0('0xd'));var squel=require(_0x7ff0('0xe'));var crypto=require(_0x7ff0('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7ff0('0x10'));var toCsv=require(_0x7ff0('0xa'));var querystring=require(_0x7ff0('0x11'));var Papa=require(_0x7ff0('0x12'));var Redis=require(_0x7ff0('0x13'));var authService=require(_0x7ff0('0x14'));var qs=require(_0x7ff0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ff0('0x16'));var logger=require(_0x7ff0('0x17'))(_0x7ff0('0x18'));var utils=require(_0x7ff0('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x7ff0('0x1a'));var db=require(_0x7ff0('0x1b'))['db'];function respondWithStatusCode(_0x56395d,_0x35cacc){_0x35cacc=_0x35cacc||0xcc;return function(_0x304590){if(_0x304590){return _0x56395d[_0x7ff0('0x1c')](_0x35cacc);}return _0x56395d[_0x7ff0('0x1d')](_0x35cacc)['end']();};}function respondWithResult(_0x40b1af,_0x1ff004){_0x1ff004=_0x1ff004||0xc8;return function(_0x53a782){if(_0x53a782){return _0x40b1af[_0x7ff0('0x1d')](_0x1ff004)['json'](_0x53a782);}};}function respondWithFilteredResult(_0x9ab59a,_0xeb0856){return function(_0x378393){if(_0x378393){var _0x267bb2=typeof _0xeb0856['offset']==='undefined'&&typeof _0xeb0856[_0x7ff0('0x1e')]===_0x7ff0('0x1f');var _0x437037=_0x378393['count'];var _0x23f05e=_0x267bb2?0x0:_0xeb0856[_0x7ff0('0x20')];var _0x1aa82b=_0x267bb2?_0x378393[_0x7ff0('0x21')]:_0xeb0856[_0x7ff0('0x20')]+_0xeb0856[_0x7ff0('0x1e')];var _0x4d503d;if(_0x1aa82b>=_0x437037){_0x1aa82b=_0x437037;_0x4d503d=0xc8;}else{_0x4d503d=0xce;}_0x9ab59a['status'](_0x4d503d);return _0x9ab59a['set'](_0x7ff0('0x22'),_0x23f05e+'-'+_0x1aa82b+'/'+_0x437037)[_0x7ff0('0x23')](_0x378393);}return null;};}function patchUpdates(_0x281197){return function(_0x330b28){try{jsonpatch[_0x7ff0('0x24')](_0x330b28,_0x281197,!![]);}catch(_0x264fb1){return BPromise['reject'](_0x264fb1);}return _0x330b28[_0x7ff0('0x25')]();};}function saveUpdates(_0x57ea01,_0x3134e5){return function(_0x12826c){if(_0x12826c){return _0x12826c[_0x7ff0('0x26')](_0x57ea01)['then'](function(_0x293032){return _0x293032;});}return null;};}function removeEntity(_0x2dbe18,_0x137962){return function(_0x46c696){if(_0x46c696){return _0x46c696['destroy']()[_0x7ff0('0x27')](function(){_0x2dbe18[_0x7ff0('0x1d')](0xcc)[_0x7ff0('0x28')]();});}};}function handleEntityNotFound(_0x503df3,_0x10fcd4){return function(_0x532203){if(!_0x532203){_0x503df3[_0x7ff0('0x1c')](0x194);}return _0x532203;};}function handleError(_0x5d1511,_0x1a9705){_0x1a9705=_0x1a9705||0x1f4;return function(_0x1ccf23){logger[_0x7ff0('0x29')](_0x1ccf23[_0x7ff0('0x2a')]);if(_0x1ccf23[_0x7ff0('0x2b')]){delete _0x1ccf23[_0x7ff0('0x2b')];}_0x5d1511[_0x7ff0('0x1d')](_0x1a9705)[_0x7ff0('0x2c')](_0x1ccf23);};}exports[_0x7ff0('0x2d')]=function(_0x50b226,_0x4e5eb8){var _0x472ad5={},_0x25b9cd={},_0x56e3a3={'count':0x0,'rows':[]};var _0x1f21eb=_['map'](db[_0x7ff0('0x2e')][_0x7ff0('0x2f')],function(_0x2982e8){return{'name':_0x2982e8[_0x7ff0('0x30')],'type':_0x2982e8[_0x7ff0('0x31')][_0x7ff0('0x32')]};});_0x25b9cd[_0x7ff0('0x33')]=_[_0x7ff0('0x34')](_0x1f21eb,_0x7ff0('0x2b'));_0x25b9cd['query']=_[_0x7ff0('0x35')](_0x50b226[_0x7ff0('0x36')]);_0x25b9cd[_0x7ff0('0x37')]=_[_0x7ff0('0x38')](_0x25b9cd[_0x7ff0('0x33')],_0x25b9cd[_0x7ff0('0x36')]);_0x472ad5[_0x7ff0('0x39')]=_['intersection'](_0x25b9cd[_0x7ff0('0x33')],qs[_0x7ff0('0x3a')](_0x50b226[_0x7ff0('0x36')][_0x7ff0('0x3a')]));_0x472ad5[_0x7ff0('0x39')]=_0x472ad5[_0x7ff0('0x39')]['length']?_0x472ad5[_0x7ff0('0x39')]:_0x25b9cd[_0x7ff0('0x33')];if(!_0x50b226['query']['hasOwnProperty'](_0x7ff0('0x3b'))){_0x472ad5[_0x7ff0('0x1e')]=qs[_0x7ff0('0x1e')](_0x50b226[_0x7ff0('0x36')][_0x7ff0('0x1e')]);_0x472ad5['offset']=qs['offset'](_0x50b226['query'][_0x7ff0('0x20')]);}_0x472ad5[_0x7ff0('0x3c')]=qs[_0x7ff0('0x3d')](_0x50b226[_0x7ff0('0x36')][_0x7ff0('0x3d')]);_0x472ad5[_0x7ff0('0x3e')]=qs[_0x7ff0('0x37')](_['pick'](_0x50b226[_0x7ff0('0x36')],_0x25b9cd[_0x7ff0('0x37')]),_0x1f21eb);if(_0x50b226[_0x7ff0('0x36')]['filter']){_0x472ad5[_0x7ff0('0x3e')]=_['merge'](_0x472ad5[_0x7ff0('0x3e')],{'$or':_[_0x7ff0('0x34')](_0x1f21eb,function(_0x117f40){if(_0x117f40['type']!==_0x7ff0('0x3f')){var _0x3b04ee={};_0x3b04ee[_0x117f40[_0x7ff0('0x2b')]]={'$like':'%'+_0x50b226[_0x7ff0('0x36')][_0x7ff0('0x40')]+'%'};return _0x3b04ee;}})});}_0x472ad5=_['merge']({},_0x472ad5,_0x50b226[_0x7ff0('0x41')]);var _0x581d2a={'where':_0x472ad5[_0x7ff0('0x3e')]};return db[_0x7ff0('0x2e')][_0x7ff0('0x21')](_0x581d2a)['then'](function(_0x17e921){_0x56e3a3[_0x7ff0('0x21')]=_0x17e921;if(_0x50b226[_0x7ff0('0x36')][_0x7ff0('0x42')]){_0x472ad5['include']=[{'all':!![]}];}return db[_0x7ff0('0x2e')][_0x7ff0('0x43')](_0x472ad5);})['then'](function(_0x405e41){_0x56e3a3[_0x7ff0('0x44')]=_0x405e41;return _0x56e3a3;})['then'](respondWithFilteredResult(_0x4e5eb8,_0x472ad5))['catch'](handleError(_0x4e5eb8,null));};exports[_0x7ff0('0x45')]=function(_0x19b64b,_0x3e095a){var _0x9d4f18={'raw':![],'where':{'id':_0x19b64b[_0x7ff0('0x46')]['id']}},_0xd59ff1={};_0xd59ff1['model']=_[_0x7ff0('0x35')](db['Dynamics365Configuration'][_0x7ff0('0x2f')]);_0xd59ff1[_0x7ff0('0x36')]=_[_0x7ff0('0x35')](_0x19b64b['query']);_0xd59ff1[_0x7ff0('0x37')]=_[_0x7ff0('0x38')](_0xd59ff1[_0x7ff0('0x33')],_0xd59ff1[_0x7ff0('0x36')]);_0x9d4f18[_0x7ff0('0x39')]=_[_0x7ff0('0x38')](_0xd59ff1['model'],qs[_0x7ff0('0x3a')](_0x19b64b['query'][_0x7ff0('0x3a')]));_0x9d4f18[_0x7ff0('0x39')]=_0x9d4f18[_0x7ff0('0x39')][_0x7ff0('0x47')]?_0x9d4f18[_0x7ff0('0x39')]:_0xd59ff1[_0x7ff0('0x33')];if(_0x19b64b[_0x7ff0('0x36')][_0x7ff0('0x42')]){_0x9d4f18[_0x7ff0('0x48')]=[{'all':!![]}];}_0x9d4f18=_[_0x7ff0('0x49')]({},_0x9d4f18,_0x19b64b[_0x7ff0('0x41')]);return db[_0x7ff0('0x2e')][_0x7ff0('0x4a')](_0x9d4f18)[_0x7ff0('0x27')](handleEntityNotFound(_0x3e095a,null))['then'](respondWithResult(_0x3e095a,null))['catch'](handleError(_0x3e095a,null));};exports[_0x7ff0('0x4b')]=function(_0x3c9967,_0x348fd4){return db[_0x7ff0('0x2e')][_0x7ff0('0x4b')](_0x3c9967['body'],{})['then'](respondWithResult(_0x348fd4,0xc9))[_0x7ff0('0x4c')](handleError(_0x348fd4,null));};exports[_0x7ff0('0x26')]=function(_0x3b6eab,_0x5c5b45){if(_0x3b6eab['body']['id']){delete _0x3b6eab['body']['id'];}return db[_0x7ff0('0x2e')]['find']({'where':{'id':_0x3b6eab['params']['id']}})[_0x7ff0('0x27')](handleEntityNotFound(_0x5c5b45,null))[_0x7ff0('0x27')](saveUpdates(_0x3b6eab[_0x7ff0('0x4d')],null))[_0x7ff0('0x27')](respondWithResult(_0x5c5b45,null))[_0x7ff0('0x4c')](handleError(_0x5c5b45,null));};exports[_0x7ff0('0x4e')]=function(_0x3b3fda,_0x3b4dc2){return db[_0x7ff0('0x2e')][_0x7ff0('0x4a')]({'where':{'id':_0x3b3fda[_0x7ff0('0x46')]['id']}})[_0x7ff0('0x27')](handleEntityNotFound(_0x3b4dc2,null))['then'](removeEntity(_0x3b4dc2,null))[_0x7ff0('0x4c')](handleError(_0x3b4dc2,null));};exports[_0x7ff0('0x4f')]=function(_0x583783,_0x5e9342,_0x43b7ec){var _0x51aeb6={};var _0x3da849={};var _0x5a15e8;var _0x2b993f;return db['Dynamics365Configuration'][_0x7ff0('0x50')]({'where':{'id':_0x583783[_0x7ff0('0x46')]['id']}})[_0x7ff0('0x27')](handleEntityNotFound(_0x5e9342,null))['then'](function(_0x1c2a06){if(_0x1c2a06){_0x5a15e8=_0x1c2a06;_0x3da849['model']=_[_0x7ff0('0x35')](db[_0x7ff0('0x51')][_0x7ff0('0x2f')]);_0x3da849[_0x7ff0('0x36')]=_[_0x7ff0('0x35')](_0x583783[_0x7ff0('0x36')]);_0x3da849[_0x7ff0('0x37')]=_['intersection'](_0x3da849[_0x7ff0('0x33')],_0x3da849[_0x7ff0('0x36')]);_0x51aeb6[_0x7ff0('0x39')]=_['intersection'](_0x3da849[_0x7ff0('0x33')],qs[_0x7ff0('0x3a')](_0x583783[_0x7ff0('0x36')][_0x7ff0('0x3a')]));_0x51aeb6['attributes']=_0x51aeb6[_0x7ff0('0x39')][_0x7ff0('0x47')]?_0x51aeb6[_0x7ff0('0x39')]:_0x3da849[_0x7ff0('0x33')];_0x51aeb6[_0x7ff0('0x3c')]=qs['sort'](_0x583783[_0x7ff0('0x36')][_0x7ff0('0x3d')]);_0x51aeb6[_0x7ff0('0x3e')]=qs[_0x7ff0('0x37')](_[_0x7ff0('0x52')](_0x583783[_0x7ff0('0x36')],_0x3da849['filters']));if(_0x583783[_0x7ff0('0x36')][_0x7ff0('0x40')]){_0x51aeb6[_0x7ff0('0x3e')]=_[_0x7ff0('0x49')](_0x51aeb6[_0x7ff0('0x3e')],{'$or':_[_0x7ff0('0x34')](_0x51aeb6[_0x7ff0('0x39')],function(_0x51e9c6){var _0x14516f={};_0x14516f[_0x51e9c6]={'$like':'%'+_0x583783[_0x7ff0('0x36')][_0x7ff0('0x40')]+'%'};return _0x14516f;})});}_0x51aeb6=_['merge']({},_0x51aeb6,_0x583783[_0x7ff0('0x41')]);return _0x5a15e8[_0x7ff0('0x4f')](_0x51aeb6);}})[_0x7ff0('0x27')](function(_0x5f8cba){if(_0x5f8cba){_0x2b993f=_0x5f8cba['length'];if(!_0x583783[_0x7ff0('0x36')][_0x7ff0('0x53')](_0x7ff0('0x3b'))){_0x51aeb6[_0x7ff0('0x1e')]=qs['limit'](_0x583783[_0x7ff0('0x36')][_0x7ff0('0x1e')]);_0x51aeb6[_0x7ff0('0x20')]=qs[_0x7ff0('0x20')](_0x583783[_0x7ff0('0x36')][_0x7ff0('0x20')]);}return _0x5a15e8[_0x7ff0('0x4f')](_0x51aeb6);}})[_0x7ff0('0x27')](function(_0x24ea2d){if(_0x24ea2d){return _0x24ea2d?{'count':_0x2b993f,'rows':_0x24ea2d}:null;}})['then'](respondWithResult(_0x5e9342,null))[_0x7ff0('0x4c')](handleError(_0x5e9342,null));};exports[_0x7ff0('0x54')]=function(_0x113327,_0xd68385,_0xfcc275){var _0x3429a4={};var _0xa1a0a8={};var _0x5b0cb7;var _0x38b271;return db[_0x7ff0('0x2e')][_0x7ff0('0x50')]({'where':{'id':_0x113327[_0x7ff0('0x46')]['id']}})[_0x7ff0('0x27')](handleEntityNotFound(_0xd68385,null))[_0x7ff0('0x27')](function(_0x38c438){if(_0x38c438){_0x5b0cb7=_0x38c438;_0xa1a0a8['model']=_[_0x7ff0('0x35')](db[_0x7ff0('0x51')][_0x7ff0('0x2f')]);_0xa1a0a8[_0x7ff0('0x36')]=_['keys'](_0x113327[_0x7ff0('0x36')]);_0xa1a0a8[_0x7ff0('0x37')]=_[_0x7ff0('0x38')](_0xa1a0a8[_0x7ff0('0x33')],_0xa1a0a8[_0x7ff0('0x36')]);_0x3429a4['attributes']=_[_0x7ff0('0x38')](_0xa1a0a8[_0x7ff0('0x33')],qs[_0x7ff0('0x3a')](_0x113327[_0x7ff0('0x36')][_0x7ff0('0x3a')]));_0x3429a4[_0x7ff0('0x39')]=_0x3429a4[_0x7ff0('0x39')][_0x7ff0('0x47')]?_0x3429a4[_0x7ff0('0x39')]:_0xa1a0a8[_0x7ff0('0x33')];_0x3429a4['order']=qs[_0x7ff0('0x3d')](_0x113327['query']['sort']);_0x3429a4[_0x7ff0('0x3e')]=qs['filters'](_[_0x7ff0('0x52')](_0x113327[_0x7ff0('0x36')],_0xa1a0a8[_0x7ff0('0x37')]));if(_0x113327[_0x7ff0('0x36')][_0x7ff0('0x40')]){_0x3429a4[_0x7ff0('0x3e')]=_[_0x7ff0('0x49')](_0x3429a4[_0x7ff0('0x3e')],{'$or':_['map'](_0x3429a4[_0x7ff0('0x39')],function(_0x2da0e4){var _0x45689d={};_0x45689d[_0x2da0e4]={'$like':'%'+_0x113327[_0x7ff0('0x36')][_0x7ff0('0x40')]+'%'};return _0x45689d;})});}_0x3429a4=_[_0x7ff0('0x49')]({},_0x3429a4,_0x113327['options']);return _0x5b0cb7[_0x7ff0('0x54')](_0x3429a4);}})['then'](function(_0x3a9d43){if(_0x3a9d43){_0x38b271=_0x3a9d43[_0x7ff0('0x47')];if(!_0x113327[_0x7ff0('0x36')]['hasOwnProperty'](_0x7ff0('0x3b'))){_0x3429a4[_0x7ff0('0x1e')]=qs['limit'](_0x113327[_0x7ff0('0x36')]['limit']);_0x3429a4[_0x7ff0('0x20')]=qs[_0x7ff0('0x20')](_0x113327[_0x7ff0('0x36')][_0x7ff0('0x20')]);}return _0x5b0cb7[_0x7ff0('0x54')](_0x3429a4);}})[_0x7ff0('0x27')](function(_0x42a69f){if(_0x42a69f){return _0x42a69f?{'count':_0x38b271,'rows':_0x42a69f}:null;}})[_0x7ff0('0x27')](respondWithResult(_0xd68385,null))['catch'](handleError(_0xd68385,null));};exports[_0x7ff0('0x55')]=function(_0x30803e,_0x36cddd,_0x4e6196){var _0x5206df={};var _0xaa3e7e={};var _0x107b2d;var _0x22f317;return db['Dynamics365Configuration'][_0x7ff0('0x50')]({'where':{'id':_0x30803e[_0x7ff0('0x46')]['id']}})['then'](handleEntityNotFound(_0x36cddd,null))[_0x7ff0('0x27')](function(_0x5baa68){if(_0x5baa68){_0x107b2d=_0x5baa68;_0xaa3e7e[_0x7ff0('0x33')]=_[_0x7ff0('0x35')](db[_0x7ff0('0x51')][_0x7ff0('0x2f')]);_0xaa3e7e[_0x7ff0('0x36')]=_[_0x7ff0('0x35')](_0x30803e[_0x7ff0('0x36')]);_0xaa3e7e[_0x7ff0('0x37')]=_[_0x7ff0('0x38')](_0xaa3e7e['model'],_0xaa3e7e[_0x7ff0('0x36')]);_0x5206df[_0x7ff0('0x39')]=_['intersection'](_0xaa3e7e[_0x7ff0('0x33')],qs[_0x7ff0('0x3a')](_0x30803e[_0x7ff0('0x36')]['fields']));_0x5206df[_0x7ff0('0x39')]=_0x5206df[_0x7ff0('0x39')][_0x7ff0('0x47')]?_0x5206df[_0x7ff0('0x39')]:_0xaa3e7e[_0x7ff0('0x33')];_0x5206df[_0x7ff0('0x3c')]=qs[_0x7ff0('0x3d')](_0x30803e['query'][_0x7ff0('0x3d')]);_0x5206df[_0x7ff0('0x3e')]=qs[_0x7ff0('0x37')](_[_0x7ff0('0x52')](_0x30803e[_0x7ff0('0x36')],_0xaa3e7e[_0x7ff0('0x37')]));if(_0x30803e[_0x7ff0('0x36')]['filter']){_0x5206df['where']=_['merge'](_0x5206df[_0x7ff0('0x3e')],{'$or':_['map'](_0x5206df[_0x7ff0('0x39')],function(_0xe6f38d){var _0x1fbef6={};_0x1fbef6[_0xe6f38d]={'$like':'%'+_0x30803e[_0x7ff0('0x36')][_0x7ff0('0x40')]+'%'};return _0x1fbef6;})});}_0x5206df=_[_0x7ff0('0x49')]({},_0x5206df,_0x30803e[_0x7ff0('0x41')]);return _0x107b2d['getDescriptions'](_0x5206df);}})[_0x7ff0('0x27')](function(_0x4d9eee){if(_0x4d9eee){_0x22f317=_0x4d9eee[_0x7ff0('0x47')];if(!_0x30803e[_0x7ff0('0x36')][_0x7ff0('0x53')](_0x7ff0('0x3b'))){_0x5206df['limit']=qs[_0x7ff0('0x1e')](_0x30803e[_0x7ff0('0x36')]['limit']);_0x5206df['offset']=qs[_0x7ff0('0x20')](_0x30803e[_0x7ff0('0x36')]['offset']);}return _0x107b2d[_0x7ff0('0x55')](_0x5206df);}})[_0x7ff0('0x27')](function(_0x46d948){if(_0x46d948){return _0x46d948?{'count':_0x22f317,'rows':_0x46d948}:null;}})[_0x7ff0('0x27')](respondWithResult(_0x36cddd,null))['catch'](handleError(_0x36cddd,null));}; \ No newline at end of file +var _0xc652=['Dynamics365Configuration','includeAll','include','findAll','catch','show','params','length','options','find','create','body','getFields','findOne','Dynamics365Field','pick','nolimit','getSubjects','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','merge','VIRTUAL','filter'];(function(_0x275311,_0x502951){var _0xaf85aa=function(_0x1d1be7){while(--_0x1d1be7){_0x275311['push'](_0x275311['shift']());}};_0xaf85aa(++_0x502951);}(_0xc652,0x1ae));var _0x2c65=function(_0x4cefc3,_0x23f291){_0x4cefc3=_0x4cefc3-0x0;var _0x1cc779=_0xc652[_0x4cefc3];return _0x1cc779;};'use strict';var emlformat=require(_0x2c65('0x0'));var rimraf=require(_0x2c65('0x1'));var zipdir=require(_0x2c65('0x2'));var jsonpatch=require(_0x2c65('0x3'));var rp=require(_0x2c65('0x4'));var moment=require('moment');var BPromise=require(_0x2c65('0x5'));var Mustache=require(_0x2c65('0x6'));var util=require(_0x2c65('0x7'));var path=require('path');var sox=require(_0x2c65('0x8'));var csv=require('to-csv');var ejs=require(_0x2c65('0x9'));var fs=require('fs');var fs_extra=require(_0x2c65('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2c65('0xb'));var jsforce=require(_0x2c65('0xc'));var deskjs=require(_0x2c65('0xd'));var toCsv=require(_0x2c65('0xe'));var querystring=require(_0x2c65('0xf'));var Papa=require(_0x2c65('0x10'));var Redis=require(_0x2c65('0x11'));var authService=require(_0x2c65('0x12'));var qs=require(_0x2c65('0x13'));var as=require(_0x2c65('0x14'));var hardwareService=require(_0x2c65('0x15'));var logger=require('../../config/logger')(_0x2c65('0x16'));var utils=require('../../config/utils');var config=require(_0x2c65('0x17'));var licenseUtil=require(_0x2c65('0x18'));var db=require(_0x2c65('0x19'))['db'];function respondWithStatusCode(_0x5f502e,_0x52282e){_0x52282e=_0x52282e||0xcc;return function(_0x52d17d){if(_0x52d17d){return _0x5f502e[_0x2c65('0x1a')](_0x52282e);}return _0x5f502e[_0x2c65('0x1b')](_0x52282e)['end']();};}function respondWithResult(_0xe304b,_0x11e532){_0x11e532=_0x11e532||0xc8;return function(_0x404a61){if(_0x404a61){return _0xe304b[_0x2c65('0x1b')](_0x11e532)[_0x2c65('0x1c')](_0x404a61);}};}function respondWithFilteredResult(_0x629b9d,_0x3a687b){return function(_0xf44257){if(_0xf44257){var _0x4c8ffb=typeof _0x3a687b['offset']===_0x2c65('0x1d')&&typeof _0x3a687b[_0x2c65('0x1e')]===_0x2c65('0x1d');var _0x4077b8=_0xf44257[_0x2c65('0x1f')];var _0x48d255=_0x4c8ffb?0x0:_0x3a687b[_0x2c65('0x20')];var _0x1df4ca=_0x4c8ffb?_0xf44257[_0x2c65('0x1f')]:_0x3a687b[_0x2c65('0x20')]+_0x3a687b['limit'];var _0x30ad66;if(_0x1df4ca>=_0x4077b8){_0x1df4ca=_0x4077b8;_0x30ad66=0xc8;}else{_0x30ad66=0xce;}_0x629b9d[_0x2c65('0x1b')](_0x30ad66);return _0x629b9d[_0x2c65('0x21')](_0x2c65('0x22'),_0x48d255+'-'+_0x1df4ca+'/'+_0x4077b8)[_0x2c65('0x1c')](_0xf44257);}return null;};}function patchUpdates(_0x4bb73a){return function(_0x58d36b){try{jsonpatch['apply'](_0x58d36b,_0x4bb73a,!![]);}catch(_0xa385dd){return BPromise[_0x2c65('0x23')](_0xa385dd);}return _0x58d36b[_0x2c65('0x24')]();};}function saveUpdates(_0x8cd0ca,_0xe63843){return function(_0x299621){if(_0x299621){return _0x299621[_0x2c65('0x25')](_0x8cd0ca)[_0x2c65('0x26')](function(_0x593ece){return _0x593ece;});}return null;};}function removeEntity(_0x437992,_0x2ffd74){return function(_0x1da0c2){if(_0x1da0c2){return _0x1da0c2[_0x2c65('0x27')]()[_0x2c65('0x26')](function(){_0x437992[_0x2c65('0x1b')](0xcc)[_0x2c65('0x28')]();});}};}function handleEntityNotFound(_0x506e63,_0x50e2ef){return function(_0x4752c2){if(!_0x4752c2){_0x506e63[_0x2c65('0x1a')](0x194);}return _0x4752c2;};}function handleError(_0x101457,_0x4269c2){_0x4269c2=_0x4269c2||0x1f4;return function(_0x4d4076){logger[_0x2c65('0x29')](_0x4d4076[_0x2c65('0x2a')]);if(_0x4d4076[_0x2c65('0x2b')]){delete _0x4d4076[_0x2c65('0x2b')];}_0x101457['status'](_0x4269c2)[_0x2c65('0x2c')](_0x4d4076);};}exports[_0x2c65('0x2d')]=function(_0x119609,_0x32c78d){var _0x1cbca0={},_0x37723c={},_0x1215cf={'count':0x0,'rows':[]};var _0x14096f=_[_0x2c65('0x2e')](db['Dynamics365Configuration'][_0x2c65('0x2f')],function(_0x483e41){return{'name':_0x483e41[_0x2c65('0x30')],'type':_0x483e41['type']['key']};});_0x37723c['model']=_[_0x2c65('0x2e')](_0x14096f,'name');_0x37723c[_0x2c65('0x31')]=_[_0x2c65('0x32')](_0x119609['query']);_0x37723c[_0x2c65('0x33')]=_[_0x2c65('0x34')](_0x37723c[_0x2c65('0x35')],_0x37723c[_0x2c65('0x31')]);_0x1cbca0[_0x2c65('0x36')]=_[_0x2c65('0x34')](_0x37723c['model'],qs[_0x2c65('0x37')](_0x119609[_0x2c65('0x31')][_0x2c65('0x37')]));_0x1cbca0[_0x2c65('0x36')]=_0x1cbca0['attributes']['length']?_0x1cbca0['attributes']:_0x37723c[_0x2c65('0x35')];if(!_0x119609[_0x2c65('0x31')][_0x2c65('0x38')]('nolimit')){_0x1cbca0['limit']=qs['limit'](_0x119609['query'][_0x2c65('0x1e')]);_0x1cbca0['offset']=qs['offset'](_0x119609[_0x2c65('0x31')][_0x2c65('0x20')]);}_0x1cbca0['order']=qs[_0x2c65('0x39')](_0x119609[_0x2c65('0x31')][_0x2c65('0x39')]);_0x1cbca0[_0x2c65('0x3a')]=qs['filters'](_['pick'](_0x119609['query'],_0x37723c[_0x2c65('0x33')]),_0x14096f);if(_0x119609[_0x2c65('0x31')]['filter']){_0x1cbca0[_0x2c65('0x3a')]=_[_0x2c65('0x3b')](_0x1cbca0[_0x2c65('0x3a')],{'$or':_[_0x2c65('0x2e')](_0x14096f,function(_0xd5f905){if(_0xd5f905['type']!==_0x2c65('0x3c')){var _0x51250f={};_0x51250f[_0xd5f905['name']]={'$like':'%'+_0x119609['query'][_0x2c65('0x3d')]+'%'};return _0x51250f;}})});}_0x1cbca0=_[_0x2c65('0x3b')]({},_0x1cbca0,_0x119609['options']);var _0x1d6b21={'where':_0x1cbca0[_0x2c65('0x3a')]};return db[_0x2c65('0x3e')][_0x2c65('0x1f')](_0x1d6b21)[_0x2c65('0x26')](function(_0x1ae520){_0x1215cf['count']=_0x1ae520;if(_0x119609[_0x2c65('0x31')][_0x2c65('0x3f')]){_0x1cbca0[_0x2c65('0x40')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x2c65('0x41')](_0x1cbca0);})['then'](function(_0x21441b){_0x1215cf['rows']=_0x21441b;return _0x1215cf;})[_0x2c65('0x26')](respondWithFilteredResult(_0x32c78d,_0x1cbca0))[_0x2c65('0x42')](handleError(_0x32c78d,null));};exports[_0x2c65('0x43')]=function(_0x5066a3,_0x5f2bbb){var _0x3ac6e2={'raw':![],'where':{'id':_0x5066a3[_0x2c65('0x44')]['id']}},_0x4f39c8={};_0x4f39c8[_0x2c65('0x35')]=_[_0x2c65('0x32')](db['Dynamics365Configuration']['rawAttributes']);_0x4f39c8['query']=_[_0x2c65('0x32')](_0x5066a3[_0x2c65('0x31')]);_0x4f39c8[_0x2c65('0x33')]=_[_0x2c65('0x34')](_0x4f39c8[_0x2c65('0x35')],_0x4f39c8['query']);_0x3ac6e2[_0x2c65('0x36')]=_[_0x2c65('0x34')](_0x4f39c8[_0x2c65('0x35')],qs['fields'](_0x5066a3[_0x2c65('0x31')][_0x2c65('0x37')]));_0x3ac6e2[_0x2c65('0x36')]=_0x3ac6e2[_0x2c65('0x36')][_0x2c65('0x45')]?_0x3ac6e2['attributes']:_0x4f39c8['model'];if(_0x5066a3[_0x2c65('0x31')][_0x2c65('0x3f')]){_0x3ac6e2['include']=[{'all':!![]}];}_0x3ac6e2=_[_0x2c65('0x3b')]({},_0x3ac6e2,_0x5066a3[_0x2c65('0x46')]);return db[_0x2c65('0x3e')][_0x2c65('0x47')](_0x3ac6e2)['then'](handleEntityNotFound(_0x5f2bbb,null))[_0x2c65('0x26')](respondWithResult(_0x5f2bbb,null))[_0x2c65('0x42')](handleError(_0x5f2bbb,null));};exports[_0x2c65('0x48')]=function(_0x4023a5,_0x41a4d8){return db[_0x2c65('0x3e')][_0x2c65('0x48')](_0x4023a5[_0x2c65('0x49')],{})[_0x2c65('0x26')](respondWithResult(_0x41a4d8,0xc9))['catch'](handleError(_0x41a4d8,null));};exports[_0x2c65('0x25')]=function(_0x4b5233,_0x7b5e24){if(_0x4b5233[_0x2c65('0x49')]['id']){delete _0x4b5233[_0x2c65('0x49')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x4b5233[_0x2c65('0x44')]['id']}})[_0x2c65('0x26')](handleEntityNotFound(_0x7b5e24,null))[_0x2c65('0x26')](saveUpdates(_0x4b5233['body'],null))['then'](respondWithResult(_0x7b5e24,null))[_0x2c65('0x42')](handleError(_0x7b5e24,null));};exports[_0x2c65('0x27')]=function(_0x575cd4,_0x3fdfec){return db[_0x2c65('0x3e')][_0x2c65('0x47')]({'where':{'id':_0x575cd4[_0x2c65('0x44')]['id']}})[_0x2c65('0x26')](handleEntityNotFound(_0x3fdfec,null))[_0x2c65('0x26')](removeEntity(_0x3fdfec,null))[_0x2c65('0x42')](handleError(_0x3fdfec,null));};exports[_0x2c65('0x4a')]=function(_0x36175c,_0x1ba7ac,_0x1cfaec){var _0xc714ed={};var _0x22c658={};var _0x230ab1;var _0x3a9b6b;return db[_0x2c65('0x3e')][_0x2c65('0x4b')]({'where':{'id':_0x36175c[_0x2c65('0x44')]['id']}})['then'](handleEntityNotFound(_0x1ba7ac,null))[_0x2c65('0x26')](function(_0x3d84c9){if(_0x3d84c9){_0x230ab1=_0x3d84c9;_0x22c658[_0x2c65('0x35')]=_[_0x2c65('0x32')](db[_0x2c65('0x4c')][_0x2c65('0x2f')]);_0x22c658[_0x2c65('0x31')]=_['keys'](_0x36175c['query']);_0x22c658[_0x2c65('0x33')]=_[_0x2c65('0x34')](_0x22c658[_0x2c65('0x35')],_0x22c658[_0x2c65('0x31')]);_0xc714ed[_0x2c65('0x36')]=_[_0x2c65('0x34')](_0x22c658[_0x2c65('0x35')],qs['fields'](_0x36175c['query'][_0x2c65('0x37')]));_0xc714ed['attributes']=_0xc714ed[_0x2c65('0x36')][_0x2c65('0x45')]?_0xc714ed[_0x2c65('0x36')]:_0x22c658['model'];_0xc714ed['order']=qs['sort'](_0x36175c[_0x2c65('0x31')][_0x2c65('0x39')]);_0xc714ed['where']=qs[_0x2c65('0x33')](_[_0x2c65('0x4d')](_0x36175c['query'],_0x22c658['filters']));if(_0x36175c[_0x2c65('0x31')][_0x2c65('0x3d')]){_0xc714ed[_0x2c65('0x3a')]=_[_0x2c65('0x3b')](_0xc714ed['where'],{'$or':_[_0x2c65('0x2e')](_0xc714ed[_0x2c65('0x36')],function(_0x317c51){var _0x3ec2d8={};_0x3ec2d8[_0x317c51]={'$like':'%'+_0x36175c[_0x2c65('0x31')][_0x2c65('0x3d')]+'%'};return _0x3ec2d8;})});}_0xc714ed=_[_0x2c65('0x3b')]({},_0xc714ed,_0x36175c['options']);return _0x230ab1[_0x2c65('0x4a')](_0xc714ed);}})[_0x2c65('0x26')](function(_0x2d4828){if(_0x2d4828){_0x3a9b6b=_0x2d4828['length'];if(!_0x36175c['query'][_0x2c65('0x38')](_0x2c65('0x4e'))){_0xc714ed[_0x2c65('0x1e')]=qs[_0x2c65('0x1e')](_0x36175c['query'][_0x2c65('0x1e')]);_0xc714ed['offset']=qs[_0x2c65('0x20')](_0x36175c[_0x2c65('0x31')][_0x2c65('0x20')]);}return _0x230ab1['getFields'](_0xc714ed);}})[_0x2c65('0x26')](function(_0x2e1cb1){if(_0x2e1cb1){return _0x2e1cb1?{'count':_0x3a9b6b,'rows':_0x2e1cb1}:null;}})['then'](respondWithResult(_0x1ba7ac,null))[_0x2c65('0x42')](handleError(_0x1ba7ac,null));};exports[_0x2c65('0x4f')]=function(_0x387feb,_0x121ce2,_0x55bc84){var _0x1c5351={};var _0x4f30ae={};var _0x1db283;var _0x46870d;return db['Dynamics365Configuration'][_0x2c65('0x4b')]({'where':{'id':_0x387feb[_0x2c65('0x44')]['id']}})[_0x2c65('0x26')](handleEntityNotFound(_0x121ce2,null))['then'](function(_0x1790f8){if(_0x1790f8){_0x1db283=_0x1790f8;_0x4f30ae[_0x2c65('0x35')]=_[_0x2c65('0x32')](db['Dynamics365Field']['rawAttributes']);_0x4f30ae[_0x2c65('0x31')]=_[_0x2c65('0x32')](_0x387feb['query']);_0x4f30ae[_0x2c65('0x33')]=_['intersection'](_0x4f30ae['model'],_0x4f30ae[_0x2c65('0x31')]);_0x1c5351[_0x2c65('0x36')]=_[_0x2c65('0x34')](_0x4f30ae[_0x2c65('0x35')],qs['fields'](_0x387feb[_0x2c65('0x31')][_0x2c65('0x37')]));_0x1c5351[_0x2c65('0x36')]=_0x1c5351['attributes']['length']?_0x1c5351[_0x2c65('0x36')]:_0x4f30ae[_0x2c65('0x35')];_0x1c5351[_0x2c65('0x50')]=qs[_0x2c65('0x39')](_0x387feb[_0x2c65('0x31')][_0x2c65('0x39')]);_0x1c5351[_0x2c65('0x3a')]=qs[_0x2c65('0x33')](_[_0x2c65('0x4d')](_0x387feb[_0x2c65('0x31')],_0x4f30ae[_0x2c65('0x33')]));if(_0x387feb['query'][_0x2c65('0x3d')]){_0x1c5351['where']=_[_0x2c65('0x3b')](_0x1c5351['where'],{'$or':_[_0x2c65('0x2e')](_0x1c5351[_0x2c65('0x36')],function(_0x1db213){var _0xd9dfd={};_0xd9dfd[_0x1db213]={'$like':'%'+_0x387feb['query'][_0x2c65('0x3d')]+'%'};return _0xd9dfd;})});}_0x1c5351=_[_0x2c65('0x3b')]({},_0x1c5351,_0x387feb[_0x2c65('0x46')]);return _0x1db283[_0x2c65('0x4f')](_0x1c5351);}})['then'](function(_0x4107fb){if(_0x4107fb){_0x46870d=_0x4107fb[_0x2c65('0x45')];if(!_0x387feb['query'][_0x2c65('0x38')](_0x2c65('0x4e'))){_0x1c5351[_0x2c65('0x1e')]=qs[_0x2c65('0x1e')](_0x387feb[_0x2c65('0x31')][_0x2c65('0x1e')]);_0x1c5351[_0x2c65('0x20')]=qs[_0x2c65('0x20')](_0x387feb['query']['offset']);}return _0x1db283[_0x2c65('0x4f')](_0x1c5351);}})[_0x2c65('0x26')](function(_0x94043c){if(_0x94043c){return _0x94043c?{'count':_0x46870d,'rows':_0x94043c}:null;}})[_0x2c65('0x26')](respondWithResult(_0x121ce2,null))[_0x2c65('0x42')](handleError(_0x121ce2,null));};exports[_0x2c65('0x51')]=function(_0x3b47c3,_0xb194f9,_0x3cfe6b){var _0xe51ebc={};var _0x3bd8e2={};var _0x4b992c;var _0x2be2dc;return db[_0x2c65('0x3e')][_0x2c65('0x4b')]({'where':{'id':_0x3b47c3['params']['id']}})[_0x2c65('0x26')](handleEntityNotFound(_0xb194f9,null))[_0x2c65('0x26')](function(_0x2b1adf){if(_0x2b1adf){_0x4b992c=_0x2b1adf;_0x3bd8e2[_0x2c65('0x35')]=_['keys'](db[_0x2c65('0x4c')][_0x2c65('0x2f')]);_0x3bd8e2['query']=_['keys'](_0x3b47c3['query']);_0x3bd8e2[_0x2c65('0x33')]=_[_0x2c65('0x34')](_0x3bd8e2[_0x2c65('0x35')],_0x3bd8e2[_0x2c65('0x31')]);_0xe51ebc[_0x2c65('0x36')]=_[_0x2c65('0x34')](_0x3bd8e2[_0x2c65('0x35')],qs[_0x2c65('0x37')](_0x3b47c3[_0x2c65('0x31')]['fields']));_0xe51ebc[_0x2c65('0x36')]=_0xe51ebc[_0x2c65('0x36')][_0x2c65('0x45')]?_0xe51ebc[_0x2c65('0x36')]:_0x3bd8e2['model'];_0xe51ebc[_0x2c65('0x50')]=qs[_0x2c65('0x39')](_0x3b47c3[_0x2c65('0x31')]['sort']);_0xe51ebc[_0x2c65('0x3a')]=qs['filters'](_[_0x2c65('0x4d')](_0x3b47c3['query'],_0x3bd8e2[_0x2c65('0x33')]));if(_0x3b47c3[_0x2c65('0x31')][_0x2c65('0x3d')]){_0xe51ebc[_0x2c65('0x3a')]=_[_0x2c65('0x3b')](_0xe51ebc[_0x2c65('0x3a')],{'$or':_['map'](_0xe51ebc[_0x2c65('0x36')],function(_0x3cceab){var _0x2b4f27={};_0x2b4f27[_0x3cceab]={'$like':'%'+_0x3b47c3['query'][_0x2c65('0x3d')]+'%'};return _0x2b4f27;})});}_0xe51ebc=_[_0x2c65('0x3b')]({},_0xe51ebc,_0x3b47c3['options']);return _0x4b992c[_0x2c65('0x51')](_0xe51ebc);}})[_0x2c65('0x26')](function(_0x543bf0){if(_0x543bf0){_0x2be2dc=_0x543bf0[_0x2c65('0x45')];if(!_0x3b47c3['query'][_0x2c65('0x38')](_0x2c65('0x4e'))){_0xe51ebc[_0x2c65('0x1e')]=qs['limit'](_0x3b47c3[_0x2c65('0x31')][_0x2c65('0x1e')]);_0xe51ebc[_0x2c65('0x20')]=qs[_0x2c65('0x20')](_0x3b47c3[_0x2c65('0x31')][_0x2c65('0x20')]);}return _0x4b992c[_0x2c65('0x51')](_0xe51ebc);}})['then'](function(_0x5b251b){if(_0x5b251b){return _0x5b251b?{'count':_0x2be2dc,'rows':_0x5b251b}:null;}})[_0x2c65('0x26')](respondWithResult(_0xb194f9,null))[_0x2c65('0x42')](handleError(_0xb194f9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 94c06a6..fb0968b 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 _0xf3cd=['path','rimraf','../../config/environment','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xddfa19,_0x37310b){var _0x2396c3=function(_0x2d0b65){while(--_0x2d0b65){_0xddfa19['push'](_0xddfa19['shift']());}};_0x2396c3(++_0x37310b);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0xf3cd[_0x195c21];return _0x3576a8;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb43b=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird','path'];(function(_0x1280bc,_0x5602ee){var _0x4bca23=function(_0x206abe){while(--_0x206abe){_0x1280bc['push'](_0x1280bc['shift']());}};_0x4bca23(++_0x5602ee);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2d6f52,_0x24d93d){_0x2d6f52=_0x2d6f52-0x0;var _0x4a2575=_0xb43b[_0x2d6f52];return _0x4a2575;};'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 ce955e3..b6ad4ca 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 _0xe9ad=['Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xe9ad,0x127));var _0xde9a=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xe9ad[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0xde9a('0x0'));var util=require('util');var moment=require(_0xde9a('0x1'));var BPromise=require('bluebird');var rs=require(_0xde9a('0x2'));var fs=require('fs');var Redis=require(_0xde9a('0x3'));var db=require(_0xde9a('0x4'))['db'];var utils=require(_0xde9a('0x5'));var logger=require(_0xde9a('0x6'))(_0xde9a('0x7'));var config=require(_0xde9a('0x8'));var jayson=require(_0xde9a('0x9'));var client=jayson[_0xde9a('0xa')][_0xde9a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2df731,_0x210db3,_0x21407b){return new BPromise(function(_0xe50023,_0x8c84ad){return client[_0xde9a('0xc')](_0x2df731,_0x21407b)['then'](function(_0xd770c){logger['info'](_0xde9a('0xd'),_0x210db3,'request\x20sent');logger['debug'](_0xde9a('0xe'),_0x210db3,_0xde9a('0xf'),JSON[_0xde9a('0x10')](_0xd770c));if(_0xd770c[_0xde9a('0x11')]){if(_0xd770c[_0xde9a('0x11')][_0xde9a('0x12')]===0x1f4){logger[_0xde9a('0x11')](_0xde9a('0xd'),_0x210db3,_0xd770c[_0xde9a('0x11')][_0xde9a('0x13')]);return _0x8c84ad(_0xd770c[_0xde9a('0x11')][_0xde9a('0x13')]);}logger[_0xde9a('0x11')](_0xde9a('0xd'),_0x210db3,_0xd770c[_0xde9a('0x11')][_0xde9a('0x13')]);return _0xe50023(_0xd770c[_0xde9a('0x11')][_0xde9a('0x13')]);}else{logger[_0xde9a('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x210db3,'request\x20sent');_0xe50023(_0xd770c[_0xde9a('0x15')][_0xde9a('0x13')]);}})['catch'](function(_0x29dbf0){logger[_0xde9a('0x11')](_0xde9a('0xd'),_0x210db3,_0x29dbf0);_0x8c84ad(_0x29dbf0);});});} \ No newline at end of file +var _0x30e8=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x55795a,_0x53d9b5){var _0x26ffa5=function(_0x4a3519){while(--_0x4a3519){_0x55795a['push'](_0x55795a['shift']());}};_0x26ffa5(++_0x53d9b5);}(_0x30e8,0x1d4));var _0x830e=function(_0x406aaa,_0x3e7c24){_0x406aaa=_0x406aaa-0x0;var _0x6cf281=_0x30e8[_0x406aaa];return _0x6cf281;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x830e('0x0'));var BPromise=require(_0x830e('0x1'));var rs=require(_0x830e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x830e('0x3'))['db'];var utils=require(_0x830e('0x4'));var logger=require(_0x830e('0x5'))(_0x830e('0x6'));var config=require('../../config/environment');var jayson=require(_0x830e('0x7'));var client=jayson[_0x830e('0x8')][_0x830e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21cecd,_0x21786a,_0x2745b5){return new BPromise(function(_0x4ca3e5,_0xaf402d){return client[_0x830e('0xa')](_0x21cecd,_0x2745b5)[_0x830e('0xb')](function(_0x168f2c){logger[_0x830e('0xc')](_0x830e('0xd'),_0x21786a,_0x830e('0xe'));logger[_0x830e('0xf')](_0x830e('0x10'),_0x21786a,_0x830e('0xe'),JSON['stringify'](_0x168f2c));if(_0x168f2c[_0x830e('0x11')]){if(_0x168f2c[_0x830e('0x11')][_0x830e('0x12')]===0x1f4){logger[_0x830e('0x11')](_0x830e('0xd'),_0x21786a,_0x168f2c[_0x830e('0x11')][_0x830e('0x13')]);return _0xaf402d(_0x168f2c[_0x830e('0x11')][_0x830e('0x13')]);}logger[_0x830e('0x11')](_0x830e('0xd'),_0x21786a,_0x168f2c[_0x830e('0x11')][_0x830e('0x13')]);return _0x4ca3e5(_0x168f2c['error'][_0x830e('0x13')]);}else{logger['info'](_0x830e('0xd'),_0x21786a,_0x830e('0xe'));_0x4ca3e5(_0x168f2c[_0x830e('0x14')][_0x830e('0x13')]);}})[_0x830e('0x15')](function(_0x364188){logger[_0x830e('0x11')](_0x830e('0xd'),_0x21786a,_0x364188);_0xaf402d(_0x364188);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 8f322b9..266746a 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 _0xe25e=['get','isAuthenticated','index','/:id','show','post','create','put','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x50f6f8,_0x2f3ef8){var _0x224ffd=function(_0x367423){while(--_0x367423){_0x50f6f8['push'](_0x50f6f8['shift']());}};_0x224ffd(++_0x2f3ef8);}(_0xe25e,0x1ab));var _0xee25=function(_0x1e3159,_0x30f1f7){_0x1e3159=_0x1e3159-0x0;var _0x5af07d=_0xe25e[_0x1e3159];return _0x5af07d;};'use strict';var multer=require(_0xee25('0x0'));var util=require('util');var path=require(_0xee25('0x1'));var timeout=require(_0xee25('0x2'));var express=require(_0xee25('0x3'));var router=express[_0xee25('0x4')]();var fs_extra=require(_0xee25('0x5'));var auth=require(_0xee25('0x6'));var interaction=require(_0xee25('0x7'));var config=require(_0xee25('0x8'));var controller=require(_0xee25('0x9'));router[_0xee25('0xa')]('/',auth[_0xee25('0xb')](),controller[_0xee25('0xc')]);router[_0xee25('0xa')](_0xee25('0xd'),auth[_0xee25('0xb')](),controller[_0xee25('0xe')]);router[_0xee25('0xf')]('/',auth[_0xee25('0xb')](),controller[_0xee25('0x10')]);router[_0xee25('0x11')](_0xee25('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xee25('0xd'),auth[_0xee25('0xb')](),controller['destroy']);module[_0xee25('0x12')]=router; \ No newline at end of file +var _0xeead=['update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','get','index','isAuthenticated','show','create','put','/:id'];(function(_0x13bca0,_0x2b097c){var _0x228dab=function(_0x420e5e){while(--_0x420e5e){_0x13bca0['push'](_0x13bca0['shift']());}};_0x228dab(++_0x2b097c);}(_0xeead,0xed));var _0xdeea=function(_0x5dded4,_0x177469){_0x5dded4=_0x5dded4-0x0;var _0x3ccc1f=_0xeead[_0x5dded4];return _0x3ccc1f;};'use strict';var multer=require(_0xdeea('0x0'));var util=require(_0xdeea('0x1'));var path=require(_0xdeea('0x2'));var timeout=require(_0xdeea('0x3'));var express=require('express');var router=express[_0xdeea('0x4')]();var fs_extra=require(_0xdeea('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdeea('0x6'));var config=require('../../config/environment');var controller=require(_0xdeea('0x7'));router[_0xdeea('0x8')]('/',auth['isAuthenticated'](),controller[_0xdeea('0x9')]);router[_0xdeea('0x8')]('/:id',auth[_0xdeea('0xa')](),controller[_0xdeea('0xb')]);router['post']('/',auth[_0xdeea('0xa')](),controller[_0xdeea('0xc')]);router[_0xdeea('0xd')](_0xdeea('0xe'),auth[_0xdeea('0xa')](),controller[_0xdeea('0xf')]);router['delete']('/:id',auth[_0xdeea('0xa')](),controller[_0xdeea('0x10')]);module[_0xdeea('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 3c28c0f..e96a7b5 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 _0xd131=['variable','keyValue','picklist','STRING','customVariable','sequelize','exports','ENUM','string'];(function(_0x4a968c,_0x5b6fee){var _0x18727c=function(_0xf473b4){while(--_0xf473b4){_0x4a968c['push'](_0x4a968c['shift']());}};_0x18727c(++_0x5b6fee);}(_0xd131,0x1e2));var _0x1d13=function(_0x2894d5,_0x159d6b){_0x2894d5=_0x2894d5-0x0;var _0x343dd7=_0xd131[_0x2894d5];return _0x343dd7;};'use strict';var Sequelize=require(_0x1d13('0x0'));module[_0x1d13('0x1')]={'type':{'type':Sequelize[_0x1d13('0x2')](_0x1d13('0x3'),_0x1d13('0x4'),'customVariable',_0x1d13('0x5'),_0x1d13('0x6')),'defaultValue':_0x1d13('0x3')},'content':{'type':Sequelize[_0x1d13('0x7')]},'key':{'type':Sequelize[_0x1d13('0x7')]},'keyType':{'type':Sequelize[_0x1d13('0x2')]('string','variable',_0x1d13('0x8'))},'keyContent':{'type':Sequelize[_0x1d13('0x7')]},'idField':{'type':Sequelize[_0x1d13('0x7')]},'nameField':{'type':Sequelize[_0x1d13('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1d13('0x7')]}}; \ No newline at end of file +var _0x1963=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x21353c,_0x2ea587){var _0xa99120=function(_0x557f33){while(--_0x557f33){_0x21353c['push'](_0x21353c['shift']());}};_0xa99120(++_0x2ea587);}(_0x1963,0x169));var _0x3196=function(_0x3150ac,_0x5dfec7){_0x3150ac=_0x3150ac-0x0;var _0x15c346=_0x1963[_0x3150ac];return _0x15c346;};'use strict';var Sequelize=require(_0x3196('0x0'));module[_0x3196('0x1')]={'type':{'type':Sequelize[_0x3196('0x2')](_0x3196('0x3'),_0x3196('0x4'),_0x3196('0x5'),_0x3196('0x6'),'picklist'),'defaultValue':_0x3196('0x3')},'content':{'type':Sequelize[_0x3196('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3196('0x2')](_0x3196('0x3'),_0x3196('0x4'),_0x3196('0x5'))},'keyContent':{'type':Sequelize[_0x3196('0x7')]},'idField':{'type':Sequelize[_0x3196('0x7')]},'nameField':{'type':Sequelize[_0x3196('0x7')]},'customField':{'type':Sequelize[_0x3196('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 55cee72..c47a94f 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 _0xbf44=['create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','catch'];(function(_0x201564,_0x4a4718){var _0x3c9a2b=function(_0x26d9d1){while(--_0x26d9d1){_0x201564['push'](_0x201564['shift']());}};_0x3c9a2b(++_0x4a4718);}(_0xbf44,0xce));var _0x4bf4=function(_0x260a1a,_0x4e28ee){_0x260a1a=_0x260a1a-0x0;var _0x17c39e=_0xbf44[_0x260a1a];return _0x17c39e;};'use strict';var emlformat=require(_0x4bf4('0x0'));var rimraf=require(_0x4bf4('0x1'));var zipdir=require(_0x4bf4('0x2'));var jsonpatch=require(_0x4bf4('0x3'));var rp=require('request-promise');var moment=require(_0x4bf4('0x4'));var BPromise=require(_0x4bf4('0x5'));var Mustache=require('mustache');var util=require(_0x4bf4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4bf4('0x7'));var ejs=require(_0x4bf4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4bf4('0x9'));var squel=require('squel');var crypto=require(_0x4bf4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4bf4('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4bf4('0xc'));var Redis=require(_0x4bf4('0xd'));var authService=require(_0x4bf4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4bf4('0xf'));var hardwareService=require(_0x4bf4('0x10'));var logger=require(_0x4bf4('0x11'))(_0x4bf4('0x12'));var utils=require(_0x4bf4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4bf4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3212a9,_0x5bec01){_0x5bec01=_0x5bec01||0xcc;return function(_0x369c26){if(_0x369c26){return _0x3212a9[_0x4bf4('0x15')](_0x5bec01);}return _0x3212a9[_0x4bf4('0x16')](_0x5bec01)[_0x4bf4('0x17')]();};}function respondWithResult(_0x2f9d73,_0x462bda){_0x462bda=_0x462bda||0xc8;return function(_0x2909bf){if(_0x2909bf){return _0x2f9d73['status'](_0x462bda)[_0x4bf4('0x18')](_0x2909bf);}};}function respondWithFilteredResult(_0x1a158a,_0x2a6c4b){return function(_0x4882e0){if(_0x4882e0){var _0x1fbd4e=typeof _0x2a6c4b['offset']==='undefined'&&typeof _0x2a6c4b[_0x4bf4('0x19')]===_0x4bf4('0x1a');var _0x3d25ee=_0x4882e0[_0x4bf4('0x1b')];var _0x3ad505=_0x1fbd4e?0x0:_0x2a6c4b[_0x4bf4('0x1c')];var _0x45e990=_0x1fbd4e?_0x4882e0['count']:_0x2a6c4b[_0x4bf4('0x1c')]+_0x2a6c4b[_0x4bf4('0x19')];var _0x4d2329;if(_0x45e990>=_0x3d25ee){_0x45e990=_0x3d25ee;_0x4d2329=0xc8;}else{_0x4d2329=0xce;}_0x1a158a['status'](_0x4d2329);return _0x1a158a['set'](_0x4bf4('0x1d'),_0x3ad505+'-'+_0x45e990+'/'+_0x3d25ee)[_0x4bf4('0x18')](_0x4882e0);}return null;};}function patchUpdates(_0x54f503){return function(_0x1853ec){try{jsonpatch[_0x4bf4('0x1e')](_0x1853ec,_0x54f503,!![]);}catch(_0x4e4cfc){return BPromise[_0x4bf4('0x1f')](_0x4e4cfc);}return _0x1853ec[_0x4bf4('0x20')]();};}function saveUpdates(_0x155d91,_0x321889){return function(_0x529f4f){if(_0x529f4f){return _0x529f4f[_0x4bf4('0x21')](_0x155d91)['then'](function(_0x24c807){return _0x24c807;});}return null;};}function removeEntity(_0xa9300d,_0x140910){return function(_0x4d6de1){if(_0x4d6de1){return _0x4d6de1['destroy']()['then'](function(){_0xa9300d['status'](0xcc)[_0x4bf4('0x17')]();});}};}function handleEntityNotFound(_0x5aa277,_0x5ed791){return function(_0x5c260d){if(!_0x5c260d){_0x5aa277['sendStatus'](0x194);}return _0x5c260d;};}function handleError(_0x4a26e9,_0x426e46){_0x426e46=_0x426e46||0x1f4;return function(_0x5640d8){logger['error'](_0x5640d8[_0x4bf4('0x22')]);if(_0x5640d8[_0x4bf4('0x23')]){delete _0x5640d8[_0x4bf4('0x23')];}_0x4a26e9[_0x4bf4('0x16')](_0x426e46)[_0x4bf4('0x24')](_0x5640d8);};}exports[_0x4bf4('0x25')]=function(_0x2ca238,_0x4ccad4){var _0xa8bb6a={},_0x1e88dc={},_0x5a7616={'count':0x0,'rows':[]};var _0x69eb7a=_[_0x4bf4('0x26')](db[_0x4bf4('0x27')][_0x4bf4('0x28')],function(_0x590d1c){return{'name':_0x590d1c[_0x4bf4('0x29')],'type':_0x590d1c['type'][_0x4bf4('0x2a')]};});_0x1e88dc[_0x4bf4('0x2b')]=_['map'](_0x69eb7a,'name');_0x1e88dc[_0x4bf4('0x2c')]=_[_0x4bf4('0x2d')](_0x2ca238[_0x4bf4('0x2c')]);_0x1e88dc['filters']=_[_0x4bf4('0x2e')](_0x1e88dc[_0x4bf4('0x2b')],_0x1e88dc[_0x4bf4('0x2c')]);_0xa8bb6a[_0x4bf4('0x2f')]=_[_0x4bf4('0x2e')](_0x1e88dc[_0x4bf4('0x2b')],qs[_0x4bf4('0x30')](_0x2ca238['query']['fields']));_0xa8bb6a[_0x4bf4('0x2f')]=_0xa8bb6a[_0x4bf4('0x2f')][_0x4bf4('0x31')]?_0xa8bb6a[_0x4bf4('0x2f')]:_0x1e88dc[_0x4bf4('0x2b')];if(!_0x2ca238[_0x4bf4('0x2c')]['hasOwnProperty']('nolimit')){_0xa8bb6a[_0x4bf4('0x19')]=qs[_0x4bf4('0x19')](_0x2ca238[_0x4bf4('0x2c')]['limit']);_0xa8bb6a[_0x4bf4('0x1c')]=qs[_0x4bf4('0x1c')](_0x2ca238[_0x4bf4('0x2c')][_0x4bf4('0x1c')]);}_0xa8bb6a[_0x4bf4('0x32')]=qs[_0x4bf4('0x33')](_0x2ca238[_0x4bf4('0x2c')][_0x4bf4('0x33')]);_0xa8bb6a[_0x4bf4('0x34')]=qs[_0x4bf4('0x35')](_['pick'](_0x2ca238[_0x4bf4('0x2c')],_0x1e88dc[_0x4bf4('0x35')]),_0x69eb7a);if(_0x2ca238['query'][_0x4bf4('0x36')]){_0xa8bb6a['where']=_[_0x4bf4('0x37')](_0xa8bb6a['where'],{'$or':_['map'](_0x69eb7a,function(_0x5f5d43){if(_0x5f5d43['type']!==_0x4bf4('0x38')){var _0x2e54d8={};_0x2e54d8[_0x5f5d43[_0x4bf4('0x23')]]={'$like':'%'+_0x2ca238[_0x4bf4('0x2c')][_0x4bf4('0x36')]+'%'};return _0x2e54d8;}})});}_0xa8bb6a=_[_0x4bf4('0x37')]({},_0xa8bb6a,_0x2ca238[_0x4bf4('0x39')]);var _0x18a313={'where':_0xa8bb6a[_0x4bf4('0x34')]};return db[_0x4bf4('0x27')][_0x4bf4('0x1b')](_0x18a313)[_0x4bf4('0x3a')](function(_0x57641a){_0x5a7616[_0x4bf4('0x1b')]=_0x57641a;if(_0x2ca238[_0x4bf4('0x2c')][_0x4bf4('0x3b')]){_0xa8bb6a[_0x4bf4('0x3c')]=[{'all':!![]}];}return db[_0x4bf4('0x27')][_0x4bf4('0x3d')](_0xa8bb6a);})[_0x4bf4('0x3a')](function(_0x1e5592){_0x5a7616[_0x4bf4('0x3e')]=_0x1e5592;return _0x5a7616;})['then'](respondWithFilteredResult(_0x4ccad4,_0xa8bb6a))['catch'](handleError(_0x4ccad4,null));};exports[_0x4bf4('0x3f')]=function(_0x2d9f98,_0x3fe933){var _0xeeb8be={'raw':!![],'where':{'id':_0x2d9f98[_0x4bf4('0x40')]['id']}},_0x534bda={};_0x534bda['model']=_[_0x4bf4('0x2d')](db[_0x4bf4('0x27')][_0x4bf4('0x28')]);_0x534bda['query']=_['keys'](_0x2d9f98[_0x4bf4('0x2c')]);_0x534bda[_0x4bf4('0x35')]=_[_0x4bf4('0x2e')](_0x534bda[_0x4bf4('0x2b')],_0x534bda[_0x4bf4('0x2c')]);_0xeeb8be[_0x4bf4('0x2f')]=_[_0x4bf4('0x2e')](_0x534bda[_0x4bf4('0x2b')],qs[_0x4bf4('0x30')](_0x2d9f98[_0x4bf4('0x2c')]['fields']));_0xeeb8be[_0x4bf4('0x2f')]=_0xeeb8be[_0x4bf4('0x2f')][_0x4bf4('0x31')]?_0xeeb8be[_0x4bf4('0x2f')]:_0x534bda[_0x4bf4('0x2b')];if(_0x2d9f98[_0x4bf4('0x2c')][_0x4bf4('0x3b')]){_0xeeb8be[_0x4bf4('0x3c')]=[{'all':!![]}];}_0xeeb8be=_[_0x4bf4('0x37')]({},_0xeeb8be,_0x2d9f98['options']);return db[_0x4bf4('0x27')]['find'](_0xeeb8be)[_0x4bf4('0x3a')](handleEntityNotFound(_0x3fe933,null))[_0x4bf4('0x3a')](respondWithResult(_0x3fe933,null))[_0x4bf4('0x41')](handleError(_0x3fe933,null));};exports[_0x4bf4('0x42')]=function(_0x812320,_0x4e5375){return db[_0x4bf4('0x27')][_0x4bf4('0x42')](_0x812320[_0x4bf4('0x43')],{})['then'](respondWithResult(_0x4e5375,0xc9))[_0x4bf4('0x41')](handleError(_0x4e5375,null));};exports[_0x4bf4('0x21')]=function(_0x2879a3,_0x3b5d54){if(_0x2879a3[_0x4bf4('0x43')]['id']){delete _0x2879a3[_0x4bf4('0x43')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x2879a3[_0x4bf4('0x40')]['id']}})[_0x4bf4('0x3a')](handleEntityNotFound(_0x3b5d54,null))[_0x4bf4('0x3a')](saveUpdates(_0x2879a3[_0x4bf4('0x43')],null))[_0x4bf4('0x3a')](respondWithResult(_0x3b5d54,null))[_0x4bf4('0x41')](handleError(_0x3b5d54,null));};exports['destroy']=function(_0x40dcae,_0x18b046){return db[_0x4bf4('0x27')]['find']({'where':{'id':_0x40dcae[_0x4bf4('0x40')]['id']}})[_0x4bf4('0x3a')](handleEntityNotFound(_0x18b046,null))[_0x4bf4('0x3a')](removeEntity(_0x18b046,null))[_0x4bf4('0x41')](handleError(_0x18b046,null));}; \ No newline at end of file +var _0x3064=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','then','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x53174f,_0x986a3b){var _0x1cbd1c=function(_0x5bbcb1){while(--_0x5bbcb1){_0x53174f['push'](_0x53174f['shift']());}};_0x1cbd1c(++_0x986a3b);}(_0x3064,0x13e));var _0x4306=function(_0x37d88a,_0x49adf9){_0x37d88a=_0x37d88a-0x0;var _0x1f4ea1=_0x3064[_0x37d88a];return _0x1f4ea1;};'use strict';var emlformat=require(_0x4306('0x0'));var rimraf=require(_0x4306('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4306('0x2'));var rp=require(_0x4306('0x3'));var moment=require(_0x4306('0x4'));var BPromise=require(_0x4306('0x5'));var Mustache=require(_0x4306('0x6'));var util=require('util');var path=require(_0x4306('0x7'));var sox=require(_0x4306('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4306('0x9'));var _=require(_0x4306('0xa'));var squel=require('squel');var crypto=require(_0x4306('0xb'));var jsforce=require(_0x4306('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4306('0xd'));var querystring=require(_0x4306('0xe'));var Papa=require(_0x4306('0xf'));var Redis=require(_0x4306('0x10'));var authService=require(_0x4306('0x11'));var qs=require(_0x4306('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4306('0x13'));var logger=require(_0x4306('0x14'))('api');var utils=require(_0x4306('0x15'));var config=require(_0x4306('0x16'));var licenseUtil=require(_0x4306('0x17'));var db=require(_0x4306('0x18'))['db'];function respondWithStatusCode(_0x4e2ace,_0x49d026){_0x49d026=_0x49d026||0xcc;return function(_0x477891){if(_0x477891){return _0x4e2ace['sendStatus'](_0x49d026);}return _0x4e2ace[_0x4306('0x19')](_0x49d026)['end']();};}function respondWithResult(_0x3b7e0f,_0x64c15c){_0x64c15c=_0x64c15c||0xc8;return function(_0x56bd4d){if(_0x56bd4d){return _0x3b7e0f[_0x4306('0x19')](_0x64c15c)[_0x4306('0x1a')](_0x56bd4d);}};}function respondWithFilteredResult(_0x53d2ab,_0x3f643e){return function(_0x18b7f9){if(_0x18b7f9){var _0x319ace=typeof _0x3f643e[_0x4306('0x1b')]==='undefined'&&typeof _0x3f643e[_0x4306('0x1c')]==='undefined';var _0x2f0064=_0x18b7f9[_0x4306('0x1d')];var _0xcf11e7=_0x319ace?0x0:_0x3f643e[_0x4306('0x1b')];var _0xe90221=_0x319ace?_0x18b7f9[_0x4306('0x1d')]:_0x3f643e[_0x4306('0x1b')]+_0x3f643e[_0x4306('0x1c')];var _0x3ccd98;if(_0xe90221>=_0x2f0064){_0xe90221=_0x2f0064;_0x3ccd98=0xc8;}else{_0x3ccd98=0xce;}_0x53d2ab['status'](_0x3ccd98);return _0x53d2ab[_0x4306('0x1e')](_0x4306('0x1f'),_0xcf11e7+'-'+_0xe90221+'/'+_0x2f0064)[_0x4306('0x1a')](_0x18b7f9);}return null;};}function patchUpdates(_0xb63314){return function(_0x2e832f){try{jsonpatch[_0x4306('0x20')](_0x2e832f,_0xb63314,!![]);}catch(_0x389f43){return BPromise['reject'](_0x389f43);}return _0x2e832f[_0x4306('0x21')]();};}function saveUpdates(_0x517d85,_0x25d59f){return function(_0x214df8){if(_0x214df8){return _0x214df8[_0x4306('0x22')](_0x517d85)['then'](function(_0x5b2455){return _0x5b2455;});}return null;};}function removeEntity(_0x3d3d7d,_0x1ca7a5){return function(_0x106f57){if(_0x106f57){return _0x106f57[_0x4306('0x23')]()[_0x4306('0x24')](function(){_0x3d3d7d[_0x4306('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f51a9,_0x123b11){return function(_0x25d626){if(!_0x25d626){_0x5f51a9['sendStatus'](0x194);}return _0x25d626;};}function handleError(_0x10015a,_0x50e4ad){_0x50e4ad=_0x50e4ad||0x1f4;return function(_0x44ce1a){logger[_0x4306('0x25')](_0x44ce1a['stack']);if(_0x44ce1a[_0x4306('0x26')]){delete _0x44ce1a[_0x4306('0x26')];}_0x10015a[_0x4306('0x19')](_0x50e4ad)[_0x4306('0x27')](_0x44ce1a);};}exports[_0x4306('0x28')]=function(_0x2c0431,_0x31c5ba){var _0x4cdf4f={},_0x12d4fb={},_0x2e385a={'count':0x0,'rows':[]};var _0x3d0f32=_[_0x4306('0x29')](db[_0x4306('0x2a')][_0x4306('0x2b')],function(_0x4f50b3){return{'name':_0x4f50b3[_0x4306('0x2c')],'type':_0x4f50b3[_0x4306('0x2d')][_0x4306('0x2e')]};});_0x12d4fb[_0x4306('0x2f')]=_[_0x4306('0x29')](_0x3d0f32,'name');_0x12d4fb[_0x4306('0x30')]=_[_0x4306('0x31')](_0x2c0431['query']);_0x12d4fb[_0x4306('0x32')]=_[_0x4306('0x33')](_0x12d4fb[_0x4306('0x2f')],_0x12d4fb[_0x4306('0x30')]);_0x4cdf4f[_0x4306('0x34')]=_['intersection'](_0x12d4fb[_0x4306('0x2f')],qs[_0x4306('0x35')](_0x2c0431[_0x4306('0x30')]['fields']));_0x4cdf4f[_0x4306('0x34')]=_0x4cdf4f[_0x4306('0x34')][_0x4306('0x36')]?_0x4cdf4f[_0x4306('0x34')]:_0x12d4fb['model'];if(!_0x2c0431[_0x4306('0x30')][_0x4306('0x37')]('nolimit')){_0x4cdf4f[_0x4306('0x1c')]=qs['limit'](_0x2c0431[_0x4306('0x30')]['limit']);_0x4cdf4f[_0x4306('0x1b')]=qs[_0x4306('0x1b')](_0x2c0431[_0x4306('0x30')][_0x4306('0x1b')]);}_0x4cdf4f[_0x4306('0x38')]=qs[_0x4306('0x39')](_0x2c0431['query']['sort']);_0x4cdf4f[_0x4306('0x3a')]=qs['filters'](_[_0x4306('0x3b')](_0x2c0431['query'],_0x12d4fb[_0x4306('0x32')]),_0x3d0f32);if(_0x2c0431[_0x4306('0x30')][_0x4306('0x3c')]){_0x4cdf4f[_0x4306('0x3a')]=_[_0x4306('0x3d')](_0x4cdf4f['where'],{'$or':_['map'](_0x3d0f32,function(_0x592ea7){if(_0x592ea7['type']!==_0x4306('0x3e')){var _0x2fbfa4={};_0x2fbfa4[_0x592ea7['name']]={'$like':'%'+_0x2c0431[_0x4306('0x30')][_0x4306('0x3c')]+'%'};return _0x2fbfa4;}})});}_0x4cdf4f=_[_0x4306('0x3d')]({},_0x4cdf4f,_0x2c0431[_0x4306('0x3f')]);var _0x5ebc59={'where':_0x4cdf4f[_0x4306('0x3a')]};return db[_0x4306('0x2a')][_0x4306('0x1d')](_0x5ebc59)['then'](function(_0x43ab91){_0x2e385a[_0x4306('0x1d')]=_0x43ab91;if(_0x2c0431[_0x4306('0x30')][_0x4306('0x40')]){_0x4cdf4f[_0x4306('0x41')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x4306('0x42')](_0x4cdf4f);})['then'](function(_0x1c67e9){_0x2e385a[_0x4306('0x43')]=_0x1c67e9;return _0x2e385a;})[_0x4306('0x24')](respondWithFilteredResult(_0x31c5ba,_0x4cdf4f))[_0x4306('0x44')](handleError(_0x31c5ba,null));};exports[_0x4306('0x45')]=function(_0x2d9eff,_0x12594f){var _0x56866e={'raw':!![],'where':{'id':_0x2d9eff['params']['id']}},_0x2611fd={};_0x2611fd['model']=_['keys'](db['Dynamics365Field'][_0x4306('0x2b')]);_0x2611fd[_0x4306('0x30')]=_['keys'](_0x2d9eff[_0x4306('0x30')]);_0x2611fd[_0x4306('0x32')]=_[_0x4306('0x33')](_0x2611fd[_0x4306('0x2f')],_0x2611fd[_0x4306('0x30')]);_0x56866e[_0x4306('0x34')]=_['intersection'](_0x2611fd[_0x4306('0x2f')],qs['fields'](_0x2d9eff[_0x4306('0x30')][_0x4306('0x35')]));_0x56866e[_0x4306('0x34')]=_0x56866e[_0x4306('0x34')][_0x4306('0x36')]?_0x56866e[_0x4306('0x34')]:_0x2611fd[_0x4306('0x2f')];if(_0x2d9eff[_0x4306('0x30')][_0x4306('0x40')]){_0x56866e[_0x4306('0x41')]=[{'all':!![]}];}_0x56866e=_[_0x4306('0x3d')]({},_0x56866e,_0x2d9eff[_0x4306('0x3f')]);return db[_0x4306('0x2a')][_0x4306('0x46')](_0x56866e)[_0x4306('0x24')](handleEntityNotFound(_0x12594f,null))[_0x4306('0x24')](respondWithResult(_0x12594f,null))[_0x4306('0x44')](handleError(_0x12594f,null));};exports[_0x4306('0x47')]=function(_0x1a9e3d,_0x538393){return db[_0x4306('0x2a')][_0x4306('0x47')](_0x1a9e3d[_0x4306('0x48')],{})[_0x4306('0x24')](respondWithResult(_0x538393,0xc9))[_0x4306('0x44')](handleError(_0x538393,null));};exports[_0x4306('0x22')]=function(_0x52ef52,_0x326dd8){if(_0x52ef52[_0x4306('0x48')]['id']){delete _0x52ef52[_0x4306('0x48')]['id'];}return db['Dynamics365Field'][_0x4306('0x46')]({'where':{'id':_0x52ef52['params']['id']}})['then'](handleEntityNotFound(_0x326dd8,null))[_0x4306('0x24')](saveUpdates(_0x52ef52['body'],null))[_0x4306('0x24')](respondWithResult(_0x326dd8,null))[_0x4306('0x44')](handleError(_0x326dd8,null));};exports[_0x4306('0x23')]=function(_0xef8c44,_0xba431f){return db[_0x4306('0x2a')][_0x4306('0x46')]({'where':{'id':_0xef8c44[_0x4306('0x49')]['id']}})[_0x4306('0x24')](handleEntityNotFound(_0xba431f,null))[_0x4306('0x24')](removeEntity(_0xba431f,null))[_0x4306('0x44')](handleError(_0xba431f,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 249c99f..547f0c2 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 _0x2ca4=['dynamics365_unique_index','idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','int_dynamics365_fields'];(function(_0x9d5f5b,_0x5878b6){var _0x4fc2a5=function(_0x13935f){while(--_0x13935f){_0x9d5f5b['push'](_0x9d5f5b['shift']());}};_0x4fc2a5(++_0x5878b6);}(_0x2ca4,0xc6));var _0x42ca=function(_0x229066,_0x443063){_0x229066=_0x229066-0x0;var _0xd7c89=_0x2ca4[_0x229066];return _0xd7c89;};'use strict';var _=require(_0x42ca('0x0'));var util=require(_0x42ca('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x42ca('0x2'));var BPromise=require(_0x42ca('0x3'));var rp=require(_0x42ca('0x4'));var fs=require('fs');var path=require(_0x42ca('0x5'));var rimraf=require(_0x42ca('0x6'));var config=require(_0x42ca('0x7'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x19df21,_0xaac59e){return _0x19df21[_0x42ca('0x8')]('Dynamics365Field',attributes,{'tableName':_0x42ca('0x9'),'paranoid':![],'indexes':[{'name':_0x42ca('0xa'),'fields':[_0x42ca('0xb'),_0x42ca('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x01dc=['moment','bluebird','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','FieldId','lodash','../../config/logger'];(function(_0x5e29c7,_0xc2f44e){var _0x5ba897=function(_0x650b47){while(--_0x650b47){_0x5e29c7['push'](_0x5e29c7['shift']());}};_0x5ba897(++_0xc2f44e);}(_0x01dc,0x73));var _0xc01d=function(_0x4fd9ad,_0x145ad4){_0x4fd9ad=_0x4fd9ad-0x0;var _0x44aa5c=_0x01dc[_0x4fd9ad];return _0x44aa5c;};'use strict';var _=require(_0xc01d('0x0'));var util=require('util');var logger=require(_0xc01d('0x1'))('api');var moment=require(_0xc01d('0x2'));var BPromise=require(_0xc01d('0x3'));var rp=require(_0xc01d('0x4'));var fs=require('fs');var path=require(_0xc01d('0x5'));var rimraf=require('rimraf');var config=require(_0xc01d('0x6'));var attributes=require(_0xc01d('0x7'));module[_0xc01d('0x8')]=function(_0x90b067,_0x3bfa71){return _0x90b067[_0xc01d('0x9')](_0xc01d('0xa'),attributes,{'tableName':_0xc01d('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0xc01d('0xc')],'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 4cadf45..9606a42 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 _0x0f93=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','info','lodash','util','moment'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0x0f93,0xad));var _0x30f9=function(_0x3b2e3a,_0x135ff7){_0x3b2e3a=_0x3b2e3a-0x0;var _0x4c8c7c=_0x0f93[_0x3b2e3a];return _0x4c8c7c;};'use strict';var _=require(_0x30f9('0x0'));var util=require(_0x30f9('0x1'));var moment=require(_0x30f9('0x2'));var BPromise=require(_0x30f9('0x3'));var rs=require(_0x30f9('0x4'));var fs=require('fs');var Redis=require(_0x30f9('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x30f9('0x6'));var config=require(_0x30f9('0x7'));var jayson=require(_0x30f9('0x8'));var client=jayson[_0x30f9('0x9')][_0x30f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x872156,_0x47b207,_0x372863){return new BPromise(function(_0x518fce,_0x11910d){return client[_0x30f9('0xb')](_0x872156,_0x372863)[_0x30f9('0xc')](function(_0x21df6e){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x47b207,_0x30f9('0xd'));logger[_0x30f9('0xe')](_0x30f9('0xf'),_0x47b207,_0x30f9('0xd'),JSON[_0x30f9('0x10')](_0x21df6e));if(_0x21df6e[_0x30f9('0x11')]){if(_0x21df6e[_0x30f9('0x11')][_0x30f9('0x12')]===0x1f4){logger[_0x30f9('0x11')](_0x30f9('0x13'),_0x47b207,_0x21df6e[_0x30f9('0x11')][_0x30f9('0x14')]);return _0x11910d(_0x21df6e[_0x30f9('0x11')]['message']);}logger[_0x30f9('0x11')](_0x30f9('0x13'),_0x47b207,_0x21df6e[_0x30f9('0x11')][_0x30f9('0x14')]);return _0x518fce(_0x21df6e[_0x30f9('0x11')]['message']);}else{logger[_0x30f9('0x15')](_0x30f9('0x13'),_0x47b207,_0x30f9('0xd'));_0x518fce(_0x21df6e['result'][_0x30f9('0x14')]);}})['catch'](function(_0x471e05){logger['error'](_0x30f9('0x13'),_0x47b207,_0x471e05);_0x11910d(_0x471e05);});});} \ No newline at end of file +var _0x6ecc=['stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s'];(function(_0x309a39,_0x193cd4){var _0x36c085=function(_0x1f43f6){while(--_0x1f43f6){_0x309a39['push'](_0x309a39['shift']());}};_0x36c085(++_0x193cd4);}(_0x6ecc,0x70));var _0xc6ec=function(_0x45f629,_0x5260c8){_0x45f629=_0x45f629-0x0;var _0x202767=_0x6ecc[_0x45f629];return _0x202767;};'use strict';var _=require('lodash');var util=require(_0xc6ec('0x0'));var moment=require(_0xc6ec('0x1'));var BPromise=require(_0xc6ec('0x2'));var rs=require(_0xc6ec('0x3'));var fs=require('fs');var Redis=require(_0xc6ec('0x4'));var db=require(_0xc6ec('0x5'))['db'];var utils=require(_0xc6ec('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc6ec('0x7')][_0xc6ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe79b21,_0x42965d,_0x2b8eeb){return new BPromise(function(_0x4147b9,_0x579d24){return client[_0xc6ec('0x9')](_0xe79b21,_0x2b8eeb)[_0xc6ec('0xa')](function(_0x128a16){logger['info'](_0xc6ec('0xb'),_0x42965d,_0xc6ec('0xc'));logger['debug'](_0xc6ec('0xd'),_0x42965d,_0xc6ec('0xc'),JSON[_0xc6ec('0xe')](_0x128a16));if(_0x128a16[_0xc6ec('0xf')]){if(_0x128a16[_0xc6ec('0xf')][_0xc6ec('0x10')]===0x1f4){logger[_0xc6ec('0xf')](_0xc6ec('0xb'),_0x42965d,_0x128a16[_0xc6ec('0xf')][_0xc6ec('0x11')]);return _0x579d24(_0x128a16[_0xc6ec('0xf')][_0xc6ec('0x11')]);}logger[_0xc6ec('0xf')](_0xc6ec('0xb'),_0x42965d,_0x128a16['error'][_0xc6ec('0x11')]);return _0x4147b9(_0x128a16['error'][_0xc6ec('0x11')]);}else{logger['info'](_0xc6ec('0xb'),_0x42965d,_0xc6ec('0xc'));_0x4147b9(_0x128a16['result'][_0xc6ec('0x11')]);}})['catch'](function(_0x14ec5a){logger[_0xc6ec('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x42965d,_0x14ec5a);_0x579d24(_0x14ec5a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index f0769f9..8cf6d42 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 _0x76bd=['../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x55e855,_0x2ea51c){var _0xc48714=function(_0x263ec2){while(--_0x263ec2){_0x55e855['push'](_0x55e855['shift']());}};_0xc48714(++_0x2ea51c);}(_0x76bd,0x1de));var _0xd76b=function(_0x16c4cb,_0x93c3c2){_0x16c4cb=_0x16c4cb-0x0;var _0x23b125=_0x76bd[_0x16c4cb];return _0x23b125;};'use strict';var multer=require('multer');var util=require(_0xd76b('0x0'));var path=require(_0xd76b('0x1'));var timeout=require(_0xd76b('0x2'));var express=require('express');var router=express[_0xd76b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd76b('0x4'));var interaction=require(_0xd76b('0x5'));var config=require(_0xd76b('0x6'));var controller=require('./intFreshdeskAccount.controller');router[_0xd76b('0x7')]('/',auth['isAuthenticated'](),controller[_0xd76b('0x8')]);router[_0xd76b('0x7')]('/:id',auth[_0xd76b('0x9')](),controller[_0xd76b('0xa')]);router[_0xd76b('0x7')](_0xd76b('0xb'),auth[_0xd76b('0x9')](),controller[_0xd76b('0xc')]);router[_0xd76b('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0xd76b('0xd')]);router[_0xd76b('0xe')]('/',auth[_0xd76b('0x9')](),controller[_0xd76b('0xf')]);router[_0xd76b('0xe')](_0xd76b('0xb'),auth[_0xd76b('0x9')](),controller[_0xd76b('0x10')]);router[_0xd76b('0x11')](_0xd76b('0x12'),auth[_0xd76b('0x9')](),controller[_0xd76b('0x13')]);router[_0xd76b('0x14')](_0xd76b('0x12'),auth[_0xd76b('0x9')](),controller[_0xd76b('0x15')]);module[_0xd76b('0x16')]=router; \ No newline at end of file +var _0xb27e=['util','path','connect-timeout','fs-extra','../../components/auth/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','create','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x4c20f2,_0x5ee4a6){var _0x576919=function(_0x142986){while(--_0x142986){_0x4c20f2['push'](_0x4c20f2['shift']());}};_0x576919(++_0x5ee4a6);}(_0xb27e,0x1a1));var _0xeb27=function(_0x580d30,_0x1c83ef){_0x580d30=_0x580d30-0x0;var _0x3c79c1=_0xb27e[_0x580d30];return _0x3c79c1;};'use strict';var multer=require(_0xeb27('0x0'));var util=require(_0xeb27('0x1'));var path=require(_0xeb27('0x2'));var timeout=require(_0xeb27('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xeb27('0x4'));var auth=require(_0xeb27('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb27('0x6'));router[_0xeb27('0x7')]('/',auth[_0xeb27('0x8')](),controller[_0xeb27('0x9')]);router[_0xeb27('0x7')](_0xeb27('0xa'),auth[_0xeb27('0x8')](),controller[_0xeb27('0xb')]);router[_0xeb27('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xeb27('0xc')]);router[_0xeb27('0x7')]('/:id/fields',auth[_0xeb27('0x8')](),controller['getFields']);router['post']('/',auth[_0xeb27('0x8')](),controller[_0xeb27('0xd')]);router[_0xeb27('0xe')](_0xeb27('0xf'),auth['isAuthenticated'](),controller[_0xeb27('0x10')]);router[_0xeb27('0x11')]('/:id',auth[_0xeb27('0x8')](),controller[_0xeb27('0x12')]);router[_0xeb27('0x13')](_0xeb27('0xa'),auth[_0xeb27('0x8')](),controller[_0xeb27('0x14')]);module[_0xeb27('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 373e765..0facc7f 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 _0x5fdc=['sequelize','exports','STRING','username','remoteUri'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x5fdc,0x127));var _0xc5fd=function(_0x1495a1,_0x273169){_0x1495a1=_0x1495a1-0x0;var _0x589fb9=_0x5fdc[_0x1495a1];return _0x589fb9;};'use strict';var Sequelize=require(_0xc5fd('0x0'));module[_0xc5fd('0x1')]={'name':{'type':Sequelize[_0xc5fd('0x2')]},'description':{'type':Sequelize[_0xc5fd('0x2')]},'username':{'type':Sequelize[_0xc5fd('0x2')],'unique':_0xc5fd('0x3')},'apiKey':{'type':Sequelize[_0xc5fd('0x2')]},'remoteUri':{'type':Sequelize[_0xc5fd('0x2')],'unique':_0xc5fd('0x4')},'serverUrl':{'type':Sequelize[_0xc5fd('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x4e67e6,_0x48cd32){var _0x2b3cec=function(_0xb519de){while(--_0xb519de){_0x4e67e6['push'](_0x4e67e6['shift']());}};_0x2b3cec(++_0x48cd32);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x161b0c,_0x6772c6){_0x161b0c=_0x161b0c-0x0;var _0x3d194b=_0x4e2e[_0x161b0c];return _0x3d194b;};'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 diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 42d1dc7..c0840e0 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 _0x1c4f=['getFields','findOne','remoteUri','apiKey','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','company','remove','default','custom_text','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','sendStatus','error','stack','name','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','addConfiguration','AccountId','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','Subjects'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x1c4f,0x1f4));var _0xf1c4=function(_0x199e92,_0x4c0c8d){_0x199e92=_0x199e92-0x0;var _0x2fef06=_0x1c4f[_0x199e92];return _0x2fef06;};'use strict';var emlformat=require(_0xf1c4('0x0'));var rimraf=require(_0xf1c4('0x1'));var zipdir=require(_0xf1c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1c4('0x3'));var moment=require(_0xf1c4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf1c4('0x5'));var util=require(_0xf1c4('0x6'));var path=require(_0xf1c4('0x7'));var sox=require('sox');var csv=require(_0xf1c4('0x8'));var ejs=require(_0xf1c4('0x9'));var fs=require('fs');var fs_extra=require(_0xf1c4('0xa'));var _=require(_0xf1c4('0xb'));var squel=require(_0xf1c4('0xc'));var crypto=require(_0xf1c4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf1c4('0xe'));var toCsv=require(_0xf1c4('0x8'));var querystring=require(_0xf1c4('0xf'));var Papa=require('papaparse');var Redis=require(_0xf1c4('0x10'));var authService=require(_0xf1c4('0x11'));var qs=require(_0xf1c4('0x12'));var as=require(_0xf1c4('0x13'));var hardwareService=require(_0xf1c4('0x14'));var logger=require(_0xf1c4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf1c4('0x16'));var licenseUtil=require(_0xf1c4('0x17'));var db=require(_0xf1c4('0x18'))['db'];var integrations=require(_0xf1c4('0x19'));function respondWithStatusCode(_0x45e5c3,_0x2f7302){_0x2f7302=_0x2f7302||0xcc;return function(_0x12cbd7){if(_0x12cbd7){return _0x45e5c3['sendStatus'](_0x2f7302);}return _0x45e5c3[_0xf1c4('0x1a')](_0x2f7302)['end']();};}function respondWithResult(_0x2d49ce,_0x3c211b){_0x3c211b=_0x3c211b||0xc8;return function(_0x11cb27){if(_0x11cb27){return _0x2d49ce[_0xf1c4('0x1a')](_0x3c211b)[_0xf1c4('0x1b')](_0x11cb27);}};}function respondWithFilteredResult(_0x119d04,_0x30efff){return function(_0xa294d3){if(_0xa294d3){var _0x3f8259=typeof _0x30efff[_0xf1c4('0x1c')]===_0xf1c4('0x1d')&&typeof _0x30efff['limit']===_0xf1c4('0x1d');var _0x4a239f=_0xa294d3['count'];var _0x2dd4a7=_0x3f8259?0x0:_0x30efff[_0xf1c4('0x1c')];var _0x55c885=_0x3f8259?_0xa294d3[_0xf1c4('0x1e')]:_0x30efff[_0xf1c4('0x1c')]+_0x30efff[_0xf1c4('0x1f')];var _0x2ba83f;if(_0x55c885>=_0x4a239f){_0x55c885=_0x4a239f;_0x2ba83f=0xc8;}else{_0x2ba83f=0xce;}_0x119d04[_0xf1c4('0x1a')](_0x2ba83f);return _0x119d04[_0xf1c4('0x20')]('Content-Range',_0x2dd4a7+'-'+_0x55c885+'/'+_0x4a239f)['json'](_0xa294d3);}return null;};}function patchUpdates(_0x3e8616){return function(_0x115302){try{jsonpatch[_0xf1c4('0x21')](_0x115302,_0x3e8616,!![]);}catch(_0x709b27){return BPromise[_0xf1c4('0x22')](_0x709b27);}return _0x115302[_0xf1c4('0x23')]();};}function saveUpdates(_0x20a0ff,_0x4ffb27){return function(_0x5dc29d){if(_0x5dc29d){return _0x5dc29d[_0xf1c4('0x24')](_0x20a0ff)['then'](function(_0x4ca299){return _0x4ca299;});}return null;};}function removeEntity(_0x1e4521,_0x215a62){return function(_0x594e0d){if(_0x594e0d){return _0x594e0d[_0xf1c4('0x25')]()['then'](function(){_0x1e4521[_0xf1c4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bc59e,_0x286028){return function(_0x2b2eec){if(!_0x2b2eec){_0x1bc59e[_0xf1c4('0x26')](0x194);}return _0x2b2eec;};}function handleError(_0x1a7440,_0x6d3d79){_0x6d3d79=_0x6d3d79||0x1f4;return function(_0x236906){logger[_0xf1c4('0x27')](_0x236906[_0xf1c4('0x28')]);if(_0x236906['name']){delete _0x236906[_0xf1c4('0x29')];}_0x1a7440[_0xf1c4('0x1a')](_0x6d3d79)['send'](_0x236906);};}exports['index']=function(_0x316048,_0x1f29fe){var _0x30e431={},_0xf16ca3={},_0x2dd8f1={'count':0x0,'rows':[]};var _0x27a683=_[_0xf1c4('0x2a')](db[_0xf1c4('0x2b')][_0xf1c4('0x2c')],function(_0x333993){return{'name':_0x333993[_0xf1c4('0x2d')],'type':_0x333993[_0xf1c4('0x2e')][_0xf1c4('0x2f')]};});_0xf16ca3[_0xf1c4('0x30')]=_['map'](_0x27a683,_0xf1c4('0x29'));_0xf16ca3[_0xf1c4('0x31')]=_[_0xf1c4('0x32')](_0x316048[_0xf1c4('0x31')]);_0xf16ca3[_0xf1c4('0x33')]=_[_0xf1c4('0x34')](_0xf16ca3[_0xf1c4('0x30')],_0xf16ca3[_0xf1c4('0x31')]);_0x30e431[_0xf1c4('0x35')]=_[_0xf1c4('0x34')](_0xf16ca3['model'],qs['fields'](_0x316048[_0xf1c4('0x31')][_0xf1c4('0x36')]));_0x30e431[_0xf1c4('0x35')]=_0x30e431[_0xf1c4('0x35')][_0xf1c4('0x37')]?_0x30e431['attributes']:_0xf16ca3[_0xf1c4('0x30')];if(!_0x316048[_0xf1c4('0x31')][_0xf1c4('0x38')](_0xf1c4('0x39'))){_0x30e431[_0xf1c4('0x1f')]=qs[_0xf1c4('0x1f')](_0x316048[_0xf1c4('0x31')][_0xf1c4('0x1f')]);_0x30e431[_0xf1c4('0x1c')]=qs[_0xf1c4('0x1c')](_0x316048[_0xf1c4('0x31')]['offset']);}_0x30e431[_0xf1c4('0x3a')]=qs['sort'](_0x316048[_0xf1c4('0x31')][_0xf1c4('0x3b')]);_0x30e431['where']=qs[_0xf1c4('0x33')](_[_0xf1c4('0x3c')](_0x316048[_0xf1c4('0x31')],_0xf16ca3['filters']),_0x27a683);if(_0x316048['query'][_0xf1c4('0x3d')]){_0x30e431['where']=_['merge'](_0x30e431[_0xf1c4('0x3e')],{'$or':_[_0xf1c4('0x2a')](_0x27a683,function(_0x3aaffc){if(_0x3aaffc[_0xf1c4('0x2e')]!==_0xf1c4('0x3f')){var _0x59fa6a={};_0x59fa6a[_0x3aaffc['name']]={'$like':'%'+_0x316048[_0xf1c4('0x31')][_0xf1c4('0x3d')]+'%'};return _0x59fa6a;}})});}_0x30e431=_[_0xf1c4('0x40')]({},_0x30e431,_0x316048[_0xf1c4('0x41')]);var _0x7f8435={'where':_0x30e431[_0xf1c4('0x3e')]};return db['FreshdeskAccount']['count'](_0x7f8435)[_0xf1c4('0x42')](function(_0x19efb3){_0x2dd8f1['count']=_0x19efb3;if(_0x316048[_0xf1c4('0x31')][_0xf1c4('0x43')]){_0x30e431[_0xf1c4('0x44')]=[{'all':!![]}];}return db[_0xf1c4('0x2b')][_0xf1c4('0x45')](_0x30e431);})[_0xf1c4('0x42')](function(_0x43e76b){_0x2dd8f1[_0xf1c4('0x46')]=_0x43e76b;return _0x2dd8f1;})[_0xf1c4('0x42')](respondWithFilteredResult(_0x1f29fe,_0x30e431))[_0xf1c4('0x47')](handleError(_0x1f29fe,null));};exports[_0xf1c4('0x48')]=function(_0x2a8adc,_0x597f85){var _0x141521={'raw':![],'where':{'id':_0x2a8adc['params']['id']}},_0xa5ec7d={};_0xa5ec7d[_0xf1c4('0x30')]=_['keys'](db[_0xf1c4('0x2b')][_0xf1c4('0x2c')]);_0xa5ec7d[_0xf1c4('0x31')]=_[_0xf1c4('0x32')](_0x2a8adc['query']);_0xa5ec7d[_0xf1c4('0x33')]=_[_0xf1c4('0x34')](_0xa5ec7d[_0xf1c4('0x30')],_0xa5ec7d[_0xf1c4('0x31')]);_0x141521[_0xf1c4('0x35')]=_[_0xf1c4('0x34')](_0xa5ec7d[_0xf1c4('0x30')],qs[_0xf1c4('0x36')](_0x2a8adc['query'][_0xf1c4('0x36')]));_0x141521[_0xf1c4('0x35')]=_0x141521[_0xf1c4('0x35')][_0xf1c4('0x37')]?_0x141521[_0xf1c4('0x35')]:_0xa5ec7d[_0xf1c4('0x30')];if(_0x2a8adc[_0xf1c4('0x31')]['includeAll']){_0x141521['include']=[{'all':!![]}];}_0x141521=_['merge']({},_0x141521,_0x2a8adc['options']);return db[_0xf1c4('0x2b')][_0xf1c4('0x49')](_0x141521)[_0xf1c4('0x42')](handleEntityNotFound(_0x597f85,null))[_0xf1c4('0x42')](respondWithResult(_0x597f85,null))[_0xf1c4('0x47')](handleError(_0x597f85,null));};exports[_0xf1c4('0x4a')]=function(_0x5dd946,_0x26190f){return db[_0xf1c4('0x2b')][_0xf1c4('0x4a')](_0x5dd946['body'],{})[_0xf1c4('0x42')](respondWithResult(_0x26190f,0xc9))['catch'](handleError(_0x26190f,null));};exports[_0xf1c4('0x24')]=function(_0x1e1ba9,_0x2608fa){if(_0x1e1ba9[_0xf1c4('0x4b')]['id']){delete _0x1e1ba9[_0xf1c4('0x4b')]['id'];}return db['FreshdeskAccount'][_0xf1c4('0x49')]({'where':{'id':_0x1e1ba9[_0xf1c4('0x4c')]['id']}})[_0xf1c4('0x42')](handleEntityNotFound(_0x2608fa,null))[_0xf1c4('0x42')](saveUpdates(_0x1e1ba9[_0xf1c4('0x4b')],null))[_0xf1c4('0x42')](respondWithResult(_0x2608fa,null))[_0xf1c4('0x47')](handleError(_0x2608fa,null));};exports['destroy']=function(_0x3fe99e,_0x3af0e6){return db[_0xf1c4('0x2b')][_0xf1c4('0x49')]({'where':{'id':_0x3fe99e[_0xf1c4('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3af0e6,null))[_0xf1c4('0x42')](removeEntity(_0x3af0e6,null))[_0xf1c4('0x47')](handleError(_0x3af0e6,null));};exports[_0xf1c4('0x4d')]=function(_0x6221f7,_0x10b236,_0x5c8a20){var _0x5f18d1={};var _0x51dc38={};var _0x7abf24;var _0x2b5724;return db[_0xf1c4('0x2b')]['findOne']({'where':{'id':_0x6221f7[_0xf1c4('0x4c')]['id']}})[_0xf1c4('0x42')](handleEntityNotFound(_0x10b236,null))['then'](function(_0x41ae12){if(_0x41ae12){_0x7abf24=_0x41ae12;_0x51dc38[_0xf1c4('0x30')]=_[_0xf1c4('0x32')](db['FreshdeskConfiguration'][_0xf1c4('0x2c')]);_0x51dc38[_0xf1c4('0x31')]=_[_0xf1c4('0x32')](_0x6221f7[_0xf1c4('0x31')]);_0x51dc38[_0xf1c4('0x33')]=_['intersection'](_0x51dc38[_0xf1c4('0x30')],_0x51dc38[_0xf1c4('0x31')]);_0x5f18d1['attributes']=_[_0xf1c4('0x34')](_0x51dc38[_0xf1c4('0x30')],qs[_0xf1c4('0x36')](_0x6221f7[_0xf1c4('0x31')][_0xf1c4('0x36')]));_0x5f18d1[_0xf1c4('0x35')]=_0x5f18d1['attributes'][_0xf1c4('0x37')]?_0x5f18d1['attributes']:_0x51dc38[_0xf1c4('0x30')];_0x5f18d1['order']=qs[_0xf1c4('0x3b')](_0x6221f7[_0xf1c4('0x31')]['sort']);_0x5f18d1[_0xf1c4('0x3e')]=qs[_0xf1c4('0x33')](_[_0xf1c4('0x3c')](_0x6221f7[_0xf1c4('0x31')],_0x51dc38[_0xf1c4('0x33')]));if(_0x6221f7[_0xf1c4('0x31')][_0xf1c4('0x3d')]){_0x5f18d1[_0xf1c4('0x3e')]=_[_0xf1c4('0x40')](_0x5f18d1[_0xf1c4('0x3e')],{'$or':_['map'](_0x5f18d1[_0xf1c4('0x35')],function(_0xb79c18){var _0x52bb8c={};_0x52bb8c[_0xb79c18]={'$like':'%'+_0x6221f7['query']['filter']+'%'};return _0x52bb8c;})});}_0x5f18d1=_[_0xf1c4('0x40')]({},_0x5f18d1,_0x6221f7[_0xf1c4('0x41')]);return _0x7abf24[_0xf1c4('0x4d')](_0x5f18d1);}})['then'](function(_0x35e00d){if(_0x35e00d){_0x2b5724=_0x35e00d['length'];if(!_0x6221f7[_0xf1c4('0x31')][_0xf1c4('0x38')](_0xf1c4('0x39'))){_0x5f18d1[_0xf1c4('0x1f')]=qs[_0xf1c4('0x1f')](_0x6221f7[_0xf1c4('0x31')][_0xf1c4('0x1f')]);_0x5f18d1[_0xf1c4('0x1c')]=qs[_0xf1c4('0x1c')](_0x6221f7[_0xf1c4('0x31')][_0xf1c4('0x1c')]);}return _0x7abf24[_0xf1c4('0x4d')](_0x5f18d1);}})[_0xf1c4('0x42')](function(_0xd5e3b7){if(_0xd5e3b7){return _0xd5e3b7?{'count':_0x2b5724,'rows':_0xd5e3b7}:null;}})[_0xf1c4('0x42')](respondWithResult(_0x10b236,null))['catch'](handleError(_0x10b236,null));};exports[_0xf1c4('0x4e')]=function(_0x26728c,_0x561937,_0x30e82a){if(_0x26728c['body']['id']){delete _0x26728c['body']['id'];}return db[_0xf1c4('0x2b')]['findOne']({'where':{'id':_0x26728c[_0xf1c4('0x4c')]['id']}})[_0xf1c4('0x42')](handleEntityNotFound(_0x561937,null))['then'](function(_0x1cb71f){if(_0x1cb71f){_0x26728c[_0xf1c4('0x4b')][_0xf1c4('0x4f')]=_0x1cb71f['id'];_0x26728c['body']['Subjects']=integrations['getSubjects'](_0x26728c[_0xf1c4('0x4b')]['channel'],_0x26728c['body'][_0xf1c4('0x2e')]);_0x26728c[_0xf1c4('0x4b')][_0xf1c4('0x50')]=integrations[_0xf1c4('0x51')](_0x26728c[_0xf1c4('0x4b')]['channel'],_0x26728c[_0xf1c4('0x4b')]['type']);return db[_0xf1c4('0x52')][_0xf1c4('0x4a')](_0x26728c['body'],{'include':[{'model':db[_0xf1c4('0x53')],'as':_0xf1c4('0x54')},{'model':db[_0xf1c4('0x53')],'as':_0xf1c4('0x50')}]});}return null;})[_0xf1c4('0x42')](respondWithResult(_0x561937,null))['catch'](handleError(_0x561937,null));};exports[_0xf1c4('0x55')]=function(_0x1a5d33,_0x118b37,_0x534029){var _0x43bda5='';return db['FreshdeskAccount'][_0xf1c4('0x56')]({'where':{'id':_0x1a5d33[_0xf1c4('0x4c')]['id']},'attributes':['id',_0xf1c4('0x57'),_0xf1c4('0x58')]})[_0xf1c4('0x42')](handleEntityNotFound(_0x118b37,null))['then'](function(_0x48160f){if(_0x48160f){_0x43bda5=_0x48160f[_0xf1c4('0x57')];var _0x2eeaae=_0x43bda5['slice'](-0x1);if(_0x2eeaae==='/'){_0x43bda5=_0x43bda5[_0xf1c4('0x59')](0x0,_0x43bda5[_0xf1c4('0x5a')](_0x2eeaae));}return rp({'method':'GET','uri':util[_0xf1c4('0x5b')](_0xf1c4('0x5c'),_0x43bda5,_0xf1c4('0x5d')),'headers':{'Authorization':util[_0xf1c4('0x5b')](_0xf1c4('0x5e'),new Buffer(util[_0xf1c4('0x5b')](_0xf1c4('0x5f'),_0x48160f[_0xf1c4('0x58')]))[_0xf1c4('0x60')](_0xf1c4('0x61')))},'json':!![]});}})[_0xf1c4('0x42')](function(_0x594687){if(_0x594687){var _0x5d1fcb=[_0xf1c4('0x62'),_0xf1c4('0x63'),_0xf1c4('0x64'),_0xf1c4('0x65'),_0xf1c4('0x1a'),_0xf1c4('0x66'),_0xf1c4('0x67'),_0xf1c4('0x68'),'ticket_type',_0xf1c4('0x67'),_0xf1c4('0x69')];_[_0xf1c4('0x6a')](_0x594687,function(_0x2d79e5){return _0x5d1fcb['includes'](_0x2d79e5[_0xf1c4('0x29')])||!_0x2d79e5[_0xf1c4('0x6b')]&&_0x2d79e5[_0xf1c4('0x2e')]!==_0xf1c4('0x6c')&&_0x2d79e5['type']!=='custom_dropdown';});return{'count':_0x594687[_0xf1c4('0x37')],'rows':_[_0xf1c4('0x2a')](_0x594687,function(_0x36afb0){return{'id':_0x36afb0['name'],'name':_0x36afb0[_0xf1c4('0x6d')],'custom':!_0x36afb0[_0xf1c4('0x6b')],'options':_0x36afb0[_0xf1c4('0x6e')]?_[_0xf1c4('0x2a')](_0x36afb0[_0xf1c4('0x6e')],function(_0x2c4c06){return{'name':_[_0xf1c4('0x6f')](_0x2c4c06),'value':_0x2c4c06};}):[]};})};}})[_0xf1c4('0x42')](respondWithResult(_0x118b37,null))['catch'](function(_0x1e8659){var _0x2da798=_0x1a5d33[_0xf1c4('0x31')]['test']?0x1f4:_0x1e8659[_0xf1c4('0x70')]||0x1f4;logger[_0xf1c4('0x27')](_0xf1c4('0x71'),_0xf1c4('0x55'),_0x2da798,JSON[_0xf1c4('0x72')](_0x1e8659));delete _0x1e8659[_0xf1c4('0x29')];if(_0x2da798===0x191){_0x2da798=0x190;}_0x118b37[_0xf1c4('0x1a')](_0x2da798)[_0xf1c4('0x73')](_0x1a5d33[_0xf1c4('0x31')]['test']?{'message':_0xf1c4('0x74'),'statusCode':_0x1e8659['statusCode']}:_0x1e8659);});}; \ No newline at end of file +var _0xd84c=['toString','base64','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','label','choices','capitalize','test','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getConfigurations','FreshdeskConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','slice','lastIndexOf','GET','format','%s:X','apiKey'];(function(_0xca1585,_0x219dfb){var _0x117736=function(_0x386c85){while(--_0x386c85){_0xca1585['push'](_0xca1585['shift']());}};_0x117736(++_0x219dfb);}(_0xd84c,0x102));var _0xcd84=function(_0x599c60,_0x344f68){_0x599c60=_0x599c60-0x0;var _0x5275c2=_0xd84c[_0x599c60];return _0x5275c2;};'use strict';var emlformat=require(_0xcd84('0x0'));var rimraf=require(_0xcd84('0x1'));var zipdir=require(_0xcd84('0x2'));var jsonpatch=require(_0xcd84('0x3'));var rp=require(_0xcd84('0x4'));var moment=require(_0xcd84('0x5'));var BPromise=require(_0xcd84('0x6'));var Mustache=require(_0xcd84('0x7'));var util=require(_0xcd84('0x8'));var path=require('path');var sox=require(_0xcd84('0x9'));var csv=require(_0xcd84('0xa'));var ejs=require(_0xcd84('0xb'));var fs=require('fs');var fs_extra=require(_0xcd84('0xc'));var _=require('lodash');var squel=require(_0xcd84('0xd'));var crypto=require(_0xcd84('0xe'));var jsforce=require(_0xcd84('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcd84('0xa'));var querystring=require(_0xcd84('0x10'));var Papa=require(_0xcd84('0x11'));var Redis=require(_0xcd84('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcd84('0x13'));var as=require(_0xcd84('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd84('0x15'))(_0xcd84('0x16'));var utils=require(_0xcd84('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcd84('0x18'));var db=require(_0xcd84('0x19'))['db'];var integrations=require(_0xcd84('0x1a'));function respondWithStatusCode(_0x116423,_0x4e1291){_0x4e1291=_0x4e1291||0xcc;return function(_0x222303){if(_0x222303){return _0x116423[_0xcd84('0x1b')](_0x4e1291);}return _0x116423[_0xcd84('0x1c')](_0x4e1291)[_0xcd84('0x1d')]();};}function respondWithResult(_0x1271b4,_0x100a7b){_0x100a7b=_0x100a7b||0xc8;return function(_0xea177a){if(_0xea177a){return _0x1271b4[_0xcd84('0x1c')](_0x100a7b)[_0xcd84('0x1e')](_0xea177a);}};}function respondWithFilteredResult(_0x45a92e,_0x223127){return function(_0x23b116){if(_0x23b116){var _0x1bd068=typeof _0x223127[_0xcd84('0x1f')]===_0xcd84('0x20')&&typeof _0x223127[_0xcd84('0x21')]===_0xcd84('0x20');var _0x9ddd5d=_0x23b116['count'];var _0x3c2d33=_0x1bd068?0x0:_0x223127[_0xcd84('0x1f')];var _0x4c9509=_0x1bd068?_0x23b116[_0xcd84('0x22')]:_0x223127[_0xcd84('0x1f')]+_0x223127[_0xcd84('0x21')];var _0xb4f1ee;if(_0x4c9509>=_0x9ddd5d){_0x4c9509=_0x9ddd5d;_0xb4f1ee=0xc8;}else{_0xb4f1ee=0xce;}_0x45a92e[_0xcd84('0x1c')](_0xb4f1ee);return _0x45a92e['set'](_0xcd84('0x23'),_0x3c2d33+'-'+_0x4c9509+'/'+_0x9ddd5d)[_0xcd84('0x1e')](_0x23b116);}return null;};}function patchUpdates(_0x225e15){return function(_0x53f8a0){try{jsonpatch['apply'](_0x53f8a0,_0x225e15,!![]);}catch(_0x98bf1f){return BPromise['reject'](_0x98bf1f);}return _0x53f8a0[_0xcd84('0x24')]();};}function saveUpdates(_0x20b0ce,_0x5cb006){return function(_0x454586){if(_0x454586){return _0x454586[_0xcd84('0x25')](_0x20b0ce)[_0xcd84('0x26')](function(_0x13996e){return _0x13996e;});}return null;};}function removeEntity(_0x14cf35,_0xfc2a17){return function(_0x49f7e8){if(_0x49f7e8){return _0x49f7e8[_0xcd84('0x27')]()[_0xcd84('0x26')](function(){_0x14cf35[_0xcd84('0x1c')](0xcc)[_0xcd84('0x1d')]();});}};}function handleEntityNotFound(_0x243368,_0x40d00a){return function(_0x5af4b9){if(!_0x5af4b9){_0x243368['sendStatus'](0x194);}return _0x5af4b9;};}function handleError(_0x5d610b,_0x1967f6){_0x1967f6=_0x1967f6||0x1f4;return function(_0x5c46c7){logger['error'](_0x5c46c7['stack']);if(_0x5c46c7[_0xcd84('0x28')]){delete _0x5c46c7[_0xcd84('0x28')];}_0x5d610b['status'](_0x1967f6)[_0xcd84('0x29')](_0x5c46c7);};}exports[_0xcd84('0x2a')]=function(_0x1f75ac,_0x5661a4){var _0x33fc4f={},_0x5d4bff={},_0x288cdd={'count':0x0,'rows':[]};var _0x71d465=_[_0xcd84('0x2b')](db[_0xcd84('0x2c')][_0xcd84('0x2d')],function(_0x3f10b1){return{'name':_0x3f10b1[_0xcd84('0x2e')],'type':_0x3f10b1[_0xcd84('0x2f')][_0xcd84('0x30')]};});_0x5d4bff[_0xcd84('0x31')]=_[_0xcd84('0x2b')](_0x71d465,_0xcd84('0x28'));_0x5d4bff['query']=_[_0xcd84('0x32')](_0x1f75ac[_0xcd84('0x33')]);_0x5d4bff[_0xcd84('0x34')]=_[_0xcd84('0x35')](_0x5d4bff['model'],_0x5d4bff[_0xcd84('0x33')]);_0x33fc4f[_0xcd84('0x36')]=_[_0xcd84('0x35')](_0x5d4bff[_0xcd84('0x31')],qs[_0xcd84('0x37')](_0x1f75ac['query'][_0xcd84('0x37')]));_0x33fc4f[_0xcd84('0x36')]=_0x33fc4f[_0xcd84('0x36')][_0xcd84('0x38')]?_0x33fc4f[_0xcd84('0x36')]:_0x5d4bff[_0xcd84('0x31')];if(!_0x1f75ac[_0xcd84('0x33')]['hasOwnProperty'](_0xcd84('0x39'))){_0x33fc4f[_0xcd84('0x21')]=qs['limit'](_0x1f75ac[_0xcd84('0x33')]['limit']);_0x33fc4f[_0xcd84('0x1f')]=qs[_0xcd84('0x1f')](_0x1f75ac[_0xcd84('0x33')][_0xcd84('0x1f')]);}_0x33fc4f[_0xcd84('0x3a')]=qs[_0xcd84('0x3b')](_0x1f75ac[_0xcd84('0x33')][_0xcd84('0x3b')]);_0x33fc4f[_0xcd84('0x3c')]=qs[_0xcd84('0x34')](_[_0xcd84('0x3d')](_0x1f75ac[_0xcd84('0x33')],_0x5d4bff[_0xcd84('0x34')]),_0x71d465);if(_0x1f75ac[_0xcd84('0x33')][_0xcd84('0x3e')]){_0x33fc4f['where']=_[_0xcd84('0x3f')](_0x33fc4f['where'],{'$or':_['map'](_0x71d465,function(_0xa8f23e){if(_0xa8f23e[_0xcd84('0x2f')]!==_0xcd84('0x40')){var _0x4d69b={};_0x4d69b[_0xa8f23e['name']]={'$like':'%'+_0x1f75ac['query'][_0xcd84('0x3e')]+'%'};return _0x4d69b;}})});}_0x33fc4f=_['merge']({},_0x33fc4f,_0x1f75ac[_0xcd84('0x41')]);var _0x40c5a7={'where':_0x33fc4f['where']};return db[_0xcd84('0x2c')]['count'](_0x40c5a7)[_0xcd84('0x26')](function(_0x1ccee1){_0x288cdd[_0xcd84('0x22')]=_0x1ccee1;if(_0x1f75ac['query']['includeAll']){_0x33fc4f[_0xcd84('0x42')]=[{'all':!![]}];}return db[_0xcd84('0x2c')][_0xcd84('0x43')](_0x33fc4f);})[_0xcd84('0x26')](function(_0x4c119c){_0x288cdd[_0xcd84('0x44')]=_0x4c119c;return _0x288cdd;})[_0xcd84('0x26')](respondWithFilteredResult(_0x5661a4,_0x33fc4f))[_0xcd84('0x45')](handleError(_0x5661a4,null));};exports[_0xcd84('0x46')]=function(_0x3fc17d,_0x1254cd){var _0x38d17d={'raw':![],'where':{'id':_0x3fc17d[_0xcd84('0x47')]['id']}},_0xabfe95={};_0xabfe95['model']=_[_0xcd84('0x32')](db['FreshdeskAccount'][_0xcd84('0x2d')]);_0xabfe95['query']=_[_0xcd84('0x32')](_0x3fc17d[_0xcd84('0x33')]);_0xabfe95['filters']=_['intersection'](_0xabfe95[_0xcd84('0x31')],_0xabfe95[_0xcd84('0x33')]);_0x38d17d[_0xcd84('0x36')]=_['intersection'](_0xabfe95['model'],qs[_0xcd84('0x37')](_0x3fc17d['query'][_0xcd84('0x37')]));_0x38d17d[_0xcd84('0x36')]=_0x38d17d['attributes'][_0xcd84('0x38')]?_0x38d17d[_0xcd84('0x36')]:_0xabfe95['model'];if(_0x3fc17d[_0xcd84('0x33')][_0xcd84('0x48')]){_0x38d17d[_0xcd84('0x42')]=[{'all':!![]}];}_0x38d17d=_['merge']({},_0x38d17d,_0x3fc17d['options']);return db['FreshdeskAccount'][_0xcd84('0x49')](_0x38d17d)[_0xcd84('0x26')](handleEntityNotFound(_0x1254cd,null))[_0xcd84('0x26')](respondWithResult(_0x1254cd,null))[_0xcd84('0x45')](handleError(_0x1254cd,null));};exports[_0xcd84('0x4a')]=function(_0x5d44ff,_0x4da28d){return db[_0xcd84('0x2c')][_0xcd84('0x4a')](_0x5d44ff['body'],{})['then'](respondWithResult(_0x4da28d,0xc9))[_0xcd84('0x45')](handleError(_0x4da28d,null));};exports[_0xcd84('0x25')]=function(_0x1b3ee1,_0x13bcc8){if(_0x1b3ee1[_0xcd84('0x4b')]['id']){delete _0x1b3ee1[_0xcd84('0x4b')]['id'];}return db[_0xcd84('0x2c')][_0xcd84('0x49')]({'where':{'id':_0x1b3ee1[_0xcd84('0x47')]['id']}})[_0xcd84('0x26')](handleEntityNotFound(_0x13bcc8,null))[_0xcd84('0x26')](saveUpdates(_0x1b3ee1['body'],null))[_0xcd84('0x26')](respondWithResult(_0x13bcc8,null))['catch'](handleError(_0x13bcc8,null));};exports[_0xcd84('0x27')]=function(_0x4c50df,_0x1e131a){return db['FreshdeskAccount'][_0xcd84('0x49')]({'where':{'id':_0x4c50df['params']['id']}})[_0xcd84('0x26')](handleEntityNotFound(_0x1e131a,null))[_0xcd84('0x26')](removeEntity(_0x1e131a,null))['catch'](handleError(_0x1e131a,null));};exports[_0xcd84('0x4c')]=function(_0x268fe5,_0x216c9,_0x5a3496){var _0x4c6c46={};var _0x402595={};var _0x3899dc;var _0x4f8e02;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x268fe5['params']['id']}})[_0xcd84('0x26')](handleEntityNotFound(_0x216c9,null))[_0xcd84('0x26')](function(_0x8ae28f){if(_0x8ae28f){_0x3899dc=_0x8ae28f;_0x402595['model']=_[_0xcd84('0x32')](db[_0xcd84('0x4d')][_0xcd84('0x2d')]);_0x402595[_0xcd84('0x33')]=_[_0xcd84('0x32')](_0x268fe5[_0xcd84('0x33')]);_0x402595[_0xcd84('0x34')]=_[_0xcd84('0x35')](_0x402595[_0xcd84('0x31')],_0x402595[_0xcd84('0x33')]);_0x4c6c46[_0xcd84('0x36')]=_[_0xcd84('0x35')](_0x402595[_0xcd84('0x31')],qs[_0xcd84('0x37')](_0x268fe5[_0xcd84('0x33')][_0xcd84('0x37')]));_0x4c6c46[_0xcd84('0x36')]=_0x4c6c46[_0xcd84('0x36')][_0xcd84('0x38')]?_0x4c6c46['attributes']:_0x402595[_0xcd84('0x31')];_0x4c6c46[_0xcd84('0x3a')]=qs[_0xcd84('0x3b')](_0x268fe5['query'][_0xcd84('0x3b')]);_0x4c6c46[_0xcd84('0x3c')]=qs[_0xcd84('0x34')](_[_0xcd84('0x3d')](_0x268fe5[_0xcd84('0x33')],_0x402595['filters']));if(_0x268fe5[_0xcd84('0x33')][_0xcd84('0x3e')]){_0x4c6c46[_0xcd84('0x3c')]=_[_0xcd84('0x3f')](_0x4c6c46[_0xcd84('0x3c')],{'$or':_['map'](_0x4c6c46[_0xcd84('0x36')],function(_0x325da1){var _0x452329={};_0x452329[_0x325da1]={'$like':'%'+_0x268fe5['query'][_0xcd84('0x3e')]+'%'};return _0x452329;})});}_0x4c6c46=_[_0xcd84('0x3f')]({},_0x4c6c46,_0x268fe5[_0xcd84('0x41')]);return _0x3899dc['getConfigurations'](_0x4c6c46);}})[_0xcd84('0x26')](function(_0x504918){if(_0x504918){_0x4f8e02=_0x504918[_0xcd84('0x38')];if(!_0x268fe5[_0xcd84('0x33')][_0xcd84('0x4e')]('nolimit')){_0x4c6c46[_0xcd84('0x21')]=qs[_0xcd84('0x21')](_0x268fe5[_0xcd84('0x33')][_0xcd84('0x21')]);_0x4c6c46[_0xcd84('0x1f')]=qs[_0xcd84('0x1f')](_0x268fe5['query']['offset']);}return _0x3899dc['getConfigurations'](_0x4c6c46);}})[_0xcd84('0x26')](function(_0x387c8f){if(_0x387c8f){return _0x387c8f?{'count':_0x4f8e02,'rows':_0x387c8f}:null;}})[_0xcd84('0x26')](respondWithResult(_0x216c9,null))[_0xcd84('0x45')](handleError(_0x216c9,null));};exports[_0xcd84('0x4f')]=function(_0x4ab032,_0x4e4f10,_0x58cdfd){if(_0x4ab032[_0xcd84('0x4b')]['id']){delete _0x4ab032[_0xcd84('0x4b')]['id'];}return db[_0xcd84('0x2c')][_0xcd84('0x50')]({'where':{'id':_0x4ab032[_0xcd84('0x47')]['id']}})['then'](handleEntityNotFound(_0x4e4f10,null))['then'](function(_0xcc39ca){if(_0xcc39ca){_0x4ab032[_0xcd84('0x4b')][_0xcd84('0x51')]=_0xcc39ca['id'];_0x4ab032[_0xcd84('0x4b')][_0xcd84('0x52')]=integrations[_0xcd84('0x53')](_0x4ab032[_0xcd84('0x4b')][_0xcd84('0x54')],_0x4ab032[_0xcd84('0x4b')][_0xcd84('0x2f')]);_0x4ab032['body'][_0xcd84('0x55')]=integrations[_0xcd84('0x56')](_0x4ab032['body'][_0xcd84('0x54')],_0x4ab032[_0xcd84('0x4b')][_0xcd84('0x2f')]);return db[_0xcd84('0x4d')][_0xcd84('0x4a')](_0x4ab032[_0xcd84('0x4b')],{'include':[{'model':db[_0xcd84('0x57')],'as':_0xcd84('0x52')},{'model':db[_0xcd84('0x57')],'as':_0xcd84('0x55')}]});}return null;})[_0xcd84('0x26')](respondWithResult(_0x4e4f10,null))[_0xcd84('0x45')](handleError(_0x4e4f10,null));};exports[_0xcd84('0x58')]=function(_0x4e8536,_0x4b476e,_0x300cf7){var _0x273be1='';return db['FreshdeskAccount'][_0xcd84('0x50')]({'where':{'id':_0x4e8536[_0xcd84('0x47')]['id']},'attributes':['id',_0xcd84('0x59'),'apiKey']})['then'](handleEntityNotFound(_0x4b476e,null))['then'](function(_0x165a66){if(_0x165a66){_0x273be1=_0x165a66[_0xcd84('0x59')];var _0x1b7464=_0x273be1[_0xcd84('0x5a')](-0x1);if(_0x1b7464==='/'){_0x273be1=_0x273be1['substring'](0x0,_0x273be1[_0xcd84('0x5b')](_0x1b7464));}return rp({'method':_0xcd84('0x5c'),'uri':util['format']('%s/%s',_0x273be1,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xcd84('0x5d')]('Basic\x20%s',new Buffer(util[_0xcd84('0x5d')](_0xcd84('0x5e'),_0x165a66[_0xcd84('0x5f')]))[_0xcd84('0x60')](_0xcd84('0x61')))},'json':!![]});}})[_0xcd84('0x26')](function(_0xcf40cb){if(_0xcf40cb){var _0x1208d5=['requester',_0xcd84('0x62'),_0xcd84('0x63'),_0xcd84('0x64'),_0xcd84('0x1c'),_0xcd84('0x65'),_0xcd84('0x66'),_0xcd84('0x67'),_0xcd84('0x68'),_0xcd84('0x66'),_0xcd84('0x69')];_[_0xcd84('0x6a')](_0xcf40cb,function(_0x1bbcbf){return _0x1208d5[_0xcd84('0x6b')](_0x1bbcbf[_0xcd84('0x28')])||!_0x1bbcbf[_0xcd84('0x6c')]&&_0x1bbcbf[_0xcd84('0x2f')]!==_0xcd84('0x6d')&&_0x1bbcbf[_0xcd84('0x2f')]!=='custom_dropdown';});return{'count':_0xcf40cb['length'],'rows':_[_0xcd84('0x2b')](_0xcf40cb,function(_0xe94bff){return{'id':_0xe94bff['name'],'name':_0xe94bff[_0xcd84('0x6e')],'custom':!_0xe94bff[_0xcd84('0x6c')],'options':_0xe94bff[_0xcd84('0x6f')]?_[_0xcd84('0x2b')](_0xe94bff['choices'],function(_0x187057){return{'name':_[_0xcd84('0x70')](_0x187057),'value':_0x187057};}):[]};})};}})[_0xcd84('0x26')](respondWithResult(_0x4b476e,null))[_0xcd84('0x45')](function(_0x1b825f){var _0x43df4d=_0x4e8536['query'][_0xcd84('0x71')]?0x1f4:_0x1b825f['statusCode']||0x1f4;logger[_0xcd84('0x72')](_0xcd84('0x73'),_0xcd84('0x58'),_0x43df4d,JSON['stringify'](_0x1b825f));delete _0x1b825f['name'];if(_0x43df4d===0x191){_0x43df4d=0x190;}_0x4b476e['status'](_0x43df4d)['send'](_0x4e8536[_0xcd84('0x33')][_0xcd84('0x71')]?{'message':_0xcd84('0x74'),'statusCode':_0x1b825f[_0xcd84('0x75')]}:_0x1b825f);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 8fa30a4..61f397b 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 _0xc1df=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash'];(function(_0x5a681f,_0x313c4e){var _0x3d7241=function(_0x574648){while(--_0x574648){_0x5a681f['push'](_0x5a681f['shift']());}};_0x3d7241(++_0x313c4e);}(_0xc1df,0xa4));var _0xfc1d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc1df[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xfc1d('0x0'));var util=require(_0xfc1d('0x1'));var logger=require(_0xfc1d('0x2'))(_0xfc1d('0x3'));var moment=require(_0xfc1d('0x4'));var BPromise=require(_0xfc1d('0x5'));var rp=require(_0xfc1d('0x6'));var fs=require('fs');var path=require(_0xfc1d('0x7'));var rimraf=require('rimraf');var config=require(_0xfc1d('0x8'));var attributes=require(_0xfc1d('0x9'));var integrations=require(_0xfc1d('0xa'));module[_0xfc1d('0xb')]=function(_0xe24a5,_0x314ee9){return _0xe24a5[_0xfc1d('0xc')](_0xfc1d('0xd'),attributes,{'tableName':_0xfc1d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ad=['request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5ce781,_0x736b15){var _0xa70499=function(_0x48558b){while(--_0x48558b){_0x5ce781['push'](_0x5ce781['shift']());}};_0xa70499(++_0x736b15);}(_0x46ad,0x19e));var _0xd46a=function(_0x26de98,_0x558653){_0x26de98=_0x26de98-0x0;var _0x1de3aa=_0x46ad[_0x26de98];return _0x1de3aa;};'use strict';var _=require(_0xd46a('0x0'));var util=require(_0xd46a('0x1'));var logger=require(_0xd46a('0x2'))(_0xd46a('0x3'));var moment=require(_0xd46a('0x4'));var BPromise=require(_0xd46a('0x5'));var rp=require(_0xd46a('0x6'));var fs=require('fs');var path=require(_0xd46a('0x7'));var rimraf=require(_0xd46a('0x8'));var config=require(_0xd46a('0x9'));var attributes=require(_0xd46a('0xa'));var integrations=require(_0xd46a('0xb'));module[_0xd46a('0xc')]=function(_0x33970c,_0x4adcec){return _0x33970c[_0xd46a('0xd')](_0xd46a('0xe'),attributes,{'tableName':'int_freshdesk_accounts','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 49c35f1..bb38c86 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 _0xbe43=['error','message','result','catch','GetFreshdeskAccount','findAll','options','attributes','map','include','model','ShowFreshdeskAccount','find','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xbe43,0xbb));var _0x3be4=function(_0x19a6e6,_0x2d7474){_0x19a6e6=_0x19a6e6-0x0;var _0x28ab2f=_0xbe43[_0x19a6e6];return _0x28ab2f;};'use strict';var _=require(_0x3be4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3be4('0x1'));var fs=require('fs');var Redis=require(_0x3be4('0x2'));var db=require(_0x3be4('0x3'))['db'];var utils=require(_0x3be4('0x4'));var logger=require(_0x3be4('0x5'))('rpc');var config=require(_0x3be4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3be4('0x7')][_0x3be4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13ddd5,_0x5ea4da,_0x49d81b){return new BPromise(function(_0x184d63,_0x33cca6){return client[_0x3be4('0x9')](_0x13ddd5,_0x49d81b)[_0x3be4('0xa')](function(_0x49b887){logger[_0x3be4('0xb')](_0x3be4('0xc'),_0x5ea4da,'request\x20sent');logger[_0x3be4('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x5ea4da,_0x3be4('0xe'),JSON[_0x3be4('0xf')](_0x49b887));if(_0x49b887['error']){if(_0x49b887[_0x3be4('0x10')]['code']===0x1f4){logger[_0x3be4('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x5ea4da,_0x49b887[_0x3be4('0x10')][_0x3be4('0x11')]);return _0x33cca6(_0x49b887[_0x3be4('0x10')][_0x3be4('0x11')]);}logger[_0x3be4('0x10')](_0x3be4('0xc'),_0x5ea4da,_0x49b887['error'][_0x3be4('0x11')]);return _0x184d63(_0x49b887[_0x3be4('0x10')]['message']);}else{logger[_0x3be4('0xb')](_0x3be4('0xc'),_0x5ea4da,'request\x20sent');_0x184d63(_0x49b887[_0x3be4('0x12')]['message']);}})[_0x3be4('0x13')](function(_0x4b50ad){logger[_0x3be4('0x10')](_0x3be4('0xc'),_0x5ea4da,_0x4b50ad);_0x33cca6(_0x4b50ad);});});}exports[_0x3be4('0x14')]=function(_0x2a65e1){var _0x15dd05=this;return new Promise(function(_0x20dbca,_0x546e75){return db['FreshdeskAccount'][_0x3be4('0x15')]({'raw':_0x2a65e1[_0x3be4('0x16')]?_0x2a65e1['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a65e1['options']?_0x2a65e1[_0x3be4('0x16')]['where']||null:null,'attributes':_0x2a65e1['options']?_0x2a65e1[_0x3be4('0x16')][_0x3be4('0x17')]||null:null,'limit':_0x2a65e1[_0x3be4('0x16')]?_0x2a65e1[_0x3be4('0x16')]['limit']||null:null,'include':_0x2a65e1['options']?_0x2a65e1['options']['include']?_[_0x3be4('0x18')](_0x2a65e1[_0x3be4('0x16')][_0x3be4('0x19')],function(_0x46fca1){return{'model':db[_0x46fca1[_0x3be4('0x1a')]],'as':_0x46fca1['as'],'attributes':_0x46fca1['attributes'],'include':_0x46fca1[_0x3be4('0x19')]?_[_0x3be4('0x18')](_0x46fca1['include'],function(_0xdb43e9){return{'model':db[_0xdb43e9[_0x3be4('0x1a')]],'as':_0xdb43e9['as'],'attributes':_0xdb43e9['attributes'],'include':_0xdb43e9[_0x3be4('0x19')]?_[_0x3be4('0x18')](_0xdb43e9[_0x3be4('0x19')],function(_0x7bb2e4){return{'model':db[_0x7bb2e4[_0x3be4('0x1a')]],'as':_0x7bb2e4['as'],'attributes':_0x7bb2e4[_0x3be4('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3be4('0xa')](function(_0x14b946){logger[_0x3be4('0xb')]('GetFreshdeskAccount',_0x2a65e1);logger[_0x3be4('0xd')]('GetFreshdeskAccount',_0x2a65e1,JSON[_0x3be4('0xf')](_0x14b946));_0x20dbca(_0x14b946);})[_0x3be4('0x13')](function(_0x34ceea){logger[_0x3be4('0x10')](_0x3be4('0x14'),_0x34ceea[_0x3be4('0x11')],_0x2a65e1);_0x546e75(_0x15dd05[_0x3be4('0x10')](0x1f4,_0x34ceea[_0x3be4('0x11')]));});});};exports[_0x3be4('0x1b')]=function(_0x2cfcda){var _0x27850e=this;return new Promise(function(_0x1c4a21,_0x4180fb){return db['FreshdeskAccount'][_0x3be4('0x1c')]({'raw':_0x2cfcda['options']?_0x2cfcda[_0x3be4('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2cfcda[_0x3be4('0x16')]?_0x2cfcda['options']['where']||null:null,'attributes':_0x2cfcda[_0x3be4('0x16')]?_0x2cfcda['options'][_0x3be4('0x17')]||null:null,'include':_0x2cfcda[_0x3be4('0x16')]?_0x2cfcda['options'][_0x3be4('0x19')]?_[_0x3be4('0x18')](_0x2cfcda[_0x3be4('0x16')][_0x3be4('0x19')],function(_0x4c1533){return{'model':db[_0x4c1533[_0x3be4('0x1a')]],'as':_0x4c1533['as'],'attributes':_0x4c1533[_0x3be4('0x17')],'include':_0x4c1533['include']?_['map'](_0x4c1533['include'],function(_0x3425e5){return{'model':db[_0x3425e5[_0x3be4('0x1a')]],'as':_0x3425e5['as'],'attributes':_0x3425e5[_0x3be4('0x17')],'include':_0x3425e5[_0x3be4('0x19')]?_[_0x3be4('0x18')](_0x3425e5[_0x3be4('0x19')],function(_0x43220e){return{'model':db[_0x43220e[_0x3be4('0x1a')]],'as':_0x43220e['as'],'attributes':_0x43220e[_0x3be4('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3be4('0xa')](function(_0x3515d6){logger['info'](_0x3be4('0x1b'),_0x2cfcda);logger[_0x3be4('0xd')](_0x3be4('0x1b'),_0x2cfcda,JSON[_0x3be4('0xf')](_0x3515d6));_0x1c4a21(_0x3515d6);})[_0x3be4('0x13')](function(_0x34db42){logger['error'](_0x3be4('0x1b'),_0x34db42[_0x3be4('0x11')],_0x2cfcda);_0x4180fb(_0x27850e['error'](0x1f4,_0x34db42[_0x3be4('0x11')]));});});}; \ No newline at end of file +var _0xb9b3=['FreshdeskAccount','options','raw','where','attributes','limit','include','model','map','then','stringify','catch','ShowFreshdeskAccount','find','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshdeskAccount'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb9b3,0x1a6));var _0x3b9b=function(_0x413e7f,_0x908f1b){_0x413e7f=_0x413e7f-0x0;var _0x4b9b88=_0xb9b3[_0x413e7f];return _0x4b9b88;};'use strict';var _=require(_0x3b9b('0x0'));var util=require(_0x3b9b('0x1'));var moment=require('moment');var BPromise=require(_0x3b9b('0x2'));var rs=require(_0x3b9b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b9b('0x4'));var logger=require(_0x3b9b('0x5'))(_0x3b9b('0x6'));var config=require(_0x3b9b('0x7'));var jayson=require(_0x3b9b('0x8'));var client=jayson['client'][_0x3b9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58a355,_0x1b34b5,_0x3cd0eb){return new BPromise(function(_0x3269c5,_0x560a21){return client[_0x3b9b('0xa')](_0x58a355,_0x3cd0eb)['then'](function(_0x51e228){logger[_0x3b9b('0xb')](_0x3b9b('0xc'),_0x1b34b5,_0x3b9b('0xd'));logger['debug'](_0x3b9b('0xe'),_0x1b34b5,_0x3b9b('0xd'),JSON['stringify'](_0x51e228));if(_0x51e228['error']){if(_0x51e228[_0x3b9b('0xf')][_0x3b9b('0x10')]===0x1f4){logger[_0x3b9b('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x1b34b5,_0x51e228[_0x3b9b('0xf')][_0x3b9b('0x11')]);return _0x560a21(_0x51e228[_0x3b9b('0xf')][_0x3b9b('0x11')]);}logger[_0x3b9b('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x1b34b5,_0x51e228[_0x3b9b('0xf')]['message']);return _0x3269c5(_0x51e228[_0x3b9b('0xf')][_0x3b9b('0x11')]);}else{logger[_0x3b9b('0xb')](_0x3b9b('0xc'),_0x1b34b5,'request\x20sent');_0x3269c5(_0x51e228[_0x3b9b('0x12')][_0x3b9b('0x11')]);}})['catch'](function(_0xe43335){logger[_0x3b9b('0xf')](_0x3b9b('0xc'),_0x1b34b5,_0xe43335);_0x560a21(_0xe43335);});});}exports[_0x3b9b('0x13')]=function(_0xb98c02){var _0x28a2f3=this;return new Promise(function(_0x1b1c71,_0x21da71){return db[_0x3b9b('0x14')]['findAll']({'raw':_0xb98c02[_0x3b9b('0x15')]?_0xb98c02[_0x3b9b('0x15')][_0x3b9b('0x16')]===undefined?!![]:![]:!![],'where':_0xb98c02[_0x3b9b('0x15')]?_0xb98c02[_0x3b9b('0x15')][_0x3b9b('0x17')]||null:null,'attributes':_0xb98c02[_0x3b9b('0x15')]?_0xb98c02[_0x3b9b('0x15')][_0x3b9b('0x18')]||null:null,'limit':_0xb98c02['options']?_0xb98c02[_0x3b9b('0x15')][_0x3b9b('0x19')]||null:null,'include':_0xb98c02[_0x3b9b('0x15')]?_0xb98c02[_0x3b9b('0x15')]['include']?_['map'](_0xb98c02[_0x3b9b('0x15')][_0x3b9b('0x1a')],function(_0x329003){return{'model':db[_0x329003[_0x3b9b('0x1b')]],'as':_0x329003['as'],'attributes':_0x329003['attributes'],'include':_0x329003[_0x3b9b('0x1a')]?_[_0x3b9b('0x1c')](_0x329003[_0x3b9b('0x1a')],function(_0x338f22){return{'model':db[_0x338f22[_0x3b9b('0x1b')]],'as':_0x338f22['as'],'attributes':_0x338f22[_0x3b9b('0x18')],'include':_0x338f22[_0x3b9b('0x1a')]?_[_0x3b9b('0x1c')](_0x338f22[_0x3b9b('0x1a')],function(_0x328d13){return{'model':db[_0x328d13['model']],'as':_0x328d13['as'],'attributes':_0x328d13[_0x3b9b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3b9b('0x1d')](function(_0x56f7e5){logger[_0x3b9b('0xb')](_0x3b9b('0x13'),_0xb98c02);logger['debug'](_0x3b9b('0x13'),_0xb98c02,JSON[_0x3b9b('0x1e')](_0x56f7e5));_0x1b1c71(_0x56f7e5);})[_0x3b9b('0x1f')](function(_0x5ab12a){logger[_0x3b9b('0xf')]('GetFreshdeskAccount',_0x5ab12a[_0x3b9b('0x11')],_0xb98c02);_0x21da71(_0x28a2f3[_0x3b9b('0xf')](0x1f4,_0x5ab12a[_0x3b9b('0x11')]));});});};exports[_0x3b9b('0x20')]=function(_0x5d6364){var _0x1edfb8=this;return new Promise(function(_0x542c21,_0x66fba1){return db[_0x3b9b('0x14')][_0x3b9b('0x21')]({'raw':_0x5d6364[_0x3b9b('0x15')]?_0x5d6364[_0x3b9b('0x15')][_0x3b9b('0x16')]===undefined?!![]:![]:!![],'where':_0x5d6364[_0x3b9b('0x15')]?_0x5d6364[_0x3b9b('0x15')][_0x3b9b('0x17')]||null:null,'attributes':_0x5d6364['options']?_0x5d6364[_0x3b9b('0x15')][_0x3b9b('0x18')]||null:null,'include':_0x5d6364[_0x3b9b('0x15')]?_0x5d6364[_0x3b9b('0x15')]['include']?_['map'](_0x5d6364['options'][_0x3b9b('0x1a')],function(_0x32ed0b){return{'model':db[_0x32ed0b['model']],'as':_0x32ed0b['as'],'attributes':_0x32ed0b[_0x3b9b('0x18')],'include':_0x32ed0b[_0x3b9b('0x1a')]?_[_0x3b9b('0x1c')](_0x32ed0b['include'],function(_0x4dd7e7){return{'model':db[_0x4dd7e7[_0x3b9b('0x1b')]],'as':_0x4dd7e7['as'],'attributes':_0x4dd7e7['attributes'],'include':_0x4dd7e7[_0x3b9b('0x1a')]?_[_0x3b9b('0x1c')](_0x4dd7e7[_0x3b9b('0x1a')],function(_0x3594e9){return{'model':db[_0x3594e9[_0x3b9b('0x1b')]],'as':_0x3594e9['as'],'attributes':_0x3594e9['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b9b('0x1d')](function(_0x2a97e2){logger[_0x3b9b('0xb')](_0x3b9b('0x20'),_0x5d6364);logger['debug'](_0x3b9b('0x20'),_0x5d6364,JSON[_0x3b9b('0x1e')](_0x2a97e2));_0x542c21(_0x2a97e2);})[_0x3b9b('0x1f')](function(_0x41f6f2){logger[_0x3b9b('0xf')]('ShowFreshdeskAccount',_0x41f6f2[_0x3b9b('0x11')],_0x5d6364);_0x66fba1(_0x1edfb8[_0x3b9b('0xf')](0x1f4,_0x41f6f2[_0x3b9b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 6849abf..343f634 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 _0xddd3=['/:id/tags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x49c6cc,_0x308bdb){var _0x22e239=function(_0x48507d){while(--_0x48507d){_0x49c6cc['push'](_0x49c6cc['shift']());}};_0x22e239(++_0x308bdb);}(_0xddd3,0x95));var _0x3ddd=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xddd3[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x3ddd('0x0'));var util=require(_0x3ddd('0x1'));var path=require(_0x3ddd('0x2'));var timeout=require(_0x3ddd('0x3'));var express=require(_0x3ddd('0x4'));var router=express[_0x3ddd('0x5')]();var fs_extra=require(_0x3ddd('0x6'));var auth=require(_0x3ddd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3ddd('0x8'));var controller=require(_0x3ddd('0x9'));router[_0x3ddd('0xa')]('/',auth[_0x3ddd('0xb')](),controller['index']);router[_0x3ddd('0xa')](_0x3ddd('0xc'),auth[_0x3ddd('0xb')](),controller[_0x3ddd('0xd')]);router[_0x3ddd('0xa')](_0x3ddd('0xe'),auth[_0x3ddd('0xb')](),controller[_0x3ddd('0xf')]);router[_0x3ddd('0xa')]('/:id/subjects',auth[_0x3ddd('0xb')](),controller[_0x3ddd('0x10')]);router[_0x3ddd('0xa')](_0x3ddd('0x11'),auth[_0x3ddd('0xb')](),controller[_0x3ddd('0x12')]);router['get'](_0x3ddd('0x13'),auth[_0x3ddd('0xb')](),controller['getTags']);router[_0x3ddd('0x14')]('/',auth[_0x3ddd('0xb')](),controller[_0x3ddd('0x15')]);router[_0x3ddd('0x14')](_0x3ddd('0x13'),auth[_0x3ddd('0xb')](),controller[_0x3ddd('0x16')]);router[_0x3ddd('0x17')](_0x3ddd('0xc'),auth[_0x3ddd('0xb')](),controller[_0x3ddd('0x18')]);router[_0x3ddd('0x19')](_0x3ddd('0xc'),auth[_0x3ddd('0xb')](),controller[_0x3ddd('0x1a')]);module[_0x3ddd('0x1b')]=router; \ No newline at end of file +var _0xd950=['post','create','setTags','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','getFields','/:id/subjects','/:id/descriptions','/:id/tags','getTags'];(function(_0x4b1728,_0x23d216){var _0x9d91cc=function(_0x54c2b6){while(--_0x54c2b6){_0x4b1728['push'](_0x4b1728['shift']());}};_0x9d91cc(++_0x23d216);}(_0xd950,0x67));var _0x0d95=function(_0x3a1678,_0x59002e){_0x3a1678=_0x3a1678-0x0;var _0x263661=_0xd950[_0x3a1678];return _0x263661;};'use strict';var multer=require(_0x0d95('0x0'));var util=require(_0x0d95('0x1'));var path=require(_0x0d95('0x2'));var timeout=require(_0x0d95('0x3'));var express=require(_0x0d95('0x4'));var router=express[_0x0d95('0x5')]();var fs_extra=require(_0x0d95('0x6'));var auth=require(_0x0d95('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0d95('0x8'));var controller=require(_0x0d95('0x9'));router[_0x0d95('0xa')]('/',auth[_0x0d95('0xb')](),controller['index']);router[_0x0d95('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0d95('0xa')]('/:id/fields',auth[_0x0d95('0xb')](),controller[_0x0d95('0xc')]);router['get'](_0x0d95('0xd'),auth[_0x0d95('0xb')](),controller['getSubjects']);router['get'](_0x0d95('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x0d95('0xa')](_0x0d95('0xf'),auth['isAuthenticated'](),controller[_0x0d95('0x10')]);router[_0x0d95('0x11')]('/',auth['isAuthenticated'](),controller[_0x0d95('0x12')]);router['post']('/:id/tags',auth[_0x0d95('0xb')](),controller[_0x0d95('0x13')]);router[_0x0d95('0x14')](_0x0d95('0x15'),auth[_0x0d95('0xb')](),controller[_0x0d95('0x16')]);router[_0x0d95('0x17')](_0x0d95('0x15'),auth[_0x0d95('0xb')](),controller['destroy']);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 9131a6b..d4799a1 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 _0xf86d=['STRING','exports'];(function(_0x109a83,_0x49b304){var _0x52e7e5=function(_0x525e50){while(--_0x525e50){_0x109a83['push'](_0x109a83['shift']());}};_0x52e7e5(++_0x49b304);}(_0xf86d,0xcf));var _0xdf86=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xf86d[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require('sequelize');module[_0xdf86('0x0')]={'name':{'type':Sequelize[_0xdf86('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x213d=['STRING','sequelize','exports'];(function(_0x3a2562,_0x2acdef){var _0x59eb58=function(_0x1b5e69){while(--_0x1b5e69){_0x3a2562['push'](_0x3a2562['shift']());}};_0x59eb58(++_0x2acdef);}(_0x213d,0x178));var _0xd213=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x213d[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0xd213('0x0'));module[_0xd213('0x1')]={'name':{'type':Sequelize[_0xd213('0x2')]},'description':{'type':Sequelize[_0xd213('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 5dc168f..5915746 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 _0xeba7=['type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','FreshdeskConfiguration','includeAll','include','findAll','rows','show','params','find','create','body','catch','findOne','getSubjects','getDescriptions','FreshdeskField','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','name','map','rawAttributes','fieldName'];(function(_0x3efdc3,_0xa8d574){var _0x5d8fda=function(_0x47d605){while(--_0x47d605){_0x3efdc3['push'](_0x3efdc3['shift']());}};_0x5d8fda(++_0xa8d574);}(_0xeba7,0x114));var _0x7eba=function(_0x3c45aa,_0x292858){_0x3c45aa=_0x3c45aa-0x0;var _0x3ef918=_0xeba7[_0x3c45aa];return _0x3ef918;};'use strict';var emlformat=require(_0x7eba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7eba('0x1'));var jsonpatch=require(_0x7eba('0x2'));var rp=require(_0x7eba('0x3'));var moment=require(_0x7eba('0x4'));var BPromise=require(_0x7eba('0x5'));var Mustache=require(_0x7eba('0x6'));var util=require(_0x7eba('0x7'));var path=require(_0x7eba('0x8'));var sox=require(_0x7eba('0x9'));var csv=require(_0x7eba('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7eba('0xb'));var crypto=require('crypto');var jsforce=require(_0x7eba('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7eba('0xa'));var querystring=require(_0x7eba('0xd'));var Papa=require(_0x7eba('0xe'));var Redis=require(_0x7eba('0xf'));var authService=require(_0x7eba('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7eba('0x11'));var logger=require(_0x7eba('0x12'))('api');var utils=require(_0x7eba('0x13'));var config=require(_0x7eba('0x14'));var licenseUtil=require(_0x7eba('0x15'));var db=require(_0x7eba('0x16'))['db'];function respondWithStatusCode(_0x2f3e86,_0x217db3){_0x217db3=_0x217db3||0xcc;return function(_0x4d92ec){if(_0x4d92ec){return _0x2f3e86['sendStatus'](_0x217db3);}return _0x2f3e86[_0x7eba('0x17')](_0x217db3)[_0x7eba('0x18')]();};}function respondWithResult(_0x544581,_0x397085){_0x397085=_0x397085||0xc8;return function(_0x379293){if(_0x379293){return _0x544581['status'](_0x397085)[_0x7eba('0x19')](_0x379293);}};}function respondWithFilteredResult(_0x1eb627,_0x1ad44b){return function(_0x18c3d3){if(_0x18c3d3){var _0x6b0628=typeof _0x1ad44b[_0x7eba('0x1a')]==='undefined'&&typeof _0x1ad44b[_0x7eba('0x1b')]===_0x7eba('0x1c');var _0x388041=_0x18c3d3[_0x7eba('0x1d')];var _0x20a22f=_0x6b0628?0x0:_0x1ad44b[_0x7eba('0x1a')];var _0x45e612=_0x6b0628?_0x18c3d3[_0x7eba('0x1d')]:_0x1ad44b['offset']+_0x1ad44b['limit'];var _0x5cebbd;if(_0x45e612>=_0x388041){_0x45e612=_0x388041;_0x5cebbd=0xc8;}else{_0x5cebbd=0xce;}_0x1eb627[_0x7eba('0x17')](_0x5cebbd);return _0x1eb627[_0x7eba('0x1e')](_0x7eba('0x1f'),_0x20a22f+'-'+_0x45e612+'/'+_0x388041)[_0x7eba('0x19')](_0x18c3d3);}return null;};}function patchUpdates(_0x22a54c){return function(_0x337d3a){try{jsonpatch['apply'](_0x337d3a,_0x22a54c,!![]);}catch(_0x3ab5cb){return BPromise['reject'](_0x3ab5cb);}return _0x337d3a[_0x7eba('0x20')]();};}function saveUpdates(_0x3c12f7,_0x298cd1){return function(_0x3a68aa){if(_0x3a68aa){return _0x3a68aa[_0x7eba('0x21')](_0x3c12f7)[_0x7eba('0x22')](function(_0x5cf03d){return _0x5cf03d;});}return null;};}function removeEntity(_0x4dc13f,_0x5a9c94){return function(_0xa53c6b){if(_0xa53c6b){return _0xa53c6b[_0x7eba('0x23')]()['then'](function(){_0x4dc13f[_0x7eba('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e51a8,_0x486916){return function(_0x4bd0e4){if(!_0x4bd0e4){_0x1e51a8['sendStatus'](0x194);}return _0x4bd0e4;};}function handleError(_0x19b409,_0x251c47){_0x251c47=_0x251c47||0x1f4;return function(_0x4f0d52){logger['error'](_0x4f0d52['stack']);if(_0x4f0d52[_0x7eba('0x24')]){delete _0x4f0d52['name'];}_0x19b409[_0x7eba('0x17')](_0x251c47)['send'](_0x4f0d52);};}exports['index']=function(_0x2184ab,_0x325319){var _0xbbaa62={},_0x4e675d={},_0x5c1f51={'count':0x0,'rows':[]};var _0x100fae=_[_0x7eba('0x25')](db['FreshdeskConfiguration'][_0x7eba('0x26')],function(_0x38dbaf){return{'name':_0x38dbaf[_0x7eba('0x27')],'type':_0x38dbaf[_0x7eba('0x28')][_0x7eba('0x29')]};});_0x4e675d[_0x7eba('0x2a')]=_['map'](_0x100fae,_0x7eba('0x24'));_0x4e675d[_0x7eba('0x2b')]=_[_0x7eba('0x2c')](_0x2184ab[_0x7eba('0x2b')]);_0x4e675d['filters']=_[_0x7eba('0x2d')](_0x4e675d[_0x7eba('0x2a')],_0x4e675d[_0x7eba('0x2b')]);_0xbbaa62[_0x7eba('0x2e')]=_['intersection'](_0x4e675d[_0x7eba('0x2a')],qs['fields'](_0x2184ab[_0x7eba('0x2b')][_0x7eba('0x2f')]));_0xbbaa62[_0x7eba('0x2e')]=_0xbbaa62[_0x7eba('0x2e')][_0x7eba('0x30')]?_0xbbaa62['attributes']:_0x4e675d['model'];if(!_0x2184ab[_0x7eba('0x2b')][_0x7eba('0x31')](_0x7eba('0x32'))){_0xbbaa62[_0x7eba('0x1b')]=qs[_0x7eba('0x1b')](_0x2184ab['query'][_0x7eba('0x1b')]);_0xbbaa62[_0x7eba('0x1a')]=qs[_0x7eba('0x1a')](_0x2184ab[_0x7eba('0x2b')][_0x7eba('0x1a')]);}_0xbbaa62[_0x7eba('0x33')]=qs[_0x7eba('0x34')](_0x2184ab[_0x7eba('0x2b')]['sort']);_0xbbaa62['where']=qs[_0x7eba('0x35')](_[_0x7eba('0x36')](_0x2184ab['query'],_0x4e675d[_0x7eba('0x35')]),_0x100fae);if(_0x2184ab['query'][_0x7eba('0x37')]){_0xbbaa62[_0x7eba('0x38')]=_[_0x7eba('0x39')](_0xbbaa62['where'],{'$or':_[_0x7eba('0x25')](_0x100fae,function(_0x4145e5){if(_0x4145e5[_0x7eba('0x28')]!==_0x7eba('0x3a')){var _0x29728d={};_0x29728d[_0x4145e5[_0x7eba('0x24')]]={'$like':'%'+_0x2184ab[_0x7eba('0x2b')][_0x7eba('0x37')]+'%'};return _0x29728d;}})});}_0xbbaa62=_['merge']({},_0xbbaa62,_0x2184ab[_0x7eba('0x3b')]);var _0x4c526e={'where':_0xbbaa62[_0x7eba('0x38')]};return db[_0x7eba('0x3c')]['count'](_0x4c526e)['then'](function(_0x540372){_0x5c1f51['count']=_0x540372;if(_0x2184ab[_0x7eba('0x2b')][_0x7eba('0x3d')]){_0xbbaa62[_0x7eba('0x3e')]=[{'all':!![]}];}return db[_0x7eba('0x3c')][_0x7eba('0x3f')](_0xbbaa62);})[_0x7eba('0x22')](function(_0x57dde9){_0x5c1f51[_0x7eba('0x40')]=_0x57dde9;return _0x5c1f51;})[_0x7eba('0x22')](respondWithFilteredResult(_0x325319,_0xbbaa62))['catch'](handleError(_0x325319,null));};exports[_0x7eba('0x41')]=function(_0x3636da,_0x5c79dd){var _0x210d18={'raw':![],'where':{'id':_0x3636da[_0x7eba('0x42')]['id']}},_0x1717b6={};_0x1717b6['model']=_[_0x7eba('0x2c')](db['FreshdeskConfiguration'][_0x7eba('0x26')]);_0x1717b6[_0x7eba('0x2b')]=_['keys'](_0x3636da[_0x7eba('0x2b')]);_0x1717b6['filters']=_[_0x7eba('0x2d')](_0x1717b6[_0x7eba('0x2a')],_0x1717b6[_0x7eba('0x2b')]);_0x210d18['attributes']=_[_0x7eba('0x2d')](_0x1717b6[_0x7eba('0x2a')],qs[_0x7eba('0x2f')](_0x3636da[_0x7eba('0x2b')][_0x7eba('0x2f')]));_0x210d18[_0x7eba('0x2e')]=_0x210d18[_0x7eba('0x2e')]['length']?_0x210d18[_0x7eba('0x2e')]:_0x1717b6[_0x7eba('0x2a')];if(_0x3636da[_0x7eba('0x2b')][_0x7eba('0x3d')]){_0x210d18[_0x7eba('0x3e')]=[{'all':!![]}];}_0x210d18=_['merge']({},_0x210d18,_0x3636da[_0x7eba('0x3b')]);return db[_0x7eba('0x3c')][_0x7eba('0x43')](_0x210d18)[_0x7eba('0x22')](handleEntityNotFound(_0x5c79dd,null))['then'](respondWithResult(_0x5c79dd,null))['catch'](handleError(_0x5c79dd,null));};exports['create']=function(_0x36c51e,_0x33b276){return db[_0x7eba('0x3c')][_0x7eba('0x44')](_0x36c51e[_0x7eba('0x45')],{})['then'](respondWithResult(_0x33b276,0xc9))[_0x7eba('0x46')](handleError(_0x33b276,null));};exports['update']=function(_0x2ad34d,_0x5553da){if(_0x2ad34d[_0x7eba('0x45')]['id']){delete _0x2ad34d['body']['id'];}return db[_0x7eba('0x3c')][_0x7eba('0x43')]({'where':{'id':_0x2ad34d[_0x7eba('0x42')]['id']}})[_0x7eba('0x22')](handleEntityNotFound(_0x5553da,null))[_0x7eba('0x22')](saveUpdates(_0x2ad34d['body'],null))[_0x7eba('0x22')](respondWithResult(_0x5553da,null))[_0x7eba('0x46')](handleError(_0x5553da,null));};exports['destroy']=function(_0x191f86,_0x3bbc34){return db[_0x7eba('0x3c')][_0x7eba('0x43')]({'where':{'id':_0x191f86['params']['id']}})['then'](handleEntityNotFound(_0x3bbc34,null))[_0x7eba('0x22')](removeEntity(_0x3bbc34,null))[_0x7eba('0x46')](handleError(_0x3bbc34,null));};exports['getFields']=function(_0x43023e,_0x32be83,_0xc1fc93){var _0x5a705a={};var _0x3e73d0={};var _0x5cc150;var _0x1ca6ea;return db[_0x7eba('0x3c')][_0x7eba('0x47')]({'where':{'id':_0x43023e[_0x7eba('0x42')]['id']}})[_0x7eba('0x22')](handleEntityNotFound(_0x32be83,null))[_0x7eba('0x22')](function(_0xf08270){if(_0xf08270){_0x5cc150=_0xf08270;_0x3e73d0['model']=_['keys'](db['FreshdeskField'][_0x7eba('0x26')]);_0x3e73d0['query']=_[_0x7eba('0x2c')](_0x43023e['query']);_0x3e73d0[_0x7eba('0x35')]=_[_0x7eba('0x2d')](_0x3e73d0[_0x7eba('0x2a')],_0x3e73d0['query']);_0x5a705a[_0x7eba('0x2e')]=_[_0x7eba('0x2d')](_0x3e73d0[_0x7eba('0x2a')],qs[_0x7eba('0x2f')](_0x43023e[_0x7eba('0x2b')][_0x7eba('0x2f')]));_0x5a705a['attributes']=_0x5a705a[_0x7eba('0x2e')]['length']?_0x5a705a['attributes']:_0x3e73d0['model'];_0x5a705a[_0x7eba('0x33')]=qs[_0x7eba('0x34')](_0x43023e['query'][_0x7eba('0x34')]);_0x5a705a[_0x7eba('0x38')]=qs[_0x7eba('0x35')](_[_0x7eba('0x36')](_0x43023e[_0x7eba('0x2b')],_0x3e73d0[_0x7eba('0x35')]));if(_0x43023e['query'][_0x7eba('0x37')]){_0x5a705a['where']=_[_0x7eba('0x39')](_0x5a705a[_0x7eba('0x38')],{'$or':_[_0x7eba('0x25')](_0x5a705a[_0x7eba('0x2e')],function(_0x5cd5fc){var _0x2a8d95={};_0x2a8d95[_0x5cd5fc]={'$like':'%'+_0x43023e['query'][_0x7eba('0x37')]+'%'};return _0x2a8d95;})});}_0x5a705a=_['merge']({},_0x5a705a,_0x43023e[_0x7eba('0x3b')]);return _0x5cc150['getFields'](_0x5a705a);}})[_0x7eba('0x22')](function(_0x454f37){if(_0x454f37){_0x1ca6ea=_0x454f37[_0x7eba('0x30')];if(!_0x43023e['query'][_0x7eba('0x31')]('nolimit')){_0x5a705a[_0x7eba('0x1b')]=qs[_0x7eba('0x1b')](_0x43023e[_0x7eba('0x2b')][_0x7eba('0x1b')]);_0x5a705a[_0x7eba('0x1a')]=qs[_0x7eba('0x1a')](_0x43023e[_0x7eba('0x2b')][_0x7eba('0x1a')]);}return _0x5cc150['getFields'](_0x5a705a);}})[_0x7eba('0x22')](function(_0x34dd68){if(_0x34dd68){return _0x34dd68?{'count':_0x1ca6ea,'rows':_0x34dd68}:null;}})[_0x7eba('0x22')](respondWithResult(_0x32be83,null))[_0x7eba('0x46')](handleError(_0x32be83,null));};exports[_0x7eba('0x48')]=function(_0x4fc517,_0x3797e1,_0x16d765){var _0x1001cf={};var _0x470534={};var _0x31d95e;var _0x21c962;return db[_0x7eba('0x3c')]['findOne']({'where':{'id':_0x4fc517['params']['id']}})[_0x7eba('0x22')](handleEntityNotFound(_0x3797e1,null))['then'](function(_0x24804e){if(_0x24804e){_0x31d95e=_0x24804e;_0x470534[_0x7eba('0x2a')]=_[_0x7eba('0x2c')](db['FreshdeskField']['rawAttributes']);_0x470534[_0x7eba('0x2b')]=_[_0x7eba('0x2c')](_0x4fc517['query']);_0x470534[_0x7eba('0x35')]=_[_0x7eba('0x2d')](_0x470534[_0x7eba('0x2a')],_0x470534[_0x7eba('0x2b')]);_0x1001cf[_0x7eba('0x2e')]=_[_0x7eba('0x2d')](_0x470534[_0x7eba('0x2a')],qs['fields'](_0x4fc517[_0x7eba('0x2b')]['fields']));_0x1001cf[_0x7eba('0x2e')]=_0x1001cf['attributes'][_0x7eba('0x30')]?_0x1001cf[_0x7eba('0x2e')]:_0x470534[_0x7eba('0x2a')];_0x1001cf[_0x7eba('0x33')]=qs[_0x7eba('0x34')](_0x4fc517[_0x7eba('0x2b')]['sort']);_0x1001cf[_0x7eba('0x38')]=qs[_0x7eba('0x35')](_[_0x7eba('0x36')](_0x4fc517[_0x7eba('0x2b')],_0x470534[_0x7eba('0x35')]));if(_0x4fc517['query'][_0x7eba('0x37')]){_0x1001cf[_0x7eba('0x38')]=_[_0x7eba('0x39')](_0x1001cf[_0x7eba('0x38')],{'$or':_['map'](_0x1001cf[_0x7eba('0x2e')],function(_0x15899c){var _0x2e83e4={};_0x2e83e4[_0x15899c]={'$like':'%'+_0x4fc517['query']['filter']+'%'};return _0x2e83e4;})});}_0x1001cf=_[_0x7eba('0x39')]({},_0x1001cf,_0x4fc517[_0x7eba('0x3b')]);return _0x31d95e['getSubjects'](_0x1001cf);}})[_0x7eba('0x22')](function(_0xb13888){if(_0xb13888){_0x21c962=_0xb13888[_0x7eba('0x30')];if(!_0x4fc517[_0x7eba('0x2b')][_0x7eba('0x31')]('nolimit')){_0x1001cf[_0x7eba('0x1b')]=qs[_0x7eba('0x1b')](_0x4fc517[_0x7eba('0x2b')]['limit']);_0x1001cf[_0x7eba('0x1a')]=qs['offset'](_0x4fc517['query'][_0x7eba('0x1a')]);}return _0x31d95e[_0x7eba('0x48')](_0x1001cf);}})[_0x7eba('0x22')](function(_0x305bf1){if(_0x305bf1){return _0x305bf1?{'count':_0x21c962,'rows':_0x305bf1}:null;}})[_0x7eba('0x22')](respondWithResult(_0x3797e1,null))[_0x7eba('0x46')](handleError(_0x3797e1,null));};exports[_0x7eba('0x49')]=function(_0x473894,_0x1c7c18,_0x41f120){var _0x34e259={};var _0xf2d9e6={};var _0x469bd;var _0x187f03;return db[_0x7eba('0x3c')][_0x7eba('0x47')]({'where':{'id':_0x473894[_0x7eba('0x42')]['id']}})['then'](handleEntityNotFound(_0x1c7c18,null))[_0x7eba('0x22')](function(_0x2ef59a){if(_0x2ef59a){_0x469bd=_0x2ef59a;_0xf2d9e6['model']=_[_0x7eba('0x2c')](db[_0x7eba('0x4a')][_0x7eba('0x26')]);_0xf2d9e6[_0x7eba('0x2b')]=_['keys'](_0x473894['query']);_0xf2d9e6['filters']=_[_0x7eba('0x2d')](_0xf2d9e6[_0x7eba('0x2a')],_0xf2d9e6[_0x7eba('0x2b')]);_0x34e259['attributes']=_[_0x7eba('0x2d')](_0xf2d9e6[_0x7eba('0x2a')],qs[_0x7eba('0x2f')](_0x473894['query']['fields']));_0x34e259[_0x7eba('0x2e')]=_0x34e259['attributes'][_0x7eba('0x30')]?_0x34e259[_0x7eba('0x2e')]:_0xf2d9e6['model'];_0x34e259[_0x7eba('0x33')]=qs['sort'](_0x473894[_0x7eba('0x2b')][_0x7eba('0x34')]);_0x34e259['where']=qs[_0x7eba('0x35')](_[_0x7eba('0x36')](_0x473894['query'],_0xf2d9e6[_0x7eba('0x35')]));if(_0x473894[_0x7eba('0x2b')][_0x7eba('0x37')]){_0x34e259[_0x7eba('0x38')]=_[_0x7eba('0x39')](_0x34e259['where'],{'$or':_[_0x7eba('0x25')](_0x34e259[_0x7eba('0x2e')],function(_0x5b9381){var _0xa4bb03={};_0xa4bb03[_0x5b9381]={'$like':'%'+_0x473894[_0x7eba('0x2b')][_0x7eba('0x37')]+'%'};return _0xa4bb03;})});}_0x34e259=_[_0x7eba('0x39')]({},_0x34e259,_0x473894['options']);return _0x469bd[_0x7eba('0x49')](_0x34e259);}})[_0x7eba('0x22')](function(_0x253f5d){if(_0x253f5d){_0x187f03=_0x253f5d[_0x7eba('0x30')];if(!_0x473894[_0x7eba('0x2b')][_0x7eba('0x31')]('nolimit')){_0x34e259[_0x7eba('0x1b')]=qs[_0x7eba('0x1b')](_0x473894[_0x7eba('0x2b')][_0x7eba('0x1b')]);_0x34e259[_0x7eba('0x1a')]=qs[_0x7eba('0x1a')](_0x473894[_0x7eba('0x2b')][_0x7eba('0x1a')]);}return _0x469bd['getDescriptions'](_0x34e259);}})[_0x7eba('0x22')](function(_0x5b7fde){if(_0x5b7fde){return _0x5b7fde?{'count':_0x187f03,'rows':_0x5b7fde}:null;}})[_0x7eba('0x22')](respondWithResult(_0x1c7c18,null))[_0x7eba('0x46')](handleError(_0x1c7c18,null));};exports['getTags']=function(_0x16134d,_0x528302,_0x41654a){var _0x5e5b90={};var _0x31fe6e={};var _0x5b110f;var _0x44e5af;return db[_0x7eba('0x3c')][_0x7eba('0x47')]({'where':{'id':_0x16134d['params']['id']}})[_0x7eba('0x22')](handleEntityNotFound(_0x528302,null))[_0x7eba('0x22')](function(_0x2474eb){if(_0x2474eb){_0x5b110f=_0x2474eb;_0x31fe6e['model']=_[_0x7eba('0x2c')](db[_0x7eba('0x4b')]['rawAttributes']);_0x31fe6e[_0x7eba('0x2b')]=_[_0x7eba('0x2c')](_0x16134d[_0x7eba('0x2b')]);_0x31fe6e[_0x7eba('0x35')]=_[_0x7eba('0x2d')](_0x31fe6e['model'],_0x31fe6e[_0x7eba('0x2b')]);_0x5e5b90[_0x7eba('0x2e')]=_[_0x7eba('0x2d')](_0x31fe6e[_0x7eba('0x2a')],qs['fields'](_0x16134d['query'][_0x7eba('0x2f')]));_0x5e5b90['attributes']=_0x5e5b90[_0x7eba('0x2e')][_0x7eba('0x30')]?_0x5e5b90[_0x7eba('0x2e')]:_0x31fe6e[_0x7eba('0x2a')];_0x5e5b90['order']=qs['sort'](_0x16134d[_0x7eba('0x2b')][_0x7eba('0x34')]);_0x5e5b90[_0x7eba('0x38')]=qs['filters'](_[_0x7eba('0x36')](_0x16134d[_0x7eba('0x2b')],_0x31fe6e[_0x7eba('0x35')]));if(_0x16134d[_0x7eba('0x2b')][_0x7eba('0x37')]){_0x5e5b90[_0x7eba('0x38')]=_['merge'](_0x5e5b90[_0x7eba('0x38')],{'$or':_['map'](_0x5e5b90[_0x7eba('0x2e')],function(_0x3409f3){var _0x2fb045={};_0x2fb045[_0x3409f3]={'$like':'%'+_0x16134d[_0x7eba('0x2b')][_0x7eba('0x37')]+'%'};return _0x2fb045;})});}_0x5e5b90=_[_0x7eba('0x39')]({},_0x5e5b90,_0x16134d[_0x7eba('0x3b')]);return _0x5b110f[_0x7eba('0x4c')](_0x5e5b90);}})[_0x7eba('0x22')](function(_0x239f3f){if(_0x239f3f){_0x44e5af=_0x239f3f[_0x7eba('0x30')];if(!_0x16134d[_0x7eba('0x2b')][_0x7eba('0x31')](_0x7eba('0x32'))){_0x5e5b90[_0x7eba('0x1b')]=qs[_0x7eba('0x1b')](_0x16134d['query'][_0x7eba('0x1b')]);_0x5e5b90[_0x7eba('0x1a')]=qs[_0x7eba('0x1a')](_0x16134d[_0x7eba('0x2b')][_0x7eba('0x1a')]);}return _0x5b110f[_0x7eba('0x4c')](_0x5e5b90);}})[_0x7eba('0x22')](function(_0x2cd6b5){if(_0x2cd6b5){return _0x2cd6b5?{'count':_0x44e5af,'rows':_0x2cd6b5}:null;}})[_0x7eba('0x22')](respondWithResult(_0x528302,null))['catch'](handleError(_0x528302,null));};exports[_0x7eba('0x4d')]=function(_0x4395bb,_0x1dbb7e,_0x395aa5){if(_0x4395bb[_0x7eba('0x45')]['id']){delete _0x4395bb['body']['id'];}return db[_0x7eba('0x3c')][_0x7eba('0x47')]({'where':{'id':_0x4395bb[_0x7eba('0x42')]['id']}})['then'](handleEntityNotFound(_0x1dbb7e,null))[_0x7eba('0x22')](function(_0x507294){if(_0x507294){return _0x507294[_0x7eba('0x4d')](_0x4395bb[_0x7eba('0x45')][_0x7eba('0x4e')]||[]);}return null;})[_0x7eba('0x22')](respondWithResult(_0x1dbb7e,null))['catch'](handleError(_0x1dbb7e,null));}; \ No newline at end of file +var _0xf2ad=['sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','update','getFields','findOne','FreshdeskField','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','params','ids','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf2ad,0x72));var _0xdf2a=function(_0x364a36,_0x1e2677){_0x364a36=_0x364a36-0x0;var _0x5cd6fa=_0xf2ad[_0x364a36];return _0x5cd6fa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdf2a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdf2a('0x1'));var BPromise=require(_0xdf2a('0x2'));var Mustache=require(_0xdf2a('0x3'));var util=require('util');var path=require(_0xdf2a('0x4'));var sox=require(_0xdf2a('0x5'));var csv=require(_0xdf2a('0x6'));var ejs=require(_0xdf2a('0x7'));var fs=require('fs');var fs_extra=require(_0xdf2a('0x8'));var _=require(_0xdf2a('0x9'));var squel=require(_0xdf2a('0xa'));var crypto=require(_0xdf2a('0xb'));var jsforce=require(_0xdf2a('0xc'));var deskjs=require(_0xdf2a('0xd'));var toCsv=require(_0xdf2a('0x6'));var querystring=require('querystring');var Papa=require(_0xdf2a('0xe'));var Redis=require(_0xdf2a('0xf'));var authService=require(_0xdf2a('0x10'));var qs=require(_0xdf2a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf2a('0x12'));var logger=require(_0xdf2a('0x13'))('api');var utils=require(_0xdf2a('0x14'));var config=require(_0xdf2a('0x15'));var licenseUtil=require(_0xdf2a('0x16'));var db=require(_0xdf2a('0x17'))['db'];function respondWithStatusCode(_0x159a74,_0x399c22){_0x399c22=_0x399c22||0xcc;return function(_0x53095b){if(_0x53095b){return _0x159a74[_0xdf2a('0x18')](_0x399c22);}return _0x159a74[_0xdf2a('0x19')](_0x399c22)[_0xdf2a('0x1a')]();};}function respondWithResult(_0x579b04,_0x19a20b){_0x19a20b=_0x19a20b||0xc8;return function(_0x4cc1a8){if(_0x4cc1a8){return _0x579b04['status'](_0x19a20b)[_0xdf2a('0x1b')](_0x4cc1a8);}};}function respondWithFilteredResult(_0x57e51d,_0x44f9de){return function(_0x37f3e9){if(_0x37f3e9){var _0x5966f6=typeof _0x44f9de[_0xdf2a('0x1c')]==='undefined'&&typeof _0x44f9de[_0xdf2a('0x1d')]===_0xdf2a('0x1e');var _0xa8f0b9=_0x37f3e9[_0xdf2a('0x1f')];var _0x5e591e=_0x5966f6?0x0:_0x44f9de[_0xdf2a('0x1c')];var _0x1a3782=_0x5966f6?_0x37f3e9[_0xdf2a('0x1f')]:_0x44f9de[_0xdf2a('0x1c')]+_0x44f9de[_0xdf2a('0x1d')];var _0x34307b;if(_0x1a3782>=_0xa8f0b9){_0x1a3782=_0xa8f0b9;_0x34307b=0xc8;}else{_0x34307b=0xce;}_0x57e51d[_0xdf2a('0x19')](_0x34307b);return _0x57e51d[_0xdf2a('0x20')](_0xdf2a('0x21'),_0x5e591e+'-'+_0x1a3782+'/'+_0xa8f0b9)[_0xdf2a('0x1b')](_0x37f3e9);}return null;};}function patchUpdates(_0x4c6ed4){return function(_0xfedbd9){try{jsonpatch['apply'](_0xfedbd9,_0x4c6ed4,!![]);}catch(_0x168ff1){return BPromise[_0xdf2a('0x22')](_0x168ff1);}return _0xfedbd9[_0xdf2a('0x23')]();};}function saveUpdates(_0x4468b0,_0x2f4534){return function(_0xfef05a){if(_0xfef05a){return _0xfef05a['update'](_0x4468b0)[_0xdf2a('0x24')](function(_0x640c4f){return _0x640c4f;});}return null;};}function removeEntity(_0x519835,_0x17b796){return function(_0x32dbff){if(_0x32dbff){return _0x32dbff[_0xdf2a('0x25')]()[_0xdf2a('0x24')](function(){_0x519835[_0xdf2a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14379d,_0x1f1d54){return function(_0x1f779c){if(!_0x1f779c){_0x14379d[_0xdf2a('0x18')](0x194);}return _0x1f779c;};}function handleError(_0x2bc0af,_0x1b6b15){_0x1b6b15=_0x1b6b15||0x1f4;return function(_0x4f321b){logger[_0xdf2a('0x26')](_0x4f321b[_0xdf2a('0x27')]);if(_0x4f321b['name']){delete _0x4f321b[_0xdf2a('0x28')];}_0x2bc0af[_0xdf2a('0x19')](_0x1b6b15)['send'](_0x4f321b);};}exports[_0xdf2a('0x29')]=function(_0x341251,_0x442a0e){var _0x19c783={},_0x2f781f={},_0x4ef560={'count':0x0,'rows':[]};var _0xe4e1ad=_[_0xdf2a('0x2a')](db[_0xdf2a('0x2b')][_0xdf2a('0x2c')],function(_0x26f3e9){return{'name':_0x26f3e9[_0xdf2a('0x2d')],'type':_0x26f3e9['type']['key']};});_0x2f781f[_0xdf2a('0x2e')]=_['map'](_0xe4e1ad,'name');_0x2f781f['query']=_[_0xdf2a('0x2f')](_0x341251[_0xdf2a('0x30')]);_0x2f781f[_0xdf2a('0x31')]=_[_0xdf2a('0x32')](_0x2f781f[_0xdf2a('0x2e')],_0x2f781f[_0xdf2a('0x30')]);_0x19c783[_0xdf2a('0x33')]=_['intersection'](_0x2f781f['model'],qs[_0xdf2a('0x34')](_0x341251[_0xdf2a('0x30')]['fields']));_0x19c783[_0xdf2a('0x33')]=_0x19c783[_0xdf2a('0x33')][_0xdf2a('0x35')]?_0x19c783[_0xdf2a('0x33')]:_0x2f781f['model'];if(!_0x341251[_0xdf2a('0x30')][_0xdf2a('0x36')]('nolimit')){_0x19c783[_0xdf2a('0x1d')]=qs[_0xdf2a('0x1d')](_0x341251[_0xdf2a('0x30')][_0xdf2a('0x1d')]);_0x19c783[_0xdf2a('0x1c')]=qs['offset'](_0x341251[_0xdf2a('0x30')]['offset']);}_0x19c783[_0xdf2a('0x37')]=qs[_0xdf2a('0x38')](_0x341251[_0xdf2a('0x30')]['sort']);_0x19c783[_0xdf2a('0x39')]=qs[_0xdf2a('0x31')](_[_0xdf2a('0x3a')](_0x341251[_0xdf2a('0x30')],_0x2f781f['filters']),_0xe4e1ad);if(_0x341251[_0xdf2a('0x30')][_0xdf2a('0x3b')]){_0x19c783[_0xdf2a('0x39')]=_[_0xdf2a('0x3c')](_0x19c783[_0xdf2a('0x39')],{'$or':_[_0xdf2a('0x2a')](_0xe4e1ad,function(_0x4ac9ab){if(_0x4ac9ab[_0xdf2a('0x3d')]!==_0xdf2a('0x3e')){var _0x5b32a2={};_0x5b32a2[_0x4ac9ab[_0xdf2a('0x28')]]={'$like':'%'+_0x341251['query'][_0xdf2a('0x3b')]+'%'};return _0x5b32a2;}})});}_0x19c783=_[_0xdf2a('0x3c')]({},_0x19c783,_0x341251['options']);var _0x277bdd={'where':_0x19c783[_0xdf2a('0x39')]};return db['FreshdeskConfiguration'][_0xdf2a('0x1f')](_0x277bdd)[_0xdf2a('0x24')](function(_0x939f77){_0x4ef560[_0xdf2a('0x1f')]=_0x939f77;if(_0x341251[_0xdf2a('0x30')][_0xdf2a('0x3f')]){_0x19c783[_0xdf2a('0x40')]=[{'all':!![]}];}return db[_0xdf2a('0x2b')][_0xdf2a('0x41')](_0x19c783);})['then'](function(_0x4cfd04){_0x4ef560[_0xdf2a('0x42')]=_0x4cfd04;return _0x4ef560;})[_0xdf2a('0x24')](respondWithFilteredResult(_0x442a0e,_0x19c783))[_0xdf2a('0x43')](handleError(_0x442a0e,null));};exports[_0xdf2a('0x44')]=function(_0x3be78e,_0x507565){var _0x4ce113={'raw':![],'where':{'id':_0x3be78e['params']['id']}},_0x4a9b1a={};_0x4a9b1a[_0xdf2a('0x2e')]=_[_0xdf2a('0x2f')](db[_0xdf2a('0x2b')][_0xdf2a('0x2c')]);_0x4a9b1a[_0xdf2a('0x30')]=_['keys'](_0x3be78e[_0xdf2a('0x30')]);_0x4a9b1a[_0xdf2a('0x31')]=_[_0xdf2a('0x32')](_0x4a9b1a[_0xdf2a('0x2e')],_0x4a9b1a[_0xdf2a('0x30')]);_0x4ce113[_0xdf2a('0x33')]=_[_0xdf2a('0x32')](_0x4a9b1a[_0xdf2a('0x2e')],qs[_0xdf2a('0x34')](_0x3be78e[_0xdf2a('0x30')][_0xdf2a('0x34')]));_0x4ce113['attributes']=_0x4ce113['attributes'][_0xdf2a('0x35')]?_0x4ce113[_0xdf2a('0x33')]:_0x4a9b1a[_0xdf2a('0x2e')];if(_0x3be78e[_0xdf2a('0x30')][_0xdf2a('0x3f')]){_0x4ce113['include']=[{'all':!![]}];}_0x4ce113=_[_0xdf2a('0x3c')]({},_0x4ce113,_0x3be78e[_0xdf2a('0x45')]);return db[_0xdf2a('0x2b')][_0xdf2a('0x46')](_0x4ce113)[_0xdf2a('0x24')](handleEntityNotFound(_0x507565,null))[_0xdf2a('0x24')](respondWithResult(_0x507565,null))['catch'](handleError(_0x507565,null));};exports[_0xdf2a('0x47')]=function(_0x17a364,_0x66bfcb){return db[_0xdf2a('0x2b')][_0xdf2a('0x47')](_0x17a364[_0xdf2a('0x48')],{})['then'](respondWithResult(_0x66bfcb,0xc9))[_0xdf2a('0x43')](handleError(_0x66bfcb,null));};exports[_0xdf2a('0x49')]=function(_0x167444,_0x210153){if(_0x167444[_0xdf2a('0x48')]['id']){delete _0x167444[_0xdf2a('0x48')]['id'];}return db['FreshdeskConfiguration'][_0xdf2a('0x46')]({'where':{'id':_0x167444['params']['id']}})[_0xdf2a('0x24')](handleEntityNotFound(_0x210153,null))[_0xdf2a('0x24')](saveUpdates(_0x167444['body'],null))[_0xdf2a('0x24')](respondWithResult(_0x210153,null))[_0xdf2a('0x43')](handleError(_0x210153,null));};exports[_0xdf2a('0x25')]=function(_0x18bab7,_0x13d7e3){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x18bab7['params']['id']}})['then'](handleEntityNotFound(_0x13d7e3,null))[_0xdf2a('0x24')](removeEntity(_0x13d7e3,null))[_0xdf2a('0x43')](handleError(_0x13d7e3,null));};exports[_0xdf2a('0x4a')]=function(_0x2c9646,_0x291fd4,_0x36c828){var _0x338e74={};var _0xed05c5={};var _0x37979d;var _0x31360a;return db['FreshdeskConfiguration'][_0xdf2a('0x4b')]({'where':{'id':_0x2c9646['params']['id']}})[_0xdf2a('0x24')](handleEntityNotFound(_0x291fd4,null))[_0xdf2a('0x24')](function(_0x5ac31d){if(_0x5ac31d){_0x37979d=_0x5ac31d;_0xed05c5[_0xdf2a('0x2e')]=_[_0xdf2a('0x2f')](db[_0xdf2a('0x4c')][_0xdf2a('0x2c')]);_0xed05c5[_0xdf2a('0x30')]=_['keys'](_0x2c9646[_0xdf2a('0x30')]);_0xed05c5[_0xdf2a('0x31')]=_[_0xdf2a('0x32')](_0xed05c5['model'],_0xed05c5[_0xdf2a('0x30')]);_0x338e74[_0xdf2a('0x33')]=_[_0xdf2a('0x32')](_0xed05c5['model'],qs[_0xdf2a('0x34')](_0x2c9646[_0xdf2a('0x30')][_0xdf2a('0x34')]));_0x338e74[_0xdf2a('0x33')]=_0x338e74[_0xdf2a('0x33')]['length']?_0x338e74[_0xdf2a('0x33')]:_0xed05c5[_0xdf2a('0x2e')];_0x338e74['order']=qs['sort'](_0x2c9646['query'][_0xdf2a('0x38')]);_0x338e74[_0xdf2a('0x39')]=qs[_0xdf2a('0x31')](_[_0xdf2a('0x3a')](_0x2c9646[_0xdf2a('0x30')],_0xed05c5['filters']));if(_0x2c9646[_0xdf2a('0x30')][_0xdf2a('0x3b')]){_0x338e74[_0xdf2a('0x39')]=_['merge'](_0x338e74[_0xdf2a('0x39')],{'$or':_[_0xdf2a('0x2a')](_0x338e74[_0xdf2a('0x33')],function(_0x1d6c10){var _0x56bb7a={};_0x56bb7a[_0x1d6c10]={'$like':'%'+_0x2c9646[_0xdf2a('0x30')][_0xdf2a('0x3b')]+'%'};return _0x56bb7a;})});}_0x338e74=_[_0xdf2a('0x3c')]({},_0x338e74,_0x2c9646[_0xdf2a('0x45')]);return _0x37979d[_0xdf2a('0x4a')](_0x338e74);}})[_0xdf2a('0x24')](function(_0xa5504c){if(_0xa5504c){_0x31360a=_0xa5504c['length'];if(!_0x2c9646[_0xdf2a('0x30')][_0xdf2a('0x36')](_0xdf2a('0x4d'))){_0x338e74['limit']=qs[_0xdf2a('0x1d')](_0x2c9646[_0xdf2a('0x30')][_0xdf2a('0x1d')]);_0x338e74[_0xdf2a('0x1c')]=qs['offset'](_0x2c9646[_0xdf2a('0x30')]['offset']);}return _0x37979d[_0xdf2a('0x4a')](_0x338e74);}})[_0xdf2a('0x24')](function(_0x370b65){if(_0x370b65){return _0x370b65?{'count':_0x31360a,'rows':_0x370b65}:null;}})[_0xdf2a('0x24')](respondWithResult(_0x291fd4,null))[_0xdf2a('0x43')](handleError(_0x291fd4,null));};exports[_0xdf2a('0x4e')]=function(_0x5e5733,_0x56d23e,_0x28223a){var _0x45adca={};var _0x2b0a00={};var _0x6e1c59;var _0x1c7b9b;return db[_0xdf2a('0x2b')][_0xdf2a('0x4b')]({'where':{'id':_0x5e5733['params']['id']}})['then'](handleEntityNotFound(_0x56d23e,null))[_0xdf2a('0x24')](function(_0x3c28b3){if(_0x3c28b3){_0x6e1c59=_0x3c28b3;_0x2b0a00[_0xdf2a('0x2e')]=_[_0xdf2a('0x2f')](db[_0xdf2a('0x4c')]['rawAttributes']);_0x2b0a00['query']=_[_0xdf2a('0x2f')](_0x5e5733[_0xdf2a('0x30')]);_0x2b0a00[_0xdf2a('0x31')]=_[_0xdf2a('0x32')](_0x2b0a00[_0xdf2a('0x2e')],_0x2b0a00[_0xdf2a('0x30')]);_0x45adca[_0xdf2a('0x33')]=_[_0xdf2a('0x32')](_0x2b0a00[_0xdf2a('0x2e')],qs[_0xdf2a('0x34')](_0x5e5733['query'][_0xdf2a('0x34')]));_0x45adca[_0xdf2a('0x33')]=_0x45adca[_0xdf2a('0x33')][_0xdf2a('0x35')]?_0x45adca[_0xdf2a('0x33')]:_0x2b0a00[_0xdf2a('0x2e')];_0x45adca['order']=qs['sort'](_0x5e5733[_0xdf2a('0x30')][_0xdf2a('0x38')]);_0x45adca[_0xdf2a('0x39')]=qs[_0xdf2a('0x31')](_[_0xdf2a('0x3a')](_0x5e5733[_0xdf2a('0x30')],_0x2b0a00[_0xdf2a('0x31')]));if(_0x5e5733[_0xdf2a('0x30')]['filter']){_0x45adca[_0xdf2a('0x39')]=_[_0xdf2a('0x3c')](_0x45adca[_0xdf2a('0x39')],{'$or':_['map'](_0x45adca[_0xdf2a('0x33')],function(_0x5171c2){var _0x394a91={};_0x394a91[_0x5171c2]={'$like':'%'+_0x5e5733[_0xdf2a('0x30')][_0xdf2a('0x3b')]+'%'};return _0x394a91;})});}_0x45adca=_[_0xdf2a('0x3c')]({},_0x45adca,_0x5e5733[_0xdf2a('0x45')]);return _0x6e1c59[_0xdf2a('0x4e')](_0x45adca);}})[_0xdf2a('0x24')](function(_0x58ca6d){if(_0x58ca6d){_0x1c7b9b=_0x58ca6d[_0xdf2a('0x35')];if(!_0x5e5733['query'][_0xdf2a('0x36')](_0xdf2a('0x4d'))){_0x45adca[_0xdf2a('0x1d')]=qs[_0xdf2a('0x1d')](_0x5e5733[_0xdf2a('0x30')][_0xdf2a('0x1d')]);_0x45adca[_0xdf2a('0x1c')]=qs[_0xdf2a('0x1c')](_0x5e5733[_0xdf2a('0x30')][_0xdf2a('0x1c')]);}return _0x6e1c59['getSubjects'](_0x45adca);}})[_0xdf2a('0x24')](function(_0x2188fa){if(_0x2188fa){return _0x2188fa?{'count':_0x1c7b9b,'rows':_0x2188fa}:null;}})[_0xdf2a('0x24')](respondWithResult(_0x56d23e,null))['catch'](handleError(_0x56d23e,null));};exports['getDescriptions']=function(_0x1a193c,_0x592bc8,_0x34b3a2){var _0x3f7597={};var _0x307acd={};var _0x314a55;var _0x5e24fa;return db[_0xdf2a('0x2b')][_0xdf2a('0x4b')]({'where':{'id':_0x1a193c['params']['id']}})[_0xdf2a('0x24')](handleEntityNotFound(_0x592bc8,null))[_0xdf2a('0x24')](function(_0x134335){if(_0x134335){_0x314a55=_0x134335;_0x307acd[_0xdf2a('0x2e')]=_[_0xdf2a('0x2f')](db['FreshdeskField']['rawAttributes']);_0x307acd['query']=_[_0xdf2a('0x2f')](_0x1a193c[_0xdf2a('0x30')]);_0x307acd[_0xdf2a('0x31')]=_[_0xdf2a('0x32')](_0x307acd[_0xdf2a('0x2e')],_0x307acd['query']);_0x3f7597[_0xdf2a('0x33')]=_['intersection'](_0x307acd[_0xdf2a('0x2e')],qs[_0xdf2a('0x34')](_0x1a193c[_0xdf2a('0x30')][_0xdf2a('0x34')]));_0x3f7597['attributes']=_0x3f7597['attributes']['length']?_0x3f7597[_0xdf2a('0x33')]:_0x307acd['model'];_0x3f7597[_0xdf2a('0x37')]=qs[_0xdf2a('0x38')](_0x1a193c[_0xdf2a('0x30')][_0xdf2a('0x38')]);_0x3f7597['where']=qs[_0xdf2a('0x31')](_[_0xdf2a('0x3a')](_0x1a193c[_0xdf2a('0x30')],_0x307acd[_0xdf2a('0x31')]));if(_0x1a193c[_0xdf2a('0x30')]['filter']){_0x3f7597[_0xdf2a('0x39')]=_[_0xdf2a('0x3c')](_0x3f7597[_0xdf2a('0x39')],{'$or':_[_0xdf2a('0x2a')](_0x3f7597[_0xdf2a('0x33')],function(_0x5091f8){var _0x3b1c94={};_0x3b1c94[_0x5091f8]={'$like':'%'+_0x1a193c[_0xdf2a('0x30')][_0xdf2a('0x3b')]+'%'};return _0x3b1c94;})});}_0x3f7597=_[_0xdf2a('0x3c')]({},_0x3f7597,_0x1a193c['options']);return _0x314a55[_0xdf2a('0x4f')](_0x3f7597);}})[_0xdf2a('0x24')](function(_0x2f4a8f){if(_0x2f4a8f){_0x5e24fa=_0x2f4a8f[_0xdf2a('0x35')];if(!_0x1a193c[_0xdf2a('0x30')][_0xdf2a('0x36')]('nolimit')){_0x3f7597[_0xdf2a('0x1d')]=qs['limit'](_0x1a193c[_0xdf2a('0x30')]['limit']);_0x3f7597[_0xdf2a('0x1c')]=qs[_0xdf2a('0x1c')](_0x1a193c[_0xdf2a('0x30')][_0xdf2a('0x1c')]);}return _0x314a55[_0xdf2a('0x4f')](_0x3f7597);}})['then'](function(_0x29bcda){if(_0x29bcda){return _0x29bcda?{'count':_0x5e24fa,'rows':_0x29bcda}:null;}})['then'](respondWithResult(_0x592bc8,null))[_0xdf2a('0x43')](handleError(_0x592bc8,null));};exports[_0xdf2a('0x50')]=function(_0x8ee181,_0x2ea3e3,_0x217dfc){var _0x5786b4={};var _0x3e1d9a={};var _0x249f3d;var _0x81a8ad;return db['FreshdeskConfiguration'][_0xdf2a('0x4b')]({'where':{'id':_0x8ee181['params']['id']}})[_0xdf2a('0x24')](handleEntityNotFound(_0x2ea3e3,null))[_0xdf2a('0x24')](function(_0x987da){if(_0x987da){_0x249f3d=_0x987da;_0x3e1d9a[_0xdf2a('0x2e')]=_[_0xdf2a('0x2f')](db[_0xdf2a('0x51')][_0xdf2a('0x2c')]);_0x3e1d9a[_0xdf2a('0x30')]=_[_0xdf2a('0x2f')](_0x8ee181[_0xdf2a('0x30')]);_0x3e1d9a['filters']=_['intersection'](_0x3e1d9a['model'],_0x3e1d9a[_0xdf2a('0x30')]);_0x5786b4[_0xdf2a('0x33')]=_[_0xdf2a('0x32')](_0x3e1d9a['model'],qs[_0xdf2a('0x34')](_0x8ee181[_0xdf2a('0x30')][_0xdf2a('0x34')]));_0x5786b4[_0xdf2a('0x33')]=_0x5786b4['attributes'][_0xdf2a('0x35')]?_0x5786b4[_0xdf2a('0x33')]:_0x3e1d9a['model'];_0x5786b4['order']=qs[_0xdf2a('0x38')](_0x8ee181[_0xdf2a('0x30')]['sort']);_0x5786b4[_0xdf2a('0x39')]=qs[_0xdf2a('0x31')](_['pick'](_0x8ee181['query'],_0x3e1d9a[_0xdf2a('0x31')]));if(_0x8ee181[_0xdf2a('0x30')]['filter']){_0x5786b4[_0xdf2a('0x39')]=_[_0xdf2a('0x3c')](_0x5786b4[_0xdf2a('0x39')],{'$or':_['map'](_0x5786b4[_0xdf2a('0x33')],function(_0x58f3ec){var _0xebff3e={};_0xebff3e[_0x58f3ec]={'$like':'%'+_0x8ee181[_0xdf2a('0x30')][_0xdf2a('0x3b')]+'%'};return _0xebff3e;})});}_0x5786b4=_[_0xdf2a('0x3c')]({},_0x5786b4,_0x8ee181[_0xdf2a('0x45')]);return _0x249f3d[_0xdf2a('0x50')](_0x5786b4);}})['then'](function(_0x3c00c9){if(_0x3c00c9){_0x81a8ad=_0x3c00c9[_0xdf2a('0x35')];if(!_0x8ee181['query'][_0xdf2a('0x36')]('nolimit')){_0x5786b4['limit']=qs[_0xdf2a('0x1d')](_0x8ee181[_0xdf2a('0x30')]['limit']);_0x5786b4['offset']=qs[_0xdf2a('0x1c')](_0x8ee181[_0xdf2a('0x30')][_0xdf2a('0x1c')]);}return _0x249f3d[_0xdf2a('0x50')](_0x5786b4);}})['then'](function(_0x498efa){if(_0x498efa){return _0x498efa?{'count':_0x81a8ad,'rows':_0x498efa}:null;}})['then'](respondWithResult(_0x2ea3e3,null))[_0xdf2a('0x43')](handleError(_0x2ea3e3,null));};exports[_0xdf2a('0x52')]=function(_0x481874,_0x926d67,_0x45edf5){if(_0x481874[_0xdf2a('0x48')]['id']){delete _0x481874[_0xdf2a('0x48')]['id'];}return db[_0xdf2a('0x2b')][_0xdf2a('0x4b')]({'where':{'id':_0x481874[_0xdf2a('0x53')]['id']}})[_0xdf2a('0x24')](handleEntityNotFound(_0x926d67,null))[_0xdf2a('0x24')](function(_0x114e02){if(_0x114e02){return _0x114e02[_0xdf2a('0x52')](_0x481874[_0xdf2a('0x48')][_0xdf2a('0x54')]||[]);}return null;})[_0xdf2a('0x24')](respondWithResult(_0x926d67,null))['catch'](handleError(_0x926d67,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index aa2b71a..f287b1e 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 _0x8767=['bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','../../config/logger','api','moment'];(function(_0x4d1d4a,_0x6aeb91){var _0x4b7816=function(_0x59abf8){while(--_0x59abf8){_0x4d1d4a['push'](_0x4d1d4a['shift']());}};_0x4b7816(++_0x6aeb91);}(_0x8767,0x99));var _0x7876=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8767[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7876('0x0'))(_0x7876('0x1'));var moment=require(_0x7876('0x2'));var BPromise=require(_0x7876('0x3'));var rp=require(_0x7876('0x4'));var fs=require('fs');var path=require(_0x7876('0x5'));var rimraf=require('rimraf');var config=require(_0x7876('0x6'));var attributes=require(_0x7876('0x7'));module[_0x7876('0x8')]=function(_0x569b08,_0x7defe1){return _0x569b08[_0x7876('0x9')](_0x7876('0xa'),attributes,{'tableName':_0x7876('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda80=['request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','bluebird'];(function(_0x5bba0a,_0x4f87c4){var _0x5d84ce=function(_0x7aa985){while(--_0x7aa985){_0x5bba0a['push'](_0x5bba0a['shift']());}};_0x5d84ce(++_0x4f87c4);}(_0xda80,0xaf));var _0x0da8=function(_0x9a3de1,_0x48216a){_0x9a3de1=_0x9a3de1-0x0;var _0x3aa708=_0xda80[_0x9a3de1];return _0x3aa708;};'use strict';var _=require(_0x0da8('0x0'));var util=require(_0x0da8('0x1'));var logger=require(_0x0da8('0x2'))(_0x0da8('0x3'));var moment=require('moment');var BPromise=require(_0x0da8('0x4'));var rp=require(_0x0da8('0x5'));var fs=require('fs');var path=require(_0x0da8('0x6'));var rimraf=require('rimraf');var config=require(_0x0da8('0x7'));var attributes=require(_0x0da8('0x8'));module[_0x0da8('0x9')]=function(_0x4e5d8a,_0x557a66){return _0x4e5d8a['define'](_0x0da8('0xa'),attributes,{'tableName':_0x0da8('0xb'),'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 997897d..a2e8ee6 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 _0xfcc7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0xfcc7,0x10e));var _0x7fcc=function(_0x1ae125,_0x20820a){_0x1ae125=_0x1ae125-0x0;var _0x1f3b2b=_0xfcc7[_0x1ae125];return _0x1f3b2b;};'use strict';var _=require('lodash');var util=require(_0x7fcc('0x0'));var moment=require(_0x7fcc('0x1'));var BPromise=require(_0x7fcc('0x2'));var rs=require(_0x7fcc('0x3'));var fs=require('fs');var Redis=require(_0x7fcc('0x4'));var db=require(_0x7fcc('0x5'))['db'];var utils=require(_0x7fcc('0x6'));var logger=require(_0x7fcc('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7fcc('0x8'));var client=jayson[_0x7fcc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d571d,_0x37439e,_0x4cf64b){return new BPromise(function(_0x13d135,_0x2f99ef){return client['request'](_0x2d571d,_0x4cf64b)[_0x7fcc('0xa')](function(_0x3a94a0){logger[_0x7fcc('0xb')](_0x7fcc('0xc'),_0x37439e,_0x7fcc('0xd'));logger[_0x7fcc('0xe')](_0x7fcc('0xf'),_0x37439e,_0x7fcc('0xd'),JSON[_0x7fcc('0x10')](_0x3a94a0));if(_0x3a94a0[_0x7fcc('0x11')]){if(_0x3a94a0[_0x7fcc('0x11')][_0x7fcc('0x12')]===0x1f4){logger[_0x7fcc('0x11')](_0x7fcc('0xc'),_0x37439e,_0x3a94a0[_0x7fcc('0x11')][_0x7fcc('0x13')]);return _0x2f99ef(_0x3a94a0[_0x7fcc('0x11')][_0x7fcc('0x13')]);}logger['error'](_0x7fcc('0xc'),_0x37439e,_0x3a94a0[_0x7fcc('0x11')][_0x7fcc('0x13')]);return _0x13d135(_0x3a94a0[_0x7fcc('0x11')][_0x7fcc('0x13')]);}else{logger['info'](_0x7fcc('0xc'),_0x37439e,_0x7fcc('0xd'));_0x13d135(_0x3a94a0[_0x7fcc('0x14')][_0x7fcc('0x13')]);}})['catch'](function(_0x34304a){logger[_0x7fcc('0x11')](_0x7fcc('0xc'),_0x37439e,_0x34304a);_0x2f99ef(_0x34304a);});});} \ No newline at end of file +var _0x7600=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3e7d6a,_0x5bc165){var _0x173913=function(_0x26a3b0){while(--_0x26a3b0){_0x3e7d6a['push'](_0x3e7d6a['shift']());}};_0x173913(++_0x5bc165);}(_0x7600,0x1e7));var _0x0760=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x7600[_0x381589];return _0x2a075d;};'use strict';var _=require(_0x0760('0x0'));var util=require(_0x0760('0x1'));var moment=require(_0x0760('0x2'));var BPromise=require(_0x0760('0x3'));var rs=require(_0x0760('0x4'));var fs=require('fs');var Redis=require(_0x0760('0x5'));var db=require(_0x0760('0x6'))['db'];var utils=require(_0x0760('0x7'));var logger=require('../../config/logger')(_0x0760('0x8'));var config=require(_0x0760('0x9'));var jayson=require(_0x0760('0xa'));var client=jayson[_0x0760('0xb')][_0x0760('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d5449,_0x44f6af,_0x4482ef){return new BPromise(function(_0x50745c,_0x292e57){return client['request'](_0x2d5449,_0x4482ef)[_0x0760('0xd')](function(_0x5bdb63){logger['info'](_0x0760('0xe'),_0x44f6af,'request\x20sent');logger[_0x0760('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x44f6af,_0x0760('0x10'),JSON[_0x0760('0x11')](_0x5bdb63));if(_0x5bdb63['error']){if(_0x5bdb63[_0x0760('0x12')][_0x0760('0x13')]===0x1f4){logger['error'](_0x0760('0xe'),_0x44f6af,_0x5bdb63[_0x0760('0x12')][_0x0760('0x14')]);return _0x292e57(_0x5bdb63[_0x0760('0x12')][_0x0760('0x14')]);}logger[_0x0760('0x12')](_0x0760('0xe'),_0x44f6af,_0x5bdb63[_0x0760('0x12')][_0x0760('0x14')]);return _0x50745c(_0x5bdb63[_0x0760('0x12')][_0x0760('0x14')]);}else{logger[_0x0760('0x15')](_0x0760('0xe'),_0x44f6af,_0x0760('0x10'));_0x50745c(_0x5bdb63[_0x0760('0x16')][_0x0760('0x14')]);}})[_0x0760('0x17')](function(_0x3fafd1){logger[_0x0760('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x44f6af,_0x3fafd1);_0x292e57(_0x3fafd1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 0c0a0e8..5bd5f55 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 _0xb45e=['Router','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports','util'];(function(_0x38f7eb,_0x2437ca){var _0x4b8ef2=function(_0x493f3c){while(--_0x493f3c){_0x38f7eb['push'](_0x38f7eb['shift']());}};_0x4b8ef2(++_0x2437ca);}(_0xb45e,0x12f));var _0xeb45=function(_0x2c0194,_0x5cc4c7){_0x2c0194=_0x2c0194-0x0;var _0x1eb1c2=_0xb45e[_0x2c0194];return _0x1eb1c2;};'use strict';var multer=require('multer');var util=require(_0xeb45('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xeb45('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xeb45('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xeb45('0x3'));var controller=require(_0xeb45('0x4'));router['get']('/',auth[_0xeb45('0x5')](),controller[_0xeb45('0x6')]);router[_0xeb45('0x7')](_0xeb45('0x8'),auth['isAuthenticated'](),controller[_0xeb45('0x9')]);router[_0xeb45('0xa')]('/',auth['isAuthenticated'](),controller[_0xeb45('0xb')]);router[_0xeb45('0xc')](_0xeb45('0x8'),auth[_0xeb45('0x5')](),controller[_0xeb45('0xd')]);router[_0xeb45('0xe')](_0xeb45('0x8'),auth[_0xeb45('0x5')](),controller['destroy']);module[_0xeb45('0xf')]=router; \ No newline at end of file +var _0xdf8d=['../../config/environment','./intFreshdeskField.controller','get','index','/:id','show','post','create','update','delete','isAuthenticated','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x1af8d3,_0x544d86){var _0x3a50c5=function(_0x4179aa){while(--_0x4179aa){_0x1af8d3['push'](_0x1af8d3['shift']());}};_0x3a50c5(++_0x544d86);}(_0xdf8d,0x9c));var _0xddf8=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xdf8d[_0x46ae5a];return _0x434986;};'use strict';var multer=require(_0xddf8('0x0'));var util=require(_0xddf8('0x1'));var path=require('path');var timeout=require(_0xddf8('0x2'));var express=require('express');var router=express[_0xddf8('0x3')]();var fs_extra=require(_0xddf8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xddf8('0x5'));var config=require(_0xddf8('0x6'));var controller=require(_0xddf8('0x7'));router[_0xddf8('0x8')]('/',auth['isAuthenticated'](),controller[_0xddf8('0x9')]);router[_0xddf8('0x8')](_0xddf8('0xa'),auth['isAuthenticated'](),controller[_0xddf8('0xb')]);router[_0xddf8('0xc')]('/',auth['isAuthenticated'](),controller[_0xddf8('0xd')]);router['put'](_0xddf8('0xa'),auth['isAuthenticated'](),controller[_0xddf8('0xe')]);router[_0xddf8('0xf')](_0xddf8('0xa'),auth[_0xddf8('0x10')](),controller['destroy']);module[_0xddf8('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 9742885..b5daca5 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 _0x02d5=['string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','picklist'];(function(_0xb5ca6e,_0x32cfff){var _0x11e0c3=function(_0x22bed8){while(--_0x22bed8){_0xb5ca6e['push'](_0xb5ca6e['shift']());}};_0x11e0c3(++_0x32cfff);}(_0x02d5,0xb8));var _0x502d=function(_0x5ba2c8,_0x5826ef){_0x5ba2c8=_0x5ba2c8-0x0;var _0x6c177f=_0x02d5[_0x5ba2c8];return _0x6c177f;};'use strict';var Sequelize=require(_0x502d('0x0'));module[_0x502d('0x1')]={'type':{'type':Sequelize[_0x502d('0x2')]('string','variable',_0x502d('0x3'),'keyValue',_0x502d('0x4')),'defaultValue':_0x502d('0x5')},'content':{'type':Sequelize[_0x502d('0x6')]},'key':{'type':Sequelize[_0x502d('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x502d('0x5'),_0x502d('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x502d('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x502d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1fc8=['sequelize','exports','ENUM','customVariable','keyValue','picklist','string','STRING','variable','BOOLEAN'];(function(_0x237395,_0x2b11b4){var _0x1a67c4=function(_0xf7488b){while(--_0xf7488b){_0x237395['push'](_0x237395['shift']());}};_0x1a67c4(++_0x2b11b4);}(_0x1fc8,0x14a));var _0x81fc=function(_0x20ab6e,_0x8ae87f){_0x20ab6e=_0x20ab6e-0x0;var _0xb17e72=_0x1fc8[_0x20ab6e];return _0xb17e72;};'use strict';var Sequelize=require(_0x81fc('0x0'));module[_0x81fc('0x1')]={'type':{'type':Sequelize[_0x81fc('0x2')]('string','variable',_0x81fc('0x3'),_0x81fc('0x4'),_0x81fc('0x5')),'defaultValue':_0x81fc('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x81fc('0x7')]},'keyType':{'type':Sequelize[_0x81fc('0x2')](_0x81fc('0x6'),_0x81fc('0x8'),_0x81fc('0x3'))},'keyContent':{'type':Sequelize[_0x81fc('0x7')]},'idField':{'type':Sequelize[_0x81fc('0x7')]},'nameField':{'type':Sequelize[_0x81fc('0x7')]},'customField':{'type':Sequelize[_0x81fc('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x81fc('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 64bba88..3f31218 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 _0x7980=['sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','FreshdeskField','type','key','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order'];(function(_0x5bd3f4,_0xbad624){var _0x111d75=function(_0x491211){while(--_0x491211){_0x5bd3f4['push'](_0x5bd3f4['shift']());}};_0x111d75(++_0xbad624);}(_0x7980,0xab));var _0x0798=function(_0x41b9cb,_0x38694f){_0x41b9cb=_0x41b9cb-0x0;var _0x393ad3=_0x7980[_0x41b9cb];return _0x393ad3;};'use strict';var emlformat=require(_0x0798('0x0'));var rimraf=require(_0x0798('0x1'));var zipdir=require(_0x0798('0x2'));var jsonpatch=require(_0x0798('0x3'));var rp=require(_0x0798('0x4'));var moment=require('moment');var BPromise=require(_0x0798('0x5'));var Mustache=require(_0x0798('0x6'));var util=require(_0x0798('0x7'));var path=require(_0x0798('0x8'));var sox=require(_0x0798('0x9'));var csv=require('to-csv');var ejs=require(_0x0798('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0798('0xb'));var squel=require(_0x0798('0xc'));var crypto=require(_0x0798('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0798('0xe'));var querystring=require(_0x0798('0xf'));var Papa=require(_0x0798('0x10'));var Redis=require(_0x0798('0x11'));var authService=require(_0x0798('0x12'));var qs=require(_0x0798('0x13'));var as=require(_0x0798('0x14'));var hardwareService=require(_0x0798('0x15'));var logger=require(_0x0798('0x16'))(_0x0798('0x17'));var utils=require('../../config/utils');var config=require(_0x0798('0x18'));var licenseUtil=require(_0x0798('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5323e5,_0x588f9d){_0x588f9d=_0x588f9d||0xcc;return function(_0x376a60){if(_0x376a60){return _0x5323e5[_0x0798('0x1a')](_0x588f9d);}return _0x5323e5[_0x0798('0x1b')](_0x588f9d)[_0x0798('0x1c')]();};}function respondWithResult(_0x39bacd,_0xfd88af){_0xfd88af=_0xfd88af||0xc8;return function(_0x5f1640){if(_0x5f1640){return _0x39bacd['status'](_0xfd88af)[_0x0798('0x1d')](_0x5f1640);}};}function respondWithFilteredResult(_0x112362,_0x47be56){return function(_0x555c45){if(_0x555c45){var _0x21c30b=typeof _0x47be56[_0x0798('0x1e')]===_0x0798('0x1f')&&typeof _0x47be56['limit']==='undefined';var _0x1c6d6f=_0x555c45['count'];var _0x41e217=_0x21c30b?0x0:_0x47be56[_0x0798('0x1e')];var _0x288f41=_0x21c30b?_0x555c45[_0x0798('0x20')]:_0x47be56['offset']+_0x47be56[_0x0798('0x21')];var _0x3039d6;if(_0x288f41>=_0x1c6d6f){_0x288f41=_0x1c6d6f;_0x3039d6=0xc8;}else{_0x3039d6=0xce;}_0x112362['status'](_0x3039d6);return _0x112362[_0x0798('0x22')](_0x0798('0x23'),_0x41e217+'-'+_0x288f41+'/'+_0x1c6d6f)[_0x0798('0x1d')](_0x555c45);}return null;};}function patchUpdates(_0x44ac33){return function(_0xfbb4a5){try{jsonpatch[_0x0798('0x24')](_0xfbb4a5,_0x44ac33,!![]);}catch(_0x3a7f8b){return BPromise[_0x0798('0x25')](_0x3a7f8b);}return _0xfbb4a5[_0x0798('0x26')]();};}function saveUpdates(_0x4a86d5,_0x2aaabf){return function(_0x35c141){if(_0x35c141){return _0x35c141[_0x0798('0x27')](_0x4a86d5)[_0x0798('0x28')](function(_0x20654b){return _0x20654b;});}return null;};}function removeEntity(_0x23f283,_0x52037c){return function(_0x3f66e2){if(_0x3f66e2){return _0x3f66e2[_0x0798('0x29')]()[_0x0798('0x28')](function(){_0x23f283[_0x0798('0x1b')](0xcc)[_0x0798('0x1c')]();});}};}function handleEntityNotFound(_0x23d59c,_0x4f648a){return function(_0x43d99f){if(!_0x43d99f){_0x23d59c[_0x0798('0x1a')](0x194);}return _0x43d99f;};}function handleError(_0x11e24d,_0x4d4e0a){_0x4d4e0a=_0x4d4e0a||0x1f4;return function(_0x4bc3f3){logger['error'](_0x4bc3f3['stack']);if(_0x4bc3f3[_0x0798('0x2a')]){delete _0x4bc3f3[_0x0798('0x2a')];}_0x11e24d[_0x0798('0x1b')](_0x4d4e0a)[_0x0798('0x2b')](_0x4bc3f3);};}exports[_0x0798('0x2c')]=function(_0x161244,_0x30bec){var _0x23e770={},_0x5bbe3d={},_0x167960={'count':0x0,'rows':[]};var _0x4f5d1d=_['map'](db[_0x0798('0x2d')]['rawAttributes'],function(_0x1dabd5){return{'name':_0x1dabd5['fieldName'],'type':_0x1dabd5[_0x0798('0x2e')][_0x0798('0x2f')]};});_0x5bbe3d[_0x0798('0x30')]=_[_0x0798('0x31')](_0x4f5d1d,_0x0798('0x2a'));_0x5bbe3d[_0x0798('0x32')]=_[_0x0798('0x33')](_0x161244[_0x0798('0x32')]);_0x5bbe3d[_0x0798('0x34')]=_[_0x0798('0x35')](_0x5bbe3d[_0x0798('0x30')],_0x5bbe3d[_0x0798('0x32')]);_0x23e770['attributes']=_[_0x0798('0x35')](_0x5bbe3d['model'],qs['fields'](_0x161244[_0x0798('0x32')][_0x0798('0x36')]));_0x23e770['attributes']=_0x23e770['attributes'][_0x0798('0x37')]?_0x23e770[_0x0798('0x38')]:_0x5bbe3d[_0x0798('0x30')];if(!_0x161244[_0x0798('0x32')][_0x0798('0x39')](_0x0798('0x3a'))){_0x23e770['limit']=qs['limit'](_0x161244[_0x0798('0x32')][_0x0798('0x21')]);_0x23e770[_0x0798('0x1e')]=qs['offset'](_0x161244['query']['offset']);}_0x23e770[_0x0798('0x3b')]=qs[_0x0798('0x3c')](_0x161244[_0x0798('0x32')][_0x0798('0x3c')]);_0x23e770[_0x0798('0x3d')]=qs[_0x0798('0x34')](_[_0x0798('0x3e')](_0x161244[_0x0798('0x32')],_0x5bbe3d['filters']),_0x4f5d1d);if(_0x161244[_0x0798('0x32')]['filter']){_0x23e770[_0x0798('0x3d')]=_[_0x0798('0x3f')](_0x23e770[_0x0798('0x3d')],{'$or':_['map'](_0x4f5d1d,function(_0x91de){if(_0x91de['type']!==_0x0798('0x40')){var _0x138bad={};_0x138bad[_0x91de[_0x0798('0x2a')]]={'$like':'%'+_0x161244['query'][_0x0798('0x41')]+'%'};return _0x138bad;}})});}_0x23e770=_[_0x0798('0x3f')]({},_0x23e770,_0x161244['options']);var _0xddc73b={'where':_0x23e770['where']};return db['FreshdeskField'][_0x0798('0x20')](_0xddc73b)[_0x0798('0x28')](function(_0x5f3e38){_0x167960['count']=_0x5f3e38;if(_0x161244[_0x0798('0x32')][_0x0798('0x42')]){_0x23e770[_0x0798('0x43')]=[{'all':!![]}];}return db[_0x0798('0x2d')][_0x0798('0x44')](_0x23e770);})[_0x0798('0x28')](function(_0x27a671){_0x167960['rows']=_0x27a671;return _0x167960;})[_0x0798('0x28')](respondWithFilteredResult(_0x30bec,_0x23e770))[_0x0798('0x45')](handleError(_0x30bec,null));};exports[_0x0798('0x46')]=function(_0x3d6de4,_0x3a8a14){var _0x26e9cb={'raw':!![],'where':{'id':_0x3d6de4[_0x0798('0x47')]['id']}},_0x4c2d8a={};_0x4c2d8a[_0x0798('0x30')]=_[_0x0798('0x33')](db[_0x0798('0x2d')][_0x0798('0x48')]);_0x4c2d8a[_0x0798('0x32')]=_[_0x0798('0x33')](_0x3d6de4[_0x0798('0x32')]);_0x4c2d8a[_0x0798('0x34')]=_[_0x0798('0x35')](_0x4c2d8a[_0x0798('0x30')],_0x4c2d8a[_0x0798('0x32')]);_0x26e9cb['attributes']=_[_0x0798('0x35')](_0x4c2d8a[_0x0798('0x30')],qs[_0x0798('0x36')](_0x3d6de4[_0x0798('0x32')]['fields']));_0x26e9cb['attributes']=_0x26e9cb[_0x0798('0x38')][_0x0798('0x37')]?_0x26e9cb[_0x0798('0x38')]:_0x4c2d8a[_0x0798('0x30')];if(_0x3d6de4['query'][_0x0798('0x42')]){_0x26e9cb['include']=[{'all':!![]}];}_0x26e9cb=_['merge']({},_0x26e9cb,_0x3d6de4[_0x0798('0x49')]);return db[_0x0798('0x2d')][_0x0798('0x4a')](_0x26e9cb)[_0x0798('0x28')](handleEntityNotFound(_0x3a8a14,null))[_0x0798('0x28')](respondWithResult(_0x3a8a14,null))[_0x0798('0x45')](handleError(_0x3a8a14,null));};exports[_0x0798('0x4b')]=function(_0x411c2a,_0x182e3b){return db['FreshdeskField'][_0x0798('0x4b')](_0x411c2a['body'],{})[_0x0798('0x28')](respondWithResult(_0x182e3b,0xc9))[_0x0798('0x45')](handleError(_0x182e3b,null));};exports[_0x0798('0x27')]=function(_0x54634d,_0x9dea1f){if(_0x54634d[_0x0798('0x4c')]['id']){delete _0x54634d[_0x0798('0x4c')]['id'];}return db[_0x0798('0x2d')]['find']({'where':{'id':_0x54634d[_0x0798('0x47')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x9dea1f,null))[_0x0798('0x28')](saveUpdates(_0x54634d[_0x0798('0x4c')],null))[_0x0798('0x28')](respondWithResult(_0x9dea1f,null))['catch'](handleError(_0x9dea1f,null));};exports[_0x0798('0x29')]=function(_0x3e1c15,_0x2679b1){return db[_0x0798('0x2d')][_0x0798('0x4a')]({'where':{'id':_0x3e1c15[_0x0798('0x47')]['id']}})[_0x0798('0x28')](handleEntityNotFound(_0x2679b1,null))[_0x0798('0x28')](removeEntity(_0x2679b1,null))[_0x0798('0x45')](handleError(_0x2679b1,null));}; \ No newline at end of file +var _0x6e6c=['set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc6e6('0x0'));var rimraf=require(_0xc6e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e6('0x2'));var rp=require(_0xc6e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6e6('0x4'));var util=require('util');var path=require(_0xc6e6('0x5'));var sox=require('sox');var csv=require(_0xc6e6('0x6'));var ejs=require(_0xc6e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6e6('0x8'));var squel=require(_0xc6e6('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6e6('0xa'));var deskjs=require(_0xc6e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6e6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc6e6('0xd'));var authService=require(_0xc6e6('0xe'));var qs=require(_0xc6e6('0xf'));var as=require(_0xc6e6('0x10'));var hardwareService=require(_0xc6e6('0x11'));var logger=require(_0xc6e6('0x12'))(_0xc6e6('0x13'));var utils=require(_0xc6e6('0x14'));var config=require(_0xc6e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6e6('0x16'))['db'];function respondWithStatusCode(_0x525d60,_0x3a30ce){_0x3a30ce=_0x3a30ce||0xcc;return function(_0x314d0f){if(_0x314d0f){return _0x525d60[_0xc6e6('0x17')](_0x3a30ce);}return _0x525d60[_0xc6e6('0x18')](_0x3a30ce)['end']();};}function respondWithResult(_0x149ac6,_0x2bfe7d){_0x2bfe7d=_0x2bfe7d||0xc8;return function(_0x13be73){if(_0x13be73){return _0x149ac6[_0xc6e6('0x18')](_0x2bfe7d)[_0xc6e6('0x19')](_0x13be73);}};}function respondWithFilteredResult(_0x4cdf15,_0x413cf8){return function(_0x178b34){if(_0x178b34){var _0x569474=typeof _0x413cf8[_0xc6e6('0x1a')]===_0xc6e6('0x1b')&&typeof _0x413cf8[_0xc6e6('0x1c')]==='undefined';var _0x51fd7c=_0x178b34['count'];var _0x3a1ccc=_0x569474?0x0:_0x413cf8['offset'];var _0x46e58f=_0x569474?_0x178b34[_0xc6e6('0x1d')]:_0x413cf8[_0xc6e6('0x1a')]+_0x413cf8[_0xc6e6('0x1c')];var _0x19e1e4;if(_0x46e58f>=_0x51fd7c){_0x46e58f=_0x51fd7c;_0x19e1e4=0xc8;}else{_0x19e1e4=0xce;}_0x4cdf15[_0xc6e6('0x18')](_0x19e1e4);return _0x4cdf15[_0xc6e6('0x1e')](_0xc6e6('0x1f'),_0x3a1ccc+'-'+_0x46e58f+'/'+_0x51fd7c)[_0xc6e6('0x19')](_0x178b34);}return null;};}function patchUpdates(_0x3d734d){return function(_0x4a36b6){try{jsonpatch[_0xc6e6('0x20')](_0x4a36b6,_0x3d734d,!![]);}catch(_0x4ad70e){return BPromise[_0xc6e6('0x21')](_0x4ad70e);}return _0x4a36b6[_0xc6e6('0x22')]();};}function saveUpdates(_0x2be6fc,_0x2f69f1){return function(_0x4f1d68){if(_0x4f1d68){return _0x4f1d68[_0xc6e6('0x23')](_0x2be6fc)[_0xc6e6('0x24')](function(_0x3a96df){return _0x3a96df;});}return null;};}function removeEntity(_0x36ebfa,_0x107561){return function(_0x4c35ae){if(_0x4c35ae){return _0x4c35ae[_0xc6e6('0x25')]()['then'](function(){_0x36ebfa[_0xc6e6('0x18')](0xcc)[_0xc6e6('0x26')]();});}};}function handleEntityNotFound(_0x2e5e0e,_0x64e1dc){return function(_0x53a1bf){if(!_0x53a1bf){_0x2e5e0e[_0xc6e6('0x17')](0x194);}return _0x53a1bf;};}function handleError(_0x5a5e47,_0x28577b){_0x28577b=_0x28577b||0x1f4;return function(_0x534745){logger[_0xc6e6('0x27')](_0x534745[_0xc6e6('0x28')]);if(_0x534745[_0xc6e6('0x29')]){delete _0x534745[_0xc6e6('0x29')];}_0x5a5e47[_0xc6e6('0x18')](_0x28577b)['send'](_0x534745);};}exports[_0xc6e6('0x2a')]=function(_0x1501bd,_0x166313){var _0x1af05c={},_0x4d1284={},_0x34ae96={'count':0x0,'rows':[]};var _0x50b735=_[_0xc6e6('0x2b')](db[_0xc6e6('0x2c')][_0xc6e6('0x2d')],function(_0xc578b3){return{'name':_0xc578b3[_0xc6e6('0x2e')],'type':_0xc578b3[_0xc6e6('0x2f')][_0xc6e6('0x30')]};});_0x4d1284[_0xc6e6('0x31')]=_[_0xc6e6('0x2b')](_0x50b735,_0xc6e6('0x29'));_0x4d1284[_0xc6e6('0x32')]=_[_0xc6e6('0x33')](_0x1501bd[_0xc6e6('0x32')]);_0x4d1284[_0xc6e6('0x34')]=_[_0xc6e6('0x35')](_0x4d1284[_0xc6e6('0x31')],_0x4d1284[_0xc6e6('0x32')]);_0x1af05c['attributes']=_[_0xc6e6('0x35')](_0x4d1284[_0xc6e6('0x31')],qs['fields'](_0x1501bd['query'][_0xc6e6('0x36')]));_0x1af05c[_0xc6e6('0x37')]=_0x1af05c[_0xc6e6('0x37')][_0xc6e6('0x38')]?_0x1af05c[_0xc6e6('0x37')]:_0x4d1284[_0xc6e6('0x31')];if(!_0x1501bd['query'][_0xc6e6('0x39')](_0xc6e6('0x3a'))){_0x1af05c[_0xc6e6('0x1c')]=qs['limit'](_0x1501bd['query'][_0xc6e6('0x1c')]);_0x1af05c[_0xc6e6('0x1a')]=qs[_0xc6e6('0x1a')](_0x1501bd[_0xc6e6('0x32')]['offset']);}_0x1af05c['order']=qs[_0xc6e6('0x3b')](_0x1501bd['query'][_0xc6e6('0x3b')]);_0x1af05c['where']=qs[_0xc6e6('0x34')](_[_0xc6e6('0x3c')](_0x1501bd[_0xc6e6('0x32')],_0x4d1284[_0xc6e6('0x34')]),_0x50b735);if(_0x1501bd['query']['filter']){_0x1af05c[_0xc6e6('0x3d')]=_[_0xc6e6('0x3e')](_0x1af05c[_0xc6e6('0x3d')],{'$or':_[_0xc6e6('0x2b')](_0x50b735,function(_0x4bb732){if(_0x4bb732['type']!==_0xc6e6('0x3f')){var _0x1326c7={};_0x1326c7[_0x4bb732[_0xc6e6('0x29')]]={'$like':'%'+_0x1501bd[_0xc6e6('0x32')]['filter']+'%'};return _0x1326c7;}})});}_0x1af05c=_[_0xc6e6('0x3e')]({},_0x1af05c,_0x1501bd[_0xc6e6('0x40')]);var _0x5ddab4={'where':_0x1af05c['where']};return db[_0xc6e6('0x2c')]['count'](_0x5ddab4)[_0xc6e6('0x24')](function(_0x3817fc){_0x34ae96['count']=_0x3817fc;if(_0x1501bd[_0xc6e6('0x32')]['includeAll']){_0x1af05c[_0xc6e6('0x41')]=[{'all':!![]}];}return db['FreshdeskField'][_0xc6e6('0x42')](_0x1af05c);})[_0xc6e6('0x24')](function(_0x247076){_0x34ae96[_0xc6e6('0x43')]=_0x247076;return _0x34ae96;})[_0xc6e6('0x24')](respondWithFilteredResult(_0x166313,_0x1af05c))[_0xc6e6('0x44')](handleError(_0x166313,null));};exports[_0xc6e6('0x45')]=function(_0x69766,_0x5ecf6c){var _0x5722db={'raw':!![],'where':{'id':_0x69766[_0xc6e6('0x46')]['id']}},_0x3e3da6={};_0x3e3da6[_0xc6e6('0x31')]=_[_0xc6e6('0x33')](db['FreshdeskField'][_0xc6e6('0x2d')]);_0x3e3da6[_0xc6e6('0x32')]=_[_0xc6e6('0x33')](_0x69766[_0xc6e6('0x32')]);_0x3e3da6['filters']=_[_0xc6e6('0x35')](_0x3e3da6[_0xc6e6('0x31')],_0x3e3da6[_0xc6e6('0x32')]);_0x5722db[_0xc6e6('0x37')]=_[_0xc6e6('0x35')](_0x3e3da6['model'],qs[_0xc6e6('0x36')](_0x69766['query'][_0xc6e6('0x36')]));_0x5722db['attributes']=_0x5722db[_0xc6e6('0x37')][_0xc6e6('0x38')]?_0x5722db[_0xc6e6('0x37')]:_0x3e3da6[_0xc6e6('0x31')];if(_0x69766[_0xc6e6('0x32')][_0xc6e6('0x47')]){_0x5722db[_0xc6e6('0x41')]=[{'all':!![]}];}_0x5722db=_[_0xc6e6('0x3e')]({},_0x5722db,_0x69766['options']);return db[_0xc6e6('0x2c')][_0xc6e6('0x48')](_0x5722db)[_0xc6e6('0x24')](handleEntityNotFound(_0x5ecf6c,null))['then'](respondWithResult(_0x5ecf6c,null))[_0xc6e6('0x44')](handleError(_0x5ecf6c,null));};exports[_0xc6e6('0x49')]=function(_0x38ecc3,_0x42ed90){return db[_0xc6e6('0x2c')][_0xc6e6('0x49')](_0x38ecc3[_0xc6e6('0x4a')],{})[_0xc6e6('0x24')](respondWithResult(_0x42ed90,0xc9))[_0xc6e6('0x44')](handleError(_0x42ed90,null));};exports[_0xc6e6('0x23')]=function(_0x3bfe85,_0x470167){if(_0x3bfe85[_0xc6e6('0x4a')]['id']){delete _0x3bfe85[_0xc6e6('0x4a')]['id'];}return db['FreshdeskField'][_0xc6e6('0x48')]({'where':{'id':_0x3bfe85['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x470167,null))[_0xc6e6('0x24')](saveUpdates(_0x3bfe85['body'],null))['then'](respondWithResult(_0x470167,null))['catch'](handleError(_0x470167,null));};exports['destroy']=function(_0x531dca,_0x3edc16){return db[_0xc6e6('0x2c')][_0xc6e6('0x48')]({'where':{'id':_0x531dca[_0xc6e6('0x46')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x3edc16,null))['then'](removeEntity(_0x3edc16,null))['catch'](handleError(_0x3edc16,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index b601ce0..2ee3986 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 _0x02ca=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash'];(function(_0x3e23c1,_0xb0c332){var _0x393fea=function(_0x2dbe0c){while(--_0x2dbe0c){_0x3e23c1['push'](_0x3e23c1['shift']());}};_0x393fea(++_0xb0c332);}(_0x02ca,0xdf));var _0xa02c=function(_0x5a5387,_0x2d0815){_0x5a5387=_0x5a5387-0x0;var _0x22ec26=_0x02ca[_0x5a5387];return _0x22ec26;};'use strict';var _=require(_0xa02c('0x0'));var util=require(_0xa02c('0x1'));var logger=require(_0xa02c('0x2'))(_0xa02c('0x3'));var moment=require(_0xa02c('0x4'));var BPromise=require(_0xa02c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa02c('0x6'));var rimraf=require(_0xa02c('0x7'));var config=require(_0xa02c('0x8'));var attributes=require(_0xa02c('0x9'));module[_0xa02c('0xa')]=function(_0x351c85,_0x2ee819){return _0x351c85[_0xa02c('0xb')](_0xa02c('0xc'),attributes,{'tableName':_0xa02c('0xd'),'paranoid':![],'indexes':[{'name':_0xa02c('0xe'),'fields':[_0xa02c('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e2e=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','FieldId'];(function(_0x1f74f6,_0x194920){var _0x7c9710=function(_0x3fb114){while(--_0x3fb114){_0x1f74f6['push'](_0x1f74f6['shift']());}};_0x7c9710(++_0x194920);}(_0x2e2e,0x138));var _0xe2e2=function(_0x4e9b86,_0x9148cb){_0x4e9b86=_0x4e9b86-0x0;var _0x42e296=_0x2e2e[_0x4e9b86];return _0x42e296;};'use strict';var _=require(_0xe2e2('0x0'));var util=require(_0xe2e2('0x1'));var logger=require(_0xe2e2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe2e2('0x3'));var rp=require(_0xe2e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2e2('0x5'));var config=require(_0xe2e2('0x6'));var attributes=require(_0xe2e2('0x7'));module[_0xe2e2('0x8')]=function(_0x11271f,_0x4f2a56){return _0x11271f[_0xe2e2('0x9')]('FreshdeskField',attributes,{'tableName':_0xe2e2('0xa'),'paranoid':![],'indexes':[{'name':_0xe2e2('0xb'),'fields':['idField',_0xe2e2('0xc')],'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 05241fd..971b6e2 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 _0x3a94=['code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3a94,0x1e2));var _0x43a9=function(_0x475122,_0x2004f3){_0x475122=_0x475122-0x0;var _0x40e43c=_0x3a94[_0x475122];return _0x40e43c;};'use strict';var _=require(_0x43a9('0x0'));var util=require('util');var moment=require(_0x43a9('0x1'));var BPromise=require(_0x43a9('0x2'));var rs=require(_0x43a9('0x3'));var fs=require('fs');var Redis=require(_0x43a9('0x4'));var db=require(_0x43a9('0x5'))['db'];var utils=require(_0x43a9('0x6'));var logger=require('../../config/logger')(_0x43a9('0x7'));var config=require('../../config/environment');var jayson=require(_0x43a9('0x8'));var client=jayson['client'][_0x43a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17b882,_0x59f2b4,_0x54c8d7){return new BPromise(function(_0x322b8b,_0xa7b638){return client[_0x43a9('0xa')](_0x17b882,_0x54c8d7)[_0x43a9('0xb')](function(_0x526cee){logger[_0x43a9('0xc')](_0x43a9('0xd'),_0x59f2b4,_0x43a9('0xe'));logger[_0x43a9('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x59f2b4,_0x43a9('0xe'),JSON[_0x43a9('0x10')](_0x526cee));if(_0x526cee[_0x43a9('0x11')]){if(_0x526cee[_0x43a9('0x11')][_0x43a9('0x12')]===0x1f4){logger[_0x43a9('0x11')](_0x43a9('0xd'),_0x59f2b4,_0x526cee[_0x43a9('0x11')]['message']);return _0xa7b638(_0x526cee[_0x43a9('0x11')][_0x43a9('0x13')]);}logger['error'](_0x43a9('0xd'),_0x59f2b4,_0x526cee['error'][_0x43a9('0x13')]);return _0x322b8b(_0x526cee['error']['message']);}else{logger[_0x43a9('0xc')](_0x43a9('0xd'),_0x59f2b4,'request\x20sent');_0x322b8b(_0x526cee['result'][_0x43a9('0x13')]);}})['catch'](function(_0x3cab44){logger[_0x43a9('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x59f2b4,_0x3cab44);_0xa7b638(_0x3cab44);});});} \ No newline at end of file +var _0x1bb3=['../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','ioredis'];(function(_0x556d57,_0x27e9e8){var _0x44aa1f=function(_0x5f06d5){while(--_0x5f06d5){_0x556d57['push'](_0x556d57['shift']());}};_0x44aa1f(++_0x27e9e8);}(_0x1bb3,0x1e4));var _0x31bb=function(_0x25fc37,_0x4db964){_0x25fc37=_0x25fc37-0x0;var _0x33a05a=_0x1bb3[_0x25fc37];return _0x33a05a;};'use strict';var _=require(_0x31bb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31bb('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x31bb('0x2'));var jayson=require(_0x31bb('0x3'));var client=jayson[_0x31bb('0x4')][_0x31bb('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x398f71,_0x473cd8,_0x11ef52){return new BPromise(function(_0x1425be,_0x3355b8){return client[_0x31bb('0x6')](_0x398f71,_0x11ef52)[_0x31bb('0x7')](function(_0x23ae4f){logger[_0x31bb('0x8')](_0x31bb('0x9'),_0x473cd8,_0x31bb('0xa'));logger['debug'](_0x31bb('0xb'),_0x473cd8,_0x31bb('0xa'),JSON[_0x31bb('0xc')](_0x23ae4f));if(_0x23ae4f[_0x31bb('0xd')]){if(_0x23ae4f['error'][_0x31bb('0xe')]===0x1f4){logger['error'](_0x31bb('0x9'),_0x473cd8,_0x23ae4f[_0x31bb('0xd')]['message']);return _0x3355b8(_0x23ae4f[_0x31bb('0xd')]['message']);}logger[_0x31bb('0xd')](_0x31bb('0x9'),_0x473cd8,_0x23ae4f[_0x31bb('0xd')]['message']);return _0x1425be(_0x23ae4f['error'][_0x31bb('0xf')]);}else{logger[_0x31bb('0x8')]('FreshdeskField,\x20%s,\x20%s',_0x473cd8,_0x31bb('0xa'));_0x1425be(_0x23ae4f[_0x31bb('0x10')][_0x31bb('0xf')]);}})[_0x31bb('0x11')](function(_0x475f8a){logger[_0x31bb('0xd')](_0x31bb('0x9'),_0x473cd8,_0x475f8a);_0x3355b8(_0x475f8a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 48e5804..758642f 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 _0xd8b0=['/:id','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x42e761,_0xe62d7e){var _0x558615=function(_0x5429ed){while(--_0x5429ed){_0x42e761['push'](_0x42e761['shift']());}};_0x558615(++_0xe62d7e);}(_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('./intFreshsalesAccount.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')]('/',auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x15')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);module[_0x0d8b('0x17')]=router; \ No newline at end of file +var _0x44a3=['getFields','post','addConfiguration','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations'];(function(_0x58682e,_0x48176d){var _0x533e59=function(_0x4a5513){while(--_0x4a5513){_0x58682e['push'](_0x58682e['shift']());}};_0x533e59(++_0x48176d);}(_0x44a3,0x1a9));var _0x344a=function(_0x154cbb,_0x43c57f){_0x154cbb=_0x154cbb-0x0;var _0x494584=_0x44a3[_0x154cbb];return _0x494584;};'use strict';var multer=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var path=require(_0x344a('0x2'));var timeout=require(_0x344a('0x3'));var express=require(_0x344a('0x4'));var router=express[_0x344a('0x5')]();var fs_extra=require(_0x344a('0x6'));var auth=require(_0x344a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x344a('0x8'));var controller=require(_0x344a('0x9'));router[_0x344a('0xa')]('/',auth[_0x344a('0xb')](),controller[_0x344a('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x344a('0xa')](_0x344a('0xd'),auth[_0x344a('0xb')](),controller[_0x344a('0xe')]);router[_0x344a('0xa')]('/:id/fields',auth[_0x344a('0xb')](),controller[_0x344a('0xf')]);router['post']('/',auth[_0x344a('0xb')](),controller['create']);router[_0x344a('0x10')]('/:id/configurations',auth[_0x344a('0xb')](),controller[_0x344a('0x11')]);router['put']('/:id',auth[_0x344a('0xb')](),controller[_0x344a('0x12')]);router[_0x344a('0x13')](_0x344a('0x14'),auth[_0x344a('0xb')](),controller[_0x344a('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index ee700db..26be677 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 _0x5c3c=['remoteUri','sequelize','exports','STRING','username'];(function(_0x2c6af3,_0x3ce442){var _0x4895bf=function(_0x5566cf){while(--_0x5566cf){_0x2c6af3['push'](_0x2c6af3['shift']());}};_0x4895bf(++_0x3ce442);}(_0x5c3c,0x132));var _0xc5c3=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x5c3c[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require(_0xc5c3('0x0'));module[_0xc5c3('0x1')]={'name':{'type':Sequelize[_0xc5c3('0x2')]},'description':{'type':Sequelize[_0xc5c3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc5c3('0x3')},'apiKey':{'type':Sequelize[_0xc5c3('0x2')]},'remoteUri':{'type':Sequelize[_0xc5c3('0x2')],'unique':_0xc5c3('0x4')},'serverUrl':{'type':Sequelize[_0xc5c3('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x1a85=['STRING','remoteUri'];(function(_0x740fde,_0x490c95){var _0x15199f=function(_0x2f731c){while(--_0x2f731c){_0x740fde['push'](_0x740fde['shift']());}};_0x15199f(++_0x490c95);}(_0x1a85,0x178));var _0x51a8=function(_0x42c7b5,_0x3f2ccf){_0x42c7b5=_0x42c7b5-0x0;var _0x3919b2=_0x1a85[_0x42c7b5];return _0x3919b2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x51a8('0x0')]},'description':{'type':Sequelize[_0x51a8('0x0')]},'username':{'type':Sequelize[_0x51a8('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x51a8('0x0')],'unique':_0x51a8('0x1')},'serverUrl':{'type':Sequelize[_0x51a8('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index d2797f4..010c31a 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 _0x3ee6=['set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','FreshsalesAccount','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','getConfigurations','FreshsalesConfiguration','nolimit','findOne','AccountId','Subjects','channel','FreshsalesField','Descriptions','getFields','apiKey','remoteUri','substring','lastIndexOf','format','/api/selector/owners','Token\x20token=','email','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','limit','undefined','count','offset'];(function(_0x1fa195,_0x49a201){var _0x2af764=function(_0x12c7d1){while(--_0x12c7d1){_0x1fa195['push'](_0x1fa195['shift']());}};_0x2af764(++_0x49a201);}(_0x3ee6,0xa6));var _0x63ee=function(_0x41c80c,_0x94058){_0x41c80c=_0x41c80c-0x0;var _0x524f4a=_0x3ee6[_0x41c80c];return _0x524f4a;};'use strict';var emlformat=require(_0x63ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x63ee('0x1'));var jsonpatch=require(_0x63ee('0x2'));var rp=require('request-promise');var moment=require(_0x63ee('0x3'));var BPromise=require(_0x63ee('0x4'));var Mustache=require(_0x63ee('0x5'));var util=require(_0x63ee('0x6'));var path=require(_0x63ee('0x7'));var sox=require(_0x63ee('0x8'));var csv=require(_0x63ee('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x63ee('0xa'));var _=require(_0x63ee('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x63ee('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x63ee('0xd'));var Papa=require(_0x63ee('0xe'));var Redis=require(_0x63ee('0xf'));var authService=require(_0x63ee('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63ee('0x11'));var logger=require(_0x63ee('0x12'))(_0x63ee('0x13'));var utils=require('../../config/utils');var config=require(_0x63ee('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x63ee('0x15'))['db'];var integrations=require(_0x63ee('0x16'));function respondWithStatusCode(_0x388622,_0x1efaf3){_0x1efaf3=_0x1efaf3||0xcc;return function(_0x3290f7){if(_0x3290f7){return _0x388622['sendStatus'](_0x1efaf3);}return _0x388622[_0x63ee('0x17')](_0x1efaf3)[_0x63ee('0x18')]();};}function respondWithResult(_0x4b64e9,_0x317acd){_0x317acd=_0x317acd||0xc8;return function(_0x1e88bd){if(_0x1e88bd){return _0x4b64e9[_0x63ee('0x17')](_0x317acd)[_0x63ee('0x19')](_0x1e88bd);}};}function respondWithFilteredResult(_0x4ae00a,_0x4de220){return function(_0x3af4b1){if(_0x3af4b1){var _0x2499c4=typeof _0x4de220['offset']==='undefined'&&typeof _0x4de220[_0x63ee('0x1a')]===_0x63ee('0x1b');var _0x4e608b=_0x3af4b1['count'];var _0x4c05d9=_0x2499c4?0x0:_0x4de220['offset'];var _0x4a759f=_0x2499c4?_0x3af4b1[_0x63ee('0x1c')]:_0x4de220[_0x63ee('0x1d')]+_0x4de220[_0x63ee('0x1a')];var _0x36376d;if(_0x4a759f>=_0x4e608b){_0x4a759f=_0x4e608b;_0x36376d=0xc8;}else{_0x36376d=0xce;}_0x4ae00a[_0x63ee('0x17')](_0x36376d);return _0x4ae00a[_0x63ee('0x1e')](_0x63ee('0x1f'),_0x4c05d9+'-'+_0x4a759f+'/'+_0x4e608b)[_0x63ee('0x19')](_0x3af4b1);}return null;};}function patchUpdates(_0x32e24a){return function(_0x527448){try{jsonpatch[_0x63ee('0x20')](_0x527448,_0x32e24a,!![]);}catch(_0x4c59a3){return BPromise[_0x63ee('0x21')](_0x4c59a3);}return _0x527448[_0x63ee('0x22')]();};}function saveUpdates(_0xb84587,_0x15f86f){return function(_0x3700b2){if(_0x3700b2){return _0x3700b2[_0x63ee('0x23')](_0xb84587)['then'](function(_0x43c026){return _0x43c026;});}return null;};}function removeEntity(_0x317888,_0x537f1f){return function(_0x9b2d75){if(_0x9b2d75){return _0x9b2d75[_0x63ee('0x24')]()[_0x63ee('0x25')](function(){_0x317888[_0x63ee('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x724d0c,_0x3c76b9){return function(_0x52aafe){if(!_0x52aafe){_0x724d0c[_0x63ee('0x26')](0x194);}return _0x52aafe;};}function handleError(_0x3b97f4,_0x69e823){_0x69e823=_0x69e823||0x1f4;return function(_0x55789d){logger[_0x63ee('0x27')](_0x55789d[_0x63ee('0x28')]);if(_0x55789d[_0x63ee('0x29')]){delete _0x55789d[_0x63ee('0x29')];}_0x3b97f4[_0x63ee('0x17')](_0x69e823)[_0x63ee('0x2a')](_0x55789d);};}exports[_0x63ee('0x2b')]=function(_0x1cf3ea,_0x4e1c2a){var _0x1332c5={},_0x1b83bb={},_0x52c0b6={'count':0x0,'rows':[]};var _0x73584a=_[_0x63ee('0x2c')](db['FreshsalesAccount']['rawAttributes'],function(_0x424ecd){return{'name':_0x424ecd['fieldName'],'type':_0x424ecd[_0x63ee('0x2d')][_0x63ee('0x2e')]};});_0x1b83bb[_0x63ee('0x2f')]=_[_0x63ee('0x2c')](_0x73584a,_0x63ee('0x29'));_0x1b83bb[_0x63ee('0x30')]=_[_0x63ee('0x31')](_0x1cf3ea[_0x63ee('0x30')]);_0x1b83bb[_0x63ee('0x32')]=_[_0x63ee('0x33')](_0x1b83bb[_0x63ee('0x2f')],_0x1b83bb[_0x63ee('0x30')]);_0x1332c5['attributes']=_[_0x63ee('0x33')](_0x1b83bb[_0x63ee('0x2f')],qs[_0x63ee('0x34')](_0x1cf3ea['query'][_0x63ee('0x34')]));_0x1332c5[_0x63ee('0x35')]=_0x1332c5[_0x63ee('0x35')][_0x63ee('0x36')]?_0x1332c5[_0x63ee('0x35')]:_0x1b83bb[_0x63ee('0x2f')];if(!_0x1cf3ea[_0x63ee('0x30')][_0x63ee('0x37')]('nolimit')){_0x1332c5[_0x63ee('0x1a')]=qs[_0x63ee('0x1a')](_0x1cf3ea[_0x63ee('0x30')][_0x63ee('0x1a')]);_0x1332c5[_0x63ee('0x1d')]=qs['offset'](_0x1cf3ea[_0x63ee('0x30')]['offset']);}_0x1332c5[_0x63ee('0x38')]=qs[_0x63ee('0x39')](_0x1cf3ea[_0x63ee('0x30')][_0x63ee('0x39')]);_0x1332c5[_0x63ee('0x3a')]=qs[_0x63ee('0x32')](_[_0x63ee('0x3b')](_0x1cf3ea[_0x63ee('0x30')],_0x1b83bb[_0x63ee('0x32')]),_0x73584a);if(_0x1cf3ea[_0x63ee('0x30')][_0x63ee('0x3c')]){_0x1332c5[_0x63ee('0x3a')]=_[_0x63ee('0x3d')](_0x1332c5[_0x63ee('0x3a')],{'$or':_[_0x63ee('0x2c')](_0x73584a,function(_0x282326){if(_0x282326[_0x63ee('0x2d')]!==_0x63ee('0x3e')){var _0x41c7c3={};_0x41c7c3[_0x282326[_0x63ee('0x29')]]={'$like':'%'+_0x1cf3ea[_0x63ee('0x30')]['filter']+'%'};return _0x41c7c3;}})});}_0x1332c5=_[_0x63ee('0x3d')]({},_0x1332c5,_0x1cf3ea[_0x63ee('0x3f')]);var _0x1c7146={'where':_0x1332c5[_0x63ee('0x3a')]};return db['FreshsalesAccount']['count'](_0x1c7146)['then'](function(_0x430f54){_0x52c0b6[_0x63ee('0x1c')]=_0x430f54;if(_0x1cf3ea[_0x63ee('0x30')][_0x63ee('0x40')]){_0x1332c5['include']=[{'all':!![]}];}return db[_0x63ee('0x41')][_0x63ee('0x42')](_0x1332c5);})[_0x63ee('0x25')](function(_0x3af5f9){_0x52c0b6[_0x63ee('0x43')]=_0x3af5f9;return _0x52c0b6;})[_0x63ee('0x25')](respondWithFilteredResult(_0x4e1c2a,_0x1332c5))[_0x63ee('0x44')](handleError(_0x4e1c2a,null));};exports[_0x63ee('0x45')]=function(_0x2ac585,_0x1de29e){var _0x1ca083={'raw':![],'where':{'id':_0x2ac585[_0x63ee('0x46')]['id']}},_0x55dbfa={};_0x55dbfa['model']=_[_0x63ee('0x31')](db[_0x63ee('0x41')][_0x63ee('0x47')]);_0x55dbfa[_0x63ee('0x30')]=_[_0x63ee('0x31')](_0x2ac585[_0x63ee('0x30')]);_0x55dbfa['filters']=_[_0x63ee('0x33')](_0x55dbfa[_0x63ee('0x2f')],_0x55dbfa['query']);_0x1ca083[_0x63ee('0x35')]=_[_0x63ee('0x33')](_0x55dbfa['model'],qs[_0x63ee('0x34')](_0x2ac585[_0x63ee('0x30')][_0x63ee('0x34')]));_0x1ca083[_0x63ee('0x35')]=_0x1ca083[_0x63ee('0x35')]['length']?_0x1ca083[_0x63ee('0x35')]:_0x55dbfa[_0x63ee('0x2f')];if(_0x2ac585[_0x63ee('0x30')][_0x63ee('0x40')]){_0x1ca083[_0x63ee('0x48')]=[{'all':!![]}];}_0x1ca083=_[_0x63ee('0x3d')]({},_0x1ca083,_0x2ac585['options']);return db[_0x63ee('0x41')][_0x63ee('0x49')](_0x1ca083)[_0x63ee('0x25')](handleEntityNotFound(_0x1de29e,null))[_0x63ee('0x25')](respondWithResult(_0x1de29e,null))[_0x63ee('0x44')](handleError(_0x1de29e,null));};exports['create']=function(_0x1095b2,_0x1714ee){return db[_0x63ee('0x41')][_0x63ee('0x4a')](_0x1095b2['body'],{})[_0x63ee('0x25')](respondWithResult(_0x1714ee,0xc9))['catch'](handleError(_0x1714ee,null));};exports[_0x63ee('0x23')]=function(_0x563036,_0x522336){if(_0x563036[_0x63ee('0x4b')]['id']){delete _0x563036[_0x63ee('0x4b')]['id'];}return db['FreshsalesAccount'][_0x63ee('0x49')]({'where':{'id':_0x563036[_0x63ee('0x46')]['id']}})[_0x63ee('0x25')](handleEntityNotFound(_0x522336,null))[_0x63ee('0x25')](saveUpdates(_0x563036[_0x63ee('0x4b')],null))[_0x63ee('0x25')](respondWithResult(_0x522336,null))[_0x63ee('0x44')](handleError(_0x522336,null));};exports['destroy']=function(_0x27cdc5,_0x3d326d){return db['FreshsalesAccount'][_0x63ee('0x49')]({'where':{'id':_0x27cdc5[_0x63ee('0x46')]['id']}})[_0x63ee('0x25')](handleEntityNotFound(_0x3d326d,null))[_0x63ee('0x25')](removeEntity(_0x3d326d,null))[_0x63ee('0x44')](handleError(_0x3d326d,null));};exports[_0x63ee('0x4c')]=function(_0x4610ef,_0x41c6a1,_0x537ded){var _0x306dea={};var _0x203140={};var _0x257962;var _0x5ee3ca;return db[_0x63ee('0x41')]['findOne']({'where':{'id':_0x4610ef['params']['id']}})[_0x63ee('0x25')](handleEntityNotFound(_0x41c6a1,null))['then'](function(_0x6be4b4){if(_0x6be4b4){_0x257962=_0x6be4b4;_0x203140['model']=_[_0x63ee('0x31')](db[_0x63ee('0x4d')][_0x63ee('0x47')]);_0x203140[_0x63ee('0x30')]=_[_0x63ee('0x31')](_0x4610ef[_0x63ee('0x30')]);_0x203140[_0x63ee('0x32')]=_['intersection'](_0x203140[_0x63ee('0x2f')],_0x203140['query']);_0x306dea[_0x63ee('0x35')]=_[_0x63ee('0x33')](_0x203140[_0x63ee('0x2f')],qs[_0x63ee('0x34')](_0x4610ef[_0x63ee('0x30')][_0x63ee('0x34')]));_0x306dea[_0x63ee('0x35')]=_0x306dea[_0x63ee('0x35')]['length']?_0x306dea[_0x63ee('0x35')]:_0x203140[_0x63ee('0x2f')];_0x306dea[_0x63ee('0x38')]=qs[_0x63ee('0x39')](_0x4610ef[_0x63ee('0x30')]['sort']);_0x306dea[_0x63ee('0x3a')]=qs[_0x63ee('0x32')](_['pick'](_0x4610ef[_0x63ee('0x30')],_0x203140[_0x63ee('0x32')]));if(_0x4610ef['query'][_0x63ee('0x3c')]){_0x306dea['where']=_[_0x63ee('0x3d')](_0x306dea[_0x63ee('0x3a')],{'$or':_['map'](_0x306dea[_0x63ee('0x35')],function(_0x4dddf6){var _0x55a4d8={};_0x55a4d8[_0x4dddf6]={'$like':'%'+_0x4610ef['query']['filter']+'%'};return _0x55a4d8;})});}_0x306dea=_[_0x63ee('0x3d')]({},_0x306dea,_0x4610ef[_0x63ee('0x3f')]);return _0x257962['getConfigurations'](_0x306dea);}})['then'](function(_0x484412){if(_0x484412){_0x5ee3ca=_0x484412[_0x63ee('0x36')];if(!_0x4610ef[_0x63ee('0x30')][_0x63ee('0x37')](_0x63ee('0x4e'))){_0x306dea[_0x63ee('0x1a')]=qs['limit'](_0x4610ef[_0x63ee('0x30')][_0x63ee('0x1a')]);_0x306dea[_0x63ee('0x1d')]=qs[_0x63ee('0x1d')](_0x4610ef[_0x63ee('0x30')]['offset']);}return _0x257962[_0x63ee('0x4c')](_0x306dea);}})[_0x63ee('0x25')](function(_0x5aa8a9){if(_0x5aa8a9){return _0x5aa8a9?{'count':_0x5ee3ca,'rows':_0x5aa8a9}:null;}})[_0x63ee('0x25')](respondWithResult(_0x41c6a1,null))[_0x63ee('0x44')](handleError(_0x41c6a1,null));};exports['addConfiguration']=function(_0x1bf11d,_0x651e8d,_0x253eec){if(_0x1bf11d[_0x63ee('0x4b')]['id']){delete _0x1bf11d[_0x63ee('0x4b')]['id'];}return db[_0x63ee('0x41')][_0x63ee('0x4f')]({'where':{'id':_0x1bf11d[_0x63ee('0x46')]['id']}})['then'](handleEntityNotFound(_0x651e8d,null))['then'](function(_0x453984){if(_0x453984){_0x1bf11d[_0x63ee('0x4b')][_0x63ee('0x50')]=_0x453984['id'];_0x1bf11d['body'][_0x63ee('0x51')]=integrations['getSubjects'](_0x1bf11d[_0x63ee('0x4b')][_0x63ee('0x52')],_0x1bf11d[_0x63ee('0x4b')][_0x63ee('0x2d')]);_0x1bf11d[_0x63ee('0x4b')]['Descriptions']=integrations['getDescriptions'](_0x1bf11d[_0x63ee('0x4b')][_0x63ee('0x52')],_0x1bf11d[_0x63ee('0x4b')]['type']);return db['FreshsalesConfiguration'][_0x63ee('0x4a')](_0x1bf11d['body'],{'include':[{'model':db[_0x63ee('0x53')],'as':_0x63ee('0x51')},{'model':db[_0x63ee('0x53')],'as':_0x63ee('0x54')}]});}return null;})[_0x63ee('0x25')](respondWithResult(_0x651e8d,null))['catch'](handleError(_0x651e8d,null));};exports[_0x63ee('0x55')]=function(_0x1a87e6,_0x16d639,_0x3c6a87){var _0x3a5a3c='';var _0x324637='';return db['FreshsalesAccount'][_0x63ee('0x4f')]({'where':{'id':_0x1a87e6[_0x63ee('0x46')]['id']},'attributes':['id','username','remoteUri',_0x63ee('0x56')]})[_0x63ee('0x25')](handleEntityNotFound(_0x16d639,null))['then'](function(_0x163451){if(_0x163451){_0x324637=_0x163451['username'];_0x3a5a3c=_0x163451[_0x63ee('0x57')];var _0x5afe07=_0x163451[_0x63ee('0x57')]['slice'](-0x1);if(_0x5afe07==='/'){_0x3a5a3c=_0x3a5a3c[_0x63ee('0x58')](0x0,_0x3a5a3c[_0x63ee('0x59')](_0x5afe07));}return rp({'method':'GET','uri':util[_0x63ee('0x5a')]('%s%s',_0x3a5a3c,_0x63ee('0x5b')),'headers':{'Authorization':_0x63ee('0x5c')+_0x163451['apiKey']},'json':!![]});}})['then'](function(_0x1fe1be){if(_0x1fe1be){var _0x443305=_0x1fe1be['users'];var _0x34f67c=![];var _0x255a46=null;for(_0x255a46=0x0;_0x255a46<_0x443305[_0x63ee('0x36')];_0x255a46++){if(_0x443305[_0x255a46][_0x63ee('0x5d')]===_0x324637){_0x34f67c=!![];}}if(_0x34f67c){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x63ee('0x25')](respondWithResult(_0x16d639,null))['catch'](function(_0xfbeeb7){var _0x35fd59=_0x1a87e6[_0x63ee('0x30')]['test']?0x1f4:_0xfbeeb7['statusCode']||0x1f4;logger[_0x63ee('0x27')](_0x63ee('0x5e'),_0x63ee('0x55'),_0x35fd59,JSON[_0x63ee('0x5f')](_0xfbeeb7));delete _0xfbeeb7[_0x63ee('0x29')];if(_0x35fd59===0x191){_0x35fd59=0x190;}_0x16d639[_0x63ee('0x17')](_0x35fd59)[_0x63ee('0x2a')](_0x1a87e6[_0x63ee('0x30')][_0x63ee('0x60')]?{'message':_0x63ee('0x61'),'statusCode':_0xfbeeb7['statusCode']}:_0xfbeeb7);});}; \ No newline at end of file +var _0x67b8=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','undefined','offset','limit','set','json','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','index','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshsalesAccount','count','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','getConfigurations','FreshsalesConfiguration','map','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','findOne','username','remoteUri','slice','substring','lastIndexOf','%s%s','/api/selector/owners','Token\x20token=','apiKey','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x1fd8f4,_0xaa4a62){var _0x9fcda2=function(_0x59b269){while(--_0x59b269){_0x1fd8f4['push'](_0x1fd8f4['shift']());}};_0x9fcda2(++_0xaa4a62);}(_0x67b8,0x18b));var _0x867b=function(_0x228b46,_0x6268b6){_0x228b46=_0x228b46-0x0;var _0x472296=_0x67b8[_0x228b46];return _0x472296;};'use strict';var emlformat=require(_0x867b('0x0'));var rimraf=require(_0x867b('0x1'));var zipdir=require(_0x867b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x867b('0x3'));var moment=require(_0x867b('0x4'));var BPromise=require(_0x867b('0x5'));var Mustache=require(_0x867b('0x6'));var util=require(_0x867b('0x7'));var path=require(_0x867b('0x8'));var sox=require(_0x867b('0x9'));var csv=require('to-csv');var ejs=require(_0x867b('0xa'));var fs=require('fs');var fs_extra=require(_0x867b('0xb'));var _=require(_0x867b('0xc'));var squel=require(_0x867b('0xd'));var crypto=require(_0x867b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x867b('0xf'));var toCsv=require(_0x867b('0x10'));var querystring=require(_0x867b('0x11'));var Papa=require(_0x867b('0x12'));var Redis=require(_0x867b('0x13'));var authService=require(_0x867b('0x14'));var qs=require(_0x867b('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x867b('0x16'));var licenseUtil=require(_0x867b('0x17'));var db=require(_0x867b('0x18'))['db'];var integrations=require(_0x867b('0x19'));function respondWithStatusCode(_0x2b7845,_0x480c3d){_0x480c3d=_0x480c3d||0xcc;return function(_0x2c64a9){if(_0x2c64a9){return _0x2b7845['sendStatus'](_0x480c3d);}return _0x2b7845[_0x867b('0x1a')](_0x480c3d)['end']();};}function respondWithResult(_0x273bb5,_0x352f78){_0x352f78=_0x352f78||0xc8;return function(_0x357a24){if(_0x357a24){return _0x273bb5[_0x867b('0x1a')](_0x352f78)['json'](_0x357a24);}};}function respondWithFilteredResult(_0xd3d4cf,_0x7d013a){return function(_0x40cdf8){if(_0x40cdf8){var _0x158391=typeof _0x7d013a['offset']===_0x867b('0x1b')&&typeof _0x7d013a['limit']===_0x867b('0x1b');var _0x597b81=_0x40cdf8['count'];var _0x35c368=_0x158391?0x0:_0x7d013a[_0x867b('0x1c')];var _0x2b4b20=_0x158391?_0x40cdf8['count']:_0x7d013a['offset']+_0x7d013a[_0x867b('0x1d')];var _0x4e1854;if(_0x2b4b20>=_0x597b81){_0x2b4b20=_0x597b81;_0x4e1854=0xc8;}else{_0x4e1854=0xce;}_0xd3d4cf[_0x867b('0x1a')](_0x4e1854);return _0xd3d4cf[_0x867b('0x1e')]('Content-Range',_0x35c368+'-'+_0x2b4b20+'/'+_0x597b81)[_0x867b('0x1f')](_0x40cdf8);}return null;};}function patchUpdates(_0x1db604){return function(_0x34934e){try{jsonpatch[_0x867b('0x20')](_0x34934e,_0x1db604,!![]);}catch(_0x199e12){return BPromise[_0x867b('0x21')](_0x199e12);}return _0x34934e[_0x867b('0x22')]();};}function saveUpdates(_0x28d6e6,_0x273fe1){return function(_0x1301cc){if(_0x1301cc){return _0x1301cc[_0x867b('0x23')](_0x28d6e6)['then'](function(_0x3066c9){return _0x3066c9;});}return null;};}function removeEntity(_0x3f74fc,_0x5426f2){return function(_0x545ecc){if(_0x545ecc){return _0x545ecc[_0x867b('0x24')]()[_0x867b('0x25')](function(){_0x3f74fc[_0x867b('0x1a')](0xcc)[_0x867b('0x26')]();});}};}function handleEntityNotFound(_0x236f86,_0x12bbdc){return function(_0xa0cfa1){if(!_0xa0cfa1){_0x236f86[_0x867b('0x27')](0x194);}return _0xa0cfa1;};}function handleError(_0xb034f,_0x166905){_0x166905=_0x166905||0x1f4;return function(_0x1fea24){logger[_0x867b('0x28')](_0x1fea24[_0x867b('0x29')]);if(_0x1fea24[_0x867b('0x2a')]){delete _0x1fea24['name'];}_0xb034f[_0x867b('0x1a')](_0x166905)['send'](_0x1fea24);};}exports[_0x867b('0x2b')]=function(_0x5c5970,_0x8cd4ad){var _0x36af39={},_0x23c45d={},_0x10703c={'count':0x0,'rows':[]};var _0xd13434=_['map'](db['FreshsalesAccount']['rawAttributes'],function(_0x43cb46){return{'name':_0x43cb46[_0x867b('0x2c')],'type':_0x43cb46['type'][_0x867b('0x2d')]};});_0x23c45d['model']=_['map'](_0xd13434,'name');_0x23c45d[_0x867b('0x2e')]=_[_0x867b('0x2f')](_0x5c5970[_0x867b('0x2e')]);_0x23c45d[_0x867b('0x30')]=_[_0x867b('0x31')](_0x23c45d[_0x867b('0x32')],_0x23c45d[_0x867b('0x2e')]);_0x36af39[_0x867b('0x33')]=_['intersection'](_0x23c45d[_0x867b('0x32')],qs[_0x867b('0x34')](_0x5c5970[_0x867b('0x2e')][_0x867b('0x34')]));_0x36af39[_0x867b('0x33')]=_0x36af39[_0x867b('0x33')][_0x867b('0x35')]?_0x36af39[_0x867b('0x33')]:_0x23c45d[_0x867b('0x32')];if(!_0x5c5970[_0x867b('0x2e')]['hasOwnProperty'](_0x867b('0x36'))){_0x36af39[_0x867b('0x1d')]=qs[_0x867b('0x1d')](_0x5c5970[_0x867b('0x2e')][_0x867b('0x1d')]);_0x36af39[_0x867b('0x1c')]=qs[_0x867b('0x1c')](_0x5c5970[_0x867b('0x2e')][_0x867b('0x1c')]);}_0x36af39['order']=qs['sort'](_0x5c5970[_0x867b('0x2e')][_0x867b('0x37')]);_0x36af39[_0x867b('0x38')]=qs[_0x867b('0x30')](_[_0x867b('0x39')](_0x5c5970[_0x867b('0x2e')],_0x23c45d[_0x867b('0x30')]),_0xd13434);if(_0x5c5970[_0x867b('0x2e')][_0x867b('0x3a')]){_0x36af39['where']=_[_0x867b('0x3b')](_0x36af39[_0x867b('0x38')],{'$or':_['map'](_0xd13434,function(_0x29783b){if(_0x29783b[_0x867b('0x3c')]!==_0x867b('0x3d')){var _0x5091a5={};_0x5091a5[_0x29783b[_0x867b('0x2a')]]={'$like':'%'+_0x5c5970[_0x867b('0x2e')]['filter']+'%'};return _0x5091a5;}})});}_0x36af39=_[_0x867b('0x3b')]({},_0x36af39,_0x5c5970[_0x867b('0x3e')]);var _0x2e2af0={'where':_0x36af39['where']};return db[_0x867b('0x3f')][_0x867b('0x40')](_0x2e2af0)[_0x867b('0x25')](function(_0xc1506c){_0x10703c[_0x867b('0x40')]=_0xc1506c;if(_0x5c5970[_0x867b('0x2e')][_0x867b('0x41')]){_0x36af39[_0x867b('0x42')]=[{'all':!![]}];}return db[_0x867b('0x3f')][_0x867b('0x43')](_0x36af39);})['then'](function(_0x183bcf){_0x10703c[_0x867b('0x44')]=_0x183bcf;return _0x10703c;})[_0x867b('0x25')](respondWithFilteredResult(_0x8cd4ad,_0x36af39))[_0x867b('0x45')](handleError(_0x8cd4ad,null));};exports['show']=function(_0x1e3407,_0x58e755){var _0x37ec23={'raw':![],'where':{'id':_0x1e3407[_0x867b('0x46')]['id']}},_0x9b6fb8={};_0x9b6fb8[_0x867b('0x32')]=_[_0x867b('0x2f')](db['FreshsalesAccount'][_0x867b('0x47')]);_0x9b6fb8[_0x867b('0x2e')]=_[_0x867b('0x2f')](_0x1e3407[_0x867b('0x2e')]);_0x9b6fb8[_0x867b('0x30')]=_[_0x867b('0x31')](_0x9b6fb8[_0x867b('0x32')],_0x9b6fb8[_0x867b('0x2e')]);_0x37ec23[_0x867b('0x33')]=_[_0x867b('0x31')](_0x9b6fb8[_0x867b('0x32')],qs[_0x867b('0x34')](_0x1e3407[_0x867b('0x2e')][_0x867b('0x34')]));_0x37ec23[_0x867b('0x33')]=_0x37ec23[_0x867b('0x33')][_0x867b('0x35')]?_0x37ec23['attributes']:_0x9b6fb8[_0x867b('0x32')];if(_0x1e3407[_0x867b('0x2e')][_0x867b('0x41')]){_0x37ec23['include']=[{'all':!![]}];}_0x37ec23=_['merge']({},_0x37ec23,_0x1e3407['options']);return db[_0x867b('0x3f')][_0x867b('0x48')](_0x37ec23)[_0x867b('0x25')](handleEntityNotFound(_0x58e755,null))[_0x867b('0x25')](respondWithResult(_0x58e755,null))['catch'](handleError(_0x58e755,null));};exports[_0x867b('0x49')]=function(_0x2d33c0,_0x5896b2){return db[_0x867b('0x3f')][_0x867b('0x49')](_0x2d33c0[_0x867b('0x4a')],{})[_0x867b('0x25')](respondWithResult(_0x5896b2,0xc9))[_0x867b('0x45')](handleError(_0x5896b2,null));};exports['update']=function(_0x327e0d,_0x1c50ce){if(_0x327e0d[_0x867b('0x4a')]['id']){delete _0x327e0d[_0x867b('0x4a')]['id'];}return db[_0x867b('0x3f')][_0x867b('0x48')]({'where':{'id':_0x327e0d[_0x867b('0x46')]['id']}})[_0x867b('0x25')](handleEntityNotFound(_0x1c50ce,null))[_0x867b('0x25')](saveUpdates(_0x327e0d[_0x867b('0x4a')],null))[_0x867b('0x25')](respondWithResult(_0x1c50ce,null))[_0x867b('0x45')](handleError(_0x1c50ce,null));};exports[_0x867b('0x24')]=function(_0x3824d9,_0x30e1af){return db[_0x867b('0x3f')][_0x867b('0x48')]({'where':{'id':_0x3824d9[_0x867b('0x46')]['id']}})['then'](handleEntityNotFound(_0x30e1af,null))[_0x867b('0x25')](removeEntity(_0x30e1af,null))['catch'](handleError(_0x30e1af,null));};exports[_0x867b('0x4b')]=function(_0x56d136,_0x2fcc3d,_0x4d3b3e){var _0x127d3f={};var _0x4a5255={};var _0x22fc94;var _0x44d280;return db[_0x867b('0x3f')]['findOne']({'where':{'id':_0x56d136[_0x867b('0x46')]['id']}})[_0x867b('0x25')](handleEntityNotFound(_0x2fcc3d,null))[_0x867b('0x25')](function(_0xbffa58){if(_0xbffa58){_0x22fc94=_0xbffa58;_0x4a5255[_0x867b('0x32')]=_[_0x867b('0x2f')](db[_0x867b('0x4c')][_0x867b('0x47')]);_0x4a5255['query']=_[_0x867b('0x2f')](_0x56d136[_0x867b('0x2e')]);_0x4a5255[_0x867b('0x30')]=_[_0x867b('0x31')](_0x4a5255[_0x867b('0x32')],_0x4a5255[_0x867b('0x2e')]);_0x127d3f[_0x867b('0x33')]=_[_0x867b('0x31')](_0x4a5255[_0x867b('0x32')],qs[_0x867b('0x34')](_0x56d136[_0x867b('0x2e')][_0x867b('0x34')]));_0x127d3f[_0x867b('0x33')]=_0x127d3f[_0x867b('0x33')][_0x867b('0x35')]?_0x127d3f[_0x867b('0x33')]:_0x4a5255[_0x867b('0x32')];_0x127d3f['order']=qs['sort'](_0x56d136[_0x867b('0x2e')][_0x867b('0x37')]);_0x127d3f[_0x867b('0x38')]=qs[_0x867b('0x30')](_['pick'](_0x56d136[_0x867b('0x2e')],_0x4a5255[_0x867b('0x30')]));if(_0x56d136['query'][_0x867b('0x3a')]){_0x127d3f['where']=_[_0x867b('0x3b')](_0x127d3f[_0x867b('0x38')],{'$or':_[_0x867b('0x4d')](_0x127d3f[_0x867b('0x33')],function(_0x2c4582){var _0x4fbb61={};_0x4fbb61[_0x2c4582]={'$like':'%'+_0x56d136[_0x867b('0x2e')][_0x867b('0x3a')]+'%'};return _0x4fbb61;})});}_0x127d3f=_['merge']({},_0x127d3f,_0x56d136[_0x867b('0x3e')]);return _0x22fc94[_0x867b('0x4b')](_0x127d3f);}})[_0x867b('0x25')](function(_0xb5e3cc){if(_0xb5e3cc){_0x44d280=_0xb5e3cc[_0x867b('0x35')];if(!_0x56d136['query']['hasOwnProperty']('nolimit')){_0x127d3f['limit']=qs[_0x867b('0x1d')](_0x56d136[_0x867b('0x2e')][_0x867b('0x1d')]);_0x127d3f[_0x867b('0x1c')]=qs[_0x867b('0x1c')](_0x56d136[_0x867b('0x2e')][_0x867b('0x1c')]);}return _0x22fc94['getConfigurations'](_0x127d3f);}})['then'](function(_0x18df15){if(_0x18df15){return _0x18df15?{'count':_0x44d280,'rows':_0x18df15}:null;}})[_0x867b('0x25')](respondWithResult(_0x2fcc3d,null))[_0x867b('0x45')](handleError(_0x2fcc3d,null));};exports[_0x867b('0x4e')]=function(_0x356e41,_0x54b0b4,_0x3e882f){if(_0x356e41[_0x867b('0x4a')]['id']){delete _0x356e41[_0x867b('0x4a')]['id'];}return db[_0x867b('0x3f')]['findOne']({'where':{'id':_0x356e41[_0x867b('0x46')]['id']}})[_0x867b('0x25')](handleEntityNotFound(_0x54b0b4,null))[_0x867b('0x25')](function(_0x16df0e){if(_0x16df0e){_0x356e41[_0x867b('0x4a')]['AccountId']=_0x16df0e['id'];_0x356e41['body'][_0x867b('0x4f')]=integrations[_0x867b('0x50')](_0x356e41[_0x867b('0x4a')]['channel'],_0x356e41[_0x867b('0x4a')][_0x867b('0x3c')]);_0x356e41['body'][_0x867b('0x51')]=integrations[_0x867b('0x52')](_0x356e41['body'][_0x867b('0x53')],_0x356e41[_0x867b('0x4a')][_0x867b('0x3c')]);return db[_0x867b('0x4c')][_0x867b('0x49')](_0x356e41[_0x867b('0x4a')],{'include':[{'model':db[_0x867b('0x54')],'as':_0x867b('0x4f')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x54b0b4,null))[_0x867b('0x45')](handleError(_0x54b0b4,null));};exports[_0x867b('0x55')]=function(_0xeb42b6,_0x189fd8,_0xeba785){var _0x247ac6='';var _0x3d6e0e='';return db['FreshsalesAccount'][_0x867b('0x56')]({'where':{'id':_0xeb42b6[_0x867b('0x46')]['id']},'attributes':['id',_0x867b('0x57'),'remoteUri','apiKey']})[_0x867b('0x25')](handleEntityNotFound(_0x189fd8,null))[_0x867b('0x25')](function(_0x56e53a){if(_0x56e53a){_0x3d6e0e=_0x56e53a['username'];_0x247ac6=_0x56e53a[_0x867b('0x58')];var _0x52f95c=_0x56e53a[_0x867b('0x58')][_0x867b('0x59')](-0x1);if(_0x52f95c==='/'){_0x247ac6=_0x247ac6[_0x867b('0x5a')](0x0,_0x247ac6[_0x867b('0x5b')](_0x52f95c));}return rp({'method':'GET','uri':util['format'](_0x867b('0x5c'),_0x247ac6,_0x867b('0x5d')),'headers':{'Authorization':_0x867b('0x5e')+_0x56e53a[_0x867b('0x5f')]},'json':!![]});}})['then'](function(_0x39fdab){if(_0x39fdab){var _0x201306=_0x39fdab['users'];var _0x2e075e=![];var _0x30f476=null;for(_0x30f476=0x0;_0x30f476<_0x201306[_0x867b('0x35')];_0x30f476++){if(_0x201306[_0x30f476]['email']===_0x3d6e0e){_0x2e075e=!![];}}if(_0x2e075e){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x867b('0x25')](respondWithResult(_0x189fd8,null))[_0x867b('0x45')](function(_0x3c6b1d){var _0x2f3ff8=_0xeb42b6['query'][_0x867b('0x60')]?0x1f4:_0x3c6b1d[_0x867b('0x61')]||0x1f4;logger[_0x867b('0x28')](_0x867b('0x62'),_0x867b('0x55'),_0x2f3ff8,JSON[_0x867b('0x63')](_0x3c6b1d));delete _0x3c6b1d['name'];if(_0x2f3ff8===0x191){_0x2f3ff8=0x190;}_0x189fd8[_0x867b('0x1a')](_0x2f3ff8)['send'](_0xeb42b6[_0x867b('0x2e')][_0x867b('0x60')]?{'message':'Wrong\x20credentials','statusCode':_0x3c6b1d[_0x867b('0x61')]}:_0x3c6b1d);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index f030b22..827ee12 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 _0x4fb4=['moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','util','../../config/logger','api'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4fb4,0x190));var _0x44fb=function(_0x5ae90f,_0x55ab72){_0x5ae90f=_0x5ae90f-0x0;var _0x224db3=_0x4fb4[_0x5ae90f];return _0x224db3;};'use strict';var _=require('lodash');var util=require(_0x44fb('0x0'));var logger=require(_0x44fb('0x1'))(_0x44fb('0x2'));var moment=require(_0x44fb('0x3'));var BPromise=require(_0x44fb('0x4'));var rp=require(_0x44fb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var attributes=require(_0x44fb('0x8'));var integrations=require(_0x44fb('0x9'));module[_0x44fb('0xa')]=function(_0x173e70,_0x464af5){return _0x173e70[_0x44fb('0xb')]('FreshsalesAccount',attributes,{'tableName':_0x44fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1893=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5d2b66,_0x20c523){var _0x4f1c10=function(_0x3b41ef){while(--_0x3b41ef){_0x5d2b66['push'](_0x5d2b66['shift']());}};_0x4f1c10(++_0x20c523);}(_0x1893,0xa2));var _0x3189=function(_0x13f2b7,_0x224502){_0x13f2b7=_0x13f2b7-0x0;var _0x59c0d6=_0x1893[_0x13f2b7];return _0x59c0d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3189('0x0'))(_0x3189('0x1'));var moment=require(_0x3189('0x2'));var BPromise=require(_0x3189('0x3'));var rp=require(_0x3189('0x4'));var fs=require('fs');var path=require(_0x3189('0x5'));var rimraf=require(_0x3189('0x6'));var config=require('../../config/environment');var attributes=require(_0x3189('0x7'));var integrations=require(_0x3189('0x8'));module[_0x3189('0x9')]=function(_0x4080a9,_0x77c566){return _0x4080a9[_0x3189('0xa')](_0x3189('0xb'),attributes,{'tableName':_0x3189('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 9ce43fe..2375169 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 _0x7096=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','map','model','find','ShowFreshsalesAccount','util','bluebird','ioredis','../../mysqldb'];(function(_0x393d80,_0x3cb358){var _0x12569f=function(_0x507e69){while(--_0x507e69){_0x393d80['push'](_0x393d80['shift']());}};_0x12569f(++_0x3cb358);}(_0x7096,0x10c));var _0x6709=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x7096[_0x15bc81];return _0x59440e;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});}exports[_0x6709('0x16')]=function(_0x235a54){var _0x4a732e=this;return new Promise(function(_0x9c1fd8,_0x166c97){return db[_0x6709('0x17')]['findAll']({'raw':_0x235a54[_0x6709('0x18')]?_0x235a54[_0x6709('0x18')][_0x6709('0x19')]===undefined?!![]:![]:!![],'where':_0x235a54[_0x6709('0x18')]?_0x235a54['options'][_0x6709('0x1a')]||null:null,'attributes':_0x235a54[_0x6709('0x18')]?_0x235a54[_0x6709('0x18')][_0x6709('0x1b')]||null:null,'limit':_0x235a54[_0x6709('0x18')]?_0x235a54[_0x6709('0x18')][_0x6709('0x1c')]||null:null,'include':_0x235a54[_0x6709('0x18')]?_0x235a54[_0x6709('0x18')][_0x6709('0x1d')]?_[_0x6709('0x1e')](_0x235a54[_0x6709('0x18')]['include'],function(_0x29f25f){return{'model':db[_0x29f25f[_0x6709('0x1f')]],'as':_0x29f25f['as'],'attributes':_0x29f25f[_0x6709('0x1b')],'include':_0x29f25f['include']?_[_0x6709('0x1e')](_0x29f25f[_0x6709('0x1d')],function(_0x20a347){return{'model':db[_0x20a347[_0x6709('0x1f')]],'as':_0x20a347['as'],'attributes':_0x20a347['attributes'],'include':_0x20a347[_0x6709('0x1d')]?_[_0x6709('0x1e')](_0x20a347['include'],function(_0x585073){return{'model':db[_0x585073[_0x6709('0x1f')]],'as':_0x585073['as'],'attributes':_0x585073['attributes']};}):[]};}):[]};}):[]:[]})[_0x6709('0xb')](function(_0x2499a2){logger['info'](_0x6709('0x16'),_0x235a54);logger['debug'](_0x6709('0x16'),_0x235a54,JSON[_0x6709('0x10')](_0x2499a2));_0x9c1fd8(_0x2499a2);})['catch'](function(_0x137137){logger['error'](_0x6709('0x16'),_0x137137[_0x6709('0x13')],_0x235a54);_0x166c97(_0x4a732e['error'](0x1f4,_0x137137[_0x6709('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x138318){var _0x135f46=this;return new Promise(function(_0x4b93b2,_0x564dcb){return db[_0x6709('0x17')][_0x6709('0x20')]({'raw':_0x138318[_0x6709('0x18')]?_0x138318[_0x6709('0x18')][_0x6709('0x19')]===undefined?!![]:![]:!![],'where':_0x138318[_0x6709('0x18')]?_0x138318[_0x6709('0x18')][_0x6709('0x1a')]||null:null,'attributes':_0x138318[_0x6709('0x18')]?_0x138318['options'][_0x6709('0x1b')]||null:null,'include':_0x138318[_0x6709('0x18')]?_0x138318[_0x6709('0x18')][_0x6709('0x1d')]?_['map'](_0x138318[_0x6709('0x18')][_0x6709('0x1d')],function(_0x124e01){return{'model':db[_0x124e01[_0x6709('0x1f')]],'as':_0x124e01['as'],'attributes':_0x124e01['attributes'],'include':_0x124e01[_0x6709('0x1d')]?_[_0x6709('0x1e')](_0x124e01['include'],function(_0x8952f1){return{'model':db[_0x8952f1[_0x6709('0x1f')]],'as':_0x8952f1['as'],'attributes':_0x8952f1['attributes'],'include':_0x8952f1[_0x6709('0x1d')]?_[_0x6709('0x1e')](_0x8952f1[_0x6709('0x1d')],function(_0xf30c4c){return{'model':db[_0xf30c4c[_0x6709('0x1f')]],'as':_0xf30c4c['as'],'attributes':_0xf30c4c[_0x6709('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6709('0xb')](function(_0x4bfed4){logger[_0x6709('0xc')](_0x6709('0x21'),_0x138318);logger['debug'](_0x6709('0x21'),_0x138318,JSON[_0x6709('0x10')](_0x4bfed4));_0x4b93b2(_0x4bfed4);})[_0x6709('0x15')](function(_0x2bb89c){logger[_0x6709('0x11')](_0x6709('0x21'),_0x2bb89c['message'],_0x138318);_0x564dcb(_0x135f46[_0x6709('0x11')](0x1f4,_0x2bb89c['message']));});});}; \ No newline at end of file +var _0x81c6=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes','ShowFreshsalesAccount','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','FreshsalesAccount,\x20%s,\x20%s'];(function(_0x585fbe,_0x369c77){var _0x5c3f3b=function(_0x4f3c31){while(--_0x4f3c31){_0x585fbe['push'](_0x585fbe['shift']());}};_0x5c3f3b(++_0x369c77);}(_0x81c6,0x1d5));var _0x681c=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0x81c6[_0x44a64f];return _0x52024b;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45331,_0xdc57a5,_0x5624d7){return new BPromise(function(_0x5b5f22,_0x1750e2){return client[_0x681c('0x8')](_0x45331,_0x5624d7)[_0x681c('0x9')](function(_0x5de78e){logger['info'](_0x681c('0xa'),_0xdc57a5,'request\x20sent');logger[_0x681c('0xb')](_0x681c('0xc'),_0xdc57a5,_0x681c('0xd'),JSON[_0x681c('0xe')](_0x5de78e));if(_0x5de78e['error']){if(_0x5de78e['error'][_0x681c('0xf')]===0x1f4){logger[_0x681c('0x10')](_0x681c('0xa'),_0xdc57a5,_0x5de78e['error'][_0x681c('0x11')]);return _0x1750e2(_0x5de78e['error'][_0x681c('0x11')]);}logger['error'](_0x681c('0xa'),_0xdc57a5,_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);return _0x5b5f22(_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);}else{logger[_0x681c('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0xdc57a5,_0x681c('0xd'));_0x5b5f22(_0x5de78e[_0x681c('0x13')][_0x681c('0x11')]);}})[_0x681c('0x14')](function(_0x2fce11){logger[_0x681c('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0xdc57a5,_0x2fce11);_0x1750e2(_0x2fce11);});});}exports[_0x681c('0x15')]=function(_0x42f506){var _0x4a9192=this;return new Promise(function(_0x42304f,_0x5b03fd){return db[_0x681c('0x16')][_0x681c('0x17')]({'raw':_0x42f506['options']?_0x42f506[_0x681c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x19')]||null:null,'attributes':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')]['attributes']||null:null,'limit':_0x42f506['options']?_0x42f506['options'][_0x681c('0x1a')]||null:null,'include':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x1b')]?_[_0x681c('0x1c')](_0x42f506[_0x681c('0x18')][_0x681c('0x1b')],function(_0x3d0297){return{'model':db[_0x3d0297[_0x681c('0x1d')]],'as':_0x3d0297['as'],'attributes':_0x3d0297[_0x681c('0x1e')],'include':_0x3d0297[_0x681c('0x1b')]?_[_0x681c('0x1c')](_0x3d0297[_0x681c('0x1b')],function(_0x218410){return{'model':db[_0x218410[_0x681c('0x1d')]],'as':_0x218410['as'],'attributes':_0x218410[_0x681c('0x1e')],'include':_0x218410['include']?_[_0x681c('0x1c')](_0x218410['include'],function(_0x5f8d64){return{'model':db[_0x5f8d64['model']],'as':_0x5f8d64['as'],'attributes':_0x5f8d64['attributes']};}):[]};}):[]};}):[]:[]})[_0x681c('0x9')](function(_0x17ea7c){logger[_0x681c('0x12')](_0x681c('0x15'),_0x42f506);logger['debug'](_0x681c('0x15'),_0x42f506,JSON[_0x681c('0xe')](_0x17ea7c));_0x42304f(_0x17ea7c);})[_0x681c('0x14')](function(_0x936fce){logger[_0x681c('0x10')](_0x681c('0x15'),_0x936fce[_0x681c('0x11')],_0x42f506);_0x5b03fd(_0x4a9192['error'](0x1f4,_0x936fce[_0x681c('0x11')]));});});};exports[_0x681c('0x1f')]=function(_0x2e783d){var _0x4af6aa=this;return new Promise(function(_0x385b14,_0x2179cd){return db[_0x681c('0x16')]['find']({'raw':_0x2e783d[_0x681c('0x18')]?_0x2e783d['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e783d[_0x681c('0x18')]?_0x2e783d[_0x681c('0x18')][_0x681c('0x19')]||null:null,'attributes':_0x2e783d['options']?_0x2e783d[_0x681c('0x18')]['attributes']||null:null,'include':_0x2e783d[_0x681c('0x18')]?_0x2e783d['options']['include']?_['map'](_0x2e783d[_0x681c('0x18')][_0x681c('0x1b')],function(_0x5a349a){return{'model':db[_0x5a349a[_0x681c('0x1d')]],'as':_0x5a349a['as'],'attributes':_0x5a349a['attributes'],'include':_0x5a349a['include']?_[_0x681c('0x1c')](_0x5a349a['include'],function(_0x35991d){return{'model':db[_0x35991d[_0x681c('0x1d')]],'as':_0x35991d['as'],'attributes':_0x35991d[_0x681c('0x1e')],'include':_0x35991d['include']?_['map'](_0x35991d[_0x681c('0x1b')],function(_0x4545ff){return{'model':db[_0x4545ff['model']],'as':_0x4545ff['as'],'attributes':_0x4545ff[_0x681c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x681c('0x9')](function(_0x302dab){logger['info'](_0x681c('0x1f'),_0x2e783d);logger[_0x681c('0xb')]('ShowFreshsalesAccount',_0x2e783d,JSON[_0x681c('0xe')](_0x302dab));_0x385b14(_0x302dab);})[_0x681c('0x14')](function(_0x83953c){logger[_0x681c('0x10')](_0x681c('0x1f'),_0x83953c['message'],_0x2e783d);_0x2179cd(_0x4af6aa['error'](0x1f4,_0x83953c[_0x681c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 293b931..8dbc286 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 _0x7239=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','create','put','update','delete','destroy','exports'];(function(_0x241abc,_0x3682b3){var _0x1a7b05=function(_0x3c5ef4){while(--_0x3c5ef4){_0x241abc['push'](_0x241abc['shift']());}};_0x1a7b05(++_0x3682b3);}(_0x7239,0x150));var _0x9723=function(_0x507251,_0x312754){_0x507251=_0x507251-0x0;var _0x220fd1=_0x7239[_0x507251];return _0x220fd1;};'use strict';var multer=require(_0x9723('0x0'));var util=require(_0x9723('0x1'));var path=require(_0x9723('0x2'));var timeout=require('connect-timeout');var express=require(_0x9723('0x3'));var router=express[_0x9723('0x4')]();var fs_extra=require(_0x9723('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9723('0x6'));var config=require(_0x9723('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x9723('0x8')]('/',auth[_0x9723('0x9')](),controller[_0x9723('0xa')]);router[_0x9723('0x8')](_0x9723('0xb'),auth[_0x9723('0x9')](),controller['show']);router[_0x9723('0x8')](_0x9723('0xc'),auth['isAuthenticated'](),controller[_0x9723('0xd')]);router['get'](_0x9723('0xe'),auth[_0x9723('0x9')](),controller['getDescriptions']);router['get']('/:id/fields',auth[_0x9723('0x9')](),controller['getFields']);router['post']('/',auth[_0x9723('0x9')](),controller[_0x9723('0xf')]);router[_0x9723('0x10')](_0x9723('0xb'),auth[_0x9723('0x9')](),controller[_0x9723('0x11')]);router[_0x9723('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9723('0x13')]);module[_0x9723('0x14')]=router; \ No newline at end of file +var _0xeabc=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','/:id','update','delete'];(function(_0x4fed5b,_0x47ebcd){var _0x438c2e=function(_0x2d2b9d){while(--_0x2d2b9d){_0x4fed5b['push'](_0x4fed5b['shift']());}};_0x438c2e(++_0x47ebcd);}(_0xeabc,0x9a));var _0xceab=function(_0x1b3da8,_0x474a4c){_0x1b3da8=_0x1b3da8-0x0;var _0x2fabfb=_0xeabc[_0x1b3da8];return _0x2fabfb;};'use strict';var multer=require(_0xceab('0x0'));var util=require(_0xceab('0x1'));var path=require('path');var timeout=require(_0xceab('0x2'));var express=require('express');var router=express[_0xceab('0x3')]();var fs_extra=require(_0xceab('0x4'));var auth=require(_0xceab('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xceab('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xceab('0x7')]('/',auth[_0xceab('0x8')](),controller[_0xceab('0x9')]);router[_0xceab('0x7')]('/:id',auth[_0xceab('0x8')](),controller[_0xceab('0xa')]);router[_0xceab('0x7')](_0xceab('0xb'),auth['isAuthenticated'](),controller[_0xceab('0xc')]);router[_0xceab('0x7')](_0xceab('0xd'),auth['isAuthenticated'](),controller[_0xceab('0xe')]);router[_0xceab('0x7')](_0xceab('0xf'),auth[_0xceab('0x8')](),controller[_0xceab('0x10')]);router[_0xceab('0x11')]('/',auth[_0xceab('0x8')](),controller[_0xceab('0x12')]);router['put'](_0xceab('0x13'),auth[_0xceab('0x8')](),controller[_0xceab('0x14')]);router[_0xceab('0x15')](_0xceab('0x13'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 5906ee5..97296c7 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 _0xffc0=['sequelize','exports','STRING'];(function(_0x3422c3,_0x31323a){var _0x3eaba0=function(_0x508fb2){while(--_0x508fb2){_0x3422c3['push'](_0x3422c3['shift']());}};_0x3eaba0(++_0x31323a);}(_0xffc0,0x1da));var _0x0ffc=function(_0x4bc835,_0x499261){_0x4bc835=_0x4bc835-0x0;var _0x45a9cd=_0xffc0[_0x4bc835];return _0x45a9cd;};'use strict';var Sequelize=require(_0x0ffc('0x0'));module[_0x0ffc('0x1')]={'name':{'type':Sequelize[_0x0ffc('0x2')]},'description':{'type':Sequelize[_0x0ffc('0x2')]}}; \ No newline at end of file +var _0x7c85=['STRING','sequelize'];(function(_0x5cdde3,_0x9789ce){var _0x53619d=function(_0x418e43){while(--_0x418e43){_0x5cdde3['push'](_0x5cdde3['shift']());}};_0x53619d(++_0x9789ce);}(_0x7c85,0x1cf));var _0x57c8=function(_0xa8b370,_0x2b77db){_0xa8b370=_0xa8b370-0x0;var _0x643e37=_0x7c85[_0xa8b370];return _0x643e37;};'use strict';var Sequelize=require(_0x57c8('0x0'));module['exports']={'name':{'type':Sequelize[_0x57c8('0x1')]},'description':{'type':Sequelize[_0x57c8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index b9f07e0..ad2f354 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 _0x04c7=['find','create','body','findOne','pick','getSubjects','FreshsalesField','getDescriptions','getFields','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x04c7,0x19e));var _0x704c=function(_0x585d09,_0x1274bc){_0x585d09=_0x585d09-0x0;var _0x7d9a14=_0x04c7[_0x585d09];return _0x7d9a14;};'use strict';var emlformat=require(_0x704c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x704c('0x1'));var rp=require(_0x704c('0x2'));var moment=require(_0x704c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x704c('0x4'));var util=require('util');var path=require(_0x704c('0x5'));var sox=require(_0x704c('0x6'));var csv=require(_0x704c('0x7'));var ejs=require(_0x704c('0x8'));var fs=require('fs');var fs_extra=require(_0x704c('0x9'));var _=require(_0x704c('0xa'));var squel=require(_0x704c('0xb'));var crypto=require(_0x704c('0xc'));var jsforce=require(_0x704c('0xd'));var deskjs=require(_0x704c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x704c('0xf'));var authService=require(_0x704c('0x10'));var qs=require(_0x704c('0x11'));var as=require(_0x704c('0x12'));var hardwareService=require(_0x704c('0x13'));var logger=require(_0x704c('0x14'))(_0x704c('0x15'));var utils=require(_0x704c('0x16'));var config=require(_0x704c('0x17'));var licenseUtil=require(_0x704c('0x18'));var db=require(_0x704c('0x19'))['db'];function respondWithStatusCode(_0x28f898,_0x8dc6de){_0x8dc6de=_0x8dc6de||0xcc;return function(_0x4897da){if(_0x4897da){return _0x28f898[_0x704c('0x1a')](_0x8dc6de);}return _0x28f898[_0x704c('0x1b')](_0x8dc6de)['end']();};}function respondWithResult(_0xab28db,_0x4d09e2){_0x4d09e2=_0x4d09e2||0xc8;return function(_0x2546c8){if(_0x2546c8){return _0xab28db[_0x704c('0x1b')](_0x4d09e2)[_0x704c('0x1c')](_0x2546c8);}};}function respondWithFilteredResult(_0x2f64ec,_0x345d87){return function(_0x407537){if(_0x407537){var _0x2b9901=typeof _0x345d87[_0x704c('0x1d')]===_0x704c('0x1e')&&typeof _0x345d87[_0x704c('0x1f')]===_0x704c('0x1e');var _0x3b67e2=_0x407537[_0x704c('0x20')];var _0x5bf8d1=_0x2b9901?0x0:_0x345d87[_0x704c('0x1d')];var _0x4e3f17=_0x2b9901?_0x407537[_0x704c('0x20')]:_0x345d87['offset']+_0x345d87['limit'];var _0x38ce46;if(_0x4e3f17>=_0x3b67e2){_0x4e3f17=_0x3b67e2;_0x38ce46=0xc8;}else{_0x38ce46=0xce;}_0x2f64ec[_0x704c('0x1b')](_0x38ce46);return _0x2f64ec['set'](_0x704c('0x21'),_0x5bf8d1+'-'+_0x4e3f17+'/'+_0x3b67e2)[_0x704c('0x1c')](_0x407537);}return null;};}function patchUpdates(_0x17ffbc){return function(_0x15f5e9){try{jsonpatch[_0x704c('0x22')](_0x15f5e9,_0x17ffbc,!![]);}catch(_0x35f730){return BPromise['reject'](_0x35f730);}return _0x15f5e9[_0x704c('0x23')]();};}function saveUpdates(_0x3fcce3,_0x492fe5){return function(_0x512c1f){if(_0x512c1f){return _0x512c1f[_0x704c('0x24')](_0x3fcce3)[_0x704c('0x25')](function(_0x549a01){return _0x549a01;});}return null;};}function removeEntity(_0x31e3ea,_0x2cb4ee){return function(_0x2c932a){if(_0x2c932a){return _0x2c932a[_0x704c('0x26')]()[_0x704c('0x25')](function(){_0x31e3ea[_0x704c('0x1b')](0xcc)[_0x704c('0x27')]();});}};}function handleEntityNotFound(_0x36680d,_0x3f9570){return function(_0x554b9a){if(!_0x554b9a){_0x36680d[_0x704c('0x1a')](0x194);}return _0x554b9a;};}function handleError(_0x8bf7df,_0x21e8b9){_0x21e8b9=_0x21e8b9||0x1f4;return function(_0x185f2a){logger['error'](_0x185f2a['stack']);if(_0x185f2a[_0x704c('0x28')]){delete _0x185f2a[_0x704c('0x28')];}_0x8bf7df[_0x704c('0x1b')](_0x21e8b9)[_0x704c('0x29')](_0x185f2a);};}exports[_0x704c('0x2a')]=function(_0x4945cd,_0x402ec6){var _0x2b4007={},_0x103a69={},_0x29ba64={'count':0x0,'rows':[]};var _0x158175=_[_0x704c('0x2b')](db[_0x704c('0x2c')][_0x704c('0x2d')],function(_0x321554){return{'name':_0x321554[_0x704c('0x2e')],'type':_0x321554[_0x704c('0x2f')][_0x704c('0x30')]};});_0x103a69[_0x704c('0x31')]=_['map'](_0x158175,'name');_0x103a69['query']=_[_0x704c('0x32')](_0x4945cd[_0x704c('0x33')]);_0x103a69[_0x704c('0x34')]=_['intersection'](_0x103a69['model'],_0x103a69[_0x704c('0x33')]);_0x2b4007[_0x704c('0x35')]=_['intersection'](_0x103a69[_0x704c('0x31')],qs[_0x704c('0x36')](_0x4945cd[_0x704c('0x33')][_0x704c('0x36')]));_0x2b4007[_0x704c('0x35')]=_0x2b4007['attributes'][_0x704c('0x37')]?_0x2b4007[_0x704c('0x35')]:_0x103a69['model'];if(!_0x4945cd[_0x704c('0x33')][_0x704c('0x38')](_0x704c('0x39'))){_0x2b4007[_0x704c('0x1f')]=qs[_0x704c('0x1f')](_0x4945cd[_0x704c('0x33')][_0x704c('0x1f')]);_0x2b4007[_0x704c('0x1d')]=qs[_0x704c('0x1d')](_0x4945cd[_0x704c('0x33')]['offset']);}_0x2b4007[_0x704c('0x3a')]=qs[_0x704c('0x3b')](_0x4945cd[_0x704c('0x33')][_0x704c('0x3b')]);_0x2b4007[_0x704c('0x3c')]=qs[_0x704c('0x34')](_['pick'](_0x4945cd[_0x704c('0x33')],_0x103a69[_0x704c('0x34')]),_0x158175);if(_0x4945cd[_0x704c('0x33')][_0x704c('0x3d')]){_0x2b4007[_0x704c('0x3c')]=_[_0x704c('0x3e')](_0x2b4007['where'],{'$or':_[_0x704c('0x2b')](_0x158175,function(_0x489b09){if(_0x489b09[_0x704c('0x2f')]!==_0x704c('0x3f')){var _0x4a3fb1={};_0x4a3fb1[_0x489b09[_0x704c('0x28')]]={'$like':'%'+_0x4945cd['query'][_0x704c('0x3d')]+'%'};return _0x4a3fb1;}})});}_0x2b4007=_[_0x704c('0x3e')]({},_0x2b4007,_0x4945cd[_0x704c('0x40')]);var _0x5ab2b6={'where':_0x2b4007[_0x704c('0x3c')]};return db[_0x704c('0x2c')][_0x704c('0x20')](_0x5ab2b6)[_0x704c('0x25')](function(_0x3e6609){_0x29ba64[_0x704c('0x20')]=_0x3e6609;if(_0x4945cd['query'][_0x704c('0x41')]){_0x2b4007[_0x704c('0x42')]=[{'all':!![]}];}return db[_0x704c('0x2c')][_0x704c('0x43')](_0x2b4007);})[_0x704c('0x25')](function(_0x5b224a){_0x29ba64['rows']=_0x5b224a;return _0x29ba64;})[_0x704c('0x25')](respondWithFilteredResult(_0x402ec6,_0x2b4007))[_0x704c('0x44')](handleError(_0x402ec6,null));};exports[_0x704c('0x45')]=function(_0x5dccec,_0x181447){var _0x165d18={'raw':![],'where':{'id':_0x5dccec[_0x704c('0x46')]['id']}},_0x13d5dc={};_0x13d5dc[_0x704c('0x31')]=_[_0x704c('0x32')](db[_0x704c('0x2c')][_0x704c('0x2d')]);_0x13d5dc[_0x704c('0x33')]=_[_0x704c('0x32')](_0x5dccec['query']);_0x13d5dc[_0x704c('0x34')]=_[_0x704c('0x47')](_0x13d5dc[_0x704c('0x31')],_0x13d5dc[_0x704c('0x33')]);_0x165d18['attributes']=_[_0x704c('0x47')](_0x13d5dc[_0x704c('0x31')],qs[_0x704c('0x36')](_0x5dccec['query']['fields']));_0x165d18[_0x704c('0x35')]=_0x165d18[_0x704c('0x35')][_0x704c('0x37')]?_0x165d18[_0x704c('0x35')]:_0x13d5dc[_0x704c('0x31')];if(_0x5dccec[_0x704c('0x33')][_0x704c('0x41')]){_0x165d18['include']=[{'all':!![]}];}_0x165d18=_[_0x704c('0x3e')]({},_0x165d18,_0x5dccec[_0x704c('0x40')]);return db[_0x704c('0x2c')][_0x704c('0x48')](_0x165d18)['then'](handleEntityNotFound(_0x181447,null))[_0x704c('0x25')](respondWithResult(_0x181447,null))[_0x704c('0x44')](handleError(_0x181447,null));};exports[_0x704c('0x49')]=function(_0x167207,_0x710c02){return db[_0x704c('0x2c')][_0x704c('0x49')](_0x167207[_0x704c('0x4a')],{})[_0x704c('0x25')](respondWithResult(_0x710c02,0xc9))['catch'](handleError(_0x710c02,null));};exports[_0x704c('0x24')]=function(_0x18d90c,_0x2e2b72){if(_0x18d90c[_0x704c('0x4a')]['id']){delete _0x18d90c[_0x704c('0x4a')]['id'];}return db[_0x704c('0x2c')][_0x704c('0x48')]({'where':{'id':_0x18d90c[_0x704c('0x46')]['id']}})[_0x704c('0x25')](handleEntityNotFound(_0x2e2b72,null))['then'](saveUpdates(_0x18d90c[_0x704c('0x4a')],null))['then'](respondWithResult(_0x2e2b72,null))[_0x704c('0x44')](handleError(_0x2e2b72,null));};exports['destroy']=function(_0x2d41e2,_0x85dc72){return db[_0x704c('0x2c')][_0x704c('0x48')]({'where':{'id':_0x2d41e2['params']['id']}})[_0x704c('0x25')](handleEntityNotFound(_0x85dc72,null))[_0x704c('0x25')](removeEntity(_0x85dc72,null))[_0x704c('0x44')](handleError(_0x85dc72,null));};exports['getSubjects']=function(_0x1d327c,_0xe07a5a,_0x38f0a5){var _0x490033={};var _0x2e861f={};var _0x360c23;var _0x121a9a;return db['FreshsalesConfiguration'][_0x704c('0x4b')]({'where':{'id':_0x1d327c[_0x704c('0x46')]['id']}})[_0x704c('0x25')](handleEntityNotFound(_0xe07a5a,null))[_0x704c('0x25')](function(_0x56525a){if(_0x56525a){_0x360c23=_0x56525a;_0x2e861f[_0x704c('0x31')]=_[_0x704c('0x32')](db['FreshsalesField']['rawAttributes']);_0x2e861f[_0x704c('0x33')]=_['keys'](_0x1d327c[_0x704c('0x33')]);_0x2e861f[_0x704c('0x34')]=_[_0x704c('0x47')](_0x2e861f[_0x704c('0x31')],_0x2e861f[_0x704c('0x33')]);_0x490033['attributes']=_[_0x704c('0x47')](_0x2e861f[_0x704c('0x31')],qs[_0x704c('0x36')](_0x1d327c[_0x704c('0x33')][_0x704c('0x36')]));_0x490033['attributes']=_0x490033['attributes']['length']?_0x490033[_0x704c('0x35')]:_0x2e861f[_0x704c('0x31')];_0x490033[_0x704c('0x3a')]=qs[_0x704c('0x3b')](_0x1d327c[_0x704c('0x33')][_0x704c('0x3b')]);_0x490033[_0x704c('0x3c')]=qs[_0x704c('0x34')](_[_0x704c('0x4c')](_0x1d327c[_0x704c('0x33')],_0x2e861f[_0x704c('0x34')]));if(_0x1d327c[_0x704c('0x33')][_0x704c('0x3d')]){_0x490033['where']=_[_0x704c('0x3e')](_0x490033['where'],{'$or':_[_0x704c('0x2b')](_0x490033[_0x704c('0x35')],function(_0x2760b8){var _0x23e73a={};_0x23e73a[_0x2760b8]={'$like':'%'+_0x1d327c[_0x704c('0x33')][_0x704c('0x3d')]+'%'};return _0x23e73a;})});}_0x490033=_[_0x704c('0x3e')]({},_0x490033,_0x1d327c[_0x704c('0x40')]);return _0x360c23[_0x704c('0x4d')](_0x490033);}})[_0x704c('0x25')](function(_0x23dd3a){if(_0x23dd3a){_0x121a9a=_0x23dd3a[_0x704c('0x37')];if(!_0x1d327c[_0x704c('0x33')][_0x704c('0x38')](_0x704c('0x39'))){_0x490033[_0x704c('0x1f')]=qs[_0x704c('0x1f')](_0x1d327c['query'][_0x704c('0x1f')]);_0x490033[_0x704c('0x1d')]=qs[_0x704c('0x1d')](_0x1d327c['query']['offset']);}return _0x360c23[_0x704c('0x4d')](_0x490033);}})[_0x704c('0x25')](function(_0x40d4d5){if(_0x40d4d5){return _0x40d4d5?{'count':_0x121a9a,'rows':_0x40d4d5}:null;}})[_0x704c('0x25')](respondWithResult(_0xe07a5a,null))[_0x704c('0x44')](handleError(_0xe07a5a,null));};exports['getDescriptions']=function(_0x12a5c8,_0x2be1d6,_0x1433a8){var _0x40ed5e={};var _0x1cd137={};var _0x3d5921;var _0x58a444;return db[_0x704c('0x2c')][_0x704c('0x4b')]({'where':{'id':_0x12a5c8['params']['id']}})[_0x704c('0x25')](handleEntityNotFound(_0x2be1d6,null))[_0x704c('0x25')](function(_0x4ccf93){if(_0x4ccf93){_0x3d5921=_0x4ccf93;_0x1cd137[_0x704c('0x31')]=_['keys'](db[_0x704c('0x4e')][_0x704c('0x2d')]);_0x1cd137['query']=_[_0x704c('0x32')](_0x12a5c8[_0x704c('0x33')]);_0x1cd137[_0x704c('0x34')]=_[_0x704c('0x47')](_0x1cd137[_0x704c('0x31')],_0x1cd137['query']);_0x40ed5e['attributes']=_['intersection'](_0x1cd137[_0x704c('0x31')],qs[_0x704c('0x36')](_0x12a5c8[_0x704c('0x33')][_0x704c('0x36')]));_0x40ed5e['attributes']=_0x40ed5e[_0x704c('0x35')][_0x704c('0x37')]?_0x40ed5e[_0x704c('0x35')]:_0x1cd137['model'];_0x40ed5e[_0x704c('0x3a')]=qs[_0x704c('0x3b')](_0x12a5c8[_0x704c('0x33')][_0x704c('0x3b')]);_0x40ed5e['where']=qs[_0x704c('0x34')](_['pick'](_0x12a5c8[_0x704c('0x33')],_0x1cd137[_0x704c('0x34')]));if(_0x12a5c8[_0x704c('0x33')]['filter']){_0x40ed5e[_0x704c('0x3c')]=_[_0x704c('0x3e')](_0x40ed5e['where'],{'$or':_[_0x704c('0x2b')](_0x40ed5e[_0x704c('0x35')],function(_0x1e51a3){var _0x4241db={};_0x4241db[_0x1e51a3]={'$like':'%'+_0x12a5c8['query'][_0x704c('0x3d')]+'%'};return _0x4241db;})});}_0x40ed5e=_['merge']({},_0x40ed5e,_0x12a5c8[_0x704c('0x40')]);return _0x3d5921['getDescriptions'](_0x40ed5e);}})['then'](function(_0x541ded){if(_0x541ded){_0x58a444=_0x541ded[_0x704c('0x37')];if(!_0x12a5c8[_0x704c('0x33')][_0x704c('0x38')](_0x704c('0x39'))){_0x40ed5e[_0x704c('0x1f')]=qs[_0x704c('0x1f')](_0x12a5c8[_0x704c('0x33')][_0x704c('0x1f')]);_0x40ed5e[_0x704c('0x1d')]=qs[_0x704c('0x1d')](_0x12a5c8[_0x704c('0x33')][_0x704c('0x1d')]);}return _0x3d5921[_0x704c('0x4f')](_0x40ed5e);}})[_0x704c('0x25')](function(_0x28d9e6){if(_0x28d9e6){return _0x28d9e6?{'count':_0x58a444,'rows':_0x28d9e6}:null;}})[_0x704c('0x25')](respondWithResult(_0x2be1d6,null))[_0x704c('0x44')](handleError(_0x2be1d6,null));};exports[_0x704c('0x50')]=function(_0x4de56e,_0x32838b,_0x4d1669){var _0x152837={};var _0x1af7ab={};var _0xb317f;var _0x1d27eb;return db['FreshsalesConfiguration'][_0x704c('0x4b')]({'where':{'id':_0x4de56e[_0x704c('0x46')]['id']}})[_0x704c('0x25')](handleEntityNotFound(_0x32838b,null))[_0x704c('0x25')](function(_0x350b75){if(_0x350b75){_0xb317f=_0x350b75;_0x1af7ab['model']=_[_0x704c('0x32')](db['FreshsalesField'][_0x704c('0x2d')]);_0x1af7ab[_0x704c('0x33')]=_[_0x704c('0x32')](_0x4de56e[_0x704c('0x33')]);_0x1af7ab[_0x704c('0x34')]=_[_0x704c('0x47')](_0x1af7ab['model'],_0x1af7ab[_0x704c('0x33')]);_0x152837['attributes']=_[_0x704c('0x47')](_0x1af7ab['model'],qs['fields'](_0x4de56e['query'][_0x704c('0x36')]));_0x152837[_0x704c('0x35')]=_0x152837['attributes'][_0x704c('0x37')]?_0x152837[_0x704c('0x35')]:_0x1af7ab[_0x704c('0x31')];_0x152837[_0x704c('0x3a')]=qs[_0x704c('0x3b')](_0x4de56e[_0x704c('0x33')]['sort']);_0x152837[_0x704c('0x3c')]=qs[_0x704c('0x34')](_[_0x704c('0x4c')](_0x4de56e[_0x704c('0x33')],_0x1af7ab[_0x704c('0x34')]));if(_0x4de56e[_0x704c('0x33')][_0x704c('0x3d')]){_0x152837[_0x704c('0x3c')]=_['merge'](_0x152837['where'],{'$or':_[_0x704c('0x2b')](_0x152837[_0x704c('0x35')],function(_0x5ca74a){var _0x54ca9d={};_0x54ca9d[_0x5ca74a]={'$like':'%'+_0x4de56e[_0x704c('0x33')][_0x704c('0x3d')]+'%'};return _0x54ca9d;})});}_0x152837=_[_0x704c('0x3e')]({},_0x152837,_0x4de56e[_0x704c('0x40')]);return _0xb317f[_0x704c('0x50')](_0x152837);}})['then'](function(_0x370335){if(_0x370335){_0x1d27eb=_0x370335[_0x704c('0x37')];if(!_0x4de56e[_0x704c('0x33')][_0x704c('0x38')](_0x704c('0x39'))){_0x152837[_0x704c('0x1f')]=qs[_0x704c('0x1f')](_0x4de56e[_0x704c('0x33')][_0x704c('0x1f')]);_0x152837[_0x704c('0x1d')]=qs['offset'](_0x4de56e[_0x704c('0x33')]['offset']);}return _0xb317f[_0x704c('0x50')](_0x152837);}})[_0x704c('0x25')](function(_0x361cb3){if(_0x361cb3){return _0x361cb3?{'count':_0x1d27eb,'rows':_0x361cb3}:null;}})[_0x704c('0x25')](respondWithResult(_0x32838b,null))[_0x704c('0x44')](handleError(_0x32838b,null));}; \ No newline at end of file +var _0x7908=['fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FreshsalesConfiguration','findAll','rows','catch','params','find','create','body','destroy','FreshsalesField','getSubjects','getDescriptions','getFields','findOne','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','offset','count','Content-Range','save','update','then','error','stack','name','send','index','map','rawAttributes'];(function(_0x37b08d,_0x2d9301){var _0x35c6dd=function(_0x576d38){while(--_0x576d38){_0x37b08d['push'](_0x37b08d['shift']());}};_0x35c6dd(++_0x2d9301);}(_0x7908,0x1a1));var _0x8790=function(_0x1a0405,_0x36cb81){_0x1a0405=_0x1a0405-0x0;var _0x220911=_0x7908[_0x1a0405];return _0x220911;};'use strict';var emlformat=require(_0x8790('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8790('0x1'));var moment=require(_0x8790('0x2'));var BPromise=require(_0x8790('0x3'));var Mustache=require(_0x8790('0x4'));var util=require('util');var path=require(_0x8790('0x5'));var sox=require(_0x8790('0x6'));var csv=require(_0x8790('0x7'));var ejs=require(_0x8790('0x8'));var fs=require('fs');var fs_extra=require(_0x8790('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8790('0xa'));var jsforce=require(_0x8790('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8790('0x7'));var querystring=require(_0x8790('0xc'));var Papa=require(_0x8790('0xd'));var Redis=require(_0x8790('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8790('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8790('0x10'));var utils=require(_0x8790('0x11'));var config=require(_0x8790('0x12'));var licenseUtil=require(_0x8790('0x13'));var db=require(_0x8790('0x14'))['db'];function respondWithStatusCode(_0x2af20e,_0x2a5a8e){_0x2a5a8e=_0x2a5a8e||0xcc;return function(_0x177a63){if(_0x177a63){return _0x2af20e[_0x8790('0x15')](_0x2a5a8e);}return _0x2af20e['status'](_0x2a5a8e)[_0x8790('0x16')]();};}function respondWithResult(_0x5a8f0c,_0x3eba85){_0x3eba85=_0x3eba85||0xc8;return function(_0xce2e85){if(_0xce2e85){return _0x5a8f0c[_0x8790('0x17')](_0x3eba85)['json'](_0xce2e85);}};}function respondWithFilteredResult(_0x245dc1,_0xba1ca1){return function(_0x81a844){if(_0x81a844){var _0x463555=typeof _0xba1ca1['offset']==='undefined'&&typeof _0xba1ca1[_0x8790('0x18')]===_0x8790('0x19');var _0x10db38=_0x81a844['count'];var _0x58b8a1=_0x463555?0x0:_0xba1ca1[_0x8790('0x1a')];var _0x18bf0f=_0x463555?_0x81a844[_0x8790('0x1b')]:_0xba1ca1[_0x8790('0x1a')]+_0xba1ca1['limit'];var _0x3a8e7d;if(_0x18bf0f>=_0x10db38){_0x18bf0f=_0x10db38;_0x3a8e7d=0xc8;}else{_0x3a8e7d=0xce;}_0x245dc1[_0x8790('0x17')](_0x3a8e7d);return _0x245dc1['set'](_0x8790('0x1c'),_0x58b8a1+'-'+_0x18bf0f+'/'+_0x10db38)['json'](_0x81a844);}return null;};}function patchUpdates(_0x23f67c){return function(_0x2b8270){try{jsonpatch['apply'](_0x2b8270,_0x23f67c,!![]);}catch(_0x57fb91){return BPromise['reject'](_0x57fb91);}return _0x2b8270[_0x8790('0x1d')]();};}function saveUpdates(_0x2afc32,_0x1b875d){return function(_0x3ae4a7){if(_0x3ae4a7){return _0x3ae4a7[_0x8790('0x1e')](_0x2afc32)[_0x8790('0x1f')](function(_0x3ce5b3){return _0x3ce5b3;});}return null;};}function removeEntity(_0x375c57,_0x3d60af){return function(_0x5738e4){if(_0x5738e4){return _0x5738e4['destroy']()[_0x8790('0x1f')](function(){_0x375c57[_0x8790('0x17')](0xcc)[_0x8790('0x16')]();});}};}function handleEntityNotFound(_0x4fb9a8,_0x2de1f1){return function(_0x5e1c20){if(!_0x5e1c20){_0x4fb9a8[_0x8790('0x15')](0x194);}return _0x5e1c20;};}function handleError(_0x537e90,_0x31d428){_0x31d428=_0x31d428||0x1f4;return function(_0x4d3516){logger[_0x8790('0x20')](_0x4d3516[_0x8790('0x21')]);if(_0x4d3516['name']){delete _0x4d3516[_0x8790('0x22')];}_0x537e90[_0x8790('0x17')](_0x31d428)[_0x8790('0x23')](_0x4d3516);};}exports[_0x8790('0x24')]=function(_0x26e611,_0x28a25f){var _0x530d40={},_0x5c96d8={},_0x5441e3={'count':0x0,'rows':[]};var _0xa5f1bc=_[_0x8790('0x25')](db['FreshsalesConfiguration'][_0x8790('0x26')],function(_0x49b091){return{'name':_0x49b091[_0x8790('0x27')],'type':_0x49b091[_0x8790('0x28')][_0x8790('0x29')]};});_0x5c96d8['model']=_[_0x8790('0x25')](_0xa5f1bc,_0x8790('0x22'));_0x5c96d8[_0x8790('0x2a')]=_[_0x8790('0x2b')](_0x26e611[_0x8790('0x2a')]);_0x5c96d8[_0x8790('0x2c')]=_[_0x8790('0x2d')](_0x5c96d8[_0x8790('0x2e')],_0x5c96d8['query']);_0x530d40[_0x8790('0x2f')]=_[_0x8790('0x2d')](_0x5c96d8[_0x8790('0x2e')],qs[_0x8790('0x30')](_0x26e611['query'][_0x8790('0x30')]));_0x530d40['attributes']=_0x530d40['attributes'][_0x8790('0x31')]?_0x530d40[_0x8790('0x2f')]:_0x5c96d8[_0x8790('0x2e')];if(!_0x26e611[_0x8790('0x2a')][_0x8790('0x32')](_0x8790('0x33'))){_0x530d40[_0x8790('0x18')]=qs['limit'](_0x26e611[_0x8790('0x2a')][_0x8790('0x18')]);_0x530d40[_0x8790('0x1a')]=qs[_0x8790('0x1a')](_0x26e611[_0x8790('0x2a')][_0x8790('0x1a')]);}_0x530d40[_0x8790('0x34')]=qs[_0x8790('0x35')](_0x26e611[_0x8790('0x2a')][_0x8790('0x35')]);_0x530d40[_0x8790('0x36')]=qs['filters'](_[_0x8790('0x37')](_0x26e611[_0x8790('0x2a')],_0x5c96d8[_0x8790('0x2c')]),_0xa5f1bc);if(_0x26e611[_0x8790('0x2a')][_0x8790('0x38')]){_0x530d40[_0x8790('0x36')]=_[_0x8790('0x39')](_0x530d40[_0x8790('0x36')],{'$or':_['map'](_0xa5f1bc,function(_0xc32181){if(_0xc32181[_0x8790('0x28')]!==_0x8790('0x3a')){var _0x75dc5a={};_0x75dc5a[_0xc32181['name']]={'$like':'%'+_0x26e611[_0x8790('0x2a')][_0x8790('0x38')]+'%'};return _0x75dc5a;}})});}_0x530d40=_['merge']({},_0x530d40,_0x26e611[_0x8790('0x3b')]);var _0x2a6c52={'where':_0x530d40[_0x8790('0x36')]};return db['FreshsalesConfiguration'][_0x8790('0x1b')](_0x2a6c52)[_0x8790('0x1f')](function(_0x4f4d77){_0x5441e3[_0x8790('0x1b')]=_0x4f4d77;if(_0x26e611['query'][_0x8790('0x3c')]){_0x530d40[_0x8790('0x3d')]=[{'all':!![]}];}return db[_0x8790('0x3e')][_0x8790('0x3f')](_0x530d40);})[_0x8790('0x1f')](function(_0x335bef){_0x5441e3[_0x8790('0x40')]=_0x335bef;return _0x5441e3;})['then'](respondWithFilteredResult(_0x28a25f,_0x530d40))[_0x8790('0x41')](handleError(_0x28a25f,null));};exports['show']=function(_0xaabba3,_0x24b3b7){var _0x535ae8={'raw':![],'where':{'id':_0xaabba3[_0x8790('0x42')]['id']}},_0x2d16ba={};_0x2d16ba[_0x8790('0x2e')]=_[_0x8790('0x2b')](db[_0x8790('0x3e')][_0x8790('0x26')]);_0x2d16ba[_0x8790('0x2a')]=_['keys'](_0xaabba3[_0x8790('0x2a')]);_0x2d16ba['filters']=_[_0x8790('0x2d')](_0x2d16ba['model'],_0x2d16ba[_0x8790('0x2a')]);_0x535ae8[_0x8790('0x2f')]=_[_0x8790('0x2d')](_0x2d16ba[_0x8790('0x2e')],qs[_0x8790('0x30')](_0xaabba3['query']['fields']));_0x535ae8[_0x8790('0x2f')]=_0x535ae8[_0x8790('0x2f')][_0x8790('0x31')]?_0x535ae8[_0x8790('0x2f')]:_0x2d16ba[_0x8790('0x2e')];if(_0xaabba3[_0x8790('0x2a')][_0x8790('0x3c')]){_0x535ae8[_0x8790('0x3d')]=[{'all':!![]}];}_0x535ae8=_[_0x8790('0x39')]({},_0x535ae8,_0xaabba3['options']);return db[_0x8790('0x3e')][_0x8790('0x43')](_0x535ae8)[_0x8790('0x1f')](handleEntityNotFound(_0x24b3b7,null))[_0x8790('0x1f')](respondWithResult(_0x24b3b7,null))[_0x8790('0x41')](handleError(_0x24b3b7,null));};exports[_0x8790('0x44')]=function(_0x2a2976,_0x1bc823){return db[_0x8790('0x3e')][_0x8790('0x44')](_0x2a2976[_0x8790('0x45')],{})[_0x8790('0x1f')](respondWithResult(_0x1bc823,0xc9))[_0x8790('0x41')](handleError(_0x1bc823,null));};exports['update']=function(_0x5e47ae,_0x485819){if(_0x5e47ae[_0x8790('0x45')]['id']){delete _0x5e47ae[_0x8790('0x45')]['id'];}return db[_0x8790('0x3e')]['find']({'where':{'id':_0x5e47ae[_0x8790('0x42')]['id']}})[_0x8790('0x1f')](handleEntityNotFound(_0x485819,null))[_0x8790('0x1f')](saveUpdates(_0x5e47ae[_0x8790('0x45')],null))[_0x8790('0x1f')](respondWithResult(_0x485819,null))['catch'](handleError(_0x485819,null));};exports[_0x8790('0x46')]=function(_0x35799d,_0xd4af4b){return db[_0x8790('0x3e')]['find']({'where':{'id':_0x35799d[_0x8790('0x42')]['id']}})[_0x8790('0x1f')](handleEntityNotFound(_0xd4af4b,null))['then'](removeEntity(_0xd4af4b,null))[_0x8790('0x41')](handleError(_0xd4af4b,null));};exports['getSubjects']=function(_0x1198c9,_0x31e552,_0x41a279){var _0xc7dc5e={};var _0x398609={};var _0x295892;var _0x1c806d;return db[_0x8790('0x3e')]['findOne']({'where':{'id':_0x1198c9[_0x8790('0x42')]['id']}})[_0x8790('0x1f')](handleEntityNotFound(_0x31e552,null))[_0x8790('0x1f')](function(_0x5af6cb){if(_0x5af6cb){_0x295892=_0x5af6cb;_0x398609['model']=_[_0x8790('0x2b')](db[_0x8790('0x47')][_0x8790('0x26')]);_0x398609[_0x8790('0x2a')]=_['keys'](_0x1198c9['query']);_0x398609[_0x8790('0x2c')]=_['intersection'](_0x398609[_0x8790('0x2e')],_0x398609[_0x8790('0x2a')]);_0xc7dc5e['attributes']=_['intersection'](_0x398609[_0x8790('0x2e')],qs['fields'](_0x1198c9[_0x8790('0x2a')][_0x8790('0x30')]));_0xc7dc5e[_0x8790('0x2f')]=_0xc7dc5e[_0x8790('0x2f')][_0x8790('0x31')]?_0xc7dc5e['attributes']:_0x398609[_0x8790('0x2e')];_0xc7dc5e[_0x8790('0x34')]=qs[_0x8790('0x35')](_0x1198c9[_0x8790('0x2a')][_0x8790('0x35')]);_0xc7dc5e['where']=qs[_0x8790('0x2c')](_[_0x8790('0x37')](_0x1198c9[_0x8790('0x2a')],_0x398609[_0x8790('0x2c')]));if(_0x1198c9[_0x8790('0x2a')][_0x8790('0x38')]){_0xc7dc5e[_0x8790('0x36')]=_['merge'](_0xc7dc5e[_0x8790('0x36')],{'$or':_[_0x8790('0x25')](_0xc7dc5e[_0x8790('0x2f')],function(_0x462ee9){var _0xa15c8={};_0xa15c8[_0x462ee9]={'$like':'%'+_0x1198c9[_0x8790('0x2a')]['filter']+'%'};return _0xa15c8;})});}_0xc7dc5e=_[_0x8790('0x39')]({},_0xc7dc5e,_0x1198c9['options']);return _0x295892[_0x8790('0x48')](_0xc7dc5e);}})['then'](function(_0x300b0c){if(_0x300b0c){_0x1c806d=_0x300b0c[_0x8790('0x31')];if(!_0x1198c9[_0x8790('0x2a')][_0x8790('0x32')]('nolimit')){_0xc7dc5e['limit']=qs[_0x8790('0x18')](_0x1198c9[_0x8790('0x2a')][_0x8790('0x18')]);_0xc7dc5e[_0x8790('0x1a')]=qs[_0x8790('0x1a')](_0x1198c9[_0x8790('0x2a')]['offset']);}return _0x295892[_0x8790('0x48')](_0xc7dc5e);}})[_0x8790('0x1f')](function(_0x534c4d){if(_0x534c4d){return _0x534c4d?{'count':_0x1c806d,'rows':_0x534c4d}:null;}})[_0x8790('0x1f')](respondWithResult(_0x31e552,null))[_0x8790('0x41')](handleError(_0x31e552,null));};exports[_0x8790('0x49')]=function(_0x34720f,_0x207e1b,_0x23a66b){var _0x375bd6={};var _0x32faa8={};var _0x3da851;var _0x174960;return db[_0x8790('0x3e')]['findOne']({'where':{'id':_0x34720f[_0x8790('0x42')]['id']}})['then'](handleEntityNotFound(_0x207e1b,null))[_0x8790('0x1f')](function(_0x2a5819){if(_0x2a5819){_0x3da851=_0x2a5819;_0x32faa8[_0x8790('0x2e')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x32faa8[_0x8790('0x2a')]=_[_0x8790('0x2b')](_0x34720f[_0x8790('0x2a')]);_0x32faa8['filters']=_[_0x8790('0x2d')](_0x32faa8[_0x8790('0x2e')],_0x32faa8[_0x8790('0x2a')]);_0x375bd6[_0x8790('0x2f')]=_[_0x8790('0x2d')](_0x32faa8[_0x8790('0x2e')],qs['fields'](_0x34720f[_0x8790('0x2a')][_0x8790('0x30')]));_0x375bd6[_0x8790('0x2f')]=_0x375bd6['attributes']['length']?_0x375bd6['attributes']:_0x32faa8['model'];_0x375bd6[_0x8790('0x34')]=qs[_0x8790('0x35')](_0x34720f[_0x8790('0x2a')][_0x8790('0x35')]);_0x375bd6[_0x8790('0x36')]=qs[_0x8790('0x2c')](_[_0x8790('0x37')](_0x34720f['query'],_0x32faa8[_0x8790('0x2c')]));if(_0x34720f[_0x8790('0x2a')][_0x8790('0x38')]){_0x375bd6[_0x8790('0x36')]=_[_0x8790('0x39')](_0x375bd6[_0x8790('0x36')],{'$or':_['map'](_0x375bd6[_0x8790('0x2f')],function(_0x126fb1){var _0x2765fe={};_0x2765fe[_0x126fb1]={'$like':'%'+_0x34720f['query']['filter']+'%'};return _0x2765fe;})});}_0x375bd6=_['merge']({},_0x375bd6,_0x34720f[_0x8790('0x3b')]);return _0x3da851['getDescriptions'](_0x375bd6);}})[_0x8790('0x1f')](function(_0x408635){if(_0x408635){_0x174960=_0x408635['length'];if(!_0x34720f[_0x8790('0x2a')][_0x8790('0x32')](_0x8790('0x33'))){_0x375bd6[_0x8790('0x18')]=qs[_0x8790('0x18')](_0x34720f[_0x8790('0x2a')][_0x8790('0x18')]);_0x375bd6['offset']=qs[_0x8790('0x1a')](_0x34720f[_0x8790('0x2a')][_0x8790('0x1a')]);}return _0x3da851[_0x8790('0x49')](_0x375bd6);}})[_0x8790('0x1f')](function(_0x3ee02a){if(_0x3ee02a){return _0x3ee02a?{'count':_0x174960,'rows':_0x3ee02a}:null;}})[_0x8790('0x1f')](respondWithResult(_0x207e1b,null))[_0x8790('0x41')](handleError(_0x207e1b,null));};exports[_0x8790('0x4a')]=function(_0x3af22b,_0x44eb3f,_0x5cf578){var _0x271075={};var _0xec9c09={};var _0xf8b5f6;var _0x2bf492;return db[_0x8790('0x3e')][_0x8790('0x4b')]({'where':{'id':_0x3af22b[_0x8790('0x42')]['id']}})[_0x8790('0x1f')](handleEntityNotFound(_0x44eb3f,null))['then'](function(_0x344c96){if(_0x344c96){_0xf8b5f6=_0x344c96;_0xec9c09['model']=_[_0x8790('0x2b')](db[_0x8790('0x47')][_0x8790('0x26')]);_0xec9c09['query']=_[_0x8790('0x2b')](_0x3af22b[_0x8790('0x2a')]);_0xec9c09['filters']=_['intersection'](_0xec9c09['model'],_0xec9c09[_0x8790('0x2a')]);_0x271075['attributes']=_[_0x8790('0x2d')](_0xec9c09[_0x8790('0x2e')],qs[_0x8790('0x30')](_0x3af22b[_0x8790('0x2a')]['fields']));_0x271075[_0x8790('0x2f')]=_0x271075[_0x8790('0x2f')]['length']?_0x271075[_0x8790('0x2f')]:_0xec9c09[_0x8790('0x2e')];_0x271075[_0x8790('0x34')]=qs['sort'](_0x3af22b[_0x8790('0x2a')][_0x8790('0x35')]);_0x271075['where']=qs['filters'](_[_0x8790('0x37')](_0x3af22b[_0x8790('0x2a')],_0xec9c09[_0x8790('0x2c')]));if(_0x3af22b[_0x8790('0x2a')][_0x8790('0x38')]){_0x271075[_0x8790('0x36')]=_[_0x8790('0x39')](_0x271075[_0x8790('0x36')],{'$or':_[_0x8790('0x25')](_0x271075[_0x8790('0x2f')],function(_0x49cded){var _0x34a9de={};_0x34a9de[_0x49cded]={'$like':'%'+_0x3af22b[_0x8790('0x2a')][_0x8790('0x38')]+'%'};return _0x34a9de;})});}_0x271075=_[_0x8790('0x39')]({},_0x271075,_0x3af22b[_0x8790('0x3b')]);return _0xf8b5f6[_0x8790('0x4a')](_0x271075);}})[_0x8790('0x1f')](function(_0x5520e6){if(_0x5520e6){_0x2bf492=_0x5520e6[_0x8790('0x31')];if(!_0x3af22b[_0x8790('0x2a')][_0x8790('0x32')](_0x8790('0x33'))){_0x271075[_0x8790('0x18')]=qs['limit'](_0x3af22b[_0x8790('0x2a')][_0x8790('0x18')]);_0x271075[_0x8790('0x1a')]=qs['offset'](_0x3af22b[_0x8790('0x2a')][_0x8790('0x1a')]);}return _0xf8b5f6[_0x8790('0x4a')](_0x271075);}})['then'](function(_0x49d8c0){if(_0x49d8c0){return _0x49d8c0?{'count':_0x2bf492,'rows':_0x49d8c0}:null;}})[_0x8790('0x1f')](respondWithResult(_0x44eb3f,null))[_0x8790('0x41')](handleError(_0x44eb3f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 8308bab..6d17170 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 _0x5a96=['define','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0xbc256d,_0x2a5cc6){var _0x3d74c9=function(_0x127c02){while(--_0x127c02){_0xbc256d['push'](_0xbc256d['shift']());}};_0x3d74c9(++_0x2a5cc6);}(_0x5a96,0x1c4));var _0x65a9=function(_0x513855,_0x311fd6){_0x513855=_0x513855-0x0;var _0x12c3d3=_0x5a96[_0x513855];return _0x12c3d3;};'use strict';var _=require(_0x65a9('0x0'));var util=require('util');var logger=require(_0x65a9('0x1'))(_0x65a9('0x2'));var moment=require(_0x65a9('0x3'));var BPromise=require(_0x65a9('0x4'));var rp=require(_0x65a9('0x5'));var fs=require('fs');var path=require(_0x65a9('0x6'));var rimraf=require('rimraf');var config=require(_0x65a9('0x7'));var attributes=require(_0x65a9('0x8'));module[_0x65a9('0x9')]=function(_0x46c353,_0x482ffc){return _0x46c353[_0x65a9('0xa')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe546=['path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x51b10b,_0x311567){var _0x45b2cf=function(_0xa17759){while(--_0xa17759){_0x51b10b['push'](_0x51b10b['shift']());}};_0x45b2cf(++_0x311567);}(_0xe546,0x14b));var _0x6e54=function(_0x2c0244,_0x541a4e){_0x2c0244=_0x2c0244-0x0;var _0xad7678=_0xe546[_0x2c0244];return _0xad7678;};'use strict';var _=require(_0x6e54('0x0'));var util=require('util');var logger=require(_0x6e54('0x1'))(_0x6e54('0x2'));var moment=require('moment');var BPromise=require(_0x6e54('0x3'));var rp=require(_0x6e54('0x4'));var fs=require('fs');var path=require(_0x6e54('0x5'));var rimraf=require(_0x6e54('0x6'));var config=require('../../config/environment');var attributes=require(_0x6e54('0x7'));module[_0x6e54('0x8')]=function(_0x388b9c,_0x25a4d9){return _0x388b9c[_0x6e54('0x9')](_0x6e54('0xa'),attributes,{'tableName':_0x6e54('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 b2e0e0f..f8614b0 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 _0xeee4=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x52fa77,_0x2b381b){var _0x477535=function(_0x5323b5){while(--_0x5323b5){_0x52fa77['push'](_0x52fa77['shift']());}};_0x477535(++_0x2b381b);}(_0xeee4,0x1dd));var _0x4eee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeee4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4eee('0x0'));var util=require(_0x4eee('0x1'));var moment=require(_0x4eee('0x2'));var BPromise=require('bluebird');var rs=require(_0x4eee('0x3'));var fs=require('fs');var Redis=require(_0x4eee('0x4'));var db=require(_0x4eee('0x5'))['db'];var utils=require(_0x4eee('0x6'));var logger=require(_0x4eee('0x7'))(_0x4eee('0x8'));var config=require(_0x4eee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4eee('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ffaff,_0x2092ca,_0x445a33){return new BPromise(function(_0x40a84b,_0x45974f){return client[_0x4eee('0xb')](_0x3ffaff,_0x445a33)[_0x4eee('0xc')](function(_0x47de3c){logger[_0x4eee('0xd')](_0x4eee('0xe'),_0x2092ca,_0x4eee('0xf'));logger[_0x4eee('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x2092ca,_0x4eee('0xf'),JSON[_0x4eee('0x11')](_0x47de3c));if(_0x47de3c[_0x4eee('0x12')]){if(_0x47de3c['error'][_0x4eee('0x13')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x2092ca,_0x47de3c['error'][_0x4eee('0x14')]);return _0x45974f(_0x47de3c[_0x4eee('0x12')][_0x4eee('0x14')]);}logger[_0x4eee('0x12')](_0x4eee('0xe'),_0x2092ca,_0x47de3c['error'][_0x4eee('0x14')]);return _0x40a84b(_0x47de3c[_0x4eee('0x12')][_0x4eee('0x14')]);}else{logger['info'](_0x4eee('0xe'),_0x2092ca,_0x4eee('0xf'));_0x40a84b(_0x47de3c['result'][_0x4eee('0x14')]);}})['catch'](function(_0xde3b39){logger[_0x4eee('0x12')](_0x4eee('0xe'),_0x2092ca,_0xde3b39);_0x45974f(_0xde3b39);});});} \ No newline at end of file +var _0x03b0=['request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0x455dd2,_0x4cdc1f){var _0x193b05=function(_0x1c82b3){while(--_0x1c82b3){_0x455dd2['push'](_0x455dd2['shift']());}};_0x193b05(++_0x4cdc1f);}(_0x03b0,0xd2));var _0x003b=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x03b0[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x003b('0x0'));var util=require(_0x003b('0x1'));var moment=require(_0x003b('0x2'));var BPromise=require('bluebird');var rs=require(_0x003b('0x3'));var fs=require('fs');var Redis=require(_0x003b('0x4'));var db=require(_0x003b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x003b('0x6'));var config=require(_0x003b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x003b('0x8')][_0x003b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17fbf8,_0x46a87f,_0x4dcf53){return new BPromise(function(_0x6d44e3,_0x57bd45){return client[_0x003b('0xa')](_0x17fbf8,_0x4dcf53)[_0x003b('0xb')](function(_0x3de993){logger[_0x003b('0xc')](_0x003b('0xd'),_0x46a87f,_0x003b('0xe'));logger[_0x003b('0xf')](_0x003b('0x10'),_0x46a87f,'request\x20sent',JSON[_0x003b('0x11')](_0x3de993));if(_0x3de993[_0x003b('0x12')]){if(_0x3de993[_0x003b('0x12')]['code']===0x1f4){logger[_0x003b('0x12')](_0x003b('0xd'),_0x46a87f,_0x3de993['error'][_0x003b('0x13')]);return _0x57bd45(_0x3de993[_0x003b('0x12')][_0x003b('0x13')]);}logger[_0x003b('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x46a87f,_0x3de993[_0x003b('0x12')][_0x003b('0x13')]);return _0x6d44e3(_0x3de993[_0x003b('0x12')][_0x003b('0x13')]);}else{logger[_0x003b('0xc')](_0x003b('0xd'),_0x46a87f,'request\x20sent');_0x6d44e3(_0x3de993[_0x003b('0x14')][_0x003b('0x13')]);}})[_0x003b('0x15')](function(_0x388ba0){logger[_0x003b('0x12')](_0x003b('0xd'),_0x46a87f,_0x388ba0);_0x57bd45(_0x388ba0);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index e7ae8ff..fd2fffb 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 _0xba33=['isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get'];(function(_0x29b435,_0x3e4bef){var _0x1ffee8=function(_0x1a19b2){while(--_0x1a19b2){_0x29b435['push'](_0x29b435['shift']());}};_0x1ffee8(++_0x3e4bef);}(_0xba33,0xf1));var _0x3ba3=function(_0xcdcff4,_0x358692){_0xcdcff4=_0xcdcff4-0x0;var _0x161f6b=_0xba33[_0xcdcff4];return _0x161f6b;};'use strict';var multer=require(_0x3ba3('0x0'));var util=require(_0x3ba3('0x1'));var path=require(_0x3ba3('0x2'));var timeout=require(_0x3ba3('0x3'));var express=require('express');var router=express[_0x3ba3('0x4')]();var fs_extra=require(_0x3ba3('0x5'));var auth=require(_0x3ba3('0x6'));var interaction=require(_0x3ba3('0x7'));var config=require(_0x3ba3('0x8'));var controller=require(_0x3ba3('0x9'));router[_0x3ba3('0xa')]('/',auth[_0x3ba3('0xb')](),controller[_0x3ba3('0xc')]);router[_0x3ba3('0xa')](_0x3ba3('0xd'),auth['isAuthenticated'](),controller[_0x3ba3('0xe')]);router[_0x3ba3('0xf')]('/',auth[_0x3ba3('0xb')](),controller[_0x3ba3('0x10')]);router[_0x3ba3('0x11')]('/:id',auth[_0x3ba3('0xb')](),controller[_0x3ba3('0x12')]);router[_0x3ba3('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3ba3('0x14')]=router; \ No newline at end of file +var _0x81d5=['fs-extra','../../components/auth/service','./intFreshsalesField.controller','get','isAuthenticated','/:id','post','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x4d5953,_0x515ef3){var _0x3e20b5=function(_0x2bfde8){while(--_0x2bfde8){_0x4d5953['push'](_0x4d5953['shift']());}};_0x3e20b5(++_0x515ef3);}(_0x81d5,0x1ab));var _0x581d=function(_0x5aeb99,_0x2ff42f){_0x5aeb99=_0x5aeb99-0x0;var _0x30e2cf=_0x81d5[_0x5aeb99];return _0x30e2cf;};'use strict';var multer=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var path=require('path');var timeout=require(_0x581d('0x2'));var express=require(_0x581d('0x3'));var router=express[_0x581d('0x4')]();var fs_extra=require(_0x581d('0x5'));var auth=require(_0x581d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x581d('0x7'));router[_0x581d('0x8')]('/',auth[_0x581d('0x9')](),controller['index']);router[_0x581d('0x8')](_0x581d('0xa'),auth[_0x581d('0x9')](),controller['show']);router[_0x581d('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x581d('0xa'),auth[_0x581d('0x9')](),controller[_0x581d('0xc')]);router[_0x581d('0xd')](_0x581d('0xa'),auth['isAuthenticated'](),controller[_0x581d('0xe')]);module[_0x581d('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 0e9a789..3399025 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 _0x05d6=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x2cb7ab,_0x2ec6a3){var _0x5db6ee=function(_0x538fe9){while(--_0x538fe9){_0x2cb7ab['push'](_0x2cb7ab['shift']());}};_0x5db6ee(++_0x2ec6a3);}(_0x05d6,0x19c));var _0x605d=function(_0x5936ff,_0x1c8a03){_0x5936ff=_0x5936ff-0x0;var _0x2d8cf0=_0x05d6[_0x5936ff];return _0x2d8cf0;};'use strict';var Sequelize=require(_0x605d('0x0'));module[_0x605d('0x1')]={'type':{'type':Sequelize[_0x605d('0x2')](_0x605d('0x3'),_0x605d('0x4'),_0x605d('0x5'),_0x605d('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x605d('0x7')]},'key':{'type':Sequelize[_0x605d('0x7')]},'keyType':{'type':Sequelize[_0x605d('0x2')](_0x605d('0x3'),_0x605d('0x4'),_0x605d('0x5'))},'keyContent':{'type':Sequelize[_0x605d('0x7')]},'idField':{'type':Sequelize[_0x605d('0x7')]},'nameField':{'type':Sequelize[_0x605d('0x7')]},'customField':{'type':Sequelize[_0x605d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x605d('0x7')]}}; \ No newline at end of file +var _0x7b03=['STRING','ENUM','customVariable','BOOLEAN','sequelize','string','variable','keyValue','picklist'];(function(_0x2b4b94,_0x42f80e){var _0x5b4842=function(_0x290929){while(--_0x290929){_0x2b4b94['push'](_0x2b4b94['shift']());}};_0x5b4842(++_0x42f80e);}(_0x7b03,0x124));var _0x37b0=function(_0x18ae6d,_0x255d00){_0x18ae6d=_0x18ae6d-0x0;var _0x3deb94=_0x7b03[_0x18ae6d];return _0x3deb94;};'use strict';var Sequelize=require(_0x37b0('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x37b0('0x1'),_0x37b0('0x2'),'customVariable',_0x37b0('0x3'),_0x37b0('0x4')),'defaultValue':_0x37b0('0x1')},'content':{'type':Sequelize[_0x37b0('0x5')]},'key':{'type':Sequelize[_0x37b0('0x5')]},'keyType':{'type':Sequelize[_0x37b0('0x6')](_0x37b0('0x1'),_0x37b0('0x2'),_0x37b0('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x37b0('0x5')]},'nameField':{'type':Sequelize[_0x37b0('0x5')]},'customField':{'type':Sequelize[_0x37b0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x37b0('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index af15cdd..d2cf7e3 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 _0x5694=['length','options','find','create','catch','body','eml-format','zip-dir','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','name','index','FreshsalesField','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','limit','where','filter','merge','map','VIRTUAL','include','rows','show','params'];(function(_0x290c78,_0x406c3d){var _0x5d5bf5=function(_0x243f87){while(--_0x243f87){_0x290c78['push'](_0x290c78['shift']());}};_0x5d5bf5(++_0x406c3d);}(_0x5694,0x150));var _0x4569=function(_0x817177,_0x2e2c8f){_0x817177=_0x817177-0x0;var _0x3c67d2=_0x5694[_0x817177];return _0x3c67d2;};'use strict';var emlformat=require(_0x4569('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4569('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4569('0x2'));var moment=require(_0x4569('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4569('0x4'));var util=require(_0x4569('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4569('0x6'));var fs=require('fs');var fs_extra=require(_0x4569('0x7'));var _=require(_0x4569('0x8'));var squel=require(_0x4569('0x9'));var crypto=require(_0x4569('0xa'));var jsforce=require(_0x4569('0xb'));var deskjs=require(_0x4569('0xc'));var toCsv=require(_0x4569('0xd'));var querystring=require(_0x4569('0xe'));var Papa=require(_0x4569('0xf'));var Redis=require(_0x4569('0x10'));var authService=require(_0x4569('0x11'));var qs=require(_0x4569('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4569('0x13'));var logger=require(_0x4569('0x14'))(_0x4569('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4569('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50ecd8,_0x59aa24){_0x59aa24=_0x59aa24||0xcc;return function(_0x78407f){if(_0x78407f){return _0x50ecd8[_0x4569('0x17')](_0x59aa24);}return _0x50ecd8[_0x4569('0x18')](_0x59aa24)[_0x4569('0x19')]();};}function respondWithResult(_0x3c4f3b,_0x29a4d2){_0x29a4d2=_0x29a4d2||0xc8;return function(_0x47ea32){if(_0x47ea32){return _0x3c4f3b[_0x4569('0x18')](_0x29a4d2)['json'](_0x47ea32);}};}function respondWithFilteredResult(_0x4be770,_0x2ba7e8){return function(_0x438957){if(_0x438957){var _0xc9372e=typeof _0x2ba7e8[_0x4569('0x1a')]===_0x4569('0x1b')&&typeof _0x2ba7e8['limit']==='undefined';var _0x2478e7=_0x438957[_0x4569('0x1c')];var _0x15ed26=_0xc9372e?0x0:_0x2ba7e8[_0x4569('0x1a')];var _0x2c906e=_0xc9372e?_0x438957[_0x4569('0x1c')]:_0x2ba7e8[_0x4569('0x1a')]+_0x2ba7e8['limit'];var _0x274b53;if(_0x2c906e>=_0x2478e7){_0x2c906e=_0x2478e7;_0x274b53=0xc8;}else{_0x274b53=0xce;}_0x4be770['status'](_0x274b53);return _0x4be770[_0x4569('0x1d')](_0x4569('0x1e'),_0x15ed26+'-'+_0x2c906e+'/'+_0x2478e7)['json'](_0x438957);}return null;};}function patchUpdates(_0x436198){return function(_0x50f864){try{jsonpatch['apply'](_0x50f864,_0x436198,!![]);}catch(_0x48b9aa){return BPromise[_0x4569('0x1f')](_0x48b9aa);}return _0x50f864[_0x4569('0x20')]();};}function saveUpdates(_0x1dc038,_0x3af4cb){return function(_0x4e2a39){if(_0x4e2a39){return _0x4e2a39[_0x4569('0x21')](_0x1dc038)[_0x4569('0x22')](function(_0x4471a0){return _0x4471a0;});}return null;};}function removeEntity(_0x46376c,_0x4a4473){return function(_0x59881b){if(_0x59881b){return _0x59881b[_0x4569('0x23')]()[_0x4569('0x22')](function(){_0x46376c[_0x4569('0x18')](0xcc)[_0x4569('0x19')]();});}};}function handleEntityNotFound(_0x4f0d6b,_0x52cc72){return function(_0x3bbed1){if(!_0x3bbed1){_0x4f0d6b['sendStatus'](0x194);}return _0x3bbed1;};}function handleError(_0x400b92,_0x504d49){_0x504d49=_0x504d49||0x1f4;return function(_0x5d1981){logger['error'](_0x5d1981['stack']);if(_0x5d1981[_0x4569('0x24')]){delete _0x5d1981[_0x4569('0x24')];}_0x400b92[_0x4569('0x18')](_0x504d49)['send'](_0x5d1981);};}exports[_0x4569('0x25')]=function(_0xefb3f9,_0x22f388){var _0x5e196f={},_0x57e4a3={},_0x3b58f7={'count':0x0,'rows':[]};var _0x26421c=_['map'](db[_0x4569('0x26')][_0x4569('0x27')],function(_0x3da4e0){return{'name':_0x3da4e0[_0x4569('0x28')],'type':_0x3da4e0['type']['key']};});_0x57e4a3[_0x4569('0x29')]=_['map'](_0x26421c,'name');_0x57e4a3['query']=_[_0x4569('0x2a')](_0xefb3f9['query']);_0x57e4a3[_0x4569('0x2b')]=_[_0x4569('0x2c')](_0x57e4a3[_0x4569('0x29')],_0x57e4a3[_0x4569('0x2d')]);_0x5e196f[_0x4569('0x2e')]=_[_0x4569('0x2c')](_0x57e4a3[_0x4569('0x29')],qs[_0x4569('0x2f')](_0xefb3f9[_0x4569('0x2d')]['fields']));_0x5e196f[_0x4569('0x2e')]=_0x5e196f[_0x4569('0x2e')]['length']?_0x5e196f[_0x4569('0x2e')]:_0x57e4a3[_0x4569('0x29')];if(!_0xefb3f9[_0x4569('0x2d')][_0x4569('0x30')](_0x4569('0x31'))){_0x5e196f[_0x4569('0x32')]=qs['limit'](_0xefb3f9[_0x4569('0x2d')][_0x4569('0x32')]);_0x5e196f['offset']=qs[_0x4569('0x1a')](_0xefb3f9[_0x4569('0x2d')][_0x4569('0x1a')]);}_0x5e196f['order']=qs['sort'](_0xefb3f9[_0x4569('0x2d')]['sort']);_0x5e196f[_0x4569('0x33')]=qs[_0x4569('0x2b')](_['pick'](_0xefb3f9[_0x4569('0x2d')],_0x57e4a3[_0x4569('0x2b')]),_0x26421c);if(_0xefb3f9[_0x4569('0x2d')][_0x4569('0x34')]){_0x5e196f['where']=_[_0x4569('0x35')](_0x5e196f[_0x4569('0x33')],{'$or':_[_0x4569('0x36')](_0x26421c,function(_0x2a3332){if(_0x2a3332['type']!==_0x4569('0x37')){var _0x17a079={};_0x17a079[_0x2a3332[_0x4569('0x24')]]={'$like':'%'+_0xefb3f9['query'][_0x4569('0x34')]+'%'};return _0x17a079;}})});}_0x5e196f=_[_0x4569('0x35')]({},_0x5e196f,_0xefb3f9['options']);var _0x13f9dc={'where':_0x5e196f[_0x4569('0x33')]};return db['FreshsalesField'][_0x4569('0x1c')](_0x13f9dc)[_0x4569('0x22')](function(_0x11211b){_0x3b58f7[_0x4569('0x1c')]=_0x11211b;if(_0xefb3f9[_0x4569('0x2d')]['includeAll']){_0x5e196f[_0x4569('0x38')]=[{'all':!![]}];}return db[_0x4569('0x26')]['findAll'](_0x5e196f);})[_0x4569('0x22')](function(_0x4e700e){_0x3b58f7[_0x4569('0x39')]=_0x4e700e;return _0x3b58f7;})['then'](respondWithFilteredResult(_0x22f388,_0x5e196f))['catch'](handleError(_0x22f388,null));};exports[_0x4569('0x3a')]=function(_0x2941fa,_0x3ebd8d){var _0x4872a9={'raw':!![],'where':{'id':_0x2941fa[_0x4569('0x3b')]['id']}},_0x1e0f63={};_0x1e0f63[_0x4569('0x29')]=_[_0x4569('0x2a')](db['FreshsalesField'][_0x4569('0x27')]);_0x1e0f63[_0x4569('0x2d')]=_['keys'](_0x2941fa['query']);_0x1e0f63[_0x4569('0x2b')]=_[_0x4569('0x2c')](_0x1e0f63[_0x4569('0x29')],_0x1e0f63['query']);_0x4872a9[_0x4569('0x2e')]=_['intersection'](_0x1e0f63[_0x4569('0x29')],qs[_0x4569('0x2f')](_0x2941fa['query'][_0x4569('0x2f')]));_0x4872a9[_0x4569('0x2e')]=_0x4872a9[_0x4569('0x2e')][_0x4569('0x3c')]?_0x4872a9[_0x4569('0x2e')]:_0x1e0f63[_0x4569('0x29')];if(_0x2941fa['query']['includeAll']){_0x4872a9['include']=[{'all':!![]}];}_0x4872a9=_['merge']({},_0x4872a9,_0x2941fa[_0x4569('0x3d')]);return db['FreshsalesField'][_0x4569('0x3e')](_0x4872a9)[_0x4569('0x22')](handleEntityNotFound(_0x3ebd8d,null))[_0x4569('0x22')](respondWithResult(_0x3ebd8d,null))['catch'](handleError(_0x3ebd8d,null));};exports[_0x4569('0x3f')]=function(_0x376dfb,_0x3e644c){return db[_0x4569('0x26')][_0x4569('0x3f')](_0x376dfb['body'],{})['then'](respondWithResult(_0x3e644c,0xc9))[_0x4569('0x40')](handleError(_0x3e644c,null));};exports[_0x4569('0x21')]=function(_0x38c3fd,_0x21f42a){if(_0x38c3fd['body']['id']){delete _0x38c3fd[_0x4569('0x41')]['id'];}return db[_0x4569('0x26')]['find']({'where':{'id':_0x38c3fd[_0x4569('0x3b')]['id']}})['then'](handleEntityNotFound(_0x21f42a,null))[_0x4569('0x22')](saveUpdates(_0x38c3fd[_0x4569('0x41')],null))[_0x4569('0x22')](respondWithResult(_0x21f42a,null))[_0x4569('0x40')](handleError(_0x21f42a,null));};exports[_0x4569('0x23')]=function(_0x307697,_0x566f24){return db[_0x4569('0x26')][_0x4569('0x3e')]({'where':{'id':_0x307697['params']['id']}})['then'](handleEntityNotFound(_0x566f24,null))[_0x4569('0x22')](removeEntity(_0x566f24,null))[_0x4569('0x40')](handleError(_0x566f24,null));}; \ No newline at end of file +var _0x38fc=['index','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','FreshsalesField','rows','catch','filters','fields','options','find','create','body','params','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','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send'];(function(_0x133792,_0xba2004){var _0x4dacb3=function(_0x38eb52){while(--_0x38eb52){_0x133792['push'](_0x133792['shift']());}};_0x4dacb3(++_0xba2004);}(_0x38fc,0xfd));var _0xc38f=function(_0x9cac6f,_0x26f533){_0x9cac6f=_0x9cac6f-0x0;var _0x2f1d40=_0x38fc[_0x9cac6f];return _0x2f1d40;};'use strict';var emlformat=require(_0xc38f('0x0'));var rimraf=require(_0xc38f('0x1'));var zipdir=require(_0xc38f('0x2'));var jsonpatch=require(_0xc38f('0x3'));var rp=require(_0xc38f('0x4'));var moment=require(_0xc38f('0x5'));var BPromise=require(_0xc38f('0x6'));var Mustache=require(_0xc38f('0x7'));var util=require(_0xc38f('0x8'));var path=require('path');var sox=require(_0xc38f('0x9'));var csv=require(_0xc38f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc38f('0xb'));var _=require(_0xc38f('0xc'));var squel=require(_0xc38f('0xd'));var crypto=require(_0xc38f('0xe'));var jsforce=require(_0xc38f('0xf'));var deskjs=require(_0xc38f('0x10'));var toCsv=require(_0xc38f('0xa'));var querystring=require(_0xc38f('0x11'));var Papa=require('papaparse');var Redis=require(_0xc38f('0x12'));var authService=require(_0xc38f('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc38f('0x14'));var logger=require(_0xc38f('0x15'))(_0xc38f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc38f('0x17'))['db'];function respondWithStatusCode(_0x196424,_0x4dd9f5){_0x4dd9f5=_0x4dd9f5||0xcc;return function(_0x384144){if(_0x384144){return _0x196424[_0xc38f('0x18')](_0x4dd9f5);}return _0x196424[_0xc38f('0x19')](_0x4dd9f5)[_0xc38f('0x1a')]();};}function respondWithResult(_0x4c45b3,_0x4186fc){_0x4186fc=_0x4186fc||0xc8;return function(_0x5f5d56){if(_0x5f5d56){return _0x4c45b3[_0xc38f('0x19')](_0x4186fc)[_0xc38f('0x1b')](_0x5f5d56);}};}function respondWithFilteredResult(_0x566ee9,_0x3ec37b){return function(_0x307a6){if(_0x307a6){var _0x34c799=typeof _0x3ec37b[_0xc38f('0x1c')]==='undefined'&&typeof _0x3ec37b[_0xc38f('0x1d')]===_0xc38f('0x1e');var _0x14e849=_0x307a6[_0xc38f('0x1f')];var _0x8e238=_0x34c799?0x0:_0x3ec37b[_0xc38f('0x1c')];var _0x20da89=_0x34c799?_0x307a6[_0xc38f('0x1f')]:_0x3ec37b[_0xc38f('0x1c')]+_0x3ec37b[_0xc38f('0x1d')];var _0x1ced23;if(_0x20da89>=_0x14e849){_0x20da89=_0x14e849;_0x1ced23=0xc8;}else{_0x1ced23=0xce;}_0x566ee9[_0xc38f('0x19')](_0x1ced23);return _0x566ee9[_0xc38f('0x20')](_0xc38f('0x21'),_0x8e238+'-'+_0x20da89+'/'+_0x14e849)[_0xc38f('0x1b')](_0x307a6);}return null;};}function patchUpdates(_0x2eb992){return function(_0x19d059){try{jsonpatch[_0xc38f('0x22')](_0x19d059,_0x2eb992,!![]);}catch(_0x20612d){return BPromise['reject'](_0x20612d);}return _0x19d059[_0xc38f('0x23')]();};}function saveUpdates(_0x5b528e,_0x413d00){return function(_0x31a5ab){if(_0x31a5ab){return _0x31a5ab[_0xc38f('0x24')](_0x5b528e)[_0xc38f('0x25')](function(_0x179772){return _0x179772;});}return null;};}function removeEntity(_0x31bca1,_0x453b9a){return function(_0x1dec7f){if(_0x1dec7f){return _0x1dec7f[_0xc38f('0x26')]()[_0xc38f('0x25')](function(){_0x31bca1[_0xc38f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c60b0,_0x1c758e){return function(_0xffbbf2){if(!_0xffbbf2){_0x5c60b0['sendStatus'](0x194);}return _0xffbbf2;};}function handleError(_0x37ce33,_0x75c98){_0x75c98=_0x75c98||0x1f4;return function(_0x4a5a6d){logger[_0xc38f('0x27')](_0x4a5a6d[_0xc38f('0x28')]);if(_0x4a5a6d[_0xc38f('0x29')]){delete _0x4a5a6d['name'];}_0x37ce33[_0xc38f('0x19')](_0x75c98)[_0xc38f('0x2a')](_0x4a5a6d);};}exports[_0xc38f('0x2b')]=function(_0x5bf7fd,_0x1f70cf){var _0x3db6fc={},_0x2ed30f={},_0x12b44e={'count':0x0,'rows':[]};var _0x3f2933=_['map'](db['FreshsalesField'][_0xc38f('0x2c')],function(_0x485fc7){return{'name':_0x485fc7[_0xc38f('0x2d')],'type':_0x485fc7['type'][_0xc38f('0x2e')]};});_0x2ed30f['model']=_['map'](_0x3f2933,_0xc38f('0x29'));_0x2ed30f[_0xc38f('0x2f')]=_[_0xc38f('0x30')](_0x5bf7fd[_0xc38f('0x2f')]);_0x2ed30f['filters']=_[_0xc38f('0x31')](_0x2ed30f[_0xc38f('0x32')],_0x2ed30f[_0xc38f('0x2f')]);_0x3db6fc['attributes']=_[_0xc38f('0x31')](_0x2ed30f['model'],qs['fields'](_0x5bf7fd[_0xc38f('0x2f')]['fields']));_0x3db6fc[_0xc38f('0x33')]=_0x3db6fc[_0xc38f('0x33')][_0xc38f('0x34')]?_0x3db6fc[_0xc38f('0x33')]:_0x2ed30f[_0xc38f('0x32')];if(!_0x5bf7fd[_0xc38f('0x2f')][_0xc38f('0x35')](_0xc38f('0x36'))){_0x3db6fc[_0xc38f('0x1d')]=qs[_0xc38f('0x1d')](_0x5bf7fd['query'][_0xc38f('0x1d')]);_0x3db6fc[_0xc38f('0x1c')]=qs[_0xc38f('0x1c')](_0x5bf7fd[_0xc38f('0x2f')][_0xc38f('0x1c')]);}_0x3db6fc[_0xc38f('0x37')]=qs[_0xc38f('0x38')](_0x5bf7fd[_0xc38f('0x2f')]['sort']);_0x3db6fc[_0xc38f('0x39')]=qs['filters'](_[_0xc38f('0x3a')](_0x5bf7fd['query'],_0x2ed30f['filters']),_0x3f2933);if(_0x5bf7fd['query'][_0xc38f('0x3b')]){_0x3db6fc[_0xc38f('0x39')]=_[_0xc38f('0x3c')](_0x3db6fc[_0xc38f('0x39')],{'$or':_['map'](_0x3f2933,function(_0x22b030){if(_0x22b030['type']!==_0xc38f('0x3d')){var _0x587ac7={};_0x587ac7[_0x22b030[_0xc38f('0x29')]]={'$like':'%'+_0x5bf7fd['query'][_0xc38f('0x3b')]+'%'};return _0x587ac7;}})});}_0x3db6fc=_['merge']({},_0x3db6fc,_0x5bf7fd['options']);var _0x41a8eb={'where':_0x3db6fc[_0xc38f('0x39')]};return db['FreshsalesField'][_0xc38f('0x1f')](_0x41a8eb)[_0xc38f('0x25')](function(_0x51cc01){_0x12b44e[_0xc38f('0x1f')]=_0x51cc01;if(_0x5bf7fd[_0xc38f('0x2f')][_0xc38f('0x3e')]){_0x3db6fc[_0xc38f('0x3f')]=[{'all':!![]}];}return db[_0xc38f('0x40')]['findAll'](_0x3db6fc);})[_0xc38f('0x25')](function(_0x5e3b9a){_0x12b44e[_0xc38f('0x41')]=_0x5e3b9a;return _0x12b44e;})['then'](respondWithFilteredResult(_0x1f70cf,_0x3db6fc))[_0xc38f('0x42')](handleError(_0x1f70cf,null));};exports['show']=function(_0x7ae61c,_0x2088ac){var _0x493523={'raw':!![],'where':{'id':_0x7ae61c['params']['id']}},_0x1bf2e0={};_0x1bf2e0['model']=_[_0xc38f('0x30')](db[_0xc38f('0x40')][_0xc38f('0x2c')]);_0x1bf2e0[_0xc38f('0x2f')]=_[_0xc38f('0x30')](_0x7ae61c[_0xc38f('0x2f')]);_0x1bf2e0[_0xc38f('0x43')]=_[_0xc38f('0x31')](_0x1bf2e0['model'],_0x1bf2e0[_0xc38f('0x2f')]);_0x493523[_0xc38f('0x33')]=_[_0xc38f('0x31')](_0x1bf2e0[_0xc38f('0x32')],qs[_0xc38f('0x44')](_0x7ae61c[_0xc38f('0x2f')][_0xc38f('0x44')]));_0x493523[_0xc38f('0x33')]=_0x493523[_0xc38f('0x33')][_0xc38f('0x34')]?_0x493523[_0xc38f('0x33')]:_0x1bf2e0[_0xc38f('0x32')];if(_0x7ae61c['query'][_0xc38f('0x3e')]){_0x493523['include']=[{'all':!![]}];}_0x493523=_['merge']({},_0x493523,_0x7ae61c[_0xc38f('0x45')]);return db[_0xc38f('0x40')][_0xc38f('0x46')](_0x493523)[_0xc38f('0x25')](handleEntityNotFound(_0x2088ac,null))['then'](respondWithResult(_0x2088ac,null))[_0xc38f('0x42')](handleError(_0x2088ac,null));};exports['create']=function(_0x5e34e6,_0x3e6b73){return db[_0xc38f('0x40')][_0xc38f('0x47')](_0x5e34e6[_0xc38f('0x48')],{})[_0xc38f('0x25')](respondWithResult(_0x3e6b73,0xc9))[_0xc38f('0x42')](handleError(_0x3e6b73,null));};exports[_0xc38f('0x24')]=function(_0x4a7d66,_0x16fb4b){if(_0x4a7d66['body']['id']){delete _0x4a7d66[_0xc38f('0x48')]['id'];}return db[_0xc38f('0x40')]['find']({'where':{'id':_0x4a7d66['params']['id']}})[_0xc38f('0x25')](handleEntityNotFound(_0x16fb4b,null))[_0xc38f('0x25')](saveUpdates(_0x4a7d66[_0xc38f('0x48')],null))[_0xc38f('0x25')](respondWithResult(_0x16fb4b,null))[_0xc38f('0x42')](handleError(_0x16fb4b,null));};exports[_0xc38f('0x26')]=function(_0x1fc977,_0x415e9c){return db['FreshsalesField'][_0xc38f('0x46')]({'where':{'id':_0x1fc977[_0xc38f('0x49')]['id']}})[_0xc38f('0x25')](handleEntityNotFound(_0x415e9c,null))[_0xc38f('0x25')](removeEntity(_0x415e9c,null))[_0xc38f('0x42')](handleError(_0x415e9c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 0bb8163..6cb217a 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 _0x793b=['freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0x793b,0x189));var _0xb793=function(_0xde3582,_0x4e3299){_0xde3582=_0xde3582-0x0;var _0x1723cb=_0x793b[_0xde3582];return _0x1723cb;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var logger=require(_0xb793('0x2'))(_0xb793('0x3'));var moment=require(_0xb793('0x4'));var BPromise=require('bluebird');var rp=require(_0xb793('0x5'));var fs=require('fs');var path=require(_0xb793('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb793('0x7'));module[_0xb793('0x8')]=function(_0x322b07,_0x2b1f19){return _0x322b07[_0xb793('0x9')](_0xb793('0xa'),attributes,{'tableName':_0xb793('0xb'),'paranoid':![],'indexes':[{'name':_0xb793('0xc'),'fields':[_0xb793('0xd'),_0xb793('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0120=['rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4624c4,_0x2620c9){var _0x3c0d60=function(_0x18abbe){while(--_0x18abbe){_0x4624c4['push'](_0x4624c4['shift']());}};_0x3c0d60(++_0x2620c9);}(_0x0120,0x6f));var _0x0012=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x0120[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));module[_0x0012('0xb')]=function(_0x4eaa5b,_0x4b396c){return _0x4eaa5b['define'](_0x0012('0xc'),attributes,{'tableName':_0x0012('0xd'),'paranoid':![],'indexes':[{'name':_0x0012('0xe'),'fields':[_0x0012('0xf'),_0x0012('0x10')],'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 4d8007b..7dccc1d 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 _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x178cbc,_0x5dd294){_0x178cbc=_0x178cbc-0x0;var _0x5da6cb=_0x3f8a[_0x178cbc];return _0x5da6cb;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('FreshsalesField,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});} \ No newline at end of file +var _0x326f=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4c2343,_0x37c3c5){var _0x47ae07=function(_0x4064f9){while(--_0x4064f9){_0x4c2343['push'](_0x4c2343['shift']());}};_0x47ae07(++_0x37c3c5);}(_0x326f,0xd1));var _0xf326=function(_0x86e931,_0x5df853){_0x86e931=_0x86e931-0x0;var _0x31b793=_0x326f[_0x86e931];return _0x31b793;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index add7b07..050804f 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3beb80,_0x35d46){var _0x31edd4=function(_0x20095e){while(--_0x20095e){_0x3beb80['push'](_0x3beb80['shift']());}};_0x31edd4(++_0x35d46);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5bba34,_0x3bae14){var _0xbfc48a=function(_0xff1738){while(--_0xff1738){_0x5bba34['push'](_0x5bba34['shift']());}};_0xbfc48a(++_0x3bae14);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 27192b3..8ae68e5 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 _0x48ac=['STRING','username','exports'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x48ac,0xe0));var _0xc48a=function(_0x265ec7,_0x5d062c){_0x265ec7=_0x265ec7-0x0;var _0x351b7d=_0x48ac[_0x265ec7];return _0x351b7d;};'use strict';var Sequelize=require('sequelize');module[_0xc48a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc48a('0x1')]},'username':{'type':Sequelize[_0xc48a('0x1')],'unique':_0xc48a('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc48a('0x1')]},'clientId':{'type':Sequelize[_0xc48a('0x1')]},'clientSecret':{'type':Sequelize[_0xc48a('0x1')]},'securityToken':{'type':Sequelize[_0xc48a('0x1')]},'serverUrl':{'type':Sequelize[_0xc48a('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x652a=['STRING','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x652a,0x1ae));var _0xa652=function(_0x53bb90,_0x171d1c){_0x53bb90=_0x53bb90-0x0;var _0x361006=_0x652a[_0x53bb90];return _0x361006;};'use strict';var Sequelize=require(_0xa652('0x0'));module[_0xa652('0x1')]={'name':{'type':Sequelize[_0xa652('0x2')]},'description':{'type':Sequelize[_0xa652('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xa652('0x2')]},'password':{'type':Sequelize[_0xa652('0x2')]},'clientId':{'type':Sequelize[_0xa652('0x2')]},'clientSecret':{'type':Sequelize[_0xa652('0x2')]},'securityToken':{'type':Sequelize[_0xa652('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa652('0x3')](_0xa652('0x4'),_0xa652('0x5')),'defaultValue':_0xa652('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index d2cae7d..a19cba1 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 _0xa18f=['findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','Subjects','channel','Descriptions','getDescriptions','SalesforceField','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','email','textarea','phone','remove','includes','label','custom','picklistValues','value','boolean','True','true','False','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','end','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','include','SalesforceAccount'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa18f,0xb2));var _0xfa18=function(_0x355df0,_0x4ee207){_0x355df0=_0x355df0-0x0;var _0x3daaef=_0xa18f[_0x355df0];return _0x3daaef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfa18('0x0'));var zipdir=require(_0xfa18('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa18('0x2'));var moment=require(_0xfa18('0x3'));var BPromise=require(_0xfa18('0x4'));var Mustache=require(_0xfa18('0x5'));var util=require(_0xfa18('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xfa18('0x7'));var ejs=require(_0xfa18('0x8'));var fs=require('fs');var fs_extra=require(_0xfa18('0x9'));var _=require(_0xfa18('0xa'));var squel=require(_0xfa18('0xb'));var crypto=require(_0xfa18('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfa18('0x7'));var querystring=require('querystring');var Papa=require(_0xfa18('0xd'));var Redis=require('ioredis');var authService=require(_0xfa18('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfa18('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa18('0x10'))(_0xfa18('0x11'));var utils=require(_0xfa18('0x12'));var config=require(_0xfa18('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa18('0x14'))['db'];var integrations=require(_0xfa18('0x15'));function respondWithStatusCode(_0xbf5b47,_0x135828){_0x135828=_0x135828||0xcc;return function(_0x2c7433){if(_0x2c7433){return _0xbf5b47[_0xfa18('0x16')](_0x135828);}return _0xbf5b47['status'](_0x135828)['end']();};}function respondWithResult(_0x32a159,_0x63614a){_0x63614a=_0x63614a||0xc8;return function(_0xfa7b2a){if(_0xfa7b2a){return _0x32a159[_0xfa18('0x17')](_0x63614a)['json'](_0xfa7b2a);}};}function respondWithFilteredResult(_0xa634ed,_0x1718d4){return function(_0x32c868){if(_0x32c868){var _0x5b988c=typeof _0x1718d4['offset']===_0xfa18('0x18')&&typeof _0x1718d4['limit']===_0xfa18('0x18');var _0x4dd543=_0x32c868[_0xfa18('0x19')];var _0x529384=_0x5b988c?0x0:_0x1718d4[_0xfa18('0x1a')];var _0x472c3f=_0x5b988c?_0x32c868[_0xfa18('0x19')]:_0x1718d4[_0xfa18('0x1a')]+_0x1718d4[_0xfa18('0x1b')];var _0x274fe8;if(_0x472c3f>=_0x4dd543){_0x472c3f=_0x4dd543;_0x274fe8=0xc8;}else{_0x274fe8=0xce;}_0xa634ed[_0xfa18('0x17')](_0x274fe8);return _0xa634ed['set'](_0xfa18('0x1c'),_0x529384+'-'+_0x472c3f+'/'+_0x4dd543)[_0xfa18('0x1d')](_0x32c868);}return null;};}function patchUpdates(_0xce0b1){return function(_0x4b3f0a){try{jsonpatch[_0xfa18('0x1e')](_0x4b3f0a,_0xce0b1,!![]);}catch(_0x3734df){return BPromise[_0xfa18('0x1f')](_0x3734df);}return _0x4b3f0a[_0xfa18('0x20')]();};}function saveUpdates(_0xa3c15c,_0x4f3904){return function(_0x1989c7){if(_0x1989c7){return _0x1989c7[_0xfa18('0x21')](_0xa3c15c)[_0xfa18('0x22')](function(_0xc4bdf){return _0xc4bdf;});}return null;};}function removeEntity(_0x3061de,_0x157acf){return function(_0x4f5002){if(_0x4f5002){return _0x4f5002['destroy']()[_0xfa18('0x22')](function(){_0x3061de[_0xfa18('0x17')](0xcc)[_0xfa18('0x23')]();});}};}function handleEntityNotFound(_0x58e79d,_0x2c9355){return function(_0x858e07){if(!_0x858e07){_0x58e79d[_0xfa18('0x16')](0x194);}return _0x858e07;};}function handleError(_0x596886,_0x1d0f44){_0x1d0f44=_0x1d0f44||0x1f4;return function(_0x1e9592){logger['error'](_0x1e9592[_0xfa18('0x24')]);if(_0x1e9592[_0xfa18('0x25')]){delete _0x1e9592[_0xfa18('0x25')];}_0x596886['status'](_0x1d0f44)[_0xfa18('0x26')](_0x1e9592);};}exports['index']=function(_0x1c7504,_0x1b6fed){var _0xcc36da={},_0x466358={},_0x197a05={'count':0x0,'rows':[]};var _0x3deb6f=_[_0xfa18('0x27')](db['SalesforceAccount'][_0xfa18('0x28')],function(_0x50919e){return{'name':_0x50919e[_0xfa18('0x29')],'type':_0x50919e['type'][_0xfa18('0x2a')]};});_0x466358[_0xfa18('0x2b')]=_[_0xfa18('0x27')](_0x3deb6f,'name');_0x466358[_0xfa18('0x2c')]=_['keys'](_0x1c7504[_0xfa18('0x2c')]);_0x466358[_0xfa18('0x2d')]=_[_0xfa18('0x2e')](_0x466358[_0xfa18('0x2b')],_0x466358[_0xfa18('0x2c')]);_0xcc36da[_0xfa18('0x2f')]=_[_0xfa18('0x2e')](_0x466358[_0xfa18('0x2b')],qs[_0xfa18('0x30')](_0x1c7504[_0xfa18('0x2c')][_0xfa18('0x30')]));_0xcc36da[_0xfa18('0x2f')]=_0xcc36da[_0xfa18('0x2f')][_0xfa18('0x31')]?_0xcc36da[_0xfa18('0x2f')]:_0x466358[_0xfa18('0x2b')];if(!_0x1c7504[_0xfa18('0x2c')][_0xfa18('0x32')](_0xfa18('0x33'))){_0xcc36da[_0xfa18('0x1b')]=qs['limit'](_0x1c7504[_0xfa18('0x2c')][_0xfa18('0x1b')]);_0xcc36da['offset']=qs['offset'](_0x1c7504['query'][_0xfa18('0x1a')]);}_0xcc36da[_0xfa18('0x34')]=qs[_0xfa18('0x35')](_0x1c7504['query'][_0xfa18('0x35')]);_0xcc36da[_0xfa18('0x36')]=qs['filters'](_['pick'](_0x1c7504[_0xfa18('0x2c')],_0x466358[_0xfa18('0x2d')]),_0x3deb6f);if(_0x1c7504['query'][_0xfa18('0x37')]){_0xcc36da[_0xfa18('0x36')]=_['merge'](_0xcc36da[_0xfa18('0x36')],{'$or':_[_0xfa18('0x27')](_0x3deb6f,function(_0x24536b){if(_0x24536b[_0xfa18('0x38')]!=='VIRTUAL'){var _0x309fd0={};_0x309fd0[_0x24536b[_0xfa18('0x25')]]={'$like':'%'+_0x1c7504[_0xfa18('0x2c')]['filter']+'%'};return _0x309fd0;}})});}_0xcc36da=_[_0xfa18('0x39')]({},_0xcc36da,_0x1c7504[_0xfa18('0x3a')]);var _0x13a10c={'where':_0xcc36da[_0xfa18('0x36')]};return db['SalesforceAccount'][_0xfa18('0x19')](_0x13a10c)['then'](function(_0x58b4ee){_0x197a05[_0xfa18('0x19')]=_0x58b4ee;if(_0x1c7504[_0xfa18('0x2c')][_0xfa18('0x3b')]){_0xcc36da[_0xfa18('0x3c')]=[{'all':!![]}];}return db[_0xfa18('0x3d')][_0xfa18('0x3e')](_0xcc36da);})[_0xfa18('0x22')](function(_0x4f5846){_0x197a05[_0xfa18('0x3f')]=_0x4f5846;return _0x197a05;})[_0xfa18('0x22')](respondWithFilteredResult(_0x1b6fed,_0xcc36da))[_0xfa18('0x40')](handleError(_0x1b6fed,null));};exports[_0xfa18('0x41')]=function(_0x2a94a7,_0x10032a){var _0x499c5f={'raw':![],'where':{'id':_0x2a94a7[_0xfa18('0x42')]['id']}},_0x136d4b={};_0x136d4b[_0xfa18('0x2b')]=_[_0xfa18('0x43')](db[_0xfa18('0x3d')][_0xfa18('0x28')]);_0x136d4b[_0xfa18('0x2c')]=_[_0xfa18('0x43')](_0x2a94a7[_0xfa18('0x2c')]);_0x136d4b[_0xfa18('0x2d')]=_[_0xfa18('0x2e')](_0x136d4b[_0xfa18('0x2b')],_0x136d4b[_0xfa18('0x2c')]);_0x499c5f[_0xfa18('0x2f')]=_[_0xfa18('0x2e')](_0x136d4b[_0xfa18('0x2b')],qs['fields'](_0x2a94a7[_0xfa18('0x2c')]['fields']));_0x499c5f[_0xfa18('0x2f')]=_0x499c5f[_0xfa18('0x2f')]['length']?_0x499c5f[_0xfa18('0x2f')]:_0x136d4b[_0xfa18('0x2b')];if(_0x2a94a7[_0xfa18('0x2c')][_0xfa18('0x3b')]){_0x499c5f[_0xfa18('0x3c')]=[{'all':!![]}];}_0x499c5f=_[_0xfa18('0x39')]({},_0x499c5f,_0x2a94a7[_0xfa18('0x3a')]);return db[_0xfa18('0x3d')][_0xfa18('0x44')](_0x499c5f)[_0xfa18('0x22')](handleEntityNotFound(_0x10032a,null))[_0xfa18('0x22')](respondWithResult(_0x10032a,null))[_0xfa18('0x40')](handleError(_0x10032a,null));};exports[_0xfa18('0x45')]=function(_0x4b437c,_0x4a38ca){return db[_0xfa18('0x3d')]['create'](_0x4b437c['body'],{})[_0xfa18('0x22')](respondWithResult(_0x4a38ca,0xc9))[_0xfa18('0x40')](handleError(_0x4a38ca,null));};exports[_0xfa18('0x21')]=function(_0x203ad2,_0x59492a){if(_0x203ad2[_0xfa18('0x46')]['id']){delete _0x203ad2[_0xfa18('0x46')]['id'];}return db['SalesforceAccount'][_0xfa18('0x44')]({'where':{'id':_0x203ad2[_0xfa18('0x42')]['id']}})[_0xfa18('0x22')](handleEntityNotFound(_0x59492a,null))[_0xfa18('0x22')](saveUpdates(_0x203ad2[_0xfa18('0x46')],null))['then'](respondWithResult(_0x59492a,null))[_0xfa18('0x40')](handleError(_0x59492a,null));};exports['destroy']=function(_0x1b6e9d,_0x264fbc){return db[_0xfa18('0x3d')][_0xfa18('0x44')]({'where':{'id':_0x1b6e9d[_0xfa18('0x42')]['id']}})['then'](handleEntityNotFound(_0x264fbc,null))['then'](removeEntity(_0x264fbc,null))[_0xfa18('0x40')](handleError(_0x264fbc,null));};exports[_0xfa18('0x47')]=function(_0x2d380a,_0x53f3c0,_0x995e9c){var _0x5288d0={};var _0x44a937={};var _0xd13278;var _0x417e79;return db[_0xfa18('0x3d')][_0xfa18('0x48')]({'where':{'id':_0x2d380a['params']['id']}})[_0xfa18('0x22')](handleEntityNotFound(_0x53f3c0,null))[_0xfa18('0x22')](function(_0x538398){if(_0x538398){_0xd13278=_0x538398;_0x44a937[_0xfa18('0x2b')]=_['keys'](db[_0xfa18('0x49')][_0xfa18('0x28')]);_0x44a937['query']=_[_0xfa18('0x43')](_0x2d380a[_0xfa18('0x2c')]);_0x44a937[_0xfa18('0x2d')]=_[_0xfa18('0x2e')](_0x44a937[_0xfa18('0x2b')],_0x44a937[_0xfa18('0x2c')]);_0x5288d0['attributes']=_['intersection'](_0x44a937[_0xfa18('0x2b')],qs['fields'](_0x2d380a[_0xfa18('0x2c')][_0xfa18('0x30')]));_0x5288d0[_0xfa18('0x2f')]=_0x5288d0['attributes']['length']?_0x5288d0[_0xfa18('0x2f')]:_0x44a937[_0xfa18('0x2b')];_0x5288d0['order']=qs['sort'](_0x2d380a[_0xfa18('0x2c')][_0xfa18('0x35')]);_0x5288d0[_0xfa18('0x36')]=qs[_0xfa18('0x2d')](_['pick'](_0x2d380a[_0xfa18('0x2c')],_0x44a937[_0xfa18('0x2d')]));if(_0x2d380a['query'][_0xfa18('0x37')]){_0x5288d0[_0xfa18('0x36')]=_[_0xfa18('0x39')](_0x5288d0[_0xfa18('0x36')],{'$or':_[_0xfa18('0x27')](_0x5288d0['attributes'],function(_0xc9054b){var _0x4d2808={};_0x4d2808[_0xc9054b]={'$like':'%'+_0x2d380a[_0xfa18('0x2c')][_0xfa18('0x37')]+'%'};return _0x4d2808;})});}_0x5288d0=_[_0xfa18('0x39')]({},_0x5288d0,_0x2d380a[_0xfa18('0x3a')]);return _0xd13278[_0xfa18('0x47')](_0x5288d0);}})[_0xfa18('0x22')](function(_0x44dd85){if(_0x44dd85){_0x417e79=_0x44dd85[_0xfa18('0x31')];if(!_0x2d380a[_0xfa18('0x2c')]['hasOwnProperty'](_0xfa18('0x33'))){_0x5288d0[_0xfa18('0x1b')]=qs[_0xfa18('0x1b')](_0x2d380a[_0xfa18('0x2c')][_0xfa18('0x1b')]);_0x5288d0[_0xfa18('0x1a')]=qs[_0xfa18('0x1a')](_0x2d380a['query'][_0xfa18('0x1a')]);}return _0xd13278[_0xfa18('0x47')](_0x5288d0);}})[_0xfa18('0x22')](function(_0x16bbc4){if(_0x16bbc4){return _0x16bbc4?{'count':_0x417e79,'rows':_0x16bbc4}:null;}})[_0xfa18('0x22')](respondWithResult(_0x53f3c0,null))[_0xfa18('0x40')](handleError(_0x53f3c0,null));};exports[_0xfa18('0x4a')]=function(_0x4f0241,_0x52a0ee,_0x5bac9e){if(_0x4f0241[_0xfa18('0x46')]['id']){delete _0x4f0241[_0xfa18('0x46')]['id'];}return db[_0xfa18('0x3d')]['findOne']({'where':{'id':_0x4f0241[_0xfa18('0x42')]['id']}})[_0xfa18('0x22')](handleEntityNotFound(_0x52a0ee,null))[_0xfa18('0x22')](function(_0x384d14){if(_0x384d14){_0x4f0241['body']['AccountId']=_0x384d14['id'];_0x4f0241[_0xfa18('0x46')][_0xfa18('0x4b')]=integrations['getSubjects'](_0x4f0241[_0xfa18('0x46')][_0xfa18('0x4c')],_0x4f0241[_0xfa18('0x46')][_0xfa18('0x38')]);_0x4f0241[_0xfa18('0x46')][_0xfa18('0x4d')]=integrations[_0xfa18('0x4e')](_0x4f0241[_0xfa18('0x46')][_0xfa18('0x4c')],_0x4f0241['body'][_0xfa18('0x38')]);return db[_0xfa18('0x49')]['create'](_0x4f0241[_0xfa18('0x46')],{'include':[{'model':db['SalesforceField'],'as':_0xfa18('0x4b')},{'model':db[_0xfa18('0x4f')],'as':_0xfa18('0x4d')}]});}return null;})[_0xfa18('0x22')](respondWithResult(_0x52a0ee,null))[_0xfa18('0x40')](handleError(_0x52a0ee,null));};exports['getFields']=function(_0x5a2851,_0x505a5c,_0x26ea40){var _0xd9d64b;var _0x1097a1='';var _0x4c6d2a='Task';return db['SalesforceAccount'][_0xfa18('0x48')]({'where':{'id':_0x5a2851[_0xfa18('0x42')]['id']},'attributes':['id',_0xfa18('0x50'),_0xfa18('0x51'),_0xfa18('0x52'),_0xfa18('0x53'),_0xfa18('0x54'),_0xfa18('0x55')]})[_0xfa18('0x22')](handleEntityNotFound(_0x505a5c,null))[_0xfa18('0x22')](function(_0xf614f6){if(_0xf614f6){_0x1097a1=_0xf614f6[_0xfa18('0x50')];var _0x82f46=_0x1097a1[_0xfa18('0x56')](-0x1);if(_0x82f46==='/'){_0x1097a1=_0x1097a1[_0xfa18('0x57')](0x0,_0x1097a1[_0xfa18('0x58')](_0x82f46));}_0xd9d64b=new jsforce[(_0xfa18('0x59'))]({'oauth2':{'loginUrl':_0x1097a1,'clientId':_0xf614f6[_0xfa18('0x51')],'clientSecret':_0xf614f6[_0xfa18('0x52')]}});return _0xd9d64b[_0xfa18('0x5a')](_0xf614f6[_0xfa18('0x53')],_0xf614f6['password']['concat'](_0xf614f6['securityToken']));}})['then'](function(_0x5e4667){if(_0x5e4667){if(!_[_0xfa18('0x5b')](_0x5a2851[_0xfa18('0x2c')][_0xfa18('0x5c')])){_0x4c6d2a=_0x5a2851[_0xfa18('0x2c')][_0xfa18('0x5c')];}return _0xd9d64b[_0xfa18('0x5d')](_0x4c6d2a)['describe']();}})[_0xfa18('0x22')](function(_0x354253){var _0x48d959=[_0xfa18('0x5e'),_0xfa18('0x5f'),_0xfa18('0x60'),_0xfa18('0x61'),_0xfa18('0x62'),'Description'];var _0x2c0046=[_0xfa18('0x63'),'int','picklist','boolean',_0xfa18('0x64'),_0xfa18('0x65'),_0xfa18('0x66')];if(_0x354253){_[_0xfa18('0x67')](_0x354253[_0xfa18('0x30')],function(_0x3115ea){return _0x48d959['includes'](_0x3115ea[_0xfa18('0x25')])||!_0x2c0046[_0xfa18('0x68')](_0x3115ea[_0xfa18('0x38')]);});return{'count':_0x354253[_0xfa18('0x30')][_0xfa18('0x31')],'rows':_['map'](_0x354253[_0xfa18('0x30')],function(_0x5f1c69){return{'id':_0x5f1c69[_0xfa18('0x25')],'name':_0x5f1c69[_0xfa18('0x69')],'custom':_0x5f1c69[_0xfa18('0x6a')],'options':_0x5f1c69[_0xfa18('0x6b')][_0xfa18('0x31')]>0x0?_['map'](_0x5f1c69[_0xfa18('0x6b')],function(_0x2373a6){return{'name':_0x2373a6['label'],'value':_0x2373a6[_0xfa18('0x6c')]};}):_0x5f1c69['type']==_0xfa18('0x6d')?[{'name':_0xfa18('0x6e'),'value':_0xfa18('0x6f')},{'name':_0xfa18('0x70'),'value':_0xfa18('0x71')}]:[]};})};}})['then'](respondWithResult(_0x505a5c,null))[_0xfa18('0x40')](function(_0x4f7213){var _0x2db136=_0x5a2851[_0xfa18('0x2c')][_0xfa18('0x72')]?0x1f4:_0x4f7213[_0xfa18('0x73')]||0x1f4;logger[_0xfa18('0x74')](_0xfa18('0x75'),_0xfa18('0x76'),_0x2db136,JSON[_0xfa18('0x77')](_0x4f7213));delete _0x4f7213[_0xfa18('0x25')];if(_0x2db136===0x191){_0x2db136=0x190;}_0x505a5c[_0xfa18('0x17')](_0x2db136)[_0xfa18('0x26')](_0x5a2851[_0xfa18('0x2c')][_0xfa18('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x4f7213[_0xfa18('0x73')]}:_0x4f7213);});}; \ No newline at end of file +var _0xa72b=['sendStatus','error','name','send','map','SalesforceAccount','fieldName','type','model','keys','query','filters','intersection','fields','attributes','sort','where','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','merge','find','create','body','getConfigurations','findOne','SalesforceConfiguration','order','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','Descriptions','channel','SalesforceField','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','login','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','Subject','string','int','picklist','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','value','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','apply','reject','update','then'];(function(_0x4b2172,_0x13fc35){var _0x4347e9=function(_0x4f7db3){while(--_0x4f7db3){_0x4b2172['push'](_0x4b2172['shift']());}};_0x4347e9(++_0x13fc35);}(_0xa72b,0xce));var _0xba72=function(_0x3b6e1f,_0x15f304){_0x3b6e1f=_0x3b6e1f-0x0;var _0x3ac3bb=_0xa72b[_0x3b6e1f];return _0x3ac3bb;};'use strict';var emlformat=require(_0xba72('0x0'));var rimraf=require(_0xba72('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba72('0x2'));var rp=require(_0xba72('0x3'));var moment=require('moment');var BPromise=require(_0xba72('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xba72('0x5'));var sox=require(_0xba72('0x6'));var csv=require('to-csv');var ejs=require(_0xba72('0x7'));var fs=require('fs');var fs_extra=require(_0xba72('0x8'));var _=require(_0xba72('0x9'));var squel=require(_0xba72('0xa'));var crypto=require(_0xba72('0xb'));var jsforce=require(_0xba72('0xc'));var deskjs=require(_0xba72('0xd'));var toCsv=require(_0xba72('0xe'));var querystring=require(_0xba72('0xf'));var Papa=require(_0xba72('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xba72('0x11'));var as=require(_0xba72('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba72('0x13'))(_0xba72('0x14'));var utils=require(_0xba72('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xba72('0x16'));var db=require(_0xba72('0x17'))['db'];var integrations=require(_0xba72('0x18'));function respondWithStatusCode(_0x3a75b2,_0x5b0b55){_0x5b0b55=_0x5b0b55||0xcc;return function(_0x278ee4){if(_0x278ee4){return _0x3a75b2['sendStatus'](_0x5b0b55);}return _0x3a75b2[_0xba72('0x19')](_0x5b0b55)[_0xba72('0x1a')]();};}function respondWithResult(_0x1e6df7,_0x1d3aa9){_0x1d3aa9=_0x1d3aa9||0xc8;return function(_0x4e858a){if(_0x4e858a){return _0x1e6df7[_0xba72('0x19')](_0x1d3aa9)[_0xba72('0x1b')](_0x4e858a);}};}function respondWithFilteredResult(_0x2cdcac,_0x53e751){return function(_0xf3d3b2){if(_0xf3d3b2){var _0x3e6d12=typeof _0x53e751['offset']===_0xba72('0x1c')&&typeof _0x53e751[_0xba72('0x1d')]===_0xba72('0x1c');var _0x52282d=_0xf3d3b2[_0xba72('0x1e')];var _0x51549f=_0x3e6d12?0x0:_0x53e751['offset'];var _0x98f31c=_0x3e6d12?_0xf3d3b2[_0xba72('0x1e')]:_0x53e751[_0xba72('0x1f')]+_0x53e751[_0xba72('0x1d')];var _0x30d255;if(_0x98f31c>=_0x52282d){_0x98f31c=_0x52282d;_0x30d255=0xc8;}else{_0x30d255=0xce;}_0x2cdcac[_0xba72('0x19')](_0x30d255);return _0x2cdcac['set']('Content-Range',_0x51549f+'-'+_0x98f31c+'/'+_0x52282d)[_0xba72('0x1b')](_0xf3d3b2);}return null;};}function patchUpdates(_0x1e376e){return function(_0x5c73b5){try{jsonpatch[_0xba72('0x20')](_0x5c73b5,_0x1e376e,!![]);}catch(_0x5dd9df){return BPromise[_0xba72('0x21')](_0x5dd9df);}return _0x5c73b5['save']();};}function saveUpdates(_0x23947a,_0x15841e){return function(_0x22dda7){if(_0x22dda7){return _0x22dda7[_0xba72('0x22')](_0x23947a)['then'](function(_0x3e158c){return _0x3e158c;});}return null;};}function removeEntity(_0x5ae29b,_0x261503){return function(_0x2a697a){if(_0x2a697a){return _0x2a697a['destroy']()[_0xba72('0x23')](function(){_0x5ae29b[_0xba72('0x19')](0xcc)[_0xba72('0x1a')]();});}};}function handleEntityNotFound(_0x202680,_0x3a7b2b){return function(_0x460c6a){if(!_0x460c6a){_0x202680[_0xba72('0x24')](0x194);}return _0x460c6a;};}function handleError(_0x18d7ea,_0x3f8d46){_0x3f8d46=_0x3f8d46||0x1f4;return function(_0x1aa13){logger[_0xba72('0x25')](_0x1aa13['stack']);if(_0x1aa13[_0xba72('0x26')]){delete _0x1aa13[_0xba72('0x26')];}_0x18d7ea[_0xba72('0x19')](_0x3f8d46)[_0xba72('0x27')](_0x1aa13);};}exports['index']=function(_0x2e1e1c,_0x340480){var _0x1fc4f2={},_0x2946b6={},_0x3829af={'count':0x0,'rows':[]};var _0x3a290e=_[_0xba72('0x28')](db[_0xba72('0x29')]['rawAttributes'],function(_0x31de92){return{'name':_0x31de92[_0xba72('0x2a')],'type':_0x31de92[_0xba72('0x2b')]['key']};});_0x2946b6[_0xba72('0x2c')]=_[_0xba72('0x28')](_0x3a290e,'name');_0x2946b6['query']=_[_0xba72('0x2d')](_0x2e1e1c[_0xba72('0x2e')]);_0x2946b6[_0xba72('0x2f')]=_[_0xba72('0x30')](_0x2946b6[_0xba72('0x2c')],_0x2946b6[_0xba72('0x2e')]);_0x1fc4f2['attributes']=_[_0xba72('0x30')](_0x2946b6[_0xba72('0x2c')],qs[_0xba72('0x31')](_0x2e1e1c[_0xba72('0x2e')][_0xba72('0x31')]));_0x1fc4f2[_0xba72('0x32')]=_0x1fc4f2[_0xba72('0x32')]['length']?_0x1fc4f2['attributes']:_0x2946b6[_0xba72('0x2c')];if(!_0x2e1e1c[_0xba72('0x2e')]['hasOwnProperty']('nolimit')){_0x1fc4f2[_0xba72('0x1d')]=qs[_0xba72('0x1d')](_0x2e1e1c[_0xba72('0x2e')][_0xba72('0x1d')]);_0x1fc4f2[_0xba72('0x1f')]=qs[_0xba72('0x1f')](_0x2e1e1c[_0xba72('0x2e')][_0xba72('0x1f')]);}_0x1fc4f2['order']=qs[_0xba72('0x33')](_0x2e1e1c[_0xba72('0x2e')]['sort']);_0x1fc4f2[_0xba72('0x34')]=qs[_0xba72('0x2f')](_['pick'](_0x2e1e1c['query'],_0x2946b6['filters']),_0x3a290e);if(_0x2e1e1c[_0xba72('0x2e')][_0xba72('0x35')]){_0x1fc4f2[_0xba72('0x34')]=_['merge'](_0x1fc4f2[_0xba72('0x34')],{'$or':_[_0xba72('0x28')](_0x3a290e,function(_0x27bd73){if(_0x27bd73[_0xba72('0x2b')]!=='VIRTUAL'){var _0x1a61c9={};_0x1a61c9[_0x27bd73[_0xba72('0x26')]]={'$like':'%'+_0x2e1e1c['query']['filter']+'%'};return _0x1a61c9;}})});}_0x1fc4f2=_['merge']({},_0x1fc4f2,_0x2e1e1c[_0xba72('0x36')]);var _0x416f15={'where':_0x1fc4f2[_0xba72('0x34')]};return db[_0xba72('0x29')][_0xba72('0x1e')](_0x416f15)[_0xba72('0x23')](function(_0x42fd76){_0x3829af['count']=_0x42fd76;if(_0x2e1e1c[_0xba72('0x2e')][_0xba72('0x37')]){_0x1fc4f2['include']=[{'all':!![]}];}return db[_0xba72('0x29')][_0xba72('0x38')](_0x1fc4f2);})[_0xba72('0x23')](function(_0x4ceffe){_0x3829af[_0xba72('0x39')]=_0x4ceffe;return _0x3829af;})[_0xba72('0x23')](respondWithFilteredResult(_0x340480,_0x1fc4f2))[_0xba72('0x3a')](handleError(_0x340480,null));};exports[_0xba72('0x3b')]=function(_0x32965d,_0x24624c){var _0xec8463={'raw':![],'where':{'id':_0x32965d[_0xba72('0x3c')]['id']}},_0x2a406b={};_0x2a406b[_0xba72('0x2c')]=_[_0xba72('0x2d')](db['SalesforceAccount'][_0xba72('0x3d')]);_0x2a406b[_0xba72('0x2e')]=_[_0xba72('0x2d')](_0x32965d[_0xba72('0x2e')]);_0x2a406b[_0xba72('0x2f')]=_[_0xba72('0x30')](_0x2a406b[_0xba72('0x2c')],_0x2a406b[_0xba72('0x2e')]);_0xec8463['attributes']=_[_0xba72('0x30')](_0x2a406b[_0xba72('0x2c')],qs[_0xba72('0x31')](_0x32965d[_0xba72('0x2e')][_0xba72('0x31')]));_0xec8463[_0xba72('0x32')]=_0xec8463[_0xba72('0x32')][_0xba72('0x3e')]?_0xec8463[_0xba72('0x32')]:_0x2a406b[_0xba72('0x2c')];if(_0x32965d[_0xba72('0x2e')][_0xba72('0x37')]){_0xec8463[_0xba72('0x3f')]=[{'all':!![]}];}_0xec8463=_[_0xba72('0x40')]({},_0xec8463,_0x32965d['options']);return db[_0xba72('0x29')][_0xba72('0x41')](_0xec8463)[_0xba72('0x23')](handleEntityNotFound(_0x24624c,null))[_0xba72('0x23')](respondWithResult(_0x24624c,null))[_0xba72('0x3a')](handleError(_0x24624c,null));};exports[_0xba72('0x42')]=function(_0x5d91a4,_0x10bb68){return db[_0xba72('0x29')]['create'](_0x5d91a4[_0xba72('0x43')],{})['then'](respondWithResult(_0x10bb68,0xc9))[_0xba72('0x3a')](handleError(_0x10bb68,null));};exports[_0xba72('0x22')]=function(_0x502f49,_0x137258){if(_0x502f49[_0xba72('0x43')]['id']){delete _0x502f49[_0xba72('0x43')]['id'];}return db['SalesforceAccount'][_0xba72('0x41')]({'where':{'id':_0x502f49[_0xba72('0x3c')]['id']}})[_0xba72('0x23')](handleEntityNotFound(_0x137258,null))[_0xba72('0x23')](saveUpdates(_0x502f49['body'],null))[_0xba72('0x23')](respondWithResult(_0x137258,null))['catch'](handleError(_0x137258,null));};exports['destroy']=function(_0x50ca0b,_0x31860e){return db['SalesforceAccount']['find']({'where':{'id':_0x50ca0b[_0xba72('0x3c')]['id']}})[_0xba72('0x23')](handleEntityNotFound(_0x31860e,null))[_0xba72('0x23')](removeEntity(_0x31860e,null))['catch'](handleError(_0x31860e,null));};exports[_0xba72('0x44')]=function(_0x1109c5,_0x5e8e53,_0x1ca86d){var _0x291b7a={};var _0x43af46={};var _0x4f9d70;var _0x281b4e;return db[_0xba72('0x29')][_0xba72('0x45')]({'where':{'id':_0x1109c5[_0xba72('0x3c')]['id']}})[_0xba72('0x23')](handleEntityNotFound(_0x5e8e53,null))[_0xba72('0x23')](function(_0x507551){if(_0x507551){_0x4f9d70=_0x507551;_0x43af46[_0xba72('0x2c')]=_['keys'](db[_0xba72('0x46')][_0xba72('0x3d')]);_0x43af46['query']=_[_0xba72('0x2d')](_0x1109c5[_0xba72('0x2e')]);_0x43af46[_0xba72('0x2f')]=_['intersection'](_0x43af46[_0xba72('0x2c')],_0x43af46['query']);_0x291b7a[_0xba72('0x32')]=_[_0xba72('0x30')](_0x43af46[_0xba72('0x2c')],qs['fields'](_0x1109c5[_0xba72('0x2e')][_0xba72('0x31')]));_0x291b7a[_0xba72('0x32')]=_0x291b7a[_0xba72('0x32')][_0xba72('0x3e')]?_0x291b7a[_0xba72('0x32')]:_0x43af46[_0xba72('0x2c')];_0x291b7a[_0xba72('0x47')]=qs[_0xba72('0x33')](_0x1109c5['query'][_0xba72('0x33')]);_0x291b7a[_0xba72('0x34')]=qs[_0xba72('0x2f')](_['pick'](_0x1109c5[_0xba72('0x2e')],_0x43af46['filters']));if(_0x1109c5[_0xba72('0x2e')][_0xba72('0x35')]){_0x291b7a[_0xba72('0x34')]=_['merge'](_0x291b7a['where'],{'$or':_[_0xba72('0x28')](_0x291b7a[_0xba72('0x32')],function(_0x46bbba){var _0x334dfe={};_0x334dfe[_0x46bbba]={'$like':'%'+_0x1109c5[_0xba72('0x2e')][_0xba72('0x35')]+'%'};return _0x334dfe;})});}_0x291b7a=_[_0xba72('0x40')]({},_0x291b7a,_0x1109c5[_0xba72('0x36')]);return _0x4f9d70['getConfigurations'](_0x291b7a);}})[_0xba72('0x23')](function(_0x4b452d){if(_0x4b452d){_0x281b4e=_0x4b452d[_0xba72('0x3e')];if(!_0x1109c5['query'][_0xba72('0x48')](_0xba72('0x49'))){_0x291b7a[_0xba72('0x1d')]=qs[_0xba72('0x1d')](_0x1109c5[_0xba72('0x2e')][_0xba72('0x1d')]);_0x291b7a[_0xba72('0x1f')]=qs[_0xba72('0x1f')](_0x1109c5['query'][_0xba72('0x1f')]);}return _0x4f9d70[_0xba72('0x44')](_0x291b7a);}})['then'](function(_0x473590){if(_0x473590){return _0x473590?{'count':_0x281b4e,'rows':_0x473590}:null;}})[_0xba72('0x23')](respondWithResult(_0x5e8e53,null))[_0xba72('0x3a')](handleError(_0x5e8e53,null));};exports[_0xba72('0x4a')]=function(_0x3bc78f,_0x476f76,_0x4fafed){if(_0x3bc78f[_0xba72('0x43')]['id']){delete _0x3bc78f[_0xba72('0x43')]['id'];}return db[_0xba72('0x29')]['findOne']({'where':{'id':_0x3bc78f['params']['id']}})['then'](handleEntityNotFound(_0x476f76,null))[_0xba72('0x23')](function(_0x6f29ea){if(_0x6f29ea){_0x3bc78f[_0xba72('0x43')][_0xba72('0x4b')]=_0x6f29ea['id'];_0x3bc78f[_0xba72('0x43')][_0xba72('0x4c')]=integrations['getSubjects'](_0x3bc78f['body']['channel'],_0x3bc78f['body'][_0xba72('0x2b')]);_0x3bc78f[_0xba72('0x43')][_0xba72('0x4d')]=integrations['getDescriptions'](_0x3bc78f[_0xba72('0x43')][_0xba72('0x4e')],_0x3bc78f[_0xba72('0x43')][_0xba72('0x2b')]);return db['SalesforceConfiguration'][_0xba72('0x42')](_0x3bc78f[_0xba72('0x43')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xba72('0x4f')],'as':_0xba72('0x4d')}]});}return null;})['then'](respondWithResult(_0x476f76,null))[_0xba72('0x3a')](handleError(_0x476f76,null));};exports['getFields']=function(_0x38f8a2,_0x353f55,_0x32f07b){var _0x1bf73b;var _0x151a79='';var _0x3bf917=_0xba72('0x50');return db[_0xba72('0x29')]['findOne']({'where':{'id':_0x38f8a2[_0xba72('0x3c')]['id']},'attributes':['id',_0xba72('0x51'),_0xba72('0x52'),_0xba72('0x53'),_0xba72('0x54'),_0xba72('0x55'),_0xba72('0x56')]})[_0xba72('0x23')](handleEntityNotFound(_0x353f55,null))[_0xba72('0x23')](function(_0x5e40d8){if(_0x5e40d8){_0x151a79=_0x5e40d8[_0xba72('0x51')];var _0x47ea59=_0x151a79[_0xba72('0x57')](-0x1);if(_0x47ea59==='/'){_0x151a79=_0x151a79['substring'](0x0,_0x151a79[_0xba72('0x58')](_0x47ea59));}_0x1bf73b=new jsforce[(_0xba72('0x59'))]({'oauth2':{'loginUrl':_0x151a79,'clientId':_0x5e40d8[_0xba72('0x52')],'clientSecret':_0x5e40d8['clientSecret']}});return _0x1bf73b[_0xba72('0x5a')](_0x5e40d8['username'],_0x5e40d8[_0xba72('0x55')][_0xba72('0x5b')](_0x5e40d8[_0xba72('0x56')]));}})[_0xba72('0x23')](function(_0x4c0f04){if(_0x4c0f04){if(!_[_0xba72('0x5c')](_0x38f8a2[_0xba72('0x2e')][_0xba72('0x5d')])){_0x3bf917=_0x38f8a2[_0xba72('0x2e')][_0xba72('0x5d')];}return _0x1bf73b['sobject'](_0x3bf917)[_0xba72('0x5e')]();}})[_0xba72('0x23')](function(_0x14646f){var _0x384c72=[_0xba72('0x5f'),_0xba72('0x60'),_0xba72('0x61'),'IsRecurrence',_0xba72('0x62'),'Description'];var _0x465a5b=[_0xba72('0x63'),_0xba72('0x64'),_0xba72('0x65'),_0xba72('0x66'),_0xba72('0x67'),_0xba72('0x68'),_0xba72('0x69')];if(_0x14646f){_[_0xba72('0x6a')](_0x14646f[_0xba72('0x31')],function(_0xde31bc){return _0x384c72[_0xba72('0x6b')](_0xde31bc[_0xba72('0x26')])||!_0x465a5b['includes'](_0xde31bc[_0xba72('0x2b')]);});return{'count':_0x14646f[_0xba72('0x31')][_0xba72('0x3e')],'rows':_[_0xba72('0x28')](_0x14646f[_0xba72('0x31')],function(_0x191ad8){return{'id':_0x191ad8['name'],'name':_0x191ad8['label'],'custom':_0x191ad8[_0xba72('0x6c')],'options':_0x191ad8[_0xba72('0x6d')][_0xba72('0x3e')]>0x0?_[_0xba72('0x28')](_0x191ad8[_0xba72('0x6d')],function(_0x5c52b0){return{'name':_0x5c52b0[_0xba72('0x6e')],'value':_0x5c52b0[_0xba72('0x6f')]};}):_0x191ad8[_0xba72('0x2b')]==_0xba72('0x66')?[{'name':'True','value':_0xba72('0x70')},{'name':_0xba72('0x71'),'value':_0xba72('0x72')}]:[]};})};}})[_0xba72('0x23')](respondWithResult(_0x353f55,null))['catch'](function(_0x62cfee){var _0x5bfe1c=_0x38f8a2[_0xba72('0x2e')][_0xba72('0x73')]?0x1f4:_0x62cfee[_0xba72('0x74')]||0x1f4;logger[_0xba72('0x25')](_0xba72('0x75'),_0xba72('0x76'),_0x5bfe1c,JSON[_0xba72('0x77')](_0x62cfee));delete _0x62cfee[_0xba72('0x26')];if(_0x5bfe1c===0x191){_0x5bfe1c=0x190;}_0x353f55[_0xba72('0x19')](_0x5bfe1c)[_0xba72('0x27')](_0x38f8a2[_0xba72('0x2e')]['test']?{'message':_0xba72('0x78'),'statusCode':_0x62cfee[_0xba72('0x74')]}:_0x62cfee);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 76ce993..6d0e80f 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 _0x52b2=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x58387f,_0x30e96e){var _0x17557e=function(_0x51a17d){while(--_0x51a17d){_0x58387f['push'](_0x58387f['shift']());}};_0x17557e(++_0x30e96e);}(_0x52b2,0x11e));var _0x252b=function(_0x1ade23,_0x229aa0){_0x1ade23=_0x1ade23-0x0;var _0x6e4ca=_0x52b2[_0x1ade23];return _0x6e4ca;};'use strict';var _=require(_0x252b('0x0'));var util=require(_0x252b('0x1'));var logger=require(_0x252b('0x2'))(_0x252b('0x3'));var moment=require(_0x252b('0x4'));var BPromise=require(_0x252b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x252b('0x6'));var rimraf=require(_0x252b('0x7'));var config=require(_0x252b('0x8'));var attributes=require(_0x252b('0x9'));var integrations=require(_0x252b('0xa'));module['exports']=function(_0x1025af,_0x409365){return _0x1025af[_0x252b('0xb')](_0x252b('0xc'),attributes,{'tableName':_0x252b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9901=['api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','util'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x9901,0x15e));var _0x1990=function(_0x3d7f7d,_0x5d57d7){_0x3d7f7d=_0x3d7f7d-0x0;var _0x59c78b=_0x9901[_0x3d7f7d];return _0x59c78b;};'use strict';var _=require('lodash');var util=require(_0x1990('0x0'));var logger=require('../../config/logger')(_0x1990('0x1'));var moment=require(_0x1990('0x2'));var BPromise=require(_0x1990('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1990('0x4'));var rimraf=require(_0x1990('0x5'));var config=require(_0x1990('0x6'));var attributes=require(_0x1990('0x7'));var integrations=require(_0x1990('0x8'));module[_0x1990('0x9')]=function(_0x29f5fb,_0x3c1260){return _0x29f5fb[_0x1990('0xa')](_0x1990('0xb'),attributes,{'tableName':_0x1990('0xc'),'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 7e5361e..13d0177 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 _0xcb60=['stringify','error','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch','SalesforceAccount','findAll','options','raw','attributes','map','include','model','GetSalesforceAccount','find','where','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3e330a,_0x11bf04){var _0x451dee=function(_0x1074b7){while(--_0x1074b7){_0x3e330a['push'](_0x3e330a['shift']());}};_0x451dee(++_0x11bf04);}(_0xcb60,0x157));var _0x0cb6=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xcb60[_0x420b24];return _0x4da552;};'use strict';var _=require(_0x0cb6('0x0'));var util=require(_0x0cb6('0x1'));var moment=require(_0x0cb6('0x2'));var BPromise=require(_0x0cb6('0x3'));var rs=require(_0x0cb6('0x4'));var fs=require('fs');var Redis=require(_0x0cb6('0x5'));var db=require(_0x0cb6('0x6'))['db'];var utils=require(_0x0cb6('0x7'));var logger=require('../../config/logger')(_0x0cb6('0x8'));var config=require(_0x0cb6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0cb6('0xa')][_0x0cb6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5152e1,_0x989991,_0x204c73){return new BPromise(function(_0x189d70,_0x4fa4f4){return client[_0x0cb6('0xc')](_0x5152e1,_0x204c73)[_0x0cb6('0xd')](function(_0x164842){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x989991,'request\x20sent');logger[_0x0cb6('0xe')](_0x0cb6('0xf'),_0x989991,_0x0cb6('0x10'),JSON[_0x0cb6('0x11')](_0x164842));if(_0x164842[_0x0cb6('0x12')]){if(_0x164842[_0x0cb6('0x12')]['code']===0x1f4){logger[_0x0cb6('0x12')](_0x0cb6('0x13'),_0x989991,_0x164842['error'][_0x0cb6('0x14')]);return _0x4fa4f4(_0x164842['error'][_0x0cb6('0x14')]);}logger[_0x0cb6('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x989991,_0x164842['error'][_0x0cb6('0x14')]);return _0x189d70(_0x164842[_0x0cb6('0x12')]['message']);}else{logger[_0x0cb6('0x15')](_0x0cb6('0x13'),_0x989991,_0x0cb6('0x10'));_0x189d70(_0x164842[_0x0cb6('0x16')][_0x0cb6('0x14')]);}})[_0x0cb6('0x17')](function(_0x33d860){logger['error'](_0x0cb6('0x13'),_0x989991,_0x33d860);_0x4fa4f4(_0x33d860);});});}exports['GetSalesforceAccount']=function(_0x152c95){var _0x5d9d0b=this;return new Promise(function(_0x83b9be,_0x366d1e){return db[_0x0cb6('0x18')][_0x0cb6('0x19')]({'raw':_0x152c95['options']?_0x152c95[_0x0cb6('0x1a')][_0x0cb6('0x1b')]===undefined?!![]:![]:!![],'where':_0x152c95[_0x0cb6('0x1a')]?_0x152c95[_0x0cb6('0x1a')]['where']||null:null,'attributes':_0x152c95[_0x0cb6('0x1a')]?_0x152c95[_0x0cb6('0x1a')][_0x0cb6('0x1c')]||null:null,'limit':_0x152c95['options']?_0x152c95[_0x0cb6('0x1a')]['limit']||null:null,'include':_0x152c95['options']?_0x152c95['options']['include']?_[_0x0cb6('0x1d')](_0x152c95[_0x0cb6('0x1a')][_0x0cb6('0x1e')],function(_0x5ac690){return{'model':db[_0x5ac690[_0x0cb6('0x1f')]],'as':_0x5ac690['as'],'attributes':_0x5ac690[_0x0cb6('0x1c')],'include':_0x5ac690['include']?_[_0x0cb6('0x1d')](_0x5ac690['include'],function(_0x301236){return{'model':db[_0x301236[_0x0cb6('0x1f')]],'as':_0x301236['as'],'attributes':_0x301236['attributes'],'include':_0x301236[_0x0cb6('0x1e')]?_[_0x0cb6('0x1d')](_0x301236[_0x0cb6('0x1e')],function(_0x48204a){return{'model':db[_0x48204a[_0x0cb6('0x1f')]],'as':_0x48204a['as'],'attributes':_0x48204a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cdd1c){logger['info']('GetSalesforceAccount',_0x152c95);logger[_0x0cb6('0xe')](_0x0cb6('0x20'),_0x152c95,JSON[_0x0cb6('0x11')](_0x5cdd1c));_0x83b9be(_0x5cdd1c);})['catch'](function(_0x539457){logger[_0x0cb6('0x12')](_0x0cb6('0x20'),_0x539457[_0x0cb6('0x14')],_0x152c95);_0x366d1e(_0x5d9d0b['error'](0x1f4,_0x539457[_0x0cb6('0x14')]));});});};exports['ShowSalesforceAccount']=function(_0x27fccd){var _0x32108d=this;return new Promise(function(_0x52ea80,_0x2db615){return db[_0x0cb6('0x18')][_0x0cb6('0x21')]({'raw':_0x27fccd['options']?_0x27fccd[_0x0cb6('0x1a')][_0x0cb6('0x1b')]===undefined?!![]:![]:!![],'where':_0x27fccd[_0x0cb6('0x1a')]?_0x27fccd[_0x0cb6('0x1a')][_0x0cb6('0x22')]||null:null,'attributes':_0x27fccd[_0x0cb6('0x1a')]?_0x27fccd[_0x0cb6('0x1a')]['attributes']||null:null,'include':_0x27fccd[_0x0cb6('0x1a')]?_0x27fccd[_0x0cb6('0x1a')][_0x0cb6('0x1e')]?_[_0x0cb6('0x1d')](_0x27fccd[_0x0cb6('0x1a')]['include'],function(_0x3aca34){return{'model':db[_0x3aca34[_0x0cb6('0x1f')]],'as':_0x3aca34['as'],'attributes':_0x3aca34[_0x0cb6('0x1c')],'include':_0x3aca34[_0x0cb6('0x1e')]?_[_0x0cb6('0x1d')](_0x3aca34['include'],function(_0x251a16){return{'model':db[_0x251a16[_0x0cb6('0x1f')]],'as':_0x251a16['as'],'attributes':_0x251a16[_0x0cb6('0x1c')],'include':_0x251a16[_0x0cb6('0x1e')]?_[_0x0cb6('0x1d')](_0x251a16[_0x0cb6('0x1e')],function(_0x3aae78){return{'model':db[_0x3aae78[_0x0cb6('0x1f')]],'as':_0x3aae78['as'],'attributes':_0x3aae78[_0x0cb6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0cb6('0xd')](function(_0x2dceb){logger[_0x0cb6('0x15')](_0x0cb6('0x23'),_0x27fccd);logger[_0x0cb6('0xe')](_0x0cb6('0x23'),_0x27fccd,JSON[_0x0cb6('0x11')](_0x2dceb));_0x52ea80(_0x2dceb);})[_0x0cb6('0x17')](function(_0x6bfbba){logger['error'](_0x0cb6('0x23'),_0x6bfbba[_0x0cb6('0x14')],_0x27fccd);_0x2db615(_0x32108d['error'](0x1f4,_0x6bfbba[_0x0cb6('0x14')]));});});}; \ No newline at end of file +var _0xbd8e=['result','SalesforceAccount','options','where','include','map','model','attributes','then','GetSalesforceAccount','debug','stringify','ShowSalesforceAccount','find','raw','catch','lodash','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','info','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SalesforceAccount,\x20%s,\x20%s','message'];(function(_0x4eaf72,_0x306e55){var _0x595136=function(_0x72a57b){while(--_0x72a57b){_0x4eaf72['push'](_0x4eaf72['shift']());}};_0x595136(++_0x306e55);}(_0xbd8e,0x1de));var _0xebd8=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbd8e[_0x432682];return _0x463d05;};'use strict';var _=require(_0xebd8('0x0'));var util=require('util');var moment=require(_0xebd8('0x1'));var BPromise=require(_0xebd8('0x2'));var rs=require(_0xebd8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xebd8('0x4'));var logger=require('../../config/logger')(_0xebd8('0x5'));var config=require('../../config/environment');var jayson=require(_0xebd8('0x6'));var client=jayson[_0xebd8('0x7')][_0xebd8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1995e5,_0x3cd56f,_0x4edbd7){return new BPromise(function(_0x133b58,_0x1820db){return client[_0xebd8('0x9')](_0x1995e5,_0x4edbd7)['then'](function(_0x294dcd){logger[_0xebd8('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x3cd56f,'request\x20sent');logger['debug'](_0xebd8('0xb'),_0x3cd56f,_0xebd8('0xc'),JSON['stringify'](_0x294dcd));if(_0x294dcd['error']){if(_0x294dcd[_0xebd8('0xd')][_0xebd8('0xe')]===0x1f4){logger[_0xebd8('0xd')](_0xebd8('0xf'),_0x3cd56f,_0x294dcd['error'][_0xebd8('0x10')]);return _0x1820db(_0x294dcd['error'][_0xebd8('0x10')]);}logger[_0xebd8('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x3cd56f,_0x294dcd[_0xebd8('0xd')][_0xebd8('0x10')]);return _0x133b58(_0x294dcd[_0xebd8('0xd')][_0xebd8('0x10')]);}else{logger[_0xebd8('0xa')](_0xebd8('0xf'),_0x3cd56f,_0xebd8('0xc'));_0x133b58(_0x294dcd[_0xebd8('0x11')][_0xebd8('0x10')]);}})['catch'](function(_0x2f90af){logger[_0xebd8('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x3cd56f,_0x2f90af);_0x1820db(_0x2f90af);});});}exports['GetSalesforceAccount']=function(_0x265656){var _0x55d351=this;return new Promise(function(_0x1ccf46,_0x5d993a){return db[_0xebd8('0x12')]['findAll']({'raw':_0x265656['options']?_0x265656[_0xebd8('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x265656[_0xebd8('0x13')]?_0x265656[_0xebd8('0x13')][_0xebd8('0x14')]||null:null,'attributes':_0x265656['options']?_0x265656[_0xebd8('0x13')]['attributes']||null:null,'limit':_0x265656[_0xebd8('0x13')]?_0x265656['options']['limit']||null:null,'include':_0x265656['options']?_0x265656['options'][_0xebd8('0x15')]?_[_0xebd8('0x16')](_0x265656[_0xebd8('0x13')]['include'],function(_0x405a14){return{'model':db[_0x405a14[_0xebd8('0x17')]],'as':_0x405a14['as'],'attributes':_0x405a14[_0xebd8('0x18')],'include':_0x405a14[_0xebd8('0x15')]?_[_0xebd8('0x16')](_0x405a14[_0xebd8('0x15')],function(_0x49ea27){return{'model':db[_0x49ea27[_0xebd8('0x17')]],'as':_0x49ea27['as'],'attributes':_0x49ea27['attributes'],'include':_0x49ea27[_0xebd8('0x15')]?_[_0xebd8('0x16')](_0x49ea27['include'],function(_0x5854b6){return{'model':db[_0x5854b6['model']],'as':_0x5854b6['as'],'attributes':_0x5854b6[_0xebd8('0x18')]};}):[]};}):[]};}):[]:[]})[_0xebd8('0x19')](function(_0x476526){logger[_0xebd8('0xa')](_0xebd8('0x1a'),_0x265656);logger[_0xebd8('0x1b')]('GetSalesforceAccount',_0x265656,JSON[_0xebd8('0x1c')](_0x476526));_0x1ccf46(_0x476526);})['catch'](function(_0x27f1d5){logger[_0xebd8('0xd')](_0xebd8('0x1a'),_0x27f1d5['message'],_0x265656);_0x5d993a(_0x55d351[_0xebd8('0xd')](0x1f4,_0x27f1d5[_0xebd8('0x10')]));});});};exports[_0xebd8('0x1d')]=function(_0x4d66ff){var _0x2e887e=this;return new Promise(function(_0x51e078,_0xfc0839){return db[_0xebd8('0x12')][_0xebd8('0x1e')]({'raw':_0x4d66ff['options']?_0x4d66ff[_0xebd8('0x13')][_0xebd8('0x1f')]===undefined?!![]:![]:!![],'where':_0x4d66ff[_0xebd8('0x13')]?_0x4d66ff[_0xebd8('0x13')]['where']||null:null,'attributes':_0x4d66ff[_0xebd8('0x13')]?_0x4d66ff[_0xebd8('0x13')][_0xebd8('0x18')]||null:null,'include':_0x4d66ff['options']?_0x4d66ff[_0xebd8('0x13')][_0xebd8('0x15')]?_[_0xebd8('0x16')](_0x4d66ff[_0xebd8('0x13')][_0xebd8('0x15')],function(_0x22b68b){return{'model':db[_0x22b68b[_0xebd8('0x17')]],'as':_0x22b68b['as'],'attributes':_0x22b68b['attributes'],'include':_0x22b68b[_0xebd8('0x15')]?_[_0xebd8('0x16')](_0x22b68b[_0xebd8('0x15')],function(_0x4d37a7){return{'model':db[_0x4d37a7[_0xebd8('0x17')]],'as':_0x4d37a7['as'],'attributes':_0x4d37a7['attributes'],'include':_0x4d37a7['include']?_[_0xebd8('0x16')](_0x4d37a7[_0xebd8('0x15')],function(_0x26d4a0){return{'model':db[_0x26d4a0[_0xebd8('0x17')]],'as':_0x26d4a0['as'],'attributes':_0x26d4a0[_0xebd8('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d4ded){logger['info']('ShowSalesforceAccount',_0x4d66ff);logger[_0xebd8('0x1b')](_0xebd8('0x1d'),_0x4d66ff,JSON[_0xebd8('0x1c')](_0x1d4ded));_0x51e078(_0x1d4ded);})[_0xebd8('0x20')](function(_0x4472bd){logger[_0xebd8('0xd')]('ShowSalesforceAccount',_0x4472bd[_0xebd8('0x10')],_0x4d66ff);_0xfc0839(_0x2e887e[_0xebd8('0xd')](0x1f4,_0x4472bd[_0xebd8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index c62434d..eaacc84 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 _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x0b0e,0x187));var _0xe0b0=function(_0x74895e,_0x298c35){_0x74895e=_0x74895e-0x0;var _0x40bc2a=_0x0b0e[_0x74895e];return _0x40bc2a;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +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(_0x4c0cbe,_0xfcec6f){var _0x3abd40=function(_0xd1546f){while(--_0xd1546f){_0x4c0cbe['push'](_0x4c0cbe['shift']());}};_0x3abd40(++_0xfcec6f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x35282c,_0x7eba5e){_0x35282c=_0x35282c-0x0;var _0x267b6d=_0x5f2f[_0x35282c];return _0x267b6d;};'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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 953caee..4d073e3 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 _0xc80e=['STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','exports'];(function(_0x58d533,_0x2bcda3){var _0xfb8f79=function(_0x3d67c2){while(--_0x3d67c2){_0x58d533['push'](_0x58d533['shift']());}};_0xfb8f79(++_0x2bcda3);}(_0xc80e,0x12b));var _0xec80=function(_0x32f776,_0x1bf7e6){_0x32f776=_0x32f776-0x0;var _0xa9f55=_0xc80e[_0x32f776];return _0xa9f55;};'use strict';var Sequelize=require('sequelize');module[_0xec80('0x0')]={'name':{'type':Sequelize[_0xec80('0x1')]},'description':{'type':Sequelize[_0xec80('0x1')]},'ticketType':{'type':Sequelize[_0xec80('0x2')](_0xec80('0x3'),_0xec80('0x4')),'defaultValue':_0xec80('0x3')},'moduleSearch':{'type':Sequelize[_0xec80('0x2')](_0xec80('0x5'),_0xec80('0x6'),_0xec80('0x7'),_0xec80('0x8'),_0xec80('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xec80('0x2')]('nothing',_0xec80('0x6'),_0xec80('0x7'),_0xec80('0x9')),'defaultValue':_0xec80('0x7')},'leadId':{'type':Sequelize[_0xec80('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xec80('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xec80('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xec80('0x1')]}}; \ No newline at end of file +var _0x55ad=['nothing','account','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x55ad,0x19a));var _0xd55a=function(_0x1f2c17,_0x309007){_0x1f2c17=_0x1f2c17-0x0;var _0x1c2adf=_0x55ad[_0x1f2c17];return _0x1c2adf;};'use strict';var Sequelize=require(_0xd55a('0x0'));module[_0xd55a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd55a('0x2')]},'ticketType':{'type':Sequelize[_0xd55a('0x3')](_0xd55a('0x4'),_0xd55a('0x5')),'defaultValue':_0xd55a('0x4')},'moduleSearch':{'type':Sequelize[_0xd55a('0x3')](_0xd55a('0x6'),_0xd55a('0x7'),_0xd55a('0x8'),_0xd55a('0x9'),'account'),'defaultValue':_0xd55a('0x6')},'moduleCreate':{'type':Sequelize[_0xd55a('0x3')](_0xd55a('0xa'),_0xd55a('0x7'),_0xd55a('0x8'),_0xd55a('0xb')),'defaultValue':_0xd55a('0x8')},'leadId':{'type':Sequelize[_0xd55a('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xd55a('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xd55a('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xd55a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index dd8b185..d51bdaa 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 _0x238f=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','SalesforceConfiguration','rawAttributes','type','key','keys','intersection','model','attributes','fields','query','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','SalesforceField','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x238f,0x1d4));var _0xf238=function(_0x2e7215,_0x408e54){_0x2e7215=_0x2e7215-0x0;var _0x4b99ac=_0x238f[_0x2e7215];return _0x4b99ac;};'use strict';var emlformat=require(_0xf238('0x0'));var rimraf=require(_0xf238('0x1'));var zipdir=require(_0xf238('0x2'));var jsonpatch=require(_0xf238('0x3'));var rp=require(_0xf238('0x4'));var moment=require(_0xf238('0x5'));var BPromise=require(_0xf238('0x6'));var Mustache=require(_0xf238('0x7'));var util=require(_0xf238('0x8'));var path=require(_0xf238('0x9'));var sox=require(_0xf238('0xa'));var csv=require('to-csv');var ejs=require(_0xf238('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf238('0xc'));var crypto=require(_0xf238('0xd'));var jsforce=require(_0xf238('0xe'));var deskjs=require(_0xf238('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf238('0x10'));var Papa=require('papaparse');var Redis=require(_0xf238('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf238('0x12'));var hardwareService=require(_0xf238('0x13'));var logger=require(_0xf238('0x14'))(_0xf238('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf238('0x16'))['db'];function respondWithStatusCode(_0x4be69b,_0x26f998){_0x26f998=_0x26f998||0xcc;return function(_0x2d4467){if(_0x2d4467){return _0x4be69b['sendStatus'](_0x26f998);}return _0x4be69b[_0xf238('0x17')](_0x26f998)['end']();};}function respondWithResult(_0x5a0855,_0x24ded0){_0x24ded0=_0x24ded0||0xc8;return function(_0x26500d){if(_0x26500d){return _0x5a0855['status'](_0x24ded0)['json'](_0x26500d);}};}function respondWithFilteredResult(_0x95b431,_0x34457a){return function(_0xf2074f){if(_0xf2074f){var _0x5345ac=typeof _0x34457a['offset']===_0xf238('0x18')&&typeof _0x34457a['limit']===_0xf238('0x18');var _0x5af383=_0xf2074f[_0xf238('0x19')];var _0x25da5b=_0x5345ac?0x0:_0x34457a[_0xf238('0x1a')];var _0x2671cf=_0x5345ac?_0xf2074f[_0xf238('0x19')]:_0x34457a[_0xf238('0x1a')]+_0x34457a[_0xf238('0x1b')];var _0x283a3a;if(_0x2671cf>=_0x5af383){_0x2671cf=_0x5af383;_0x283a3a=0xc8;}else{_0x283a3a=0xce;}_0x95b431['status'](_0x283a3a);return _0x95b431[_0xf238('0x1c')](_0xf238('0x1d'),_0x25da5b+'-'+_0x2671cf+'/'+_0x5af383)[_0xf238('0x1e')](_0xf2074f);}return null;};}function patchUpdates(_0x6dac02){return function(_0x87da3c){try{jsonpatch[_0xf238('0x1f')](_0x87da3c,_0x6dac02,!![]);}catch(_0x1a2848){return BPromise[_0xf238('0x20')](_0x1a2848);}return _0x87da3c[_0xf238('0x21')]();};}function saveUpdates(_0x20f116,_0x3dd04a){return function(_0x188b71){if(_0x188b71){return _0x188b71[_0xf238('0x22')](_0x20f116)[_0xf238('0x23')](function(_0x31165c){return _0x31165c;});}return null;};}function removeEntity(_0x1c074d,_0x2c2723){return function(_0x161fb8){if(_0x161fb8){return _0x161fb8[_0xf238('0x24')]()['then'](function(){_0x1c074d[_0xf238('0x17')](0xcc)[_0xf238('0x25')]();});}};}function handleEntityNotFound(_0x3b873b,_0x19a993){return function(_0x155207){if(!_0x155207){_0x3b873b[_0xf238('0x26')](0x194);}return _0x155207;};}function handleError(_0x41367b,_0x262655){_0x262655=_0x262655||0x1f4;return function(_0x5e36c0){logger[_0xf238('0x27')](_0x5e36c0['stack']);if(_0x5e36c0[_0xf238('0x28')]){delete _0x5e36c0[_0xf238('0x28')];}_0x41367b[_0xf238('0x17')](_0x262655)[_0xf238('0x29')](_0x5e36c0);};}exports[_0xf238('0x2a')]=function(_0x337e31,_0x2111f2){var _0x1f577b={},_0x927f67={},_0x27420e={'count':0x0,'rows':[]};var _0x2cf2b8=_[_0xf238('0x2b')](db[_0xf238('0x2c')][_0xf238('0x2d')],function(_0x499dd5){return{'name':_0x499dd5['fieldName'],'type':_0x499dd5[_0xf238('0x2e')][_0xf238('0x2f')]};});_0x927f67['model']=_[_0xf238('0x2b')](_0x2cf2b8,_0xf238('0x28'));_0x927f67['query']=_[_0xf238('0x30')](_0x337e31['query']);_0x927f67['filters']=_[_0xf238('0x31')](_0x927f67[_0xf238('0x32')],_0x927f67['query']);_0x1f577b[_0xf238('0x33')]=_[_0xf238('0x31')](_0x927f67[_0xf238('0x32')],qs[_0xf238('0x34')](_0x337e31[_0xf238('0x35')][_0xf238('0x34')]));_0x1f577b[_0xf238('0x33')]=_0x1f577b[_0xf238('0x33')][_0xf238('0x36')]?_0x1f577b['attributes']:_0x927f67['model'];if(!_0x337e31[_0xf238('0x35')]['hasOwnProperty'](_0xf238('0x37'))){_0x1f577b[_0xf238('0x1b')]=qs['limit'](_0x337e31[_0xf238('0x35')][_0xf238('0x1b')]);_0x1f577b[_0xf238('0x1a')]=qs[_0xf238('0x1a')](_0x337e31[_0xf238('0x35')]['offset']);}_0x1f577b[_0xf238('0x38')]=qs['sort'](_0x337e31['query'][_0xf238('0x39')]);_0x1f577b[_0xf238('0x3a')]=qs[_0xf238('0x3b')](_[_0xf238('0x3c')](_0x337e31[_0xf238('0x35')],_0x927f67[_0xf238('0x3b')]),_0x2cf2b8);if(_0x337e31[_0xf238('0x35')][_0xf238('0x3d')]){_0x1f577b[_0xf238('0x3a')]=_[_0xf238('0x3e')](_0x1f577b[_0xf238('0x3a')],{'$or':_[_0xf238('0x2b')](_0x2cf2b8,function(_0x13e182){if(_0x13e182[_0xf238('0x2e')]!==_0xf238('0x3f')){var _0x434cbd={};_0x434cbd[_0x13e182[_0xf238('0x28')]]={'$like':'%'+_0x337e31[_0xf238('0x35')][_0xf238('0x3d')]+'%'};return _0x434cbd;}})});}_0x1f577b=_[_0xf238('0x3e')]({},_0x1f577b,_0x337e31[_0xf238('0x40')]);var _0x4e89b2={'where':_0x1f577b[_0xf238('0x3a')]};return db[_0xf238('0x2c')]['count'](_0x4e89b2)[_0xf238('0x23')](function(_0x4cc82b){_0x27420e['count']=_0x4cc82b;if(_0x337e31[_0xf238('0x35')]['includeAll']){_0x1f577b[_0xf238('0x41')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xf238('0x42')](_0x1f577b);})[_0xf238('0x23')](function(_0x5b75f8){_0x27420e[_0xf238('0x43')]=_0x5b75f8;return _0x27420e;})[_0xf238('0x23')](respondWithFilteredResult(_0x2111f2,_0x1f577b))[_0xf238('0x44')](handleError(_0x2111f2,null));};exports[_0xf238('0x45')]=function(_0xc9a54d,_0x3154c7){var _0x4293bb={'raw':![],'where':{'id':_0xc9a54d[_0xf238('0x46')]['id']}},_0x2a89aa={};_0x2a89aa[_0xf238('0x32')]=_[_0xf238('0x30')](db[_0xf238('0x2c')][_0xf238('0x2d')]);_0x2a89aa[_0xf238('0x35')]=_[_0xf238('0x30')](_0xc9a54d['query']);_0x2a89aa['filters']=_['intersection'](_0x2a89aa['model'],_0x2a89aa[_0xf238('0x35')]);_0x4293bb[_0xf238('0x33')]=_[_0xf238('0x31')](_0x2a89aa[_0xf238('0x32')],qs['fields'](_0xc9a54d[_0xf238('0x35')][_0xf238('0x34')]));_0x4293bb[_0xf238('0x33')]=_0x4293bb[_0xf238('0x33')][_0xf238('0x36')]?_0x4293bb[_0xf238('0x33')]:_0x2a89aa[_0xf238('0x32')];if(_0xc9a54d[_0xf238('0x35')][_0xf238('0x47')]){_0x4293bb[_0xf238('0x41')]=[{'all':!![]}];}_0x4293bb=_['merge']({},_0x4293bb,_0xc9a54d[_0xf238('0x40')]);return db['SalesforceConfiguration'][_0xf238('0x48')](_0x4293bb)[_0xf238('0x23')](handleEntityNotFound(_0x3154c7,null))['then'](respondWithResult(_0x3154c7,null))[_0xf238('0x44')](handleError(_0x3154c7,null));};exports[_0xf238('0x49')]=function(_0x2f72b6,_0x49fb1d){return db[_0xf238('0x2c')]['create'](_0x2f72b6[_0xf238('0x4a')],{})['then'](respondWithResult(_0x49fb1d,0xc9))[_0xf238('0x44')](handleError(_0x49fb1d,null));};exports[_0xf238('0x22')]=function(_0x4f818c,_0x172824){if(_0x4f818c[_0xf238('0x4a')]['id']){delete _0x4f818c[_0xf238('0x4a')]['id'];}return db[_0xf238('0x2c')][_0xf238('0x48')]({'where':{'id':_0x4f818c[_0xf238('0x46')]['id']}})[_0xf238('0x23')](handleEntityNotFound(_0x172824,null))[_0xf238('0x23')](saveUpdates(_0x4f818c['body'],null))[_0xf238('0x23')](respondWithResult(_0x172824,null))[_0xf238('0x44')](handleError(_0x172824,null));};exports[_0xf238('0x24')]=function(_0xb39eb,_0x3e7bf9){return db[_0xf238('0x2c')][_0xf238('0x48')]({'where':{'id':_0xb39eb[_0xf238('0x46')]['id']}})[_0xf238('0x23')](handleEntityNotFound(_0x3e7bf9,null))[_0xf238('0x23')](removeEntity(_0x3e7bf9,null))[_0xf238('0x44')](handleError(_0x3e7bf9,null));};exports[_0xf238('0x4b')]=function(_0x4a87f8,_0x5969ac,_0x51415a){var _0x2f3a3f={};var _0x544cf9={};var _0x951e96;var _0x25e27f;return db['SalesforceConfiguration'][_0xf238('0x4c')]({'where':{'id':_0x4a87f8[_0xf238('0x46')]['id']}})[_0xf238('0x23')](handleEntityNotFound(_0x5969ac,null))['then'](function(_0x571b74){if(_0x571b74){_0x951e96=_0x571b74;_0x544cf9[_0xf238('0x32')]=_[_0xf238('0x30')](db['SalesforceField'][_0xf238('0x2d')]);_0x544cf9[_0xf238('0x35')]=_[_0xf238('0x30')](_0x4a87f8[_0xf238('0x35')]);_0x544cf9[_0xf238('0x3b')]=_[_0xf238('0x31')](_0x544cf9[_0xf238('0x32')],_0x544cf9[_0xf238('0x35')]);_0x2f3a3f['attributes']=_[_0xf238('0x31')](_0x544cf9[_0xf238('0x32')],qs[_0xf238('0x34')](_0x4a87f8[_0xf238('0x35')][_0xf238('0x34')]));_0x2f3a3f[_0xf238('0x33')]=_0x2f3a3f[_0xf238('0x33')][_0xf238('0x36')]?_0x2f3a3f[_0xf238('0x33')]:_0x544cf9['model'];_0x2f3a3f[_0xf238('0x38')]=qs['sort'](_0x4a87f8[_0xf238('0x35')][_0xf238('0x39')]);_0x2f3a3f[_0xf238('0x3a')]=qs['filters'](_['pick'](_0x4a87f8[_0xf238('0x35')],_0x544cf9['filters']));if(_0x4a87f8[_0xf238('0x35')][_0xf238('0x3d')]){_0x2f3a3f[_0xf238('0x3a')]=_[_0xf238('0x3e')](_0x2f3a3f[_0xf238('0x3a')],{'$or':_[_0xf238('0x2b')](_0x2f3a3f[_0xf238('0x33')],function(_0x33a4cd){var _0x232123={};_0x232123[_0x33a4cd]={'$like':'%'+_0x4a87f8[_0xf238('0x35')][_0xf238('0x3d')]+'%'};return _0x232123;})});}_0x2f3a3f=_[_0xf238('0x3e')]({},_0x2f3a3f,_0x4a87f8[_0xf238('0x40')]);return _0x951e96['getFields'](_0x2f3a3f);}})[_0xf238('0x23')](function(_0x1392e1){if(_0x1392e1){_0x25e27f=_0x1392e1['length'];if(!_0x4a87f8['query']['hasOwnProperty'](_0xf238('0x37'))){_0x2f3a3f[_0xf238('0x1b')]=qs[_0xf238('0x1b')](_0x4a87f8[_0xf238('0x35')][_0xf238('0x1b')]);_0x2f3a3f['offset']=qs[_0xf238('0x1a')](_0x4a87f8['query'][_0xf238('0x1a')]);}return _0x951e96[_0xf238('0x4b')](_0x2f3a3f);}})[_0xf238('0x23')](function(_0x3181b1){if(_0x3181b1){return _0x3181b1?{'count':_0x25e27f,'rows':_0x3181b1}:null;}})[_0xf238('0x23')](respondWithResult(_0x5969ac,null))[_0xf238('0x44')](handleError(_0x5969ac,null));};exports['getSubjects']=function(_0x2c8871,_0x5059b7,_0xeb6294){var _0x100f84={};var _0x3a824e={};var _0x22e037;var _0x5c457d;return db['SalesforceConfiguration'][_0xf238('0x4c')]({'where':{'id':_0x2c8871[_0xf238('0x46')]['id']}})['then'](handleEntityNotFound(_0x5059b7,null))['then'](function(_0x10fb5f){if(_0x10fb5f){_0x22e037=_0x10fb5f;_0x3a824e[_0xf238('0x32')]=_[_0xf238('0x30')](db[_0xf238('0x4d')]['rawAttributes']);_0x3a824e[_0xf238('0x35')]=_[_0xf238('0x30')](_0x2c8871[_0xf238('0x35')]);_0x3a824e[_0xf238('0x3b')]=_[_0xf238('0x31')](_0x3a824e['model'],_0x3a824e[_0xf238('0x35')]);_0x100f84[_0xf238('0x33')]=_[_0xf238('0x31')](_0x3a824e[_0xf238('0x32')],qs[_0xf238('0x34')](_0x2c8871['query'][_0xf238('0x34')]));_0x100f84[_0xf238('0x33')]=_0x100f84['attributes'][_0xf238('0x36')]?_0x100f84['attributes']:_0x3a824e[_0xf238('0x32')];_0x100f84['order']=qs['sort'](_0x2c8871[_0xf238('0x35')][_0xf238('0x39')]);_0x100f84[_0xf238('0x3a')]=qs[_0xf238('0x3b')](_['pick'](_0x2c8871[_0xf238('0x35')],_0x3a824e[_0xf238('0x3b')]));if(_0x2c8871[_0xf238('0x35')][_0xf238('0x3d')]){_0x100f84[_0xf238('0x3a')]=_[_0xf238('0x3e')](_0x100f84['where'],{'$or':_['map'](_0x100f84[_0xf238('0x33')],function(_0x490576){var _0x589a80={};_0x589a80[_0x490576]={'$like':'%'+_0x2c8871[_0xf238('0x35')][_0xf238('0x3d')]+'%'};return _0x589a80;})});}_0x100f84=_[_0xf238('0x3e')]({},_0x100f84,_0x2c8871['options']);return _0x22e037[_0xf238('0x4e')](_0x100f84);}})[_0xf238('0x23')](function(_0x5405a7){if(_0x5405a7){_0x5c457d=_0x5405a7['length'];if(!_0x2c8871[_0xf238('0x35')][_0xf238('0x4f')](_0xf238('0x37'))){_0x100f84[_0xf238('0x1b')]=qs['limit'](_0x2c8871[_0xf238('0x35')][_0xf238('0x1b')]);_0x100f84['offset']=qs[_0xf238('0x1a')](_0x2c8871[_0xf238('0x35')][_0xf238('0x1a')]);}return _0x22e037[_0xf238('0x4e')](_0x100f84);}})[_0xf238('0x23')](function(_0x3573d8){if(_0x3573d8){return _0x3573d8?{'count':_0x5c457d,'rows':_0x3573d8}:null;}})[_0xf238('0x23')](respondWithResult(_0x5059b7,null))['catch'](handleError(_0x5059b7,null));};exports[_0xf238('0x50')]=function(_0x1d76a0,_0x5d1d58,_0x20fc82){var _0x14ff74={};var _0x37744c={};var _0x252a72;var _0x1a2a8d;return db[_0xf238('0x2c')]['findOne']({'where':{'id':_0x1d76a0[_0xf238('0x46')]['id']}})[_0xf238('0x23')](handleEntityNotFound(_0x5d1d58,null))['then'](function(_0x265df6){if(_0x265df6){_0x252a72=_0x265df6;_0x37744c['model']=_[_0xf238('0x30')](db[_0xf238('0x4d')]['rawAttributes']);_0x37744c[_0xf238('0x35')]=_['keys'](_0x1d76a0[_0xf238('0x35')]);_0x37744c['filters']=_[_0xf238('0x31')](_0x37744c[_0xf238('0x32')],_0x37744c[_0xf238('0x35')]);_0x14ff74[_0xf238('0x33')]=_[_0xf238('0x31')](_0x37744c['model'],qs['fields'](_0x1d76a0['query'][_0xf238('0x34')]));_0x14ff74[_0xf238('0x33')]=_0x14ff74[_0xf238('0x33')][_0xf238('0x36')]?_0x14ff74[_0xf238('0x33')]:_0x37744c[_0xf238('0x32')];_0x14ff74[_0xf238('0x38')]=qs[_0xf238('0x39')](_0x1d76a0['query'][_0xf238('0x39')]);_0x14ff74[_0xf238('0x3a')]=qs[_0xf238('0x3b')](_[_0xf238('0x3c')](_0x1d76a0[_0xf238('0x35')],_0x37744c['filters']));if(_0x1d76a0['query'][_0xf238('0x3d')]){_0x14ff74[_0xf238('0x3a')]=_['merge'](_0x14ff74[_0xf238('0x3a')],{'$or':_[_0xf238('0x2b')](_0x14ff74[_0xf238('0x33')],function(_0x4dc6b0){var _0x56e16c={};_0x56e16c[_0x4dc6b0]={'$like':'%'+_0x1d76a0[_0xf238('0x35')][_0xf238('0x3d')]+'%'};return _0x56e16c;})});}_0x14ff74=_[_0xf238('0x3e')]({},_0x14ff74,_0x1d76a0[_0xf238('0x40')]);return _0x252a72[_0xf238('0x50')](_0x14ff74);}})[_0xf238('0x23')](function(_0x15eb11){if(_0x15eb11){_0x1a2a8d=_0x15eb11[_0xf238('0x36')];if(!_0x1d76a0[_0xf238('0x35')][_0xf238('0x4f')]('nolimit')){_0x14ff74[_0xf238('0x1b')]=qs['limit'](_0x1d76a0[_0xf238('0x35')][_0xf238('0x1b')]);_0x14ff74['offset']=qs['offset'](_0x1d76a0[_0xf238('0x35')][_0xf238('0x1a')]);}return _0x252a72[_0xf238('0x50')](_0x14ff74);}})[_0xf238('0x23')](function(_0x3d43ba){if(_0x3d43ba){return _0x3d43ba?{'count':_0x1a2a8d,'rows':_0x3d43ba}:null;}})[_0xf238('0x23')](respondWithResult(_0x5d1d58,null))[_0xf238('0x44')](handleError(_0x5d1d58,null));}; \ No newline at end of file +var _0x315c=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','offset','limit','undefined','count','status','Content-Range','json','apply','reject','save','destroy','then','end','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','keys','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','catch','show','params','intersection','find','create','body','update','findOne','SalesforceField','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x5831cb,_0xa5d29e){var _0xff6e3e=function(_0x7d0959){while(--_0x7d0959){_0x5831cb['push'](_0x5831cb['shift']());}};_0xff6e3e(++_0xa5d29e);}(_0x315c,0xe1));var _0xc315=function(_0x47e970,_0x56640f){_0x47e970=_0x47e970-0x0;var _0x16c5b3=_0x315c[_0x47e970];return _0x16c5b3;};'use strict';var emlformat=require(_0xc315('0x0'));var rimraf=require(_0xc315('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc315('0x2'));var rp=require('request-promise');var moment=require(_0xc315('0x3'));var BPromise=require(_0xc315('0x4'));var Mustache=require(_0xc315('0x5'));var util=require(_0xc315('0x6'));var path=require(_0xc315('0x7'));var sox=require(_0xc315('0x8'));var csv=require(_0xc315('0x9'));var ejs=require(_0xc315('0xa'));var fs=require('fs');var fs_extra=require(_0xc315('0xb'));var _=require(_0xc315('0xc'));var squel=require(_0xc315('0xd'));var crypto=require(_0xc315('0xe'));var jsforce=require(_0xc315('0xf'));var deskjs=require(_0xc315('0x10'));var toCsv=require(_0xc315('0x9'));var querystring=require('querystring');var Papa=require(_0xc315('0x11'));var Redis=require(_0xc315('0x12'));var authService=require(_0xc315('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc315('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc315('0x15'));var utils=require(_0xc315('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc315('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd1dba9,_0x4af8cb){_0x4af8cb=_0x4af8cb||0xcc;return function(_0x447c4a){if(_0x447c4a){return _0xd1dba9[_0xc315('0x18')](_0x4af8cb);}return _0xd1dba9['status'](_0x4af8cb)['end']();};}function respondWithResult(_0x5bfbe5,_0x16491c){_0x16491c=_0x16491c||0xc8;return function(_0x173cd0){if(_0x173cd0){return _0x5bfbe5['status'](_0x16491c)['json'](_0x173cd0);}};}function respondWithFilteredResult(_0x42a062,_0x40901e){return function(_0x535e81){if(_0x535e81){var _0x49cfa4=typeof _0x40901e[_0xc315('0x19')]==='undefined'&&typeof _0x40901e[_0xc315('0x1a')]===_0xc315('0x1b');var _0x1115d3=_0x535e81[_0xc315('0x1c')];var _0x4e4bdc=_0x49cfa4?0x0:_0x40901e[_0xc315('0x19')];var _0x39fa89=_0x49cfa4?_0x535e81[_0xc315('0x1c')]:_0x40901e['offset']+_0x40901e[_0xc315('0x1a')];var _0x457f59;if(_0x39fa89>=_0x1115d3){_0x39fa89=_0x1115d3;_0x457f59=0xc8;}else{_0x457f59=0xce;}_0x42a062[_0xc315('0x1d')](_0x457f59);return _0x42a062['set'](_0xc315('0x1e'),_0x4e4bdc+'-'+_0x39fa89+'/'+_0x1115d3)[_0xc315('0x1f')](_0x535e81);}return null;};}function patchUpdates(_0x36bf3b){return function(_0x2ae395){try{jsonpatch[_0xc315('0x20')](_0x2ae395,_0x36bf3b,!![]);}catch(_0x5db060){return BPromise[_0xc315('0x21')](_0x5db060);}return _0x2ae395[_0xc315('0x22')]();};}function saveUpdates(_0xf258cf,_0x285263){return function(_0x2820ab){if(_0x2820ab){return _0x2820ab['update'](_0xf258cf)['then'](function(_0x193279){return _0x193279;});}return null;};}function removeEntity(_0x30041b,_0x49ca2f){return function(_0x1752b2){if(_0x1752b2){return _0x1752b2[_0xc315('0x23')]()[_0xc315('0x24')](function(){_0x30041b['status'](0xcc)[_0xc315('0x25')]();});}};}function handleEntityNotFound(_0x418e84,_0x53dd3d){return function(_0x590540){if(!_0x590540){_0x418e84[_0xc315('0x18')](0x194);}return _0x590540;};}function handleError(_0x274264,_0x5072f2){_0x5072f2=_0x5072f2||0x1f4;return function(_0x111829){logger['error'](_0x111829[_0xc315('0x26')]);if(_0x111829['name']){delete _0x111829[_0xc315('0x27')];}_0x274264['status'](_0x5072f2)[_0xc315('0x28')](_0x111829);};}exports[_0xc315('0x29')]=function(_0x12cf9c,_0x5d23ad){var _0x59471c={},_0x594313={},_0x2d3766={'count':0x0,'rows':[]};var _0x1e975e=_[_0xc315('0x2a')](db[_0xc315('0x2b')][_0xc315('0x2c')],function(_0x5d114b){return{'name':_0x5d114b[_0xc315('0x2d')],'type':_0x5d114b[_0xc315('0x2e')]['key']};});_0x594313['model']=_[_0xc315('0x2a')](_0x1e975e,'name');_0x594313['query']=_[_0xc315('0x2f')](_0x12cf9c[_0xc315('0x30')]);_0x594313[_0xc315('0x31')]=_['intersection'](_0x594313['model'],_0x594313['query']);_0x59471c['attributes']=_['intersection'](_0x594313[_0xc315('0x32')],qs[_0xc315('0x33')](_0x12cf9c[_0xc315('0x30')][_0xc315('0x33')]));_0x59471c[_0xc315('0x34')]=_0x59471c[_0xc315('0x34')][_0xc315('0x35')]?_0x59471c[_0xc315('0x34')]:_0x594313[_0xc315('0x32')];if(!_0x12cf9c[_0xc315('0x30')][_0xc315('0x36')](_0xc315('0x37'))){_0x59471c[_0xc315('0x1a')]=qs[_0xc315('0x1a')](_0x12cf9c[_0xc315('0x30')][_0xc315('0x1a')]);_0x59471c[_0xc315('0x19')]=qs[_0xc315('0x19')](_0x12cf9c['query']['offset']);}_0x59471c[_0xc315('0x38')]=qs[_0xc315('0x39')](_0x12cf9c[_0xc315('0x30')]['sort']);_0x59471c[_0xc315('0x3a')]=qs['filters'](_['pick'](_0x12cf9c['query'],_0x594313[_0xc315('0x31')]),_0x1e975e);if(_0x12cf9c[_0xc315('0x30')][_0xc315('0x3b')]){_0x59471c[_0xc315('0x3a')]=_[_0xc315('0x3c')](_0x59471c[_0xc315('0x3a')],{'$or':_[_0xc315('0x2a')](_0x1e975e,function(_0x3c119f){if(_0x3c119f[_0xc315('0x2e')]!=='VIRTUAL'){var _0x46710e={};_0x46710e[_0x3c119f['name']]={'$like':'%'+_0x12cf9c['query'][_0xc315('0x3b')]+'%'};return _0x46710e;}})});}_0x59471c=_[_0xc315('0x3c')]({},_0x59471c,_0x12cf9c[_0xc315('0x3d')]);var _0x3e9b98={'where':_0x59471c[_0xc315('0x3a')]};return db[_0xc315('0x2b')]['count'](_0x3e9b98)['then'](function(_0x4abc57){_0x2d3766[_0xc315('0x1c')]=_0x4abc57;if(_0x12cf9c[_0xc315('0x30')][_0xc315('0x3e')]){_0x59471c[_0xc315('0x3f')]=[{'all':!![]}];}return db[_0xc315('0x2b')]['findAll'](_0x59471c);})['then'](function(_0x57da38){_0x2d3766['rows']=_0x57da38;return _0x2d3766;})[_0xc315('0x24')](respondWithFilteredResult(_0x5d23ad,_0x59471c))[_0xc315('0x40')](handleError(_0x5d23ad,null));};exports[_0xc315('0x41')]=function(_0x5a5e06,_0x112937){var _0x368a0e={'raw':![],'where':{'id':_0x5a5e06[_0xc315('0x42')]['id']}},_0x4825ac={};_0x4825ac[_0xc315('0x32')]=_[_0xc315('0x2f')](db['SalesforceConfiguration'][_0xc315('0x2c')]);_0x4825ac[_0xc315('0x30')]=_[_0xc315('0x2f')](_0x5a5e06[_0xc315('0x30')]);_0x4825ac[_0xc315('0x31')]=_['intersection'](_0x4825ac[_0xc315('0x32')],_0x4825ac[_0xc315('0x30')]);_0x368a0e[_0xc315('0x34')]=_[_0xc315('0x43')](_0x4825ac[_0xc315('0x32')],qs[_0xc315('0x33')](_0x5a5e06[_0xc315('0x30')]['fields']));_0x368a0e[_0xc315('0x34')]=_0x368a0e[_0xc315('0x34')][_0xc315('0x35')]?_0x368a0e[_0xc315('0x34')]:_0x4825ac[_0xc315('0x32')];if(_0x5a5e06[_0xc315('0x30')][_0xc315('0x3e')]){_0x368a0e[_0xc315('0x3f')]=[{'all':!![]}];}_0x368a0e=_[_0xc315('0x3c')]({},_0x368a0e,_0x5a5e06[_0xc315('0x3d')]);return db[_0xc315('0x2b')][_0xc315('0x44')](_0x368a0e)[_0xc315('0x24')](handleEntityNotFound(_0x112937,null))['then'](respondWithResult(_0x112937,null))[_0xc315('0x40')](handleError(_0x112937,null));};exports[_0xc315('0x45')]=function(_0x4fff18,_0xa8424d){return db['SalesforceConfiguration'][_0xc315('0x45')](_0x4fff18[_0xc315('0x46')],{})[_0xc315('0x24')](respondWithResult(_0xa8424d,0xc9))[_0xc315('0x40')](handleError(_0xa8424d,null));};exports[_0xc315('0x47')]=function(_0x2df45d,_0x37a849){if(_0x2df45d[_0xc315('0x46')]['id']){delete _0x2df45d[_0xc315('0x46')]['id'];}return db[_0xc315('0x2b')][_0xc315('0x44')]({'where':{'id':_0x2df45d[_0xc315('0x42')]['id']}})[_0xc315('0x24')](handleEntityNotFound(_0x37a849,null))[_0xc315('0x24')](saveUpdates(_0x2df45d['body'],null))[_0xc315('0x24')](respondWithResult(_0x37a849,null))[_0xc315('0x40')](handleError(_0x37a849,null));};exports['destroy']=function(_0x10a235,_0x69d0c2){return db[_0xc315('0x2b')][_0xc315('0x44')]({'where':{'id':_0x10a235[_0xc315('0x42')]['id']}})[_0xc315('0x24')](handleEntityNotFound(_0x69d0c2,null))[_0xc315('0x24')](removeEntity(_0x69d0c2,null))[_0xc315('0x40')](handleError(_0x69d0c2,null));};exports['getFields']=function(_0x25c66c,_0x4cd59d,_0x380c60){var _0x145cae={};var _0x3763a3={};var _0x5730bd;var _0x5518f2;return db['SalesforceConfiguration'][_0xc315('0x48')]({'where':{'id':_0x25c66c[_0xc315('0x42')]['id']}})['then'](handleEntityNotFound(_0x4cd59d,null))[_0xc315('0x24')](function(_0x16fd4b){if(_0x16fd4b){_0x5730bd=_0x16fd4b;_0x3763a3['model']=_[_0xc315('0x2f')](db[_0xc315('0x49')]['rawAttributes']);_0x3763a3[_0xc315('0x30')]=_[_0xc315('0x2f')](_0x25c66c[_0xc315('0x30')]);_0x3763a3[_0xc315('0x31')]=_['intersection'](_0x3763a3[_0xc315('0x32')],_0x3763a3[_0xc315('0x30')]);_0x145cae[_0xc315('0x34')]=_[_0xc315('0x43')](_0x3763a3['model'],qs[_0xc315('0x33')](_0x25c66c[_0xc315('0x30')][_0xc315('0x33')]));_0x145cae[_0xc315('0x34')]=_0x145cae[_0xc315('0x34')][_0xc315('0x35')]?_0x145cae[_0xc315('0x34')]:_0x3763a3['model'];_0x145cae[_0xc315('0x38')]=qs[_0xc315('0x39')](_0x25c66c['query'][_0xc315('0x39')]);_0x145cae[_0xc315('0x3a')]=qs[_0xc315('0x31')](_[_0xc315('0x4a')](_0x25c66c['query'],_0x3763a3[_0xc315('0x31')]));if(_0x25c66c['query'][_0xc315('0x3b')]){_0x145cae[_0xc315('0x3a')]=_['merge'](_0x145cae[_0xc315('0x3a')],{'$or':_[_0xc315('0x2a')](_0x145cae['attributes'],function(_0x4a860f){var _0x1a88ae={};_0x1a88ae[_0x4a860f]={'$like':'%'+_0x25c66c[_0xc315('0x30')][_0xc315('0x3b')]+'%'};return _0x1a88ae;})});}_0x145cae=_[_0xc315('0x3c')]({},_0x145cae,_0x25c66c[_0xc315('0x3d')]);return _0x5730bd['getFields'](_0x145cae);}})[_0xc315('0x24')](function(_0x2a84c2){if(_0x2a84c2){_0x5518f2=_0x2a84c2[_0xc315('0x35')];if(!_0x25c66c[_0xc315('0x30')][_0xc315('0x36')](_0xc315('0x37'))){_0x145cae[_0xc315('0x1a')]=qs[_0xc315('0x1a')](_0x25c66c[_0xc315('0x30')][_0xc315('0x1a')]);_0x145cae[_0xc315('0x19')]=qs['offset'](_0x25c66c[_0xc315('0x30')][_0xc315('0x19')]);}return _0x5730bd[_0xc315('0x4b')](_0x145cae);}})[_0xc315('0x24')](function(_0xafbba){if(_0xafbba){return _0xafbba?{'count':_0x5518f2,'rows':_0xafbba}:null;}})['then'](respondWithResult(_0x4cd59d,null))['catch'](handleError(_0x4cd59d,null));};exports[_0xc315('0x4c')]=function(_0x4c3532,_0x3a21f8,_0x1bd5c4){var _0x350c9f={};var _0x189c53={};var _0x10c9a3;var _0x5c2640;return db[_0xc315('0x2b')][_0xc315('0x48')]({'where':{'id':_0x4c3532[_0xc315('0x42')]['id']}})[_0xc315('0x24')](handleEntityNotFound(_0x3a21f8,null))[_0xc315('0x24')](function(_0x3276a9){if(_0x3276a9){_0x10c9a3=_0x3276a9;_0x189c53[_0xc315('0x32')]=_[_0xc315('0x2f')](db[_0xc315('0x49')]['rawAttributes']);_0x189c53[_0xc315('0x30')]=_[_0xc315('0x2f')](_0x4c3532[_0xc315('0x30')]);_0x189c53['filters']=_['intersection'](_0x189c53['model'],_0x189c53[_0xc315('0x30')]);_0x350c9f[_0xc315('0x34')]=_[_0xc315('0x43')](_0x189c53[_0xc315('0x32')],qs['fields'](_0x4c3532[_0xc315('0x30')][_0xc315('0x33')]));_0x350c9f['attributes']=_0x350c9f[_0xc315('0x34')]['length']?_0x350c9f['attributes']:_0x189c53[_0xc315('0x32')];_0x350c9f['order']=qs['sort'](_0x4c3532[_0xc315('0x30')]['sort']);_0x350c9f[_0xc315('0x3a')]=qs[_0xc315('0x31')](_['pick'](_0x4c3532[_0xc315('0x30')],_0x189c53[_0xc315('0x31')]));if(_0x4c3532['query'][_0xc315('0x3b')]){_0x350c9f[_0xc315('0x3a')]=_[_0xc315('0x3c')](_0x350c9f['where'],{'$or':_[_0xc315('0x2a')](_0x350c9f['attributes'],function(_0x469104){var _0x2ca5c3={};_0x2ca5c3[_0x469104]={'$like':'%'+_0x4c3532['query']['filter']+'%'};return _0x2ca5c3;})});}_0x350c9f=_[_0xc315('0x3c')]({},_0x350c9f,_0x4c3532[_0xc315('0x3d')]);return _0x10c9a3['getSubjects'](_0x350c9f);}})[_0xc315('0x24')](function(_0x12c1fb){if(_0x12c1fb){_0x5c2640=_0x12c1fb['length'];if(!_0x4c3532[_0xc315('0x30')][_0xc315('0x36')](_0xc315('0x37'))){_0x350c9f[_0xc315('0x1a')]=qs[_0xc315('0x1a')](_0x4c3532[_0xc315('0x30')][_0xc315('0x1a')]);_0x350c9f['offset']=qs[_0xc315('0x19')](_0x4c3532[_0xc315('0x30')][_0xc315('0x19')]);}return _0x10c9a3[_0xc315('0x4c')](_0x350c9f);}})[_0xc315('0x24')](function(_0x4c8e00){if(_0x4c8e00){return _0x4c8e00?{'count':_0x5c2640,'rows':_0x4c8e00}:null;}})['then'](respondWithResult(_0x3a21f8,null))[_0xc315('0x40')](handleError(_0x3a21f8,null));};exports[_0xc315('0x4d')]=function(_0x524ce6,_0x30966e,_0x50bf32){var _0x3e7d14={};var _0x2a187b={};var _0x52430e;var _0x21a406;return db[_0xc315('0x2b')][_0xc315('0x48')]({'where':{'id':_0x524ce6[_0xc315('0x42')]['id']}})[_0xc315('0x24')](handleEntityNotFound(_0x30966e,null))[_0xc315('0x24')](function(_0x5d5572){if(_0x5d5572){_0x52430e=_0x5d5572;_0x2a187b[_0xc315('0x32')]=_[_0xc315('0x2f')](db[_0xc315('0x49')][_0xc315('0x2c')]);_0x2a187b[_0xc315('0x30')]=_[_0xc315('0x2f')](_0x524ce6[_0xc315('0x30')]);_0x2a187b[_0xc315('0x31')]=_[_0xc315('0x43')](_0x2a187b['model'],_0x2a187b[_0xc315('0x30')]);_0x3e7d14[_0xc315('0x34')]=_['intersection'](_0x2a187b[_0xc315('0x32')],qs[_0xc315('0x33')](_0x524ce6[_0xc315('0x30')][_0xc315('0x33')]));_0x3e7d14[_0xc315('0x34')]=_0x3e7d14[_0xc315('0x34')]['length']?_0x3e7d14[_0xc315('0x34')]:_0x2a187b['model'];_0x3e7d14[_0xc315('0x38')]=qs[_0xc315('0x39')](_0x524ce6['query'][_0xc315('0x39')]);_0x3e7d14[_0xc315('0x3a')]=qs[_0xc315('0x31')](_[_0xc315('0x4a')](_0x524ce6['query'],_0x2a187b[_0xc315('0x31')]));if(_0x524ce6['query'][_0xc315('0x3b')]){_0x3e7d14['where']=_[_0xc315('0x3c')](_0x3e7d14[_0xc315('0x3a')],{'$or':_['map'](_0x3e7d14[_0xc315('0x34')],function(_0x5ae402){var _0x100179={};_0x100179[_0x5ae402]={'$like':'%'+_0x524ce6[_0xc315('0x30')][_0xc315('0x3b')]+'%'};return _0x100179;})});}_0x3e7d14=_[_0xc315('0x3c')]({},_0x3e7d14,_0x524ce6[_0xc315('0x3d')]);return _0x52430e[_0xc315('0x4d')](_0x3e7d14);}})[_0xc315('0x24')](function(_0x12bf86){if(_0x12bf86){_0x21a406=_0x12bf86[_0xc315('0x35')];if(!_0x524ce6[_0xc315('0x30')][_0xc315('0x36')](_0xc315('0x37'))){_0x3e7d14['limit']=qs[_0xc315('0x1a')](_0x524ce6[_0xc315('0x30')]['limit']);_0x3e7d14[_0xc315('0x19')]=qs[_0xc315('0x19')](_0x524ce6[_0xc315('0x30')][_0xc315('0x19')]);}return _0x52430e[_0xc315('0x4d')](_0x3e7d14);}})['then'](function(_0x4683bd){if(_0x4683bd){return _0x4683bd?{'count':_0x21a406,'rows':_0x4683bd}:null;}})[_0xc315('0x24')](respondWithResult(_0x30966e,null))['catch'](handleError(_0x30966e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index c1b2136..6ca8985 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 _0xb6cc=['request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x257841,_0x389b4d){var _0x1b87ed=function(_0xceb19e){while(--_0xceb19e){_0x257841['push'](_0x257841['shift']());}};_0x1b87ed(++_0x389b4d);}(_0xb6cc,0x117));var _0xcb6c=function(_0x47e596,_0x1e0e4c){_0x47e596=_0x47e596-0x0;var _0x32322e=_0xb6cc[_0x47e596];return _0x32322e;};'use strict';var _=require(_0xcb6c('0x0'));var util=require(_0xcb6c('0x1'));var logger=require(_0xcb6c('0x2'))(_0xcb6c('0x3'));var moment=require(_0xcb6c('0x4'));var BPromise=require(_0xcb6c('0x5'));var rp=require(_0xcb6c('0x6'));var fs=require('fs');var path=require(_0xcb6c('0x7'));var rimraf=require(_0xcb6c('0x8'));var config=require(_0xcb6c('0x9'));var attributes=require(_0xcb6c('0xa'));module[_0xcb6c('0xb')]=function(_0x1ec69d,_0x3df7d8){return _0x1ec69d[_0xcb6c('0xc')](_0xcb6c('0xd'),attributes,{'tableName':_0xcb6c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6df9=['int_salesforce_configurations','lodash','util','../../config/logger','moment','request-promise','../../config/environment','./intSalesforceConfiguration.attributes','exports','define'];(function(_0x3f6e26,_0x811a34){var _0x474345=function(_0x4a0cbe){while(--_0x4a0cbe){_0x3f6e26['push'](_0x3f6e26['shift']());}};_0x474345(++_0x811a34);}(_0x6df9,0x1e1));var _0x96df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6df9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x96df('0x0'));var util=require(_0x96df('0x1'));var logger=require(_0x96df('0x2'))('api');var moment=require(_0x96df('0x3'));var BPromise=require('bluebird');var rp=require(_0x96df('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x96df('0x5'));var attributes=require(_0x96df('0x6'));module[_0x96df('0x7')]=function(_0x338736,_0x3d645d){return _0x338736[_0x96df('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0x96df('0x9'),'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 7d95d09..a758476 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 _0xe778=['client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment'];(function(_0xc4a86a,_0x219afb){var _0x25dd10=function(_0x4a0087){while(--_0x4a0087){_0xc4a86a['push'](_0xc4a86a['shift']());}};_0x25dd10(++_0x219afb);}(_0xe778,0x188));var _0x8e77=function(_0x33c636,_0x8320ea){_0x33c636=_0x33c636-0x0;var _0x575ffd=_0xe778[_0x33c636];return _0x575ffd;};'use strict';var _=require(_0x8e77('0x0'));var util=require(_0x8e77('0x1'));var moment=require(_0x8e77('0x2'));var BPromise=require(_0x8e77('0x3'));var rs=require(_0x8e77('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8e77('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8e77('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8e77('0x7')][_0x8e77('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e553e,_0x5391e2,_0x2b451d){return new BPromise(function(_0x1e840b,_0x539029){return client[_0x8e77('0x9')](_0x4e553e,_0x2b451d)[_0x8e77('0xa')](function(_0xb512ad){logger[_0x8e77('0xb')](_0x8e77('0xc'),_0x5391e2,_0x8e77('0xd'));logger[_0x8e77('0xe')](_0x8e77('0xf'),_0x5391e2,_0x8e77('0xd'),JSON[_0x8e77('0x10')](_0xb512ad));if(_0xb512ad['error']){if(_0xb512ad[_0x8e77('0x11')][_0x8e77('0x12')]===0x1f4){logger['error'](_0x8e77('0xc'),_0x5391e2,_0xb512ad[_0x8e77('0x11')][_0x8e77('0x13')]);return _0x539029(_0xb512ad[_0x8e77('0x11')][_0x8e77('0x13')]);}logger[_0x8e77('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5391e2,_0xb512ad[_0x8e77('0x11')][_0x8e77('0x13')]);return _0x1e840b(_0xb512ad['error'][_0x8e77('0x13')]);}else{logger['info'](_0x8e77('0xc'),_0x5391e2,'request\x20sent');_0x1e840b(_0xb512ad['result'][_0x8e77('0x13')]);}})[_0x8e77('0x14')](function(_0x551e4b){logger['error'](_0x8e77('0xc'),_0x5391e2,_0x551e4b);_0x539029(_0x551e4b);});});} \ No newline at end of file +var _0xc6e3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x3226f4,_0x1bd77d){var _0x3d850f=function(_0xb51fa8){while(--_0xb51fa8){_0x3226f4['push'](_0x3226f4['shift']());}};_0x3d850f(++_0x1bd77d);}(_0xc6e3,0xbb));var _0x3c6e=function(_0x3b1b93,_0x5cfce0){_0x3b1b93=_0x3b1b93-0x0;var _0x5d8fb9=_0xc6e3[_0x3b1b93];return _0x5d8fb9;};'use strict';var _=require('lodash');var util=require(_0x3c6e('0x0'));var moment=require(_0x3c6e('0x1'));var BPromise=require(_0x3c6e('0x2'));var rs=require(_0x3c6e('0x3'));var fs=require('fs');var Redis=require(_0x3c6e('0x4'));var db=require(_0x3c6e('0x5'))['db'];var utils=require(_0x3c6e('0x6'));var logger=require(_0x3c6e('0x7'))(_0x3c6e('0x8'));var config=require(_0x3c6e('0x9'));var jayson=require(_0x3c6e('0xa'));var client=jayson['client'][_0x3c6e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bfaac,_0x49b097,_0x2f822f){return new BPromise(function(_0x3adbdb,_0x1d62c1){return client[_0x3c6e('0xc')](_0x1bfaac,_0x2f822f)[_0x3c6e('0xd')](function(_0x29aa31){logger[_0x3c6e('0xe')](_0x3c6e('0xf'),_0x49b097,_0x3c6e('0x10'));logger[_0x3c6e('0x11')](_0x3c6e('0x12'),_0x49b097,_0x3c6e('0x10'),JSON[_0x3c6e('0x13')](_0x29aa31));if(_0x29aa31[_0x3c6e('0x14')]){if(_0x29aa31[_0x3c6e('0x14')][_0x3c6e('0x15')]===0x1f4){logger[_0x3c6e('0x14')](_0x3c6e('0xf'),_0x49b097,_0x29aa31[_0x3c6e('0x14')]['message']);return _0x1d62c1(_0x29aa31[_0x3c6e('0x14')][_0x3c6e('0x16')]);}logger[_0x3c6e('0x14')](_0x3c6e('0xf'),_0x49b097,_0x29aa31[_0x3c6e('0x14')][_0x3c6e('0x16')]);return _0x3adbdb(_0x29aa31[_0x3c6e('0x14')]['message']);}else{logger[_0x3c6e('0xe')](_0x3c6e('0xf'),_0x49b097,'request\x20sent');_0x3adbdb(_0x29aa31[_0x3c6e('0x17')]['message']);}})['catch'](function(_0x4d561a){logger['error'](_0x3c6e('0xf'),_0x49b097,_0x4d561a);_0x1d62c1(_0x4d561a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 089ae1a..fdc6106 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 _0x2282=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index','isAuthenticated','show','put','update'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x2282,0x7c));var _0x2228=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0x2282[_0x21de89];return _0x290b7e;};'use strict';var multer=require(_0x2228('0x0'));var util=require(_0x2228('0x1'));var path=require(_0x2228('0x2'));var timeout=require(_0x2228('0x3'));var express=require(_0x2228('0x4'));var router=express['Router']();var fs_extra=require(_0x2228('0x5'));var auth=require(_0x2228('0x6'));var interaction=require(_0x2228('0x7'));var config=require(_0x2228('0x8'));var controller=require(_0x2228('0x9'));router[_0x2228('0xa')]('/',auth['isAuthenticated'](),controller[_0x2228('0xb')]);router['get']('/:id',auth[_0x2228('0xc')](),controller[_0x2228('0xd')]);router['post']('/',auth[_0x2228('0xc')](),controller['create']);router[_0x2228('0xe')]('/:id',auth[_0x2228('0xc')](),controller[_0x2228('0xf')]);router[_0x2228('0x10')](_0x2228('0x11'),auth[_0x2228('0xc')](),controller[_0x2228('0x12')]);module[_0x2228('0x13')]=router; \ No newline at end of file +var _0x0e94=['show','post','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','../../config/environment','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x1a027c,_0x118ef2){var _0x9d4825=function(_0x389be1){while(--_0x389be1){_0x1a027c['push'](_0x1a027c['shift']());}};_0x9d4825(++_0x118ef2);}(_0x0e94,0x8e));var _0x40e9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0e94[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x40e9('0x0'));var util=require(_0x40e9('0x1'));var path=require('path');var timeout=require(_0x40e9('0x2'));var express=require(_0x40e9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x40e9('0x4'));var controller=require(_0x40e9('0x5'));router[_0x40e9('0x6')]('/',auth[_0x40e9('0x7')](),controller['index']);router[_0x40e9('0x6')]('/:id',auth[_0x40e9('0x7')](),controller[_0x40e9('0x8')]);router[_0x40e9('0x9')]('/',auth[_0x40e9('0x7')](),controller['create']);router[_0x40e9('0xa')](_0x40e9('0xb'),auth[_0x40e9('0x7')](),controller[_0x40e9('0xc')]);router[_0x40e9('0xd')]('/:id',auth[_0x40e9('0x7')](),controller[_0x40e9('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index ec6f74e..d347df4 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 _0xb225=['STRING','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb225,0x171));var _0x5b22=function(_0x558e45,_0x4f5e4f){_0x558e45=_0x558e45-0x0;var _0x3e9075=_0xb225[_0x558e45];return _0x3e9075;};'use strict';var Sequelize=require(_0x5b22('0x0'));module['exports']={'type':{'type':Sequelize[_0x5b22('0x1')](_0x5b22('0x2'),_0x5b22('0x3'),_0x5b22('0x4'),_0x5b22('0x5'),_0x5b22('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5b22('0x7')]},'keyType':{'type':Sequelize[_0x5b22('0x1')](_0x5b22('0x2'),'variable',_0x5b22('0x4'))},'keyContent':{'type':Sequelize[_0x5b22('0x7')]},'idField':{'type':Sequelize[_0x5b22('0x7')]},'variableName':{'type':Sequelize[_0x5b22('0x7')]}}; \ No newline at end of file +var _0x3b48=['keyValue','picklist','string','STRING','ENUM','sequelize','exports','variable','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b48,0x95));var _0x83b4=function(_0x794b0f,_0x194dcf){_0x794b0f=_0x794b0f-0x0;var _0x232124=_0x3b48[_0x794b0f];return _0x232124;};'use strict';var Sequelize=require(_0x83b4('0x0'));module[_0x83b4('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x83b4('0x2'),_0x83b4('0x3'),_0x83b4('0x4'),_0x83b4('0x5')),'defaultValue':_0x83b4('0x6')},'content':{'type':Sequelize[_0x83b4('0x7')]},'key':{'type':Sequelize[_0x83b4('0x7')]},'keyType':{'type':Sequelize[_0x83b4('0x8')](_0x83b4('0x6'),_0x83b4('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x83b4('0x7')]},'idField':{'type':Sequelize[_0x83b4('0x7')]},'variableName':{'type':Sequelize[_0x83b4('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 21f8109..854c521 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 _0xa521=['count','set','Content-Range','save','update','then','destroy','sendStatus','name','send','map','SalesforceField','rawAttributes','type','key','model','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','fields','length','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit'];(function(_0x5254b2,_0x2dded5){var _0x4dbe0a=function(_0x3ac653){while(--_0x3ac653){_0x5254b2['push'](_0x5254b2['shift']());}};_0x4dbe0a(++_0x2dded5);}(_0xa521,0x13d));var _0x1a52=function(_0x2b6b62,_0x20573d){_0x2b6b62=_0x2b6b62-0x0;var _0x352258=_0xa521[_0x2b6b62];return _0x352258;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a52('0x0'));var zipdir=require(_0x1a52('0x1'));var jsonpatch=require(_0x1a52('0x2'));var rp=require(_0x1a52('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1a52('0x4'));var util=require('util');var path=require(_0x1a52('0x5'));var sox=require(_0x1a52('0x6'));var csv=require(_0x1a52('0x7'));var ejs=require(_0x1a52('0x8'));var fs=require('fs');var fs_extra=require(_0x1a52('0x9'));var _=require(_0x1a52('0xa'));var squel=require(_0x1a52('0xb'));var crypto=require(_0x1a52('0xc'));var jsforce=require(_0x1a52('0xd'));var deskjs=require(_0x1a52('0xe'));var toCsv=require(_0x1a52('0x7'));var querystring=require('querystring');var Papa=require(_0x1a52('0xf'));var Redis=require(_0x1a52('0x10'));var authService=require(_0x1a52('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1a52('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a52('0x13'))('api');var utils=require(_0x1a52('0x14'));var config=require(_0x1a52('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a52('0x16'))['db'];function respondWithStatusCode(_0x1637fc,_0x366cdc){_0x366cdc=_0x366cdc||0xcc;return function(_0x15bdf3){if(_0x15bdf3){return _0x1637fc['sendStatus'](_0x366cdc);}return _0x1637fc[_0x1a52('0x17')](_0x366cdc)[_0x1a52('0x18')]();};}function respondWithResult(_0x32fe15,_0x5b55ce){_0x5b55ce=_0x5b55ce||0xc8;return function(_0x24f5da){if(_0x24f5da){return _0x32fe15['status'](_0x5b55ce)[_0x1a52('0x19')](_0x24f5da);}};}function respondWithFilteredResult(_0x1fc4fa,_0x6457e3){return function(_0x3a8205){if(_0x3a8205){var _0xf680e9=typeof _0x6457e3[_0x1a52('0x1a')]==='undefined'&&typeof _0x6457e3[_0x1a52('0x1b')]==='undefined';var _0x106a56=_0x3a8205['count'];var _0x598f77=_0xf680e9?0x0:_0x6457e3['offset'];var _0x51b36d=_0xf680e9?_0x3a8205[_0x1a52('0x1c')]:_0x6457e3[_0x1a52('0x1a')]+_0x6457e3[_0x1a52('0x1b')];var _0x333adf;if(_0x51b36d>=_0x106a56){_0x51b36d=_0x106a56;_0x333adf=0xc8;}else{_0x333adf=0xce;}_0x1fc4fa[_0x1a52('0x17')](_0x333adf);return _0x1fc4fa[_0x1a52('0x1d')](_0x1a52('0x1e'),_0x598f77+'-'+_0x51b36d+'/'+_0x106a56)[_0x1a52('0x19')](_0x3a8205);}return null;};}function patchUpdates(_0x152d8c){return function(_0x3a7137){try{jsonpatch['apply'](_0x3a7137,_0x152d8c,!![]);}catch(_0x5bae44){return BPromise['reject'](_0x5bae44);}return _0x3a7137[_0x1a52('0x1f')]();};}function saveUpdates(_0x452521,_0x5e11bb){return function(_0x4ffd9d){if(_0x4ffd9d){return _0x4ffd9d[_0x1a52('0x20')](_0x452521)[_0x1a52('0x21')](function(_0x3c8911){return _0x3c8911;});}return null;};}function removeEntity(_0x3c814a,_0x53a453){return function(_0xde5610){if(_0xde5610){return _0xde5610[_0x1a52('0x22')]()['then'](function(){_0x3c814a[_0x1a52('0x17')](0xcc)[_0x1a52('0x18')]();});}};}function handleEntityNotFound(_0x3eeded,_0x490ee9){return function(_0x2bd63a){if(!_0x2bd63a){_0x3eeded[_0x1a52('0x23')](0x194);}return _0x2bd63a;};}function handleError(_0x561df6,_0x17fe93){_0x17fe93=_0x17fe93||0x1f4;return function(_0xfb15ee){logger['error'](_0xfb15ee['stack']);if(_0xfb15ee[_0x1a52('0x24')]){delete _0xfb15ee[_0x1a52('0x24')];}_0x561df6[_0x1a52('0x17')](_0x17fe93)[_0x1a52('0x25')](_0xfb15ee);};}exports['index']=function(_0x1b7c32,_0x1a8738){var _0x19017c={},_0x58fb1e={},_0xe089b7={'count':0x0,'rows':[]};var _0x42c560=_[_0x1a52('0x26')](db[_0x1a52('0x27')][_0x1a52('0x28')],function(_0x3b129f){return{'name':_0x3b129f['fieldName'],'type':_0x3b129f[_0x1a52('0x29')][_0x1a52('0x2a')]};});_0x58fb1e[_0x1a52('0x2b')]=_[_0x1a52('0x26')](_0x42c560,_0x1a52('0x24'));_0x58fb1e[_0x1a52('0x2c')]=_['keys'](_0x1b7c32[_0x1a52('0x2c')]);_0x58fb1e['filters']=_[_0x1a52('0x2d')](_0x58fb1e[_0x1a52('0x2b')],_0x58fb1e['query']);_0x19017c[_0x1a52('0x2e')]=_[_0x1a52('0x2d')](_0x58fb1e['model'],qs['fields'](_0x1b7c32[_0x1a52('0x2c')]['fields']));_0x19017c[_0x1a52('0x2e')]=_0x19017c[_0x1a52('0x2e')]['length']?_0x19017c[_0x1a52('0x2e')]:_0x58fb1e[_0x1a52('0x2b')];if(!_0x1b7c32['query'][_0x1a52('0x2f')](_0x1a52('0x30'))){_0x19017c[_0x1a52('0x1b')]=qs['limit'](_0x1b7c32[_0x1a52('0x2c')][_0x1a52('0x1b')]);_0x19017c[_0x1a52('0x1a')]=qs[_0x1a52('0x1a')](_0x1b7c32[_0x1a52('0x2c')]['offset']);}_0x19017c[_0x1a52('0x31')]=qs[_0x1a52('0x32')](_0x1b7c32[_0x1a52('0x2c')][_0x1a52('0x32')]);_0x19017c[_0x1a52('0x33')]=qs[_0x1a52('0x34')](_['pick'](_0x1b7c32[_0x1a52('0x2c')],_0x58fb1e[_0x1a52('0x34')]),_0x42c560);if(_0x1b7c32['query'][_0x1a52('0x35')]){_0x19017c[_0x1a52('0x33')]=_[_0x1a52('0x36')](_0x19017c[_0x1a52('0x33')],{'$or':_[_0x1a52('0x26')](_0x42c560,function(_0x29f4d1){if(_0x29f4d1[_0x1a52('0x29')]!=='VIRTUAL'){var _0xfb6e3={};_0xfb6e3[_0x29f4d1[_0x1a52('0x24')]]={'$like':'%'+_0x1b7c32[_0x1a52('0x2c')][_0x1a52('0x35')]+'%'};return _0xfb6e3;}})});}_0x19017c=_[_0x1a52('0x36')]({},_0x19017c,_0x1b7c32[_0x1a52('0x37')]);var _0x1dcdc0={'where':_0x19017c[_0x1a52('0x33')]};return db['SalesforceField'][_0x1a52('0x1c')](_0x1dcdc0)[_0x1a52('0x21')](function(_0x2ee168){_0xe089b7[_0x1a52('0x1c')]=_0x2ee168;if(_0x1b7c32['query'][_0x1a52('0x38')]){_0x19017c['include']=[{'all':!![]}];}return db[_0x1a52('0x27')][_0x1a52('0x39')](_0x19017c);})['then'](function(_0x928fe2){_0xe089b7[_0x1a52('0x3a')]=_0x928fe2;return _0xe089b7;})[_0x1a52('0x21')](respondWithFilteredResult(_0x1a8738,_0x19017c))[_0x1a52('0x3b')](handleError(_0x1a8738,null));};exports[_0x1a52('0x3c')]=function(_0x340128,_0x518504){var _0x22da24={'raw':!![],'where':{'id':_0x340128[_0x1a52('0x3d')]['id']}},_0x25fac8={};_0x25fac8[_0x1a52('0x2b')]=_[_0x1a52('0x3e')](db['SalesforceField'][_0x1a52('0x28')]);_0x25fac8[_0x1a52('0x2c')]=_[_0x1a52('0x3e')](_0x340128[_0x1a52('0x2c')]);_0x25fac8[_0x1a52('0x34')]=_[_0x1a52('0x2d')](_0x25fac8[_0x1a52('0x2b')],_0x25fac8[_0x1a52('0x2c')]);_0x22da24['attributes']=_[_0x1a52('0x2d')](_0x25fac8[_0x1a52('0x2b')],qs[_0x1a52('0x3f')](_0x340128[_0x1a52('0x2c')]['fields']));_0x22da24[_0x1a52('0x2e')]=_0x22da24[_0x1a52('0x2e')][_0x1a52('0x40')]?_0x22da24[_0x1a52('0x2e')]:_0x25fac8[_0x1a52('0x2b')];if(_0x340128['query'][_0x1a52('0x38')]){_0x22da24[_0x1a52('0x41')]=[{'all':!![]}];}_0x22da24=_[_0x1a52('0x36')]({},_0x22da24,_0x340128['options']);return db['SalesforceField'][_0x1a52('0x42')](_0x22da24)[_0x1a52('0x21')](handleEntityNotFound(_0x518504,null))[_0x1a52('0x21')](respondWithResult(_0x518504,null))[_0x1a52('0x3b')](handleError(_0x518504,null));};exports[_0x1a52('0x43')]=function(_0x1adfb6,_0x4c93a2){return db[_0x1a52('0x27')]['create'](_0x1adfb6[_0x1a52('0x44')],{})[_0x1a52('0x21')](respondWithResult(_0x4c93a2,0xc9))[_0x1a52('0x3b')](handleError(_0x4c93a2,null));};exports[_0x1a52('0x20')]=function(_0x461b2d,_0x15dd09){if(_0x461b2d['body']['id']){delete _0x461b2d[_0x1a52('0x44')]['id'];}return db['SalesforceField'][_0x1a52('0x42')]({'where':{'id':_0x461b2d['params']['id']}})['then'](handleEntityNotFound(_0x15dd09,null))[_0x1a52('0x21')](saveUpdates(_0x461b2d[_0x1a52('0x44')],null))[_0x1a52('0x21')](respondWithResult(_0x15dd09,null))[_0x1a52('0x3b')](handleError(_0x15dd09,null));};exports[_0x1a52('0x22')]=function(_0x189864,_0x1b39ec){return db['SalesforceField'][_0x1a52('0x42')]({'where':{'id':_0x189864[_0x1a52('0x3d')]['id']}})[_0x1a52('0x21')](handleEntityNotFound(_0x1b39ec,null))['then'](removeEntity(_0x1b39ec,null))[_0x1a52('0x3b')](handleError(_0x1b39ec,null));}; \ No newline at end of file +var _0xfcc7=['map','SalesforceField','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','length','find','create','body','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index'];(function(_0x20724d,_0x577485){var _0x39321d=function(_0x544cf3){while(--_0x544cf3){_0x20724d['push'](_0x20724d['shift']());}};_0x39321d(++_0x577485);}(_0xfcc7,0x6a));var _0x7fcc=function(_0x59f7b8,_0xb2ac21){_0x59f7b8=_0x59f7b8-0x0;var _0x7b28c5=_0xfcc7[_0x59f7b8];return _0x7b28c5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7fcc('0x0'));var jsonpatch=require(_0x7fcc('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7fcc('0x2'));var Mustache=require(_0x7fcc('0x3'));var util=require('util');var path=require(_0x7fcc('0x4'));var sox=require(_0x7fcc('0x5'));var csv=require(_0x7fcc('0x6'));var ejs=require(_0x7fcc('0x7'));var fs=require('fs');var fs_extra=require(_0x7fcc('0x8'));var _=require(_0x7fcc('0x9'));var squel=require(_0x7fcc('0xa'));var crypto=require('crypto');var jsforce=require(_0x7fcc('0xb'));var deskjs=require(_0x7fcc('0xc'));var toCsv=require(_0x7fcc('0x6'));var querystring=require(_0x7fcc('0xd'));var Papa=require(_0x7fcc('0xe'));var Redis=require(_0x7fcc('0xf'));var authService=require(_0x7fcc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7fcc('0x11'));var hardwareService=require(_0x7fcc('0x12'));var logger=require(_0x7fcc('0x13'))(_0x7fcc('0x14'));var utils=require(_0x7fcc('0x15'));var config=require(_0x7fcc('0x16'));var licenseUtil=require(_0x7fcc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48723b,_0x2d41b5){_0x2d41b5=_0x2d41b5||0xcc;return function(_0x263929){if(_0x263929){return _0x48723b[_0x7fcc('0x18')](_0x2d41b5);}return _0x48723b['status'](_0x2d41b5)[_0x7fcc('0x19')]();};}function respondWithResult(_0x299067,_0xbc2fe2){_0xbc2fe2=_0xbc2fe2||0xc8;return function(_0x1084ee){if(_0x1084ee){return _0x299067[_0x7fcc('0x1a')](_0xbc2fe2)[_0x7fcc('0x1b')](_0x1084ee);}};}function respondWithFilteredResult(_0xa2b458,_0x50c9b0){return function(_0x419d5a){if(_0x419d5a){var _0x3fec3f=typeof _0x50c9b0[_0x7fcc('0x1c')]===_0x7fcc('0x1d')&&typeof _0x50c9b0[_0x7fcc('0x1e')]===_0x7fcc('0x1d');var _0x128c28=_0x419d5a[_0x7fcc('0x1f')];var _0x3a5525=_0x3fec3f?0x0:_0x50c9b0['offset'];var _0xcc437a=_0x3fec3f?_0x419d5a[_0x7fcc('0x1f')]:_0x50c9b0[_0x7fcc('0x1c')]+_0x50c9b0['limit'];var _0x47dfd8;if(_0xcc437a>=_0x128c28){_0xcc437a=_0x128c28;_0x47dfd8=0xc8;}else{_0x47dfd8=0xce;}_0xa2b458[_0x7fcc('0x1a')](_0x47dfd8);return _0xa2b458[_0x7fcc('0x20')](_0x7fcc('0x21'),_0x3a5525+'-'+_0xcc437a+'/'+_0x128c28)[_0x7fcc('0x1b')](_0x419d5a);}return null;};}function patchUpdates(_0x4f9a18){return function(_0x4688d7){try{jsonpatch['apply'](_0x4688d7,_0x4f9a18,!![]);}catch(_0x353f2d){return BPromise[_0x7fcc('0x22')](_0x353f2d);}return _0x4688d7[_0x7fcc('0x23')]();};}function saveUpdates(_0x5e2db1,_0x5edd41){return function(_0x599df8){if(_0x599df8){return _0x599df8[_0x7fcc('0x24')](_0x5e2db1)['then'](function(_0x14fc58){return _0x14fc58;});}return null;};}function removeEntity(_0x435812,_0x3e3f6c){return function(_0x287994){if(_0x287994){return _0x287994[_0x7fcc('0x25')]()[_0x7fcc('0x26')](function(){_0x435812[_0x7fcc('0x1a')](0xcc)[_0x7fcc('0x19')]();});}};}function handleEntityNotFound(_0x218fb7,_0x250790){return function(_0x1f3fde){if(!_0x1f3fde){_0x218fb7['sendStatus'](0x194);}return _0x1f3fde;};}function handleError(_0x2a2d68,_0x148f15){_0x148f15=_0x148f15||0x1f4;return function(_0x5b42be){logger[_0x7fcc('0x27')](_0x5b42be[_0x7fcc('0x28')]);if(_0x5b42be[_0x7fcc('0x29')]){delete _0x5b42be[_0x7fcc('0x29')];}_0x2a2d68[_0x7fcc('0x1a')](_0x148f15)[_0x7fcc('0x2a')](_0x5b42be);};}exports[_0x7fcc('0x2b')]=function(_0x3d7b30,_0x4644d4){var _0x3f40c8={},_0x455cf8={},_0x5b4b30={'count':0x0,'rows':[]};var _0x3c4dd2=_[_0x7fcc('0x2c')](db[_0x7fcc('0x2d')]['rawAttributes'],function(_0x212385){return{'name':_0x212385[_0x7fcc('0x2e')],'type':_0x212385[_0x7fcc('0x2f')][_0x7fcc('0x30')]};});_0x455cf8[_0x7fcc('0x31')]=_[_0x7fcc('0x2c')](_0x3c4dd2,'name');_0x455cf8[_0x7fcc('0x32')]=_[_0x7fcc('0x33')](_0x3d7b30['query']);_0x455cf8['filters']=_[_0x7fcc('0x34')](_0x455cf8[_0x7fcc('0x31')],_0x455cf8['query']);_0x3f40c8[_0x7fcc('0x35')]=_[_0x7fcc('0x34')](_0x455cf8['model'],qs[_0x7fcc('0x36')](_0x3d7b30[_0x7fcc('0x32')][_0x7fcc('0x36')]));_0x3f40c8['attributes']=_0x3f40c8[_0x7fcc('0x35')]['length']?_0x3f40c8[_0x7fcc('0x35')]:_0x455cf8['model'];if(!_0x3d7b30[_0x7fcc('0x32')][_0x7fcc('0x37')]('nolimit')){_0x3f40c8[_0x7fcc('0x1e')]=qs[_0x7fcc('0x1e')](_0x3d7b30[_0x7fcc('0x32')][_0x7fcc('0x1e')]);_0x3f40c8[_0x7fcc('0x1c')]=qs[_0x7fcc('0x1c')](_0x3d7b30[_0x7fcc('0x32')][_0x7fcc('0x1c')]);}_0x3f40c8['order']=qs['sort'](_0x3d7b30['query']['sort']);_0x3f40c8[_0x7fcc('0x38')]=qs['filters'](_[_0x7fcc('0x39')](_0x3d7b30[_0x7fcc('0x32')],_0x455cf8['filters']),_0x3c4dd2);if(_0x3d7b30[_0x7fcc('0x32')]['filter']){_0x3f40c8['where']=_[_0x7fcc('0x3a')](_0x3f40c8[_0x7fcc('0x38')],{'$or':_[_0x7fcc('0x2c')](_0x3c4dd2,function(_0x1f8ced){if(_0x1f8ced[_0x7fcc('0x2f')]!==_0x7fcc('0x3b')){var _0xa67e93={};_0xa67e93[_0x1f8ced[_0x7fcc('0x29')]]={'$like':'%'+_0x3d7b30[_0x7fcc('0x32')][_0x7fcc('0x3c')]+'%'};return _0xa67e93;}})});}_0x3f40c8=_[_0x7fcc('0x3a')]({},_0x3f40c8,_0x3d7b30[_0x7fcc('0x3d')]);var _0x5dc6a5={'where':_0x3f40c8['where']};return db[_0x7fcc('0x2d')]['count'](_0x5dc6a5)[_0x7fcc('0x26')](function(_0x852fd4){_0x5b4b30[_0x7fcc('0x1f')]=_0x852fd4;if(_0x3d7b30[_0x7fcc('0x32')][_0x7fcc('0x3e')]){_0x3f40c8[_0x7fcc('0x3f')]=[{'all':!![]}];}return db[_0x7fcc('0x2d')][_0x7fcc('0x40')](_0x3f40c8);})[_0x7fcc('0x26')](function(_0xd54bdc){_0x5b4b30[_0x7fcc('0x41')]=_0xd54bdc;return _0x5b4b30;})[_0x7fcc('0x26')](respondWithFilteredResult(_0x4644d4,_0x3f40c8))[_0x7fcc('0x42')](handleError(_0x4644d4,null));};exports[_0x7fcc('0x43')]=function(_0x29c11a,_0x18c2f9){var _0x12084b={'raw':!![],'where':{'id':_0x29c11a[_0x7fcc('0x44')]['id']}},_0x20bb35={};_0x20bb35['model']=_[_0x7fcc('0x33')](db[_0x7fcc('0x2d')][_0x7fcc('0x45')]);_0x20bb35[_0x7fcc('0x32')]=_[_0x7fcc('0x33')](_0x29c11a[_0x7fcc('0x32')]);_0x20bb35[_0x7fcc('0x46')]=_[_0x7fcc('0x34')](_0x20bb35[_0x7fcc('0x31')],_0x20bb35[_0x7fcc('0x32')]);_0x12084b[_0x7fcc('0x35')]=_['intersection'](_0x20bb35[_0x7fcc('0x31')],qs[_0x7fcc('0x36')](_0x29c11a['query'][_0x7fcc('0x36')]));_0x12084b[_0x7fcc('0x35')]=_0x12084b[_0x7fcc('0x35')][_0x7fcc('0x47')]?_0x12084b[_0x7fcc('0x35')]:_0x20bb35['model'];if(_0x29c11a['query']['includeAll']){_0x12084b['include']=[{'all':!![]}];}_0x12084b=_[_0x7fcc('0x3a')]({},_0x12084b,_0x29c11a[_0x7fcc('0x3d')]);return db[_0x7fcc('0x2d')][_0x7fcc('0x48')](_0x12084b)[_0x7fcc('0x26')](handleEntityNotFound(_0x18c2f9,null))[_0x7fcc('0x26')](respondWithResult(_0x18c2f9,null))[_0x7fcc('0x42')](handleError(_0x18c2f9,null));};exports[_0x7fcc('0x49')]=function(_0x40d97e,_0x342944){return db['SalesforceField'][_0x7fcc('0x49')](_0x40d97e[_0x7fcc('0x4a')],{})[_0x7fcc('0x26')](respondWithResult(_0x342944,0xc9))['catch'](handleError(_0x342944,null));};exports['update']=function(_0x39a5d6,_0x29fbda){if(_0x39a5d6[_0x7fcc('0x4a')]['id']){delete _0x39a5d6[_0x7fcc('0x4a')]['id'];}return db[_0x7fcc('0x2d')][_0x7fcc('0x48')]({'where':{'id':_0x39a5d6[_0x7fcc('0x44')]['id']}})[_0x7fcc('0x26')](handleEntityNotFound(_0x29fbda,null))[_0x7fcc('0x26')](saveUpdates(_0x39a5d6[_0x7fcc('0x4a')],null))[_0x7fcc('0x26')](respondWithResult(_0x29fbda,null))[_0x7fcc('0x42')](handleError(_0x29fbda,null));};exports[_0x7fcc('0x25')]=function(_0xa4e057,_0x2f83a1){return db[_0x7fcc('0x2d')][_0x7fcc('0x48')]({'where':{'id':_0xa4e057['params']['id']}})['then'](handleEntityNotFound(_0x2f83a1,null))[_0x7fcc('0x26')](removeEntity(_0x2f83a1,null))[_0x7fcc('0x42')](handleError(_0x2f83a1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 62b4e66..e9f12be 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 _0xc5ad=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','salesforce_unique_index','idField','lodash','util'];(function(_0x42f9db,_0x30bb55){var _0x392858=function(_0xb7305e){while(--_0xb7305e){_0x42f9db['push'](_0x42f9db['shift']());}};_0x392858(++_0x30bb55);}(_0xc5ad,0x184));var _0xdc5a=function(_0x1f1a75,_0x1ddc67){_0x1f1a75=_0x1f1a75-0x0;var _0x42e355=_0xc5ad[_0x1f1a75];return _0x42e355;};'use strict';var _=require(_0xdc5a('0x0'));var util=require(_0xdc5a('0x1'));var logger=require(_0xdc5a('0x2'))(_0xdc5a('0x3'));var moment=require(_0xdc5a('0x4'));var BPromise=require(_0xdc5a('0x5'));var rp=require(_0xdc5a('0x6'));var fs=require('fs');var path=require(_0xdc5a('0x7'));var rimraf=require(_0xdc5a('0x8'));var config=require(_0xdc5a('0x9'));var attributes=require(_0xdc5a('0xa'));module[_0xdc5a('0xb')]=function(_0x38ebab,_0x4e63b0){return _0x38ebab['define'](_0xdc5a('0xc'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xdc5a('0xd'),'fields':[_0xdc5a('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa331=['api','moment','path','rimraf','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xa331,0xcf));var _0x1a33=function(_0x3e8e98,_0x4d6478){_0x3e8e98=_0x3e8e98-0x0;var _0x387c2f=_0xa331[_0x3e8e98];return _0x387c2f;};'use strict';var _=require(_0x1a33('0x0'));var util=require(_0x1a33('0x1'));var logger=require(_0x1a33('0x2'))(_0x1a33('0x3'));var moment=require(_0x1a33('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a33('0x5'));var rimraf=require(_0x1a33('0x6'));var config=require('../../config/environment');var attributes=require(_0x1a33('0x7'));module[_0x1a33('0x8')]=function(_0x4af820,_0x4234d9){return _0x4af820[_0x1a33('0x9')](_0x1a33('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x1a33('0xb'),'fields':[_0x1a33('0xc'),_0x1a33('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 9f82887..a322c8f 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 _0xe9d7=['SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceField,\x20%s,\x20%s','debug'];(function(_0x505bb6,_0x432a70){var _0x126e1b=function(_0x1245bb){while(--_0x1245bb){_0x505bb6['push'](_0x505bb6['shift']());}};_0x126e1b(++_0x432a70);}(_0xe9d7,0xed));var _0x7e9d=function(_0x417955,_0x4ed8c8){_0x417955=_0x417955-0x0;var _0x3a94ef=_0xe9d7[_0x417955];return _0x3a94ef;};'use strict';var _=require(_0x7e9d('0x0'));var util=require(_0x7e9d('0x1'));var moment=require(_0x7e9d('0x2'));var BPromise=require('bluebird');var rs=require(_0x7e9d('0x3'));var fs=require('fs');var Redis=require(_0x7e9d('0x4'));var db=require(_0x7e9d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e9d('0x6'))(_0x7e9d('0x7'));var config=require(_0x7e9d('0x8'));var jayson=require(_0x7e9d('0x9'));var client=jayson[_0x7e9d('0xa')][_0x7e9d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ec3b3,_0xcb502,_0xe9a6f7){return new BPromise(function(_0x27d4fa,_0x31d6a3){return client[_0x7e9d('0xc')](_0x1ec3b3,_0xe9a6f7)['then'](function(_0x116d65){logger[_0x7e9d('0xd')](_0x7e9d('0xe'),_0xcb502,'request\x20sent');logger[_0x7e9d('0xf')](_0x7e9d('0x10'),_0xcb502,_0x7e9d('0x11'),JSON[_0x7e9d('0x12')](_0x116d65));if(_0x116d65[_0x7e9d('0x13')]){if(_0x116d65[_0x7e9d('0x13')]['code']===0x1f4){logger[_0x7e9d('0x13')](_0x7e9d('0xe'),_0xcb502,_0x116d65['error']['message']);return _0x31d6a3(_0x116d65[_0x7e9d('0x13')][_0x7e9d('0x14')]);}logger[_0x7e9d('0x13')]('SalesforceField,\x20%s,\x20%s',_0xcb502,_0x116d65[_0x7e9d('0x13')][_0x7e9d('0x14')]);return _0x27d4fa(_0x116d65[_0x7e9d('0x13')][_0x7e9d('0x14')]);}else{logger[_0x7e9d('0xd')]('SalesforceField,\x20%s,\x20%s',_0xcb502,_0x7e9d('0x11'));_0x27d4fa(_0x116d65[_0x7e9d('0x15')][_0x7e9d('0x14')]);}})[_0x7e9d('0x16')](function(_0x3ed258){logger['error']('SalesforceField,\x20%s,\x20%s',_0xcb502,_0x3ed258);_0x31d6a3(_0x3ed258);});});} \ No newline at end of file +var _0x4b38=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SalesforceField,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info'];(function(_0x3d221d,_0x423b05){var _0x1b802b=function(_0x34563f){while(--_0x34563f){_0x3d221d['push'](_0x3d221d['shift']());}};_0x1b802b(++_0x423b05);}(_0x4b38,0xd1));var _0x84b3=function(_0x71b3ad,_0x3e7d70){_0x71b3ad=_0x71b3ad-0x0;var _0x55909d=_0x4b38[_0x71b3ad];return _0x55909d;};'use strict';var _=require(_0x84b3('0x0'));var util=require(_0x84b3('0x1'));var moment=require(_0x84b3('0x2'));var BPromise=require('bluebird');var rs=require(_0x84b3('0x3'));var fs=require('fs');var Redis=require(_0x84b3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x84b3('0x5'));var logger=require(_0x84b3('0x6'))(_0x84b3('0x7'));var config=require(_0x84b3('0x8'));var jayson=require(_0x84b3('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x501995,_0x36a158,_0x20e926){return new BPromise(function(_0x2c5917,_0x335bab){return client[_0x84b3('0xa')](_0x501995,_0x20e926)[_0x84b3('0xb')](function(_0xace093){logger['info'](_0x84b3('0xc'),_0x36a158,'request\x20sent');logger[_0x84b3('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x36a158,_0x84b3('0xe'),JSON['stringify'](_0xace093));if(_0xace093[_0x84b3('0xf')]){if(_0xace093[_0x84b3('0xf')][_0x84b3('0x10')]===0x1f4){logger[_0x84b3('0xf')](_0x84b3('0xc'),_0x36a158,_0xace093[_0x84b3('0xf')][_0x84b3('0x11')]);return _0x335bab(_0xace093[_0x84b3('0xf')][_0x84b3('0x11')]);}logger[_0x84b3('0xf')](_0x84b3('0xc'),_0x36a158,_0xace093[_0x84b3('0xf')]['message']);return _0x2c5917(_0xace093[_0x84b3('0xf')][_0x84b3('0x11')]);}else{logger[_0x84b3('0x12')](_0x84b3('0xc'),_0x36a158,_0x84b3('0xe'));_0x2c5917(_0xace093['result']['message']);}})['catch'](function(_0x28700f){logger[_0x84b3('0xf')]('SalesforceField,\x20%s,\x20%s',_0x36a158,_0x28700f);_0x335bab(_0x28700f);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index ebdb401..6b04cd6 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 _0x47c2=['create','addConfiguration','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post'];(function(_0x23f43c,_0x4606b6){var _0x4bc94e=function(_0x4c1bba){while(--_0x4c1bba){_0x23f43c['push'](_0x23f43c['shift']());}};_0x4bc94e(++_0x4606b6);}(_0x47c2,0x1ae));var _0x247c=function(_0x1f256c,_0x2ff047){_0x1f256c=_0x1f256c-0x0;var _0x1b60ba=_0x47c2[_0x1f256c];return _0x1b60ba;};'use strict';var multer=require(_0x247c('0x0'));var util=require(_0x247c('0x1'));var path=require(_0x247c('0x2'));var timeout=require(_0x247c('0x3'));var express=require(_0x247c('0x4'));var router=express[_0x247c('0x5')]();var fs_extra=require(_0x247c('0x6'));var auth=require(_0x247c('0x7'));var interaction=require(_0x247c('0x8'));var config=require(_0x247c('0x9'));var controller=require(_0x247c('0xa'));router[_0x247c('0xb')]('/',auth[_0x247c('0xc')](),controller[_0x247c('0xd')]);router[_0x247c('0xb')](_0x247c('0xe'),auth['isAuthenticated'](),controller[_0x247c('0xf')]);router['get'](_0x247c('0x10'),auth[_0x247c('0xc')](),controller['getConfigurations']);router[_0x247c('0xb')](_0x247c('0x11'),auth['isAuthenticated'](),controller[_0x247c('0x12')]);router[_0x247c('0x13')]('/',auth[_0x247c('0xc')](),controller[_0x247c('0x14')]);router[_0x247c('0x13')](_0x247c('0x10'),auth['isAuthenticated'](),controller[_0x247c('0x15')]);router['put'](_0x247c('0xe'),auth[_0x247c('0xc')](),controller[_0x247c('0x16')]);router[_0x247c('0x17')](_0x247c('0xe'),auth[_0x247c('0xc')](),controller[_0x247c('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9789=['index','isAuthenticated','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get'];(function(_0x4f6da2,_0x4a141){var _0x5c8fca=function(_0x3c24b0){while(--_0x3c24b0){_0x4f6da2['push'](_0x4f6da2['shift']());}};_0x5c8fca(++_0x4a141);}(_0x9789,0xc7));var _0x9978=function(_0x2a05bf,_0x55e3a4){_0x2a05bf=_0x2a05bf-0x0;var _0x38a62e=_0x9789[_0x2a05bf];return _0x38a62e;};'use strict';var multer=require(_0x9978('0x0'));var util=require(_0x9978('0x1'));var path=require(_0x9978('0x2'));var timeout=require('connect-timeout');var express=require(_0x9978('0x3'));var router=express[_0x9978('0x4')]();var fs_extra=require(_0x9978('0x5'));var auth=require(_0x9978('0x6'));var interaction=require(_0x9978('0x7'));var config=require(_0x9978('0x8'));var controller=require(_0x9978('0x9'));router[_0x9978('0xa')]('/',auth['isAuthenticated'](),controller[_0x9978('0xb')]);router[_0x9978('0xa')]('/:id',auth[_0x9978('0xc')](),controller['show']);router[_0x9978('0xa')](_0x9978('0xd'),auth['isAuthenticated'](),controller[_0x9978('0xe')]);router[_0x9978('0xa')]('/:id/fields',auth[_0x9978('0xc')](),controller[_0x9978('0xf')]);router[_0x9978('0x10')]('/',auth[_0x9978('0xc')](),controller['create']);router['post'](_0x9978('0xd'),auth['isAuthenticated'](),controller[_0x9978('0x11')]);router[_0x9978('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9978('0x13')]('/:id',auth[_0x9978('0xc')](),controller['destroy']);module[_0x9978('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 e623c17..fd97f84 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 _0xb5e4=['sequelize','exports','STRING'];(function(_0x1e0eba,_0x15a84c){var _0x631c66=function(_0x36e68){while(--_0x36e68){_0x1e0eba['push'](_0x1e0eba['shift']());}};_0x631c66(++_0x15a84c);}(_0xb5e4,0xed));var _0x4b5e=function(_0xe2a43b,_0x40f293){_0xe2a43b=_0xe2a43b-0x0;var _0x372352=_0xb5e4[_0xe2a43b];return _0x372352;};'use strict';var Sequelize=require(_0x4b5e('0x0'));module[_0x4b5e('0x1')]={'name':{'type':Sequelize[_0x4b5e('0x2')]},'description':{'type':Sequelize[_0x4b5e('0x2')]},'username':{'type':Sequelize[_0x4b5e('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x4b5e('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4b5e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe84f=['sequelize','exports','STRING','username','remoteUri'];(function(_0x14cc34,_0x4f7ec9){var _0x5393fb=function(_0x1fc2ad){while(--_0x1fc2ad){_0x14cc34['push'](_0x14cc34['shift']());}};_0x5393fb(++_0x4f7ec9);}(_0xe84f,0x190));var _0xfe84=function(_0x20d7b4,_0x7fa6f9){_0x20d7b4=_0x20d7b4-0x0;var _0x4d3b8a=_0xe84f[_0x20d7b4];return _0x4d3b8a;};'use strict';var Sequelize=require(_0xfe84('0x0'));module[_0xfe84('0x1')]={'name':{'type':Sequelize[_0xfe84('0x2')]},'description':{'type':Sequelize[_0xfe84('0x2')]},'username':{'type':Sequelize[_0xfe84('0x2')],'unique':_0xfe84('0x3')},'password':{'type':Sequelize[_0xfe84('0x2')]},'email':{'type':Sequelize[_0xfe84('0x2')]},'remoteUri':{'type':Sequelize[_0xfe84('0x2')],'unique':_0xfe84('0x4')},'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 dba8293..6f5ae29 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 _0x19be=['getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','user_input','sys_created_on','sys_domain','sys_created_by','closed_at','cmdb_ci','active','work_notes_list','business_service','priority','sys_domain_path','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','assigned_to','sla_due','approval','sys_mod_count','reopen_count','sys_tags','upon_approval','location','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','test','statusCode','send','Wrong\x20credentials','boolean','true','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','set','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','VIRTUAL','options','ServicenowAccount','includeAll','findAll','params','length','include','catch','create','body','findOne','ServicenowConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions'];(function(_0x1585be,_0x422a82){var _0x5f2427=function(_0x4e3948){while(--_0x4e3948){_0x1585be['push'](_0x1585be['shift']());}};_0x5f2427(++_0x422a82);}(_0x19be,0x119));var _0xe19b=function(_0x5aebad,_0x2e99a5){_0x5aebad=_0x5aebad-0x0;var _0x52179f=_0x19be[_0x5aebad];return _0x52179f;};'use strict';var emlformat=require(_0xe19b('0x0'));var rimraf=require(_0xe19b('0x1'));var zipdir=require(_0xe19b('0x2'));var jsonpatch=require(_0xe19b('0x3'));var rp=require(_0xe19b('0x4'));var moment=require(_0xe19b('0x5'));var BPromise=require(_0xe19b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe19b('0x7'));var sox=require(_0xe19b('0x8'));var csv=require(_0xe19b('0x9'));var ejs=require(_0xe19b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe19b('0xb'));var squel=require(_0xe19b('0xc'));var crypto=require('crypto');var jsforce=require(_0xe19b('0xd'));var deskjs=require(_0xe19b('0xe'));var toCsv=require(_0xe19b('0x9'));var querystring=require('querystring');var Papa=require(_0xe19b('0xf'));var Redis=require('ioredis');var authService=require(_0xe19b('0x10'));var qs=require(_0xe19b('0x11'));var as=require(_0xe19b('0x12'));var hardwareService=require(_0xe19b('0x13'));var logger=require(_0xe19b('0x14'))(_0xe19b('0x15'));var utils=require(_0xe19b('0x16'));var config=require(_0xe19b('0x17'));var licenseUtil=require(_0xe19b('0x18'));var db=require(_0xe19b('0x19'))['db'];var integrations=require(_0xe19b('0x1a'));function respondWithStatusCode(_0x4c3f92,_0x1fa79e){_0x1fa79e=_0x1fa79e||0xcc;return function(_0x26faa4){if(_0x26faa4){return _0x4c3f92[_0xe19b('0x1b')](_0x1fa79e);}return _0x4c3f92[_0xe19b('0x1c')](_0x1fa79e)[_0xe19b('0x1d')]();};}function respondWithResult(_0x2c7259,_0x294f47){_0x294f47=_0x294f47||0xc8;return function(_0x345ec1){if(_0x345ec1){return _0x2c7259[_0xe19b('0x1c')](_0x294f47)[_0xe19b('0x1e')](_0x345ec1);}};}function respondWithFilteredResult(_0x45a131,_0x594ff8){return function(_0x5cd7df){if(_0x5cd7df){var _0x55ba57=typeof _0x594ff8['offset']==='undefined'&&typeof _0x594ff8[_0xe19b('0x1f')]===_0xe19b('0x20');var _0x2a1084=_0x5cd7df[_0xe19b('0x21')];var _0xdf2765=_0x55ba57?0x0:_0x594ff8['offset'];var _0x1dc921=_0x55ba57?_0x5cd7df[_0xe19b('0x21')]:_0x594ff8['offset']+_0x594ff8[_0xe19b('0x1f')];var _0x32c2b4;if(_0x1dc921>=_0x2a1084){_0x1dc921=_0x2a1084;_0x32c2b4=0xc8;}else{_0x32c2b4=0xce;}_0x45a131['status'](_0x32c2b4);return _0x45a131[_0xe19b('0x22')]('Content-Range',_0xdf2765+'-'+_0x1dc921+'/'+_0x2a1084)['json'](_0x5cd7df);}return null;};}function patchUpdates(_0x2184f9){return function(_0x270a12){try{jsonpatch['apply'](_0x270a12,_0x2184f9,!![]);}catch(_0x4d1190){return BPromise['reject'](_0x4d1190);}return _0x270a12[_0xe19b('0x23')]();};}function saveUpdates(_0x3ed972,_0x557cd7){return function(_0x36f540){if(_0x36f540){return _0x36f540[_0xe19b('0x24')](_0x3ed972)[_0xe19b('0x25')](function(_0xb78e87){return _0xb78e87;});}return null;};}function removeEntity(_0x13e02a,_0x21ec9a){return function(_0x2e3a22){if(_0x2e3a22){return _0x2e3a22[_0xe19b('0x26')]()[_0xe19b('0x25')](function(){_0x13e02a['status'](0xcc)[_0xe19b('0x1d')]();});}};}function handleEntityNotFound(_0xa5ab23,_0xbf1041){return function(_0x2f1327){if(!_0x2f1327){_0xa5ab23['sendStatus'](0x194);}return _0x2f1327;};}function handleError(_0x405171,_0x137671){_0x137671=_0x137671||0x1f4;return function(_0x4c6aab){logger[_0xe19b('0x27')](_0x4c6aab[_0xe19b('0x28')]);if(_0x4c6aab[_0xe19b('0x29')]){delete _0x4c6aab['name'];}_0x405171[_0xe19b('0x1c')](_0x137671)['send'](_0x4c6aab);};}exports[_0xe19b('0x2a')]=function(_0x4f65b7,_0x3e7635){var _0x440342={},_0x32b89b={},_0x2042c8={'count':0x0,'rows':[]};var _0x217a4b=_['map'](db['ServicenowAccount'][_0xe19b('0x2b')],function(_0x151ee1){return{'name':_0x151ee1[_0xe19b('0x2c')],'type':_0x151ee1[_0xe19b('0x2d')][_0xe19b('0x2e')]};});_0x32b89b[_0xe19b('0x2f')]=_['map'](_0x217a4b,_0xe19b('0x29'));_0x32b89b[_0xe19b('0x30')]=_[_0xe19b('0x31')](_0x4f65b7[_0xe19b('0x30')]);_0x32b89b[_0xe19b('0x32')]=_[_0xe19b('0x33')](_0x32b89b[_0xe19b('0x2f')],_0x32b89b[_0xe19b('0x30')]);_0x440342[_0xe19b('0x34')]=_[_0xe19b('0x33')](_0x32b89b['model'],qs['fields'](_0x4f65b7[_0xe19b('0x30')][_0xe19b('0x35')]));_0x440342[_0xe19b('0x34')]=_0x440342[_0xe19b('0x34')]['length']?_0x440342[_0xe19b('0x34')]:_0x32b89b[_0xe19b('0x2f')];if(!_0x4f65b7[_0xe19b('0x30')][_0xe19b('0x36')](_0xe19b('0x37'))){_0x440342['limit']=qs['limit'](_0x4f65b7[_0xe19b('0x30')][_0xe19b('0x1f')]);_0x440342[_0xe19b('0x38')]=qs['offset'](_0x4f65b7['query'][_0xe19b('0x38')]);}_0x440342[_0xe19b('0x39')]=qs[_0xe19b('0x3a')](_0x4f65b7[_0xe19b('0x30')][_0xe19b('0x3a')]);_0x440342[_0xe19b('0x3b')]=qs[_0xe19b('0x32')](_[_0xe19b('0x3c')](_0x4f65b7['query'],_0x32b89b[_0xe19b('0x32')]),_0x217a4b);if(_0x4f65b7[_0xe19b('0x30')][_0xe19b('0x3d')]){_0x440342[_0xe19b('0x3b')]=_[_0xe19b('0x3e')](_0x440342[_0xe19b('0x3b')],{'$or':_[_0xe19b('0x3f')](_0x217a4b,function(_0x9912c8){if(_0x9912c8['type']!==_0xe19b('0x40')){var _0x1848a5={};_0x1848a5[_0x9912c8[_0xe19b('0x29')]]={'$like':'%'+_0x4f65b7[_0xe19b('0x30')][_0xe19b('0x3d')]+'%'};return _0x1848a5;}})});}_0x440342=_[_0xe19b('0x3e')]({},_0x440342,_0x4f65b7[_0xe19b('0x41')]);var _0x3d4521={'where':_0x440342[_0xe19b('0x3b')]};return db[_0xe19b('0x42')][_0xe19b('0x21')](_0x3d4521)[_0xe19b('0x25')](function(_0x2669c0){_0x2042c8['count']=_0x2669c0;if(_0x4f65b7[_0xe19b('0x30')][_0xe19b('0x43')]){_0x440342['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0xe19b('0x44')](_0x440342);})[_0xe19b('0x25')](function(_0x1361d1){_0x2042c8['rows']=_0x1361d1;return _0x2042c8;})[_0xe19b('0x25')](respondWithFilteredResult(_0x3e7635,_0x440342))['catch'](handleError(_0x3e7635,null));};exports['show']=function(_0xa8eff1,_0x44e147){var _0x2aa262={'raw':![],'where':{'id':_0xa8eff1[_0xe19b('0x45')]['id']}},_0x1717c8={};_0x1717c8[_0xe19b('0x2f')]=_[_0xe19b('0x31')](db[_0xe19b('0x42')]['rawAttributes']);_0x1717c8[_0xe19b('0x30')]=_[_0xe19b('0x31')](_0xa8eff1[_0xe19b('0x30')]);_0x1717c8[_0xe19b('0x32')]=_['intersection'](_0x1717c8[_0xe19b('0x2f')],_0x1717c8[_0xe19b('0x30')]);_0x2aa262[_0xe19b('0x34')]=_[_0xe19b('0x33')](_0x1717c8[_0xe19b('0x2f')],qs['fields'](_0xa8eff1[_0xe19b('0x30')][_0xe19b('0x35')]));_0x2aa262['attributes']=_0x2aa262[_0xe19b('0x34')][_0xe19b('0x46')]?_0x2aa262[_0xe19b('0x34')]:_0x1717c8[_0xe19b('0x2f')];if(_0xa8eff1['query']['includeAll']){_0x2aa262[_0xe19b('0x47')]=[{'all':!![]}];}_0x2aa262=_[_0xe19b('0x3e')]({},_0x2aa262,_0xa8eff1[_0xe19b('0x41')]);return db[_0xe19b('0x42')]['find'](_0x2aa262)['then'](handleEntityNotFound(_0x44e147,null))['then'](respondWithResult(_0x44e147,null))[_0xe19b('0x48')](handleError(_0x44e147,null));};exports[_0xe19b('0x49')]=function(_0x38a545,_0x3ffbc4){return db[_0xe19b('0x42')]['create'](_0x38a545['body'],{})['then'](respondWithResult(_0x3ffbc4,0xc9))['catch'](handleError(_0x3ffbc4,null));};exports[_0xe19b('0x24')]=function(_0x3898ae,_0x16103a){if(_0x3898ae[_0xe19b('0x4a')]['id']){delete _0x3898ae[_0xe19b('0x4a')]['id'];}return db[_0xe19b('0x42')]['find']({'where':{'id':_0x3898ae['params']['id']}})[_0xe19b('0x25')](handleEntityNotFound(_0x16103a,null))[_0xe19b('0x25')](saveUpdates(_0x3898ae[_0xe19b('0x4a')],null))[_0xe19b('0x25')](respondWithResult(_0x16103a,null))[_0xe19b('0x48')](handleError(_0x16103a,null));};exports[_0xe19b('0x26')]=function(_0x3330ac,_0x34757e){return db[_0xe19b('0x42')]['find']({'where':{'id':_0x3330ac['params']['id']}})[_0xe19b('0x25')](handleEntityNotFound(_0x34757e,null))['then'](removeEntity(_0x34757e,null))[_0xe19b('0x48')](handleError(_0x34757e,null));};exports['getConfigurations']=function(_0x10e06d,_0xec9011,_0xa1899c){var _0x4fe47e={};var _0x3b83f4={};var _0x59d435;var _0x5334dd;return db[_0xe19b('0x42')][_0xe19b('0x4b')]({'where':{'id':_0x10e06d[_0xe19b('0x45')]['id']}})[_0xe19b('0x25')](handleEntityNotFound(_0xec9011,null))[_0xe19b('0x25')](function(_0x3eb11){if(_0x3eb11){_0x59d435=_0x3eb11;_0x3b83f4['model']=_['keys'](db[_0xe19b('0x4c')][_0xe19b('0x2b')]);_0x3b83f4[_0xe19b('0x30')]=_['keys'](_0x10e06d[_0xe19b('0x30')]);_0x3b83f4[_0xe19b('0x32')]=_[_0xe19b('0x33')](_0x3b83f4[_0xe19b('0x2f')],_0x3b83f4[_0xe19b('0x30')]);_0x4fe47e[_0xe19b('0x34')]=_[_0xe19b('0x33')](_0x3b83f4[_0xe19b('0x2f')],qs[_0xe19b('0x35')](_0x10e06d['query'][_0xe19b('0x35')]));_0x4fe47e[_0xe19b('0x34')]=_0x4fe47e[_0xe19b('0x34')][_0xe19b('0x46')]?_0x4fe47e['attributes']:_0x3b83f4['model'];_0x4fe47e[_0xe19b('0x39')]=qs[_0xe19b('0x3a')](_0x10e06d['query'][_0xe19b('0x3a')]);_0x4fe47e[_0xe19b('0x3b')]=qs['filters'](_[_0xe19b('0x3c')](_0x10e06d['query'],_0x3b83f4['filters']));if(_0x10e06d[_0xe19b('0x30')]['filter']){_0x4fe47e[_0xe19b('0x3b')]=_[_0xe19b('0x3e')](_0x4fe47e[_0xe19b('0x3b')],{'$or':_[_0xe19b('0x3f')](_0x4fe47e['attributes'],function(_0x10d43b){var _0x2d9f03={};_0x2d9f03[_0x10d43b]={'$like':'%'+_0x10e06d['query'][_0xe19b('0x3d')]+'%'};return _0x2d9f03;})});}_0x4fe47e=_[_0xe19b('0x3e')]({},_0x4fe47e,_0x10e06d[_0xe19b('0x41')]);return _0x59d435[_0xe19b('0x4d')](_0x4fe47e);}})['then'](function(_0x322f97){if(_0x322f97){_0x5334dd=_0x322f97[_0xe19b('0x46')];if(!_0x10e06d[_0xe19b('0x30')][_0xe19b('0x36')](_0xe19b('0x37'))){_0x4fe47e[_0xe19b('0x1f')]=qs[_0xe19b('0x1f')](_0x10e06d['query'][_0xe19b('0x1f')]);_0x4fe47e[_0xe19b('0x38')]=qs[_0xe19b('0x38')](_0x10e06d[_0xe19b('0x30')]['offset']);}return _0x59d435[_0xe19b('0x4d')](_0x4fe47e);}})[_0xe19b('0x25')](function(_0x6596f8){if(_0x6596f8){return _0x6596f8?{'count':_0x5334dd,'rows':_0x6596f8}:null;}})[_0xe19b('0x25')](respondWithResult(_0xec9011,null))[_0xe19b('0x48')](handleError(_0xec9011,null));};exports['addConfiguration']=function(_0x543ba2,_0x483d9d,_0x556ca8){if(_0x543ba2['body']['id']){delete _0x543ba2[_0xe19b('0x4a')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x543ba2[_0xe19b('0x45')]['id']}})[_0xe19b('0x25')](handleEntityNotFound(_0x483d9d,null))[_0xe19b('0x25')](function(_0xf79147){if(_0xf79147){_0x543ba2[_0xe19b('0x4a')][_0xe19b('0x4e')]=_0xf79147['id'];_0x543ba2[_0xe19b('0x4a')][_0xe19b('0x4f')]=integrations[_0xe19b('0x50')](_0x543ba2[_0xe19b('0x4a')][_0xe19b('0x51')],_0x543ba2[_0xe19b('0x4a')][_0xe19b('0x2d')]);_0x543ba2[_0xe19b('0x4a')][_0xe19b('0x52')]=integrations[_0xe19b('0x53')](_0x543ba2['body'][_0xe19b('0x51')],_0x543ba2[_0xe19b('0x4a')][_0xe19b('0x2d')]);return db[_0xe19b('0x4c')][_0xe19b('0x49')](_0x543ba2[_0xe19b('0x4a')],{'include':[{'model':db[_0xe19b('0x54')],'as':_0xe19b('0x4f')},{'model':db['ServicenowField'],'as':_0xe19b('0x52')}]});}return null;})[_0xe19b('0x25')](respondWithResult(_0x483d9d,null))[_0xe19b('0x48')](handleError(_0x483d9d,null));};exports[_0xe19b('0x55')]=function(_0x213a76,_0x4ec120,_0x3a521f){var _0x453989=[_0xe19b('0x56'),_0xe19b('0x57'),_0xe19b('0x58'),'subcategory',_0xe19b('0x59'),_0xe19b('0x5a'),_0xe19b('0x5b'),_0xe19b('0x5c'),_0xe19b('0x5d')];var _0x19f7bb=[_0xe19b('0x5e'),'made_sla',_0xe19b('0x5f'),'watch_list',_0xe19b('0x60'),_0xe19b('0x61'),_0xe19b('0x62'),_0xe19b('0x57'),_0xe19b('0x63'),_0xe19b('0x64'),_0xe19b('0x65'),'sys_updated_by','opened_by',_0xe19b('0x66'),_0xe19b('0x67'),_0xe19b('0x68'),'state',_0xe19b('0x69'),_0xe19b('0x58'),'order','calendar_stc',_0xe19b('0x6a'),_0xe19b('0x6b'),'delivery_plan','impact',_0xe19b('0x6c'),_0xe19b('0x6d'),_0xe19b('0x6e'),_0xe19b('0x6f'),_0xe19b('0x70'),'rfc','time_worked',_0xe19b('0x71'),_0xe19b('0x72'),_0xe19b('0x73'),_0xe19b('0x74'),_0xe19b('0x75'),_0xe19b('0x76'),_0xe19b('0x77'),_0xe19b('0x78'),_0xe19b('0x79'),_0xe19b('0x7a'),_0xe19b('0x7b'),'short_description',_0xe19b('0x59'),_0xe19b('0x7c'),_0xe19b('0x7d'),_0xe19b('0x7e'),_0xe19b('0x7f'),_0xe19b('0x80'),_0xe19b('0x81'),_0xe19b('0x82'),'calendar_duration',_0xe19b('0x5a'),'sys_class_name',_0xe19b('0x83'),_0xe19b('0x84'),_0xe19b('0x85'),_0xe19b('0x86'),_0xe19b('0x87'),'contact_type',_0xe19b('0x88'),_0xe19b('0x5b'),_0xe19b('0x89'),_0xe19b('0x8a'),_0xe19b('0x8b'),'reassignment_count','activity_due',_0xe19b('0x8c'),_0xe19b('0x5c'),'comments',_0xe19b('0x8d'),_0xe19b('0x8e'),'comments_and_work_notes','due_date',_0xe19b('0x8f'),_0xe19b('0x90'),_0xe19b('0x91'),'escalation',_0xe19b('0x92'),'correlation_id',_0xe19b('0x93'),_0xe19b('0x5d')];var _0x47cef8='';var _0x5929c8='';var _0x216c8f=[];var _0x1dd602='';var _0x5bd50a='';var _0x12eec4=[];var _0x51d8bf='';var _0x20575c='';var _0x34904d={};var _0x44c2f7='';return db['ServicenowAccount'][_0xe19b('0x4b')]({'where':{'id':_0x213a76[_0xe19b('0x45')]['id']},'attributes':['id','username',_0xe19b('0x94'),_0xe19b('0x95'),_0xe19b('0x96'),_0xe19b('0x97')]})['then'](handleEntityNotFound(_0x4ec120,null))[_0xe19b('0x25')](function(_0x2b5252){if(_0x2b5252){_0x44c2f7=_0x2b5252[_0xe19b('0x96')];var _0x42a10e=_0x44c2f7[_0xe19b('0x98')](-0x1);if(_0x42a10e==='/'){_0x44c2f7=_0x44c2f7[_0xe19b('0x99')](0x0,_0x44c2f7[_0xe19b('0x9a')](_0x42a10e));}_0x20575c=util[_0xe19b('0x9b')](_0xe19b('0x9c'),_0x44c2f7);_0x51d8bf=util['format']('%s/api/now/table/',_0x44c2f7);_0x34904d={'user':_0x2b5252['username'],'pass':_0x2b5252[_0xe19b('0x94')]};var _0x552e9c={'method':'GET','uri':_0x20575c+_0xe19b('0x9d'),'auth':_0x34904d,'json':!![]};return rp(_0x552e9c);}})[_0xe19b('0x25')](function(_0x2e061f){if(_0x2e061f[_0xe19b('0x9e')][_0xe19b('0x46')]>0x0){_0x47cef8=_0x2e061f[_0xe19b('0x9e')];}console[_0xe19b('0x9f')](_0xe19b('0xa0'),_0x47cef8);_0x12eec4=[];_0x5929c8=Object[_0xe19b('0xa1')]([],_0x47cef8);_[_0xe19b('0xa2')](_0x5929c8,function(_0x26ec29){return!_0x453989[_0xe19b('0xa3')](_0x26ec29[_0xe19b('0x29')]);});_0x5929c8[_0xe19b('0xa4')](function(_0xd0bab4){var _0x5f24d9=createFieldObject(_0x51d8bf,_0x34904d,_0xd0bab4[_0xe19b('0xa5')],_0xd0bab4[_0xe19b('0x29')],_0xd0bab4[_0xe19b('0xa6')],![]);_0x12eec4[_0xe19b('0xa7')](_0x5f24d9);});return Promise[_0xe19b('0xa8')](_0x12eec4);})[_0xe19b('0x25')](function(_0x355ae0){_0x216c8f=_0x355ae0;_0x1dd602=Object[_0xe19b('0xa1')]([],_0x47cef8);console['log'](_0xe19b('0xa9'),_0x47cef8);_[_0xe19b('0xa2')](_0x1dd602,function(_0x165dbf){return _0x19f7bb[_0xe19b('0xa3')](_0x165dbf['name']);});console['log'](_0xe19b('0xaa'),_0x1dd602);_0x12eec4=[];_0x1dd602[_0xe19b('0xa4')](function(_0x32d72c){var _0x5c2fa0=createFieldObject(_0x51d8bf,_0x34904d,_0x32d72c['internalType'],_0x32d72c[_0xe19b('0x29')],_0x32d72c[_0xe19b('0xa6')],!![]);_0x12eec4[_0xe19b('0xa7')](_0x5c2fa0);});return Promise[_0xe19b('0xa8')](_0x12eec4);})[_0xe19b('0x25')](function(_0x38c052){_0x5bd50a=_0x38c052;var _0xb0055a=_0x216c8f['concat'](_0x5bd50a);return{'count':_0xb0055a['length'],'rows':_0xb0055a};})[_0xe19b('0x25')](respondWithResult(_0x4ec120,null))[_0xe19b('0x48')](function(_0x492ffd){console[_0xe19b('0x9f')]('ServiceNow\x20error:\x20'+_0x492ffd);var _0x2e49c3=_0x213a76[_0xe19b('0x30')][_0xe19b('0xab')]?0x1f4:_0x492ffd[_0xe19b('0xac')]||0x1f4;logger['error'](_0x492ffd[_0xe19b('0x28')]);delete _0x492ffd[_0xe19b('0x29')];if(_0x2e49c3===0x191){_0x2e49c3=0x190;}_0x4ec120[_0xe19b('0x1c')](_0x2e49c3)[_0xe19b('0xad')](_0x213a76['query'][_0xe19b('0xab')]?{'message':_0xe19b('0xae'),'statusCode':_0x492ffd[_0xe19b('0xac')]}:_0x492ffd);});};function createFieldObject(_0x5bd530,_0x3fb7a6,_0x3852ad,_0x38add8,_0x1a2c5e,_0x5c039c){return new Promise(function(_0x18c5e6,_0x13b50a){var _0x45bb2f={'id':_0x38add8,'name':_0x1a2c5e,'custom':_0x5c039c};if(_0x3852ad===_0xe19b('0xaf')){_0x45bb2f['options']=[{'name':'True','value':_0xe19b('0xb0')},{'name':'False','value':_0xe19b('0xb1')}];_0x18c5e6(_0x45bb2f);}else{var _0x4623da={'method':_0xe19b('0xb2'),'uri':_0x5bd530+_0xe19b('0xb3')+_0x38add8,'auth':_0x3fb7a6,'json':!![]};return rp(_0x4623da)[_0xe19b('0x25')](function(_0x3240e1){var _0x48c40f=[];if(_0x3240e1[_0xe19b('0x9e')][_0xe19b('0x46')]>0x0){_0x3240e1[_0xe19b('0x9e')][_0xe19b('0xa4')](function(_0x24faa7){if(_0x24faa7[_0xe19b('0xb4')]==='false'){var _0x1b0c26={'name':_0x24faa7['label'],'value':_0x24faa7[_0xe19b('0xb5')]};_0x48c40f[_0xe19b('0xa7')](_0x1b0c26);}});}_0x45bb2f[_0xe19b('0x41')]=_0x48c40f;if(_0x45bb2f[_0xe19b('0x41')][_0xe19b('0x46')]>0x0){_0x18c5e6(_0x45bb2f);}else{if(_0x5c039c==![]){_0x18c5e6();}else{_0x18c5e6(_0x45bb2f);}}});}});} \ No newline at end of file +var _0x2040=['pick','addConfiguration','getSubjects','channel','Descriptions','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','calendar_stc','closed_at','active','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','urgency','problem_id','company','reassignment_count','activity_due','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result','log','assign','remove','includes','forEach','internalType','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','push','concat','test','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','zip-dir','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','getConfigurations','findOne','ServicenowConfiguration'];(function(_0x4bfd95,_0x1c3b3b){var _0x1484cd=function(_0x2c622b){while(--_0x2c622b){_0x4bfd95['push'](_0x4bfd95['shift']());}};_0x1484cd(++_0x1c3b3b);}(_0x2040,0x127));var _0x0204=function(_0x1f0ebd,_0x2005fb){_0x1f0ebd=_0x1f0ebd-0x0;var _0x5b35f7=_0x2040[_0x1f0ebd];return _0x5b35f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0204('0x0'));var zipdir=require(_0x0204('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0204('0x2'));var moment=require('moment');var BPromise=require(_0x0204('0x3'));var Mustache=require('mustache');var util=require(_0x0204('0x4'));var path=require(_0x0204('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0204('0x6'));var fs=require('fs');var fs_extra=require(_0x0204('0x7'));var _=require(_0x0204('0x8'));var squel=require(_0x0204('0x9'));var crypto=require(_0x0204('0xa'));var jsforce=require(_0x0204('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0204('0xc'));var querystring=require(_0x0204('0xd'));var Papa=require('papaparse');var Redis=require(_0x0204('0xe'));var authService=require(_0x0204('0xf'));var qs=require(_0x0204('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0204('0x11'));var logger=require('../../config/logger')(_0x0204('0x12'));var utils=require(_0x0204('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0204('0x14'));var db=require(_0x0204('0x15'))['db'];var integrations=require(_0x0204('0x16'));function respondWithStatusCode(_0x2e08a9,_0x1eba28){_0x1eba28=_0x1eba28||0xcc;return function(_0x1d6cb6){if(_0x1d6cb6){return _0x2e08a9[_0x0204('0x17')](_0x1eba28);}return _0x2e08a9['status'](_0x1eba28)[_0x0204('0x18')]();};}function respondWithResult(_0x22797d,_0x5923f8){_0x5923f8=_0x5923f8||0xc8;return function(_0x4df2f4){if(_0x4df2f4){return _0x22797d[_0x0204('0x19')](_0x5923f8)['json'](_0x4df2f4);}};}function respondWithFilteredResult(_0x37987e,_0x27b614){return function(_0x14b467){if(_0x14b467){var _0x2b631f=typeof _0x27b614[_0x0204('0x1a')]===_0x0204('0x1b')&&typeof _0x27b614['limit']===_0x0204('0x1b');var _0x1d7db7=_0x14b467[_0x0204('0x1c')];var _0x3013c0=_0x2b631f?0x0:_0x27b614[_0x0204('0x1a')];var _0x2d436d=_0x2b631f?_0x14b467['count']:_0x27b614[_0x0204('0x1a')]+_0x27b614[_0x0204('0x1d')];var _0x2a981d;if(_0x2d436d>=_0x1d7db7){_0x2d436d=_0x1d7db7;_0x2a981d=0xc8;}else{_0x2a981d=0xce;}_0x37987e[_0x0204('0x19')](_0x2a981d);return _0x37987e[_0x0204('0x1e')](_0x0204('0x1f'),_0x3013c0+'-'+_0x2d436d+'/'+_0x1d7db7)[_0x0204('0x20')](_0x14b467);}return null;};}function patchUpdates(_0x3158a5){return function(_0x1905a4){try{jsonpatch[_0x0204('0x21')](_0x1905a4,_0x3158a5,!![]);}catch(_0x10fac9){return BPromise[_0x0204('0x22')](_0x10fac9);}return _0x1905a4[_0x0204('0x23')]();};}function saveUpdates(_0x2cdef9,_0x2a46d3){return function(_0x1478af){if(_0x1478af){return _0x1478af['update'](_0x2cdef9)['then'](function(_0x1b9548){return _0x1b9548;});}return null;};}function removeEntity(_0x95ab74,_0x172ea5){return function(_0x2c8e5a){if(_0x2c8e5a){return _0x2c8e5a[_0x0204('0x24')]()[_0x0204('0x25')](function(){_0x95ab74[_0x0204('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208752,_0xda8f16){return function(_0x121fb1){if(!_0x121fb1){_0x208752[_0x0204('0x17')](0x194);}return _0x121fb1;};}function handleError(_0x2cdc1d,_0x161dbf){_0x161dbf=_0x161dbf||0x1f4;return function(_0x2a9a7f){logger[_0x0204('0x26')](_0x2a9a7f[_0x0204('0x27')]);if(_0x2a9a7f[_0x0204('0x28')]){delete _0x2a9a7f[_0x0204('0x28')];}_0x2cdc1d[_0x0204('0x19')](_0x161dbf)[_0x0204('0x29')](_0x2a9a7f);};}exports[_0x0204('0x2a')]=function(_0x6eb679,_0x1f29a5){var _0x4b761c={},_0x140dc9={},_0x210201={'count':0x0,'rows':[]};var _0x1ffbb9=_['map'](db[_0x0204('0x2b')][_0x0204('0x2c')],function(_0x1c7d43){return{'name':_0x1c7d43[_0x0204('0x2d')],'type':_0x1c7d43[_0x0204('0x2e')][_0x0204('0x2f')]};});_0x140dc9['model']=_['map'](_0x1ffbb9,_0x0204('0x28'));_0x140dc9[_0x0204('0x30')]=_['keys'](_0x6eb679[_0x0204('0x30')]);_0x140dc9[_0x0204('0x31')]=_[_0x0204('0x32')](_0x140dc9['model'],_0x140dc9[_0x0204('0x30')]);_0x4b761c[_0x0204('0x33')]=_[_0x0204('0x32')](_0x140dc9[_0x0204('0x34')],qs[_0x0204('0x35')](_0x6eb679[_0x0204('0x30')][_0x0204('0x35')]));_0x4b761c[_0x0204('0x33')]=_0x4b761c[_0x0204('0x33')][_0x0204('0x36')]?_0x4b761c[_0x0204('0x33')]:_0x140dc9[_0x0204('0x34')];if(!_0x6eb679['query']['hasOwnProperty'](_0x0204('0x37'))){_0x4b761c[_0x0204('0x1d')]=qs[_0x0204('0x1d')](_0x6eb679[_0x0204('0x30')][_0x0204('0x1d')]);_0x4b761c[_0x0204('0x1a')]=qs['offset'](_0x6eb679[_0x0204('0x30')]['offset']);}_0x4b761c[_0x0204('0x38')]=qs[_0x0204('0x39')](_0x6eb679[_0x0204('0x30')][_0x0204('0x39')]);_0x4b761c[_0x0204('0x3a')]=qs[_0x0204('0x31')](_['pick'](_0x6eb679['query'],_0x140dc9['filters']),_0x1ffbb9);if(_0x6eb679['query'][_0x0204('0x3b')]){_0x4b761c[_0x0204('0x3a')]=_['merge'](_0x4b761c[_0x0204('0x3a')],{'$or':_[_0x0204('0x3c')](_0x1ffbb9,function(_0x4d2214){if(_0x4d2214['type']!==_0x0204('0x3d')){var _0x3d861={};_0x3d861[_0x4d2214[_0x0204('0x28')]]={'$like':'%'+_0x6eb679[_0x0204('0x30')][_0x0204('0x3b')]+'%'};return _0x3d861;}})});}_0x4b761c=_[_0x0204('0x3e')]({},_0x4b761c,_0x6eb679[_0x0204('0x3f')]);var _0x47e72c={'where':_0x4b761c[_0x0204('0x3a')]};return db[_0x0204('0x2b')][_0x0204('0x1c')](_0x47e72c)['then'](function(_0x5516a8){_0x210201[_0x0204('0x1c')]=_0x5516a8;if(_0x6eb679['query'][_0x0204('0x40')]){_0x4b761c[_0x0204('0x41')]=[{'all':!![]}];}return db[_0x0204('0x2b')][_0x0204('0x42')](_0x4b761c);})[_0x0204('0x25')](function(_0x29b476){_0x210201[_0x0204('0x43')]=_0x29b476;return _0x210201;})[_0x0204('0x25')](respondWithFilteredResult(_0x1f29a5,_0x4b761c))[_0x0204('0x44')](handleError(_0x1f29a5,null));};exports[_0x0204('0x45')]=function(_0x3acc76,_0x49650c){var _0x587f21={'raw':![],'where':{'id':_0x3acc76[_0x0204('0x46')]['id']}},_0x443c50={};_0x443c50[_0x0204('0x34')]=_['keys'](db[_0x0204('0x2b')][_0x0204('0x2c')]);_0x443c50[_0x0204('0x30')]=_[_0x0204('0x47')](_0x3acc76[_0x0204('0x30')]);_0x443c50[_0x0204('0x31')]=_['intersection'](_0x443c50['model'],_0x443c50['query']);_0x587f21[_0x0204('0x33')]=_[_0x0204('0x32')](_0x443c50['model'],qs[_0x0204('0x35')](_0x3acc76[_0x0204('0x30')][_0x0204('0x35')]));_0x587f21[_0x0204('0x33')]=_0x587f21[_0x0204('0x33')][_0x0204('0x36')]?_0x587f21[_0x0204('0x33')]:_0x443c50[_0x0204('0x34')];if(_0x3acc76['query'][_0x0204('0x40')]){_0x587f21[_0x0204('0x41')]=[{'all':!![]}];}_0x587f21=_[_0x0204('0x3e')]({},_0x587f21,_0x3acc76[_0x0204('0x3f')]);return db['ServicenowAccount'][_0x0204('0x48')](_0x587f21)[_0x0204('0x25')](handleEntityNotFound(_0x49650c,null))[_0x0204('0x25')](respondWithResult(_0x49650c,null))[_0x0204('0x44')](handleError(_0x49650c,null));};exports[_0x0204('0x49')]=function(_0x39ad51,_0x3b7bcb){return db['ServicenowAccount'][_0x0204('0x49')](_0x39ad51[_0x0204('0x4a')],{})['then'](respondWithResult(_0x3b7bcb,0xc9))[_0x0204('0x44')](handleError(_0x3b7bcb,null));};exports[_0x0204('0x4b')]=function(_0x3b9976,_0x531109){if(_0x3b9976[_0x0204('0x4a')]['id']){delete _0x3b9976[_0x0204('0x4a')]['id'];}return db[_0x0204('0x2b')][_0x0204('0x48')]({'where':{'id':_0x3b9976[_0x0204('0x46')]['id']}})[_0x0204('0x25')](handleEntityNotFound(_0x531109,null))[_0x0204('0x25')](saveUpdates(_0x3b9976['body'],null))['then'](respondWithResult(_0x531109,null))[_0x0204('0x44')](handleError(_0x531109,null));};exports['destroy']=function(_0x2d405c,_0x1af7b4){return db[_0x0204('0x2b')]['find']({'where':{'id':_0x2d405c[_0x0204('0x46')]['id']}})[_0x0204('0x25')](handleEntityNotFound(_0x1af7b4,null))[_0x0204('0x25')](removeEntity(_0x1af7b4,null))['catch'](handleError(_0x1af7b4,null));};exports[_0x0204('0x4c')]=function(_0x534d0e,_0x37644f,_0x5eb71f){var _0x340763={};var _0x1625a5={};var _0x4e322e;var _0x4d4cf1;return db[_0x0204('0x2b')][_0x0204('0x4d')]({'where':{'id':_0x534d0e[_0x0204('0x46')]['id']}})['then'](handleEntityNotFound(_0x37644f,null))[_0x0204('0x25')](function(_0x5657dd){if(_0x5657dd){_0x4e322e=_0x5657dd;_0x1625a5[_0x0204('0x34')]=_[_0x0204('0x47')](db[_0x0204('0x4e')][_0x0204('0x2c')]);_0x1625a5[_0x0204('0x30')]=_[_0x0204('0x47')](_0x534d0e[_0x0204('0x30')]);_0x1625a5[_0x0204('0x31')]=_[_0x0204('0x32')](_0x1625a5[_0x0204('0x34')],_0x1625a5[_0x0204('0x30')]);_0x340763['attributes']=_['intersection'](_0x1625a5[_0x0204('0x34')],qs[_0x0204('0x35')](_0x534d0e[_0x0204('0x30')][_0x0204('0x35')]));_0x340763[_0x0204('0x33')]=_0x340763[_0x0204('0x33')][_0x0204('0x36')]?_0x340763['attributes']:_0x1625a5[_0x0204('0x34')];_0x340763[_0x0204('0x38')]=qs[_0x0204('0x39')](_0x534d0e[_0x0204('0x30')]['sort']);_0x340763[_0x0204('0x3a')]=qs[_0x0204('0x31')](_[_0x0204('0x4f')](_0x534d0e[_0x0204('0x30')],_0x1625a5[_0x0204('0x31')]));if(_0x534d0e['query'][_0x0204('0x3b')]){_0x340763[_0x0204('0x3a')]=_[_0x0204('0x3e')](_0x340763[_0x0204('0x3a')],{'$or':_[_0x0204('0x3c')](_0x340763[_0x0204('0x33')],function(_0x22f02e){var _0x307085={};_0x307085[_0x22f02e]={'$like':'%'+_0x534d0e[_0x0204('0x30')][_0x0204('0x3b')]+'%'};return _0x307085;})});}_0x340763=_['merge']({},_0x340763,_0x534d0e[_0x0204('0x3f')]);return _0x4e322e[_0x0204('0x4c')](_0x340763);}})[_0x0204('0x25')](function(_0xaece1f){if(_0xaece1f){_0x4d4cf1=_0xaece1f[_0x0204('0x36')];if(!_0x534d0e[_0x0204('0x30')]['hasOwnProperty'](_0x0204('0x37'))){_0x340763['limit']=qs[_0x0204('0x1d')](_0x534d0e[_0x0204('0x30')]['limit']);_0x340763[_0x0204('0x1a')]=qs['offset'](_0x534d0e[_0x0204('0x30')][_0x0204('0x1a')]);}return _0x4e322e['getConfigurations'](_0x340763);}})['then'](function(_0xb426df){if(_0xb426df){return _0xb426df?{'count':_0x4d4cf1,'rows':_0xb426df}:null;}})[_0x0204('0x25')](respondWithResult(_0x37644f,null))['catch'](handleError(_0x37644f,null));};exports[_0x0204('0x50')]=function(_0x2696b3,_0x1d86a5,_0x5e1e37){if(_0x2696b3[_0x0204('0x4a')]['id']){delete _0x2696b3[_0x0204('0x4a')]['id'];}return db['ServicenowAccount'][_0x0204('0x4d')]({'where':{'id':_0x2696b3[_0x0204('0x46')]['id']}})[_0x0204('0x25')](handleEntityNotFound(_0x1d86a5,null))[_0x0204('0x25')](function(_0x28aa1b){if(_0x28aa1b){_0x2696b3['body']['AccountId']=_0x28aa1b['id'];_0x2696b3[_0x0204('0x4a')]['Subjects']=integrations[_0x0204('0x51')](_0x2696b3['body'][_0x0204('0x52')],_0x2696b3[_0x0204('0x4a')]['type']);_0x2696b3[_0x0204('0x4a')][_0x0204('0x53')]=integrations['getDescriptions'](_0x2696b3['body']['channel'],_0x2696b3[_0x0204('0x4a')][_0x0204('0x2e')]);return db[_0x0204('0x4e')][_0x0204('0x49')](_0x2696b3[_0x0204('0x4a')],{'include':[{'model':db[_0x0204('0x54')],'as':_0x0204('0x55')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x0204('0x25')](respondWithResult(_0x1d86a5,null))[_0x0204('0x44')](handleError(_0x1d86a5,null));};exports[_0x0204('0x56')]=function(_0x585e2e,_0x49a4cf,_0x58b363){var _0x5b44b2=[_0x0204('0x57'),_0x0204('0x58'),_0x0204('0x59'),_0x0204('0x5a'),'close_code',_0x0204('0x5b'),_0x0204('0x5c'),'severity',_0x0204('0x5d')];var _0x4d77ea=[_0x0204('0x5e'),'made_sla',_0x0204('0x5f'),_0x0204('0x60'),_0x0204('0x61'),_0x0204('0x62'),_0x0204('0x63'),_0x0204('0x58'),_0x0204('0x64'),_0x0204('0x65'),_0x0204('0x66'),_0x0204('0x67'),_0x0204('0x68'),_0x0204('0x69'),_0x0204('0x6a'),_0x0204('0x6b'),'state','sys_created_by',_0x0204('0x59'),_0x0204('0x38'),_0x0204('0x6c'),_0x0204('0x6d'),'cmdb_ci','delivery_plan','impact',_0x0204('0x6e'),'work_notes_list','business_service',_0x0204('0x6f'),_0x0204('0x70'),_0x0204('0x71'),_0x0204('0x72'),'expected_start',_0x0204('0x73'),_0x0204('0x74'),_0x0204('0x75'),_0x0204('0x76'),_0x0204('0x77'),_0x0204('0x78'),_0x0204('0x79'),_0x0204('0x7a'),'subcategory',_0x0204('0x7b'),'short_description','close_code',_0x0204('0x7c'),'delivery_task',_0x0204('0x7d'),_0x0204('0x7e'),_0x0204('0x7f'),_0x0204('0x80'),_0x0204('0x81'),_0x0204('0x82'),_0x0204('0x5b'),_0x0204('0x83'),_0x0204('0x84'),_0x0204('0x85'),_0x0204('0x86'),_0x0204('0x87'),_0x0204('0x88'),'contact_type','reopened_by',_0x0204('0x5c'),_0x0204('0x89'),_0x0204('0x8a'),_0x0204('0x8b'),_0x0204('0x8c'),_0x0204('0x8d'),'assigned_to',_0x0204('0x8e'),_0x0204('0x8f'),_0x0204('0x90'),_0x0204('0x91'),_0x0204('0x92'),_0x0204('0x93'),_0x0204('0x94'),_0x0204('0x95'),'sys_tags','escalation',_0x0204('0x96'),_0x0204('0x97'),_0x0204('0x98'),'category'];var _0x27570a='';var _0x5e9058='';var _0x528df9=[];var _0x2d082d='';var _0x1cf9b6='';var _0x4360b3=[];var _0x53854='';var _0x312f4a='';var _0x378d47={};var _0x627e6='';return db[_0x0204('0x2b')]['findOne']({'where':{'id':_0x585e2e[_0x0204('0x46')]['id']},'attributes':['id',_0x0204('0x99'),_0x0204('0x9a'),_0x0204('0x9b'),_0x0204('0x9c'),_0x0204('0x9d')]})[_0x0204('0x25')](handleEntityNotFound(_0x49a4cf,null))['then'](function(_0x1623c9){if(_0x1623c9){_0x627e6=_0x1623c9[_0x0204('0x9c')];var _0xa219af=_0x627e6[_0x0204('0x9e')](-0x1);if(_0xa219af==='/'){_0x627e6=_0x627e6[_0x0204('0x9f')](0x0,_0x627e6['lastIndexOf'](_0xa219af));}_0x312f4a=util[_0x0204('0xa0')](_0x0204('0xa1'),_0x627e6);_0x53854=util[_0x0204('0xa0')](_0x0204('0xa2'),_0x627e6);_0x378d47={'user':_0x1623c9[_0x0204('0x99')],'pass':_0x1623c9[_0x0204('0x9a')]};var _0x16a440={'method':_0x0204('0xa3'),'uri':_0x312f4a+'incident?sysparm_display_value=all','auth':_0x378d47,'json':!![]};return rp(_0x16a440);}})[_0x0204('0x25')](function(_0x15db8b){if(_0x15db8b[_0x0204('0xa4')][_0x0204('0x36')]>0x0){_0x27570a=_0x15db8b[_0x0204('0xa4')];}console[_0x0204('0xa5')]('incident\x20table\x20objects',_0x27570a);_0x4360b3=[];_0x5e9058=Object[_0x0204('0xa6')]([],_0x27570a);_[_0x0204('0xa7')](_0x5e9058,function(_0x265471){return!_0x5b44b2[_0x0204('0xa8')](_0x265471[_0x0204('0x28')]);});_0x5e9058[_0x0204('0xa9')](function(_0x191b72){var _0x4f5f17=createFieldObject(_0x53854,_0x378d47,_0x191b72[_0x0204('0xaa')],_0x191b72['name'],_0x191b72['label'],![]);_0x4360b3['push'](_0x4f5f17);});return Promise[_0x0204('0xab')](_0x4360b3);})[_0x0204('0x25')](function(_0x1a1fb1){_0x528df9=_0x1a1fb1;_0x2d082d=Object[_0x0204('0xa6')]([],_0x27570a);console['log'](_0x0204('0xac'),_0x27570a);_[_0x0204('0xa7')](_0x2d082d,function(_0xd0a258){return _0x4d77ea[_0x0204('0xa8')](_0xd0a258[_0x0204('0x28')]);});console['log'](_0x0204('0xad'),_0x2d082d);_0x4360b3=[];_0x2d082d[_0x0204('0xa9')](function(_0x15c576){var _0x75e4ee=createFieldObject(_0x53854,_0x378d47,_0x15c576[_0x0204('0xaa')],_0x15c576[_0x0204('0x28')],_0x15c576[_0x0204('0xae')],!![]);_0x4360b3[_0x0204('0xaf')](_0x75e4ee);});return Promise[_0x0204('0xab')](_0x4360b3);})[_0x0204('0x25')](function(_0x16cb7c){_0x1cf9b6=_0x16cb7c;var _0x1ce93b=_0x528df9[_0x0204('0xb0')](_0x1cf9b6);return{'count':_0x1ce93b[_0x0204('0x36')],'rows':_0x1ce93b};})['then'](respondWithResult(_0x49a4cf,null))['catch'](function(_0x252d88){console[_0x0204('0xa5')]('ServiceNow\x20error:\x20'+_0x252d88);var _0x270704=_0x585e2e[_0x0204('0x30')][_0x0204('0xb1')]?0x1f4:_0x252d88[_0x0204('0xb2')]||0x1f4;logger[_0x0204('0x26')](_0x252d88[_0x0204('0x27')]);delete _0x252d88[_0x0204('0x28')];if(_0x270704===0x191){_0x270704=0x190;}_0x49a4cf[_0x0204('0x19')](_0x270704)['send'](_0x585e2e[_0x0204('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x252d88[_0x0204('0xb2')]}:_0x252d88);});};function createFieldObject(_0xc384d3,_0x3f9704,_0xf18b15,_0x338a2a,_0x19e563,_0x44d4dc){return new Promise(function(_0x2aa83b,_0x28dd56){var _0x488a9e={'id':_0x338a2a,'name':_0x19e563,'custom':_0x44d4dc};if(_0xf18b15===_0x0204('0xb3')){_0x488a9e[_0x0204('0x3f')]=[{'name':_0x0204('0xb4'),'value':_0x0204('0xb5')},{'name':_0x0204('0xb6'),'value':_0x0204('0xb7')}];_0x2aa83b(_0x488a9e);}else{var _0x43cf7c={'method':'GET','uri':_0xc384d3+_0x0204('0xb8')+_0x338a2a,'auth':_0x3f9704,'json':!![]};return rp(_0x43cf7c)['then'](function(_0x3647f9){var _0x1027c1=[];if(_0x3647f9['result'][_0x0204('0x36')]>0x0){_0x3647f9[_0x0204('0xa4')]['forEach'](function(_0xbb53c9){if(_0xbb53c9[_0x0204('0xb9')]===_0x0204('0xb7')){var _0x29de2b={'name':_0xbb53c9[_0x0204('0xae')],'value':_0xbb53c9[_0x0204('0xba')]};_0x1027c1[_0x0204('0xaf')](_0x29de2b);}});}_0x488a9e[_0x0204('0x3f')]=_0x1027c1;if(_0x488a9e['options'][_0x0204('0x36')]>0x0){_0x2aa83b(_0x488a9e);}else{if(_0x44d4dc==![]){_0x2aa83b();}else{_0x2aa83b(_0x488a9e);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 1081cd6..4b200e5 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 _0xeda8=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x134c72,_0x29aae6){var _0x36d3fc=function(_0x178ce3){while(--_0x178ce3){_0x134c72['push'](_0x134c72['shift']());}};_0x36d3fc(++_0x29aae6);}(_0xeda8,0x104));var _0x8eda=function(_0x6957c9,_0x57e6f3){_0x6957c9=_0x6957c9-0x0;var _0x7e1b2e=_0xeda8[_0x6957c9];return _0x7e1b2e;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));var integrations=require(_0x8eda('0xa'));module[_0x8eda('0xb')]=function(_0x349361,_0x32abe8){return _0x349361['define'](_0x8eda('0xc'),attributes,{'tableName':_0x8eda('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f8a=['exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x5ccedb,_0x519aae){_0x5ccedb=_0x5ccedb-0x0;var _0x17b4f8=_0x3f8a[_0x5ccedb];return _0x17b4f8;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));var integrations=require(_0xa3f8('0xa'));module[_0xa3f8('0xb')]=function(_0x1f160a,_0xf895d9){return _0x1f160a[_0xa3f8('0xc')](_0xa3f8('0xd'),attributes,{'tableName':_0xa3f8('0xe'),'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 be0bd1d..60fe89d 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 _0x8659=['then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ServicenowAccount','findAll','options','raw','where','attributes','include','model','map','GetServicenowAccount','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2aee2f,_0xad9887){var _0x19337f=function(_0x2e62d){while(--_0x2e62d){_0x2aee2f['push'](_0x2aee2f['shift']());}};_0x19337f(++_0xad9887);}(_0x8659,0x1d2));var _0x9865=function(_0x44a749,_0x5e6c20){_0x44a749=_0x44a749-0x0;var _0x4e379f=_0x8659[_0x44a749];return _0x4e379f;};'use strict';var _=require(_0x9865('0x0'));var util=require(_0x9865('0x1'));var moment=require(_0x9865('0x2'));var BPromise=require(_0x9865('0x3'));var rs=require(_0x9865('0x4'));var fs=require('fs');var Redis=require(_0x9865('0x5'));var db=require(_0x9865('0x6'))['db'];var utils=require(_0x9865('0x7'));var logger=require(_0x9865('0x8'))(_0x9865('0x9'));var config=require(_0x9865('0xa'));var jayson=require(_0x9865('0xb'));var client=jayson[_0x9865('0xc')][_0x9865('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xcc4f5b,_0x16a16f,_0x2801c8){return new BPromise(function(_0x16e515,_0x3d6d2a){return client[_0x9865('0xe')](_0xcc4f5b,_0x2801c8)[_0x9865('0xf')](function(_0x1ba6d2){logger[_0x9865('0x10')](_0x9865('0x11'),_0x16a16f,_0x9865('0x12'));logger[_0x9865('0x13')](_0x9865('0x14'),_0x16a16f,_0x9865('0x12'),JSON[_0x9865('0x15')](_0x1ba6d2));if(_0x1ba6d2[_0x9865('0x16')]){if(_0x1ba6d2['error'][_0x9865('0x17')]===0x1f4){logger['error'](_0x9865('0x11'),_0x16a16f,_0x1ba6d2[_0x9865('0x16')]['message']);return _0x3d6d2a(_0x1ba6d2[_0x9865('0x16')][_0x9865('0x18')]);}logger[_0x9865('0x16')](_0x9865('0x11'),_0x16a16f,_0x1ba6d2[_0x9865('0x16')][_0x9865('0x18')]);return _0x16e515(_0x1ba6d2['error'][_0x9865('0x18')]);}else{logger['info'](_0x9865('0x11'),_0x16a16f,_0x9865('0x12'));_0x16e515(_0x1ba6d2['result'][_0x9865('0x18')]);}})[_0x9865('0x19')](function(_0x2024e4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x16a16f,_0x2024e4);_0x3d6d2a(_0x2024e4);});});}exports['GetServicenowAccount']=function(_0x293f8d){var _0x1c6995=this;return new Promise(function(_0x1c926a,_0x4a8446){return db[_0x9865('0x1a')][_0x9865('0x1b')]({'raw':_0x293f8d['options']?_0x293f8d[_0x9865('0x1c')][_0x9865('0x1d')]===undefined?!![]:![]:!![],'where':_0x293f8d['options']?_0x293f8d[_0x9865('0x1c')][_0x9865('0x1e')]||null:null,'attributes':_0x293f8d[_0x9865('0x1c')]?_0x293f8d[_0x9865('0x1c')][_0x9865('0x1f')]||null:null,'limit':_0x293f8d['options']?_0x293f8d['options']['limit']||null:null,'include':_0x293f8d[_0x9865('0x1c')]?_0x293f8d[_0x9865('0x1c')][_0x9865('0x20')]?_['map'](_0x293f8d[_0x9865('0x1c')][_0x9865('0x20')],function(_0x285813){return{'model':db[_0x285813[_0x9865('0x21')]],'as':_0x285813['as'],'attributes':_0x285813['attributes'],'include':_0x285813[_0x9865('0x20')]?_[_0x9865('0x22')](_0x285813[_0x9865('0x20')],function(_0x17d1bd){return{'model':db[_0x17d1bd['model']],'as':_0x17d1bd['as'],'attributes':_0x17d1bd[_0x9865('0x1f')],'include':_0x17d1bd[_0x9865('0x20')]?_['map'](_0x17d1bd[_0x9865('0x20')],function(_0x100318){return{'model':db[_0x100318['model']],'as':_0x100318['as'],'attributes':_0x100318[_0x9865('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9865('0xf')](function(_0x5d7b99){logger[_0x9865('0x10')](_0x9865('0x23'),_0x293f8d);logger['debug'](_0x9865('0x23'),_0x293f8d,JSON['stringify'](_0x5d7b99));_0x1c926a(_0x5d7b99);})['catch'](function(_0x5ab917){logger[_0x9865('0x16')]('GetServicenowAccount',_0x5ab917[_0x9865('0x18')],_0x293f8d);_0x4a8446(_0x1c6995[_0x9865('0x16')](0x1f4,_0x5ab917[_0x9865('0x18')]));});});};exports[_0x9865('0x24')]=function(_0x14542f){var _0x4ebeec=this;return new Promise(function(_0x245106,_0x4fe651){return db[_0x9865('0x1a')]['find']({'raw':_0x14542f[_0x9865('0x1c')]?_0x14542f['options'][_0x9865('0x1d')]===undefined?!![]:![]:!![],'where':_0x14542f[_0x9865('0x1c')]?_0x14542f[_0x9865('0x1c')][_0x9865('0x1e')]||null:null,'attributes':_0x14542f['options']?_0x14542f['options'][_0x9865('0x1f')]||null:null,'include':_0x14542f[_0x9865('0x1c')]?_0x14542f[_0x9865('0x1c')][_0x9865('0x20')]?_[_0x9865('0x22')](_0x14542f[_0x9865('0x1c')]['include'],function(_0x23da48){return{'model':db[_0x23da48[_0x9865('0x21')]],'as':_0x23da48['as'],'attributes':_0x23da48['attributes'],'include':_0x23da48[_0x9865('0x20')]?_['map'](_0x23da48[_0x9865('0x20')],function(_0x34f2de){return{'model':db[_0x34f2de[_0x9865('0x21')]],'as':_0x34f2de['as'],'attributes':_0x34f2de['attributes'],'include':_0x34f2de['include']?_[_0x9865('0x22')](_0x34f2de[_0x9865('0x20')],function(_0x1281f8){return{'model':db[_0x1281f8[_0x9865('0x21')]],'as':_0x1281f8['as'],'attributes':_0x1281f8[_0x9865('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9865('0xf')](function(_0xe92376){logger[_0x9865('0x10')](_0x9865('0x24'),_0x14542f);logger[_0x9865('0x13')](_0x9865('0x24'),_0x14542f,JSON[_0x9865('0x15')](_0xe92376));_0x245106(_0xe92376);})[_0x9865('0x19')](function(_0x1c983a){logger[_0x9865('0x16')]('ShowServicenowAccount',_0x1c983a[_0x9865('0x18')],_0x14542f);_0x4fe651(_0x4ebeec[_0x9865('0x16')](0x1f4,_0x1c983a[_0x9865('0x18')]));});});}; \ No newline at end of file +var _0x4af2=['request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetServicenowAccount','ServicenowAccount','findAll','raw','options','limit','map','include','model','attributes','ShowServicenowAccount','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0x4af2,0x1a4));var _0x24af=function(_0xb12ab6,_0x37ba97){_0xb12ab6=_0xb12ab6-0x0;var _0x595a04=_0x4af2[_0xb12ab6];return _0x595a04;};'use strict';var _=require(_0x24af('0x0'));var util=require(_0x24af('0x1'));var moment=require(_0x24af('0x2'));var BPromise=require(_0x24af('0x3'));var rs=require(_0x24af('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24af('0x5'))['db'];var utils=require(_0x24af('0x6'));var logger=require(_0x24af('0x7'))(_0x24af('0x8'));var config=require(_0x24af('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x24af('0xa')][_0x24af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44ca1c,_0x1122d9,_0x4ae1e8){return new BPromise(function(_0x436ff4,_0x36f580){return client[_0x24af('0xc')](_0x44ca1c,_0x4ae1e8)[_0x24af('0xd')](function(_0x279cd3){logger[_0x24af('0xe')](_0x24af('0xf'),_0x1122d9,'request\x20sent');logger[_0x24af('0x10')](_0x24af('0x11'),_0x1122d9,_0x24af('0x12'),JSON[_0x24af('0x13')](_0x279cd3));if(_0x279cd3[_0x24af('0x14')]){if(_0x279cd3[_0x24af('0x14')]['code']===0x1f4){logger['error'](_0x24af('0xf'),_0x1122d9,_0x279cd3[_0x24af('0x14')][_0x24af('0x15')]);return _0x36f580(_0x279cd3[_0x24af('0x14')][_0x24af('0x15')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1122d9,_0x279cd3[_0x24af('0x14')]['message']);return _0x436ff4(_0x279cd3[_0x24af('0x14')][_0x24af('0x15')]);}else{logger[_0x24af('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x1122d9,_0x24af('0x12'));_0x436ff4(_0x279cd3['result']['message']);}})[_0x24af('0x16')](function(_0x409b69){logger[_0x24af('0x14')](_0x24af('0xf'),_0x1122d9,_0x409b69);_0x36f580(_0x409b69);});});}exports[_0x24af('0x17')]=function(_0x770df3){var _0x20aff4=this;return new Promise(function(_0x55992b,_0x4c75a1){return db[_0x24af('0x18')][_0x24af('0x19')]({'raw':_0x770df3['options']?_0x770df3['options'][_0x24af('0x1a')]===undefined?!![]:![]:!![],'where':_0x770df3['options']?_0x770df3[_0x24af('0x1b')]['where']||null:null,'attributes':_0x770df3[_0x24af('0x1b')]?_0x770df3[_0x24af('0x1b')]['attributes']||null:null,'limit':_0x770df3[_0x24af('0x1b')]?_0x770df3[_0x24af('0x1b')][_0x24af('0x1c')]||null:null,'include':_0x770df3[_0x24af('0x1b')]?_0x770df3['options']['include']?_[_0x24af('0x1d')](_0x770df3[_0x24af('0x1b')][_0x24af('0x1e')],function(_0x139212){return{'model':db[_0x139212[_0x24af('0x1f')]],'as':_0x139212['as'],'attributes':_0x139212[_0x24af('0x20')],'include':_0x139212[_0x24af('0x1e')]?_['map'](_0x139212[_0x24af('0x1e')],function(_0x2b1e53){return{'model':db[_0x2b1e53[_0x24af('0x1f')]],'as':_0x2b1e53['as'],'attributes':_0x2b1e53[_0x24af('0x20')],'include':_0x2b1e53[_0x24af('0x1e')]?_[_0x24af('0x1d')](_0x2b1e53[_0x24af('0x1e')],function(_0x1ffc56){return{'model':db[_0x1ffc56[_0x24af('0x1f')]],'as':_0x1ffc56['as'],'attributes':_0x1ffc56['attributes']};}):[]};}):[]};}):[]:[]})[_0x24af('0xd')](function(_0x297638){logger[_0x24af('0xe')]('GetServicenowAccount',_0x770df3);logger['debug'](_0x24af('0x17'),_0x770df3,JSON[_0x24af('0x13')](_0x297638));_0x55992b(_0x297638);})[_0x24af('0x16')](function(_0x4c30c6){logger[_0x24af('0x14')](_0x24af('0x17'),_0x4c30c6[_0x24af('0x15')],_0x770df3);_0x4c75a1(_0x20aff4['error'](0x1f4,_0x4c30c6['message']));});});};exports[_0x24af('0x21')]=function(_0x340d0b){var _0x4839cd=this;return new Promise(function(_0x332b6e,_0x5781ca){return db[_0x24af('0x18')][_0x24af('0x22')]({'raw':_0x340d0b[_0x24af('0x1b')]?_0x340d0b[_0x24af('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x340d0b[_0x24af('0x1b')]?_0x340d0b[_0x24af('0x1b')][_0x24af('0x23')]||null:null,'attributes':_0x340d0b[_0x24af('0x1b')]?_0x340d0b[_0x24af('0x1b')][_0x24af('0x20')]||null:null,'include':_0x340d0b['options']?_0x340d0b['options'][_0x24af('0x1e')]?_['map'](_0x340d0b[_0x24af('0x1b')][_0x24af('0x1e')],function(_0x543391){return{'model':db[_0x543391['model']],'as':_0x543391['as'],'attributes':_0x543391['attributes'],'include':_0x543391[_0x24af('0x1e')]?_[_0x24af('0x1d')](_0x543391['include'],function(_0x246ac2){return{'model':db[_0x246ac2[_0x24af('0x1f')]],'as':_0x246ac2['as'],'attributes':_0x246ac2[_0x24af('0x20')],'include':_0x246ac2[_0x24af('0x1e')]?_[_0x24af('0x1d')](_0x246ac2[_0x24af('0x1e')],function(_0x4c4b82){return{'model':db[_0x4c4b82['model']],'as':_0x4c4b82['as'],'attributes':_0x4c4b82[_0x24af('0x20')]};}):[]};}):[]};}):[]:[]})[_0x24af('0xd')](function(_0x27e036){logger[_0x24af('0xe')](_0x24af('0x21'),_0x340d0b);logger[_0x24af('0x10')]('ShowServicenowAccount',_0x340d0b,JSON[_0x24af('0x13')](_0x27e036));_0x332b6e(_0x27e036);})[_0x24af('0x16')](function(_0x3cb406){logger[_0x24af('0x14')](_0x24af('0x21'),_0x3cb406['message'],_0x340d0b);_0x5781ca(_0x4839cd[_0x24af('0x14')](0x1f4,_0x3cb406[_0x24af('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 0b30fce..a6f2f91 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 _0xd57d=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields'];(function(_0x21e6c1,_0x5f5646){var _0x59c2e7=function(_0x716466){while(--_0x716466){_0x21e6c1['push'](_0x21e6c1['shift']());}};_0x59c2e7(++_0x5f5646);}(_0xd57d,0xdb));var _0xdd57=function(_0x72e29d,_0x17f411){_0x72e29d=_0x72e29d-0x0;var _0x310f12=_0xd57d[_0x72e29d];return _0x310f12;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdd57('0x0'));var timeout=require(_0xdd57('0x1'));var express=require(_0xdd57('0x2'));var router=express[_0xdd57('0x3')]();var fs_extra=require(_0xdd57('0x4'));var auth=require(_0xdd57('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdd57('0x6'));router[_0xdd57('0x7')]('/',auth[_0xdd57('0x8')](),controller[_0xdd57('0x9')]);router['get'](_0xdd57('0xa'),auth[_0xdd57('0x8')](),controller['show']);router['get'](_0xdd57('0xb'),auth[_0xdd57('0x8')](),controller['getFields']);router[_0xdd57('0x7')](_0xdd57('0xc'),auth['isAuthenticated'](),controller[_0xdd57('0xd')]);router['get'](_0xdd57('0xe'),auth[_0xdd57('0x8')](),controller[_0xdd57('0xf')]);router[_0xdd57('0x10')]('/',auth[_0xdd57('0x8')](),controller[_0xdd57('0x11')]);router[_0xdd57('0x12')](_0xdd57('0xa'),auth[_0xdd57('0x8')](),controller['update']);router['delete'](_0xdd57('0xa'),auth[_0xdd57('0x8')](),controller[_0xdd57('0x13')]);module[_0xdd57('0x14')]=router; \ No newline at end of file +var _0xd5e0=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd5e0,0x81));var _0x0d5e=function(_0x55c376,_0x27204f){_0x55c376=_0x55c376-0x0;var _0x30502f=_0xd5e0[_0x55c376];return _0x30502f;};'use strict';var multer=require(_0x0d5e('0x0'));var util=require(_0x0d5e('0x1'));var path=require(_0x0d5e('0x2'));var timeout=require(_0x0d5e('0x3'));var express=require(_0x0d5e('0x4'));var router=express['Router']();var fs_extra=require(_0x0d5e('0x5'));var auth=require(_0x0d5e('0x6'));var interaction=require(_0x0d5e('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0x0d5e('0x8')]('/',auth[_0x0d5e('0x9')](),controller['index']);router[_0x0d5e('0x8')]('/:id',auth[_0x0d5e('0x9')](),controller[_0x0d5e('0xa')]);router[_0x0d5e('0x8')](_0x0d5e('0xb'),auth[_0x0d5e('0x9')](),controller['getFields']);router[_0x0d5e('0x8')](_0x0d5e('0xc'),auth['isAuthenticated'](),controller[_0x0d5e('0xd')]);router[_0x0d5e('0x8')](_0x0d5e('0xe'),auth[_0x0d5e('0x9')](),controller['getDescriptions']);router[_0x0d5e('0xf')]('/',auth[_0x0d5e('0x9')](),controller['create']);router[_0x0d5e('0x10')](_0x0d5e('0x11'),auth[_0x0d5e('0x9')](),controller[_0x0d5e('0x12')]);router[_0x0d5e('0x13')]('/:id',auth[_0x0d5e('0x9')](),controller[_0x0d5e('0x14')]);module[_0x0d5e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 43e8295..b9abb63 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 _0xa724=['exports','STRING','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa724,0x134));var _0x4a72=function(_0x1d9704,_0x2ddc2e){_0x1d9704=_0x1d9704-0x0;var _0x406a30=_0xa724[_0x1d9704];return _0x406a30;};'use strict';var Sequelize=require(_0x4a72('0x0'));module[_0x4a72('0x1')]={'name':{'type':Sequelize[_0x4a72('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0413=['STRING','sequelize'];(function(_0x308c09,_0x2f26a1){var _0x29989b=function(_0x25bee6){while(--_0x25bee6){_0x308c09['push'](_0x308c09['shift']());}};_0x29989b(++_0x2f26a1);}(_0x0413,0x77));var _0x3041=function(_0x5a8d25,_0x35524f){_0x5a8d25=_0x5a8d25-0x0;var _0x9b1ee8=_0x0413[_0x5a8d25];return _0x9b1ee8;};'use strict';var Sequelize=require(_0x3041('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3041('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 7521e55..8de227f 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 _0x0c9d=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','catch','show','find','create','body','update','params','getFields','findOne','ServicenowField','getSubjects','options','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../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','destroy','end','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','key'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0x0c9d,0x150));var _0xd0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd0c9('0x0'));var rimraf=require(_0xd0c9('0x1'));var zipdir=require(_0xd0c9('0x2'));var jsonpatch=require(_0xd0c9('0x3'));var rp=require(_0xd0c9('0x4'));var moment=require(_0xd0c9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd0c9('0x6'));var util=require(_0xd0c9('0x7'));var path=require(_0xd0c9('0x8'));var sox=require(_0xd0c9('0x9'));var csv=require(_0xd0c9('0xa'));var ejs=require(_0xd0c9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd0c9('0xc'));var jsforce=require(_0xd0c9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd0c9('0xa'));var querystring=require(_0xd0c9('0xe'));var Papa=require(_0xd0c9('0xf'));var Redis=require('ioredis');var authService=require(_0xd0c9('0x10'));var qs=require(_0xd0c9('0x11'));var as=require(_0xd0c9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd0c9('0x13'))(_0xd0c9('0x14'));var utils=require('../../config/utils');var config=require(_0xd0c9('0x15'));var licenseUtil=require(_0xd0c9('0x16'));var db=require(_0xd0c9('0x17'))['db'];function respondWithStatusCode(_0x12f9ea,_0x464ceb){_0x464ceb=_0x464ceb||0xcc;return function(_0x2edd12){if(_0x2edd12){return _0x12f9ea[_0xd0c9('0x18')](_0x464ceb);}return _0x12f9ea['status'](_0x464ceb)['end']();};}function respondWithResult(_0x13112e,_0x3e6c8b){_0x3e6c8b=_0x3e6c8b||0xc8;return function(_0x36450a){if(_0x36450a){return _0x13112e[_0xd0c9('0x19')](_0x3e6c8b)[_0xd0c9('0x1a')](_0x36450a);}};}function respondWithFilteredResult(_0x50cd64,_0xefb424){return function(_0x264087){if(_0x264087){var _0x4c2b10=typeof _0xefb424[_0xd0c9('0x1b')]===_0xd0c9('0x1c')&&typeof _0xefb424[_0xd0c9('0x1d')]===_0xd0c9('0x1c');var _0x5701dd=_0x264087[_0xd0c9('0x1e')];var _0x4557a8=_0x4c2b10?0x0:_0xefb424[_0xd0c9('0x1b')];var _0x15d584=_0x4c2b10?_0x264087['count']:_0xefb424['offset']+_0xefb424['limit'];var _0x1ade9b;if(_0x15d584>=_0x5701dd){_0x15d584=_0x5701dd;_0x1ade9b=0xc8;}else{_0x1ade9b=0xce;}_0x50cd64[_0xd0c9('0x19')](_0x1ade9b);return _0x50cd64[_0xd0c9('0x1f')]('Content-Range',_0x4557a8+'-'+_0x15d584+'/'+_0x5701dd)[_0xd0c9('0x1a')](_0x264087);}return null;};}function patchUpdates(_0xc2e35c){return function(_0x2ce90d){try{jsonpatch[_0xd0c9('0x20')](_0x2ce90d,_0xc2e35c,!![]);}catch(_0x35d0fb){return BPromise['reject'](_0x35d0fb);}return _0x2ce90d['save']();};}function saveUpdates(_0x2b6749,_0x3073a7){return function(_0x16a0ec){if(_0x16a0ec){return _0x16a0ec['update'](_0x2b6749)[_0xd0c9('0x21')](function(_0x4670e7){return _0x4670e7;});}return null;};}function removeEntity(_0x2e706a,_0x490ae7){return function(_0x1db9d4){if(_0x1db9d4){return _0x1db9d4[_0xd0c9('0x22')]()[_0xd0c9('0x21')](function(){_0x2e706a[_0xd0c9('0x19')](0xcc)[_0xd0c9('0x23')]();});}};}function handleEntityNotFound(_0x2a090d,_0x52192e){return function(_0xf26740){if(!_0xf26740){_0x2a090d[_0xd0c9('0x18')](0x194);}return _0xf26740;};}function handleError(_0x35fe0c,_0x12b674){_0x12b674=_0x12b674||0x1f4;return function(_0x4996d4){logger['error'](_0x4996d4[_0xd0c9('0x24')]);if(_0x4996d4[_0xd0c9('0x25')]){delete _0x4996d4[_0xd0c9('0x25')];}_0x35fe0c[_0xd0c9('0x19')](_0x12b674)[_0xd0c9('0x26')](_0x4996d4);};}exports[_0xd0c9('0x27')]=function(_0xf8bd17,_0x50a752){var _0x459c8a={},_0x8e43ea={},_0xb202ed={'count':0x0,'rows':[]};var _0x36adf1=_[_0xd0c9('0x28')](db[_0xd0c9('0x29')][_0xd0c9('0x2a')],function(_0x31ff8f){return{'name':_0x31ff8f['fieldName'],'type':_0x31ff8f['type'][_0xd0c9('0x2b')]};});_0x8e43ea[_0xd0c9('0x2c')]=_[_0xd0c9('0x28')](_0x36adf1,_0xd0c9('0x25'));_0x8e43ea[_0xd0c9('0x2d')]=_[_0xd0c9('0x2e')](_0xf8bd17[_0xd0c9('0x2d')]);_0x8e43ea[_0xd0c9('0x2f')]=_['intersection'](_0x8e43ea[_0xd0c9('0x2c')],_0x8e43ea[_0xd0c9('0x2d')]);_0x459c8a[_0xd0c9('0x30')]=_[_0xd0c9('0x31')](_0x8e43ea[_0xd0c9('0x2c')],qs[_0xd0c9('0x32')](_0xf8bd17[_0xd0c9('0x2d')][_0xd0c9('0x32')]));_0x459c8a[_0xd0c9('0x30')]=_0x459c8a['attributes'][_0xd0c9('0x33')]?_0x459c8a[_0xd0c9('0x30')]:_0x8e43ea['model'];if(!_0xf8bd17[_0xd0c9('0x2d')][_0xd0c9('0x34')](_0xd0c9('0x35'))){_0x459c8a[_0xd0c9('0x1d')]=qs[_0xd0c9('0x1d')](_0xf8bd17[_0xd0c9('0x2d')][_0xd0c9('0x1d')]);_0x459c8a[_0xd0c9('0x1b')]=qs[_0xd0c9('0x1b')](_0xf8bd17[_0xd0c9('0x2d')]['offset']);}_0x459c8a[_0xd0c9('0x36')]=qs[_0xd0c9('0x37')](_0xf8bd17['query']['sort']);_0x459c8a[_0xd0c9('0x38')]=qs[_0xd0c9('0x2f')](_[_0xd0c9('0x39')](_0xf8bd17[_0xd0c9('0x2d')],_0x8e43ea[_0xd0c9('0x2f')]),_0x36adf1);if(_0xf8bd17[_0xd0c9('0x2d')][_0xd0c9('0x3a')]){_0x459c8a[_0xd0c9('0x38')]=_['merge'](_0x459c8a[_0xd0c9('0x38')],{'$or':_[_0xd0c9('0x28')](_0x36adf1,function(_0x372734){if(_0x372734[_0xd0c9('0x3b')]!==_0xd0c9('0x3c')){var _0x2b6d51={};_0x2b6d51[_0x372734[_0xd0c9('0x25')]]={'$like':'%'+_0xf8bd17['query']['filter']+'%'};return _0x2b6d51;}})});}_0x459c8a=_[_0xd0c9('0x3d')]({},_0x459c8a,_0xf8bd17['options']);var _0x230cf5={'where':_0x459c8a[_0xd0c9('0x38')]};return db[_0xd0c9('0x29')][_0xd0c9('0x1e')](_0x230cf5)[_0xd0c9('0x21')](function(_0x4b5f45){_0xb202ed['count']=_0x4b5f45;if(_0xf8bd17[_0xd0c9('0x2d')][_0xd0c9('0x3e')]){_0x459c8a['include']=[{'all':!![]}];}return db[_0xd0c9('0x29')]['findAll'](_0x459c8a);})[_0xd0c9('0x21')](function(_0x15904e){_0xb202ed['rows']=_0x15904e;return _0xb202ed;})['then'](respondWithFilteredResult(_0x50a752,_0x459c8a))[_0xd0c9('0x3f')](handleError(_0x50a752,null));};exports[_0xd0c9('0x40')]=function(_0x551010,_0x68eed3){var _0x5dcc2e={'raw':![],'where':{'id':_0x551010['params']['id']}},_0x22c6fc={};_0x22c6fc['model']=_[_0xd0c9('0x2e')](db[_0xd0c9('0x29')]['rawAttributes']);_0x22c6fc['query']=_[_0xd0c9('0x2e')](_0x551010[_0xd0c9('0x2d')]);_0x22c6fc['filters']=_[_0xd0c9('0x31')](_0x22c6fc[_0xd0c9('0x2c')],_0x22c6fc[_0xd0c9('0x2d')]);_0x5dcc2e[_0xd0c9('0x30')]=_[_0xd0c9('0x31')](_0x22c6fc[_0xd0c9('0x2c')],qs[_0xd0c9('0x32')](_0x551010[_0xd0c9('0x2d')]['fields']));_0x5dcc2e[_0xd0c9('0x30')]=_0x5dcc2e['attributes'][_0xd0c9('0x33')]?_0x5dcc2e[_0xd0c9('0x30')]:_0x22c6fc['model'];if(_0x551010[_0xd0c9('0x2d')][_0xd0c9('0x3e')]){_0x5dcc2e['include']=[{'all':!![]}];}_0x5dcc2e=_['merge']({},_0x5dcc2e,_0x551010['options']);return db[_0xd0c9('0x29')][_0xd0c9('0x41')](_0x5dcc2e)[_0xd0c9('0x21')](handleEntityNotFound(_0x68eed3,null))[_0xd0c9('0x21')](respondWithResult(_0x68eed3,null))['catch'](handleError(_0x68eed3,null));};exports[_0xd0c9('0x42')]=function(_0x5955bb,_0x1a3a43){return db[_0xd0c9('0x29')][_0xd0c9('0x42')](_0x5955bb[_0xd0c9('0x43')],{})[_0xd0c9('0x21')](respondWithResult(_0x1a3a43,0xc9))[_0xd0c9('0x3f')](handleError(_0x1a3a43,null));};exports[_0xd0c9('0x44')]=function(_0x5a663a,_0x48b4a4){if(_0x5a663a[_0xd0c9('0x43')]['id']){delete _0x5a663a[_0xd0c9('0x43')]['id'];}return db[_0xd0c9('0x29')]['find']({'where':{'id':_0x5a663a[_0xd0c9('0x45')]['id']}})[_0xd0c9('0x21')](handleEntityNotFound(_0x48b4a4,null))[_0xd0c9('0x21')](saveUpdates(_0x5a663a['body'],null))[_0xd0c9('0x21')](respondWithResult(_0x48b4a4,null))[_0xd0c9('0x3f')](handleError(_0x48b4a4,null));};exports[_0xd0c9('0x22')]=function(_0x297ede,_0x55f415){return db['ServicenowConfiguration']['find']({'where':{'id':_0x297ede[_0xd0c9('0x45')]['id']}})[_0xd0c9('0x21')](handleEntityNotFound(_0x55f415,null))[_0xd0c9('0x21')](removeEntity(_0x55f415,null))['catch'](handleError(_0x55f415,null));};exports[_0xd0c9('0x46')]=function(_0x304be3,_0xbd28ff,_0x399096){var _0x30b25e={};var _0x57664f={};var _0x5f3461;var _0x29e3a4;return db[_0xd0c9('0x29')][_0xd0c9('0x47')]({'where':{'id':_0x304be3[_0xd0c9('0x45')]['id']}})[_0xd0c9('0x21')](handleEntityNotFound(_0xbd28ff,null))[_0xd0c9('0x21')](function(_0x294dc9){if(_0x294dc9){_0x5f3461=_0x294dc9;_0x57664f[_0xd0c9('0x2c')]=_['keys'](db[_0xd0c9('0x48')]['rawAttributes']);_0x57664f[_0xd0c9('0x2d')]=_['keys'](_0x304be3['query']);_0x57664f['filters']=_['intersection'](_0x57664f[_0xd0c9('0x2c')],_0x57664f[_0xd0c9('0x2d')]);_0x30b25e[_0xd0c9('0x30')]=_['intersection'](_0x57664f[_0xd0c9('0x2c')],qs[_0xd0c9('0x32')](_0x304be3[_0xd0c9('0x2d')][_0xd0c9('0x32')]));_0x30b25e['attributes']=_0x30b25e[_0xd0c9('0x30')][_0xd0c9('0x33')]?_0x30b25e['attributes']:_0x57664f['model'];_0x30b25e[_0xd0c9('0x36')]=qs['sort'](_0x304be3[_0xd0c9('0x2d')][_0xd0c9('0x37')]);_0x30b25e[_0xd0c9('0x38')]=qs[_0xd0c9('0x2f')](_['pick'](_0x304be3['query'],_0x57664f[_0xd0c9('0x2f')]));if(_0x304be3[_0xd0c9('0x2d')][_0xd0c9('0x3a')]){_0x30b25e['where']=_[_0xd0c9('0x3d')](_0x30b25e[_0xd0c9('0x38')],{'$or':_[_0xd0c9('0x28')](_0x30b25e[_0xd0c9('0x30')],function(_0x413044){var _0x4102ac={};_0x4102ac[_0x413044]={'$like':'%'+_0x304be3[_0xd0c9('0x2d')][_0xd0c9('0x3a')]+'%'};return _0x4102ac;})});}_0x30b25e=_[_0xd0c9('0x3d')]({},_0x30b25e,_0x304be3['options']);return _0x5f3461['getFields'](_0x30b25e);}})['then'](function(_0x3177d7){if(_0x3177d7){_0x29e3a4=_0x3177d7[_0xd0c9('0x33')];if(!_0x304be3[_0xd0c9('0x2d')][_0xd0c9('0x34')](_0xd0c9('0x35'))){_0x30b25e[_0xd0c9('0x1d')]=qs[_0xd0c9('0x1d')](_0x304be3['query']['limit']);_0x30b25e['offset']=qs[_0xd0c9('0x1b')](_0x304be3[_0xd0c9('0x2d')][_0xd0c9('0x1b')]);}return _0x5f3461[_0xd0c9('0x46')](_0x30b25e);}})[_0xd0c9('0x21')](function(_0x2b1ba9){if(_0x2b1ba9){return _0x2b1ba9?{'count':_0x29e3a4,'rows':_0x2b1ba9}:null;}})[_0xd0c9('0x21')](respondWithResult(_0xbd28ff,null))[_0xd0c9('0x3f')](handleError(_0xbd28ff,null));};exports[_0xd0c9('0x49')]=function(_0x5de8b9,_0x5dfd6b,_0x343419){var _0x296443={};var _0x2e1706={};var _0x56ad08;var _0xd56cfd;return db[_0xd0c9('0x29')][_0xd0c9('0x47')]({'where':{'id':_0x5de8b9[_0xd0c9('0x45')]['id']}})[_0xd0c9('0x21')](handleEntityNotFound(_0x5dfd6b,null))[_0xd0c9('0x21')](function(_0x1f61f9){if(_0x1f61f9){_0x56ad08=_0x1f61f9;_0x2e1706[_0xd0c9('0x2c')]=_[_0xd0c9('0x2e')](db[_0xd0c9('0x48')][_0xd0c9('0x2a')]);_0x2e1706[_0xd0c9('0x2d')]=_[_0xd0c9('0x2e')](_0x5de8b9[_0xd0c9('0x2d')]);_0x2e1706[_0xd0c9('0x2f')]=_[_0xd0c9('0x31')](_0x2e1706['model'],_0x2e1706[_0xd0c9('0x2d')]);_0x296443['attributes']=_[_0xd0c9('0x31')](_0x2e1706[_0xd0c9('0x2c')],qs[_0xd0c9('0x32')](_0x5de8b9[_0xd0c9('0x2d')][_0xd0c9('0x32')]));_0x296443[_0xd0c9('0x30')]=_0x296443['attributes'][_0xd0c9('0x33')]?_0x296443[_0xd0c9('0x30')]:_0x2e1706['model'];_0x296443[_0xd0c9('0x36')]=qs[_0xd0c9('0x37')](_0x5de8b9['query'][_0xd0c9('0x37')]);_0x296443['where']=qs[_0xd0c9('0x2f')](_[_0xd0c9('0x39')](_0x5de8b9[_0xd0c9('0x2d')],_0x2e1706[_0xd0c9('0x2f')]));if(_0x5de8b9[_0xd0c9('0x2d')][_0xd0c9('0x3a')]){_0x296443[_0xd0c9('0x38')]=_[_0xd0c9('0x3d')](_0x296443[_0xd0c9('0x38')],{'$or':_[_0xd0c9('0x28')](_0x296443[_0xd0c9('0x30')],function(_0x353d37){var _0x33eef1={};_0x33eef1[_0x353d37]={'$like':'%'+_0x5de8b9[_0xd0c9('0x2d')]['filter']+'%'};return _0x33eef1;})});}_0x296443=_[_0xd0c9('0x3d')]({},_0x296443,_0x5de8b9[_0xd0c9('0x4a')]);return _0x56ad08['getSubjects'](_0x296443);}})[_0xd0c9('0x21')](function(_0x44e06f){if(_0x44e06f){_0xd56cfd=_0x44e06f['length'];if(!_0x5de8b9['query'][_0xd0c9('0x34')]('nolimit')){_0x296443[_0xd0c9('0x1d')]=qs[_0xd0c9('0x1d')](_0x5de8b9[_0xd0c9('0x2d')][_0xd0c9('0x1d')]);_0x296443[_0xd0c9('0x1b')]=qs[_0xd0c9('0x1b')](_0x5de8b9['query']['offset']);}return _0x56ad08[_0xd0c9('0x49')](_0x296443);}})['then'](function(_0x1eeb41){if(_0x1eeb41){return _0x1eeb41?{'count':_0xd56cfd,'rows':_0x1eeb41}:null;}})[_0xd0c9('0x21')](respondWithResult(_0x5dfd6b,null))['catch'](handleError(_0x5dfd6b,null));};exports[_0xd0c9('0x4b')]=function(_0x59d5b8,_0x582910,_0x249393){var _0x5d5521={};var _0x425d48={};var _0x5bbab3;var _0x5107bd;return db[_0xd0c9('0x29')][_0xd0c9('0x47')]({'where':{'id':_0x59d5b8[_0xd0c9('0x45')]['id']}})['then'](handleEntityNotFound(_0x582910,null))['then'](function(_0x300779){if(_0x300779){_0x5bbab3=_0x300779;_0x425d48[_0xd0c9('0x2c')]=_[_0xd0c9('0x2e')](db[_0xd0c9('0x48')][_0xd0c9('0x2a')]);_0x425d48['query']=_[_0xd0c9('0x2e')](_0x59d5b8['query']);_0x425d48[_0xd0c9('0x2f')]=_['intersection'](_0x425d48[_0xd0c9('0x2c')],_0x425d48[_0xd0c9('0x2d')]);_0x5d5521[_0xd0c9('0x30')]=_[_0xd0c9('0x31')](_0x425d48[_0xd0c9('0x2c')],qs['fields'](_0x59d5b8[_0xd0c9('0x2d')]['fields']));_0x5d5521[_0xd0c9('0x30')]=_0x5d5521[_0xd0c9('0x30')]['length']?_0x5d5521['attributes']:_0x425d48[_0xd0c9('0x2c')];_0x5d5521[_0xd0c9('0x36')]=qs['sort'](_0x59d5b8[_0xd0c9('0x2d')][_0xd0c9('0x37')]);_0x5d5521['where']=qs[_0xd0c9('0x2f')](_[_0xd0c9('0x39')](_0x59d5b8[_0xd0c9('0x2d')],_0x425d48[_0xd0c9('0x2f')]));if(_0x59d5b8[_0xd0c9('0x2d')][_0xd0c9('0x3a')]){_0x5d5521['where']=_['merge'](_0x5d5521['where'],{'$or':_[_0xd0c9('0x28')](_0x5d5521[_0xd0c9('0x30')],function(_0x851b8d){var _0x3c49cc={};_0x3c49cc[_0x851b8d]={'$like':'%'+_0x59d5b8[_0xd0c9('0x2d')][_0xd0c9('0x3a')]+'%'};return _0x3c49cc;})});}_0x5d5521=_['merge']({},_0x5d5521,_0x59d5b8[_0xd0c9('0x4a')]);return _0x5bbab3[_0xd0c9('0x4b')](_0x5d5521);}})['then'](function(_0x59d5b7){if(_0x59d5b7){_0x5107bd=_0x59d5b7[_0xd0c9('0x33')];if(!_0x59d5b8['query'][_0xd0c9('0x34')](_0xd0c9('0x35'))){_0x5d5521[_0xd0c9('0x1d')]=qs[_0xd0c9('0x1d')](_0x59d5b8[_0xd0c9('0x2d')][_0xd0c9('0x1d')]);_0x5d5521[_0xd0c9('0x1b')]=qs[_0xd0c9('0x1b')](_0x59d5b8[_0xd0c9('0x2d')]['offset']);}return _0x5bbab3[_0xd0c9('0x4b')](_0x5d5521);}})[_0xd0c9('0x21')](function(_0x2f4ba6){if(_0x2f4ba6){return _0x2f4ba6?{'count':_0x5107bd,'rows':_0x2f4ba6}:null;}})[_0xd0c9('0x21')](respondWithResult(_0x582910,null))[_0xd0c9('0x3f')](handleError(_0x582910,null));}; \ No newline at end of file +var _0x7990=['show','params','keys','length','includeAll','find','catch','create','body','getFields','findOne','ServicenowField','order','merge','hasOwnProperty','getSubjects','pick','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','ejs','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','name','query','intersection','fields','attributes','nolimit','sort','where','filters','filter','VIRTUAL','options','count','include','findAll','rows'];(function(_0x136171,_0x393e90){var _0x5c228a=function(_0x1dfe3c){while(--_0x1dfe3c){_0x136171['push'](_0x136171['shift']());}};_0x5c228a(++_0x393e90);}(_0x7990,0xb2));var _0x0799=function(_0x50d3cd,_0x2d05c2){_0x50d3cd=_0x50d3cd-0x0;var _0x1a0ffd=_0x7990[_0x50d3cd];return _0x1a0ffd;};'use strict';var emlformat=require(_0x0799('0x0'));var rimraf=require(_0x0799('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0799('0x2'));var rp=require(_0x0799('0x3'));var moment=require('moment');var BPromise=require(_0x0799('0x4'));var Mustache=require(_0x0799('0x5'));var util=require(_0x0799('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0799('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0799('0x8'));var squel=require('squel');var crypto=require(_0x0799('0x9'));var jsforce=require(_0x0799('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0799('0xb'));var querystring=require('querystring');var Papa=require(_0x0799('0xc'));var Redis=require(_0x0799('0xd'));var authService=require(_0x0799('0xe'));var qs=require(_0x0799('0xf'));var as=require(_0x0799('0x10'));var hardwareService=require(_0x0799('0x11'));var logger=require(_0x0799('0x12'))('api');var utils=require(_0x0799('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0799('0x14'))['db'];function respondWithStatusCode(_0x5cde78,_0x1a8faf){_0x1a8faf=_0x1a8faf||0xcc;return function(_0x536ea4){if(_0x536ea4){return _0x5cde78[_0x0799('0x15')](_0x1a8faf);}return _0x5cde78[_0x0799('0x16')](_0x1a8faf)[_0x0799('0x17')]();};}function respondWithResult(_0x16676b,_0x217ef7){_0x217ef7=_0x217ef7||0xc8;return function(_0x478193){if(_0x478193){return _0x16676b[_0x0799('0x16')](_0x217ef7)[_0x0799('0x18')](_0x478193);}};}function respondWithFilteredResult(_0x5c6407,_0xd4140d){return function(_0x1ceda0){if(_0x1ceda0){var _0x5b0377=typeof _0xd4140d[_0x0799('0x19')]===_0x0799('0x1a')&&typeof _0xd4140d[_0x0799('0x1b')]===_0x0799('0x1a');var _0x351127=_0x1ceda0['count'];var _0x4dad04=_0x5b0377?0x0:_0xd4140d[_0x0799('0x19')];var _0x53a3d4=_0x5b0377?_0x1ceda0['count']:_0xd4140d['offset']+_0xd4140d['limit'];var _0x7b58ac;if(_0x53a3d4>=_0x351127){_0x53a3d4=_0x351127;_0x7b58ac=0xc8;}else{_0x7b58ac=0xce;}_0x5c6407[_0x0799('0x16')](_0x7b58ac);return _0x5c6407[_0x0799('0x1c')](_0x0799('0x1d'),_0x4dad04+'-'+_0x53a3d4+'/'+_0x351127)['json'](_0x1ceda0);}return null;};}function patchUpdates(_0x541c18){return function(_0xf981e8){try{jsonpatch[_0x0799('0x1e')](_0xf981e8,_0x541c18,!![]);}catch(_0x4f3c38){return BPromise[_0x0799('0x1f')](_0x4f3c38);}return _0xf981e8[_0x0799('0x20')]();};}function saveUpdates(_0x18166f,_0x180c13){return function(_0x3ac48e){if(_0x3ac48e){return _0x3ac48e['update'](_0x18166f)['then'](function(_0x4707a1){return _0x4707a1;});}return null;};}function removeEntity(_0x2795e2,_0x4959e9){return function(_0x57d292){if(_0x57d292){return _0x57d292[_0x0799('0x21')]()[_0x0799('0x22')](function(){_0x2795e2[_0x0799('0x16')](0xcc)[_0x0799('0x17')]();});}};}function handleEntityNotFound(_0x5f4b63,_0x38a54c){return function(_0x19aac1){if(!_0x19aac1){_0x5f4b63[_0x0799('0x15')](0x194);}return _0x19aac1;};}function handleError(_0x4e017e,_0x25a92c){_0x25a92c=_0x25a92c||0x1f4;return function(_0x219b32){logger[_0x0799('0x23')](_0x219b32[_0x0799('0x24')]);if(_0x219b32['name']){delete _0x219b32['name'];}_0x4e017e[_0x0799('0x16')](_0x25a92c)[_0x0799('0x25')](_0x219b32);};}exports[_0x0799('0x26')]=function(_0x587220,_0x54ddbc){var _0x2a80cd={},_0x4bdc57={},_0x23cab5={'count':0x0,'rows':[]};var _0x443960=_['map'](db[_0x0799('0x27')][_0x0799('0x28')],function(_0x1f3d04){return{'name':_0x1f3d04[_0x0799('0x29')],'type':_0x1f3d04[_0x0799('0x2a')][_0x0799('0x2b')]};});_0x4bdc57[_0x0799('0x2c')]=_[_0x0799('0x2d')](_0x443960,_0x0799('0x2e'));_0x4bdc57['query']=_['keys'](_0x587220[_0x0799('0x2f')]);_0x4bdc57['filters']=_['intersection'](_0x4bdc57[_0x0799('0x2c')],_0x4bdc57[_0x0799('0x2f')]);_0x2a80cd['attributes']=_[_0x0799('0x30')](_0x4bdc57[_0x0799('0x2c')],qs[_0x0799('0x31')](_0x587220[_0x0799('0x2f')]['fields']));_0x2a80cd[_0x0799('0x32')]=_0x2a80cd[_0x0799('0x32')]['length']?_0x2a80cd[_0x0799('0x32')]:_0x4bdc57[_0x0799('0x2c')];if(!_0x587220[_0x0799('0x2f')]['hasOwnProperty'](_0x0799('0x33'))){_0x2a80cd[_0x0799('0x1b')]=qs[_0x0799('0x1b')](_0x587220[_0x0799('0x2f')][_0x0799('0x1b')]);_0x2a80cd[_0x0799('0x19')]=qs[_0x0799('0x19')](_0x587220['query'][_0x0799('0x19')]);}_0x2a80cd['order']=qs[_0x0799('0x34')](_0x587220[_0x0799('0x2f')]['sort']);_0x2a80cd[_0x0799('0x35')]=qs[_0x0799('0x36')](_['pick'](_0x587220[_0x0799('0x2f')],_0x4bdc57['filters']),_0x443960);if(_0x587220['query'][_0x0799('0x37')]){_0x2a80cd['where']=_['merge'](_0x2a80cd[_0x0799('0x35')],{'$or':_['map'](_0x443960,function(_0x47633f){if(_0x47633f['type']!==_0x0799('0x38')){var _0x163f32={};_0x163f32[_0x47633f[_0x0799('0x2e')]]={'$like':'%'+_0x587220[_0x0799('0x2f')][_0x0799('0x37')]+'%'};return _0x163f32;}})});}_0x2a80cd=_['merge']({},_0x2a80cd,_0x587220[_0x0799('0x39')]);var _0x4797e1={'where':_0x2a80cd[_0x0799('0x35')]};return db[_0x0799('0x27')][_0x0799('0x3a')](_0x4797e1)[_0x0799('0x22')](function(_0x1670d6){_0x23cab5[_0x0799('0x3a')]=_0x1670d6;if(_0x587220[_0x0799('0x2f')]['includeAll']){_0x2a80cd[_0x0799('0x3b')]=[{'all':!![]}];}return db[_0x0799('0x27')][_0x0799('0x3c')](_0x2a80cd);})[_0x0799('0x22')](function(_0xf35bf9){_0x23cab5[_0x0799('0x3d')]=_0xf35bf9;return _0x23cab5;})[_0x0799('0x22')](respondWithFilteredResult(_0x54ddbc,_0x2a80cd))['catch'](handleError(_0x54ddbc,null));};exports[_0x0799('0x3e')]=function(_0x609750,_0x5d868e){var _0x30aa19={'raw':![],'where':{'id':_0x609750[_0x0799('0x3f')]['id']}},_0x296281={};_0x296281[_0x0799('0x2c')]=_['keys'](db[_0x0799('0x27')][_0x0799('0x28')]);_0x296281[_0x0799('0x2f')]=_[_0x0799('0x40')](_0x609750[_0x0799('0x2f')]);_0x296281[_0x0799('0x36')]=_[_0x0799('0x30')](_0x296281['model'],_0x296281[_0x0799('0x2f')]);_0x30aa19[_0x0799('0x32')]=_['intersection'](_0x296281[_0x0799('0x2c')],qs[_0x0799('0x31')](_0x609750[_0x0799('0x2f')][_0x0799('0x31')]));_0x30aa19[_0x0799('0x32')]=_0x30aa19[_0x0799('0x32')][_0x0799('0x41')]?_0x30aa19['attributes']:_0x296281[_0x0799('0x2c')];if(_0x609750[_0x0799('0x2f')][_0x0799('0x42')]){_0x30aa19[_0x0799('0x3b')]=[{'all':!![]}];}_0x30aa19=_['merge']({},_0x30aa19,_0x609750['options']);return db[_0x0799('0x27')][_0x0799('0x43')](_0x30aa19)[_0x0799('0x22')](handleEntityNotFound(_0x5d868e,null))[_0x0799('0x22')](respondWithResult(_0x5d868e,null))[_0x0799('0x44')](handleError(_0x5d868e,null));};exports['create']=function(_0x1e9645,_0x1b0e8b){return db[_0x0799('0x27')][_0x0799('0x45')](_0x1e9645['body'],{})[_0x0799('0x22')](respondWithResult(_0x1b0e8b,0xc9))[_0x0799('0x44')](handleError(_0x1b0e8b,null));};exports['update']=function(_0x430b92,_0x432fca){if(_0x430b92[_0x0799('0x46')]['id']){delete _0x430b92['body']['id'];}return db[_0x0799('0x27')][_0x0799('0x43')]({'where':{'id':_0x430b92[_0x0799('0x3f')]['id']}})[_0x0799('0x22')](handleEntityNotFound(_0x432fca,null))[_0x0799('0x22')](saveUpdates(_0x430b92[_0x0799('0x46')],null))[_0x0799('0x22')](respondWithResult(_0x432fca,null))[_0x0799('0x44')](handleError(_0x432fca,null));};exports[_0x0799('0x21')]=function(_0x52c62e,_0x4e5d34){return db[_0x0799('0x27')]['find']({'where':{'id':_0x52c62e[_0x0799('0x3f')]['id']}})[_0x0799('0x22')](handleEntityNotFound(_0x4e5d34,null))['then'](removeEntity(_0x4e5d34,null))[_0x0799('0x44')](handleError(_0x4e5d34,null));};exports[_0x0799('0x47')]=function(_0x4570c0,_0x3ecb58,_0x4b91ef){var _0x3cd27e={};var _0x51b823={};var _0x447064;var _0x466df1;return db[_0x0799('0x27')][_0x0799('0x48')]({'where':{'id':_0x4570c0[_0x0799('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3ecb58,null))['then'](function(_0xd36219){if(_0xd36219){_0x447064=_0xd36219;_0x51b823[_0x0799('0x2c')]=_['keys'](db[_0x0799('0x49')][_0x0799('0x28')]);_0x51b823[_0x0799('0x2f')]=_[_0x0799('0x40')](_0x4570c0[_0x0799('0x2f')]);_0x51b823['filters']=_[_0x0799('0x30')](_0x51b823['model'],_0x51b823[_0x0799('0x2f')]);_0x3cd27e[_0x0799('0x32')]=_[_0x0799('0x30')](_0x51b823['model'],qs[_0x0799('0x31')](_0x4570c0[_0x0799('0x2f')]['fields']));_0x3cd27e[_0x0799('0x32')]=_0x3cd27e[_0x0799('0x32')][_0x0799('0x41')]?_0x3cd27e['attributes']:_0x51b823[_0x0799('0x2c')];_0x3cd27e[_0x0799('0x4a')]=qs[_0x0799('0x34')](_0x4570c0[_0x0799('0x2f')][_0x0799('0x34')]);_0x3cd27e[_0x0799('0x35')]=qs[_0x0799('0x36')](_['pick'](_0x4570c0[_0x0799('0x2f')],_0x51b823['filters']));if(_0x4570c0[_0x0799('0x2f')]['filter']){_0x3cd27e[_0x0799('0x35')]=_[_0x0799('0x4b')](_0x3cd27e['where'],{'$or':_[_0x0799('0x2d')](_0x3cd27e[_0x0799('0x32')],function(_0x1b7c65){var _0x31b0a1={};_0x31b0a1[_0x1b7c65]={'$like':'%'+_0x4570c0['query']['filter']+'%'};return _0x31b0a1;})});}_0x3cd27e=_[_0x0799('0x4b')]({},_0x3cd27e,_0x4570c0['options']);return _0x447064[_0x0799('0x47')](_0x3cd27e);}})[_0x0799('0x22')](function(_0x2adfbd){if(_0x2adfbd){_0x466df1=_0x2adfbd[_0x0799('0x41')];if(!_0x4570c0['query'][_0x0799('0x4c')](_0x0799('0x33'))){_0x3cd27e[_0x0799('0x1b')]=qs['limit'](_0x4570c0['query'][_0x0799('0x1b')]);_0x3cd27e[_0x0799('0x19')]=qs[_0x0799('0x19')](_0x4570c0[_0x0799('0x2f')][_0x0799('0x19')]);}return _0x447064['getFields'](_0x3cd27e);}})['then'](function(_0x1f829d){if(_0x1f829d){return _0x1f829d?{'count':_0x466df1,'rows':_0x1f829d}:null;}})[_0x0799('0x22')](respondWithResult(_0x3ecb58,null))[_0x0799('0x44')](handleError(_0x3ecb58,null));};exports[_0x0799('0x4d')]=function(_0x43a710,_0x2a275a,_0x1efae0){var _0x5de2cf={};var _0x2c596b={};var _0x3bc6f1;var _0x5df1a0;return db[_0x0799('0x27')][_0x0799('0x48')]({'where':{'id':_0x43a710[_0x0799('0x3f')]['id']}})[_0x0799('0x22')](handleEntityNotFound(_0x2a275a,null))[_0x0799('0x22')](function(_0x239056){if(_0x239056){_0x3bc6f1=_0x239056;_0x2c596b['model']=_[_0x0799('0x40')](db[_0x0799('0x49')][_0x0799('0x28')]);_0x2c596b[_0x0799('0x2f')]=_[_0x0799('0x40')](_0x43a710[_0x0799('0x2f')]);_0x2c596b['filters']=_[_0x0799('0x30')](_0x2c596b['model'],_0x2c596b[_0x0799('0x2f')]);_0x5de2cf[_0x0799('0x32')]=_[_0x0799('0x30')](_0x2c596b[_0x0799('0x2c')],qs['fields'](_0x43a710[_0x0799('0x2f')][_0x0799('0x31')]));_0x5de2cf[_0x0799('0x32')]=_0x5de2cf[_0x0799('0x32')][_0x0799('0x41')]?_0x5de2cf['attributes']:_0x2c596b[_0x0799('0x2c')];_0x5de2cf['order']=qs[_0x0799('0x34')](_0x43a710[_0x0799('0x2f')][_0x0799('0x34')]);_0x5de2cf[_0x0799('0x35')]=qs[_0x0799('0x36')](_[_0x0799('0x4e')](_0x43a710[_0x0799('0x2f')],_0x2c596b[_0x0799('0x36')]));if(_0x43a710[_0x0799('0x2f')][_0x0799('0x37')]){_0x5de2cf[_0x0799('0x35')]=_[_0x0799('0x4b')](_0x5de2cf[_0x0799('0x35')],{'$or':_['map'](_0x5de2cf['attributes'],function(_0x4213a2){var _0x284b7e={};_0x284b7e[_0x4213a2]={'$like':'%'+_0x43a710['query'][_0x0799('0x37')]+'%'};return _0x284b7e;})});}_0x5de2cf=_[_0x0799('0x4b')]({},_0x5de2cf,_0x43a710[_0x0799('0x39')]);return _0x3bc6f1[_0x0799('0x4d')](_0x5de2cf);}})[_0x0799('0x22')](function(_0x57e4c4){if(_0x57e4c4){_0x5df1a0=_0x57e4c4[_0x0799('0x41')];if(!_0x43a710[_0x0799('0x2f')][_0x0799('0x4c')](_0x0799('0x33'))){_0x5de2cf[_0x0799('0x1b')]=qs[_0x0799('0x1b')](_0x43a710['query']['limit']);_0x5de2cf['offset']=qs[_0x0799('0x19')](_0x43a710[_0x0799('0x2f')][_0x0799('0x19')]);}return _0x3bc6f1[_0x0799('0x4d')](_0x5de2cf);}})[_0x0799('0x22')](function(_0x1ba588){if(_0x1ba588){return _0x1ba588?{'count':_0x5df1a0,'rows':_0x1ba588}:null;}})[_0x0799('0x22')](respondWithResult(_0x2a275a,null))[_0x0799('0x44')](handleError(_0x2a275a,null));};exports[_0x0799('0x4f')]=function(_0x2de000,_0x53c9f3,_0x49ca8d){var _0x24c35e={};var _0x548daf={};var _0x5a40f1;var _0x7be13e;return db['ServicenowConfiguration'][_0x0799('0x48')]({'where':{'id':_0x2de000[_0x0799('0x3f')]['id']}})[_0x0799('0x22')](handleEntityNotFound(_0x53c9f3,null))[_0x0799('0x22')](function(_0x277aa3){if(_0x277aa3){_0x5a40f1=_0x277aa3;_0x548daf['model']=_[_0x0799('0x40')](db[_0x0799('0x49')][_0x0799('0x28')]);_0x548daf[_0x0799('0x2f')]=_[_0x0799('0x40')](_0x2de000[_0x0799('0x2f')]);_0x548daf[_0x0799('0x36')]=_[_0x0799('0x30')](_0x548daf['model'],_0x548daf['query']);_0x24c35e[_0x0799('0x32')]=_[_0x0799('0x30')](_0x548daf[_0x0799('0x2c')],qs['fields'](_0x2de000[_0x0799('0x2f')]['fields']));_0x24c35e[_0x0799('0x32')]=_0x24c35e[_0x0799('0x32')]['length']?_0x24c35e[_0x0799('0x32')]:_0x548daf['model'];_0x24c35e[_0x0799('0x4a')]=qs['sort'](_0x2de000[_0x0799('0x2f')][_0x0799('0x34')]);_0x24c35e[_0x0799('0x35')]=qs[_0x0799('0x36')](_[_0x0799('0x4e')](_0x2de000[_0x0799('0x2f')],_0x548daf[_0x0799('0x36')]));if(_0x2de000[_0x0799('0x2f')]['filter']){_0x24c35e[_0x0799('0x35')]=_[_0x0799('0x4b')](_0x24c35e[_0x0799('0x35')],{'$or':_[_0x0799('0x2d')](_0x24c35e[_0x0799('0x32')],function(_0x58f163){var _0x5cee95={};_0x5cee95[_0x58f163]={'$like':'%'+_0x2de000[_0x0799('0x2f')][_0x0799('0x37')]+'%'};return _0x5cee95;})});}_0x24c35e=_[_0x0799('0x4b')]({},_0x24c35e,_0x2de000[_0x0799('0x39')]);return _0x5a40f1[_0x0799('0x4f')](_0x24c35e);}})[_0x0799('0x22')](function(_0x57d992){if(_0x57d992){_0x7be13e=_0x57d992[_0x0799('0x41')];if(!_0x2de000['query']['hasOwnProperty'](_0x0799('0x33'))){_0x24c35e[_0x0799('0x1b')]=qs[_0x0799('0x1b')](_0x2de000['query'][_0x0799('0x1b')]);_0x24c35e[_0x0799('0x19')]=qs[_0x0799('0x19')](_0x2de000[_0x0799('0x2f')]['offset']);}return _0x5a40f1[_0x0799('0x4f')](_0x24c35e);}})[_0x0799('0x22')](function(_0x4e29b0){if(_0x4e29b0){return _0x4e29b0?{'count':_0x7be13e,'rows':_0x4e29b0}:null;}})[_0x0799('0x22')](respondWithResult(_0x53c9f3,null))[_0x0799('0x44')](handleError(_0x53c9f3,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index ce0664a..2c4703b 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 _0x1c9a=['moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger'];(function(_0x2b6268,_0x53acef){var _0x4ad50e=function(_0x11c3f7){while(--_0x11c3f7){_0x2b6268['push'](_0x2b6268['shift']());}};_0x4ad50e(++_0x53acef);}(_0x1c9a,0x98));var _0xa1c9=function(_0x1554a5,_0x374a5e){_0x1554a5=_0x1554a5-0x0;var _0x3eac50=_0x1c9a[_0x1554a5];return _0x3eac50;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var logger=require(_0xa1c9('0x1'))('api');var moment=require(_0xa1c9('0x2'));var BPromise=require(_0xa1c9('0x3'));var rp=require(_0xa1c9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1c9('0x5'));var config=require(_0xa1c9('0x6'));var attributes=require(_0xa1c9('0x7'));module[_0xa1c9('0x8')]=function(_0x572229,_0x144e91){return _0x572229['define'](_0xa1c9('0x9'),attributes,{'tableName':_0xa1c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcac2=['../../config/logger','moment','bluebird','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0xc4ea75,_0x273753){var _0x52ea5e=function(_0x1ee872){while(--_0x1ee872){_0xc4ea75['push'](_0xc4ea75['shift']());}};_0x52ea5e(++_0x273753);}(_0xcac2,0x1e8));var _0x2cac=function(_0x37c9c7,_0x436ff0){_0x37c9c7=_0x37c9c7-0x0;var _0x23ff77=_0xcac2[_0x37c9c7];return _0x23ff77;};'use strict';var _=require(_0x2cac('0x0'));var util=require(_0x2cac('0x1'));var logger=require(_0x2cac('0x2'))('api');var moment=require(_0x2cac('0x3'));var BPromise=require(_0x2cac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2cac('0x5'));module[_0x2cac('0x6')]=function(_0x26b741,_0x2ab257){return _0x26b741[_0x2cac('0x7')](_0x2cac('0x8'),attributes,{'tableName':_0x2cac('0x9'),'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 97b4250..b2d500c 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 _0xcbef=['then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xcbef,0x11a));var _0xfcbe=function(_0x42c903,_0x5c81bc){_0x42c903=_0x42c903-0x0;var _0xcfd717=_0xcbef[_0x42c903];return _0xcfd717;};'use strict';var _=require('lodash');var util=require(_0xfcbe('0x0'));var moment=require(_0xfcbe('0x1'));var BPromise=require('bluebird');var rs=require(_0xfcbe('0x2'));var fs=require('fs');var Redis=require(_0xfcbe('0x3'));var db=require(_0xfcbe('0x4'))['db'];var utils=require(_0xfcbe('0x5'));var logger=require(_0xfcbe('0x6'))(_0xfcbe('0x7'));var config=require(_0xfcbe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfcbe('0x9')][_0xfcbe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x447001,_0x1ec46c,_0x24cf22){return new BPromise(function(_0xc9105c,_0xcd71d8){return client[_0xfcbe('0xb')](_0x447001,_0x24cf22)[_0xfcbe('0xc')](function(_0x223b8d){logger['info'](_0xfcbe('0xd'),_0x1ec46c,_0xfcbe('0xe'));logger[_0xfcbe('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x1ec46c,_0xfcbe('0xe'),JSON[_0xfcbe('0x10')](_0x223b8d));if(_0x223b8d['error']){if(_0x223b8d['error']['code']===0x1f4){logger[_0xfcbe('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1ec46c,_0x223b8d[_0xfcbe('0x11')][_0xfcbe('0x12')]);return _0xcd71d8(_0x223b8d[_0xfcbe('0x11')][_0xfcbe('0x12')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x1ec46c,_0x223b8d[_0xfcbe('0x11')][_0xfcbe('0x12')]);return _0xc9105c(_0x223b8d['error']['message']);}else{logger[_0xfcbe('0x13')](_0xfcbe('0xd'),_0x1ec46c,_0xfcbe('0xe'));_0xc9105c(_0x223b8d['result'][_0xfcbe('0x12')]);}})[_0xfcbe('0x14')](function(_0x40fcee){logger[_0xfcbe('0x11')](_0xfcbe('0xd'),_0x1ec46c,_0x40fcee);_0xcd71d8(_0x40fcee);});});} \ No newline at end of file +var _0x1509=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0xd2bb3d,_0x8d10){var _0x36a213=function(_0x3f4848){while(--_0x3f4848){_0xd2bb3d['push'](_0xd2bb3d['shift']());}};_0x36a213(++_0x8d10);}(_0x1509,0x15c));var _0x9150=function(_0x3281d9,_0x2f0dcd){_0x3281d9=_0x3281d9-0x0;var _0x21a66f=_0x1509[_0x3281d9];return _0x21a66f;};'use strict';var _=require(_0x9150('0x0'));var util=require(_0x9150('0x1'));var moment=require(_0x9150('0x2'));var BPromise=require(_0x9150('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9150('0x4'));var db=require(_0x9150('0x5'))['db'];var utils=require(_0x9150('0x6'));var logger=require(_0x9150('0x7'))(_0x9150('0x8'));var config=require(_0x9150('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9150('0xa')][_0x9150('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6a1075,_0x47281c,_0x4a45a8){return new BPromise(function(_0x25ea20,_0x300da8){return client['request'](_0x6a1075,_0x4a45a8)['then'](function(_0xdbf6fa){logger[_0x9150('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x47281c,_0x9150('0xd'));logger[_0x9150('0xe')](_0x9150('0xf'),_0x47281c,_0x9150('0xd'),JSON[_0x9150('0x10')](_0xdbf6fa));if(_0xdbf6fa['error']){if(_0xdbf6fa[_0x9150('0x11')]['code']===0x1f4){logger[_0x9150('0x11')](_0x9150('0x12'),_0x47281c,_0xdbf6fa[_0x9150('0x11')][_0x9150('0x13')]);return _0x300da8(_0xdbf6fa['error'][_0x9150('0x13')]);}logger[_0x9150('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x47281c,_0xdbf6fa[_0x9150('0x11')][_0x9150('0x13')]);return _0x25ea20(_0xdbf6fa[_0x9150('0x11')]['message']);}else{logger[_0x9150('0xc')](_0x9150('0x12'),_0x47281c,_0x9150('0xd'));_0x25ea20(_0xdbf6fa[_0x9150('0x14')][_0x9150('0x13')]);}})[_0x9150('0x15')](function(_0x4184bb){logger[_0x9150('0x11')](_0x9150('0x12'),_0x47281c,_0x4184bb);_0x300da8(_0x4184bb);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f35e2b1..29d280f 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 _0xc870=['delete','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x28d210,_0x25532e){var _0x124155=function(_0x4cf45c){while(--_0x4cf45c){_0x28d210['push'](_0x28d210['shift']());}};_0x124155(++_0x25532e);}(_0xc870,0x69));var _0x0c87=function(_0x4d17a2,_0x3ba7a2){_0x4d17a2=_0x4d17a2-0x0;var _0x414282=_0xc870[_0x4d17a2];return _0x414282;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c87('0x0'));var router=express[_0x0c87('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x0c87('0x2'));var interaction=require(_0x0c87('0x3'));var config=require(_0x0c87('0x4'));var controller=require(_0x0c87('0x5'));router[_0x0c87('0x6')]('/',auth[_0x0c87('0x7')](),controller[_0x0c87('0x8')]);router[_0x0c87('0x6')](_0x0c87('0x9'),auth[_0x0c87('0x7')](),controller['show']);router[_0x0c87('0xa')]('/',auth['isAuthenticated'](),controller[_0x0c87('0xb')]);router[_0x0c87('0xc')](_0x0c87('0x9'),auth[_0x0c87('0x7')](),controller[_0x0c87('0xd')]);router[_0x0c87('0xe')]('/:id',auth[_0x0c87('0x7')](),controller[_0x0c87('0xf')]);module[_0x0c87('0x10')]=router; \ No newline at end of file +var _0xf85e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x29cc51,_0x147079){var _0x516703=function(_0x292c27){while(--_0x292c27){_0x29cc51['push'](_0x29cc51['shift']());}};_0x516703(++_0x147079);}(_0xf85e,0x129));var _0xef85=function(_0x209b99,_0x303841){_0x209b99=_0x209b99-0x0;var _0x4f9bde=_0xf85e[_0x209b99];return _0x4f9bde;};'use strict';var multer=require(_0xef85('0x0'));var util=require(_0xef85('0x1'));var path=require(_0xef85('0x2'));var timeout=require('connect-timeout');var express=require(_0xef85('0x3'));var router=express[_0xef85('0x4')]();var fs_extra=require(_0xef85('0x5'));var auth=require(_0xef85('0x6'));var interaction=require(_0xef85('0x7'));var config=require(_0xef85('0x8'));var controller=require('./intServicenowField.controller');router[_0xef85('0x9')]('/',auth[_0xef85('0xa')](),controller[_0xef85('0xb')]);router[_0xef85('0x9')](_0xef85('0xc'),auth[_0xef85('0xa')](),controller['show']);router[_0xef85('0xd')]('/',auth[_0xef85('0xa')](),controller[_0xef85('0xe')]);router[_0xef85('0xf')]('/:id',auth[_0xef85('0xa')](),controller[_0xef85('0x10')]);router[_0xef85('0x11')](_0xef85('0xc'),auth[_0xef85('0xa')](),controller[_0xef85('0x12')]);module[_0xef85('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 8486d10..ebb62ae 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 _0xd676=['string','BOOLEAN','exports','ENUM','variable','customVariable','picklist','STRING'];(function(_0x4c5df1,_0xa4195e){var _0x528207=function(_0x504333){while(--_0x504333){_0x4c5df1['push'](_0x4c5df1['shift']());}};_0x528207(++_0xa4195e);}(_0xd676,0x82));var _0x6d67=function(_0x5bf6f8,_0x16754f){_0x5bf6f8=_0x5bf6f8-0x0;var _0x25302a=_0xd676[_0x5bf6f8];return _0x25302a;};'use strict';var Sequelize=require('sequelize');module[_0x6d67('0x0')]={'type':{'type':Sequelize[_0x6d67('0x1')]('string',_0x6d67('0x2'),_0x6d67('0x3'),'keyValue',_0x6d67('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6d67('0x5')]},'key':{'type':Sequelize[_0x6d67('0x5')]},'keyType':{'type':Sequelize[_0x6d67('0x1')](_0x6d67('0x6'),_0x6d67('0x2'),_0x6d67('0x3'))},'keyContent':{'type':Sequelize[_0x6d67('0x5')]},'idField':{'type':Sequelize[_0x6d67('0x5')]},'nameField':{'type':Sequelize[_0x6d67('0x5')]},'customField':{'type':Sequelize[_0x6d67('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6d67('0x5')]}}; \ No newline at end of file +var _0xc329=['ENUM','variable','keyValue','picklist','STRING','string','customVariable','BOOLEAN','sequelize','exports'];(function(_0x3182f5,_0x31f86e){var _0x5ee63b=function(_0x533678){while(--_0x533678){_0x3182f5['push'](_0x3182f5['shift']());}};_0x5ee63b(++_0x31f86e);}(_0xc329,0x80));var _0x9c32=function(_0x3d00db,_0x3692b3){_0x3d00db=_0x3d00db-0x0;var _0x41f115=_0xc329[_0x3d00db];return _0x41f115;};'use strict';var Sequelize=require(_0x9c32('0x0'));module[_0x9c32('0x1')]={'type':{'type':Sequelize[_0x9c32('0x2')]('string',_0x9c32('0x3'),'customVariable',_0x9c32('0x4'),_0x9c32('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9c32('0x6')]},'keyType':{'type':Sequelize[_0x9c32('0x2')](_0x9c32('0x7'),_0x9c32('0x3'),_0x9c32('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9c32('0x6')]},'customField':{'type':Sequelize[_0x9c32('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 27f3bf2..034ff07 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 _0x2478=['filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','ServicenowField','rawAttributes','fieldName','key','model','map','query','keys'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2478,0xad));var _0x8247=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x2478[_0x36ed48];return _0x51c63a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8247('0x0'));var zipdir=require(_0x8247('0x1'));var jsonpatch=require(_0x8247('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8247('0x3'));var Mustache=require(_0x8247('0x4'));var util=require(_0x8247('0x5'));var path=require(_0x8247('0x6'));var sox=require(_0x8247('0x7'));var csv=require(_0x8247('0x8'));var ejs=require(_0x8247('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8247('0xa'));var crypto=require(_0x8247('0xb'));var jsforce=require(_0x8247('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8247('0x8'));var querystring=require('querystring');var Papa=require(_0x8247('0xd'));var Redis=require(_0x8247('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8247('0xf'));var as=require(_0x8247('0x10'));var hardwareService=require(_0x8247('0x11'));var logger=require(_0x8247('0x12'))(_0x8247('0x13'));var utils=require('../../config/utils');var config=require(_0x8247('0x14'));var licenseUtil=require(_0x8247('0x15'));var db=require(_0x8247('0x16'))['db'];function respondWithStatusCode(_0x43bba7,_0x4d10ee){_0x4d10ee=_0x4d10ee||0xcc;return function(_0x5db3dc){if(_0x5db3dc){return _0x43bba7['sendStatus'](_0x4d10ee);}return _0x43bba7[_0x8247('0x17')](_0x4d10ee)[_0x8247('0x18')]();};}function respondWithResult(_0x83291a,_0x35cc71){_0x35cc71=_0x35cc71||0xc8;return function(_0x1d52a1){if(_0x1d52a1){return _0x83291a[_0x8247('0x17')](_0x35cc71)[_0x8247('0x19')](_0x1d52a1);}};}function respondWithFilteredResult(_0x58c68d,_0x51c790){return function(_0x627571){if(_0x627571){var _0x331ff6=typeof _0x51c790[_0x8247('0x1a')]===_0x8247('0x1b')&&typeof _0x51c790[_0x8247('0x1c')]===_0x8247('0x1b');var _0xc6fe06=_0x627571[_0x8247('0x1d')];var _0x277824=_0x331ff6?0x0:_0x51c790['offset'];var _0x1116ec=_0x331ff6?_0x627571[_0x8247('0x1d')]:_0x51c790[_0x8247('0x1a')]+_0x51c790[_0x8247('0x1c')];var _0x5bd7dc;if(_0x1116ec>=_0xc6fe06){_0x1116ec=_0xc6fe06;_0x5bd7dc=0xc8;}else{_0x5bd7dc=0xce;}_0x58c68d[_0x8247('0x17')](_0x5bd7dc);return _0x58c68d[_0x8247('0x1e')]('Content-Range',_0x277824+'-'+_0x1116ec+'/'+_0xc6fe06)[_0x8247('0x19')](_0x627571);}return null;};}function patchUpdates(_0x3d3661){return function(_0x589e12){try{jsonpatch[_0x8247('0x1f')](_0x589e12,_0x3d3661,!![]);}catch(_0x1ab1bd){return BPromise[_0x8247('0x20')](_0x1ab1bd);}return _0x589e12['save']();};}function saveUpdates(_0x163360,_0x21209a){return function(_0x47973a){if(_0x47973a){return _0x47973a[_0x8247('0x21')](_0x163360)[_0x8247('0x22')](function(_0x445e69){return _0x445e69;});}return null;};}function removeEntity(_0x4f4a38,_0x1c9622){return function(_0x216cc5){if(_0x216cc5){return _0x216cc5[_0x8247('0x23')]()[_0x8247('0x22')](function(){_0x4f4a38[_0x8247('0x17')](0xcc)[_0x8247('0x18')]();});}};}function handleEntityNotFound(_0x3a98e2,_0xd16c59){return function(_0x26bd18){if(!_0x26bd18){_0x3a98e2[_0x8247('0x24')](0x194);}return _0x26bd18;};}function handleError(_0x2132a4,_0x32e8e4){_0x32e8e4=_0x32e8e4||0x1f4;return function(_0x2cae9d){logger[_0x8247('0x25')](_0x2cae9d[_0x8247('0x26')]);if(_0x2cae9d[_0x8247('0x27')]){delete _0x2cae9d[_0x8247('0x27')];}_0x2132a4[_0x8247('0x17')](_0x32e8e4)[_0x8247('0x28')](_0x2cae9d);};}exports['index']=function(_0x3d5a30,_0x171772){var _0x508d25={},_0x54d6c1={},_0x51b65e={'count':0x0,'rows':[]};var _0x163dca=_['map'](db[_0x8247('0x29')][_0x8247('0x2a')],function(_0x569511){return{'name':_0x569511[_0x8247('0x2b')],'type':_0x569511['type'][_0x8247('0x2c')]};});_0x54d6c1[_0x8247('0x2d')]=_[_0x8247('0x2e')](_0x163dca,_0x8247('0x27'));_0x54d6c1[_0x8247('0x2f')]=_[_0x8247('0x30')](_0x3d5a30[_0x8247('0x2f')]);_0x54d6c1[_0x8247('0x31')]=_[_0x8247('0x32')](_0x54d6c1[_0x8247('0x2d')],_0x54d6c1['query']);_0x508d25[_0x8247('0x33')]=_['intersection'](_0x54d6c1[_0x8247('0x2d')],qs['fields'](_0x3d5a30['query']['fields']));_0x508d25[_0x8247('0x33')]=_0x508d25[_0x8247('0x33')][_0x8247('0x34')]?_0x508d25[_0x8247('0x33')]:_0x54d6c1['model'];if(!_0x3d5a30[_0x8247('0x2f')][_0x8247('0x35')](_0x8247('0x36'))){_0x508d25['limit']=qs['limit'](_0x3d5a30[_0x8247('0x2f')][_0x8247('0x1c')]);_0x508d25['offset']=qs[_0x8247('0x1a')](_0x3d5a30[_0x8247('0x2f')]['offset']);}_0x508d25[_0x8247('0x37')]=qs['sort'](_0x3d5a30['query'][_0x8247('0x38')]);_0x508d25['where']=qs[_0x8247('0x31')](_[_0x8247('0x39')](_0x3d5a30[_0x8247('0x2f')],_0x54d6c1[_0x8247('0x31')]),_0x163dca);if(_0x3d5a30[_0x8247('0x2f')][_0x8247('0x3a')]){_0x508d25[_0x8247('0x3b')]=_[_0x8247('0x3c')](_0x508d25[_0x8247('0x3b')],{'$or':_[_0x8247('0x2e')](_0x163dca,function(_0xdc3cbc){if(_0xdc3cbc['type']!==_0x8247('0x3d')){var _0x3e88df={};_0x3e88df[_0xdc3cbc[_0x8247('0x27')]]={'$like':'%'+_0x3d5a30[_0x8247('0x2f')][_0x8247('0x3a')]+'%'};return _0x3e88df;}})});}_0x508d25=_['merge']({},_0x508d25,_0x3d5a30['options']);var _0x7b2c7f={'where':_0x508d25[_0x8247('0x3b')]};return db[_0x8247('0x29')][_0x8247('0x1d')](_0x7b2c7f)['then'](function(_0x11db1a){_0x51b65e[_0x8247('0x1d')]=_0x11db1a;if(_0x3d5a30[_0x8247('0x2f')][_0x8247('0x3e')]){_0x508d25[_0x8247('0x3f')]=[{'all':!![]}];}return db[_0x8247('0x29')][_0x8247('0x40')](_0x508d25);})[_0x8247('0x22')](function(_0x26fec0){_0x51b65e[_0x8247('0x41')]=_0x26fec0;return _0x51b65e;})[_0x8247('0x22')](respondWithFilteredResult(_0x171772,_0x508d25))[_0x8247('0x42')](handleError(_0x171772,null));};exports[_0x8247('0x43')]=function(_0x14314e,_0x2853a3){var _0x253133={'raw':!![],'where':{'id':_0x14314e[_0x8247('0x44')]['id']}},_0x154fa9={};_0x154fa9['model']=_[_0x8247('0x30')](db['ServicenowField'][_0x8247('0x2a')]);_0x154fa9['query']=_[_0x8247('0x30')](_0x14314e[_0x8247('0x2f')]);_0x154fa9[_0x8247('0x31')]=_[_0x8247('0x32')](_0x154fa9[_0x8247('0x2d')],_0x154fa9['query']);_0x253133['attributes']=_[_0x8247('0x32')](_0x154fa9[_0x8247('0x2d')],qs[_0x8247('0x45')](_0x14314e[_0x8247('0x2f')][_0x8247('0x45')]));_0x253133[_0x8247('0x33')]=_0x253133[_0x8247('0x33')][_0x8247('0x34')]?_0x253133[_0x8247('0x33')]:_0x154fa9[_0x8247('0x2d')];if(_0x14314e[_0x8247('0x2f')][_0x8247('0x3e')]){_0x253133['include']=[{'all':!![]}];}_0x253133=_[_0x8247('0x3c')]({},_0x253133,_0x14314e[_0x8247('0x46')]);return db['ServicenowField'][_0x8247('0x47')](_0x253133)[_0x8247('0x22')](handleEntityNotFound(_0x2853a3,null))[_0x8247('0x22')](respondWithResult(_0x2853a3,null))[_0x8247('0x42')](handleError(_0x2853a3,null));};exports[_0x8247('0x48')]=function(_0x4cd184,_0x446b73){return db[_0x8247('0x29')][_0x8247('0x48')](_0x4cd184[_0x8247('0x49')],{})[_0x8247('0x22')](respondWithResult(_0x446b73,0xc9))[_0x8247('0x42')](handleError(_0x446b73,null));};exports[_0x8247('0x21')]=function(_0x55ee43,_0x1e25a3){if(_0x55ee43[_0x8247('0x49')]['id']){delete _0x55ee43[_0x8247('0x49')]['id'];}return db[_0x8247('0x29')][_0x8247('0x47')]({'where':{'id':_0x55ee43['params']['id']}})['then'](handleEntityNotFound(_0x1e25a3,null))[_0x8247('0x22')](saveUpdates(_0x55ee43[_0x8247('0x49')],null))[_0x8247('0x22')](respondWithResult(_0x1e25a3,null))['catch'](handleError(_0x1e25a3,null));};exports['destroy']=function(_0x58aaea,_0x2b71fc){return db[_0x8247('0x29')]['find']({'where':{'id':_0x58aaea[_0x8247('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b71fc,null))[_0x8247('0x22')](removeEntity(_0x2b71fc,null))[_0x8247('0x42')](handleError(_0x2b71fc,null));}; \ No newline at end of file +var _0x12ff=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','update','error','stack','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','name','options','then','includeAll','include','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x12ff,0x120));var _0xf12f=function(_0x32e93e,_0x2c7db2){_0x32e93e=_0x32e93e-0x0;var _0x182712=_0x12ff[_0x32e93e];return _0x182712;};'use strict';var emlformat=require(_0xf12f('0x0'));var rimraf=require(_0xf12f('0x1'));var zipdir=require(_0xf12f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf12f('0x3'));var moment=require(_0xf12f('0x4'));var BPromise=require(_0xf12f('0x5'));var Mustache=require(_0xf12f('0x6'));var util=require(_0xf12f('0x7'));var path=require(_0xf12f('0x8'));var sox=require(_0xf12f('0x9'));var csv=require(_0xf12f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf12f('0xb'));var _=require(_0xf12f('0xc'));var squel=require(_0xf12f('0xd'));var crypto=require(_0xf12f('0xe'));var jsforce=require(_0xf12f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf12f('0xa'));var querystring=require('querystring');var Papa=require(_0xf12f('0x10'));var Redis=require(_0xf12f('0x11'));var authService=require(_0xf12f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf12f('0x13'))(_0xf12f('0x14'));var utils=require(_0xf12f('0x15'));var config=require(_0xf12f('0x16'));var licenseUtil=require(_0xf12f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35cbd2,_0x2d092f){_0x2d092f=_0x2d092f||0xcc;return function(_0x4a808c){if(_0x4a808c){return _0x35cbd2[_0xf12f('0x18')](_0x2d092f);}return _0x35cbd2[_0xf12f('0x19')](_0x2d092f)[_0xf12f('0x1a')]();};}function respondWithResult(_0x35efeb,_0x207f68){_0x207f68=_0x207f68||0xc8;return function(_0x33075c){if(_0x33075c){return _0x35efeb['status'](_0x207f68)[_0xf12f('0x1b')](_0x33075c);}};}function respondWithFilteredResult(_0x2b2dba,_0x342e00){return function(_0xeb80b5){if(_0xeb80b5){var _0x315cef=typeof _0x342e00['offset']===_0xf12f('0x1c')&&typeof _0x342e00[_0xf12f('0x1d')]==='undefined';var _0x25bbc4=_0xeb80b5[_0xf12f('0x1e')];var _0x2ce16b=_0x315cef?0x0:_0x342e00['offset'];var _0x3939bc=_0x315cef?_0xeb80b5['count']:_0x342e00['offset']+_0x342e00['limit'];var _0x5cbebe;if(_0x3939bc>=_0x25bbc4){_0x3939bc=_0x25bbc4;_0x5cbebe=0xc8;}else{_0x5cbebe=0xce;}_0x2b2dba[_0xf12f('0x19')](_0x5cbebe);return _0x2b2dba[_0xf12f('0x1f')](_0xf12f('0x20'),_0x2ce16b+'-'+_0x3939bc+'/'+_0x25bbc4)[_0xf12f('0x1b')](_0xeb80b5);}return null;};}function patchUpdates(_0x3ca9a3){return function(_0x32b3c4){try{jsonpatch[_0xf12f('0x21')](_0x32b3c4,_0x3ca9a3,!![]);}catch(_0x34c0f3){return BPromise[_0xf12f('0x22')](_0x34c0f3);}return _0x32b3c4['save']();};}function saveUpdates(_0x327613,_0x14c047){return function(_0x456478){if(_0x456478){return _0x456478[_0xf12f('0x23')](_0x327613)['then'](function(_0x9528fe){return _0x9528fe;});}return null;};}function removeEntity(_0x59d774,_0xbea9d4){return function(_0x22482c){if(_0x22482c){return _0x22482c['destroy']()['then'](function(){_0x59d774['status'](0xcc)[_0xf12f('0x1a')]();});}};}function handleEntityNotFound(_0x4518ff,_0x1c88d2){return function(_0x795107){if(!_0x795107){_0x4518ff[_0xf12f('0x18')](0x194);}return _0x795107;};}function handleError(_0x5efd8e,_0x49a0d8){_0x49a0d8=_0x49a0d8||0x1f4;return function(_0x314ab6){logger[_0xf12f('0x24')](_0x314ab6[_0xf12f('0x25')]);if(_0x314ab6['name']){delete _0x314ab6['name'];}_0x5efd8e[_0xf12f('0x19')](_0x49a0d8)['send'](_0x314ab6);};}exports[_0xf12f('0x26')]=function(_0x1d9422,_0x19f7f5){var _0x46db04={},_0x5e84e1={},_0x4ed380={'count':0x0,'rows':[]};var _0x41bdeb=_[_0xf12f('0x27')](db[_0xf12f('0x28')][_0xf12f('0x29')],function(_0x8e81ae){return{'name':_0x8e81ae[_0xf12f('0x2a')],'type':_0x8e81ae[_0xf12f('0x2b')][_0xf12f('0x2c')]};});_0x5e84e1['model']=_[_0xf12f('0x27')](_0x41bdeb,'name');_0x5e84e1[_0xf12f('0x2d')]=_[_0xf12f('0x2e')](_0x1d9422[_0xf12f('0x2d')]);_0x5e84e1[_0xf12f('0x2f')]=_[_0xf12f('0x30')](_0x5e84e1[_0xf12f('0x31')],_0x5e84e1[_0xf12f('0x2d')]);_0x46db04[_0xf12f('0x32')]=_[_0xf12f('0x30')](_0x5e84e1['model'],qs[_0xf12f('0x33')](_0x1d9422[_0xf12f('0x2d')][_0xf12f('0x33')]));_0x46db04[_0xf12f('0x32')]=_0x46db04[_0xf12f('0x32')][_0xf12f('0x34')]?_0x46db04['attributes']:_0x5e84e1[_0xf12f('0x31')];if(!_0x1d9422['query'][_0xf12f('0x35')]('nolimit')){_0x46db04[_0xf12f('0x1d')]=qs['limit'](_0x1d9422[_0xf12f('0x2d')][_0xf12f('0x1d')]);_0x46db04[_0xf12f('0x36')]=qs[_0xf12f('0x36')](_0x1d9422[_0xf12f('0x2d')][_0xf12f('0x36')]);}_0x46db04[_0xf12f('0x37')]=qs[_0xf12f('0x38')](_0x1d9422[_0xf12f('0x2d')]['sort']);_0x46db04[_0xf12f('0x39')]=qs['filters'](_[_0xf12f('0x3a')](_0x1d9422[_0xf12f('0x2d')],_0x5e84e1[_0xf12f('0x2f')]),_0x41bdeb);if(_0x1d9422['query'][_0xf12f('0x3b')]){_0x46db04[_0xf12f('0x39')]=_[_0xf12f('0x3c')](_0x46db04['where'],{'$or':_[_0xf12f('0x27')](_0x41bdeb,function(_0x361006){if(_0x361006[_0xf12f('0x2b')]!=='VIRTUAL'){var _0xc02a27={};_0xc02a27[_0x361006[_0xf12f('0x3d')]]={'$like':'%'+_0x1d9422[_0xf12f('0x2d')][_0xf12f('0x3b')]+'%'};return _0xc02a27;}})});}_0x46db04=_['merge']({},_0x46db04,_0x1d9422[_0xf12f('0x3e')]);var _0x1fd875={'where':_0x46db04['where']};return db['ServicenowField'][_0xf12f('0x1e')](_0x1fd875)[_0xf12f('0x3f')](function(_0x2c917a){_0x4ed380[_0xf12f('0x1e')]=_0x2c917a;if(_0x1d9422[_0xf12f('0x2d')][_0xf12f('0x40')]){_0x46db04[_0xf12f('0x41')]=[{'all':!![]}];}return db[_0xf12f('0x28')]['findAll'](_0x46db04);})[_0xf12f('0x3f')](function(_0x362a75){_0x4ed380['rows']=_0x362a75;return _0x4ed380;})[_0xf12f('0x3f')](respondWithFilteredResult(_0x19f7f5,_0x46db04))[_0xf12f('0x42')](handleError(_0x19f7f5,null));};exports[_0xf12f('0x43')]=function(_0x37620e,_0x4686dd){var _0x6fdc99={'raw':!![],'where':{'id':_0x37620e[_0xf12f('0x44')]['id']}},_0x28cca4={};_0x28cca4[_0xf12f('0x31')]=_[_0xf12f('0x2e')](db[_0xf12f('0x28')][_0xf12f('0x29')]);_0x28cca4[_0xf12f('0x2d')]=_['keys'](_0x37620e[_0xf12f('0x2d')]);_0x28cca4[_0xf12f('0x2f')]=_[_0xf12f('0x30')](_0x28cca4[_0xf12f('0x31')],_0x28cca4[_0xf12f('0x2d')]);_0x6fdc99[_0xf12f('0x32')]=_['intersection'](_0x28cca4[_0xf12f('0x31')],qs['fields'](_0x37620e['query'][_0xf12f('0x33')]));_0x6fdc99['attributes']=_0x6fdc99[_0xf12f('0x32')]['length']?_0x6fdc99[_0xf12f('0x32')]:_0x28cca4[_0xf12f('0x31')];if(_0x37620e[_0xf12f('0x2d')][_0xf12f('0x40')]){_0x6fdc99['include']=[{'all':!![]}];}_0x6fdc99=_['merge']({},_0x6fdc99,_0x37620e[_0xf12f('0x3e')]);return db[_0xf12f('0x28')][_0xf12f('0x45')](_0x6fdc99)[_0xf12f('0x3f')](handleEntityNotFound(_0x4686dd,null))['then'](respondWithResult(_0x4686dd,null))[_0xf12f('0x42')](handleError(_0x4686dd,null));};exports['create']=function(_0x3e6744,_0x163afb){return db[_0xf12f('0x28')][_0xf12f('0x46')](_0x3e6744[_0xf12f('0x47')],{})['then'](respondWithResult(_0x163afb,0xc9))[_0xf12f('0x42')](handleError(_0x163afb,null));};exports['update']=function(_0x22a1df,_0x575229){if(_0x22a1df['body']['id']){delete _0x22a1df[_0xf12f('0x47')]['id'];}return db['ServicenowField'][_0xf12f('0x45')]({'where':{'id':_0x22a1df['params']['id']}})[_0xf12f('0x3f')](handleEntityNotFound(_0x575229,null))[_0xf12f('0x3f')](saveUpdates(_0x22a1df[_0xf12f('0x47')],null))[_0xf12f('0x3f')](respondWithResult(_0x575229,null))[_0xf12f('0x42')](handleError(_0x575229,null));};exports[_0xf12f('0x48')]=function(_0x5c9d44,_0x2e952b){return db[_0xf12f('0x28')][_0xf12f('0x45')]({'where':{'id':_0x5c9d44[_0xf12f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e952b,null))['then'](removeEntity(_0x2e952b,null))['catch'](handleError(_0x2e952b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index ce1cb68..1cf32d4 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 _0x65f1=['path','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x427877,_0x38645d){var _0x2e0cb2=function(_0x1a04c9){while(--_0x1a04c9){_0x427877['push'](_0x427877['shift']());}};_0x2e0cb2(++_0x38645d);}(_0x65f1,0x9f));var _0x165f=function(_0x40b2ed,_0x2b1765){_0x40b2ed=_0x40b2ed-0x0;var _0x18397d=_0x65f1[_0x40b2ed];return _0x18397d;};'use strict';var _=require(_0x165f('0x0'));var util=require(_0x165f('0x1'));var logger=require(_0x165f('0x2'))('api');var moment=require(_0x165f('0x3'));var BPromise=require(_0x165f('0x4'));var rp=require(_0x165f('0x5'));var fs=require('fs');var path=require(_0x165f('0x6'));var rimraf=require('rimraf');var config=require(_0x165f('0x7'));var attributes=require(_0x165f('0x8'));module['exports']=function(_0x2f6829,_0x1c0caa){return _0x2f6829[_0x165f('0x9')](_0x165f('0xa'),attributes,{'tableName':_0x165f('0xb'),'paranoid':![],'indexes':[{'name':_0x165f('0xc'),'fields':[_0x165f('0xd'),_0x165f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0659=['int_servicenow_fields','servicenow_unique_index','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports'];(function(_0x4c8d62,_0x290549){var _0x55b5a2=function(_0x3ac230){while(--_0x3ac230){_0x4c8d62['push'](_0x4c8d62['shift']());}};_0x55b5a2(++_0x290549);}(_0x0659,0x9f));var _0x9065=function(_0x3b06f3,_0x349f69){_0x3b06f3=_0x3b06f3-0x0;var _0x4c9b1b=_0x0659[_0x3b06f3];return _0x4c9b1b;};'use strict';var _=require('lodash');var util=require(_0x9065('0x0'));var logger=require(_0x9065('0x1'))(_0x9065('0x2'));var moment=require(_0x9065('0x3'));var BPromise=require('bluebird');var rp=require(_0x9065('0x4'));var fs=require('fs');var path=require(_0x9065('0x5'));var rimraf=require(_0x9065('0x6'));var config=require(_0x9065('0x7'));var attributes=require(_0x9065('0x8'));module[_0x9065('0x9')]=function(_0x5bd970,_0x176103){return _0x5bd970['define']('ServicenowField',attributes,{'tableName':_0x9065('0xa'),'paranoid':![],'indexes':[{'name':_0x9065('0xb'),'fields':['idField',_0x9065('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 45ff0ad..1acfa23 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 _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(_0xc6a817,_0x92e4e){var _0x3cb6bb=function(_0x94a24c){while(--_0x94a24c){_0xc6a817['push'](_0xc6a817['shift']());}};_0x3cb6bb(++_0x92e4e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xcb91[_0x2f6f50];return _0x2cf365;};'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 +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x15204b,_0x12d6af){var _0x410d73=function(_0x48e1df){while(--_0x48e1df){_0x15204b['push'](_0x15204b['shift']());}};_0x410d73(++_0x12d6af);}(_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 moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index f7d17cf..757e5c3 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x135ebf,_0x4b7864){var _0x14ef74=function(_0x4a77cc){while(--_0x4a77cc){_0x135ebf['push'](_0x135ebf['shift']());}};_0x14ef74(++_0x4b7864);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2763b7,_0x4eed84){var _0x9f49c8=function(_0x318aa7){while(--_0x318aa7){_0x2763b7['push'](_0x2763b7['shift']());}};_0x9f49c8(++_0x4eed84);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 5ee377f..d0ffc22 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(_0x1f113f,_0x28b09b){var _0x413408=function(_0x328f8e){while(--_0x328f8e){_0x1f113f['push'](_0x1f113f['shift']());}};_0x413408(++_0x28b09b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x123f70,_0x245089){var _0x47f2ec=function(_0x3e6f3a){while(--_0x3e6f3a){_0x123f70['push'](_0x123f70['shift']());}};_0x47f2ec(++_0x245089);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 2990f33..1fd49e4 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 _0x5b91=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','index','map','SugarcrmAccount','fieldName','type','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','filter','options','count','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_id','parent_name','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Calls','values','module_fields','includes','label','endsWith','value','test','statusCode','error','stringify','Wrong\x20credentials','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x5b91,0x1e2));var _0x15b9=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0x5b91[_0x148c09];return _0x18e613;};'use strict';var emlformat=require(_0x15b9('0x0'));var rimraf=require(_0x15b9('0x1'));var zipdir=require(_0x15b9('0x2'));var jsonpatch=require(_0x15b9('0x3'));var rp=require(_0x15b9('0x4'));var moment=require(_0x15b9('0x5'));var BPromise=require(_0x15b9('0x6'));var Mustache=require(_0x15b9('0x7'));var util=require(_0x15b9('0x8'));var path=require(_0x15b9('0x9'));var sox=require(_0x15b9('0xa'));var csv=require(_0x15b9('0xb'));var ejs=require(_0x15b9('0xc'));var fs=require('fs');var fs_extra=require(_0x15b9('0xd'));var _=require(_0x15b9('0xe'));var squel=require(_0x15b9('0xf'));var crypto=require(_0x15b9('0x10'));var jsforce=require(_0x15b9('0x11'));var deskjs=require(_0x15b9('0x12'));var toCsv=require(_0x15b9('0xb'));var querystring=require('querystring');var Papa=require(_0x15b9('0x13'));var Redis=require(_0x15b9('0x14'));var authService=require(_0x15b9('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x15b9('0x16'));var hardwareService=require(_0x15b9('0x17'));var logger=require(_0x15b9('0x18'))('api');var utils=require(_0x15b9('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x15b9('0x1a'));var db=require(_0x15b9('0x1b'))['db'];var integrations=require(_0x15b9('0x1c'));function respondWithStatusCode(_0x473851,_0x3c2af8){_0x3c2af8=_0x3c2af8||0xcc;return function(_0x400f1a){if(_0x400f1a){return _0x473851[_0x15b9('0x1d')](_0x3c2af8);}return _0x473851[_0x15b9('0x1e')](_0x3c2af8)[_0x15b9('0x1f')]();};}function respondWithResult(_0xfa737b,_0x28e8c7){_0x28e8c7=_0x28e8c7||0xc8;return function(_0x129695){if(_0x129695){return _0xfa737b[_0x15b9('0x1e')](_0x28e8c7)[_0x15b9('0x20')](_0x129695);}};}function respondWithFilteredResult(_0x5d606f,_0x498be2){return function(_0x234697){if(_0x234697){var _0x197dfb=typeof _0x498be2[_0x15b9('0x21')]===_0x15b9('0x22')&&typeof _0x498be2[_0x15b9('0x23')]===_0x15b9('0x22');var _0x17668e=_0x234697['count'];var _0x428967=_0x197dfb?0x0:_0x498be2[_0x15b9('0x21')];var _0x490c4c=_0x197dfb?_0x234697['count']:_0x498be2[_0x15b9('0x21')]+_0x498be2[_0x15b9('0x23')];var _0x1d7208;if(_0x490c4c>=_0x17668e){_0x490c4c=_0x17668e;_0x1d7208=0xc8;}else{_0x1d7208=0xce;}_0x5d606f[_0x15b9('0x1e')](_0x1d7208);return _0x5d606f[_0x15b9('0x24')](_0x15b9('0x25'),_0x428967+'-'+_0x490c4c+'/'+_0x17668e)[_0x15b9('0x20')](_0x234697);}return null;};}function patchUpdates(_0x3582a0){return function(_0x1b5013){try{jsonpatch[_0x15b9('0x26')](_0x1b5013,_0x3582a0,!![]);}catch(_0x1bc960){return BPromise[_0x15b9('0x27')](_0x1bc960);}return _0x1b5013[_0x15b9('0x28')]();};}function saveUpdates(_0x485fa4,_0x2b8f8c){return function(_0x4a5407){if(_0x4a5407){return _0x4a5407[_0x15b9('0x29')](_0x485fa4)[_0x15b9('0x2a')](function(_0x4f2b36){return _0x4f2b36;});}return null;};}function removeEntity(_0x5527b4,_0x5a795d){return function(_0x2a7d0a){if(_0x2a7d0a){return _0x2a7d0a[_0x15b9('0x2b')]()['then'](function(){_0x5527b4[_0x15b9('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50ed44,_0x58b95c){return function(_0x1077db){if(!_0x1077db){_0x50ed44['sendStatus'](0x194);}return _0x1077db;};}function handleError(_0x42af4f,_0x46f260){_0x46f260=_0x46f260||0x1f4;return function(_0x89a412){logger['error'](_0x89a412['stack']);if(_0x89a412['name']){delete _0x89a412[_0x15b9('0x2c')];}_0x42af4f[_0x15b9('0x1e')](_0x46f260)['send'](_0x89a412);};}exports[_0x15b9('0x2d')]=function(_0x32eb02,_0x1dabfc){var _0x5e1e0b={},_0x482271={},_0x1f0b63={'count':0x0,'rows':[]};var _0xc1e72d=_[_0x15b9('0x2e')](db[_0x15b9('0x2f')]['rawAttributes'],function(_0x3cb2ee){return{'name':_0x3cb2ee[_0x15b9('0x30')],'type':_0x3cb2ee[_0x15b9('0x31')]['key']};});_0x482271[_0x15b9('0x32')]=_[_0x15b9('0x2e')](_0xc1e72d,'name');_0x482271[_0x15b9('0x33')]=_[_0x15b9('0x34')](_0x32eb02[_0x15b9('0x33')]);_0x482271['filters']=_[_0x15b9('0x35')](_0x482271['model'],_0x482271['query']);_0x5e1e0b[_0x15b9('0x36')]=_[_0x15b9('0x35')](_0x482271[_0x15b9('0x32')],qs[_0x15b9('0x37')](_0x32eb02[_0x15b9('0x33')][_0x15b9('0x37')]));_0x5e1e0b[_0x15b9('0x36')]=_0x5e1e0b[_0x15b9('0x36')]['length']?_0x5e1e0b['attributes']:_0x482271[_0x15b9('0x32')];if(!_0x32eb02[_0x15b9('0x33')]['hasOwnProperty'](_0x15b9('0x38'))){_0x5e1e0b[_0x15b9('0x23')]=qs[_0x15b9('0x23')](_0x32eb02[_0x15b9('0x33')]['limit']);_0x5e1e0b[_0x15b9('0x21')]=qs[_0x15b9('0x21')](_0x32eb02[_0x15b9('0x33')][_0x15b9('0x21')]);}_0x5e1e0b[_0x15b9('0x39')]=qs[_0x15b9('0x3a')](_0x32eb02[_0x15b9('0x33')][_0x15b9('0x3a')]);_0x5e1e0b[_0x15b9('0x3b')]=qs[_0x15b9('0x3c')](_[_0x15b9('0x3d')](_0x32eb02[_0x15b9('0x33')],_0x482271[_0x15b9('0x3c')]),_0xc1e72d);if(_0x32eb02[_0x15b9('0x33')]['filter']){_0x5e1e0b[_0x15b9('0x3b')]=_[_0x15b9('0x3e')](_0x5e1e0b[_0x15b9('0x3b')],{'$or':_[_0x15b9('0x2e')](_0xc1e72d,function(_0x5efe81){if(_0x5efe81['type']!=='VIRTUAL'){var _0xb127ff={};_0xb127ff[_0x5efe81['name']]={'$like':'%'+_0x32eb02[_0x15b9('0x33')][_0x15b9('0x3f')]+'%'};return _0xb127ff;}})});}_0x5e1e0b=_[_0x15b9('0x3e')]({},_0x5e1e0b,_0x32eb02[_0x15b9('0x40')]);var _0x5d2ce9={'where':_0x5e1e0b[_0x15b9('0x3b')]};return db[_0x15b9('0x2f')]['count'](_0x5d2ce9)[_0x15b9('0x2a')](function(_0x1fd9cf){_0x1f0b63[_0x15b9('0x41')]=_0x1fd9cf;if(_0x32eb02[_0x15b9('0x33')][_0x15b9('0x42')]){_0x5e1e0b[_0x15b9('0x43')]=[{'all':!![]}];}return db[_0x15b9('0x2f')]['findAll'](_0x5e1e0b);})[_0x15b9('0x2a')](function(_0x1130fc){_0x1f0b63[_0x15b9('0x44')]=_0x1130fc;return _0x1f0b63;})[_0x15b9('0x2a')](respondWithFilteredResult(_0x1dabfc,_0x5e1e0b))[_0x15b9('0x45')](handleError(_0x1dabfc,null));};exports[_0x15b9('0x46')]=function(_0x94c882,_0x3c1348){var _0x1cd251={'raw':![],'where':{'id':_0x94c882[_0x15b9('0x47')]['id']}},_0x5b5a07={};_0x5b5a07[_0x15b9('0x32')]=_[_0x15b9('0x34')](db[_0x15b9('0x2f')][_0x15b9('0x48')]);_0x5b5a07['query']=_[_0x15b9('0x34')](_0x94c882['query']);_0x5b5a07['filters']=_['intersection'](_0x5b5a07['model'],_0x5b5a07[_0x15b9('0x33')]);_0x1cd251[_0x15b9('0x36')]=_[_0x15b9('0x35')](_0x5b5a07[_0x15b9('0x32')],qs['fields'](_0x94c882['query'][_0x15b9('0x37')]));_0x1cd251[_0x15b9('0x36')]=_0x1cd251[_0x15b9('0x36')][_0x15b9('0x49')]?_0x1cd251[_0x15b9('0x36')]:_0x5b5a07[_0x15b9('0x32')];if(_0x94c882[_0x15b9('0x33')][_0x15b9('0x42')]){_0x1cd251['include']=[{'all':!![]}];}_0x1cd251=_[_0x15b9('0x3e')]({},_0x1cd251,_0x94c882[_0x15b9('0x40')]);return db['SugarcrmAccount'][_0x15b9('0x4a')](_0x1cd251)['then'](handleEntityNotFound(_0x3c1348,null))[_0x15b9('0x2a')](respondWithResult(_0x3c1348,null))[_0x15b9('0x45')](handleError(_0x3c1348,null));};exports[_0x15b9('0x4b')]=function(_0x151e36,_0x43a7ff){return db['SugarcrmAccount']['create'](_0x151e36[_0x15b9('0x4c')],{})[_0x15b9('0x2a')](respondWithResult(_0x43a7ff,0xc9))[_0x15b9('0x45')](handleError(_0x43a7ff,null));};exports[_0x15b9('0x29')]=function(_0x2b3a77,_0x487c07){if(_0x2b3a77[_0x15b9('0x4c')]['id']){delete _0x2b3a77[_0x15b9('0x4c')]['id'];}return db[_0x15b9('0x2f')][_0x15b9('0x4a')]({'where':{'id':_0x2b3a77[_0x15b9('0x47')]['id']}})[_0x15b9('0x2a')](handleEntityNotFound(_0x487c07,null))[_0x15b9('0x2a')](saveUpdates(_0x2b3a77['body'],null))['then'](respondWithResult(_0x487c07,null))['catch'](handleError(_0x487c07,null));};exports[_0x15b9('0x2b')]=function(_0x7010d0,_0x197e60){return db[_0x15b9('0x2f')][_0x15b9('0x4a')]({'where':{'id':_0x7010d0['params']['id']}})['then'](handleEntityNotFound(_0x197e60,null))[_0x15b9('0x2a')](removeEntity(_0x197e60,null))['catch'](handleError(_0x197e60,null));};exports[_0x15b9('0x4d')]=function(_0x3e8edd,_0x53f51d,_0x52ca81){var _0x543273={};var _0x35b397={};var _0x333969;var _0x4884b4;return db[_0x15b9('0x2f')][_0x15b9('0x4e')]({'where':{'id':_0x3e8edd[_0x15b9('0x47')]['id']}})[_0x15b9('0x2a')](handleEntityNotFound(_0x53f51d,null))[_0x15b9('0x2a')](function(_0x51187f){if(_0x51187f){_0x333969=_0x51187f;_0x35b397[_0x15b9('0x32')]=_[_0x15b9('0x34')](db[_0x15b9('0x4f')][_0x15b9('0x48')]);_0x35b397[_0x15b9('0x33')]=_[_0x15b9('0x34')](_0x3e8edd['query']);_0x35b397['filters']=_[_0x15b9('0x35')](_0x35b397[_0x15b9('0x32')],_0x35b397[_0x15b9('0x33')]);_0x543273[_0x15b9('0x36')]=_[_0x15b9('0x35')](_0x35b397['model'],qs[_0x15b9('0x37')](_0x3e8edd[_0x15b9('0x33')][_0x15b9('0x37')]));_0x543273[_0x15b9('0x36')]=_0x543273[_0x15b9('0x36')][_0x15b9('0x49')]?_0x543273[_0x15b9('0x36')]:_0x35b397[_0x15b9('0x32')];_0x543273[_0x15b9('0x39')]=qs['sort'](_0x3e8edd[_0x15b9('0x33')][_0x15b9('0x3a')]);_0x543273[_0x15b9('0x3b')]=qs[_0x15b9('0x3c')](_[_0x15b9('0x3d')](_0x3e8edd['query'],_0x35b397[_0x15b9('0x3c')]));if(_0x3e8edd[_0x15b9('0x33')][_0x15b9('0x3f')]){_0x543273[_0x15b9('0x3b')]=_[_0x15b9('0x3e')](_0x543273[_0x15b9('0x3b')],{'$or':_['map'](_0x543273[_0x15b9('0x36')],function(_0x43049a){var _0x11a3ce={};_0x11a3ce[_0x43049a]={'$like':'%'+_0x3e8edd[_0x15b9('0x33')][_0x15b9('0x3f')]+'%'};return _0x11a3ce;})});}_0x543273=_[_0x15b9('0x3e')]({},_0x543273,_0x3e8edd[_0x15b9('0x40')]);return _0x333969[_0x15b9('0x4d')](_0x543273);}})[_0x15b9('0x2a')](function(_0x1a8fbe){if(_0x1a8fbe){_0x4884b4=_0x1a8fbe[_0x15b9('0x49')];if(!_0x3e8edd[_0x15b9('0x33')][_0x15b9('0x50')]('nolimit')){_0x543273[_0x15b9('0x23')]=qs[_0x15b9('0x23')](_0x3e8edd[_0x15b9('0x33')]['limit']);_0x543273[_0x15b9('0x21')]=qs[_0x15b9('0x21')](_0x3e8edd[_0x15b9('0x33')]['offset']);}return _0x333969[_0x15b9('0x4d')](_0x543273);}})[_0x15b9('0x2a')](function(_0x478f1e){if(_0x478f1e){return _0x478f1e?{'count':_0x4884b4,'rows':_0x478f1e}:null;}})['then'](respondWithResult(_0x53f51d,null))[_0x15b9('0x45')](handleError(_0x53f51d,null));};exports[_0x15b9('0x51')]=function(_0x5cf613,_0x28102b,_0x2ea797){if(_0x5cf613[_0x15b9('0x4c')]['id']){delete _0x5cf613[_0x15b9('0x4c')]['id'];}return db[_0x15b9('0x2f')][_0x15b9('0x4e')]({'where':{'id':_0x5cf613[_0x15b9('0x47')]['id']}})[_0x15b9('0x2a')](handleEntityNotFound(_0x28102b,null))[_0x15b9('0x2a')](function(_0x537b31){if(_0x537b31){_0x5cf613['body'][_0x15b9('0x52')]=_0x537b31['id'];_0x5cf613[_0x15b9('0x4c')][_0x15b9('0x53')]=integrations[_0x15b9('0x54')](_0x5cf613[_0x15b9('0x4c')][_0x15b9('0x55')],_0x5cf613[_0x15b9('0x4c')]['type']);_0x5cf613[_0x15b9('0x4c')]['Descriptions']=integrations[_0x15b9('0x56')](_0x5cf613[_0x15b9('0x4c')]['channel'],_0x5cf613['body']['type']);return db[_0x15b9('0x4f')]['create'](_0x5cf613[_0x15b9('0x4c')],{'include':[{'model':db[_0x15b9('0x57')],'as':_0x15b9('0x53')},{'model':db['SugarcrmField'],'as':_0x15b9('0x58')}]});}return null;})[_0x15b9('0x2a')](respondWithResult(_0x28102b,null))[_0x15b9('0x45')](handleError(_0x28102b,null));};exports[_0x15b9('0x59')]=function(_0x34de45,_0x37ed77,_0x441511){var _0x1038bc='';var _0x110da0=['id',_0x15b9('0x2c'),_0x15b9('0x5a'),_0x15b9('0x5b'),_0x15b9('0x5c'),'date_start',_0x15b9('0x5d'),_0x15b9('0x5e'),_0x15b9('0x5f'),'parent_type',_0x15b9('0x60'),'direction'];return db[_0x15b9('0x2f')][_0x15b9('0x4e')]({'where':{'id':_0x34de45[_0x15b9('0x47')]['id']},'attributes':['id',_0x15b9('0x61'),_0x15b9('0x62'),_0x15b9('0x63')]})[_0x15b9('0x2a')](handleEntityNotFound(_0x37ed77,null))[_0x15b9('0x2a')](function(_0x233ef9){if(_0x233ef9){_0x1038bc=_0x233ef9[_0x15b9('0x63')];var _0x706c89=_0x1038bc['slice'](-0x1);if(_0x706c89==='/'){_0x1038bc=_0x1038bc[_0x15b9('0x64')](0x0,_0x1038bc[_0x15b9('0x65')](_0x706c89));}return rp({'method':_0x15b9('0x66'),'uri':util[_0x15b9('0x67')](_0x15b9('0x68'),_0x1038bc,_0x15b9('0x69')),'json':!![],'form':{'method':_0x15b9('0x6a'),'input_type':_0x15b9('0x6b'),'response_type':_0x15b9('0x6b'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x233ef9[_0x15b9('0x61')],'password':_0x233ef9[_0x15b9('0x62')],'encryption':_0x15b9('0x6c')},'application':_0x15b9('0x6d')})}});}})[_0x15b9('0x2a')](function(_0x1d6f97){if(_0x1d6f97&&_0x1d6f97[_0x15b9('0x2c')]!=='Invalid\x20Login'&&_0x1d6f97[_0x15b9('0x2c')]!=='Password\x20Expired'){return rp({'method':_0x15b9('0x66'),'uri':util[_0x15b9('0x67')](_0x15b9('0x68'),_0x1038bc,_0x15b9('0x69')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0x15b9('0x6b'),'rest_data':JSON['stringify']({'session':_0x1d6f97['id'],'module_name':_0x15b9('0x6e')})}})['then'](function(_0x2b7746){if(_0x2b7746){var _0x4bce3f=_[_0x15b9('0x6f')](_0x2b7746[_0x15b9('0x70')]);_['remove'](_0x4bce3f,function(_0x2668d8){return _0x110da0[_0x15b9('0x71')](_0x2668d8[_0x15b9('0x2c')]);});return{'count':_0x4bce3f[_0x15b9('0x49')],'rows':_[_0x15b9('0x2e')](_0x4bce3f,function(_0x54b1f6){return{'id':_0x54b1f6['name'],'name':_0x54b1f6[_0x15b9('0x72')],'custom':_[_0x15b9('0x73')](_0x54b1f6[_0x15b9('0x2c')],'_c')?!![]:![],'options':_0x54b1f6[_0x15b9('0x40')]?_[_0x15b9('0x2e')](_[_0x15b9('0x6f')](_0x54b1f6[_0x15b9('0x40')]),function(_0x551e76){return{'name':_0x551e76[_0x15b9('0x74')],'value':_0x551e76[_0x15b9('0x2c')]};}):[]};})};}})['then'](respondWithResult(_0x37ed77,null))[_0x15b9('0x45')](function(_0x1ed869){var _0x4d6c97=_0x34de45[_0x15b9('0x33')][_0x15b9('0x75')]?0x1f4:_0x1ed869[_0x15b9('0x76')]||0x1f4;logger[_0x15b9('0x77')]('getFields,\x20%s,\x20%s,\x20%s',_0x15b9('0x59'),_0x4d6c97,JSON[_0x15b9('0x78')](_0x1ed869));delete _0x1ed869[_0x15b9('0x2c')];if(_0x4d6c97===0x191){_0x4d6c97=0x190;}_0x37ed77[_0x15b9('0x1e')](_0x4d6c97)['send'](_0x34de45[_0x15b9('0x33')][_0x15b9('0x75')]?{'message':_0x15b9('0x79'),'statusCode':_0x1ed869[_0x15b9('0x76')]}:_0x1ed869);});}else{var _0x2e1220=0x1f4;_0x37ed77[_0x15b9('0x1e')](_0x2e1220)[_0x15b9('0x7a')]({'message':_0x15b9('0x79'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x4f4e=['description','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','remoteUri','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','includes','label','endsWith','value','test','statusCode','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','show','params','include','find','create','body','catch','SugarcrmConfiguration','merge','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x4f4e,0x193));var _0xe4f4=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0x4f4e[_0x1460f6];return _0x46ce94;};'use strict';var emlformat=require(_0xe4f4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4f4('0x1'));var jsonpatch=require(_0xe4f4('0x2'));var rp=require('request-promise');var moment=require(_0xe4f4('0x3'));var BPromise=require(_0xe4f4('0x4'));var Mustache=require(_0xe4f4('0x5'));var util=require(_0xe4f4('0x6'));var path=require(_0xe4f4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe4f4('0x8'));var fs=require('fs');var fs_extra=require(_0xe4f4('0x9'));var _=require(_0xe4f4('0xa'));var squel=require(_0xe4f4('0xb'));var crypto=require(_0xe4f4('0xc'));var jsforce=require(_0xe4f4('0xd'));var deskjs=require(_0xe4f4('0xe'));var toCsv=require(_0xe4f4('0xf'));var querystring=require(_0xe4f4('0x10'));var Papa=require(_0xe4f4('0x11'));var Redis=require(_0xe4f4('0x12'));var authService=require(_0xe4f4('0x13'));var qs=require(_0xe4f4('0x14'));var as=require(_0xe4f4('0x15'));var hardwareService=require(_0xe4f4('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xe4f4('0x17'));var config=require(_0xe4f4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4f4('0x19'))['db'];var integrations=require(_0xe4f4('0x1a'));function respondWithStatusCode(_0x3a77a1,_0x33e388){_0x33e388=_0x33e388||0xcc;return function(_0x2b3fa6){if(_0x2b3fa6){return _0x3a77a1['sendStatus'](_0x33e388);}return _0x3a77a1['status'](_0x33e388)[_0xe4f4('0x1b')]();};}function respondWithResult(_0x217ff9,_0x1fb7a9){_0x1fb7a9=_0x1fb7a9||0xc8;return function(_0x51a4ea){if(_0x51a4ea){return _0x217ff9['status'](_0x1fb7a9)[_0xe4f4('0x1c')](_0x51a4ea);}};}function respondWithFilteredResult(_0x538d6d,_0x16ee77){return function(_0x11e3be){if(_0x11e3be){var _0x29c9d0=typeof _0x16ee77[_0xe4f4('0x1d')]===_0xe4f4('0x1e')&&typeof _0x16ee77[_0xe4f4('0x1f')]===_0xe4f4('0x1e');var _0x37a5a3=_0x11e3be[_0xe4f4('0x20')];var _0x3b0be5=_0x29c9d0?0x0:_0x16ee77[_0xe4f4('0x1d')];var _0x4e501f=_0x29c9d0?_0x11e3be[_0xe4f4('0x20')]:_0x16ee77[_0xe4f4('0x1d')]+_0x16ee77[_0xe4f4('0x1f')];var _0x7dcee8;if(_0x4e501f>=_0x37a5a3){_0x4e501f=_0x37a5a3;_0x7dcee8=0xc8;}else{_0x7dcee8=0xce;}_0x538d6d[_0xe4f4('0x21')](_0x7dcee8);return _0x538d6d[_0xe4f4('0x22')]('Content-Range',_0x3b0be5+'-'+_0x4e501f+'/'+_0x37a5a3)[_0xe4f4('0x1c')](_0x11e3be);}return null;};}function patchUpdates(_0x37cdea){return function(_0x400001){try{jsonpatch[_0xe4f4('0x23')](_0x400001,_0x37cdea,!![]);}catch(_0x322b97){return BPromise[_0xe4f4('0x24')](_0x322b97);}return _0x400001[_0xe4f4('0x25')]();};}function saveUpdates(_0x1ae299,_0x44a2a3){return function(_0x6f3f63){if(_0x6f3f63){return _0x6f3f63[_0xe4f4('0x26')](_0x1ae299)[_0xe4f4('0x27')](function(_0x479b25){return _0x479b25;});}return null;};}function removeEntity(_0x543085,_0x16cdf0){return function(_0x2faf3c){if(_0x2faf3c){return _0x2faf3c[_0xe4f4('0x28')]()[_0xe4f4('0x27')](function(){_0x543085[_0xe4f4('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x97ab6a,_0x698b06){return function(_0x321a1c){if(!_0x321a1c){_0x97ab6a[_0xe4f4('0x29')](0x194);}return _0x321a1c;};}function handleError(_0x83cb66,_0x2859cd){_0x2859cd=_0x2859cd||0x1f4;return function(_0x2064d2){logger[_0xe4f4('0x2a')](_0x2064d2[_0xe4f4('0x2b')]);if(_0x2064d2[_0xe4f4('0x2c')]){delete _0x2064d2['name'];}_0x83cb66[_0xe4f4('0x21')](_0x2859cd)['send'](_0x2064d2);};}exports['index']=function(_0x1b9ad3,_0x5f436c){var _0x37ef={},_0x1adf40={},_0x10f621={'count':0x0,'rows':[]};var _0x2712ec=_[_0xe4f4('0x2d')](db[_0xe4f4('0x2e')][_0xe4f4('0x2f')],function(_0xd3d2e){return{'name':_0xd3d2e[_0xe4f4('0x30')],'type':_0xd3d2e[_0xe4f4('0x31')]['key']};});_0x1adf40[_0xe4f4('0x32')]=_[_0xe4f4('0x2d')](_0x2712ec,'name');_0x1adf40[_0xe4f4('0x33')]=_[_0xe4f4('0x34')](_0x1b9ad3['query']);_0x1adf40[_0xe4f4('0x35')]=_['intersection'](_0x1adf40['model'],_0x1adf40[_0xe4f4('0x33')]);_0x37ef[_0xe4f4('0x36')]=_[_0xe4f4('0x37')](_0x1adf40[_0xe4f4('0x32')],qs['fields'](_0x1b9ad3[_0xe4f4('0x33')][_0xe4f4('0x38')]));_0x37ef['attributes']=_0x37ef[_0xe4f4('0x36')][_0xe4f4('0x39')]?_0x37ef[_0xe4f4('0x36')]:_0x1adf40[_0xe4f4('0x32')];if(!_0x1b9ad3[_0xe4f4('0x33')][_0xe4f4('0x3a')](_0xe4f4('0x3b'))){_0x37ef[_0xe4f4('0x1f')]=qs[_0xe4f4('0x1f')](_0x1b9ad3[_0xe4f4('0x33')][_0xe4f4('0x1f')]);_0x37ef[_0xe4f4('0x1d')]=qs['offset'](_0x1b9ad3[_0xe4f4('0x33')][_0xe4f4('0x1d')]);}_0x37ef[_0xe4f4('0x3c')]=qs['sort'](_0x1b9ad3[_0xe4f4('0x33')][_0xe4f4('0x3d')]);_0x37ef[_0xe4f4('0x3e')]=qs[_0xe4f4('0x35')](_[_0xe4f4('0x3f')](_0x1b9ad3['query'],_0x1adf40['filters']),_0x2712ec);if(_0x1b9ad3[_0xe4f4('0x33')][_0xe4f4('0x40')]){_0x37ef[_0xe4f4('0x3e')]=_['merge'](_0x37ef['where'],{'$or':_[_0xe4f4('0x2d')](_0x2712ec,function(_0x44c6a4){if(_0x44c6a4[_0xe4f4('0x31')]!==_0xe4f4('0x41')){var _0x17a9a3={};_0x17a9a3[_0x44c6a4['name']]={'$like':'%'+_0x1b9ad3['query'][_0xe4f4('0x40')]+'%'};return _0x17a9a3;}})});}_0x37ef=_['merge']({},_0x37ef,_0x1b9ad3[_0xe4f4('0x42')]);var _0x3ff5d6={'where':_0x37ef[_0xe4f4('0x3e')]};return db[_0xe4f4('0x2e')]['count'](_0x3ff5d6)[_0xe4f4('0x27')](function(_0x2df33f){_0x10f621[_0xe4f4('0x20')]=_0x2df33f;if(_0x1b9ad3['query'][_0xe4f4('0x43')]){_0x37ef['include']=[{'all':!![]}];}return db[_0xe4f4('0x2e')][_0xe4f4('0x44')](_0x37ef);})[_0xe4f4('0x27')](function(_0x27510e){_0x10f621['rows']=_0x27510e;return _0x10f621;})['then'](respondWithFilteredResult(_0x5f436c,_0x37ef))['catch'](handleError(_0x5f436c,null));};exports[_0xe4f4('0x45')]=function(_0x4916f8,_0x4292c3){var _0x479203={'raw':![],'where':{'id':_0x4916f8[_0xe4f4('0x46')]['id']}},_0x28e7bc={};_0x28e7bc['model']=_[_0xe4f4('0x34')](db[_0xe4f4('0x2e')][_0xe4f4('0x2f')]);_0x28e7bc[_0xe4f4('0x33')]=_[_0xe4f4('0x34')](_0x4916f8[_0xe4f4('0x33')]);_0x28e7bc[_0xe4f4('0x35')]=_[_0xe4f4('0x37')](_0x28e7bc[_0xe4f4('0x32')],_0x28e7bc[_0xe4f4('0x33')]);_0x479203['attributes']=_[_0xe4f4('0x37')](_0x28e7bc['model'],qs[_0xe4f4('0x38')](_0x4916f8[_0xe4f4('0x33')]['fields']));_0x479203[_0xe4f4('0x36')]=_0x479203['attributes']['length']?_0x479203['attributes']:_0x28e7bc[_0xe4f4('0x32')];if(_0x4916f8[_0xe4f4('0x33')][_0xe4f4('0x43')]){_0x479203[_0xe4f4('0x47')]=[{'all':!![]}];}_0x479203=_['merge']({},_0x479203,_0x4916f8[_0xe4f4('0x42')]);return db[_0xe4f4('0x2e')][_0xe4f4('0x48')](_0x479203)[_0xe4f4('0x27')](handleEntityNotFound(_0x4292c3,null))[_0xe4f4('0x27')](respondWithResult(_0x4292c3,null))['catch'](handleError(_0x4292c3,null));};exports[_0xe4f4('0x49')]=function(_0x4daf8d,_0x44018c){return db[_0xe4f4('0x2e')]['create'](_0x4daf8d[_0xe4f4('0x4a')],{})[_0xe4f4('0x27')](respondWithResult(_0x44018c,0xc9))['catch'](handleError(_0x44018c,null));};exports[_0xe4f4('0x26')]=function(_0xa6eae3,_0x192964){if(_0xa6eae3[_0xe4f4('0x4a')]['id']){delete _0xa6eae3[_0xe4f4('0x4a')]['id'];}return db[_0xe4f4('0x2e')][_0xe4f4('0x48')]({'where':{'id':_0xa6eae3[_0xe4f4('0x46')]['id']}})[_0xe4f4('0x27')](handleEntityNotFound(_0x192964,null))[_0xe4f4('0x27')](saveUpdates(_0xa6eae3[_0xe4f4('0x4a')],null))[_0xe4f4('0x27')](respondWithResult(_0x192964,null))[_0xe4f4('0x4b')](handleError(_0x192964,null));};exports['destroy']=function(_0x49d616,_0x38a240){return db[_0xe4f4('0x2e')][_0xe4f4('0x48')]({'where':{'id':_0x49d616[_0xe4f4('0x46')]['id']}})[_0xe4f4('0x27')](handleEntityNotFound(_0x38a240,null))[_0xe4f4('0x27')](removeEntity(_0x38a240,null))[_0xe4f4('0x4b')](handleError(_0x38a240,null));};exports['getConfigurations']=function(_0x52b9bc,_0x1ee5d8,_0x41b414){var _0x1975a2={};var _0x354adb={};var _0x26fbaf;var _0x50f8c6;return db[_0xe4f4('0x2e')]['findOne']({'where':{'id':_0x52b9bc[_0xe4f4('0x46')]['id']}})[_0xe4f4('0x27')](handleEntityNotFound(_0x1ee5d8,null))[_0xe4f4('0x27')](function(_0x4691e0){if(_0x4691e0){_0x26fbaf=_0x4691e0;_0x354adb['model']=_[_0xe4f4('0x34')](db[_0xe4f4('0x4c')][_0xe4f4('0x2f')]);_0x354adb[_0xe4f4('0x33')]=_[_0xe4f4('0x34')](_0x52b9bc[_0xe4f4('0x33')]);_0x354adb[_0xe4f4('0x35')]=_['intersection'](_0x354adb[_0xe4f4('0x32')],_0x354adb[_0xe4f4('0x33')]);_0x1975a2['attributes']=_['intersection'](_0x354adb[_0xe4f4('0x32')],qs[_0xe4f4('0x38')](_0x52b9bc[_0xe4f4('0x33')]['fields']));_0x1975a2['attributes']=_0x1975a2[_0xe4f4('0x36')]['length']?_0x1975a2[_0xe4f4('0x36')]:_0x354adb['model'];_0x1975a2[_0xe4f4('0x3c')]=qs[_0xe4f4('0x3d')](_0x52b9bc[_0xe4f4('0x33')][_0xe4f4('0x3d')]);_0x1975a2[_0xe4f4('0x3e')]=qs['filters'](_['pick'](_0x52b9bc[_0xe4f4('0x33')],_0x354adb[_0xe4f4('0x35')]));if(_0x52b9bc['query']['filter']){_0x1975a2['where']=_['merge'](_0x1975a2[_0xe4f4('0x3e')],{'$or':_[_0xe4f4('0x2d')](_0x1975a2['attributes'],function(_0x58c380){var _0x35e17b={};_0x35e17b[_0x58c380]={'$like':'%'+_0x52b9bc[_0xe4f4('0x33')]['filter']+'%'};return _0x35e17b;})});}_0x1975a2=_[_0xe4f4('0x4d')]({},_0x1975a2,_0x52b9bc[_0xe4f4('0x42')]);return _0x26fbaf[_0xe4f4('0x4e')](_0x1975a2);}})[_0xe4f4('0x27')](function(_0x508359){if(_0x508359){_0x50f8c6=_0x508359[_0xe4f4('0x39')];if(!_0x52b9bc[_0xe4f4('0x33')][_0xe4f4('0x3a')](_0xe4f4('0x3b'))){_0x1975a2[_0xe4f4('0x1f')]=qs[_0xe4f4('0x1f')](_0x52b9bc[_0xe4f4('0x33')][_0xe4f4('0x1f')]);_0x1975a2[_0xe4f4('0x1d')]=qs[_0xe4f4('0x1d')](_0x52b9bc[_0xe4f4('0x33')][_0xe4f4('0x1d')]);}return _0x26fbaf['getConfigurations'](_0x1975a2);}})[_0xe4f4('0x27')](function(_0xa29296){if(_0xa29296){return _0xa29296?{'count':_0x50f8c6,'rows':_0xa29296}:null;}})[_0xe4f4('0x27')](respondWithResult(_0x1ee5d8,null))[_0xe4f4('0x4b')](handleError(_0x1ee5d8,null));};exports[_0xe4f4('0x4f')]=function(_0x3712f3,_0x81de71,_0x1cea86){if(_0x3712f3[_0xe4f4('0x4a')]['id']){delete _0x3712f3['body']['id'];}return db[_0xe4f4('0x2e')][_0xe4f4('0x50')]({'where':{'id':_0x3712f3[_0xe4f4('0x46')]['id']}})[_0xe4f4('0x27')](handleEntityNotFound(_0x81de71,null))[_0xe4f4('0x27')](function(_0x5b66fb){if(_0x5b66fb){_0x3712f3[_0xe4f4('0x4a')][_0xe4f4('0x51')]=_0x5b66fb['id'];_0x3712f3[_0xe4f4('0x4a')]['Subjects']=integrations[_0xe4f4('0x52')](_0x3712f3[_0xe4f4('0x4a')][_0xe4f4('0x53')],_0x3712f3[_0xe4f4('0x4a')][_0xe4f4('0x31')]);_0x3712f3[_0xe4f4('0x4a')][_0xe4f4('0x54')]=integrations[_0xe4f4('0x55')](_0x3712f3[_0xe4f4('0x4a')][_0xe4f4('0x53')],_0x3712f3['body'][_0xe4f4('0x31')]);return db['SugarcrmConfiguration'][_0xe4f4('0x49')](_0x3712f3['body'],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0xe4f4('0x56')],'as':'Descriptions'}]});}return null;})[_0xe4f4('0x27')](respondWithResult(_0x81de71,null))[_0xe4f4('0x4b')](handleError(_0x81de71,null));};exports[_0xe4f4('0x57')]=function(_0x3a9620,_0x19e851,_0x15ba8f){var _0xe0536d='';var _0x3d8e5e=['id',_0xe4f4('0x2c'),_0xe4f4('0x58'),'created_by',_0xe4f4('0x59'),_0xe4f4('0x5a'),_0xe4f4('0x5b'),'duration_minutes',_0xe4f4('0x5c'),_0xe4f4('0x5d'),_0xe4f4('0x5e'),_0xe4f4('0x5f')];return db[_0xe4f4('0x2e')][_0xe4f4('0x50')]({'where':{'id':_0x3a9620['params']['id']},'attributes':['id',_0xe4f4('0x60'),'password',_0xe4f4('0x61')]})['then'](handleEntityNotFound(_0x19e851,null))[_0xe4f4('0x27')](function(_0x223e75){if(_0x223e75){_0xe0536d=_0x223e75[_0xe4f4('0x61')];var _0x4bef5=_0xe0536d['slice'](-0x1);if(_0x4bef5==='/'){_0xe0536d=_0xe0536d[_0xe4f4('0x62')](0x0,_0xe0536d[_0xe4f4('0x63')](_0x4bef5));}return rp({'method':_0xe4f4('0x64'),'uri':util['format'](_0xe4f4('0x65'),_0xe0536d,_0xe4f4('0x66')),'json':!![],'form':{'method':_0xe4f4('0x67'),'input_type':_0xe4f4('0x68'),'response_type':_0xe4f4('0x68'),'rest_data':JSON[_0xe4f4('0x69')]({'user_auth':{'user_name':_0x223e75[_0xe4f4('0x60')],'password':_0x223e75[_0xe4f4('0x6a')],'encryption':_0xe4f4('0x6b')},'application':_0xe4f4('0x6c')})}});}})[_0xe4f4('0x27')](function(_0x291acf){if(_0x291acf&&_0x291acf['name']!==_0xe4f4('0x6d')&&_0x291acf[_0xe4f4('0x2c')]!==_0xe4f4('0x6e')){return rp({'method':_0xe4f4('0x64'),'uri':util['format']('%s%s',_0xe0536d,_0xe4f4('0x66')),'json':!![],'form':{'method':_0xe4f4('0x6f'),'input_type':_0xe4f4('0x68'),'response_type':'JSON','rest_data':JSON[_0xe4f4('0x69')]({'session':_0x291acf['id'],'module_name':_0xe4f4('0x70')})}})[_0xe4f4('0x27')](function(_0x1ecfcf){if(_0x1ecfcf){var _0x510a75=_[_0xe4f4('0x71')](_0x1ecfcf[_0xe4f4('0x72')]);_['remove'](_0x510a75,function(_0x49ae27){return _0x3d8e5e[_0xe4f4('0x73')](_0x49ae27[_0xe4f4('0x2c')]);});return{'count':_0x510a75['length'],'rows':_[_0xe4f4('0x2d')](_0x510a75,function(_0x19ea65){return{'id':_0x19ea65['name'],'name':_0x19ea65[_0xe4f4('0x74')],'custom':_[_0xe4f4('0x75')](_0x19ea65['name'],'_c')?!![]:![],'options':_0x19ea65[_0xe4f4('0x42')]?_[_0xe4f4('0x2d')](_['values'](_0x19ea65['options']),function(_0x3c59a5){return{'name':_0x3c59a5[_0xe4f4('0x76')],'value':_0x3c59a5[_0xe4f4('0x2c')]};}):[]};})};}})['then'](respondWithResult(_0x19e851,null))[_0xe4f4('0x4b')](function(_0x515be5){var _0x3aa0d4=_0x3a9620[_0xe4f4('0x33')][_0xe4f4('0x77')]?0x1f4:_0x515be5[_0xe4f4('0x78')]||0x1f4;logger[_0xe4f4('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0xe4f4('0x57'),_0x3aa0d4,JSON[_0xe4f4('0x69')](_0x515be5));delete _0x515be5[_0xe4f4('0x2c')];if(_0x3aa0d4===0x191){_0x3aa0d4=0x190;}_0x19e851[_0xe4f4('0x21')](_0x3aa0d4)[_0xe4f4('0x79')](_0x3a9620[_0xe4f4('0x33')][_0xe4f4('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x515be5[_0xe4f4('0x78')]}:_0x515be5);});}else{var _0x338510=0x1f4;_0x19e851[_0xe4f4('0x21')](_0x338510)[_0xe4f4('0x79')]({'message':_0xe4f4('0x7a'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 8d1a4de..85dc3d5 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 _0xc022=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x29abd5,_0x186097){var _0x454cd4=function(_0x36c6cb){while(--_0x36c6cb){_0x29abd5['push'](_0x29abd5['shift']());}};_0x454cd4(++_0x186097);}(_0xc022,0xd1));var _0x2c02=function(_0x168114,_0x54c2d9){_0x168114=_0x168114-0x0;var _0x21d911=_0xc022[_0x168114];return _0x21d911;};'use strict';var _=require(_0x2c02('0x0'));var util=require(_0x2c02('0x1'));var logger=require('../../config/logger')(_0x2c02('0x2'));var moment=require(_0x2c02('0x3'));var BPromise=require(_0x2c02('0x4'));var rp=require(_0x2c02('0x5'));var fs=require('fs');var path=require(_0x2c02('0x6'));var rimraf=require(_0x2c02('0x7'));var config=require(_0x2c02('0x8'));var attributes=require(_0x2c02('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x2c02('0xa')]=function(_0x15bac4,_0x2f22ce){return _0x15bac4['define'](_0x2c02('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0d7=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','api','moment','bluebird','request-promise','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x40745c,_0x5b12eb){_0x40745c=_0x40745c-0x0;var _0x4055c0=_0xc0d7[_0x40745c];return _0x4055c0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7c0d('0x0'));var moment=require(_0x7c0d('0x1'));var BPromise=require(_0x7c0d('0x2'));var rp=require(_0x7c0d('0x3'));var fs=require('fs');var path=require(_0x7c0d('0x4'));var rimraf=require(_0x7c0d('0x5'));var config=require(_0x7c0d('0x6'));var attributes=require(_0x7c0d('0x7'));var integrations=require(_0x7c0d('0x8'));module['exports']=function(_0x507bc0,_0x14f205){return _0x507bc0[_0x7c0d('0x9')](_0x7c0d('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 2d76c09..fee4446 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 _0xdd53=['code','message','info','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','limit','include','model','attributes','map','debug','ShowSugarcrmAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4f9589,_0x508341){var _0x461484=function(_0x292e1b){while(--_0x292e1b){_0x4f9589['push'](_0x4f9589['shift']());}};_0x461484(++_0x508341);}(_0xdd53,0x1a9));var _0x3dd5=function(_0x2d4025,_0x28bb95){_0x2d4025=_0x2d4025-0x0;var _0x9b5092=_0xdd53[_0x2d4025];return _0x9b5092;};'use strict';var _=require(_0x3dd5('0x0'));var util=require(_0x3dd5('0x1'));var moment=require('moment');var BPromise=require(_0x3dd5('0x2'));var rs=require(_0x3dd5('0x3'));var fs=require('fs');var Redis=require(_0x3dd5('0x4'));var db=require(_0x3dd5('0x5'))['db'];var utils=require(_0x3dd5('0x6'));var logger=require(_0x3dd5('0x7'))(_0x3dd5('0x8'));var config=require('../../config/environment');var jayson=require(_0x3dd5('0x9'));var client=jayson[_0x3dd5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf56c9b,_0x6b9b7e,_0x1add8a){return new BPromise(function(_0x4799f7,_0x31f59d){return client['request'](_0xf56c9b,_0x1add8a)[_0x3dd5('0xb')](function(_0x3aa032){logger['info'](_0x3dd5('0xc'),_0x6b9b7e,_0x3dd5('0xd'));logger['debug'](_0x3dd5('0xe'),_0x6b9b7e,_0x3dd5('0xd'),JSON[_0x3dd5('0xf')](_0x3aa032));if(_0x3aa032[_0x3dd5('0x10')]){if(_0x3aa032[_0x3dd5('0x10')][_0x3dd5('0x11')]===0x1f4){logger[_0x3dd5('0x10')](_0x3dd5('0xc'),_0x6b9b7e,_0x3aa032[_0x3dd5('0x10')][_0x3dd5('0x12')]);return _0x31f59d(_0x3aa032[_0x3dd5('0x10')]['message']);}logger[_0x3dd5('0x10')](_0x3dd5('0xc'),_0x6b9b7e,_0x3aa032['error']['message']);return _0x4799f7(_0x3aa032[_0x3dd5('0x10')][_0x3dd5('0x12')]);}else{logger[_0x3dd5('0x13')](_0x3dd5('0xc'),_0x6b9b7e,_0x3dd5('0xd'));_0x4799f7(_0x3aa032['result'][_0x3dd5('0x12')]);}})[_0x3dd5('0x14')](function(_0x4dba63){logger[_0x3dd5('0x10')](_0x3dd5('0xc'),_0x6b9b7e,_0x4dba63);_0x31f59d(_0x4dba63);});});}exports[_0x3dd5('0x15')]=function(_0xd17e04){var _0x49761c=this;return new Promise(function(_0x31ed6e,_0x2855c5){return db[_0x3dd5('0x16')][_0x3dd5('0x17')]({'raw':_0xd17e04[_0x3dd5('0x18')]?_0xd17e04[_0x3dd5('0x18')][_0x3dd5('0x19')]===undefined?!![]:![]:!![],'where':_0xd17e04[_0x3dd5('0x18')]?_0xd17e04[_0x3dd5('0x18')][_0x3dd5('0x1a')]||null:null,'attributes':_0xd17e04[_0x3dd5('0x18')]?_0xd17e04[_0x3dd5('0x18')]['attributes']||null:null,'limit':_0xd17e04[_0x3dd5('0x18')]?_0xd17e04['options'][_0x3dd5('0x1b')]||null:null,'include':_0xd17e04['options']?_0xd17e04[_0x3dd5('0x18')]['include']?_['map'](_0xd17e04['options'][_0x3dd5('0x1c')],function(_0x213724){return{'model':db[_0x213724[_0x3dd5('0x1d')]],'as':_0x213724['as'],'attributes':_0x213724[_0x3dd5('0x1e')],'include':_0x213724['include']?_['map'](_0x213724['include'],function(_0x1cd848){return{'model':db[_0x1cd848[_0x3dd5('0x1d')]],'as':_0x1cd848['as'],'attributes':_0x1cd848[_0x3dd5('0x1e')],'include':_0x1cd848['include']?_[_0x3dd5('0x1f')](_0x1cd848['include'],function(_0xded891){return{'model':db[_0xded891[_0x3dd5('0x1d')]],'as':_0xded891['as'],'attributes':_0xded891[_0x3dd5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3dd5('0xb')](function(_0x4d1b26){logger[_0x3dd5('0x13')](_0x3dd5('0x15'),_0xd17e04);logger[_0x3dd5('0x20')](_0x3dd5('0x15'),_0xd17e04,JSON[_0x3dd5('0xf')](_0x4d1b26));_0x31ed6e(_0x4d1b26);})[_0x3dd5('0x14')](function(_0x2305f0){logger[_0x3dd5('0x10')]('GetSugarcrmAccount',_0x2305f0[_0x3dd5('0x12')],_0xd17e04);_0x2855c5(_0x49761c[_0x3dd5('0x10')](0x1f4,_0x2305f0['message']));});});};exports[_0x3dd5('0x21')]=function(_0x5c8203){var _0x5cf24b=this;return new Promise(function(_0x3daca4,_0x5ea989){return db[_0x3dd5('0x16')]['find']({'raw':_0x5c8203[_0x3dd5('0x18')]?_0x5c8203[_0x3dd5('0x18')][_0x3dd5('0x19')]===undefined?!![]:![]:!![],'where':_0x5c8203[_0x3dd5('0x18')]?_0x5c8203[_0x3dd5('0x18')][_0x3dd5('0x1a')]||null:null,'attributes':_0x5c8203['options']?_0x5c8203[_0x3dd5('0x18')][_0x3dd5('0x1e')]||null:null,'include':_0x5c8203[_0x3dd5('0x18')]?_0x5c8203[_0x3dd5('0x18')][_0x3dd5('0x1c')]?_['map'](_0x5c8203[_0x3dd5('0x18')][_0x3dd5('0x1c')],function(_0x38ff61){return{'model':db[_0x38ff61[_0x3dd5('0x1d')]],'as':_0x38ff61['as'],'attributes':_0x38ff61[_0x3dd5('0x1e')],'include':_0x38ff61['include']?_[_0x3dd5('0x1f')](_0x38ff61[_0x3dd5('0x1c')],function(_0x577701){return{'model':db[_0x577701[_0x3dd5('0x1d')]],'as':_0x577701['as'],'attributes':_0x577701['attributes'],'include':_0x577701[_0x3dd5('0x1c')]?_['map'](_0x577701[_0x3dd5('0x1c')],function(_0x3277){return{'model':db[_0x3277[_0x3dd5('0x1d')]],'as':_0x3277['as'],'attributes':_0x3277[_0x3dd5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3dd5('0xb')](function(_0x5e5833){logger[_0x3dd5('0x13')](_0x3dd5('0x21'),_0x5c8203);logger[_0x3dd5('0x20')](_0x3dd5('0x21'),_0x5c8203,JSON['stringify'](_0x5e5833));_0x3daca4(_0x5e5833);})[_0x3dd5('0x14')](function(_0x685656){logger[_0x3dd5('0x10')](_0x3dd5('0x21'),_0x685656[_0x3dd5('0x12')],_0x5c8203);_0x5ea989(_0x5cf24b[_0x3dd5('0x10')](0x1f4,_0x685656['message']));});});}; \ No newline at end of file +var _0x299a=['client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowSugarcrmAccount','SugarcrmAccount','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x299a,0x95));var _0xa299=function(_0x26090d,_0x85909b){_0x26090d=_0x26090d-0x0;var _0x147bbc=_0x299a[_0x26090d];return _0x147bbc;};'use strict';var _=require(_0xa299('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa299('0x1'));var fs=require('fs');var Redis=require(_0xa299('0x2'));var db=require(_0xa299('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa299('0x4'));var config=require(_0xa299('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa299('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x578a2f,_0x124867,_0x46f6f6){return new BPromise(function(_0x1d3367,_0x37da58){return client[_0xa299('0x7')](_0x578a2f,_0x46f6f6)[_0xa299('0x8')](function(_0x395f40){logger[_0xa299('0x9')](_0xa299('0xa'),_0x124867,_0xa299('0xb'));logger[_0xa299('0xc')](_0xa299('0xd'),_0x124867,'request\x20sent',JSON[_0xa299('0xe')](_0x395f40));if(_0x395f40[_0xa299('0xf')]){if(_0x395f40[_0xa299('0xf')][_0xa299('0x10')]===0x1f4){logger['error'](_0xa299('0xa'),_0x124867,_0x395f40[_0xa299('0xf')]['message']);return _0x37da58(_0x395f40[_0xa299('0xf')][_0xa299('0x11')]);}logger[_0xa299('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x124867,_0x395f40[_0xa299('0xf')]['message']);return _0x1d3367(_0x395f40[_0xa299('0xf')][_0xa299('0x11')]);}else{logger[_0xa299('0x9')]('SugarcrmAccount,\x20%s,\x20%s',_0x124867,_0xa299('0xb'));_0x1d3367(_0x395f40['result'][_0xa299('0x11')]);}})[_0xa299('0x12')](function(_0x424da6){logger[_0xa299('0xf')](_0xa299('0xa'),_0x124867,_0x424da6);_0x37da58(_0x424da6);});});}exports[_0xa299('0x13')]=function(_0x4d3e1e){var _0x1ea5be=this;return new Promise(function(_0x2827f7,_0x65c6){return db['SugarcrmAccount'][_0xa299('0x14')]({'raw':_0x4d3e1e[_0xa299('0x15')]?_0x4d3e1e[_0xa299('0x15')][_0xa299('0x16')]===undefined?!![]:![]:!![],'where':_0x4d3e1e[_0xa299('0x15')]?_0x4d3e1e[_0xa299('0x15')][_0xa299('0x17')]||null:null,'attributes':_0x4d3e1e['options']?_0x4d3e1e['options'][_0xa299('0x18')]||null:null,'limit':_0x4d3e1e[_0xa299('0x15')]?_0x4d3e1e['options'][_0xa299('0x19')]||null:null,'include':_0x4d3e1e[_0xa299('0x15')]?_0x4d3e1e['options'][_0xa299('0x1a')]?_['map'](_0x4d3e1e[_0xa299('0x15')][_0xa299('0x1a')],function(_0x52360f){return{'model':db[_0x52360f[_0xa299('0x1b')]],'as':_0x52360f['as'],'attributes':_0x52360f[_0xa299('0x18')],'include':_0x52360f['include']?_['map'](_0x52360f['include'],function(_0x4579bf){return{'model':db[_0x4579bf[_0xa299('0x1b')]],'as':_0x4579bf['as'],'attributes':_0x4579bf[_0xa299('0x18')],'include':_0x4579bf['include']?_[_0xa299('0x1c')](_0x4579bf[_0xa299('0x1a')],function(_0x11f1e7){return{'model':db[_0x11f1e7[_0xa299('0x1b')]],'as':_0x11f1e7['as'],'attributes':_0x11f1e7[_0xa299('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa299('0x8')](function(_0x433e9b){logger[_0xa299('0x9')](_0xa299('0x13'),_0x4d3e1e);logger['debug']('GetSugarcrmAccount',_0x4d3e1e,JSON[_0xa299('0xe')](_0x433e9b));_0x2827f7(_0x433e9b);})[_0xa299('0x12')](function(_0x30052c){logger['error'](_0xa299('0x13'),_0x30052c[_0xa299('0x11')],_0x4d3e1e);_0x65c6(_0x1ea5be[_0xa299('0xf')](0x1f4,_0x30052c['message']));});});};exports[_0xa299('0x1d')]=function(_0x4f19df){var _0x33a76f=this;return new Promise(function(_0x2839f0,_0x1c9a4f){return db[_0xa299('0x1e')]['find']({'raw':_0x4f19df['options']?_0x4f19df['options'][_0xa299('0x16')]===undefined?!![]:![]:!![],'where':_0x4f19df['options']?_0x4f19df[_0xa299('0x15')]['where']||null:null,'attributes':_0x4f19df[_0xa299('0x15')]?_0x4f19df[_0xa299('0x15')]['attributes']||null:null,'include':_0x4f19df[_0xa299('0x15')]?_0x4f19df[_0xa299('0x15')][_0xa299('0x1a')]?_[_0xa299('0x1c')](_0x4f19df[_0xa299('0x15')]['include'],function(_0x17fdb0){return{'model':db[_0x17fdb0['model']],'as':_0x17fdb0['as'],'attributes':_0x17fdb0['attributes'],'include':_0x17fdb0[_0xa299('0x1a')]?_[_0xa299('0x1c')](_0x17fdb0[_0xa299('0x1a')],function(_0x1c1c16){return{'model':db[_0x1c1c16[_0xa299('0x1b')]],'as':_0x1c1c16['as'],'attributes':_0x1c1c16['attributes'],'include':_0x1c1c16[_0xa299('0x1a')]?_[_0xa299('0x1c')](_0x1c1c16['include'],function(_0x59cf12){return{'model':db[_0x59cf12[_0xa299('0x1b')]],'as':_0x59cf12['as'],'attributes':_0x59cf12[_0xa299('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa299('0x8')](function(_0x324736){logger[_0xa299('0x9')]('ShowSugarcrmAccount',_0x4f19df);logger[_0xa299('0xc')]('ShowSugarcrmAccount',_0x4f19df,JSON['stringify'](_0x324736));_0x2839f0(_0x324736);})[_0xa299('0x12')](function(_0x43de56){logger['error'](_0xa299('0x1d'),_0x43de56['message'],_0x4f19df);_0x1c9a4f(_0x33a76f[_0xa299('0xf')](0x1f4,_0x43de56[_0xa299('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index a7e236a..d066376 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 _0x27a7=['/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0x27a7,0x69));var _0x727a=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0x27a7[_0x22dac7];return _0x3e6cfa;};'use strict';var multer=require(_0x727a('0x0'));var util=require(_0x727a('0x1'));var path=require(_0x727a('0x2'));var timeout=require(_0x727a('0x3'));var express=require(_0x727a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x727a('0x5'));var interaction=require(_0x727a('0x6'));var config=require(_0x727a('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x727a('0x8')]('/',auth['isAuthenticated'](),controller[_0x727a('0x9')]);router[_0x727a('0x8')](_0x727a('0xa'),auth[_0x727a('0xb')](),controller[_0x727a('0xc')]);router[_0x727a('0x8')](_0x727a('0xd'),auth[_0x727a('0xb')](),controller[_0x727a('0xe')]);router[_0x727a('0x8')](_0x727a('0xf'),auth[_0x727a('0xb')](),controller[_0x727a('0x10')]);router[_0x727a('0x8')](_0x727a('0x11'),auth[_0x727a('0xb')](),controller[_0x727a('0x12')]);router['post']('/',auth[_0x727a('0xb')](),controller[_0x727a('0x13')]);router['put'](_0x727a('0xa'),auth[_0x727a('0xb')](),controller[_0x727a('0x14')]);router['delete'](_0x727a('0xa'),auth[_0x727a('0xb')](),controller[_0x727a('0x15')]);module[_0x727a('0x16')]=router; \ No newline at end of file +var _0x6291=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','show','get','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update'];(function(_0x14caee,_0x2d8f13){var _0x1ff3d7=function(_0x378593){while(--_0x378593){_0x14caee['push'](_0x14caee['shift']());}};_0x1ff3d7(++_0x2d8f13);}(_0x6291,0xba));var _0x1629=function(_0x5d547f,_0x50a029){_0x5d547f=_0x5d547f-0x0;var _0x66efe3=_0x6291[_0x5d547f];return _0x66efe3;};'use strict';var multer=require('multer');var util=require(_0x1629('0x0'));var path=require(_0x1629('0x1'));var timeout=require(_0x1629('0x2'));var express=require('express');var router=express[_0x1629('0x3')]();var fs_extra=require(_0x1629('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1629('0x5'));var config=require(_0x1629('0x6'));var controller=require(_0x1629('0x7'));router['get']('/',auth[_0x1629('0x8')](),controller[_0x1629('0x9')]);router['get']('/:id',auth[_0x1629('0x8')](),controller[_0x1629('0xa')]);router[_0x1629('0xb')](_0x1629('0xc'),auth[_0x1629('0x8')](),controller['getFields']);router[_0x1629('0xb')](_0x1629('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x1629('0xb')](_0x1629('0xe'),auth[_0x1629('0x8')](),controller[_0x1629('0xf')]);router[_0x1629('0x10')]('/',auth['isAuthenticated'](),controller[_0x1629('0x11')]);router[_0x1629('0x12')](_0x1629('0x13'),auth[_0x1629('0x8')](),controller[_0x1629('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1629('0x15')]);module[_0x1629('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 881c096..5d8e862 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 _0xf049=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf049,0x19c));var _0x9f04=function(_0x5c238b,_0x330696){_0x5c238b=_0x5c238b-0x0;var _0x183c39=_0xf049[_0x5c238b];return _0x183c39;};'use strict';var Sequelize=require(_0x9f04('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9f04('0x1')]}}; \ No newline at end of file +var _0xd063=['exports','STRING','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd063,0x1ca));var _0x3d06=function(_0x37bbc6,_0x369467){_0x37bbc6=_0x37bbc6-0x0;var _0x209c9c=_0xd063[_0x37bbc6];return _0x209c9c;};'use strict';var Sequelize=require(_0x3d06('0x0'));module[_0x3d06('0x1')]={'name':{'type':Sequelize[_0x3d06('0x2')]},'description':{'type':Sequelize[_0x3d06('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index d28eb6d..44ca06d 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 _0x6304=['includeAll','include','findAll','rows','catch','show','find','create','body','params','getFields','findOne','SugarcrmField','rawAttributes','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','error','name','index','map','SugarcrmConfiguration','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options'];(function(_0xa7c05d,_0x312374){var _0x47b002=function(_0x44aa2f){while(--_0x44aa2f){_0xa7c05d['push'](_0xa7c05d['shift']());}};_0x47b002(++_0x312374);}(_0x6304,0xf8));var _0x4630=function(_0x52447b,_0x2dff64){_0x52447b=_0x52447b-0x0;var _0x100f6f=_0x6304[_0x52447b];return _0x100f6f;};'use strict';var emlformat=require(_0x4630('0x0'));var rimraf=require(_0x4630('0x1'));var zipdir=require(_0x4630('0x2'));var jsonpatch=require(_0x4630('0x3'));var rp=require(_0x4630('0x4'));var moment=require(_0x4630('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4630('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4630('0x7'));var csv=require(_0x4630('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4630('0x9'));var squel=require(_0x4630('0xa'));var crypto=require(_0x4630('0xb'));var jsforce=require(_0x4630('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4630('0x8'));var querystring=require('querystring');var Papa=require(_0x4630('0xd'));var Redis=require(_0x4630('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4630('0xf'));var as=require(_0x4630('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4630('0x11'));var config=require(_0x4630('0x12'));var licenseUtil=require(_0x4630('0x13'));var db=require(_0x4630('0x14'))['db'];function respondWithStatusCode(_0x5c68e0,_0xa188a3){_0xa188a3=_0xa188a3||0xcc;return function(_0x481d42){if(_0x481d42){return _0x5c68e0[_0x4630('0x15')](_0xa188a3);}return _0x5c68e0['status'](_0xa188a3)['end']();};}function respondWithResult(_0x4f41ac,_0x564dbd){_0x564dbd=_0x564dbd||0xc8;return function(_0x49768a){if(_0x49768a){return _0x4f41ac[_0x4630('0x16')](_0x564dbd)[_0x4630('0x17')](_0x49768a);}};}function respondWithFilteredResult(_0x5c8100,_0x5bc402){return function(_0x95e27a){if(_0x95e27a){var _0x1e6153=typeof _0x5bc402[_0x4630('0x18')]===_0x4630('0x19')&&typeof _0x5bc402[_0x4630('0x1a')]===_0x4630('0x19');var _0x24e5ed=_0x95e27a[_0x4630('0x1b')];var _0x354253=_0x1e6153?0x0:_0x5bc402['offset'];var _0x3b38fc=_0x1e6153?_0x95e27a['count']:_0x5bc402[_0x4630('0x18')]+_0x5bc402[_0x4630('0x1a')];var _0x2829d0;if(_0x3b38fc>=_0x24e5ed){_0x3b38fc=_0x24e5ed;_0x2829d0=0xc8;}else{_0x2829d0=0xce;}_0x5c8100[_0x4630('0x16')](_0x2829d0);return _0x5c8100[_0x4630('0x1c')](_0x4630('0x1d'),_0x354253+'-'+_0x3b38fc+'/'+_0x24e5ed)[_0x4630('0x17')](_0x95e27a);}return null;};}function patchUpdates(_0x19c30a){return function(_0xcaf461){try{jsonpatch['apply'](_0xcaf461,_0x19c30a,!![]);}catch(_0x37de0f){return BPromise[_0x4630('0x1e')](_0x37de0f);}return _0xcaf461[_0x4630('0x1f')]();};}function saveUpdates(_0x1734d8,_0x422288){return function(_0xf6b5cb){if(_0xf6b5cb){return _0xf6b5cb['update'](_0x1734d8)[_0x4630('0x20')](function(_0x493bd9){return _0x493bd9;});}return null;};}function removeEntity(_0x1e7994,_0x19aac1){return function(_0x57b776){if(_0x57b776){return _0x57b776[_0x4630('0x21')]()[_0x4630('0x20')](function(){_0x1e7994[_0x4630('0x16')](0xcc)[_0x4630('0x22')]();});}};}function handleEntityNotFound(_0x1c1424,_0x448d65){return function(_0x5cd653){if(!_0x5cd653){_0x1c1424[_0x4630('0x15')](0x194);}return _0x5cd653;};}function handleError(_0x2fed6b,_0x56c616){_0x56c616=_0x56c616||0x1f4;return function(_0x4cb941){logger[_0x4630('0x23')](_0x4cb941['stack']);if(_0x4cb941['name']){delete _0x4cb941[_0x4630('0x24')];}_0x2fed6b[_0x4630('0x16')](_0x56c616)['send'](_0x4cb941);};}exports[_0x4630('0x25')]=function(_0x5b7e3f,_0x4b7011){var _0x56a185={},_0x2680c2={},_0x877b73={'count':0x0,'rows':[]};var _0x16ce4f=_[_0x4630('0x26')](db[_0x4630('0x27')]['rawAttributes'],function(_0x2c537b){return{'name':_0x2c537b[_0x4630('0x28')],'type':_0x2c537b[_0x4630('0x29')][_0x4630('0x2a')]};});_0x2680c2[_0x4630('0x2b')]=_[_0x4630('0x26')](_0x16ce4f,_0x4630('0x24'));_0x2680c2['query']=_[_0x4630('0x2c')](_0x5b7e3f[_0x4630('0x2d')]);_0x2680c2['filters']=_['intersection'](_0x2680c2[_0x4630('0x2b')],_0x2680c2[_0x4630('0x2d')]);_0x56a185[_0x4630('0x2e')]=_[_0x4630('0x2f')](_0x2680c2[_0x4630('0x2b')],qs[_0x4630('0x30')](_0x5b7e3f[_0x4630('0x2d')][_0x4630('0x30')]));_0x56a185[_0x4630('0x2e')]=_0x56a185['attributes'][_0x4630('0x31')]?_0x56a185[_0x4630('0x2e')]:_0x2680c2['model'];if(!_0x5b7e3f[_0x4630('0x2d')][_0x4630('0x32')](_0x4630('0x33'))){_0x56a185[_0x4630('0x1a')]=qs[_0x4630('0x1a')](_0x5b7e3f[_0x4630('0x2d')][_0x4630('0x1a')]);_0x56a185[_0x4630('0x18')]=qs['offset'](_0x5b7e3f['query'][_0x4630('0x18')]);}_0x56a185['order']=qs[_0x4630('0x34')](_0x5b7e3f['query'][_0x4630('0x34')]);_0x56a185[_0x4630('0x35')]=qs[_0x4630('0x36')](_[_0x4630('0x37')](_0x5b7e3f[_0x4630('0x2d')],_0x2680c2[_0x4630('0x36')]),_0x16ce4f);if(_0x5b7e3f[_0x4630('0x2d')][_0x4630('0x38')]){_0x56a185[_0x4630('0x35')]=_['merge'](_0x56a185['where'],{'$or':_[_0x4630('0x26')](_0x16ce4f,function(_0x3b5e35){if(_0x3b5e35[_0x4630('0x29')]!==_0x4630('0x39')){var _0x5b464e={};_0x5b464e[_0x3b5e35[_0x4630('0x24')]]={'$like':'%'+_0x5b7e3f['query'][_0x4630('0x38')]+'%'};return _0x5b464e;}})});}_0x56a185=_[_0x4630('0x3a')]({},_0x56a185,_0x5b7e3f[_0x4630('0x3b')]);var _0x2850c7={'where':_0x56a185[_0x4630('0x35')]};return db[_0x4630('0x27')]['count'](_0x2850c7)['then'](function(_0x271cf3){_0x877b73[_0x4630('0x1b')]=_0x271cf3;if(_0x5b7e3f[_0x4630('0x2d')][_0x4630('0x3c')]){_0x56a185[_0x4630('0x3d')]=[{'all':!![]}];}return db[_0x4630('0x27')][_0x4630('0x3e')](_0x56a185);})[_0x4630('0x20')](function(_0x48af67){_0x877b73[_0x4630('0x3f')]=_0x48af67;return _0x877b73;})['then'](respondWithFilteredResult(_0x4b7011,_0x56a185))[_0x4630('0x40')](handleError(_0x4b7011,null));};exports[_0x4630('0x41')]=function(_0x46117a,_0x20683a){var _0x51e70b={'raw':![],'where':{'id':_0x46117a['params']['id']}},_0x29c931={};_0x29c931['model']=_[_0x4630('0x2c')](db['SugarcrmConfiguration']['rawAttributes']);_0x29c931[_0x4630('0x2d')]=_[_0x4630('0x2c')](_0x46117a[_0x4630('0x2d')]);_0x29c931[_0x4630('0x36')]=_[_0x4630('0x2f')](_0x29c931[_0x4630('0x2b')],_0x29c931[_0x4630('0x2d')]);_0x51e70b[_0x4630('0x2e')]=_[_0x4630('0x2f')](_0x29c931[_0x4630('0x2b')],qs['fields'](_0x46117a[_0x4630('0x2d')][_0x4630('0x30')]));_0x51e70b['attributes']=_0x51e70b['attributes'][_0x4630('0x31')]?_0x51e70b['attributes']:_0x29c931[_0x4630('0x2b')];if(_0x46117a['query'][_0x4630('0x3c')]){_0x51e70b[_0x4630('0x3d')]=[{'all':!![]}];}_0x51e70b=_[_0x4630('0x3a')]({},_0x51e70b,_0x46117a[_0x4630('0x3b')]);return db[_0x4630('0x27')][_0x4630('0x42')](_0x51e70b)['then'](handleEntityNotFound(_0x20683a,null))[_0x4630('0x20')](respondWithResult(_0x20683a,null))['catch'](handleError(_0x20683a,null));};exports[_0x4630('0x43')]=function(_0x3814dc,_0x18e9c5){return db['SugarcrmConfiguration']['create'](_0x3814dc['body'],{})[_0x4630('0x20')](respondWithResult(_0x18e9c5,0xc9))[_0x4630('0x40')](handleError(_0x18e9c5,null));};exports['update']=function(_0x16ed73,_0x11492c){if(_0x16ed73[_0x4630('0x44')]['id']){delete _0x16ed73[_0x4630('0x44')]['id'];}return db[_0x4630('0x27')][_0x4630('0x42')]({'where':{'id':_0x16ed73[_0x4630('0x45')]['id']}})[_0x4630('0x20')](handleEntityNotFound(_0x11492c,null))[_0x4630('0x20')](saveUpdates(_0x16ed73[_0x4630('0x44')],null))[_0x4630('0x20')](respondWithResult(_0x11492c,null))[_0x4630('0x40')](handleError(_0x11492c,null));};exports['destroy']=function(_0x3518c0,_0x474f3d){return db[_0x4630('0x27')][_0x4630('0x42')]({'where':{'id':_0x3518c0[_0x4630('0x45')]['id']}})['then'](handleEntityNotFound(_0x474f3d,null))[_0x4630('0x20')](removeEntity(_0x474f3d,null))[_0x4630('0x40')](handleError(_0x474f3d,null));};exports[_0x4630('0x46')]=function(_0x5eaefa,_0x595e41,_0x1a23ae){var _0x442c25={};var _0x340077={};var _0x4aa2e1;var _0x590f39;return db['SugarcrmConfiguration'][_0x4630('0x47')]({'where':{'id':_0x5eaefa['params']['id']}})[_0x4630('0x20')](handleEntityNotFound(_0x595e41,null))[_0x4630('0x20')](function(_0x11787d){if(_0x11787d){_0x4aa2e1=_0x11787d;_0x340077['model']=_[_0x4630('0x2c')](db[_0x4630('0x48')][_0x4630('0x49')]);_0x340077['query']=_[_0x4630('0x2c')](_0x5eaefa[_0x4630('0x2d')]);_0x340077[_0x4630('0x36')]=_['intersection'](_0x340077[_0x4630('0x2b')],_0x340077[_0x4630('0x2d')]);_0x442c25[_0x4630('0x2e')]=_[_0x4630('0x2f')](_0x340077[_0x4630('0x2b')],qs['fields'](_0x5eaefa['query'][_0x4630('0x30')]));_0x442c25[_0x4630('0x2e')]=_0x442c25[_0x4630('0x2e')][_0x4630('0x31')]?_0x442c25[_0x4630('0x2e')]:_0x340077['model'];_0x442c25[_0x4630('0x4a')]=qs['sort'](_0x5eaefa[_0x4630('0x2d')][_0x4630('0x34')]);_0x442c25[_0x4630('0x35')]=qs[_0x4630('0x36')](_[_0x4630('0x37')](_0x5eaefa[_0x4630('0x2d')],_0x340077[_0x4630('0x36')]));if(_0x5eaefa[_0x4630('0x2d')]['filter']){_0x442c25['where']=_[_0x4630('0x3a')](_0x442c25[_0x4630('0x35')],{'$or':_[_0x4630('0x26')](_0x442c25[_0x4630('0x2e')],function(_0x497b38){var _0x32626b={};_0x32626b[_0x497b38]={'$like':'%'+_0x5eaefa[_0x4630('0x2d')][_0x4630('0x38')]+'%'};return _0x32626b;})});}_0x442c25=_[_0x4630('0x3a')]({},_0x442c25,_0x5eaefa[_0x4630('0x3b')]);return _0x4aa2e1[_0x4630('0x46')](_0x442c25);}})['then'](function(_0x11459b){if(_0x11459b){_0x590f39=_0x11459b[_0x4630('0x31')];if(!_0x5eaefa['query'][_0x4630('0x32')](_0x4630('0x33'))){_0x442c25['limit']=qs[_0x4630('0x1a')](_0x5eaefa[_0x4630('0x2d')][_0x4630('0x1a')]);_0x442c25['offset']=qs[_0x4630('0x18')](_0x5eaefa[_0x4630('0x2d')][_0x4630('0x18')]);}return _0x4aa2e1[_0x4630('0x46')](_0x442c25);}})[_0x4630('0x20')](function(_0x4c0a29){if(_0x4c0a29){return _0x4c0a29?{'count':_0x590f39,'rows':_0x4c0a29}:null;}})[_0x4630('0x20')](respondWithResult(_0x595e41,null))[_0x4630('0x40')](handleError(_0x595e41,null));};exports['getSubjects']=function(_0x46cb3c,_0x59de1b,_0xcd3a3c){var _0x2ad61e={};var _0x125d7b={};var _0x115e90;var _0x2a4349;return db[_0x4630('0x27')][_0x4630('0x47')]({'where':{'id':_0x46cb3c[_0x4630('0x45')]['id']}})['then'](handleEntityNotFound(_0x59de1b,null))[_0x4630('0x20')](function(_0x5dac5c){if(_0x5dac5c){_0x115e90=_0x5dac5c;_0x125d7b[_0x4630('0x2b')]=_['keys'](db[_0x4630('0x48')]['rawAttributes']);_0x125d7b[_0x4630('0x2d')]=_['keys'](_0x46cb3c[_0x4630('0x2d')]);_0x125d7b['filters']=_[_0x4630('0x2f')](_0x125d7b['model'],_0x125d7b[_0x4630('0x2d')]);_0x2ad61e[_0x4630('0x2e')]=_[_0x4630('0x2f')](_0x125d7b[_0x4630('0x2b')],qs[_0x4630('0x30')](_0x46cb3c[_0x4630('0x2d')]['fields']));_0x2ad61e[_0x4630('0x2e')]=_0x2ad61e[_0x4630('0x2e')]['length']?_0x2ad61e[_0x4630('0x2e')]:_0x125d7b[_0x4630('0x2b')];_0x2ad61e['order']=qs[_0x4630('0x34')](_0x46cb3c[_0x4630('0x2d')][_0x4630('0x34')]);_0x2ad61e[_0x4630('0x35')]=qs[_0x4630('0x36')](_['pick'](_0x46cb3c[_0x4630('0x2d')],_0x125d7b[_0x4630('0x36')]));if(_0x46cb3c[_0x4630('0x2d')][_0x4630('0x38')]){_0x2ad61e[_0x4630('0x35')]=_['merge'](_0x2ad61e[_0x4630('0x35')],{'$or':_[_0x4630('0x26')](_0x2ad61e[_0x4630('0x2e')],function(_0xd49bfa){var _0x49f6b3={};_0x49f6b3[_0xd49bfa]={'$like':'%'+_0x46cb3c[_0x4630('0x2d')][_0x4630('0x38')]+'%'};return _0x49f6b3;})});}_0x2ad61e=_['merge']({},_0x2ad61e,_0x46cb3c['options']);return _0x115e90[_0x4630('0x4b')](_0x2ad61e);}})['then'](function(_0x12ed0a){if(_0x12ed0a){_0x2a4349=_0x12ed0a[_0x4630('0x31')];if(!_0x46cb3c['query'][_0x4630('0x32')](_0x4630('0x33'))){_0x2ad61e[_0x4630('0x1a')]=qs[_0x4630('0x1a')](_0x46cb3c[_0x4630('0x2d')][_0x4630('0x1a')]);_0x2ad61e[_0x4630('0x18')]=qs[_0x4630('0x18')](_0x46cb3c[_0x4630('0x2d')]['offset']);}return _0x115e90[_0x4630('0x4b')](_0x2ad61e);}})[_0x4630('0x20')](function(_0x551d42){if(_0x551d42){return _0x551d42?{'count':_0x2a4349,'rows':_0x551d42}:null;}})[_0x4630('0x20')](respondWithResult(_0x59de1b,null))[_0x4630('0x40')](handleError(_0x59de1b,null));};exports[_0x4630('0x4c')]=function(_0x2a4f07,_0x54e2ab,_0x1d5743){var _0x59b530={};var _0x431aaf={};var _0x381ffe;var _0x3e399b;return db[_0x4630('0x27')][_0x4630('0x47')]({'where':{'id':_0x2a4f07[_0x4630('0x45')]['id']}})[_0x4630('0x20')](handleEntityNotFound(_0x54e2ab,null))['then'](function(_0x464f0b){if(_0x464f0b){_0x381ffe=_0x464f0b;_0x431aaf[_0x4630('0x2b')]=_['keys'](db[_0x4630('0x48')][_0x4630('0x49')]);_0x431aaf[_0x4630('0x2d')]=_['keys'](_0x2a4f07['query']);_0x431aaf[_0x4630('0x36')]=_[_0x4630('0x2f')](_0x431aaf[_0x4630('0x2b')],_0x431aaf['query']);_0x59b530[_0x4630('0x2e')]=_['intersection'](_0x431aaf[_0x4630('0x2b')],qs[_0x4630('0x30')](_0x2a4f07[_0x4630('0x2d')][_0x4630('0x30')]));_0x59b530[_0x4630('0x2e')]=_0x59b530[_0x4630('0x2e')]['length']?_0x59b530[_0x4630('0x2e')]:_0x431aaf[_0x4630('0x2b')];_0x59b530[_0x4630('0x4a')]=qs[_0x4630('0x34')](_0x2a4f07[_0x4630('0x2d')]['sort']);_0x59b530[_0x4630('0x35')]=qs[_0x4630('0x36')](_[_0x4630('0x37')](_0x2a4f07[_0x4630('0x2d')],_0x431aaf['filters']));if(_0x2a4f07[_0x4630('0x2d')][_0x4630('0x38')]){_0x59b530[_0x4630('0x35')]=_['merge'](_0x59b530[_0x4630('0x35')],{'$or':_['map'](_0x59b530['attributes'],function(_0x505dc4){var _0xcd05e4={};_0xcd05e4[_0x505dc4]={'$like':'%'+_0x2a4f07[_0x4630('0x2d')][_0x4630('0x38')]+'%'};return _0xcd05e4;})});}_0x59b530=_[_0x4630('0x3a')]({},_0x59b530,_0x2a4f07[_0x4630('0x3b')]);return _0x381ffe[_0x4630('0x4c')](_0x59b530);}})['then'](function(_0x284098){if(_0x284098){_0x3e399b=_0x284098['length'];if(!_0x2a4f07[_0x4630('0x2d')]['hasOwnProperty'](_0x4630('0x33'))){_0x59b530['limit']=qs[_0x4630('0x1a')](_0x2a4f07[_0x4630('0x2d')][_0x4630('0x1a')]);_0x59b530[_0x4630('0x18')]=qs[_0x4630('0x18')](_0x2a4f07[_0x4630('0x2d')]['offset']);}return _0x381ffe[_0x4630('0x4c')](_0x59b530);}})[_0x4630('0x20')](function(_0x49d5d7){if(_0x49d5d7){return _0x49d5d7?{'count':_0x3e399b,'rows':_0x49d5d7}:null;}})[_0x4630('0x20')](respondWithResult(_0x54e2ab,null))['catch'](handleError(_0x54e2ab,null));}; \ No newline at end of file +var _0x9497=['attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','SugarcrmConfiguration','includeAll','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','getFields','SugarcrmField','order','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','update','then','destroy','error','name','send','index','map','fieldName','key','query','filters','model','intersection','fields'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x9497,0x1a5));var _0x7949=function(_0x512366,_0x241ec1){_0x512366=_0x512366-0x0;var _0x55edac=_0x9497[_0x512366];return _0x55edac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7949('0x0'));var zipdir=require(_0x7949('0x1'));var jsonpatch=require(_0x7949('0x2'));var rp=require(_0x7949('0x3'));var moment=require(_0x7949('0x4'));var BPromise=require(_0x7949('0x5'));var Mustache=require(_0x7949('0x6'));var util=require(_0x7949('0x7'));var path=require(_0x7949('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7949('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7949('0xa'));var squel=require(_0x7949('0xb'));var crypto=require('crypto');var jsforce=require(_0x7949('0xc'));var deskjs=require(_0x7949('0xd'));var toCsv=require(_0x7949('0xe'));var querystring=require(_0x7949('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7949('0x10'));var qs=require(_0x7949('0x11'));var as=require(_0x7949('0x12'));var hardwareService=require(_0x7949('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7949('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7949('0x15'))['db'];function respondWithStatusCode(_0x590d23,_0x1f436d){_0x1f436d=_0x1f436d||0xcc;return function(_0x179e45){if(_0x179e45){return _0x590d23[_0x7949('0x16')](_0x1f436d);}return _0x590d23[_0x7949('0x17')](_0x1f436d)[_0x7949('0x18')]();};}function respondWithResult(_0x1e6c50,_0x4dc3fb){_0x4dc3fb=_0x4dc3fb||0xc8;return function(_0x53986c){if(_0x53986c){return _0x1e6c50[_0x7949('0x17')](_0x4dc3fb)['json'](_0x53986c);}};}function respondWithFilteredResult(_0x59e12d,_0x25d577){return function(_0x5c2be3){if(_0x5c2be3){var _0x1b1dfa=typeof _0x25d577[_0x7949('0x19')]===_0x7949('0x1a')&&typeof _0x25d577['limit']===_0x7949('0x1a');var _0x5223b5=_0x5c2be3[_0x7949('0x1b')];var _0x5023ba=_0x1b1dfa?0x0:_0x25d577[_0x7949('0x19')];var _0x2c3474=_0x1b1dfa?_0x5c2be3[_0x7949('0x1b')]:_0x25d577[_0x7949('0x19')]+_0x25d577['limit'];var _0x4ef84c;if(_0x2c3474>=_0x5223b5){_0x2c3474=_0x5223b5;_0x4ef84c=0xc8;}else{_0x4ef84c=0xce;}_0x59e12d[_0x7949('0x17')](_0x4ef84c);return _0x59e12d[_0x7949('0x1c')](_0x7949('0x1d'),_0x5023ba+'-'+_0x2c3474+'/'+_0x5223b5)[_0x7949('0x1e')](_0x5c2be3);}return null;};}function patchUpdates(_0x19f881){return function(_0x5f4d2f){try{jsonpatch[_0x7949('0x1f')](_0x5f4d2f,_0x19f881,!![]);}catch(_0x8ab3fc){return BPromise['reject'](_0x8ab3fc);}return _0x5f4d2f['save']();};}function saveUpdates(_0x27676b,_0x133eb6){return function(_0x116ea1){if(_0x116ea1){return _0x116ea1[_0x7949('0x20')](_0x27676b)[_0x7949('0x21')](function(_0x322881){return _0x322881;});}return null;};}function removeEntity(_0x5b9542,_0x160492){return function(_0x18fbeb){if(_0x18fbeb){return _0x18fbeb[_0x7949('0x22')]()[_0x7949('0x21')](function(){_0x5b9542[_0x7949('0x17')](0xcc)[_0x7949('0x18')]();});}};}function handleEntityNotFound(_0x4b0205,_0x47f3d4){return function(_0x583632){if(!_0x583632){_0x4b0205[_0x7949('0x16')](0x194);}return _0x583632;};}function handleError(_0xc5d70f,_0x5e19d7){_0x5e19d7=_0x5e19d7||0x1f4;return function(_0x1d4146){logger[_0x7949('0x23')](_0x1d4146['stack']);if(_0x1d4146[_0x7949('0x24')]){delete _0x1d4146[_0x7949('0x24')];}_0xc5d70f[_0x7949('0x17')](_0x5e19d7)[_0x7949('0x25')](_0x1d4146);};}exports[_0x7949('0x26')]=function(_0xeb0522,_0x93770b){var _0x2b4b6e={},_0xa30d47={},_0x1e3c20={'count':0x0,'rows':[]};var _0xa09665=_[_0x7949('0x27')](db['SugarcrmConfiguration']['rawAttributes'],function(_0xd81c28){return{'name':_0xd81c28[_0x7949('0x28')],'type':_0xd81c28['type'][_0x7949('0x29')]};});_0xa30d47['model']=_[_0x7949('0x27')](_0xa09665,_0x7949('0x24'));_0xa30d47[_0x7949('0x2a')]=_['keys'](_0xeb0522[_0x7949('0x2a')]);_0xa30d47[_0x7949('0x2b')]=_['intersection'](_0xa30d47[_0x7949('0x2c')],_0xa30d47[_0x7949('0x2a')]);_0x2b4b6e['attributes']=_[_0x7949('0x2d')](_0xa30d47[_0x7949('0x2c')],qs['fields'](_0xeb0522[_0x7949('0x2a')][_0x7949('0x2e')]));_0x2b4b6e[_0x7949('0x2f')]=_0x2b4b6e[_0x7949('0x2f')][_0x7949('0x30')]?_0x2b4b6e[_0x7949('0x2f')]:_0xa30d47[_0x7949('0x2c')];if(!_0xeb0522[_0x7949('0x2a')][_0x7949('0x31')](_0x7949('0x32'))){_0x2b4b6e[_0x7949('0x33')]=qs[_0x7949('0x33')](_0xeb0522[_0x7949('0x2a')][_0x7949('0x33')]);_0x2b4b6e[_0x7949('0x19')]=qs[_0x7949('0x19')](_0xeb0522['query'][_0x7949('0x19')]);}_0x2b4b6e['order']=qs[_0x7949('0x34')](_0xeb0522[_0x7949('0x2a')]['sort']);_0x2b4b6e[_0x7949('0x35')]=qs[_0x7949('0x2b')](_[_0x7949('0x36')](_0xeb0522[_0x7949('0x2a')],_0xa30d47[_0x7949('0x2b')]),_0xa09665);if(_0xeb0522[_0x7949('0x2a')][_0x7949('0x37')]){_0x2b4b6e['where']=_[_0x7949('0x38')](_0x2b4b6e[_0x7949('0x35')],{'$or':_[_0x7949('0x27')](_0xa09665,function(_0x97cc14){if(_0x97cc14[_0x7949('0x39')]!==_0x7949('0x3a')){var _0x138b7a={};_0x138b7a[_0x97cc14[_0x7949('0x24')]]={'$like':'%'+_0xeb0522[_0x7949('0x2a')][_0x7949('0x37')]+'%'};return _0x138b7a;}})});}_0x2b4b6e=_['merge']({},_0x2b4b6e,_0xeb0522[_0x7949('0x3b')]);var _0x2e0697={'where':_0x2b4b6e['where']};return db[_0x7949('0x3c')][_0x7949('0x1b')](_0x2e0697)['then'](function(_0x515db4){_0x1e3c20[_0x7949('0x1b')]=_0x515db4;if(_0xeb0522['query'][_0x7949('0x3d')]){_0x2b4b6e['include']=[{'all':!![]}];}return db[_0x7949('0x3c')][_0x7949('0x3e')](_0x2b4b6e);})[_0x7949('0x21')](function(_0x3e16b9){_0x1e3c20[_0x7949('0x3f')]=_0x3e16b9;return _0x1e3c20;})[_0x7949('0x21')](respondWithFilteredResult(_0x93770b,_0x2b4b6e))[_0x7949('0x40')](handleError(_0x93770b,null));};exports[_0x7949('0x41')]=function(_0x26be44,_0x3e452a){var _0xba8ab7={'raw':![],'where':{'id':_0x26be44['params']['id']}},_0x50dbb9={};_0x50dbb9[_0x7949('0x2c')]=_[_0x7949('0x42')](db[_0x7949('0x3c')][_0x7949('0x43')]);_0x50dbb9[_0x7949('0x2a')]=_[_0x7949('0x42')](_0x26be44[_0x7949('0x2a')]);_0x50dbb9[_0x7949('0x2b')]=_[_0x7949('0x2d')](_0x50dbb9['model'],_0x50dbb9[_0x7949('0x2a')]);_0xba8ab7[_0x7949('0x2f')]=_[_0x7949('0x2d')](_0x50dbb9['model'],qs['fields'](_0x26be44[_0x7949('0x2a')][_0x7949('0x2e')]));_0xba8ab7[_0x7949('0x2f')]=_0xba8ab7['attributes'][_0x7949('0x30')]?_0xba8ab7[_0x7949('0x2f')]:_0x50dbb9[_0x7949('0x2c')];if(_0x26be44[_0x7949('0x2a')][_0x7949('0x3d')]){_0xba8ab7['include']=[{'all':!![]}];}_0xba8ab7=_[_0x7949('0x38')]({},_0xba8ab7,_0x26be44['options']);return db['SugarcrmConfiguration'][_0x7949('0x44')](_0xba8ab7)[_0x7949('0x21')](handleEntityNotFound(_0x3e452a,null))[_0x7949('0x21')](respondWithResult(_0x3e452a,null))[_0x7949('0x40')](handleError(_0x3e452a,null));};exports[_0x7949('0x45')]=function(_0x4b2ba6,_0x251d74){return db[_0x7949('0x3c')][_0x7949('0x45')](_0x4b2ba6[_0x7949('0x46')],{})[_0x7949('0x21')](respondWithResult(_0x251d74,0xc9))[_0x7949('0x40')](handleError(_0x251d74,null));};exports[_0x7949('0x20')]=function(_0x6b641d,_0x526fb3){if(_0x6b641d[_0x7949('0x46')]['id']){delete _0x6b641d['body']['id'];}return db[_0x7949('0x3c')][_0x7949('0x44')]({'where':{'id':_0x6b641d['params']['id']}})[_0x7949('0x21')](handleEntityNotFound(_0x526fb3,null))[_0x7949('0x21')](saveUpdates(_0x6b641d[_0x7949('0x46')],null))[_0x7949('0x21')](respondWithResult(_0x526fb3,null))[_0x7949('0x40')](handleError(_0x526fb3,null));};exports[_0x7949('0x22')]=function(_0x3da8f0,_0x30299b){return db[_0x7949('0x3c')][_0x7949('0x44')]({'where':{'id':_0x3da8f0[_0x7949('0x47')]['id']}})[_0x7949('0x21')](handleEntityNotFound(_0x30299b,null))[_0x7949('0x21')](removeEntity(_0x30299b,null))[_0x7949('0x40')](handleError(_0x30299b,null));};exports[_0x7949('0x48')]=function(_0x166670,_0x4cd5e0,_0x475b74){var _0x47f455={};var _0x20c852={};var _0x46d1ef;var _0xc0fe15;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x166670[_0x7949('0x47')]['id']}})[_0x7949('0x21')](handleEntityNotFound(_0x4cd5e0,null))[_0x7949('0x21')](function(_0x1af01f){if(_0x1af01f){_0x46d1ef=_0x1af01f;_0x20c852[_0x7949('0x2c')]=_[_0x7949('0x42')](db[_0x7949('0x49')][_0x7949('0x43')]);_0x20c852[_0x7949('0x2a')]=_[_0x7949('0x42')](_0x166670['query']);_0x20c852['filters']=_[_0x7949('0x2d')](_0x20c852[_0x7949('0x2c')],_0x20c852[_0x7949('0x2a')]);_0x47f455[_0x7949('0x2f')]=_[_0x7949('0x2d')](_0x20c852['model'],qs[_0x7949('0x2e')](_0x166670['query'][_0x7949('0x2e')]));_0x47f455[_0x7949('0x2f')]=_0x47f455[_0x7949('0x2f')][_0x7949('0x30')]?_0x47f455['attributes']:_0x20c852[_0x7949('0x2c')];_0x47f455[_0x7949('0x4a')]=qs[_0x7949('0x34')](_0x166670[_0x7949('0x2a')][_0x7949('0x34')]);_0x47f455[_0x7949('0x35')]=qs['filters'](_['pick'](_0x166670['query'],_0x20c852['filters']));if(_0x166670[_0x7949('0x2a')][_0x7949('0x37')]){_0x47f455[_0x7949('0x35')]=_[_0x7949('0x38')](_0x47f455['where'],{'$or':_['map'](_0x47f455[_0x7949('0x2f')],function(_0x340cf8){var _0x2387fe={};_0x2387fe[_0x340cf8]={'$like':'%'+_0x166670[_0x7949('0x2a')][_0x7949('0x37')]+'%'};return _0x2387fe;})});}_0x47f455=_[_0x7949('0x38')]({},_0x47f455,_0x166670['options']);return _0x46d1ef['getFields'](_0x47f455);}})['then'](function(_0x1e1eef){if(_0x1e1eef){_0xc0fe15=_0x1e1eef[_0x7949('0x30')];if(!_0x166670['query']['hasOwnProperty'](_0x7949('0x32'))){_0x47f455[_0x7949('0x33')]=qs[_0x7949('0x33')](_0x166670[_0x7949('0x2a')][_0x7949('0x33')]);_0x47f455[_0x7949('0x19')]=qs[_0x7949('0x19')](_0x166670[_0x7949('0x2a')][_0x7949('0x19')]);}return _0x46d1ef['getFields'](_0x47f455);}})['then'](function(_0x2cc73d){if(_0x2cc73d){return _0x2cc73d?{'count':_0xc0fe15,'rows':_0x2cc73d}:null;}})[_0x7949('0x21')](respondWithResult(_0x4cd5e0,null))[_0x7949('0x40')](handleError(_0x4cd5e0,null));};exports[_0x7949('0x4b')]=function(_0x3daa16,_0x4e7da3,_0x21a3bd){var _0x494746={};var _0x3a1ecf={};var _0x3f591d;var _0x2fc106;return db[_0x7949('0x3c')][_0x7949('0x4c')]({'where':{'id':_0x3daa16['params']['id']}})['then'](handleEntityNotFound(_0x4e7da3,null))[_0x7949('0x21')](function(_0x49ea68){if(_0x49ea68){_0x3f591d=_0x49ea68;_0x3a1ecf[_0x7949('0x2c')]=_[_0x7949('0x42')](db[_0x7949('0x49')][_0x7949('0x43')]);_0x3a1ecf[_0x7949('0x2a')]=_[_0x7949('0x42')](_0x3daa16[_0x7949('0x2a')]);_0x3a1ecf[_0x7949('0x2b')]=_[_0x7949('0x2d')](_0x3a1ecf[_0x7949('0x2c')],_0x3a1ecf[_0x7949('0x2a')]);_0x494746[_0x7949('0x2f')]=_[_0x7949('0x2d')](_0x3a1ecf['model'],qs[_0x7949('0x2e')](_0x3daa16[_0x7949('0x2a')][_0x7949('0x2e')]));_0x494746['attributes']=_0x494746[_0x7949('0x2f')][_0x7949('0x30')]?_0x494746[_0x7949('0x2f')]:_0x3a1ecf[_0x7949('0x2c')];_0x494746['order']=qs[_0x7949('0x34')](_0x3daa16[_0x7949('0x2a')]['sort']);_0x494746['where']=qs[_0x7949('0x2b')](_[_0x7949('0x36')](_0x3daa16[_0x7949('0x2a')],_0x3a1ecf['filters']));if(_0x3daa16[_0x7949('0x2a')][_0x7949('0x37')]){_0x494746[_0x7949('0x35')]=_[_0x7949('0x38')](_0x494746['where'],{'$or':_[_0x7949('0x27')](_0x494746[_0x7949('0x2f')],function(_0x147519){var _0x464239={};_0x464239[_0x147519]={'$like':'%'+_0x3daa16['query'][_0x7949('0x37')]+'%'};return _0x464239;})});}_0x494746=_[_0x7949('0x38')]({},_0x494746,_0x3daa16[_0x7949('0x3b')]);return _0x3f591d[_0x7949('0x4b')](_0x494746);}})[_0x7949('0x21')](function(_0x413e45){if(_0x413e45){_0x2fc106=_0x413e45[_0x7949('0x30')];if(!_0x3daa16[_0x7949('0x2a')][_0x7949('0x31')](_0x7949('0x32'))){_0x494746[_0x7949('0x33')]=qs[_0x7949('0x33')](_0x3daa16[_0x7949('0x2a')]['limit']);_0x494746[_0x7949('0x19')]=qs[_0x7949('0x19')](_0x3daa16[_0x7949('0x2a')][_0x7949('0x19')]);}return _0x3f591d['getSubjects'](_0x494746);}})[_0x7949('0x21')](function(_0x40e0f3){if(_0x40e0f3){return _0x40e0f3?{'count':_0x2fc106,'rows':_0x40e0f3}:null;}})[_0x7949('0x21')](respondWithResult(_0x4e7da3,null))[_0x7949('0x40')](handleError(_0x4e7da3,null));};exports[_0x7949('0x4d')]=function(_0x12ec6b,_0xec1edf,_0x3dd29e){var _0x3dfbbd={};var _0x4401ae={};var _0x3d5dd3;var _0x2d188e;return db['SugarcrmConfiguration'][_0x7949('0x4c')]({'where':{'id':_0x12ec6b[_0x7949('0x47')]['id']}})['then'](handleEntityNotFound(_0xec1edf,null))[_0x7949('0x21')](function(_0x5a4e6c){if(_0x5a4e6c){_0x3d5dd3=_0x5a4e6c;_0x4401ae[_0x7949('0x2c')]=_[_0x7949('0x42')](db[_0x7949('0x49')][_0x7949('0x43')]);_0x4401ae[_0x7949('0x2a')]=_[_0x7949('0x42')](_0x12ec6b[_0x7949('0x2a')]);_0x4401ae['filters']=_[_0x7949('0x2d')](_0x4401ae[_0x7949('0x2c')],_0x4401ae['query']);_0x3dfbbd[_0x7949('0x2f')]=_[_0x7949('0x2d')](_0x4401ae['model'],qs[_0x7949('0x2e')](_0x12ec6b[_0x7949('0x2a')][_0x7949('0x2e')]));_0x3dfbbd['attributes']=_0x3dfbbd[_0x7949('0x2f')][_0x7949('0x30')]?_0x3dfbbd[_0x7949('0x2f')]:_0x4401ae[_0x7949('0x2c')];_0x3dfbbd[_0x7949('0x4a')]=qs[_0x7949('0x34')](_0x12ec6b['query'][_0x7949('0x34')]);_0x3dfbbd[_0x7949('0x35')]=qs['filters'](_[_0x7949('0x36')](_0x12ec6b[_0x7949('0x2a')],_0x4401ae[_0x7949('0x2b')]));if(_0x12ec6b['query'][_0x7949('0x37')]){_0x3dfbbd['where']=_[_0x7949('0x38')](_0x3dfbbd[_0x7949('0x35')],{'$or':_[_0x7949('0x27')](_0x3dfbbd['attributes'],function(_0x51ded0){var _0x7d5caa={};_0x7d5caa[_0x51ded0]={'$like':'%'+_0x12ec6b[_0x7949('0x2a')][_0x7949('0x37')]+'%'};return _0x7d5caa;})});}_0x3dfbbd=_[_0x7949('0x38')]({},_0x3dfbbd,_0x12ec6b[_0x7949('0x3b')]);return _0x3d5dd3[_0x7949('0x4d')](_0x3dfbbd);}})[_0x7949('0x21')](function(_0x4dfbb0){if(_0x4dfbb0){_0x2d188e=_0x4dfbb0['length'];if(!_0x12ec6b[_0x7949('0x2a')]['hasOwnProperty'](_0x7949('0x32'))){_0x3dfbbd[_0x7949('0x33')]=qs[_0x7949('0x33')](_0x12ec6b[_0x7949('0x2a')][_0x7949('0x33')]);_0x3dfbbd['offset']=qs[_0x7949('0x19')](_0x12ec6b[_0x7949('0x2a')]['offset']);}return _0x3d5dd3[_0x7949('0x4d')](_0x3dfbbd);}})[_0x7949('0x21')](function(_0x28d350){if(_0x28d350){return _0x28d350?{'count':_0x2d188e,'rows':_0x28d350}:null;}})['then'](respondWithResult(_0xec1edf,null))['catch'](handleError(_0xec1edf,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 247897d..bab1f67 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 _0xb044=['path','rimraf','../../config/environment','exports','define','int_sugarcrm_configurations','util','api','moment','bluebird','request-promise'];(function(_0x4afdce,_0x2d1a6a){var _0x5a163f=function(_0x392115){while(--_0x392115){_0x4afdce['push'](_0x4afdce['shift']());}};_0x5a163f(++_0x2d1a6a);}(_0xb044,0x74));var _0x4b04=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb044[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0x4b04('0x0'));var logger=require('../../config/logger')(_0x4b04('0x1'));var moment=require(_0x4b04('0x2'));var BPromise=require(_0x4b04('0x3'));var rp=require(_0x4b04('0x4'));var fs=require('fs');var path=require(_0x4b04('0x5'));var rimraf=require(_0x4b04('0x6'));var config=require(_0x4b04('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x4b04('0x8')]=function(_0x17cd2d,_0x4fce87){return _0x17cd2d[_0x4b04('0x9')]('SugarcrmConfiguration',attributes,{'tableName':_0x4b04('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fc9=['../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x5c2aec,_0x28b371){var _0x12a6ef=function(_0x199a25){while(--_0x199a25){_0x5c2aec['push'](_0x5c2aec['shift']());}};_0x12a6ef(++_0x28b371);}(_0x9fc9,0x95));var _0x99fc=function(_0x3ddc51,_0x27523f){_0x3ddc51=_0x3ddc51-0x0;var _0x20953c=_0x9fc9[_0x3ddc51];return _0x20953c;};'use strict';var _=require(_0x99fc('0x0'));var util=require(_0x99fc('0x1'));var logger=require(_0x99fc('0x2'))(_0x99fc('0x3'));var moment=require('moment');var BPromise=require(_0x99fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99fc('0x5'));var rimraf=require(_0x99fc('0x6'));var config=require(_0x99fc('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x99fc('0x8')]=function(_0xc21eae,_0x435ff7){return _0xc21eae[_0x99fc('0x9')](_0x99fc('0xa'),attributes,{'tableName':_0x99fc('0xb'),'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 ed9f153..ebc9533 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 _0xe1d2=['catch','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x289d2b,_0xcaf592){var _0x1153a2=function(_0x4ed5d7){while(--_0x4ed5d7){_0x289d2b['push'](_0x289d2b['shift']());}};_0x1153a2(++_0xcaf592);}(_0xe1d2,0x1e1));var _0x2e1d=function(_0x5ed55e,_0x4e3380){_0x5ed55e=_0x5ed55e-0x0;var _0x454e03=_0xe1d2[_0x5ed55e];return _0x454e03;};'use strict';var _=require('lodash');var util=require(_0x2e1d('0x0'));var moment=require(_0x2e1d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e1d('0x2'))['db'];var utils=require(_0x2e1d('0x3'));var logger=require('../../config/logger')(_0x2e1d('0x4'));var config=require(_0x2e1d('0x5'));var jayson=require(_0x2e1d('0x6'));var client=jayson['client'][_0x2e1d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c3e52,_0x13867b,_0x2ab0fe){return new BPromise(function(_0xdc7419,_0x2acddf){return client[_0x2e1d('0x8')](_0x1c3e52,_0x2ab0fe)[_0x2e1d('0x9')](function(_0x509e7c){logger[_0x2e1d('0xa')](_0x2e1d('0xb'),_0x13867b,_0x2e1d('0xc'));logger[_0x2e1d('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x13867b,'request\x20sent',JSON[_0x2e1d('0xe')](_0x509e7c));if(_0x509e7c[_0x2e1d('0xf')]){if(_0x509e7c[_0x2e1d('0xf')][_0x2e1d('0x10')]===0x1f4){logger[_0x2e1d('0xf')](_0x2e1d('0xb'),_0x13867b,_0x509e7c[_0x2e1d('0xf')]['message']);return _0x2acddf(_0x509e7c[_0x2e1d('0xf')][_0x2e1d('0x11')]);}logger[_0x2e1d('0xf')](_0x2e1d('0xb'),_0x13867b,_0x509e7c[_0x2e1d('0xf')]['message']);return _0xdc7419(_0x509e7c[_0x2e1d('0xf')][_0x2e1d('0x11')]);}else{logger[_0x2e1d('0xa')](_0x2e1d('0xb'),_0x13867b,_0x2e1d('0xc'));_0xdc7419(_0x509e7c[_0x2e1d('0x12')][_0x2e1d('0x11')]);}})[_0x2e1d('0x13')](function(_0x1f6911){logger['error'](_0x2e1d('0xb'),_0x13867b,_0x1f6911);_0x2acddf(_0x1f6911);});});} \ No newline at end of file +var _0x4edf=['SugarcrmConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x35c19b,_0x7a7bb2){var _0x335340=function(_0x5c5f61){while(--_0x5c5f61){_0x35c19b['push'](_0x35c19b['shift']());}};_0x335340(++_0x7a7bb2);}(_0x4edf,0x1d1));var _0xf4ed=function(_0x57da0a,_0x284aed){_0x57da0a=_0x57da0a-0x0;var _0x3145d5=_0x4edf[_0x57da0a];return _0x3145d5;};'use strict';var _=require(_0xf4ed('0x0'));var util=require(_0xf4ed('0x1'));var moment=require(_0xf4ed('0x2'));var BPromise=require(_0xf4ed('0x3'));var rs=require(_0xf4ed('0x4'));var fs=require('fs');var Redis=require(_0xf4ed('0x5'));var db=require(_0xf4ed('0x6'))['db'];var utils=require(_0xf4ed('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf4ed('0x8'));var jayson=require(_0xf4ed('0x9'));var client=jayson['client'][_0xf4ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48cf18,_0x58ba8b,_0x4c3af1){return new BPromise(function(_0x2a4301,_0x369609){return client[_0xf4ed('0xb')](_0x48cf18,_0x4c3af1)[_0xf4ed('0xc')](function(_0x3636a8){logger[_0xf4ed('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x58ba8b,_0xf4ed('0xe'));logger[_0xf4ed('0xf')](_0xf4ed('0x10'),_0x58ba8b,'request\x20sent',JSON['stringify'](_0x3636a8));if(_0x3636a8[_0xf4ed('0x11')]){if(_0x3636a8[_0xf4ed('0x11')][_0xf4ed('0x12')]===0x1f4){logger['error'](_0xf4ed('0x13'),_0x58ba8b,_0x3636a8['error'][_0xf4ed('0x14')]);return _0x369609(_0x3636a8['error'][_0xf4ed('0x14')]);}logger[_0xf4ed('0x11')](_0xf4ed('0x13'),_0x58ba8b,_0x3636a8[_0xf4ed('0x11')][_0xf4ed('0x14')]);return _0x2a4301(_0x3636a8[_0xf4ed('0x11')][_0xf4ed('0x14')]);}else{logger[_0xf4ed('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x58ba8b,_0xf4ed('0xe'));_0x2a4301(_0x3636a8[_0xf4ed('0x15')][_0xf4ed('0x14')]);}})['catch'](function(_0x41e323){logger[_0xf4ed('0x11')](_0xf4ed('0x13'),_0x58ba8b,_0x41e323);_0x369609(_0x41e323);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index f883421..8266d4a 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 _0xc057=['./intSugarcrmField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x17ecff,_0x2147b6){var _0x41eaaa=function(_0x13f32e){while(--_0x13f32e){_0x17ecff['push'](_0x17ecff['shift']());}};_0x41eaaa(++_0x2147b6);}(_0xc057,0x9b));var _0x7c05=function(_0x18aef9,_0x572f42){_0x18aef9=_0x18aef9-0x0;var _0xb9d29c=_0xc057[_0x18aef9];return _0xb9d29c;};'use strict';var multer=require('multer');var util=require(_0x7c05('0x0'));var path=require(_0x7c05('0x1'));var timeout=require(_0x7c05('0x2'));var express=require(_0x7c05('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7c05('0x4'));var interaction=require(_0x7c05('0x5'));var config=require(_0x7c05('0x6'));var controller=require(_0x7c05('0x7'));router[_0x7c05('0x8')]('/',auth[_0x7c05('0x9')](),controller['index']);router[_0x7c05('0x8')]('/:id',auth[_0x7c05('0x9')](),controller[_0x7c05('0xa')]);router[_0x7c05('0xb')]('/',auth[_0x7c05('0x9')](),controller[_0x7c05('0xc')]);router[_0x7c05('0xd')](_0x7c05('0xe'),auth['isAuthenticated'](),controller[_0x7c05('0xf')]);router[_0x7c05('0x10')](_0x7c05('0xe'),auth[_0x7c05('0x9')](),controller['destroy']);module[_0x7c05('0x11')]=router; \ No newline at end of file +var _0x69a8=['Router','fs-extra','./intSugarcrmField.controller','isAuthenticated','index','get','show','post','create','put','update','delete','/:id','destroy','exports','multer','express'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x69a8,0x11f));var _0x869a=function(_0x25f747,_0x549699){_0x25f747=_0x25f747-0x0;var _0x212551=_0x69a8[_0x25f747];return _0x212551;};'use strict';var multer=require(_0x869a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x869a('0x1'));var router=express[_0x869a('0x2')]();var fs_extra=require(_0x869a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x869a('0x4'));router['get']('/',auth[_0x869a('0x5')](),controller[_0x869a('0x6')]);router[_0x869a('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x869a('0x8')]);router[_0x869a('0x9')]('/',auth['isAuthenticated'](),controller[_0x869a('0xa')]);router[_0x869a('0xb')]('/:id',auth[_0x869a('0x5')](),controller[_0x869a('0xc')]);router[_0x869a('0xd')](_0x869a('0xe'),auth[_0x869a('0x5')](),controller[_0x869a('0xf')]);module[_0x869a('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 2ab453b..6539eb3 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 _0xf280=['variable','keyValue','picklist','STRING','string','BOOLEAN','ENUM'];(function(_0x5078dd,_0x369434){var _0x422e40=function(_0x4b553b){while(--_0x4b553b){_0x5078dd['push'](_0x5078dd['shift']());}};_0x422e40(++_0x369434);}(_0xf280,0x125));var _0x0f28=function(_0x323d87,_0x4ef3f9){_0x323d87=_0x323d87-0x0;var _0x5e8f74=_0xf280[_0x323d87];return _0x5e8f74;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x0f28('0x0')]('string',_0x0f28('0x1'),'customVariable',_0x0f28('0x2'),_0x0f28('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0f28('0x4')]},'key':{'type':Sequelize[_0x0f28('0x4')]},'keyType':{'type':Sequelize[_0x0f28('0x0')](_0x0f28('0x5'),_0x0f28('0x1'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0f28('0x4')]},'customField':{'type':Sequelize[_0x0f28('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0f28('0x4')]}}; \ No newline at end of file +var _0x5699=['string','customVariable','keyValue','picklist','STRING','variable','exports','ENUM'];(function(_0x4fa0c7,_0x4a9abc){var _0x27234c=function(_0x530409){while(--_0x530409){_0x4fa0c7['push'](_0x4fa0c7['shift']());}};_0x27234c(++_0x4a9abc);}(_0x5699,0x1de));var _0x9569=function(_0x20b191,_0x5ef6b3){_0x20b191=_0x20b191-0x0;var _0x5a3f54=_0x5699[_0x20b191];return _0x5a3f54;};'use strict';var Sequelize=require('sequelize');module[_0x9569('0x0')]={'type':{'type':Sequelize[_0x9569('0x1')](_0x9569('0x2'),'variable',_0x9569('0x3'),_0x9569('0x4'),_0x9569('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9569('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9569('0x1')]('string',_0x9569('0x7'),_0x9569('0x3'))},'keyContent':{'type':Sequelize[_0x9569('0x6')]},'idField':{'type':Sequelize[_0x9569('0x6')]},'nameField':{'type':Sequelize[_0x9569('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9569('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index aa736b8..0b502c4 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 _0xb26a=['ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','sendStatus','stack','name','send','SugarcrmField','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','rawAttributes','includeAll','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox'];(function(_0x11a289,_0x54b41c){var _0x224679=function(_0x4c972c){while(--_0x4c972c){_0x11a289['push'](_0x11a289['shift']());}};_0x224679(++_0x54b41c);}(_0xb26a,0xd3));var _0xab26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb26a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xab26('0x0'));var rimraf=require(_0xab26('0x1'));var zipdir=require(_0xab26('0x2'));var jsonpatch=require(_0xab26('0x3'));var rp=require(_0xab26('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xab26('0x5'));var util=require(_0xab26('0x6'));var path=require('path');var sox=require(_0xab26('0x7'));var csv=require('to-csv');var ejs=require(_0xab26('0x8'));var fs=require('fs');var fs_extra=require(_0xab26('0x9'));var _=require(_0xab26('0xa'));var squel=require(_0xab26('0xb'));var crypto=require(_0xab26('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xab26('0xd'));var toCsv=require(_0xab26('0xe'));var querystring=require(_0xab26('0xf'));var Papa=require(_0xab26('0x10'));var Redis=require(_0xab26('0x11'));var authService=require(_0xab26('0x12'));var qs=require(_0xab26('0x13'));var as=require(_0xab26('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab26('0x15'))(_0xab26('0x16'));var utils=require('../../config/utils');var config=require(_0xab26('0x17'));var licenseUtil=require(_0xab26('0x18'));var db=require(_0xab26('0x19'))['db'];function respondWithStatusCode(_0x210443,_0x3f1c5b){_0x3f1c5b=_0x3f1c5b||0xcc;return function(_0x147e2d){if(_0x147e2d){return _0x210443['sendStatus'](_0x3f1c5b);}return _0x210443['status'](_0x3f1c5b)['end']();};}function respondWithResult(_0x33eae4,_0x445fcc){_0x445fcc=_0x445fcc||0xc8;return function(_0x4cd494){if(_0x4cd494){return _0x33eae4['status'](_0x445fcc)[_0xab26('0x1a')](_0x4cd494);}};}function respondWithFilteredResult(_0x549f2c,_0x434f82){return function(_0x4565f0){if(_0x4565f0){var _0x480b7b=typeof _0x434f82[_0xab26('0x1b')]===_0xab26('0x1c')&&typeof _0x434f82[_0xab26('0x1d')]==='undefined';var _0xd89a1f=_0x4565f0['count'];var _0x13c13e=_0x480b7b?0x0:_0x434f82[_0xab26('0x1b')];var _0x32cffd=_0x480b7b?_0x4565f0[_0xab26('0x1e')]:_0x434f82[_0xab26('0x1b')]+_0x434f82['limit'];var _0x3aee4f;if(_0x32cffd>=_0xd89a1f){_0x32cffd=_0xd89a1f;_0x3aee4f=0xc8;}else{_0x3aee4f=0xce;}_0x549f2c[_0xab26('0x1f')](_0x3aee4f);return _0x549f2c[_0xab26('0x20')]('Content-Range',_0x13c13e+'-'+_0x32cffd+'/'+_0xd89a1f)['json'](_0x4565f0);}return null;};}function patchUpdates(_0x5adf1b){return function(_0xad0f43){try{jsonpatch[_0xab26('0x21')](_0xad0f43,_0x5adf1b,!![]);}catch(_0x106aa4){return BPromise[_0xab26('0x22')](_0x106aa4);}return _0xad0f43[_0xab26('0x23')]();};}function saveUpdates(_0x1f5f29,_0x4a6248){return function(_0x34687f){if(_0x34687f){return _0x34687f[_0xab26('0x24')](_0x1f5f29)[_0xab26('0x25')](function(_0x12425f){return _0x12425f;});}return null;};}function removeEntity(_0xcc1b4e,_0x2ec5b3){return function(_0x59a8e8){if(_0x59a8e8){return _0x59a8e8['destroy']()[_0xab26('0x25')](function(){_0xcc1b4e[_0xab26('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x408955,_0x1dff70){return function(_0x2116ea){if(!_0x2116ea){_0x408955[_0xab26('0x26')](0x194);}return _0x2116ea;};}function handleError(_0x383225,_0x29c017){_0x29c017=_0x29c017||0x1f4;return function(_0x331051){logger['error'](_0x331051[_0xab26('0x27')]);if(_0x331051[_0xab26('0x28')]){delete _0x331051[_0xab26('0x28')];}_0x383225[_0xab26('0x1f')](_0x29c017)[_0xab26('0x29')](_0x331051);};}exports['index']=function(_0x5d59fa,_0x3bda4e){var _0x237bd7={},_0x3814ee={},_0x46dcd5={'count':0x0,'rows':[]};var _0x38ffc5=_['map'](db[_0xab26('0x2a')]['rawAttributes'],function(_0x26ef60){return{'name':_0x26ef60[_0xab26('0x2b')],'type':_0x26ef60['type'][_0xab26('0x2c')]};});_0x3814ee[_0xab26('0x2d')]=_[_0xab26('0x2e')](_0x38ffc5,_0xab26('0x28'));_0x3814ee[_0xab26('0x2f')]=_[_0xab26('0x30')](_0x5d59fa[_0xab26('0x2f')]);_0x3814ee[_0xab26('0x31')]=_[_0xab26('0x32')](_0x3814ee[_0xab26('0x2d')],_0x3814ee[_0xab26('0x2f')]);_0x237bd7[_0xab26('0x33')]=_['intersection'](_0x3814ee[_0xab26('0x2d')],qs[_0xab26('0x34')](_0x5d59fa[_0xab26('0x2f')][_0xab26('0x34')]));_0x237bd7[_0xab26('0x33')]=_0x237bd7[_0xab26('0x33')][_0xab26('0x35')]?_0x237bd7[_0xab26('0x33')]:_0x3814ee[_0xab26('0x2d')];if(!_0x5d59fa[_0xab26('0x2f')][_0xab26('0x36')](_0xab26('0x37'))){_0x237bd7[_0xab26('0x1d')]=qs[_0xab26('0x1d')](_0x5d59fa[_0xab26('0x2f')][_0xab26('0x1d')]);_0x237bd7[_0xab26('0x1b')]=qs[_0xab26('0x1b')](_0x5d59fa['query'][_0xab26('0x1b')]);}_0x237bd7['order']=qs[_0xab26('0x38')](_0x5d59fa[_0xab26('0x2f')][_0xab26('0x38')]);_0x237bd7[_0xab26('0x39')]=qs[_0xab26('0x31')](_[_0xab26('0x3a')](_0x5d59fa[_0xab26('0x2f')],_0x3814ee[_0xab26('0x31')]),_0x38ffc5);if(_0x5d59fa[_0xab26('0x2f')][_0xab26('0x3b')]){_0x237bd7['where']=_[_0xab26('0x3c')](_0x237bd7['where'],{'$or':_[_0xab26('0x2e')](_0x38ffc5,function(_0x3a0f29){if(_0x3a0f29[_0xab26('0x3d')]!==_0xab26('0x3e')){var _0x1da605={};_0x1da605[_0x3a0f29[_0xab26('0x28')]]={'$like':'%'+_0x5d59fa[_0xab26('0x2f')][_0xab26('0x3b')]+'%'};return _0x1da605;}})});}_0x237bd7=_[_0xab26('0x3c')]({},_0x237bd7,_0x5d59fa[_0xab26('0x3f')]);var _0x5e8143={'where':_0x237bd7['where']};return db[_0xab26('0x2a')][_0xab26('0x1e')](_0x5e8143)['then'](function(_0x169993){_0x46dcd5[_0xab26('0x1e')]=_0x169993;if(_0x5d59fa[_0xab26('0x2f')]['includeAll']){_0x237bd7[_0xab26('0x40')]=[{'all':!![]}];}return db[_0xab26('0x2a')]['findAll'](_0x237bd7);})[_0xab26('0x25')](function(_0x5ed638){_0x46dcd5[_0xab26('0x41')]=_0x5ed638;return _0x46dcd5;})[_0xab26('0x25')](respondWithFilteredResult(_0x3bda4e,_0x237bd7))[_0xab26('0x42')](handleError(_0x3bda4e,null));};exports['show']=function(_0x1e6803,_0x4b84e7){var _0x3061ec={'raw':!![],'where':{'id':_0x1e6803['params']['id']}},_0x3eb970={};_0x3eb970['model']=_[_0xab26('0x30')](db[_0xab26('0x2a')][_0xab26('0x43')]);_0x3eb970[_0xab26('0x2f')]=_['keys'](_0x1e6803['query']);_0x3eb970['filters']=_[_0xab26('0x32')](_0x3eb970[_0xab26('0x2d')],_0x3eb970[_0xab26('0x2f')]);_0x3061ec[_0xab26('0x33')]=_[_0xab26('0x32')](_0x3eb970[_0xab26('0x2d')],qs[_0xab26('0x34')](_0x1e6803[_0xab26('0x2f')]['fields']));_0x3061ec[_0xab26('0x33')]=_0x3061ec[_0xab26('0x33')]['length']?_0x3061ec['attributes']:_0x3eb970[_0xab26('0x2d')];if(_0x1e6803[_0xab26('0x2f')][_0xab26('0x44')]){_0x3061ec[_0xab26('0x40')]=[{'all':!![]}];}_0x3061ec=_[_0xab26('0x3c')]({},_0x3061ec,_0x1e6803[_0xab26('0x3f')]);return db['SugarcrmField']['find'](_0x3061ec)[_0xab26('0x25')](handleEntityNotFound(_0x4b84e7,null))[_0xab26('0x25')](respondWithResult(_0x4b84e7,null))[_0xab26('0x42')](handleError(_0x4b84e7,null));};exports[_0xab26('0x45')]=function(_0x377806,_0x48f57a){return db[_0xab26('0x2a')][_0xab26('0x45')](_0x377806[_0xab26('0x46')],{})[_0xab26('0x25')](respondWithResult(_0x48f57a,0xc9))[_0xab26('0x42')](handleError(_0x48f57a,null));};exports[_0xab26('0x24')]=function(_0x3d5c8a,_0x1da9e3){if(_0x3d5c8a[_0xab26('0x46')]['id']){delete _0x3d5c8a['body']['id'];}return db[_0xab26('0x2a')]['find']({'where':{'id':_0x3d5c8a[_0xab26('0x47')]['id']}})['then'](handleEntityNotFound(_0x1da9e3,null))['then'](saveUpdates(_0x3d5c8a[_0xab26('0x46')],null))[_0xab26('0x25')](respondWithResult(_0x1da9e3,null))[_0xab26('0x42')](handleError(_0x1da9e3,null));};exports[_0xab26('0x48')]=function(_0x18660d,_0x5aec4f){return db[_0xab26('0x2a')]['find']({'where':{'id':_0x18660d[_0xab26('0x47')]['id']}})[_0xab26('0x25')](handleEntityNotFound(_0x5aec4f,null))[_0xab26('0x25')](removeEntity(_0x5aec4f,null))[_0xab26('0x42')](handleError(_0x5aec4f,null));}; \ No newline at end of file +var _0x31ae=['params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','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','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','update','destroy','then','end','sendStatus','error','stack','name','send','map','SugarcrmField','type','key','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','catch','show','rawAttributes','intersection','includeAll','find','create','body'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x31ae,0x1c3));var _0xe31a=function(_0x35cf09,_0x5e86eb){_0x35cf09=_0x35cf09-0x0;var _0x3063f8=_0x31ae[_0x35cf09];return _0x3063f8;};'use strict';var emlformat=require(_0xe31a('0x0'));var rimraf=require(_0xe31a('0x1'));var zipdir=require(_0xe31a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe31a('0x3'));var moment=require('moment');var BPromise=require(_0xe31a('0x4'));var Mustache=require(_0xe31a('0x5'));var util=require(_0xe31a('0x6'));var path=require(_0xe31a('0x7'));var sox=require(_0xe31a('0x8'));var csv=require('to-csv');var ejs=require(_0xe31a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe31a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe31a('0xb'));var deskjs=require(_0xe31a('0xc'));var toCsv=require(_0xe31a('0xd'));var querystring=require('querystring');var Papa=require(_0xe31a('0xe'));var Redis=require(_0xe31a('0xf'));var authService=require(_0xe31a('0x10'));var qs=require(_0xe31a('0x11'));var as=require(_0xe31a('0x12'));var hardwareService=require(_0xe31a('0x13'));var logger=require(_0xe31a('0x14'))(_0xe31a('0x15'));var utils=require(_0xe31a('0x16'));var config=require(_0xe31a('0x17'));var licenseUtil=require(_0xe31a('0x18'));var db=require(_0xe31a('0x19'))['db'];function respondWithStatusCode(_0x36c597,_0x5c3c7a){_0x5c3c7a=_0x5c3c7a||0xcc;return function(_0x4c4c8){if(_0x4c4c8){return _0x36c597['sendStatus'](_0x5c3c7a);}return _0x36c597['status'](_0x5c3c7a)['end']();};}function respondWithResult(_0x14e867,_0xcdc9fa){_0xcdc9fa=_0xcdc9fa||0xc8;return function(_0x52ee0f){if(_0x52ee0f){return _0x14e867[_0xe31a('0x1a')](_0xcdc9fa)[_0xe31a('0x1b')](_0x52ee0f);}};}function respondWithFilteredResult(_0x128166,_0x222bbf){return function(_0x4cb3e1){if(_0x4cb3e1){var _0x4a8ac4=typeof _0x222bbf[_0xe31a('0x1c')]===_0xe31a('0x1d')&&typeof _0x222bbf['limit']==='undefined';var _0x21fbd4=_0x4cb3e1['count'];var _0x6e4330=_0x4a8ac4?0x0:_0x222bbf[_0xe31a('0x1c')];var _0x27484d=_0x4a8ac4?_0x4cb3e1[_0xe31a('0x1e')]:_0x222bbf['offset']+_0x222bbf[_0xe31a('0x1f')];var _0x5dff63;if(_0x27484d>=_0x21fbd4){_0x27484d=_0x21fbd4;_0x5dff63=0xc8;}else{_0x5dff63=0xce;}_0x128166[_0xe31a('0x1a')](_0x5dff63);return _0x128166[_0xe31a('0x20')]('Content-Range',_0x6e4330+'-'+_0x27484d+'/'+_0x21fbd4)[_0xe31a('0x1b')](_0x4cb3e1);}return null;};}function patchUpdates(_0x3ed182){return function(_0x41abb0){try{jsonpatch[_0xe31a('0x21')](_0x41abb0,_0x3ed182,!![]);}catch(_0x5ac110){return BPromise[_0xe31a('0x22')](_0x5ac110);}return _0x41abb0['save']();};}function saveUpdates(_0x58fef8,_0xd0c7f3){return function(_0xc1c9eb){if(_0xc1c9eb){return _0xc1c9eb[_0xe31a('0x23')](_0x58fef8)['then'](function(_0x130902){return _0x130902;});}return null;};}function removeEntity(_0x3fb037,_0x19bdba){return function(_0x3103f9){if(_0x3103f9){return _0x3103f9[_0xe31a('0x24')]()[_0xe31a('0x25')](function(){_0x3fb037['status'](0xcc)[_0xe31a('0x26')]();});}};}function handleEntityNotFound(_0x3bd7d4,_0x1eb69b){return function(_0x4a7ecc){if(!_0x4a7ecc){_0x3bd7d4[_0xe31a('0x27')](0x194);}return _0x4a7ecc;};}function handleError(_0x3abb91,_0x1e1a92){_0x1e1a92=_0x1e1a92||0x1f4;return function(_0x2965fe){logger[_0xe31a('0x28')](_0x2965fe[_0xe31a('0x29')]);if(_0x2965fe[_0xe31a('0x2a')]){delete _0x2965fe[_0xe31a('0x2a')];}_0x3abb91[_0xe31a('0x1a')](_0x1e1a92)[_0xe31a('0x2b')](_0x2965fe);};}exports['index']=function(_0x1012c4,_0x1228c2){var _0x2be414={},_0x11be1f={},_0x23f446={'count':0x0,'rows':[]};var _0x2be08e=_[_0xe31a('0x2c')](db[_0xe31a('0x2d')]['rawAttributes'],function(_0xbddf74){return{'name':_0xbddf74['fieldName'],'type':_0xbddf74[_0xe31a('0x2e')][_0xe31a('0x2f')]};});_0x11be1f['model']=_['map'](_0x2be08e,_0xe31a('0x2a'));_0x11be1f[_0xe31a('0x30')]=_[_0xe31a('0x31')](_0x1012c4[_0xe31a('0x30')]);_0x11be1f['filters']=_['intersection'](_0x11be1f[_0xe31a('0x32')],_0x11be1f['query']);_0x2be414[_0xe31a('0x33')]=_['intersection'](_0x11be1f[_0xe31a('0x32')],qs['fields'](_0x1012c4[_0xe31a('0x30')][_0xe31a('0x34')]));_0x2be414[_0xe31a('0x33')]=_0x2be414[_0xe31a('0x33')][_0xe31a('0x35')]?_0x2be414[_0xe31a('0x33')]:_0x11be1f[_0xe31a('0x32')];if(!_0x1012c4[_0xe31a('0x30')][_0xe31a('0x36')](_0xe31a('0x37'))){_0x2be414[_0xe31a('0x1f')]=qs[_0xe31a('0x1f')](_0x1012c4[_0xe31a('0x30')][_0xe31a('0x1f')]);_0x2be414[_0xe31a('0x1c')]=qs[_0xe31a('0x1c')](_0x1012c4[_0xe31a('0x30')][_0xe31a('0x1c')]);}_0x2be414[_0xe31a('0x38')]=qs[_0xe31a('0x39')](_0x1012c4[_0xe31a('0x30')]['sort']);_0x2be414['where']=qs[_0xe31a('0x3a')](_[_0xe31a('0x3b')](_0x1012c4['query'],_0x11be1f['filters']),_0x2be08e);if(_0x1012c4[_0xe31a('0x30')][_0xe31a('0x3c')]){_0x2be414[_0xe31a('0x3d')]=_[_0xe31a('0x3e')](_0x2be414[_0xe31a('0x3d')],{'$or':_['map'](_0x2be08e,function(_0x5a18e0){if(_0x5a18e0[_0xe31a('0x2e')]!==_0xe31a('0x3f')){var _0x20aa70={};_0x20aa70[_0x5a18e0[_0xe31a('0x2a')]]={'$like':'%'+_0x1012c4[_0xe31a('0x30')][_0xe31a('0x3c')]+'%'};return _0x20aa70;}})});}_0x2be414=_[_0xe31a('0x3e')]({},_0x2be414,_0x1012c4[_0xe31a('0x40')]);var _0x1cd09c={'where':_0x2be414[_0xe31a('0x3d')]};return db[_0xe31a('0x2d')][_0xe31a('0x1e')](_0x1cd09c)[_0xe31a('0x25')](function(_0x138403){_0x23f446[_0xe31a('0x1e')]=_0x138403;if(_0x1012c4[_0xe31a('0x30')]['includeAll']){_0x2be414[_0xe31a('0x41')]=[{'all':!![]}];}return db[_0xe31a('0x2d')]['findAll'](_0x2be414);})[_0xe31a('0x25')](function(_0x13fedb){_0x23f446['rows']=_0x13fedb;return _0x23f446;})[_0xe31a('0x25')](respondWithFilteredResult(_0x1228c2,_0x2be414))[_0xe31a('0x42')](handleError(_0x1228c2,null));};exports[_0xe31a('0x43')]=function(_0x3648c0,_0x1b966e){var _0x39369e={'raw':!![],'where':{'id':_0x3648c0['params']['id']}},_0x1488c3={};_0x1488c3[_0xe31a('0x32')]=_[_0xe31a('0x31')](db[_0xe31a('0x2d')][_0xe31a('0x44')]);_0x1488c3[_0xe31a('0x30')]=_[_0xe31a('0x31')](_0x3648c0['query']);_0x1488c3[_0xe31a('0x3a')]=_['intersection'](_0x1488c3[_0xe31a('0x32')],_0x1488c3[_0xe31a('0x30')]);_0x39369e[_0xe31a('0x33')]=_[_0xe31a('0x45')](_0x1488c3[_0xe31a('0x32')],qs[_0xe31a('0x34')](_0x3648c0[_0xe31a('0x30')][_0xe31a('0x34')]));_0x39369e[_0xe31a('0x33')]=_0x39369e[_0xe31a('0x33')][_0xe31a('0x35')]?_0x39369e[_0xe31a('0x33')]:_0x1488c3[_0xe31a('0x32')];if(_0x3648c0[_0xe31a('0x30')][_0xe31a('0x46')]){_0x39369e[_0xe31a('0x41')]=[{'all':!![]}];}_0x39369e=_[_0xe31a('0x3e')]({},_0x39369e,_0x3648c0[_0xe31a('0x40')]);return db[_0xe31a('0x2d')][_0xe31a('0x47')](_0x39369e)['then'](handleEntityNotFound(_0x1b966e,null))[_0xe31a('0x25')](respondWithResult(_0x1b966e,null))[_0xe31a('0x42')](handleError(_0x1b966e,null));};exports[_0xe31a('0x48')]=function(_0x518cf5,_0x4960da){return db[_0xe31a('0x2d')][_0xe31a('0x48')](_0x518cf5[_0xe31a('0x49')],{})['then'](respondWithResult(_0x4960da,0xc9))[_0xe31a('0x42')](handleError(_0x4960da,null));};exports[_0xe31a('0x23')]=function(_0x2e8706,_0x2fd15b){if(_0x2e8706[_0xe31a('0x49')]['id']){delete _0x2e8706['body']['id'];}return db[_0xe31a('0x2d')][_0xe31a('0x47')]({'where':{'id':_0x2e8706[_0xe31a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2fd15b,null))[_0xe31a('0x25')](saveUpdates(_0x2e8706[_0xe31a('0x49')],null))[_0xe31a('0x25')](respondWithResult(_0x2fd15b,null))[_0xe31a('0x42')](handleError(_0x2fd15b,null));};exports['destroy']=function(_0x141f56,_0x422904){return db[_0xe31a('0x2d')][_0xe31a('0x47')]({'where':{'id':_0x141f56['params']['id']}})[_0xe31a('0x25')](handleEntityNotFound(_0x422904,null))['then'](removeEntity(_0x422904,null))[_0xe31a('0x42')](handleError(_0x422904,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 2fcbd6b..92a50d1 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 _0x86d9=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util'];(function(_0x62cd0b,_0x478403){var _0x1ec7bd=function(_0x146712){while(--_0x146712){_0x62cd0b['push'](_0x62cd0b['shift']());}};_0x1ec7bd(++_0x478403);}(_0x86d9,0x196));var _0x986d=function(_0x195bde,_0x4b29b6){_0x195bde=_0x195bde-0x0;var _0x42ef9c=_0x86d9[_0x195bde];return _0x42ef9c;};'use strict';var _=require(_0x986d('0x0'));var util=require(_0x986d('0x1'));var logger=require(_0x986d('0x2'))(_0x986d('0x3'));var moment=require('moment');var BPromise=require(_0x986d('0x4'));var rp=require(_0x986d('0x5'));var fs=require('fs');var path=require(_0x986d('0x6'));var rimraf=require(_0x986d('0x7'));var config=require(_0x986d('0x8'));var attributes=require(_0x986d('0x9'));module[_0x986d('0xa')]=function(_0x427075,_0x2ebe1d){return _0x427075[_0x986d('0xb')](_0x986d('0xc'),attributes,{'tableName':_0x986d('0xd'),'paranoid':![],'indexes':[{'name':_0x986d('0xe'),'fields':[_0x986d('0xf'),_0x986d('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5939=['int_sugarcrm_fields','sugarcrm_unique_index','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','SugarcrmField'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x5939,0x121));var _0x9593=function(_0x1d6550,_0x3d38b7){_0x1d6550=_0x1d6550-0x0;var _0x1f75cd=_0x5939[_0x1d6550];return _0x1f75cd;};'use strict';var _=require('lodash');var util=require(_0x9593('0x0'));var logger=require(_0x9593('0x1'))(_0x9593('0x2'));var moment=require('moment');var BPromise=require(_0x9593('0x3'));var rp=require(_0x9593('0x4'));var fs=require('fs');var path=require(_0x9593('0x5'));var rimraf=require(_0x9593('0x6'));var config=require(_0x9593('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x9593('0x8')]=function(_0x4eee49,_0x2b8ca5){return _0x4eee49['define'](_0x9593('0x9'),attributes,{'tableName':_0x9593('0xa'),'paranoid':![],'indexes':[{'name':_0x9593('0xb'),'fields':['idField',_0x9593('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 444927e..af2dd2f 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 _0xe7e4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x376bed,_0x34f65c){var _0x56f14e=function(_0x321e2b){while(--_0x321e2b){_0x376bed['push'](_0x376bed['shift']());}};_0x56f14e(++_0x34f65c);}(_0xe7e4,0x14e));var _0x4e7e=function(_0x1fd7f8,_0x86203){_0x1fd7f8=_0x1fd7f8-0x0;var _0x12f57f=_0xe7e4[_0x1fd7f8];return _0x12f57f;};'use strict';var _=require(_0x4e7e('0x0'));var util=require(_0x4e7e('0x1'));var moment=require(_0x4e7e('0x2'));var BPromise=require(_0x4e7e('0x3'));var rs=require(_0x4e7e('0x4'));var fs=require('fs');var Redis=require(_0x4e7e('0x5'));var db=require(_0x4e7e('0x6'))['db'];var utils=require(_0x4e7e('0x7'));var logger=require(_0x4e7e('0x8'))(_0x4e7e('0x9'));var config=require(_0x4e7e('0xa'));var jayson=require(_0x4e7e('0xb'));var client=jayson[_0x4e7e('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cbb25,_0x79d82b,_0x3cb2d5){return new BPromise(function(_0x208aef,_0x4dc19d){return client[_0x4e7e('0xd')](_0x5cbb25,_0x3cb2d5)[_0x4e7e('0xe')](function(_0x41e36b){logger[_0x4e7e('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x79d82b,_0x4e7e('0x10'));logger[_0x4e7e('0x11')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x79d82b,'request\x20sent',JSON[_0x4e7e('0x12')](_0x41e36b));if(_0x41e36b[_0x4e7e('0x13')]){if(_0x41e36b[_0x4e7e('0x13')][_0x4e7e('0x14')]===0x1f4){logger[_0x4e7e('0x13')](_0x4e7e('0x15'),_0x79d82b,_0x41e36b['error'][_0x4e7e('0x16')]);return _0x4dc19d(_0x41e36b[_0x4e7e('0x13')][_0x4e7e('0x16')]);}logger[_0x4e7e('0x13')](_0x4e7e('0x15'),_0x79d82b,_0x41e36b['error']['message']);return _0x208aef(_0x41e36b['error']['message']);}else{logger[_0x4e7e('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x79d82b,_0x4e7e('0x10'));_0x208aef(_0x41e36b['result'][_0x4e7e('0x16')]);}})[_0x4e7e('0x17')](function(_0x7bae2c){logger[_0x4e7e('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x79d82b,_0x7bae2c);_0x4dc19d(_0x7bae2c);});});} \ No newline at end of file +var _0xd805=['error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x27e299,_0x4d8a2b){var _0x1d8c25=function(_0x5c9ef8){while(--_0x5c9ef8){_0x27e299['push'](_0x27e299['shift']());}};_0x1d8c25(++_0x4d8a2b);}(_0xd805,0xc1));var _0x5d80=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0xd805[_0x587ba2];return _0x50ec73;};'use strict';var _=require(_0x5d80('0x0'));var util=require(_0x5d80('0x1'));var moment=require(_0x5d80('0x2'));var BPromise=require(_0x5d80('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d80('0x4'));var db=require(_0x5d80('0x5'))['db'];var utils=require(_0x5d80('0x6'));var logger=require(_0x5d80('0x7'))('rpc');var config=require(_0x5d80('0x8'));var jayson=require(_0x5d80('0x9'));var client=jayson[_0x5d80('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d602a,_0x54f0f8,_0x2e8937){return new BPromise(function(_0x421504,_0x5c9707){return client['request'](_0x1d602a,_0x2e8937)[_0x5d80('0xb')](function(_0x3d8018){logger[_0x5d80('0xc')](_0x5d80('0xd'),_0x54f0f8,_0x5d80('0xe'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x54f0f8,_0x5d80('0xe'),JSON[_0x5d80('0xf')](_0x3d8018));if(_0x3d8018[_0x5d80('0x10')]){if(_0x3d8018[_0x5d80('0x10')]['code']===0x1f4){logger[_0x5d80('0x10')](_0x5d80('0xd'),_0x54f0f8,_0x3d8018['error']['message']);return _0x5c9707(_0x3d8018[_0x5d80('0x10')]['message']);}logger[_0x5d80('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x54f0f8,_0x3d8018[_0x5d80('0x10')][_0x5d80('0x11')]);return _0x421504(_0x3d8018[_0x5d80('0x10')][_0x5d80('0x11')]);}else{logger['info'](_0x5d80('0xd'),_0x54f0f8,_0x5d80('0xe'));_0x421504(_0x3d8018[_0x5d80('0x12')][_0x5d80('0x11')]);}})['catch'](function(_0x656719){logger[_0x5d80('0x10')](_0x5d80('0xd'),_0x54f0f8,_0x656719);_0x5c9707(_0x656719);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index b5d300c..e8aca44 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 _0x61be=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x61be,0x1d7));var _0xe61b=function(_0x53f1de,_0x37d8d3){_0x53f1de=_0x53f1de-0x0;var _0x2fa505=_0x61be[_0x53f1de];return _0x2fa505;};'use strict';var multer=require(_0xe61b('0x0'));var util=require(_0xe61b('0x1'));var path=require(_0xe61b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe61b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe61b('0x4'));var config=require(_0xe61b('0x5'));var controller=require(_0xe61b('0x6'));router[_0xe61b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe61b('0x7')]('/:id',auth[_0xe61b('0x8')](),controller['show']);router['get'](_0xe61b('0x9'),auth[_0xe61b('0x8')](),controller[_0xe61b('0xa')]);router[_0xe61b('0x7')](_0xe61b('0xb'),auth[_0xe61b('0x8')](),controller[_0xe61b('0xc')]);router[_0xe61b('0xd')]('/',auth['isAuthenticated'](),controller[_0xe61b('0xe')]);router[_0xe61b('0xd')](_0xe61b('0x9'),auth[_0xe61b('0x8')](),controller[_0xe61b('0xf')]);router[_0xe61b('0x10')](_0xe61b('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xe61b('0x12')](_0xe61b('0x11'),auth[_0xe61b('0x8')](),controller['destroy']);module[_0xe61b('0x13')]=router; \ No newline at end of file +var _0xcf84=['/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xcf84,0x175));var _0x4cf8=function(_0x447338,_0x31ddb3){_0x447338=_0x447338-0x0;var _0x5e4ffd=_0xcf84[_0x447338];return _0x5e4ffd;};'use strict';var multer=require(_0x4cf8('0x0'));var util=require(_0x4cf8('0x1'));var path=require(_0x4cf8('0x2'));var timeout=require(_0x4cf8('0x3'));var express=require(_0x4cf8('0x4'));var router=express[_0x4cf8('0x5')]();var fs_extra=require(_0x4cf8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4cf8('0x7'));var config=require('../../config/environment');var controller=require(_0x4cf8('0x8'));router[_0x4cf8('0x9')]('/',auth[_0x4cf8('0xa')](),controller['index']);router['get'](_0x4cf8('0xb'),auth[_0x4cf8('0xa')](),controller['show']);router[_0x4cf8('0x9')](_0x4cf8('0xc'),auth[_0x4cf8('0xa')](),controller[_0x4cf8('0xd')]);router[_0x4cf8('0x9')](_0x4cf8('0xe'),auth[_0x4cf8('0xa')](),controller[_0x4cf8('0xf')]);router[_0x4cf8('0x10')]('/',auth['isAuthenticated'](),controller[_0x4cf8('0x11')]);router[_0x4cf8('0x10')](_0x4cf8('0xc'),auth[_0x4cf8('0xa')](),controller[_0x4cf8('0x12')]);router[_0x4cf8('0x13')](_0x4cf8('0xb'),auth[_0x4cf8('0xa')](),controller[_0x4cf8('0x14')]);router[_0x4cf8('0x15')](_0x4cf8('0xb'),auth['isAuthenticated'](),controller[_0x4cf8('0x16')]);module[_0x4cf8('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 0937bbd..4e12d49 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 _0xd848=['STRING','HelpDesk','sequelize','exports'];(function(_0x1f7dc1,_0x577c15){var _0x2d5895=function(_0x4bb517){while(--_0x4bb517){_0x1f7dc1['push'](_0x1f7dc1['shift']());}};_0x2d5895(++_0x577c15);}(_0xd848,0x132));var _0x8d84=function(_0x248a43,_0x59e52a){_0x248a43=_0x248a43-0x0;var _0x451379=_0xd848[_0x248a43];return _0x451379;};'use strict';var Sequelize=require(_0x8d84('0x0'));module[_0x8d84('0x1')]={'name':{'type':Sequelize[_0x8d84('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8d84('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8d84('0x2')],'allowNull':![],'defaultValue':_0x8d84('0x3')},'remoteUri':{'type':Sequelize[_0x8d84('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8d84('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8d84('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xae01=['sequelize','exports','STRING'];(function(_0x23bca9,_0x590fef){var _0x5eb135=function(_0x5e2e39){while(--_0x5e2e39){_0x23bca9['push'](_0x23bca9['shift']());}};_0x5eb135(++_0x590fef);}(_0xae01,0x1bc));var _0x1ae0=function(_0x38a66f,_0x2f4b6c){_0x38a66f=_0x38a66f-0x0;var _0x59b25a=_0xae01[_0x38a66f];return _0x59b25a;};'use strict';var Sequelize=require(_0x1ae0('0x0'));module[_0x1ae0('0x1')]={'name':{'type':Sequelize[_0x1ae0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1ae0('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1ae0('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x1ae0('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1ae0('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x1ae0('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 6e62e9a..4ed215a 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 _0xdd00=['query','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','filter','catch','show','includeAll','include','options','body','params','find','getConfigurations','findOne','VtigerConfiguration','nolimit','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','create','VtigerField','Subjects','md5','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','login','result','token','GET','describe','sessionName','reference','remove','editable','false','label','cf_','picklist','picklistValues','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','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','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','map','VtigerAccount','rawAttributes','fieldName','type','model','keys','filters','intersection'];(function(_0x4a6102,_0xedf422){var _0x416650=function(_0x4be9ec){while(--_0x4be9ec){_0x4a6102['push'](_0x4a6102['shift']());}};_0x416650(++_0xedf422);}(_0xdd00,0x12c));var _0x0dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd00[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0dd0('0x0'));var rimraf=require(_0x0dd0('0x1'));var zipdir=require(_0x0dd0('0x2'));var jsonpatch=require(_0x0dd0('0x3'));var rp=require(_0x0dd0('0x4'));var moment=require(_0x0dd0('0x5'));var BPromise=require(_0x0dd0('0x6'));var Mustache=require(_0x0dd0('0x7'));var util=require(_0x0dd0('0x8'));var path=require('path');var sox=require(_0x0dd0('0x9'));var csv=require(_0x0dd0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0dd0('0xb'));var _=require(_0x0dd0('0xc'));var squel=require('squel');var crypto=require(_0x0dd0('0xd'));var jsforce=require(_0x0dd0('0xe'));var deskjs=require(_0x0dd0('0xf'));var toCsv=require(_0x0dd0('0xa'));var querystring=require(_0x0dd0('0x10'));var Papa=require(_0x0dd0('0x11'));var Redis=require(_0x0dd0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0dd0('0x13'));var as=require(_0x0dd0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0dd0('0x15'))('api');var utils=require(_0x0dd0('0x16'));var config=require(_0x0dd0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0dd0('0x18'))['db'];var integrations=require(_0x0dd0('0x19'));function respondWithStatusCode(_0xf51be7,_0xed2d8a){_0xed2d8a=_0xed2d8a||0xcc;return function(_0x127789){if(_0x127789){return _0xf51be7[_0x0dd0('0x1a')](_0xed2d8a);}return _0xf51be7[_0x0dd0('0x1b')](_0xed2d8a)[_0x0dd0('0x1c')]();};}function respondWithResult(_0x1e3eb4,_0x1df5cb){_0x1df5cb=_0x1df5cb||0xc8;return function(_0x167381){if(_0x167381){return _0x1e3eb4[_0x0dd0('0x1b')](_0x1df5cb)['json'](_0x167381);}};}function respondWithFilteredResult(_0x2916f1,_0x3744e1){return function(_0x581088){if(_0x581088){var _0x15c89e=typeof _0x3744e1[_0x0dd0('0x1d')]==='undefined'&&typeof _0x3744e1[_0x0dd0('0x1e')]===_0x0dd0('0x1f');var _0x4db918=_0x581088[_0x0dd0('0x20')];var _0x510446=_0x15c89e?0x0:_0x3744e1[_0x0dd0('0x1d')];var _0x2507ba=_0x15c89e?_0x581088[_0x0dd0('0x20')]:_0x3744e1[_0x0dd0('0x1d')]+_0x3744e1[_0x0dd0('0x1e')];var _0x5c0c1e;if(_0x2507ba>=_0x4db918){_0x2507ba=_0x4db918;_0x5c0c1e=0xc8;}else{_0x5c0c1e=0xce;}_0x2916f1['status'](_0x5c0c1e);return _0x2916f1[_0x0dd0('0x21')](_0x0dd0('0x22'),_0x510446+'-'+_0x2507ba+'/'+_0x4db918)[_0x0dd0('0x23')](_0x581088);}return null;};}function patchUpdates(_0x26db24){return function(_0x10901f){try{jsonpatch[_0x0dd0('0x24')](_0x10901f,_0x26db24,!![]);}catch(_0x160974){return BPromise[_0x0dd0('0x25')](_0x160974);}return _0x10901f[_0x0dd0('0x26')]();};}function saveUpdates(_0x53118d,_0x5a35cf){return function(_0x539fd6){if(_0x539fd6){return _0x539fd6[_0x0dd0('0x27')](_0x53118d)[_0x0dd0('0x28')](function(_0x3d864f){return _0x3d864f;});}return null;};}function removeEntity(_0x2b31be,_0x5a31ea){return function(_0x1d8b83){if(_0x1d8b83){return _0x1d8b83[_0x0dd0('0x29')]()['then'](function(){_0x2b31be[_0x0dd0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cbee8,_0x466a40){return function(_0x1354e5){if(!_0x1354e5){_0x3cbee8[_0x0dd0('0x1a')](0x194);}return _0x1354e5;};}function handleError(_0x1bc3d9,_0x2f2330){_0x2f2330=_0x2f2330||0x1f4;return function(_0x7aeb99){logger[_0x0dd0('0x2a')](_0x7aeb99['stack']);if(_0x7aeb99[_0x0dd0('0x2b')]){delete _0x7aeb99[_0x0dd0('0x2b')];}_0x1bc3d9[_0x0dd0('0x1b')](_0x2f2330)[_0x0dd0('0x2c')](_0x7aeb99);};}exports['index']=function(_0x379a02,_0x469df1){var _0xfee35c={},_0x5f247f={},_0x22d09c={'count':0x0,'rows':[]};var _0x2e4637=_[_0x0dd0('0x2d')](db[_0x0dd0('0x2e')][_0x0dd0('0x2f')],function(_0x130448){return{'name':_0x130448[_0x0dd0('0x30')],'type':_0x130448[_0x0dd0('0x31')]['key']};});_0x5f247f[_0x0dd0('0x32')]=_[_0x0dd0('0x2d')](_0x2e4637,_0x0dd0('0x2b'));_0x5f247f['query']=_[_0x0dd0('0x33')](_0x379a02['query']);_0x5f247f[_0x0dd0('0x34')]=_[_0x0dd0('0x35')](_0x5f247f[_0x0dd0('0x32')],_0x5f247f[_0x0dd0('0x36')]);_0xfee35c[_0x0dd0('0x37')]=_['intersection'](_0x5f247f[_0x0dd0('0x32')],qs[_0x0dd0('0x38')](_0x379a02[_0x0dd0('0x36')]['fields']));_0xfee35c[_0x0dd0('0x37')]=_0xfee35c['attributes'][_0x0dd0('0x39')]?_0xfee35c[_0x0dd0('0x37')]:_0x5f247f[_0x0dd0('0x32')];if(!_0x379a02[_0x0dd0('0x36')][_0x0dd0('0x3a')]('nolimit')){_0xfee35c[_0x0dd0('0x1e')]=qs['limit'](_0x379a02[_0x0dd0('0x36')][_0x0dd0('0x1e')]);_0xfee35c[_0x0dd0('0x1d')]=qs[_0x0dd0('0x1d')](_0x379a02[_0x0dd0('0x36')][_0x0dd0('0x1d')]);}_0xfee35c[_0x0dd0('0x3b')]=qs[_0x0dd0('0x3c')](_0x379a02['query'][_0x0dd0('0x3c')]);_0xfee35c['where']=qs[_0x0dd0('0x34')](_[_0x0dd0('0x3d')](_0x379a02[_0x0dd0('0x36')],_0x5f247f[_0x0dd0('0x34')]),_0x2e4637);if(_0x379a02[_0x0dd0('0x36')]['filter']){_0xfee35c[_0x0dd0('0x3e')]=_[_0x0dd0('0x3f')](_0xfee35c[_0x0dd0('0x3e')],{'$or':_[_0x0dd0('0x2d')](_0x2e4637,function(_0x20d018){if(_0x20d018[_0x0dd0('0x31')]!=='VIRTUAL'){var _0x1d44a9={};_0x1d44a9[_0x20d018[_0x0dd0('0x2b')]]={'$like':'%'+_0x379a02[_0x0dd0('0x36')][_0x0dd0('0x40')]+'%'};return _0x1d44a9;}})});}_0xfee35c=_[_0x0dd0('0x3f')]({},_0xfee35c,_0x379a02['options']);var _0x3df691={'where':_0xfee35c[_0x0dd0('0x3e')]};return db['VtigerAccount']['count'](_0x3df691)[_0x0dd0('0x28')](function(_0x480271){_0x22d09c[_0x0dd0('0x20')]=_0x480271;if(_0x379a02[_0x0dd0('0x36')]['includeAll']){_0xfee35c['include']=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0xfee35c);})[_0x0dd0('0x28')](function(_0x102922){_0x22d09c['rows']=_0x102922;return _0x22d09c;})['then'](respondWithFilteredResult(_0x469df1,_0xfee35c))[_0x0dd0('0x41')](handleError(_0x469df1,null));};exports[_0x0dd0('0x42')]=function(_0x4abbff,_0x270e62){var _0x39ffa0={'raw':![],'where':{'id':_0x4abbff['params']['id']}},_0x346fad={};_0x346fad['model']=_[_0x0dd0('0x33')](db[_0x0dd0('0x2e')][_0x0dd0('0x2f')]);_0x346fad['query']=_['keys'](_0x4abbff['query']);_0x346fad[_0x0dd0('0x34')]=_[_0x0dd0('0x35')](_0x346fad[_0x0dd0('0x32')],_0x346fad[_0x0dd0('0x36')]);_0x39ffa0[_0x0dd0('0x37')]=_[_0x0dd0('0x35')](_0x346fad[_0x0dd0('0x32')],qs[_0x0dd0('0x38')](_0x4abbff[_0x0dd0('0x36')][_0x0dd0('0x38')]));_0x39ffa0['attributes']=_0x39ffa0['attributes'][_0x0dd0('0x39')]?_0x39ffa0[_0x0dd0('0x37')]:_0x346fad[_0x0dd0('0x32')];if(_0x4abbff[_0x0dd0('0x36')][_0x0dd0('0x43')]){_0x39ffa0[_0x0dd0('0x44')]=[{'all':!![]}];}_0x39ffa0=_[_0x0dd0('0x3f')]({},_0x39ffa0,_0x4abbff[_0x0dd0('0x45')]);return db['VtigerAccount']['find'](_0x39ffa0)['then'](handleEntityNotFound(_0x270e62,null))[_0x0dd0('0x28')](respondWithResult(_0x270e62,null))[_0x0dd0('0x41')](handleError(_0x270e62,null));};exports['create']=function(_0x807f7d,_0x46fc04){return db['VtigerAccount']['create'](_0x807f7d[_0x0dd0('0x46')],{})[_0x0dd0('0x28')](respondWithResult(_0x46fc04,0xc9))[_0x0dd0('0x41')](handleError(_0x46fc04,null));};exports[_0x0dd0('0x27')]=function(_0xde0266,_0x569aa3){if(_0xde0266[_0x0dd0('0x46')]['id']){delete _0xde0266[_0x0dd0('0x46')]['id'];}return db[_0x0dd0('0x2e')]['find']({'where':{'id':_0xde0266[_0x0dd0('0x47')]['id']}})[_0x0dd0('0x28')](handleEntityNotFound(_0x569aa3,null))['then'](saveUpdates(_0xde0266['body'],null))[_0x0dd0('0x28')](respondWithResult(_0x569aa3,null))[_0x0dd0('0x41')](handleError(_0x569aa3,null));};exports[_0x0dd0('0x29')]=function(_0x355c1f,_0x5dcbf3){return db['VtigerAccount'][_0x0dd0('0x48')]({'where':{'id':_0x355c1f['params']['id']}})['then'](handleEntityNotFound(_0x5dcbf3,null))['then'](removeEntity(_0x5dcbf3,null))[_0x0dd0('0x41')](handleError(_0x5dcbf3,null));};exports[_0x0dd0('0x49')]=function(_0x5bf4b9,_0xd83d6f,_0x214151){var _0x572364={};var _0xa9ac64={};var _0x4784e8;var _0x43b241;return db[_0x0dd0('0x2e')][_0x0dd0('0x4a')]({'where':{'id':_0x5bf4b9['params']['id']}})[_0x0dd0('0x28')](handleEntityNotFound(_0xd83d6f,null))[_0x0dd0('0x28')](function(_0x49e41b){if(_0x49e41b){_0x4784e8=_0x49e41b;_0xa9ac64[_0x0dd0('0x32')]=_[_0x0dd0('0x33')](db[_0x0dd0('0x4b')]['rawAttributes']);_0xa9ac64[_0x0dd0('0x36')]=_[_0x0dd0('0x33')](_0x5bf4b9[_0x0dd0('0x36')]);_0xa9ac64[_0x0dd0('0x34')]=_['intersection'](_0xa9ac64[_0x0dd0('0x32')],_0xa9ac64[_0x0dd0('0x36')]);_0x572364['attributes']=_[_0x0dd0('0x35')](_0xa9ac64[_0x0dd0('0x32')],qs[_0x0dd0('0x38')](_0x5bf4b9[_0x0dd0('0x36')][_0x0dd0('0x38')]));_0x572364[_0x0dd0('0x37')]=_0x572364[_0x0dd0('0x37')][_0x0dd0('0x39')]?_0x572364[_0x0dd0('0x37')]:_0xa9ac64['model'];_0x572364[_0x0dd0('0x3b')]=qs[_0x0dd0('0x3c')](_0x5bf4b9[_0x0dd0('0x36')]['sort']);_0x572364[_0x0dd0('0x3e')]=qs[_0x0dd0('0x34')](_['pick'](_0x5bf4b9[_0x0dd0('0x36')],_0xa9ac64[_0x0dd0('0x34')]));if(_0x5bf4b9['query']['filter']){_0x572364['where']=_[_0x0dd0('0x3f')](_0x572364[_0x0dd0('0x3e')],{'$or':_[_0x0dd0('0x2d')](_0x572364[_0x0dd0('0x37')],function(_0xa40b34){var _0x52a9dd={};_0x52a9dd[_0xa40b34]={'$like':'%'+_0x5bf4b9['query'][_0x0dd0('0x40')]+'%'};return _0x52a9dd;})});}_0x572364=_[_0x0dd0('0x3f')]({},_0x572364,_0x5bf4b9[_0x0dd0('0x45')]);return _0x4784e8[_0x0dd0('0x49')](_0x572364);}})[_0x0dd0('0x28')](function(_0x3fbcd0){if(_0x3fbcd0){_0x43b241=_0x3fbcd0[_0x0dd0('0x39')];if(!_0x5bf4b9[_0x0dd0('0x36')][_0x0dd0('0x3a')](_0x0dd0('0x4c'))){_0x572364[_0x0dd0('0x1e')]=qs[_0x0dd0('0x1e')](_0x5bf4b9[_0x0dd0('0x36')][_0x0dd0('0x1e')]);_0x572364[_0x0dd0('0x1d')]=qs[_0x0dd0('0x1d')](_0x5bf4b9[_0x0dd0('0x36')][_0x0dd0('0x1d')]);}return _0x4784e8[_0x0dd0('0x49')](_0x572364);}})[_0x0dd0('0x28')](function(_0x5592c7){if(_0x5592c7){return _0x5592c7?{'count':_0x43b241,'rows':_0x5592c7}:null;}})[_0x0dd0('0x28')](respondWithResult(_0xd83d6f,null))[_0x0dd0('0x41')](handleError(_0xd83d6f,null));};exports[_0x0dd0('0x4d')]=function(_0x305e62,_0xd9d0ce,_0x30271e){if(_0x305e62['body']['id']){delete _0x305e62[_0x0dd0('0x46')]['id'];}return db[_0x0dd0('0x2e')][_0x0dd0('0x4a')]({'where':{'id':_0x305e62[_0x0dd0('0x47')]['id']}})[_0x0dd0('0x28')](handleEntityNotFound(_0xd9d0ce,null))[_0x0dd0('0x28')](function(_0x2a1f2f){if(_0x2a1f2f){_0x305e62['body']['AccountId']=_0x2a1f2f['id'];_0x305e62[_0x0dd0('0x46')]['Subjects']=integrations[_0x0dd0('0x4e')](_0x305e62[_0x0dd0('0x46')][_0x0dd0('0x4f')],_0x305e62[_0x0dd0('0x46')][_0x0dd0('0x31')]);_0x305e62['body'][_0x0dd0('0x50')]=integrations[_0x0dd0('0x51')](_0x305e62[_0x0dd0('0x46')]['channel'],_0x305e62[_0x0dd0('0x46')][_0x0dd0('0x31')]);return db[_0x0dd0('0x4b')][_0x0dd0('0x52')](_0x305e62[_0x0dd0('0x46')],{'include':[{'model':db[_0x0dd0('0x53')],'as':_0x0dd0('0x54')},{'model':db[_0x0dd0('0x53')],'as':'Descriptions'}]});}return null;})[_0x0dd0('0x28')](respondWithResult(_0xd9d0ce,null))['catch'](handleError(_0xd9d0ce,null));};var md5=require(_0x0dd0('0x55'));exports['getFields']=function(_0x345204,_0x38da9d,_0x237883){var _0x28f271=null;var _0x3cd61b=null;var _0x3bba23=null;var _0x33e027=null;var _0x5413ab='';return db[_0x0dd0('0x2e')][_0x0dd0('0x4a')]({'where':{'id':_0x345204[_0x0dd0('0x47')]['id']},'attributes':['id',_0x0dd0('0x2b'),_0x0dd0('0x56'),_0x0dd0('0x57'),_0x0dd0('0x58'),'remoteUri',_0x0dd0('0x59'),_0x0dd0('0x5a')]})[_0x0dd0('0x28')](handleEntityNotFound(_0x38da9d,null))['then'](function(_0x5bd448){if(_0x5bd448){_0x28f271=_0x5bd448['username'];_0x3cd61b=_0x5bd448['accessKey'];_0x3bba23=_0x5bd448[_0x0dd0('0x58')];_0x5413ab=_0x5bd448[_0x0dd0('0x5b')];var _0x2bf87d=_0x5413ab[_0x0dd0('0x5c')](-0x1);if(_0x2bf87d==='/'){_0x5413ab=_0x5413ab[_0x0dd0('0x5d')](0x0,_0x5413ab[_0x0dd0('0x5e')](_0x2bf87d));}_0x33e027=util[_0x0dd0('0x5f')](_0x0dd0('0x60'),_0x5413ab);var _0x5bf9a4={'method':'GET','uri':_0x33e027,'qs':{'operation':_0x0dd0('0x61'),'username':_0x5bd448[_0x0dd0('0x56')]},'json':!![]};return rp(_0x5bf9a4);}})[_0x0dd0('0x28')](function(_0xfe19d7){if(_0xfe19d7[_0x0dd0('0x62')]){var _0x24a3cc={'method':'POST','uri':_0x33e027,'form':{'operation':_0x0dd0('0x63'),'username':_0x28f271,'accessKey':md5(_0xfe19d7[_0x0dd0('0x64')][_0x0dd0('0x65')]+_0x3cd61b)},'json':!![]};return rp(_0x24a3cc);}})[_0x0dd0('0x28')](function(_0x31586d){if(_0x31586d[_0x0dd0('0x62')]){var _0x1b25ff={'method':_0x0dd0('0x66'),'uri':_0x33e027,'qs':{'operation':_0x0dd0('0x67'),'username':_0x28f271,'sessionName':_0x31586d['result'][_0x0dd0('0x68')],'elementType':_0x3bba23},'json':!![]};return rp(_0x1b25ff);}})[_0x0dd0('0x28')](function(_0x5277f2){if(_0x5277f2['success']){var _0x5db876=['autogenerated',_0x0dd0('0x69'),'owner'];_['remove'](_0x5277f2[_0x0dd0('0x64')]['fields'],function(_0x4345b9){return _0x5db876['includes'](_0x4345b9[_0x0dd0('0x31')][_0x0dd0('0x2b')]);});_[_0x0dd0('0x6a')](_0x5277f2[_0x0dd0('0x64')][_0x0dd0('0x38')],function(_0x13156b){return _0x13156b[_0x0dd0('0x6b')]===_0x0dd0('0x6c');});return{'count':_0x5277f2[_0x0dd0('0x64')]['fields'][_0x0dd0('0x39')],'rows':_['map'](_0x5277f2['result'][_0x0dd0('0x38')],function(_0x2641a3){return{'id':_0x2641a3[_0x0dd0('0x2b')],'name':_0x2641a3[_0x0dd0('0x6d')],'custom':_['startsWith'](_0x2641a3[_0x0dd0('0x2b')],_0x0dd0('0x6e'))?!![]:![],'options':_0x2641a3[_0x0dd0('0x31')]['name']===_0x0dd0('0x6f')&&_0x2641a3[_0x0dd0('0x31')][_0x0dd0('0x70')][_0x0dd0('0x39')]>0x0?_[_0x0dd0('0x2d')](_0x2641a3[_0x0dd0('0x31')]['picklistValues'],function(_0x4cd95a){return{'name':_0x4cd95a[_0x0dd0('0x6d')],'value':_0x4cd95a['value']};}):[]};})};}})[_0x0dd0('0x28')](respondWithResult(_0x38da9d,null))['catch'](function(_0x173590){console['log'](_0x0dd0('0x71')+_0x173590);var _0x5bf1ac=_0x345204[_0x0dd0('0x36')][_0x0dd0('0x72')]?0x1f4:_0x173590[_0x0dd0('0x73')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5bf1ac,JSON[_0x0dd0('0x74')](_0x173590));delete _0x173590[_0x0dd0('0x2b')];if(_0x5bf1ac===0x191){_0x5bf1ac=0x190;}_0x38da9d[_0x0dd0('0x1b')](_0x5bf1ac)['send'](_0x345204['query'][_0x0dd0('0x72')]?{'message':_0x0dd0('0x75'),'statusCode':_0x173590[_0x0dd0('0x73')]}:_0x173590);});}; \ No newline at end of file +var _0xfec7=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','count','limit','Content-Range','apply','reject','update','then','name','send','map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','merge','options','find','create','body','destroy','findOne','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions','VtigerConfiguration','VtigerField','Descriptions','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','GET','getchallenge','success','result','describe','sessionName','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0x117d7f,_0x59b132){var _0x3481cc=function(_0x231315){while(--_0x231315){_0x117d7f['push'](_0x117d7f['shift']());}};_0x3481cc(++_0x59b132);}(_0xfec7,0x1b0));var _0x7fec=function(_0x2da2a7,_0x4ce051){_0x2da2a7=_0x2da2a7-0x0;var _0x336366=_0xfec7[_0x2da2a7];return _0x336366;};'use strict';var emlformat=require(_0x7fec('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(_0x7fec('0x1'));var Mustache=require(_0x7fec('0x2'));var util=require(_0x7fec('0x3'));var path=require(_0x7fec('0x4'));var sox=require('sox');var csv=require(_0x7fec('0x5'));var ejs=require(_0x7fec('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fec('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7fec('0x8'));var deskjs=require(_0x7fec('0x9'));var toCsv=require(_0x7fec('0x5'));var querystring=require(_0x7fec('0xa'));var Papa=require(_0x7fec('0xb'));var Redis=require(_0x7fec('0xc'));var authService=require(_0x7fec('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7fec('0xe'));var logger=require(_0x7fec('0xf'))('api');var utils=require(_0x7fec('0x10'));var config=require(_0x7fec('0x11'));var licenseUtil=require(_0x7fec('0x12'));var db=require(_0x7fec('0x13'))['db'];var integrations=require(_0x7fec('0x14'));function respondWithStatusCode(_0x14714c,_0x160538){_0x160538=_0x160538||0xcc;return function(_0x137925){if(_0x137925){return _0x14714c[_0x7fec('0x15')](_0x160538);}return _0x14714c[_0x7fec('0x16')](_0x160538)[_0x7fec('0x17')]();};}function respondWithResult(_0x464615,_0x36fbc6){_0x36fbc6=_0x36fbc6||0xc8;return function(_0x1aeebc){if(_0x1aeebc){return _0x464615[_0x7fec('0x16')](_0x36fbc6)[_0x7fec('0x18')](_0x1aeebc);}};}function respondWithFilteredResult(_0x133472,_0x47e4dd){return function(_0x4bcde7){if(_0x4bcde7){var _0x468a49=typeof _0x47e4dd[_0x7fec('0x19')]==='undefined'&&typeof _0x47e4dd['limit']==='undefined';var _0x5743d7=_0x4bcde7['count'];var _0x4719c6=_0x468a49?0x0:_0x47e4dd[_0x7fec('0x19')];var _0x31fd2e=_0x468a49?_0x4bcde7[_0x7fec('0x1a')]:_0x47e4dd[_0x7fec('0x19')]+_0x47e4dd[_0x7fec('0x1b')];var _0x1b1ac6;if(_0x31fd2e>=_0x5743d7){_0x31fd2e=_0x5743d7;_0x1b1ac6=0xc8;}else{_0x1b1ac6=0xce;}_0x133472[_0x7fec('0x16')](_0x1b1ac6);return _0x133472['set'](_0x7fec('0x1c'),_0x4719c6+'-'+_0x31fd2e+'/'+_0x5743d7)['json'](_0x4bcde7);}return null;};}function patchUpdates(_0x5910e6){return function(_0x56a169){try{jsonpatch[_0x7fec('0x1d')](_0x56a169,_0x5910e6,!![]);}catch(_0x401a8a){return BPromise[_0x7fec('0x1e')](_0x401a8a);}return _0x56a169['save']();};}function saveUpdates(_0x497949,_0xb1fc1c){return function(_0x4a2440){if(_0x4a2440){return _0x4a2440[_0x7fec('0x1f')](_0x497949)[_0x7fec('0x20')](function(_0x308974){return _0x308974;});}return null;};}function removeEntity(_0x310cf6,_0xff98f4){return function(_0x3a24c2){if(_0x3a24c2){return _0x3a24c2['destroy']()[_0x7fec('0x20')](function(){_0x310cf6[_0x7fec('0x16')](0xcc)[_0x7fec('0x17')]();});}};}function handleEntityNotFound(_0x40b0cd,_0x5f3183){return function(_0x13b575){if(!_0x13b575){_0x40b0cd[_0x7fec('0x15')](0x194);}return _0x13b575;};}function handleError(_0x4673c7,_0xbcd6d9){_0xbcd6d9=_0xbcd6d9||0x1f4;return function(_0x48a22c){logger['error'](_0x48a22c['stack']);if(_0x48a22c[_0x7fec('0x21')]){delete _0x48a22c['name'];}_0x4673c7['status'](_0xbcd6d9)[_0x7fec('0x22')](_0x48a22c);};}exports['index']=function(_0x2e4b4d,_0x28e77e){var _0x3690bf={},_0x336490={},_0x1800d8={'count':0x0,'rows':[]};var _0x2dfab5=_[_0x7fec('0x23')](db[_0x7fec('0x24')][_0x7fec('0x25')],function(_0x3b4793){return{'name':_0x3b4793[_0x7fec('0x26')],'type':_0x3b4793['type'][_0x7fec('0x27')]};});_0x336490[_0x7fec('0x28')]=_[_0x7fec('0x23')](_0x2dfab5,_0x7fec('0x21'));_0x336490[_0x7fec('0x29')]=_[_0x7fec('0x2a')](_0x2e4b4d['query']);_0x336490[_0x7fec('0x2b')]=_[_0x7fec('0x2c')](_0x336490[_0x7fec('0x28')],_0x336490[_0x7fec('0x29')]);_0x3690bf[_0x7fec('0x2d')]=_[_0x7fec('0x2c')](_0x336490[_0x7fec('0x28')],qs[_0x7fec('0x2e')](_0x2e4b4d[_0x7fec('0x29')]['fields']));_0x3690bf[_0x7fec('0x2d')]=_0x3690bf[_0x7fec('0x2d')]['length']?_0x3690bf[_0x7fec('0x2d')]:_0x336490[_0x7fec('0x28')];if(!_0x2e4b4d[_0x7fec('0x29')]['hasOwnProperty'](_0x7fec('0x2f'))){_0x3690bf[_0x7fec('0x1b')]=qs['limit'](_0x2e4b4d[_0x7fec('0x29')][_0x7fec('0x1b')]);_0x3690bf[_0x7fec('0x19')]=qs[_0x7fec('0x19')](_0x2e4b4d[_0x7fec('0x29')]['offset']);}_0x3690bf[_0x7fec('0x30')]=qs[_0x7fec('0x31')](_0x2e4b4d['query']['sort']);_0x3690bf[_0x7fec('0x32')]=qs[_0x7fec('0x2b')](_[_0x7fec('0x33')](_0x2e4b4d['query'],_0x336490[_0x7fec('0x2b')]),_0x2dfab5);if(_0x2e4b4d[_0x7fec('0x29')][_0x7fec('0x34')]){_0x3690bf[_0x7fec('0x32')]=_['merge'](_0x3690bf[_0x7fec('0x32')],{'$or':_['map'](_0x2dfab5,function(_0x171593){if(_0x171593[_0x7fec('0x35')]!==_0x7fec('0x36')){var _0x4de6e4={};_0x4de6e4[_0x171593[_0x7fec('0x21')]]={'$like':'%'+_0x2e4b4d[_0x7fec('0x29')]['filter']+'%'};return _0x4de6e4;}})});}_0x3690bf=_['merge']({},_0x3690bf,_0x2e4b4d['options']);var _0x51924e={'where':_0x3690bf[_0x7fec('0x32')]};return db[_0x7fec('0x24')][_0x7fec('0x1a')](_0x51924e)[_0x7fec('0x20')](function(_0x29a0be){_0x1800d8['count']=_0x29a0be;if(_0x2e4b4d[_0x7fec('0x29')][_0x7fec('0x37')]){_0x3690bf[_0x7fec('0x38')]=[{'all':!![]}];}return db['VtigerAccount'][_0x7fec('0x39')](_0x3690bf);})[_0x7fec('0x20')](function(_0x13e994){_0x1800d8[_0x7fec('0x3a')]=_0x13e994;return _0x1800d8;})['then'](respondWithFilteredResult(_0x28e77e,_0x3690bf))[_0x7fec('0x3b')](handleError(_0x28e77e,null));};exports['show']=function(_0x3f5690,_0x1bdeef){var _0x5563aa={'raw':![],'where':{'id':_0x3f5690[_0x7fec('0x3c')]['id']}},_0x2938f6={};_0x2938f6[_0x7fec('0x28')]=_['keys'](db[_0x7fec('0x24')][_0x7fec('0x25')]);_0x2938f6[_0x7fec('0x29')]=_[_0x7fec('0x2a')](_0x3f5690[_0x7fec('0x29')]);_0x2938f6[_0x7fec('0x2b')]=_[_0x7fec('0x2c')](_0x2938f6[_0x7fec('0x28')],_0x2938f6[_0x7fec('0x29')]);_0x5563aa[_0x7fec('0x2d')]=_[_0x7fec('0x2c')](_0x2938f6[_0x7fec('0x28')],qs[_0x7fec('0x2e')](_0x3f5690[_0x7fec('0x29')][_0x7fec('0x2e')]));_0x5563aa[_0x7fec('0x2d')]=_0x5563aa['attributes'][_0x7fec('0x3d')]?_0x5563aa[_0x7fec('0x2d')]:_0x2938f6[_0x7fec('0x28')];if(_0x3f5690[_0x7fec('0x29')][_0x7fec('0x37')]){_0x5563aa['include']=[{'all':!![]}];}_0x5563aa=_[_0x7fec('0x3e')]({},_0x5563aa,_0x3f5690[_0x7fec('0x3f')]);return db['VtigerAccount'][_0x7fec('0x40')](_0x5563aa)['then'](handleEntityNotFound(_0x1bdeef,null))[_0x7fec('0x20')](respondWithResult(_0x1bdeef,null))['catch'](handleError(_0x1bdeef,null));};exports[_0x7fec('0x41')]=function(_0x4358da,_0x232121){return db[_0x7fec('0x24')][_0x7fec('0x41')](_0x4358da[_0x7fec('0x42')],{})[_0x7fec('0x20')](respondWithResult(_0x232121,0xc9))['catch'](handleError(_0x232121,null));};exports[_0x7fec('0x1f')]=function(_0x4f960f,_0x308e8c){if(_0x4f960f[_0x7fec('0x42')]['id']){delete _0x4f960f['body']['id'];}return db[_0x7fec('0x24')][_0x7fec('0x40')]({'where':{'id':_0x4f960f[_0x7fec('0x3c')]['id']}})[_0x7fec('0x20')](handleEntityNotFound(_0x308e8c,null))['then'](saveUpdates(_0x4f960f[_0x7fec('0x42')],null))[_0x7fec('0x20')](respondWithResult(_0x308e8c,null))[_0x7fec('0x3b')](handleError(_0x308e8c,null));};exports[_0x7fec('0x43')]=function(_0x5d675b,_0x24da5b){return db[_0x7fec('0x24')]['find']({'where':{'id':_0x5d675b[_0x7fec('0x3c')]['id']}})['then'](handleEntityNotFound(_0x24da5b,null))['then'](removeEntity(_0x24da5b,null))[_0x7fec('0x3b')](handleError(_0x24da5b,null));};exports['getConfigurations']=function(_0x2b23db,_0x50c02e,_0x58effa){var _0x387f20={};var _0x57b818={};var _0x1e6180;var _0x5078d7;return db[_0x7fec('0x24')][_0x7fec('0x44')]({'where':{'id':_0x2b23db[_0x7fec('0x3c')]['id']}})[_0x7fec('0x20')](handleEntityNotFound(_0x50c02e,null))[_0x7fec('0x20')](function(_0x3dacfa){if(_0x3dacfa){_0x1e6180=_0x3dacfa;_0x57b818['model']=_[_0x7fec('0x2a')](db['VtigerConfiguration'][_0x7fec('0x25')]);_0x57b818[_0x7fec('0x29')]=_[_0x7fec('0x2a')](_0x2b23db[_0x7fec('0x29')]);_0x57b818[_0x7fec('0x2b')]=_[_0x7fec('0x2c')](_0x57b818[_0x7fec('0x28')],_0x57b818[_0x7fec('0x29')]);_0x387f20[_0x7fec('0x2d')]=_[_0x7fec('0x2c')](_0x57b818[_0x7fec('0x28')],qs[_0x7fec('0x2e')](_0x2b23db[_0x7fec('0x29')][_0x7fec('0x2e')]));_0x387f20['attributes']=_0x387f20[_0x7fec('0x2d')]['length']?_0x387f20['attributes']:_0x57b818[_0x7fec('0x28')];_0x387f20[_0x7fec('0x30')]=qs[_0x7fec('0x31')](_0x2b23db[_0x7fec('0x29')][_0x7fec('0x31')]);_0x387f20[_0x7fec('0x32')]=qs['filters'](_[_0x7fec('0x33')](_0x2b23db['query'],_0x57b818[_0x7fec('0x2b')]));if(_0x2b23db['query'][_0x7fec('0x34')]){_0x387f20[_0x7fec('0x32')]=_['merge'](_0x387f20['where'],{'$or':_[_0x7fec('0x23')](_0x387f20['attributes'],function(_0x349a3a){var _0x415829={};_0x415829[_0x349a3a]={'$like':'%'+_0x2b23db[_0x7fec('0x29')][_0x7fec('0x34')]+'%'};return _0x415829;})});}_0x387f20=_['merge']({},_0x387f20,_0x2b23db[_0x7fec('0x3f')]);return _0x1e6180[_0x7fec('0x45')](_0x387f20);}})[_0x7fec('0x20')](function(_0x4a26cd){if(_0x4a26cd){_0x5078d7=_0x4a26cd['length'];if(!_0x2b23db['query']['hasOwnProperty'](_0x7fec('0x2f'))){_0x387f20['limit']=qs['limit'](_0x2b23db[_0x7fec('0x29')]['limit']);_0x387f20[_0x7fec('0x19')]=qs[_0x7fec('0x19')](_0x2b23db['query'][_0x7fec('0x19')]);}return _0x1e6180[_0x7fec('0x45')](_0x387f20);}})[_0x7fec('0x20')](function(_0x5dafc5){if(_0x5dafc5){return _0x5dafc5?{'count':_0x5078d7,'rows':_0x5dafc5}:null;}})[_0x7fec('0x20')](respondWithResult(_0x50c02e,null))[_0x7fec('0x3b')](handleError(_0x50c02e,null));};exports[_0x7fec('0x46')]=function(_0x3ef537,_0x343432,_0x97f9c9){if(_0x3ef537[_0x7fec('0x42')]['id']){delete _0x3ef537[_0x7fec('0x42')]['id'];}return db[_0x7fec('0x24')][_0x7fec('0x44')]({'where':{'id':_0x3ef537['params']['id']}})[_0x7fec('0x20')](handleEntityNotFound(_0x343432,null))[_0x7fec('0x20')](function(_0x4f1522){if(_0x4f1522){_0x3ef537[_0x7fec('0x42')][_0x7fec('0x47')]=_0x4f1522['id'];_0x3ef537[_0x7fec('0x42')][_0x7fec('0x48')]=integrations['getSubjects'](_0x3ef537[_0x7fec('0x42')][_0x7fec('0x49')],_0x3ef537[_0x7fec('0x42')]['type']);_0x3ef537[_0x7fec('0x42')]['Descriptions']=integrations[_0x7fec('0x4a')](_0x3ef537['body'][_0x7fec('0x49')],_0x3ef537[_0x7fec('0x42')][_0x7fec('0x35')]);return db[_0x7fec('0x4b')][_0x7fec('0x41')](_0x3ef537['body'],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0x7fec('0x4c')],'as':_0x7fec('0x4d')}]});}return null;})['then'](respondWithResult(_0x343432,null))[_0x7fec('0x3b')](handleError(_0x343432,null));};var md5=require(_0x7fec('0x4e'));exports[_0x7fec('0x4f')]=function(_0x3f1009,_0x4d418c,_0x542ce5){var _0x45909e=null;var _0x4616ae=null;var _0x56a5de=null;var _0x112767=null;var _0x19d6a1='';return db[_0x7fec('0x24')][_0x7fec('0x44')]({'where':{'id':_0x3f1009['params']['id']},'attributes':['id',_0x7fec('0x21'),_0x7fec('0x50'),_0x7fec('0x51'),_0x7fec('0x52'),_0x7fec('0x53'),_0x7fec('0x54'),_0x7fec('0x55')]})[_0x7fec('0x20')](handleEntityNotFound(_0x4d418c,null))[_0x7fec('0x20')](function(_0x11d20d){if(_0x11d20d){_0x45909e=_0x11d20d['username'];_0x4616ae=_0x11d20d[_0x7fec('0x55')];_0x56a5de=_0x11d20d['moduleName'];_0x19d6a1=_0x11d20d[_0x7fec('0x53')];var _0x48887a=_0x19d6a1['slice'](-0x1);if(_0x48887a==='/'){_0x19d6a1=_0x19d6a1[_0x7fec('0x56')](0x0,_0x19d6a1[_0x7fec('0x57')](_0x48887a));}_0x112767=util[_0x7fec('0x58')]('%s/webservice.php',_0x19d6a1);var _0x507bc2={'method':_0x7fec('0x59'),'uri':_0x112767,'qs':{'operation':_0x7fec('0x5a'),'username':_0x11d20d[_0x7fec('0x50')]},'json':!![]};return rp(_0x507bc2);}})[_0x7fec('0x20')](function(_0x4eb265){if(_0x4eb265[_0x7fec('0x5b')]){var _0x2fa074={'method':'POST','uri':_0x112767,'form':{'operation':'login','username':_0x45909e,'accessKey':md5(_0x4eb265[_0x7fec('0x5c')]['token']+_0x4616ae)},'json':!![]};return rp(_0x2fa074);}})[_0x7fec('0x20')](function(_0x51fe20){if(_0x51fe20['success']){var _0x93c12e={'method':'GET','uri':_0x112767,'qs':{'operation':_0x7fec('0x5d'),'username':_0x45909e,'sessionName':_0x51fe20['result'][_0x7fec('0x5e')],'elementType':_0x56a5de},'json':!![]};return rp(_0x93c12e);}})['then'](function(_0x6eaadd){if(_0x6eaadd[_0x7fec('0x5b')]){var _0x4c150d=['autogenerated','reference','owner'];_[_0x7fec('0x5f')](_0x6eaadd[_0x7fec('0x5c')][_0x7fec('0x2e')],function(_0x4c0d8c){return _0x4c150d[_0x7fec('0x60')](_0x4c0d8c[_0x7fec('0x35')][_0x7fec('0x21')]);});_[_0x7fec('0x5f')](_0x6eaadd[_0x7fec('0x5c')]['fields'],function(_0x5290cf){return _0x5290cf[_0x7fec('0x61')]===_0x7fec('0x62');});return{'count':_0x6eaadd['result'][_0x7fec('0x2e')][_0x7fec('0x3d')],'rows':_[_0x7fec('0x23')](_0x6eaadd['result'][_0x7fec('0x2e')],function(_0xb460e9){return{'id':_0xb460e9[_0x7fec('0x21')],'name':_0xb460e9[_0x7fec('0x63')],'custom':_[_0x7fec('0x64')](_0xb460e9[_0x7fec('0x21')],_0x7fec('0x65'))?!![]:![],'options':_0xb460e9[_0x7fec('0x35')]['name']===_0x7fec('0x66')&&_0xb460e9[_0x7fec('0x35')][_0x7fec('0x67')][_0x7fec('0x3d')]>0x0?_['map'](_0xb460e9[_0x7fec('0x35')]['picklistValues'],function(_0x376831){return{'name':_0x376831[_0x7fec('0x63')],'value':_0x376831['value']};}):[]};})};}})['then'](respondWithResult(_0x4d418c,null))[_0x7fec('0x3b')](function(_0x40c68e){console[_0x7fec('0x68')](_0x7fec('0x69')+_0x40c68e);var _0x52e5d0=_0x3f1009[_0x7fec('0x29')][_0x7fec('0x6a')]?0x1f4:_0x40c68e[_0x7fec('0x6b')]||0x1f4;logger[_0x7fec('0x6c')](_0x7fec('0x6d'),_0x7fec('0x4f'),_0x52e5d0,JSON[_0x7fec('0x6e')](_0x40c68e));delete _0x40c68e[_0x7fec('0x21')];if(_0x52e5d0===0x191){_0x52e5d0=0x190;}_0x4d418c[_0x7fec('0x16')](_0x52e5d0)[_0x7fec('0x22')](_0x3f1009[_0x7fec('0x29')][_0x7fec('0x6a')]?{'message':_0x7fec('0x6f'),'statusCode':_0x40c68e[_0x7fec('0x6b')]}:_0x40c68e);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index e885e44..62f18af 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 _0x91cf=['../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerAccount.attributes'];(function(_0x197e06,_0x42c950){var _0xdff668=function(_0x21e7ec){while(--_0x21e7ec){_0x197e06['push'](_0x197e06['shift']());}};_0xdff668(++_0x42c950);}(_0x91cf,0x10c));var _0xf91c=function(_0x5de889,_0x115fc4){_0x5de889=_0x5de889-0x0;var _0x549a4f=_0x91cf[_0x5de889];return _0x549a4f;};'use strict';var _=require(_0xf91c('0x0'));var util=require('util');var logger=require(_0xf91c('0x1'))(_0xf91c('0x2'));var moment=require(_0xf91c('0x3'));var BPromise=require(_0xf91c('0x4'));var rp=require(_0xf91c('0x5'));var fs=require('fs');var path=require(_0xf91c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf91c('0x7'));var integrations=require(_0xf91c('0x8'));module[_0xf91c('0x9')]=function(_0x155ae4,_0x5ef39){return _0x155ae4[_0xf91c('0xa')]('VtigerAccount',attributes,{'tableName':_0xf91c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf687=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','util','../../config/logger','api','bluebird'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xf687,0x8c));var _0x7f68=function(_0x5448a2,_0x2b48d2){_0x5448a2=_0x5448a2-0x0;var _0x2ecc64=_0xf687[_0x5448a2];return _0x2ecc64;};'use strict';var _=require('lodash');var util=require(_0x7f68('0x0'));var logger=require(_0x7f68('0x1'))(_0x7f68('0x2'));var moment=require('moment');var BPromise=require(_0x7f68('0x3'));var rp=require(_0x7f68('0x4'));var fs=require('fs');var path=require(_0x7f68('0x5'));var rimraf=require(_0x7f68('0x6'));var config=require(_0x7f68('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x7f68('0x8'));module[_0x7f68('0x9')]=function(_0x47ed70,_0x2c3083){return _0x47ed70[_0x7f68('0xa')](_0x7f68('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 2a493df..41d294d 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 _0x0565=['request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','code','message','error','GetVtigerAccount','options','raw','where','attributes','limit','map','model','include','debug','catch','ShowVtigerAccount','VtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x3a2d40,_0x113c80){var _0x3fb2d=function(_0x4d0ce1){while(--_0x4d0ce1){_0x3a2d40['push'](_0x3a2d40['shift']());}};_0x3fb2d(++_0x113c80);}(_0x0565,0xf2));var _0x5056=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0565[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var moment=require(_0x5056('0x2'));var BPromise=require(_0x5056('0x3'));var rs=require(_0x5056('0x4'));var fs=require('fs');var Redis=require(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var utils=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var config=require('../../config/environment');var jayson=require(_0x5056('0xa'));var client=jayson[_0x5056('0xb')][_0x5056('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22afb7,_0x4b8280,_0x52b01f){return new BPromise(function(_0x38f74,_0x223c92){return client[_0x5056('0xd')](_0x22afb7,_0x52b01f)[_0x5056('0xe')](function(_0x2144a9){logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));logger['debug'](_0x5056('0x12'),_0x4b8280,_0x5056('0x11'),JSON[_0x5056('0x13')](_0x2144a9));if(_0x2144a9['error']){if(_0x2144a9['error'][_0x5056('0x14')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x223c92(_0x2144a9['error'][_0x5056('0x15')]);}logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x38f74(_0x2144a9[_0x5056('0x16')][_0x5056('0x15')]);}else{logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));_0x38f74(_0x2144a9['result'][_0x5056('0x15')]);}})['catch'](function(_0x43db77){logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x43db77);_0x223c92(_0x43db77);});});}exports[_0x5056('0x17')]=function(_0x4056ce){var _0x51b21e=this;return new Promise(function(_0x9ea88,_0x56537e){return db['VtigerAccount']['findAll']({'raw':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'where':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0x4056ce[_0x5056('0x18')]?_0x4056ce['options'][_0x5056('0x1b')]||null:null,'limit':_0x4056ce[_0x5056('0x18')]?_0x4056ce['options'][_0x5056('0x1c')]||null:null,'include':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')]['include']?_[_0x5056('0x1d')](_0x4056ce[_0x5056('0x18')]['include'],function(_0x4a64be){return{'model':db[_0x4a64be[_0x5056('0x1e')]],'as':_0x4a64be['as'],'attributes':_0x4a64be[_0x5056('0x1b')],'include':_0x4a64be[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x4a64be['include'],function(_0x267048){return{'model':db[_0x267048[_0x5056('0x1e')]],'as':_0x267048['as'],'attributes':_0x267048['attributes'],'include':_0x267048[_0x5056('0x1f')]?_['map'](_0x267048[_0x5056('0x1f')],function(_0x39d539){return{'model':db[_0x39d539[_0x5056('0x1e')]],'as':_0x39d539['as'],'attributes':_0x39d539[_0x5056('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5056('0xe')](function(_0x50f2a8){logger[_0x5056('0xf')](_0x5056('0x17'),_0x4056ce);logger[_0x5056('0x20')](_0x5056('0x17'),_0x4056ce,JSON['stringify'](_0x50f2a8));_0x9ea88(_0x50f2a8);})[_0x5056('0x21')](function(_0x5b0270){logger[_0x5056('0x16')]('GetVtigerAccount',_0x5b0270['message'],_0x4056ce);_0x56537e(_0x51b21e['error'](0x1f4,_0x5b0270[_0x5056('0x15')]));});});};exports[_0x5056('0x22')]=function(_0x482939){var _0x27f4be=this;return new Promise(function(_0x2c5728,_0x9e2986){return db[_0x5056('0x23')][_0x5056('0x24')]({'raw':_0x482939[_0x5056('0x18')]?_0x482939[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'where':_0x482939[_0x5056('0x18')]?_0x482939[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0x482939['options']?_0x482939['options'][_0x5056('0x1b')]||null:null,'include':_0x482939[_0x5056('0x18')]?_0x482939['options'][_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x482939['options'][_0x5056('0x1f')],function(_0x378b33){return{'model':db[_0x378b33[_0x5056('0x1e')]],'as':_0x378b33['as'],'attributes':_0x378b33[_0x5056('0x1b')],'include':_0x378b33[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x378b33[_0x5056('0x1f')],function(_0x2f1d27){return{'model':db[_0x2f1d27[_0x5056('0x1e')]],'as':_0x2f1d27['as'],'attributes':_0x2f1d27[_0x5056('0x1b')],'include':_0x2f1d27[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x2f1d27[_0x5056('0x1f')],function(_0x3d7d78){return{'model':db[_0x3d7d78[_0x5056('0x1e')]],'as':_0x3d7d78['as'],'attributes':_0x3d7d78['attributes']};}):[]};}):[]};}):[]:[]})[_0x5056('0xe')](function(_0x483d1e){logger[_0x5056('0xf')](_0x5056('0x22'),_0x482939);logger[_0x5056('0x20')](_0x5056('0x22'),_0x482939,JSON['stringify'](_0x483d1e));_0x2c5728(_0x483d1e);})[_0x5056('0x21')](function(_0x32fecc){logger['error'](_0x5056('0x22'),_0x32fecc['message'],_0x482939);_0x9e2986(_0x27f4be[_0x5056('0x16')](0x1f4,_0x32fecc[_0x5056('0x15')]));});});}; \ No newline at end of file +var _0x1be1=['../../config/environment','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVtigerAccount','options','raw','where','attributes','limit','include','map','model','VtigerAccount','find','ShowVtigerAccount','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x39d4ba,_0x8d5880){var _0x3a2b31=function(_0x4fb4c2){while(--_0x4fb4c2){_0x39d4ba['push'](_0x39d4ba['shift']());}};_0x3a2b31(++_0x8d5880);}(_0x1be1,0x192));var _0x11be=function(_0x223316,_0xda01d8){_0x223316=_0x223316-0x0;var _0x43ff9b=_0x1be1[_0x223316];return _0x43ff9b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11be('0x0'));var BPromise=require(_0x11be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11be('0x2'));var db=require(_0x11be('0x3'))['db'];var utils=require(_0x11be('0x4'));var logger=require(_0x11be('0x5'))('rpc');var config=require(_0x11be('0x6'));var jayson=require(_0x11be('0x7'));var client=jayson[_0x11be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe8c62,_0x497730,_0x18f661){return new BPromise(function(_0x11fc15,_0x246772){return client[_0x11be('0x9')](_0xfe8c62,_0x18f661)[_0x11be('0xa')](function(_0x5f3d04){logger[_0x11be('0xb')](_0x11be('0xc'),_0x497730,'request\x20sent');logger[_0x11be('0xd')](_0x11be('0xe'),_0x497730,_0x11be('0xf'),JSON[_0x11be('0x10')](_0x5f3d04));if(_0x5f3d04['error']){if(_0x5f3d04[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger[_0x11be('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x497730,_0x5f3d04[_0x11be('0x11')][_0x11be('0x13')]);return _0x246772(_0x5f3d04['error'][_0x11be('0x13')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x497730,_0x5f3d04['error']['message']);return _0x11fc15(_0x5f3d04['error']['message']);}else{logger['info'](_0x11be('0xc'),_0x497730,'request\x20sent');_0x11fc15(_0x5f3d04[_0x11be('0x14')][_0x11be('0x13')]);}})[_0x11be('0x15')](function(_0x216b8c){logger['error'](_0x11be('0xc'),_0x497730,_0x216b8c);_0x246772(_0x216b8c);});});}exports[_0x11be('0x16')]=function(_0x56ab61){var _0x299f45=this;return new Promise(function(_0xc3263c,_0x23aa5f){return db['VtigerAccount']['findAll']({'raw':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x18')]===undefined?!![]:![]:!![],'where':_0x56ab61[_0x11be('0x17')]?_0x56ab61['options'][_0x11be('0x19')]||null:null,'attributes':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x1a')]||null:null,'limit':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x1b')]||null:null,'include':_0x56ab61[_0x11be('0x17')]?_0x56ab61[_0x11be('0x17')][_0x11be('0x1c')]?_['map'](_0x56ab61[_0x11be('0x17')][_0x11be('0x1c')],function(_0x2fe43c){return{'model':db[_0x2fe43c['model']],'as':_0x2fe43c['as'],'attributes':_0x2fe43c['attributes'],'include':_0x2fe43c[_0x11be('0x1c')]?_[_0x11be('0x1d')](_0x2fe43c[_0x11be('0x1c')],function(_0x4cb27f){return{'model':db[_0x4cb27f[_0x11be('0x1e')]],'as':_0x4cb27f['as'],'attributes':_0x4cb27f['attributes'],'include':_0x4cb27f[_0x11be('0x1c')]?_['map'](_0x4cb27f[_0x11be('0x1c')],function(_0xb11f3d){return{'model':db[_0xb11f3d['model']],'as':_0xb11f3d['as'],'attributes':_0xb11f3d[_0x11be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x11be('0xa')](function(_0x1d3b5c){logger[_0x11be('0xb')](_0x11be('0x16'),_0x56ab61);logger[_0x11be('0xd')](_0x11be('0x16'),_0x56ab61,JSON[_0x11be('0x10')](_0x1d3b5c));_0xc3263c(_0x1d3b5c);})[_0x11be('0x15')](function(_0x5966c5){logger[_0x11be('0x11')]('GetVtigerAccount',_0x5966c5[_0x11be('0x13')],_0x56ab61);_0x23aa5f(_0x299f45[_0x11be('0x11')](0x1f4,_0x5966c5['message']));});});};exports['ShowVtigerAccount']=function(_0x49fd5c){var _0x265fc9=this;return new Promise(function(_0x5e8f9a,_0x66316d){return db[_0x11be('0x1f')][_0x11be('0x20')]({'raw':_0x49fd5c[_0x11be('0x17')]?_0x49fd5c[_0x11be('0x17')][_0x11be('0x18')]===undefined?!![]:![]:!![],'where':_0x49fd5c['options']?_0x49fd5c[_0x11be('0x17')][_0x11be('0x19')]||null:null,'attributes':_0x49fd5c[_0x11be('0x17')]?_0x49fd5c[_0x11be('0x17')][_0x11be('0x1a')]||null:null,'include':_0x49fd5c[_0x11be('0x17')]?_0x49fd5c['options'][_0x11be('0x1c')]?_[_0x11be('0x1d')](_0x49fd5c[_0x11be('0x17')][_0x11be('0x1c')],function(_0x228bd3){return{'model':db[_0x228bd3['model']],'as':_0x228bd3['as'],'attributes':_0x228bd3[_0x11be('0x1a')],'include':_0x228bd3[_0x11be('0x1c')]?_[_0x11be('0x1d')](_0x228bd3['include'],function(_0x2c6fb2){return{'model':db[_0x2c6fb2['model']],'as':_0x2c6fb2['as'],'attributes':_0x2c6fb2['attributes'],'include':_0x2c6fb2['include']?_['map'](_0x2c6fb2[_0x11be('0x1c')],function(_0x2c5715){return{'model':db[_0x2c5715[_0x11be('0x1e')]],'as':_0x2c5715['as'],'attributes':_0x2c5715['attributes']};}):[]};}):[]};}):[]:[]})[_0x11be('0xa')](function(_0x1866d8){logger['info'](_0x11be('0x21'),_0x49fd5c);logger['debug'](_0x11be('0x21'),_0x49fd5c,JSON['stringify'](_0x1866d8));_0x5e8f9a(_0x1866d8);})[_0x11be('0x15')](function(_0xa6d724){logger[_0x11be('0x11')](_0x11be('0x21'),_0xa6d724['message'],_0x49fd5c);_0x66316d(_0x265fc9[_0x11be('0x11')](0x1f4,_0xa6d724[_0x11be('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index bc430bc..6ed5b68 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 _0xf95f=['./intVtigerConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xf95f,0xf0));var _0xff95=function(_0x59ec7a,_0x1eb345){_0x59ec7a=_0x59ec7a-0x0;var _0x8535ed=_0xf95f[_0x59ec7a];return _0x8535ed;};'use strict';var multer=require(_0xff95('0x0'));var util=require(_0xff95('0x1'));var path=require(_0xff95('0x2'));var timeout=require(_0xff95('0x3'));var express=require(_0xff95('0x4'));var router=express[_0xff95('0x5')]();var fs_extra=require(_0xff95('0x6'));var auth=require(_0xff95('0x7'));var interaction=require(_0xff95('0x8'));var config=require(_0xff95('0x9'));var controller=require(_0xff95('0xa'));router['get']('/',auth[_0xff95('0xb')](),controller['index']);router[_0xff95('0xc')](_0xff95('0xd'),auth[_0xff95('0xb')](),controller[_0xff95('0xe')]);router['get'](_0xff95('0xf'),auth['isAuthenticated'](),controller[_0xff95('0x10')]);router[_0xff95('0xc')]('/:id/subjects',auth[_0xff95('0xb')](),controller[_0xff95('0x11')]);router[_0xff95('0xc')](_0xff95('0x12'),auth[_0xff95('0xb')](),controller[_0xff95('0x13')]);router[_0xff95('0x14')]('/',auth[_0xff95('0xb')](),controller[_0xff95('0x15')]);router[_0xff95('0x16')](_0xff95('0xd'),auth[_0xff95('0xb')](),controller['update']);router[_0xff95('0x17')](_0xff95('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xff95('0x18')]=router; \ No newline at end of file +var _0xf268=['../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put','update','exports','multer','util','path','express','fs-extra','../../components/interaction/service'];(function(_0x51f95b,_0x1f1350){var _0x2d4c5e=function(_0x3ecef5){while(--_0x3ecef5){_0x51f95b['push'](_0x51f95b['shift']());}};_0x2d4c5e(++_0x1f1350);}(_0xf268,0xa2));var _0x8f26=function(_0x5962b4,_0x84be73){_0x5962b4=_0x5962b4-0x0;var _0xe6443c=_0xf268[_0x5962b4];return _0xe6443c;};'use strict';var multer=require(_0x8f26('0x0'));var util=require(_0x8f26('0x1'));var path=require(_0x8f26('0x2'));var timeout=require('connect-timeout');var express=require(_0x8f26('0x3'));var router=express['Router']();var fs_extra=require(_0x8f26('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8f26('0x5'));var config=require(_0x8f26('0x6'));var controller=require('./intVtigerConfiguration.controller');router[_0x8f26('0x7')]('/',auth['isAuthenticated'](),controller[_0x8f26('0x8')]);router[_0x8f26('0x7')](_0x8f26('0x9'),auth[_0x8f26('0xa')](),controller[_0x8f26('0xb')]);router[_0x8f26('0x7')](_0x8f26('0xc'),auth[_0x8f26('0xa')](),controller[_0x8f26('0xd')]);router[_0x8f26('0x7')]('/:id/subjects',auth[_0x8f26('0xa')](),controller['getSubjects']);router[_0x8f26('0x7')](_0x8f26('0xe'),auth[_0x8f26('0xa')](),controller[_0x8f26('0xf')]);router[_0x8f26('0x10')]('/',auth[_0x8f26('0xa')](),controller[_0x8f26('0x11')]);router[_0x8f26('0x12')]('/:id',auth[_0x8f26('0xa')](),controller[_0x8f26('0x13')]);router['delete'](_0x8f26('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x8f26('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index a534189..b6b36fe 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 _0x60d6=['exports','sequelize'];(function(_0x795a78,_0x4e8184){var _0x17871f=function(_0x33d45c){while(--_0x33d45c){_0x795a78['push'](_0x795a78['shift']());}};_0x17871f(++_0x4e8184);}(_0x60d6,0x107));var _0x660d=function(_0x18f3f8,_0x36a345){_0x18f3f8=_0x18f3f8-0x0;var _0x29233c=_0x60d6[_0x18f3f8];return _0x29233c;};'use strict';var Sequelize=require(_0x660d('0x0'));module[_0x660d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6b10=['exports','sequelize'];(function(_0x18f65d,_0x32f166){var _0xf80f65=function(_0x311dec){while(--_0x311dec){_0x18f65d['push'](_0x18f65d['shift']());}};_0xf80f65(++_0x32f166);}(_0x6b10,0xb7));var _0x06b1=function(_0x2c897c,_0x10451a){_0x2c897c=_0x2c897c-0x0;var _0xc9e1f0=_0x6b10[_0x2c897c];return _0xc9e1f0;};'use strict';var Sequelize=require(_0x06b1('0x0'));module[_0x06b1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index e7e2fd6..8e6e451 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 _0xb264=['../../config/environment','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','offset','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','catch','show','params','body','find','findOne','VtigerField','length','order','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x24def2,_0x1c7a61){var _0x24e93d=function(_0x797259){while(--_0x797259){_0x24def2['push'](_0x24def2['shift']());}};_0x24e93d(++_0x1c7a61);}(_0xb264,0x88));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4b26('0x0'));var rimraf=require(_0x4b26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b26('0x2'));var rp=require(_0x4b26('0x3'));var moment=require(_0x4b26('0x4'));var BPromise=require(_0x4b26('0x5'));var Mustache=require(_0x4b26('0x6'));var util=require(_0x4b26('0x7'));var path=require('path');var sox=require(_0x4b26('0x8'));var csv=require(_0x4b26('0x9'));var ejs=require(_0x4b26('0xa'));var fs=require('fs');var fs_extra=require(_0x4b26('0xb'));var _=require('lodash');var squel=require(_0x4b26('0xc'));var crypto=require(_0x4b26('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4b26('0x9'));var querystring=require('querystring');var Papa=require(_0x4b26('0xe'));var Redis=require(_0x4b26('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4b26('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4b26('0x11'));var logger=require('../../config/logger')(_0x4b26('0x12'));var utils=require(_0x4b26('0x13'));var config=require(_0x4b26('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x260ac3,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x125527){if(_0x125527){return _0x260ac3[_0x4b26('0x15')](_0x596c48);}return _0x260ac3[_0x4b26('0x16')](_0x596c48)[_0x4b26('0x17')]();};}function respondWithResult(_0x1d6a67,_0x57e47e){_0x57e47e=_0x57e47e||0xc8;return function(_0x5589e2){if(_0x5589e2){return _0x1d6a67[_0x4b26('0x16')](_0x57e47e)[_0x4b26('0x18')](_0x5589e2);}};}function respondWithFilteredResult(_0x1b75ad,_0x168549){return function(_0x36ce2b){if(_0x36ce2b){var _0xac8b02=typeof _0x168549['offset']===_0x4b26('0x19')&&typeof _0x168549['limit']===_0x4b26('0x19');var _0x347e46=_0x36ce2b[_0x4b26('0x1a')];var _0x12a185=_0xac8b02?0x0:_0x168549['offset'];var _0x448300=_0xac8b02?_0x36ce2b[_0x4b26('0x1a')]:_0x168549['offset']+_0x168549[_0x4b26('0x1b')];var _0x182465;if(_0x448300>=_0x347e46){_0x448300=_0x347e46;_0x182465=0xc8;}else{_0x182465=0xce;}_0x1b75ad['status'](_0x182465);return _0x1b75ad[_0x4b26('0x1c')](_0x4b26('0x1d'),_0x12a185+'-'+_0x448300+'/'+_0x347e46)['json'](_0x36ce2b);}return null;};}function patchUpdates(_0x2709d8){return function(_0x18f573){try{jsonpatch[_0x4b26('0x1e')](_0x18f573,_0x2709d8,!![]);}catch(_0x38f492){return BPromise[_0x4b26('0x1f')](_0x38f492);}return _0x18f573[_0x4b26('0x20')]();};}function saveUpdates(_0x5c6280,_0x29e351){return function(_0x156609){if(_0x156609){return _0x156609[_0x4b26('0x21')](_0x5c6280)['then'](function(_0x2163b7){return _0x2163b7;});}return null;};}function removeEntity(_0x55fe66,_0x2a9ee9){return function(_0x1014ca){if(_0x1014ca){return _0x1014ca[_0x4b26('0x22')]()['then'](function(){_0x55fe66['status'](0xcc)[_0x4b26('0x17')]();});}};}function handleEntityNotFound(_0x439b82,_0x1b3dd3){return function(_0x47f1d2){if(!_0x47f1d2){_0x439b82['sendStatus'](0x194);}return _0x47f1d2;};}function handleError(_0x212188,_0x4f7576){_0x4f7576=_0x4f7576||0x1f4;return function(_0x1669c2){logger[_0x4b26('0x23')](_0x1669c2[_0x4b26('0x24')]);if(_0x1669c2[_0x4b26('0x25')]){delete _0x1669c2[_0x4b26('0x25')];}_0x212188[_0x4b26('0x16')](_0x4f7576)[_0x4b26('0x26')](_0x1669c2);};}exports[_0x4b26('0x27')]=function(_0x2090f1,_0x3477b1){var _0x19cfac={},_0xb01942={},_0x2fde94={'count':0x0,'rows':[]};var _0xc1587d=_[_0x4b26('0x28')](db[_0x4b26('0x29')][_0x4b26('0x2a')],function(_0xe9de0){return{'name':_0xe9de0[_0x4b26('0x2b')],'type':_0xe9de0[_0x4b26('0x2c')][_0x4b26('0x2d')]};});_0xb01942[_0x4b26('0x2e')]=_[_0x4b26('0x28')](_0xc1587d,_0x4b26('0x25'));_0xb01942[_0x4b26('0x2f')]=_[_0x4b26('0x30')](_0x2090f1[_0x4b26('0x2f')]);_0xb01942['filters']=_[_0x4b26('0x31')](_0xb01942[_0x4b26('0x2e')],_0xb01942['query']);_0x19cfac[_0x4b26('0x32')]=_[_0x4b26('0x31')](_0xb01942[_0x4b26('0x2e')],qs[_0x4b26('0x33')](_0x2090f1[_0x4b26('0x2f')][_0x4b26('0x33')]));_0x19cfac[_0x4b26('0x32')]=_0x19cfac[_0x4b26('0x32')]['length']?_0x19cfac[_0x4b26('0x32')]:_0xb01942['model'];if(!_0x2090f1['query']['hasOwnProperty'](_0x4b26('0x34'))){_0x19cfac['limit']=qs[_0x4b26('0x1b')](_0x2090f1[_0x4b26('0x2f')][_0x4b26('0x1b')]);_0x19cfac[_0x4b26('0x35')]=qs[_0x4b26('0x35')](_0x2090f1[_0x4b26('0x2f')][_0x4b26('0x35')]);}_0x19cfac['order']=qs[_0x4b26('0x36')](_0x2090f1[_0x4b26('0x2f')]['sort']);_0x19cfac[_0x4b26('0x37')]=qs[_0x4b26('0x38')](_[_0x4b26('0x39')](_0x2090f1[_0x4b26('0x2f')],_0xb01942[_0x4b26('0x38')]),_0xc1587d);if(_0x2090f1[_0x4b26('0x2f')][_0x4b26('0x3a')]){_0x19cfac[_0x4b26('0x37')]=_[_0x4b26('0x3b')](_0x19cfac['where'],{'$or':_['map'](_0xc1587d,function(_0x228b6e){if(_0x228b6e[_0x4b26('0x2c')]!==_0x4b26('0x3c')){var _0x2f8fba={};_0x2f8fba[_0x228b6e[_0x4b26('0x25')]]={'$like':'%'+_0x2090f1[_0x4b26('0x2f')]['filter']+'%'};return _0x2f8fba;}})});}_0x19cfac=_['merge']({},_0x19cfac,_0x2090f1[_0x4b26('0x3d')]);var _0x3d27cb={'where':_0x19cfac[_0x4b26('0x37')]};return db[_0x4b26('0x29')][_0x4b26('0x1a')](_0x3d27cb)[_0x4b26('0x3e')](function(_0x240269){_0x2fde94[_0x4b26('0x1a')]=_0x240269;if(_0x2090f1[_0x4b26('0x2f')][_0x4b26('0x3f')]){_0x19cfac[_0x4b26('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x19cfac);})['then'](function(_0x614632){_0x2fde94['rows']=_0x614632;return _0x2fde94;})[_0x4b26('0x3e')](respondWithFilteredResult(_0x3477b1,_0x19cfac))[_0x4b26('0x41')](handleError(_0x3477b1,null));};exports[_0x4b26('0x42')]=function(_0x52e6f8,_0x5a8612){var _0x1b6920={'raw':![],'where':{'id':_0x52e6f8[_0x4b26('0x43')]['id']}},_0x498ae5={};_0x498ae5[_0x4b26('0x2e')]=_['keys'](db['VtigerConfiguration'][_0x4b26('0x2a')]);_0x498ae5[_0x4b26('0x2f')]=_[_0x4b26('0x30')](_0x52e6f8[_0x4b26('0x2f')]);_0x498ae5[_0x4b26('0x38')]=_['intersection'](_0x498ae5['model'],_0x498ae5[_0x4b26('0x2f')]);_0x1b6920['attributes']=_[_0x4b26('0x31')](_0x498ae5[_0x4b26('0x2e')],qs[_0x4b26('0x33')](_0x52e6f8[_0x4b26('0x2f')][_0x4b26('0x33')]));_0x1b6920[_0x4b26('0x32')]=_0x1b6920['attributes']['length']?_0x1b6920['attributes']:_0x498ae5[_0x4b26('0x2e')];if(_0x52e6f8[_0x4b26('0x2f')]['includeAll']){_0x1b6920['include']=[{'all':!![]}];}_0x1b6920=_[_0x4b26('0x3b')]({},_0x1b6920,_0x52e6f8['options']);return db[_0x4b26('0x29')]['find'](_0x1b6920)['then'](handleEntityNotFound(_0x5a8612,null))[_0x4b26('0x3e')](respondWithResult(_0x5a8612,null))['catch'](handleError(_0x5a8612,null));};exports['create']=function(_0x274f21,_0x36b9c6){return db[_0x4b26('0x29')]['create'](_0x274f21['body'],{})['then'](respondWithResult(_0x36b9c6,0xc9))[_0x4b26('0x41')](handleError(_0x36b9c6,null));};exports[_0x4b26('0x21')]=function(_0x278485,_0x4f7c81){if(_0x278485[_0x4b26('0x44')]['id']){delete _0x278485['body']['id'];}return db['VtigerConfiguration'][_0x4b26('0x45')]({'where':{'id':_0x278485[_0x4b26('0x43')]['id']}})[_0x4b26('0x3e')](handleEntityNotFound(_0x4f7c81,null))[_0x4b26('0x3e')](saveUpdates(_0x278485['body'],null))[_0x4b26('0x3e')](respondWithResult(_0x4f7c81,null))['catch'](handleError(_0x4f7c81,null));};exports[_0x4b26('0x22')]=function(_0x145073,_0x470d7a){return db[_0x4b26('0x29')][_0x4b26('0x45')]({'where':{'id':_0x145073[_0x4b26('0x43')]['id']}})['then'](handleEntityNotFound(_0x470d7a,null))[_0x4b26('0x3e')](removeEntity(_0x470d7a,null))['catch'](handleError(_0x470d7a,null));};exports['getFields']=function(_0xc9403f,_0x1b53c5,_0x5d25e3){var _0x4da11d={};var _0x149eb5={};var _0x115c9f;var _0x4ba210;return db[_0x4b26('0x29')][_0x4b26('0x46')]({'where':{'id':_0xc9403f[_0x4b26('0x43')]['id']}})['then'](handleEntityNotFound(_0x1b53c5,null))['then'](function(_0x5f2bd8){if(_0x5f2bd8){_0x115c9f=_0x5f2bd8;_0x149eb5[_0x4b26('0x2e')]=_['keys'](db[_0x4b26('0x47')][_0x4b26('0x2a')]);_0x149eb5['query']=_[_0x4b26('0x30')](_0xc9403f[_0x4b26('0x2f')]);_0x149eb5[_0x4b26('0x38')]=_[_0x4b26('0x31')](_0x149eb5['model'],_0x149eb5[_0x4b26('0x2f')]);_0x4da11d[_0x4b26('0x32')]=_[_0x4b26('0x31')](_0x149eb5['model'],qs['fields'](_0xc9403f['query'][_0x4b26('0x33')]));_0x4da11d['attributes']=_0x4da11d[_0x4b26('0x32')][_0x4b26('0x48')]?_0x4da11d['attributes']:_0x149eb5[_0x4b26('0x2e')];_0x4da11d[_0x4b26('0x49')]=qs['sort'](_0xc9403f[_0x4b26('0x2f')][_0x4b26('0x36')]);_0x4da11d[_0x4b26('0x37')]=qs[_0x4b26('0x38')](_[_0x4b26('0x39')](_0xc9403f['query'],_0x149eb5[_0x4b26('0x38')]));if(_0xc9403f[_0x4b26('0x2f')]['filter']){_0x4da11d[_0x4b26('0x37')]=_['merge'](_0x4da11d[_0x4b26('0x37')],{'$or':_[_0x4b26('0x28')](_0x4da11d[_0x4b26('0x32')],function(_0x1a4bfc){var _0x22e655={};_0x22e655[_0x1a4bfc]={'$like':'%'+_0xc9403f[_0x4b26('0x2f')][_0x4b26('0x3a')]+'%'};return _0x22e655;})});}_0x4da11d=_[_0x4b26('0x3b')]({},_0x4da11d,_0xc9403f[_0x4b26('0x3d')]);return _0x115c9f[_0x4b26('0x4a')](_0x4da11d);}})[_0x4b26('0x3e')](function(_0x26431f){if(_0x26431f){_0x4ba210=_0x26431f[_0x4b26('0x48')];if(!_0xc9403f[_0x4b26('0x2f')][_0x4b26('0x4b')](_0x4b26('0x34'))){_0x4da11d['limit']=qs['limit'](_0xc9403f['query'][_0x4b26('0x1b')]);_0x4da11d[_0x4b26('0x35')]=qs[_0x4b26('0x35')](_0xc9403f['query']['offset']);}return _0x115c9f[_0x4b26('0x4a')](_0x4da11d);}})[_0x4b26('0x3e')](function(_0x4ef048){if(_0x4ef048){return _0x4ef048?{'count':_0x4ba210,'rows':_0x4ef048}:null;}})['then'](respondWithResult(_0x1b53c5,null))[_0x4b26('0x41')](handleError(_0x1b53c5,null));};exports[_0x4b26('0x4c')]=function(_0x2916f7,_0x5962fa,_0x449486){var _0x357670={};var _0xf99923={};var _0x2f3e77;var _0x1d0c84;return db[_0x4b26('0x29')]['findOne']({'where':{'id':_0x2916f7['params']['id']}})['then'](handleEntityNotFound(_0x5962fa,null))['then'](function(_0x290b53){if(_0x290b53){_0x2f3e77=_0x290b53;_0xf99923[_0x4b26('0x2e')]=_[_0x4b26('0x30')](db[_0x4b26('0x47')]['rawAttributes']);_0xf99923[_0x4b26('0x2f')]=_[_0x4b26('0x30')](_0x2916f7[_0x4b26('0x2f')]);_0xf99923['filters']=_['intersection'](_0xf99923['model'],_0xf99923[_0x4b26('0x2f')]);_0x357670[_0x4b26('0x32')]=_[_0x4b26('0x31')](_0xf99923[_0x4b26('0x2e')],qs[_0x4b26('0x33')](_0x2916f7[_0x4b26('0x2f')][_0x4b26('0x33')]));_0x357670['attributes']=_0x357670['attributes'][_0x4b26('0x48')]?_0x357670[_0x4b26('0x32')]:_0xf99923[_0x4b26('0x2e')];_0x357670[_0x4b26('0x49')]=qs[_0x4b26('0x36')](_0x2916f7[_0x4b26('0x2f')][_0x4b26('0x36')]);_0x357670['where']=qs[_0x4b26('0x38')](_[_0x4b26('0x39')](_0x2916f7[_0x4b26('0x2f')],_0xf99923[_0x4b26('0x38')]));if(_0x2916f7['query'][_0x4b26('0x3a')]){_0x357670[_0x4b26('0x37')]=_['merge'](_0x357670[_0x4b26('0x37')],{'$or':_['map'](_0x357670[_0x4b26('0x32')],function(_0x59d304){var _0x250086={};_0x250086[_0x59d304]={'$like':'%'+_0x2916f7[_0x4b26('0x2f')][_0x4b26('0x3a')]+'%'};return _0x250086;})});}_0x357670=_[_0x4b26('0x3b')]({},_0x357670,_0x2916f7['options']);return _0x2f3e77[_0x4b26('0x4c')](_0x357670);}})[_0x4b26('0x3e')](function(_0xa7b8c){if(_0xa7b8c){_0x1d0c84=_0xa7b8c[_0x4b26('0x48')];if(!_0x2916f7[_0x4b26('0x2f')]['hasOwnProperty'](_0x4b26('0x34'))){_0x357670[_0x4b26('0x1b')]=qs[_0x4b26('0x1b')](_0x2916f7[_0x4b26('0x2f')][_0x4b26('0x1b')]);_0x357670[_0x4b26('0x35')]=qs[_0x4b26('0x35')](_0x2916f7[_0x4b26('0x2f')]['offset']);}return _0x2f3e77[_0x4b26('0x4c')](_0x357670);}})[_0x4b26('0x3e')](function(_0x5e474f){if(_0x5e474f){return _0x5e474f?{'count':_0x1d0c84,'rows':_0x5e474f}:null;}})[_0x4b26('0x3e')](respondWithResult(_0x5962fa,null))['catch'](handleError(_0x5962fa,null));};exports['getDescriptions']=function(_0x3a43f5,_0x30fbfc,_0x29b66e){var _0x549012={};var _0x5b7d6f={};var _0x3c8947;var _0x5a6cc2;return db[_0x4b26('0x29')][_0x4b26('0x46')]({'where':{'id':_0x3a43f5['params']['id']}})[_0x4b26('0x3e')](handleEntityNotFound(_0x30fbfc,null))[_0x4b26('0x3e')](function(_0x157d9c){if(_0x157d9c){_0x3c8947=_0x157d9c;_0x5b7d6f[_0x4b26('0x2e')]=_[_0x4b26('0x30')](db['VtigerField'][_0x4b26('0x2a')]);_0x5b7d6f['query']=_[_0x4b26('0x30')](_0x3a43f5[_0x4b26('0x2f')]);_0x5b7d6f[_0x4b26('0x38')]=_[_0x4b26('0x31')](_0x5b7d6f[_0x4b26('0x2e')],_0x5b7d6f['query']);_0x549012['attributes']=_[_0x4b26('0x31')](_0x5b7d6f[_0x4b26('0x2e')],qs[_0x4b26('0x33')](_0x3a43f5[_0x4b26('0x2f')][_0x4b26('0x33')]));_0x549012['attributes']=_0x549012['attributes'][_0x4b26('0x48')]?_0x549012[_0x4b26('0x32')]:_0x5b7d6f[_0x4b26('0x2e')];_0x549012[_0x4b26('0x49')]=qs[_0x4b26('0x36')](_0x3a43f5[_0x4b26('0x2f')][_0x4b26('0x36')]);_0x549012['where']=qs[_0x4b26('0x38')](_[_0x4b26('0x39')](_0x3a43f5['query'],_0x5b7d6f[_0x4b26('0x38')]));if(_0x3a43f5[_0x4b26('0x2f')][_0x4b26('0x3a')]){_0x549012['where']=_[_0x4b26('0x3b')](_0x549012[_0x4b26('0x37')],{'$or':_[_0x4b26('0x28')](_0x549012[_0x4b26('0x32')],function(_0x11a3df){var _0x55982c={};_0x55982c[_0x11a3df]={'$like':'%'+_0x3a43f5['query'][_0x4b26('0x3a')]+'%'};return _0x55982c;})});}_0x549012=_[_0x4b26('0x3b')]({},_0x549012,_0x3a43f5[_0x4b26('0x3d')]);return _0x3c8947[_0x4b26('0x4d')](_0x549012);}})[_0x4b26('0x3e')](function(_0x140319){if(_0x140319){_0x5a6cc2=_0x140319[_0x4b26('0x48')];if(!_0x3a43f5[_0x4b26('0x2f')][_0x4b26('0x4b')](_0x4b26('0x34'))){_0x549012['limit']=qs[_0x4b26('0x1b')](_0x3a43f5['query'][_0x4b26('0x1b')]);_0x549012[_0x4b26('0x35')]=qs[_0x4b26('0x35')](_0x3a43f5[_0x4b26('0x2f')]['offset']);}return _0x3c8947[_0x4b26('0x4d')](_0x549012);}})[_0x4b26('0x3e')](function(_0x3c9a21){if(_0x3c9a21){return _0x3c9a21?{'count':_0x5a6cc2,'rows':_0x3c9a21}:null;}})[_0x4b26('0x3e')](respondWithResult(_0x30fbfc,null))['catch'](handleError(_0x30fbfc,null));}; \ No newline at end of file +var _0x79d3=['update','then','destroy','end','sendStatus','error','stack','name','send','index','VtigerConfiguration','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','VtigerField','rawAttributes','getFields','hasOwnProperty','getSubjects','findOne','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save'];(function(_0x218be4,_0x257ff7){var _0x105e54=function(_0x46d509){while(--_0x46d509){_0x218be4['push'](_0x218be4['shift']());}};_0x105e54(++_0x257ff7);}(_0x79d3,0x179));var _0x379d=function(_0x1accf6,_0x4a9854){_0x1accf6=_0x1accf6-0x0;var _0x24e446=_0x79d3[_0x1accf6];return _0x24e446;};'use strict';var emlformat=require(_0x379d('0x0'));var rimraf=require(_0x379d('0x1'));var zipdir=require(_0x379d('0x2'));var jsonpatch=require(_0x379d('0x3'));var rp=require(_0x379d('0x4'));var moment=require(_0x379d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x379d('0x6'));var util=require(_0x379d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x379d('0x8'));var ejs=require(_0x379d('0x9'));var fs=require('fs');var fs_extra=require(_0x379d('0xa'));var _=require(_0x379d('0xb'));var squel=require(_0x379d('0xc'));var crypto=require('crypto');var jsforce=require(_0x379d('0xd'));var deskjs=require(_0x379d('0xe'));var toCsv=require(_0x379d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x379d('0xf'));var authService=require(_0x379d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x379d('0x11'));var hardwareService=require(_0x379d('0x12'));var logger=require(_0x379d('0x13'))(_0x379d('0x14'));var utils=require('../../config/utils');var config=require(_0x379d('0x15'));var licenseUtil=require(_0x379d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x380841,_0x9dc839){_0x9dc839=_0x9dc839||0xcc;return function(_0x4fae63){if(_0x4fae63){return _0x380841['sendStatus'](_0x9dc839);}return _0x380841[_0x379d('0x17')](_0x9dc839)['end']();};}function respondWithResult(_0x5f4947,_0x339aab){_0x339aab=_0x339aab||0xc8;return function(_0x4c36bb){if(_0x4c36bb){return _0x5f4947[_0x379d('0x17')](_0x339aab)['json'](_0x4c36bb);}};}function respondWithFilteredResult(_0x2957c8,_0x4150a1){return function(_0x1afe8e){if(_0x1afe8e){var _0x3e7fee=typeof _0x4150a1[_0x379d('0x18')]===_0x379d('0x19')&&typeof _0x4150a1[_0x379d('0x1a')]===_0x379d('0x19');var _0x462244=_0x1afe8e[_0x379d('0x1b')];var _0x58653d=_0x3e7fee?0x0:_0x4150a1['offset'];var _0x37f319=_0x3e7fee?_0x1afe8e[_0x379d('0x1b')]:_0x4150a1[_0x379d('0x18')]+_0x4150a1[_0x379d('0x1a')];var _0x2b1f1f;if(_0x37f319>=_0x462244){_0x37f319=_0x462244;_0x2b1f1f=0xc8;}else{_0x2b1f1f=0xce;}_0x2957c8[_0x379d('0x17')](_0x2b1f1f);return _0x2957c8['set'](_0x379d('0x1c'),_0x58653d+'-'+_0x37f319+'/'+_0x462244)[_0x379d('0x1d')](_0x1afe8e);}return null;};}function patchUpdates(_0x34f791){return function(_0x151e66){try{jsonpatch[_0x379d('0x1e')](_0x151e66,_0x34f791,!![]);}catch(_0x26348b){return BPromise[_0x379d('0x1f')](_0x26348b);}return _0x151e66[_0x379d('0x20')]();};}function saveUpdates(_0x1d1bdb,_0x139d23){return function(_0x34b0aa){if(_0x34b0aa){return _0x34b0aa[_0x379d('0x21')](_0x1d1bdb)[_0x379d('0x22')](function(_0x385417){return _0x385417;});}return null;};}function removeEntity(_0x32493f,_0x26b485){return function(_0x26e2b3){if(_0x26e2b3){return _0x26e2b3[_0x379d('0x23')]()[_0x379d('0x22')](function(){_0x32493f['status'](0xcc)[_0x379d('0x24')]();});}};}function handleEntityNotFound(_0x4d273c,_0x3a22b1){return function(_0x375ad8){if(!_0x375ad8){_0x4d273c[_0x379d('0x25')](0x194);}return _0x375ad8;};}function handleError(_0x20bd99,_0x10f0ed){_0x10f0ed=_0x10f0ed||0x1f4;return function(_0x15bccc){logger[_0x379d('0x26')](_0x15bccc[_0x379d('0x27')]);if(_0x15bccc[_0x379d('0x28')]){delete _0x15bccc['name'];}_0x20bd99['status'](_0x10f0ed)[_0x379d('0x29')](_0x15bccc);};}exports[_0x379d('0x2a')]=function(_0xa65ad2,_0x2030ec){var _0x3bbc12={},_0x35da33={},_0x3d527d={'count':0x0,'rows':[]};var _0x9f0b4a=_['map'](db[_0x379d('0x2b')]['rawAttributes'],function(_0xef62e7){return{'name':_0xef62e7[_0x379d('0x2c')],'type':_0xef62e7[_0x379d('0x2d')][_0x379d('0x2e')]};});_0x35da33[_0x379d('0x2f')]=_[_0x379d('0x30')](_0x9f0b4a,'name');_0x35da33[_0x379d('0x31')]=_[_0x379d('0x32')](_0xa65ad2[_0x379d('0x31')]);_0x35da33[_0x379d('0x33')]=_[_0x379d('0x34')](_0x35da33['model'],_0x35da33[_0x379d('0x31')]);_0x3bbc12[_0x379d('0x35')]=_[_0x379d('0x34')](_0x35da33['model'],qs[_0x379d('0x36')](_0xa65ad2[_0x379d('0x31')]['fields']));_0x3bbc12['attributes']=_0x3bbc12[_0x379d('0x35')][_0x379d('0x37')]?_0x3bbc12[_0x379d('0x35')]:_0x35da33[_0x379d('0x2f')];if(!_0xa65ad2[_0x379d('0x31')]['hasOwnProperty'](_0x379d('0x38'))){_0x3bbc12['limit']=qs[_0x379d('0x1a')](_0xa65ad2[_0x379d('0x31')][_0x379d('0x1a')]);_0x3bbc12['offset']=qs['offset'](_0xa65ad2[_0x379d('0x31')][_0x379d('0x18')]);}_0x3bbc12['order']=qs[_0x379d('0x39')](_0xa65ad2['query']['sort']);_0x3bbc12['where']=qs[_0x379d('0x33')](_[_0x379d('0x3a')](_0xa65ad2[_0x379d('0x31')],_0x35da33[_0x379d('0x33')]),_0x9f0b4a);if(_0xa65ad2[_0x379d('0x31')][_0x379d('0x3b')]){_0x3bbc12[_0x379d('0x3c')]=_[_0x379d('0x3d')](_0x3bbc12['where'],{'$or':_[_0x379d('0x30')](_0x9f0b4a,function(_0x182845){if(_0x182845['type']!==_0x379d('0x3e')){var _0x41b6dc={};_0x41b6dc[_0x182845[_0x379d('0x28')]]={'$like':'%'+_0xa65ad2['query'][_0x379d('0x3b')]+'%'};return _0x41b6dc;}})});}_0x3bbc12=_[_0x379d('0x3d')]({},_0x3bbc12,_0xa65ad2[_0x379d('0x3f')]);var _0x228f1f={'where':_0x3bbc12[_0x379d('0x3c')]};return db[_0x379d('0x2b')][_0x379d('0x1b')](_0x228f1f)['then'](function(_0x19156e){_0x3d527d[_0x379d('0x1b')]=_0x19156e;if(_0xa65ad2['query'][_0x379d('0x40')]){_0x3bbc12['include']=[{'all':!![]}];}return db[_0x379d('0x2b')][_0x379d('0x41')](_0x3bbc12);})[_0x379d('0x22')](function(_0x412afe){_0x3d527d[_0x379d('0x42')]=_0x412afe;return _0x3d527d;})['then'](respondWithFilteredResult(_0x2030ec,_0x3bbc12))[_0x379d('0x43')](handleError(_0x2030ec,null));};exports[_0x379d('0x44')]=function(_0x266a53,_0x11ba3f){var _0x7051e2={'raw':![],'where':{'id':_0x266a53[_0x379d('0x45')]['id']}},_0x458fa9={};_0x458fa9['model']=_[_0x379d('0x32')](db['VtigerConfiguration']['rawAttributes']);_0x458fa9['query']=_[_0x379d('0x32')](_0x266a53['query']);_0x458fa9[_0x379d('0x33')]=_['intersection'](_0x458fa9[_0x379d('0x2f')],_0x458fa9[_0x379d('0x31')]);_0x7051e2['attributes']=_[_0x379d('0x34')](_0x458fa9[_0x379d('0x2f')],qs[_0x379d('0x36')](_0x266a53['query'][_0x379d('0x36')]));_0x7051e2[_0x379d('0x35')]=_0x7051e2[_0x379d('0x35')][_0x379d('0x37')]?_0x7051e2[_0x379d('0x35')]:_0x458fa9[_0x379d('0x2f')];if(_0x266a53[_0x379d('0x31')][_0x379d('0x40')]){_0x7051e2[_0x379d('0x46')]=[{'all':!![]}];}_0x7051e2=_[_0x379d('0x3d')]({},_0x7051e2,_0x266a53['options']);return db['VtigerConfiguration']['find'](_0x7051e2)['then'](handleEntityNotFound(_0x11ba3f,null))[_0x379d('0x22')](respondWithResult(_0x11ba3f,null))[_0x379d('0x43')](handleError(_0x11ba3f,null));};exports[_0x379d('0x47')]=function(_0x16207b,_0xf8a2dd){return db['VtigerConfiguration'][_0x379d('0x47')](_0x16207b[_0x379d('0x48')],{})[_0x379d('0x22')](respondWithResult(_0xf8a2dd,0xc9))[_0x379d('0x43')](handleError(_0xf8a2dd,null));};exports[_0x379d('0x21')]=function(_0x489e70,_0x265d24){if(_0x489e70[_0x379d('0x48')]['id']){delete _0x489e70[_0x379d('0x48')]['id'];}return db[_0x379d('0x2b')]['find']({'where':{'id':_0x489e70[_0x379d('0x45')]['id']}})['then'](handleEntityNotFound(_0x265d24,null))['then'](saveUpdates(_0x489e70[_0x379d('0x48')],null))[_0x379d('0x22')](respondWithResult(_0x265d24,null))[_0x379d('0x43')](handleError(_0x265d24,null));};exports['destroy']=function(_0x16457a,_0x50fcfe){return db[_0x379d('0x2b')][_0x379d('0x49')]({'where':{'id':_0x16457a[_0x379d('0x45')]['id']}})['then'](handleEntityNotFound(_0x50fcfe,null))[_0x379d('0x22')](removeEntity(_0x50fcfe,null))[_0x379d('0x43')](handleError(_0x50fcfe,null));};exports['getFields']=function(_0x28f66b,_0x3e34d2,_0x297af4){var _0x25e2e5={};var _0x297eb6={};var _0x585d77;var _0x39cc2b;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x28f66b[_0x379d('0x45')]['id']}})[_0x379d('0x22')](handleEntityNotFound(_0x3e34d2,null))[_0x379d('0x22')](function(_0x401d1e){if(_0x401d1e){_0x585d77=_0x401d1e;_0x297eb6['model']=_['keys'](db[_0x379d('0x4a')][_0x379d('0x4b')]);_0x297eb6[_0x379d('0x31')]=_[_0x379d('0x32')](_0x28f66b[_0x379d('0x31')]);_0x297eb6['filters']=_[_0x379d('0x34')](_0x297eb6[_0x379d('0x2f')],_0x297eb6[_0x379d('0x31')]);_0x25e2e5[_0x379d('0x35')]=_['intersection'](_0x297eb6['model'],qs['fields'](_0x28f66b[_0x379d('0x31')][_0x379d('0x36')]));_0x25e2e5[_0x379d('0x35')]=_0x25e2e5[_0x379d('0x35')][_0x379d('0x37')]?_0x25e2e5[_0x379d('0x35')]:_0x297eb6[_0x379d('0x2f')];_0x25e2e5['order']=qs[_0x379d('0x39')](_0x28f66b[_0x379d('0x31')][_0x379d('0x39')]);_0x25e2e5[_0x379d('0x3c')]=qs[_0x379d('0x33')](_[_0x379d('0x3a')](_0x28f66b[_0x379d('0x31')],_0x297eb6[_0x379d('0x33')]));if(_0x28f66b[_0x379d('0x31')][_0x379d('0x3b')]){_0x25e2e5[_0x379d('0x3c')]=_['merge'](_0x25e2e5[_0x379d('0x3c')],{'$or':_['map'](_0x25e2e5[_0x379d('0x35')],function(_0x4b312d){var _0x5c556b={};_0x5c556b[_0x4b312d]={'$like':'%'+_0x28f66b[_0x379d('0x31')]['filter']+'%'};return _0x5c556b;})});}_0x25e2e5=_['merge']({},_0x25e2e5,_0x28f66b['options']);return _0x585d77[_0x379d('0x4c')](_0x25e2e5);}})[_0x379d('0x22')](function(_0x5967c3){if(_0x5967c3){_0x39cc2b=_0x5967c3[_0x379d('0x37')];if(!_0x28f66b[_0x379d('0x31')][_0x379d('0x4d')](_0x379d('0x38'))){_0x25e2e5[_0x379d('0x1a')]=qs[_0x379d('0x1a')](_0x28f66b[_0x379d('0x31')][_0x379d('0x1a')]);_0x25e2e5[_0x379d('0x18')]=qs[_0x379d('0x18')](_0x28f66b['query'][_0x379d('0x18')]);}return _0x585d77[_0x379d('0x4c')](_0x25e2e5);}})[_0x379d('0x22')](function(_0x59d0d4){if(_0x59d0d4){return _0x59d0d4?{'count':_0x39cc2b,'rows':_0x59d0d4}:null;}})[_0x379d('0x22')](respondWithResult(_0x3e34d2,null))[_0x379d('0x43')](handleError(_0x3e34d2,null));};exports[_0x379d('0x4e')]=function(_0x1a1adb,_0x3230c4,_0x8a4692){var _0x190ee6={};var _0x2997ae={};var _0x4c5ad2;var _0x2908a7;return db[_0x379d('0x2b')][_0x379d('0x4f')]({'where':{'id':_0x1a1adb[_0x379d('0x45')]['id']}})[_0x379d('0x22')](handleEntityNotFound(_0x3230c4,null))['then'](function(_0x24a7d3){if(_0x24a7d3){_0x4c5ad2=_0x24a7d3;_0x2997ae[_0x379d('0x2f')]=_['keys'](db[_0x379d('0x4a')]['rawAttributes']);_0x2997ae[_0x379d('0x31')]=_[_0x379d('0x32')](_0x1a1adb['query']);_0x2997ae[_0x379d('0x33')]=_['intersection'](_0x2997ae[_0x379d('0x2f')],_0x2997ae[_0x379d('0x31')]);_0x190ee6[_0x379d('0x35')]=_[_0x379d('0x34')](_0x2997ae[_0x379d('0x2f')],qs[_0x379d('0x36')](_0x1a1adb[_0x379d('0x31')][_0x379d('0x36')]));_0x190ee6[_0x379d('0x35')]=_0x190ee6[_0x379d('0x35')][_0x379d('0x37')]?_0x190ee6['attributes']:_0x2997ae[_0x379d('0x2f')];_0x190ee6[_0x379d('0x50')]=qs['sort'](_0x1a1adb['query']['sort']);_0x190ee6[_0x379d('0x3c')]=qs[_0x379d('0x33')](_[_0x379d('0x3a')](_0x1a1adb[_0x379d('0x31')],_0x2997ae[_0x379d('0x33')]));if(_0x1a1adb[_0x379d('0x31')][_0x379d('0x3b')]){_0x190ee6[_0x379d('0x3c')]=_[_0x379d('0x3d')](_0x190ee6[_0x379d('0x3c')],{'$or':_['map'](_0x190ee6[_0x379d('0x35')],function(_0x43c784){var _0x305df2={};_0x305df2[_0x43c784]={'$like':'%'+_0x1a1adb[_0x379d('0x31')][_0x379d('0x3b')]+'%'};return _0x305df2;})});}_0x190ee6=_[_0x379d('0x3d')]({},_0x190ee6,_0x1a1adb[_0x379d('0x3f')]);return _0x4c5ad2[_0x379d('0x4e')](_0x190ee6);}})[_0x379d('0x22')](function(_0x36d323){if(_0x36d323){_0x2908a7=_0x36d323[_0x379d('0x37')];if(!_0x1a1adb[_0x379d('0x31')][_0x379d('0x4d')](_0x379d('0x38'))){_0x190ee6[_0x379d('0x1a')]=qs[_0x379d('0x1a')](_0x1a1adb[_0x379d('0x31')][_0x379d('0x1a')]);_0x190ee6[_0x379d('0x18')]=qs['offset'](_0x1a1adb[_0x379d('0x31')][_0x379d('0x18')]);}return _0x4c5ad2[_0x379d('0x4e')](_0x190ee6);}})['then'](function(_0x3cd036){if(_0x3cd036){return _0x3cd036?{'count':_0x2908a7,'rows':_0x3cd036}:null;}})[_0x379d('0x22')](respondWithResult(_0x3230c4,null))['catch'](handleError(_0x3230c4,null));};exports[_0x379d('0x51')]=function(_0x3ce1a1,_0xf919de,_0x25598b){var _0x115342={};var _0x1311fb={};var _0x45dcc9;var _0x137560;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x3ce1a1['params']['id']}})[_0x379d('0x22')](handleEntityNotFound(_0xf919de,null))[_0x379d('0x22')](function(_0x240717){if(_0x240717){_0x45dcc9=_0x240717;_0x1311fb[_0x379d('0x2f')]=_['keys'](db[_0x379d('0x4a')][_0x379d('0x4b')]);_0x1311fb[_0x379d('0x31')]=_[_0x379d('0x32')](_0x3ce1a1[_0x379d('0x31')]);_0x1311fb[_0x379d('0x33')]=_[_0x379d('0x34')](_0x1311fb[_0x379d('0x2f')],_0x1311fb['query']);_0x115342[_0x379d('0x35')]=_[_0x379d('0x34')](_0x1311fb[_0x379d('0x2f')],qs['fields'](_0x3ce1a1['query']['fields']));_0x115342[_0x379d('0x35')]=_0x115342['attributes'][_0x379d('0x37')]?_0x115342[_0x379d('0x35')]:_0x1311fb[_0x379d('0x2f')];_0x115342[_0x379d('0x50')]=qs[_0x379d('0x39')](_0x3ce1a1['query'][_0x379d('0x39')]);_0x115342[_0x379d('0x3c')]=qs[_0x379d('0x33')](_['pick'](_0x3ce1a1['query'],_0x1311fb['filters']));if(_0x3ce1a1['query'][_0x379d('0x3b')]){_0x115342['where']=_[_0x379d('0x3d')](_0x115342[_0x379d('0x3c')],{'$or':_[_0x379d('0x30')](_0x115342['attributes'],function(_0x4ebbca){var _0x43dc97={};_0x43dc97[_0x4ebbca]={'$like':'%'+_0x3ce1a1[_0x379d('0x31')][_0x379d('0x3b')]+'%'};return _0x43dc97;})});}_0x115342=_[_0x379d('0x3d')]({},_0x115342,_0x3ce1a1['options']);return _0x45dcc9[_0x379d('0x51')](_0x115342);}})[_0x379d('0x22')](function(_0x9bf7d5){if(_0x9bf7d5){_0x137560=_0x9bf7d5[_0x379d('0x37')];if(!_0x3ce1a1[_0x379d('0x31')][_0x379d('0x4d')](_0x379d('0x38'))){_0x115342[_0x379d('0x1a')]=qs[_0x379d('0x1a')](_0x3ce1a1[_0x379d('0x31')][_0x379d('0x1a')]);_0x115342['offset']=qs[_0x379d('0x18')](_0x3ce1a1['query']['offset']);}return _0x45dcc9['getDescriptions'](_0x115342);}})['then'](function(_0x542f16){if(_0x542f16){return _0x542f16?{'count':_0x137560,'rows':_0x542f16}:null;}})['then'](respondWithResult(_0xf919de,null))[_0x379d('0x43')](handleError(_0xf919de,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 17fd192..d06b2ff 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 _0x7a98=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util','api','moment','bluebird','request-promise'];(function(_0xe80f1f,_0x471cc5){var _0x21b9c8=function(_0x559b44){while(--_0x559b44){_0xe80f1f['push'](_0xe80f1f['shift']());}};_0x21b9c8(++_0x471cc5);}(_0x7a98,0x7c));var _0x87a9=function(_0x147e5b,_0x5945f2){_0x147e5b=_0x147e5b-0x0;var _0x2af8af=_0x7a98[_0x147e5b];return _0x2af8af;};'use strict';var _=require(_0x87a9('0x0'));var util=require(_0x87a9('0x1'));var logger=require('../../config/logger')(_0x87a9('0x2'));var moment=require(_0x87a9('0x3'));var BPromise=require(_0x87a9('0x4'));var rp=require(_0x87a9('0x5'));var fs=require('fs');var path=require(_0x87a9('0x6'));var rimraf=require(_0x87a9('0x7'));var config=require(_0x87a9('0x8'));var attributes=require(_0x87a9('0x9'));module[_0x87a9('0xa')]=function(_0x509e92,_0x11c158){return _0x509e92['define'](_0x87a9('0xb'),attributes,{'tableName':_0x87a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12b0=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x12b0,0x7a));var _0x012b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x12b0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x012b('0x0'));var util=require(_0x012b('0x1'));var logger=require('../../config/logger')(_0x012b('0x2'));var moment=require(_0x012b('0x3'));var BPromise=require(_0x012b('0x4'));var rp=require(_0x012b('0x5'));var fs=require('fs');var path=require(_0x012b('0x6'));var rimraf=require(_0x012b('0x7'));var config=require('../../config/environment');var attributes=require(_0x012b('0x8'));module[_0x012b('0x9')]=function(_0xf748f,_0x471939){return _0xf748f[_0x012b('0xa')](_0x012b('0xb'),attributes,{'tableName':_0x012b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 54ccd5f..c8c5249 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 _0x4161=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x166956,_0x424097){var _0x1c757b=function(_0x2ea19b){while(--_0x2ea19b){_0x166956['push'](_0x166956['shift']());}};_0x1c757b(++_0x424097);}(_0x4161,0x1ca));var _0x1416=function(_0x3c1a71,_0x3515d2){_0x3c1a71=_0x3c1a71-0x0;var _0x503971=_0x4161[_0x3c1a71];return _0x503971;};'use strict';var _=require(_0x1416('0x0'));var util=require('util');var moment=require(_0x1416('0x1'));var BPromise=require(_0x1416('0x2'));var rs=require(_0x1416('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1416('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1416('0x5'))(_0x1416('0x6'));var config=require(_0x1416('0x7'));var jayson=require(_0x1416('0x8'));var client=jayson[_0x1416('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18dda1,_0x102130,_0xf25445){return new BPromise(function(_0x5b3976,_0x2f4d82){return client[_0x1416('0xa')](_0x18dda1,_0xf25445)[_0x1416('0xb')](function(_0x545d92){logger[_0x1416('0xc')](_0x1416('0xd'),_0x102130,_0x1416('0xe'));logger[_0x1416('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x102130,_0x1416('0xe'),JSON[_0x1416('0x10')](_0x545d92));if(_0x545d92['error']){if(_0x545d92['error'][_0x1416('0x11')]===0x1f4){logger[_0x1416('0x12')](_0x1416('0xd'),_0x102130,_0x545d92['error']['message']);return _0x2f4d82(_0x545d92['error'][_0x1416('0x13')]);}logger[_0x1416('0x12')](_0x1416('0xd'),_0x102130,_0x545d92[_0x1416('0x12')][_0x1416('0x13')]);return _0x5b3976(_0x545d92['error'][_0x1416('0x13')]);}else{logger['info'](_0x1416('0xd'),_0x102130,_0x1416('0xe'));_0x5b3976(_0x545d92['result'][_0x1416('0x13')]);}})[_0x1416('0x14')](function(_0x2879c5){logger[_0x1416('0x12')](_0x1416('0xd'),_0x102130,_0x2879c5);_0x2f4d82(_0x2879c5);});});} \ No newline at end of file +var _0x8134=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','ioredis'];(function(_0x239886,_0x1d149e){var _0x485f72=function(_0xe2b124){while(--_0xe2b124){_0x239886['push'](_0x239886['shift']());}};_0x485f72(++_0x1d149e);}(_0x8134,0xb1));var _0x4813=function(_0x1a8c0c,_0x58ee9e){_0x1a8c0c=_0x1a8c0c-0x0;var _0x2c108b=_0x8134[_0x1a8c0c];return _0x2c108b;};'use strict';var _=require('lodash');var util=require(_0x4813('0x0'));var moment=require('moment');var BPromise=require(_0x4813('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4813('0x2'));var db=require(_0x4813('0x3'))['db'];var utils=require(_0x4813('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4813('0x5'));var jayson=require(_0x4813('0x6'));var client=jayson[_0x4813('0x7')][_0x4813('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37a4ed,_0x560cd2,_0x4901b7){return new BPromise(function(_0x30a948,_0x14bf03){return client['request'](_0x37a4ed,_0x4901b7)[_0x4813('0x9')](function(_0x47a6be){logger[_0x4813('0xa')](_0x4813('0xb'),_0x560cd2,_0x4813('0xc'));logger[_0x4813('0xd')](_0x4813('0xe'),_0x560cd2,_0x4813('0xc'),JSON['stringify'](_0x47a6be));if(_0x47a6be[_0x4813('0xf')]){if(_0x47a6be[_0x4813('0xf')][_0x4813('0x10')]===0x1f4){logger[_0x4813('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x560cd2,_0x47a6be['error'][_0x4813('0x11')]);return _0x14bf03(_0x47a6be[_0x4813('0xf')][_0x4813('0x11')]);}logger['error'](_0x4813('0xb'),_0x560cd2,_0x47a6be[_0x4813('0xf')][_0x4813('0x11')]);return _0x30a948(_0x47a6be[_0x4813('0xf')]['message']);}else{logger[_0x4813('0xa')](_0x4813('0xb'),_0x560cd2,_0x4813('0xc'));_0x30a948(_0x47a6be[_0x4813('0x12')][_0x4813('0x11')]);}})[_0x4813('0x13')](function(_0x7c15f4){logger[_0x4813('0xf')](_0x4813('0xb'),_0x560cd2,_0x7c15f4);_0x14bf03(_0x7c15f4);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 1d1b1b0..cad2b5a 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 _0x9169=['./intVtigerField.controller','get','index','isAuthenticated','show','create','put','/:id','update','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x401609,_0x5eb61d){var _0x35fd57=function(_0x5dcddd){while(--_0x5dcddd){_0x401609['push'](_0x401609['shift']());}};_0x35fd57(++_0x5eb61d);}(_0x9169,0x82));var _0x9916=function(_0x36cd09,_0x2d5e2f){_0x36cd09=_0x36cd09-0x0;var _0x18fd1a=_0x9169[_0x36cd09];return _0x18fd1a;};'use strict';var multer=require(_0x9916('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9916('0x1'));var express=require(_0x9916('0x2'));var router=express[_0x9916('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9916('0x4'));var config=require(_0x9916('0x5'));var controller=require(_0x9916('0x6'));router[_0x9916('0x7')]('/',auth['isAuthenticated'](),controller[_0x9916('0x8')]);router['get']('/:id',auth[_0x9916('0x9')](),controller[_0x9916('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9916('0xb')]);router[_0x9916('0xc')](_0x9916('0xd'),auth[_0x9916('0x9')](),controller[_0x9916('0xe')]);router['delete'](_0x9916('0xd'),auth[_0x9916('0x9')](),controller[_0x9916('0xf')]);module[_0x9916('0x10')]=router; \ No newline at end of file +var _0xa996=['express','Router','../../components/auth/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy','multer','path','connect-timeout'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xa996,0x1ed));var _0x6a99=function(_0x3955c7,_0x5a892f){_0x3955c7=_0x3955c7-0x0;var _0x38cbb1=_0xa996[_0x3955c7];return _0x38cbb1;};'use strict';var multer=require(_0x6a99('0x0'));var util=require('util');var path=require(_0x6a99('0x1'));var timeout=require(_0x6a99('0x2'));var express=require(_0x6a99('0x3'));var router=express[_0x6a99('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6a99('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6a99('0x6'));router[_0x6a99('0x7')]('/',auth[_0x6a99('0x8')](),controller[_0x6a99('0x9')]);router['get'](_0x6a99('0xa'),auth[_0x6a99('0x8')](),controller['show']);router[_0x6a99('0xb')]('/',auth[_0x6a99('0x8')](),controller[_0x6a99('0xc')]);router[_0x6a99('0xd')](_0x6a99('0xa'),auth[_0x6a99('0x8')](),controller[_0x6a99('0xe')]);router['delete'](_0x6a99('0xa'),auth[_0x6a99('0x8')](),controller[_0x6a99('0xf')]);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 eb246c6..8cf623b 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 _0x7806=['keyValue','picklist','STRING','BOOLEAN','sequelize','variable','customVariable'];(function(_0x1477b4,_0x369d39){var _0x5b73c1=function(_0x176dd7){while(--_0x176dd7){_0x1477b4['push'](_0x1477b4['shift']());}};_0x5b73c1(++_0x369d39);}(_0x7806,0x17e));var _0x6780=function(_0x549362,_0x112273){_0x549362=_0x549362-0x0;var _0xdc3ae0=_0x7806[_0x549362];return _0xdc3ae0;};'use strict';var Sequelize=require(_0x6780('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x6780('0x1'),_0x6780('0x2'),_0x6780('0x3'),_0x6780('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6780('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x6780('0x1'),_0x6780('0x2'))},'keyContent':{'type':Sequelize[_0x6780('0x5')]},'idField':{'type':Sequelize[_0x6780('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6780('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6780('0x5')]}}; \ No newline at end of file +var _0xf837=['string','variable','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x552214,_0x272f86){var _0x3131a9=function(_0x3ddf50){while(--_0x3ddf50){_0x552214['push'](_0x552214['shift']());}};_0x3131a9(++_0x272f86);}(_0xf837,0x84));var _0x7f83=function(_0x1c6145,_0x410a9d){_0x1c6145=_0x1c6145-0x0;var _0x224655=_0xf837[_0x1c6145];return _0x224655;};'use strict';var Sequelize=require(_0x7f83('0x0'));module[_0x7f83('0x1')]={'type':{'type':Sequelize[_0x7f83('0x2')](_0x7f83('0x3'),_0x7f83('0x4'),'customVariable','keyValue',_0x7f83('0x5')),'defaultValue':_0x7f83('0x3')},'content':{'type':Sequelize[_0x7f83('0x6')]},'key':{'type':Sequelize[_0x7f83('0x6')]},'keyType':{'type':Sequelize[_0x7f83('0x2')]('string','variable',_0x7f83('0x7'))},'keyContent':{'type':Sequelize[_0x7f83('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7f83('0x6')]},'customField':{'type':Sequelize[_0x7f83('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 72fc6a5..505ce35 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 _0x0889=['status','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','includeAll','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','end'];(function(_0x222d8e,_0x2901ee){var _0x38e28c=function(_0x1ab58f){while(--_0x1ab58f){_0x222d8e['push'](_0x222d8e['shift']());}};_0x38e28c(++_0x2901ee);}(_0x0889,0x10c));var _0x9088=function(_0x265f76,_0x57e292){_0x265f76=_0x265f76-0x0;var _0xa0be95=_0x0889[_0x265f76];return _0xa0be95;};'use strict';var emlformat=require(_0x9088('0x0'));var rimraf=require(_0x9088('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9088('0x2'));var rp=require(_0x9088('0x3'));var moment=require(_0x9088('0x4'));var BPromise=require(_0x9088('0x5'));var Mustache=require(_0x9088('0x6'));var util=require(_0x9088('0x7'));var path=require(_0x9088('0x8'));var sox=require(_0x9088('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9088('0xa'));var _=require(_0x9088('0xb'));var squel=require(_0x9088('0xc'));var crypto=require(_0x9088('0xd'));var jsforce=require(_0x9088('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9088('0xf'));var querystring=require(_0x9088('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9088('0x11'));var as=require(_0x9088('0x12'));var hardwareService=require(_0x9088('0x13'));var logger=require(_0x9088('0x14'))(_0x9088('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9088('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf7d161,_0x5f30aa){_0x5f30aa=_0x5f30aa||0xcc;return function(_0x5305df){if(_0x5305df){return _0xf7d161['sendStatus'](_0x5f30aa);}return _0xf7d161['status'](_0x5f30aa)[_0x9088('0x17')]();};}function respondWithResult(_0x5cd3d0,_0x2dc488){_0x2dc488=_0x2dc488||0xc8;return function(_0x223714){if(_0x223714){return _0x5cd3d0[_0x9088('0x18')](_0x2dc488)[_0x9088('0x19')](_0x223714);}};}function respondWithFilteredResult(_0x6d5c19,_0x27977d){return function(_0x251f23){if(_0x251f23){var _0x2e7cbb=typeof _0x27977d[_0x9088('0x1a')]==='undefined'&&typeof _0x27977d['limit']===_0x9088('0x1b');var _0x108553=_0x251f23[_0x9088('0x1c')];var _0x5c911a=_0x2e7cbb?0x0:_0x27977d[_0x9088('0x1a')];var _0x3ce5bf=_0x2e7cbb?_0x251f23[_0x9088('0x1c')]:_0x27977d[_0x9088('0x1a')]+_0x27977d[_0x9088('0x1d')];var _0x3fac8d;if(_0x3ce5bf>=_0x108553){_0x3ce5bf=_0x108553;_0x3fac8d=0xc8;}else{_0x3fac8d=0xce;}_0x6d5c19[_0x9088('0x18')](_0x3fac8d);return _0x6d5c19[_0x9088('0x1e')](_0x9088('0x1f'),_0x5c911a+'-'+_0x3ce5bf+'/'+_0x108553)[_0x9088('0x19')](_0x251f23);}return null;};}function patchUpdates(_0x47e283){return function(_0x2375a0){try{jsonpatch['apply'](_0x2375a0,_0x47e283,!![]);}catch(_0x4a5440){return BPromise[_0x9088('0x20')](_0x4a5440);}return _0x2375a0['save']();};}function saveUpdates(_0x38b1f7,_0x289709){return function(_0x17539c){if(_0x17539c){return _0x17539c[_0x9088('0x21')](_0x38b1f7)[_0x9088('0x22')](function(_0x4fda2a){return _0x4fda2a;});}return null;};}function removeEntity(_0x58de72,_0x189d38){return function(_0x5da180){if(_0x5da180){return _0x5da180[_0x9088('0x23')]()[_0x9088('0x22')](function(){_0x58de72['status'](0xcc)[_0x9088('0x17')]();});}};}function handleEntityNotFound(_0x76cd90,_0x56b5bc){return function(_0x7cf088){if(!_0x7cf088){_0x76cd90[_0x9088('0x24')](0x194);}return _0x7cf088;};}function handleError(_0x161899,_0x49dbe6){_0x49dbe6=_0x49dbe6||0x1f4;return function(_0x13d5be){logger[_0x9088('0x25')](_0x13d5be[_0x9088('0x26')]);if(_0x13d5be[_0x9088('0x27')]){delete _0x13d5be['name'];}_0x161899[_0x9088('0x18')](_0x49dbe6)[_0x9088('0x28')](_0x13d5be);};}exports[_0x9088('0x29')]=function(_0x476eff,_0x17182e){var _0x1018c4={},_0x3c6d43={},_0x117107={'count':0x0,'rows':[]};var _0x16b841=_[_0x9088('0x2a')](db[_0x9088('0x2b')][_0x9088('0x2c')],function(_0x4cebb1){return{'name':_0x4cebb1[_0x9088('0x2d')],'type':_0x4cebb1[_0x9088('0x2e')][_0x9088('0x2f')]};});_0x3c6d43['model']=_[_0x9088('0x2a')](_0x16b841,'name');_0x3c6d43[_0x9088('0x30')]=_[_0x9088('0x31')](_0x476eff[_0x9088('0x30')]);_0x3c6d43[_0x9088('0x32')]=_[_0x9088('0x33')](_0x3c6d43[_0x9088('0x34')],_0x3c6d43[_0x9088('0x30')]);_0x1018c4[_0x9088('0x35')]=_[_0x9088('0x33')](_0x3c6d43['model'],qs[_0x9088('0x36')](_0x476eff[_0x9088('0x30')][_0x9088('0x36')]));_0x1018c4['attributes']=_0x1018c4[_0x9088('0x35')][_0x9088('0x37')]?_0x1018c4[_0x9088('0x35')]:_0x3c6d43[_0x9088('0x34')];if(!_0x476eff['query']['hasOwnProperty'](_0x9088('0x38'))){_0x1018c4[_0x9088('0x1d')]=qs[_0x9088('0x1d')](_0x476eff['query'][_0x9088('0x1d')]);_0x1018c4['offset']=qs[_0x9088('0x1a')](_0x476eff[_0x9088('0x30')][_0x9088('0x1a')]);}_0x1018c4['order']=qs[_0x9088('0x39')](_0x476eff[_0x9088('0x30')][_0x9088('0x39')]);_0x1018c4['where']=qs['filters'](_[_0x9088('0x3a')](_0x476eff['query'],_0x3c6d43[_0x9088('0x32')]),_0x16b841);if(_0x476eff[_0x9088('0x30')]['filter']){_0x1018c4[_0x9088('0x3b')]=_[_0x9088('0x3c')](_0x1018c4[_0x9088('0x3b')],{'$or':_[_0x9088('0x2a')](_0x16b841,function(_0x123aa3){if(_0x123aa3[_0x9088('0x2e')]!==_0x9088('0x3d')){var _0x24c46b={};_0x24c46b[_0x123aa3[_0x9088('0x27')]]={'$like':'%'+_0x476eff[_0x9088('0x30')][_0x9088('0x3e')]+'%'};return _0x24c46b;}})});}_0x1018c4=_[_0x9088('0x3c')]({},_0x1018c4,_0x476eff[_0x9088('0x3f')]);var _0x3ddf75={'where':_0x1018c4[_0x9088('0x3b')]};return db['VtigerField'][_0x9088('0x1c')](_0x3ddf75)['then'](function(_0x621703){_0x117107[_0x9088('0x1c')]=_0x621703;if(_0x476eff[_0x9088('0x30')]['includeAll']){_0x1018c4[_0x9088('0x40')]=[{'all':!![]}];}return db['VtigerField'][_0x9088('0x41')](_0x1018c4);})[_0x9088('0x22')](function(_0x10d353){_0x117107[_0x9088('0x42')]=_0x10d353;return _0x117107;})['then'](respondWithFilteredResult(_0x17182e,_0x1018c4))[_0x9088('0x43')](handleError(_0x17182e,null));};exports['show']=function(_0x36c4d7,_0xe34a03){var _0x381d51={'raw':!![],'where':{'id':_0x36c4d7['params']['id']}},_0x12ed67={};_0x12ed67[_0x9088('0x34')]=_[_0x9088('0x31')](db[_0x9088('0x2b')][_0x9088('0x2c')]);_0x12ed67[_0x9088('0x30')]=_[_0x9088('0x31')](_0x36c4d7[_0x9088('0x30')]);_0x12ed67[_0x9088('0x32')]=_[_0x9088('0x33')](_0x12ed67[_0x9088('0x34')],_0x12ed67[_0x9088('0x30')]);_0x381d51['attributes']=_[_0x9088('0x33')](_0x12ed67['model'],qs[_0x9088('0x36')](_0x36c4d7['query'][_0x9088('0x36')]));_0x381d51[_0x9088('0x35')]=_0x381d51[_0x9088('0x35')][_0x9088('0x37')]?_0x381d51[_0x9088('0x35')]:_0x12ed67[_0x9088('0x34')];if(_0x36c4d7[_0x9088('0x30')][_0x9088('0x44')]){_0x381d51[_0x9088('0x40')]=[{'all':!![]}];}_0x381d51=_['merge']({},_0x381d51,_0x36c4d7[_0x9088('0x3f')]);return db['VtigerField']['find'](_0x381d51)[_0x9088('0x22')](handleEntityNotFound(_0xe34a03,null))[_0x9088('0x22')](respondWithResult(_0xe34a03,null))[_0x9088('0x43')](handleError(_0xe34a03,null));};exports[_0x9088('0x45')]=function(_0x1658eb,_0x115992){return db[_0x9088('0x2b')][_0x9088('0x45')](_0x1658eb['body'],{})[_0x9088('0x22')](respondWithResult(_0x115992,0xc9))['catch'](handleError(_0x115992,null));};exports[_0x9088('0x21')]=function(_0x55cbc3,_0x24480c){if(_0x55cbc3[_0x9088('0x46')]['id']){delete _0x55cbc3[_0x9088('0x46')]['id'];}return db[_0x9088('0x2b')][_0x9088('0x47')]({'where':{'id':_0x55cbc3['params']['id']}})[_0x9088('0x22')](handleEntityNotFound(_0x24480c,null))[_0x9088('0x22')](saveUpdates(_0x55cbc3[_0x9088('0x46')],null))[_0x9088('0x22')](respondWithResult(_0x24480c,null))[_0x9088('0x43')](handleError(_0x24480c,null));};exports[_0x9088('0x23')]=function(_0x30a323,_0x15e43c){return db['VtigerField']['find']({'where':{'id':_0x30a323[_0x9088('0x48')]['id']}})[_0x9088('0x22')](handleEntityNotFound(_0x15e43c,null))['then'](removeEntity(_0x15e43c,null))[_0x9088('0x43')](handleError(_0x15e43c,null));}; \ No newline at end of file +var _0x3de4=['map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','VtigerField','rows','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','model'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0x3de4,0xab));var _0x43de=function(_0x643324,_0x1f51af){_0x643324=_0x643324-0x0;var _0x56f4cc=_0x3de4[_0x643324];return _0x56f4cc;};'use strict';var emlformat=require(_0x43de('0x0'));var rimraf=require(_0x43de('0x1'));var zipdir=require(_0x43de('0x2'));var jsonpatch=require(_0x43de('0x3'));var rp=require(_0x43de('0x4'));var moment=require(_0x43de('0x5'));var BPromise=require(_0x43de('0x6'));var Mustache=require(_0x43de('0x7'));var util=require(_0x43de('0x8'));var path=require(_0x43de('0x9'));var sox=require('sox');var csv=require(_0x43de('0xa'));var ejs=require(_0x43de('0xb'));var fs=require('fs');var fs_extra=require(_0x43de('0xc'));var _=require(_0x43de('0xd'));var squel=require(_0x43de('0xe'));var crypto=require(_0x43de('0xf'));var jsforce=require(_0x43de('0x10'));var deskjs=require(_0x43de('0x11'));var toCsv=require(_0x43de('0xa'));var querystring=require(_0x43de('0x12'));var Papa=require('papaparse');var Redis=require(_0x43de('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x43de('0x14'));var hardwareService=require(_0x43de('0x15'));var logger=require('../../config/logger')(_0x43de('0x16'));var utils=require(_0x43de('0x17'));var config=require(_0x43de('0x18'));var licenseUtil=require(_0x43de('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x498f5f,_0x3f1071){_0x3f1071=_0x3f1071||0xcc;return function(_0x5de63e){if(_0x5de63e){return _0x498f5f[_0x43de('0x1a')](_0x3f1071);}return _0x498f5f[_0x43de('0x1b')](_0x3f1071)[_0x43de('0x1c')]();};}function respondWithResult(_0x346b9f,_0x564b08){_0x564b08=_0x564b08||0xc8;return function(_0x3f9532){if(_0x3f9532){return _0x346b9f['status'](_0x564b08)[_0x43de('0x1d')](_0x3f9532);}};}function respondWithFilteredResult(_0x59e053,_0x5a9514){return function(_0x27b694){if(_0x27b694){var _0x4c03cd=typeof _0x5a9514['offset']===_0x43de('0x1e')&&typeof _0x5a9514['limit']===_0x43de('0x1e');var _0x59db15=_0x27b694[_0x43de('0x1f')];var _0x4fb406=_0x4c03cd?0x0:_0x5a9514['offset'];var _0x54a5fa=_0x4c03cd?_0x27b694['count']:_0x5a9514[_0x43de('0x20')]+_0x5a9514[_0x43de('0x21')];var _0x187f93;if(_0x54a5fa>=_0x59db15){_0x54a5fa=_0x59db15;_0x187f93=0xc8;}else{_0x187f93=0xce;}_0x59e053[_0x43de('0x1b')](_0x187f93);return _0x59e053[_0x43de('0x22')](_0x43de('0x23'),_0x4fb406+'-'+_0x54a5fa+'/'+_0x59db15)[_0x43de('0x1d')](_0x27b694);}return null;};}function patchUpdates(_0x4d5cdb){return function(_0x1fbde9){try{jsonpatch[_0x43de('0x24')](_0x1fbde9,_0x4d5cdb,!![]);}catch(_0x423be5){return BPromise[_0x43de('0x25')](_0x423be5);}return _0x1fbde9['save']();};}function saveUpdates(_0x3f0d1a,_0x255c94){return function(_0x2701fe){if(_0x2701fe){return _0x2701fe[_0x43de('0x26')](_0x3f0d1a)[_0x43de('0x27')](function(_0x952e7){return _0x952e7;});}return null;};}function removeEntity(_0x4a5e2d,_0x2e0a37){return function(_0x182e18){if(_0x182e18){return _0x182e18[_0x43de('0x28')]()['then'](function(){_0x4a5e2d[_0x43de('0x1b')](0xcc)[_0x43de('0x1c')]();});}};}function handleEntityNotFound(_0x228aae,_0x112141){return function(_0x34add8){if(!_0x34add8){_0x228aae['sendStatus'](0x194);}return _0x34add8;};}function handleError(_0x4dd5da,_0x5e32a1){_0x5e32a1=_0x5e32a1||0x1f4;return function(_0x2f62e4){logger['error'](_0x2f62e4[_0x43de('0x29')]);if(_0x2f62e4[_0x43de('0x2a')]){delete _0x2f62e4[_0x43de('0x2a')];}_0x4dd5da['status'](_0x5e32a1)[_0x43de('0x2b')](_0x2f62e4);};}exports['index']=function(_0x319177,_0x4c3350){var _0x3aa27b={},_0x1db5ca={},_0x16c22e={'count':0x0,'rows':[]};var _0x32fe0c=_['map'](db['VtigerField'][_0x43de('0x2c')],function(_0x2ef646){return{'name':_0x2ef646[_0x43de('0x2d')],'type':_0x2ef646[_0x43de('0x2e')]['key']};});_0x1db5ca[_0x43de('0x2f')]=_[_0x43de('0x30')](_0x32fe0c,_0x43de('0x2a'));_0x1db5ca[_0x43de('0x31')]=_['keys'](_0x319177[_0x43de('0x31')]);_0x1db5ca[_0x43de('0x32')]=_[_0x43de('0x33')](_0x1db5ca[_0x43de('0x2f')],_0x1db5ca[_0x43de('0x31')]);_0x3aa27b['attributes']=_['intersection'](_0x1db5ca[_0x43de('0x2f')],qs[_0x43de('0x34')](_0x319177['query'][_0x43de('0x34')]));_0x3aa27b[_0x43de('0x35')]=_0x3aa27b['attributes'][_0x43de('0x36')]?_0x3aa27b[_0x43de('0x35')]:_0x1db5ca['model'];if(!_0x319177[_0x43de('0x31')]['hasOwnProperty'](_0x43de('0x37'))){_0x3aa27b[_0x43de('0x21')]=qs['limit'](_0x319177['query'][_0x43de('0x21')]);_0x3aa27b['offset']=qs['offset'](_0x319177[_0x43de('0x31')]['offset']);}_0x3aa27b[_0x43de('0x38')]=qs[_0x43de('0x39')](_0x319177[_0x43de('0x31')]['sort']);_0x3aa27b[_0x43de('0x3a')]=qs[_0x43de('0x32')](_[_0x43de('0x3b')](_0x319177[_0x43de('0x31')],_0x1db5ca[_0x43de('0x32')]),_0x32fe0c);if(_0x319177['query'][_0x43de('0x3c')]){_0x3aa27b['where']=_['merge'](_0x3aa27b['where'],{'$or':_['map'](_0x32fe0c,function(_0x261ba8){if(_0x261ba8[_0x43de('0x2e')]!==_0x43de('0x3d')){var _0x18dffd={};_0x18dffd[_0x261ba8[_0x43de('0x2a')]]={'$like':'%'+_0x319177['query'][_0x43de('0x3c')]+'%'};return _0x18dffd;}})});}_0x3aa27b=_[_0x43de('0x3e')]({},_0x3aa27b,_0x319177[_0x43de('0x3f')]);var _0x84992c={'where':_0x3aa27b[_0x43de('0x3a')]};return db['VtigerField']['count'](_0x84992c)[_0x43de('0x27')](function(_0x4149d9){_0x16c22e[_0x43de('0x1f')]=_0x4149d9;if(_0x319177[_0x43de('0x31')][_0x43de('0x40')]){_0x3aa27b[_0x43de('0x41')]=[{'all':!![]}];}return db[_0x43de('0x42')]['findAll'](_0x3aa27b);})[_0x43de('0x27')](function(_0x3ef0ca){_0x16c22e[_0x43de('0x43')]=_0x3ef0ca;return _0x16c22e;})[_0x43de('0x27')](respondWithFilteredResult(_0x4c3350,_0x3aa27b))['catch'](handleError(_0x4c3350,null));};exports['show']=function(_0x95e9b8,_0x40e15d){var _0x564185={'raw':!![],'where':{'id':_0x95e9b8[_0x43de('0x44')]['id']}},_0x1409e5={};_0x1409e5[_0x43de('0x2f')]=_['keys'](db['VtigerField'][_0x43de('0x2c')]);_0x1409e5[_0x43de('0x31')]=_['keys'](_0x95e9b8['query']);_0x1409e5[_0x43de('0x32')]=_[_0x43de('0x33')](_0x1409e5[_0x43de('0x2f')],_0x1409e5[_0x43de('0x31')]);_0x564185['attributes']=_[_0x43de('0x33')](_0x1409e5[_0x43de('0x2f')],qs['fields'](_0x95e9b8[_0x43de('0x31')]['fields']));_0x564185[_0x43de('0x35')]=_0x564185[_0x43de('0x35')][_0x43de('0x36')]?_0x564185[_0x43de('0x35')]:_0x1409e5[_0x43de('0x2f')];if(_0x95e9b8['query'][_0x43de('0x40')]){_0x564185['include']=[{'all':!![]}];}_0x564185=_[_0x43de('0x3e')]({},_0x564185,_0x95e9b8[_0x43de('0x3f')]);return db[_0x43de('0x42')][_0x43de('0x45')](_0x564185)[_0x43de('0x27')](handleEntityNotFound(_0x40e15d,null))['then'](respondWithResult(_0x40e15d,null))[_0x43de('0x46')](handleError(_0x40e15d,null));};exports[_0x43de('0x47')]=function(_0xdd828b,_0x16f725){return db['VtigerField'][_0x43de('0x47')](_0xdd828b['body'],{})[_0x43de('0x27')](respondWithResult(_0x16f725,0xc9))[_0x43de('0x46')](handleError(_0x16f725,null));};exports['update']=function(_0x5894b1,_0x1c4781){if(_0x5894b1[_0x43de('0x48')]['id']){delete _0x5894b1[_0x43de('0x48')]['id'];}return db[_0x43de('0x42')]['find']({'where':{'id':_0x5894b1[_0x43de('0x44')]['id']}})[_0x43de('0x27')](handleEntityNotFound(_0x1c4781,null))[_0x43de('0x27')](saveUpdates(_0x5894b1[_0x43de('0x48')],null))[_0x43de('0x27')](respondWithResult(_0x1c4781,null))[_0x43de('0x46')](handleError(_0x1c4781,null));};exports[_0x43de('0x28')]=function(_0x127663,_0x5d1402){return db[_0x43de('0x42')][_0x43de('0x45')]({'where':{'id':_0x127663[_0x43de('0x44')]['id']}})[_0x43de('0x27')](handleEntityNotFound(_0x5d1402,null))[_0x43de('0x27')](removeEntity(_0x5d1402,null))[_0x43de('0x46')](handleError(_0x5d1402,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 14676aa..2fb7597 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 _0x4fa0=['exports','define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x4fa0,0xba));var _0x04fa=function(_0xa6cb09,_0x39410f){_0xa6cb09=_0xa6cb09-0x0;var _0x12b437=_0x4fa0[_0xa6cb09];return _0x12b437;};'use strict';var _=require('lodash');var util=require(_0x04fa('0x0'));var logger=require('../../config/logger')(_0x04fa('0x1'));var moment=require(_0x04fa('0x2'));var BPromise=require(_0x04fa('0x3'));var rp=require(_0x04fa('0x4'));var fs=require('fs');var path=require(_0x04fa('0x5'));var rimraf=require(_0x04fa('0x6'));var config=require(_0x04fa('0x7'));var attributes=require(_0x04fa('0x8'));module[_0x04fa('0x9')]=function(_0x2c742d,_0x4c2b89){return _0x2c742d[_0x04fa('0xa')]('VtigerField',attributes,{'tableName':_0x04fa('0xb'),'paranoid':![],'indexes':[{'name':_0x04fa('0xc'),'fields':[_0x04fa('0xd'),_0x04fa('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x45b5=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','idField','FieldId','lodash','util','api','moment'];(function(_0x875767,_0x3b3b94){var _0x13ec0d=function(_0x585958){while(--_0x585958){_0x875767['push'](_0x875767['shift']());}};_0x13ec0d(++_0x3b3b94);}(_0x45b5,0xec));var _0x545b=function(_0x466190,_0x516eec){_0x466190=_0x466190-0x0;var _0x22398e=_0x45b5[_0x466190];return _0x22398e;};'use strict';var _=require(_0x545b('0x0'));var util=require(_0x545b('0x1'));var logger=require('../../config/logger')(_0x545b('0x2'));var moment=require(_0x545b('0x3'));var BPromise=require(_0x545b('0x4'));var rp=require(_0x545b('0x5'));var fs=require('fs');var path=require(_0x545b('0x6'));var rimraf=require(_0x545b('0x7'));var config=require(_0x545b('0x8'));var attributes=require(_0x545b('0x9'));module[_0x545b('0xa')]=function(_0x3f24cf,_0xf5532e){return _0x3f24cf[_0x545b('0xb')]('VtigerField',attributes,{'tableName':_0x545b('0xc'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x545b('0xd'),_0x545b('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 29462d6..5e2b0d4 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 _0x0495=['request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x0495,0x126));var _0x5049=function(_0x1a42c5,_0x3c0b08){_0x1a42c5=_0x1a42c5-0x0;var _0x3dd436=_0x0495[_0x1a42c5];return _0x3dd436;};'use strict';var _=require('lodash');var util=require(_0x5049('0x0'));var moment=require('moment');var BPromise=require(_0x5049('0x1'));var rs=require(_0x5049('0x2'));var fs=require('fs');var Redis=require(_0x5049('0x3'));var db=require(_0x5049('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5049('0x5'));var config=require(_0x5049('0x6'));var jayson=require(_0x5049('0x7'));var client=jayson[_0x5049('0x8')][_0x5049('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10d6a8,_0x4111c1,_0x4e97c7){return new BPromise(function(_0x2e5d09,_0x4fe6f2){return client[_0x5049('0xa')](_0x10d6a8,_0x4e97c7)[_0x5049('0xb')](function(_0xeeae8c){logger[_0x5049('0xc')](_0x5049('0xd'),_0x4111c1,_0x5049('0xe'));logger[_0x5049('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x4111c1,'request\x20sent',JSON[_0x5049('0x10')](_0xeeae8c));if(_0xeeae8c['error']){if(_0xeeae8c[_0x5049('0x11')][_0x5049('0x12')]===0x1f4){logger['error'](_0x5049('0xd'),_0x4111c1,_0xeeae8c[_0x5049('0x11')]['message']);return _0x4fe6f2(_0xeeae8c[_0x5049('0x11')][_0x5049('0x13')]);}logger[_0x5049('0x11')](_0x5049('0xd'),_0x4111c1,_0xeeae8c[_0x5049('0x11')]['message']);return _0x2e5d09(_0xeeae8c[_0x5049('0x11')][_0x5049('0x13')]);}else{logger[_0x5049('0xc')](_0x5049('0xd'),_0x4111c1,_0x5049('0xe'));_0x2e5d09(_0xeeae8c[_0x5049('0x14')]['message']);}})[_0x5049('0x15')](function(_0x1205a7){logger['error'](_0x5049('0xd'),_0x4111c1,_0x1205a7);_0x4fe6f2(_0x1205a7);});});} \ No newline at end of file +var _0x629d=['debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent'];(function(_0x4a4fd8,_0x3d3ee7){var _0x236fcd=function(_0x2b663e){while(--_0x2b663e){_0x4a4fd8['push'](_0x4a4fd8['shift']());}};_0x236fcd(++_0x3d3ee7);}(_0x629d,0xa1));var _0xd629=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x629d[_0x25248b];return _0x509939;};'use strict';var _=require(_0xd629('0x0'));var util=require(_0xd629('0x1'));var moment=require(_0xd629('0x2'));var BPromise=require(_0xd629('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd629('0x4'))['db'];var utils=require(_0xd629('0x5'));var logger=require(_0xd629('0x6'))(_0xd629('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd629('0x8')][_0xd629('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2abf4a,_0x15838e,_0x523a6f){return new BPromise(function(_0x51cc23,_0x34f90a){return client[_0xd629('0xa')](_0x2abf4a,_0x523a6f)[_0xd629('0xb')](function(_0x5059e3){logger[_0xd629('0xc')](_0xd629('0xd'),_0x15838e,_0xd629('0xe'));logger[_0xd629('0xf')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x15838e,_0xd629('0xe'),JSON[_0xd629('0x10')](_0x5059e3));if(_0x5059e3[_0xd629('0x11')]){if(_0x5059e3[_0xd629('0x11')][_0xd629('0x12')]===0x1f4){logger[_0xd629('0x11')]('VtigerField,\x20%s,\x20%s',_0x15838e,_0x5059e3['error'][_0xd629('0x13')]);return _0x34f90a(_0x5059e3[_0xd629('0x11')]['message']);}logger[_0xd629('0x11')](_0xd629('0xd'),_0x15838e,_0x5059e3[_0xd629('0x11')][_0xd629('0x13')]);return _0x51cc23(_0x5059e3[_0xd629('0x11')]['message']);}else{logger[_0xd629('0xc')](_0xd629('0xd'),_0x15838e,_0xd629('0xe'));_0x51cc23(_0x5059e3[_0xd629('0x14')][_0xd629('0x13')]);}})[_0xd629('0x15')](function(_0x5d2531){logger[_0xd629('0x11')](_0xd629('0xd'),_0x15838e,_0x5d2531);_0x34f90a(_0x5d2531);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 974475e..983271a 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 _0x3007=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','multer','util'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0x3007,0xf0));var _0x7300=function(_0x19a6b4,_0x300963){_0x19a6b4=_0x19a6b4-0x0;var _0x554ca5=_0x3007[_0x19a6b4];return _0x554ca5;};'use strict';var multer=require(_0x7300('0x0'));var util=require(_0x7300('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7300('0x2'));var router=express[_0x7300('0x3')]();var fs_extra=require(_0x7300('0x4'));var auth=require(_0x7300('0x5'));var interaction=require(_0x7300('0x6'));var config=require(_0x7300('0x7'));var controller=require(_0x7300('0x8'));router[_0x7300('0x9')]('/',auth[_0x7300('0xa')](),controller[_0x7300('0xb')]);router[_0x7300('0x9')](_0x7300('0xc'),auth[_0x7300('0xa')](),controller['show']);router[_0x7300('0x9')]('/:id/configurations',auth[_0x7300('0xa')](),controller[_0x7300('0xd')]);router[_0x7300('0x9')](_0x7300('0xe'),auth[_0x7300('0xa')](),controller[_0x7300('0xf')]);router[_0x7300('0x10')]('/',auth[_0x7300('0xa')](),controller['create']);router[_0x7300('0x10')]('/:id/configurations',auth[_0x7300('0xa')](),controller[_0x7300('0x11')]);router[_0x7300('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x7300('0x13')]);router[_0x7300('0x14')](_0x7300('0xc'),auth[_0x7300('0xa')](),controller[_0x7300('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf19c=['/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x2c31d7,_0x221c7b){var _0x113207=function(_0x12293f){while(--_0x12293f){_0x2c31d7['push'](_0x2c31d7['shift']());}};_0x113207(++_0x221c7b);}(_0xf19c,0x10b));var _0xcf19=function(_0x5f1541,_0x369ad6){_0x5f1541=_0x5f1541-0x0;var _0x132790=_0xf19c[_0x5f1541];return _0x132790;};'use strict';var multer=require(_0xcf19('0x0'));var util=require(_0xcf19('0x1'));var path=require(_0xcf19('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf19('0x3'));var router=express[_0xcf19('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcf19('0x5'));var interaction=require(_0xcf19('0x6'));var config=require(_0xcf19('0x7'));var controller=require(_0xcf19('0x8'));router[_0xcf19('0x9')]('/',auth['isAuthenticated'](),controller[_0xcf19('0xa')]);router[_0xcf19('0x9')](_0xcf19('0xb'),auth[_0xcf19('0xc')](),controller[_0xcf19('0xd')]);router[_0xcf19('0x9')]('/:id/configurations',auth[_0xcf19('0xc')](),controller[_0xcf19('0xe')]);router[_0xcf19('0x9')](_0xcf19('0xf'),auth[_0xcf19('0xc')](),controller[_0xcf19('0x10')]);router[_0xcf19('0x11')]('/',auth[_0xcf19('0xc')](),controller[_0xcf19('0x12')]);router['post'](_0xcf19('0x13'),auth[_0xcf19('0xc')](),controller[_0xcf19('0x14')]);router[_0xcf19('0x15')](_0xcf19('0xb'),auth[_0xcf19('0xc')](),controller[_0xcf19('0x16')]);router[_0xcf19('0x17')](_0xcf19('0xb'),auth[_0xcf19('0xc')](),controller[_0xcf19('0x18')]);module[_0xcf19('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index c0c756a..3f2465a 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 _0x4ccb=['remoteUri','password','token','ENUM','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x3ad737,_0x300131){var _0x16c1e2=function(_0x4c64fe){while(--_0x4c64fe){_0x3ad737['push'](_0x3ad737['shift']());}};_0x16c1e2(++_0x300131);}(_0x4ccb,0x196));var _0xb4cc=function(_0x4fd84c,_0x2df434){_0x4fd84c=_0x4fd84c-0x0;var _0x35b849=_0x4ccb[_0x4fd84c];return _0x35b849;};'use strict';var Sequelize=require(_0xb4cc('0x0'));module[_0xb4cc('0x1')]={'name':{'type':Sequelize[_0xb4cc('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb4cc('0x2')],'unique':_0xb4cc('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xb4cc('0x2')]},'remoteUri':{'type':Sequelize[_0xb4cc('0x2')],'unique':_0xb4cc('0x4')},'authType':{'type':Sequelize['ENUM'](_0xb4cc('0x5'),_0xb4cc('0x6')),'defaultValue':_0xb4cc('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb4cc('0x7')](_0xb4cc('0x8'),_0xb4cc('0x9')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xe944=['password','token','integrationTab','newTab','sequelize','STRING','remoteUri','ENUM'];(function(_0x4671e3,_0x52202e){var _0x3c3a80=function(_0x361e1d){while(--_0x361e1d){_0x4671e3['push'](_0x4671e3['shift']());}};_0x3c3a80(++_0x52202e);}(_0xe944,0x174));var _0x4e94=function(_0x40c59e,_0x129ce0){_0x40c59e=_0x40c59e-0x0;var _0x58b432=_0xe944[_0x40c59e];return _0x58b432;};'use strict';var Sequelize=require(_0x4e94('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4e94('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x4e94('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4e94('0x2')},'authType':{'type':Sequelize[_0x4e94('0x3')](_0x4e94('0x4'),_0x4e94('0x5')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x4e94('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4e94('0x3')](_0x4e94('0x6'),_0x4e94('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 50e5bac..50164ec 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 _0xeb74=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','filter','AccountId','channel','Descriptions','ZendeskField','Subjects','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','%s:%s','toString','base64','Basic\x20%s','%s/token:%s','Sequelize','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xeb74,0xe3));var _0x4eb7=function(_0x43969a,_0x43341e){_0x43969a=_0x43969a-0x0;var _0x5a377e=_0xeb74[_0x43969a];return _0x5a377e;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];var integrations=require(_0x4eb7('0x19'));function respondWithStatusCode(_0x4194e1,_0x3c9f45){_0x3c9f45=_0x3c9f45||0xcc;return function(_0x4c27a4){if(_0x4c27a4){return _0x4194e1['sendStatus'](_0x3c9f45);}return _0x4194e1['status'](_0x3c9f45)[_0x4eb7('0x1a')]();};}function respondWithResult(_0x51f09d,_0x84c68b){_0x84c68b=_0x84c68b||0xc8;return function(_0x119afa){if(_0x119afa){return _0x51f09d[_0x4eb7('0x1b')](_0x84c68b)[_0x4eb7('0x1c')](_0x119afa);}};}function respondWithFilteredResult(_0x5d6d5,_0x21433d){return function(_0x11674f){if(_0x11674f){var _0x76988=typeof _0x21433d[_0x4eb7('0x1d')]===_0x4eb7('0x1e')&&typeof _0x21433d['limit']===_0x4eb7('0x1e');var _0x11ac9f=_0x11674f[_0x4eb7('0x1f')];var _0xf14478=_0x76988?0x0:_0x21433d[_0x4eb7('0x1d')];var _0x44f1b9=_0x76988?_0x11674f[_0x4eb7('0x1f')]:_0x21433d[_0x4eb7('0x1d')]+_0x21433d['limit'];var _0x3cf53a;if(_0x44f1b9>=_0x11ac9f){_0x44f1b9=_0x11ac9f;_0x3cf53a=0xc8;}else{_0x3cf53a=0xce;}_0x5d6d5[_0x4eb7('0x1b')](_0x3cf53a);return _0x5d6d5[_0x4eb7('0x20')](_0x4eb7('0x21'),_0xf14478+'-'+_0x44f1b9+'/'+_0x11ac9f)[_0x4eb7('0x1c')](_0x11674f);}return null;};}function patchUpdates(_0x2efd67){return function(_0x11fb0a){try{jsonpatch['apply'](_0x11fb0a,_0x2efd67,!![]);}catch(_0x214a28){return BPromise[_0x4eb7('0x22')](_0x214a28);}return _0x11fb0a[_0x4eb7('0x23')]();};}function saveUpdates(_0x164515,_0x14a7be){return function(_0x1b4640){if(_0x1b4640){return _0x1b4640[_0x4eb7('0x24')](_0x164515)[_0x4eb7('0x25')](function(_0x1a2b8b){return _0x1a2b8b;});}return null;};}function removeEntity(_0x13e871,_0x4de2d9){return function(_0x3e72cd){if(_0x3e72cd){return _0x3e72cd[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x13e871[_0x4eb7('0x1b')](0xcc)[_0x4eb7('0x1a')]();});}};}function handleEntityNotFound(_0x25eb74,_0x365060){return function(_0xe9db8){if(!_0xe9db8){_0x25eb74[_0x4eb7('0x27')](0x194);}return _0xe9db8;};}function handleError(_0x248759,_0xf83c11){_0xf83c11=_0xf83c11||0x1f4;return function(_0x2984b2){logger[_0x4eb7('0x28')](_0x2984b2[_0x4eb7('0x29')]);if(_0x2984b2[_0x4eb7('0x2a')]){delete _0x2984b2[_0x4eb7('0x2a')];}_0x248759[_0x4eb7('0x1b')](_0xf83c11)[_0x4eb7('0x2b')](_0x2984b2);};}exports[_0x4eb7('0x2c')]=function(_0x28fda8,_0x114c68){var _0x17030a={},_0x3ed224={},_0x50209d={'count':0x0,'rows':[]};var _0x34515c=_['map'](db[_0x4eb7('0x2d')][_0x4eb7('0x2e')],function(_0xc5aa21){return{'name':_0xc5aa21[_0x4eb7('0x2f')],'type':_0xc5aa21[_0x4eb7('0x30')][_0x4eb7('0x31')]};});_0x3ed224[_0x4eb7('0x32')]=_[_0x4eb7('0x33')](_0x34515c,_0x4eb7('0x2a'));_0x3ed224['query']=_[_0x4eb7('0x34')](_0x28fda8['query']);_0x3ed224[_0x4eb7('0x35')]=_[_0x4eb7('0x36')](_0x3ed224['model'],_0x3ed224['query']);_0x17030a[_0x4eb7('0x37')]=_[_0x4eb7('0x36')](_0x3ed224[_0x4eb7('0x32')],qs[_0x4eb7('0x38')](_0x28fda8['query'][_0x4eb7('0x38')]));_0x17030a[_0x4eb7('0x37')]=_0x17030a[_0x4eb7('0x37')][_0x4eb7('0x39')]?_0x17030a[_0x4eb7('0x37')]:_0x3ed224['model'];if(!_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x3b')](_0x4eb7('0x3c'))){_0x17030a['limit']=qs[_0x4eb7('0x3d')](_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x3d')]);_0x17030a['offset']=qs[_0x4eb7('0x1d')](_0x28fda8['query'][_0x4eb7('0x1d')]);}_0x17030a[_0x4eb7('0x3e')]=qs[_0x4eb7('0x3f')](_0x28fda8[_0x4eb7('0x3a')]['sort']);_0x17030a[_0x4eb7('0x40')]=qs[_0x4eb7('0x35')](_[_0x4eb7('0x41')](_0x28fda8[_0x4eb7('0x3a')],_0x3ed224['filters']),_0x34515c);if(_0x28fda8['query']['filter']){_0x17030a[_0x4eb7('0x40')]=_[_0x4eb7('0x42')](_0x17030a[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x33')](_0x34515c,function(_0x210c20){if(_0x210c20[_0x4eb7('0x30')]!==_0x4eb7('0x43')){var _0x20d2bc={};_0x20d2bc[_0x210c20[_0x4eb7('0x2a')]]={'$like':'%'+_0x28fda8[_0x4eb7('0x3a')]['filter']+'%'};return _0x20d2bc;}})});}_0x17030a=_[_0x4eb7('0x42')]({},_0x17030a,_0x28fda8[_0x4eb7('0x44')]);var _0xe04d76={'where':_0x17030a[_0x4eb7('0x40')]};return db[_0x4eb7('0x2d')][_0x4eb7('0x1f')](_0xe04d76)[_0x4eb7('0x25')](function(_0xef998f){_0x50209d[_0x4eb7('0x1f')]=_0xef998f;if(_0x28fda8[_0x4eb7('0x3a')][_0x4eb7('0x45')]){_0x17030a[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x2d')][_0x4eb7('0x47')](_0x17030a);})[_0x4eb7('0x25')](function(_0x5b819f){_0x50209d[_0x4eb7('0x48')]=_0x5b819f;return _0x50209d;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x114c68,_0x17030a))[_0x4eb7('0x49')](handleError(_0x114c68,null));};exports[_0x4eb7('0x4a')]=function(_0x5eff9e,_0x2fd5c2){var _0x2df542={'raw':![],'where':{'id':_0x5eff9e[_0x4eb7('0x4b')]['id']}},_0x482357={};_0x482357[_0x4eb7('0x32')]=_[_0x4eb7('0x34')](db[_0x4eb7('0x2d')][_0x4eb7('0x2e')]);_0x482357[_0x4eb7('0x3a')]=_['keys'](_0x5eff9e[_0x4eb7('0x3a')]);_0x482357['filters']=_[_0x4eb7('0x36')](_0x482357[_0x4eb7('0x32')],_0x482357[_0x4eb7('0x3a')]);_0x2df542['attributes']=_[_0x4eb7('0x36')](_0x482357[_0x4eb7('0x32')],qs[_0x4eb7('0x38')](_0x5eff9e[_0x4eb7('0x3a')]['fields']));_0x2df542[_0x4eb7('0x37')]=_0x2df542['attributes'][_0x4eb7('0x39')]?_0x2df542[_0x4eb7('0x37')]:_0x482357[_0x4eb7('0x32')];if(_0x5eff9e[_0x4eb7('0x3a')][_0x4eb7('0x45')]){_0x2df542['include']=[{'all':!![]}];}_0x2df542=_['merge']({},_0x2df542,_0x5eff9e[_0x4eb7('0x44')]);return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')](_0x2df542)[_0x4eb7('0x25')](handleEntityNotFound(_0x2fd5c2,null))[_0x4eb7('0x25')](respondWithResult(_0x2fd5c2,null))['catch'](handleError(_0x2fd5c2,null));};exports[_0x4eb7('0x4d')]=function(_0x104284,_0x56609e){return db[_0x4eb7('0x2d')][_0x4eb7('0x4d')](_0x104284['body'],{})[_0x4eb7('0x25')](respondWithResult(_0x56609e,0xc9))[_0x4eb7('0x49')](handleError(_0x56609e,null));};exports[_0x4eb7('0x24')]=function(_0x5774d5,_0x130113){if(_0x5774d5['body']['id']){delete _0x5774d5['body']['id'];}return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')]({'where':{'id':_0x5774d5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x130113,null))[_0x4eb7('0x25')](saveUpdates(_0x5774d5[_0x4eb7('0x4e')],null))[_0x4eb7('0x25')](respondWithResult(_0x130113,null))[_0x4eb7('0x49')](handleError(_0x130113,null));};exports[_0x4eb7('0x26')]=function(_0x23c0d5,_0x42a1d9){return db[_0x4eb7('0x2d')][_0x4eb7('0x4c')]({'where':{'id':_0x23c0d5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x42a1d9,null))[_0x4eb7('0x25')](removeEntity(_0x42a1d9,null))[_0x4eb7('0x49')](handleError(_0x42a1d9,null));};exports[_0x4eb7('0x4f')]=function(_0x1411c9,_0x11cc3d,_0x4cfba8){var _0x3f3d41={};var _0x550888={};var _0x4db5f7;var _0x3f3a5f;return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x1411c9[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x11cc3d,null))['then'](function(_0x4e3163){if(_0x4e3163){_0x4db5f7=_0x4e3163;_0x550888[_0x4eb7('0x32')]=_['keys'](db[_0x4eb7('0x51')][_0x4eb7('0x2e')]);_0x550888[_0x4eb7('0x3a')]=_[_0x4eb7('0x34')](_0x1411c9['query']);_0x550888[_0x4eb7('0x35')]=_[_0x4eb7('0x36')](_0x550888[_0x4eb7('0x32')],_0x550888[_0x4eb7('0x3a')]);_0x3f3d41['attributes']=_[_0x4eb7('0x36')](_0x550888[_0x4eb7('0x32')],qs['fields'](_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x38')]));_0x3f3d41['attributes']=_0x3f3d41[_0x4eb7('0x37')]['length']?_0x3f3d41[_0x4eb7('0x37')]:_0x550888['model'];_0x3f3d41[_0x4eb7('0x3e')]=qs[_0x4eb7('0x3f')](_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x3f')]);_0x3f3d41[_0x4eb7('0x40')]=qs[_0x4eb7('0x35')](_['pick'](_0x1411c9['query'],_0x550888[_0x4eb7('0x35')]));if(_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x52')]){_0x3f3d41[_0x4eb7('0x40')]=_['merge'](_0x3f3d41[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x33')](_0x3f3d41['attributes'],function(_0x452f21){var _0xba9272={};_0xba9272[_0x452f21]={'$like':'%'+_0x1411c9[_0x4eb7('0x3a')][_0x4eb7('0x52')]+'%'};return _0xba9272;})});}_0x3f3d41=_[_0x4eb7('0x42')]({},_0x3f3d41,_0x1411c9[_0x4eb7('0x44')]);return _0x4db5f7[_0x4eb7('0x4f')](_0x3f3d41);}})['then'](function(_0x5839f1){if(_0x5839f1){_0x3f3a5f=_0x5839f1[_0x4eb7('0x39')];if(!_0x1411c9['query'][_0x4eb7('0x3b')]('nolimit')){_0x3f3d41[_0x4eb7('0x3d')]=qs['limit'](_0x1411c9['query'][_0x4eb7('0x3d')]);_0x3f3d41[_0x4eb7('0x1d')]=qs['offset'](_0x1411c9[_0x4eb7('0x3a')]['offset']);}return _0x4db5f7[_0x4eb7('0x4f')](_0x3f3d41);}})[_0x4eb7('0x25')](function(_0x4ab8e8){if(_0x4ab8e8){return _0x4ab8e8?{'count':_0x3f3a5f,'rows':_0x4ab8e8}:null;}})[_0x4eb7('0x25')](respondWithResult(_0x11cc3d,null))[_0x4eb7('0x49')](handleError(_0x11cc3d,null));};exports['addConfiguration']=function(_0x4b492a,_0x5c8d45,_0x59e2f2){if(_0x4b492a[_0x4eb7('0x4e')]['id']){delete _0x4b492a['body']['id'];}return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x4b492a['params']['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5c8d45,null))[_0x4eb7('0x25')](function(_0x463ab6){if(_0x463ab6){_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x53')]=_0x463ab6['id'];_0x4b492a[_0x4eb7('0x4e')]['Subjects']=integrations['getSubjects'](_0x4b492a['body'][_0x4eb7('0x54')],_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x30')]);_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x55')]=integrations['getDescriptions'](_0x4b492a['body'][_0x4eb7('0x54')],_0x4b492a[_0x4eb7('0x4e')][_0x4eb7('0x30')]);return db[_0x4eb7('0x51')][_0x4eb7('0x4d')](_0x4b492a['body'],{'include':[{'model':db[_0x4eb7('0x56')],'as':_0x4eb7('0x57')},{'model':db[_0x4eb7('0x56')],'as':_0x4eb7('0x55')}]});}return null;})['then'](respondWithResult(_0x5c8d45,null))['catch'](handleError(_0x5c8d45,null));};exports[_0x4eb7('0x58')]=function(_0x3883f3,_0x4e8125,_0x1911ad){var _0x4b698b='';return db[_0x4eb7('0x2d')][_0x4eb7('0x50')]({'where':{'id':_0x3883f3[_0x4eb7('0x4b')]['id']},'attributes':['id',_0x4eb7('0x59'),'password',_0x4eb7('0x5a'),_0x4eb7('0x5b'),_0x4eb7('0x5c')]})[_0x4eb7('0x25')](handleEntityNotFound(_0x4e8125,null))[_0x4eb7('0x25')](function(_0x3271d0){if(_0x3271d0){_0x4b698b=_0x3271d0[_0x4eb7('0x5c')];var _0x232242=_0x4b698b[_0x4eb7('0x5d')](-0x1);if(_0x232242==='/'){_0x4b698b=_0x4b698b[_0x4eb7('0x5e')](0x0,_0x4b698b[_0x4eb7('0x5f')](_0x232242));}var _0x713b0a={'method':_0x4eb7('0x60'),'uri':util[_0x4eb7('0x61')](_0x4eb7('0x62'),_0x4b698b,_0x4eb7('0x63')),'json':!![]};switch(_0x3271d0[_0x4eb7('0x5b')]){case _0x4eb7('0x64'):_0x713b0a[_0x4eb7('0x65')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4eb7('0x61')](_0x4eb7('0x66'),_0x3271d0[_0x4eb7('0x59')],_0x3271d0[_0x4eb7('0x64')]))[_0x4eb7('0x67')](_0x4eb7('0x68')))};break;case _0x4eb7('0x5a'):_0x713b0a[_0x4eb7('0x65')]={'Authorization':util['format'](_0x4eb7('0x69'),new Buffer(util[_0x4eb7('0x61')](_0x4eb7('0x6a'),_0x3271d0['username'],_0x3271d0['token']))[_0x4eb7('0x67')](_0x4eb7('0x68')))};break;default:throw new db[(_0x4eb7('0x6b'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x713b0a);}})[_0x4eb7('0x25')](function(_0x1a1525){if(_0x1a1525){var _0x4778f9=[_0x4eb7('0x6c'),_0x4eb7('0x6d'),_0x4eb7('0x6e'),_0x4eb7('0x6f')];_[_0x4eb7('0x70')](_0x1a1525[_0x4eb7('0x63')],function(_0x2e531e){return _0x4778f9[_0x4eb7('0x71')](_0x2e531e[_0x4eb7('0x30')]);});return{'count':_0x1a1525['ticket_fields']['length'],'rows':_[_0x4eb7('0x33')](_0x1a1525[_0x4eb7('0x63')],function(_0x14648d){return{'id':_0x14648d['id'],'name':_0x14648d[_0x4eb7('0x72')]>0x7?_0x14648d[_0x4eb7('0x73')]:_0x14648d[_0x4eb7('0x30')],'custom':_0x14648d['position']>0x7?!![]:![],'options':_0x14648d['system_field_options']?_0x14648d[_0x4eb7('0x74')]:_0x14648d[_0x4eb7('0x75')]?_0x14648d[_0x4eb7('0x75')]:[]};})};}})[_0x4eb7('0x25')](respondWithResult(_0x4e8125,null))[_0x4eb7('0x49')](function(_0x2480ed){var _0x13f574=_0x3883f3[_0x4eb7('0x3a')][_0x4eb7('0x76')]?0x1f4:_0x2480ed[_0x4eb7('0x77')]||0x1f4;logger[_0x4eb7('0x28')](_0x4eb7('0x78'),_0x4eb7('0x58'),_0x13f574,JSON[_0x4eb7('0x79')](_0x2480ed));delete _0x2480ed['name'];if(_0x13f574===0x191){_0x13f574=0x190;}_0x4e8125[_0x4eb7('0x1b')](_0x13f574)[_0x4eb7('0x2b')](_0x3883f3[_0x4eb7('0x3a')][_0x4eb7('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x2480ed[_0x4eb7('0x77')]}:_0x2480ed);});}; \ No newline at end of file +var _0x1339=['Sequelize','Unknown\x20authentication\x20type','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','update','then','name','send','map','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','ZendeskAccount','includeAll','include','rows','catch','show','rawAttributes','intersection','find','create','body','destroy','params','findOne','pick','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','GET','%s/%s','authType','headers','format','Basic\x20%s','%s:%s','toString','%s/token:%s','base64'];(function(_0x524375,_0x3ca8d4){var _0x18e8a6=function(_0x4a6898){while(--_0x4a6898){_0x524375['push'](_0x524375['shift']());}};_0x18e8a6(++_0x3ca8d4);}(_0x1339,0x1ed));var _0x9133=function(_0x514d8a,_0x5af084){_0x514d8a=_0x514d8a-0x0;var _0x5c7987=_0x1339[_0x514d8a];return _0x5c7987;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9133('0x1a'));function respondWithStatusCode(_0x7cc59e,_0x4bbfdc){_0x4bbfdc=_0x4bbfdc||0xcc;return function(_0x5283a3){if(_0x5283a3){return _0x7cc59e[_0x9133('0x1b')](_0x4bbfdc);}return _0x7cc59e['status'](_0x4bbfdc)[_0x9133('0x1c')]();};}function respondWithResult(_0x439e1a,_0x17dfd1){_0x17dfd1=_0x17dfd1||0xc8;return function(_0x464ec5){if(_0x464ec5){return _0x439e1a[_0x9133('0x1d')](_0x17dfd1)[_0x9133('0x1e')](_0x464ec5);}};}function respondWithFilteredResult(_0x49cc5d,_0x13f8fc){return function(_0x1e23ce){if(_0x1e23ce){var _0x4f4f14=typeof _0x13f8fc[_0x9133('0x1f')]===_0x9133('0x20')&&typeof _0x13f8fc[_0x9133('0x21')]===_0x9133('0x20');var _0x4a2c4f=_0x1e23ce[_0x9133('0x22')];var _0x573998=_0x4f4f14?0x0:_0x13f8fc[_0x9133('0x1f')];var _0x5d4a77=_0x4f4f14?_0x1e23ce[_0x9133('0x22')]:_0x13f8fc[_0x9133('0x1f')]+_0x13f8fc['limit'];var _0x38dd60;if(_0x5d4a77>=_0x4a2c4f){_0x5d4a77=_0x4a2c4f;_0x38dd60=0xc8;}else{_0x38dd60=0xce;}_0x49cc5d['status'](_0x38dd60);return _0x49cc5d[_0x9133('0x23')]('Content-Range',_0x573998+'-'+_0x5d4a77+'/'+_0x4a2c4f)['json'](_0x1e23ce);}return null;};}function patchUpdates(_0x2f7354){return function(_0x577de4){try{jsonpatch[_0x9133('0x24')](_0x577de4,_0x2f7354,!![]);}catch(_0x4c1088){return BPromise['reject'](_0x4c1088);}return _0x577de4['save']();};}function saveUpdates(_0x2e99a1,_0x2dcfb8){return function(_0x4da09c){if(_0x4da09c){return _0x4da09c[_0x9133('0x25')](_0x2e99a1)[_0x9133('0x26')](function(_0xff08d5){return _0xff08d5;});}return null;};}function removeEntity(_0x26190c,_0x4f26e8){return function(_0xdb7a98){if(_0xdb7a98){return _0xdb7a98['destroy']()[_0x9133('0x26')](function(){_0x26190c[_0x9133('0x1d')](0xcc)[_0x9133('0x1c')]();});}};}function handleEntityNotFound(_0x14c1cb,_0x4483ef){return function(_0xe829b){if(!_0xe829b){_0x14c1cb[_0x9133('0x1b')](0x194);}return _0xe829b;};}function handleError(_0x313d43,_0x1b6b3e){_0x1b6b3e=_0x1b6b3e||0x1f4;return function(_0x46050b){logger['error'](_0x46050b['stack']);if(_0x46050b[_0x9133('0x27')]){delete _0x46050b[_0x9133('0x27')];}_0x313d43[_0x9133('0x1d')](_0x1b6b3e)[_0x9133('0x28')](_0x46050b);};}exports['index']=function(_0x4ecd9e,_0x3e2404){var _0x45966d={},_0x188c49={},_0x26d351={'count':0x0,'rows':[]};var _0x390f50=_[_0x9133('0x29')](db['ZendeskAccount']['rawAttributes'],function(_0x5a27c1){return{'name':_0x5a27c1[_0x9133('0x2a')],'type':_0x5a27c1['type'][_0x9133('0x2b')]};});_0x188c49[_0x9133('0x2c')]=_['map'](_0x390f50,_0x9133('0x27'));_0x188c49['query']=_[_0x9133('0x2d')](_0x4ecd9e[_0x9133('0x2e')]);_0x188c49[_0x9133('0x2f')]=_['intersection'](_0x188c49[_0x9133('0x2c')],_0x188c49[_0x9133('0x2e')]);_0x45966d[_0x9133('0x30')]=_['intersection'](_0x188c49[_0x9133('0x2c')],qs[_0x9133('0x31')](_0x4ecd9e[_0x9133('0x2e')]['fields']));_0x45966d[_0x9133('0x30')]=_0x45966d[_0x9133('0x30')][_0x9133('0x32')]?_0x45966d[_0x9133('0x30')]:_0x188c49['model'];if(!_0x4ecd9e[_0x9133('0x2e')][_0x9133('0x33')]('nolimit')){_0x45966d[_0x9133('0x21')]=qs[_0x9133('0x21')](_0x4ecd9e[_0x9133('0x2e')][_0x9133('0x21')]);_0x45966d[_0x9133('0x1f')]=qs[_0x9133('0x1f')](_0x4ecd9e[_0x9133('0x2e')][_0x9133('0x1f')]);}_0x45966d[_0x9133('0x34')]=qs[_0x9133('0x35')](_0x4ecd9e[_0x9133('0x2e')]['sort']);_0x45966d[_0x9133('0x36')]=qs[_0x9133('0x2f')](_['pick'](_0x4ecd9e[_0x9133('0x2e')],_0x188c49[_0x9133('0x2f')]),_0x390f50);if(_0x4ecd9e[_0x9133('0x2e')][_0x9133('0x37')]){_0x45966d[_0x9133('0x36')]=_[_0x9133('0x38')](_0x45966d['where'],{'$or':_['map'](_0x390f50,function(_0x33c05b){if(_0x33c05b[_0x9133('0x39')]!==_0x9133('0x3a')){var _0x112514={};_0x112514[_0x33c05b[_0x9133('0x27')]]={'$like':'%'+_0x4ecd9e[_0x9133('0x2e')][_0x9133('0x37')]+'%'};return _0x112514;}})});}_0x45966d=_[_0x9133('0x38')]({},_0x45966d,_0x4ecd9e[_0x9133('0x3b')]);var _0x5a3f73={'where':_0x45966d[_0x9133('0x36')]};return db[_0x9133('0x3c')][_0x9133('0x22')](_0x5a3f73)[_0x9133('0x26')](function(_0x3df6ca){_0x26d351['count']=_0x3df6ca;if(_0x4ecd9e[_0x9133('0x2e')][_0x9133('0x3d')]){_0x45966d[_0x9133('0x3e')]=[{'all':!![]}];}return db[_0x9133('0x3c')]['findAll'](_0x45966d);})[_0x9133('0x26')](function(_0x1293f1){_0x26d351[_0x9133('0x3f')]=_0x1293f1;return _0x26d351;})[_0x9133('0x26')](respondWithFilteredResult(_0x3e2404,_0x45966d))[_0x9133('0x40')](handleError(_0x3e2404,null));};exports[_0x9133('0x41')]=function(_0x3b2287,_0x4ca1a3){var _0x7f6cd9={'raw':![],'where':{'id':_0x3b2287['params']['id']}},_0x5e0fde={};_0x5e0fde[_0x9133('0x2c')]=_[_0x9133('0x2d')](db[_0x9133('0x3c')][_0x9133('0x42')]);_0x5e0fde[_0x9133('0x2e')]=_[_0x9133('0x2d')](_0x3b2287[_0x9133('0x2e')]);_0x5e0fde[_0x9133('0x2f')]=_[_0x9133('0x43')](_0x5e0fde['model'],_0x5e0fde[_0x9133('0x2e')]);_0x7f6cd9[_0x9133('0x30')]=_[_0x9133('0x43')](_0x5e0fde['model'],qs['fields'](_0x3b2287[_0x9133('0x2e')][_0x9133('0x31')]));_0x7f6cd9['attributes']=_0x7f6cd9[_0x9133('0x30')][_0x9133('0x32')]?_0x7f6cd9[_0x9133('0x30')]:_0x5e0fde[_0x9133('0x2c')];if(_0x3b2287[_0x9133('0x2e')]['includeAll']){_0x7f6cd9[_0x9133('0x3e')]=[{'all':!![]}];}_0x7f6cd9=_[_0x9133('0x38')]({},_0x7f6cd9,_0x3b2287[_0x9133('0x3b')]);return db['ZendeskAccount'][_0x9133('0x44')](_0x7f6cd9)[_0x9133('0x26')](handleEntityNotFound(_0x4ca1a3,null))['then'](respondWithResult(_0x4ca1a3,null))['catch'](handleError(_0x4ca1a3,null));};exports[_0x9133('0x45')]=function(_0x2cd935,_0x4446fe){return db[_0x9133('0x3c')][_0x9133('0x45')](_0x2cd935[_0x9133('0x46')],{})[_0x9133('0x26')](respondWithResult(_0x4446fe,0xc9))[_0x9133('0x40')](handleError(_0x4446fe,null));};exports[_0x9133('0x25')]=function(_0xf07fbb,_0x3d6a49){if(_0xf07fbb[_0x9133('0x46')]['id']){delete _0xf07fbb['body']['id'];}return db['ZendeskAccount'][_0x9133('0x44')]({'where':{'id':_0xf07fbb['params']['id']}})[_0x9133('0x26')](handleEntityNotFound(_0x3d6a49,null))[_0x9133('0x26')](saveUpdates(_0xf07fbb[_0x9133('0x46')],null))[_0x9133('0x26')](respondWithResult(_0x3d6a49,null))['catch'](handleError(_0x3d6a49,null));};exports[_0x9133('0x47')]=function(_0x25750f,_0x799772){return db['ZendeskAccount'][_0x9133('0x44')]({'where':{'id':_0x25750f[_0x9133('0x48')]['id']}})[_0x9133('0x26')](handleEntityNotFound(_0x799772,null))['then'](removeEntity(_0x799772,null))[_0x9133('0x40')](handleError(_0x799772,null));};exports['getConfigurations']=function(_0x2342f4,_0x3c4b67,_0x304673){var _0x9fa963={};var _0x4f58fe={};var _0x4a346c;var _0x2f09f6;return db[_0x9133('0x3c')][_0x9133('0x49')]({'where':{'id':_0x2342f4[_0x9133('0x48')]['id']}})[_0x9133('0x26')](handleEntityNotFound(_0x3c4b67,null))['then'](function(_0x554bb9){if(_0x554bb9){_0x4a346c=_0x554bb9;_0x4f58fe[_0x9133('0x2c')]=_[_0x9133('0x2d')](db['ZendeskConfiguration'][_0x9133('0x42')]);_0x4f58fe[_0x9133('0x2e')]=_['keys'](_0x2342f4['query']);_0x4f58fe['filters']=_[_0x9133('0x43')](_0x4f58fe['model'],_0x4f58fe[_0x9133('0x2e')]);_0x9fa963[_0x9133('0x30')]=_[_0x9133('0x43')](_0x4f58fe[_0x9133('0x2c')],qs['fields'](_0x2342f4[_0x9133('0x2e')]['fields']));_0x9fa963[_0x9133('0x30')]=_0x9fa963[_0x9133('0x30')][_0x9133('0x32')]?_0x9fa963[_0x9133('0x30')]:_0x4f58fe[_0x9133('0x2c')];_0x9fa963[_0x9133('0x34')]=qs['sort'](_0x2342f4['query']['sort']);_0x9fa963[_0x9133('0x36')]=qs[_0x9133('0x2f')](_[_0x9133('0x4a')](_0x2342f4['query'],_0x4f58fe[_0x9133('0x2f')]));if(_0x2342f4[_0x9133('0x2e')][_0x9133('0x37')]){_0x9fa963[_0x9133('0x36')]=_[_0x9133('0x38')](_0x9fa963[_0x9133('0x36')],{'$or':_[_0x9133('0x29')](_0x9fa963[_0x9133('0x30')],function(_0x59bb26){var _0x464954={};_0x464954[_0x59bb26]={'$like':'%'+_0x2342f4['query'][_0x9133('0x37')]+'%'};return _0x464954;})});}_0x9fa963=_['merge']({},_0x9fa963,_0x2342f4[_0x9133('0x3b')]);return _0x4a346c[_0x9133('0x4b')](_0x9fa963);}})['then'](function(_0x540b02){if(_0x540b02){_0x2f09f6=_0x540b02[_0x9133('0x32')];if(!_0x2342f4[_0x9133('0x2e')][_0x9133('0x33')](_0x9133('0x4c'))){_0x9fa963[_0x9133('0x21')]=qs[_0x9133('0x21')](_0x2342f4[_0x9133('0x2e')][_0x9133('0x21')]);_0x9fa963[_0x9133('0x1f')]=qs[_0x9133('0x1f')](_0x2342f4[_0x9133('0x2e')]['offset']);}return _0x4a346c[_0x9133('0x4b')](_0x9fa963);}})['then'](function(_0x23d61f){if(_0x23d61f){return _0x23d61f?{'count':_0x2f09f6,'rows':_0x23d61f}:null;}})[_0x9133('0x26')](respondWithResult(_0x3c4b67,null))[_0x9133('0x40')](handleError(_0x3c4b67,null));};exports[_0x9133('0x4d')]=function(_0xd37001,_0x52d4c8,_0x35bc72){if(_0xd37001[_0x9133('0x46')]['id']){delete _0xd37001[_0x9133('0x46')]['id'];}return db[_0x9133('0x3c')]['findOne']({'where':{'id':_0xd37001[_0x9133('0x48')]['id']}})[_0x9133('0x26')](handleEntityNotFound(_0x52d4c8,null))[_0x9133('0x26')](function(_0x31e978){if(_0x31e978){_0xd37001['body']['AccountId']=_0x31e978['id'];_0xd37001[_0x9133('0x46')][_0x9133('0x4e')]=integrations[_0x9133('0x4f')](_0xd37001[_0x9133('0x46')][_0x9133('0x50')],_0xd37001[_0x9133('0x46')]['type']);_0xd37001[_0x9133('0x46')][_0x9133('0x51')]=integrations[_0x9133('0x52')](_0xd37001[_0x9133('0x46')]['channel'],_0xd37001[_0x9133('0x46')]['type']);return db[_0x9133('0x53')][_0x9133('0x45')](_0xd37001[_0x9133('0x46')],{'include':[{'model':db[_0x9133('0x54')],'as':_0x9133('0x4e')},{'model':db[_0x9133('0x54')],'as':_0x9133('0x51')}]});}return null;})[_0x9133('0x26')](respondWithResult(_0x52d4c8,null))['catch'](handleError(_0x52d4c8,null));};exports[_0x9133('0x55')]=function(_0x1fcd01,_0x10afd7,_0x152283){var _0x406861='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x1fcd01['params']['id']},'attributes':['id',_0x9133('0x56'),_0x9133('0x57'),_0x9133('0x58'),'authType',_0x9133('0x59')]})[_0x9133('0x26')](handleEntityNotFound(_0x10afd7,null))[_0x9133('0x26')](function(_0x3e660c){if(_0x3e660c){_0x406861=_0x3e660c[_0x9133('0x59')];var _0x4cab23=_0x406861[_0x9133('0x5a')](-0x1);if(_0x4cab23==='/'){_0x406861=_0x406861[_0x9133('0x5b')](0x0,_0x406861['lastIndexOf'](_0x4cab23));}var _0x41f924={'method':_0x9133('0x5c'),'uri':util['format'](_0x9133('0x5d'),_0x406861,'ticket_fields'),'json':!![]};switch(_0x3e660c[_0x9133('0x5e')]){case _0x9133('0x57'):_0x41f924[_0x9133('0x5f')]={'Authorization':util[_0x9133('0x60')](_0x9133('0x61'),new Buffer(util['format'](_0x9133('0x62'),_0x3e660c[_0x9133('0x56')],_0x3e660c[_0x9133('0x57')]))[_0x9133('0x63')]('base64'))};break;case _0x9133('0x58'):_0x41f924[_0x9133('0x5f')]={'Authorization':util[_0x9133('0x60')](_0x9133('0x61'),new Buffer(util[_0x9133('0x60')](_0x9133('0x64'),_0x3e660c[_0x9133('0x56')],_0x3e660c[_0x9133('0x58')]))[_0x9133('0x63')](_0x9133('0x65')))};break;default:throw new db[(_0x9133('0x66'))]['ValidationError'](_0x9133('0x67'));}return rp(_0x41f924);}})[_0x9133('0x26')](function(_0x242974){if(_0x242974){var _0x12ae5f=['subject',_0x9133('0x68'),'group',_0x9133('0x69')];_[_0x9133('0x6a')](_0x242974[_0x9133('0x6b')],function(_0x530984){return _0x12ae5f[_0x9133('0x6c')](_0x530984[_0x9133('0x39')]);});return{'count':_0x242974[_0x9133('0x6b')]['length'],'rows':_[_0x9133('0x29')](_0x242974[_0x9133('0x6b')],function(_0x5013f8){return{'id':_0x5013f8['id'],'name':_0x5013f8[_0x9133('0x6d')]>0x7?_0x5013f8[_0x9133('0x6e')]:_0x5013f8[_0x9133('0x39')],'custom':_0x5013f8['position']>0x7?!![]:![],'options':_0x5013f8[_0x9133('0x6f')]?_0x5013f8['system_field_options']:_0x5013f8[_0x9133('0x70')]?_0x5013f8[_0x9133('0x70')]:[]};})};}})[_0x9133('0x26')](respondWithResult(_0x10afd7,null))['catch'](function(_0x2bd590){var _0x54f9ad=_0x1fcd01[_0x9133('0x2e')][_0x9133('0x71')]?0x1f4:_0x2bd590[_0x9133('0x72')]||0x1f4;logger[_0x9133('0x73')](_0x9133('0x74'),_0x9133('0x55'),_0x54f9ad,JSON[_0x9133('0x75')](_0x2bd590));delete _0x2bd590[_0x9133('0x27')];if(_0x54f9ad===0x191){_0x54f9ad=0x190;}_0x10afd7['status'](_0x54f9ad)[_0x9133('0x28')](_0x1fcd01[_0x9133('0x2e')][_0x9133('0x71')]?{'message':_0x9133('0x76'),'statusCode':_0x2bd590[_0x9133('0x72')]}:_0x2bd590);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 44d5385..a019bb9 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 _0x1982=['path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','util','../../config/logger','api','bluebird','request-promise'];(function(_0x33a7fe,_0x23c9ed){var _0x1bbdf5=function(_0x278783){while(--_0x278783){_0x33a7fe['push'](_0x33a7fe['shift']());}};_0x1bbdf5(++_0x23c9ed);}(_0x1982,0xc1));var _0x2198=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1982[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2198('0x0'));var logger=require(_0x2198('0x1'))(_0x2198('0x2'));var moment=require('moment');var BPromise=require(_0x2198('0x3'));var rp=require(_0x2198('0x4'));var fs=require('fs');var path=require(_0x2198('0x5'));var rimraf=require('rimraf');var config=require(_0x2198('0x6'));var attributes=require(_0x2198('0x7'));var integrations=require(_0x2198('0x8'));module[_0x2198('0x9')]=function(_0x1e151a,_0x14b572){return _0x1e151a['define'](_0x2198('0xa'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91ac=['request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','int_zendesk_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x644ecd,_0x397f36){var _0x1c66ce=function(_0x4cf42b){while(--_0x4cf42b){_0x644ecd['push'](_0x644ecd['shift']());}};_0x1c66ce(++_0x397f36);}(_0x91ac,0x119));var _0xc91a=function(_0x320815,_0x2a89d8){_0x320815=_0x320815-0x0;var _0x2f096d=_0x91ac[_0x320815];return _0x2f096d;};'use strict';var _=require('lodash');var util=require(_0xc91a('0x0'));var logger=require(_0xc91a('0x1'))(_0xc91a('0x2'));var moment=require(_0xc91a('0x3'));var BPromise=require(_0xc91a('0x4'));var rp=require(_0xc91a('0x5'));var fs=require('fs');var path=require(_0xc91a('0x6'));var rimraf=require(_0xc91a('0x7'));var config=require(_0xc91a('0x8'));var attributes=require(_0xc91a('0x9'));var integrations=require(_0xc91a('0xa'));module[_0xc91a('0xb')]=function(_0x3e41f1,_0x21f0e4){return _0x3e41f1['define']('ZendeskAccount',attributes,{'tableName':_0xc91a('0xc'),'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 7c39031..8eb1b81 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 _0xcb27=['map','GetZendeskAccount','ZendeskAccount','find','ShowZendeskAccount','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','options','raw','where','attributes','limit','include','model'];(function(_0x33c808,_0x1d206b){var _0xdbd11c=function(_0x23f18c){while(--_0x23f18c){_0x33c808['push'](_0x33c808['shift']());}};_0xdbd11c(++_0x1d206b);}(_0xcb27,0x19d));var _0x7cb2=function(_0x331223,_0x505cd9){_0x331223=_0x331223-0x0;var _0x1787b9=_0xcb27[_0x331223];return _0x1787b9;};'use strict';var _=require(_0x7cb2('0x0'));var util=require('util');var moment=require(_0x7cb2('0x1'));var BPromise=require(_0x7cb2('0x2'));var rs=require(_0x7cb2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7cb2('0x4'));var logger=require(_0x7cb2('0x5'))(_0x7cb2('0x6'));var config=require(_0x7cb2('0x7'));var jayson=require(_0x7cb2('0x8'));var client=jayson['client'][_0x7cb2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x374bef,_0x1a1f8e,_0x47595f){return new BPromise(function(_0x20b7e2,_0x9bcead){return client[_0x7cb2('0xa')](_0x374bef,_0x47595f)[_0x7cb2('0xb')](function(_0x149b56){logger[_0x7cb2('0xc')](_0x7cb2('0xd'),_0x1a1f8e,_0x7cb2('0xe'));logger[_0x7cb2('0xf')](_0x7cb2('0x10'),_0x1a1f8e,'request\x20sent',JSON[_0x7cb2('0x11')](_0x149b56));if(_0x149b56['error']){if(_0x149b56[_0x7cb2('0x12')]['code']===0x1f4){logger[_0x7cb2('0x12')](_0x7cb2('0xd'),_0x1a1f8e,_0x149b56[_0x7cb2('0x12')][_0x7cb2('0x13')]);return _0x9bcead(_0x149b56[_0x7cb2('0x12')][_0x7cb2('0x13')]);}logger[_0x7cb2('0x12')](_0x7cb2('0xd'),_0x1a1f8e,_0x149b56['error'][_0x7cb2('0x13')]);return _0x20b7e2(_0x149b56[_0x7cb2('0x12')][_0x7cb2('0x13')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x1a1f8e,_0x7cb2('0xe'));_0x20b7e2(_0x149b56[_0x7cb2('0x14')][_0x7cb2('0x13')]);}})[_0x7cb2('0x15')](function(_0x4b1067){logger[_0x7cb2('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x1a1f8e,_0x4b1067);_0x9bcead(_0x4b1067);});});}exports['GetZendeskAccount']=function(_0xf17d79){var _0x5468ed=this;return new Promise(function(_0x3afc0c,_0x595622){return db['ZendeskAccount']['findAll']({'raw':_0xf17d79[_0x7cb2('0x16')]?_0xf17d79[_0x7cb2('0x16')][_0x7cb2('0x17')]===undefined?!![]:![]:!![],'where':_0xf17d79[_0x7cb2('0x16')]?_0xf17d79[_0x7cb2('0x16')][_0x7cb2('0x18')]||null:null,'attributes':_0xf17d79[_0x7cb2('0x16')]?_0xf17d79[_0x7cb2('0x16')][_0x7cb2('0x19')]||null:null,'limit':_0xf17d79[_0x7cb2('0x16')]?_0xf17d79[_0x7cb2('0x16')][_0x7cb2('0x1a')]||null:null,'include':_0xf17d79['options']?_0xf17d79['options'][_0x7cb2('0x1b')]?_['map'](_0xf17d79[_0x7cb2('0x16')]['include'],function(_0xd3710e){return{'model':db[_0xd3710e[_0x7cb2('0x1c')]],'as':_0xd3710e['as'],'attributes':_0xd3710e[_0x7cb2('0x19')],'include':_0xd3710e[_0x7cb2('0x1b')]?_[_0x7cb2('0x1d')](_0xd3710e[_0x7cb2('0x1b')],function(_0x21fa84){return{'model':db[_0x21fa84[_0x7cb2('0x1c')]],'as':_0x21fa84['as'],'attributes':_0x21fa84[_0x7cb2('0x19')],'include':_0x21fa84[_0x7cb2('0x1b')]?_[_0x7cb2('0x1d')](_0x21fa84['include'],function(_0x39ca25){return{'model':db[_0x39ca25[_0x7cb2('0x1c')]],'as':_0x39ca25['as'],'attributes':_0x39ca25[_0x7cb2('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e7b87){logger[_0x7cb2('0xc')](_0x7cb2('0x1e'),_0xf17d79);logger[_0x7cb2('0xf')](_0x7cb2('0x1e'),_0xf17d79,JSON['stringify'](_0x4e7b87));_0x3afc0c(_0x4e7b87);})['catch'](function(_0x3179e4){logger[_0x7cb2('0x12')](_0x7cb2('0x1e'),_0x3179e4[_0x7cb2('0x13')],_0xf17d79);_0x595622(_0x5468ed[_0x7cb2('0x12')](0x1f4,_0x3179e4[_0x7cb2('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x4aa9f7){var _0x1cf430=this;return new Promise(function(_0x46f54e,_0x577dc0){return db[_0x7cb2('0x1f')][_0x7cb2('0x20')]({'raw':_0x4aa9f7['options']?_0x4aa9f7[_0x7cb2('0x16')][_0x7cb2('0x17')]===undefined?!![]:![]:!![],'where':_0x4aa9f7[_0x7cb2('0x16')]?_0x4aa9f7['options'][_0x7cb2('0x18')]||null:null,'attributes':_0x4aa9f7[_0x7cb2('0x16')]?_0x4aa9f7[_0x7cb2('0x16')][_0x7cb2('0x19')]||null:null,'include':_0x4aa9f7[_0x7cb2('0x16')]?_0x4aa9f7[_0x7cb2('0x16')][_0x7cb2('0x1b')]?_[_0x7cb2('0x1d')](_0x4aa9f7[_0x7cb2('0x16')][_0x7cb2('0x1b')],function(_0xef16f8){return{'model':db[_0xef16f8[_0x7cb2('0x1c')]],'as':_0xef16f8['as'],'attributes':_0xef16f8[_0x7cb2('0x19')],'include':_0xef16f8['include']?_[_0x7cb2('0x1d')](_0xef16f8[_0x7cb2('0x1b')],function(_0x27bc4f){return{'model':db[_0x27bc4f[_0x7cb2('0x1c')]],'as':_0x27bc4f['as'],'attributes':_0x27bc4f['attributes'],'include':_0x27bc4f[_0x7cb2('0x1b')]?_[_0x7cb2('0x1d')](_0x27bc4f[_0x7cb2('0x1b')],function(_0x1bb7ba){return{'model':db[_0x1bb7ba['model']],'as':_0x1bb7ba['as'],'attributes':_0x1bb7ba[_0x7cb2('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7cb2('0xb')](function(_0x2001b4){logger[_0x7cb2('0xc')](_0x7cb2('0x21'),_0x4aa9f7);logger[_0x7cb2('0xf')](_0x7cb2('0x21'),_0x4aa9f7,JSON[_0x7cb2('0x11')](_0x2001b4));_0x46f54e(_0x2001b4);})[_0x7cb2('0x15')](function(_0x2c96e5){logger[_0x7cb2('0x12')](_0x7cb2('0x21'),_0x2c96e5[_0x7cb2('0x13')],_0x4aa9f7);_0x577dc0(_0x1cf430[_0x7cb2('0x12')](0x1f4,_0x2c96e5[_0x7cb2('0x13')]));});});}; \ No newline at end of file +var _0x9146=['message','ZendeskAccount,\x20%s,\x20%s','info','result','GetZendeskAccount','ZendeskAccount','findAll','options','limit','map','attributes','include','model','catch','ShowZendeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x9146,0x16d));var _0x6914=function(_0x1dc24d,_0x541fa4){_0x1dc24d=_0x1dc24d-0x0;var _0x5d7fb2=_0x9146[_0x1dc24d];return _0x5d7fb2;};'use strict';var _=require(_0x6914('0x0'));var util=require(_0x6914('0x1'));var moment=require(_0x6914('0x2'));var BPromise=require('bluebird');var rs=require(_0x6914('0x3'));var fs=require('fs');var Redis=require(_0x6914('0x4'));var db=require(_0x6914('0x5'))['db'];var utils=require(_0x6914('0x6'));var logger=require(_0x6914('0x7'))(_0x6914('0x8'));var config=require(_0x6914('0x9'));var jayson=require(_0x6914('0xa'));var client=jayson[_0x6914('0xb')][_0x6914('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x470c1a,_0xb85d34,_0xb0435e){return new BPromise(function(_0x2a6a0a,_0x48caa3){return client[_0x6914('0xd')](_0x470c1a,_0xb0435e)[_0x6914('0xe')](function(_0x2ed660){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0xb85d34,'request\x20sent');logger[_0x6914('0xf')](_0x6914('0x10'),_0xb85d34,_0x6914('0x11'),JSON[_0x6914('0x12')](_0x2ed660));if(_0x2ed660[_0x6914('0x13')]){if(_0x2ed660['error']['code']===0x1f4){logger[_0x6914('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0xb85d34,_0x2ed660[_0x6914('0x13')][_0x6914('0x14')]);return _0x48caa3(_0x2ed660[_0x6914('0x13')][_0x6914('0x14')]);}logger[_0x6914('0x13')](_0x6914('0x15'),_0xb85d34,_0x2ed660['error'][_0x6914('0x14')]);return _0x2a6a0a(_0x2ed660[_0x6914('0x13')][_0x6914('0x14')]);}else{logger[_0x6914('0x16')](_0x6914('0x15'),_0xb85d34,_0x6914('0x11'));_0x2a6a0a(_0x2ed660[_0x6914('0x17')][_0x6914('0x14')]);}})['catch'](function(_0x314808){logger[_0x6914('0x13')](_0x6914('0x15'),_0xb85d34,_0x314808);_0x48caa3(_0x314808);});});}exports[_0x6914('0x18')]=function(_0x212345){var _0x1b7340=this;return new Promise(function(_0xcfc7ac,_0xf233b){return db[_0x6914('0x19')][_0x6914('0x1a')]({'raw':_0x212345[_0x6914('0x1b')]?_0x212345[_0x6914('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x212345[_0x6914('0x1b')]?_0x212345[_0x6914('0x1b')]['where']||null:null,'attributes':_0x212345[_0x6914('0x1b')]?_0x212345[_0x6914('0x1b')]['attributes']||null:null,'limit':_0x212345[_0x6914('0x1b')]?_0x212345[_0x6914('0x1b')][_0x6914('0x1c')]||null:null,'include':_0x212345[_0x6914('0x1b')]?_0x212345[_0x6914('0x1b')]['include']?_[_0x6914('0x1d')](_0x212345[_0x6914('0x1b')]['include'],function(_0x5c7eb3){return{'model':db[_0x5c7eb3['model']],'as':_0x5c7eb3['as'],'attributes':_0x5c7eb3[_0x6914('0x1e')],'include':_0x5c7eb3[_0x6914('0x1f')]?_[_0x6914('0x1d')](_0x5c7eb3[_0x6914('0x1f')],function(_0x3aa998){return{'model':db[_0x3aa998[_0x6914('0x20')]],'as':_0x3aa998['as'],'attributes':_0x3aa998['attributes'],'include':_0x3aa998[_0x6914('0x1f')]?_['map'](_0x3aa998['include'],function(_0x3f726b){return{'model':db[_0x3f726b[_0x6914('0x20')]],'as':_0x3f726b['as'],'attributes':_0x3f726b['attributes']};}):[]};}):[]};}):[]:[]})[_0x6914('0xe')](function(_0x4f1554){logger['info'](_0x6914('0x18'),_0x212345);logger[_0x6914('0xf')](_0x6914('0x18'),_0x212345,JSON[_0x6914('0x12')](_0x4f1554));_0xcfc7ac(_0x4f1554);})[_0x6914('0x21')](function(_0x26d744){logger[_0x6914('0x13')]('GetZendeskAccount',_0x26d744[_0x6914('0x14')],_0x212345);_0xf233b(_0x1b7340[_0x6914('0x13')](0x1f4,_0x26d744[_0x6914('0x14')]));});});};exports[_0x6914('0x22')]=function(_0x3bc31a){var _0x462375=this;return new Promise(function(_0x367e6d,_0x54865f){return db[_0x6914('0x19')]['find']({'raw':_0x3bc31a[_0x6914('0x1b')]?_0x3bc31a[_0x6914('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3bc31a[_0x6914('0x1b')]?_0x3bc31a[_0x6914('0x1b')]['where']||null:null,'attributes':_0x3bc31a['options']?_0x3bc31a[_0x6914('0x1b')][_0x6914('0x1e')]||null:null,'include':_0x3bc31a[_0x6914('0x1b')]?_0x3bc31a[_0x6914('0x1b')][_0x6914('0x1f')]?_[_0x6914('0x1d')](_0x3bc31a[_0x6914('0x1b')][_0x6914('0x1f')],function(_0x2e6382){return{'model':db[_0x2e6382['model']],'as':_0x2e6382['as'],'attributes':_0x2e6382[_0x6914('0x1e')],'include':_0x2e6382[_0x6914('0x1f')]?_[_0x6914('0x1d')](_0x2e6382[_0x6914('0x1f')],function(_0x8dd360){return{'model':db[_0x8dd360[_0x6914('0x20')]],'as':_0x8dd360['as'],'attributes':_0x8dd360[_0x6914('0x1e')],'include':_0x8dd360['include']?_['map'](_0x8dd360['include'],function(_0x254942){return{'model':db[_0x254942[_0x6914('0x20')]],'as':_0x254942['as'],'attributes':_0x254942[_0x6914('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc3f411){logger[_0x6914('0x16')](_0x6914('0x22'),_0x3bc31a);logger[_0x6914('0xf')](_0x6914('0x22'),_0x3bc31a,JSON[_0x6914('0x12')](_0xc3f411));_0x367e6d(_0xc3f411);})['catch'](function(_0x3f6861){logger['error']('ShowZendeskAccount',_0x3f6861[_0x6914('0x14')],_0x3bc31a);_0x54865f(_0x462375['error'](0x1f4,_0x3f6861[_0x6914('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index c2a6575..ac1e29c 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 _0xa571=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','update','exports','multer'];(function(_0x56d0e0,_0x1d9532){var _0x2b4e8c=function(_0x386b53){while(--_0x386b53){_0x56d0e0['push'](_0x56d0e0['shift']());}};_0x2b4e8c(++_0x1d9532);}(_0xa571,0x107));var _0x1a57=function(_0x4dce10,_0x410c91){_0x4dce10=_0x4dce10-0x0;var _0x468507=_0xa571[_0x4dce10];return _0x468507;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getFields']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['get']('/:id/tags',auth[_0x1a57('0x8')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),controller['setTags']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x14')]);router['delete'](_0x1a57('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1a57('0x15')]=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x2e19a8,_0x572ed2){var _0x2ee152=function(_0x145d4e){while(--_0x145d4e){_0x2e19a8['push'](_0x2e19a8['shift']());}};_0x2ee152(++_0x572ed2);}(_0xe706,0xa3));var _0x6e70=function(_0x44db60,_0x4ec8ca){_0x44db60=_0x44db60-0x0;var _0x3fa929=_0xe706[_0x44db60];return _0x3fa929;};'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('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index bbbf933..7a70989 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 _0x95ac=['STRING','sequelize'];(function(_0x308cb1,_0x29209a){var _0x4f80da=function(_0x3430d8){while(--_0x3430d8){_0x308cb1['push'](_0x308cb1['shift']());}};_0x4f80da(++_0x29209a);}(_0x95ac,0x71));var _0xc95a=function(_0x4ac2d2,_0x547088){_0x4ac2d2=_0x4ac2d2-0x0;var _0x175eda=_0x95ac[_0x4ac2d2];return _0x175eda;};'use strict';var Sequelize=require(_0xc95a('0x0'));module['exports']={'name':{'type':Sequelize[_0xc95a('0x1')]},'description':{'type':Sequelize[_0xc95a('0x1')]}}; \ No newline at end of file +var _0xb630=['STRING','sequelize','exports'];(function(_0x3f9ac2,_0x1b670b){var _0xe6a436=function(_0x1f3ea5){while(--_0x1f3ea5){_0x3f9ac2['push'](_0x3f9ac2['shift']());}};_0xe6a436(++_0x1b670b);}(_0xb630,0x88));var _0x0b63=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0xb630[_0x3ceb54];return _0x26d8a6;};'use strict';var Sequelize=require(_0x0b63('0x0'));module[_0x0b63('0x1')]={'name':{'type':Sequelize[_0x0b63('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 6d2b586..86dd680 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 _0xc736=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','update','params','getFields','ZendeskField','getSubjects','findOne','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','then','destroy','sendStatus','stack','name','send','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x212b6d,_0x1af22c){var _0x46db77=function(_0x26c04d){while(--_0x26c04d){_0x212b6d['push'](_0x212b6d['shift']());}};_0x46db77(++_0x1af22c);}(_0xc736,0x69));var _0x6c73=function(_0x55440a,_0x1f0a2e){_0x55440a=_0x55440a-0x0;var _0x381496=_0xc736[_0x55440a];return _0x381496;};'use strict';var emlformat=require(_0x6c73('0x0'));var rimraf=require(_0x6c73('0x1'));var zipdir=require(_0x6c73('0x2'));var jsonpatch=require(_0x6c73('0x3'));var rp=require(_0x6c73('0x4'));var moment=require(_0x6c73('0x5'));var BPromise=require(_0x6c73('0x6'));var Mustache=require('mustache');var util=require(_0x6c73('0x7'));var path=require(_0x6c73('0x8'));var sox=require(_0x6c73('0x9'));var csv=require(_0x6c73('0xa'));var ejs=require(_0x6c73('0xb'));var fs=require('fs');var fs_extra=require(_0x6c73('0xc'));var _=require(_0x6c73('0xd'));var squel=require(_0x6c73('0xe'));var crypto=require('crypto');var jsforce=require(_0x6c73('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6c73('0xa'));var querystring=require(_0x6c73('0x10'));var Papa=require('papaparse');var Redis=require(_0x6c73('0x11'));var authService=require(_0x6c73('0x12'));var qs=require(_0x6c73('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c73('0x14'));var logger=require(_0x6c73('0x15'))(_0x6c73('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6c73('0x17'));var db=require(_0x6c73('0x18'))['db'];function respondWithStatusCode(_0x2a6d7a,_0x1e67b4){_0x1e67b4=_0x1e67b4||0xcc;return function(_0x462c8b){if(_0x462c8b){return _0x2a6d7a['sendStatus'](_0x1e67b4);}return _0x2a6d7a['status'](_0x1e67b4)[_0x6c73('0x19')]();};}function respondWithResult(_0x2cb66e,_0x140d98){_0x140d98=_0x140d98||0xc8;return function(_0x47cea6){if(_0x47cea6){return _0x2cb66e['status'](_0x140d98)[_0x6c73('0x1a')](_0x47cea6);}};}function respondWithFilteredResult(_0x222662,_0x6edc59){return function(_0xc35172){if(_0xc35172){var _0x5963f3=typeof _0x6edc59['offset']===_0x6c73('0x1b')&&typeof _0x6edc59[_0x6c73('0x1c')]==='undefined';var _0x51b92a=_0xc35172[_0x6c73('0x1d')];var _0x3a3b0f=_0x5963f3?0x0:_0x6edc59[_0x6c73('0x1e')];var _0x3534d5=_0x5963f3?_0xc35172[_0x6c73('0x1d')]:_0x6edc59[_0x6c73('0x1e')]+_0x6edc59[_0x6c73('0x1c')];var _0x27ed86;if(_0x3534d5>=_0x51b92a){_0x3534d5=_0x51b92a;_0x27ed86=0xc8;}else{_0x27ed86=0xce;}_0x222662[_0x6c73('0x1f')](_0x27ed86);return _0x222662[_0x6c73('0x20')](_0x6c73('0x21'),_0x3a3b0f+'-'+_0x3534d5+'/'+_0x51b92a)['json'](_0xc35172);}return null;};}function patchUpdates(_0x3cdc96){return function(_0x4906ff){try{jsonpatch['apply'](_0x4906ff,_0x3cdc96,!![]);}catch(_0x4dac60){return BPromise[_0x6c73('0x22')](_0x4dac60);}return _0x4906ff['save']();};}function saveUpdates(_0x299f53,_0x6f63bb){return function(_0x17cdae){if(_0x17cdae){return _0x17cdae['update'](_0x299f53)[_0x6c73('0x23')](function(_0x58b17b){return _0x58b17b;});}return null;};}function removeEntity(_0x3881f7,_0x520c54){return function(_0x49fcb4){if(_0x49fcb4){return _0x49fcb4[_0x6c73('0x24')]()[_0x6c73('0x23')](function(){_0x3881f7[_0x6c73('0x1f')](0xcc)[_0x6c73('0x19')]();});}};}function handleEntityNotFound(_0x131b30,_0x3f1440){return function(_0x51d6b1){if(!_0x51d6b1){_0x131b30[_0x6c73('0x25')](0x194);}return _0x51d6b1;};}function handleError(_0x3cc2f2,_0x3febf0){_0x3febf0=_0x3febf0||0x1f4;return function(_0x4198c1){logger['error'](_0x4198c1[_0x6c73('0x26')]);if(_0x4198c1[_0x6c73('0x27')]){delete _0x4198c1['name'];}_0x3cc2f2[_0x6c73('0x1f')](_0x3febf0)[_0x6c73('0x28')](_0x4198c1);};}exports['index']=function(_0x277889,_0x3e60f8){var _0x16ca85={},_0x317536={},_0x18984c={'count':0x0,'rows':[]};var _0x36d033=_[_0x6c73('0x29')](db[_0x6c73('0x2a')][_0x6c73('0x2b')],function(_0x355dab){return{'name':_0x355dab[_0x6c73('0x2c')],'type':_0x355dab[_0x6c73('0x2d')][_0x6c73('0x2e')]};});_0x317536[_0x6c73('0x2f')]=_[_0x6c73('0x29')](_0x36d033,_0x6c73('0x27'));_0x317536[_0x6c73('0x30')]=_[_0x6c73('0x31')](_0x277889[_0x6c73('0x30')]);_0x317536[_0x6c73('0x32')]=_[_0x6c73('0x33')](_0x317536[_0x6c73('0x2f')],_0x317536['query']);_0x16ca85[_0x6c73('0x34')]=_[_0x6c73('0x33')](_0x317536[_0x6c73('0x2f')],qs[_0x6c73('0x35')](_0x277889[_0x6c73('0x30')][_0x6c73('0x35')]));_0x16ca85[_0x6c73('0x34')]=_0x16ca85[_0x6c73('0x34')][_0x6c73('0x36')]?_0x16ca85[_0x6c73('0x34')]:_0x317536[_0x6c73('0x2f')];if(!_0x277889[_0x6c73('0x30')][_0x6c73('0x37')](_0x6c73('0x38'))){_0x16ca85[_0x6c73('0x1c')]=qs[_0x6c73('0x1c')](_0x277889[_0x6c73('0x30')]['limit']);_0x16ca85['offset']=qs[_0x6c73('0x1e')](_0x277889[_0x6c73('0x30')]['offset']);}_0x16ca85[_0x6c73('0x39')]=qs['sort'](_0x277889[_0x6c73('0x30')][_0x6c73('0x3a')]);_0x16ca85[_0x6c73('0x3b')]=qs['filters'](_[_0x6c73('0x3c')](_0x277889[_0x6c73('0x30')],_0x317536[_0x6c73('0x32')]),_0x36d033);if(_0x277889['query'][_0x6c73('0x3d')]){_0x16ca85[_0x6c73('0x3b')]=_[_0x6c73('0x3e')](_0x16ca85[_0x6c73('0x3b')],{'$or':_[_0x6c73('0x29')](_0x36d033,function(_0x248df6){if(_0x248df6['type']!==_0x6c73('0x3f')){var _0x23c04f={};_0x23c04f[_0x248df6['name']]={'$like':'%'+_0x277889[_0x6c73('0x30')][_0x6c73('0x3d')]+'%'};return _0x23c04f;}})});}_0x16ca85=_[_0x6c73('0x3e')]({},_0x16ca85,_0x277889[_0x6c73('0x40')]);var _0x5c00ea={'where':_0x16ca85[_0x6c73('0x3b')]};return db[_0x6c73('0x2a')][_0x6c73('0x1d')](_0x5c00ea)['then'](function(_0x3590b5){_0x18984c['count']=_0x3590b5;if(_0x277889['query'][_0x6c73('0x41')]){_0x16ca85[_0x6c73('0x42')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x16ca85);})[_0x6c73('0x23')](function(_0x56a18d){_0x18984c[_0x6c73('0x43')]=_0x56a18d;return _0x18984c;})[_0x6c73('0x23')](respondWithFilteredResult(_0x3e60f8,_0x16ca85))[_0x6c73('0x44')](handleError(_0x3e60f8,null));};exports[_0x6c73('0x45')]=function(_0x35d608,_0x434b1c){var _0xdb6d9c={'raw':![],'where':{'id':_0x35d608['params']['id']}},_0x582bc2={};_0x582bc2['model']=_['keys'](db[_0x6c73('0x2a')]['rawAttributes']);_0x582bc2['query']=_[_0x6c73('0x31')](_0x35d608['query']);_0x582bc2['filters']=_[_0x6c73('0x33')](_0x582bc2[_0x6c73('0x2f')],_0x582bc2[_0x6c73('0x30')]);_0xdb6d9c[_0x6c73('0x34')]=_['intersection'](_0x582bc2[_0x6c73('0x2f')],qs[_0x6c73('0x35')](_0x35d608['query'][_0x6c73('0x35')]));_0xdb6d9c['attributes']=_0xdb6d9c['attributes'][_0x6c73('0x36')]?_0xdb6d9c['attributes']:_0x582bc2[_0x6c73('0x2f')];if(_0x35d608[_0x6c73('0x30')]['includeAll']){_0xdb6d9c[_0x6c73('0x42')]=[{'all':!![]}];}_0xdb6d9c=_['merge']({},_0xdb6d9c,_0x35d608['options']);return db[_0x6c73('0x2a')][_0x6c73('0x46')](_0xdb6d9c)[_0x6c73('0x23')](handleEntityNotFound(_0x434b1c,null))['then'](respondWithResult(_0x434b1c,null))['catch'](handleError(_0x434b1c,null));};exports[_0x6c73('0x47')]=function(_0x55f014,_0x27309e){return db[_0x6c73('0x2a')]['create'](_0x55f014[_0x6c73('0x48')],{})[_0x6c73('0x23')](respondWithResult(_0x27309e,0xc9))[_0x6c73('0x44')](handleError(_0x27309e,null));};exports[_0x6c73('0x49')]=function(_0x177f32,_0x156666){if(_0x177f32[_0x6c73('0x48')]['id']){delete _0x177f32[_0x6c73('0x48')]['id'];}return db[_0x6c73('0x2a')]['find']({'where':{'id':_0x177f32[_0x6c73('0x4a')]['id']}})[_0x6c73('0x23')](handleEntityNotFound(_0x156666,null))['then'](saveUpdates(_0x177f32[_0x6c73('0x48')],null))[_0x6c73('0x23')](respondWithResult(_0x156666,null))[_0x6c73('0x44')](handleError(_0x156666,null));};exports['destroy']=function(_0x36af7d,_0x3c9b22){return db[_0x6c73('0x2a')][_0x6c73('0x46')]({'where':{'id':_0x36af7d[_0x6c73('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c9b22,null))[_0x6c73('0x23')](removeEntity(_0x3c9b22,null))['catch'](handleError(_0x3c9b22,null));};exports[_0x6c73('0x4b')]=function(_0x30f850,_0x4c557a,_0x326a8a){var _0x3c59ee={};var _0x2a5906={};var _0x4b5c37;var _0xe7ee98;return db[_0x6c73('0x2a')]['findOne']({'where':{'id':_0x30f850[_0x6c73('0x4a')]['id']}})[_0x6c73('0x23')](handleEntityNotFound(_0x4c557a,null))[_0x6c73('0x23')](function(_0x702386){if(_0x702386){_0x4b5c37=_0x702386;_0x2a5906[_0x6c73('0x2f')]=_[_0x6c73('0x31')](db[_0x6c73('0x4c')][_0x6c73('0x2b')]);_0x2a5906[_0x6c73('0x30')]=_[_0x6c73('0x31')](_0x30f850['query']);_0x2a5906[_0x6c73('0x32')]=_[_0x6c73('0x33')](_0x2a5906[_0x6c73('0x2f')],_0x2a5906['query']);_0x3c59ee[_0x6c73('0x34')]=_[_0x6c73('0x33')](_0x2a5906[_0x6c73('0x2f')],qs[_0x6c73('0x35')](_0x30f850[_0x6c73('0x30')]['fields']));_0x3c59ee[_0x6c73('0x34')]=_0x3c59ee['attributes']['length']?_0x3c59ee['attributes']:_0x2a5906[_0x6c73('0x2f')];_0x3c59ee[_0x6c73('0x39')]=qs[_0x6c73('0x3a')](_0x30f850[_0x6c73('0x30')]['sort']);_0x3c59ee[_0x6c73('0x3b')]=qs[_0x6c73('0x32')](_[_0x6c73('0x3c')](_0x30f850[_0x6c73('0x30')],_0x2a5906[_0x6c73('0x32')]));if(_0x30f850[_0x6c73('0x30')][_0x6c73('0x3d')]){_0x3c59ee['where']=_[_0x6c73('0x3e')](_0x3c59ee[_0x6c73('0x3b')],{'$or':_[_0x6c73('0x29')](_0x3c59ee[_0x6c73('0x34')],function(_0x5aefa4){var _0x50c4d9={};_0x50c4d9[_0x5aefa4]={'$like':'%'+_0x30f850[_0x6c73('0x30')]['filter']+'%'};return _0x50c4d9;})});}_0x3c59ee=_[_0x6c73('0x3e')]({},_0x3c59ee,_0x30f850[_0x6c73('0x40')]);return _0x4b5c37[_0x6c73('0x4b')](_0x3c59ee);}})['then'](function(_0x4092dc){if(_0x4092dc){_0xe7ee98=_0x4092dc[_0x6c73('0x36')];if(!_0x30f850[_0x6c73('0x30')]['hasOwnProperty']('nolimit')){_0x3c59ee['limit']=qs[_0x6c73('0x1c')](_0x30f850[_0x6c73('0x30')][_0x6c73('0x1c')]);_0x3c59ee[_0x6c73('0x1e')]=qs[_0x6c73('0x1e')](_0x30f850['query'][_0x6c73('0x1e')]);}return _0x4b5c37[_0x6c73('0x4b')](_0x3c59ee);}})[_0x6c73('0x23')](function(_0x2496d0){if(_0x2496d0){return _0x2496d0?{'count':_0xe7ee98,'rows':_0x2496d0}:null;}})[_0x6c73('0x23')](respondWithResult(_0x4c557a,null))['catch'](handleError(_0x4c557a,null));};exports[_0x6c73('0x4d')]=function(_0x36d99d,_0x3d98d1,_0x2b73f2){var _0x4aaa42={};var _0x786db4={};var _0x2b2bb7;var _0x3ca731;return db[_0x6c73('0x2a')][_0x6c73('0x4e')]({'where':{'id':_0x36d99d['params']['id']}})['then'](handleEntityNotFound(_0x3d98d1,null))[_0x6c73('0x23')](function(_0x5ce7d5){if(_0x5ce7d5){_0x2b2bb7=_0x5ce7d5;_0x786db4['model']=_['keys'](db['ZendeskField'][_0x6c73('0x2b')]);_0x786db4[_0x6c73('0x30')]=_[_0x6c73('0x31')](_0x36d99d[_0x6c73('0x30')]);_0x786db4[_0x6c73('0x32')]=_[_0x6c73('0x33')](_0x786db4['model'],_0x786db4[_0x6c73('0x30')]);_0x4aaa42[_0x6c73('0x34')]=_[_0x6c73('0x33')](_0x786db4['model'],qs[_0x6c73('0x35')](_0x36d99d[_0x6c73('0x30')][_0x6c73('0x35')]));_0x4aaa42[_0x6c73('0x34')]=_0x4aaa42[_0x6c73('0x34')][_0x6c73('0x36')]?_0x4aaa42[_0x6c73('0x34')]:_0x786db4[_0x6c73('0x2f')];_0x4aaa42['order']=qs[_0x6c73('0x3a')](_0x36d99d[_0x6c73('0x30')]['sort']);_0x4aaa42['where']=qs['filters'](_['pick'](_0x36d99d[_0x6c73('0x30')],_0x786db4['filters']));if(_0x36d99d[_0x6c73('0x30')]['filter']){_0x4aaa42[_0x6c73('0x3b')]=_[_0x6c73('0x3e')](_0x4aaa42['where'],{'$or':_['map'](_0x4aaa42[_0x6c73('0x34')],function(_0x328aa0){var _0x548ae3={};_0x548ae3[_0x328aa0]={'$like':'%'+_0x36d99d['query'][_0x6c73('0x3d')]+'%'};return _0x548ae3;})});}_0x4aaa42=_[_0x6c73('0x3e')]({},_0x4aaa42,_0x36d99d['options']);return _0x2b2bb7['getSubjects'](_0x4aaa42);}})[_0x6c73('0x23')](function(_0x6e4c8b){if(_0x6e4c8b){_0x3ca731=_0x6e4c8b[_0x6c73('0x36')];if(!_0x36d99d[_0x6c73('0x30')][_0x6c73('0x37')](_0x6c73('0x38'))){_0x4aaa42['limit']=qs[_0x6c73('0x1c')](_0x36d99d[_0x6c73('0x30')][_0x6c73('0x1c')]);_0x4aaa42[_0x6c73('0x1e')]=qs[_0x6c73('0x1e')](_0x36d99d[_0x6c73('0x30')][_0x6c73('0x1e')]);}return _0x2b2bb7['getSubjects'](_0x4aaa42);}})['then'](function(_0x37092d){if(_0x37092d){return _0x37092d?{'count':_0x3ca731,'rows':_0x37092d}:null;}})['then'](respondWithResult(_0x3d98d1,null))[_0x6c73('0x44')](handleError(_0x3d98d1,null));};exports[_0x6c73('0x4f')]=function(_0x53a457,_0x31c729,_0x10c935){var _0x15a28c={};var _0x2b772e={};var _0x1bae68;var _0x47ea62;return db[_0x6c73('0x2a')]['findOne']({'where':{'id':_0x53a457[_0x6c73('0x4a')]['id']}})[_0x6c73('0x23')](handleEntityNotFound(_0x31c729,null))['then'](function(_0x13a684){if(_0x13a684){_0x1bae68=_0x13a684;_0x2b772e['model']=_[_0x6c73('0x31')](db[_0x6c73('0x4c')][_0x6c73('0x2b')]);_0x2b772e[_0x6c73('0x30')]=_['keys'](_0x53a457[_0x6c73('0x30')]);_0x2b772e[_0x6c73('0x32')]=_[_0x6c73('0x33')](_0x2b772e['model'],_0x2b772e[_0x6c73('0x30')]);_0x15a28c[_0x6c73('0x34')]=_[_0x6c73('0x33')](_0x2b772e[_0x6c73('0x2f')],qs[_0x6c73('0x35')](_0x53a457[_0x6c73('0x30')][_0x6c73('0x35')]));_0x15a28c['attributes']=_0x15a28c[_0x6c73('0x34')]['length']?_0x15a28c['attributes']:_0x2b772e['model'];_0x15a28c[_0x6c73('0x39')]=qs[_0x6c73('0x3a')](_0x53a457[_0x6c73('0x30')][_0x6c73('0x3a')]);_0x15a28c[_0x6c73('0x3b')]=qs[_0x6c73('0x32')](_[_0x6c73('0x3c')](_0x53a457[_0x6c73('0x30')],_0x2b772e[_0x6c73('0x32')]));if(_0x53a457[_0x6c73('0x30')][_0x6c73('0x3d')]){_0x15a28c['where']=_[_0x6c73('0x3e')](_0x15a28c['where'],{'$or':_[_0x6c73('0x29')](_0x15a28c[_0x6c73('0x34')],function(_0x213256){var _0x3e9bcc={};_0x3e9bcc[_0x213256]={'$like':'%'+_0x53a457[_0x6c73('0x30')][_0x6c73('0x3d')]+'%'};return _0x3e9bcc;})});}_0x15a28c=_[_0x6c73('0x3e')]({},_0x15a28c,_0x53a457[_0x6c73('0x40')]);return _0x1bae68[_0x6c73('0x4f')](_0x15a28c);}})[_0x6c73('0x23')](function(_0x3b4535){if(_0x3b4535){_0x47ea62=_0x3b4535[_0x6c73('0x36')];if(!_0x53a457['query'][_0x6c73('0x37')](_0x6c73('0x38'))){_0x15a28c[_0x6c73('0x1c')]=qs[_0x6c73('0x1c')](_0x53a457[_0x6c73('0x30')][_0x6c73('0x1c')]);_0x15a28c[_0x6c73('0x1e')]=qs[_0x6c73('0x1e')](_0x53a457[_0x6c73('0x30')]['offset']);}return _0x1bae68[_0x6c73('0x4f')](_0x15a28c);}})[_0x6c73('0x23')](function(_0x9f29c){if(_0x9f29c){return _0x9f29c?{'count':_0x47ea62,'rows':_0x9f29c}:null;}})['then'](respondWithResult(_0x31c729,null))[_0x6c73('0x44')](handleError(_0x31c729,null));};exports[_0x6c73('0x50')]=function(_0xdfb8b,_0xd72f72,_0x4f7e68){var _0x14ab1d={};var _0x4ffbf0={};var _0x40038;var _0x56a851;return db[_0x6c73('0x2a')][_0x6c73('0x4e')]({'where':{'id':_0xdfb8b[_0x6c73('0x4a')]['id']}})[_0x6c73('0x23')](handleEntityNotFound(_0xd72f72,null))[_0x6c73('0x23')](function(_0x591159){if(_0x591159){_0x40038=_0x591159;_0x4ffbf0[_0x6c73('0x2f')]=_[_0x6c73('0x31')](db['Tag'][_0x6c73('0x2b')]);_0x4ffbf0[_0x6c73('0x30')]=_[_0x6c73('0x31')](_0xdfb8b['query']);_0x4ffbf0[_0x6c73('0x32')]=_[_0x6c73('0x33')](_0x4ffbf0[_0x6c73('0x2f')],_0x4ffbf0['query']);_0x14ab1d[_0x6c73('0x34')]=_[_0x6c73('0x33')](_0x4ffbf0[_0x6c73('0x2f')],qs[_0x6c73('0x35')](_0xdfb8b[_0x6c73('0x30')][_0x6c73('0x35')]));_0x14ab1d[_0x6c73('0x34')]=_0x14ab1d['attributes']['length']?_0x14ab1d[_0x6c73('0x34')]:_0x4ffbf0[_0x6c73('0x2f')];_0x14ab1d[_0x6c73('0x39')]=qs[_0x6c73('0x3a')](_0xdfb8b[_0x6c73('0x30')][_0x6c73('0x3a')]);_0x14ab1d[_0x6c73('0x3b')]=qs[_0x6c73('0x32')](_[_0x6c73('0x3c')](_0xdfb8b[_0x6c73('0x30')],_0x4ffbf0[_0x6c73('0x32')]));if(_0xdfb8b[_0x6c73('0x30')][_0x6c73('0x3d')]){_0x14ab1d[_0x6c73('0x3b')]=_[_0x6c73('0x3e')](_0x14ab1d['where'],{'$or':_['map'](_0x14ab1d['attributes'],function(_0x196a6e){var _0x50b74c={};_0x50b74c[_0x196a6e]={'$like':'%'+_0xdfb8b[_0x6c73('0x30')][_0x6c73('0x3d')]+'%'};return _0x50b74c;})});}_0x14ab1d=_[_0x6c73('0x3e')]({},_0x14ab1d,_0xdfb8b['options']);return _0x40038[_0x6c73('0x50')](_0x14ab1d);}})[_0x6c73('0x23')](function(_0x472a11){if(_0x472a11){_0x56a851=_0x472a11['length'];if(!_0xdfb8b[_0x6c73('0x30')][_0x6c73('0x37')]('nolimit')){_0x14ab1d[_0x6c73('0x1c')]=qs['limit'](_0xdfb8b[_0x6c73('0x30')][_0x6c73('0x1c')]);_0x14ab1d[_0x6c73('0x1e')]=qs[_0x6c73('0x1e')](_0xdfb8b[_0x6c73('0x30')][_0x6c73('0x1e')]);}return _0x40038[_0x6c73('0x50')](_0x14ab1d);}})[_0x6c73('0x23')](function(_0x12d354){if(_0x12d354){return _0x12d354?{'count':_0x56a851,'rows':_0x12d354}:null;}})['then'](respondWithResult(_0xd72f72,null))[_0x6c73('0x44')](handleError(_0xd72f72,null));};exports['setTags']=function(_0x2c3590,_0x497e52,_0xefdc1f){if(_0x2c3590[_0x6c73('0x48')]['id']){delete _0x2c3590['body']['id'];}return db[_0x6c73('0x2a')]['findOne']({'where':{'id':_0x2c3590[_0x6c73('0x4a')]['id']}})['then'](handleEntityNotFound(_0x497e52,null))[_0x6c73('0x23')](function(_0x34bab6){if(_0x34bab6){return _0x34bab6[_0x6c73('0x51')](_0x2c3590[_0x6c73('0x48')]['ids']||[]);}return null;})[_0x6c73('0x23')](respondWithResult(_0x497e52,null))[_0x6c73('0x44')](handleError(_0x497e52,null));}; \ No newline at end of file +var _0xb10e=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','count','Content-Range','json','save','update','then','destroy','end','sendStatus','name','send','index','map','rawAttributes','fieldName','key','keys','filters','intersection','model','fields','query','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ZendeskConfiguration','findAll','rows','catch','show','params','includeAll','include','find','create','getFields','findOne','ZendeskField','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0xafbe24,_0x577086){var _0x1fbcc2=function(_0x478e8e){while(--_0x478e8e){_0xafbe24['push'](_0xafbe24['shift']());}};_0x1fbcc2(++_0x577086);}(_0xb10e,0xec));var _0xeb10=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb10e[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb10('0x0'));var zipdir=require(_0xeb10('0x1'));var jsonpatch=require(_0xeb10('0x2'));var rp=require('request-promise');var moment=require(_0xeb10('0x3'));var BPromise=require(_0xeb10('0x4'));var Mustache=require(_0xeb10('0x5'));var util=require('util');var path=require(_0xeb10('0x6'));var sox=require(_0xeb10('0x7'));var csv=require('to-csv');var ejs=require(_0xeb10('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb10('0x9'));var squel=require(_0xeb10('0xa'));var crypto=require(_0xeb10('0xb'));var jsforce=require(_0xeb10('0xc'));var deskjs=require(_0xeb10('0xd'));var toCsv=require(_0xeb10('0xe'));var querystring=require(_0xeb10('0xf'));var Papa=require(_0xeb10('0x10'));var Redis=require(_0xeb10('0x11'));var authService=require(_0xeb10('0x12'));var qs=require(_0xeb10('0x13'));var as=require(_0xeb10('0x14'));var hardwareService=require(_0xeb10('0x15'));var logger=require('../../config/logger')(_0xeb10('0x16'));var utils=require(_0xeb10('0x17'));var config=require(_0xeb10('0x18'));var licenseUtil=require(_0xeb10('0x19'));var db=require(_0xeb10('0x1a'))['db'];function respondWithStatusCode(_0x2df3b6,_0x4b1444){_0x4b1444=_0x4b1444||0xcc;return function(_0x284288){if(_0x284288){return _0x2df3b6['sendStatus'](_0x4b1444);}return _0x2df3b6['status'](_0x4b1444)['end']();};}function respondWithResult(_0xa55663,_0x3e8299){_0x3e8299=_0x3e8299||0xc8;return function(_0x41122d){if(_0x41122d){return _0xa55663[_0xeb10('0x1b')](_0x3e8299)['json'](_0x41122d);}};}function respondWithFilteredResult(_0x1266f2,_0x34c46b){return function(_0x4ddbd5){if(_0x4ddbd5){var _0x3b06cb=typeof _0x34c46b[_0xeb10('0x1c')]==='undefined'&&typeof _0x34c46b[_0xeb10('0x1d')]==='undefined';var _0x25bbb8=_0x4ddbd5['count'];var _0x4d97b7=_0x3b06cb?0x0:_0x34c46b[_0xeb10('0x1c')];var _0x46feb9=_0x3b06cb?_0x4ddbd5[_0xeb10('0x1e')]:_0x34c46b['offset']+_0x34c46b[_0xeb10('0x1d')];var _0x53b9e5;if(_0x46feb9>=_0x25bbb8){_0x46feb9=_0x25bbb8;_0x53b9e5=0xc8;}else{_0x53b9e5=0xce;}_0x1266f2[_0xeb10('0x1b')](_0x53b9e5);return _0x1266f2['set'](_0xeb10('0x1f'),_0x4d97b7+'-'+_0x46feb9+'/'+_0x25bbb8)[_0xeb10('0x20')](_0x4ddbd5);}return null;};}function patchUpdates(_0x8f58cf){return function(_0x34236d){try{jsonpatch['apply'](_0x34236d,_0x8f58cf,!![]);}catch(_0x195178){return BPromise['reject'](_0x195178);}return _0x34236d[_0xeb10('0x21')]();};}function saveUpdates(_0x4a98e5,_0x260cd6){return function(_0x508fd0){if(_0x508fd0){return _0x508fd0[_0xeb10('0x22')](_0x4a98e5)[_0xeb10('0x23')](function(_0x53a1b6){return _0x53a1b6;});}return null;};}function removeEntity(_0x599d94,_0x32fd47){return function(_0x2ee8de){if(_0x2ee8de){return _0x2ee8de[_0xeb10('0x24')]()[_0xeb10('0x23')](function(){_0x599d94[_0xeb10('0x1b')](0xcc)[_0xeb10('0x25')]();});}};}function handleEntityNotFound(_0x26d268,_0x2ad126){return function(_0x1c7afc){if(!_0x1c7afc){_0x26d268[_0xeb10('0x26')](0x194);}return _0x1c7afc;};}function handleError(_0x280882,_0x2aa2fa){_0x2aa2fa=_0x2aa2fa||0x1f4;return function(_0xb31064){logger['error'](_0xb31064['stack']);if(_0xb31064[_0xeb10('0x27')]){delete _0xb31064['name'];}_0x280882[_0xeb10('0x1b')](_0x2aa2fa)[_0xeb10('0x28')](_0xb31064);};}exports[_0xeb10('0x29')]=function(_0x4262bb,_0x39ca04){var _0x553eda={},_0x12cf9b={},_0x27bee3={'count':0x0,'rows':[]};var _0x5c482a=_[_0xeb10('0x2a')](db['ZendeskConfiguration'][_0xeb10('0x2b')],function(_0x55ecba){return{'name':_0x55ecba[_0xeb10('0x2c')],'type':_0x55ecba['type'][_0xeb10('0x2d')]};});_0x12cf9b['model']=_[_0xeb10('0x2a')](_0x5c482a,_0xeb10('0x27'));_0x12cf9b['query']=_[_0xeb10('0x2e')](_0x4262bb['query']);_0x12cf9b[_0xeb10('0x2f')]=_['intersection'](_0x12cf9b['model'],_0x12cf9b['query']);_0x553eda['attributes']=_[_0xeb10('0x30')](_0x12cf9b[_0xeb10('0x31')],qs[_0xeb10('0x32')](_0x4262bb[_0xeb10('0x33')][_0xeb10('0x32')]));_0x553eda['attributes']=_0x553eda[_0xeb10('0x34')][_0xeb10('0x35')]?_0x553eda[_0xeb10('0x34')]:_0x12cf9b[_0xeb10('0x31')];if(!_0x4262bb['query'][_0xeb10('0x36')]('nolimit')){_0x553eda['limit']=qs['limit'](_0x4262bb[_0xeb10('0x33')][_0xeb10('0x1d')]);_0x553eda[_0xeb10('0x1c')]=qs[_0xeb10('0x1c')](_0x4262bb['query']['offset']);}_0x553eda[_0xeb10('0x37')]=qs[_0xeb10('0x38')](_0x4262bb[_0xeb10('0x33')][_0xeb10('0x38')]);_0x553eda[_0xeb10('0x39')]=qs['filters'](_[_0xeb10('0x3a')](_0x4262bb[_0xeb10('0x33')],_0x12cf9b[_0xeb10('0x2f')]),_0x5c482a);if(_0x4262bb[_0xeb10('0x33')][_0xeb10('0x3b')]){_0x553eda[_0xeb10('0x39')]=_[_0xeb10('0x3c')](_0x553eda[_0xeb10('0x39')],{'$or':_[_0xeb10('0x2a')](_0x5c482a,function(_0x5ebae4){if(_0x5ebae4[_0xeb10('0x3d')]!==_0xeb10('0x3e')){var _0x4a8a41={};_0x4a8a41[_0x5ebae4['name']]={'$like':'%'+_0x4262bb[_0xeb10('0x33')][_0xeb10('0x3b')]+'%'};return _0x4a8a41;}})});}_0x553eda=_[_0xeb10('0x3c')]({},_0x553eda,_0x4262bb[_0xeb10('0x3f')]);var _0x4924c8={'where':_0x553eda[_0xeb10('0x39')]};return db[_0xeb10('0x40')][_0xeb10('0x1e')](_0x4924c8)[_0xeb10('0x23')](function(_0x5dda18){_0x27bee3[_0xeb10('0x1e')]=_0x5dda18;if(_0x4262bb[_0xeb10('0x33')]['includeAll']){_0x553eda['include']=[{'all':!![]}];}return db[_0xeb10('0x40')][_0xeb10('0x41')](_0x553eda);})[_0xeb10('0x23')](function(_0x262a07){_0x27bee3[_0xeb10('0x42')]=_0x262a07;return _0x27bee3;})[_0xeb10('0x23')](respondWithFilteredResult(_0x39ca04,_0x553eda))[_0xeb10('0x43')](handleError(_0x39ca04,null));};exports[_0xeb10('0x44')]=function(_0x5b6be5,_0x243d7d){var _0x28509c={'raw':![],'where':{'id':_0x5b6be5[_0xeb10('0x45')]['id']}},_0x3fefa5={};_0x3fefa5[_0xeb10('0x31')]=_[_0xeb10('0x2e')](db[_0xeb10('0x40')][_0xeb10('0x2b')]);_0x3fefa5['query']=_[_0xeb10('0x2e')](_0x5b6be5[_0xeb10('0x33')]);_0x3fefa5[_0xeb10('0x2f')]=_[_0xeb10('0x30')](_0x3fefa5['model'],_0x3fefa5[_0xeb10('0x33')]);_0x28509c[_0xeb10('0x34')]=_['intersection'](_0x3fefa5['model'],qs['fields'](_0x5b6be5[_0xeb10('0x33')][_0xeb10('0x32')]));_0x28509c[_0xeb10('0x34')]=_0x28509c['attributes'][_0xeb10('0x35')]?_0x28509c[_0xeb10('0x34')]:_0x3fefa5[_0xeb10('0x31')];if(_0x5b6be5['query'][_0xeb10('0x46')]){_0x28509c[_0xeb10('0x47')]=[{'all':!![]}];}_0x28509c=_[_0xeb10('0x3c')]({},_0x28509c,_0x5b6be5[_0xeb10('0x3f')]);return db[_0xeb10('0x40')][_0xeb10('0x48')](_0x28509c)[_0xeb10('0x23')](handleEntityNotFound(_0x243d7d,null))[_0xeb10('0x23')](respondWithResult(_0x243d7d,null))[_0xeb10('0x43')](handleError(_0x243d7d,null));};exports[_0xeb10('0x49')]=function(_0x46f09e,_0x4f2475){return db[_0xeb10('0x40')]['create'](_0x46f09e['body'],{})[_0xeb10('0x23')](respondWithResult(_0x4f2475,0xc9))['catch'](handleError(_0x4f2475,null));};exports['update']=function(_0xacf21c,_0x5ef3f0){if(_0xacf21c['body']['id']){delete _0xacf21c['body']['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0xacf21c['params']['id']}})[_0xeb10('0x23')](handleEntityNotFound(_0x5ef3f0,null))['then'](saveUpdates(_0xacf21c['body'],null))['then'](respondWithResult(_0x5ef3f0,null))['catch'](handleError(_0x5ef3f0,null));};exports['destroy']=function(_0x32fbcf,_0x155cf7){return db[_0xeb10('0x40')][_0xeb10('0x48')]({'where':{'id':_0x32fbcf[_0xeb10('0x45')]['id']}})['then'](handleEntityNotFound(_0x155cf7,null))['then'](removeEntity(_0x155cf7,null))[_0xeb10('0x43')](handleError(_0x155cf7,null));};exports[_0xeb10('0x4a')]=function(_0x3937b9,_0x3d70d2,_0x1f9aca){var _0x55709d={};var _0x3b2210={};var _0x340e45;var _0x4b051d;return db[_0xeb10('0x40')][_0xeb10('0x4b')]({'where':{'id':_0x3937b9['params']['id']}})[_0xeb10('0x23')](handleEntityNotFound(_0x3d70d2,null))[_0xeb10('0x23')](function(_0x474b7e){if(_0x474b7e){_0x340e45=_0x474b7e;_0x3b2210['model']=_[_0xeb10('0x2e')](db[_0xeb10('0x4c')][_0xeb10('0x2b')]);_0x3b2210[_0xeb10('0x33')]=_['keys'](_0x3937b9[_0xeb10('0x33')]);_0x3b2210[_0xeb10('0x2f')]=_[_0xeb10('0x30')](_0x3b2210[_0xeb10('0x31')],_0x3b2210[_0xeb10('0x33')]);_0x55709d['attributes']=_[_0xeb10('0x30')](_0x3b2210[_0xeb10('0x31')],qs[_0xeb10('0x32')](_0x3937b9[_0xeb10('0x33')][_0xeb10('0x32')]));_0x55709d[_0xeb10('0x34')]=_0x55709d[_0xeb10('0x34')]['length']?_0x55709d['attributes']:_0x3b2210[_0xeb10('0x31')];_0x55709d[_0xeb10('0x37')]=qs[_0xeb10('0x38')](_0x3937b9[_0xeb10('0x33')][_0xeb10('0x38')]);_0x55709d[_0xeb10('0x39')]=qs[_0xeb10('0x2f')](_[_0xeb10('0x3a')](_0x3937b9['query'],_0x3b2210['filters']));if(_0x3937b9['query'][_0xeb10('0x3b')]){_0x55709d[_0xeb10('0x39')]=_['merge'](_0x55709d[_0xeb10('0x39')],{'$or':_['map'](_0x55709d[_0xeb10('0x34')],function(_0x2ba278){var _0x4226be={};_0x4226be[_0x2ba278]={'$like':'%'+_0x3937b9[_0xeb10('0x33')][_0xeb10('0x3b')]+'%'};return _0x4226be;})});}_0x55709d=_['merge']({},_0x55709d,_0x3937b9[_0xeb10('0x3f')]);return _0x340e45[_0xeb10('0x4a')](_0x55709d);}})[_0xeb10('0x23')](function(_0x241f62){if(_0x241f62){_0x4b051d=_0x241f62[_0xeb10('0x35')];if(!_0x3937b9[_0xeb10('0x33')][_0xeb10('0x36')](_0xeb10('0x4d'))){_0x55709d[_0xeb10('0x1d')]=qs[_0xeb10('0x1d')](_0x3937b9[_0xeb10('0x33')][_0xeb10('0x1d')]);_0x55709d[_0xeb10('0x1c')]=qs['offset'](_0x3937b9[_0xeb10('0x33')]['offset']);}return _0x340e45['getFields'](_0x55709d);}})[_0xeb10('0x23')](function(_0x52cb35){if(_0x52cb35){return _0x52cb35?{'count':_0x4b051d,'rows':_0x52cb35}:null;}})[_0xeb10('0x23')](respondWithResult(_0x3d70d2,null))['catch'](handleError(_0x3d70d2,null));};exports[_0xeb10('0x4e')]=function(_0x37a146,_0x4f120c,_0x4583bf){var _0x137579={};var _0x31fd85={};var _0x4f8bf3;var _0x3c4c08;return db['ZendeskConfiguration'][_0xeb10('0x4b')]({'where':{'id':_0x37a146[_0xeb10('0x45')]['id']}})[_0xeb10('0x23')](handleEntityNotFound(_0x4f120c,null))[_0xeb10('0x23')](function(_0xe5e0b3){if(_0xe5e0b3){_0x4f8bf3=_0xe5e0b3;_0x31fd85['model']=_[_0xeb10('0x2e')](db[_0xeb10('0x4c')][_0xeb10('0x2b')]);_0x31fd85[_0xeb10('0x33')]=_[_0xeb10('0x2e')](_0x37a146[_0xeb10('0x33')]);_0x31fd85[_0xeb10('0x2f')]=_[_0xeb10('0x30')](_0x31fd85[_0xeb10('0x31')],_0x31fd85[_0xeb10('0x33')]);_0x137579[_0xeb10('0x34')]=_[_0xeb10('0x30')](_0x31fd85[_0xeb10('0x31')],qs[_0xeb10('0x32')](_0x37a146[_0xeb10('0x33')][_0xeb10('0x32')]));_0x137579[_0xeb10('0x34')]=_0x137579['attributes']['length']?_0x137579['attributes']:_0x31fd85[_0xeb10('0x31')];_0x137579['order']=qs[_0xeb10('0x38')](_0x37a146[_0xeb10('0x33')][_0xeb10('0x38')]);_0x137579['where']=qs[_0xeb10('0x2f')](_[_0xeb10('0x3a')](_0x37a146['query'],_0x31fd85[_0xeb10('0x2f')]));if(_0x37a146[_0xeb10('0x33')][_0xeb10('0x3b')]){_0x137579['where']=_[_0xeb10('0x3c')](_0x137579['where'],{'$or':_[_0xeb10('0x2a')](_0x137579[_0xeb10('0x34')],function(_0x2d2551){var _0x544bf0={};_0x544bf0[_0x2d2551]={'$like':'%'+_0x37a146['query'][_0xeb10('0x3b')]+'%'};return _0x544bf0;})});}_0x137579=_[_0xeb10('0x3c')]({},_0x137579,_0x37a146[_0xeb10('0x3f')]);return _0x4f8bf3['getSubjects'](_0x137579);}})[_0xeb10('0x23')](function(_0x253c61){if(_0x253c61){_0x3c4c08=_0x253c61[_0xeb10('0x35')];if(!_0x37a146['query'][_0xeb10('0x36')](_0xeb10('0x4d'))){_0x137579[_0xeb10('0x1d')]=qs[_0xeb10('0x1d')](_0x37a146['query'][_0xeb10('0x1d')]);_0x137579['offset']=qs[_0xeb10('0x1c')](_0x37a146['query'][_0xeb10('0x1c')]);}return _0x4f8bf3[_0xeb10('0x4e')](_0x137579);}})[_0xeb10('0x23')](function(_0xa9e260){if(_0xa9e260){return _0xa9e260?{'count':_0x3c4c08,'rows':_0xa9e260}:null;}})[_0xeb10('0x23')](respondWithResult(_0x4f120c,null))[_0xeb10('0x43')](handleError(_0x4f120c,null));};exports[_0xeb10('0x4f')]=function(_0x563824,_0xb01c48,_0x1e1a80){var _0x1cebb6={};var _0x26fdcb={};var _0x10dc94;var _0x375ff5;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x563824[_0xeb10('0x45')]['id']}})[_0xeb10('0x23')](handleEntityNotFound(_0xb01c48,null))[_0xeb10('0x23')](function(_0x5e8007){if(_0x5e8007){_0x10dc94=_0x5e8007;_0x26fdcb[_0xeb10('0x31')]=_[_0xeb10('0x2e')](db[_0xeb10('0x4c')][_0xeb10('0x2b')]);_0x26fdcb[_0xeb10('0x33')]=_[_0xeb10('0x2e')](_0x563824[_0xeb10('0x33')]);_0x26fdcb[_0xeb10('0x2f')]=_['intersection'](_0x26fdcb[_0xeb10('0x31')],_0x26fdcb[_0xeb10('0x33')]);_0x1cebb6['attributes']=_[_0xeb10('0x30')](_0x26fdcb['model'],qs[_0xeb10('0x32')](_0x563824[_0xeb10('0x33')][_0xeb10('0x32')]));_0x1cebb6[_0xeb10('0x34')]=_0x1cebb6[_0xeb10('0x34')][_0xeb10('0x35')]?_0x1cebb6['attributes']:_0x26fdcb[_0xeb10('0x31')];_0x1cebb6[_0xeb10('0x37')]=qs['sort'](_0x563824[_0xeb10('0x33')][_0xeb10('0x38')]);_0x1cebb6[_0xeb10('0x39')]=qs[_0xeb10('0x2f')](_['pick'](_0x563824[_0xeb10('0x33')],_0x26fdcb['filters']));if(_0x563824[_0xeb10('0x33')]['filter']){_0x1cebb6[_0xeb10('0x39')]=_['merge'](_0x1cebb6[_0xeb10('0x39')],{'$or':_['map'](_0x1cebb6[_0xeb10('0x34')],function(_0x1ee1d6){var _0x204d84={};_0x204d84[_0x1ee1d6]={'$like':'%'+_0x563824[_0xeb10('0x33')][_0xeb10('0x3b')]+'%'};return _0x204d84;})});}_0x1cebb6=_[_0xeb10('0x3c')]({},_0x1cebb6,_0x563824[_0xeb10('0x3f')]);return _0x10dc94[_0xeb10('0x4f')](_0x1cebb6);}})[_0xeb10('0x23')](function(_0x19a74c){if(_0x19a74c){_0x375ff5=_0x19a74c[_0xeb10('0x35')];if(!_0x563824[_0xeb10('0x33')][_0xeb10('0x36')]('nolimit')){_0x1cebb6['limit']=qs[_0xeb10('0x1d')](_0x563824['query']['limit']);_0x1cebb6[_0xeb10('0x1c')]=qs[_0xeb10('0x1c')](_0x563824[_0xeb10('0x33')]['offset']);}return _0x10dc94['getDescriptions'](_0x1cebb6);}})[_0xeb10('0x23')](function(_0x3e6281){if(_0x3e6281){return _0x3e6281?{'count':_0x375ff5,'rows':_0x3e6281}:null;}})['then'](respondWithResult(_0xb01c48,null))[_0xeb10('0x43')](handleError(_0xb01c48,null));};exports[_0xeb10('0x50')]=function(_0xe7c83b,_0x374cf6,_0x543f44){var _0x3815ae={};var _0x29cd4b={};var _0x3cec02;var _0x116ccc;return db['ZendeskConfiguration'][_0xeb10('0x4b')]({'where':{'id':_0xe7c83b['params']['id']}})[_0xeb10('0x23')](handleEntityNotFound(_0x374cf6,null))[_0xeb10('0x23')](function(_0x9c7622){if(_0x9c7622){_0x3cec02=_0x9c7622;_0x29cd4b['model']=_[_0xeb10('0x2e')](db[_0xeb10('0x51')][_0xeb10('0x2b')]);_0x29cd4b[_0xeb10('0x33')]=_[_0xeb10('0x2e')](_0xe7c83b[_0xeb10('0x33')]);_0x29cd4b[_0xeb10('0x2f')]=_[_0xeb10('0x30')](_0x29cd4b[_0xeb10('0x31')],_0x29cd4b[_0xeb10('0x33')]);_0x3815ae[_0xeb10('0x34')]=_[_0xeb10('0x30')](_0x29cd4b['model'],qs[_0xeb10('0x32')](_0xe7c83b[_0xeb10('0x33')][_0xeb10('0x32')]));_0x3815ae['attributes']=_0x3815ae[_0xeb10('0x34')]['length']?_0x3815ae[_0xeb10('0x34')]:_0x29cd4b[_0xeb10('0x31')];_0x3815ae[_0xeb10('0x37')]=qs[_0xeb10('0x38')](_0xe7c83b['query'][_0xeb10('0x38')]);_0x3815ae[_0xeb10('0x39')]=qs[_0xeb10('0x2f')](_[_0xeb10('0x3a')](_0xe7c83b['query'],_0x29cd4b[_0xeb10('0x2f')]));if(_0xe7c83b[_0xeb10('0x33')][_0xeb10('0x3b')]){_0x3815ae['where']=_[_0xeb10('0x3c')](_0x3815ae[_0xeb10('0x39')],{'$or':_[_0xeb10('0x2a')](_0x3815ae[_0xeb10('0x34')],function(_0x30454c){var _0x553937={};_0x553937[_0x30454c]={'$like':'%'+_0xe7c83b[_0xeb10('0x33')]['filter']+'%'};return _0x553937;})});}_0x3815ae=_[_0xeb10('0x3c')]({},_0x3815ae,_0xe7c83b[_0xeb10('0x3f')]);return _0x3cec02[_0xeb10('0x50')](_0x3815ae);}})[_0xeb10('0x23')](function(_0x3205f3){if(_0x3205f3){_0x116ccc=_0x3205f3['length'];if(!_0xe7c83b[_0xeb10('0x33')][_0xeb10('0x36')](_0xeb10('0x4d'))){_0x3815ae['limit']=qs['limit'](_0xe7c83b[_0xeb10('0x33')][_0xeb10('0x1d')]);_0x3815ae[_0xeb10('0x1c')]=qs[_0xeb10('0x1c')](_0xe7c83b[_0xeb10('0x33')]['offset']);}return _0x3cec02[_0xeb10('0x50')](_0x3815ae);}})[_0xeb10('0x23')](function(_0x1a12d0){if(_0x1a12d0){return _0x1a12d0?{'count':_0x116ccc,'rows':_0x1a12d0}:null;}})['then'](respondWithResult(_0x374cf6,null))[_0xeb10('0x43')](handleError(_0x374cf6,null));};exports[_0xeb10('0x52')]=function(_0x4dc2f9,_0x10be09,_0xdc2d5e){if(_0x4dc2f9['body']['id']){delete _0x4dc2f9['body']['id'];}return db[_0xeb10('0x40')][_0xeb10('0x4b')]({'where':{'id':_0x4dc2f9[_0xeb10('0x45')]['id']}})[_0xeb10('0x23')](handleEntityNotFound(_0x10be09,null))[_0xeb10('0x23')](function(_0x61c4ba){if(_0x61c4ba){return _0x61c4ba[_0xeb10('0x52')](_0x4dc2f9['body'][_0xeb10('0x53')]||[]);}return null;})[_0xeb10('0x23')](respondWithResult(_0x10be09,null))['catch'](handleError(_0x10be09,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 554136b..0dba08e 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 _0xb44a=['../../config/logger','moment','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x2833b8,_0x376edd){var _0x56ae5e=function(_0xd0fe06){while(--_0xd0fe06){_0x2833b8['push'](_0x2833b8['shift']());}};_0x56ae5e(++_0x376edd);}(_0xb44a,0x1c2));var _0xab44=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xb44a[_0x29b609];return _0x54c952;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab44('0x0'))('api');var moment=require(_0xab44('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab44('0x2'));var rimraf=require('rimraf');var config=require(_0xab44('0x3'));var attributes=require(_0xab44('0x4'));module[_0xab44('0x5')]=function(_0x28681a,_0x2f3948){return _0x28681a[_0xab44('0x6')](_0xab44('0x7'),attributes,{'tableName':_0xab44('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13f6=['request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','lodash','util','moment','bluebird'];(function(_0x265aae,_0x3edce6){var _0x1e0177=function(_0x398191){while(--_0x398191){_0x265aae['push'](_0x265aae['shift']());}};_0x1e0177(++_0x3edce6);}(_0x13f6,0x124));var _0x613f=function(_0x440f3a,_0x639689){_0x440f3a=_0x440f3a-0x0;var _0x457152=_0x13f6[_0x440f3a];return _0x457152;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x613f('0x2'));var BPromise=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var attributes=require(_0x613f('0x7'));module['exports']=function(_0x3f3525,_0x2367b3){return _0x3f3525['define']('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','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 8d5375f..79629d1 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 _0x71b6=['stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xd86cc,_0x27fba3){var _0x249312=function(_0x5ded4e){while(--_0x5ded4e){_0xd86cc['push'](_0xd86cc['shift']());}};_0x249312(++_0x27fba3);}(_0x71b6,0x66));var _0x671b=function(_0x6363a,_0xa5b318){_0x6363a=_0x6363a-0x0;var _0x48d5c6=_0x71b6[_0x6363a];return _0x48d5c6;};'use strict';var _=require(_0x671b('0x0'));var util=require(_0x671b('0x1'));var moment=require(_0x671b('0x2'));var BPromise=require('bluebird');var rs=require(_0x671b('0x3'));var fs=require('fs');var Redis=require(_0x671b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x671b('0x5'));var logger=require(_0x671b('0x6'))(_0x671b('0x7'));var config=require(_0x671b('0x8'));var jayson=require(_0x671b('0x9'));var client=jayson[_0x671b('0xa')][_0x671b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52a9e5,_0x3f102f,_0x1dec74){return new BPromise(function(_0x3d99af,_0x1eafa7){return client[_0x671b('0xc')](_0x52a9e5,_0x1dec74)[_0x671b('0xd')](function(_0x3c9d5a){logger['info'](_0x671b('0xe'),_0x3f102f,'request\x20sent');logger[_0x671b('0xf')](_0x671b('0x10'),_0x3f102f,_0x671b('0x11'),JSON[_0x671b('0x12')](_0x3c9d5a));if(_0x3c9d5a[_0x671b('0x13')]){if(_0x3c9d5a['error'][_0x671b('0x14')]===0x1f4){logger['error'](_0x671b('0xe'),_0x3f102f,_0x3c9d5a[_0x671b('0x13')][_0x671b('0x15')]);return _0x1eafa7(_0x3c9d5a['error'][_0x671b('0x15')]);}logger[_0x671b('0x13')](_0x671b('0xe'),_0x3f102f,_0x3c9d5a[_0x671b('0x13')][_0x671b('0x15')]);return _0x3d99af(_0x3c9d5a[_0x671b('0x13')][_0x671b('0x15')]);}else{logger[_0x671b('0x16')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3f102f,_0x671b('0x11'));_0x3d99af(_0x3c9d5a['result']['message']);}})[_0x671b('0x17')](function(_0x53da79){logger[_0x671b('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3f102f,_0x53da79);_0x1eafa7(_0x53da79);});});} \ No newline at end of file +var _0xc510=['stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x67464f,_0x432c68){var _0x14c459=function(_0x37f456){while(--_0x37f456){_0x67464f['push'](_0x67464f['shift']());}};_0x14c459(++_0x432c68);}(_0xc510,0x190));var _0x0c51=function(_0x576cc7,_0x3c6b04){_0x576cc7=_0x576cc7-0x0;var _0x2686f0=_0xc510[_0x576cc7];return _0x2686f0;};'use strict';var _=require(_0x0c51('0x0'));var util=require('util');var moment=require(_0x0c51('0x1'));var BPromise=require(_0x0c51('0x2'));var rs=require(_0x0c51('0x3'));var fs=require('fs');var Redis=require(_0x0c51('0x4'));var db=require(_0x0c51('0x5'))['db'];var utils=require(_0x0c51('0x6'));var logger=require(_0x0c51('0x7'))(_0x0c51('0x8'));var config=require(_0x0c51('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0c51('0xa')][_0x0c51('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44a486,_0x1ea031,_0x15c05d){return new BPromise(function(_0x5604a8,_0x51b79f){return client[_0x0c51('0xc')](_0x44a486,_0x15c05d)['then'](function(_0x1dd492){logger[_0x0c51('0xd')](_0x0c51('0xe'),_0x1ea031,'request\x20sent');logger[_0x0c51('0xf')](_0x0c51('0x10'),_0x1ea031,_0x0c51('0x11'),JSON[_0x0c51('0x12')](_0x1dd492));if(_0x1dd492['error']){if(_0x1dd492[_0x0c51('0x13')]['code']===0x1f4){logger[_0x0c51('0x13')](_0x0c51('0xe'),_0x1ea031,_0x1dd492['error'][_0x0c51('0x14')]);return _0x51b79f(_0x1dd492[_0x0c51('0x13')][_0x0c51('0x14')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x1ea031,_0x1dd492[_0x0c51('0x13')][_0x0c51('0x14')]);return _0x5604a8(_0x1dd492[_0x0c51('0x13')][_0x0c51('0x14')]);}else{logger['info'](_0x0c51('0xe'),_0x1ea031,_0x0c51('0x11'));_0x5604a8(_0x1dd492['result'][_0x0c51('0x14')]);}})[_0x0c51('0x15')](function(_0x33d322){logger[_0x0c51('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1ea031,_0x33d322);_0x51b79f(_0x33d322);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 5d0540a..fc063d3 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 _0x99c6=['/:id','post','put','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x1f5a09,_0x4287cf){var _0x41942f=function(_0x1b264d){while(--_0x1b264d){_0x1f5a09['push'](_0x1f5a09['shift']());}};_0x41942f(++_0x4287cf);}(_0x99c6,0xd1));var _0x699c=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x99c6[_0x4ae829];return _0x256b31;};'use strict';var multer=require(_0x699c('0x0'));var util=require('util');var path=require(_0x699c('0x1'));var timeout=require(_0x699c('0x2'));var express=require('express');var router=express[_0x699c('0x3')]();var fs_extra=require(_0x699c('0x4'));var auth=require(_0x699c('0x5'));var interaction=require(_0x699c('0x6'));var config=require(_0x699c('0x7'));var controller=require(_0x699c('0x8'));router[_0x699c('0x9')]('/',auth[_0x699c('0xa')](),controller[_0x699c('0xb')]);router[_0x699c('0x9')](_0x699c('0xc'),auth[_0x699c('0xa')](),controller['show']);router[_0x699c('0xd')]('/',auth[_0x699c('0xa')](),controller['create']);router[_0x699c('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x699c('0xf')]);router['delete'](_0x699c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x699c('0x10')]=router; \ No newline at end of file +var _0xcf8b=['update','delete','destroy','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','post','put','/:id'];(function(_0x28ea33,_0x197124){var _0x475761=function(_0x3480d9){while(--_0x3480d9){_0x28ea33['push'](_0x28ea33['shift']());}};_0x475761(++_0x197124);}(_0xcf8b,0x99));var _0xbcf8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf8b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xbcf8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbcf8('0x1'));var router=express[_0xbcf8('0x2')]();var fs_extra=require(_0xbcf8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xbcf8('0x4'));var config=require(_0xbcf8('0x5'));var controller=require(_0xbcf8('0x6'));router[_0xbcf8('0x7')]('/',auth[_0xbcf8('0x8')](),controller['index']);router[_0xbcf8('0x7')]('/:id',auth[_0xbcf8('0x8')](),controller['show']);router[_0xbcf8('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbcf8('0xa')](_0xbcf8('0xb'),auth[_0xbcf8('0x8')](),controller[_0xbcf8('0xc')]);router[_0xbcf8('0xd')]('/:id',auth[_0xbcf8('0x8')](),controller[_0xbcf8('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 8f27367..5a1da4e 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 _0x5676=['customVariable','keyValue','picklist','STRING','exports','ENUM','string','variable'];(function(_0x2d88cd,_0x2c7f6b){var _0x474ab6=function(_0x2c5006){while(--_0x2c5006){_0x2d88cd['push'](_0x2d88cd['shift']());}};_0x474ab6(++_0x2c7f6b);}(_0x5676,0x11c));var _0x6567=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5676[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0x6567('0x0')]={'type':{'type':Sequelize[_0x6567('0x1')](_0x6567('0x2'),_0x6567('0x3'),_0x6567('0x4'),_0x6567('0x5'),_0x6567('0x6')),'defaultValue':_0x6567('0x2')},'content':{'type':Sequelize[_0x6567('0x7')]},'key':{'type':Sequelize[_0x6567('0x7')]},'keyType':{'type':Sequelize[_0x6567('0x1')](_0x6567('0x2'),'variable',_0x6567('0x4'))},'keyContent':{'type':Sequelize[_0x6567('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6567('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6567('0x7')]}}; \ No newline at end of file +var _0x3ddc=['string','variable','customVariable','ENUM','STRING','BOOLEAN','sequelize','exports'];(function(_0x50453f,_0xfa8c33){var _0x21c6b4=function(_0x13984f){while(--_0x13984f){_0x50453f['push'](_0x50453f['shift']());}};_0x21c6b4(++_0xfa8c33);}(_0x3ddc,0xce));var _0xc3dd=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3ddc[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xc3dd('0x0'));module[_0xc3dd('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc3dd('0x2'),_0xc3dd('0x3'),_0xc3dd('0x4'),'keyValue','picklist'),'defaultValue':_0xc3dd('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc3dd('0x5')](_0xc3dd('0x2'),_0xc3dd('0x3'),_0xc3dd('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc3dd('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc3dd('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc3dd('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 860bd05..9595fdf 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 _0x2911=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','destroy','then','error','stack','index','ZendeskField','rawAttributes','fieldName','type','map','name','query','keys','filters','attributes','intersection','fields','length','model','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x78e634,_0x37719d){var _0x1742ab=function(_0x4f1da0){while(--_0x4f1da0){_0x78e634['push'](_0x78e634['shift']());}};_0x1742ab(++_0x37719d);}(_0x2911,0x90));var _0x1291=function(_0x450050,_0x27eeec){_0x450050=_0x450050-0x0;var _0x3b7f51=_0x2911[_0x450050];return _0x3b7f51;};'use strict';var emlformat=require(_0x1291('0x0'));var rimraf=require(_0x1291('0x1'));var zipdir=require(_0x1291('0x2'));var jsonpatch=require(_0x1291('0x3'));var rp=require(_0x1291('0x4'));var moment=require(_0x1291('0x5'));var BPromise=require(_0x1291('0x6'));var Mustache=require(_0x1291('0x7'));var util=require(_0x1291('0x8'));var path=require('path');var sox=require(_0x1291('0x9'));var csv=require(_0x1291('0xa'));var ejs=require(_0x1291('0xb'));var fs=require('fs');var fs_extra=require(_0x1291('0xc'));var _=require(_0x1291('0xd'));var squel=require(_0x1291('0xe'));var crypto=require(_0x1291('0xf'));var jsforce=require(_0x1291('0x10'));var deskjs=require(_0x1291('0x11'));var toCsv=require(_0x1291('0xa'));var querystring=require('querystring');var Papa=require(_0x1291('0x12'));var Redis=require(_0x1291('0x13'));var authService=require(_0x1291('0x14'));var qs=require(_0x1291('0x15'));var as=require(_0x1291('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1291('0x17'))('api');var utils=require(_0x1291('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1291('0x19'))['db'];function respondWithStatusCode(_0x1f1212,_0x19b255){_0x19b255=_0x19b255||0xcc;return function(_0x75a0c4){if(_0x75a0c4){return _0x1f1212[_0x1291('0x1a')](_0x19b255);}return _0x1f1212[_0x1291('0x1b')](_0x19b255)[_0x1291('0x1c')]();};}function respondWithResult(_0x1bc97d,_0xaedada){_0xaedada=_0xaedada||0xc8;return function(_0x21190e){if(_0x21190e){return _0x1bc97d[_0x1291('0x1b')](_0xaedada)['json'](_0x21190e);}};}function respondWithFilteredResult(_0x4d9cb1,_0x493a41){return function(_0x38edcc){if(_0x38edcc){var _0x2f50c0=typeof _0x493a41[_0x1291('0x1d')]===_0x1291('0x1e')&&typeof _0x493a41[_0x1291('0x1f')]===_0x1291('0x1e');var _0x3a1ba1=_0x38edcc[_0x1291('0x20')];var _0x1775a3=_0x2f50c0?0x0:_0x493a41['offset'];var _0x2381f6=_0x2f50c0?_0x38edcc[_0x1291('0x20')]:_0x493a41[_0x1291('0x1d')]+_0x493a41[_0x1291('0x1f')];var _0xa0ed5b;if(_0x2381f6>=_0x3a1ba1){_0x2381f6=_0x3a1ba1;_0xa0ed5b=0xc8;}else{_0xa0ed5b=0xce;}_0x4d9cb1[_0x1291('0x1b')](_0xa0ed5b);return _0x4d9cb1[_0x1291('0x21')]('Content-Range',_0x1775a3+'-'+_0x2381f6+'/'+_0x3a1ba1)[_0x1291('0x22')](_0x38edcc);}return null;};}function patchUpdates(_0x5ae619){return function(_0x4a023a){try{jsonpatch['apply'](_0x4a023a,_0x5ae619,!![]);}catch(_0x4e7cc3){return BPromise[_0x1291('0x23')](_0x4e7cc3);}return _0x4a023a['save']();};}function saveUpdates(_0x8603ef,_0x5b7d2b){return function(_0x25b2be){if(_0x25b2be){return _0x25b2be[_0x1291('0x24')](_0x8603ef)['then'](function(_0x147849){return _0x147849;});}return null;};}function removeEntity(_0x512e69,_0x106a4d){return function(_0x328d96){if(_0x328d96){return _0x328d96[_0x1291('0x25')]()[_0x1291('0x26')](function(){_0x512e69['status'](0xcc)[_0x1291('0x1c')]();});}};}function handleEntityNotFound(_0xda05bc,_0x18f420){return function(_0x3a37ea){if(!_0x3a37ea){_0xda05bc[_0x1291('0x1a')](0x194);}return _0x3a37ea;};}function handleError(_0x5e8746,_0x5e3f65){_0x5e3f65=_0x5e3f65||0x1f4;return function(_0x54e24e){logger[_0x1291('0x27')](_0x54e24e[_0x1291('0x28')]);if(_0x54e24e['name']){delete _0x54e24e['name'];}_0x5e8746[_0x1291('0x1b')](_0x5e3f65)['send'](_0x54e24e);};}exports[_0x1291('0x29')]=function(_0x563182,_0x5c995d){var _0x4630ea={},_0x18492d={},_0x4b5cbf={'count':0x0,'rows':[]};var _0x529583=_['map'](db[_0x1291('0x2a')][_0x1291('0x2b')],function(_0x20b64f){return{'name':_0x20b64f[_0x1291('0x2c')],'type':_0x20b64f[_0x1291('0x2d')]['key']};});_0x18492d['model']=_[_0x1291('0x2e')](_0x529583,_0x1291('0x2f'));_0x18492d[_0x1291('0x30')]=_[_0x1291('0x31')](_0x563182[_0x1291('0x30')]);_0x18492d[_0x1291('0x32')]=_['intersection'](_0x18492d['model'],_0x18492d[_0x1291('0x30')]);_0x4630ea[_0x1291('0x33')]=_[_0x1291('0x34')](_0x18492d['model'],qs['fields'](_0x563182[_0x1291('0x30')][_0x1291('0x35')]));_0x4630ea['attributes']=_0x4630ea[_0x1291('0x33')][_0x1291('0x36')]?_0x4630ea['attributes']:_0x18492d[_0x1291('0x37')];if(!_0x563182['query']['hasOwnProperty']('nolimit')){_0x4630ea['limit']=qs[_0x1291('0x1f')](_0x563182[_0x1291('0x30')][_0x1291('0x1f')]);_0x4630ea[_0x1291('0x1d')]=qs['offset'](_0x563182[_0x1291('0x30')][_0x1291('0x1d')]);}_0x4630ea[_0x1291('0x38')]=qs['sort'](_0x563182[_0x1291('0x30')][_0x1291('0x39')]);_0x4630ea[_0x1291('0x3a')]=qs[_0x1291('0x32')](_[_0x1291('0x3b')](_0x563182['query'],_0x18492d[_0x1291('0x32')]),_0x529583);if(_0x563182[_0x1291('0x30')][_0x1291('0x3c')]){_0x4630ea[_0x1291('0x3a')]=_[_0x1291('0x3d')](_0x4630ea[_0x1291('0x3a')],{'$or':_['map'](_0x529583,function(_0x2a7245){if(_0x2a7245[_0x1291('0x2d')]!==_0x1291('0x3e')){var _0x228b90={};_0x228b90[_0x2a7245['name']]={'$like':'%'+_0x563182['query'][_0x1291('0x3c')]+'%'};return _0x228b90;}})});}_0x4630ea=_[_0x1291('0x3d')]({},_0x4630ea,_0x563182['options']);var _0x4e8242={'where':_0x4630ea[_0x1291('0x3a')]};return db[_0x1291('0x2a')][_0x1291('0x20')](_0x4e8242)[_0x1291('0x26')](function(_0xcfbef){_0x4b5cbf[_0x1291('0x20')]=_0xcfbef;if(_0x563182[_0x1291('0x30')][_0x1291('0x3f')]){_0x4630ea[_0x1291('0x40')]=[{'all':!![]}];}return db[_0x1291('0x2a')][_0x1291('0x41')](_0x4630ea);})['then'](function(_0xbd8431){_0x4b5cbf[_0x1291('0x42')]=_0xbd8431;return _0x4b5cbf;})[_0x1291('0x26')](respondWithFilteredResult(_0x5c995d,_0x4630ea))[_0x1291('0x43')](handleError(_0x5c995d,null));};exports[_0x1291('0x44')]=function(_0x426e7e,_0x39fc47){var _0x562ec0={'raw':!![],'where':{'id':_0x426e7e['params']['id']}},_0x2c3451={};_0x2c3451['model']=_[_0x1291('0x31')](db[_0x1291('0x2a')]['rawAttributes']);_0x2c3451[_0x1291('0x30')]=_[_0x1291('0x31')](_0x426e7e['query']);_0x2c3451[_0x1291('0x32')]=_[_0x1291('0x34')](_0x2c3451[_0x1291('0x37')],_0x2c3451[_0x1291('0x30')]);_0x562ec0[_0x1291('0x33')]=_['intersection'](_0x2c3451['model'],qs[_0x1291('0x35')](_0x426e7e[_0x1291('0x30')][_0x1291('0x35')]));_0x562ec0[_0x1291('0x33')]=_0x562ec0['attributes'][_0x1291('0x36')]?_0x562ec0[_0x1291('0x33')]:_0x2c3451[_0x1291('0x37')];if(_0x426e7e[_0x1291('0x30')][_0x1291('0x3f')]){_0x562ec0['include']=[{'all':!![]}];}_0x562ec0=_[_0x1291('0x3d')]({},_0x562ec0,_0x426e7e[_0x1291('0x45')]);return db['ZendeskField'][_0x1291('0x46')](_0x562ec0)[_0x1291('0x26')](handleEntityNotFound(_0x39fc47,null))[_0x1291('0x26')](respondWithResult(_0x39fc47,null))['catch'](handleError(_0x39fc47,null));};exports[_0x1291('0x47')]=function(_0x271a2a,_0x4c86d8){return db[_0x1291('0x2a')]['create'](_0x271a2a[_0x1291('0x48')],{})[_0x1291('0x26')](respondWithResult(_0x4c86d8,0xc9))['catch'](handleError(_0x4c86d8,null));};exports['update']=function(_0x3eda70,_0x2f58e4){if(_0x3eda70[_0x1291('0x48')]['id']){delete _0x3eda70['body']['id'];}return db[_0x1291('0x2a')][_0x1291('0x46')]({'where':{'id':_0x3eda70[_0x1291('0x49')]['id']}})[_0x1291('0x26')](handleEntityNotFound(_0x2f58e4,null))[_0x1291('0x26')](saveUpdates(_0x3eda70[_0x1291('0x48')],null))[_0x1291('0x26')](respondWithResult(_0x2f58e4,null))['catch'](handleError(_0x2f58e4,null));};exports[_0x1291('0x25')]=function(_0x3742af,_0x2bf1d1){return db[_0x1291('0x2a')]['find']({'where':{'id':_0x3742af[_0x1291('0x49')]['id']}})[_0x1291('0x26')](handleEntityNotFound(_0x2bf1d1,null))['then'](removeEntity(_0x2bf1d1,null))[_0x1291('0x43')](handleError(_0x2bf1d1,null));}; \ No newline at end of file +var _0x79e0=['../../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','update','destroy','then','stack','name','index','map','ZendeskField','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x197491,_0x506e8c){var _0x24e8a1=function(_0xc9a7f8){while(--_0xc9a7f8){_0x197491['push'](_0x197491['shift']());}};_0x24e8a1(++_0x506e8c);}(_0x79e0,0x1f4));var _0x079e=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x79e0[_0x1b5aea];return _0x15cfc6;};'use strict';var emlformat=require(_0x079e('0x0'));var rimraf=require(_0x079e('0x1'));var zipdir=require(_0x079e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x079e('0x3'));var BPromise=require(_0x079e('0x4'));var Mustache=require(_0x079e('0x5'));var util=require(_0x079e('0x6'));var path=require(_0x079e('0x7'));var sox=require(_0x079e('0x8'));var csv=require(_0x079e('0x9'));var ejs=require(_0x079e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x079e('0xb'));var crypto=require('crypto');var jsforce=require(_0x079e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x079e('0x9'));var querystring=require(_0x079e('0xd'));var Papa=require(_0x079e('0xe'));var Redis=require(_0x079e('0xf'));var authService=require(_0x079e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x079e('0x11'));var hardwareService=require(_0x079e('0x12'));var logger=require(_0x079e('0x13'))(_0x079e('0x14'));var utils=require(_0x079e('0x15'));var config=require(_0x079e('0x16'));var licenseUtil=require(_0x079e('0x17'));var db=require(_0x079e('0x18'))['db'];function respondWithStatusCode(_0x20cb8d,_0x464dcd){_0x464dcd=_0x464dcd||0xcc;return function(_0x42b881){if(_0x42b881){return _0x20cb8d[_0x079e('0x19')](_0x464dcd);}return _0x20cb8d[_0x079e('0x1a')](_0x464dcd)[_0x079e('0x1b')]();};}function respondWithResult(_0x44ba1d,_0x3f42e4){_0x3f42e4=_0x3f42e4||0xc8;return function(_0x2519ce){if(_0x2519ce){return _0x44ba1d['status'](_0x3f42e4)[_0x079e('0x1c')](_0x2519ce);}};}function respondWithFilteredResult(_0x25994b,_0x4b4445){return function(_0x40837a){if(_0x40837a){var _0x4916e1=typeof _0x4b4445[_0x079e('0x1d')]===_0x079e('0x1e')&&typeof _0x4b4445['limit']===_0x079e('0x1e');var _0xf04dd4=_0x40837a[_0x079e('0x1f')];var _0xa86353=_0x4916e1?0x0:_0x4b4445[_0x079e('0x1d')];var _0x2f95fe=_0x4916e1?_0x40837a[_0x079e('0x1f')]:_0x4b4445[_0x079e('0x1d')]+_0x4b4445[_0x079e('0x20')];var _0x1837cf;if(_0x2f95fe>=_0xf04dd4){_0x2f95fe=_0xf04dd4;_0x1837cf=0xc8;}else{_0x1837cf=0xce;}_0x25994b[_0x079e('0x1a')](_0x1837cf);return _0x25994b[_0x079e('0x21')]('Content-Range',_0xa86353+'-'+_0x2f95fe+'/'+_0xf04dd4)[_0x079e('0x1c')](_0x40837a);}return null;};}function patchUpdates(_0x4d530e){return function(_0x600450){try{jsonpatch[_0x079e('0x22')](_0x600450,_0x4d530e,!![]);}catch(_0xca5f9e){return BPromise[_0x079e('0x23')](_0xca5f9e);}return _0x600450['save']();};}function saveUpdates(_0x1b8f5c,_0x6d07f4){return function(_0x5b21c6){if(_0x5b21c6){return _0x5b21c6[_0x079e('0x24')](_0x1b8f5c)['then'](function(_0x39a72a){return _0x39a72a;});}return null;};}function removeEntity(_0x3359d8,_0x1deb1f){return function(_0x230790){if(_0x230790){return _0x230790[_0x079e('0x25')]()[_0x079e('0x26')](function(){_0x3359d8[_0x079e('0x1a')](0xcc)[_0x079e('0x1b')]();});}};}function handleEntityNotFound(_0xd1b742,_0x200a06){return function(_0x41d456){if(!_0x41d456){_0xd1b742[_0x079e('0x19')](0x194);}return _0x41d456;};}function handleError(_0x11e352,_0xee90ef){_0xee90ef=_0xee90ef||0x1f4;return function(_0x469cd0){logger['error'](_0x469cd0[_0x079e('0x27')]);if(_0x469cd0[_0x079e('0x28')]){delete _0x469cd0['name'];}_0x11e352[_0x079e('0x1a')](_0xee90ef)['send'](_0x469cd0);};}exports[_0x079e('0x29')]=function(_0x49c52d,_0x26c4c5){var _0x484313={},_0x5dc8ce={},_0x4a88bb={'count':0x0,'rows':[]};var _0x3f567f=_[_0x079e('0x2a')](db[_0x079e('0x2b')]['rawAttributes'],function(_0x1d70a0){return{'name':_0x1d70a0[_0x079e('0x2c')],'type':_0x1d70a0['type'][_0x079e('0x2d')]};});_0x5dc8ce[_0x079e('0x2e')]=_[_0x079e('0x2a')](_0x3f567f,'name');_0x5dc8ce[_0x079e('0x2f')]=_[_0x079e('0x30')](_0x49c52d[_0x079e('0x2f')]);_0x5dc8ce[_0x079e('0x31')]=_[_0x079e('0x32')](_0x5dc8ce[_0x079e('0x2e')],_0x5dc8ce[_0x079e('0x2f')]);_0x484313['attributes']=_[_0x079e('0x32')](_0x5dc8ce[_0x079e('0x2e')],qs['fields'](_0x49c52d['query'][_0x079e('0x33')]));_0x484313[_0x079e('0x34')]=_0x484313[_0x079e('0x34')]['length']?_0x484313[_0x079e('0x34')]:_0x5dc8ce['model'];if(!_0x49c52d[_0x079e('0x2f')][_0x079e('0x35')]('nolimit')){_0x484313['limit']=qs[_0x079e('0x20')](_0x49c52d['query'][_0x079e('0x20')]);_0x484313[_0x079e('0x1d')]=qs['offset'](_0x49c52d[_0x079e('0x2f')][_0x079e('0x1d')]);}_0x484313[_0x079e('0x36')]=qs[_0x079e('0x37')](_0x49c52d[_0x079e('0x2f')][_0x079e('0x37')]);_0x484313[_0x079e('0x38')]=qs[_0x079e('0x31')](_[_0x079e('0x39')](_0x49c52d[_0x079e('0x2f')],_0x5dc8ce['filters']),_0x3f567f);if(_0x49c52d[_0x079e('0x2f')][_0x079e('0x3a')]){_0x484313['where']=_[_0x079e('0x3b')](_0x484313[_0x079e('0x38')],{'$or':_['map'](_0x3f567f,function(_0x4156da){if(_0x4156da[_0x079e('0x3c')]!==_0x079e('0x3d')){var _0x37c9b3={};_0x37c9b3[_0x4156da[_0x079e('0x28')]]={'$like':'%'+_0x49c52d[_0x079e('0x2f')][_0x079e('0x3a')]+'%'};return _0x37c9b3;}})});}_0x484313=_[_0x079e('0x3b')]({},_0x484313,_0x49c52d[_0x079e('0x3e')]);var _0x541179={'where':_0x484313[_0x079e('0x38')]};return db[_0x079e('0x2b')][_0x079e('0x1f')](_0x541179)['then'](function(_0x63fbc4){_0x4a88bb['count']=_0x63fbc4;if(_0x49c52d[_0x079e('0x2f')]['includeAll']){_0x484313[_0x079e('0x3f')]=[{'all':!![]}];}return db['ZendeskField'][_0x079e('0x40')](_0x484313);})[_0x079e('0x26')](function(_0x11e011){_0x4a88bb[_0x079e('0x41')]=_0x11e011;return _0x4a88bb;})[_0x079e('0x26')](respondWithFilteredResult(_0x26c4c5,_0x484313))[_0x079e('0x42')](handleError(_0x26c4c5,null));};exports[_0x079e('0x43')]=function(_0x1d30e7,_0x5cded6){var _0x24f533={'raw':!![],'where':{'id':_0x1d30e7[_0x079e('0x44')]['id']}},_0xb9598d={};_0xb9598d[_0x079e('0x2e')]=_[_0x079e('0x30')](db[_0x079e('0x2b')][_0x079e('0x45')]);_0xb9598d[_0x079e('0x2f')]=_[_0x079e('0x30')](_0x1d30e7[_0x079e('0x2f')]);_0xb9598d[_0x079e('0x31')]=_[_0x079e('0x32')](_0xb9598d[_0x079e('0x2e')],_0xb9598d[_0x079e('0x2f')]);_0x24f533[_0x079e('0x34')]=_[_0x079e('0x32')](_0xb9598d['model'],qs[_0x079e('0x33')](_0x1d30e7[_0x079e('0x2f')][_0x079e('0x33')]));_0x24f533[_0x079e('0x34')]=_0x24f533[_0x079e('0x34')]['length']?_0x24f533[_0x079e('0x34')]:_0xb9598d['model'];if(_0x1d30e7[_0x079e('0x2f')][_0x079e('0x46')]){_0x24f533[_0x079e('0x3f')]=[{'all':!![]}];}_0x24f533=_[_0x079e('0x3b')]({},_0x24f533,_0x1d30e7[_0x079e('0x3e')]);return db[_0x079e('0x2b')]['find'](_0x24f533)[_0x079e('0x26')](handleEntityNotFound(_0x5cded6,null))[_0x079e('0x26')](respondWithResult(_0x5cded6,null))[_0x079e('0x42')](handleError(_0x5cded6,null));};exports[_0x079e('0x47')]=function(_0xfe9890,_0x399c74){return db['ZendeskField'][_0x079e('0x47')](_0xfe9890[_0x079e('0x48')],{})['then'](respondWithResult(_0x399c74,0xc9))[_0x079e('0x42')](handleError(_0x399c74,null));};exports[_0x079e('0x24')]=function(_0x26148d,_0x16f857){if(_0x26148d[_0x079e('0x48')]['id']){delete _0x26148d['body']['id'];}return db['ZendeskField']['find']({'where':{'id':_0x26148d['params']['id']}})[_0x079e('0x26')](handleEntityNotFound(_0x16f857,null))['then'](saveUpdates(_0x26148d['body'],null))['then'](respondWithResult(_0x16f857,null))[_0x079e('0x42')](handleError(_0x16f857,null));};exports[_0x079e('0x25')]=function(_0x1df897,_0x8e8cf3){return db[_0x079e('0x2b')][_0x079e('0x49')]({'where':{'id':_0x1df897[_0x079e('0x44')]['id']}})[_0x079e('0x26')](handleEntityNotFound(_0x8e8cf3,null))[_0x079e('0x26')](removeEntity(_0x8e8cf3,null))[_0x079e('0x42')](handleError(_0x8e8cf3,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 4181c1a..1845b60 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 _0xed1e=['lodash','util','moment','bluebird','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId'];(function(_0x5c4061,_0x58d978){var _0x46325e=function(_0x7df5b6){while(--_0x7df5b6){_0x5c4061['push'](_0x5c4061['shift']());}};_0x46325e(++_0x58d978);}(_0xed1e,0x16c));var _0xeed1=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0xed1e[_0x59befa];return _0x1dd63d;};'use strict';var _=require(_0xeed1('0x0'));var util=require(_0xeed1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeed1('0x2'));var BPromise=require(_0xeed1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeed1('0x4'));var rimraf=require(_0xeed1('0x5'));var config=require('../../config/environment');var attributes=require(_0xeed1('0x6'));module[_0xeed1('0x7')]=function(_0x51cf97,_0x26289b){return _0x51cf97[_0xeed1('0x8')](_0xeed1('0x9'),attributes,{'tableName':_0xeed1('0xa'),'paranoid':![],'indexes':[{'name':_0xeed1('0xb'),'fields':[_0xeed1('0xc'),_0xeed1('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8c45=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment'];(function(_0x5ae038,_0x7e8ec2){var _0x31af62=function(_0x4bcaf3){while(--_0x4bcaf3){_0x5ae038['push'](_0x5ae038['shift']());}};_0x31af62(++_0x7e8ec2);}(_0x8c45,0x96));var _0x58c4=function(_0x2eae28,_0x4f6c29){_0x2eae28=_0x2eae28-0x0;var _0x5c0750=_0x8c45[_0x2eae28];return _0x5c0750;};'use strict';var _=require(_0x58c4('0x0'));var util=require(_0x58c4('0x1'));var logger=require(_0x58c4('0x2'))('api');var moment=require(_0x58c4('0x3'));var BPromise=require(_0x58c4('0x4'));var rp=require(_0x58c4('0x5'));var fs=require('fs');var path=require(_0x58c4('0x6'));var rimraf=require(_0x58c4('0x7'));var config=require(_0x58c4('0x8'));var attributes=require('./intZendeskField.attributes');module[_0x58c4('0x9')]=function(_0xc20096,_0x12a935){return _0xc20096[_0x58c4('0xa')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x58c4('0xb'),'fields':[_0x58c4('0xc'),_0x58c4('0xd')],'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 50fc15c..405a579 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 _0x5482=['then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request'];(function(_0x575f3c,_0x5a6e52){var _0x5a5837=function(_0x5aa0aa){while(--_0x5aa0aa){_0x575f3c['push'](_0x575f3c['shift']());}};_0x5a5837(++_0x5a6e52);}(_0x5482,0x1ad));var _0x2548=function(_0x3adad8,_0x5aef55){_0x3adad8=_0x3adad8-0x0;var _0x177095=_0x5482[_0x3adad8];return _0x177095;};'use strict';var _=require(_0x2548('0x0'));var util=require(_0x2548('0x1'));var moment=require(_0x2548('0x2'));var BPromise=require(_0x2548('0x3'));var rs=require(_0x2548('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2548('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2548('0x6'));var config=require('../../config/environment');var jayson=require(_0x2548('0x7'));var client=jayson[_0x2548('0x8')][_0x2548('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25d15b,_0x1a8896,_0x188915){return new BPromise(function(_0x4c05e3,_0x1dbda2){return client[_0x2548('0xa')](_0x25d15b,_0x188915)[_0x2548('0xb')](function(_0xa86068){logger[_0x2548('0xc')](_0x2548('0xd'),_0x1a8896,_0x2548('0xe'));logger[_0x2548('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x1a8896,_0x2548('0xe'),JSON['stringify'](_0xa86068));if(_0xa86068[_0x2548('0x10')]){if(_0xa86068[_0x2548('0x10')][_0x2548('0x11')]===0x1f4){logger['error'](_0x2548('0xd'),_0x1a8896,_0xa86068[_0x2548('0x10')][_0x2548('0x12')]);return _0x1dbda2(_0xa86068[_0x2548('0x10')][_0x2548('0x12')]);}logger[_0x2548('0x10')]('ZendeskField,\x20%s,\x20%s',_0x1a8896,_0xa86068[_0x2548('0x10')][_0x2548('0x12')]);return _0x4c05e3(_0xa86068[_0x2548('0x10')][_0x2548('0x12')]);}else{logger[_0x2548('0xc')](_0x2548('0xd'),_0x1a8896,'request\x20sent');_0x4c05e3(_0xa86068['result'][_0x2548('0x12')]);}})[_0x2548('0x13')](function(_0x383e29){logger['error'](_0x2548('0xd'),_0x1a8896,_0x383e29);_0x1dbda2(_0x383e29);});});} \ No newline at end of file +var _0xe5b4=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x7c0074,_0x1ffdcf){var _0x13e95b=function(_0x521212){while(--_0x521212){_0x7c0074['push'](_0x7c0074['shift']());}};_0x13e95b(++_0x1ffdcf);}(_0xe5b4,0x77));var _0x4e5b=function(_0x20b05a,_0x366db7){_0x20b05a=_0x20b05a-0x0;var _0x418866=_0xe5b4[_0x20b05a];return _0x418866;};'use strict';var _=require(_0x4e5b('0x0'));var util=require(_0x4e5b('0x1'));var moment=require(_0x4e5b('0x2'));var BPromise=require(_0x4e5b('0x3'));var rs=require(_0x4e5b('0x4'));var fs=require('fs');var Redis=require(_0x4e5b('0x5'));var db=require(_0x4e5b('0x6'))['db'];var utils=require(_0x4e5b('0x7'));var logger=require(_0x4e5b('0x8'))('rpc');var config=require(_0x4e5b('0x9'));var jayson=require(_0x4e5b('0xa'));var client=jayson[_0x4e5b('0xb')][_0x4e5b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f2800,_0x185d1e,_0xbdafd){return new BPromise(function(_0x3e9642,_0x27828){return client[_0x4e5b('0xd')](_0x2f2800,_0xbdafd)['then'](function(_0xc43693){logger[_0x4e5b('0xe')](_0x4e5b('0xf'),_0x185d1e,_0x4e5b('0x10'));logger[_0x4e5b('0x11')](_0x4e5b('0x12'),_0x185d1e,'request\x20sent',JSON[_0x4e5b('0x13')](_0xc43693));if(_0xc43693[_0x4e5b('0x14')]){if(_0xc43693[_0x4e5b('0x14')][_0x4e5b('0x15')]===0x1f4){logger[_0x4e5b('0x14')](_0x4e5b('0xf'),_0x185d1e,_0xc43693[_0x4e5b('0x14')][_0x4e5b('0x16')]);return _0x27828(_0xc43693[_0x4e5b('0x14')][_0x4e5b('0x16')]);}logger[_0x4e5b('0x14')]('ZendeskField,\x20%s,\x20%s',_0x185d1e,_0xc43693[_0x4e5b('0x14')]['message']);return _0x3e9642(_0xc43693[_0x4e5b('0x14')][_0x4e5b('0x16')]);}else{logger[_0x4e5b('0xe')](_0x4e5b('0xf'),_0x185d1e,_0x4e5b('0x10'));_0x3e9642(_0xc43693[_0x4e5b('0x17')][_0x4e5b('0x16')]);}})[_0x4e5b('0x18')](function(_0x49366e){logger[_0x4e5b('0x14')](_0x4e5b('0xf'),_0x185d1e,_0x49366e);_0x27828(_0x49366e);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index e89f272..f83377d 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 _0xfc33=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create','put','delete','destroy','multer','util'];(function(_0x151ff0,_0x58f275){var _0x43075b=function(_0x4c3f48){while(--_0x4c3f48){_0x151ff0['push'](_0x151ff0['shift']());}};_0x43075b(++_0x58f275);}(_0xfc33,0xf0));var _0x3fc3=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xfc33[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0x3fc3('0x0'));var util=require(_0x3fc3('0x1'));var path=require(_0x3fc3('0x2'));var timeout=require(_0x3fc3('0x3'));var express=require(_0x3fc3('0x4'));var router=express[_0x3fc3('0x5')]();var fs_extra=require(_0x3fc3('0x6'));var auth=require(_0x3fc3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3fc3('0x8'));var controller=require(_0x3fc3('0x9'));router[_0x3fc3('0xa')]('/',auth[_0x3fc3('0xb')](),controller[_0x3fc3('0xc')]);router[_0x3fc3('0xa')](_0x3fc3('0xd'),auth[_0x3fc3('0xb')](),controller['show']);router['get'](_0x3fc3('0xe'),auth[_0x3fc3('0xb')](),controller['getConfigurations']);router[_0x3fc3('0xa')](_0x3fc3('0xf'),auth[_0x3fc3('0xb')](),controller[_0x3fc3('0x10')]);router[_0x3fc3('0x11')]('/',auth[_0x3fc3('0xb')](),controller[_0x3fc3('0x12')]);router[_0x3fc3('0x11')](_0x3fc3('0xe'),auth[_0x3fc3('0xb')](),controller['addConfiguration']);router[_0x3fc3('0x13')](_0x3fc3('0xd'),auth[_0x3fc3('0xb')](),controller['update']);router[_0x3fc3('0x14')](_0x3fc3('0xd'),auth[_0x3fc3('0xb')](),controller[_0x3fc3('0x15')]);module['exports']=router; \ No newline at end of file +var _0xfacb=['put','/:id','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','isAuthenticated','show','/:id/configurations','post','create'];(function(_0xa79f5e,_0x199017){var _0x527516=function(_0x476fbf){while(--_0x476fbf){_0xa79f5e['push'](_0xa79f5e['shift']());}};_0x527516(++_0x199017);}(_0xfacb,0x1d4));var _0xbfac=function(_0xb8c6f7,_0x59b811){_0xb8c6f7=_0xb8c6f7-0x0;var _0x3fda8e=_0xfacb[_0xb8c6f7];return _0x3fda8e;};'use strict';var multer=require('multer');var util=require(_0xbfac('0x0'));var path=require(_0xbfac('0x1'));var timeout=require(_0xbfac('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbfac('0x3'));var auth=require(_0xbfac('0x4'));var interaction=require(_0xbfac('0x5'));var config=require(_0xbfac('0x6'));var controller=require(_0xbfac('0x7'));router[_0xbfac('0x8')]('/',auth['isAuthenticated'](),controller[_0xbfac('0x9')]);router[_0xbfac('0x8')]('/:id',auth[_0xbfac('0xa')](),controller[_0xbfac('0xb')]);router[_0xbfac('0x8')](_0xbfac('0xc'),auth[_0xbfac('0xa')](),controller['getConfigurations']);router[_0xbfac('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xbfac('0xd')]('/',auth[_0xbfac('0xa')](),controller[_0xbfac('0xe')]);router[_0xbfac('0xd')](_0xbfac('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xbfac('0xf')](_0xbfac('0x10'),auth['isAuthenticated'](),controller[_0xbfac('0x11')]);router[_0xbfac('0x12')](_0xbfac('0x10'),auth[_0xbfac('0xa')](),controller[_0xbfac('0x13')]);module[_0xbfac('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 7aaf20a..59ea4dd 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 _0x2750=['STRING','sequelize'];(function(_0x4ed17b,_0x2b1745){var _0x24b248=function(_0x136ab1){while(--_0x136ab1){_0x4ed17b['push'](_0x4ed17b['shift']());}};_0x24b248(++_0x2b1745);}(_0x2750,0x13b));var _0x0275=function(_0x1524be,_0x5d2455){_0x1524be=_0x1524be-0x0;var _0x73dbf5=_0x2750[_0x1524be];return _0x73dbf5;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'name':{'type':Sequelize[_0x0275('0x1')]},'description':{'type':Sequelize[_0x0275('0x1')]},'host':{'type':Sequelize[_0x0275('0x1')]},'zone':{'type':Sequelize[_0x0275('0x1')]},'clientId':{'type':Sequelize[_0x0275('0x1')]},'clientSecret':{'type':Sequelize[_0x0275('0x1')]},'serverUrl':{'type':Sequelize[_0x0275('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x0275('0x1')]},'refreshToken':{'type':Sequelize[_0x0275('0x1')]}}; \ No newline at end of file +var _0x1be1=['STRING'];(function(_0x7d8fc7,_0x5625a1){var _0x366b19=function(_0x147ec3){while(--_0x147ec3){_0x7d8fc7['push'](_0x7d8fc7['shift']());}};_0x366b19(++_0x5625a1);}(_0x1be1,0x192));var _0x11be=function(_0x4d4551,_0x4c0de5){_0x4d4551=_0x4d4551-0x0;var _0x5b7af9=_0x1be1[_0x4d4551];return _0x5b7af9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x11be('0x0')]},'description':{'type':Sequelize[_0x11be('0x0')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x11be('0x0')]},'clientId':{'type':Sequelize[_0x11be('0x0')]},'clientSecret':{'type':Sequelize[_0x11be('0x0')]},'serverUrl':{'type':Sequelize[_0x11be('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x11be('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 7172081..f5c4a32 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 _0x8cb4=['send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ZohoAccount','includeAll','include','findAll','rows','catch','params','options','create','body','update','find','destroy','getConfigurations','findOne','ZohoConfiguration','addConfiguration','Subjects','getSubjects','getDescriptions','channel','ZohoField','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','getFields','stringify','test','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name'];(function(_0x1f31a7,_0x1fed3f){var _0x634508=function(_0xbe2c2a){while(--_0xbe2c2a){_0x1f31a7['push'](_0x1f31a7['shift']());}};_0x634508(++_0x1fed3f);}(_0x8cb4,0xdf));var _0x48cb=function(_0x3993cd,_0x41ded9){_0x3993cd=_0x3993cd-0x0;var _0x5daf68=_0x8cb4[_0x3993cd];return _0x5daf68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48cb('0x0'));var zipdir=require(_0x48cb('0x1'));var jsonpatch=require(_0x48cb('0x2'));var rp=require(_0x48cb('0x3'));var moment=require(_0x48cb('0x4'));var BPromise=require(_0x48cb('0x5'));var Mustache=require(_0x48cb('0x6'));var util=require(_0x48cb('0x7'));var path=require(_0x48cb('0x8'));var sox=require(_0x48cb('0x9'));var csv=require(_0x48cb('0xa'));var ejs=require(_0x48cb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x48cb('0xc'));var squel=require(_0x48cb('0xd'));var crypto=require(_0x48cb('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x48cb('0xf'));var toCsv=require('to-csv');var querystring=require(_0x48cb('0x10'));var Papa=require(_0x48cb('0x11'));var Redis=require(_0x48cb('0x12'));var authService=require(_0x48cb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x48cb('0x14'));var hardwareService=require(_0x48cb('0x15'));var logger=require(_0x48cb('0x16'))(_0x48cb('0x17'));var utils=require(_0x48cb('0x18'));var config=require(_0x48cb('0x19'));var licenseUtil=require(_0x48cb('0x1a'));var db=require(_0x48cb('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x487731,_0x41410e){_0x41410e=_0x41410e||0xcc;return function(_0x26033a){if(_0x26033a){return _0x487731[_0x48cb('0x1c')](_0x41410e);}return _0x487731[_0x48cb('0x1d')](_0x41410e)[_0x48cb('0x1e')]();};}function respondWithResult(_0x371c55,_0x19b2cc){_0x19b2cc=_0x19b2cc||0xc8;return function(_0x34072d){if(_0x34072d){return _0x371c55['status'](_0x19b2cc)[_0x48cb('0x1f')](_0x34072d);}};}function respondWithFilteredResult(_0x1ad51a,_0x587b8c){return function(_0x1f075f){if(_0x1f075f){var _0x48a1d3=typeof _0x587b8c[_0x48cb('0x20')]===_0x48cb('0x21')&&typeof _0x587b8c[_0x48cb('0x22')]===_0x48cb('0x21');var _0x49995d=_0x1f075f[_0x48cb('0x23')];var _0x5ac9c4=_0x48a1d3?0x0:_0x587b8c[_0x48cb('0x20')];var _0x5f119e=_0x48a1d3?_0x1f075f[_0x48cb('0x23')]:_0x587b8c[_0x48cb('0x20')]+_0x587b8c[_0x48cb('0x22')];var _0x2a7480;if(_0x5f119e>=_0x49995d){_0x5f119e=_0x49995d;_0x2a7480=0xc8;}else{_0x2a7480=0xce;}_0x1ad51a[_0x48cb('0x1d')](_0x2a7480);return _0x1ad51a[_0x48cb('0x24')](_0x48cb('0x25'),_0x5ac9c4+'-'+_0x5f119e+'/'+_0x49995d)['json'](_0x1f075f);}return null;};}function patchUpdates(_0x39b6c8){return function(_0x2d6f33){try{jsonpatch[_0x48cb('0x26')](_0x2d6f33,_0x39b6c8,!![]);}catch(_0x3f4556){return BPromise[_0x48cb('0x27')](_0x3f4556);}return _0x2d6f33[_0x48cb('0x28')]();};}function saveUpdates(_0x5949c4,_0x12d8c3){return function(_0x4e0b42){if(_0x4e0b42){return _0x4e0b42['update'](_0x5949c4)['then'](function(_0x446fd5){return _0x446fd5;});}return null;};}function removeEntity(_0x2e03f7,_0x5e53c0){return function(_0x45e245){if(_0x45e245){return _0x45e245['destroy']()[_0x48cb('0x29')](function(){_0x2e03f7['status'](0xcc)[_0x48cb('0x1e')]();});}};}function handleEntityNotFound(_0x5b6918,_0x2a31e5){return function(_0x1899b8){if(!_0x1899b8){_0x5b6918[_0x48cb('0x1c')](0x194);}return _0x1899b8;};}function handleError(_0x4836df,_0x1ed73a){_0x1ed73a=_0x1ed73a||0x1f4;return function(_0x5ba330){logger[_0x48cb('0x2a')](_0x5ba330[_0x48cb('0x2b')]);if(_0x5ba330['name']){delete _0x5ba330[_0x48cb('0x2c')];}_0x4836df[_0x48cb('0x1d')](_0x1ed73a)[_0x48cb('0x2d')](_0x5ba330);};}exports[_0x48cb('0x2e')]=function(_0x675129,_0x4d012d){var _0x5e130c={},_0x2f4721={},_0x3f6fd1={'count':0x0,'rows':[]};var _0x3dc219=_[_0x48cb('0x2f')](db['ZohoAccount'][_0x48cb('0x30')],function(_0x2e91d0){return{'name':_0x2e91d0[_0x48cb('0x31')],'type':_0x2e91d0[_0x48cb('0x32')][_0x48cb('0x33')]};});_0x2f4721[_0x48cb('0x34')]=_['map'](_0x3dc219,_0x48cb('0x2c'));_0x2f4721['query']=_[_0x48cb('0x35')](_0x675129[_0x48cb('0x36')]);_0x2f4721[_0x48cb('0x37')]=_[_0x48cb('0x38')](_0x2f4721[_0x48cb('0x34')],_0x2f4721['query']);_0x5e130c[_0x48cb('0x39')]=_[_0x48cb('0x38')](_0x2f4721[_0x48cb('0x34')],qs[_0x48cb('0x3a')](_0x675129[_0x48cb('0x36')][_0x48cb('0x3a')]));_0x5e130c[_0x48cb('0x39')]=_0x5e130c[_0x48cb('0x39')][_0x48cb('0x3b')]?_0x5e130c[_0x48cb('0x39')]:_0x2f4721[_0x48cb('0x34')];if(!_0x675129[_0x48cb('0x36')][_0x48cb('0x3c')](_0x48cb('0x3d'))){_0x5e130c['limit']=qs[_0x48cb('0x22')](_0x675129[_0x48cb('0x36')]['limit']);_0x5e130c[_0x48cb('0x20')]=qs[_0x48cb('0x20')](_0x675129[_0x48cb('0x36')][_0x48cb('0x20')]);}_0x5e130c[_0x48cb('0x3e')]=qs[_0x48cb('0x3f')](_0x675129[_0x48cb('0x36')][_0x48cb('0x3f')]);_0x5e130c[_0x48cb('0x40')]=qs[_0x48cb('0x37')](_[_0x48cb('0x41')](_0x675129['query'],_0x2f4721[_0x48cb('0x37')]),_0x3dc219);if(_0x675129[_0x48cb('0x36')][_0x48cb('0x42')]){_0x5e130c[_0x48cb('0x40')]=_[_0x48cb('0x43')](_0x5e130c[_0x48cb('0x40')],{'$or':_[_0x48cb('0x2f')](_0x3dc219,function(_0x9f43cb){if(_0x9f43cb['type']!==_0x48cb('0x44')){var _0x346f18={};_0x346f18[_0x9f43cb[_0x48cb('0x2c')]]={'$like':'%'+_0x675129['query'][_0x48cb('0x42')]+'%'};return _0x346f18;}})});}_0x5e130c=_[_0x48cb('0x43')]({},_0x5e130c,_0x675129['options']);var _0x2d6616={'where':_0x5e130c[_0x48cb('0x40')]};return db[_0x48cb('0x45')][_0x48cb('0x23')](_0x2d6616)[_0x48cb('0x29')](function(_0x136e49){_0x3f6fd1['count']=_0x136e49;if(_0x675129[_0x48cb('0x36')][_0x48cb('0x46')]){_0x5e130c[_0x48cb('0x47')]=[{'all':!![]}];}return db[_0x48cb('0x45')][_0x48cb('0x48')](_0x5e130c);})[_0x48cb('0x29')](function(_0x2cf03c){_0x3f6fd1[_0x48cb('0x49')]=_0x2cf03c;return _0x3f6fd1;})[_0x48cb('0x29')](respondWithFilteredResult(_0x4d012d,_0x5e130c))[_0x48cb('0x4a')](handleError(_0x4d012d,null));};exports['show']=function(_0x5602a0,_0x3402fc){var _0x167278={'raw':![],'where':{'id':_0x5602a0[_0x48cb('0x4b')]['id']}},_0x40b413={};_0x40b413[_0x48cb('0x34')]=_[_0x48cb('0x35')](db[_0x48cb('0x45')]['rawAttributes']);_0x40b413[_0x48cb('0x36')]=_['keys'](_0x5602a0[_0x48cb('0x36')]);_0x40b413[_0x48cb('0x37')]=_[_0x48cb('0x38')](_0x40b413[_0x48cb('0x34')],_0x40b413['query']);_0x167278[_0x48cb('0x39')]=_['intersection'](_0x40b413[_0x48cb('0x34')],qs[_0x48cb('0x3a')](_0x5602a0[_0x48cb('0x36')][_0x48cb('0x3a')]));_0x167278[_0x48cb('0x39')]=_0x167278[_0x48cb('0x39')][_0x48cb('0x3b')]?_0x167278['attributes']:_0x40b413[_0x48cb('0x34')];if(_0x5602a0['query']['includeAll']){_0x167278[_0x48cb('0x47')]=[{'all':!![]}];}_0x167278=_[_0x48cb('0x43')]({},_0x167278,_0x5602a0[_0x48cb('0x4c')]);return db[_0x48cb('0x45')]['find'](_0x167278)[_0x48cb('0x29')](handleEntityNotFound(_0x3402fc,null))['then'](respondWithResult(_0x3402fc,null))[_0x48cb('0x4a')](handleError(_0x3402fc,null));};exports[_0x48cb('0x4d')]=function(_0x5bc578,_0x197604){return db['ZohoAccount'][_0x48cb('0x4d')](_0x5bc578[_0x48cb('0x4e')],{})['then'](respondWithResult(_0x197604,0xc9))[_0x48cb('0x4a')](handleError(_0x197604,null));};exports[_0x48cb('0x4f')]=function(_0x334d0b,_0x524b0a){if(_0x334d0b[_0x48cb('0x4e')]['id']){delete _0x334d0b[_0x48cb('0x4e')]['id'];}return db[_0x48cb('0x45')][_0x48cb('0x50')]({'where':{'id':_0x334d0b[_0x48cb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x524b0a,null))[_0x48cb('0x29')](saveUpdates(_0x334d0b[_0x48cb('0x4e')],null))['then'](respondWithResult(_0x524b0a,null))['catch'](handleError(_0x524b0a,null));};exports[_0x48cb('0x51')]=function(_0x7099cb,_0x4816de){return db[_0x48cb('0x45')]['find']({'where':{'id':_0x7099cb[_0x48cb('0x4b')]['id']}})[_0x48cb('0x29')](handleEntityNotFound(_0x4816de,null))[_0x48cb('0x29')](removeEntity(_0x4816de,null))[_0x48cb('0x4a')](handleError(_0x4816de,null));};exports[_0x48cb('0x52')]=function(_0xb73675,_0x4532a1,_0x24bcc9){var _0x3cd83b={};var _0x301922={};var _0x1c3765;var _0x1fdc86;return db['ZohoAccount'][_0x48cb('0x53')]({'where':{'id':_0xb73675[_0x48cb('0x4b')]['id']}})[_0x48cb('0x29')](handleEntityNotFound(_0x4532a1,null))[_0x48cb('0x29')](function(_0x33b7a9){if(_0x33b7a9){_0x1c3765=_0x33b7a9;_0x301922['model']=_[_0x48cb('0x35')](db[_0x48cb('0x54')][_0x48cb('0x30')]);_0x301922[_0x48cb('0x36')]=_[_0x48cb('0x35')](_0xb73675[_0x48cb('0x36')]);_0x301922['filters']=_[_0x48cb('0x38')](_0x301922[_0x48cb('0x34')],_0x301922[_0x48cb('0x36')]);_0x3cd83b[_0x48cb('0x39')]=_[_0x48cb('0x38')](_0x301922['model'],qs[_0x48cb('0x3a')](_0xb73675['query'][_0x48cb('0x3a')]));_0x3cd83b[_0x48cb('0x39')]=_0x3cd83b[_0x48cb('0x39')][_0x48cb('0x3b')]?_0x3cd83b[_0x48cb('0x39')]:_0x301922['model'];_0x3cd83b[_0x48cb('0x3e')]=qs[_0x48cb('0x3f')](_0xb73675[_0x48cb('0x36')]['sort']);_0x3cd83b[_0x48cb('0x40')]=qs[_0x48cb('0x37')](_['pick'](_0xb73675[_0x48cb('0x36')],_0x301922[_0x48cb('0x37')]));if(_0xb73675[_0x48cb('0x36')][_0x48cb('0x42')]){_0x3cd83b[_0x48cb('0x40')]=_[_0x48cb('0x43')](_0x3cd83b[_0x48cb('0x40')],{'$or':_['map'](_0x3cd83b['attributes'],function(_0x97c477){var _0x228645={};_0x228645[_0x97c477]={'$like':'%'+_0xb73675['query'][_0x48cb('0x42')]+'%'};return _0x228645;})});}_0x3cd83b=_[_0x48cb('0x43')]({},_0x3cd83b,_0xb73675[_0x48cb('0x4c')]);return _0x1c3765['getConfigurations'](_0x3cd83b);}})[_0x48cb('0x29')](function(_0x443024){if(_0x443024){_0x1fdc86=_0x443024['length'];if(!_0xb73675[_0x48cb('0x36')][_0x48cb('0x3c')](_0x48cb('0x3d'))){_0x3cd83b[_0x48cb('0x22')]=qs[_0x48cb('0x22')](_0xb73675['query'][_0x48cb('0x22')]);_0x3cd83b[_0x48cb('0x20')]=qs[_0x48cb('0x20')](_0xb73675[_0x48cb('0x36')][_0x48cb('0x20')]);}return _0x1c3765[_0x48cb('0x52')](_0x3cd83b);}})['then'](function(_0x38e880){if(_0x38e880){return _0x38e880?{'count':_0x1fdc86,'rows':_0x38e880}:null;}})['then'](respondWithResult(_0x4532a1,null))['catch'](handleError(_0x4532a1,null));};exports[_0x48cb('0x55')]=function(_0x2ee0bc,_0x786a06,_0x18552b){if(_0x2ee0bc[_0x48cb('0x4e')]['id']){delete _0x2ee0bc['body']['id'];}return db[_0x48cb('0x45')][_0x48cb('0x53')]({'where':{'id':_0x2ee0bc[_0x48cb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x786a06,null))['then'](function(_0x4ecd5a){if(_0x4ecd5a){_0x2ee0bc[_0x48cb('0x4e')]['AccountId']=_0x4ecd5a['id'];_0x2ee0bc[_0x48cb('0x4e')][_0x48cb('0x56')]=integrations[_0x48cb('0x57')](_0x2ee0bc[_0x48cb('0x4e')]['channel'],_0x2ee0bc['body'][_0x48cb('0x32')]);_0x2ee0bc['body']['Descriptions']=integrations[_0x48cb('0x58')](_0x2ee0bc[_0x48cb('0x4e')][_0x48cb('0x59')],_0x2ee0bc[_0x48cb('0x4e')][_0x48cb('0x32')]);return db['ZohoConfiguration'][_0x48cb('0x4d')](_0x2ee0bc[_0x48cb('0x4e')],{'include':[{'model':db[_0x48cb('0x5a')],'as':'Subjects'},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x786a06,null))[_0x48cb('0x4a')](handleError(_0x786a06,null));};function getAccessToken(_0x9f0d91){return new Promise(function(_0x17d43c,_0x200254){var _0x5e5ebb;switch(_0x9f0d91['zone']){case'US':_0x5e5ebb=_0x48cb('0x5b');break;case'AU':_0x5e5ebb='https://accounts.zoho.com.au';break;case'EU':_0x5e5ebb=_0x48cb('0x5c');break;case'IN':_0x5e5ebb=_0x48cb('0x5d');break;case'CN':_0x5e5ebb=_0x48cb('0x5e');break;default:_0x5e5ebb='https://accounts.zoho.eu';break;}var _0x5c5577={'method':'POST','uri':_0x5e5ebb+_0x48cb('0x5f'),'qs':{'refresh_token':_0x9f0d91[_0x48cb('0x60')],'client_id':_0x9f0d91[_0x48cb('0x61')],'client_secret':_0x9f0d91[_0x48cb('0x62')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5c5577)[_0x48cb('0x29')](function(_0x3e1d4e){if(_0x3e1d4e['access_token']){_0x17d43c(_0x3e1d4e[_0x48cb('0x63')]);}else{_0x200254(_0x48cb('0x64'));}})[_0x48cb('0x4a')](function(_0x518c08){_0x200254(_0x518c08);});});}exports['getFields']=function(_0x2d6732,_0x2e19b0,_0x5560cd){var _0x232b84,_0x1c2950,_0x2d7588,_0x305b7c,_0x2db973;return db[_0x48cb('0x45')][_0x48cb('0x53')]({'where':{'id':_0x2d6732[_0x48cb('0x4b')]['id']},'attributes':['id',_0x48cb('0x65'),'zone',_0x48cb('0x61'),_0x48cb('0x62'),_0x48cb('0x66'),_0x48cb('0x67'),_0x48cb('0x60')]})['then'](handleEntityNotFound(_0x2e19b0,null))[_0x48cb('0x29')](function(_0x4e1909){_0x2db973=_0x4e1909;_0x232b84=_0x2db973[_0x48cb('0x65')];_0x1c2950=_0x232b84===_0x48cb('0x68')?'eu':_0x48cb('0x69');_0x2d7588=_0x2db973[_0x48cb('0x66')];var _0xf78bbe=_0x2d7588[_0x48cb('0x6a')](-0x1);if(_0xf78bbe==='/'||_0xf78bbe==='\x5c'||_0xf78bbe===':'){_0x2d7588=_0x2d7588[_0x48cb('0x6b')](0x0,_0x2d7588[_0x48cb('0x6c')](_0xf78bbe));}if(!_0x2db973[_0x48cb('0x60')]){throw new Error(_0x48cb('0x6d'));}return getAccessToken(_0x2db973);})[_0x48cb('0x29')](function(_0x5bcfa9){if(_0x5bcfa9){return rp({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1c2950),'qs':{'module':_0x48cb('0x6e')},'headers':{'Authorization':_0x48cb('0x6f')+_0x5bcfa9},'json':!![]});}})[_0x48cb('0x29')](function(_0x3f63fb){if(_0x3f63fb){if(_0x3f63fb[_0x48cb('0x70')]&&_0x3f63fb[_0x48cb('0x70')]['error']){throw new Error(_0x3f63fb['response'][_0x48cb('0x2a')][_0x48cb('0x71')]);}var _0x5e7031=[];var _0x35de76=[];var _0x36f1c4=[_0x48cb('0x72'),_0x48cb('0x73'),_0x48cb('0x74'),_0x48cb('0x75'),_0x48cb('0x76'),_0x48cb('0x77'),'Call_Start_Time',_0x48cb('0x78')];_0x35de76=_[_0x48cb('0x79')](_0x3f63fb[_0x48cb('0x3a')],function(_0x228be9){return _0x36f1c4['includes'](_0x228be9[_0x48cb('0x7a')]);});for(var _0x31adea=0x0;_0x31adea<_0x35de76[_0x48cb('0x3b')];_0x31adea++){if(_0x35de76[_0x31adea]['system_mandatory']===![]){_0x5e7031[_0x48cb('0x7b')]({'id':_0x35de76[_0x31adea]['id'],'name':_0x35de76[_0x31adea][_0x48cb('0x7c')],'custom':_0x35de76[_0x31adea][_0x48cb('0x7d')],'options':_0x35de76[_0x31adea][_0x48cb('0x7e')]===_0x48cb('0x7f')&&_0x35de76[_0x31adea][_0x48cb('0x80')][_0x48cb('0x3b')]>-0x1?_[_0x48cb('0x2f')](_0x35de76[_0x31adea][_0x48cb('0x80')],function(_0x4206c4){return{'name':_0x4206c4,'value':_0x4206c4};}):[]});}}return{'count':_0x5e7031[_0x48cb('0x3b')],'rows':_0x5e7031};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x2e19b0,null))[_0x48cb('0x4a')](function(_0x4e3f0a){var _0x2bf0bc=_0x2d6732[_0x48cb('0x36')]['test']?0x1f4:_0x4e3f0a['statusCode']||0x1f4;logger[_0x48cb('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x48cb('0x81'),_0x2bf0bc,JSON[_0x48cb('0x82')](_0x4e3f0a));delete _0x4e3f0a[_0x48cb('0x2c')];if(_0x2bf0bc===0x191){_0x2bf0bc=0x190;}_0x2e19b0['status'](_0x2bf0bc)[_0x48cb('0x2d')](_0x2d6732['query'][_0x48cb('0x83')]?{'message':_0x48cb('0x84'),'statusCode':_0x4e3f0a[_0x48cb('0x85')]}:_0x4e3f0a);});}; \ No newline at end of file +var _0x47ca=['AccountId','Subjects','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','refresh_token','access_token','getFields','host','clientId','clientSecret','zoho.eu','serverUrl','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','includes','system_mandatory','push','display_label','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','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','ZohoAccount','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','ZohoConfiguration','getConfigurations','addConfiguration','findOne'];(function(_0x4f1f80,_0x5c77ef){var _0x188690=function(_0x444427){while(--_0x444427){_0x4f1f80['push'](_0x4f1f80['shift']());}};_0x188690(++_0x5c77ef);}(_0x47ca,0x1c3));var _0xa47c=function(_0x17e902,_0x3e09fd){_0x17e902=_0x17e902-0x0;var _0x594559=_0x47ca[_0x17e902];return _0x594559;};'use strict';var emlformat=require(_0xa47c('0x0'));var rimraf=require(_0xa47c('0x1'));var zipdir=require(_0xa47c('0x2'));var jsonpatch=require(_0xa47c('0x3'));var rp=require('request-promise');var moment=require(_0xa47c('0x4'));var BPromise=require(_0xa47c('0x5'));var Mustache=require(_0xa47c('0x6'));var util=require(_0xa47c('0x7'));var path=require(_0xa47c('0x8'));var sox=require(_0xa47c('0x9'));var csv=require(_0xa47c('0xa'));var ejs=require(_0xa47c('0xb'));var fs=require('fs');var fs_extra=require(_0xa47c('0xc'));var _=require(_0xa47c('0xd'));var squel=require(_0xa47c('0xe'));var crypto=require(_0xa47c('0xf'));var jsforce=require(_0xa47c('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa47c('0xa'));var querystring=require(_0xa47c('0x11'));var Papa=require(_0xa47c('0x12'));var Redis=require(_0xa47c('0x13'));var authService=require(_0xa47c('0x14'));var qs=require(_0xa47c('0x15'));var as=require(_0xa47c('0x16'));var hardwareService=require(_0xa47c('0x17'));var logger=require(_0xa47c('0x18'))(_0xa47c('0x19'));var utils=require(_0xa47c('0x1a'));var config=require(_0xa47c('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xa47c('0x1c'))['db'];var integrations=require(_0xa47c('0x1d'));function respondWithStatusCode(_0x2c1945,_0x2380e5){_0x2380e5=_0x2380e5||0xcc;return function(_0x2e1ceb){if(_0x2e1ceb){return _0x2c1945['sendStatus'](_0x2380e5);}return _0x2c1945['status'](_0x2380e5)['end']();};}function respondWithResult(_0x171e91,_0x496169){_0x496169=_0x496169||0xc8;return function(_0x194246){if(_0x194246){return _0x171e91[_0xa47c('0x1e')](_0x496169)[_0xa47c('0x1f')](_0x194246);}};}function respondWithFilteredResult(_0x2f6033,_0x40ac3b){return function(_0x296d69){if(_0x296d69){var _0x5d1249=typeof _0x40ac3b[_0xa47c('0x20')]===_0xa47c('0x21')&&typeof _0x40ac3b[_0xa47c('0x22')]==='undefined';var _0x1d2fec=_0x296d69[_0xa47c('0x23')];var _0x35b5a6=_0x5d1249?0x0:_0x40ac3b[_0xa47c('0x20')];var _0x23ded9=_0x5d1249?_0x296d69['count']:_0x40ac3b[_0xa47c('0x20')]+_0x40ac3b[_0xa47c('0x22')];var _0x3e11fe;if(_0x23ded9>=_0x1d2fec){_0x23ded9=_0x1d2fec;_0x3e11fe=0xc8;}else{_0x3e11fe=0xce;}_0x2f6033[_0xa47c('0x1e')](_0x3e11fe);return _0x2f6033[_0xa47c('0x24')](_0xa47c('0x25'),_0x35b5a6+'-'+_0x23ded9+'/'+_0x1d2fec)['json'](_0x296d69);}return null;};}function patchUpdates(_0x532984){return function(_0x53e912){try{jsonpatch['apply'](_0x53e912,_0x532984,!![]);}catch(_0x2ca568){return BPromise[_0xa47c('0x26')](_0x2ca568);}return _0x53e912[_0xa47c('0x27')]();};}function saveUpdates(_0x53b666,_0x2ee4e5){return function(_0x1b65c6){if(_0x1b65c6){return _0x1b65c6[_0xa47c('0x28')](_0x53b666)[_0xa47c('0x29')](function(_0x5e0ef1){return _0x5e0ef1;});}return null;};}function removeEntity(_0x2173d9,_0x22f0a2){return function(_0xcf5a2e){if(_0xcf5a2e){return _0xcf5a2e[_0xa47c('0x2a')]()[_0xa47c('0x29')](function(){_0x2173d9[_0xa47c('0x1e')](0xcc)[_0xa47c('0x2b')]();});}};}function handleEntityNotFound(_0x568a54,_0x455d32){return function(_0x31eb13){if(!_0x31eb13){_0x568a54['sendStatus'](0x194);}return _0x31eb13;};}function handleError(_0x3bf134,_0x476158){_0x476158=_0x476158||0x1f4;return function(_0x3ac32e){logger[_0xa47c('0x2c')](_0x3ac32e[_0xa47c('0x2d')]);if(_0x3ac32e['name']){delete _0x3ac32e[_0xa47c('0x2e')];}_0x3bf134[_0xa47c('0x1e')](_0x476158)['send'](_0x3ac32e);};}exports[_0xa47c('0x2f')]=function(_0x127ddc,_0x6c8964){var _0x2e4c99={},_0x556bb9={},_0x3ff365={'count':0x0,'rows':[]};var _0x2f8629=_[_0xa47c('0x30')](db[_0xa47c('0x31')]['rawAttributes'],function(_0x1466e2){return{'name':_0x1466e2[_0xa47c('0x32')],'type':_0x1466e2[_0xa47c('0x33')]['key']};});_0x556bb9['model']=_[_0xa47c('0x30')](_0x2f8629,_0xa47c('0x2e'));_0x556bb9[_0xa47c('0x34')]=_[_0xa47c('0x35')](_0x127ddc[_0xa47c('0x34')]);_0x556bb9[_0xa47c('0x36')]=_[_0xa47c('0x37')](_0x556bb9['model'],_0x556bb9[_0xa47c('0x34')]);_0x2e4c99[_0xa47c('0x38')]=_[_0xa47c('0x37')](_0x556bb9[_0xa47c('0x39')],qs[_0xa47c('0x3a')](_0x127ddc[_0xa47c('0x34')]['fields']));_0x2e4c99[_0xa47c('0x38')]=_0x2e4c99[_0xa47c('0x38')][_0xa47c('0x3b')]?_0x2e4c99[_0xa47c('0x38')]:_0x556bb9[_0xa47c('0x39')];if(!_0x127ddc[_0xa47c('0x34')][_0xa47c('0x3c')](_0xa47c('0x3d'))){_0x2e4c99['limit']=qs[_0xa47c('0x22')](_0x127ddc[_0xa47c('0x34')]['limit']);_0x2e4c99['offset']=qs['offset'](_0x127ddc[_0xa47c('0x34')][_0xa47c('0x20')]);}_0x2e4c99[_0xa47c('0x3e')]=qs[_0xa47c('0x3f')](_0x127ddc[_0xa47c('0x34')][_0xa47c('0x3f')]);_0x2e4c99[_0xa47c('0x40')]=qs[_0xa47c('0x36')](_[_0xa47c('0x41')](_0x127ddc[_0xa47c('0x34')],_0x556bb9[_0xa47c('0x36')]),_0x2f8629);if(_0x127ddc[_0xa47c('0x34')][_0xa47c('0x42')]){_0x2e4c99['where']=_[_0xa47c('0x43')](_0x2e4c99['where'],{'$or':_['map'](_0x2f8629,function(_0x1168cc){if(_0x1168cc[_0xa47c('0x33')]!==_0xa47c('0x44')){var _0x2fbc8b={};_0x2fbc8b[_0x1168cc[_0xa47c('0x2e')]]={'$like':'%'+_0x127ddc[_0xa47c('0x34')][_0xa47c('0x42')]+'%'};return _0x2fbc8b;}})});}_0x2e4c99=_['merge']({},_0x2e4c99,_0x127ddc['options']);var _0x140382={'where':_0x2e4c99['where']};return db[_0xa47c('0x31')][_0xa47c('0x23')](_0x140382)['then'](function(_0x19bcb0){_0x3ff365[_0xa47c('0x23')]=_0x19bcb0;if(_0x127ddc['query'][_0xa47c('0x45')]){_0x2e4c99[_0xa47c('0x46')]=[{'all':!![]}];}return db[_0xa47c('0x31')][_0xa47c('0x47')](_0x2e4c99);})[_0xa47c('0x29')](function(_0x542a0f){_0x3ff365[_0xa47c('0x48')]=_0x542a0f;return _0x3ff365;})[_0xa47c('0x29')](respondWithFilteredResult(_0x6c8964,_0x2e4c99))[_0xa47c('0x49')](handleError(_0x6c8964,null));};exports[_0xa47c('0x4a')]=function(_0x43bc49,_0xc8d2d5){var _0x371f36={'raw':![],'where':{'id':_0x43bc49[_0xa47c('0x4b')]['id']}},_0x52f680={};_0x52f680[_0xa47c('0x39')]=_[_0xa47c('0x35')](db['ZohoAccount'][_0xa47c('0x4c')]);_0x52f680['query']=_['keys'](_0x43bc49[_0xa47c('0x34')]);_0x52f680[_0xa47c('0x36')]=_['intersection'](_0x52f680[_0xa47c('0x39')],_0x52f680[_0xa47c('0x34')]);_0x371f36[_0xa47c('0x38')]=_[_0xa47c('0x37')](_0x52f680[_0xa47c('0x39')],qs[_0xa47c('0x3a')](_0x43bc49['query'][_0xa47c('0x3a')]));_0x371f36[_0xa47c('0x38')]=_0x371f36[_0xa47c('0x38')][_0xa47c('0x3b')]?_0x371f36[_0xa47c('0x38')]:_0x52f680[_0xa47c('0x39')];if(_0x43bc49['query'][_0xa47c('0x45')]){_0x371f36[_0xa47c('0x46')]=[{'all':!![]}];}_0x371f36=_[_0xa47c('0x43')]({},_0x371f36,_0x43bc49[_0xa47c('0x4d')]);return db[_0xa47c('0x31')]['find'](_0x371f36)[_0xa47c('0x29')](handleEntityNotFound(_0xc8d2d5,null))[_0xa47c('0x29')](respondWithResult(_0xc8d2d5,null))[_0xa47c('0x49')](handleError(_0xc8d2d5,null));};exports[_0xa47c('0x4e')]=function(_0x21debb,_0x2c8090){return db['ZohoAccount'][_0xa47c('0x4e')](_0x21debb[_0xa47c('0x4f')],{})[_0xa47c('0x29')](respondWithResult(_0x2c8090,0xc9))['catch'](handleError(_0x2c8090,null));};exports['update']=function(_0x54cf6e,_0x477ba6){if(_0x54cf6e[_0xa47c('0x4f')]['id']){delete _0x54cf6e[_0xa47c('0x4f')]['id'];}return db[_0xa47c('0x31')][_0xa47c('0x50')]({'where':{'id':_0x54cf6e['params']['id']}})['then'](handleEntityNotFound(_0x477ba6,null))[_0xa47c('0x29')](saveUpdates(_0x54cf6e[_0xa47c('0x4f')],null))[_0xa47c('0x29')](respondWithResult(_0x477ba6,null))['catch'](handleError(_0x477ba6,null));};exports['destroy']=function(_0x21d258,_0x5acae1){return db[_0xa47c('0x31')][_0xa47c('0x50')]({'where':{'id':_0x21d258[_0xa47c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5acae1,null))['then'](removeEntity(_0x5acae1,null))['catch'](handleError(_0x5acae1,null));};exports['getConfigurations']=function(_0x446f91,_0x3f295f,_0x2a9830){var _0x562abe={};var _0x5071c7={};var _0x257929;var _0x1a8d3a;return db['ZohoAccount']['findOne']({'where':{'id':_0x446f91[_0xa47c('0x4b')]['id']}})[_0xa47c('0x29')](handleEntityNotFound(_0x3f295f,null))[_0xa47c('0x29')](function(_0x400225){if(_0x400225){_0x257929=_0x400225;_0x5071c7['model']=_['keys'](db[_0xa47c('0x51')][_0xa47c('0x4c')]);_0x5071c7[_0xa47c('0x34')]=_[_0xa47c('0x35')](_0x446f91[_0xa47c('0x34')]);_0x5071c7[_0xa47c('0x36')]=_[_0xa47c('0x37')](_0x5071c7[_0xa47c('0x39')],_0x5071c7[_0xa47c('0x34')]);_0x562abe[_0xa47c('0x38')]=_[_0xa47c('0x37')](_0x5071c7[_0xa47c('0x39')],qs['fields'](_0x446f91['query'][_0xa47c('0x3a')]));_0x562abe[_0xa47c('0x38')]=_0x562abe[_0xa47c('0x38')]['length']?_0x562abe['attributes']:_0x5071c7[_0xa47c('0x39')];_0x562abe['order']=qs[_0xa47c('0x3f')](_0x446f91[_0xa47c('0x34')]['sort']);_0x562abe[_0xa47c('0x40')]=qs[_0xa47c('0x36')](_[_0xa47c('0x41')](_0x446f91[_0xa47c('0x34')],_0x5071c7[_0xa47c('0x36')]));if(_0x446f91[_0xa47c('0x34')]['filter']){_0x562abe[_0xa47c('0x40')]=_['merge'](_0x562abe[_0xa47c('0x40')],{'$or':_[_0xa47c('0x30')](_0x562abe[_0xa47c('0x38')],function(_0x5285d2){var _0x5f4bb4={};_0x5f4bb4[_0x5285d2]={'$like':'%'+_0x446f91[_0xa47c('0x34')][_0xa47c('0x42')]+'%'};return _0x5f4bb4;})});}_0x562abe=_[_0xa47c('0x43')]({},_0x562abe,_0x446f91[_0xa47c('0x4d')]);return _0x257929[_0xa47c('0x52')](_0x562abe);}})[_0xa47c('0x29')](function(_0x2415d6){if(_0x2415d6){_0x1a8d3a=_0x2415d6['length'];if(!_0x446f91[_0xa47c('0x34')][_0xa47c('0x3c')](_0xa47c('0x3d'))){_0x562abe['limit']=qs[_0xa47c('0x22')](_0x446f91['query'][_0xa47c('0x22')]);_0x562abe['offset']=qs['offset'](_0x446f91['query'][_0xa47c('0x20')]);}return _0x257929[_0xa47c('0x52')](_0x562abe);}})[_0xa47c('0x29')](function(_0x5ed2f0){if(_0x5ed2f0){return _0x5ed2f0?{'count':_0x1a8d3a,'rows':_0x5ed2f0}:null;}})['then'](respondWithResult(_0x3f295f,null))['catch'](handleError(_0x3f295f,null));};exports[_0xa47c('0x53')]=function(_0x2f7696,_0x1bf7af,_0x826539){if(_0x2f7696[_0xa47c('0x4f')]['id']){delete _0x2f7696[_0xa47c('0x4f')]['id'];}return db[_0xa47c('0x31')][_0xa47c('0x54')]({'where':{'id':_0x2f7696[_0xa47c('0x4b')]['id']}})[_0xa47c('0x29')](handleEntityNotFound(_0x1bf7af,null))['then'](function(_0x2477ea){if(_0x2477ea){_0x2f7696['body'][_0xa47c('0x55')]=_0x2477ea['id'];_0x2f7696['body'][_0xa47c('0x56')]=integrations['getSubjects'](_0x2f7696[_0xa47c('0x4f')][_0xa47c('0x57')],_0x2f7696[_0xa47c('0x4f')][_0xa47c('0x33')]);_0x2f7696['body']['Descriptions']=integrations['getDescriptions'](_0x2f7696[_0xa47c('0x4f')][_0xa47c('0x57')],_0x2f7696[_0xa47c('0x4f')][_0xa47c('0x33')]);return db[_0xa47c('0x51')]['create'](_0x2f7696[_0xa47c('0x4f')],{'include':[{'model':db[_0xa47c('0x58')],'as':_0xa47c('0x56')},{'model':db[_0xa47c('0x58')],'as':_0xa47c('0x59')}]});}return null;})['then'](respondWithResult(_0x1bf7af,null))[_0xa47c('0x49')](handleError(_0x1bf7af,null));};function getAccessToken(_0x2e3358){return new Promise(function(_0x16d89f,_0x16ca83){var _0x1a2618;switch(_0x2e3358[_0xa47c('0x5a')]){case'US':_0x1a2618=_0xa47c('0x5b');break;case'AU':_0x1a2618=_0xa47c('0x5c');break;case'EU':_0x1a2618='https://accounts.zoho.eu';break;case'IN':_0x1a2618=_0xa47c('0x5d');break;case'CN':_0x1a2618='https://accounts.zoho.com.cn';break;default:_0x1a2618=_0xa47c('0x5e');break;}var _0x517703={'method':_0xa47c('0x5f'),'uri':_0x1a2618+_0xa47c('0x60'),'qs':{'refresh_token':_0x2e3358[_0xa47c('0x61')],'client_id':_0x2e3358['clientId'],'client_secret':_0x2e3358['clientSecret'],'grant_type':_0xa47c('0x62')},'json':!![]};return rp(_0x517703)['then'](function(_0x7c0f12){if(_0x7c0f12[_0xa47c('0x63')]){_0x16d89f(_0x7c0f12[_0xa47c('0x63')]);}else{_0x16ca83('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x150e19){_0x16ca83(_0x150e19);});});}exports[_0xa47c('0x64')]=function(_0x5b8718,_0x5b63d5,_0x25bb0c){var _0x5c1498,_0x3af30f,_0x3cec98,_0x516264,_0x2229a0;return db[_0xa47c('0x31')]['findOne']({'where':{'id':_0x5b8718['params']['id']},'attributes':['id',_0xa47c('0x65'),_0xa47c('0x5a'),_0xa47c('0x66'),_0xa47c('0x67'),'serverUrl','code',_0xa47c('0x61')]})[_0xa47c('0x29')](handleEntityNotFound(_0x5b63d5,null))[_0xa47c('0x29')](function(_0x25e89f){_0x2229a0=_0x25e89f;_0x5c1498=_0x2229a0[_0xa47c('0x65')];_0x3af30f=_0x5c1498===_0xa47c('0x68')?'eu':'com';_0x3cec98=_0x2229a0[_0xa47c('0x69')];var _0x55f544=_0x3cec98[_0xa47c('0x6a')](-0x1);if(_0x55f544==='/'||_0x55f544==='\x5c'||_0x55f544===':'){_0x3cec98=_0x3cec98['substring'](0x0,_0x3cec98[_0xa47c('0x6b')](_0x55f544));}if(!_0x2229a0[_0xa47c('0x61')]){throw new Error(_0xa47c('0x6c'));}return getAccessToken(_0x2229a0);})[_0xa47c('0x29')](function(_0x1a06ff){if(_0x1a06ff){return rp({'method':_0xa47c('0x6d'),'uri':util[_0xa47c('0x6e')](_0xa47c('0x6f'),_0x3af30f),'qs':{'module':_0xa47c('0x70')},'headers':{'Authorization':_0xa47c('0x71')+_0x1a06ff},'json':!![]});}})[_0xa47c('0x29')](function(_0xfddaed){if(_0xfddaed){if(_0xfddaed[_0xa47c('0x72')]&&_0xfddaed[_0xa47c('0x72')][_0xa47c('0x2c')]){throw new Error(_0xfddaed[_0xa47c('0x72')][_0xa47c('0x2c')][_0xa47c('0x73')]);}var _0x1bc348=[];var _0x3b5768=[];var _0x23def5=['Owner',_0xa47c('0x74'),_0xa47c('0x75'),_0xa47c('0x76'),'Call_Duration',_0xa47c('0x77'),_0xa47c('0x78'),_0xa47c('0x79')];_0x3b5768=_['remove'](_0xfddaed['fields'],function(_0x2ea886){return _0x23def5[_0xa47c('0x7a')](_0x2ea886['api_name']);});for(var _0x57a4b5=0x0;_0x57a4b5<_0x3b5768[_0xa47c('0x3b')];_0x57a4b5++){if(_0x3b5768[_0x57a4b5][_0xa47c('0x7b')]===![]){_0x1bc348[_0xa47c('0x7c')]({'id':_0x3b5768[_0x57a4b5]['id'],'name':_0x3b5768[_0x57a4b5][_0xa47c('0x7d')],'custom':_0x3b5768[_0x57a4b5]['custom_field'],'options':_0x3b5768[_0x57a4b5]['data_type']===_0xa47c('0x7e')&&_0x3b5768[_0x57a4b5][_0xa47c('0x7f')][_0xa47c('0x3b')]>-0x1?_[_0xa47c('0x30')](_0x3b5768[_0x57a4b5][_0xa47c('0x7f')],function(_0x5b0b2f){return{'name':_0x5b0b2f,'value':_0x5b0b2f};}):[]});}}return{'count':_0x1bc348[_0xa47c('0x3b')],'rows':_0x1bc348};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x5b63d5,null))[_0xa47c('0x49')](function(_0x483bf7){var _0x38bbaa=_0x5b8718['query'][_0xa47c('0x80')]?0x1f4:_0x483bf7[_0xa47c('0x81')]||0x1f4;logger[_0xa47c('0x2c')](_0xa47c('0x82'),_0xa47c('0x64'),_0x38bbaa,JSON[_0xa47c('0x83')](_0x483bf7));delete _0x483bf7[_0xa47c('0x2e')];if(_0x38bbaa===0x191){_0x38bbaa=0x190;}_0x5b63d5[_0xa47c('0x1e')](_0x38bbaa)[_0xa47c('0x84')](_0x5b8718[_0xa47c('0x34')][_0xa47c('0x80')]?{'message':_0xa47c('0x85'),'statusCode':_0x483bf7[_0xa47c('0x81')]}:_0x483bf7);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 0bcd77e..2a8fe82 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 _0x947e=['exports','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','https://accounts.zoho.in','https://accounts.zoho.com.cn','catch','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x947e,0x13a));var _0xe947=function(_0x321336,_0x4c2b55){_0x321336=_0x321336-0x0;var _0x4680e7=_0x947e[_0x321336];return _0x4680e7;};'use strict';var _=require(_0xe947('0x0'));var util=require(_0xe947('0x1'));var logger=require(_0xe947('0x2'))(_0xe947('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe947('0x4'));var fs=require('fs');var path=require(_0xe947('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xe947('0x6')]=function(_0x1f0c78,_0x5ac778){return _0x1f0c78[_0xe947('0x7')](_0xe947('0x8'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x121c55,_0x44b100,_0x9e92ec){if(_0x121c55[_0xe947('0x9')](_0xe947('0xa'))||_0x121c55[_0xe947('0x9')](_0xe947('0xb'))||_0x121c55[_0xe947('0x9')](_0xe947('0xc'))||_0x121c55[_0xe947('0x9')](_0xe947('0xd'))||_0x121c55[_0xe947('0x9')](_0xe947('0xe'))||_0x121c55[_0xe947('0x9')](_0xe947('0xf'))){var _0x51f253,_0x5cd86e;_0x51f253=_0x121c55['serverUrl'];var _0x3dc73a=_0x51f253[_0xe947('0x10')](-0x1);if(_0x3dc73a==='/'||_0x3dc73a==='\x5c'||_0x3dc73a===':'){_0x51f253=_0x51f253[_0xe947('0x11')](0x0,_0x51f253[_0xe947('0x12')](_0x3dc73a));}switch(_0x121c55['zone']){case'US':_0x5cd86e=_0xe947('0x13');break;case'AU':_0x5cd86e=_0xe947('0x14');break;case'IN':_0x5cd86e='https://accounts.zoho.in';break;case'CN':_0x5cd86e='https://accounts.zoho.com.cn';break;default:_0x5cd86e=_0xe947('0x15');break;}var _0x3b759a={'method':_0xe947('0x16'),'uri':_0x5cd86e+_0xe947('0x17'),'form':{'grant_type':_0xe947('0x18'),'client_id':_0x121c55[_0xe947('0xc')],'client_secret':_0x121c55[_0xe947('0xd')],'redirect_uri':_0x121c55[_0xe947('0xb')],'code':_0x121c55['code']},'headers':{'Content-Type':_0xe947('0x19')}};return rp(_0x3b759a)[_0xe947('0x1a')](function(_0x256319){var _0x2dfeee=JSON[_0xe947('0x1b')](_0x256319);if(_0x2dfeee[_0xe947('0x1c')]){_0x121c55[_0xe947('0x1d')]=_0x2dfeee['refresh_token'];logger[_0xe947('0x1e')](util[_0xe947('0x1f')](_0xe947('0x20'),_0x121c55['name'],_0x121c55['id']));}else{logger[_0xe947('0x21')](util['format'](_0xe947('0x22'),_0x121c55[_0xe947('0x23')],_0x121c55['id']),util['inspect'](_0x2dfeee,{'showHidden':![],'depth':null}));}return _0x9e92ec(null,_0x44b100);})['catch'](function(_0x33c3d0){logger[_0xe947('0x21')](util[_0xe947('0x1f')](_0xe947('0x22'),_0x121c55[_0xe947('0x23')],_0x121c55['id']),util[_0xe947('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x9e92ec(_0x33c3d0);});}else{return _0x9e92ec(null,_0x44b100);}},'beforeUpdate':function(_0x42e3b2,_0x2c50be,_0x20c4fb){if(_0x42e3b2['changed']('zone')||_0x42e3b2['changed'](_0xe947('0xb'))||_0x42e3b2[_0xe947('0x9')]('clientId')||_0x42e3b2[_0xe947('0x9')]('clientSecret')||_0x42e3b2[_0xe947('0x9')]('code')||_0x42e3b2[_0xe947('0x9')](_0xe947('0xf'))){var _0x196281,_0x5838e3;_0x196281=_0x42e3b2['serverUrl'];var _0x380759=_0x196281['slice'](-0x1);if(_0x380759==='/'||_0x380759==='\x5c'||_0x380759===':'){_0x196281=_0x196281[_0xe947('0x11')](0x0,_0x196281[_0xe947('0x12')](_0x380759));}switch(_0x42e3b2[_0xe947('0xa')]){case'US':_0x5838e3='https://accounts.zoho.com';break;case'AU':_0x5838e3=_0xe947('0x14');break;case'IN':_0x5838e3=_0xe947('0x25');break;case'CN':_0x5838e3=_0xe947('0x26');break;default:_0x5838e3=_0xe947('0x15');break;}var _0x1ed279={'method':_0xe947('0x16'),'uri':_0x5838e3+'/oauth/v2/token','form':{'grant_type':_0xe947('0x18'),'client_id':_0x42e3b2[_0xe947('0xc')],'client_secret':_0x42e3b2[_0xe947('0xd')],'redirect_uri':_0x42e3b2[_0xe947('0xb')],'code':_0x42e3b2[_0xe947('0xe')]},'headers':{'Content-Type':_0xe947('0x19')}};return rp(_0x1ed279)['then'](function(_0x3bf9e8){var _0x4395e6=JSON['parse'](_0x3bf9e8);if(_0x4395e6['refresh_token']){_0x42e3b2[_0xe947('0x1d')]=_0x4395e6[_0xe947('0x1c')];logger[_0xe947('0x1e')](util[_0xe947('0x1f')](_0xe947('0x20'),_0x42e3b2[_0xe947('0x23')],_0x42e3b2['id']));}else{logger[_0xe947('0x21')](util[_0xe947('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x42e3b2['name'],_0x42e3b2['id']),util[_0xe947('0x24')](_0x4395e6,{'showHidden':![],'depth':null}));}return _0x20c4fb(null,_0x2c50be);})[_0xe947('0x27')](function(_0x4a6c31){logger[_0xe947('0x21')](util['format'](_0xe947('0x22'),_0x42e3b2[_0xe947('0x23')],_0x42e3b2['id']),util[_0xe947('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x20c4fb(_0x4a6c31);});}else{return _0x20c4fb(null,_0x2c50be);}}}});}; \ No newline at end of file +var _0xd858=['zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','refresh_token','lodash','util','../../config/logger','api','request-promise','path','../../components/integrations/configuration','exports','define','ZohoAccount','changed'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0xd858,0x70));var _0x8d85=function(_0xe74934,_0x30a90f){_0xe74934=_0xe74934-0x0;var _0x3039cf=_0xd858[_0xe74934];return _0x3039cf;};'use strict';var _=require(_0x8d85('0x0'));var util=require(_0x8d85('0x1'));var logger=require(_0x8d85('0x2'))(_0x8d85('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8d85('0x4'));var fs=require('fs');var path=require(_0x8d85('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x8d85('0x6'));module[_0x8d85('0x7')]=function(_0x5a8abc,_0x9a926){return _0x5a8abc[_0x8d85('0x8')](_0x8d85('0x9'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5367f4,_0x52a74a,_0x16d044){if(_0x5367f4[_0x8d85('0xa')](_0x8d85('0xb'))||_0x5367f4[_0x8d85('0xa')](_0x8d85('0xc'))||_0x5367f4[_0x8d85('0xa')](_0x8d85('0xd'))||_0x5367f4[_0x8d85('0xa')](_0x8d85('0xe'))||_0x5367f4[_0x8d85('0xa')](_0x8d85('0xf'))||_0x5367f4[_0x8d85('0xa')](_0x8d85('0x10'))){var _0x59248d,_0x518b6a;_0x59248d=_0x5367f4[_0x8d85('0xc')];var _0x267143=_0x59248d[_0x8d85('0x11')](-0x1);if(_0x267143==='/'||_0x267143==='\x5c'||_0x267143===':'){_0x59248d=_0x59248d[_0x8d85('0x12')](0x0,_0x59248d[_0x8d85('0x13')](_0x267143));}switch(_0x5367f4[_0x8d85('0xb')]){case'US':_0x518b6a=_0x8d85('0x14');break;case'AU':_0x518b6a=_0x8d85('0x15');break;case'IN':_0x518b6a=_0x8d85('0x16');break;case'CN':_0x518b6a=_0x8d85('0x17');break;default:_0x518b6a=_0x8d85('0x18');break;}var _0x29be0b={'method':_0x8d85('0x19'),'uri':_0x518b6a+_0x8d85('0x1a'),'form':{'grant_type':_0x8d85('0x1b'),'client_id':_0x5367f4[_0x8d85('0xd')],'client_secret':_0x5367f4[_0x8d85('0xe')],'redirect_uri':_0x5367f4[_0x8d85('0xc')],'code':_0x5367f4[_0x8d85('0xf')]},'headers':{'Content-Type':_0x8d85('0x1c')}};return rp(_0x29be0b)[_0x8d85('0x1d')](function(_0x1e5958){var _0x21e3cf=JSON[_0x8d85('0x1e')](_0x1e5958);if(_0x21e3cf['refresh_token']){_0x5367f4[_0x8d85('0x1f')]=_0x21e3cf['refresh_token'];logger[_0x8d85('0x20')](util['format'](_0x8d85('0x21'),_0x5367f4[_0x8d85('0x22')],_0x5367f4['id']));}else{logger[_0x8d85('0x23')](util[_0x8d85('0x24')](_0x8d85('0x25'),_0x5367f4[_0x8d85('0x22')],_0x5367f4['id']),util['inspect'](_0x21e3cf,{'showHidden':![],'depth':null}));}return _0x16d044(null,_0x52a74a);})[_0x8d85('0x26')](function(_0x4301c0){logger[_0x8d85('0x23')](util[_0x8d85('0x24')](_0x8d85('0x25'),_0x5367f4['name'],_0x5367f4['id']),util[_0x8d85('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x16d044(_0x4301c0);});}else{return _0x16d044(null,_0x52a74a);}},'beforeUpdate':function(_0x32d952,_0x1b4a36,_0x450f69){if(_0x32d952[_0x8d85('0xa')](_0x8d85('0xb'))||_0x32d952[_0x8d85('0xa')]('serverUrl')||_0x32d952['changed'](_0x8d85('0xd'))||_0x32d952[_0x8d85('0xa')](_0x8d85('0xe'))||_0x32d952[_0x8d85('0xa')](_0x8d85('0xf'))||_0x32d952[_0x8d85('0xa')]('host')){var _0x16919f,_0x1de00f;_0x16919f=_0x32d952[_0x8d85('0xc')];var _0x209e37=_0x16919f[_0x8d85('0x11')](-0x1);if(_0x209e37==='/'||_0x209e37==='\x5c'||_0x209e37===':'){_0x16919f=_0x16919f['substring'](0x0,_0x16919f['lastIndexOf'](_0x209e37));}switch(_0x32d952[_0x8d85('0xb')]){case'US':_0x1de00f='https://accounts.zoho.com';break;case'AU':_0x1de00f=_0x8d85('0x15');break;case'IN':_0x1de00f='https://accounts.zoho.in';break;case'CN':_0x1de00f=_0x8d85('0x17');break;default:_0x1de00f=_0x8d85('0x18');break;}var _0x317441={'method':_0x8d85('0x19'),'uri':_0x1de00f+_0x8d85('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x32d952[_0x8d85('0xd')],'client_secret':_0x32d952[_0x8d85('0xe')],'redirect_uri':_0x32d952[_0x8d85('0xc')],'code':_0x32d952[_0x8d85('0xf')]},'headers':{'Content-Type':_0x8d85('0x1c')}};return rp(_0x317441)[_0x8d85('0x1d')](function(_0x53cff1){var _0x56bbfa=JSON[_0x8d85('0x1e')](_0x53cff1);if(_0x56bbfa[_0x8d85('0x28')]){_0x32d952[_0x8d85('0x1f')]=_0x56bbfa[_0x8d85('0x28')];logger['info'](util[_0x8d85('0x24')](_0x8d85('0x21'),_0x32d952[_0x8d85('0x22')],_0x32d952['id']));}else{logger[_0x8d85('0x23')](util[_0x8d85('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x32d952[_0x8d85('0x22')],_0x32d952['id']),util[_0x8d85('0x27')](_0x56bbfa,{'showHidden':![],'depth':null}));}return _0x450f69(null,_0x1b4a36);})[_0x8d85('0x26')](function(_0x1ebda0){logger[_0x8d85('0x23')](util[_0x8d85('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x32d952['name'],_0x32d952['id']),util[_0x8d85('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x450f69(_0x1ebda0);});}else{return _0x450f69(null,_0x1b4a36);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 72d86fe..b691f82 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 _0x2fc9=['jayson/promise','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','GetZohoAccount','catch','ShowZohoAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x15b476,_0x3a65a6){var _0x1963b5=function(_0x2989f2){while(--_0x2989f2){_0x15b476['push'](_0x15b476['shift']());}};_0x1963b5(++_0x3a65a6);}(_0x2fc9,0xc2));var _0x92fc=function(_0x53f897,_0x539857){_0x53f897=_0x53f897-0x0;var _0x6879f8=_0x2fc9[_0x53f897];return _0x6879f8;};'use strict';var _=require('lodash');var util=require(_0x92fc('0x0'));var moment=require(_0x92fc('0x1'));var BPromise=require(_0x92fc('0x2'));var rs=require(_0x92fc('0x3'));var fs=require('fs');var Redis=require(_0x92fc('0x4'));var db=require(_0x92fc('0x5'))['db'];var utils=require(_0x92fc('0x6'));var logger=require(_0x92fc('0x7'))(_0x92fc('0x8'));var config=require(_0x92fc('0x9'));var jayson=require(_0x92fc('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c79a5,_0x340518,_0x13787c){return new BPromise(function(_0xa640a5,_0x3b656e){return client[_0x92fc('0xb')](_0x5c79a5,_0x13787c)[_0x92fc('0xc')](function(_0x2805f4){logger['info'](_0x92fc('0xd'),_0x340518,_0x92fc('0xe'));logger[_0x92fc('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x340518,_0x92fc('0xe'),JSON[_0x92fc('0x10')](_0x2805f4));if(_0x2805f4[_0x92fc('0x11')]){if(_0x2805f4['error']['code']===0x1f4){logger[_0x92fc('0x11')](_0x92fc('0xd'),_0x340518,_0x2805f4['error'][_0x92fc('0x12')]);return _0x3b656e(_0x2805f4[_0x92fc('0x11')][_0x92fc('0x12')]);}logger[_0x92fc('0x11')](_0x92fc('0xd'),_0x340518,_0x2805f4['error'][_0x92fc('0x12')]);return _0xa640a5(_0x2805f4[_0x92fc('0x11')][_0x92fc('0x12')]);}else{logger[_0x92fc('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x340518,'request\x20sent');_0xa640a5(_0x2805f4[_0x92fc('0x14')][_0x92fc('0x12')]);}})['catch'](function(_0x3370c9){logger[_0x92fc('0x11')](_0x92fc('0xd'),_0x340518,_0x3370c9);_0x3b656e(_0x3370c9);});});}exports['GetZohoAccount']=function(_0x2b0229){var _0x346ee8=this;return new Promise(function(_0x3a1071,_0x2602f7){return db[_0x92fc('0x15')][_0x92fc('0x16')]({'raw':_0x2b0229[_0x92fc('0x17')]?_0x2b0229[_0x92fc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2b0229[_0x92fc('0x17')]?_0x2b0229['options'][_0x92fc('0x18')]||null:null,'attributes':_0x2b0229[_0x92fc('0x17')]?_0x2b0229[_0x92fc('0x17')][_0x92fc('0x19')]||null:null,'limit':_0x2b0229[_0x92fc('0x17')]?_0x2b0229[_0x92fc('0x17')][_0x92fc('0x1a')]||null:null,'include':_0x2b0229['options']?_0x2b0229[_0x92fc('0x17')][_0x92fc('0x1b')]?_[_0x92fc('0x1c')](_0x2b0229['options'][_0x92fc('0x1b')],function(_0x442576){return{'model':db[_0x442576[_0x92fc('0x1d')]],'as':_0x442576['as'],'attributes':_0x442576['attributes'],'include':_0x442576[_0x92fc('0x1b')]?_[_0x92fc('0x1c')](_0x442576[_0x92fc('0x1b')],function(_0x4052d5){return{'model':db[_0x4052d5[_0x92fc('0x1d')]],'as':_0x4052d5['as'],'attributes':_0x4052d5[_0x92fc('0x19')],'include':_0x4052d5[_0x92fc('0x1b')]?_[_0x92fc('0x1c')](_0x4052d5[_0x92fc('0x1b')],function(_0x19ff2b){return{'model':db[_0x19ff2b[_0x92fc('0x1d')]],'as':_0x19ff2b['as'],'attributes':_0x19ff2b[_0x92fc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x92fc('0xc')](function(_0x4ef103){logger[_0x92fc('0x13')](_0x92fc('0x1e'),_0x2b0229);logger[_0x92fc('0xf')](_0x92fc('0x1e'),_0x2b0229,JSON[_0x92fc('0x10')](_0x4ef103));_0x3a1071(_0x4ef103);})[_0x92fc('0x1f')](function(_0x129bcf){logger['error'](_0x92fc('0x1e'),_0x129bcf[_0x92fc('0x12')],_0x2b0229);_0x2602f7(_0x346ee8[_0x92fc('0x11')](0x1f4,_0x129bcf['message']));});});};exports[_0x92fc('0x20')]=function(_0x1607ab){var _0x416dfe=this;return new Promise(function(_0x265b38,_0x44e0cb){return db['ZohoAccount'][_0x92fc('0x21')]({'raw':_0x1607ab[_0x92fc('0x17')]?_0x1607ab[_0x92fc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1607ab[_0x92fc('0x17')]?_0x1607ab[_0x92fc('0x17')][_0x92fc('0x18')]||null:null,'attributes':_0x1607ab[_0x92fc('0x17')]?_0x1607ab[_0x92fc('0x17')]['attributes']||null:null,'include':_0x1607ab[_0x92fc('0x17')]?_0x1607ab[_0x92fc('0x17')][_0x92fc('0x1b')]?_[_0x92fc('0x1c')](_0x1607ab['options'][_0x92fc('0x1b')],function(_0x4b9971){return{'model':db[_0x4b9971['model']],'as':_0x4b9971['as'],'attributes':_0x4b9971[_0x92fc('0x19')],'include':_0x4b9971[_0x92fc('0x1b')]?_[_0x92fc('0x1c')](_0x4b9971[_0x92fc('0x1b')],function(_0x8831a1){return{'model':db[_0x8831a1['model']],'as':_0x8831a1['as'],'attributes':_0x8831a1[_0x92fc('0x19')],'include':_0x8831a1[_0x92fc('0x1b')]?_[_0x92fc('0x1c')](_0x8831a1[_0x92fc('0x1b')],function(_0x5cee34){return{'model':db[_0x5cee34[_0x92fc('0x1d')]],'as':_0x5cee34['as'],'attributes':_0x5cee34[_0x92fc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x92fc('0xc')](function(_0x3e877a){logger[_0x92fc('0x13')](_0x92fc('0x20'),_0x1607ab);logger[_0x92fc('0xf')]('ShowZohoAccount',_0x1607ab,JSON['stringify'](_0x3e877a));_0x265b38(_0x3e877a);})['catch'](function(_0x121fc3){logger[_0x92fc('0x11')](_0x92fc('0x20'),_0x121fc3['message'],_0x1607ab);_0x44e0cb(_0x416dfe[_0x92fc('0x11')](0x1f4,_0x121fc3[_0x92fc('0x12')]));});});}; \ No newline at end of file +var _0x6365=['ZohoAccount','options','raw','where','attributes','limit','include','model','map','catch','find','debug','ShowZohoAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','GetZohoAccount'];(function(_0x421a99,_0x239c08){var _0x16a86c=function(_0x2a3d4c){while(--_0x2a3d4c){_0x421a99['push'](_0x421a99['shift']());}};_0x16a86c(++_0x239c08);}(_0x6365,0x148));var _0x5636=function(_0x5cc58f,_0xe7d059){_0x5cc58f=_0x5cc58f-0x0;var _0x344816=_0x6365[_0x5cc58f];return _0x344816;};'use strict';var _=require(_0x5636('0x0'));var util=require(_0x5636('0x1'));var moment=require(_0x5636('0x2'));var BPromise=require(_0x5636('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5636('0x4'));var db=require(_0x5636('0x5'))['db'];var utils=require(_0x5636('0x6'));var logger=require(_0x5636('0x7'))(_0x5636('0x8'));var config=require('../../config/environment');var jayson=require(_0x5636('0x9'));var client=jayson[_0x5636('0xa')][_0x5636('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3575b7,_0x53d5b4,_0x17439f){return new BPromise(function(_0x10769f,_0x54eb5c){return client['request'](_0x3575b7,_0x17439f)[_0x5636('0xc')](function(_0x43e880){logger[_0x5636('0xd')](_0x5636('0xe'),_0x53d5b4,'request\x20sent');logger['debug'](_0x5636('0xf'),_0x53d5b4,'request\x20sent',JSON[_0x5636('0x10')](_0x43e880));if(_0x43e880[_0x5636('0x11')]){if(_0x43e880[_0x5636('0x11')][_0x5636('0x12')]===0x1f4){logger[_0x5636('0x11')](_0x5636('0xe'),_0x53d5b4,_0x43e880['error'][_0x5636('0x13')]);return _0x54eb5c(_0x43e880[_0x5636('0x11')]['message']);}logger[_0x5636('0x11')](_0x5636('0xe'),_0x53d5b4,_0x43e880['error']['message']);return _0x10769f(_0x43e880[_0x5636('0x11')][_0x5636('0x13')]);}else{logger[_0x5636('0xd')](_0x5636('0xe'),_0x53d5b4,_0x5636('0x14'));_0x10769f(_0x43e880['result'][_0x5636('0x13')]);}})['catch'](function(_0x55de40){logger[_0x5636('0x11')](_0x5636('0xe'),_0x53d5b4,_0x55de40);_0x54eb5c(_0x55de40);});});}exports[_0x5636('0x15')]=function(_0x287675){var _0x4683c6=this;return new Promise(function(_0x2e375d,_0x17cdc4){return db[_0x5636('0x16')]['findAll']({'raw':_0x287675['options']?_0x287675[_0x5636('0x17')][_0x5636('0x18')]===undefined?!![]:![]:!![],'where':_0x287675[_0x5636('0x17')]?_0x287675['options'][_0x5636('0x19')]||null:null,'attributes':_0x287675[_0x5636('0x17')]?_0x287675[_0x5636('0x17')][_0x5636('0x1a')]||null:null,'limit':_0x287675[_0x5636('0x17')]?_0x287675['options'][_0x5636('0x1b')]||null:null,'include':_0x287675[_0x5636('0x17')]?_0x287675[_0x5636('0x17')][_0x5636('0x1c')]?_['map'](_0x287675['options'][_0x5636('0x1c')],function(_0x4d8f1c){return{'model':db[_0x4d8f1c[_0x5636('0x1d')]],'as':_0x4d8f1c['as'],'attributes':_0x4d8f1c[_0x5636('0x1a')],'include':_0x4d8f1c[_0x5636('0x1c')]?_[_0x5636('0x1e')](_0x4d8f1c['include'],function(_0x3a1575){return{'model':db[_0x3a1575['model']],'as':_0x3a1575['as'],'attributes':_0x3a1575[_0x5636('0x1a')],'include':_0x3a1575['include']?_[_0x5636('0x1e')](_0x3a1575[_0x5636('0x1c')],function(_0x10f3ea){return{'model':db[_0x10f3ea[_0x5636('0x1d')]],'as':_0x10f3ea['as'],'attributes':_0x10f3ea['attributes']};}):[]};}):[]};}):[]:[]})[_0x5636('0xc')](function(_0x1ff533){logger[_0x5636('0xd')](_0x5636('0x15'),_0x287675);logger['debug'](_0x5636('0x15'),_0x287675,JSON['stringify'](_0x1ff533));_0x2e375d(_0x1ff533);})[_0x5636('0x1f')](function(_0x54726e){logger[_0x5636('0x11')]('GetZohoAccount',_0x54726e[_0x5636('0x13')],_0x287675);_0x17cdc4(_0x4683c6['error'](0x1f4,_0x54726e[_0x5636('0x13')]));});});};exports['ShowZohoAccount']=function(_0x183f69){var _0x29e56a=this;return new Promise(function(_0x3987e2,_0x573e86){return db[_0x5636('0x16')][_0x5636('0x20')]({'raw':_0x183f69[_0x5636('0x17')]?_0x183f69['options'][_0x5636('0x18')]===undefined?!![]:![]:!![],'where':_0x183f69[_0x5636('0x17')]?_0x183f69[_0x5636('0x17')][_0x5636('0x19')]||null:null,'attributes':_0x183f69[_0x5636('0x17')]?_0x183f69[_0x5636('0x17')]['attributes']||null:null,'include':_0x183f69['options']?_0x183f69[_0x5636('0x17')]['include']?_[_0x5636('0x1e')](_0x183f69['options'][_0x5636('0x1c')],function(_0x3825ca){return{'model':db[_0x3825ca[_0x5636('0x1d')]],'as':_0x3825ca['as'],'attributes':_0x3825ca[_0x5636('0x1a')],'include':_0x3825ca['include']?_[_0x5636('0x1e')](_0x3825ca['include'],function(_0x1885c5){return{'model':db[_0x1885c5[_0x5636('0x1d')]],'as':_0x1885c5['as'],'attributes':_0x1885c5[_0x5636('0x1a')],'include':_0x1885c5['include']?_['map'](_0x1885c5[_0x5636('0x1c')],function(_0x41604e){return{'model':db[_0x41604e[_0x5636('0x1d')]],'as':_0x41604e['as'],'attributes':_0x41604e[_0x5636('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5636('0xc')](function(_0x154eb6){logger[_0x5636('0xd')]('ShowZohoAccount',_0x183f69);logger[_0x5636('0x21')]('ShowZohoAccount',_0x183f69,JSON['stringify'](_0x154eb6));_0x3987e2(_0x154eb6);})[_0x5636('0x1f')](function(_0x276972){logger[_0x5636('0x11')](_0x5636('0x22'),_0x276972[_0x5636('0x13')],_0x183f69);_0x573e86(_0x29e56a[_0x5636('0x11')](0x1f4,_0x276972[_0x5636('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 94164a3..39b7a58 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 _0x4bad=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x44990c,_0x18ffdc){var _0x1f407b=function(_0x33420e){while(--_0x33420e){_0x44990c['push'](_0x44990c['shift']());}};_0x1f407b(++_0x18ffdc);}(_0x4bad,0x181));var _0xd4ba=function(_0x2e9808,_0x380d6c){_0x2e9808=_0x2e9808-0x0;var _0x1cf50a=_0x4bad[_0x2e9808];return _0x1cf50a;};'use strict';var multer=require('multer');var util=require(_0xd4ba('0x0'));var path=require(_0xd4ba('0x1'));var timeout=require(_0xd4ba('0x2'));var express=require(_0xd4ba('0x3'));var router=express[_0xd4ba('0x4')]();var fs_extra=require(_0xd4ba('0x5'));var auth=require(_0xd4ba('0x6'));var interaction=require(_0xd4ba('0x7'));var config=require(_0xd4ba('0x8'));var controller=require(_0xd4ba('0x9'));router[_0xd4ba('0xa')]('/',auth[_0xd4ba('0xb')](),controller['index']);router[_0xd4ba('0xa')](_0xd4ba('0xc'),auth[_0xd4ba('0xb')](),controller[_0xd4ba('0xd')]);router[_0xd4ba('0xa')](_0xd4ba('0xe'),auth[_0xd4ba('0xb')](),controller[_0xd4ba('0xf')]);router[_0xd4ba('0xa')](_0xd4ba('0x10'),auth[_0xd4ba('0xb')](),controller[_0xd4ba('0x11')]);router[_0xd4ba('0xa')](_0xd4ba('0x12'),auth['isAuthenticated'](),controller[_0xd4ba('0x13')]);router[_0xd4ba('0x14')]('/',auth['isAuthenticated'](),controller[_0xd4ba('0x15')]);router[_0xd4ba('0x16')](_0xd4ba('0xc'),auth[_0xd4ba('0xb')](),controller['update']);router[_0xd4ba('0x17')](_0xd4ba('0xc'),auth[_0xd4ba('0xb')](),controller[_0xd4ba('0x18')]);module[_0xd4ba('0x19')]=router; \ No newline at end of file +var _0x7fed=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','exports','multer','util','path','express'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x7fed,0xec));var _0xd7fe=function(_0x5dd6d2,_0xa6e079){_0x5dd6d2=_0x5dd6d2-0x0;var _0x2ee77b=_0x7fed[_0x5dd6d2];return _0x2ee77b;};'use strict';var multer=require(_0xd7fe('0x0'));var util=require(_0xd7fe('0x1'));var path=require(_0xd7fe('0x2'));var timeout=require('connect-timeout');var express=require(_0xd7fe('0x3'));var router=express[_0xd7fe('0x4')]();var fs_extra=require(_0xd7fe('0x5'));var auth=require(_0xd7fe('0x6'));var interaction=require(_0xd7fe('0x7'));var config=require(_0xd7fe('0x8'));var controller=require('./intZohoConfiguration.controller');router[_0xd7fe('0x9')]('/',auth[_0xd7fe('0xa')](),controller[_0xd7fe('0xb')]);router['get'](_0xd7fe('0xc'),auth[_0xd7fe('0xa')](),controller[_0xd7fe('0xd')]);router['get'](_0xd7fe('0xe'),auth['isAuthenticated'](),controller[_0xd7fe('0xf')]);router[_0xd7fe('0x9')](_0xd7fe('0x10'),auth['isAuthenticated'](),controller[_0xd7fe('0x11')]);router[_0xd7fe('0x9')](_0xd7fe('0x12'),auth[_0xd7fe('0xa')](),controller['getDescriptions']);router[_0xd7fe('0x13')]('/',auth['isAuthenticated'](),controller[_0xd7fe('0x14')]);router[_0xd7fe('0x15')](_0xd7fe('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd7fe('0x16')](_0xd7fe('0xc'),auth[_0xd7fe('0xa')](),controller['destroy']);module[_0xd7fe('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 49a071c..e7b3ddf 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 _0x4af7=['contact_lead','sequelize','exports','STRING','ENUM','lead','nothing'];(function(_0x3eee56,_0x176daf){var _0x506bcd=function(_0x3cfe8b){while(--_0x3cfe8b){_0x3eee56['push'](_0x3eee56['shift']());}};_0x506bcd(++_0x176daf);}(_0x4af7,0x104));var _0x74af=function(_0x1f5887,_0x2fa1f1){_0x1f5887=_0x1f5887-0x0;var _0x21774b=_0x4af7[_0x1f5887];return _0x21774b;};'use strict';var Sequelize=require(_0x74af('0x0'));module[_0x74af('0x1')]={'name':{'type':Sequelize[_0x74af('0x2')]},'moduleCreate':{'type':Sequelize[_0x74af('0x3')](_0x74af('0x4'),'contact',_0x74af('0x5')),'defaultValue':_0x74af('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead','contact',_0x74af('0x4')),'defaultValue':_0x74af('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5a81=['contact_lead','contact','exports','STRING','ENUM','lead'];(function(_0x4969fa,_0x1e63b6){var _0x1e9157=function(_0x43a104){while(--_0x43a104){_0x4969fa['push'](_0x4969fa['shift']());}};_0x1e9157(++_0x1e63b6);}(_0x5a81,0x92));var _0x15a8=function(_0x2b1e5b,_0x43b03a){_0x2b1e5b=_0x2b1e5b-0x0;var _0x2a07be=_0x5a81[_0x2b1e5b];return _0x2a07be;};'use strict';var Sequelize=require('sequelize');module[_0x15a8('0x0')]={'name':{'type':Sequelize[_0x15a8('0x1')]},'moduleCreate':{'type':Sequelize[_0x15a8('0x2')]('lead','contact','nothing'),'defaultValue':_0x15a8('0x3')},'moduleSearch':{'type':Sequelize[_0x15a8('0x2')](_0x15a8('0x4'),_0x15a8('0x5'),_0x15a8('0x3')),'defaultValue':_0x15a8('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 3326c65..9f86b8d 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 _0x5867=['set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','fields','includeAll','create','body','find','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0x5867,0x172));var _0x7586=function(_0x184013,_0x572c35){_0x184013=_0x184013-0x0;var _0x3762be=_0x5867[_0x184013];return _0x3762be;};'use strict';var emlformat=require(_0x7586('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7586('0x1'));var jsonpatch=require(_0x7586('0x2'));var rp=require('request-promise');var moment=require(_0x7586('0x3'));var BPromise=require(_0x7586('0x4'));var Mustache=require(_0x7586('0x5'));var util=require(_0x7586('0x6'));var path=require('path');var sox=require(_0x7586('0x7'));var csv=require(_0x7586('0x8'));var ejs=require(_0x7586('0x9'));var fs=require('fs');var fs_extra=require(_0x7586('0xa'));var _=require(_0x7586('0xb'));var squel=require(_0x7586('0xc'));var crypto=require(_0x7586('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7586('0xe'));var toCsv=require(_0x7586('0x8'));var querystring=require(_0x7586('0xf'));var Papa=require(_0x7586('0x10'));var Redis=require(_0x7586('0x11'));var authService=require(_0x7586('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7586('0x13'));var utils=require(_0x7586('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7586('0x15'));var db=require(_0x7586('0x16'))['db'];function respondWithStatusCode(_0xe2a95c,_0x294a2e){_0x294a2e=_0x294a2e||0xcc;return function(_0x4e44d6){if(_0x4e44d6){return _0xe2a95c['sendStatus'](_0x294a2e);}return _0xe2a95c[_0x7586('0x17')](_0x294a2e)[_0x7586('0x18')]();};}function respondWithResult(_0x283c31,_0x1054a1){_0x1054a1=_0x1054a1||0xc8;return function(_0x5d664e){if(_0x5d664e){return _0x283c31['status'](_0x1054a1)[_0x7586('0x19')](_0x5d664e);}};}function respondWithFilteredResult(_0x56cd2f,_0x477d0d){return function(_0x4ce995){if(_0x4ce995){var _0x50c0d3=typeof _0x477d0d[_0x7586('0x1a')]===_0x7586('0x1b')&&typeof _0x477d0d[_0x7586('0x1c')]===_0x7586('0x1b');var _0x453784=_0x4ce995[_0x7586('0x1d')];var _0x1b6177=_0x50c0d3?0x0:_0x477d0d['offset'];var _0x2b7309=_0x50c0d3?_0x4ce995[_0x7586('0x1d')]:_0x477d0d[_0x7586('0x1a')]+_0x477d0d[_0x7586('0x1c')];var _0x29002d;if(_0x2b7309>=_0x453784){_0x2b7309=_0x453784;_0x29002d=0xc8;}else{_0x29002d=0xce;}_0x56cd2f['status'](_0x29002d);return _0x56cd2f[_0x7586('0x1e')](_0x7586('0x1f'),_0x1b6177+'-'+_0x2b7309+'/'+_0x453784)[_0x7586('0x19')](_0x4ce995);}return null;};}function patchUpdates(_0x185ebf){return function(_0x342cca){try{jsonpatch[_0x7586('0x20')](_0x342cca,_0x185ebf,!![]);}catch(_0x42de55){return BPromise[_0x7586('0x21')](_0x42de55);}return _0x342cca['save']();};}function saveUpdates(_0x359d18,_0x516760){return function(_0x3624f2){if(_0x3624f2){return _0x3624f2[_0x7586('0x22')](_0x359d18)['then'](function(_0x2696f9){return _0x2696f9;});}return null;};}function removeEntity(_0x70eb3,_0x444296){return function(_0x473217){if(_0x473217){return _0x473217[_0x7586('0x23')]()[_0x7586('0x24')](function(){_0x70eb3[_0x7586('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11c41a,_0x22b417){return function(_0x57d08a){if(!_0x57d08a){_0x11c41a[_0x7586('0x25')](0x194);}return _0x57d08a;};}function handleError(_0x460c9a,_0x29604a){_0x29604a=_0x29604a||0x1f4;return function(_0x24dee9){logger[_0x7586('0x26')](_0x24dee9[_0x7586('0x27')]);if(_0x24dee9[_0x7586('0x28')]){delete _0x24dee9[_0x7586('0x28')];}_0x460c9a[_0x7586('0x17')](_0x29604a)['send'](_0x24dee9);};}exports[_0x7586('0x29')]=function(_0x13b7f9,_0x27255d){var _0x177be7={},_0x265e89={},_0x1fead7={'count':0x0,'rows':[]};var _0x2e4ace=_[_0x7586('0x2a')](db[_0x7586('0x2b')][_0x7586('0x2c')],function(_0x30f35a){return{'name':_0x30f35a[_0x7586('0x2d')],'type':_0x30f35a[_0x7586('0x2e')][_0x7586('0x2f')]};});_0x265e89[_0x7586('0x30')]=_[_0x7586('0x2a')](_0x2e4ace,_0x7586('0x28'));_0x265e89['query']=_[_0x7586('0x31')](_0x13b7f9[_0x7586('0x32')]);_0x265e89[_0x7586('0x33')]=_[_0x7586('0x34')](_0x265e89[_0x7586('0x30')],_0x265e89[_0x7586('0x32')]);_0x177be7['attributes']=_['intersection'](_0x265e89[_0x7586('0x30')],qs['fields'](_0x13b7f9[_0x7586('0x32')]['fields']));_0x177be7[_0x7586('0x35')]=_0x177be7[_0x7586('0x35')][_0x7586('0x36')]?_0x177be7[_0x7586('0x35')]:_0x265e89[_0x7586('0x30')];if(!_0x13b7f9[_0x7586('0x32')][_0x7586('0x37')](_0x7586('0x38'))){_0x177be7['limit']=qs['limit'](_0x13b7f9[_0x7586('0x32')][_0x7586('0x1c')]);_0x177be7['offset']=qs[_0x7586('0x1a')](_0x13b7f9['query']['offset']);}_0x177be7[_0x7586('0x39')]=qs['sort'](_0x13b7f9[_0x7586('0x32')][_0x7586('0x3a')]);_0x177be7['where']=qs['filters'](_[_0x7586('0x3b')](_0x13b7f9[_0x7586('0x32')],_0x265e89[_0x7586('0x33')]),_0x2e4ace);if(_0x13b7f9[_0x7586('0x32')][_0x7586('0x3c')]){_0x177be7[_0x7586('0x3d')]=_[_0x7586('0x3e')](_0x177be7[_0x7586('0x3d')],{'$or':_['map'](_0x2e4ace,function(_0x2ab069){if(_0x2ab069['type']!==_0x7586('0x3f')){var _0x692970={};_0x692970[_0x2ab069[_0x7586('0x28')]]={'$like':'%'+_0x13b7f9['query'][_0x7586('0x3c')]+'%'};return _0x692970;}})});}_0x177be7=_['merge']({},_0x177be7,_0x13b7f9[_0x7586('0x40')]);var _0x583f90={'where':_0x177be7[_0x7586('0x3d')]};return db['ZohoConfiguration'][_0x7586('0x1d')](_0x583f90)[_0x7586('0x24')](function(_0x4267e8){_0x1fead7[_0x7586('0x1d')]=_0x4267e8;if(_0x13b7f9[_0x7586('0x32')]['includeAll']){_0x177be7[_0x7586('0x41')]=[{'all':!![]}];}return db[_0x7586('0x2b')][_0x7586('0x42')](_0x177be7);})[_0x7586('0x24')](function(_0x42808c){_0x1fead7[_0x7586('0x43')]=_0x42808c;return _0x1fead7;})[_0x7586('0x24')](respondWithFilteredResult(_0x27255d,_0x177be7))[_0x7586('0x44')](handleError(_0x27255d,null));};exports['show']=function(_0x5b3aef,_0x378721){var _0x2f909d={'raw':![],'where':{'id':_0x5b3aef[_0x7586('0x45')]['id']}},_0x340c59={};_0x340c59[_0x7586('0x30')]=_[_0x7586('0x31')](db[_0x7586('0x2b')][_0x7586('0x2c')]);_0x340c59[_0x7586('0x32')]=_[_0x7586('0x31')](_0x5b3aef[_0x7586('0x32')]);_0x340c59['filters']=_['intersection'](_0x340c59[_0x7586('0x30')],_0x340c59[_0x7586('0x32')]);_0x2f909d[_0x7586('0x35')]=_[_0x7586('0x34')](_0x340c59[_0x7586('0x30')],qs['fields'](_0x5b3aef['query'][_0x7586('0x46')]));_0x2f909d[_0x7586('0x35')]=_0x2f909d[_0x7586('0x35')][_0x7586('0x36')]?_0x2f909d[_0x7586('0x35')]:_0x340c59['model'];if(_0x5b3aef[_0x7586('0x32')][_0x7586('0x47')]){_0x2f909d[_0x7586('0x41')]=[{'all':!![]}];}_0x2f909d=_[_0x7586('0x3e')]({},_0x2f909d,_0x5b3aef[_0x7586('0x40')]);return db[_0x7586('0x2b')]['find'](_0x2f909d)[_0x7586('0x24')](handleEntityNotFound(_0x378721,null))[_0x7586('0x24')](respondWithResult(_0x378721,null))[_0x7586('0x44')](handleError(_0x378721,null));};exports[_0x7586('0x48')]=function(_0x256ccf,_0x3ad3ac){return db['ZohoConfiguration'][_0x7586('0x48')](_0x256ccf[_0x7586('0x49')],{})['then'](respondWithResult(_0x3ad3ac,0xc9))[_0x7586('0x44')](handleError(_0x3ad3ac,null));};exports['update']=function(_0x1eeed7,_0x7b25b6){if(_0x1eeed7[_0x7586('0x49')]['id']){delete _0x1eeed7[_0x7586('0x49')]['id'];}return db['ZohoConfiguration'][_0x7586('0x4a')]({'where':{'id':_0x1eeed7[_0x7586('0x45')]['id']}})[_0x7586('0x24')](handleEntityNotFound(_0x7b25b6,null))[_0x7586('0x24')](saveUpdates(_0x1eeed7[_0x7586('0x49')],null))[_0x7586('0x24')](respondWithResult(_0x7b25b6,null))[_0x7586('0x44')](handleError(_0x7b25b6,null));};exports[_0x7586('0x23')]=function(_0x4bdba1,_0x4d8f60){return db['ZohoConfiguration'][_0x7586('0x4a')]({'where':{'id':_0x4bdba1[_0x7586('0x45')]['id']}})['then'](handleEntityNotFound(_0x4d8f60,null))[_0x7586('0x24')](removeEntity(_0x4d8f60,null))[_0x7586('0x44')](handleError(_0x4d8f60,null));};exports[_0x7586('0x4b')]=function(_0x5c5a57,_0x36807f,_0x25dcb8){var _0x4b463f={};var _0x3be212={};var _0x1004fe;var _0x307041;return db[_0x7586('0x2b')][_0x7586('0x4c')]({'where':{'id':_0x5c5a57[_0x7586('0x45')]['id']}})[_0x7586('0x24')](handleEntityNotFound(_0x36807f,null))[_0x7586('0x24')](function(_0x3071e5){if(_0x3071e5){_0x1004fe=_0x3071e5;_0x3be212['model']=_[_0x7586('0x31')](db[_0x7586('0x4d')][_0x7586('0x2c')]);_0x3be212[_0x7586('0x32')]=_[_0x7586('0x31')](_0x5c5a57[_0x7586('0x32')]);_0x3be212[_0x7586('0x33')]=_[_0x7586('0x34')](_0x3be212[_0x7586('0x30')],_0x3be212[_0x7586('0x32')]);_0x4b463f['attributes']=_[_0x7586('0x34')](_0x3be212[_0x7586('0x30')],qs[_0x7586('0x46')](_0x5c5a57[_0x7586('0x32')][_0x7586('0x46')]));_0x4b463f[_0x7586('0x35')]=_0x4b463f[_0x7586('0x35')][_0x7586('0x36')]?_0x4b463f[_0x7586('0x35')]:_0x3be212[_0x7586('0x30')];_0x4b463f[_0x7586('0x39')]=qs['sort'](_0x5c5a57[_0x7586('0x32')][_0x7586('0x3a')]);_0x4b463f[_0x7586('0x3d')]=qs[_0x7586('0x33')](_[_0x7586('0x3b')](_0x5c5a57[_0x7586('0x32')],_0x3be212[_0x7586('0x33')]));if(_0x5c5a57[_0x7586('0x32')][_0x7586('0x3c')]){_0x4b463f['where']=_['merge'](_0x4b463f[_0x7586('0x3d')],{'$or':_[_0x7586('0x2a')](_0x4b463f[_0x7586('0x35')],function(_0x3682c2){var _0x470ed3={};_0x470ed3[_0x3682c2]={'$like':'%'+_0x5c5a57['query'][_0x7586('0x3c')]+'%'};return _0x470ed3;})});}_0x4b463f=_[_0x7586('0x3e')]({},_0x4b463f,_0x5c5a57[_0x7586('0x40')]);return _0x1004fe[_0x7586('0x4b')](_0x4b463f);}})[_0x7586('0x24')](function(_0x41524f){if(_0x41524f){_0x307041=_0x41524f[_0x7586('0x36')];if(!_0x5c5a57[_0x7586('0x32')][_0x7586('0x37')](_0x7586('0x38'))){_0x4b463f['limit']=qs['limit'](_0x5c5a57[_0x7586('0x32')]['limit']);_0x4b463f[_0x7586('0x1a')]=qs[_0x7586('0x1a')](_0x5c5a57[_0x7586('0x32')][_0x7586('0x1a')]);}return _0x1004fe[_0x7586('0x4b')](_0x4b463f);}})['then'](function(_0x2c46ce){if(_0x2c46ce){return _0x2c46ce?{'count':_0x307041,'rows':_0x2c46ce}:null;}})['then'](respondWithResult(_0x36807f,null))[_0x7586('0x44')](handleError(_0x36807f,null));};exports[_0x7586('0x4e')]=function(_0x187ea1,_0x3f58ce,_0x4b6fca){var _0x410091={};var _0x378dd3={};var _0x34a330;var _0x40c792;return db[_0x7586('0x2b')][_0x7586('0x4c')]({'where':{'id':_0x187ea1['params']['id']}})[_0x7586('0x24')](handleEntityNotFound(_0x3f58ce,null))[_0x7586('0x24')](function(_0x20a66c){if(_0x20a66c){_0x34a330=_0x20a66c;_0x378dd3[_0x7586('0x30')]=_['keys'](db[_0x7586('0x4d')]['rawAttributes']);_0x378dd3[_0x7586('0x32')]=_[_0x7586('0x31')](_0x187ea1[_0x7586('0x32')]);_0x378dd3[_0x7586('0x33')]=_['intersection'](_0x378dd3[_0x7586('0x30')],_0x378dd3['query']);_0x410091[_0x7586('0x35')]=_[_0x7586('0x34')](_0x378dd3[_0x7586('0x30')],qs[_0x7586('0x46')](_0x187ea1[_0x7586('0x32')]['fields']));_0x410091[_0x7586('0x35')]=_0x410091[_0x7586('0x35')][_0x7586('0x36')]?_0x410091['attributes']:_0x378dd3['model'];_0x410091[_0x7586('0x39')]=qs['sort'](_0x187ea1[_0x7586('0x32')][_0x7586('0x3a')]);_0x410091[_0x7586('0x3d')]=qs[_0x7586('0x33')](_[_0x7586('0x3b')](_0x187ea1[_0x7586('0x32')],_0x378dd3[_0x7586('0x33')]));if(_0x187ea1[_0x7586('0x32')][_0x7586('0x3c')]){_0x410091['where']=_[_0x7586('0x3e')](_0x410091[_0x7586('0x3d')],{'$or':_['map'](_0x410091[_0x7586('0x35')],function(_0x9ace59){var _0x395c3c={};_0x395c3c[_0x9ace59]={'$like':'%'+_0x187ea1[_0x7586('0x32')]['filter']+'%'};return _0x395c3c;})});}_0x410091=_[_0x7586('0x3e')]({},_0x410091,_0x187ea1[_0x7586('0x40')]);return _0x34a330[_0x7586('0x4e')](_0x410091);}})['then'](function(_0x23fdb2){if(_0x23fdb2){_0x40c792=_0x23fdb2[_0x7586('0x36')];if(!_0x187ea1[_0x7586('0x32')][_0x7586('0x37')](_0x7586('0x38'))){_0x410091['limit']=qs[_0x7586('0x1c')](_0x187ea1['query']['limit']);_0x410091[_0x7586('0x1a')]=qs[_0x7586('0x1a')](_0x187ea1[_0x7586('0x32')][_0x7586('0x1a')]);}return _0x34a330[_0x7586('0x4e')](_0x410091);}})[_0x7586('0x24')](function(_0x4b97ae){if(_0x4b97ae){return _0x4b97ae?{'count':_0x40c792,'rows':_0x4b97ae}:null;}})['then'](respondWithResult(_0x3f58ce,null))['catch'](handleError(_0x3f58ce,null));};exports[_0x7586('0x4f')]=function(_0x4700f4,_0x5f2142,_0x59fa01){var _0x182d4c={};var _0x511a51={};var _0x407c08;var _0x388267;return db[_0x7586('0x2b')][_0x7586('0x4c')]({'where':{'id':_0x4700f4[_0x7586('0x45')]['id']}})[_0x7586('0x24')](handleEntityNotFound(_0x5f2142,null))[_0x7586('0x24')](function(_0x1fca2b){if(_0x1fca2b){_0x407c08=_0x1fca2b;_0x511a51[_0x7586('0x30')]=_['keys'](db[_0x7586('0x4d')][_0x7586('0x2c')]);_0x511a51[_0x7586('0x32')]=_[_0x7586('0x31')](_0x4700f4[_0x7586('0x32')]);_0x511a51['filters']=_[_0x7586('0x34')](_0x511a51[_0x7586('0x30')],_0x511a51[_0x7586('0x32')]);_0x182d4c[_0x7586('0x35')]=_[_0x7586('0x34')](_0x511a51[_0x7586('0x30')],qs['fields'](_0x4700f4[_0x7586('0x32')][_0x7586('0x46')]));_0x182d4c[_0x7586('0x35')]=_0x182d4c[_0x7586('0x35')][_0x7586('0x36')]?_0x182d4c[_0x7586('0x35')]:_0x511a51['model'];_0x182d4c['order']=qs[_0x7586('0x3a')](_0x4700f4['query']['sort']);_0x182d4c[_0x7586('0x3d')]=qs[_0x7586('0x33')](_[_0x7586('0x3b')](_0x4700f4['query'],_0x511a51[_0x7586('0x33')]));if(_0x4700f4['query'][_0x7586('0x3c')]){_0x182d4c[_0x7586('0x3d')]=_[_0x7586('0x3e')](_0x182d4c['where'],{'$or':_['map'](_0x182d4c[_0x7586('0x35')],function(_0x50ba75){var _0x342a13={};_0x342a13[_0x50ba75]={'$like':'%'+_0x4700f4[_0x7586('0x32')][_0x7586('0x3c')]+'%'};return _0x342a13;})});}_0x182d4c=_[_0x7586('0x3e')]({},_0x182d4c,_0x4700f4[_0x7586('0x40')]);return _0x407c08[_0x7586('0x4f')](_0x182d4c);}})[_0x7586('0x24')](function(_0x1c9474){if(_0x1c9474){_0x388267=_0x1c9474['length'];if(!_0x4700f4['query'][_0x7586('0x37')]('nolimit')){_0x182d4c[_0x7586('0x1c')]=qs[_0x7586('0x1c')](_0x4700f4[_0x7586('0x32')][_0x7586('0x1c')]);_0x182d4c[_0x7586('0x1a')]=qs[_0x7586('0x1a')](_0x4700f4[_0x7586('0x32')]['offset']);}return _0x407c08[_0x7586('0x4f')](_0x182d4c);}})[_0x7586('0x24')](function(_0x1dc17f){if(_0x1dc17f){return _0x1dc17f?{'count':_0x388267,'rows':_0x1dc17f}:null;}})['then'](respondWithResult(_0x5f2142,null))[_0x7586('0x44')](handleError(_0x5f2142,null));}; \ No newline at end of file +var _0xc11c=['rawAttributes','length','find','create','body','getFields','findOne','ZohoField','pick','options','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','ZohoConfiguration','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0x5c24a2,_0x54e610){var _0x207b4a=function(_0x1ec959){while(--_0x1ec959){_0x5c24a2['push'](_0x5c24a2['shift']());}};_0x207b4a(++_0x54e610);}(_0xc11c,0x141));var _0xcc11=function(_0x476c6f,_0x5dc8b9){_0x476c6f=_0x476c6f-0x0;var _0x53e534=_0xc11c[_0x476c6f];return _0x53e534;};'use strict';var emlformat=require(_0xcc11('0x0'));var rimraf=require(_0xcc11('0x1'));var zipdir=require(_0xcc11('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcc11('0x3'));var util=require('util');var path=require(_0xcc11('0x4'));var sox=require(_0xcc11('0x5'));var csv=require(_0xcc11('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc11('0x7'));var squel=require('squel');var crypto=require(_0xcc11('0x8'));var jsforce=require(_0xcc11('0x9'));var deskjs=require(_0xcc11('0xa'));var toCsv=require(_0xcc11('0x6'));var querystring=require(_0xcc11('0xb'));var Papa=require(_0xcc11('0xc'));var Redis=require(_0xcc11('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xcc11('0xe'));var as=require(_0xcc11('0xf'));var hardwareService=require(_0xcc11('0x10'));var logger=require(_0xcc11('0x11'))(_0xcc11('0x12'));var utils=require('../../config/utils');var config=require(_0xcc11('0x13'));var licenseUtil=require(_0xcc11('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x194182,_0x4bd511){_0x4bd511=_0x4bd511||0xcc;return function(_0x1c0e03){if(_0x1c0e03){return _0x194182[_0xcc11('0x15')](_0x4bd511);}return _0x194182[_0xcc11('0x16')](_0x4bd511)['end']();};}function respondWithResult(_0xd50d22,_0x315e9b){_0x315e9b=_0x315e9b||0xc8;return function(_0x29d02f){if(_0x29d02f){return _0xd50d22['status'](_0x315e9b)[_0xcc11('0x17')](_0x29d02f);}};}function respondWithFilteredResult(_0x11549c,_0x2b7ab6){return function(_0x248d52){if(_0x248d52){var _0x2b0dbe=typeof _0x2b7ab6['offset']===_0xcc11('0x18')&&typeof _0x2b7ab6['limit']===_0xcc11('0x18');var _0xbf0baa=_0x248d52[_0xcc11('0x19')];var _0x3fe2f3=_0x2b0dbe?0x0:_0x2b7ab6['offset'];var _0x589e76=_0x2b0dbe?_0x248d52['count']:_0x2b7ab6[_0xcc11('0x1a')]+_0x2b7ab6[_0xcc11('0x1b')];var _0x4b910f;if(_0x589e76>=_0xbf0baa){_0x589e76=_0xbf0baa;_0x4b910f=0xc8;}else{_0x4b910f=0xce;}_0x11549c[_0xcc11('0x16')](_0x4b910f);return _0x11549c[_0xcc11('0x1c')]('Content-Range',_0x3fe2f3+'-'+_0x589e76+'/'+_0xbf0baa)[_0xcc11('0x17')](_0x248d52);}return null;};}function patchUpdates(_0x376f7f){return function(_0x2c4572){try{jsonpatch[_0xcc11('0x1d')](_0x2c4572,_0x376f7f,!![]);}catch(_0x57f995){return BPromise[_0xcc11('0x1e')](_0x57f995);}return _0x2c4572[_0xcc11('0x1f')]();};}function saveUpdates(_0x49f37a,_0x1ebc98){return function(_0x54e019){if(_0x54e019){return _0x54e019[_0xcc11('0x20')](_0x49f37a)[_0xcc11('0x21')](function(_0x5c91f9){return _0x5c91f9;});}return null;};}function removeEntity(_0x51d50e,_0x5e5bc7){return function(_0xca2cdb){if(_0xca2cdb){return _0xca2cdb[_0xcc11('0x22')]()['then'](function(){_0x51d50e[_0xcc11('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3972ee,_0x23245a){return function(_0xa2e381){if(!_0xa2e381){_0x3972ee[_0xcc11('0x15')](0x194);}return _0xa2e381;};}function handleError(_0x4def9b,_0x5096f3){_0x5096f3=_0x5096f3||0x1f4;return function(_0x5c2967){logger[_0xcc11('0x23')](_0x5c2967['stack']);if(_0x5c2967[_0xcc11('0x24')]){delete _0x5c2967[_0xcc11('0x24')];}_0x4def9b[_0xcc11('0x16')](_0x5096f3)[_0xcc11('0x25')](_0x5c2967);};}exports[_0xcc11('0x26')]=function(_0x3be405,_0x2e9a1e){var _0x20078c={},_0x2c89b6={},_0x394a6c={'count':0x0,'rows':[]};var _0x5ddd72=_[_0xcc11('0x27')](db[_0xcc11('0x28')]['rawAttributes'],function(_0x587df9){return{'name':_0x587df9[_0xcc11('0x29')],'type':_0x587df9['type']['key']};});_0x2c89b6[_0xcc11('0x2a')]=_['map'](_0x5ddd72,'name');_0x2c89b6['query']=_['keys'](_0x3be405[_0xcc11('0x2b')]);_0x2c89b6[_0xcc11('0x2c')]=_[_0xcc11('0x2d')](_0x2c89b6[_0xcc11('0x2a')],_0x2c89b6[_0xcc11('0x2b')]);_0x20078c[_0xcc11('0x2e')]=_['intersection'](_0x2c89b6[_0xcc11('0x2a')],qs[_0xcc11('0x2f')](_0x3be405[_0xcc11('0x2b')][_0xcc11('0x2f')]));_0x20078c[_0xcc11('0x2e')]=_0x20078c['attributes']['length']?_0x20078c['attributes']:_0x2c89b6[_0xcc11('0x2a')];if(!_0x3be405[_0xcc11('0x2b')][_0xcc11('0x30')]('nolimit')){_0x20078c['limit']=qs[_0xcc11('0x1b')](_0x3be405['query']['limit']);_0x20078c[_0xcc11('0x1a')]=qs['offset'](_0x3be405[_0xcc11('0x2b')][_0xcc11('0x1a')]);}_0x20078c[_0xcc11('0x31')]=qs[_0xcc11('0x32')](_0x3be405[_0xcc11('0x2b')]['sort']);_0x20078c[_0xcc11('0x33')]=qs[_0xcc11('0x2c')](_['pick'](_0x3be405[_0xcc11('0x2b')],_0x2c89b6[_0xcc11('0x2c')]),_0x5ddd72);if(_0x3be405['query'][_0xcc11('0x34')]){_0x20078c[_0xcc11('0x33')]=_['merge'](_0x20078c[_0xcc11('0x33')],{'$or':_['map'](_0x5ddd72,function(_0x1f3517){if(_0x1f3517[_0xcc11('0x35')]!==_0xcc11('0x36')){var _0x28ef4a={};_0x28ef4a[_0x1f3517[_0xcc11('0x24')]]={'$like':'%'+_0x3be405['query'][_0xcc11('0x34')]+'%'};return _0x28ef4a;}})});}_0x20078c=_[_0xcc11('0x37')]({},_0x20078c,_0x3be405['options']);var _0x1aa14f={'where':_0x20078c[_0xcc11('0x33')]};return db[_0xcc11('0x28')][_0xcc11('0x19')](_0x1aa14f)[_0xcc11('0x21')](function(_0x2f01f0){_0x394a6c['count']=_0x2f01f0;if(_0x3be405[_0xcc11('0x2b')][_0xcc11('0x38')]){_0x20078c[_0xcc11('0x39')]=[{'all':!![]}];}return db[_0xcc11('0x28')][_0xcc11('0x3a')](_0x20078c);})[_0xcc11('0x21')](function(_0x243821){_0x394a6c[_0xcc11('0x3b')]=_0x243821;return _0x394a6c;})[_0xcc11('0x21')](respondWithFilteredResult(_0x2e9a1e,_0x20078c))[_0xcc11('0x3c')](handleError(_0x2e9a1e,null));};exports[_0xcc11('0x3d')]=function(_0x16a3d4,_0xff9f58){var _0x4daaaf={'raw':![],'where':{'id':_0x16a3d4[_0xcc11('0x3e')]['id']}},_0x5b5612={};_0x5b5612['model']=_[_0xcc11('0x3f')](db[_0xcc11('0x28')][_0xcc11('0x40')]);_0x5b5612[_0xcc11('0x2b')]=_[_0xcc11('0x3f')](_0x16a3d4[_0xcc11('0x2b')]);_0x5b5612[_0xcc11('0x2c')]=_[_0xcc11('0x2d')](_0x5b5612[_0xcc11('0x2a')],_0x5b5612['query']);_0x4daaaf['attributes']=_[_0xcc11('0x2d')](_0x5b5612[_0xcc11('0x2a')],qs['fields'](_0x16a3d4['query']['fields']));_0x4daaaf['attributes']=_0x4daaaf[_0xcc11('0x2e')][_0xcc11('0x41')]?_0x4daaaf[_0xcc11('0x2e')]:_0x5b5612[_0xcc11('0x2a')];if(_0x16a3d4[_0xcc11('0x2b')][_0xcc11('0x38')]){_0x4daaaf['include']=[{'all':!![]}];}_0x4daaaf=_[_0xcc11('0x37')]({},_0x4daaaf,_0x16a3d4['options']);return db[_0xcc11('0x28')][_0xcc11('0x42')](_0x4daaaf)[_0xcc11('0x21')](handleEntityNotFound(_0xff9f58,null))[_0xcc11('0x21')](respondWithResult(_0xff9f58,null))['catch'](handleError(_0xff9f58,null));};exports[_0xcc11('0x43')]=function(_0x3df569,_0x5c7815){return db['ZohoConfiguration']['create'](_0x3df569['body'],{})['then'](respondWithResult(_0x5c7815,0xc9))['catch'](handleError(_0x5c7815,null));};exports[_0xcc11('0x20')]=function(_0x3b5d65,_0x44d083){if(_0x3b5d65[_0xcc11('0x44')]['id']){delete _0x3b5d65[_0xcc11('0x44')]['id'];}return db[_0xcc11('0x28')][_0xcc11('0x42')]({'where':{'id':_0x3b5d65[_0xcc11('0x3e')]['id']}})['then'](handleEntityNotFound(_0x44d083,null))[_0xcc11('0x21')](saveUpdates(_0x3b5d65['body'],null))['then'](respondWithResult(_0x44d083,null))[_0xcc11('0x3c')](handleError(_0x44d083,null));};exports['destroy']=function(_0x5b13a4,_0x15f0e7){return db[_0xcc11('0x28')]['find']({'where':{'id':_0x5b13a4['params']['id']}})[_0xcc11('0x21')](handleEntityNotFound(_0x15f0e7,null))[_0xcc11('0x21')](removeEntity(_0x15f0e7,null))[_0xcc11('0x3c')](handleError(_0x15f0e7,null));};exports[_0xcc11('0x45')]=function(_0x4703f7,_0x8e4a4d,_0x3e16d6){var _0xd241a5={};var _0x1ac9e2={};var _0x4ea42a;var _0x3dca94;return db[_0xcc11('0x28')][_0xcc11('0x46')]({'where':{'id':_0x4703f7[_0xcc11('0x3e')]['id']}})['then'](handleEntityNotFound(_0x8e4a4d,null))[_0xcc11('0x21')](function(_0x5021a5){if(_0x5021a5){_0x4ea42a=_0x5021a5;_0x1ac9e2[_0xcc11('0x2a')]=_['keys'](db[_0xcc11('0x47')]['rawAttributes']);_0x1ac9e2[_0xcc11('0x2b')]=_[_0xcc11('0x3f')](_0x4703f7[_0xcc11('0x2b')]);_0x1ac9e2[_0xcc11('0x2c')]=_[_0xcc11('0x2d')](_0x1ac9e2[_0xcc11('0x2a')],_0x1ac9e2[_0xcc11('0x2b')]);_0xd241a5[_0xcc11('0x2e')]=_[_0xcc11('0x2d')](_0x1ac9e2[_0xcc11('0x2a')],qs[_0xcc11('0x2f')](_0x4703f7['query'][_0xcc11('0x2f')]));_0xd241a5[_0xcc11('0x2e')]=_0xd241a5['attributes']['length']?_0xd241a5[_0xcc11('0x2e')]:_0x1ac9e2[_0xcc11('0x2a')];_0xd241a5[_0xcc11('0x31')]=qs[_0xcc11('0x32')](_0x4703f7[_0xcc11('0x2b')][_0xcc11('0x32')]);_0xd241a5['where']=qs[_0xcc11('0x2c')](_[_0xcc11('0x48')](_0x4703f7['query'],_0x1ac9e2[_0xcc11('0x2c')]));if(_0x4703f7[_0xcc11('0x2b')][_0xcc11('0x34')]){_0xd241a5[_0xcc11('0x33')]=_[_0xcc11('0x37')](_0xd241a5[_0xcc11('0x33')],{'$or':_[_0xcc11('0x27')](_0xd241a5['attributes'],function(_0x229af9){var _0x589950={};_0x589950[_0x229af9]={'$like':'%'+_0x4703f7[_0xcc11('0x2b')][_0xcc11('0x34')]+'%'};return _0x589950;})});}_0xd241a5=_[_0xcc11('0x37')]({},_0xd241a5,_0x4703f7[_0xcc11('0x49')]);return _0x4ea42a[_0xcc11('0x45')](_0xd241a5);}})['then'](function(_0x407f3f){if(_0x407f3f){_0x3dca94=_0x407f3f[_0xcc11('0x41')];if(!_0x4703f7[_0xcc11('0x2b')][_0xcc11('0x30')](_0xcc11('0x4a'))){_0xd241a5[_0xcc11('0x1b')]=qs['limit'](_0x4703f7['query'][_0xcc11('0x1b')]);_0xd241a5['offset']=qs[_0xcc11('0x1a')](_0x4703f7[_0xcc11('0x2b')][_0xcc11('0x1a')]);}return _0x4ea42a['getFields'](_0xd241a5);}})[_0xcc11('0x21')](function(_0x499291){if(_0x499291){return _0x499291?{'count':_0x3dca94,'rows':_0x499291}:null;}})[_0xcc11('0x21')](respondWithResult(_0x8e4a4d,null))[_0xcc11('0x3c')](handleError(_0x8e4a4d,null));};exports[_0xcc11('0x4b')]=function(_0x50c659,_0x20fbb2,_0x2051a6){var _0x2f958a={};var _0x6ea33d={};var _0x4e2684;var _0x1e8129;return db[_0xcc11('0x28')][_0xcc11('0x46')]({'where':{'id':_0x50c659['params']['id']}})[_0xcc11('0x21')](handleEntityNotFound(_0x20fbb2,null))[_0xcc11('0x21')](function(_0x29fde5){if(_0x29fde5){_0x4e2684=_0x29fde5;_0x6ea33d[_0xcc11('0x2a')]=_[_0xcc11('0x3f')](db[_0xcc11('0x47')][_0xcc11('0x40')]);_0x6ea33d[_0xcc11('0x2b')]=_[_0xcc11('0x3f')](_0x50c659['query']);_0x6ea33d['filters']=_['intersection'](_0x6ea33d[_0xcc11('0x2a')],_0x6ea33d[_0xcc11('0x2b')]);_0x2f958a[_0xcc11('0x2e')]=_[_0xcc11('0x2d')](_0x6ea33d['model'],qs[_0xcc11('0x2f')](_0x50c659[_0xcc11('0x2b')][_0xcc11('0x2f')]));_0x2f958a[_0xcc11('0x2e')]=_0x2f958a[_0xcc11('0x2e')][_0xcc11('0x41')]?_0x2f958a[_0xcc11('0x2e')]:_0x6ea33d['model'];_0x2f958a['order']=qs[_0xcc11('0x32')](_0x50c659['query'][_0xcc11('0x32')]);_0x2f958a[_0xcc11('0x33')]=qs['filters'](_['pick'](_0x50c659[_0xcc11('0x2b')],_0x6ea33d[_0xcc11('0x2c')]));if(_0x50c659['query']['filter']){_0x2f958a[_0xcc11('0x33')]=_[_0xcc11('0x37')](_0x2f958a['where'],{'$or':_[_0xcc11('0x27')](_0x2f958a[_0xcc11('0x2e')],function(_0x43ffab){var _0x24184a={};_0x24184a[_0x43ffab]={'$like':'%'+_0x50c659[_0xcc11('0x2b')][_0xcc11('0x34')]+'%'};return _0x24184a;})});}_0x2f958a=_[_0xcc11('0x37')]({},_0x2f958a,_0x50c659[_0xcc11('0x49')]);return _0x4e2684['getSubjects'](_0x2f958a);}})[_0xcc11('0x21')](function(_0x52468a){if(_0x52468a){_0x1e8129=_0x52468a[_0xcc11('0x41')];if(!_0x50c659[_0xcc11('0x2b')]['hasOwnProperty'](_0xcc11('0x4a'))){_0x2f958a['limit']=qs['limit'](_0x50c659[_0xcc11('0x2b')]['limit']);_0x2f958a[_0xcc11('0x1a')]=qs[_0xcc11('0x1a')](_0x50c659['query'][_0xcc11('0x1a')]);}return _0x4e2684[_0xcc11('0x4b')](_0x2f958a);}})[_0xcc11('0x21')](function(_0x51a9f8){if(_0x51a9f8){return _0x51a9f8?{'count':_0x1e8129,'rows':_0x51a9f8}:null;}})[_0xcc11('0x21')](respondWithResult(_0x20fbb2,null))[_0xcc11('0x3c')](handleError(_0x20fbb2,null));};exports[_0xcc11('0x4c')]=function(_0x20bfea,_0x5eb69b,_0x33bc43){var _0x710229={};var _0x538273={};var _0x3d1a88;var _0x1a6fd4;return db['ZohoConfiguration'][_0xcc11('0x46')]({'where':{'id':_0x20bfea['params']['id']}})[_0xcc11('0x21')](handleEntityNotFound(_0x5eb69b,null))[_0xcc11('0x21')](function(_0x2ba5d5){if(_0x2ba5d5){_0x3d1a88=_0x2ba5d5;_0x538273[_0xcc11('0x2a')]=_[_0xcc11('0x3f')](db[_0xcc11('0x47')][_0xcc11('0x40')]);_0x538273[_0xcc11('0x2b')]=_[_0xcc11('0x3f')](_0x20bfea['query']);_0x538273[_0xcc11('0x2c')]=_['intersection'](_0x538273[_0xcc11('0x2a')],_0x538273[_0xcc11('0x2b')]);_0x710229['attributes']=_[_0xcc11('0x2d')](_0x538273['model'],qs[_0xcc11('0x2f')](_0x20bfea['query']['fields']));_0x710229[_0xcc11('0x2e')]=_0x710229[_0xcc11('0x2e')][_0xcc11('0x41')]?_0x710229['attributes']:_0x538273['model'];_0x710229[_0xcc11('0x31')]=qs[_0xcc11('0x32')](_0x20bfea['query']['sort']);_0x710229['where']=qs[_0xcc11('0x2c')](_[_0xcc11('0x48')](_0x20bfea[_0xcc11('0x2b')],_0x538273[_0xcc11('0x2c')]));if(_0x20bfea[_0xcc11('0x2b')]['filter']){_0x710229[_0xcc11('0x33')]=_[_0xcc11('0x37')](_0x710229[_0xcc11('0x33')],{'$or':_['map'](_0x710229[_0xcc11('0x2e')],function(_0x1747c3){var _0x135a49={};_0x135a49[_0x1747c3]={'$like':'%'+_0x20bfea[_0xcc11('0x2b')][_0xcc11('0x34')]+'%'};return _0x135a49;})});}_0x710229=_[_0xcc11('0x37')]({},_0x710229,_0x20bfea[_0xcc11('0x49')]);return _0x3d1a88[_0xcc11('0x4c')](_0x710229);}})['then'](function(_0x218edc){if(_0x218edc){_0x1a6fd4=_0x218edc[_0xcc11('0x41')];if(!_0x20bfea[_0xcc11('0x2b')][_0xcc11('0x30')](_0xcc11('0x4a'))){_0x710229[_0xcc11('0x1b')]=qs['limit'](_0x20bfea['query'][_0xcc11('0x1b')]);_0x710229['offset']=qs[_0xcc11('0x1a')](_0x20bfea[_0xcc11('0x2b')]['offset']);}return _0x3d1a88[_0xcc11('0x4c')](_0x710229);}})[_0xcc11('0x21')](function(_0x34c70a){if(_0x34c70a){return _0x34c70a?{'count':_0x1a6fd4,'rows':_0x34c70a}:null;}})['then'](respondWithResult(_0x5eb69b,null))[_0xcc11('0x3c')](handleError(_0x5eb69b,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 27c4a1e..8869d0a 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 _0x8888=['moment','bluebird','path','rimraf','./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0x3e0ab2,_0x4ce059){var _0x499560=function(_0x4bd526){while(--_0x4bd526){_0x3e0ab2['push'](_0x3e0ab2['shift']());}};_0x499560(++_0x4ce059);}(_0x8888,0x172));var _0x8888=function(_0x4ba8eb,_0x5ad178){_0x4ba8eb=_0x4ba8eb-0x0;var _0x2972ef=_0x8888[_0x4ba8eb];return _0x2972ef;};'use strict';var _=require(_0x8888('0x0'));var util=require(_0x8888('0x1'));var logger=require(_0x8888('0x2'))(_0x8888('0x3'));var moment=require(_0x8888('0x4'));var BPromise=require(_0x8888('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8888('0x6'));var rimraf=require(_0x8888('0x7'));var config=require('../../config/environment');var attributes=require(_0x8888('0x8'));module['exports']=function(_0x25101d,_0x3c500f){return _0x25101d['define'](_0x8888('0x9'),attributes,{'tableName':_0x8888('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x334d=['./intZohoConfiguration.attributes','define','ZohoConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x47d3bd,_0x3cadba){var _0xefba50=function(_0x15565c){while(--_0x15565c){_0x47d3bd['push'](_0x47d3bd['shift']());}};_0xefba50(++_0x3cadba);}(_0x334d,0x12e));var _0xd334=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x334d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd334('0x0'));var util=require(_0xd334('0x1'));var logger=require(_0xd334('0x2'))(_0xd334('0x3'));var moment=require(_0xd334('0x4'));var BPromise=require(_0xd334('0x5'));var rp=require(_0xd334('0x6'));var fs=require('fs');var path=require(_0xd334('0x7'));var rimraf=require(_0xd334('0x8'));var config=require(_0xd334('0x9'));var attributes=require(_0xd334('0xa'));module['exports']=function(_0x7ba16f,_0x2a941d){return _0x7ba16f[_0xd334('0xb')](_0xd334('0xc'),attributes,{'tableName':'int_zoho_configurations','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 a8624cd..134e16a 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 _0xc2fd=['lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result'];(function(_0x67e894,_0x2d96bd){var _0xe86c76=function(_0x1280e2){while(--_0x1280e2){_0x67e894['push'](_0x67e894['shift']());}};_0xe86c76(++_0x2d96bd);}(_0xc2fd,0x1b8));var _0xdc2f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc2fd[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xdc2f('0x0'));var util=require(_0xdc2f('0x1'));var moment=require(_0xdc2f('0x2'));var BPromise=require(_0xdc2f('0x3'));var rs=require(_0xdc2f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdc2f('0x5'))('rpc');var config=require(_0xdc2f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdc2f('0x7')][_0xdc2f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x109255,_0x78c7a8,_0x21454d){return new BPromise(function(_0x10de7a,_0x46a7d9){return client[_0xdc2f('0x9')](_0x109255,_0x21454d)[_0xdc2f('0xa')](function(_0x44e2b4){logger[_0xdc2f('0xb')](_0xdc2f('0xc'),_0x78c7a8,_0xdc2f('0xd'));logger[_0xdc2f('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x78c7a8,_0xdc2f('0xd'),JSON[_0xdc2f('0xf')](_0x44e2b4));if(_0x44e2b4['error']){if(_0x44e2b4['error'][_0xdc2f('0x10')]===0x1f4){logger[_0xdc2f('0x11')](_0xdc2f('0xc'),_0x78c7a8,_0x44e2b4['error'][_0xdc2f('0x12')]);return _0x46a7d9(_0x44e2b4[_0xdc2f('0x11')][_0xdc2f('0x12')]);}logger[_0xdc2f('0x11')](_0xdc2f('0xc'),_0x78c7a8,_0x44e2b4['error'][_0xdc2f('0x12')]);return _0x10de7a(_0x44e2b4['error'][_0xdc2f('0x12')]);}else{logger[_0xdc2f('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x78c7a8,'request\x20sent');_0x10de7a(_0x44e2b4[_0xdc2f('0x13')]['message']);}})['catch'](function(_0x3f8383){logger[_0xdc2f('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x78c7a8,_0x3f8383);_0x46a7d9(_0x3f8383);});});} \ No newline at end of file +var _0x6a76=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x35ee30,_0x54da97){var _0x2bda98=function(_0x5ed1a1){while(--_0x5ed1a1){_0x35ee30['push'](_0x35ee30['shift']());}};_0x2bda98(++_0x54da97);}(_0x6a76,0x1a6));var _0x66a7=function(_0x3068c8,_0x1f5504){_0x3068c8=_0x3068c8-0x0;var _0x40c6e4=_0x6a76[_0x3068c8];return _0x40c6e4;};'use strict';var _=require(_0x66a7('0x0'));var util=require(_0x66a7('0x1'));var moment=require(_0x66a7('0x2'));var BPromise=require(_0x66a7('0x3'));var rs=require(_0x66a7('0x4'));var fs=require('fs');var Redis=require(_0x66a7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x66a7('0x6'));var logger=require('../../config/logger')(_0x66a7('0x7'));var config=require(_0x66a7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x66a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14ed70,_0x4c1ee2,_0x291773){return new BPromise(function(_0xb9f3bf,_0x23979b){return client[_0x66a7('0xa')](_0x14ed70,_0x291773)[_0x66a7('0xb')](function(_0x5a8dc8){logger[_0x66a7('0xc')](_0x66a7('0xd'),_0x4c1ee2,_0x66a7('0xe'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x4c1ee2,_0x66a7('0xe'),JSON[_0x66a7('0xf')](_0x5a8dc8));if(_0x5a8dc8['error']){if(_0x5a8dc8[_0x66a7('0x10')][_0x66a7('0x11')]===0x1f4){logger[_0x66a7('0x10')](_0x66a7('0xd'),_0x4c1ee2,_0x5a8dc8[_0x66a7('0x10')][_0x66a7('0x12')]);return _0x23979b(_0x5a8dc8[_0x66a7('0x10')]['message']);}logger[_0x66a7('0x10')](_0x66a7('0xd'),_0x4c1ee2,_0x5a8dc8[_0x66a7('0x10')][_0x66a7('0x12')]);return _0xb9f3bf(_0x5a8dc8[_0x66a7('0x10')]['message']);}else{logger[_0x66a7('0xc')](_0x66a7('0xd'),_0x4c1ee2,_0x66a7('0xe'));_0xb9f3bf(_0x5a8dc8['result'][_0x66a7('0x12')]);}})[_0x66a7('0x13')](function(_0x56f064){logger[_0x66a7('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x4c1ee2,_0x56f064);_0x23979b(_0x56f064);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 742f487..d68c239 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 _0x72d8=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','isAuthenticated','index','get','/:id','post','create','put','delete','destroy','exports'];(function(_0x20092a,_0x2297cf){var _0x1f66e2=function(_0x57c370){while(--_0x57c370){_0x20092a['push'](_0x20092a['shift']());}};_0x1f66e2(++_0x2297cf);}(_0x72d8,0x8c));var _0x872d=function(_0x317d61,_0x5e6335){_0x317d61=_0x317d61-0x0;var _0x3abc20=_0x72d8[_0x317d61];return _0x3abc20;};'use strict';var multer=require(_0x872d('0x0'));var util=require(_0x872d('0x1'));var path=require(_0x872d('0x2'));var timeout=require(_0x872d('0x3'));var express=require(_0x872d('0x4'));var router=express[_0x872d('0x5')]();var fs_extra=require(_0x872d('0x6'));var auth=require(_0x872d('0x7'));var interaction=require(_0x872d('0x8'));var config=require('../../config/environment');var controller=require(_0x872d('0x9'));router['get']('/',auth[_0x872d('0xa')](),controller[_0x872d('0xb')]);router[_0x872d('0xc')](_0x872d('0xd'),auth[_0x872d('0xa')](),controller['show']);router[_0x872d('0xe')]('/',auth[_0x872d('0xa')](),controller[_0x872d('0xf')]);router[_0x872d('0x10')]('/:id',auth[_0x872d('0xa')](),controller['update']);router[_0x872d('0x11')](_0x872d('0xd'),auth[_0x872d('0xa')](),controller[_0x872d('0x12')]);module[_0x872d('0x13')]=router; \ No newline at end of file +var _0x031d=['../../components/auth/service','../../config/environment','./intZohoField.controller','get','index','/:id','show','post','isAuthenticated','put','update','destroy','multer','util','connect-timeout','Router'];(function(_0x2e9f03,_0x1b42d4){var _0x5d62a2=function(_0x36e299){while(--_0x36e299){_0x2e9f03['push'](_0x2e9f03['shift']());}};_0x5d62a2(++_0x1b42d4);}(_0x031d,0x11c));var _0xd031=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x031d[_0x479160];return _0x47ac6d;};'use strict';var multer=require(_0xd031('0x0'));var util=require(_0xd031('0x1'));var path=require('path');var timeout=require(_0xd031('0x2'));var express=require('express');var router=express[_0xd031('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd031('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd031('0x5'));var controller=require(_0xd031('0x6'));router[_0xd031('0x7')]('/',auth['isAuthenticated'](),controller[_0xd031('0x8')]);router[_0xd031('0x7')](_0xd031('0x9'),auth['isAuthenticated'](),controller[_0xd031('0xa')]);router[_0xd031('0xb')]('/',auth[_0xd031('0xc')](),controller['create']);router[_0xd031('0xd')]('/:id',auth[_0xd031('0xc')](),controller[_0xd031('0xe')]);router['delete'](_0xd031('0x9'),auth['isAuthenticated'](),controller[_0xd031('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index ac12ac3..a52381d 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 _0x083c=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','customVariable','STRING'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x083c,0x1b1));var _0xc083=function(_0x53aecd,_0x3d159f){_0x53aecd=_0x53aecd-0x0;var _0x13992c=_0x083c[_0x53aecd];return _0x13992c;};'use strict';var Sequelize=require(_0xc083('0x0'));module[_0xc083('0x1')]={'type':{'type':Sequelize[_0xc083('0x2')](_0xc083('0x3'),_0xc083('0x4'),'customVariable',_0xc083('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc083('0x2')]('string','variable',_0xc083('0x6'))},'keyContent':{'type':Sequelize[_0xc083('0x7')]},'idField':{'type':Sequelize[_0xc083('0x7')]},'nameField':{'type':Sequelize[_0xc083('0x7')]},'customField':{'type':Sequelize[_0xc083('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc083('0x7')]}}; \ No newline at end of file +var _0xc4e3=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x48f5e7,_0x58962d){var _0x57406b=function(_0x2f260c){while(--_0x2f260c){_0x48f5e7['push'](_0x48f5e7['shift']());}};_0x57406b(++_0x58962d);}(_0xc4e3,0x186));var _0x3c4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4e3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3c4e('0x0'));module[_0x3c4e('0x1')]={'type':{'type':Sequelize[_0x3c4e('0x2')](_0x3c4e('0x3'),_0x3c4e('0x4'),_0x3c4e('0x5'),_0x3c4e('0x6'),_0x3c4e('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3c4e('0x8')]},'key':{'type':Sequelize[_0x3c4e('0x8')]},'keyType':{'type':Sequelize[_0x3c4e('0x2')]('string',_0x3c4e('0x4'),_0x3c4e('0x5'))},'keyContent':{'type':Sequelize[_0x3c4e('0x8')]},'idField':{'type':Sequelize[_0x3c4e('0x8')]},'nameField':{'type':Sequelize[_0x3c4e('0x8')]},'customField':{'type':Sequelize[_0x3c4e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3c4e('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 3426ae5..edf76a1 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 _0x18af=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','then','destroy','stack','send','index','map','ZohoField','rawAttributes','fieldName','type','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring'];(function(_0xa5e21,_0x503f03){var _0x8d9634=function(_0x3ce2b4){while(--_0x3ce2b4){_0xa5e21['push'](_0xa5e21['shift']());}};_0x8d9634(++_0x503f03);}(_0x18af,0x19d));var _0xf18a=function(_0x45c963,_0x502d3d){_0x45c963=_0x45c963-0x0;var _0x35041f=_0x18af[_0x45c963];return _0x35041f;};'use strict';var emlformat=require(_0xf18a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf18a('0x1'));var jsonpatch=require(_0xf18a('0x2'));var rp=require(_0xf18a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf18a('0x4'));var util=require(_0xf18a('0x5'));var path=require(_0xf18a('0x6'));var sox=require('sox');var csv=require(_0xf18a('0x7'));var ejs=require(_0xf18a('0x8'));var fs=require('fs');var fs_extra=require(_0xf18a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf18a('0xa'));var jsforce=require(_0xf18a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf18a('0x7'));var querystring=require(_0xf18a('0xc'));var Papa=require(_0xf18a('0xd'));var Redis=require(_0xf18a('0xe'));var authService=require(_0xf18a('0xf'));var qs=require(_0xf18a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf18a('0x11'));var logger=require(_0xf18a('0x12'))(_0xf18a('0x13'));var utils=require(_0xf18a('0x14'));var config=require(_0xf18a('0x15'));var licenseUtil=require(_0xf18a('0x16'));var db=require(_0xf18a('0x17'))['db'];function respondWithStatusCode(_0x1c6df5,_0x2b4853){_0x2b4853=_0x2b4853||0xcc;return function(_0x5592f7){if(_0x5592f7){return _0x1c6df5[_0xf18a('0x18')](_0x2b4853);}return _0x1c6df5[_0xf18a('0x19')](_0x2b4853)[_0xf18a('0x1a')]();};}function respondWithResult(_0x3e2540,_0x188d85){_0x188d85=_0x188d85||0xc8;return function(_0x4aab0c){if(_0x4aab0c){return _0x3e2540['status'](_0x188d85)[_0xf18a('0x1b')](_0x4aab0c);}};}function respondWithFilteredResult(_0x47d424,_0x34c4d8){return function(_0x5b7b33){if(_0x5b7b33){var _0x2f67c0=typeof _0x34c4d8[_0xf18a('0x1c')]===_0xf18a('0x1d')&&typeof _0x34c4d8['limit']===_0xf18a('0x1d');var _0x49c0c9=_0x5b7b33[_0xf18a('0x1e')];var _0x3bda93=_0x2f67c0?0x0:_0x34c4d8[_0xf18a('0x1c')];var _0x40b52f=_0x2f67c0?_0x5b7b33[_0xf18a('0x1e')]:_0x34c4d8[_0xf18a('0x1c')]+_0x34c4d8[_0xf18a('0x1f')];var _0x3b32e9;if(_0x40b52f>=_0x49c0c9){_0x40b52f=_0x49c0c9;_0x3b32e9=0xc8;}else{_0x3b32e9=0xce;}_0x47d424[_0xf18a('0x19')](_0x3b32e9);return _0x47d424[_0xf18a('0x20')]('Content-Range',_0x3bda93+'-'+_0x40b52f+'/'+_0x49c0c9)[_0xf18a('0x1b')](_0x5b7b33);}return null;};}function patchUpdates(_0x1052d){return function(_0x396ea7){try{jsonpatch[_0xf18a('0x21')](_0x396ea7,_0x1052d,!![]);}catch(_0x2a8ed0){return BPromise['reject'](_0x2a8ed0);}return _0x396ea7['save']();};}function saveUpdates(_0x3dceda,_0x4e868d){return function(_0x4da8cc){if(_0x4da8cc){return _0x4da8cc[_0xf18a('0x22')](_0x3dceda)[_0xf18a('0x23')](function(_0x34ea8f){return _0x34ea8f;});}return null;};}function removeEntity(_0x44438c,_0x265256){return function(_0x3260cd){if(_0x3260cd){return _0x3260cd[_0xf18a('0x24')]()[_0xf18a('0x23')](function(){_0x44438c[_0xf18a('0x19')](0xcc)[_0xf18a('0x1a')]();});}};}function handleEntityNotFound(_0x3352ca,_0x4507b0){return function(_0x573993){if(!_0x573993){_0x3352ca[_0xf18a('0x18')](0x194);}return _0x573993;};}function handleError(_0x4895a6,_0x189e79){_0x189e79=_0x189e79||0x1f4;return function(_0x2be086){logger['error'](_0x2be086[_0xf18a('0x25')]);if(_0x2be086['name']){delete _0x2be086['name'];}_0x4895a6[_0xf18a('0x19')](_0x189e79)[_0xf18a('0x26')](_0x2be086);};}exports[_0xf18a('0x27')]=function(_0x2ba7cf,_0x27e1f2){var _0x2bd09c={},_0x4c06e1={},_0x5284a4={'count':0x0,'rows':[]};var _0x12db0a=_[_0xf18a('0x28')](db[_0xf18a('0x29')][_0xf18a('0x2a')],function(_0x48370d){return{'name':_0x48370d[_0xf18a('0x2b')],'type':_0x48370d[_0xf18a('0x2c')]['key']};});_0x4c06e1['model']=_['map'](_0x12db0a,_0xf18a('0x2d'));_0x4c06e1[_0xf18a('0x2e')]=_['keys'](_0x2ba7cf[_0xf18a('0x2e')]);_0x4c06e1[_0xf18a('0x2f')]=_[_0xf18a('0x30')](_0x4c06e1[_0xf18a('0x31')],_0x4c06e1['query']);_0x2bd09c[_0xf18a('0x32')]=_[_0xf18a('0x30')](_0x4c06e1['model'],qs[_0xf18a('0x33')](_0x2ba7cf[_0xf18a('0x2e')][_0xf18a('0x33')]));_0x2bd09c[_0xf18a('0x32')]=_0x2bd09c[_0xf18a('0x32')][_0xf18a('0x34')]?_0x2bd09c[_0xf18a('0x32')]:_0x4c06e1[_0xf18a('0x31')];if(!_0x2ba7cf[_0xf18a('0x2e')][_0xf18a('0x35')](_0xf18a('0x36'))){_0x2bd09c[_0xf18a('0x1f')]=qs[_0xf18a('0x1f')](_0x2ba7cf['query'][_0xf18a('0x1f')]);_0x2bd09c[_0xf18a('0x1c')]=qs[_0xf18a('0x1c')](_0x2ba7cf[_0xf18a('0x2e')][_0xf18a('0x1c')]);}_0x2bd09c[_0xf18a('0x37')]=qs[_0xf18a('0x38')](_0x2ba7cf[_0xf18a('0x2e')]['sort']);_0x2bd09c['where']=qs[_0xf18a('0x2f')](_[_0xf18a('0x39')](_0x2ba7cf[_0xf18a('0x2e')],_0x4c06e1[_0xf18a('0x2f')]),_0x12db0a);if(_0x2ba7cf['query'][_0xf18a('0x3a')]){_0x2bd09c['where']=_['merge'](_0x2bd09c['where'],{'$or':_[_0xf18a('0x28')](_0x12db0a,function(_0x5ed289){if(_0x5ed289[_0xf18a('0x2c')]!==_0xf18a('0x3b')){var _0x2d8600={};_0x2d8600[_0x5ed289[_0xf18a('0x2d')]]={'$like':'%'+_0x2ba7cf[_0xf18a('0x2e')][_0xf18a('0x3a')]+'%'};return _0x2d8600;}})});}_0x2bd09c=_[_0xf18a('0x3c')]({},_0x2bd09c,_0x2ba7cf[_0xf18a('0x3d')]);var _0x1f8d4b={'where':_0x2bd09c['where']};return db[_0xf18a('0x29')][_0xf18a('0x1e')](_0x1f8d4b)['then'](function(_0x3f48ef){_0x5284a4['count']=_0x3f48ef;if(_0x2ba7cf[_0xf18a('0x2e')][_0xf18a('0x3e')]){_0x2bd09c[_0xf18a('0x3f')]=[{'all':!![]}];}return db[_0xf18a('0x29')][_0xf18a('0x40')](_0x2bd09c);})[_0xf18a('0x23')](function(_0x206630){_0x5284a4['rows']=_0x206630;return _0x5284a4;})[_0xf18a('0x23')](respondWithFilteredResult(_0x27e1f2,_0x2bd09c))[_0xf18a('0x41')](handleError(_0x27e1f2,null));};exports['show']=function(_0x70d1e2,_0x547f01){var _0x5a1aa0={'raw':!![],'where':{'id':_0x70d1e2[_0xf18a('0x42')]['id']}},_0x1087d9={};_0x1087d9[_0xf18a('0x31')]=_['keys'](db[_0xf18a('0x29')][_0xf18a('0x2a')]);_0x1087d9[_0xf18a('0x2e')]=_[_0xf18a('0x43')](_0x70d1e2[_0xf18a('0x2e')]);_0x1087d9[_0xf18a('0x2f')]=_[_0xf18a('0x30')](_0x1087d9[_0xf18a('0x31')],_0x1087d9[_0xf18a('0x2e')]);_0x5a1aa0[_0xf18a('0x32')]=_[_0xf18a('0x30')](_0x1087d9[_0xf18a('0x31')],qs[_0xf18a('0x33')](_0x70d1e2['query'][_0xf18a('0x33')]));_0x5a1aa0[_0xf18a('0x32')]=_0x5a1aa0['attributes'][_0xf18a('0x34')]?_0x5a1aa0[_0xf18a('0x32')]:_0x1087d9[_0xf18a('0x31')];if(_0x70d1e2['query']['includeAll']){_0x5a1aa0[_0xf18a('0x3f')]=[{'all':!![]}];}_0x5a1aa0=_[_0xf18a('0x3c')]({},_0x5a1aa0,_0x70d1e2[_0xf18a('0x3d')]);return db[_0xf18a('0x29')][_0xf18a('0x44')](_0x5a1aa0)[_0xf18a('0x23')](handleEntityNotFound(_0x547f01,null))[_0xf18a('0x23')](respondWithResult(_0x547f01,null))['catch'](handleError(_0x547f01,null));};exports['create']=function(_0x574e82,_0x381abb){return db[_0xf18a('0x29')][_0xf18a('0x45')](_0x574e82[_0xf18a('0x46')],{})['then'](respondWithResult(_0x381abb,0xc9))['catch'](handleError(_0x381abb,null));};exports[_0xf18a('0x22')]=function(_0x53b8d3,_0x5b5ad8){if(_0x53b8d3['body']['id']){delete _0x53b8d3[_0xf18a('0x46')]['id'];}return db[_0xf18a('0x29')]['find']({'where':{'id':_0x53b8d3[_0xf18a('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b5ad8,null))[_0xf18a('0x23')](saveUpdates(_0x53b8d3['body'],null))['then'](respondWithResult(_0x5b5ad8,null))['catch'](handleError(_0x5b5ad8,null));};exports[_0xf18a('0x24')]=function(_0x1229f6,_0x498a6e){return db[_0xf18a('0x29')][_0xf18a('0x44')]({'where':{'id':_0x1229f6['params']['id']}})[_0xf18a('0x23')](handleEntityNotFound(_0x498a6e,null))['then'](removeEntity(_0x498a6e,null))[_0xf18a('0x41')](handleError(_0x498a6e,null));}; \ No newline at end of file +var _0x9d01=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','save','then','destroy','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x11b232,_0x243189){var _0x5f5866=function(_0x2d8541){while(--_0x2d8541){_0x11b232['push'](_0x11b232['shift']());}};_0x5f5866(++_0x243189);}(_0x9d01,0x1ec));var _0x19d0=function(_0x305551,_0x868339){_0x305551=_0x305551-0x0;var _0x115ce2=_0x9d01[_0x305551];return _0x115ce2;};'use strict';var emlformat=require(_0x19d0('0x0'));var rimraf=require(_0x19d0('0x1'));var zipdir=require(_0x19d0('0x2'));var jsonpatch=require(_0x19d0('0x3'));var rp=require(_0x19d0('0x4'));var moment=require(_0x19d0('0x5'));var BPromise=require(_0x19d0('0x6'));var Mustache=require(_0x19d0('0x7'));var util=require('util');var path=require(_0x19d0('0x8'));var sox=require('sox');var csv=require(_0x19d0('0x9'));var ejs=require(_0x19d0('0xa'));var fs=require('fs');var fs_extra=require(_0x19d0('0xb'));var _=require('lodash');var squel=require(_0x19d0('0xc'));var crypto=require(_0x19d0('0xd'));var jsforce=require(_0x19d0('0xe'));var deskjs=require(_0x19d0('0xf'));var toCsv=require(_0x19d0('0x9'));var querystring=require(_0x19d0('0x10'));var Papa=require(_0x19d0('0x11'));var Redis=require(_0x19d0('0x12'));var authService=require(_0x19d0('0x13'));var qs=require(_0x19d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x19d0('0x15'))(_0x19d0('0x16'));var utils=require(_0x19d0('0x17'));var config=require(_0x19d0('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x235544,_0x4f92ea){_0x4f92ea=_0x4f92ea||0xcc;return function(_0x133764){if(_0x133764){return _0x235544[_0x19d0('0x19')](_0x4f92ea);}return _0x235544[_0x19d0('0x1a')](_0x4f92ea)['end']();};}function respondWithResult(_0x142063,_0x102cba){_0x102cba=_0x102cba||0xc8;return function(_0x23d608){if(_0x23d608){return _0x142063['status'](_0x102cba)[_0x19d0('0x1b')](_0x23d608);}};}function respondWithFilteredResult(_0x2bd961,_0xf4f375){return function(_0x3afaf9){if(_0x3afaf9){var _0x2b3fc5=typeof _0xf4f375['offset']==='undefined'&&typeof _0xf4f375[_0x19d0('0x1c')]===_0x19d0('0x1d');var _0x30458c=_0x3afaf9[_0x19d0('0x1e')];var _0x1f8c4b=_0x2b3fc5?0x0:_0xf4f375[_0x19d0('0x1f')];var _0x5f232d=_0x2b3fc5?_0x3afaf9[_0x19d0('0x1e')]:_0xf4f375[_0x19d0('0x1f')]+_0xf4f375['limit'];var _0x2fce80;if(_0x5f232d>=_0x30458c){_0x5f232d=_0x30458c;_0x2fce80=0xc8;}else{_0x2fce80=0xce;}_0x2bd961['status'](_0x2fce80);return _0x2bd961['set'](_0x19d0('0x20'),_0x1f8c4b+'-'+_0x5f232d+'/'+_0x30458c)[_0x19d0('0x1b')](_0x3afaf9);}return null;};}function patchUpdates(_0x138d86){return function(_0x50da4a){try{jsonpatch[_0x19d0('0x21')](_0x50da4a,_0x138d86,!![]);}catch(_0x3cd2e7){return BPromise['reject'](_0x3cd2e7);}return _0x50da4a[_0x19d0('0x22')]();};}function saveUpdates(_0x18ed8b,_0x2d4b9c){return function(_0x2bad70){if(_0x2bad70){return _0x2bad70['update'](_0x18ed8b)[_0x19d0('0x23')](function(_0x2061d5){return _0x2061d5;});}return null;};}function removeEntity(_0x8c7e04,_0x195383){return function(_0x54ee0c){if(_0x54ee0c){return _0x54ee0c[_0x19d0('0x24')]()[_0x19d0('0x23')](function(){_0x8c7e04['status'](0xcc)[_0x19d0('0x25')]();});}};}function handleEntityNotFound(_0x4e34d7,_0x1cf5df){return function(_0x21fe03){if(!_0x21fe03){_0x4e34d7['sendStatus'](0x194);}return _0x21fe03;};}function handleError(_0x7f14e4,_0xde2bc2){_0xde2bc2=_0xde2bc2||0x1f4;return function(_0x54dbd5){logger[_0x19d0('0x26')](_0x54dbd5['stack']);if(_0x54dbd5['name']){delete _0x54dbd5[_0x19d0('0x27')];}_0x7f14e4[_0x19d0('0x1a')](_0xde2bc2)[_0x19d0('0x28')](_0x54dbd5);};}exports[_0x19d0('0x29')]=function(_0x116fd2,_0x49e4bf){var _0x5ca234={},_0x5c9090={},_0x4eab77={'count':0x0,'rows':[]};var _0x488436=_[_0x19d0('0x2a')](db[_0x19d0('0x2b')][_0x19d0('0x2c')],function(_0x436635){return{'name':_0x436635[_0x19d0('0x2d')],'type':_0x436635['type'][_0x19d0('0x2e')]};});_0x5c9090[_0x19d0('0x2f')]=_['map'](_0x488436,_0x19d0('0x27'));_0x5c9090['query']=_[_0x19d0('0x30')](_0x116fd2[_0x19d0('0x31')]);_0x5c9090[_0x19d0('0x32')]=_['intersection'](_0x5c9090[_0x19d0('0x2f')],_0x5c9090[_0x19d0('0x31')]);_0x5ca234['attributes']=_[_0x19d0('0x33')](_0x5c9090[_0x19d0('0x2f')],qs[_0x19d0('0x34')](_0x116fd2['query']['fields']));_0x5ca234[_0x19d0('0x35')]=_0x5ca234[_0x19d0('0x35')][_0x19d0('0x36')]?_0x5ca234['attributes']:_0x5c9090['model'];if(!_0x116fd2['query'][_0x19d0('0x37')](_0x19d0('0x38'))){_0x5ca234[_0x19d0('0x1c')]=qs[_0x19d0('0x1c')](_0x116fd2['query'][_0x19d0('0x1c')]);_0x5ca234[_0x19d0('0x1f')]=qs[_0x19d0('0x1f')](_0x116fd2[_0x19d0('0x31')][_0x19d0('0x1f')]);}_0x5ca234[_0x19d0('0x39')]=qs['sort'](_0x116fd2[_0x19d0('0x31')][_0x19d0('0x3a')]);_0x5ca234[_0x19d0('0x3b')]=qs[_0x19d0('0x32')](_[_0x19d0('0x3c')](_0x116fd2[_0x19d0('0x31')],_0x5c9090[_0x19d0('0x32')]),_0x488436);if(_0x116fd2['query']['filter']){_0x5ca234[_0x19d0('0x3b')]=_['merge'](_0x5ca234[_0x19d0('0x3b')],{'$or':_[_0x19d0('0x2a')](_0x488436,function(_0x48425a){if(_0x48425a['type']!==_0x19d0('0x3d')){var _0x156821={};_0x156821[_0x48425a[_0x19d0('0x27')]]={'$like':'%'+_0x116fd2[_0x19d0('0x31')][_0x19d0('0x3e')]+'%'};return _0x156821;}})});}_0x5ca234=_[_0x19d0('0x3f')]({},_0x5ca234,_0x116fd2[_0x19d0('0x40')]);var _0x3f2686={'where':_0x5ca234[_0x19d0('0x3b')]};return db[_0x19d0('0x2b')][_0x19d0('0x1e')](_0x3f2686)[_0x19d0('0x23')](function(_0x2bb4ee){_0x4eab77[_0x19d0('0x1e')]=_0x2bb4ee;if(_0x116fd2['query'][_0x19d0('0x41')]){_0x5ca234['include']=[{'all':!![]}];}return db[_0x19d0('0x2b')][_0x19d0('0x42')](_0x5ca234);})[_0x19d0('0x23')](function(_0x303abc){_0x4eab77[_0x19d0('0x43')]=_0x303abc;return _0x4eab77;})['then'](respondWithFilteredResult(_0x49e4bf,_0x5ca234))[_0x19d0('0x44')](handleError(_0x49e4bf,null));};exports[_0x19d0('0x45')]=function(_0x2c0ad2,_0x5506cb){var _0xd71d6={'raw':!![],'where':{'id':_0x2c0ad2['params']['id']}},_0x2d19fb={};_0x2d19fb[_0x19d0('0x2f')]=_[_0x19d0('0x30')](db['ZohoField'][_0x19d0('0x2c')]);_0x2d19fb[_0x19d0('0x31')]=_[_0x19d0('0x30')](_0x2c0ad2[_0x19d0('0x31')]);_0x2d19fb['filters']=_[_0x19d0('0x33')](_0x2d19fb['model'],_0x2d19fb[_0x19d0('0x31')]);_0xd71d6[_0x19d0('0x35')]=_[_0x19d0('0x33')](_0x2d19fb[_0x19d0('0x2f')],qs[_0x19d0('0x34')](_0x2c0ad2[_0x19d0('0x31')]['fields']));_0xd71d6['attributes']=_0xd71d6[_0x19d0('0x35')]['length']?_0xd71d6['attributes']:_0x2d19fb['model'];if(_0x2c0ad2['query'][_0x19d0('0x41')]){_0xd71d6['include']=[{'all':!![]}];}_0xd71d6=_[_0x19d0('0x3f')]({},_0xd71d6,_0x2c0ad2[_0x19d0('0x40')]);return db[_0x19d0('0x2b')]['find'](_0xd71d6)['then'](handleEntityNotFound(_0x5506cb,null))[_0x19d0('0x23')](respondWithResult(_0x5506cb,null))['catch'](handleError(_0x5506cb,null));};exports['create']=function(_0x317843,_0x4f026f){return db[_0x19d0('0x2b')][_0x19d0('0x46')](_0x317843[_0x19d0('0x47')],{})[_0x19d0('0x23')](respondWithResult(_0x4f026f,0xc9))['catch'](handleError(_0x4f026f,null));};exports['update']=function(_0x2ee2ac,_0x2e903c){if(_0x2ee2ac[_0x19d0('0x47')]['id']){delete _0x2ee2ac[_0x19d0('0x47')]['id'];}return db[_0x19d0('0x2b')][_0x19d0('0x48')]({'where':{'id':_0x2ee2ac['params']['id']}})[_0x19d0('0x23')](handleEntityNotFound(_0x2e903c,null))[_0x19d0('0x23')](saveUpdates(_0x2ee2ac[_0x19d0('0x47')],null))[_0x19d0('0x23')](respondWithResult(_0x2e903c,null))['catch'](handleError(_0x2e903c,null));};exports['destroy']=function(_0x3fb9cb,_0x2df82c){return db['ZohoField'][_0x19d0('0x48')]({'where':{'id':_0x3fb9cb['params']['id']}})['then'](handleEntityNotFound(_0x2df82c,null))[_0x19d0('0x23')](removeEntity(_0x2df82c,null))[_0x19d0('0x44')](handleError(_0x2df82c,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 9ce8bc7..1aa572d 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 _0x1893=['rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x95975e,_0x51412c){var _0x5d4933=function(_0x1cb2da){while(--_0x1cb2da){_0x95975e['push'](_0x95975e['shift']());}};_0x5d4933(++_0x51412c);}(_0x1893,0xa2));var _0x3189=function(_0x1bda6c,_0x5440b1){_0x1bda6c=_0x1bda6c-0x0;var _0x501a86=_0x1893[_0x1bda6c];return _0x501a86;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3189('0x0'))(_0x3189('0x1'));var moment=require(_0x3189('0x2'));var BPromise=require(_0x3189('0x3'));var rp=require(_0x3189('0x4'));var fs=require('fs');var path=require(_0x3189('0x5'));var rimraf=require(_0x3189('0x6'));var config=require('../../config/environment');var attributes=require(_0x3189('0x7'));module[_0x3189('0x8')]=function(_0x2333e6,_0x4080a9){return _0x2333e6[_0x3189('0x9')](_0x3189('0xa'),attributes,{'tableName':_0x3189('0xb'),'paranoid':![],'indexes':[{'name':_0x3189('0xc'),'fields':['idField',_0x3189('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['bluebird','request-promise','path','exports','define','ZohoField','int_zoho_fields','idField','FieldId','lodash','../../config/logger','moment'];(function(_0x35014d,_0x15f124){var _0x2d827c=function(_0x481f04){while(--_0x481f04){_0x35014d['push'](_0x35014d['shift']());}};_0x2d827c(++_0x15f124);}(_0xafc4,0x69));var _0x4afc=function(_0x1fd442,_0x3251c8){_0x1fd442=_0x1fd442-0x0;var _0x3b4c82=_0xafc4[_0x1fd442];return _0x3b4c82;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x4afc('0xa'),_0x4afc('0xb')],'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 b3660d2..57e8f00 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 _0x9586=['ioredis','rpc','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0xdb4955,_0x145b00){var _0x39daf9=function(_0x183327){while(--_0x183327){_0xdb4955['push'](_0xdb4955['shift']());}};_0x39daf9(++_0x145b00);}(_0x9586,0x19e));var _0x6958=function(_0x1b9922,_0x3bbacb){_0x1b9922=_0x1b9922-0x0;var _0x5df260=_0x9586[_0x1b9922];return _0x5df260;};'use strict';var _=require(_0x6958('0x0'));var util=require('util');var moment=require(_0x6958('0x1'));var BPromise=require(_0x6958('0x2'));var rs=require(_0x6958('0x3'));var fs=require('fs');var Redis=require(_0x6958('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6958('0x5'));var config=require(_0x6958('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6958('0x7')][_0x6958('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35038d,_0x59b024,_0x57ab02){return new BPromise(function(_0x151b03,_0x1000fb){return client[_0x6958('0x9')](_0x35038d,_0x57ab02)[_0x6958('0xa')](function(_0x1208a4){logger[_0x6958('0xb')](_0x6958('0xc'),_0x59b024,_0x6958('0xd'));logger[_0x6958('0xe')](_0x6958('0xf'),_0x59b024,_0x6958('0xd'),JSON[_0x6958('0x10')](_0x1208a4));if(_0x1208a4[_0x6958('0x11')]){if(_0x1208a4[_0x6958('0x11')][_0x6958('0x12')]===0x1f4){logger['error'](_0x6958('0xc'),_0x59b024,_0x1208a4[_0x6958('0x11')][_0x6958('0x13')]);return _0x1000fb(_0x1208a4[_0x6958('0x11')]['message']);}logger[_0x6958('0x11')](_0x6958('0xc'),_0x59b024,_0x1208a4[_0x6958('0x11')]['message']);return _0x151b03(_0x1208a4[_0x6958('0x11')]['message']);}else{logger[_0x6958('0xb')](_0x6958('0xc'),_0x59b024,_0x6958('0xd'));_0x151b03(_0x1208a4[_0x6958('0x14')][_0x6958('0x13')]);}})[_0x6958('0x15')](function(_0x5cfe78){logger[_0x6958('0x11')](_0x6958('0xc'),_0x59b024,_0x5cfe78);_0x1000fb(_0x5cfe78);});});} \ No newline at end of file +var _0xa635=['../../config/logger','../../config/environment','jayson/promise','client','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x8fbe27,_0x2b27a5){var _0x401de7=function(_0x1ee9fa){while(--_0x1ee9fa){_0x8fbe27['push'](_0x8fbe27['shift']());}};_0x401de7(++_0x2b27a5);}(_0xa635,0xcc));var _0x5a63=function(_0x835a38,_0x4cde34){_0x835a38=_0x835a38-0x0;var _0x50e539=_0xa635[_0x835a38];return _0x50e539;};'use strict';var _=require(_0x5a63('0x0'));var util=require('util');var moment=require(_0x5a63('0x1'));var BPromise=require(_0x5a63('0x2'));var rs=require(_0x5a63('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a63('0x4'))['db'];var utils=require(_0x5a63('0x5'));var logger=require(_0x5a63('0x6'))('rpc');var config=require(_0x5a63('0x7'));var jayson=require(_0x5a63('0x8'));var client=jayson[_0x5a63('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc2e0f1,_0x57a462,_0x1ba59a){return new BPromise(function(_0x4afabb,_0x2a59dd){return client['request'](_0xc2e0f1,_0x1ba59a)[_0x5a63('0xa')](function(_0x544190){logger['info'](_0x5a63('0xb'),_0x57a462,_0x5a63('0xc'));logger[_0x5a63('0xd')](_0x5a63('0xe'),_0x57a462,_0x5a63('0xc'),JSON[_0x5a63('0xf')](_0x544190));if(_0x544190[_0x5a63('0x10')]){if(_0x544190[_0x5a63('0x10')][_0x5a63('0x11')]===0x1f4){logger['error'](_0x5a63('0xb'),_0x57a462,_0x544190[_0x5a63('0x10')][_0x5a63('0x12')]);return _0x2a59dd(_0x544190[_0x5a63('0x10')][_0x5a63('0x12')]);}logger[_0x5a63('0x10')](_0x5a63('0xb'),_0x57a462,_0x544190[_0x5a63('0x10')][_0x5a63('0x12')]);return _0x4afabb(_0x544190[_0x5a63('0x10')][_0x5a63('0x12')]);}else{logger['info'](_0x5a63('0xb'),_0x57a462,_0x5a63('0xc'));_0x4afabb(_0x544190[_0x5a63('0x13')]['message']);}})[_0x5a63('0x14')](function(_0xf5823f){logger[_0x5a63('0x10')](_0x5a63('0xb'),_0x57a462,_0xf5823f);_0x2a59dd(_0xf5823f);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 8c73e6d..f448771 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(_0x3bd52b,_0xbbc735){var _0x1e5b89=function(_0x29ccc3){while(--_0x29ccc3){_0x3bd52b['push'](_0x3bd52b['shift']());}};_0x1e5b89(++_0xbbc735);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3d3440,_0x57a606){var _0x4a3828=function(_0x344aa0){while(--_0x344aa0){_0x3d3440['push'](_0x3d3440['shift']());}};_0x4a3828(++_0x57a606);}(_0xe706,0xa3));var _0x6e70=function(_0x37f053,_0x4b2ad0){_0x37f053=_0x37f053-0x0;var _0x78f6a0=_0xe706[_0x37f053];return _0x78f6a0;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 04e9f20..a8bcd4c 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 _0xe53c=['BOOLEAN','state','exports','STRING','unique_name_and_version','app.js'];(function(_0x3430d2,_0x1c1e42){var _0x567e4c=function(_0x492dfc){while(--_0x492dfc){_0x3430d2['push'](_0x3430d2['shift']());}};_0x567e4c(++_0x1c1e42);}(_0xe53c,0x14c));var _0xce53=function(_0x2a6193,_0x2ec097){_0x2a6193=_0x2a6193-0x0;var _0x317a31=_0xe53c[_0x2a6193];return _0x317a31;};'use strict';var Sequelize=require('sequelize');module[_0xce53('0x0')]={'name':{'type':Sequelize[_0xce53('0x1')],'allowNull':![],'unique':_0xce53('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xce53('0x2')},'main':{'type':Sequelize[_0xce53('0x1')],'defaultValue':_0xce53('0x3')},'filename':{'type':Sequelize[_0xce53('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xce53('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xce53('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xce53('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xce53('0x1')],'unique':_0xce53('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xce53('0x1')]},'remoteUri':{'type':Sequelize[_0xce53('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x9386=['INTEGER','state','sequelize','exports','unique_name_and_version','STRING','app.js'];(function(_0x6e68b9,_0x41d225){var _0x18ac2a=function(_0x225a64){while(--_0x225a64){_0x6e68b9['push'](_0x6e68b9['shift']());}};_0x18ac2a(++_0x41d225);}(_0x9386,0x6b));var _0x6938=function(_0x259536,_0x3bfdc9){_0x259536=_0x259536-0x0;var _0x4bb0bf=_0x9386[_0x259536];return _0x4bb0bf;};'use strict';var Sequelize=require(_0x6938('0x0'));module[_0x6938('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6938('0x2')},'version':{'type':Sequelize[_0x6938('0x3')],'allowNull':![],'unique':_0x6938('0x2')},'main':{'type':Sequelize[_0x6938('0x3')],'defaultValue':_0x6938('0x4')},'filename':{'type':Sequelize[_0x6938('0x3')]},'path':{'type':Sequelize[_0x6938('0x3')]},'type':{'type':Sequelize[_0x6938('0x3')]},'size':{'type':Sequelize[_0x6938('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x6938('0x3')]},'logo':{'type':Sequelize[_0x6938('0x3')]},'state':{'type':Sequelize[_0x6938('0x3')],'unique':_0x6938('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x6938('0x3')]},'remoteUri':{'type':Sequelize[_0x6938('0x3')]},'link':{'type':Sequelize[_0x6938('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 4b96fb3..6724a17 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 _0x187d=['body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','create'];(function(_0x362733,_0x46e9fa){var _0x4fccca=function(_0x57289e){while(--_0x57289e){_0x362733['push'](_0x362733['shift']());}};_0x4fccca(++_0x46e9fa);}(_0x187d,0x93));var _0xd187=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x187d[_0x21aec3];return _0x288bbc;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')](_0x3ce4a1[_0xd187('0x48')],{})['then'](respondWithResult(_0x3f5def,0xc9))[_0xd187('0x41')](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x4523c8,_0x1449d7){if(_0x4523c8[_0xd187('0x48')]['id']){delete _0x4523c8['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x4523c8['params']['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x1449d7,null))[_0xd187('0x3f')](saveUpdates(_0x4523c8['body'],null))['then'](respondWithResult(_0x1449d7,null))['catch'](handleError(_0x1449d7,null));};exports['destroy']=function(_0x473bef,_0x22f432){return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x473bef[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x22f432,null))[_0xd187('0x3f')](removeEntity(_0x22f432,null))['catch'](handleError(_0x22f432,null));}; \ No newline at end of file +var _0x90b1=['map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','Integration','includeAll','rows','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index'];(function(_0x289622,_0x2896f3){var _0x2d24ae=function(_0x55167a){while(--_0x55167a){_0x289622['push'](_0x289622['shift']());}};_0x2d24ae(++_0x2896f3);}(_0x90b1,0x1bb));var _0x190b=function(_0x517c97,_0x3fd275){_0x517c97=_0x517c97-0x0;var _0x244ef3=_0x90b1[_0x517c97];return _0x244ef3;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['Integration'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['Integration']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['Integration'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 35ccee3..19add49 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 _0x3455=['../../config/logger','api','moment','request-promise','../../config/environment','./integration.attributes','exports','define','lodash'];(function(_0x4dabb5,_0x45fe81){var _0x11e16f=function(_0x416722){while(--_0x416722){_0x4dabb5['push'](_0x4dabb5['shift']());}};_0x11e16f(++_0x45fe81);}(_0x3455,0x13a));var _0x5345=function(_0x2d31b8,_0x242597){_0x2d31b8=_0x2d31b8-0x0;var _0x547be0=_0x3455[_0x2d31b8];return _0x547be0;};'use strict';var _=require(_0x5345('0x0'));var util=require('util');var logger=require(_0x5345('0x1'))(_0x5345('0x2'));var moment=require(_0x5345('0x3'));var BPromise=require('bluebird');var rp=require(_0x5345('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5345('0x5'));var attributes=require(_0x5345('0x6'));module[_0x5345('0x7')]=function(_0x32c6aa,_0x13be5e){return _0x32c6aa[_0x5345('0x8')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x498e=['api','moment','bluebird','request-promise','path','../../config/environment','./integration.attributes','exports','define','Integration','lodash','../../config/logger'];(function(_0xe54bf9,_0x27a75c){var _0x2d735c=function(_0x72aa42){while(--_0x72aa42){_0xe54bf9['push'](_0xe54bf9['shift']());}};_0x2d735c(++_0x27a75c);}(_0x498e,0x196));var _0xe498=function(_0x4b9e96,_0x58ccd5){_0x4b9e96=_0x4b9e96-0x0;var _0x2b1e49=_0x498e[_0x4b9e96];return _0x2b1e49;};'use strict';var _=require(_0xe498('0x0'));var util=require('util');var logger=require(_0xe498('0x1'))(_0xe498('0x2'));var moment=require(_0xe498('0x3'));var BPromise=require(_0xe498('0x4'));var rp=require(_0xe498('0x5'));var fs=require('fs');var path=require(_0xe498('0x6'));var rimraf=require('rimraf');var config=require(_0xe498('0x7'));var attributes=require(_0xe498('0x8'));module[_0xe498('0x9')]=function(_0x367f31,_0x3e1c57){return _0x367f31[_0xe498('0xa')](_0xe498('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index dba786b..9518c0e 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 _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xc2c7,0x134));var _0x7c2c=function(_0x2e18d2,_0x180dc0){_0x2e18d2=_0x2e18d2-0x0;var _0x253d1a=_0xc2c7[_0x2e18d2];return _0x253d1a;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('Integration,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x589061,_0xa264f7){var _0x437761=function(_0x13d14f){while(--_0x13d14f){_0x589061['push'](_0x589061['shift']());}};_0x437761(++_0xa264f7);}(_0x66fa,0x117));var _0xa66f=function(_0x2d371e,_0x144df2){_0x2d371e=_0x2d371e-0x0;var _0x1fd1aa=_0x66fa[_0x2d371e];return _0x1fd1aa;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('Integration,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('Integration,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index fcea52a..e573006 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 _0x187d=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x502eb0,_0x6d0814){var _0x4f78e4=function(_0x237787){while(--_0x237787){_0x502eb0['push'](_0x502eb0['shift']());}};_0x4f78e4(++_0x6d0814);}(_0x187d,0x93));var _0xd187=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x187d[_0x32d457];return _0x338386;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')]('/',auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x13')]);router[_0xd187('0x14')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0x15')]);module[_0xd187('0x16')]=router; \ No newline at end of file +var _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0295,0x1f0));var _0x5029=function(_0x48baa3,_0x3cebbf){_0x48baa3=_0x48baa3-0x0;var _0x394bba=_0x0295[_0x48baa3];return _0x394bba;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 9461a2c..6086253 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 _0xbafd=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','sequelize','exports','STRING'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xbafd,0xed));var _0xdbaf=function(_0x57c0ab,_0x57dd50){_0x57c0ab=_0x57c0ab-0x0;var _0x145ad5=_0xbafd[_0x57c0ab];return _0x145ad5;};'use strict';var Sequelize=require(_0xdbaf('0x0'));module[_0xdbaf('0x1')]={'integration':{'type':Sequelize[_0xdbaf('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xdbaf('0x2')]},'integrationId':{'type':Sequelize[_0xdbaf('0x3')]},'contacts':{'type':Sequelize[_0xdbaf('0x2')]},'uniqueid':{'type':Sequelize[_0xdbaf('0x2')]},'calleridnum':{'type':Sequelize[_0xdbaf('0x2')]},'calleridname':{'type':Sequelize[_0xdbaf('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xdbaf('0x4')]},'agentconnectAt':{'type':Sequelize[_0xdbaf('0x4')]},'holdtime':{'type':Sequelize[_0xdbaf('0x3')]},'agentcomplete':{'type':Sequelize[_0xdbaf('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xdbaf('0x4')]},'talktime':{'type':Sequelize[_0xdbaf('0x3')]},'agentacw':{'type':Sequelize[_0xdbaf('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xdbaf('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xdbaf('0x4')]},'agentdump':{'type':Sequelize[_0xdbaf('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xdbaf('0x4')]},'lastevent':{'type':Sequelize[_0xdbaf('0x2')]},'channel':{'type':Sequelize[_0xdbaf('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xdbaf('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdbaf('0x2')]},'connectedlinename':{'type':Sequelize[_0xdbaf('0x2')]},'language':{'type':Sequelize[_0xdbaf('0x2')]},'accountcode':{'type':Sequelize[_0xdbaf('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xdbaf('0x2')]},'priority':{'type':Sequelize[_0xdbaf('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdbaf('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xdbaf('0x2')]},'destcalleridnum':{'type':Sequelize[_0xdbaf('0x2')]},'destcalleridname':{'type':Sequelize[_0xdbaf('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdbaf('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xdbaf('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xdbaf('0x2')]},'destcontext':{'type':Sequelize[_0xdbaf('0x2')]},'destexten':{'type':Sequelize[_0xdbaf('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xdbaf('0x2')]},'messageId':{'type':Sequelize[_0xdbaf('0x2')]},'inReplyTo':{'type':Sequelize[_0xdbaf('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xdbaf('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xdbaf('0x6')]},'text':{'type':Sequelize[_0xdbaf('0x6')]},'status':{'type':Sequelize[_0xdbaf('0x7')](_0xdbaf('0x8'),_0xdbaf('0x9'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0xdbaf('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xdbaf('0x3')]}}; \ No newline at end of file +var _0xeec6=['DATE','BOOLEAN','TEXT','ENUM','FAILED','sequelize','STRING','INTEGER'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0xeec6,0x125));var _0x6eec=function(_0x50af9c,_0xf03b1e){_0x50af9c=_0x50af9c-0x0;var _0x5b5e5a=_0xeec6[_0x50af9c];return _0x5b5e5a;};'use strict';var Sequelize=require(_0x6eec('0x0'));module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x6eec('0x1')]},'ticketId':{'type':Sequelize[_0x6eec('0x1')]},'integrationId':{'type':Sequelize[_0x6eec('0x2')]},'contacts':{'type':Sequelize[_0x6eec('0x1')]},'uniqueid':{'type':Sequelize[_0x6eec('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6eec('0x1')]},'queue':{'type':Sequelize[_0x6eec('0x1')]},'interface':{'type':Sequelize[_0x6eec('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x6eec('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x6eec('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x6eec('0x2')]},'agentacw':{'type':Sequelize[_0x6eec('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x6eec('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x6eec('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6eec('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x6eec('0x1')]},'channel':{'type':Sequelize[_0x6eec('0x1')]},'channelstate':{'type':Sequelize[_0x6eec('0x2')]},'channelstatedesc':{'type':Sequelize[_0x6eec('0x1')]},'connectedlinenum':{'type':Sequelize[_0x6eec('0x1')]},'connectedlinename':{'type':Sequelize[_0x6eec('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6eec('0x1')]},'context':{'type':Sequelize[_0x6eec('0x1')]},'exten':{'type':Sequelize[_0x6eec('0x1')]},'priority':{'type':Sequelize[_0x6eec('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x6eec('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x6eec('0x1')]},'destcalleridnum':{'type':Sequelize[_0x6eec('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x6eec('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x6eec('0x1')]},'destlanguage':{'type':Sequelize[_0x6eec('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x6eec('0x1')]},'destexten':{'type':Sequelize[_0x6eec('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x6eec('0x1')]},'messageId':{'type':Sequelize[_0x6eec('0x1')]},'inReplyTo':{'type':Sequelize[_0x6eec('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x6eec('0x1')]},'to':{'type':Sequelize[_0x6eec('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x6eec('0x5')]},'html':{'type':Sequelize[_0x6eec('0x5')]},'text':{'type':Sequelize[_0x6eec('0x5')]},'status':{'type':Sequelize[_0x6eec('0x6')]('SENT','SENDING','RECEIVED',_0x6eec('0x7'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x6eec('0x1')]},'appdata':{'type':Sequelize[_0x6eec('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index e2329f2..b8de4a8 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 _0xf394=['then','destroy','stack','name','send','IntegrationReport','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filters','filter','where','merge','options','includeAll','include','findAll','show','find','catch','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0xf394,0x190));var _0x4f39=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf394[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x4f39('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f39('0x1'));var jsonpatch=require(_0x4f39('0x2'));var rp=require(_0x4f39('0x3'));var moment=require(_0x4f39('0x4'));var BPromise=require(_0x4f39('0x5'));var Mustache=require(_0x4f39('0x6'));var util=require(_0x4f39('0x7'));var path=require(_0x4f39('0x8'));var sox=require('sox');var csv=require(_0x4f39('0x9'));var ejs=require(_0x4f39('0xa'));var fs=require('fs');var fs_extra=require(_0x4f39('0xb'));var _=require(_0x4f39('0xc'));var squel=require(_0x4f39('0xd'));var crypto=require(_0x4f39('0xe'));var jsforce=require(_0x4f39('0xf'));var deskjs=require(_0x4f39('0x10'));var toCsv=require(_0x4f39('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4f39('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4f39('0x12'));var as=require(_0x4f39('0x13'));var hardwareService=require(_0x4f39('0x14'));var logger=require('../../config/logger')(_0x4f39('0x15'));var utils=require(_0x4f39('0x16'));var config=require(_0x4f39('0x17'));var licenseUtil=require(_0x4f39('0x18'));var db=require(_0x4f39('0x19'))['db'];function respondWithStatusCode(_0x575d53,_0x3cc044){_0x3cc044=_0x3cc044||0xcc;return function(_0x4bf16e){if(_0x4bf16e){return _0x575d53[_0x4f39('0x1a')](_0x3cc044);}return _0x575d53[_0x4f39('0x1b')](_0x3cc044)[_0x4f39('0x1c')]();};}function respondWithResult(_0x16a182,_0xd9ff46){_0xd9ff46=_0xd9ff46||0xc8;return function(_0x44e6b6){if(_0x44e6b6){return _0x16a182['status'](_0xd9ff46)[_0x4f39('0x1d')](_0x44e6b6);}};}function respondWithFilteredResult(_0x4cbb6f,_0x43b131){return function(_0x126dcf){if(_0x126dcf){var _0x5ebbc4=typeof _0x43b131[_0x4f39('0x1e')]===_0x4f39('0x1f')&&typeof _0x43b131[_0x4f39('0x20')]==='undefined';var _0x34deb5=_0x126dcf[_0x4f39('0x21')];var _0x30d476=_0x5ebbc4?0x0:_0x43b131[_0x4f39('0x1e')];var _0x2b8362=_0x5ebbc4?_0x126dcf[_0x4f39('0x21')]:_0x43b131['offset']+_0x43b131['limit'];var _0xe49d52;if(_0x2b8362>=_0x34deb5){_0x2b8362=_0x34deb5;_0xe49d52=0xc8;}else{_0xe49d52=0xce;}_0x4cbb6f['status'](_0xe49d52);return _0x4cbb6f[_0x4f39('0x22')](_0x4f39('0x23'),_0x30d476+'-'+_0x2b8362+'/'+_0x34deb5)[_0x4f39('0x1d')](_0x126dcf);}return null;};}function patchUpdates(_0x1a5004){return function(_0x3264bb){try{jsonpatch[_0x4f39('0x24')](_0x3264bb,_0x1a5004,!![]);}catch(_0x259893){return BPromise[_0x4f39('0x25')](_0x259893);}return _0x3264bb['save']();};}function saveUpdates(_0x9643bc,_0xc89d12){return function(_0x57af53){if(_0x57af53){return _0x57af53['update'](_0x9643bc)[_0x4f39('0x26')](function(_0x70c313){return _0x70c313;});}return null;};}function removeEntity(_0x4529e5,_0x3a6cc6){return function(_0x1570c1){if(_0x1570c1){return _0x1570c1[_0x4f39('0x27')]()['then'](function(){_0x4529e5[_0x4f39('0x1b')](0xcc)[_0x4f39('0x1c')]();});}};}function handleEntityNotFound(_0x3bff5b,_0xa5abd5){return function(_0x472b60){if(!_0x472b60){_0x3bff5b['sendStatus'](0x194);}return _0x472b60;};}function handleError(_0x462fec,_0x2ef686){_0x2ef686=_0x2ef686||0x1f4;return function(_0x570236){logger['error'](_0x570236[_0x4f39('0x28')]);if(_0x570236['name']){delete _0x570236[_0x4f39('0x29')];}_0x462fec[_0x4f39('0x1b')](_0x2ef686)[_0x4f39('0x2a')](_0x570236);};}exports['index']=function(_0x1a46c4,_0x4b5ffa){var _0x44e0aa={},_0x32657c={},_0x3808d0={'count':0x0,'rows':[]};var _0x3d3739=_['map'](db[_0x4f39('0x2b')]['rawAttributes'],function(_0x4cc778){return{'name':_0x4cc778['fieldName'],'type':_0x4cc778[_0x4f39('0x2c')][_0x4f39('0x2d')]};});_0x32657c[_0x4f39('0x2e')]=_[_0x4f39('0x2f')](_0x3d3739,'name');_0x32657c[_0x4f39('0x30')]=_[_0x4f39('0x31')](_0x1a46c4['query']);_0x32657c['filters']=_[_0x4f39('0x32')](_0x32657c[_0x4f39('0x2e')],_0x32657c[_0x4f39('0x30')]);_0x44e0aa['attributes']=_[_0x4f39('0x32')](_0x32657c[_0x4f39('0x2e')],qs[_0x4f39('0x33')](_0x1a46c4['query']['fields']));_0x44e0aa[_0x4f39('0x34')]=_0x44e0aa[_0x4f39('0x34')][_0x4f39('0x35')]?_0x44e0aa[_0x4f39('0x34')]:_0x32657c[_0x4f39('0x2e')];if(!_0x1a46c4['query'][_0x4f39('0x36')]('nolimit')){_0x44e0aa[_0x4f39('0x20')]=qs['limit'](_0x1a46c4[_0x4f39('0x30')][_0x4f39('0x20')]);_0x44e0aa[_0x4f39('0x1e')]=qs['offset'](_0x1a46c4['query']['offset']);}_0x44e0aa[_0x4f39('0x37')]=qs[_0x4f39('0x38')](_0x1a46c4[_0x4f39('0x30')][_0x4f39('0x38')]);_0x44e0aa['where']=qs['filters'](_[_0x4f39('0x39')](_0x1a46c4[_0x4f39('0x30')],_0x32657c[_0x4f39('0x3a')]),_0x3d3739);if(_0x1a46c4[_0x4f39('0x30')][_0x4f39('0x3b')]){_0x44e0aa[_0x4f39('0x3c')]=_['merge'](_0x44e0aa[_0x4f39('0x3c')],{'$or':_[_0x4f39('0x2f')](_0x3d3739,function(_0x7281bd){if(_0x7281bd['type']!=='VIRTUAL'){var _0x451b70={};_0x451b70[_0x7281bd[_0x4f39('0x29')]]={'$like':'%'+_0x1a46c4['query'][_0x4f39('0x3b')]+'%'};return _0x451b70;}})});}_0x44e0aa=_[_0x4f39('0x3d')]({},_0x44e0aa,_0x1a46c4[_0x4f39('0x3e')]);var _0x5c0861={'where':_0x44e0aa['where']};return db[_0x4f39('0x2b')]['count'](_0x5c0861)['then'](function(_0x3d5d48){_0x3808d0[_0x4f39('0x21')]=_0x3d5d48;if(_0x1a46c4[_0x4f39('0x30')][_0x4f39('0x3f')]){_0x44e0aa[_0x4f39('0x40')]=[{'all':!![]}];}return db[_0x4f39('0x2b')][_0x4f39('0x41')](_0x44e0aa);})[_0x4f39('0x26')](function(_0x32d4d2){_0x3808d0['rows']=_0x32d4d2;return _0x3808d0;})[_0x4f39('0x26')](respondWithFilteredResult(_0x4b5ffa,_0x44e0aa))['catch'](handleError(_0x4b5ffa,null));};exports[_0x4f39('0x42')]=function(_0x2b72be,_0x366d11){var _0x4b5f2a={'raw':![],'where':{'id':_0x2b72be['params']['id']}},_0x27f1ca={};_0x27f1ca[_0x4f39('0x2e')]=_[_0x4f39('0x31')](db[_0x4f39('0x2b')]['rawAttributes']);_0x27f1ca[_0x4f39('0x30')]=_['keys'](_0x2b72be['query']);_0x27f1ca[_0x4f39('0x3a')]=_['intersection'](_0x27f1ca['model'],_0x27f1ca[_0x4f39('0x30')]);_0x4b5f2a['attributes']=_['intersection'](_0x27f1ca[_0x4f39('0x2e')],qs[_0x4f39('0x33')](_0x2b72be[_0x4f39('0x30')][_0x4f39('0x33')]));_0x4b5f2a[_0x4f39('0x34')]=_0x4b5f2a[_0x4f39('0x34')]['length']?_0x4b5f2a[_0x4f39('0x34')]:_0x27f1ca[_0x4f39('0x2e')];if(_0x2b72be[_0x4f39('0x30')][_0x4f39('0x3f')]){_0x4b5f2a['include']=[{'all':!![]}];}_0x4b5f2a=_[_0x4f39('0x3d')]({},_0x4b5f2a,_0x2b72be['options']);return db[_0x4f39('0x2b')][_0x4f39('0x43')](_0x4b5f2a)[_0x4f39('0x26')](handleEntityNotFound(_0x366d11,null))['then'](respondWithResult(_0x366d11,null))[_0x4f39('0x44')](handleError(_0x366d11,null));};exports[_0x4f39('0x45')]=function(_0x304155,_0x5ddd15){return db[_0x4f39('0x2b')]['create'](_0x304155[_0x4f39('0x46')],{})[_0x4f39('0x26')](respondWithResult(_0x5ddd15,0xc9))[_0x4f39('0x44')](handleError(_0x5ddd15,null));};exports['update']=function(_0x152f36,_0x1f7c62){if(_0x152f36[_0x4f39('0x46')]['id']){delete _0x152f36[_0x4f39('0x46')]['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x152f36[_0x4f39('0x47')]['id']}})[_0x4f39('0x26')](handleEntityNotFound(_0x1f7c62,null))[_0x4f39('0x26')](saveUpdates(_0x152f36[_0x4f39('0x46')],null))[_0x4f39('0x26')](respondWithResult(_0x1f7c62,null))['catch'](handleError(_0x1f7c62,null));};exports[_0x4f39('0x27')]=function(_0x2e9bf2,_0xb9373c){return db[_0x4f39('0x2b')]['find']({'where':{'id':_0x2e9bf2[_0x4f39('0x47')]['id']}})['then'](handleEntityNotFound(_0xb9373c,null))['then'](removeEntity(_0xb9373c,null))[_0x4f39('0x44')](handleError(_0xb9373c,null));};exports[_0x4f39('0x48')]=function(_0x5e8884,_0x136d83){return db[_0x4f39('0x2b')][_0x4f39('0x48')]()[_0x4f39('0x26')](respondWithResult(_0x136d83,null))[_0x4f39('0x44')](handleError(_0x136d83,null));}; \ No newline at end of file +var _0x1502=['length','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','show','params','keys','includeAll','catch','create','body','find','describe','eml-format','rimraf','zip-dir','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','map','IntegrationReport','rawAttributes','type','key','query','filters','intersection','model','attributes','fields'];(function(_0x59c476,_0x5cd7fb){var _0x5c6e4f=function(_0x1e95c5){while(--_0x1e95c5){_0x59c476['push'](_0x59c476['shift']());}};_0x5c6e4f(++_0x5cd7fb);}(_0x1502,0x177));var _0x2150=function(_0x5519e8,_0x205071){_0x5519e8=_0x5519e8-0x0;var _0x5e122c=_0x1502[_0x5519e8];return _0x5e122c;};'use strict';var emlformat=require(_0x2150('0x0'));var rimraf=require(_0x2150('0x1'));var zipdir=require(_0x2150('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2150('0x3'));var util=require('util');var path=require(_0x2150('0x4'));var sox=require(_0x2150('0x5'));var csv=require(_0x2150('0x6'));var ejs=require(_0x2150('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2150('0x8'));var squel=require(_0x2150('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2150('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2150('0xb'));var Papa=require(_0x2150('0xc'));var Redis=require(_0x2150('0xd'));var authService=require(_0x2150('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2150('0xf'));var hardwareService=require(_0x2150('0x10'));var logger=require(_0x2150('0x11'))(_0x2150('0x12'));var utils=require(_0x2150('0x13'));var config=require(_0x2150('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2150('0x15'))['db'];function respondWithStatusCode(_0x1036fd,_0x57aaff){_0x57aaff=_0x57aaff||0xcc;return function(_0x4ffe2c){if(_0x4ffe2c){return _0x1036fd[_0x2150('0x16')](_0x57aaff);}return _0x1036fd[_0x2150('0x17')](_0x57aaff)[_0x2150('0x18')]();};}function respondWithResult(_0x2288fd,_0x113bf9){_0x113bf9=_0x113bf9||0xc8;return function(_0x414da1){if(_0x414da1){return _0x2288fd[_0x2150('0x17')](_0x113bf9)[_0x2150('0x19')](_0x414da1);}};}function respondWithFilteredResult(_0x116fd9,_0x1dfc02){return function(_0x1a08e1){if(_0x1a08e1){var _0x5e7f4c=typeof _0x1dfc02[_0x2150('0x1a')]===_0x2150('0x1b')&&typeof _0x1dfc02[_0x2150('0x1c')]===_0x2150('0x1b');var _0x3b33f7=_0x1a08e1[_0x2150('0x1d')];var _0x4ab31a=_0x5e7f4c?0x0:_0x1dfc02[_0x2150('0x1a')];var _0x1e68ce=_0x5e7f4c?_0x1a08e1['count']:_0x1dfc02['offset']+_0x1dfc02['limit'];var _0x3ed4e4;if(_0x1e68ce>=_0x3b33f7){_0x1e68ce=_0x3b33f7;_0x3ed4e4=0xc8;}else{_0x3ed4e4=0xce;}_0x116fd9[_0x2150('0x17')](_0x3ed4e4);return _0x116fd9[_0x2150('0x1e')](_0x2150('0x1f'),_0x4ab31a+'-'+_0x1e68ce+'/'+_0x3b33f7)[_0x2150('0x19')](_0x1a08e1);}return null;};}function patchUpdates(_0x250735){return function(_0x5e9489){try{jsonpatch[_0x2150('0x20')](_0x5e9489,_0x250735,!![]);}catch(_0x51453d){return BPromise[_0x2150('0x21')](_0x51453d);}return _0x5e9489[_0x2150('0x22')]();};}function saveUpdates(_0xcbaf13,_0x457a65){return function(_0xd7d460){if(_0xd7d460){return _0xd7d460[_0x2150('0x23')](_0xcbaf13)[_0x2150('0x24')](function(_0x348d56){return _0x348d56;});}return null;};}function removeEntity(_0x327a68,_0x28c851){return function(_0x2d3563){if(_0x2d3563){return _0x2d3563[_0x2150('0x25')]()[_0x2150('0x24')](function(){_0x327a68[_0x2150('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfa51e5,_0x39ab15){return function(_0x5e8cb3){if(!_0x5e8cb3){_0xfa51e5[_0x2150('0x16')](0x194);}return _0x5e8cb3;};}function handleError(_0x2943dd,_0x237b25){_0x237b25=_0x237b25||0x1f4;return function(_0x5f1dab){logger['error'](_0x5f1dab['stack']);if(_0x5f1dab[_0x2150('0x26')]){delete _0x5f1dab[_0x2150('0x26')];}_0x2943dd['status'](_0x237b25)[_0x2150('0x27')](_0x5f1dab);};}exports['index']=function(_0x2516dc,_0x55bc99){var _0x585fcd={},_0x2a9fbf={},_0x434540={'count':0x0,'rows':[]};var _0x30a025=_[_0x2150('0x28')](db[_0x2150('0x29')][_0x2150('0x2a')],function(_0x10b612){return{'name':_0x10b612['fieldName'],'type':_0x10b612[_0x2150('0x2b')][_0x2150('0x2c')]};});_0x2a9fbf['model']=_[_0x2150('0x28')](_0x30a025,_0x2150('0x26'));_0x2a9fbf[_0x2150('0x2d')]=_['keys'](_0x2516dc[_0x2150('0x2d')]);_0x2a9fbf[_0x2150('0x2e')]=_[_0x2150('0x2f')](_0x2a9fbf[_0x2150('0x30')],_0x2a9fbf[_0x2150('0x2d')]);_0x585fcd[_0x2150('0x31')]=_[_0x2150('0x2f')](_0x2a9fbf[_0x2150('0x30')],qs[_0x2150('0x32')](_0x2516dc[_0x2150('0x2d')]['fields']));_0x585fcd[_0x2150('0x31')]=_0x585fcd[_0x2150('0x31')][_0x2150('0x33')]?_0x585fcd[_0x2150('0x31')]:_0x2a9fbf[_0x2150('0x30')];if(!_0x2516dc[_0x2150('0x2d')]['hasOwnProperty'](_0x2150('0x34'))){_0x585fcd[_0x2150('0x1c')]=qs[_0x2150('0x1c')](_0x2516dc[_0x2150('0x2d')][_0x2150('0x1c')]);_0x585fcd[_0x2150('0x1a')]=qs[_0x2150('0x1a')](_0x2516dc[_0x2150('0x2d')][_0x2150('0x1a')]);}_0x585fcd[_0x2150('0x35')]=qs[_0x2150('0x36')](_0x2516dc[_0x2150('0x2d')][_0x2150('0x36')]);_0x585fcd[_0x2150('0x37')]=qs[_0x2150('0x2e')](_['pick'](_0x2516dc[_0x2150('0x2d')],_0x2a9fbf[_0x2150('0x2e')]),_0x30a025);if(_0x2516dc[_0x2150('0x2d')][_0x2150('0x38')]){_0x585fcd[_0x2150('0x37')]=_[_0x2150('0x39')](_0x585fcd[_0x2150('0x37')],{'$or':_[_0x2150('0x28')](_0x30a025,function(_0x1ab1f8){if(_0x1ab1f8[_0x2150('0x2b')]!=='VIRTUAL'){var _0x42b0e2={};_0x42b0e2[_0x1ab1f8[_0x2150('0x26')]]={'$like':'%'+_0x2516dc[_0x2150('0x2d')][_0x2150('0x38')]+'%'};return _0x42b0e2;}})});}_0x585fcd=_[_0x2150('0x39')]({},_0x585fcd,_0x2516dc[_0x2150('0x3a')]);var _0x1bed8d={'where':_0x585fcd[_0x2150('0x37')]};return db[_0x2150('0x29')][_0x2150('0x1d')](_0x1bed8d)['then'](function(_0x39a491){_0x434540[_0x2150('0x1d')]=_0x39a491;if(_0x2516dc[_0x2150('0x2d')]['includeAll']){_0x585fcd[_0x2150('0x3b')]=[{'all':!![]}];}return db[_0x2150('0x29')][_0x2150('0x3c')](_0x585fcd);})[_0x2150('0x24')](function(_0x5f5d9e){_0x434540[_0x2150('0x3d')]=_0x5f5d9e;return _0x434540;})[_0x2150('0x24')](respondWithFilteredResult(_0x55bc99,_0x585fcd))['catch'](handleError(_0x55bc99,null));};exports[_0x2150('0x3e')]=function(_0x457d23,_0x2e75c2){var _0x43029f={'raw':![],'where':{'id':_0x457d23[_0x2150('0x3f')]['id']}},_0x2f24eb={};_0x2f24eb['model']=_[_0x2150('0x40')](db[_0x2150('0x29')][_0x2150('0x2a')]);_0x2f24eb['query']=_['keys'](_0x457d23[_0x2150('0x2d')]);_0x2f24eb[_0x2150('0x2e')]=_[_0x2150('0x2f')](_0x2f24eb[_0x2150('0x30')],_0x2f24eb[_0x2150('0x2d')]);_0x43029f[_0x2150('0x31')]=_[_0x2150('0x2f')](_0x2f24eb['model'],qs[_0x2150('0x32')](_0x457d23['query']['fields']));_0x43029f[_0x2150('0x31')]=_0x43029f[_0x2150('0x31')][_0x2150('0x33')]?_0x43029f[_0x2150('0x31')]:_0x2f24eb[_0x2150('0x30')];if(_0x457d23[_0x2150('0x2d')][_0x2150('0x41')]){_0x43029f[_0x2150('0x3b')]=[{'all':!![]}];}_0x43029f=_['merge']({},_0x43029f,_0x457d23[_0x2150('0x3a')]);return db[_0x2150('0x29')]['find'](_0x43029f)[_0x2150('0x24')](handleEntityNotFound(_0x2e75c2,null))['then'](respondWithResult(_0x2e75c2,null))[_0x2150('0x42')](handleError(_0x2e75c2,null));};exports[_0x2150('0x43')]=function(_0xa23cb9,_0x293bc3){return db['IntegrationReport'][_0x2150('0x43')](_0xa23cb9[_0x2150('0x44')],{})[_0x2150('0x24')](respondWithResult(_0x293bc3,0xc9))[_0x2150('0x42')](handleError(_0x293bc3,null));};exports[_0x2150('0x23')]=function(_0xbc1ebd,_0x3f24f3){if(_0xbc1ebd[_0x2150('0x44')]['id']){delete _0xbc1ebd['body']['id'];}return db[_0x2150('0x29')][_0x2150('0x45')]({'where':{'id':_0xbc1ebd[_0x2150('0x3f')]['id']}})[_0x2150('0x24')](handleEntityNotFound(_0x3f24f3,null))[_0x2150('0x24')](saveUpdates(_0xbc1ebd[_0x2150('0x44')],null))[_0x2150('0x24')](respondWithResult(_0x3f24f3,null))[_0x2150('0x42')](handleError(_0x3f24f3,null));};exports['destroy']=function(_0xd1e061,_0x1e67a8){return db[_0x2150('0x29')][_0x2150('0x45')]({'where':{'id':_0xd1e061[_0x2150('0x3f')]['id']}})[_0x2150('0x24')](handleEntityNotFound(_0x1e67a8,null))[_0x2150('0x24')](removeEntity(_0x1e67a8,null))['catch'](handleError(_0x1e67a8,null));};exports[_0x2150('0x46')]=function(_0x5164d4,_0x164f98){return db[_0x2150('0x29')]['describe']()[_0x2150('0x24')](respondWithResult(_0x164f98,null))['catch'](handleError(_0x164f98,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index c5c24aa..6878923 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 _0x2dad=['exports','define','IntegrationReport','report_integration','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x33e386,_0x5209b7){var _0x4f11a0=function(_0x436e97){while(--_0x436e97){_0x33e386['push'](_0x33e386['shift']());}};_0x4f11a0(++_0x5209b7);}(_0x2dad,0xee));var _0xd2da=function(_0x40fa98,_0x4c1198){_0x40fa98=_0x40fa98-0x0;var _0x64c0b1=_0x2dad[_0x40fa98];return _0x64c0b1;};'use strict';var _=require('lodash');var util=require(_0xd2da('0x0'));var logger=require(_0xd2da('0x1'))(_0xd2da('0x2'));var moment=require(_0xd2da('0x3'));var BPromise=require(_0xd2da('0x4'));var rp=require(_0xd2da('0x5'));var fs=require('fs');var path=require(_0xd2da('0x6'));var rimraf=require(_0xd2da('0x7'));var config=require(_0xd2da('0x8'));var attributes=require('./integrationReport.attributes');module[_0xd2da('0x9')]=function(_0x16ab37,_0x1c9cc3){return _0x16ab37[_0xd2da('0xa')](_0xd2da('0xb'),attributes,{'tableName':_0xd2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ee7=['exports','define','IntegrationReport','report_integration','lodash','api','request-promise','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ee7,0x17c));var _0x74ee=function(_0x4a06e3,_0x215889){_0x4a06e3=_0x4a06e3-0x0;var _0x1320ef=_0x4ee7[_0x4a06e3];return _0x1320ef;};'use strict';var _=require(_0x74ee('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x74ee('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x74ee('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x74ee('0x3'));var attributes=require('./integrationReport.attributes');module[_0x74ee('0x4')]=function(_0xb52978,_0x10af4e){return _0xb52978[_0x74ee('0x5')](_0x74ee('0x6'),attributes,{'tableName':_0x74ee('0x7'),'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 1a08e2b..d5c923a 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 _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xc2c7,0x134));var _0x7c2c=function(_0x484aa8,_0x4812f6){_0x484aa8=_0x484aa8-0x0;var _0x3aae78=_0xc2c7[_0x484aa8];return _0x3aae78;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0x31f0=['../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3379af,_0x416f71){var _0x30134e=function(_0x1e017a){while(--_0x1e017a){_0x3379af['push'](_0x3379af['shift']());}};_0x30134e(++_0x416f71);}(_0x31f0,0xb7));var _0x031f=function(_0x38a533,_0x13b2d3){_0x38a533=_0x38a533-0x0;var _0x918f56=_0x31f0[_0x38a533];return _0x918f56;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index f15bad8..bb2b61d 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 _0xdfd2=['/:id/sub_intervals/create_many','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./interval.controller','get','/:id','isAuthenticated','/:id/sub_intervals','getIntervals','post','addInterval'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xdfd2,0xf6));var _0x2dfd=function(_0x1bf17e,_0x1ed2bb){_0x1bf17e=_0x1bf17e-0x0;var _0x1fe5a7=_0xdfd2[_0x1bf17e];return _0x1fe5a7;};'use strict';var multer=require(_0x2dfd('0x0'));var util=require('util');var path=require(_0x2dfd('0x1'));var timeout=require(_0x2dfd('0x2'));var express=require('express');var router=express[_0x2dfd('0x3')]();var fs_extra=require(_0x2dfd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2dfd('0x5'));var controller=require(_0x2dfd('0x6'));router[_0x2dfd('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2dfd('0x7')](_0x2dfd('0x8'),auth[_0x2dfd('0x9')](),controller['show']);router[_0x2dfd('0x7')](_0x2dfd('0xa'),auth[_0x2dfd('0x9')](),controller[_0x2dfd('0xb')]);router[_0x2dfd('0xc')]('/',auth[_0x2dfd('0x9')](),controller['create']);router[_0x2dfd('0xc')](_0x2dfd('0xa'),auth[_0x2dfd('0x9')](),controller[_0x2dfd('0xd')]);router[_0x2dfd('0xc')](_0x2dfd('0xe'),auth['isAuthenticated'](),controller['addIntervals']);router[_0x2dfd('0xf')]('/:id',auth[_0x2dfd('0x9')](),controller[_0x2dfd('0x10')]);router[_0x2dfd('0x11')](_0x2dfd('0x8'),auth[_0x2dfd('0x9')](),controller[_0x2dfd('0x12')]);module[_0x2dfd('0x13')]=router; \ No newline at end of file +var _0xc029=['show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc029,0x1df));var _0x9c02=function(_0x1a2ef3,_0x21186c){_0x1a2ef3=_0x1a2ef3-0x0;var _0x34f4a4=_0xc029[_0x1a2ef3];return _0x34f4a4;};'use strict';var multer=require(_0x9c02('0x0'));var util=require(_0x9c02('0x1'));var path=require(_0x9c02('0x2'));var timeout=require(_0x9c02('0x3'));var express=require(_0x9c02('0x4'));var router=express[_0x9c02('0x5')]();var fs_extra=require(_0x9c02('0x6'));var auth=require(_0x9c02('0x7'));var interaction=require(_0x9c02('0x8'));var config=require(_0x9c02('0x9'));var controller=require(_0x9c02('0xa'));router[_0x9c02('0xb')]('/',auth[_0x9c02('0xc')](),controller[_0x9c02('0xd')]);router[_0x9c02('0xb')](_0x9c02('0xe'),auth[_0x9c02('0xc')](),controller[_0x9c02('0xf')]);router['get'](_0x9c02('0x10'),auth['isAuthenticated'](),controller[_0x9c02('0x11')]);router[_0x9c02('0x12')]('/',auth[_0x9c02('0xc')](),controller[_0x9c02('0x13')]);router['post'](_0x9c02('0x10'),auth['isAuthenticated'](),controller[_0x9c02('0x14')]);router['post'](_0x9c02('0x15'),auth[_0x9c02('0xc')](),controller['addIntervals']);router[_0x9c02('0x16')](_0x9c02('0xe'),auth['isAuthenticated'](),controller[_0x9c02('0x17')]);router[_0x9c02('0x18')](_0x9c02('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x9c02('0x19')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 4e3398f..f260397 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 _0x125b=['STRING','sequelize','exports'];(function(_0x5bc6f0,_0x2296b0){var _0x34b12b=function(_0x3f4576){while(--_0x3f4576){_0x5bc6f0['push'](_0x5bc6f0['shift']());}};_0x34b12b(++_0x2296b0);}(_0x125b,0x130));var _0xb125=function(_0x8e3983,_0x21f7cd){_0x8e3983=_0x8e3983-0x0;var _0x483527=_0x125b[_0x8e3983];return _0x483527;};'use strict';var Sequelize=require(_0xb125('0x0'));module[_0xb125('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb125('0x2')]},'interval':{'type':Sequelize[_0xb125('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xe751=['exports','STRING','sequelize'];(function(_0x55e205,_0x38b0c1){var _0x14e333=function(_0x38a1f2){while(--_0x38a1f2){_0x55e205['push'](_0x55e205['shift']());}};_0x14e333(++_0x38b0c1);}(_0xe751,0xe9));var _0x1e75=function(_0x318db2,_0x589fbf){_0x318db2=_0x318db2-0x0;var _0x2fba39=_0xe751[_0x318db2];return _0x2fba39;};'use strict';var Sequelize=require(_0x1e75('0x0'));module[_0x1e75('0x1')]={'name':{'type':Sequelize[_0x1e75('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1e75('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index bc692cb..250fc0c 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 _0xf138=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','UserProfileResource','end','stack','name','send','index','map','Interval','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','sort','addIntervals','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf138,0xff));var _0x8f13=function(_0x42de7d,_0x3febfd){_0x42de7d=_0x42de7d-0x0;var _0x2a63e9=_0xf138[_0x42de7d];return _0x2a63e9;};'use strict';var emlformat=require(_0x8f13('0x0'));var rimraf=require(_0x8f13('0x1'));var zipdir=require(_0x8f13('0x2'));var jsonpatch=require(_0x8f13('0x3'));var rp=require(_0x8f13('0x4'));var moment=require(_0x8f13('0x5'));var BPromise=require(_0x8f13('0x6'));var Mustache=require(_0x8f13('0x7'));var util=require(_0x8f13('0x8'));var path=require('path');var sox=require(_0x8f13('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f13('0xa'));var squel=require(_0x8f13('0xb'));var crypto=require(_0x8f13('0xc'));var jsforce=require(_0x8f13('0xd'));var deskjs=require(_0x8f13('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8f13('0xf'));var Papa=require(_0x8f13('0x10'));var Redis=require(_0x8f13('0x11'));var authService=require(_0x8f13('0x12'));var qs=require(_0x8f13('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f13('0x14'));var logger=require('../../config/logger')(_0x8f13('0x15'));var utils=require(_0x8f13('0x16'));var config=require(_0x8f13('0x17'));var licenseUtil=require(_0x8f13('0x18'));var db=require('../../mysqldb')['db'];var extensions=require(_0x8f13('0x19'));function respondWithStatusCode(_0x4244b5,_0x10bc43){_0x10bc43=_0x10bc43||0xcc;return function(_0x48c07b){if(_0x48c07b){return _0x4244b5[_0x8f13('0x1a')](_0x10bc43);}return _0x4244b5[_0x8f13('0x1b')](_0x10bc43)['end']();};}function respondWithResult(_0x307fd5,_0x281241){_0x281241=_0x281241||0xc8;return function(_0x4869e3){if(_0x4869e3){return _0x307fd5['status'](_0x281241)[_0x8f13('0x1c')](_0x4869e3);}};}function respondWithFilteredResult(_0x56703b,_0x38350f){return function(_0x4db07a){if(_0x4db07a){var _0x10d1bf=typeof _0x38350f[_0x8f13('0x1d')]===_0x8f13('0x1e')&&typeof _0x38350f[_0x8f13('0x1f')]===_0x8f13('0x1e');var _0x2f658b=_0x4db07a[_0x8f13('0x20')];var _0x1e8a4e=_0x10d1bf?0x0:_0x38350f['offset'];var _0x33adbd=_0x10d1bf?_0x4db07a[_0x8f13('0x20')]:_0x38350f['offset']+_0x38350f[_0x8f13('0x1f')];var _0x155b82;if(_0x33adbd>=_0x2f658b){_0x33adbd=_0x2f658b;_0x155b82=0xc8;}else{_0x155b82=0xce;}_0x56703b[_0x8f13('0x1b')](_0x155b82);return _0x56703b[_0x8f13('0x21')](_0x8f13('0x22'),_0x1e8a4e+'-'+_0x33adbd+'/'+_0x2f658b)[_0x8f13('0x1c')](_0x4db07a);}return null;};}function patchUpdates(_0xa7ef3d){return function(_0x28d255){try{jsonpatch[_0x8f13('0x23')](_0x28d255,_0xa7ef3d,!![]);}catch(_0x548da1){return BPromise['reject'](_0x548da1);}return _0x28d255[_0x8f13('0x24')]();};}function saveUpdates(_0x53ecb7,_0x652308){return function(_0x35ad4d){if(_0x35ad4d){return _0x35ad4d[_0x8f13('0x25')](_0x53ecb7)['then'](function(_0x265e91){return _0x265e91;});}return null;};}function removeEntity(_0x41632e,_0x4a5627){return function(_0x37c38d){if(_0x37c38d){return _0x37c38d[_0x8f13('0x26')]()[_0x8f13('0x27')](function(){var _0x3a2417=_0x37c38d[_0x8f13('0x28')]({'plain':!![]});var _0x183243='Intervals';return db[_0x8f13('0x29')][_0x8f13('0x26')]({'where':{'type':_0x183243,'resourceId':_0x3a2417['id']}})['then'](function(){return _0x37c38d;});})['then'](function(){_0x41632e['status'](0xcc)[_0x8f13('0x2a')]();});}};}function handleEntityNotFound(_0x3ec04d,_0x2f364e){return function(_0x203c89){if(!_0x203c89){_0x3ec04d['sendStatus'](0x194);}return _0x203c89;};}function handleError(_0x3b9a,_0x54d2ec){_0x54d2ec=_0x54d2ec||0x1f4;return function(_0x301954){logger['error'](_0x301954[_0x8f13('0x2b')]);if(_0x301954['name']){delete _0x301954[_0x8f13('0x2c')];}_0x3b9a['status'](_0x54d2ec)[_0x8f13('0x2d')](_0x301954);};}exports[_0x8f13('0x2e')]=function(_0x13253c,_0x434bbf){var _0x5858b3={},_0x25eb7f={},_0x385086={'count':0x0,'rows':[]};var _0x319509=_[_0x8f13('0x2f')](db[_0x8f13('0x30')]['rawAttributes'],function(_0x157688){return{'name':_0x157688[_0x8f13('0x31')],'type':_0x157688[_0x8f13('0x32')][_0x8f13('0x33')]};});_0x25eb7f[_0x8f13('0x34')]=_['map'](_0x319509,_0x8f13('0x2c'));_0x25eb7f[_0x8f13('0x35')]=_[_0x8f13('0x36')](_0x13253c['query']);_0x25eb7f['filters']=_[_0x8f13('0x37')](_0x25eb7f[_0x8f13('0x34')],_0x25eb7f['query']);_0x5858b3['attributes']=_[_0x8f13('0x37')](_0x25eb7f[_0x8f13('0x34')],qs['fields'](_0x13253c[_0x8f13('0x35')][_0x8f13('0x38')]));_0x5858b3[_0x8f13('0x39')]=_0x5858b3[_0x8f13('0x39')][_0x8f13('0x3a')]?_0x5858b3[_0x8f13('0x39')]:_0x25eb7f[_0x8f13('0x34')];if(!_0x13253c[_0x8f13('0x35')][_0x8f13('0x3b')](_0x8f13('0x3c'))){_0x5858b3[_0x8f13('0x1f')]=qs[_0x8f13('0x1f')](_0x13253c[_0x8f13('0x35')][_0x8f13('0x1f')]);_0x5858b3['offset']=qs[_0x8f13('0x1d')](_0x13253c['query'][_0x8f13('0x1d')]);}_0x5858b3[_0x8f13('0x3d')]=qs['sort'](_0x13253c[_0x8f13('0x35')]['sort']);_0x5858b3['where']=qs[_0x8f13('0x3e')](_[_0x8f13('0x3f')](_0x13253c[_0x8f13('0x35')],_0x25eb7f['filters']),_0x319509);if(_0x13253c['query'][_0x8f13('0x40')]){_0x5858b3[_0x8f13('0x41')]=_['merge'](_0x5858b3[_0x8f13('0x41')],{'$or':_[_0x8f13('0x2f')](_0x319509,function(_0x58c0de){if(_0x58c0de[_0x8f13('0x32')]!==_0x8f13('0x42')){var _0x1ea252={};_0x1ea252[_0x58c0de['name']]={'$like':'%'+_0x13253c[_0x8f13('0x35')][_0x8f13('0x40')]+'%'};return _0x1ea252;}})});}_0x5858b3=_['merge']({},_0x5858b3,_0x13253c[_0x8f13('0x43')]);var _0x5f4f03={'where':_0x5858b3[_0x8f13('0x41')]};return db['Interval'][_0x8f13('0x20')](_0x5f4f03)['then'](function(_0x83a086){_0x385086[_0x8f13('0x20')]=_0x83a086;if(_0x13253c[_0x8f13('0x35')][_0x8f13('0x44')]){_0x5858b3[_0x8f13('0x45')]=[{'all':!![]}];}return db[_0x8f13('0x30')][_0x8f13('0x46')](_0x5858b3);})[_0x8f13('0x27')](function(_0x1d633a){_0x385086['rows']=_0x1d633a;return _0x385086;})[_0x8f13('0x27')](respondWithFilteredResult(_0x434bbf,_0x5858b3))[_0x8f13('0x47')](handleError(_0x434bbf,null));};exports[_0x8f13('0x48')]=function(_0x2910ed,_0x50568f){var _0x5926d6={'raw':!![],'where':{'id':_0x2910ed[_0x8f13('0x49')]['id']}},_0x5b4e8e={};_0x5b4e8e[_0x8f13('0x34')]=_['keys'](db[_0x8f13('0x30')][_0x8f13('0x4a')]);_0x5b4e8e[_0x8f13('0x35')]=_[_0x8f13('0x36')](_0x2910ed[_0x8f13('0x35')]);_0x5b4e8e[_0x8f13('0x3e')]=_['intersection'](_0x5b4e8e[_0x8f13('0x34')],_0x5b4e8e['query']);_0x5926d6['attributes']=_[_0x8f13('0x37')](_0x5b4e8e[_0x8f13('0x34')],qs[_0x8f13('0x38')](_0x2910ed[_0x8f13('0x35')][_0x8f13('0x38')]));_0x5926d6[_0x8f13('0x39')]=_0x5926d6[_0x8f13('0x39')][_0x8f13('0x3a')]?_0x5926d6[_0x8f13('0x39')]:_0x5b4e8e[_0x8f13('0x34')];if(_0x2910ed[_0x8f13('0x35')][_0x8f13('0x44')]){_0x5926d6['include']=[{'all':!![]}];}_0x5926d6=_[_0x8f13('0x4b')]({},_0x5926d6,_0x2910ed[_0x8f13('0x43')]);return db[_0x8f13('0x30')][_0x8f13('0x4c')](_0x5926d6)[_0x8f13('0x27')](handleEntityNotFound(_0x50568f,null))[_0x8f13('0x27')](respondWithResult(_0x50568f,null))['catch'](handleError(_0x50568f,null));};exports[_0x8f13('0x4d')]=function(_0x2ea739,_0x24b113){return db['Interval'][_0x8f13('0x4d')](_0x2ea739[_0x8f13('0x4e')],{})[_0x8f13('0x27')](function(_0x4a90b8){var _0x492bb4=_0x2ea739[_0x8f13('0x4f')][_0x8f13('0x28')]({'plain':!![]});if(!_0x492bb4)throw new Error(_0x8f13('0x50'));if(_0x492bb4['role']==='user'){var _0x548cd0=_0x4a90b8[_0x8f13('0x28')]({'plain':!![]});var _0x1b88e0=_0x8f13('0x51');return db['UserProfileSection']['find']({'where':{'name':_0x1b88e0,'userProfileId':_0x492bb4[_0x8f13('0x52')]},'raw':!![]})[_0x8f13('0x27')](function(_0x6360fd){if(_0x6360fd&&_0x6360fd['autoAssociation']===0x0){return db[_0x8f13('0x29')]['create']({'name':_0x548cd0['name'],'resourceId':_0x548cd0['id'],'type':_0x6360fd[_0x8f13('0x2c')],'sectionId':_0x6360fd['id']},{})['then'](function(){return _0x4a90b8;});}else{return _0x4a90b8;}})['catch'](function(_0x510231){logger['error'](_0x8f13('0x53'),_0x510231);throw _0x510231;});}return _0x4a90b8;})[_0x8f13('0x27')](respondWithResult(_0x24b113,0xc9))[_0x8f13('0x47')](handleError(_0x24b113,null));};exports[_0x8f13('0x25')]=function(_0x4a549c,_0x260f40){if(_0x4a549c['body']['id']){delete _0x4a549c[_0x8f13('0x4e')]['id'];}return db[_0x8f13('0x30')][_0x8f13('0x4c')]({'where':{'id':_0x4a549c['params']['id']}})['then'](handleEntityNotFound(_0x260f40,null))[_0x8f13('0x27')](saveUpdates(_0x4a549c[_0x8f13('0x4e')],null))[_0x8f13('0x27')](respondWithResult(_0x260f40,null))['catch'](handleError(_0x260f40,null));};exports[_0x8f13('0x26')]=function(_0x2f97c4,_0x4a43ae){return db[_0x8f13('0x30')][_0x8f13('0x4c')]({'where':{'id':_0x2f97c4[_0x8f13('0x49')]['id']}})[_0x8f13('0x27')](handleEntityNotFound(_0x4a43ae,null))['then'](removeEntity(_0x4a43ae,null))['catch'](handleError(_0x4a43ae,null));};exports[_0x8f13('0x54')]=function(_0x49f9cb,_0x4b0b12,_0x13f124){if(_0x49f9cb['body']['id']){delete _0x49f9cb['body']['id'];}return db[_0x8f13('0x30')]['find']({'where':{'id':_0x49f9cb[_0x8f13('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b0b12,null))[_0x8f13('0x27')](function(_0x5dabb4){if(_0x5dabb4){_0x49f9cb['body'][_0x8f13('0x55')]=_0x5dabb4['id'];return db[_0x8f13('0x30')][_0x8f13('0x4d')](_0x49f9cb['body']);}})[_0x8f13('0x27')](respondWithResult(_0x4b0b12,null))[_0x8f13('0x47')](handleError(_0x4b0b12,null));};exports[_0x8f13('0x56')]=function(_0x1bc7a6,_0x1d035b,_0x1c3fe6){var _0x30ba5c={};var _0x1f860d={};var _0x145834;var _0x56ef3a;return db[_0x8f13('0x30')][_0x8f13('0x57')]({'where':{'id':_0x1bc7a6[_0x8f13('0x49')]['id']}})[_0x8f13('0x27')](handleEntityNotFound(_0x1d035b,null))[_0x8f13('0x27')](function(_0x37bce0){if(_0x37bce0){_0x145834=_0x37bce0;_0x1f860d[_0x8f13('0x34')]=_[_0x8f13('0x36')](db[_0x8f13('0x30')]['rawAttributes']);_0x1f860d['query']=_[_0x8f13('0x36')](_0x1bc7a6[_0x8f13('0x35')]);_0x1f860d[_0x8f13('0x3e')]=_[_0x8f13('0x37')](_0x1f860d[_0x8f13('0x34')],_0x1f860d[_0x8f13('0x35')]);_0x30ba5c['attributes']=_[_0x8f13('0x37')](_0x1f860d['model'],qs[_0x8f13('0x38')](_0x1bc7a6[_0x8f13('0x35')][_0x8f13('0x38')]));_0x30ba5c['attributes']=_0x30ba5c[_0x8f13('0x39')][_0x8f13('0x3a')]?_0x30ba5c['attributes']:_0x1f860d[_0x8f13('0x34')];_0x30ba5c[_0x8f13('0x3d')]=qs['sort'](_0x1bc7a6[_0x8f13('0x35')][_0x8f13('0x58')]);_0x30ba5c[_0x8f13('0x41')]=qs['filters'](_[_0x8f13('0x3f')](_0x1bc7a6['query'],_0x1f860d['filters']));if(_0x1bc7a6[_0x8f13('0x35')][_0x8f13('0x40')]){_0x30ba5c[_0x8f13('0x41')]=_[_0x8f13('0x4b')](_0x30ba5c['where'],{'$or':_[_0x8f13('0x2f')](_0x30ba5c[_0x8f13('0x39')],function(_0x1b3605){var _0x172c2={};_0x172c2[_0x1b3605]={'$like':'%'+_0x1bc7a6[_0x8f13('0x35')][_0x8f13('0x40')]+'%'};return _0x172c2;})});}_0x30ba5c=_[_0x8f13('0x4b')]({},_0x30ba5c,_0x1bc7a6[_0x8f13('0x43')]);return _0x145834[_0x8f13('0x56')](_0x30ba5c);}})['then'](function(_0x449458){if(_0x449458){_0x56ef3a=_0x449458[_0x8f13('0x3a')];if(!_0x1bc7a6[_0x8f13('0x35')][_0x8f13('0x3b')](_0x8f13('0x3c'))){_0x30ba5c[_0x8f13('0x1f')]=qs['limit'](_0x1bc7a6[_0x8f13('0x35')][_0x8f13('0x1f')]);_0x30ba5c['offset']=qs[_0x8f13('0x1d')](_0x1bc7a6[_0x8f13('0x35')]['offset']);}return _0x145834[_0x8f13('0x56')](_0x30ba5c);}})['then'](function(_0x111f59){if(_0x111f59){return _0x111f59?{'count':_0x56ef3a,'rows':_0x111f59}:null;}})[_0x8f13('0x27')](respondWithResult(_0x1d035b,null))[_0x8f13('0x47')](handleError(_0x1d035b,null));};exports[_0x8f13('0x59')]=function(_0xe652c8,_0x2b23f5,_0x1e7a08){return db[_0x8f13('0x30')][_0x8f13('0x57')]({'where':{'id':_0xe652c8[_0x8f13('0x49')]['id']}})[_0x8f13('0x27')](handleEntityNotFound(_0x2b23f5,null))[_0x8f13('0x27')](function(_0x2bd491){if(_0x2bd491){return db['sequelize']['transaction'](function(_0x2ffceb){return db[_0x8f13('0x30')][_0x8f13('0x26')]({'where':{'IntervalId':_0xe652c8[_0x8f13('0x49')]['id']},'transaction':_0x2ffceb})[_0x8f13('0x27')](function(_0x31d6f5){var _0x31575f=_[_0x8f13('0x2f')](_0xe652c8['body'],function(_0x5ead7f){delete _0x5ead7f['id'];_0x5ead7f[_0x8f13('0x55')]=_0xe652c8[_0x8f13('0x49')]['id'];return _0x5ead7f;});return db[_0x8f13('0x30')][_0x8f13('0x5a')](_0x31575f,{'transaction':_0x2ffceb});});})[_0x8f13('0x27')](function(){return db[_0x8f13('0x30')][_0x8f13('0x46')]({'where':{'IntervalId':_0xe652c8[_0x8f13('0x49')]['id']}});});}})[_0x8f13('0x27')](respondWithResult(_0x2b23f5,null))['catch'](handleError(_0x2b23f5,null));}; \ No newline at end of file +var _0xd309=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','get','Intervals','UserProfileResource','end','name','Interval','rawAttributes','fieldName','model','map','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','includeAll','include','findAll','rows','show','params','keys','fields','options','find','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','create','error','IntervalId','getIntervals','findOne','pick','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xd309,0x14b));var _0x9d30=function(_0x494a34,_0x48394c){_0x494a34=_0x494a34-0x0;var _0x1e73b3=_0xd309[_0x494a34];return _0x1e73b3;};'use strict';var emlformat=require(_0x9d30('0x0'));var rimraf=require(_0x9d30('0x1'));var zipdir=require(_0x9d30('0x2'));var jsonpatch=require(_0x9d30('0x3'));var rp=require(_0x9d30('0x4'));var moment=require(_0x9d30('0x5'));var BPromise=require(_0x9d30('0x6'));var Mustache=require(_0x9d30('0x7'));var util=require('util');var path=require(_0x9d30('0x8'));var sox=require(_0x9d30('0x9'));var csv=require(_0x9d30('0xa'));var ejs=require(_0x9d30('0xb'));var fs=require('fs');var fs_extra=require(_0x9d30('0xc'));var _=require(_0x9d30('0xd'));var squel=require('squel');var crypto=require(_0x9d30('0xe'));var jsforce=require(_0x9d30('0xf'));var deskjs=require(_0x9d30('0x10'));var toCsv=require(_0x9d30('0xa'));var querystring=require('querystring');var Papa=require(_0x9d30('0x11'));var Redis=require(_0x9d30('0x12'));var authService=require(_0x9d30('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9d30('0x14'));var hardwareService=require(_0x9d30('0x15'));var logger=require(_0x9d30('0x16'))('api');var utils=require(_0x9d30('0x17'));var config=require(_0x9d30('0x18'));var licenseUtil=require(_0x9d30('0x19'));var db=require(_0x9d30('0x1a'))['db'];var extensions=require(_0x9d30('0x1b'));function respondWithStatusCode(_0x22509c,_0x40c628){_0x40c628=_0x40c628||0xcc;return function(_0x3c5f42){if(_0x3c5f42){return _0x22509c[_0x9d30('0x1c')](_0x40c628);}return _0x22509c[_0x9d30('0x1d')](_0x40c628)['end']();};}function respondWithResult(_0x415943,_0x1e9a33){_0x1e9a33=_0x1e9a33||0xc8;return function(_0x109ab1){if(_0x109ab1){return _0x415943[_0x9d30('0x1d')](_0x1e9a33)['json'](_0x109ab1);}};}function respondWithFilteredResult(_0xdfb97a,_0x4dd76e){return function(_0x589e99){if(_0x589e99){var _0x1a121e=typeof _0x4dd76e[_0x9d30('0x1e')]===_0x9d30('0x1f')&&typeof _0x4dd76e['limit']===_0x9d30('0x1f');var _0x5ca628=_0x589e99[_0x9d30('0x20')];var _0x3763e2=_0x1a121e?0x0:_0x4dd76e[_0x9d30('0x1e')];var _0x5636d2=_0x1a121e?_0x589e99[_0x9d30('0x20')]:_0x4dd76e['offset']+_0x4dd76e[_0x9d30('0x21')];var _0x512bdc;if(_0x5636d2>=_0x5ca628){_0x5636d2=_0x5ca628;_0x512bdc=0xc8;}else{_0x512bdc=0xce;}_0xdfb97a[_0x9d30('0x1d')](_0x512bdc);return _0xdfb97a['set'](_0x9d30('0x22'),_0x3763e2+'-'+_0x5636d2+'/'+_0x5ca628)['json'](_0x589e99);}return null;};}function patchUpdates(_0x53258a){return function(_0x2bd510){try{jsonpatch[_0x9d30('0x23')](_0x2bd510,_0x53258a,!![]);}catch(_0x5541f2){return BPromise[_0x9d30('0x24')](_0x5541f2);}return _0x2bd510[_0x9d30('0x25')]();};}function saveUpdates(_0x393378,_0x3f6ba6){return function(_0x2cbb6a){if(_0x2cbb6a){return _0x2cbb6a['update'](_0x393378)[_0x9d30('0x26')](function(_0x5d06df){return _0x5d06df;});}return null;};}function removeEntity(_0x49ad8e,_0x5231be){return function(_0x2d0494){if(_0x2d0494){return _0x2d0494[_0x9d30('0x27')]()['then'](function(){var _0x35762d=_0x2d0494[_0x9d30('0x28')]({'plain':!![]});var _0x2c404e=_0x9d30('0x29');return db[_0x9d30('0x2a')]['destroy']({'where':{'type':_0x2c404e,'resourceId':_0x35762d['id']}})[_0x9d30('0x26')](function(){return _0x2d0494;});})['then'](function(){_0x49ad8e[_0x9d30('0x1d')](0xcc)[_0x9d30('0x2b')]();});}};}function handleEntityNotFound(_0x587eb4,_0x526463){return function(_0x183d38){if(!_0x183d38){_0x587eb4['sendStatus'](0x194);}return _0x183d38;};}function handleError(_0x4d8a01,_0x4ae568){_0x4ae568=_0x4ae568||0x1f4;return function(_0x324f5b){logger['error'](_0x324f5b['stack']);if(_0x324f5b[_0x9d30('0x2c')]){delete _0x324f5b[_0x9d30('0x2c')];}_0x4d8a01['status'](_0x4ae568)['send'](_0x324f5b);};}exports['index']=function(_0x416b57,_0x2bd959){var _0x57e24b={},_0x1831ea={},_0x1d7dd3={'count':0x0,'rows':[]};var _0x3b5481=_['map'](db[_0x9d30('0x2d')][_0x9d30('0x2e')],function(_0x4b5ca7){return{'name':_0x4b5ca7[_0x9d30('0x2f')],'type':_0x4b5ca7['type']['key']};});_0x1831ea[_0x9d30('0x30')]=_[_0x9d30('0x31')](_0x3b5481,_0x9d30('0x2c'));_0x1831ea[_0x9d30('0x32')]=_['keys'](_0x416b57[_0x9d30('0x32')]);_0x1831ea[_0x9d30('0x33')]=_['intersection'](_0x1831ea[_0x9d30('0x30')],_0x1831ea['query']);_0x57e24b[_0x9d30('0x34')]=_[_0x9d30('0x35')](_0x1831ea['model'],qs['fields'](_0x416b57[_0x9d30('0x32')]['fields']));_0x57e24b['attributes']=_0x57e24b[_0x9d30('0x34')][_0x9d30('0x36')]?_0x57e24b[_0x9d30('0x34')]:_0x1831ea[_0x9d30('0x30')];if(!_0x416b57[_0x9d30('0x32')][_0x9d30('0x37')](_0x9d30('0x38'))){_0x57e24b['limit']=qs[_0x9d30('0x21')](_0x416b57[_0x9d30('0x32')][_0x9d30('0x21')]);_0x57e24b[_0x9d30('0x1e')]=qs['offset'](_0x416b57[_0x9d30('0x32')][_0x9d30('0x1e')]);}_0x57e24b[_0x9d30('0x39')]=qs[_0x9d30('0x3a')](_0x416b57[_0x9d30('0x32')]['sort']);_0x57e24b[_0x9d30('0x3b')]=qs[_0x9d30('0x33')](_['pick'](_0x416b57['query'],_0x1831ea[_0x9d30('0x33')]),_0x3b5481);if(_0x416b57[_0x9d30('0x32')][_0x9d30('0x3c')]){_0x57e24b[_0x9d30('0x3b')]=_['merge'](_0x57e24b[_0x9d30('0x3b')],{'$or':_[_0x9d30('0x31')](_0x3b5481,function(_0x4c6c58){if(_0x4c6c58[_0x9d30('0x3d')]!=='VIRTUAL'){var _0x58f0cd={};_0x58f0cd[_0x4c6c58[_0x9d30('0x2c')]]={'$like':'%'+_0x416b57[_0x9d30('0x32')]['filter']+'%'};return _0x58f0cd;}})});}_0x57e24b=_[_0x9d30('0x3e')]({},_0x57e24b,_0x416b57['options']);var _0x943697={'where':_0x57e24b['where']};return db[_0x9d30('0x2d')]['count'](_0x943697)['then'](function(_0x9ae72c){_0x1d7dd3[_0x9d30('0x20')]=_0x9ae72c;if(_0x416b57[_0x9d30('0x32')][_0x9d30('0x3f')]){_0x57e24b[_0x9d30('0x40')]=[{'all':!![]}];}return db[_0x9d30('0x2d')][_0x9d30('0x41')](_0x57e24b);})[_0x9d30('0x26')](function(_0x5cb65d){_0x1d7dd3[_0x9d30('0x42')]=_0x5cb65d;return _0x1d7dd3;})['then'](respondWithFilteredResult(_0x2bd959,_0x57e24b))['catch'](handleError(_0x2bd959,null));};exports[_0x9d30('0x43')]=function(_0x2577e9,_0x514116){var _0x2fa098={'raw':!![],'where':{'id':_0x2577e9[_0x9d30('0x44')]['id']}},_0xe2d657={};_0xe2d657[_0x9d30('0x30')]=_['keys'](db[_0x9d30('0x2d')]['rawAttributes']);_0xe2d657[_0x9d30('0x32')]=_[_0x9d30('0x45')](_0x2577e9[_0x9d30('0x32')]);_0xe2d657[_0x9d30('0x33')]=_[_0x9d30('0x35')](_0xe2d657[_0x9d30('0x30')],_0xe2d657[_0x9d30('0x32')]);_0x2fa098[_0x9d30('0x34')]=_[_0x9d30('0x35')](_0xe2d657[_0x9d30('0x30')],qs[_0x9d30('0x46')](_0x2577e9[_0x9d30('0x32')][_0x9d30('0x46')]));_0x2fa098[_0x9d30('0x34')]=_0x2fa098[_0x9d30('0x34')][_0x9d30('0x36')]?_0x2fa098[_0x9d30('0x34')]:_0xe2d657[_0x9d30('0x30')];if(_0x2577e9['query'][_0x9d30('0x3f')]){_0x2fa098[_0x9d30('0x40')]=[{'all':!![]}];}_0x2fa098=_[_0x9d30('0x3e')]({},_0x2fa098,_0x2577e9[_0x9d30('0x47')]);return db[_0x9d30('0x2d')][_0x9d30('0x48')](_0x2fa098)['then'](handleEntityNotFound(_0x514116,null))[_0x9d30('0x26')](respondWithResult(_0x514116,null))[_0x9d30('0x49')](handleError(_0x514116,null));};exports['create']=function(_0x5103ea,_0x479a59){return db['Interval']['create'](_0x5103ea[_0x9d30('0x4a')],{})[_0x9d30('0x26')](function(_0x1484ea){var _0x349e79=_0x5103ea['user']['get']({'plain':!![]});if(!_0x349e79)throw new Error(_0x9d30('0x4b'));if(_0x349e79[_0x9d30('0x4c')]===_0x9d30('0x4d')){var _0x10b1ca=_0x1484ea[_0x9d30('0x28')]({'plain':!![]});var _0x4ca225=_0x9d30('0x29');return db['UserProfileSection'][_0x9d30('0x48')]({'where':{'name':_0x4ca225,'userProfileId':_0x349e79[_0x9d30('0x4e')]},'raw':!![]})['then'](function(_0x5bbb71){if(_0x5bbb71&&_0x5bbb71[_0x9d30('0x4f')]===0x0){return db['UserProfileResource'][_0x9d30('0x50')]({'name':_0x10b1ca[_0x9d30('0x2c')],'resourceId':_0x10b1ca['id'],'type':_0x5bbb71[_0x9d30('0x2c')],'sectionId':_0x5bbb71['id']},{})[_0x9d30('0x26')](function(){return _0x1484ea;});}else{return _0x1484ea;}})['catch'](function(_0x29b55f){logger[_0x9d30('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29b55f);throw _0x29b55f;});}return _0x1484ea;})[_0x9d30('0x26')](respondWithResult(_0x479a59,0xc9))[_0x9d30('0x49')](handleError(_0x479a59,null));};exports['update']=function(_0x8ee47,_0x29ffdb){if(_0x8ee47[_0x9d30('0x4a')]['id']){delete _0x8ee47['body']['id'];}return db['Interval'][_0x9d30('0x48')]({'where':{'id':_0x8ee47[_0x9d30('0x44')]['id']}})['then'](handleEntityNotFound(_0x29ffdb,null))[_0x9d30('0x26')](saveUpdates(_0x8ee47['body'],null))[_0x9d30('0x26')](respondWithResult(_0x29ffdb,null))['catch'](handleError(_0x29ffdb,null));};exports[_0x9d30('0x27')]=function(_0x1414a2,_0x6dd097){return db[_0x9d30('0x2d')][_0x9d30('0x48')]({'where':{'id':_0x1414a2[_0x9d30('0x44')]['id']}})[_0x9d30('0x26')](handleEntityNotFound(_0x6dd097,null))['then'](removeEntity(_0x6dd097,null))[_0x9d30('0x49')](handleError(_0x6dd097,null));};exports['addInterval']=function(_0x3536ca,_0x5d3183,_0x4795a7){if(_0x3536ca['body']['id']){delete _0x3536ca[_0x9d30('0x4a')]['id'];}return db[_0x9d30('0x2d')]['find']({'where':{'id':_0x3536ca[_0x9d30('0x44')]['id']}})[_0x9d30('0x26')](handleEntityNotFound(_0x5d3183,null))['then'](function(_0x50ddcc){if(_0x50ddcc){_0x3536ca[_0x9d30('0x4a')][_0x9d30('0x52')]=_0x50ddcc['id'];return db[_0x9d30('0x2d')][_0x9d30('0x50')](_0x3536ca[_0x9d30('0x4a')]);}})['then'](respondWithResult(_0x5d3183,null))[_0x9d30('0x49')](handleError(_0x5d3183,null));};exports[_0x9d30('0x53')]=function(_0x25eebf,_0x243c6d,_0x23611d){var _0x3ea63a={};var _0x2e0409={};var _0x33a461;var _0x526f69;return db[_0x9d30('0x2d')][_0x9d30('0x54')]({'where':{'id':_0x25eebf[_0x9d30('0x44')]['id']}})['then'](handleEntityNotFound(_0x243c6d,null))[_0x9d30('0x26')](function(_0x447030){if(_0x447030){_0x33a461=_0x447030;_0x2e0409[_0x9d30('0x30')]=_[_0x9d30('0x45')](db['Interval'][_0x9d30('0x2e')]);_0x2e0409[_0x9d30('0x32')]=_['keys'](_0x25eebf[_0x9d30('0x32')]);_0x2e0409[_0x9d30('0x33')]=_['intersection'](_0x2e0409[_0x9d30('0x30')],_0x2e0409[_0x9d30('0x32')]);_0x3ea63a[_0x9d30('0x34')]=_[_0x9d30('0x35')](_0x2e0409[_0x9d30('0x30')],qs['fields'](_0x25eebf['query']['fields']));_0x3ea63a['attributes']=_0x3ea63a[_0x9d30('0x34')][_0x9d30('0x36')]?_0x3ea63a[_0x9d30('0x34')]:_0x2e0409[_0x9d30('0x30')];_0x3ea63a[_0x9d30('0x39')]=qs[_0x9d30('0x3a')](_0x25eebf[_0x9d30('0x32')][_0x9d30('0x3a')]);_0x3ea63a[_0x9d30('0x3b')]=qs[_0x9d30('0x33')](_[_0x9d30('0x55')](_0x25eebf[_0x9d30('0x32')],_0x2e0409[_0x9d30('0x33')]));if(_0x25eebf[_0x9d30('0x32')][_0x9d30('0x3c')]){_0x3ea63a[_0x9d30('0x3b')]=_[_0x9d30('0x3e')](_0x3ea63a[_0x9d30('0x3b')],{'$or':_['map'](_0x3ea63a[_0x9d30('0x34')],function(_0x4fd111){var _0x571cd7={};_0x571cd7[_0x4fd111]={'$like':'%'+_0x25eebf[_0x9d30('0x32')][_0x9d30('0x3c')]+'%'};return _0x571cd7;})});}_0x3ea63a=_['merge']({},_0x3ea63a,_0x25eebf[_0x9d30('0x47')]);return _0x33a461[_0x9d30('0x53')](_0x3ea63a);}})['then'](function(_0x4c7f49){if(_0x4c7f49){_0x526f69=_0x4c7f49['length'];if(!_0x25eebf[_0x9d30('0x32')][_0x9d30('0x37')](_0x9d30('0x38'))){_0x3ea63a[_0x9d30('0x21')]=qs[_0x9d30('0x21')](_0x25eebf[_0x9d30('0x32')][_0x9d30('0x21')]);_0x3ea63a['offset']=qs[_0x9d30('0x1e')](_0x25eebf[_0x9d30('0x32')]['offset']);}return _0x33a461[_0x9d30('0x53')](_0x3ea63a);}})[_0x9d30('0x26')](function(_0x20689b){if(_0x20689b){return _0x20689b?{'count':_0x526f69,'rows':_0x20689b}:null;}})[_0x9d30('0x26')](respondWithResult(_0x243c6d,null))[_0x9d30('0x49')](handleError(_0x243c6d,null));};exports['addIntervals']=function(_0x5005d3,_0x22a80a,_0x6a9d99){return db[_0x9d30('0x2d')][_0x9d30('0x54')]({'where':{'id':_0x5005d3[_0x9d30('0x44')]['id']}})['then'](handleEntityNotFound(_0x22a80a,null))[_0x9d30('0x26')](function(_0x2be135){if(_0x2be135){return db[_0x9d30('0x56')]['transaction'](function(_0x25796a){return db[_0x9d30('0x2d')][_0x9d30('0x27')]({'where':{'IntervalId':_0x5005d3['params']['id']},'transaction':_0x25796a})['then'](function(_0x1c9f42){var _0x48180f=_[_0x9d30('0x31')](_0x5005d3[_0x9d30('0x4a')],function(_0x1535fa){delete _0x1535fa['id'];_0x1535fa['IntervalId']=_0x5005d3[_0x9d30('0x44')]['id'];return _0x1535fa;});return db[_0x9d30('0x2d')]['bulkCreate'](_0x48180f,{'transaction':_0x25796a});});})[_0x9d30('0x26')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x5005d3[_0x9d30('0x44')]['id']}});});}})[_0x9d30('0x26')](respondWithResult(_0x22a80a,null))['catch'](handleError(_0x22a80a,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 71855b8..155fba4 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 _0xb02d=['tools_intervals','rewrite','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./interval.attributes','Interval'];(function(_0x58dcbf,_0x27e7a4){var _0x2ca9e6=function(_0x85ef15){while(--_0x85ef15){_0x58dcbf['push'](_0x58dcbf['shift']());}};_0x2ca9e6(++_0x27e7a4);}(_0xb02d,0x188));var _0xdb02=function(_0x696757,_0x304036){_0x696757=_0x696757-0x0;var _0x144cc6=_0xb02d[_0x696757];return _0x144cc6;};'use strict';var _=require('lodash');var util=require(_0xdb02('0x0'));var logger=require(_0xdb02('0x1'))(_0xdb02('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdb02('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb02('0x4'));var config=require(_0xdb02('0x5'));var attributes=require(_0xdb02('0x6'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0x4b8877,_0x3e6fcb){return _0x4b8877['define'](_0xdb02('0x7'),attributes,{'tableName':_0xdb02('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x38d650,_0x1d2c76){extensions[_0xdb02('0x9')](_0x4b8877,_0x38d650);},'afterBulkCreate':function(_0x596157,_0x3b201d,_0x313c5){_0x313c5();extensions[_0xdb02('0x9')](_0x4b8877,_0x596157[0x0]);},'afterUpdate':function(_0x4fa493,_0x3e75d4){extensions['rewrite'](_0x4b8877,_0x4fa493);},'afterDestroy':function(_0x21629b,_0x16f76f){extensions['rewrite'](_0x4b8877,_0x21629b);}}});}; \ No newline at end of file +var _0x49c1=['../../config/logger','api','moment','request-promise','path','../../config/environment','./interval.attributes','exports','define','tools_intervals','rewrite','lodash'];(function(_0x387ddb,_0x6af1b7){var _0x288939=function(_0x1cef11){while(--_0x1cef11){_0x387ddb['push'](_0x387ddb['shift']());}};_0x288939(++_0x6af1b7);}(_0x49c1,0xef));var _0x149c=function(_0x269d86,_0x549d58){_0x269d86=_0x269d86-0x0;var _0x1b0470=_0x49c1[_0x269d86];return _0x1b0470;};'use strict';var _=require(_0x149c('0x0'));var util=require('util');var logger=require(_0x149c('0x1'))(_0x149c('0x2'));var moment=require(_0x149c('0x3'));var BPromise=require('bluebird');var rp=require(_0x149c('0x4'));var fs=require('fs');var path=require(_0x149c('0x5'));var rimraf=require('rimraf');var config=require(_0x149c('0x6'));var attributes=require(_0x149c('0x7'));var extensions=require('../../components/extensions/rewrite');module[_0x149c('0x8')]=function(_0x561d00,_0x33fa87){return _0x561d00[_0x149c('0x9')]('Interval',attributes,{'tableName':_0x149c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xfe0da6,_0x54bcc5){extensions[_0x149c('0xb')](_0x561d00,_0xfe0da6);},'afterBulkCreate':function(_0x350050,_0x486451,_0x3dc08d){_0x3dc08d();extensions[_0x149c('0xb')](_0x561d00,_0x350050[0x0]);},'afterUpdate':function(_0x44941e,_0x2c0c8b){extensions['rewrite'](_0x561d00,_0x44941e);},'afterDestroy':function(_0x307cb3,_0x172440){extensions[_0x149c('0xb')](_0x561d00,_0x307cb3);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index c49378a..8fb84bb 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 _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 31bd9b6..13da294 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(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x474f47,_0x2303b7){var _0x21bfe6=function(_0x1121d1){while(--_0x1121d1){_0x474f47['push'](_0x474f47['shift']());}};_0x21bfe6(++_0x2303b7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5c2c45,_0x14cc73){_0x5c2c45=_0x5c2c45-0x0;var _0x44e8dc=_0x5f2f[_0x5c2c45];return _0x44e8dc;};'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')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 4bc1abb..0d78961 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 _0x240c=['end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','headers','remoteAddress','body','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','description','stringify','Bug','fields','customfield_11500','customfield_11501','oldToken','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','request','setEncoding','utf8','data'];(function(_0x5ea73e,_0x485a82){var _0x3ad685=function(_0x285898){while(--_0x285898){_0x5ea73e['push'](_0x5ea73e['shift']());}};_0x3ad685(++_0x485a82);}(_0x240c,0x91));var _0xc240=function(_0x1b968c,_0x3346b0){_0x1b968c=_0x1b968c-0x0;var _0x1262f8=_0x240c[_0x1b968c];return _0x1262f8;};'use strict';var BPromise=require(_0xc240('0x0'));var https=require(_0xc240('0x1'));var logger=require(_0xc240('0x2'))(_0xc240('0x3'));var USERNAME=_0xc240('0x4');var PASSWORD=_0xc240('0x5');function openIssue(_0x27d9c7,_0x505433){var _0x56df36={'fields':{'project':{'key':_0x27d9c7[_0xc240('0x6')]||_0xc240('0x7')},'summary':(_0x27d9c7[_0xc240('0x8')]||_0xc240('0x9'))+'\x20from\x20'+_0x27d9c7['ip'],'description':_0x27d9c7[_0xc240('0xa')]||JSON[_0xc240('0xb')](_0x27d9c7),'issuetype':{'name':_0x27d9c7['issuetype']||_0xc240('0xc')}}};_0x56df36[_0xc240('0xd')][_0xc240('0xe')]=_0x27d9c7['email'];_0x56df36[_0xc240('0xd')][_0xc240('0xf')]=_0x27d9c7[_0xc240('0x10')];_0x56df36['fields']['customfield_11502']=_0x27d9c7[_0xc240('0x11')];_0x56df36['fields']['customfield_11503']=_0x27d9c7[_0xc240('0x12')];_0x56df36[_0xc240('0xd')][_0xc240('0x13')]=_0x27d9c7[_0xc240('0x14')];_0x56df36[_0xc240('0xd')][_0xc240('0x15')]=_0x27d9c7['ip'];var _0x208314={'host':_0xc240('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xc240('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0xc240('0x18'),'Authorization':_0xc240('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xc240('0x1a')]('base64')}};var _0x69f49f=JSON[_0xc240('0xb')](_0x56df36);var _0x469eda=https[_0xc240('0x1b')](_0x208314,function(_0x2cbcd6){_0x2cbcd6[_0xc240('0x1c')](_0xc240('0x1d'));var _0x4aaedd='';_0x2cbcd6['on'](_0xc240('0x1e'),function(_0x1e8489){_0x4aaedd+=_0x1e8489;});_0x2cbcd6['on'](_0xc240('0x1f'),function(){if(_0x505433){return _0x505433[_0xc240('0x20')](_0x2cbcd6[_0xc240('0x21')])[_0xc240('0x22')](JSON[_0xc240('0x23')](_0x4aaedd));}});});_0x469eda['on'](_0xc240('0x24'),function(_0x489d5c){if(_0x505433){return _0x505433[_0xc240('0x20')](0x1f4)['json']({'errors':[{'message':_0xc240('0x25'),'type':_0xc240('0x26')}]});}});_0x469eda[_0xc240('0x27')](_0x69f49f);_0x469eda['end']();}exports[_0xc240('0x28')]=openIssue;exports['send']=function(_0x5a9e89,_0x50d6f9){_0x5a9e89['body']['ip']=_0x5a9e89[_0xc240('0x29')]['x-forwarded-for']||_0x5a9e89['connection'][_0xc240('0x2a')]||_0x5a9e89['socket']['remoteAddress']||_0x5a9e89['connection']['socket']['remoteAddress'];return openIssue(_0x5a9e89[_0xc240('0x2b')],_0x50d6f9);}; \ No newline at end of file +var _0xec8a=['../../config/logger','api','support','3eAmWpBVP0','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','newToken','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','base64','request','data','end','status','statusCode','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','connection','socket','remoteAddress','bluebird','https'];(function(_0x50e97b,_0xf85ac8){var _0x1caf44=function(_0x5db84a){while(--_0x5db84a){_0x50e97b['push'](_0x50e97b['shift']());}};_0x1caf44(++_0xf85ac8);}(_0xec8a,0x124));var _0xaec8=function(_0x41e771,_0xb6f77c){_0x41e771=_0x41e771-0x0;var _0x17b517=_0xec8a[_0x41e771];return _0x17b517;};'use strict';var BPromise=require(_0xaec8('0x0'));var https=require(_0xaec8('0x1'));var logger=require(_0xaec8('0x2'))(_0xaec8('0x3'));var USERNAME=_0xaec8('0x4');var PASSWORD=_0xaec8('0x5');function openIssue(_0x1210bd,_0x43b251){var _0x1e87a4={'fields':{'project':{'key':_0x1210bd['key']||_0xaec8('0x6')},'summary':(_0x1210bd['summary']||_0xaec8('0x7'))+_0xaec8('0x8')+_0x1210bd['ip'],'description':_0x1210bd[_0xaec8('0x9')]||JSON[_0xaec8('0xa')](_0x1210bd),'issuetype':{'name':_0x1210bd[_0xaec8('0xb')]||'Bug'}}};_0x1e87a4[_0xaec8('0xc')][_0xaec8('0xd')]=_0x1210bd[_0xaec8('0xe')];_0x1e87a4[_0xaec8('0xc')][_0xaec8('0xf')]=_0x1210bd['oldToken'];_0x1e87a4[_0xaec8('0xc')]['customfield_11502']=_0x1210bd[_0xaec8('0x10')];_0x1e87a4[_0xaec8('0xc')][_0xaec8('0x11')]=_0x1210bd['name'];_0x1e87a4[_0xaec8('0xc')][_0xaec8('0x12')]=_0x1210bd[_0xaec8('0x13')];_0x1e87a4['fields'][_0xaec8('0x14')]=_0x1210bd['ip'];var _0x34ec04={'host':_0xaec8('0x15'),'port':0x1bb,'path':_0xaec8('0x16'),'method':_0xaec8('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xaec8('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xaec8('0x19')](_0xaec8('0x1a'))}};var _0x1edb7b=JSON[_0xaec8('0xa')](_0x1e87a4);var _0x136714=https[_0xaec8('0x1b')](_0x34ec04,function(_0x349120){_0x349120['setEncoding']('utf8');var _0x142806='';_0x349120['on'](_0xaec8('0x1c'),function(_0x44fd5f){_0x142806+=_0x44fd5f;});_0x349120['on'](_0xaec8('0x1d'),function(){if(_0x43b251){return _0x43b251[_0xaec8('0x1e')](_0x349120[_0xaec8('0x1f')])['json'](JSON['parse'](_0x142806));}});});_0x136714['on']('error',function(_0x40dbf2){if(_0x43b251){return _0x43b251['status'](0x1f4)[_0xaec8('0x20')]({'errors':[{'message':_0xaec8('0x21'),'type':_0xaec8('0x22')}]});}});_0x136714[_0xaec8('0x23')](_0x1edb7b);_0x136714[_0xaec8('0x1d')]();}exports[_0xaec8('0x24')]=openIssue;exports[_0xaec8('0x25')]=function(_0x5df134,_0x204f47){_0x5df134[_0xaec8('0x26')]['ip']=_0x5df134['headers']['x-forwarded-for']||_0x5df134[_0xaec8('0x27')]['remoteAddress']||_0x5df134[_0xaec8('0x28')][_0xaec8('0x29')]||_0x5df134[_0xaec8('0x27')][_0xaec8('0x28')][_0xaec8('0x29')];return openIssue(_0x5df134['body'],_0x204f47);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index f84794e..559d2be 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 _0xcb91=['get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller'];(function(_0x43ec26,_0x45369d){var _0x59cbad=function(_0x3879c0){while(--_0x3879c0){_0x43ec26['push'](_0x43ec26['shift']());}};_0x59cbad(++_0x45369d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0xcb91[_0x1fb4e1];return _0x22d1b0;};'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');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9bde=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','util','connect-timeout','Router'];(function(_0x4c87d8,_0x590f51){var _0x286a0e=function(_0x5ba47e){while(--_0x5ba47e){_0x4c87d8['push'](_0x4c87d8['shift']());}};_0x286a0e(++_0x590f51);}(_0x9bde,0xe1));var _0xe9bd=function(_0x290733,_0x503a42){_0x290733=_0x290733-0x0;var _0x6ddb2e=_0x9bde[_0x290733];return _0x6ddb2e;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var fs_extra=require(_0xe9bd('0x3'));var auth=require(_0xe9bd('0x4'));var interaction=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var controller=require(_0xe9bd('0x7'));router[_0xe9bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9bd('0x9')]);router[_0xe9bd('0x8')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0x8')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xe')]);router[_0xe9bd('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe9bd('0x10')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller['update']);router[_0xe9bd('0x11')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index eea7e46..f8a0606 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7a54,0x106));var _0x47a5=function(_0x4ac556,_0x1f8b0c){_0x4ac556=_0x4ac556-0x0;var _0x5a3850=_0x7a54[_0x4ac556];return _0x5a3850;};'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(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x7a54,0x106));var _0x47a5=function(_0x4dab63,_0x4e1903){_0x4dab63=_0x4dab63-0x0;var _0x405814=_0x7a54[_0x4dab63];return _0x405814;};'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 ea214be..ec641e9 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 _0xc3a8=['includeAll','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','index','map','JscriptyAnswerReport','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xc3a8,0xe8));var _0x8c3a=function(_0x3060e3,_0x14f2c6){_0x3060e3=_0x3060e3-0x0;var _0x497d2c=_0xc3a8[_0x3060e3];return _0x497d2c;};'use strict';var emlformat=require(_0x8c3a('0x0'));var rimraf=require(_0x8c3a('0x1'));var zipdir=require(_0x8c3a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c3a('0x3'));var moment=require('moment');var BPromise=require(_0x8c3a('0x4'));var Mustache=require(_0x8c3a('0x5'));var util=require(_0x8c3a('0x6'));var path=require(_0x8c3a('0x7'));var sox=require('sox');var csv=require(_0x8c3a('0x8'));var ejs=require(_0x8c3a('0x9'));var fs=require('fs');var fs_extra=require(_0x8c3a('0xa'));var _=require(_0x8c3a('0xb'));var squel=require(_0x8c3a('0xc'));var crypto=require(_0x8c3a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8c3a('0xe'));var toCsv=require(_0x8c3a('0x8'));var querystring=require(_0x8c3a('0xf'));var Papa=require(_0x8c3a('0x10'));var Redis=require(_0x8c3a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c3a('0x12'));var as=require(_0x8c3a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c3a('0x14'))(_0x8c3a('0x15'));var utils=require(_0x8c3a('0x16'));var config=require(_0x8c3a('0x17'));var licenseUtil=require(_0x8c3a('0x18'));var db=require(_0x8c3a('0x19'))['db'];function respondWithStatusCode(_0x5eb124,_0x99edce){_0x99edce=_0x99edce||0xcc;return function(_0x57e0ec){if(_0x57e0ec){return _0x5eb124['sendStatus'](_0x99edce);}return _0x5eb124[_0x8c3a('0x1a')](_0x99edce)[_0x8c3a('0x1b')]();};}function respondWithResult(_0x271d3d,_0x31f3d4){_0x31f3d4=_0x31f3d4||0xc8;return function(_0x290298){if(_0x290298){return _0x271d3d[_0x8c3a('0x1a')](_0x31f3d4)[_0x8c3a('0x1c')](_0x290298);}};}function respondWithFilteredResult(_0x513e00,_0x43b853){return function(_0x5be4ea){if(_0x5be4ea){var _0x1d8b7b=typeof _0x43b853[_0x8c3a('0x1d')]===_0x8c3a('0x1e')&&typeof _0x43b853[_0x8c3a('0x1f')]===_0x8c3a('0x1e');var _0x54fe05=_0x5be4ea['count'];var _0x51acdb=_0x1d8b7b?0x0:_0x43b853['offset'];var _0x29502b=_0x1d8b7b?_0x5be4ea[_0x8c3a('0x20')]:_0x43b853[_0x8c3a('0x1d')]+_0x43b853[_0x8c3a('0x1f')];var _0x365ab8;if(_0x29502b>=_0x54fe05){_0x29502b=_0x54fe05;_0x365ab8=0xc8;}else{_0x365ab8=0xce;}_0x513e00[_0x8c3a('0x1a')](_0x365ab8);return _0x513e00['set'](_0x8c3a('0x21'),_0x51acdb+'-'+_0x29502b+'/'+_0x54fe05)[_0x8c3a('0x1c')](_0x5be4ea);}return null;};}function patchUpdates(_0x4f77df){return function(_0x1590a7){try{jsonpatch['apply'](_0x1590a7,_0x4f77df,!![]);}catch(_0x3efbc4){return BPromise[_0x8c3a('0x22')](_0x3efbc4);}return _0x1590a7[_0x8c3a('0x23')]();};}function saveUpdates(_0x58ca7a,_0x429ca6){return function(_0xb78cfc){if(_0xb78cfc){return _0xb78cfc[_0x8c3a('0x24')](_0x58ca7a)[_0x8c3a('0x25')](function(_0x718982){return _0x718982;});}return null;};}function removeEntity(_0x3c5f12,_0x427917){return function(_0x5546c3){if(_0x5546c3){return _0x5546c3[_0x8c3a('0x26')]()['then'](function(){_0x3c5f12[_0x8c3a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb9f4bf,_0xe50c44){return function(_0x530e9c){if(!_0x530e9c){_0xb9f4bf[_0x8c3a('0x27')](0x194);}return _0x530e9c;};}function handleError(_0x4a1c24,_0x9cc5a8){_0x9cc5a8=_0x9cc5a8||0x1f4;return function(_0x295fb9){logger[_0x8c3a('0x28')](_0x295fb9['stack']);if(_0x295fb9['name']){delete _0x295fb9[_0x8c3a('0x29')];}_0x4a1c24[_0x8c3a('0x1a')](_0x9cc5a8)['send'](_0x295fb9);};}exports[_0x8c3a('0x2a')]=function(_0x2f77b1,_0x4ae1e4){var _0xd5353d={},_0x31cad9={},_0x3d6fd5={'count':0x0,'rows':[]};var _0x48d1f8=_[_0x8c3a('0x2b')](db[_0x8c3a('0x2c')]['rawAttributes'],function(_0x3ba072){return{'name':_0x3ba072[_0x8c3a('0x2d')],'type':_0x3ba072['type'][_0x8c3a('0x2e')]};});_0x31cad9[_0x8c3a('0x2f')]=_[_0x8c3a('0x2b')](_0x48d1f8,'name');_0x31cad9[_0x8c3a('0x30')]=_[_0x8c3a('0x31')](_0x2f77b1[_0x8c3a('0x30')]);_0x31cad9[_0x8c3a('0x32')]=_['intersection'](_0x31cad9['model'],_0x31cad9[_0x8c3a('0x30')]);_0xd5353d[_0x8c3a('0x33')]=_[_0x8c3a('0x34')](_0x31cad9[_0x8c3a('0x2f')],qs[_0x8c3a('0x35')](_0x2f77b1['query'][_0x8c3a('0x35')]));_0xd5353d[_0x8c3a('0x33')]=_0xd5353d[_0x8c3a('0x33')][_0x8c3a('0x36')]?_0xd5353d[_0x8c3a('0x33')]:_0x31cad9['model'];if(!_0x2f77b1[_0x8c3a('0x30')]['hasOwnProperty'](_0x8c3a('0x37'))){_0xd5353d['limit']=qs[_0x8c3a('0x1f')](_0x2f77b1['query'][_0x8c3a('0x1f')]);_0xd5353d[_0x8c3a('0x1d')]=qs[_0x8c3a('0x1d')](_0x2f77b1[_0x8c3a('0x30')]['offset']);}_0xd5353d[_0x8c3a('0x38')]=qs[_0x8c3a('0x39')](_0x2f77b1[_0x8c3a('0x30')]['sort']);_0xd5353d[_0x8c3a('0x3a')]=qs[_0x8c3a('0x32')](_[_0x8c3a('0x3b')](_0x2f77b1[_0x8c3a('0x30')],_0x31cad9[_0x8c3a('0x32')]),_0x48d1f8);if(_0x2f77b1[_0x8c3a('0x30')][_0x8c3a('0x3c')]){_0xd5353d[_0x8c3a('0x3a')]=_[_0x8c3a('0x3d')](_0xd5353d[_0x8c3a('0x3a')],{'$or':_[_0x8c3a('0x2b')](_0x48d1f8,function(_0x582cdc){if(_0x582cdc[_0x8c3a('0x3e')]!==_0x8c3a('0x3f')){var _0x14d710={};_0x14d710[_0x582cdc['name']]={'$like':'%'+_0x2f77b1[_0x8c3a('0x30')]['filter']+'%'};return _0x14d710;}})});}_0xd5353d=_[_0x8c3a('0x3d')]({},_0xd5353d,_0x2f77b1['options']);var _0xaf4959={'where':_0xd5353d[_0x8c3a('0x3a')]};return db['JscriptyAnswerReport'][_0x8c3a('0x20')](_0xaf4959)[_0x8c3a('0x25')](function(_0x34926e){_0x3d6fd5[_0x8c3a('0x20')]=_0x34926e;if(_0x2f77b1[_0x8c3a('0x30')][_0x8c3a('0x40')]){_0xd5353d['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x8c3a('0x41')](_0xd5353d);})[_0x8c3a('0x25')](function(_0x1e14cc){_0x3d6fd5[_0x8c3a('0x42')]=_0x1e14cc;return _0x3d6fd5;})['then'](respondWithFilteredResult(_0x4ae1e4,_0xd5353d))[_0x8c3a('0x43')](handleError(_0x4ae1e4,null));};exports['show']=function(_0x1ad084,_0x5ebaf5){var _0x7e7e08={'raw':!![],'where':{'id':_0x1ad084[_0x8c3a('0x44')]['id']}},_0x55c1d5={};_0x55c1d5[_0x8c3a('0x2f')]=_[_0x8c3a('0x31')](db[_0x8c3a('0x2c')][_0x8c3a('0x45')]);_0x55c1d5[_0x8c3a('0x30')]=_['keys'](_0x1ad084['query']);_0x55c1d5[_0x8c3a('0x32')]=_[_0x8c3a('0x34')](_0x55c1d5[_0x8c3a('0x2f')],_0x55c1d5['query']);_0x7e7e08[_0x8c3a('0x33')]=_[_0x8c3a('0x34')](_0x55c1d5[_0x8c3a('0x2f')],qs['fields'](_0x1ad084[_0x8c3a('0x30')][_0x8c3a('0x35')]));_0x7e7e08[_0x8c3a('0x33')]=_0x7e7e08[_0x8c3a('0x33')]['length']?_0x7e7e08[_0x8c3a('0x33')]:_0x55c1d5[_0x8c3a('0x2f')];if(_0x1ad084['query'][_0x8c3a('0x40')]){_0x7e7e08['include']=[{'all':!![]}];}_0x7e7e08=_['merge']({},_0x7e7e08,_0x1ad084['options']);return db[_0x8c3a('0x2c')][_0x8c3a('0x46')](_0x7e7e08)[_0x8c3a('0x25')](handleEntityNotFound(_0x5ebaf5,null))[_0x8c3a('0x25')](respondWithResult(_0x5ebaf5,null))[_0x8c3a('0x43')](handleError(_0x5ebaf5,null));};exports[_0x8c3a('0x47')]=function(_0xba973c,_0x16d669){return db[_0x8c3a('0x2c')][_0x8c3a('0x47')](_0xba973c[_0x8c3a('0x48')],{})['then'](respondWithResult(_0x16d669,0xc9))[_0x8c3a('0x43')](handleError(_0x16d669,null));};exports[_0x8c3a('0x24')]=function(_0xe3566b,_0x2b156c){if(_0xe3566b[_0x8c3a('0x48')]['id']){delete _0xe3566b[_0x8c3a('0x48')]['id'];}return db[_0x8c3a('0x2c')][_0x8c3a('0x46')]({'where':{'id':_0xe3566b[_0x8c3a('0x44')]['id']}})[_0x8c3a('0x25')](handleEntityNotFound(_0x2b156c,null))[_0x8c3a('0x25')](saveUpdates(_0xe3566b['body'],null))[_0x8c3a('0x25')](respondWithResult(_0x2b156c,null))[_0x8c3a('0x43')](handleError(_0x2b156c,null));};exports[_0x8c3a('0x26')]=function(_0x24e2c6,_0x15e6cb){return db[_0x8c3a('0x2c')][_0x8c3a('0x46')]({'where':{'id':_0x24e2c6[_0x8c3a('0x44')]['id']}})[_0x8c3a('0x25')](handleEntityNotFound(_0x15e6cb,null))['then'](removeEntity(_0x15e6cb,null))[_0x8c3a('0x43')](handleError(_0x15e6cb,null));};exports[_0x8c3a('0x49')]=function(_0x2eceb3,_0x339652){return db['JscriptyAnswerReport'][_0x8c3a('0x49')]()['then'](respondWithResult(_0x339652,null))['catch'](handleError(_0x339652,null));}; \ No newline at end of file +var _0xe7de=['limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','JscriptyAnswerReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','rows','catch','show','params','include','merge','find','create','body','describe','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0xe7de,0x165));var _0xee7d=function(_0x2dac8b,_0x3a8fa7){_0x2dac8b=_0x2dac8b-0x0;var _0x31c7ab=_0xe7de[_0x2dac8b];return _0x31c7ab;};'use strict';var emlformat=require(_0xee7d('0x0'));var rimraf=require(_0xee7d('0x1'));var zipdir=require(_0xee7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xee7d('0x3'));var BPromise=require(_0xee7d('0x4'));var Mustache=require(_0xee7d('0x5'));var util=require(_0xee7d('0x6'));var path=require(_0xee7d('0x7'));var sox=require(_0xee7d('0x8'));var csv=require(_0xee7d('0x9'));var ejs=require(_0xee7d('0xa'));var fs=require('fs');var fs_extra=require(_0xee7d('0xb'));var _=require(_0xee7d('0xc'));var squel=require(_0xee7d('0xd'));var crypto=require(_0xee7d('0xe'));var jsforce=require(_0xee7d('0xf'));var deskjs=require(_0xee7d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xee7d('0x11'));var Papa=require(_0xee7d('0x12'));var Redis=require(_0xee7d('0x13'));var authService=require(_0xee7d('0x14'));var qs=require(_0xee7d('0x15'));var as=require(_0xee7d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee7d('0x17'))('api');var utils=require(_0xee7d('0x18'));var config=require(_0xee7d('0x19'));var licenseUtil=require(_0xee7d('0x1a'));var db=require(_0xee7d('0x1b'))['db'];function respondWithStatusCode(_0xdfb04b,_0xb4c933){_0xb4c933=_0xb4c933||0xcc;return function(_0x3e9daa){if(_0x3e9daa){return _0xdfb04b[_0xee7d('0x1c')](_0xb4c933);}return _0xdfb04b[_0xee7d('0x1d')](_0xb4c933)[_0xee7d('0x1e')]();};}function respondWithResult(_0x41ca24,_0x47eb16){_0x47eb16=_0x47eb16||0xc8;return function(_0x4bfdab){if(_0x4bfdab){return _0x41ca24[_0xee7d('0x1d')](_0x47eb16)[_0xee7d('0x1f')](_0x4bfdab);}};}function respondWithFilteredResult(_0x4ab8a6,_0x1211a1){return function(_0x1a2976){if(_0x1a2976){var _0x1dc47c=typeof _0x1211a1['offset']===_0xee7d('0x20')&&typeof _0x1211a1[_0xee7d('0x21')]===_0xee7d('0x20');var _0x62d1ec=_0x1a2976[_0xee7d('0x22')];var _0x25f3e0=_0x1dc47c?0x0:_0x1211a1['offset'];var _0x152dd6=_0x1dc47c?_0x1a2976[_0xee7d('0x22')]:_0x1211a1[_0xee7d('0x23')]+_0x1211a1['limit'];var _0x277738;if(_0x152dd6>=_0x62d1ec){_0x152dd6=_0x62d1ec;_0x277738=0xc8;}else{_0x277738=0xce;}_0x4ab8a6['status'](_0x277738);return _0x4ab8a6[_0xee7d('0x24')](_0xee7d('0x25'),_0x25f3e0+'-'+_0x152dd6+'/'+_0x62d1ec)[_0xee7d('0x1f')](_0x1a2976);}return null;};}function patchUpdates(_0x4f6445){return function(_0x113a05){try{jsonpatch['apply'](_0x113a05,_0x4f6445,!![]);}catch(_0x20aeaa){return BPromise[_0xee7d('0x26')](_0x20aeaa);}return _0x113a05[_0xee7d('0x27')]();};}function saveUpdates(_0xed4f9f,_0x52eaf4){return function(_0x32ad6e){if(_0x32ad6e){return _0x32ad6e[_0xee7d('0x28')](_0xed4f9f)[_0xee7d('0x29')](function(_0x136a7b){return _0x136a7b;});}return null;};}function removeEntity(_0x33613a,_0x4d0efb){return function(_0x172850){if(_0x172850){return _0x172850[_0xee7d('0x2a')]()[_0xee7d('0x29')](function(){_0x33613a['status'](0xcc)[_0xee7d('0x1e')]();});}};}function handleEntityNotFound(_0x293382,_0x379de9){return function(_0x576d56){if(!_0x576d56){_0x293382[_0xee7d('0x1c')](0x194);}return _0x576d56;};}function handleError(_0x38e6a6,_0x4532cb){_0x4532cb=_0x4532cb||0x1f4;return function(_0x2b9482){logger[_0xee7d('0x2b')](_0x2b9482[_0xee7d('0x2c')]);if(_0x2b9482[_0xee7d('0x2d')]){delete _0x2b9482[_0xee7d('0x2d')];}_0x38e6a6[_0xee7d('0x1d')](_0x4532cb)['send'](_0x2b9482);};}exports[_0xee7d('0x2e')]=function(_0x4e1bf5,_0x5ca947){var _0x2a5b06={},_0x4d4ff0={},_0x151094={'count':0x0,'rows':[]};var _0xc2e2c1=_['map'](db[_0xee7d('0x2f')][_0xee7d('0x30')],function(_0xac47ec){return{'name':_0xac47ec[_0xee7d('0x31')],'type':_0xac47ec[_0xee7d('0x32')]['key']};});_0x4d4ff0[_0xee7d('0x33')]=_[_0xee7d('0x34')](_0xc2e2c1,_0xee7d('0x2d'));_0x4d4ff0[_0xee7d('0x35')]=_[_0xee7d('0x36')](_0x4e1bf5[_0xee7d('0x35')]);_0x4d4ff0[_0xee7d('0x37')]=_[_0xee7d('0x38')](_0x4d4ff0['model'],_0x4d4ff0[_0xee7d('0x35')]);_0x2a5b06[_0xee7d('0x39')]=_[_0xee7d('0x38')](_0x4d4ff0['model'],qs[_0xee7d('0x3a')](_0x4e1bf5['query'][_0xee7d('0x3a')]));_0x2a5b06[_0xee7d('0x39')]=_0x2a5b06['attributes']['length']?_0x2a5b06[_0xee7d('0x39')]:_0x4d4ff0['model'];if(!_0x4e1bf5[_0xee7d('0x35')][_0xee7d('0x3b')](_0xee7d('0x3c'))){_0x2a5b06[_0xee7d('0x21')]=qs[_0xee7d('0x21')](_0x4e1bf5['query']['limit']);_0x2a5b06[_0xee7d('0x23')]=qs['offset'](_0x4e1bf5[_0xee7d('0x35')][_0xee7d('0x23')]);}_0x2a5b06[_0xee7d('0x3d')]=qs[_0xee7d('0x3e')](_0x4e1bf5[_0xee7d('0x35')][_0xee7d('0x3e')]);_0x2a5b06[_0xee7d('0x3f')]=qs[_0xee7d('0x37')](_[_0xee7d('0x40')](_0x4e1bf5[_0xee7d('0x35')],_0x4d4ff0[_0xee7d('0x37')]),_0xc2e2c1);if(_0x4e1bf5[_0xee7d('0x35')]['filter']){_0x2a5b06[_0xee7d('0x3f')]=_['merge'](_0x2a5b06[_0xee7d('0x3f')],{'$or':_[_0xee7d('0x34')](_0xc2e2c1,function(_0x13f7d2){if(_0x13f7d2['type']!==_0xee7d('0x41')){var _0x2944ac={};_0x2944ac[_0x13f7d2[_0xee7d('0x2d')]]={'$like':'%'+_0x4e1bf5['query'][_0xee7d('0x42')]+'%'};return _0x2944ac;}})});}_0x2a5b06=_['merge']({},_0x2a5b06,_0x4e1bf5[_0xee7d('0x43')]);var _0x4a1c11={'where':_0x2a5b06['where']};return db[_0xee7d('0x2f')][_0xee7d('0x22')](_0x4a1c11)[_0xee7d('0x29')](function(_0x281d7d){_0x151094['count']=_0x281d7d;if(_0x4e1bf5[_0xee7d('0x35')]['includeAll']){_0x2a5b06['include']=[{'all':!![]}];}return db[_0xee7d('0x2f')]['findAll'](_0x2a5b06);})[_0xee7d('0x29')](function(_0x527339){_0x151094[_0xee7d('0x44')]=_0x527339;return _0x151094;})[_0xee7d('0x29')](respondWithFilteredResult(_0x5ca947,_0x2a5b06))[_0xee7d('0x45')](handleError(_0x5ca947,null));};exports[_0xee7d('0x46')]=function(_0x55775d,_0x203ec5){var _0x33643d={'raw':!![],'where':{'id':_0x55775d[_0xee7d('0x47')]['id']}},_0x24bb87={};_0x24bb87[_0xee7d('0x33')]=_[_0xee7d('0x36')](db['JscriptyAnswerReport'][_0xee7d('0x30')]);_0x24bb87[_0xee7d('0x35')]=_[_0xee7d('0x36')](_0x55775d[_0xee7d('0x35')]);_0x24bb87['filters']=_[_0xee7d('0x38')](_0x24bb87['model'],_0x24bb87[_0xee7d('0x35')]);_0x33643d['attributes']=_[_0xee7d('0x38')](_0x24bb87[_0xee7d('0x33')],qs[_0xee7d('0x3a')](_0x55775d['query'][_0xee7d('0x3a')]));_0x33643d['attributes']=_0x33643d[_0xee7d('0x39')]['length']?_0x33643d[_0xee7d('0x39')]:_0x24bb87[_0xee7d('0x33')];if(_0x55775d[_0xee7d('0x35')]['includeAll']){_0x33643d[_0xee7d('0x48')]=[{'all':!![]}];}_0x33643d=_[_0xee7d('0x49')]({},_0x33643d,_0x55775d['options']);return db['JscriptyAnswerReport'][_0xee7d('0x4a')](_0x33643d)[_0xee7d('0x29')](handleEntityNotFound(_0x203ec5,null))['then'](respondWithResult(_0x203ec5,null))[_0xee7d('0x45')](handleError(_0x203ec5,null));};exports[_0xee7d('0x4b')]=function(_0x238fbb,_0x48470e){return db['JscriptyAnswerReport'][_0xee7d('0x4b')](_0x238fbb[_0xee7d('0x4c')],{})[_0xee7d('0x29')](respondWithResult(_0x48470e,0xc9))[_0xee7d('0x45')](handleError(_0x48470e,null));};exports[_0xee7d('0x28')]=function(_0xd13c3a,_0x486cfc){if(_0xd13c3a[_0xee7d('0x4c')]['id']){delete _0xd13c3a[_0xee7d('0x4c')]['id'];}return db[_0xee7d('0x2f')][_0xee7d('0x4a')]({'where':{'id':_0xd13c3a[_0xee7d('0x47')]['id']}})[_0xee7d('0x29')](handleEntityNotFound(_0x486cfc,null))[_0xee7d('0x29')](saveUpdates(_0xd13c3a[_0xee7d('0x4c')],null))[_0xee7d('0x29')](respondWithResult(_0x486cfc,null))[_0xee7d('0x45')](handleError(_0x486cfc,null));};exports['destroy']=function(_0x56bc0c,_0x336a1c){return db[_0xee7d('0x2f')][_0xee7d('0x4a')]({'where':{'id':_0x56bc0c[_0xee7d('0x47')]['id']}})[_0xee7d('0x29')](handleEntityNotFound(_0x336a1c,null))[_0xee7d('0x29')](removeEntity(_0x336a1c,null))[_0xee7d('0x45')](handleError(_0x336a1c,null));};exports['describe']=function(_0x1544e7,_0x52c85c){return db[_0xee7d('0x2f')][_0xee7d('0x4d')]()['then'](respondWithResult(_0x52c85c,null))['catch'](handleError(_0x52c85c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index a944394..cf8e74b 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 _0x899e=['request-promise','path','rimraf','../../config/environment','exports','define','JscriptyAnswerReport','util','../../config/logger','moment','bluebird'];(function(_0x5b9ccd,_0x1e9c2f){var _0x5a66e8=function(_0x525426){while(--_0x525426){_0x5b9ccd['push'](_0x5b9ccd['shift']());}};_0x5a66e8(++_0x1e9c2f);}(_0x899e,0xcd));var _0xe899=function(_0x518abc,_0x238628){_0x518abc=_0x518abc-0x0;var _0x304a4d=_0x899e[_0x518abc];return _0x304a4d;};'use strict';var _=require('lodash');var util=require(_0xe899('0x0'));var logger=require(_0xe899('0x1'))('api');var moment=require(_0xe899('0x2'));var BPromise=require(_0xe899('0x3'));var rp=require(_0xe899('0x4'));var fs=require('fs');var path=require(_0xe899('0x5'));var rimraf=require(_0xe899('0x6'));var config=require(_0xe899('0x7'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xe899('0x8')]=function(_0xb96038,_0x259a29){return _0xb96038[_0xe899('0x9')](_0xe899('0xa'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63ed=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','../../config/logger','moment'];(function(_0x3d97bd,_0x4366f1){var _0x13a3f5=function(_0x20f9b2){while(--_0x20f9b2){_0x3d97bd['push'](_0x3d97bd['shift']());}};_0x13a3f5(++_0x4366f1);}(_0x63ed,0x1d2));var _0xd63e=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x63ed[_0x11005e];return _0x29338f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd63e('0x0'))('api');var moment=require(_0xd63e('0x1'));var BPromise=require(_0xd63e('0x2'));var rp=require(_0xd63e('0x3'));var fs=require('fs');var path=require(_0xd63e('0x4'));var rimraf=require(_0xd63e('0x5'));var config=require(_0xd63e('0x6'));var attributes=require(_0xd63e('0x7'));module[_0xd63e('0x8')]=function(_0x3ecec9,_0x590b7b){return _0x3ecec9[_0xd63e('0x9')](_0xd63e('0xa'),attributes,{'tableName':_0xd63e('0xb'),'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 28803c7..8ef1295 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 _0xc40d=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x24dfd2,_0x504fac){var _0x3abda1=function(_0x55bc85){while(--_0x55bc85){_0x24dfd2['push'](_0x24dfd2['shift']());}};_0x3abda1(++_0x504fac);}(_0xc40d,0x197));var _0xdc40=function(_0x448fe6,_0x26ea29){_0x448fe6=_0x448fe6-0x0;var _0x118214=_0xc40d[_0x448fe6];return _0x118214;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdc40('0x0'));var BPromise=require(_0xdc40('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc40('0x2'));var db=require(_0xdc40('0x3'))['db'];var utils=require(_0xdc40('0x4'));var logger=require(_0xdc40('0x5'))('rpc');var config=require(_0xdc40('0x6'));var jayson=require(_0xdc40('0x7'));var client=jayson[_0xdc40('0x8')][_0xdc40('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5740f3,_0x109332,_0x104e5e){return new BPromise(function(_0x4c5603,_0x5ad727){return client['request'](_0x5740f3,_0x104e5e)[_0xdc40('0xa')](function(_0x144d59){logger[_0xdc40('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x109332,_0xdc40('0xc'));logger[_0xdc40('0xd')](_0xdc40('0xe'),_0x109332,'request\x20sent',JSON[_0xdc40('0xf')](_0x144d59));if(_0x144d59[_0xdc40('0x10')]){if(_0x144d59[_0xdc40('0x10')]['code']===0x1f4){logger[_0xdc40('0x10')](_0xdc40('0x11'),_0x109332,_0x144d59[_0xdc40('0x10')][_0xdc40('0x12')]);return _0x5ad727(_0x144d59[_0xdc40('0x10')][_0xdc40('0x12')]);}logger[_0xdc40('0x10')](_0xdc40('0x11'),_0x109332,_0x144d59[_0xdc40('0x10')][_0xdc40('0x12')]);return _0x4c5603(_0x144d59[_0xdc40('0x10')][_0xdc40('0x12')]);}else{logger[_0xdc40('0xb')](_0xdc40('0x11'),_0x109332,_0xdc40('0xc'));_0x4c5603(_0x144d59[_0xdc40('0x13')][_0xdc40('0x12')]);}})[_0xdc40('0x14')](function(_0x14583d){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x109332,_0x14583d);_0x5ad727(_0x14583d);});});} \ No newline at end of file +var _0xb95a=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4dd31a,_0x54046f){var _0x2645cc=function(_0x447a2b){while(--_0x447a2b){_0x4dd31a['push'](_0x4dd31a['shift']());}};_0x2645cc(++_0x54046f);}(_0xb95a,0xea));var _0xab95=function(_0xc893a8,_0x5edd06){_0xc893a8=_0xc893a8-0x0;var _0x18a88a=_0xb95a[_0xc893a8];return _0x18a88a;};'use strict';var _=require(_0xab95('0x0'));var util=require(_0xab95('0x1'));var moment=require(_0xab95('0x2'));var BPromise=require('bluebird');var rs=require(_0xab95('0x3'));var fs=require('fs');var Redis=require(_0xab95('0x4'));var db=require(_0xab95('0x5'))['db'];var utils=require(_0xab95('0x6'));var logger=require('../../config/logger')(_0xab95('0x7'));var config=require(_0xab95('0x8'));var jayson=require(_0xab95('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17fe83,_0x1fe332,_0x1bd1ec){return new BPromise(function(_0x593b61,_0x226190){return client['request'](_0x17fe83,_0x1bd1ec)[_0xab95('0xa')](function(_0x204db){logger[_0xab95('0xb')](_0xab95('0xc'),_0x1fe332,_0xab95('0xd'));logger[_0xab95('0xe')](_0xab95('0xf'),_0x1fe332,'request\x20sent',JSON[_0xab95('0x10')](_0x204db));if(_0x204db[_0xab95('0x11')]){if(_0x204db[_0xab95('0x11')]['code']===0x1f4){logger[_0xab95('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1fe332,_0x204db[_0xab95('0x11')][_0xab95('0x12')]);return _0x226190(_0x204db[_0xab95('0x11')][_0xab95('0x12')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x1fe332,_0x204db['error']['message']);return _0x593b61(_0x204db[_0xab95('0x11')][_0xab95('0x12')]);}else{logger[_0xab95('0xb')](_0xab95('0xc'),_0x1fe332,'request\x20sent');_0x593b61(_0x204db[_0xab95('0x13')][_0xab95('0x12')]);}})[_0xab95('0x14')](function(_0x14a295){logger[_0xab95('0x11')](_0xab95('0xc'),_0x1fe332,_0x14a295);_0x226190(_0x14a295);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index be45831..8b14ed7 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 _0x0542=['/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','post','/:id/clone','clone','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions'];(function(_0x403d78,_0x34fbd5){var _0x9cdb24=function(_0x5672fb){while(--_0x5672fb){_0x403d78['push'](_0x403d78['shift']());}};_0x9cdb24(++_0x34fbd5);}(_0x0542,0x1bc));var _0x2054=function(_0x441819,_0x3f0993){_0x441819=_0x441819-0x0;var _0x7b5f1=_0x0542[_0x441819];return _0x7b5f1;};'use strict';var multer=require(_0x2054('0x0'));var util=require(_0x2054('0x1'));var path=require(_0x2054('0x2'));var timeout=require('connect-timeout');var express=require(_0x2054('0x3'));var router=express[_0x2054('0x4')]();var fs_extra=require(_0x2054('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2054('0x6'));var config=require(_0x2054('0x7'));var controller=require('./jscriptyProject.controller');router[_0x2054('0x8')]('/',auth[_0x2054('0x9')](),controller[_0x2054('0xa')]);router[_0x2054('0x8')](_0x2054('0xb'),auth['isAuthenticated'](),controller[_0x2054('0xc')]);router[_0x2054('0x8')](_0x2054('0xd'),auth[_0x2054('0x9')](),controller[_0x2054('0xe')]);router[_0x2054('0x8')](_0x2054('0xf'),auth[_0x2054('0x9')](),controller[_0x2054('0x10')]);router[_0x2054('0x8')](_0x2054('0x11'),auth[_0x2054('0x9')](),timeout(_0x2054('0x12')),controller[_0x2054('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2054('0x14')]);router[_0x2054('0x15')](_0x2054('0x16'),auth[_0x2054('0x9')](),controller[_0x2054('0x17')]);router['put'](_0x2054('0xb'),auth['isAuthenticated'](),controller[_0x2054('0x18')]);router[_0x2054('0x19')](_0x2054('0xb'),auth[_0x2054('0x9')](),controller[_0x2054('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x333d=['create','post','clone','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary'];(function(_0x45d5ef,_0x10c29b){var _0x474d19=function(_0xc182bf){while(--_0xc182bf){_0x45d5ef['push'](_0x45d5ef['shift']());}};_0x474d19(++_0x10c29b);}(_0x333d,0x9a));var _0xd333=function(_0x2ef644,_0x2ab0ff){_0x2ef644=_0x2ef644-0x0;var _0x11f00e=_0x333d[_0x2ef644];return _0x11f00e;};'use strict';var multer=require(_0xd333('0x0'));var util=require('util');var path=require(_0xd333('0x1'));var timeout=require(_0xd333('0x2'));var express=require(_0xd333('0x3'));var router=express[_0xd333('0x4')]();var fs_extra=require(_0xd333('0x5'));var auth=require(_0xd333('0x6'));var interaction=require(_0xd333('0x7'));var config=require(_0xd333('0x8'));var controller=require(_0xd333('0x9'));router[_0xd333('0xa')]('/',auth[_0xd333('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd333('0xc')]);router[_0xd333('0xa')](_0xd333('0xd'),auth[_0xd333('0xb')](),controller[_0xd333('0xe')]);router[_0xd333('0xa')](_0xd333('0xf'),auth['isAuthenticated'](),controller[_0xd333('0x10')]);router[_0xd333('0xa')](_0xd333('0x11'),auth[_0xd333('0xb')](),timeout(_0xd333('0x12')),controller[_0xd333('0x13')]);router['post']('/',auth[_0xd333('0xb')](),controller[_0xd333('0x14')]);router[_0xd333('0x15')]('/:id/clone',auth[_0xd333('0xb')](),controller[_0xd333('0x16')]);router[_0xd333('0x17')](_0xd333('0x18'),auth[_0xd333('0xb')](),controller[_0xd333('0x19')]);router[_0xd333('0x1a')](_0xd333('0x18'),auth[_0xd333('0xb')](),controller[_0xd333('0x1b')]);module[_0xd333('0x1c')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 74f1b5e..1223039 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 _0x66b9=['sequelize','lodash','STRING','long','isObjectLike','setDataValue','formData','stringify','isString','format','getDataValue','name','description','BOOLEAN'];(function(_0x232d10,_0x58fedc){var _0x4380ac=function(_0x2c8a4c){while(--_0x2c8a4c){_0x232d10['push'](_0x232d10['shift']());}};_0x4380ac(++_0x58fedc);}(_0x66b9,0xa8));var _0x966b=function(_0x34939f,_0x339e2a){_0x34939f=_0x34939f-0x0;var _0x28476e=_0x66b9[_0x34939f];return _0x28476e;};'use strict';var Sequelize=require(_0x966b('0x0'));var _=require(_0x966b('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0x966b('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x966b('0x2')]},'formData':{'type':Sequelize['TEXT'](_0x966b('0x3')),'set':function(_0x14b33f){if(_[_0x966b('0x4')](_0x14b33f)){this[_0x966b('0x5')](_0x966b('0x6'),JSON[_0x966b('0x7')](_0x14b33f));}else if(_[_0x966b('0x8')](_0x14b33f)){this[_0x966b('0x5')](_0x966b('0x6'),_0x14b33f);}else{this['setDataValue'](_0x966b('0x6'),util[_0x966b('0x9')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x966b('0xa')](_0x966b('0xb'))||'',this['getDataValue'](_0x966b('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x966b('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x966b('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0xcd1e=['long','isObjectLike','formData','isString','setDataValue','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT'];(function(_0x460fd7,_0x2012db){var _0x44d1c2=function(_0x545e11){while(--_0x545e11){_0x460fd7['push'](_0x460fd7['shift']());}};_0x44d1c2(++_0x2012db);}(_0xcd1e,0xe8));var _0xecd1=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xcd1e[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0xecd1('0x0'));var _=require(_0xecd1('0x1'));var util=require(_0xecd1('0x2'));module[_0xecd1('0x3')]={'name':{'type':Sequelize[_0xecd1('0x4')],'unique':'name'},'description':{'type':Sequelize[_0xecd1('0x4')]},'formData':{'type':Sequelize[_0xecd1('0x5')](_0xecd1('0x6')),'set':function(_0x314881){if(_[_0xecd1('0x7')](_0x314881)){this['setDataValue'](_0xecd1('0x8'),JSON['stringify'](_0x314881));}else if(_[_0xecd1('0x9')](_0x314881)){this[_0xecd1('0xa')](_0xecd1('0x8'),_0x314881);}else{this[_0xecd1('0xa')](_0xecd1('0x8'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xecd1('0xb')]('name')||'',this[_0xecd1('0xb')](_0xecd1('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xecd1('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xecd1('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 613e89d..58e4901 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 _0x63a2=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','getSessions','findOne','order','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','fromCharCode','indexOf','toString','replace','startTime','starttime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','Projects','destroy','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','include','findAll','rows','catch','show','params','intersection','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63a2,0x1e1));var _0x263a=function(_0x62683e,_0x3afe78){_0x62683e=_0x62683e-0x0;var _0x2755bd=_0x63a2[_0x62683e];return _0x2755bd;};'use strict';var emlformat=require(_0x263a('0x0'));var rimraf=require(_0x263a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x263a('0x2'));var rp=require('request-promise');var moment=require(_0x263a('0x3'));var BPromise=require(_0x263a('0x4'));var Mustache=require(_0x263a('0x5'));var util=require(_0x263a('0x6'));var path=require(_0x263a('0x7'));var sox=require('sox');var csv=require(_0x263a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x263a('0x9'));var squel=require(_0x263a('0xa'));var crypto=require('crypto');var jsforce=require(_0x263a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x263a('0x8'));var querystring=require(_0x263a('0xc'));var Papa=require(_0x263a('0xd'));var Redis=require(_0x263a('0xe'));var authService=require(_0x263a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x263a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x263a('0x11'))('api');var utils=require(_0x263a('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2794fe,_0x2208f0){_0x2208f0=_0x2208f0||0xcc;return function(_0x449efa){if(_0x449efa){return _0x2794fe[_0x263a('0x13')](_0x2208f0);}return _0x2794fe[_0x263a('0x14')](_0x2208f0)[_0x263a('0x15')]();};}function respondWithResult(_0x1d7da6,_0x1ff30d){_0x1ff30d=_0x1ff30d||0xc8;return function(_0x5eb4a6){if(_0x5eb4a6){return _0x1d7da6[_0x263a('0x14')](_0x1ff30d)['json'](_0x5eb4a6);}};}function respondWithFilteredResult(_0x5a694e,_0x2c37cf){return function(_0x5e5fa9){if(_0x5e5fa9){var _0x62e623=typeof _0x2c37cf[_0x263a('0x16')]===_0x263a('0x17')&&typeof _0x2c37cf[_0x263a('0x18')]===_0x263a('0x17');var _0x1450b1=_0x5e5fa9['count'];var _0x49eb2d=_0x62e623?0x0:_0x2c37cf[_0x263a('0x16')];var _0x242cc6=_0x62e623?_0x5e5fa9[_0x263a('0x19')]:_0x2c37cf[_0x263a('0x16')]+_0x2c37cf[_0x263a('0x18')];var _0x36d0c3;if(_0x242cc6>=_0x1450b1){_0x242cc6=_0x1450b1;_0x36d0c3=0xc8;}else{_0x36d0c3=0xce;}_0x5a694e[_0x263a('0x14')](_0x36d0c3);return _0x5a694e[_0x263a('0x1a')](_0x263a('0x1b'),_0x49eb2d+'-'+_0x242cc6+'/'+_0x1450b1)[_0x263a('0x1c')](_0x5e5fa9);}return null;};}function patchUpdates(_0x12477c){return function(_0x59e21d){try{jsonpatch[_0x263a('0x1d')](_0x59e21d,_0x12477c,!![]);}catch(_0x2e70a8){return BPromise['reject'](_0x2e70a8);}return _0x59e21d[_0x263a('0x1e')]();};}function saveUpdates(_0x15395f,_0x48dc9b){return function(_0xe6096a){if(_0xe6096a){return _0xe6096a[_0x263a('0x1f')](_0x15395f)[_0x263a('0x20')](function(_0x86993b){return _0x86993b;});}return null;};}function removeEntity(_0x48f81,_0x3f74d3){return function(_0x2259a0){if(_0x2259a0){return _0x2259a0['destroy']()['then'](function(){var _0x4cef6b=_0x2259a0['get']({'plain':!![]});var _0xc59953=_0x263a('0x21');return db['UserProfileResource'][_0x263a('0x22')]({'where':{'type':_0xc59953,'resourceId':_0x4cef6b['id']}})[_0x263a('0x20')](function(){return _0x2259a0;});})['then'](function(){_0x48f81[_0x263a('0x14')](0xcc)[_0x263a('0x15')]();});}};}function handleEntityNotFound(_0x4d2ac2,_0x426b17){return function(_0x28481a){if(!_0x28481a){_0x4d2ac2['sendStatus'](0x194);}return _0x28481a;};}function handleError(_0xd8c993,_0x289e1c){_0x289e1c=_0x289e1c||0x1f4;return function(_0x195166){logger[_0x263a('0x23')](_0x195166[_0x263a('0x24')]);if(_0x195166[_0x263a('0x25')]){delete _0x195166[_0x263a('0x25')];}_0xd8c993[_0x263a('0x14')](_0x289e1c)['send'](_0x195166);};}exports[_0x263a('0x26')]=function(_0x4253dd,_0x404888){var _0x57197a={},_0x2b53bc={},_0x215eae={'count':0x0,'rows':[]};var _0x2d67ef=_[_0x263a('0x27')](db[_0x263a('0x28')][_0x263a('0x29')],function(_0x50bac4){return{'name':_0x50bac4[_0x263a('0x2a')],'type':_0x50bac4[_0x263a('0x2b')][_0x263a('0x2c')]};});_0x2b53bc[_0x263a('0x2d')]=_[_0x263a('0x27')](_0x2d67ef,_0x263a('0x25'));_0x2b53bc[_0x263a('0x2e')]=_[_0x263a('0x2f')](_0x4253dd[_0x263a('0x2e')]);_0x2b53bc[_0x263a('0x30')]=_['intersection'](_0x2b53bc[_0x263a('0x2d')],_0x2b53bc[_0x263a('0x2e')]);_0x57197a[_0x263a('0x31')]=_['intersection'](_0x2b53bc['model'],qs['fields'](_0x4253dd[_0x263a('0x2e')][_0x263a('0x32')]));_0x57197a[_0x263a('0x31')]=_0x57197a[_0x263a('0x31')]['length']?_0x57197a['attributes']:_0x2b53bc[_0x263a('0x2d')];if(!_0x4253dd[_0x263a('0x2e')][_0x263a('0x33')](_0x263a('0x34'))){_0x57197a[_0x263a('0x18')]=qs[_0x263a('0x18')](_0x4253dd[_0x263a('0x2e')]['limit']);_0x57197a[_0x263a('0x16')]=qs[_0x263a('0x16')](_0x4253dd[_0x263a('0x2e')][_0x263a('0x16')]);}_0x57197a['order']=qs[_0x263a('0x35')](_0x4253dd[_0x263a('0x2e')][_0x263a('0x35')]);_0x57197a['where']=qs[_0x263a('0x30')](_[_0x263a('0x36')](_0x4253dd[_0x263a('0x2e')],_0x2b53bc['filters']),_0x2d67ef);if(_0x4253dd['query'][_0x263a('0x37')]){_0x57197a['where']=_[_0x263a('0x38')](_0x57197a[_0x263a('0x39')],{'$or':_[_0x263a('0x27')](_0x2d67ef,function(_0x53af01){if(_0x53af01['type']!=='VIRTUAL'){var _0x338553={};_0x338553[_0x53af01['name']]={'$like':'%'+_0x4253dd[_0x263a('0x2e')][_0x263a('0x37')]+'%'};return _0x338553;}})});}_0x57197a=_[_0x263a('0x38')]({},_0x57197a,_0x4253dd[_0x263a('0x3a')]);var _0x536fc6={'where':_0x57197a[_0x263a('0x39')]};return db[_0x263a('0x28')][_0x263a('0x19')](_0x536fc6)['then'](function(_0x37141e){_0x215eae['count']=_0x37141e;if(_0x4253dd[_0x263a('0x2e')]['includeAll']){_0x57197a[_0x263a('0x3b')]=[{'all':!![]}];}return db['JscriptyProject'][_0x263a('0x3c')](_0x57197a);})['then'](function(_0x1c13ef){_0x215eae[_0x263a('0x3d')]=_0x1c13ef;return _0x215eae;})['then'](respondWithFilteredResult(_0x404888,_0x57197a))[_0x263a('0x3e')](handleError(_0x404888,null));};exports[_0x263a('0x3f')]=function(_0x152a4b,_0x31232){var _0x39ce19={'raw':![],'where':{'id':_0x152a4b[_0x263a('0x40')]['id']}},_0x3674b8={};_0x3674b8[_0x263a('0x2d')]=_[_0x263a('0x2f')](db[_0x263a('0x28')]['rawAttributes']);_0x3674b8[_0x263a('0x2e')]=_[_0x263a('0x2f')](_0x152a4b[_0x263a('0x2e')]);_0x3674b8[_0x263a('0x30')]=_[_0x263a('0x41')](_0x3674b8['model'],_0x3674b8[_0x263a('0x2e')]);_0x39ce19[_0x263a('0x31')]=_[_0x263a('0x41')](_0x3674b8[_0x263a('0x2d')],qs[_0x263a('0x32')](_0x152a4b[_0x263a('0x2e')][_0x263a('0x32')]));_0x39ce19[_0x263a('0x31')]=_0x39ce19[_0x263a('0x31')][_0x263a('0x42')]?_0x39ce19[_0x263a('0x31')]:_0x3674b8[_0x263a('0x2d')];if(_0x152a4b[_0x263a('0x2e')][_0x263a('0x43')]){_0x39ce19[_0x263a('0x3b')]=[{'all':!![]}];}_0x39ce19=_['merge']({},_0x39ce19,_0x152a4b['options']);return db[_0x263a('0x28')][_0x263a('0x44')](_0x39ce19)[_0x263a('0x20')](handleEntityNotFound(_0x31232,null))[_0x263a('0x20')](respondWithResult(_0x31232,null))['catch'](handleError(_0x31232,null));};exports[_0x263a('0x45')]=function(_0x1a531a,_0x3e6867){return db[_0x263a('0x28')]['create'](_0x1a531a['body'],{})[_0x263a('0x20')](function(_0x3e4e32){var _0x3fe5b6=_0x1a531a[_0x263a('0x46')]['get']({'plain':!![]});if(!_0x3fe5b6)throw new Error(_0x263a('0x47'));if(_0x3fe5b6[_0x263a('0x48')]===_0x263a('0x46')){var _0x59147a=_0x3e4e32[_0x263a('0x49')]({'plain':!![]});var _0x1419bf='Projects';return db[_0x263a('0x4a')][_0x263a('0x44')]({'where':{'name':_0x1419bf,'userProfileId':_0x3fe5b6[_0x263a('0x4b')]},'raw':!![]})[_0x263a('0x20')](function(_0xbeaf57){if(_0xbeaf57&&_0xbeaf57[_0x263a('0x4c')]===0x0){return db['UserProfileResource'][_0x263a('0x45')]({'name':_0x59147a['name'],'resourceId':_0x59147a['id'],'type':_0xbeaf57[_0x263a('0x25')],'sectionId':_0xbeaf57['id']},{})[_0x263a('0x20')](function(){return _0x3e4e32;});}else{return _0x3e4e32;}})[_0x263a('0x3e')](function(_0x2d80b6){logger[_0x263a('0x23')](_0x263a('0x4d'),_0x2d80b6);throw _0x2d80b6;});}return _0x3e4e32;})['then'](respondWithResult(_0x3e6867,0xc9))[_0x263a('0x3e')](handleError(_0x3e6867,null));};exports[_0x263a('0x4e')]=function(_0xeb67f7,_0x28c210){var _0x441c2c={'where':{'id':_0xeb67f7['params']['id']}},_0x5acba6={};_0x5acba6[_0x263a('0x2d')]=_[_0x263a('0x2f')](db[_0x263a('0x28')][_0x263a('0x29')]);_0x441c2c[_0x263a('0x31')]=_[_0x263a('0x41')](_0x5acba6[_0x263a('0x2d')],qs[_0x263a('0x32')](_0xeb67f7['query']['fields']));_0x441c2c[_0x263a('0x31')]=_0x441c2c[_0x263a('0x31')][_0x263a('0x42')]?_0x441c2c[_0x263a('0x31')]:_0x5acba6[_0x263a('0x2d')];if(_0xeb67f7['query'][_0x263a('0x43')]){_0x441c2c[_0x263a('0x3b')]=[{'all':!![]}];}_0x441c2c=_[_0x263a('0x38')]({},_0x441c2c,_0xeb67f7[_0x263a('0x3a')]);return db['JscriptyProject']['find'](_0x441c2c)['then'](handleEntityNotFound(_0x28c210,null))['then'](function(_0xf7e228){if(_0xf7e228){var _0x19799a=_0xf7e228['get']({'plain':!![]});_0x19799a=qs[_0x263a('0x4f')](_0x19799a,['id',_0x263a('0x50'),_0x263a('0x51')]);_0xeb67f7[_0x263a('0x52')]=_['omit'](_0xeb67f7[_0x263a('0x52')],['id',_0x263a('0x50'),_0x263a('0x51')]);return db[_0x263a('0x28')][_0x263a('0x45')](_['merge'](_0x19799a,_0xeb67f7[_0x263a('0x52')]),{'include':_0xeb67f7[_0x263a('0x2e')][_0x263a('0x43')]?[{'all':!![]}]:undefined})[_0x263a('0x20')](function(_0xef7dcb){var _0x5040c4=_0xeb67f7['user'][_0x263a('0x49')]({'plain':!![]});if(!_0x5040c4)throw new Error(_0x263a('0x47'));if(_0x5040c4[_0x263a('0x48')]===_0x263a('0x46')){var _0x2f8628=_0xef7dcb[_0x263a('0x49')]({'plain':!![]});var _0x5ad552=_0x263a('0x21');return db['UserProfileSection'][_0x263a('0x44')]({'where':{'name':_0x5ad552,'userProfileId':_0x5040c4[_0x263a('0x4b')]},'raw':!![]})['then'](function(_0x1dec1d){if(_0x1dec1d&&_0x1dec1d[_0x263a('0x4c')]===0x0){return db['UserProfileResource'][_0x263a('0x45')]({'name':_0x2f8628['name'],'resourceId':_0x2f8628['id'],'type':_0x1dec1d[_0x263a('0x25')],'sectionId':_0x1dec1d['id']},{})[_0x263a('0x20')](function(){return _0xef7dcb;});}else{return _0xef7dcb;}})['catch'](function(_0x29934c){logger[_0x263a('0x23')](_0x263a('0x4d'),_0x29934c);throw _0x29934c;});}return _0xef7dcb;});}})[_0x263a('0x20')](respondWithResult(_0x28c210,0xc9))[_0x263a('0x3e')](handleError(_0x28c210,null));};exports['update']=function(_0x3b0212,_0x85c0c8){if(_0x3b0212[_0x263a('0x52')]['id']){delete _0x3b0212['body']['id'];}return db[_0x263a('0x28')]['find']({'where':{'id':_0x3b0212[_0x263a('0x40')]['id']}})[_0x263a('0x20')](handleEntityNotFound(_0x85c0c8,null))[_0x263a('0x20')](saveUpdates(_0x3b0212[_0x263a('0x52')],null))[_0x263a('0x20')](respondWithResult(_0x85c0c8,null))[_0x263a('0x3e')](handleError(_0x85c0c8,null));};exports[_0x263a('0x22')]=function(_0x3bbf60,_0x480aca){return db[_0x263a('0x28')][_0x263a('0x44')]({'where':{'id':_0x3bbf60[_0x263a('0x40')]['id']}})[_0x263a('0x20')](handleEntityNotFound(_0x480aca,null))['then'](removeEntity(_0x480aca,null))['catch'](handleError(_0x480aca,null));};exports[_0x263a('0x53')]=function(_0x441d98,_0x3a8891,_0x367d56){var _0x1677c8={'raw':!![],'where':{}};var _0x4c7879={};var _0x44783b={'count':0x0,'rows':[]};return db[_0x263a('0x28')][_0x263a('0x54')]({'where':{'id':_0x441d98[_0x263a('0x40')]['id']}})[_0x263a('0x20')](handleEntityNotFound(_0x3a8891,null))[_0x263a('0x20')](function(_0xde736c){if(_0xde736c){_0x4c7879[_0x263a('0x2d')]=_[_0x263a('0x2f')](db['JscriptySessionReport'][_0x263a('0x29')]);_0x4c7879['query']=_[_0x263a('0x2f')](_0x441d98[_0x263a('0x2e')]);_0x4c7879[_0x263a('0x30')]=_[_0x263a('0x41')](_0x4c7879[_0x263a('0x2d')],_0x4c7879[_0x263a('0x2e')]);_0x1677c8[_0x263a('0x31')]=_[_0x263a('0x41')](_0x4c7879[_0x263a('0x2d')],qs[_0x263a('0x32')](_0x441d98[_0x263a('0x2e')][_0x263a('0x32')]));_0x1677c8['attributes']=_0x1677c8[_0x263a('0x31')][_0x263a('0x42')]?_0x1677c8['attributes']:_0x4c7879[_0x263a('0x2d')];if(!_0x441d98[_0x263a('0x2e')][_0x263a('0x33')](_0x263a('0x34'))){_0x1677c8[_0x263a('0x18')]=qs[_0x263a('0x18')](_0x441d98[_0x263a('0x2e')]['limit']);_0x1677c8[_0x263a('0x16')]=qs[_0x263a('0x16')](_0x441d98[_0x263a('0x2e')]['offset']);}_0x1677c8[_0x263a('0x55')]=qs[_0x263a('0x35')](_0x441d98['query'][_0x263a('0x35')]);_0x1677c8['where']=qs[_0x263a('0x30')](_['pick'](_0x441d98['query'],_0x4c7879[_0x263a('0x30')]));_0x1677c8[_0x263a('0x39')][_0x263a('0x56')]=_0xde736c['id'];if(_0x441d98[_0x263a('0x2e')][_0x263a('0x37')]){_0x1677c8['where']=_[_0x263a('0x38')](_0x1677c8[_0x263a('0x39')],{'$or':_[_0x263a('0x27')](_0x1677c8[_0x263a('0x31')],function(_0x1232d7){var _0x13ec35={};_0x13ec35[_0x1232d7]={'$like':'%'+_0x441d98[_0x263a('0x2e')]['filter']+'%'};return _0x13ec35;})});}_0x1677c8=_[_0x263a('0x38')]({},_0x1677c8,_0x441d98[_0x263a('0x3a')]);return db[_0x263a('0x57')][_0x263a('0x19')]({'where':_0x1677c8[_0x263a('0x39')]})[_0x263a('0x20')](function(_0x3feefa){_0x44783b[_0x263a('0x19')]=_0x3feefa;if(_0x441d98[_0x263a('0x2e')]['includeAll']){_0x1677c8[_0x263a('0x3b')]=[{'all':!![]}];}return db[_0x263a('0x57')]['findAll'](_0x1677c8);})[_0x263a('0x20')](function(_0x3e796f){_0x44783b[_0x263a('0x3d')]=_0x3e796f;return _0x44783b;});}})[_0x263a('0x20')](respondWithFilteredResult(_0x3a8891,_0x1677c8))[_0x263a('0x3e')](handleError(_0x3a8891,null));};exports[_0x263a('0x58')]=function(_0x3f2b3c,_0xac9e36,_0x4ce248){var _0x144c84={'raw':!![],'where':{}};var _0x4a1abe={};var _0x3ed094={'count':0x0,'rows':[]};return db[_0x263a('0x28')][_0x263a('0x54')]({'where':{'id':_0x3f2b3c[_0x263a('0x40')]['id']}})[_0x263a('0x20')](handleEntityNotFound(_0xac9e36,null))['then'](function(_0x1f615e){if(_0x1f615e){_0x4a1abe['model']=_[_0x263a('0x2f')](db[_0x263a('0x59')][_0x263a('0x29')]);_0x4a1abe[_0x263a('0x2e')]=_['keys'](_0x3f2b3c[_0x263a('0x2e')]);_0x4a1abe[_0x263a('0x30')]=_['intersection'](_0x4a1abe[_0x263a('0x2d')],_0x4a1abe[_0x263a('0x2e')]);_0x144c84[_0x263a('0x31')]=_['intersection'](_0x4a1abe['model'],qs[_0x263a('0x32')](_0x3f2b3c[_0x263a('0x2e')][_0x263a('0x32')]));_0x144c84[_0x263a('0x31')]=_0x144c84[_0x263a('0x31')][_0x263a('0x42')]?_0x144c84[_0x263a('0x31')]:_0x4a1abe[_0x263a('0x2d')];if(!_0x3f2b3c['query'][_0x263a('0x33')](_0x263a('0x34'))){_0x144c84['limit']=qs[_0x263a('0x18')](_0x3f2b3c[_0x263a('0x2e')][_0x263a('0x18')]);_0x144c84['offset']=qs['offset'](_0x3f2b3c['query'][_0x263a('0x16')]);}_0x144c84[_0x263a('0x55')]=qs[_0x263a('0x35')](_0x3f2b3c[_0x263a('0x2e')]['sort']);_0x144c84[_0x263a('0x39')]=qs[_0x263a('0x30')](_[_0x263a('0x36')](_0x3f2b3c[_0x263a('0x2e')],_0x4a1abe[_0x263a('0x30')]));_0x144c84[_0x263a('0x39')][_0x263a('0x56')]=_0x1f615e['id'];if(_0x3f2b3c[_0x263a('0x2e')][_0x263a('0x37')]){_0x144c84[_0x263a('0x39')]=_[_0x263a('0x38')](_0x144c84[_0x263a('0x39')],{'$or':_['map'](_0x144c84[_0x263a('0x31')],function(_0x19b057){var _0x5812f4={};_0x5812f4[_0x19b057]={'$like':'%'+_0x3f2b3c[_0x263a('0x2e')][_0x263a('0x37')]+'%'};return _0x5812f4;})});}_0x144c84=_[_0x263a('0x38')]({},_0x144c84,_0x3f2b3c[_0x263a('0x3a')]);return db[_0x263a('0x59')][_0x263a('0x19')]({'where':_0x144c84['where']})[_0x263a('0x20')](function(_0x13da13){_0x3ed094[_0x263a('0x19')]=_0x13da13;if(_0x3f2b3c[_0x263a('0x2e')]['includeAll']){_0x144c84['include']=[{'all':!![]}];}return db[_0x263a('0x59')][_0x263a('0x3c')](_0x144c84);})[_0x263a('0x20')](function(_0x509695){_0x3ed094[_0x263a('0x3d')]=_0x509695;return _0x3ed094;});}})['then'](respondWithFilteredResult(_0xac9e36,_0x144c84))['catch'](handleError(_0xac9e36,null));};function char(_0x559b60){return'number'===typeof _0x559b60?String[_0x263a('0x5a')][_0x263a('0x1d')](null,arguments):_0x559b60;}function needsEncapsulation(_0xdaccf2){return!!_0xdaccf2&&(_0xdaccf2['toString']()[_0x263a('0x5b')](char(0xd))>=0x0||_0xdaccf2['toString']()[_0x263a('0x5b')](char(0xa))>=0x0||_0xdaccf2[_0x263a('0x5c')]()[_0x263a('0x5b')](char(0x2c))>=0x0||_0xdaccf2['toString']()[_0x263a('0x5b')](char(0x22))>=0x0);}function encapsulate(_0x267172){var _0x540530=char(0x22),_0x259c05='\x5c'+char(0x22),_0x1da1f0=_0x267172[_0x263a('0x5c')]()[_0x263a('0x5d')](new RegExp(_0x540530,'g'),_0x259c05);return _0x540530+_0x1da1f0+_0x540530;}exports['getSummary']=function(_0x32dd48,_0x55366d,_0x5ce7dd){var _0x319751,_0x2aec27;var _0x41714d={'where':{'ProjectId':_0x32dd48[_0x263a('0x40')]['id']}};if(_0x32dd48['query'][_0x263a('0x5e')]){_0x41714d[_0x263a('0x39')][_0x263a('0x5f')]=JSON['parse'](_0x32dd48['query'][_0x263a('0x5e')]);}return db[_0x263a('0x57')]['findAll'](_0x41714d)[_0x263a('0x20')](handleEntityNotFound(_0x55366d,null))[_0x263a('0x20')](function(_0x19b3b1){if(_0x19b3b1){_0x319751=_0x19b3b1;return db['JscriptyQuestionReport'][_0x263a('0x3c')]({'where':{'SessionId':{'$in':_[_0x263a('0x27')](_0x319751,'id')},'ProjectId':_0x32dd48[_0x263a('0x40')]['id']},'order':_0x263a('0x60')});}})['then'](handleEntityNotFound(_0x55366d,null))[_0x263a('0x20')](function(_0x792af3){if(_0x792af3){_0x2aec27=_0x792af3;var _0x1ebee4={};for(var _0x3c2c0f=0x0,_0x11746a=_0x2aec27[_0x263a('0x42')];_0x3c2c0f<_0x11746a;_0x3c2c0f++){if(!_0x1ebee4[_0x263a('0x33')](_0x2aec27[_0x3c2c0f][_0x263a('0x61')])){_0x1ebee4[_0x2aec27[_0x3c2c0f][_0x263a('0x61')]]=needsEncapsulation(_0x2aec27[_0x3c2c0f]['question'])?encapsulate(_0x2aec27[_0x3c2c0f][_0x263a('0x62')]):_0x2aec27[_0x3c2c0f][_0x263a('0x62')];}}var _0x1a55da=[],_0x5a4fbc={};for(var _0x28cec5=0x0,_0x4abbd0=_0x319751[_0x263a('0x42')];_0x28cec5<_0x4abbd0;_0x28cec5++){_0x5a4fbc={'ProjectId':_0x32dd48[_0x263a('0x40')]['id'],'SessionId':_0x319751[_0x28cec5]['id'],'StartTime':moment(_0x319751[_0x28cec5][_0x263a('0x5f')])[_0x263a('0x63')](_0x263a('0x64'))};for(var _0x44a810=0x0,_0x48984f=_0x2aec27['length'];_0x44a810<_0x48984f;_0x44a810++){if(_0x2aec27[_0x44a810][_0x263a('0x65')]==_0x319751[_0x28cec5]['id']&&_0x1ebee4[_0x263a('0x33')](_0x2aec27[_0x44a810][_0x263a('0x61')])){_0x5a4fbc[_0x1ebee4[_0x2aec27[_0x44a810][_0x263a('0x61')]]]=_0x2aec27[_0x44a810][_0x263a('0x66')];}}for(var _0x60a0f1 in _0x1ebee4){if(!_0x5a4fbc[_0x263a('0x33')](_0x1ebee4[_0x60a0f1])){_0x5a4fbc[_0x1ebee4[_0x60a0f1]]=null;}}_0x1a55da[_0x263a('0x67')](_0x5a4fbc);}return _0x1a55da;}})['then'](function(_0x40e065){if(!_[_0x263a('0x68')](_0x40e065)){var _0x76e838=toCsv(_0x40e065);var _0x38d982=Date['now']();fs['writeFileSync'](util[_0x263a('0x63')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x32dd48[_0x263a('0x40')]['id'],_0x38d982),_0x76e838);_0x55366d[_0x263a('0x69')]('Content-disposition',_0x263a('0x6a')+util['format'](_0x263a('0x6b'),_0x32dd48[_0x263a('0x40')]['id'],_0x38d982));_0x55366d['setHeader']('Content-type',_0x263a('0x6c'));return _0x55366d[_0x263a('0x6d')](util[_0x263a('0x63')](_0x263a('0x6e'),_0x32dd48['params']['id'],_0x38d982));}else{return _0x55366d['sendStatus'](0xcc);}})['catch'](handleError(_0x55366d,null));}; \ No newline at end of file +var _0x9ffd=['where','pick','filter','merge','VIRTUAL','options','JscriptyProject','includeAll','include','findAll','rows','catch','params','find','create','user','get','Projects','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','body','updatedAt','role','destroy','getSessions','JscriptySessionReport','ProjectId','getAnswers','findOne','hasOwnProperty','order','number','fromCharCode','indexOf','toString','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','questionId','question','push','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','update','then','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort'];(function(_0x3452eb,_0x44035e){var _0x4244fd=function(_0x48564b){while(--_0x48564b){_0x3452eb['push'](_0x3452eb['shift']());}};_0x4244fd(++_0x44035e);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x56c8fa,_0x73403e){_0x56c8fa=_0x56c8fa-0x0;var _0x33a640=_0x9ffd[_0x56c8fa];return _0x33a640;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];function respondWithStatusCode(_0x47d842,_0x47b0d7){_0x47b0d7=_0x47b0d7||0xcc;return function(_0xaaf7af){if(_0xaaf7af){return _0x47d842[_0xd9ff('0x1a')](_0x47b0d7);}return _0x47d842[_0xd9ff('0x1b')](_0x47b0d7)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x12c39a,_0x556aa4){_0x556aa4=_0x556aa4||0xc8;return function(_0x2f78c1){if(_0x2f78c1){return _0x12c39a[_0xd9ff('0x1b')](_0x556aa4)['json'](_0x2f78c1);}};}function respondWithFilteredResult(_0xf14c9f,_0x5db010){return function(_0x4ffe54){if(_0x4ffe54){var _0x547e28=typeof _0x5db010['offset']===_0xd9ff('0x1d')&&typeof _0x5db010['limit']===_0xd9ff('0x1d');var _0xa30fd2=_0x4ffe54[_0xd9ff('0x1e')];var _0x3afd19=_0x547e28?0x0:_0x5db010[_0xd9ff('0x1f')];var _0x2d4df1=_0x547e28?_0x4ffe54[_0xd9ff('0x1e')]:_0x5db010[_0xd9ff('0x1f')]+_0x5db010[_0xd9ff('0x20')];var _0x1f028f;if(_0x2d4df1>=_0xa30fd2){_0x2d4df1=_0xa30fd2;_0x1f028f=0xc8;}else{_0x1f028f=0xce;}_0xf14c9f[_0xd9ff('0x1b')](_0x1f028f);return _0xf14c9f[_0xd9ff('0x21')](_0xd9ff('0x22'),_0x3afd19+'-'+_0x2d4df1+'/'+_0xa30fd2)['json'](_0x4ffe54);}return null;};}function patchUpdates(_0x4cf8ec){return function(_0x264a3d){try{jsonpatch[_0xd9ff('0x23')](_0x264a3d,_0x4cf8ec,!![]);}catch(_0x4eea4d){return BPromise['reject'](_0x4eea4d);}return _0x264a3d['save']();};}function saveUpdates(_0x4b1477,_0x1f4d9e){return function(_0x58eb5f){if(_0x58eb5f){return _0x58eb5f[_0xd9ff('0x24')](_0x4b1477)[_0xd9ff('0x25')](function(_0x291f52){return _0x291f52;});}return null;};}function removeEntity(_0x9f074e,_0x278b66){return function(_0x42a828){if(_0x42a828){return _0x42a828['destroy']()['then'](function(){var _0x1136e9=_0x42a828['get']({'plain':!![]});var _0x3ca906='Projects';return db[_0xd9ff('0x26')]['destroy']({'where':{'type':_0x3ca906,'resourceId':_0x1136e9['id']}})[_0xd9ff('0x25')](function(){return _0x42a828;});})[_0xd9ff('0x25')](function(){_0x9f074e[_0xd9ff('0x1b')](0xcc)[_0xd9ff('0x1c')]();});}};}function handleEntityNotFound(_0x5d685e,_0x11a17b){return function(_0xe11f88){if(!_0xe11f88){_0x5d685e[_0xd9ff('0x1a')](0x194);}return _0xe11f88;};}function handleError(_0x4390f7,_0x5c1c1f){_0x5c1c1f=_0x5c1c1f||0x1f4;return function(_0x1d3684){logger[_0xd9ff('0x27')](_0x1d3684[_0xd9ff('0x28')]);if(_0x1d3684[_0xd9ff('0x29')]){delete _0x1d3684[_0xd9ff('0x29')];}_0x4390f7[_0xd9ff('0x1b')](_0x5c1c1f)[_0xd9ff('0x2a')](_0x1d3684);};}exports[_0xd9ff('0x2b')]=function(_0x3dc443,_0x5706cf){var _0xcea5db={},_0x4ba2be={},_0x1d55fd={'count':0x0,'rows':[]};var _0x29c532=_[_0xd9ff('0x2c')](db['JscriptyProject'][_0xd9ff('0x2d')],function(_0x3b26da){return{'name':_0x3b26da[_0xd9ff('0x2e')],'type':_0x3b26da[_0xd9ff('0x2f')]['key']};});_0x4ba2be[_0xd9ff('0x30')]=_['map'](_0x29c532,_0xd9ff('0x29'));_0x4ba2be[_0xd9ff('0x31')]=_[_0xd9ff('0x32')](_0x3dc443[_0xd9ff('0x31')]);_0x4ba2be[_0xd9ff('0x33')]=_[_0xd9ff('0x34')](_0x4ba2be[_0xd9ff('0x30')],_0x4ba2be[_0xd9ff('0x31')]);_0xcea5db[_0xd9ff('0x35')]=_[_0xd9ff('0x34')](_0x4ba2be[_0xd9ff('0x30')],qs[_0xd9ff('0x36')](_0x3dc443[_0xd9ff('0x31')][_0xd9ff('0x36')]));_0xcea5db['attributes']=_0xcea5db[_0xd9ff('0x35')][_0xd9ff('0x37')]?_0xcea5db[_0xd9ff('0x35')]:_0x4ba2be['model'];if(!_0x3dc443[_0xd9ff('0x31')]['hasOwnProperty'](_0xd9ff('0x38'))){_0xcea5db['limit']=qs[_0xd9ff('0x20')](_0x3dc443['query'][_0xd9ff('0x20')]);_0xcea5db[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x3dc443['query']['offset']);}_0xcea5db['order']=qs[_0xd9ff('0x39')](_0x3dc443[_0xd9ff('0x31')][_0xd9ff('0x39')]);_0xcea5db[_0xd9ff('0x3a')]=qs[_0xd9ff('0x33')](_[_0xd9ff('0x3b')](_0x3dc443['query'],_0x4ba2be['filters']),_0x29c532);if(_0x3dc443['query'][_0xd9ff('0x3c')]){_0xcea5db[_0xd9ff('0x3a')]=_[_0xd9ff('0x3d')](_0xcea5db[_0xd9ff('0x3a')],{'$or':_['map'](_0x29c532,function(_0x2692c0){if(_0x2692c0['type']!==_0xd9ff('0x3e')){var _0x3e2beb={};_0x3e2beb[_0x2692c0[_0xd9ff('0x29')]]={'$like':'%'+_0x3dc443[_0xd9ff('0x31')]['filter']+'%'};return _0x3e2beb;}})});}_0xcea5db=_[_0xd9ff('0x3d')]({},_0xcea5db,_0x3dc443[_0xd9ff('0x3f')]);var _0x4961a7={'where':_0xcea5db[_0xd9ff('0x3a')]};return db[_0xd9ff('0x40')][_0xd9ff('0x1e')](_0x4961a7)[_0xd9ff('0x25')](function(_0x1fe44d){_0x1d55fd[_0xd9ff('0x1e')]=_0x1fe44d;if(_0x3dc443['query'][_0xd9ff('0x41')]){_0xcea5db[_0xd9ff('0x42')]=[{'all':!![]}];}return db[_0xd9ff('0x40')][_0xd9ff('0x43')](_0xcea5db);})[_0xd9ff('0x25')](function(_0x52aab8){_0x1d55fd[_0xd9ff('0x44')]=_0x52aab8;return _0x1d55fd;})[_0xd9ff('0x25')](respondWithFilteredResult(_0x5706cf,_0xcea5db))[_0xd9ff('0x45')](handleError(_0x5706cf,null));};exports['show']=function(_0x5d06dd,_0x36843b){var _0x7eb1a={'raw':![],'where':{'id':_0x5d06dd[_0xd9ff('0x46')]['id']}},_0x18d1c4={};_0x18d1c4[_0xd9ff('0x30')]=_[_0xd9ff('0x32')](db['JscriptyProject'][_0xd9ff('0x2d')]);_0x18d1c4[_0xd9ff('0x31')]=_['keys'](_0x5d06dd[_0xd9ff('0x31')]);_0x18d1c4[_0xd9ff('0x33')]=_[_0xd9ff('0x34')](_0x18d1c4[_0xd9ff('0x30')],_0x18d1c4[_0xd9ff('0x31')]);_0x7eb1a['attributes']=_['intersection'](_0x18d1c4['model'],qs[_0xd9ff('0x36')](_0x5d06dd['query'][_0xd9ff('0x36')]));_0x7eb1a[_0xd9ff('0x35')]=_0x7eb1a[_0xd9ff('0x35')]['length']?_0x7eb1a[_0xd9ff('0x35')]:_0x18d1c4[_0xd9ff('0x30')];if(_0x5d06dd['query'][_0xd9ff('0x41')]){_0x7eb1a[_0xd9ff('0x42')]=[{'all':!![]}];}_0x7eb1a=_[_0xd9ff('0x3d')]({},_0x7eb1a,_0x5d06dd[_0xd9ff('0x3f')]);return db['JscriptyProject'][_0xd9ff('0x47')](_0x7eb1a)['then'](handleEntityNotFound(_0x36843b,null))[_0xd9ff('0x25')](respondWithResult(_0x36843b,null))['catch'](handleError(_0x36843b,null));};exports[_0xd9ff('0x48')]=function(_0x3d91e6,_0x2bf37a){return db[_0xd9ff('0x40')][_0xd9ff('0x48')](_0x3d91e6['body'],{})[_0xd9ff('0x25')](function(_0x3d6f11){var _0x2fbe53=_0x3d91e6[_0xd9ff('0x49')]['get']({'plain':!![]});if(!_0x2fbe53)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fbe53['role']===_0xd9ff('0x49')){var _0x40be56=_0x3d6f11[_0xd9ff('0x4a')]({'plain':!![]});var _0x572618=_0xd9ff('0x4b');return db[_0xd9ff('0x4c')][_0xd9ff('0x47')]({'where':{'name':_0x572618,'userProfileId':_0x2fbe53[_0xd9ff('0x4d')]},'raw':!![]})[_0xd9ff('0x25')](function(_0x40d391){if(_0x40d391&&_0x40d391[_0xd9ff('0x4e')]===0x0){return db[_0xd9ff('0x26')][_0xd9ff('0x48')]({'name':_0x40be56[_0xd9ff('0x29')],'resourceId':_0x40be56['id'],'type':_0x40d391[_0xd9ff('0x29')],'sectionId':_0x40d391['id']},{})[_0xd9ff('0x25')](function(){return _0x3d6f11;});}else{return _0x3d6f11;}})[_0xd9ff('0x45')](function(_0x487b07){logger[_0xd9ff('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x487b07);throw _0x487b07;});}return _0x3d6f11;})[_0xd9ff('0x25')](respondWithResult(_0x2bf37a,0xc9))['catch'](handleError(_0x2bf37a,null));};exports[_0xd9ff('0x4f')]=function(_0x49623d,_0xc82610){var _0x5624a0={'where':{'id':_0x49623d['params']['id']}},_0x3aea70={};_0x3aea70[_0xd9ff('0x30')]=_['keys'](db[_0xd9ff('0x40')]['rawAttributes']);_0x5624a0[_0xd9ff('0x35')]=_[_0xd9ff('0x34')](_0x3aea70[_0xd9ff('0x30')],qs[_0xd9ff('0x36')](_0x49623d['query'][_0xd9ff('0x36')]));_0x5624a0[_0xd9ff('0x35')]=_0x5624a0[_0xd9ff('0x35')]['length']?_0x5624a0[_0xd9ff('0x35')]:_0x3aea70[_0xd9ff('0x30')];if(_0x49623d[_0xd9ff('0x31')][_0xd9ff('0x41')]){_0x5624a0[_0xd9ff('0x42')]=[{'all':!![]}];}_0x5624a0=_['merge']({},_0x5624a0,_0x49623d[_0xd9ff('0x3f')]);return db[_0xd9ff('0x40')][_0xd9ff('0x47')](_0x5624a0)[_0xd9ff('0x25')](handleEntityNotFound(_0xc82610,null))[_0xd9ff('0x25')](function(_0x2b36e8){if(_0x2b36e8){var _0x458fd4=_0x2b36e8['get']({'plain':!![]});_0x458fd4=qs[_0xd9ff('0x50')](_0x458fd4,['id',_0xd9ff('0x51'),'updatedAt']);_0x49623d[_0xd9ff('0x52')]=_[_0xd9ff('0x50')](_0x49623d['body'],['id',_0xd9ff('0x51'),_0xd9ff('0x53')]);return db[_0xd9ff('0x40')]['create'](_['merge'](_0x458fd4,_0x49623d[_0xd9ff('0x52')]),{'include':_0x49623d['query'][_0xd9ff('0x41')]?[{'all':!![]}]:undefined})[_0xd9ff('0x25')](function(_0x31907e){var _0x102aea=_0x49623d['user']['get']({'plain':!![]});if(!_0x102aea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x102aea[_0xd9ff('0x54')]===_0xd9ff('0x49')){var _0x2e7781=_0x31907e[_0xd9ff('0x4a')]({'plain':!![]});var _0x27dad3='Projects';return db[_0xd9ff('0x4c')]['find']({'where':{'name':_0x27dad3,'userProfileId':_0x102aea[_0xd9ff('0x4d')]},'raw':!![]})[_0xd9ff('0x25')](function(_0x3f92c3){if(_0x3f92c3&&_0x3f92c3[_0xd9ff('0x4e')]===0x0){return db[_0xd9ff('0x26')][_0xd9ff('0x48')]({'name':_0x2e7781[_0xd9ff('0x29')],'resourceId':_0x2e7781['id'],'type':_0x3f92c3[_0xd9ff('0x29')],'sectionId':_0x3f92c3['id']},{})['then'](function(){return _0x31907e;});}else{return _0x31907e;}})[_0xd9ff('0x45')](function(_0x29e2f6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29e2f6);throw _0x29e2f6;});}return _0x31907e;});}})[_0xd9ff('0x25')](respondWithResult(_0xc82610,0xc9))['catch'](handleError(_0xc82610,null));};exports[_0xd9ff('0x24')]=function(_0x34fca4,_0x5b62a7){if(_0x34fca4[_0xd9ff('0x52')]['id']){delete _0x34fca4[_0xd9ff('0x52')]['id'];}return db[_0xd9ff('0x40')][_0xd9ff('0x47')]({'where':{'id':_0x34fca4[_0xd9ff('0x46')]['id']}})['then'](handleEntityNotFound(_0x5b62a7,null))[_0xd9ff('0x25')](saveUpdates(_0x34fca4['body'],null))['then'](respondWithResult(_0x5b62a7,null))[_0xd9ff('0x45')](handleError(_0x5b62a7,null));};exports[_0xd9ff('0x55')]=function(_0x1a08a9,_0x2fe00b){return db['JscriptyProject'][_0xd9ff('0x47')]({'where':{'id':_0x1a08a9[_0xd9ff('0x46')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x2fe00b,null))[_0xd9ff('0x25')](removeEntity(_0x2fe00b,null))[_0xd9ff('0x45')](handleError(_0x2fe00b,null));};exports[_0xd9ff('0x56')]=function(_0x2f12f7,_0x1d80f1,_0x4ac056){var _0x4c6b9d={'raw':!![],'where':{}};var _0x5e04d3={};var _0x275fb9={'count':0x0,'rows':[]};return db[_0xd9ff('0x40')]['findOne']({'where':{'id':_0x2f12f7[_0xd9ff('0x46')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x1d80f1,null))[_0xd9ff('0x25')](function(_0xd42dcb){if(_0xd42dcb){_0x5e04d3[_0xd9ff('0x30')]=_[_0xd9ff('0x32')](db[_0xd9ff('0x57')][_0xd9ff('0x2d')]);_0x5e04d3['query']=_[_0xd9ff('0x32')](_0x2f12f7[_0xd9ff('0x31')]);_0x5e04d3[_0xd9ff('0x33')]=_['intersection'](_0x5e04d3[_0xd9ff('0x30')],_0x5e04d3['query']);_0x4c6b9d[_0xd9ff('0x35')]=_[_0xd9ff('0x34')](_0x5e04d3[_0xd9ff('0x30')],qs['fields'](_0x2f12f7[_0xd9ff('0x31')][_0xd9ff('0x36')]));_0x4c6b9d[_0xd9ff('0x35')]=_0x4c6b9d[_0xd9ff('0x35')]['length']?_0x4c6b9d[_0xd9ff('0x35')]:_0x5e04d3[_0xd9ff('0x30')];if(!_0x2f12f7[_0xd9ff('0x31')]['hasOwnProperty'](_0xd9ff('0x38'))){_0x4c6b9d[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x2f12f7['query'][_0xd9ff('0x20')]);_0x4c6b9d[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x2f12f7[_0xd9ff('0x31')][_0xd9ff('0x1f')]);}_0x4c6b9d['order']=qs[_0xd9ff('0x39')](_0x2f12f7[_0xd9ff('0x31')]['sort']);_0x4c6b9d[_0xd9ff('0x3a')]=qs[_0xd9ff('0x33')](_[_0xd9ff('0x3b')](_0x2f12f7['query'],_0x5e04d3[_0xd9ff('0x33')]));_0x4c6b9d['where'][_0xd9ff('0x58')]=_0xd42dcb['id'];if(_0x2f12f7['query'][_0xd9ff('0x3c')]){_0x4c6b9d[_0xd9ff('0x3a')]=_[_0xd9ff('0x3d')](_0x4c6b9d[_0xd9ff('0x3a')],{'$or':_[_0xd9ff('0x2c')](_0x4c6b9d[_0xd9ff('0x35')],function(_0xda0003){var _0x518c8c={};_0x518c8c[_0xda0003]={'$like':'%'+_0x2f12f7[_0xd9ff('0x31')][_0xd9ff('0x3c')]+'%'};return _0x518c8c;})});}_0x4c6b9d=_['merge']({},_0x4c6b9d,_0x2f12f7[_0xd9ff('0x3f')]);return db[_0xd9ff('0x57')][_0xd9ff('0x1e')]({'where':_0x4c6b9d[_0xd9ff('0x3a')]})[_0xd9ff('0x25')](function(_0x43eadb){_0x275fb9['count']=_0x43eadb;if(_0x2f12f7['query'][_0xd9ff('0x41')]){_0x4c6b9d[_0xd9ff('0x42')]=[{'all':!![]}];}return db[_0xd9ff('0x57')][_0xd9ff('0x43')](_0x4c6b9d);})[_0xd9ff('0x25')](function(_0x183199){_0x275fb9['rows']=_0x183199;return _0x275fb9;});}})[_0xd9ff('0x25')](respondWithFilteredResult(_0x1d80f1,_0x4c6b9d))[_0xd9ff('0x45')](handleError(_0x1d80f1,null));};exports[_0xd9ff('0x59')]=function(_0x3d4953,_0x14c89f,_0x32aa19){var _0x498544={'raw':!![],'where':{}};var _0x124214={};var _0x3aef79={'count':0x0,'rows':[]};return db[_0xd9ff('0x40')][_0xd9ff('0x5a')]({'where':{'id':_0x3d4953[_0xd9ff('0x46')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x14c89f,null))[_0xd9ff('0x25')](function(_0x468c50){if(_0x468c50){_0x124214['model']=_[_0xd9ff('0x32')](db['JscriptyAnswerReport'][_0xd9ff('0x2d')]);_0x124214[_0xd9ff('0x31')]=_[_0xd9ff('0x32')](_0x3d4953[_0xd9ff('0x31')]);_0x124214[_0xd9ff('0x33')]=_[_0xd9ff('0x34')](_0x124214[_0xd9ff('0x30')],_0x124214[_0xd9ff('0x31')]);_0x498544[_0xd9ff('0x35')]=_[_0xd9ff('0x34')](_0x124214[_0xd9ff('0x30')],qs[_0xd9ff('0x36')](_0x3d4953[_0xd9ff('0x31')]['fields']));_0x498544[_0xd9ff('0x35')]=_0x498544[_0xd9ff('0x35')][_0xd9ff('0x37')]?_0x498544[_0xd9ff('0x35')]:_0x124214['model'];if(!_0x3d4953[_0xd9ff('0x31')][_0xd9ff('0x5b')]('nolimit')){_0x498544[_0xd9ff('0x20')]=qs[_0xd9ff('0x20')](_0x3d4953[_0xd9ff('0x31')][_0xd9ff('0x20')]);_0x498544[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x3d4953[_0xd9ff('0x31')]['offset']);}_0x498544[_0xd9ff('0x5c')]=qs['sort'](_0x3d4953[_0xd9ff('0x31')][_0xd9ff('0x39')]);_0x498544[_0xd9ff('0x3a')]=qs[_0xd9ff('0x33')](_[_0xd9ff('0x3b')](_0x3d4953[_0xd9ff('0x31')],_0x124214[_0xd9ff('0x33')]));_0x498544[_0xd9ff('0x3a')][_0xd9ff('0x58')]=_0x468c50['id'];if(_0x3d4953[_0xd9ff('0x31')][_0xd9ff('0x3c')]){_0x498544['where']=_[_0xd9ff('0x3d')](_0x498544[_0xd9ff('0x3a')],{'$or':_['map'](_0x498544[_0xd9ff('0x35')],function(_0x41e545){var _0x3b3511={};_0x3b3511[_0x41e545]={'$like':'%'+_0x3d4953[_0xd9ff('0x31')][_0xd9ff('0x3c')]+'%'};return _0x3b3511;})});}_0x498544=_[_0xd9ff('0x3d')]({},_0x498544,_0x3d4953['options']);return db['JscriptyAnswerReport'][_0xd9ff('0x1e')]({'where':_0x498544['where']})['then'](function(_0x4a55c1){_0x3aef79['count']=_0x4a55c1;if(_0x3d4953[_0xd9ff('0x31')][_0xd9ff('0x41')]){_0x498544[_0xd9ff('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x498544);})[_0xd9ff('0x25')](function(_0x5e7f52){_0x3aef79[_0xd9ff('0x44')]=_0x5e7f52;return _0x3aef79;});}})['then'](respondWithFilteredResult(_0x14c89f,_0x498544))[_0xd9ff('0x45')](handleError(_0x14c89f,null));};function char(_0x3ec460){return _0xd9ff('0x5d')===typeof _0x3ec460?String[_0xd9ff('0x5e')][_0xd9ff('0x23')](null,arguments):_0x3ec460;}function needsEncapsulation(_0x4e6dd2){return!!_0x4e6dd2&&(_0x4e6dd2['toString']()[_0xd9ff('0x5f')](char(0xd))>=0x0||_0x4e6dd2[_0xd9ff('0x60')]()[_0xd9ff('0x5f')](char(0xa))>=0x0||_0x4e6dd2[_0xd9ff('0x60')]()[_0xd9ff('0x5f')](char(0x2c))>=0x0||_0x4e6dd2['toString']()[_0xd9ff('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x19403d){var _0x9cb608=char(0x22),_0x7fdc57='\x5c'+char(0x22),_0x42018e=_0x19403d[_0xd9ff('0x60')]()[_0xd9ff('0x61')](new RegExp(_0x9cb608,'g'),_0x7fdc57);return _0x9cb608+_0x42018e+_0x9cb608;}exports[_0xd9ff('0x62')]=function(_0x28ba2c,_0x41b7e3,_0x280134){var _0x311b25,_0x1ec695;var _0x5baff1={'where':{'ProjectId':_0x28ba2c[_0xd9ff('0x46')]['id']}};if(_0x28ba2c[_0xd9ff('0x31')]['startTime']){_0x5baff1['where'][_0xd9ff('0x63')]=JSON[_0xd9ff('0x64')](_0x28ba2c['query'][_0xd9ff('0x65')]);}return db[_0xd9ff('0x57')][_0xd9ff('0x43')](_0x5baff1)[_0xd9ff('0x25')](handleEntityNotFound(_0x41b7e3,null))[_0xd9ff('0x25')](function(_0x36b1d5){if(_0x36b1d5){_0x311b25=_0x36b1d5;return db[_0xd9ff('0x66')][_0xd9ff('0x43')]({'where':{'SessionId':{'$in':_['map'](_0x311b25,'id')},'ProjectId':_0x28ba2c['params']['id']},'order':'-createdAt'});}})[_0xd9ff('0x25')](handleEntityNotFound(_0x41b7e3,null))[_0xd9ff('0x25')](function(_0x8fa0d3){if(_0x8fa0d3){_0x1ec695=_0x8fa0d3;var _0x59a429={};for(var _0xe5ef9c=0x0,_0x709054=_0x1ec695[_0xd9ff('0x37')];_0xe5ef9c<_0x709054;_0xe5ef9c++){if(!_0x59a429[_0xd9ff('0x5b')](_0x1ec695[_0xe5ef9c][_0xd9ff('0x67')])){_0x59a429[_0x1ec695[_0xe5ef9c][_0xd9ff('0x67')]]=needsEncapsulation(_0x1ec695[_0xe5ef9c]['question'])?encapsulate(_0x1ec695[_0xe5ef9c][_0xd9ff('0x68')]):_0x1ec695[_0xe5ef9c]['question'];}}var _0x5cb3af=[],_0x5fc38d={};for(var _0x3d4b20=0x0,_0x2780bf=_0x311b25['length'];_0x3d4b20<_0x2780bf;_0x3d4b20++){_0x5fc38d={'ProjectId':_0x28ba2c[_0xd9ff('0x46')]['id'],'SessionId':_0x311b25[_0x3d4b20]['id'],'StartTime':moment(_0x311b25[_0x3d4b20][_0xd9ff('0x63')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x4aa6d5=0x0,_0x11840a=_0x1ec695[_0xd9ff('0x37')];_0x4aa6d5<_0x11840a;_0x4aa6d5++){if(_0x1ec695[_0x4aa6d5]['SessionId']==_0x311b25[_0x3d4b20]['id']&&_0x59a429[_0xd9ff('0x5b')](_0x1ec695[_0x4aa6d5][_0xd9ff('0x67')])){_0x5fc38d[_0x59a429[_0x1ec695[_0x4aa6d5][_0xd9ff('0x67')]]]=_0x1ec695[_0x4aa6d5]['answer'];}}for(var _0x4a05f8 in _0x59a429){if(!_0x5fc38d['hasOwnProperty'](_0x59a429[_0x4a05f8])){_0x5fc38d[_0x59a429[_0x4a05f8]]=null;}}_0x5cb3af[_0xd9ff('0x69')](_0x5fc38d);}return _0x5cb3af;}})['then'](function(_0x27e71b){if(!_[_0xd9ff('0x6a')](_0x27e71b)){var _0x5c8224=toCsv(_0x27e71b);var _0x1b048b=Date[_0xd9ff('0x6b')]();fs[_0xd9ff('0x6c')](util[_0xd9ff('0x6d')](_0xd9ff('0x6e'),_0x28ba2c['params']['id'],_0x1b048b),_0x5c8224);_0x41b7e3[_0xd9ff('0x6f')]('Content-disposition','attachment;\x20filename='+util['format'](_0xd9ff('0x70'),_0x28ba2c[_0xd9ff('0x46')]['id'],_0x1b048b));_0x41b7e3[_0xd9ff('0x6f')](_0xd9ff('0x71'),'text/csv');return _0x41b7e3['download'](util[_0xd9ff('0x6d')](_0xd9ff('0x6e'),_0x28ba2c[_0xd9ff('0x46')]['id'],_0x1b048b));}else{return _0x41b7e3[_0xd9ff('0x1a')](0xcc);}})[_0xd9ff('0x45')](handleError(_0x41b7e3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 624b1e4..215dc49 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 _0x20d6=['jscripty_projects','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','JscriptyProject'];(function(_0x30f0a0,_0x57fece){var _0x562c5f=function(_0x3f01d9){while(--_0x3f01d9){_0x30f0a0['push'](_0x30f0a0['shift']());}};_0x562c5f(++_0x57fece);}(_0x20d6,0x9d));var _0x620d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x20d6[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x620d('0x0'));var util=require(_0x620d('0x1'));var logger=require(_0x620d('0x2'))(_0x620d('0x3'));var moment=require(_0x620d('0x4'));var BPromise=require('bluebird');var rp=require(_0x620d('0x5'));var fs=require('fs');var path=require(_0x620d('0x6'));var rimraf=require(_0x620d('0x7'));var config=require(_0x620d('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x620d('0x9')]=function(_0x3ea631,_0x5c67f9){return _0x3ea631[_0x620d('0xa')](_0x620d('0xb'),attributes,{'tableName':_0x620d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23ea=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash'];(function(_0x37d172,_0x55b556){var _0xc6dac3=function(_0x2a5742){while(--_0x2a5742){_0x37d172['push'](_0x37d172['shift']());}};_0xc6dac3(++_0x55b556);}(_0x23ea,0xc3));var _0xa23e=function(_0x54f253,_0x13acb1){_0x54f253=_0x54f253-0x0;var _0x207e8d=_0x23ea[_0x54f253];return _0x207e8d;};'use strict';var _=require(_0xa23e('0x0'));var util=require(_0xa23e('0x1'));var logger=require(_0xa23e('0x2'))(_0xa23e('0x3'));var moment=require(_0xa23e('0x4'));var BPromise=require(_0xa23e('0x5'));var rp=require(_0xa23e('0x6'));var fs=require('fs');var path=require(_0xa23e('0x7'));var rimraf=require(_0xa23e('0x8'));var config=require(_0xa23e('0x9'));var attributes=require(_0xa23e('0xa'));module['exports']=function(_0x3baf3d,_0x423454){return _0x3baf3d[_0xa23e('0xb')](_0xa23e('0xc'),attributes,{'tableName':_0xa23e('0xd'),'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 8f5b317..ad5f940 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 _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xac4a,0x13f));var _0xaac4=function(_0x466b1a,_0x27a318){_0x466b1a=_0x466b1a-0x0;var _0x130559=_0xac4a[_0x466b1a];return _0x130559;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ 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','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x5b34d9,_0x3ab99e){var _0x146fcf=function(_0x3a27fd){while(--_0x3a27fd){_0x5b34d9['push'](_0x5b34d9['shift']());}};_0x146fcf(++_0x3ab99e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x685346,_0x3ef2e5){_0x685346=_0x685346-0x0;var _0x52e15b=_0xcb91[_0x685346];return _0x52e15b;};'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')]('JscriptyProject,\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/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index df0f5df..d44862d 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 _0x0cca=['./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5a197c,_0x10e0db){var _0xc2cf74=function(_0x283716){while(--_0x283716){_0x5a197c['push'](_0x5a197c['shift']());}};_0xc2cf74(++_0x10e0db);}(_0x0cca,0x70));var _0xa0cc=function(_0xd02def,_0x144f25){_0xd02def=_0xd02def-0x0;var _0x2e8374=_0x0cca[_0xd02def];return _0x2e8374;};'use strict';var multer=require('multer');var util=require(_0xa0cc('0x0'));var path=require(_0xa0cc('0x1'));var timeout=require(_0xa0cc('0x2'));var express=require(_0xa0cc('0x3'));var router=express[_0xa0cc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa0cc('0x5'));var interaction=require(_0xa0cc('0x6'));var config=require(_0xa0cc('0x7'));var controller=require(_0xa0cc('0x8'));router['get']('/',auth[_0xa0cc('0x9')](),controller[_0xa0cc('0xa')]);router[_0xa0cc('0xb')](_0xa0cc('0xc'),auth[_0xa0cc('0x9')](),controller[_0xa0cc('0xd')]);router[_0xa0cc('0xb')](_0xa0cc('0xe'),auth[_0xa0cc('0x9')](),controller[_0xa0cc('0xf')]);router[_0xa0cc('0x10')]('/',auth[_0xa0cc('0x9')](),controller[_0xa0cc('0x11')]);router['put'](_0xa0cc('0xe'),auth[_0xa0cc('0x9')](),controller['update']);router[_0xa0cc('0x12')](_0xa0cc('0xe'),auth[_0xa0cc('0x9')](),controller[_0xa0cc('0x13')]);module['exports']=router; \ No newline at end of file +var _0xddb9=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','get','/describe','post','create','put','/:id','update','delete','destroy'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xddb9,0x141));var _0x9ddb=function(_0x1a676d,_0x2978ed){_0x1a676d=_0x1a676d-0x0;var _0x23db8d=_0xddb9[_0x1a676d];return _0x23db8d;};'use strict';var multer=require(_0x9ddb('0x0'));var util=require(_0x9ddb('0x1'));var path=require('path');var timeout=require(_0x9ddb('0x2'));var express=require(_0x9ddb('0x3'));var router=express[_0x9ddb('0x4')]();var fs_extra=require(_0x9ddb('0x5'));var auth=require(_0x9ddb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9ddb('0x7'));var controller=require(_0x9ddb('0x8'));router['get']('/',auth[_0x9ddb('0x9')](),controller['index']);router[_0x9ddb('0xa')](_0x9ddb('0xb'),auth[_0x9ddb('0x9')](),controller['describe']);router[_0x9ddb('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9ddb('0xc')]('/',auth[_0x9ddb('0x9')](),controller[_0x9ddb('0xd')]);router[_0x9ddb('0xe')](_0x9ddb('0xf'),auth['isAuthenticated'](),controller[_0x9ddb('0x10')]);router[_0x9ddb('0x11')](_0x9ddb('0xf'),auth['isAuthenticated'](),controller[_0x9ddb('0x12')]);module[_0x9ddb('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index cbf8f6e..732ec08 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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0xdd7d75,_0x46e701){_0xdd7d75=_0xdd7d75-0x0;var _0x4af992=_0x7a54[_0xdd7d75];return _0x4af992;};'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(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7a54,0x106));var _0x47a5=function(_0x4bcc60,_0x54cdcb){_0x4bcc60=_0x4bcc60-0x0;var _0x52d7ab=_0x7a54[_0x4bcc60];return _0x52d7ab;};'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 c6e117b..e215185 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 _0xafc2=['offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','error','stack','name','map','JscriptyQuestionReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','rawAttributes','includeAll','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x1eb808,_0x4b7952){var _0x1701f7=function(_0x4b8ef7){while(--_0x4b8ef7){_0x1eb808['push'](_0x1eb808['shift']());}};_0x1701f7(++_0x4b7952);}(_0xafc2,0x11a));var _0x2afc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xafc2[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x2afc('0x0'));var rimraf=require(_0x2afc('0x1'));var zipdir=require(_0x2afc('0x2'));var jsonpatch=require(_0x2afc('0x3'));var rp=require(_0x2afc('0x4'));var moment=require(_0x2afc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2afc('0x6'));var util=require(_0x2afc('0x7'));var path=require(_0x2afc('0x8'));var sox=require('sox');var csv=require(_0x2afc('0x9'));var ejs=require(_0x2afc('0xa'));var fs=require('fs');var fs_extra=require(_0x2afc('0xb'));var _=require(_0x2afc('0xc'));var squel=require(_0x2afc('0xd'));var crypto=require('crypto');var jsforce=require(_0x2afc('0xe'));var deskjs=require(_0x2afc('0xf'));var toCsv=require(_0x2afc('0x9'));var querystring=require(_0x2afc('0x10'));var Papa=require(_0x2afc('0x11'));var Redis=require('ioredis');var authService=require(_0x2afc('0x12'));var qs=require(_0x2afc('0x13'));var as=require(_0x2afc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2afc('0x15'))(_0x2afc('0x16'));var utils=require(_0x2afc('0x17'));var config=require(_0x2afc('0x18'));var licenseUtil=require(_0x2afc('0x19'));var db=require(_0x2afc('0x1a'))['db'];function respondWithStatusCode(_0x540eaa,_0x90eb1f){_0x90eb1f=_0x90eb1f||0xcc;return function(_0x1b59b1){if(_0x1b59b1){return _0x540eaa[_0x2afc('0x1b')](_0x90eb1f);}return _0x540eaa['status'](_0x90eb1f)[_0x2afc('0x1c')]();};}function respondWithResult(_0x2a68d3,_0x39547a){_0x39547a=_0x39547a||0xc8;return function(_0x284655){if(_0x284655){return _0x2a68d3[_0x2afc('0x1d')](_0x39547a)['json'](_0x284655);}};}function respondWithFilteredResult(_0x5a220b,_0x2d43cb){return function(_0x142349){if(_0x142349){var _0x513a09=typeof _0x2d43cb[_0x2afc('0x1e')]===_0x2afc('0x1f')&&typeof _0x2d43cb[_0x2afc('0x20')]===_0x2afc('0x1f');var _0x3d8a19=_0x142349[_0x2afc('0x21')];var _0x40d496=_0x513a09?0x0:_0x2d43cb[_0x2afc('0x1e')];var _0x70c61b=_0x513a09?_0x142349[_0x2afc('0x21')]:_0x2d43cb['offset']+_0x2d43cb['limit'];var _0x1a9aa3;if(_0x70c61b>=_0x3d8a19){_0x70c61b=_0x3d8a19;_0x1a9aa3=0xc8;}else{_0x1a9aa3=0xce;}_0x5a220b[_0x2afc('0x1d')](_0x1a9aa3);return _0x5a220b[_0x2afc('0x22')](_0x2afc('0x23'),_0x40d496+'-'+_0x70c61b+'/'+_0x3d8a19)[_0x2afc('0x24')](_0x142349);}return null;};}function patchUpdates(_0x384a27){return function(_0x3c237a){try{jsonpatch[_0x2afc('0x25')](_0x3c237a,_0x384a27,!![]);}catch(_0x3cb62d){return BPromise['reject'](_0x3cb62d);}return _0x3c237a['save']();};}function saveUpdates(_0x532ea8,_0x872b37){return function(_0x30071f){if(_0x30071f){return _0x30071f[_0x2afc('0x26')](_0x532ea8)[_0x2afc('0x27')](function(_0x55023b){return _0x55023b;});}return null;};}function removeEntity(_0x20b907,_0x3a57c5){return function(_0x1c2004){if(_0x1c2004){return _0x1c2004[_0x2afc('0x28')]()[_0x2afc('0x27')](function(){_0x20b907['status'](0xcc)[_0x2afc('0x1c')]();});}};}function handleEntityNotFound(_0x5e2cde,_0x36c6cc){return function(_0x37aa17){if(!_0x37aa17){_0x5e2cde[_0x2afc('0x1b')](0x194);}return _0x37aa17;};}function handleError(_0x3ce465,_0x4e3250){_0x4e3250=_0x4e3250||0x1f4;return function(_0x5f29b3){logger[_0x2afc('0x29')](_0x5f29b3[_0x2afc('0x2a')]);if(_0x5f29b3[_0x2afc('0x2b')]){delete _0x5f29b3[_0x2afc('0x2b')];}_0x3ce465['status'](_0x4e3250)['send'](_0x5f29b3);};}exports['index']=function(_0xcee7de,_0x48c6ac){var _0x4246ce={},_0x1067eb={},_0x214bd5={'count':0x0,'rows':[]};var _0x1432ac=_[_0x2afc('0x2c')](db[_0x2afc('0x2d')]['rawAttributes'],function(_0x1beb54){return{'name':_0x1beb54[_0x2afc('0x2e')],'type':_0x1beb54[_0x2afc('0x2f')][_0x2afc('0x30')]};});_0x1067eb[_0x2afc('0x31')]=_['map'](_0x1432ac,_0x2afc('0x2b'));_0x1067eb[_0x2afc('0x32')]=_[_0x2afc('0x33')](_0xcee7de[_0x2afc('0x32')]);_0x1067eb['filters']=_[_0x2afc('0x34')](_0x1067eb['model'],_0x1067eb[_0x2afc('0x32')]);_0x4246ce['attributes']=_['intersection'](_0x1067eb[_0x2afc('0x31')],qs['fields'](_0xcee7de[_0x2afc('0x32')][_0x2afc('0x35')]));_0x4246ce[_0x2afc('0x36')]=_0x4246ce[_0x2afc('0x36')][_0x2afc('0x37')]?_0x4246ce[_0x2afc('0x36')]:_0x1067eb[_0x2afc('0x31')];if(!_0xcee7de[_0x2afc('0x32')][_0x2afc('0x38')](_0x2afc('0x39'))){_0x4246ce[_0x2afc('0x20')]=qs['limit'](_0xcee7de[_0x2afc('0x32')][_0x2afc('0x20')]);_0x4246ce[_0x2afc('0x1e')]=qs[_0x2afc('0x1e')](_0xcee7de[_0x2afc('0x32')][_0x2afc('0x1e')]);}_0x4246ce[_0x2afc('0x3a')]=qs[_0x2afc('0x3b')](_0xcee7de[_0x2afc('0x32')][_0x2afc('0x3b')]);_0x4246ce[_0x2afc('0x3c')]=qs[_0x2afc('0x3d')](_[_0x2afc('0x3e')](_0xcee7de['query'],_0x1067eb['filters']),_0x1432ac);if(_0xcee7de[_0x2afc('0x32')][_0x2afc('0x3f')]){_0x4246ce[_0x2afc('0x3c')]=_[_0x2afc('0x40')](_0x4246ce[_0x2afc('0x3c')],{'$or':_['map'](_0x1432ac,function(_0x20e60d){if(_0x20e60d[_0x2afc('0x2f')]!==_0x2afc('0x41')){var _0x4d2dde={};_0x4d2dde[_0x20e60d[_0x2afc('0x2b')]]={'$like':'%'+_0xcee7de['query']['filter']+'%'};return _0x4d2dde;}})});}_0x4246ce=_[_0x2afc('0x40')]({},_0x4246ce,_0xcee7de[_0x2afc('0x42')]);var _0x111da4={'where':_0x4246ce[_0x2afc('0x3c')]};return db[_0x2afc('0x2d')]['count'](_0x111da4)['then'](function(_0x33e90c){_0x214bd5['count']=_0x33e90c;if(_0xcee7de['query']['includeAll']){_0x4246ce[_0x2afc('0x43')]=[{'all':!![]}];}return db[_0x2afc('0x2d')][_0x2afc('0x44')](_0x4246ce);})['then'](function(_0x376197){_0x214bd5[_0x2afc('0x45')]=_0x376197;return _0x214bd5;})[_0x2afc('0x27')](respondWithFilteredResult(_0x48c6ac,_0x4246ce))['catch'](handleError(_0x48c6ac,null));};exports[_0x2afc('0x46')]=function(_0x4e25a6,_0x1d42d2){var _0x4b53a8={'raw':!![],'where':{'id':_0x4e25a6['params']['id']}},_0x22cc2a={};_0x22cc2a[_0x2afc('0x31')]=_[_0x2afc('0x33')](db[_0x2afc('0x2d')][_0x2afc('0x47')]);_0x22cc2a[_0x2afc('0x32')]=_[_0x2afc('0x33')](_0x4e25a6[_0x2afc('0x32')]);_0x22cc2a[_0x2afc('0x3d')]=_[_0x2afc('0x34')](_0x22cc2a[_0x2afc('0x31')],_0x22cc2a[_0x2afc('0x32')]);_0x4b53a8['attributes']=_['intersection'](_0x22cc2a[_0x2afc('0x31')],qs[_0x2afc('0x35')](_0x4e25a6[_0x2afc('0x32')][_0x2afc('0x35')]));_0x4b53a8[_0x2afc('0x36')]=_0x4b53a8[_0x2afc('0x36')]['length']?_0x4b53a8[_0x2afc('0x36')]:_0x22cc2a[_0x2afc('0x31')];if(_0x4e25a6[_0x2afc('0x32')][_0x2afc('0x48')]){_0x4b53a8[_0x2afc('0x43')]=[{'all':!![]}];}_0x4b53a8=_[_0x2afc('0x40')]({},_0x4b53a8,_0x4e25a6[_0x2afc('0x42')]);return db[_0x2afc('0x2d')][_0x2afc('0x49')](_0x4b53a8)['then'](handleEntityNotFound(_0x1d42d2,null))['then'](respondWithResult(_0x1d42d2,null))['catch'](handleError(_0x1d42d2,null));};exports[_0x2afc('0x4a')]=function(_0x38c5be,_0x648b4a){return db[_0x2afc('0x2d')][_0x2afc('0x4a')](_0x38c5be[_0x2afc('0x4b')],{})[_0x2afc('0x27')](respondWithResult(_0x648b4a,0xc9))[_0x2afc('0x4c')](handleError(_0x648b4a,null));};exports['update']=function(_0x5f06e7,_0x4b7453){if(_0x5f06e7[_0x2afc('0x4b')]['id']){delete _0x5f06e7['body']['id'];}return db[_0x2afc('0x2d')][_0x2afc('0x49')]({'where':{'id':_0x5f06e7[_0x2afc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4b7453,null))['then'](saveUpdates(_0x5f06e7[_0x2afc('0x4b')],null))[_0x2afc('0x27')](respondWithResult(_0x4b7453,null))[_0x2afc('0x4c')](handleError(_0x4b7453,null));};exports[_0x2afc('0x28')]=function(_0x16e2d6,_0x1527eb){return db['JscriptyQuestionReport'][_0x2afc('0x49')]({'where':{'id':_0x16e2d6[_0x2afc('0x4d')]['id']}})[_0x2afc('0x27')](handleEntityNotFound(_0x1527eb,null))[_0x2afc('0x27')](removeEntity(_0x1527eb,null))[_0x2afc('0x4c')](handleError(_0x1527eb,null));};exports['describe']=function(_0x4e4b8f,_0x480763){return db[_0x2afc('0x2d')]['describe']()[_0x2afc('0x27')](respondWithResult(_0x480763,null))['catch'](handleError(_0x480763,null));}; \ No newline at end of file +var _0x79d1=['sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','params','keys','find','catch','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','set','json','update','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x79d1,0x136));var _0x179d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x79d1[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x179d('0x0'));var jsonpatch=require(_0x179d('0x1'));var rp=require(_0x179d('0x2'));var moment=require(_0x179d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x179d('0x4'));var util=require(_0x179d('0x5'));var path=require(_0x179d('0x6'));var sox=require(_0x179d('0x7'));var csv=require(_0x179d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x179d('0x9'));var _=require(_0x179d('0xa'));var squel=require(_0x179d('0xb'));var crypto=require(_0x179d('0xc'));var jsforce=require(_0x179d('0xd'));var deskjs=require(_0x179d('0xe'));var toCsv=require(_0x179d('0x8'));var querystring=require('querystring');var Papa=require(_0x179d('0xf'));var Redis=require(_0x179d('0x10'));var authService=require(_0x179d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x179d('0x12'));var hardwareService=require(_0x179d('0x13'));var logger=require(_0x179d('0x14'))(_0x179d('0x15'));var utils=require(_0x179d('0x16'));var config=require(_0x179d('0x17'));var licenseUtil=require(_0x179d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x111f27,_0x1f006c){_0x1f006c=_0x1f006c||0xcc;return function(_0x3202fb){if(_0x3202fb){return _0x111f27[_0x179d('0x19')](_0x1f006c);}return _0x111f27[_0x179d('0x1a')](_0x1f006c)[_0x179d('0x1b')]();};}function respondWithResult(_0x38ca49,_0x57d8b0){_0x57d8b0=_0x57d8b0||0xc8;return function(_0x3e2b9e){if(_0x3e2b9e){return _0x38ca49['status'](_0x57d8b0)['json'](_0x3e2b9e);}};}function respondWithFilteredResult(_0x12fbc1,_0x5053cd){return function(_0x1babc3){if(_0x1babc3){var _0x237854=typeof _0x5053cd[_0x179d('0x1c')]==='undefined'&&typeof _0x5053cd[_0x179d('0x1d')]==='undefined';var _0x5095c4=_0x1babc3['count'];var _0x1fefe4=_0x237854?0x0:_0x5053cd[_0x179d('0x1c')];var _0x2e17b8=_0x237854?_0x1babc3['count']:_0x5053cd[_0x179d('0x1c')]+_0x5053cd[_0x179d('0x1d')];var _0x2e864e;if(_0x2e17b8>=_0x5095c4){_0x2e17b8=_0x5095c4;_0x2e864e=0xc8;}else{_0x2e864e=0xce;}_0x12fbc1[_0x179d('0x1a')](_0x2e864e);return _0x12fbc1[_0x179d('0x1e')]('Content-Range',_0x1fefe4+'-'+_0x2e17b8+'/'+_0x5095c4)[_0x179d('0x1f')](_0x1babc3);}return null;};}function patchUpdates(_0x22b096){return function(_0x3a93bf){try{jsonpatch['apply'](_0x3a93bf,_0x22b096,!![]);}catch(_0x29dd2b){return BPromise['reject'](_0x29dd2b);}return _0x3a93bf['save']();};}function saveUpdates(_0x49961a,_0x13a6d8){return function(_0x1c688b){if(_0x1c688b){return _0x1c688b[_0x179d('0x20')](_0x49961a)[_0x179d('0x21')](function(_0x1840a7){return _0x1840a7;});}return null;};}function removeEntity(_0x4c6ba0,_0xc4be31){return function(_0x117473){if(_0x117473){return _0x117473[_0x179d('0x22')]()[_0x179d('0x21')](function(){_0x4c6ba0[_0x179d('0x1a')](0xcc)[_0x179d('0x1b')]();});}};}function handleEntityNotFound(_0x40d0dd,_0x426ba5){return function(_0x200832){if(!_0x200832){_0x40d0dd['sendStatus'](0x194);}return _0x200832;};}function handleError(_0x57956a,_0x5b5e30){_0x5b5e30=_0x5b5e30||0x1f4;return function(_0x2aa201){logger[_0x179d('0x23')](_0x2aa201[_0x179d('0x24')]);if(_0x2aa201[_0x179d('0x25')]){delete _0x2aa201[_0x179d('0x25')];}_0x57956a[_0x179d('0x1a')](_0x5b5e30)['send'](_0x2aa201);};}exports[_0x179d('0x26')]=function(_0x5884f3,_0x32b8ac){var _0x5367ea={},_0xb82de0={},_0xbbd1aa={'count':0x0,'rows':[]};var _0xbfc173=_[_0x179d('0x27')](db[_0x179d('0x28')][_0x179d('0x29')],function(_0x3f2e63){return{'name':_0x3f2e63[_0x179d('0x2a')],'type':_0x3f2e63[_0x179d('0x2b')][_0x179d('0x2c')]};});_0xb82de0['model']=_[_0x179d('0x27')](_0xbfc173,_0x179d('0x25'));_0xb82de0[_0x179d('0x2d')]=_['keys'](_0x5884f3[_0x179d('0x2d')]);_0xb82de0[_0x179d('0x2e')]=_[_0x179d('0x2f')](_0xb82de0[_0x179d('0x30')],_0xb82de0[_0x179d('0x2d')]);_0x5367ea[_0x179d('0x31')]=_[_0x179d('0x2f')](_0xb82de0[_0x179d('0x30')],qs[_0x179d('0x32')](_0x5884f3[_0x179d('0x2d')][_0x179d('0x32')]));_0x5367ea[_0x179d('0x31')]=_0x5367ea[_0x179d('0x31')][_0x179d('0x33')]?_0x5367ea[_0x179d('0x31')]:_0xb82de0['model'];if(!_0x5884f3['query'][_0x179d('0x34')](_0x179d('0x35'))){_0x5367ea[_0x179d('0x1d')]=qs[_0x179d('0x1d')](_0x5884f3['query'][_0x179d('0x1d')]);_0x5367ea[_0x179d('0x1c')]=qs[_0x179d('0x1c')](_0x5884f3[_0x179d('0x2d')][_0x179d('0x1c')]);}_0x5367ea[_0x179d('0x36')]=qs[_0x179d('0x37')](_0x5884f3[_0x179d('0x2d')][_0x179d('0x37')]);_0x5367ea[_0x179d('0x38')]=qs['filters'](_[_0x179d('0x39')](_0x5884f3['query'],_0xb82de0[_0x179d('0x2e')]),_0xbfc173);if(_0x5884f3[_0x179d('0x2d')][_0x179d('0x3a')]){_0x5367ea[_0x179d('0x38')]=_['merge'](_0x5367ea[_0x179d('0x38')],{'$or':_[_0x179d('0x27')](_0xbfc173,function(_0x3ff2bd){if(_0x3ff2bd[_0x179d('0x2b')]!=='VIRTUAL'){var _0x32ab10={};_0x32ab10[_0x3ff2bd['name']]={'$like':'%'+_0x5884f3['query']['filter']+'%'};return _0x32ab10;}})});}_0x5367ea=_[_0x179d('0x3b')]({},_0x5367ea,_0x5884f3[_0x179d('0x3c')]);var _0x3a067e={'where':_0x5367ea[_0x179d('0x38')]};return db[_0x179d('0x28')][_0x179d('0x3d')](_0x3a067e)[_0x179d('0x21')](function(_0x362290){_0xbbd1aa[_0x179d('0x3d')]=_0x362290;if(_0x5884f3[_0x179d('0x2d')][_0x179d('0x3e')]){_0x5367ea[_0x179d('0x3f')]=[{'all':!![]}];}return db[_0x179d('0x28')][_0x179d('0x40')](_0x5367ea);})[_0x179d('0x21')](function(_0x1195ce){_0xbbd1aa[_0x179d('0x41')]=_0x1195ce;return _0xbbd1aa;})[_0x179d('0x21')](respondWithFilteredResult(_0x32b8ac,_0x5367ea))['catch'](handleError(_0x32b8ac,null));};exports['show']=function(_0xb759a,_0xdb6317){var _0x161934={'raw':!![],'where':{'id':_0xb759a[_0x179d('0x42')]['id']}},_0x3cbea9={};_0x3cbea9[_0x179d('0x30')]=_[_0x179d('0x43')](db[_0x179d('0x28')][_0x179d('0x29')]);_0x3cbea9[_0x179d('0x2d')]=_[_0x179d('0x43')](_0xb759a[_0x179d('0x2d')]);_0x3cbea9['filters']=_[_0x179d('0x2f')](_0x3cbea9[_0x179d('0x30')],_0x3cbea9[_0x179d('0x2d')]);_0x161934['attributes']=_[_0x179d('0x2f')](_0x3cbea9[_0x179d('0x30')],qs[_0x179d('0x32')](_0xb759a[_0x179d('0x2d')][_0x179d('0x32')]));_0x161934[_0x179d('0x31')]=_0x161934[_0x179d('0x31')][_0x179d('0x33')]?_0x161934[_0x179d('0x31')]:_0x3cbea9['model'];if(_0xb759a[_0x179d('0x2d')][_0x179d('0x3e')]){_0x161934['include']=[{'all':!![]}];}_0x161934=_[_0x179d('0x3b')]({},_0x161934,_0xb759a[_0x179d('0x3c')]);return db[_0x179d('0x28')][_0x179d('0x44')](_0x161934)[_0x179d('0x21')](handleEntityNotFound(_0xdb6317,null))[_0x179d('0x21')](respondWithResult(_0xdb6317,null))[_0x179d('0x45')](handleError(_0xdb6317,null));};exports[_0x179d('0x46')]=function(_0x5a15df,_0x117fbd){return db[_0x179d('0x28')][_0x179d('0x46')](_0x5a15df[_0x179d('0x47')],{})['then'](respondWithResult(_0x117fbd,0xc9))[_0x179d('0x45')](handleError(_0x117fbd,null));};exports[_0x179d('0x20')]=function(_0x53cf93,_0x23ecbd){if(_0x53cf93[_0x179d('0x47')]['id']){delete _0x53cf93[_0x179d('0x47')]['id'];}return db[_0x179d('0x28')]['find']({'where':{'id':_0x53cf93[_0x179d('0x42')]['id']}})[_0x179d('0x21')](handleEntityNotFound(_0x23ecbd,null))[_0x179d('0x21')](saveUpdates(_0x53cf93[_0x179d('0x47')],null))[_0x179d('0x21')](respondWithResult(_0x23ecbd,null))[_0x179d('0x45')](handleError(_0x23ecbd,null));};exports['destroy']=function(_0x14b757,_0x4b9da5){return db[_0x179d('0x28')][_0x179d('0x44')]({'where':{'id':_0x14b757['params']['id']}})['then'](handleEntityNotFound(_0x4b9da5,null))[_0x179d('0x21')](removeEntity(_0x4b9da5,null))[_0x179d('0x45')](handleError(_0x4b9da5,null));};exports[_0x179d('0x48')]=function(_0x4cceac,_0x18bc86){return db['JscriptyQuestionReport'][_0x179d('0x48')]()['then'](respondWithResult(_0x18bc86,null))[_0x179d('0x45')](handleError(_0x18bc86,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index b6d9e05..0b391c8 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 _0xd8a7=['path','rimraf','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xc94e9d,_0x5eaace){var _0x513a57=function(_0x5a2d79){while(--_0x5a2d79){_0xc94e9d['push'](_0xc94e9d['shift']());}};_0x513a57(++_0x5eaace);}(_0xd8a7,0xa2));var _0x7d8a=function(_0x634769,_0x284876){_0x634769=_0x634769-0x0;var _0x46f7ea=_0xd8a7[_0x634769];return _0x46f7ea;};'use strict';var _=require(_0x7d8a('0x0'));var util=require('util');var logger=require(_0x7d8a('0x1'))(_0x7d8a('0x2'));var moment=require(_0x7d8a('0x3'));var BPromise=require(_0x7d8a('0x4'));var rp=require(_0x7d8a('0x5'));var fs=require('fs');var path=require(_0x7d8a('0x6'));var rimraf=require(_0x7d8a('0x7'));var config=require('../../config/environment');var attributes=require(_0x7d8a('0x8'));module[_0x7d8a('0x9')]=function(_0x405d4b,_0x549149){return _0x405d4b[_0x7d8a('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x7d8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aee=['lodash','util','../../config/logger','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport'];(function(_0x56569c,_0x1cecb7){var _0x28a064=function(_0x31a647){while(--_0x31a647){_0x56569c['push'](_0x56569c['shift']());}};_0x28a064(++_0x1cecb7);}(_0x6aee,0x87));var _0xe6ae=function(_0x10127e,_0x57713e){_0x10127e=_0x10127e-0x0;var _0x23b1f9=_0x6aee[_0x10127e];return _0x23b1f9;};'use strict';var _=require(_0xe6ae('0x0'));var util=require(_0xe6ae('0x1'));var logger=require(_0xe6ae('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe6ae('0x3'));var config=require(_0xe6ae('0x4'));var attributes=require(_0xe6ae('0x5'));module[_0xe6ae('0x6')]=function(_0x2f373b,_0x31fbb4){return _0x2f373b[_0xe6ae('0x7')](_0xe6ae('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 79ded44..8fe55e8 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 _0xf3a5=['rpc','../../config/environment','http','request','then','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4116b3,_0x4a3da1){var _0x4ad9c9=function(_0x118753){while(--_0x118753){_0x4116b3['push'](_0x4116b3['shift']());}};_0x4ad9c9(++_0x4a3da1);}(_0xf3a5,0xaa));var _0x5f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5f3a('0x0'));var util=require(_0x5f3a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f3a('0x2'));var db=require(_0x5f3a('0x3'))['db'];var utils=require(_0x5f3a('0x4'));var logger=require(_0x5f3a('0x5'))(_0x5f3a('0x6'));var config=require(_0x5f3a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5f3a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x110bfd,_0xb33a80,_0x194abd){return new BPromise(function(_0x40ecf9,_0x5802c4){return client[_0x5f3a('0x9')](_0x110bfd,_0x194abd)[_0x5f3a('0xa')](function(_0x34b3e6){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0xb33a80,_0x5f3a('0xb'));logger[_0x5f3a('0xc')](_0x5f3a('0xd'),_0xb33a80,_0x5f3a('0xb'),JSON[_0x5f3a('0xe')](_0x34b3e6));if(_0x34b3e6['error']){if(_0x34b3e6[_0x5f3a('0xf')][_0x5f3a('0x10')]===0x1f4){logger[_0x5f3a('0xf')](_0x5f3a('0x11'),_0xb33a80,_0x34b3e6[_0x5f3a('0xf')][_0x5f3a('0x12')]);return _0x5802c4(_0x34b3e6[_0x5f3a('0xf')][_0x5f3a('0x12')]);}logger[_0x5f3a('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xb33a80,_0x34b3e6[_0x5f3a('0xf')]['message']);return _0x40ecf9(_0x34b3e6[_0x5f3a('0xf')]['message']);}else{logger[_0x5f3a('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xb33a80,_0x5f3a('0xb'));_0x40ecf9(_0x34b3e6[_0x5f3a('0x14')][_0x5f3a('0x12')]);}})[_0x5f3a('0x15')](function(_0x2e75f4){logger[_0x5f3a('0xf')](_0x5f3a('0x11'),_0xb33a80,_0x2e75f4);_0x5802c4(_0x2e75f4);});});} \ No newline at end of file +var _0xd8a8=['rpc','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x472378,_0x327f94){var _0x4c1e48=function(_0x300b1c){while(--_0x300b1c){_0x472378['push'](_0x472378['shift']());}};_0x4c1e48(++_0x327f94);}(_0xd8a8,0x197));var _0x8d8a=function(_0x2f5d4c,_0x1ddba4){_0x2f5d4c=_0x2f5d4c-0x0;var _0x5e3c51=_0xd8a8[_0x2f5d4c];return _0x5e3c51;};'use strict';var _=require('lodash');var util=require(_0x8d8a('0x0'));var moment=require(_0x8d8a('0x1'));var BPromise=require(_0x8d8a('0x2'));var rs=require(_0x8d8a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d8a('0x4'))['db'];var utils=require(_0x8d8a('0x5'));var logger=require(_0x8d8a('0x6'))(_0x8d8a('0x7'));var config=require('../../config/environment');var jayson=require(_0x8d8a('0x8'));var client=jayson[_0x8d8a('0x9')][_0x8d8a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d2f4f,_0x5daaf1,_0x508f34){return new BPromise(function(_0x33f915,_0x5859a6){return client[_0x8d8a('0xb')](_0x5d2f4f,_0x508f34)[_0x8d8a('0xc')](function(_0xefa427){logger['info'](_0x8d8a('0xd'),_0x5daaf1,_0x8d8a('0xe'));logger[_0x8d8a('0xf')](_0x8d8a('0x10'),_0x5daaf1,'request\x20sent',JSON[_0x8d8a('0x11')](_0xefa427));if(_0xefa427[_0x8d8a('0x12')]){if(_0xefa427[_0x8d8a('0x12')][_0x8d8a('0x13')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x5daaf1,_0xefa427[_0x8d8a('0x12')][_0x8d8a('0x14')]);return _0x5859a6(_0xefa427[_0x8d8a('0x12')][_0x8d8a('0x14')]);}logger[_0x8d8a('0x12')](_0x8d8a('0xd'),_0x5daaf1,_0xefa427[_0x8d8a('0x12')]['message']);return _0x33f915(_0xefa427[_0x8d8a('0x12')][_0x8d8a('0x14')]);}else{logger[_0x8d8a('0x15')](_0x8d8a('0xd'),_0x5daaf1,_0x8d8a('0xe'));_0x33f915(_0xefa427[_0x8d8a('0x16')][_0x8d8a('0x14')]);}})['catch'](function(_0x15b359){logger[_0x8d8a('0x12')](_0x8d8a('0xd'),_0x5daaf1,_0x15b359);_0x5859a6(_0x15b359);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index b2eb7db..9bacb4b 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 _0x6e92=['path','connect-timeout','express','fs-extra','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','/:id','getQuestions','create','put','update','delete','destroy','exports','multer','util'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x6e92,0x154));var _0x26e9=function(_0x4d8790,_0x521730){_0x4d8790=_0x4d8790-0x0;var _0x5e99c4=_0x6e92[_0x4d8790];return _0x5e99c4;};'use strict';var multer=require(_0x26e9('0x0'));var util=require(_0x26e9('0x1'));var path=require(_0x26e9('0x2'));var timeout=require(_0x26e9('0x3'));var express=require(_0x26e9('0x4'));var router=express['Router']();var fs_extra=require(_0x26e9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x26e9('0x6'));var controller=require(_0x26e9('0x7'));router[_0x26e9('0x8')]('/',auth[_0x26e9('0x9')](),controller['index']);router[_0x26e9('0x8')](_0x26e9('0xa'),auth[_0x26e9('0x9')](),controller['describe']);router[_0x26e9('0x8')](_0x26e9('0xb'),auth[_0x26e9('0x9')](),controller['show']);router[_0x26e9('0x8')]('/:id/questions',auth[_0x26e9('0x9')](),controller[_0x26e9('0xc')]);router['post']('/',auth[_0x26e9('0x9')](),controller[_0x26e9('0xd')]);router[_0x26e9('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x26e9('0xf')]);router[_0x26e9('0x10')](_0x26e9('0xb'),auth[_0x26e9('0x9')](),controller[_0x26e9('0x11')]);module[_0x26e9('0x12')]=router; \ No newline at end of file +var _0xda41=['put','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getQuestions','post','create'];(function(_0x52ac6b,_0xb00fc8){var _0x2473af=function(_0x1b36b7){while(--_0x1b36b7){_0x52ac6b['push'](_0x52ac6b['shift']());}};_0x2473af(++_0xb00fc8);}(_0xda41,0xc1));var _0x1da4=function(_0x3fefa0,_0x135236){_0x3fefa0=_0x3fefa0-0x0;var _0xba4821=_0xda41[_0x3fefa0];return _0xba4821;};'use strict';var multer=require('multer');var util=require(_0x1da4('0x0'));var path=require('path');var timeout=require(_0x1da4('0x1'));var express=require(_0x1da4('0x2'));var router=express[_0x1da4('0x3')]();var fs_extra=require(_0x1da4('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1da4('0x5'));var controller=require(_0x1da4('0x6'));router[_0x1da4('0x7')]('/',auth['isAuthenticated'](),controller[_0x1da4('0x8')]);router[_0x1da4('0x7')](_0x1da4('0x9'),auth[_0x1da4('0xa')](),controller[_0x1da4('0xb')]);router[_0x1da4('0x7')](_0x1da4('0xc'),auth[_0x1da4('0xa')](),controller[_0x1da4('0xd')]);router[_0x1da4('0x7')]('/:id/questions',auth[_0x1da4('0xa')](),controller[_0x1da4('0xe')]);router[_0x1da4('0xf')]('/',auth[_0x1da4('0xa')](),controller[_0x1da4('0x10')]);router[_0x1da4('0x11')](_0x1da4('0xc'),auth['isAuthenticated'](),controller[_0x1da4('0x12')]);router[_0x1da4('0x13')](_0x1da4('0xc'),auth[_0x1da4('0xa')](),controller['destroy']);module[_0x1da4('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 627390b..9cbafee 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 _0xce28=['format','STRING','BOOLEAN','moment','DATE','setDataValue'];(function(_0x477514,_0x2605ac){var _0x37f27e=function(_0x2f888d){while(--_0x2f888d){_0x477514['push'](_0x477514['shift']());}};_0x37f27e(++_0x2605ac);}(_0xce28,0xf9));var _0x8ce2=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xce28[_0x369151];return _0x4292d5;};'use strict';var moment=require(_0x8ce2('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0x8ce2('0x1')],'set':function(_0xb8fa5f){this[_0x8ce2('0x2')]('starttime',_0xb8fa5f);this[_0x8ce2('0x2')]('endtime',moment()[_0x8ce2('0x3')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x8ce2('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8ce2('0x4')]},'uniqueid':{'type':Sequelize[_0x8ce2('0x4')]},'calleridname':{'type':Sequelize[_0x8ce2('0x4')]},'calleridnum':{'type':Sequelize[_0x8ce2('0x4')]},'completed':{'type':Sequelize[_0x8ce2('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x5564=['YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','starttime'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x5564,0x1ca));var _0x4556=function(_0x34a7dd,_0x2aa42f){_0x34a7dd=_0x34a7dd-0x0;var _0x48c43c=_0x5564[_0x34a7dd];return _0x48c43c;};'use strict';var moment=require(_0x4556('0x0'));var Sequelize=require(_0x4556('0x1'));module[_0x4556('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x1e7881){this['setDataValue'](_0x4556('0x3'),_0x1e7881);this['setDataValue']('endtime',moment()['format'](_0x4556('0x4')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x4556('0x5')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4556('0x5')]},'uniqueid':{'type':Sequelize[_0x4556('0x5')]},'calleridname':{'type':Sequelize[_0x4556('0x5')]},'calleridnum':{'type':Sequelize[_0x4556('0x5')]},'completed':{'type':Sequelize[_0x4556('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index a2992cc..e6d866c 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 _0x577f=['set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','JscriptySessionReport','includeAll','include','findAll','rows','params','catch','create','body','find','findOne','JscriptyQuestionReport','order','SessionId','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count'];(function(_0x4f4ccb,_0x3d519e){var _0x220a92=function(_0x2c671c){while(--_0x2c671c){_0x4f4ccb['push'](_0x4f4ccb['shift']());}};_0x220a92(++_0x3d519e);}(_0x577f,0x79));var _0xf577=function(_0xa73d10,_0x297257){_0xa73d10=_0xa73d10-0x0;var _0x1b8048=_0x577f[_0xa73d10];return _0x1b8048;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf577('0x0'));var jsonpatch=require(_0xf577('0x1'));var rp=require(_0xf577('0x2'));var moment=require(_0xf577('0x3'));var BPromise=require(_0xf577('0x4'));var Mustache=require(_0xf577('0x5'));var util=require(_0xf577('0x6'));var path=require('path');var sox=require(_0xf577('0x7'));var csv=require(_0xf577('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf577('0x9'));var _=require('lodash');var squel=require(_0xf577('0xa'));var crypto=require(_0xf577('0xb'));var jsforce=require(_0xf577('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf577('0x8'));var querystring=require(_0xf577('0xd'));var Papa=require(_0xf577('0xe'));var Redis=require(_0xf577('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf577('0x10'));var as=require(_0xf577('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf577('0x12'))(_0xf577('0x13'));var utils=require('../../config/utils');var config=require(_0xf577('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf577('0x15'))['db'];function respondWithStatusCode(_0x557def,_0xf48c08){_0xf48c08=_0xf48c08||0xcc;return function(_0x406e5c){if(_0x406e5c){return _0x557def['sendStatus'](_0xf48c08);}return _0x557def['status'](_0xf48c08)[_0xf577('0x16')]();};}function respondWithResult(_0x42b2d4,_0x435791){_0x435791=_0x435791||0xc8;return function(_0x1509ac){if(_0x1509ac){return _0x42b2d4[_0xf577('0x17')](_0x435791)[_0xf577('0x18')](_0x1509ac);}};}function respondWithFilteredResult(_0x44097e,_0x292af1){return function(_0x257dc4){if(_0x257dc4){var _0x5f4cc2=typeof _0x292af1[_0xf577('0x19')]===_0xf577('0x1a')&&typeof _0x292af1[_0xf577('0x1b')]==='undefined';var _0xf33ea6=_0x257dc4[_0xf577('0x1c')];var _0x534cee=_0x5f4cc2?0x0:_0x292af1[_0xf577('0x19')];var _0x339b1c=_0x5f4cc2?_0x257dc4[_0xf577('0x1c')]:_0x292af1[_0xf577('0x19')]+_0x292af1[_0xf577('0x1b')];var _0x4bb3bb;if(_0x339b1c>=_0xf33ea6){_0x339b1c=_0xf33ea6;_0x4bb3bb=0xc8;}else{_0x4bb3bb=0xce;}_0x44097e['status'](_0x4bb3bb);return _0x44097e[_0xf577('0x1d')](_0xf577('0x1e'),_0x534cee+'-'+_0x339b1c+'/'+_0xf33ea6)[_0xf577('0x18')](_0x257dc4);}return null;};}function patchUpdates(_0x455984){return function(_0x5e7e8b){try{jsonpatch['apply'](_0x5e7e8b,_0x455984,!![]);}catch(_0x97764){return BPromise[_0xf577('0x1f')](_0x97764);}return _0x5e7e8b[_0xf577('0x20')]();};}function saveUpdates(_0x26f335,_0x50c366){return function(_0x57eabb){if(_0x57eabb){return _0x57eabb[_0xf577('0x21')](_0x26f335)[_0xf577('0x22')](function(_0x66aef9){return _0x66aef9;});}return null;};}function removeEntity(_0x33e885,_0x57849c){return function(_0x4e4e47){if(_0x4e4e47){return _0x4e4e47[_0xf577('0x23')]()[_0xf577('0x22')](function(){_0x33e885[_0xf577('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57b652,_0x4199b6){return function(_0x48173c){if(!_0x48173c){_0x57b652[_0xf577('0x24')](0x194);}return _0x48173c;};}function handleError(_0x46eb15,_0x10a16b){_0x10a16b=_0x10a16b||0x1f4;return function(_0x551ea3){logger[_0xf577('0x25')](_0x551ea3['stack']);if(_0x551ea3['name']){delete _0x551ea3[_0xf577('0x26')];}_0x46eb15[_0xf577('0x17')](_0x10a16b)[_0xf577('0x27')](_0x551ea3);};}exports[_0xf577('0x28')]=function(_0xc93911,_0x4069c4){var _0x2c3d2b={},_0x2cab93={},_0x8274b6={'count':0x0,'rows':[]};var _0x2e8499=_[_0xf577('0x29')](db['JscriptySessionReport'][_0xf577('0x2a')],function(_0x3f39c0){return{'name':_0x3f39c0['fieldName'],'type':_0x3f39c0[_0xf577('0x2b')][_0xf577('0x2c')]};});_0x2cab93['model']=_['map'](_0x2e8499,_0xf577('0x26'));_0x2cab93['query']=_[_0xf577('0x2d')](_0xc93911[_0xf577('0x2e')]);_0x2cab93[_0xf577('0x2f')]=_[_0xf577('0x30')](_0x2cab93[_0xf577('0x31')],_0x2cab93[_0xf577('0x2e')]);_0x2c3d2b[_0xf577('0x32')]=_[_0xf577('0x30')](_0x2cab93['model'],qs[_0xf577('0x33')](_0xc93911[_0xf577('0x2e')]['fields']));_0x2c3d2b[_0xf577('0x32')]=_0x2c3d2b['attributes'][_0xf577('0x34')]?_0x2c3d2b[_0xf577('0x32')]:_0x2cab93[_0xf577('0x31')];if(!_0xc93911[_0xf577('0x2e')]['hasOwnProperty'](_0xf577('0x35'))){_0x2c3d2b[_0xf577('0x1b')]=qs[_0xf577('0x1b')](_0xc93911[_0xf577('0x2e')][_0xf577('0x1b')]);_0x2c3d2b[_0xf577('0x19')]=qs['offset'](_0xc93911[_0xf577('0x2e')][_0xf577('0x19')]);}_0x2c3d2b['order']=qs[_0xf577('0x36')](_0xc93911[_0xf577('0x2e')][_0xf577('0x36')]);_0x2c3d2b['where']=qs[_0xf577('0x2f')](_[_0xf577('0x37')](_0xc93911[_0xf577('0x2e')],_0x2cab93['filters']),_0x2e8499);if(_0xc93911[_0xf577('0x2e')][_0xf577('0x38')]){_0x2c3d2b[_0xf577('0x39')]=_[_0xf577('0x3a')](_0x2c3d2b[_0xf577('0x39')],{'$or':_['map'](_0x2e8499,function(_0xd0785c){if(_0xd0785c[_0xf577('0x2b')]!==_0xf577('0x3b')){var _0x3620cc={};_0x3620cc[_0xd0785c[_0xf577('0x26')]]={'$like':'%'+_0xc93911[_0xf577('0x2e')][_0xf577('0x38')]+'%'};return _0x3620cc;}})});}_0x2c3d2b=_[_0xf577('0x3a')]({},_0x2c3d2b,_0xc93911[_0xf577('0x3c')]);var _0x2fb97c={'where':_0x2c3d2b[_0xf577('0x39')]};return db[_0xf577('0x3d')][_0xf577('0x1c')](_0x2fb97c)[_0xf577('0x22')](function(_0x673e30){_0x8274b6[_0xf577('0x1c')]=_0x673e30;if(_0xc93911[_0xf577('0x2e')][_0xf577('0x3e')]){_0x2c3d2b[_0xf577('0x3f')]=[{'all':!![]}];}return db[_0xf577('0x3d')][_0xf577('0x40')](_0x2c3d2b);})['then'](function(_0x2db127){_0x8274b6[_0xf577('0x41')]=_0x2db127;return _0x8274b6;})[_0xf577('0x22')](respondWithFilteredResult(_0x4069c4,_0x2c3d2b))['catch'](handleError(_0x4069c4,null));};exports['show']=function(_0x57c2d4,_0x50c233){var _0x4ca3e6={'raw':!![],'where':{'id':_0x57c2d4[_0xf577('0x42')]['id']}},_0x21654d={};_0x21654d[_0xf577('0x31')]=_[_0xf577('0x2d')](db[_0xf577('0x3d')][_0xf577('0x2a')]);_0x21654d['query']=_[_0xf577('0x2d')](_0x57c2d4[_0xf577('0x2e')]);_0x21654d[_0xf577('0x2f')]=_[_0xf577('0x30')](_0x21654d['model'],_0x21654d[_0xf577('0x2e')]);_0x4ca3e6['attributes']=_[_0xf577('0x30')](_0x21654d[_0xf577('0x31')],qs[_0xf577('0x33')](_0x57c2d4[_0xf577('0x2e')]['fields']));_0x4ca3e6[_0xf577('0x32')]=_0x4ca3e6[_0xf577('0x32')][_0xf577('0x34')]?_0x4ca3e6[_0xf577('0x32')]:_0x21654d[_0xf577('0x31')];if(_0x57c2d4[_0xf577('0x2e')][_0xf577('0x3e')]){_0x4ca3e6['include']=[{'all':!![]}];}_0x4ca3e6=_[_0xf577('0x3a')]({},_0x4ca3e6,_0x57c2d4['options']);return db[_0xf577('0x3d')]['find'](_0x4ca3e6)[_0xf577('0x22')](handleEntityNotFound(_0x50c233,null))[_0xf577('0x22')](respondWithResult(_0x50c233,null))[_0xf577('0x43')](handleError(_0x50c233,null));};exports[_0xf577('0x44')]=function(_0x2aa158,_0x244c5c){return db[_0xf577('0x3d')][_0xf577('0x44')](_0x2aa158[_0xf577('0x45')],{})[_0xf577('0x22')](respondWithResult(_0x244c5c,0xc9))[_0xf577('0x43')](handleError(_0x244c5c,null));};exports[_0xf577('0x21')]=function(_0x17c26d,_0x39f28b){if(_0x17c26d[_0xf577('0x45')]['id']){delete _0x17c26d[_0xf577('0x45')]['id'];}return db[_0xf577('0x3d')][_0xf577('0x46')]({'where':{'id':_0x17c26d[_0xf577('0x42')]['id']}})[_0xf577('0x22')](handleEntityNotFound(_0x39f28b,null))[_0xf577('0x22')](saveUpdates(_0x17c26d[_0xf577('0x45')],null))[_0xf577('0x22')](respondWithResult(_0x39f28b,null))[_0xf577('0x43')](handleError(_0x39f28b,null));};exports[_0xf577('0x23')]=function(_0x312c0c,_0x5e7d70){return db['JscriptySessionReport']['find']({'where':{'id':_0x312c0c[_0xf577('0x42')]['id']}})[_0xf577('0x22')](handleEntityNotFound(_0x5e7d70,null))[_0xf577('0x22')](removeEntity(_0x5e7d70,null))[_0xf577('0x43')](handleError(_0x5e7d70,null));};exports['describe']=function(_0x22d34e,_0x321e15){return db[_0xf577('0x3d')]['describe']()['then'](respondWithResult(_0x321e15,null))[_0xf577('0x43')](handleError(_0x321e15,null));};exports['getQuestions']=function(_0x2ac696,_0xa9c7e1,_0x4e4d77){var _0x57deca={'raw':!![],'where':{}};var _0x5ceb85={};var _0x1caf1d={'count':0x0,'rows':[]};return db[_0xf577('0x3d')][_0xf577('0x47')]({'where':{'id':_0x2ac696[_0xf577('0x42')]['id']}})[_0xf577('0x22')](handleEntityNotFound(_0xa9c7e1,null))[_0xf577('0x22')](function(_0x24fe4d){if(_0x24fe4d){_0x5ceb85['model']=_[_0xf577('0x2d')](db[_0xf577('0x48')][_0xf577('0x2a')]);_0x5ceb85[_0xf577('0x2e')]=_[_0xf577('0x2d')](_0x2ac696[_0xf577('0x2e')]);_0x5ceb85[_0xf577('0x2f')]=_[_0xf577('0x30')](_0x5ceb85[_0xf577('0x31')],_0x5ceb85[_0xf577('0x2e')]);_0x57deca[_0xf577('0x32')]=_[_0xf577('0x30')](_0x5ceb85['model'],qs['fields'](_0x2ac696[_0xf577('0x2e')][_0xf577('0x33')]));_0x57deca[_0xf577('0x32')]=_0x57deca['attributes'][_0xf577('0x34')]?_0x57deca[_0xf577('0x32')]:_0x5ceb85[_0xf577('0x31')];if(!_0x2ac696['query']['hasOwnProperty']('nolimit')){_0x57deca[_0xf577('0x1b')]=qs[_0xf577('0x1b')](_0x2ac696['query'][_0xf577('0x1b')]);_0x57deca[_0xf577('0x19')]=qs[_0xf577('0x19')](_0x2ac696[_0xf577('0x2e')][_0xf577('0x19')]);}_0x57deca[_0xf577('0x49')]=qs[_0xf577('0x36')](_0x2ac696[_0xf577('0x2e')][_0xf577('0x36')]);_0x57deca['where']=qs[_0xf577('0x2f')](_[_0xf577('0x37')](_0x2ac696['query'],_0x5ceb85[_0xf577('0x2f')]));_0x57deca[_0xf577('0x39')][_0xf577('0x4a')]=_0x24fe4d['id'];if(_0x2ac696[_0xf577('0x2e')]['filter']){_0x57deca[_0xf577('0x39')]=_[_0xf577('0x3a')](_0x57deca[_0xf577('0x39')],{'$or':_['map'](_0x57deca[_0xf577('0x32')],function(_0x227acc){var _0x23d32b={};_0x23d32b[_0x227acc]={'$like':'%'+_0x2ac696[_0xf577('0x2e')][_0xf577('0x38')]+'%'};return _0x23d32b;})});}_0x57deca=_[_0xf577('0x3a')]({},_0x57deca,_0x2ac696[_0xf577('0x3c')]);return db[_0xf577('0x48')][_0xf577('0x1c')]({'where':_0x57deca['where']})['then'](function(_0x54f5eb){_0x1caf1d[_0xf577('0x1c')]=_0x54f5eb;if(_0x2ac696[_0xf577('0x2e')]['includeAll']){_0x57deca[_0xf577('0x3f')]=[{'all':!![]}];}return db[_0xf577('0x48')]['findAll'](_0x57deca);})[_0xf577('0x22')](function(_0x26a08b){_0x1caf1d[_0xf577('0x41')]=_0x26a08b;return _0x1caf1d;});}})[_0xf577('0x22')](respondWithFilteredResult(_0xa9c7e1,_0x57deca))[_0xf577('0x43')](handleError(_0xa9c7e1,null));}; \ No newline at end of file +var _0x4832=['sendStatus','status','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','catch','params','describe','getQuestions','findOne','JscriptyQuestionReport','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util'];(function(_0x470376,_0x23a277){var _0x3159d8=function(_0x3b38ba){while(--_0x3b38ba){_0x470376['push'](_0x470376['shift']());}};_0x3159d8(++_0x23a277);}(_0x4832,0xcc));var _0x2483=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0x4832[_0x421eeb];return _0x2c7371;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2483('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2483('0x1'));var rp=require(_0x2483('0x2'));var moment=require(_0x2483('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2483('0x4'));var path=require(_0x2483('0x5'));var sox=require('sox');var csv=require(_0x2483('0x6'));var ejs=require(_0x2483('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2483('0x8'));var crypto=require(_0x2483('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x2483('0xa'));var toCsv=require(_0x2483('0x6'));var querystring=require('querystring');var Papa=require(_0x2483('0xb'));var Redis=require(_0x2483('0xc'));var authService=require(_0x2483('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2483('0xe'));var logger=require(_0x2483('0xf'))(_0x2483('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2483('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d5fb4,_0x4a7b48){_0x4a7b48=_0x4a7b48||0xcc;return function(_0x22bc52){if(_0x22bc52){return _0x4d5fb4[_0x2483('0x12')](_0x4a7b48);}return _0x4d5fb4[_0x2483('0x13')](_0x4a7b48)['end']();};}function respondWithResult(_0x5a8c9c,_0x54bc0b){_0x54bc0b=_0x54bc0b||0xc8;return function(_0x3f817f){if(_0x3f817f){return _0x5a8c9c[_0x2483('0x13')](_0x54bc0b)['json'](_0x3f817f);}};}function respondWithFilteredResult(_0xc240d0,_0x2d6467){return function(_0x454756){if(_0x454756){var _0x4278d9=typeof _0x2d6467['offset']===_0x2483('0x14')&&typeof _0x2d6467[_0x2483('0x15')]==='undefined';var _0xa28476=_0x454756['count'];var _0x505598=_0x4278d9?0x0:_0x2d6467['offset'];var _0x4a071a=_0x4278d9?_0x454756[_0x2483('0x16')]:_0x2d6467['offset']+_0x2d6467[_0x2483('0x15')];var _0xdb27c7;if(_0x4a071a>=_0xa28476){_0x4a071a=_0xa28476;_0xdb27c7=0xc8;}else{_0xdb27c7=0xce;}_0xc240d0[_0x2483('0x13')](_0xdb27c7);return _0xc240d0[_0x2483('0x17')](_0x2483('0x18'),_0x505598+'-'+_0x4a071a+'/'+_0xa28476)[_0x2483('0x19')](_0x454756);}return null;};}function patchUpdates(_0x176138){return function(_0xc6f18){try{jsonpatch[_0x2483('0x1a')](_0xc6f18,_0x176138,!![]);}catch(_0x41d5b8){return BPromise['reject'](_0x41d5b8);}return _0xc6f18[_0x2483('0x1b')]();};}function saveUpdates(_0x25f6e9,_0x45676a){return function(_0x5e8d7f){if(_0x5e8d7f){return _0x5e8d7f[_0x2483('0x1c')](_0x25f6e9)[_0x2483('0x1d')](function(_0x475759){return _0x475759;});}return null;};}function removeEntity(_0x51763b,_0x383ded){return function(_0x36170b){if(_0x36170b){return _0x36170b[_0x2483('0x1e')]()[_0x2483('0x1d')](function(){_0x51763b[_0x2483('0x13')](0xcc)[_0x2483('0x1f')]();});}};}function handleEntityNotFound(_0x123dd0,_0x331058){return function(_0x51dcfa){if(!_0x51dcfa){_0x123dd0[_0x2483('0x12')](0x194);}return _0x51dcfa;};}function handleError(_0x49d8c6,_0x44433a){_0x44433a=_0x44433a||0x1f4;return function(_0x392924){logger[_0x2483('0x20')](_0x392924[_0x2483('0x21')]);if(_0x392924[_0x2483('0x22')]){delete _0x392924[_0x2483('0x22')];}_0x49d8c6[_0x2483('0x13')](_0x44433a)[_0x2483('0x23')](_0x392924);};}exports[_0x2483('0x24')]=function(_0x3160f8,_0x3b2f90){var _0x218cf7={},_0x47aae6={},_0x4b17ac={'count':0x0,'rows':[]};var _0xac006f=_[_0x2483('0x25')](db[_0x2483('0x26')][_0x2483('0x27')],function(_0x30e47a){return{'name':_0x30e47a[_0x2483('0x28')],'type':_0x30e47a[_0x2483('0x29')]['key']};});_0x47aae6['model']=_[_0x2483('0x25')](_0xac006f,_0x2483('0x22'));_0x47aae6[_0x2483('0x2a')]=_[_0x2483('0x2b')](_0x3160f8[_0x2483('0x2a')]);_0x47aae6['filters']=_[_0x2483('0x2c')](_0x47aae6[_0x2483('0x2d')],_0x47aae6['query']);_0x218cf7[_0x2483('0x2e')]=_[_0x2483('0x2c')](_0x47aae6['model'],qs['fields'](_0x3160f8[_0x2483('0x2a')][_0x2483('0x2f')]));_0x218cf7['attributes']=_0x218cf7[_0x2483('0x2e')][_0x2483('0x30')]?_0x218cf7[_0x2483('0x2e')]:_0x47aae6[_0x2483('0x2d')];if(!_0x3160f8[_0x2483('0x2a')]['hasOwnProperty'](_0x2483('0x31'))){_0x218cf7['limit']=qs[_0x2483('0x15')](_0x3160f8[_0x2483('0x2a')]['limit']);_0x218cf7[_0x2483('0x32')]=qs[_0x2483('0x32')](_0x3160f8[_0x2483('0x2a')][_0x2483('0x32')]);}_0x218cf7[_0x2483('0x33')]=qs[_0x2483('0x34')](_0x3160f8['query'][_0x2483('0x34')]);_0x218cf7[_0x2483('0x35')]=qs[_0x2483('0x36')](_[_0x2483('0x37')](_0x3160f8[_0x2483('0x2a')],_0x47aae6[_0x2483('0x36')]),_0xac006f);if(_0x3160f8[_0x2483('0x2a')][_0x2483('0x38')]){_0x218cf7[_0x2483('0x35')]=_[_0x2483('0x39')](_0x218cf7[_0x2483('0x35')],{'$or':_[_0x2483('0x25')](_0xac006f,function(_0x5db2eb){if(_0x5db2eb[_0x2483('0x29')]!==_0x2483('0x3a')){var _0x3d5320={};_0x3d5320[_0x5db2eb[_0x2483('0x22')]]={'$like':'%'+_0x3160f8[_0x2483('0x2a')][_0x2483('0x38')]+'%'};return _0x3d5320;}})});}_0x218cf7=_[_0x2483('0x39')]({},_0x218cf7,_0x3160f8[_0x2483('0x3b')]);var _0x421779={'where':_0x218cf7['where']};return db[_0x2483('0x26')][_0x2483('0x16')](_0x421779)[_0x2483('0x1d')](function(_0x3e66db){_0x4b17ac[_0x2483('0x16')]=_0x3e66db;if(_0x3160f8[_0x2483('0x2a')][_0x2483('0x3c')]){_0x218cf7[_0x2483('0x3d')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x2483('0x3e')](_0x218cf7);})[_0x2483('0x1d')](function(_0x263efd){_0x4b17ac[_0x2483('0x3f')]=_0x263efd;return _0x4b17ac;})[_0x2483('0x1d')](respondWithFilteredResult(_0x3b2f90,_0x218cf7))['catch'](handleError(_0x3b2f90,null));};exports[_0x2483('0x40')]=function(_0x16527f,_0x3909c2){var _0x481edb={'raw':!![],'where':{'id':_0x16527f['params']['id']}},_0x4b2737={};_0x4b2737[_0x2483('0x2d')]=_[_0x2483('0x2b')](db['JscriptySessionReport'][_0x2483('0x27')]);_0x4b2737[_0x2483('0x2a')]=_[_0x2483('0x2b')](_0x16527f['query']);_0x4b2737[_0x2483('0x36')]=_['intersection'](_0x4b2737[_0x2483('0x2d')],_0x4b2737['query']);_0x481edb[_0x2483('0x2e')]=_[_0x2483('0x2c')](_0x4b2737['model'],qs[_0x2483('0x2f')](_0x16527f[_0x2483('0x2a')][_0x2483('0x2f')]));_0x481edb[_0x2483('0x2e')]=_0x481edb[_0x2483('0x2e')][_0x2483('0x30')]?_0x481edb[_0x2483('0x2e')]:_0x4b2737['model'];if(_0x16527f[_0x2483('0x2a')][_0x2483('0x3c')]){_0x481edb[_0x2483('0x3d')]=[{'all':!![]}];}_0x481edb=_[_0x2483('0x39')]({},_0x481edb,_0x16527f[_0x2483('0x3b')]);return db[_0x2483('0x26')][_0x2483('0x41')](_0x481edb)[_0x2483('0x1d')](handleEntityNotFound(_0x3909c2,null))[_0x2483('0x1d')](respondWithResult(_0x3909c2,null))['catch'](handleError(_0x3909c2,null));};exports[_0x2483('0x42')]=function(_0xcb2de8,_0x39148c){return db[_0x2483('0x26')][_0x2483('0x42')](_0xcb2de8[_0x2483('0x43')],{})[_0x2483('0x1d')](respondWithResult(_0x39148c,0xc9))[_0x2483('0x44')](handleError(_0x39148c,null));};exports[_0x2483('0x1c')]=function(_0x24a656,_0xca0fc3){if(_0x24a656['body']['id']){delete _0x24a656[_0x2483('0x43')]['id'];}return db[_0x2483('0x26')][_0x2483('0x41')]({'where':{'id':_0x24a656['params']['id']}})[_0x2483('0x1d')](handleEntityNotFound(_0xca0fc3,null))[_0x2483('0x1d')](saveUpdates(_0x24a656[_0x2483('0x43')],null))[_0x2483('0x1d')](respondWithResult(_0xca0fc3,null))[_0x2483('0x44')](handleError(_0xca0fc3,null));};exports[_0x2483('0x1e')]=function(_0x48a9d7,_0x57acaf){return db[_0x2483('0x26')][_0x2483('0x41')]({'where':{'id':_0x48a9d7[_0x2483('0x45')]['id']}})[_0x2483('0x1d')](handleEntityNotFound(_0x57acaf,null))[_0x2483('0x1d')](removeEntity(_0x57acaf,null))[_0x2483('0x44')](handleError(_0x57acaf,null));};exports[_0x2483('0x46')]=function(_0x435e35,_0x15b10c){return db[_0x2483('0x26')][_0x2483('0x46')]()[_0x2483('0x1d')](respondWithResult(_0x15b10c,null))['catch'](handleError(_0x15b10c,null));};exports[_0x2483('0x47')]=function(_0x3f1280,_0x59321c,_0x34787b){var _0x58860b={'raw':!![],'where':{}};var _0x3f3e50={};var _0x5dd1f0={'count':0x0,'rows':[]};return db[_0x2483('0x26')][_0x2483('0x48')]({'where':{'id':_0x3f1280['params']['id']}})[_0x2483('0x1d')](handleEntityNotFound(_0x59321c,null))[_0x2483('0x1d')](function(_0x3b5161){if(_0x3b5161){_0x3f3e50[_0x2483('0x2d')]=_[_0x2483('0x2b')](db[_0x2483('0x49')]['rawAttributes']);_0x3f3e50[_0x2483('0x2a')]=_[_0x2483('0x2b')](_0x3f1280[_0x2483('0x2a')]);_0x3f3e50[_0x2483('0x36')]=_[_0x2483('0x2c')](_0x3f3e50[_0x2483('0x2d')],_0x3f3e50[_0x2483('0x2a')]);_0x58860b['attributes']=_[_0x2483('0x2c')](_0x3f3e50['model'],qs[_0x2483('0x2f')](_0x3f1280[_0x2483('0x2a')][_0x2483('0x2f')]));_0x58860b[_0x2483('0x2e')]=_0x58860b[_0x2483('0x2e')][_0x2483('0x30')]?_0x58860b['attributes']:_0x3f3e50['model'];if(!_0x3f1280[_0x2483('0x2a')]['hasOwnProperty'](_0x2483('0x31'))){_0x58860b[_0x2483('0x15')]=qs[_0x2483('0x15')](_0x3f1280['query'][_0x2483('0x15')]);_0x58860b[_0x2483('0x32')]=qs['offset'](_0x3f1280['query']['offset']);}_0x58860b[_0x2483('0x33')]=qs[_0x2483('0x34')](_0x3f1280[_0x2483('0x2a')]['sort']);_0x58860b[_0x2483('0x35')]=qs['filters'](_['pick'](_0x3f1280[_0x2483('0x2a')],_0x3f3e50[_0x2483('0x36')]));_0x58860b[_0x2483('0x35')]['SessionId']=_0x3b5161['id'];if(_0x3f1280[_0x2483('0x2a')][_0x2483('0x38')]){_0x58860b[_0x2483('0x35')]=_['merge'](_0x58860b[_0x2483('0x35')],{'$or':_[_0x2483('0x25')](_0x58860b[_0x2483('0x2e')],function(_0x37aada){var _0x1dedf2={};_0x1dedf2[_0x37aada]={'$like':'%'+_0x3f1280[_0x2483('0x2a')]['filter']+'%'};return _0x1dedf2;})});}_0x58860b=_[_0x2483('0x39')]({},_0x58860b,_0x3f1280[_0x2483('0x3b')]);return db[_0x2483('0x49')][_0x2483('0x16')]({'where':_0x58860b['where']})[_0x2483('0x1d')](function(_0x1f0594){_0x5dd1f0[_0x2483('0x16')]=_0x1f0594;if(_0x3f1280[_0x2483('0x2a')][_0x2483('0x3c')]){_0x58860b['include']=[{'all':!![]}];}return db[_0x2483('0x49')]['findAll'](_0x58860b);})['then'](function(_0x5d7552){_0x5dd1f0[_0x2483('0x3f')]=_0x5d7552;return _0x5dd1f0;});}})[_0x2483('0x1d')](respondWithFilteredResult(_0x59321c,_0x58860b))[_0x2483('0x44')](handleError(_0x59321c,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index d9cd308..0adee29 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 _0xbd51=['exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','./jscriptySessionReport.attributes'];(function(_0x27dcee,_0x181eca){var _0x286455=function(_0x4df27c){while(--_0x4df27c){_0x27dcee['push'](_0x27dcee['shift']());}};_0x286455(++_0x181eca);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x406cea,_0x455c52){_0x406cea=_0x406cea-0x0;var _0x1be374=_0xbd51[_0x406cea];return _0x1be374;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x390846,_0x3eb289){var _0x4e7977=function(_0x23f0e4){while(--_0x23f0e4){_0x390846['push'](_0x390846['shift']());}};_0x4e7977(++_0x3eb289);}(_0xfcf0,0x138));var _0x0fcf=function(_0x239b31,_0x44a64d){_0x239b31=_0x239b31-0x0;var _0x41c8be=_0xfcf0[_0x239b31];return _0x41c8be;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'report_jscripty_sessions','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 a3ab3f4..bfd65b5 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5cc71f,_0x4f6f52){var _0x4e1b52=function(_0x1bea3b){while(--_0x1bea3b){_0x5cc71f['push'](_0x5cc71f['shift']());}};_0x4e1b52(++_0x4f6f52);}(_0xadb5,0xad));var _0x5adb=function(_0x527290,_0x243ccf){_0x527290=_0x527290-0x0;var _0x2f2ee3=_0xadb5[_0x527290];return _0x2f2ee3;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x1967=['then','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x1967,0x173));var _0x7196=function(_0x346706,_0x4cec69){_0x346706=_0x346706-0x0;var _0x1a9673=_0x1967[_0x346706];return _0x1a9673;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index e5a95ee..f6d434e 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 _0x96ae=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','update','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','util','path'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x96ae,0xda));var _0xe96a=function(_0x5f4abc,_0x1692ac){_0x5f4abc=_0x5f4abc-0x0;var _0x3c29a6=_0x96ae[_0x5f4abc];return _0x3c29a6;};'use strict';var multer=require(_0xe96a('0x0'));var util=require(_0xe96a('0x1'));var path=require(_0xe96a('0x2'));var timeout=require(_0xe96a('0x3'));var express=require('express');var router=express[_0xe96a('0x4')]();var fs_extra=require(_0xe96a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe96a('0x6'));var config=require(_0xe96a('0x7'));var controller=require(_0xe96a('0x8'));router[_0xe96a('0x9')]('/',controller[_0xe96a('0xa')]);router[_0xe96a('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xe96a('0xc')]);router[_0xe96a('0x9')](_0xe96a('0xd'),auth[_0xe96a('0xe')](),controller[_0xe96a('0xf')]);module[_0xe96a('0x10')]=router; \ No newline at end of file +var _0xed04=['put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index'];(function(_0x3b2244,_0x54873f){var _0x2dcc14=function(_0x53d73f){while(--_0x53d73f){_0x3b2244['push'](_0x3b2244['shift']());}};_0x2dcc14(++_0x54873f);}(_0xed04,0x123));var _0x4ed0=function(_0x554ed5,_0x374b43){_0x554ed5=_0x554ed5-0x0;var _0x3fddb5=_0xed04[_0x554ed5];return _0x3fddb5;};'use strict';var multer=require(_0x4ed0('0x0'));var util=require('util');var path=require(_0x4ed0('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ed0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4ed0('0x3'));var interaction=require(_0x4ed0('0x4'));var config=require(_0x4ed0('0x5'));var controller=require(_0x4ed0('0x6'));router[_0x4ed0('0x7')]('/',controller[_0x4ed0('0x8')]);router[_0x4ed0('0x9')](_0x4ed0('0xa'),auth[_0x4ed0('0xb')](),controller[_0x4ed0('0xc')]);router[_0x4ed0('0x7')](_0x4ed0('0xd'),auth[_0x4ed0('0xb')](),controller[_0x4ed0('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index acf0b98..df84e7f 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 _0x3e1b=['TEXT','STRING','INTEGER'];(function(_0x1ac5e1,_0x43a483){var _0x3ae80e=function(_0x234518){while(--_0x234518){_0x1ac5e1['push'](_0x1ac5e1['shift']());}};_0x3ae80e(++_0x43a483);}(_0x3e1b,0x18c));var _0xb3e1=function(_0x12503c,_0x4dc558){_0x12503c=_0x12503c-0x0;var _0x88119b=_0x3e1b[_0x12503c];return _0x88119b;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0xb3e1('0x0')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xb3e1('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xb3e1('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd2db=['STRING','INTEGER','exports','TEXT'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xd2db,0x18a));var _0xbd2d=function(_0x4256d5,_0x11d4a8){_0x4256d5=_0x4256d5-0x0;var _0x28695b=_0xd2db[_0x4256d5];return _0x28695b;};'use strict';var Sequelize=require('sequelize');module[_0xbd2d('0x0')]={'license':{'type':Sequelize[_0xbd2d('0x1')]},'data1':{'type':Sequelize[_0xbd2d('0x2')]},'data2':{'type':Sequelize[_0xbd2d('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xbd2d('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 272a2bc..d2460a3 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 _0xa474=['download','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','send','../../config/license/util','model','rawAttributes','query','keys','filters','intersection','attributes','fields','merge','options','catch','update','body','License','find','params','get','key','demo','downloadLogFile','license-info.log','join','/var','xcally','Content-disposition','attachment;\x20filename=','Content-Type'];(function(_0x396952,_0x56b463){var _0x53d27c=function(_0xe5d83f){while(--_0xe5d83f){_0x396952['push'](_0x396952['shift']());}};_0x53d27c(++_0x56b463);}(_0xa474,0x16e));var _0x4a47=function(_0x2c0b6d,_0x4afcba){_0x2c0b6d=_0x2c0b6d-0x0;var _0x310c8e=_0xa474[_0x2c0b6d];return _0x310c8e;};'use strict';var emlformat=require(_0x4a47('0x0'));var rimraf=require(_0x4a47('0x1'));var zipdir=require(_0x4a47('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a47('0x3'));var moment=require(_0x4a47('0x4'));var BPromise=require(_0x4a47('0x5'));var Mustache=require(_0x4a47('0x6'));var util=require(_0x4a47('0x7'));var path=require(_0x4a47('0x8'));var sox=require(_0x4a47('0x9'));var csv=require(_0x4a47('0xa'));var ejs=require(_0x4a47('0xb'));var fs=require('fs');var fs_extra=require(_0x4a47('0xc'));var _=require(_0x4a47('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4a47('0xe'));var deskjs=require(_0x4a47('0xf'));var toCsv=require(_0x4a47('0xa'));var querystring=require(_0x4a47('0x10'));var Papa=require(_0x4a47('0x11'));var Redis=require(_0x4a47('0x12'));var authService=require(_0x4a47('0x13'));var qs=require(_0x4a47('0x14'));var as=require(_0x4a47('0x15'));var hardwareService=require(_0x4a47('0x16'));var logger=require(_0x4a47('0x17'))(_0x4a47('0x18'));var utils=require(_0x4a47('0x19'));var config=require(_0x4a47('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x4a47('0x1b'))['db'];function respondWithStatusCode(_0x27f35a,_0x5ab751){_0x5ab751=_0x5ab751||0xcc;return function(_0x22c867){if(_0x22c867){return _0x27f35a[_0x4a47('0x1c')](_0x5ab751);}return _0x27f35a[_0x4a47('0x1d')](_0x5ab751)[_0x4a47('0x1e')]();};}function respondWithResult(_0x4d85ea,_0x2b7cca){_0x2b7cca=_0x2b7cca||0xc8;return function(_0x46a9c3){if(_0x46a9c3){return _0x4d85ea['status'](_0x2b7cca)[_0x4a47('0x1f')](_0x46a9c3);}};}function respondWithFilteredResult(_0x4954c3,_0x1ce4f6){return function(_0x2bc5ea){if(_0x2bc5ea){var _0x4d00d6=typeof _0x1ce4f6[_0x4a47('0x20')]===_0x4a47('0x21')&&typeof _0x1ce4f6[_0x4a47('0x22')]===_0x4a47('0x21');var _0x29b13b=_0x2bc5ea[_0x4a47('0x23')];var _0x1f35bb=_0x4d00d6?0x0:_0x1ce4f6[_0x4a47('0x20')];var _0x187774=_0x4d00d6?_0x2bc5ea['count']:_0x1ce4f6[_0x4a47('0x20')]+_0x1ce4f6[_0x4a47('0x22')];var _0x4185fc;if(_0x187774>=_0x29b13b){_0x187774=_0x29b13b;_0x4185fc=0xc8;}else{_0x4185fc=0xce;}_0x4954c3['status'](_0x4185fc);return _0x4954c3[_0x4a47('0x24')](_0x4a47('0x25'),_0x1f35bb+'-'+_0x187774+'/'+_0x29b13b)['json'](_0x2bc5ea);}return null;};}function patchUpdates(_0x24ef29){return function(_0xe8ecd8){try{jsonpatch[_0x4a47('0x26')](_0xe8ecd8,_0x24ef29,!![]);}catch(_0x3c7a8b){return BPromise[_0x4a47('0x27')](_0x3c7a8b);}return _0xe8ecd8[_0x4a47('0x28')]();};}function saveUpdates(_0x139ec1,_0x52505c){return function(_0x415f4b){if(_0x415f4b){return _0x415f4b['update'](_0x139ec1)[_0x4a47('0x29')](function(_0x15f2aa){return _0x15f2aa;});}return null;};}function removeEntity(_0x2f72f7,_0x56185f){return function(_0x22d62b){if(_0x22d62b){return _0x22d62b['destroy']()[_0x4a47('0x29')](function(){_0x2f72f7[_0x4a47('0x1d')](0xcc)[_0x4a47('0x1e')]();});}};}function handleEntityNotFound(_0x464e2a,_0x5754ba){return function(_0x592db1){if(!_0x592db1){_0x464e2a[_0x4a47('0x1c')](0x194);}return _0x592db1;};}function handleError(_0x1e106d,_0xe81a8e){_0xe81a8e=_0xe81a8e||0x1f4;return function(_0x440a66){logger[_0x4a47('0x2a')](_0x440a66['stack']);if(_0x440a66['name']){delete _0x440a66['name'];}_0x1e106d['status'](_0xe81a8e)[_0x4a47('0x2b')](_0x440a66);};}var utilLicense=require(_0x4a47('0x2c'));exports['index']=function(_0x1cc910,_0x40776c){var _0x5f4f90={'raw':!![],'where':{'id':0x1}},_0x3a435a={};_0x3a435a[_0x4a47('0x2d')]=_['keys'](db['License'][_0x4a47('0x2e')]);_0x3a435a[_0x4a47('0x2f')]=_[_0x4a47('0x30')](_0x1cc910[_0x4a47('0x2f')]);_0x3a435a[_0x4a47('0x31')]=_[_0x4a47('0x32')](_0x3a435a[_0x4a47('0x2d')],_0x3a435a[_0x4a47('0x2f')]);_0x5f4f90[_0x4a47('0x33')]=_[_0x4a47('0x32')](_0x3a435a[_0x4a47('0x2d')],qs[_0x4a47('0x34')](_0x1cc910['query'][_0x4a47('0x34')]));_0x5f4f90[_0x4a47('0x33')]=_0x5f4f90[_0x4a47('0x33')]['length']?_0x5f4f90[_0x4a47('0x33')]:_0x3a435a[_0x4a47('0x2d')];_0x5f4f90=_[_0x4a47('0x35')]({},_0x5f4f90,_0x1cc910[_0x4a47('0x36')]);return utilLicense['getLicense'](_0x5f4f90)[_0x4a47('0x29')](respondWithResult(_0x40776c,null))[_0x4a47('0x37')](handleError(_0x40776c,null));};exports[_0x4a47('0x38')]=function(_0x30d465,_0x2eec64){if(_0x30d465[_0x4a47('0x39')]['id']){delete _0x30d465[_0x4a47('0x39')]['id'];}return db[_0x4a47('0x3a')][_0x4a47('0x3b')]({'where':{'id':_0x30d465[_0x4a47('0x3c')]['id']}})[_0x4a47('0x29')](handleEntityNotFound(_0x2eec64,null))[_0x4a47('0x29')](function(_0x41e430){var _0x12cfa3=_0x41e430[_0x4a47('0x3d')]({'plain':!![]});return utilLicense['checkLicense'](_0x12cfa3,_0x30d465[_0x4a47('0x39')][_0x4a47('0x3e')]);})[_0x4a47('0x29')](function(_0x2a76a3){if(!_0x2a76a3[_0x4a47('0x3f')]){return saveUpdates(_0x30d465[_0x4a47('0x39')],null);}return _0x2a76a3;})[_0x4a47('0x29')](respondWithResult(_0x2eec64,null))['catch'](handleError(_0x2eec64,null));};exports[_0x4a47('0x40')]=function(_0x58d2f9,_0x56c39c){var _0x1b2128=_0x4a47('0x41');var _0x477ca1=path[_0x4a47('0x42')](_0x4a47('0x43'),'log',_0x4a47('0x44'),_0x1b2128);_0x56c39c['setHeader'](_0x4a47('0x45'),_0x4a47('0x46')+_0x1b2128);_0x56c39c[_0x4a47('0x24')](_0x4a47('0x47'),'text/plain');_0x56c39c[_0x4a47('0x48')](_0x477ca1);}; \ No newline at end of file +var _0x39f4=['util','path','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','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','error','name','send','index','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','merge','catch','body','License','find','params','get','demo','license-info.log','/var','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x584789,_0xb3c3a3){var _0x3030cc=function(_0x1ede41){while(--_0x1ede41){_0x584789['push'](_0x584789['shift']());}};_0x3030cc(++_0xb3c3a3);}(_0x39f4,0x187));var _0x439f=function(_0x20c1eb,_0x52c46d){_0x20c1eb=_0x20c1eb-0x0;var _0x1d1e3e=_0x39f4[_0x20c1eb];return _0x1d1e3e;};'use strict';var emlformat=require(_0x439f('0x0'));var rimraf=require(_0x439f('0x1'));var zipdir=require(_0x439f('0x2'));var jsonpatch=require(_0x439f('0x3'));var rp=require(_0x439f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x439f('0x5'));var path=require(_0x439f('0x6'));var sox=require('sox');var csv=require(_0x439f('0x7'));var ejs=require(_0x439f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x439f('0x9'));var squel=require(_0x439f('0xa'));var crypto=require(_0x439f('0xb'));var jsforce=require(_0x439f('0xc'));var deskjs=require(_0x439f('0xd'));var toCsv=require(_0x439f('0x7'));var querystring=require(_0x439f('0xe'));var Papa=require(_0x439f('0xf'));var Redis=require(_0x439f('0x10'));var authService=require(_0x439f('0x11'));var qs=require(_0x439f('0x12'));var as=require(_0x439f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x439f('0x14'));var utils=require(_0x439f('0x15'));var config=require(_0x439f('0x16'));var licenseUtil=require(_0x439f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x117eb7,_0x193181){_0x193181=_0x193181||0xcc;return function(_0x3ff740){if(_0x3ff740){return _0x117eb7[_0x439f('0x18')](_0x193181);}return _0x117eb7[_0x439f('0x19')](_0x193181)['end']();};}function respondWithResult(_0x160704,_0x4c9bbc){_0x4c9bbc=_0x4c9bbc||0xc8;return function(_0x424782){if(_0x424782){return _0x160704[_0x439f('0x19')](_0x4c9bbc)[_0x439f('0x1a')](_0x424782);}};}function respondWithFilteredResult(_0x396312,_0x56e3c8){return function(_0xb2b5d5){if(_0xb2b5d5){var _0x3f9763=typeof _0x56e3c8[_0x439f('0x1b')]==='undefined'&&typeof _0x56e3c8[_0x439f('0x1c')]==='undefined';var _0x5c6f5e=_0xb2b5d5[_0x439f('0x1d')];var _0x5f4cde=_0x3f9763?0x0:_0x56e3c8[_0x439f('0x1b')];var _0xf091bd=_0x3f9763?_0xb2b5d5[_0x439f('0x1d')]:_0x56e3c8['offset']+_0x56e3c8[_0x439f('0x1c')];var _0x2c70bc;if(_0xf091bd>=_0x5c6f5e){_0xf091bd=_0x5c6f5e;_0x2c70bc=0xc8;}else{_0x2c70bc=0xce;}_0x396312[_0x439f('0x19')](_0x2c70bc);return _0x396312[_0x439f('0x1e')]('Content-Range',_0x5f4cde+'-'+_0xf091bd+'/'+_0x5c6f5e)[_0x439f('0x1a')](_0xb2b5d5);}return null;};}function patchUpdates(_0x1e910a){return function(_0x313c08){try{jsonpatch[_0x439f('0x1f')](_0x313c08,_0x1e910a,!![]);}catch(_0x3f2752){return BPromise[_0x439f('0x20')](_0x3f2752);}return _0x313c08[_0x439f('0x21')]();};}function saveUpdates(_0xe5015e,_0x4bbf91){return function(_0x100237){if(_0x100237){return _0x100237[_0x439f('0x22')](_0xe5015e)['then'](function(_0x22f08c){return _0x22f08c;});}return null;};}function removeEntity(_0xd25438,_0x2f5dde){return function(_0x3d7991){if(_0x3d7991){return _0x3d7991[_0x439f('0x23')]()[_0x439f('0x24')](function(){_0xd25438[_0x439f('0x19')](0xcc)[_0x439f('0x25')]();});}};}function handleEntityNotFound(_0x3fffd7,_0x1d9473){return function(_0x141e1b){if(!_0x141e1b){_0x3fffd7[_0x439f('0x18')](0x194);}return _0x141e1b;};}function handleError(_0x103346,_0x17f94a){_0x17f94a=_0x17f94a||0x1f4;return function(_0x3311ba){logger[_0x439f('0x26')](_0x3311ba['stack']);if(_0x3311ba['name']){delete _0x3311ba[_0x439f('0x27')];}_0x103346['status'](_0x17f94a)[_0x439f('0x28')](_0x3311ba);};}var utilLicense=require(_0x439f('0x17'));exports[_0x439f('0x29')]=function(_0x3703d8,_0x349963){var _0x460dac={'raw':!![],'where':{'id':0x1}},_0x2a6860={};_0x2a6860[_0x439f('0x2a')]=_[_0x439f('0x2b')](db['License'][_0x439f('0x2c')]);_0x2a6860[_0x439f('0x2d')]=_['keys'](_0x3703d8['query']);_0x2a6860[_0x439f('0x2e')]=_[_0x439f('0x2f')](_0x2a6860['model'],_0x2a6860[_0x439f('0x2d')]);_0x460dac['attributes']=_[_0x439f('0x2f')](_0x2a6860['model'],qs[_0x439f('0x30')](_0x3703d8[_0x439f('0x2d')][_0x439f('0x30')]));_0x460dac[_0x439f('0x31')]=_0x460dac[_0x439f('0x31')][_0x439f('0x32')]?_0x460dac[_0x439f('0x31')]:_0x2a6860[_0x439f('0x2a')];_0x460dac=_[_0x439f('0x33')]({},_0x460dac,_0x3703d8['options']);return utilLicense['getLicense'](_0x460dac)[_0x439f('0x24')](respondWithResult(_0x349963,null))[_0x439f('0x34')](handleError(_0x349963,null));};exports[_0x439f('0x22')]=function(_0x54545,_0x2accca){if(_0x54545[_0x439f('0x35')]['id']){delete _0x54545[_0x439f('0x35')]['id'];}return db[_0x439f('0x36')][_0x439f('0x37')]({'where':{'id':_0x54545[_0x439f('0x38')]['id']}})[_0x439f('0x24')](handleEntityNotFound(_0x2accca,null))[_0x439f('0x24')](function(_0x5570a6){var _0x48deee=_0x5570a6[_0x439f('0x39')]({'plain':!![]});return utilLicense['checkLicense'](_0x48deee,_0x54545[_0x439f('0x35')]['key']);})[_0x439f('0x24')](function(_0x4d10dd){if(!_0x4d10dd[_0x439f('0x3a')]){return saveUpdates(_0x54545[_0x439f('0x35')],null);}return _0x4d10dd;})[_0x439f('0x24')](respondWithResult(_0x2accca,null))['catch'](handleError(_0x2accca,null));};exports['downloadLogFile']=function(_0x532c76,_0x2b04eb){var _0x51d6fb=_0x439f('0x3b');var _0x235180=path['join'](_0x439f('0x3c'),'log','xcally',_0x51d6fb);_0x2b04eb['setHeader'](_0x439f('0x3d'),_0x439f('0x3e')+_0x51d6fb);_0x2b04eb[_0x439f('0x1e')](_0x439f('0x3f'),_0x439f('0x40'));_0x2b04eb[_0x439f('0x41')](_0x235180);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index d30a44e..d761f55 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 _0xd476=['license','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./license.attributes','exports','define','License'];(function(_0x46db1a,_0x28e5b4){var _0x21627c=function(_0x5a0929){while(--_0x5a0929){_0x46db1a['push'](_0x46db1a['shift']());}};_0x21627c(++_0x28e5b4);}(_0xd476,0x181));var _0x6d47=function(_0x524f3e,_0x425df9){_0x524f3e=_0x524f3e-0x0;var _0x265938=_0xd476[_0x524f3e];return _0x265938;};'use strict';var _=require(_0x6d47('0x0'));var util=require(_0x6d47('0x1'));var logger=require(_0x6d47('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6d47('0x3'));var rp=require(_0x6d47('0x4'));var fs=require('fs');var path=require(_0x6d47('0x5'));var rimraf=require(_0x6d47('0x6'));var config=require('../../config/environment');var attributes=require(_0x6d47('0x7'));module[_0x6d47('0x8')]=function(_0xe30b03,_0x24d4fd){return _0xe30b03[_0x6d47('0x9')](_0x6d47('0xa'),attributes,{'tableName':_0x6d47('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbca=['bluebird','path','rimraf','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','moment'];(function(_0x596ba2,_0x51b08b){var _0x4bdae6=function(_0x7de5f4){while(--_0x7de5f4){_0x596ba2['push'](_0x596ba2['shift']());}};_0x4bdae6(++_0x51b08b);}(_0xbbca,0x188));var _0xabbc=function(_0x3ed7df,_0xb4e77d){_0x3ed7df=_0x3ed7df-0x0;var _0x52d35d=_0xbbca[_0x3ed7df];return _0x52d35d;};'use strict';var _=require(_0xabbc('0x0'));var util=require(_0xabbc('0x1'));var logger=require(_0xabbc('0x2'))('api');var moment=require(_0xabbc('0x3'));var BPromise=require(_0xabbc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabbc('0x5'));var rimraf=require(_0xabbc('0x6'));var config=require('../../config/environment');var attributes=require(_0xabbc('0x7'));module[_0xabbc('0x8')]=function(_0x298ae9,_0x31b8ca){return _0x298ae9[_0xabbc('0x9')](_0xabbc('0xa'),attributes,{'tableName':_0xabbc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 8dd475d..ec1977c 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 _0x05dc=['request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','info'];(function(_0x3da4b9,_0x58d387){var _0xdb347f=function(_0x8aa72d){while(--_0x8aa72d){_0x3da4b9['push'](_0x3da4b9['shift']());}};_0xdb347f(++_0x58d387);}(_0x05dc,0x14a));var _0xc05d=function(_0x18dfea,_0x43d571){_0x18dfea=_0x18dfea-0x0;var _0x5222e3=_0x05dc[_0x18dfea];return _0x5222e3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc05d('0x0'));var BPromise=require(_0xc05d('0x1'));var rs=require(_0xc05d('0x2'));var fs=require('fs');var Redis=require(_0xc05d('0x3'));var db=require(_0xc05d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc05d('0x5'));var client=jayson[_0xc05d('0x6')][_0xc05d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x54164c,_0x3f2615,_0x2bce3e){return new BPromise(function(_0x558350,_0x5bedbd){return client[_0xc05d('0x8')](_0x54164c,_0x2bce3e)['then'](function(_0x43626f){logger[_0xc05d('0x9')]('License,\x20%s,\x20%s',_0x3f2615,_0xc05d('0xa'));logger[_0xc05d('0xb')](_0xc05d('0xc'),_0x3f2615,'request\x20sent',JSON[_0xc05d('0xd')](_0x43626f));if(_0x43626f[_0xc05d('0xe')]){if(_0x43626f['error'][_0xc05d('0xf')]===0x1f4){logger[_0xc05d('0xe')](_0xc05d('0x10'),_0x3f2615,_0x43626f['error'][_0xc05d('0x11')]);return _0x5bedbd(_0x43626f['error'][_0xc05d('0x11')]);}logger[_0xc05d('0xe')](_0xc05d('0x10'),_0x3f2615,_0x43626f[_0xc05d('0xe')][_0xc05d('0x11')]);return _0x558350(_0x43626f[_0xc05d('0xe')][_0xc05d('0x11')]);}else{logger[_0xc05d('0x9')](_0xc05d('0x10'),_0x3f2615,_0xc05d('0xa'));_0x558350(_0x43626f[_0xc05d('0x12')][_0xc05d('0x11')]);}})[_0xc05d('0x13')](function(_0x125478){logger[_0xc05d('0xe')]('License,\x20%s,\x20%s',_0x3f2615,_0x125478);_0x5bedbd(_0x125478);});});} \ No newline at end of file +var _0x2b53=['client','http','request','then','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','util','moment','randomstring','../../mysqldb','rpc','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2b53,0xd6));var _0x32b5=function(_0x1c4b51,_0x2d014f){_0x1c4b51=_0x1c4b51-0x0;var _0xcf249c=_0x2b53[_0x1c4b51];return _0xcf249c;};'use strict';var _=require('lodash');var util=require(_0x32b5('0x0'));var moment=require(_0x32b5('0x1'));var BPromise=require('bluebird');var rs=require(_0x32b5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32b5('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x32b5('0x4'));var config=require('../../config/environment');var jayson=require(_0x32b5('0x5'));var client=jayson[_0x32b5('0x6')][_0x32b5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5bbe6d,_0xc60232,_0x276c33){return new BPromise(function(_0x5ef525,_0x478e1e){return client[_0x32b5('0x8')](_0x5bbe6d,_0x276c33)[_0x32b5('0x9')](function(_0x4a5c93){logger['info'](_0x32b5('0xa'),_0xc60232,_0x32b5('0xb'));logger['debug'](_0x32b5('0xc'),_0xc60232,'request\x20sent',JSON[_0x32b5('0xd')](_0x4a5c93));if(_0x4a5c93['error']){if(_0x4a5c93['error'][_0x32b5('0xe')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0xc60232,_0x4a5c93[_0x32b5('0xf')][_0x32b5('0x10')]);return _0x478e1e(_0x4a5c93[_0x32b5('0xf')][_0x32b5('0x10')]);}logger[_0x32b5('0xf')]('License,\x20%s,\x20%s',_0xc60232,_0x4a5c93[_0x32b5('0xf')][_0x32b5('0x10')]);return _0x5ef525(_0x4a5c93[_0x32b5('0xf')][_0x32b5('0x10')]);}else{logger[_0x32b5('0x11')](_0x32b5('0xa'),_0xc60232,_0x32b5('0xb'));_0x5ef525(_0x4a5c93[_0x32b5('0x12')][_0x32b5('0x10')]);}})[_0x32b5('0x13')](function(_0x33b93f){logger['error'](_0x32b5('0xa'),_0xc60232,_0x33b93f);_0x478e1e(_0x33b93f);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index de1d237..2322aab 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 _0xcdcb=['removeSmtp','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addSmtp','addInteraction','/:id/send','put','delete','removeDispositions','removeAnswers','removeImap'];(function(_0x209464,_0x1e5987){var _0x564b9c=function(_0x203f90){while(--_0x203f90){_0x209464['push'](_0x209464['shift']());}};_0x564b9c(++_0x1e5987);}(_0xcdcb,0x173));var _0xbcdc=function(_0x365564,_0x30f1a4){_0x365564=_0x365564-0x0;var _0x1703ff=_0xcdcb[_0x365564];return _0x1703ff;};'use strict';var multer=require(_0xbcdc('0x0'));var util=require(_0xbcdc('0x1'));var path=require(_0xbcdc('0x2'));var timeout=require(_0xbcdc('0x3'));var express=require(_0xbcdc('0x4'));var router=express['Router']();var fs_extra=require(_0xbcdc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbcdc('0x6'));var config=require(_0xbcdc('0x7'));var controller=require(_0xbcdc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbcdc('0x9')]);router[_0xbcdc('0xa')](_0xbcdc('0xb'),auth[_0xbcdc('0xc')](),controller[_0xbcdc('0xd')]);router['get'](_0xbcdc('0xe'),auth[_0xbcdc('0xc')](),controller[_0xbcdc('0xf')]);router['get'](_0xbcdc('0x10'),auth[_0xbcdc('0xc')](),controller['getDispositions']);router[_0xbcdc('0xa')](_0xbcdc('0x11'),auth['isAuthenticated'](),controller[_0xbcdc('0x12')]);router[_0xbcdc('0xa')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xbcdc('0x13')]);router[_0xbcdc('0xa')](_0xbcdc('0x14'),auth['isAuthenticated'](),controller[_0xbcdc('0x15')]);router['get'](_0xbcdc('0x16'),auth[_0xbcdc('0xc')](),controller[_0xbcdc('0x17')]);router['get']('/:id/applications',auth[_0xbcdc('0xc')](),controller[_0xbcdc('0x18')]);router[_0xbcdc('0xa')]('/:id/messages',auth[_0xbcdc('0xc')](),controller[_0xbcdc('0x19')]);router['get'](_0xbcdc('0x1a'),auth['isAuthenticated'](),controller[_0xbcdc('0x1b')]);router[_0xbcdc('0xa')](_0xbcdc('0x1c'),auth[_0xbcdc('0xc')](),controller[_0xbcdc('0x1d')]);router[_0xbcdc('0x1e')]('/:id/dispositions',auth[_0xbcdc('0xc')](),controller[_0xbcdc('0x1f')]);router[_0xbcdc('0x1e')](_0xbcdc('0x11'),auth[_0xbcdc('0xc')](),controller[_0xbcdc('0x20')]);router[_0xbcdc('0x1e')]('/',auth[_0xbcdc('0xc')](),controller[_0xbcdc('0x21')]);router[_0xbcdc('0x1e')](_0xbcdc('0x22'),auth[_0xbcdc('0xc')](),controller['addImap']);router[_0xbcdc('0x1e')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xbcdc('0x23')]);router[_0xbcdc('0x1e')](_0xbcdc('0x16'),auth[_0xbcdc('0xc')](),controller[_0xbcdc('0x24')]);router[_0xbcdc('0x1e')]('/:id/applications',auth[_0xbcdc('0xc')](),controller['addApplications']);router[_0xbcdc('0x1e')](_0xbcdc('0x25'),auth[_0xbcdc('0xc')](),controller['send']);router['post'](_0xbcdc('0x1c'),auth['isAuthenticated'](),controller['addAgents']);router[_0xbcdc('0x26')](_0xbcdc('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xbcdc('0x27')](_0xbcdc('0x10'),auth[_0xbcdc('0xc')](),controller[_0xbcdc('0x28')]);router[_0xbcdc('0x27')](_0xbcdc('0x11'),auth[_0xbcdc('0xc')](),controller[_0xbcdc('0x29')]);router[_0xbcdc('0x27')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xbcdc('0x2a')]);router[_0xbcdc('0x27')](_0xbcdc('0x14'),auth[_0xbcdc('0xc')](),controller[_0xbcdc('0x2b')]);router[_0xbcdc('0x27')]('/:id',auth['isAuthenticated'](),controller[_0xbcdc('0x2c')]);router[_0xbcdc('0x27')](_0xbcdc('0x1c'),auth[_0xbcdc('0xc')](),controller['removeAgents']);module[_0xbcdc('0x2d')]=router; \ No newline at end of file +var _0x503d=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','post','addDisposition','addAnswer','create','addSmtp','/:id/interactions','addInteraction','addApplications','send','addAgents','update','removeDispositions','delete','removeImap','removeSmtp','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index'];(function(_0x39b2eb,_0x4faaf6){var _0xe04429=function(_0x18a0a8){while(--_0x18a0a8){_0x39b2eb['push'](_0x39b2eb['shift']());}};_0xe04429(++_0x4faaf6);}(_0x503d,0x19b));var _0xd503=function(_0x3c04d7,_0x472801){_0x3c04d7=_0x3c04d7-0x0;var _0x2fb24=_0x503d[_0x3c04d7];return _0x2fb24;};'use strict';var multer=require('multer');var util=require(_0xd503('0x0'));var path=require(_0xd503('0x1'));var timeout=require(_0xd503('0x2'));var express=require(_0xd503('0x3'));var router=express[_0xd503('0x4')]();var fs_extra=require(_0xd503('0x5'));var auth=require(_0xd503('0x6'));var interaction=require(_0xd503('0x7'));var config=require('../../config/environment');var controller=require(_0xd503('0x8'));router[_0xd503('0x9')]('/',auth[_0xd503('0xa')](),controller[_0xd503('0xb')]);router[_0xd503('0x9')](_0xd503('0xc'),auth[_0xd503('0xa')](),controller[_0xd503('0xd')]);router[_0xd503('0x9')](_0xd503('0xe'),auth[_0xd503('0xa')](),controller[_0xd503('0xf')]);router[_0xd503('0x9')](_0xd503('0x10'),auth['isAuthenticated'](),controller[_0xd503('0x11')]);router[_0xd503('0x9')](_0xd503('0x12'),auth[_0xd503('0xa')](),controller[_0xd503('0x13')]);router[_0xd503('0x9')](_0xd503('0x14'),auth[_0xd503('0xa')](),controller[_0xd503('0x15')]);router[_0xd503('0x9')](_0xd503('0x16'),auth[_0xd503('0xa')](),controller[_0xd503('0x17')]);router[_0xd503('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xd503('0x18')]);router[_0xd503('0x9')](_0xd503('0x19'),auth[_0xd503('0xa')](),controller[_0xd503('0x1a')]);router[_0xd503('0x9')](_0xd503('0x1b'),auth[_0xd503('0xa')](),controller[_0xd503('0x1c')]);router[_0xd503('0x9')](_0xd503('0x1d'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0xd503('0x9')](_0xd503('0x1e'),auth[_0xd503('0xa')](),controller['getAgents']);router[_0xd503('0x1f')](_0xd503('0x10'),auth[_0xd503('0xa')](),controller[_0xd503('0x20')]);router[_0xd503('0x1f')](_0xd503('0x12'),auth['isAuthenticated'](),controller[_0xd503('0x21')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd503('0x22')]);router[_0xd503('0x1f')]('/:id/in_servers',auth[_0xd503('0xa')](),controller['addImap']);router[_0xd503('0x1f')](_0xd503('0x16'),auth['isAuthenticated'](),controller[_0xd503('0x23')]);router[_0xd503('0x1f')](_0xd503('0x24'),auth[_0xd503('0xa')](),controller[_0xd503('0x25')]);router[_0xd503('0x1f')](_0xd503('0x19'),auth['isAuthenticated'](),controller[_0xd503('0x26')]);router[_0xd503('0x1f')]('/:id/send',auth[_0xd503('0xa')](),controller[_0xd503('0x27')]);router[_0xd503('0x1f')]('/:id/users',auth[_0xd503('0xa')](),controller[_0xd503('0x28')]);router['put'](_0xd503('0xe'),auth[_0xd503('0xa')](),controller[_0xd503('0x29')]);router['delete'](_0xd503('0x10'),auth[_0xd503('0xa')](),controller[_0xd503('0x2a')]);router[_0xd503('0x2b')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0xd503('0x14'),auth['isAuthenticated'](),controller[_0xd503('0x2c')]);router['delete']('/:id/out_servers',auth[_0xd503('0xa')](),controller[_0xd503('0x2d')]);router[_0xd503('0x2b')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xd503('0x2b')]('/:id/users',auth[_0xd503('0xa')](),controller[_0xd503('0x2e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 7e0e261..37cdbb7 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 _0xe5ce=['getDataValue','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}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','hotmail','outlook365','provider'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0xe5ce,0x91));var _0xee5c=function(_0x15293a,_0x1dc80d){_0x15293a=_0x15293a-0x0;var _0x4f47aa=_0xe5ce[_0x15293a];return _0x4f47aa;};'use strict';var Sequelize=require('sequelize');module[_0xee5c('0x0')]={'description':{'type':Sequelize[_0xee5c('0x1')]},'name':{'type':Sequelize[_0xee5c('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xee5c('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xee5c('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xee5c('0x3')]},'markAsUnread':{'type':Sequelize[_0xee5c('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xee5c('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xee5c('0x4')](0x2)[_0xee5c('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xee5c('0x3')],'defaultValue':function(){return _0xee5c('0x6');}},'notificationSound':{'type':Sequelize[_0xee5c('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xee5c('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xee5c('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xee5c('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xee5c('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xee5c('0x2')],'defaultValue':![],'comment':_0xee5c('0x7'),'set':function(_0x444ecb){if(!_0x444ecb)this[_0xee5c('0x8')](_0xee5c('0x9'),null);this[_0xee5c('0x8')](_0xee5c('0xa'),_0x444ecb);}},'provider':{'type':Sequelize[_0xee5c('0xb')]('gmail',_0xee5c('0xc'),'yahoo',_0xee5c('0xd')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0xee5c('0xe')))return'custom';return this[_0xee5c('0xf')]('provider');},'set':function(_0x160b04){if(_0x160b04==='custom')_0x160b04=null;return this[_0xee5c('0x8')](_0xee5c('0xe'),_0x160b04);}}}; \ No newline at end of file +var _0xf991=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','custom','getDataValue','provider','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x46d208,_0x3654d0){var _0x3bc42f=function(_0x4722bf){while(--_0x4722bf){_0x46d208['push'](_0x46d208['shift']());}};_0x3bc42f(++_0x3654d0);}(_0xf991,0x14f));var _0x1f99=function(_0x4e0d05,_0x1252ef){_0x4e0d05=_0x4e0d05-0x0;var _0x568b50=_0xf991[_0x4e0d05];return _0x568b50;};'use strict';var Sequelize=require('sequelize');module[_0x1f99('0x0')]={'description':{'type':Sequelize[_0x1f99('0x1')]},'name':{'type':Sequelize[_0x1f99('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x1f99('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x1f99('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x1f99('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x1f99('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x1f99('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x1f99('0x1')],'allowNull':![],'defaultValue':_0x1f99('0x4')},'fontSize':{'type':Sequelize[_0x1f99('0x5')](0x2)[_0x1f99('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x1f99('0x3')],'defaultValue':function(){return _0x1f99('0x7');}},'notificationSound':{'type':Sequelize[_0x1f99('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1f99('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1f99('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1f99('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1f99('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x1f99('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x1f99('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5816fc){if(!_0x5816fc)this[_0x1f99('0x9')](_0x1f99('0xa'),null);this[_0x1f99('0x9')](_0x1f99('0xb'),_0x5816fc);}},'provider':{'type':Sequelize[_0x1f99('0xc')](_0x1f99('0xd'),_0x1f99('0xe'),_0x1f99('0xf'),_0x1f99('0x10')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return _0x1f99('0x11');return this[_0x1f99('0x12')]('provider');},'set':function(_0x226384){if(_0x226384==='custom')_0x226384=null;return this[_0x1f99('0x9')](_0x1f99('0x13'),_0x226384);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 68a81c8..f05a45e 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 _0xd4df=['lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','destroy','get','MailAccounts','UserProfileResource','stack','name','MailServerIn','Imap','MailServerOut','map','MailAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','Smtp','Pause','mandatoryDispositionPause','options','find','update','body','modernAuthentication','CloudProviderId','describe','addDisposition','params','Disposition','create','findOne','pick','MailAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','provider','custom','email','isNil','active','description','user','username','password','pass','service','host','port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','json','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','send','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','List','defaults','ListId','messageId','subject','attach','out','Interaction','CloudProvider','OAuth2','data5','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','userMailAccount:remove','moment','bluebird','util','path'];(function(_0x2d524b,_0x419b7b){var _0x57cc20=function(_0x195cbb){while(--_0x195cbb){_0x2d524b['push'](_0x2d524b['shift']());}};_0x57cc20(++_0x419b7b);}(_0xd4df,0xb5));var _0xfd4d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd4df[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0xfd4d('0x0'));var BPromise=require(_0xfd4d('0x1'));var util=require(_0xfd4d('0x2'));var path=require(_0xfd4d('0x3'));var _=require(_0xfd4d('0x4'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0xfd4d('0x5'));var logger=require(_0xfd4d('0x6'))('api');var config=require('../../config/environment');var db=require(_0xfd4d('0x7'))['db'];config[_0xfd4d('0x8')]=_['defaults'](config[_0xfd4d('0x8')],{'host':_0xfd4d('0x9'),'port':0x18eb});var socket=require(_0xfd4d('0xa'))(new Redis(config[_0xfd4d('0x8')]));require(_0xfd4d('0xb'))[_0xfd4d('0xc')](socket);var jayson=require(_0xfd4d('0xd'));var client=jayson[_0xfd4d('0xe')][_0xfd4d('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x40ded9,_0x17d2fb,_0x3c6896,_0x41433a){return new BPromise(function(_0xe1bd32,_0x2d3cce){var _0x3ff20d=_0x41433a||client;return _0x3ff20d['request'](_0x40ded9,_0x3c6896)[_0xfd4d('0x10')](function(_0x31dca9){logger[_0xfd4d('0x11')](_0xfd4d('0x12'),_0x17d2fb,_0xfd4d('0x13'));logger[_0xfd4d('0x14')](_0xfd4d('0x15'),_0x17d2fb,'request\x20sent',JSON[_0xfd4d('0x16')](_0x31dca9));if(_0x31dca9[_0xfd4d('0x17')]){if(_0x31dca9['error'][_0xfd4d('0x18')]===0x1f4){logger['error'](_0xfd4d('0x12'),_0x17d2fb,_0x31dca9[_0xfd4d('0x17')][_0xfd4d('0x19')]);return _0x2d3cce(_0x31dca9[_0xfd4d('0x17')][_0xfd4d('0x19')]);}logger[_0xfd4d('0x17')]('MailAccount,\x20%s,\x20%s',_0x17d2fb,_0x31dca9[_0xfd4d('0x17')][_0xfd4d('0x19')]);return _0xe1bd32(_0x31dca9[_0xfd4d('0x17')][_0xfd4d('0x19')]);}else{logger[_0xfd4d('0x11')](_0xfd4d('0x12'),_0x17d2fb,_0xfd4d('0x13'));_0xe1bd32(_0x31dca9[_0xfd4d('0x1a')][_0xfd4d('0x19')]);}})[_0xfd4d('0x1b')](function(_0x56c096){logger[_0xfd4d('0x17')](_0xfd4d('0x12'),_0x17d2fb,_0x56c096);_0x2d3cce(_0x56c096);});});}function respondWithStatusCode(_0x59d3a9,_0x4d5ae5){_0x4d5ae5=_0x4d5ae5||0xcc;return function(_0x437132){if(_0x437132){return _0x59d3a9[_0xfd4d('0x1c')](_0x4d5ae5);}return _0x59d3a9['status'](_0x4d5ae5)[_0xfd4d('0x1d')]();};}function respondWithResult(_0x5119b4,_0x24277e){_0x24277e=_0x24277e||0xc8;return function(_0x2ec485){if(_0x2ec485){return _0x5119b4[_0xfd4d('0x1e')](_0x24277e)['json'](_0x2ec485);}};}function respondWithFilteredResult(_0x3614fc,_0xd9ec9c){return function(_0x3782f9){if(_0x3782f9){var _0x29f14b=typeof _0xd9ec9c[_0xfd4d('0x1f')]==='undefined'&&typeof _0xd9ec9c['limit']===_0xfd4d('0x20');var _0x18f79f=_0x3782f9[_0xfd4d('0x21')];var _0x1a3050=_0x29f14b?0x0:_0xd9ec9c[_0xfd4d('0x1f')];var _0x16ff92=_0x29f14b?_0x3782f9['count']:_0xd9ec9c[_0xfd4d('0x1f')]+_0xd9ec9c[_0xfd4d('0x22')];var _0x56e18c;if(_0x16ff92>=_0x18f79f){_0x16ff92=_0x18f79f;_0x56e18c=0xc8;}else{_0x56e18c=0xce;}_0x3614fc[_0xfd4d('0x1e')](_0x56e18c);return _0x3614fc[_0xfd4d('0x23')](_0xfd4d('0x24'),_0x1a3050+'-'+_0x16ff92+'/'+_0x18f79f)['json'](_0x3782f9);}return null;};}function saveUpdates(_0x589d94){return function(_0x49faac){if(_0x49faac){return _0x49faac['update'](_0x589d94)['then'](function(_0x4ff48a){return _0x4ff48a;});}return null;};}function removeEntity(_0x6b9a4a){return function(_0x141580){if(_0x141580){return _0x141580[_0xfd4d('0x25')]()[_0xfd4d('0x10')](function(){var _0x54b58c=_0x141580[_0xfd4d('0x26')]({'plain':!![]});var _0x11fc9b=_0xfd4d('0x27');return db[_0xfd4d('0x28')][_0xfd4d('0x25')]({'where':{'type':_0x11fc9b,'resourceId':_0x54b58c['id']}})['then'](function(){return _0x141580;});})[_0xfd4d('0x10')](function(){_0x6b9a4a[_0xfd4d('0x1e')](0xcc)[_0xfd4d('0x1d')]();});}};}function handleEntityNotFound(_0x5a7eae){return function(_0x1bd074){if(!_0x1bd074){_0x5a7eae[_0xfd4d('0x1c')](0x194);}return _0x1bd074;};}function handleError(_0x33553a,_0xb38fb){_0xb38fb=_0xb38fb||0x1f4;return function(_0x447c74){logger[_0xfd4d('0x17')](_0x447c74[_0xfd4d('0x29')]);if(_0x447c74[_0xfd4d('0x2a')]){delete _0x447c74[_0xfd4d('0x2a')];}_0x33553a[_0xfd4d('0x1e')](_0xb38fb)['send'](_0x447c74);};}exports['index']=function(_0x192ef7,_0x5a65ee){var _0x45eed0={'include':[{'model':db[_0xfd4d('0x2b')],'as':_0xfd4d('0x2c')},{'model':db[_0xfd4d('0x2d')],'as':'Smtp'},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2d3c52={},_0x267dd4={'count':0x0,'rows':[]};var _0x14f738=_[_0xfd4d('0x2e')](db[_0xfd4d('0x2f')][_0xfd4d('0x30')],function(_0xb8602){return{'name':_0xb8602[_0xfd4d('0x31')],'type':_0xb8602[_0xfd4d('0x32')][_0xfd4d('0x33')]};});_0x2d3c52['model']=_[_0xfd4d('0x2e')](_0x14f738,_0xfd4d('0x2a'));_0x2d3c52[_0xfd4d('0x34')]=_[_0xfd4d('0x35')](_0x192ef7[_0xfd4d('0x34')]);_0x2d3c52[_0xfd4d('0x36')]=_[_0xfd4d('0x37')](_0x2d3c52[_0xfd4d('0x38')],_0x2d3c52['query']);_0x45eed0[_0xfd4d('0x39')]=_[_0xfd4d('0x37')](_0x2d3c52['model'],qs[_0xfd4d('0x3a')](_0x192ef7['query'][_0xfd4d('0x3a')]));_0x45eed0[_0xfd4d('0x39')]=_0x45eed0[_0xfd4d('0x39')][_0xfd4d('0x3b')]?_0x45eed0[_0xfd4d('0x39')]:_0x2d3c52[_0xfd4d('0x38')];if(!_0x192ef7[_0xfd4d('0x34')][_0xfd4d('0x3c')](_0xfd4d('0x3d'))){_0x45eed0[_0xfd4d('0x22')]=qs[_0xfd4d('0x22')](_0x192ef7[_0xfd4d('0x34')]['limit']);_0x45eed0[_0xfd4d('0x1f')]=qs['offset'](_0x192ef7[_0xfd4d('0x34')]['offset']);}_0x45eed0[_0xfd4d('0x3e')]=qs[_0xfd4d('0x3f')](_0x192ef7[_0xfd4d('0x34')][_0xfd4d('0x3f')]);_0x45eed0['where']=qs[_0xfd4d('0x36')](_['pick'](_0x192ef7['query'],_0x2d3c52['filters']),_0x14f738);if(_0x192ef7[_0xfd4d('0x34')][_0xfd4d('0x40')]){_0x45eed0[_0xfd4d('0x41')]=_[_0xfd4d('0x42')](_0x45eed0['where'],{'$or':_['map'](_0x14f738,function(_0xfb52a1){if(_0xfb52a1[_0xfd4d('0x32')]!==_0xfd4d('0x43')){var _0x584ddd={};_0x584ddd[_0xfb52a1[_0xfd4d('0x2a')]]={'$like':'%'+_0x192ef7[_0xfd4d('0x34')][_0xfd4d('0x40')]+'%'};return _0x584ddd;}})});}_0x45eed0=_['merge']({},_0x45eed0,_0x192ef7['options']);var _0x5b2878={'where':_0x45eed0[_0xfd4d('0x41')]};return db['MailAccount'][_0xfd4d('0x21')](_0x5b2878)[_0xfd4d('0x10')](function(_0x4ab6cf){_0x267dd4[_0xfd4d('0x21')]=_0x4ab6cf;if(_0x192ef7[_0xfd4d('0x34')][_0xfd4d('0x44')]){_0x45eed0[_0xfd4d('0x45')]=[{'all':!![]}];}return db['MailAccount'][_0xfd4d('0x46')](_0x45eed0);})[_0xfd4d('0x10')](function(_0x496958){_0x267dd4[_0xfd4d('0x47')]=_0x496958;return _0x267dd4;})[_0xfd4d('0x10')](respondWithFilteredResult(_0x5a65ee,_0x45eed0))[_0xfd4d('0x1b')](handleError(_0x5a65ee,null));};exports['show']=function(_0x6bb92e,_0x411aa9){var _0x244b98={'raw':![],'where':{'id':_0x6bb92e['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xfd4d('0x2c')},{'model':db[_0xfd4d('0x2d')],'as':_0xfd4d('0x48')},{'model':db[_0xfd4d('0x49')],'as':_0xfd4d('0x4a')}]},_0x191243={};_0x191243[_0xfd4d('0x38')]=_[_0xfd4d('0x35')](db[_0xfd4d('0x2f')]['rawAttributes']);_0x191243['query']=_['keys'](_0x6bb92e['query']);_0x191243[_0xfd4d('0x36')]=_[_0xfd4d('0x37')](_0x191243[_0xfd4d('0x38')],_0x191243[_0xfd4d('0x34')]);_0x244b98[_0xfd4d('0x39')]=_[_0xfd4d('0x37')](_0x191243[_0xfd4d('0x38')],qs['fields'](_0x6bb92e['query'][_0xfd4d('0x3a')]));_0x244b98['attributes']=_0x244b98['attributes'][_0xfd4d('0x3b')]?_0x244b98[_0xfd4d('0x39')]:_0x191243[_0xfd4d('0x38')];if(_0x6bb92e[_0xfd4d('0x34')][_0xfd4d('0x44')]){_0x244b98[_0xfd4d('0x45')]=[{'all':!![]}];}_0x244b98=_[_0xfd4d('0x42')]({},_0x244b98,_0x6bb92e[_0xfd4d('0x4b')]);return db[_0xfd4d('0x2f')][_0xfd4d('0x4c')](_0x244b98)[_0xfd4d('0x10')](handleEntityNotFound(_0x411aa9,null))[_0xfd4d('0x10')](respondWithResult(_0x411aa9,null))[_0xfd4d('0x1b')](handleError(_0x411aa9,null));};exports[_0xfd4d('0x4d')]=function(_0xf2cd1e,_0x3528d8){if(_0xf2cd1e['body']['id']){delete _0xf2cd1e['body']['id'];}if(_0xf2cd1e[_0xfd4d('0x4e')][_0xfd4d('0x2c')]){if(!_0xf2cd1e[_0xfd4d('0x4e')][_0xfd4d('0x2c')][_0xfd4d('0x4f')]){_0xf2cd1e[_0xfd4d('0x4e')][_0xfd4d('0x2c')][_0xfd4d('0x50')]=null;}}if(_0xf2cd1e[_0xfd4d('0x4e')][_0xfd4d('0x48')]){if(!_0xf2cd1e[_0xfd4d('0x4e')][_0xfd4d('0x48')]['modernAuthentication']){_0xf2cd1e[_0xfd4d('0x4e')][_0xfd4d('0x48')][_0xfd4d('0x50')]=null;}}return db['MailAccount']['find']({'where':{'id':_0xf2cd1e['params']['id']},'include':[{'model':db[_0xfd4d('0x2b')],'as':'Imap'},{'model':db[_0xfd4d('0x2d')],'as':'Smtp'},{'model':db[_0xfd4d('0x49')],'as':_0xfd4d('0x4a')}]})[_0xfd4d('0x10')](handleEntityNotFound(_0x3528d8,null))['then'](saveUpdates(_0xf2cd1e[_0xfd4d('0x4e')],null))[_0xfd4d('0x10')](function(_0x5f2e47){if(_0x5f2e47&&_0xf2cd1e[_0xfd4d('0x4e')][_0xfd4d('0x2c')]){return db[_0xfd4d('0x2b')][_0xfd4d('0x4d')](_0xf2cd1e['body'][_0xfd4d('0x2c')],{'where':{'MailAccountId':_0x5f2e47['id']}})[_0xfd4d('0x10')](function(){return _0x5f2e47;});}return _0x5f2e47;})[_0xfd4d('0x10')](function(_0x2812ce){if(_0x2812ce&&_0xf2cd1e['body'][_0xfd4d('0x48')]){return db[_0xfd4d('0x2d')][_0xfd4d('0x4d')](_0xf2cd1e[_0xfd4d('0x4e')][_0xfd4d('0x48')],{'where':{'MailAccountId':_0x2812ce['id']}})['then'](function(){return _0x2812ce;});}return _0x2812ce;})[_0xfd4d('0x10')](respondWithResult(_0x3528d8,null))['catch'](handleError(_0x3528d8,null));};exports['describe']=function(_0x1217b4,_0x2d455b){return db[_0xfd4d('0x2f')][_0xfd4d('0x51')]()[_0xfd4d('0x10')](respondWithResult(_0x2d455b,null))[_0xfd4d('0x1b')](handleError(_0x2d455b,null));};exports[_0xfd4d('0x52')]=function(_0x3b40d0,_0x1d4c10){if(_0x3b40d0[_0xfd4d('0x4e')]['id']){delete _0x3b40d0[_0xfd4d('0x4e')]['id'];}return db[_0xfd4d('0x2f')][_0xfd4d('0x4c')]({'where':{'id':_0x3b40d0[_0xfd4d('0x53')]['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x1d4c10,null))[_0xfd4d('0x10')](function(_0x2de8a8){if(_0x2de8a8){_0x3b40d0[_0xfd4d('0x4e')]['MailAccountId']=_0x2de8a8['id'];return db[_0xfd4d('0x54')][_0xfd4d('0x55')](_0x3b40d0['body']);}})['then'](respondWithResult(_0x1d4c10,null))[_0xfd4d('0x1b')](handleError(_0x1d4c10,null));};exports['getDispositions']=function(_0x592f1f,_0x2249b9){var _0x1083d8={'raw':![],'where':{}};var _0x5d7f58={};var _0x3feaa7={'count':0x0,'rows':[]};return db[_0xfd4d('0x2f')][_0xfd4d('0x56')]({'where':{'id':_0x592f1f[_0xfd4d('0x53')]['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x2249b9,null))[_0xfd4d('0x10')](function(_0x5170f0){if(_0x5170f0){_0x5d7f58[_0xfd4d('0x38')]=_[_0xfd4d('0x35')](db['Disposition'][_0xfd4d('0x30')]);_0x5d7f58[_0xfd4d('0x34')]=_[_0xfd4d('0x35')](_0x592f1f['query']);_0x5d7f58[_0xfd4d('0x36')]=_['intersection'](_0x5d7f58[_0xfd4d('0x38')],_0x5d7f58[_0xfd4d('0x34')]);_0x1083d8[_0xfd4d('0x39')]=_['intersection'](_0x5d7f58['model'],qs['fields'](_0x592f1f[_0xfd4d('0x34')]['fields']));_0x1083d8['attributes']=_0x1083d8['attributes']['length']?_0x1083d8[_0xfd4d('0x39')]:_0x5d7f58[_0xfd4d('0x38')];if(!_0x592f1f['query'][_0xfd4d('0x3c')](_0xfd4d('0x3d'))){_0x1083d8[_0xfd4d('0x22')]=qs['limit'](_0x592f1f[_0xfd4d('0x34')][_0xfd4d('0x22')]);_0x1083d8[_0xfd4d('0x1f')]=qs[_0xfd4d('0x1f')](_0x592f1f[_0xfd4d('0x34')][_0xfd4d('0x1f')]);}_0x1083d8[_0xfd4d('0x3e')]=qs[_0xfd4d('0x3f')](_0x592f1f[_0xfd4d('0x34')][_0xfd4d('0x3f')]);_0x1083d8[_0xfd4d('0x41')]=qs[_0xfd4d('0x36')](_[_0xfd4d('0x57')](_0x592f1f['query'],_0x5d7f58[_0xfd4d('0x36')]));_0x1083d8[_0xfd4d('0x41')][_0xfd4d('0x58')]=_0x5170f0['id'];if(_0x592f1f['query'][_0xfd4d('0x40')]){_0x1083d8['where']=_[_0xfd4d('0x42')](_0x1083d8['where'],{'$or':_[_0xfd4d('0x2e')](_0x1083d8[_0xfd4d('0x39')],function(_0x318f2f){var _0x3347d5={};_0x3347d5[_0x318f2f]={'$like':'%'+_0x592f1f['query'][_0xfd4d('0x40')]+'%'};return _0x3347d5;})});}_0x1083d8=_['merge']({},_0x1083d8,_0x592f1f[_0xfd4d('0x4b')]);return db[_0xfd4d('0x54')][_0xfd4d('0x21')]({'where':_0x1083d8['where']})[_0xfd4d('0x10')](function(_0x169c05){_0x3feaa7[_0xfd4d('0x21')]=_0x169c05;if(_0x592f1f['query'][_0xfd4d('0x44')]){_0x1083d8[_0xfd4d('0x45')]=[{'all':!![]}];}return db[_0xfd4d('0x54')][_0xfd4d('0x46')](_0x1083d8);})[_0xfd4d('0x10')](function(_0x4b648b){_0x3feaa7['rows']=_0x4b648b;return _0x3feaa7;});}})[_0xfd4d('0x10')](respondWithFilteredResult(_0x2249b9,_0x1083d8))[_0xfd4d('0x1b')](handleError(_0x2249b9,null));};exports[_0xfd4d('0x59')]=function(_0x56dd58,_0x1cea9a){return db[_0xfd4d('0x2f')][_0xfd4d('0x4c')]({'where':{'id':_0x56dd58['params']['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x1cea9a,null))['then'](function(_0x4b03b3){if(_0x4b03b3){return _0x4b03b3[_0xfd4d('0x59')](_0x56dd58[_0xfd4d('0x34')][_0xfd4d('0x5a')]);}})['then'](respondWithStatusCode(_0x1cea9a,null))[_0xfd4d('0x1b')](handleError(_0x1cea9a,null));};exports[_0xfd4d('0x5b')]=function(_0x26a053,_0x3c5034){if(_0x26a053[_0xfd4d('0x4e')]['id']){delete _0x26a053[_0xfd4d('0x4e')]['id'];}return db[_0xfd4d('0x2f')][_0xfd4d('0x4c')]({'where':{'id':_0x26a053['params']['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x3c5034,null))[_0xfd4d('0x10')](function(_0x393500){if(_0x393500){_0x26a053['body'][_0xfd4d('0x58')]=_0x393500['id'];return db['CannedAnswer'][_0xfd4d('0x55')](_0x26a053[_0xfd4d('0x4e')]);}})[_0xfd4d('0x10')](respondWithResult(_0x3c5034,null))[_0xfd4d('0x1b')](handleError(_0x3c5034,null));};exports[_0xfd4d('0x5c')]=function(_0x19c7c7,_0x5bfe74){var _0xc98931={'raw':![],'where':{}};var _0x41cf7a={};var _0x275392={'count':0x0,'rows':[]};return db[_0xfd4d('0x2f')][_0xfd4d('0x56')]({'where':{'id':_0x19c7c7[_0xfd4d('0x53')]['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x5bfe74,null))[_0xfd4d('0x10')](function(_0x6707f2){if(_0x6707f2){_0x41cf7a['model']=_[_0xfd4d('0x35')](db[_0xfd4d('0x5d')]['rawAttributes']);_0x41cf7a[_0xfd4d('0x34')]=_[_0xfd4d('0x35')](_0x19c7c7['query']);_0x41cf7a[_0xfd4d('0x36')]=_[_0xfd4d('0x37')](_0x41cf7a[_0xfd4d('0x38')],_0x41cf7a[_0xfd4d('0x34')]);_0xc98931['attributes']=_[_0xfd4d('0x37')](_0x41cf7a[_0xfd4d('0x38')],qs[_0xfd4d('0x3a')](_0x19c7c7['query'][_0xfd4d('0x3a')]));_0xc98931['attributes']=_0xc98931[_0xfd4d('0x39')]['length']?_0xc98931[_0xfd4d('0x39')]:_0x41cf7a[_0xfd4d('0x38')];if(!_0x19c7c7[_0xfd4d('0x34')][_0xfd4d('0x3c')](_0xfd4d('0x3d'))){_0xc98931['limit']=qs[_0xfd4d('0x22')](_0x19c7c7[_0xfd4d('0x34')][_0xfd4d('0x22')]);_0xc98931[_0xfd4d('0x1f')]=qs[_0xfd4d('0x1f')](_0x19c7c7['query'][_0xfd4d('0x1f')]);}_0xc98931[_0xfd4d('0x3e')]=qs[_0xfd4d('0x3f')](_0x19c7c7[_0xfd4d('0x34')]['sort']);_0xc98931[_0xfd4d('0x41')]=qs[_0xfd4d('0x36')](_[_0xfd4d('0x57')](_0x19c7c7['query'],_0x41cf7a['filters']));_0xc98931[_0xfd4d('0x41')][_0xfd4d('0x58')]=_0x6707f2['id'];if(_0x19c7c7[_0xfd4d('0x34')][_0xfd4d('0x40')]){_0xc98931['where']=_[_0xfd4d('0x42')](_0xc98931[_0xfd4d('0x41')],{'$or':_[_0xfd4d('0x2e')](_0xc98931[_0xfd4d('0x39')],function(_0x3e84dd){var _0x4e4ee6={};_0x4e4ee6[_0x3e84dd]={'$like':'%'+_0x19c7c7[_0xfd4d('0x34')]['filter']+'%'};return _0x4e4ee6;})});}_0xc98931=_[_0xfd4d('0x42')]({},_0xc98931,_0x19c7c7[_0xfd4d('0x4b')]);return db[_0xfd4d('0x5d')]['count']({'where':_0xc98931[_0xfd4d('0x41')]})[_0xfd4d('0x10')](function(_0x48943f){_0x275392[_0xfd4d('0x21')]=_0x48943f;if(_0x19c7c7[_0xfd4d('0x34')][_0xfd4d('0x44')]){_0xc98931['include']=[{'all':!![]}];}return db[_0xfd4d('0x5d')][_0xfd4d('0x46')](_0xc98931);})[_0xfd4d('0x10')](function(_0x165f2e){_0x275392['rows']=_0x165f2e;return _0x275392;});}})['then'](respondWithFilteredResult(_0x5bfe74,_0xc98931))[_0xfd4d('0x1b')](handleError(_0x5bfe74,null));};exports[_0xfd4d('0x5e')]=function(_0x5bbddb,_0x430b75){return db[_0xfd4d('0x2f')]['find']({'where':{'id':_0x5bbddb[_0xfd4d('0x53')]['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x430b75,null))['then'](function(_0x50b5fd){if(_0x50b5fd){return _0x50b5fd[_0xfd4d('0x5e')](_0x5bbddb['query'][_0xfd4d('0x5a')]);}})[_0xfd4d('0x10')](respondWithStatusCode(_0x430b75,null))['catch'](handleError(_0x430b75,null));};exports[_0xfd4d('0x55')]=function(_0xac1da0,_0x1e98c0){var _0x341e61={'name':_0xac1da0['body'][_0xfd4d('0x2a')],'key':_0xac1da0[_0xfd4d('0x4e')][_0xfd4d('0x33')],'provider':_0xac1da0[_0xfd4d('0x4e')][_0xfd4d('0x5f')]===_0xfd4d('0x60')?null:_0xac1da0[_0xfd4d('0x4e')]['provider'],'email':_0xac1da0[_0xfd4d('0x4e')][_0xfd4d('0x61')],'ListId':_0xac1da0[_0xfd4d('0x4e')]['ListId'],'active':!_[_0xfd4d('0x62')](_0xac1da0[_0xfd4d('0x4e')]['active'])?_0xac1da0[_0xfd4d('0x4e')][_0xfd4d('0x63')]:!![],'description':_0xac1da0[_0xfd4d('0x4e')][_0xfd4d('0x64')]||null,'Imap':{},'Smtp':{}};if(_0x341e61['provider']){_0x341e61[_0xfd4d('0x2c')][_0xfd4d('0x65')]=_0x341e61[_0xfd4d('0x48')][_0xfd4d('0x65')]=_0xac1da0['body'][_0xfd4d('0x66')];_0x341e61[_0xfd4d('0x2c')][_0xfd4d('0x67')]=_0x341e61[_0xfd4d('0x48')][_0xfd4d('0x68')]=_0xac1da0[_0xfd4d('0x4e')][_0xfd4d('0x67')];if(_0xac1da0[_0xfd4d('0x4e')][_0xfd4d('0x4f')]){_0x341e61['Imap'][_0xfd4d('0x4f')]=_0x341e61[_0xfd4d('0x48')][_0xfd4d('0x4f')]=!![];_0x341e61['Imap'][_0xfd4d('0x50')]=_0x341e61[_0xfd4d('0x48')][_0xfd4d('0x50')]=_0xac1da0[_0xfd4d('0x4e')]['CloudProviderId'];_0x341e61[_0xfd4d('0x2c')][_0xfd4d('0x67')]=_0x341e61[_0xfd4d('0x48')]['pass']=null;}else{_0x341e61[_0xfd4d('0x2c')][_0xfd4d('0x50')]=_0x341e61[_0xfd4d('0x48')][_0xfd4d('0x50')]=null;}_0x341e61[_0xfd4d('0x2c')][_0xfd4d('0x69')]=_0x341e61[_0xfd4d('0x48')][_0xfd4d('0x69')]=null;_0x341e61['Imap']['host']=_0x341e61[_0xfd4d('0x48')][_0xfd4d('0x6a')]=null;_0x341e61[_0xfd4d('0x2c')][_0xfd4d('0x6b')]=_0x341e61[_0xfd4d('0x48')]['port']=null;}else{if(_0xac1da0[_0xfd4d('0x4e')][_0xfd4d('0x6c')]){_0x341e61['Imap'][_0xfd4d('0x65')]=_0x341e61['Smtp'][_0xfd4d('0x65')]=_0xac1da0[_0xfd4d('0x4e')][_0xfd4d('0x66')];_0x341e61['Imap']['password']=_0x341e61[_0xfd4d('0x48')]['pass']=_0xac1da0[_0xfd4d('0x4e')][_0xfd4d('0x67')];}else{_0x341e61['Imap'][_0xfd4d('0x6c')]=_0x341e61[_0xfd4d('0x48')]['authentication']=![];_0x341e61[_0xfd4d('0x2c')][_0xfd4d('0x65')]=_0x341e61[_0xfd4d('0x48')][_0xfd4d('0x65')]=null;_0x341e61[_0xfd4d('0x2c')][_0xfd4d('0x67')]=_0x341e61[_0xfd4d('0x48')]['pass']=null;}_0x341e61[_0xfd4d('0x2c')][_0xfd4d('0x6a')]=_0xac1da0[_0xfd4d('0x4e')][_0xfd4d('0x2c')]['host'];_0x341e61['Imap']['port']=_0xac1da0[_0xfd4d('0x4e')]['Imap'][_0xfd4d('0x6b')];_0x341e61[_0xfd4d('0x48')][_0xfd4d('0x6a')]=_0xac1da0[_0xfd4d('0x4e')][_0xfd4d('0x48')]['host'];_0x341e61['Smtp'][_0xfd4d('0x6b')]=_0xac1da0['body']['Smtp'][_0xfd4d('0x6b')];}return db['MailAccount'][_0xfd4d('0x55')](_0x341e61,{'include':[{'model':db[_0xfd4d('0x2d')],'as':_0xfd4d('0x48')},{'model':db[_0xfd4d('0x2b')],'as':_0xfd4d('0x2c')}]})[_0xfd4d('0x10')](function(_0x48e98e){var _0xc6e8ed=_0xac1da0[_0xfd4d('0x65')][_0xfd4d('0x26')]({'plain':!![]});if(!_0xc6e8ed)throw new Error(_0xfd4d('0x6d'));if(_0xc6e8ed[_0xfd4d('0x6e')]===_0xfd4d('0x65')){var _0x593da1=_0x48e98e['get']({'plain':!![]});return db[_0xfd4d('0x6f')][_0xfd4d('0x4c')]({'where':{'name':_0xfd4d('0x27'),'userProfileId':_0xc6e8ed[_0xfd4d('0x70')]},'raw':!![]})[_0xfd4d('0x10')](function(_0x455879){if(_0x455879&&_0x455879[_0xfd4d('0x71')]===0x0){return db[_0xfd4d('0x28')][_0xfd4d('0x55')]({'name':_0x593da1[_0xfd4d('0x2a')],'resourceId':_0x593da1['id'],'type':_0x455879[_0xfd4d('0x2a')],'sectionId':_0x455879['id']},{})[_0xfd4d('0x10')](function(){return _0x48e98e;});}else{return _0x48e98e;}})[_0xfd4d('0x1b')](function(_0x13d828){logger[_0xfd4d('0x17')](_0xfd4d('0x72'),_0x13d828);throw _0x13d828;});}return _0x48e98e;})['then'](respondWithResult(_0x1e98c0,0xc9))[_0xfd4d('0x1b')](handleError(_0x1e98c0,null));};exports['getImap']=function(_0x2ae186,_0x405b73){return db[_0xfd4d('0x2f')][_0xfd4d('0x56')]({'where':{'id':_0x2ae186['params']['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x405b73,null))[_0xfd4d('0x10')](function(_0x1b6ec6){if(_0x1b6ec6){return _0x1b6ec6[_0xfd4d('0x73')]();}return null;})[_0xfd4d('0x10')](respondWithResult(_0x405b73,null))[_0xfd4d('0x1b')](handleError(_0x405b73,null));};exports[_0xfd4d('0x74')]=function(_0x5bf557,_0x1f597f){if(_0x5bf557[_0xfd4d('0x4e')]['id']){delete _0x5bf557['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x5bf557[_0xfd4d('0x53')]['id']}})['then'](handleEntityNotFound(_0x1f597f,null))[_0xfd4d('0x10')](function(_0x2753e4){if(_0x2753e4){_0x5bf557[_0xfd4d('0x4e')][_0xfd4d('0x58')]=_0x2753e4['id'];return db[_0xfd4d('0x2b')][_0xfd4d('0x55')](_0x5bf557[_0xfd4d('0x4e')]);}})[_0xfd4d('0x10')](respondWithResult(_0x1f597f,null))[_0xfd4d('0x1b')](handleError(_0x1f597f,null));};exports[_0xfd4d('0x75')]=function(_0x564640,_0x275f87){return db[_0xfd4d('0x2f')][_0xfd4d('0x56')]({'where':{'id':_0x564640['params']['id']}})['then'](handleEntityNotFound(_0x275f87,null))[_0xfd4d('0x10')](function(_0x27d50b){if(_0x27d50b){return _0x27d50b['setImap'](null);}return null;})[_0xfd4d('0x10')](respondWithStatusCode(_0x275f87,null))[_0xfd4d('0x1b')](handleError(_0x275f87,null));};exports[_0xfd4d('0x76')]=function(_0x3f23ff,_0x3383f5){return db[_0xfd4d('0x2f')][_0xfd4d('0x56')]({'where':{'id':_0x3f23ff[_0xfd4d('0x53')]['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x3383f5,null))[_0xfd4d('0x10')](function(_0xd8ad1d){if(_0xd8ad1d){return _0xd8ad1d[_0xfd4d('0x76')]();}return null;})[_0xfd4d('0x10')](respondWithResult(_0x3383f5,null))[_0xfd4d('0x1b')](handleError(_0x3383f5,null));};exports[_0xfd4d('0x77')]=function(_0x37979c,_0x113ab4){if(_0x37979c[_0xfd4d('0x4e')]['id']){delete _0x37979c['body']['id'];}return db[_0xfd4d('0x2f')]['find']({'where':{'id':_0x37979c[_0xfd4d('0x53')]['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x113ab4,null))[_0xfd4d('0x10')](function(_0x1b2ad1){if(_0x1b2ad1){_0x37979c['body'][_0xfd4d('0x58')]=_0x1b2ad1['id'];return db[_0xfd4d('0x2d')][_0xfd4d('0x55')](_0x37979c[_0xfd4d('0x4e')]);}})[_0xfd4d('0x10')](respondWithResult(_0x113ab4,null))[_0xfd4d('0x1b')](handleError(_0x113ab4,null));};exports[_0xfd4d('0x78')]=function(_0x4a62c2,_0x27f96a){return db[_0xfd4d('0x2f')][_0xfd4d('0x56')]({'where':{'id':_0x4a62c2[_0xfd4d('0x53')]['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x27f96a,null))['then'](function(_0x48c7e3){if(_0x48c7e3){return _0x48c7e3[_0xfd4d('0x79')](null);}return null;})['then'](respondWithStatusCode(_0x27f96a,null))['catch'](handleError(_0x27f96a,null));};exports['addInteraction']=function(_0xd683d0,_0x49149d){return db[_0xfd4d('0x7a')][_0xfd4d('0x4c')]({'where':{'id':_0xd683d0[_0xfd4d('0x53')]['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x49149d,null))[_0xfd4d('0x10')](function(_0x28e278){if(_0x28e278){return _0x28e278[_0xfd4d('0x7b')](_0xd683d0[_0xfd4d('0x4e')][_0xfd4d('0x5a')],_[_0xfd4d('0x7c')](_0xd683d0[_0xfd4d('0x4e')],[_0xfd4d('0x5a'),'id'])||{});}})[_0xfd4d('0x10')](respondWithResult(_0x49149d,null))[_0xfd4d('0x1b')](handleError(_0x49149d,null));};exports[_0xfd4d('0x7d')]=function(_0x285be4,_0x20abb5){var _0x55be30={'raw':![],'where':{}};var _0x50662d={};var _0x5e4371={'count':0x0,'rows':[]};return db[_0xfd4d('0x2f')][_0xfd4d('0x56')]({'where':{'id':_0x285be4[_0xfd4d('0x53')]['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x20abb5,null))[_0xfd4d('0x10')](function(_0x1d0e86){if(_0x1d0e86){_0x50662d[_0xfd4d('0x38')]=_['keys'](db['MailInteraction'][_0xfd4d('0x30')]);_0x50662d[_0xfd4d('0x34')]=_[_0xfd4d('0x35')](_0x285be4[_0xfd4d('0x34')]);_0x50662d[_0xfd4d('0x36')]=_[_0xfd4d('0x37')](_0x50662d[_0xfd4d('0x38')],_0x50662d[_0xfd4d('0x34')]);_0x55be30['attributes']=_[_0xfd4d('0x37')](_0x50662d[_0xfd4d('0x38')],qs['fields'](_0x285be4[_0xfd4d('0x34')][_0xfd4d('0x3a')]));_0x55be30[_0xfd4d('0x39')]=_0x55be30[_0xfd4d('0x39')][_0xfd4d('0x3b')]?_0x55be30[_0xfd4d('0x39')]:_0x50662d[_0xfd4d('0x38')];if(!_0x285be4['query']['hasOwnProperty'](_0xfd4d('0x3d'))){_0x55be30['limit']=qs[_0xfd4d('0x22')](_0x285be4[_0xfd4d('0x34')][_0xfd4d('0x22')]);_0x55be30['offset']=qs[_0xfd4d('0x1f')](_0x285be4['query'][_0xfd4d('0x1f')]);}_0x55be30[_0xfd4d('0x3e')]=qs[_0xfd4d('0x3f')](_0x285be4['query'][_0xfd4d('0x3f')]);_0x55be30[_0xfd4d('0x41')]=qs[_0xfd4d('0x36')](_['pick'](_0x285be4[_0xfd4d('0x34')],_0x50662d[_0xfd4d('0x36')]));_0x55be30[_0xfd4d('0x41')][_0xfd4d('0x58')]=_0x1d0e86['id'];if(_0x285be4[_0xfd4d('0x34')]['filter']){_0x55be30[_0xfd4d('0x41')]=_[_0xfd4d('0x42')](_0x55be30['where'],{'$or':_['map'](_0x55be30[_0xfd4d('0x39')],function(_0x76f370){var _0x29f727={};_0x29f727[_0x76f370]={'$like':'%'+_0x285be4[_0xfd4d('0x34')]['filter']+'%'};return _0x29f727;})});}_0x55be30=_[_0xfd4d('0x42')]({},_0x55be30,_0x285be4[_0xfd4d('0x4b')]);return db['MailInteraction']['count']({'where':_0x55be30['where']})[_0xfd4d('0x10')](function(_0x5ad1da){_0x5e4371[_0xfd4d('0x21')]=_0x5ad1da;if(_0x285be4[_0xfd4d('0x34')]['includeAll']){_0x55be30[_0xfd4d('0x45')]=[{'model':db[_0xfd4d('0x7e')],'as':'Contact','required':![]},{'model':db[_0xfd4d('0x7f')],'as':_0xfd4d('0x80'),'attributes':[_0xfd4d('0x2a'),'fullname',_0xfd4d('0x81')],'required':![]},{'model':db[_0xfd4d('0x82')],'as':_0xfd4d('0x83'),'attributes':['id',_0xfd4d('0x2a'),_0xfd4d('0x84')],'where':_0x285be4[_0xfd4d('0x34')]['tag']?{'id':_0x285be4[_0xfd4d('0x34')][_0xfd4d('0x85')]}:undefined,'required':_0x285be4[_0xfd4d('0x34')][_0xfd4d('0x85')]?!![]:![]}];}return db[_0xfd4d('0x7a')][_0xfd4d('0x46')](_0x55be30);})[_0xfd4d('0x10')](function(_0x4a4901){_0x5e4371[_0xfd4d('0x47')]=_0x4a4901;return _0x5e4371;});}})[_0xfd4d('0x10')](respondWithFilteredResult(_0x20abb5,_0x55be30))['catch'](handleError(_0x20abb5,null));};exports[_0xfd4d('0x86')]=function addApplications(_0x233277,_0x2092d7){var _0xbf3e23=_0x233277[_0xfd4d('0x53')]['id'];var _0x1da86e=_0x233277[_0xfd4d('0x4e')];var _0x4d52e3=0xc8;var _0x1d8097=null;return db[_0xfd4d('0x87')][_0xfd4d('0x88')]({'isolationLevel':db[_0xfd4d('0x87')][_0xfd4d('0x89')][_0xfd4d('0x8a')][_0xfd4d('0x8b')]},function(_0x5f10a3){return db[_0xfd4d('0x2f')][_0xfd4d('0x56')]({'where':{'id':_0xbf3e23},'transaction':_0x5f10a3})[_0xfd4d('0x10')](function(_0x582974){if(_0x582974){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0xbf3e23},'transaction':_0x5f10a3})[_0xfd4d('0x10')](function(){var _0x525ccd=_[_0xfd4d('0x2e')](_0x1da86e,function(_0x2feefe){_0x2feefe[_0xfd4d('0x58')]=_0xbf3e23;return _0x2feefe;});return db[_0xfd4d('0x8c')][_0xfd4d('0x8d')](_0x525ccd,{'transaction':_0x5f10a3});});}else{_0x4d52e3=0x194;_0x1d8097=[];}});})[_0xfd4d('0x10')](function(){if(_0x4d52e3!==0x194){return db[_0xfd4d('0x8c')]['findAndCountAll']({'where':{'MailAccountId':_0xbf3e23},'order':'priority'})[_0xfd4d('0x10')](function(_0x158ea3){_0x1d8097=_0x158ea3;});}})['catch'](function(_0x3c5dfa){_0x4d52e3=0x1f4;logger['error'](_0x3c5dfa[_0xfd4d('0x29')]);if(_0x3c5dfa[_0xfd4d('0x2a')]){delete _0x3c5dfa['name'];}_0x1d8097=_0x3c5dfa;})['finally'](function(){if(_0x1d8097===null){_0x2092d7[_0xfd4d('0x1c')](_0x4d52e3);}else{if(_0x4d52e3===0x1f4){_0x2092d7['status'](_0x4d52e3)['send'](_0x1d8097);}else{_0x2092d7[_0xfd4d('0x1e')](_0x4d52e3)[_0xfd4d('0x8e')](_0x1d8097);}}});};exports['getApplications']=function(_0x1dd6d5,_0x3a5d09){var _0x284634={};var _0x2734eb={};var _0x125797;var _0x3040a0;return db[_0xfd4d('0x2f')][_0xfd4d('0x56')]({'where':{'id':_0x1dd6d5[_0xfd4d('0x53')]['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x3a5d09,null))[_0xfd4d('0x10')](function(_0x13a61d){if(_0x13a61d){_0x125797=_0x13a61d;_0x2734eb[_0xfd4d('0x38')]=_[_0xfd4d('0x35')](db[_0xfd4d('0x8c')]['rawAttributes']);_0x2734eb[_0xfd4d('0x34')]=_['keys'](_0x1dd6d5[_0xfd4d('0x34')]);_0x2734eb[_0xfd4d('0x36')]=_[_0xfd4d('0x37')](_0x2734eb[_0xfd4d('0x38')],_0x2734eb[_0xfd4d('0x34')]);_0x284634[_0xfd4d('0x39')]=_['intersection'](_0x2734eb['model'],qs['fields'](_0x1dd6d5[_0xfd4d('0x34')][_0xfd4d('0x3a')]));_0x284634['attributes']=_0x284634[_0xfd4d('0x39')][_0xfd4d('0x3b')]?_0x284634[_0xfd4d('0x39')]:_0x2734eb[_0xfd4d('0x38')];_0x284634[_0xfd4d('0x3e')]=qs[_0xfd4d('0x3f')](_0x1dd6d5[_0xfd4d('0x34')]['sort']);_0x284634[_0xfd4d('0x41')]=qs[_0xfd4d('0x36')](_['pick'](_0x1dd6d5[_0xfd4d('0x34')],_0x2734eb[_0xfd4d('0x36')]));if(_0x1dd6d5[_0xfd4d('0x34')][_0xfd4d('0x40')]){_0x284634[_0xfd4d('0x41')]=_['merge'](_0x284634[_0xfd4d('0x41')],{'$or':_[_0xfd4d('0x2e')](_0x284634['attributes'],function(_0xe67073){var _0xc59cc0={};_0xc59cc0[_0xe67073]={'$like':'%'+_0x1dd6d5['query'][_0xfd4d('0x40')]+'%'};return _0xc59cc0;})});}_0x284634=_['merge']({},_0x284634,_0x1dd6d5[_0xfd4d('0x4b')]);return _0x125797[_0xfd4d('0x8f')](_0x284634);}})['then'](function(_0x13d37a){if(_0x13d37a){_0x3040a0=_0x13d37a[_0xfd4d('0x3b')];if(!_0x1dd6d5[_0xfd4d('0x34')][_0xfd4d('0x3c')](_0xfd4d('0x3d'))){_0x284634['limit']=qs[_0xfd4d('0x22')](_0x1dd6d5[_0xfd4d('0x34')]['limit']);_0x284634[_0xfd4d('0x1f')]=qs[_0xfd4d('0x1f')](_0x1dd6d5['query'][_0xfd4d('0x1f')]);}return _0x125797[_0xfd4d('0x8f')](_0x284634);}})[_0xfd4d('0x10')](function(_0x339352){if(_0x339352){return _0x339352?{'count':_0x3040a0,'rows':_0x339352}:null;}})[_0xfd4d('0x10')](respondWithResult(_0x3a5d09,null))[_0xfd4d('0x1b')](handleError(_0x3a5d09,null));};exports['getMessages']=function(_0x1d45ce,_0x3242a9){var _0x56852a={'raw':!![],'where':{}};var _0x57f4be={};var _0x5b3b1f={'count':0x0,'rows':[]};return db[_0xfd4d('0x2f')][_0xfd4d('0x56')]({'where':{'id':_0x1d45ce[_0xfd4d('0x53')]['id']}})['then'](handleEntityNotFound(_0x3242a9,null))['then'](function(_0x3477e0){if(_0x3477e0){_0x57f4be['model']=_['keys'](db[_0xfd4d('0x90')][_0xfd4d('0x30')]);_0x57f4be[_0xfd4d('0x34')]=_[_0xfd4d('0x35')](_0x1d45ce[_0xfd4d('0x34')]);_0x57f4be[_0xfd4d('0x36')]=_['intersection'](_0x57f4be[_0xfd4d('0x38')],_0x57f4be[_0xfd4d('0x34')]);_0x56852a['attributes']=_[_0xfd4d('0x37')](_0x57f4be[_0xfd4d('0x38')],qs['fields'](_0x1d45ce['query'][_0xfd4d('0x3a')]));_0x56852a[_0xfd4d('0x39')]=_0x56852a[_0xfd4d('0x39')][_0xfd4d('0x3b')]?_0x56852a[_0xfd4d('0x39')]:_0x57f4be[_0xfd4d('0x38')];if(!_0x1d45ce[_0xfd4d('0x34')][_0xfd4d('0x3c')](_0xfd4d('0x3d'))){_0x56852a['limit']=qs[_0xfd4d('0x22')](_0x1d45ce['query'][_0xfd4d('0x22')]);_0x56852a['offset']=qs[_0xfd4d('0x1f')](_0x1d45ce[_0xfd4d('0x34')][_0xfd4d('0x1f')]);}_0x56852a['order']=qs[_0xfd4d('0x3f')](_0x1d45ce[_0xfd4d('0x34')][_0xfd4d('0x3f')]);_0x56852a[_0xfd4d('0x41')]=qs[_0xfd4d('0x36')](_[_0xfd4d('0x57')](_0x1d45ce['query'],_0x57f4be['filters']));_0x56852a[_0xfd4d('0x41')][_0xfd4d('0x58')]=_0x3477e0['id'];if(_0x1d45ce[_0xfd4d('0x34')][_0xfd4d('0x40')]){_0x56852a[_0xfd4d('0x41')]=_[_0xfd4d('0x42')](_0x56852a[_0xfd4d('0x41')],{'$or':_[_0xfd4d('0x2e')](_0x56852a[_0xfd4d('0x39')],function(_0x494f76){var _0x264e23={};_0x264e23[_0x494f76]={'$like':'%'+_0x1d45ce[_0xfd4d('0x34')][_0xfd4d('0x40')]+'%'};return _0x264e23;})});}if(_0x1d45ce[_0xfd4d('0x34')][_0xfd4d('0x91')]){var _0x38867a=_0x1d45ce[_0xfd4d('0x34')][_0xfd4d('0x91')][_0xfd4d('0x92')](',');var _0x15ff6c={};_0x15ff6c[_0x38867a[0x0]]={'$gte':moment(_0x38867a[0x1])[_0xfd4d('0x93')](_0xfd4d('0x94'))};_0x56852a[_0xfd4d('0x41')]=_[_0xfd4d('0x42')](_0x56852a[_0xfd4d('0x41')],_0x15ff6c);}_0x56852a=_[_0xfd4d('0x42')]({},_0x56852a,_0x1d45ce['options']);return db['MailMessage'][_0xfd4d('0x21')]({'where':_0x56852a['where']})[_0xfd4d('0x10')](function(_0x1168c8){_0x5b3b1f[_0xfd4d('0x21')]=_0x1168c8;if(_0x1d45ce['query'][_0xfd4d('0x44')]){_0x56852a[_0xfd4d('0x45')]=[{'all':!![]}];}return db[_0xfd4d('0x90')][_0xfd4d('0x46')](_0x56852a);})[_0xfd4d('0x10')](function(_0x2f3bd2){if(_0x1d45ce[_0xfd4d('0x34')][_0xfd4d('0x95')]===_0xfd4d('0x96')){for(var _0x1d4ed6=0x0;_0x1d4ed6<_0x2f3bd2[_0xfd4d('0x3b')];_0x1d4ed6++){_0x2f3bd2[_0x1d4ed6][_0xfd4d('0x4e')]=juice(_0x2f3bd2[_0x1d4ed6][_0xfd4d('0x4e')]);}}_0x5b3b1f[_0xfd4d('0x47')]=_0x2f3bd2;return _0x5b3b1f;});}})[_0xfd4d('0x10')](respondWithFilteredResult(_0x3242a9,_0x56852a))[_0xfd4d('0x1b')](handleError(_0x3242a9,null));};exports[_0xfd4d('0x97')]=function(_0x4e5482,_0x58e9dc){var _0xbc58d,_0x1fa63d={},_0x63b388;if(_0x4e5482['body']['to']){_0x63b388=_0x4e5482[_0xfd4d('0x4e')]['to']['split'](',')[0x0];}return db[_0xfd4d('0x2f')][_0xfd4d('0x4c')]({'where':{'id':_0x4e5482['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xfd4d('0x98'),'where':{'email':_0x63b388},'limit':0x1,'order':[[_0xfd4d('0x99'),_0xfd4d('0x9a')]]}]},{'model':db[_0xfd4d('0x2d')],'as':_0xfd4d('0x48'),'raw':!![]}]})[_0xfd4d('0x10')](handleEntityNotFound(_0x58e9dc,null))[_0xfd4d('0x10')](function(_0x4606e9){if(_0x4606e9){_0xbc58d=_0x4606e9;if(_0x4606e9[_0xfd4d('0x48')]){if(_[_0xfd4d('0x62')](_0x4e5482[_0xfd4d('0x4e')][_0xfd4d('0x9b')])){_0x4e5482[_0xfd4d('0x4e')][_0xfd4d('0x9b')]=util[_0xfd4d('0x93')](_0xfd4d('0x9c'),_0x4606e9[_0xfd4d('0x2a')],_0x4606e9[_0xfd4d('0x61')]||_0x4606e9[_0xfd4d('0x48')][_0xfd4d('0x65')]);}if(_0x4e5482['body'][_0xfd4d('0x9d')]&&_0x4e5482[_0xfd4d('0x4e')][_0xfd4d('0x9d')]['length']){for(var _0x25b023=0x0;_0x25b023<_0x4e5482[_0xfd4d('0x4e')]['attachments'][_0xfd4d('0x3b')];_0x25b023+=0x1){_0x4e5482['body'][_0xfd4d('0x9d')][_0x25b023]={'filename':_0x4e5482[_0xfd4d('0x4e')][_0xfd4d('0x9d')][_0x25b023][_0xfd4d('0x2a')],'path':path[_0xfd4d('0x9e')](config[_0xfd4d('0x9f')],'server/files/attachments',_0x4e5482[_0xfd4d('0x4e')]['attachments'][_0x25b023][_0xfd4d('0xa0')])};}}var _0x3a218a={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4606e9[_0xfd4d('0x48')][_0xfd4d('0x69')])){if(_0x4606e9[_0xfd4d('0x48')][_0xfd4d('0x6c')]){_0x3a218a[_0xfd4d('0xa1')]={'user':_0x4606e9['Smtp']['user'],'pass':_0x4606e9[_0xfd4d('0x48')][_0xfd4d('0x68')]};}_0x3a218a[_0xfd4d('0x6a')]=_0x4606e9[_0xfd4d('0x48')][_0xfd4d('0x6a')];_0x3a218a[_0xfd4d('0x6b')]=_0x4606e9['Smtp']['port'];_0x3a218a[_0xfd4d('0xa2')]=_0x4606e9[_0xfd4d('0x48')][_0xfd4d('0xa2')];}else{_0x3a218a['service']=_0x4606e9[_0xfd4d('0x48')]['service'];_0x3a218a['auth']={'user':_0x4606e9[_0xfd4d('0x48')]['user'],'pass':_0x4606e9[_0xfd4d('0x48')]['pass']};}return respondWithRpcPromise(_0xfd4d('0xa3'),_0xfd4d('0xa4'),{'account':_0x3a218a,'message':_0x4e5482['body']});}else{throw new Error(_0xfd4d('0xa5'));}}})[_0xfd4d('0x10')](function(_0x123fef){if(_0x123fef){_0x1fa63d=_0x123fef;if(_0xbc58d[_0xfd4d('0xa6')]){if(_0xbc58d[_0xfd4d('0xa6')]['Contacts'][_0xfd4d('0x3b')]){return _0xbc58d[_0xfd4d('0xa6')]['Contacts'][0x0];}else{return db[_0xfd4d('0x7e')]['create'](_[_0xfd4d('0xa7')](_0x4e5482[_0xfd4d('0x4e')],{'firstName':_0x4e5482[_0xfd4d('0x4e')]['to'],'email':_0x4e5482[_0xfd4d('0x4e')]['to'],'phone':_0x4e5482[_0xfd4d('0x4e')]['to'],'ListId':_0xbc58d[_0xfd4d('0xa8')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xfd4d('0x10')](function(_0x125b73){if(_0x125b73){var _0x3df8d8={'UserId':_0x4e5482[_0xfd4d('0x65')]['id'],'ContactId':_0x125b73['id'],'MailAccountId':_0xbc58d['id'],'inReplyTo':_0x1fa63d[_0xfd4d('0xa9')],'to':_0x4e5482['body'][_0xfd4d('0x9b')],'cc':_0x4e5482[_0xfd4d('0x4e')]['cc'],'subject':_0x4e5482[_0xfd4d('0x4e')][_0xfd4d('0xaa')],'attach':_0x4e5482[_0xfd4d('0x4e')][_0xfd4d('0xab')],'firstMsgDirection':_0xfd4d('0xac'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xfd4d('0xac'),'Messages':[_[_0xfd4d('0x42')](_0x4e5482[_0xfd4d('0x4e')],{'messageId':_0x1fa63d[_0xfd4d('0xa9')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xbc58d['id'],'UserId':_0x4e5482[_0xfd4d('0x65')]['id'],'ContactId':_0x125b73['id']})]};if(_0x4e5482[_0xfd4d('0x4e')]['Interaction']){_0x3df8d8=_[_0xfd4d('0x42')](_0x3df8d8,_0x4e5482['body'][_0xfd4d('0xad')]);}return db[_0xfd4d('0x7a')][_0xfd4d('0x55')](_0x3df8d8,{'include':[{'model':db[_0xfd4d('0x90')],'as':'Messages'}]});}})[_0xfd4d('0x10')](respondWithResult(_0x58e9dc,null))[_0xfd4d('0x1b')](handleError(_0x58e9dc,null));};exports['verifySmtp']=function(_0x43b88d,_0x5c9aa4){return db[_0xfd4d('0x2f')][_0xfd4d('0x4c')]({'where':{'id':_0x43b88d['params']['id']},'include':[{'model':db[_0xfd4d('0x2d')],'as':_0xfd4d('0x48'),'raw':!![],'include':[{'model':db[_0xfd4d('0xae')],'as':_0xfd4d('0xae'),'raw':!![]}]}]})[_0xfd4d('0x10')](handleEntityNotFound(_0x5c9aa4,null))['then'](function(_0x6996df){if(!_0x6996df[_0xfd4d('0x48')])return;var _0x4e70e9={'id':_0x6996df['id'],'tls':{'rejectUnauthorized':![]}};if(_0x6996df[_0xfd4d('0x5f')]!=='custom'){_0x4e70e9[_0xfd4d('0x69')]=_0x6996df[_0xfd4d('0x5f')];}else{_0x4e70e9[_0xfd4d('0x6a')]=_0x6996df[_0xfd4d('0x48')][_0xfd4d('0x6a')];_0x4e70e9[_0xfd4d('0x6b')]=_0x6996df[_0xfd4d('0x48')][_0xfd4d('0x6b')];_0x4e70e9[_0xfd4d('0xa2')]=_0x6996df[_0xfd4d('0x48')][_0xfd4d('0xa2')];}if(_0x6996df[_0xfd4d('0x48')][_0xfd4d('0x6c')]){if(_0x6996df[_0xfd4d('0x48')][_0xfd4d('0x4f')]){_0x4e70e9[_0xfd4d('0xa1')]={'type':_0xfd4d('0xaf'),'user':_0x6996df[_0xfd4d('0x48')][_0xfd4d('0x65')],'accessToken':_0x6996df[_0xfd4d('0x48')]['CloudProvider'][_0xfd4d('0xb0')]};}else{_0x4e70e9[_0xfd4d('0xa1')]={'user':_0x6996df['Smtp'][_0xfd4d('0x65')],'pass':_0x6996df[_0xfd4d('0x48')][_0xfd4d('0x68')]};}}return respondWithRpcPromise('VerifySmtp',_0xfd4d('0xb1'),{'account':_0x4e70e9});})['then'](respondWithResult(_0x5c9aa4,null))[_0xfd4d('0x1b')](handleError(_0x5c9aa4,null));};exports[_0xfd4d('0x25')]=function(_0x2e0a36,_0x4bec46){return db[_0xfd4d('0x2f')][_0xfd4d('0x4c')]({'where':{'id':_0x2e0a36[_0xfd4d('0x53')]['id']}})['then'](handleEntityNotFound(_0x4bec46,null))[_0xfd4d('0x10')](function(_0x2b4398){if(_0x2b4398&&_0x2b4398[_0xfd4d('0x69')]){throw new db['Sequelize'][(_0xfd4d('0xb2'))](_0xfd4d('0xb3'));}return _0x2b4398;})[_0xfd4d('0x10')](removeEntity(_0x4bec46,null))['catch'](handleError(_0x4bec46,null));};exports['addAgents']=function(_0x5a3e0d,_0x3a573c){return db[_0xfd4d('0x2f')][_0xfd4d('0x4c')]({'where':{'id':_0x5a3e0d[_0xfd4d('0x53')]['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x3a573c,null))[_0xfd4d('0x10')](function(_0x4b301a){if(_0x4b301a){return _0x4b301a[_0xfd4d('0xb4')](_0x5a3e0d[_0xfd4d('0x4e')][_0xfd4d('0x5a')],_['omit'](_0x5a3e0d[_0xfd4d('0x4e')],[_0xfd4d('0x5a'),'id'])||{})[_0xfd4d('0xb5')](function(_0x4e825a){for(var _0x134a51=0x0;_0x134a51<_0x5a3e0d['body'][_0xfd4d('0x5a')][_0xfd4d('0x3b')];_0x134a51+=0x1){socket[_0xfd4d('0xb6')]('userMailAccount:save',{'UserId':Number(_0x5a3e0d[_0xfd4d('0x4e')][_0xfd4d('0x5a')][_0x134a51]),'MailAccountId':Number(_0x5a3e0d[_0xfd4d('0x53')]['id'])});}return _0x4e825a;});}})['then'](respondWithResult(_0x3a573c,null))[_0xfd4d('0x1b')](handleError(_0x3a573c,null));};exports[_0xfd4d('0xb7')]=function(_0x3ff94e,_0x1ebab2){return db[_0xfd4d('0x2f')]['find']({'where':{'id':_0x3ff94e[_0xfd4d('0x53')]['id']}})[_0xfd4d('0x10')](handleEntityNotFound(_0x1ebab2,null))[_0xfd4d('0x10')](function(_0x53bb81){if(_0x53bb81){return _0x53bb81[_0xfd4d('0xb7')](_0x3ff94e['query'][_0xfd4d('0x5a')])[_0xfd4d('0x10')](function(){if(_['isArray'](_0x3ff94e[_0xfd4d('0x34')][_0xfd4d('0x5a')])){for(var _0x145291=0x0;_0x145291<_0x3ff94e[_0xfd4d('0x34')]['ids']['length'];_0x145291+=0x1){socket[_0xfd4d('0xb6')](_0xfd4d('0xb8'),{'UserId':Number(_0x3ff94e[_0xfd4d('0x34')]['ids'][_0x145291]),'MailAccountId':Number(_0x3ff94e['params']['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x3ff94e[_0xfd4d('0x34')][_0xfd4d('0x5a')]),'MailAccountId':Number(_0x3ff94e['params']['id'])});}});}})[_0xfd4d('0x10')](respondWithStatusCode(_0x1ebab2,null))[_0xfd4d('0x1b')](handleError(_0x1ebab2,null));};exports['getAgents']=function(_0x561576,_0x2ec80c){var _0x188e8d={};var _0xd9962={};var _0x33c653;var _0x1aadb4;return db[_0xfd4d('0x2f')][_0xfd4d('0x56')]({'where':{'id':_0x561576[_0xfd4d('0x53')]['id']}})['then'](handleEntityNotFound(_0x2ec80c,null))[_0xfd4d('0x10')](function(_0x5ebf4a){if(_0x5ebf4a){_0x33c653=_0x5ebf4a;_0xd9962['model']=_['keys'](db['User'][_0xfd4d('0x30')]);_0xd9962['query']=_[_0xfd4d('0x35')](_0x561576[_0xfd4d('0x34')]);_0xd9962[_0xfd4d('0x36')]=_['intersection'](_0xd9962[_0xfd4d('0x38')],_0xd9962[_0xfd4d('0x34')]);_0x188e8d[_0xfd4d('0x39')]=_[_0xfd4d('0x37')](_0xd9962['model'],qs[_0xfd4d('0x3a')](_0x561576['query'][_0xfd4d('0x3a')]));_0x188e8d['attributes']=_0x188e8d[_0xfd4d('0x39')][_0xfd4d('0x3b')]?_0x188e8d[_0xfd4d('0x39')]:_0xd9962[_0xfd4d('0x38')];_0x188e8d[_0xfd4d('0x3e')]=qs[_0xfd4d('0x3f')](_0x561576[_0xfd4d('0x34')][_0xfd4d('0x3f')]);_0x188e8d[_0xfd4d('0x41')]=qs[_0xfd4d('0x36')](_[_0xfd4d('0x57')](_0x561576[_0xfd4d('0x34')],_0xd9962[_0xfd4d('0x36')]));if(_0x561576['query'][_0xfd4d('0x40')]){_0x188e8d['where']=_['merge'](_0x188e8d['where'],{'$or':_['map'](_0x188e8d[_0xfd4d('0x39')],function(_0x35b8ef){var _0x1791fa={};_0x1791fa[_0x35b8ef]={'$like':'%'+_0x561576[_0xfd4d('0x34')][_0xfd4d('0x40')]+'%'};return _0x1791fa;})});}_0x188e8d=_[_0xfd4d('0x42')]({},_0x188e8d,_0x561576['options']);return _0x33c653['getAgents'](_0x188e8d);}})[_0xfd4d('0x10')](function(_0x4abfb6){if(_0x4abfb6){_0x1aadb4=_0x4abfb6['length'];if(!_0x561576[_0xfd4d('0x34')][_0xfd4d('0x3c')](_0xfd4d('0x3d'))){_0x188e8d['limit']=qs[_0xfd4d('0x22')](_0x561576[_0xfd4d('0x34')][_0xfd4d('0x22')]);_0x188e8d[_0xfd4d('0x1f')]=qs[_0xfd4d('0x1f')](_0x561576[_0xfd4d('0x34')][_0xfd4d('0x1f')]);}return _0x33c653['getAgents'](_0x188e8d);}})[_0xfd4d('0x10')](function(_0x2a03d6){if(_0x2a03d6){return _0x2a03d6?{'count':_0x1aadb4,'rows':_0x2a03d6}:null;}})[_0xfd4d('0x10')](respondWithResult(_0x2ec80c,null))[_0xfd4d('0x1b')](handleError(_0x2ec80c,null));}; \ No newline at end of file +var _0xf30a=['verifySmtp','CloudProvider','custom','OAuth2','VerifySmtp','Sequelize','ValidationError','addAgents','omit','spread','userMailAccount:save','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','update','destroy','get','MailAccounts','stack','name','send','index','Imap','MailServerOut','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','MailServerIn','Pause','find','body','modernAuthentication','Smtp','CloudProviderId','describe','addDisposition','MailAccountId','create','findOne','Disposition','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','provider','email','isNil','active','user','password','pass','service','host','authentication','port','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','Tags','tag','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','json','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','Contacts','updatedAt','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','Interaction','Messages'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0xf30a,0x17d));var _0xaf30=function(_0x531318,_0x17f403){_0x531318=_0x531318-0x0;var _0x3109d3=_0xf30a[_0x531318];return _0x3109d3;};'use strict';var moment=require(_0xaf30('0x0'));var BPromise=require(_0xaf30('0x1'));var util=require('util');var path=require(_0xaf30('0x2'));var _=require(_0xaf30('0x3'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0xaf30('0x4'));var logger=require(_0xaf30('0x5'))(_0xaf30('0x6'));var config=require(_0xaf30('0x7'));var db=require(_0xaf30('0x8'))['db'];config[_0xaf30('0x9')]=_[_0xaf30('0xa')](config[_0xaf30('0x9')],{'host':_0xaf30('0xb'),'port':0x18eb});var socket=require(_0xaf30('0xc'))(new Redis(config['redis']));require(_0xaf30('0xd'))[_0xaf30('0xe')](socket);var jayson=require(_0xaf30('0xf'));var client=jayson[_0xaf30('0x10')][_0xaf30('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x1c1bda,_0x4e7f5c,_0x248518,_0x2bb484){return new BPromise(function(_0x35b5a5,_0x4a1cf4){var _0x2789dc=_0x2bb484||client;return _0x2789dc[_0xaf30('0x12')](_0x1c1bda,_0x248518)[_0xaf30('0x13')](function(_0x4fccfb){logger['info'](_0xaf30('0x14'),_0x4e7f5c,_0xaf30('0x15'));logger[_0xaf30('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x4e7f5c,_0xaf30('0x15'),JSON[_0xaf30('0x17')](_0x4fccfb));if(_0x4fccfb['error']){if(_0x4fccfb[_0xaf30('0x18')][_0xaf30('0x19')]===0x1f4){logger[_0xaf30('0x18')](_0xaf30('0x14'),_0x4e7f5c,_0x4fccfb['error']['message']);return _0x4a1cf4(_0x4fccfb[_0xaf30('0x18')][_0xaf30('0x1a')]);}logger['error'](_0xaf30('0x14'),_0x4e7f5c,_0x4fccfb[_0xaf30('0x18')][_0xaf30('0x1a')]);return _0x35b5a5(_0x4fccfb[_0xaf30('0x18')][_0xaf30('0x1a')]);}else{logger[_0xaf30('0x1b')](_0xaf30('0x14'),_0x4e7f5c,_0xaf30('0x15'));_0x35b5a5(_0x4fccfb[_0xaf30('0x1c')][_0xaf30('0x1a')]);}})[_0xaf30('0x1d')](function(_0x5e8b1b){logger[_0xaf30('0x18')](_0xaf30('0x14'),_0x4e7f5c,_0x5e8b1b);_0x4a1cf4(_0x5e8b1b);});});}function respondWithStatusCode(_0x16c174,_0x5c2a53){_0x5c2a53=_0x5c2a53||0xcc;return function(_0x40a4ac){if(_0x40a4ac){return _0x16c174[_0xaf30('0x1e')](_0x5c2a53);}return _0x16c174[_0xaf30('0x1f')](_0x5c2a53)[_0xaf30('0x20')]();};}function respondWithResult(_0x3bf92f,_0x14a5f4){_0x14a5f4=_0x14a5f4||0xc8;return function(_0x5affeb){if(_0x5affeb){return _0x3bf92f[_0xaf30('0x1f')](_0x14a5f4)['json'](_0x5affeb);}};}function respondWithFilteredResult(_0x296076,_0x5d9ee5){return function(_0x3ac058){if(_0x3ac058){var _0x45f15c=typeof _0x5d9ee5[_0xaf30('0x21')]===_0xaf30('0x22')&&typeof _0x5d9ee5[_0xaf30('0x23')]===_0xaf30('0x22');var _0x3b2bda=_0x3ac058['count'];var _0x5c4d12=_0x45f15c?0x0:_0x5d9ee5['offset'];var _0x4d1939=_0x45f15c?_0x3ac058[_0xaf30('0x24')]:_0x5d9ee5[_0xaf30('0x21')]+_0x5d9ee5['limit'];var _0x584e58;if(_0x4d1939>=_0x3b2bda){_0x4d1939=_0x3b2bda;_0x584e58=0xc8;}else{_0x584e58=0xce;}_0x296076['status'](_0x584e58);return _0x296076['set'](_0xaf30('0x25'),_0x5c4d12+'-'+_0x4d1939+'/'+_0x3b2bda)['json'](_0x3ac058);}return null;};}function saveUpdates(_0x4a52a4){return function(_0x11e422){if(_0x11e422){return _0x11e422[_0xaf30('0x26')](_0x4a52a4)[_0xaf30('0x13')](function(_0x210fe0){return _0x210fe0;});}return null;};}function removeEntity(_0x52e7ff){return function(_0x21ff2d){if(_0x21ff2d){return _0x21ff2d[_0xaf30('0x27')]()['then'](function(){var _0x2b9726=_0x21ff2d[_0xaf30('0x28')]({'plain':!![]});var _0x36ba67=_0xaf30('0x29');return db['UserProfileResource'][_0xaf30('0x27')]({'where':{'type':_0x36ba67,'resourceId':_0x2b9726['id']}})[_0xaf30('0x13')](function(){return _0x21ff2d;});})['then'](function(){_0x52e7ff[_0xaf30('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x439197){return function(_0x41fc87){if(!_0x41fc87){_0x439197[_0xaf30('0x1e')](0x194);}return _0x41fc87;};}function handleError(_0x49fe8e,_0x42cb36){_0x42cb36=_0x42cb36||0x1f4;return function(_0x4637da){logger['error'](_0x4637da[_0xaf30('0x2a')]);if(_0x4637da['name']){delete _0x4637da[_0xaf30('0x2b')];}_0x49fe8e[_0xaf30('0x1f')](_0x42cb36)[_0xaf30('0x2c')](_0x4637da);};}exports[_0xaf30('0x2d')]=function(_0x2f9815,_0x5b77ab){var _0x1e9b41={'include':[{'model':db['MailServerIn'],'as':_0xaf30('0x2e')},{'model':db[_0xaf30('0x2f')],'as':'Smtp'},{'model':db['Pause'],'as':_0xaf30('0x30')}]},_0x504a87={},_0xf42919={'count':0x0,'rows':[]};var _0x38e05a=_['map'](db[_0xaf30('0x31')][_0xaf30('0x32')],function(_0x218529){return{'name':_0x218529[_0xaf30('0x33')],'type':_0x218529[_0xaf30('0x34')][_0xaf30('0x35')]};});_0x504a87[_0xaf30('0x36')]=_[_0xaf30('0x37')](_0x38e05a,_0xaf30('0x2b'));_0x504a87[_0xaf30('0x38')]=_[_0xaf30('0x39')](_0x2f9815[_0xaf30('0x38')]);_0x504a87[_0xaf30('0x3a')]=_[_0xaf30('0x3b')](_0x504a87[_0xaf30('0x36')],_0x504a87[_0xaf30('0x38')]);_0x1e9b41['attributes']=_[_0xaf30('0x3b')](_0x504a87[_0xaf30('0x36')],qs[_0xaf30('0x3c')](_0x2f9815[_0xaf30('0x38')]['fields']));_0x1e9b41[_0xaf30('0x3d')]=_0x1e9b41[_0xaf30('0x3d')][_0xaf30('0x3e')]?_0x1e9b41[_0xaf30('0x3d')]:_0x504a87[_0xaf30('0x36')];if(!_0x2f9815[_0xaf30('0x38')][_0xaf30('0x3f')](_0xaf30('0x40'))){_0x1e9b41[_0xaf30('0x23')]=qs[_0xaf30('0x23')](_0x2f9815['query'][_0xaf30('0x23')]);_0x1e9b41['offset']=qs[_0xaf30('0x21')](_0x2f9815[_0xaf30('0x38')][_0xaf30('0x21')]);}_0x1e9b41[_0xaf30('0x41')]=qs[_0xaf30('0x42')](_0x2f9815[_0xaf30('0x38')]['sort']);_0x1e9b41[_0xaf30('0x43')]=qs['filters'](_['pick'](_0x2f9815['query'],_0x504a87[_0xaf30('0x3a')]),_0x38e05a);if(_0x2f9815[_0xaf30('0x38')][_0xaf30('0x44')]){_0x1e9b41[_0xaf30('0x43')]=_[_0xaf30('0x45')](_0x1e9b41[_0xaf30('0x43')],{'$or':_[_0xaf30('0x37')](_0x38e05a,function(_0x2bf296){if(_0x2bf296[_0xaf30('0x34')]!==_0xaf30('0x46')){var _0x4b4b80={};_0x4b4b80[_0x2bf296[_0xaf30('0x2b')]]={'$like':'%'+_0x2f9815['query']['filter']+'%'};return _0x4b4b80;}})});}_0x1e9b41=_[_0xaf30('0x45')]({},_0x1e9b41,_0x2f9815[_0xaf30('0x47')]);var _0x565f32={'where':_0x1e9b41['where']};return db[_0xaf30('0x31')][_0xaf30('0x24')](_0x565f32)[_0xaf30('0x13')](function(_0x6ea37f){_0xf42919[_0xaf30('0x24')]=_0x6ea37f;if(_0x2f9815[_0xaf30('0x38')][_0xaf30('0x48')]){_0x1e9b41[_0xaf30('0x49')]=[{'all':!![]}];}return db['MailAccount'][_0xaf30('0x4a')](_0x1e9b41);})[_0xaf30('0x13')](function(_0x84cb33){_0xf42919[_0xaf30('0x4b')]=_0x84cb33;return _0xf42919;})[_0xaf30('0x13')](respondWithFilteredResult(_0x5b77ab,_0x1e9b41))[_0xaf30('0x1d')](handleError(_0x5b77ab,null));};exports['show']=function(_0x2c727d,_0x205956){var _0x12df06={'raw':![],'where':{'id':_0x2c727d[_0xaf30('0x4c')]['id']},'include':[{'model':db[_0xaf30('0x4d')],'as':_0xaf30('0x2e')},{'model':db[_0xaf30('0x2f')],'as':'Smtp'},{'model':db[_0xaf30('0x4e')],'as':_0xaf30('0x30')}]},_0x539b11={};_0x539b11[_0xaf30('0x36')]=_[_0xaf30('0x39')](db[_0xaf30('0x31')][_0xaf30('0x32')]);_0x539b11[_0xaf30('0x38')]=_[_0xaf30('0x39')](_0x2c727d[_0xaf30('0x38')]);_0x539b11[_0xaf30('0x3a')]=_['intersection'](_0x539b11[_0xaf30('0x36')],_0x539b11[_0xaf30('0x38')]);_0x12df06[_0xaf30('0x3d')]=_[_0xaf30('0x3b')](_0x539b11[_0xaf30('0x36')],qs[_0xaf30('0x3c')](_0x2c727d[_0xaf30('0x38')][_0xaf30('0x3c')]));_0x12df06['attributes']=_0x12df06[_0xaf30('0x3d')][_0xaf30('0x3e')]?_0x12df06[_0xaf30('0x3d')]:_0x539b11[_0xaf30('0x36')];if(_0x2c727d['query'][_0xaf30('0x48')]){_0x12df06[_0xaf30('0x49')]=[{'all':!![]}];}_0x12df06=_[_0xaf30('0x45')]({},_0x12df06,_0x2c727d[_0xaf30('0x47')]);return db[_0xaf30('0x31')][_0xaf30('0x4f')](_0x12df06)[_0xaf30('0x13')](handleEntityNotFound(_0x205956,null))[_0xaf30('0x13')](respondWithResult(_0x205956,null))[_0xaf30('0x1d')](handleError(_0x205956,null));};exports['update']=function(_0x462ec5,_0x5f0a9b){if(_0x462ec5[_0xaf30('0x50')]['id']){delete _0x462ec5[_0xaf30('0x50')]['id'];}if(_0x462ec5[_0xaf30('0x50')]['Imap']){if(!_0x462ec5[_0xaf30('0x50')][_0xaf30('0x2e')][_0xaf30('0x51')]){_0x462ec5[_0xaf30('0x50')][_0xaf30('0x2e')]['CloudProviderId']=null;}}if(_0x462ec5['body']['Smtp']){if(!_0x462ec5['body']['Smtp'][_0xaf30('0x51')]){_0x462ec5['body'][_0xaf30('0x52')][_0xaf30('0x53')]=null;}}return db['MailAccount'][_0xaf30('0x4f')]({'where':{'id':_0x462ec5['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xaf30('0x2e')},{'model':db[_0xaf30('0x2f')],'as':_0xaf30('0x52')},{'model':db[_0xaf30('0x4e')],'as':'mandatoryDispositionPause'}]})[_0xaf30('0x13')](handleEntityNotFound(_0x5f0a9b,null))['then'](saveUpdates(_0x462ec5[_0xaf30('0x50')],null))[_0xaf30('0x13')](function(_0x462506){if(_0x462506&&_0x462ec5[_0xaf30('0x50')][_0xaf30('0x2e')]){return db['MailServerIn'][_0xaf30('0x26')](_0x462ec5['body'][_0xaf30('0x2e')],{'where':{'MailAccountId':_0x462506['id']}})[_0xaf30('0x13')](function(){return _0x462506;});}return _0x462506;})[_0xaf30('0x13')](function(_0x52d44a){if(_0x52d44a&&_0x462ec5[_0xaf30('0x50')]['Smtp']){return db[_0xaf30('0x2f')][_0xaf30('0x26')](_0x462ec5[_0xaf30('0x50')][_0xaf30('0x52')],{'where':{'MailAccountId':_0x52d44a['id']}})[_0xaf30('0x13')](function(){return _0x52d44a;});}return _0x52d44a;})[_0xaf30('0x13')](respondWithResult(_0x5f0a9b,null))[_0xaf30('0x1d')](handleError(_0x5f0a9b,null));};exports[_0xaf30('0x54')]=function(_0x3eda4b,_0x51ccca){return db[_0xaf30('0x31')][_0xaf30('0x54')]()[_0xaf30('0x13')](respondWithResult(_0x51ccca,null))['catch'](handleError(_0x51ccca,null));};exports[_0xaf30('0x55')]=function(_0x4c780d,_0x5dab47){if(_0x4c780d['body']['id']){delete _0x4c780d[_0xaf30('0x50')]['id'];}return db[_0xaf30('0x31')]['find']({'where':{'id':_0x4c780d[_0xaf30('0x4c')]['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0x5dab47,null))[_0xaf30('0x13')](function(_0x459a69){if(_0x459a69){_0x4c780d[_0xaf30('0x50')][_0xaf30('0x56')]=_0x459a69['id'];return db['Disposition'][_0xaf30('0x57')](_0x4c780d[_0xaf30('0x50')]);}})['then'](respondWithResult(_0x5dab47,null))['catch'](handleError(_0x5dab47,null));};exports['getDispositions']=function(_0x431bc1,_0x4261e1){var _0x31e52d={'raw':![],'where':{}};var _0x53d86a={};var _0x41101c={'count':0x0,'rows':[]};return db[_0xaf30('0x31')][_0xaf30('0x58')]({'where':{'id':_0x431bc1[_0xaf30('0x4c')]['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0x4261e1,null))[_0xaf30('0x13')](function(_0x59911e){if(_0x59911e){_0x53d86a[_0xaf30('0x36')]=_[_0xaf30('0x39')](db[_0xaf30('0x59')][_0xaf30('0x32')]);_0x53d86a['query']=_[_0xaf30('0x39')](_0x431bc1['query']);_0x53d86a[_0xaf30('0x3a')]=_[_0xaf30('0x3b')](_0x53d86a[_0xaf30('0x36')],_0x53d86a[_0xaf30('0x38')]);_0x31e52d[_0xaf30('0x3d')]=_['intersection'](_0x53d86a['model'],qs[_0xaf30('0x3c')](_0x431bc1[_0xaf30('0x38')]['fields']));_0x31e52d['attributes']=_0x31e52d[_0xaf30('0x3d')][_0xaf30('0x3e')]?_0x31e52d[_0xaf30('0x3d')]:_0x53d86a['model'];if(!_0x431bc1['query']['hasOwnProperty'](_0xaf30('0x40'))){_0x31e52d[_0xaf30('0x23')]=qs[_0xaf30('0x23')](_0x431bc1['query'][_0xaf30('0x23')]);_0x31e52d[_0xaf30('0x21')]=qs[_0xaf30('0x21')](_0x431bc1[_0xaf30('0x38')][_0xaf30('0x21')]);}_0x31e52d[_0xaf30('0x41')]=qs[_0xaf30('0x42')](_0x431bc1[_0xaf30('0x38')]['sort']);_0x31e52d['where']=qs[_0xaf30('0x3a')](_[_0xaf30('0x5a')](_0x431bc1[_0xaf30('0x38')],_0x53d86a[_0xaf30('0x3a')]));_0x31e52d['where']['MailAccountId']=_0x59911e['id'];if(_0x431bc1[_0xaf30('0x38')][_0xaf30('0x44')]){_0x31e52d[_0xaf30('0x43')]=_['merge'](_0x31e52d['where'],{'$or':_[_0xaf30('0x37')](_0x31e52d[_0xaf30('0x3d')],function(_0x1e3547){var _0x19c388={};_0x19c388[_0x1e3547]={'$like':'%'+_0x431bc1[_0xaf30('0x38')][_0xaf30('0x44')]+'%'};return _0x19c388;})});}_0x31e52d=_[_0xaf30('0x45')]({},_0x31e52d,_0x431bc1[_0xaf30('0x47')]);return db['Disposition'][_0xaf30('0x24')]({'where':_0x31e52d[_0xaf30('0x43')]})[_0xaf30('0x13')](function(_0x2752f4){_0x41101c['count']=_0x2752f4;if(_0x431bc1[_0xaf30('0x38')]['includeAll']){_0x31e52d[_0xaf30('0x49')]=[{'all':!![]}];}return db[_0xaf30('0x59')][_0xaf30('0x4a')](_0x31e52d);})[_0xaf30('0x13')](function(_0x4998ea){_0x41101c['rows']=_0x4998ea;return _0x41101c;});}})['then'](respondWithFilteredResult(_0x4261e1,_0x31e52d))['catch'](handleError(_0x4261e1,null));};exports[_0xaf30('0x5b')]=function(_0x3e1115,_0x4543e9){return db[_0xaf30('0x31')][_0xaf30('0x4f')]({'where':{'id':_0x3e1115[_0xaf30('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4543e9,null))['then'](function(_0x3c5259){if(_0x3c5259){return _0x3c5259[_0xaf30('0x5b')](_0x3e1115[_0xaf30('0x38')][_0xaf30('0x5c')]);}})[_0xaf30('0x13')](respondWithStatusCode(_0x4543e9,null))[_0xaf30('0x1d')](handleError(_0x4543e9,null));};exports[_0xaf30('0x5d')]=function(_0x5b2403,_0x3530a8){if(_0x5b2403['body']['id']){delete _0x5b2403[_0xaf30('0x50')]['id'];}return db[_0xaf30('0x31')][_0xaf30('0x4f')]({'where':{'id':_0x5b2403[_0xaf30('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3530a8,null))[_0xaf30('0x13')](function(_0x40b4bd){if(_0x40b4bd){_0x5b2403[_0xaf30('0x50')][_0xaf30('0x56')]=_0x40b4bd['id'];return db[_0xaf30('0x5e')][_0xaf30('0x57')](_0x5b2403[_0xaf30('0x50')]);}})['then'](respondWithResult(_0x3530a8,null))[_0xaf30('0x1d')](handleError(_0x3530a8,null));};exports[_0xaf30('0x5f')]=function(_0x3eca4b,_0x15c417){var _0x4a19c2={'raw':![],'where':{}};var _0x54bb27={};var _0x388e85={'count':0x0,'rows':[]};return db[_0xaf30('0x31')][_0xaf30('0x58')]({'where':{'id':_0x3eca4b['params']['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0x15c417,null))['then'](function(_0x41ded5){if(_0x41ded5){_0x54bb27[_0xaf30('0x36')]=_[_0xaf30('0x39')](db[_0xaf30('0x5e')][_0xaf30('0x32')]);_0x54bb27[_0xaf30('0x38')]=_[_0xaf30('0x39')](_0x3eca4b[_0xaf30('0x38')]);_0x54bb27[_0xaf30('0x3a')]=_[_0xaf30('0x3b')](_0x54bb27['model'],_0x54bb27[_0xaf30('0x38')]);_0x4a19c2['attributes']=_[_0xaf30('0x3b')](_0x54bb27[_0xaf30('0x36')],qs[_0xaf30('0x3c')](_0x3eca4b[_0xaf30('0x38')][_0xaf30('0x3c')]));_0x4a19c2[_0xaf30('0x3d')]=_0x4a19c2[_0xaf30('0x3d')][_0xaf30('0x3e')]?_0x4a19c2[_0xaf30('0x3d')]:_0x54bb27[_0xaf30('0x36')];if(!_0x3eca4b[_0xaf30('0x38')][_0xaf30('0x3f')]('nolimit')){_0x4a19c2[_0xaf30('0x23')]=qs[_0xaf30('0x23')](_0x3eca4b[_0xaf30('0x38')][_0xaf30('0x23')]);_0x4a19c2['offset']=qs[_0xaf30('0x21')](_0x3eca4b[_0xaf30('0x38')][_0xaf30('0x21')]);}_0x4a19c2[_0xaf30('0x41')]=qs[_0xaf30('0x42')](_0x3eca4b[_0xaf30('0x38')][_0xaf30('0x42')]);_0x4a19c2[_0xaf30('0x43')]=qs[_0xaf30('0x3a')](_[_0xaf30('0x5a')](_0x3eca4b[_0xaf30('0x38')],_0x54bb27[_0xaf30('0x3a')]));_0x4a19c2[_0xaf30('0x43')][_0xaf30('0x56')]=_0x41ded5['id'];if(_0x3eca4b[_0xaf30('0x38')]['filter']){_0x4a19c2[_0xaf30('0x43')]=_[_0xaf30('0x45')](_0x4a19c2[_0xaf30('0x43')],{'$or':_[_0xaf30('0x37')](_0x4a19c2['attributes'],function(_0x590136){var _0x2d512e={};_0x2d512e[_0x590136]={'$like':'%'+_0x3eca4b[_0xaf30('0x38')][_0xaf30('0x44')]+'%'};return _0x2d512e;})});}_0x4a19c2=_[_0xaf30('0x45')]({},_0x4a19c2,_0x3eca4b[_0xaf30('0x47')]);return db[_0xaf30('0x5e')][_0xaf30('0x24')]({'where':_0x4a19c2['where']})[_0xaf30('0x13')](function(_0x33e616){_0x388e85[_0xaf30('0x24')]=_0x33e616;if(_0x3eca4b[_0xaf30('0x38')]['includeAll']){_0x4a19c2[_0xaf30('0x49')]=[{'all':!![]}];}return db[_0xaf30('0x5e')][_0xaf30('0x4a')](_0x4a19c2);})[_0xaf30('0x13')](function(_0x477c26){_0x388e85[_0xaf30('0x4b')]=_0x477c26;return _0x388e85;});}})[_0xaf30('0x13')](respondWithFilteredResult(_0x15c417,_0x4a19c2))[_0xaf30('0x1d')](handleError(_0x15c417,null));};exports[_0xaf30('0x60')]=function(_0x35ebfd,_0x299f5a){return db['MailAccount']['find']({'where':{'id':_0x35ebfd[_0xaf30('0x4c')]['id']}})['then'](handleEntityNotFound(_0x299f5a,null))['then'](function(_0xd5fa01){if(_0xd5fa01){return _0xd5fa01[_0xaf30('0x60')](_0x35ebfd[_0xaf30('0x38')]['ids']);}})[_0xaf30('0x13')](respondWithStatusCode(_0x299f5a,null))[_0xaf30('0x1d')](handleError(_0x299f5a,null));};exports[_0xaf30('0x57')]=function(_0x31ca9e,_0x5c4a1f){var _0xcb185d={'name':_0x31ca9e['body'][_0xaf30('0x2b')],'key':_0x31ca9e[_0xaf30('0x50')]['key'],'provider':_0x31ca9e[_0xaf30('0x50')][_0xaf30('0x61')]==='custom'?null:_0x31ca9e[_0xaf30('0x50')][_0xaf30('0x61')],'email':_0x31ca9e['body'][_0xaf30('0x62')],'ListId':_0x31ca9e['body']['ListId'],'active':!_[_0xaf30('0x63')](_0x31ca9e[_0xaf30('0x50')][_0xaf30('0x64')])?_0x31ca9e[_0xaf30('0x50')][_0xaf30('0x64')]:!![],'description':_0x31ca9e[_0xaf30('0x50')]['description']||null,'Imap':{},'Smtp':{}};if(_0xcb185d['provider']){_0xcb185d[_0xaf30('0x2e')]['user']=_0xcb185d[_0xaf30('0x52')][_0xaf30('0x65')]=_0x31ca9e[_0xaf30('0x50')]['username'];_0xcb185d['Imap'][_0xaf30('0x66')]=_0xcb185d[_0xaf30('0x52')][_0xaf30('0x67')]=_0x31ca9e[_0xaf30('0x50')][_0xaf30('0x66')];if(_0x31ca9e['body'][_0xaf30('0x51')]){_0xcb185d[_0xaf30('0x2e')][_0xaf30('0x51')]=_0xcb185d[_0xaf30('0x52')]['modernAuthentication']=!![];_0xcb185d[_0xaf30('0x2e')]['CloudProviderId']=_0xcb185d[_0xaf30('0x52')][_0xaf30('0x53')]=_0x31ca9e[_0xaf30('0x50')][_0xaf30('0x53')];_0xcb185d['Imap'][_0xaf30('0x66')]=_0xcb185d[_0xaf30('0x52')][_0xaf30('0x67')]=null;}else{_0xcb185d[_0xaf30('0x2e')][_0xaf30('0x53')]=_0xcb185d[_0xaf30('0x52')][_0xaf30('0x53')]=null;}_0xcb185d['Imap'][_0xaf30('0x68')]=_0xcb185d['Smtp']['service']=null;_0xcb185d['Imap'][_0xaf30('0x69')]=_0xcb185d[_0xaf30('0x52')][_0xaf30('0x69')]=null;_0xcb185d['Imap']['port']=_0xcb185d['Smtp']['port']=null;}else{if(_0x31ca9e['body'][_0xaf30('0x6a')]){_0xcb185d[_0xaf30('0x2e')][_0xaf30('0x65')]=_0xcb185d['Smtp'][_0xaf30('0x65')]=_0x31ca9e[_0xaf30('0x50')]['username'];_0xcb185d['Imap']['password']=_0xcb185d[_0xaf30('0x52')][_0xaf30('0x67')]=_0x31ca9e[_0xaf30('0x50')][_0xaf30('0x66')];}else{_0xcb185d[_0xaf30('0x2e')]['authentication']=_0xcb185d[_0xaf30('0x52')]['authentication']=![];_0xcb185d[_0xaf30('0x2e')][_0xaf30('0x65')]=_0xcb185d[_0xaf30('0x52')]['user']=null;_0xcb185d[_0xaf30('0x2e')][_0xaf30('0x66')]=_0xcb185d[_0xaf30('0x52')][_0xaf30('0x67')]=null;}_0xcb185d[_0xaf30('0x2e')][_0xaf30('0x69')]=_0x31ca9e[_0xaf30('0x50')][_0xaf30('0x2e')][_0xaf30('0x69')];_0xcb185d[_0xaf30('0x2e')][_0xaf30('0x6b')]=_0x31ca9e[_0xaf30('0x50')][_0xaf30('0x2e')][_0xaf30('0x6b')];_0xcb185d[_0xaf30('0x52')][_0xaf30('0x69')]=_0x31ca9e[_0xaf30('0x50')][_0xaf30('0x52')][_0xaf30('0x69')];_0xcb185d['Smtp']['port']=_0x31ca9e[_0xaf30('0x50')][_0xaf30('0x52')][_0xaf30('0x6b')];}return db[_0xaf30('0x31')][_0xaf30('0x57')](_0xcb185d,{'include':[{'model':db[_0xaf30('0x2f')],'as':_0xaf30('0x52')},{'model':db[_0xaf30('0x4d')],'as':_0xaf30('0x2e')}]})[_0xaf30('0x13')](function(_0x3ec9d0){var _0x48c1ab=_0x31ca9e[_0xaf30('0x65')][_0xaf30('0x28')]({'plain':!![]});if(!_0x48c1ab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48c1ab[_0xaf30('0x6c')]===_0xaf30('0x65')){var _0x3734de=_0x3ec9d0[_0xaf30('0x28')]({'plain':!![]});return db[_0xaf30('0x6d')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x48c1ab[_0xaf30('0x6e')]},'raw':!![]})['then'](function(_0x248e7f){if(_0x248e7f&&_0x248e7f['autoAssociation']===0x0){return db[_0xaf30('0x6f')]['create']({'name':_0x3734de[_0xaf30('0x2b')],'resourceId':_0x3734de['id'],'type':_0x248e7f['name'],'sectionId':_0x248e7f['id']},{})[_0xaf30('0x13')](function(){return _0x3ec9d0;});}else{return _0x3ec9d0;}})[_0xaf30('0x1d')](function(_0x2134ad){logger[_0xaf30('0x18')](_0xaf30('0x70'),_0x2134ad);throw _0x2134ad;});}return _0x3ec9d0;})['then'](respondWithResult(_0x5c4a1f,0xc9))[_0xaf30('0x1d')](handleError(_0x5c4a1f,null));};exports[_0xaf30('0x71')]=function(_0xec0c80,_0x35405c){return db['MailAccount'][_0xaf30('0x58')]({'where':{'id':_0xec0c80['params']['id']}})['then'](handleEntityNotFound(_0x35405c,null))[_0xaf30('0x13')](function(_0x55173f){if(_0x55173f){return _0x55173f[_0xaf30('0x71')]();}return null;})[_0xaf30('0x13')](respondWithResult(_0x35405c,null))[_0xaf30('0x1d')](handleError(_0x35405c,null));};exports[_0xaf30('0x72')]=function(_0x1fae54,_0x57a961){if(_0x1fae54[_0xaf30('0x50')]['id']){delete _0x1fae54[_0xaf30('0x50')]['id'];}return db[_0xaf30('0x31')][_0xaf30('0x4f')]({'where':{'id':_0x1fae54[_0xaf30('0x4c')]['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0x57a961,null))[_0xaf30('0x13')](function(_0x20de80){if(_0x20de80){_0x1fae54[_0xaf30('0x50')][_0xaf30('0x56')]=_0x20de80['id'];return db[_0xaf30('0x4d')][_0xaf30('0x57')](_0x1fae54['body']);}})[_0xaf30('0x13')](respondWithResult(_0x57a961,null))[_0xaf30('0x1d')](handleError(_0x57a961,null));};exports[_0xaf30('0x73')]=function(_0x8a669a,_0x210389){return db[_0xaf30('0x31')]['findOne']({'where':{'id':_0x8a669a[_0xaf30('0x4c')]['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0x210389,null))[_0xaf30('0x13')](function(_0x1dd26f){if(_0x1dd26f){return _0x1dd26f['setImap'](null);}return null;})[_0xaf30('0x13')](respondWithStatusCode(_0x210389,null))[_0xaf30('0x1d')](handleError(_0x210389,null));};exports[_0xaf30('0x74')]=function(_0x20e5c8,_0x550304){return db['MailAccount'][_0xaf30('0x58')]({'where':{'id':_0x20e5c8['params']['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0x550304,null))['then'](function(_0x37eeb1){if(_0x37eeb1){return _0x37eeb1[_0xaf30('0x74')]();}return null;})[_0xaf30('0x13')](respondWithResult(_0x550304,null))[_0xaf30('0x1d')](handleError(_0x550304,null));};exports[_0xaf30('0x75')]=function(_0x24138c,_0x58a46f){if(_0x24138c[_0xaf30('0x50')]['id']){delete _0x24138c[_0xaf30('0x50')]['id'];}return db[_0xaf30('0x31')][_0xaf30('0x4f')]({'where':{'id':_0x24138c[_0xaf30('0x4c')]['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0x58a46f,null))['then'](function(_0x3a3fc5){if(_0x3a3fc5){_0x24138c[_0xaf30('0x50')][_0xaf30('0x56')]=_0x3a3fc5['id'];return db['MailServerOut'][_0xaf30('0x57')](_0x24138c[_0xaf30('0x50')]);}})[_0xaf30('0x13')](respondWithResult(_0x58a46f,null))[_0xaf30('0x1d')](handleError(_0x58a46f,null));};exports[_0xaf30('0x76')]=function(_0x448eea,_0x3c9928){return db[_0xaf30('0x31')][_0xaf30('0x58')]({'where':{'id':_0x448eea[_0xaf30('0x4c')]['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0x3c9928,null))[_0xaf30('0x13')](function(_0xe336bb){if(_0xe336bb){return _0xe336bb['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x3c9928,null))[_0xaf30('0x1d')](handleError(_0x3c9928,null));};exports[_0xaf30('0x77')]=function(_0x49ef00,_0x54f17d){return db[_0xaf30('0x78')][_0xaf30('0x4f')]({'where':{'id':_0x49ef00[_0xaf30('0x4c')]['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0x54f17d,null))[_0xaf30('0x13')](function(_0x971680){if(_0x971680){return _0x971680[_0xaf30('0x77')](_0x49ef00[_0xaf30('0x50')][_0xaf30('0x5c')],_['omit'](_0x49ef00['body'],[_0xaf30('0x5c'),'id'])||{});}})[_0xaf30('0x13')](respondWithResult(_0x54f17d,null))[_0xaf30('0x1d')](handleError(_0x54f17d,null));};exports[_0xaf30('0x79')]=function(_0x364833,_0x3b29aa){var _0x47d292={'raw':![],'where':{}};var _0x2f54ef={};var _0x6a6bc6={'count':0x0,'rows':[]};return db[_0xaf30('0x31')]['findOne']({'where':{'id':_0x364833[_0xaf30('0x4c')]['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0x3b29aa,null))[_0xaf30('0x13')](function(_0x3ddb63){if(_0x3ddb63){_0x2f54ef['model']=_[_0xaf30('0x39')](db[_0xaf30('0x78')][_0xaf30('0x32')]);_0x2f54ef['query']=_['keys'](_0x364833['query']);_0x2f54ef[_0xaf30('0x3a')]=_[_0xaf30('0x3b')](_0x2f54ef[_0xaf30('0x36')],_0x2f54ef[_0xaf30('0x38')]);_0x47d292[_0xaf30('0x3d')]=_['intersection'](_0x2f54ef['model'],qs[_0xaf30('0x3c')](_0x364833[_0xaf30('0x38')]['fields']));_0x47d292['attributes']=_0x47d292[_0xaf30('0x3d')][_0xaf30('0x3e')]?_0x47d292[_0xaf30('0x3d')]:_0x2f54ef[_0xaf30('0x36')];if(!_0x364833[_0xaf30('0x38')][_0xaf30('0x3f')](_0xaf30('0x40'))){_0x47d292['limit']=qs['limit'](_0x364833[_0xaf30('0x38')]['limit']);_0x47d292[_0xaf30('0x21')]=qs[_0xaf30('0x21')](_0x364833['query'][_0xaf30('0x21')]);}_0x47d292['order']=qs['sort'](_0x364833[_0xaf30('0x38')][_0xaf30('0x42')]);_0x47d292[_0xaf30('0x43')]=qs[_0xaf30('0x3a')](_[_0xaf30('0x5a')](_0x364833['query'],_0x2f54ef[_0xaf30('0x3a')]));_0x47d292[_0xaf30('0x43')][_0xaf30('0x56')]=_0x3ddb63['id'];if(_0x364833[_0xaf30('0x38')][_0xaf30('0x44')]){_0x47d292[_0xaf30('0x43')]=_[_0xaf30('0x45')](_0x47d292[_0xaf30('0x43')],{'$or':_['map'](_0x47d292[_0xaf30('0x3d')],function(_0x4145f7){var _0x2fd845={};_0x2fd845[_0x4145f7]={'$like':'%'+_0x364833[_0xaf30('0x38')][_0xaf30('0x44')]+'%'};return _0x2fd845;})});}_0x47d292=_[_0xaf30('0x45')]({},_0x47d292,_0x364833[_0xaf30('0x47')]);return db[_0xaf30('0x78')][_0xaf30('0x24')]({'where':_0x47d292[_0xaf30('0x43')]})['then'](function(_0x278fb4){_0x6a6bc6[_0xaf30('0x24')]=_0x278fb4;if(_0x364833[_0xaf30('0x38')]['includeAll']){_0x47d292[_0xaf30('0x49')]=[{'model':db[_0xaf30('0x7a')],'as':_0xaf30('0x7b'),'required':![]},{'model':db[_0xaf30('0x7c')],'as':_0xaf30('0x7d'),'attributes':[_0xaf30('0x2b'),_0xaf30('0x7e'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xaf30('0x7f'),'attributes':['id',_0xaf30('0x2b'),'color'],'where':_0x364833[_0xaf30('0x38')]['tag']?{'id':_0x364833[_0xaf30('0x38')][_0xaf30('0x80')]}:undefined,'required':_0x364833[_0xaf30('0x38')][_0xaf30('0x80')]?!![]:![]}];}return db[_0xaf30('0x78')][_0xaf30('0x4a')](_0x47d292);})['then'](function(_0x5c7b07){_0x6a6bc6['rows']=_0x5c7b07;return _0x6a6bc6;});}})[_0xaf30('0x13')](respondWithFilteredResult(_0x3b29aa,_0x47d292))[_0xaf30('0x1d')](handleError(_0x3b29aa,null));};exports['addApplications']=function addApplications(_0x4e196e,_0x295e1a){var _0x30625e=_0x4e196e['params']['id'];var _0x120d88=_0x4e196e[_0xaf30('0x50')];var _0x5cab24=0xc8;var _0x5876c2=null;return db[_0xaf30('0x81')][_0xaf30('0x82')]({'isolationLevel':db[_0xaf30('0x81')]['Transaction'][_0xaf30('0x83')][_0xaf30('0x84')]},function(_0x5b6892){return db[_0xaf30('0x31')]['findOne']({'where':{'id':_0x30625e},'transaction':_0x5b6892})['then'](function(_0x49ef71){if(_0x49ef71){return db[_0xaf30('0x85')]['destroy']({'where':{'MailAccountId':_0x30625e},'transaction':_0x5b6892})[_0xaf30('0x13')](function(){var _0x24ff8c=_[_0xaf30('0x37')](_0x120d88,function(_0x277aa9){_0x277aa9[_0xaf30('0x56')]=_0x30625e;return _0x277aa9;});return db[_0xaf30('0x85')]['bulkCreate'](_0x24ff8c,{'transaction':_0x5b6892});});}else{_0x5cab24=0x194;_0x5876c2=[];}});})[_0xaf30('0x13')](function(){if(_0x5cab24!==0x194){return db[_0xaf30('0x85')][_0xaf30('0x86')]({'where':{'MailAccountId':_0x30625e},'order':_0xaf30('0x87')})[_0xaf30('0x13')](function(_0x4a24ec){_0x5876c2=_0x4a24ec;});}})[_0xaf30('0x1d')](function(_0x36c472){_0x5cab24=0x1f4;logger[_0xaf30('0x18')](_0x36c472[_0xaf30('0x2a')]);if(_0x36c472[_0xaf30('0x2b')]){delete _0x36c472[_0xaf30('0x2b')];}_0x5876c2=_0x36c472;})[_0xaf30('0x88')](function(){if(_0x5876c2===null){_0x295e1a['sendStatus'](_0x5cab24);}else{if(_0x5cab24===0x1f4){_0x295e1a[_0xaf30('0x1f')](_0x5cab24)[_0xaf30('0x2c')](_0x5876c2);}else{_0x295e1a[_0xaf30('0x1f')](_0x5cab24)[_0xaf30('0x89')](_0x5876c2);}}});};exports['getApplications']=function(_0x30b6f3,_0x47078c){var _0x1c9cf5={};var _0x5dd2ef={};var _0x230553;var _0x25685b;return db['MailAccount'][_0xaf30('0x58')]({'where':{'id':_0x30b6f3[_0xaf30('0x4c')]['id']}})['then'](handleEntityNotFound(_0x47078c,null))['then'](function(_0x57d034){if(_0x57d034){_0x230553=_0x57d034;_0x5dd2ef[_0xaf30('0x36')]=_[_0xaf30('0x39')](db['MailApplication'][_0xaf30('0x32')]);_0x5dd2ef[_0xaf30('0x38')]=_[_0xaf30('0x39')](_0x30b6f3['query']);_0x5dd2ef[_0xaf30('0x3a')]=_[_0xaf30('0x3b')](_0x5dd2ef[_0xaf30('0x36')],_0x5dd2ef['query']);_0x1c9cf5[_0xaf30('0x3d')]=_['intersection'](_0x5dd2ef[_0xaf30('0x36')],qs['fields'](_0x30b6f3[_0xaf30('0x38')][_0xaf30('0x3c')]));_0x1c9cf5[_0xaf30('0x3d')]=_0x1c9cf5[_0xaf30('0x3d')]['length']?_0x1c9cf5[_0xaf30('0x3d')]:_0x5dd2ef['model'];_0x1c9cf5[_0xaf30('0x41')]=qs['sort'](_0x30b6f3['query']['sort']);_0x1c9cf5[_0xaf30('0x43')]=qs[_0xaf30('0x3a')](_[_0xaf30('0x5a')](_0x30b6f3[_0xaf30('0x38')],_0x5dd2ef['filters']));if(_0x30b6f3['query'][_0xaf30('0x44')]){_0x1c9cf5[_0xaf30('0x43')]=_['merge'](_0x1c9cf5[_0xaf30('0x43')],{'$or':_[_0xaf30('0x37')](_0x1c9cf5[_0xaf30('0x3d')],function(_0x311657){var _0x58ff25={};_0x58ff25[_0x311657]={'$like':'%'+_0x30b6f3['query'][_0xaf30('0x44')]+'%'};return _0x58ff25;})});}_0x1c9cf5=_['merge']({},_0x1c9cf5,_0x30b6f3[_0xaf30('0x47')]);return _0x230553['getApplications'](_0x1c9cf5);}})['then'](function(_0x1eae9b){if(_0x1eae9b){_0x25685b=_0x1eae9b[_0xaf30('0x3e')];if(!_0x30b6f3[_0xaf30('0x38')][_0xaf30('0x3f')]('nolimit')){_0x1c9cf5[_0xaf30('0x23')]=qs['limit'](_0x30b6f3[_0xaf30('0x38')][_0xaf30('0x23')]);_0x1c9cf5[_0xaf30('0x21')]=qs['offset'](_0x30b6f3['query'][_0xaf30('0x21')]);}return _0x230553[_0xaf30('0x8a')](_0x1c9cf5);}})[_0xaf30('0x13')](function(_0x5c1983){if(_0x5c1983){return _0x5c1983?{'count':_0x25685b,'rows':_0x5c1983}:null;}})[_0xaf30('0x13')](respondWithResult(_0x47078c,null))['catch'](handleError(_0x47078c,null));};exports[_0xaf30('0x8b')]=function(_0x3f5f0a,_0x26f179){var _0x50c091={'raw':!![],'where':{}};var _0x575a89={};var _0x496963={'count':0x0,'rows':[]};return db['MailAccount'][_0xaf30('0x58')]({'where':{'id':_0x3f5f0a[_0xaf30('0x4c')]['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0x26f179,null))['then'](function(_0x28e68d){if(_0x28e68d){_0x575a89[_0xaf30('0x36')]=_[_0xaf30('0x39')](db[_0xaf30('0x8c')]['rawAttributes']);_0x575a89[_0xaf30('0x38')]=_[_0xaf30('0x39')](_0x3f5f0a[_0xaf30('0x38')]);_0x575a89[_0xaf30('0x3a')]=_[_0xaf30('0x3b')](_0x575a89[_0xaf30('0x36')],_0x575a89['query']);_0x50c091['attributes']=_['intersection'](_0x575a89[_0xaf30('0x36')],qs[_0xaf30('0x3c')](_0x3f5f0a[_0xaf30('0x38')][_0xaf30('0x3c')]));_0x50c091[_0xaf30('0x3d')]=_0x50c091['attributes']['length']?_0x50c091[_0xaf30('0x3d')]:_0x575a89['model'];if(!_0x3f5f0a[_0xaf30('0x38')]['hasOwnProperty'](_0xaf30('0x40'))){_0x50c091[_0xaf30('0x23')]=qs[_0xaf30('0x23')](_0x3f5f0a[_0xaf30('0x38')]['limit']);_0x50c091['offset']=qs[_0xaf30('0x21')](_0x3f5f0a[_0xaf30('0x38')][_0xaf30('0x21')]);}_0x50c091[_0xaf30('0x41')]=qs[_0xaf30('0x42')](_0x3f5f0a['query'][_0xaf30('0x42')]);_0x50c091[_0xaf30('0x43')]=qs['filters'](_[_0xaf30('0x5a')](_0x3f5f0a[_0xaf30('0x38')],_0x575a89['filters']));_0x50c091[_0xaf30('0x43')][_0xaf30('0x56')]=_0x28e68d['id'];if(_0x3f5f0a[_0xaf30('0x38')][_0xaf30('0x44')]){_0x50c091[_0xaf30('0x43')]=_[_0xaf30('0x45')](_0x50c091[_0xaf30('0x43')],{'$or':_[_0xaf30('0x37')](_0x50c091[_0xaf30('0x3d')],function(_0x134bee){var _0x40a050={};_0x40a050[_0x134bee]={'$like':'%'+_0x3f5f0a['query']['filter']+'%'};return _0x40a050;})});}if(_0x3f5f0a[_0xaf30('0x38')][_0xaf30('0x8d')]){var _0x416068=_0x3f5f0a[_0xaf30('0x38')]['$gte'][_0xaf30('0x8e')](',');var _0x178ab8={};_0x178ab8[_0x416068[0x0]]={'$gte':moment(_0x416068[0x1])[_0xaf30('0x8f')](_0xaf30('0x90'))};_0x50c091[_0xaf30('0x43')]=_[_0xaf30('0x45')](_0x50c091[_0xaf30('0x43')],_0x178ab8);}_0x50c091=_['merge']({},_0x50c091,_0x3f5f0a[_0xaf30('0x47')]);return db[_0xaf30('0x8c')][_0xaf30('0x24')]({'where':_0x50c091['where']})[_0xaf30('0x13')](function(_0x4a3156){_0x496963[_0xaf30('0x24')]=_0x4a3156;if(_0x3f5f0a[_0xaf30('0x38')][_0xaf30('0x48')]){_0x50c091[_0xaf30('0x49')]=[{'all':!![]}];}return db[_0xaf30('0x8c')][_0xaf30('0x4a')](_0x50c091);})[_0xaf30('0x13')](function(_0x24f06f){if(_0x3f5f0a[_0xaf30('0x38')][_0xaf30('0x91')]==='true'){for(var _0x3fc31e=0x0;_0x3fc31e<_0x24f06f[_0xaf30('0x3e')];_0x3fc31e++){_0x24f06f[_0x3fc31e][_0xaf30('0x50')]=juice(_0x24f06f[_0x3fc31e][_0xaf30('0x50')]);}}_0x496963[_0xaf30('0x4b')]=_0x24f06f;return _0x496963;});}})[_0xaf30('0x13')](respondWithFilteredResult(_0x26f179,_0x50c091))[_0xaf30('0x1d')](handleError(_0x26f179,null));};exports[_0xaf30('0x2c')]=function(_0x1ee570,_0x6d2101){var _0x129e29,_0x3b96fc={},_0x2bd863;if(_0x1ee570[_0xaf30('0x50')]['to']){_0x2bd863=_0x1ee570[_0xaf30('0x50')]['to'][_0xaf30('0x8e')](',')[0x0];}return db[_0xaf30('0x31')][_0xaf30('0x4f')]({'where':{'id':_0x1ee570[_0xaf30('0x4c')]['id']},'include':[{'model':db[_0xaf30('0x92')],'as':_0xaf30('0x93'),'include':[{'model':db['CmContact'],'as':_0xaf30('0x94'),'where':{'email':_0x2bd863},'limit':0x1,'order':[[_0xaf30('0x95'),'DESC']]}]},{'model':db[_0xaf30('0x2f')],'as':'Smtp','raw':!![]}]})[_0xaf30('0x13')](handleEntityNotFound(_0x6d2101,null))[_0xaf30('0x13')](function(_0x1d52c4){if(_0x1d52c4){_0x129e29=_0x1d52c4;if(_0x1d52c4[_0xaf30('0x52')]){if(_[_0xaf30('0x63')](_0x1ee570[_0xaf30('0x50')][_0xaf30('0x96')])){_0x1ee570[_0xaf30('0x50')][_0xaf30('0x96')]=util['format'](_0xaf30('0x97'),_0x1d52c4[_0xaf30('0x2b')],_0x1d52c4[_0xaf30('0x62')]||_0x1d52c4[_0xaf30('0x52')][_0xaf30('0x65')]);}if(_0x1ee570['body']['attachments']&&_0x1ee570[_0xaf30('0x50')][_0xaf30('0x98')]['length']){for(var _0x15ec6d=0x0;_0x15ec6d<_0x1ee570[_0xaf30('0x50')][_0xaf30('0x98')][_0xaf30('0x3e')];_0x15ec6d+=0x1){_0x1ee570[_0xaf30('0x50')][_0xaf30('0x98')][_0x15ec6d]={'filename':_0x1ee570[_0xaf30('0x50')][_0xaf30('0x98')][_0x15ec6d]['name'],'path':path[_0xaf30('0x99')](config[_0xaf30('0x9a')],_0xaf30('0x9b'),_0x1ee570[_0xaf30('0x50')][_0xaf30('0x98')][_0x15ec6d][_0xaf30('0x9c')])};}}var _0xddbf65={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x1d52c4[_0xaf30('0x52')][_0xaf30('0x68')])){if(_0x1d52c4['Smtp'][_0xaf30('0x6a')]){_0xddbf65[_0xaf30('0x9d')]={'user':_0x1d52c4[_0xaf30('0x52')]['user'],'pass':_0x1d52c4['Smtp'][_0xaf30('0x67')]};}_0xddbf65['host']=_0x1d52c4['Smtp']['host'];_0xddbf65[_0xaf30('0x6b')]=_0x1d52c4[_0xaf30('0x52')]['port'];_0xddbf65[_0xaf30('0x9e')]=_0x1d52c4[_0xaf30('0x52')]['secure'];}else{_0xddbf65[_0xaf30('0x68')]=_0x1d52c4[_0xaf30('0x52')][_0xaf30('0x68')];_0xddbf65[_0xaf30('0x9d')]={'user':_0x1d52c4[_0xaf30('0x52')]['user'],'pass':_0x1d52c4['Smtp']['pass']};}return respondWithRpcPromise(_0xaf30('0x9f'),_0xaf30('0xa0'),{'account':_0xddbf65,'message':_0x1ee570[_0xaf30('0x50')]});}else{throw new Error(_0xaf30('0xa1'));}}})[_0xaf30('0x13')](function(_0x15da96){if(_0x15da96){_0x3b96fc=_0x15da96;if(_0x129e29[_0xaf30('0x93')]){if(_0x129e29[_0xaf30('0x93')][_0xaf30('0x94')]['length']){return _0x129e29[_0xaf30('0x93')][_0xaf30('0x94')][0x0];}else{return db['CmContact'][_0xaf30('0x57')](_[_0xaf30('0xa')](_0x1ee570[_0xaf30('0x50')],{'firstName':_0x1ee570[_0xaf30('0x50')]['to'],'email':_0x1ee570['body']['to'],'phone':_0x1ee570['body']['to'],'ListId':_0x129e29[_0xaf30('0xa2')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xaf30('0x13')](function(_0x4743d3){if(_0x4743d3){var _0x49e5e7={'UserId':_0x1ee570[_0xaf30('0x65')]['id'],'ContactId':_0x4743d3['id'],'MailAccountId':_0x129e29['id'],'inReplyTo':_0x3b96fc[_0xaf30('0xa3')],'to':_0x1ee570[_0xaf30('0x50')][_0xaf30('0x96')],'cc':_0x1ee570['body']['cc'],'subject':_0x1ee570[_0xaf30('0x50')][_0xaf30('0xa4')],'attach':_0x1ee570[_0xaf30('0x50')][_0xaf30('0xa5')],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0xaf30('0x90')),'lastMsgDirection':'out','Messages':[_['merge'](_0x1ee570[_0xaf30('0x50')],{'messageId':_0x3b96fc[_0xaf30('0xa3')],'sentAt':moment()[_0xaf30('0x8f')](_0xaf30('0x90')),'read':!![],'MailAccountId':_0x129e29['id'],'UserId':_0x1ee570['user']['id'],'ContactId':_0x4743d3['id']})]};if(_0x1ee570['body'][_0xaf30('0xa6')]){_0x49e5e7=_[_0xaf30('0x45')](_0x49e5e7,_0x1ee570[_0xaf30('0x50')][_0xaf30('0xa6')]);}return db[_0xaf30('0x78')][_0xaf30('0x57')](_0x49e5e7,{'include':[{'model':db['MailMessage'],'as':_0xaf30('0xa7')}]});}})['then'](respondWithResult(_0x6d2101,null))[_0xaf30('0x1d')](handleError(_0x6d2101,null));};exports[_0xaf30('0xa8')]=function(_0x36a7c0,_0x4c308f){return db[_0xaf30('0x31')]['find']({'where':{'id':_0x36a7c0[_0xaf30('0x4c')]['id']},'include':[{'model':db[_0xaf30('0x2f')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xaf30('0xa9')],'as':_0xaf30('0xa9'),'raw':!![]}]}]})[_0xaf30('0x13')](handleEntityNotFound(_0x4c308f,null))[_0xaf30('0x13')](function(_0x26e07a){if(!_0x26e07a[_0xaf30('0x52')])return;var _0x303c91={'id':_0x26e07a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x26e07a['provider']!==_0xaf30('0xaa')){_0x303c91[_0xaf30('0x68')]=_0x26e07a[_0xaf30('0x61')];}else{_0x303c91[_0xaf30('0x69')]=_0x26e07a[_0xaf30('0x52')]['host'];_0x303c91[_0xaf30('0x6b')]=_0x26e07a[_0xaf30('0x52')]['port'];_0x303c91[_0xaf30('0x9e')]=_0x26e07a['Smtp'][_0xaf30('0x9e')];}if(_0x26e07a[_0xaf30('0x52')]['authentication']){if(_0x26e07a[_0xaf30('0x52')][_0xaf30('0x51')]){_0x303c91[_0xaf30('0x9d')]={'type':_0xaf30('0xab'),'user':_0x26e07a[_0xaf30('0x52')][_0xaf30('0x65')],'accessToken':_0x26e07a[_0xaf30('0x52')][_0xaf30('0xa9')]['data5']};}else{_0x303c91[_0xaf30('0x9d')]={'user':_0x26e07a[_0xaf30('0x52')][_0xaf30('0x65')],'pass':_0x26e07a['Smtp']['pass']};}}return respondWithRpcPromise(_0xaf30('0xac'),_0xaf30('0xa8'),{'account':_0x303c91});})[_0xaf30('0x13')](respondWithResult(_0x4c308f,null))[_0xaf30('0x1d')](handleError(_0x4c308f,null));};exports[_0xaf30('0x27')]=function(_0x5ea215,_0x5303e1){return db[_0xaf30('0x31')][_0xaf30('0x4f')]({'where':{'id':_0x5ea215[_0xaf30('0x4c')]['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0x5303e1,null))[_0xaf30('0x13')](function(_0x5c07c1){if(_0x5c07c1&&_0x5c07c1['service']){throw new db[(_0xaf30('0xad'))][(_0xaf30('0xae'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x5c07c1;})['then'](removeEntity(_0x5303e1,null))[_0xaf30('0x1d')](handleError(_0x5303e1,null));};exports[_0xaf30('0xaf')]=function(_0x5ef089,_0x2c869d){return db[_0xaf30('0x31')]['find']({'where':{'id':_0x5ef089['params']['id']}})['then'](handleEntityNotFound(_0x2c869d,null))['then'](function(_0x1c90a0){if(_0x1c90a0){return _0x1c90a0[_0xaf30('0xaf')](_0x5ef089[_0xaf30('0x50')]['ids'],_[_0xaf30('0xb0')](_0x5ef089[_0xaf30('0x50')],[_0xaf30('0x5c'),'id'])||{})[_0xaf30('0xb1')](function(_0x1f0495){for(var _0x1704ad=0x0;_0x1704ad<_0x5ef089[_0xaf30('0x50')][_0xaf30('0x5c')][_0xaf30('0x3e')];_0x1704ad+=0x1){socket['emit'](_0xaf30('0xb2'),{'UserId':Number(_0x5ef089[_0xaf30('0x50')]['ids'][_0x1704ad]),'MailAccountId':Number(_0x5ef089[_0xaf30('0x4c')]['id'])});}return _0x1f0495;});}})[_0xaf30('0x13')](respondWithResult(_0x2c869d,null))[_0xaf30('0x1d')](handleError(_0x2c869d,null));};exports['removeAgents']=function(_0x461b90,_0x27cd5f){return db[_0xaf30('0x31')][_0xaf30('0x4f')]({'where':{'id':_0x461b90[_0xaf30('0x4c')]['id']}})['then'](handleEntityNotFound(_0x27cd5f,null))[_0xaf30('0x13')](function(_0x5990a0){if(_0x5990a0){return _0x5990a0['removeAgents'](_0x461b90['query'][_0xaf30('0x5c')])['then'](function(){if(_[_0xaf30('0xb3')](_0x461b90['query'][_0xaf30('0x5c')])){for(var _0x5b270d=0x0;_0x5b270d<_0x461b90[_0xaf30('0x38')]['ids']['length'];_0x5b270d+=0x1){socket[_0xaf30('0xb4')](_0xaf30('0xb5'),{'UserId':Number(_0x461b90['query'][_0xaf30('0x5c')][_0x5b270d]),'MailAccountId':Number(_0x461b90[_0xaf30('0x4c')]['id'])});}}else{socket[_0xaf30('0xb4')]('userMailAccount:remove',{'UserId':Number(_0x461b90[_0xaf30('0x38')][_0xaf30('0x5c')]),'MailAccountId':Number(_0x461b90[_0xaf30('0x4c')]['id'])});}});}})[_0xaf30('0x13')](respondWithStatusCode(_0x27cd5f,null))[_0xaf30('0x1d')](handleError(_0x27cd5f,null));};exports['getAgents']=function(_0x1fa72a,_0xaed57d){var _0x58cc33={};var _0x1ff9f9={};var _0x59d730;var _0x4a50f1;return db[_0xaf30('0x31')]['findOne']({'where':{'id':_0x1fa72a[_0xaf30('0x4c')]['id']}})[_0xaf30('0x13')](handleEntityNotFound(_0xaed57d,null))['then'](function(_0x278bc9){if(_0x278bc9){_0x59d730=_0x278bc9;_0x1ff9f9[_0xaf30('0x36')]=_[_0xaf30('0x39')](db[_0xaf30('0x7c')][_0xaf30('0x32')]);_0x1ff9f9[_0xaf30('0x38')]=_['keys'](_0x1fa72a[_0xaf30('0x38')]);_0x1ff9f9[_0xaf30('0x3a')]=_[_0xaf30('0x3b')](_0x1ff9f9[_0xaf30('0x36')],_0x1ff9f9[_0xaf30('0x38')]);_0x58cc33[_0xaf30('0x3d')]=_[_0xaf30('0x3b')](_0x1ff9f9['model'],qs['fields'](_0x1fa72a[_0xaf30('0x38')]['fields']));_0x58cc33['attributes']=_0x58cc33[_0xaf30('0x3d')][_0xaf30('0x3e')]?_0x58cc33[_0xaf30('0x3d')]:_0x1ff9f9['model'];_0x58cc33[_0xaf30('0x41')]=qs[_0xaf30('0x42')](_0x1fa72a[_0xaf30('0x38')]['sort']);_0x58cc33[_0xaf30('0x43')]=qs[_0xaf30('0x3a')](_[_0xaf30('0x5a')](_0x1fa72a[_0xaf30('0x38')],_0x1ff9f9['filters']));if(_0x1fa72a[_0xaf30('0x38')][_0xaf30('0x44')]){_0x58cc33[_0xaf30('0x43')]=_[_0xaf30('0x45')](_0x58cc33[_0xaf30('0x43')],{'$or':_[_0xaf30('0x37')](_0x58cc33['attributes'],function(_0xcb2f88){var _0x5a5205={};_0x5a5205[_0xcb2f88]={'$like':'%'+_0x1fa72a[_0xaf30('0x38')]['filter']+'%'};return _0x5a5205;})});}_0x58cc33=_[_0xaf30('0x45')]({},_0x58cc33,_0x1fa72a[_0xaf30('0x47')]);return _0x59d730['getAgents'](_0x58cc33);}})['then'](function(_0xc6605e){if(_0xc6605e){_0x4a50f1=_0xc6605e['length'];if(!_0x1fa72a[_0xaf30('0x38')][_0xaf30('0x3f')]('nolimit')){_0x58cc33[_0xaf30('0x23')]=qs[_0xaf30('0x23')](_0x1fa72a['query'][_0xaf30('0x23')]);_0x58cc33['offset']=qs[_0xaf30('0x21')](_0x1fa72a['query'][_0xaf30('0x21')]);}return _0x59d730[_0xaf30('0xb6')](_0x58cc33);}})[_0xaf30('0x13')](function(_0x126c0c){if(_0x126c0c){return _0x126c0c?{'count':_0x4a50f1,'rows':_0x126c0c}:null;}})[_0xaf30('0x13')](respondWithResult(_0xaed57d,null))['catch'](handleError(_0xaed57d,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 524a9b8..957b584 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 _0xed5c=['remove','emit','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update'];(function(_0x1d69d2,_0x2ef689){var _0x10b3ba=function(_0x2651f8){while(--_0x2651f8){_0x1d69d2['push'](_0x1d69d2['shift']());}};_0x10b3ba(++_0x2ef689);}(_0xed5c,0x81));var _0xced5=function(_0x4ece94,_0x315047){_0x4ece94=_0x4ece94-0x0;var _0x3e5664=_0xed5c[_0x4ece94];return _0x3e5664;};'use strict';var EventEmitter=require(_0xced5('0x0'));var MailAccount=require(_0xced5('0x1'))['db'][_0xced5('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xced5('0x3')](0x0);var events={'afterCreate':_0xced5('0x4'),'afterUpdate':_0xced5('0x5'),'afterDestroy':_0xced5('0x6')};function emitEvent(_0x395c27){return function(_0x2b8184,_0x2ec4f9,_0x583a62){MailAccountEvents[_0xced5('0x7')](_0x395c27+':'+_0x2b8184['id'],_0x2b8184);MailAccountEvents[_0xced5('0x7')](_0x395c27,_0x2b8184);_0x583a62(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xced5('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xb091=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','../../mysqldb','MailAccount'];(function(_0x5be41b,_0x333257){var _0x11c96e=function(_0x3fff04){while(--_0x3fff04){_0x5be41b['push'](_0x5be41b['shift']());}};_0x11c96e(++_0x333257);}(_0xb091,0x16e));var _0x1b09=function(_0x37425a,_0x1c99ad){_0x37425a=_0x37425a-0x0;var _0x5a0e3b=_0xb091[_0x37425a];return _0x5a0e3b;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x1b09('0x0'))['db'][_0x1b09('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1b09('0x2')](0x0);var events={'afterCreate':_0x1b09('0x3'),'afterUpdate':'update','afterDestroy':_0x1b09('0x4')};function emitEvent(_0x59af61){return function(_0x5aa3b0,_0x295863,_0x24d22c){MailAccountEvents['emit'](_0x59af61+':'+_0x5aa3b0['id'],_0x5aa3b0);MailAccountEvents[_0x1b09('0x5')](_0x59af61,_0x5aa3b0);_0x24d22c(null);};}for(var e in events){if(events[_0x1b09('0x6')](e)){var event=events[e];MailAccount[_0x1b09('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 25bf737..d645df3 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 _0x4f92=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','define','MailAccount','mail_accounts','lodash'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x4f92,0x19f));var _0x24f9=function(_0xc1136d,_0x3d339f){_0xc1136d=_0xc1136d-0x0;var _0x3ba510=_0x4f92[_0xc1136d];return _0x3ba510;};'use strict';var _=require(_0x24f9('0x0'));var util=require(_0x24f9('0x1'));var logger=require('../../config/logger')(_0x24f9('0x2'));var moment=require(_0x24f9('0x3'));var BPromise=require(_0x24f9('0x4'));var rp=require(_0x24f9('0x5'));var fs=require('fs');var path=require(_0x24f9('0x6'));var rimraf=require(_0x24f9('0x7'));var config=require(_0x24f9('0x8'));var attributes=require(_0x24f9('0x9'));module['exports']=function(_0x5c8663,_0xde95b6){return _0x5c8663[_0x24f9('0xa')](_0x24f9('0xb'),attributes,{'tableName':_0x24f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf378=['define','MailAccount','mail_accounts','lodash','util','api','bluebird','request-promise','path','../../config/environment','./mailAccount.attributes','exports'];(function(_0x351d63,_0x53e576){var _0x2002a4=function(_0x1224db){while(--_0x1224db){_0x351d63['push'](_0x351d63['shift']());}};_0x2002a4(++_0x53e576);}(_0xf378,0x1d7));var _0x8f37=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xf378[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x8f37('0x0'));var util=require(_0x8f37('0x1'));var logger=require('../../config/logger')(_0x8f37('0x2'));var moment=require('moment');var BPromise=require(_0x8f37('0x3'));var rp=require(_0x8f37('0x4'));var fs=require('fs');var path=require(_0x8f37('0x5'));var rimraf=require('rimraf');var config=require(_0x8f37('0x6'));var attributes=require(_0x8f37('0x7'));module[_0x8f37('0x8')]=function(_0x1dfdf3,_0x159083){return _0x1dfdf3[_0x8f37('0x9')](_0x8f37('0xa'),attributes,{'tableName':_0x8f37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index dcf5f23..5e7f253 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 _0xc9bb=['stringify','error','code','message','result','catch','MailAccount','findAll','options','raw','where','limit','include','map','model','attributes','info','GetMailAccount','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','MailApplication','get','omit','Applications','list','applications','asc','autoclose','push','length','close','*,*,*,*','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','MailInteraction','create','Contact\x20not\x20found','spread','update','interaction','created','attachments','originCc','ChatWebsiteId','Attachment','Attachments','UserId','User','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0xc9bb,0x1ea));var _0xbc9b=function(_0x512c96,_0x21e519){_0x512c96=_0x512c96-0x0;var _0x5350c6=_0xc9bb[_0x512c96];return _0x5350c6;};'use strict';var _=require(_0xbc9b('0x0'));var util=require(_0xbc9b('0x1'));var moment=require(_0xbc9b('0x2'));var BPromise=require(_0xbc9b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc9b('0x4'))['db'];var utils=require(_0xbc9b('0x5'));var logger=require('../../config/logger')(_0xbc9b('0x6'));var config=require(_0xbc9b('0x7'));var jayson=require(_0xbc9b('0x8'));var client=jayson[_0xbc9b('0x9')][_0xbc9b('0xa')]({'port':0x232c});config[_0xbc9b('0xb')]=_[_0xbc9b('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbc9b('0xd'))(new Redis(config['redis']));require('./mailAccount.socket')[_0xbc9b('0xe')](socket);function respondWithRpcPromise(_0x3c8a94,_0x493327,_0x434a82){return new BPromise(function(_0x4faeb8,_0x3cd1e3){return client[_0xbc9b('0xf')](_0x3c8a94,_0x434a82)[_0xbc9b('0x10')](function(_0x51838d){logger['info'](_0xbc9b('0x11'),_0x493327,_0xbc9b('0x12'));logger[_0xbc9b('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x493327,_0xbc9b('0x12'),JSON[_0xbc9b('0x14')](_0x51838d));if(_0x51838d[_0xbc9b('0x15')]){if(_0x51838d[_0xbc9b('0x15')][_0xbc9b('0x16')]===0x1f4){logger['error'](_0xbc9b('0x11'),_0x493327,_0x51838d['error'][_0xbc9b('0x17')]);return _0x3cd1e3(_0x51838d[_0xbc9b('0x15')][_0xbc9b('0x17')]);}logger[_0xbc9b('0x15')](_0xbc9b('0x11'),_0x493327,_0x51838d[_0xbc9b('0x15')]['message']);return _0x4faeb8(_0x51838d[_0xbc9b('0x15')][_0xbc9b('0x17')]);}else{logger['info'](_0xbc9b('0x11'),_0x493327,_0xbc9b('0x12'));_0x4faeb8(_0x51838d[_0xbc9b('0x18')]['message']);}})[_0xbc9b('0x19')](function(_0x11667c){logger[_0xbc9b('0x15')]('MailAccount,\x20%s,\x20%s',_0x493327,_0x11667c);_0x3cd1e3(_0x11667c);});});}exports['GetMailAccount']=function(_0x1120d3){var _0x1308e1=this;return new Promise(function(_0x423fc8,_0x34bca2){return db[_0xbc9b('0x1a')][_0xbc9b('0x1b')]({'raw':_0x1120d3[_0xbc9b('0x1c')]?_0x1120d3[_0xbc9b('0x1c')][_0xbc9b('0x1d')]===undefined?!![]:![]:!![],'where':_0x1120d3[_0xbc9b('0x1c')]?_0x1120d3[_0xbc9b('0x1c')][_0xbc9b('0x1e')]||null:null,'attributes':_0x1120d3[_0xbc9b('0x1c')]?_0x1120d3[_0xbc9b('0x1c')]['attributes']||null:null,'limit':_0x1120d3[_0xbc9b('0x1c')]?_0x1120d3['options'][_0xbc9b('0x1f')]||null:null,'include':_0x1120d3['options']?_0x1120d3[_0xbc9b('0x1c')][_0xbc9b('0x20')]?_[_0xbc9b('0x21')](_0x1120d3[_0xbc9b('0x1c')][_0xbc9b('0x20')],function(_0x13a0ec){return{'model':db[_0x13a0ec[_0xbc9b('0x22')]],'as':_0x13a0ec['as'],'attributes':_0x13a0ec[_0xbc9b('0x23')],'include':_0x13a0ec[_0xbc9b('0x20')]?_['map'](_0x13a0ec[_0xbc9b('0x20')],function(_0x273e27){return{'model':db[_0x273e27[_0xbc9b('0x22')]],'as':_0x273e27['as'],'attributes':_0x273e27[_0xbc9b('0x23')],'include':_0x273e27[_0xbc9b('0x20')]?_[_0xbc9b('0x21')](_0x273e27['include'],function(_0x2a352b){return{'model':db[_0x2a352b[_0xbc9b('0x22')]],'as':_0x2a352b['as'],'attributes':_0x2a352b[_0xbc9b('0x23')]};}):[]};}):[]};}):[]:[]})[_0xbc9b('0x10')](function(_0x53c970){logger[_0xbc9b('0x24')](_0xbc9b('0x25'),_0x1120d3);logger[_0xbc9b('0x13')](_0xbc9b('0x25'),_0x1120d3,JSON[_0xbc9b('0x14')](_0x53c970));_0x423fc8(_0x53c970);})['catch'](function(_0x2cb013){logger[_0xbc9b('0x15')]('GetMailAccount',_0x2cb013[_0xbc9b('0x17')],_0x1120d3);_0x34bca2(_0x1308e1[_0xbc9b('0x15')](0x1f4,_0x2cb013[_0xbc9b('0x17')]));});});};exports[_0xbc9b('0x26')]=function(_0x14afea){var _0x520e1a=this;return new Promise(function(_0x552e2b,_0x37568b){return db['MailAccount']['find']({'raw':_0x14afea['options']?_0x14afea[_0xbc9b('0x1c')][_0xbc9b('0x1d')]===undefined?!![]:![]:!![],'where':_0x14afea[_0xbc9b('0x1c')]?_0x14afea[_0xbc9b('0x1c')][_0xbc9b('0x1e')]||null:null,'attributes':_0x14afea[_0xbc9b('0x1c')]?_0x14afea[_0xbc9b('0x1c')][_0xbc9b('0x23')]||null:null,'include':_0x14afea[_0xbc9b('0x1c')]?_0x14afea['options'][_0xbc9b('0x20')]?_[_0xbc9b('0x21')](_0x14afea['options'][_0xbc9b('0x20')],function(_0x3d6fde){return{'model':db[_0x3d6fde['model']],'as':_0x3d6fde['as'],'attributes':_0x3d6fde[_0xbc9b('0x23')],'include':_0x3d6fde[_0xbc9b('0x20')]?_[_0xbc9b('0x21')](_0x3d6fde['include'],function(_0x28f7ee){return{'model':db[_0x28f7ee[_0xbc9b('0x22')]],'as':_0x28f7ee['as'],'attributes':_0x28f7ee['attributes'],'include':_0x28f7ee[_0xbc9b('0x20')]?_['map'](_0x28f7ee['include'],function(_0x5a6eb4){return{'model':db[_0x5a6eb4[_0xbc9b('0x22')]],'as':_0x5a6eb4['as'],'attributes':_0x5a6eb4['attributes']};}):[]};}):[]};}):[]:[]})[_0xbc9b('0x10')](function(_0x598e99){logger[_0xbc9b('0x24')]('ShowMailAccount',_0x14afea);logger[_0xbc9b('0x13')](_0xbc9b('0x26'),_0x14afea,JSON[_0xbc9b('0x14')](_0x598e99));_0x552e2b(_0x598e99);})[_0xbc9b('0x19')](function(_0x1b8233){logger[_0xbc9b('0x15')](_0xbc9b('0x26'),_0x1b8233['message'],_0x14afea);_0x37568b(_0x520e1a[_0xbc9b('0x15')](0x1f4,_0x1b8233['message']));});});};exports[_0xbc9b('0x27')]=function(_0x20ada){var _0x480e21=this;return new Promise(function(_0x5326f5,_0x56fd5c){var _0x4c9186={'body':_0x20ada[_0xbc9b('0x28')],'channel':_0xbc9b('0x29')};var _0x15a67a=_[_0xbc9b('0x2a')](_[_0xbc9b('0x2b')](db[_0xbc9b('0x2c')]['rawAttributes']),[_0xbc9b('0x2d'),_0xbc9b('0x2e'),_0xbc9b('0x2f'),_0xbc9b('0x30')]);var _0x19bce3=![];if(_0x20ada[_0xbc9b('0x28')]['id']){delete _0x20ada[_0xbc9b('0x28')]['id'];}if(_[_0xbc9b('0x31')](_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x32')])){return _0x56fd5c(_0x480e21['error'](0x1f4,_0xbc9b('0x33')));}if(_['isNil'](_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x28')])||_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x28')]===''){return _0x56fd5c(_0x480e21[_0xbc9b('0x15')](0x1f4,_0xbc9b('0x34')));}if(_['isNil'](_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x35')])){return _0x56fd5c(_0x480e21[_0xbc9b('0x15')](0x1f4,_0xbc9b('0x36')+_0x15a67a));}if(!_[_0xbc9b('0x37')](_0x15a67a,_0x20ada['body'][_0xbc9b('0x35')])){return _0x56fd5c(_0x480e21['error'](0x1f4,_0xbc9b('0x38')+_0x15a67a));}var _0xaa2739={};_0xaa2739[_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x35')]]=_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x32')];return db[_0xbc9b('0x1a')][_0xbc9b('0x39')]({'where':{'id':_0x20ada[_0xbc9b('0x3a')]['id']},'include':[{'model':db[_0xbc9b('0x3b')],'as':_0xbc9b('0x3c'),'include':[{'model':db[_0xbc9b('0x2c')],'as':_0xbc9b('0x3d'),'where':_0xaa2739,'limit':0x1,'order':[[_0xbc9b('0x2e'),'DESC']]}]},{'model':db[_0xbc9b('0x3e')],'as':'Applications'},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xbc9b('0x10')](function(_0x5ddd9d){if(_0x5ddd9d&&_0x5ddd9d[_0xbc9b('0x3c')]){var _0x2ab5ac=_0x5ddd9d[_0xbc9b('0x3f')]({'plain':!![]});_0x4c9186[_0xbc9b('0x3a')]=_[_0xbc9b('0x40')](_0x2ab5ac,[_0xbc9b('0x41'),_0xbc9b('0x3c')]);_0x4c9186['applications']=_0x2ab5ac['Applications'];_0x4c9186[_0xbc9b('0x42')]=_0x2ab5ac[_0xbc9b('0x3c')];_0x4c9186[_0xbc9b('0x43')]=_['orderBy'](_0x4c9186[_0xbc9b('0x43')],['priority'],[_0xbc9b('0x44')]);if(_0x4c9186['account']&&_0x4c9186[_0xbc9b('0x3a')][_0xbc9b('0x45')]){_0x4c9186[_0xbc9b('0x43')][_0xbc9b('0x46')]({'id':0x0,'priority':_0x4c9186[_0xbc9b('0x43')][_0xbc9b('0x47')]+0x1,'app':_0xbc9b('0x48'),'appdata':_0xbc9b('0x45'),'interval':_0xbc9b('0x49')});}if(_0x4c9186[_0xbc9b('0x3a')][_0xbc9b('0x41')]){delete _0x4c9186[_0xbc9b('0x3a')][_0xbc9b('0x41')];}if(_0x4c9186['account'][_0xbc9b('0x3c')]){delete _0x4c9186[_0xbc9b('0x3a')]['List'];}if(_0x2ab5ac[_0xbc9b('0x3c')][_0xbc9b('0x3d')][_0xbc9b('0x47')]){return _0x2ab5ac['List'][_0xbc9b('0x3d')][0x0];}var _0x4c2bb7=_[_0xbc9b('0xc')](_0x20ada['body'],{'firstName':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x32')],'ListId':_0x2ab5ac['ListId']});_0x4c2bb7[_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x35')]]=_0x20ada[_0xbc9b('0x28')]['from'];return db[_0xbc9b('0x2c')]['create'](_0x4c2bb7);}else{throw new Error('List\x20not\x20found');}})[_0xbc9b('0x10')](function(_0x44c17f){_0x4c9186[_0xbc9b('0x4a')]=_0x44c17f;if(_0x44c17f){if(!_0x20ada[_0xbc9b('0x28')]['message'][_0xbc9b('0x4b')]){_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')][_0xbc9b('0x4b')]=rs[_0xbc9b('0x4c')]()+'\x20'+_0x20ada['body'][_0xbc9b('0x17')][_0xbc9b('0x32')];}var _0x2cd0dc={'ContactId':_0x44c17f['id'],'MailAccountId':_0x20ada[_0xbc9b('0x3a')]['id'],'inReplyTo':_0x20ada['body'][_0xbc9b('0x17')]['messageId'],'to':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')]['from'],'cc':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')]['cc'],'subject':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')][_0xbc9b('0x4d')],'attach':_0x20ada[_0xbc9b('0x28')]['message'][_0xbc9b('0x4e')],'lastMsgAt':moment()[_0xbc9b('0x4f')](_0xbc9b('0x50')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x20ada[_0xbc9b('0x3a')]['id']},'include':[{'model':db[_0xbc9b('0x51')],'as':_0xbc9b('0x52'),'attributes':[_0xbc9b('0x4b')],'where':{'messageId':_0x20ada[_0xbc9b('0x28')]['message'][_0xbc9b('0x53')]}}]})[_0xbc9b('0x10')](function(_0xc5b348){if(_0xc5b348){return[_0xc5b348,![]];}return db[_0xbc9b('0x54')][_0xbc9b('0x55')](_0x2cd0dc)[_0xbc9b('0x10')](function(_0x28a722){return[_0x28a722,!![]];});});}else{throw new Error(_0xbc9b('0x56'));}})[_0xbc9b('0x57')](function(_0x59cee4,_0x5273f8){if(_0x59cee4){_0x19bce3=_0x5273f8;if(!_0x5273f8){return _0x59cee4[_0xbc9b('0x58')]({'inReplyTo':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')][_0xbc9b('0x4b')],'to':_0x20ada['body']['message'][_0xbc9b('0x32')],'cc':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')]['cc'],'subject':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')][_0xbc9b('0x4d')],'attach':_0x59cee4[_0xbc9b('0x4e')]?_0x59cee4[_0xbc9b('0x4e')]:_0x20ada[_0xbc9b('0x28')]['message'][_0xbc9b('0x4e')],'substatus':null,'substatusAt':moment()[_0xbc9b('0x4f')](_0xbc9b('0x50')),'lastMsgAt':moment()[_0xbc9b('0x4f')](_0xbc9b('0x50')),'lastMsgDirection':'in'});}else{return _0x59cee4;}}})['then'](function(_0x1d820f){_0x4c9186[_0xbc9b('0x59')]=_0x1d820f['get']({'plain':!![]});_0x4c9186[_0xbc9b('0x59')][_0xbc9b('0x5a')]=_0x19bce3;return db[_0xbc9b('0x51')][_0xbc9b('0x55')]({'body':_0x20ada[_0xbc9b('0x28')]['body'],'MailAccountId':_0x20ada[_0xbc9b('0x3a')]['id'],'MailInteractionId':_0x1d820f['id'],'direction':'in','ContactId':_0x4c9186[_0xbc9b('0x4a')]['id'],'messageId':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')][_0xbc9b('0x4b')],'from':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')][_0xbc9b('0x32')],'to':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')]['to'],'cc':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')]['cc'],'subject':_0x20ada[_0xbc9b('0x28')]['message'][_0xbc9b('0x4d')],'attach':_0x20ada[_0xbc9b('0x28')]['message'][_0xbc9b('0x4e')],'Attachments':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')][_0xbc9b('0x5b')],'originTo':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')]['originTo'],'originCc':_0x20ada['body'][_0xbc9b('0x17')][_0xbc9b('0x5c')],'bcc':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')]['bcc'],'ChatWebsiteId':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')][_0xbc9b('0x5d')]||null,'originChannel':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')]['originChannel']||'Email','ChatOfflineMessageId':_0x20ada[_0xbc9b('0x28')][_0xbc9b('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xbc9b('0x5e')],'as':_0xbc9b('0x5f')}]});})[_0xbc9b('0x10')](function(_0x5b576d){_0x4c9186[_0xbc9b('0x17')]=_0x5b576d;if(_0x4c9186[_0xbc9b('0x59')][_0xbc9b('0x60')]){return db[_0xbc9b('0x61')]['find']({'attributes':['id',_0xbc9b('0x62')],'where':{'id':_0x4c9186['interaction']['UserId']}})[_0xbc9b('0x10')](function(_0x4e9fb5){if(_0x4e9fb5){_0x4c9186[_0xbc9b('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4e9fb5[_0xbc9b('0x62')]+','+(_0x4c9186[_0xbc9b('0x3a')][_0xbc9b('0x63')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xbc9b('0x64'),_0xbc9b('0x65'),_0x4c9186);});}return respondWithRpcPromise('Start','startRouting',_0x4c9186);})[_0xbc9b('0x10')](function(_0x1cf49a){_0x5326f5(_0x1cf49a);})[_0xbc9b('0x19')](function(_0x5539b8){_0x56fd5c(_0x480e21[_0xbc9b('0x15')](0x1f4,_0x5539b8[_0xbc9b('0x17')]));});});}; \ No newline at end of file +var _0x3a6d=['ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','Applications','Smtp','get','account','list','applications','orderBy','priority','asc','close','autoclose','length','create','List\x20not\x20found','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','update','subject','interaction','created','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','User','name','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','rawAttributes','createdAt','CompanyId'];(function(_0x2adb04,_0x4d4356){var _0x3c1bca=function(_0x5e3b88){while(--_0x5e3b88){_0x2adb04['push'](_0x2adb04['shift']());}};_0x3c1bca(++_0x4d4356);}(_0x3a6d,0x1e9));var _0xd3a6=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3a6d[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require(_0xd3a6('0x2'));var BPromise=require(_0xd3a6('0x3'));var rs=require(_0xd3a6('0x4'));var fs=require('fs');var Redis=require(_0xd3a6('0x5'));var db=require(_0xd3a6('0x6'))['db'];var utils=require(_0xd3a6('0x7'));var logger=require(_0xd3a6('0x8'))(_0xd3a6('0x9'));var config=require(_0xd3a6('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xd3a6('0xb')][_0xd3a6('0xc')]({'port':0x232c});config[_0xd3a6('0xd')]=_[_0xd3a6('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd3a6('0xf'))(new Redis(config[_0xd3a6('0xd')]));require(_0xd3a6('0x10'))[_0xd3a6('0x11')](socket);function respondWithRpcPromise(_0x504b59,_0x597727,_0x382b05){return new BPromise(function(_0x1c0721,_0x48deec){return client[_0xd3a6('0x12')](_0x504b59,_0x382b05)['then'](function(_0x485c47){logger[_0xd3a6('0x13')](_0xd3a6('0x14'),_0x597727,_0xd3a6('0x15'));logger[_0xd3a6('0x16')](_0xd3a6('0x17'),_0x597727,_0xd3a6('0x15'),JSON[_0xd3a6('0x18')](_0x485c47));if(_0x485c47[_0xd3a6('0x19')]){if(_0x485c47[_0xd3a6('0x19')][_0xd3a6('0x1a')]===0x1f4){logger['error'](_0xd3a6('0x14'),_0x597727,_0x485c47['error'][_0xd3a6('0x1b')]);return _0x48deec(_0x485c47[_0xd3a6('0x19')][_0xd3a6('0x1b')]);}logger['error'](_0xd3a6('0x14'),_0x597727,_0x485c47['error'][_0xd3a6('0x1b')]);return _0x1c0721(_0x485c47['error'][_0xd3a6('0x1b')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x597727,'request\x20sent');_0x1c0721(_0x485c47[_0xd3a6('0x1c')]['message']);}})[_0xd3a6('0x1d')](function(_0xfad1bc){logger[_0xd3a6('0x19')](_0xd3a6('0x14'),_0x597727,_0xfad1bc);_0x48deec(_0xfad1bc);});});}exports[_0xd3a6('0x1e')]=function(_0x2e8d5e){var _0x39322a=this;return new Promise(function(_0x30c1b6,_0x10d4e1){return db[_0xd3a6('0x1f')][_0xd3a6('0x20')]({'raw':_0x2e8d5e[_0xd3a6('0x21')]?_0x2e8d5e['options'][_0xd3a6('0x22')]===undefined?!![]:![]:!![],'where':_0x2e8d5e[_0xd3a6('0x21')]?_0x2e8d5e['options'][_0xd3a6('0x23')]||null:null,'attributes':_0x2e8d5e[_0xd3a6('0x21')]?_0x2e8d5e[_0xd3a6('0x21')][_0xd3a6('0x24')]||null:null,'limit':_0x2e8d5e[_0xd3a6('0x21')]?_0x2e8d5e['options'][_0xd3a6('0x25')]||null:null,'include':_0x2e8d5e[_0xd3a6('0x21')]?_0x2e8d5e[_0xd3a6('0x21')][_0xd3a6('0x26')]?_[_0xd3a6('0x27')](_0x2e8d5e[_0xd3a6('0x21')][_0xd3a6('0x26')],function(_0x1bf644){return{'model':db[_0x1bf644[_0xd3a6('0x28')]],'as':_0x1bf644['as'],'attributes':_0x1bf644[_0xd3a6('0x24')],'include':_0x1bf644[_0xd3a6('0x26')]?_[_0xd3a6('0x27')](_0x1bf644['include'],function(_0x1df839){return{'model':db[_0x1df839['model']],'as':_0x1df839['as'],'attributes':_0x1df839['attributes'],'include':_0x1df839[_0xd3a6('0x26')]?_[_0xd3a6('0x27')](_0x1df839[_0xd3a6('0x26')],function(_0x5c7c26){return{'model':db[_0x5c7c26[_0xd3a6('0x28')]],'as':_0x5c7c26['as'],'attributes':_0x5c7c26[_0xd3a6('0x24')]};}):[]};}):[]};}):[]:[]})[_0xd3a6('0x29')](function(_0x4aab9c){logger['info'](_0xd3a6('0x1e'),_0x2e8d5e);logger[_0xd3a6('0x16')](_0xd3a6('0x1e'),_0x2e8d5e,JSON[_0xd3a6('0x18')](_0x4aab9c));_0x30c1b6(_0x4aab9c);})[_0xd3a6('0x1d')](function(_0x2790cc){logger['error']('GetMailAccount',_0x2790cc[_0xd3a6('0x1b')],_0x2e8d5e);_0x10d4e1(_0x39322a[_0xd3a6('0x19')](0x1f4,_0x2790cc['message']));});});};exports[_0xd3a6('0x2a')]=function(_0x461497){var _0x4c556c=this;return new Promise(function(_0x141f59,_0x330527){return db[_0xd3a6('0x1f')][_0xd3a6('0x2b')]({'raw':_0x461497[_0xd3a6('0x21')]?_0x461497[_0xd3a6('0x21')][_0xd3a6('0x22')]===undefined?!![]:![]:!![],'where':_0x461497['options']?_0x461497[_0xd3a6('0x21')][_0xd3a6('0x23')]||null:null,'attributes':_0x461497[_0xd3a6('0x21')]?_0x461497[_0xd3a6('0x21')][_0xd3a6('0x24')]||null:null,'include':_0x461497[_0xd3a6('0x21')]?_0x461497['options'][_0xd3a6('0x26')]?_['map'](_0x461497[_0xd3a6('0x21')][_0xd3a6('0x26')],function(_0x499764){return{'model':db[_0x499764[_0xd3a6('0x28')]],'as':_0x499764['as'],'attributes':_0x499764[_0xd3a6('0x24')],'include':_0x499764[_0xd3a6('0x26')]?_[_0xd3a6('0x27')](_0x499764[_0xd3a6('0x26')],function(_0x35232a){return{'model':db[_0x35232a[_0xd3a6('0x28')]],'as':_0x35232a['as'],'attributes':_0x35232a['attributes'],'include':_0x35232a[_0xd3a6('0x26')]?_[_0xd3a6('0x27')](_0x35232a['include'],function(_0x1a3305){return{'model':db[_0x1a3305[_0xd3a6('0x28')]],'as':_0x1a3305['as'],'attributes':_0x1a3305['attributes']};}):[]};}):[]};}):[]:[]})[_0xd3a6('0x29')](function(_0x43318d){logger[_0xd3a6('0x13')](_0xd3a6('0x2a'),_0x461497);logger[_0xd3a6('0x16')](_0xd3a6('0x2a'),_0x461497,JSON[_0xd3a6('0x18')](_0x43318d));_0x141f59(_0x43318d);})[_0xd3a6('0x1d')](function(_0x251373){logger['error'](_0xd3a6('0x2a'),_0x251373['message'],_0x461497);_0x330527(_0x4c556c[_0xd3a6('0x19')](0x1f4,_0x251373['message']));});});};exports[_0xd3a6('0x2c')]=function(_0x212711){var _0x1e4150=this;return new Promise(function(_0x2ca903,_0xbaefdd){var _0x5afc14={'body':_0x212711[_0xd3a6('0x2d')],'channel':_0xd3a6('0x2e')};var _0x3a7259=_[_0xd3a6('0x2f')](_['keys'](db['CmContact'][_0xd3a6('0x30')]),[_0xd3a6('0x31'),'updatedAt',_0xd3a6('0x32'),_0xd3a6('0x33')]);var _0x4969cf=![];if(_0x212711[_0xd3a6('0x2d')]['id']){delete _0x212711['body']['id'];}if(_['isNil'](_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x34')])){return _0xbaefdd(_0x1e4150[_0xd3a6('0x19')](0x1f4,_0xd3a6('0x35')));}if(_[_0xd3a6('0x36')](_0x212711['body'][_0xd3a6('0x2d')])||_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x2d')]===''){return _0xbaefdd(_0x1e4150[_0xd3a6('0x19')](0x1f4,_0xd3a6('0x37')));}if(_[_0xd3a6('0x36')](_0x212711['body'][_0xd3a6('0x38')])){return _0xbaefdd(_0x1e4150['error'](0x1f4,_0xd3a6('0x39')+_0x3a7259));}if(!_[_0xd3a6('0x3a')](_0x3a7259,_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x38')])){return _0xbaefdd(_0x1e4150[_0xd3a6('0x19')](0x1f4,_0xd3a6('0x3b')+_0x3a7259));}var _0x1a7d64={};_0x1a7d64[_0x212711['body'][_0xd3a6('0x38')]]=_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x34')];return db['MailAccount']['find']({'where':{'id':_0x212711['account']['id']},'include':[{'model':db[_0xd3a6('0x3c')],'as':_0xd3a6('0x3d'),'include':[{'model':db[_0xd3a6('0x3e')],'as':_0xd3a6('0x3f'),'where':_0x1a7d64,'limit':0x1,'order':[['updatedAt',_0xd3a6('0x40')]]}]},{'model':db['MailApplication'],'as':_0xd3a6('0x41')},{'model':db['MailServerOut'],'as':_0xd3a6('0x42')}]})[_0xd3a6('0x29')](function(_0x397c28){if(_0x397c28&&_0x397c28[_0xd3a6('0x3d')]){var _0x2aef86=_0x397c28[_0xd3a6('0x43')]({'plain':!![]});_0x5afc14[_0xd3a6('0x44')]=_['omit'](_0x2aef86,[_0xd3a6('0x41'),_0xd3a6('0x3d')]);_0x5afc14['applications']=_0x2aef86['Applications'];_0x5afc14[_0xd3a6('0x45')]=_0x2aef86[_0xd3a6('0x3d')];_0x5afc14[_0xd3a6('0x46')]=_[_0xd3a6('0x47')](_0x5afc14[_0xd3a6('0x46')],[_0xd3a6('0x48')],[_0xd3a6('0x49')]);if(_0x5afc14['account']&&_0x5afc14[_0xd3a6('0x44')]['autoclose']){_0x5afc14[_0xd3a6('0x46')]['push']({'id':0x0,'priority':_0x5afc14[_0xd3a6('0x46')]['length']+0x1,'app':_0xd3a6('0x4a'),'appdata':_0xd3a6('0x4b'),'interval':'*,*,*,*'});}if(_0x5afc14[_0xd3a6('0x44')][_0xd3a6('0x41')]){delete _0x5afc14['account']['Applications'];}if(_0x5afc14['account'][_0xd3a6('0x3d')]){delete _0x5afc14[_0xd3a6('0x44')][_0xd3a6('0x3d')];}if(_0x2aef86[_0xd3a6('0x3d')]['Contacts'][_0xd3a6('0x4c')]){return _0x2aef86[_0xd3a6('0x3d')][_0xd3a6('0x3f')][0x0];}var _0x101f09=_[_0xd3a6('0xe')](_0x212711[_0xd3a6('0x2d')],{'firstName':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x34')],'ListId':_0x2aef86['ListId']});_0x101f09[_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x38')]]=_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x34')];return db[_0xd3a6('0x3e')][_0xd3a6('0x4d')](_0x101f09);}else{throw new Error(_0xd3a6('0x4e'));}})[_0xd3a6('0x29')](function(_0x6b8c0c){_0x5afc14['contact']=_0x6b8c0c;if(_0x6b8c0c){if(!_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')][_0xd3a6('0x4f')]){_0x212711['body'][_0xd3a6('0x1b')][_0xd3a6('0x4f')]=rs[_0xd3a6('0x50')]()+'\x20'+_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')]['from'];}var _0x13be91={'ContactId':_0x6b8c0c['id'],'MailAccountId':_0x212711[_0xd3a6('0x44')]['id'],'inReplyTo':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')]['messageId'],'to':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')]['from'],'cc':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')]['cc'],'subject':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')]['subject'],'attach':_0x212711['body'][_0xd3a6('0x1b')][_0xd3a6('0x51')],'lastMsgAt':moment()[_0xd3a6('0x52')](_0xd3a6('0x53')),'lastMsgDirection':'in'};return db[_0xd3a6('0x54')][_0xd3a6('0x2b')]({'where':{'closed':![],'MailAccountId':_0x212711[_0xd3a6('0x44')]['id']},'include':[{'model':db[_0xd3a6('0x55')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x212711['body'][_0xd3a6('0x1b')][_0xd3a6('0x56')]}}]})[_0xd3a6('0x29')](function(_0x1efd03){if(_0x1efd03){return[_0x1efd03,![]];}return db[_0xd3a6('0x54')][_0xd3a6('0x4d')](_0x13be91)['then'](function(_0x4f6cd4){return[_0x4f6cd4,!![]];});});}else{throw new Error(_0xd3a6('0x57'));}})['spread'](function(_0x361c5e,_0x2055b0){if(_0x361c5e){_0x4969cf=_0x2055b0;if(!_0x2055b0){return _0x361c5e[_0xd3a6('0x58')]({'inReplyTo':_0x212711[_0xd3a6('0x2d')]['message'][_0xd3a6('0x4f')],'to':_0x212711['body'][_0xd3a6('0x1b')][_0xd3a6('0x34')],'cc':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')]['cc'],'subject':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')][_0xd3a6('0x59')],'attach':_0x361c5e[_0xd3a6('0x51')]?_0x361c5e[_0xd3a6('0x51')]:_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')][_0xd3a6('0x51')],'substatus':null,'substatusAt':moment()[_0xd3a6('0x52')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xd3a6('0x52')](_0xd3a6('0x53')),'lastMsgDirection':'in'});}else{return _0x361c5e;}}})['then'](function(_0x2696f1){_0x5afc14[_0xd3a6('0x5a')]=_0x2696f1['get']({'plain':!![]});_0x5afc14[_0xd3a6('0x5a')][_0xd3a6('0x5b')]=_0x4969cf;return db[_0xd3a6('0x55')][_0xd3a6('0x4d')]({'body':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x2d')],'MailAccountId':_0x212711[_0xd3a6('0x44')]['id'],'MailInteractionId':_0x2696f1['id'],'direction':'in','ContactId':_0x5afc14['contact']['id'],'messageId':_0x212711[_0xd3a6('0x2d')]['message'][_0xd3a6('0x4f')],'from':_0x212711['body']['message'][_0xd3a6('0x34')],'to':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')]['to'],'cc':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')]['cc'],'subject':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')][_0xd3a6('0x59')],'attach':_0x212711['body']['message']['attach'],'Attachments':_0x212711[_0xd3a6('0x2d')]['message']['attachments'],'originTo':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')][_0xd3a6('0x5c')],'originCc':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')][_0xd3a6('0x5d')],'bcc':_0x212711[_0xd3a6('0x2d')]['message'][_0xd3a6('0x5e')],'ChatWebsiteId':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')][_0xd3a6('0x5f')]||null,'originChannel':_0x212711[_0xd3a6('0x2d')][_0xd3a6('0x1b')][_0xd3a6('0x60')]||_0xd3a6('0x61'),'ChatOfflineMessageId':_0x212711['body']['message'][_0xd3a6('0x62')]||null},{'include':[{'model':db[_0xd3a6('0x63')],'as':_0xd3a6('0x64')}]});})[_0xd3a6('0x29')](function(_0x4c97a4){_0x5afc14[_0xd3a6('0x1b')]=_0x4c97a4;if(_0x5afc14[_0xd3a6('0x5a')]['UserId']){return db[_0xd3a6('0x65')][_0xd3a6('0x2b')]({'attributes':['id',_0xd3a6('0x66')],'where':{'id':_0x5afc14[_0xd3a6('0x5a')]['UserId']}})['then'](function(_0xf7a604){if(_0xf7a604){_0x5afc14[_0xd3a6('0x46')][_0xd3a6('0x67')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xf7a604[_0xd3a6('0x66')]+','+(_0x5afc14[_0xd3a6('0x44')][_0xd3a6('0x68')]||0xa),'interval':_0xd3a6('0x69')});}return respondWithRpcPromise(_0xd3a6('0x6a'),_0xd3a6('0x6b'),_0x5afc14);});}return respondWithRpcPromise(_0xd3a6('0x6a'),_0xd3a6('0x6b'),_0x5afc14);})[_0xd3a6('0x29')](function(_0x2189a3){_0x2ca903(_0x2189a3);})[_0xd3a6('0x1d')](function(_0x32f9ea){_0xbaefdd(_0x1e4150[_0xd3a6('0x19')](0x1f4,_0x32f9ea[_0xd3a6('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index b682f28..cdd9f62 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 _0xaea8=['removeListener','register','length','save','update','emit'];(function(_0x7fa1a9,_0x2ff649){var _0x43c671=function(_0x7e9c81){while(--_0x7e9c81){_0x7fa1a9['push'](_0x7fa1a9['shift']());}};_0x43c671(++_0x2ff649);}(_0xaea8,0x1d1));var _0x8aea=function(_0x5e1e4b,_0x49e0a0){_0x5e1e4b=_0x5e1e4b-0x0;var _0x1526b1=_0xaea8[_0x5e1e4b];return _0x1526b1;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x8aea('0x0'),'remove',_0x8aea('0x1')];function createListener(_0x49c84e,_0xae30d9){return function(_0x1b4da7){_0xae30d9[_0x8aea('0x2')](_0x49c84e,_0x1b4da7);};}function removeListener(_0x3f3b8e,_0x16bc00){return function(){MailAccountEvents[_0x8aea('0x3')](_0x3f3b8e,_0x16bc00);};}exports[_0x8aea('0x4')]=function(_0x594002){for(var _0x1ff892=0x0,_0x2d5edd=events[_0x8aea('0x5')];_0x1ff892<_0x2d5edd;_0x1ff892++){var _0x2d2da9=events[_0x1ff892];var _0x2a5cf9=createListener('mailAccount:'+_0x2d2da9,_0x594002);MailAccountEvents['on'](_0x2d2da9,_0x2a5cf9);}}; \ No newline at end of file +var _0xb033=['save','remove','update','emit','removeListener','register','length','./mailAccount.events'];(function(_0x483909,_0x37a61d){var _0x2595df=function(_0x45a5fb){while(--_0x45a5fb){_0x483909['push'](_0x483909['shift']());}};_0x2595df(++_0x37a61d);}(_0xb033,0x9f));var _0x3b03=function(_0x1acb75,_0x4cfb8f){_0x1acb75=_0x1acb75-0x0;var _0xdba49=_0xb033[_0x1acb75];return _0xdba49;};'use strict';var MailAccountEvents=require(_0x3b03('0x0'));var events=[_0x3b03('0x1'),_0x3b03('0x2'),_0x3b03('0x3')];function createListener(_0x3ce571,_0x24bc18){return function(_0x9d8205){_0x24bc18[_0x3b03('0x4')](_0x3ce571,_0x9d8205);};}function removeListener(_0x11f4ce,_0x4555b5){return function(){MailAccountEvents[_0x3b03('0x5')](_0x11f4ce,_0x4555b5);};}exports[_0x3b03('0x6')]=function(_0x2ac9c8){for(var _0x50dbe6=0x0,_0x320f0a=events[_0x3b03('0x7')];_0x50dbe6<_0x320f0a;_0x50dbe6++){var _0x534948=events[_0x50dbe6];var _0x345aee=createListener('mailAccount:'+_0x534948,_0x2ac9c8);MailAccountEvents['on'](_0x534948,_0x345aee);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index d718863..d95868d 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 _0x9bd9=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','show','update','isAuthenticated','exports','multer','util'];(function(_0x32fba5,_0x187eff){var _0x10f1b0=function(_0x49e708){while(--_0x49e708){_0x32fba5['push'](_0x32fba5['shift']());}};_0x10f1b0(++_0x187eff);}(_0x9bd9,0x1c0));var _0x99bd=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0x9bd9[_0x532d78];return _0x5990c4;};'use strict';var multer=require(_0x99bd('0x0'));var util=require(_0x99bd('0x1'));var path=require(_0x99bd('0x2'));var timeout=require(_0x99bd('0x3'));var express=require(_0x99bd('0x4'));var router=express[_0x99bd('0x5')]();var fs_extra=require(_0x99bd('0x6'));var auth=require(_0x99bd('0x7'));var interaction=require(_0x99bd('0x8'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0x99bd('0x9')](_0x99bd('0xa'),auth['isAuthenticated'](),controller[_0x99bd('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x99bd('0xc')]);router['delete'](_0x99bd('0xa'),auth[_0x99bd('0xd')](),controller['destroy']);module[_0x99bd('0xe')]=router; \ No newline at end of file +var _0x9ff2=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','update','destroy','multer','util'];(function(_0x4bca06,_0x181cee){var _0x3e291d=function(_0xaa7638){while(--_0xaa7638){_0x4bca06['push'](_0x4bca06['shift']());}};_0x3e291d(++_0x181cee);}(_0x9ff2,0xd0));var _0x29ff=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x9ff2[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x29ff('0x0'));var util=require(_0x29ff('0x1'));var path=require(_0x29ff('0x2'));var timeout=require(_0x29ff('0x3'));var express=require(_0x29ff('0x4'));var router=express[_0x29ff('0x5')]();var fs_extra=require(_0x29ff('0x6'));var auth=require(_0x29ff('0x7'));var interaction=require(_0x29ff('0x8'));var config=require(_0x29ff('0x9'));var controller=require(_0x29ff('0xa'));router['get'](_0x29ff('0xb'),auth[_0x29ff('0xc')](),controller['show']);router['put'](_0x29ff('0xb'),auth[_0x29ff('0xc')](),controller[_0x29ff('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x29ff('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 1fdfb5f..9c4ee46 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 _0x94d1=['TEXT','STRING','*,*,*,*','sequelize'];(function(_0x243769,_0x328b9d){var _0x242d2b=function(_0x432b5e){while(--_0x432b5e){_0x243769['push'](_0x243769['shift']());}};_0x242d2b(++_0x328b9d);}(_0x94d1,0x7f));var _0x194d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94d1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x194d('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x194d('0x1')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x194d('0x2')],'defaultValue':_0x194d('0x3')}}; \ No newline at end of file +var _0x9222=['INTEGER','noop','TEXT','*,*,*,*','sequelize'];(function(_0x2a2fc8,_0x2b2af8){var _0x321184=function(_0x40f865){while(--_0x40f865){_0x2a2fc8['push'](_0x2a2fc8['shift']());}};_0x321184(++_0x2b2af8);}(_0x9222,0x144));var _0x2922=function(_0x1291f8,_0xf7fdf6){_0x1291f8=_0x1291f8-0x0;var _0x5cd122=_0x9222[_0x1291f8];return _0x5cd122;};'use strict';var Sequelize=require(_0x2922('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2922('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2922('0x2')},'appdata':{'type':Sequelize[_0x2922('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2922('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 6b20c92..c70e545 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 _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x521e7e,_0x41a6c4){var _0x3b1da4=function(_0x21940a){while(--_0x21940a){_0x521e7e['push'](_0x521e7e['shift']());}};_0x3b1da4(++_0x41a6c4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file +var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x5055ef,_0x365395){var _0x37fac3=function(_0x143a52){while(--_0x143a52){_0x5055ef['push'](_0x5055ef['shift']());}};_0x37fac3(++_0x365395);}(_0xac4a,0x13f));var _0xaac4=function(_0x2ee818,_0x2bd04f){_0x2ee818=_0x2ee818-0x0;var _0x5e1d3c=_0xac4a[_0x2ee818];return _0x5e1d3c;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index b6b6475..e7a9fab 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 _0x3716=['../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x572b5d,_0x517b9e){var _0x31a9f8=function(_0x45ee7c){while(--_0x45ee7c){_0x572b5d['push'](_0x572b5d['shift']());}};_0x31a9f8(++_0x517b9e);}(_0x3716,0x78));var _0x6371=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0x3716[_0x36bfe3];return _0x9b0436;};'use strict';var _=require(_0x6371('0x0'));var util=require(_0x6371('0x1'));var logger=require(_0x6371('0x2'))(_0x6371('0x3'));var moment=require(_0x6371('0x4'));var BPromise=require(_0x6371('0x5'));var rp=require(_0x6371('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6371('0x7'));var config=require(_0x6371('0x8'));var attributes=require(_0x6371('0x9'));module[_0x6371('0xa')]=function(_0x263e1b,_0x7281da){return _0x263e1b[_0x6371('0xb')](_0x6371('0xc'),attributes,{'tableName':_0x6371('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6371('0xe'),'collate':_0x6371('0xf')});}; \ No newline at end of file +var _0xd8c0=['../../config/environment','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x403c57,_0x280a51){var _0x35fa69=function(_0x13a356){while(--_0x13a356){_0x403c57['push'](_0x403c57['shift']());}};_0x35fa69(++_0x280a51);}(_0xd8c0,0x17a));var _0x0d8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd8c0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0d8c('0x0'));var util=require('util');var logger=require(_0x0d8c('0x1'))(_0x0d8c('0x2'));var moment=require(_0x0d8c('0x3'));var BPromise=require(_0x0d8c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d8c('0x5'));var rimraf=require('rimraf');var config=require(_0x0d8c('0x6'));var attributes=require('./mailApplication.attributes');module[_0x0d8c('0x7')]=function(_0x2c92a0,_0x3bccbf){return _0x2c92a0['define'](_0x0d8c('0x8'),attributes,{'tableName':_0x0d8c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0d8c('0xa'),'collate':_0x0d8c('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index b78fb58..18e48d5 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 _0x25bf=['stringify','error','code','message','info','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s'];(function(_0x3f51cb,_0x3fec7b){var _0x34d837=function(_0x1f4fa1){while(--_0x1f4fa1){_0x3f51cb['push'](_0x3f51cb['shift']());}};_0x34d837(++_0x3fec7b);}(_0x25bf,0xce));var _0xf25b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x25bf[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf25b('0x0'));var util=require(_0xf25b('0x1'));var moment=require(_0xf25b('0x2'));var BPromise=require(_0xf25b('0x3'));var rs=require(_0xf25b('0x4'));var fs=require('fs');var Redis=require(_0xf25b('0x5'));var db=require(_0xf25b('0x6'))['db'];var utils=require(_0xf25b('0x7'));var logger=require('../../config/logger')(_0xf25b('0x8'));var config=require(_0xf25b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf25b('0xa')][_0xf25b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f5fec,_0x1bb65b,_0x3f3d3d){return new BPromise(function(_0x1f0450,_0x34b86a){return client[_0xf25b('0xc')](_0x2f5fec,_0x3f3d3d)[_0xf25b('0xd')](function(_0x395bc4){logger['info'](_0xf25b('0xe'),_0x1bb65b,_0xf25b('0xf'));logger[_0xf25b('0x10')](_0xf25b('0x11'),_0x1bb65b,_0xf25b('0xf'),JSON[_0xf25b('0x12')](_0x395bc4));if(_0x395bc4[_0xf25b('0x13')]){if(_0x395bc4[_0xf25b('0x13')][_0xf25b('0x14')]===0x1f4){logger[_0xf25b('0x13')](_0xf25b('0xe'),_0x1bb65b,_0x395bc4[_0xf25b('0x13')]['message']);return _0x34b86a(_0x395bc4[_0xf25b('0x13')]['message']);}logger[_0xf25b('0x13')](_0xf25b('0xe'),_0x1bb65b,_0x395bc4['error'][_0xf25b('0x15')]);return _0x1f0450(_0x395bc4[_0xf25b('0x13')]['message']);}else{logger[_0xf25b('0x16')]('MailApplication,\x20%s,\x20%s',_0x1bb65b,'request\x20sent');_0x1f0450(_0x395bc4[_0xf25b('0x17')]['message']);}})[_0xf25b('0x18')](function(_0x572a23){logger['error'](_0xf25b('0xe'),_0x1bb65b,_0x572a23);_0x34b86a(_0x572a23);});});}exports[_0xf25b('0x19')]=function(_0x5e2138){var _0x14adb3=this;return new Promise(function(_0x5b7529,_0x1495f8){return db[_0xf25b('0x1a')][_0xf25b('0x1b')](_0x5e2138[_0xf25b('0x1c')],{'raw':_0x5e2138[_0xf25b('0x1d')]?_0x5e2138[_0xf25b('0x1d')][_0xf25b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e2138[_0xf25b('0x1d')]?_0x5e2138[_0xf25b('0x1d')]['where']||null:null,'attributes':_0x5e2138[_0xf25b('0x1d')]?_0x5e2138[_0xf25b('0x1d')]['attributes']||null:null,'limit':_0x5e2138[_0xf25b('0x1d')]?_0x5e2138[_0xf25b('0x1d')][_0xf25b('0x1f')]||null:null})[_0xf25b('0xd')](function(_0xdaa5d){logger['info']('UpdateMailApplication',_0x5e2138);logger[_0xf25b('0x10')](_0xf25b('0x19'),_0x5e2138,JSON[_0xf25b('0x12')](_0xdaa5d));_0x5b7529(_0xdaa5d);})[_0xf25b('0x18')](function(_0x4b3540){logger[_0xf25b('0x13')](_0xf25b('0x19'),_0x4b3540['message'],_0x5e2138);_0x1495f8(_0x14adb3[_0xf25b('0x13')](0x1f4,_0x4b3540['message']));});});}; \ No newline at end of file +var _0xbcc2=['error','code','message','request\x20sent','result','catch','UpdateMailApplication','body','options','where','attributes','stringify','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s'];(function(_0x336264,_0x32e1d9){var _0x53cf91=function(_0x21026c){while(--_0x21026c){_0x336264['push'](_0x336264['shift']());}};_0x53cf91(++_0x32e1d9);}(_0xbcc2,0x93));var _0x2bcc=function(_0x54813d,_0x101c1f){_0x54813d=_0x54813d-0x0;var _0x561eea=_0xbcc2[_0x54813d];return _0x561eea;};'use strict';var _=require(_0x2bcc('0x0'));var util=require('util');var moment=require(_0x2bcc('0x1'));var BPromise=require('bluebird');var rs=require(_0x2bcc('0x2'));var fs=require('fs');var Redis=require(_0x2bcc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2bcc('0x4'))(_0x2bcc('0x5'));var config=require(_0x2bcc('0x6'));var jayson=require(_0x2bcc('0x7'));var client=jayson['client'][_0x2bcc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x281d82,_0x1eef23,_0x3e2446){return new BPromise(function(_0x31af6a,_0x5e14eb){return client[_0x2bcc('0x9')](_0x281d82,_0x3e2446)[_0x2bcc('0xa')](function(_0x1b5f75){logger[_0x2bcc('0xb')](_0x2bcc('0xc'),_0x1eef23,'request\x20sent');logger[_0x2bcc('0xd')](_0x2bcc('0xe'),_0x1eef23,'request\x20sent',JSON['stringify'](_0x1b5f75));if(_0x1b5f75[_0x2bcc('0xf')]){if(_0x1b5f75[_0x2bcc('0xf')][_0x2bcc('0x10')]===0x1f4){logger['error'](_0x2bcc('0xc'),_0x1eef23,_0x1b5f75['error'][_0x2bcc('0x11')]);return _0x5e14eb(_0x1b5f75[_0x2bcc('0xf')][_0x2bcc('0x11')]);}logger[_0x2bcc('0xf')]('MailApplication,\x20%s,\x20%s',_0x1eef23,_0x1b5f75['error'][_0x2bcc('0x11')]);return _0x31af6a(_0x1b5f75[_0x2bcc('0xf')]['message']);}else{logger[_0x2bcc('0xb')](_0x2bcc('0xc'),_0x1eef23,_0x2bcc('0x12'));_0x31af6a(_0x1b5f75[_0x2bcc('0x13')][_0x2bcc('0x11')]);}})[_0x2bcc('0x14')](function(_0x5378c9){logger[_0x2bcc('0xf')](_0x2bcc('0xc'),_0x1eef23,_0x5378c9);_0x5e14eb(_0x5378c9);});});}exports[_0x2bcc('0x15')]=function(_0x5f6a59){var _0x2b4f73=this;return new Promise(function(_0x5dc187,_0x4aa7f5){return db['MailApplication']['update'](_0x5f6a59[_0x2bcc('0x16')],{'raw':_0x5f6a59[_0x2bcc('0x17')]?_0x5f6a59[_0x2bcc('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f6a59[_0x2bcc('0x17')]?_0x5f6a59[_0x2bcc('0x17')][_0x2bcc('0x18')]||null:null,'attributes':_0x5f6a59[_0x2bcc('0x17')]?_0x5f6a59[_0x2bcc('0x17')][_0x2bcc('0x19')]||null:null,'limit':_0x5f6a59[_0x2bcc('0x17')]?_0x5f6a59[_0x2bcc('0x17')]['limit']||null:null})[_0x2bcc('0xa')](function(_0x30bc5b){logger[_0x2bcc('0xb')](_0x2bcc('0x15'),_0x5f6a59);logger['debug']('UpdateMailApplication',_0x5f6a59,JSON[_0x2bcc('0x1a')](_0x30bc5b));_0x5dc187(_0x30bc5b);})[_0x2bcc('0x14')](function(_0x267937){logger[_0x2bcc('0xf')](_0x2bcc('0x15'),_0x267937['message'],_0x5f6a59);_0x4aa7f5(_0x2b4f73['error'](0x1f4,_0x267937['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index e4cf8ed..f175952 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 _0xe833=['/:id','show','/:id/messages','download','post','addMessage','tracked','mail','addTags','mailinteraction:update','delete','mailinteraction:destroy','/:id/tags','removeTags','exports','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','describe'];(function(_0x4d893a,_0x49fc97){var _0x2fd178=function(_0x3383cf){while(--_0x3383cf){_0x4d893a['push'](_0x4d893a['shift']());}};_0x2fd178(++_0x49fc97);}(_0xe833,0x1f2));var _0x3e83=function(_0x180d85,_0x22d8ac){_0x180d85=_0x180d85-0x0;var _0x11a6a2=_0xe833[_0x180d85];return _0x11a6a2;};'use strict';var express=require('express');var router=express[_0x3e83('0x0')]();var auth=require(_0x3e83('0x1'));var interaction=require('../../components/interaction/service');var controller=require(_0x3e83('0x2'));router[_0x3e83('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3e83('0x3')]('/describe',auth[_0x3e83('0x4')](),controller[_0x3e83('0x5')]);router[_0x3e83('0x3')](_0x3e83('0x6'),auth[_0x3e83('0x4')](),controller[_0x3e83('0x7')]);router[_0x3e83('0x3')](_0x3e83('0x8'),auth[_0x3e83('0x4')](),controller['getMessages']);router[_0x3e83('0x3')]('/:id/download',auth[_0x3e83('0x4')](),controller[_0x3e83('0x9')]);router[_0x3e83('0xa')]('/',auth[_0x3e83('0x4')](),controller['create']);router['post'](_0x3e83('0x8'),auth['isAuthenticated'](),controller[_0x3e83('0xb')]);router[_0x3e83('0xa')]('/:id/tags',auth[_0x3e83('0x4')](),interaction[_0x3e83('0xc')](_0x3e83('0xd'),'mailinteraction:addtags'),controller[_0x3e83('0xe')]);router['put'](_0x3e83('0x6'),auth[_0x3e83('0x4')](),interaction['tracked'](_0x3e83('0xd'),_0x3e83('0xf')),controller['update']);router[_0x3e83('0x10')](_0x3e83('0x6'),auth['isAuthenticated'](),interaction['tracked'](_0x3e83('0xd'),_0x3e83('0x11')),controller['destroy']);router['delete'](_0x3e83('0x12'),auth[_0x3e83('0x4')](),controller[_0x3e83('0x13')]);module[_0x3e83('0x14')]=router; \ No newline at end of file +var _0x9592=['../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','addTags','put','mailinteraction:update','mailinteraction:destroy','destroy','delete','exports','express','Router'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x9592,0x127));var _0x2959=function(_0x42b7ab,_0x50af64){_0x42b7ab=_0x42b7ab-0x0;var _0x4ce843=_0x9592[_0x42b7ab];return _0x4ce843;};'use strict';var express=require(_0x2959('0x0'));var router=express[_0x2959('0x1')]();var auth=require(_0x2959('0x2'));var interaction=require(_0x2959('0x3'));var controller=require(_0x2959('0x4'));router[_0x2959('0x5')]('/',auth[_0x2959('0x6')](),controller[_0x2959('0x7')]);router[_0x2959('0x5')](_0x2959('0x8'),auth[_0x2959('0x6')](),controller[_0x2959('0x9')]);router[_0x2959('0x5')](_0x2959('0xa'),auth[_0x2959('0x6')](),controller['show']);router[_0x2959('0x5')](_0x2959('0xb'),auth[_0x2959('0x6')](),controller['getMessages']);router[_0x2959('0x5')](_0x2959('0xc'),auth[_0x2959('0x6')](),controller[_0x2959('0xd')]);router[_0x2959('0xe')]('/',auth[_0x2959('0x6')](),controller[_0x2959('0xf')]);router['post'](_0x2959('0xb'),auth[_0x2959('0x6')](),controller[_0x2959('0x10')]);router[_0x2959('0xe')](_0x2959('0x11'),auth[_0x2959('0x6')](),interaction[_0x2959('0x12')](_0x2959('0x13'),'mailinteraction:addtags'),controller[_0x2959('0x14')]);router[_0x2959('0x15')]('/:id',auth[_0x2959('0x6')](),interaction[_0x2959('0x12')](_0x2959('0x13'),_0x2959('0x16')),controller['update']);router['delete'](_0x2959('0xa'),auth['isAuthenticated'](),interaction[_0x2959('0x12')](_0x2959('0x13'),_0x2959('0x17')),controller[_0x2959('0x18')]);router[_0x2959('0x19')](_0x2959('0x11'),auth[_0x2959('0x6')](),controller['removeTags']);module[_0x2959('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 d133698..9cc3a21 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 _0x0a2a=['sequelize','iconv','exports','BOOLEAN','STRING','TEXT','long','DATE','ENUM','out'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0x0a2a,0x186));var _0xa0a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a2a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa0a2('0x0'));var iconv=require(_0xa0a2('0x1'));module[_0xa0a2('0x2')]={'closed':{'type':Sequelize[_0xa0a2('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa0a2('0x4')]},'thirdDisposition':{'type':Sequelize[_0xa0a2('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xa0a2('0x4')](0x1fe)},'to':{'type':Sequelize[_0xa0a2('0x4')]},'cc':{'type':Sequelize[_0xa0a2('0x5')](_0xa0a2('0x6'))},'subject':{'type':Sequelize[_0xa0a2('0x5')]()},'attach':{'type':Sequelize[_0xa0a2('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xa0a2('0x7')]},'firstMsgDirection':{'type':Sequelize[_0xa0a2('0x8')]('in',_0xa0a2('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa0a2('0x8')]('in',_0xa0a2('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa0a2('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x3dd1=['TEXT','long','out','ENUM','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x7dd16a,_0x3dbf26){var _0x12ce84=function(_0x3d581d){while(--_0x3d581d){_0x7dd16a['push'](_0x7dd16a['shift']());}};_0x12ce84(++_0x3dbf26);}(_0x3dd1,0x112));var _0x13dd=function(_0x3a2877,_0x3be85e){_0x3a2877=_0x3a2877-0x0;var _0x2c7f78=_0x3dd1[_0x3a2877];return _0x2c7f78;};'use strict';var Sequelize=require(_0x13dd('0x0'));var iconv=require(_0x13dd('0x1'));module[_0x13dd('0x2')]={'closed':{'type':Sequelize[_0x13dd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x13dd('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x13dd('0x5')]},'thirdDisposition':{'type':Sequelize[_0x13dd('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x13dd('0x6')](_0x13dd('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x13dd('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x13dd('0x4')]},'substatus':{'type':Sequelize[_0x13dd('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x13dd('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x13dd('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x13dd('0x9')]('in',_0x13dd('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x13dd('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 369092d..ba0d490 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 _0x6075=['UserId','closed','talking','index','MailInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','field','color','tools_tags','select','u.id','u.fullname','left_join','users','from','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','text','start','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','c.email\x20LIKE\x20?','getFullTextValue','group','Sequelize','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','enableEmailPreview','all','params','includeAll','include','merge','options','create','body','describe','addMessage','omit','ids','getMessages','nolimit','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','addTags','setTags','spread','mailInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','format','Attachment','Attachments','Messages','subject','mkdirSync','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','squel','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','answered','unmanaged','total'];(function(_0x1d5602,_0x17e78e){var _0x2ae01=function(_0x502bbf){while(--_0x502bbf){_0x1d5602['push'](_0x1d5602['shift']());}};_0x2ae01(++_0x17e78e);}(_0x6075,0x191));var _0x5607=function(_0x2cc4cd,_0x3356c7){_0x2cc4cd=_0x2cc4cd-0x0;var _0x1c1f19=_0x6075[_0x2cc4cd];return _0x1c1f19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5607('0x0'));var zipdir=require(_0x5607('0x1'));var moment=require(_0x5607('0x2'));var BPromise=require(_0x5607('0x3'));var util=require(_0x5607('0x4'));var path=require(_0x5607('0x5'));var fs=require('fs');var _=require(_0x5607('0x6'));var squel=require(_0x5607('0x7'));var juice=require(_0x5607('0x8'));var Redis=require('ioredis');var qs=require(_0x5607('0x9'));var as=require(_0x5607('0xa'));var logger=require(_0x5607('0xb'))('api');var config=require('../../config/environment');var db=require(_0x5607('0xc'))['db'];var htmlEntities=require(_0x5607('0xd'));config[_0x5607('0xe')]=_[_0x5607('0xf')](config[_0x5607('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x5607('0x10'))(new Redis(config[_0x5607('0xe')]));require(_0x5607('0x11'))['register'](socket);function respondWithStatusCode(_0x6e62a0,_0x51b2a1){_0x51b2a1=_0x51b2a1||0xcc;return function(_0x49626b){if(_0x49626b){return _0x6e62a0[_0x5607('0x12')](_0x51b2a1);}return _0x6e62a0[_0x5607('0x13')](_0x51b2a1)[_0x5607('0x14')]();};}function respondWithResult(_0x5225fc,_0x2c8013){_0x2c8013=_0x2c8013||0xc8;return function(_0x42a405){if(_0x42a405){return _0x5225fc[_0x5607('0x13')](_0x2c8013)[_0x5607('0x15')](_0x42a405);}};}function respondWithFilteredResult(_0xe6368d,_0x33c436){return function(_0x138d74){if(_0x138d74){var _0x1c8cbc=typeof _0x33c436[_0x5607('0x16')]==='undefined'&&typeof _0x33c436[_0x5607('0x17')]===_0x5607('0x18');var _0xe3e004=_0x138d74['count'];var _0x556397=_0x1c8cbc?0x0:_0x33c436[_0x5607('0x16')];var _0x50e498=_0x1c8cbc?_0x138d74[_0x5607('0x19')]:_0x33c436[_0x5607('0x16')]+_0x33c436[_0x5607('0x17')];var _0x1375e9;if(_0x50e498>=_0xe3e004){_0x50e498=_0xe3e004;_0x1375e9=0xc8;}else{_0x1375e9=0xce;}_0xe6368d[_0x5607('0x13')](_0x1375e9);return _0xe6368d[_0x5607('0x1a')]('Content-Range',_0x556397+'-'+_0x50e498+'/'+_0xe3e004)[_0x5607('0x15')](_0x138d74);}return null;};}function saveUpdates(_0x50bd2c){return function(_0x180775){if(_0x180775){return _0x180775[_0x5607('0x1b')](_0x50bd2c)[_0x5607('0x1c')](function(_0x5f080d){return _0x5f080d;});}return null;};}function removeEntity(_0xffa25d){return function(_0x6e4868){if(_0x6e4868){return _0x6e4868[_0x5607('0x1d')]()['then'](function(){_0xffa25d[_0x5607('0x13')](0xcc)[_0x5607('0x14')]();});}};}function handleEntityNotFound(_0x22fda4){return function(_0x491046){if(!_0x491046){_0x22fda4[_0x5607('0x12')](0x194);}return _0x491046;};}function handleError(_0x4feb1c,_0x49f918){_0x49f918=_0x49f918||0x1f4;return function(_0x39a9f4){logger[_0x5607('0x1e')](_0x39a9f4[_0x5607('0x1f')]);if(_0x39a9f4[_0x5607('0x20')]){delete _0x39a9f4[_0x5607('0x20')];}_0x4feb1c[_0x5607('0x13')](_0x49f918)[_0x5607('0x21')](_0x39a9f4);};}function getInteractionUsers(_0x20918c,_0x8a7592){return new BPromise(function(_0x42a1af,_0x593df7){try{if(_0x8a7592[_0x20918c['id']]){_0x20918c[_0x5607('0x22')]=_[_0x5607('0x23')](_0x8a7592[_0x20918c['id']],function(_0x482842){return{'id':_0x482842['id'],'fullname':_0x482842[_0x5607('0x24')]};});}}catch(_0x14dd08){_0x593df7(_0x14dd08);}_0x42a1af(_0x20918c);});}function getInteractionTags(_0xdb07c8,_0x400827){return new BPromise(function(_0x447042,_0x34642e){try{if(_0xdb07c8[_0x5607('0x25')]){_0xdb07c8[_0x5607('0x26')]=[];_0xdb07c8['TagIds'][_0x5607('0x27')](',')[_0x5607('0x28')](function(_0x51b7d5){_0xdb07c8['Tags'][_0x5607('0x29')](_0x400827[_0x51b7d5]);});}delete _0xdb07c8[_0x5607('0x25')];}catch(_0xe8788){_0x34642e(_0xe8788);}_0x447042(_0xdb07c8);});}function getLastMessageText(_0x16bb98){return new BPromise(function(_0x2c3078,_0x536071){return db[_0x5607('0x2a')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x16bb98['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x5607('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x5607('0x2c')],'order':_0x5607('0x2d'),'raw':!![]})['then'](function(_0x326c51){if(_0x326c51&&_0x326c51['plainBody']){_0x16bb98[_0x5607('0x2e')]=_[_0x5607('0x2f')](_0x326c51[_0x5607('0x2c')]);}_0x2c3078(_0x16bb98);})[_0x5607('0x30')](function(_0x31afed){_0x536071(_0x31afed);});});}function updateMailInteraction(_0x525fb5,_0x3def3e,_0x4ccf5b,_0x123f2c){return new BPromise(function(_0x284e22,_0x4a21b5){return getInteractionUsers(_0x525fb5,_0x4ccf5b)[_0x5607('0x1c')](function(_0x3aa51e){return getInteractionTags(_0x3aa51e,_0x3def3e);})[_0x5607('0x1c')](function(_0x5ee39c){return getStateInteraction(_0x5ee39c);})[_0x5607('0x1c')](function(_0x9e21bd){if(_0x123f2c){_0x284e22(getLastMessageText(_0x9e21bd));}else{_0x284e22(_0x9e21bd);}})[_0x5607('0x30')](function(_0x4ef3c3){_0x4a21b5(_0x4ef3c3);});});}function getStateInteraction(_0x5d55cf){return new BPromise(function(_0x3478dc){_0x5d55cf[_0x5607('0x31')]=0x0;_0x5d55cf['talking']=0x0;_0x5d55cf[_0x5607('0x32')]=0x0;_0x5d55cf[_0x5607('0x33')]=0x0;_0x5d55cf[_0x5607('0x34')]=0x0;if(!_0x5d55cf['closed']&&!_0x5d55cf[_0x5607('0x35')]){_0x5d55cf['waiting']+=0x1;}if(!_0x5d55cf[_0x5607('0x36')]&&_0x5d55cf[_0x5607('0x35')]){_0x5d55cf[_0x5607('0x37')]+=0x1;if(_0x5d55cf['waiting']){_0x5d55cf['waiting']-=0x1;}}if(_0x5d55cf['closed']&&_0x5d55cf[_0x5607('0x35')]){_0x5d55cf[_0x5607('0x32')]+=0x1;if(_0x5d55cf[_0x5607('0x37')]){_0x5d55cf[_0x5607('0x37')]-=0x1;}}if(_0x5d55cf[_0x5607('0x36')]&&!_0x5d55cf[_0x5607('0x35')]){_0x5d55cf[_0x5607('0x33')]+=0x1;if(_0x5d55cf[_0x5607('0x31')]){_0x5d55cf['waiting']-=0x1;}}_0x5d55cf[_0x5607('0x34')]+=0x1;_0x3478dc(_0x5d55cf);});}exports[_0x5607('0x38')]=function(_0x1671f0,_0x2c4b9e){var _0x5d7474={},_0x2e35a3={},_0xfd05e={'count':0x0,'rows':[]};var _0x55277a=_['map'](db[_0x5607('0x39')][_0x5607('0x3a')],function(_0x13ce34){return{'name':_0x13ce34['fieldName'],'type':_0x13ce34['type']['key']};});_0x2e35a3[_0x5607('0x3b')]=_[_0x5607('0x23')](_0x55277a,_0x5607('0x20'));_0x2e35a3['query']=_[_0x5607('0x3c')](_0x1671f0[_0x5607('0x3d')]);_0x2e35a3[_0x5607('0x3e')]=_[_0x5607('0x3f')](_0x2e35a3[_0x5607('0x3b')],_0x2e35a3[_0x5607('0x3d')]);_0x5d7474[_0x5607('0x40')]=_['intersection'](_0x2e35a3['model'],qs[_0x5607('0x41')](_0x1671f0[_0x5607('0x3d')][_0x5607('0x41')]));_0x5d7474['attributes']=_0x5d7474[_0x5607('0x40')][_0x5607('0x42')]?_0x5d7474['attributes']:_0x2e35a3[_0x5607('0x3b')];if(!_0x1671f0[_0x5607('0x3d')]['hasOwnProperty']('nolimit')){_0x5d7474[_0x5607('0x17')]=qs[_0x5607('0x17')](_0x1671f0[_0x5607('0x3d')]['limit']);_0x5d7474[_0x5607('0x16')]=qs[_0x5607('0x16')](_0x1671f0['query'][_0x5607('0x16')]);}_0x5d7474[_0x5607('0x43')]=qs['sort'](_0x1671f0[_0x5607('0x3d')][_0x5607('0x44')]);_0x5d7474[_0x5607('0x45')]=qs['filters'](_[_0x5607('0x46')](_0x1671f0[_0x5607('0x3d')],_0x2e35a3[_0x5607('0x3e')]),_0x55277a);var _0x2dddb2=[];var _0x33283e=squel['select']()[_0x5607('0x47')]('id')[_0x5607('0x47')](_0x5607('0x20'))[_0x5607('0x47')](_0x5607('0x48'))['from'](_0x5607('0x49'));var _0x5c9b68=squel[_0x5607('0x4a')]()[_0x5607('0x47')](_0x5607('0x4b'))[_0x5607('0x47')](_0x5607('0x4c'))[_0x5607('0x47')]('ui.MailInteractionId')['from']('user_has_mail_interactions','ui')[_0x5607('0x4d')](_0x5607('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0xa6e098=squel[_0x5607('0x4a')]()[_0x5607('0x4f')](_0x5607('0x50'),'i')[_0x5607('0x4d')](_0x5607('0x51'),'c',_0x5607('0x52'))[_0x5607('0x4d')](_0x5607('0x4e'),'o',_0x5607('0x53'))[_0x5607('0x4d')](_0x5607('0x54'),'a',_0x5607('0x55'))[_0x5607('0x4d')](_0x5607('0x56'),'me',_0x5607('0x57'))[_0x5607('0x4d')]('mail_interaction_has_tags','it',_0x5607('0x58'))['left_join'](_0x5607('0x49'),'t',_0x5607('0x59'));var _0x3147b9=squel[_0x5607('0x5a')]();var _0x586847=[];var _0x1427eb=squel['expr']();var _0x3ae406;if(_0x1671f0['query']['search']){_0x3ae406=as[_0x5607('0x5b')](_0x1671f0[_0x5607('0x3d')][_0x5607('0x5c')]);var _0x1ecc48=_0x3ae406['sqlOperator'];for(var _0x414fbf=0x0;_0x414fbf<_0x3ae406['conditions'][_0x5607('0x42')];_0x414fbf++){var _0x44fb73=_0x3ae406[_0x5607('0x5d')][_0x414fbf];var _0x411968='i';var _0x5b7b87=_[_0x5607('0x5e')](_0x55277a,[_0x5607('0x20'),_0x44fb73['field']]);if(!_0x5b7b87){switch(_0x44fb73[_0x5607('0x47')]){case'unreadMessages':if(_0x44fb73[_0x5607('0x5f')]==0x1){_0xa6e098[_0x5607('0x60')]('`'+_0x44fb73[_0x5607('0x47')]+_0x5607('0x61'));}else{_0xa6e098[_0x5607('0x60')]('`'+_0x44fb73['field']+_0x5607('0x62'));}break;case _0x5607('0x63'):if(_0x44fb73[_0x5607('0x64')]===_0x5607('0x65')){if(_0x44fb73['value'][_0x5607('0x27')]('\x20')[_0x5607('0x42')]>0x1){_0x3147b9[_0x1ecc48]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x44fb73[_0x5607('0x5f')]),null);}else{var _0xb679d3='%'+_0x44fb73[_0x5607('0x5f')]+'%';_0x3147b9[_0x1ecc48](_0x5607('0x66'),_0xb679d3,_0xb679d3,_0xb679d3);}}else{_0x5b7b87=_[_0x5607('0x5e')](_0x55277a,['name','ContactId']);_0x44fb73[_0x5607('0x47')]='ContactId';_0x30d982=as[_0x5607('0x67')](_0x411968,_0x5b7b87['type'],_0x44fb73);_0x3147b9[_0x1ecc48](_0x30d982['text'],_0x30d982['value']['start'],_0x30d982[_0x5607('0x5f')][_0x5607('0x14')]);}break;case _0x5607('0x68'):var _0x3d00cc=_0x44fb73[_0x5607('0x5f')][_0x5607('0x27')](',')[_0x5607('0x23')](function(_0x5c670f){return Number(_0x5c670f);});_0x3d00cc[_0x5607('0x28')](function(_0x68e294){_0x1427eb['or'](_0x5607('0x69'),'%,'+_0x68e294+',%');});_0x586847=_['union'](_0x586847,_0x3d00cc);break;case _0x5607('0x6a'):if(_0x44fb73[_0x5607('0x64')]==='$substring'){_0x3147b9[_0x1ecc48](_0x5607('0x6b'),'%'+_0x44fb73['value']+'%',null);}else{_0x5b7b87=_[_0x5607('0x5e')](_0x55277a,[_0x5607('0x20'),'UserId']);_0x44fb73[_0x5607('0x47')]=_0x5607('0x35');_0x30d982=as[_0x5607('0x67')](_0x411968,_0x5b7b87[_0x5607('0x6c')],_0x44fb73);_0x3147b9[_0x1ecc48](_0x30d982[_0x5607('0x6d')],_0x30d982[_0x5607('0x5f')][_0x5607('0x6e')],_0x30d982['value']['end']);}break;case _0x5607('0x2c'):_0x30d982=as[_0x5607('0x67')]('me',null,_0x44fb73);_0x3147b9[_0x1ecc48](_0x30d982[_0x5607('0x6d')],_0x30d982[_0x5607('0x5f')][_0x5607('0x6e')],_0x30d982[_0x5607('0x5f')][_0x5607('0x14')]);break;}}else{var _0x30d982=as[_0x5607('0x67')](_0x411968,_0x5b7b87[_0x5607('0x6c')],_0x44fb73);_0x3147b9[_0x1ecc48](_0x30d982['text'],_0x30d982[_0x5607('0x5f')]['start'],_0x30d982[_0x5607('0x5f')][_0x5607('0x14')]);}}}else{var _0x2946b9=_(_0x1671f0['query'])['keys']()[_0x5607('0x23')](function(_0x5ea27d){return _['some'](_0x55277a,['name',_0x5ea27d])?_0x5ea27d:undefined;})['compact']()[_0x5607('0x5f')]();if(!_[_0x5607('0x6f')](_0x2946b9)){_0x2946b9[_0x5607('0x28')](function(_0x43c968){if(_0x43c968===_0x5607('0x70')){_0xa6e098[_0x5607('0x45')](_0x5607('0x71'),[]['concat'](_0x1671f0[_0x5607('0x3d')][_0x43c968]));}else if(_0x43c968===_0x5607('0x72')){var _0x39ff6b=JSON[_0x5607('0x73')](_0x1671f0[_0x5607('0x3d')][_0x43c968])['$gte'];var _0x150dcd=JSON[_0x5607('0x73')](_0x1671f0[_0x5607('0x3d')][_0x43c968])['$lte'];_0xa6e098[_0x5607('0x45')](_0x5607('0x74'),_0x39ff6b,_0x150dcd);}else{if(_0x1671f0[_0x5607('0x3d')][_0x43c968]==='null'){_0xa6e098[_0x5607('0x45')]('i.'+_0x43c968+_0x5607('0x75'));}else{_0xa6e098[_0x5607('0x45')]('i.'+_0x43c968+_0x5607('0x76'),_0x1671f0['query'][_0x43c968]);}}});}if(_0x1671f0[_0x5607('0x3d')][_0x5607('0x77')]){if(_0x1671f0[_0x5607('0x3d')][_0x5607('0x77')]==0x1){_0xa6e098[_0x5607('0x60')](_0x5607('0x78'));}else{_0xa6e098[_0x5607('0x60')](_0x5607('0x79'));}}if(_0x1671f0['query']['tag']){_0x586847=_[_0x5607('0x7a')](_0x1671f0[_0x5607('0x3d')][_0x5607('0x7b')])?_0x1671f0[_0x5607('0x3d')][_0x5607('0x7b')]:new Array(_0x1671f0[_0x5607('0x3d')]['tag']);_0x586847[_0x5607('0x28')](function(_0x38cb94){_0x1427eb['or'](_0x5607('0x69'),'%,'+_0x38cb94+',%');});}if(_0x1671f0[_0x5607('0x3d')][_0x5607('0x7c')]){var _0x25bc3d=_0x1671f0[_0x5607('0x3d')][_0x5607('0x7c')]['replace']('\x5c','\x5c\x5c')[_0x5607('0x7d')](/'/g,'\x27\x27');if(qs[_0x5607('0x7e')](_0x25bc3d)){_0x3147b9['or']('i.id\x20LIKE\x20?',_0x25bc3d+'%');}else if(qs['isEmail'](_0x25bc3d)){_0x3147b9['or'](_0x5607('0x7f'),_0x25bc3d+'%');}else{_0x3147b9['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5607('0x80')](_0x25bc3d))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x25bc3d));}}}_0xa6e098[_0x5607('0x45')](_0x3147b9);_0xa6e098[_0x5607('0x81')]('i.id');var _0x5a4ccd={'type':db[_0x5607('0x82')]['QueryTypes']['SELECT'],'raw':!![]};var _0x27adef=_0xa6e098[_0x5607('0x83')]();_0x27adef[_0x5607('0x47')]('i.id');_0x27adef[_0x5607('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5607('0x84'));if(_0x5d7474[_0x5607('0x43')]){_0x5d7474[_0x5607('0x43')][_0x5607('0x28')](function(_0x3c0000){var _0x58dafb=_0x3c0000[0x0]===_0x5607('0x85')?_0x3c0000[0x0]:'i.'+_0x3c0000[0x0];_0xa6e098['order'](_0x58dafb,_0x3c0000[0x1]===_0x5607('0x86')?![]:!![]);});}if(!_['isEmpty'](_0x586847)){_0xa6e098[_0x5607('0x60')](_0x1427eb);_0x27adef[_0x5607('0x45')](_0x5607('0x87'),_0x586847);}BPromise[_0x5607('0x88')]()['then'](function(){if(!_0x3ae406){if(_0x1671f0[_0x5607('0x3d')][_0x5607('0x70')])return;_0x27adef[_0x5607('0x45')](_0x5607('0x89'));_0xa6e098[_0x5607('0x45')](_0x5607('0x89'));return;}if(_0x1671f0[_0x5607('0x8a')][_0x5607('0x8b')]!==_0x5607('0x8c'))return;return _0x1671f0[_0x5607('0x8a')][_0x5607('0x8d')]({'attributes':['id'],'raw':!![]})[_0x5607('0x1c')](function(_0x1acfe1){if(_[_0x5607('0x6f')](_0x1acfe1)){_0x27adef[_0x5607('0x45')](_0x5607('0x8e'));_0xa6e098[_0x5607('0x45')](_0x5607('0x8e'));}else{_0x27adef['where'](_0x5607('0x71'),_['map'](_0x1acfe1,'id'));_0xa6e098[_0x5607('0x45')]('i.MailAccountId\x20IN\x20?',_[_0x5607('0x23')](_0x1acfe1,'id'));}});})[_0x5607('0x1c')](function(){if(_0x1671f0[_0x5607('0x8a')][_0x5607('0x8b')]===_0x5607('0x8c')&&!_0x3ae406&&!_0x1671f0[_0x5607('0x3d')][_0x5607('0x70')])return[];return db[_0x5607('0x8f')][_0x5607('0x3d')](_0x27adef['toString'](),_0x5a4ccd);})['then'](function(_0xd14f0){_0xfd05e[_0x5607('0x19')]=_0xd14f0[_0x5607('0x42')];if(_0xfd05e[_0x5607('0x19')]===0x0)return[];return db[_0x5607('0x8f')][_0x5607('0x3d')](_0x33283e[_0x5607('0x90')](),_0x5a4ccd)['then'](function(_0x5c9959){_0x2dddb2=_[_0x5607('0x91')](_0x5c9959,'id');_0x5a4ccd=_['merge'](_0x5a4ccd,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1671f0[_0x5607('0x3d')][_0x5607('0x41')]){_0x5d7474[_0x5607('0x40')][_0x5607('0x28')](function(_0x5f672c){_0xa6e098[_0x5607('0x47')]('i.'+_0x5f672c);});}else{_0xa6e098[_0x5607('0x47')](_0x5607('0x92'),_0x5607('0x84'));_0xa6e098[_0x5607('0x47')](_0x5607('0x93'),'Account.key');_0xa6e098[_0x5607('0x47')](_0x5607('0x94'),_0x5607('0x95'));_0xa6e098[_0x5607('0x47')](_0x5607('0x96'),_0x5607('0x85'));_0xa6e098[_0x5607('0x47')](_0x5607('0x97'));_0xa6e098[_0x5607('0x47')]('i.createdAt');_0xa6e098['field']('i.updatedAt');_0xa6e098[_0x5607('0x47')](_0x5607('0x98'));_0xa6e098[_0x5607('0x47')](_0x5607('0x99'));_0xa6e098[_0x5607('0x47')](_0x5607('0x9a'));_0xa6e098[_0x5607('0x47')]('i.lastMsgAt');_0xa6e098[_0x5607('0x47')](_0x5607('0x9b'));_0xa6e098[_0x5607('0x47')](_0x5607('0x9c'));_0xa6e098[_0x5607('0x47')](_0x5607('0x9d'));_0xa6e098[_0x5607('0x47')](_0x5607('0x9e'));_0xa6e098[_0x5607('0x47')](_0x5607('0x9f'));_0xa6e098[_0x5607('0x47')]('i.substatus');_0xa6e098[_0x5607('0x47')](_0x5607('0xa0'));_0xa6e098[_0x5607('0x47')](_0x5607('0xa1'));_0xa6e098[_0x5607('0x47')](_0x5607('0xa2'));_0xa6e098['field'](_0x5607('0xa3'));_0xa6e098[_0x5607('0x47')](_0x5607('0xa4'),_0x5607('0xa5'));_0xa6e098['field'](_0x5607('0xa6'),_0x5607('0xa7'));_0xa6e098['field']('c.email',_0x5607('0xa8'));_0xa6e098['field'](_0x5607('0xa9'),'Contact.phone');_0xa6e098[_0x5607('0x47')](_0x5607('0xaa'),'Contact.mobile');_0xa6e098['field'](_0x5607('0xab'),_0x5607('0xac'));_0xa6e098[_0x5607('0x47')]('o.fullname','Owner.fullname');_0xa6e098[_0x5607('0x47')](_0x5607('0xad'),_0x5607('0xae'));_0xa6e098[_0x5607('0x47')](_0x5607('0xaf'),'TagIds');}if(_0x5d7474['limit'])_0xa6e098[_0x5607('0x17')](_0x5d7474[_0x5607('0x17')]);if(_0x5d7474[_0x5607('0x16')])_0xa6e098[_0x5607('0x16')](_0x5d7474['offset']);return db[_0x5607('0x8f')]['query'](_0xa6e098[_0x5607('0x90')](),_0x5a4ccd);})[_0x5607('0x1c')](function(_0x1b5e38){if(_0x1b5e38['length']>0x0)_0x5c9b68[_0x5607('0x45')](_0x5607('0xb0'),_[_0x5607('0x23')](_0x1b5e38,'id'));return db[_0x5607('0x8f')][_0x5607('0x3d')](_0x5c9b68[_0x5607('0x90')](),_0x5a4ccd)[_0x5607('0x1c')](function(_0x48557c){var _0x532a72=_['groupBy'](_0x48557c,_0x5607('0xb1'));var _0x9a634d=[];return db['Setting']['findOne']({'attributes':[_0x5607('0xb2')],'raw':!![]})[_0x5607('0x1c')](function(_0x509394){var _0x146aa3=_0x509394['enableEmailPreview'];_0x1b5e38[_0x5607('0x28')](function(_0x52e7ff){_0x9a634d['push'](updateMailInteraction(_0x52e7ff,_0x2dddb2,_0x532a72,_0x146aa3));});return BPromise[_0x5607('0xb3')](_0x9a634d);});});});})[_0x5607('0x1c')](function(_0x52160c){_0xfd05e['rows']=_0x52160c;return _0xfd05e;})[_0x5607('0x1c')](respondWithFilteredResult(_0x2c4b9e,_0x5d7474))[_0x5607('0x30')](handleError(_0x2c4b9e,null));};exports['show']=function(_0x21301a,_0x371610){var _0x215625={'raw':![],'where':{'id':_0x21301a[_0x5607('0xb4')]['id']}},_0x4e3d27={};_0x4e3d27[_0x5607('0x3b')]=_[_0x5607('0x3c')](db[_0x5607('0x39')][_0x5607('0x3a')]);_0x4e3d27[_0x5607('0x3d')]=_[_0x5607('0x3c')](_0x21301a['query']);_0x4e3d27[_0x5607('0x3e')]=_[_0x5607('0x3f')](_0x4e3d27[_0x5607('0x3b')],_0x4e3d27['query']);_0x215625[_0x5607('0x40')]=_[_0x5607('0x3f')](_0x4e3d27[_0x5607('0x3b')],qs[_0x5607('0x41')](_0x21301a[_0x5607('0x3d')][_0x5607('0x41')]));_0x215625[_0x5607('0x40')]=_0x215625[_0x5607('0x40')]['length']?_0x215625[_0x5607('0x40')]:_0x4e3d27[_0x5607('0x3b')];if(_0x21301a[_0x5607('0x3d')][_0x5607('0xb5')]){_0x215625[_0x5607('0xb6')]=[{'all':!![]}];}_0x215625=_[_0x5607('0xb7')]({},_0x215625,_0x21301a[_0x5607('0xb8')]);return db[_0x5607('0x39')]['find'](_0x215625)[_0x5607('0x1c')](handleEntityNotFound(_0x371610,null))[_0x5607('0x1c')](respondWithResult(_0x371610,null))[_0x5607('0x30')](handleError(_0x371610,null));};exports[_0x5607('0xb9')]=function(_0x5c8d15,_0x46bf50){return db[_0x5607('0x39')]['create'](_0x5c8d15['body'],{})['then'](respondWithResult(_0x46bf50,0xc9))[_0x5607('0x30')](handleError(_0x46bf50,null));};exports[_0x5607('0x1b')]=function(_0x34aa78,_0x4ed338){if(_0x34aa78[_0x5607('0xba')]['id']){delete _0x34aa78[_0x5607('0xba')]['id'];}return db[_0x5607('0x39')][_0x5607('0x5e')]({'where':{'id':_0x34aa78[_0x5607('0xb4')]['id']}})[_0x5607('0x1c')](handleEntityNotFound(_0x4ed338,null))[_0x5607('0x1c')](saveUpdates(_0x34aa78[_0x5607('0xba')],null))['then'](respondWithResult(_0x4ed338,null))[_0x5607('0x30')](handleError(_0x4ed338,null));};exports[_0x5607('0x1d')]=function(_0x151a13,_0x195a5b){return db[_0x5607('0x39')][_0x5607('0x5e')]({'where':{'id':_0x151a13[_0x5607('0xb4')]['id']}})['then'](handleEntityNotFound(_0x195a5b,null))['then'](removeEntity(_0x195a5b,null))['catch'](handleError(_0x195a5b,null));};exports['describe']=function(_0x5cde3,_0x180c9b){return db[_0x5607('0x39')][_0x5607('0xbb')]()[_0x5607('0x1c')](respondWithResult(_0x180c9b,null))['catch'](handleError(_0x180c9b,null));};exports[_0x5607('0xbc')]=function(_0x2eb103,_0x9c89e4){return db['MailMessage']['find']({'where':{'id':_0x2eb103[_0x5607('0xb4')]['id']}})[_0x5607('0x1c')](handleEntityNotFound(_0x9c89e4,null))[_0x5607('0x1c')](function(_0x59ee04){if(_0x59ee04){return _0x59ee04[_0x5607('0xbc')](_0x2eb103[_0x5607('0xba')]['ids'],_[_0x5607('0xbd')](_0x2eb103[_0x5607('0xba')],[_0x5607('0xbe'),'id'])||{});}})[_0x5607('0x1c')](respondWithResult(_0x9c89e4,null))[_0x5607('0x30')](handleError(_0x9c89e4,null));};exports[_0x5607('0xbf')]=function(_0x49f61f,_0xc5322a){var _0xff2bf5={'raw':![],'where':{}};var _0xb24cbb={};var _0x35c643={'count':0x0,'rows':[]};return db[_0x5607('0x39')]['findOne']({'where':{'id':_0x49f61f[_0x5607('0xb4')]['id']}})[_0x5607('0x1c')](handleEntityNotFound(_0xc5322a,null))[_0x5607('0x1c')](function(_0x3abaaa){if(_0x3abaaa){_0xb24cbb[_0x5607('0x3b')]=_[_0x5607('0x3c')](db[_0x5607('0x2a')][_0x5607('0x3a')]);_0xb24cbb[_0x5607('0x3d')]=_[_0x5607('0x3c')](_0x49f61f['query']);_0xb24cbb['filters']=_['intersection'](_0xb24cbb[_0x5607('0x3b')],_0xb24cbb['query']);_0xff2bf5['attributes']=_[_0x5607('0x3f')](_0xb24cbb['model'],qs[_0x5607('0x41')](_0x49f61f['query']['fields']));_0xff2bf5[_0x5607('0x40')]=_0xff2bf5[_0x5607('0x40')][_0x5607('0x42')]?_0xff2bf5[_0x5607('0x40')]:_0xb24cbb[_0x5607('0x3b')];if(!_0x49f61f[_0x5607('0x3d')]['hasOwnProperty'](_0x5607('0xc0'))){_0xff2bf5[_0x5607('0x17')]=qs[_0x5607('0x17')](_0x49f61f[_0x5607('0x3d')][_0x5607('0x17')]);_0xff2bf5['offset']=qs['offset'](_0x49f61f[_0x5607('0x3d')]['offset']);}_0xff2bf5['order']=qs[_0x5607('0x44')](_0x49f61f[_0x5607('0x3d')][_0x5607('0x44')]);_0xff2bf5[_0x5607('0x45')]=qs[_0x5607('0x3e')](_['pick'](_0x49f61f['query'],_0xb24cbb[_0x5607('0x3e')]));_0xff2bf5[_0x5607('0x45')][_0x5607('0xb1')]=_0x3abaaa['id'];if(_0x49f61f[_0x5607('0x3d')]['filter']){_0xff2bf5[_0x5607('0x45')]=_[_0x5607('0xb7')](_0xff2bf5[_0x5607('0x45')],{'$or':_[_0x5607('0x23')](_0xff2bf5['attributes'],function(_0x1d2d6d){var _0xdd93da={};_0xdd93da[_0x1d2d6d]={'$like':'%'+_0x49f61f['query'][_0x5607('0x7c')]+'%'};return _0xdd93da;})});}if(_0x49f61f[_0x5607('0x3d')][_0x5607('0xc1')]){var _0x2a2498=_0x49f61f[_0x5607('0x3d')][_0x5607('0xc1')]['split'](',');var _0x23064b={};_0x23064b[_0x2a2498[0x0]]={'$gte':moment(_0x2a2498[0x1])['format'](_0x5607('0xc2'))};_0xff2bf5[_0x5607('0x45')]=_[_0x5607('0xb7')](_0xff2bf5[_0x5607('0x45')],_0x23064b);}_0xff2bf5=_[_0x5607('0xb7')]({},_0xff2bf5,_0x49f61f['options']);return db['MailMessage']['count']({'where':_0xff2bf5['where']})[_0x5607('0x1c')](function(_0x38cdc2){_0x35c643['count']=_0x38cdc2;if(_0x49f61f[_0x5607('0x3d')][_0x5607('0xb5')]){_0xff2bf5[_0x5607('0xb6')]=[{'all':!![]}];}return db[_0x5607('0x2a')][_0x5607('0xc3')](_0xff2bf5);})[_0x5607('0x1c')](function(_0x5a3114){if(_0x49f61f[_0x5607('0x3d')][_0x5607('0xc4')]===_0x5607('0xc5')){for(var _0x3b8240=0x0;_0x3b8240<_0x5a3114['length'];_0x3b8240++){_0x5a3114[_0x3b8240][_0x5607('0xba')]=juice(_0x5a3114[_0x3b8240][_0x5607('0xba')]);}}_0x35c643[_0x5607('0xc6')]=_0x5a3114;return _0x35c643;});}})[_0x5607('0x1c')](respondWithFilteredResult(_0xc5322a,_0xff2bf5))[_0x5607('0x30')](handleError(_0xc5322a,null));};exports[_0x5607('0xc7')]=function(_0x3d5273,_0x245e4b){return db[_0x5607('0x39')][_0x5607('0x5e')]({'where':{'id':_0x3d5273['params']['id']}})[_0x5607('0x1c')](handleEntityNotFound(_0x245e4b,null))[_0x5607('0x1c')](function(_0x11165d){if(_0x11165d){return _0x11165d[_0x5607('0xc8')](_0x3d5273[_0x5607('0xba')]['ids'],_[_0x5607('0xbd')](_0x3d5273[_0x5607('0xba')],[_0x5607('0xbe'),'id'])||{})[_0x5607('0xc9')](function(){return db['Tag'][_0x5607('0xc3')]({'attributes':['id',_0x5607('0x20'),'color'],'where':{'id':_0x3d5273[_0x5607('0xba')][_0x5607('0xbe')]}});})[_0x5607('0x1c')](function(_0x178b20){socket['emit'](_0x5607('0xca'),{'id':Number(_0x3d5273[_0x5607('0xb4')]['id']),'tags':_0x178b20||[]});return{'id':Number(_0x3d5273['params']['id']),'tags':_0x178b20||[]};});}})[_0x5607('0x1c')](respondWithResult(_0x245e4b,null))[_0x5607('0x30')](handleError(_0x245e4b,null));};exports[_0x5607('0xcb')]=function(_0x2e54ad,_0x3a215c){return db[_0x5607('0x39')][_0x5607('0x5e')]({'where':{'id':_0x2e54ad[_0x5607('0xb4')]['id']}})['then'](handleEntityNotFound(_0x3a215c,null))[_0x5607('0x1c')](function(_0x3aa505){if(_0x3aa505){return _0x3aa505[_0x5607('0xcb')](_0x2e54ad[_0x5607('0x3d')][_0x5607('0xbe')]);}})[_0x5607('0x1c')](respondWithStatusCode(_0x3a215c,null))[_0x5607('0x30')](handleError(_0x3a215c,null));};exports[_0x5607('0xcc')]=function(_0x2fcde6,_0x30a49f){var _0x7902ce=moment()['unix']()[_0x5607('0x90')]();var _0x512c97=path[_0x5607('0xcd')](config[_0x5607('0xce')],_0x5607('0xcf'),_0x5607('0xd0'),_0x5607('0xd1'));var _0xdac7d7=path[_0x5607('0xcd')](config[_0x5607('0xce')],_0x5607('0xcf'),'files',_0x5607('0xd2'));var _0x2cd591=path[_0x5607('0xcd')](_0x512c97,_0x7902ce);var _0x418c36=util[_0x5607('0xd3')]('transcript-%d-%s.zip',_0x2fcde6[_0x5607('0xb4')]['id'],_0x7902ce);var _0x26cc63=path[_0x5607('0xcd')](_0x512c97,_0x418c36);var _0x5e908=[];if(_0x2fcde6[_0x5607('0x3d')][_0x5607('0xd2')]){_0x5e908[_0x5607('0x29')]({'model':db[_0x5607('0xd4')],'as':_0x5607('0xd5'),'raw':!![]});}var _0x31bcf7=[{'model':db[_0x5607('0x2a')],'as':_0x5607('0xd6'),'attributes':['id',_0x5607('0xba'),_0x5607('0x4f'),'to','cc','bcc',_0x5607('0xd7'),_0x5607('0x72')],'where':{'secret':![]},'order':qs[_0x5607('0x44')]('id'),'include':_0x5e908}];return db[_0x5607('0x39')][_0x5607('0x5e')]({'where':{'id':_0x2fcde6['params']['id']},'include':_0x31bcf7})[_0x5607('0x1c')](handleEntityNotFound(_0x30a49f,null))[_0x5607('0x1c')](function(_0xf6dc35){if(_0xf6dc35&&_0xf6dc35[_0x5607('0xd6')]){var _0x285484=_0xf6dc35['get']({'plain':!![]});fs[_0x5607('0xd8')](_0x2cd591);return BPromise['each'](_0x285484['Messages'],function(_0x57f98a,_0x525d8e){var _0x31fba7={'from':_0x57f98a[_0x5607('0x4f')],'to':_0x57f98a['to'],'subject':_0x57f98a[_0x5607('0xd7')],'html':htmlEntities['decode'](_0x57f98a[_0x5607('0xba')]),'headers':{'Date':moment(_0x57f98a[_0x5607('0x72')])['format'](_0x5607('0xd9'))},'attachments':[]};if(_0x57f98a['cc']){_0x31fba7[_0x5607('0xda')]['Cc']=_0x57f98a['cc'];}if(_0x57f98a[_0x5607('0xdb')]){_0x31fba7[_0x5607('0xda')][_0x5607('0xdc')]=_0x57f98a[_0x5607('0xdb')];}return new BPromise(function(_0x2618ec,_0x38d712){if(_0x57f98a['Attachments']){for(var _0x54f51e=0x0;_0x54f51e<_0x57f98a[_0x5607('0xd5')][_0x5607('0x42')];_0x54f51e++){var _0x1676c1=_0x57f98a[_0x5607('0xd5')][_0x54f51e];var _0x40b1a1=path['join'](_0xdac7d7,_0x1676c1[_0x5607('0xdd')]);if(fs[_0x5607('0xde')](_0x40b1a1)){_0x31fba7[_0x5607('0xd2')]['push']({'name':_0x1676c1['name'],'contentType':_0x1676c1[_0x5607('0x6c')],'data':fs[_0x5607('0xdf')](_0x40b1a1)});}}}emlformat['build'](_0x31fba7,function(_0x1d2556,_0x5230f4){if(_0x1d2556)return _0x38d712(_0x1d2556);fs[_0x5607('0xe0')](path[_0x5607('0xcd')](_0x2cd591,util[_0x5607('0xd3')](_0x5607('0xe1'),_0x525d8e)),_0x5230f4);return _0x2618ec(_0x5230f4);});});})['then'](function(){return new BPromise(function(_0x151f16,_0x1dcabf){zipdir(_0x2cd591,{'saveTo':_0x26cc63},function(_0x169977,_0x10edea){if(_0x169977)return _0x1dcabf(_0x169977);return _0x151f16(_0x10edea);});})[_0x5607('0x1c')](function(){return new BPromise(function(_0x5d1095,_0x583959){rimraf(_0x2cd591,function(_0x1ae5a8){if(_0x1ae5a8)_0x583959(_0x1ae5a8);return _0x5d1095();});});})[_0x5607('0x1c')](function(){return _0x30a49f['download'](_0x26cc63,_0x418c36,function(_0x22a6f5){if(!_0x22a6f5)fs[_0x5607('0xe2')](_0x26cc63);});});});}else{return _0x30a49f['sendStatus'](0xc8);}})[_0x5607('0x30')](handleError(_0x30a49f,null));}; \ No newline at end of file +var _0xfd2e=['i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','SELECT','clone','contactName','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_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.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','rows','show','params','rawAttributes','include','options','create','body','describe','addMessage','omit','ids','getMessages','nolimit','MailInteractionId','format','includeAll','inlineCss','addTags','spread','findAll','emit','removeTags','download','unix','join','root','files','transcript-%d-%s.zip','attachments','Messages','bcc','subject','get','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','bluebird','path','lodash','squel','juice','ioredis','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','name','send','Users','map','fullname','TagIds','Tags','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','answered','total','closed','UserId','waiting','talking','unmanaged','index','MailInteraction','key','model','query','filters','intersection','fields','attributes','order','sort','where','select','field','color','from','u.fullname','ui.MailInteractionId','user_has_mail_interactions','u.id\x20=\x20ui.UserId','mail_interactions','left_join','users','o.id\x20=\x20i.UserId','mail_accounts','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','start','buildExpression','type','keys','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfd2e,0x6e));var _0xefd2=function(_0x1fe5fb,_0x1d24c5){_0x1fe5fb=_0x1fe5fb-0x0;var _0x2c98ad=_0xfd2e[_0x1fe5fb];return _0x2c98ad;};'use strict';var emlformat=require(_0xefd2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xefd2('0x1'));var moment=require('moment');var BPromise=require(_0xefd2('0x2'));var util=require('util');var path=require(_0xefd2('0x3'));var fs=require('fs');var _=require(_0xefd2('0x4'));var squel=require(_0xefd2('0x5'));var juice=require(_0xefd2('0x6'));var Redis=require(_0xefd2('0x7'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0xefd2('0x8'))('api');var config=require('../../config/environment');var db=require(_0xefd2('0x9'))['db'];var htmlEntities=require('html-entities');config[_0xefd2('0xa')]=_[_0xefd2('0xb')](config[_0xefd2('0xa')],{'host':_0xefd2('0xc'),'port':0x18eb});var socket=require(_0xefd2('0xd'))(new Redis(config[_0xefd2('0xa')]));require(_0xefd2('0xe'))['register'](socket);function respondWithStatusCode(_0x2d8eff,_0x349eea){_0x349eea=_0x349eea||0xcc;return function(_0xd765f7){if(_0xd765f7){return _0x2d8eff[_0xefd2('0xf')](_0x349eea);}return _0x2d8eff[_0xefd2('0x10')](_0x349eea)[_0xefd2('0x11')]();};}function respondWithResult(_0x11aab0,_0x2f1472){_0x2f1472=_0x2f1472||0xc8;return function(_0x53d09b){if(_0x53d09b){return _0x11aab0['status'](_0x2f1472)[_0xefd2('0x12')](_0x53d09b);}};}function respondWithFilteredResult(_0x4ddfd2,_0x58effd){return function(_0x87493c){if(_0x87493c){var _0x2b4d24=typeof _0x58effd[_0xefd2('0x13')]===_0xefd2('0x14')&&typeof _0x58effd[_0xefd2('0x15')]==='undefined';var _0x1a35b7=_0x87493c[_0xefd2('0x16')];var _0x2e706a=_0x2b4d24?0x0:_0x58effd[_0xefd2('0x13')];var _0x293c78=_0x2b4d24?_0x87493c[_0xefd2('0x16')]:_0x58effd['offset']+_0x58effd['limit'];var _0xd75a31;if(_0x293c78>=_0x1a35b7){_0x293c78=_0x1a35b7;_0xd75a31=0xc8;}else{_0xd75a31=0xce;}_0x4ddfd2[_0xefd2('0x10')](_0xd75a31);return _0x4ddfd2[_0xefd2('0x17')](_0xefd2('0x18'),_0x2e706a+'-'+_0x293c78+'/'+_0x1a35b7)[_0xefd2('0x12')](_0x87493c);}return null;};}function saveUpdates(_0x5080a8){return function(_0x129ada){if(_0x129ada){return _0x129ada[_0xefd2('0x19')](_0x5080a8)[_0xefd2('0x1a')](function(_0x11baea){return _0x11baea;});}return null;};}function removeEntity(_0x4d2e38){return function(_0x115ad8){if(_0x115ad8){return _0x115ad8[_0xefd2('0x1b')]()[_0xefd2('0x1a')](function(){_0x4d2e38[_0xefd2('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x292b2d){return function(_0xb5b076){if(!_0xb5b076){_0x292b2d[_0xefd2('0xf')](0x194);}return _0xb5b076;};}function handleError(_0x25196e,_0x2aaa1b){_0x2aaa1b=_0x2aaa1b||0x1f4;return function(_0x3cbff0){logger[_0xefd2('0x1c')](_0x3cbff0['stack']);if(_0x3cbff0['name']){delete _0x3cbff0[_0xefd2('0x1d')];}_0x25196e[_0xefd2('0x10')](_0x2aaa1b)[_0xefd2('0x1e')](_0x3cbff0);};}function getInteractionUsers(_0x16421b,_0x1d294c){return new BPromise(function(_0x470684,_0x42e4e6){try{if(_0x1d294c[_0x16421b['id']]){_0x16421b[_0xefd2('0x1f')]=_[_0xefd2('0x20')](_0x1d294c[_0x16421b['id']],function(_0x519d9){return{'id':_0x519d9['id'],'fullname':_0x519d9[_0xefd2('0x21')]};});}}catch(_0x50dc75){_0x42e4e6(_0x50dc75);}_0x470684(_0x16421b);});}function getInteractionTags(_0x348019,_0x37feb6){return new BPromise(function(_0x127e4f,_0x398ce2){try{if(_0x348019[_0xefd2('0x22')]){_0x348019[_0xefd2('0x23')]=[];_0x348019[_0xefd2('0x22')]['split'](',')[_0xefd2('0x24')](function(_0x12a0f5){_0x348019[_0xefd2('0x23')][_0xefd2('0x25')](_0x37feb6[_0x12a0f5]);});}delete _0x348019[_0xefd2('0x22')];}catch(_0x50b245){_0x398ce2(_0x50b245);}_0x127e4f(_0x348019);});}function getLastMessageText(_0x315f58){return new BPromise(function(_0x328714,_0x573197){return db[_0xefd2('0x26')][_0xefd2('0x27')]({'where':{'$and':[{'MailInteractionId':_0x315f58['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xefd2('0x28')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xefd2('0x29')],'order':_0xefd2('0x2a'),'raw':!![]})[_0xefd2('0x1a')](function(_0x5b9f03){if(_0x5b9f03&&_0x5b9f03[_0xefd2('0x29')]){_0x315f58[_0xefd2('0x2b')]=_[_0xefd2('0x2c')](_0x5b9f03[_0xefd2('0x29')]);}_0x328714(_0x315f58);})['catch'](function(_0x25644c){_0x573197(_0x25644c);});});}function updateMailInteraction(_0x329737,_0x36f439,_0x25d94d,_0x2ffbf3){return new BPromise(function(_0x37ff34,_0x2712cc){return getInteractionUsers(_0x329737,_0x25d94d)[_0xefd2('0x1a')](function(_0x1d5fad){return getInteractionTags(_0x1d5fad,_0x36f439);})[_0xefd2('0x1a')](function(_0x384395){return getStateInteraction(_0x384395);})['then'](function(_0x20b1dd){if(_0x2ffbf3){_0x37ff34(getLastMessageText(_0x20b1dd));}else{_0x37ff34(_0x20b1dd);}})[_0xefd2('0x2d')](function(_0x4fdba9){_0x2712cc(_0x4fdba9);});});}function getStateInteraction(_0x38ed70){return new BPromise(function(_0xd54536){_0x38ed70['waiting']=0x0;_0x38ed70['talking']=0x0;_0x38ed70[_0xefd2('0x2e')]=0x0;_0x38ed70['unmanaged']=0x0;_0x38ed70[_0xefd2('0x2f')]=0x0;if(!_0x38ed70[_0xefd2('0x30')]&&!_0x38ed70[_0xefd2('0x31')]){_0x38ed70[_0xefd2('0x32')]+=0x1;}if(!_0x38ed70[_0xefd2('0x30')]&&_0x38ed70['UserId']){_0x38ed70[_0xefd2('0x33')]+=0x1;if(_0x38ed70[_0xefd2('0x32')]){_0x38ed70[_0xefd2('0x32')]-=0x1;}}if(_0x38ed70[_0xefd2('0x30')]&&_0x38ed70[_0xefd2('0x31')]){_0x38ed70[_0xefd2('0x2e')]+=0x1;if(_0x38ed70[_0xefd2('0x33')]){_0x38ed70[_0xefd2('0x33')]-=0x1;}}if(_0x38ed70[_0xefd2('0x30')]&&!_0x38ed70[_0xefd2('0x31')]){_0x38ed70[_0xefd2('0x34')]+=0x1;if(_0x38ed70[_0xefd2('0x32')]){_0x38ed70[_0xefd2('0x32')]-=0x1;}}_0x38ed70[_0xefd2('0x2f')]+=0x1;_0xd54536(_0x38ed70);});}exports[_0xefd2('0x35')]=function(_0x40f773,_0x2f0ba9){var _0x1d3204={},_0x155772={},_0x16612d={'count':0x0,'rows':[]};var _0x3b61bd=_['map'](db[_0xefd2('0x36')]['rawAttributes'],function(_0x46495b){return{'name':_0x46495b['fieldName'],'type':_0x46495b['type'][_0xefd2('0x37')]};});_0x155772[_0xefd2('0x38')]=_[_0xefd2('0x20')](_0x3b61bd,_0xefd2('0x1d'));_0x155772[_0xefd2('0x39')]=_['keys'](_0x40f773['query']);_0x155772[_0xefd2('0x3a')]=_['intersection'](_0x155772[_0xefd2('0x38')],_0x155772[_0xefd2('0x39')]);_0x1d3204['attributes']=_[_0xefd2('0x3b')](_0x155772[_0xefd2('0x38')],qs[_0xefd2('0x3c')](_0x40f773[_0xefd2('0x39')]['fields']));_0x1d3204[_0xefd2('0x3d')]=_0x1d3204[_0xefd2('0x3d')]['length']?_0x1d3204[_0xefd2('0x3d')]:_0x155772['model'];if(!_0x40f773[_0xefd2('0x39')]['hasOwnProperty']('nolimit')){_0x1d3204[_0xefd2('0x15')]=qs[_0xefd2('0x15')](_0x40f773['query'][_0xefd2('0x15')]);_0x1d3204['offset']=qs[_0xefd2('0x13')](_0x40f773['query'][_0xefd2('0x13')]);}_0x1d3204[_0xefd2('0x3e')]=qs[_0xefd2('0x3f')](_0x40f773['query'][_0xefd2('0x3f')]);_0x1d3204[_0xefd2('0x40')]=qs['filters'](_['pick'](_0x40f773[_0xefd2('0x39')],_0x155772[_0xefd2('0x3a')]),_0x3b61bd);var _0x4fad61=[];var _0x212875=squel[_0xefd2('0x41')]()[_0xefd2('0x42')]('id')[_0xefd2('0x42')]('name')[_0xefd2('0x42')](_0xefd2('0x43'))[_0xefd2('0x44')]('tools_tags');var _0x1b85dd=squel['select']()[_0xefd2('0x42')]('u.id')[_0xefd2('0x42')](_0xefd2('0x45'))['field'](_0xefd2('0x46'))[_0xefd2('0x44')](_0xefd2('0x47'),'ui')['left_join']('users','u',_0xefd2('0x48'));var _0x5c4606=squel[_0xefd2('0x41')]()[_0xefd2('0x44')](_0xefd2('0x49'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xefd2('0x4a')](_0xefd2('0x4b'),'o',_0xefd2('0x4c'))[_0xefd2('0x4a')](_0xefd2('0x4d'),'a','a.id\x20=\x20i.MailAccountId')[_0xefd2('0x4a')](_0xefd2('0x4e'),'me',_0xefd2('0x4f'))[_0xefd2('0x4a')](_0xefd2('0x50'),'it',_0xefd2('0x51'))[_0xefd2('0x4a')](_0xefd2('0x52'),'t',_0xefd2('0x53'));var _0x13d657=squel[_0xefd2('0x54')]();var _0x40a8be=[];var _0x1445ed=squel[_0xefd2('0x54')]();var _0x3343a5;if(_0x40f773[_0xefd2('0x39')][_0xefd2('0x55')]){_0x3343a5=as[_0xefd2('0x56')](_0x40f773[_0xefd2('0x39')]['search']);var _0x11a00f=_0x3343a5[_0xefd2('0x57')];for(var _0x21fbe8=0x0;_0x21fbe8<_0x3343a5[_0xefd2('0x58')]['length'];_0x21fbe8++){var _0x2d9c3b=_0x3343a5[_0xefd2('0x58')][_0x21fbe8];var _0x1037c4='i';var _0x421906=_[_0xefd2('0x59')](_0x3b61bd,[_0xefd2('0x1d'),_0x2d9c3b[_0xefd2('0x42')]]);if(!_0x421906){switch(_0x2d9c3b[_0xefd2('0x42')]){case _0xefd2('0x5a'):if(_0x2d9c3b[_0xefd2('0x5b')]==0x1){_0x5c4606[_0xefd2('0x5c')]('`'+_0x2d9c3b['field']+_0xefd2('0x5d'));}else{_0x5c4606[_0xefd2('0x5c')]('`'+_0x2d9c3b[_0xefd2('0x42')]+_0xefd2('0x5e'));}break;case _0xefd2('0x5f'):if(_0x2d9c3b[_0xefd2('0x60')]===_0xefd2('0x61')){if(_0x2d9c3b[_0xefd2('0x5b')][_0xefd2('0x62')]('\x20')[_0xefd2('0x63')]>0x1){_0x13d657[_0x11a00f](_0xefd2('0x64'),qs[_0xefd2('0x65')](_0x2d9c3b[_0xefd2('0x5b')]),null);}else{var _0x38b642='%'+_0x2d9c3b['value']+'%';_0x13d657[_0x11a00f](_0xefd2('0x66'),_0x38b642,_0x38b642,_0x38b642);}}else{_0x421906=_[_0xefd2('0x59')](_0x3b61bd,['name',_0xefd2('0x67')]);_0x2d9c3b[_0xefd2('0x42')]=_0xefd2('0x67');_0x22f531=as['buildExpression'](_0x1037c4,_0x421906['type'],_0x2d9c3b);_0x13d657[_0x11a00f](_0x22f531[_0xefd2('0x68')],_0x22f531[_0xefd2('0x5b')]['start'],_0x22f531[_0xefd2('0x5b')][_0xefd2('0x11')]);}break;case _0xefd2('0x69'):var _0x5cb14c=_0x2d9c3b['value'][_0xefd2('0x62')](',')[_0xefd2('0x20')](function(_0x559c64){return Number(_0x559c64);});_0x5cb14c[_0xefd2('0x24')](function(_0x2c6273){_0x1445ed['or'](_0xefd2('0x6a'),'%,'+_0x2c6273+',%');});_0x40a8be=_[_0xefd2('0x6b')](_0x40a8be,_0x5cb14c);break;case'User':if(_0x2d9c3b[_0xefd2('0x60')]==='$substring'){_0x13d657[_0x11a00f]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2d9c3b['value']+'%',null);}else{_0x421906=_[_0xefd2('0x59')](_0x3b61bd,[_0xefd2('0x1d'),_0xefd2('0x31')]);_0x2d9c3b['field']='UserId';_0x22f531=as['buildExpression'](_0x1037c4,_0x421906['type'],_0x2d9c3b);_0x13d657[_0x11a00f](_0x22f531[_0xefd2('0x68')],_0x22f531[_0xefd2('0x5b')][_0xefd2('0x6c')],_0x22f531[_0xefd2('0x5b')][_0xefd2('0x11')]);}break;case _0xefd2('0x29'):_0x22f531=as['buildExpression']('me',null,_0x2d9c3b);_0x13d657[_0x11a00f](_0x22f531[_0xefd2('0x68')],_0x22f531[_0xefd2('0x5b')]['start'],_0x22f531[_0xefd2('0x5b')]['end']);break;}}else{var _0x22f531=as[_0xefd2('0x6d')](_0x1037c4,_0x421906[_0xefd2('0x6e')],_0x2d9c3b);_0x13d657[_0x11a00f](_0x22f531['text'],_0x22f531['value']['start'],_0x22f531['value'][_0xefd2('0x11')]);}}}else{var _0x267d79=_(_0x40f773[_0xefd2('0x39')])[_0xefd2('0x6f')]()[_0xefd2('0x20')](function(_0x921366){return _['some'](_0x3b61bd,[_0xefd2('0x1d'),_0x921366])?_0x921366:undefined;})[_0xefd2('0x70')]()['value']();if(!_[_0xefd2('0x71')](_0x267d79)){_0x267d79[_0xefd2('0x24')](function(_0xdbcd5e){if(_0xdbcd5e===_0xefd2('0x72')){_0x5c4606[_0xefd2('0x40')](_0xefd2('0x73'),[][_0xefd2('0x74')](_0x40f773[_0xefd2('0x39')][_0xdbcd5e]));}else if(_0xdbcd5e===_0xefd2('0x75')){var _0x3756b4=JSON[_0xefd2('0x76')](_0x40f773[_0xefd2('0x39')][_0xdbcd5e])[_0xefd2('0x77')];var _0x4d90ce=JSON[_0xefd2('0x76')](_0x40f773[_0xefd2('0x39')][_0xdbcd5e])[_0xefd2('0x78')];_0x5c4606['where'](_0xefd2('0x79'),_0x3756b4,_0x4d90ce);}else{if(_0x40f773[_0xefd2('0x39')][_0xdbcd5e]===_0xefd2('0x7a')){_0x5c4606[_0xefd2('0x40')]('i.'+_0xdbcd5e+_0xefd2('0x7b'));}else{_0x5c4606[_0xefd2('0x40')]('i.'+_0xdbcd5e+_0xefd2('0x7c'),_0x40f773[_0xefd2('0x39')][_0xdbcd5e]);}}});}if(_0x40f773[_0xefd2('0x39')]['read']){if(_0x40f773[_0xefd2('0x39')][_0xefd2('0x7d')]==0x1){_0x5c4606[_0xefd2('0x5c')]('`unreadMessages`\x20=\x200');}else{_0x5c4606[_0xefd2('0x5c')](_0xefd2('0x7e'));}}if(_0x40f773[_0xefd2('0x39')]['tag']){_0x40a8be=_[_0xefd2('0x7f')](_0x40f773[_0xefd2('0x39')]['tag'])?_0x40f773['query'][_0xefd2('0x80')]:new Array(_0x40f773['query'][_0xefd2('0x80')]);_0x40a8be['forEach'](function(_0x426849){_0x1445ed['or'](_0xefd2('0x6a'),'%,'+_0x426849+',%');});}if(_0x40f773[_0xefd2('0x39')][_0xefd2('0x81')]){var _0x24bd09=_0x40f773['query'][_0xefd2('0x81')][_0xefd2('0x82')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xefd2('0x83')](_0x24bd09)){_0x13d657['or'](_0xefd2('0x84'),_0x24bd09+'%');}else if(qs[_0xefd2('0x85')](_0x24bd09)){_0x13d657['or']('c.email\x20LIKE\x20?',_0x24bd09+'%');}else{_0x13d657['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xefd2('0x65')](_0x24bd09))['or'](_0xefd2('0x86'),qs[_0xefd2('0x65')](_0x24bd09));}}}_0x5c4606[_0xefd2('0x40')](_0x13d657);_0x5c4606['group'](_0xefd2('0x87'));var _0x3695a6={'type':db[_0xefd2('0x88')]['QueryTypes'][_0xefd2('0x89')],'raw':!![]};var _0x74ee72=_0x5c4606[_0xefd2('0x8a')]();_0x74ee72['field'](_0xefd2('0x87'));_0x74ee72[_0xefd2('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xefd2('0x5a'));if(_0x1d3204[_0xefd2('0x3e')]){_0x1d3204[_0xefd2('0x3e')][_0xefd2('0x24')](function(_0x535e8e){var _0x1ad0a5=_0x535e8e[0x0]===_0xefd2('0x8b')?_0x535e8e[0x0]:'i.'+_0x535e8e[0x0];_0x5c4606[_0xefd2('0x3e')](_0x1ad0a5,_0x535e8e[0x1]==='DESC'?![]:!![]);});}if(!_[_0xefd2('0x71')](_0x40a8be)){_0x5c4606[_0xefd2('0x5c')](_0x1445ed);_0x74ee72[_0xefd2('0x40')](_0xefd2('0x8c'),_0x40a8be);}BPromise['resolve']()[_0xefd2('0x1a')](function(){if(!_0x3343a5){if(_0x40f773['query'][_0xefd2('0x72')])return;_0x74ee72['where'](_0xefd2('0x8d'));_0x5c4606[_0xefd2('0x40')](_0xefd2('0x8d'));return;}if(_0x40f773[_0xefd2('0x8e')][_0xefd2('0x8f')]!==_0xefd2('0x90'))return;return _0x40f773[_0xefd2('0x8e')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xefd2('0x1a')](function(_0x31c88e){if(_['isEmpty'](_0x31c88e)){_0x74ee72['where'](_0xefd2('0x91'));_0x5c4606['where'](_0xefd2('0x91'));}else{_0x74ee72['where'](_0xefd2('0x73'),_[_0xefd2('0x20')](_0x31c88e,'id'));_0x5c4606[_0xefd2('0x40')](_0xefd2('0x73'),_[_0xefd2('0x20')](_0x31c88e,'id'));}});})[_0xefd2('0x1a')](function(){if(_0x40f773[_0xefd2('0x8e')][_0xefd2('0x8f')]==='agent'&&!_0x3343a5&&!_0x40f773['query'][_0xefd2('0x72')])return[];return db[_0xefd2('0x92')][_0xefd2('0x39')](_0x74ee72[_0xefd2('0x93')](),_0x3695a6);})[_0xefd2('0x1a')](function(_0x57f32b){_0x16612d[_0xefd2('0x16')]=_0x57f32b['length'];if(_0x16612d[_0xefd2('0x16')]===0x0)return[];return db[_0xefd2('0x92')][_0xefd2('0x39')](_0x212875[_0xefd2('0x93')](),_0x3695a6)[_0xefd2('0x1a')](function(_0x319475){_0x4fad61=_[_0xefd2('0x94')](_0x319475,'id');_0x3695a6=_[_0xefd2('0x95')](_0x3695a6,{'model':db[_0xefd2('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x40f773[_0xefd2('0x39')][_0xefd2('0x3c')]){_0x1d3204['attributes'][_0xefd2('0x24')](function(_0x2c87ce){_0x5c4606['field']('i.'+_0x2c87ce);});}else{_0x5c4606[_0xefd2('0x42')](_0xefd2('0x96'),'unreadMessages');_0x5c4606[_0xefd2('0x42')](_0xefd2('0x97'),_0xefd2('0x98'));_0x5c4606['field'](_0xefd2('0x99'),_0xefd2('0x9a'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0x9b'),_0xefd2('0x8b'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0x87'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0x9c'));_0x5c4606['field'](_0xefd2('0x9d'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0x9e'));_0x5c4606['field'](_0xefd2('0x9f'));_0x5c4606['field'](_0xefd2('0xa0'));_0x5c4606[_0xefd2('0x42')]('i.lastMsgAt');_0x5c4606[_0xefd2('0x42')](_0xefd2('0xa1'));_0x5c4606['field'](_0xefd2('0xa2'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0xa3'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0xa4'));_0x5c4606['field'](_0xefd2('0xa5'));_0x5c4606[_0xefd2('0x42')]('i.substatus');_0x5c4606[_0xefd2('0x42')](_0xefd2('0xa6'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0xa7'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0xa8'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0xa9'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0xaa'),'Contact.firstName');_0x5c4606[_0xefd2('0x42')](_0xefd2('0xab'),_0xefd2('0xac'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0xad'),_0xefd2('0xae'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0xaf'),'Contact.phone');_0x5c4606[_0xefd2('0x42')](_0xefd2('0xb0'),'Contact.mobile');_0x5c4606[_0xefd2('0x42')](_0xefd2('0xb1'),'Contact.fax');_0x5c4606['field'](_0xefd2('0xb2'),_0xefd2('0xb3'));_0x5c4606[_0xefd2('0x42')](_0xefd2('0xb4'),'Owner.internal');_0x5c4606[_0xefd2('0x42')](_0xefd2('0xb5'),_0xefd2('0x22'));}if(_0x1d3204[_0xefd2('0x15')])_0x5c4606[_0xefd2('0x15')](_0x1d3204[_0xefd2('0x15')]);if(_0x1d3204[_0xefd2('0x13')])_0x5c4606[_0xefd2('0x13')](_0x1d3204[_0xefd2('0x13')]);return db['sequelize'][_0xefd2('0x39')](_0x5c4606[_0xefd2('0x93')](),_0x3695a6);})[_0xefd2('0x1a')](function(_0x489241){if(_0x489241[_0xefd2('0x63')]>0x0)_0x1b85dd[_0xefd2('0x40')]('ui.MailInteractionId\x20IN\x20?',_[_0xefd2('0x20')](_0x489241,'id'));return db['sequelize'][_0xefd2('0x39')](_0x1b85dd[_0xefd2('0x93')](),_0x3695a6)[_0xefd2('0x1a')](function(_0x384876){var _0x3f772c=_[_0xefd2('0xb6')](_0x384876,'MailInteractionId');var _0x4a1fa2=[];return db[_0xefd2('0xb7')]['findOne']({'attributes':[_0xefd2('0xb8')],'raw':!![]})['then'](function(_0x2dbc2f){var _0x100575=_0x2dbc2f[_0xefd2('0xb8')];_0x489241[_0xefd2('0x24')](function(_0x43b751){_0x4a1fa2['push'](updateMailInteraction(_0x43b751,_0x4fad61,_0x3f772c,_0x100575));});return BPromise['all'](_0x4a1fa2);});});});})[_0xefd2('0x1a')](function(_0x507b30){_0x16612d[_0xefd2('0xb9')]=_0x507b30;return _0x16612d;})[_0xefd2('0x1a')](respondWithFilteredResult(_0x2f0ba9,_0x1d3204))[_0xefd2('0x2d')](handleError(_0x2f0ba9,null));};exports[_0xefd2('0xba')]=function(_0x3e101a,_0x46fdc9){var _0xfbac4b={'raw':![],'where':{'id':_0x3e101a[_0xefd2('0xbb')]['id']}},_0x276bc2={};_0x276bc2[_0xefd2('0x38')]=_['keys'](db['MailInteraction'][_0xefd2('0xbc')]);_0x276bc2[_0xefd2('0x39')]=_[_0xefd2('0x6f')](_0x3e101a['query']);_0x276bc2['filters']=_[_0xefd2('0x3b')](_0x276bc2[_0xefd2('0x38')],_0x276bc2[_0xefd2('0x39')]);_0xfbac4b['attributes']=_[_0xefd2('0x3b')](_0x276bc2[_0xefd2('0x38')],qs[_0xefd2('0x3c')](_0x3e101a['query'][_0xefd2('0x3c')]));_0xfbac4b[_0xefd2('0x3d')]=_0xfbac4b['attributes'][_0xefd2('0x63')]?_0xfbac4b['attributes']:_0x276bc2[_0xefd2('0x38')];if(_0x3e101a[_0xefd2('0x39')]['includeAll']){_0xfbac4b[_0xefd2('0xbd')]=[{'all':!![]}];}_0xfbac4b=_[_0xefd2('0x95')]({},_0xfbac4b,_0x3e101a[_0xefd2('0xbe')]);return db['MailInteraction'][_0xefd2('0x59')](_0xfbac4b)['then'](handleEntityNotFound(_0x46fdc9,null))['then'](respondWithResult(_0x46fdc9,null))[_0xefd2('0x2d')](handleError(_0x46fdc9,null));};exports[_0xefd2('0xbf')]=function(_0x45c4cf,_0x5417c9){return db['MailInteraction'][_0xefd2('0xbf')](_0x45c4cf[_0xefd2('0xc0')],{})[_0xefd2('0x1a')](respondWithResult(_0x5417c9,0xc9))[_0xefd2('0x2d')](handleError(_0x5417c9,null));};exports['update']=function(_0x28a0e2,_0x531a61){if(_0x28a0e2['body']['id']){delete _0x28a0e2[_0xefd2('0xc0')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x28a0e2[_0xefd2('0xbb')]['id']}})['then'](handleEntityNotFound(_0x531a61,null))[_0xefd2('0x1a')](saveUpdates(_0x28a0e2[_0xefd2('0xc0')],null))[_0xefd2('0x1a')](respondWithResult(_0x531a61,null))[_0xefd2('0x2d')](handleError(_0x531a61,null));};exports[_0xefd2('0x1b')]=function(_0x7dc059,_0x1ee6e4){return db[_0xefd2('0x36')][_0xefd2('0x59')]({'where':{'id':_0x7dc059[_0xefd2('0xbb')]['id']}})[_0xefd2('0x1a')](handleEntityNotFound(_0x1ee6e4,null))['then'](removeEntity(_0x1ee6e4,null))[_0xefd2('0x2d')](handleError(_0x1ee6e4,null));};exports[_0xefd2('0xc1')]=function(_0x142fdb,_0x5cea58){return db[_0xefd2('0x36')][_0xefd2('0xc1')]()[_0xefd2('0x1a')](respondWithResult(_0x5cea58,null))[_0xefd2('0x2d')](handleError(_0x5cea58,null));};exports[_0xefd2('0xc2')]=function(_0x578c48,_0x274526){return db['MailMessage'][_0xefd2('0x59')]({'where':{'id':_0x578c48['params']['id']}})[_0xefd2('0x1a')](handleEntityNotFound(_0x274526,null))['then'](function(_0x37b787){if(_0x37b787){return _0x37b787[_0xefd2('0xc2')](_0x578c48['body']['ids'],_[_0xefd2('0xc3')](_0x578c48[_0xefd2('0xc0')],[_0xefd2('0xc4'),'id'])||{});}})[_0xefd2('0x1a')](respondWithResult(_0x274526,null))['catch'](handleError(_0x274526,null));};exports[_0xefd2('0xc5')]=function(_0x353402,_0x596da4){var _0x5bf641={'raw':![],'where':{}};var _0x5a24eb={};var _0x38506a={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x353402[_0xefd2('0xbb')]['id']}})[_0xefd2('0x1a')](handleEntityNotFound(_0x596da4,null))[_0xefd2('0x1a')](function(_0xeddb71){if(_0xeddb71){_0x5a24eb[_0xefd2('0x38')]=_['keys'](db[_0xefd2('0x26')][_0xefd2('0xbc')]);_0x5a24eb[_0xefd2('0x39')]=_[_0xefd2('0x6f')](_0x353402[_0xefd2('0x39')]);_0x5a24eb[_0xefd2('0x3a')]=_[_0xefd2('0x3b')](_0x5a24eb[_0xefd2('0x38')],_0x5a24eb[_0xefd2('0x39')]);_0x5bf641['attributes']=_['intersection'](_0x5a24eb[_0xefd2('0x38')],qs[_0xefd2('0x3c')](_0x353402['query'][_0xefd2('0x3c')]));_0x5bf641[_0xefd2('0x3d')]=_0x5bf641['attributes'][_0xefd2('0x63')]?_0x5bf641[_0xefd2('0x3d')]:_0x5a24eb[_0xefd2('0x38')];if(!_0x353402[_0xefd2('0x39')]['hasOwnProperty'](_0xefd2('0xc6'))){_0x5bf641[_0xefd2('0x15')]=qs['limit'](_0x353402[_0xefd2('0x39')][_0xefd2('0x15')]);_0x5bf641[_0xefd2('0x13')]=qs[_0xefd2('0x13')](_0x353402[_0xefd2('0x39')]['offset']);}_0x5bf641[_0xefd2('0x3e')]=qs[_0xefd2('0x3f')](_0x353402[_0xefd2('0x39')][_0xefd2('0x3f')]);_0x5bf641[_0xefd2('0x40')]=qs[_0xefd2('0x3a')](_['pick'](_0x353402[_0xefd2('0x39')],_0x5a24eb[_0xefd2('0x3a')]));_0x5bf641[_0xefd2('0x40')][_0xefd2('0xc7')]=_0xeddb71['id'];if(_0x353402['query']['filter']){_0x5bf641[_0xefd2('0x40')]=_[_0xefd2('0x95')](_0x5bf641[_0xefd2('0x40')],{'$or':_[_0xefd2('0x20')](_0x5bf641[_0xefd2('0x3d')],function(_0x149ef4){var _0x5c2a2e={};_0x5c2a2e[_0x149ef4]={'$like':'%'+_0x353402[_0xefd2('0x39')]['filter']+'%'};return _0x5c2a2e;})});}if(_0x353402[_0xefd2('0x39')][_0xefd2('0x77')]){var _0x21a673=_0x353402[_0xefd2('0x39')]['$gte'][_0xefd2('0x62')](',');var _0x59daa3={};_0x59daa3[_0x21a673[0x0]]={'$gte':moment(_0x21a673[0x1])[_0xefd2('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5bf641[_0xefd2('0x40')]=_['merge'](_0x5bf641[_0xefd2('0x40')],_0x59daa3);}_0x5bf641=_[_0xefd2('0x95')]({},_0x5bf641,_0x353402[_0xefd2('0xbe')]);return db[_0xefd2('0x26')]['count']({'where':_0x5bf641[_0xefd2('0x40')]})[_0xefd2('0x1a')](function(_0x3c0e74){_0x38506a[_0xefd2('0x16')]=_0x3c0e74;if(_0x353402[_0xefd2('0x39')][_0xefd2('0xc9')]){_0x5bf641[_0xefd2('0xbd')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x5bf641);})[_0xefd2('0x1a')](function(_0x4e3673){if(_0x353402[_0xefd2('0x39')][_0xefd2('0xca')]==='true'){for(var _0x418c65=0x0;_0x418c65<_0x4e3673[_0xefd2('0x63')];_0x418c65++){_0x4e3673[_0x418c65][_0xefd2('0xc0')]=juice(_0x4e3673[_0x418c65][_0xefd2('0xc0')]);}}_0x38506a[_0xefd2('0xb9')]=_0x4e3673;return _0x38506a;});}})[_0xefd2('0x1a')](respondWithFilteredResult(_0x596da4,_0x5bf641))[_0xefd2('0x2d')](handleError(_0x596da4,null));};exports[_0xefd2('0xcb')]=function(_0xd0e8d9,_0x2ada37){return db[_0xefd2('0x36')][_0xefd2('0x59')]({'where':{'id':_0xd0e8d9[_0xefd2('0xbb')]['id']}})['then'](handleEntityNotFound(_0x2ada37,null))[_0xefd2('0x1a')](function(_0xc348e6){if(_0xc348e6){return _0xc348e6['setTags'](_0xd0e8d9['body']['ids'],_[_0xefd2('0xc3')](_0xd0e8d9[_0xefd2('0xc0')],[_0xefd2('0xc4'),'id'])||{})[_0xefd2('0xcc')](function(){return db['Tag'][_0xefd2('0xcd')]({'attributes':['id',_0xefd2('0x1d'),_0xefd2('0x43')],'where':{'id':_0xd0e8d9[_0xefd2('0xc0')][_0xefd2('0xc4')]}});})[_0xefd2('0x1a')](function(_0x30b664){socket[_0xefd2('0xce')]('mailInteractionTags:save',{'id':Number(_0xd0e8d9[_0xefd2('0xbb')]['id']),'tags':_0x30b664||[]});return{'id':Number(_0xd0e8d9[_0xefd2('0xbb')]['id']),'tags':_0x30b664||[]};});}})['then'](respondWithResult(_0x2ada37,null))[_0xefd2('0x2d')](handleError(_0x2ada37,null));};exports[_0xefd2('0xcf')]=function(_0x538d35,_0x331d68){return db[_0xefd2('0x36')][_0xefd2('0x59')]({'where':{'id':_0x538d35[_0xefd2('0xbb')]['id']}})[_0xefd2('0x1a')](handleEntityNotFound(_0x331d68,null))[_0xefd2('0x1a')](function(_0x377546){if(_0x377546){return _0x377546['removeTags'](_0x538d35[_0xefd2('0x39')][_0xefd2('0xc4')]);}})[_0xefd2('0x1a')](respondWithStatusCode(_0x331d68,null))[_0xefd2('0x2d')](handleError(_0x331d68,null));};exports[_0xefd2('0xd0')]=function(_0x58ece7,_0x2a6d7e){var _0x346951=moment()[_0xefd2('0xd1')]()[_0xefd2('0x93')]();var _0xbb8901=path[_0xefd2('0xd2')](config[_0xefd2('0xd3')],'server',_0xefd2('0xd4'),'tmp');var _0x1c8219=path['join'](config['root'],'server',_0xefd2('0xd4'),'attachments');var _0x384154=path[_0xefd2('0xd2')](_0xbb8901,_0x346951);var _0x33dd02=util['format'](_0xefd2('0xd5'),_0x58ece7['params']['id'],_0x346951);var _0x3e8496=path[_0xefd2('0xd2')](_0xbb8901,_0x33dd02);var _0x1daebb=[];if(_0x58ece7[_0xefd2('0x39')][_0xefd2('0xd6')]){_0x1daebb[_0xefd2('0x25')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x3f44e5=[{'model':db[_0xefd2('0x26')],'as':_0xefd2('0xd7'),'attributes':['id','body',_0xefd2('0x44'),'to','cc',_0xefd2('0xd8'),_0xefd2('0xd9'),_0xefd2('0x75')],'where':{'secret':![]},'order':qs[_0xefd2('0x3f')]('id'),'include':_0x1daebb}];return db['MailInteraction']['find']({'where':{'id':_0x58ece7[_0xefd2('0xbb')]['id']},'include':_0x3f44e5})['then'](handleEntityNotFound(_0x2a6d7e,null))[_0xefd2('0x1a')](function(_0x100d5c){if(_0x100d5c&&_0x100d5c[_0xefd2('0xd7')]){var _0x5133ca=_0x100d5c[_0xefd2('0xda')]({'plain':!![]});fs['mkdirSync'](_0x384154);return BPromise[_0xefd2('0xdb')](_0x5133ca[_0xefd2('0xd7')],function(_0x2eeac2,_0x510b75){var _0x2b767d={'from':_0x2eeac2[_0xefd2('0x44')],'to':_0x2eeac2['to'],'subject':_0x2eeac2[_0xefd2('0xd9')],'html':htmlEntities[_0xefd2('0xdc')](_0x2eeac2[_0xefd2('0xc0')]),'headers':{'Date':moment(_0x2eeac2[_0xefd2('0x75')])[_0xefd2('0xc8')](_0xefd2('0xdd'))},'attachments':[]};if(_0x2eeac2['cc']){_0x2b767d[_0xefd2('0xde')]['Cc']=_0x2eeac2['cc'];}if(_0x2eeac2[_0xefd2('0xd8')]){_0x2b767d[_0xefd2('0xde')][_0xefd2('0xdf')]=_0x2eeac2['bcc'];}return new BPromise(function(_0x29bf4e,_0x123d60){if(_0x2eeac2[_0xefd2('0xe0')]){for(var _0x287687=0x0;_0x287687<_0x2eeac2[_0xefd2('0xe0')][_0xefd2('0x63')];_0x287687++){var _0x8d0895=_0x2eeac2[_0xefd2('0xe0')][_0x287687];var _0x59e4f1=path[_0xefd2('0xd2')](_0x1c8219,_0x8d0895[_0xefd2('0xe1')]);if(fs[_0xefd2('0xe2')](_0x59e4f1)){_0x2b767d[_0xefd2('0xd6')][_0xefd2('0x25')]({'name':_0x8d0895[_0xefd2('0x1d')],'contentType':_0x8d0895['type'],'data':fs[_0xefd2('0xe3')](_0x59e4f1)});}}}emlformat[_0xefd2('0xe4')](_0x2b767d,function(_0x10f735,_0x5edf2c){if(_0x10f735)return _0x123d60(_0x10f735);fs['writeFileSync'](path[_0xefd2('0xd2')](_0x384154,util[_0xefd2('0xc8')](_0xefd2('0xe5'),_0x510b75)),_0x5edf2c);return _0x29bf4e(_0x5edf2c);});});})['then'](function(){return new BPromise(function(_0x29e797,_0x4dcad3){zipdir(_0x384154,{'saveTo':_0x3e8496},function(_0x5db277,_0x4761a1){if(_0x5db277)return _0x4dcad3(_0x5db277);return _0x29e797(_0x4761a1);});})[_0xefd2('0x1a')](function(){return new BPromise(function(_0x31b723,_0x49e993){rimraf(_0x384154,function(_0x22d92a){if(_0x22d92a)_0x49e993(_0x22d92a);return _0x31b723();});});})[_0xefd2('0x1a')](function(){return _0x2a6d7e[_0xefd2('0xd0')](_0x3e8496,_0x33dd02,function(_0x82b45e){if(!_0x82b45e)fs[_0xefd2('0xe6')](_0x3e8496);});});});}else{return _0x2a6d7e[_0xefd2('0xf')](0xc8);}})['catch'](handleError(_0x2a6d7e,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index ad677b6..485bb6f 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 _0x97ba=['findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','update','remove','then','setDataValue','map'];(function(_0x17e771,_0x55fd17){var _0x1f3a6d=function(_0x346ee3){while(--_0x346ee3){_0x17e771['push'](_0x17e771['shift']());}};_0x1f3a6d(++_0x55fd17);}(_0x97ba,0x177));var _0xa97b=function(_0x4988a1,_0x276ecd){_0x4988a1=_0x4988a1-0x0;var _0x1f893c=_0x97ba[_0x4988a1];return _0x1f893c;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xa97b('0x0'))['db'][_0xa97b('0x1')];var MailMessage=require(_0xa97b('0x0'))['db'][_0xa97b('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xa97b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa97b('0x4'),'afterDestroy':_0xa97b('0x5')};function emitEvent(_0x24fbcd){return function(_0x40e9a1,_0x567c05,_0x3c8f13){_0x40e9a1['getUsers']({'attributes':['id'],'raw':!![]})[_0xa97b('0x6')](function(_0x1500d2){_0x40e9a1[_0xa97b('0x7')]('Users',_0x1500d2[_0xa97b('0x8')](function(_0x2e79d7){return{'id':_0x2e79d7['id']};}));return MailMessage[_0xa97b('0x9')]({'where':{'MailInteractionId':_0x40e9a1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa97b('0x6')](function(_0x3651fe){_0x40e9a1[_0xa97b('0x7')](_0xa97b('0xa'),_0x3651fe[_0xa97b('0xb')]);MailInteractionEvents[_0xa97b('0xc')](_0x24fbcd+':'+_0x40e9a1['id'],_0x40e9a1);MailInteractionEvents[_0xa97b('0xc')](_0x24fbcd,_0x40e9a1);_0x3c8f13(null);})['catch'](_0x3c8f13(null));};}for(var e in events){if(events[_0xa97b('0xd')](e)){var event=events[e];MailInteraction[_0xa97b('0xe')](e,emitEvent(event));}}module[_0xa97b('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x2ef7=['hasOwnProperty','hook','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit'];(function(_0x593752,_0xfc3827){var _0x4612be=function(_0x2d64c6){while(--_0x2d64c6){_0x593752['push'](_0x593752['shift']());}};_0x4612be(++_0xfc3827);}(_0x2ef7,0x182));var _0x72ef=function(_0x2dc387,_0x506fe8){_0x2dc387=_0x2dc387-0x0;var _0x4f48ef=_0x2ef7[_0x2dc387];return _0x4f48ef;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x72ef('0x0'))['db'][_0x72ef('0x1')];var MailMessage=require(_0x72ef('0x0'))['db'][_0x72ef('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x72ef('0x3')](0x0);var events={'afterCreate':_0x72ef('0x4'),'afterUpdate':'update','afterDestroy':_0x72ef('0x5')};function emitEvent(_0xc1d7fb){return function(_0x4cbb25,_0x341891,_0x57c607){_0x4cbb25[_0x72ef('0x6')]({'attributes':['id'],'raw':!![]})[_0x72ef('0x7')](function(_0x23b63f){_0x4cbb25[_0x72ef('0x8')](_0x72ef('0x9'),_0x23b63f[_0x72ef('0xa')](function(_0x1c8c51){return{'id':_0x1c8c51['id']};}));return MailMessage[_0x72ef('0xb')]({'where':{'MailInteractionId':_0x4cbb25['id'],'direction':'in','read':![]},'raw':!![]});})[_0x72ef('0x7')](function(_0x172e19){_0x4cbb25[_0x72ef('0x8')]('unreadMessages',_0x172e19[_0x72ef('0xc')]);MailInteractionEvents[_0x72ef('0xd')](_0xc1d7fb+':'+_0x4cbb25['id'],_0x4cbb25);MailInteractionEvents[_0x72ef('0xd')](_0xc1d7fb,_0x4cbb25);_0x57c607(null);})['catch'](_0x57c607(null));};}for(var e in events){if(events[_0x72ef('0xe')](e)){var event=events[e];MailInteraction[_0x72ef('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 1dd5c41..6fbf5bf 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 _0x8382=['closed','changed','substatus','closedAt','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1b8f3e,_0x3d1671){var _0x155551=function(_0x3e210c){while(--_0x3e210c){_0x1b8f3e['push'](_0x1b8f3e['shift']());}};_0x155551(++_0x3d1671);}(_0x8382,0xe3));var _0x2838=function(_0x4ce32c,_0x562a9e){_0x4ce32c=_0x4ce32c-0x0;var _0x5ceccb=_0x8382[_0x4ce32c];return _0x5ceccb;};'use strict';var _=require(_0x2838('0x0'));var util=require(_0x2838('0x1'));var logger=require('../../config/logger')(_0x2838('0x2'));var moment=require(_0x2838('0x3'));var BPromise=require(_0x2838('0x4'));var rp=require(_0x2838('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2838('0x6'));var config=require(_0x2838('0x7'));var attributes=require(_0x2838('0x8'));module['exports']=function(_0x464b16,_0x4867c2){return _0x464b16[_0x2838('0x9')](_0x2838('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x2838('0xb'),'to'],'type':_0x2838('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x126687,_0x5cc32b,_0x4e17c6){if(_0x126687['substatus']){_0x126687[_0x2838('0xd')]=moment()[_0x2838('0xe')](_0x2838('0xf'));}if(_0x126687[_0x2838('0x10')]){_0x126687['closedAt']=moment()['format'](_0x2838('0xf'));}_0x4e17c6(null,_0x5cc32b);},'beforeUpdate':function(_0x58a1ba,_0x4bbff4,_0x3f6774){if(_0x58a1ba[_0x2838('0x11')](_0x2838('0x12'))){_0x58a1ba[_0x2838('0xd')]=_0x58a1ba[_0x2838('0x12')]?moment()[_0x2838('0xe')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x58a1ba['changed'](_0x2838('0x10'))){_0x58a1ba[_0x2838('0x13')]=moment()['format'](_0x2838('0xf'));_0x58a1ba[_0x2838('0x12')]=null;_0x58a1ba[_0x2838('0xd')]=null;}_0x3f6774(null,_0x58a1ba);},'afterUpdate':function(_0x4075f1,_0x28fc9c,_0x4cb364){var _0x1ce722=_0x464b16['models'];var _0x206f97=_0x4075f1[_0x2838('0x14')]({'plain':!![]});if(_0x206f97[_0x2838('0x10')]){return _0x1ce722[_0x2838('0x15')][_0x2838('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x206f97['id']}})[_0x2838('0x17')](function(){_0x4cb364();})[_0x2838('0x18')](function(_0x47a45d){_0x4cb364(_0x47a45d);});}else{_0x4cb364();}}},'charset':_0x2838('0x19'),'collate':_0x2838('0x1a')});}; \ No newline at end of file +var _0x3894=['../../config/environment','./mailInteraction.attributes','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then','catch','utf8mb4','lodash','util','../../config/logger','api','path'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x3894,0x1db));var _0x4389=function(_0x26393b,_0x449a84){_0x26393b=_0x26393b-0x0;var _0x57230a=_0x3894[_0x26393b];return _0x57230a;};'use strict';var _=require(_0x4389('0x0'));var util=require(_0x4389('0x1'));var logger=require(_0x4389('0x2'))(_0x4389('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4389('0x4'));var rimraf=require('rimraf');var config=require(_0x4389('0x5'));var attributes=require(_0x4389('0x6'));module['exports']=function(_0x53d3c1,_0x63d44c){return _0x53d3c1['define']('MailInteraction',attributes,{'tableName':_0x4389('0x7'),'paranoid':![],'indexes':[{'name':_0x4389('0x8'),'fields':[_0x4389('0x9'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3ad304,_0x1a170b,_0x15ab84){if(_0x3ad304[_0x4389('0xa')]){_0x3ad304[_0x4389('0xb')]=moment()[_0x4389('0xc')](_0x4389('0xd'));}if(_0x3ad304[_0x4389('0xe')]){_0x3ad304[_0x4389('0xf')]=moment()[_0x4389('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x15ab84(null,_0x1a170b);},'beforeUpdate':function(_0x2472ed,_0x396df2,_0x4ae8fb){if(_0x2472ed['changed'](_0x4389('0xa'))){_0x2472ed[_0x4389('0xb')]=_0x2472ed['substatus']?moment()['format'](_0x4389('0xd')):null;}if(_0x2472ed[_0x4389('0x10')](_0x4389('0xe'))){_0x2472ed[_0x4389('0xf')]=moment()[_0x4389('0xc')]('YYYY-MM-DD\x20HH:mm:ss');_0x2472ed['substatus']=null;_0x2472ed[_0x4389('0xb')]=null;}_0x4ae8fb(null,_0x2472ed);},'afterUpdate':function(_0x588391,_0x19f017,_0xee5d7f){var _0x2701bd=_0x53d3c1[_0x4389('0x11')];var _0x19c312=_0x588391[_0x4389('0x12')]({'plain':!![]});if(_0x19c312[_0x4389('0xe')]){return _0x2701bd[_0x4389('0x13')][_0x4389('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x19c312['id']}})[_0x4389('0x15')](function(){_0xee5d7f();})[_0x4389('0x16')](function(_0x138f7c){_0xee5d7f(_0x138f7c);});}else{_0xee5d7f();}}},'charset':_0x4389('0x17'),'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 1e0e7f8..3241675 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 _0xed52=['request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','MailInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateMailInteraction','MailInteraction','body','options','where','attributes','limit','then','find','addTags','ids','omit','spread','AddTags','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','socket.io-emitter','./mailInteraction.socket','register','request'];(function(_0x53a681,_0x485698){var _0x25bf0f=function(_0x436efe){while(--_0x436efe){_0x53a681['push'](_0x53a681['shift']());}};_0x25bf0f(++_0x485698);}(_0xed52,0x16e));var _0x2ed5=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xed52[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0x2ed5('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2ed5('0x1'));var fs=require('fs');var Redis=require(_0x2ed5('0x2'));var db=require(_0x2ed5('0x3'))['db'];var utils=require(_0x2ed5('0x4'));var logger=require(_0x2ed5('0x5'))(_0x2ed5('0x6'));var config=require(_0x2ed5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2ed5('0x8')]['http']({'port':0x232a});config[_0x2ed5('0x9')]=_['defaults'](config[_0x2ed5('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ed5('0xa'))(new Redis(config[_0x2ed5('0x9')]));require(_0x2ed5('0xb'))[_0x2ed5('0xc')](socket);function respondWithRpcPromise(_0x426cc8,_0xe794c5,_0x58bd49){return new BPromise(function(_0x1556eb,_0x2ebbd5){return client[_0x2ed5('0xd')](_0x426cc8,_0x58bd49)['then'](function(_0x52af8b){logger['info']('MailInteraction,\x20%s,\x20%s',_0xe794c5,_0x2ed5('0xe'));logger[_0x2ed5('0xf')](_0x2ed5('0x10'),_0xe794c5,_0x2ed5('0xe'),JSON[_0x2ed5('0x11')](_0x52af8b));if(_0x52af8b[_0x2ed5('0x12')]){if(_0x52af8b[_0x2ed5('0x12')]['code']===0x1f4){logger[_0x2ed5('0x12')](_0x2ed5('0x13'),_0xe794c5,_0x52af8b[_0x2ed5('0x12')][_0x2ed5('0x14')]);return _0x2ebbd5(_0x52af8b[_0x2ed5('0x12')][_0x2ed5('0x14')]);}logger[_0x2ed5('0x12')](_0x2ed5('0x13'),_0xe794c5,_0x52af8b[_0x2ed5('0x12')][_0x2ed5('0x14')]);return _0x1556eb(_0x52af8b[_0x2ed5('0x12')]['message']);}else{logger[_0x2ed5('0x15')](_0x2ed5('0x13'),_0xe794c5,_0x2ed5('0xe'));_0x1556eb(_0x52af8b[_0x2ed5('0x16')][_0x2ed5('0x14')]);}})[_0x2ed5('0x17')](function(_0x41b5df){logger[_0x2ed5('0x12')](_0x2ed5('0x13'),_0xe794c5,_0x41b5df);_0x2ebbd5(_0x41b5df);});});}exports[_0x2ed5('0x18')]=function(_0x1a7718){var _0x3479b7=this;return new Promise(function(_0x2342eb,_0x262c30){return db[_0x2ed5('0x19')]['update'](_0x1a7718[_0x2ed5('0x1a')],{'raw':_0x1a7718[_0x2ed5('0x1b')]?_0x1a7718[_0x2ed5('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a7718[_0x2ed5('0x1b')]?_0x1a7718[_0x2ed5('0x1b')][_0x2ed5('0x1c')]||null:null,'attributes':_0x1a7718['options']?_0x1a7718['options'][_0x2ed5('0x1d')]||null:null,'limit':_0x1a7718['options']?_0x1a7718['options'][_0x2ed5('0x1e')]||null:null})[_0x2ed5('0x1f')](function(_0x16ed90){logger[_0x2ed5('0x15')]('UpdateMailInteraction',_0x1a7718);logger['debug'](_0x2ed5('0x18'),_0x1a7718,JSON[_0x2ed5('0x11')](_0x16ed90));_0x2342eb(_0x16ed90);})[_0x2ed5('0x17')](function(_0xa14624){logger[_0x2ed5('0x12')](_0x2ed5('0x18'),_0xa14624[_0x2ed5('0x14')],_0x1a7718);_0x262c30(_0x3479b7[_0x2ed5('0x12')](0x1f4,_0xa14624['message']));});});};exports['AddTagsToMailInteraction']=function(_0x57002f){return new Promise(function(_0x49ddbc,_0x506fbf){return db[_0x2ed5('0x19')][_0x2ed5('0x20')]({'where':_0x57002f[_0x2ed5('0x1b')]?_0x57002f['options']['where']||null:null})[_0x2ed5('0x1f')](function(_0x2f5816){if(_0x2f5816){return _0x2f5816[_0x2ed5('0x21')](_0x57002f[_0x2ed5('0x1a')][_0x2ed5('0x22')],_[_0x2ed5('0x23')](_0x57002f[_0x2ed5('0x1a')],[_0x2ed5('0x22'),'id'])||{});}})[_0x2ed5('0x24')](function(_0xce9699){logger['info'](_0x2ed5('0x25'),_0x57002f);logger['debug'](_0x2ed5('0x25'),_0x57002f,JSON['stringify'](_0xce9699));_0x49ddbc(_0xce9699);})[_0x2ed5('0x17')](function(_0x863618){logger[_0x2ed5('0x12')](_0x2ed5('0x25'),_0x863618[_0x2ed5('0x14')],_0x57002f);_0x506fbf(_this[_0x2ed5('0x12')](0x1f4,_0x863618[_0x2ed5('0x14')]));});});}; \ No newline at end of file +var _0x22ed=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','raw','where','attributes','limit','info','UpdateMailInteraction','AddTagsToMailInteraction','MailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x50fb3f,_0x4724f4){var _0x1ce4c3=function(_0x2cb60b){while(--_0x2cb60b){_0x50fb3f['push'](_0x50fb3f['shift']());}};_0x1ce4c3(++_0x4724f4);}(_0x22ed,0x1a9));var _0xd22e=function(_0x26ffd4,_0x46cf5b){_0x26ffd4=_0x26ffd4-0x0;var _0x5a38a8=_0x22ed[_0x26ffd4];return _0x5a38a8;};'use strict';var _=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var moment=require(_0xd22e('0x2'));var BPromise=require(_0xd22e('0x3'));var rs=require(_0xd22e('0x4'));var fs=require('fs');var Redis=require(_0xd22e('0x5'));var db=require(_0xd22e('0x6'))['db'];var utils=require(_0xd22e('0x7'));var logger=require(_0xd22e('0x8'))(_0xd22e('0x9'));var config=require(_0xd22e('0xa'));var jayson=require(_0xd22e('0xb'));var client=jayson['client'][_0xd22e('0xc')]({'port':0x232a});config[_0xd22e('0xd')]=_['defaults'](config[_0xd22e('0xd')],{'host':_0xd22e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd22e('0xd')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0xb51f40,_0x57630d,_0x4bd798){return new BPromise(function(_0x54c27d,_0x15ad97){return client[_0xd22e('0xf')](_0xb51f40,_0x4bd798)[_0xd22e('0x10')](function(_0x1c57a9){logger['info'](_0xd22e('0x11'),_0x57630d,_0xd22e('0x12'));logger[_0xd22e('0x13')](_0xd22e('0x14'),_0x57630d,_0xd22e('0x12'),JSON[_0xd22e('0x15')](_0x1c57a9));if(_0x1c57a9['error']){if(_0x1c57a9[_0xd22e('0x16')][_0xd22e('0x17')]===0x1f4){logger[_0xd22e('0x16')]('MailInteraction,\x20%s,\x20%s',_0x57630d,_0x1c57a9[_0xd22e('0x16')]['message']);return _0x15ad97(_0x1c57a9[_0xd22e('0x16')][_0xd22e('0x18')]);}logger[_0xd22e('0x16')](_0xd22e('0x11'),_0x57630d,_0x1c57a9[_0xd22e('0x16')][_0xd22e('0x18')]);return _0x54c27d(_0x1c57a9[_0xd22e('0x16')][_0xd22e('0x18')]);}else{logger['info'](_0xd22e('0x11'),_0x57630d,_0xd22e('0x12'));_0x54c27d(_0x1c57a9[_0xd22e('0x19')][_0xd22e('0x18')]);}})[_0xd22e('0x1a')](function(_0x2ccd36){logger['error'](_0xd22e('0x11'),_0x57630d,_0x2ccd36);_0x15ad97(_0x2ccd36);});});}exports['UpdateMailInteraction']=function(_0x3a840c){var _0x4d70b6=this;return new Promise(function(_0x5898d1,_0x198189){return db['MailInteraction']['update'](_0x3a840c[_0xd22e('0x1b')],{'raw':_0x3a840c[_0xd22e('0x1c')]?_0x3a840c[_0xd22e('0x1c')][_0xd22e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a840c['options']?_0x3a840c[_0xd22e('0x1c')][_0xd22e('0x1e')]||null:null,'attributes':_0x3a840c[_0xd22e('0x1c')]?_0x3a840c['options'][_0xd22e('0x1f')]||null:null,'limit':_0x3a840c[_0xd22e('0x1c')]?_0x3a840c[_0xd22e('0x1c')][_0xd22e('0x20')]||null:null})['then'](function(_0x54058a){logger[_0xd22e('0x21')](_0xd22e('0x22'),_0x3a840c);logger[_0xd22e('0x13')](_0xd22e('0x22'),_0x3a840c,JSON[_0xd22e('0x15')](_0x54058a));_0x5898d1(_0x54058a);})[_0xd22e('0x1a')](function(_0x4b7ed5){logger[_0xd22e('0x16')](_0xd22e('0x22'),_0x4b7ed5[_0xd22e('0x18')],_0x3a840c);_0x198189(_0x4d70b6[_0xd22e('0x16')](0x1f4,_0x4b7ed5[_0xd22e('0x18')]));});});};exports[_0xd22e('0x23')]=function(_0x1ea198){return new Promise(function(_0x4b9424,_0x59bc61){return db[_0xd22e('0x24')][_0xd22e('0x25')]({'where':_0x1ea198[_0xd22e('0x1c')]?_0x1ea198[_0xd22e('0x1c')]['where']||null:null})['then'](function(_0x14c636){if(_0x14c636){return _0x14c636[_0xd22e('0x26')](_0x1ea198[_0xd22e('0x1b')][_0xd22e('0x27')],_[_0xd22e('0x28')](_0x1ea198[_0xd22e('0x1b')],['ids','id'])||{});}})[_0xd22e('0x29')](function(_0x510c90){logger['info']('AddTags',_0x1ea198);logger[_0xd22e('0x13')](_0xd22e('0x2a'),_0x1ea198,JSON[_0xd22e('0x15')](_0x510c90));_0x4b9424(_0x510c90);})[_0xd22e('0x1a')](function(_0x471a0d){logger[_0xd22e('0x16')]('AddTags',_0x471a0d['message'],_0x1ea198);_0x59bc61(_this[_0xd22e('0x16')](0x1f4,_0x471a0d[_0xd22e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 5f5334c..0fb2988 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 _0x8a96=['removeListener','register','length','mailInteraction:','save','remove','update','emit'];(function(_0xb5926,_0x4f9421){var _0xe70368=function(_0x3abdd3){while(--_0x3abdd3){_0xb5926['push'](_0xb5926['shift']());}};_0xe70368(++_0x4f9421);}(_0x8a96,0x1ec));var _0x68a9=function(_0x433fed,_0x118d04){_0x433fed=_0x433fed-0x0;var _0x134cfa=_0x8a96[_0x433fed];return _0x134cfa;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x68a9('0x0'),_0x68a9('0x1'),_0x68a9('0x2')];function createListener(_0x485f2a,_0x18d153){return function(_0x21bdc5){_0x18d153[_0x68a9('0x3')](_0x485f2a,_0x21bdc5);};}function removeListener(_0x486b0b,_0x4a85ed){return function(){MailInteractionEvents[_0x68a9('0x4')](_0x486b0b,_0x4a85ed);};}exports[_0x68a9('0x5')]=function(_0x5255b0){for(var _0x22b74d=0x0,_0x41345d=events[_0x68a9('0x6')];_0x22b74d<_0x41345d;_0x22b74d++){var _0x315967=events[_0x22b74d];var _0x2d6501=createListener(_0x68a9('0x7')+_0x315967,_0x5255b0);MailInteractionEvents['on'](_0x315967,_0x2d6501);}}; \ No newline at end of file +var _0x0acb=['remove','update','emit','removeListener','register','./mailInteraction.events','save'];(function(_0x17f124,_0x4e8a1b){var _0x248f97=function(_0x4e84b1){while(--_0x4e84b1){_0x17f124['push'](_0x17f124['shift']());}};_0x248f97(++_0x4e8a1b);}(_0x0acb,0x8a));var _0xb0ac=function(_0x415dec,_0x132ffb){_0x415dec=_0x415dec-0x0;var _0x40d4e9=_0x0acb[_0x415dec];return _0x40d4e9;};'use strict';var MailInteractionEvents=require(_0xb0ac('0x0'));var events=[_0xb0ac('0x1'),_0xb0ac('0x2'),_0xb0ac('0x3')];function createListener(_0x2cc2c0,_0x23331d){return function(_0x5eea53){_0x23331d[_0xb0ac('0x4')](_0x2cc2c0,_0x5eea53);};}function removeListener(_0x5b9ce1,_0x4612fb){return function(){MailInteractionEvents[_0xb0ac('0x5')](_0x5b9ce1,_0x4612fb);};}exports[_0xb0ac('0x6')]=function(_0x28ff4c){for(var _0x33dbf2=0x0,_0x30ddc9=events['length'];_0x33dbf2<_0x30ddc9;_0x33dbf2++){var _0x4eeafd=events[_0x33dbf2];var _0x19a800=createListener('mailInteraction:'+_0x4eeafd,_0x28ff4c);MailInteractionEvents['on'](_0x4eeafd,_0x19a800);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index f9dfe44..21c3886 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 _0xe844=['get','/describe','describe','/:id','/:id/download','download','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index'];(function(_0xc1bb8b,_0x14e049){var _0x50c6f8=function(_0x50d20c){while(--_0x50d20c){_0xc1bb8b['push'](_0xc1bb8b['shift']());}};_0x50c6f8(++_0x14e049);}(_0xe844,0xba));var _0x4e84=function(_0x137d0c,_0xdd8c00){_0x137d0c=_0x137d0c-0x0;var _0x2fc444=_0xe844[_0x137d0c];return _0x2fc444;};'use strict';var multer=require(_0x4e84('0x0'));var util=require(_0x4e84('0x1'));var path=require(_0x4e84('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e84('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4e84('0x4'));var interaction=require(_0x4e84('0x5'));var config=require(_0x4e84('0x6'));var controller=require(_0x4e84('0x7'));router['get']('/',auth[_0x4e84('0x8')](),controller[_0x4e84('0x9')]);router[_0x4e84('0xa')](_0x4e84('0xb'),auth[_0x4e84('0x8')](),controller[_0x4e84('0xc')]);router[_0x4e84('0xa')](_0x4e84('0xd'),auth[_0x4e84('0x8')](),controller['show']);router[_0x4e84('0xa')](_0x4e84('0xe'),auth[_0x4e84('0x8')](),controller[_0x4e84('0xf')]);router['post']('/',auth[_0x4e84('0x8')](),interaction[_0x4e84('0x10')](_0x4e84('0x11'),_0x4e84('0x12')),controller[_0x4e84('0x13')]);router[_0x4e84('0x14')]('/:id',auth[_0x4e84('0x8')](),controller[_0x4e84('0x15')]);router[_0x4e84('0x14')](_0x4e84('0x16'),auth[_0x4e84('0x8')](),controller[_0x4e84('0x17')]);router[_0x4e84('0x14')](_0x4e84('0x18'),auth[_0x4e84('0x8')](),controller['reject']);router[_0x4e84('0x19')]('/:id',auth[_0x4e84('0x8')](),controller[_0x4e84('0x1a')]);module[_0x4e84('0x1b')]=router; \ No newline at end of file +var _0xa9cd=['show','/:id/download','download','post','mail','mailmessage:create','update','put','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/:id'];(function(_0x34a818,_0x1d288a){var _0x5f480f=function(_0x554f41){while(--_0x554f41){_0x34a818['push'](_0x34a818['shift']());}};_0x5f480f(++_0x1d288a);}(_0xa9cd,0x187));var _0xda9c=function(_0x1befa2,_0x732d85){_0x1befa2=_0x1befa2-0x0;var _0x120c70=_0xa9cd[_0x1befa2];return _0x120c70;};'use strict';var multer=require(_0xda9c('0x0'));var util=require(_0xda9c('0x1'));var path=require(_0xda9c('0x2'));var timeout=require(_0xda9c('0x3'));var express=require(_0xda9c('0x4'));var router=express[_0xda9c('0x5')]();var fs_extra=require(_0xda9c('0x6'));var auth=require(_0xda9c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xda9c('0x8'));var controller=require(_0xda9c('0x9'));router[_0xda9c('0xa')]('/',auth[_0xda9c('0xb')](),controller[_0xda9c('0xc')]);router[_0xda9c('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xda9c('0xa')](_0xda9c('0xd'),auth[_0xda9c('0xb')](),controller[_0xda9c('0xe')]);router['get'](_0xda9c('0xf'),auth[_0xda9c('0xb')](),controller[_0xda9c('0x10')]);router[_0xda9c('0x11')]('/',auth[_0xda9c('0xb')](),interaction['tracked'](_0xda9c('0x12'),_0xda9c('0x13')),controller['create']);router['put'](_0xda9c('0xd'),auth[_0xda9c('0xb')](),controller[_0xda9c('0x14')]);router[_0xda9c('0x15')]('/:id/accept',auth[_0xda9c('0xb')](),controller['accept']);router['put'](_0xda9c('0x16'),auth[_0xda9c('0xb')](),controller[_0xda9c('0x17')]);router[_0xda9c('0x18')](_0xda9c('0xd'),auth['isAuthenticated'](),controller[_0xda9c('0x19')]);module[_0xda9c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 94dcbde..f54e503 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 _0x025b=['out','STRING','DATE','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM'];(function(_0x2ac2da,_0x13f6c5){var _0x1dada8=function(_0x16c529){while(--_0x16c529){_0x2ac2da['push'](_0x2ac2da['shift']());}};_0x1dada8(++_0x13f6c5);}(_0x025b,0x1c5));var _0xb025=function(_0x54aa9d,_0xdea630){_0x54aa9d=_0x54aa9d-0x0;var _0x21e4af=_0x025b[_0x54aa9d];return _0x21e4af;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb025('0x0'));module[_0xb025('0x1')]={'body':{'type':Sequelize[_0xb025('0x2')](_0xb025('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb025('0x2')](_0xb025('0x4'))},'read':{'type':Sequelize[_0xb025('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb025('0x6')]('in',_0xb025('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xb025('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xb025('0x2')](_0xb025('0x3'))},'cc':{'type':Sequelize['TEXT'](_0xb025('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0xb025('0x3'))},'subject':{'type':Sequelize[_0xb025('0x2')]},'sentAt':{'type':Sequelize[_0xb025('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb025('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xb025('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0xb025('0x3'))},'originCc':{'type':Sequelize[_0xb025('0x2')](_0xb025('0x3'))},'originChannel':{'type':Sequelize[_0xb025('0x6')]('Email','Chat'),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0xc7db=['DATE','INTEGER','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out'];(function(_0x328ab2,_0x4dfd97){var _0x5e8a9=function(_0x434654){while(--_0x434654){_0x328ab2['push'](_0x328ab2['shift']());}};_0x5e8a9(++_0x4dfd97);}(_0xc7db,0x197));var _0xbc7d=function(_0x548ac1,_0x27178f){_0x548ac1=_0x548ac1-0x0;var _0x89687b=_0xc7db[_0x548ac1];return _0x89687b;};'use strict';var Sequelize=require(_0xbc7d('0x0'));var _=require(_0xbc7d('0x1'));module[_0xbc7d('0x2')]={'body':{'type':Sequelize[_0xbc7d('0x3')](_0xbc7d('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbc7d('0x3')](_0xbc7d('0x5'))},'read':{'type':Sequelize[_0xbc7d('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbc7d('0x7')]('in',_0xbc7d('0x8')),'defaultValue':_0xbc7d('0x8'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xbc7d('0x3')](_0xbc7d('0x4'))},'cc':{'type':Sequelize[_0xbc7d('0x3')](_0xbc7d('0x4'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0xbc7d('0x3')]},'sentAt':{'type':Sequelize[_0xbc7d('0x9')]},'attach':{'type':Sequelize[_0xbc7d('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xbc7d('0x3')](_0xbc7d('0x4'))},'originCc':{'type':Sequelize['TEXT'](_0xbc7d('0x4'))},'originChannel':{'type':Sequelize[_0xbc7d('0x7')](_0xbc7d('0xb'),_0xbc7d('0xc')),'defaultValue':_0xbc7d('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 f03407e..8d85822 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 _0xff4e=['port','secure','authentication','user','pass','auth','attachments','join','root','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','agent','UserId','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','ContactId','sequelize','SELECT','contact','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','internal','motionChannel','reject','toString','server','files','tmp','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','writeFileSync','download','unlinkSync','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','json','limit','undefined','offset','count','status','set','sendStatus','name','send','map','MailMessage','fieldName','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','show','fields','length','include','update','find','params','destroy','describe','create','body','out','secret','split','MailAccount','MailAccountId','CmList','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','service','host'];(function(_0x41416e,_0x161a19){var _0xda0a3d=function(_0x162e46){while(--_0x162e46){_0x41416e['push'](_0x41416e['shift']());}};_0xda0a3d(++_0x161a19);}(_0xff4e,0xe0));var _0xeff4=function(_0x1b8a6c,_0x4c2a5f){_0x1b8a6c=_0x1b8a6c-0x0;var _0x13ec3b=_0xff4e[_0x1b8a6c];return _0x13ec3b;};'use strict';var emlformat=require('eml-format');var moment=require(_0xeff4('0x0'));var BPromise=require(_0xeff4('0x1'));var util=require(_0xeff4('0x2'));var path=require(_0xeff4('0x3'));var fs=require('fs');var _=require(_0xeff4('0x4'));var Redis=require(_0xeff4('0x5'));var htmlToText=require(_0xeff4('0x6'));var qs=require(_0xeff4('0x7'));var logger=require(_0xeff4('0x8'))('api');var interaction_log=require(_0xeff4('0x8'))(_0xeff4('0x9'));var config=require(_0xeff4('0xa'));var db=require(_0xeff4('0xb'))['db'];config[_0xeff4('0xc')]=_[_0xeff4('0xd')](config[_0xeff4('0xc')],{'host':_0xeff4('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeff4('0xc')]));var htmlEntities=require('html-entities');require(_0xeff4('0xf'))[_0xeff4('0x10')](socket);var jayson=require('jayson/promise');var client=jayson[_0xeff4('0x11')][_0xeff4('0x12')]({'port':0x232c});var client9003=jayson[_0xeff4('0x11')][_0xeff4('0x12')]({'port':0x232b});var client9002=jayson[_0xeff4('0x11')][_0xeff4('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x261209,_0x1b5f20,_0x1a4df9,_0x53a2f2){return new BPromise(function(_0x106180,_0x4c4996){var _0x4bbbc2=_0x53a2f2||client;return _0x4bbbc2[_0xeff4('0x13')](_0x261209,_0x1a4df9)[_0xeff4('0x14')](function(_0x54a24b){logger[_0xeff4('0x15')](_0xeff4('0x16'),_0x1b5f20,_0xeff4('0x17'));logger['debug'](_0xeff4('0x18'),_0x1b5f20,_0xeff4('0x17'),JSON[_0xeff4('0x19')](_0x54a24b));if(_0x54a24b[_0xeff4('0x1a')]){if(_0x54a24b['error']['code']===0x1f4){logger[_0xeff4('0x1a')](_0xeff4('0x16'),_0x1b5f20,_0x54a24b[_0xeff4('0x1a')][_0xeff4('0x1b')]);return _0x4c4996(_0x54a24b[_0xeff4('0x1a')][_0xeff4('0x1b')]);}logger[_0xeff4('0x1a')](_0xeff4('0x16'),_0x1b5f20,_0x54a24b['error'][_0xeff4('0x1b')]);return _0x106180(_0x54a24b[_0xeff4('0x1a')][_0xeff4('0x1b')]);}else{logger[_0xeff4('0x15')](_0xeff4('0x16'),_0x1b5f20,'request\x20sent');_0x106180(_0x54a24b['result'][_0xeff4('0x1b')]);}})[_0xeff4('0x1c')](function(_0x58a5df){logger[_0xeff4('0x1a')]('MailMessage,\x20%s,\x20%s',_0x1b5f20,_0x58a5df);_0x4c4996(_0x58a5df);});});}function respondWithResult(_0x1fabd7,_0x1d8a8a){_0x1d8a8a=_0x1d8a8a||0xc8;return function(_0x5ac2e2){if(_0x5ac2e2){return _0x1fabd7['status'](_0x1d8a8a)[_0xeff4('0x1d')](_0x5ac2e2);}};}function respondWithFilteredResult(_0x28ccb7,_0x420161){return function(_0x356398){if(_0x356398){var _0x48e13c=typeof _0x420161['offset']==='undefined'&&typeof _0x420161[_0xeff4('0x1e')]===_0xeff4('0x1f');var _0x1a1960=_0x356398['count'];var _0x225c77=_0x48e13c?0x0:_0x420161[_0xeff4('0x20')];var _0x32fbbf=_0x48e13c?_0x356398[_0xeff4('0x21')]:_0x420161[_0xeff4('0x20')]+_0x420161[_0xeff4('0x1e')];var _0x10541c;if(_0x32fbbf>=_0x1a1960){_0x32fbbf=_0x1a1960;_0x10541c=0xc8;}else{_0x10541c=0xce;}_0x28ccb7[_0xeff4('0x22')](_0x10541c);return _0x28ccb7[_0xeff4('0x23')]('Content-Range',_0x225c77+'-'+_0x32fbbf+'/'+_0x1a1960)[_0xeff4('0x1d')](_0x356398);}return null;};}function saveUpdates(_0x123f87){return function(_0x2a813b){if(_0x2a813b){return _0x2a813b['update'](_0x123f87)[_0xeff4('0x14')](function(_0x5434f2){return _0x5434f2;});}return null;};}function removeEntity(_0x54da36){return function(_0xa38875){if(_0xa38875){return _0xa38875['destroy']()[_0xeff4('0x14')](function(){_0x54da36[_0xeff4('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x452a8e){return function(_0x2752cc){if(!_0x2752cc){_0x452a8e[_0xeff4('0x24')](0x194);}return _0x2752cc;};}function handleError(_0x5c11d1,_0x54942f){_0x54942f=_0x54942f||0x1f4;return function(_0x361268){logger['error'](_0x361268['stack']);if(_0x361268[_0xeff4('0x25')]){delete _0x361268[_0xeff4('0x25')];}_0x5c11d1[_0xeff4('0x22')](_0x54942f)[_0xeff4('0x26')](_0x361268);};}exports['index']=function(_0x54d072,_0x385c13){var _0xff6bb0={},_0x3565e8={},_0x2d6d3f={'count':0x0,'rows':[]};var _0x2556ff=_[_0xeff4('0x27')](db[_0xeff4('0x28')]['rawAttributes'],function(_0x4166e1){return{'name':_0x4166e1[_0xeff4('0x29')],'type':_0x4166e1['type']['key']};});_0x3565e8[_0xeff4('0x2a')]=_[_0xeff4('0x27')](_0x2556ff,'name');_0x3565e8[_0xeff4('0x2b')]=_[_0xeff4('0x2c')](_0x54d072[_0xeff4('0x2b')]);_0x3565e8[_0xeff4('0x2d')]=_[_0xeff4('0x2e')](_0x3565e8[_0xeff4('0x2a')],_0x3565e8[_0xeff4('0x2b')]);_0xff6bb0[_0xeff4('0x2f')]=_[_0xeff4('0x2e')](_0x3565e8[_0xeff4('0x2a')],qs['fields'](_0x54d072[_0xeff4('0x2b')]['fields']));_0xff6bb0['attributes']=_0xff6bb0[_0xeff4('0x2f')]['length']?_0xff6bb0[_0xeff4('0x2f')]:_0x3565e8[_0xeff4('0x2a')];if(!_0x54d072[_0xeff4('0x2b')]['hasOwnProperty'](_0xeff4('0x30'))){_0xff6bb0['limit']=qs[_0xeff4('0x1e')](_0x54d072['query']['limit']);_0xff6bb0['offset']=qs[_0xeff4('0x20')](_0x54d072[_0xeff4('0x2b')][_0xeff4('0x20')]);}_0xff6bb0[_0xeff4('0x31')]=qs[_0xeff4('0x32')](_0x54d072[_0xeff4('0x2b')][_0xeff4('0x32')]);_0xff6bb0[_0xeff4('0x33')]=qs[_0xeff4('0x2d')](_[_0xeff4('0x34')](_0x54d072[_0xeff4('0x2b')],_0x3565e8['filters']),_0x2556ff);if(_0x54d072[_0xeff4('0x2b')][_0xeff4('0x35')]){_0xff6bb0['where']=_[_0xeff4('0x36')](_0xff6bb0[_0xeff4('0x33')],{'$or':_[_0xeff4('0x27')](_0x2556ff,function(_0x1184d7){if(_0x1184d7[_0xeff4('0x37')]!==_0xeff4('0x38')){var _0x252614={};_0x252614[_0x1184d7[_0xeff4('0x25')]]={'$like':'%'+_0x54d072[_0xeff4('0x2b')][_0xeff4('0x35')]+'%'};return _0x252614;}})});}_0xff6bb0=_['merge']({},_0xff6bb0,_0x54d072[_0xeff4('0x39')]);var _0x423b4a={'where':_0xff6bb0[_0xeff4('0x33')]};return db[_0xeff4('0x28')]['count'](_0x423b4a)[_0xeff4('0x14')](function(_0x3bd207){_0x2d6d3f[_0xeff4('0x21')]=_0x3bd207;if(_0x54d072[_0xeff4('0x2b')][_0xeff4('0x3a')]){_0xff6bb0['include']=[{'all':!![]}];}return db[_0xeff4('0x28')]['findAll'](_0xff6bb0);})[_0xeff4('0x14')](function(_0x5aa208){_0x2d6d3f['rows']=_0x5aa208;return _0x2d6d3f;})[_0xeff4('0x14')](respondWithFilteredResult(_0x385c13,_0xff6bb0))[_0xeff4('0x1c')](handleError(_0x385c13,null));};exports[_0xeff4('0x3b')]=function(_0x23a82c,_0xc0cf17){var _0x44c149={'raw':!![],'where':{'id':_0x23a82c['params']['id']}},_0x19ac4f={};_0x19ac4f[_0xeff4('0x2a')]=_[_0xeff4('0x2c')](db['MailMessage']['rawAttributes']);_0x19ac4f[_0xeff4('0x2b')]=_[_0xeff4('0x2c')](_0x23a82c['query']);_0x19ac4f[_0xeff4('0x2d')]=_[_0xeff4('0x2e')](_0x19ac4f[_0xeff4('0x2a')],_0x19ac4f[_0xeff4('0x2b')]);_0x44c149[_0xeff4('0x2f')]=_[_0xeff4('0x2e')](_0x19ac4f[_0xeff4('0x2a')],qs[_0xeff4('0x3c')](_0x23a82c[_0xeff4('0x2b')][_0xeff4('0x3c')]));_0x44c149[_0xeff4('0x2f')]=_0x44c149['attributes'][_0xeff4('0x3d')]?_0x44c149['attributes']:_0x19ac4f[_0xeff4('0x2a')];if(_0x23a82c[_0xeff4('0x2b')]['includeAll']){_0x44c149[_0xeff4('0x3e')]=[{'all':!![]}];}_0x44c149=_[_0xeff4('0x36')]({},_0x44c149,_0x23a82c['options']);return db['MailMessage']['find'](_0x44c149)[_0xeff4('0x14')](handleEntityNotFound(_0xc0cf17,null))['then'](respondWithResult(_0xc0cf17,null))[_0xeff4('0x1c')](handleError(_0xc0cf17,null));};exports[_0xeff4('0x3f')]=function(_0x5d3bd3,_0x87392e){if(_0x5d3bd3['body']['id']){delete _0x5d3bd3['body']['id'];}return db['MailMessage'][_0xeff4('0x40')]({'where':{'id':_0x5d3bd3[_0xeff4('0x41')]['id']}})[_0xeff4('0x14')](handleEntityNotFound(_0x87392e,null))[_0xeff4('0x14')](saveUpdates(_0x5d3bd3['body'],null))[_0xeff4('0x14')](respondWithResult(_0x87392e,null))[_0xeff4('0x1c')](handleError(_0x87392e,null));};exports[_0xeff4('0x42')]=function(_0x2dcba5,_0x2369be){return db[_0xeff4('0x28')]['find']({'where':{'id':_0x2dcba5[_0xeff4('0x41')]['id']}})['then'](handleEntityNotFound(_0x2369be,null))[_0xeff4('0x14')](removeEntity(_0x2369be,null))[_0xeff4('0x1c')](handleError(_0x2369be,null));};exports[_0xeff4('0x43')]=function(_0x11ced0,_0xc997bb){return db['MailMessage'][_0xeff4('0x43')]()[_0xeff4('0x14')](respondWithResult(_0xc997bb,null))['catch'](handleError(_0xc997bb,null));};exports[_0xeff4('0x44')]=function(_0x24dfa3,_0x5d763b){return db[_0xeff4('0x28')][_0xeff4('0x44')](_0x24dfa3[_0xeff4('0x45')])[_0xeff4('0x14')](function(_0x3251bd){if(_0x3251bd){if(_0x3251bd['direction']===_0xeff4('0x46')&&!_0x3251bd[_0xeff4('0x47')]){var _0x3f014c,_0x5a26a2,_0x394463;if(_0x24dfa3[_0xeff4('0x45')]['to']){_0x5a26a2=_0x24dfa3[_0xeff4('0x45')]['to'][_0xeff4('0x48')](',')[0x0];}return db[_0xeff4('0x49')]['findOne']({'where':{'id':_0x3251bd[_0xeff4('0x4a')]},'include':[{'model':db[_0xeff4('0x4b')],'as':'List','include':[{'model':db[_0xeff4('0x4c')],'as':_0xeff4('0x4d'),'where':{'email':_0x5a26a2},'limit':0x1,'order':[['updatedAt',_0xeff4('0x4e')]]}]},{'model':db[_0xeff4('0x4f')],'as':_0xeff4('0x50'),'raw':!![]}]})['then'](function(_0x303ce9){_0x3f014c=_0x303ce9;if(_0x3f014c&&_0x3f014c[_0xeff4('0x50')]){var _0x44ea99={'tls':{'rejectUnauthorized':![]}};if(_[_0xeff4('0x51')](_0x3f014c[_0xeff4('0x50')][_0xeff4('0x52')])){_0x44ea99['host']=_0x3f014c['Smtp'][_0xeff4('0x53')];_0x44ea99[_0xeff4('0x54')]=_0x3f014c[_0xeff4('0x50')][_0xeff4('0x54')];_0x44ea99[_0xeff4('0x55')]=_0x3f014c[_0xeff4('0x50')]['secure'];if(_0x3f014c[_0xeff4('0x50')][_0xeff4('0x56')]){_0x44ea99['auth']={'user':_0x3f014c[_0xeff4('0x50')][_0xeff4('0x57')],'pass':_0x3f014c[_0xeff4('0x50')][_0xeff4('0x58')]};}}else{_0x44ea99['service']=_0x3f014c[_0xeff4('0x50')]['service'];_0x44ea99[_0xeff4('0x59')]={'user':_0x3f014c[_0xeff4('0x50')][_0xeff4('0x57')],'pass':_0x3f014c[_0xeff4('0x50')][_0xeff4('0x58')]};_0x44ea99['secure']=_0x3f014c[_0xeff4('0x50')][_0xeff4('0x55')];}if(_0x24dfa3['body'][_0xeff4('0x5a')]&&_0x24dfa3[_0xeff4('0x45')][_0xeff4('0x5a')][_0xeff4('0x3d')]){for(var _0x1a2d4a=0x0;_0x1a2d4a<_0x24dfa3['body'][_0xeff4('0x5a')][_0xeff4('0x3d')];_0x1a2d4a+=0x1){_0x24dfa3[_0xeff4('0x45')][_0xeff4('0x5a')][_0x1a2d4a]={'filename':_0x24dfa3['body'][_0xeff4('0x5a')][_0x1a2d4a][_0xeff4('0x25')],'path':path[_0xeff4('0x5b')](config[_0xeff4('0x5c')],_0xeff4('0x5d'),_0x24dfa3[_0xeff4('0x45')][_0xeff4('0x5a')][_0x1a2d4a][_0xeff4('0x5e')])};}}_0x394463={'account':_0x44ea99,'message':_0x24dfa3[_0xeff4('0x45')]};return;}})[_0xeff4('0x14')](function(){if(_0x3f014c[_0xeff4('0x5f')]){if(_0x3f014c[_0xeff4('0x5f')][_0xeff4('0x4d')][_0xeff4('0x3d')]){return _0x3f014c['List'][_0xeff4('0x4d')][0x0];}else{return db[_0xeff4('0x4c')][_0xeff4('0x44')](_[_0xeff4('0xd')](_0x24dfa3[_0xeff4('0x45')],{'firstName':_0x24dfa3[_0xeff4('0x45')]['to'],'email':_0x24dfa3['body']['to'],'phone':_0x24dfa3['body']['to'],'ListId':_0x3f014c[_0xeff4('0x60')]}));}}else{throw new Error(_0xeff4('0x61'));}})[_0xeff4('0x14')](function(){if(_0x394463){return respondWithRpcPromise(_0xeff4('0x62'),_0xeff4('0x63'),_0x394463,client9003)[_0xeff4('0x14')](function(_0x5425bd){return _0x3251bd[_0xeff4('0x3f')]({'read':!![],'messageId':_0x5425bd[_0xeff4('0x64')],'sentAt':moment()[_0xeff4('0x65')](_0xeff4('0x66'))});})[_0xeff4('0x1c')](function(_0x25bef1){logger[_0xeff4('0x1a')]('%s',JSON['stringify'](_0x25bef1));return _0x3251bd;});}return _0x3251bd;});}return _0x3251bd;}})[_0xeff4('0x14')](respondWithResult(_0x5d763b,0xc9))[_0xeff4('0x1c')](handleError(_0x5d763b,null));};exports[_0xeff4('0x67')]=function(_0x1df162,_0x36fe5d){var _0x525b16={'agent':{},'channel':_0xeff4('0x68')};if(_0x1df162['body']['id']){delete _0x1df162[_0xeff4('0x45')]['id'];}_0x1df162[_0xeff4('0x45')][_0xeff4('0x69')]=!![];_0x1df162['body']['readAt']=moment()[_0xeff4('0x65')](_0xeff4('0x66'));_0x1df162[_0xeff4('0x45')]['UserId']=_0x1df162[_0xeff4('0x45')]['UserId']||_0x1df162[_0xeff4('0x57')]['id'];_0x525b16[_0xeff4('0x6a')]['id']=_0x1df162[_0xeff4('0x45')][_0xeff4('0x6b')];return db[_0xeff4('0x28')]['find']({'where':{'id':_0x1df162[_0xeff4('0x41')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x36fe5d,null))[_0xeff4('0x14')](saveUpdates(_0x1df162['body'],null))[_0xeff4('0x14')](function(_0x5b414b){if(_0x5b414b){_0x525b16[_0xeff4('0x1b')]=_0x5b414b[_0xeff4('0x6c')]({'plain':!![]});return db[_0xeff4('0x6d')][_0xeff4('0x40')]({'where':{'id':_0x5b414b[_0xeff4('0x6e')]}});}return null;})[_0xeff4('0x14')](handleEntityNotFound(_0x36fe5d,null))[_0xeff4('0x14')](function(_0x3ae05d){if(_0x3ae05d){return _0x3ae05d[_0xeff4('0x3f')]({'UserId':_0x1df162[_0xeff4('0x45')][_0xeff4('0x6b')],'read1stAt':_[_0xeff4('0x51')](_0x3ae05d[_0xeff4('0x6f')])?moment()[_0xeff4('0x65')](_0xeff4('0x66')):undefined});}return null;})['then'](function(_0x3947db){if(_0x3947db){_0x525b16[_0xeff4('0x70')]=_0x3947db[_0xeff4('0x6c')]({'plain':!![]});interaction_log[_0xeff4('0x15')](_0xeff4('0x71'),_0x1df162['user']['id'],_0x1df162[_0xeff4('0x57')]['name'],_0x1df162['user'][_0xeff4('0x72')],_0x525b16[_0xeff4('0x70')]['id'],_0x1df162[_0xeff4('0x45')]?JSON['stringify'](_0x1df162['body']):_0xeff4('0x73'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x525b16);}return null;})[_0xeff4('0x14')](function(_0x5e9566){var _0x533070='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e9566['message'][_0xeff4('0x74')];return db[_0xeff4('0x75')][_0xeff4('0x2b')](_0x533070,{'type':db['Sequelize']['QueryTypes'][_0xeff4('0x76')],'raw':!![]})[_0xeff4('0x14')](function(_0x5a8156){return _0x5a8156;});})[_0xeff4('0x14')](function(_0x5777aa){if(_0x5777aa){_0x525b16[_0xeff4('0x1b')][_0xeff4('0x77')]=_0x5777aa[0x0];if(!_0x1df162[_0xeff4('0x45')][_0xeff4('0x6b')])return;return db['User'][_0xeff4('0x40')]({'where':{'id':_0x1df162[_0xeff4('0x45')][_0xeff4('0x6b')],'role':'agent'},'attributes':['id',_0xeff4('0x25'),_0xeff4('0x78'),_0xeff4('0x79'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2e2f2b){if(!_0x2e2f2b)return null;_0x525b16[_0xeff4('0x1b')][_0xeff4('0x6a')]=_0x2e2f2b;return _0x525b16;})[_0xeff4('0x14')](function(_0x5e2808){if(_0x5e2808){if(_0x1df162[_0xeff4('0x45')][_0xeff4('0x7a')]){_0x525b16['message'][_0xeff4('0x7b')]=util[_0xeff4('0x65')](_0xeff4('0x7c'),_0x1df162[_0xeff4('0x57')]['name']);_0x525b16[_0xeff4('0x1b')][_0xeff4('0x7d')]=_0x525b16['channel'];_0x525b16['message']['motionChannel']=_0x525b16[_0xeff4('0x7d')];_0x525b16[_0xeff4('0x1b')][_0xeff4('0x7e')]=_0xeff4('0x67');_0x525b16['message'][_0xeff4('0x45')]=htmlToText['fromString'](_0x525b16['message'][_0xeff4('0x45')]);return respondWithRpcPromise(_0xeff4('0x7f'),_0xeff4('0x7f'),{'event':_0xeff4('0x80'),'message':_0x525b16['message']},client9002)[_0xeff4('0x14')](function(){return _0x525b16;});}return _0x525b16;}return null;})[_0xeff4('0x14')](respondWithResult(_0x36fe5d,null))[_0xeff4('0x1c')](handleError(_0x36fe5d,null));};exports['reject']=function(_0x5cbd66,_0xb7713b){var _0x171e02={'agent':{},'channel':_0xeff4('0x68')};if(_0x5cbd66[_0xeff4('0x45')]['id']){delete _0x5cbd66[_0xeff4('0x45')]['id'];}_0x5cbd66[_0xeff4('0x45')][_0xeff4('0x6b')]=_0x5cbd66[_0xeff4('0x45')][_0xeff4('0x6b')]||_0x5cbd66[_0xeff4('0x57')]['id'];_0x171e02[_0xeff4('0x6a')]['id']=_0x5cbd66[_0xeff4('0x45')]['UserId'];return db[_0xeff4('0x28')][_0xeff4('0x40')]({'where':{'id':_0x5cbd66[_0xeff4('0x41')]['id'],'UserId':null}})[_0xeff4('0x14')](handleEntityNotFound(_0xb7713b,null))[_0xeff4('0x14')](function(_0x99b274){if(_0x99b274){_0x171e02[_0xeff4('0x1b')]=_0x99b274[_0xeff4('0x6c')]({'plain':!![]});return db['MailInteraction'][_0xeff4('0x40')]({'where':{'id':_0x99b274[_0xeff4('0x6e')]}});}return null;})[_0xeff4('0x14')](handleEntityNotFound(_0xb7713b,null))['then'](function(_0x34d940){if(_0x34d940){_0x171e02['interaction']=_0x34d940[_0xeff4('0x6c')]({'plain':!![]});interaction_log[_0xeff4('0x15')](_0xeff4('0x81'),_0x5cbd66['user']['id'],_0x5cbd66[_0xeff4('0x57')][_0xeff4('0x25')],_0x5cbd66['user'][_0xeff4('0x72')],_0x171e02[_0xeff4('0x70')]['id'],_0x5cbd66[_0xeff4('0x45')]?JSON['stringify'](_0x5cbd66[_0xeff4('0x45')]):_0xeff4('0x73'));return respondWithRpcPromise('RejectMessage',_0xeff4('0x82'),_0x171e02);}return null;})[_0xeff4('0x14')](function(_0x212e29){var _0xe92be6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x212e29[_0xeff4('0x1b')][_0xeff4('0x74')];return db['sequelize'][_0xeff4('0x2b')](_0xe92be6,{'type':db['Sequelize']['QueryTypes'][_0xeff4('0x76')],'raw':!![]})[_0xeff4('0x14')](function(_0x40244c){return _0x40244c;});})[_0xeff4('0x14')](function(_0x5e0729){if(_0x5e0729){_0x171e02[_0xeff4('0x1b')][_0xeff4('0x77')]=_0x5e0729[0x0];if(!_0x5cbd66['body']['UserId'])return;return db[_0xeff4('0x83')]['find']({'where':{'id':_0x5cbd66[_0xeff4('0x45')][_0xeff4('0x6b')],'role':_0xeff4('0x6a')},'attributes':['id',_0xeff4('0x25'),_0xeff4('0x78'),_0xeff4('0x79'),_0xeff4('0x84')],'raw':!![]});}return null;})['then'](function(_0x535aa0){if(!_0x535aa0)return null;_0x171e02[_0xeff4('0x1b')][_0xeff4('0x6a')]=_0x535aa0;return _0x171e02;})[_0xeff4('0x14')](function(_0x51fff5){if(_0x51fff5){_0x51fff5[_0xeff4('0x1b')][_0xeff4('0x7b')]=util[_0xeff4('0x65')](_0xeff4('0x7c'),_0x5cbd66[_0xeff4('0x57')][_0xeff4('0x25')]);_0x51fff5[_0xeff4('0x1b')][_0xeff4('0x7d')]=_0x171e02['channel'];_0x51fff5['message'][_0xeff4('0x85')]=_0x171e02[_0xeff4('0x7d')];_0x51fff5['message'][_0xeff4('0x7e')]=_0xeff4('0x86');_0x51fff5[_0xeff4('0x1b')][_0xeff4('0x45')]=htmlToText['fromString'](_0x171e02[_0xeff4('0x1b')]['body']);respondWithRpcPromise(_0xeff4('0x7f'),_0xeff4('0x7f'),{'event':'rejectmessage','message':_0x51fff5[_0xeff4('0x1b')]},client9002);return _0x171e02;}return null;})[_0xeff4('0x14')](respondWithResult(_0xb7713b,null))[_0xeff4('0x1c')](handleError(_0xb7713b,null));};exports['download']=function(_0x22d7d2,_0x4433bf){var _0x33f2cb=moment()['unix']()[_0xeff4('0x87')]();var _0x567bbe=path[_0xeff4('0x5b')](config[_0xeff4('0x5c')],_0xeff4('0x88'),_0xeff4('0x89'),_0xeff4('0x8a'));var _0x253e5d=path['join'](config[_0xeff4('0x5c')],_0xeff4('0x88'),_0xeff4('0x89'),_0xeff4('0x5a'));var _0x30cf70=util['format']('message-%s.eml',_0x33f2cb);return db[_0xeff4('0x28')]['find']({'where':{'id':_0x22d7d2[_0xeff4('0x41')]['id']},'attributes':['id','body',_0xeff4('0x8b'),'to','cc',_0xeff4('0x8c'),_0xeff4('0x8d'),_0xeff4('0x8e')],'include':_0x22d7d2[_0xeff4('0x2b')][_0xeff4('0x5a')]?[{'model':db[_0xeff4('0x8f')],'as':_0xeff4('0x90')}]:undefined})[_0xeff4('0x14')](handleEntityNotFound(_0x4433bf,null))['then'](function(_0x3f4141){if(_0x3f4141){var _0x3c3542=_0x3f4141;var _0x4679a8={'from':_0x3c3542[_0xeff4('0x8b')],'to':_0x3c3542['to'],'subject':_0x3c3542[_0xeff4('0x8d')],'html':htmlEntities[_0xeff4('0x91')](_0x3c3542[_0xeff4('0x45')]),'headers':{'Date':moment(_0x3c3542[_0xeff4('0x8e')])[_0xeff4('0x65')](_0xeff4('0x92'))},'attachments':[]};if(_0x3f4141['cc']){_0x4679a8[_0xeff4('0x93')]['Cc']=_0x3f4141['cc'];}if(_0x3f4141[_0xeff4('0x8c')]){_0x4679a8[_0xeff4('0x93')][_0xeff4('0x94')]=_0x3f4141['bcc'];}return new BPromise(function(_0x17abc1,_0x3a463d){if(_0x3f4141[_0xeff4('0x90')]){for(var _0xcd2dc=0x0;_0xcd2dc<_0x3f4141['Attachments'][_0xeff4('0x3d')];_0xcd2dc++){var _0xa6623c=_0x3f4141[_0xeff4('0x90')][_0xcd2dc];var _0x2bbf06=path[_0xeff4('0x5b')](_0x253e5d,_0xa6623c[_0xeff4('0x5e')]);if(fs['existsSync'](_0x2bbf06)){_0x4679a8[_0xeff4('0x5a')][_0xeff4('0x95')]({'name':_0xa6623c[_0xeff4('0x25')],'contentType':_0xa6623c[_0xeff4('0x37')],'data':fs[_0xeff4('0x96')](_0x2bbf06)});}}}emlformat['build'](_0x4679a8,function(_0xb36b5d,_0x7e224c){if(_0xb36b5d)return _0x3a463d(_0xb36b5d);fs[_0xeff4('0x97')](path['join'](_0x567bbe,_0x30cf70),_0x7e224c);return _0x17abc1(_0x7e224c);});});}})[_0xeff4('0x14')](function(_0x503412){if(_0x503412){return _0x4433bf[_0xeff4('0x98')](path[_0xeff4('0x5b')](_0x567bbe,_0x30cf70),_0x30cf70,function(_0x56ce65){if(!_0x56ce65)fs[_0xeff4('0x99')](path[_0xeff4('0x5b')](_0x567bbe,_0x30cf70));});}})[_0xeff4('0x1c')](handleError(_0x4433bf,null));}; \ No newline at end of file +var _0xe58e=['headers','Bcc','existsSync','build','writeFileSync','eml-format','bluebird','util','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','register','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','status','json','offset','undefined','limit','count','set','then','destroy','sendStatus','stack','name','send','map','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','where','filter','merge','VIRTUAL','includeAll','include','MailMessage','rows','show','params','rawAttributes','options','find','update','body','describe','create','direction','out','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','secure','authentication','auth','user','pass','attachments','join','server/files/attachments','basename','Contacts','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','manual','interface','SIP/%s','motionChannel','channel','event','fromString','EventManager','acceptmessage','MailInteraction','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','ContactId','internal','reject','rejectmessage','download','unix','toString','server','files','root','bcc','subject','Attachment','Attachments','from','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ'];(function(_0x229cb4,_0x3980b4){var _0x429401=function(_0x5745ff){while(--_0x5745ff){_0x229cb4['push'](_0x229cb4['shift']());}};_0x429401(++_0x3980b4);}(_0xe58e,0x1e2));var _0xee58=function(_0x17eae1,_0x528337){_0x17eae1=_0x17eae1-0x0;var _0x23c2a4=_0xe58e[_0x17eae1];return _0x23c2a4;};'use strict';var emlformat=require(_0xee58('0x0'));var moment=require('moment');var BPromise=require(_0xee58('0x1'));var util=require(_0xee58('0x2'));var path=require(_0xee58('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xee58('0x4'));var htmlToText=require(_0xee58('0x5'));var qs=require(_0xee58('0x6'));var logger=require(_0xee58('0x7'))(_0xee58('0x8'));var interaction_log=require('../../config/logger')(_0xee58('0x9'));var config=require(_0xee58('0xa'));var db=require(_0xee58('0xb'))['db'];config[_0xee58('0xc')]=_[_0xee58('0xd')](config[_0xee58('0xc')],{'host':_0xee58('0xe'),'port':0x18eb});var socket=require(_0xee58('0xf'))(new Redis(config[_0xee58('0xc')]));var htmlEntities=require(_0xee58('0x10'));require('./mailMessage.socket')[_0xee58('0x11')](socket);var jayson=require(_0xee58('0x12'));var client=jayson[_0xee58('0x13')]['http']({'port':0x232c});var client9003=jayson[_0xee58('0x13')]['http']({'port':0x232b});var client9002=jayson[_0xee58('0x13')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c8769,_0x58656f,_0x43d055,_0x4ebd66){return new BPromise(function(_0x388f4b,_0x103bed){var _0x26df23=_0x4ebd66||client;return _0x26df23[_0xee58('0x14')](_0x3c8769,_0x43d055)['then'](function(_0x2eeee1){logger[_0xee58('0x15')]('MailMessage,\x20%s,\x20%s',_0x58656f,_0xee58('0x16'));logger[_0xee58('0x17')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x58656f,_0xee58('0x16'),JSON[_0xee58('0x18')](_0x2eeee1));if(_0x2eeee1[_0xee58('0x19')]){if(_0x2eeee1['error'][_0xee58('0x1a')]===0x1f4){logger[_0xee58('0x19')](_0xee58('0x1b'),_0x58656f,_0x2eeee1['error'][_0xee58('0x1c')]);return _0x103bed(_0x2eeee1['error'][_0xee58('0x1c')]);}logger['error'](_0xee58('0x1b'),_0x58656f,_0x2eeee1['error']['message']);return _0x388f4b(_0x2eeee1['error']['message']);}else{logger[_0xee58('0x15')](_0xee58('0x1b'),_0x58656f,'request\x20sent');_0x388f4b(_0x2eeee1['result']['message']);}})[_0xee58('0x1d')](function(_0x1b236a){logger['error'](_0xee58('0x1b'),_0x58656f,_0x1b236a);_0x103bed(_0x1b236a);});});}function respondWithResult(_0x5d71de,_0x40299a){_0x40299a=_0x40299a||0xc8;return function(_0x3a2ab3){if(_0x3a2ab3){return _0x5d71de[_0xee58('0x1e')](_0x40299a)[_0xee58('0x1f')](_0x3a2ab3);}};}function respondWithFilteredResult(_0x57d608,_0x1ade51){return function(_0x3d5cbf){if(_0x3d5cbf){var _0x1ee60a=typeof _0x1ade51[_0xee58('0x20')]===_0xee58('0x21')&&typeof _0x1ade51[_0xee58('0x22')]===_0xee58('0x21');var _0x537731=_0x3d5cbf[_0xee58('0x23')];var _0x37bd0f=_0x1ee60a?0x0:_0x1ade51[_0xee58('0x20')];var _0x15b036=_0x1ee60a?_0x3d5cbf['count']:_0x1ade51[_0xee58('0x20')]+_0x1ade51['limit'];var _0x644954;if(_0x15b036>=_0x537731){_0x15b036=_0x537731;_0x644954=0xc8;}else{_0x644954=0xce;}_0x57d608[_0xee58('0x1e')](_0x644954);return _0x57d608[_0xee58('0x24')]('Content-Range',_0x37bd0f+'-'+_0x15b036+'/'+_0x537731)['json'](_0x3d5cbf);}return null;};}function saveUpdates(_0x53ec08){return function(_0x2ace20){if(_0x2ace20){return _0x2ace20['update'](_0x53ec08)[_0xee58('0x25')](function(_0x4353ea){return _0x4353ea;});}return null;};}function removeEntity(_0x311201){return function(_0x1a9074){if(_0x1a9074){return _0x1a9074[_0xee58('0x26')]()['then'](function(){_0x311201[_0xee58('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x160406){return function(_0x4b450a){if(!_0x4b450a){_0x160406[_0xee58('0x27')](0x194);}return _0x4b450a;};}function handleError(_0x439bdf,_0x1285ae){_0x1285ae=_0x1285ae||0x1f4;return function(_0x2ceb5d){logger[_0xee58('0x19')](_0x2ceb5d[_0xee58('0x28')]);if(_0x2ceb5d[_0xee58('0x29')]){delete _0x2ceb5d[_0xee58('0x29')];}_0x439bdf[_0xee58('0x1e')](_0x1285ae)[_0xee58('0x2a')](_0x2ceb5d);};}exports['index']=function(_0x11de9b,_0x1f014d){var _0x358f53={},_0x38c559={},_0x198504={'count':0x0,'rows':[]};var _0x3703e9=_[_0xee58('0x2b')](db['MailMessage']['rawAttributes'],function(_0x17b9f6){return{'name':_0x17b9f6['fieldName'],'type':_0x17b9f6[_0xee58('0x2c')][_0xee58('0x2d')]};});_0x38c559[_0xee58('0x2e')]=_[_0xee58('0x2b')](_0x3703e9,'name');_0x38c559[_0xee58('0x2f')]=_[_0xee58('0x30')](_0x11de9b[_0xee58('0x2f')]);_0x38c559[_0xee58('0x31')]=_[_0xee58('0x32')](_0x38c559[_0xee58('0x2e')],_0x38c559[_0xee58('0x2f')]);_0x358f53['attributes']=_[_0xee58('0x32')](_0x38c559[_0xee58('0x2e')],qs[_0xee58('0x33')](_0x11de9b[_0xee58('0x2f')][_0xee58('0x33')]));_0x358f53[_0xee58('0x34')]=_0x358f53[_0xee58('0x34')][_0xee58('0x35')]?_0x358f53[_0xee58('0x34')]:_0x38c559[_0xee58('0x2e')];if(!_0x11de9b[_0xee58('0x2f')]['hasOwnProperty']('nolimit')){_0x358f53[_0xee58('0x22')]=qs['limit'](_0x11de9b[_0xee58('0x2f')][_0xee58('0x22')]);_0x358f53[_0xee58('0x20')]=qs[_0xee58('0x20')](_0x11de9b[_0xee58('0x2f')][_0xee58('0x20')]);}_0x358f53[_0xee58('0x36')]=qs['sort'](_0x11de9b['query']['sort']);_0x358f53[_0xee58('0x37')]=qs[_0xee58('0x31')](_['pick'](_0x11de9b[_0xee58('0x2f')],_0x38c559['filters']),_0x3703e9);if(_0x11de9b[_0xee58('0x2f')][_0xee58('0x38')]){_0x358f53['where']=_[_0xee58('0x39')](_0x358f53[_0xee58('0x37')],{'$or':_[_0xee58('0x2b')](_0x3703e9,function(_0x5b3dd8){if(_0x5b3dd8[_0xee58('0x2c')]!==_0xee58('0x3a')){var _0x2282ac={};_0x2282ac[_0x5b3dd8[_0xee58('0x29')]]={'$like':'%'+_0x11de9b[_0xee58('0x2f')][_0xee58('0x38')]+'%'};return _0x2282ac;}})});}_0x358f53=_[_0xee58('0x39')]({},_0x358f53,_0x11de9b['options']);var _0x528b7a={'where':_0x358f53[_0xee58('0x37')]};return db['MailMessage'][_0xee58('0x23')](_0x528b7a)[_0xee58('0x25')](function(_0x585ad4){_0x198504[_0xee58('0x23')]=_0x585ad4;if(_0x11de9b[_0xee58('0x2f')][_0xee58('0x3b')]){_0x358f53[_0xee58('0x3c')]=[{'all':!![]}];}return db[_0xee58('0x3d')]['findAll'](_0x358f53);})[_0xee58('0x25')](function(_0x1761b0){_0x198504[_0xee58('0x3e')]=_0x1761b0;return _0x198504;})[_0xee58('0x25')](respondWithFilteredResult(_0x1f014d,_0x358f53))[_0xee58('0x1d')](handleError(_0x1f014d,null));};exports[_0xee58('0x3f')]=function(_0x2393d8,_0x1c80f1){var _0x230fa6={'raw':!![],'where':{'id':_0x2393d8[_0xee58('0x40')]['id']}},_0x5a5081={};_0x5a5081[_0xee58('0x2e')]=_['keys'](db[_0xee58('0x3d')][_0xee58('0x41')]);_0x5a5081[_0xee58('0x2f')]=_[_0xee58('0x30')](_0x2393d8[_0xee58('0x2f')]);_0x5a5081[_0xee58('0x31')]=_[_0xee58('0x32')](_0x5a5081[_0xee58('0x2e')],_0x5a5081[_0xee58('0x2f')]);_0x230fa6[_0xee58('0x34')]=_[_0xee58('0x32')](_0x5a5081[_0xee58('0x2e')],qs[_0xee58('0x33')](_0x2393d8[_0xee58('0x2f')][_0xee58('0x33')]));_0x230fa6[_0xee58('0x34')]=_0x230fa6[_0xee58('0x34')][_0xee58('0x35')]?_0x230fa6[_0xee58('0x34')]:_0x5a5081[_0xee58('0x2e')];if(_0x2393d8[_0xee58('0x2f')][_0xee58('0x3b')]){_0x230fa6[_0xee58('0x3c')]=[{'all':!![]}];}_0x230fa6=_[_0xee58('0x39')]({},_0x230fa6,_0x2393d8[_0xee58('0x42')]);return db[_0xee58('0x3d')][_0xee58('0x43')](_0x230fa6)[_0xee58('0x25')](handleEntityNotFound(_0x1c80f1,null))['then'](respondWithResult(_0x1c80f1,null))['catch'](handleError(_0x1c80f1,null));};exports[_0xee58('0x44')]=function(_0x3619a0,_0x435654){if(_0x3619a0[_0xee58('0x45')]['id']){delete _0x3619a0[_0xee58('0x45')]['id'];}return db[_0xee58('0x3d')][_0xee58('0x43')]({'where':{'id':_0x3619a0[_0xee58('0x40')]['id']}})[_0xee58('0x25')](handleEntityNotFound(_0x435654,null))['then'](saveUpdates(_0x3619a0[_0xee58('0x45')],null))[_0xee58('0x25')](respondWithResult(_0x435654,null))['catch'](handleError(_0x435654,null));};exports[_0xee58('0x26')]=function(_0x2dd8f6,_0x1a7b8e){return db[_0xee58('0x3d')]['find']({'where':{'id':_0x2dd8f6[_0xee58('0x40')]['id']}})[_0xee58('0x25')](handleEntityNotFound(_0x1a7b8e,null))[_0xee58('0x25')](removeEntity(_0x1a7b8e,null))[_0xee58('0x1d')](handleError(_0x1a7b8e,null));};exports[_0xee58('0x46')]=function(_0x349407,_0x299f55){return db['MailMessage'][_0xee58('0x46')]()[_0xee58('0x25')](respondWithResult(_0x299f55,null))[_0xee58('0x1d')](handleError(_0x299f55,null));};exports[_0xee58('0x47')]=function(_0x599bb3,_0x37a99e){return db['MailMessage'][_0xee58('0x47')](_0x599bb3[_0xee58('0x45')])['then'](function(_0x13ae68){if(_0x13ae68){if(_0x13ae68[_0xee58('0x48')]===_0xee58('0x49')&&!_0x13ae68[_0xee58('0x4a')]){var _0x3316a3,_0x36e00c,_0x347de9;if(_0x599bb3['body']['to']){_0x36e00c=_0x599bb3[_0xee58('0x45')]['to'][_0xee58('0x4b')](',')[0x0];}return db[_0xee58('0x4c')]['findOne']({'where':{'id':_0x13ae68[_0xee58('0x4d')]},'include':[{'model':db[_0xee58('0x4e')],'as':_0xee58('0x4f'),'include':[{'model':db[_0xee58('0x50')],'as':'Contacts','where':{'email':_0x36e00c},'limit':0x1,'order':[[_0xee58('0x51'),_0xee58('0x52')]]}]},{'model':db[_0xee58('0x53')],'as':_0xee58('0x54'),'raw':!![]}]})[_0xee58('0x25')](function(_0x15e555){_0x3316a3=_0x15e555;if(_0x3316a3&&_0x3316a3[_0xee58('0x54')]){var _0x9bec23={'tls':{'rejectUnauthorized':![]}};if(_[_0xee58('0x55')](_0x3316a3['Smtp'][_0xee58('0x56')])){_0x9bec23[_0xee58('0x57')]=_0x3316a3['Smtp'][_0xee58('0x57')];_0x9bec23['port']=_0x3316a3[_0xee58('0x54')]['port'];_0x9bec23[_0xee58('0x58')]=_0x3316a3['Smtp']['secure'];if(_0x3316a3[_0xee58('0x54')][_0xee58('0x59')]){_0x9bec23[_0xee58('0x5a')]={'user':_0x3316a3[_0xee58('0x54')][_0xee58('0x5b')],'pass':_0x3316a3[_0xee58('0x54')][_0xee58('0x5c')]};}}else{_0x9bec23[_0xee58('0x56')]=_0x3316a3[_0xee58('0x54')][_0xee58('0x56')];_0x9bec23[_0xee58('0x5a')]={'user':_0x3316a3[_0xee58('0x54')][_0xee58('0x5b')],'pass':_0x3316a3[_0xee58('0x54')][_0xee58('0x5c')]};_0x9bec23['secure']=_0x3316a3[_0xee58('0x54')]['secure'];}if(_0x599bb3['body'][_0xee58('0x5d')]&&_0x599bb3['body'][_0xee58('0x5d')]['length']){for(var _0x495f85=0x0;_0x495f85<_0x599bb3[_0xee58('0x45')][_0xee58('0x5d')][_0xee58('0x35')];_0x495f85+=0x1){_0x599bb3[_0xee58('0x45')][_0xee58('0x5d')][_0x495f85]={'filename':_0x599bb3[_0xee58('0x45')][_0xee58('0x5d')][_0x495f85][_0xee58('0x29')],'path':path[_0xee58('0x5e')](config['root'],_0xee58('0x5f'),_0x599bb3[_0xee58('0x45')][_0xee58('0x5d')][_0x495f85][_0xee58('0x60')])};}}_0x347de9={'account':_0x9bec23,'message':_0x599bb3[_0xee58('0x45')]};return;}})[_0xee58('0x25')](function(){if(_0x3316a3['List']){if(_0x3316a3[_0xee58('0x4f')][_0xee58('0x61')][_0xee58('0x35')]){return _0x3316a3[_0xee58('0x4f')][_0xee58('0x61')][0x0];}else{return db[_0xee58('0x50')]['create'](_[_0xee58('0xd')](_0x599bb3[_0xee58('0x45')],{'firstName':_0x599bb3['body']['to'],'email':_0x599bb3['body']['to'],'phone':_0x599bb3[_0xee58('0x45')]['to'],'ListId':_0x3316a3['ListId']}));}}else{throw new Error(_0xee58('0x62'));}})['then'](function(){if(_0x347de9){return respondWithRpcPromise(_0xee58('0x63'),_0xee58('0x64'),_0x347de9,client9003)[_0xee58('0x25')](function(_0x7b3ae){return _0x13ae68[_0xee58('0x44')]({'read':!![],'messageId':_0x7b3ae['messageId'],'sentAt':moment()[_0xee58('0x65')](_0xee58('0x66'))});})[_0xee58('0x1d')](function(_0x47aea4){logger[_0xee58('0x19')]('%s',JSON[_0xee58('0x18')](_0x47aea4));return _0x13ae68;});}return _0x13ae68;});}return _0x13ae68;}})['then'](respondWithResult(_0x37a99e,0xc9))[_0xee58('0x1d')](handleError(_0x37a99e,null));};exports[_0xee58('0x67')]=function(_0x23c0b4,_0x36db3f){var _0xe8f889={'agent':{},'channel':_0xee58('0x68')};if(_0x23c0b4[_0xee58('0x45')]['id']){delete _0x23c0b4[_0xee58('0x45')]['id'];}_0x23c0b4['body'][_0xee58('0x69')]=!![];_0x23c0b4['body'][_0xee58('0x6a')]=moment()[_0xee58('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x23c0b4[_0xee58('0x45')]['UserId']=_0x23c0b4['body'][_0xee58('0x6b')]||_0x23c0b4[_0xee58('0x5b')]['id'];_0xe8f889[_0xee58('0x6c')]['id']=_0x23c0b4[_0xee58('0x45')][_0xee58('0x6b')];return db[_0xee58('0x3d')][_0xee58('0x43')]({'where':{'id':_0x23c0b4[_0xee58('0x40')]['id'],'UserId':null}})[_0xee58('0x25')](handleEntityNotFound(_0x36db3f,null))[_0xee58('0x25')](saveUpdates(_0x23c0b4[_0xee58('0x45')],null))[_0xee58('0x25')](function(_0x38ab5e){if(_0x38ab5e){_0xe8f889[_0xee58('0x1c')]=_0x38ab5e[_0xee58('0x6d')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x38ab5e['MailInteractionId']}});}return null;})[_0xee58('0x25')](handleEntityNotFound(_0x36db3f,null))[_0xee58('0x25')](function(_0x345416){if(_0x345416){return _0x345416[_0xee58('0x44')]({'UserId':_0x23c0b4[_0xee58('0x45')][_0xee58('0x6b')],'read1stAt':_[_0xee58('0x55')](_0x345416['read1stAt'])?moment()['format'](_0xee58('0x66')):undefined});}return null;})[_0xee58('0x25')](function(_0x5047ab){if(_0x5047ab){_0xe8f889['interaction']=_0x5047ab['get']({'plain':!![]});interaction_log['info'](_0xee58('0x6e'),_0x23c0b4[_0xee58('0x5b')]['id'],_0x23c0b4[_0xee58('0x5b')]['name'],_0x23c0b4[_0xee58('0x5b')]['role'],_0xe8f889[_0xee58('0x6f')]['id'],_0x23c0b4['body']?JSON['stringify'](_0x23c0b4['body']):_0xee58('0x70'));return respondWithRpcPromise(_0xee58('0x71'),_0xee58('0x72'),_0xe8f889);}return null;})[_0xee58('0x25')](function(_0x48d36e){var _0x7893df=_0xee58('0x73')+_0x48d36e[_0xee58('0x1c')]['ContactId'];return db[_0xee58('0x74')][_0xee58('0x2f')](_0x7893df,{'type':db[_0xee58('0x75')][_0xee58('0x76')][_0xee58('0x77')],'raw':!![]})[_0xee58('0x25')](function(_0x9d956f){return _0x9d956f;});})[_0xee58('0x25')](function(_0x34281d){if(_0x34281d){_0xe8f889['message'][_0xee58('0x78')]=_0x34281d[0x0];if(!_0x23c0b4[_0xee58('0x45')][_0xee58('0x6b')])return;return db[_0xee58('0x79')][_0xee58('0x43')]({'where':{'id':_0x23c0b4[_0xee58('0x45')][_0xee58('0x6b')],'role':_0xee58('0x6c')},'attributes':['id',_0xee58('0x29'),'fullname',_0xee58('0x7a'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3f45a0){if(!_0x3f45a0)return null;_0xe8f889[_0xee58('0x1c')][_0xee58('0x6c')]=_0x3f45a0;return _0xe8f889;})[_0xee58('0x25')](function(_0x151b19){if(_0x151b19){if(_0x23c0b4[_0xee58('0x45')][_0xee58('0x7b')]){_0xe8f889[_0xee58('0x1c')][_0xee58('0x7c')]=util[_0xee58('0x65')](_0xee58('0x7d'),_0x23c0b4[_0xee58('0x5b')][_0xee58('0x29')]);_0xe8f889['message']['channel']=_0xe8f889['channel'];_0xe8f889[_0xee58('0x1c')][_0xee58('0x7e')]=_0xe8f889[_0xee58('0x7f')];_0xe8f889[_0xee58('0x1c')][_0xee58('0x80')]=_0xee58('0x67');_0xe8f889[_0xee58('0x1c')][_0xee58('0x45')]=htmlToText[_0xee58('0x81')](_0xe8f889[_0xee58('0x1c')][_0xee58('0x45')]);return respondWithRpcPromise(_0xee58('0x82'),'EventManager',{'event':_0xee58('0x83'),'message':_0xe8f889[_0xee58('0x1c')]},client9002)['then'](function(){return _0xe8f889;});}return _0xe8f889;}return null;})[_0xee58('0x25')](respondWithResult(_0x36db3f,null))[_0xee58('0x1d')](handleError(_0x36db3f,null));};exports['reject']=function(_0x40e846,_0x36b014){var _0x3ad5e9={'agent':{},'channel':_0xee58('0x68')};if(_0x40e846[_0xee58('0x45')]['id']){delete _0x40e846[_0xee58('0x45')]['id'];}_0x40e846['body'][_0xee58('0x6b')]=_0x40e846['body']['UserId']||_0x40e846[_0xee58('0x5b')]['id'];_0x3ad5e9['agent']['id']=_0x40e846[_0xee58('0x45')][_0xee58('0x6b')];return db[_0xee58('0x3d')]['find']({'where':{'id':_0x40e846['params']['id'],'UserId':null}})[_0xee58('0x25')](handleEntityNotFound(_0x36b014,null))['then'](function(_0x453379){if(_0x453379){_0x3ad5e9[_0xee58('0x1c')]=_0x453379[_0xee58('0x6d')]({'plain':!![]});return db[_0xee58('0x84')][_0xee58('0x43')]({'where':{'id':_0x453379[_0xee58('0x85')]}});}return null;})[_0xee58('0x25')](handleEntityNotFound(_0x36b014,null))[_0xee58('0x25')](function(_0x5c3b59){if(_0x5c3b59){_0x3ad5e9[_0xee58('0x6f')]=_0x5c3b59['get']({'plain':!![]});interaction_log[_0xee58('0x15')](_0xee58('0x86'),_0x40e846[_0xee58('0x5b')]['id'],_0x40e846[_0xee58('0x5b')][_0xee58('0x29')],_0x40e846[_0xee58('0x5b')][_0xee58('0x87')],_0x3ad5e9[_0xee58('0x6f')]['id'],_0x40e846['body']?JSON[_0xee58('0x18')](_0x40e846[_0xee58('0x45')]):_0xee58('0x70'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x3ad5e9);}return null;})[_0xee58('0x25')](function(_0x2748d0){var _0x3b5f10='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2748d0[_0xee58('0x1c')][_0xee58('0x88')];return db[_0xee58('0x74')][_0xee58('0x2f')](_0x3b5f10,{'type':db[_0xee58('0x75')][_0xee58('0x76')][_0xee58('0x77')],'raw':!![]})[_0xee58('0x25')](function(_0x5ebebd){return _0x5ebebd;});})[_0xee58('0x25')](function(_0x2ac080){if(_0x2ac080){_0x3ad5e9['message'][_0xee58('0x78')]=_0x2ac080[0x0];if(!_0x40e846[_0xee58('0x45')]['UserId'])return;return db[_0xee58('0x79')][_0xee58('0x43')]({'where':{'id':_0x40e846[_0xee58('0x45')][_0xee58('0x6b')],'role':_0xee58('0x6c')},'attributes':['id',_0xee58('0x29'),'fullname',_0xee58('0x7a'),_0xee58('0x89')],'raw':!![]});}return null;})['then'](function(_0x8c87ec){if(!_0x8c87ec)return null;_0x3ad5e9['message'][_0xee58('0x6c')]=_0x8c87ec;return _0x3ad5e9;})[_0xee58('0x25')](function(_0x287600){if(_0x287600){_0x287600[_0xee58('0x1c')][_0xee58('0x7c')]=util[_0xee58('0x65')](_0xee58('0x7d'),_0x40e846['user'][_0xee58('0x29')]);_0x287600[_0xee58('0x1c')][_0xee58('0x7f')]=_0x3ad5e9['channel'];_0x287600['message'][_0xee58('0x7e')]=_0x3ad5e9[_0xee58('0x7f')];_0x287600[_0xee58('0x1c')][_0xee58('0x80')]=_0xee58('0x8a');_0x287600[_0xee58('0x1c')][_0xee58('0x45')]=htmlToText[_0xee58('0x81')](_0x3ad5e9['message'][_0xee58('0x45')]);respondWithRpcPromise(_0xee58('0x82'),_0xee58('0x82'),{'event':_0xee58('0x8b'),'message':_0x287600[_0xee58('0x1c')]},client9002);return _0x3ad5e9;}return null;})['then'](respondWithResult(_0x36b014,null))[_0xee58('0x1d')](handleError(_0x36b014,null));};exports[_0xee58('0x8c')]=function(_0x55e5c2,_0x45889e){var _0x572169=moment()[_0xee58('0x8d')]()[_0xee58('0x8e')]();var _0x5dd670=path[_0xee58('0x5e')](config['root'],_0xee58('0x8f'),_0xee58('0x90'),'tmp');var _0x25e8a9=path[_0xee58('0x5e')](config[_0xee58('0x91')],'server',_0xee58('0x90'),_0xee58('0x5d'));var _0x130378=util[_0xee58('0x65')]('message-%s.eml',_0x572169);return db[_0xee58('0x3d')][_0xee58('0x43')]({'where':{'id':_0x55e5c2[_0xee58('0x40')]['id']},'attributes':['id',_0xee58('0x45'),'from','to','cc',_0xee58('0x92'),_0xee58('0x93'),'createdAt'],'include':_0x55e5c2[_0xee58('0x2f')][_0xee58('0x5d')]?[{'model':db[_0xee58('0x94')],'as':_0xee58('0x95')}]:undefined})[_0xee58('0x25')](handleEntityNotFound(_0x45889e,null))['then'](function(_0x47a8e3){if(_0x47a8e3){var _0x2d5c5e=_0x47a8e3;var _0x328e6b={'from':_0x2d5c5e[_0xee58('0x96')],'to':_0x2d5c5e['to'],'subject':_0x2d5c5e[_0xee58('0x93')],'html':htmlEntities[_0xee58('0x97')](_0x2d5c5e[_0xee58('0x45')]),'headers':{'Date':moment(_0x2d5c5e[_0xee58('0x98')])[_0xee58('0x65')](_0xee58('0x99'))},'attachments':[]};if(_0x47a8e3['cc']){_0x328e6b[_0xee58('0x9a')]['Cc']=_0x47a8e3['cc'];}if(_0x47a8e3['bcc']){_0x328e6b[_0xee58('0x9a')][_0xee58('0x9b')]=_0x47a8e3['bcc'];}return new BPromise(function(_0x13503a,_0x514345){if(_0x47a8e3[_0xee58('0x95')]){for(var _0x13dd64=0x0;_0x13dd64<_0x47a8e3['Attachments']['length'];_0x13dd64++){var _0x16347f=_0x47a8e3['Attachments'][_0x13dd64];var _0x3f91d4=path['join'](_0x25e8a9,_0x16347f[_0xee58('0x60')]);if(fs[_0xee58('0x9c')](_0x3f91d4)){_0x328e6b[_0xee58('0x5d')]['push']({'name':_0x16347f[_0xee58('0x29')],'contentType':_0x16347f[_0xee58('0x2c')],'data':fs['readFileSync'](_0x3f91d4)});}}}emlformat[_0xee58('0x9d')](_0x328e6b,function(_0x1c400d,_0x2d43f3){if(_0x1c400d)return _0x514345(_0x1c400d);fs[_0xee58('0x9e')](path[_0xee58('0x5e')](_0x5dd670,_0x130378),_0x2d43f3);return _0x13503a(_0x2d43f3);});});}})['then'](function(_0x3fa187){if(_0x3fa187){return _0x45889e[_0xee58('0x8c')](path[_0xee58('0x5e')](_0x5dd670,_0x130378),_0x130378,function(_0x116b93){if(!_0x116b93)fs['unlinkSync'](path[_0xee58('0x5e')](_0x5dd670,_0x130378));});}})['catch'](handleError(_0x45889e,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 107a4b4..10ec1f2 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 _0xe051=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x160372,_0x4b0d9d){var _0x806be7=function(_0x165827){while(--_0x165827){_0x160372['push'](_0x160372['shift']());}};_0x806be7(++_0x4b0d9d);}(_0xe051,0xe8));var _0x1e05=function(_0x2df6ac,_0x4195c7){_0x2df6ac=_0x2df6ac-0x0;var _0x1b9e04=_0xe051[_0x2df6ac];return _0x1b9e04;};'use strict';var EventEmitter=require(_0x1e05('0x0'));var MailMessage=require(_0x1e05('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x1e05('0x2')](0x0);var events={'afterCreate':_0x1e05('0x3'),'afterUpdate':_0x1e05('0x4'),'afterDestroy':_0x1e05('0x5')};function emitEvent(_0xdcbbe2){return function(_0x2f93da,_0x371811,_0x116167){MailMessageEvents[_0x1e05('0x6')](_0xdcbbe2+':'+_0x2f93da['id'],_0x2f93da);MailMessageEvents[_0x1e05('0x6')](_0xdcbbe2,_0x2f93da);_0x116167(null);};}for(var e in events){if(events[_0x1e05('0x7')](e)){var event=events[e];MailMessage[_0x1e05('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x14f7=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5cc71f,_0x4f6f52){var _0x4e1b52=function(_0x1bea3b){while(--_0x1bea3b){_0x5cc71f['push'](_0x5cc71f['shift']());}};_0x4e1b52(++_0x4f6f52);}(_0x14f7,0x126));var _0x714f=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x14f7[_0x13d07a];return _0x5ee0ee;};'use strict';var EventEmitter=require(_0x714f('0x0'));var MailMessage=require(_0x714f('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x714f('0x2')](0x0);var events={'afterCreate':_0x714f('0x3'),'afterUpdate':_0x714f('0x4'),'afterDestroy':'remove'};function emitEvent(_0xd3438c){return function(_0x45c707,_0x188dba,_0x2df7c9){MailMessageEvents[_0x714f('0x5')](_0xd3438c+':'+_0x45c707['id'],_0x45c707);MailMessageEvents['emit'](_0xd3438c,_0x45c707);_0x2df7c9(null);};}for(var e in events){if(events[_0x714f('0x6')](e)){var event=events[e];MailMessage[_0x714f('0x7')](e,emitEvent(event));}}module[_0x714f('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 939edeb..e6fe4ae 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 _0x9a2b=['exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','fromString','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x46a3e1,_0x4eaa57){var _0xa11d28=function(_0x2c7287){while(--_0x2c7287){_0x46a3e1['push'](_0x46a3e1['shift']());}};_0xa11d28(++_0x4eaa57);}(_0x9a2b,0x1ca));var _0xb9a2=function(_0x38aa1d,_0x4faf18){_0x38aa1d=_0x38aa1d-0x0;var _0x2fb75d=_0x9a2b[_0x38aa1d];return _0x2fb75d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb9a2('0x0'))(_0xb9a2('0x1'));var moment=require(_0xb9a2('0x2'));var BPromise=require(_0xb9a2('0x3'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xb9a2('0x4'));var rimraf=require(_0xb9a2('0x5'));var config=require(_0xb9a2('0x6'));var attributes=require('./mailMessage.attributes');module[_0xb9a2('0x7')]=function(_0x12b66e,_0x52049c){return _0x12b66e[_0xb9a2('0x8')](_0xb9a2('0x9'),attributes,{'tableName':_0xb9a2('0xa'),'paranoid':![],'indexes':[{'name':_0xb9a2('0xb'),'fields':[_0xb9a2('0xb')]},{'name':_0xb9a2('0xc'),'fields':[_0xb9a2('0xd'),_0xb9a2('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1a1ebf,_0x62bc5e,_0x163038){if(_0x1a1ebf['body']){_0x1a1ebf[_0xb9a2('0xd')]=htmlToText[_0xb9a2('0xf')](_0x1a1ebf['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x163038(null,_0x62bc5e);},'afterCreate':function(_0x1ecaa6,_0x5497d9,_0xbd9ea){var _0x27403e=_0x12b66e['models'];var _0xbd637b=_0x1ecaa6[_0xb9a2('0x10')]({'plain':!![]});if(_0xbd637b[_0xb9a2('0x11')]['toLowerCase']()==='in'||_0xbd637b[_0xb9a2('0x11')][_0xb9a2('0x12')]()===_0xb9a2('0x13')&&!_0xbd637b[_0xb9a2('0x14')]&&!_[_0xb9a2('0x15')](_0xbd637b[_0xb9a2('0x16')])){_0x27403e[_0xb9a2('0x17')][_0xb9a2('0x18')]({'where':{'id':_0xbd637b[_0xb9a2('0x19')]}})[_0xb9a2('0x1a')](function(_0x1b5999){if(_0x1b5999){_0x1b5999['update']({'lastMsgAt':_0xbd637b['createdAt'],'lastMsgDirection':_0xbd637b[_0xb9a2('0x11')]['toLowerCase']()});}})[_0xb9a2('0x1b')](function(_0x76fcdd){console[_0xb9a2('0x1c')](_0x76fcdd);});}_0xbd9ea();}},'charset':_0xb9a2('0x1d'),'collate':_0xb9a2('0x1e')});}; \ No newline at end of file +var _0xba67=['lodash','util','../../config/logger','api','moment','bluebird','html-to-text','rimraf','../../config/environment','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','body','fromString','models','get','toLowerCase','direction','out','secret','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x11937f,_0x4cf7a7){var _0x4d473f=function(_0x2c384e){while(--_0x2c384e){_0x11937f['push'](_0x11937f['shift']());}};_0x4d473f(++_0x4cf7a7);}(_0xba67,0x118));var _0x7ba6=function(_0x319b4b,_0x220e4a){_0x319b4b=_0x319b4b-0x0;var _0x544c49=_0xba67[_0x319b4b];return _0x544c49;};'use strict';var _=require(_0x7ba6('0x0'));var util=require(_0x7ba6('0x1'));var logger=require(_0x7ba6('0x2'))(_0x7ba6('0x3'));var moment=require(_0x7ba6('0x4'));var BPromise=require(_0x7ba6('0x5'));var rp=require('request-promise');var htmlToText=require(_0x7ba6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ba6('0x7'));var config=require(_0x7ba6('0x8'));var attributes=require('./mailMessage.attributes');module[_0x7ba6('0x9')]=function(_0x20c041,_0x16052b){return _0x20c041[_0x7ba6('0xa')](_0x7ba6('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x7ba6('0xc'),'fields':[_0x7ba6('0xc')]},{'name':_0x7ba6('0xd'),'fields':[_0x7ba6('0xe'),_0x7ba6('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x581a57,_0xd605b4,_0x5e0b2c){if(_0x581a57[_0x7ba6('0x10')]){_0x581a57[_0x7ba6('0xe')]=htmlToText[_0x7ba6('0x11')](_0x581a57[_0x7ba6('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5e0b2c(null,_0xd605b4);},'afterCreate':function(_0x2b67eb,_0x18a2b1,_0xdd4203){var _0x8d6fbe=_0x20c041[_0x7ba6('0x12')];var _0x3b8e49=_0x2b67eb[_0x7ba6('0x13')]({'plain':!![]});if(_0x3b8e49['direction'][_0x7ba6('0x14')]()==='in'||_0x3b8e49[_0x7ba6('0x15')]['toLowerCase']()===_0x7ba6('0x16')&&!_0x3b8e49[_0x7ba6('0x17')]&&!_[_0x7ba6('0x18')](_0x3b8e49['UserId'])){_0x8d6fbe[_0x7ba6('0x19')][_0x7ba6('0x1a')]({'where':{'id':_0x3b8e49[_0x7ba6('0x1b')]}})[_0x7ba6('0x1c')](function(_0x894f4b){if(_0x894f4b){_0x894f4b[_0x7ba6('0x1d')]({'lastMsgAt':_0x3b8e49[_0x7ba6('0x1e')],'lastMsgDirection':_0x3b8e49['direction'][_0x7ba6('0x14')]()});}})[_0x7ba6('0x1f')](function(_0x4a2f07){console[_0x7ba6('0x20')](_0x4a2f07);});}_0xdd4203();}},'charset':_0x7ba6('0x21'),'collate':_0x7ba6('0x22')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 3a6050d..e925d66 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 _0x5204=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailMessage','body','options','CreateMailMessage','lodash'];(function(_0x3207a5,_0x33d1b1){var _0x308f93=function(_0x49e0e7){while(--_0x49e0e7){_0x3207a5['push'](_0x3207a5['shift']());}};_0x308f93(++_0x33d1b1);}(_0x5204,0xdf));var _0x4520=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0x5204[_0x2ab365];return _0x49fef3;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});config[_0x4520('0xb')]=_[_0x4520('0xc')](config[_0x4520('0xb')],{'host':_0x4520('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4520('0xb')]));require('./mailMessage.socket')[_0x4520('0xe')](socket);function respondWithRpcPromise(_0x37a617,_0x1a5324,_0x30ca43){return new BPromise(function(_0x4d767b,_0x297f8d){return client[_0x4520('0xf')](_0x37a617,_0x30ca43)[_0x4520('0x10')](function(_0x2a2a2f){logger[_0x4520('0x11')](_0x4520('0x12'),_0x1a5324,_0x4520('0x13'));logger[_0x4520('0x14')](_0x4520('0x15'),_0x1a5324,_0x4520('0x13'),JSON[_0x4520('0x16')](_0x2a2a2f));if(_0x2a2a2f[_0x4520('0x17')]){if(_0x2a2a2f[_0x4520('0x17')][_0x4520('0x18')]===0x1f4){logger[_0x4520('0x17')](_0x4520('0x12'),_0x1a5324,_0x2a2a2f['error'][_0x4520('0x19')]);return _0x297f8d(_0x2a2a2f[_0x4520('0x17')][_0x4520('0x19')]);}logger[_0x4520('0x17')](_0x4520('0x12'),_0x1a5324,_0x2a2a2f['error'][_0x4520('0x19')]);return _0x4d767b(_0x2a2a2f[_0x4520('0x17')][_0x4520('0x19')]);}else{logger[_0x4520('0x11')](_0x4520('0x12'),_0x1a5324,_0x4520('0x13'));_0x4d767b(_0x2a2a2f[_0x4520('0x1a')][_0x4520('0x19')]);}})[_0x4520('0x1b')](function(_0x11eaea){logger[_0x4520('0x17')](_0x4520('0x12'),_0x1a5324,_0x11eaea);_0x297f8d(_0x11eaea);});});}exports['CreateMailMessage']=function(_0xc016a3){var _0x52ca8c=this;return new Promise(function(_0x5ceff6,_0x4c46c5){return db[_0x4520('0x1c')]['create'](_0xc016a3[_0x4520('0x1d')],{'raw':_0xc016a3[_0x4520('0x1e')]?_0xc016a3[_0x4520('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x4520('0x10')](function(_0x4000d4){logger[_0x4520('0x11')]('CreateMailMessage',_0xc016a3);logger[_0x4520('0x14')](_0x4520('0x1f'),_0xc016a3,JSON[_0x4520('0x16')](_0x4000d4));_0x5ceff6(_0x4000d4);})[_0x4520('0x1b')](function(_0x2a8528){logger['error'](_0x4520('0x1f'),_0x2a8528[_0x4520('0x19')],_0xc016a3);_0x4c46c5(_0x52ca8c[_0x4520('0x17')](0x1f4,_0x2a8528[_0x4520('0x19')]));});});}; \ No newline at end of file +var _0x3de3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','CreateMailMessage','MailMessage','create','options','catch','lodash','moment','bluebird'];(function(_0x5f0f73,_0x250743){var _0x188358=function(_0x163737){while(--_0x163737){_0x5f0f73['push'](_0x5f0f73['shift']());}};_0x188358(++_0x250743);}(_0x3de3,0x1ce));var _0x33de=function(_0x4c1d05,_0x5c5bc3){_0x4c1d05=_0x4c1d05-0x0;var _0x1a38ed=_0x3de3[_0x4c1d05];return _0x1a38ed;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var moment=require(_0x33de('0x1'));var BPromise=require(_0x33de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33de('0x3'));var db=require(_0x33de('0x4'))['db'];var utils=require(_0x33de('0x5'));var logger=require(_0x33de('0x6'))('rpc');var config=require(_0x33de('0x7'));var jayson=require(_0x33de('0x8'));var client=jayson['client'][_0x33de('0x9')]({'port':0x232a});config['redis']=_[_0x33de('0xa')](config[_0x33de('0xb')],{'host':_0x33de('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33de('0xb')]));require(_0x33de('0xd'))[_0x33de('0xe')](socket);function respondWithRpcPromise(_0x5e1be7,_0x2cbf35,_0x348720){return new BPromise(function(_0x8b655d,_0x241211){return client[_0x33de('0xf')](_0x5e1be7,_0x348720)[_0x33de('0x10')](function(_0x8dfa3b){logger[_0x33de('0x11')](_0x33de('0x12'),_0x2cbf35,_0x33de('0x13'));logger[_0x33de('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2cbf35,_0x33de('0x13'),JSON[_0x33de('0x15')](_0x8dfa3b));if(_0x8dfa3b['error']){if(_0x8dfa3b['error'][_0x33de('0x16')]===0x1f4){logger[_0x33de('0x17')](_0x33de('0x12'),_0x2cbf35,_0x8dfa3b[_0x33de('0x17')]['message']);return _0x241211(_0x8dfa3b[_0x33de('0x17')][_0x33de('0x18')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x2cbf35,_0x8dfa3b[_0x33de('0x17')][_0x33de('0x18')]);return _0x8b655d(_0x8dfa3b[_0x33de('0x17')]['message']);}else{logger[_0x33de('0x11')](_0x33de('0x12'),_0x2cbf35,'request\x20sent');_0x8b655d(_0x8dfa3b[_0x33de('0x19')][_0x33de('0x18')]);}})['catch'](function(_0x5bb74e){logger[_0x33de('0x17')]('MailMessage,\x20%s,\x20%s',_0x2cbf35,_0x5bb74e);_0x241211(_0x5bb74e);});});}exports[_0x33de('0x1a')]=function(_0x2f0529){var _0x3810b5=this;return new Promise(function(_0x315c9b,_0xc4f1a4){return db[_0x33de('0x1b')][_0x33de('0x1c')](_0x2f0529['body'],{'raw':_0x2f0529['options']?_0x2f0529[_0x33de('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x33de('0x10')](function(_0x4cd8db){logger[_0x33de('0x11')](_0x33de('0x1a'),_0x2f0529);logger['debug'](_0x33de('0x1a'),_0x2f0529,JSON['stringify'](_0x4cd8db));_0x315c9b(_0x4cd8db);})[_0x33de('0x1e')](function(_0x5c602d){logger[_0x33de('0x17')](_0x33de('0x1a'),_0x5c602d[_0x33de('0x18')],_0x2f0529);_0xc4f1a4(_0x3810b5['error'](0x1f4,_0x5c602d[_0x33de('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 93dfd91..dd3a521 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 _0x9a69=['emit','register','length','save','remove','update'];(function(_0x3ff703,_0x56f6cb){var _0x500d02=function(_0xf852f4){while(--_0xf852f4){_0x3ff703['push'](_0x3ff703['shift']());}};_0x500d02(++_0x56f6cb);}(_0x9a69,0x75));var _0x99a6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9a69[_0x42cae2];return _0x5f256f;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x99a6('0x0'),_0x99a6('0x1'),_0x99a6('0x2')];function createListener(_0x2bc583,_0x43211d){return function(_0x4183f8){_0x43211d[_0x99a6('0x3')](_0x2bc583,_0x4183f8);};}function removeListener(_0x5e34a1,_0x15d059){return function(){MailMessageEvents['removeListener'](_0x5e34a1,_0x15d059);};}exports[_0x99a6('0x4')]=function(_0x35a831){for(var _0x567ae8=0x0,_0x66081a=events[_0x99a6('0x5')];_0x567ae8<_0x66081a;_0x567ae8++){var _0x15c120=events[_0x567ae8];var _0x1b2a68=createListener('mailMessage:'+_0x15c120,_0x35a831);MailMessageEvents['on'](_0x15c120,_0x1b2a68);}}; \ No newline at end of file +var _0x94dc=['register','mailMessage:','./mailMessage.events','remove','removeListener'];(function(_0x162c5e,_0x348792){var _0x21b45d=function(_0x28668b){while(--_0x28668b){_0x162c5e['push'](_0x162c5e['shift']());}};_0x21b45d(++_0x348792);}(_0x94dc,0xb1));var _0xc94d=function(_0x457da3,_0x22273e){_0x457da3=_0x457da3-0x0;var _0x237f45=_0x94dc[_0x457da3];return _0x237f45;};'use strict';var MailMessageEvents=require(_0xc94d('0x0'));var events=['save',_0xc94d('0x1'),'update'];function createListener(_0x1645b0,_0x1b2070){return function(_0x40e7d8){_0x1b2070['emit'](_0x1645b0,_0x40e7d8);};}function removeListener(_0x306706,_0x41d4ec){return function(){MailMessageEvents[_0xc94d('0x2')](_0x306706,_0x41d4ec);};}exports[_0xc94d('0x3')]=function(_0x3c0601){for(var _0x344188=0x0,_0xb7275c=events['length'];_0x344188<_0xb7275c;_0x344188++){var _0x2f9757=events[_0x344188];var _0xbe5904=createListener(_0xc94d('0x4')+_0x2f9757,_0x3c0601);MailMessageEvents['on'](_0x2f9757,_0xbe5904);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 7c7ad8c..3afa6d8 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 _0xd5bd=['put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents'];(function(_0x2042a4,_0x16f91e){var _0x233995=function(_0x3a864f){while(--_0x3a864f){_0x2042a4['push'](_0x2042a4['shift']());}};_0x233995(++_0x16f91e);}(_0xd5bd,0x1b9));var _0xdd5b=function(_0x23e5ce,_0x57584d){_0x23e5ce=_0x23e5ce-0x0;var _0x2ce19b=_0xd5bd[_0x23e5ce];return _0x2ce19b;};'use strict';var multer=require(_0xdd5b('0x0'));var util=require(_0xdd5b('0x1'));var path=require(_0xdd5b('0x2'));var timeout=require(_0xdd5b('0x3'));var express=require(_0xdd5b('0x4'));var router=express[_0xdd5b('0x5')]();var fs_extra=require(_0xdd5b('0x6'));var auth=require(_0xdd5b('0x7'));var interaction=require(_0xdd5b('0x8'));var config=require(_0xdd5b('0x9'));var controller=require(_0xdd5b('0xa'));router[_0xdd5b('0xb')]('/',auth[_0xdd5b('0xc')](),controller['index']);router[_0xdd5b('0xb')]('/describe',auth[_0xdd5b('0xc')](),controller[_0xdd5b('0xd')]);router['get'](_0xdd5b('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xdd5b('0xb')](_0xdd5b('0xf'),auth[_0xdd5b('0xc')](),controller[_0xdd5b('0x10')]);router[_0xdd5b('0xb')](_0xdd5b('0x11'),auth[_0xdd5b('0xc')](),controller[_0xdd5b('0x12')]);router[_0xdd5b('0xb')]('/:id/users',auth[_0xdd5b('0xc')](),controller[_0xdd5b('0x13')]);router[_0xdd5b('0x14')]('/',auth[_0xdd5b('0xc')](),controller['create']);router[_0xdd5b('0x14')]('/:id/teams',auth[_0xdd5b('0xc')](),controller[_0xdd5b('0x15')]);router[_0xdd5b('0x14')](_0xdd5b('0x16'),auth[_0xdd5b('0xc')](),controller[_0xdd5b('0x17')]);router[_0xdd5b('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xdd5b('0x19')]);router[_0xdd5b('0x1a')](_0xdd5b('0xe'),auth[_0xdd5b('0xc')](),controller[_0xdd5b('0x1b')]);router[_0xdd5b('0x1a')](_0xdd5b('0x11'),auth['isAuthenticated'](),controller[_0xdd5b('0x1c')]);router['delete'](_0xdd5b('0x16'),auth[_0xdd5b('0xc')](),controller[_0xdd5b('0x1d')]);module[_0xdd5b('0x1e')]=router; \ No newline at end of file +var _0x5391=['create','addTeams','put','update','delete','destroy','removeTeams','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x336082,_0x5c364b){var _0x2ea2eb=function(_0x4c6c53){while(--_0x4c6c53){_0x336082['push'](_0x336082['shift']());}};_0x2ea2eb(++_0x5c364b);}(_0x5391,0x13b));var _0x1539=function(_0x3679fa,_0x1728f5){_0x3679fa=_0x3679fa-0x0;var _0x233bb1=_0x5391[_0x3679fa];return _0x233bb1;};'use strict';var multer=require(_0x1539('0x0'));var util=require(_0x1539('0x1'));var path=require(_0x1539('0x2'));var timeout=require(_0x1539('0x3'));var express=require(_0x1539('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1539('0x5'));var interaction=require(_0x1539('0x6'));var config=require(_0x1539('0x7'));var controller=require('./mailQueue.controller');router[_0x1539('0x8')]('/',auth['isAuthenticated'](),controller[_0x1539('0x9')]);router['get'](_0x1539('0xa'),auth[_0x1539('0xb')](),controller[_0x1539('0xc')]);router[_0x1539('0x8')](_0x1539('0xd'),auth[_0x1539('0xb')](),controller[_0x1539('0xe')]);router[_0x1539('0x8')]('/:id/members',auth[_0x1539('0xb')](),controller[_0x1539('0xf')]);router[_0x1539('0x8')](_0x1539('0x10'),auth[_0x1539('0xb')](),controller[_0x1539('0x11')]);router[_0x1539('0x8')](_0x1539('0x12'),auth['isAuthenticated'](),controller[_0x1539('0x13')]);router[_0x1539('0x14')]('/',auth[_0x1539('0xb')](),controller[_0x1539('0x15')]);router['post'](_0x1539('0x10'),auth[_0x1539('0xb')](),controller[_0x1539('0x16')]);router[_0x1539('0x14')](_0x1539('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x1539('0x17')](_0x1539('0xd'),auth['isAuthenticated'](),controller[_0x1539('0x18')]);router[_0x1539('0x19')](_0x1539('0xd'),auth[_0x1539('0xb')](),controller[_0x1539('0x1a')]);router[_0x1539('0x19')](_0x1539('0x10'),auth[_0x1539('0xb')](),controller[_0x1539('0x1b')]);router[_0x1539('0x19')](_0x1539('0x12'),auth[_0x1539('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index d3de466..06b3cf1 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 _0xdd17=['INTEGER','ENUM','rrmemory','beepall','exports','name','STRING'];(function(_0x2c4483,_0x41cc5b){var _0x43b0ac=function(_0x1d98b3){while(--_0x1d98b3){_0x2c4483['push'](_0x2c4483['shift']());}};_0x43b0ac(++_0x41cc5b);}(_0xdd17,0x1ee));var _0x7dd1=function(_0x336359,_0x4bdc94){_0x336359=_0x336359-0x0;var _0x552770=_0xdd17[_0x336359];return _0x552770;};'use strict';var Sequelize=require('sequelize');module[_0x7dd1('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x7dd1('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7dd1('0x2')]},'timeout':{'type':Sequelize[_0x7dd1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7dd1('0x4')](_0x7dd1('0x5'),_0x7dd1('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xb02f=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x30bfeb,_0x4c2f77){var _0x5e2f23=function(_0x170997){while(--_0x170997){_0x30bfeb['push'](_0x30bfeb['shift']());}};_0x5e2f23(++_0x4c2f77);}(_0xb02f,0xc2));var _0xfb02=function(_0x368a8c,_0x3c8ec5){_0x368a8c=_0x368a8c-0x0;var _0x80de7f=_0xb02f[_0x368a8c];return _0x80de7f;};'use strict';var Sequelize=require(_0xfb02('0x0'));module[_0xfb02('0x1')]={'name':{'type':Sequelize[_0xfb02('0x2')],'unique':_0xfb02('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfb02('0x2')]},'timeout':{'type':Sequelize[_0xfb02('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb02('0x5')]('rrmemory',_0xfb02('0x6'),_0xfb02('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index de27637..a56e921 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 _0xbee3=['includeAll','catch','show','params','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','MailQueues','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','UserMailQueue','pick','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','mailPause','getTeams','findOne','Team','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userMailQueue:save','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','addAgents','omit','isArray','userMailQueue:remove','getAgents','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','map','MailQueue','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xbee3,0xd5));var _0x3bee=function(_0x744b7c,_0x10d9e9){_0x744b7c=_0x744b7c-0x0;var _0x1b3ba6=_0xbee3[_0x744b7c];return _0x1b3ba6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3bee('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3bee('0x3'));var util=require(_0x3bee('0x4'));var path=require(_0x3bee('0x5'));var sox=require('sox');var csv=require(_0x3bee('0x6'));var ejs=require(_0x3bee('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3bee('0x8'));var squel=require(_0x3bee('0x9'));var crypto=require(_0x3bee('0xa'));var jsforce=require(_0x3bee('0xb'));var deskjs=require(_0x3bee('0xc'));var toCsv=require(_0x3bee('0x6'));var querystring=require(_0x3bee('0xd'));var Papa=require('papaparse');var Redis=require(_0x3bee('0xe'));var authService=require(_0x3bee('0xf'));var qs=require(_0x3bee('0x10'));var as=require(_0x3bee('0x11'));var hardwareService=require(_0x3bee('0x12'));var logger=require(_0x3bee('0x13'))('api');var utils=require(_0x3bee('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3bee('0x15'));var db=require(_0x3bee('0x16'))['db'];config[_0x3bee('0x17')]=_[_0x3bee('0x18')](config[_0x3bee('0x17')],{'host':_0x3bee('0x19'),'port':0x18eb});var socket=require(_0x3bee('0x1a'))(new Redis(config['redis']));require(_0x3bee('0x1b'))[_0x3bee('0x1c')](socket);function respondWithStatusCode(_0x31ac52,_0x237110){_0x237110=_0x237110||0xcc;return function(_0x3a0396){if(_0x3a0396){return _0x31ac52['sendStatus'](_0x237110);}return _0x31ac52['status'](_0x237110)[_0x3bee('0x1d')]();};}function respondWithResult(_0x515397,_0x2cfba7){_0x2cfba7=_0x2cfba7||0xc8;return function(_0x7e763c){if(_0x7e763c){return _0x515397['status'](_0x2cfba7)['json'](_0x7e763c);}};}function respondWithFilteredResult(_0x1582a4,_0x36c5aa){return function(_0xfdba3b){if(_0xfdba3b){var _0x631ff8=typeof _0x36c5aa['offset']===_0x3bee('0x1e')&&typeof _0x36c5aa[_0x3bee('0x1f')]===_0x3bee('0x1e');var _0x49b32d=_0xfdba3b[_0x3bee('0x20')];var _0xa1a004=_0x631ff8?0x0:_0x36c5aa[_0x3bee('0x21')];var _0x556d13=_0x631ff8?_0xfdba3b['count']:_0x36c5aa[_0x3bee('0x21')]+_0x36c5aa[_0x3bee('0x1f')];var _0x57aba4;if(_0x556d13>=_0x49b32d){_0x556d13=_0x49b32d;_0x57aba4=0xc8;}else{_0x57aba4=0xce;}_0x1582a4[_0x3bee('0x22')](_0x57aba4);return _0x1582a4[_0x3bee('0x23')](_0x3bee('0x24'),_0xa1a004+'-'+_0x556d13+'/'+_0x49b32d)[_0x3bee('0x25')](_0xfdba3b);}return null;};}function patchUpdates(_0x28c248){return function(_0x26e92e){try{jsonpatch[_0x3bee('0x26')](_0x26e92e,_0x28c248,!![]);}catch(_0x582fa9){return BPromise[_0x3bee('0x27')](_0x582fa9);}return _0x26e92e[_0x3bee('0x28')]();};}function saveUpdates(_0x1fed5a,_0x3bb884){return function(_0x500664){if(_0x500664){return _0x500664[_0x3bee('0x29')](_0x1fed5a)[_0x3bee('0x2a')](function(_0x1e0111){return _0x1e0111;});}return null;};}function removeEntity(_0x4b4cd4,_0x5ed022){return function(_0x13181e){if(_0x13181e){return _0x13181e[_0x3bee('0x2b')]()['then'](function(){var _0x2c0e50=_0x13181e[_0x3bee('0x2c')]({'plain':!![]});var _0x2e666a='MailQueues';return db[_0x3bee('0x2d')][_0x3bee('0x2b')]({'where':{'type':_0x2e666a,'resourceId':_0x2c0e50['id']}})[_0x3bee('0x2a')](function(){return _0x13181e;});})['then'](function(){_0x4b4cd4[_0x3bee('0x22')](0xcc)[_0x3bee('0x1d')]();});}};}function handleEntityNotFound(_0x3a3d92,_0x496abd){return function(_0x1115ed){if(!_0x1115ed){_0x3a3d92[_0x3bee('0x2e')](0x194);}return _0x1115ed;};}function handleError(_0x27ed99,_0xda5745){_0xda5745=_0xda5745||0x1f4;return function(_0x3433aa){logger['error'](_0x3433aa['stack']);if(_0x3433aa[_0x3bee('0x2f')]){delete _0x3433aa[_0x3bee('0x2f')];}_0x27ed99[_0x3bee('0x22')](_0xda5745)[_0x3bee('0x30')](_0x3433aa);};}exports['index']=function(_0x47877d,_0x38f93c){var _0x42cb58={},_0x4f5b58={},_0x51be99={'count':0x0,'rows':[]};var _0xf4701f=_[_0x3bee('0x31')](db[_0x3bee('0x32')][_0x3bee('0x33')],function(_0x845f21){return{'name':_0x845f21[_0x3bee('0x34')],'type':_0x845f21[_0x3bee('0x35')][_0x3bee('0x36')]};});_0x4f5b58[_0x3bee('0x37')]=_[_0x3bee('0x31')](_0xf4701f,'name');_0x4f5b58['query']=_[_0x3bee('0x38')](_0x47877d['query']);_0x4f5b58['filters']=_[_0x3bee('0x39')](_0x4f5b58[_0x3bee('0x37')],_0x4f5b58[_0x3bee('0x3a')]);_0x42cb58[_0x3bee('0x3b')]=_[_0x3bee('0x39')](_0x4f5b58[_0x3bee('0x37')],qs[_0x3bee('0x3c')](_0x47877d[_0x3bee('0x3a')]['fields']));_0x42cb58[_0x3bee('0x3b')]=_0x42cb58[_0x3bee('0x3b')]['length']?_0x42cb58[_0x3bee('0x3b')]:_0x4f5b58[_0x3bee('0x37')];if(!_0x47877d[_0x3bee('0x3a')][_0x3bee('0x3d')](_0x3bee('0x3e'))){_0x42cb58['limit']=qs['limit'](_0x47877d[_0x3bee('0x3a')][_0x3bee('0x1f')]);_0x42cb58[_0x3bee('0x21')]=qs[_0x3bee('0x21')](_0x47877d[_0x3bee('0x3a')][_0x3bee('0x21')]);}_0x42cb58[_0x3bee('0x3f')]=qs[_0x3bee('0x40')](_0x47877d[_0x3bee('0x3a')][_0x3bee('0x40')]);_0x42cb58[_0x3bee('0x41')]=qs[_0x3bee('0x42')](_['pick'](_0x47877d[_0x3bee('0x3a')],_0x4f5b58[_0x3bee('0x42')]),_0xf4701f);if(_0x47877d[_0x3bee('0x3a')][_0x3bee('0x43')]){_0x42cb58[_0x3bee('0x41')]=_[_0x3bee('0x44')](_0x42cb58[_0x3bee('0x41')],{'$or':_[_0x3bee('0x31')](_0xf4701f,function(_0x1ed537){if(_0x1ed537[_0x3bee('0x35')]!==_0x3bee('0x45')){var _0x23f6e1={};_0x23f6e1[_0x1ed537[_0x3bee('0x2f')]]={'$like':'%'+_0x47877d['query'][_0x3bee('0x43')]+'%'};return _0x23f6e1;}})});}_0x42cb58=_[_0x3bee('0x44')]({},_0x42cb58,_0x47877d[_0x3bee('0x46')]);var _0x306eba={'where':_0x42cb58[_0x3bee('0x41')]};return db[_0x3bee('0x32')][_0x3bee('0x20')](_0x306eba)[_0x3bee('0x2a')](function(_0x5d9e1b){_0x51be99[_0x3bee('0x20')]=_0x5d9e1b;if(_0x47877d[_0x3bee('0x3a')][_0x3bee('0x47')]){_0x42cb58['include']=[{'all':!![]}];}return db[_0x3bee('0x32')]['findAll'](_0x42cb58);})[_0x3bee('0x2a')](function(_0x48325e){_0x51be99['rows']=_0x48325e;return _0x51be99;})[_0x3bee('0x2a')](respondWithFilteredResult(_0x38f93c,_0x42cb58))[_0x3bee('0x48')](handleError(_0x38f93c,null));};exports[_0x3bee('0x49')]=function(_0x104068,_0x5b03a){var _0x55627a={'raw':!![],'where':{'id':_0x104068[_0x3bee('0x4a')]['id']}},_0x52b028={};_0x52b028['model']=_[_0x3bee('0x38')](db['MailQueue'][_0x3bee('0x33')]);_0x52b028['query']=_[_0x3bee('0x38')](_0x104068[_0x3bee('0x3a')]);_0x52b028[_0x3bee('0x42')]=_[_0x3bee('0x39')](_0x52b028['model'],_0x52b028['query']);_0x55627a[_0x3bee('0x3b')]=_['intersection'](_0x52b028['model'],qs['fields'](_0x104068[_0x3bee('0x3a')]['fields']));_0x55627a[_0x3bee('0x3b')]=_0x55627a[_0x3bee('0x3b')][_0x3bee('0x4b')]?_0x55627a['attributes']:_0x52b028[_0x3bee('0x37')];if(_0x104068['query'][_0x3bee('0x47')]){_0x55627a['include']=[{'all':!![]}];}_0x55627a=_[_0x3bee('0x44')]({},_0x55627a,_0x104068[_0x3bee('0x46')]);return db[_0x3bee('0x32')]['find'](_0x55627a)[_0x3bee('0x2a')](handleEntityNotFound(_0x5b03a,null))[_0x3bee('0x2a')](respondWithResult(_0x5b03a,null))[_0x3bee('0x48')](handleError(_0x5b03a,null));};exports['create']=function(_0x479d7f,_0x6f1388){return db[_0x3bee('0x32')][_0x3bee('0x4c')](_0x479d7f[_0x3bee('0x4d')],{})[_0x3bee('0x2a')](function(_0x21ab40){var _0x4005a3=_0x479d7f['user'][_0x3bee('0x2c')]({'plain':!![]});if(!_0x4005a3)throw new Error(_0x3bee('0x4e'));if(_0x4005a3['role']==='user'){var _0x3730c5=_0x21ab40['get']({'plain':!![]});var _0x1cb54e=_0x3bee('0x4f');return db[_0x3bee('0x50')]['find']({'where':{'name':_0x1cb54e,'userProfileId':_0x4005a3[_0x3bee('0x51')]},'raw':!![]})[_0x3bee('0x2a')](function(_0x127cb8){if(_0x127cb8&&_0x127cb8['autoAssociation']===0x0){return db[_0x3bee('0x2d')][_0x3bee('0x4c')]({'name':_0x3730c5['name'],'resourceId':_0x3730c5['id'],'type':_0x127cb8[_0x3bee('0x2f')],'sectionId':_0x127cb8['id']},{})[_0x3bee('0x2a')](function(){return _0x21ab40;});}else{return _0x21ab40;}})['catch'](function(_0x432920){logger[_0x3bee('0x52')](_0x3bee('0x53'),_0x432920);throw _0x432920;});}return _0x21ab40;})[_0x3bee('0x2a')](respondWithResult(_0x6f1388,0xc9))[_0x3bee('0x48')](handleError(_0x6f1388,null));};exports[_0x3bee('0x29')]=function(_0xf7f9c3,_0x72c2c4){if(_0xf7f9c3['body']['id']){delete _0xf7f9c3['body']['id'];}return db[_0x3bee('0x32')]['find']({'where':{'id':_0xf7f9c3[_0x3bee('0x4a')]['id']}})[_0x3bee('0x2a')](handleEntityNotFound(_0x72c2c4,null))[_0x3bee('0x2a')](saveUpdates(_0xf7f9c3['body'],null))[_0x3bee('0x2a')](respondWithResult(_0x72c2c4,null))[_0x3bee('0x48')](handleError(_0x72c2c4,null));};exports[_0x3bee('0x2b')]=function(_0x5d5a2e,_0x19cbb8){return db['MailQueue'][_0x3bee('0x54')]({'where':{'id':_0x5d5a2e[_0x3bee('0x4a')]['id']}})[_0x3bee('0x2a')](handleEntityNotFound(_0x19cbb8,null))['then'](removeEntity(_0x19cbb8,null))[_0x3bee('0x48')](handleError(_0x19cbb8,null));};exports[_0x3bee('0x55')]=function(_0x282300,_0x526551){return db['MailQueue'][_0x3bee('0x55')]()[_0x3bee('0x2a')](respondWithResult(_0x526551,null))[_0x3bee('0x48')](handleError(_0x526551,null));};exports['getMembers']=function(_0x4a8d2b,_0x2799e3,_0x572fa6){var _0x5cd620={'raw':!![],'where':{}},_0xbae40e={},_0x2a8f08;return db[_0x3bee('0x32')]['findOne']({'where':{'id':_0x4a8d2b['params']['id']}})[_0x3bee('0x2a')](handleEntityNotFound(_0x2799e3,null))[_0x3bee('0x2a')](function(_0x480b54){if(_0x480b54){_0x2a8f08=_0x480b54[_0x3bee('0x2c')]({'plain':!![]});_0xbae40e['model']=_[_0x3bee('0x38')](db[_0x3bee('0x56')][_0x3bee('0x33')]);_0xbae40e[_0x3bee('0x3a')]=_[_0x3bee('0x38')](_0x4a8d2b[_0x3bee('0x3a')]);_0xbae40e[_0x3bee('0x42')]=_[_0x3bee('0x39')](_0xbae40e[_0x3bee('0x37')],_0xbae40e[_0x3bee('0x3a')]);_0x5cd620[_0x3bee('0x3b')]=_['intersection'](_0xbae40e['model'],qs['fields'](_0x4a8d2b[_0x3bee('0x3a')][_0x3bee('0x3c')]));_0x5cd620[_0x3bee('0x3b')]=_0x5cd620[_0x3bee('0x3b')]['length']?_0x5cd620[_0x3bee('0x3b')]:_0xbae40e[_0x3bee('0x37')];if(!_0x4a8d2b['query']['hasOwnProperty'](_0x3bee('0x3e'))){_0x5cd620[_0x3bee('0x1f')]=qs[_0x3bee('0x1f')](_0x4a8d2b['query'][_0x3bee('0x1f')]);_0x5cd620[_0x3bee('0x21')]=qs[_0x3bee('0x21')](_0x4a8d2b['query'][_0x3bee('0x21')]);}_0x5cd620[_0x3bee('0x3f')]=qs[_0x3bee('0x40')](_0x4a8d2b[_0x3bee('0x3a')]['sort']);_0x5cd620['where']=qs[_0x3bee('0x42')](_[_0x3bee('0x57')](_0x4a8d2b[_0x3bee('0x3a')],_0xbae40e[_0x3bee('0x42')]));_0x5cd620[_0x3bee('0x41')]['MailQueueId']=_0x480b54['id'];if(_0x4a8d2b[_0x3bee('0x3a')]['filter']){_0x5cd620[_0x3bee('0x41')]=_[_0x3bee('0x44')](_0x5cd620[_0x3bee('0x41')],{'$or':_[_0x3bee('0x31')](_0x5cd620[_0x3bee('0x3b')],function(_0x2c049a){var _0x3f7dad={};_0x3f7dad[_0x2c049a]={'$like':'%'+_0x4a8d2b['query'][_0x3bee('0x43')]+'%'};return _0x3f7dad;})});}_0x5cd620=_[_0x3bee('0x44')]({},_0x5cd620,_0x4a8d2b[_0x3bee('0x46')]);return db[_0x3bee('0x56')]['findAll'](_0x5cd620);}})[_0x3bee('0x2a')](function(_0x378f83){if(_0x378f83){return db[_0x3bee('0x58')][_0x3bee('0x59')]({'where':{'id':_[_0x3bee('0x31')](_0x378f83,_0x3bee('0x5a')),'role':_0x3bee('0x5b')},'attributes':['id',_0x3bee('0x2f'),'mailPause',_0x3bee('0x5c'),_0x3bee('0x5d')]});}})[_0x3bee('0x2a')](function(_0x49f2af){if(_0x49f2af){return{'count':_0x49f2af[_0x3bee('0x20')],'rows':_[_0x3bee('0x31')](_0x49f2af[_0x3bee('0x5e')],function(_0x3890cd){return{'membername':_0x3890cd[_0x3bee('0x2f')],'UserId':_0x3890cd['id'],'queue_name':_0x2a8f08[_0x3bee('0x2f')],'MailQueueId':_0x2a8f08['id'],'interface':util[_0x3bee('0x5f')](_0x3bee('0x60'),_0x3bee('0x61'),_0x3890cd[_0x3bee('0x2f')]),'penalty':0x0,'paused':_0x3890cd[_0x3bee('0x62')],'createdAt':_0x3890cd[_0x3bee('0x5d')],'updatedAt':_0x3890cd[_0x3bee('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3bee('0x2a')](respondWithFilteredResult(_0x2799e3,_0x5cd620))[_0x3bee('0x48')](handleError(_0x2799e3,null));};exports[_0x3bee('0x63')]=function(_0x1e5f6d,_0x116a9b,_0x38e1be){var _0x30e979={};var _0x3c5600={};var _0x464355;var _0x316a5a;return db[_0x3bee('0x32')][_0x3bee('0x64')]({'where':{'id':_0x1e5f6d['params']['id']}})[_0x3bee('0x2a')](handleEntityNotFound(_0x116a9b,null))[_0x3bee('0x2a')](function(_0x46bf22){if(_0x46bf22){_0x464355=_0x46bf22;_0x3c5600[_0x3bee('0x37')]=_[_0x3bee('0x38')](db[_0x3bee('0x65')][_0x3bee('0x33')]);_0x3c5600[_0x3bee('0x3a')]=_[_0x3bee('0x38')](_0x1e5f6d['query']);_0x3c5600[_0x3bee('0x42')]=_[_0x3bee('0x39')](_0x3c5600['model'],_0x3c5600[_0x3bee('0x3a')]);_0x30e979['attributes']=_[_0x3bee('0x39')](_0x3c5600[_0x3bee('0x37')],qs[_0x3bee('0x3c')](_0x1e5f6d['query']['fields']));_0x30e979[_0x3bee('0x3b')]=_0x30e979[_0x3bee('0x3b')][_0x3bee('0x4b')]?_0x30e979[_0x3bee('0x3b')]:_0x3c5600[_0x3bee('0x37')];_0x30e979[_0x3bee('0x3f')]=qs[_0x3bee('0x40')](_0x1e5f6d[_0x3bee('0x3a')]['sort']);_0x30e979[_0x3bee('0x41')]=qs[_0x3bee('0x42')](_[_0x3bee('0x57')](_0x1e5f6d[_0x3bee('0x3a')],_0x3c5600[_0x3bee('0x42')]));if(_0x1e5f6d[_0x3bee('0x3a')][_0x3bee('0x43')]){_0x30e979['where']=_[_0x3bee('0x44')](_0x30e979[_0x3bee('0x41')],{'$or':_['map'](_0x30e979[_0x3bee('0x3b')],function(_0x1f3816){var _0x47adb7={};_0x47adb7[_0x1f3816]={'$like':'%'+_0x1e5f6d[_0x3bee('0x3a')]['filter']+'%'};return _0x47adb7;})});}_0x30e979=_[_0x3bee('0x44')]({},_0x30e979,_0x1e5f6d[_0x3bee('0x46')]);return _0x464355[_0x3bee('0x63')](_0x30e979);}})[_0x3bee('0x2a')](function(_0x515717){if(_0x515717){_0x316a5a=_0x515717[_0x3bee('0x4b')];if(!_0x1e5f6d[_0x3bee('0x3a')][_0x3bee('0x3d')]('nolimit')){_0x30e979[_0x3bee('0x1f')]=qs[_0x3bee('0x1f')](_0x1e5f6d['query'][_0x3bee('0x1f')]);_0x30e979[_0x3bee('0x21')]=qs['offset'](_0x1e5f6d[_0x3bee('0x3a')][_0x3bee('0x21')]);}return _0x464355[_0x3bee('0x63')](_0x30e979);}})[_0x3bee('0x2a')](function(_0x1e8d22){if(_0x1e8d22){return _0x1e8d22?{'count':_0x316a5a,'rows':_0x1e8d22}:null;}})['then'](respondWithResult(_0x116a9b,null))[_0x3bee('0x48')](handleError(_0x116a9b,null));};exports[_0x3bee('0x66')]=function(_0x3d8f1b,_0x48337f,_0x49859c){var _0x133909=_0x3d8f1b[_0x3bee('0x4d')][_0x3bee('0x67')];return db[_0x3bee('0x65')][_0x3bee('0x68')]({'where':{'id':_0x133909},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3bee('0x69'),'attributes':['id','name',_0x3bee('0x6a'),_0x3bee('0x6b'),_0x3bee('0x6c')],'raw':!![]}]})[_0x3bee('0x2a')](function(_0x3ca8ad){if(_0x3ca8ad){var _0x20331a=_[_0x3bee('0x6d')](_0x3ca8ad,function(_0x2116eb){var _0x252ef1=_0x2116eb['get']({'plain':!![]});return _0x252ef1[_0x3bee('0x69')];});return db['MailQueue']['find']({'where':{'id':_0x3d8f1b[_0x3bee('0x4a')]['id']}})['then'](function(_0x49e2f5){return db[_0x3bee('0x6e')][_0x3bee('0x6f')](function(_0x31f180){return _0x49e2f5[_0x3bee('0x66')](_0x133909,{'transaction':_0x31f180})[_0x3bee('0x2a')](function(){return BPromise[_0x3bee('0x70')](_0x20331a,function(_0x14d391){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x14d391['id'],'MailQueueId':_0x3d8f1b['params']['id']},'transaction':_0x31f180});});})['then'](function(){_0x20331a[_0x3bee('0x71')](function(_0x5dc940){socket[_0x3bee('0x72')](_0x3bee('0x73'),{'UserId':_0x5dc940['id'],'MailQueueId':_0x49e2f5['id']});});});});});}})['then'](respondWithStatusCode(_0x48337f,null))[_0x3bee('0x48')](handleError(_0x48337f,null));};exports['removeTeams']=function(_0x268d7d,_0x23da0a,_0x20f12f){return db[_0x3bee('0x65')][_0x3bee('0x68')]({'where':{'id':_0x268d7d[_0x3bee('0x3a')][_0x3bee('0x67')]},'attributes':['id'],'include':[{'model':db[_0x3bee('0x58')],'as':_0x3bee('0x69'),'attributes':['id'],'raw':!![]}]})[_0x3bee('0x2a')](handleEntityNotFound(_0x23da0a,null))[_0x3bee('0x2a')](function(_0x191539){var _0x392e03=_[_0x3bee('0x31')](_0x191539,'id');var _0x4098d6=[];var _0x241e05=[];var _0xa3a59c=squel['select']();_0xa3a59c[_0x3bee('0x74')](_0x3bee('0x75'))[_0x3bee('0x76')](_0x3bee('0x77'),'tq')['join'](_0x3bee('0x78'),'ut',_0x3bee('0x79'))['where'](_0x3bee('0x7a'),_0x268d7d[_0x3bee('0x4a')]['id']);for(var _0x240df0=0x0;_0x240df0<_0x191539[_0x3bee('0x4b')];_0x240df0+=0x1){let _0x56f06f=_0x191539[_0x240df0];for(var _0x22a0e7=0x0;_0x22a0e7<_0x56f06f[_0x3bee('0x69')]['length'];_0x22a0e7+=0x1){let _0x1ee101=_0x56f06f[_0x3bee('0x69')][_0x22a0e7];var _0x15f0ee=_0xa3a59c[_0x3bee('0x7b')]();_0x15f0ee[_0x3bee('0x41')]('ut.UserId\x20=\x20?',_0x1ee101['id']);_0x241e05[_0x3bee('0x7c')](db[_0x3bee('0x6e')][_0x3bee('0x3a')](_0x15f0ee[_0x3bee('0x7d')](),{'type':db['sequelize'][_0x3bee('0x7e')][_0x3bee('0x7f')]})[_0x3bee('0x2a')](function(_0x5311af){if(_0x5311af['length']===0x1){return _0x1ee101['id'];}else{var _0x362065=_[_0x3bee('0x80')](_[_0x3bee('0x31')](_0x5311af,_0x3bee('0x81')),function(_0x21e062){return _[_0x3bee('0x82')](_0x392e03,_0x21e062);});if(_0x362065){return _0x1ee101['id'];}}}));}}return BPromise[_0x3bee('0x83')](_0x241e05)[_0x3bee('0x2a')](function(_0x3e93df){_0x4098d6=_(_0x4098d6)[_0x3bee('0x84')](_0x3e93df)['compact']()[_0x3bee('0x85')]();return db[_0x3bee('0x32')]['find']({'where':{'id':_0x268d7d[_0x3bee('0x4a')]['id']}})[_0x3bee('0x2a')](function(_0x4f3770){return db[_0x3bee('0x6e')][_0x3bee('0x6f')](function(_0xe307){return _0x4f3770[_0x3bee('0x86')](_0x268d7d[_0x3bee('0x3a')][_0x3bee('0x67')],{'transaction':_0xe307})[_0x3bee('0x2a')](function(){if(!_[_0x3bee('0x87')](_0x4098d6)){return _0x4f3770[_0x3bee('0x88')](_0x4098d6,{'transaction':_0xe307});}})[_0x3bee('0x2a')](function(){_0x4098d6[_0x3bee('0x71')](function(_0x33724d){socket[_0x3bee('0x72')]('userMailQueue:remove',{'UserId':_0x33724d,'MailQueueId':_0x4f3770['id']});});});});});});})[_0x3bee('0x2a')](respondWithStatusCode(_0x23da0a,null))[_0x3bee('0x48')](handleError(_0x23da0a,null));};exports[_0x3bee('0x89')]=function(_0x1090db,_0x32bf32,_0x4a5851){return db[_0x3bee('0x32')][_0x3bee('0x54')]({'where':{'id':_0x1090db[_0x3bee('0x4a')]['id']}})[_0x3bee('0x2a')](handleEntityNotFound(_0x32bf32,null))[_0x3bee('0x2a')](function(_0x410a4f){if(_0x410a4f){return _0x410a4f[_0x3bee('0x89')](_0x1090db[_0x3bee('0x4d')][_0x3bee('0x67')],_[_0x3bee('0x8a')](_0x1090db[_0x3bee('0x4d')],[_0x3bee('0x67'),'id'])||{})['spread'](function(_0x5b8de2){for(var _0x3477a4=0x0;_0x3477a4<_0x1090db[_0x3bee('0x4d')][_0x3bee('0x67')][_0x3bee('0x4b')];_0x3477a4+=0x1){socket[_0x3bee('0x72')](_0x3bee('0x73'),{'UserId':Number(_0x1090db[_0x3bee('0x4d')][_0x3bee('0x67')][_0x3477a4]),'MailQueueId':Number(_0x1090db['params']['id'])});}return _0x5b8de2;});}})[_0x3bee('0x2a')](respondWithResult(_0x32bf32,null))[_0x3bee('0x48')](handleError(_0x32bf32,null));};exports[_0x3bee('0x88')]=function(_0x105425,_0x2e19cb,_0x1e68f4){return db['MailQueue']['find']({'where':{'id':_0x105425[_0x3bee('0x4a')]['id']}})[_0x3bee('0x2a')](handleEntityNotFound(_0x2e19cb,null))['then'](function(_0x3df342){if(_0x3df342){return _0x3df342[_0x3bee('0x88')](_0x105425['query'][_0x3bee('0x67')])[_0x3bee('0x2a')](function(){if(_[_0x3bee('0x8b')](_0x105425[_0x3bee('0x3a')][_0x3bee('0x67')])){for(var _0x1c1a0b=0x0;_0x1c1a0b<_0x105425[_0x3bee('0x3a')][_0x3bee('0x67')]['length'];_0x1c1a0b+=0x1){socket[_0x3bee('0x72')](_0x3bee('0x8c'),{'UserId':Number(_0x105425[_0x3bee('0x3a')][_0x3bee('0x67')][_0x1c1a0b]),'MailQueueId':Number(_0x105425[_0x3bee('0x4a')]['id'])});}}else{socket[_0x3bee('0x72')](_0x3bee('0x8c'),{'UserId':Number(_0x105425['query'][_0x3bee('0x67')]),'MailQueueId':Number(_0x105425[_0x3bee('0x4a')]['id'])});}});}})[_0x3bee('0x2a')](respondWithStatusCode(_0x2e19cb,null))[_0x3bee('0x48')](handleError(_0x2e19cb,null));};exports['getAgents']=function(_0x5eceb9,_0x315511,_0xfc9faf){var _0x875997={};var _0x4b198a={};var _0x3acc56;var _0x3a062a;return db[_0x3bee('0x32')]['findOne']({'where':{'id':_0x5eceb9[_0x3bee('0x4a')]['id']}})[_0x3bee('0x2a')](handleEntityNotFound(_0x315511,null))[_0x3bee('0x2a')](function(_0x2711bc){if(_0x2711bc){_0x3acc56=_0x2711bc;_0x4b198a[_0x3bee('0x37')]=_[_0x3bee('0x38')](db[_0x3bee('0x58')][_0x3bee('0x33')]);_0x4b198a['query']=_['keys'](_0x5eceb9[_0x3bee('0x3a')]);_0x4b198a[_0x3bee('0x42')]=_[_0x3bee('0x39')](_0x4b198a[_0x3bee('0x37')],_0x4b198a[_0x3bee('0x3a')]);_0x875997['attributes']=_[_0x3bee('0x39')](_0x4b198a[_0x3bee('0x37')],qs[_0x3bee('0x3c')](_0x5eceb9[_0x3bee('0x3a')][_0x3bee('0x3c')]));_0x875997['attributes']=_0x875997['attributes'][_0x3bee('0x4b')]?_0x875997['attributes']:_0x4b198a[_0x3bee('0x37')];_0x875997[_0x3bee('0x3f')]=qs[_0x3bee('0x40')](_0x5eceb9['query']['sort']);_0x875997[_0x3bee('0x41')]=qs[_0x3bee('0x42')](_[_0x3bee('0x57')](_0x5eceb9[_0x3bee('0x3a')],_0x4b198a[_0x3bee('0x42')]));if(_0x5eceb9[_0x3bee('0x3a')]['filter']){_0x875997[_0x3bee('0x41')]=_[_0x3bee('0x44')](_0x875997[_0x3bee('0x41')],{'$or':_['map'](_0x875997[_0x3bee('0x3b')],function(_0x1d351f){var _0x33fe33={};_0x33fe33[_0x1d351f]={'$like':'%'+_0x5eceb9[_0x3bee('0x3a')][_0x3bee('0x43')]+'%'};return _0x33fe33;})});}_0x875997=_['merge']({},_0x875997,_0x5eceb9[_0x3bee('0x46')]);return _0x3acc56['getAgents'](_0x875997);}})[_0x3bee('0x2a')](function(_0x23333b){if(_0x23333b){_0x3a062a=_0x23333b[_0x3bee('0x4b')];if(!_0x5eceb9[_0x3bee('0x3a')][_0x3bee('0x3d')](_0x3bee('0x3e'))){_0x875997[_0x3bee('0x1f')]=qs[_0x3bee('0x1f')](_0x5eceb9['query'][_0x3bee('0x1f')]);_0x875997[_0x3bee('0x21')]=qs['offset'](_0x5eceb9['query'][_0x3bee('0x21')]);}return _0x3acc56[_0x3bee('0x8d')](_0x875997);}})[_0x3bee('0x2a')](function(_0x63fa09){if(_0x63fa09){return _0x63fa09?{'count':_0x3a062a,'rows':_0x63fa09}:null;}})['then'](respondWithResult(_0x315511,null))[_0x3bee('0x48')](handleError(_0x315511,null));}; \ No newline at end of file +var _0x1948=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','findAll','findAndCountAll','mailPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','sort','Agents','online','flatMap','sequelize','transaction','addTeams','emit','userMailQueue:save','User','select','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','TeamId','all','compact','isEmpty','removeAgents','userMailQueue:remove','addAgents','ids','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','error','name','index','MailQueue','fieldName','type','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filters','merge','where','VIRTUAL','filter','options','includeAll','include','show','params','rawAttributes','find','create','body','user'];(function(_0x366ef8,_0x474475){var _0x494f3c=function(_0x54b998){while(--_0x54b998){_0x366ef8['push'](_0x366ef8['shift']());}};_0x494f3c(++_0x474475);}(_0x1948,0x145));var _0x8194=function(_0x485067,_0x810f77){_0x485067=_0x485067-0x0;var _0x195d06=_0x1948[_0x485067];return _0x195d06;};'use strict';var emlformat=require(_0x8194('0x0'));var rimraf=require(_0x8194('0x1'));var zipdir=require(_0x8194('0x2'));var jsonpatch=require(_0x8194('0x3'));var rp=require(_0x8194('0x4'));var moment=require('moment');var BPromise=require(_0x8194('0x5'));var Mustache=require(_0x8194('0x6'));var util=require(_0x8194('0x7'));var path=require(_0x8194('0x8'));var sox=require(_0x8194('0x9'));var csv=require(_0x8194('0xa'));var ejs=require(_0x8194('0xb'));var fs=require('fs');var fs_extra=require(_0x8194('0xc'));var _=require('lodash');var squel=require(_0x8194('0xd'));var crypto=require(_0x8194('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8194('0xf'));var toCsv=require(_0x8194('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8194('0x10'));var authService=require(_0x8194('0x11'));var qs=require(_0x8194('0x12'));var as=require(_0x8194('0x13'));var hardwareService=require(_0x8194('0x14'));var logger=require('../../config/logger')(_0x8194('0x15'));var utils=require(_0x8194('0x16'));var config=require(_0x8194('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8194('0x18'))['db'];config[_0x8194('0x19')]=_[_0x8194('0x1a')](config[_0x8194('0x19')],{'host':_0x8194('0x1b'),'port':0x18eb});var socket=require(_0x8194('0x1c'))(new Redis(config['redis']));require(_0x8194('0x1d'))[_0x8194('0x1e')](socket);function respondWithStatusCode(_0xfd031c,_0x2ab425){_0x2ab425=_0x2ab425||0xcc;return function(_0x2d4463){if(_0x2d4463){return _0xfd031c[_0x8194('0x1f')](_0x2ab425);}return _0xfd031c[_0x8194('0x20')](_0x2ab425)[_0x8194('0x21')]();};}function respondWithResult(_0x19c23e,_0x5abd09){_0x5abd09=_0x5abd09||0xc8;return function(_0x49731d){if(_0x49731d){return _0x19c23e[_0x8194('0x20')](_0x5abd09)['json'](_0x49731d);}};}function respondWithFilteredResult(_0x41a11e,_0x4afbe3){return function(_0x55e4c2){if(_0x55e4c2){var _0x5f2172=typeof _0x4afbe3[_0x8194('0x22')]===_0x8194('0x23')&&typeof _0x4afbe3[_0x8194('0x24')]===_0x8194('0x23');var _0x956c6a=_0x55e4c2[_0x8194('0x25')];var _0x599712=_0x5f2172?0x0:_0x4afbe3['offset'];var _0xe8f563=_0x5f2172?_0x55e4c2['count']:_0x4afbe3[_0x8194('0x22')]+_0x4afbe3[_0x8194('0x24')];var _0x9421f5;if(_0xe8f563>=_0x956c6a){_0xe8f563=_0x956c6a;_0x9421f5=0xc8;}else{_0x9421f5=0xce;}_0x41a11e['status'](_0x9421f5);return _0x41a11e[_0x8194('0x26')](_0x8194('0x27'),_0x599712+'-'+_0xe8f563+'/'+_0x956c6a)[_0x8194('0x28')](_0x55e4c2);}return null;};}function patchUpdates(_0x28df4f){return function(_0x1babf1){try{jsonpatch[_0x8194('0x29')](_0x1babf1,_0x28df4f,!![]);}catch(_0x2c5061){return BPromise[_0x8194('0x2a')](_0x2c5061);}return _0x1babf1[_0x8194('0x2b')]();};}function saveUpdates(_0x263093,_0xbb64b7){return function(_0x300491){if(_0x300491){return _0x300491['update'](_0x263093)[_0x8194('0x2c')](function(_0x1216b1){return _0x1216b1;});}return null;};}function removeEntity(_0x21e92d,_0x46a242){return function(_0x55b0d9){if(_0x55b0d9){return _0x55b0d9[_0x8194('0x2d')]()[_0x8194('0x2c')](function(){var _0x425a1d=_0x55b0d9[_0x8194('0x2e')]({'plain':!![]});var _0x3e8cb3='MailQueues';return db['UserProfileResource'][_0x8194('0x2d')]({'where':{'type':_0x3e8cb3,'resourceId':_0x425a1d['id']}})[_0x8194('0x2c')](function(){return _0x55b0d9;});})[_0x8194('0x2c')](function(){_0x21e92d[_0x8194('0x20')](0xcc)[_0x8194('0x21')]();});}};}function handleEntityNotFound(_0x56c512,_0x4af9cc){return function(_0x5624a0){if(!_0x5624a0){_0x56c512[_0x8194('0x1f')](0x194);}return _0x5624a0;};}function handleError(_0x56b5bc,_0x490a37){_0x490a37=_0x490a37||0x1f4;return function(_0xb8910b){logger[_0x8194('0x2f')](_0xb8910b['stack']);if(_0xb8910b[_0x8194('0x30')]){delete _0xb8910b['name'];}_0x56b5bc[_0x8194('0x20')](_0x490a37)['send'](_0xb8910b);};}exports[_0x8194('0x31')]=function(_0x1a8bf9,_0x126795){var _0x2c3514={},_0x4ae934={},_0x4c1993={'count':0x0,'rows':[]};var _0x1721a1=_['map'](db[_0x8194('0x32')]['rawAttributes'],function(_0x2558cc){return{'name':_0x2558cc[_0x8194('0x33')],'type':_0x2558cc[_0x8194('0x34')]['key']};});_0x4ae934['model']=_[_0x8194('0x35')](_0x1721a1,_0x8194('0x30'));_0x4ae934[_0x8194('0x36')]=_[_0x8194('0x37')](_0x1a8bf9['query']);_0x4ae934['filters']=_['intersection'](_0x4ae934[_0x8194('0x38')],_0x4ae934[_0x8194('0x36')]);_0x2c3514[_0x8194('0x39')]=_[_0x8194('0x3a')](_0x4ae934[_0x8194('0x38')],qs[_0x8194('0x3b')](_0x1a8bf9['query'][_0x8194('0x3b')]));_0x2c3514[_0x8194('0x39')]=_0x2c3514[_0x8194('0x39')][_0x8194('0x3c')]?_0x2c3514[_0x8194('0x39')]:_0x4ae934[_0x8194('0x38')];if(!_0x1a8bf9[_0x8194('0x36')][_0x8194('0x3d')](_0x8194('0x3e'))){_0x2c3514[_0x8194('0x24')]=qs[_0x8194('0x24')](_0x1a8bf9[_0x8194('0x36')]['limit']);_0x2c3514[_0x8194('0x22')]=qs['offset'](_0x1a8bf9['query'][_0x8194('0x22')]);}_0x2c3514[_0x8194('0x3f')]=qs['sort'](_0x1a8bf9['query']['sort']);_0x2c3514['where']=qs['filters'](_[_0x8194('0x40')](_0x1a8bf9[_0x8194('0x36')],_0x4ae934[_0x8194('0x41')]),_0x1721a1);if(_0x1a8bf9['query']['filter']){_0x2c3514['where']=_[_0x8194('0x42')](_0x2c3514[_0x8194('0x43')],{'$or':_[_0x8194('0x35')](_0x1721a1,function(_0x2256d8){if(_0x2256d8['type']!==_0x8194('0x44')){var _0x14c450={};_0x14c450[_0x2256d8[_0x8194('0x30')]]={'$like':'%'+_0x1a8bf9[_0x8194('0x36')][_0x8194('0x45')]+'%'};return _0x14c450;}})});}_0x2c3514=_['merge']({},_0x2c3514,_0x1a8bf9[_0x8194('0x46')]);var _0xc20525={'where':_0x2c3514[_0x8194('0x43')]};return db[_0x8194('0x32')][_0x8194('0x25')](_0xc20525)[_0x8194('0x2c')](function(_0x36789b){_0x4c1993['count']=_0x36789b;if(_0x1a8bf9[_0x8194('0x36')][_0x8194('0x47')]){_0x2c3514[_0x8194('0x48')]=[{'all':!![]}];}return db[_0x8194('0x32')]['findAll'](_0x2c3514);})['then'](function(_0x1fac16){_0x4c1993['rows']=_0x1fac16;return _0x4c1993;})[_0x8194('0x2c')](respondWithFilteredResult(_0x126795,_0x2c3514))['catch'](handleError(_0x126795,null));};exports[_0x8194('0x49')]=function(_0x573003,_0x1200c8){var _0x3e7ab2={'raw':!![],'where':{'id':_0x573003[_0x8194('0x4a')]['id']}},_0x958766={};_0x958766['model']=_[_0x8194('0x37')](db[_0x8194('0x32')][_0x8194('0x4b')]);_0x958766['query']=_[_0x8194('0x37')](_0x573003[_0x8194('0x36')]);_0x958766[_0x8194('0x41')]=_[_0x8194('0x3a')](_0x958766[_0x8194('0x38')],_0x958766['query']);_0x3e7ab2[_0x8194('0x39')]=_['intersection'](_0x958766[_0x8194('0x38')],qs[_0x8194('0x3b')](_0x573003[_0x8194('0x36')][_0x8194('0x3b')]));_0x3e7ab2[_0x8194('0x39')]=_0x3e7ab2[_0x8194('0x39')][_0x8194('0x3c')]?_0x3e7ab2[_0x8194('0x39')]:_0x958766[_0x8194('0x38')];if(_0x573003[_0x8194('0x36')][_0x8194('0x47')]){_0x3e7ab2[_0x8194('0x48')]=[{'all':!![]}];}_0x3e7ab2=_[_0x8194('0x42')]({},_0x3e7ab2,_0x573003[_0x8194('0x46')]);return db[_0x8194('0x32')][_0x8194('0x4c')](_0x3e7ab2)[_0x8194('0x2c')](handleEntityNotFound(_0x1200c8,null))[_0x8194('0x2c')](respondWithResult(_0x1200c8,null))['catch'](handleError(_0x1200c8,null));};exports[_0x8194('0x4d')]=function(_0x33c0f8,_0x5542ed){return db['MailQueue'][_0x8194('0x4d')](_0x33c0f8[_0x8194('0x4e')],{})[_0x8194('0x2c')](function(_0x3029fe){var _0x3f85af=_0x33c0f8[_0x8194('0x4f')][_0x8194('0x2e')]({'plain':!![]});if(!_0x3f85af)throw new Error(_0x8194('0x50'));if(_0x3f85af[_0x8194('0x51')]===_0x8194('0x4f')){var _0x5aa280=_0x3029fe['get']({'plain':!![]});var _0x510f6d='MailQueues';return db[_0x8194('0x52')][_0x8194('0x4c')]({'where':{'name':_0x510f6d,'userProfileId':_0x3f85af[_0x8194('0x53')]},'raw':!![]})[_0x8194('0x2c')](function(_0x381091){if(_0x381091&&_0x381091[_0x8194('0x54')]===0x0){return db[_0x8194('0x55')][_0x8194('0x4d')]({'name':_0x5aa280[_0x8194('0x30')],'resourceId':_0x5aa280['id'],'type':_0x381091['name'],'sectionId':_0x381091['id']},{})['then'](function(){return _0x3029fe;});}else{return _0x3029fe;}})[_0x8194('0x56')](function(_0x156aff){logger[_0x8194('0x2f')](_0x8194('0x57'),_0x156aff);throw _0x156aff;});}return _0x3029fe;})[_0x8194('0x2c')](respondWithResult(_0x5542ed,0xc9))[_0x8194('0x56')](handleError(_0x5542ed,null));};exports['update']=function(_0x40c82c,_0x10b854){if(_0x40c82c[_0x8194('0x4e')]['id']){delete _0x40c82c[_0x8194('0x4e')]['id'];}return db[_0x8194('0x32')][_0x8194('0x4c')]({'where':{'id':_0x40c82c[_0x8194('0x4a')]['id']}})[_0x8194('0x2c')](handleEntityNotFound(_0x10b854,null))['then'](saveUpdates(_0x40c82c[_0x8194('0x4e')],null))[_0x8194('0x2c')](respondWithResult(_0x10b854,null))[_0x8194('0x56')](handleError(_0x10b854,null));};exports[_0x8194('0x2d')]=function(_0x3105cb,_0x2044f3){return db[_0x8194('0x32')][_0x8194('0x4c')]({'where':{'id':_0x3105cb[_0x8194('0x4a')]['id']}})[_0x8194('0x2c')](handleEntityNotFound(_0x2044f3,null))[_0x8194('0x2c')](removeEntity(_0x2044f3,null))['catch'](handleError(_0x2044f3,null));};exports[_0x8194('0x58')]=function(_0x27f041,_0x317da7){return db[_0x8194('0x32')]['describe']()['then'](respondWithResult(_0x317da7,null))[_0x8194('0x56')](handleError(_0x317da7,null));};exports[_0x8194('0x59')]=function(_0x3554b5,_0x5a1d9e,_0x46136d){var _0x4cf5cc={'raw':!![],'where':{}},_0x3eb9be={},_0xb8ad36;return db[_0x8194('0x32')][_0x8194('0x5a')]({'where':{'id':_0x3554b5[_0x8194('0x4a')]['id']}})[_0x8194('0x2c')](handleEntityNotFound(_0x5a1d9e,null))[_0x8194('0x2c')](function(_0x186898){if(_0x186898){_0xb8ad36=_0x186898[_0x8194('0x2e')]({'plain':!![]});_0x3eb9be[_0x8194('0x38')]=_[_0x8194('0x37')](db[_0x8194('0x5b')][_0x8194('0x4b')]);_0x3eb9be['query']=_['keys'](_0x3554b5['query']);_0x3eb9be[_0x8194('0x41')]=_[_0x8194('0x3a')](_0x3eb9be[_0x8194('0x38')],_0x3eb9be['query']);_0x4cf5cc[_0x8194('0x39')]=_[_0x8194('0x3a')](_0x3eb9be['model'],qs[_0x8194('0x3b')](_0x3554b5['query']['fields']));_0x4cf5cc['attributes']=_0x4cf5cc['attributes'][_0x8194('0x3c')]?_0x4cf5cc[_0x8194('0x39')]:_0x3eb9be[_0x8194('0x38')];if(!_0x3554b5[_0x8194('0x36')]['hasOwnProperty'](_0x8194('0x3e'))){_0x4cf5cc[_0x8194('0x24')]=qs[_0x8194('0x24')](_0x3554b5[_0x8194('0x36')][_0x8194('0x24')]);_0x4cf5cc[_0x8194('0x22')]=qs[_0x8194('0x22')](_0x3554b5[_0x8194('0x36')][_0x8194('0x22')]);}_0x4cf5cc[_0x8194('0x3f')]=qs['sort'](_0x3554b5['query']['sort']);_0x4cf5cc[_0x8194('0x43')]=qs[_0x8194('0x41')](_['pick'](_0x3554b5[_0x8194('0x36')],_0x3eb9be[_0x8194('0x41')]));_0x4cf5cc['where']['MailQueueId']=_0x186898['id'];if(_0x3554b5[_0x8194('0x36')][_0x8194('0x45')]){_0x4cf5cc[_0x8194('0x43')]=_[_0x8194('0x42')](_0x4cf5cc[_0x8194('0x43')],{'$or':_['map'](_0x4cf5cc['attributes'],function(_0x5bfb4c){var _0x429a8b={};_0x429a8b[_0x5bfb4c]={'$like':'%'+_0x3554b5[_0x8194('0x36')][_0x8194('0x45')]+'%'};return _0x429a8b;})});}_0x4cf5cc=_['merge']({},_0x4cf5cc,_0x3554b5[_0x8194('0x46')]);return db['UserMailQueue'][_0x8194('0x5c')](_0x4cf5cc);}})[_0x8194('0x2c')](function(_0x3da585){if(_0x3da585){return db['User'][_0x8194('0x5d')]({'where':{'id':_['map'](_0x3da585,'UserId'),'role':'agent'},'attributes':['id',_0x8194('0x30'),_0x8194('0x5e'),_0x8194('0x5f'),_0x8194('0x60')]});}})['then'](function(_0x7f3a6c){if(_0x7f3a6c){return{'count':_0x7f3a6c['count'],'rows':_[_0x8194('0x35')](_0x7f3a6c[_0x8194('0x61')],function(_0x1b137b){return{'membername':_0x1b137b['name'],'UserId':_0x1b137b['id'],'queue_name':_0xb8ad36['name'],'MailQueueId':_0xb8ad36['id'],'interface':util[_0x8194('0x62')](_0x8194('0x63'),_0x8194('0x64'),_0x1b137b[_0x8194('0x30')]),'penalty':0x0,'paused':_0x1b137b[_0x8194('0x5e')],'createdAt':_0x1b137b[_0x8194('0x60')],'updatedAt':_0x1b137b[_0x8194('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8194('0x2c')](respondWithFilteredResult(_0x5a1d9e,_0x4cf5cc))[_0x8194('0x56')](handleError(_0x5a1d9e,null));};exports[_0x8194('0x65')]=function(_0x26bd94,_0x47cc54,_0x54e292){var _0x5e5eff={};var _0x34dd0c={};var _0x453894;var _0x4114f2;return db['MailQueue'][_0x8194('0x5a')]({'where':{'id':_0x26bd94[_0x8194('0x4a')]['id']}})[_0x8194('0x2c')](handleEntityNotFound(_0x47cc54,null))['then'](function(_0x1f159d){if(_0x1f159d){_0x453894=_0x1f159d;_0x34dd0c[_0x8194('0x38')]=_[_0x8194('0x37')](db[_0x8194('0x66')][_0x8194('0x4b')]);_0x34dd0c['query']=_[_0x8194('0x37')](_0x26bd94[_0x8194('0x36')]);_0x34dd0c['filters']=_[_0x8194('0x3a')](_0x34dd0c['model'],_0x34dd0c[_0x8194('0x36')]);_0x5e5eff[_0x8194('0x39')]=_[_0x8194('0x3a')](_0x34dd0c[_0x8194('0x38')],qs[_0x8194('0x3b')](_0x26bd94[_0x8194('0x36')][_0x8194('0x3b')]));_0x5e5eff[_0x8194('0x39')]=_0x5e5eff['attributes'][_0x8194('0x3c')]?_0x5e5eff[_0x8194('0x39')]:_0x34dd0c['model'];_0x5e5eff['order']=qs[_0x8194('0x67')](_0x26bd94[_0x8194('0x36')][_0x8194('0x67')]);_0x5e5eff[_0x8194('0x43')]=qs[_0x8194('0x41')](_['pick'](_0x26bd94[_0x8194('0x36')],_0x34dd0c[_0x8194('0x41')]));if(_0x26bd94['query'][_0x8194('0x45')]){_0x5e5eff['where']=_[_0x8194('0x42')](_0x5e5eff['where'],{'$or':_[_0x8194('0x35')](_0x5e5eff[_0x8194('0x39')],function(_0x286d9d){var _0x57a13b={};_0x57a13b[_0x286d9d]={'$like':'%'+_0x26bd94['query'][_0x8194('0x45')]+'%'};return _0x57a13b;})});}_0x5e5eff=_[_0x8194('0x42')]({},_0x5e5eff,_0x26bd94[_0x8194('0x46')]);return _0x453894[_0x8194('0x65')](_0x5e5eff);}})[_0x8194('0x2c')](function(_0x225f77){if(_0x225f77){_0x4114f2=_0x225f77[_0x8194('0x3c')];if(!_0x26bd94[_0x8194('0x36')][_0x8194('0x3d')](_0x8194('0x3e'))){_0x5e5eff[_0x8194('0x24')]=qs[_0x8194('0x24')](_0x26bd94[_0x8194('0x36')][_0x8194('0x24')]);_0x5e5eff[_0x8194('0x22')]=qs[_0x8194('0x22')](_0x26bd94['query'][_0x8194('0x22')]);}return _0x453894[_0x8194('0x65')](_0x5e5eff);}})['then'](function(_0x28c384){if(_0x28c384){return _0x28c384?{'count':_0x4114f2,'rows':_0x28c384}:null;}})[_0x8194('0x2c')](respondWithResult(_0x47cc54,null))[_0x8194('0x56')](handleError(_0x47cc54,null));};exports['addTeams']=function(_0x18341e,_0x47e5dc,_0x7a9086){var _0x1480a0=_0x18341e[_0x8194('0x4e')]['ids'];return db['Team'][_0x8194('0x5c')]({'where':{'id':_0x1480a0},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8194('0x68'),'attributes':['id',_0x8194('0x30'),_0x8194('0x69'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x2b623c){if(_0x2b623c){var _0x234147=_[_0x8194('0x6a')](_0x2b623c,function(_0x523745){var _0x37ab09=_0x523745[_0x8194('0x2e')]({'plain':!![]});return _0x37ab09[_0x8194('0x68')];});return db[_0x8194('0x32')][_0x8194('0x4c')]({'where':{'id':_0x18341e['params']['id']}})[_0x8194('0x2c')](function(_0x3df59a){return db[_0x8194('0x6b')][_0x8194('0x6c')](function(_0x415d1e){return _0x3df59a[_0x8194('0x6d')](_0x1480a0,{'transaction':_0x415d1e})['then'](function(){return BPromise['each'](_0x234147,function(_0x3cc996){return db[_0x8194('0x5b')]['findOrCreate']({'where':{'UserId':_0x3cc996['id'],'MailQueueId':_0x18341e['params']['id']},'transaction':_0x415d1e});});})[_0x8194('0x2c')](function(){_0x234147['forEach'](function(_0x38c8e7){socket[_0x8194('0x6e')](_0x8194('0x6f'),{'UserId':_0x38c8e7['id'],'MailQueueId':_0x3df59a['id']});});});});});}})[_0x8194('0x2c')](respondWithStatusCode(_0x47e5dc,null))['catch'](handleError(_0x47e5dc,null));};exports['removeTeams']=function(_0x354ff2,_0x3189a0,_0x4fae53){return db[_0x8194('0x66')][_0x8194('0x5c')]({'where':{'id':_0x354ff2[_0x8194('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x8194('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3189a0,null))[_0x8194('0x2c')](function(_0x26de6d){var _0x183488=_[_0x8194('0x35')](_0x26de6d,'id');var _0x5a35e6=[];var _0x1e03f0=[];var _0x240324=squel[_0x8194('0x71')]();_0x240324['field'](_0x8194('0x72'))[_0x8194('0x73')](_0x8194('0x74'),'tq')['join'](_0x8194('0x75'),'ut',_0x8194('0x76'))['where'](_0x8194('0x77'),_0x354ff2[_0x8194('0x4a')]['id']);for(var _0x1b4567=0x0;_0x1b4567<_0x26de6d[_0x8194('0x3c')];_0x1b4567+=0x1){let _0x5dd849=_0x26de6d[_0x1b4567];for(var _0x3de436=0x0;_0x3de436<_0x5dd849[_0x8194('0x68')]['length'];_0x3de436+=0x1){let _0x678b41=_0x5dd849[_0x8194('0x68')][_0x3de436];var _0x315d95=_0x240324[_0x8194('0x78')]();_0x315d95[_0x8194('0x43')]('ut.UserId\x20=\x20?',_0x678b41['id']);_0x1e03f0[_0x8194('0x79')](db['sequelize']['query'](_0x315d95['toString'](),{'type':db[_0x8194('0x6b')][_0x8194('0x7a')][_0x8194('0x7b')]})[_0x8194('0x2c')](function(_0x2fd54d){if(_0x2fd54d[_0x8194('0x3c')]===0x1){return _0x678b41['id'];}else{var _0x1d57dc=_['every'](_[_0x8194('0x35')](_0x2fd54d,_0x8194('0x7c')),function(_0x4052ba){return _['includes'](_0x183488,_0x4052ba);});if(_0x1d57dc){return _0x678b41['id'];}}}));}}return BPromise[_0x8194('0x7d')](_0x1e03f0)['then'](function(_0x26daa9){_0x5a35e6=_(_0x5a35e6)['union'](_0x26daa9)[_0x8194('0x7e')]()['value']();return db['MailQueue'][_0x8194('0x4c')]({'where':{'id':_0x354ff2[_0x8194('0x4a')]['id']}})[_0x8194('0x2c')](function(_0x27511e){return db[_0x8194('0x6b')]['transaction'](function(_0xa10616){return _0x27511e['removeTeams'](_0x354ff2[_0x8194('0x36')]['ids'],{'transaction':_0xa10616})[_0x8194('0x2c')](function(){if(!_[_0x8194('0x7f')](_0x5a35e6)){return _0x27511e[_0x8194('0x80')](_0x5a35e6,{'transaction':_0xa10616});}})['then'](function(){_0x5a35e6['forEach'](function(_0x47c632){socket['emit'](_0x8194('0x81'),{'UserId':_0x47c632,'MailQueueId':_0x27511e['id']});});});});});});})[_0x8194('0x2c')](respondWithStatusCode(_0x3189a0,null))['catch'](handleError(_0x3189a0,null));};exports[_0x8194('0x82')]=function(_0x2c88a7,_0x7c3851,_0x4c818a){return db[_0x8194('0x32')]['find']({'where':{'id':_0x2c88a7[_0x8194('0x4a')]['id']}})['then'](handleEntityNotFound(_0x7c3851,null))[_0x8194('0x2c')](function(_0x3b0577){if(_0x3b0577){return _0x3b0577[_0x8194('0x82')](_0x2c88a7[_0x8194('0x4e')][_0x8194('0x83')],_[_0x8194('0x84')](_0x2c88a7[_0x8194('0x4e')],[_0x8194('0x83'),'id'])||{})['spread'](function(_0x54b26b){for(var _0x3ba60f=0x0;_0x3ba60f<_0x2c88a7[_0x8194('0x4e')][_0x8194('0x83')][_0x8194('0x3c')];_0x3ba60f+=0x1){socket['emit'](_0x8194('0x6f'),{'UserId':Number(_0x2c88a7[_0x8194('0x4e')][_0x8194('0x83')][_0x3ba60f]),'MailQueueId':Number(_0x2c88a7['params']['id'])});}return _0x54b26b;});}})[_0x8194('0x2c')](respondWithResult(_0x7c3851,null))[_0x8194('0x56')](handleError(_0x7c3851,null));};exports[_0x8194('0x80')]=function(_0x4749e0,_0x5b38cc,_0x10d490){return db[_0x8194('0x32')][_0x8194('0x4c')]({'where':{'id':_0x4749e0[_0x8194('0x4a')]['id']}})[_0x8194('0x2c')](handleEntityNotFound(_0x5b38cc,null))['then'](function(_0x73e287){if(_0x73e287){return _0x73e287['removeAgents'](_0x4749e0['query'][_0x8194('0x83')])[_0x8194('0x2c')](function(){if(_[_0x8194('0x85')](_0x4749e0[_0x8194('0x36')][_0x8194('0x83')])){for(var _0x165078=0x0;_0x165078<_0x4749e0[_0x8194('0x36')][_0x8194('0x83')]['length'];_0x165078+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x4749e0[_0x8194('0x36')][_0x8194('0x83')][_0x165078]),'MailQueueId':Number(_0x4749e0[_0x8194('0x4a')]['id'])});}}else{socket[_0x8194('0x6e')](_0x8194('0x81'),{'UserId':Number(_0x4749e0['query'][_0x8194('0x83')]),'MailQueueId':Number(_0x4749e0[_0x8194('0x4a')]['id'])});}});}})[_0x8194('0x2c')](respondWithStatusCode(_0x5b38cc,null))[_0x8194('0x56')](handleError(_0x5b38cc,null));};exports['getAgents']=function(_0x5d388c,_0x53296a,_0xef8b0e){var _0x15e148={};var _0x47c371={};var _0x534431;var _0x32f7bb;return db[_0x8194('0x32')][_0x8194('0x5a')]({'where':{'id':_0x5d388c[_0x8194('0x4a')]['id']}})[_0x8194('0x2c')](handleEntityNotFound(_0x53296a,null))[_0x8194('0x2c')](function(_0x59a6d5){if(_0x59a6d5){_0x534431=_0x59a6d5;_0x47c371[_0x8194('0x38')]=_[_0x8194('0x37')](db[_0x8194('0x70')][_0x8194('0x4b')]);_0x47c371[_0x8194('0x36')]=_[_0x8194('0x37')](_0x5d388c['query']);_0x47c371[_0x8194('0x41')]=_['intersection'](_0x47c371['model'],_0x47c371[_0x8194('0x36')]);_0x15e148[_0x8194('0x39')]=_[_0x8194('0x3a')](_0x47c371[_0x8194('0x38')],qs['fields'](_0x5d388c[_0x8194('0x36')][_0x8194('0x3b')]));_0x15e148[_0x8194('0x39')]=_0x15e148[_0x8194('0x39')][_0x8194('0x3c')]?_0x15e148['attributes']:_0x47c371[_0x8194('0x38')];_0x15e148[_0x8194('0x3f')]=qs[_0x8194('0x67')](_0x5d388c[_0x8194('0x36')][_0x8194('0x67')]);_0x15e148['where']=qs[_0x8194('0x41')](_[_0x8194('0x40')](_0x5d388c[_0x8194('0x36')],_0x47c371[_0x8194('0x41')]));if(_0x5d388c['query'][_0x8194('0x45')]){_0x15e148[_0x8194('0x43')]=_[_0x8194('0x42')](_0x15e148[_0x8194('0x43')],{'$or':_[_0x8194('0x35')](_0x15e148['attributes'],function(_0x5340a1){var _0x208b96={};_0x208b96[_0x5340a1]={'$like':'%'+_0x5d388c['query'][_0x8194('0x45')]+'%'};return _0x208b96;})});}_0x15e148=_['merge']({},_0x15e148,_0x5d388c[_0x8194('0x46')]);return _0x534431[_0x8194('0x86')](_0x15e148);}})[_0x8194('0x2c')](function(_0x328b06){if(_0x328b06){_0x32f7bb=_0x328b06[_0x8194('0x3c')];if(!_0x5d388c[_0x8194('0x36')][_0x8194('0x3d')](_0x8194('0x3e'))){_0x15e148['limit']=qs[_0x8194('0x24')](_0x5d388c[_0x8194('0x36')][_0x8194('0x24')]);_0x15e148[_0x8194('0x22')]=qs['offset'](_0x5d388c[_0x8194('0x36')][_0x8194('0x22')]);}return _0x534431[_0x8194('0x86')](_0x15e148);}})[_0x8194('0x2c')](function(_0x2dbd14){if(_0x2dbd14){return _0x2dbd14?{'count':_0x32f7bb,'rows':_0x2dbd14}:null;}})['then'](respondWithResult(_0x53296a,null))[_0x8194('0x56')](handleError(_0x53296a,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index c46d910..dc06397 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 _0x729a=['../../mysqldb','MailQueue','save','remove','emit','hook','exports','events'];(function(_0x2afbbc,_0x55324e){var _0x290ebd=function(_0xfae13a){while(--_0xfae13a){_0x2afbbc['push'](_0x2afbbc['shift']());}};_0x290ebd(++_0x55324e);}(_0x729a,0x107));var _0xa729=function(_0x304d78,_0x42941c){_0x304d78=_0x304d78-0x0;var _0x111c2d=_0x729a[_0x304d78];return _0x111c2d;};'use strict';var EventEmitter=require(_0xa729('0x0'));var MailQueue=require(_0xa729('0x1'))['db'][_0xa729('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa729('0x3'),'afterUpdate':'update','afterDestroy':_0xa729('0x4')};function emitEvent(_0x4e5bc0){return function(_0x181f90,_0x23c74c,_0x30a86e){MailQueueEvents[_0xa729('0x5')](_0x4e5bc0+':'+_0x181f90['id'],_0x181f90);MailQueueEvents[_0xa729('0x5')](_0x4e5bc0,_0x181f90);_0x30a86e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xa729('0x6')](e,emitEvent(event));}}module[_0xa729('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xb43a=['exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0xb43a,0x15f));var _0xab43=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0xb43a[_0x548627];return _0x844a84;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xab43('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xab43('0x1')](0x0);var events={'afterCreate':_0xab43('0x2'),'afterUpdate':_0xab43('0x3'),'afterDestroy':'remove'};function emitEvent(_0x49239c){return function(_0x498be2,_0x20d525,_0x490af2){MailQueueEvents[_0xab43('0x4')](_0x49239c+':'+_0x498be2['id'],_0x498be2);MailQueueEvents['emit'](_0x49239c,_0x498be2);_0x490af2(null);};}for(var e in events){if(events[_0xab43('0x5')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xab43('0x6')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 947ad41..fa8961a 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 _0xc2a6=['path','rimraf','./mailQueue.attributes','exports','define','MailQueue','mail_queues','util','../../config/logger','api','request-promise'];(function(_0x24f30b,_0x492ece){var _0x23874f=function(_0x4c61ea){while(--_0x4c61ea){_0x24f30b['push'](_0x24f30b['shift']());}};_0x23874f(++_0x492ece);}(_0xc2a6,0x125));var _0x6c2a=function(_0x523140,_0x3994f8){_0x523140=_0x523140-0x0;var _0x2d1059=_0xc2a6[_0x523140];return _0x2d1059;};'use strict';var _=require('lodash');var util=require(_0x6c2a('0x0'));var logger=require(_0x6c2a('0x1'))(_0x6c2a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6c2a('0x3'));var fs=require('fs');var path=require(_0x6c2a('0x4'));var rimraf=require(_0x6c2a('0x5'));var config=require('../../config/environment');var attributes=require(_0x6c2a('0x6'));module[_0x6c2a('0x7')]=function(_0x486c6a,_0x31c274){return _0x486c6a[_0x6c2a('0x8')](_0x6c2a('0x9'),attributes,{'tableName':_0x6c2a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccfe=['path','rimraf','./mailQueue.attributes','exports','define','mail_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2c43bb,_0x1138d7){var _0x2a0fd3=function(_0x5a4c56){while(--_0x5a4c56){_0x2c43bb['push'](_0x2c43bb['shift']());}};_0x2a0fd3(++_0x1138d7);}(_0xccfe,0x186));var _0xeccf=function(_0x2c0889,_0x397d7e){_0x2c0889=_0x2c0889-0x0;var _0x55eee2=_0xccfe[_0x2c0889];return _0x55eee2;};'use strict';var _=require(_0xeccf('0x0'));var util=require(_0xeccf('0x1'));var logger=require(_0xeccf('0x2'))(_0xeccf('0x3'));var moment=require(_0xeccf('0x4'));var BPromise=require(_0xeccf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeccf('0x6'));var rimraf=require(_0xeccf('0x7'));var config=require('../../config/environment');var attributes=require(_0xeccf('0x8'));module[_0xeccf('0x9')]=function(_0x2db794,_0xb0df78){return _0x2db794[_0xeccf('0xa')]('MailQueue',attributes,{'tableName':_0xeccf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 5dbe430..299a9b4 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 _0x2060=['model','map','debug','ShowMailQueue','find','info','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','socket.io-emitter','redis','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x566760,_0x1f7104){var _0x30ca6d=function(_0x3aa193){while(--_0x3aa193){_0x566760['push'](_0x566760['shift']());}};_0x30ca6d(++_0x1f7104);}(_0x2060,0x1be));var _0x0206=function(_0x542567,_0x1500a8){_0x542567=_0x542567-0x0;var _0x45df1b=_0x2060[_0x542567];return _0x45df1b;};'use strict';var _=require(_0x0206('0x0'));var util=require('util');var moment=require(_0x0206('0x1'));var BPromise=require(_0x0206('0x2'));var rs=require(_0x0206('0x3'));var fs=require('fs');var Redis=require(_0x0206('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0206('0x5'));var logger=require(_0x0206('0x6'))('rpc');var config=require(_0x0206('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0206('0x8')][_0x0206('0x9')]({'port':0x232a});config['redis']=_[_0x0206('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0206('0xb'))(new Redis(config[_0x0206('0xc')]));require(_0x0206('0xd'))[_0x0206('0xe')](socket);function respondWithRpcPromise(_0x120181,_0x3e20d1,_0x2cdca9){return new BPromise(function(_0x138f07,_0x1e266c){return client[_0x0206('0xf')](_0x120181,_0x2cdca9)[_0x0206('0x10')](function(_0x521d23){logger['info'](_0x0206('0x11'),_0x3e20d1,_0x0206('0x12'));logger['debug'](_0x0206('0x13'),_0x3e20d1,_0x0206('0x12'),JSON[_0x0206('0x14')](_0x521d23));if(_0x521d23['error']){if(_0x521d23[_0x0206('0x15')][_0x0206('0x16')]===0x1f4){logger[_0x0206('0x15')](_0x0206('0x11'),_0x3e20d1,_0x521d23['error'][_0x0206('0x17')]);return _0x1e266c(_0x521d23['error'][_0x0206('0x17')]);}logger[_0x0206('0x15')](_0x0206('0x11'),_0x3e20d1,_0x521d23[_0x0206('0x15')][_0x0206('0x17')]);return _0x138f07(_0x521d23[_0x0206('0x15')]['message']);}else{logger['info'](_0x0206('0x11'),_0x3e20d1,'request\x20sent');_0x138f07(_0x521d23['result'][_0x0206('0x17')]);}})[_0x0206('0x18')](function(_0x2021b2){logger[_0x0206('0x15')]('MailQueue,\x20%s,\x20%s',_0x3e20d1,_0x2021b2);_0x1e266c(_0x2021b2);});});}exports[_0x0206('0x19')]=function(_0x43ad08){var _0x314c0e=this;return new Promise(function(_0x301de7,_0x3c189c){return db[_0x0206('0x1a')][_0x0206('0x1b')]({'raw':_0x43ad08[_0x0206('0x1c')]?_0x43ad08['options'][_0x0206('0x1d')]===undefined?!![]:![]:!![],'where':_0x43ad08['options']?_0x43ad08['options'][_0x0206('0x1e')]||null:null,'attributes':_0x43ad08['options']?_0x43ad08[_0x0206('0x1c')][_0x0206('0x1f')]||null:null,'limit':_0x43ad08[_0x0206('0x1c')]?_0x43ad08['options'][_0x0206('0x20')]||null:null,'include':_0x43ad08[_0x0206('0x1c')]?_0x43ad08[_0x0206('0x1c')]['include']?_['map'](_0x43ad08[_0x0206('0x1c')][_0x0206('0x21')],function(_0x57079a){return{'model':db[_0x57079a[_0x0206('0x22')]],'as':_0x57079a['as'],'attributes':_0x57079a[_0x0206('0x1f')],'include':_0x57079a[_0x0206('0x21')]?_[_0x0206('0x23')](_0x57079a[_0x0206('0x21')],function(_0x519a0a){return{'model':db[_0x519a0a[_0x0206('0x22')]],'as':_0x519a0a['as'],'attributes':_0x519a0a[_0x0206('0x1f')],'include':_0x519a0a[_0x0206('0x21')]?_['map'](_0x519a0a[_0x0206('0x21')],function(_0x45a10b){return{'model':db[_0x45a10b[_0x0206('0x22')]],'as':_0x45a10b['as'],'attributes':_0x45a10b['attributes']};}):[]};}):[]};}):[]:[]})[_0x0206('0x10')](function(_0x306f5e){logger['info'](_0x0206('0x19'),_0x43ad08);logger[_0x0206('0x24')](_0x0206('0x19'),_0x43ad08,JSON['stringify'](_0x306f5e));_0x301de7(_0x306f5e);})[_0x0206('0x18')](function(_0x136543){logger[_0x0206('0x15')](_0x0206('0x19'),_0x136543[_0x0206('0x17')],_0x43ad08);_0x3c189c(_0x314c0e[_0x0206('0x15')](0x1f4,_0x136543[_0x0206('0x17')]));});});};exports[_0x0206('0x25')]=function(_0x1dace0){var _0x1ed88d=this;return new Promise(function(_0x60a468,_0x5187ac){return db['MailQueue'][_0x0206('0x26')]({'raw':_0x1dace0[_0x0206('0x1c')]?_0x1dace0[_0x0206('0x1c')][_0x0206('0x1d')]===undefined?!![]:![]:!![],'where':_0x1dace0[_0x0206('0x1c')]?_0x1dace0[_0x0206('0x1c')][_0x0206('0x1e')]||null:null,'attributes':_0x1dace0['options']?_0x1dace0[_0x0206('0x1c')][_0x0206('0x1f')]||null:null,'include':_0x1dace0[_0x0206('0x1c')]?_0x1dace0[_0x0206('0x1c')][_0x0206('0x21')]?_['map'](_0x1dace0[_0x0206('0x1c')][_0x0206('0x21')],function(_0x27d18b){return{'model':db[_0x27d18b['model']],'as':_0x27d18b['as'],'attributes':_0x27d18b[_0x0206('0x1f')],'include':_0x27d18b['include']?_[_0x0206('0x23')](_0x27d18b[_0x0206('0x21')],function(_0x440499){return{'model':db[_0x440499['model']],'as':_0x440499['as'],'attributes':_0x440499[_0x0206('0x1f')],'include':_0x440499[_0x0206('0x21')]?_['map'](_0x440499['include'],function(_0x3c4d3f){return{'model':db[_0x3c4d3f[_0x0206('0x22')]],'as':_0x3c4d3f['as'],'attributes':_0x3c4d3f[_0x0206('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0206('0x10')](function(_0x2a6a57){logger[_0x0206('0x27')]('ShowMailQueue',_0x1dace0);logger[_0x0206('0x24')](_0x0206('0x25'),_0x1dace0,JSON['stringify'](_0x2a6a57));_0x60a468(_0x2a6a57);})['catch'](function(_0x1c1954){logger[_0x0206('0x15')](_0x0206('0x25'),_0x1c1954[_0x0206('0x17')],_0x1dace0);_0x5187ac(_0x1ed88d[_0x0206('0x15')](0x1f4,_0x1c1954[_0x0206('0x17')]));});});}; \ No newline at end of file +var _0x6a2b=['socket.io-emitter','./mailQueue.socket','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','GetMailQueue','ShowMailQueue','find','debug','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost'];(function(_0x5d7439,_0x29e8e5){var _0x8b3624=function(_0x311c52){while(--_0x311c52){_0x5d7439['push'](_0x5d7439['shift']());}};_0x8b3624(++_0x29e8e5);}(_0x6a2b,0x1e2));var _0xb6a2=function(_0x3c7999,_0x36868d){_0x3c7999=_0x3c7999-0x0;var _0x4723b4=_0x6a2b[_0x3c7999];return _0x4723b4;};'use strict';var _=require('lodash');var util=require(_0xb6a2('0x0'));var moment=require(_0xb6a2('0x1'));var BPromise=require('bluebird');var rs=require(_0xb6a2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb6a2('0x3'))['db'];var utils=require(_0xb6a2('0x4'));var logger=require(_0xb6a2('0x5'))(_0xb6a2('0x6'));var config=require('../../config/environment');var jayson=require(_0xb6a2('0x7'));var client=jayson[_0xb6a2('0x8')][_0xb6a2('0x9')]({'port':0x232a});config[_0xb6a2('0xa')]=_['defaults'](config[_0xb6a2('0xa')],{'host':_0xb6a2('0xb'),'port':0x18eb});var socket=require(_0xb6a2('0xc'))(new Redis(config[_0xb6a2('0xa')]));require(_0xb6a2('0xd'))['register'](socket);function respondWithRpcPromise(_0x3008e7,_0x281af3,_0x2b8cb7){return new BPromise(function(_0x188479,_0x4751d1){return client['request'](_0x3008e7,_0x2b8cb7)['then'](function(_0x4b430c){logger[_0xb6a2('0xe')](_0xb6a2('0xf'),_0x281af3,_0xb6a2('0x10'));logger['debug'](_0xb6a2('0x11'),_0x281af3,'request\x20sent',JSON[_0xb6a2('0x12')](_0x4b430c));if(_0x4b430c[_0xb6a2('0x13')]){if(_0x4b430c[_0xb6a2('0x13')][_0xb6a2('0x14')]===0x1f4){logger[_0xb6a2('0x13')]('MailQueue,\x20%s,\x20%s',_0x281af3,_0x4b430c['error'][_0xb6a2('0x15')]);return _0x4751d1(_0x4b430c[_0xb6a2('0x13')][_0xb6a2('0x15')]);}logger[_0xb6a2('0x13')]('MailQueue,\x20%s,\x20%s',_0x281af3,_0x4b430c[_0xb6a2('0x13')][_0xb6a2('0x15')]);return _0x188479(_0x4b430c[_0xb6a2('0x13')]['message']);}else{logger[_0xb6a2('0xe')](_0xb6a2('0xf'),_0x281af3,'request\x20sent');_0x188479(_0x4b430c['result']['message']);}})[_0xb6a2('0x16')](function(_0x4ad5c7){logger[_0xb6a2('0x13')](_0xb6a2('0xf'),_0x281af3,_0x4ad5c7);_0x4751d1(_0x4ad5c7);});});}exports['GetMailQueue']=function(_0x2f684a){var _0x29bc34=this;return new Promise(function(_0x4e523c,_0x495316){return db[_0xb6a2('0x17')][_0xb6a2('0x18')]({'raw':_0x2f684a[_0xb6a2('0x19')]?_0x2f684a['options'][_0xb6a2('0x1a')]===undefined?!![]:![]:!![],'where':_0x2f684a[_0xb6a2('0x19')]?_0x2f684a[_0xb6a2('0x19')][_0xb6a2('0x1b')]||null:null,'attributes':_0x2f684a[_0xb6a2('0x19')]?_0x2f684a[_0xb6a2('0x19')][_0xb6a2('0x1c')]||null:null,'limit':_0x2f684a[_0xb6a2('0x19')]?_0x2f684a[_0xb6a2('0x19')][_0xb6a2('0x1d')]||null:null,'include':_0x2f684a['options']?_0x2f684a[_0xb6a2('0x19')][_0xb6a2('0x1e')]?_[_0xb6a2('0x1f')](_0x2f684a[_0xb6a2('0x19')][_0xb6a2('0x1e')],function(_0x5fa4dc){return{'model':db[_0x5fa4dc['model']],'as':_0x5fa4dc['as'],'attributes':_0x5fa4dc[_0xb6a2('0x1c')],'include':_0x5fa4dc[_0xb6a2('0x1e')]?_[_0xb6a2('0x1f')](_0x5fa4dc['include'],function(_0x2e6844){return{'model':db[_0x2e6844['model']],'as':_0x2e6844['as'],'attributes':_0x2e6844['attributes'],'include':_0x2e6844[_0xb6a2('0x1e')]?_[_0xb6a2('0x1f')](_0x2e6844['include'],function(_0x4dd5f5){return{'model':db[_0x4dd5f5[_0xb6a2('0x20')]],'as':_0x4dd5f5['as'],'attributes':_0x4dd5f5['attributes']};}):[]};}):[]};}):[]:[]})[_0xb6a2('0x21')](function(_0x17b97a){logger[_0xb6a2('0xe')](_0xb6a2('0x22'),_0x2f684a);logger['debug'](_0xb6a2('0x22'),_0x2f684a,JSON[_0xb6a2('0x12')](_0x17b97a));_0x4e523c(_0x17b97a);})[_0xb6a2('0x16')](function(_0xf56f60){logger['error'](_0xb6a2('0x22'),_0xf56f60[_0xb6a2('0x15')],_0x2f684a);_0x495316(_0x29bc34['error'](0x1f4,_0xf56f60[_0xb6a2('0x15')]));});});};exports[_0xb6a2('0x23')]=function(_0xbabfca){var _0x1c47e4=this;return new Promise(function(_0x1f4ff9,_0x41570d){return db[_0xb6a2('0x17')][_0xb6a2('0x24')]({'raw':_0xbabfca[_0xb6a2('0x19')]?_0xbabfca[_0xb6a2('0x19')][_0xb6a2('0x1a')]===undefined?!![]:![]:!![],'where':_0xbabfca['options']?_0xbabfca[_0xb6a2('0x19')][_0xb6a2('0x1b')]||null:null,'attributes':_0xbabfca['options']?_0xbabfca[_0xb6a2('0x19')]['attributes']||null:null,'include':_0xbabfca[_0xb6a2('0x19')]?_0xbabfca['options']['include']?_[_0xb6a2('0x1f')](_0xbabfca[_0xb6a2('0x19')][_0xb6a2('0x1e')],function(_0x3197d7){return{'model':db[_0x3197d7[_0xb6a2('0x20')]],'as':_0x3197d7['as'],'attributes':_0x3197d7[_0xb6a2('0x1c')],'include':_0x3197d7['include']?_[_0xb6a2('0x1f')](_0x3197d7[_0xb6a2('0x1e')],function(_0x2e09ec){return{'model':db[_0x2e09ec[_0xb6a2('0x20')]],'as':_0x2e09ec['as'],'attributes':_0x2e09ec[_0xb6a2('0x1c')],'include':_0x2e09ec['include']?_[_0xb6a2('0x1f')](_0x2e09ec[_0xb6a2('0x1e')],function(_0x171937){return{'model':db[_0x171937['model']],'as':_0x171937['as'],'attributes':_0x171937[_0xb6a2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb6a2('0x21')](function(_0xf7143b){logger['info'](_0xb6a2('0x23'),_0xbabfca);logger[_0xb6a2('0x25')](_0xb6a2('0x23'),_0xbabfca,JSON[_0xb6a2('0x12')](_0xf7143b));_0x1f4ff9(_0xf7143b);})[_0xb6a2('0x16')](function(_0x3da607){logger[_0xb6a2('0x13')](_0xb6a2('0x23'),_0x3da607['message'],_0xbabfca);_0x41570d(_0x1c47e4[_0xb6a2('0x13')](0x1f4,_0x3da607[_0xb6a2('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index fcbecd1..75ad1ae 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 _0x2fe3=['save','removeListener','length','./mailQueue.events'];(function(_0x2faa68,_0x1db5ff){var _0x284a83=function(_0x2340a4){while(--_0x2340a4){_0x2faa68['push'](_0x2faa68['shift']());}};_0x284a83(++_0x1db5ff);}(_0x2fe3,0x87));var _0x32fe=function(_0x344331,_0x57fe53){_0x344331=_0x344331-0x0;var _0xda5c7b=_0x2fe3[_0x344331];return _0xda5c7b;};'use strict';var MailQueueEvents=require(_0x32fe('0x0'));var events=[_0x32fe('0x1'),'remove','update'];function createListener(_0x3abab5,_0x5528c3){return function(_0x2f85c0){_0x5528c3['emit'](_0x3abab5,_0x2f85c0);};}function removeListener(_0x4ddeb7,_0x2724bd){return function(){MailQueueEvents[_0x32fe('0x2')](_0x4ddeb7,_0x2724bd);};}exports['register']=function(_0x6605ec){for(var _0x89aed1=0x0,_0x314bc1=events[_0x32fe('0x3')];_0x89aed1<_0x314bc1;_0x89aed1++){var _0x5bfbca=events[_0x89aed1];var _0x20171a=createListener('mailQueue:'+_0x5bfbca,_0x6605ec);MailQueueEvents['on'](_0x5bfbca,_0x20171a);}}; \ No newline at end of file +var _0xb887=['./mailQueue.events','update','removeListener','length','mailQueue:'];(function(_0x32214a,_0x24fb09){var _0x1ce1a5=function(_0x58a5ea){while(--_0x58a5ea){_0x32214a['push'](_0x32214a['shift']());}};_0x1ce1a5(++_0x24fb09);}(_0xb887,0xaf));var _0x7b88=function(_0x39eb44,_0x2d6aa7){_0x39eb44=_0x39eb44-0x0;var _0x51d782=_0xb887[_0x39eb44];return _0x51d782;};'use strict';var MailQueueEvents=require(_0x7b88('0x0'));var events=['save','remove',_0x7b88('0x1')];function createListener(_0x24cd4d,_0x4cfaa6){return function(_0x5e7582){_0x4cfaa6['emit'](_0x24cd4d,_0x5e7582);};}function removeListener(_0x436d9b,_0x1f3a1c){return function(){MailQueueEvents[_0x7b88('0x2')](_0x436d9b,_0x1f3a1c);};}exports['register']=function(_0x2e8267){for(var _0x234357=0x0,_0x57f8a6=events[_0x7b88('0x3')];_0x234357<_0x57f8a6;_0x234357++){var _0x4b356f=events[_0x234357];var _0x2f4ca0=createListener(_0x7b88('0x4')+_0x4b356f,_0x2e8267);MailQueueEvents['on'](_0x4b356f,_0x2f4ca0);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 56d7d14..5eef878 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 _0xb3eb=['../../components/interaction/service','./mailQueueReport.controller','get','index','/describe','describe','/:id','show','post','isAuthenticated','create','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xb3eb,0x164));var _0xbb3e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3eb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbb3e('0x0'));var util=require('util');var path=require(_0xbb3e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbb3e('0x2')]();var fs_extra=require(_0xbb3e('0x3'));var auth=require(_0xbb3e('0x4'));var interaction=require(_0xbb3e('0x5'));var config=require('../../config/environment');var controller=require(_0xbb3e('0x6'));router[_0xbb3e('0x7')]('/',auth['isAuthenticated'](),controller[_0xbb3e('0x8')]);router[_0xbb3e('0x7')](_0xbb3e('0x9'),auth['isAuthenticated'](),controller[_0xbb3e('0xa')]);router[_0xbb3e('0x7')](_0xbb3e('0xb'),auth['isAuthenticated'](),controller[_0xbb3e('0xc')]);router[_0xbb3e('0xd')]('/',auth[_0xbb3e('0xe')](),controller[_0xbb3e('0xf')]);router['put'](_0xbb3e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xbb3e('0x10')](_0xbb3e('0xb'),auth[_0xbb3e('0xe')](),controller[_0xbb3e('0x11')]);module[_0xbb3e('0x12')]=router; \ No newline at end of file +var _0x2217=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','create','put'];(function(_0x5aafa6,_0x4981f3){var _0x4a8198=function(_0x27ede9){while(--_0x27ede9){_0x5aafa6['push'](_0x5aafa6['shift']());}};_0x4a8198(++_0x4981f3);}(_0x2217,0xc0));var _0x7221=function(_0x513d6c,_0x678bb1){_0x513d6c=_0x513d6c-0x0;var _0x2dde47=_0x2217[_0x513d6c];return _0x2dde47;};'use strict';var multer=require(_0x7221('0x0'));var util=require(_0x7221('0x1'));var path=require(_0x7221('0x2'));var timeout=require(_0x7221('0x3'));var express=require(_0x7221('0x4'));var router=express['Router']();var fs_extra=require(_0x7221('0x5'));var auth=require(_0x7221('0x6'));var interaction=require(_0x7221('0x7'));var config=require(_0x7221('0x8'));var controller=require('./mailQueueReport.controller');router[_0x7221('0x9')]('/',auth['isAuthenticated'](),controller[_0x7221('0xa')]);router[_0x7221('0x9')](_0x7221('0xb'),auth[_0x7221('0xc')](),controller[_0x7221('0xd')]);router[_0x7221('0x9')](_0x7221('0xe'),auth[_0x7221('0xc')](),controller[_0x7221('0xf')]);router['post']('/',auth[_0x7221('0xc')](),controller[_0x7221('0x10')]);router[_0x7221('0x11')](_0x7221('0xe'),auth[_0x7221('0xc')](),controller['update']);router[_0x7221('0x12')](_0x7221('0xe'),auth[_0x7221('0xc')](),controller[_0x7221('0x13')]);module[_0x7221('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index ee3bd35..9c3b940 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 _0x3cb4=['sequelize','exports','STRING','DATE','moment'];(function(_0x3ad720,_0x46b004){var _0x534fb2=function(_0x4acac1){while(--_0x4acac1){_0x3ad720['push'](_0x3ad720['shift']());}};_0x534fb2(++_0x46b004);}(_0x3cb4,0xc7));var _0x43cb=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x3cb4[_0x550d12];return _0x12103d;};'use strict';var moment=require(_0x43cb('0x0'));var Sequelize=require(_0x43cb('0x1'));module[_0x43cb('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x43cb('0x3')]},'joinAt':{'type':Sequelize[_0x43cb('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x43cb('0x4')]},'exitAt':{'type':Sequelize[_0x43cb('0x4')]},'reason':{'type':Sequelize[_0x43cb('0x3')]}}; \ No newline at end of file +var _0x4fb3=['DATE','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4fb3,0xbd));var _0x34fb=function(_0x417071,_0x5cc28c){_0x417071=_0x417071-0x0;var _0x5d0318=_0x4fb3[_0x417071];return _0x5d0318;};'use strict';var moment=require('moment');var Sequelize=require(_0x34fb('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x34fb('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 247f92c..3be0e02 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 _0xbbbc=['query','intersection','fields','attributes','length','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','params','keys','filters','includeAll','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x533f6,_0x20adf8){_0x533f6=_0x533f6-0x0;var _0x4f828c=_0xbbbc[_0x533f6];return _0x4f828c;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];function respondWithStatusCode(_0x53e651,_0x56f81){_0x56f81=_0x56f81||0xcc;return function(_0x523c50){if(_0x523c50){return _0x53e651[_0xcbbb('0x18')](_0x56f81);}return _0x53e651[_0xcbbb('0x19')](_0x56f81)[_0xcbbb('0x1a')]();};}function respondWithResult(_0x47ea6a,_0x27ba56){_0x27ba56=_0x27ba56||0xc8;return function(_0x3ff767){if(_0x3ff767){return _0x47ea6a[_0xcbbb('0x19')](_0x27ba56)[_0xcbbb('0x1b')](_0x3ff767);}};}function respondWithFilteredResult(_0x47e679,_0x5af226){return function(_0x1bba39){if(_0x1bba39){var _0x30297d=typeof _0x5af226[_0xcbbb('0x1c')]===_0xcbbb('0x1d')&&typeof _0x5af226['limit']===_0xcbbb('0x1d');var _0x4ff973=_0x1bba39[_0xcbbb('0x1e')];var _0x3436af=_0x30297d?0x0:_0x5af226[_0xcbbb('0x1c')];var _0x5052df=_0x30297d?_0x1bba39['count']:_0x5af226['offset']+_0x5af226[_0xcbbb('0x1f')];var _0x3ae91b;if(_0x5052df>=_0x4ff973){_0x5052df=_0x4ff973;_0x3ae91b=0xc8;}else{_0x3ae91b=0xce;}_0x47e679[_0xcbbb('0x19')](_0x3ae91b);return _0x47e679[_0xcbbb('0x20')](_0xcbbb('0x21'),_0x3436af+'-'+_0x5052df+'/'+_0x4ff973)[_0xcbbb('0x1b')](_0x1bba39);}return null;};}function patchUpdates(_0x45de5f){return function(_0x2be36c){try{jsonpatch[_0xcbbb('0x22')](_0x2be36c,_0x45de5f,!![]);}catch(_0x2d4335){return BPromise['reject'](_0x2d4335);}return _0x2be36c[_0xcbbb('0x23')]();};}function saveUpdates(_0xe07b0,_0x159c62){return function(_0x42aaf1){if(_0x42aaf1){return _0x42aaf1[_0xcbbb('0x24')](_0xe07b0)[_0xcbbb('0x25')](function(_0x297eae){return _0x297eae;});}return null;};}function removeEntity(_0xabb565,_0x3ca570){return function(_0x5e3970){if(_0x5e3970){return _0x5e3970[_0xcbbb('0x26')]()[_0xcbbb('0x25')](function(){_0xabb565['status'](0xcc)[_0xcbbb('0x1a')]();});}};}function handleEntityNotFound(_0x4ffa80,_0x48dfc4){return function(_0x575d56){if(!_0x575d56){_0x4ffa80[_0xcbbb('0x18')](0x194);}return _0x575d56;};}function handleError(_0x548440,_0x59c422){_0x59c422=_0x59c422||0x1f4;return function(_0x5499a1){logger[_0xcbbb('0x27')](_0x5499a1['stack']);if(_0x5499a1['name']){delete _0x5499a1[_0xcbbb('0x28')];}_0x548440[_0xcbbb('0x19')](_0x59c422)[_0xcbbb('0x29')](_0x5499a1);};}exports[_0xcbbb('0x2a')]=function(_0x372024,_0x39ba8b){var _0x3d4c0d={},_0x1c986d={},_0x2a023f={'count':0x0,'rows':[]};var _0x26c05e=_[_0xcbbb('0x2b')](db[_0xcbbb('0x2c')][_0xcbbb('0x2d')],function(_0x1ce741){return{'name':_0x1ce741[_0xcbbb('0x2e')],'type':_0x1ce741[_0xcbbb('0x2f')][_0xcbbb('0x30')]};});_0x1c986d[_0xcbbb('0x31')]=_['map'](_0x26c05e,_0xcbbb('0x28'));_0x1c986d[_0xcbbb('0x32')]=_['keys'](_0x372024[_0xcbbb('0x32')]);_0x1c986d['filters']=_[_0xcbbb('0x33')](_0x1c986d[_0xcbbb('0x31')],_0x1c986d[_0xcbbb('0x32')]);_0x3d4c0d['attributes']=_[_0xcbbb('0x33')](_0x1c986d[_0xcbbb('0x31')],qs[_0xcbbb('0x34')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x34')]));_0x3d4c0d[_0xcbbb('0x35')]=_0x3d4c0d[_0xcbbb('0x35')][_0xcbbb('0x36')]?_0x3d4c0d[_0xcbbb('0x35')]:_0x1c986d[_0xcbbb('0x31')];if(!_0x372024['query']['hasOwnProperty']('nolimit')){_0x3d4c0d['limit']=qs[_0xcbbb('0x1f')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x1f')]);_0x3d4c0d[_0xcbbb('0x1c')]=qs[_0xcbbb('0x1c')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x1c')]);}_0x3d4c0d[_0xcbbb('0x37')]=qs[_0xcbbb('0x38')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x38')]);_0x3d4c0d[_0xcbbb('0x39')]=qs['filters'](_['pick'](_0x372024[_0xcbbb('0x32')],_0x1c986d['filters']),_0x26c05e);if(_0x372024['query']['filter']){_0x3d4c0d[_0xcbbb('0x39')]=_[_0xcbbb('0x3a')](_0x3d4c0d[_0xcbbb('0x39')],{'$or':_[_0xcbbb('0x2b')](_0x26c05e,function(_0x38e59d){if(_0x38e59d[_0xcbbb('0x2f')]!==_0xcbbb('0x3b')){var _0x14c1a2={};_0x14c1a2[_0x38e59d[_0xcbbb('0x28')]]={'$like':'%'+_0x372024[_0xcbbb('0x32')][_0xcbbb('0x3c')]+'%'};return _0x14c1a2;}})});}_0x3d4c0d=_['merge']({},_0x3d4c0d,_0x372024[_0xcbbb('0x3d')]);var _0x55d349={'where':_0x3d4c0d[_0xcbbb('0x39')]};return db[_0xcbbb('0x2c')][_0xcbbb('0x1e')](_0x55d349)[_0xcbbb('0x25')](function(_0x433065){_0x2a023f[_0xcbbb('0x1e')]=_0x433065;if(_0x372024['query']['includeAll']){_0x3d4c0d['include']=[{'all':!![]}];}return db[_0xcbbb('0x2c')][_0xcbbb('0x3e')](_0x3d4c0d);})[_0xcbbb('0x25')](function(_0x162979){_0x2a023f[_0xcbbb('0x3f')]=_0x162979;return _0x2a023f;})[_0xcbbb('0x25')](respondWithFilteredResult(_0x39ba8b,_0x3d4c0d))[_0xcbbb('0x40')](handleError(_0x39ba8b,null));};exports['show']=function(_0x1a7799,_0x22076a){var _0x5550d2={'raw':!![],'where':{'id':_0x1a7799[_0xcbbb('0x41')]['id']}},_0x15b3bc={};_0x15b3bc[_0xcbbb('0x31')]=_[_0xcbbb('0x42')](db[_0xcbbb('0x2c')]['rawAttributes']);_0x15b3bc[_0xcbbb('0x32')]=_['keys'](_0x1a7799['query']);_0x15b3bc[_0xcbbb('0x43')]=_[_0xcbbb('0x33')](_0x15b3bc[_0xcbbb('0x31')],_0x15b3bc[_0xcbbb('0x32')]);_0x5550d2[_0xcbbb('0x35')]=_[_0xcbbb('0x33')](_0x15b3bc[_0xcbbb('0x31')],qs[_0xcbbb('0x34')](_0x1a7799[_0xcbbb('0x32')][_0xcbbb('0x34')]));_0x5550d2[_0xcbbb('0x35')]=_0x5550d2[_0xcbbb('0x35')][_0xcbbb('0x36')]?_0x5550d2[_0xcbbb('0x35')]:_0x15b3bc['model'];if(_0x1a7799[_0xcbbb('0x32')][_0xcbbb('0x44')]){_0x5550d2[_0xcbbb('0x45')]=[{'all':!![]}];}_0x5550d2=_[_0xcbbb('0x3a')]({},_0x5550d2,_0x1a7799['options']);return db['MailQueueReport']['find'](_0x5550d2)[_0xcbbb('0x25')](handleEntityNotFound(_0x22076a,null))[_0xcbbb('0x25')](respondWithResult(_0x22076a,null))[_0xcbbb('0x40')](handleError(_0x22076a,null));};exports[_0xcbbb('0x46')]=function(_0x146f37,_0x1ef25b){return db[_0xcbbb('0x2c')]['create'](_0x146f37[_0xcbbb('0x47')],{})[_0xcbbb('0x25')](respondWithResult(_0x1ef25b,0xc9))[_0xcbbb('0x40')](handleError(_0x1ef25b,null));};exports[_0xcbbb('0x24')]=function(_0x478c22,_0x3378cd){if(_0x478c22[_0xcbbb('0x47')]['id']){delete _0x478c22[_0xcbbb('0x47')]['id'];}return db[_0xcbbb('0x2c')]['find']({'where':{'id':_0x478c22['params']['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x3378cd,null))[_0xcbbb('0x25')](saveUpdates(_0x478c22[_0xcbbb('0x47')],null))['then'](respondWithResult(_0x3378cd,null))['catch'](handleError(_0x3378cd,null));};exports['destroy']=function(_0x189a40,_0x3070d9){return db['MailQueueReport'][_0xcbbb('0x48')]({'where':{'id':_0x189a40[_0xcbbb('0x41')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x3070d9,null))[_0xcbbb('0x25')](removeEntity(_0x3070d9,null))['catch'](handleError(_0x3070d9,null));};exports[_0xcbbb('0x49')]=function(_0x1e4bb0,_0x39640d){return db[_0xcbbb('0x2c')][_0xcbbb('0x49')]()[_0xcbbb('0x25')](respondWithResult(_0x39640d,null))[_0xcbbb('0x40')](handleError(_0x39640d,null));}; \ No newline at end of file +var _0x5f66=['bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x159f91,_0xe8a30f){var _0x26bd65=function(_0x5680d1){while(--_0x5680d1){_0x159f91['push'](_0x159f91['shift']());}};_0x26bd65(++_0xe8a30f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['MailQueueReport'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['MailQueueReport'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index ead4c9d..93626e6 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 _0x49c1=['moment','request-promise','path','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','uniqueid','lodash','../../config/logger','api'];(function(_0x563f5c,_0x24e5d0){var _0x536a6a=function(_0x4d1751){while(--_0x4d1751){_0x563f5c['push'](_0x563f5c['shift']());}};_0x536a6a(++_0x24e5d0);}(_0x49c1,0xef));var _0x149c=function(_0x115de5,_0x30bea0){_0x115de5=_0x115de5-0x0;var _0x32eab2=_0x49c1[_0x115de5];return _0x32eab2;};'use strict';var _=require(_0x149c('0x0'));var util=require('util');var logger=require(_0x149c('0x1'))(_0x149c('0x2'));var moment=require(_0x149c('0x3'));var BPromise=require('bluebird');var rp=require(_0x149c('0x4'));var fs=require('fs');var path=require(_0x149c('0x5'));var rimraf=require('rimraf');var config=require(_0x149c('0x6'));var attributes=require(_0x149c('0x7'));module['exports']=function(_0x46c725,_0x561d00){return _0x46c725[_0x149c('0x8')](_0x149c('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x149c('0xa'),'fields':[_0x149c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfbd1=['uniqueid','../../config/logger','bluebird','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xfbd1,0x1c3));var _0x1fbd=function(_0x4ab32c,_0x44ab5e){_0x4ab32c=_0x4ab32c-0x0;var _0x2b9644=_0xfbd1[_0x4ab32c];return _0x2b9644;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1fbd('0x0'))('api');var moment=require('moment');var BPromise=require(_0x1fbd('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1fbd('0x2'));var config=require(_0x1fbd('0x3'));var attributes=require(_0x1fbd('0x4'));module[_0x1fbd('0x5')]=function(_0x5eaf55,_0x35d062){return _0x5eaf55[_0x1fbd('0x6')](_0x1fbd('0x7'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x1fbd('0x8'),'fields':[_0x1fbd('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 229635b..0b59428 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 _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0xbd7fc5,_0x1d43aa){var _0x50f950=function(_0x3b8143){while(--_0x3b8143){_0xbd7fc5['push'](_0xbd7fc5['shift']());}};_0x50f950(++_0x1d43aa);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +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(_0xbc0a41,_0x347e6e){var _0x58b569=function(_0x1a0995){while(--_0x1a0995){_0xbc0a41['push'](_0xbc0a41['shift']());}};_0x58b569(++_0x347e6e);}(_0x7a54,0x106));var _0x47a5=function(_0x2187c7,_0x42ff32){_0x2187c7=_0x2187c7-0x0;var _0x2a22e6=_0x7a54[_0x2187c7];return _0x2a22e6;};'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 c4dd42a..66b03e2 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5ebd54,_0x928763){var _0x5f53f5=function(_0x380b5f){while(--_0x380b5f){_0x5ebd54['push'](_0x5ebd54['shift']());}};_0x5f53f5(++_0x928763);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5300b9,_0x2890ab){var _0x5db92e=function(_0x4a5054){while(--_0x4a5054){_0x5300b9['push'](_0x5300b9['shift']());}};_0x5db92e(++_0x2890ab);}(_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 deef579..447650c 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 _0xe14b=['exports','STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x474fb8,_0x298892){var _0xfd2d18=function(_0x5ec5c7){while(--_0x5ec5c7){_0x474fb8['push'](_0x474fb8['shift']());}};_0xfd2d18(++_0x298892);}(_0xe14b,0x16d));var _0xbe14=function(_0x4bda95,_0x9ccebb){_0x4bda95=_0x4bda95-0x0;var _0x37490e=_0xe14b[_0x4bda95];return _0x37490e;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'description':{'type':Sequelize[_0xbe14('0x2')]},'host':{'type':Sequelize[_0xbe14('0x2')]},'authentication':{'type':Sequelize[_0xbe14('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xbe14('0x2')]},'password':{'type':Sequelize[_0xbe14('0x2')]},'port':{'type':Sequelize[_0xbe14('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xbe14('0x5')},'connTimeout':{'type':Sequelize[_0xbe14('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xbe14('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8ae2=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x42749b,_0x16a7ba){var _0x19db46=function(_0x43d724){while(--_0x43d724){_0x42749b['push'](_0x42749b['shift']());}};_0x19db46(++_0x16a7ba);}(_0x8ae2,0x121));var _0x28ae=function(_0x1594de,_0x5d33b5){_0x1594de=_0x1594de-0x0;var _0x5af371=_0x8ae2[_0x1594de];return _0x5af371;};'use strict';var Sequelize=require(_0x28ae('0x0'));module[_0x28ae('0x1')]={'description':{'type':Sequelize[_0x28ae('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x28ae('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x28ae('0x2')]},'port':{'type':Sequelize[_0x28ae('0x4')]},'tls':{'type':Sequelize[_0x28ae('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x28ae('0x2')],'defaultValue':_0x28ae('0x5')},'connTimeout':{'type':Sequelize[_0x28ae('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x28ae('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x28ae('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 819e9f1..f1f7d50 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 _0x7b3c=['../../config/environment','define','MailServerIn','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x341877,_0xa3554c){var _0x274c5a=function(_0x12787d){while(--_0x12787d){_0x341877['push'](_0x341877['shift']());}};_0x274c5a(++_0xa3554c);}(_0x7b3c,0x12c));var _0xc7b3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7b3c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xc7b3('0x0'));var util=require('util');var logger=require(_0xc7b3('0x1'))(_0xc7b3('0x2'));var moment=require(_0xc7b3('0x3'));var BPromise=require(_0xc7b3('0x4'));var rp=require(_0xc7b3('0x5'));var fs=require('fs');var path=require(_0xc7b3('0x6'));var rimraf=require(_0xc7b3('0x7'));var config=require(_0xc7b3('0x8'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x5a7445,_0x1f9179){return _0x5a7445[_0xc7b3('0x9')](_0xc7b3('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x859a=['bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x859a,0xcd));var _0xa859=function(_0x586634,_0x4fa98e){_0x586634=_0x586634-0x0;var _0x65eca5=_0x859a[_0x586634];return _0x65eca5;};'use strict';var _=require(_0xa859('0x0'));var util=require(_0xa859('0x1'));var logger=require(_0xa859('0x2'))(_0xa859('0x3'));var moment=require(_0xa859('0x4'));var BPromise=require(_0xa859('0x5'));var rp=require(_0xa859('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa859('0x7'));var config=require(_0xa859('0x8'));var attributes=require(_0xa859('0x9'));module[_0xa859('0xa')]=function(_0x1d717a,_0x37d1d2){return _0x1d717a[_0xa859('0xb')](_0xa859('0xc'),attributes,{'tableName':_0xa859('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 39dae49..7a8efc0 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 _0xa391=['error','message','result','catch','GetMailServerIn','findAll','options','raw','attributes','limit','include','map','model','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xa391,0x1ee));var _0x1a39=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xa391[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var util=require(_0x1a39('0x0'));var moment=require('moment');var BPromise=require(_0x1a39('0x1'));var rs=require(_0x1a39('0x2'));var fs=require('fs');var Redis=require(_0x1a39('0x3'));var db=require(_0x1a39('0x4'))['db'];var utils=require(_0x1a39('0x5'));var logger=require('../../config/logger')(_0x1a39('0x6'));var config=require(_0x1a39('0x7'));var jayson=require(_0x1a39('0x8'));var client=jayson[_0x1a39('0x9')][_0x1a39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a94b8,_0x2ec880,_0x532449){return new BPromise(function(_0x382591,_0x5e02d2){return client[_0x1a39('0xb')](_0x1a94b8,_0x532449)[_0x1a39('0xc')](function(_0x48aba4){logger[_0x1a39('0xd')](_0x1a39('0xe'),_0x2ec880,_0x1a39('0xf'));logger[_0x1a39('0x10')](_0x1a39('0x11'),_0x2ec880,'request\x20sent',JSON['stringify'](_0x48aba4));if(_0x48aba4[_0x1a39('0x12')]){if(_0x48aba4[_0x1a39('0x12')]['code']===0x1f4){logger[_0x1a39('0x12')]('MailServerIn,\x20%s,\x20%s',_0x2ec880,_0x48aba4['error'][_0x1a39('0x13')]);return _0x5e02d2(_0x48aba4[_0x1a39('0x12')][_0x1a39('0x13')]);}logger[_0x1a39('0x12')](_0x1a39('0xe'),_0x2ec880,_0x48aba4['error'][_0x1a39('0x13')]);return _0x382591(_0x48aba4[_0x1a39('0x12')][_0x1a39('0x13')]);}else{logger['info'](_0x1a39('0xe'),_0x2ec880,'request\x20sent');_0x382591(_0x48aba4[_0x1a39('0x14')][_0x1a39('0x13')]);}})[_0x1a39('0x15')](function(_0x373db2){logger[_0x1a39('0x12')](_0x1a39('0xe'),_0x2ec880,_0x373db2);_0x5e02d2(_0x373db2);});});}exports[_0x1a39('0x16')]=function(_0x584fdc){var _0x40edea=this;return new Promise(function(_0x1f8dc7,_0x320a6e){return db['MailServerIn'][_0x1a39('0x17')]({'raw':_0x584fdc[_0x1a39('0x18')]?_0x584fdc[_0x1a39('0x18')][_0x1a39('0x19')]===undefined?!![]:![]:!![],'where':_0x584fdc['options']?_0x584fdc['options']['where']||null:null,'attributes':_0x584fdc['options']?_0x584fdc[_0x1a39('0x18')][_0x1a39('0x1a')]||null:null,'limit':_0x584fdc[_0x1a39('0x18')]?_0x584fdc[_0x1a39('0x18')][_0x1a39('0x1b')]||null:null,'include':_0x584fdc['options']?_0x584fdc[_0x1a39('0x18')][_0x1a39('0x1c')]?_[_0x1a39('0x1d')](_0x584fdc[_0x1a39('0x18')][_0x1a39('0x1c')],function(_0x5577ed){return{'model':db[_0x5577ed['model']],'as':_0x5577ed['as'],'attributes':_0x5577ed['attributes'],'include':_0x5577ed[_0x1a39('0x1c')]?_['map'](_0x5577ed['include'],function(_0xd0591){return{'model':db[_0xd0591[_0x1a39('0x1e')]],'as':_0xd0591['as'],'attributes':_0xd0591['attributes'],'include':_0xd0591[_0x1a39('0x1c')]?_[_0x1a39('0x1d')](_0xd0591[_0x1a39('0x1c')],function(_0x73426d){return{'model':db[_0x73426d[_0x1a39('0x1e')]],'as':_0x73426d['as'],'attributes':_0x73426d[_0x1a39('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1a39('0xc')](function(_0x1b8e1f){logger[_0x1a39('0xd')](_0x1a39('0x16'),_0x584fdc);logger[_0x1a39('0x10')]('GetMailServerIn',_0x584fdc,JSON[_0x1a39('0x1f')](_0x1b8e1f));_0x1f8dc7(_0x1b8e1f);})[_0x1a39('0x15')](function(_0x4f6bba){logger[_0x1a39('0x12')](_0x1a39('0x16'),_0x4f6bba[_0x1a39('0x13')],_0x584fdc);_0x320a6e(_0x40edea['error'](0x1f4,_0x4f6bba['message']));});});}; \ No newline at end of file +var _0xe3bd=['rpc','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetMailServerIn','MailServerIn','findAll','options','where','limit','include','map','model','attributes','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x5d64f3,_0x9f069c){var _0x26ca1d=function(_0x5e1b6c){while(--_0x5e1b6c){_0x5d64f3['push'](_0x5d64f3['shift']());}};_0x26ca1d(++_0x9f069c);}(_0xe3bd,0x126));var _0xde3b=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xe3bd[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require(_0xde3b('0x0'));var moment=require(_0xde3b('0x1'));var BPromise=require(_0xde3b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde3b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xde3b('0x4'));var logger=require(_0xde3b('0x5'))(_0xde3b('0x6'));var config=require('../../config/environment');var jayson=require(_0xde3b('0x7'));var client=jayson['client'][_0xde3b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47ad7f,_0x19a343,_0x29cdcc){return new BPromise(function(_0x202089,_0x2e0337){return client[_0xde3b('0x9')](_0x47ad7f,_0x29cdcc)[_0xde3b('0xa')](function(_0x5ab20e){logger[_0xde3b('0xb')](_0xde3b('0xc'),_0x19a343,_0xde3b('0xd'));logger[_0xde3b('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x19a343,_0xde3b('0xd'),JSON[_0xde3b('0xf')](_0x5ab20e));if(_0x5ab20e[_0xde3b('0x10')]){if(_0x5ab20e[_0xde3b('0x10')][_0xde3b('0x11')]===0x1f4){logger['error'](_0xde3b('0xc'),_0x19a343,_0x5ab20e[_0xde3b('0x10')][_0xde3b('0x12')]);return _0x2e0337(_0x5ab20e['error']['message']);}logger[_0xde3b('0x10')](_0xde3b('0xc'),_0x19a343,_0x5ab20e[_0xde3b('0x10')][_0xde3b('0x12')]);return _0x202089(_0x5ab20e[_0xde3b('0x10')][_0xde3b('0x12')]);}else{logger[_0xde3b('0xb')](_0xde3b('0xc'),_0x19a343,_0xde3b('0xd'));_0x202089(_0x5ab20e['result']['message']);}})['catch'](function(_0x36defd){logger['error']('MailServerIn,\x20%s,\x20%s',_0x19a343,_0x36defd);_0x2e0337(_0x36defd);});});}exports[_0xde3b('0x13')]=function(_0x1b6244){var _0x18479a=this;return new Promise(function(_0x1d5f53,_0x314026){return db[_0xde3b('0x14')][_0xde3b('0x15')]({'raw':_0x1b6244[_0xde3b('0x16')]?_0x1b6244[_0xde3b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1b6244[_0xde3b('0x16')]?_0x1b6244['options'][_0xde3b('0x17')]||null:null,'attributes':_0x1b6244[_0xde3b('0x16')]?_0x1b6244[_0xde3b('0x16')]['attributes']||null:null,'limit':_0x1b6244['options']?_0x1b6244[_0xde3b('0x16')][_0xde3b('0x18')]||null:null,'include':_0x1b6244[_0xde3b('0x16')]?_0x1b6244[_0xde3b('0x16')][_0xde3b('0x19')]?_[_0xde3b('0x1a')](_0x1b6244['options'][_0xde3b('0x19')],function(_0x2ba3b5){return{'model':db[_0x2ba3b5[_0xde3b('0x1b')]],'as':_0x2ba3b5['as'],'attributes':_0x2ba3b5[_0xde3b('0x1c')],'include':_0x2ba3b5[_0xde3b('0x19')]?_[_0xde3b('0x1a')](_0x2ba3b5[_0xde3b('0x19')],function(_0x1210be){return{'model':db[_0x1210be[_0xde3b('0x1b')]],'as':_0x1210be['as'],'attributes':_0x1210be[_0xde3b('0x1c')],'include':_0x1210be[_0xde3b('0x19')]?_['map'](_0x1210be[_0xde3b('0x19')],function(_0x50d34a){return{'model':db[_0x50d34a[_0xde3b('0x1b')]],'as':_0x50d34a['as'],'attributes':_0x50d34a[_0xde3b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xde3b('0xa')](function(_0x49a19c){logger['info'](_0xde3b('0x13'),_0x1b6244);logger[_0xde3b('0xe')](_0xde3b('0x13'),_0x1b6244,JSON[_0xde3b('0xf')](_0x49a19c));_0x1d5f53(_0x49a19c);})[_0xde3b('0x1d')](function(_0x372711){logger[_0xde3b('0x10')](_0xde3b('0x13'),_0x372711['message'],_0x1b6244);_0x314026(_0x18479a[_0xde3b('0x10')](0x1f4,_0x372711[_0xde3b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 4277da2..da7363e 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7a54,0x106));var _0x47a5=function(_0x2d4998,_0x3b1552){_0x2d4998=_0x2d4998-0x0;var _0x3e77a7=_0x7a54[_0x2d4998];return _0x3e77a7;};'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 065f762..d183c32 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 _0x6b20=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x4f998a,_0x2750a5){var _0x16d84b=function(_0x2897c3){while(--_0x2897c3){_0x4f998a['push'](_0x4f998a['shift']());}};_0x16d84b(++_0x2750a5);}(_0x6b20,0xd1));var _0x06b2=function(_0x58a638,_0x504102){_0x58a638=_0x58a638-0x0;var _0x489e0e=_0x6b20[_0x58a638];return _0x489e0e;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x06b2('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x06b2('0x2')]},'port':{'type':Sequelize[_0x06b2('0x3')]},'secure':{'type':Sequelize[_0x06b2('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x06b2('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x06b2('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xe706=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x1831a8,_0x9adbf){var _0x57c792=function(_0x12420d){while(--_0x12420d){_0x1831a8['push'](_0x1831a8['shift']());}};_0x57c792(++_0x9adbf);}(_0xe706,0xa3));var _0x6e70=function(_0x4f229e,_0x1b1e6c){_0x4f229e=_0x4f229e-0x0;var _0x407c5e=_0xe706[_0x4f229e];return _0x407c5e;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'description':{'type':Sequelize[_0x6e70('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x6e70('0x2')]},'pass':{'type':Sequelize[_0x6e70('0x2')]},'port':{'type':Sequelize[_0x6e70('0x3')]},'secure':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x6e70('0x2')]},'authentication':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x6e70('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 bd2c596..8d14ad5 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 _0x0f04=['end','error','stack','name','send','index','map','MailServerOut','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','where','filters','merge','filter','includeAll','include','rows','show','params','keys','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x0f04,0x1ca));var _0x40f0=function(_0x45ba16,_0x33ba90){_0x45ba16=_0x45ba16-0x0;var _0xe33367=_0x0f04[_0x45ba16];return _0xe33367;};'use strict';var emlformat=require(_0x40f0('0x0'));var rimraf=require(_0x40f0('0x1'));var zipdir=require(_0x40f0('0x2'));var jsonpatch=require(_0x40f0('0x3'));var rp=require(_0x40f0('0x4'));var moment=require('moment');var BPromise=require(_0x40f0('0x5'));var Mustache=require('mustache');var util=require(_0x40f0('0x6'));var path=require('path');var sox=require(_0x40f0('0x7'));var csv=require(_0x40f0('0x8'));var ejs=require(_0x40f0('0x9'));var fs=require('fs');var fs_extra=require(_0x40f0('0xa'));var _=require(_0x40f0('0xb'));var squel=require(_0x40f0('0xc'));var crypto=require(_0x40f0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x40f0('0xe'));var toCsv=require(_0x40f0('0x8'));var querystring=require('querystring');var Papa=require(_0x40f0('0xf'));var Redis=require(_0x40f0('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x40f0('0x11'));var hardwareService=require(_0x40f0('0x12'));var logger=require(_0x40f0('0x13'))(_0x40f0('0x14'));var utils=require(_0x40f0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x40f0('0x16'));var db=require(_0x40f0('0x17'))['db'];function respondWithStatusCode(_0x17d592,_0xf72b8e){_0xf72b8e=_0xf72b8e||0xcc;return function(_0x4aa501){if(_0x4aa501){return _0x17d592[_0x40f0('0x18')](_0xf72b8e);}return _0x17d592[_0x40f0('0x19')](_0xf72b8e)['end']();};}function respondWithResult(_0x5d6c97,_0x26ba2f){_0x26ba2f=_0x26ba2f||0xc8;return function(_0x25366b){if(_0x25366b){return _0x5d6c97['status'](_0x26ba2f)[_0x40f0('0x1a')](_0x25366b);}};}function respondWithFilteredResult(_0x1fdf28,_0x48166c){return function(_0xa7b5b7){if(_0xa7b5b7){var _0x4bf932=typeof _0x48166c['offset']==='undefined'&&typeof _0x48166c[_0x40f0('0x1b')]===_0x40f0('0x1c');var _0x5c43e7=_0xa7b5b7[_0x40f0('0x1d')];var _0x107d2d=_0x4bf932?0x0:_0x48166c[_0x40f0('0x1e')];var _0x416cf2=_0x4bf932?_0xa7b5b7[_0x40f0('0x1d')]:_0x48166c[_0x40f0('0x1e')]+_0x48166c[_0x40f0('0x1b')];var _0x20248e;if(_0x416cf2>=_0x5c43e7){_0x416cf2=_0x5c43e7;_0x20248e=0xc8;}else{_0x20248e=0xce;}_0x1fdf28[_0x40f0('0x19')](_0x20248e);return _0x1fdf28[_0x40f0('0x1f')](_0x40f0('0x20'),_0x107d2d+'-'+_0x416cf2+'/'+_0x5c43e7)['json'](_0xa7b5b7);}return null;};}function patchUpdates(_0x440c9d){return function(_0x26a496){try{jsonpatch[_0x40f0('0x21')](_0x26a496,_0x440c9d,!![]);}catch(_0x540886){return BPromise[_0x40f0('0x22')](_0x540886);}return _0x26a496[_0x40f0('0x23')]();};}function saveUpdates(_0x279513,_0x4de9b0){return function(_0x2afb52){if(_0x2afb52){return _0x2afb52[_0x40f0('0x24')](_0x279513)[_0x40f0('0x25')](function(_0x2e4042){return _0x2e4042;});}return null;};}function removeEntity(_0x1162b8,_0x4314f9){return function(_0xf5d4a){if(_0xf5d4a){return _0xf5d4a[_0x40f0('0x26')]()['then'](function(){_0x1162b8['status'](0xcc)[_0x40f0('0x27')]();});}};}function handleEntityNotFound(_0x3794c6,_0x5e54a4){return function(_0x16e81b){if(!_0x16e81b){_0x3794c6['sendStatus'](0x194);}return _0x16e81b;};}function handleError(_0x14b4d8,_0x3cf322){_0x3cf322=_0x3cf322||0x1f4;return function(_0x24ba92){logger[_0x40f0('0x28')](_0x24ba92[_0x40f0('0x29')]);if(_0x24ba92[_0x40f0('0x2a')]){delete _0x24ba92[_0x40f0('0x2a')];}_0x14b4d8[_0x40f0('0x19')](_0x3cf322)[_0x40f0('0x2b')](_0x24ba92);};}exports[_0x40f0('0x2c')]=function(_0x1baf9e,_0x4bcb97){var _0x51241b={},_0x2596f6={},_0x450bad={'count':0x0,'rows':[]};var _0x18a4c1=_[_0x40f0('0x2d')](db[_0x40f0('0x2e')]['rawAttributes'],function(_0x43205e){return{'name':_0x43205e[_0x40f0('0x2f')],'type':_0x43205e[_0x40f0('0x30')][_0x40f0('0x31')]};});_0x2596f6[_0x40f0('0x32')]=_[_0x40f0('0x2d')](_0x18a4c1,_0x40f0('0x2a'));_0x2596f6[_0x40f0('0x33')]=_['keys'](_0x1baf9e[_0x40f0('0x33')]);_0x2596f6['filters']=_[_0x40f0('0x34')](_0x2596f6[_0x40f0('0x32')],_0x2596f6[_0x40f0('0x33')]);_0x51241b[_0x40f0('0x35')]=_[_0x40f0('0x34')](_0x2596f6[_0x40f0('0x32')],qs[_0x40f0('0x36')](_0x1baf9e[_0x40f0('0x33')][_0x40f0('0x36')]));_0x51241b['attributes']=_0x51241b['attributes']['length']?_0x51241b[_0x40f0('0x35')]:_0x2596f6[_0x40f0('0x32')];if(!_0x1baf9e[_0x40f0('0x33')]['hasOwnProperty'](_0x40f0('0x37'))){_0x51241b[_0x40f0('0x1b')]=qs['limit'](_0x1baf9e[_0x40f0('0x33')][_0x40f0('0x1b')]);_0x51241b[_0x40f0('0x1e')]=qs[_0x40f0('0x1e')](_0x1baf9e[_0x40f0('0x33')][_0x40f0('0x1e')]);}_0x51241b[_0x40f0('0x38')]=qs['sort'](_0x1baf9e[_0x40f0('0x33')]['sort']);_0x51241b[_0x40f0('0x39')]=qs[_0x40f0('0x3a')](_['pick'](_0x1baf9e[_0x40f0('0x33')],_0x2596f6[_0x40f0('0x3a')]),_0x18a4c1);if(_0x1baf9e[_0x40f0('0x33')]['filter']){_0x51241b['where']=_[_0x40f0('0x3b')](_0x51241b[_0x40f0('0x39')],{'$or':_['map'](_0x18a4c1,function(_0x1f225c){if(_0x1f225c[_0x40f0('0x30')]!=='VIRTUAL'){var _0x9cf479={};_0x9cf479[_0x1f225c['name']]={'$like':'%'+_0x1baf9e['query'][_0x40f0('0x3c')]+'%'};return _0x9cf479;}})});}_0x51241b=_[_0x40f0('0x3b')]({},_0x51241b,_0x1baf9e['options']);var _0x4cf246={'where':_0x51241b[_0x40f0('0x39')]};return db['MailServerOut'][_0x40f0('0x1d')](_0x4cf246)[_0x40f0('0x25')](function(_0x154be0){_0x450bad[_0x40f0('0x1d')]=_0x154be0;if(_0x1baf9e[_0x40f0('0x33')][_0x40f0('0x3d')]){_0x51241b[_0x40f0('0x3e')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x51241b);})['then'](function(_0x134bb3){_0x450bad[_0x40f0('0x3f')]=_0x134bb3;return _0x450bad;})[_0x40f0('0x25')](respondWithFilteredResult(_0x4bcb97,_0x51241b))['catch'](handleError(_0x4bcb97,null));};exports[_0x40f0('0x40')]=function(_0x48e0a7,_0x574d6b){var _0x4cdcfa={'raw':!![],'where':{'id':_0x48e0a7[_0x40f0('0x41')]['id']}},_0x359dec={};_0x359dec['model']=_['keys'](db[_0x40f0('0x2e')]['rawAttributes']);_0x359dec[_0x40f0('0x33')]=_[_0x40f0('0x42')](_0x48e0a7['query']);_0x359dec[_0x40f0('0x3a')]=_[_0x40f0('0x34')](_0x359dec['model'],_0x359dec[_0x40f0('0x33')]);_0x4cdcfa[_0x40f0('0x35')]=_[_0x40f0('0x34')](_0x359dec[_0x40f0('0x32')],qs[_0x40f0('0x36')](_0x48e0a7[_0x40f0('0x33')][_0x40f0('0x36')]));_0x4cdcfa[_0x40f0('0x35')]=_0x4cdcfa[_0x40f0('0x35')]['length']?_0x4cdcfa[_0x40f0('0x35')]:_0x359dec[_0x40f0('0x32')];if(_0x48e0a7['query']['includeAll']){_0x4cdcfa[_0x40f0('0x3e')]=[{'all':!![]}];}_0x4cdcfa=_['merge']({},_0x4cdcfa,_0x48e0a7['options']);return db[_0x40f0('0x2e')][_0x40f0('0x43')](_0x4cdcfa)[_0x40f0('0x25')](handleEntityNotFound(_0x574d6b,null))[_0x40f0('0x25')](respondWithResult(_0x574d6b,null))['catch'](handleError(_0x574d6b,null));};exports[_0x40f0('0x44')]=function(_0x5a8d69,_0x43e672){return db['MailServerOut'][_0x40f0('0x44')](_0x5a8d69[_0x40f0('0x45')],{})[_0x40f0('0x25')](respondWithResult(_0x43e672,0xc9))[_0x40f0('0x46')](handleError(_0x43e672,null));};exports[_0x40f0('0x24')]=function(_0x4489e3,_0x5d32b7){if(_0x4489e3[_0x40f0('0x45')]['id']){delete _0x4489e3['body']['id'];}return db['MailServerOut']['find']({'where':{'id':_0x4489e3['params']['id']}})[_0x40f0('0x25')](handleEntityNotFound(_0x5d32b7,null))[_0x40f0('0x25')](saveUpdates(_0x4489e3[_0x40f0('0x45')],null))[_0x40f0('0x25')](respondWithResult(_0x5d32b7,null))['catch'](handleError(_0x5d32b7,null));};exports[_0x40f0('0x26')]=function(_0x5996cf,_0x2c910){return db['MailServerOut']['find']({'where':{'id':_0x5996cf[_0x40f0('0x41')]['id']}})[_0x40f0('0x25')](handleEntityNotFound(_0x2c910,null))['then'](removeEntity(_0x2c910,null))[_0x40f0('0x46')](handleError(_0x2c910,null));}; \ No newline at end of file +var _0xfbd6=['../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','MailServerOut','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0xcb0171,_0x4d3679){var _0x19d60d=function(_0xb34434){while(--_0xb34434){_0xcb0171['push'](_0xcb0171['shift']());}};_0x19d60d(++_0x4d3679);}(_0xfbd6,0x19b));var _0x6fbd=function(_0x4a1238,_0x50bc2b){_0x4a1238=_0x4a1238-0x0;var _0x1b5080=_0xfbd6[_0x4a1238];return _0x1b5080;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6fbd('0x0'));var zipdir=require(_0x6fbd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6fbd('0x2'));var moment=require(_0x6fbd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6fbd('0x4'));var util=require('util');var path=require(_0x6fbd('0x5'));var sox=require(_0x6fbd('0x6'));var csv=require(_0x6fbd('0x7'));var ejs=require(_0x6fbd('0x8'));var fs=require('fs');var fs_extra=require(_0x6fbd('0x9'));var _=require(_0x6fbd('0xa'));var squel=require(_0x6fbd('0xb'));var crypto=require(_0x6fbd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6fbd('0xd'));var toCsv=require(_0x6fbd('0x7'));var querystring=require(_0x6fbd('0xe'));var Papa=require(_0x6fbd('0xf'));var Redis=require(_0x6fbd('0x10'));var authService=require(_0x6fbd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6fbd('0x12'));var hardwareService=require(_0x6fbd('0x13'));var logger=require(_0x6fbd('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6fbd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6fbd('0x16'))['db'];function respondWithStatusCode(_0x216f11,_0x6725f7){_0x6725f7=_0x6725f7||0xcc;return function(_0x3ec144){if(_0x3ec144){return _0x216f11[_0x6fbd('0x17')](_0x6725f7);}return _0x216f11['status'](_0x6725f7)[_0x6fbd('0x18')]();};}function respondWithResult(_0x25297d,_0x585220){_0x585220=_0x585220||0xc8;return function(_0x502668){if(_0x502668){return _0x25297d['status'](_0x585220)['json'](_0x502668);}};}function respondWithFilteredResult(_0x4868e7,_0x153cb1){return function(_0x4aa87a){if(_0x4aa87a){var _0x4d16e4=typeof _0x153cb1[_0x6fbd('0x19')]===_0x6fbd('0x1a')&&typeof _0x153cb1[_0x6fbd('0x1b')]==='undefined';var _0x1cfa7a=_0x4aa87a[_0x6fbd('0x1c')];var _0xfa9016=_0x4d16e4?0x0:_0x153cb1[_0x6fbd('0x19')];var _0x5b2d71=_0x4d16e4?_0x4aa87a[_0x6fbd('0x1c')]:_0x153cb1['offset']+_0x153cb1[_0x6fbd('0x1b')];var _0x41d799;if(_0x5b2d71>=_0x1cfa7a){_0x5b2d71=_0x1cfa7a;_0x41d799=0xc8;}else{_0x41d799=0xce;}_0x4868e7[_0x6fbd('0x1d')](_0x41d799);return _0x4868e7['set'](_0x6fbd('0x1e'),_0xfa9016+'-'+_0x5b2d71+'/'+_0x1cfa7a)[_0x6fbd('0x1f')](_0x4aa87a);}return null;};}function patchUpdates(_0x1b82f9){return function(_0xe320af){try{jsonpatch[_0x6fbd('0x20')](_0xe320af,_0x1b82f9,!![]);}catch(_0x5d1ab9){return BPromise[_0x6fbd('0x21')](_0x5d1ab9);}return _0xe320af[_0x6fbd('0x22')]();};}function saveUpdates(_0x33d48c,_0x54bfa3){return function(_0x3202ef){if(_0x3202ef){return _0x3202ef[_0x6fbd('0x23')](_0x33d48c)[_0x6fbd('0x24')](function(_0x4dbf33){return _0x4dbf33;});}return null;};}function removeEntity(_0x50d7f5,_0x621856){return function(_0x1bd952){if(_0x1bd952){return _0x1bd952[_0x6fbd('0x25')]()['then'](function(){_0x50d7f5[_0x6fbd('0x1d')](0xcc)[_0x6fbd('0x18')]();});}};}function handleEntityNotFound(_0x4faa84,_0x47ad87){return function(_0x135ec6){if(!_0x135ec6){_0x4faa84[_0x6fbd('0x17')](0x194);}return _0x135ec6;};}function handleError(_0x38c681,_0x4168f9){_0x4168f9=_0x4168f9||0x1f4;return function(_0x437c3e){logger['error'](_0x437c3e[_0x6fbd('0x26')]);if(_0x437c3e[_0x6fbd('0x27')]){delete _0x437c3e['name'];}_0x38c681[_0x6fbd('0x1d')](_0x4168f9)[_0x6fbd('0x28')](_0x437c3e);};}exports[_0x6fbd('0x29')]=function(_0x304ef2,_0x243cc3){var _0x412ef6={},_0x409abf={},_0x1c8c26={'count':0x0,'rows':[]};var _0x55b942=_['map'](db[_0x6fbd('0x2a')]['rawAttributes'],function(_0x230562){return{'name':_0x230562[_0x6fbd('0x2b')],'type':_0x230562['type'][_0x6fbd('0x2c')]};});_0x409abf[_0x6fbd('0x2d')]=_[_0x6fbd('0x2e')](_0x55b942,_0x6fbd('0x27'));_0x409abf['query']=_['keys'](_0x304ef2[_0x6fbd('0x2f')]);_0x409abf[_0x6fbd('0x30')]=_[_0x6fbd('0x31')](_0x409abf[_0x6fbd('0x2d')],_0x409abf[_0x6fbd('0x2f')]);_0x412ef6[_0x6fbd('0x32')]=_[_0x6fbd('0x31')](_0x409abf[_0x6fbd('0x2d')],qs[_0x6fbd('0x33')](_0x304ef2['query'][_0x6fbd('0x33')]));_0x412ef6[_0x6fbd('0x32')]=_0x412ef6[_0x6fbd('0x32')][_0x6fbd('0x34')]?_0x412ef6[_0x6fbd('0x32')]:_0x409abf['model'];if(!_0x304ef2[_0x6fbd('0x2f')][_0x6fbd('0x35')]('nolimit')){_0x412ef6[_0x6fbd('0x1b')]=qs[_0x6fbd('0x1b')](_0x304ef2[_0x6fbd('0x2f')][_0x6fbd('0x1b')]);_0x412ef6[_0x6fbd('0x19')]=qs[_0x6fbd('0x19')](_0x304ef2['query'][_0x6fbd('0x19')]);}_0x412ef6[_0x6fbd('0x36')]=qs[_0x6fbd('0x37')](_0x304ef2[_0x6fbd('0x2f')][_0x6fbd('0x37')]);_0x412ef6[_0x6fbd('0x38')]=qs[_0x6fbd('0x30')](_[_0x6fbd('0x39')](_0x304ef2[_0x6fbd('0x2f')],_0x409abf[_0x6fbd('0x30')]),_0x55b942);if(_0x304ef2['query'][_0x6fbd('0x3a')]){_0x412ef6[_0x6fbd('0x38')]=_[_0x6fbd('0x3b')](_0x412ef6[_0x6fbd('0x38')],{'$or':_[_0x6fbd('0x2e')](_0x55b942,function(_0x4608e5){if(_0x4608e5[_0x6fbd('0x3c')]!=='VIRTUAL'){var _0x5c9af4={};_0x5c9af4[_0x4608e5[_0x6fbd('0x27')]]={'$like':'%'+_0x304ef2['query']['filter']+'%'};return _0x5c9af4;}})});}_0x412ef6=_[_0x6fbd('0x3b')]({},_0x412ef6,_0x304ef2[_0x6fbd('0x3d')]);var _0x4c5b43={'where':_0x412ef6[_0x6fbd('0x38')]};return db[_0x6fbd('0x2a')][_0x6fbd('0x1c')](_0x4c5b43)[_0x6fbd('0x24')](function(_0x473ec0){_0x1c8c26[_0x6fbd('0x1c')]=_0x473ec0;if(_0x304ef2['query'][_0x6fbd('0x3e')]){_0x412ef6[_0x6fbd('0x3f')]=[{'all':!![]}];}return db[_0x6fbd('0x2a')][_0x6fbd('0x40')](_0x412ef6);})[_0x6fbd('0x24')](function(_0x32bfb1){_0x1c8c26['rows']=_0x32bfb1;return _0x1c8c26;})['then'](respondWithFilteredResult(_0x243cc3,_0x412ef6))[_0x6fbd('0x41')](handleError(_0x243cc3,null));};exports[_0x6fbd('0x42')]=function(_0x253359,_0x4c713b){var _0x276995={'raw':!![],'where':{'id':_0x253359[_0x6fbd('0x43')]['id']}},_0x2dd7c4={};_0x2dd7c4[_0x6fbd('0x2d')]=_['keys'](db['MailServerOut']['rawAttributes']);_0x2dd7c4[_0x6fbd('0x2f')]=_[_0x6fbd('0x44')](_0x253359[_0x6fbd('0x2f')]);_0x2dd7c4['filters']=_['intersection'](_0x2dd7c4['model'],_0x2dd7c4['query']);_0x276995[_0x6fbd('0x32')]=_[_0x6fbd('0x31')](_0x2dd7c4[_0x6fbd('0x2d')],qs[_0x6fbd('0x33')](_0x253359[_0x6fbd('0x2f')]['fields']));_0x276995[_0x6fbd('0x32')]=_0x276995[_0x6fbd('0x32')][_0x6fbd('0x34')]?_0x276995['attributes']:_0x2dd7c4[_0x6fbd('0x2d')];if(_0x253359[_0x6fbd('0x2f')][_0x6fbd('0x3e')]){_0x276995['include']=[{'all':!![]}];}_0x276995=_[_0x6fbd('0x3b')]({},_0x276995,_0x253359[_0x6fbd('0x3d')]);return db[_0x6fbd('0x2a')][_0x6fbd('0x45')](_0x276995)[_0x6fbd('0x24')](handleEntityNotFound(_0x4c713b,null))[_0x6fbd('0x24')](respondWithResult(_0x4c713b,null))[_0x6fbd('0x41')](handleError(_0x4c713b,null));};exports[_0x6fbd('0x46')]=function(_0x2802d6,_0x3eb669){return db[_0x6fbd('0x2a')][_0x6fbd('0x46')](_0x2802d6[_0x6fbd('0x47')],{})[_0x6fbd('0x24')](respondWithResult(_0x3eb669,0xc9))[_0x6fbd('0x41')](handleError(_0x3eb669,null));};exports[_0x6fbd('0x23')]=function(_0x1b8157,_0x412456){if(_0x1b8157[_0x6fbd('0x47')]['id']){delete _0x1b8157[_0x6fbd('0x47')]['id'];}return db[_0x6fbd('0x2a')][_0x6fbd('0x45')]({'where':{'id':_0x1b8157[_0x6fbd('0x43')]['id']}})[_0x6fbd('0x24')](handleEntityNotFound(_0x412456,null))[_0x6fbd('0x24')](saveUpdates(_0x1b8157[_0x6fbd('0x47')],null))[_0x6fbd('0x24')](respondWithResult(_0x412456,null))[_0x6fbd('0x41')](handleError(_0x412456,null));};exports[_0x6fbd('0x25')]=function(_0xe081fb,_0x350187){return db[_0x6fbd('0x2a')][_0x6fbd('0x45')]({'where':{'id':_0xe081fb[_0x6fbd('0x43')]['id']}})['then'](handleEntityNotFound(_0x350187,null))['then'](removeEntity(_0x350187,null))['catch'](handleError(_0x350187,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 76a1d3e..e8119c5 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 _0x4747=['api','moment','path','rimraf','../../config/environment','exports','define','util','../../config/logger'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x4747,0xbb));var _0x7474=function(_0x34e14d,_0x5dea39){_0x34e14d=_0x34e14d-0x0;var _0x3d8e08=_0x4747[_0x34e14d];return _0x3d8e08;};'use strict';var _=require('lodash');var util=require(_0x7474('0x0'));var logger=require(_0x7474('0x1'))(_0x7474('0x2'));var moment=require(_0x7474('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7474('0x4'));var rimraf=require(_0x7474('0x5'));var config=require(_0x7474('0x6'));var attributes=require('./mailServerOut.attributes');module[_0x7474('0x7')]=function(_0x2ecb29,_0x1d301b){return _0x2ecb29[_0x7474('0x8')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe64b=['exports','MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xe64b,0x1f1));var _0xbe64=function(_0x4a5111,_0x212e4c){_0x4a5111=_0x4a5111-0x0;var _0x36288a=_0xe64b[_0x4a5111];return _0x36288a;};'use strict';var _=require(_0xbe64('0x0'));var util=require(_0xbe64('0x1'));var logger=require(_0xbe64('0x2'))('api');var moment=require(_0xbe64('0x3'));var BPromise=require(_0xbe64('0x4'));var rp=require(_0xbe64('0x5'));var fs=require('fs');var path=require(_0xbe64('0x6'));var rimraf=require(_0xbe64('0x7'));var config=require(_0xbe64('0x8'));var attributes=require(_0xbe64('0x9'));module[_0xbe64('0xa')]=function(_0x4bb437,_0x5981e3){return _0x4bb437['define'](_0xbe64('0xb'),attributes,{'tableName':_0xbe64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 3a9adc1..4868445 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 _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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x3cd6a8,_0x56fe29){_0x3cd6a8=_0x3cd6a8-0x0;var _0x1c1af8=_0x7a54[_0x3cd6a8];return _0x1c1af8;};'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 +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x58e2d2,_0x4ff59b){var _0x249768=function(_0x1c9e31){while(--_0x1c9e31){_0x58e2d2['push'](_0x58e2d2['shift']());}};_0x249768(++_0x4ff59b);}(_0x2ef3,0xba));var _0x32ef=function(_0x1fe17f,_0x538617){_0x1fe17f=_0x1fe17f-0x0;var _0x24f345=_0x2ef3[_0x1fe17f];return _0x24f345;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index f8350a3..2e758aa 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 _0x1139=['show','post','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x459504,_0x389912){var _0x2de324=function(_0x3e624a){while(--_0x3e624a){_0x459504['push'](_0x459504['shift']());}};_0x2de324(++_0x389912);}(_0x1139,0x10a));var _0x9113=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1139[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x9113('0x0'));var util=require(_0x9113('0x1'));var path=require('path');var timeout=require(_0x9113('0x2'));var express=require(_0x9113('0x3'));var router=express[_0x9113('0x4')]();var fs_extra=require(_0x9113('0x5'));var auth=require(_0x9113('0x6'));var interaction=require(_0x9113('0x7'));var config=require('../../config/environment');var controller=require(_0x9113('0x8'));router[_0x9113('0x9')]('/',auth[_0x9113('0xa')](),controller['index']);router[_0x9113('0x9')](_0x9113('0xb'),auth[_0x9113('0xa')](),controller[_0x9113('0xc')]);router[_0x9113('0x9')](_0x9113('0xd'),auth[_0x9113('0xa')](),controller[_0x9113('0xe')]);router[_0x9113('0xf')]('/',auth[_0x9113('0xa')](),controller['create']);router[_0x9113('0x10')](_0x9113('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x9113('0x11')]('/:id',auth[_0x9113('0xa')](),controller[_0x9113('0x12')]);module[_0x9113('0x13')]=router; \ No newline at end of file +var _0xecec=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','/:id','show','post','put','update','exports','multer'];(function(_0x23b106,_0x50acec){var _0x3c88e5=function(_0x1fcb42){while(--_0x1fcb42){_0x23b106['push'](_0x23b106['shift']());}};_0x3c88e5(++_0x50acec);}(_0xecec,0xcb));var _0xcece=function(_0x57118c,_0x29667d){_0x57118c=_0x57118c-0x0;var _0x170ed0=_0xecec[_0x57118c];return _0x170ed0;};'use strict';var multer=require(_0xcece('0x0'));var util=require(_0xcece('0x1'));var path=require('path');var timeout=require(_0xcece('0x2'));var express=require(_0xcece('0x3'));var router=express['Router']();var fs_extra=require(_0xcece('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcece('0x5'));var config=require(_0xcece('0x6'));var controller=require(_0xcece('0x7'));router[_0xcece('0x8')]('/',auth[_0xcece('0x9')](),controller['index']);router[_0xcece('0x8')](_0xcece('0xa'),auth[_0xcece('0x9')](),controller['describe']);router[_0xcece('0x8')](_0xcece('0xb'),auth['isAuthenticated'](),controller[_0xcece('0xc')]);router[_0xcece('0xd')]('/',auth[_0xcece('0x9')](),controller['create']);router[_0xcece('0xe')]('/:id',auth[_0xcece('0x9')](),controller[_0xcece('0xf')]);router['delete'](_0xcece('0xb'),auth[_0xcece('0x9')](),controller['destroy']);module[_0xcece('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 0566e98..2725b16 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 _0x6ec2=['sequelize','exports','STRING','name'];(function(_0x628b67,_0x55b903){var _0x1dc1c6=function(_0x2a2548){while(--_0x2a2548){_0x628b67['push'](_0x628b67['shift']());}};_0x1dc1c6(++_0x55b903);}(_0x6ec2,0x78));var _0x26ec=function(_0x5bf037,_0x12fc42){_0x5bf037=_0x5bf037-0x0;var _0x50e4bc=_0x6ec2[_0x5bf037];return _0x50e4bc;};'use strict';var Sequelize=require(_0x26ec('0x0'));module[_0x26ec('0x1')]={'name':{'type':Sequelize[_0x26ec('0x2')],'unique':_0x26ec('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x26ec('0x2')]}}; \ No newline at end of file +var _0xe14b=['sequelize','exports','STRING'];(function(_0x2a9e7a,_0x2bec82){var _0x22b2d2=function(_0x5a8277){while(--_0x5a8277){_0x2a9e7a['push'](_0x2a9e7a['shift']());}};_0x22b2d2(++_0x2bec82);}(_0xe14b,0x93));var _0xbe14=function(_0x1529a3,_0x529f63){_0x1529a3=_0x1529a3-0x0;var _0x1a0d4b=_0xe14b[_0x1529a3];return _0x1a0d4b;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbe14('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index cfb0213..7b54194 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 _0xabaf=['body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','catch','create'];(function(_0x143cc6,_0xf94536){var _0x2cedba=function(_0x15a2ad){while(--_0x15a2ad){_0x143cc6['push'](_0x143cc6['shift']());}};_0x2cedba(++_0xf94536);}(_0xabaf,0xa0));var _0xfaba=function(_0x22f8aa,_0x123ece){_0x22f8aa=_0x22f8aa-0x0;var _0x26d60b=_0xabaf[_0x22f8aa];return _0x26d60b;};'use strict';var emlformat=require(_0xfaba('0x0'));var rimraf=require(_0xfaba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfaba('0x2'));var moment=require(_0xfaba('0x3'));var BPromise=require(_0xfaba('0x4'));var Mustache=require(_0xfaba('0x5'));var util=require(_0xfaba('0x6'));var path=require(_0xfaba('0x7'));var sox=require(_0xfaba('0x8'));var csv=require('to-csv');var ejs=require(_0xfaba('0x9'));var fs=require('fs');var fs_extra=require(_0xfaba('0xa'));var _=require('lodash');var squel=require(_0xfaba('0xb'));var crypto=require(_0xfaba('0xc'));var jsforce=require(_0xfaba('0xd'));var deskjs=require(_0xfaba('0xe'));var toCsv=require(_0xfaba('0xf'));var querystring=require(_0xfaba('0x10'));var Papa=require(_0xfaba('0x11'));var Redis=require(_0xfaba('0x12'));var authService=require(_0xfaba('0x13'));var qs=require(_0xfaba('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfaba('0x15'));var logger=require(_0xfaba('0x16'))('api');var utils=require(_0xfaba('0x17'));var config=require(_0xfaba('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfaba('0x19'))['db'];function respondWithStatusCode(_0x245e7b,_0x9e7684){_0x9e7684=_0x9e7684||0xcc;return function(_0x482636){if(_0x482636){return _0x245e7b['sendStatus'](_0x9e7684);}return _0x245e7b['status'](_0x9e7684)[_0xfaba('0x1a')]();};}function respondWithResult(_0x13593c,_0x361a5c){_0x361a5c=_0x361a5c||0xc8;return function(_0x3efc82){if(_0x3efc82){return _0x13593c[_0xfaba('0x1b')](_0x361a5c)['json'](_0x3efc82);}};}function respondWithFilteredResult(_0x5e1587,_0x2a8baa){return function(_0x30e098){if(_0x30e098){var _0x2c9881=typeof _0x2a8baa[_0xfaba('0x1c')]===_0xfaba('0x1d')&&typeof _0x2a8baa[_0xfaba('0x1e')]===_0xfaba('0x1d');var _0x1ab365=_0x30e098['count'];var _0x3d3013=_0x2c9881?0x0:_0x2a8baa[_0xfaba('0x1c')];var _0x1ec393=_0x2c9881?_0x30e098['count']:_0x2a8baa['offset']+_0x2a8baa[_0xfaba('0x1e')];var _0x41a2ec;if(_0x1ec393>=_0x1ab365){_0x1ec393=_0x1ab365;_0x41a2ec=0xc8;}else{_0x41a2ec=0xce;}_0x5e1587[_0xfaba('0x1b')](_0x41a2ec);return _0x5e1587[_0xfaba('0x1f')]('Content-Range',_0x3d3013+'-'+_0x1ec393+'/'+_0x1ab365)[_0xfaba('0x20')](_0x30e098);}return null;};}function patchUpdates(_0x47834b){return function(_0x11c34d){try{jsonpatch[_0xfaba('0x21')](_0x11c34d,_0x47834b,!![]);}catch(_0x155169){return BPromise[_0xfaba('0x22')](_0x155169);}return _0x11c34d[_0xfaba('0x23')]();};}function saveUpdates(_0x3bc2be,_0x167dd0){return function(_0x40a64f){if(_0x40a64f){return _0x40a64f[_0xfaba('0x24')](_0x3bc2be)[_0xfaba('0x25')](function(_0x5dcc66){return _0x5dcc66;});}return null;};}function removeEntity(_0x4fb539,_0x6c2e9d){return function(_0x5040ee){if(_0x5040ee){return _0x5040ee[_0xfaba('0x26')]()['then'](function(){_0x4fb539['status'](0xcc)[_0xfaba('0x1a')]();});}};}function handleEntityNotFound(_0x309cce,_0x4fef24){return function(_0x300785){if(!_0x300785){_0x309cce[_0xfaba('0x27')](0x194);}return _0x300785;};}function handleError(_0x55860c,_0x5cf8bc){_0x5cf8bc=_0x5cf8bc||0x1f4;return function(_0x5ef814){logger['error'](_0x5ef814[_0xfaba('0x28')]);if(_0x5ef814[_0xfaba('0x29')]){delete _0x5ef814['name'];}_0x55860c[_0xfaba('0x1b')](_0x5cf8bc)[_0xfaba('0x2a')](_0x5ef814);};}exports[_0xfaba('0x2b')]=function(_0x411031,_0x3fdc68){var _0x5efd5b={},_0x285b1f={},_0x5348c8={'count':0x0,'rows':[]};var _0x4a6e35=_['map'](db[_0xfaba('0x2c')][_0xfaba('0x2d')],function(_0x3f23ff){return{'name':_0x3f23ff[_0xfaba('0x2e')],'type':_0x3f23ff[_0xfaba('0x2f')][_0xfaba('0x30')]};});_0x285b1f[_0xfaba('0x31')]=_['map'](_0x4a6e35,_0xfaba('0x29'));_0x285b1f[_0xfaba('0x32')]=_[_0xfaba('0x33')](_0x411031[_0xfaba('0x32')]);_0x285b1f[_0xfaba('0x34')]=_[_0xfaba('0x35')](_0x285b1f[_0xfaba('0x31')],_0x285b1f['query']);_0x5efd5b[_0xfaba('0x36')]=_[_0xfaba('0x35')](_0x285b1f[_0xfaba('0x31')],qs[_0xfaba('0x37')](_0x411031[_0xfaba('0x32')]['fields']));_0x5efd5b[_0xfaba('0x36')]=_0x5efd5b[_0xfaba('0x36')][_0xfaba('0x38')]?_0x5efd5b[_0xfaba('0x36')]:_0x285b1f['model'];if(!_0x411031['query'][_0xfaba('0x39')](_0xfaba('0x3a'))){_0x5efd5b[_0xfaba('0x1e')]=qs[_0xfaba('0x1e')](_0x411031[_0xfaba('0x32')][_0xfaba('0x1e')]);_0x5efd5b[_0xfaba('0x1c')]=qs['offset'](_0x411031[_0xfaba('0x32')][_0xfaba('0x1c')]);}_0x5efd5b[_0xfaba('0x3b')]=qs[_0xfaba('0x3c')](_0x411031[_0xfaba('0x32')][_0xfaba('0x3c')]);_0x5efd5b[_0xfaba('0x3d')]=qs['filters'](_['pick'](_0x411031[_0xfaba('0x32')],_0x285b1f[_0xfaba('0x34')]),_0x4a6e35);if(_0x411031[_0xfaba('0x32')][_0xfaba('0x3e')]){_0x5efd5b['where']=_[_0xfaba('0x3f')](_0x5efd5b['where'],{'$or':_[_0xfaba('0x40')](_0x4a6e35,function(_0x1a735b){if(_0x1a735b['type']!==_0xfaba('0x41')){var _0xfb116d={};_0xfb116d[_0x1a735b[_0xfaba('0x29')]]={'$like':'%'+_0x411031[_0xfaba('0x32')][_0xfaba('0x3e')]+'%'};return _0xfb116d;}})});}_0x5efd5b=_[_0xfaba('0x3f')]({},_0x5efd5b,_0x411031[_0xfaba('0x42')]);var _0x5bfe8a={'where':_0x5efd5b[_0xfaba('0x3d')]};return db['MailSubstatus'][_0xfaba('0x43')](_0x5bfe8a)['then'](function(_0x204847){_0x5348c8[_0xfaba('0x43')]=_0x204847;if(_0x411031['query'][_0xfaba('0x44')]){_0x5efd5b[_0xfaba('0x45')]=[{'all':!![]}];}return db['MailSubstatus'][_0xfaba('0x46')](_0x5efd5b);})[_0xfaba('0x25')](function(_0x1536b5){_0x5348c8[_0xfaba('0x47')]=_0x1536b5;return _0x5348c8;})[_0xfaba('0x25')](respondWithFilteredResult(_0x3fdc68,_0x5efd5b))['catch'](handleError(_0x3fdc68,null));};exports[_0xfaba('0x48')]=function(_0x35a219,_0x703711){var _0x21f9f8={'raw':!![],'where':{'id':_0x35a219[_0xfaba('0x49')]['id']}},_0x3bb887={};_0x3bb887[_0xfaba('0x31')]=_[_0xfaba('0x33')](db[_0xfaba('0x2c')][_0xfaba('0x2d')]);_0x3bb887[_0xfaba('0x32')]=_[_0xfaba('0x33')](_0x35a219[_0xfaba('0x32')]);_0x3bb887[_0xfaba('0x34')]=_[_0xfaba('0x35')](_0x3bb887[_0xfaba('0x31')],_0x3bb887[_0xfaba('0x32')]);_0x21f9f8['attributes']=_['intersection'](_0x3bb887[_0xfaba('0x31')],qs['fields'](_0x35a219['query'][_0xfaba('0x37')]));_0x21f9f8[_0xfaba('0x36')]=_0x21f9f8[_0xfaba('0x36')][_0xfaba('0x38')]?_0x21f9f8[_0xfaba('0x36')]:_0x3bb887[_0xfaba('0x31')];if(_0x35a219[_0xfaba('0x32')]['includeAll']){_0x21f9f8[_0xfaba('0x45')]=[{'all':!![]}];}_0x21f9f8=_[_0xfaba('0x3f')]({},_0x21f9f8,_0x35a219[_0xfaba('0x42')]);return db[_0xfaba('0x2c')][_0xfaba('0x4a')](_0x21f9f8)[_0xfaba('0x25')](handleEntityNotFound(_0x703711,null))[_0xfaba('0x25')](respondWithResult(_0x703711,null))[_0xfaba('0x4b')](handleError(_0x703711,null));};exports[_0xfaba('0x4c')]=function(_0x58cc2e,_0x529ee2){return db[_0xfaba('0x2c')][_0xfaba('0x4c')](_0x58cc2e['body'],{})[_0xfaba('0x25')](respondWithResult(_0x529ee2,0xc9))[_0xfaba('0x4b')](handleError(_0x529ee2,null));};exports[_0xfaba('0x24')]=function(_0x1167f5,_0x232129){if(_0x1167f5[_0xfaba('0x4d')]['id']){delete _0x1167f5[_0xfaba('0x4d')]['id'];}return db[_0xfaba('0x2c')][_0xfaba('0x4a')]({'where':{'id':_0x1167f5[_0xfaba('0x49')]['id']}})[_0xfaba('0x25')](handleEntityNotFound(_0x232129,null))[_0xfaba('0x25')](saveUpdates(_0x1167f5[_0xfaba('0x4d')],null))[_0xfaba('0x25')](respondWithResult(_0x232129,null))[_0xfaba('0x4b')](handleError(_0x232129,null));};exports[_0xfaba('0x26')]=function(_0x2fe78b,_0x57c0b3){return db[_0xfaba('0x2c')][_0xfaba('0x4a')]({'where':{'id':_0x2fe78b[_0xfaba('0x49')]['id']}})[_0xfaba('0x25')](handleEntityNotFound(_0x57c0b3,null))[_0xfaba('0x25')](removeEntity(_0x57c0b3,null))['catch'](handleError(_0x57c0b3,null));};exports['describe']=function(_0x567769,_0x14962c){return db[_0xfaba('0x2c')][_0xfaba('0x4e')]()[_0xfaba('0x25')](respondWithResult(_0x14962c,null))['catch'](handleError(_0x14962c,null));}; \ No newline at end of file +var _0xd3fd=['squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','sendStatus','error','stack','name','send','map','MailSubstatus','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','then','includeAll','findAll','catch','show','keys','rawAttributes','include','find','create','body','params','describe','eml-format','zip-dir','request-promise','util','sox','to-csv','lodash'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd3fd,0x197));var _0xdd3f=function(_0x4a3ca3,_0x517755){_0x4a3ca3=_0x4a3ca3-0x0;var _0x6c4b58=_0xd3fd[_0x4a3ca3];return _0x6c4b58;};'use strict';var emlformat=require(_0xdd3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd3f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd3f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdd3f('0x3'));var path=require('path');var sox=require(_0xdd3f('0x4'));var csv=require(_0xdd3f('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd3f('0x6'));var squel=require(_0xdd3f('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdd3f('0x8'));var toCsv=require(_0xdd3f('0x5'));var querystring=require(_0xdd3f('0x9'));var Papa=require(_0xdd3f('0xa'));var Redis=require(_0xdd3f('0xb'));var authService=require(_0xdd3f('0xc'));var qs=require(_0xdd3f('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd3f('0xe'));var logger=require('../../config/logger')(_0xdd3f('0xf'));var utils=require('../../config/utils');var config=require(_0xdd3f('0x10'));var licenseUtil=require(_0xdd3f('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f6dfe,_0x8c64f6){_0x8c64f6=_0x8c64f6||0xcc;return function(_0x5eb91f){if(_0x5eb91f){return _0x1f6dfe['sendStatus'](_0x8c64f6);}return _0x1f6dfe['status'](_0x8c64f6)[_0xdd3f('0x12')]();};}function respondWithResult(_0x30b626,_0x30ad09){_0x30ad09=_0x30ad09||0xc8;return function(_0x495060){if(_0x495060){return _0x30b626[_0xdd3f('0x13')](_0x30ad09)[_0xdd3f('0x14')](_0x495060);}};}function respondWithFilteredResult(_0x57b64e,_0x3a04cc){return function(_0x2709fb){if(_0x2709fb){var _0x4c348f=typeof _0x3a04cc[_0xdd3f('0x15')]===_0xdd3f('0x16')&&typeof _0x3a04cc[_0xdd3f('0x17')]===_0xdd3f('0x16');var _0x18d6e9=_0x2709fb[_0xdd3f('0x18')];var _0x3cb97c=_0x4c348f?0x0:_0x3a04cc[_0xdd3f('0x15')];var _0x5527d7=_0x4c348f?_0x2709fb[_0xdd3f('0x18')]:_0x3a04cc[_0xdd3f('0x15')]+_0x3a04cc[_0xdd3f('0x17')];var _0xfb03a;if(_0x5527d7>=_0x18d6e9){_0x5527d7=_0x18d6e9;_0xfb03a=0xc8;}else{_0xfb03a=0xce;}_0x57b64e[_0xdd3f('0x13')](_0xfb03a);return _0x57b64e[_0xdd3f('0x19')](_0xdd3f('0x1a'),_0x3cb97c+'-'+_0x5527d7+'/'+_0x18d6e9)['json'](_0x2709fb);}return null;};}function patchUpdates(_0x214187){return function(_0x32c489){try{jsonpatch[_0xdd3f('0x1b')](_0x32c489,_0x214187,!![]);}catch(_0x576b7b){return BPromise['reject'](_0x576b7b);}return _0x32c489[_0xdd3f('0x1c')]();};}function saveUpdates(_0x36a302,_0x10438f){return function(_0x3afa54){if(_0x3afa54){return _0x3afa54[_0xdd3f('0x1d')](_0x36a302)['then'](function(_0x1f724f){return _0x1f724f;});}return null;};}function removeEntity(_0x364a23,_0x1266c4){return function(_0x5dceb2){if(_0x5dceb2){return _0x5dceb2[_0xdd3f('0x1e')]()['then'](function(){_0x364a23[_0xdd3f('0x13')](0xcc)[_0xdd3f('0x12')]();});}};}function handleEntityNotFound(_0x43c4ac,_0x1169a3){return function(_0x38332a){if(!_0x38332a){_0x43c4ac[_0xdd3f('0x1f')](0x194);}return _0x38332a;};}function handleError(_0x28be73,_0x552159){_0x552159=_0x552159||0x1f4;return function(_0x460921){logger[_0xdd3f('0x20')](_0x460921[_0xdd3f('0x21')]);if(_0x460921[_0xdd3f('0x22')]){delete _0x460921[_0xdd3f('0x22')];}_0x28be73[_0xdd3f('0x13')](_0x552159)[_0xdd3f('0x23')](_0x460921);};}exports['index']=function(_0x1c9e43,_0x115a98){var _0x1061de={},_0x3a49d4={},_0x208442={'count':0x0,'rows':[]};var _0xdd763e=_[_0xdd3f('0x24')](db[_0xdd3f('0x25')]['rawAttributes'],function(_0x34c09c){return{'name':_0x34c09c[_0xdd3f('0x26')],'type':_0x34c09c['type']['key']};});_0x3a49d4[_0xdd3f('0x27')]=_[_0xdd3f('0x24')](_0xdd763e,_0xdd3f('0x22'));_0x3a49d4[_0xdd3f('0x28')]=_['keys'](_0x1c9e43[_0xdd3f('0x28')]);_0x3a49d4['filters']=_[_0xdd3f('0x29')](_0x3a49d4['model'],_0x3a49d4[_0xdd3f('0x28')]);_0x1061de[_0xdd3f('0x2a')]=_[_0xdd3f('0x29')](_0x3a49d4[_0xdd3f('0x27')],qs[_0xdd3f('0x2b')](_0x1c9e43[_0xdd3f('0x28')]['fields']));_0x1061de[_0xdd3f('0x2a')]=_0x1061de[_0xdd3f('0x2a')][_0xdd3f('0x2c')]?_0x1061de[_0xdd3f('0x2a')]:_0x3a49d4['model'];if(!_0x1c9e43[_0xdd3f('0x28')][_0xdd3f('0x2d')](_0xdd3f('0x2e'))){_0x1061de['limit']=qs[_0xdd3f('0x17')](_0x1c9e43['query'][_0xdd3f('0x17')]);_0x1061de['offset']=qs[_0xdd3f('0x15')](_0x1c9e43[_0xdd3f('0x28')]['offset']);}_0x1061de[_0xdd3f('0x2f')]=qs[_0xdd3f('0x30')](_0x1c9e43[_0xdd3f('0x28')]['sort']);_0x1061de[_0xdd3f('0x31')]=qs[_0xdd3f('0x32')](_[_0xdd3f('0x33')](_0x1c9e43[_0xdd3f('0x28')],_0x3a49d4[_0xdd3f('0x32')]),_0xdd763e);if(_0x1c9e43[_0xdd3f('0x28')][_0xdd3f('0x34')]){_0x1061de[_0xdd3f('0x31')]=_[_0xdd3f('0x35')](_0x1061de['where'],{'$or':_['map'](_0xdd763e,function(_0x439b3f){if(_0x439b3f[_0xdd3f('0x36')]!=='VIRTUAL'){var _0x52077d={};_0x52077d[_0x439b3f[_0xdd3f('0x22')]]={'$like':'%'+_0x1c9e43[_0xdd3f('0x28')][_0xdd3f('0x34')]+'%'};return _0x52077d;}})});}_0x1061de=_[_0xdd3f('0x35')]({},_0x1061de,_0x1c9e43[_0xdd3f('0x37')]);var _0xdbb699={'where':_0x1061de[_0xdd3f('0x31')]};return db[_0xdd3f('0x25')][_0xdd3f('0x18')](_0xdbb699)[_0xdd3f('0x38')](function(_0x1010d0){_0x208442['count']=_0x1010d0;if(_0x1c9e43[_0xdd3f('0x28')][_0xdd3f('0x39')]){_0x1061de['include']=[{'all':!![]}];}return db[_0xdd3f('0x25')][_0xdd3f('0x3a')](_0x1061de);})[_0xdd3f('0x38')](function(_0x12c927){_0x208442['rows']=_0x12c927;return _0x208442;})[_0xdd3f('0x38')](respondWithFilteredResult(_0x115a98,_0x1061de))[_0xdd3f('0x3b')](handleError(_0x115a98,null));};exports[_0xdd3f('0x3c')]=function(_0x11ed71,_0x33b1dd){var _0x1b65e1={'raw':!![],'where':{'id':_0x11ed71['params']['id']}},_0xd4e0e={};_0xd4e0e['model']=_[_0xdd3f('0x3d')](db['MailSubstatus'][_0xdd3f('0x3e')]);_0xd4e0e[_0xdd3f('0x28')]=_[_0xdd3f('0x3d')](_0x11ed71[_0xdd3f('0x28')]);_0xd4e0e[_0xdd3f('0x32')]=_[_0xdd3f('0x29')](_0xd4e0e[_0xdd3f('0x27')],_0xd4e0e[_0xdd3f('0x28')]);_0x1b65e1[_0xdd3f('0x2a')]=_['intersection'](_0xd4e0e[_0xdd3f('0x27')],qs[_0xdd3f('0x2b')](_0x11ed71['query']['fields']));_0x1b65e1['attributes']=_0x1b65e1['attributes'][_0xdd3f('0x2c')]?_0x1b65e1[_0xdd3f('0x2a')]:_0xd4e0e['model'];if(_0x11ed71[_0xdd3f('0x28')][_0xdd3f('0x39')]){_0x1b65e1[_0xdd3f('0x3f')]=[{'all':!![]}];}_0x1b65e1=_[_0xdd3f('0x35')]({},_0x1b65e1,_0x11ed71[_0xdd3f('0x37')]);return db[_0xdd3f('0x25')][_0xdd3f('0x40')](_0x1b65e1)['then'](handleEntityNotFound(_0x33b1dd,null))['then'](respondWithResult(_0x33b1dd,null))['catch'](handleError(_0x33b1dd,null));};exports[_0xdd3f('0x41')]=function(_0x3591c2,_0x344522){return db[_0xdd3f('0x25')]['create'](_0x3591c2['body'],{})[_0xdd3f('0x38')](respondWithResult(_0x344522,0xc9))['catch'](handleError(_0x344522,null));};exports[_0xdd3f('0x1d')]=function(_0x41f844,_0x11ac14){if(_0x41f844[_0xdd3f('0x42')]['id']){delete _0x41f844[_0xdd3f('0x42')]['id'];}return db[_0xdd3f('0x25')]['find']({'where':{'id':_0x41f844[_0xdd3f('0x43')]['id']}})[_0xdd3f('0x38')](handleEntityNotFound(_0x11ac14,null))['then'](saveUpdates(_0x41f844['body'],null))[_0xdd3f('0x38')](respondWithResult(_0x11ac14,null))[_0xdd3f('0x3b')](handleError(_0x11ac14,null));};exports['destroy']=function(_0x3cf3b6,_0x462efd){return db['MailSubstatus']['find']({'where':{'id':_0x3cf3b6[_0xdd3f('0x43')]['id']}})[_0xdd3f('0x38')](handleEntityNotFound(_0x462efd,null))[_0xdd3f('0x38')](removeEntity(_0x462efd,null))[_0xdd3f('0x3b')](handleError(_0x462efd,null));};exports[_0xdd3f('0x44')]=function(_0xe401e1,_0xd7ba2c){return db[_0xdd3f('0x25')][_0xdd3f('0x44')]()['then'](respondWithResult(_0xd7ba2c,null))[_0xdd3f('0x3b')](handleError(_0xd7ba2c,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 668be2c..473e041 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 _0x2009=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailSubstatus','setMaxListeners','update'];(function(_0x5f0f89,_0x1fc5cc){var _0x541945=function(_0x26ea1d){while(--_0x26ea1d){_0x5f0f89['push'](_0x5f0f89['shift']());}};_0x541945(++_0x1fc5cc);}(_0x2009,0x104));var _0x9200=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2009[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x9200('0x0'))['db'][_0x9200('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x9200('0x2')](0x0);var events={'afterUpdate':_0x9200('0x3')};function emitEvent(_0x1ef8c4){return function(_0x1c5180,_0x255732,_0x996972){MailSubstatusEvents['emit'](_0x1ef8c4+':'+_0x1c5180['id'],_0x1c5180);MailSubstatusEvents[_0x9200('0x4')](_0x1ef8c4,_0x1c5180);_0x996972(null);};}for(var e in events){if(events[_0x9200('0x5')](e)){var event=events[e];MailSubstatus[_0x9200('0x6')](e,emitEvent(event));}}module[_0x9200('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x9f17=['../../mysqldb','MailSubstatus','setMaxListeners','emit','hasOwnProperty','hook','events'];(function(_0x1531c3,_0x1800da){var _0x6cb6f9=function(_0x43853d){while(--_0x43853d){_0x1531c3['push'](_0x1531c3['shift']());}};_0x6cb6f9(++_0x1800da);}(_0x9f17,0x8b));var _0x79f1=function(_0x3052f4,_0x4275bb){_0x3052f4=_0x3052f4-0x0;var _0x856a28=_0x9f17[_0x3052f4];return _0x856a28;};'use strict';var EventEmitter=require(_0x79f1('0x0'));var MailSubstatus=require(_0x79f1('0x1'))['db'][_0x79f1('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x79f1('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x51410e){return function(_0xe3b0e8,_0x18b849,_0x225257){MailSubstatusEvents[_0x79f1('0x4')](_0x51410e+':'+_0xe3b0e8['id'],_0xe3b0e8);MailSubstatusEvents[_0x79f1('0x4')](_0x51410e,_0xe3b0e8);_0x225257(null);};}for(var e in events){if(events[_0x79f1('0x5')](e)){var event=events[e];MailSubstatus[_0x79f1('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 5a86eef..50e9e94 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 _0x8d30=['mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x8d30,0x7d));var _0x08d3=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x8d30[_0x9d14e3];return _0x19bf32;};'use strict';var attributes=require(_0x08d3('0x0'));module[_0x08d3('0x1')]=function(_0x4991ad){var _0x59c1f3=_0x4991ad[_0x08d3('0x2')];return _0x4991ad[_0x08d3('0x3')](_0x08d3('0x4'),attributes,{'tableName':_0x08d3('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4d678c,_0x4ca99b,_0x334efc){return _0x59c1f3[_0x08d3('0x6')][_0x08d3('0x7')]({'value':_0x4d678c[_0x08d3('0x8')]},{'where':{'field':_0x08d3('0x9'),'value':_0x4d678c[_0x08d3('0xa')][_0x08d3('0x8')]}})[_0x08d3('0xb')](function(){_0x334efc();})[_0x08d3('0xc')](function(_0x573bcf){_0x334efc(_0x573bcf);});}}});}; \ No newline at end of file +var _0x762e=['_previousDataValues','name','then','catch','./mailSubstatus.attributes','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus'];(function(_0x405bdd,_0x528ae7){var _0xc8c066=function(_0x16ab06){while(--_0x16ab06){_0x405bdd['push'](_0x405bdd['shift']());}};_0xc8c066(++_0x528ae7);}(_0x762e,0xea));var _0xe762=function(_0x3737e6,_0x5b2de3){_0x3737e6=_0x3737e6-0x0;var _0x589409=_0x762e[_0x3737e6];return _0x589409;};'use strict';var attributes=require(_0xe762('0x0'));module['exports']=function(_0x4f2cab){var _0x107dda=_0x4f2cab['models'];return _0x4f2cab['define'](_0xe762('0x1'),attributes,{'tableName':_0xe762('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2a390a,_0x59723c,_0xe78ccf){return _0x107dda[_0xe762('0x3')][_0xe762('0x4')]({'value':_0x2a390a['name']},{'where':{'field':_0xe762('0x5'),'value':_0x2a390a[_0xe762('0x6')][_0xe762('0x7')]}})[_0xe762('0x8')](function(){_0xe78ccf();})[_0xe762('0x9')](function(_0x38aac7){_0xe78ccf(_0x38aac7);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 9a7c3d8..db7df17 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 _0x40cb=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x28bfcd,_0x5b8a9c){var _0x454264=function(_0x1b3c6d){while(--_0x1b3c6d){_0x28bfcd['push'](_0x28bfcd['shift']());}};_0x454264(++_0x5b8a9c);}(_0x40cb,0x108));var _0xb40c=function(_0x88b125,_0x41c328){_0x88b125=_0x88b125-0x0;var _0x5d6b7b=_0x40cb[_0x88b125];return _0x5d6b7b;};'use strict';var _=require(_0xb40c('0x0'));var util=require(_0xb40c('0x1'));var moment=require(_0xb40c('0x2'));var BPromise=require(_0xb40c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb40c('0x4'));var db=require(_0xb40c('0x5'))['db'];var utils=require(_0xb40c('0x6'));var logger=require(_0xb40c('0x7'))('rpc');var config=require(_0xb40c('0x8'));var jayson=require(_0xb40c('0x9'));var client=jayson['client'][_0xb40c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb9fba5,_0x198379,_0x3f0e0e){return new BPromise(function(_0x345f54,_0x389402){return client[_0xb40c('0xb')](_0xb9fba5,_0x3f0e0e)['then'](function(_0x9e3634){logger['info'](_0xb40c('0xc'),_0x198379,_0xb40c('0xd'));logger[_0xb40c('0xe')](_0xb40c('0xf'),_0x198379,_0xb40c('0xd'),JSON[_0xb40c('0x10')](_0x9e3634));if(_0x9e3634[_0xb40c('0x11')]){if(_0x9e3634[_0xb40c('0x11')]['code']===0x1f4){logger[_0xb40c('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x198379,_0x9e3634['error'][_0xb40c('0x12')]);return _0x389402(_0x9e3634[_0xb40c('0x11')]['message']);}logger[_0xb40c('0x11')](_0xb40c('0xc'),_0x198379,_0x9e3634[_0xb40c('0x11')][_0xb40c('0x12')]);return _0x345f54(_0x9e3634[_0xb40c('0x11')]['message']);}else{logger[_0xb40c('0x13')](_0xb40c('0xc'),_0x198379,_0xb40c('0xd'));_0x345f54(_0x9e3634[_0xb40c('0x14')][_0xb40c('0x12')]);}})[_0xb40c('0x15')](function(_0x43c4e6){logger[_0xb40c('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x198379,_0x43c4e6);_0x389402(_0x43c4e6);});});} \ No newline at end of file +var _0xfb30=['util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x101583,_0x29f7c5){var _0x5428dc=function(_0x13c005){while(--_0x13c005){_0x101583['push'](_0x101583['shift']());}};_0x5428dc(++_0x29f7c5);}(_0xfb30,0x167));var _0x0fb3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfb30[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0fb3('0x0'));var util=require(_0x0fb3('0x1'));var moment=require('moment');var BPromise=require(_0x0fb3('0x2'));var rs=require(_0x0fb3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0fb3('0x4'));var logger=require(_0x0fb3('0x5'))('rpc');var config=require(_0x0fb3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0fb3('0x7')][_0x0fb3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5aecb1,_0x2be2fb,_0x3e83cb){return new BPromise(function(_0x37bd9a,_0x51de18){return client['request'](_0x5aecb1,_0x3e83cb)[_0x0fb3('0x9')](function(_0x29e687){logger[_0x0fb3('0xa')](_0x0fb3('0xb'),_0x2be2fb,_0x0fb3('0xc'));logger[_0x0fb3('0xd')](_0x0fb3('0xe'),_0x2be2fb,_0x0fb3('0xc'),JSON[_0x0fb3('0xf')](_0x29e687));if(_0x29e687['error']){if(_0x29e687[_0x0fb3('0x10')][_0x0fb3('0x11')]===0x1f4){logger[_0x0fb3('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x2be2fb,_0x29e687[_0x0fb3('0x10')][_0x0fb3('0x12')]);return _0x51de18(_0x29e687['error']['message']);}logger[_0x0fb3('0x10')](_0x0fb3('0xb'),_0x2be2fb,_0x29e687['error'][_0x0fb3('0x12')]);return _0x37bd9a(_0x29e687[_0x0fb3('0x10')]['message']);}else{logger[_0x0fb3('0xa')](_0x0fb3('0xb'),_0x2be2fb,_0x0fb3('0xc'));_0x37bd9a(_0x29e687['result']['message']);}})[_0x0fb3('0x13')](function(_0x184ec6){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2be2fb,_0x184ec6);_0x51de18(_0x184ec6);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 241c876..d0b7561 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 _0xa154=['../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','/:id','show','create','put','delete','destroy','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa154,0xcb));var _0x4a15=function(_0xa599e2,_0x3046be){_0xa599e2=_0xa599e2-0x0;var _0x122f49=_0xa154[_0xa599e2];return _0x122f49;};'use strict';var multer=require('multer');var util=require(_0x4a15('0x0'));var path=require(_0x4a15('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4a15('0x2')]();var fs_extra=require(_0x4a15('0x3'));var auth=require(_0x4a15('0x4'));var interaction=require(_0x4a15('0x5'));var config=require(_0x4a15('0x6'));var controller=require(_0x4a15('0x7'));router['get']('/',auth[_0x4a15('0x8')](),controller['index']);router[_0x4a15('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x4a15('0x9')](_0x4a15('0xa'),auth[_0x4a15('0x8')](),controller[_0x4a15('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4a15('0xc')]);router[_0x4a15('0xd')](_0x4a15('0xa'),auth[_0x4a15('0x8')](),controller['update']);router[_0x4a15('0xe')](_0x4a15('0xa'),auth[_0x4a15('0x8')](),controller[_0x4a15('0xf')]);module['exports']=router; \ No newline at end of file +var _0x695e=['/:id','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./mailTransferReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x2bdb3f,_0x816c4b){var _0x14a776=function(_0x3e104c){while(--_0x3e104c){_0x2bdb3f['push'](_0x2bdb3f['shift']());}};_0x14a776(++_0x816c4b);}(_0x695e,0x6a));var _0xe695=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x695e[_0x3aaf0a];return _0x33e6bc;};'use strict';var multer=require(_0xe695('0x0'));var util=require(_0xe695('0x1'));var path=require(_0xe695('0x2'));var timeout=require('connect-timeout');var express=require(_0xe695('0x3'));var router=express[_0xe695('0x4')]();var fs_extra=require(_0xe695('0x5'));var auth=require(_0xe695('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe695('0x7'));router[_0xe695('0x8')]('/',auth['isAuthenticated'](),controller[_0xe695('0x9')]);router['get'](_0xe695('0xa'),auth[_0xe695('0xb')](),controller[_0xe695('0xc')]);router[_0xe695('0x8')](_0xe695('0xd'),auth[_0xe695('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe695('0xe')](_0xe695('0xd'),auth[_0xe695('0xb')](),controller['update']);router[_0xe695('0xf')](_0xe695('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xe695('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index d2236fa..235464a 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x472b9c,_0x180065){var _0x143852=function(_0x1bd711){while(--_0x1bd711){_0x472b9c['push'](_0x472b9c['shift']());}};_0x143852(++_0x180065);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0xcb91[_0x3a4f18];return _0x4c20fc;};'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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x4c974e,_0x513d9e){var _0x31327b=function(_0x5db97c){while(--_0x5db97c){_0x4c974e['push'](_0x4c974e['shift']());}};_0x31327b(++_0x513d9e);}(_0x54ef,0x112));var _0xf54e=function(_0x4552a0,_0x4c8e1a){_0x4552a0=_0x4552a0-0x0;var _0x12c404=_0x54ef[_0x4552a0];return _0x12c404;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index a0014c5..e592223 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 _0x54f2=['status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailTransferReport','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x1a4a06,_0x36a5c2){var _0x49ec08=function(_0x497f24){while(--_0x497f24){_0x1a4a06['push'](_0x1a4a06['shift']());}};_0x49ec08(++_0x36a5c2);}(_0x54f2,0xc9));var _0x254f=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x54f2[_0x6cf19c];return _0xce14f3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x254f('0x0'));var jsonpatch=require(_0x254f('0x1'));var rp=require(_0x254f('0x2'));var moment=require(_0x254f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x254f('0x4'));var util=require(_0x254f('0x5'));var path=require(_0x254f('0x6'));var sox=require(_0x254f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x254f('0x8'));var _=require(_0x254f('0x9'));var squel=require(_0x254f('0xa'));var crypto=require(_0x254f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x254f('0xc'));var toCsv=require(_0x254f('0xd'));var querystring=require(_0x254f('0xe'));var Papa=require(_0x254f('0xf'));var Redis=require(_0x254f('0x10'));var authService=require(_0x254f('0x11'));var qs=require(_0x254f('0x12'));var as=require(_0x254f('0x13'));var hardwareService=require(_0x254f('0x14'));var logger=require(_0x254f('0x15'))(_0x254f('0x16'));var utils=require(_0x254f('0x17'));var config=require(_0x254f('0x18'));var licenseUtil=require(_0x254f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x297fcf,_0x50c3c8){_0x50c3c8=_0x50c3c8||0xcc;return function(_0x5403ad){if(_0x5403ad){return _0x297fcf[_0x254f('0x1a')](_0x50c3c8);}return _0x297fcf[_0x254f('0x1b')](_0x50c3c8)[_0x254f('0x1c')]();};}function respondWithResult(_0x297f37,_0x5f2dc5){_0x5f2dc5=_0x5f2dc5||0xc8;return function(_0x5de409){if(_0x5de409){return _0x297f37[_0x254f('0x1b')](_0x5f2dc5)[_0x254f('0x1d')](_0x5de409);}};}function respondWithFilteredResult(_0x209867,_0x54be0f){return function(_0xbb2c39){if(_0xbb2c39){var _0x12ccec=typeof _0x54be0f[_0x254f('0x1e')]==='undefined'&&typeof _0x54be0f[_0x254f('0x1f')]==='undefined';var _0x3c44a6=_0xbb2c39[_0x254f('0x20')];var _0x37b2f4=_0x12ccec?0x0:_0x54be0f[_0x254f('0x1e')];var _0x1c9edf=_0x12ccec?_0xbb2c39[_0x254f('0x20')]:_0x54be0f[_0x254f('0x1e')]+_0x54be0f[_0x254f('0x1f')];var _0x3e42fa;if(_0x1c9edf>=_0x3c44a6){_0x1c9edf=_0x3c44a6;_0x3e42fa=0xc8;}else{_0x3e42fa=0xce;}_0x209867[_0x254f('0x1b')](_0x3e42fa);return _0x209867[_0x254f('0x21')](_0x254f('0x22'),_0x37b2f4+'-'+_0x1c9edf+'/'+_0x3c44a6)[_0x254f('0x1d')](_0xbb2c39);}return null;};}function patchUpdates(_0xf872af){return function(_0x2845bc){try{jsonpatch[_0x254f('0x23')](_0x2845bc,_0xf872af,!![]);}catch(_0x4dc8df){return BPromise[_0x254f('0x24')](_0x4dc8df);}return _0x2845bc[_0x254f('0x25')]();};}function saveUpdates(_0x1a2971,_0x497e91){return function(_0x43198c){if(_0x43198c){return _0x43198c[_0x254f('0x26')](_0x1a2971)[_0x254f('0x27')](function(_0x461752){return _0x461752;});}return null;};}function removeEntity(_0x544312,_0x5d62fa){return function(_0x227bc6){if(_0x227bc6){return _0x227bc6[_0x254f('0x28')]()[_0x254f('0x27')](function(){_0x544312[_0x254f('0x1b')](0xcc)[_0x254f('0x1c')]();});}};}function handleEntityNotFound(_0x38a2b5,_0x1c7f9d){return function(_0x22efde){if(!_0x22efde){_0x38a2b5[_0x254f('0x1a')](0x194);}return _0x22efde;};}function handleError(_0x2b45b5,_0x3e68da){_0x3e68da=_0x3e68da||0x1f4;return function(_0xbbd7ad){logger[_0x254f('0x29')](_0xbbd7ad[_0x254f('0x2a')]);if(_0xbbd7ad['name']){delete _0xbbd7ad[_0x254f('0x2b')];}_0x2b45b5['status'](_0x3e68da)[_0x254f('0x2c')](_0xbbd7ad);};}exports[_0x254f('0x2d')]=function(_0x258abf,_0x322d66){var _0x37b0c9={},_0x351366={},_0x2143e9={'count':0x0,'rows':[]};var _0x355b42=_[_0x254f('0x2e')](db[_0x254f('0x2f')][_0x254f('0x30')],function(_0x544a5c){return{'name':_0x544a5c['fieldName'],'type':_0x544a5c[_0x254f('0x31')]['key']};});_0x351366[_0x254f('0x32')]=_['map'](_0x355b42,_0x254f('0x2b'));_0x351366[_0x254f('0x33')]=_[_0x254f('0x34')](_0x258abf[_0x254f('0x33')]);_0x351366['filters']=_[_0x254f('0x35')](_0x351366[_0x254f('0x32')],_0x351366['query']);_0x37b0c9['attributes']=_[_0x254f('0x35')](_0x351366[_0x254f('0x32')],qs[_0x254f('0x36')](_0x258abf['query'][_0x254f('0x36')]));_0x37b0c9[_0x254f('0x37')]=_0x37b0c9[_0x254f('0x37')][_0x254f('0x38')]?_0x37b0c9[_0x254f('0x37')]:_0x351366[_0x254f('0x32')];if(!_0x258abf[_0x254f('0x33')][_0x254f('0x39')](_0x254f('0x3a'))){_0x37b0c9[_0x254f('0x1f')]=qs[_0x254f('0x1f')](_0x258abf[_0x254f('0x33')][_0x254f('0x1f')]);_0x37b0c9[_0x254f('0x1e')]=qs[_0x254f('0x1e')](_0x258abf[_0x254f('0x33')][_0x254f('0x1e')]);}_0x37b0c9['order']=qs[_0x254f('0x3b')](_0x258abf['query'][_0x254f('0x3b')]);_0x37b0c9[_0x254f('0x3c')]=qs[_0x254f('0x3d')](_['pick'](_0x258abf['query'],_0x351366[_0x254f('0x3d')]),_0x355b42);if(_0x258abf['query'][_0x254f('0x3e')]){_0x37b0c9['where']=_[_0x254f('0x3f')](_0x37b0c9['where'],{'$or':_[_0x254f('0x2e')](_0x355b42,function(_0x1d6413){if(_0x1d6413[_0x254f('0x31')]!==_0x254f('0x40')){var _0x273568={};_0x273568[_0x1d6413['name']]={'$like':'%'+_0x258abf[_0x254f('0x33')]['filter']+'%'};return _0x273568;}})});}_0x37b0c9=_[_0x254f('0x3f')]({},_0x37b0c9,_0x258abf[_0x254f('0x41')]);var _0x4656c6={'where':_0x37b0c9[_0x254f('0x3c')]};return db[_0x254f('0x2f')][_0x254f('0x20')](_0x4656c6)[_0x254f('0x27')](function(_0x210fa4){_0x2143e9[_0x254f('0x20')]=_0x210fa4;if(_0x258abf['query'][_0x254f('0x42')]){_0x37b0c9[_0x254f('0x43')]=[{'all':!![]}];}return db[_0x254f('0x2f')]['findAll'](_0x37b0c9);})[_0x254f('0x27')](function(_0x3e2e70){_0x2143e9[_0x254f('0x44')]=_0x3e2e70;return _0x2143e9;})['then'](respondWithFilteredResult(_0x322d66,_0x37b0c9))[_0x254f('0x45')](handleError(_0x322d66,null));};exports[_0x254f('0x46')]=function(_0x2ab496,_0x55285a){var _0x2f317b={'raw':!![],'where':{'id':_0x2ab496['params']['id']}},_0x11e338={};_0x11e338[_0x254f('0x32')]=_['keys'](db[_0x254f('0x2f')]['rawAttributes']);_0x11e338['query']=_[_0x254f('0x34')](_0x2ab496[_0x254f('0x33')]);_0x11e338['filters']=_[_0x254f('0x35')](_0x11e338['model'],_0x11e338['query']);_0x2f317b[_0x254f('0x37')]=_[_0x254f('0x35')](_0x11e338['model'],qs['fields'](_0x2ab496[_0x254f('0x33')][_0x254f('0x36')]));_0x2f317b[_0x254f('0x37')]=_0x2f317b['attributes'][_0x254f('0x38')]?_0x2f317b[_0x254f('0x37')]:_0x11e338['model'];if(_0x2ab496[_0x254f('0x33')]['includeAll']){_0x2f317b['include']=[{'all':!![]}];}_0x2f317b=_[_0x254f('0x3f')]({},_0x2f317b,_0x2ab496['options']);return db[_0x254f('0x2f')][_0x254f('0x47')](_0x2f317b)[_0x254f('0x27')](handleEntityNotFound(_0x55285a,null))[_0x254f('0x27')](respondWithResult(_0x55285a,null))[_0x254f('0x45')](handleError(_0x55285a,null));};exports[_0x254f('0x48')]=function(_0x32682c,_0x51e5de){return db[_0x254f('0x2f')][_0x254f('0x48')](_0x32682c['body'],{})['then'](respondWithResult(_0x51e5de,0xc9))['catch'](handleError(_0x51e5de,null));};exports[_0x254f('0x26')]=function(_0x344a13,_0x9a86c8){if(_0x344a13[_0x254f('0x49')]['id']){delete _0x344a13[_0x254f('0x49')]['id'];}return db[_0x254f('0x2f')][_0x254f('0x47')]({'where':{'id':_0x344a13[_0x254f('0x4a')]['id']}})[_0x254f('0x27')](handleEntityNotFound(_0x9a86c8,null))[_0x254f('0x27')](saveUpdates(_0x344a13[_0x254f('0x49')],null))['then'](respondWithResult(_0x9a86c8,null))[_0x254f('0x45')](handleError(_0x9a86c8,null));};exports['destroy']=function(_0x20b80b,_0x4bec27){return db[_0x254f('0x2f')][_0x254f('0x47')]({'where':{'id':_0x20b80b[_0x254f('0x4a')]['id']}})[_0x254f('0x27')](handleEntityNotFound(_0x4bec27,null))[_0x254f('0x27')](removeEntity(_0x4bec27,null))[_0x254f('0x45')](handleError(_0x4bec27,null));};exports['describe']=function(_0x3158bf,_0xa385c5){return db[_0x254f('0x2f')][_0x254f('0x4b')]()[_0x254f('0x27')](respondWithResult(_0xa385c5,null))[_0x254f('0x45')](handleError(_0xa385c5,null));}; \ No newline at end of file +var _0x1b01=['Content-Range','json','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','MailTransferReport','includeAll','include','rows','catch','show','params','intersection','fields','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x28d6e1,_0x3bd067){var _0x529cf3=function(_0x5e66d7){while(--_0x5e66d7){_0x28d6e1['push'](_0x28d6e1['shift']());}};_0x529cf3(++_0x3bd067);}(_0x1b01,0x152));var _0x11b0=function(_0x87dedb,_0x50b848){_0x87dedb=_0x87dedb-0x0;var _0x17e884=_0x1b01[_0x87dedb];return _0x17e884;};'use strict';var emlformat=require(_0x11b0('0x0'));var rimraf=require(_0x11b0('0x1'));var zipdir=require(_0x11b0('0x2'));var jsonpatch=require(_0x11b0('0x3'));var rp=require('request-promise');var moment=require(_0x11b0('0x4'));var BPromise=require(_0x11b0('0x5'));var Mustache=require(_0x11b0('0x6'));var util=require(_0x11b0('0x7'));var path=require(_0x11b0('0x8'));var sox=require(_0x11b0('0x9'));var csv=require(_0x11b0('0xa'));var ejs=require(_0x11b0('0xb'));var fs=require('fs');var fs_extra=require(_0x11b0('0xc'));var _=require(_0x11b0('0xd'));var squel=require(_0x11b0('0xe'));var crypto=require('crypto');var jsforce=require(_0x11b0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x11b0('0xa'));var querystring=require('querystring');var Papa=require(_0x11b0('0x10'));var Redis=require(_0x11b0('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x11b0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x11b0('0x13'))(_0x11b0('0x14'));var utils=require(_0x11b0('0x15'));var config=require(_0x11b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x11b0('0x17'))['db'];function respondWithStatusCode(_0x5babbd,_0x5de763){_0x5de763=_0x5de763||0xcc;return function(_0x721e3b){if(_0x721e3b){return _0x5babbd[_0x11b0('0x18')](_0x5de763);}return _0x5babbd[_0x11b0('0x19')](_0x5de763)[_0x11b0('0x1a')]();};}function respondWithResult(_0x3f3b31,_0x35ff2e){_0x35ff2e=_0x35ff2e||0xc8;return function(_0xcd9f2c){if(_0xcd9f2c){return _0x3f3b31[_0x11b0('0x19')](_0x35ff2e)['json'](_0xcd9f2c);}};}function respondWithFilteredResult(_0x46a0c5,_0xec9c75){return function(_0x8bc0a5){if(_0x8bc0a5){var _0x4a0936=typeof _0xec9c75[_0x11b0('0x1b')]===_0x11b0('0x1c')&&typeof _0xec9c75[_0x11b0('0x1d')]===_0x11b0('0x1c');var _0x2d2c83=_0x8bc0a5[_0x11b0('0x1e')];var _0x43473c=_0x4a0936?0x0:_0xec9c75['offset'];var _0x37fb81=_0x4a0936?_0x8bc0a5[_0x11b0('0x1e')]:_0xec9c75['offset']+_0xec9c75[_0x11b0('0x1d')];var _0x11d232;if(_0x37fb81>=_0x2d2c83){_0x37fb81=_0x2d2c83;_0x11d232=0xc8;}else{_0x11d232=0xce;}_0x46a0c5[_0x11b0('0x19')](_0x11d232);return _0x46a0c5[_0x11b0('0x1f')](_0x11b0('0x20'),_0x43473c+'-'+_0x37fb81+'/'+_0x2d2c83)[_0x11b0('0x21')](_0x8bc0a5);}return null;};}function patchUpdates(_0x22ff1e){return function(_0x253eb5){try{jsonpatch[_0x11b0('0x22')](_0x253eb5,_0x22ff1e,!![]);}catch(_0x1c789c){return BPromise['reject'](_0x1c789c);}return _0x253eb5[_0x11b0('0x23')]();};}function saveUpdates(_0xfd95ca,_0x3beae0){return function(_0xc85f94){if(_0xc85f94){return _0xc85f94[_0x11b0('0x24')](_0xfd95ca)[_0x11b0('0x25')](function(_0x56c1ae){return _0x56c1ae;});}return null;};}function removeEntity(_0x184bed,_0x917c85){return function(_0x1c9a25){if(_0x1c9a25){return _0x1c9a25['destroy']()[_0x11b0('0x25')](function(){_0x184bed[_0x11b0('0x19')](0xcc)[_0x11b0('0x1a')]();});}};}function handleEntityNotFound(_0xbbd7a4,_0x53720d){return function(_0x5a0976){if(!_0x5a0976){_0xbbd7a4['sendStatus'](0x194);}return _0x5a0976;};}function handleError(_0x3abd9d,_0x4717f8){_0x4717f8=_0x4717f8||0x1f4;return function(_0x4b4e85){logger[_0x11b0('0x26')](_0x4b4e85[_0x11b0('0x27')]);if(_0x4b4e85[_0x11b0('0x28')]){delete _0x4b4e85[_0x11b0('0x28')];}_0x3abd9d[_0x11b0('0x19')](_0x4717f8)[_0x11b0('0x29')](_0x4b4e85);};}exports[_0x11b0('0x2a')]=function(_0x4013a5,_0x301817){var _0x34ec9={},_0x11d47f={},_0x1ce5ad={'count':0x0,'rows':[]};var _0xfc8475=_[_0x11b0('0x2b')](db['MailTransferReport'][_0x11b0('0x2c')],function(_0x3a9ade){return{'name':_0x3a9ade[_0x11b0('0x2d')],'type':_0x3a9ade[_0x11b0('0x2e')]['key']};});_0x11d47f[_0x11b0('0x2f')]=_['map'](_0xfc8475,_0x11b0('0x28'));_0x11d47f[_0x11b0('0x30')]=_[_0x11b0('0x31')](_0x4013a5[_0x11b0('0x30')]);_0x11d47f['filters']=_['intersection'](_0x11d47f[_0x11b0('0x2f')],_0x11d47f[_0x11b0('0x30')]);_0x34ec9['attributes']=_['intersection'](_0x11d47f[_0x11b0('0x2f')],qs['fields'](_0x4013a5['query']['fields']));_0x34ec9[_0x11b0('0x32')]=_0x34ec9['attributes'][_0x11b0('0x33')]?_0x34ec9[_0x11b0('0x32')]:_0x11d47f[_0x11b0('0x2f')];if(!_0x4013a5[_0x11b0('0x30')][_0x11b0('0x34')](_0x11b0('0x35'))){_0x34ec9[_0x11b0('0x1d')]=qs['limit'](_0x4013a5[_0x11b0('0x30')][_0x11b0('0x1d')]);_0x34ec9[_0x11b0('0x1b')]=qs[_0x11b0('0x1b')](_0x4013a5[_0x11b0('0x30')][_0x11b0('0x1b')]);}_0x34ec9[_0x11b0('0x36')]=qs['sort'](_0x4013a5[_0x11b0('0x30')][_0x11b0('0x37')]);_0x34ec9[_0x11b0('0x38')]=qs[_0x11b0('0x39')](_['pick'](_0x4013a5[_0x11b0('0x30')],_0x11d47f[_0x11b0('0x39')]),_0xfc8475);if(_0x4013a5['query'][_0x11b0('0x3a')]){_0x34ec9[_0x11b0('0x38')]=_[_0x11b0('0x3b')](_0x34ec9[_0x11b0('0x38')],{'$or':_[_0x11b0('0x2b')](_0xfc8475,function(_0x1d614e){if(_0x1d614e['type']!==_0x11b0('0x3c')){var _0x2a17a5={};_0x2a17a5[_0x1d614e[_0x11b0('0x28')]]={'$like':'%'+_0x4013a5[_0x11b0('0x30')]['filter']+'%'};return _0x2a17a5;}})});}_0x34ec9=_[_0x11b0('0x3b')]({},_0x34ec9,_0x4013a5['options']);var _0x84d103={'where':_0x34ec9[_0x11b0('0x38')]};return db[_0x11b0('0x3d')][_0x11b0('0x1e')](_0x84d103)[_0x11b0('0x25')](function(_0x239423){_0x1ce5ad[_0x11b0('0x1e')]=_0x239423;if(_0x4013a5[_0x11b0('0x30')][_0x11b0('0x3e')]){_0x34ec9[_0x11b0('0x3f')]=[{'all':!![]}];}return db[_0x11b0('0x3d')]['findAll'](_0x34ec9);})[_0x11b0('0x25')](function(_0x50fec3){_0x1ce5ad[_0x11b0('0x40')]=_0x50fec3;return _0x1ce5ad;})[_0x11b0('0x25')](respondWithFilteredResult(_0x301817,_0x34ec9))[_0x11b0('0x41')](handleError(_0x301817,null));};exports[_0x11b0('0x42')]=function(_0x23520e,_0x4e0380){var _0x3cc8f6={'raw':!![],'where':{'id':_0x23520e[_0x11b0('0x43')]['id']}},_0x1ca1ab={};_0x1ca1ab[_0x11b0('0x2f')]=_[_0x11b0('0x31')](db[_0x11b0('0x3d')][_0x11b0('0x2c')]);_0x1ca1ab[_0x11b0('0x30')]=_['keys'](_0x23520e[_0x11b0('0x30')]);_0x1ca1ab[_0x11b0('0x39')]=_[_0x11b0('0x44')](_0x1ca1ab[_0x11b0('0x2f')],_0x1ca1ab[_0x11b0('0x30')]);_0x3cc8f6[_0x11b0('0x32')]=_[_0x11b0('0x44')](_0x1ca1ab[_0x11b0('0x2f')],qs['fields'](_0x23520e['query'][_0x11b0('0x45')]));_0x3cc8f6[_0x11b0('0x32')]=_0x3cc8f6[_0x11b0('0x32')][_0x11b0('0x33')]?_0x3cc8f6[_0x11b0('0x32')]:_0x1ca1ab[_0x11b0('0x2f')];if(_0x23520e['query'][_0x11b0('0x3e')]){_0x3cc8f6[_0x11b0('0x3f')]=[{'all':!![]}];}_0x3cc8f6=_[_0x11b0('0x3b')]({},_0x3cc8f6,_0x23520e['options']);return db['MailTransferReport'][_0x11b0('0x46')](_0x3cc8f6)[_0x11b0('0x25')](handleEntityNotFound(_0x4e0380,null))[_0x11b0('0x25')](respondWithResult(_0x4e0380,null))[_0x11b0('0x41')](handleError(_0x4e0380,null));};exports['create']=function(_0x260b4c,_0x20ff6c){return db[_0x11b0('0x3d')][_0x11b0('0x47')](_0x260b4c['body'],{})[_0x11b0('0x25')](respondWithResult(_0x20ff6c,0xc9))[_0x11b0('0x41')](handleError(_0x20ff6c,null));};exports[_0x11b0('0x24')]=function(_0x5e6d73,_0x1c9ee6){if(_0x5e6d73[_0x11b0('0x48')]['id']){delete _0x5e6d73[_0x11b0('0x48')]['id'];}return db[_0x11b0('0x3d')][_0x11b0('0x46')]({'where':{'id':_0x5e6d73['params']['id']}})[_0x11b0('0x25')](handleEntityNotFound(_0x1c9ee6,null))['then'](saveUpdates(_0x5e6d73[_0x11b0('0x48')],null))['then'](respondWithResult(_0x1c9ee6,null))[_0x11b0('0x41')](handleError(_0x1c9ee6,null));};exports[_0x11b0('0x49')]=function(_0x1065f0,_0x9af9a1){return db['MailTransferReport'][_0x11b0('0x46')]({'where':{'id':_0x1065f0[_0x11b0('0x43')]['id']}})['then'](handleEntityNotFound(_0x9af9a1,null))[_0x11b0('0x25')](removeEntity(_0x9af9a1,null))['catch'](handleError(_0x9af9a1,null));};exports['describe']=function(_0x5d4a0c,_0x33b37e){return db[_0x11b0('0x3d')]['describe']()[_0x11b0('0x25')](respondWithResult(_0x33b37e,null))[_0x11b0('0x41')](handleError(_0x33b37e,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 0944db7..dea67e7 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 _0xfc76=['rimraf','./mailTransferReport.attributes','define','report_mail_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','path'];(function(_0x45f57f,_0x388c50){var _0x16c44a=function(_0x3e703a){while(--_0x3e703a){_0x45f57f['push'](_0x45f57f['shift']());}};_0x16c44a(++_0x388c50);}(_0xfc76,0xb5));var _0x6fc7=function(_0x4b46a3,_0x2f13de){_0x4b46a3=_0x4b46a3-0x0;var _0x18dae5=_0xfc76[_0x4b46a3];return _0x18dae5;};'use strict';var _=require('lodash');var util=require(_0x6fc7('0x0'));var logger=require(_0x6fc7('0x1'))(_0x6fc7('0x2'));var moment=require(_0x6fc7('0x3'));var BPromise=require(_0x6fc7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fc7('0x5'));var rimraf=require(_0x6fc7('0x6'));var config=require('../../config/environment');var attributes=require(_0x6fc7('0x7'));module['exports']=function(_0xe8177b,_0x82a35a){return _0xe8177b[_0x6fc7('0x8')]('MailTransferReport',attributes,{'tableName':_0x6fc7('0x9'),'paranoid':![],'indexes':[{'name':_0x6fc7('0xa'),'fields':[_0x6fc7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x528f=['util','../../config/logger','api','moment','bluebird','path','./mailTransferReport.attributes','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x1d7265,_0xa62261){var _0x209267=function(_0x5bfc98){while(--_0x5bfc98){_0x1d7265['push'](_0x1d7265['shift']());}};_0x209267(++_0xa62261);}(_0x528f,0x140));var _0xf528=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x528f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf528('0x0'));var logger=require(_0xf528('0x1'))(_0xf528('0x2'));var moment=require(_0xf528('0x3'));var BPromise=require(_0xf528('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf528('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf528('0x6'));module['exports']=function(_0x2a4f5b,_0x17c8c8){return _0x2a4f5b['define'](_0xf528('0x7'),attributes,{'tableName':_0xf528('0x8'),'paranoid':![],'indexes':[{'name':_0xf528('0x9'),'fields':[_0xf528('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 067c217..4bbdd0d 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 _0x26e8=['../../config/environment','jayson/promise','http','request','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','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x42bc40,_0x23865b){var _0x2e7498=function(_0x3efd2a){while(--_0x3efd2a){_0x42bc40['push'](_0x42bc40['shift']());}};_0x2e7498(++_0x23865b);}(_0x26e8,0x196));var _0x826e=function(_0x10647f,_0x5b78b1){_0x10647f=_0x10647f-0x0;var _0x10bb41=_0x26e8[_0x10647f];return _0x10bb41;};'use strict';var _=require(_0x826e('0x0'));var util=require(_0x826e('0x1'));var moment=require(_0x826e('0x2'));var BPromise=require(_0x826e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x826e('0x4'));var db=require(_0x826e('0x5'))['db'];var utils=require(_0x826e('0x6'));var logger=require(_0x826e('0x7'))('rpc');var config=require(_0x826e('0x8'));var jayson=require(_0x826e('0x9'));var client=jayson['client'][_0x826e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bfb0b,_0x11cab1,_0x3eb010){return new BPromise(function(_0x5760f6,_0x1dfed2){return client[_0x826e('0xb')](_0x5bfb0b,_0x3eb010)[_0x826e('0xc')](function(_0x4b0440){logger[_0x826e('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x11cab1,_0x826e('0xe'));logger[_0x826e('0xf')](_0x826e('0x10'),_0x11cab1,_0x826e('0xe'),JSON[_0x826e('0x11')](_0x4b0440));if(_0x4b0440[_0x826e('0x12')]){if(_0x4b0440['error'][_0x826e('0x13')]===0x1f4){logger[_0x826e('0x12')](_0x826e('0x14'),_0x11cab1,_0x4b0440[_0x826e('0x12')][_0x826e('0x15')]);return _0x1dfed2(_0x4b0440['error'][_0x826e('0x15')]);}logger[_0x826e('0x12')](_0x826e('0x14'),_0x11cab1,_0x4b0440[_0x826e('0x12')][_0x826e('0x15')]);return _0x5760f6(_0x4b0440[_0x826e('0x12')][_0x826e('0x15')]);}else{logger[_0x826e('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x11cab1,'request\x20sent');_0x5760f6(_0x4b0440['result'][_0x826e('0x15')]);}})[_0x826e('0x16')](function(_0x384989){logger['error'](_0x826e('0x14'),_0x11cab1,_0x384989);_0x1dfed2(_0x384989);});});} \ No newline at end of file +var _0x8f95=['stringify','error','code','message','result','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x520308,_0x262c4c){var _0x2305c7=function(_0x2fdc53){while(--_0x2fdc53){_0x520308['push'](_0x520308['shift']());}};_0x2305c7(++_0x262c4c);}(_0x8f95,0x11d));var _0x58f9=function(_0x3f81d9,_0x3fa571){_0x3f81d9=_0x3f81d9-0x0;var _0x293025=_0x8f95[_0x3f81d9];return _0x293025;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x58f9('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58f9('0x1'))['db'];var utils=require(_0x58f9('0x2'));var logger=require('../../config/logger')(_0x58f9('0x3'));var config=require(_0x58f9('0x4'));var jayson=require(_0x58f9('0x5'));var client=jayson[_0x58f9('0x6')][_0x58f9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2c7bce,_0x412e17,_0x56810c){return new BPromise(function(_0x18fbdd,_0x50d1b4){return client[_0x58f9('0x8')](_0x2c7bce,_0x56810c)[_0x58f9('0x9')](function(_0x2cbbf4){logger[_0x58f9('0xa')](_0x58f9('0xb'),_0x412e17,_0x58f9('0xc'));logger[_0x58f9('0xd')](_0x58f9('0xe'),_0x412e17,_0x58f9('0xc'),JSON[_0x58f9('0xf')](_0x2cbbf4));if(_0x2cbbf4[_0x58f9('0x10')]){if(_0x2cbbf4[_0x58f9('0x10')][_0x58f9('0x11')]===0x1f4){logger[_0x58f9('0x10')](_0x58f9('0xb'),_0x412e17,_0x2cbbf4[_0x58f9('0x10')][_0x58f9('0x12')]);return _0x50d1b4(_0x2cbbf4['error'][_0x58f9('0x12')]);}logger[_0x58f9('0x10')](_0x58f9('0xb'),_0x412e17,_0x2cbbf4[_0x58f9('0x10')][_0x58f9('0x12')]);return _0x18fbdd(_0x2cbbf4[_0x58f9('0x10')]['message']);}else{logger[_0x58f9('0xa')](_0x58f9('0xb'),_0x412e17,_0x58f9('0xc'));_0x18fbdd(_0x2cbbf4[_0x58f9('0x13')]['message']);}})['catch'](function(_0x587312){logger[_0x58f9('0x10')](_0x58f9('0xb'),_0x412e17,_0x587312);_0x50d1b4(_0x587312);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 03bfed0..41f5e26 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 _0x1d46=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x1f334e,_0x405c94){var _0x57ec46=function(_0x3aaf8a){while(--_0x3aaf8a){_0x1f334e['push'](_0x1f334e['shift']());}};_0x57ec46(++_0x405c94);}(_0x1d46,0x172));var _0x61d4=function(_0x276468,_0x29685a){_0x276468=_0x276468-0x0;var _0x36dc3a=_0x1d46[_0x276468];return _0x36dc3a;};'use strict';var multer=require(_0x61d4('0x0'));var util=require(_0x61d4('0x1'));var path=require(_0x61d4('0x2'));var timeout=require(_0x61d4('0x3'));var express=require(_0x61d4('0x4'));var router=express[_0x61d4('0x5')]();var fs_extra=require(_0x61d4('0x6'));var auth=require(_0x61d4('0x7'));var interaction=require(_0x61d4('0x8'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x61d4('0x9')]('/',auth[_0x61d4('0xa')](),controller[_0x61d4('0xb')]);router['get'](_0x61d4('0xc'),auth['isAuthenticated'](),controller[_0x61d4('0xd')]);router[_0x61d4('0x9')](_0x61d4('0xe'),auth[_0x61d4('0xa')](),controller[_0x61d4('0xf')]);router[_0x61d4('0x10')]('/',auth[_0x61d4('0xa')](),controller[_0x61d4('0x11')]);router[_0x61d4('0x12')]('/:id',auth[_0x61d4('0xa')](),controller[_0x61d4('0x13')]);router[_0x61d4('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x61d4('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf649=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','util','path'];(function(_0xcc468c,_0x469dfb){var _0xcf785f=function(_0x10bc26){while(--_0x10bc26){_0xcc468c['push'](_0xcc468c['shift']());}};_0xcf785f(++_0x469dfb);}(_0xf649,0xba));var _0x9f64=function(_0x5090f,_0x5abf30){_0x5090f=_0x5090f-0x0;var _0x3b657a=_0xf649[_0x5090f];return _0x3b657a;};'use strict';var multer=require(_0x9f64('0x0'));var util=require(_0x9f64('0x1'));var path=require(_0x9f64('0x2'));var timeout=require(_0x9f64('0x3'));var express=require(_0x9f64('0x4'));var router=express[_0x9f64('0x5')]();var fs_extra=require(_0x9f64('0x6'));var auth=require(_0x9f64('0x7'));var interaction=require(_0x9f64('0x8'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x9f64('0x9')]('/',auth[_0x9f64('0xa')](),controller[_0x9f64('0xb')]);router[_0x9f64('0x9')](_0x9f64('0xc'),auth[_0x9f64('0xa')](),controller[_0x9f64('0xd')]);router[_0x9f64('0x9')](_0x9f64('0xe'),auth[_0x9f64('0xa')](),controller[_0x9f64('0xf')]);router[_0x9f64('0x10')]('/',auth[_0x9f64('0xa')](),controller['create']);router[_0x9f64('0x11')](_0x9f64('0xe'),auth[_0x9f64('0xa')](),controller[_0x9f64('0x12')]);router['delete'](_0x9f64('0xe'),auth[_0x9f64('0xa')](),controller[_0x9f64('0x13')]);module[_0x9f64('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 eea166c..044e14a 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 _0xaefd=['talk:[queue]','INTEGER','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xaefd,0xdf));var _0xdaef=function(_0x49710d,_0x561fb5){_0x49710d=_0x49710d-0x0;var _0x464572=_0xaefd[_0x49710d];return _0x464572;};'use strict';var Sequelize=require(_0xdaef('0x0'));var moment=require(_0xdaef('0x1'));module['exports']={'channel':{'type':Sequelize[_0xdaef('0x2')]},'membername':{'type':Sequelize[_0xdaef('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdaef('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xdaef('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xdaef('0x4')]},'exitAt':{'type':Sequelize[_0xdaef('0x4')],'set':function(_0x126ae6){var _0x297085=moment(_0x126ae6);var _0x56a03e=moment(this[_0xdaef('0x5')](_0xdaef('0x6')));var _0x4a3d4d=_0x297085[_0xdaef('0x7')](_0x56a03e,_0xdaef('0x8'));this[_0xdaef('0x9')]('exitAt',_0x126ae6);this[_0xdaef('0x9')](_0xdaef('0xa'),_0x4a3d4d>=0x0?_0x4a3d4d:null);}},'data1':{'type':Sequelize[_0xdaef('0x2')],'comment':_0xdaef('0xb')},'data2':{'type':Sequelize[_0xdaef('0x2')],'comment':_0xdaef('0xc')},'data3':{'type':Sequelize[_0xdaef('0x2')],'comment':_0xdaef('0xd')},'data4':{'type':Sequelize[_0xdaef('0x2')],'comment':_0xdaef('0xe')},'data5':{'type':Sequelize['STRING'],'comment':_0xdaef('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0xdaef('0x10')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0ffd=['getDataValue','enterAt','diff','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x4ea932,_0x33eccf){var _0x31de3c=function(_0x20623a){while(--_0x20623a){_0x4ea932['push'](_0x4ea932['shift']());}};_0x31de3c(++_0x33eccf);}(_0x0ffd,0x129));var _0xd0ff=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x0ffd[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd0ff('0x0'));module[_0xd0ff('0x1')]={'channel':{'type':Sequelize[_0xd0ff('0x2')]},'membername':{'type':Sequelize[_0xd0ff('0x2')]},'interface':{'type':Sequelize[_0xd0ff('0x2')]},'type':{'type':Sequelize[_0xd0ff('0x2')],'defaultValue':_0xd0ff('0x3'),'comment':_0xd0ff('0x4')},'duration':{'type':Sequelize[_0xd0ff('0x5')]},'enterAt':{'type':Sequelize[_0xd0ff('0x6')]},'exitAt':{'type':Sequelize[_0xd0ff('0x6')],'set':function(_0x2317ad){var _0x21a490=moment(_0x2317ad);var _0x170890=moment(this[_0xd0ff('0x7')](_0xd0ff('0x8')));var _0x4aea6e=_0x21a490[_0xd0ff('0x9')](_0x170890,_0xd0ff('0xa'));this['setDataValue']('exitAt',_0x2317ad);this[_0xd0ff('0xb')]('duration',_0x4aea6e>=0x0?_0x4aea6e:null);}},'data1':{'type':Sequelize[_0xd0ff('0x2')],'comment':_0xd0ff('0xc')},'data2':{'type':Sequelize[_0xd0ff('0x2')],'comment':_0xd0ff('0xd')},'data3':{'type':Sequelize['STRING'],'comment':_0xd0ff('0xe')},'data4':{'type':Sequelize[_0xd0ff('0x2')],'comment':_0xd0ff('0xf')},'data5':{'type':Sequelize[_0xd0ff('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xd0ff('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xd0ff('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index ae48659..8051696 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 _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(_0x23e859,_0x419ccc){var _0xe4964=function(_0x2e2501){while(--_0x2e2501){_0x23e859['push'](_0x23e859['shift']());}};_0xe4964(++_0x419ccc);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['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 +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(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xedd9,0xfc));var _0x9edd=function(_0xb6e9c7,_0x14898e){_0xb6e9c7=_0xb6e9c7-0x0;var _0x42d031=_0xedd9[_0xb6e9c7];return _0x42d031;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 744a552..b35aa75 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 _0xec30=['rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','interface','util','api','bluebird','request-promise'];(function(_0x224fba,_0x5dff13){var _0x3285d7=function(_0x60f879){while(--_0x60f879){_0x224fba['push'](_0x224fba['shift']());}};_0x3285d7(++_0x5dff13);}(_0xec30,0xf9));var _0x0ec3=function(_0xb77dd4,_0x371dd8){_0xb77dd4=_0xb77dd4-0x0;var _0x29db3c=_0xec30[_0xb77dd4];return _0x29db3c;};'use strict';var _=require('lodash');var util=require(_0x0ec3('0x0'));var logger=require('../../config/logger')(_0x0ec3('0x1'));var moment=require('moment');var BPromise=require(_0x0ec3('0x2'));var rp=require(_0x0ec3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ec3('0x4'));var config=require(_0x0ec3('0x5'));var attributes=require(_0x0ec3('0x6'));module[_0x0ec3('0x7')]=function(_0x1214f2,_0x33b4eb){return _0x1214f2[_0x0ec3('0x8')](_0x0ec3('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0x0ec3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c79=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports','MemberReport','membername_interface','membername','interface'];(function(_0x494c24,_0x4918c2){var _0x3a52f0=function(_0x2c78e2){while(--_0x2c78e2){_0x494c24['push'](_0x494c24['shift']());}};_0x3a52f0(++_0x4918c2);}(_0x6c79,0x1d1));var _0x96c7=function(_0x546074,_0x2633ed){_0x546074=_0x546074-0x0;var _0xc39c10=_0x6c79[_0x546074];return _0xc39c10;};'use strict';var _=require(_0x96c7('0x0'));var util=require(_0x96c7('0x1'));var logger=require(_0x96c7('0x2'))(_0x96c7('0x3'));var moment=require(_0x96c7('0x4'));var BPromise=require(_0x96c7('0x5'));var rp=require(_0x96c7('0x6'));var fs=require('fs');var path=require(_0x96c7('0x7'));var rimraf=require('rimraf');var config=require(_0x96c7('0x8'));var attributes=require(_0x96c7('0x9'));module[_0x96c7('0xa')]=function(_0x205875,_0x2fea1e){return _0x205875['define'](_0x96c7('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x96c7('0xc'),'fields':[_0x96c7('0xd'),_0x96c7('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index dff0daf..807581f 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 _0x7d9f=['catch','CreateMemberReport','create','update','body','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MemberReport,\x20%s,\x20%s','message','result','findAll','options','raw','where','attributes','include','map','model','then','GetMemberReport','stringify'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x3cf4d3,_0x48065e){_0x3cf4d3=_0x3cf4d3-0x0;var _0x4e547b=_0x7d9f[_0x3cf4d3];return _0x4e547b;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var moment=require(_0xf7d9('0x2'));var BPromise=require(_0xf7d9('0x3'));var rs=require(_0xf7d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7d9('0x5'))['db'];var utils=require(_0xf7d9('0x6'));var logger=require(_0xf7d9('0x7'))(_0xf7d9('0x8'));var config=require(_0xf7d9('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf7d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x250675,_0x5772b4,_0x21c654){return new BPromise(function(_0x1685a6,_0x5e4087){return client[_0xf7d9('0xb')](_0x250675,_0x21c654)['then'](function(_0x265548){logger[_0xf7d9('0xc')]('MemberReport,\x20%s,\x20%s',_0x5772b4,'request\x20sent');logger[_0xf7d9('0xd')](_0xf7d9('0xe'),_0x5772b4,_0xf7d9('0xf'),JSON['stringify'](_0x265548));if(_0x265548['error']){if(_0x265548[_0xf7d9('0x10')][_0xf7d9('0x11')]===0x1f4){logger[_0xf7d9('0x10')](_0xf7d9('0x12'),_0x5772b4,_0x265548['error'][_0xf7d9('0x13')]);return _0x5e4087(_0x265548[_0xf7d9('0x10')][_0xf7d9('0x13')]);}logger[_0xf7d9('0x10')]('MemberReport,\x20%s,\x20%s',_0x5772b4,_0x265548[_0xf7d9('0x10')][_0xf7d9('0x13')]);return _0x1685a6(_0x265548[_0xf7d9('0x10')][_0xf7d9('0x13')]);}else{logger['info'](_0xf7d9('0x12'),_0x5772b4,_0xf7d9('0xf'));_0x1685a6(_0x265548[_0xf7d9('0x14')]['message']);}})['catch'](function(_0x35751e){logger[_0xf7d9('0x10')](_0xf7d9('0x12'),_0x5772b4,_0x35751e);_0x5e4087(_0x35751e);});});}exports['GetMemberReport']=function(_0x44ebd3){var _0x32b68d=this;return new Promise(function(_0x5eb7c9,_0x1e4298){return db['MemberReport'][_0xf7d9('0x15')]({'raw':_0x44ebd3[_0xf7d9('0x16')]?_0x44ebd3['options'][_0xf7d9('0x17')]===undefined?!![]:![]:!![],'where':_0x44ebd3[_0xf7d9('0x16')]?_0x44ebd3[_0xf7d9('0x16')][_0xf7d9('0x18')]||null:null,'attributes':_0x44ebd3[_0xf7d9('0x16')]?_0x44ebd3[_0xf7d9('0x16')][_0xf7d9('0x19')]||null:null,'limit':_0x44ebd3[_0xf7d9('0x16')]?_0x44ebd3['options']['limit']||null:null,'include':_0x44ebd3[_0xf7d9('0x16')]?_0x44ebd3['options'][_0xf7d9('0x1a')]?_[_0xf7d9('0x1b')](_0x44ebd3['options'][_0xf7d9('0x1a')],function(_0x27ba8c){return{'model':db[_0x27ba8c['model']],'as':_0x27ba8c['as'],'attributes':_0x27ba8c['attributes'],'include':_0x27ba8c[_0xf7d9('0x1a')]?_[_0xf7d9('0x1b')](_0x27ba8c[_0xf7d9('0x1a')],function(_0x595556){return{'model':db[_0x595556[_0xf7d9('0x1c')]],'as':_0x595556['as'],'attributes':_0x595556['attributes'],'include':_0x595556[_0xf7d9('0x1a')]?_[_0xf7d9('0x1b')](_0x595556[_0xf7d9('0x1a')],function(_0x5b1ea5){return{'model':db[_0x5b1ea5[_0xf7d9('0x1c')]],'as':_0x5b1ea5['as'],'attributes':_0x5b1ea5[_0xf7d9('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf7d9('0x1d')](function(_0xf9373a){logger[_0xf7d9('0xc')]('GetMemberReport',_0x44ebd3);logger[_0xf7d9('0xd')](_0xf7d9('0x1e'),_0x44ebd3,JSON[_0xf7d9('0x1f')](_0xf9373a));_0x5eb7c9(_0xf9373a);})[_0xf7d9('0x20')](function(_0x508b00){logger[_0xf7d9('0x10')](_0xf7d9('0x1e'),_0x508b00[_0xf7d9('0x13')],_0x44ebd3);_0x1e4298(_0x32b68d[_0xf7d9('0x10')](0x1f4,_0x508b00[_0xf7d9('0x13')]));});});};exports[_0xf7d9('0x21')]=function(_0x5ea74d){var _0x5d963f=this;return new Promise(function(_0x5a673a,_0x2bba94){return db['MemberReport'][_0xf7d9('0x22')](_0x5ea74d['body'],{'raw':_0x5ea74d[_0xf7d9('0x16')]?_0x5ea74d['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x14ec19){logger['info'](_0xf7d9('0x21'),_0x5ea74d);logger[_0xf7d9('0xd')](_0xf7d9('0x21'),_0x5ea74d,JSON[_0xf7d9('0x1f')](_0x14ec19));_0x5a673a(_0x14ec19);})[_0xf7d9('0x20')](function(_0x86a7a1){logger[_0xf7d9('0x10')](_0xf7d9('0x21'),_0x86a7a1['message'],_0x5ea74d);_0x2bba94(_0x5d963f[_0xf7d9('0x10')](0x1f4,_0x86a7a1[_0xf7d9('0x13')]));});});};exports['UpdateMemberReport']=function(_0x5a1cd9){var _0x1e2977=this;return new Promise(function(_0x1fd532,_0x4110ce){return db['MemberReport'][_0xf7d9('0x23')](_0x5a1cd9[_0xf7d9('0x24')],{'raw':_0x5a1cd9[_0xf7d9('0x16')]?_0x5a1cd9[_0xf7d9('0x16')][_0xf7d9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a1cd9[_0xf7d9('0x16')]?_0x5a1cd9[_0xf7d9('0x16')][_0xf7d9('0x18')]||null:null,'attributes':_0x5a1cd9[_0xf7d9('0x16')]?_0x5a1cd9[_0xf7d9('0x16')][_0xf7d9('0x19')]||null:null,'limit':_0x5a1cd9['options']?_0x5a1cd9[_0xf7d9('0x16')]['limit']||null:null})[_0xf7d9('0x1d')](function(_0x1111e4){logger[_0xf7d9('0xc')](_0xf7d9('0x25'),_0x5a1cd9);logger['debug']('UpdateMemberReport',_0x5a1cd9,JSON[_0xf7d9('0x1f')](_0x1111e4));_0x1fd532(_0x1111e4);})['catch'](function(_0x16e604){logger[_0xf7d9('0x10')](_0xf7d9('0x25'),_0x16e604[_0xf7d9('0x13')],_0x5a1cd9);_0x4110ce(_0x1e2977['error'](0x1f4,_0x16e604['message']));});});}; \ No newline at end of file +var _0xc9b0=['result','GetMemberReport','findAll','options','raw','where','attributes','include','map','model','catch','CreateMemberReport','create','body','then','UpdateMemberReport','MemberReport','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc9b0,0x143));var _0x0c9b=function(_0x4a70ae,_0x8dfcbb){_0x4a70ae=_0x4a70ae-0x0;var _0x16b7cb=_0xc9b0[_0x4a70ae];return _0x16b7cb;};'use strict';var _=require(_0x0c9b('0x0'));var util=require(_0x0c9b('0x1'));var moment=require(_0x0c9b('0x2'));var BPromise=require(_0x0c9b('0x3'));var rs=require(_0x0c9b('0x4'));var fs=require('fs');var Redis=require(_0x0c9b('0x5'));var db=require(_0x0c9b('0x6'))['db'];var utils=require(_0x0c9b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0c9b('0x8'));var jayson=require(_0x0c9b('0x9'));var client=jayson[_0x0c9b('0xa')][_0x0c9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bd53c,_0x16779e,_0x363958){return new BPromise(function(_0x44bcd5,_0x170820){return client['request'](_0x1bd53c,_0x363958)['then'](function(_0x4e4a0d){logger[_0x0c9b('0xc')](_0x0c9b('0xd'),_0x16779e,_0x0c9b('0xe'));logger[_0x0c9b('0xf')](_0x0c9b('0x10'),_0x16779e,_0x0c9b('0xe'),JSON['stringify'](_0x4e4a0d));if(_0x4e4a0d[_0x0c9b('0x11')]){if(_0x4e4a0d[_0x0c9b('0x11')]['code']===0x1f4){logger[_0x0c9b('0x11')]('MemberReport,\x20%s,\x20%s',_0x16779e,_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);return _0x170820(_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);}logger[_0x0c9b('0x11')](_0x0c9b('0xd'),_0x16779e,_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);return _0x44bcd5(_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x16779e,'request\x20sent');_0x44bcd5(_0x4e4a0d[_0x0c9b('0x13')][_0x0c9b('0x12')]);}})['catch'](function(_0xa7bda1){logger[_0x0c9b('0x11')](_0x0c9b('0xd'),_0x16779e,_0xa7bda1);_0x170820(_0xa7bda1);});});}exports[_0x0c9b('0x14')]=function(_0x2b2f65){var _0x4619b3=this;return new Promise(function(_0x39218d,_0x4bd2d8){return db['MemberReport'][_0x0c9b('0x15')]({'raw':_0x2b2f65['options']?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x17')]===undefined?!![]:![]:!![],'where':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x18')]||null:null,'attributes':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x19')]||null:null,'limit':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')]['limit']||null:null,'include':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x1a')]?_['map'](_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x1a')],function(_0x2409c6){return{'model':db[_0x2409c6['model']],'as':_0x2409c6['as'],'attributes':_0x2409c6[_0x0c9b('0x19')],'include':_0x2409c6['include']?_[_0x0c9b('0x1b')](_0x2409c6[_0x0c9b('0x1a')],function(_0x2d1ce5){return{'model':db[_0x2d1ce5[_0x0c9b('0x1c')]],'as':_0x2d1ce5['as'],'attributes':_0x2d1ce5[_0x0c9b('0x19')],'include':_0x2d1ce5[_0x0c9b('0x1a')]?_[_0x0c9b('0x1b')](_0x2d1ce5[_0x0c9b('0x1a')],function(_0x476c59){return{'model':db[_0x476c59[_0x0c9b('0x1c')]],'as':_0x476c59['as'],'attributes':_0x476c59[_0x0c9b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x594710){logger[_0x0c9b('0xc')](_0x0c9b('0x14'),_0x2b2f65);logger[_0x0c9b('0xf')](_0x0c9b('0x14'),_0x2b2f65,JSON['stringify'](_0x594710));_0x39218d(_0x594710);})[_0x0c9b('0x1d')](function(_0x1391d1){logger['error'](_0x0c9b('0x14'),_0x1391d1[_0x0c9b('0x12')],_0x2b2f65);_0x4bd2d8(_0x4619b3[_0x0c9b('0x11')](0x1f4,_0x1391d1[_0x0c9b('0x12')]));});});};exports[_0x0c9b('0x1e')]=function(_0x30027c){var _0x523fad=this;return new Promise(function(_0x2eeea7,_0x125c55){return db['MemberReport'][_0x0c9b('0x1f')](_0x30027c[_0x0c9b('0x20')],{'raw':_0x30027c[_0x0c9b('0x16')]?_0x30027c[_0x0c9b('0x16')][_0x0c9b('0x17')]===undefined?!![]:![]:!![]})[_0x0c9b('0x21')](function(_0x21a348){logger[_0x0c9b('0xc')](_0x0c9b('0x1e'),_0x30027c);logger[_0x0c9b('0xf')](_0x0c9b('0x1e'),_0x30027c,JSON['stringify'](_0x21a348));_0x2eeea7(_0x21a348);})['catch'](function(_0x9629be){logger[_0x0c9b('0x11')](_0x0c9b('0x1e'),_0x9629be[_0x0c9b('0x12')],_0x30027c);_0x125c55(_0x523fad[_0x0c9b('0x11')](0x1f4,_0x9629be[_0x0c9b('0x12')]));});});};exports[_0x0c9b('0x22')]=function(_0x265fae){var _0x414fda=this;return new Promise(function(_0xe8e702,_0x535ab7){return db[_0x0c9b('0x23')]['update'](_0x265fae[_0x0c9b('0x20')],{'raw':_0x265fae[_0x0c9b('0x16')]?_0x265fae[_0x0c9b('0x16')][_0x0c9b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x265fae[_0x0c9b('0x16')]?_0x265fae['options'][_0x0c9b('0x18')]||null:null,'attributes':_0x265fae['options']?_0x265fae['options'][_0x0c9b('0x19')]||null:null,'limit':_0x265fae['options']?_0x265fae[_0x0c9b('0x16')][_0x0c9b('0x24')]||null:null})[_0x0c9b('0x21')](function(_0x3df8b5){logger[_0x0c9b('0xc')](_0x0c9b('0x22'),_0x265fae);logger[_0x0c9b('0xf')](_0x0c9b('0x22'),_0x265fae,JSON[_0x0c9b('0x25')](_0x3df8b5));_0xe8e702(_0x3df8b5);})[_0x0c9b('0x1d')](function(_0x2514f6){logger[_0x0c9b('0x11')]('UpdateMemberReport',_0x2514f6[_0x0c9b('0x12')],_0x265fae);_0x535ab7(_0x414fda[_0x0c9b('0x11')](0x1f4,_0x2514f6[_0x0c9b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 4f79961..d181b9d 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 _0x976e=['../../components/auth/service','../../config/environment','./migration.controller','get','index','exports','util','path','express','Router','fs-extra'];(function(_0x521f15,_0x2eb9e7){var _0x309c82=function(_0x272fa3){while(--_0x272fa3){_0x521f15['push'](_0x521f15['shift']());}};_0x309c82(++_0x2eb9e7);}(_0x976e,0x1c9));var _0xe976=function(_0x362d5d,_0x44a708){_0x362d5d=_0x362d5d-0x0;var _0x54f2ec=_0x976e[_0x362d5d];return _0x54f2ec;};'use strict';var multer=require('multer');var util=require(_0xe976('0x0'));var path=require(_0xe976('0x1'));var timeout=require('connect-timeout');var express=require(_0xe976('0x2'));var router=express[_0xe976('0x3')]();var fs_extra=require(_0xe976('0x4'));var auth=require(_0xe976('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe976('0x6'));var controller=require(_0xe976('0x7'));router[_0xe976('0x8')]('/',controller[_0xe976('0x9')]);module[_0xe976('0xa')]=router; \ No newline at end of file +var _0xe407=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller','index','multer','util'];(function(_0x500938,_0x6852ec){var _0x577c5e=function(_0x445e75){while(--_0x445e75){_0x500938['push'](_0x500938['shift']());}};_0x577c5e(++_0x6852ec);}(_0xe407,0x181));var _0x7e40=function(_0x2a0bec,_0x1cab51){_0x2a0bec=_0x2a0bec-0x0;var _0xe48b0e=_0xe407[_0x2a0bec];return _0xe48b0e;};'use strict';var multer=require(_0x7e40('0x0'));var util=require(_0x7e40('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7e40('0x2'));var router=express[_0x7e40('0x3')]();var fs_extra=require(_0x7e40('0x4'));var auth=require(_0x7e40('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7e40('0x6'));var controller=require(_0x7e40('0x7'));router['get']('/',controller[_0x7e40('0x8')]);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 294a026..01c675f 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 _0x3a38=['STRING','sequelize','exports'];(function(_0x1130f5,_0x49ccc8){var _0x56fe43=function(_0x7c2b93){while(--_0x7c2b93){_0x1130f5['push'](_0x1130f5['shift']());}};_0x56fe43(++_0x49ccc8);}(_0x3a38,0x1c0));var _0x83a3=function(_0x5d1431,_0x5b7fa4){_0x5d1431=_0x5d1431-0x0;var _0x22c384=_0x3a38[_0x5d1431];return _0x22c384;};'use strict';var Sequelize=require(_0x83a3('0x0'));module[_0x83a3('0x1')]={'version':{'type':Sequelize[_0x83a3('0x2')],'unique':'version'}}; \ No newline at end of file +var _0x5092=['version','exports','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5092,0xa9));var _0x2509=function(_0x37a543,_0x36382d){_0x37a543=_0x37a543-0x0;var _0x33915c=_0x5092[_0x37a543];return _0x33915c;};'use strict';var Sequelize=require('sequelize');module[_0x2509('0x0')]={'version':{'type':Sequelize[_0x2509('0x1')],'unique':_0x2509('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 1c9acc0..7db319f 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 _0x66d9=['querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','offset','undefined','count','apply','reject','save','destroy','then','end','error','stack','send','index','rawAttributes','type','key','model','map','name','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','where','pick','VIRTUAL','filter','merge','options','Migration','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js'];(function(_0x64daf7,_0x3ce579){var _0x11d8d8=function(_0x3d986b){while(--_0x3d986b){_0x64daf7['push'](_0x64daf7['shift']());}};_0x11d8d8(++_0x3ce579);}(_0x66d9,0x1b9));var _0x966d=function(_0x3fed30,_0x34aff4){_0x3fed30=_0x3fed30-0x0;var _0x3e52b9=_0x66d9[_0x3fed30];return _0x3e52b9;};'use strict';var emlformat=require(_0x966d('0x0'));var rimraf=require(_0x966d('0x1'));var zipdir=require(_0x966d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x966d('0x3'));var moment=require(_0x966d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x966d('0x5'));var path=require(_0x966d('0x6'));var sox=require(_0x966d('0x7'));var csv=require(_0x966d('0x8'));var ejs=require(_0x966d('0x9'));var fs=require('fs');var fs_extra=require(_0x966d('0xa'));var _=require(_0x966d('0xb'));var squel=require(_0x966d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x966d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x966d('0xe'));var Papa=require(_0x966d('0xf'));var Redis=require('ioredis');var authService=require(_0x966d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x966d('0x11'));var hardwareService=require(_0x966d('0x12'));var logger=require('../../config/logger')(_0x966d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x966d('0x14'))['db'];function respondWithStatusCode(_0x290ed4,_0x48228b){_0x48228b=_0x48228b||0xcc;return function(_0x360638){if(_0x360638){return _0x290ed4[_0x966d('0x15')](_0x48228b);}return _0x290ed4[_0x966d('0x16')](_0x48228b)['end']();};}function respondWithResult(_0x3a845a,_0x1c1ac3){_0x1c1ac3=_0x1c1ac3||0xc8;return function(_0x19cb65){if(_0x19cb65){return _0x3a845a[_0x966d('0x16')](_0x1c1ac3)[_0x966d('0x17')](_0x19cb65);}};}function respondWithFilteredResult(_0x2fc285,_0x4638bc){return function(_0x45420d){if(_0x45420d){var _0x3f7ecf=typeof _0x4638bc[_0x966d('0x18')]===_0x966d('0x19')&&typeof _0x4638bc['limit']===_0x966d('0x19');var _0x4eb976=_0x45420d['count'];var _0x88b307=_0x3f7ecf?0x0:_0x4638bc['offset'];var _0x151007=_0x3f7ecf?_0x45420d[_0x966d('0x1a')]:_0x4638bc[_0x966d('0x18')]+_0x4638bc['limit'];var _0x24b575;if(_0x151007>=_0x4eb976){_0x151007=_0x4eb976;_0x24b575=0xc8;}else{_0x24b575=0xce;}_0x2fc285[_0x966d('0x16')](_0x24b575);return _0x2fc285['set']('Content-Range',_0x88b307+'-'+_0x151007+'/'+_0x4eb976)['json'](_0x45420d);}return null;};}function patchUpdates(_0x25fe13){return function(_0x4ee88){try{jsonpatch[_0x966d('0x1b')](_0x4ee88,_0x25fe13,!![]);}catch(_0x484fee){return BPromise[_0x966d('0x1c')](_0x484fee);}return _0x4ee88[_0x966d('0x1d')]();};}function saveUpdates(_0x12845b,_0x50b93a){return function(_0x3365f3){if(_0x3365f3){return _0x3365f3['update'](_0x12845b)['then'](function(_0x194478){return _0x194478;});}return null;};}function removeEntity(_0xac4e85,_0x3f0ed2){return function(_0x419dbf){if(_0x419dbf){return _0x419dbf[_0x966d('0x1e')]()[_0x966d('0x1f')](function(){_0xac4e85[_0x966d('0x16')](0xcc)[_0x966d('0x20')]();});}};}function handleEntityNotFound(_0x459001,_0xfee665){return function(_0x123582){if(!_0x123582){_0x459001[_0x966d('0x15')](0x194);}return _0x123582;};}function handleError(_0x4fb593,_0x3fbb55){_0x3fbb55=_0x3fbb55||0x1f4;return function(_0x7b2dad){logger[_0x966d('0x21')](_0x7b2dad[_0x966d('0x22')]);if(_0x7b2dad['name']){delete _0x7b2dad['name'];}_0x4fb593[_0x966d('0x16')](_0x3fbb55)[_0x966d('0x23')](_0x7b2dad);};}exports[_0x966d('0x24')]=function(_0x5f1042,_0x471c61){var _0x2c4338={},_0x1670d0={},_0x1d171d={'count':0x0,'rows':[]};var _0x39186f=_['map'](db['Migration'][_0x966d('0x25')],function(_0x29a31f){return{'name':_0x29a31f['fieldName'],'type':_0x29a31f[_0x966d('0x26')][_0x966d('0x27')]};});_0x1670d0[_0x966d('0x28')]=_[_0x966d('0x29')](_0x39186f,_0x966d('0x2a'));_0x1670d0[_0x966d('0x2b')]=_[_0x966d('0x2c')](_0x5f1042['query']);_0x1670d0[_0x966d('0x2d')]=_['intersection'](_0x1670d0[_0x966d('0x28')],_0x1670d0['query']);_0x2c4338[_0x966d('0x2e')]=_[_0x966d('0x2f')](_0x1670d0['model'],qs[_0x966d('0x30')](_0x5f1042[_0x966d('0x2b')][_0x966d('0x30')]));_0x2c4338[_0x966d('0x2e')]=_0x2c4338['attributes'][_0x966d('0x31')]?_0x2c4338[_0x966d('0x2e')]:_0x1670d0['model'];if(!_0x5f1042[_0x966d('0x2b')]['hasOwnProperty'](_0x966d('0x32'))){_0x2c4338['limit']=qs[_0x966d('0x33')](_0x5f1042[_0x966d('0x2b')][_0x966d('0x33')]);_0x2c4338[_0x966d('0x18')]=qs['offset'](_0x5f1042[_0x966d('0x2b')][_0x966d('0x18')]);}_0x2c4338[_0x966d('0x34')]=qs['sort'](_0x5f1042[_0x966d('0x2b')]['sort']);_0x2c4338[_0x966d('0x35')]=qs[_0x966d('0x2d')](_[_0x966d('0x36')](_0x5f1042['query'],_0x1670d0['filters']),_0x39186f);if(_0x5f1042[_0x966d('0x2b')]['filter']){_0x2c4338[_0x966d('0x35')]=_['merge'](_0x2c4338[_0x966d('0x35')],{'$or':_[_0x966d('0x29')](_0x39186f,function(_0x59c423){if(_0x59c423[_0x966d('0x26')]!==_0x966d('0x37')){var _0xe04d91={};_0xe04d91[_0x59c423[_0x966d('0x2a')]]={'$like':'%'+_0x5f1042['query'][_0x966d('0x38')]+'%'};return _0xe04d91;}})});}_0x2c4338=_[_0x966d('0x39')]({},_0x2c4338,_0x5f1042[_0x966d('0x3a')]);var _0x16a1f5={'where':_0x2c4338[_0x966d('0x35')]};return db[_0x966d('0x3b')][_0x966d('0x1a')](_0x16a1f5)['then'](function(_0x2874ec){_0x1d171d[_0x966d('0x1a')]=_0x2874ec;if(_0x5f1042[_0x966d('0x2b')][_0x966d('0x3c')]){_0x2c4338[_0x966d('0x3d')]=[{'all':!![]}];}return db[_0x966d('0x3b')][_0x966d('0x3e')](_0x2c4338);})[_0x966d('0x1f')](function(_0x1ed051){_0x1d171d[_0x966d('0x3f')]=_0x1ed051;return _0x1d171d;})[_0x966d('0x1f')](respondWithFilteredResult(_0x471c61,_0x2c4338))[_0x966d('0x40')](handleError(_0x471c61,null));}; \ No newline at end of file +var _0x9255=['then','destroy','stack','name','send','index','map','Migration','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x9255,0x19c));var _0x5925=function(_0xd3c515,_0x27b9bf){_0xd3c515=_0xd3c515-0x0;var _0x526fac=_0x9255[_0xd3c515];return _0x526fac;};'use strict';var emlformat=require(_0x5925('0x0'));var rimraf=require(_0x5925('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5925('0x2'));var rp=require(_0x5925('0x3'));var moment=require(_0x5925('0x4'));var BPromise=require(_0x5925('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5925('0x6'));var csv=require(_0x5925('0x7'));var ejs=require(_0x5925('0x8'));var fs=require('fs');var fs_extra=require(_0x5925('0x9'));var _=require(_0x5925('0xa'));var squel=require(_0x5925('0xb'));var crypto=require(_0x5925('0xc'));var jsforce=require(_0x5925('0xd'));var deskjs=require(_0x5925('0xe'));var toCsv=require(_0x5925('0x7'));var querystring=require(_0x5925('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5925('0x10'));var qs=require(_0x5925('0x11'));var as=require(_0x5925('0x12'));var hardwareService=require(_0x5925('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5925('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5925('0x15'));var db=require(_0x5925('0x16'))['db'];function respondWithStatusCode(_0x22ac93,_0x45012d){_0x45012d=_0x45012d||0xcc;return function(_0x1a1eea){if(_0x1a1eea){return _0x22ac93[_0x5925('0x17')](_0x45012d);}return _0x22ac93[_0x5925('0x18')](_0x45012d)[_0x5925('0x19')]();};}function respondWithResult(_0x23a073,_0x2de46b){_0x2de46b=_0x2de46b||0xc8;return function(_0x23ea54){if(_0x23ea54){return _0x23a073['status'](_0x2de46b)[_0x5925('0x1a')](_0x23ea54);}};}function respondWithFilteredResult(_0x8cb148,_0x3f44a1){return function(_0x307c4a){if(_0x307c4a){var _0x26a5c1=typeof _0x3f44a1[_0x5925('0x1b')]===_0x5925('0x1c')&&typeof _0x3f44a1[_0x5925('0x1d')]===_0x5925('0x1c');var _0x1e13e6=_0x307c4a['count'];var _0x9e8d18=_0x26a5c1?0x0:_0x3f44a1[_0x5925('0x1b')];var _0xd75951=_0x26a5c1?_0x307c4a[_0x5925('0x1e')]:_0x3f44a1['offset']+_0x3f44a1[_0x5925('0x1d')];var _0x222d70;if(_0xd75951>=_0x1e13e6){_0xd75951=_0x1e13e6;_0x222d70=0xc8;}else{_0x222d70=0xce;}_0x8cb148[_0x5925('0x18')](_0x222d70);return _0x8cb148[_0x5925('0x1f')](_0x5925('0x20'),_0x9e8d18+'-'+_0xd75951+'/'+_0x1e13e6)[_0x5925('0x1a')](_0x307c4a);}return null;};}function patchUpdates(_0x2db740){return function(_0x1482c5){try{jsonpatch[_0x5925('0x21')](_0x1482c5,_0x2db740,!![]);}catch(_0x3f1271){return BPromise['reject'](_0x3f1271);}return _0x1482c5[_0x5925('0x22')]();};}function saveUpdates(_0x2bc197,_0x3477e2){return function(_0x5c2a50){if(_0x5c2a50){return _0x5c2a50[_0x5925('0x23')](_0x2bc197)[_0x5925('0x24')](function(_0x545b12){return _0x545b12;});}return null;};}function removeEntity(_0x587ae6,_0x39d9e4){return function(_0x3e0de2){if(_0x3e0de2){return _0x3e0de2[_0x5925('0x25')]()['then'](function(){_0x587ae6[_0x5925('0x18')](0xcc)[_0x5925('0x19')]();});}};}function handleEntityNotFound(_0x3d8245,_0x501147){return function(_0x57c570){if(!_0x57c570){_0x3d8245[_0x5925('0x17')](0x194);}return _0x57c570;};}function handleError(_0x2f685d,_0x3b881c){_0x3b881c=_0x3b881c||0x1f4;return function(_0x4b0f96){logger['error'](_0x4b0f96[_0x5925('0x26')]);if(_0x4b0f96[_0x5925('0x27')]){delete _0x4b0f96['name'];}_0x2f685d[_0x5925('0x18')](_0x3b881c)[_0x5925('0x28')](_0x4b0f96);};}exports[_0x5925('0x29')]=function(_0x3f8a29,_0x1d842d){var _0x963021={},_0x42a721={},_0x5b8f57={'count':0x0,'rows':[]};var _0x9afe09=_[_0x5925('0x2a')](db[_0x5925('0x2b')][_0x5925('0x2c')],function(_0x4f95ee){return{'name':_0x4f95ee['fieldName'],'type':_0x4f95ee[_0x5925('0x2d')][_0x5925('0x2e')]};});_0x42a721['model']=_[_0x5925('0x2a')](_0x9afe09,_0x5925('0x27'));_0x42a721[_0x5925('0x2f')]=_[_0x5925('0x30')](_0x3f8a29[_0x5925('0x2f')]);_0x42a721[_0x5925('0x31')]=_[_0x5925('0x32')](_0x42a721[_0x5925('0x33')],_0x42a721[_0x5925('0x2f')]);_0x963021[_0x5925('0x34')]=_[_0x5925('0x32')](_0x42a721[_0x5925('0x33')],qs[_0x5925('0x35')](_0x3f8a29[_0x5925('0x2f')][_0x5925('0x35')]));_0x963021[_0x5925('0x34')]=_0x963021[_0x5925('0x34')][_0x5925('0x36')]?_0x963021['attributes']:_0x42a721[_0x5925('0x33')];if(!_0x3f8a29['query']['hasOwnProperty']('nolimit')){_0x963021[_0x5925('0x1d')]=qs['limit'](_0x3f8a29['query'][_0x5925('0x1d')]);_0x963021[_0x5925('0x1b')]=qs[_0x5925('0x1b')](_0x3f8a29[_0x5925('0x2f')]['offset']);}_0x963021['order']=qs[_0x5925('0x37')](_0x3f8a29[_0x5925('0x2f')][_0x5925('0x37')]);_0x963021['where']=qs['filters'](_['pick'](_0x3f8a29[_0x5925('0x2f')],_0x42a721[_0x5925('0x31')]),_0x9afe09);if(_0x3f8a29[_0x5925('0x2f')]['filter']){_0x963021[_0x5925('0x38')]=_[_0x5925('0x39')](_0x963021[_0x5925('0x38')],{'$or':_[_0x5925('0x2a')](_0x9afe09,function(_0x31ef3d){if(_0x31ef3d[_0x5925('0x2d')]!==_0x5925('0x3a')){var _0x4c5330={};_0x4c5330[_0x31ef3d[_0x5925('0x27')]]={'$like':'%'+_0x3f8a29['query']['filter']+'%'};return _0x4c5330;}})});}_0x963021=_['merge']({},_0x963021,_0x3f8a29[_0x5925('0x3b')]);var _0x5e53dd={'where':_0x963021[_0x5925('0x38')]};return db['Migration'][_0x5925('0x1e')](_0x5e53dd)[_0x5925('0x24')](function(_0x504835){_0x5b8f57[_0x5925('0x1e')]=_0x504835;if(_0x3f8a29[_0x5925('0x2f')][_0x5925('0x3c')]){_0x963021[_0x5925('0x3d')]=[{'all':!![]}];}return db[_0x5925('0x2b')][_0x5925('0x3e')](_0x963021);})[_0x5925('0x24')](function(_0x2ec0fa){_0x5b8f57['rows']=_0x2ec0fa;return _0x5b8f57;})['then'](respondWithFilteredResult(_0x1d842d,_0x963021))[_0x5925('0x3f')](handleError(_0x1d842d,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index b8168b1..7a2a494 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 _0xa392=['bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','exports','define','migrations','lodash','util','../../config/logger','api'];(function(_0x6d77ec,_0x338e01){var _0x567ac6=function(_0x57f402){while(--_0x57f402){_0x6d77ec['push'](_0x6d77ec['shift']());}};_0x567ac6(++_0x338e01);}(_0xa392,0x74));var _0x2a39=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xa392[_0x26462c];return _0x509a42;};'use strict';var _=require(_0x2a39('0x0'));var util=require(_0x2a39('0x1'));var logger=require(_0x2a39('0x2'))(_0x2a39('0x3'));var moment=require('moment');var BPromise=require(_0x2a39('0x4'));var rp=require(_0x2a39('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a39('0x6'));var config=require(_0x2a39('0x7'));var attributes=require(_0x2a39('0x8'));module[_0x2a39('0x9')]=function(_0x401359,_0x2629cc){return _0x401359[_0x2a39('0xa')]('Migration',attributes,{'tableName':_0x2a39('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ec4=['define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./migration.attributes','exports'];(function(_0x150d68,_0x13061c){var _0xd65277=function(_0x2c121e){while(--_0x2c121e){_0x150d68['push'](_0x150d68['shift']());}};_0xd65277(++_0x13061c);}(_0x3ec4,0x1e4));var _0x43ec=function(_0xf5da60,_0x4f7b51){_0xf5da60=_0xf5da60-0x0;var _0x216adc=_0x3ec4[_0xf5da60];return _0x216adc;};'use strict';var _=require(_0x43ec('0x0'));var util=require(_0x43ec('0x1'));var logger=require(_0x43ec('0x2'))(_0x43ec('0x3'));var moment=require(_0x43ec('0x4'));var BPromise=require(_0x43ec('0x5'));var rp=require(_0x43ec('0x6'));var fs=require('fs');var path=require(_0x43ec('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x43ec('0x8'));module[_0x43ec('0x9')]=function(_0x44bdf8,_0x79a431){return _0x44bdf8[_0x43ec('0xa')](_0x43ec('0xb'),attributes,{'tableName':_0x43ec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 193d257..e489e9a 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 _0x9f94=['debug','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','Migration,\x20%s,\x20%s','request\x20sent'];(function(_0x4f8560,_0x27f89c){var _0x54ef01=function(_0x206e65){while(--_0x206e65){_0x4f8560['push'](_0x4f8560['shift']());}};_0x54ef01(++_0x27f89c);}(_0x9f94,0x1e7));var _0x49f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9f94[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var moment=require(_0x49f9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49f9('0x3'));var db=require(_0x49f9('0x4'))['db'];var utils=require(_0x49f9('0x5'));var logger=require(_0x49f9('0x6'))(_0x49f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x49f9('0x8'));var client=jayson[_0x49f9('0x9')][_0x49f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fdbf1,_0x10ada8,_0x2e0928){return new BPromise(function(_0x355683,_0x2eddd1){return client['request'](_0x2fdbf1,_0x2e0928)['then'](function(_0x1628bb){logger['info'](_0x49f9('0xb'),_0x10ada8,_0x49f9('0xc'));logger[_0x49f9('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'),JSON['stringify'](_0x1628bb));if(_0x1628bb[_0x49f9('0xe')]){if(_0x1628bb[_0x49f9('0xe')][_0x49f9('0xf')]===0x1f4){logger[_0x49f9('0xe')]('Migration,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error'][_0x49f9('0x10')]);return _0x2eddd1(_0x1628bb[_0x49f9('0xe')][_0x49f9('0x10')]);}logger[_0x49f9('0xe')]('Migration,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error']['message']);return _0x355683(_0x1628bb[_0x49f9('0xe')]['message']);}else{logger[_0x49f9('0x11')]('Migration,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'));_0x355683(_0x1628bb[_0x49f9('0x12')]['message']);}})[_0x49f9('0x13')](function(_0x1a2026){logger[_0x49f9('0xe')](_0x49f9('0xb'),_0x10ada8,_0x1a2026);_0x2eddd1(_0x1a2026);});});} \ No newline at end of file +var _0x7980=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2ea3c3,_0x13e26b){var _0x15ea17=function(_0x3a1ce7){while(--_0x3a1ce7){_0x2ea3c3['push'](_0x2ea3c3['shift']());}};_0x15ea17(++_0x13e26b);}(_0x7980,0xab));var _0x0798=function(_0x2d563d,_0x18d7f8){_0x2d563d=_0x2d563d-0x0;var _0x15601a=_0x7980[_0x2d563d];return _0x15601a;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var moment=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var rs=require(_0x0798('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0798('0x5'))['db'];var utils=require(_0x0798('0x6'));var logger=require(_0x0798('0x7'))(_0x0798('0x8'));var config=require(_0x0798('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0798('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e534f,_0x34f808,_0x467859){return new BPromise(function(_0x54da10,_0x5151b3){return client[_0x0798('0xb')](_0x1e534f,_0x467859)[_0x0798('0xc')](function(_0x301a55){logger[_0x0798('0xd')](_0x0798('0xe'),_0x34f808,_0x0798('0xf'));logger[_0x0798('0x10')](_0x0798('0x11'),_0x34f808,_0x0798('0xf'),JSON[_0x0798('0x12')](_0x301a55));if(_0x301a55['error']){if(_0x301a55[_0x0798('0x13')][_0x0798('0x14')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x34f808,_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);return _0x5151b3(_0x301a55[_0x0798('0x13')][_0x0798('0x15')]);}logger[_0x0798('0x13')](_0x0798('0xe'),_0x34f808,_0x301a55[_0x0798('0x13')]['message']);return _0x54da10(_0x301a55['error'][_0x0798('0x15')]);}else{logger[_0x0798('0xd')]('Migration,\x20%s,\x20%s',_0x34f808,'request\x20sent');_0x54da10(_0x301a55[_0x0798('0x16')][_0x0798('0x15')]);}})[_0x0798('0x17')](function(_0x5dc617){logger['error'](_0x0798('0xe'),_0x34f808,_0x5dc617);_0x5151b3(_0x5dc617);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index c48aa20..fdad9d2 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 _0x66fa=['isAuthenticated','index','get','/:id','post','create','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd35184,_0x46dc7a){var _0x42daa4=function(_0x3430b7){while(--_0x3430b7){_0xd35184['push'](_0xd35184['shift']());}};_0x42daa4(++_0x46dc7a);}(_0x66fa,0x117));var _0xa66f=function(_0x26465f,_0x382bb8){_0x26465f=_0x26465f-0x0;var _0x45d340=_0x66fa[_0x26465f];return _0x45d340;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./network.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller[_0xa66f('0xe')]);router['put'](_0xa66f('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0xf')]=router; \ No newline at end of file +var _0xd92a=['get','index','/:id','isAuthenticated','show','post','create','delete','exports','util','path','connect-timeout','Router','fs-extra','./network.controller'];(function(_0x2353fe,_0x4b0bca){var _0x4d43f6=function(_0x5d0bd9){while(--_0x5d0bd9){_0x2353fe['push'](_0x2353fe['shift']());}};_0x4d43f6(++_0x4b0bca);}(_0xd92a,0x1bc));var _0xad92=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd92a[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0xad92('0x0'));var path=require(_0xad92('0x1'));var timeout=require(_0xad92('0x2'));var express=require('express');var router=express[_0xad92('0x3')]();var fs_extra=require(_0xad92('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xad92('0x5'));router[_0xad92('0x6')]('/',auth['isAuthenticated'](),controller[_0xad92('0x7')]);router[_0xad92('0x6')](_0xad92('0x8'),auth[_0xad92('0x9')](),controller[_0xad92('0xa')]);router[_0xad92('0xb')]('/',auth[_0xad92('0x9')](),controller[_0xad92('0xc')]);router['put'](_0xad92('0x8'),auth[_0xad92('0x9')](),controller['update']);router[_0xad92('0xd')](_0xad92('0x8'),auth[_0xad92('0x9')](),controller['destroy']);module[_0xad92('0xe')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 80afc4d..4649a4a 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 _0x3e28=['STRING','sequelize','exports','stun'];(function(_0x50d713,_0x551e8e){var _0x58b623=function(_0x373c92){while(--_0x373c92){_0x50d713['push'](_0x50d713['shift']());}};_0x58b623(++_0x551e8e);}(_0x3e28,0xc9));var _0x83e2=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x3e28[_0x176329];return _0x31997c;};'use strict';var Sequelize=require(_0x83e2('0x0'));module[_0x83e2('0x1')]={'type':{'type':Sequelize['ENUM']('localnet','externip',_0x83e2('0x2'),'turn')},'value':{'type':Sequelize[_0x83e2('0x3')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x83e2('0x3')]}}; \ No newline at end of file +var _0x133d=['STRING','sequelize','exports','ENUM','externip','stun','turn'];(function(_0x3eb969,_0x11c187){var _0x5e62e0=function(_0x4eb12d){while(--_0x4eb12d){_0x3eb969['push'](_0x3eb969['shift']());}};_0x5e62e0(++_0x11c187);}(_0x133d,0x189));var _0xd133=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0x133d[_0x55c1f0];return _0x1530fa;};'use strict';var Sequelize=require(_0xd133('0x0'));module[_0xd133('0x1')]={'type':{'type':Sequelize[_0xd133('0x2')]('localnet',_0xd133('0x3'),_0xd133('0x4'),_0xd133('0x5'))},'value':{'type':Sequelize[_0xd133('0x6')]},'username':{'type':Sequelize[_0xd133('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 99a2316..2eb044f 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 _0x0261=['index','map','Network','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','fields','find','create','transaction','body','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','res_stun_monitor.so','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','render','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','sequelize','/etc/asterisk/stun_xcally.conf','TURN','format','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','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','jayson/promise','client','request','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','set','Content-Range','apply','reject','save','then','stack','name','send'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0x0261,0x11b));var _0x1026=function(_0x4257b6,_0x2348c7){_0x4257b6=_0x4257b6-0x0;var _0x4ad68c=_0x0261[_0x4257b6];return _0x4ad68c;};'use strict';var emlformat=require(_0x1026('0x0'));var rimraf=require(_0x1026('0x1'));var zipdir=require(_0x1026('0x2'));var jsonpatch=require(_0x1026('0x3'));var rp=require(_0x1026('0x4'));var moment=require(_0x1026('0x5'));var BPromise=require(_0x1026('0x6'));var Mustache=require(_0x1026('0x7'));var util=require(_0x1026('0x8'));var path=require(_0x1026('0x9'));var sox=require(_0x1026('0xa'));var csv=require(_0x1026('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1026('0xc'));var squel=require(_0x1026('0xd'));var crypto=require('crypto');var jsforce=require(_0x1026('0xe'));var deskjs=require(_0x1026('0xf'));var toCsv=require(_0x1026('0xb'));var querystring=require('querystring');var Papa=require(_0x1026('0x10'));var Redis=require(_0x1026('0x11'));var authService=require(_0x1026('0x12'));var qs=require(_0x1026('0x13'));var as=require(_0x1026('0x14'));var hardwareService=require(_0x1026('0x15'));var logger=require(_0x1026('0x16'))(_0x1026('0x17'));var utils=require('../../config/utils');var config=require(_0x1026('0x18'));var licenseUtil=require(_0x1026('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1026('0x1a'));var client=jayson[_0x1026('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57a4fc,_0xa246a2,_0x5e7649,_0x579c3d){return new BPromise(function(_0x49f1f3,_0x1c73d7){var _0x15dee8=_0x579c3d||client;return _0x15dee8[_0x1026('0x1c')](_0x57a4fc,_0x5e7649)['then'](function(_0x429d6d){logger[_0x1026('0x1d')](_0x1026('0x1e'),_0xa246a2,_0x1026('0x1f'));logger['debug'](_0x1026('0x20'),_0xa246a2,_0x1026('0x1f'),JSON['stringify'](_0x429d6d));if(_0x429d6d[_0x1026('0x21')]){if(_0x429d6d[_0x1026('0x21')][_0x1026('0x22')]===0x1f4){logger[_0x1026('0x21')](_0x1026('0x1e'),_0xa246a2,_0x429d6d[_0x1026('0x21')]['message']);return _0x1c73d7(_0x429d6d['error'][_0x1026('0x23')]);}logger[_0x1026('0x21')](_0x1026('0x1e'),_0xa246a2,_0x429d6d[_0x1026('0x21')]['message']);return _0x49f1f3(_0x429d6d[_0x1026('0x21')][_0x1026('0x23')]);}else{logger[_0x1026('0x1d')](_0x1026('0x1e'),_0xa246a2,_0x1026('0x1f'));_0x49f1f3(_0x429d6d[_0x1026('0x24')][_0x1026('0x23')]);}})[_0x1026('0x25')](function(_0x16af8e){logger[_0x1026('0x21')](_0x1026('0x1e'),_0xa246a2,_0x16af8e);_0x1c73d7(_0x16af8e);});});}function respondWithStatusCode(_0x2205e7,_0x34b2ab){_0x34b2ab=_0x34b2ab||0xcc;return function(_0x23640b){if(_0x23640b){return _0x2205e7[_0x1026('0x26')](_0x34b2ab);}return _0x2205e7[_0x1026('0x27')](_0x34b2ab)[_0x1026('0x28')]();};}function respondWithResult(_0x516033,_0x464d1d){_0x464d1d=_0x464d1d||0xc8;return function(_0x243d1a){if(_0x243d1a){return _0x516033[_0x1026('0x27')](_0x464d1d)[_0x1026('0x29')](_0x243d1a);}};}function respondWithFilteredResult(_0x391aa8,_0x4eaa69){return function(_0x358ee1){if(_0x358ee1){var _0x5a7579=typeof _0x4eaa69[_0x1026('0x2a')]===_0x1026('0x2b')&&typeof _0x4eaa69['limit']===_0x1026('0x2b');var _0xd96c19=_0x358ee1['count'];var _0x267430=_0x5a7579?0x0:_0x4eaa69[_0x1026('0x2a')];var _0xfe4ee7=_0x5a7579?_0x358ee1['count']:_0x4eaa69[_0x1026('0x2a')]+_0x4eaa69['limit'];var _0x13309b;if(_0xfe4ee7>=_0xd96c19){_0xfe4ee7=_0xd96c19;_0x13309b=0xc8;}else{_0x13309b=0xce;}_0x391aa8[_0x1026('0x27')](_0x13309b);return _0x391aa8[_0x1026('0x2c')](_0x1026('0x2d'),_0x267430+'-'+_0xfe4ee7+'/'+_0xd96c19)[_0x1026('0x29')](_0x358ee1);}return null;};}function patchUpdates(_0x303085){return function(_0x5e8fe5){try{jsonpatch[_0x1026('0x2e')](_0x5e8fe5,_0x303085,!![]);}catch(_0x707e75){return BPromise[_0x1026('0x2f')](_0x707e75);}return _0x5e8fe5[_0x1026('0x30')]();};}function saveUpdates(_0x3bd8aa,_0x45eb17){return function(_0x1f80cc){if(_0x1f80cc){return _0x1f80cc['update'](_0x3bd8aa)[_0x1026('0x31')](function(_0x2165f9){return _0x2165f9;});}return null;};}function removeEntity(_0x14d221,_0x4f386b){return function(_0x2e2896){if(_0x2e2896){return _0x2e2896['destroy']()[_0x1026('0x31')](function(){_0x14d221[_0x1026('0x27')](0xcc)[_0x1026('0x28')]();});}};}function handleEntityNotFound(_0x2a80a3,_0x2c9226){return function(_0x3f4ac5){if(!_0x3f4ac5){_0x2a80a3[_0x1026('0x26')](0x194);}return _0x3f4ac5;};}function handleError(_0x519443,_0x1f1b8e){_0x1f1b8e=_0x1f1b8e||0x1f4;return function(_0x643235){logger['error'](_0x643235[_0x1026('0x32')]);if(_0x643235['name']){delete _0x643235[_0x1026('0x33')];}_0x519443[_0x1026('0x27')](_0x1f1b8e)[_0x1026('0x34')](_0x643235);};}exports[_0x1026('0x35')]=function(_0x6c4d05,_0x5a6e8b){var _0x12befd={},_0x431c69={},_0x301c1b={'count':0x0,'rows':[]};var _0x2b07ea=_[_0x1026('0x36')](db[_0x1026('0x37')][_0x1026('0x38')],function(_0x3a911f){return{'name':_0x3a911f[_0x1026('0x39')],'type':_0x3a911f['type'][_0x1026('0x3a')]};});_0x431c69[_0x1026('0x3b')]=_[_0x1026('0x36')](_0x2b07ea,'name');_0x431c69[_0x1026('0x3c')]=_[_0x1026('0x3d')](_0x6c4d05['query']);_0x431c69[_0x1026('0x3e')]=_[_0x1026('0x3f')](_0x431c69[_0x1026('0x3b')],_0x431c69['query']);_0x12befd[_0x1026('0x40')]=_[_0x1026('0x3f')](_0x431c69['model'],qs['fields'](_0x6c4d05[_0x1026('0x3c')]['fields']));_0x12befd[_0x1026('0x40')]=_0x12befd[_0x1026('0x40')][_0x1026('0x41')]?_0x12befd[_0x1026('0x40')]:_0x431c69[_0x1026('0x3b')];if(!_0x6c4d05[_0x1026('0x3c')][_0x1026('0x42')](_0x1026('0x43'))){_0x12befd[_0x1026('0x44')]=qs[_0x1026('0x44')](_0x6c4d05[_0x1026('0x3c')][_0x1026('0x44')]);_0x12befd[_0x1026('0x2a')]=qs['offset'](_0x6c4d05[_0x1026('0x3c')][_0x1026('0x2a')]);}_0x12befd['order']=qs[_0x1026('0x45')](_0x6c4d05[_0x1026('0x3c')][_0x1026('0x45')]);_0x12befd[_0x1026('0x46')]=qs[_0x1026('0x3e')](_[_0x1026('0x47')](_0x6c4d05[_0x1026('0x3c')],_0x431c69[_0x1026('0x3e')]),_0x2b07ea);if(_0x6c4d05['query'][_0x1026('0x48')]){_0x12befd['where']=_[_0x1026('0x49')](_0x12befd['where'],{'$or':_[_0x1026('0x36')](_0x2b07ea,function(_0x40c31d){if(_0x40c31d[_0x1026('0x4a')]!==_0x1026('0x4b')){var _0x12a38e={};_0x12a38e[_0x40c31d[_0x1026('0x33')]]={'$like':'%'+_0x6c4d05[_0x1026('0x3c')][_0x1026('0x48')]+'%'};return _0x12a38e;}})});}_0x12befd=_[_0x1026('0x49')]({},_0x12befd,_0x6c4d05[_0x1026('0x4c')]);var _0x4fc8da={'where':_0x12befd[_0x1026('0x46')]};return db[_0x1026('0x37')]['count'](_0x4fc8da)['then'](function(_0x4befc9){_0x301c1b[_0x1026('0x4d')]=_0x4befc9;if(_0x6c4d05[_0x1026('0x3c')][_0x1026('0x4e')]){_0x12befd[_0x1026('0x4f')]=[{'all':!![]}];}return db[_0x1026('0x37')][_0x1026('0x50')](_0x12befd);})[_0x1026('0x31')](function(_0x285dd4){_0x301c1b[_0x1026('0x51')]=_0x285dd4;return _0x301c1b;})[_0x1026('0x31')](respondWithFilteredResult(_0x5a6e8b,_0x12befd))[_0x1026('0x25')](handleError(_0x5a6e8b,null));};exports[_0x1026('0x52')]=function(_0x25d25a,_0x463f6e){var _0xb6df2d={'raw':!![],'where':{'id':_0x25d25a[_0x1026('0x53')]['id']}},_0x1ec17d={};_0x1ec17d[_0x1026('0x3b')]=_[_0x1026('0x3d')](db[_0x1026('0x37')]['rawAttributes']);_0x1ec17d[_0x1026('0x3c')]=_[_0x1026('0x3d')](_0x25d25a['query']);_0x1ec17d[_0x1026('0x3e')]=_['intersection'](_0x1ec17d['model'],_0x1ec17d[_0x1026('0x3c')]);_0xb6df2d[_0x1026('0x40')]=_[_0x1026('0x3f')](_0x1ec17d['model'],qs['fields'](_0x25d25a[_0x1026('0x3c')][_0x1026('0x54')]));_0xb6df2d[_0x1026('0x40')]=_0xb6df2d[_0x1026('0x40')][_0x1026('0x41')]?_0xb6df2d[_0x1026('0x40')]:_0x1ec17d[_0x1026('0x3b')];if(_0x25d25a[_0x1026('0x3c')]['includeAll']){_0xb6df2d[_0x1026('0x4f')]=[{'all':!![]}];}_0xb6df2d=_['merge']({},_0xb6df2d,_0x25d25a[_0x1026('0x4c')]);return db[_0x1026('0x37')][_0x1026('0x55')](_0xb6df2d)[_0x1026('0x31')](handleEntityNotFound(_0x463f6e,null))[_0x1026('0x31')](respondWithResult(_0x463f6e,null))[_0x1026('0x25')](handleError(_0x463f6e,null));};exports[_0x1026('0x56')]=function(_0x375bac,_0x4dd099,_0x29d3ff){var _0x26ee25;return db['sequelize'][_0x1026('0x57')](function(_0x421324){return db['Network'][_0x1026('0x56')](_0x375bac['body'],{'raw':!![]})[_0x1026('0x31')](function(_0x53a7d3){_0x26ee25=_0x53a7d3;return db['Network'][_0x1026('0x50')]({'where':{'type':_0x375bac[_0x1026('0x58')][_0x1026('0x4a')]},'raw':!![]});})['then'](function(_0x14dfa3){if(_0x26ee25[_0x1026('0x4a')][_0x1026('0x59')]()==_0x1026('0x5a')){var _0x1a3ffc=fs[_0x1026('0x5b')](path[_0x1026('0x5c')](config['root'],_0x1026('0x5d')),_0x1026('0x5e'));var _0x4fc149=ejs['render'](_0x1a3ffc,{'networks':_0x14dfa3||[]});fs[_0x1026('0x5f')]('/etc/asterisk/stun_xcally.conf',_0x4fc149);return respondWithRpcPromise(_0x1026('0x60'),_0x1026('0x56'),{'module':_0x1026('0x61')});}else if(_0x26ee25[_0x1026('0x4a')][_0x1026('0x59')]()=='TURN'){var _0x5d93c0=fs['readFileSync'](path[_0x1026('0x5c')](config[_0x1026('0x62')],_0x1026('0x63')),_0x1026('0x5e'));var _0x3dcc4b=ejs['render'](_0x5d93c0,{'networks':_0x14dfa3||[]});fs[_0x1026('0x5f')](_0x1026('0x64'),_0x3dcc4b);return respondWithRpcPromise('Reload',_0x1026('0x56'),{'module':_0x1026('0x61')});}else{var _0x35d114=fs[_0x1026('0x5b')](path[_0x1026('0x5c')](config[_0x1026('0x62')],_0x1026('0x65')),_0x1026('0x5e'));var _0x3663bb=ejs[_0x1026('0x66')](_0x35d114,{'networks':_0x14dfa3||[]});fs[_0x1026('0x5f')](util['format'](_0x1026('0x67'),_0x375bac[_0x1026('0x58')]['type'][_0x1026('0x68')]()),_0x3663bb);return respondWithRpcPromise('Reload','create',{'module':_0x1026('0x69')});}return null;})[_0x1026('0x31')](function(){return _0x26ee25;});})['then'](respondWithResult(_0x4dd099,0xc9))[_0x1026('0x25')](handleError(_0x4dd099,null));};exports[_0x1026('0x6a')]=function(_0x404cc0,_0x4c157f,_0x4adada){var _0x1983d3;return db[_0x1026('0x6b')]['transaction'](function(_0x2c1774){return db[_0x1026('0x37')]['find']({'where':{'id':_0x404cc0[_0x1026('0x53')]['id']}})['then'](handleEntityNotFound(_0x4c157f,null))['then'](saveUpdates(_0x404cc0[_0x1026('0x58')],null))['then'](function(_0x1e247d){if(_0x1e247d){_0x1983d3=_0x1e247d;return db[_0x1026('0x37')][_0x1026('0x50')]({'where':{'type':_0x1983d3[_0x1026('0x4a')]},'raw':!![]});}return null;})[_0x1026('0x31')](function(_0x2d6852){if(_0x1983d3['type']['toUpperCase']()=='STUN'){var _0x1de5ad=fs['readFileSync'](path[_0x1026('0x5c')](config[_0x1026('0x62')],_0x1026('0x5d')),'utf8');var _0x5721da=ejs[_0x1026('0x66')](_0x1de5ad,{'networks':_0x2d6852||[]});fs[_0x1026('0x5f')](_0x1026('0x6c'),_0x5721da);return respondWithRpcPromise(_0x1026('0x60'),_0x1026('0x6a'),{'module':_0x1026('0x61')});}else if(_0x1983d3[_0x1026('0x4a')][_0x1026('0x59')]()==_0x1026('0x6d')){var _0x434a25=fs[_0x1026('0x5b')](path[_0x1026('0x5c')](config['root'],_0x1026('0x63')),_0x1026('0x5e'));var _0x50c515=ejs[_0x1026('0x66')](_0x434a25,{'networks':_0x2d6852||[]});fs[_0x1026('0x5f')]('/etc/asterisk/turn_xcally.conf',_0x50c515);return respondWithRpcPromise('Reload',_0x1026('0x6a'),{'module':_0x1026('0x61')});}else{var _0x573792=fs['readFileSync'](path[_0x1026('0x5c')](config[_0x1026('0x62')],_0x1026('0x65')),_0x1026('0x5e'));var _0x29d5d2=ejs[_0x1026('0x66')](_0x573792,{'networks':_0x2d6852||[]});fs['writeFileSync'](util[_0x1026('0x6e')](_0x1026('0x67'),_0x404cc0[_0x1026('0x58')][_0x1026('0x4a')][_0x1026('0x68')]()),_0x29d5d2);return respondWithRpcPromise(_0x1026('0x60'),'update',{'module':'chan_sip.so'});}return null;})[_0x1026('0x31')](function(_0x309d8c){if(_0x309d8c){return _0x1983d3;}return null;});})['then'](respondWithResult(_0x4c157f,null))[_0x1026('0x25')](handleError(_0x4c157f,null));};exports[_0x1026('0x6f')]=function(_0x2072bf,_0x5cc84b,_0x36b1ea){var _0x2913d3;return db[_0x1026('0x37')]['find']({'where':{'id':_0x2072bf[_0x1026('0x53')]['id']}})[_0x1026('0x31')](function(_0x31768f){_0x2913d3=_0x31768f;return _0x31768f;})[_0x1026('0x31')](handleEntityNotFound(_0x5cc84b,null))[_0x1026('0x31')](removeEntity(_0x5cc84b,null))[_0x1026('0x31')](function(){if(_0x2913d3){return db[_0x1026('0x37')]['findAll']({'where':{'type':_0x2913d3[_0x1026('0x4a')]},'raw':!![]});}})[_0x1026('0x31')](function(_0x1d9f72){if(_0x2913d3[_0x1026('0x4a')][_0x1026('0x59')]()=='STUN'){var _0x3b1630=fs[_0x1026('0x5b')](path[_0x1026('0x5c')](config[_0x1026('0x62')],_0x1026('0x5d')),'utf8');var _0x6dd819=ejs[_0x1026('0x66')](_0x3b1630,{'networks':_0x1d9f72||[]});fs[_0x1026('0x5f')](_0x1026('0x6c'),_0x6dd819);return respondWithRpcPromise(_0x1026('0x60'),'destroy',{'module':_0x1026('0x61')});}else if(_0x2913d3[_0x1026('0x4a')][_0x1026('0x59')]()==_0x1026('0x6d')){var _0x47a88b=fs[_0x1026('0x5b')](path[_0x1026('0x5c')](config[_0x1026('0x62')],_0x1026('0x63')),_0x1026('0x5e'));var _0x1b3bc1=ejs[_0x1026('0x66')](_0x47a88b,{'networks':_0x1d9f72||[]});fs[_0x1026('0x5f')]('/etc/asterisk/turn_xcally.conf',_0x1b3bc1);return respondWithRpcPromise(_0x1026('0x60'),'destroy',{'module':_0x1026('0x61')});}else{var _0x5f3498=fs[_0x1026('0x5b')](path[_0x1026('0x5c')](config['root'],_0x1026('0x65')),_0x1026('0x5e'));var _0x3b3a42=ejs['render'](_0x5f3498,{'networks':_0x1d9f72||[]});fs[_0x1026('0x5f')](util['format'](_0x1026('0x67'),_0x2072bf['body'][_0x1026('0x4a')][_0x1026('0x68')]()),_0x3b3a42);return respondWithRpcPromise(_0x1026('0x60'),_0x1026('0x6f'),{'module':_0x1026('0x69')});}return null;})[_0x1026('0x25')](handleError(_0x5cc84b,null));}; \ No newline at end of file +var _0x88eb=['Reload','res_stun_monitor.so','TURN','/etc/asterisk/turn_xcally.conf','format','chan_sip.so','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','server/files/templates/turn_multiple.ejs','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','Network','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','length','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88eb,0x76));var _0xb88e=function(_0x4d8f8b,_0x4bc669){_0x4d8f8b=_0x4d8f8b-0x0;var _0x4156b6=_0x88eb[_0x4d8f8b];return _0x4156b6;};'use strict';var emlformat=require(_0xb88e('0x0'));var rimraf=require(_0xb88e('0x1'));var zipdir=require(_0xb88e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb88e('0x3'));var moment=require('moment');var BPromise=require(_0xb88e('0x4'));var Mustache=require(_0xb88e('0x5'));var util=require(_0xb88e('0x6'));var path=require(_0xb88e('0x7'));var sox=require(_0xb88e('0x8'));var csv=require(_0xb88e('0x9'));var ejs=require(_0xb88e('0xa'));var fs=require('fs');var fs_extra=require(_0xb88e('0xb'));var _=require(_0xb88e('0xc'));var squel=require(_0xb88e('0xd'));var crypto=require(_0xb88e('0xe'));var jsforce=require(_0xb88e('0xf'));var deskjs=require(_0xb88e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb88e('0x11'));var Papa=require('papaparse');var Redis=require(_0xb88e('0x12'));var authService=require(_0xb88e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb88e('0x14'));var hardwareService=require(_0xb88e('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb88e('0x16'));var licenseUtil=require(_0xb88e('0x17'));var db=require(_0xb88e('0x18'))['db'];var jayson=require(_0xb88e('0x19'));var client=jayson[_0xb88e('0x1a')][_0xb88e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1bd062,_0x5adf94,_0x43f552,_0x57c4f1){return new BPromise(function(_0x998c0c,_0x49f646){var _0x490331=_0x57c4f1||client;return _0x490331[_0xb88e('0x1c')](_0x1bd062,_0x43f552)['then'](function(_0x4281fa){logger[_0xb88e('0x1d')](_0xb88e('0x1e'),_0x5adf94,_0xb88e('0x1f'));logger[_0xb88e('0x20')]('Network,\x20%s,\x20%s,\x20%s',_0x5adf94,'request\x20sent',JSON[_0xb88e('0x21')](_0x4281fa));if(_0x4281fa[_0xb88e('0x22')]){if(_0x4281fa[_0xb88e('0x22')][_0xb88e('0x23')]===0x1f4){logger[_0xb88e('0x22')]('Network,\x20%s,\x20%s',_0x5adf94,_0x4281fa[_0xb88e('0x22')][_0xb88e('0x24')]);return _0x49f646(_0x4281fa['error'][_0xb88e('0x24')]);}logger[_0xb88e('0x22')](_0xb88e('0x1e'),_0x5adf94,_0x4281fa['error'][_0xb88e('0x24')]);return _0x998c0c(_0x4281fa['error'][_0xb88e('0x24')]);}else{logger['info'](_0xb88e('0x1e'),_0x5adf94,'request\x20sent');_0x998c0c(_0x4281fa['result'][_0xb88e('0x24')]);}})[_0xb88e('0x25')](function(_0x5dfe8c){logger[_0xb88e('0x22')]('Network,\x20%s,\x20%s',_0x5adf94,_0x5dfe8c);_0x49f646(_0x5dfe8c);});});}function respondWithStatusCode(_0x39854c,_0x593c2e){_0x593c2e=_0x593c2e||0xcc;return function(_0x4c6d8d){if(_0x4c6d8d){return _0x39854c[_0xb88e('0x26')](_0x593c2e);}return _0x39854c['status'](_0x593c2e)[_0xb88e('0x27')]();};}function respondWithResult(_0x39611f,_0x4d2055){_0x4d2055=_0x4d2055||0xc8;return function(_0x17397f){if(_0x17397f){return _0x39611f[_0xb88e('0x28')](_0x4d2055)[_0xb88e('0x29')](_0x17397f);}};}function respondWithFilteredResult(_0xdc28db,_0x313524){return function(_0x4d0648){if(_0x4d0648){var _0x1c202a=typeof _0x313524[_0xb88e('0x2a')]==='undefined'&&typeof _0x313524[_0xb88e('0x2b')]===_0xb88e('0x2c');var _0x34e96b=_0x4d0648['count'];var _0x39be73=_0x1c202a?0x0:_0x313524['offset'];var _0x4f1552=_0x1c202a?_0x4d0648[_0xb88e('0x2d')]:_0x313524[_0xb88e('0x2a')]+_0x313524[_0xb88e('0x2b')];var _0x388552;if(_0x4f1552>=_0x34e96b){_0x4f1552=_0x34e96b;_0x388552=0xc8;}else{_0x388552=0xce;}_0xdc28db['status'](_0x388552);return _0xdc28db[_0xb88e('0x2e')](_0xb88e('0x2f'),_0x39be73+'-'+_0x4f1552+'/'+_0x34e96b)[_0xb88e('0x29')](_0x4d0648);}return null;};}function patchUpdates(_0x332ba7){return function(_0x50be93){try{jsonpatch[_0xb88e('0x30')](_0x50be93,_0x332ba7,!![]);}catch(_0x59b12c){return BPromise['reject'](_0x59b12c);}return _0x50be93['save']();};}function saveUpdates(_0x54f928,_0x1d0de5){return function(_0x483cf9){if(_0x483cf9){return _0x483cf9[_0xb88e('0x31')](_0x54f928)[_0xb88e('0x32')](function(_0xa77065){return _0xa77065;});}return null;};}function removeEntity(_0x2a1966,_0x2fbd0f){return function(_0x1a7550){if(_0x1a7550){return _0x1a7550[_0xb88e('0x33')]()[_0xb88e('0x32')](function(){_0x2a1966['status'](0xcc)[_0xb88e('0x27')]();});}};}function handleEntityNotFound(_0x3a30f4,_0x247e38){return function(_0x6c6e5d){if(!_0x6c6e5d){_0x3a30f4['sendStatus'](0x194);}return _0x6c6e5d;};}function handleError(_0x16b47d,_0x141c8d){_0x141c8d=_0x141c8d||0x1f4;return function(_0x40a945){logger[_0xb88e('0x22')](_0x40a945[_0xb88e('0x34')]);if(_0x40a945[_0xb88e('0x35')]){delete _0x40a945['name'];}_0x16b47d['status'](_0x141c8d)[_0xb88e('0x36')](_0x40a945);};}exports[_0xb88e('0x37')]=function(_0x4ba906,_0x104ab3){var _0x309b5c={},_0x337bd7={},_0x17294f={'count':0x0,'rows':[]};var _0x370405=_[_0xb88e('0x38')](db[_0xb88e('0x39')][_0xb88e('0x3a')],function(_0xf1df33){return{'name':_0xf1df33['fieldName'],'type':_0xf1df33[_0xb88e('0x3b')][_0xb88e('0x3c')]};});_0x337bd7['model']=_[_0xb88e('0x38')](_0x370405,_0xb88e('0x35'));_0x337bd7['query']=_['keys'](_0x4ba906[_0xb88e('0x3d')]);_0x337bd7[_0xb88e('0x3e')]=_[_0xb88e('0x3f')](_0x337bd7[_0xb88e('0x40')],_0x337bd7[_0xb88e('0x3d')]);_0x309b5c[_0xb88e('0x41')]=_[_0xb88e('0x3f')](_0x337bd7[_0xb88e('0x40')],qs['fields'](_0x4ba906[_0xb88e('0x3d')][_0xb88e('0x42')]));_0x309b5c[_0xb88e('0x41')]=_0x309b5c['attributes']['length']?_0x309b5c[_0xb88e('0x41')]:_0x337bd7[_0xb88e('0x40')];if(!_0x4ba906[_0xb88e('0x3d')][_0xb88e('0x43')](_0xb88e('0x44'))){_0x309b5c[_0xb88e('0x2b')]=qs[_0xb88e('0x2b')](_0x4ba906[_0xb88e('0x3d')]['limit']);_0x309b5c[_0xb88e('0x2a')]=qs['offset'](_0x4ba906[_0xb88e('0x3d')][_0xb88e('0x2a')]);}_0x309b5c[_0xb88e('0x45')]=qs['sort'](_0x4ba906['query']['sort']);_0x309b5c[_0xb88e('0x46')]=qs['filters'](_['pick'](_0x4ba906['query'],_0x337bd7['filters']),_0x370405);if(_0x4ba906[_0xb88e('0x3d')][_0xb88e('0x47')]){_0x309b5c[_0xb88e('0x46')]=_['merge'](_0x309b5c[_0xb88e('0x46')],{'$or':_[_0xb88e('0x38')](_0x370405,function(_0x24df40){if(_0x24df40[_0xb88e('0x3b')]!==_0xb88e('0x48')){var _0x3b8716={};_0x3b8716[_0x24df40[_0xb88e('0x35')]]={'$like':'%'+_0x4ba906[_0xb88e('0x3d')][_0xb88e('0x47')]+'%'};return _0x3b8716;}})});}_0x309b5c=_[_0xb88e('0x49')]({},_0x309b5c,_0x4ba906[_0xb88e('0x4a')]);var _0x1e94f5={'where':_0x309b5c[_0xb88e('0x46')]};return db[_0xb88e('0x39')][_0xb88e('0x2d')](_0x1e94f5)[_0xb88e('0x32')](function(_0x6c8e36){_0x17294f[_0xb88e('0x2d')]=_0x6c8e36;if(_0x4ba906['query'][_0xb88e('0x4b')]){_0x309b5c[_0xb88e('0x4c')]=[{'all':!![]}];}return db[_0xb88e('0x39')][_0xb88e('0x4d')](_0x309b5c);})[_0xb88e('0x32')](function(_0x6bcaf9){_0x17294f[_0xb88e('0x4e')]=_0x6bcaf9;return _0x17294f;})[_0xb88e('0x32')](respondWithFilteredResult(_0x104ab3,_0x309b5c))['catch'](handleError(_0x104ab3,null));};exports[_0xb88e('0x4f')]=function(_0x571b84,_0x1d2f09){var _0x51039d={'raw':!![],'where':{'id':_0x571b84[_0xb88e('0x50')]['id']}},_0x265dca={};_0x265dca[_0xb88e('0x40')]=_['keys'](db['Network'][_0xb88e('0x3a')]);_0x265dca['query']=_[_0xb88e('0x51')](_0x571b84[_0xb88e('0x3d')]);_0x265dca[_0xb88e('0x3e')]=_['intersection'](_0x265dca[_0xb88e('0x40')],_0x265dca['query']);_0x51039d[_0xb88e('0x41')]=_[_0xb88e('0x3f')](_0x265dca['model'],qs['fields'](_0x571b84[_0xb88e('0x3d')][_0xb88e('0x42')]));_0x51039d[_0xb88e('0x41')]=_0x51039d['attributes'][_0xb88e('0x52')]?_0x51039d[_0xb88e('0x41')]:_0x265dca['model'];if(_0x571b84[_0xb88e('0x3d')]['includeAll']){_0x51039d['include']=[{'all':!![]}];}_0x51039d=_[_0xb88e('0x49')]({},_0x51039d,_0x571b84[_0xb88e('0x4a')]);return db[_0xb88e('0x39')][_0xb88e('0x53')](_0x51039d)['then'](handleEntityNotFound(_0x1d2f09,null))['then'](respondWithResult(_0x1d2f09,null))[_0xb88e('0x25')](handleError(_0x1d2f09,null));};exports[_0xb88e('0x54')]=function(_0x1ba2d9,_0x4a30d8,_0x54ffe2){var _0x579eee;return db[_0xb88e('0x55')][_0xb88e('0x56')](function(_0x36eea5){return db['Network'][_0xb88e('0x54')](_0x1ba2d9[_0xb88e('0x57')],{'raw':!![]})[_0xb88e('0x32')](function(_0x426cf4){_0x579eee=_0x426cf4;return db[_0xb88e('0x39')][_0xb88e('0x4d')]({'where':{'type':_0x1ba2d9[_0xb88e('0x57')]['type']},'raw':!![]});})[_0xb88e('0x32')](function(_0x1b913c){if(_0x579eee[_0xb88e('0x3b')][_0xb88e('0x58')]()==_0xb88e('0x59')){var _0x2db9fc=fs[_0xb88e('0x5a')](path[_0xb88e('0x5b')](config[_0xb88e('0x5c')],_0xb88e('0x5d')),_0xb88e('0x5e'));var _0x448852=ejs[_0xb88e('0x5f')](_0x2db9fc,{'networks':_0x1b913c||[]});fs[_0xb88e('0x60')](_0xb88e('0x61'),_0x448852);return respondWithRpcPromise(_0xb88e('0x62'),_0xb88e('0x54'),{'module':_0xb88e('0x63')});}else if(_0x579eee[_0xb88e('0x3b')][_0xb88e('0x58')]()==_0xb88e('0x64')){var _0x479e9d=fs[_0xb88e('0x5a')](path[_0xb88e('0x5b')](config[_0xb88e('0x5c')],'server/files/templates/turn_multiple.ejs'),_0xb88e('0x5e'));var _0x235fa0=ejs[_0xb88e('0x5f')](_0x479e9d,{'networks':_0x1b913c||[]});fs['writeFileSync'](_0xb88e('0x65'),_0x235fa0);return respondWithRpcPromise(_0xb88e('0x62'),_0xb88e('0x54'),{'module':_0xb88e('0x63')});}else{var _0x4e07ea=fs[_0xb88e('0x5a')](path[_0xb88e('0x5b')](config[_0xb88e('0x5c')],'server/files/templates/network.ejs'),_0xb88e('0x5e'));var _0x1e179a=ejs['render'](_0x4e07ea,{'networks':_0x1b913c||[]});fs['writeFileSync'](util[_0xb88e('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x1ba2d9[_0xb88e('0x57')][_0xb88e('0x3b')]['toLowerCase']()),_0x1e179a);return respondWithRpcPromise(_0xb88e('0x62'),_0xb88e('0x54'),{'module':_0xb88e('0x67')});}return null;})[_0xb88e('0x32')](function(){return _0x579eee;});})['then'](respondWithResult(_0x4a30d8,0xc9))['catch'](handleError(_0x4a30d8,null));};exports['update']=function(_0x5dbc68,_0x1f6c26,_0x363bc5){var _0x56f4e8;return db[_0xb88e('0x55')][_0xb88e('0x56')](function(_0x50de41){return db[_0xb88e('0x39')][_0xb88e('0x53')]({'where':{'id':_0x5dbc68[_0xb88e('0x50')]['id']}})[_0xb88e('0x32')](handleEntityNotFound(_0x1f6c26,null))[_0xb88e('0x32')](saveUpdates(_0x5dbc68[_0xb88e('0x57')],null))[_0xb88e('0x32')](function(_0x169083){if(_0x169083){_0x56f4e8=_0x169083;return db[_0xb88e('0x39')][_0xb88e('0x4d')]({'where':{'type':_0x56f4e8['type']},'raw':!![]});}return null;})['then'](function(_0xe2d044){if(_0x56f4e8[_0xb88e('0x3b')][_0xb88e('0x58')]()==_0xb88e('0x59')){var _0x5bb2a4=fs['readFileSync'](path[_0xb88e('0x5b')](config[_0xb88e('0x5c')],_0xb88e('0x5d')),'utf8');var _0x24b6be=ejs[_0xb88e('0x5f')](_0x5bb2a4,{'networks':_0xe2d044||[]});fs['writeFileSync'](_0xb88e('0x61'),_0x24b6be);return respondWithRpcPromise(_0xb88e('0x62'),_0xb88e('0x31'),{'module':_0xb88e('0x63')});}else if(_0x56f4e8['type']['toUpperCase']()=='TURN'){var _0x1ded75=fs['readFileSync'](path[_0xb88e('0x5b')](config[_0xb88e('0x5c')],'server/files/templates/turn_multiple.ejs'),_0xb88e('0x5e'));var _0x253854=ejs[_0xb88e('0x5f')](_0x1ded75,{'networks':_0xe2d044||[]});fs[_0xb88e('0x60')]('/etc/asterisk/turn_xcally.conf',_0x253854);return respondWithRpcPromise('Reload','update',{'module':'res_stun_monitor.so'});}else{var _0x532836=fs[_0xb88e('0x5a')](path[_0xb88e('0x5b')](config[_0xb88e('0x5c')],_0xb88e('0x68')),_0xb88e('0x5e'));var _0x4e37be=ejs[_0xb88e('0x5f')](_0x532836,{'networks':_0xe2d044||[]});fs[_0xb88e('0x60')](util[_0xb88e('0x66')](_0xb88e('0x69'),_0x5dbc68[_0xb88e('0x57')]['type'][_0xb88e('0x6a')]()),_0x4e37be);return respondWithRpcPromise(_0xb88e('0x62'),_0xb88e('0x31'),{'module':_0xb88e('0x67')});}return null;})[_0xb88e('0x32')](function(_0x2036e9){if(_0x2036e9){return _0x56f4e8;}return null;});})[_0xb88e('0x32')](respondWithResult(_0x1f6c26,null))[_0xb88e('0x25')](handleError(_0x1f6c26,null));};exports['destroy']=function(_0x245be0,_0x388893,_0x361786){var _0x13b4ce;return db[_0xb88e('0x39')]['find']({'where':{'id':_0x245be0[_0xb88e('0x50')]['id']}})[_0xb88e('0x32')](function(_0x3ed313){_0x13b4ce=_0x3ed313;return _0x3ed313;})[_0xb88e('0x32')](handleEntityNotFound(_0x388893,null))[_0xb88e('0x32')](removeEntity(_0x388893,null))[_0xb88e('0x32')](function(){if(_0x13b4ce){return db[_0xb88e('0x39')][_0xb88e('0x4d')]({'where':{'type':_0x13b4ce[_0xb88e('0x3b')]},'raw':!![]});}})[_0xb88e('0x32')](function(_0x50d9a8){if(_0x13b4ce['type'][_0xb88e('0x58')]()==_0xb88e('0x59')){var _0x2dd5db=fs['readFileSync'](path[_0xb88e('0x5b')](config[_0xb88e('0x5c')],_0xb88e('0x5d')),_0xb88e('0x5e'));var _0x2d78ae=ejs['render'](_0x2dd5db,{'networks':_0x50d9a8||[]});fs[_0xb88e('0x60')](_0xb88e('0x61'),_0x2d78ae);return respondWithRpcPromise('Reload',_0xb88e('0x33'),{'module':_0xb88e('0x63')});}else if(_0x13b4ce[_0xb88e('0x3b')][_0xb88e('0x58')]()==_0xb88e('0x64')){var _0x522ea2=fs[_0xb88e('0x5a')](path[_0xb88e('0x5b')](config[_0xb88e('0x5c')],_0xb88e('0x6b')),_0xb88e('0x5e'));var _0x27bf60=ejs[_0xb88e('0x5f')](_0x522ea2,{'networks':_0x50d9a8||[]});fs['writeFileSync'](_0xb88e('0x65'),_0x27bf60);return respondWithRpcPromise('Reload',_0xb88e('0x33'),{'module':_0xb88e('0x63')});}else{var _0x158a3f=fs[_0xb88e('0x5a')](path[_0xb88e('0x5b')](config[_0xb88e('0x5c')],_0xb88e('0x68')),_0xb88e('0x5e'));var _0x58ad6e=ejs['render'](_0x158a3f,{'networks':_0x50d9a8||[]});fs[_0xb88e('0x60')](util[_0xb88e('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x245be0[_0xb88e('0x57')][_0xb88e('0x3b')][_0xb88e('0x6a')]()),_0x58ad6e);return respondWithRpcPromise(_0xb88e('0x62'),_0xb88e('0x33'),{'module':'chan_sip.so'});}return null;})[_0xb88e('0x25')](handleError(_0x388893,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index d83ce7e..5e9fdfa 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 _0xb6b1=['../../config/logger','moment','bluebird','path','../../config/environment','./network.attributes','exports','define','network','lodash'];(function(_0x77d76e,_0x106ed2){var _0x5620c8=function(_0x481b37){while(--_0x481b37){_0x77d76e['push'](_0x77d76e['shift']());}};_0x5620c8(++_0x106ed2);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xb6b1[_0x2ed8f3];return _0x525a55;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var logger=require(_0x1b6b('0x1'))('api');var moment=require(_0x1b6b('0x2'));var BPromise=require(_0x1b6b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b6b('0x4'));var rimraf=require('rimraf');var config=require(_0x1b6b('0x5'));var attributes=require(_0x1b6b('0x6'));module[_0x1b6b('0x7')]=function(_0xdbbe22,_0x5870ca){return _0xdbbe22[_0x1b6b('0x8')]('Network',attributes,{'tableName':_0x1b6b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d2d=['../../config/logger','api','moment','request-promise','../../config/environment','./network.attributes','exports','define','network','lodash','util'];(function(_0x59ee85,_0x21000a){var _0x9d1121=function(_0x59c5fb){while(--_0x59c5fb){_0x59ee85['push'](_0x59ee85['shift']());}};_0x9d1121(++_0x21000a);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x594ca4,_0x15f380){_0x594ca4=_0x594ca4-0x0;var _0x1516ff=_0x1d2d[_0x594ca4];return _0x1516ff;};'use strict';var _=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var logger=require(_0xd1d2('0x2'))(_0xd1d2('0x3'));var moment=require(_0xd1d2('0x4'));var BPromise=require('bluebird');var rp=require(_0xd1d2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd1d2('0x6'));var attributes=require(_0xd1d2('0x7'));module[_0xd1d2('0x8')]=function(_0x269613,_0x2f930d){return _0x269613[_0xd1d2('0x9')]('Network',attributes,{'tableName':_0xd1d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 070a22c..9fac897 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b5396,_0x3009bb){var _0x212f0a=function(_0x33bc57){while(--_0x33bc57){_0x4b5396['push'](_0x4b5396['shift']());}};_0x212f0a(++_0x3009bb);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x524e78,_0x9862d0){_0x524e78=_0x524e78-0x0;var _0x576950=_0x7a54[_0x524e78];return _0x576950;};'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 00ae128..db9f31f 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 _0x3fe5=['addAgents','/:id/send','update','delete','destroy','removeAnswers','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','/describe','describe','get','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','addApplications'];(function(_0x28a0f3,_0x90f4c2){var _0x2559dc=function(_0x1aebea){while(--_0x1aebea){_0x28a0f3['push'](_0x28a0f3['shift']());}};_0x2559dc(++_0x90f4c2);}(_0x3fe5,0x127));var _0x53fe=function(_0x1e8118,_0x2587ff){_0x1e8118=_0x1e8118-0x0;var _0x3b13c4=_0x3fe5[_0x1e8118];return _0x3b13c4;};'use strict';var multer=require('multer');var util=require(_0x53fe('0x0'));var path=require(_0x53fe('0x1'));var timeout=require('connect-timeout');var express=require(_0x53fe('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x53fe('0x3'));var interaction=require(_0x53fe('0x4'));var config=require(_0x53fe('0x5'));var controller=require(_0x53fe('0x6'));router['get']('/',auth[_0x53fe('0x7')](),controller[_0x53fe('0x8')]);router['get'](_0x53fe('0x9'),auth['isAuthenticated'](),controller[_0x53fe('0xa')]);router[_0x53fe('0xb')](_0x53fe('0xc'),auth[_0x53fe('0x7')](),controller[_0x53fe('0xd')]);router[_0x53fe('0xb')]('/:id/dispositions',auth[_0x53fe('0x7')](),controller[_0x53fe('0xe')]);router['get'](_0x53fe('0xf'),auth[_0x53fe('0x7')](),controller[_0x53fe('0x10')]);router[_0x53fe('0xb')](_0x53fe('0x11'),auth['isAuthenticated'](),controller[_0x53fe('0x12')]);router[_0x53fe('0xb')](_0x53fe('0x13'),auth[_0x53fe('0x7')](),controller[_0x53fe('0x14')]);router[_0x53fe('0xb')](_0x53fe('0x15'),auth[_0x53fe('0x7')](),controller['getAgents']);router[_0x53fe('0x16')]('/',auth[_0x53fe('0x7')](),controller[_0x53fe('0x17')]);router['post'](_0x53fe('0x18'),auth['isAuthenticated'](),controller[_0x53fe('0x19')]);router[_0x53fe('0x16')](_0x53fe('0xf'),auth[_0x53fe('0x7')](),controller[_0x53fe('0x1a')]);router['post'](_0x53fe('0x1b'),controller['notify']);router[_0x53fe('0x16')](_0x53fe('0x11'),auth['isAuthenticated'](),controller[_0x53fe('0x1c')]);router[_0x53fe('0x16')]('/:id/users',auth[_0x53fe('0x7')](),controller[_0x53fe('0x1d')]);router[_0x53fe('0x16')](_0x53fe('0x1e'),auth[_0x53fe('0x7')](),controller['send']);router['put'](_0x53fe('0xc'),auth[_0x53fe('0x7')](),controller[_0x53fe('0x1f')]);router[_0x53fe('0x20')](_0x53fe('0xc'),auth[_0x53fe('0x7')](),controller[_0x53fe('0x21')]);router[_0x53fe('0x20')]('/:id/dispositions',auth[_0x53fe('0x7')](),controller['removeDispositions']);router[_0x53fe('0x20')](_0x53fe('0xf'),auth['isAuthenticated'](),controller[_0x53fe('0x22')]);router[_0x53fe('0x20')](_0x53fe('0x15'),auth[_0x53fe('0x7')](),controller['removeAgents']);module[_0x53fe('0x23')]=router; \ No newline at end of file +var _0xe4d1=['/:id/users','getAgents','post','create','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','delete','destroy','removeDispositions','removeAnswers','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xe4d1,0xf5));var _0x1e4d=function(_0x2b591c,_0x117b3c){_0x2b591c=_0x2b591c-0x0;var _0x9ef65d=_0xe4d1[_0x2b591c];return _0x9ef65d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1e4d('0x0'));var router=express[_0x1e4d('0x1')]();var fs_extra=require(_0x1e4d('0x2'));var auth=require(_0x1e4d('0x3'));var interaction=require(_0x1e4d('0x4'));var config=require(_0x1e4d('0x5'));var controller=require(_0x1e4d('0x6'));router[_0x1e4d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1e4d('0x7')](_0x1e4d('0x8'),auth[_0x1e4d('0x9')](),controller[_0x1e4d('0xa')]);router['get'](_0x1e4d('0xb'),auth[_0x1e4d('0x9')](),controller[_0x1e4d('0xc')]);router[_0x1e4d('0x7')](_0x1e4d('0xd'),auth[_0x1e4d('0x9')](),controller[_0x1e4d('0xe')]);router['get'](_0x1e4d('0xf'),auth[_0x1e4d('0x9')](),controller[_0x1e4d('0x10')]);router['get'](_0x1e4d('0x11'),auth[_0x1e4d('0x9')](),controller[_0x1e4d('0x12')]);router[_0x1e4d('0x7')](_0x1e4d('0x13'),auth['isAuthenticated'](),controller[_0x1e4d('0x14')]);router['get'](_0x1e4d('0x15'),auth[_0x1e4d('0x9')](),controller[_0x1e4d('0x16')]);router[_0x1e4d('0x17')]('/',auth[_0x1e4d('0x9')](),controller[_0x1e4d('0x18')]);router[_0x1e4d('0x17')](_0x1e4d('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x1e4d('0x17')](_0x1e4d('0xf'),auth['isAuthenticated'](),controller[_0x1e4d('0x19')]);router[_0x1e4d('0x17')](_0x1e4d('0x1a'),controller[_0x1e4d('0x1b')]);router[_0x1e4d('0x17')](_0x1e4d('0x11'),auth[_0x1e4d('0x9')](),controller[_0x1e4d('0x1c')]);router['post'](_0x1e4d('0x15'),auth[_0x1e4d('0x9')](),controller[_0x1e4d('0x1d')]);router[_0x1e4d('0x17')](_0x1e4d('0x1e'),auth[_0x1e4d('0x9')](),controller[_0x1e4d('0x1f')]);router[_0x1e4d('0x20')](_0x1e4d('0xb'),auth[_0x1e4d('0x9')](),controller['update']);router[_0x1e4d('0x21')]('/:id',auth[_0x1e4d('0x9')](),controller[_0x1e4d('0x22')]);router[_0x1e4d('0x21')](_0x1e4d('0xd'),auth[_0x1e4d('0x9')](),controller[_0x1e4d('0x23')]);router[_0x1e4d('0x21')]('/:id/canned_answers',auth[_0x1e4d('0x9')](),controller[_0x1e4d('0x24')]);router[_0x1e4d('0x21')](_0x1e4d('0x15'),auth[_0x1e4d('0x9')](),controller['removeAgents']);module[_0x1e4d('0x25')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index f7faca9..0266e99 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 _0x15f8=['STRING','name','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x15f8,0x81));var _0x815f=function(_0x252868,_0x564008){_0x252868=_0x252868-0x0;var _0x21f372=_0x15f8[_0x252868];return _0x21f372;};'use strict';var Sequelize=require(_0x815f('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x815f('0x1')],'unique':_0x815f('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x815f('0x1')]},'token':{'type':Sequelize[_0x815f('0x1')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x815f('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'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['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x815f('0x1')]},'queueTransfer':{'type':Sequelize[_0x815f('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x815f('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x815f('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x815f('0x5')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x815f('0x6'),'set':function(_0x1c35fe){if(!_0x1c35fe)this[_0x815f('0x7')](_0x815f('0x8'),null);this['setDataValue'](_0x815f('0x9'),_0x1c35fe);}}}; \ No newline at end of file +var _0x2e8c=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x1e3f34,_0x4b2222){var _0x334f67=function(_0x595b6c){while(--_0x595b6c){_0x1e3f34['push'](_0x1e3f34['shift']());}};_0x334f67(++_0x4b2222);}(_0x2e8c,0x101));var _0xc2e8=function(_0x21c857,_0x1f9812){_0x21c857=_0x21c857-0x0;var _0x2e6516=_0x2e8c[_0x21c857];return _0x2e6516;};'use strict';var Sequelize=require(_0xc2e8('0x0'));var rs=require(_0xc2e8('0x1'));module[_0xc2e8('0x2')]={'name':{'type':Sequelize[_0xc2e8('0x3')],'unique':_0xc2e8('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xc2e8('0x3')]},'token':{'type':Sequelize[_0xc2e8('0x3')],'defaultValue':function(){return rs[_0xc2e8('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc2e8('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc2e8('0x6')],'defaultValue':function(){return _0xc2e8('0x7');}},'notificationSound':{'type':Sequelize[_0xc2e8('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc2e8('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc2e8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc2e8('0x3')]},'queueTransfer':{'type':Sequelize[_0xc2e8('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc2e8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc2e8('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc2e8('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0xc2e8('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xc2e8('0x8')],'defaultValue':![],'comment':_0xc2e8('0xb'),'set':function(_0x1eb72d){if(!_0x1eb72d)this[_0xc2e8('0xc')]('mandatoryDispositionPauseId',null);this[_0xc2e8('0xc')](_0xc2e8('0xd'),_0x1eb72d);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index b129350..a2f09e8 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 _0x1b9e=['nolimit','order','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','hasOwnProperty','sort','pick','OpenchannelAccountId','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','OpenchannelApplication','List','Applications','list','applications','orderBy','priority','account','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','Contact','Tag','tag','addAgents','spread','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','ListId','Messages','dataValues','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','UserProfileResource','stack','name','send','index','Pause','map','OpenchannelAccount','fieldName','type','key','keys','query','model','attributes','fields','length'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x1b9e,0x1ed));var _0xe1b9=function(_0xcb71d6,_0x3c44fb){_0xcb71d6=_0xcb71d6-0x0;var _0x14e632=_0x1b9e[_0xcb71d6];return _0x14e632;};'use strict';var emlformat=require(_0xe1b9('0x0'));var rimraf=require(_0xe1b9('0x1'));var zipdir=require(_0xe1b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe1b9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe1b9('0x4'));var util=require('util');var path=require(_0xe1b9('0x5'));var sox=require(_0xe1b9('0x6'));var csv=require(_0xe1b9('0x7'));var ejs=require(_0xe1b9('0x8'));var fs=require('fs');var fs_extra=require(_0xe1b9('0x9'));var _=require(_0xe1b9('0xa'));var squel=require('squel');var crypto=require(_0xe1b9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe1b9('0xc'));var toCsv=require(_0xe1b9('0x7'));var querystring=require('querystring');var Papa=require(_0xe1b9('0xd'));var Redis=require(_0xe1b9('0xe'));var authService=require(_0xe1b9('0xf'));var qs=require(_0xe1b9('0x10'));var as=require(_0xe1b9('0x11'));var hardwareService=require(_0xe1b9('0x12'));var logger=require(_0xe1b9('0x13'))(_0xe1b9('0x14'));var utils=require(_0xe1b9('0x15'));var config=require(_0xe1b9('0x16'));var licenseUtil=require(_0xe1b9('0x17'));var db=require(_0xe1b9('0x18'))['db'];config[_0xe1b9('0x19')]=_[_0xe1b9('0x1a')](config[_0xe1b9('0x19')],{'host':_0xe1b9('0x1b'),'port':0x18eb});var socket=require(_0xe1b9('0x1c'))(new Redis(config[_0xe1b9('0x19')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0xe1b9('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xe1b9('0x1e')][_0xe1b9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4b2f6d,_0x57ec06,_0x624d84,_0x68fd75){return new BPromise(function(_0x320b8b,_0x39bf50){var _0x555191=_0x68fd75||client;return _0x555191[_0xe1b9('0x20')](_0x4b2f6d,_0x624d84)['then'](function(_0x477e0c){logger['info'](_0xe1b9('0x21'),_0x57ec06,_0xe1b9('0x22'));logger['debug'](_0xe1b9('0x23'),_0x57ec06,_0xe1b9('0x22'),JSON['stringify'](_0x477e0c));if(_0x477e0c[_0xe1b9('0x24')]){if(_0x477e0c[_0xe1b9('0x24')]['code']===0x1f4){logger[_0xe1b9('0x24')](_0xe1b9('0x21'),_0x57ec06,_0x477e0c[_0xe1b9('0x24')][_0xe1b9('0x25')]);return _0x39bf50(_0x477e0c[_0xe1b9('0x24')][_0xe1b9('0x25')]);}logger[_0xe1b9('0x24')](_0xe1b9('0x21'),_0x57ec06,_0x477e0c[_0xe1b9('0x24')][_0xe1b9('0x25')]);return _0x320b8b(_0x477e0c[_0xe1b9('0x24')][_0xe1b9('0x25')]);}else{logger[_0xe1b9('0x26')](_0xe1b9('0x21'),_0x57ec06,'request\x20sent');_0x320b8b(_0x477e0c['result'][_0xe1b9('0x25')]);}})[_0xe1b9('0x27')](function(_0x90dd51){logger[_0xe1b9('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x57ec06,_0x90dd51);_0x39bf50(_0x90dd51);});});}function respondWithStatusCode(_0x4f5bb4,_0x82424e){_0x82424e=_0x82424e||0xcc;return function(_0x331a5c){if(_0x331a5c){return _0x4f5bb4[_0xe1b9('0x28')](_0x82424e);}return _0x4f5bb4[_0xe1b9('0x29')](_0x82424e)[_0xe1b9('0x2a')]();};}function respondWithResult(_0x5b6879,_0x5cacde){_0x5cacde=_0x5cacde||0xc8;return function(_0x482430){if(_0x482430){return _0x5b6879[_0xe1b9('0x29')](_0x5cacde)[_0xe1b9('0x2b')](_0x482430);}};}function respondWithFilteredResult(_0x5b101d,_0x5bc8b2){return function(_0x3f6082){if(_0x3f6082){var _0x36759e=typeof _0x5bc8b2[_0xe1b9('0x2c')]===_0xe1b9('0x2d')&&typeof _0x5bc8b2[_0xe1b9('0x2e')]==='undefined';var _0x2a7299=_0x3f6082[_0xe1b9('0x2f')];var _0x43fb2c=_0x36759e?0x0:_0x5bc8b2[_0xe1b9('0x2c')];var _0x3ced53=_0x36759e?_0x3f6082['count']:_0x5bc8b2[_0xe1b9('0x2c')]+_0x5bc8b2[_0xe1b9('0x2e')];var _0x53e2dd;if(_0x3ced53>=_0x2a7299){_0x3ced53=_0x2a7299;_0x53e2dd=0xc8;}else{_0x53e2dd=0xce;}_0x5b101d[_0xe1b9('0x29')](_0x53e2dd);return _0x5b101d['set'](_0xe1b9('0x30'),_0x43fb2c+'-'+_0x3ced53+'/'+_0x2a7299)[_0xe1b9('0x2b')](_0x3f6082);}return null;};}function patchUpdates(_0x5e4113){return function(_0x382d8c){try{jsonpatch[_0xe1b9('0x31')](_0x382d8c,_0x5e4113,!![]);}catch(_0x4155d3){return BPromise['reject'](_0x4155d3);}return _0x382d8c[_0xe1b9('0x32')]();};}function saveUpdates(_0x12475f,_0x42f377){return function(_0x4fe4db){if(_0x4fe4db){return _0x4fe4db[_0xe1b9('0x33')](_0x12475f)[_0xe1b9('0x34')](function(_0x29183a){return _0x29183a;});}return null;};}function removeEntity(_0x3d5f9a,_0x12a29f){return function(_0x469e94){if(_0x469e94){return _0x469e94[_0xe1b9('0x35')]()['then'](function(){var _0x335740=_0x469e94['get']({'plain':!![]});var _0x2f90ac='OpenchannelAccounts';return db[_0xe1b9('0x36')][_0xe1b9('0x35')]({'where':{'type':_0x2f90ac,'resourceId':_0x335740['id']}})[_0xe1b9('0x34')](function(){return _0x469e94;});})[_0xe1b9('0x34')](function(){_0x3d5f9a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25100f,_0x49db60){return function(_0x402528){if(!_0x402528){_0x25100f[_0xe1b9('0x28')](0x194);}return _0x402528;};}function handleError(_0x507458,_0x11311b){_0x11311b=_0x11311b||0x1f4;return function(_0x512c65){logger[_0xe1b9('0x24')](_0x512c65[_0xe1b9('0x37')]);if(_0x512c65[_0xe1b9('0x38')]){delete _0x512c65[_0xe1b9('0x38')];}_0x507458[_0xe1b9('0x29')](_0x11311b)[_0xe1b9('0x39')](_0x512c65);};}exports[_0xe1b9('0x3a')]=function(_0x357c9a,_0x5d6a39){var _0x1e6b85={'include':[{'model':db[_0xe1b9('0x3b')],'as':'mandatoryDispositionPause'}]},_0xc50ca={},_0x1c2033={'count':0x0,'rows':[]};var _0x525190=_[_0xe1b9('0x3c')](db[_0xe1b9('0x3d')]['rawAttributes'],function(_0x542a76){return{'name':_0x542a76[_0xe1b9('0x3e')],'type':_0x542a76[_0xe1b9('0x3f')][_0xe1b9('0x40')]};});_0xc50ca['model']=_['map'](_0x525190,_0xe1b9('0x38'));_0xc50ca['query']=_[_0xe1b9('0x41')](_0x357c9a[_0xe1b9('0x42')]);_0xc50ca['filters']=_['intersection'](_0xc50ca[_0xe1b9('0x43')],_0xc50ca[_0xe1b9('0x42')]);_0x1e6b85[_0xe1b9('0x44')]=_['intersection'](_0xc50ca[_0xe1b9('0x43')],qs[_0xe1b9('0x45')](_0x357c9a[_0xe1b9('0x42')]['fields']));_0x1e6b85['attributes']=_0x1e6b85['attributes'][_0xe1b9('0x46')]?_0x1e6b85[_0xe1b9('0x44')]:_0xc50ca[_0xe1b9('0x43')];if(!_0x357c9a['query']['hasOwnProperty'](_0xe1b9('0x47'))){_0x1e6b85[_0xe1b9('0x2e')]=qs[_0xe1b9('0x2e')](_0x357c9a[_0xe1b9('0x42')][_0xe1b9('0x2e')]);_0x1e6b85[_0xe1b9('0x2c')]=qs[_0xe1b9('0x2c')](_0x357c9a[_0xe1b9('0x42')]['offset']);}_0x1e6b85[_0xe1b9('0x48')]=qs['sort'](_0x357c9a['query']['sort']);_0x1e6b85[_0xe1b9('0x49')]=qs[_0xe1b9('0x4a')](_['pick'](_0x357c9a[_0xe1b9('0x42')],_0xc50ca[_0xe1b9('0x4a')]),_0x525190);if(_0x357c9a[_0xe1b9('0x42')][_0xe1b9('0x4b')]){_0x1e6b85[_0xe1b9('0x49')]=_['merge'](_0x1e6b85['where'],{'$or':_[_0xe1b9('0x3c')](_0x525190,function(_0x5794b0){if(_0x5794b0[_0xe1b9('0x3f')]!==_0xe1b9('0x4c')){var _0x40afda={};_0x40afda[_0x5794b0[_0xe1b9('0x38')]]={'$like':'%'+_0x357c9a[_0xe1b9('0x42')][_0xe1b9('0x4b')]+'%'};return _0x40afda;}})});}_0x1e6b85=_[_0xe1b9('0x4d')]({},_0x1e6b85,_0x357c9a[_0xe1b9('0x4e')]);var _0x34a8d1={'where':_0x1e6b85['where']};return db['OpenchannelAccount'][_0xe1b9('0x2f')](_0x34a8d1)['then'](function(_0x273e79){_0x1c2033['count']=_0x273e79;if(_0x357c9a['query'][_0xe1b9('0x4f')]){_0x1e6b85[_0xe1b9('0x50')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xe1b9('0x51')](_0x1e6b85);})[_0xe1b9('0x34')](function(_0x52d1ac){_0x1c2033[_0xe1b9('0x52')]=_0x52d1ac;return _0x1c2033;})['then'](respondWithFilteredResult(_0x5d6a39,_0x1e6b85))[_0xe1b9('0x27')](handleError(_0x5d6a39,null));};exports[_0xe1b9('0x53')]=function(_0x555607,_0x3a2d61){var _0x5e2b54={'raw':![],'where':{'id':_0x555607[_0xe1b9('0x54')]['id']},'include':[{'model':db[_0xe1b9('0x3b')],'as':_0xe1b9('0x55')}]},_0x11ed2a={};_0x11ed2a[_0xe1b9('0x43')]=_[_0xe1b9('0x41')](db[_0xe1b9('0x3d')][_0xe1b9('0x56')]);_0x11ed2a[_0xe1b9('0x42')]=_['keys'](_0x555607[_0xe1b9('0x42')]);_0x11ed2a[_0xe1b9('0x4a')]=_[_0xe1b9('0x57')](_0x11ed2a[_0xe1b9('0x43')],_0x11ed2a[_0xe1b9('0x42')]);_0x5e2b54[_0xe1b9('0x44')]=_[_0xe1b9('0x57')](_0x11ed2a[_0xe1b9('0x43')],qs[_0xe1b9('0x45')](_0x555607[_0xe1b9('0x42')][_0xe1b9('0x45')]));_0x5e2b54[_0xe1b9('0x44')]=_0x5e2b54[_0xe1b9('0x44')][_0xe1b9('0x46')]?_0x5e2b54['attributes']:_0x11ed2a[_0xe1b9('0x43')];if(_0x555607[_0xe1b9('0x42')][_0xe1b9('0x4f')]){_0x5e2b54[_0xe1b9('0x50')]=[{'all':!![]}];}_0x5e2b54=_[_0xe1b9('0x4d')]({},_0x5e2b54,_0x555607[_0xe1b9('0x4e')]);return db['OpenchannelAccount'][_0xe1b9('0x58')](_0x5e2b54)['then'](handleEntityNotFound(_0x3a2d61,null))['then'](respondWithResult(_0x3a2d61,null))['catch'](handleError(_0x3a2d61,null));};exports[_0xe1b9('0x59')]=function(_0x19bdd2,_0x482cf4){return db[_0xe1b9('0x3d')]['create'](_0x19bdd2[_0xe1b9('0x5a')],{})[_0xe1b9('0x34')](function(_0x2cfb98){var _0x2e0f7a=_0x19bdd2[_0xe1b9('0x5b')][_0xe1b9('0x5c')]({'plain':!![]});if(!_0x2e0f7a)throw new Error(_0xe1b9('0x5d'));if(_0x2e0f7a[_0xe1b9('0x5e')]===_0xe1b9('0x5b')){var _0x50e1fc=_0x2cfb98[_0xe1b9('0x5c')]({'plain':!![]});var _0x217716=_0xe1b9('0x5f');return db['UserProfileSection']['find']({'where':{'name':_0x217716,'userProfileId':_0x2e0f7a[_0xe1b9('0x60')]},'raw':!![]})[_0xe1b9('0x34')](function(_0x17e8aa){if(_0x17e8aa&&_0x17e8aa[_0xe1b9('0x61')]===0x0){return db['UserProfileResource'][_0xe1b9('0x59')]({'name':_0x50e1fc['name'],'resourceId':_0x50e1fc['id'],'type':_0x17e8aa[_0xe1b9('0x38')],'sectionId':_0x17e8aa['id']},{})[_0xe1b9('0x34')](function(){return _0x2cfb98;});}else{return _0x2cfb98;}})[_0xe1b9('0x27')](function(_0x412a90){logger[_0xe1b9('0x24')](_0xe1b9('0x62'),_0x412a90);throw _0x412a90;});}return _0x2cfb98;})[_0xe1b9('0x34')](respondWithResult(_0x482cf4,0xc9))[_0xe1b9('0x27')](handleError(_0x482cf4,null));};exports[_0xe1b9('0x33')]=function(_0x1c7fbb,_0x3771e8){if(_0x1c7fbb[_0xe1b9('0x5a')]['id']){delete _0x1c7fbb[_0xe1b9('0x5a')]['id'];}return db[_0xe1b9('0x3d')]['find']({'where':{'id':_0x1c7fbb['params']['id']},'include':[{'model':db[_0xe1b9('0x3b')],'as':_0xe1b9('0x55')}]})[_0xe1b9('0x34')](handleEntityNotFound(_0x3771e8,null))[_0xe1b9('0x34')](saveUpdates(_0x1c7fbb[_0xe1b9('0x5a')],null))[_0xe1b9('0x34')](respondWithResult(_0x3771e8,null))[_0xe1b9('0x27')](handleError(_0x3771e8,null));};exports['destroy']=function(_0x55413e,_0x34621f){return db['OpenchannelAccount'][_0xe1b9('0x58')]({'where':{'id':_0x55413e[_0xe1b9('0x54')]['id']}})['then'](handleEntityNotFound(_0x34621f,null))[_0xe1b9('0x34')](removeEntity(_0x34621f,null))[_0xe1b9('0x27')](handleError(_0x34621f,null));};exports['describe']=function(_0x4081b0,_0x12e380){return db[_0xe1b9('0x3d')][_0xe1b9('0x63')]()[_0xe1b9('0x34')](respondWithResult(_0x12e380,null))[_0xe1b9('0x27')](handleError(_0x12e380,null));};exports[_0xe1b9('0x64')]=function(_0x5980ed,_0x52885a,_0x8c5899){if(_0x5980ed[_0xe1b9('0x5a')]['id']){delete _0x5980ed[_0xe1b9('0x5a')]['id'];}return db[_0xe1b9('0x3d')][_0xe1b9('0x58')]({'where':{'id':_0x5980ed[_0xe1b9('0x54')]['id']}})['then'](handleEntityNotFound(_0x52885a,null))['then'](function(_0x2f7041){if(_0x2f7041){_0x5980ed[_0xe1b9('0x5a')]['OpenchannelAccountId']=_0x2f7041['id'];return db[_0xe1b9('0x65')][_0xe1b9('0x59')](_0x5980ed[_0xe1b9('0x5a')]);}})[_0xe1b9('0x34')](respondWithResult(_0x52885a,null))[_0xe1b9('0x27')](handleError(_0x52885a,null));};exports['getDispositions']=function(_0x156d85,_0x262869,_0x2582fb){var _0x3d0231={'raw':![],'where':{}};var _0x4ad317={};var _0x14c378={'count':0x0,'rows':[]};return db[_0xe1b9('0x3d')][_0xe1b9('0x66')]({'where':{'id':_0x156d85[_0xe1b9('0x54')]['id']}})['then'](handleEntityNotFound(_0x262869,null))[_0xe1b9('0x34')](function(_0x14e6bb){if(_0x14e6bb){_0x4ad317[_0xe1b9('0x43')]=_[_0xe1b9('0x41')](db[_0xe1b9('0x65')][_0xe1b9('0x56')]);_0x4ad317[_0xe1b9('0x42')]=_[_0xe1b9('0x41')](_0x156d85[_0xe1b9('0x42')]);_0x4ad317[_0xe1b9('0x4a')]=_[_0xe1b9('0x57')](_0x4ad317[_0xe1b9('0x43')],_0x4ad317[_0xe1b9('0x42')]);_0x3d0231[_0xe1b9('0x44')]=_[_0xe1b9('0x57')](_0x4ad317[_0xe1b9('0x43')],qs['fields'](_0x156d85['query'][_0xe1b9('0x45')]));_0x3d0231[_0xe1b9('0x44')]=_0x3d0231[_0xe1b9('0x44')][_0xe1b9('0x46')]?_0x3d0231[_0xe1b9('0x44')]:_0x4ad317[_0xe1b9('0x43')];if(!_0x156d85[_0xe1b9('0x42')][_0xe1b9('0x67')](_0xe1b9('0x47'))){_0x3d0231['limit']=qs['limit'](_0x156d85[_0xe1b9('0x42')][_0xe1b9('0x2e')]);_0x3d0231[_0xe1b9('0x2c')]=qs[_0xe1b9('0x2c')](_0x156d85['query'][_0xe1b9('0x2c')]);}_0x3d0231['order']=qs[_0xe1b9('0x68')](_0x156d85[_0xe1b9('0x42')]['sort']);_0x3d0231[_0xe1b9('0x49')]=qs['filters'](_[_0xe1b9('0x69')](_0x156d85[_0xe1b9('0x42')],_0x4ad317[_0xe1b9('0x4a')]));_0x3d0231[_0xe1b9('0x49')][_0xe1b9('0x6a')]=_0x14e6bb['id'];if(_0x156d85[_0xe1b9('0x42')][_0xe1b9('0x4b')]){_0x3d0231[_0xe1b9('0x49')]=_[_0xe1b9('0x4d')](_0x3d0231[_0xe1b9('0x49')],{'$or':_['map'](_0x3d0231[_0xe1b9('0x44')],function(_0x3542dd){var _0x2168a0={};_0x2168a0[_0x3542dd]={'$like':'%'+_0x156d85[_0xe1b9('0x42')][_0xe1b9('0x4b')]+'%'};return _0x2168a0;})});}_0x3d0231=_[_0xe1b9('0x4d')]({},_0x3d0231,_0x156d85[_0xe1b9('0x4e')]);return db[_0xe1b9('0x65')][_0xe1b9('0x2f')]({'where':_0x3d0231[_0xe1b9('0x49')]})[_0xe1b9('0x34')](function(_0x24a85a){_0x14c378[_0xe1b9('0x2f')]=_0x24a85a;if(_0x156d85[_0xe1b9('0x42')][_0xe1b9('0x4f')]){_0x3d0231[_0xe1b9('0x50')]=[{'all':!![]}];}return db['Disposition'][_0xe1b9('0x51')](_0x3d0231);})[_0xe1b9('0x34')](function(_0x46d9c4){_0x14c378['rows']=_0x46d9c4;return _0x14c378;});}})[_0xe1b9('0x34')](respondWithFilteredResult(_0x262869,_0x3d0231))[_0xe1b9('0x27')](handleError(_0x262869,null));};exports[_0xe1b9('0x6b')]=function(_0x568873,_0x10b0cd,_0x28477f){return db[_0xe1b9('0x3d')]['find']({'where':{'id':_0x568873[_0xe1b9('0x54')]['id']}})[_0xe1b9('0x34')](handleEntityNotFound(_0x10b0cd,null))['then'](function(_0x1fd971){if(_0x1fd971){return _0x1fd971[_0xe1b9('0x6b')](_0x568873[_0xe1b9('0x42')][_0xe1b9('0x6c')]);}})[_0xe1b9('0x34')](respondWithStatusCode(_0x10b0cd,null))['catch'](handleError(_0x10b0cd,null));};exports['addAnswer']=function(_0x586848,_0x334a9c,_0x4b5c7e){if(_0x586848[_0xe1b9('0x5a')]['id']){delete _0x586848['body']['id'];}return db['OpenchannelAccount'][_0xe1b9('0x58')]({'where':{'id':_0x586848[_0xe1b9('0x54')]['id']}})[_0xe1b9('0x34')](handleEntityNotFound(_0x334a9c,null))[_0xe1b9('0x34')](function(_0x2ac53b){if(_0x2ac53b){_0x586848[_0xe1b9('0x5a')][_0xe1b9('0x6a')]=_0x2ac53b['id'];return db[_0xe1b9('0x6d')][_0xe1b9('0x59')](_0x586848['body']);}})[_0xe1b9('0x34')](respondWithResult(_0x334a9c,null))['catch'](handleError(_0x334a9c,null));};exports[_0xe1b9('0x6e')]=function(_0xae00a3,_0x76d7a2,_0x2b466e){var _0x8b5923={'raw':![],'where':{}};var _0x54d083={};var _0x5a8532={'count':0x0,'rows':[]};return db[_0xe1b9('0x3d')]['findOne']({'where':{'id':_0xae00a3[_0xe1b9('0x54')]['id']}})[_0xe1b9('0x34')](handleEntityNotFound(_0x76d7a2,null))[_0xe1b9('0x34')](function(_0x31ef77){if(_0x31ef77){_0x54d083[_0xe1b9('0x43')]=_[_0xe1b9('0x41')](db[_0xe1b9('0x6d')][_0xe1b9('0x56')]);_0x54d083[_0xe1b9('0x42')]=_[_0xe1b9('0x41')](_0xae00a3[_0xe1b9('0x42')]);_0x54d083[_0xe1b9('0x4a')]=_['intersection'](_0x54d083['model'],_0x54d083[_0xe1b9('0x42')]);_0x8b5923[_0xe1b9('0x44')]=_[_0xe1b9('0x57')](_0x54d083[_0xe1b9('0x43')],qs['fields'](_0xae00a3[_0xe1b9('0x42')][_0xe1b9('0x45')]));_0x8b5923[_0xe1b9('0x44')]=_0x8b5923[_0xe1b9('0x44')][_0xe1b9('0x46')]?_0x8b5923['attributes']:_0x54d083[_0xe1b9('0x43')];if(!_0xae00a3[_0xe1b9('0x42')]['hasOwnProperty'](_0xe1b9('0x47'))){_0x8b5923['limit']=qs['limit'](_0xae00a3['query']['limit']);_0x8b5923['offset']=qs[_0xe1b9('0x2c')](_0xae00a3['query'][_0xe1b9('0x2c')]);}_0x8b5923[_0xe1b9('0x48')]=qs['sort'](_0xae00a3[_0xe1b9('0x42')][_0xe1b9('0x68')]);_0x8b5923[_0xe1b9('0x49')]=qs['filters'](_[_0xe1b9('0x69')](_0xae00a3[_0xe1b9('0x42')],_0x54d083[_0xe1b9('0x4a')]));_0x8b5923[_0xe1b9('0x49')][_0xe1b9('0x6a')]=_0x31ef77['id'];if(_0xae00a3['query']['filter']){_0x8b5923[_0xe1b9('0x49')]=_['merge'](_0x8b5923[_0xe1b9('0x49')],{'$or':_[_0xe1b9('0x3c')](_0x8b5923[_0xe1b9('0x44')],function(_0x4d67d1){var _0x26629a={};_0x26629a[_0x4d67d1]={'$like':'%'+_0xae00a3[_0xe1b9('0x42')][_0xe1b9('0x4b')]+'%'};return _0x26629a;})});}_0x8b5923=_[_0xe1b9('0x4d')]({},_0x8b5923,_0xae00a3[_0xe1b9('0x4e')]);return db['CannedAnswer'][_0xe1b9('0x2f')]({'where':_0x8b5923['where']})[_0xe1b9('0x34')](function(_0x411349){_0x5a8532[_0xe1b9('0x2f')]=_0x411349;if(_0xae00a3[_0xe1b9('0x42')][_0xe1b9('0x4f')]){_0x8b5923[_0xe1b9('0x50')]=[{'all':!![]}];}return db[_0xe1b9('0x6d')][_0xe1b9('0x51')](_0x8b5923);})[_0xe1b9('0x34')](function(_0x44d5b3){_0x5a8532[_0xe1b9('0x52')]=_0x44d5b3;return _0x5a8532;});}})[_0xe1b9('0x34')](respondWithFilteredResult(_0x76d7a2,_0x8b5923))[_0xe1b9('0x27')](handleError(_0x76d7a2,null));};exports[_0xe1b9('0x6f')]=function(_0x109334,_0x38d824,_0x956a2c){return db[_0xe1b9('0x3d')][_0xe1b9('0x58')]({'where':{'id':_0x109334['params']['id']}})[_0xe1b9('0x34')](handleEntityNotFound(_0x38d824,null))[_0xe1b9('0x34')](function(_0xde4ab0){if(_0xde4ab0){return _0xde4ab0['removeAnswers'](_0x109334[_0xe1b9('0x42')]['ids']);}})[_0xe1b9('0x34')](respondWithStatusCode(_0x38d824,null))[_0xe1b9('0x27')](handleError(_0x38d824,null));};exports[_0xe1b9('0x70')]=function(_0x4c0e67,_0x2b3931,_0x56c41f){var _0x267fc0={'body':_0x4c0e67[_0xe1b9('0x5a')],'channel':_0xe1b9('0x71')};var _0x3b07ce=[];var _0x35df09=[];var _0x16a0c7={};var _0x5a04ad=![];return db[_0xe1b9('0x72')]['describe']()['then'](function(_0x3458b8){if(!_0x3458b8){throw new db[(_0xe1b9('0x73'))][(_0xe1b9('0x74'))](_0xe1b9('0x75'));}_0x3b07ce=_[_0xe1b9('0x76')](_[_0xe1b9('0x41')](_0x3458b8),[_0xe1b9('0x77'),_0xe1b9('0x78')]);_0x35df09=_[_0xe1b9('0x76')](_[_0xe1b9('0x41')](_0x3458b8),[_0xe1b9('0x77'),_0xe1b9('0x78'),_0xe1b9('0x79'),'ListId']);if(_0x4c0e67[_0xe1b9('0x5a')]['id']){delete _0x4c0e67[_0xe1b9('0x5a')]['id'];}if(_[_0xe1b9('0x7a')](_0x4c0e67[_0xe1b9('0x5a')][_0xe1b9('0x7b')])){throw new db[(_0xe1b9('0x73'))]['ValidationError'](_0xe1b9('0x7c'));}if(_[_0xe1b9('0x7a')](_0x4c0e67[_0xe1b9('0x5a')][_0xe1b9('0x5a')])||_0x4c0e67[_0xe1b9('0x5a')][_0xe1b9('0x5a')]===''){throw new db['Sequelize'][(_0xe1b9('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe1b9('0x7a')](_0x4c0e67[_0xe1b9('0x5a')][_0xe1b9('0x7d')])){throw new db['Sequelize'][(_0xe1b9('0x74'))](_0xe1b9('0x7e')+_0x35df09);}if(!_['includes'](_0x35df09,_0x4c0e67[_0xe1b9('0x5a')][_0xe1b9('0x7d')])){throw new db[(_0xe1b9('0x73'))][(_0xe1b9('0x74'))](_0xe1b9('0x7f')+_0x35df09);}_0x16a0c7[_0x4c0e67['body'][_0xe1b9('0x7d')]]=_0x4c0e67['body']['from'];})['then'](function(){return db['OpenchannelAccount'][_0xe1b9('0x58')]({'where':{'id':_0x4c0e67[_0xe1b9('0x54')]['id']},'include':[{'model':db[_0xe1b9('0x80')],'as':'List','include':[{'model':db['CmContact'],'as':_0xe1b9('0x81'),'where':_0x16a0c7,'limit':0x1,'order':[[_0xe1b9('0x78'),'DESC']]}]},{'model':db[_0xe1b9('0x82')],'as':'Applications'}]});})[_0xe1b9('0x34')](handleEntityNotFound(_0x2b3931,null))[_0xe1b9('0x34')](function(_0x54ef6c){if(_0x54ef6c&&_0x54ef6c[_0xe1b9('0x83')]){_0x267fc0['account']=_0x54ef6c;_0x267fc0['applications']=_0x54ef6c[_0xe1b9('0x84')];_0x267fc0[_0xe1b9('0x85')]=_0x54ef6c[_0xe1b9('0x83')];_0x267fc0[_0xe1b9('0x86')]=_[_0xe1b9('0x87')](_0x267fc0[_0xe1b9('0x86')],[_0xe1b9('0x88')],['asc']);if(_0x267fc0['account'][_0xe1b9('0x84')]){delete _0x267fc0[_0xe1b9('0x89')][_0xe1b9('0x84')];}if(_0x267fc0[_0xe1b9('0x89')][_0xe1b9('0x83')]&&_0x267fc0[_0xe1b9('0x89')][_0xe1b9('0x83')][_0xe1b9('0x81')][_0xe1b9('0x46')]){return _0x267fc0[_0xe1b9('0x89')][_0xe1b9('0x83')][_0xe1b9('0x81')][0x0];}var _0x5d9ff6=_[_0xe1b9('0x1a')](_0x4c0e67[_0xe1b9('0x5a')],{'firstName':_0x4c0e67[_0xe1b9('0x5a')][_0xe1b9('0x7b')],'ListId':_0x54ef6c['ListId']});_0x5d9ff6[_0x4c0e67[_0xe1b9('0x5a')][_0xe1b9('0x7d')]]=_0x4c0e67[_0xe1b9('0x5a')]['from'];return db[_0xe1b9('0x72')][_0xe1b9('0x59')](_0x5d9ff6,{'fields':_0x3b07ce,'raw':!![]});}})[_0xe1b9('0x34')](handleEntityNotFound(_0x2b3931,null))['then'](function(_0x5db070){_0x267fc0[_0xe1b9('0x8a')]=_0x5db070;if(_0x5db070){var _0x251c7f={'ContactId':_0x5db070['id'],'OpenchannelAccountId':_0x4c0e67['params']['id'],'from':(_0x5db070[_0xe1b9('0x8b')]||'')+'\x20'+(_0x5db070[_0xe1b9('0x8c')]||'')};var _0x490133={'OpenchannelAccountId':_0x4c0e67[_0xe1b9('0x54')]['id'],'closed':![]};if(_0x4c0e67[_0xe1b9('0x5a')]['threadId']){_0x490133[_0xe1b9('0x8d')]=_0x4c0e67[_0xe1b9('0x5a')][_0xe1b9('0x8d')];return db['OpenchannelInteraction'][_0xe1b9('0x58')]({'where':_0x490133})[_0xe1b9('0x34')](function(_0x2bae2b){if(_0x2bae2b){return[_0x2bae2b,![]];}_0x251c7f[_0xe1b9('0x8d')]=_0x4c0e67['body']['threadId'];_0x251c7f[_0xe1b9('0x8e')]=_0x4c0e67[_0xe1b9('0x5a')][_0xe1b9('0x8e')];return db[_0xe1b9('0x8f')][_0xe1b9('0x59')](_0x251c7f)['then'](function(_0x360717){return[_0x360717,!![]];});});}else{_0x490133['threadId']=null;}_0x490133[_0xe1b9('0x90')]=_0x5db070['id'];return db[_0xe1b9('0x8f')][_0xe1b9('0x58')]({'where':_0x490133})[_0xe1b9('0x34')](function(_0x13ecfd){if(_0x13ecfd){return[_0x13ecfd,![]];}return db['OpenchannelInteraction']['create'](_0x251c7f)[_0xe1b9('0x34')](function(_0x375d0d){return[_0x375d0d,!![]];});});}})['spread'](function(_0x135b88,_0x509116){if(_0x135b88){_0x5a04ad=_0x509116;if(!_0x509116){var _0x4670cd={'from':(_0x267fc0[_0xe1b9('0x8a')]['firstName']||'')+'\x20'+(_0x267fc0[_0xe1b9('0x8a')][_0xe1b9('0x8c')]||'')};if(_0x4c0e67['body'][_0xe1b9('0x8d')]&&_0x4c0e67[_0xe1b9('0x5a')]['messageId']&&_0x4c0e67[_0xe1b9('0x5a')][_0xe1b9('0x8d')]!=_0x4c0e67['body'][_0xe1b9('0x91')]){_0x4670cd[_0xe1b9('0x8d')]=_0x4c0e67[_0xe1b9('0x5a')][_0xe1b9('0x91')];}return _0x135b88['update'](_0x4670cd);}else{return _0x135b88;}}})[_0xe1b9('0x34')](function(_0x19a21e){_0x267fc0['interaction']=_0x19a21e[_0xe1b9('0x5c')]({'plain':!![]});_0x267fc0[_0xe1b9('0x92')][_0xe1b9('0x93')]=_0x5a04ad;if(_0x267fc0[_0xe1b9('0x92')][_0xe1b9('0x93')]){if(_0x267fc0[_0xe1b9('0x89')][_0xe1b9('0x94')]){_0x267fc0[_0xe1b9('0x86')][_0xe1b9('0x95')]({'id':0x0,'priority':_0x267fc0[_0xe1b9('0x86')][_0xe1b9('0x46')]+0x1,'app':'close','appdata':_0xe1b9('0x96'),'interval':_0xe1b9('0x97')});}}return db[_0xe1b9('0x98')][_0xe1b9('0x59')]({'body':_0x4c0e67[_0xe1b9('0x5a')]['body'],'OpenchannelAccountId':_0x4c0e67[_0xe1b9('0x54')]['id'],'OpenchannelInteractionId':_0x19a21e['id'],'direction':'in','ContactId':_0x267fc0['contact']['id'],'AttachmentId':_0x4c0e67[_0xe1b9('0x5a')][_0xe1b9('0x99')]});})[_0xe1b9('0x34')](function(_0x1eed88){_0x267fc0[_0xe1b9('0x25')]=_0x1eed88;if(_0x267fc0['interaction'][_0xe1b9('0x9a')]){return db[_0xe1b9('0x9b')][_0xe1b9('0x58')]({'attributes':['id',_0xe1b9('0x38')],'where':{'id':_0x267fc0[_0xe1b9('0x92')]['UserId']}})[_0xe1b9('0x34')](function(_0x46d704){if(_0x46d704){_0x267fc0[_0xe1b9('0x86')][_0xe1b9('0x9c')]({'id':0x0,'priority':0x0,'app':_0xe1b9('0x9d'),'appdata':_0x46d704['name']+','+(_0x267fc0[_0xe1b9('0x89')][_0xe1b9('0x9e')]||0xa),'interval':_0xe1b9('0x97')});_0x267fc0[_0xe1b9('0x9f')]=![];}return respondWithRpcPromise(_0xe1b9('0xa0'),_0xe1b9('0xa1'),_0x267fc0);});}return respondWithRpcPromise(_0xe1b9('0xa0'),_0xe1b9('0xa1'),_0x267fc0);})['then'](function(_0x35eeea){respondWithRpcPromise('EventManager',_0xe1b9('0xa2'),{'event':'notify','message':_0x35eeea},client9002);return _0x35eeea;})[_0xe1b9('0x34')](respondWithResult(_0x2b3931,null))['catch'](handleError(_0x2b3931,null));};exports[_0xe1b9('0xa3')]=function(_0xdf94a8,_0x1efec8){var _0x3b2fed=_0xdf94a8[_0xe1b9('0x54')]['id'];var _0x57cc78=_0xdf94a8[_0xe1b9('0x5a')];var _0x182d79=0xc8;var _0x2e3de1=null;return db[_0xe1b9('0xa4')][_0xe1b9('0xa5')]({'isolationLevel':db[_0xe1b9('0xa4')][_0xe1b9('0xa6')][_0xe1b9('0xa7')][_0xe1b9('0xa8')]},function(_0x3e1c7c){return db[_0xe1b9('0x3d')][_0xe1b9('0x66')]({'where':{'id':_0x3b2fed},'transaction':_0x3e1c7c})[_0xe1b9('0x34')](function(_0x4ec78b){if(_0x4ec78b){return db[_0xe1b9('0x82')][_0xe1b9('0x35')]({'where':{'OpenchannelAccountId':_0x3b2fed},'transaction':_0x3e1c7c})[_0xe1b9('0x34')](function(){var _0x503bae=_[_0xe1b9('0x3c')](_0x57cc78,function(_0x23ae5f){_0x23ae5f[_0xe1b9('0x6a')]=_0x3b2fed;return _0x23ae5f;});return db[_0xe1b9('0x82')]['bulkCreate'](_0x503bae,{'transaction':_0x3e1c7c});});}else{_0x182d79=0x194;_0x2e3de1=[];}});})[_0xe1b9('0x34')](function(){if(_0x182d79!==0x194){return db[_0xe1b9('0x82')][_0xe1b9('0xa9')]({'where':{'OpenchannelAccountId':_0x3b2fed},'order':_0xe1b9('0x88')})[_0xe1b9('0x34')](function(_0x417d51){_0x2e3de1=_0x417d51;});}})[_0xe1b9('0x27')](function(_0x245f56){_0x182d79=0x1f4;logger['error'](_0x245f56['stack']);if(_0x245f56['name']){delete _0x245f56['name'];}_0x2e3de1=_0x245f56;})[_0xe1b9('0xaa')](function(){if(_0x2e3de1===null){_0x1efec8[_0xe1b9('0x28')](_0x182d79);}else{if(_0x182d79===0x1f4){_0x1efec8['status'](_0x182d79)['send'](_0x2e3de1);}else{_0x1efec8[_0xe1b9('0x29')](_0x182d79)['json'](_0x2e3de1);}}});};exports[_0xe1b9('0xab')]=function(_0x4574c7,_0x575448,_0x1ee5bd){var _0x27b336={};var _0x3ef4cf={};var _0x22e07b;var _0x3bb304;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4574c7[_0xe1b9('0x54')]['id']}})[_0xe1b9('0x34')](handleEntityNotFound(_0x575448,null))[_0xe1b9('0x34')](function(_0x2add65){if(_0x2add65){_0x22e07b=_0x2add65;_0x3ef4cf[_0xe1b9('0x43')]=_['keys'](db[_0xe1b9('0x82')]['rawAttributes']);_0x3ef4cf[_0xe1b9('0x42')]=_[_0xe1b9('0x41')](_0x4574c7[_0xe1b9('0x42')]);_0x3ef4cf[_0xe1b9('0x4a')]=_[_0xe1b9('0x57')](_0x3ef4cf[_0xe1b9('0x43')],_0x3ef4cf[_0xe1b9('0x42')]);_0x27b336['attributes']=_[_0xe1b9('0x57')](_0x3ef4cf[_0xe1b9('0x43')],qs[_0xe1b9('0x45')](_0x4574c7['query']['fields']));_0x27b336['attributes']=_0x27b336['attributes'][_0xe1b9('0x46')]?_0x27b336[_0xe1b9('0x44')]:_0x3ef4cf[_0xe1b9('0x43')];_0x27b336[_0xe1b9('0x48')]=qs['sort'](_0x4574c7[_0xe1b9('0x42')][_0xe1b9('0x68')]);_0x27b336[_0xe1b9('0x49')]=qs[_0xe1b9('0x4a')](_[_0xe1b9('0x69')](_0x4574c7['query'],_0x3ef4cf['filters']));if(_0x4574c7[_0xe1b9('0x42')][_0xe1b9('0x4b')]){_0x27b336['where']=_[_0xe1b9('0x4d')](_0x27b336[_0xe1b9('0x49')],{'$or':_[_0xe1b9('0x3c')](_0x27b336[_0xe1b9('0x44')],function(_0x386b88){var _0x3e2ce1={};_0x3e2ce1[_0x386b88]={'$like':'%'+_0x4574c7[_0xe1b9('0x42')]['filter']+'%'};return _0x3e2ce1;})});}_0x27b336=_[_0xe1b9('0x4d')]({},_0x27b336,_0x4574c7[_0xe1b9('0x4e')]);return _0x22e07b['getApplications'](_0x27b336);}})[_0xe1b9('0x34')](function(_0x47bbd1){if(_0x47bbd1){_0x3bb304=_0x47bbd1[_0xe1b9('0x46')];if(!_0x4574c7[_0xe1b9('0x42')]['hasOwnProperty']('nolimit')){_0x27b336[_0xe1b9('0x2e')]=qs[_0xe1b9('0x2e')](_0x4574c7[_0xe1b9('0x42')][_0xe1b9('0x2e')]);_0x27b336[_0xe1b9('0x2c')]=qs[_0xe1b9('0x2c')](_0x4574c7[_0xe1b9('0x42')][_0xe1b9('0x2c')]);}return _0x22e07b[_0xe1b9('0xab')](_0x27b336);}})[_0xe1b9('0x34')](function(_0x101d12){if(_0x101d12){return _0x101d12?{'count':_0x3bb304,'rows':_0x101d12}:null;}})[_0xe1b9('0x34')](respondWithResult(_0x575448,null))[_0xe1b9('0x27')](handleError(_0x575448,null));};exports['getInteractions']=function(_0x44a8e7,_0x112529,_0xa85a92){var _0x9a3552={'raw':![],'where':{}};var _0x3d2291={};var _0x17d093={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe1b9('0x66')]({'where':{'id':_0x44a8e7[_0xe1b9('0x54')]['id']}})['then'](handleEntityNotFound(_0x112529,null))[_0xe1b9('0x34')](function(_0x55795b){if(_0x55795b){_0x3d2291[_0xe1b9('0x43')]=_[_0xe1b9('0x41')](db['OpenchannelInteraction'][_0xe1b9('0x56')]);_0x3d2291[_0xe1b9('0x42')]=_[_0xe1b9('0x41')](_0x44a8e7[_0xe1b9('0x42')]);_0x3d2291[_0xe1b9('0x4a')]=_[_0xe1b9('0x57')](_0x3d2291[_0xe1b9('0x43')],_0x3d2291['query']);_0x9a3552[_0xe1b9('0x44')]=_['intersection'](_0x3d2291[_0xe1b9('0x43')],qs['fields'](_0x44a8e7[_0xe1b9('0x42')][_0xe1b9('0x45')]));_0x9a3552[_0xe1b9('0x44')]=_0x9a3552['attributes'][_0xe1b9('0x46')]?_0x9a3552['attributes']:_0x3d2291[_0xe1b9('0x43')];if(!_0x44a8e7['query'][_0xe1b9('0x67')](_0xe1b9('0x47'))){_0x9a3552['limit']=qs[_0xe1b9('0x2e')](_0x44a8e7['query'][_0xe1b9('0x2e')]);_0x9a3552[_0xe1b9('0x2c')]=qs['offset'](_0x44a8e7[_0xe1b9('0x42')]['offset']);}_0x9a3552[_0xe1b9('0x48')]=qs['sort'](_0x44a8e7[_0xe1b9('0x42')][_0xe1b9('0x68')]);_0x9a3552[_0xe1b9('0x49')]=qs[_0xe1b9('0x4a')](_[_0xe1b9('0x69')](_0x44a8e7[_0xe1b9('0x42')],_0x3d2291['filters']));_0x9a3552[_0xe1b9('0x49')][_0xe1b9('0x6a')]=_0x55795b['id'];if(_0x44a8e7[_0xe1b9('0x42')][_0xe1b9('0x4b')]){_0x9a3552[_0xe1b9('0x49')]=_[_0xe1b9('0x4d')](_0x9a3552[_0xe1b9('0x49')],{'$or':_[_0xe1b9('0x3c')](_0x9a3552[_0xe1b9('0x44')],function(_0x287670){var _0x155aae={};_0x155aae[_0x287670]={'$like':'%'+_0x44a8e7[_0xe1b9('0x42')][_0xe1b9('0x4b')]+'%'};return _0x155aae;})});}_0x9a3552=_['merge']({},_0x9a3552,_0x44a8e7['options']);return db['OpenchannelInteraction']['count']({'where':_0x9a3552[_0xe1b9('0x49')]})[_0xe1b9('0x34')](function(_0x327871){_0x17d093[_0xe1b9('0x2f')]=_0x327871;if(_0x44a8e7['query'][_0xe1b9('0x4f')]){_0x9a3552[_0xe1b9('0x50')]=[{'model':db['CmContact'],'as':_0xe1b9('0xac'),'required':![]},{'model':db[_0xe1b9('0x9b')],'as':'Owner','attributes':[_0xe1b9('0x38'),'fullname','internal'],'required':![]},{'model':db[_0xe1b9('0xad')],'as':'Tags','attributes':['id',_0xe1b9('0x38'),'color'],'where':_0x44a8e7['query'][_0xe1b9('0xae')]?{'id':_0x44a8e7[_0xe1b9('0x42')][_0xe1b9('0xae')]}:undefined,'required':_0x44a8e7[_0xe1b9('0x42')][_0xe1b9('0xae')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xe1b9('0x51')](_0x9a3552);})['then'](function(_0x1b44ff){_0x17d093[_0xe1b9('0x52')]=_0x1b44ff;return _0x17d093;});}})[_0xe1b9('0x34')](respondWithFilteredResult(_0x112529,_0x9a3552))[_0xe1b9('0x27')](handleError(_0x112529,null));};exports[_0xe1b9('0xaf')]=function(_0x4d2924,_0xfa91f0,_0x3ccc06){return db[_0xe1b9('0x3d')][_0xe1b9('0x58')]({'where':{'id':_0x4d2924['params']['id']}})[_0xe1b9('0x34')](handleEntityNotFound(_0xfa91f0,null))[_0xe1b9('0x34')](function(_0xe61a2e){if(_0xe61a2e){return _0xe61a2e[_0xe1b9('0xaf')](_0x4d2924['body'][_0xe1b9('0x6c')],_['omit'](_0x4d2924['body'],['ids','id'])||{})[_0xe1b9('0xb0')](function(_0x626a31){for(var _0x152b9f=0x0;_0x152b9f<_0x4d2924[_0xe1b9('0x5a')][_0xe1b9('0x6c')][_0xe1b9('0x46')];_0x152b9f+=0x1){socket['emit'](_0xe1b9('0xb1'),{'UserId':Number(_0x4d2924[_0xe1b9('0x5a')][_0xe1b9('0x6c')][_0x152b9f]),'OpenchannelAccountId':Number(_0x4d2924[_0xe1b9('0x54')]['id'])});}return _0x626a31;});}})[_0xe1b9('0x34')](respondWithResult(_0xfa91f0,null))['catch'](handleError(_0xfa91f0,null));};exports[_0xe1b9('0xb2')]=function(_0x2dcb65,_0x1e004b,_0x562c92){return db[_0xe1b9('0x3d')][_0xe1b9('0x58')]({'where':{'id':_0x2dcb65[_0xe1b9('0x54')]['id']}})['then'](handleEntityNotFound(_0x1e004b,null))['then'](function(_0x5784f8){if(_0x5784f8){return _0x5784f8[_0xe1b9('0xb2')](_0x2dcb65[_0xe1b9('0x42')][_0xe1b9('0x6c')])['then'](function(){if(_[_0xe1b9('0xb3')](_0x2dcb65[_0xe1b9('0x42')][_0xe1b9('0x6c')])){for(var _0x42912c=0x0;_0x42912c<_0x2dcb65['query'][_0xe1b9('0x6c')][_0xe1b9('0x46')];_0x42912c+=0x1){socket[_0xe1b9('0xb4')](_0xe1b9('0xb5'),{'UserId':Number(_0x2dcb65['query']['ids'][_0x42912c]),'OpenchannelAccountId':Number(_0x2dcb65['params']['id'])});}}else{socket[_0xe1b9('0xb4')](_0xe1b9('0xb5'),{'UserId':Number(_0x2dcb65[_0xe1b9('0x42')]['ids']),'OpenchannelAccountId':Number(_0x2dcb65[_0xe1b9('0x54')]['id'])});}});}})[_0xe1b9('0x34')](respondWithStatusCode(_0x1e004b,null))[_0xe1b9('0x27')](handleError(_0x1e004b,null));};exports[_0xe1b9('0xb6')]=function(_0x60f1a8,_0x4d3c22,_0x18bf6e){var _0x2be913={};var _0x35626a={};var _0x281c6e;var _0x262bc9;return db[_0xe1b9('0x3d')][_0xe1b9('0x66')]({'where':{'id':_0x60f1a8[_0xe1b9('0x54')]['id']}})[_0xe1b9('0x34')](handleEntityNotFound(_0x4d3c22,null))[_0xe1b9('0x34')](function(_0x3b9957){if(_0x3b9957){_0x281c6e=_0x3b9957;_0x35626a[_0xe1b9('0x43')]=_[_0xe1b9('0x41')](db['User'][_0xe1b9('0x56')]);_0x35626a[_0xe1b9('0x42')]=_['keys'](_0x60f1a8[_0xe1b9('0x42')]);_0x35626a[_0xe1b9('0x4a')]=_[_0xe1b9('0x57')](_0x35626a['model'],_0x35626a[_0xe1b9('0x42')]);_0x2be913[_0xe1b9('0x44')]=_[_0xe1b9('0x57')](_0x35626a['model'],qs[_0xe1b9('0x45')](_0x60f1a8['query'][_0xe1b9('0x45')]));_0x2be913[_0xe1b9('0x44')]=_0x2be913['attributes'][_0xe1b9('0x46')]?_0x2be913[_0xe1b9('0x44')]:_0x35626a[_0xe1b9('0x43')];_0x2be913[_0xe1b9('0x48')]=qs[_0xe1b9('0x68')](_0x60f1a8[_0xe1b9('0x42')]['sort']);_0x2be913['where']=qs[_0xe1b9('0x4a')](_['pick'](_0x60f1a8[_0xe1b9('0x42')],_0x35626a[_0xe1b9('0x4a')]));if(_0x60f1a8[_0xe1b9('0x42')][_0xe1b9('0x4b')]){_0x2be913[_0xe1b9('0x49')]=_[_0xe1b9('0x4d')](_0x2be913[_0xe1b9('0x49')],{'$or':_[_0xe1b9('0x3c')](_0x2be913[_0xe1b9('0x44')],function(_0x23fe23){var _0x590939={};_0x590939[_0x23fe23]={'$like':'%'+_0x60f1a8[_0xe1b9('0x42')][_0xe1b9('0x4b')]+'%'};return _0x590939;})});}_0x2be913=_[_0xe1b9('0x4d')]({},_0x2be913,_0x60f1a8[_0xe1b9('0x4e')]);return _0x281c6e['getAgents'](_0x2be913);}})['then'](function(_0x2f4547){if(_0x2f4547){_0x262bc9=_0x2f4547[_0xe1b9('0x46')];if(!_0x60f1a8[_0xe1b9('0x42')]['hasOwnProperty']('nolimit')){_0x2be913['limit']=qs[_0xe1b9('0x2e')](_0x60f1a8[_0xe1b9('0x42')]['limit']);_0x2be913[_0xe1b9('0x2c')]=qs['offset'](_0x60f1a8[_0xe1b9('0x42')][_0xe1b9('0x2c')]);}return _0x281c6e['getAgents'](_0x2be913);}})['then'](function(_0x1b26cd){if(_0x1b26cd){return _0x1b26cd?{'count':_0x262bc9,'rows':_0x1b26cd}:null;}})['then'](respondWithResult(_0x4d3c22,null))[_0xe1b9('0x27')](handleError(_0x4d3c22,null));};exports['send']=function(_0x26bdc7,_0xf55c5f,_0x180505){var _0x429c82,_0x52bbf4,_0x19092b;if(_[_0xe1b9('0x7a')](_0x26bdc7[_0xe1b9('0x5a')][_0xe1b9('0x5a')])||_0x26bdc7[_0xe1b9('0x5a')][_0xe1b9('0x5a')]===''){throw new db[(_0xe1b9('0x73'))][(_0xe1b9('0x74'))](_0xe1b9('0xb7'));}if(_[_0xe1b9('0x7a')](_0x26bdc7[_0xe1b9('0x5a')]['to'])){}_0x429c82=_0x26bdc7['body']['to'];return db[_0xe1b9('0x3d')]['findOne']({'where':{'id':_0x26bdc7[_0xe1b9('0x54')]['id']}})['then'](handleEntityNotFound(_0xf55c5f,null))[_0xe1b9('0x34')](function(_0x464258){if(_0x464258){return db['OpenchannelAccount'][_0xe1b9('0x58')]({'where':{'id':_0x464258['id']},'include':[{'model':db['CmList'],'as':_0xe1b9('0x83'),'include':[{'model':db[_0xe1b9('0x72')],'as':_0xe1b9('0x81'),'where':{[_0x464258[_0xe1b9('0x7d')]]:_0x429c82},'limit':0x1,'order':[[_0xe1b9('0x78'),_0xe1b9('0xb8')]]}]}]})[_0xe1b9('0x34')](handleEntityNotFound(_0xf55c5f,null))[_0xe1b9('0x34')](function(_0x590c14){if(_0x590c14&&_0x590c14[_0xe1b9('0x83')]){_0x52bbf4=_0x590c14[_0xe1b9('0x5c')]({'plain':!![]});if(_0x52bbf4['List']&&_0x52bbf4[_0xe1b9('0x83')]['Contacts'][_0xe1b9('0x46')]){return _0x52bbf4[_0xe1b9('0x83')][_0xe1b9('0x81')][0x0];}return db[_0xe1b9('0x72')][_0xe1b9('0x59')](_['defaults'](_0x26bdc7[_0xe1b9('0x5a')],{'firstName':_0x429c82,[_0x590c14[_0xe1b9('0x7d')]]:_0x429c82,'phone':_0x429c82,'ListId':_0x52bbf4[_0xe1b9('0xb9')]}));}})[_0xe1b9('0x34')](handleEntityNotFound(_0xf55c5f,null))['then'](function(_0x9de78d){if(_0x9de78d){_0x19092b=_0x9de78d;return db[_0xe1b9('0x8f')]['find']({'where':{'ContactId':_0x19092b['id'],'closed':![],'OpenchannelAccountId':_0x52bbf4['id']}})[_0xe1b9('0x34')](function(_0x30f581){if(_0x30f581){return[_0x30f581,![]];}return db[_0xe1b9('0x8f')][_0xe1b9('0x59')]({'UserId':_0x26bdc7[_0xe1b9('0x5b')]['id'],'ContactId':_0x19092b['id'],'OpenchannelAccountId':_0x52bbf4['id'],'lastMsgDirection':'out','Messages':[_[_0xe1b9('0x4d')](_0x26bdc7['body'],{'read':![],'body':_0x26bdc7[_0xe1b9('0x5a')]['body'],'OpenchannelAccountId':_0x52bbf4['id'],'UserId':_0x26bdc7[_0xe1b9('0x5b')]['id'],'ContactId':_0x19092b['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xe1b9('0xba')}]})[_0xe1b9('0x34')](function(_0x15f8b1){return[_0x15f8b1,!![]];});});}})[_0xe1b9('0xb0')](function(_0x240fa8,_0x981322){if(_0x981322){return _0x240fa8;}return db[_0xe1b9('0x98')][_0xe1b9('0x59')](_[_0xe1b9('0x4d')](_0x26bdc7[_0xe1b9('0x5a')],{'read':![],'body':_0x26bdc7['body'][_0xe1b9('0x5a')],'OpenchannelAccountId':_0x52bbf4['id'],'OpenchannelInteractionId':_0x240fa8['id'],'UserId':_0x26bdc7[_0xe1b9('0x5b')]['id'],'ContactId':_0x19092b['id']}))[_0xe1b9('0x34')](function(_0x493255){_0x240fa8[_0xe1b9('0xbb')]['Messages']=[];_0x240fa8[_0xe1b9('0xbb')][_0xe1b9('0xba')][_0xe1b9('0x95')](_0x493255[_0xe1b9('0xbb')]);return _0x240fa8;});});}})[_0xe1b9('0x34')](respondWithResult(_0xf55c5f,null))[_0xe1b9('0x27')](handleError(_0xf55c5f,null));}; \ No newline at end of file +var _0x8101=['findOne','hasOwnProperty','nolimit','OpenchannelAccountId','ids','CannedAnswer','getAnswers','order','includeAll','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','updatedAt','DESC','OpenchannelApplication','Applications','List','account','applications','list','orderBy','priority','Contacts','contact','firstName','threadId','OpenchannelInteraction','externalUrl','spread','lastName','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','addApplications','sequelize','transaction','ISOLATION_LEVELS','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','tag','omit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','emit','getAgents','Messages','dataValues','push','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','get','OpenchannelAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','Pause','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','sort','where','pick','filter','merge','options','OpenchannelAccount','include','findAll','rows','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions'];(function(_0x223daf,_0x57678f){var _0x2bad68=function(_0x4da80a){while(--_0x4da80a){_0x223daf['push'](_0x223daf['shift']());}};_0x2bad68(++_0x57678f);}(_0x8101,0x10b));var _0x1810=function(_0x425b19,_0x2dcf14){_0x425b19=_0x425b19-0x0;var _0x15ecab=_0x8101[_0x425b19];return _0x15ecab;};'use strict';var emlformat=require(_0x1810('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1810('0x1'));var jsonpatch=require(_0x1810('0x2'));var rp=require(_0x1810('0x3'));var moment=require(_0x1810('0x4'));var BPromise=require(_0x1810('0x5'));var Mustache=require(_0x1810('0x6'));var util=require(_0x1810('0x7'));var path=require(_0x1810('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1810('0x9'));var fs=require('fs');var fs_extra=require(_0x1810('0xa'));var _=require(_0x1810('0xb'));var squel=require(_0x1810('0xc'));var crypto=require(_0x1810('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1810('0xe'));var toCsv=require(_0x1810('0xf'));var querystring=require(_0x1810('0x10'));var Papa=require(_0x1810('0x11'));var Redis=require('ioredis');var authService=require(_0x1810('0x12'));var qs=require(_0x1810('0x13'));var as=require(_0x1810('0x14'));var hardwareService=require(_0x1810('0x15'));var logger=require('../../config/logger')(_0x1810('0x16'));var utils=require(_0x1810('0x17'));var config=require(_0x1810('0x18'));var licenseUtil=require(_0x1810('0x19'));var db=require('../../mysqldb')['db'];config[_0x1810('0x1a')]=_[_0x1810('0x1b')](config[_0x1810('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x1810('0x1c'))(new Redis(config[_0x1810('0x1a')]));require(_0x1810('0x1d'))['register'](socket);var jayson=require(_0x1810('0x1e'));var client=jayson[_0x1810('0x1f')][_0x1810('0x20')]({'port':0x232c});var client9002=jayson[_0x1810('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x60c9d9,_0x5ce6db,_0x22d881,_0x433615){return new BPromise(function(_0xd27b40,_0x1dce22){var _0xfa10a7=_0x433615||client;return _0xfa10a7['request'](_0x60c9d9,_0x22d881)['then'](function(_0x41cd45){logger[_0x1810('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x5ce6db,_0x1810('0x22'));logger[_0x1810('0x23')](_0x1810('0x24'),_0x5ce6db,_0x1810('0x22'),JSON[_0x1810('0x25')](_0x41cd45));if(_0x41cd45[_0x1810('0x26')]){if(_0x41cd45[_0x1810('0x26')]['code']===0x1f4){logger[_0x1810('0x26')](_0x1810('0x27'),_0x5ce6db,_0x41cd45[_0x1810('0x26')][_0x1810('0x28')]);return _0x1dce22(_0x41cd45[_0x1810('0x26')][_0x1810('0x28')]);}logger[_0x1810('0x26')](_0x1810('0x27'),_0x5ce6db,_0x41cd45[_0x1810('0x26')]['message']);return _0xd27b40(_0x41cd45[_0x1810('0x26')][_0x1810('0x28')]);}else{logger[_0x1810('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x5ce6db,_0x1810('0x22'));_0xd27b40(_0x41cd45[_0x1810('0x29')][_0x1810('0x28')]);}})[_0x1810('0x2a')](function(_0x2c8620){logger['error'](_0x1810('0x27'),_0x5ce6db,_0x2c8620);_0x1dce22(_0x2c8620);});});}function respondWithStatusCode(_0x3954fa,_0x1d5012){_0x1d5012=_0x1d5012||0xcc;return function(_0x6c5c41){if(_0x6c5c41){return _0x3954fa['sendStatus'](_0x1d5012);}return _0x3954fa[_0x1810('0x2b')](_0x1d5012)[_0x1810('0x2c')]();};}function respondWithResult(_0x582b66,_0x11fc49){_0x11fc49=_0x11fc49||0xc8;return function(_0xdd7a46){if(_0xdd7a46){return _0x582b66[_0x1810('0x2b')](_0x11fc49)['json'](_0xdd7a46);}};}function respondWithFilteredResult(_0x1f1dec,_0xcae248){return function(_0x2d7a20){if(_0x2d7a20){var _0x58415e=typeof _0xcae248[_0x1810('0x2d')]===_0x1810('0x2e')&&typeof _0xcae248[_0x1810('0x2f')]===_0x1810('0x2e');var _0x5104a2=_0x2d7a20[_0x1810('0x30')];var _0x5901c0=_0x58415e?0x0:_0xcae248[_0x1810('0x2d')];var _0x1b134c=_0x58415e?_0x2d7a20[_0x1810('0x30')]:_0xcae248[_0x1810('0x2d')]+_0xcae248['limit'];var _0x57e6a2;if(_0x1b134c>=_0x5104a2){_0x1b134c=_0x5104a2;_0x57e6a2=0xc8;}else{_0x57e6a2=0xce;}_0x1f1dec[_0x1810('0x2b')](_0x57e6a2);return _0x1f1dec['set'](_0x1810('0x31'),_0x5901c0+'-'+_0x1b134c+'/'+_0x5104a2)[_0x1810('0x32')](_0x2d7a20);}return null;};}function patchUpdates(_0x1ba484){return function(_0x176c22){try{jsonpatch[_0x1810('0x33')](_0x176c22,_0x1ba484,!![]);}catch(_0x2c9be6){return BPromise[_0x1810('0x34')](_0x2c9be6);}return _0x176c22['save']();};}function saveUpdates(_0x1a4b4b,_0x143cd5){return function(_0x3fa20e){if(_0x3fa20e){return _0x3fa20e[_0x1810('0x35')](_0x1a4b4b)['then'](function(_0x2d555b){return _0x2d555b;});}return null;};}function removeEntity(_0x139192,_0x252e31){return function(_0x3917bf){if(_0x3917bf){return _0x3917bf['destroy']()[_0x1810('0x36')](function(){var _0x472d39=_0x3917bf[_0x1810('0x37')]({'plain':!![]});var _0x3bcf64=_0x1810('0x38');return db[_0x1810('0x39')][_0x1810('0x3a')]({'where':{'type':_0x3bcf64,'resourceId':_0x472d39['id']}})[_0x1810('0x36')](function(){return _0x3917bf;});})[_0x1810('0x36')](function(){_0x139192['status'](0xcc)[_0x1810('0x2c')]();});}};}function handleEntityNotFound(_0x4a59ff,_0x1c31df){return function(_0x38fe1d){if(!_0x38fe1d){_0x4a59ff[_0x1810('0x3b')](0x194);}return _0x38fe1d;};}function handleError(_0x5a7245,_0x56b9a1){_0x56b9a1=_0x56b9a1||0x1f4;return function(_0x1b1a6b){logger['error'](_0x1b1a6b[_0x1810('0x3c')]);if(_0x1b1a6b[_0x1810('0x3d')]){delete _0x1b1a6b[_0x1810('0x3d')];}_0x5a7245[_0x1810('0x2b')](_0x56b9a1)[_0x1810('0x3e')](_0x1b1a6b);};}exports['index']=function(_0x4e1369,_0x54f06d){var _0x44a1b8={'include':[{'model':db[_0x1810('0x3f')],'as':'mandatoryDispositionPause'}]},_0xebce34={},_0x157107={'count':0x0,'rows':[]};var _0x5e211e=_[_0x1810('0x40')](db['OpenchannelAccount'][_0x1810('0x41')],function(_0x481b2e){return{'name':_0x481b2e[_0x1810('0x42')],'type':_0x481b2e[_0x1810('0x43')][_0x1810('0x44')]};});_0xebce34['model']=_[_0x1810('0x40')](_0x5e211e,_0x1810('0x3d'));_0xebce34['query']=_[_0x1810('0x45')](_0x4e1369[_0x1810('0x46')]);_0xebce34[_0x1810('0x47')]=_[_0x1810('0x48')](_0xebce34[_0x1810('0x49')],_0xebce34[_0x1810('0x46')]);_0x44a1b8[_0x1810('0x4a')]=_['intersection'](_0xebce34[_0x1810('0x49')],qs['fields'](_0x4e1369[_0x1810('0x46')][_0x1810('0x4b')]));_0x44a1b8['attributes']=_0x44a1b8[_0x1810('0x4a')]['length']?_0x44a1b8[_0x1810('0x4a')]:_0xebce34[_0x1810('0x49')];if(!_0x4e1369[_0x1810('0x46')]['hasOwnProperty']('nolimit')){_0x44a1b8['limit']=qs[_0x1810('0x2f')](_0x4e1369[_0x1810('0x46')][_0x1810('0x2f')]);_0x44a1b8[_0x1810('0x2d')]=qs[_0x1810('0x2d')](_0x4e1369[_0x1810('0x46')][_0x1810('0x2d')]);}_0x44a1b8['order']=qs['sort'](_0x4e1369[_0x1810('0x46')][_0x1810('0x4c')]);_0x44a1b8[_0x1810('0x4d')]=qs[_0x1810('0x47')](_[_0x1810('0x4e')](_0x4e1369[_0x1810('0x46')],_0xebce34['filters']),_0x5e211e);if(_0x4e1369[_0x1810('0x46')][_0x1810('0x4f')]){_0x44a1b8[_0x1810('0x4d')]=_[_0x1810('0x50')](_0x44a1b8[_0x1810('0x4d')],{'$or':_['map'](_0x5e211e,function(_0x2587d){if(_0x2587d[_0x1810('0x43')]!=='VIRTUAL'){var _0x559da2={};_0x559da2[_0x2587d['name']]={'$like':'%'+_0x4e1369[_0x1810('0x46')]['filter']+'%'};return _0x559da2;}})});}_0x44a1b8=_[_0x1810('0x50')]({},_0x44a1b8,_0x4e1369[_0x1810('0x51')]);var _0x9c5cfb={'where':_0x44a1b8[_0x1810('0x4d')]};return db[_0x1810('0x52')][_0x1810('0x30')](_0x9c5cfb)[_0x1810('0x36')](function(_0x2eb879){_0x157107['count']=_0x2eb879;if(_0x4e1369[_0x1810('0x46')]['includeAll']){_0x44a1b8[_0x1810('0x53')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x1810('0x54')](_0x44a1b8);})[_0x1810('0x36')](function(_0x164966){_0x157107[_0x1810('0x55')]=_0x164966;return _0x157107;})['then'](respondWithFilteredResult(_0x54f06d,_0x44a1b8))[_0x1810('0x2a')](handleError(_0x54f06d,null));};exports[_0x1810('0x56')]=function(_0x32554d,_0x8eb923){var _0x5c0f94={'raw':![],'where':{'id':_0x32554d['params']['id']},'include':[{'model':db[_0x1810('0x3f')],'as':'mandatoryDispositionPause'}]},_0x259a9a={};_0x259a9a[_0x1810('0x49')]=_[_0x1810('0x45')](db[_0x1810('0x52')][_0x1810('0x41')]);_0x259a9a[_0x1810('0x46')]=_[_0x1810('0x45')](_0x32554d[_0x1810('0x46')]);_0x259a9a['filters']=_[_0x1810('0x48')](_0x259a9a[_0x1810('0x49')],_0x259a9a[_0x1810('0x46')]);_0x5c0f94[_0x1810('0x4a')]=_[_0x1810('0x48')](_0x259a9a[_0x1810('0x49')],qs[_0x1810('0x4b')](_0x32554d[_0x1810('0x46')]['fields']));_0x5c0f94[_0x1810('0x4a')]=_0x5c0f94[_0x1810('0x4a')][_0x1810('0x57')]?_0x5c0f94[_0x1810('0x4a')]:_0x259a9a['model'];if(_0x32554d['query']['includeAll']){_0x5c0f94[_0x1810('0x53')]=[{'all':!![]}];}_0x5c0f94=_[_0x1810('0x50')]({},_0x5c0f94,_0x32554d['options']);return db[_0x1810('0x52')][_0x1810('0x58')](_0x5c0f94)[_0x1810('0x36')](handleEntityNotFound(_0x8eb923,null))[_0x1810('0x36')](respondWithResult(_0x8eb923,null))['catch'](handleError(_0x8eb923,null));};exports[_0x1810('0x59')]=function(_0x2e0b9e,_0x3e85f6){return db['OpenchannelAccount']['create'](_0x2e0b9e[_0x1810('0x5a')],{})['then'](function(_0x12a582){var _0x46cef3=_0x2e0b9e[_0x1810('0x5b')][_0x1810('0x37')]({'plain':!![]});if(!_0x46cef3)throw new Error(_0x1810('0x5c'));if(_0x46cef3[_0x1810('0x5d')]===_0x1810('0x5b')){var _0x2fc54b=_0x12a582['get']({'plain':!![]});var _0x40897c=_0x1810('0x38');return db[_0x1810('0x5e')][_0x1810('0x58')]({'where':{'name':_0x40897c,'userProfileId':_0x46cef3[_0x1810('0x5f')]},'raw':!![]})[_0x1810('0x36')](function(_0x5f3305){if(_0x5f3305&&_0x5f3305[_0x1810('0x60')]===0x0){return db[_0x1810('0x39')]['create']({'name':_0x2fc54b['name'],'resourceId':_0x2fc54b['id'],'type':_0x5f3305[_0x1810('0x3d')],'sectionId':_0x5f3305['id']},{})[_0x1810('0x36')](function(){return _0x12a582;});}else{return _0x12a582;}})[_0x1810('0x2a')](function(_0x264365){logger[_0x1810('0x26')](_0x1810('0x61'),_0x264365);throw _0x264365;});}return _0x12a582;})['then'](respondWithResult(_0x3e85f6,0xc9))[_0x1810('0x2a')](handleError(_0x3e85f6,null));};exports['update']=function(_0x49f232,_0x444191){if(_0x49f232[_0x1810('0x5a')]['id']){delete _0x49f232[_0x1810('0x5a')]['id'];}return db[_0x1810('0x52')][_0x1810('0x58')]({'where':{'id':_0x49f232[_0x1810('0x62')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x1810('0x36')](handleEntityNotFound(_0x444191,null))[_0x1810('0x36')](saveUpdates(_0x49f232[_0x1810('0x5a')],null))[_0x1810('0x36')](respondWithResult(_0x444191,null))[_0x1810('0x2a')](handleError(_0x444191,null));};exports['destroy']=function(_0x17b12e,_0x346043){return db[_0x1810('0x52')]['find']({'where':{'id':_0x17b12e[_0x1810('0x62')]['id']}})[_0x1810('0x36')](handleEntityNotFound(_0x346043,null))[_0x1810('0x36')](removeEntity(_0x346043,null))['catch'](handleError(_0x346043,null));};exports[_0x1810('0x63')]=function(_0x3d78cc,_0x5958b7){return db['OpenchannelAccount']['describe']()['then'](respondWithResult(_0x5958b7,null))[_0x1810('0x2a')](handleError(_0x5958b7,null));};exports[_0x1810('0x64')]=function(_0x5becd0,_0x4f0321,_0x5a88bc){if(_0x5becd0['body']['id']){delete _0x5becd0[_0x1810('0x5a')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x5becd0[_0x1810('0x62')]['id']}})[_0x1810('0x36')](handleEntityNotFound(_0x4f0321,null))['then'](function(_0x3b5f73){if(_0x3b5f73){_0x5becd0['body']['OpenchannelAccountId']=_0x3b5f73['id'];return db[_0x1810('0x65')][_0x1810('0x59')](_0x5becd0[_0x1810('0x5a')]);}})[_0x1810('0x36')](respondWithResult(_0x4f0321,null))[_0x1810('0x2a')](handleError(_0x4f0321,null));};exports[_0x1810('0x66')]=function(_0x57964a,_0x320c31,_0x1edb2a){var _0x4588d7={'raw':![],'where':{}};var _0x2422cb={};var _0x112379={'count':0x0,'rows':[]};return db[_0x1810('0x52')][_0x1810('0x67')]({'where':{'id':_0x57964a[_0x1810('0x62')]['id']}})['then'](handleEntityNotFound(_0x320c31,null))[_0x1810('0x36')](function(_0x2e1b35){if(_0x2e1b35){_0x2422cb[_0x1810('0x49')]=_[_0x1810('0x45')](db[_0x1810('0x65')][_0x1810('0x41')]);_0x2422cb[_0x1810('0x46')]=_[_0x1810('0x45')](_0x57964a['query']);_0x2422cb[_0x1810('0x47')]=_[_0x1810('0x48')](_0x2422cb[_0x1810('0x49')],_0x2422cb[_0x1810('0x46')]);_0x4588d7[_0x1810('0x4a')]=_[_0x1810('0x48')](_0x2422cb['model'],qs[_0x1810('0x4b')](_0x57964a[_0x1810('0x46')][_0x1810('0x4b')]));_0x4588d7['attributes']=_0x4588d7[_0x1810('0x4a')][_0x1810('0x57')]?_0x4588d7[_0x1810('0x4a')]:_0x2422cb[_0x1810('0x49')];if(!_0x57964a[_0x1810('0x46')][_0x1810('0x68')](_0x1810('0x69'))){_0x4588d7[_0x1810('0x2f')]=qs['limit'](_0x57964a[_0x1810('0x46')][_0x1810('0x2f')]);_0x4588d7[_0x1810('0x2d')]=qs['offset'](_0x57964a[_0x1810('0x46')]['offset']);}_0x4588d7['order']=qs[_0x1810('0x4c')](_0x57964a[_0x1810('0x46')][_0x1810('0x4c')]);_0x4588d7[_0x1810('0x4d')]=qs[_0x1810('0x47')](_[_0x1810('0x4e')](_0x57964a[_0x1810('0x46')],_0x2422cb[_0x1810('0x47')]));_0x4588d7['where'][_0x1810('0x6a')]=_0x2e1b35['id'];if(_0x57964a[_0x1810('0x46')][_0x1810('0x4f')]){_0x4588d7['where']=_[_0x1810('0x50')](_0x4588d7['where'],{'$or':_[_0x1810('0x40')](_0x4588d7[_0x1810('0x4a')],function(_0x5c089a){var _0x11fa7d={};_0x11fa7d[_0x5c089a]={'$like':'%'+_0x57964a[_0x1810('0x46')][_0x1810('0x4f')]+'%'};return _0x11fa7d;})});}_0x4588d7=_['merge']({},_0x4588d7,_0x57964a[_0x1810('0x51')]);return db[_0x1810('0x65')]['count']({'where':_0x4588d7[_0x1810('0x4d')]})[_0x1810('0x36')](function(_0x2bd2a8){_0x112379[_0x1810('0x30')]=_0x2bd2a8;if(_0x57964a[_0x1810('0x46')]['includeAll']){_0x4588d7['include']=[{'all':!![]}];}return db[_0x1810('0x65')]['findAll'](_0x4588d7);})[_0x1810('0x36')](function(_0x5cd0c1){_0x112379['rows']=_0x5cd0c1;return _0x112379;});}})[_0x1810('0x36')](respondWithFilteredResult(_0x320c31,_0x4588d7))[_0x1810('0x2a')](handleError(_0x320c31,null));};exports['removeDispositions']=function(_0x4afcff,_0x20fa86,_0x364e91){return db[_0x1810('0x52')][_0x1810('0x58')]({'where':{'id':_0x4afcff['params']['id']}})[_0x1810('0x36')](handleEntityNotFound(_0x20fa86,null))[_0x1810('0x36')](function(_0x438d27){if(_0x438d27){return _0x438d27['removeDispositions'](_0x4afcff[_0x1810('0x46')][_0x1810('0x6b')]);}})[_0x1810('0x36')](respondWithStatusCode(_0x20fa86,null))[_0x1810('0x2a')](handleError(_0x20fa86,null));};exports['addAnswer']=function(_0x2d54fb,_0x4e2304,_0x3c31cd){if(_0x2d54fb[_0x1810('0x5a')]['id']){delete _0x2d54fb[_0x1810('0x5a')]['id'];}return db[_0x1810('0x52')][_0x1810('0x58')]({'where':{'id':_0x2d54fb[_0x1810('0x62')]['id']}})[_0x1810('0x36')](handleEntityNotFound(_0x4e2304,null))[_0x1810('0x36')](function(_0x879e2f){if(_0x879e2f){_0x2d54fb[_0x1810('0x5a')][_0x1810('0x6a')]=_0x879e2f['id'];return db[_0x1810('0x6c')][_0x1810('0x59')](_0x2d54fb['body']);}})['then'](respondWithResult(_0x4e2304,null))[_0x1810('0x2a')](handleError(_0x4e2304,null));};exports[_0x1810('0x6d')]=function(_0x183c69,_0x19905a,_0x5cd3b3){var _0xf6ccfa={'raw':![],'where':{}};var _0x2998bf={};var _0x68e98b={'count':0x0,'rows':[]};return db[_0x1810('0x52')][_0x1810('0x67')]({'where':{'id':_0x183c69[_0x1810('0x62')]['id']}})[_0x1810('0x36')](handleEntityNotFound(_0x19905a,null))[_0x1810('0x36')](function(_0xbdef73){if(_0xbdef73){_0x2998bf[_0x1810('0x49')]=_[_0x1810('0x45')](db[_0x1810('0x6c')][_0x1810('0x41')]);_0x2998bf[_0x1810('0x46')]=_['keys'](_0x183c69[_0x1810('0x46')]);_0x2998bf['filters']=_[_0x1810('0x48')](_0x2998bf[_0x1810('0x49')],_0x2998bf[_0x1810('0x46')]);_0xf6ccfa['attributes']=_[_0x1810('0x48')](_0x2998bf[_0x1810('0x49')],qs[_0x1810('0x4b')](_0x183c69[_0x1810('0x46')][_0x1810('0x4b')]));_0xf6ccfa[_0x1810('0x4a')]=_0xf6ccfa[_0x1810('0x4a')][_0x1810('0x57')]?_0xf6ccfa[_0x1810('0x4a')]:_0x2998bf[_0x1810('0x49')];if(!_0x183c69['query'][_0x1810('0x68')](_0x1810('0x69'))){_0xf6ccfa['limit']=qs[_0x1810('0x2f')](_0x183c69[_0x1810('0x46')][_0x1810('0x2f')]);_0xf6ccfa['offset']=qs['offset'](_0x183c69[_0x1810('0x46')][_0x1810('0x2d')]);}_0xf6ccfa[_0x1810('0x6e')]=qs[_0x1810('0x4c')](_0x183c69[_0x1810('0x46')][_0x1810('0x4c')]);_0xf6ccfa[_0x1810('0x4d')]=qs[_0x1810('0x47')](_[_0x1810('0x4e')](_0x183c69[_0x1810('0x46')],_0x2998bf[_0x1810('0x47')]));_0xf6ccfa[_0x1810('0x4d')][_0x1810('0x6a')]=_0xbdef73['id'];if(_0x183c69['query']['filter']){_0xf6ccfa[_0x1810('0x4d')]=_['merge'](_0xf6ccfa[_0x1810('0x4d')],{'$or':_[_0x1810('0x40')](_0xf6ccfa[_0x1810('0x4a')],function(_0x23b20a){var _0x4bcf71={};_0x4bcf71[_0x23b20a]={'$like':'%'+_0x183c69['query'][_0x1810('0x4f')]+'%'};return _0x4bcf71;})});}_0xf6ccfa=_[_0x1810('0x50')]({},_0xf6ccfa,_0x183c69[_0x1810('0x51')]);return db[_0x1810('0x6c')][_0x1810('0x30')]({'where':_0xf6ccfa[_0x1810('0x4d')]})['then'](function(_0x352903){_0x68e98b[_0x1810('0x30')]=_0x352903;if(_0x183c69[_0x1810('0x46')][_0x1810('0x6f')]){_0xf6ccfa[_0x1810('0x53')]=[{'all':!![]}];}return db[_0x1810('0x6c')][_0x1810('0x54')](_0xf6ccfa);})[_0x1810('0x36')](function(_0x33c407){_0x68e98b[_0x1810('0x55')]=_0x33c407;return _0x68e98b;});}})[_0x1810('0x36')](respondWithFilteredResult(_0x19905a,_0xf6ccfa))[_0x1810('0x2a')](handleError(_0x19905a,null));};exports[_0x1810('0x70')]=function(_0x282426,_0x3c50c4,_0x4a4fd3){return db[_0x1810('0x52')][_0x1810('0x58')]({'where':{'id':_0x282426[_0x1810('0x62')]['id']}})[_0x1810('0x36')](handleEntityNotFound(_0x3c50c4,null))[_0x1810('0x36')](function(_0x200516){if(_0x200516){return _0x200516[_0x1810('0x70')](_0x282426['query'][_0x1810('0x6b')]);}})['then'](respondWithStatusCode(_0x3c50c4,null))[_0x1810('0x2a')](handleError(_0x3c50c4,null));};exports[_0x1810('0x71')]=function(_0x716907,_0x48a74c,_0x14ecb8){var _0x27c482={'body':_0x716907[_0x1810('0x5a')],'channel':'openchannel'};var _0x4ead8f=[];var _0x59b353=[];var _0x441c33={};var _0x208515=![];return db[_0x1810('0x72')]['describe']()[_0x1810('0x36')](function(_0x12b646){if(!_0x12b646){throw new db[(_0x1810('0x73'))][(_0x1810('0x74'))](_0x1810('0x75'));}_0x4ead8f=_[_0x1810('0x76')](_[_0x1810('0x45')](_0x12b646),[_0x1810('0x77'),'updatedAt']);_0x59b353=_[_0x1810('0x76')](_[_0x1810('0x45')](_0x12b646),[_0x1810('0x77'),'updatedAt',_0x1810('0x78'),_0x1810('0x79')]);if(_0x716907[_0x1810('0x5a')]['id']){delete _0x716907[_0x1810('0x5a')]['id'];}if(_[_0x1810('0x7a')](_0x716907['body']['from'])){throw new db[(_0x1810('0x73'))][(_0x1810('0x74'))]('from\x20is\x20mandatory');}if(_[_0x1810('0x7a')](_0x716907[_0x1810('0x5a')][_0x1810('0x5a')])||_0x716907['body'][_0x1810('0x5a')]===''){throw new db[(_0x1810('0x73'))][(_0x1810('0x74'))](_0x1810('0x7b'));}if(_[_0x1810('0x7a')](_0x716907['body'][_0x1810('0x7c')])){throw new db[(_0x1810('0x73'))]['ValidationError'](_0x1810('0x7d')+_0x59b353);}if(!_['includes'](_0x59b353,_0x716907['body'][_0x1810('0x7c')])){throw new db['Sequelize']['ValidationError'](_0x1810('0x7e')+_0x59b353);}_0x441c33[_0x716907[_0x1810('0x5a')][_0x1810('0x7c')]]=_0x716907[_0x1810('0x5a')][_0x1810('0x7f')];})[_0x1810('0x36')](function(){return db[_0x1810('0x52')][_0x1810('0x58')]({'where':{'id':_0x716907[_0x1810('0x62')]['id']},'include':[{'model':db[_0x1810('0x80')],'as':'List','include':[{'model':db[_0x1810('0x72')],'as':'Contacts','where':_0x441c33,'limit':0x1,'order':[[_0x1810('0x81'),_0x1810('0x82')]]}]},{'model':db[_0x1810('0x83')],'as':_0x1810('0x84')}]});})[_0x1810('0x36')](handleEntityNotFound(_0x48a74c,null))['then'](function(_0x1d4ce3){if(_0x1d4ce3&&_0x1d4ce3[_0x1810('0x85')]){_0x27c482[_0x1810('0x86')]=_0x1d4ce3;_0x27c482[_0x1810('0x87')]=_0x1d4ce3[_0x1810('0x84')];_0x27c482[_0x1810('0x88')]=_0x1d4ce3['List'];_0x27c482['applications']=_[_0x1810('0x89')](_0x27c482[_0x1810('0x87')],[_0x1810('0x8a')],['asc']);if(_0x27c482['account'][_0x1810('0x84')]){delete _0x27c482[_0x1810('0x86')][_0x1810('0x84')];}if(_0x27c482[_0x1810('0x86')][_0x1810('0x85')]&&_0x27c482['account']['List']['Contacts'][_0x1810('0x57')]){return _0x27c482[_0x1810('0x86')][_0x1810('0x85')][_0x1810('0x8b')][0x0];}var _0x81e2c7=_[_0x1810('0x1b')](_0x716907[_0x1810('0x5a')],{'firstName':_0x716907[_0x1810('0x5a')][_0x1810('0x7f')],'ListId':_0x1d4ce3[_0x1810('0x79')]});_0x81e2c7[_0x716907[_0x1810('0x5a')]['mapKey']]=_0x716907[_0x1810('0x5a')][_0x1810('0x7f')];return db[_0x1810('0x72')][_0x1810('0x59')](_0x81e2c7,{'fields':_0x4ead8f,'raw':!![]});}})['then'](handleEntityNotFound(_0x48a74c,null))['then'](function(_0x1545b2){_0x27c482[_0x1810('0x8c')]=_0x1545b2;if(_0x1545b2){var _0x45ff17={'ContactId':_0x1545b2['id'],'OpenchannelAccountId':_0x716907[_0x1810('0x62')]['id'],'from':(_0x1545b2[_0x1810('0x8d')]||'')+'\x20'+(_0x1545b2['lastName']||'')};var _0x2dd3a4={'OpenchannelAccountId':_0x716907['params']['id'],'closed':![]};if(_0x716907[_0x1810('0x5a')][_0x1810('0x8e')]){_0x2dd3a4[_0x1810('0x8e')]=_0x716907[_0x1810('0x5a')][_0x1810('0x8e')];return db[_0x1810('0x8f')][_0x1810('0x58')]({'where':_0x2dd3a4})[_0x1810('0x36')](function(_0xf719af){if(_0xf719af){return[_0xf719af,![]];}_0x45ff17[_0x1810('0x8e')]=_0x716907['body'][_0x1810('0x8e')];_0x45ff17[_0x1810('0x90')]=_0x716907[_0x1810('0x5a')][_0x1810('0x90')];return db[_0x1810('0x8f')][_0x1810('0x59')](_0x45ff17)[_0x1810('0x36')](function(_0x6dfac6){return[_0x6dfac6,!![]];});});}else{_0x2dd3a4[_0x1810('0x8e')]=null;}_0x2dd3a4['ContactId']=_0x1545b2['id'];return db[_0x1810('0x8f')][_0x1810('0x58')]({'where':_0x2dd3a4})['then'](function(_0x5212d0){if(_0x5212d0){return[_0x5212d0,![]];}return db[_0x1810('0x8f')]['create'](_0x45ff17)['then'](function(_0x283cb3){return[_0x283cb3,!![]];});});}})[_0x1810('0x91')](function(_0x459b5d,_0x17dadf){if(_0x459b5d){_0x208515=_0x17dadf;if(!_0x17dadf){var _0xd19717={'from':(_0x27c482['contact'][_0x1810('0x8d')]||'')+'\x20'+(_0x27c482[_0x1810('0x8c')][_0x1810('0x92')]||'')};if(_0x716907['body']['threadId']&&_0x716907['body'][_0x1810('0x93')]&&_0x716907[_0x1810('0x5a')][_0x1810('0x8e')]!=_0x716907['body'][_0x1810('0x93')]){_0xd19717[_0x1810('0x8e')]=_0x716907[_0x1810('0x5a')][_0x1810('0x93')];}return _0x459b5d[_0x1810('0x35')](_0xd19717);}else{return _0x459b5d;}}})['then'](function(_0x5b639e){_0x27c482[_0x1810('0x94')]=_0x5b639e[_0x1810('0x37')]({'plain':!![]});_0x27c482[_0x1810('0x94')][_0x1810('0x95')]=_0x208515;if(_0x27c482['interaction'][_0x1810('0x95')]){if(_0x27c482[_0x1810('0x86')][_0x1810('0x96')]){_0x27c482[_0x1810('0x87')]['push']({'id':0x0,'priority':_0x27c482[_0x1810('0x87')][_0x1810('0x57')]+0x1,'app':_0x1810('0x97'),'appdata':_0x1810('0x98'),'interval':_0x1810('0x99')});}}return db[_0x1810('0x9a')]['create']({'body':_0x716907['body'][_0x1810('0x5a')],'OpenchannelAccountId':_0x716907['params']['id'],'OpenchannelInteractionId':_0x5b639e['id'],'direction':'in','ContactId':_0x27c482[_0x1810('0x8c')]['id'],'AttachmentId':_0x716907[_0x1810('0x5a')]['AttachmentId']});})[_0x1810('0x36')](function(_0x2c667d){_0x27c482[_0x1810('0x28')]=_0x2c667d;if(_0x27c482[_0x1810('0x94')][_0x1810('0x9b')]){return db[_0x1810('0x9c')][_0x1810('0x58')]({'attributes':['id',_0x1810('0x3d')],'where':{'id':_0x27c482[_0x1810('0x94')][_0x1810('0x9b')]}})['then'](function(_0x13526b){if(_0x13526b){_0x27c482[_0x1810('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':_0x1810('0x9d'),'appdata':_0x13526b['name']+','+(_0x27c482[_0x1810('0x86')][_0x1810('0x9e')]||0xa),'interval':_0x1810('0x99')});_0x27c482[_0x1810('0x9f')]=![];}return respondWithRpcPromise(_0x1810('0xa0'),'startRouting',_0x27c482);});}return respondWithRpcPromise(_0x1810('0xa0'),_0x1810('0xa1'),_0x27c482);})['then'](function(_0x405f11){respondWithRpcPromise('EventManager','EventManager',{'event':_0x1810('0x71'),'message':_0x405f11},client9002);return _0x405f11;})[_0x1810('0x36')](respondWithResult(_0x48a74c,null))[_0x1810('0x2a')](handleError(_0x48a74c,null));};exports[_0x1810('0xa2')]=function(_0x2bb1d2,_0x53e8ed){var _0x25e2db=_0x2bb1d2['params']['id'];var _0x3e6ef9=_0x2bb1d2['body'];var _0x4e5e0d=0xc8;var _0xa578ae=null;return db[_0x1810('0xa3')][_0x1810('0xa4')]({'isolationLevel':db[_0x1810('0xa3')]['Transaction'][_0x1810('0xa5')]['READ_COMMITTED']},function(_0x1d957b){return db[_0x1810('0x52')][_0x1810('0x67')]({'where':{'id':_0x25e2db},'transaction':_0x1d957b})[_0x1810('0x36')](function(_0x494dd3){if(_0x494dd3){return db[_0x1810('0x83')][_0x1810('0x3a')]({'where':{'OpenchannelAccountId':_0x25e2db},'transaction':_0x1d957b})[_0x1810('0x36')](function(){var _0x98a528=_[_0x1810('0x40')](_0x3e6ef9,function(_0x483db0){_0x483db0[_0x1810('0x6a')]=_0x25e2db;return _0x483db0;});return db['OpenchannelApplication']['bulkCreate'](_0x98a528,{'transaction':_0x1d957b});});}else{_0x4e5e0d=0x194;_0xa578ae=[];}});})[_0x1810('0x36')](function(){if(_0x4e5e0d!==0x194){return db[_0x1810('0x83')][_0x1810('0xa6')]({'where':{'OpenchannelAccountId':_0x25e2db},'order':'priority'})['then'](function(_0x281028){_0xa578ae=_0x281028;});}})[_0x1810('0x2a')](function(_0x2b6d5a){_0x4e5e0d=0x1f4;logger['error'](_0x2b6d5a[_0x1810('0x3c')]);if(_0x2b6d5a[_0x1810('0x3d')]){delete _0x2b6d5a['name'];}_0xa578ae=_0x2b6d5a;})[_0x1810('0xa7')](function(){if(_0xa578ae===null){_0x53e8ed[_0x1810('0x3b')](_0x4e5e0d);}else{if(_0x4e5e0d===0x1f4){_0x53e8ed[_0x1810('0x2b')](_0x4e5e0d)[_0x1810('0x3e')](_0xa578ae);}else{_0x53e8ed[_0x1810('0x2b')](_0x4e5e0d)[_0x1810('0x32')](_0xa578ae);}}});};exports[_0x1810('0xa8')]=function(_0x1969c4,_0x580201,_0x262bd5){var _0x3ae7eb={};var _0x339bbd={};var _0x298b01;var _0x5b918f;return db[_0x1810('0x52')][_0x1810('0x67')]({'where':{'id':_0x1969c4['params']['id']}})[_0x1810('0x36')](handleEntityNotFound(_0x580201,null))[_0x1810('0x36')](function(_0x3e51fe){if(_0x3e51fe){_0x298b01=_0x3e51fe;_0x339bbd[_0x1810('0x49')]=_[_0x1810('0x45')](db[_0x1810('0x83')][_0x1810('0x41')]);_0x339bbd[_0x1810('0x46')]=_[_0x1810('0x45')](_0x1969c4['query']);_0x339bbd['filters']=_[_0x1810('0x48')](_0x339bbd['model'],_0x339bbd[_0x1810('0x46')]);_0x3ae7eb[_0x1810('0x4a')]=_[_0x1810('0x48')](_0x339bbd['model'],qs[_0x1810('0x4b')](_0x1969c4['query'][_0x1810('0x4b')]));_0x3ae7eb[_0x1810('0x4a')]=_0x3ae7eb[_0x1810('0x4a')][_0x1810('0x57')]?_0x3ae7eb[_0x1810('0x4a')]:_0x339bbd[_0x1810('0x49')];_0x3ae7eb[_0x1810('0x6e')]=qs[_0x1810('0x4c')](_0x1969c4[_0x1810('0x46')][_0x1810('0x4c')]);_0x3ae7eb[_0x1810('0x4d')]=qs[_0x1810('0x47')](_[_0x1810('0x4e')](_0x1969c4['query'],_0x339bbd[_0x1810('0x47')]));if(_0x1969c4[_0x1810('0x46')][_0x1810('0x4f')]){_0x3ae7eb[_0x1810('0x4d')]=_[_0x1810('0x50')](_0x3ae7eb[_0x1810('0x4d')],{'$or':_[_0x1810('0x40')](_0x3ae7eb[_0x1810('0x4a')],function(_0x7c2f32){var _0x1551b9={};_0x1551b9[_0x7c2f32]={'$like':'%'+_0x1969c4[_0x1810('0x46')]['filter']+'%'};return _0x1551b9;})});}_0x3ae7eb=_[_0x1810('0x50')]({},_0x3ae7eb,_0x1969c4[_0x1810('0x51')]);return _0x298b01['getApplications'](_0x3ae7eb);}})[_0x1810('0x36')](function(_0x1e5bf3){if(_0x1e5bf3){_0x5b918f=_0x1e5bf3[_0x1810('0x57')];if(!_0x1969c4[_0x1810('0x46')][_0x1810('0x68')](_0x1810('0x69'))){_0x3ae7eb[_0x1810('0x2f')]=qs[_0x1810('0x2f')](_0x1969c4[_0x1810('0x46')][_0x1810('0x2f')]);_0x3ae7eb[_0x1810('0x2d')]=qs[_0x1810('0x2d')](_0x1969c4[_0x1810('0x46')][_0x1810('0x2d')]);}return _0x298b01[_0x1810('0xa8')](_0x3ae7eb);}})[_0x1810('0x36')](function(_0x38aa27){if(_0x38aa27){return _0x38aa27?{'count':_0x5b918f,'rows':_0x38aa27}:null;}})[_0x1810('0x36')](respondWithResult(_0x580201,null))[_0x1810('0x2a')](handleError(_0x580201,null));};exports[_0x1810('0xa9')]=function(_0x724bac,_0x3776a0,_0x252234){var _0x5293c6={'raw':![],'where':{}};var _0xd7ecd5={};var _0xe96ff1={'count':0x0,'rows':[]};return db[_0x1810('0x52')][_0x1810('0x67')]({'where':{'id':_0x724bac[_0x1810('0x62')]['id']}})[_0x1810('0x36')](handleEntityNotFound(_0x3776a0,null))[_0x1810('0x36')](function(_0x4f0546){if(_0x4f0546){_0xd7ecd5[_0x1810('0x49')]=_['keys'](db[_0x1810('0x8f')][_0x1810('0x41')]);_0xd7ecd5['query']=_[_0x1810('0x45')](_0x724bac[_0x1810('0x46')]);_0xd7ecd5[_0x1810('0x47')]=_[_0x1810('0x48')](_0xd7ecd5['model'],_0xd7ecd5['query']);_0x5293c6['attributes']=_[_0x1810('0x48')](_0xd7ecd5[_0x1810('0x49')],qs['fields'](_0x724bac[_0x1810('0x46')][_0x1810('0x4b')]));_0x5293c6[_0x1810('0x4a')]=_0x5293c6['attributes'][_0x1810('0x57')]?_0x5293c6['attributes']:_0xd7ecd5[_0x1810('0x49')];if(!_0x724bac[_0x1810('0x46')][_0x1810('0x68')](_0x1810('0x69'))){_0x5293c6[_0x1810('0x2f')]=qs[_0x1810('0x2f')](_0x724bac[_0x1810('0x46')][_0x1810('0x2f')]);_0x5293c6[_0x1810('0x2d')]=qs[_0x1810('0x2d')](_0x724bac['query'][_0x1810('0x2d')]);}_0x5293c6[_0x1810('0x6e')]=qs[_0x1810('0x4c')](_0x724bac['query'][_0x1810('0x4c')]);_0x5293c6[_0x1810('0x4d')]=qs[_0x1810('0x47')](_[_0x1810('0x4e')](_0x724bac[_0x1810('0x46')],_0xd7ecd5['filters']));_0x5293c6[_0x1810('0x4d')][_0x1810('0x6a')]=_0x4f0546['id'];if(_0x724bac[_0x1810('0x46')]['filter']){_0x5293c6['where']=_[_0x1810('0x50')](_0x5293c6[_0x1810('0x4d')],{'$or':_[_0x1810('0x40')](_0x5293c6[_0x1810('0x4a')],function(_0x32670a){var _0x3dfc16={};_0x3dfc16[_0x32670a]={'$like':'%'+_0x724bac[_0x1810('0x46')][_0x1810('0x4f')]+'%'};return _0x3dfc16;})});}_0x5293c6=_[_0x1810('0x50')]({},_0x5293c6,_0x724bac[_0x1810('0x51')]);return db['OpenchannelInteraction'][_0x1810('0x30')]({'where':_0x5293c6[_0x1810('0x4d')]})['then'](function(_0x56f9f2){_0xe96ff1[_0x1810('0x30')]=_0x56f9f2;if(_0x724bac[_0x1810('0x46')]['includeAll']){_0x5293c6[_0x1810('0x53')]=[{'model':db[_0x1810('0x72')],'as':_0x1810('0xaa'),'required':![]},{'model':db[_0x1810('0x9c')],'as':_0x1810('0xab'),'attributes':[_0x1810('0x3d'),_0x1810('0xac'),'internal'],'required':![]},{'model':db[_0x1810('0xad')],'as':'Tags','attributes':['id',_0x1810('0x3d'),'color'],'where':_0x724bac['query']['tag']?{'id':_0x724bac[_0x1810('0x46')][_0x1810('0xae')]}:undefined,'required':_0x724bac[_0x1810('0x46')][_0x1810('0xae')]?!![]:![]}];}return db[_0x1810('0x8f')][_0x1810('0x54')](_0x5293c6);})[_0x1810('0x36')](function(_0x116743){_0xe96ff1[_0x1810('0x55')]=_0x116743;return _0xe96ff1;});}})['then'](respondWithFilteredResult(_0x3776a0,_0x5293c6))[_0x1810('0x2a')](handleError(_0x3776a0,null));};exports['addAgents']=function(_0x58e3b4,_0x254a0f,_0x4c0cda){return db[_0x1810('0x52')][_0x1810('0x58')]({'where':{'id':_0x58e3b4['params']['id']}})[_0x1810('0x36')](handleEntityNotFound(_0x254a0f,null))[_0x1810('0x36')](function(_0x5e713c){if(_0x5e713c){return _0x5e713c['addAgents'](_0x58e3b4[_0x1810('0x5a')][_0x1810('0x6b')],_[_0x1810('0xaf')](_0x58e3b4[_0x1810('0x5a')],['ids','id'])||{})['spread'](function(_0x15ebc9){for(var _0x2d77c4=0x0;_0x2d77c4<_0x58e3b4[_0x1810('0x5a')][_0x1810('0x6b')][_0x1810('0x57')];_0x2d77c4+=0x1){socket['emit'](_0x1810('0xb0'),{'UserId':Number(_0x58e3b4[_0x1810('0x5a')][_0x1810('0x6b')][_0x2d77c4]),'OpenchannelAccountId':Number(_0x58e3b4[_0x1810('0x62')]['id'])});}return _0x15ebc9;});}})[_0x1810('0x36')](respondWithResult(_0x254a0f,null))[_0x1810('0x2a')](handleError(_0x254a0f,null));};exports[_0x1810('0xb1')]=function(_0x2eb248,_0x30cef9,_0x1212dd){return db[_0x1810('0x52')][_0x1810('0x58')]({'where':{'id':_0x2eb248[_0x1810('0x62')]['id']}})['then'](handleEntityNotFound(_0x30cef9,null))[_0x1810('0x36')](function(_0x46d564){if(_0x46d564){return _0x46d564[_0x1810('0xb1')](_0x2eb248[_0x1810('0x46')][_0x1810('0x6b')])['then'](function(){if(_[_0x1810('0xb2')](_0x2eb248['query'][_0x1810('0x6b')])){for(var _0x176226=0x0;_0x176226<_0x2eb248[_0x1810('0x46')][_0x1810('0x6b')]['length'];_0x176226+=0x1){socket['emit'](_0x1810('0xb3'),{'UserId':Number(_0x2eb248[_0x1810('0x46')]['ids'][_0x176226]),'OpenchannelAccountId':Number(_0x2eb248[_0x1810('0x62')]['id'])});}}else{socket[_0x1810('0xb4')](_0x1810('0xb3'),{'UserId':Number(_0x2eb248[_0x1810('0x46')]['ids']),'OpenchannelAccountId':Number(_0x2eb248[_0x1810('0x62')]['id'])});}});}})[_0x1810('0x36')](respondWithStatusCode(_0x30cef9,null))['catch'](handleError(_0x30cef9,null));};exports[_0x1810('0xb5')]=function(_0x141a71,_0x278349,_0x1e4fe1){var _0x348228={};var _0x1d00ad={};var _0x3610a4;var _0x253103;return db['OpenchannelAccount'][_0x1810('0x67')]({'where':{'id':_0x141a71[_0x1810('0x62')]['id']}})['then'](handleEntityNotFound(_0x278349,null))[_0x1810('0x36')](function(_0x3f2711){if(_0x3f2711){_0x3610a4=_0x3f2711;_0x1d00ad[_0x1810('0x49')]=_[_0x1810('0x45')](db[_0x1810('0x9c')][_0x1810('0x41')]);_0x1d00ad[_0x1810('0x46')]=_['keys'](_0x141a71[_0x1810('0x46')]);_0x1d00ad[_0x1810('0x47')]=_[_0x1810('0x48')](_0x1d00ad[_0x1810('0x49')],_0x1d00ad['query']);_0x348228[_0x1810('0x4a')]=_[_0x1810('0x48')](_0x1d00ad[_0x1810('0x49')],qs['fields'](_0x141a71['query'][_0x1810('0x4b')]));_0x348228['attributes']=_0x348228[_0x1810('0x4a')][_0x1810('0x57')]?_0x348228['attributes']:_0x1d00ad[_0x1810('0x49')];_0x348228['order']=qs[_0x1810('0x4c')](_0x141a71[_0x1810('0x46')]['sort']);_0x348228[_0x1810('0x4d')]=qs['filters'](_[_0x1810('0x4e')](_0x141a71[_0x1810('0x46')],_0x1d00ad[_0x1810('0x47')]));if(_0x141a71[_0x1810('0x46')][_0x1810('0x4f')]){_0x348228[_0x1810('0x4d')]=_[_0x1810('0x50')](_0x348228[_0x1810('0x4d')],{'$or':_['map'](_0x348228['attributes'],function(_0x5bb353){var _0x11dd6a={};_0x11dd6a[_0x5bb353]={'$like':'%'+_0x141a71[_0x1810('0x46')]['filter']+'%'};return _0x11dd6a;})});}_0x348228=_[_0x1810('0x50')]({},_0x348228,_0x141a71[_0x1810('0x51')]);return _0x3610a4[_0x1810('0xb5')](_0x348228);}})[_0x1810('0x36')](function(_0x1670b5){if(_0x1670b5){_0x253103=_0x1670b5[_0x1810('0x57')];if(!_0x141a71['query'][_0x1810('0x68')](_0x1810('0x69'))){_0x348228[_0x1810('0x2f')]=qs[_0x1810('0x2f')](_0x141a71[_0x1810('0x46')][_0x1810('0x2f')]);_0x348228[_0x1810('0x2d')]=qs[_0x1810('0x2d')](_0x141a71['query'][_0x1810('0x2d')]);}return _0x3610a4[_0x1810('0xb5')](_0x348228);}})[_0x1810('0x36')](function(_0xe2ae5f){if(_0xe2ae5f){return _0xe2ae5f?{'count':_0x253103,'rows':_0xe2ae5f}:null;}})[_0x1810('0x36')](respondWithResult(_0x278349,null))[_0x1810('0x2a')](handleError(_0x278349,null));};exports[_0x1810('0x3e')]=function(_0x302133,_0x578417,_0x2b7f1b){var _0x43b737,_0x26e77a,_0x2451b9;if(_[_0x1810('0x7a')](_0x302133[_0x1810('0x5a')][_0x1810('0x5a')])||_0x302133[_0x1810('0x5a')][_0x1810('0x5a')]===''){throw new db[(_0x1810('0x73'))][(_0x1810('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x302133[_0x1810('0x5a')]['to'])){}_0x43b737=_0x302133[_0x1810('0x5a')]['to'];return db[_0x1810('0x52')]['findOne']({'where':{'id':_0x302133[_0x1810('0x62')]['id']}})[_0x1810('0x36')](handleEntityNotFound(_0x578417,null))['then'](function(_0x13ce0e){if(_0x13ce0e){return db['OpenchannelAccount'][_0x1810('0x58')]({'where':{'id':_0x13ce0e['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x1810('0x72')],'as':'Contacts','where':{[_0x13ce0e[_0x1810('0x7c')]]:_0x43b737},'limit':0x1,'order':[[_0x1810('0x81'),_0x1810('0x82')]]}]}]})['then'](handleEntityNotFound(_0x578417,null))[_0x1810('0x36')](function(_0x42fbd2){if(_0x42fbd2&&_0x42fbd2[_0x1810('0x85')]){_0x26e77a=_0x42fbd2[_0x1810('0x37')]({'plain':!![]});if(_0x26e77a[_0x1810('0x85')]&&_0x26e77a[_0x1810('0x85')]['Contacts']['length']){return _0x26e77a['List'][_0x1810('0x8b')][0x0];}return db[_0x1810('0x72')][_0x1810('0x59')](_['defaults'](_0x302133[_0x1810('0x5a')],{'firstName':_0x43b737,[_0x42fbd2[_0x1810('0x7c')]]:_0x43b737,'phone':_0x43b737,'ListId':_0x26e77a[_0x1810('0x79')]}));}})[_0x1810('0x36')](handleEntityNotFound(_0x578417,null))[_0x1810('0x36')](function(_0x21da0b){if(_0x21da0b){_0x2451b9=_0x21da0b;return db[_0x1810('0x8f')]['find']({'where':{'ContactId':_0x2451b9['id'],'closed':![],'OpenchannelAccountId':_0x26e77a['id']}})[_0x1810('0x36')](function(_0x4336e9){if(_0x4336e9){return[_0x4336e9,![]];}return db[_0x1810('0x8f')][_0x1810('0x59')]({'UserId':_0x302133['user']['id'],'ContactId':_0x2451b9['id'],'OpenchannelAccountId':_0x26e77a['id'],'lastMsgDirection':'out','Messages':[_[_0x1810('0x50')](_0x302133['body'],{'read':![],'body':_0x302133[_0x1810('0x5a')][_0x1810('0x5a')],'OpenchannelAccountId':_0x26e77a['id'],'UserId':_0x302133['user']['id'],'ContactId':_0x2451b9['id']})]},{'include':[{'model':db[_0x1810('0x9a')],'as':_0x1810('0xb6')}]})[_0x1810('0x36')](function(_0x2f532c){return[_0x2f532c,!![]];});});}})[_0x1810('0x91')](function(_0x3307d3,_0x1e63c7){if(_0x1e63c7){return _0x3307d3;}return db[_0x1810('0x9a')]['create'](_[_0x1810('0x50')](_0x302133['body'],{'read':![],'body':_0x302133[_0x1810('0x5a')][_0x1810('0x5a')],'OpenchannelAccountId':_0x26e77a['id'],'OpenchannelInteractionId':_0x3307d3['id'],'UserId':_0x302133['user']['id'],'ContactId':_0x2451b9['id']}))[_0x1810('0x36')](function(_0xe33250){_0x3307d3['dataValues'][_0x1810('0xb6')]=[];_0x3307d3[_0x1810('0xb7')][_0x1810('0xb6')][_0x1810('0xb8')](_0xe33250[_0x1810('0xb7')]);return _0x3307d3;});});}})['then'](respondWithResult(_0x578417,null))[_0x1810('0x2a')](handleError(_0x578417,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index f10620d..3d70798 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 _0x6f0d=['remove','emit','hook','exports','../../mysqldb','OpenchannelAccount','setMaxListeners','save'];(function(_0x2c6964,_0x43aaba){var _0x6870de=function(_0x4089db){while(--_0x4089db){_0x2c6964['push'](_0x2c6964['shift']());}};_0x6870de(++_0x43aaba);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x72d519,_0x571503){_0x72d519=_0x72d519-0x0;var _0x2d36f5=_0x6f0d[_0x72d519];return _0x2d36f5;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xd6f0('0x0'))['db'][_0xd6f0('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xd6f0('0x2')](0x0);var events={'afterCreate':_0xd6f0('0x3'),'afterUpdate':'update','afterDestroy':_0xd6f0('0x4')};function emitEvent(_0x135a93){return function(_0x2f78fb,_0x25344b,_0x3a757f){OpenchannelAccountEvents['emit'](_0x135a93+':'+_0x2f78fb['id'],_0x2f78fb);OpenchannelAccountEvents[_0xd6f0('0x5')](_0x135a93,_0x2f78fb);_0x3a757f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xd6f0('0x6')](e,emitEvent(event));}}module[_0xd6f0('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x96cc=['remove','emit','hook','exports','events','OpenchannelAccount','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96cc,0x16c));var _0xc96c=function(_0x1ec7aa,_0x2506df){_0x1ec7aa=_0x1ec7aa-0x0;var _0x4bafb7=_0x96cc[_0x1ec7aa];return _0x4bafb7;};'use strict';var EventEmitter=require(_0xc96c('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xc96c('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc96c('0x2'),'afterUpdate':_0xc96c('0x3'),'afterDestroy':_0xc96c('0x4')};function emitEvent(_0x421701){return function(_0x71140d,_0x29b6f1,_0x377e6c){OpenchannelAccountEvents[_0xc96c('0x5')](_0x421701+':'+_0x71140d['id'],_0x71140d);OpenchannelAccountEvents[_0xc96c('0x5')](_0x421701,_0x71140d);_0x377e6c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xc96c('0x6')](e,emitEvent(event));}}module[_0xc96c('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 a52fe15..290e2a9 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(_0xddaca6,_0x467f4f){var _0x269021=function(_0x5380d0){while(--_0x5380d0){_0xddaca6['push'](_0xddaca6['shift']());}};_0x269021(++_0x467f4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x31cc77,_0x264c70){var _0x2f26f6=function(_0x56cb48){while(--_0x56cb48){_0x31cc77['push'](_0x31cc77['shift']());}};_0x2f26f6(++_0x264c70);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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 e45f8a3..e3bd055 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 _0xd64b=['http','redis','defaults','localhost','socket.io-emitter','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x34c6a3,_0x3e1a91){var _0x58fcda=function(_0x104547){while(--_0x104547){_0x34c6a3['push'](_0x34c6a3['shift']());}};_0x58fcda(++_0x3e1a91);}(_0xd64b,0xc1));var _0xbd64=function(_0x29835c,_0x3504c2){_0x29835c=_0x29835c-0x0;var _0x3c4ac0=_0xd64b[_0x29835c];return _0x3c4ac0;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});config[_0xbd64('0x8')]=_[_0xbd64('0x9')](config[_0xbd64('0x8')],{'host':_0xbd64('0xa'),'port':0x18eb});var socket=require(_0xbd64('0xb'))(new Redis(config[_0xbd64('0x8')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x40919e,_0xde7cc8,_0x1250be){return new BPromise(function(_0x4e1adb,_0xc80599){return client[_0xbd64('0xc')](_0x40919e,_0x1250be)[_0xbd64('0xd')](function(_0x18bde8){logger['info'](_0xbd64('0xe'),_0xde7cc8,'request\x20sent');logger[_0xbd64('0xf')](_0xbd64('0x10'),_0xde7cc8,_0xbd64('0x11'),JSON[_0xbd64('0x12')](_0x18bde8));if(_0x18bde8[_0xbd64('0x13')]){if(_0x18bde8[_0xbd64('0x13')][_0xbd64('0x14')]===0x1f4){logger[_0xbd64('0x13')](_0xbd64('0xe'),_0xde7cc8,_0x18bde8['error'][_0xbd64('0x15')]);return _0xc80599(_0x18bde8[_0xbd64('0x13')][_0xbd64('0x15')]);}logger[_0xbd64('0x13')](_0xbd64('0xe'),_0xde7cc8,_0x18bde8['error'][_0xbd64('0x15')]);return _0x4e1adb(_0x18bde8['error'][_0xbd64('0x15')]);}else{logger[_0xbd64('0x16')](_0xbd64('0xe'),_0xde7cc8,_0xbd64('0x11'));_0x4e1adb(_0x18bde8[_0xbd64('0x17')][_0xbd64('0x15')]);}})[_0xbd64('0x18')](function(_0x32c4c7){logger['error'](_0xbd64('0xe'),_0xde7cc8,_0x32c4c7);_0xc80599(_0x32c4c7);});});} \ No newline at end of file +var _0x9d9b=['./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x52d0f6,_0x6ff744){var _0x1597f0=function(_0x524ac8){while(--_0x524ac8){_0x52d0f6['push'](_0x52d0f6['shift']());}};_0x1597f0(++_0x6ff744);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0xae3b80,_0xf38b6){_0xae3b80=_0xae3b80-0x0;var _0x2702d3=_0x9d9b[_0xae3b80];return _0x2702d3;};'use strict';var _=require('lodash');var util=require(_0xb9d9('0x0'));var moment=require(_0xb9d9('0x1'));var BPromise=require('bluebird');var rs=require(_0xb9d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9d9('0x3'))['db'];var utils=require(_0xb9d9('0x4'));var logger=require(_0xb9d9('0x5'))('rpc');var config=require(_0xb9d9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb9d9('0x7')][_0xb9d9('0x8')]({'port':0x232a});config['redis']=_[_0xb9d9('0x9')](config[_0xb9d9('0xa')],{'host':_0xb9d9('0xb'),'port':0x18eb});var socket=require(_0xb9d9('0xc'))(new Redis(config[_0xb9d9('0xa')]));require(_0xb9d9('0xd'))[_0xb9d9('0xe')](socket);function respondWithRpcPromise(_0x5a9c18,_0x5b591e,_0x5f14e7){return new BPromise(function(_0x4cde40,_0x45f507){return client[_0xb9d9('0xf')](_0x5a9c18,_0x5f14e7)[_0xb9d9('0x10')](function(_0x5e226e){logger[_0xb9d9('0x11')](_0xb9d9('0x12'),_0x5b591e,'request\x20sent');logger[_0xb9d9('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5b591e,_0xb9d9('0x14'),JSON[_0xb9d9('0x15')](_0x5e226e));if(_0x5e226e[_0xb9d9('0x16')]){if(_0x5e226e[_0xb9d9('0x16')][_0xb9d9('0x17')]===0x1f4){logger[_0xb9d9('0x16')](_0xb9d9('0x12'),_0x5b591e,_0x5e226e[_0xb9d9('0x16')]['message']);return _0x45f507(_0x5e226e['error'][_0xb9d9('0x18')]);}logger[_0xb9d9('0x16')](_0xb9d9('0x12'),_0x5b591e,_0x5e226e[_0xb9d9('0x16')]['message']);return _0x4cde40(_0x5e226e['error'][_0xb9d9('0x18')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5b591e,_0xb9d9('0x14'));_0x4cde40(_0x5e226e[_0xb9d9('0x19')][_0xb9d9('0x18')]);}})['catch'](function(_0x473b89){logger[_0xb9d9('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5b591e,_0x473b89);_0x45f507(_0x473b89);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index bdd0661..5c8ebbf 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 _0xb469=['./openchannelAccount.events','save','remove','update','register'];(function(_0x4796ad,_0x28e4e9){var _0x2f9bd1=function(_0xe0ea6e){while(--_0xe0ea6e){_0x4796ad['push'](_0x4796ad['shift']());}};_0x2f9bd1(++_0x28e4e9);}(_0xb469,0x13b));var _0x9b46=function(_0x545bc2,_0x450eb7){_0x545bc2=_0x545bc2-0x0;var _0x339357=_0xb469[_0x545bc2];return _0x339357;};'use strict';var OpenchannelAccountEvents=require(_0x9b46('0x0'));var events=[_0x9b46('0x1'),_0x9b46('0x2'),_0x9b46('0x3')];function createListener(_0x1a41e8,_0x895347){return function(_0x9212ae){_0x895347['emit'](_0x1a41e8,_0x9212ae);};}function removeListener(_0x31f853,_0x45322f){return function(){OpenchannelAccountEvents['removeListener'](_0x31f853,_0x45322f);};}exports[_0x9b46('0x4')]=function(_0x405d1c){for(var _0x50b49e=0x0,_0x1b2dd3=events['length'];_0x50b49e<_0x1b2dd3;_0x50b49e++){var _0x4c1ed9=events[_0x50b49e];var _0x34c0de=createListener('openchannelAccount:'+_0x4c1ed9,_0x405d1c);OpenchannelAccountEvents['on'](_0x4c1ed9,_0x34c0de);}}; \ No newline at end of file +var _0x0b25=['remove','update','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x47f484,_0x951b23){var _0xfe3ad2=function(_0x143fb7){while(--_0x143fb7){_0x47f484['push'](_0x47f484['shift']());}};_0xfe3ad2(++_0x951b23);}(_0x0b25,0x155));var _0x50b2=function(_0x144b30,_0x77072d){_0x144b30=_0x144b30-0x0;var _0x1bb7bc=_0x0b25[_0x144b30];return _0x1bb7bc;};'use strict';var OpenchannelAccountEvents=require(_0x50b2('0x0'));var events=[_0x50b2('0x1'),_0x50b2('0x2'),_0x50b2('0x3')];function createListener(_0x2877f1,_0x21c9cc){return function(_0x3cdbb9){_0x21c9cc['emit'](_0x2877f1,_0x3cdbb9);};}function removeListener(_0x4bf98b,_0x2e34c1){return function(){OpenchannelAccountEvents['removeListener'](_0x4bf98b,_0x2e34c1);};}exports[_0x50b2('0x4')]=function(_0x1b77e0){for(var _0x3cbc65=0x0,_0x29278f=events[_0x50b2('0x5')];_0x3cbc65<_0x29278f;_0x3cbc65++){var _0x550cfd=events[_0x3cbc65];var _0x2aeeb0=createListener(_0x50b2('0x6')+_0x550cfd,_0x1b77e0);OpenchannelAccountEvents['on'](_0x550cfd,_0x2aeeb0);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index fe74a38..4c9b925 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 _0xcf41=['/:id','show','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get'];(function(_0x5bff23,_0x268aeb){var _0x49f998=function(_0x10b488){while(--_0x10b488){_0x5bff23['push'](_0x5bff23['shift']());}};_0x49f998(++_0x268aeb);}(_0xcf41,0x138));var _0x1cf4=function(_0x191b36,_0x408c3b){_0x191b36=_0x191b36-0x0;var _0x179fcc=_0xcf41[_0x191b36];return _0x179fcc;};'use strict';var multer=require('multer');var util=require(_0x1cf4('0x0'));var path=require(_0x1cf4('0x1'));var timeout=require(_0x1cf4('0x2'));var express=require(_0x1cf4('0x3'));var router=express[_0x1cf4('0x4')]();var fs_extra=require(_0x1cf4('0x5'));var auth=require(_0x1cf4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1cf4('0x7'));var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0x1cf4('0x8')](),controller[_0x1cf4('0x9')]);router[_0x1cf4('0xa')](_0x1cf4('0xb'),auth[_0x1cf4('0x8')](),controller[_0x1cf4('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1cf4('0xb'),auth[_0x1cf4('0x8')](),controller[_0x1cf4('0xd')]);router[_0x1cf4('0xe')](_0x1cf4('0xb'),auth[_0x1cf4('0x8')](),controller[_0x1cf4('0xf')]);module[_0x1cf4('0x10')]=router; \ No newline at end of file +var _0x9637=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','/:id','isAuthenticated','show','post','create','put','update','multer','util','express','Router'];(function(_0x3f848a,_0x57e33f){var _0x504c7b=function(_0x4157e9){while(--_0x4157e9){_0x3f848a['push'](_0x3f848a['shift']());}};_0x504c7b(++_0x57e33f);}(_0x9637,0x1bc));var _0x7963=function(_0x329768,_0x11a2da){_0x329768=_0x329768-0x0;var _0x25d978=_0x9637[_0x329768];return _0x25d978;};'use strict';var multer=require(_0x7963('0x0'));var util=require(_0x7963('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7963('0x2'));var router=express[_0x7963('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7963('0x4'));var interaction=require(_0x7963('0x5'));var config=require(_0x7963('0x6'));var controller=require(_0x7963('0x7'));router[_0x7963('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7963('0x8')](_0x7963('0x9'),auth[_0x7963('0xa')](),controller[_0x7963('0xb')]);router[_0x7963('0xc')]('/',auth[_0x7963('0xa')](),controller[_0x7963('0xd')]);router[_0x7963('0xe')]('/:id',auth[_0x7963('0xa')](),controller[_0x7963('0xf')]);router['delete'](_0x7963('0x9'),auth[_0x7963('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 75351a1..7d0a8ef 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 _0xc992=['*,*,*,*','INTEGER','noop','TEXT'];(function(_0x5197d4,_0x196c96){var _0x39e9bd=function(_0x16eaa2){while(--_0x16eaa2){_0x5197d4['push'](_0x5197d4['shift']());}};_0x39e9bd(++_0x196c96);}(_0xc992,0x1e5));var _0x2c99=function(_0x4d93e4,_0x22b7bd){_0x4d93e4=_0x4d93e4-0x0;var _0x1ab47e=_0xc992[_0x4d93e4];return _0x1ab47e;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2c99('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2c99('0x1')},'appdata':{'type':Sequelize[_0x2c99('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2c99('0x3')}}; \ No newline at end of file +var _0xaff3=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x4b7540,_0x39bca0){var _0x208ccf=function(_0x21aede){while(--_0x21aede){_0x4b7540['push'](_0x4b7540['shift']());}};_0x208ccf(++_0x39bca0);}(_0xaff3,0x134));var _0x3aff=function(_0x240989,_0x5ecec0){_0x240989=_0x240989-0x0;var _0x57d5f9=_0xaff3[_0x240989];return _0x57d5f9;};'use strict';var Sequelize=require(_0x3aff('0x0'));module[_0x3aff('0x1')]={'priority':{'type':Sequelize[_0x3aff('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3aff('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3aff('0x4')]()},'description':{'type':Sequelize[_0x3aff('0x3')]},'interval':{'type':Sequelize[_0x3aff('0x3')],'defaultValue':_0x3aff('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 1f83c45..357f872 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 _0x4b6a=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','OpenchannelApplication','findAll','rows','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0x4b6a,0xd8));var _0xa4b6=function(_0x18bef7,_0x224af8){_0x18bef7=_0x18bef7-0x0;var _0x476c7d=_0x4b6a[_0x18bef7];return _0x476c7d;};'use strict';var emlformat=require(_0xa4b6('0x0'));var rimraf=require(_0xa4b6('0x1'));var zipdir=require(_0xa4b6('0x2'));var jsonpatch=require(_0xa4b6('0x3'));var rp=require(_0xa4b6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa4b6('0x5'));var util=require('util');var path=require(_0xa4b6('0x6'));var sox=require(_0xa4b6('0x7'));var csv=require(_0xa4b6('0x8'));var ejs=require(_0xa4b6('0x9'));var fs=require('fs');var fs_extra=require(_0xa4b6('0xa'));var _=require(_0xa4b6('0xb'));var squel=require(_0xa4b6('0xc'));var crypto=require('crypto');var jsforce=require(_0xa4b6('0xd'));var deskjs=require(_0xa4b6('0xe'));var toCsv=require(_0xa4b6('0x8'));var querystring=require('querystring');var Papa=require(_0xa4b6('0xf'));var Redis=require(_0xa4b6('0x10'));var authService=require(_0xa4b6('0x11'));var qs=require(_0xa4b6('0x12'));var as=require(_0xa4b6('0x13'));var hardwareService=require(_0xa4b6('0x14'));var logger=require(_0xa4b6('0x15'))(_0xa4b6('0x16'));var utils=require(_0xa4b6('0x17'));var config=require(_0xa4b6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa4b6('0x19'))['db'];function respondWithStatusCode(_0x331976,_0x4dc960){_0x4dc960=_0x4dc960||0xcc;return function(_0x808e74){if(_0x808e74){return _0x331976['sendStatus'](_0x4dc960);}return _0x331976['status'](_0x4dc960)[_0xa4b6('0x1a')]();};}function respondWithResult(_0x3a0f38,_0x526ff1){_0x526ff1=_0x526ff1||0xc8;return function(_0x253f7e){if(_0x253f7e){return _0x3a0f38[_0xa4b6('0x1b')](_0x526ff1)[_0xa4b6('0x1c')](_0x253f7e);}};}function respondWithFilteredResult(_0xca2af4,_0x4045c6){return function(_0x1c1d57){if(_0x1c1d57){var _0x527b19=typeof _0x4045c6['offset']==='undefined'&&typeof _0x4045c6['limit']===_0xa4b6('0x1d');var _0x4d8250=_0x1c1d57[_0xa4b6('0x1e')];var _0x280b1a=_0x527b19?0x0:_0x4045c6[_0xa4b6('0x1f')];var _0x4d5e88=_0x527b19?_0x1c1d57['count']:_0x4045c6[_0xa4b6('0x1f')]+_0x4045c6[_0xa4b6('0x20')];var _0x4a070a;if(_0x4d5e88>=_0x4d8250){_0x4d5e88=_0x4d8250;_0x4a070a=0xc8;}else{_0x4a070a=0xce;}_0xca2af4[_0xa4b6('0x1b')](_0x4a070a);return _0xca2af4[_0xa4b6('0x21')](_0xa4b6('0x22'),_0x280b1a+'-'+_0x4d5e88+'/'+_0x4d8250)['json'](_0x1c1d57);}return null;};}function patchUpdates(_0x35a4e8){return function(_0x1df57c){try{jsonpatch[_0xa4b6('0x23')](_0x1df57c,_0x35a4e8,!![]);}catch(_0x4f9a49){return BPromise[_0xa4b6('0x24')](_0x4f9a49);}return _0x1df57c[_0xa4b6('0x25')]();};}function saveUpdates(_0x2af6ca,_0x1008d2){return function(_0x5e0233){if(_0x5e0233){return _0x5e0233[_0xa4b6('0x26')](_0x2af6ca)['then'](function(_0xa2e387){return _0xa2e387;});}return null;};}function removeEntity(_0x36968e,_0x58f726){return function(_0x5efa00){if(_0x5efa00){return _0x5efa00[_0xa4b6('0x27')]()[_0xa4b6('0x28')](function(){_0x36968e[_0xa4b6('0x1b')](0xcc)[_0xa4b6('0x1a')]();});}};}function handleEntityNotFound(_0x301c4d,_0x21b2e0){return function(_0x3bdc8a){if(!_0x3bdc8a){_0x301c4d[_0xa4b6('0x29')](0x194);}return _0x3bdc8a;};}function handleError(_0x47eddd,_0x12e02b){_0x12e02b=_0x12e02b||0x1f4;return function(_0x3de6b7){logger[_0xa4b6('0x2a')](_0x3de6b7['stack']);if(_0x3de6b7[_0xa4b6('0x2b')]){delete _0x3de6b7['name'];}_0x47eddd[_0xa4b6('0x1b')](_0x12e02b)[_0xa4b6('0x2c')](_0x3de6b7);};}exports[_0xa4b6('0x2d')]=function(_0x3781b8,_0x3e2f23){var _0x3f217b={},_0x7edb4c={},_0xfd0ab3={'count':0x0,'rows':[]};var _0x1aaac4=_['map'](db['OpenchannelApplication'][_0xa4b6('0x2e')],function(_0x5e3889){return{'name':_0x5e3889[_0xa4b6('0x2f')],'type':_0x5e3889[_0xa4b6('0x30')][_0xa4b6('0x31')]};});_0x7edb4c[_0xa4b6('0x32')]=_[_0xa4b6('0x33')](_0x1aaac4,_0xa4b6('0x2b'));_0x7edb4c[_0xa4b6('0x34')]=_['keys'](_0x3781b8[_0xa4b6('0x34')]);_0x7edb4c[_0xa4b6('0x35')]=_[_0xa4b6('0x36')](_0x7edb4c[_0xa4b6('0x32')],_0x7edb4c['query']);_0x3f217b[_0xa4b6('0x37')]=_[_0xa4b6('0x36')](_0x7edb4c['model'],qs['fields'](_0x3781b8[_0xa4b6('0x34')][_0xa4b6('0x38')]));_0x3f217b['attributes']=_0x3f217b[_0xa4b6('0x37')][_0xa4b6('0x39')]?_0x3f217b['attributes']:_0x7edb4c[_0xa4b6('0x32')];if(!_0x3781b8[_0xa4b6('0x34')][_0xa4b6('0x3a')]('nolimit')){_0x3f217b[_0xa4b6('0x20')]=qs[_0xa4b6('0x20')](_0x3781b8[_0xa4b6('0x34')]['limit']);_0x3f217b[_0xa4b6('0x1f')]=qs[_0xa4b6('0x1f')](_0x3781b8[_0xa4b6('0x34')][_0xa4b6('0x1f')]);}_0x3f217b[_0xa4b6('0x3b')]=qs[_0xa4b6('0x3c')](_0x3781b8[_0xa4b6('0x34')][_0xa4b6('0x3c')]);_0x3f217b[_0xa4b6('0x3d')]=qs[_0xa4b6('0x35')](_['pick'](_0x3781b8[_0xa4b6('0x34')],_0x7edb4c[_0xa4b6('0x35')]),_0x1aaac4);if(_0x3781b8[_0xa4b6('0x34')][_0xa4b6('0x3e')]){_0x3f217b[_0xa4b6('0x3d')]=_[_0xa4b6('0x3f')](_0x3f217b[_0xa4b6('0x3d')],{'$or':_[_0xa4b6('0x33')](_0x1aaac4,function(_0x293356){if(_0x293356[_0xa4b6('0x30')]!==_0xa4b6('0x40')){var _0x166268={};_0x166268[_0x293356[_0xa4b6('0x2b')]]={'$like':'%'+_0x3781b8[_0xa4b6('0x34')][_0xa4b6('0x3e')]+'%'};return _0x166268;}})});}_0x3f217b=_[_0xa4b6('0x3f')]({},_0x3f217b,_0x3781b8['options']);var _0x136ccb={'where':_0x3f217b['where']};return db['OpenchannelApplication'][_0xa4b6('0x1e')](_0x136ccb)[_0xa4b6('0x28')](function(_0xf09eb8){_0xfd0ab3[_0xa4b6('0x1e')]=_0xf09eb8;if(_0x3781b8[_0xa4b6('0x34')][_0xa4b6('0x41')]){_0x3f217b[_0xa4b6('0x42')]=[{'all':!![]}];}return db[_0xa4b6('0x43')][_0xa4b6('0x44')](_0x3f217b);})[_0xa4b6('0x28')](function(_0x5aa682){_0xfd0ab3[_0xa4b6('0x45')]=_0x5aa682;return _0xfd0ab3;})[_0xa4b6('0x28')](respondWithFilteredResult(_0x3e2f23,_0x3f217b))[_0xa4b6('0x46')](handleError(_0x3e2f23,null));};exports[_0xa4b6('0x47')]=function(_0x1c9e82,_0x24095c){var _0x3d56d9={'raw':!![],'where':{'id':_0x1c9e82['params']['id']}},_0x4d5b5c={};_0x4d5b5c['model']=_[_0xa4b6('0x48')](db['OpenchannelApplication'][_0xa4b6('0x2e')]);_0x4d5b5c[_0xa4b6('0x34')]=_[_0xa4b6('0x48')](_0x1c9e82[_0xa4b6('0x34')]);_0x4d5b5c[_0xa4b6('0x35')]=_[_0xa4b6('0x36')](_0x4d5b5c[_0xa4b6('0x32')],_0x4d5b5c[_0xa4b6('0x34')]);_0x3d56d9['attributes']=_[_0xa4b6('0x36')](_0x4d5b5c[_0xa4b6('0x32')],qs[_0xa4b6('0x38')](_0x1c9e82[_0xa4b6('0x34')][_0xa4b6('0x38')]));_0x3d56d9[_0xa4b6('0x37')]=_0x3d56d9[_0xa4b6('0x37')][_0xa4b6('0x39')]?_0x3d56d9[_0xa4b6('0x37')]:_0x4d5b5c[_0xa4b6('0x32')];if(_0x1c9e82['query'][_0xa4b6('0x41')]){_0x3d56d9[_0xa4b6('0x42')]=[{'all':!![]}];}_0x3d56d9=_[_0xa4b6('0x3f')]({},_0x3d56d9,_0x1c9e82['options']);return db[_0xa4b6('0x43')][_0xa4b6('0x49')](_0x3d56d9)[_0xa4b6('0x28')](handleEntityNotFound(_0x24095c,null))['then'](respondWithResult(_0x24095c,null))[_0xa4b6('0x46')](handleError(_0x24095c,null));};exports[_0xa4b6('0x4a')]=function(_0x4e834c,_0x30cc35){return db['OpenchannelApplication'][_0xa4b6('0x4a')](_0x4e834c[_0xa4b6('0x4b')],{})[_0xa4b6('0x28')](respondWithResult(_0x30cc35,0xc9))[_0xa4b6('0x46')](handleError(_0x30cc35,null));};exports[_0xa4b6('0x26')]=function(_0x477dc1,_0x532077){if(_0x477dc1['body']['id']){delete _0x477dc1[_0xa4b6('0x4b')]['id'];}return db[_0xa4b6('0x43')]['find']({'where':{'id':_0x477dc1['params']['id']}})[_0xa4b6('0x28')](handleEntityNotFound(_0x532077,null))['then'](saveUpdates(_0x477dc1[_0xa4b6('0x4b')],null))[_0xa4b6('0x28')](respondWithResult(_0x532077,null))['catch'](handleError(_0x532077,null));};exports[_0xa4b6('0x27')]=function(_0x1f7ad6,_0x34c4d3){return db[_0xa4b6('0x43')][_0xa4b6('0x49')]({'where':{'id':_0x1f7ad6[_0xa4b6('0x4c')]['id']}})[_0xa4b6('0x28')](handleEntityNotFound(_0x34c4d3,null))[_0xa4b6('0x28')](removeEntity(_0x34c4d3,null))['catch'](handleError(_0x34c4d3,null));}; \ No newline at end of file +var _0x4981=['find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','stack','name','index','map','OpenchannelApplication','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options'];(function(_0x4f5af0,_0x2710d0){var _0x1ad6c4=function(_0x5101a9){while(--_0x5101a9){_0x4f5af0['push'](_0x4f5af0['shift']());}};_0x1ad6c4(++_0x2710d0);}(_0x4981,0x95));var _0x1498=function(_0x473119,_0x5258c2){_0x473119=_0x473119-0x0;var _0x2d8107=_0x4981[_0x473119];return _0x2d8107;};'use strict';var emlformat=require(_0x1498('0x0'));var rimraf=require(_0x1498('0x1'));var zipdir=require(_0x1498('0x2'));var jsonpatch=require(_0x1498('0x3'));var rp=require('request-promise');var moment=require(_0x1498('0x4'));var BPromise=require(_0x1498('0x5'));var Mustache=require(_0x1498('0x6'));var util=require('util');var path=require(_0x1498('0x7'));var sox=require(_0x1498('0x8'));var csv=require('to-csv');var ejs=require(_0x1498('0x9'));var fs=require('fs');var fs_extra=require(_0x1498('0xa'));var _=require('lodash');var squel=require(_0x1498('0xb'));var crypto=require(_0x1498('0xc'));var jsforce=require(_0x1498('0xd'));var deskjs=require(_0x1498('0xe'));var toCsv=require(_0x1498('0xf'));var querystring=require(_0x1498('0x10'));var Papa=require(_0x1498('0x11'));var Redis=require(_0x1498('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1498('0x13'));var as=require(_0x1498('0x14'));var hardwareService=require(_0x1498('0x15'));var logger=require(_0x1498('0x16'))(_0x1498('0x17'));var utils=require(_0x1498('0x18'));var config=require(_0x1498('0x19'));var licenseUtil=require(_0x1498('0x1a'));var db=require(_0x1498('0x1b'))['db'];function respondWithStatusCode(_0x3cf59b,_0x141382){_0x141382=_0x141382||0xcc;return function(_0x203aac){if(_0x203aac){return _0x3cf59b[_0x1498('0x1c')](_0x141382);}return _0x3cf59b[_0x1498('0x1d')](_0x141382)[_0x1498('0x1e')]();};}function respondWithResult(_0x4d9238,_0xc9a9e0){_0xc9a9e0=_0xc9a9e0||0xc8;return function(_0x3b11ca){if(_0x3b11ca){return _0x4d9238['status'](_0xc9a9e0)[_0x1498('0x1f')](_0x3b11ca);}};}function respondWithFilteredResult(_0x3138ac,_0x59ce8a){return function(_0x58031e){if(_0x58031e){var _0x1e51dd=typeof _0x59ce8a[_0x1498('0x20')]===_0x1498('0x21')&&typeof _0x59ce8a[_0x1498('0x22')]===_0x1498('0x21');var _0x59e66e=_0x58031e[_0x1498('0x23')];var _0x5b8263=_0x1e51dd?0x0:_0x59ce8a[_0x1498('0x20')];var _0x4edcf0=_0x1e51dd?_0x58031e['count']:_0x59ce8a[_0x1498('0x20')]+_0x59ce8a[_0x1498('0x22')];var _0x9d6ba;if(_0x4edcf0>=_0x59e66e){_0x4edcf0=_0x59e66e;_0x9d6ba=0xc8;}else{_0x9d6ba=0xce;}_0x3138ac[_0x1498('0x1d')](_0x9d6ba);return _0x3138ac['set'](_0x1498('0x24'),_0x5b8263+'-'+_0x4edcf0+'/'+_0x59e66e)['json'](_0x58031e);}return null;};}function patchUpdates(_0x29d894){return function(_0x157b18){try{jsonpatch['apply'](_0x157b18,_0x29d894,!![]);}catch(_0x2373f4){return BPromise[_0x1498('0x25')](_0x2373f4);}return _0x157b18[_0x1498('0x26')]();};}function saveUpdates(_0x5811f9,_0x56ffec){return function(_0x2874c1){if(_0x2874c1){return _0x2874c1[_0x1498('0x27')](_0x5811f9)[_0x1498('0x28')](function(_0x3ad75c){return _0x3ad75c;});}return null;};}function removeEntity(_0xe4e0f2,_0x49f67b){return function(_0x15a5a0){if(_0x15a5a0){return _0x15a5a0['destroy']()[_0x1498('0x28')](function(){_0xe4e0f2[_0x1498('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11a7df,_0x8d49e1){return function(_0x543bd0){if(!_0x543bd0){_0x11a7df['sendStatus'](0x194);}return _0x543bd0;};}function handleError(_0x5ec979,_0x541ab2){_0x541ab2=_0x541ab2||0x1f4;return function(_0x3a1594){logger['error'](_0x3a1594[_0x1498('0x29')]);if(_0x3a1594[_0x1498('0x2a')]){delete _0x3a1594[_0x1498('0x2a')];}_0x5ec979['status'](_0x541ab2)['send'](_0x3a1594);};}exports[_0x1498('0x2b')]=function(_0x3751fb,_0x42cdd0){var _0x5dd1e5={},_0x3a0c36={},_0xdb532a={'count':0x0,'rows':[]};var _0x417c23=_[_0x1498('0x2c')](db[_0x1498('0x2d')]['rawAttributes'],function(_0x183b7f){return{'name':_0x183b7f['fieldName'],'type':_0x183b7f['type']['key']};});_0x3a0c36[_0x1498('0x2e')]=_['map'](_0x417c23,_0x1498('0x2a'));_0x3a0c36[_0x1498('0x2f')]=_['keys'](_0x3751fb[_0x1498('0x2f')]);_0x3a0c36[_0x1498('0x30')]=_[_0x1498('0x31')](_0x3a0c36[_0x1498('0x2e')],_0x3a0c36['query']);_0x5dd1e5[_0x1498('0x32')]=_[_0x1498('0x31')](_0x3a0c36[_0x1498('0x2e')],qs[_0x1498('0x33')](_0x3751fb[_0x1498('0x2f')]['fields']));_0x5dd1e5[_0x1498('0x32')]=_0x5dd1e5[_0x1498('0x32')][_0x1498('0x34')]?_0x5dd1e5['attributes']:_0x3a0c36[_0x1498('0x2e')];if(!_0x3751fb['query'][_0x1498('0x35')](_0x1498('0x36'))){_0x5dd1e5[_0x1498('0x22')]=qs[_0x1498('0x22')](_0x3751fb['query'][_0x1498('0x22')]);_0x5dd1e5[_0x1498('0x20')]=qs[_0x1498('0x20')](_0x3751fb['query']['offset']);}_0x5dd1e5[_0x1498('0x37')]=qs[_0x1498('0x38')](_0x3751fb[_0x1498('0x2f')]['sort']);_0x5dd1e5[_0x1498('0x39')]=qs[_0x1498('0x30')](_['pick'](_0x3751fb[_0x1498('0x2f')],_0x3a0c36[_0x1498('0x30')]),_0x417c23);if(_0x3751fb[_0x1498('0x2f')][_0x1498('0x3a')]){_0x5dd1e5[_0x1498('0x39')]=_[_0x1498('0x3b')](_0x5dd1e5[_0x1498('0x39')],{'$or':_[_0x1498('0x2c')](_0x417c23,function(_0x4e751a){if(_0x4e751a['type']!==_0x1498('0x3c')){var _0x381b53={};_0x381b53[_0x4e751a['name']]={'$like':'%'+_0x3751fb[_0x1498('0x2f')]['filter']+'%'};return _0x381b53;}})});}_0x5dd1e5=_[_0x1498('0x3b')]({},_0x5dd1e5,_0x3751fb['options']);var _0x766743={'where':_0x5dd1e5[_0x1498('0x39')]};return db[_0x1498('0x2d')][_0x1498('0x23')](_0x766743)['then'](function(_0x352293){_0xdb532a[_0x1498('0x23')]=_0x352293;if(_0x3751fb[_0x1498('0x2f')][_0x1498('0x3d')]){_0x5dd1e5[_0x1498('0x3e')]=[{'all':!![]}];}return db[_0x1498('0x2d')][_0x1498('0x3f')](_0x5dd1e5);})[_0x1498('0x28')](function(_0xe420d1){_0xdb532a[_0x1498('0x40')]=_0xe420d1;return _0xdb532a;})[_0x1498('0x28')](respondWithFilteredResult(_0x42cdd0,_0x5dd1e5))[_0x1498('0x41')](handleError(_0x42cdd0,null));};exports[_0x1498('0x42')]=function(_0x327549,_0x29c832){var _0x1cc8c7={'raw':!![],'where':{'id':_0x327549[_0x1498('0x43')]['id']}},_0x1d0876={};_0x1d0876[_0x1498('0x2e')]=_[_0x1498('0x44')](db[_0x1498('0x2d')]['rawAttributes']);_0x1d0876[_0x1498('0x2f')]=_['keys'](_0x327549[_0x1498('0x2f')]);_0x1d0876[_0x1498('0x30')]=_['intersection'](_0x1d0876[_0x1498('0x2e')],_0x1d0876[_0x1498('0x2f')]);_0x1cc8c7[_0x1498('0x32')]=_[_0x1498('0x31')](_0x1d0876['model'],qs['fields'](_0x327549[_0x1498('0x2f')]['fields']));_0x1cc8c7[_0x1498('0x32')]=_0x1cc8c7[_0x1498('0x32')][_0x1498('0x34')]?_0x1cc8c7[_0x1498('0x32')]:_0x1d0876['model'];if(_0x327549['query']['includeAll']){_0x1cc8c7[_0x1498('0x3e')]=[{'all':!![]}];}_0x1cc8c7=_[_0x1498('0x3b')]({},_0x1cc8c7,_0x327549[_0x1498('0x45')]);return db['OpenchannelApplication'][_0x1498('0x46')](_0x1cc8c7)[_0x1498('0x28')](handleEntityNotFound(_0x29c832,null))[_0x1498('0x28')](respondWithResult(_0x29c832,null))[_0x1498('0x41')](handleError(_0x29c832,null));};exports[_0x1498('0x47')]=function(_0x47b04a,_0x47139b){return db[_0x1498('0x2d')][_0x1498('0x47')](_0x47b04a['body'],{})[_0x1498('0x28')](respondWithResult(_0x47139b,0xc9))[_0x1498('0x41')](handleError(_0x47139b,null));};exports[_0x1498('0x27')]=function(_0x4a6828,_0x436e18){if(_0x4a6828[_0x1498('0x48')]['id']){delete _0x4a6828[_0x1498('0x48')]['id'];}return db['OpenchannelApplication'][_0x1498('0x46')]({'where':{'id':_0x4a6828[_0x1498('0x43')]['id']}})['then'](handleEntityNotFound(_0x436e18,null))[_0x1498('0x28')](saveUpdates(_0x4a6828['body'],null))['then'](respondWithResult(_0x436e18,null))[_0x1498('0x41')](handleError(_0x436e18,null));};exports['destroy']=function(_0x3ad0c9,_0x5913ee){return db[_0x1498('0x2d')]['find']({'where':{'id':_0x3ad0c9[_0x1498('0x43')]['id']}})['then'](handleEntityNotFound(_0x5913ee,null))[_0x1498('0x28')](removeEntity(_0x5913ee,null))[_0x1498('0x41')](handleError(_0x5913ee,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 4c0389e..b077e89 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 _0x72e7=['../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x50c1f4,_0x14e855){var _0x420908=function(_0x315025){while(--_0x315025){_0x50c1f4['push'](_0x50c1f4['shift']());}};_0x420908(++_0x14e855);}(_0x72e7,0xbc));var _0x772e=function(_0x4dad5d,_0x523a38){_0x4dad5d=_0x4dad5d-0x0;var _0x4f94f5=_0x72e7[_0x4dad5d];return _0x4f94f5;};'use strict';var _=require(_0x772e('0x0'));var util=require(_0x772e('0x1'));var logger=require('../../config/logger')(_0x772e('0x2'));var moment=require(_0x772e('0x3'));var BPromise=require(_0x772e('0x4'));var rp=require(_0x772e('0x5'));var fs=require('fs');var path=require(_0x772e('0x6'));var rimraf=require(_0x772e('0x7'));var config=require(_0x772e('0x8'));var attributes=require(_0x772e('0x9'));module['exports']=function(_0x1faad0,_0x14b77b){return _0x1faad0[_0x772e('0xa')](_0x772e('0xb'),attributes,{'tableName':_0x772e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x772e('0xd')});}; \ No newline at end of file +var _0xc841=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x25e94a,_0x2c4b4f){var _0x5dba67=function(_0x2b27a7){while(--_0x2b27a7){_0x25e94a['push'](_0x25e94a['shift']());}};_0x5dba67(++_0x2c4b4f);}(_0xc841,0x17a));var _0x1c84=function(_0x387ab7,_0x308ba1){_0x387ab7=_0x387ab7-0x0;var _0x1e7f43=_0xc841[_0x387ab7];return _0x1e7f43;};'use strict';var _=require(_0x1c84('0x0'));var util=require(_0x1c84('0x1'));var logger=require(_0x1c84('0x2'))(_0x1c84('0x3'));var moment=require(_0x1c84('0x4'));var BPromise=require(_0x1c84('0x5'));var rp=require(_0x1c84('0x6'));var fs=require('fs');var path=require(_0x1c84('0x7'));var rimraf=require(_0x1c84('0x8'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x1fe757,_0x4b0625){return _0x1fe757[_0x1c84('0x9')](_0x1c84('0xa'),attributes,{'tableName':_0x1c84('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1c84('0xc'),'collate':_0x1c84('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 99e8a6d..4455412 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 _0x97b0=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','code','error','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','update','body','options','raw','lodash','util','moment','../../mysqldb'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0x97b0,0xc4));var _0x097b=function(_0x1884c9,_0xeb3978){_0x1884c9=_0x1884c9-0x0;var _0x56ae1f=_0x97b0[_0x1884c9];return _0x56ae1f;};'use strict';var _=require(_0x097b('0x0'));var util=require(_0x097b('0x1'));var moment=require(_0x097b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x097b('0x3'))['db'];var utils=require(_0x097b('0x4'));var logger=require(_0x097b('0x5'))('rpc');var config=require(_0x097b('0x6'));var jayson=require(_0x097b('0x7'));var client=jayson['client'][_0x097b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b2846,_0x275f31,_0x3a42d2){return new BPromise(function(_0x2ad64c,_0xfed0ad){return client['request'](_0x2b2846,_0x3a42d2)[_0x097b('0x9')](function(_0x1704e1){logger[_0x097b('0xa')]('OpenchannelApplication,\x20%s,\x20%s',_0x275f31,_0x097b('0xb'));logger[_0x097b('0xc')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x275f31,_0x097b('0xb'),JSON[_0x097b('0xd')](_0x1704e1));if(_0x1704e1['error']){if(_0x1704e1['error'][_0x097b('0xe')]===0x1f4){logger[_0x097b('0xf')](_0x097b('0x10'),_0x275f31,_0x1704e1[_0x097b('0xf')][_0x097b('0x11')]);return _0xfed0ad(_0x1704e1[_0x097b('0xf')]['message']);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x275f31,_0x1704e1[_0x097b('0xf')][_0x097b('0x11')]);return _0x2ad64c(_0x1704e1[_0x097b('0xf')]['message']);}else{logger['info'](_0x097b('0x10'),_0x275f31,_0x097b('0xb'));_0x2ad64c(_0x1704e1[_0x097b('0x12')][_0x097b('0x11')]);}})[_0x097b('0x13')](function(_0x3d458e){logger['error'](_0x097b('0x10'),_0x275f31,_0x3d458e);_0xfed0ad(_0x3d458e);});});}exports[_0x097b('0x14')]=function(_0x352dce){var _0x4bda33=this;return new Promise(function(_0x5bd09e,_0x24c4e9){return db['OpenchannelApplication'][_0x097b('0x15')](_0x352dce[_0x097b('0x16')],{'raw':_0x352dce[_0x097b('0x17')]?_0x352dce[_0x097b('0x17')][_0x097b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x352dce[_0x097b('0x17')]?_0x352dce[_0x097b('0x17')]['where']||null:null,'attributes':_0x352dce[_0x097b('0x17')]?_0x352dce[_0x097b('0x17')]['attributes']||null:null,'limit':_0x352dce[_0x097b('0x17')]?_0x352dce[_0x097b('0x17')]['limit']||null:null})[_0x097b('0x9')](function(_0x66e210){logger[_0x097b('0xa')](_0x097b('0x14'),_0x352dce);logger[_0x097b('0xc')](_0x097b('0x14'),_0x352dce,JSON[_0x097b('0xd')](_0x66e210));_0x5bd09e(_0x66e210);})[_0x097b('0x13')](function(_0xf9f28c){logger[_0x097b('0xf')](_0x097b('0x14'),_0xf9f28c[_0x097b('0x11')],_0x352dce);_0x24c4e9(_0x4bda33[_0x097b('0xf')](0x1f4,_0xf9f28c[_0x097b('0x11')]));});});}; \ No newline at end of file +var _0xdc69=['rpc','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','where','attributes','then','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4e89d4,_0x178435){var _0x1ac198=function(_0x2fb9ff){while(--_0x2fb9ff){_0x4e89d4['push'](_0x4e89d4['shift']());}};_0x1ac198(++_0x178435);}(_0xdc69,0x156));var _0x9dc6=function(_0x174a72,_0x46034c){_0x174a72=_0x174a72-0x0;var _0x32cecd=_0xdc69[_0x174a72];return _0x32cecd;};'use strict';var _=require(_0x9dc6('0x0'));var util=require('util');var moment=require(_0x9dc6('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9dc6('0x2'));var db=require(_0x9dc6('0x3'))['db'];var utils=require(_0x9dc6('0x4'));var logger=require(_0x9dc6('0x5'))(_0x9dc6('0x6'));var config=require('../../config/environment');var jayson=require(_0x9dc6('0x7'));var client=jayson[_0x9dc6('0x8')][_0x9dc6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15c6ad,_0x35f627,_0x10dcc1){return new BPromise(function(_0x184485,_0x505274){return client[_0x9dc6('0xa')](_0x15c6ad,_0x10dcc1)['then'](function(_0x1f58bb){logger[_0x9dc6('0xb')](_0x9dc6('0xc'),_0x35f627,_0x9dc6('0xd'));logger[_0x9dc6('0xe')](_0x9dc6('0xf'),_0x35f627,_0x9dc6('0xd'),JSON[_0x9dc6('0x10')](_0x1f58bb));if(_0x1f58bb[_0x9dc6('0x11')]){if(_0x1f58bb[_0x9dc6('0x11')][_0x9dc6('0x12')]===0x1f4){logger[_0x9dc6('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x35f627,_0x1f58bb[_0x9dc6('0x11')][_0x9dc6('0x13')]);return _0x505274(_0x1f58bb['error'][_0x9dc6('0x13')]);}logger['error'](_0x9dc6('0xc'),_0x35f627,_0x1f58bb[_0x9dc6('0x11')][_0x9dc6('0x13')]);return _0x184485(_0x1f58bb['error'][_0x9dc6('0x13')]);}else{logger[_0x9dc6('0xb')](_0x9dc6('0xc'),_0x35f627,_0x9dc6('0xd'));_0x184485(_0x1f58bb[_0x9dc6('0x14')][_0x9dc6('0x13')]);}})[_0x9dc6('0x15')](function(_0xfafc3){logger['error'](_0x9dc6('0xc'),_0x35f627,_0xfafc3);_0x505274(_0xfafc3);});});}exports[_0x9dc6('0x16')]=function(_0x291352){var _0x77cc13=this;return new Promise(function(_0x98c789,_0x11670b){return db[_0x9dc6('0x17')][_0x9dc6('0x18')](_0x291352['body'],{'raw':_0x291352[_0x9dc6('0x19')]?_0x291352[_0x9dc6('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291352['options']?_0x291352[_0x9dc6('0x19')][_0x9dc6('0x1a')]||null:null,'attributes':_0x291352['options']?_0x291352[_0x9dc6('0x19')][_0x9dc6('0x1b')]||null:null,'limit':_0x291352[_0x9dc6('0x19')]?_0x291352[_0x9dc6('0x19')]['limit']||null:null})[_0x9dc6('0x1c')](function(_0x1313cc){logger[_0x9dc6('0xb')](_0x9dc6('0x16'),_0x291352);logger[_0x9dc6('0xe')]('UpdateOpenchannelApplication',_0x291352,JSON['stringify'](_0x1313cc));_0x98c789(_0x1313cc);})[_0x9dc6('0x15')](function(_0xdb2fc2){logger[_0x9dc6('0x11')](_0x9dc6('0x16'),_0xdb2fc2[_0x9dc6('0x13')],_0x291352);_0x11670b(_0x77cc13[_0x9dc6('0x11')](0x1f4,_0xdb2fc2[_0x9dc6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index b156e6c..9d68024 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 _0xd49b=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages','download','post','create','tracked','openchannelinteraction:addtags','addTags','put','openchannel','openchannelinteraction:update','update','delete','destroy','/:id/tags','removeTags'];(function(_0x466d24,_0x3a3d6c){var _0x535da6=function(_0x241c41){while(--_0x241c41){_0x466d24['push'](_0x466d24['shift']());}};_0x535da6(++_0x3a3d6c);}(_0xd49b,0x70));var _0xbd49=function(_0x340da7,_0x13d6fc){_0x340da7=_0x340da7-0x0;var _0x43b466=_0xd49b[_0x340da7];return _0x43b466;};'use strict';var multer=require(_0xbd49('0x0'));var util=require(_0xbd49('0x1'));var path=require(_0xbd49('0x2'));var timeout=require(_0xbd49('0x3'));var express=require(_0xbd49('0x4'));var router=express['Router']();var fs_extra=require(_0xbd49('0x5'));var auth=require(_0xbd49('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbd49('0x7'));var controller=require('./openchannelInteraction.controller');router[_0xbd49('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0xbd49('0x9')](),controller['describe']);router[_0xbd49('0x8')](_0xbd49('0xa'),auth[_0xbd49('0x9')](),controller[_0xbd49('0xb')]);router[_0xbd49('0x8')](_0xbd49('0xc'),auth[_0xbd49('0x9')](),controller[_0xbd49('0xd')]);router[_0xbd49('0x8')]('/:id/download',auth[_0xbd49('0x9')](),controller[_0xbd49('0xe')]);router[_0xbd49('0xf')]('/',auth['isAuthenticated'](),controller[_0xbd49('0x10')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xbd49('0x11')]('openchannel',_0xbd49('0x12')),controller[_0xbd49('0x13')]);router[_0xbd49('0x14')](_0xbd49('0xa'),auth[_0xbd49('0x9')](),interaction[_0xbd49('0x11')](_0xbd49('0x15'),_0xbd49('0x16')),controller[_0xbd49('0x17')]);router[_0xbd49('0x18')]('/:id',auth[_0xbd49('0x9')](),interaction[_0xbd49('0x11')](_0xbd49('0x15'),'openchannelinteraction:destroy'),controller[_0xbd49('0x19')]);router[_0xbd49('0x18')](_0xbd49('0x1a'),auth[_0xbd49('0x9')](),controller[_0xbd49('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xfa2e=['create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','delete','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0xfa2e,0x10d));var _0xefa2=function(_0x3c12e0,_0x2a4ee9){_0x3c12e0=_0x3c12e0-0x0;var _0x463436=_0xfa2e[_0x3c12e0];return _0x463436;};'use strict';var multer=require('multer');var util=require(_0xefa2('0x0'));var path=require(_0xefa2('0x1'));var timeout=require(_0xefa2('0x2'));var express=require(_0xefa2('0x3'));var router=express[_0xefa2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xefa2('0x5'));var interaction=require(_0xefa2('0x6'));var config=require(_0xefa2('0x7'));var controller=require(_0xefa2('0x8'));router[_0xefa2('0x9')]('/',auth['isAuthenticated'](),controller[_0xefa2('0xa')]);router[_0xefa2('0x9')](_0xefa2('0xb'),auth[_0xefa2('0xc')](),controller[_0xefa2('0xd')]);router[_0xefa2('0x9')](_0xefa2('0xe'),auth[_0xefa2('0xc')](),controller[_0xefa2('0xf')]);router['get']('/:id/messages',auth[_0xefa2('0xc')](),controller['getMessages']);router[_0xefa2('0x9')](_0xefa2('0x10'),auth['isAuthenticated'](),controller[_0xefa2('0x11')]);router[_0xefa2('0x12')]('/',auth['isAuthenticated'](),controller[_0xefa2('0x13')]);router[_0xefa2('0x12')](_0xefa2('0x14'),auth[_0xefa2('0xc')](),controller[_0xefa2('0x15')]);router[_0xefa2('0x12')](_0xefa2('0x16'),auth['isAuthenticated'](),interaction[_0xefa2('0x17')](_0xefa2('0x18'),'openchannelinteraction:addtags'),controller[_0xefa2('0x19')]);router[_0xefa2('0x1a')]('/:id',auth[_0xefa2('0xc')](),interaction[_0xefa2('0x17')](_0xefa2('0x18'),_0xefa2('0x1b')),controller['update']);router[_0xefa2('0x1c')](_0xefa2('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0xefa2('0x18'),'openchannelinteraction:destroy'),controller[_0xefa2('0x1d')]);router['delete'](_0xefa2('0x16'),auth['isAuthenticated'](),controller[_0xefa2('0x1e')]);module[_0xefa2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index c23de32..e2964e8 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 _0xa4fa=['STRING','ENUM','out','sequelize','DATE'];(function(_0x1ea754,_0x42814e){var _0x524e3f=function(_0x5e728d){while(--_0x5e728d){_0x1ea754['push'](_0x1ea754['shift']());}};_0x524e3f(++_0x42814e);}(_0xa4fa,0x1ca));var _0xaa4f=function(_0x275217,_0x46c641){_0x275217=_0x275217-0x0;var _0x5217a3=_0xa4fa[_0x275217];return _0x5217a3;};'use strict';var Sequelize=require(_0xaa4f('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaa4f('0x1')]},'disposition':{'type':Sequelize[_0xaa4f('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaa4f('0x2')]},'note':{'type':Sequelize[_0xaa4f('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xaa4f('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xaa4f('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xaa4f('0x3')]('in',_0xaa4f('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xaa4f('0x2')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xaa0b=['DATE','STRING','ENUM','sequelize','exports'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0xaa0b,0x1b1));var _0xbaa0=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xaa0b[_0x45b034];return _0x509cb0;};'use strict';var Sequelize=require(_0xbaa0('0x0'));module[_0xbaa0('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbaa0('0x2')]},'disposition':{'type':Sequelize[_0xbaa0('0x3')]},'secondDisposition':{'type':Sequelize[_0xbaa0('0x3')]},'thirdDisposition':{'type':Sequelize[_0xbaa0('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xbaa0('0x2')]},'threadId':{'type':Sequelize[_0xbaa0('0x3')]},'externalUrl':{'type':Sequelize[_0xbaa0('0x3')]},'lastMsgAt':{'type':Sequelize[_0xbaa0('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xbaa0('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xbaa0('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 6a7a8e0..45dd900 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 _0xa146=['o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','OpenchannelInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','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','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','rows','includeAll','include','options','create','body','params','describe','addMessage','ids','findOne','OpenchannelMessage','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','color','emit','openchannelInteractionTags:save','removeTags','join','root','server','files','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Attachment','Messages','secret','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','renderFile','downloadInteraction.ejs','transcript-','.pdf','download','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','update','then','destroy','error','stack','name','send','fullname','Tags','TagIds','forEach','push','catch','waiting','answered','unmanaged','closed','UserId','talking','total','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','field','from','tools_tags','select','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL'];(function(_0x26088d,_0x31d0e1){var _0x4d2e64=function(_0x2e6528){while(--_0x2e6528){_0x26088d['push'](_0x26088d['shift']());}};_0x4d2e64(++_0x31d0e1);}(_0xa146,0x197));var _0x6a14=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa146[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x6a14('0x0'));var rimraf=require(_0x6a14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a14('0x2'));var rp=require(_0x6a14('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6a14('0x4'));var util=require(_0x6a14('0x5'));var path=require('path');var sox=require(_0x6a14('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a14('0x7'));var _=require(_0x6a14('0x8'));var squel=require(_0x6a14('0x9'));var crypto=require('crypto');var jsforce=require(_0x6a14('0xa'));var deskjs=require(_0x6a14('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6a14('0xc'));var Papa=require(_0x6a14('0xd'));var Redis=require(_0x6a14('0xe'));var authService=require(_0x6a14('0xf'));var qs=require(_0x6a14('0x10'));var as=require(_0x6a14('0x11'));var pdf=require(_0x6a14('0x12'));var hardwareService=require(_0x6a14('0x13'));var logger=require(_0x6a14('0x14'))(_0x6a14('0x15'));var utils=require(_0x6a14('0x16'));var config=require(_0x6a14('0x17'));var licenseUtil=require(_0x6a14('0x18'));var db=require(_0x6a14('0x19'))['db'];config[_0x6a14('0x1a')]=_[_0x6a14('0x1b')](config[_0x6a14('0x1a')],{'host':_0x6a14('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6a14('0x1d'))[_0x6a14('0x1e')](socket);function respondWithStatusCode(_0x393fe1,_0x31114f){_0x31114f=_0x31114f||0xcc;return function(_0x592b3a){if(_0x592b3a){return _0x393fe1[_0x6a14('0x1f')](_0x31114f);}return _0x393fe1['status'](_0x31114f)[_0x6a14('0x20')]();};}function respondWithResult(_0x5ca84d,_0x229041){_0x229041=_0x229041||0xc8;return function(_0x375011){if(_0x375011){return _0x5ca84d[_0x6a14('0x21')](_0x229041)[_0x6a14('0x22')](_0x375011);}};}function respondWithFilteredResult(_0x1d09b9,_0x1d955c){return function(_0x303414){if(_0x303414){var _0xebb10d=typeof _0x1d955c['offset']===_0x6a14('0x23')&&typeof _0x1d955c[_0x6a14('0x24')]===_0x6a14('0x23');var _0x4b67de=_0x303414['count'];var _0x2572b4=_0xebb10d?0x0:_0x1d955c['offset'];var _0x825324=_0xebb10d?_0x303414[_0x6a14('0x25')]:_0x1d955c[_0x6a14('0x26')]+_0x1d955c[_0x6a14('0x24')];var _0x48537c;if(_0x825324>=_0x4b67de){_0x825324=_0x4b67de;_0x48537c=0xc8;}else{_0x48537c=0xce;}_0x1d09b9[_0x6a14('0x21')](_0x48537c);return _0x1d09b9['set'](_0x6a14('0x27'),_0x2572b4+'-'+_0x825324+'/'+_0x4b67de)[_0x6a14('0x22')](_0x303414);}return null;};}function patchUpdates(_0x513f67){return function(_0x3f2beb){try{jsonpatch[_0x6a14('0x28')](_0x3f2beb,_0x513f67,!![]);}catch(_0x410bef){return BPromise['reject'](_0x410bef);}return _0x3f2beb['save']();};}function saveUpdates(_0x4157a3,_0x40a06a){return function(_0x4d758b){if(_0x4d758b){return _0x4d758b[_0x6a14('0x29')](_0x4157a3)[_0x6a14('0x2a')](function(_0x5e4f34){return _0x5e4f34;});}return null;};}function removeEntity(_0x365992,_0x33db09){return function(_0x5243ae){if(_0x5243ae){return _0x5243ae[_0x6a14('0x2b')]()['then'](function(){_0x365992[_0x6a14('0x21')](0xcc)[_0x6a14('0x20')]();});}};}function handleEntityNotFound(_0x1f4647,_0x5c37f6){return function(_0x518092){if(!_0x518092){_0x1f4647[_0x6a14('0x1f')](0x194);}return _0x518092;};}function handleError(_0x40ec60,_0x2a6f0e){_0x2a6f0e=_0x2a6f0e||0x1f4;return function(_0x16a431){logger[_0x6a14('0x2c')](_0x16a431[_0x6a14('0x2d')]);if(_0x16a431[_0x6a14('0x2e')]){delete _0x16a431[_0x6a14('0x2e')];}_0x40ec60[_0x6a14('0x21')](_0x2a6f0e)[_0x6a14('0x2f')](_0x16a431);};}function getInteractionUsers(_0x5b0c00,_0x3d817c){return new BPromise(function(_0x2e12e9,_0x34f49c){try{if(_0x3d817c[_0x5b0c00['id']]){_0x5b0c00['Users']=_['map'](_0x3d817c[_0x5b0c00['id']],function(_0x3b5090){return{'id':_0x3b5090['id'],'fullname':_0x3b5090[_0x6a14('0x30')]};});}}catch(_0x8c32d1){_0x34f49c(_0x8c32d1);}_0x2e12e9(_0x5b0c00);});}function getInteractionTags(_0x17d494,_0x1580b0){return new BPromise(function(_0x38585f,_0x112c4a){try{if(_0x17d494['TagIds']){_0x17d494[_0x6a14('0x31')]=[];_0x17d494[_0x6a14('0x32')]['split'](',')[_0x6a14('0x33')](function(_0x4395c8){_0x17d494[_0x6a14('0x31')][_0x6a14('0x34')](_0x1580b0[_0x4395c8]);});}delete _0x17d494[_0x6a14('0x32')];}catch(_0x38fa64){_0x112c4a(_0x38fa64);}_0x38585f(_0x17d494);});}function updateOpenchannelInteraction(_0x5303b6,_0x2f610a,_0x350e7e){return new BPromise(function(_0x26252a,_0x1c4a75){return getInteractionUsers(_0x5303b6,_0x350e7e)[_0x6a14('0x2a')](function(_0x523a37){return getInteractionTags(_0x523a37,_0x2f610a);})[_0x6a14('0x2a')](function(_0x193f10){return getStateInteraction(_0x193f10);})[_0x6a14('0x2a')](function(_0x43c433){_0x26252a(_0x43c433);})[_0x6a14('0x35')](function(_0x3ddda0){_0x1c4a75(_0x3ddda0);});});}function getStateInteraction(_0x95a623){return new BPromise(function(_0x2f40b2){_0x95a623[_0x6a14('0x36')]=0x0;_0x95a623['talking']=0x0;_0x95a623[_0x6a14('0x37')]=0x0;_0x95a623[_0x6a14('0x38')]=0x0;_0x95a623['total']=0x0;if(!_0x95a623[_0x6a14('0x39')]&&!_0x95a623[_0x6a14('0x3a')]){_0x95a623['waiting']+=0x1;}if(!_0x95a623['closed']&&_0x95a623[_0x6a14('0x3a')]){_0x95a623[_0x6a14('0x3b')]+=0x1;if(_0x95a623[_0x6a14('0x36')]){_0x95a623['waiting']-=0x1;}}if(_0x95a623[_0x6a14('0x39')]&&_0x95a623[_0x6a14('0x3a')]){_0x95a623[_0x6a14('0x37')]+=0x1;if(_0x95a623[_0x6a14('0x3b')]){_0x95a623[_0x6a14('0x3b')]-=0x1;}}if(_0x95a623[_0x6a14('0x39')]&&!_0x95a623[_0x6a14('0x3a')]){_0x95a623[_0x6a14('0x38')]+=0x1;if(_0x95a623[_0x6a14('0x36')]){_0x95a623[_0x6a14('0x36')]-=0x1;}}_0x95a623[_0x6a14('0x3c')]+=0x1;_0x2f40b2(_0x95a623);});}exports['index']=function(_0xd7fc00,_0x2aaeb5){var _0x13b906={},_0x28d047={},_0x244248={'count':0x0,'rows':[]};var _0x228324=_[_0x6a14('0x3d')](db['OpenchannelInteraction'][_0x6a14('0x3e')],function(_0x3b8b29){return{'name':_0x3b8b29[_0x6a14('0x3f')],'type':_0x3b8b29['type'][_0x6a14('0x40')]};});_0x28d047[_0x6a14('0x41')]=_['map'](_0x228324,'name');_0x28d047[_0x6a14('0x42')]=_[_0x6a14('0x43')](_0xd7fc00[_0x6a14('0x42')]);_0x28d047[_0x6a14('0x44')]=_[_0x6a14('0x45')](_0x28d047[_0x6a14('0x41')],_0x28d047[_0x6a14('0x42')]);_0x13b906[_0x6a14('0x46')]=_[_0x6a14('0x45')](_0x28d047[_0x6a14('0x41')],qs['fields'](_0xd7fc00[_0x6a14('0x42')][_0x6a14('0x47')]));_0x13b906['attributes']=_0x13b906['attributes'][_0x6a14('0x48')]?_0x13b906[_0x6a14('0x46')]:_0x28d047[_0x6a14('0x41')];if(!_0xd7fc00[_0x6a14('0x42')]['hasOwnProperty'](_0x6a14('0x49'))){_0x13b906['limit']=qs[_0x6a14('0x24')](_0xd7fc00[_0x6a14('0x42')][_0x6a14('0x24')]);_0x13b906[_0x6a14('0x26')]=qs[_0x6a14('0x26')](_0xd7fc00['query'][_0x6a14('0x26')]);}_0x13b906['order']=qs[_0x6a14('0x4a')](_0xd7fc00[_0x6a14('0x42')][_0x6a14('0x4a')]);_0x13b906[_0x6a14('0x4b')]=qs[_0x6a14('0x44')](_[_0x6a14('0x4c')](_0xd7fc00[_0x6a14('0x42')],_0x28d047['filters']),_0x228324);var _0x4816d3=[];var _0x19c4da=squel['select']()['field']('id')[_0x6a14('0x4d')](_0x6a14('0x2e'))[_0x6a14('0x4d')]('color')[_0x6a14('0x4e')](_0x6a14('0x4f'));var _0x1f1131=squel[_0x6a14('0x50')]()[_0x6a14('0x4d')]('u.id')[_0x6a14('0x4d')]('u.fullname')[_0x6a14('0x4d')](_0x6a14('0x51'))['from'](_0x6a14('0x52'),'ui')[_0x6a14('0x53')](_0x6a14('0x54'),'u',_0x6a14('0x55'));var _0x5ab53a=squel[_0x6a14('0x50')]()['from'](_0x6a14('0x56'),'i')[_0x6a14('0x53')](_0x6a14('0x57'),'c',_0x6a14('0x58'))['left_join'](_0x6a14('0x54'),'o',_0x6a14('0x59'))[_0x6a14('0x53')](_0x6a14('0x5a'),'a',_0x6a14('0x5b'))[_0x6a14('0x53')](_0x6a14('0x5c'),'me',_0x6a14('0x5d'))[_0x6a14('0x53')](_0x6a14('0x5e'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0x6a14('0x4f'),'t',_0x6a14('0x5f'));var _0x49ec30=squel['expr']();var _0x2d1ae9=[];var _0x22c22d=squel[_0x6a14('0x60')]();var _0x5863e4;if(_0xd7fc00[_0x6a14('0x42')][_0x6a14('0x61')]){_0x5863e4=as[_0x6a14('0x62')](_0xd7fc00[_0x6a14('0x42')]['search']);var _0x4c73a2=_0x5863e4[_0x6a14('0x63')];for(var _0x42dd4f=0x0;_0x42dd4f<_0x5863e4[_0x6a14('0x64')]['length'];_0x42dd4f++){var _0x36f89e=_0x5863e4[_0x6a14('0x64')][_0x42dd4f];var _0x4c066c='i';var _0x47efcd=_[_0x6a14('0x65')](_0x228324,[_0x6a14('0x2e'),_0x36f89e['field']]);if(!_0x47efcd){switch(_0x36f89e[_0x6a14('0x4d')]){case _0x6a14('0x66'):if(_0x36f89e['value']==0x1){_0x5ab53a[_0x6a14('0x67')]('`'+_0x36f89e[_0x6a14('0x4d')]+'`\x20=\x200');}else{_0x5ab53a[_0x6a14('0x67')]('`'+_0x36f89e[_0x6a14('0x4d')]+'`\x20>\x200');}break;case'Contact':if(_0x36f89e[_0x6a14('0x68')]===_0x6a14('0x69')){if(_0x36f89e[_0x6a14('0x6a')][_0x6a14('0x6b')]('\x20')[_0x6a14('0x48')]>0x1){_0x49ec30[_0x4c73a2](_0x6a14('0x6c'),qs[_0x6a14('0x6d')](_0x36f89e[_0x6a14('0x6a')]),null);}else{var _0x21c075='%'+_0x36f89e['value']+'%';_0x49ec30[_0x4c73a2]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x21c075,_0x21c075,_0x21c075);}}else{_0x47efcd=_[_0x6a14('0x65')](_0x228324,['name',_0x6a14('0x6e')]);_0x36f89e[_0x6a14('0x4d')]=_0x6a14('0x6e');_0x4a0634=as[_0x6a14('0x6f')](_0x4c066c,_0x47efcd[_0x6a14('0x70')],_0x36f89e);_0x49ec30[_0x4c73a2](_0x4a0634[_0x6a14('0x71')],_0x4a0634[_0x6a14('0x6a')][_0x6a14('0x72')],_0x4a0634[_0x6a14('0x6a')][_0x6a14('0x20')]);}break;case _0x6a14('0x73'):var _0x5bb0f5=_0x36f89e[_0x6a14('0x6a')][_0x6a14('0x6b')](',')['map'](function(_0x478eb3){return Number(_0x478eb3);});_0x5bb0f5[_0x6a14('0x33')](function(_0x51a527){_0x22c22d['or'](_0x6a14('0x74'),'%,'+_0x51a527+',%');});_0x2d1ae9=_[_0x6a14('0x75')](_0x2d1ae9,_0x5bb0f5);break;case _0x6a14('0x76'):if(_0x36f89e[_0x6a14('0x68')]==='$substring'){_0x49ec30[_0x4c73a2](_0x6a14('0x77'),'%'+_0x36f89e['value']+'%',null);}else{_0x47efcd=_[_0x6a14('0x65')](_0x228324,[_0x6a14('0x2e'),_0x6a14('0x3a')]);_0x36f89e['field']=_0x6a14('0x3a');_0x4a0634=as[_0x6a14('0x6f')](_0x4c066c,_0x47efcd['type'],_0x36f89e);_0x49ec30[_0x4c73a2](_0x4a0634[_0x6a14('0x71')],_0x4a0634[_0x6a14('0x6a')][_0x6a14('0x72')],_0x4a0634[_0x6a14('0x6a')][_0x6a14('0x20')]);}break;case'body':_0x4a0634=as[_0x6a14('0x6f')]('me',null,_0x36f89e);_0x49ec30[_0x4c73a2](_0x4a0634[_0x6a14('0x71')],_0x4a0634['value'][_0x6a14('0x72')],_0x4a0634[_0x6a14('0x6a')][_0x6a14('0x20')]);break;}}else{var _0x4a0634=as[_0x6a14('0x6f')](_0x4c066c,_0x47efcd[_0x6a14('0x70')],_0x36f89e);_0x49ec30[_0x4c73a2](_0x4a0634[_0x6a14('0x71')],_0x4a0634['value'][_0x6a14('0x72')],_0x4a0634[_0x6a14('0x6a')][_0x6a14('0x20')]);}}}else{var _0x2ab689=_(_0xd7fc00['query'])[_0x6a14('0x43')]()[_0x6a14('0x3d')](function(_0x3d61e1){return _[_0x6a14('0x78')](_0x228324,[_0x6a14('0x2e'),_0x3d61e1])?_0x3d61e1:undefined;})[_0x6a14('0x79')]()[_0x6a14('0x6a')]();if(!_[_0x6a14('0x7a')](_0x2ab689)){_0x2ab689[_0x6a14('0x33')](function(_0x2969dc){if(_0x2969dc==='OpenchannelAccountId'){_0x5ab53a[_0x6a14('0x4b')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x6a14('0x7b')](_0xd7fc00['query'][_0x2969dc]));}else if(_0x2969dc===_0x6a14('0x7c')){var _0x26e354=JSON[_0x6a14('0x7d')](_0xd7fc00[_0x6a14('0x42')][_0x2969dc])[_0x6a14('0x7e')];var _0xa914e8=JSON['parse'](_0xd7fc00[_0x6a14('0x42')][_0x2969dc])[_0x6a14('0x7f')];_0x5ab53a[_0x6a14('0x4b')](_0x6a14('0x80'),_0x26e354,_0xa914e8);}else{if(_0xd7fc00[_0x6a14('0x42')][_0x2969dc]===_0x6a14('0x81')){_0x5ab53a['where']('i.'+_0x2969dc+'\x20IS\x20NULL');}else{_0x5ab53a[_0x6a14('0x4b')]('i.'+_0x2969dc+_0x6a14('0x82'),_0xd7fc00['query'][_0x2969dc]);}}});}if(_0xd7fc00['query']['read']){if(_0xd7fc00[_0x6a14('0x42')]['read']==0x1){_0x5ab53a[_0x6a14('0x67')](_0x6a14('0x83'));}else{_0x5ab53a[_0x6a14('0x67')](_0x6a14('0x84'));}}if(_0xd7fc00['query'][_0x6a14('0x85')]){_0x2d1ae9=_[_0x6a14('0x86')](_0xd7fc00[_0x6a14('0x42')][_0x6a14('0x85')])?_0xd7fc00[_0x6a14('0x42')][_0x6a14('0x85')]:new Array(_0xd7fc00[_0x6a14('0x42')][_0x6a14('0x85')]);_0x2d1ae9[_0x6a14('0x33')](function(_0xc838fe){_0x22c22d['or'](_0x6a14('0x74'),'%,'+_0xc838fe+',%');});}if(_0xd7fc00[_0x6a14('0x42')][_0x6a14('0x87')]){var _0xfad9e3=_0xd7fc00[_0x6a14('0x42')]['filter']['replace']('\x5c','\x5c\x5c')[_0x6a14('0x88')](/'/g,'\x27\x27');if(qs[_0x6a14('0x89')](_0xfad9e3)){_0x49ec30['or'](_0x6a14('0x8a'),_0xfad9e3+'%');}else{_0x49ec30['or'](_0x6a14('0x8b'),qs[_0x6a14('0x6d')](_0xfad9e3))['or'](_0x6a14('0x8c'),_0xfad9e3+'%')['or'](_0x6a14('0x8d'),_0xfad9e3+'%');}}}_0x5ab53a['where'](_0x49ec30);_0x5ab53a[_0x6a14('0x8e')]('i.id');var _0x227bf7={'type':db[_0x6a14('0x8f')]['QueryTypes'][_0x6a14('0x90')],'raw':!![]};var _0x15a23a=_0x5ab53a[_0x6a14('0x91')]();_0x15a23a[_0x6a14('0x4d')](_0x6a14('0x92'));_0x15a23a[_0x6a14('0x4d')](_0x6a14('0x93'),'unreadMessages');if(_0x13b906[_0x6a14('0x94')]){_0x13b906[_0x6a14('0x94')][_0x6a14('0x33')](function(_0x5452be){var _0x569a6c=_0x5452be[0x0]===_0x6a14('0x95')?_0x5452be[0x0]:'i.'+_0x5452be[0x0];_0x5ab53a[_0x6a14('0x94')](_0x569a6c,_0x5452be[0x1]==='DESC'?![]:!![]);});}if(!_[_0x6a14('0x7a')](_0x2d1ae9)){_0x5ab53a[_0x6a14('0x67')](_0x22c22d);_0x15a23a['where'](_0x6a14('0x96'),_0x2d1ae9);}BPromise['resolve']()[_0x6a14('0x2a')](function(){if(!_0x5863e4){if(_0xd7fc00[_0x6a14('0x42')][_0x6a14('0x97')])return;_0x15a23a[_0x6a14('0x4b')](_0x6a14('0x98'));_0x5ab53a[_0x6a14('0x4b')](_0x6a14('0x98'));return;}if(_0xd7fc00[_0x6a14('0x99')][_0x6a14('0x9a')]!==_0x6a14('0x9b'))return;return _0xd7fc00[_0x6a14('0x99')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x6a14('0x2a')](function(_0x11337b){if(_['isEmpty'](_0x11337b)){_0x15a23a['where']('i.OpenchannelAccountId\x20IS\x20NULL');_0x5ab53a['where'](_0x6a14('0x9c'));}else{_0x15a23a[_0x6a14('0x4b')](_0x6a14('0x9d'),_[_0x6a14('0x3d')](_0x11337b,'id'));_0x5ab53a['where'](_0x6a14('0x9d'),_[_0x6a14('0x3d')](_0x11337b,'id'));}});})['then'](function(){if(_0xd7fc00[_0x6a14('0x99')][_0x6a14('0x9a')]===_0x6a14('0x9b')&&!_0x5863e4&&!_0xd7fc00[_0x6a14('0x42')]['OpenchannelAccountId'])return[];return db['sequelize'][_0x6a14('0x42')](_0x15a23a[_0x6a14('0x9e')](),_0x227bf7);})[_0x6a14('0x2a')](function(_0x446d34){_0x244248[_0x6a14('0x25')]=_0x446d34[_0x6a14('0x48')];if(_0x244248[_0x6a14('0x25')]===0x0)return[];return db[_0x6a14('0x9f')][_0x6a14('0x42')](_0x19c4da[_0x6a14('0x9e')](),_0x227bf7)[_0x6a14('0x2a')](function(_0x11852f){_0x4816d3=_[_0x6a14('0xa0')](_0x11852f,'id');_0x227bf7=_[_0x6a14('0xa1')](_0x227bf7,{'model':db[_0x6a14('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xd7fc00['query'][_0x6a14('0x47')]){_0x13b906['attributes'][_0x6a14('0x33')](function(_0x201518){_0x5ab53a[_0x6a14('0x4d')]('i.'+_0x201518);});}else{_0x5ab53a[_0x6a14('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6a14('0x66'));_0x5ab53a[_0x6a14('0x4d')](_0x6a14('0xa3'),_0x6a14('0xa4'));_0x5ab53a['field'](_0x6a14('0xa5'),_0x6a14('0xa6'));_0x5ab53a[_0x6a14('0x4d')](_0x6a14('0xa7'),_0x6a14('0x95'));_0x5ab53a[_0x6a14('0x4d')](_0x6a14('0xa8'));_0x5ab53a['field'](_0x6a14('0xa9'),_0x6a14('0xaa'));_0x5ab53a['field'](_0x6a14('0xab'),_0x6a14('0xac'));_0x5ab53a[_0x6a14('0x4d')]('c.email',_0x6a14('0xad'));_0x5ab53a[_0x6a14('0x4d')](_0x6a14('0xae'),_0x6a14('0xaf'));_0x5ab53a['field'](_0x6a14('0xb0'),_0x6a14('0xb1'));_0x5ab53a[_0x6a14('0x4d')]('c.fax',_0x6a14('0xb2'));_0x5ab53a[_0x6a14('0x4d')](_0x6a14('0xb3'),'Owner.fullname');_0x5ab53a[_0x6a14('0x4d')](_0x6a14('0xb4'),_0x6a14('0xb5'));_0x5ab53a['field'](_0x6a14('0xb6'),_0x6a14('0x32'));}if(_0x13b906[_0x6a14('0x24')])_0x5ab53a[_0x6a14('0x24')](_0x13b906[_0x6a14('0x24')]);if(_0x13b906[_0x6a14('0x26')])_0x5ab53a[_0x6a14('0x26')](_0x13b906[_0x6a14('0x26')]);return db['sequelize']['query'](_0x5ab53a[_0x6a14('0x9e')](),_0x227bf7);})[_0x6a14('0x2a')](function(_0x3dea45){if(_0x3dea45['length']>0x0)_0x1f1131[_0x6a14('0x4b')](_0x6a14('0xb7'),_['map'](_0x3dea45,'id'));return db[_0x6a14('0x9f')][_0x6a14('0x42')](_0x1f1131['toString'](),_0x227bf7)[_0x6a14('0x2a')](function(_0x4f2ce3){var _0x949f8f=_[_0x6a14('0xb8')](_0x4f2ce3,_0x6a14('0xb9'));var _0x4b7d12=[];_0x3dea45[_0x6a14('0x33')](function(_0x566cb2){_0x4b7d12[_0x6a14('0x34')](updateOpenchannelInteraction(_0x566cb2,_0x4816d3,_0x949f8f));});return BPromise['all'](_0x4b7d12);});});})[_0x6a14('0x2a')](function(_0x67ae16){_0x244248[_0x6a14('0xba')]=_0x67ae16;return _0x244248;})[_0x6a14('0x2a')](respondWithFilteredResult(_0x2aaeb5,_0x13b906))[_0x6a14('0x35')](handleError(_0x2aaeb5,null));};exports['show']=function(_0x4373ab,_0x265764){var _0x17dea7={};if(_0x4373ab['query'][_0x6a14('0x70')]&&_0x4373ab['query']['type']===_0x6a14('0x4e')){_0x17dea7['from']=_0x4373ab['params']['id'];}else{_0x17dea7['id']=_0x4373ab['params']['id'];}var _0x508f76={'raw':![],'where':_0x17dea7},_0x2282f7={};_0x2282f7['model']=_[_0x6a14('0x43')](db[_0x6a14('0xa2')][_0x6a14('0x3e')]);_0x2282f7[_0x6a14('0x42')]=_[_0x6a14('0x43')](_0x4373ab[_0x6a14('0x42')]);_0x2282f7[_0x6a14('0x44')]=_['intersection'](_0x2282f7['model'],_0x2282f7[_0x6a14('0x42')]);_0x508f76[_0x6a14('0x46')]=_[_0x6a14('0x45')](_0x2282f7[_0x6a14('0x41')],qs[_0x6a14('0x47')](_0x4373ab[_0x6a14('0x42')][_0x6a14('0x47')]));_0x508f76[_0x6a14('0x46')]=_0x508f76[_0x6a14('0x46')][_0x6a14('0x48')]?_0x508f76[_0x6a14('0x46')]:_0x2282f7[_0x6a14('0x41')];if(_0x4373ab[_0x6a14('0x42')][_0x6a14('0xbb')]){_0x508f76[_0x6a14('0xbc')]=[{'all':!![]}];}_0x508f76=_['merge']({},_0x508f76,_0x4373ab[_0x6a14('0xbd')]);return db[_0x6a14('0xa2')][_0x6a14('0x65')](_0x508f76)['then'](handleEntityNotFound(_0x265764,null))[_0x6a14('0x2a')](respondWithResult(_0x265764,null))[_0x6a14('0x35')](handleError(_0x265764,null));};exports[_0x6a14('0xbe')]=function(_0x30a09f,_0x4d3be3){return db[_0x6a14('0xa2')][_0x6a14('0xbe')](_0x30a09f[_0x6a14('0xbf')],{})[_0x6a14('0x2a')](respondWithResult(_0x4d3be3,0xc9))['catch'](handleError(_0x4d3be3,null));};exports[_0x6a14('0x29')]=function(_0x5af627,_0x2eb6b3){if(_0x5af627[_0x6a14('0xbf')]['id']){delete _0x5af627[_0x6a14('0xbf')]['id'];}return db['OpenchannelInteraction'][_0x6a14('0x65')]({'where':{'id':_0x5af627['params']['id']}})[_0x6a14('0x2a')](handleEntityNotFound(_0x2eb6b3,null))[_0x6a14('0x2a')](saveUpdates(_0x5af627[_0x6a14('0xbf')],null))[_0x6a14('0x2a')](respondWithResult(_0x2eb6b3,null))[_0x6a14('0x35')](handleError(_0x2eb6b3,null));};exports[_0x6a14('0x2b')]=function(_0x42cf8b,_0x4f27f1){return db[_0x6a14('0xa2')][_0x6a14('0x65')]({'where':{'id':_0x42cf8b[_0x6a14('0xc0')]['id']}})['then'](handleEntityNotFound(_0x4f27f1,null))[_0x6a14('0x2a')](removeEntity(_0x4f27f1,null))[_0x6a14('0x35')](handleError(_0x4f27f1,null));};exports[_0x6a14('0xc1')]=function(_0x43bac,_0x36f7b4){return db[_0x6a14('0xa2')]['describe']()[_0x6a14('0x2a')](respondWithResult(_0x36f7b4,null))[_0x6a14('0x35')](handleError(_0x36f7b4,null));};exports[_0x6a14('0xc2')]=function(_0x1eb8d4,_0x3ea42c,_0x5da627){return db['OpenchannelMessage'][_0x6a14('0x65')]({'where':{'id':_0x1eb8d4[_0x6a14('0xc0')]['id']}})[_0x6a14('0x2a')](handleEntityNotFound(_0x3ea42c,null))[_0x6a14('0x2a')](function(_0x1cba57){if(_0x1cba57){return _0x1cba57[_0x6a14('0xc2')](_0x1eb8d4[_0x6a14('0xbf')][_0x6a14('0xc3')],_['omit'](_0x1eb8d4[_0x6a14('0xbf')],[_0x6a14('0xc3'),'id'])||{});}})[_0x6a14('0x2a')](respondWithResult(_0x3ea42c,null))[_0x6a14('0x35')](handleError(_0x3ea42c,null));};exports['getMessages']=function(_0x45874b,_0x1a85e1,_0x1154a7){var _0x52b4cb={'raw':![],'where':{}};var _0x122f19={};var _0x5cce97={'count':0x0,'rows':[]};return db[_0x6a14('0xa2')][_0x6a14('0xc4')]({'where':{'id':_0x45874b[_0x6a14('0xc0')]['id']}})[_0x6a14('0x2a')](handleEntityNotFound(_0x1a85e1,null))[_0x6a14('0x2a')](function(_0x365106){if(_0x365106){_0x122f19['model']=_[_0x6a14('0x43')](db[_0x6a14('0xc5')][_0x6a14('0x3e')]);_0x122f19[_0x6a14('0x42')]=_[_0x6a14('0x43')](_0x45874b[_0x6a14('0x42')]);_0x122f19[_0x6a14('0x44')]=_[_0x6a14('0x45')](_0x122f19[_0x6a14('0x41')],_0x122f19['query']);_0x52b4cb[_0x6a14('0x46')]=_['intersection'](_0x122f19['model'],qs[_0x6a14('0x47')](_0x45874b[_0x6a14('0x42')][_0x6a14('0x47')]));_0x52b4cb[_0x6a14('0x46')]=_0x52b4cb[_0x6a14('0x46')][_0x6a14('0x48')]?_0x52b4cb[_0x6a14('0x46')]:_0x122f19[_0x6a14('0x41')];if(!_0x45874b[_0x6a14('0x42')][_0x6a14('0xc6')]('nolimit')){_0x52b4cb[_0x6a14('0x24')]=qs[_0x6a14('0x24')](_0x45874b['query'][_0x6a14('0x24')]);_0x52b4cb[_0x6a14('0x26')]=qs[_0x6a14('0x26')](_0x45874b['query'][_0x6a14('0x26')]);}_0x52b4cb[_0x6a14('0x94')]=qs['sort'](_0x45874b[_0x6a14('0x42')][_0x6a14('0x4a')]);_0x52b4cb['where']=qs[_0x6a14('0x44')](_['pick'](_0x45874b[_0x6a14('0x42')],_0x122f19[_0x6a14('0x44')]));_0x52b4cb[_0x6a14('0x4b')][_0x6a14('0xb9')]=_0x365106['id'];if(_0x45874b[_0x6a14('0x42')][_0x6a14('0x87')]){_0x52b4cb[_0x6a14('0x4b')]=_[_0x6a14('0xa1')](_0x52b4cb[_0x6a14('0x4b')],{'$or':_[_0x6a14('0x3d')](_0x52b4cb[_0x6a14('0x46')],function(_0x147bb8){var _0x490250={};_0x490250[_0x147bb8]={'$like':'%'+_0x45874b[_0x6a14('0x42')][_0x6a14('0x87')]+'%'};return _0x490250;})});}if(_0x45874b['query'][_0x6a14('0x7e')]){var _0x106bc8=_0x45874b[_0x6a14('0x42')][_0x6a14('0x7e')]['split'](',');var _0x43079b={};_0x43079b[_0x106bc8[0x0]]={'$gte':moment(_0x106bc8[0x1])[_0x6a14('0xc7')](_0x6a14('0xc8'))};_0x52b4cb[_0x6a14('0x4b')]=_[_0x6a14('0xa1')](_0x52b4cb[_0x6a14('0x4b')],_0x43079b);}_0x52b4cb=_['merge']({},_0x52b4cb,_0x45874b[_0x6a14('0xbd')]);return db[_0x6a14('0xc5')]['count']({'where':_0x52b4cb[_0x6a14('0x4b')]})['then'](function(_0x14b24a){_0x5cce97['count']=_0x14b24a;if(_0x45874b[_0x6a14('0x42')][_0x6a14('0xbb')]){_0x52b4cb[_0x6a14('0xbc')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x6a14('0xc9')](_0x52b4cb);})[_0x6a14('0x2a')](function(_0x1f0f84){_0x5cce97[_0x6a14('0xba')]=_0x1f0f84;return _0x5cce97;});}})[_0x6a14('0x2a')](respondWithFilteredResult(_0x1a85e1,_0x52b4cb))[_0x6a14('0x35')](handleError(_0x1a85e1,null));};exports[_0x6a14('0xca')]=function(_0x516405,_0x4d9f3f,_0x1b7642){return db['OpenchannelInteraction'][_0x6a14('0x65')]({'where':{'id':_0x516405[_0x6a14('0xc0')]['id']}})[_0x6a14('0x2a')](handleEntityNotFound(_0x4d9f3f,null))[_0x6a14('0x2a')](function(_0x58e24f){if(_0x58e24f){return _0x58e24f[_0x6a14('0xcb')](_0x516405[_0x6a14('0xbf')][_0x6a14('0xc3')],_[_0x6a14('0xcc')](_0x516405[_0x6a14('0xbf')],[_0x6a14('0xc3'),'id'])||{})[_0x6a14('0xcd')](function(){return db[_0x6a14('0x73')][_0x6a14('0xc9')]({'attributes':['id',_0x6a14('0x2e'),_0x6a14('0xce')],'where':{'id':_0x516405[_0x6a14('0xbf')][_0x6a14('0xc3')]}});})[_0x6a14('0x2a')](function(_0x4d093a){socket[_0x6a14('0xcf')](_0x6a14('0xd0'),{'id':Number(_0x516405[_0x6a14('0xc0')]['id']),'tags':_0x4d093a||[]});return{'id':Number(_0x516405[_0x6a14('0xc0')]['id']),'tags':_0x4d093a||[]};});}})[_0x6a14('0x2a')](respondWithResult(_0x4d9f3f,null))[_0x6a14('0x35')](handleError(_0x4d9f3f,null));};exports[_0x6a14('0xd1')]=function(_0x5a358f,_0x1668a7,_0x3500ca){return db[_0x6a14('0xa2')][_0x6a14('0x65')]({'where':{'id':_0x5a358f[_0x6a14('0xc0')]['id']}})['then'](handleEntityNotFound(_0x1668a7,null))['then'](function(_0x1e78d5){if(_0x1e78d5){return _0x1e78d5[_0x6a14('0xd1')](_0x5a358f['query']['ids']);}})[_0x6a14('0x2a')](respondWithStatusCode(_0x1668a7,null))['catch'](handleError(_0x1668a7,null));};exports['download']=function(_0x545d84,_0x561353){var _0x410e6b=moment()['unix']()[_0x6a14('0x9e')]();var _0x5bdc8a=path[_0x6a14('0xd2')](config[_0x6a14('0xd3')],_0x6a14('0xd4'),_0x6a14('0xd5'),'tmp');var _0x3712ed=path['join'](config['root'],_0x6a14('0xd4'),'files',_0x6a14('0xd6'));var _0x1fa0c8=path[_0x6a14('0xd2')](_0x5bdc8a,_0x410e6b);var _0x40a605=util[_0x6a14('0xc7')](_0x6a14('0xd7'),_0x545d84[_0x6a14('0xc0')]['id'],_0x410e6b);var _0x1d5e39=path[_0x6a14('0xd2')](_0x5bdc8a,_0x40a605);var _0x1be22f=[];_0x1be22f['push']({'model':db[_0x6a14('0x76')],'as':_0x6a14('0x76'),'attributes':['id',_0x6a14('0x30')],'raw':!![]});_0x1be22f[_0x6a14('0x34')]({'model':db['CmContact'],'as':_0x6a14('0xd8'),'attributes':['id',_0x6a14('0xd9'),_0x6a14('0xda')],'raw':!![]});if(_0x545d84['query'][_0x6a14('0xd6')]){_0x1be22f[_0x6a14('0x34')]({'model':db[_0x6a14('0xdb')],'as':'Attachment','raw':!![]});}var _0x5e274b=[{'model':db[_0x6a14('0xc5')],'as':_0x6a14('0xdc'),'attributes':['id',_0x6a14('0xbf'),'createdAt','direction',_0x6a14('0xdd'),'read'],'include':_0x1be22f}];_0x5e274b['push']({'model':db[_0x6a14('0xde')],'as':_0x6a14('0xdf'),'attributes':['id',_0x6a14('0x2e')]});_0x5e274b[_0x6a14('0x34')]({'model':db[_0x6a14('0x76')],'as':_0x6a14('0xe0'),'attributes':['id',_0x6a14('0x30')]});return db[_0x6a14('0xa2')][_0x6a14('0x65')]({'where':{'id':_0x545d84['params']['id']},'include':_0x5e274b})[_0x6a14('0x2a')](handleEntityNotFound(_0x561353,null))[_0x6a14('0x2a')](function(_0x41a364){if(_0x41a364){var _0x8a2609=_0x41a364['get']({'plain':!![]});fs[_0x6a14('0xe1')](_0x1fa0c8);var _0x4b12bc={'channel':_0x6a14('0xe2'),'account':_0x8a2609[_0x6a14('0xdf')][_0x6a14('0x2e')],'agent':_0x8a2609['Owner']?_0x8a2609[_0x6a14('0xe0')][_0x6a14('0x30')]:'N.A.','createdAt':moment(_0x8a2609['createdAt'])['format'](_0x6a14('0xc8'))[_0x6a14('0x9e')](),'closedAt':_0x8a2609[_0x6a14('0x39')]?moment(_0x8a2609[_0x6a14('0xe3')])['format'](_0x6a14('0xc8'))[_0x6a14('0x9e')]():'','disposition':_0x8a2609[_0x6a14('0xe4')],'visibility':_0x8a2609[_0x6a14('0xe5')]?_0x6a14('0xe6'):_0x6a14('0xe7'),'messages':_(_0x8a2609[_0x6a14('0xdc')])[_0x6a14('0x87')]({'secret':![]})[_0x6a14('0x3d')](function(_0x1090b6){if(_0x1090b6[_0x6a14('0xdb')]){var _0x3a7677=path[_0x6a14('0xd2')](_0x3712ed,_0x1090b6['Attachment'][_0x6a14('0xe8')]);if(fs[_0x6a14('0xe9')](_0x3a7677)){fs[_0x6a14('0xea')](_0x3a7677)[_0x6a14('0xeb')](fs[_0x6a14('0xec')](path['join'](_0x1fa0c8,_0x1090b6[_0x6a14('0xdb')][_0x6a14('0xe8')])));}}return{'date':moment(_0x1090b6['createdAt'])[_0x6a14('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6a14('0x9e')](),'sender':_0x1090b6[_0x6a14('0xed')]===_0x6a14('0xee')?_0x1090b6[_0x6a14('0x76')]?_0x1090b6[_0x6a14('0x76')][_0x6a14('0x30')]:_0x6a14('0xef'):_0x1090b6[_0x6a14('0xd8')][_0x6a14('0xd9')]+(_0x1090b6['Contact'][_0x6a14('0xda')]?'\x20'+_0x1090b6[_0x6a14('0xd8')][_0x6a14('0xda')]:''),'body':_0x1090b6[_0x6a14('0xdb')]?_0x1090b6['Attachment'][_0x6a14('0xe8')]:_0x1090b6['body'],'direction':_0x1090b6['direction']==='out'?'A':'C','secret':_0x1090b6[_0x6a14('0xdd')],'read':_0x1090b6['read'],'attachment':_0x1090b6[_0x6a14('0xdb')]};})[_0x6a14('0x6a')]()};return ejs[_0x6a14('0xf0')](path[_0x6a14('0xd2')](config['root'],_0x6a14('0xd4'),'views',_0x6a14('0xf1')),{'interaction':_0x4b12bc})[_0x6a14('0x2a')](function(_0x50d7ed){var _0x47aceb=path[_0x6a14('0xd2')](_0x1fa0c8,_0x6a14('0xf2')+_0x8a2609['id']+'-'+_0x410e6b+_0x6a14('0xf3'));var _0xe8be2={'path':_0x47aceb,'channel':'Openchannel','interactionId':_0x8a2609['id']};return pdf['createPdfFromHTML'](_0x50d7ed,_0xe8be2);})['then'](function(){return new BPromise(function(_0x131000,_0x3564b5){zipdir(_0x1fa0c8,{'saveTo':_0x1d5e39},function(_0x2c6d7c,_0x34e49b){if(_0x2c6d7c)return _0x3564b5(_0x2c6d7c);return _0x131000(_0x34e49b);});})[_0x6a14('0x2a')](function(){return new BPromise(function(_0x1f37de,_0x4e20e5){rimraf(_0x1fa0c8,function(_0x28baa3){if(_0x28baa3)_0x4e20e5(_0x28baa3);return _0x1f37de();});});})[_0x6a14('0x2a')](function(){return _0x561353[_0x6a14('0xf4')](_0x1d5e39,_0x40a605,function(_0x481355){if(_0x481355){console[_0x6a14('0xf5')](_0x6a14('0xf6'),_0x481355);}else{fs[_0x6a14('0xf7')](_0x1d5e39);}});});});}else{return _0x561353['sendStatus'](0xc8);}})[_0x6a14('0x35')](handleError(_0x561353,null));}; \ No newline at end of file +var _0xc320=['query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','pick','select','field','color','from','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','text','body','buildExpression','some','compact','isEmpty','OpenchannelAccountId','where','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','user','sequelize','toString','count','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','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','i.*','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','rows','show','params','includeAll','options','create','update','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','root','files','join','server','transcript-%d-%s.zip','fullname','CmContact','Contact','firstName','lastName','attachments','Attachment','direction','secret','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','closedAt','disposition','threadId','Public','Private','Messages','basename','existsSync','createReadStream','pipe','out','System','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','status','end','json','limit','undefined','offset','apply','save','then','error','stack','name','send','Users','map','TagIds','split','forEach','Tags','catch','total','UserId','waiting','closed','talking','unmanaged','index','OpenchannelInteraction','rawAttributes','type','key','model'];(function(_0x5da87b,_0x2015c3){var _0x1a1f02=function(_0x2db746){while(--_0x2db746){_0x5da87b['push'](_0x5da87b['shift']());}};_0x1a1f02(++_0x2015c3);}(_0xc320,0xb4));var _0x0c32=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc320[_0x50a0c2];return _0x5ebadd;};'use strict';var emlformat=require(_0x0c32('0x0'));var rimraf=require(_0x0c32('0x1'));var zipdir=require(_0x0c32('0x2'));var jsonpatch=require(_0x0c32('0x3'));var rp=require(_0x0c32('0x4'));var moment=require(_0x0c32('0x5'));var BPromise=require(_0x0c32('0x6'));var Mustache=require('mustache');var util=require(_0x0c32('0x7'));var path=require('path');var sox=require(_0x0c32('0x8'));var csv=require(_0x0c32('0x9'));var ejs=require(_0x0c32('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c32('0xb'));var squel=require(_0x0c32('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0c32('0xd'));var toCsv=require(_0x0c32('0x9'));var querystring=require(_0x0c32('0xe'));var Papa=require(_0x0c32('0xf'));var Redis=require('ioredis');var authService=require(_0x0c32('0x10'));var qs=require(_0x0c32('0x11'));var as=require(_0x0c32('0x12'));var pdf=require(_0x0c32('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c32('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0c32('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c32('0x16'))['db'];config[_0x0c32('0x17')]=_[_0x0c32('0x18')](config[_0x0c32('0x17')],{'host':_0x0c32('0x19'),'port':0x18eb});var socket=require(_0x0c32('0x1a'))(new Redis(config[_0x0c32('0x17')]));require(_0x0c32('0x1b'))['register'](socket);function respondWithStatusCode(_0x52b10d,_0x2c5930){_0x2c5930=_0x2c5930||0xcc;return function(_0x160819){if(_0x160819){return _0x52b10d['sendStatus'](_0x2c5930);}return _0x52b10d[_0x0c32('0x1c')](_0x2c5930)[_0x0c32('0x1d')]();};}function respondWithResult(_0x328947,_0x3a3be2){_0x3a3be2=_0x3a3be2||0xc8;return function(_0x67aa7e){if(_0x67aa7e){return _0x328947[_0x0c32('0x1c')](_0x3a3be2)[_0x0c32('0x1e')](_0x67aa7e);}};}function respondWithFilteredResult(_0x1ae5df,_0x52313d){return function(_0x2d0efc){if(_0x2d0efc){var _0x49b25d=typeof _0x52313d['offset']==='undefined'&&typeof _0x52313d[_0x0c32('0x1f')]===_0x0c32('0x20');var _0x220f2f=_0x2d0efc['count'];var _0x463983=_0x49b25d?0x0:_0x52313d[_0x0c32('0x21')];var _0x229169=_0x49b25d?_0x2d0efc['count']:_0x52313d[_0x0c32('0x21')]+_0x52313d['limit'];var _0x252f54;if(_0x229169>=_0x220f2f){_0x229169=_0x220f2f;_0x252f54=0xc8;}else{_0x252f54=0xce;}_0x1ae5df[_0x0c32('0x1c')](_0x252f54);return _0x1ae5df['set']('Content-Range',_0x463983+'-'+_0x229169+'/'+_0x220f2f)[_0x0c32('0x1e')](_0x2d0efc);}return null;};}function patchUpdates(_0x2b66bc){return function(_0x2ed925){try{jsonpatch[_0x0c32('0x22')](_0x2ed925,_0x2b66bc,!![]);}catch(_0x420596){return BPromise['reject'](_0x420596);}return _0x2ed925[_0x0c32('0x23')]();};}function saveUpdates(_0x22bb71,_0x48c6f2){return function(_0x446cc6){if(_0x446cc6){return _0x446cc6['update'](_0x22bb71)['then'](function(_0x2750f4){return _0x2750f4;});}return null;};}function removeEntity(_0x1ef2a6,_0x2e3fea){return function(_0xf6c6ed){if(_0xf6c6ed){return _0xf6c6ed['destroy']()[_0x0c32('0x24')](function(){_0x1ef2a6[_0x0c32('0x1c')](0xcc)[_0x0c32('0x1d')]();});}};}function handleEntityNotFound(_0xf51d73,_0xfc3985){return function(_0x10e5bd){if(!_0x10e5bd){_0xf51d73['sendStatus'](0x194);}return _0x10e5bd;};}function handleError(_0x5cf7d9,_0x5ba493){_0x5ba493=_0x5ba493||0x1f4;return function(_0x14e62c){logger[_0x0c32('0x25')](_0x14e62c[_0x0c32('0x26')]);if(_0x14e62c[_0x0c32('0x27')]){delete _0x14e62c[_0x0c32('0x27')];}_0x5cf7d9[_0x0c32('0x1c')](_0x5ba493)[_0x0c32('0x28')](_0x14e62c);};}function getInteractionUsers(_0x42a725,_0x19b304){return new BPromise(function(_0x2ec25a,_0x179409){try{if(_0x19b304[_0x42a725['id']]){_0x42a725[_0x0c32('0x29')]=_[_0x0c32('0x2a')](_0x19b304[_0x42a725['id']],function(_0x2a2d2d){return{'id':_0x2a2d2d['id'],'fullname':_0x2a2d2d['fullname']};});}}catch(_0x567080){_0x179409(_0x567080);}_0x2ec25a(_0x42a725);});}function getInteractionTags(_0x2a8795,_0x141a8c){return new BPromise(function(_0x216d41,_0x215792){try{if(_0x2a8795[_0x0c32('0x2b')]){_0x2a8795['Tags']=[];_0x2a8795['TagIds'][_0x0c32('0x2c')](',')[_0x0c32('0x2d')](function(_0x4413b4){_0x2a8795[_0x0c32('0x2e')]['push'](_0x141a8c[_0x4413b4]);});}delete _0x2a8795['TagIds'];}catch(_0x173379){_0x215792(_0x173379);}_0x216d41(_0x2a8795);});}function updateOpenchannelInteraction(_0x3d8b62,_0x3d4759,_0xeef22b){return new BPromise(function(_0x4b794c,_0x220ef5){return getInteractionUsers(_0x3d8b62,_0xeef22b)['then'](function(_0x55b5f3){return getInteractionTags(_0x55b5f3,_0x3d4759);})[_0x0c32('0x24')](function(_0x5387bd){return getStateInteraction(_0x5387bd);})['then'](function(_0x42cd35){_0x4b794c(_0x42cd35);})[_0x0c32('0x2f')](function(_0x2bceed){_0x220ef5(_0x2bceed);});});}function getStateInteraction(_0x781fb3){return new BPromise(function(_0x154b65){_0x781fb3['waiting']=0x0;_0x781fb3['talking']=0x0;_0x781fb3['answered']=0x0;_0x781fb3['unmanaged']=0x0;_0x781fb3[_0x0c32('0x30')]=0x0;if(!_0x781fb3['closed']&&!_0x781fb3[_0x0c32('0x31')]){_0x781fb3[_0x0c32('0x32')]+=0x1;}if(!_0x781fb3[_0x0c32('0x33')]&&_0x781fb3[_0x0c32('0x31')]){_0x781fb3[_0x0c32('0x34')]+=0x1;if(_0x781fb3[_0x0c32('0x32')]){_0x781fb3[_0x0c32('0x32')]-=0x1;}}if(_0x781fb3[_0x0c32('0x33')]&&_0x781fb3[_0x0c32('0x31')]){_0x781fb3['answered']+=0x1;if(_0x781fb3[_0x0c32('0x34')]){_0x781fb3['talking']-=0x1;}}if(_0x781fb3[_0x0c32('0x33')]&&!_0x781fb3[_0x0c32('0x31')]){_0x781fb3[_0x0c32('0x35')]+=0x1;if(_0x781fb3['waiting']){_0x781fb3[_0x0c32('0x32')]-=0x1;}}_0x781fb3[_0x0c32('0x30')]+=0x1;_0x154b65(_0x781fb3);});}exports[_0x0c32('0x36')]=function(_0x2d091d,_0x511a98){var _0x535300={},_0x25acad={},_0x43a4bb={'count':0x0,'rows':[]};var _0x2e8745=_[_0x0c32('0x2a')](db[_0x0c32('0x37')][_0x0c32('0x38')],function(_0x92948e){return{'name':_0x92948e['fieldName'],'type':_0x92948e[_0x0c32('0x39')][_0x0c32('0x3a')]};});_0x25acad[_0x0c32('0x3b')]=_['map'](_0x2e8745,'name');_0x25acad[_0x0c32('0x3c')]=_[_0x0c32('0x3d')](_0x2d091d['query']);_0x25acad[_0x0c32('0x3e')]=_[_0x0c32('0x3f')](_0x25acad[_0x0c32('0x3b')],_0x25acad['query']);_0x535300['attributes']=_[_0x0c32('0x3f')](_0x25acad[_0x0c32('0x3b')],qs[_0x0c32('0x40')](_0x2d091d[_0x0c32('0x3c')][_0x0c32('0x40')]));_0x535300['attributes']=_0x535300['attributes'][_0x0c32('0x41')]?_0x535300[_0x0c32('0x42')]:_0x25acad[_0x0c32('0x3b')];if(!_0x2d091d['query']['hasOwnProperty'](_0x0c32('0x43'))){_0x535300['limit']=qs[_0x0c32('0x1f')](_0x2d091d['query'][_0x0c32('0x1f')]);_0x535300['offset']=qs['offset'](_0x2d091d[_0x0c32('0x3c')][_0x0c32('0x21')]);}_0x535300[_0x0c32('0x44')]=qs[_0x0c32('0x45')](_0x2d091d[_0x0c32('0x3c')]['sort']);_0x535300['where']=qs[_0x0c32('0x3e')](_[_0x0c32('0x46')](_0x2d091d[_0x0c32('0x3c')],_0x25acad['filters']),_0x2e8745);var _0x19a23d=[];var _0xd003b0=squel[_0x0c32('0x47')]()['field']('id')[_0x0c32('0x48')](_0x0c32('0x27'))[_0x0c32('0x48')](_0x0c32('0x49'))[_0x0c32('0x4a')]('tools_tags');var _0x504768=squel[_0x0c32('0x47')]()[_0x0c32('0x48')](_0x0c32('0x4b'))[_0x0c32('0x48')]('u.fullname')[_0x0c32('0x48')](_0x0c32('0x4c'))[_0x0c32('0x4a')](_0x0c32('0x4d'),'ui')[_0x0c32('0x4e')]('users','u',_0x0c32('0x4f'));var _0x2ec297=squel[_0x0c32('0x47')]()[_0x0c32('0x4a')]('openchannel_interactions','i')[_0x0c32('0x4e')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0c32('0x4e')]('users','o',_0x0c32('0x50'))[_0x0c32('0x4e')](_0x0c32('0x51'),'a',_0x0c32('0x52'))[_0x0c32('0x4e')]('openchannel_messages','me',_0x0c32('0x53'))[_0x0c32('0x4e')]('openchannel_interaction_has_tags','it',_0x0c32('0x54'))[_0x0c32('0x4e')](_0x0c32('0x55'),'t',_0x0c32('0x56'));var _0x2c811b=squel['expr']();var _0x452311=[];var _0x1c7cb8=squel[_0x0c32('0x57')]();var _0x17f974;if(_0x2d091d[_0x0c32('0x3c')]['search']){_0x17f974=as[_0x0c32('0x58')](_0x2d091d['query']['search']);var _0x5877ff=_0x17f974['sqlOperator'];for(var _0x28e317=0x0;_0x28e317<_0x17f974[_0x0c32('0x59')]['length'];_0x28e317++){var _0x32e477=_0x17f974[_0x0c32('0x59')][_0x28e317];var _0x504886='i';var _0x514c68=_[_0x0c32('0x5a')](_0x2e8745,[_0x0c32('0x27'),_0x32e477[_0x0c32('0x48')]]);if(!_0x514c68){switch(_0x32e477['field']){case _0x0c32('0x5b'):if(_0x32e477[_0x0c32('0x5c')]==0x1){_0x2ec297[_0x0c32('0x5d')]('`'+_0x32e477[_0x0c32('0x48')]+_0x0c32('0x5e'));}else{_0x2ec297['having']('`'+_0x32e477[_0x0c32('0x48')]+_0x0c32('0x5f'));}break;case'Contact':if(_0x32e477[_0x0c32('0x60')]===_0x0c32('0x61')){if(_0x32e477[_0x0c32('0x5c')]['split']('\x20')[_0x0c32('0x41')]>0x1){_0x2c811b[_0x5877ff](_0x0c32('0x62'),qs['getFullTextValue'](_0x32e477[_0x0c32('0x5c')]),null);}else{var _0x3f9f18='%'+_0x32e477[_0x0c32('0x5c')]+'%';_0x2c811b[_0x5877ff]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3f9f18,_0x3f9f18,_0x3f9f18);}}else{_0x514c68=_[_0x0c32('0x5a')](_0x2e8745,[_0x0c32('0x27'),'ContactId']);_0x32e477['field']=_0x0c32('0x63');_0x20c3c8=as['buildExpression'](_0x504886,_0x514c68[_0x0c32('0x39')],_0x32e477);_0x2c811b[_0x5877ff](_0x20c3c8['text'],_0x20c3c8[_0x0c32('0x5c')][_0x0c32('0x64')],_0x20c3c8['value'][_0x0c32('0x1d')]);}break;case _0x0c32('0x65'):var _0xc6efb1=_0x32e477[_0x0c32('0x5c')]['split'](',')[_0x0c32('0x2a')](function(_0x1cd6f){return Number(_0x1cd6f);});_0xc6efb1[_0x0c32('0x2d')](function(_0x1b7756){_0x1c7cb8['or'](_0x0c32('0x66'),'%,'+_0x1b7756+',%');});_0x452311=_[_0x0c32('0x67')](_0x452311,_0xc6efb1);break;case _0x0c32('0x68'):if(_0x32e477['operator']===_0x0c32('0x61')){_0x2c811b[_0x5877ff]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x32e477[_0x0c32('0x5c')]+'%',null);}else{_0x514c68=_[_0x0c32('0x5a')](_0x2e8745,[_0x0c32('0x27'),_0x0c32('0x31')]);_0x32e477[_0x0c32('0x48')]=_0x0c32('0x31');_0x20c3c8=as['buildExpression'](_0x504886,_0x514c68[_0x0c32('0x39')],_0x32e477);_0x2c811b[_0x5877ff](_0x20c3c8[_0x0c32('0x69')],_0x20c3c8['value'][_0x0c32('0x64')],_0x20c3c8['value'][_0x0c32('0x1d')]);}break;case _0x0c32('0x6a'):_0x20c3c8=as[_0x0c32('0x6b')]('me',null,_0x32e477);_0x2c811b[_0x5877ff](_0x20c3c8[_0x0c32('0x69')],_0x20c3c8['value'][_0x0c32('0x64')],_0x20c3c8[_0x0c32('0x5c')]['end']);break;}}else{var _0x20c3c8=as[_0x0c32('0x6b')](_0x504886,_0x514c68[_0x0c32('0x39')],_0x32e477);_0x2c811b[_0x5877ff](_0x20c3c8[_0x0c32('0x69')],_0x20c3c8['value'][_0x0c32('0x64')],_0x20c3c8['value'][_0x0c32('0x1d')]);}}}else{var _0x3a6ad6=_(_0x2d091d[_0x0c32('0x3c')])[_0x0c32('0x3d')]()[_0x0c32('0x2a')](function(_0x5dab0f){return _[_0x0c32('0x6c')](_0x2e8745,[_0x0c32('0x27'),_0x5dab0f])?_0x5dab0f:undefined;})[_0x0c32('0x6d')]()[_0x0c32('0x5c')]();if(!_[_0x0c32('0x6e')](_0x3a6ad6)){_0x3a6ad6[_0x0c32('0x2d')](function(_0x297d9f){if(_0x297d9f===_0x0c32('0x6f')){_0x2ec297[_0x0c32('0x70')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x0c32('0x71')](_0x2d091d[_0x0c32('0x3c')][_0x297d9f]));}else if(_0x297d9f===_0x0c32('0x72')){var _0x2a0fd6=JSON[_0x0c32('0x73')](_0x2d091d[_0x0c32('0x3c')][_0x297d9f])[_0x0c32('0x74')];var _0x69dfa=JSON[_0x0c32('0x73')](_0x2d091d['query'][_0x297d9f])[_0x0c32('0x75')];_0x2ec297[_0x0c32('0x70')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2a0fd6,_0x69dfa);}else{if(_0x2d091d[_0x0c32('0x3c')][_0x297d9f]===_0x0c32('0x76')){_0x2ec297[_0x0c32('0x70')]('i.'+_0x297d9f+_0x0c32('0x77'));}else{_0x2ec297[_0x0c32('0x70')]('i.'+_0x297d9f+_0x0c32('0x78'),_0x2d091d[_0x0c32('0x3c')][_0x297d9f]);}}});}if(_0x2d091d[_0x0c32('0x3c')][_0x0c32('0x79')]){if(_0x2d091d[_0x0c32('0x3c')][_0x0c32('0x79')]==0x1){_0x2ec297['having'](_0x0c32('0x7a'));}else{_0x2ec297['having'](_0x0c32('0x7b'));}}if(_0x2d091d[_0x0c32('0x3c')][_0x0c32('0x7c')]){_0x452311=_[_0x0c32('0x7d')](_0x2d091d['query'][_0x0c32('0x7c')])?_0x2d091d[_0x0c32('0x3c')][_0x0c32('0x7c')]:new Array(_0x2d091d[_0x0c32('0x3c')]['tag']);_0x452311[_0x0c32('0x2d')](function(_0x95b747){_0x1c7cb8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x95b747+',%');});}if(_0x2d091d['query'][_0x0c32('0x7e')]){var _0x336eb1=_0x2d091d[_0x0c32('0x3c')][_0x0c32('0x7e')]['replace']('\x5c','\x5c\x5c')[_0x0c32('0x7f')](/'/g,'\x27\x27');if(qs[_0x0c32('0x80')](_0x336eb1)){_0x2c811b['or'](_0x0c32('0x81'),_0x336eb1+'%');}else{_0x2c811b['or'](_0x0c32('0x82'),qs['getFullTextValue'](_0x336eb1))['or'](_0x0c32('0x83'),_0x336eb1+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x336eb1+'%');}}}_0x2ec297[_0x0c32('0x70')](_0x2c811b);_0x2ec297[_0x0c32('0x84')](_0x0c32('0x85'));var _0x26be3d={'type':db['Sequelize'][_0x0c32('0x86')]['SELECT'],'raw':!![]};var _0x4eccf6=_0x2ec297['clone']();_0x4eccf6[_0x0c32('0x48')](_0x0c32('0x85'));_0x4eccf6[_0x0c32('0x48')](_0x0c32('0x87'),_0x0c32('0x5b'));if(_0x535300[_0x0c32('0x44')]){_0x535300['order']['forEach'](function(_0x27ce5b){var _0x2eff2a=_0x27ce5b[0x0]===_0x0c32('0x88')?_0x27ce5b[0x0]:'i.'+_0x27ce5b[0x0];_0x2ec297[_0x0c32('0x44')](_0x2eff2a,_0x27ce5b[0x1]===_0x0c32('0x89')?![]:!![]);});}if(!_[_0x0c32('0x6e')](_0x452311)){_0x2ec297[_0x0c32('0x5d')](_0x1c7cb8);_0x4eccf6['where']('t.id\x20IN\x20?',_0x452311);}BPromise[_0x0c32('0x8a')]()[_0x0c32('0x24')](function(){if(!_0x17f974){if(_0x2d091d['query'][_0x0c32('0x6f')])return;_0x4eccf6[_0x0c32('0x70')](_0x0c32('0x8b'));_0x2ec297['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2d091d['user'][_0x0c32('0x8c')]!==_0x0c32('0x8d'))return;return _0x2d091d['user'][_0x0c32('0x8e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x10b9f8){if(_[_0x0c32('0x6e')](_0x10b9f8)){_0x4eccf6[_0x0c32('0x70')](_0x0c32('0x8f'));_0x2ec297[_0x0c32('0x70')](_0x0c32('0x8f'));}else{_0x4eccf6[_0x0c32('0x70')](_0x0c32('0x90'),_['map'](_0x10b9f8,'id'));_0x2ec297[_0x0c32('0x70')](_0x0c32('0x90'),_[_0x0c32('0x2a')](_0x10b9f8,'id'));}});})[_0x0c32('0x24')](function(){if(_0x2d091d[_0x0c32('0x91')]['role']==='agent'&&!_0x17f974&&!_0x2d091d['query']['OpenchannelAccountId'])return[];return db[_0x0c32('0x92')][_0x0c32('0x3c')](_0x4eccf6[_0x0c32('0x93')](),_0x26be3d);})['then'](function(_0x14c485){_0x43a4bb[_0x0c32('0x94')]=_0x14c485['length'];if(_0x43a4bb[_0x0c32('0x94')]===0x0)return[];return db['sequelize'][_0x0c32('0x3c')](_0xd003b0[_0x0c32('0x93')](),_0x26be3d)['then'](function(_0x1482f6){_0x19a23d=_[_0x0c32('0x95')](_0x1482f6,'id');_0x26be3d=_[_0x0c32('0x96')](_0x26be3d,{'model':db[_0x0c32('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2d091d[_0x0c32('0x3c')][_0x0c32('0x40')]){_0x535300[_0x0c32('0x42')][_0x0c32('0x2d')](function(_0x9989e3){_0x2ec297['field']('i.'+_0x9989e3);});}else{_0x2ec297[_0x0c32('0x48')](_0x0c32('0x87'),'unreadMessages');_0x2ec297[_0x0c32('0x48')](_0x0c32('0x97'),_0x0c32('0x98'));_0x2ec297['field']('a.mandatoryDisposition',_0x0c32('0x99'));_0x2ec297[_0x0c32('0x48')](_0x0c32('0x9a'),'contactName');_0x2ec297[_0x0c32('0x48')](_0x0c32('0x9b'));_0x2ec297['field']('c.firstName','Contact.firstName');_0x2ec297[_0x0c32('0x48')](_0x0c32('0x9c'),_0x0c32('0x9d'));_0x2ec297[_0x0c32('0x48')](_0x0c32('0x9e'),_0x0c32('0x9f'));_0x2ec297[_0x0c32('0x48')](_0x0c32('0xa0'),_0x0c32('0xa1'));_0x2ec297['field'](_0x0c32('0xa2'),_0x0c32('0xa3'));_0x2ec297[_0x0c32('0x48')](_0x0c32('0xa4'),_0x0c32('0xa5'));_0x2ec297['field'](_0x0c32('0xa6'),_0x0c32('0xa7'));_0x2ec297['field'](_0x0c32('0xa8'),'Owner.internal');_0x2ec297['field'](_0x0c32('0xa9'),_0x0c32('0x2b'));}if(_0x535300['limit'])_0x2ec297[_0x0c32('0x1f')](_0x535300['limit']);if(_0x535300[_0x0c32('0x21')])_0x2ec297[_0x0c32('0x21')](_0x535300[_0x0c32('0x21')]);return db[_0x0c32('0x92')]['query'](_0x2ec297[_0x0c32('0x93')](),_0x26be3d);})[_0x0c32('0x24')](function(_0x5b4f4f){if(_0x5b4f4f[_0x0c32('0x41')]>0x0)_0x504768['where'](_0x0c32('0xaa'),_[_0x0c32('0x2a')](_0x5b4f4f,'id'));return db[_0x0c32('0x92')][_0x0c32('0x3c')](_0x504768[_0x0c32('0x93')](),_0x26be3d)[_0x0c32('0x24')](function(_0xc12387){var _0x22bd27=_[_0x0c32('0xab')](_0xc12387,_0x0c32('0xac'));var _0x10d98e=[];_0x5b4f4f[_0x0c32('0x2d')](function(_0x114934){_0x10d98e[_0x0c32('0xad')](updateOpenchannelInteraction(_0x114934,_0x19a23d,_0x22bd27));});return BPromise['all'](_0x10d98e);});});})[_0x0c32('0x24')](function(_0x307687){_0x43a4bb[_0x0c32('0xae')]=_0x307687;return _0x43a4bb;})[_0x0c32('0x24')](respondWithFilteredResult(_0x511a98,_0x535300))[_0x0c32('0x2f')](handleError(_0x511a98,null));};exports[_0x0c32('0xaf')]=function(_0x7f81c1,_0x395a5d){var _0x2c07db={};if(_0x7f81c1['query']['type']&&_0x7f81c1[_0x0c32('0x3c')][_0x0c32('0x39')]==='from'){_0x2c07db[_0x0c32('0x4a')]=_0x7f81c1[_0x0c32('0xb0')]['id'];}else{_0x2c07db['id']=_0x7f81c1[_0x0c32('0xb0')]['id'];}var _0x529471={'raw':![],'where':_0x2c07db},_0x59a834={};_0x59a834[_0x0c32('0x3b')]=_[_0x0c32('0x3d')](db[_0x0c32('0x37')][_0x0c32('0x38')]);_0x59a834['query']=_[_0x0c32('0x3d')](_0x7f81c1[_0x0c32('0x3c')]);_0x59a834[_0x0c32('0x3e')]=_[_0x0c32('0x3f')](_0x59a834[_0x0c32('0x3b')],_0x59a834['query']);_0x529471[_0x0c32('0x42')]=_['intersection'](_0x59a834[_0x0c32('0x3b')],qs[_0x0c32('0x40')](_0x7f81c1[_0x0c32('0x3c')][_0x0c32('0x40')]));_0x529471['attributes']=_0x529471[_0x0c32('0x42')][_0x0c32('0x41')]?_0x529471[_0x0c32('0x42')]:_0x59a834[_0x0c32('0x3b')];if(_0x7f81c1['query'][_0x0c32('0xb1')]){_0x529471['include']=[{'all':!![]}];}_0x529471=_[_0x0c32('0x96')]({},_0x529471,_0x7f81c1[_0x0c32('0xb2')]);return db[_0x0c32('0x37')][_0x0c32('0x5a')](_0x529471)[_0x0c32('0x24')](handleEntityNotFound(_0x395a5d,null))['then'](respondWithResult(_0x395a5d,null))['catch'](handleError(_0x395a5d,null));};exports[_0x0c32('0xb3')]=function(_0x422bc3,_0x5c7ba2){return db['OpenchannelInteraction']['create'](_0x422bc3['body'],{})[_0x0c32('0x24')](respondWithResult(_0x5c7ba2,0xc9))[_0x0c32('0x2f')](handleError(_0x5c7ba2,null));};exports[_0x0c32('0xb4')]=function(_0xb45b52,_0x132826){if(_0xb45b52[_0x0c32('0x6a')]['id']){delete _0xb45b52['body']['id'];}return db[_0x0c32('0x37')][_0x0c32('0x5a')]({'where':{'id':_0xb45b52[_0x0c32('0xb0')]['id']}})[_0x0c32('0x24')](handleEntityNotFound(_0x132826,null))[_0x0c32('0x24')](saveUpdates(_0xb45b52[_0x0c32('0x6a')],null))[_0x0c32('0x24')](respondWithResult(_0x132826,null))[_0x0c32('0x2f')](handleError(_0x132826,null));};exports[_0x0c32('0xb5')]=function(_0x1f7a83,_0x3a88b1){return db['OpenchannelInteraction']['find']({'where':{'id':_0x1f7a83['params']['id']}})[_0x0c32('0x24')](handleEntityNotFound(_0x3a88b1,null))['then'](removeEntity(_0x3a88b1,null))[_0x0c32('0x2f')](handleError(_0x3a88b1,null));};exports[_0x0c32('0xb6')]=function(_0x42e55f,_0xbc191d){return db[_0x0c32('0x37')][_0x0c32('0xb6')]()['then'](respondWithResult(_0xbc191d,null))[_0x0c32('0x2f')](handleError(_0xbc191d,null));};exports[_0x0c32('0xb7')]=function(_0x504ecd,_0x293020,_0x5da4e1){return db[_0x0c32('0xb8')][_0x0c32('0x5a')]({'where':{'id':_0x504ecd['params']['id']}})[_0x0c32('0x24')](handleEntityNotFound(_0x293020,null))[_0x0c32('0x24')](function(_0x4bf0fc){if(_0x4bf0fc){return _0x4bf0fc['addMessage'](_0x504ecd[_0x0c32('0x6a')][_0x0c32('0xb9')],_[_0x0c32('0xba')](_0x504ecd[_0x0c32('0x6a')],[_0x0c32('0xb9'),'id'])||{});}})[_0x0c32('0x24')](respondWithResult(_0x293020,null))[_0x0c32('0x2f')](handleError(_0x293020,null));};exports[_0x0c32('0xbb')]=function(_0x252afa,_0x58c380,_0x577a36){var _0x534fdb={'raw':![],'where':{}};var _0x2e0a38={};var _0x35426e={'count':0x0,'rows':[]};return db[_0x0c32('0x37')]['findOne']({'where':{'id':_0x252afa[_0x0c32('0xb0')]['id']}})[_0x0c32('0x24')](handleEntityNotFound(_0x58c380,null))[_0x0c32('0x24')](function(_0x13d1af){if(_0x13d1af){_0x2e0a38[_0x0c32('0x3b')]=_[_0x0c32('0x3d')](db[_0x0c32('0xb8')][_0x0c32('0x38')]);_0x2e0a38['query']=_[_0x0c32('0x3d')](_0x252afa[_0x0c32('0x3c')]);_0x2e0a38[_0x0c32('0x3e')]=_[_0x0c32('0x3f')](_0x2e0a38[_0x0c32('0x3b')],_0x2e0a38[_0x0c32('0x3c')]);_0x534fdb['attributes']=_[_0x0c32('0x3f')](_0x2e0a38[_0x0c32('0x3b')],qs['fields'](_0x252afa['query'][_0x0c32('0x40')]));_0x534fdb[_0x0c32('0x42')]=_0x534fdb[_0x0c32('0x42')][_0x0c32('0x41')]?_0x534fdb[_0x0c32('0x42')]:_0x2e0a38[_0x0c32('0x3b')];if(!_0x252afa['query'][_0x0c32('0xbc')](_0x0c32('0x43'))){_0x534fdb['limit']=qs[_0x0c32('0x1f')](_0x252afa[_0x0c32('0x3c')][_0x0c32('0x1f')]);_0x534fdb['offset']=qs[_0x0c32('0x21')](_0x252afa[_0x0c32('0x3c')]['offset']);}_0x534fdb[_0x0c32('0x44')]=qs[_0x0c32('0x45')](_0x252afa[_0x0c32('0x3c')][_0x0c32('0x45')]);_0x534fdb[_0x0c32('0x70')]=qs[_0x0c32('0x3e')](_[_0x0c32('0x46')](_0x252afa[_0x0c32('0x3c')],_0x2e0a38['filters']));_0x534fdb['where'][_0x0c32('0xac')]=_0x13d1af['id'];if(_0x252afa[_0x0c32('0x3c')][_0x0c32('0x7e')]){_0x534fdb[_0x0c32('0x70')]=_[_0x0c32('0x96')](_0x534fdb[_0x0c32('0x70')],{'$or':_[_0x0c32('0x2a')](_0x534fdb[_0x0c32('0x42')],function(_0x14cc74){var _0x2ff40b={};_0x2ff40b[_0x14cc74]={'$like':'%'+_0x252afa[_0x0c32('0x3c')][_0x0c32('0x7e')]+'%'};return _0x2ff40b;})});}if(_0x252afa[_0x0c32('0x3c')][_0x0c32('0x74')]){var _0x4e1dcf=_0x252afa['query'][_0x0c32('0x74')][_0x0c32('0x2c')](',');var _0x173291={};_0x173291[_0x4e1dcf[0x0]]={'$gte':moment(_0x4e1dcf[0x1])[_0x0c32('0xbd')](_0x0c32('0xbe'))};_0x534fdb['where']=_[_0x0c32('0x96')](_0x534fdb[_0x0c32('0x70')],_0x173291);}_0x534fdb=_[_0x0c32('0x96')]({},_0x534fdb,_0x252afa[_0x0c32('0xb2')]);return db['OpenchannelMessage'][_0x0c32('0x94')]({'where':_0x534fdb[_0x0c32('0x70')]})['then'](function(_0x291889){_0x35426e[_0x0c32('0x94')]=_0x291889;if(_0x252afa[_0x0c32('0x3c')][_0x0c32('0xb1')]){_0x534fdb[_0x0c32('0xbf')]=[{'all':!![]}];}return db[_0x0c32('0xb8')][_0x0c32('0xc0')](_0x534fdb);})[_0x0c32('0x24')](function(_0x5a0cad){_0x35426e[_0x0c32('0xae')]=_0x5a0cad;return _0x35426e;});}})[_0x0c32('0x24')](respondWithFilteredResult(_0x58c380,_0x534fdb))[_0x0c32('0x2f')](handleError(_0x58c380,null));};exports[_0x0c32('0xc1')]=function(_0x4654e9,_0x47bc6f,_0x5ad79b){return db[_0x0c32('0x37')][_0x0c32('0x5a')]({'where':{'id':_0x4654e9[_0x0c32('0xb0')]['id']}})[_0x0c32('0x24')](handleEntityNotFound(_0x47bc6f,null))[_0x0c32('0x24')](function(_0x51f88e){if(_0x51f88e){return _0x51f88e['setTags'](_0x4654e9['body']['ids'],_[_0x0c32('0xba')](_0x4654e9[_0x0c32('0x6a')],[_0x0c32('0xb9'),'id'])||{})[_0x0c32('0xc2')](function(){return db[_0x0c32('0x65')][_0x0c32('0xc0')]({'attributes':['id',_0x0c32('0x27'),'color'],'where':{'id':_0x4654e9['body'][_0x0c32('0xb9')]}});})[_0x0c32('0x24')](function(_0x570409){socket[_0x0c32('0xc3')](_0x0c32('0xc4'),{'id':Number(_0x4654e9[_0x0c32('0xb0')]['id']),'tags':_0x570409||[]});return{'id':Number(_0x4654e9[_0x0c32('0xb0')]['id']),'tags':_0x570409||[]};});}})[_0x0c32('0x24')](respondWithResult(_0x47bc6f,null))['catch'](handleError(_0x47bc6f,null));};exports[_0x0c32('0xc5')]=function(_0x5756d7,_0x255665,_0x484c43){return db[_0x0c32('0x37')][_0x0c32('0x5a')]({'where':{'id':_0x5756d7[_0x0c32('0xb0')]['id']}})['then'](handleEntityNotFound(_0x255665,null))[_0x0c32('0x24')](function(_0x5eaf20){if(_0x5eaf20){return _0x5eaf20[_0x0c32('0xc5')](_0x5756d7[_0x0c32('0x3c')][_0x0c32('0xb9')]);}})['then'](respondWithStatusCode(_0x255665,null))[_0x0c32('0x2f')](handleError(_0x255665,null));};exports[_0x0c32('0xc6')]=function(_0x3777d0,_0x1d64b1){var _0x29ebf9=moment()[_0x0c32('0xc7')]()[_0x0c32('0x93')]();var _0x2f7e07=path['join'](config[_0x0c32('0xc8')],'server',_0x0c32('0xc9'),'tmp');var _0x60793c=path[_0x0c32('0xca')](config[_0x0c32('0xc8')],_0x0c32('0xcb'),_0x0c32('0xc9'),'attachments');var _0x45069a=path[_0x0c32('0xca')](_0x2f7e07,_0x29ebf9);var _0x43a54f=util[_0x0c32('0xbd')](_0x0c32('0xcc'),_0x3777d0[_0x0c32('0xb0')]['id'],_0x29ebf9);var _0x57f421=path[_0x0c32('0xca')](_0x2f7e07,_0x43a54f);var _0x3cc28a=[];_0x3cc28a['push']({'model':db[_0x0c32('0x68')],'as':_0x0c32('0x68'),'attributes':['id',_0x0c32('0xcd')],'raw':!![]});_0x3cc28a[_0x0c32('0xad')]({'model':db[_0x0c32('0xce')],'as':_0x0c32('0xcf'),'attributes':['id',_0x0c32('0xd0'),_0x0c32('0xd1')],'raw':!![]});if(_0x3777d0[_0x0c32('0x3c')][_0x0c32('0xd2')]){_0x3cc28a['push']({'model':db[_0x0c32('0xd3')],'as':_0x0c32('0xd3'),'raw':!![]});}var _0x2f1eb2=[{'model':db[_0x0c32('0xb8')],'as':'Messages','attributes':['id','body','createdAt',_0x0c32('0xd4'),_0x0c32('0xd5'),_0x0c32('0x79')],'include':_0x3cc28a}];_0x2f1eb2[_0x0c32('0xad')]({'model':db[_0x0c32('0xd6')],'as':_0x0c32('0xd7'),'attributes':['id',_0x0c32('0x27')]});_0x2f1eb2['push']({'model':db[_0x0c32('0x68')],'as':_0x0c32('0xd8'),'attributes':['id',_0x0c32('0xcd')]});return db['OpenchannelInteraction'][_0x0c32('0x5a')]({'where':{'id':_0x3777d0['params']['id']},'include':_0x2f1eb2})[_0x0c32('0x24')](handleEntityNotFound(_0x1d64b1,null))[_0x0c32('0x24')](function(_0xa8b036){if(_0xa8b036){var _0xfedf52=_0xa8b036['get']({'plain':!![]});fs[_0x0c32('0xd9')](_0x45069a);var _0x4b1eec={'channel':_0x0c32('0xda'),'account':_0xfedf52[_0x0c32('0xd7')][_0x0c32('0x27')],'agent':_0xfedf52[_0x0c32('0xd8')]?_0xfedf52[_0x0c32('0xd8')][_0x0c32('0xcd')]:'N.A.','createdAt':moment(_0xfedf52[_0x0c32('0x72')])[_0x0c32('0xbd')](_0x0c32('0xbe'))[_0x0c32('0x93')](),'closedAt':_0xfedf52[_0x0c32('0x33')]?moment(_0xfedf52[_0x0c32('0xdb')])[_0x0c32('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0c32('0x93')]():'','disposition':_0xfedf52[_0x0c32('0xdc')],'visibility':_0xfedf52[_0x0c32('0xdd')]?_0x0c32('0xde'):_0x0c32('0xdf'),'messages':_(_0xfedf52[_0x0c32('0xe0')])['filter']({'secret':![]})['map'](function(_0x3def98){if(_0x3def98[_0x0c32('0xd3')]){var _0x2a5883=path[_0x0c32('0xca')](_0x60793c,_0x3def98[_0x0c32('0xd3')][_0x0c32('0xe1')]);if(fs[_0x0c32('0xe2')](_0x2a5883)){fs[_0x0c32('0xe3')](_0x2a5883)[_0x0c32('0xe4')](fs['createWriteStream'](path['join'](_0x45069a,_0x3def98[_0x0c32('0xd3')][_0x0c32('0xe1')])));}}return{'date':moment(_0x3def98['createdAt'])['format'](_0x0c32('0xbe'))[_0x0c32('0x93')](),'sender':_0x3def98['direction']===_0x0c32('0xe5')?_0x3def98[_0x0c32('0x68')]?_0x3def98['User'][_0x0c32('0xcd')]:_0x0c32('0xe6'):_0x3def98[_0x0c32('0xcf')][_0x0c32('0xd0')]+(_0x3def98[_0x0c32('0xcf')]['lastName']?'\x20'+_0x3def98[_0x0c32('0xcf')][_0x0c32('0xd1')]:''),'body':_0x3def98['Attachment']?_0x3def98[_0x0c32('0xd3')][_0x0c32('0xe1')]:_0x3def98['body'],'direction':_0x3def98[_0x0c32('0xd4')]==='out'?'A':'C','secret':_0x3def98[_0x0c32('0xd5')],'read':_0x3def98[_0x0c32('0x79')],'attachment':_0x3def98[_0x0c32('0xd3')]};})['value']()};return ejs[_0x0c32('0xe7')](path['join'](config[_0x0c32('0xc8')],_0x0c32('0xcb'),_0x0c32('0xe8'),'downloadInteraction.ejs'),{'interaction':_0x4b1eec})[_0x0c32('0x24')](function(_0x4179a1){var _0x4d3425=path[_0x0c32('0xca')](_0x45069a,_0x0c32('0xe9')+_0xfedf52['id']+'-'+_0x29ebf9+_0x0c32('0xea'));var _0x5e1c87={'path':_0x4d3425,'channel':'Openchannel','interactionId':_0xfedf52['id']};return pdf[_0x0c32('0xeb')](_0x4179a1,_0x5e1c87);})[_0x0c32('0x24')](function(){return new BPromise(function(_0x1c5bc8,_0x32d90f){zipdir(_0x45069a,{'saveTo':_0x57f421},function(_0x325af9,_0x11e730){if(_0x325af9)return _0x32d90f(_0x325af9);return _0x1c5bc8(_0x11e730);});})[_0x0c32('0x24')](function(){return new BPromise(function(_0x23b566,_0x47e725){rimraf(_0x45069a,function(_0x4de60e){if(_0x4de60e)_0x47e725(_0x4de60e);return _0x23b566();});});})['then'](function(){return _0x1d64b1[_0x0c32('0xc6')](_0x57f421,_0x43a54f,function(_0x161f54){if(_0x161f54){console[_0x0c32('0xec')](_0x0c32('0xed'),_0x161f54);}else{fs[_0x0c32('0xee')](_0x57f421);}});});});}else{return _0x1d64b1[_0x0c32('0xef')](0xc8);}})['catch'](handleError(_0x1d64b1,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 20133df..952c14c 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 _0x1b48=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x1b48,0x6d));var _0x81b4=function(_0x5f332f,_0xc899b0){_0x5f332f=_0x5f332f-0x0;var _0x563f9c=_0x1b48[_0x5f332f];return _0x563f9c;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db'][_0x81b4('0x0')];var OpenchannelMessage=require(_0x81b4('0x1'))['db'][_0x81b4('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x81b4('0x3')](0x0);var events={'afterCreate':_0x81b4('0x4'),'afterUpdate':_0x81b4('0x5'),'afterDestroy':_0x81b4('0x6')};function emitEvent(_0x5e181b){return function(_0x17a809,_0x2ef2e1,_0x5adcac){_0x17a809[_0x81b4('0x7')]({'attributes':['id'],'raw':!![]})[_0x81b4('0x8')](function(_0x4b4d3a){_0x17a809[_0x81b4('0x9')](_0x81b4('0xa'),_0x4b4d3a[_0x81b4('0xb')](function(_0x573dc9){return{'id':_0x573dc9['id']};}));return OpenchannelMessage[_0x81b4('0xc')]({'where':{'OpenchannelInteractionId':_0x17a809['id'],'direction':'in','read':![]},'raw':!![]});})[_0x81b4('0x8')](function(_0x2100a1){_0x17a809[_0x81b4('0x9')](_0x81b4('0xd'),_0x2100a1[_0x81b4('0xe')]);OpenchannelInteractionEvents['emit'](_0x5e181b+':'+_0x17a809['id'],_0x17a809);OpenchannelInteractionEvents[_0x81b4('0xf')](_0x5e181b,_0x17a809);_0x5adcac(null);})[_0x81b4('0x10')](_0x5adcac(null));};}for(var e in events){if(events[_0x81b4('0x11')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x81b4('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x357e=['../../mysqldb','OpenchannelMessage','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hook','exports','events','OpenchannelInteraction'];(function(_0x2c0ac4,_0x4e0dd1){var _0x4eba00=function(_0x1a298c){while(--_0x1a298c){_0x2c0ac4['push'](_0x2c0ac4['shift']());}};_0x4eba00(++_0x4e0dd1);}(_0x357e,0xa0));var _0xe357=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x357e[_0x13b8f3];return _0x1a6d06;};'use strict';var EventEmitter=require(_0xe357('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xe357('0x1')];var OpenchannelMessage=require(_0xe357('0x2'))['db'][_0xe357('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe357('0x4'),'afterUpdate':_0xe357('0x5'),'afterDestroy':_0xe357('0x6')};function emitEvent(_0x5c9c54){return function(_0x2ca127,_0x967007,_0x671178){_0x2ca127[_0xe357('0x7')]({'attributes':['id'],'raw':!![]})[_0xe357('0x8')](function(_0x595ec9){_0x2ca127[_0xe357('0x9')](_0xe357('0xa'),_0x595ec9[_0xe357('0xb')](function(_0x5f0f66){return{'id':_0x5f0f66['id']};}));return OpenchannelMessage[_0xe357('0xc')]({'where':{'OpenchannelInteractionId':_0x2ca127['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x25b50a){_0x2ca127[_0xe357('0x9')](_0xe357('0xd'),_0x25b50a[_0xe357('0xe')]);OpenchannelInteractionEvents[_0xe357('0xf')](_0x5c9c54+':'+_0x2ca127['id'],_0x2ca127);OpenchannelInteractionEvents[_0xe357('0xf')](_0x5c9c54,_0x2ca127);_0x671178(null);})['catch'](_0x671178(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xe357('0x10')](e,emitEvent(event));}}module[_0xe357('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 f55137d..2c2610e 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 _0xa42e=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt'];(function(_0x3f79a0,_0x31cce6){var _0x2ffb5f=function(_0x4c7e38){while(--_0x4c7e38){_0x3f79a0['push'](_0x3f79a0['shift']());}};_0x2ffb5f(++_0x31cce6);}(_0xa42e,0xec));var _0xea42=function(_0x59f558,_0x10fc7c){_0x59f558=_0x59f558-0x0;var _0x1901c1=_0xa42e[_0x59f558];return _0x1901c1;};'use strict';var _=require(_0xea42('0x0'));var util=require(_0xea42('0x1'));var logger=require(_0xea42('0x2'))(_0xea42('0x3'));var moment=require(_0xea42('0x4'));var BPromise=require(_0xea42('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xea42('0x6'));var attributes=require(_0xea42('0x7'));module[_0xea42('0x8')]=function(_0x83ff00,_0x327b04){return _0x83ff00['define'](_0xea42('0x9'),attributes,{'tableName':_0xea42('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xea42('0xb'),'collate':_0xea42('0xc'),'hooks':{'beforeUpdate':function(_0xf09a70,_0xfe1d53,_0x339486){if(_0xf09a70[_0xea42('0xd')](_0xea42('0xe'))){_0xf09a70[_0xea42('0xf')]=moment()[_0xea42('0x10')](_0xea42('0x11'));}_0x339486(null,_0xf09a70);}}});}; \ No newline at end of file +var _0xf6cd=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf6cd,0x16b));var _0xdf6c=function(_0x37768b,_0xedcc5a){_0x37768b=_0x37768b-0x0;var _0x1f3c43=_0xf6cd[_0x37768b];return _0x1f3c43;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdf6c('0x0'))(_0xdf6c('0x1'));var moment=require(_0xdf6c('0x2'));var BPromise=require(_0xdf6c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf6c('0x4'));var rimraf=require(_0xdf6c('0x5'));var config=require(_0xdf6c('0x6'));var attributes=require(_0xdf6c('0x7'));module[_0xdf6c('0x8')]=function(_0x5dbf5e,_0x24fe48){return _0x5dbf5e[_0xdf6c('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0xdf6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdf6c('0xb'),'collate':_0xdf6c('0xc'),'hooks':{'beforeUpdate':function(_0x313b69,_0x21af6b,_0x3a608d){if(_0x313b69[_0xdf6c('0xd')](_0xdf6c('0xe'))){_0x313b69[_0xdf6c('0xf')]=moment()[_0xdf6c('0x10')](_0xdf6c('0x11'));}_0x3a608d(null,_0x313b69);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 141f649..0b413f7 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 _0x897f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./openchannelInteraction.socket','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','then','debug','find','addTags','ids','omit','spread','AddTags','lodash','util'];(function(_0x4cc49d,_0x59b2bf){var _0x196424=function(_0x2f80c6){while(--_0x2f80c6){_0x4cc49d['push'](_0x4cc49d['shift']());}};_0x196424(++_0x59b2bf);}(_0x897f,0xd0));var _0xf897=function(_0x9b9c46,_0x3997a8){_0x9b9c46=_0x9b9c46-0x0;var _0x47ee52=_0x897f[_0x9b9c46];return _0x47ee52;};'use strict';var _=require(_0xf897('0x0'));var util=require(_0xf897('0x1'));var moment=require(_0xf897('0x2'));var BPromise=require(_0xf897('0x3'));var rs=require(_0xf897('0x4'));var fs=require('fs');var Redis=require(_0xf897('0x5'));var db=require(_0xf897('0x6'))['db'];var utils=require(_0xf897('0x7'));var logger=require(_0xf897('0x8'))(_0xf897('0x9'));var config=require(_0xf897('0xa'));var jayson=require(_0xf897('0xb'));var client=jayson['client'][_0xf897('0xc')]({'port':0x232a});config[_0xf897('0xd')]=_['defaults'](config[_0xf897('0xd')],{'host':_0xf897('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf897('0xd')]));require(_0xf897('0xf'))['register'](socket);function respondWithRpcPromise(_0x4bd986,_0x4fe3b7,_0x44f9dd){return new BPromise(function(_0x3d3c86,_0x579d43){return client[_0xf897('0x10')](_0x4bd986,_0x44f9dd)['then'](function(_0x4f1d1a){logger[_0xf897('0x11')](_0xf897('0x12'),_0x4fe3b7,_0xf897('0x13'));logger['debug'](_0xf897('0x14'),_0x4fe3b7,'request\x20sent',JSON[_0xf897('0x15')](_0x4f1d1a));if(_0x4f1d1a[_0xf897('0x16')]){if(_0x4f1d1a[_0xf897('0x16')][_0xf897('0x17')]===0x1f4){logger[_0xf897('0x16')](_0xf897('0x12'),_0x4fe3b7,_0x4f1d1a[_0xf897('0x16')][_0xf897('0x18')]);return _0x579d43(_0x4f1d1a['error']['message']);}logger[_0xf897('0x16')](_0xf897('0x12'),_0x4fe3b7,_0x4f1d1a[_0xf897('0x16')][_0xf897('0x18')]);return _0x3d3c86(_0x4f1d1a[_0xf897('0x16')][_0xf897('0x18')]);}else{logger[_0xf897('0x11')](_0xf897('0x12'),_0x4fe3b7,'request\x20sent');_0x3d3c86(_0x4f1d1a[_0xf897('0x19')][_0xf897('0x18')]);}})[_0xf897('0x1a')](function(_0x2875aa){logger[_0xf897('0x16')](_0xf897('0x12'),_0x4fe3b7,_0x2875aa);_0x579d43(_0x2875aa);});});}exports[_0xf897('0x1b')]=function(_0x18f7d4){var _0x5de20b=this;return new Promise(function(_0x58f1e1,_0x2a6be6){return db[_0xf897('0x1c')]['update'](_0x18f7d4[_0xf897('0x1d')],{'raw':_0x18f7d4[_0xf897('0x1e')]?_0x18f7d4[_0xf897('0x1e')][_0xf897('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18f7d4[_0xf897('0x1e')]?_0x18f7d4[_0xf897('0x1e')][_0xf897('0x20')]||null:null,'attributes':_0x18f7d4[_0xf897('0x1e')]?_0x18f7d4['options'][_0xf897('0x21')]||null:null,'limit':_0x18f7d4[_0xf897('0x1e')]?_0x18f7d4[_0xf897('0x1e')]['limit']||null:null})[_0xf897('0x22')](function(_0x4def0c){logger[_0xf897('0x11')](_0xf897('0x1b'),_0x18f7d4);logger[_0xf897('0x23')]('UpdateOpenchannelInteraction',_0x18f7d4,JSON[_0xf897('0x15')](_0x4def0c));_0x58f1e1(_0x4def0c);})[_0xf897('0x1a')](function(_0x1a1bd1){logger[_0xf897('0x16')]('UpdateOpenchannelInteraction',_0x1a1bd1[_0xf897('0x18')],_0x18f7d4);_0x2a6be6(_0x5de20b[_0xf897('0x16')](0x1f4,_0x1a1bd1[_0xf897('0x18')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x1b6114){return new Promise(function(_0x38f441,_0x3618cb){return db[_0xf897('0x1c')][_0xf897('0x24')]({'where':_0x1b6114[_0xf897('0x1e')]?_0x1b6114['options']['where']||null:null})[_0xf897('0x22')](function(_0x330ebb){if(_0x330ebb){return _0x330ebb[_0xf897('0x25')](_0x1b6114['body'][_0xf897('0x26')],_[_0xf897('0x27')](_0x1b6114[_0xf897('0x1d')],[_0xf897('0x26'),'id'])||{});}})[_0xf897('0x28')](function(_0xc80f){logger['info']('AddTags',_0x1b6114);logger[_0xf897('0x23')](_0xf897('0x29'),_0x1b6114,JSON[_0xf897('0x15')](_0xc80f));_0x38f441(_0xc80f);})['catch'](function(_0x7967bd){logger['error'](_0xf897('0x29'),_0x7967bd[_0xf897('0x18')],_0x1b6114);_0x3618cb(_this[_0xf897('0x16')](0x1f4,_0x7967bd[_0xf897('0x18')]));});});}; \ No newline at end of file +var _0x686d=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelInteraction','update','body','options','where','attributes','UpdateOpenchannelInteraction','catch','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','util','bluebird','randomstring'];(function(_0x21f912,_0x309fa0){var _0x150b47=function(_0x1d484e){while(--_0x1d484e){_0x21f912['push'](_0x21f912['shift']());}};_0x150b47(++_0x309fa0);}(_0x686d,0x9d));var _0xd686=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0x686d[_0x36f243];return _0x426436;};'use strict';var _=require('lodash');var util=require(_0xd686('0x0'));var moment=require('moment');var BPromise=require(_0xd686('0x1'));var rs=require(_0xd686('0x2'));var fs=require('fs');var Redis=require(_0xd686('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd686('0x4'));var logger=require(_0xd686('0x5'))(_0xd686('0x6'));var config=require('../../config/environment');var jayson=require(_0xd686('0x7'));var client=jayson[_0xd686('0x8')]['http']({'port':0x232a});config['redis']=_[_0xd686('0x9')](config[_0xd686('0xa')],{'host':_0xd686('0xb'),'port':0x18eb});var socket=require(_0xd686('0xc'))(new Redis(config[_0xd686('0xa')]));require('./openchannelInteraction.socket')[_0xd686('0xd')](socket);function respondWithRpcPromise(_0x16d442,_0x4e91f0,_0x958aa7){return new BPromise(function(_0x5ae8e6,_0x1b5770){return client[_0xd686('0xe')](_0x16d442,_0x958aa7)[_0xd686('0xf')](function(_0x418d1e){logger[_0xd686('0x10')](_0xd686('0x11'),_0x4e91f0,_0xd686('0x12'));logger[_0xd686('0x13')](_0xd686('0x14'),_0x4e91f0,_0xd686('0x12'),JSON[_0xd686('0x15')](_0x418d1e));if(_0x418d1e[_0xd686('0x16')]){if(_0x418d1e['error'][_0xd686('0x17')]===0x1f4){logger[_0xd686('0x16')](_0xd686('0x11'),_0x4e91f0,_0x418d1e['error'][_0xd686('0x18')]);return _0x1b5770(_0x418d1e[_0xd686('0x16')][_0xd686('0x18')]);}logger[_0xd686('0x16')](_0xd686('0x11'),_0x4e91f0,_0x418d1e['error'][_0xd686('0x18')]);return _0x5ae8e6(_0x418d1e['error'][_0xd686('0x18')]);}else{logger['info'](_0xd686('0x11'),_0x4e91f0,_0xd686('0x12'));_0x5ae8e6(_0x418d1e['result'][_0xd686('0x18')]);}})['catch'](function(_0x1fbe70){logger[_0xd686('0x16')](_0xd686('0x11'),_0x4e91f0,_0x1fbe70);_0x1b5770(_0x1fbe70);});});}exports['UpdateOpenchannelInteraction']=function(_0x2ceebf){var _0xb52024=this;return new Promise(function(_0x81c053,_0x2b3c3c){return db[_0xd686('0x19')][_0xd686('0x1a')](_0x2ceebf[_0xd686('0x1b')],{'raw':_0x2ceebf[_0xd686('0x1c')]?_0x2ceebf['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ceebf[_0xd686('0x1c')]?_0x2ceebf['options'][_0xd686('0x1d')]||null:null,'attributes':_0x2ceebf[_0xd686('0x1c')]?_0x2ceebf[_0xd686('0x1c')][_0xd686('0x1e')]||null:null,'limit':_0x2ceebf[_0xd686('0x1c')]?_0x2ceebf[_0xd686('0x1c')]['limit']||null:null})[_0xd686('0xf')](function(_0x4f0210){logger[_0xd686('0x10')](_0xd686('0x1f'),_0x2ceebf);logger[_0xd686('0x13')](_0xd686('0x1f'),_0x2ceebf,JSON[_0xd686('0x15')](_0x4f0210));_0x81c053(_0x4f0210);})[_0xd686('0x20')](function(_0x3f9deb){logger[_0xd686('0x16')](_0xd686('0x1f'),_0x3f9deb['message'],_0x2ceebf);_0x2b3c3c(_0xb52024[_0xd686('0x16')](0x1f4,_0x3f9deb[_0xd686('0x18')]));});});};exports[_0xd686('0x21')]=function(_0x397f9b){return new Promise(function(_0x3251d7,_0x1f918a){return db[_0xd686('0x19')][_0xd686('0x22')]({'where':_0x397f9b['options']?_0x397f9b[_0xd686('0x1c')]['where']||null:null})[_0xd686('0xf')](function(_0x351b6c){if(_0x351b6c){return _0x351b6c[_0xd686('0x23')](_0x397f9b[_0xd686('0x1b')][_0xd686('0x24')],_[_0xd686('0x25')](_0x397f9b[_0xd686('0x1b')],[_0xd686('0x24'),'id'])||{});}})[_0xd686('0x26')](function(_0x165e4c){logger[_0xd686('0x10')]('AddTags',_0x397f9b);logger[_0xd686('0x13')](_0xd686('0x27'),_0x397f9b,JSON[_0xd686('0x15')](_0x165e4c));_0x3251d7(_0x165e4c);})['catch'](function(_0x48588c){logger[_0xd686('0x16')]('AddTags',_0x48588c[_0xd686('0x18')],_0x397f9b);_0x1f918a(_this[_0xd686('0x16')](0x1f4,_0x48588c['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index f1cd468..f8c0c24 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 _0xb981=['openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0xc5f519,_0x1b8585){var _0x3a33e3=function(_0x58b1a8){while(--_0x58b1a8){_0xc5f519['push'](_0xc5f519['shift']());}};_0x3a33e3(++_0x1b8585);}(_0xb981,0xfd));var _0x1b98=function(_0x2f53dc,_0x29e13a){_0x2f53dc=_0x2f53dc-0x0;var _0x5c66a8=_0xb981[_0x2f53dc];return _0x5c66a8;};'use strict';var OpenchannelInteractionEvents=require(_0x1b98('0x0'));var events=[_0x1b98('0x1'),_0x1b98('0x2'),_0x1b98('0x3')];function createListener(_0x30df29,_0x259196){return function(_0x2aec99){_0x259196[_0x1b98('0x4')](_0x30df29,_0x2aec99);};}function removeListener(_0xec7db4,_0x4f8779){return function(){OpenchannelInteractionEvents[_0x1b98('0x5')](_0xec7db4,_0x4f8779);};}exports[_0x1b98('0x6')]=function(_0x13c209){for(var _0xd4daf6=0x0,_0x30ff08=events[_0x1b98('0x7')];_0xd4daf6<_0x30ff08;_0xd4daf6++){var _0x1a7438=events[_0xd4daf6];var _0x22852e=createListener(_0x1b98('0x8')+_0x1a7438,_0x13c209);OpenchannelInteractionEvents['on'](_0x1a7438,_0x22852e);}}; \ No newline at end of file +var _0x3c31=['save','update','emit','length','./openchannelInteraction.events'];(function(_0x1e62b3,_0x3f4c47){var _0xabf3f7=function(_0x445284){while(--_0x445284){_0x1e62b3['push'](_0x1e62b3['shift']());}};_0xabf3f7(++_0x3f4c47);}(_0x3c31,0x1b2));var _0x13c3=function(_0x6b64d1,_0x4cbf6d){_0x6b64d1=_0x6b64d1-0x0;var _0x2a2d95=_0x3c31[_0x6b64d1];return _0x2a2d95;};'use strict';var OpenchannelInteractionEvents=require(_0x13c3('0x0'));var events=[_0x13c3('0x1'),'remove',_0x13c3('0x2')];function createListener(_0x1cbba6,_0x161c8d){return function(_0x4dfcac){_0x161c8d[_0x13c3('0x3')](_0x1cbba6,_0x4dfcac);};}function removeListener(_0x5193da,_0x51f726){return function(){OpenchannelInteractionEvents['removeListener'](_0x5193da,_0x51f726);};}exports['register']=function(_0x12655b){for(var _0x40a41b=0x0,_0x9267a5=events[_0x13c3('0x4')];_0x40a41b<_0x9267a5;_0x40a41b++){var _0x209d26=events[_0x40a41b];var _0x173497=createListener('openchannelInteraction:'+_0x209d26,_0x12655b);OpenchannelInteractionEvents['on'](_0x209d26,_0x173497);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 6845ba9..c38353e 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x3fca53,_0x310260){_0x3fca53=_0x3fca53-0x0;var _0x452f62=_0x70e0[_0x3fca53];return _0x452f62;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x1a5296,_0x57bc78){var _0x5e68a0=function(_0x238846){while(--_0x238846){_0x1a5296['push'](_0x1a5296['shift']());}};_0x5e68a0(++_0x57bc78);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index f80662b..c756e88 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 _0x9000=['sequelize','exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x121be5,_0x424611){var _0x2804b6=function(_0x8946be){while(--_0x8946be){_0x121be5['push'](_0x121be5['shift']());}};_0x2804b6(++_0x424611);}(_0x9000,0x19e));var _0x0900=function(_0x11afd1,_0x4d62ff){_0x11afd1=_0x11afd1-0x0;var _0x5e8b34=_0x9000[_0x11afd1];return _0x5e8b34;};'use strict';var Sequelize=require(_0x0900('0x0'));module[_0x0900('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0900('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0900('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0900('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0900('0x4')]('in',_0x0900('0x5')),'defaultValue':_0x0900('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0900('0x6')]},'providerName':{'type':Sequelize[_0x0900('0x7')]},'providerResponse':{'type':Sequelize[_0x0900('0x8')]}}; \ No newline at end of file +var _0xbb59=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb59,0xec));var _0x9bb5=function(_0x3bbf79,_0x4093f0){_0x3bbf79=_0x3bbf79-0x0;var _0x597080=_0xbb59[_0x3bbf79];return _0x597080;};'use strict';var Sequelize=require(_0x9bb5('0x0'));module[_0x9bb5('0x1')]={'body':{'type':Sequelize[_0x9bb5('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x9bb5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9bb5('0x4')]('in',_0x9bb5('0x5')),'defaultValue':_0x9bb5('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9bb5('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9bb5('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 6b20116..8a14e0a 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 _0xec9d=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./openchannelMessage.socket','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','end','json','limit','undefined','offset','count','status','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','body','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','get','role','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','fullname','email','internal','agent','manual','interface','SIP/%s','channel','EventManager','acceptmessage','reject','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','User','motionChannel','event','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x548e64,_0x29e562){var _0x47d34e=function(_0x397256){while(--_0x397256){_0x548e64['push'](_0x548e64['shift']());}};_0x47d34e(++_0x29e562);}(_0xec9d,0x6f));var _0xdec9=function(_0x1f5206,_0xa85c7a){_0x1f5206=_0x1f5206-0x0;var _0x52c522=_0xec9d[_0x1f5206];return _0x52c522;};'use strict';var emlformat=require(_0xdec9('0x0'));var rimraf=require(_0xdec9('0x1'));var zipdir=require(_0xdec9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdec9('0x3'));var moment=require(_0xdec9('0x4'));var BPromise=require(_0xdec9('0x5'));var Mustache=require(_0xdec9('0x6'));var util=require(_0xdec9('0x7'));var path=require(_0xdec9('0x8'));var sox=require(_0xdec9('0x9'));var csv=require(_0xdec9('0xa'));var ejs=require(_0xdec9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdec9('0xc'));var squel=require(_0xdec9('0xd'));var crypto=require(_0xdec9('0xe'));var jsforce=require(_0xdec9('0xf'));var deskjs=require(_0xdec9('0x10'));var toCsv=require(_0xdec9('0xa'));var querystring=require(_0xdec9('0x11'));var Papa=require('papaparse');var Redis=require(_0xdec9('0x12'));var authService=require(_0xdec9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdec9('0x14'));var hardwareService=require(_0xdec9('0x15'));var logger=require(_0xdec9('0x16'))(_0xdec9('0x17'));var utils=require(_0xdec9('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdec9('0x19'))['db'];config['redis']=_[_0xdec9('0x1a')](config[_0xdec9('0x1b')],{'host':_0xdec9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdec9('0x1d'))['register'](socket);var jayson=require(_0xdec9('0x1e'));var client=jayson[_0xdec9('0x1f')][_0xdec9('0x20')]({'port':0x232c});var client9002=jayson[_0xdec9('0x1f')][_0xdec9('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5ceff4,_0x71a1d4,_0x55a670,_0xef0639){return new BPromise(function(_0x61bc89,_0x109084){var _0x2d8bee=_0xef0639||client;return _0x2d8bee[_0xdec9('0x21')](_0x5ceff4,_0x55a670)[_0xdec9('0x22')](function(_0x26c400){logger[_0xdec9('0x23')](_0xdec9('0x24'),_0x71a1d4,_0xdec9('0x25'));logger[_0xdec9('0x26')](_0xdec9('0x27'),_0x71a1d4,'request\x20sent',JSON[_0xdec9('0x28')](_0x26c400));if(_0x26c400[_0xdec9('0x29')]){if(_0x26c400[_0xdec9('0x29')]['code']===0x1f4){logger[_0xdec9('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x71a1d4,_0x26c400[_0xdec9('0x29')][_0xdec9('0x2a')]);return _0x109084(_0x26c400[_0xdec9('0x29')][_0xdec9('0x2a')]);}logger[_0xdec9('0x29')](_0xdec9('0x24'),_0x71a1d4,_0x26c400[_0xdec9('0x29')]['message']);return _0x61bc89(_0x26c400[_0xdec9('0x29')][_0xdec9('0x2a')]);}else{logger['info'](_0xdec9('0x24'),_0x71a1d4,_0xdec9('0x25'));_0x61bc89(_0x26c400[_0xdec9('0x2b')][_0xdec9('0x2a')]);}})['catch'](function(_0x8c9b2){logger[_0xdec9('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x71a1d4,_0x8c9b2);_0x109084(_0x8c9b2);});});}function respondWithStatusCode(_0x30571b,_0x50554f){_0x50554f=_0x50554f||0xcc;return function(_0x2993bc){if(_0x2993bc){return _0x30571b['sendStatus'](_0x50554f);}return _0x30571b['status'](_0x50554f)[_0xdec9('0x2c')]();};}function respondWithResult(_0x3deadd,_0x223840){_0x223840=_0x223840||0xc8;return function(_0x2fc1ab){if(_0x2fc1ab){return _0x3deadd['status'](_0x223840)[_0xdec9('0x2d')](_0x2fc1ab);}};}function respondWithFilteredResult(_0x5db22c,_0x29e254){return function(_0x37ee69){if(_0x37ee69){var _0x57e72f=typeof _0x29e254['offset']==='undefined'&&typeof _0x29e254[_0xdec9('0x2e')]===_0xdec9('0x2f');var _0x269013=_0x37ee69['count'];var _0x4be6f6=_0x57e72f?0x0:_0x29e254[_0xdec9('0x30')];var _0x29d8f3=_0x57e72f?_0x37ee69[_0xdec9('0x31')]:_0x29e254[_0xdec9('0x30')]+_0x29e254['limit'];var _0xa9d363;if(_0x29d8f3>=_0x269013){_0x29d8f3=_0x269013;_0xa9d363=0xc8;}else{_0xa9d363=0xce;}_0x5db22c[_0xdec9('0x32')](_0xa9d363);return _0x5db22c['set']('Content-Range',_0x4be6f6+'-'+_0x29d8f3+'/'+_0x269013)['json'](_0x37ee69);}return null;};}function patchUpdates(_0x440bf5){return function(_0x30c471){try{jsonpatch['apply'](_0x30c471,_0x440bf5,!![]);}catch(_0x1b9607){return BPromise['reject'](_0x1b9607);}return _0x30c471[_0xdec9('0x33')]();};}function saveUpdates(_0x28fa4e,_0x37b4b6){return function(_0x1e25f5){if(_0x1e25f5){return _0x1e25f5[_0xdec9('0x34')](_0x28fa4e)[_0xdec9('0x22')](function(_0x3777a4){return _0x3777a4;});}return null;};}function removeEntity(_0x2b294a,_0x3a316d){return function(_0x117484){if(_0x117484){return _0x117484[_0xdec9('0x35')]()[_0xdec9('0x22')](function(){_0x2b294a[_0xdec9('0x32')](0xcc)[_0xdec9('0x2c')]();});}};}function handleEntityNotFound(_0x1e4c12,_0x2cb29b){return function(_0x5d3d4a){if(!_0x5d3d4a){_0x1e4c12['sendStatus'](0x194);}return _0x5d3d4a;};}function handleError(_0x3cca55,_0x599855){_0x599855=_0x599855||0x1f4;return function(_0x222485){logger[_0xdec9('0x29')](_0x222485[_0xdec9('0x36')]);if(_0x222485[_0xdec9('0x37')]){delete _0x222485[_0xdec9('0x37')];}_0x3cca55[_0xdec9('0x32')](_0x599855)[_0xdec9('0x38')](_0x222485);};}exports[_0xdec9('0x39')]=function(_0x25a007,_0x579018){var _0x10777e={},_0x3d26cd={},_0x291131={'count':0x0,'rows':[]};var _0x598a99=_[_0xdec9('0x3a')](db[_0xdec9('0x3b')]['rawAttributes'],function(_0x593a8e){return{'name':_0x593a8e[_0xdec9('0x3c')],'type':_0x593a8e['type'][_0xdec9('0x3d')]};});_0x3d26cd[_0xdec9('0x3e')]=_['map'](_0x598a99,_0xdec9('0x37'));_0x3d26cd['query']=_['keys'](_0x25a007[_0xdec9('0x3f')]);_0x3d26cd[_0xdec9('0x40')]=_[_0xdec9('0x41')](_0x3d26cd['model'],_0x3d26cd[_0xdec9('0x3f')]);_0x10777e[_0xdec9('0x42')]=_[_0xdec9('0x41')](_0x3d26cd['model'],qs[_0xdec9('0x43')](_0x25a007['query'][_0xdec9('0x43')]));_0x10777e['attributes']=_0x10777e['attributes']['length']?_0x10777e[_0xdec9('0x42')]:_0x3d26cd[_0xdec9('0x3e')];if(!_0x25a007[_0xdec9('0x3f')][_0xdec9('0x44')](_0xdec9('0x45'))){_0x10777e[_0xdec9('0x2e')]=qs['limit'](_0x25a007['query'][_0xdec9('0x2e')]);_0x10777e[_0xdec9('0x30')]=qs['offset'](_0x25a007[_0xdec9('0x3f')][_0xdec9('0x30')]);}_0x10777e[_0xdec9('0x46')]=qs[_0xdec9('0x47')](_0x25a007[_0xdec9('0x3f')][_0xdec9('0x47')]);_0x10777e[_0xdec9('0x48')]=qs['filters'](_['pick'](_0x25a007['query'],_0x3d26cd[_0xdec9('0x40')]),_0x598a99);if(_0x25a007['query']['filter']){_0x10777e[_0xdec9('0x48')]=_[_0xdec9('0x49')](_0x10777e[_0xdec9('0x48')],{'$or':_[_0xdec9('0x3a')](_0x598a99,function(_0x10b180){if(_0x10b180[_0xdec9('0x4a')]!==_0xdec9('0x4b')){var _0x3f18d6={};_0x3f18d6[_0x10b180[_0xdec9('0x37')]]={'$like':'%'+_0x25a007['query']['filter']+'%'};return _0x3f18d6;}})});}_0x10777e=_[_0xdec9('0x49')]({},_0x10777e,_0x25a007[_0xdec9('0x4c')]);var _0x292db7={'where':_0x10777e[_0xdec9('0x48')]};return db[_0xdec9('0x3b')][_0xdec9('0x31')](_0x292db7)['then'](function(_0x27442b){_0x291131[_0xdec9('0x31')]=_0x27442b;if(_0x25a007[_0xdec9('0x3f')][_0xdec9('0x4d')]){_0x10777e[_0xdec9('0x4e')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xdec9('0x4f')](_0x10777e);})[_0xdec9('0x22')](function(_0xd6b5b2){_0x291131[_0xdec9('0x50')]=_0xd6b5b2;return _0x291131;})[_0xdec9('0x22')](respondWithFilteredResult(_0x579018,_0x10777e))[_0xdec9('0x51')](handleError(_0x579018,null));};exports[_0xdec9('0x52')]=function(_0x500fda,_0x4ea1ae){var _0x55a3a2={'raw':!![],'where':{'id':_0x500fda[_0xdec9('0x53')]['id']}},_0x4d00b7={};_0x4d00b7['model']=_[_0xdec9('0x54')](db[_0xdec9('0x3b')][_0xdec9('0x55')]);_0x4d00b7[_0xdec9('0x3f')]=_[_0xdec9('0x54')](_0x500fda[_0xdec9('0x3f')]);_0x4d00b7[_0xdec9('0x40')]=_[_0xdec9('0x41')](_0x4d00b7[_0xdec9('0x3e')],_0x4d00b7[_0xdec9('0x3f')]);_0x55a3a2[_0xdec9('0x42')]=_[_0xdec9('0x41')](_0x4d00b7[_0xdec9('0x3e')],qs[_0xdec9('0x43')](_0x500fda[_0xdec9('0x3f')][_0xdec9('0x43')]));_0x55a3a2['attributes']=_0x55a3a2['attributes'][_0xdec9('0x56')]?_0x55a3a2['attributes']:_0x4d00b7[_0xdec9('0x3e')];if(_0x500fda[_0xdec9('0x3f')][_0xdec9('0x4d')]){_0x55a3a2[_0xdec9('0x4e')]=[{'all':!![]}];}_0x55a3a2=_[_0xdec9('0x49')]({},_0x55a3a2,_0x500fda['options']);return db[_0xdec9('0x3b')][_0xdec9('0x57')](_0x55a3a2)['then'](handleEntityNotFound(_0x4ea1ae,null))['then'](respondWithResult(_0x4ea1ae,null))[_0xdec9('0x51')](handleError(_0x4ea1ae,null));};exports[_0xdec9('0x58')]=function(_0x254c9a,_0x2e6e79){return db['OpenchannelMessage'][_0xdec9('0x58')](_0x254c9a[_0xdec9('0x59')],{})[_0xdec9('0x22')](respondWithResult(_0x2e6e79,0xc9))['catch'](handleError(_0x2e6e79,null));};exports['update']=function(_0x402d08,_0x5d71e8){if(_0x402d08[_0xdec9('0x59')]['id']){delete _0x402d08['body']['id'];}return db[_0xdec9('0x3b')][_0xdec9('0x57')]({'where':{'id':_0x402d08[_0xdec9('0x53')]['id']}})[_0xdec9('0x22')](handleEntityNotFound(_0x5d71e8,null))[_0xdec9('0x22')](saveUpdates(_0x402d08['body'],null))[_0xdec9('0x22')](respondWithResult(_0x5d71e8,null))[_0xdec9('0x51')](handleError(_0x5d71e8,null));};exports[_0xdec9('0x35')]=function(_0x36c52c,_0x123284){return db[_0xdec9('0x3b')][_0xdec9('0x57')]({'where':{'id':_0x36c52c[_0xdec9('0x53')]['id']}})[_0xdec9('0x22')](handleEntityNotFound(_0x123284,null))[_0xdec9('0x22')](removeEntity(_0x123284,null))[_0xdec9('0x51')](handleError(_0x123284,null));};exports['describe']=function(_0x3144c6,_0x9bd093){return db['OpenchannelMessage']['describe']()[_0xdec9('0x22')](respondWithResult(_0x9bd093,null))[_0xdec9('0x51')](handleError(_0x9bd093,null));};var interaction_log=require(_0xdec9('0x16'))(_0xdec9('0x5a'));exports[_0xdec9('0x5b')]=function(_0x4580a3,_0x141620,_0x505c3f){var _0x4b922a={'agent':{},'channel':_0xdec9('0x5c')};if(_0x4580a3[_0xdec9('0x59')]['id']){delete _0x4580a3[_0xdec9('0x59')]['id'];}_0x4580a3[_0xdec9('0x59')][_0xdec9('0x5d')]=!![];_0x4580a3[_0xdec9('0x59')][_0xdec9('0x5e')]=moment()[_0xdec9('0x5f')](_0xdec9('0x60'));_0x4580a3[_0xdec9('0x59')]['UserId']=_0x4580a3[_0xdec9('0x59')][_0xdec9('0x61')]||_0x4580a3[_0xdec9('0x62')]['id'];_0x4b922a['agent']['id']=_0x4580a3['body'][_0xdec9('0x61')];return db[_0xdec9('0x3b')][_0xdec9('0x57')]({'where':{'id':_0x4580a3['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x141620,null))['then'](saveUpdates(_0x4580a3[_0xdec9('0x59')],null))[_0xdec9('0x22')](function(_0x41b9e6){if(_0x41b9e6){_0x4b922a[_0xdec9('0x2a')]=_0x41b9e6['get']({'plain':!![]});return db[_0xdec9('0x63')]['find']({'where':{'id':_0x41b9e6[_0xdec9('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x141620,null))['then'](function(_0x1744d0){if(_0x1744d0){return _0x1744d0[_0xdec9('0x34')]({'UserId':_0x4580a3[_0xdec9('0x59')][_0xdec9('0x61')],'read1stAt':_[_0xdec9('0x65')](_0x1744d0['read1stAt'])?moment()['format'](_0xdec9('0x60')):undefined});}return null;})[_0xdec9('0x22')](function(_0x4f5558){if(_0x4f5558){_0x4b922a[_0xdec9('0x66')]=_0x4f5558[_0xdec9('0x67')]({'plain':!![]});interaction_log[_0xdec9('0x23')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4580a3[_0xdec9('0x62')]['id'],_0x4580a3['user'][_0xdec9('0x37')],_0x4580a3[_0xdec9('0x62')][_0xdec9('0x68')],_0x4b922a[_0xdec9('0x66')]['id'],_0x4580a3[_0xdec9('0x59')]?JSON[_0xdec9('0x28')](_0x4580a3[_0xdec9('0x59')]):'null');return respondWithRpcPromise(_0xdec9('0x69'),_0xdec9('0x6a'),_0x4b922a);}return null;})[_0xdec9('0x22')](function(_0x56dcba){var _0x21564b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x56dcba['message'][_0xdec9('0x6b')];return db['sequelize'][_0xdec9('0x3f')](_0x21564b,{'type':db[_0xdec9('0x6c')][_0xdec9('0x6d')][_0xdec9('0x6e')],'raw':!![]})['then'](function(_0x5e86c1){return _0x5e86c1;});})['then'](function(_0x3551b4){if(_0x3551b4){_0x4b922a[_0xdec9('0x2a')]['contact']=_0x3551b4[0x0];if(!_0x4580a3[_0xdec9('0x59')]['UserId'])return;return db['User']['find']({'where':{'id':_0x4580a3[_0xdec9('0x59')]['UserId'],'role':'agent'},'attributes':['id',_0xdec9('0x37'),_0xdec9('0x6f'),_0xdec9('0x70'),_0xdec9('0x71')],'raw':!![]});}return null;})[_0xdec9('0x22')](function(_0x594c6d){if(!_0x594c6d)return null;_0x4b922a[_0xdec9('0x2a')][_0xdec9('0x72')]=_0x594c6d;return _0x4b922a;})[_0xdec9('0x22')](function(_0xe281d7){if(_0xe281d7){if(_0x4580a3[_0xdec9('0x59')][_0xdec9('0x73')]){_0x4b922a['message'][_0xdec9('0x74')]=util[_0xdec9('0x5f')](_0xdec9('0x75'),_0x4580a3['user'][_0xdec9('0x37')]);_0x4b922a['message']['channel']=_0x4b922a[_0xdec9('0x76')];_0x4b922a[_0xdec9('0x2a')]['motionChannel']=_0x4b922a[_0xdec9('0x76')];_0x4b922a[_0xdec9('0x2a')]['event']=_0xdec9('0x5b');return respondWithRpcPromise(_0xdec9('0x77'),_0xdec9('0x77'),{'event':_0xdec9('0x78'),'message':_0x4b922a['message']},client9002)[_0xdec9('0x22')](function(){return _0x4b922a;});}return _0x4b922a;}return null;})[_0xdec9('0x22')](respondWithResult(_0x141620,null))['catch'](handleError(_0x141620,null));};var interaction_log=require(_0xdec9('0x16'))(_0xdec9('0x5a'));exports[_0xdec9('0x79')]=function(_0x960e10,_0x384f90,_0x5e7bce){var _0x47be0b={'agent':{},'channel':_0xdec9('0x5c')};if(_0x960e10[_0xdec9('0x59')]['id']){delete _0x960e10[_0xdec9('0x59')]['id'];}_0x960e10[_0xdec9('0x59')][_0xdec9('0x61')]=_0x960e10[_0xdec9('0x59')][_0xdec9('0x61')]||_0x960e10['user']['id'];_0x47be0b['agent']['id']=_0x960e10[_0xdec9('0x59')][_0xdec9('0x61')];return db[_0xdec9('0x3b')][_0xdec9('0x57')]({'where':{'id':_0x960e10[_0xdec9('0x53')]['id'],'UserId':null}})[_0xdec9('0x22')](handleEntityNotFound(_0x384f90,null))[_0xdec9('0x22')](function(_0x3e9cd6){if(_0x3e9cd6){_0x47be0b[_0xdec9('0x2a')]=_0x3e9cd6['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xdec9('0x57')]({'where':{'id':_0x3e9cd6['OpenchannelInteractionId']}});}return null;})[_0xdec9('0x22')](handleEntityNotFound(_0x384f90,null))[_0xdec9('0x22')](function(_0x3f6ea7){if(_0x3f6ea7){_0x47be0b[_0xdec9('0x66')]=_0x3f6ea7[_0xdec9('0x67')]({'plain':!![]});interaction_log[_0xdec9('0x23')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x960e10[_0xdec9('0x62')]['id'],_0x960e10[_0xdec9('0x62')][_0xdec9('0x37')],_0x960e10[_0xdec9('0x62')][_0xdec9('0x68')],_0x47be0b[_0xdec9('0x66')]['id'],_0x960e10[_0xdec9('0x59')]?JSON[_0xdec9('0x28')](_0x960e10[_0xdec9('0x59')]):_0xdec9('0x7a'));return respondWithRpcPromise(_0xdec9('0x7b'),_0xdec9('0x7c'),_0x47be0b);}return null;})[_0xdec9('0x22')](function(_0x300e9d){var _0xa7d491=_0xdec9('0x7d')+_0x300e9d['message'][_0xdec9('0x6b')];return db[_0xdec9('0x7e')][_0xdec9('0x3f')](_0xa7d491,{'type':db[_0xdec9('0x6c')][_0xdec9('0x6d')][_0xdec9('0x6e')],'raw':!![]})[_0xdec9('0x22')](function(_0x7bdebd){return _0x7bdebd;});})[_0xdec9('0x22')](function(_0x311638){if(_0x311638){_0x47be0b[_0xdec9('0x2a')][_0xdec9('0x7f')]=_0x311638[0x0];if(!_0x960e10[_0xdec9('0x59')][_0xdec9('0x61')])return;return db[_0xdec9('0x80')][_0xdec9('0x57')]({'where':{'id':_0x960e10[_0xdec9('0x59')][_0xdec9('0x61')],'role':_0xdec9('0x72')},'attributes':['id',_0xdec9('0x37'),_0xdec9('0x6f'),_0xdec9('0x70'),_0xdec9('0x71')],'raw':!![]});}return null;})[_0xdec9('0x22')](function(_0x573720){if(!_0x573720)return null;_0x47be0b[_0xdec9('0x2a')][_0xdec9('0x72')]=_0x573720;return _0x47be0b;})[_0xdec9('0x22')](function(_0x19fc29){if(_0x19fc29){_0x19fc29[_0xdec9('0x2a')][_0xdec9('0x74')]=util['format'](_0xdec9('0x75'),_0x960e10[_0xdec9('0x62')][_0xdec9('0x37')]);_0x19fc29['message'][_0xdec9('0x76')]=_0x47be0b['channel'];_0x19fc29[_0xdec9('0x2a')][_0xdec9('0x81')]=_0x47be0b['channel'];_0x19fc29[_0xdec9('0x2a')][_0xdec9('0x82')]=_0xdec9('0x79');respondWithRpcPromise(_0xdec9('0x77'),'EventManager',{'event':_0xdec9('0x83'),'message':_0x19fc29[_0xdec9('0x2a')]},client9002);return _0x47be0b;}return null;})[_0xdec9('0x22')](respondWithResult(_0x384f90,null))[_0xdec9('0x51')](handleError(_0x384f90,null));}; \ No newline at end of file +var _0xd307=['rejectMessage','User','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','then','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','../../config/logger','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xd307,0x110));var _0x7d30=function(_0x178bcc,_0x15aa2b){_0x178bcc=_0x178bcc-0x0;var _0xddf332=_0xd307[_0x178bcc];return _0xddf332;};'use strict';var emlformat=require(_0x7d30('0x0'));var rimraf=require(_0x7d30('0x1'));var zipdir=require(_0x7d30('0x2'));var jsonpatch=require(_0x7d30('0x3'));var rp=require(_0x7d30('0x4'));var moment=require(_0x7d30('0x5'));var BPromise=require(_0x7d30('0x6'));var Mustache=require(_0x7d30('0x7'));var util=require('util');var path=require(_0x7d30('0x8'));var sox=require(_0x7d30('0x9'));var csv=require('to-csv');var ejs=require(_0x7d30('0xa'));var fs=require('fs');var fs_extra=require(_0x7d30('0xb'));var _=require(_0x7d30('0xc'));var squel=require(_0x7d30('0xd'));var crypto=require(_0x7d30('0xe'));var jsforce=require(_0x7d30('0xf'));var deskjs=require(_0x7d30('0x10'));var toCsv=require(_0x7d30('0x11'));var querystring=require('querystring');var Papa=require(_0x7d30('0x12'));var Redis=require(_0x7d30('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7d30('0x14'));var as=require(_0x7d30('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d30('0x16'));var utils=require(_0x7d30('0x17'));var config=require(_0x7d30('0x18'));var licenseUtil=require(_0x7d30('0x19'));var db=require(_0x7d30('0x1a'))['db'];config['redis']=_[_0x7d30('0x1b')](config[_0x7d30('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x7d30('0x1d'))(new Redis(config[_0x7d30('0x1c')]));require('./openchannelMessage.socket')[_0x7d30('0x1e')](socket);var jayson=require(_0x7d30('0x1f'));var client=jayson[_0x7d30('0x20')][_0x7d30('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x7d30('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x29a2e9,_0x3ad4e7,_0x5ced4f,_0x52157d){return new BPromise(function(_0x5027b3,_0x147860){var _0x183e1c=_0x52157d||client;return _0x183e1c['request'](_0x29a2e9,_0x5ced4f)[_0x7d30('0x22')](function(_0x549c69){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x3ad4e7,_0x7d30('0x23'));logger[_0x7d30('0x24')](_0x7d30('0x25'),_0x3ad4e7,'request\x20sent',JSON[_0x7d30('0x26')](_0x549c69));if(_0x549c69[_0x7d30('0x27')]){if(_0x549c69[_0x7d30('0x27')][_0x7d30('0x28')]===0x1f4){logger[_0x7d30('0x27')](_0x7d30('0x29'),_0x3ad4e7,_0x549c69[_0x7d30('0x27')][_0x7d30('0x2a')]);return _0x147860(_0x549c69['error'][_0x7d30('0x2a')]);}logger[_0x7d30('0x27')](_0x7d30('0x29'),_0x3ad4e7,_0x549c69[_0x7d30('0x27')][_0x7d30('0x2a')]);return _0x5027b3(_0x549c69[_0x7d30('0x27')][_0x7d30('0x2a')]);}else{logger[_0x7d30('0x2b')](_0x7d30('0x29'),_0x3ad4e7,_0x7d30('0x23'));_0x5027b3(_0x549c69[_0x7d30('0x2c')]['message']);}})[_0x7d30('0x2d')](function(_0x592aa0){logger['error'](_0x7d30('0x29'),_0x3ad4e7,_0x592aa0);_0x147860(_0x592aa0);});});}function respondWithStatusCode(_0x191bfa,_0x422a44){_0x422a44=_0x422a44||0xcc;return function(_0x271c0c){if(_0x271c0c){return _0x191bfa[_0x7d30('0x2e')](_0x422a44);}return _0x191bfa[_0x7d30('0x2f')](_0x422a44)['end']();};}function respondWithResult(_0x1ce727,_0x201536){_0x201536=_0x201536||0xc8;return function(_0x2e2f3d){if(_0x2e2f3d){return _0x1ce727[_0x7d30('0x2f')](_0x201536)['json'](_0x2e2f3d);}};}function respondWithFilteredResult(_0x5a7b9f,_0x33ccb1){return function(_0x13e6c6){if(_0x13e6c6){var _0x866f0c=typeof _0x33ccb1[_0x7d30('0x30')]===_0x7d30('0x31')&&typeof _0x33ccb1[_0x7d30('0x32')]===_0x7d30('0x31');var _0x489084=_0x13e6c6[_0x7d30('0x33')];var _0x3af4dd=_0x866f0c?0x0:_0x33ccb1['offset'];var _0x9d5473=_0x866f0c?_0x13e6c6[_0x7d30('0x33')]:_0x33ccb1[_0x7d30('0x30')]+_0x33ccb1['limit'];var _0x5bca01;if(_0x9d5473>=_0x489084){_0x9d5473=_0x489084;_0x5bca01=0xc8;}else{_0x5bca01=0xce;}_0x5a7b9f['status'](_0x5bca01);return _0x5a7b9f[_0x7d30('0x34')](_0x7d30('0x35'),_0x3af4dd+'-'+_0x9d5473+'/'+_0x489084)[_0x7d30('0x36')](_0x13e6c6);}return null;};}function patchUpdates(_0x7e362a){return function(_0x51aeba){try{jsonpatch['apply'](_0x51aeba,_0x7e362a,!![]);}catch(_0x44a2fc){return BPromise[_0x7d30('0x37')](_0x44a2fc);}return _0x51aeba[_0x7d30('0x38')]();};}function saveUpdates(_0x19cbb6,_0x4d9526){return function(_0x5a1613){if(_0x5a1613){return _0x5a1613[_0x7d30('0x39')](_0x19cbb6)[_0x7d30('0x22')](function(_0x48dba8){return _0x48dba8;});}return null;};}function removeEntity(_0x39ebbc,_0x128cae){return function(_0x303b9d){if(_0x303b9d){return _0x303b9d[_0x7d30('0x3a')]()['then'](function(){_0x39ebbc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44eba7,_0x48703d){return function(_0x1c4610){if(!_0x1c4610){_0x44eba7['sendStatus'](0x194);}return _0x1c4610;};}function handleError(_0x533490,_0x11d4ea){_0x11d4ea=_0x11d4ea||0x1f4;return function(_0x35cf70){logger[_0x7d30('0x27')](_0x35cf70[_0x7d30('0x3b')]);if(_0x35cf70[_0x7d30('0x3c')]){delete _0x35cf70[_0x7d30('0x3c')];}_0x533490['status'](_0x11d4ea)[_0x7d30('0x3d')](_0x35cf70);};}exports[_0x7d30('0x3e')]=function(_0x1b10a9,_0x40c674){var _0x40e7d4={},_0x344562={},_0x3f619d={'count':0x0,'rows':[]};var _0xebf8de=_['map'](db[_0x7d30('0x3f')][_0x7d30('0x40')],function(_0x57bcad){return{'name':_0x57bcad[_0x7d30('0x41')],'type':_0x57bcad[_0x7d30('0x42')][_0x7d30('0x43')]};});_0x344562[_0x7d30('0x44')]=_[_0x7d30('0x45')](_0xebf8de,_0x7d30('0x3c'));_0x344562[_0x7d30('0x46')]=_[_0x7d30('0x47')](_0x1b10a9[_0x7d30('0x46')]);_0x344562[_0x7d30('0x48')]=_[_0x7d30('0x49')](_0x344562[_0x7d30('0x44')],_0x344562[_0x7d30('0x46')]);_0x40e7d4[_0x7d30('0x4a')]=_['intersection'](_0x344562[_0x7d30('0x44')],qs[_0x7d30('0x4b')](_0x1b10a9[_0x7d30('0x46')]['fields']));_0x40e7d4[_0x7d30('0x4a')]=_0x40e7d4[_0x7d30('0x4a')][_0x7d30('0x4c')]?_0x40e7d4[_0x7d30('0x4a')]:_0x344562['model'];if(!_0x1b10a9[_0x7d30('0x46')][_0x7d30('0x4d')]('nolimit')){_0x40e7d4[_0x7d30('0x32')]=qs['limit'](_0x1b10a9[_0x7d30('0x46')][_0x7d30('0x32')]);_0x40e7d4[_0x7d30('0x30')]=qs['offset'](_0x1b10a9[_0x7d30('0x46')][_0x7d30('0x30')]);}_0x40e7d4['order']=qs[_0x7d30('0x4e')](_0x1b10a9[_0x7d30('0x46')][_0x7d30('0x4e')]);_0x40e7d4[_0x7d30('0x4f')]=qs[_0x7d30('0x48')](_[_0x7d30('0x50')](_0x1b10a9['query'],_0x344562['filters']),_0xebf8de);if(_0x1b10a9[_0x7d30('0x46')][_0x7d30('0x51')]){_0x40e7d4['where']=_[_0x7d30('0x52')](_0x40e7d4['where'],{'$or':_[_0x7d30('0x45')](_0xebf8de,function(_0x30a38a){if(_0x30a38a[_0x7d30('0x42')]!==_0x7d30('0x53')){var _0x1be4a5={};_0x1be4a5[_0x30a38a[_0x7d30('0x3c')]]={'$like':'%'+_0x1b10a9[_0x7d30('0x46')][_0x7d30('0x51')]+'%'};return _0x1be4a5;}})});}_0x40e7d4=_[_0x7d30('0x52')]({},_0x40e7d4,_0x1b10a9[_0x7d30('0x54')]);var _0x5f4034={'where':_0x40e7d4[_0x7d30('0x4f')]};return db[_0x7d30('0x3f')]['count'](_0x5f4034)['then'](function(_0x28bf00){_0x3f619d['count']=_0x28bf00;if(_0x1b10a9[_0x7d30('0x46')][_0x7d30('0x55')]){_0x40e7d4[_0x7d30('0x56')]=[{'all':!![]}];}return db[_0x7d30('0x3f')][_0x7d30('0x57')](_0x40e7d4);})[_0x7d30('0x22')](function(_0x256f25){_0x3f619d[_0x7d30('0x58')]=_0x256f25;return _0x3f619d;})['then'](respondWithFilteredResult(_0x40c674,_0x40e7d4))[_0x7d30('0x2d')](handleError(_0x40c674,null));};exports[_0x7d30('0x59')]=function(_0x5ba179,_0x18aba7){var _0x3bb329={'raw':!![],'where':{'id':_0x5ba179[_0x7d30('0x5a')]['id']}},_0x34338a={};_0x34338a['model']=_['keys'](db[_0x7d30('0x3f')][_0x7d30('0x40')]);_0x34338a[_0x7d30('0x46')]=_['keys'](_0x5ba179[_0x7d30('0x46')]);_0x34338a[_0x7d30('0x48')]=_['intersection'](_0x34338a['model'],_0x34338a[_0x7d30('0x46')]);_0x3bb329[_0x7d30('0x4a')]=_[_0x7d30('0x49')](_0x34338a['model'],qs[_0x7d30('0x4b')](_0x5ba179[_0x7d30('0x46')]['fields']));_0x3bb329[_0x7d30('0x4a')]=_0x3bb329[_0x7d30('0x4a')][_0x7d30('0x4c')]?_0x3bb329[_0x7d30('0x4a')]:_0x34338a[_0x7d30('0x44')];if(_0x5ba179[_0x7d30('0x46')]['includeAll']){_0x3bb329[_0x7d30('0x56')]=[{'all':!![]}];}_0x3bb329=_['merge']({},_0x3bb329,_0x5ba179['options']);return db[_0x7d30('0x3f')][_0x7d30('0x5b')](_0x3bb329)[_0x7d30('0x22')](handleEntityNotFound(_0x18aba7,null))['then'](respondWithResult(_0x18aba7,null))['catch'](handleError(_0x18aba7,null));};exports[_0x7d30('0x5c')]=function(_0x5156c5,_0x13ae96){return db[_0x7d30('0x3f')]['create'](_0x5156c5[_0x7d30('0x5d')],{})['then'](respondWithResult(_0x13ae96,0xc9))['catch'](handleError(_0x13ae96,null));};exports[_0x7d30('0x39')]=function(_0x300d16,_0x5ee7f9){if(_0x300d16['body']['id']){delete _0x300d16['body']['id'];}return db[_0x7d30('0x3f')][_0x7d30('0x5b')]({'where':{'id':_0x300d16['params']['id']}})[_0x7d30('0x22')](handleEntityNotFound(_0x5ee7f9,null))[_0x7d30('0x22')](saveUpdates(_0x300d16[_0x7d30('0x5d')],null))[_0x7d30('0x22')](respondWithResult(_0x5ee7f9,null))[_0x7d30('0x2d')](handleError(_0x5ee7f9,null));};exports[_0x7d30('0x3a')]=function(_0x512367,_0x376686){return db['OpenchannelMessage'][_0x7d30('0x5b')]({'where':{'id':_0x512367[_0x7d30('0x5a')]['id']}})[_0x7d30('0x22')](handleEntityNotFound(_0x376686,null))['then'](removeEntity(_0x376686,null))[_0x7d30('0x2d')](handleError(_0x376686,null));};exports['describe']=function(_0x2d6c09,_0x528221){return db[_0x7d30('0x3f')][_0x7d30('0x5e')]()['then'](respondWithResult(_0x528221,null))['catch'](handleError(_0x528221,null));};var interaction_log=require(_0x7d30('0x5f'))(_0x7d30('0x60'));exports[_0x7d30('0x61')]=function(_0x6b2209,_0xc4ae6e,_0x9e0693){var _0x276b02={'agent':{},'channel':'openchannel'};if(_0x6b2209['body']['id']){delete _0x6b2209[_0x7d30('0x5d')]['id'];}_0x6b2209[_0x7d30('0x5d')][_0x7d30('0x62')]=!![];_0x6b2209[_0x7d30('0x5d')][_0x7d30('0x63')]=moment()[_0x7d30('0x64')](_0x7d30('0x65'));_0x6b2209['body'][_0x7d30('0x66')]=_0x6b2209['body'][_0x7d30('0x66')]||_0x6b2209[_0x7d30('0x67')]['id'];_0x276b02[_0x7d30('0x68')]['id']=_0x6b2209[_0x7d30('0x5d')][_0x7d30('0x66')];return db[_0x7d30('0x3f')][_0x7d30('0x5b')]({'where':{'id':_0x6b2209[_0x7d30('0x5a')]['id'],'UserId':null}})[_0x7d30('0x22')](handleEntityNotFound(_0xc4ae6e,null))[_0x7d30('0x22')](saveUpdates(_0x6b2209[_0x7d30('0x5d')],null))['then'](function(_0x22224e){if(_0x22224e){_0x276b02[_0x7d30('0x2a')]=_0x22224e[_0x7d30('0x69')]({'plain':!![]});return db[_0x7d30('0x6a')][_0x7d30('0x5b')]({'where':{'id':_0x22224e[_0x7d30('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0xc4ae6e,null))[_0x7d30('0x22')](function(_0x2011fc){if(_0x2011fc){return _0x2011fc['update']({'UserId':_0x6b2209[_0x7d30('0x5d')]['UserId'],'read1stAt':_[_0x7d30('0x6c')](_0x2011fc[_0x7d30('0x6d')])?moment()['format'](_0x7d30('0x65')):undefined});}return null;})[_0x7d30('0x22')](function(_0x52c3a2){if(_0x52c3a2){_0x276b02[_0x7d30('0x6e')]=_0x52c3a2['get']({'plain':!![]});interaction_log['info'](_0x7d30('0x6f'),_0x6b2209[_0x7d30('0x67')]['id'],_0x6b2209[_0x7d30('0x67')][_0x7d30('0x3c')],_0x6b2209['user'][_0x7d30('0x70')],_0x276b02['interaction']['id'],_0x6b2209[_0x7d30('0x5d')]?JSON[_0x7d30('0x26')](_0x6b2209['body']):_0x7d30('0x71'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x276b02);}return null;})[_0x7d30('0x22')](function(_0x15cbb1){var _0x33a0db=_0x7d30('0x72')+_0x15cbb1['message']['ContactId'];return db[_0x7d30('0x73')][_0x7d30('0x46')](_0x33a0db,{'type':db[_0x7d30('0x74')][_0x7d30('0x75')][_0x7d30('0x76')],'raw':!![]})['then'](function(_0x1ecbfb){return _0x1ecbfb;});})[_0x7d30('0x22')](function(_0x46b76f){if(_0x46b76f){_0x276b02['message'][_0x7d30('0x77')]=_0x46b76f[0x0];if(!_0x6b2209[_0x7d30('0x5d')][_0x7d30('0x66')])return;return db['User'][_0x7d30('0x5b')]({'where':{'id':_0x6b2209[_0x7d30('0x5d')]['UserId'],'role':_0x7d30('0x68')},'attributes':['id',_0x7d30('0x3c'),_0x7d30('0x78'),_0x7d30('0x79'),_0x7d30('0x7a')],'raw':!![]});}return null;})[_0x7d30('0x22')](function(_0x5ed111){if(!_0x5ed111)return null;_0x276b02['message'][_0x7d30('0x68')]=_0x5ed111;return _0x276b02;})['then'](function(_0x145b1b){if(_0x145b1b){if(_0x6b2209[_0x7d30('0x5d')][_0x7d30('0x7b')]){_0x276b02[_0x7d30('0x2a')]['interface']=util[_0x7d30('0x64')](_0x7d30('0x7c'),_0x6b2209['user']['name']);_0x276b02['message'][_0x7d30('0x7d')]=_0x276b02['channel'];_0x276b02[_0x7d30('0x2a')][_0x7d30('0x7e')]=_0x276b02[_0x7d30('0x7d')];_0x276b02[_0x7d30('0x2a')]['event']=_0x7d30('0x61');return respondWithRpcPromise(_0x7d30('0x7f'),_0x7d30('0x7f'),{'event':_0x7d30('0x80'),'message':_0x276b02[_0x7d30('0x2a')]},client9002)['then'](function(){return _0x276b02;});}return _0x276b02;}return null;})[_0x7d30('0x22')](respondWithResult(_0xc4ae6e,null))[_0x7d30('0x2d')](handleError(_0xc4ae6e,null));};var interaction_log=require(_0x7d30('0x5f'))(_0x7d30('0x60'));exports[_0x7d30('0x37')]=function(_0x457e12,_0x597c8b,_0x221093){var _0x34851f={'agent':{},'channel':'openchannel'};if(_0x457e12['body']['id']){delete _0x457e12[_0x7d30('0x5d')]['id'];}_0x457e12['body'][_0x7d30('0x66')]=_0x457e12['body'][_0x7d30('0x66')]||_0x457e12[_0x7d30('0x67')]['id'];_0x34851f[_0x7d30('0x68')]['id']=_0x457e12[_0x7d30('0x5d')][_0x7d30('0x66')];return db[_0x7d30('0x3f')][_0x7d30('0x5b')]({'where':{'id':_0x457e12[_0x7d30('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x597c8b,null))['then'](function(_0x11141b){if(_0x11141b){_0x34851f['message']=_0x11141b[_0x7d30('0x69')]({'plain':!![]});return db[_0x7d30('0x6a')][_0x7d30('0x5b')]({'where':{'id':_0x11141b['OpenchannelInteractionId']}});}return null;})[_0x7d30('0x22')](handleEntityNotFound(_0x597c8b,null))[_0x7d30('0x22')](function(_0x11e8f3){if(_0x11e8f3){_0x34851f[_0x7d30('0x6e')]=_0x11e8f3['get']({'plain':!![]});interaction_log[_0x7d30('0x2b')](_0x7d30('0x81'),_0x457e12[_0x7d30('0x67')]['id'],_0x457e12[_0x7d30('0x67')][_0x7d30('0x3c')],_0x457e12[_0x7d30('0x67')]['role'],_0x34851f[_0x7d30('0x6e')]['id'],_0x457e12[_0x7d30('0x5d')]?JSON[_0x7d30('0x26')](_0x457e12[_0x7d30('0x5d')]):'null');return respondWithRpcPromise('RejectMessage',_0x7d30('0x82'),_0x34851f);}return null;})['then'](function(_0x3a483a){var _0x5810b0=_0x7d30('0x72')+_0x3a483a[_0x7d30('0x2a')]['ContactId'];return db[_0x7d30('0x73')]['query'](_0x5810b0,{'type':db['Sequelize'][_0x7d30('0x75')][_0x7d30('0x76')],'raw':!![]})[_0x7d30('0x22')](function(_0x6d8ba7){return _0x6d8ba7;});})[_0x7d30('0x22')](function(_0x52e7b3){if(_0x52e7b3){_0x34851f[_0x7d30('0x2a')][_0x7d30('0x77')]=_0x52e7b3[0x0];if(!_0x457e12['body'][_0x7d30('0x66')])return;return db[_0x7d30('0x83')]['find']({'where':{'id':_0x457e12[_0x7d30('0x5d')][_0x7d30('0x66')],'role':_0x7d30('0x68')},'attributes':['id',_0x7d30('0x3c'),_0x7d30('0x78'),_0x7d30('0x79'),'internal'],'raw':!![]});}return null;})[_0x7d30('0x22')](function(_0x480a1e){if(!_0x480a1e)return null;_0x34851f[_0x7d30('0x2a')]['agent']=_0x480a1e;return _0x34851f;})[_0x7d30('0x22')](function(_0x59db36){if(_0x59db36){_0x59db36[_0x7d30('0x2a')]['interface']=util['format'](_0x7d30('0x7c'),_0x457e12[_0x7d30('0x67')][_0x7d30('0x3c')]);_0x59db36[_0x7d30('0x2a')][_0x7d30('0x7d')]=_0x34851f[_0x7d30('0x7d')];_0x59db36[_0x7d30('0x2a')]['motionChannel']=_0x34851f['channel'];_0x59db36[_0x7d30('0x2a')][_0x7d30('0x84')]='reject';respondWithRpcPromise(_0x7d30('0x7f'),_0x7d30('0x7f'),{'event':_0x7d30('0x85'),'message':_0x59db36[_0x7d30('0x2a')]},client9002);return _0x34851f;}return null;})[_0x7d30('0x22')](respondWithResult(_0x597c8b,null))['catch'](handleError(_0x597c8b,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index f75793d..7f9b91b 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 _0x764b=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','remove','emit','hook'];(function(_0x243a0f,_0x1c9214){var _0x1cb8e2=function(_0x2f8144){while(--_0x2f8144){_0x243a0f['push'](_0x243a0f['shift']());}};_0x1cb8e2(++_0x1c9214);}(_0x764b,0x1d1));var _0xb764=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x764b[_0x1b2ff7];return _0x31656a;};'use strict';var EventEmitter=require(_0xb764('0x0'));var OpenchannelMessage=require(_0xb764('0x1'))['db'][_0xb764('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb764('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb764('0x4')};function emitEvent(_0x152267){return function(_0x445f1f,_0x75f4dd,_0x1bd169){OpenchannelMessageEvents['emit'](_0x152267+':'+_0x445f1f['id'],_0x445f1f);OpenchannelMessageEvents[_0xb764('0x5')](_0x152267,_0x445f1f);_0x1bd169(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xb764('0x6')](e,emitEvent(event));}}module[_0xb764('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x2362=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x2e8c3a,_0x56ab17){var _0x4d7311=function(_0x12e45d){while(--_0x12e45d){_0x2e8c3a['push'](_0x2e8c3a['shift']());}};_0x4d7311(++_0x56ab17);}(_0x2362,0x1e7));var _0x2236=function(_0x4a9a80,_0x4069cf){_0x4a9a80=_0x4a9a80-0x0;var _0x53affa=_0x2362[_0x4a9a80];return _0x53affa;};'use strict';var EventEmitter=require(_0x2236('0x0'));var OpenchannelMessage=require(_0x2236('0x1'))['db'][_0x2236('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2236('0x3')](0x0);var events={'afterCreate':_0x2236('0x4'),'afterUpdate':_0x2236('0x5'),'afterDestroy':_0x2236('0x6')};function emitEvent(_0x2413b2){return function(_0x2fde78,_0x4b150f,_0x2648e3){OpenchannelMessageEvents[_0x2236('0x7')](_0x2413b2+':'+_0x2fde78['id'],_0x2fde78);OpenchannelMessageEvents[_0x2236('0x7')](_0x2413b2,_0x2fde78);_0x2648e3(null);};}for(var e in events){if(events[_0x2236('0x8')](e)){var event=events[e];OpenchannelMessage[_0x2236('0x9')](e,emitEvent(event));}}module[_0x2236('0xa')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 92f5d44..6aad8c8 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 _0x0b0e=['get','toLowerCase','direction','secret','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','Interactions','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','length','omit','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','fti_openchannel_messages','body','FULLTEXT'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2b305c,_0x5ae303){_0x2b305c=_0x2b305c-0x0;var _0x5d8c85=_0x0b0e[_0x2b305c];return _0x5d8c85;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xe0b0('0xb'),'fields':[_0xe0b0('0xc')],'type':_0xe0b0('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ac27e,_0x4c24f9,_0x338e7c){var _0x1dd3b8=_0x30e20d['models'];var _0x1fef28=_0x2ac27e[_0xe0b0('0xe')]({'plain':!![]});if(_0x1fef28['direction'][_0xe0b0('0xf')]()==='in'||_0x1fef28[_0xe0b0('0x10')][_0xe0b0('0xf')]()==='out'&&!_0x1fef28[_0xe0b0('0x11')]&&!_[_0xe0b0('0x12')](_0x1fef28[_0xe0b0('0x13')])){_0x1dd3b8[_0xe0b0('0x14')][_0xe0b0('0x15')]({'where':{'id':_0x1fef28['OpenchannelInteractionId']}})[_0xe0b0('0x16')](function(_0x154de6){if(_0x154de6){_0x154de6[_0xe0b0('0x17')]({'lastMsgAt':_0x1fef28[_0xe0b0('0x18')],'lastMsgDirection':_0x1fef28[_0xe0b0('0x10')]['toLowerCase']()});}})[_0xe0b0('0x19')](function(_0x5adb01){console[_0xe0b0('0x1a')](_0x5adb01);});}if(_0x1fef28[_0xe0b0('0x10')]==='out'&&!_0x1fef28[_0xe0b0('0x11')]){var _0x4a4cc0;_0x1dd3b8[_0xe0b0('0x1b')][_0xe0b0('0x1c')]()['then'](function(_0x54a3eb){return _0x1dd3b8[_0xe0b0('0x1d')]['find']({'where':{'id':_0x1fef28['OpenchannelAccountId']},'include':[{'model':_0x1dd3b8['OpenchannelInteraction'],'as':_0xe0b0('0x1e'),'where':{'id':_0x1fef28['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x1dd3b8['CmContact'],'as':_0xe0b0('0x1f'),'attributes':_['keys'](_0x54a3eb)}]}]});})[_0xe0b0('0x16')](function(_0x5dba2f){_0x4a4cc0=_0x5dba2f[_0xe0b0('0xe')]({'plain':!![]});if(_0x4a4cc0&&_0x4a4cc0[_0xe0b0('0x20')]){logger[_0xe0b0('0x21')](_0xe0b0('0x22'),_0xe0b0('0x23'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x1fef28['id'],_0x4a4cc0[_0xe0b0('0x20')]));if(_0x4a4cc0['Interactions']&&_0x4a4cc0[_0xe0b0('0x1e')][_0xe0b0('0x24')]){_0x1fef28['Interaction']=_[_0xe0b0('0x25')](_0x4a4cc0['Interactions'][0x0],_0xe0b0('0x1f'));_0x1fef28['Contact']=_0x4a4cc0[_0xe0b0('0x1e')][0x0]['Contact'];}var _0x4c24f9={'method':'POST','uri':encodeURI(_0x4a4cc0[_0xe0b0('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4c24f9['method']){case _0xe0b0('0x26'):_0x4c24f9['qs']=_0x1fef28;break;case'POST':_0x4c24f9[_0xe0b0('0xc')]=_0x1fef28;break;}return rp(_0x4c24f9)[_0xe0b0('0x16')](function(_0x1f1ebd){logger[_0xe0b0('0x21')](_0xe0b0('0x22'),_0xe0b0('0x23'),util['format'](_0xe0b0('0x27'),_0x1fef28['id'],_0x4a4cc0[_0xe0b0('0x20')]));if(_0x1f1ebd['body'][_0xe0b0('0x28')]&&_0x1f1ebd[_0xe0b0('0xc')][_0xe0b0('0x28')]!=_0x1fef28[_0xe0b0('0x29')][_0xe0b0('0x28')]){return _0x1dd3b8[_0xe0b0('0x14')][_0xe0b0('0x17')]({'threadId':_0x1f1ebd['body'][_0xe0b0('0x28')]},{'logging':!![],'where':{'id':_0x1fef28[_0xe0b0('0x29')]['id']}});}else{return;}})['then'](function(){return _0x2ac27e['update']({'read':!![]});})[_0xe0b0('0x19')](function(_0x33e672){logger[_0xe0b0('0x1a')](_0xe0b0('0x22'),_0xe0b0('0x23'),util['inspect'](_0x33e672,{'showHidden':![],'depth':null}));_0x338e7c();});}else{_0x338e7c();}})[_0xe0b0('0x2a')](function(){_0x338e7c();});}else{_0x338e7c();}}},'charset':_0xe0b0('0x2b'),'collate':_0xe0b0('0x2c')});}; \ No newline at end of file +var _0x1a85=['openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','error','CmContact','then','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','POST','method','GET','info','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','OpenchannelMessage'];(function(_0x2eb7ec,_0x2dddb1){var _0x5016a9=function(_0x113c00){while(--_0x113c00){_0x2eb7ec['push'](_0x2eb7ec['shift']());}};_0x5016a9(++_0x2dddb1);}(_0x1a85,0x178));var _0x51a8=function(_0x385b70,_0x52974f){_0x385b70=_0x385b70-0x0;var _0x33e2ef=_0x1a85[_0x385b70];return _0x33e2ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x51a8('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56e1b4,_0x39e06a,_0x2f276b){var _0x1a476d=_0x4b76a8[_0x51a8('0xa')];var _0x418f06=_0x56e1b4[_0x51a8('0xb')]({'plain':!![]});if(_0x418f06[_0x51a8('0xc')][_0x51a8('0xd')]()==='in'||_0x418f06[_0x51a8('0xc')][_0x51a8('0xd')]()===_0x51a8('0xe')&&!_0x418f06[_0x51a8('0xf')]&&!_[_0x51a8('0x10')](_0x418f06[_0x51a8('0x11')])){_0x1a476d[_0x51a8('0x12')][_0x51a8('0x13')]({'where':{'id':_0x418f06[_0x51a8('0x14')]}})['then'](function(_0x461f5c){if(_0x461f5c){_0x461f5c[_0x51a8('0x15')]({'lastMsgAt':_0x418f06[_0x51a8('0x16')],'lastMsgDirection':_0x418f06['direction'][_0x51a8('0xd')]()});}})['catch'](function(_0x10584b){console[_0x51a8('0x17')](_0x10584b);});}if(_0x418f06[_0x51a8('0xc')]===_0x51a8('0xe')&&!_0x418f06[_0x51a8('0xf')]){var _0x3e0603;_0x1a476d[_0x51a8('0x18')]['describe']()[_0x51a8('0x19')](function(_0x45a433){return _0x1a476d[_0x51a8('0x1a')][_0x51a8('0x1b')]({'where':{'id':_0x418f06[_0x51a8('0x1c')]},'include':[{'model':_0x1a476d[_0x51a8('0x12')],'as':'Interactions','where':{'id':_0x418f06[_0x51a8('0x14')]},'limit':0x1,'include':[{'model':_0x1a476d[_0x51a8('0x18')],'as':_0x51a8('0x1d'),'attributes':_[_0x51a8('0x1e')](_0x45a433)}]}]});})[_0x51a8('0x19')](function(_0x3bc044){_0x3e0603=_0x3bc044[_0x51a8('0xb')]({'plain':!![]});if(_0x3e0603&&_0x3e0603[_0x51a8('0x1f')]){logger['info'](_0x51a8('0x20'),'afterCreate',util[_0x51a8('0x21')](_0x51a8('0x22'),_0x418f06['id'],_0x3e0603[_0x51a8('0x1f')]));if(_0x3e0603[_0x51a8('0x23')]&&_0x3e0603['Interactions'][_0x51a8('0x24')]){_0x418f06['Interaction']=_['omit'](_0x3e0603[_0x51a8('0x23')][0x0],'Contact');_0x418f06[_0x51a8('0x1d')]=_0x3e0603[_0x51a8('0x23')][0x0][_0x51a8('0x1d')];}var _0x39e06a={'method':_0x51a8('0x25'),'uri':encodeURI(_0x3e0603[_0x51a8('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x39e06a[_0x51a8('0x26')]){case _0x51a8('0x27'):_0x39e06a['qs']=_0x418f06;break;case'POST':_0x39e06a[_0x51a8('0x9')]=_0x418f06;break;}return rp(_0x39e06a)[_0x51a8('0x19')](function(_0xca5746){logger[_0x51a8('0x28')](_0x51a8('0x20'),_0x51a8('0x29'),util[_0x51a8('0x21')](_0x51a8('0x2a'),_0x418f06['id'],_0x3e0603[_0x51a8('0x1f')]));if(_0xca5746[_0x51a8('0x9')][_0x51a8('0x2b')]&&_0xca5746[_0x51a8('0x9')]['threadId']!=_0x418f06[_0x51a8('0x2c')]['threadId']){return _0x1a476d[_0x51a8('0x12')][_0x51a8('0x15')]({'threadId':_0xca5746[_0x51a8('0x9')][_0x51a8('0x2b')]},{'logging':!![],'where':{'id':_0x418f06[_0x51a8('0x2c')]['id']}});}else{return;}})['then'](function(){return _0x56e1b4[_0x51a8('0x15')]({'read':!![]});})['catch'](function(_0x41c4de){logger[_0x51a8('0x17')](_0x51a8('0x20'),'afterCreate',util[_0x51a8('0x2d')](_0x41c4de,{'showHidden':![],'depth':null}));_0x2f276b();});}else{_0x2f276b();}})['finally'](function(){_0x2f276b();});}else{_0x2f276b();}}},'charset':_0x51a8('0x2e'),'collate':_0x51a8('0x2f')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index a89d251..ddde96d 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x1b00eb,_0x1f8bb4){var _0x35050a=function(_0x253e5c){while(--_0x253e5c){_0x1b00eb['push'](_0x1b00eb['shift']());}};_0x35050a(++_0x1f8bb4);}(_0xadb5,0xad));var _0x5adb=function(_0x414c6b,_0x3744b8){_0x414c6b=_0x414c6b-0x0;var _0x48d832=_0xadb5[_0x414c6b];return _0x48d832;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x213a8d,_0x55fbcf){var _0x5ebce6=function(_0x3f8083){while(--_0x3f8083){_0x213a8d['push'](_0x213a8d['shift']());}};_0x5ebce6(++_0x55fbcf);}(_0xadb5,0xad));var _0x5adb=function(_0x296928,_0x31976c){_0x296928=_0x296928-0x0;var _0x4da592=_0xadb5[_0x296928];return _0x4da592;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index ffc0118..059804e 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 _0xea1c=['removeListener','register','length','remove','update','emit'];(function(_0x58c8fd,_0x2d395e){var _0x548eef=function(_0x2b1129){while(--_0x2b1129){_0x58c8fd['push'](_0x58c8fd['shift']());}};_0x548eef(++_0x2d395e);}(_0xea1c,0x117));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0xcea1('0x0'),_0xcea1('0x1')];function createListener(_0x182617,_0x13bc73){return function(_0x5284a7){_0x13bc73[_0xcea1('0x2')](_0x182617,_0x5284a7);};}function removeListener(_0x377ab8,_0xb835ce){return function(){OpenchannelMessageEvents[_0xcea1('0x3')](_0x377ab8,_0xb835ce);};}exports[_0xcea1('0x4')]=function(_0x1ff8bf){for(var _0x29732f=0x0,_0xec7a9f=events[_0xcea1('0x5')];_0x29732f<_0xec7a9f;_0x29732f++){var _0x1441c6=events[_0x29732f];var _0x295e4c=createListener('openchannelMessage:'+_0x1441c6,_0x1ff8bf);OpenchannelMessageEvents['on'](_0x1441c6,_0x295e4c);}}; \ No newline at end of file +var _0x45b3=['remove','update','emit','length','openchannelMessage:','save'];(function(_0xcf7d1e,_0x1b00ad){var _0x42b2cb=function(_0x4c5c9b){while(--_0x4c5c9b){_0xcf7d1e['push'](_0xcf7d1e['shift']());}};_0x42b2cb(++_0x1b00ad);}(_0x45b3,0x179));var _0x345b=function(_0xf0ee74,_0xa0720){_0xf0ee74=_0xf0ee74-0x0;var _0x4a3e6b=_0x45b3[_0xf0ee74];return _0x4a3e6b;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x345b('0x0'),_0x345b('0x1'),_0x345b('0x2')];function createListener(_0x18a48d,_0x4766e7){return function(_0x380e6b){_0x4766e7[_0x345b('0x3')](_0x18a48d,_0x380e6b);};}function removeListener(_0x1958d3,_0x32f665){return function(){OpenchannelMessageEvents['removeListener'](_0x1958d3,_0x32f665);};}exports['register']=function(_0x1a19f5){for(var _0xf99195=0x0,_0x45755a=events[_0x345b('0x4')];_0xf99195<_0x45755a;_0xf99195++){var _0x1e3308=events[_0xf99195];var _0x3d95d5=createListener(_0x345b('0x5')+_0x1e3308,_0x1a19f5);OpenchannelMessageEvents['on'](_0x1e3308,_0x3d95d5);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 09511ad..23141f9 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 _0x83d4=['show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','multer','util','path','Router','fs-extra','../../components/auth/service','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x3a052d,_0x481f1a){var _0x1d08fe=function(_0x2d54fb){while(--_0x2d54fb){_0x3a052d['push'](_0x3a052d['shift']());}};_0x1d08fe(++_0x481f1a);}(_0x83d4,0x102));var _0x483d=function(_0x43bdc1,_0x5b9f7e){_0x43bdc1=_0x43bdc1-0x0;var _0x36ca=_0x83d4[_0x43bdc1];return _0x36ca;};'use strict';var multer=require(_0x483d('0x0'));var util=require(_0x483d('0x1'));var path=require(_0x483d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x483d('0x3')]();var fs_extra=require(_0x483d('0x4'));var auth=require(_0x483d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x483d('0x6'));router[_0x483d('0x7')]('/',auth[_0x483d('0x8')](),controller['index']);router[_0x483d('0x7')](_0x483d('0x9'),auth['isAuthenticated'](),controller[_0x483d('0xa')]);router[_0x483d('0x7')](_0x483d('0xb'),auth[_0x483d('0x8')](),controller[_0x483d('0xc')]);router[_0x483d('0x7')](_0x483d('0xd'),auth[_0x483d('0x8')](),controller[_0x483d('0xe')]);router[_0x483d('0x7')](_0x483d('0xf'),auth[_0x483d('0x8')](),controller[_0x483d('0x10')]);router[_0x483d('0x7')](_0x483d('0x11'),auth[_0x483d('0x8')](),controller[_0x483d('0x12')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x483d('0x13')](_0x483d('0xf'),auth[_0x483d('0x8')](),controller[_0x483d('0x14')]);router[_0x483d('0x13')](_0x483d('0x11'),auth['isAuthenticated'](),controller[_0x483d('0x15')]);router[_0x483d('0x16')](_0x483d('0xb'),auth[_0x483d('0x8')](),controller[_0x483d('0x17')]);router[_0x483d('0x18')](_0x483d('0xb'),auth[_0x483d('0x8')](),controller[_0x483d('0x19')]);router[_0x483d('0x18')](_0x483d('0xf'),auth[_0x483d('0x8')](),controller[_0x483d('0x1a')]);router['delete'](_0x483d('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xc383=['getAgents','create','addTeams','post','addAgents','put','/:id','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x4e2a84,_0x5b69a8){var _0x1ab18a=function(_0x4bb756){while(--_0x4bb756){_0x4e2a84['push'](_0x4e2a84['shift']());}};_0x1ab18a(++_0x5b69a8);}(_0xc383,0x136));var _0x3c38=function(_0x37f2a1,_0x4a98c5){_0x37f2a1=_0x37f2a1-0x0;var _0x387ae8=_0xc383[_0x37f2a1];return _0x387ae8;};'use strict';var multer=require(_0x3c38('0x0'));var util=require(_0x3c38('0x1'));var path=require(_0x3c38('0x2'));var timeout=require('connect-timeout');var express=require(_0x3c38('0x3'));var router=express['Router']();var fs_extra=require(_0x3c38('0x4'));var auth=require(_0x3c38('0x5'));var interaction=require(_0x3c38('0x6'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x3c38('0x7')]('/',auth[_0x3c38('0x8')](),controller[_0x3c38('0x9')]);router['get']('/describe',auth[_0x3c38('0x8')](),controller[_0x3c38('0xa')]);router[_0x3c38('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3c38('0x7')]('/:id/members',auth[_0x3c38('0x8')](),controller[_0x3c38('0xb')]);router['get'](_0x3c38('0xc'),auth['isAuthenticated'](),controller[_0x3c38('0xd')]);router['get'](_0x3c38('0xe'),auth[_0x3c38('0x8')](),controller[_0x3c38('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3c38('0x10')]);router['post'](_0x3c38('0xc'),auth['isAuthenticated'](),controller[_0x3c38('0x11')]);router[_0x3c38('0x12')](_0x3c38('0xe'),auth[_0x3c38('0x8')](),controller[_0x3c38('0x13')]);router[_0x3c38('0x14')](_0x3c38('0x15'),auth[_0x3c38('0x8')](),controller[_0x3c38('0x16')]);router[_0x3c38('0x17')](_0x3c38('0x15'),auth[_0x3c38('0x8')](),controller['destroy']);router[_0x3c38('0x17')](_0x3c38('0xc'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x3c38('0x17')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x3c38('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 67ad258..ec6dff9 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 _0x5da4=['ENUM','rrmemory','roundrobin','exports','STRING','name','INTEGER'];(function(_0x32f18b,_0x5cd69b){var _0x20f9b3=function(_0x3a7f84){while(--_0x3a7f84){_0x32f18b['push'](_0x32f18b['shift']());}};_0x20f9b3(++_0x5cd69b);}(_0x5da4,0x11b));var _0x45da=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5da4[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require('sequelize');module[_0x45da('0x0')]={'name':{'type':Sequelize[_0x45da('0x1')],'unique':_0x45da('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x45da('0x1')]},'timeout':{'type':Sequelize[_0x45da('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x45da('0x4')](_0x45da('0x5'),'beepall',_0x45da('0x6'))}}; \ No newline at end of file +var _0xbfb7=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x15ec03,_0x10baf9){var _0x2cf15c=function(_0x112c28){while(--_0x112c28){_0x15ec03['push'](_0x15ec03['shift']());}};_0x2cf15c(++_0x10baf9);}(_0xbfb7,0x188));var _0x7bfb=function(_0x382602,_0x5e9d2d){_0x382602=_0x382602-0x0;var _0x14dda6=_0xbfb7[_0x382602];return _0x14dda6;};'use strict';var Sequelize=require(_0x7bfb('0x0'));module[_0x7bfb('0x1')]={'name':{'type':Sequelize[_0x7bfb('0x2')],'unique':_0x7bfb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7bfb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7bfb('0x5')](_0x7bfb('0x6'),'beepall',_0x7bfb('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 6e60c25..023d724 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 _0xa44d=['isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','OpenchannelQueues','UserProfileResource','end','error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserOpenchannelQueue','order','OpenchannelQueueId','User','UserId','agent','openchannelPause','createdAt','format','SIP','updatedAt','getTeams','Team','length','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','includes','all','compact','value'];(function(_0x25d9d3,_0x32a520){var _0x116dd0=function(_0x1a7259){while(--_0x1a7259){_0x25d9d3['push'](_0x25d9d3['shift']());}};_0x116dd0(++_0x32a520);}(_0xa44d,0x1a4));var _0xda44=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0xa44d[_0x1030ce];return _0x3367fd;};'use strict';var emlformat=require(_0xda44('0x0'));var rimraf=require(_0xda44('0x1'));var zipdir=require(_0xda44('0x2'));var jsonpatch=require(_0xda44('0x3'));var rp=require(_0xda44('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xda44('0x5'));var util=require('util');var path=require(_0xda44('0x6'));var sox=require(_0xda44('0x7'));var csv=require(_0xda44('0x8'));var ejs=require(_0xda44('0x9'));var fs=require('fs');var fs_extra=require(_0xda44('0xa'));var _=require(_0xda44('0xb'));var squel=require(_0xda44('0xc'));var crypto=require('crypto');var jsforce=require(_0xda44('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xda44('0x8'));var querystring=require(_0xda44('0xe'));var Papa=require('papaparse');var Redis=require(_0xda44('0xf'));var authService=require(_0xda44('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xda44('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda44('0x12'))(_0xda44('0x13'));var utils=require(_0xda44('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xda44('0x15'));var db=require(_0xda44('0x16'))['db'];config[_0xda44('0x17')]=_[_0xda44('0x18')](config[_0xda44('0x17')],{'host':_0xda44('0x19'),'port':0x18eb});var socket=require(_0xda44('0x1a'))(new Redis(config[_0xda44('0x17')]));require(_0xda44('0x1b'))[_0xda44('0x1c')](socket);function respondWithStatusCode(_0x4a6a12,_0x303d42){_0x303d42=_0x303d42||0xcc;return function(_0x5eb508){if(_0x5eb508){return _0x4a6a12[_0xda44('0x1d')](_0x303d42);}return _0x4a6a12['status'](_0x303d42)['end']();};}function respondWithResult(_0x1a7d3a,_0x418986){_0x418986=_0x418986||0xc8;return function(_0xe69b44){if(_0xe69b44){return _0x1a7d3a[_0xda44('0x1e')](_0x418986)[_0xda44('0x1f')](_0xe69b44);}};}function respondWithFilteredResult(_0x4c0a1c,_0x26855b){return function(_0x23aa20){if(_0x23aa20){var _0x3860a9=typeof _0x26855b[_0xda44('0x20')]===_0xda44('0x21')&&typeof _0x26855b[_0xda44('0x22')]===_0xda44('0x21');var _0x2320aa=_0x23aa20[_0xda44('0x23')];var _0x14c298=_0x3860a9?0x0:_0x26855b[_0xda44('0x20')];var _0xde1641=_0x3860a9?_0x23aa20['count']:_0x26855b[_0xda44('0x20')]+_0x26855b[_0xda44('0x22')];var _0x1e229f;if(_0xde1641>=_0x2320aa){_0xde1641=_0x2320aa;_0x1e229f=0xc8;}else{_0x1e229f=0xce;}_0x4c0a1c[_0xda44('0x1e')](_0x1e229f);return _0x4c0a1c['set'](_0xda44('0x24'),_0x14c298+'-'+_0xde1641+'/'+_0x2320aa)[_0xda44('0x1f')](_0x23aa20);}return null;};}function patchUpdates(_0x2f017b){return function(_0x4aae50){try{jsonpatch['apply'](_0x4aae50,_0x2f017b,!![]);}catch(_0x525b6c){return BPromise[_0xda44('0x25')](_0x525b6c);}return _0x4aae50['save']();};}function saveUpdates(_0x4682a3,_0x5b1220){return function(_0x1ca47c){if(_0x1ca47c){return _0x1ca47c[_0xda44('0x26')](_0x4682a3)[_0xda44('0x27')](function(_0x4e2294){return _0x4e2294;});}return null;};}function removeEntity(_0x170494,_0x3e5133){return function(_0x1e7d30){if(_0x1e7d30){return _0x1e7d30[_0xda44('0x28')]()[_0xda44('0x27')](function(){var _0x41ff43=_0x1e7d30[_0xda44('0x29')]({'plain':!![]});var _0x45adb3=_0xda44('0x2a');return db[_0xda44('0x2b')]['destroy']({'where':{'type':_0x45adb3,'resourceId':_0x41ff43['id']}})[_0xda44('0x27')](function(){return _0x1e7d30;});})[_0xda44('0x27')](function(){_0x170494[_0xda44('0x1e')](0xcc)[_0xda44('0x2c')]();});}};}function handleEntityNotFound(_0x48cd34,_0x5ebe41){return function(_0x427cf3){if(!_0x427cf3){_0x48cd34[_0xda44('0x1d')](0x194);}return _0x427cf3;};}function handleError(_0x3a589e,_0xb32367){_0xb32367=_0xb32367||0x1f4;return function(_0x2cd7b9){logger[_0xda44('0x2d')](_0x2cd7b9[_0xda44('0x2e')]);if(_0x2cd7b9['name']){delete _0x2cd7b9[_0xda44('0x2f')];}_0x3a589e[_0xda44('0x1e')](_0xb32367)['send'](_0x2cd7b9);};}exports[_0xda44('0x30')]=function(_0x50cce0,_0x9c077f){var _0x2fbd00={},_0x190fbe={},_0x1a1eaa={'count':0x0,'rows':[]};var _0x2ced12=_[_0xda44('0x31')](db[_0xda44('0x32')][_0xda44('0x33')],function(_0x4398f4){return{'name':_0x4398f4[_0xda44('0x34')],'type':_0x4398f4['type'][_0xda44('0x35')]};});_0x190fbe['model']=_[_0xda44('0x31')](_0x2ced12,'name');_0x190fbe[_0xda44('0x36')]=_[_0xda44('0x37')](_0x50cce0[_0xda44('0x36')]);_0x190fbe[_0xda44('0x38')]=_[_0xda44('0x39')](_0x190fbe[_0xda44('0x3a')],_0x190fbe[_0xda44('0x36')]);_0x2fbd00[_0xda44('0x3b')]=_['intersection'](_0x190fbe['model'],qs[_0xda44('0x3c')](_0x50cce0[_0xda44('0x36')][_0xda44('0x3c')]));_0x2fbd00[_0xda44('0x3b')]=_0x2fbd00[_0xda44('0x3b')]['length']?_0x2fbd00[_0xda44('0x3b')]:_0x190fbe[_0xda44('0x3a')];if(!_0x50cce0[_0xda44('0x36')][_0xda44('0x3d')](_0xda44('0x3e'))){_0x2fbd00['limit']=qs[_0xda44('0x22')](_0x50cce0[_0xda44('0x36')]['limit']);_0x2fbd00[_0xda44('0x20')]=qs[_0xda44('0x20')](_0x50cce0[_0xda44('0x36')][_0xda44('0x20')]);}_0x2fbd00['order']=qs['sort'](_0x50cce0['query'][_0xda44('0x3f')]);_0x2fbd00[_0xda44('0x40')]=qs['filters'](_[_0xda44('0x41')](_0x50cce0[_0xda44('0x36')],_0x190fbe[_0xda44('0x38')]),_0x2ced12);if(_0x50cce0['query'][_0xda44('0x42')]){_0x2fbd00[_0xda44('0x40')]=_[_0xda44('0x43')](_0x2fbd00[_0xda44('0x40')],{'$or':_[_0xda44('0x31')](_0x2ced12,function(_0x4e42bc){if(_0x4e42bc[_0xda44('0x44')]!==_0xda44('0x45')){var _0x1f17ac={};_0x1f17ac[_0x4e42bc[_0xda44('0x2f')]]={'$like':'%'+_0x50cce0[_0xda44('0x36')][_0xda44('0x42')]+'%'};return _0x1f17ac;}})});}_0x2fbd00=_[_0xda44('0x43')]({},_0x2fbd00,_0x50cce0[_0xda44('0x46')]);var _0x5b2d2d={'where':_0x2fbd00[_0xda44('0x40')]};return db[_0xda44('0x32')]['count'](_0x5b2d2d)['then'](function(_0x7e425e){_0x1a1eaa['count']=_0x7e425e;if(_0x50cce0[_0xda44('0x36')][_0xda44('0x47')]){_0x2fbd00[_0xda44('0x48')]=[{'all':!![]}];}return db[_0xda44('0x32')][_0xda44('0x49')](_0x2fbd00);})[_0xda44('0x27')](function(_0x40bbc9){_0x1a1eaa[_0xda44('0x4a')]=_0x40bbc9;return _0x1a1eaa;})['then'](respondWithFilteredResult(_0x9c077f,_0x2fbd00))[_0xda44('0x4b')](handleError(_0x9c077f,null));};exports['show']=function(_0x43a2ef,_0x197fdb){var _0x662c9a={'raw':!![],'where':{'id':_0x43a2ef[_0xda44('0x4c')]['id']}},_0x1f5e26={};_0x1f5e26[_0xda44('0x3a')]=_[_0xda44('0x37')](db[_0xda44('0x32')]['rawAttributes']);_0x1f5e26[_0xda44('0x36')]=_['keys'](_0x43a2ef['query']);_0x1f5e26[_0xda44('0x38')]=_[_0xda44('0x39')](_0x1f5e26[_0xda44('0x3a')],_0x1f5e26[_0xda44('0x36')]);_0x662c9a['attributes']=_[_0xda44('0x39')](_0x1f5e26[_0xda44('0x3a')],qs['fields'](_0x43a2ef['query'][_0xda44('0x3c')]));_0x662c9a[_0xda44('0x3b')]=_0x662c9a[_0xda44('0x3b')]['length']?_0x662c9a[_0xda44('0x3b')]:_0x1f5e26['model'];if(_0x43a2ef['query'][_0xda44('0x47')]){_0x662c9a['include']=[{'all':!![]}];}_0x662c9a=_[_0xda44('0x43')]({},_0x662c9a,_0x43a2ef['options']);return db['OpenchannelQueue']['find'](_0x662c9a)['then'](handleEntityNotFound(_0x197fdb,null))[_0xda44('0x27')](respondWithResult(_0x197fdb,null))[_0xda44('0x4b')](handleError(_0x197fdb,null));};exports[_0xda44('0x4d')]=function(_0x4121dd,_0x3bda2f){return db[_0xda44('0x32')][_0xda44('0x4d')](_0x4121dd[_0xda44('0x4e')],{})[_0xda44('0x27')](function(_0xd90f0d){var _0x2e24b7=_0x4121dd[_0xda44('0x4f')][_0xda44('0x29')]({'plain':!![]});if(!_0x2e24b7)throw new Error(_0xda44('0x50'));if(_0x2e24b7[_0xda44('0x51')]==='user'){var _0x34433f=_0xd90f0d['get']({'plain':!![]});var _0x19ec7d='OpenchannelQueues';return db[_0xda44('0x52')][_0xda44('0x53')]({'where':{'name':_0x19ec7d,'userProfileId':_0x2e24b7[_0xda44('0x54')]},'raw':!![]})[_0xda44('0x27')](function(_0x445d7e){if(_0x445d7e&&_0x445d7e[_0xda44('0x55')]===0x0){return db['UserProfileResource'][_0xda44('0x4d')]({'name':_0x34433f[_0xda44('0x2f')],'resourceId':_0x34433f['id'],'type':_0x445d7e[_0xda44('0x2f')],'sectionId':_0x445d7e['id']},{})[_0xda44('0x27')](function(){return _0xd90f0d;});}else{return _0xd90f0d;}})['catch'](function(_0xd522c8){logger[_0xda44('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd522c8);throw _0xd522c8;});}return _0xd90f0d;})[_0xda44('0x27')](respondWithResult(_0x3bda2f,0xc9))[_0xda44('0x4b')](handleError(_0x3bda2f,null));};exports['update']=function(_0x5f31aa,_0x5c14f9){if(_0x5f31aa[_0xda44('0x4e')]['id']){delete _0x5f31aa[_0xda44('0x4e')]['id'];}return db[_0xda44('0x32')][_0xda44('0x53')]({'where':{'id':_0x5f31aa[_0xda44('0x4c')]['id']}})[_0xda44('0x27')](handleEntityNotFound(_0x5c14f9,null))[_0xda44('0x27')](saveUpdates(_0x5f31aa[_0xda44('0x4e')],null))['then'](respondWithResult(_0x5c14f9,null))[_0xda44('0x4b')](handleError(_0x5c14f9,null));};exports[_0xda44('0x28')]=function(_0x34b276,_0x49d58b){return db[_0xda44('0x32')][_0xda44('0x53')]({'where':{'id':_0x34b276[_0xda44('0x4c')]['id']}})['then'](handleEntityNotFound(_0x49d58b,null))[_0xda44('0x27')](removeEntity(_0x49d58b,null))[_0xda44('0x4b')](handleError(_0x49d58b,null));};exports[_0xda44('0x56')]=function(_0x2bb736,_0x19ab65){return db['OpenchannelQueue'][_0xda44('0x56')]()[_0xda44('0x27')](respondWithResult(_0x19ab65,null))['catch'](handleError(_0x19ab65,null));};exports[_0xda44('0x57')]=function(_0x540366,_0x2dc98b,_0x266ce5){var _0x2292ab={'raw':!![],'where':{}},_0x5368a0={},_0x3c11d6;return db[_0xda44('0x32')][_0xda44('0x58')]({'where':{'id':_0x540366[_0xda44('0x4c')]['id']}})[_0xda44('0x27')](handleEntityNotFound(_0x2dc98b,null))[_0xda44('0x27')](function(_0x469315){if(_0x469315){_0x3c11d6=_0x469315[_0xda44('0x29')]({'plain':!![]});_0x5368a0['model']=_[_0xda44('0x37')](db[_0xda44('0x59')][_0xda44('0x33')]);_0x5368a0[_0xda44('0x36')]=_[_0xda44('0x37')](_0x540366[_0xda44('0x36')]);_0x5368a0[_0xda44('0x38')]=_[_0xda44('0x39')](_0x5368a0['model'],_0x5368a0[_0xda44('0x36')]);_0x2292ab[_0xda44('0x3b')]=_[_0xda44('0x39')](_0x5368a0[_0xda44('0x3a')],qs['fields'](_0x540366[_0xda44('0x36')][_0xda44('0x3c')]));_0x2292ab[_0xda44('0x3b')]=_0x2292ab[_0xda44('0x3b')]['length']?_0x2292ab[_0xda44('0x3b')]:_0x5368a0[_0xda44('0x3a')];if(!_0x540366['query']['hasOwnProperty']('nolimit')){_0x2292ab[_0xda44('0x22')]=qs[_0xda44('0x22')](_0x540366[_0xda44('0x36')][_0xda44('0x22')]);_0x2292ab[_0xda44('0x20')]=qs[_0xda44('0x20')](_0x540366[_0xda44('0x36')][_0xda44('0x20')]);}_0x2292ab[_0xda44('0x5a')]=qs['sort'](_0x540366[_0xda44('0x36')][_0xda44('0x3f')]);_0x2292ab[_0xda44('0x40')]=qs[_0xda44('0x38')](_[_0xda44('0x41')](_0x540366[_0xda44('0x36')],_0x5368a0['filters']));_0x2292ab[_0xda44('0x40')][_0xda44('0x5b')]=_0x469315['id'];if(_0x540366[_0xda44('0x36')][_0xda44('0x42')]){_0x2292ab[_0xda44('0x40')]=_[_0xda44('0x43')](_0x2292ab[_0xda44('0x40')],{'$or':_[_0xda44('0x31')](_0x2292ab[_0xda44('0x3b')],function(_0x36c5db){var _0x55251e={};_0x55251e[_0x36c5db]={'$like':'%'+_0x540366[_0xda44('0x36')][_0xda44('0x42')]+'%'};return _0x55251e;})});}_0x2292ab=_[_0xda44('0x43')]({},_0x2292ab,_0x540366[_0xda44('0x46')]);return db[_0xda44('0x59')][_0xda44('0x49')](_0x2292ab);}})[_0xda44('0x27')](function(_0x23b56c){if(_0x23b56c){return db[_0xda44('0x5c')]['findAndCountAll']({'where':{'id':_['map'](_0x23b56c,_0xda44('0x5d')),'role':_0xda44('0x5e')},'attributes':['id',_0xda44('0x2f'),_0xda44('0x5f'),'updatedAt',_0xda44('0x60')]});}})[_0xda44('0x27')](function(_0x3ed6f1){if(_0x3ed6f1){return{'count':_0x3ed6f1[_0xda44('0x23')],'rows':_['map'](_0x3ed6f1['rows'],function(_0x26c9ac){return{'membername':_0x26c9ac[_0xda44('0x2f')],'UserId':_0x26c9ac['id'],'queue_name':_0x3c11d6[_0xda44('0x2f')],'OpenchannelQueueId':_0x3c11d6['id'],'interface':util[_0xda44('0x61')]('%s/%s',_0xda44('0x62'),_0x26c9ac['name']),'penalty':0x0,'paused':_0x26c9ac[_0xda44('0x5f')],'createdAt':_0x26c9ac[_0xda44('0x60')],'updatedAt':_0x26c9ac[_0xda44('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xda44('0x27')](respondWithFilteredResult(_0x2dc98b,_0x2292ab))['catch'](handleError(_0x2dc98b,null));};exports[_0xda44('0x64')]=function(_0x3c2d5f,_0x1cbe75,_0x19fffb){var _0x186059={};var _0x59cf87={};var _0x38a303;var _0xbbd153;return db['OpenchannelQueue'][_0xda44('0x58')]({'where':{'id':_0x3c2d5f[_0xda44('0x4c')]['id']}})[_0xda44('0x27')](handleEntityNotFound(_0x1cbe75,null))[_0xda44('0x27')](function(_0x26ad67){if(_0x26ad67){_0x38a303=_0x26ad67;_0x59cf87[_0xda44('0x3a')]=_[_0xda44('0x37')](db[_0xda44('0x65')][_0xda44('0x33')]);_0x59cf87[_0xda44('0x36')]=_['keys'](_0x3c2d5f[_0xda44('0x36')]);_0x59cf87[_0xda44('0x38')]=_[_0xda44('0x39')](_0x59cf87['model'],_0x59cf87[_0xda44('0x36')]);_0x186059[_0xda44('0x3b')]=_[_0xda44('0x39')](_0x59cf87['model'],qs[_0xda44('0x3c')](_0x3c2d5f[_0xda44('0x36')][_0xda44('0x3c')]));_0x186059[_0xda44('0x3b')]=_0x186059[_0xda44('0x3b')][_0xda44('0x66')]?_0x186059[_0xda44('0x3b')]:_0x59cf87[_0xda44('0x3a')];_0x186059[_0xda44('0x5a')]=qs[_0xda44('0x3f')](_0x3c2d5f[_0xda44('0x36')][_0xda44('0x3f')]);_0x186059[_0xda44('0x40')]=qs[_0xda44('0x38')](_[_0xda44('0x41')](_0x3c2d5f[_0xda44('0x36')],_0x59cf87[_0xda44('0x38')]));if(_0x3c2d5f[_0xda44('0x36')][_0xda44('0x42')]){_0x186059[_0xda44('0x40')]=_[_0xda44('0x43')](_0x186059[_0xda44('0x40')],{'$or':_[_0xda44('0x31')](_0x186059['attributes'],function(_0x315c07){var _0x15e814={};_0x15e814[_0x315c07]={'$like':'%'+_0x3c2d5f[_0xda44('0x36')][_0xda44('0x42')]+'%'};return _0x15e814;})});}_0x186059=_[_0xda44('0x43')]({},_0x186059,_0x3c2d5f['options']);return _0x38a303['getTeams'](_0x186059);}})['then'](function(_0x3e2fe2){if(_0x3e2fe2){_0xbbd153=_0x3e2fe2[_0xda44('0x66')];if(!_0x3c2d5f[_0xda44('0x36')][_0xda44('0x3d')]('nolimit')){_0x186059['limit']=qs[_0xda44('0x22')](_0x3c2d5f['query'][_0xda44('0x22')]);_0x186059[_0xda44('0x20')]=qs[_0xda44('0x20')](_0x3c2d5f['query'][_0xda44('0x20')]);}return _0x38a303[_0xda44('0x64')](_0x186059);}})[_0xda44('0x27')](function(_0x25a6f2){if(_0x25a6f2){return _0x25a6f2?{'count':_0xbbd153,'rows':_0x25a6f2}:null;}})[_0xda44('0x27')](respondWithResult(_0x1cbe75,null))[_0xda44('0x4b')](handleError(_0x1cbe75,null));};exports['addTeams']=function(_0x56c2b5,_0x2ac059,_0x3c2c49){var _0x3a0f86=_0x56c2b5[_0xda44('0x4e')][_0xda44('0x67')];return db[_0xda44('0x65')]['findAll']({'where':{'id':_0x3a0f86},'attributes':['id'],'include':[{'model':db[_0xda44('0x5c')],'as':_0xda44('0x68'),'attributes':['id',_0xda44('0x2f'),'online',_0xda44('0x69'),_0xda44('0x6a')],'raw':!![]}]})[_0xda44('0x27')](function(_0x45cedd){if(_0x45cedd){var _0x39a7b0=_[_0xda44('0x6b')](_0x45cedd,function(_0x5512e3){var _0x7eb479=_0x5512e3[_0xda44('0x29')]({'plain':!![]});return _0x7eb479[_0xda44('0x68')];});return db[_0xda44('0x32')][_0xda44('0x53')]({'where':{'id':_0x56c2b5[_0xda44('0x4c')]['id']}})[_0xda44('0x27')](function(_0x277ad5){return db[_0xda44('0x6c')][_0xda44('0x6d')](function(_0x48e429){return _0x277ad5['addTeams'](_0x3a0f86,{'transaction':_0x48e429})[_0xda44('0x27')](function(){return BPromise[_0xda44('0x6e')](_0x39a7b0,function(_0x57d45c){return db[_0xda44('0x59')][_0xda44('0x6f')]({'where':{'UserId':_0x57d45c['id'],'OpenchannelQueueId':_0x56c2b5['params']['id']},'transaction':_0x48e429});});})['then'](function(){_0x39a7b0[_0xda44('0x70')](function(_0x1ac114){socket[_0xda44('0x71')]('userOpenchannelQueue:save',{'UserId':_0x1ac114['id'],'OpenchannelQueueId':_0x277ad5['id']});});});});});}})[_0xda44('0x27')](respondWithStatusCode(_0x2ac059,null))[_0xda44('0x4b')](handleError(_0x2ac059,null));};exports[_0xda44('0x72')]=function(_0x2a507d,_0x3954dd,_0x10785f){return db[_0xda44('0x65')][_0xda44('0x49')]({'where':{'id':_0x2a507d[_0xda44('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xda44('0x5c')],'as':_0xda44('0x68'),'attributes':['id'],'raw':!![]}]})[_0xda44('0x27')](handleEntityNotFound(_0x3954dd,null))[_0xda44('0x27')](function(_0x3cae7c){var _0x5ae3e5=_[_0xda44('0x31')](_0x3cae7c,'id');var _0x4e0074=[];var _0xa649e4=[];var _0x8ad544=squel[_0xda44('0x73')]();_0x8ad544[_0xda44('0x74')]('tq.TeamId')['from'](_0xda44('0x75'),'tq')[_0xda44('0x76')](_0xda44('0x77'),'ut',_0xda44('0x78'))[_0xda44('0x40')]('OpenchannelQueueId\x20=\x20?',_0x2a507d[_0xda44('0x4c')]['id']);for(var _0x481edd=0x0;_0x481edd<_0x3cae7c[_0xda44('0x66')];_0x481edd+=0x1){let _0x369f5f=_0x3cae7c[_0x481edd];for(var _0x35c9ab=0x0;_0x35c9ab<_0x369f5f['Agents'][_0xda44('0x66')];_0x35c9ab+=0x1){let _0x24d23a=_0x369f5f[_0xda44('0x68')][_0x35c9ab];var _0x582f38=_0x8ad544['clone']();_0x582f38[_0xda44('0x40')](_0xda44('0x79'),_0x24d23a['id']);_0xa649e4[_0xda44('0x7a')](db[_0xda44('0x6c')][_0xda44('0x36')](_0x582f38['toString'](),{'type':db[_0xda44('0x6c')][_0xda44('0x7b')]['SELECT']})['then'](function(_0x1ec97d){if(_0x1ec97d['length']===0x1){return _0x24d23a['id'];}else{var _0x456681=_['every'](_[_0xda44('0x31')](_0x1ec97d,'TeamId'),function(_0x2e8a80){return _[_0xda44('0x7c')](_0x5ae3e5,_0x2e8a80);});if(_0x456681){return _0x24d23a['id'];}}}));}}return BPromise[_0xda44('0x7d')](_0xa649e4)[_0xda44('0x27')](function(_0x4e6005){_0x4e0074=_(_0x4e0074)['union'](_0x4e6005)[_0xda44('0x7e')]()[_0xda44('0x7f')]();return db[_0xda44('0x32')][_0xda44('0x53')]({'where':{'id':_0x2a507d[_0xda44('0x4c')]['id']}})[_0xda44('0x27')](function(_0x54c61d){return db['sequelize'][_0xda44('0x6d')](function(_0x2709a5){return _0x54c61d['removeTeams'](_0x2a507d[_0xda44('0x36')][_0xda44('0x67')],{'transaction':_0x2709a5})[_0xda44('0x27')](function(){if(!_[_0xda44('0x80')](_0x4e0074)){return _0x54c61d[_0xda44('0x81')](_0x4e0074,{'transaction':_0x2709a5});}})[_0xda44('0x27')](function(){_0x4e0074[_0xda44('0x70')](function(_0xae092e){socket[_0xda44('0x71')](_0xda44('0x82'),{'UserId':_0xae092e,'OpenchannelQueueId':_0x54c61d['id']});});});});});});})[_0xda44('0x27')](respondWithStatusCode(_0x3954dd,null))['catch'](handleError(_0x3954dd,null));};exports['addAgents']=function(_0x301bab,_0x5a07f7,_0xf4082a){return db[_0xda44('0x32')][_0xda44('0x53')]({'where':{'id':_0x301bab[_0xda44('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5a07f7,null))['then'](function(_0x479db9){if(_0x479db9){return _0x479db9[_0xda44('0x83')](_0x301bab[_0xda44('0x4e')]['ids'],_[_0xda44('0x84')](_0x301bab[_0xda44('0x4e')],['ids','id'])||{})[_0xda44('0x85')](function(_0x1ba2bc){for(var _0x1e5c45=0x0;_0x1e5c45<_0x301bab[_0xda44('0x4e')]['ids'][_0xda44('0x66')];_0x1e5c45+=0x1){socket[_0xda44('0x71')](_0xda44('0x86'),{'UserId':Number(_0x301bab[_0xda44('0x4e')]['ids'][_0x1e5c45]),'OpenchannelQueueId':Number(_0x301bab[_0xda44('0x4c')]['id'])});}return _0x1ba2bc;});}})[_0xda44('0x27')](respondWithResult(_0x5a07f7,null))['catch'](handleError(_0x5a07f7,null));};exports[_0xda44('0x81')]=function(_0x4b50e2,_0x6286d2,_0x487c4c){return db[_0xda44('0x32')][_0xda44('0x53')]({'where':{'id':_0x4b50e2[_0xda44('0x4c')]['id']}})[_0xda44('0x27')](handleEntityNotFound(_0x6286d2,null))['then'](function(_0x2f419a){if(_0x2f419a){return _0x2f419a[_0xda44('0x81')](_0x4b50e2[_0xda44('0x36')][_0xda44('0x67')])[_0xda44('0x27')](function(){if(_[_0xda44('0x87')](_0x4b50e2[_0xda44('0x36')]['ids'])){for(var _0xb8f345=0x0;_0xb8f345<_0x4b50e2['query']['ids'][_0xda44('0x66')];_0xb8f345+=0x1){socket['emit'](_0xda44('0x82'),{'UserId':Number(_0x4b50e2[_0xda44('0x36')][_0xda44('0x67')][_0xb8f345]),'OpenchannelQueueId':Number(_0x4b50e2['params']['id'])});}}else{socket[_0xda44('0x71')](_0xda44('0x82'),{'UserId':Number(_0x4b50e2['query'][_0xda44('0x67')]),'OpenchannelQueueId':Number(_0x4b50e2[_0xda44('0x4c')]['id'])});}});}})[_0xda44('0x27')](respondWithStatusCode(_0x6286d2,null))[_0xda44('0x4b')](handleError(_0x6286d2,null));};exports[_0xda44('0x88')]=function(_0x5a3ca6,_0x18f7a3,_0x2f9c61){var _0x37342a={};var _0x24b186={};var _0x31c30e;var _0x2a0b7c;return db[_0xda44('0x32')][_0xda44('0x58')]({'where':{'id':_0x5a3ca6[_0xda44('0x4c')]['id']}})[_0xda44('0x27')](handleEntityNotFound(_0x18f7a3,null))['then'](function(_0x499168){if(_0x499168){_0x31c30e=_0x499168;_0x24b186[_0xda44('0x3a')]=_[_0xda44('0x37')](db[_0xda44('0x5c')][_0xda44('0x33')]);_0x24b186['query']=_[_0xda44('0x37')](_0x5a3ca6[_0xda44('0x36')]);_0x24b186[_0xda44('0x38')]=_[_0xda44('0x39')](_0x24b186[_0xda44('0x3a')],_0x24b186[_0xda44('0x36')]);_0x37342a[_0xda44('0x3b')]=_[_0xda44('0x39')](_0x24b186[_0xda44('0x3a')],qs[_0xda44('0x3c')](_0x5a3ca6['query']['fields']));_0x37342a[_0xda44('0x3b')]=_0x37342a[_0xda44('0x3b')]['length']?_0x37342a[_0xda44('0x3b')]:_0x24b186[_0xda44('0x3a')];_0x37342a['order']=qs[_0xda44('0x3f')](_0x5a3ca6[_0xda44('0x36')][_0xda44('0x3f')]);_0x37342a[_0xda44('0x40')]=qs['filters'](_[_0xda44('0x41')](_0x5a3ca6[_0xda44('0x36')],_0x24b186['filters']));if(_0x5a3ca6[_0xda44('0x36')][_0xda44('0x42')]){_0x37342a[_0xda44('0x40')]=_[_0xda44('0x43')](_0x37342a[_0xda44('0x40')],{'$or':_[_0xda44('0x31')](_0x37342a[_0xda44('0x3b')],function(_0x252042){var _0x44191f={};_0x44191f[_0x252042]={'$like':'%'+_0x5a3ca6[_0xda44('0x36')][_0xda44('0x42')]+'%'};return _0x44191f;})});}_0x37342a=_[_0xda44('0x43')]({},_0x37342a,_0x5a3ca6[_0xda44('0x46')]);return _0x31c30e[_0xda44('0x88')](_0x37342a);}})[_0xda44('0x27')](function(_0x99be8b){if(_0x99be8b){_0x2a0b7c=_0x99be8b[_0xda44('0x66')];if(!_0x5a3ca6['query'][_0xda44('0x3d')](_0xda44('0x3e'))){_0x37342a['limit']=qs[_0xda44('0x22')](_0x5a3ca6[_0xda44('0x36')][_0xda44('0x22')]);_0x37342a['offset']=qs[_0xda44('0x20')](_0x5a3ca6[_0xda44('0x36')][_0xda44('0x20')]);}return _0x31c30e[_0xda44('0x88')](_0x37342a);}})['then'](function(_0x5f2e66){if(_0x5f2e66){return _0x5f2e66?{'count':_0x2a0b7c,'rows':_0x5f2e66}:null;}})['then'](respondWithResult(_0x18f7a3,null))[_0xda44('0x4b')](handleError(_0x18f7a3,null));}; \ No newline at end of file +var _0x752b=['rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','includeAll','include','rows','show','keys','length','find','catch','user','role','OpenchannelQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','OpenchannelQueueId','UserOpenchannelQueue','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','register','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','OpenchannelQueue'];(function(_0x1654f5,_0x5e1214){var _0x37cd7d=function(_0x9d544e){while(--_0x9d544e){_0x1654f5['push'](_0x1654f5['shift']());}};_0x37cd7d(++_0x5e1214);}(_0x752b,0x1f3));var _0xb752=function(_0x3ea427,_0x5cb3b3){_0x3ea427=_0x3ea427-0x0;var _0x1317f6=_0x752b[_0x3ea427];return _0x1317f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb752('0x0'));var zipdir=require(_0xb752('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb752('0x2'));var moment=require('moment');var BPromise=require(_0xb752('0x3'));var Mustache=require(_0xb752('0x4'));var util=require(_0xb752('0x5'));var path=require('path');var sox=require(_0xb752('0x6'));var csv=require(_0xb752('0x7'));var ejs=require(_0xb752('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb752('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb752('0xa'));var toCsv=require(_0xb752('0x7'));var querystring=require('querystring');var Papa=require(_0xb752('0xb'));var Redis=require(_0xb752('0xc'));var authService=require(_0xb752('0xd'));var qs=require(_0xb752('0xe'));var as=require(_0xb752('0xf'));var hardwareService=require(_0xb752('0x10'));var logger=require('../../config/logger')(_0xb752('0x11'));var utils=require(_0xb752('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xb752('0x13'));var db=require(_0xb752('0x14'))['db'];config[_0xb752('0x15')]=_[_0xb752('0x16')](config['redis'],{'host':_0xb752('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb752('0x18'))[_0xb752('0x19')](socket);function respondWithStatusCode(_0x3d6058,_0x427328){_0x427328=_0x427328||0xcc;return function(_0x205496){if(_0x205496){return _0x3d6058['sendStatus'](_0x427328);}return _0x3d6058['status'](_0x427328)[_0xb752('0x1a')]();};}function respondWithResult(_0x776873,_0x52e0cd){_0x52e0cd=_0x52e0cd||0xc8;return function(_0x52dc21){if(_0x52dc21){return _0x776873[_0xb752('0x1b')](_0x52e0cd)['json'](_0x52dc21);}};}function respondWithFilteredResult(_0x8252ce,_0x1a50b7){return function(_0x4ca34e){if(_0x4ca34e){var _0x391d8e=typeof _0x1a50b7[_0xb752('0x1c')]==='undefined'&&typeof _0x1a50b7['limit']===_0xb752('0x1d');var _0x1d7232=_0x4ca34e[_0xb752('0x1e')];var _0x2b983f=_0x391d8e?0x0:_0x1a50b7[_0xb752('0x1c')];var _0x4df00a=_0x391d8e?_0x4ca34e[_0xb752('0x1e')]:_0x1a50b7[_0xb752('0x1c')]+_0x1a50b7[_0xb752('0x1f')];var _0x242f20;if(_0x4df00a>=_0x1d7232){_0x4df00a=_0x1d7232;_0x242f20=0xc8;}else{_0x242f20=0xce;}_0x8252ce['status'](_0x242f20);return _0x8252ce[_0xb752('0x20')](_0xb752('0x21'),_0x2b983f+'-'+_0x4df00a+'/'+_0x1d7232)[_0xb752('0x22')](_0x4ca34e);}return null;};}function patchUpdates(_0x774c54){return function(_0x2fd091){try{jsonpatch[_0xb752('0x23')](_0x2fd091,_0x774c54,!![]);}catch(_0x31d109){return BPromise[_0xb752('0x24')](_0x31d109);}return _0x2fd091[_0xb752('0x25')]();};}function saveUpdates(_0x393161,_0x3f9a60){return function(_0x6594ee){if(_0x6594ee){return _0x6594ee[_0xb752('0x26')](_0x393161)[_0xb752('0x27')](function(_0x2c64af){return _0x2c64af;});}return null;};}function removeEntity(_0x110e72,_0x3f2ace){return function(_0x357534){if(_0x357534){return _0x357534['destroy']()[_0xb752('0x27')](function(){var _0x225610=_0x357534[_0xb752('0x28')]({'plain':!![]});var _0x52ca27='OpenchannelQueues';return db[_0xb752('0x29')][_0xb752('0x2a')]({'where':{'type':_0x52ca27,'resourceId':_0x225610['id']}})[_0xb752('0x27')](function(){return _0x357534;});})[_0xb752('0x27')](function(){_0x110e72[_0xb752('0x1b')](0xcc)[_0xb752('0x1a')]();});}};}function handleEntityNotFound(_0x1c7341,_0x1a55f0){return function(_0x4656cd){if(!_0x4656cd){_0x1c7341['sendStatus'](0x194);}return _0x4656cd;};}function handleError(_0x218243,_0x5488f1){_0x5488f1=_0x5488f1||0x1f4;return function(_0xb9b8e0){logger[_0xb752('0x2b')](_0xb9b8e0['stack']);if(_0xb9b8e0[_0xb752('0x2c')]){delete _0xb9b8e0[_0xb752('0x2c')];}_0x218243[_0xb752('0x1b')](_0x5488f1)[_0xb752('0x2d')](_0xb9b8e0);};}exports[_0xb752('0x2e')]=function(_0x3cd7aa,_0x3c42ef){var _0x4aa8ed={},_0x48d2fc={},_0x12dab6={'count':0x0,'rows':[]};var _0x59f8c8=_[_0xb752('0x2f')](db[_0xb752('0x30')][_0xb752('0x31')],function(_0x1f1d2b){return{'name':_0x1f1d2b[_0xb752('0x32')],'type':_0x1f1d2b['type'][_0xb752('0x33')]};});_0x48d2fc[_0xb752('0x34')]=_[_0xb752('0x2f')](_0x59f8c8,'name');_0x48d2fc[_0xb752('0x35')]=_['keys'](_0x3cd7aa['query']);_0x48d2fc[_0xb752('0x36')]=_[_0xb752('0x37')](_0x48d2fc[_0xb752('0x34')],_0x48d2fc['query']);_0x4aa8ed['attributes']=_[_0xb752('0x37')](_0x48d2fc[_0xb752('0x34')],qs['fields'](_0x3cd7aa['query'][_0xb752('0x38')]));_0x4aa8ed['attributes']=_0x4aa8ed[_0xb752('0x39')]['length']?_0x4aa8ed[_0xb752('0x39')]:_0x48d2fc['model'];if(!_0x3cd7aa['query'][_0xb752('0x3a')](_0xb752('0x3b'))){_0x4aa8ed[_0xb752('0x1f')]=qs[_0xb752('0x1f')](_0x3cd7aa['query'][_0xb752('0x1f')]);_0x4aa8ed[_0xb752('0x1c')]=qs['offset'](_0x3cd7aa[_0xb752('0x35')][_0xb752('0x1c')]);}_0x4aa8ed[_0xb752('0x3c')]=qs[_0xb752('0x3d')](_0x3cd7aa[_0xb752('0x35')]['sort']);_0x4aa8ed['where']=qs[_0xb752('0x36')](_[_0xb752('0x3e')](_0x3cd7aa[_0xb752('0x35')],_0x48d2fc['filters']),_0x59f8c8);if(_0x3cd7aa[_0xb752('0x35')][_0xb752('0x3f')]){_0x4aa8ed['where']=_[_0xb752('0x40')](_0x4aa8ed[_0xb752('0x41')],{'$or':_[_0xb752('0x2f')](_0x59f8c8,function(_0x58e37c){if(_0x58e37c[_0xb752('0x42')]!=='VIRTUAL'){var _0x49cb10={};_0x49cb10[_0x58e37c[_0xb752('0x2c')]]={'$like':'%'+_0x3cd7aa[_0xb752('0x35')][_0xb752('0x3f')]+'%'};return _0x49cb10;}})});}_0x4aa8ed=_[_0xb752('0x40')]({},_0x4aa8ed,_0x3cd7aa[_0xb752('0x43')]);var _0x3871ae={'where':_0x4aa8ed[_0xb752('0x41')]};return db['OpenchannelQueue'][_0xb752('0x1e')](_0x3871ae)[_0xb752('0x27')](function(_0x458570){_0x12dab6['count']=_0x458570;if(_0x3cd7aa[_0xb752('0x35')][_0xb752('0x44')]){_0x4aa8ed[_0xb752('0x45')]=[{'all':!![]}];}return db[_0xb752('0x30')]['findAll'](_0x4aa8ed);})['then'](function(_0x4fe132){_0x12dab6[_0xb752('0x46')]=_0x4fe132;return _0x12dab6;})['then'](respondWithFilteredResult(_0x3c42ef,_0x4aa8ed))['catch'](handleError(_0x3c42ef,null));};exports[_0xb752('0x47')]=function(_0x5904e5,_0x12701f){var _0x46f98d={'raw':!![],'where':{'id':_0x5904e5['params']['id']}},_0x471c03={};_0x471c03[_0xb752('0x34')]=_[_0xb752('0x48')](db[_0xb752('0x30')][_0xb752('0x31')]);_0x471c03[_0xb752('0x35')]=_[_0xb752('0x48')](_0x5904e5[_0xb752('0x35')]);_0x471c03['filters']=_[_0xb752('0x37')](_0x471c03[_0xb752('0x34')],_0x471c03['query']);_0x46f98d[_0xb752('0x39')]=_[_0xb752('0x37')](_0x471c03['model'],qs['fields'](_0x5904e5[_0xb752('0x35')][_0xb752('0x38')]));_0x46f98d[_0xb752('0x39')]=_0x46f98d['attributes'][_0xb752('0x49')]?_0x46f98d[_0xb752('0x39')]:_0x471c03['model'];if(_0x5904e5['query'][_0xb752('0x44')]){_0x46f98d[_0xb752('0x45')]=[{'all':!![]}];}_0x46f98d=_['merge']({},_0x46f98d,_0x5904e5[_0xb752('0x43')]);return db[_0xb752('0x30')][_0xb752('0x4a')](_0x46f98d)[_0xb752('0x27')](handleEntityNotFound(_0x12701f,null))[_0xb752('0x27')](respondWithResult(_0x12701f,null))[_0xb752('0x4b')](handleError(_0x12701f,null));};exports['create']=function(_0x1207d9,_0x1fe9fd){return db['OpenchannelQueue']['create'](_0x1207d9['body'],{})[_0xb752('0x27')](function(_0x516882){var _0x1673d8=_0x1207d9[_0xb752('0x4c')][_0xb752('0x28')]({'plain':!![]});if(!_0x1673d8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1673d8[_0xb752('0x4d')]===_0xb752('0x4c')){var _0x2d3f78=_0x516882['get']({'plain':!![]});var _0x55ab73=_0xb752('0x4e');return db['UserProfileSection'][_0xb752('0x4a')]({'where':{'name':_0x55ab73,'userProfileId':_0x1673d8[_0xb752('0x4f')]},'raw':!![]})[_0xb752('0x27')](function(_0x297d8e){if(_0x297d8e&&_0x297d8e[_0xb752('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x2d3f78[_0xb752('0x2c')],'resourceId':_0x2d3f78['id'],'type':_0x297d8e['name'],'sectionId':_0x297d8e['id']},{})[_0xb752('0x27')](function(){return _0x516882;});}else{return _0x516882;}})['catch'](function(_0x36c7ef){logger[_0xb752('0x2b')](_0xb752('0x51'),_0x36c7ef);throw _0x36c7ef;});}return _0x516882;})[_0xb752('0x27')](respondWithResult(_0x1fe9fd,0xc9))[_0xb752('0x4b')](handleError(_0x1fe9fd,null));};exports['update']=function(_0x1afdfb,_0x27e942){if(_0x1afdfb['body']['id']){delete _0x1afdfb[_0xb752('0x52')]['id'];}return db[_0xb752('0x30')][_0xb752('0x4a')]({'where':{'id':_0x1afdfb['params']['id']}})[_0xb752('0x27')](handleEntityNotFound(_0x27e942,null))[_0xb752('0x27')](saveUpdates(_0x1afdfb[_0xb752('0x52')],null))[_0xb752('0x27')](respondWithResult(_0x27e942,null))[_0xb752('0x4b')](handleError(_0x27e942,null));};exports['destroy']=function(_0x198f4f,_0x225b97){return db[_0xb752('0x30')]['find']({'where':{'id':_0x198f4f[_0xb752('0x53')]['id']}})[_0xb752('0x27')](handleEntityNotFound(_0x225b97,null))[_0xb752('0x27')](removeEntity(_0x225b97,null))[_0xb752('0x4b')](handleError(_0x225b97,null));};exports[_0xb752('0x54')]=function(_0x246ae0,_0x33d008){return db[_0xb752('0x30')]['describe']()[_0xb752('0x27')](respondWithResult(_0x33d008,null))[_0xb752('0x4b')](handleError(_0x33d008,null));};exports[_0xb752('0x55')]=function(_0x362c65,_0x5ce2b3,_0x313dc5){var _0x83f2a9={'raw':!![],'where':{}},_0x33c205={},_0x3a495a;return db[_0xb752('0x30')][_0xb752('0x56')]({'where':{'id':_0x362c65[_0xb752('0x53')]['id']}})[_0xb752('0x27')](handleEntityNotFound(_0x5ce2b3,null))[_0xb752('0x27')](function(_0x23d3a5){if(_0x23d3a5){_0x3a495a=_0x23d3a5[_0xb752('0x28')]({'plain':!![]});_0x33c205['model']=_[_0xb752('0x48')](db['UserOpenchannelQueue'][_0xb752('0x31')]);_0x33c205['query']=_[_0xb752('0x48')](_0x362c65[_0xb752('0x35')]);_0x33c205['filters']=_[_0xb752('0x37')](_0x33c205[_0xb752('0x34')],_0x33c205[_0xb752('0x35')]);_0x83f2a9[_0xb752('0x39')]=_[_0xb752('0x37')](_0x33c205[_0xb752('0x34')],qs[_0xb752('0x38')](_0x362c65[_0xb752('0x35')][_0xb752('0x38')]));_0x83f2a9[_0xb752('0x39')]=_0x83f2a9[_0xb752('0x39')][_0xb752('0x49')]?_0x83f2a9[_0xb752('0x39')]:_0x33c205[_0xb752('0x34')];if(!_0x362c65[_0xb752('0x35')][_0xb752('0x3a')]('nolimit')){_0x83f2a9[_0xb752('0x1f')]=qs[_0xb752('0x1f')](_0x362c65[_0xb752('0x35')][_0xb752('0x1f')]);_0x83f2a9[_0xb752('0x1c')]=qs[_0xb752('0x1c')](_0x362c65[_0xb752('0x35')]['offset']);}_0x83f2a9[_0xb752('0x3c')]=qs[_0xb752('0x3d')](_0x362c65['query'][_0xb752('0x3d')]);_0x83f2a9[_0xb752('0x41')]=qs[_0xb752('0x36')](_[_0xb752('0x3e')](_0x362c65[_0xb752('0x35')],_0x33c205[_0xb752('0x36')]));_0x83f2a9['where'][_0xb752('0x57')]=_0x23d3a5['id'];if(_0x362c65[_0xb752('0x35')][_0xb752('0x3f')]){_0x83f2a9[_0xb752('0x41')]=_['merge'](_0x83f2a9['where'],{'$or':_[_0xb752('0x2f')](_0x83f2a9[_0xb752('0x39')],function(_0x1b1726){var _0x7a1cf0={};_0x7a1cf0[_0x1b1726]={'$like':'%'+_0x362c65[_0xb752('0x35')][_0xb752('0x3f')]+'%'};return _0x7a1cf0;})});}_0x83f2a9=_[_0xb752('0x40')]({},_0x83f2a9,_0x362c65['options']);return db[_0xb752('0x58')]['findAll'](_0x83f2a9);}})['then'](function(_0x179d91){if(_0x179d91){return db['User'][_0xb752('0x59')]({'where':{'id':_[_0xb752('0x2f')](_0x179d91,_0xb752('0x5a')),'role':_0xb752('0x5b')},'attributes':['id',_0xb752('0x2c'),_0xb752('0x5c'),_0xb752('0x5d'),_0xb752('0x5e')]});}})[_0xb752('0x27')](function(_0x242612){if(_0x242612){return{'count':_0x242612[_0xb752('0x1e')],'rows':_[_0xb752('0x2f')](_0x242612[_0xb752('0x46')],function(_0x2c0390){return{'membername':_0x2c0390[_0xb752('0x2c')],'UserId':_0x2c0390['id'],'queue_name':_0x3a495a[_0xb752('0x2c')],'OpenchannelQueueId':_0x3a495a['id'],'interface':util['format']('%s/%s',_0xb752('0x5f'),_0x2c0390['name']),'penalty':0x0,'paused':_0x2c0390[_0xb752('0x5c')],'createdAt':_0x2c0390[_0xb752('0x5e')],'updatedAt':_0x2c0390[_0xb752('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb752('0x27')](respondWithFilteredResult(_0x5ce2b3,_0x83f2a9))[_0xb752('0x4b')](handleError(_0x5ce2b3,null));};exports[_0xb752('0x60')]=function(_0x1aaae1,_0xa9582,_0x443a1d){var _0x5aa045={};var _0x513ac2={};var _0xa19a66;var _0xe62de8;return db[_0xb752('0x30')][_0xb752('0x56')]({'where':{'id':_0x1aaae1[_0xb752('0x53')]['id']}})[_0xb752('0x27')](handleEntityNotFound(_0xa9582,null))[_0xb752('0x27')](function(_0x11ce00){if(_0x11ce00){_0xa19a66=_0x11ce00;_0x513ac2[_0xb752('0x34')]=_[_0xb752('0x48')](db[_0xb752('0x61')]['rawAttributes']);_0x513ac2[_0xb752('0x35')]=_[_0xb752('0x48')](_0x1aaae1[_0xb752('0x35')]);_0x513ac2[_0xb752('0x36')]=_[_0xb752('0x37')](_0x513ac2[_0xb752('0x34')],_0x513ac2[_0xb752('0x35')]);_0x5aa045['attributes']=_[_0xb752('0x37')](_0x513ac2[_0xb752('0x34')],qs['fields'](_0x1aaae1[_0xb752('0x35')]['fields']));_0x5aa045[_0xb752('0x39')]=_0x5aa045['attributes'][_0xb752('0x49')]?_0x5aa045['attributes']:_0x513ac2[_0xb752('0x34')];_0x5aa045[_0xb752('0x3c')]=qs[_0xb752('0x3d')](_0x1aaae1[_0xb752('0x35')][_0xb752('0x3d')]);_0x5aa045[_0xb752('0x41')]=qs[_0xb752('0x36')](_[_0xb752('0x3e')](_0x1aaae1['query'],_0x513ac2[_0xb752('0x36')]));if(_0x1aaae1[_0xb752('0x35')]['filter']){_0x5aa045[_0xb752('0x41')]=_['merge'](_0x5aa045['where'],{'$or':_['map'](_0x5aa045[_0xb752('0x39')],function(_0x190277){var _0x5dcef7={};_0x5dcef7[_0x190277]={'$like':'%'+_0x1aaae1['query'][_0xb752('0x3f')]+'%'};return _0x5dcef7;})});}_0x5aa045=_['merge']({},_0x5aa045,_0x1aaae1[_0xb752('0x43')]);return _0xa19a66[_0xb752('0x60')](_0x5aa045);}})['then'](function(_0x1cb823){if(_0x1cb823){_0xe62de8=_0x1cb823[_0xb752('0x49')];if(!_0x1aaae1[_0xb752('0x35')][_0xb752('0x3a')](_0xb752('0x3b'))){_0x5aa045[_0xb752('0x1f')]=qs['limit'](_0x1aaae1[_0xb752('0x35')][_0xb752('0x1f')]);_0x5aa045['offset']=qs['offset'](_0x1aaae1[_0xb752('0x35')]['offset']);}return _0xa19a66[_0xb752('0x60')](_0x5aa045);}})[_0xb752('0x27')](function(_0x39c54d){if(_0x39c54d){return _0x39c54d?{'count':_0xe62de8,'rows':_0x39c54d}:null;}})[_0xb752('0x27')](respondWithResult(_0xa9582,null))['catch'](handleError(_0xa9582,null));};exports[_0xb752('0x62')]=function(_0x2c5a0c,_0x3b57de,_0x14c48c){var _0x3b7971=_0x2c5a0c[_0xb752('0x52')][_0xb752('0x63')];return db[_0xb752('0x61')][_0xb752('0x64')]({'where':{'id':_0x3b7971},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb752('0x65'),'attributes':['id',_0xb752('0x2c'),_0xb752('0x66'),_0xb752('0x67'),_0xb752('0x68')],'raw':!![]}]})[_0xb752('0x27')](function(_0x989379){if(_0x989379){var _0x186c3a=_[_0xb752('0x69')](_0x989379,function(_0x37d515){var _0xf98298=_0x37d515[_0xb752('0x28')]({'plain':!![]});return _0xf98298[_0xb752('0x65')];});return db['OpenchannelQueue'][_0xb752('0x4a')]({'where':{'id':_0x2c5a0c[_0xb752('0x53')]['id']}})[_0xb752('0x27')](function(_0x21b839){return db[_0xb752('0x6a')][_0xb752('0x6b')](function(_0xe5e907){return _0x21b839[_0xb752('0x62')](_0x3b7971,{'transaction':_0xe5e907})[_0xb752('0x27')](function(){return BPromise[_0xb752('0x6c')](_0x186c3a,function(_0x1749bc){return db['UserOpenchannelQueue'][_0xb752('0x6d')]({'where':{'UserId':_0x1749bc['id'],'OpenchannelQueueId':_0x2c5a0c['params']['id']},'transaction':_0xe5e907});});})[_0xb752('0x27')](function(){_0x186c3a[_0xb752('0x6e')](function(_0x3da950){socket[_0xb752('0x6f')](_0xb752('0x70'),{'UserId':_0x3da950['id'],'OpenchannelQueueId':_0x21b839['id']});});});});});}})['then'](respondWithStatusCode(_0x3b57de,null))[_0xb752('0x4b')](handleError(_0x3b57de,null));};exports[_0xb752('0x71')]=function(_0x27e77b,_0x28a065,_0x5043f8){return db[_0xb752('0x61')][_0xb752('0x64')]({'where':{'id':_0x27e77b['query'][_0xb752('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb752('0x65'),'attributes':['id'],'raw':!![]}]})[_0xb752('0x27')](handleEntityNotFound(_0x28a065,null))[_0xb752('0x27')](function(_0x2f612d){var _0x2aa000=_[_0xb752('0x2f')](_0x2f612d,'id');var _0x3ceb8d=[];var _0x4470ae=[];var _0x516741=squel[_0xb752('0x72')]();_0x516741[_0xb752('0x73')](_0xb752('0x74'))[_0xb752('0x75')]('team_has_openchannel_queues','tq')[_0xb752('0x76')](_0xb752('0x77'),'ut',_0xb752('0x78'))['where'](_0xb752('0x79'),_0x27e77b[_0xb752('0x53')]['id']);for(var _0x2b14f4=0x0;_0x2b14f4<_0x2f612d[_0xb752('0x49')];_0x2b14f4+=0x1){let _0x5e6792=_0x2f612d[_0x2b14f4];for(var _0x183628=0x0;_0x183628<_0x5e6792[_0xb752('0x65')][_0xb752('0x49')];_0x183628+=0x1){let _0x511da5=_0x5e6792['Agents'][_0x183628];var _0x2fab41=_0x516741['clone']();_0x2fab41[_0xb752('0x41')](_0xb752('0x7a'),_0x511da5['id']);_0x4470ae[_0xb752('0x7b')](db[_0xb752('0x6a')][_0xb752('0x35')](_0x2fab41[_0xb752('0x7c')](),{'type':db[_0xb752('0x6a')][_0xb752('0x7d')][_0xb752('0x7e')]})[_0xb752('0x27')](function(_0x776050){if(_0x776050[_0xb752('0x49')]===0x1){return _0x511da5['id'];}else{var _0x22ce13=_[_0xb752('0x7f')](_[_0xb752('0x2f')](_0x776050,'TeamId'),function(_0x532868){return _[_0xb752('0x80')](_0x2aa000,_0x532868);});if(_0x22ce13){return _0x511da5['id'];}}}));}}return BPromise['all'](_0x4470ae)[_0xb752('0x27')](function(_0x4d4c85){_0x3ceb8d=_(_0x3ceb8d)['union'](_0x4d4c85)['compact']()[_0xb752('0x81')]();return db[_0xb752('0x30')][_0xb752('0x4a')]({'where':{'id':_0x27e77b[_0xb752('0x53')]['id']}})[_0xb752('0x27')](function(_0x128474){return db[_0xb752('0x6a')][_0xb752('0x6b')](function(_0x447218){return _0x128474[_0xb752('0x71')](_0x27e77b[_0xb752('0x35')][_0xb752('0x63')],{'transaction':_0x447218})['then'](function(){if(!_[_0xb752('0x82')](_0x3ceb8d)){return _0x128474['removeAgents'](_0x3ceb8d,{'transaction':_0x447218});}})[_0xb752('0x27')](function(){_0x3ceb8d[_0xb752('0x6e')](function(_0x261ac1){socket[_0xb752('0x6f')](_0xb752('0x83'),{'UserId':_0x261ac1,'OpenchannelQueueId':_0x128474['id']});});});});});});})['then'](respondWithStatusCode(_0x28a065,null))[_0xb752('0x4b')](handleError(_0x28a065,null));};exports[_0xb752('0x84')]=function(_0x2d917f,_0x4510fa,_0x5d60ef){return db['OpenchannelQueue'][_0xb752('0x4a')]({'where':{'id':_0x2d917f[_0xb752('0x53')]['id']}})[_0xb752('0x27')](handleEntityNotFound(_0x4510fa,null))[_0xb752('0x27')](function(_0x397d07){if(_0x397d07){return _0x397d07[_0xb752('0x84')](_0x2d917f[_0xb752('0x52')][_0xb752('0x63')],_[_0xb752('0x85')](_0x2d917f[_0xb752('0x52')],['ids','id'])||{})['spread'](function(_0x58fabf){for(var _0x224691=0x0;_0x224691<_0x2d917f[_0xb752('0x52')]['ids']['length'];_0x224691+=0x1){socket[_0xb752('0x6f')](_0xb752('0x70'),{'UserId':Number(_0x2d917f['body'][_0xb752('0x63')][_0x224691]),'OpenchannelQueueId':Number(_0x2d917f['params']['id'])});}return _0x58fabf;});}})[_0xb752('0x27')](respondWithResult(_0x4510fa,null))['catch'](handleError(_0x4510fa,null));};exports[_0xb752('0x86')]=function(_0x1ec13e,_0x20c565,_0x20a2e7){return db[_0xb752('0x30')][_0xb752('0x4a')]({'where':{'id':_0x1ec13e[_0xb752('0x53')]['id']}})[_0xb752('0x27')](handleEntityNotFound(_0x20c565,null))[_0xb752('0x27')](function(_0x38c924){if(_0x38c924){return _0x38c924[_0xb752('0x86')](_0x1ec13e[_0xb752('0x35')][_0xb752('0x63')])[_0xb752('0x27')](function(){if(_[_0xb752('0x87')](_0x1ec13e[_0xb752('0x35')][_0xb752('0x63')])){for(var _0x2f27ed=0x0;_0x2f27ed<_0x1ec13e[_0xb752('0x35')][_0xb752('0x63')][_0xb752('0x49')];_0x2f27ed+=0x1){socket[_0xb752('0x6f')](_0xb752('0x83'),{'UserId':Number(_0x1ec13e[_0xb752('0x35')][_0xb752('0x63')][_0x2f27ed]),'OpenchannelQueueId':Number(_0x1ec13e[_0xb752('0x53')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x1ec13e['query']['ids']),'OpenchannelQueueId':Number(_0x1ec13e[_0xb752('0x53')]['id'])});}});}})[_0xb752('0x27')](respondWithStatusCode(_0x20c565,null))[_0xb752('0x4b')](handleError(_0x20c565,null));};exports[_0xb752('0x88')]=function(_0x38ee3a,_0xf1e24,_0x38191f){var _0x4d147c={};var _0x27d312={};var _0x1795b2;var _0x2cd933;return db[_0xb752('0x30')][_0xb752('0x56')]({'where':{'id':_0x38ee3a[_0xb752('0x53')]['id']}})[_0xb752('0x27')](handleEntityNotFound(_0xf1e24,null))['then'](function(_0x136042){if(_0x136042){_0x1795b2=_0x136042;_0x27d312[_0xb752('0x34')]=_['keys'](db['User'][_0xb752('0x31')]);_0x27d312[_0xb752('0x35')]=_['keys'](_0x38ee3a[_0xb752('0x35')]);_0x27d312[_0xb752('0x36')]=_[_0xb752('0x37')](_0x27d312[_0xb752('0x34')],_0x27d312[_0xb752('0x35')]);_0x4d147c[_0xb752('0x39')]=_[_0xb752('0x37')](_0x27d312[_0xb752('0x34')],qs[_0xb752('0x38')](_0x38ee3a['query'][_0xb752('0x38')]));_0x4d147c['attributes']=_0x4d147c[_0xb752('0x39')][_0xb752('0x49')]?_0x4d147c[_0xb752('0x39')]:_0x27d312[_0xb752('0x34')];_0x4d147c[_0xb752('0x3c')]=qs[_0xb752('0x3d')](_0x38ee3a[_0xb752('0x35')][_0xb752('0x3d')]);_0x4d147c[_0xb752('0x41')]=qs['filters'](_['pick'](_0x38ee3a[_0xb752('0x35')],_0x27d312[_0xb752('0x36')]));if(_0x38ee3a[_0xb752('0x35')][_0xb752('0x3f')]){_0x4d147c[_0xb752('0x41')]=_[_0xb752('0x40')](_0x4d147c['where'],{'$or':_[_0xb752('0x2f')](_0x4d147c['attributes'],function(_0x13349b){var _0x109871={};_0x109871[_0x13349b]={'$like':'%'+_0x38ee3a['query'][_0xb752('0x3f')]+'%'};return _0x109871;})});}_0x4d147c=_[_0xb752('0x40')]({},_0x4d147c,_0x38ee3a[_0xb752('0x43')]);return _0x1795b2[_0xb752('0x88')](_0x4d147c);}})[_0xb752('0x27')](function(_0x16542f){if(_0x16542f){_0x2cd933=_0x16542f[_0xb752('0x49')];if(!_0x38ee3a['query'][_0xb752('0x3a')]('nolimit')){_0x4d147c[_0xb752('0x1f')]=qs[_0xb752('0x1f')](_0x38ee3a[_0xb752('0x35')]['limit']);_0x4d147c[_0xb752('0x1c')]=qs[_0xb752('0x1c')](_0x38ee3a[_0xb752('0x35')][_0xb752('0x1c')]);}return _0x1795b2['getAgents'](_0x4d147c);}})[_0xb752('0x27')](function(_0x1c92c0){if(_0x1c92c0){return _0x1c92c0?{'count':_0x2cd933,'rows':_0x1c92c0}:null;}})[_0xb752('0x27')](respondWithResult(_0xf1e24,null))['catch'](handleError(_0xf1e24,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 86cc2b9..d0352c0 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 _0x05ba=['hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','update','emit'];(function(_0x24aadb,_0x239998){var _0x9e2ccf=function(_0xc7c5e1){while(--_0xc7c5e1){_0x24aadb['push'](_0x24aadb['shift']());}};_0x9e2ccf(++_0x239998);}(_0x05ba,0xea));var _0xa05b=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x05ba[_0xef4cf0];return _0x497ad2;};'use strict';var EventEmitter=require(_0xa05b('0x0'));var OpenchannelQueue=require(_0xa05b('0x1'))['db'][_0xa05b('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa05b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa05b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x449311){return function(_0x2b0ea4,_0x5bf6a1,_0x5a6c61){OpenchannelQueueEvents[_0xa05b('0x5')](_0x449311+':'+_0x2b0ea4['id'],_0x2b0ea4);OpenchannelQueueEvents[_0xa05b('0x5')](_0x449311,_0x2b0ea4);_0x5a6c61(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xa05b('0x6')](e,emitEvent(event));}}module[_0xa05b('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x8152=['hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners','update','remove','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8152,0x81));var _0x2815=function(_0x100e19,_0x3c9a36){_0x100e19=_0x100e19-0x0;var _0x2000ae=_0x8152[_0x100e19];return _0x2000ae;};'use strict';var EventEmitter=require(_0x2815('0x0'));var OpenchannelQueue=require(_0x2815('0x1'))['db'][_0x2815('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2815('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2815('0x4'),'afterDestroy':_0x2815('0x5')};function emitEvent(_0x1a183f){return function(_0x5117c1,_0x48094d,_0x41448d){OpenchannelQueueEvents['emit'](_0x1a183f+':'+_0x5117c1['id'],_0x5117c1);OpenchannelQueueEvents[_0x2815('0x6')](_0x1a183f,_0x5117c1);_0x41448d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x2815('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 096e580..bcbc8e5 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 _0x96b0=['request-promise','path','rimraf','../../config/environment','exports','define','util','../../config/logger','api','bluebird'];(function(_0x1d0458,_0x389f29){var _0x35eea4=function(_0x181770){while(--_0x181770){_0x1d0458['push'](_0x1d0458['shift']());}};_0x35eea4(++_0x389f29);}(_0x96b0,0xba));var _0x096b=function(_0xdf6067,_0x9a09b6){_0xdf6067=_0xdf6067-0x0;var _0x5370c8=_0x96b0[_0xdf6067];return _0x5370c8;};'use strict';var _=require('lodash');var util=require(_0x096b('0x0'));var logger=require(_0x096b('0x1'))(_0x096b('0x2'));var moment=require('moment');var BPromise=require(_0x096b('0x3'));var rp=require(_0x096b('0x4'));var fs=require('fs');var path=require(_0x096b('0x5'));var rimraf=require(_0x096b('0x6'));var config=require(_0x096b('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x096b('0x8')]=function(_0x1b0030,_0x22ce45){return _0x1b0030[_0x096b('0x9')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe3f=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe3f,0x108));var _0xffe3=function(_0x50a905,_0x3b16da){_0x50a905=_0x50a905-0x0;var _0x36ea13=_0xfe3f[_0x50a905];return _0x36ea13;};'use strict';var _=require(_0xffe3('0x0'));var util=require('util');var logger=require(_0xffe3('0x1'))(_0xffe3('0x2'));var moment=require('moment');var BPromise=require(_0xffe3('0x3'));var rp=require(_0xffe3('0x4'));var fs=require('fs');var path=require(_0xffe3('0x5'));var rimraf=require(_0xffe3('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module[_0xffe3('0x7')]=function(_0x2c4c0c,_0x562195){return _0x2c4c0c[_0xffe3('0x8')](_0xffe3('0x9'),attributes,{'tableName':_0xffe3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 49b02f4..02c8bb4 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 _0x672e=['localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowOpenchannelQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x2c24e7,_0x1fe744){var _0x432423=function(_0x14251c){while(--_0x14251c){_0x2c24e7['push'](_0x2c24e7['shift']());}};_0x432423(++_0x1fe744);}(_0x672e,0x111));var _0xe672=function(_0x3c4033,_0x50863a){_0x3c4033=_0x3c4033-0x0;var _0x4818f8=_0x672e[_0x3c4033];return _0x4818f8;};'use strict';var _=require(_0xe672('0x0'));var util=require(_0xe672('0x1'));var moment=require(_0xe672('0x2'));var BPromise=require('bluebird');var rs=require(_0xe672('0x3'));var fs=require('fs');var Redis=require(_0xe672('0x4'));var db=require(_0xe672('0x5'))['db'];var utils=require(_0xe672('0x6'));var logger=require('../../config/logger')(_0xe672('0x7'));var config=require(_0xe672('0x8'));var jayson=require(_0xe672('0x9'));var client=jayson[_0xe672('0xa')][_0xe672('0xb')]({'port':0x232a});config[_0xe672('0xc')]=_[_0xe672('0xd')](config[_0xe672('0xc')],{'host':_0xe672('0xe'),'port':0x18eb});var socket=require(_0xe672('0xf'))(new Redis(config[_0xe672('0xc')]));require(_0xe672('0x10'))[_0xe672('0x11')](socket);function respondWithRpcPromise(_0x24469f,_0x56e808,_0x17eb05){return new BPromise(function(_0x5862ac,_0x1a98ca){return client['request'](_0x24469f,_0x17eb05)[_0xe672('0x12')](function(_0x39294f){logger[_0xe672('0x13')](_0xe672('0x14'),_0x56e808,_0xe672('0x15'));logger['debug'](_0xe672('0x16'),_0x56e808,_0xe672('0x15'),JSON[_0xe672('0x17')](_0x39294f));if(_0x39294f[_0xe672('0x18')]){if(_0x39294f[_0xe672('0x18')]['code']===0x1f4){logger['error'](_0xe672('0x14'),_0x56e808,_0x39294f['error']['message']);return _0x1a98ca(_0x39294f[_0xe672('0x18')][_0xe672('0x19')]);}logger[_0xe672('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x56e808,_0x39294f[_0xe672('0x18')][_0xe672('0x19')]);return _0x5862ac(_0x39294f['error'][_0xe672('0x19')]);}else{logger[_0xe672('0x13')](_0xe672('0x14'),_0x56e808,_0xe672('0x15'));_0x5862ac(_0x39294f['result'][_0xe672('0x19')]);}})[_0xe672('0x1a')](function(_0x57e477){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x56e808,_0x57e477);_0x1a98ca(_0x57e477);});});}exports[_0xe672('0x1b')]=function(_0x5567fe){var _0x3be519=this;return new Promise(function(_0x538eed,_0x4f2a8e){return db[_0xe672('0x1c')][_0xe672('0x1d')]({'raw':_0x5567fe['options']?_0x5567fe[_0xe672('0x1e')][_0xe672('0x1f')]===undefined?!![]:![]:!![],'where':_0x5567fe[_0xe672('0x1e')]?_0x5567fe[_0xe672('0x1e')][_0xe672('0x20')]||null:null,'attributes':_0x5567fe[_0xe672('0x1e')]?_0x5567fe[_0xe672('0x1e')][_0xe672('0x21')]||null:null,'limit':_0x5567fe['options']?_0x5567fe[_0xe672('0x1e')][_0xe672('0x22')]||null:null,'include':_0x5567fe['options']?_0x5567fe[_0xe672('0x1e')][_0xe672('0x23')]?_[_0xe672('0x24')](_0x5567fe[_0xe672('0x1e')][_0xe672('0x23')],function(_0x136c38){return{'model':db[_0x136c38['model']],'as':_0x136c38['as'],'attributes':_0x136c38[_0xe672('0x21')],'include':_0x136c38[_0xe672('0x23')]?_[_0xe672('0x24')](_0x136c38[_0xe672('0x23')],function(_0x433423){return{'model':db[_0x433423[_0xe672('0x25')]],'as':_0x433423['as'],'attributes':_0x433423[_0xe672('0x21')],'include':_0x433423['include']?_[_0xe672('0x24')](_0x433423[_0xe672('0x23')],function(_0x1e4863){return{'model':db[_0x1e4863[_0xe672('0x25')]],'as':_0x1e4863['as'],'attributes':_0x1e4863['attributes']};}):[]};}):[]};}):[]:[]})[_0xe672('0x12')](function(_0x120168){logger[_0xe672('0x13')](_0xe672('0x1b'),_0x5567fe);logger[_0xe672('0x26')](_0xe672('0x1b'),_0x5567fe,JSON[_0xe672('0x17')](_0x120168));_0x538eed(_0x120168);})[_0xe672('0x1a')](function(_0xb6c1b5){logger[_0xe672('0x18')](_0xe672('0x1b'),_0xb6c1b5[_0xe672('0x19')],_0x5567fe);_0x4f2a8e(_0x3be519[_0xe672('0x18')](0x1f4,_0xb6c1b5['message']));});});};exports[_0xe672('0x27')]=function(_0x3775fb){var _0x40b877=this;return new Promise(function(_0x170c82,_0x18a9e8){return db[_0xe672('0x1c')][_0xe672('0x28')]({'raw':_0x3775fb['options']?_0x3775fb[_0xe672('0x1e')][_0xe672('0x1f')]===undefined?!![]:![]:!![],'where':_0x3775fb[_0xe672('0x1e')]?_0x3775fb[_0xe672('0x1e')][_0xe672('0x20')]||null:null,'attributes':_0x3775fb[_0xe672('0x1e')]?_0x3775fb[_0xe672('0x1e')][_0xe672('0x21')]||null:null,'include':_0x3775fb[_0xe672('0x1e')]?_0x3775fb['options']['include']?_[_0xe672('0x24')](_0x3775fb[_0xe672('0x1e')]['include'],function(_0x241312){return{'model':db[_0x241312[_0xe672('0x25')]],'as':_0x241312['as'],'attributes':_0x241312[_0xe672('0x21')],'include':_0x241312[_0xe672('0x23')]?_[_0xe672('0x24')](_0x241312[_0xe672('0x23')],function(_0x32817f){return{'model':db[_0x32817f[_0xe672('0x25')]],'as':_0x32817f['as'],'attributes':_0x32817f['attributes'],'include':_0x32817f[_0xe672('0x23')]?_[_0xe672('0x24')](_0x32817f[_0xe672('0x23')],function(_0x2a04f7){return{'model':db[_0x2a04f7[_0xe672('0x25')]],'as':_0x2a04f7['as'],'attributes':_0x2a04f7[_0xe672('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe672('0x12')](function(_0x16db71){logger[_0xe672('0x13')]('ShowOpenchannelQueue',_0x3775fb);logger['debug']('ShowOpenchannelQueue',_0x3775fb,JSON[_0xe672('0x17')](_0x16db71));_0x170c82(_0x16db71);})['catch'](function(_0x213808){logger[_0xe672('0x18')](_0xe672('0x27'),_0x213808[_0xe672('0x19')],_0x3775fb);_0x18a9e8(_0x40b877[_0xe672('0x18')](0x1f4,_0x213808['message']));});});}; \ No newline at end of file +var _0x621f=['util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowOpenchannelQueue','find','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x621f,0x1d3));var _0xf621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x621f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf621('0x0'));var util=require(_0xf621('0x1'));var moment=require(_0xf621('0x2'));var BPromise=require('bluebird');var rs=require(_0xf621('0x3'));var fs=require('fs');var Redis=require(_0xf621('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf621('0x5'))(_0xf621('0x6'));var config=require(_0xf621('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf621('0x8')]['http']({'port':0x232a});config['redis']=_[_0xf621('0x9')](config[_0xf621('0xa')],{'host':_0xf621('0xb'),'port':0x18eb});var socket=require(_0xf621('0xc'))(new Redis(config[_0xf621('0xa')]));require(_0xf621('0xd'))[_0xf621('0xe')](socket);function respondWithRpcPromise(_0x220bbf,_0x18e98e,_0x363fc6){return new BPromise(function(_0x4b0fb5,_0x589b5a){return client[_0xf621('0xf')](_0x220bbf,_0x363fc6)[_0xf621('0x10')](function(_0xeb9f67){logger[_0xf621('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x18e98e,'request\x20sent');logger[_0xf621('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x18e98e,_0xf621('0x13'),JSON[_0xf621('0x14')](_0xeb9f67));if(_0xeb9f67[_0xf621('0x15')]){if(_0xeb9f67['error'][_0xf621('0x16')]===0x1f4){logger[_0xf621('0x15')](_0xf621('0x17'),_0x18e98e,_0xeb9f67['error'][_0xf621('0x18')]);return _0x589b5a(_0xeb9f67[_0xf621('0x15')][_0xf621('0x18')]);}logger[_0xf621('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x18e98e,_0xeb9f67[_0xf621('0x15')][_0xf621('0x18')]);return _0x4b0fb5(_0xeb9f67[_0xf621('0x15')]['message']);}else{logger[_0xf621('0x11')](_0xf621('0x17'),_0x18e98e,'request\x20sent');_0x4b0fb5(_0xeb9f67[_0xf621('0x19')][_0xf621('0x18')]);}})[_0xf621('0x1a')](function(_0x29a69c){logger[_0xf621('0x15')](_0xf621('0x17'),_0x18e98e,_0x29a69c);_0x589b5a(_0x29a69c);});});}exports[_0xf621('0x1b')]=function(_0x1e97f2){var _0x1eafd3=this;return new Promise(function(_0x30423a,_0xb7889d){return db['OpenchannelQueue'][_0xf621('0x1c')]({'raw':_0x1e97f2['options']?_0x1e97f2[_0xf621('0x1d')][_0xf621('0x1e')]===undefined?!![]:![]:!![],'where':_0x1e97f2['options']?_0x1e97f2[_0xf621('0x1d')][_0xf621('0x1f')]||null:null,'attributes':_0x1e97f2[_0xf621('0x1d')]?_0x1e97f2[_0xf621('0x1d')][_0xf621('0x20')]||null:null,'limit':_0x1e97f2[_0xf621('0x1d')]?_0x1e97f2[_0xf621('0x1d')][_0xf621('0x21')]||null:null,'include':_0x1e97f2[_0xf621('0x1d')]?_0x1e97f2[_0xf621('0x1d')][_0xf621('0x22')]?_['map'](_0x1e97f2[_0xf621('0x1d')][_0xf621('0x22')],function(_0x17a1f5){return{'model':db[_0x17a1f5[_0xf621('0x23')]],'as':_0x17a1f5['as'],'attributes':_0x17a1f5['attributes'],'include':_0x17a1f5['include']?_[_0xf621('0x24')](_0x17a1f5[_0xf621('0x22')],function(_0x74597d){return{'model':db[_0x74597d[_0xf621('0x23')]],'as':_0x74597d['as'],'attributes':_0x74597d[_0xf621('0x20')],'include':_0x74597d[_0xf621('0x22')]?_['map'](_0x74597d[_0xf621('0x22')],function(_0x115ffe){return{'model':db[_0x115ffe[_0xf621('0x23')]],'as':_0x115ffe['as'],'attributes':_0x115ffe[_0xf621('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf621('0x10')](function(_0x53385a){logger['info'](_0xf621('0x1b'),_0x1e97f2);logger[_0xf621('0x12')]('GetOpenchannelQueue',_0x1e97f2,JSON['stringify'](_0x53385a));_0x30423a(_0x53385a);})[_0xf621('0x1a')](function(_0x83eb73){logger[_0xf621('0x15')](_0xf621('0x1b'),_0x83eb73['message'],_0x1e97f2);_0xb7889d(_0x1eafd3[_0xf621('0x15')](0x1f4,_0x83eb73['message']));});});};exports[_0xf621('0x25')]=function(_0x53f6bf){var _0x44040c=this;return new Promise(function(_0x9f109a,_0x34282d){return db['OpenchannelQueue'][_0xf621('0x26')]({'raw':_0x53f6bf[_0xf621('0x1d')]?_0x53f6bf['options'][_0xf621('0x1e')]===undefined?!![]:![]:!![],'where':_0x53f6bf[_0xf621('0x1d')]?_0x53f6bf['options'][_0xf621('0x1f')]||null:null,'attributes':_0x53f6bf[_0xf621('0x1d')]?_0x53f6bf[_0xf621('0x1d')][_0xf621('0x20')]||null:null,'include':_0x53f6bf[_0xf621('0x1d')]?_0x53f6bf['options'][_0xf621('0x22')]?_[_0xf621('0x24')](_0x53f6bf[_0xf621('0x1d')]['include'],function(_0x2ecde5){return{'model':db[_0x2ecde5[_0xf621('0x23')]],'as':_0x2ecde5['as'],'attributes':_0x2ecde5[_0xf621('0x20')],'include':_0x2ecde5[_0xf621('0x22')]?_['map'](_0x2ecde5[_0xf621('0x22')],function(_0x34d1dd){return{'model':db[_0x34d1dd[_0xf621('0x23')]],'as':_0x34d1dd['as'],'attributes':_0x34d1dd['attributes'],'include':_0x34d1dd['include']?_['map'](_0x34d1dd[_0xf621('0x22')],function(_0x5c27da){return{'model':db[_0x5c27da[_0xf621('0x23')]],'as':_0x5c27da['as'],'attributes':_0x5c27da[_0xf621('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf621('0x10')](function(_0x2b154a){logger[_0xf621('0x11')](_0xf621('0x25'),_0x53f6bf);logger[_0xf621('0x12')]('ShowOpenchannelQueue',_0x53f6bf,JSON['stringify'](_0x2b154a));_0x9f109a(_0x2b154a);})[_0xf621('0x1a')](function(_0x43aac8){logger['error'](_0xf621('0x25'),_0x43aac8[_0xf621('0x18')],_0x53f6bf);_0x34282d(_0x44040c[_0xf621('0x15')](0x1f4,_0x43aac8[_0xf621('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 74afd41..88e5dc2 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 _0x0907=['openchannelQueue:','save','update','emit','removeListener','length'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x0907,0x181));var _0x7090=function(_0x565afa,_0x2ddc58){_0x565afa=_0x565afa-0x0;var _0x1e85fe=_0x0907[_0x565afa];return _0x1e85fe;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x7090('0x0'),'remove',_0x7090('0x1')];function createListener(_0x150062,_0x10dc37){return function(_0x43e2f6){_0x10dc37[_0x7090('0x2')](_0x150062,_0x43e2f6);};}function removeListener(_0x294242,_0x99bbf0){return function(){OpenchannelQueueEvents[_0x7090('0x3')](_0x294242,_0x99bbf0);};}exports['register']=function(_0x9e1f32){for(var _0xa65a6c=0x0,_0x5e33da=events[_0x7090('0x4')];_0xa65a6c<_0x5e33da;_0xa65a6c++){var _0x350a1b=events[_0xa65a6c];var _0x4200ad=createListener(_0x7090('0x5')+_0x350a1b,_0x9e1f32);OpenchannelQueueEvents['on'](_0x350a1b,_0x4200ad);}}; \ No newline at end of file +var _0x969d=['removeListener','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit'];(function(_0x50792d,_0x3ac0da){var _0x19cf5d=function(_0x4e914){while(--_0x4e914){_0x50792d['push'](_0x50792d['shift']());}};_0x19cf5d(++_0x3ac0da);}(_0x969d,0xf7));var _0xd969=function(_0x2b9fbf,_0x32600d){_0x2b9fbf=_0x2b9fbf-0x0;var _0x319289=_0x969d[_0x2b9fbf];return _0x319289;};'use strict';var OpenchannelQueueEvents=require(_0xd969('0x0'));var events=[_0xd969('0x1'),_0xd969('0x2'),_0xd969('0x3')];function createListener(_0x599450,_0x291589){return function(_0x4a56c4){_0x291589[_0xd969('0x4')](_0x599450,_0x4a56c4);};}function removeListener(_0x5139f0,_0x5443a2){return function(){OpenchannelQueueEvents[_0xd969('0x5')](_0x5139f0,_0x5443a2);};}exports['register']=function(_0x5a2d42){for(var _0x2e1b2a=0x0,_0x46ffc2=events['length'];_0x2e1b2a<_0x46ffc2;_0x2e1b2a++){var _0x106f36=events[_0x2e1b2a];var _0xded38a=createListener(_0xd969('0x6')+_0x106f36,_0x5a2d42);OpenchannelQueueEvents['on'](_0x106f36,_0xded38a);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 8cbce9c..eaed3f0 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 _0x747a=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','describe','/:id','show','create'];(function(_0x26746c,_0x1808b6){var _0x568f10=function(_0x438360){while(--_0x438360){_0x26746c['push'](_0x26746c['shift']());}};_0x568f10(++_0x1808b6);}(_0x747a,0x109));var _0xa747=function(_0x505473,_0x358249){_0x505473=_0x505473-0x0;var _0x1c466d=_0x747a[_0x505473];return _0x1c466d;};'use strict';var multer=require('multer');var util=require(_0xa747('0x0'));var path=require(_0xa747('0x1'));var timeout=require(_0xa747('0x2'));var express=require(_0xa747('0x3'));var router=express[_0xa747('0x4')]();var fs_extra=require(_0xa747('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa747('0x6'));var config=require(_0xa747('0x7'));var controller=require(_0xa747('0x8'));router[_0xa747('0x9')]('/',auth[_0xa747('0xa')](),controller['index']);router[_0xa747('0x9')]('/describe',auth[_0xa747('0xa')](),controller[_0xa747('0xb')]);router[_0xa747('0x9')](_0xa747('0xc'),auth['isAuthenticated'](),controller[_0xa747('0xd')]);router['post']('/',auth[_0xa747('0xa')](),controller[_0xa747('0xe')]);router[_0xa747('0xf')](_0xa747('0xc'),auth[_0xa747('0xa')](),controller[_0xa747('0x10')]);router[_0xa747('0x11')](_0xa747('0xc'),auth[_0xa747('0xa')](),controller[_0xa747('0x12')]);module[_0xa747('0x13')]=router; \ No newline at end of file +var _0x21bf=['multer','util','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','post','create','put','delete','/:id','destroy','exports'];(function(_0x5b29ad,_0x5e9074){var _0x39cd19=function(_0x47a991){while(--_0x47a991){_0x5b29ad['push'](_0x5b29ad['shift']());}};_0x39cd19(++_0x5e9074);}(_0x21bf,0x17c));var _0xf21b=function(_0x40b508,_0x40ae66){_0x40b508=_0x40b508-0x0;var _0x7772c7=_0x21bf[_0x40b508];return _0x7772c7;};'use strict';var multer=require(_0xf21b('0x0'));var util=require(_0xf21b('0x1'));var path=require('path');var timeout=require(_0xf21b('0x2'));var express=require(_0xf21b('0x3'));var router=express[_0xf21b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf21b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelQueueReport.controller');router[_0xf21b('0x6')]('/',auth[_0xf21b('0x7')](),controller[_0xf21b('0x8')]);router[_0xf21b('0x6')](_0xf21b('0x9'),auth[_0xf21b('0x7')](),controller[_0xf21b('0xa')]);router[_0xf21b('0x6')]('/:id',auth[_0xf21b('0x7')](),controller[_0xf21b('0xb')]);router[_0xf21b('0xc')]('/',auth[_0xf21b('0x7')](),controller[_0xf21b('0xd')]);router[_0xf21b('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf21b('0xf')](_0xf21b('0x10'),auth[_0xf21b('0x7')](),controller[_0xf21b('0x11')]);module[_0xf21b('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index a6b403b..82430d2 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 _0xbaad=['DATE','moment','sequelize','exports','STRING'];(function(_0x1975b8,_0x1d3f2c){var _0x5042c9=function(_0x498988){while(--_0x498988){_0x1975b8['push'](_0x1975b8['shift']());}};_0x5042c9(++_0x1d3f2c);}(_0xbaad,0x1e6));var _0xdbaa=function(_0x2000ce,_0x22dc45){_0x2000ce=_0x2000ce-0x0;var _0x180ffe=_0xbaad[_0x2000ce];return _0x180ffe;};'use strict';var moment=require(_0xdbaa('0x0'));var Sequelize=require(_0xdbaa('0x1'));module[_0xdbaa('0x2')]={'uniqueid':{'type':Sequelize[_0xdbaa('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xdbaa('0x3')]},'joinAt':{'type':Sequelize[_0xdbaa('0x4')]},'leaveAt':{'type':Sequelize[_0xdbaa('0x4')]},'acceptAt':{'type':Sequelize[_0xdbaa('0x4')]},'exitAt':{'type':Sequelize[_0xdbaa('0x4')]},'reason':{'type':Sequelize[_0xdbaa('0x3')]}}; \ No newline at end of file +var _0x0a0e=['DATE','moment','sequelize','exports','STRING'];(function(_0x568a61,_0x2124f8){var _0x334c3b=function(_0x1afc39){while(--_0x1afc39){_0x568a61['push'](_0x568a61['shift']());}};_0x334c3b(++_0x2124f8);}(_0x0a0e,0x1cd));var _0xe0a0=function(_0x481471,_0x26356b){_0x481471=_0x481471-0x0;var _0x1e92e0=_0x0a0e[_0x481471];return _0x1e92e0;};'use strict';var moment=require(_0xe0a0('0x0'));var Sequelize=require(_0xe0a0('0x1'));module[_0xe0a0('0x2')]={'uniqueid':{'type':Sequelize[_0xe0a0('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe0a0('0x4')]},'leaveAt':{'type':Sequelize[_0xe0a0('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe0a0('0x4')]},'reason':{'type':Sequelize[_0xe0a0('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 79467b7..116a4ba 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 _0x79e3=['map','OpenchannelQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','error','stack','name','send','index'];(function(_0x1a968e,_0x3f45f4){var _0x2c7b23=function(_0xc1e5c4){while(--_0xc1e5c4){_0x1a968e['push'](_0x1a968e['shift']());}};_0x2c7b23(++_0x3f45f4);}(_0x79e3,0x18b));var _0x379e=function(_0x23ffed,_0x2411c3){_0x23ffed=_0x23ffed-0x0;var _0x48c5fc=_0x79e3[_0x23ffed];return _0x48c5fc;};'use strict';var emlformat=require(_0x379e('0x0'));var rimraf=require(_0x379e('0x1'));var zipdir=require(_0x379e('0x2'));var jsonpatch=require(_0x379e('0x3'));var rp=require(_0x379e('0x4'));var moment=require(_0x379e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x379e('0x6'));var path=require(_0x379e('0x7'));var sox=require('sox');var csv=require(_0x379e('0x8'));var ejs=require(_0x379e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x379e('0xa'));var squel=require('squel');var crypto=require(_0x379e('0xb'));var jsforce=require(_0x379e('0xc'));var deskjs=require(_0x379e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x379e('0xe'));var Papa=require('papaparse');var Redis=require(_0x379e('0xf'));var authService=require(_0x379e('0x10'));var qs=require(_0x379e('0x11'));var as=require(_0x379e('0x12'));var hardwareService=require(_0x379e('0x13'));var logger=require('../../config/logger')(_0x379e('0x14'));var utils=require(_0x379e('0x15'));var config=require(_0x379e('0x16'));var licenseUtil=require(_0x379e('0x17'));var db=require(_0x379e('0x18'))['db'];function respondWithStatusCode(_0x9b687c,_0x1ad9c8){_0x1ad9c8=_0x1ad9c8||0xcc;return function(_0x4525d8){if(_0x4525d8){return _0x9b687c[_0x379e('0x19')](_0x1ad9c8);}return _0x9b687c[_0x379e('0x1a')](_0x1ad9c8)[_0x379e('0x1b')]();};}function respondWithResult(_0x5b5460,_0x1ec821){_0x1ec821=_0x1ec821||0xc8;return function(_0x52e25a){if(_0x52e25a){return _0x5b5460[_0x379e('0x1a')](_0x1ec821)[_0x379e('0x1c')](_0x52e25a);}};}function respondWithFilteredResult(_0x4b47fc,_0x5093b2){return function(_0x580ebf){if(_0x580ebf){var _0xda904b=typeof _0x5093b2[_0x379e('0x1d')]===_0x379e('0x1e')&&typeof _0x5093b2[_0x379e('0x1f')]===_0x379e('0x1e');var _0x515412=_0x580ebf[_0x379e('0x20')];var _0x4adb63=_0xda904b?0x0:_0x5093b2[_0x379e('0x1d')];var _0x3a94f7=_0xda904b?_0x580ebf[_0x379e('0x20')]:_0x5093b2[_0x379e('0x1d')]+_0x5093b2[_0x379e('0x1f')];var _0x4073a6;if(_0x3a94f7>=_0x515412){_0x3a94f7=_0x515412;_0x4073a6=0xc8;}else{_0x4073a6=0xce;}_0x4b47fc[_0x379e('0x1a')](_0x4073a6);return _0x4b47fc['set'](_0x379e('0x21'),_0x4adb63+'-'+_0x3a94f7+'/'+_0x515412)[_0x379e('0x1c')](_0x580ebf);}return null;};}function patchUpdates(_0x50aa4b){return function(_0x32a49c){try{jsonpatch['apply'](_0x32a49c,_0x50aa4b,!![]);}catch(_0x356960){return BPromise[_0x379e('0x22')](_0x356960);}return _0x32a49c[_0x379e('0x23')]();};}function saveUpdates(_0x4136a3,_0x31cd81){return function(_0x223315){if(_0x223315){return _0x223315['update'](_0x4136a3)[_0x379e('0x24')](function(_0x5d905d){return _0x5d905d;});}return null;};}function removeEntity(_0x30d009,_0x243f51){return function(_0x54bc41){if(_0x54bc41){return _0x54bc41[_0x379e('0x25')]()[_0x379e('0x24')](function(){_0x30d009[_0x379e('0x1a')](0xcc)[_0x379e('0x1b')]();});}};}function handleEntityNotFound(_0x4f910b,_0x2294df){return function(_0xf78403){if(!_0xf78403){_0x4f910b[_0x379e('0x19')](0x194);}return _0xf78403;};}function handleError(_0xc6074c,_0x26ef93){_0x26ef93=_0x26ef93||0x1f4;return function(_0x567084){logger[_0x379e('0x26')](_0x567084[_0x379e('0x27')]);if(_0x567084[_0x379e('0x28')]){delete _0x567084[_0x379e('0x28')];}_0xc6074c[_0x379e('0x1a')](_0x26ef93)[_0x379e('0x29')](_0x567084);};}exports[_0x379e('0x2a')]=function(_0x281a12,_0x24e412){var _0x6ba21c={},_0x28e1bd={},_0x44e194={'count':0x0,'rows':[]};var _0x433317=_[_0x379e('0x2b')](db[_0x379e('0x2c')]['rawAttributes'],function(_0x284eb8){return{'name':_0x284eb8[_0x379e('0x2d')],'type':_0x284eb8[_0x379e('0x2e')][_0x379e('0x2f')]};});_0x28e1bd[_0x379e('0x30')]=_[_0x379e('0x2b')](_0x433317,_0x379e('0x28'));_0x28e1bd[_0x379e('0x31')]=_[_0x379e('0x32')](_0x281a12[_0x379e('0x31')]);_0x28e1bd[_0x379e('0x33')]=_['intersection'](_0x28e1bd[_0x379e('0x30')],_0x28e1bd[_0x379e('0x31')]);_0x6ba21c[_0x379e('0x34')]=_[_0x379e('0x35')](_0x28e1bd['model'],qs['fields'](_0x281a12[_0x379e('0x31')][_0x379e('0x36')]));_0x6ba21c[_0x379e('0x34')]=_0x6ba21c['attributes'][_0x379e('0x37')]?_0x6ba21c[_0x379e('0x34')]:_0x28e1bd[_0x379e('0x30')];if(!_0x281a12[_0x379e('0x31')][_0x379e('0x38')](_0x379e('0x39'))){_0x6ba21c[_0x379e('0x1f')]=qs[_0x379e('0x1f')](_0x281a12[_0x379e('0x31')][_0x379e('0x1f')]);_0x6ba21c[_0x379e('0x1d')]=qs[_0x379e('0x1d')](_0x281a12[_0x379e('0x31')]['offset']);}_0x6ba21c['order']=qs[_0x379e('0x3a')](_0x281a12['query'][_0x379e('0x3a')]);_0x6ba21c[_0x379e('0x3b')]=qs['filters'](_[_0x379e('0x3c')](_0x281a12[_0x379e('0x31')],_0x28e1bd[_0x379e('0x33')]),_0x433317);if(_0x281a12[_0x379e('0x31')][_0x379e('0x3d')]){_0x6ba21c['where']=_['merge'](_0x6ba21c[_0x379e('0x3b')],{'$or':_[_0x379e('0x2b')](_0x433317,function(_0x2427e7){if(_0x2427e7[_0x379e('0x2e')]!=='VIRTUAL'){var _0x3836d4={};_0x3836d4[_0x2427e7[_0x379e('0x28')]]={'$like':'%'+_0x281a12[_0x379e('0x31')]['filter']+'%'};return _0x3836d4;}})});}_0x6ba21c=_[_0x379e('0x3e')]({},_0x6ba21c,_0x281a12['options']);var _0x391310={'where':_0x6ba21c[_0x379e('0x3b')]};return db[_0x379e('0x2c')][_0x379e('0x20')](_0x391310)[_0x379e('0x24')](function(_0x10c34d){_0x44e194[_0x379e('0x20')]=_0x10c34d;if(_0x281a12[_0x379e('0x31')][_0x379e('0x3f')]){_0x6ba21c[_0x379e('0x40')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x6ba21c);})[_0x379e('0x24')](function(_0x3c0a23){_0x44e194['rows']=_0x3c0a23;return _0x44e194;})[_0x379e('0x24')](respondWithFilteredResult(_0x24e412,_0x6ba21c))[_0x379e('0x41')](handleError(_0x24e412,null));};exports[_0x379e('0x42')]=function(_0x1ff994,_0x37f82b){var _0x9937b7={'raw':!![],'where':{'id':_0x1ff994[_0x379e('0x43')]['id']}},_0x524507={};_0x524507[_0x379e('0x30')]=_[_0x379e('0x32')](db[_0x379e('0x2c')][_0x379e('0x44')]);_0x524507['query']=_[_0x379e('0x32')](_0x1ff994[_0x379e('0x31')]);_0x524507[_0x379e('0x33')]=_[_0x379e('0x35')](_0x524507[_0x379e('0x30')],_0x524507['query']);_0x9937b7[_0x379e('0x34')]=_[_0x379e('0x35')](_0x524507['model'],qs[_0x379e('0x36')](_0x1ff994[_0x379e('0x31')][_0x379e('0x36')]));_0x9937b7[_0x379e('0x34')]=_0x9937b7[_0x379e('0x34')]['length']?_0x9937b7[_0x379e('0x34')]:_0x524507['model'];if(_0x1ff994[_0x379e('0x31')][_0x379e('0x3f')]){_0x9937b7[_0x379e('0x40')]=[{'all':!![]}];}_0x9937b7=_[_0x379e('0x3e')]({},_0x9937b7,_0x1ff994['options']);return db[_0x379e('0x2c')][_0x379e('0x45')](_0x9937b7)['then'](handleEntityNotFound(_0x37f82b,null))[_0x379e('0x24')](respondWithResult(_0x37f82b,null))[_0x379e('0x41')](handleError(_0x37f82b,null));};exports[_0x379e('0x46')]=function(_0x409359,_0x4392c4){return db[_0x379e('0x2c')][_0x379e('0x46')](_0x409359[_0x379e('0x47')],{})[_0x379e('0x24')](respondWithResult(_0x4392c4,0xc9))[_0x379e('0x41')](handleError(_0x4392c4,null));};exports['update']=function(_0x335e13,_0x32d1e0){if(_0x335e13[_0x379e('0x47')]['id']){delete _0x335e13['body']['id'];}return db['OpenchannelQueueReport'][_0x379e('0x45')]({'where':{'id':_0x335e13['params']['id']}})[_0x379e('0x24')](handleEntityNotFound(_0x32d1e0,null))[_0x379e('0x24')](saveUpdates(_0x335e13[_0x379e('0x47')],null))[_0x379e('0x24')](respondWithResult(_0x32d1e0,null))[_0x379e('0x41')](handleError(_0x32d1e0,null));};exports[_0x379e('0x25')]=function(_0x3ad2cf,_0x3f62c8){return db[_0x379e('0x2c')][_0x379e('0x45')]({'where':{'id':_0x3ad2cf[_0x379e('0x43')]['id']}})[_0x379e('0x24')](handleEntityNotFound(_0x3f62c8,null))[_0x379e('0x24')](removeEntity(_0x3f62c8,null))['catch'](handleError(_0x3f62c8,null));};exports[_0x379e('0x48')]=function(_0x5e052f,_0x198dec){return db[_0x379e('0x2c')]['describe']()['then'](respondWithResult(_0x198dec,null))[_0x379e('0x41')](handleError(_0x198dec,null));}; \ No newline at end of file +var _0xf84a=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','then','stack','name','send','index','OpenchannelQueueReport','fieldName','type','model','map','query','keys','filters','attributes','fields','hasOwnProperty','limit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','length','find','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x54dcad,_0x554f46){var _0x537c56=function(_0x48ff85){while(--_0x48ff85){_0x54dcad['push'](_0x54dcad['shift']());}};_0x537c56(++_0x554f46);}(_0xf84a,0x199));var _0xaf84=function(_0x167d2d,_0x1f1cf0){_0x167d2d=_0x167d2d-0x0;var _0x42bd5f=_0xf84a[_0x167d2d];return _0x42bd5f;};'use strict';var emlformat=require(_0xaf84('0x0'));var rimraf=require(_0xaf84('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf84('0x2'));var rp=require(_0xaf84('0x3'));var moment=require(_0xaf84('0x4'));var BPromise=require(_0xaf84('0x5'));var Mustache=require(_0xaf84('0x6'));var util=require(_0xaf84('0x7'));var path=require('path');var sox=require(_0xaf84('0x8'));var csv=require(_0xaf84('0x9'));var ejs=require(_0xaf84('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaf84('0xb'));var crypto=require(_0xaf84('0xc'));var jsforce=require(_0xaf84('0xd'));var deskjs=require(_0xaf84('0xe'));var toCsv=require(_0xaf84('0x9'));var querystring=require(_0xaf84('0xf'));var Papa=require(_0xaf84('0x10'));var Redis=require(_0xaf84('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaf84('0x12'));var hardwareService=require(_0xaf84('0x13'));var logger=require('../../config/logger')(_0xaf84('0x14'));var utils=require(_0xaf84('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xaf84('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15eeb6,_0x5f81df){_0x5f81df=_0x5f81df||0xcc;return function(_0x358f86){if(_0x358f86){return _0x15eeb6[_0xaf84('0x17')](_0x5f81df);}return _0x15eeb6[_0xaf84('0x18')](_0x5f81df)[_0xaf84('0x19')]();};}function respondWithResult(_0xcc33fd,_0x4ddcb0){_0x4ddcb0=_0x4ddcb0||0xc8;return function(_0x22725e){if(_0x22725e){return _0xcc33fd[_0xaf84('0x18')](_0x4ddcb0)[_0xaf84('0x1a')](_0x22725e);}};}function respondWithFilteredResult(_0x3afcc5,_0x3cddec){return function(_0x43773d){if(_0x43773d){var _0x2ae45d=typeof _0x3cddec['offset']===_0xaf84('0x1b')&&typeof _0x3cddec['limit']===_0xaf84('0x1b');var _0x4bca50=_0x43773d[_0xaf84('0x1c')];var _0x58c946=_0x2ae45d?0x0:_0x3cddec[_0xaf84('0x1d')];var _0x4ca64a=_0x2ae45d?_0x43773d['count']:_0x3cddec[_0xaf84('0x1d')]+_0x3cddec['limit'];var _0x25964e;if(_0x4ca64a>=_0x4bca50){_0x4ca64a=_0x4bca50;_0x25964e=0xc8;}else{_0x25964e=0xce;}_0x3afcc5[_0xaf84('0x18')](_0x25964e);return _0x3afcc5[_0xaf84('0x1e')](_0xaf84('0x1f'),_0x58c946+'-'+_0x4ca64a+'/'+_0x4bca50)['json'](_0x43773d);}return null;};}function patchUpdates(_0x2ba42e){return function(_0x4d44ee){try{jsonpatch[_0xaf84('0x20')](_0x4d44ee,_0x2ba42e,!![]);}catch(_0x33ac61){return BPromise['reject'](_0x33ac61);}return _0x4d44ee['save']();};}function saveUpdates(_0x3f0074,_0xdad505){return function(_0xd4d125){if(_0xd4d125){return _0xd4d125['update'](_0x3f0074)[_0xaf84('0x21')](function(_0x4bc496){return _0x4bc496;});}return null;};}function removeEntity(_0x3b1824,_0x41026e){return function(_0x498567){if(_0x498567){return _0x498567['destroy']()[_0xaf84('0x21')](function(){_0x3b1824['status'](0xcc)[_0xaf84('0x19')]();});}};}function handleEntityNotFound(_0x2ca700,_0x2ee3c3){return function(_0x4a6968){if(!_0x4a6968){_0x2ca700[_0xaf84('0x17')](0x194);}return _0x4a6968;};}function handleError(_0x5b4e31,_0x99995f){_0x99995f=_0x99995f||0x1f4;return function(_0x4b29de){logger['error'](_0x4b29de[_0xaf84('0x22')]);if(_0x4b29de[_0xaf84('0x23')]){delete _0x4b29de[_0xaf84('0x23')];}_0x5b4e31[_0xaf84('0x18')](_0x99995f)[_0xaf84('0x24')](_0x4b29de);};}exports[_0xaf84('0x25')]=function(_0x2478b7,_0xa3ffe9){var _0x45b067={},_0x4e2c97={},_0x3d60b6={'count':0x0,'rows':[]};var _0x1ea654=_['map'](db[_0xaf84('0x26')]['rawAttributes'],function(_0x4eecd2){return{'name':_0x4eecd2[_0xaf84('0x27')],'type':_0x4eecd2[_0xaf84('0x28')]['key']};});_0x4e2c97[_0xaf84('0x29')]=_[_0xaf84('0x2a')](_0x1ea654,_0xaf84('0x23'));_0x4e2c97[_0xaf84('0x2b')]=_[_0xaf84('0x2c')](_0x2478b7[_0xaf84('0x2b')]);_0x4e2c97[_0xaf84('0x2d')]=_['intersection'](_0x4e2c97[_0xaf84('0x29')],_0x4e2c97[_0xaf84('0x2b')]);_0x45b067[_0xaf84('0x2e')]=_['intersection'](_0x4e2c97[_0xaf84('0x29')],qs['fields'](_0x2478b7[_0xaf84('0x2b')][_0xaf84('0x2f')]));_0x45b067[_0xaf84('0x2e')]=_0x45b067[_0xaf84('0x2e')]['length']?_0x45b067['attributes']:_0x4e2c97[_0xaf84('0x29')];if(!_0x2478b7[_0xaf84('0x2b')][_0xaf84('0x30')]('nolimit')){_0x45b067['limit']=qs[_0xaf84('0x31')](_0x2478b7['query'][_0xaf84('0x31')]);_0x45b067[_0xaf84('0x1d')]=qs['offset'](_0x2478b7[_0xaf84('0x2b')]['offset']);}_0x45b067['order']=qs[_0xaf84('0x32')](_0x2478b7[_0xaf84('0x2b')][_0xaf84('0x32')]);_0x45b067['where']=qs[_0xaf84('0x2d')](_[_0xaf84('0x33')](_0x2478b7[_0xaf84('0x2b')],_0x4e2c97[_0xaf84('0x2d')]),_0x1ea654);if(_0x2478b7[_0xaf84('0x2b')]['filter']){_0x45b067[_0xaf84('0x34')]=_[_0xaf84('0x35')](_0x45b067[_0xaf84('0x34')],{'$or':_['map'](_0x1ea654,function(_0x4e80bb){if(_0x4e80bb['type']!==_0xaf84('0x36')){var _0x39d175={};_0x39d175[_0x4e80bb[_0xaf84('0x23')]]={'$like':'%'+_0x2478b7['query'][_0xaf84('0x37')]+'%'};return _0x39d175;}})});}_0x45b067=_[_0xaf84('0x35')]({},_0x45b067,_0x2478b7[_0xaf84('0x38')]);var _0xffcab2={'where':_0x45b067[_0xaf84('0x34')]};return db['OpenchannelQueueReport'][_0xaf84('0x1c')](_0xffcab2)[_0xaf84('0x21')](function(_0x46525b){_0x3d60b6[_0xaf84('0x1c')]=_0x46525b;if(_0x2478b7[_0xaf84('0x2b')][_0xaf84('0x39')]){_0x45b067[_0xaf84('0x3a')]=[{'all':!![]}];}return db[_0xaf84('0x26')][_0xaf84('0x3b')](_0x45b067);})['then'](function(_0x546a8d){_0x3d60b6[_0xaf84('0x3c')]=_0x546a8d;return _0x3d60b6;})[_0xaf84('0x21')](respondWithFilteredResult(_0xa3ffe9,_0x45b067))[_0xaf84('0x3d')](handleError(_0xa3ffe9,null));};exports[_0xaf84('0x3e')]=function(_0x289af8,_0x20dac5){var _0x3d5b49={'raw':!![],'where':{'id':_0x289af8[_0xaf84('0x3f')]['id']}},_0x3df851={};_0x3df851[_0xaf84('0x29')]=_['keys'](db[_0xaf84('0x26')][_0xaf84('0x40')]);_0x3df851[_0xaf84('0x2b')]=_['keys'](_0x289af8[_0xaf84('0x2b')]);_0x3df851[_0xaf84('0x2d')]=_[_0xaf84('0x41')](_0x3df851[_0xaf84('0x29')],_0x3df851['query']);_0x3d5b49[_0xaf84('0x2e')]=_[_0xaf84('0x41')](_0x3df851['model'],qs['fields'](_0x289af8[_0xaf84('0x2b')][_0xaf84('0x2f')]));_0x3d5b49[_0xaf84('0x2e')]=_0x3d5b49[_0xaf84('0x2e')][_0xaf84('0x42')]?_0x3d5b49[_0xaf84('0x2e')]:_0x3df851[_0xaf84('0x29')];if(_0x289af8[_0xaf84('0x2b')][_0xaf84('0x39')]){_0x3d5b49[_0xaf84('0x3a')]=[{'all':!![]}];}_0x3d5b49=_[_0xaf84('0x35')]({},_0x3d5b49,_0x289af8[_0xaf84('0x38')]);return db[_0xaf84('0x26')][_0xaf84('0x43')](_0x3d5b49)[_0xaf84('0x21')](handleEntityNotFound(_0x20dac5,null))[_0xaf84('0x21')](respondWithResult(_0x20dac5,null))[_0xaf84('0x3d')](handleError(_0x20dac5,null));};exports['create']=function(_0x19b28e,_0x26a0ea){return db[_0xaf84('0x26')]['create'](_0x19b28e[_0xaf84('0x44')],{})[_0xaf84('0x21')](respondWithResult(_0x26a0ea,0xc9))[_0xaf84('0x3d')](handleError(_0x26a0ea,null));};exports[_0xaf84('0x45')]=function(_0x354924,_0x5edbf1){if(_0x354924[_0xaf84('0x44')]['id']){delete _0x354924['body']['id'];}return db[_0xaf84('0x26')][_0xaf84('0x43')]({'where':{'id':_0x354924[_0xaf84('0x3f')]['id']}})[_0xaf84('0x21')](handleEntityNotFound(_0x5edbf1,null))[_0xaf84('0x21')](saveUpdates(_0x354924[_0xaf84('0x44')],null))[_0xaf84('0x21')](respondWithResult(_0x5edbf1,null))[_0xaf84('0x3d')](handleError(_0x5edbf1,null));};exports['destroy']=function(_0x4b899d,_0x37935e){return db[_0xaf84('0x26')]['find']({'where':{'id':_0x4b899d[_0xaf84('0x3f')]['id']}})['then'](handleEntityNotFound(_0x37935e,null))[_0xaf84('0x21')](removeEntity(_0x37935e,null))[_0xaf84('0x3d')](handleError(_0x37935e,null));};exports[_0xaf84('0x46')]=function(_0x41e639,_0x2685a2){return db[_0xaf84('0x26')][_0xaf84('0x46')]()['then'](respondWithResult(_0x2685a2,null))[_0xaf84('0x3d')](handleError(_0x2685a2,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index fc2fb5c..fc8f76a 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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x118a51,_0x612bb){var _0x5d8cd3=function(_0x25272f){while(--_0x25272f){_0x118a51['push'](_0x118a51['shift']());}};_0x5d8cd3(++_0x612bb);}(_0xe14b,0x93));var _0xbe14=function(_0x5d5870,_0x46fc13){_0x5d5870=_0x5d5870-0x0;var _0x4c20f7=_0xe14b[_0x5d5870];return _0x4c20f7;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x483653,_0x5c28b1){var _0x19bc80=function(_0x2ec7e9){while(--_0x2ec7e9){_0x483653['push'](_0x483653['shift']());}};_0x19bc80(++_0x5c28b1);}(_0x326f,0xd1));var _0xf326=function(_0x3ac2e6,_0x255b10){_0x3ac2e6=_0x3ac2e6-0x0;var _0x4ee43c=_0x326f[_0x3ac2e6];return _0x4ee43c;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 956ca8d..19a9186 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 _0x51c5=['attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','info','catch','CreateOpenchannelQueueReport','create','options','raw','then','OpenchannelQueueReport','update','body','where'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x51c5,0x8f));var _0x551c=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x51c5[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var moment=require(_0x551c('0x2'));var BPromise=require(_0x551c('0x3'));var rs=require(_0x551c('0x4'));var fs=require('fs');var Redis=require(_0x551c('0x5'));var db=require(_0x551c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x551c('0x7'))(_0x551c('0x8'));var config=require(_0x551c('0x9'));var jayson=require(_0x551c('0xa'));var client=jayson[_0x551c('0xb')][_0x551c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21dfa1,_0x196955,_0x4f3a0a){return new BPromise(function(_0x414edb,_0x15f4f8){return client[_0x551c('0xd')](_0x21dfa1,_0x4f3a0a)['then'](function(_0x17683c){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x196955,'request\x20sent');logger[_0x551c('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x196955,_0x551c('0xf'),JSON[_0x551c('0x10')](_0x17683c));if(_0x17683c[_0x551c('0x11')]){if(_0x17683c[_0x551c('0x11')][_0x551c('0x12')]===0x1f4){logger[_0x551c('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x196955,_0x17683c[_0x551c('0x11')][_0x551c('0x13')]);return _0x15f4f8(_0x17683c[_0x551c('0x11')]['message']);}logger[_0x551c('0x11')](_0x551c('0x14'),_0x196955,_0x17683c['error'][_0x551c('0x13')]);return _0x414edb(_0x17683c['error'][_0x551c('0x13')]);}else{logger[_0x551c('0x15')](_0x551c('0x14'),_0x196955,_0x551c('0xf'));_0x414edb(_0x17683c['result']['message']);}})[_0x551c('0x16')](function(_0xcdf011){logger['error'](_0x551c('0x14'),_0x196955,_0xcdf011);_0x15f4f8(_0xcdf011);});});}exports[_0x551c('0x17')]=function(_0x274432){var _0x2a0b55=this;return new Promise(function(_0x4c8dba,_0x4fcaf3){return db['OpenchannelQueueReport'][_0x551c('0x18')](_0x274432['body'],{'raw':_0x274432['options']?_0x274432[_0x551c('0x19')][_0x551c('0x1a')]===undefined?!![]:![]:!![]})[_0x551c('0x1b')](function(_0x1927e7){logger[_0x551c('0x15')](_0x551c('0x17'),_0x274432);logger['debug']('CreateOpenchannelQueueReport',_0x274432,JSON[_0x551c('0x10')](_0x1927e7));_0x4c8dba(_0x1927e7);})['catch'](function(_0x330160){logger[_0x551c('0x11')](_0x551c('0x17'),_0x330160[_0x551c('0x13')],_0x274432);_0x4fcaf3(_0x2a0b55[_0x551c('0x11')](0x1f4,_0x330160['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x194a1d){var _0x52cea5=this;return new Promise(function(_0x164343,_0x30f639){return db[_0x551c('0x1c')][_0x551c('0x1d')](_0x194a1d[_0x551c('0x1e')],{'raw':_0x194a1d[_0x551c('0x19')]?_0x194a1d[_0x551c('0x19')][_0x551c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x194a1d['options']?_0x194a1d[_0x551c('0x19')][_0x551c('0x1f')]||null:null,'attributes':_0x194a1d['options']?_0x194a1d[_0x551c('0x19')][_0x551c('0x20')]||null:null,'limit':_0x194a1d['options']?_0x194a1d[_0x551c('0x19')][_0x551c('0x21')]||null:null})[_0x551c('0x1b')](function(_0x1600b5){logger[_0x551c('0x15')]('UpdateOpenchannelQueueReport',_0x194a1d);logger[_0x551c('0xe')](_0x551c('0x22'),_0x194a1d,JSON[_0x551c('0x10')](_0x1600b5));_0x164343(_0x1600b5);})['catch'](function(_0x3aa0c0){logger[_0x551c('0x11')]('UpdateOpenchannelQueueReport',_0x3aa0c0['message'],_0x194a1d);_0x30f639(_0x52cea5[_0x551c('0x11')](0x1f4,_0x3aa0c0[_0x551c('0x13')]));});});}; \ No newline at end of file +var _0x3266=['message','body','options','raw','catch','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x3266,0x6a));var _0x6326=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x3266[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var moment=require(_0x6326('0x2'));var BPromise=require(_0x6326('0x3'));var rs=require(_0x6326('0x4'));var fs=require('fs');var Redis=require(_0x6326('0x5'));var db=require(_0x6326('0x6'))['db'];var utils=require(_0x6326('0x7'));var logger=require(_0x6326('0x8'))('rpc');var config=require(_0x6326('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6326('0xa')][_0x6326('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14208e,_0x5402e5,_0x161f4e){return new BPromise(function(_0x5730e7,_0x2af571){return client[_0x6326('0xc')](_0x14208e,_0x161f4e)[_0x6326('0xd')](function(_0x1aee60){logger[_0x6326('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5402e5,_0x6326('0xf'));logger[_0x6326('0x10')](_0x6326('0x11'),_0x5402e5,_0x6326('0xf'),JSON[_0x6326('0x12')](_0x1aee60));if(_0x1aee60[_0x6326('0x13')]){if(_0x1aee60[_0x6326('0x13')][_0x6326('0x14')]===0x1f4){logger[_0x6326('0x13')](_0x6326('0x15'),_0x5402e5,_0x1aee60['error']['message']);return _0x2af571(_0x1aee60[_0x6326('0x13')][_0x6326('0x16')]);}logger['error'](_0x6326('0x15'),_0x5402e5,_0x1aee60['error'][_0x6326('0x16')]);return _0x5730e7(_0x1aee60[_0x6326('0x13')][_0x6326('0x16')]);}else{logger[_0x6326('0xe')](_0x6326('0x15'),_0x5402e5,_0x6326('0xf'));_0x5730e7(_0x1aee60['result'][_0x6326('0x16')]);}})['catch'](function(_0x5945ee){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x5402e5,_0x5945ee);_0x2af571(_0x5945ee);});});}exports['CreateOpenchannelQueueReport']=function(_0x58e960){var _0xdf5ced=this;return new Promise(function(_0x1f4c11,_0x2be78e){return db['OpenchannelQueueReport']['create'](_0x58e960[_0x6326('0x17')],{'raw':_0x58e960[_0x6326('0x18')]?_0x58e960[_0x6326('0x18')][_0x6326('0x19')]===undefined?!![]:![]:!![]})[_0x6326('0xd')](function(_0x25957a){logger[_0x6326('0xe')]('CreateOpenchannelQueueReport',_0x58e960);logger[_0x6326('0x10')]('CreateOpenchannelQueueReport',_0x58e960,JSON[_0x6326('0x12')](_0x25957a));_0x1f4c11(_0x25957a);})[_0x6326('0x1a')](function(_0x2482ef){logger[_0x6326('0x13')](_0x6326('0x1b'),_0x2482ef[_0x6326('0x16')],_0x58e960);_0x2be78e(_0xdf5ced[_0x6326('0x13')](0x1f4,_0x2482ef[_0x6326('0x16')]));});});};exports[_0x6326('0x1c')]=function(_0x2d0d00){var _0x34954b=this;return new Promise(function(_0x4933e1,_0x72d020){return db[_0x6326('0x1d')]['update'](_0x2d0d00['body'],{'raw':_0x2d0d00['options']?_0x2d0d00[_0x6326('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d0d00[_0x6326('0x18')]?_0x2d0d00[_0x6326('0x18')]['where']||null:null,'attributes':_0x2d0d00[_0x6326('0x18')]?_0x2d0d00[_0x6326('0x18')][_0x6326('0x1e')]||null:null,'limit':_0x2d0d00[_0x6326('0x18')]?_0x2d0d00[_0x6326('0x18')][_0x6326('0x1f')]||null:null})[_0x6326('0xd')](function(_0x27802c){logger[_0x6326('0xe')](_0x6326('0x1c'),_0x2d0d00);logger[_0x6326('0x10')](_0x6326('0x1c'),_0x2d0d00,JSON[_0x6326('0x12')](_0x27802c));_0x4933e1(_0x27802c);})[_0x6326('0x1a')](function(_0x2e0445){logger[_0x6326('0x13')]('UpdateOpenchannelQueueReport',_0x2e0445[_0x6326('0x16')],_0x2d0d00);_0x72d020(_0x34954b[_0x6326('0x13')](0x1f4,_0x2e0445[_0x6326('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index d2f1f33..88d973d 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 _0xbefb=['update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x56c0df,_0x1a9368){var _0x936a9=function(_0x1c0377){while(--_0x1c0377){_0x56c0df['push'](_0x56c0df['shift']());}};_0x936a9(++_0x1a9368);}(_0xbefb,0xe9));var _0xbbef=function(_0x2e60aa,_0x3cba0d){_0x2e60aa=_0x2e60aa-0x0;var _0x11160d=_0xbefb[_0x2e60aa];return _0x11160d;};'use strict';var multer=require('multer');var util=require(_0xbbef('0x0'));var path=require(_0xbbef('0x1'));var timeout=require(_0xbbef('0x2'));var express=require(_0xbbef('0x3'));var router=express[_0xbbef('0x4')]();var fs_extra=require(_0xbbef('0x5'));var auth=require(_0xbbef('0x6'));var interaction=require(_0xbbef('0x7'));var config=require(_0xbbef('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0xbbef('0x9')]('/',auth[_0xbbef('0xa')](),controller[_0xbbef('0xb')]);router[_0xbbef('0x9')](_0xbbef('0xc'),auth['isAuthenticated'](),controller[_0xbbef('0xd')]);router[_0xbbef('0x9')](_0xbbef('0xe'),auth[_0xbbef('0xa')](),controller[_0xbbef('0xf')]);router[_0xbbef('0x10')]('/',auth['isAuthenticated'](),controller[_0xbbef('0x11')]);router[_0xbbef('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xbbef('0x13')]);router['delete'](_0xbbef('0xe'),auth[_0xbbef('0xa')](),controller[_0xbbef('0x14')]);module['exports']=router; \ No newline at end of file +var _0x31f5=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x3e8a42,_0x571c1c){var _0x2e30f6=function(_0x5dcbe6){while(--_0x5dcbe6){_0x3e8a42['push'](_0x3e8a42['shift']());}};_0x2e30f6(++_0x571c1c);}(_0x31f5,0x6b));var _0x531f=function(_0x242005,_0xc9c464){_0x242005=_0x242005-0x0;var _0x5bb233=_0x31f5[_0x242005];return _0x5bb233;};'use strict';var multer=require(_0x531f('0x0'));var util=require(_0x531f('0x1'));var path=require(_0x531f('0x2'));var timeout=require(_0x531f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x531f('0x4'));var interaction=require(_0x531f('0x5'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x531f('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x531f('0x6')](_0x531f('0x7'),auth[_0x531f('0x8')](),controller[_0x531f('0x9')]);router[_0x531f('0x6')](_0x531f('0xa'),auth[_0x531f('0x8')](),controller[_0x531f('0xb')]);router[_0x531f('0xc')]('/',auth[_0x531f('0x8')](),controller[_0x531f('0xd')]);router[_0x531f('0xe')](_0x531f('0xa'),auth[_0x531f('0x8')](),controller[_0x531f('0xf')]);router['delete']('/:id',auth[_0x531f('0x8')](),controller[_0x531f('0x10')]);module[_0x531f('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index a76633e..c090d50 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x4a2995,_0x3644c9){var _0x5141dd=function(_0x30dcfc){while(--_0x30dcfc){_0x4a2995['push'](_0x4a2995['shift']());}};_0x5141dd(++_0x3644c9);}(_0x34e8,0x12c));var _0x834e=function(_0x1a00cc,_0x5e49d1){_0x1a00cc=_0x1a00cc-0x0;var _0x2efd84=_0x34e8[_0x1a00cc];return _0x2efd84;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xa69733,_0x2aa122){var _0xca5645=function(_0x3a2729){while(--_0x3a2729){_0xa69733['push'](_0xa69733['shift']());}};_0xca5645(++_0x2aa122);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index c501bea..7c63b51 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 _0x6709=['show','params','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','OpenchannelTransferReport','includeAll','include','findAll','rows','catch'];(function(_0xf4d05,_0x5e601f){var _0x47c971=function(_0x17aae3){while(--_0x17aae3){_0xf4d05['push'](_0xf4d05['shift']());}};_0x47c971(++_0x5e601f);}(_0x6709,0x12f));var _0x9670=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x6709[_0x256b72];return _0x2183e3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9670('0x0'));var zipdir=require(_0x9670('0x1'));var jsonpatch=require(_0x9670('0x2'));var rp=require(_0x9670('0x3'));var moment=require(_0x9670('0x4'));var BPromise=require(_0x9670('0x5'));var Mustache=require(_0x9670('0x6'));var util=require('util');var path=require(_0x9670('0x7'));var sox=require(_0x9670('0x8'));var csv=require(_0x9670('0x9'));var ejs=require(_0x9670('0xa'));var fs=require('fs');var fs_extra=require(_0x9670('0xb'));var _=require(_0x9670('0xc'));var squel=require(_0x9670('0xd'));var crypto=require(_0x9670('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9670('0xf'));var toCsv=require(_0x9670('0x9'));var querystring=require(_0x9670('0x10'));var Papa=require('papaparse');var Redis=require(_0x9670('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9670('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9670('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9670('0x14'));var config=require(_0x9670('0x15'));var licenseUtil=require(_0x9670('0x16'));var db=require(_0x9670('0x17'))['db'];function respondWithStatusCode(_0x8bf4fe,_0x3cd232){_0x3cd232=_0x3cd232||0xcc;return function(_0x57a5e3){if(_0x57a5e3){return _0x8bf4fe['sendStatus'](_0x3cd232);}return _0x8bf4fe[_0x9670('0x18')](_0x3cd232)[_0x9670('0x19')]();};}function respondWithResult(_0x1ddf10,_0x17b703){_0x17b703=_0x17b703||0xc8;return function(_0x35280a){if(_0x35280a){return _0x1ddf10[_0x9670('0x18')](_0x17b703)[_0x9670('0x1a')](_0x35280a);}};}function respondWithFilteredResult(_0x55da91,_0x5ea3d2){return function(_0x3c9a48){if(_0x3c9a48){var _0x182414=typeof _0x5ea3d2[_0x9670('0x1b')]===_0x9670('0x1c')&&typeof _0x5ea3d2[_0x9670('0x1d')]===_0x9670('0x1c');var _0x318403=_0x3c9a48[_0x9670('0x1e')];var _0x1199b8=_0x182414?0x0:_0x5ea3d2[_0x9670('0x1b')];var _0x4e05c2=_0x182414?_0x3c9a48[_0x9670('0x1e')]:_0x5ea3d2['offset']+_0x5ea3d2['limit'];var _0x17e53a;if(_0x4e05c2>=_0x318403){_0x4e05c2=_0x318403;_0x17e53a=0xc8;}else{_0x17e53a=0xce;}_0x55da91[_0x9670('0x18')](_0x17e53a);return _0x55da91['set']('Content-Range',_0x1199b8+'-'+_0x4e05c2+'/'+_0x318403)[_0x9670('0x1a')](_0x3c9a48);}return null;};}function patchUpdates(_0x2c3546){return function(_0x57cfb6){try{jsonpatch[_0x9670('0x1f')](_0x57cfb6,_0x2c3546,!![]);}catch(_0x4d2bd8){return BPromise['reject'](_0x4d2bd8);}return _0x57cfb6[_0x9670('0x20')]();};}function saveUpdates(_0x3d7639,_0x16150a){return function(_0x231fb4){if(_0x231fb4){return _0x231fb4['update'](_0x3d7639)[_0x9670('0x21')](function(_0x314f07){return _0x314f07;});}return null;};}function removeEntity(_0x5a6cd3,_0x5a462f){return function(_0x4adb61){if(_0x4adb61){return _0x4adb61[_0x9670('0x22')]()[_0x9670('0x21')](function(){_0x5a6cd3[_0x9670('0x18')](0xcc)[_0x9670('0x19')]();});}};}function handleEntityNotFound(_0xda071b,_0x527555){return function(_0x55e6e6){if(!_0x55e6e6){_0xda071b[_0x9670('0x23')](0x194);}return _0x55e6e6;};}function handleError(_0x5a82a4,_0x516393){_0x516393=_0x516393||0x1f4;return function(_0x24a95d){logger[_0x9670('0x24')](_0x24a95d[_0x9670('0x25')]);if(_0x24a95d[_0x9670('0x26')]){delete _0x24a95d[_0x9670('0x26')];}_0x5a82a4[_0x9670('0x18')](_0x516393)[_0x9670('0x27')](_0x24a95d);};}exports[_0x9670('0x28')]=function(_0x17b99d,_0x33d1b6){var _0x3f777f={},_0xe36438={},_0x4fbbfb={'count':0x0,'rows':[]};var _0x49dcce=_[_0x9670('0x29')](db['OpenchannelTransferReport'][_0x9670('0x2a')],function(_0x4b7b2e){return{'name':_0x4b7b2e[_0x9670('0x2b')],'type':_0x4b7b2e[_0x9670('0x2c')]['key']};});_0xe36438[_0x9670('0x2d')]=_['map'](_0x49dcce,_0x9670('0x26'));_0xe36438[_0x9670('0x2e')]=_[_0x9670('0x2f')](_0x17b99d[_0x9670('0x2e')]);_0xe36438[_0x9670('0x30')]=_[_0x9670('0x31')](_0xe36438[_0x9670('0x2d')],_0xe36438['query']);_0x3f777f[_0x9670('0x32')]=_['intersection'](_0xe36438['model'],qs['fields'](_0x17b99d[_0x9670('0x2e')][_0x9670('0x33')]));_0x3f777f[_0x9670('0x32')]=_0x3f777f[_0x9670('0x32')][_0x9670('0x34')]?_0x3f777f['attributes']:_0xe36438[_0x9670('0x2d')];if(!_0x17b99d['query'][_0x9670('0x35')]('nolimit')){_0x3f777f['limit']=qs[_0x9670('0x1d')](_0x17b99d[_0x9670('0x2e')][_0x9670('0x1d')]);_0x3f777f['offset']=qs[_0x9670('0x1b')](_0x17b99d[_0x9670('0x2e')][_0x9670('0x1b')]);}_0x3f777f[_0x9670('0x36')]=qs[_0x9670('0x37')](_0x17b99d[_0x9670('0x2e')][_0x9670('0x37')]);_0x3f777f[_0x9670('0x38')]=qs['filters'](_[_0x9670('0x39')](_0x17b99d[_0x9670('0x2e')],_0xe36438[_0x9670('0x30')]),_0x49dcce);if(_0x17b99d[_0x9670('0x2e')][_0x9670('0x3a')]){_0x3f777f['where']=_[_0x9670('0x3b')](_0x3f777f[_0x9670('0x38')],{'$or':_[_0x9670('0x29')](_0x49dcce,function(_0x5f3a45){if(_0x5f3a45[_0x9670('0x2c')]!=='VIRTUAL'){var _0x5f51cf={};_0x5f51cf[_0x5f3a45[_0x9670('0x26')]]={'$like':'%'+_0x17b99d['query'][_0x9670('0x3a')]+'%'};return _0x5f51cf;}})});}_0x3f777f=_[_0x9670('0x3b')]({},_0x3f777f,_0x17b99d[_0x9670('0x3c')]);var _0x3a5981={'where':_0x3f777f[_0x9670('0x38')]};return db[_0x9670('0x3d')][_0x9670('0x1e')](_0x3a5981)[_0x9670('0x21')](function(_0x2eddad){_0x4fbbfb['count']=_0x2eddad;if(_0x17b99d[_0x9670('0x2e')][_0x9670('0x3e')]){_0x3f777f[_0x9670('0x3f')]=[{'all':!![]}];}return db[_0x9670('0x3d')][_0x9670('0x40')](_0x3f777f);})[_0x9670('0x21')](function(_0x457eca){_0x4fbbfb[_0x9670('0x41')]=_0x457eca;return _0x4fbbfb;})[_0x9670('0x21')](respondWithFilteredResult(_0x33d1b6,_0x3f777f))[_0x9670('0x42')](handleError(_0x33d1b6,null));};exports[_0x9670('0x43')]=function(_0x3f745a,_0x5a15ff){var _0x3cca95={'raw':!![],'where':{'id':_0x3f745a[_0x9670('0x44')]['id']}},_0x17c076={};_0x17c076[_0x9670('0x2d')]=_['keys'](db[_0x9670('0x3d')][_0x9670('0x2a')]);_0x17c076[_0x9670('0x2e')]=_[_0x9670('0x2f')](_0x3f745a[_0x9670('0x2e')]);_0x17c076[_0x9670('0x30')]=_[_0x9670('0x31')](_0x17c076[_0x9670('0x2d')],_0x17c076[_0x9670('0x2e')]);_0x3cca95['attributes']=_[_0x9670('0x31')](_0x17c076[_0x9670('0x2d')],qs[_0x9670('0x33')](_0x3f745a['query'][_0x9670('0x33')]));_0x3cca95['attributes']=_0x3cca95[_0x9670('0x32')][_0x9670('0x34')]?_0x3cca95[_0x9670('0x32')]:_0x17c076[_0x9670('0x2d')];if(_0x3f745a[_0x9670('0x2e')][_0x9670('0x3e')]){_0x3cca95[_0x9670('0x3f')]=[{'all':!![]}];}_0x3cca95=_['merge']({},_0x3cca95,_0x3f745a[_0x9670('0x3c')]);return db[_0x9670('0x3d')][_0x9670('0x45')](_0x3cca95)[_0x9670('0x21')](handleEntityNotFound(_0x5a15ff,null))[_0x9670('0x21')](respondWithResult(_0x5a15ff,null))[_0x9670('0x42')](handleError(_0x5a15ff,null));};exports[_0x9670('0x46')]=function(_0x5e3786,_0x29c9dc){return db[_0x9670('0x3d')][_0x9670('0x46')](_0x5e3786[_0x9670('0x47')],{})['then'](respondWithResult(_0x29c9dc,0xc9))['catch'](handleError(_0x29c9dc,null));};exports[_0x9670('0x48')]=function(_0xad592e,_0x2ff7ad){if(_0xad592e[_0x9670('0x47')]['id']){delete _0xad592e[_0x9670('0x47')]['id'];}return db['OpenchannelTransferReport'][_0x9670('0x45')]({'where':{'id':_0xad592e['params']['id']}})[_0x9670('0x21')](handleEntityNotFound(_0x2ff7ad,null))[_0x9670('0x21')](saveUpdates(_0xad592e[_0x9670('0x47')],null))[_0x9670('0x21')](respondWithResult(_0x2ff7ad,null))['catch'](handleError(_0x2ff7ad,null));};exports[_0x9670('0x22')]=function(_0x5e5236,_0x52c99a){return db['OpenchannelTransferReport'][_0x9670('0x45')]({'where':{'id':_0x5e5236[_0x9670('0x44')]['id']}})[_0x9670('0x21')](handleEntityNotFound(_0x52c99a,null))[_0x9670('0x21')](removeEntity(_0x52c99a,null))['catch'](handleError(_0x52c99a,null));};exports['describe']=function(_0x3d7b16,_0x3eacb9){return db[_0x9670('0x3d')][_0x9670('0x49')]()[_0x9670('0x21')](respondWithResult(_0x3eacb9,null))[_0x9670('0x42')](handleError(_0x3eacb9,null));}; \ No newline at end of file +var _0x4dfb=['show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','rows','catch'];(function(_0x37b596,_0x19a66b){var _0x4e0b4c=function(_0x3778ae){while(--_0x3778ae){_0x37b596['push'](_0x37b596['shift']());}};_0x4e0b4c(++_0x19a66b);}(_0x4dfb,0x11b));var _0xb4df=function(_0x1a23e5,_0x4520f3){_0x1a23e5=_0x1a23e5-0x0;var _0x595ad7=_0x4dfb[_0x1a23e5];return _0x595ad7;};'use strict';var emlformat=require(_0xb4df('0x0'));var rimraf=require(_0xb4df('0x1'));var zipdir=require(_0xb4df('0x2'));var jsonpatch=require(_0xb4df('0x3'));var rp=require('request-promise');var moment=require(_0xb4df('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb4df('0x5'));var sox=require('sox');var csv=require(_0xb4df('0x6'));var ejs=require(_0xb4df('0x7'));var fs=require('fs');var fs_extra=require(_0xb4df('0x8'));var _=require(_0xb4df('0x9'));var squel=require(_0xb4df('0xa'));var crypto=require(_0xb4df('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb4df('0x6'));var querystring=require(_0xb4df('0xc'));var Papa=require(_0xb4df('0xd'));var Redis=require(_0xb4df('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb4df('0xf'));var as=require(_0xb4df('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb4df('0x11'));var config=require(_0xb4df('0x12'));var licenseUtil=require(_0xb4df('0x13'));var db=require(_0xb4df('0x14'))['db'];function respondWithStatusCode(_0x4e9e87,_0x3fd36d){_0x3fd36d=_0x3fd36d||0xcc;return function(_0x74c3aa){if(_0x74c3aa){return _0x4e9e87[_0xb4df('0x15')](_0x3fd36d);}return _0x4e9e87[_0xb4df('0x16')](_0x3fd36d)['end']();};}function respondWithResult(_0x40c259,_0xbe5c3b){_0xbe5c3b=_0xbe5c3b||0xc8;return function(_0x176f73){if(_0x176f73){return _0x40c259['status'](_0xbe5c3b)[_0xb4df('0x17')](_0x176f73);}};}function respondWithFilteredResult(_0xa543e6,_0x4ccfff){return function(_0x22bcb3){if(_0x22bcb3){var _0x4fb06a=typeof _0x4ccfff[_0xb4df('0x18')]==='undefined'&&typeof _0x4ccfff[_0xb4df('0x19')]===_0xb4df('0x1a');var _0x1a9277=_0x22bcb3[_0xb4df('0x1b')];var _0x49bae9=_0x4fb06a?0x0:_0x4ccfff[_0xb4df('0x18')];var _0x126952=_0x4fb06a?_0x22bcb3[_0xb4df('0x1b')]:_0x4ccfff[_0xb4df('0x18')]+_0x4ccfff['limit'];var _0x3620ca;if(_0x126952>=_0x1a9277){_0x126952=_0x1a9277;_0x3620ca=0xc8;}else{_0x3620ca=0xce;}_0xa543e6[_0xb4df('0x16')](_0x3620ca);return _0xa543e6[_0xb4df('0x1c')](_0xb4df('0x1d'),_0x49bae9+'-'+_0x126952+'/'+_0x1a9277)['json'](_0x22bcb3);}return null;};}function patchUpdates(_0x5cc3cf){return function(_0x29dca0){try{jsonpatch['apply'](_0x29dca0,_0x5cc3cf,!![]);}catch(_0x33c394){return BPromise[_0xb4df('0x1e')](_0x33c394);}return _0x29dca0[_0xb4df('0x1f')]();};}function saveUpdates(_0x5599b1,_0xcc8fab){return function(_0x197d1a){if(_0x197d1a){return _0x197d1a[_0xb4df('0x20')](_0x5599b1)[_0xb4df('0x21')](function(_0x43638e){return _0x43638e;});}return null;};}function removeEntity(_0x5e121d,_0x84410){return function(_0x93a57c){if(_0x93a57c){return _0x93a57c[_0xb4df('0x22')]()[_0xb4df('0x21')](function(){_0x5e121d['status'](0xcc)[_0xb4df('0x23')]();});}};}function handleEntityNotFound(_0x3d4167,_0x4dc8c2){return function(_0x285238){if(!_0x285238){_0x3d4167['sendStatus'](0x194);}return _0x285238;};}function handleError(_0x1f999d,_0x2ccd4b){_0x2ccd4b=_0x2ccd4b||0x1f4;return function(_0x54b03a){logger[_0xb4df('0x24')](_0x54b03a[_0xb4df('0x25')]);if(_0x54b03a[_0xb4df('0x26')]){delete _0x54b03a['name'];}_0x1f999d['status'](_0x2ccd4b)[_0xb4df('0x27')](_0x54b03a);};}exports['index']=function(_0x439fab,_0x2ec279){var _0x53ed0b={},_0x4d2d5c={},_0x247b3e={'count':0x0,'rows':[]};var _0x200013=_[_0xb4df('0x28')](db[_0xb4df('0x29')][_0xb4df('0x2a')],function(_0x13ede9){return{'name':_0x13ede9[_0xb4df('0x2b')],'type':_0x13ede9['type'][_0xb4df('0x2c')]};});_0x4d2d5c[_0xb4df('0x2d')]=_[_0xb4df('0x28')](_0x200013,_0xb4df('0x26'));_0x4d2d5c[_0xb4df('0x2e')]=_[_0xb4df('0x2f')](_0x439fab[_0xb4df('0x2e')]);_0x4d2d5c[_0xb4df('0x30')]=_[_0xb4df('0x31')](_0x4d2d5c[_0xb4df('0x2d')],_0x4d2d5c[_0xb4df('0x2e')]);_0x53ed0b['attributes']=_[_0xb4df('0x31')](_0x4d2d5c['model'],qs[_0xb4df('0x32')](_0x439fab[_0xb4df('0x2e')][_0xb4df('0x32')]));_0x53ed0b[_0xb4df('0x33')]=_0x53ed0b['attributes'][_0xb4df('0x34')]?_0x53ed0b[_0xb4df('0x33')]:_0x4d2d5c[_0xb4df('0x2d')];if(!_0x439fab[_0xb4df('0x2e')]['hasOwnProperty']('nolimit')){_0x53ed0b[_0xb4df('0x19')]=qs[_0xb4df('0x19')](_0x439fab[_0xb4df('0x2e')][_0xb4df('0x19')]);_0x53ed0b['offset']=qs[_0xb4df('0x18')](_0x439fab['query'][_0xb4df('0x18')]);}_0x53ed0b[_0xb4df('0x35')]=qs['sort'](_0x439fab[_0xb4df('0x2e')][_0xb4df('0x36')]);_0x53ed0b[_0xb4df('0x37')]=qs[_0xb4df('0x30')](_[_0xb4df('0x38')](_0x439fab['query'],_0x4d2d5c[_0xb4df('0x30')]),_0x200013);if(_0x439fab['query'][_0xb4df('0x39')]){_0x53ed0b[_0xb4df('0x37')]=_[_0xb4df('0x3a')](_0x53ed0b['where'],{'$or':_[_0xb4df('0x28')](_0x200013,function(_0x12d092){if(_0x12d092['type']!==_0xb4df('0x3b')){var _0x5175b5={};_0x5175b5[_0x12d092[_0xb4df('0x26')]]={'$like':'%'+_0x439fab[_0xb4df('0x2e')][_0xb4df('0x39')]+'%'};return _0x5175b5;}})});}_0x53ed0b=_[_0xb4df('0x3a')]({},_0x53ed0b,_0x439fab['options']);var _0xe3b0e={'where':_0x53ed0b[_0xb4df('0x37')]};return db[_0xb4df('0x29')][_0xb4df('0x1b')](_0xe3b0e)[_0xb4df('0x21')](function(_0x31e8ca){_0x247b3e['count']=_0x31e8ca;if(_0x439fab[_0xb4df('0x2e')]['includeAll']){_0x53ed0b['include']=[{'all':!![]}];}return db[_0xb4df('0x29')]['findAll'](_0x53ed0b);})[_0xb4df('0x21')](function(_0x4ae77b){_0x247b3e[_0xb4df('0x3c')]=_0x4ae77b;return _0x247b3e;})['then'](respondWithFilteredResult(_0x2ec279,_0x53ed0b))[_0xb4df('0x3d')](handleError(_0x2ec279,null));};exports[_0xb4df('0x3e')]=function(_0x5005ce,_0x4f3bd0){var _0x5d4a6f={'raw':!![],'where':{'id':_0x5005ce[_0xb4df('0x3f')]['id']}},_0x1b0552={};_0x1b0552['model']=_['keys'](db[_0xb4df('0x29')][_0xb4df('0x2a')]);_0x1b0552[_0xb4df('0x2e')]=_[_0xb4df('0x2f')](_0x5005ce['query']);_0x1b0552[_0xb4df('0x30')]=_['intersection'](_0x1b0552[_0xb4df('0x2d')],_0x1b0552[_0xb4df('0x2e')]);_0x5d4a6f['attributes']=_[_0xb4df('0x31')](_0x1b0552[_0xb4df('0x2d')],qs[_0xb4df('0x32')](_0x5005ce[_0xb4df('0x2e')][_0xb4df('0x32')]));_0x5d4a6f[_0xb4df('0x33')]=_0x5d4a6f['attributes'][_0xb4df('0x34')]?_0x5d4a6f[_0xb4df('0x33')]:_0x1b0552[_0xb4df('0x2d')];if(_0x5005ce[_0xb4df('0x2e')]['includeAll']){_0x5d4a6f['include']=[{'all':!![]}];}_0x5d4a6f=_['merge']({},_0x5d4a6f,_0x5005ce[_0xb4df('0x40')]);return db[_0xb4df('0x29')][_0xb4df('0x41')](_0x5d4a6f)['then'](handleEntityNotFound(_0x4f3bd0,null))['then'](respondWithResult(_0x4f3bd0,null))['catch'](handleError(_0x4f3bd0,null));};exports['create']=function(_0x4c24ff,_0x5103d5){return db['OpenchannelTransferReport'][_0xb4df('0x42')](_0x4c24ff[_0xb4df('0x43')],{})[_0xb4df('0x21')](respondWithResult(_0x5103d5,0xc9))[_0xb4df('0x3d')](handleError(_0x5103d5,null));};exports[_0xb4df('0x20')]=function(_0x1d1cfc,_0x3ea188){if(_0x1d1cfc[_0xb4df('0x43')]['id']){delete _0x1d1cfc[_0xb4df('0x43')]['id'];}return db[_0xb4df('0x29')][_0xb4df('0x41')]({'where':{'id':_0x1d1cfc['params']['id']}})[_0xb4df('0x21')](handleEntityNotFound(_0x3ea188,null))[_0xb4df('0x21')](saveUpdates(_0x1d1cfc[_0xb4df('0x43')],null))['then'](respondWithResult(_0x3ea188,null))[_0xb4df('0x3d')](handleError(_0x3ea188,null));};exports[_0xb4df('0x22')]=function(_0x45ee02,_0x39fb40){return db['OpenchannelTransferReport'][_0xb4df('0x41')]({'where':{'id':_0x45ee02[_0xb4df('0x3f')]['id']}})[_0xb4df('0x21')](handleEntityNotFound(_0x39fb40,null))[_0xb4df('0x21')](removeEntity(_0x39fb40,null))['catch'](handleError(_0x39fb40,null));};exports[_0xb4df('0x44')]=function(_0xf812b4,_0x1788c6){return db['OpenchannelTransferReport'][_0xb4df('0x44')]()['then'](respondWithResult(_0x1788c6,null))[_0xb4df('0x3d')](handleError(_0x1788c6,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index e92ef58..f40564e 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 _0x7c91=['../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x250ef3,_0x204cda){var _0x1ca44c=function(_0x525430){while(--_0x525430){_0x250ef3['push'](_0x250ef3['shift']());}};_0x1ca44c(++_0x204cda);}(_0x7c91,0x1b4));var _0x17c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c91[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x17c9('0x0'));var logger=require(_0x17c9('0x1'))(_0x17c9('0x2'));var moment=require('moment');var BPromise=require(_0x17c9('0x3'));var rp=require(_0x17c9('0x4'));var fs=require('fs');var path=require(_0x17c9('0x5'));var rimraf=require('rimraf');var config=require(_0x17c9('0x6'));var attributes=require(_0x17c9('0x7'));module[_0x17c9('0x8')]=function(_0x5df509,_0x703a58){return _0x5df509[_0x17c9('0x9')](_0x17c9('0xa'),attributes,{'tableName':_0x17c9('0xb'),'paranoid':![],'indexes':[{'name':_0x17c9('0xc'),'fields':[_0x17c9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xab3f=['./openchannelTransferReport.attributes','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x6f7c64,_0x4a8555){var _0x16753a=function(_0xbb964c){while(--_0xbb964c){_0x6f7c64['push'](_0x6f7c64['shift']());}};_0x16753a(++_0x4a8555);}(_0xab3f,0x1dd));var _0xfab3=function(_0x43a569,_0x4276cd){_0x43a569=_0x43a569-0x0;var _0x1408e0=_0xab3f[_0x43a569];return _0x1408e0;};'use strict';var _=require(_0xfab3('0x0'));var util=require(_0xfab3('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfab3('0x2'));var rp=require(_0xfab3('0x3'));var fs=require('fs');var path=require(_0xfab3('0x4'));var rimraf=require(_0xfab3('0x5'));var config=require(_0xfab3('0x6'));var attributes=require(_0xfab3('0x7'));module['exports']=function(_0x19f03c,_0x4e0f27){return _0x19f03c['define'](_0xfab3('0x8'),attributes,{'tableName':_0xfab3('0x9'),'paranoid':![],'indexes':[{'name':_0xfab3('0xa'),'fields':[_0xfab3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 5323dda..090ffaa 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 _0xa990=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xa990,0xc9));var _0x0a99=function(_0x2df144,_0x49d5e0){_0x2df144=_0x2df144-0x0;var _0x1e36f8=_0xa990[_0x2df144];return _0x1e36f8;};'use strict';var _=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var moment=require(_0x0a99('0x2'));var BPromise=require(_0x0a99('0x3'));var rs=require(_0x0a99('0x4'));var fs=require('fs');var Redis=require(_0x0a99('0x5'));var db=require(_0x0a99('0x6'))['db'];var utils=require(_0x0a99('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0a99('0x8'));var jayson=require(_0x0a99('0x9'));var client=jayson[_0x0a99('0xa')][_0x0a99('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45b195,_0x398d95,_0xc6001b){return new BPromise(function(_0x599c7,_0x3cf0ef){return client[_0x0a99('0xc')](_0x45b195,_0xc6001b)[_0x0a99('0xd')](function(_0x56810b){logger[_0x0a99('0xe')](_0x0a99('0xf'),_0x398d95,'request\x20sent');logger['debug'](_0x0a99('0x10'),_0x398d95,_0x0a99('0x11'),JSON[_0x0a99('0x12')](_0x56810b));if(_0x56810b[_0x0a99('0x13')]){if(_0x56810b[_0x0a99('0x13')]['code']===0x1f4){logger[_0x0a99('0x13')](_0x0a99('0xf'),_0x398d95,_0x56810b['error'][_0x0a99('0x14')]);return _0x3cf0ef(_0x56810b[_0x0a99('0x13')][_0x0a99('0x14')]);}logger[_0x0a99('0x13')](_0x0a99('0xf'),_0x398d95,_0x56810b[_0x0a99('0x13')][_0x0a99('0x14')]);return _0x599c7(_0x56810b[_0x0a99('0x13')]['message']);}else{logger['info'](_0x0a99('0xf'),_0x398d95,_0x0a99('0x11'));_0x599c7(_0x56810b[_0x0a99('0x15')]['message']);}})[_0x0a99('0x16')](function(_0x5c91f9){logger['error'](_0x0a99('0xf'),_0x398d95,_0x5c91f9);_0x3cf0ef(_0x5c91f9);});});} \ No newline at end of file +var _0x383d=['debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1bdb86,_0x41e065){var _0x7b6c9c=function(_0x36f4d4){while(--_0x36f4d4){_0x1bdb86['push'](_0x1bdb86['shift']());}};_0x7b6c9c(++_0x41e065);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd383('0x0'));var BPromise=require(_0xd383('0x1'));var rs=require(_0xd383('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd383('0x3'))['db'];var utils=require(_0xd383('0x4'));var logger=require(_0xd383('0x5'))(_0xd383('0x6'));var config=require(_0xd383('0x7'));var jayson=require(_0xd383('0x8'));var client=jayson['client'][_0xd383('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30ba82,_0x9922e9,_0x470d8d){return new BPromise(function(_0xffa778,_0x5d4e0f){return client['request'](_0x30ba82,_0x470d8d)[_0xd383('0xa')](function(_0xb3ff62){logger['info'](_0xd383('0xb'),_0x9922e9,_0xd383('0xc'));logger[_0xd383('0xd')](_0xd383('0xe'),_0x9922e9,_0xd383('0xc'),JSON[_0xd383('0xf')](_0xb3ff62));if(_0xb3ff62['error']){if(_0xb3ff62[_0xd383('0x10')][_0xd383('0x11')]===0x1f4){logger[_0xd383('0x10')](_0xd383('0xb'),_0x9922e9,_0xb3ff62['error'][_0xd383('0x12')]);return _0x5d4e0f(_0xb3ff62[_0xd383('0x10')][_0xd383('0x12')]);}logger[_0xd383('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x9922e9,_0xb3ff62[_0xd383('0x10')]['message']);return _0xffa778(_0xb3ff62[_0xd383('0x10')][_0xd383('0x12')]);}else{logger[_0xd383('0x13')](_0xd383('0xb'),_0x9922e9,_0xd383('0xc'));_0xffa778(_0xb3ff62[_0xd383('0x14')]['message']);}})['catch'](function(_0x3905c1){logger[_0xd383('0x10')](_0xd383('0xb'),_0x9922e9,_0x3905c1);_0x5d4e0f(_0x3905c1);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index fe859ed..b438924 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 _0xdf6d=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index'];(function(_0x148117,_0x5b617f){var _0x4efb61=function(_0xb41052){while(--_0xb41052){_0x148117['push'](_0x148117['shift']());}};_0x4efb61(++_0x5b617f);}(_0xdf6d,0x15e));var _0xddf6=function(_0x1bcb1a,_0xf57821){_0x1bcb1a=_0x1bcb1a-0x0;var _0x288274=_0xdf6d[_0x1bcb1a];return _0x288274;};'use strict';var multer=require(_0xddf6('0x0'));var util=require('util');var path=require(_0xddf6('0x1'));var timeout=require(_0xddf6('0x2'));var express=require(_0xddf6('0x3'));var router=express[_0xddf6('0x4')]();var fs_extra=require(_0xddf6('0x5'));var auth=require(_0xddf6('0x6'));var interaction=require(_0xddf6('0x7'));var config=require(_0xddf6('0x8'));var controller=require('./pause.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xddf6('0x9')]);router['get'](_0xddf6('0xa'),auth[_0xddf6('0xb')](),controller[_0xddf6('0xc')]);router[_0xddf6('0xd')]('/',auth['isAuthenticated'](),controller[_0xddf6('0xe')]);router[_0xddf6('0xf')](_0xddf6('0xa'),auth[_0xddf6('0xb')](),controller[_0xddf6('0x10')]);router[_0xddf6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xddf6('0x12')]);module[_0xddf6('0x13')]=router; \ No newline at end of file +var _0x2227=['/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get'];(function(_0x490203,_0x2b548e){var _0x33c716=function(_0x471b7d){while(--_0x471b7d){_0x490203['push'](_0x490203['shift']());}};_0x33c716(++_0x2b548e);}(_0x2227,0x143));var _0x7222=function(_0x2fe689,_0x5794e5){_0x2fe689=_0x2fe689-0x0;var _0x35ea44=_0x2227[_0x2fe689];return _0x35ea44;};'use strict';var multer=require(_0x7222('0x0'));var util=require('util');var path=require(_0x7222('0x1'));var timeout=require(_0x7222('0x2'));var express=require(_0x7222('0x3'));var router=express[_0x7222('0x4')]();var fs_extra=require(_0x7222('0x5'));var auth=require(_0x7222('0x6'));var interaction=require(_0x7222('0x7'));var config=require(_0x7222('0x8'));var controller=require(_0x7222('0x9'));router['get']('/',auth[_0x7222('0xa')](),controller[_0x7222('0xb')]);router[_0x7222('0xc')](_0x7222('0xd'),auth['isAuthenticated'](),controller[_0x7222('0xe')]);router[_0x7222('0xf')]('/',auth[_0x7222('0xa')](),controller[_0x7222('0x10')]);router[_0x7222('0x11')]('/:id',auth[_0x7222('0xa')](),controller[_0x7222('0x12')]);router[_0x7222('0x13')](_0x7222('0xd'),auth[_0x7222('0xa')](),controller['destroy']);module[_0x7222('0x14')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 534d8cd..a2dbe90 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 _0x3ae7=['sequelize','exports','STRING','name'];(function(_0x4a1361,_0xccab9e){var _0x1d0e0d=function(_0x4199a5){while(--_0x4199a5){_0x4a1361['push'](_0x4a1361['shift']());}};_0x1d0e0d(++_0xccab9e);}(_0x3ae7,0x1e4));var _0x73ae=function(_0x4b4606,_0x14941e){_0x4b4606=_0x4b4606-0x0;var _0x5da78c=_0x3ae7[_0x4b4606];return _0x5da78c;};'use strict';var Sequelize=require(_0x73ae('0x0'));module[_0x73ae('0x1')]={'name':{'type':Sequelize[_0x73ae('0x2')],'unique':_0x73ae('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5afd=['exports','STRING','name'];(function(_0x115bce,_0x5f1f5d){var _0x46d47d=function(_0x4060b5){while(--_0x4060b5){_0x115bce['push'](_0x115bce['shift']());}};_0x46d47d(++_0x5f1f5d);}(_0x5afd,0x1e9));var _0xd5af=function(_0x564adf,_0x861a9){_0x564adf=_0x564adf-0x0;var _0x506f27=_0x5afd[_0x564adf];return _0x506f27;};'use strict';var Sequelize=require('sequelize');module[_0xd5af('0x0')]={'name':{'type':Sequelize[_0xd5af('0x1')],'unique':_0xd5af('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xd5af('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 786e9fe..3e6af4f 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 _0x42a2=['end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Pause','includeAll','include','findAll','params','length','options','catch','body','user','Pauses','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','moment','util','path','sox','to-csv','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x445aba,_0x3d2cfe){var _0x2f458e=function(_0x35baa2){while(--_0x35baa2){_0x445aba['push'](_0x445aba['shift']());}};_0x2f458e(++_0x3d2cfe);}(_0x42a2,0x1f3));var _0x242a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x42a2[_0x4792c8];return _0x35edb1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x242a('0x0'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x242a('0x1'));var path=require(_0x242a('0x2'));var sox=require(_0x242a('0x3'));var csv=require(_0x242a('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x242a('0x5'));var crypto=require('crypto');var jsforce=require(_0x242a('0x6'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x242a('0x7'));var Papa=require(_0x242a('0x8'));var Redis=require('ioredis');var authService=require(_0x242a('0x9'));var qs=require('../../components/parsers/qs');var as=require(_0x242a('0xa'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x242a('0xb'))(_0x242a('0xc'));var utils=require(_0x242a('0xd'));var config=require(_0x242a('0xe'));var licenseUtil=require(_0x242a('0xf'));var db=require(_0x242a('0x10'))['db'];function respondWithStatusCode(_0x328e14,_0x4c21f1){_0x4c21f1=_0x4c21f1||0xcc;return function(_0x2d2749){if(_0x2d2749){return _0x328e14[_0x242a('0x11')](_0x4c21f1);}return _0x328e14[_0x242a('0x12')](_0x4c21f1)[_0x242a('0x13')]();};}function respondWithResult(_0x4e788b,_0x4016d9){_0x4016d9=_0x4016d9||0xc8;return function(_0x5a11f3){if(_0x5a11f3){return _0x4e788b[_0x242a('0x12')](_0x4016d9)[_0x242a('0x14')](_0x5a11f3);}};}function respondWithFilteredResult(_0x24ff1e,_0x307c43){return function(_0x46c4ee){if(_0x46c4ee){var _0x522ad0=typeof _0x307c43[_0x242a('0x15')]===_0x242a('0x16')&&typeof _0x307c43[_0x242a('0x17')]===_0x242a('0x16');var _0x51ad74=_0x46c4ee[_0x242a('0x18')];var _0x3db475=_0x522ad0?0x0:_0x307c43['offset'];var _0x25a4d3=_0x522ad0?_0x46c4ee[_0x242a('0x18')]:_0x307c43['offset']+_0x307c43[_0x242a('0x17')];var _0xc1166e;if(_0x25a4d3>=_0x51ad74){_0x25a4d3=_0x51ad74;_0xc1166e=0xc8;}else{_0xc1166e=0xce;}_0x24ff1e[_0x242a('0x12')](_0xc1166e);return _0x24ff1e[_0x242a('0x19')](_0x242a('0x1a'),_0x3db475+'-'+_0x25a4d3+'/'+_0x51ad74)[_0x242a('0x14')](_0x46c4ee);}return null;};}function patchUpdates(_0x47a70d){return function(_0x493c01){try{jsonpatch[_0x242a('0x1b')](_0x493c01,_0x47a70d,!![]);}catch(_0x58c8a8){return BPromise['reject'](_0x58c8a8);}return _0x493c01['save']();};}function saveUpdates(_0x48378d,_0x2fea3d){return function(_0x1b96a3){if(_0x1b96a3){return _0x1b96a3[_0x242a('0x1c')](_0x48378d)[_0x242a('0x1d')](function(_0x1af2ec){return _0x1af2ec;});}return null;};}function removeEntity(_0xb5fc0f,_0x5ae7a8){return function(_0x5d15e0){if(_0x5d15e0){return _0x5d15e0[_0x242a('0x1e')]()[_0x242a('0x1d')](function(){var _0x1e2a2b=_0x5d15e0[_0x242a('0x1f')]({'plain':!![]});var _0x2415da='Pauses';return db[_0x242a('0x20')]['destroy']({'where':{'type':_0x2415da,'resourceId':_0x1e2a2b['id']}})['then'](function(){return _0x5d15e0;});})[_0x242a('0x1d')](function(){_0xb5fc0f['status'](0xcc)[_0x242a('0x13')]();});}};}function handleEntityNotFound(_0x1326f4,_0x51be42){return function(_0x18509c){if(!_0x18509c){_0x1326f4[_0x242a('0x11')](0x194);}return _0x18509c;};}function handleError(_0x3db53d,_0x1d39e9){_0x1d39e9=_0x1d39e9||0x1f4;return function(_0x34b69a){logger['error'](_0x34b69a[_0x242a('0x21')]);if(_0x34b69a[_0x242a('0x22')]){delete _0x34b69a['name'];}_0x3db53d[_0x242a('0x12')](_0x1d39e9)['send'](_0x34b69a);};}exports[_0x242a('0x23')]=function(_0x2359bd,_0x44ae0c){var _0x48a0d0={},_0x241f42={},_0x56268b={'count':0x0,'rows':[]};var _0x1e7f03=_[_0x242a('0x24')](db['Pause'][_0x242a('0x25')],function(_0x767bb1){return{'name':_0x767bb1[_0x242a('0x26')],'type':_0x767bb1[_0x242a('0x27')]['key']};});_0x241f42[_0x242a('0x28')]=_[_0x242a('0x24')](_0x1e7f03,_0x242a('0x22'));_0x241f42[_0x242a('0x29')]=_[_0x242a('0x2a')](_0x2359bd['query']);_0x241f42[_0x242a('0x2b')]=_[_0x242a('0x2c')](_0x241f42['model'],_0x241f42['query']);_0x48a0d0[_0x242a('0x2d')]=_[_0x242a('0x2c')](_0x241f42[_0x242a('0x28')],qs[_0x242a('0x2e')](_0x2359bd[_0x242a('0x29')][_0x242a('0x2e')]));_0x48a0d0[_0x242a('0x2d')]=_0x48a0d0['attributes']['length']?_0x48a0d0['attributes']:_0x241f42[_0x242a('0x28')];if(!_0x2359bd['query'][_0x242a('0x2f')](_0x242a('0x30'))){_0x48a0d0[_0x242a('0x17')]=qs[_0x242a('0x17')](_0x2359bd['query'][_0x242a('0x17')]);_0x48a0d0[_0x242a('0x15')]=qs[_0x242a('0x15')](_0x2359bd[_0x242a('0x29')]['offset']);}_0x48a0d0[_0x242a('0x31')]=qs[_0x242a('0x32')](_0x2359bd[_0x242a('0x29')][_0x242a('0x32')]);_0x48a0d0[_0x242a('0x33')]=qs['filters'](_[_0x242a('0x34')](_0x2359bd[_0x242a('0x29')],_0x241f42[_0x242a('0x2b')]),_0x1e7f03);if(_0x2359bd['query'][_0x242a('0x35')]){_0x48a0d0[_0x242a('0x33')]=_[_0x242a('0x36')](_0x48a0d0[_0x242a('0x33')],{'$or':_[_0x242a('0x24')](_0x1e7f03,function(_0x108885){if(_0x108885[_0x242a('0x27')]!==_0x242a('0x37')){var _0x2480b3={};_0x2480b3[_0x108885['name']]={'$like':'%'+_0x2359bd['query'][_0x242a('0x35')]+'%'};return _0x2480b3;}})});}_0x48a0d0=_[_0x242a('0x36')]({},_0x48a0d0,_0x2359bd['options']);var _0xca9da2={'where':_0x48a0d0['where']};return db[_0x242a('0x38')]['count'](_0xca9da2)[_0x242a('0x1d')](function(_0x5f0b88){_0x56268b['count']=_0x5f0b88;if(_0x2359bd[_0x242a('0x29')][_0x242a('0x39')]){_0x48a0d0[_0x242a('0x3a')]=[{'all':!![]}];}return db[_0x242a('0x38')][_0x242a('0x3b')](_0x48a0d0);})['then'](function(_0x2af96f){_0x56268b['rows']=_0x2af96f;return _0x56268b;})[_0x242a('0x1d')](respondWithFilteredResult(_0x44ae0c,_0x48a0d0))['catch'](handleError(_0x44ae0c,null));};exports['show']=function(_0x21c7b5,_0x17cc35){var _0x23573f={'raw':!![],'where':{'id':_0x21c7b5[_0x242a('0x3c')]['id']}},_0x48c184={};_0x48c184['model']=_[_0x242a('0x2a')](db[_0x242a('0x38')][_0x242a('0x25')]);_0x48c184[_0x242a('0x29')]=_[_0x242a('0x2a')](_0x21c7b5[_0x242a('0x29')]);_0x48c184[_0x242a('0x2b')]=_[_0x242a('0x2c')](_0x48c184[_0x242a('0x28')],_0x48c184[_0x242a('0x29')]);_0x23573f['attributes']=_[_0x242a('0x2c')](_0x48c184['model'],qs[_0x242a('0x2e')](_0x21c7b5[_0x242a('0x29')]['fields']));_0x23573f[_0x242a('0x2d')]=_0x23573f[_0x242a('0x2d')][_0x242a('0x3d')]?_0x23573f[_0x242a('0x2d')]:_0x48c184[_0x242a('0x28')];if(_0x21c7b5[_0x242a('0x29')][_0x242a('0x39')]){_0x23573f[_0x242a('0x3a')]=[{'all':!![]}];}_0x23573f=_[_0x242a('0x36')]({},_0x23573f,_0x21c7b5[_0x242a('0x3e')]);return db['Pause']['find'](_0x23573f)[_0x242a('0x1d')](handleEntityNotFound(_0x17cc35,null))['then'](respondWithResult(_0x17cc35,null))[_0x242a('0x3f')](handleError(_0x17cc35,null));};exports['create']=function(_0x346b3a,_0x4716fa){return db[_0x242a('0x38')]['create'](_0x346b3a[_0x242a('0x40')],{})['then'](function(_0x45ac3b){var _0x472859=_0x346b3a[_0x242a('0x41')][_0x242a('0x1f')]({'plain':!![]});if(!_0x472859)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x472859['role']==='user'){var _0x388e33=_0x45ac3b[_0x242a('0x1f')]({'plain':!![]});var _0x1fb61c=_0x242a('0x42');return db[_0x242a('0x43')]['find']({'where':{'name':_0x1fb61c,'userProfileId':_0x472859[_0x242a('0x44')]},'raw':!![]})[_0x242a('0x1d')](function(_0x37e6cd){if(_0x37e6cd&&_0x37e6cd[_0x242a('0x45')]===0x0){return db[_0x242a('0x20')][_0x242a('0x46')]({'name':_0x388e33[_0x242a('0x22')],'resourceId':_0x388e33['id'],'type':_0x37e6cd['name'],'sectionId':_0x37e6cd['id']},{})[_0x242a('0x1d')](function(){return _0x45ac3b;});}else{return _0x45ac3b;}})['catch'](function(_0x5c4649){logger[_0x242a('0x47')](_0x242a('0x48'),_0x5c4649);throw _0x5c4649;});}return _0x45ac3b;})['then'](respondWithResult(_0x4716fa,0xc9))['catch'](handleError(_0x4716fa,null));};exports['update']=function(_0x39fa62,_0x5dd82f){if(_0x39fa62[_0x242a('0x40')]['id']){delete _0x39fa62[_0x242a('0x40')]['id'];}return db[_0x242a('0x38')][_0x242a('0x49')]({'where':{'id':_0x39fa62[_0x242a('0x3c')]['id']}})[_0x242a('0x1d')](handleEntityNotFound(_0x5dd82f,null))[_0x242a('0x1d')](saveUpdates(_0x39fa62[_0x242a('0x40')],null))[_0x242a('0x1d')](respondWithResult(_0x5dd82f,null))[_0x242a('0x3f')](handleError(_0x5dd82f,null));};exports[_0x242a('0x1e')]=function(_0xeca84a,_0x4fd090){return db[_0x242a('0x38')]['find']({'where':{'id':_0xeca84a[_0x242a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4fd090,null))['then'](removeEntity(_0x4fd090,null))[_0x242a('0x3f')](handleError(_0x4fd090,null));}; \ No newline at end of file +var _0xf499=['rimraf','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','limit','undefined','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','end','sendStatus','name','send','index','Pause','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','include','rows','catch','show','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format'];(function(_0x38dd10,_0x3bc54c){var _0x42dcac=function(_0x1754b7){while(--_0x1754b7){_0x38dd10['push'](_0x38dd10['shift']());}};_0x42dcac(++_0x3bc54c);}(_0xf499,0x199));var _0x9f49=function(_0x5d821b,_0x51af51){_0x5d821b=_0x5d821b-0x0;var _0x94b98d=_0xf499[_0x5d821b];return _0x94b98d;};'use strict';var emlformat=require(_0x9f49('0x0'));var rimraf=require(_0x9f49('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f49('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f49('0x3'));var Mustache=require(_0x9f49('0x4'));var util=require('util');var path=require('path');var sox=require(_0x9f49('0x5'));var csv=require(_0x9f49('0x6'));var ejs=require(_0x9f49('0x7'));var fs=require('fs');var fs_extra=require(_0x9f49('0x8'));var _=require(_0x9f49('0x9'));var squel=require(_0x9f49('0xa'));var crypto=require('crypto');var jsforce=require(_0x9f49('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9f49('0xc'));var Papa=require(_0x9f49('0xd'));var Redis=require(_0x9f49('0xe'));var authService=require(_0x9f49('0xf'));var qs=require(_0x9f49('0x10'));var as=require(_0x9f49('0x11'));var hardwareService=require(_0x9f49('0x12'));var logger=require(_0x9f49('0x13'))(_0x9f49('0x14'));var utils=require('../../config/utils');var config=require(_0x9f49('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f49('0x16'))['db'];function respondWithStatusCode(_0x2b8349,_0x20941c){_0x20941c=_0x20941c||0xcc;return function(_0x26ce2f){if(_0x26ce2f){return _0x2b8349['sendStatus'](_0x20941c);}return _0x2b8349[_0x9f49('0x17')](_0x20941c)['end']();};}function respondWithResult(_0x5ac3b4,_0x47992c){_0x47992c=_0x47992c||0xc8;return function(_0x41d718){if(_0x41d718){return _0x5ac3b4[_0x9f49('0x17')](_0x47992c)['json'](_0x41d718);}};}function respondWithFilteredResult(_0x12a7ae,_0x5f045e){return function(_0x41cfae){if(_0x41cfae){var _0x179f1d=typeof _0x5f045e['offset']==='undefined'&&typeof _0x5f045e[_0x9f49('0x18')]===_0x9f49('0x19');var _0x3254a0=_0x41cfae[_0x9f49('0x1a')];var _0x2a9bed=_0x179f1d?0x0:_0x5f045e['offset'];var _0x34a935=_0x179f1d?_0x41cfae[_0x9f49('0x1a')]:_0x5f045e[_0x9f49('0x1b')]+_0x5f045e[_0x9f49('0x18')];var _0x393be9;if(_0x34a935>=_0x3254a0){_0x34a935=_0x3254a0;_0x393be9=0xc8;}else{_0x393be9=0xce;}_0x12a7ae[_0x9f49('0x17')](_0x393be9);return _0x12a7ae['set'](_0x9f49('0x1c'),_0x2a9bed+'-'+_0x34a935+'/'+_0x3254a0)[_0x9f49('0x1d')](_0x41cfae);}return null;};}function patchUpdates(_0x5ce9bd){return function(_0x20e091){try{jsonpatch[_0x9f49('0x1e')](_0x20e091,_0x5ce9bd,!![]);}catch(_0x128eec){return BPromise[_0x9f49('0x1f')](_0x128eec);}return _0x20e091[_0x9f49('0x20')]();};}function saveUpdates(_0x408693,_0x574f3e){return function(_0x598054){if(_0x598054){return _0x598054[_0x9f49('0x21')](_0x408693)[_0x9f49('0x22')](function(_0x3a4c44){return _0x3a4c44;});}return null;};}function removeEntity(_0x27884c,_0x2af623){return function(_0x200a98){if(_0x200a98){return _0x200a98[_0x9f49('0x23')]()[_0x9f49('0x22')](function(){var _0x2d4f1e=_0x200a98[_0x9f49('0x24')]({'plain':!![]});var _0x4a0bd8=_0x9f49('0x25');return db[_0x9f49('0x26')][_0x9f49('0x23')]({'where':{'type':_0x4a0bd8,'resourceId':_0x2d4f1e['id']}})[_0x9f49('0x22')](function(){return _0x200a98;});})[_0x9f49('0x22')](function(){_0x27884c[_0x9f49('0x17')](0xcc)[_0x9f49('0x27')]();});}};}function handleEntityNotFound(_0x204a13,_0x528db7){return function(_0x63ddd9){if(!_0x63ddd9){_0x204a13[_0x9f49('0x28')](0x194);}return _0x63ddd9;};}function handleError(_0x5e4adc,_0x22693c){_0x22693c=_0x22693c||0x1f4;return function(_0x5e8416){logger['error'](_0x5e8416['stack']);if(_0x5e8416[_0x9f49('0x29')]){delete _0x5e8416[_0x9f49('0x29')];}_0x5e4adc[_0x9f49('0x17')](_0x22693c)[_0x9f49('0x2a')](_0x5e8416);};}exports[_0x9f49('0x2b')]=function(_0x3d7c21,_0x4dd163){var _0x3b6fa5={},_0x39d1af={},_0x43b6fc={'count':0x0,'rows':[]};var _0x5f0dfb=_['map'](db[_0x9f49('0x2c')][_0x9f49('0x2d')],function(_0x38165d){return{'name':_0x38165d[_0x9f49('0x2e')],'type':_0x38165d[_0x9f49('0x2f')][_0x9f49('0x30')]};});_0x39d1af[_0x9f49('0x31')]=_[_0x9f49('0x32')](_0x5f0dfb,_0x9f49('0x29'));_0x39d1af['query']=_[_0x9f49('0x33')](_0x3d7c21[_0x9f49('0x34')]);_0x39d1af[_0x9f49('0x35')]=_['intersection'](_0x39d1af['model'],_0x39d1af['query']);_0x3b6fa5[_0x9f49('0x36')]=_[_0x9f49('0x37')](_0x39d1af[_0x9f49('0x31')],qs['fields'](_0x3d7c21[_0x9f49('0x34')][_0x9f49('0x38')]));_0x3b6fa5[_0x9f49('0x36')]=_0x3b6fa5[_0x9f49('0x36')][_0x9f49('0x39')]?_0x3b6fa5['attributes']:_0x39d1af[_0x9f49('0x31')];if(!_0x3d7c21[_0x9f49('0x34')][_0x9f49('0x3a')](_0x9f49('0x3b'))){_0x3b6fa5['limit']=qs['limit'](_0x3d7c21[_0x9f49('0x34')][_0x9f49('0x18')]);_0x3b6fa5[_0x9f49('0x1b')]=qs[_0x9f49('0x1b')](_0x3d7c21['query'][_0x9f49('0x1b')]);}_0x3b6fa5[_0x9f49('0x3c')]=qs[_0x9f49('0x3d')](_0x3d7c21['query'][_0x9f49('0x3d')]);_0x3b6fa5[_0x9f49('0x3e')]=qs[_0x9f49('0x35')](_['pick'](_0x3d7c21[_0x9f49('0x34')],_0x39d1af[_0x9f49('0x35')]),_0x5f0dfb);if(_0x3d7c21[_0x9f49('0x34')]['filter']){_0x3b6fa5[_0x9f49('0x3e')]=_[_0x9f49('0x3f')](_0x3b6fa5[_0x9f49('0x3e')],{'$or':_[_0x9f49('0x32')](_0x5f0dfb,function(_0x2a2638){if(_0x2a2638['type']!=='VIRTUAL'){var _0x4c2c3b={};_0x4c2c3b[_0x2a2638[_0x9f49('0x29')]]={'$like':'%'+_0x3d7c21[_0x9f49('0x34')][_0x9f49('0x40')]+'%'};return _0x4c2c3b;}})});}_0x3b6fa5=_['merge']({},_0x3b6fa5,_0x3d7c21[_0x9f49('0x41')]);var _0x50e8d7={'where':_0x3b6fa5[_0x9f49('0x3e')]};return db['Pause'][_0x9f49('0x1a')](_0x50e8d7)[_0x9f49('0x22')](function(_0x56663a){_0x43b6fc[_0x9f49('0x1a')]=_0x56663a;if(_0x3d7c21[_0x9f49('0x34')]['includeAll']){_0x3b6fa5[_0x9f49('0x42')]=[{'all':!![]}];}return db[_0x9f49('0x2c')]['findAll'](_0x3b6fa5);})[_0x9f49('0x22')](function(_0x164b77){_0x43b6fc[_0x9f49('0x43')]=_0x164b77;return _0x43b6fc;})['then'](respondWithFilteredResult(_0x4dd163,_0x3b6fa5))[_0x9f49('0x44')](handleError(_0x4dd163,null));};exports[_0x9f49('0x45')]=function(_0x12e33a,_0x3bd184){var _0x52e20c={'raw':!![],'where':{'id':_0x12e33a['params']['id']}},_0x2e0490={};_0x2e0490[_0x9f49('0x31')]=_['keys'](db[_0x9f49('0x2c')][_0x9f49('0x2d')]);_0x2e0490[_0x9f49('0x34')]=_[_0x9f49('0x33')](_0x12e33a[_0x9f49('0x34')]);_0x2e0490[_0x9f49('0x35')]=_['intersection'](_0x2e0490[_0x9f49('0x31')],_0x2e0490[_0x9f49('0x34')]);_0x52e20c[_0x9f49('0x36')]=_[_0x9f49('0x37')](_0x2e0490['model'],qs[_0x9f49('0x38')](_0x12e33a[_0x9f49('0x34')]['fields']));_0x52e20c['attributes']=_0x52e20c['attributes'][_0x9f49('0x39')]?_0x52e20c[_0x9f49('0x36')]:_0x2e0490[_0x9f49('0x31')];if(_0x12e33a[_0x9f49('0x34')][_0x9f49('0x46')]){_0x52e20c[_0x9f49('0x42')]=[{'all':!![]}];}_0x52e20c=_['merge']({},_0x52e20c,_0x12e33a[_0x9f49('0x41')]);return db[_0x9f49('0x2c')][_0x9f49('0x47')](_0x52e20c)['then'](handleEntityNotFound(_0x3bd184,null))[_0x9f49('0x22')](respondWithResult(_0x3bd184,null))['catch'](handleError(_0x3bd184,null));};exports[_0x9f49('0x48')]=function(_0x270238,_0x185cc7){return db[_0x9f49('0x2c')][_0x9f49('0x48')](_0x270238['body'],{})[_0x9f49('0x22')](function(_0xa7c337){var _0x155c4a=_0x270238[_0x9f49('0x49')][_0x9f49('0x24')]({'plain':!![]});if(!_0x155c4a)throw new Error(_0x9f49('0x4a'));if(_0x155c4a['role']===_0x9f49('0x49')){var _0x3054d7=_0xa7c337[_0x9f49('0x24')]({'plain':!![]});var _0x1c5746=_0x9f49('0x25');return db[_0x9f49('0x4b')][_0x9f49('0x47')]({'where':{'name':_0x1c5746,'userProfileId':_0x155c4a[_0x9f49('0x4c')]},'raw':!![]})['then'](function(_0xb2f1df){if(_0xb2f1df&&_0xb2f1df[_0x9f49('0x4d')]===0x0){return db['UserProfileResource'][_0x9f49('0x48')]({'name':_0x3054d7[_0x9f49('0x29')],'resourceId':_0x3054d7['id'],'type':_0xb2f1df['name'],'sectionId':_0xb2f1df['id']},{})[_0x9f49('0x22')](function(){return _0xa7c337;});}else{return _0xa7c337;}})[_0x9f49('0x44')](function(_0x587712){logger[_0x9f49('0x4e')](_0x9f49('0x4f'),_0x587712);throw _0x587712;});}return _0xa7c337;})[_0x9f49('0x22')](respondWithResult(_0x185cc7,0xc9))[_0x9f49('0x44')](handleError(_0x185cc7,null));};exports[_0x9f49('0x21')]=function(_0x501b71,_0x20cdde){if(_0x501b71[_0x9f49('0x50')]['id']){delete _0x501b71[_0x9f49('0x50')]['id'];}return db[_0x9f49('0x2c')][_0x9f49('0x47')]({'where':{'id':_0x501b71[_0x9f49('0x51')]['id']}})[_0x9f49('0x22')](handleEntityNotFound(_0x20cdde,null))[_0x9f49('0x22')](saveUpdates(_0x501b71[_0x9f49('0x50')],null))[_0x9f49('0x22')](respondWithResult(_0x20cdde,null))[_0x9f49('0x44')](handleError(_0x20cdde,null));};exports[_0x9f49('0x23')]=function(_0x247394,_0x2f5752){return db['Pause'][_0x9f49('0x47')]({'where':{'id':_0x247394[_0x9f49('0x51')]['id']}})[_0x9f49('0x22')](handleEntityNotFound(_0x2f5752,null))[_0x9f49('0x22')](removeEntity(_0x2f5752,null))[_0x9f49('0x44')](handleError(_0x2f5752,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 02719f2..f3f8db0 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 _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x4284a2,_0x2d78b0){var _0x2bb623=function(_0x368370){while(--_0x368370){_0x4284a2['push'](_0x4284a2['shift']());}};_0x2bb623(++_0x2d78b0);}(_0xf494,0x1c6));var _0x4f49=function(_0x27a848,_0x2dfc9a){_0x27a848=_0x27a848-0x0;var _0x57dbb0=_0xf494[_0x27a848];return _0x57dbb0;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x33a5ec,_0x10c014){_0x33a5ec=_0x33a5ec-0x0;var _0x38f89c=_0x7fbe[_0x33a5ec];return _0x38f89c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),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 297d237..4f7dd3c 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(_0x5a8760,_0x3f7df1){var _0x34ac9c=function(_0x3b1f4a){while(--_0x3b1f4a){_0x5a8760['push'](_0x5a8760['shift']());}};_0x34ac9c(++_0x3f7df1);}(_0x7a54,0x106));var _0x47a5=function(_0x3f81f7,_0x515ad1){_0x3f81f7=_0x3f81f7-0x0;var _0x1b5793=_0x7a54[_0x3f81f7];return _0x1b5793;};'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(_0x4a4c1d,_0x26510b){var _0x3bd8a0=function(_0x1b54e7){while(--_0x1b54e7){_0x4a4c1d['push'](_0x4a4c1d['shift']());}};_0x3bd8a0(++_0x26510b);}(_0xb10b,0x12a));var _0xbb10=function(_0x4254e7,_0x4fc342){_0x4254e7=_0x4254e7-0x0;var _0x5e0844=_0xb10b[_0x4254e7];return _0x5e0844;};'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 7df2c9f..dbbdfa7 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 _0x5178=['root','server/files/plugins','originalname','replace','format','basename','extname','now','post','single','file','upload','webhookPost','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/webhook','webhookGet','isAuthenticated','/:id/download','diskStorage','join'];(function(_0x4e0eea,_0x5cf9e6){var _0x544871=function(_0x16acea){while(--_0x16acea){_0x4e0eea['push'](_0x4e0eea['shift']());}};_0x544871(++_0x5cf9e6);}(_0x5178,0x171));var _0x8517=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x5178[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x8517('0x0'));var path=require(_0x8517('0x1'));var timeout=require(_0x8517('0x2'));var express=require(_0x8517('0x3'));var router=express[_0x8517('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var controller=require('./plugin.controller');router[_0x8517('0x7')]('/',auth['isAuthenticated'](),controller[_0x8517('0x8')]);router[_0x8517('0x7')](_0x8517('0x9'),controller[_0x8517('0xa')]);router[_0x8517('0x7')]('/:id',auth[_0x8517('0xb')](),controller['show']);router['get'](_0x8517('0xc'),auth[_0x8517('0xb')](),controller['download']);var upload=multer({'storage':multer[_0x8517('0xd')]({'destination':function(_0x24172f,_0x203154,_0x3be6b0){_0x3be6b0(null,path[_0x8517('0xe')](config[_0x8517('0xf')],_0x8517('0x10')));},'filename':function(_0x12388f,_0x4b9768,_0x9c57de){_0x4b9768[_0x8517('0x11')]=_0x4b9768[_0x8517('0x11')][_0x8517('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x9c57de(null,util[_0x8517('0x13')]('%s-%s%s',path[_0x8517('0x14')](_0x4b9768[_0x8517('0x11')],path[_0x8517('0x15')](_0x4b9768[_0x8517('0x11')])),Date[_0x8517('0x16')](),path[_0x8517('0x15')](_0x4b9768[_0x8517('0x11')])));}})});router[_0x8517('0x17')]('/',upload[_0x8517('0x18')](_0x8517('0x19')),controller[_0x8517('0x1a')]);router[_0x8517('0x17')]('/webhook',controller[_0x8517('0x1b')]);router[_0x8517('0x1c')](_0x8517('0x1d'),auth[_0x8517('0xb')](),controller[_0x8517('0x1e')]);router[_0x8517('0x1f')](_0x8517('0x1d'),auth['isAuthenticated'](),controller[_0x8517('0x1f')]);module['exports']=router; \ No newline at end of file +var _0xcb99=['originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','update','delete','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','/:id','show','download','diskStorage','join'];(function(_0x278a9d,_0x4589d4){var _0x956b6f=function(_0x275dc2){while(--_0x275dc2){_0x278a9d['push'](_0x278a9d['shift']());}};_0x956b6f(++_0x4589d4);}(_0xcb99,0x8b));var _0x9cb9=function(_0x4e6cbb,_0x3450f0){_0x4e6cbb=_0x4e6cbb-0x0;var _0x15ced4=_0xcb99[_0x4e6cbb];return _0x15ced4;};'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'),controller[_0x9cb9('0xa')]);router[_0x9cb9('0x8')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router[_0x9cb9('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x9cb9('0xd')]);var upload=multer({'storage':multer[_0x9cb9('0xe')]({'destination':function(_0x1b4fa6,_0x5a0ac7,_0x3be02c){_0x3be02c(null,path[_0x9cb9('0xf')](config['root'],'server/files/plugins'));},'filename':function(_0x227d49,_0x2e687e,_0x3382c8){_0x2e687e[_0x9cb9('0x10')]=_0x2e687e['originalname'][_0x9cb9('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3382c8(null,util[_0x9cb9('0x12')](_0x9cb9('0x13'),path[_0x9cb9('0x14')](_0x2e687e[_0x9cb9('0x10')],path[_0x9cb9('0x15')](_0x2e687e[_0x9cb9('0x10')])),Date[_0x9cb9('0x16')](),path[_0x9cb9('0x15')](_0x2e687e[_0x9cb9('0x10')])));}})});router[_0x9cb9('0x17')]('/',upload[_0x9cb9('0x18')](_0x9cb9('0x19')),controller[_0x9cb9('0x1a')]);router[_0x9cb9('0x17')](_0x9cb9('0x9'),controller[_0x9cb9('0x1b')]);router[_0x9cb9('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x1d')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index b65a7f4..52a584b 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 _0xe911=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','script','TEXT'];(function(_0x26f30f,_0x173f07){var _0x9feaa2=function(_0x4fe16f){while(--_0x4fe16f){_0x26f30f['push'](_0x26f30f['shift']());}};_0x9feaa2(++_0x173f07);}(_0xe911,0x8b));var _0x1e91=function(_0x185fb0,_0x2ba208){_0x185fb0=_0x185fb0-0x0;var _0x4b3f3b=_0xe911[_0x185fb0];return _0x4b3f3b;};'use strict';var Sequelize=require('sequelize');module[_0x1e91('0x0')]={'name':{'type':Sequelize[_0x1e91('0x1')]},'type':{'type':Sequelize[_0x1e91('0x2')]('html',_0x1e91('0x3'))},'description':{'type':Sequelize[_0x1e91('0x4')]},'version':{'type':Sequelize[_0x1e91('0x4')]},'path':{'type':Sequelize[_0x1e91('0x1')],'comment':_0x1e91('0x5')},'active':{'type':Sequelize[_0x1e91('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x1e91('0x2')](_0x1e91('0x7'),_0x1e91('0x8'),_0x1e91('0x9'),_0x1e91('0xa')),'defaultValue':'always','comment':_0x1e91('0xb')},'icon':{'type':Sequelize[_0x1e91('0x1')]},'adminUrl':{'type':Sequelize[_0x1e91('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x1e91('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfe9d=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never'];(function(_0x6af1d6,_0x350b0a){var _0x10c00b=function(_0x1a0523){while(--_0x1a0523){_0x6af1d6['push'](_0x6af1d6['shift']());}};_0x10c00b(++_0x350b0a);}(_0xfe9d,0x1a1));var _0xdfe9=function(_0x2b44d0,_0x4df26c){_0x2b44d0=_0x2b44d0-0x0;var _0x45fc61=_0xfe9d[_0x2b44d0];return _0x45fc61;};'use strict';var Sequelize=require(_0xdfe9('0x0'));module[_0xdfe9('0x1')]={'name':{'type':Sequelize[_0xdfe9('0x2')]},'type':{'type':Sequelize[_0xdfe9('0x3')](_0xdfe9('0x4'),_0xdfe9('0x5'))},'description':{'type':Sequelize[_0xdfe9('0x6')]},'version':{'type':Sequelize[_0xdfe9('0x6')]},'path':{'type':Sequelize[_0xdfe9('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xdfe9('0x7')],'defaultValue':0x0,'comment':_0xdfe9('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0xdfe9('0x9'),'agentOnly',_0xdfe9('0xa'),_0xdfe9('0xb')),'defaultValue':'always','comment':_0xdfe9('0xc')},'icon':{'type':Sequelize[_0xdfe9('0x2')]},'adminUrl':{'type':Sequelize[_0xdfe9('0x2')]},'agentUrl':{'type':Sequelize[_0xdfe9('0x2')]},'scriptName':{'type':Sequelize[_0xdfe9('0x2')]},'scriptPath':{'type':Sequelize[_0xdfe9('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 2856ae5..2e62219 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 _0xb527=['order','sort','where','filters','pick','filter','merge','type','VIRTUAL','Plugin','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','download','join','root','format','%s.zip','basename','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','info','Temporary\x20file\x20removed','file','filename','extname','server/files/plugins','0777','readdirSync','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','Plugin\x20manifest\x20missing','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon-apps','plugins','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','webhookGet','resolve','port','hostname','encoding','method','%s%s','headers','content-type','endsWith','statusCode','sendStatus','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','content-length','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x16568b,_0x1400aa){var _0x405220=function(_0x1567ae){while(--_0x1567ae){_0x16568b['push'](_0x16568b['shift']());}};_0x405220(++_0x1400aa);}(_0xb527,0x117));var _0x7b52=function(_0x1ea78c,_0x5ca37e){_0x1ea78c=_0x1ea78c-0x0;var _0x17329b=_0xb527[_0x1ea78c];return _0x17329b;};'use strict';var emlformat=require(_0x7b52('0x0'));var rimraf=require(_0x7b52('0x1'));var zipdir=require(_0x7b52('0x2'));var jsonpatch=require(_0x7b52('0x3'));var rp=require(_0x7b52('0x4'));var moment=require(_0x7b52('0x5'));var BPromise=require(_0x7b52('0x6'));var Mustache=require(_0x7b52('0x7'));var util=require(_0x7b52('0x8'));var path=require(_0x7b52('0x9'));var sox=require(_0x7b52('0xa'));var csv=require(_0x7b52('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b52('0xc'));var _=require(_0x7b52('0xd'));var squel=require(_0x7b52('0xe'));var crypto=require(_0x7b52('0xf'));var jsforce=require(_0x7b52('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x7b52('0xb'));var querystring=require(_0x7b52('0x11'));var Papa=require(_0x7b52('0x12'));var extract=require(_0x7b52('0x13'));var rimraf=require('rimraf');var archiver=require(_0x7b52('0x14'));var Redis=require('ioredis');var authService=require(_0x7b52('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x7b52('0x16'));var hardwareService=require(_0x7b52('0x17'));var logger=require(_0x7b52('0x18'))(_0x7b52('0x19'));var utils=require('../../config/utils');var config=require(_0x7b52('0x1a'));var licenseUtil=require(_0x7b52('0x1b'));var db=require('../../mysqldb')['db'];config[_0x7b52('0x1c')]=_[_0x7b52('0x1d')](config[_0x7b52('0x1c')],{'host':_0x7b52('0x1e'),'port':0x18eb});var socket=require(_0x7b52('0x1f'))(new Redis(config[_0x7b52('0x1c')]));require(_0x7b52('0x20'))[_0x7b52('0x21')](socket);function respondWithStatusCode(_0xf82c99,_0x5f58f0){_0x5f58f0=_0x5f58f0||0xcc;return function(_0x507658){if(_0x507658){return _0xf82c99['sendStatus'](_0x5f58f0);}return _0xf82c99[_0x7b52('0x22')](_0x5f58f0)[_0x7b52('0x23')]();};}function respondWithResult(_0x17513e,_0x5a7f){_0x5a7f=_0x5a7f||0xc8;return function(_0x293f3a){if(_0x293f3a){return _0x17513e[_0x7b52('0x22')](_0x5a7f)[_0x7b52('0x24')](_0x293f3a);}};}function respondWithFilteredResult(_0x241534,_0x1ae09a){return function(_0x259f61){if(_0x259f61){var _0x11f246=typeof _0x1ae09a[_0x7b52('0x25')]===_0x7b52('0x26')&&typeof _0x1ae09a[_0x7b52('0x27')]==='undefined';var _0x543929=_0x259f61[_0x7b52('0x28')];var _0x4eb277=_0x11f246?0x0:_0x1ae09a['offset'];var _0x2fd00a=_0x11f246?_0x259f61[_0x7b52('0x28')]:_0x1ae09a['offset']+_0x1ae09a['limit'];var _0x208bb1;if(_0x2fd00a>=_0x543929){_0x2fd00a=_0x543929;_0x208bb1=0xc8;}else{_0x208bb1=0xce;}_0x241534[_0x7b52('0x22')](_0x208bb1);return _0x241534[_0x7b52('0x29')]('Content-Range',_0x4eb277+'-'+_0x2fd00a+'/'+_0x543929)[_0x7b52('0x24')](_0x259f61);}return null;};}function patchUpdates(_0x1e5ce3){return function(_0x195a2f){try{jsonpatch[_0x7b52('0x2a')](_0x195a2f,_0x1e5ce3,!![]);}catch(_0x34abc7){return BPromise[_0x7b52('0x2b')](_0x34abc7);}return _0x195a2f[_0x7b52('0x2c')]();};}function saveUpdates(_0x1b67ea,_0x259b5d){return function(_0x1d6e4d){if(_0x1d6e4d){return _0x1d6e4d[_0x7b52('0x2d')](_0x1b67ea)[_0x7b52('0x2e')](function(_0x5cf75c){return _0x5cf75c;});}return null;};}function removeEntity(_0x2a3c57,_0x52ceed){return function(_0x22307c){if(_0x22307c){return _0x22307c[_0x7b52('0x2f')]()[_0x7b52('0x2e')](function(){var _0x491735=_0x22307c[_0x7b52('0x30')]({'plain':!![]});var _0x49efa6='Plugins';return db[_0x7b52('0x31')][_0x7b52('0x2f')]({'where':{'type':_0x49efa6,'resourceId':_0x491735['id']}})[_0x7b52('0x2e')](function(){return _0x22307c;});})[_0x7b52('0x2e')](function(){_0x2a3c57['status'](0xcc)[_0x7b52('0x23')]();});}};}function handleEntityNotFound(_0x404560,_0x3a0bfb){return function(_0x541d9f){if(!_0x541d9f){_0x404560['sendStatus'](0x194);}return _0x541d9f;};}function handleError(_0x1f8a73,_0x3421d2){_0x3421d2=_0x3421d2||0x1f4;return function(_0x3654f1){logger[_0x7b52('0x32')](_0x3654f1[_0x7b52('0x33')]);if(_0x3654f1[_0x7b52('0x34')]){delete _0x3654f1[_0x7b52('0x34')];}_0x1f8a73[_0x7b52('0x22')](_0x3421d2)[_0x7b52('0x35')](_0x3654f1);};}exports[_0x7b52('0x36')]=function(_0x416815,_0x183dfb){var _0x248e47={},_0x3f6741={},_0x54d504={'count':0x0,'rows':[]};var _0x14d317=_[_0x7b52('0x37')](db['Plugin']['rawAttributes'],function(_0xc8ac6c){return{'name':_0xc8ac6c[_0x7b52('0x38')],'type':_0xc8ac6c['type'][_0x7b52('0x39')]};});_0x3f6741[_0x7b52('0x3a')]=_['map'](_0x14d317,_0x7b52('0x34'));_0x3f6741[_0x7b52('0x3b')]=_[_0x7b52('0x3c')](_0x416815[_0x7b52('0x3b')]);_0x3f6741['filters']=_[_0x7b52('0x3d')](_0x3f6741[_0x7b52('0x3a')],_0x3f6741[_0x7b52('0x3b')]);_0x248e47[_0x7b52('0x3e')]=_[_0x7b52('0x3d')](_0x3f6741['model'],qs[_0x7b52('0x3f')](_0x416815[_0x7b52('0x3b')][_0x7b52('0x3f')]));_0x248e47[_0x7b52('0x3e')]=_0x248e47[_0x7b52('0x3e')][_0x7b52('0x40')]?_0x248e47[_0x7b52('0x3e')]:_0x3f6741['model'];if(!_0x416815[_0x7b52('0x3b')][_0x7b52('0x41')](_0x7b52('0x42'))){_0x248e47[_0x7b52('0x27')]=qs['limit'](_0x416815[_0x7b52('0x3b')][_0x7b52('0x27')]);_0x248e47[_0x7b52('0x25')]=qs[_0x7b52('0x25')](_0x416815[_0x7b52('0x3b')][_0x7b52('0x25')]);}_0x248e47[_0x7b52('0x43')]=qs[_0x7b52('0x44')](_0x416815[_0x7b52('0x3b')]['sort']);_0x248e47[_0x7b52('0x45')]=qs[_0x7b52('0x46')](_[_0x7b52('0x47')](_0x416815['query'],_0x3f6741[_0x7b52('0x46')]),_0x14d317);if(_0x416815[_0x7b52('0x3b')][_0x7b52('0x48')]){_0x248e47['where']=_[_0x7b52('0x49')](_0x248e47[_0x7b52('0x45')],{'$or':_[_0x7b52('0x37')](_0x14d317,function(_0x34538a){if(_0x34538a[_0x7b52('0x4a')]!==_0x7b52('0x4b')){var _0x56115a={};_0x56115a[_0x34538a[_0x7b52('0x34')]]={'$like':'%'+_0x416815[_0x7b52('0x3b')][_0x7b52('0x48')]+'%'};return _0x56115a;}})});}_0x248e47=_[_0x7b52('0x49')]({},_0x248e47,_0x416815['options']);var _0x57233f={'where':_0x248e47[_0x7b52('0x45')]};return db['Plugin']['count'](_0x57233f)[_0x7b52('0x2e')](function(_0xc67096){_0x54d504[_0x7b52('0x28')]=_0xc67096;if(_0x416815[_0x7b52('0x3b')]['includeAll']){_0x248e47['include']=[{'all':!![]}];}return db[_0x7b52('0x4c')][_0x7b52('0x4d')](_0x248e47);})[_0x7b52('0x2e')](function(_0x34096a){_0x54d504[_0x7b52('0x4e')]=_0x34096a;return _0x54d504;})[_0x7b52('0x2e')](respondWithFilteredResult(_0x183dfb,_0x248e47))[_0x7b52('0x4f')](handleError(_0x183dfb,null));};exports[_0x7b52('0x50')]=function(_0x234f34,_0x3cacfd){var _0x3edc80={'raw':!![],'where':{'id':_0x234f34[_0x7b52('0x51')]['id']}},_0x3f67a1={};_0x3f67a1['model']=_['keys'](db['Plugin'][_0x7b52('0x52')]);_0x3f67a1[_0x7b52('0x3b')]=_['keys'](_0x234f34[_0x7b52('0x3b')]);_0x3f67a1['filters']=_[_0x7b52('0x3d')](_0x3f67a1[_0x7b52('0x3a')],_0x3f67a1[_0x7b52('0x3b')]);_0x3edc80[_0x7b52('0x3e')]=_[_0x7b52('0x3d')](_0x3f67a1['model'],qs['fields'](_0x234f34[_0x7b52('0x3b')][_0x7b52('0x3f')]));_0x3edc80[_0x7b52('0x3e')]=_0x3edc80['attributes'][_0x7b52('0x40')]?_0x3edc80[_0x7b52('0x3e')]:_0x3f67a1[_0x7b52('0x3a')];if(_0x234f34[_0x7b52('0x3b')][_0x7b52('0x53')]){_0x3edc80[_0x7b52('0x54')]=[{'all':!![]}];}_0x3edc80=_[_0x7b52('0x49')]({},_0x3edc80,_0x234f34['options']);return db[_0x7b52('0x4c')][_0x7b52('0x55')](_0x3edc80)['then'](handleEntityNotFound(_0x3cacfd,null))[_0x7b52('0x2e')](respondWithResult(_0x3cacfd,null))[_0x7b52('0x4f')](handleError(_0x3cacfd,null));};exports[_0x7b52('0x56')]=function(_0x205e68,_0x1f6a9a,_0x4e4e8c){return db['Plugin'][_0x7b52('0x55')]({'where':{'id':_0x205e68['params']['id']},'attributes':['name',_0x7b52('0x9')],'raw':!![]})[_0x7b52('0x2e')](handleEntityNotFound(_0x1f6a9a,null))[_0x7b52('0x2e')](function(_0x49eed2){if(_0x49eed2){var _0x40058f=path[_0x7b52('0x57')](config[_0x7b52('0x58')],'server/files/plugins',util[_0x7b52('0x59')](_0x7b52('0x5a'),path[_0x7b52('0x5b')](_0x49eed2['path'])));var _0x48e7d3=fs['createWriteStream'](_0x40058f);var _0x1fb794=archiver(_0x7b52('0x5c'),{'zlib':{'level':0x9}});_0x1fb794['on'](_0x7b52('0x5d'),function(_0x7640b5){if(_0x7640b5[_0x7b52('0x5e')]==='ENOENT'){logger[_0x7b52('0x32')](_0x7640b5);}else{throw new db[(_0x7b52('0x5f'))][(_0x7b52('0x60'))](_0x7b52('0x61'));}});_0x1fb794['on'](_0x7b52('0x32'),function(_0x524ce0){throw new db[(_0x7b52('0x5f'))][(_0x7b52('0x60'))](_0x7b52('0x61'));});_0x1fb794[_0x7b52('0x62')](_0x48e7d3);_0x1fb794[_0x7b52('0x63')](_0x7b52('0x64'),{'cwd':path[_0x7b52('0x57')](config[_0x7b52('0x58')],'server/files/plugins',path[_0x7b52('0x65')](_0x49eed2[_0x7b52('0x9')])),'ignore':[path[_0x7b52('0x57')](path[_0x7b52('0x5b')](_0x49eed2['path']),_0x7b52('0x66')),path['join'](path[_0x7b52('0x5b')](_0x49eed2['path']),_0x7b52('0x67'))],'nodir':!![]})[_0x7b52('0x68')]();_0x48e7d3['on'](_0x7b52('0x69'),function(){if(!fs[_0x7b52('0x6a')](_0x40058f)){throw new db[(_0x7b52('0x5f'))][(_0x7b52('0x60'))]('Plugin\x20not\x20found');}return _0x1f6a9a[_0x7b52('0x56')](_0x40058f,util['format'](_0x7b52('0x5a'),path['basename'](_0x49eed2[_0x7b52('0x9')])),function(_0x71d5ce){if(_0x71d5ce){throw new db[(_0x7b52('0x5f'))][(_0x7b52('0x60'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x40058f);logger[_0x7b52('0x6b')]('Download\x20completed');logger[_0x7b52('0x6b')](_0x7b52('0x6c'));});});}return null;})[_0x7b52('0x4f')](handleError(_0x1f6a9a,null));};exports['upload']=function(_0xefde0f,_0x57efbb,_0x5e2be0){var _0x22548f=path['basename'](_0xefde0f[_0x7b52('0x6d')][_0x7b52('0x6e')],path[_0x7b52('0x6f')](_0xefde0f[_0x7b52('0x6d')][_0x7b52('0x6e')]));var _0x66aaf0=path[_0x7b52('0x57')](config[_0x7b52('0x58')],_0x7b52('0x70'),_0xefde0f[_0x7b52('0x6d')][_0x7b52('0x6e')]);var _0x405210=path['join'](config[_0x7b52('0x58')],'server/files/plugins',_0x22548f);logger[_0x7b52('0x6b')]('Plugin\x20upload\x20filepath:\x20%s',_0x66aaf0);logger[_0x7b52('0x6b')]('Plugin\x20upload\x20destination:\x20%s',_0x405210);try{fs['chmodSync'](_0x66aaf0,parseInt(_0x7b52('0x71'),0x8));extract(_0x66aaf0,{'dir':_0x405210},function(_0x175f98){if(_0x175f98){logger[_0x7b52('0x32')](_0x175f98);handleError(_0x175f98,!![]);};var _0x55309e=fs[_0x7b52('0x72')](_0x405210);if(_0x55309e[_0x7b52('0x40')]>0x1){removeReferences(_0x66aaf0,_0x405210);logger[_0x7b52('0x32')]('Invalid\x20plugin\x20structure');return _0x5e2be0(new Error('Invalid\x20plugin\x20structure'));}var _0x48306f=fs[_0x7b52('0x73')](path[_0x7b52('0x57')](_0x405210,_0x55309e[0x0]));if(_0x48306f[_0x7b52('0x74')]()){removeReferences(_0x66aaf0,_0x405210);logger[_0x7b52('0x32')]('Invalid\x20plugin\x20structure');return _0x5e2be0(new Error(_0x7b52('0x75')));}if(_0x48306f[_0x7b52('0x76')]()){var _0x24a49d=fs['readdirSync'](path[_0x7b52('0x57')](_0x405210,_0x55309e[0x0]));if(_0x24a49d['length']===0x0){removeReferences(_0x66aaf0,_0x405210);logger[_0x7b52('0x32')](_0x7b52('0x75'));return _0x5e2be0(new Error('Invalid\x20plugin\x20structure'));}var _0x18f102=_0x24a49d['some'](function(_0x494b89){return _0x494b89==='manifest.json';});if(!_0x18f102){return _0x5e2be0(new Error(_0x7b52('0x77')));}var _0xab4b=fs['readFileSync'](path['join'](_0x405210,_0x55309e[0x0],_0x7b52('0x78')));var _0x4812e5=JSON[_0x7b52('0x79')](_0xab4b);if(_0x7b52('0x26')==typeof _0x4812e5[_0x7b52('0x34')]){return _0x5e2be0(new Error(_0x7b52('0x7a')));}if(_0x7b52('0x26')==typeof _0x4812e5[_0x7b52('0x4a')]){return _0x5e2be0(new Error(_0x7b52('0x7b')));}if(_0x7b52('0x26')==typeof _0x4812e5[_0x7b52('0x7c')]){return _0x5e2be0(new Error(_0x7b52('0x7d')));}if(_0x7b52('0x26')==typeof _0x4812e5[_0x7b52('0x7e')]){return _0x5e2be0(new Error(_0x7b52('0x7f')));}if(_0x4812e5[_0x7b52('0x4a')]===_0x7b52('0x80')){if(_0x7b52('0x26')==typeof _0x4812e5['parameters']['views']){return _0x5e2be0(new Error(_0x7b52('0x81')));}if(_0x7b52('0x26')==typeof _0x4812e5[_0x7b52('0x7e')][_0x7b52('0x82')][_0x7b52('0x83')]&&_0x7b52('0x26')==typeof _0x4812e5[_0x7b52('0x7e')][_0x7b52('0x82')][_0x7b52('0x84')]){return _0x5e2be0(new Error(_0x7b52('0x85')));}}else if(_0x4812e5['type']===_0x7b52('0x86')){if(_0x7b52('0x26')==typeof _0x4812e5[_0x7b52('0x7e')][_0x7b52('0x87')]){return _0x5e2be0(new Error(_0x7b52('0x88')));}if(_0x7b52('0x26')==typeof _0x4812e5[_0x7b52('0x7e')][_0x7b52('0x89')]){return _0x5e2be0(new Error(_0x7b52('0x8a')));}}else{return _0x5e2be0(new Error(_0x7b52('0x8b')));}var _0x2188ae=_0x4812e5[_0x7b52('0x34')];var _0xbd4b50=_0x4812e5['description'];var _0x465e6d=_0x4812e5[_0x7b52('0x4a')];var _0x22fef7=_0x4812e5[_0x7b52('0x8c')]?_0x4812e5['sidebar']:_0x7b52('0x8d');var _0x47f0fa=_0x4812e5['icon']?_0x4812e5['icon']:_0x7b52('0x8e');var _0xb91983='';var _0x213640='';var _0x475036='';var _0x309f9c='';var _0x4d1c6d=_0x4812e5[_0x7b52('0x7c')];if(_0x465e6d===_0x7b52('0x80')){if('undefined'!=typeof _0x4812e5[_0x7b52('0x7e')][_0x7b52('0x82')][_0x7b52('0x83')]){var _0x5e89eb=_0x4812e5[_0x7b52('0x7e')]['views'][_0x7b52('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5e89eb)){_0xb91983=path[_0x7b52('0x57')](_0x7b52('0x8f'),_0x22548f,_0x55309e[0x0],_0x5e89eb);}else{_0xb91983=_0x5e89eb;}}else{logger[_0x7b52('0x6b')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x7b52('0x26')!=typeof _0x4812e5[_0x7b52('0x7e')][_0x7b52('0x82')][_0x7b52('0x84')]){var _0x5dcb9b=_0x4812e5[_0x7b52('0x7e')][_0x7b52('0x82')][_0x7b52('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x7b52('0x90')](_0x5dcb9b)){_0x213640=path[_0x7b52('0x57')](_0x7b52('0x8f'),_0x22548f,_0x55309e[0x0],_0x5dcb9b);}else{_0x213640=_0x5dcb9b;}}else{logger[_0x7b52('0x6b')](_0x7b52('0x91'));}}else if(_0x465e6d==='script'){_0x475036=_0x4812e5[_0x7b52('0x7e')]['scriptName'];_0x309f9c=_0x4812e5[_0x7b52('0x7e')][_0x7b52('0x89')];if(_0x7b52('0x26')!=typeof _0x4812e5[_0x7b52('0x7e')][_0x7b52('0x82')]){if(_0x7b52('0x26')!=typeof _0x4812e5[_0x7b52('0x7e')][_0x7b52('0x82')][_0x7b52('0x83')]){var _0x5e89eb=_0x4812e5['parameters'][_0x7b52('0x82')][_0x7b52('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x7b52('0x90')](_0x5e89eb)){_0xb91983=path[_0x7b52('0x57')]('plugins',_0x22548f,_0x55309e[0x0],_0x5e89eb);}else{_0xb91983=_0x5e89eb;}}if('undefined'!=typeof _0x4812e5[_0x7b52('0x7e')][_0x7b52('0x82')]['agent']){var _0x5dcb9b=_0x4812e5[_0x7b52('0x7e')][_0x7b52('0x82')][_0x7b52('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5dcb9b)){_0x213640=path[_0x7b52('0x57')](_0x7b52('0x8f'),_0x22548f,_0x55309e[0x0],_0x5dcb9b);}else{_0x213640=_0x5dcb9b;}}}}var _0x3dd59c={'name':_0x2188ae,'description':_0xbd4b50,'path':path[_0x7b52('0x57')](_0x22548f,_0x55309e[0x0]),'type':_0x465e6d,'sidebar':_0x22fef7,'icon':_0x47f0fa,'adminUrl':_0xb91983,'agentUrl':_0x213640,'scriptName':_0x475036,'scriptPath':_0x309f9c,'version':_0x4d1c6d};removeReferences(_0x66aaf0,null);return db[_0x7b52('0x4c')][_0x7b52('0x92')](_0x3dd59c)[_0x7b52('0x2e')](function(_0x201136){var _0x5a7203={'role':_0xefde0f[_0x7b52('0x93')][_0x7b52('0x94')],'userProfileId':_0xefde0f[_0x7b52('0x93')]['userProfileId']};if(!_0x5a7203)throw new Error(_0x7b52('0x95'));if(_0x5a7203['role']===_0x7b52('0x96')){var _0x27f9b0=_0x201136[_0x7b52('0x30')]({'plain':!![]});return db[_0x7b52('0x97')][_0x7b52('0x55')]({'where':{'name':_0x7b52('0x98'),'userProfileId':_0x5a7203[_0x7b52('0x99')]},'raw':!![]})['then'](function(_0x340dc6){if(_0x340dc6&&_0x340dc6[_0x7b52('0x9a')]===0x0){return db[_0x7b52('0x31')][_0x7b52('0x92')]({'name':_0x27f9b0['name'],'resourceId':_0x27f9b0['id'],'type':_0x340dc6[_0x7b52('0x34')],'sectionId':_0x340dc6['id']},{})[_0x7b52('0x2e')](function(){return _0x201136;});}else{return _0x201136;}})[_0x7b52('0x4f')](function(_0x147e41){logger[_0x7b52('0x32')](_0x7b52('0x9b'),_0x147e41);throw _0x147e41;});}return _0x201136;})[_0x7b52('0x2e')](respondWithResult(_0x57efbb,null))[_0x7b52('0x4f')](handleError(_0x57efbb,null));}});}catch(_0x4e7e72){_0x57efbb['status'](0x1f4)[_0x7b52('0x35')](_0x4e7e72);}};function removeReferences(_0x43b351,_0x152f7d){try{if(_0x43b351){fs[_0x7b52('0x9c')](_0x43b351);logger[_0x7b52('0x6b')]('Zip\x20archive\x20removed');}if(_0x152f7d){rimraf(_0x152f7d,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x1fcd50){logger[_0x7b52('0x32')](_0x1fcd50);}}exports[_0x7b52('0x2d')]=function(_0x3f1158,_0x3f04cf,_0xdb0de3){return db['Plugin']['find']({'where':{'id':_0x3f1158[_0x7b52('0x51')]['id']}})[_0x7b52('0x2e')](handleEntityNotFound(_0x3f04cf,null))['then'](saveUpdates(_0x3f1158[_0x7b52('0x93')],null))['then'](respondWithResult(_0x3f04cf,null))['catch'](handleError(_0x3f04cf,null));};exports['delete']=function(_0x503d87,_0x2435b4,_0x3f68fb){return db[_0x7b52('0x4c')][_0x7b52('0x55')]({'where':{'id':_0x503d87[_0x7b52('0x51')]['id']}})[_0x7b52('0x2e')](function(_0x41dc99){if(_0x41dc99){return _0x41dc99[_0x7b52('0x2f')]();}})[_0x7b52('0x2e')](function(_0x2e7381){rimraf(path[_0x7b52('0x57')](config[_0x7b52('0x58')],_0x7b52('0x70'),path[_0x7b52('0x65')](_0x2e7381[_0x7b52('0x9')])),function(){});return _0x2e7381;})[_0x7b52('0x2e')](handleEntityNotFound(_0x2435b4,null))[_0x7b52('0x2e')](respondWithStatusCode(_0x2435b4,null))[_0x7b52('0x4f')](handleError(_0x2435b4,null));};exports[_0x7b52('0x9d')]=function(_0x553134,_0x426adc,_0x2fae48){return BPromise[_0x7b52('0x9e')]()[_0x7b52('0x2e')](function(){if(!_0x553134[_0x7b52('0x3b')][_0x7b52('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x553134[_0x7b52('0x3b')][_0x7b52('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5bfd2c=_0x553134[_0x7b52('0x3b')][_0x7b52('0xa0')]?_0x553134[_0x7b52('0x3b')]['hostname']+':'+_0x553134[_0x7b52('0x3b')]['port']:'http://localhost:'+_0x553134[_0x7b52('0x3b')]['port'];var _0x5e6b8e=_0x553134[_0x7b52('0x3b')][_0x7b52('0x24')]?_0x553134[_0x7b52('0x3b')]['json']:!![];var _0x5b2edc=_0x553134['query'][_0x7b52('0xa1')]?_0x553134[_0x7b52('0x3b')][_0x7b52('0xa1')]:null;var _0x196b31={'method':_0x553134[_0x7b52('0xa2')],'uri':util[_0x7b52('0x59')](_0x7b52('0xa3'),_0x5bfd2c,_0x553134[_0x7b52('0x3b')]['path']),'json':_0x5e6b8e,'resolveWithFullResponse':!![],'encoding':_0x5b2edc,'qs':_0x553134[_0x7b52('0x3b')]};if(_0x553134[_0x7b52('0xa4')]){_0x196b31['headers']=_0x553134[_0x7b52('0xa4')];if(_0x196b31[_0x7b52('0xa4')]['content-length']){delete _0x196b31[_0x7b52('0xa4')]['content-length'];}}if(_0x196b31[_0x7b52('0xa4')][_0x7b52('0xa5')]){delete _0x196b31['headers']['content-type'];}return rp(_0x196b31);})[_0x7b52('0x2e')](function(_0x197a6d){if(_0x197a6d){_0x426adc[_0x7b52('0x29')](_0x197a6d['headers']);logger[_0x7b52('0x6b')](_0x197a6d[_0x7b52('0x93')]);if(_[_0x7b52('0xa6')](_0x553134[_0x7b52('0x3b')]['path'],'download')&&_0x197a6d[_0x7b52('0xa7')]==0x1f4){return _0x426adc['sendStatus'](_0x197a6d[_0x7b52('0xa7')]);}else{return _0x426adc[_0x7b52('0x22')](_0x197a6d[_0x7b52('0xa7')])['send'](_0x197a6d['body']);}}else{return _0x426adc[_0x7b52('0xa8')](0xc8);}})[_0x7b52('0x4f')](handleError(_0x426adc,null));};exports[_0x7b52('0xa9')]=function(_0x3eae19,_0x545357,_0xa9f0e3){return BPromise[_0x7b52('0x9e')]()[_0x7b52('0x2e')](function(){if(!_0x3eae19[_0x7b52('0x3b')][_0x7b52('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x3eae19[_0x7b52('0x3b')][_0x7b52('0x9f')]){throw new Error(_0x7b52('0xaa'));}var _0x25aec6=_0x3eae19['query']['hostname']?_0x3eae19['query'][_0x7b52('0xa0')]+':'+_0x3eae19[_0x7b52('0x3b')][_0x7b52('0x9f')]:_0x7b52('0xab')+_0x3eae19[_0x7b52('0x3b')]['port'];var _0x366568=_0x3eae19['query']['json']?_0x3eae19[_0x7b52('0x3b')]['json']:!![];var _0x5b393c=_0x3eae19[_0x7b52('0x3b')]['encoding']?_0x3eae19[_0x7b52('0x3b')]['encoding']:null;var _0x1f9bc7={'method':_0x3eae19['method'],'uri':util[_0x7b52('0x59')](_0x7b52('0xa3'),_0x25aec6,_0x3eae19[_0x7b52('0x3b')][_0x7b52('0x9')]),'json':_0x366568,'resolveWithFullResponse':!![],'encoding':_0x5b393c,'body':_0x3eae19['body']};if(_0x3eae19[_0x7b52('0xa4')]){_0x1f9bc7['headers']=_0x3eae19[_0x7b52('0xa4')];if(_0x1f9bc7['headers'][_0x7b52('0xac')]){delete _0x1f9bc7[_0x7b52('0xa4')][_0x7b52('0xac')];}}if(_0x1f9bc7['headers']['content-type']){delete _0x1f9bc7['headers'][_0x7b52('0xa5')];}return rp(_0x1f9bc7);})[_0x7b52('0x2e')](function(_0xf7792a){if(_0xf7792a){_0x545357[_0x7b52('0x29')](_0xf7792a['headers']);logger[_0x7b52('0x6b')](_0xf7792a[_0x7b52('0x93')]);return _0x545357[_0x7b52('0x22')](_0xf7792a[_0x7b52('0xa7')])[_0x7b52('0x35')](_0xf7792a[_0x7b52('0x93')]);}else{return _0x545357[_0x7b52('0xa8')](0xc8);}})[_0x7b52('0x4f')](handleError(_0x545357,null));}; \ No newline at end of file +var _0x1eb1=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','send','webhookPost','http://localhost:','method','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','UserProfileResource','error','stack','name','index','map','Plugin','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','catch','show','params','keys','includeAll','include','options','download','join','root','server/files/plugins','format','basename','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','dirname','attachments/**/*','close','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','info','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','admin','test','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Plugins'];(function(_0x3a0633,_0x120c59){var _0x58341e=function(_0x1ecb29){while(--_0x1ecb29){_0x3a0633['push'](_0x3a0633['shift']());}};_0x58341e(++_0x120c59);}(_0x1eb1,0xc7));var _0x11eb=function(_0x208bf0,_0x34c7ca){_0x208bf0=_0x208bf0-0x0;var _0x37b822=_0x1eb1[_0x208bf0];return _0x37b822;};'use strict';var emlformat=require(_0x11eb('0x0'));var rimraf=require(_0x11eb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x11eb('0x2'));var moment=require(_0x11eb('0x3'));var BPromise=require(_0x11eb('0x4'));var Mustache=require('mustache');var util=require(_0x11eb('0x5'));var path=require(_0x11eb('0x6'));var sox=require(_0x11eb('0x7'));var csv=require(_0x11eb('0x8'));var ejs=require(_0x11eb('0x9'));var fs=require('fs');var fs_extra=require(_0x11eb('0xa'));var _=require('lodash');var squel=require(_0x11eb('0xb'));var crypto=require('crypto');var jsforce=require(_0x11eb('0xc'));var deskjs=require(_0x11eb('0xd'));var toCsv=require(_0x11eb('0x8'));var querystring=require('querystring');var Papa=require(_0x11eb('0xe'));var extract=require(_0x11eb('0xf'));var rimraf=require(_0x11eb('0x1'));var archiver=require(_0x11eb('0x10'));var Redis=require(_0x11eb('0x11'));var authService=require(_0x11eb('0x12'));var qs=require(_0x11eb('0x13'));var as=require(_0x11eb('0x14'));var hardwareService=require(_0x11eb('0x15'));var logger=require(_0x11eb('0x16'))(_0x11eb('0x17'));var utils=require('../../config/utils');var config=require(_0x11eb('0x18'));var licenseUtil=require(_0x11eb('0x19'));var db=require('../../mysqldb')['db'];config[_0x11eb('0x1a')]=_[_0x11eb('0x1b')](config[_0x11eb('0x1a')],{'host':_0x11eb('0x1c'),'port':0x18eb});var socket=require(_0x11eb('0x1d'))(new Redis(config['redis']));require(_0x11eb('0x1e'))['register'](socket);function respondWithStatusCode(_0x13661e,_0x407eaa){_0x407eaa=_0x407eaa||0xcc;return function(_0x5cad32){if(_0x5cad32){return _0x13661e[_0x11eb('0x1f')](_0x407eaa);}return _0x13661e['status'](_0x407eaa)[_0x11eb('0x20')]();};}function respondWithResult(_0x58f8f3,_0x226546){_0x226546=_0x226546||0xc8;return function(_0x12393e){if(_0x12393e){return _0x58f8f3[_0x11eb('0x21')](_0x226546)[_0x11eb('0x22')](_0x12393e);}};}function respondWithFilteredResult(_0x33790b,_0x2d5715){return function(_0x33199b){if(_0x33199b){var _0x21c080=typeof _0x2d5715[_0x11eb('0x23')]===_0x11eb('0x24')&&typeof _0x2d5715[_0x11eb('0x25')]===_0x11eb('0x24');var _0x5b11b8=_0x33199b[_0x11eb('0x26')];var _0x5cd146=_0x21c080?0x0:_0x2d5715['offset'];var _0x14a5c7=_0x21c080?_0x33199b['count']:_0x2d5715[_0x11eb('0x23')]+_0x2d5715[_0x11eb('0x25')];var _0x1d1845;if(_0x14a5c7>=_0x5b11b8){_0x14a5c7=_0x5b11b8;_0x1d1845=0xc8;}else{_0x1d1845=0xce;}_0x33790b[_0x11eb('0x21')](_0x1d1845);return _0x33790b[_0x11eb('0x27')](_0x11eb('0x28'),_0x5cd146+'-'+_0x14a5c7+'/'+_0x5b11b8)['json'](_0x33199b);}return null;};}function patchUpdates(_0x3d6336){return function(_0x22ed79){try{jsonpatch['apply'](_0x22ed79,_0x3d6336,!![]);}catch(_0x29a845){return BPromise['reject'](_0x29a845);}return _0x22ed79[_0x11eb('0x29')]();};}function saveUpdates(_0x9e1841,_0x71696f){return function(_0x513703){if(_0x513703){return _0x513703[_0x11eb('0x2a')](_0x9e1841)[_0x11eb('0x2b')](function(_0x284bec){return _0x284bec;});}return null;};}function removeEntity(_0x38197b,_0x34e1b1){return function(_0x3b761d){if(_0x3b761d){return _0x3b761d[_0x11eb('0x2c')]()['then'](function(){var _0x3ec7e9=_0x3b761d['get']({'plain':!![]});var _0x63f192='Plugins';return db[_0x11eb('0x2d')]['destroy']({'where':{'type':_0x63f192,'resourceId':_0x3ec7e9['id']}})[_0x11eb('0x2b')](function(){return _0x3b761d;});})[_0x11eb('0x2b')](function(){_0x38197b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4155c3,_0x1e50fd){return function(_0x34a0d2){if(!_0x34a0d2){_0x4155c3[_0x11eb('0x1f')](0x194);}return _0x34a0d2;};}function handleError(_0x1c06ea,_0x1a0d12){_0x1a0d12=_0x1a0d12||0x1f4;return function(_0x15477c){logger[_0x11eb('0x2e')](_0x15477c[_0x11eb('0x2f')]);if(_0x15477c[_0x11eb('0x30')]){delete _0x15477c[_0x11eb('0x30')];}_0x1c06ea['status'](_0x1a0d12)['send'](_0x15477c);};}exports[_0x11eb('0x31')]=function(_0x189471,_0x51776d){var _0x2d146f={},_0x92b620={},_0x35a5da={'count':0x0,'rows':[]};var _0x31e05e=_[_0x11eb('0x32')](db[_0x11eb('0x33')]['rawAttributes'],function(_0x2a2b62){return{'name':_0x2a2b62[_0x11eb('0x34')],'type':_0x2a2b62[_0x11eb('0x35')][_0x11eb('0x36')]};});_0x92b620[_0x11eb('0x37')]=_['map'](_0x31e05e,'name');_0x92b620[_0x11eb('0x38')]=_['keys'](_0x189471['query']);_0x92b620[_0x11eb('0x39')]=_[_0x11eb('0x3a')](_0x92b620[_0x11eb('0x37')],_0x92b620[_0x11eb('0x38')]);_0x2d146f['attributes']=_[_0x11eb('0x3a')](_0x92b620[_0x11eb('0x37')],qs[_0x11eb('0x3b')](_0x189471[_0x11eb('0x38')][_0x11eb('0x3b')]));_0x2d146f[_0x11eb('0x3c')]=_0x2d146f[_0x11eb('0x3c')][_0x11eb('0x3d')]?_0x2d146f[_0x11eb('0x3c')]:_0x92b620['model'];if(!_0x189471[_0x11eb('0x38')][_0x11eb('0x3e')](_0x11eb('0x3f'))){_0x2d146f[_0x11eb('0x25')]=qs[_0x11eb('0x25')](_0x189471['query'][_0x11eb('0x25')]);_0x2d146f['offset']=qs[_0x11eb('0x23')](_0x189471[_0x11eb('0x38')][_0x11eb('0x23')]);}_0x2d146f[_0x11eb('0x40')]=qs[_0x11eb('0x41')](_0x189471[_0x11eb('0x38')][_0x11eb('0x41')]);_0x2d146f[_0x11eb('0x42')]=qs[_0x11eb('0x39')](_[_0x11eb('0x43')](_0x189471[_0x11eb('0x38')],_0x92b620[_0x11eb('0x39')]),_0x31e05e);if(_0x189471['query'][_0x11eb('0x44')]){_0x2d146f[_0x11eb('0x42')]=_[_0x11eb('0x45')](_0x2d146f[_0x11eb('0x42')],{'$or':_['map'](_0x31e05e,function(_0x5a9cdf){if(_0x5a9cdf['type']!==_0x11eb('0x46')){var _0x5607e3={};_0x5607e3[_0x5a9cdf[_0x11eb('0x30')]]={'$like':'%'+_0x189471['query'][_0x11eb('0x44')]+'%'};return _0x5607e3;}})});}_0x2d146f=_[_0x11eb('0x45')]({},_0x2d146f,_0x189471['options']);var _0x59c74c={'where':_0x2d146f['where']};return db['Plugin'][_0x11eb('0x26')](_0x59c74c)[_0x11eb('0x2b')](function(_0x4388fa){_0x35a5da[_0x11eb('0x26')]=_0x4388fa;if(_0x189471['query']['includeAll']){_0x2d146f['include']=[{'all':!![]}];}return db['Plugin'][_0x11eb('0x47')](_0x2d146f);})[_0x11eb('0x2b')](function(_0x492040){_0x35a5da['rows']=_0x492040;return _0x35a5da;})[_0x11eb('0x2b')](respondWithFilteredResult(_0x51776d,_0x2d146f))[_0x11eb('0x48')](handleError(_0x51776d,null));};exports[_0x11eb('0x49')]=function(_0x1acfa1,_0x48b637){var _0x378161={'raw':!![],'where':{'id':_0x1acfa1[_0x11eb('0x4a')]['id']}},_0x1e5f1d={};_0x1e5f1d[_0x11eb('0x37')]=_['keys'](db[_0x11eb('0x33')]['rawAttributes']);_0x1e5f1d[_0x11eb('0x38')]=_[_0x11eb('0x4b')](_0x1acfa1[_0x11eb('0x38')]);_0x1e5f1d[_0x11eb('0x39')]=_[_0x11eb('0x3a')](_0x1e5f1d['model'],_0x1e5f1d[_0x11eb('0x38')]);_0x378161['attributes']=_['intersection'](_0x1e5f1d[_0x11eb('0x37')],qs[_0x11eb('0x3b')](_0x1acfa1[_0x11eb('0x38')][_0x11eb('0x3b')]));_0x378161[_0x11eb('0x3c')]=_0x378161[_0x11eb('0x3c')][_0x11eb('0x3d')]?_0x378161[_0x11eb('0x3c')]:_0x1e5f1d[_0x11eb('0x37')];if(_0x1acfa1[_0x11eb('0x38')][_0x11eb('0x4c')]){_0x378161[_0x11eb('0x4d')]=[{'all':!![]}];}_0x378161=_[_0x11eb('0x45')]({},_0x378161,_0x1acfa1[_0x11eb('0x4e')]);return db[_0x11eb('0x33')]['find'](_0x378161)[_0x11eb('0x2b')](handleEntityNotFound(_0x48b637,null))[_0x11eb('0x2b')](respondWithResult(_0x48b637,null))[_0x11eb('0x48')](handleError(_0x48b637,null));};exports[_0x11eb('0x4f')]=function(_0x4017d3,_0x1e613a,_0xf264ac){return db[_0x11eb('0x33')]['find']({'where':{'id':_0x4017d3[_0x11eb('0x4a')]['id']},'attributes':[_0x11eb('0x30'),_0x11eb('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x1e613a,null))[_0x11eb('0x2b')](function(_0x368497){if(_0x368497){var _0x2050f5=path[_0x11eb('0x50')](config[_0x11eb('0x51')],_0x11eb('0x52'),util[_0x11eb('0x53')]('%s.zip',path[_0x11eb('0x54')](_0x368497['path'])));var _0x521c58=fs[_0x11eb('0x55')](_0x2050f5);var _0x28710f=archiver(_0x11eb('0x56'),{'zlib':{'level':0x9}});_0x28710f['on'](_0x11eb('0x57'),function(_0x25f284){if(_0x25f284[_0x11eb('0x58')]==='ENOENT'){logger[_0x11eb('0x2e')](_0x25f284);}else{throw new db[(_0x11eb('0x59'))][(_0x11eb('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x28710f['on'](_0x11eb('0x2e'),function(_0x36eb07){throw new db['Sequelize'][(_0x11eb('0x5a'))](_0x11eb('0x5b'));});_0x28710f[_0x11eb('0x5c')](_0x521c58);_0x28710f['glob'](_0x11eb('0x5d'),{'cwd':path[_0x11eb('0x50')](config[_0x11eb('0x51')],'server/files/plugins',path[_0x11eb('0x5e')](_0x368497[_0x11eb('0x6')])),'ignore':[path[_0x11eb('0x50')](path[_0x11eb('0x54')](_0x368497[_0x11eb('0x6')]),'node_modules/**/*'),path[_0x11eb('0x50')](path[_0x11eb('0x54')](_0x368497[_0x11eb('0x6')]),_0x11eb('0x5f'))],'nodir':!![]})['finalize']();_0x521c58['on'](_0x11eb('0x60'),function(){if(!fs[_0x11eb('0x61')](_0x2050f5)){throw new db[(_0x11eb('0x59'))][(_0x11eb('0x5a'))](_0x11eb('0x62'));}return _0x1e613a[_0x11eb('0x4f')](_0x2050f5,util[_0x11eb('0x53')](_0x11eb('0x63'),path[_0x11eb('0x54')](_0x368497[_0x11eb('0x6')])),function(_0x22cb0f){if(_0x22cb0f){throw new db[(_0x11eb('0x59'))]['Error'](_0x11eb('0x64'));}fs['unlinkSync'](_0x2050f5);logger['info'](_0x11eb('0x65'));logger['info'](_0x11eb('0x66'));});});}return null;})[_0x11eb('0x48')](handleError(_0x1e613a,null));};exports[_0x11eb('0x67')]=function(_0x3b1f54,_0x375301,_0x388825){var _0x43a6e4=path[_0x11eb('0x54')](_0x3b1f54[_0x11eb('0x68')][_0x11eb('0x69')],path[_0x11eb('0x6a')](_0x3b1f54[_0x11eb('0x68')][_0x11eb('0x69')]));var _0x1155ff=path['join'](config[_0x11eb('0x51')],_0x11eb('0x52'),_0x3b1f54[_0x11eb('0x68')][_0x11eb('0x69')]);var _0x47140a=path[_0x11eb('0x50')](config['root'],_0x11eb('0x52'),_0x43a6e4);logger[_0x11eb('0x6b')](_0x11eb('0x6c'),_0x1155ff);logger[_0x11eb('0x6b')](_0x11eb('0x6d'),_0x47140a);try{fs[_0x11eb('0x6e')](_0x1155ff,parseInt('0777',0x8));extract(_0x1155ff,{'dir':_0x47140a},function(_0x4f7628){if(_0x4f7628){logger[_0x11eb('0x2e')](_0x4f7628);handleError(_0x4f7628,!![]);};var _0x408298=fs[_0x11eb('0x6f')](_0x47140a);if(_0x408298['length']>0x1){removeReferences(_0x1155ff,_0x47140a);logger[_0x11eb('0x2e')](_0x11eb('0x70'));return _0x388825(new Error('Invalid\x20plugin\x20structure'));}var _0x13973b=fs[_0x11eb('0x71')](path[_0x11eb('0x50')](_0x47140a,_0x408298[0x0]));if(_0x13973b[_0x11eb('0x72')]()){removeReferences(_0x1155ff,_0x47140a);logger[_0x11eb('0x2e')](_0x11eb('0x70'));return _0x388825(new Error(_0x11eb('0x70')));}if(_0x13973b[_0x11eb('0x73')]()){var _0x2f2877=fs[_0x11eb('0x6f')](path[_0x11eb('0x50')](_0x47140a,_0x408298[0x0]));if(_0x2f2877[_0x11eb('0x3d')]===0x0){removeReferences(_0x1155ff,_0x47140a);logger[_0x11eb('0x2e')](_0x11eb('0x70'));return _0x388825(new Error(_0x11eb('0x70')));}var _0x4c6109=_0x2f2877[_0x11eb('0x74')](function(_0x46f5ac){return _0x46f5ac===_0x11eb('0x75');});if(!_0x4c6109){return _0x388825(new Error('Plugin\x20manifest\x20missing'));}var _0x51a4d9=fs[_0x11eb('0x76')](path['join'](_0x47140a,_0x408298[0x0],'manifest.json'));var _0x4eac42=JSON[_0x11eb('0x77')](_0x51a4d9);if('undefined'==typeof _0x4eac42['name']){return _0x388825(new Error(_0x11eb('0x78')));}if(_0x11eb('0x24')==typeof _0x4eac42['type']){return _0x388825(new Error(_0x11eb('0x79')));}if('undefined'==typeof _0x4eac42['version']){return _0x388825(new Error(_0x11eb('0x7a')));}if('undefined'==typeof _0x4eac42[_0x11eb('0x7b')]){return _0x388825(new Error(_0x11eb('0x7c')));}if(_0x4eac42[_0x11eb('0x35')]===_0x11eb('0x7d')){if('undefined'==typeof _0x4eac42[_0x11eb('0x7b')]['views']){return _0x388825(new Error(_0x11eb('0x7e')));}if(_0x11eb('0x24')==typeof _0x4eac42['parameters'][_0x11eb('0x7f')]['admin']&&_0x11eb('0x24')==typeof _0x4eac42[_0x11eb('0x7b')]['views'][_0x11eb('0x80')]){return _0x388825(new Error(_0x11eb('0x81')));}}else if(_0x4eac42[_0x11eb('0x35')]===_0x11eb('0x82')){if(_0x11eb('0x24')==typeof _0x4eac42[_0x11eb('0x7b')]['scriptName']){return _0x388825(new Error(_0x11eb('0x83')));}if(_0x11eb('0x24')==typeof _0x4eac42['parameters'][_0x11eb('0x84')]){return _0x388825(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x388825(new Error(_0x11eb('0x85')));}var _0x2ac20d=_0x4eac42[_0x11eb('0x30')];var _0x3d0beb=_0x4eac42[_0x11eb('0x86')];var _0x20e5d1=_0x4eac42[_0x11eb('0x35')];var _0x1cd344=_0x4eac42[_0x11eb('0x87')]?_0x4eac42[_0x11eb('0x87')]:_0x11eb('0x88');var _0x1ff5cc=_0x4eac42[_0x11eb('0x89')]?_0x4eac42[_0x11eb('0x89')]:_0x11eb('0x8a');var _0x5e62f3='';var _0x285c7d='';var _0x2c8739='';var _0x159167='';var _0x123b39=_0x4eac42[_0x11eb('0x8b')];if(_0x20e5d1===_0x11eb('0x7d')){if(_0x11eb('0x24')!=typeof _0x4eac42[_0x11eb('0x7b')][_0x11eb('0x7f')]['admin']){var _0x246520=_0x4eac42[_0x11eb('0x7b')][_0x11eb('0x7f')][_0x11eb('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x11eb('0x8d')](_0x246520)){_0x5e62f3=path[_0x11eb('0x50')]('plugins',_0x43a6e4,_0x408298[0x0],_0x246520);}else{_0x5e62f3=_0x246520;}}else{logger[_0x11eb('0x6b')](_0x11eb('0x8e'));}if(_0x11eb('0x24')!=typeof _0x4eac42[_0x11eb('0x7b')][_0x11eb('0x7f')]['agent']){var _0x1a3b75=_0x4eac42[_0x11eb('0x7b')][_0x11eb('0x7f')][_0x11eb('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x11eb('0x8d')](_0x1a3b75)){_0x285c7d=path[_0x11eb('0x50')]('plugins',_0x43a6e4,_0x408298[0x0],_0x1a3b75);}else{_0x285c7d=_0x1a3b75;}}else{logger[_0x11eb('0x6b')](_0x11eb('0x8f'));}}else if(_0x20e5d1===_0x11eb('0x82')){_0x2c8739=_0x4eac42[_0x11eb('0x7b')][_0x11eb('0x90')];_0x159167=_0x4eac42[_0x11eb('0x7b')][_0x11eb('0x84')];if(_0x11eb('0x24')!=typeof _0x4eac42[_0x11eb('0x7b')][_0x11eb('0x7f')]){if(_0x11eb('0x24')!=typeof _0x4eac42[_0x11eb('0x7b')]['views']['admin']){var _0x246520=_0x4eac42[_0x11eb('0x7b')]['views'][_0x11eb('0x8c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x246520)){_0x5e62f3=path['join']('plugins',_0x43a6e4,_0x408298[0x0],_0x246520);}else{_0x5e62f3=_0x246520;}}if(_0x11eb('0x24')!=typeof _0x4eac42[_0x11eb('0x7b')][_0x11eb('0x7f')][_0x11eb('0x80')]){var _0x1a3b75=_0x4eac42[_0x11eb('0x7b')][_0x11eb('0x7f')][_0x11eb('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x11eb('0x8d')](_0x1a3b75)){_0x285c7d=path[_0x11eb('0x50')]('plugins',_0x43a6e4,_0x408298[0x0],_0x1a3b75);}else{_0x285c7d=_0x1a3b75;}}}}var _0x20f1e4={'name':_0x2ac20d,'description':_0x3d0beb,'path':path['join'](_0x43a6e4,_0x408298[0x0]),'type':_0x20e5d1,'sidebar':_0x1cd344,'icon':_0x1ff5cc,'adminUrl':_0x5e62f3,'agentUrl':_0x285c7d,'scriptName':_0x2c8739,'scriptPath':_0x159167,'version':_0x123b39};removeReferences(_0x1155ff,null);return db[_0x11eb('0x33')][_0x11eb('0x91')](_0x20f1e4)['then'](function(_0x3cc128){var _0x2b5b48={'role':_0x3b1f54[_0x11eb('0x92')]['role'],'userProfileId':_0x3b1f54['body'][_0x11eb('0x93')]};if(!_0x2b5b48)throw new Error(_0x11eb('0x94'));if(_0x2b5b48[_0x11eb('0x95')]==='user'){var _0x29fe54=_0x3cc128['get']({'plain':!![]});return db[_0x11eb('0x96')][_0x11eb('0x97')]({'where':{'name':_0x11eb('0x98'),'userProfileId':_0x2b5b48[_0x11eb('0x93')]},'raw':!![]})[_0x11eb('0x2b')](function(_0x409c67){if(_0x409c67&&_0x409c67[_0x11eb('0x99')]===0x0){return db[_0x11eb('0x2d')][_0x11eb('0x91')]({'name':_0x29fe54[_0x11eb('0x30')],'resourceId':_0x29fe54['id'],'type':_0x409c67[_0x11eb('0x30')],'sectionId':_0x409c67['id']},{})[_0x11eb('0x2b')](function(){return _0x3cc128;});}else{return _0x3cc128;}})[_0x11eb('0x48')](function(_0x3f202a){logger[_0x11eb('0x2e')](_0x11eb('0x9a'),_0x3f202a);throw _0x3f202a;});}return _0x3cc128;})['then'](respondWithResult(_0x375301,null))['catch'](handleError(_0x375301,null));}});}catch(_0x110d08){_0x375301['status'](0x1f4)['send'](_0x110d08);}};function removeReferences(_0x5e585d,_0x54a619){try{if(_0x5e585d){fs[_0x11eb('0x9b')](_0x5e585d);logger[_0x11eb('0x6b')](_0x11eb('0x9c'));}if(_0x54a619){rimraf(_0x54a619,function(){});logger['info'](_0x11eb('0x9d'));}}catch(_0x817e59){logger[_0x11eb('0x2e')](_0x817e59);}}exports['update']=function(_0x4a915a,_0x42b95c,_0x8fc3e){return db[_0x11eb('0x33')]['find']({'where':{'id':_0x4a915a['params']['id']}})[_0x11eb('0x2b')](handleEntityNotFound(_0x42b95c,null))[_0x11eb('0x2b')](saveUpdates(_0x4a915a[_0x11eb('0x92')],null))[_0x11eb('0x2b')](respondWithResult(_0x42b95c,null))[_0x11eb('0x48')](handleError(_0x42b95c,null));};exports[_0x11eb('0x9e')]=function(_0x2f00bf,_0x4e5fdb,_0x79457f){return db['Plugin'][_0x11eb('0x97')]({'where':{'id':_0x2f00bf[_0x11eb('0x4a')]['id']}})['then'](function(_0x35b135){if(_0x35b135){return _0x35b135[_0x11eb('0x2c')]();}})[_0x11eb('0x2b')](function(_0x3df639){rimraf(path[_0x11eb('0x50')](config[_0x11eb('0x51')],_0x11eb('0x52'),path[_0x11eb('0x5e')](_0x3df639['path'])),function(){});return _0x3df639;})[_0x11eb('0x2b')](handleEntityNotFound(_0x4e5fdb,null))['then'](respondWithStatusCode(_0x4e5fdb,null))[_0x11eb('0x48')](handleError(_0x4e5fdb,null));};exports[_0x11eb('0x9f')]=function(_0x4d2e54,_0x5ddaa5,_0x14a315){return BPromise[_0x11eb('0xa0')]()[_0x11eb('0x2b')](function(){if(!_0x4d2e54[_0x11eb('0x38')][_0x11eb('0x6')]){throw new Error(_0x11eb('0xa1'));}if(!_0x4d2e54[_0x11eb('0x38')]['port']){throw new Error(_0x11eb('0xa2'));}var _0x45edee=_0x4d2e54['query'][_0x11eb('0xa3')]?_0x4d2e54[_0x11eb('0x38')][_0x11eb('0xa3')]+':'+_0x4d2e54[_0x11eb('0x38')][_0x11eb('0xa4')]:'http://localhost:'+_0x4d2e54['query'][_0x11eb('0xa4')];var _0x4d6341=_0x4d2e54[_0x11eb('0x38')]['json']?_0x4d2e54[_0x11eb('0x38')][_0x11eb('0x22')]:!![];var _0x217480=_0x4d2e54[_0x11eb('0x38')]['encoding']?_0x4d2e54[_0x11eb('0x38')][_0x11eb('0xa5')]:null;var _0x386f1e={'method':_0x4d2e54['method'],'uri':util[_0x11eb('0x53')](_0x11eb('0xa6'),_0x45edee,_0x4d2e54['query'][_0x11eb('0x6')]),'json':_0x4d6341,'resolveWithFullResponse':!![],'encoding':_0x217480,'qs':_0x4d2e54[_0x11eb('0x38')]};if(_0x4d2e54[_0x11eb('0xa7')]){_0x386f1e['headers']=_0x4d2e54[_0x11eb('0xa7')];if(_0x386f1e[_0x11eb('0xa7')][_0x11eb('0xa8')]){delete _0x386f1e['headers'][_0x11eb('0xa8')];}}if(_0x386f1e['headers']['content-type']){delete _0x386f1e['headers'][_0x11eb('0xa9')];}return rp(_0x386f1e);})[_0x11eb('0x2b')](function(_0x14de6a){if(_0x14de6a){_0x5ddaa5['set'](_0x14de6a['headers']);logger['info'](_0x14de6a['body']);if(_[_0x11eb('0xaa')](_0x4d2e54[_0x11eb('0x38')][_0x11eb('0x6')],_0x11eb('0x4f'))&&_0x14de6a['statusCode']==0x1f4){return _0x5ddaa5[_0x11eb('0x1f')](_0x14de6a[_0x11eb('0xab')]);}else{return _0x5ddaa5[_0x11eb('0x21')](_0x14de6a[_0x11eb('0xab')])[_0x11eb('0xac')](_0x14de6a[_0x11eb('0x92')]);}}else{return _0x5ddaa5['sendStatus'](0xc8);}})[_0x11eb('0x48')](handleError(_0x5ddaa5,null));};exports[_0x11eb('0xad')]=function(_0x5addc9,_0x2217d2,_0x242bc6){return BPromise['resolve']()['then'](function(){if(!_0x5addc9[_0x11eb('0x38')][_0x11eb('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5addc9[_0x11eb('0x38')][_0x11eb('0xa4')]){throw new Error(_0x11eb('0xa2'));}var _0x9b01dd=_0x5addc9[_0x11eb('0x38')][_0x11eb('0xa3')]?_0x5addc9[_0x11eb('0x38')][_0x11eb('0xa3')]+':'+_0x5addc9[_0x11eb('0x38')]['port']:_0x11eb('0xae')+_0x5addc9[_0x11eb('0x38')][_0x11eb('0xa4')];var _0x2bbcf2=_0x5addc9[_0x11eb('0x38')]['json']?_0x5addc9[_0x11eb('0x38')]['json']:!![];var _0x520dbc=_0x5addc9[_0x11eb('0x38')]['encoding']?_0x5addc9[_0x11eb('0x38')]['encoding']:null;var _0x34939a={'method':_0x5addc9[_0x11eb('0xaf')],'uri':util[_0x11eb('0x53')]('%s%s',_0x9b01dd,_0x5addc9[_0x11eb('0x38')][_0x11eb('0x6')]),'json':_0x2bbcf2,'resolveWithFullResponse':!![],'encoding':_0x520dbc,'body':_0x5addc9[_0x11eb('0x92')]};if(_0x5addc9['headers']){_0x34939a['headers']=_0x5addc9['headers'];if(_0x34939a['headers']['content-length']){delete _0x34939a[_0x11eb('0xa7')]['content-length'];}}if(_0x34939a[_0x11eb('0xa7')][_0x11eb('0xa9')]){delete _0x34939a['headers']['content-type'];}return rp(_0x34939a);})['then'](function(_0x303750){if(_0x303750){_0x2217d2['set'](_0x303750[_0x11eb('0xa7')]);logger[_0x11eb('0x6b')](_0x303750['body']);return _0x2217d2[_0x11eb('0x21')](_0x303750[_0x11eb('0xab')])[_0x11eb('0xac')](_0x303750[_0x11eb('0x92')]);}else{return _0x2217d2['sendStatus'](0xc8);}})['catch'](handleError(_0x2217d2,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 1fe9e33..44909dd 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 _0x496e=['../../mysqldb','Plugin','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x496e,0x1a0));var _0xe496=function(_0x3fb30a,_0x2d4b58){_0x3fb30a=_0x3fb30a-0x0;var _0x2bb59a=_0x496e[_0x3fb30a];return _0x2bb59a;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xe496('0x0'))['db'][_0xe496('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xe496('0x2')](0x0);var events={'afterCreate':_0xe496('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x58f21a){return function(_0x1daba1,_0x509847,_0xa68e68){PluginEvents[_0xe496('0x4')](_0x58f21a+':'+_0x1daba1['id'],_0x1daba1);PluginEvents[_0xe496('0x4')](_0x58f21a,_0x1daba1);_0xa68e68(null);};}for(var e in events){if(events[_0xe496('0x5')](e)){var event=events[e];Plugin[_0xe496('0x6')](e,emitEvent(event));}}module[_0xe496('0x7')]=PluginEvents; \ No newline at end of file +var _0xdcd5=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdcd5,0x110));var _0x5dcd=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0xdcd5[_0x2cde0a];return _0x260610;};'use strict';var EventEmitter=require(_0x5dcd('0x0'));var Plugin=require(_0x5dcd('0x1'))['db'][_0x5dcd('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x5dcd('0x3')](0x0);var events={'afterCreate':_0x5dcd('0x4'),'afterUpdate':_0x5dcd('0x5'),'afterDestroy':_0x5dcd('0x6')};function emitEvent(_0x5447ba){return function(_0x1c13f5,_0x245dc8,_0x3e2af0){PluginEvents[_0x5dcd('0x7')](_0x5447ba+':'+_0x1c13f5['id'],_0x1c13f5);PluginEvents[_0x5dcd('0x7')](_0x5447ba,_0x1c13f5);_0x3e2af0(null);};}for(var e in events){if(events[_0x5dcd('0x8')](e)){var event=events[e];Plugin[_0x5dcd('0x9')](e,emitEvent(event));}}module[_0x5dcd('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index da80fbf..29d07d7 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 _0xc48d=['Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./plugin.attributes','define'];(function(_0x4032e3,_0x6d6449){var _0x34f51a=function(_0x3f77e4){while(--_0x3f77e4){_0x4032e3['push'](_0x4032e3['shift']());}};_0x34f51a(++_0x6d6449);}(_0xc48d,0xc2));var _0xdc48=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xc48d[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0xdc48('0x0'));var util=require(_0xdc48('0x1'));var logger=require(_0xdc48('0x2'))(_0xdc48('0x3'));var moment=require(_0xdc48('0x4'));var BPromise=require(_0xdc48('0x5'));var rp=require(_0xdc48('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdc48('0x7'));var attributes=require(_0xdc48('0x8'));module['exports']=function(_0x4d7fed,_0x523258){return _0x4d7fed[_0xdc48('0x9')](_0xdc48('0xa'),attributes,{'tableName':_0xdc48('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2e2=['exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes'];(function(_0x52dcde,_0x165900){var _0xb30748=function(_0x3bb19e){while(--_0x3bb19e){_0x52dcde['push'](_0x52dcde['shift']());}};_0xb30748(++_0x165900);}(_0xe2e2,0xe4));var _0x2e2e=function(_0x5bc1b7,_0x14b385){_0x5bc1b7=_0x5bc1b7-0x0;var _0x23fb83=_0xe2e2[_0x5bc1b7];return _0x23fb83;};'use strict';var _=require(_0x2e2e('0x0'));var util=require(_0x2e2e('0x1'));var logger=require(_0x2e2e('0x2'))(_0x2e2e('0x3'));var moment=require(_0x2e2e('0x4'));var BPromise=require(_0x2e2e('0x5'));var rp=require(_0x2e2e('0x6'));var fs=require('fs');var path=require(_0x2e2e('0x7'));var rimraf=require('rimraf');var config=require(_0x2e2e('0x8'));var attributes=require(_0x2e2e('0x9'));module[_0x2e2e('0xa')]=function(_0x21ef51,_0x45e61b){return _0x21ef51[_0x2e2e('0xb')](_0x2e2e('0xc'),attributes,{'tableName':_0x2e2e('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 217c3f1..8e80b7b 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 _0x9313=['../../config/logger','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','register','request','then','info','Plugin,\x20%s,\x20%s','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','CreatePlugin','Plugin','create','body','options','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x90a39a,_0x32020d){var _0x2b62f7=function(_0x6841cc){while(--_0x6841cc){_0x90a39a['push'](_0x90a39a['shift']());}};_0x2b62f7(++_0x32020d);}(_0x9313,0xc4));var _0x3931=function(_0x248586,_0x3e3a94){_0x248586=_0x248586-0x0;var _0x1ea60a=_0x9313[_0x248586];return _0x1ea60a;};'use strict';var _=require(_0x3931('0x0'));var util=require(_0x3931('0x1'));var moment=require(_0x3931('0x2'));var BPromise=require(_0x3931('0x3'));var rs=require(_0x3931('0x4'));var fs=require('fs');var Redis=require(_0x3931('0x5'));var db=require(_0x3931('0x6'))['db'];var utils=require(_0x3931('0x7'));var logger=require(_0x3931('0x8'))('rpc');var config=require(_0x3931('0x9'));var jayson=require(_0x3931('0xa'));var client=jayson[_0x3931('0xb')]['http']({'port':0x232a});config['redis']=_[_0x3931('0xc')](config['redis'],{'host':_0x3931('0xd'),'port':0x18eb});var socket=require(_0x3931('0xe'))(new Redis(config[_0x3931('0xf')]));require('./plugin.socket')[_0x3931('0x10')](socket);function respondWithRpcPromise(_0x293336,_0x3903a7,_0x1794fd){return new BPromise(function(_0x3d8edd,_0x1a8c74){return client[_0x3931('0x11')](_0x293336,_0x1794fd)[_0x3931('0x12')](function(_0x4e8a98){logger[_0x3931('0x13')](_0x3931('0x14'),_0x3903a7,'request\x20sent');logger['debug'](_0x3931('0x15'),_0x3903a7,_0x3931('0x16'),JSON['stringify'](_0x4e8a98));if(_0x4e8a98['error']){if(_0x4e8a98['error'][_0x3931('0x17')]===0x1f4){logger[_0x3931('0x18')](_0x3931('0x14'),_0x3903a7,_0x4e8a98[_0x3931('0x18')][_0x3931('0x19')]);return _0x1a8c74(_0x4e8a98['error'][_0x3931('0x19')]);}logger[_0x3931('0x18')](_0x3931('0x14'),_0x3903a7,_0x4e8a98[_0x3931('0x18')]['message']);return _0x3d8edd(_0x4e8a98[_0x3931('0x18')]['message']);}else{logger['info'](_0x3931('0x14'),_0x3903a7,_0x3931('0x16'));_0x3d8edd(_0x4e8a98[_0x3931('0x1a')][_0x3931('0x19')]);}})[_0x3931('0x1b')](function(_0x8dbafa){logger[_0x3931('0x18')](_0x3931('0x14'),_0x3903a7,_0x8dbafa);_0x1a8c74(_0x8dbafa);});});}exports[_0x3931('0x1c')]=function(_0x4fcf04){var _0x5cdaf7=this;return new Promise(function(_0x1a4987,_0x197f01){return db[_0x3931('0x1d')][_0x3931('0x1e')](_0x4fcf04[_0x3931('0x1f')],{'raw':_0x4fcf04['options']?_0x4fcf04[_0x3931('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x3931('0x12')](function(_0x49d344){logger['info'](_0x3931('0x1c'),_0x4fcf04);logger['debug'](_0x3931('0x1c'),_0x4fcf04,JSON[_0x3931('0x21')](_0x49d344));_0x1a4987(_0x49d344);})[_0x3931('0x1b')](function(_0x179daa){logger[_0x3931('0x18')](_0x3931('0x1c'),_0x179daa[_0x3931('0x19')],_0x4fcf04);_0x197f01(_0x5cdaf7[_0x3931('0x18')](0x1f4,_0x179daa[_0x3931('0x19')]));});});}; \ No newline at end of file +var _0x769d=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','Plugin,\x20%s,\x20%s','message','result','catch','create','body','options','raw','CreatePlugin'];(function(_0x3e7a41,_0x5c2cdf){var _0x157206=function(_0x4dd076){while(--_0x4dd076){_0x3e7a41['push'](_0x3e7a41['shift']());}};_0x157206(++_0x5c2cdf);}(_0x769d,0x132));var _0xd769=function(_0x823d82,_0x4caf84){_0x823d82=_0x823d82-0x0;var _0x2cd260=_0x769d[_0x823d82];return _0x2cd260;};'use strict';var _=require(_0xd769('0x0'));var util=require(_0xd769('0x1'));var moment=require(_0xd769('0x2'));var BPromise=require(_0xd769('0x3'));var rs=require(_0xd769('0x4'));var fs=require('fs');var Redis=require(_0xd769('0x5'));var db=require(_0xd769('0x6'))['db'];var utils=require(_0xd769('0x7'));var logger=require(_0xd769('0x8'))(_0xd769('0x9'));var config=require('../../config/environment');var jayson=require(_0xd769('0xa'));var client=jayson[_0xd769('0xb')][_0xd769('0xc')]({'port':0x232a});config[_0xd769('0xd')]=_[_0xd769('0xe')](config[_0xd769('0xd')],{'host':_0xd769('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0xd769('0x10')](socket);function respondWithRpcPromise(_0x3d890c,_0x354de8,_0x5d4317){return new BPromise(function(_0x11b051,_0x5a5660){return client[_0xd769('0x11')](_0x3d890c,_0x5d4317)[_0xd769('0x12')](function(_0x51f2df){logger[_0xd769('0x13')]('Plugin,\x20%s,\x20%s',_0x354de8,_0xd769('0x14'));logger[_0xd769('0x15')](_0xd769('0x16'),_0x354de8,_0xd769('0x14'),JSON[_0xd769('0x17')](_0x51f2df));if(_0x51f2df['error']){if(_0x51f2df[_0xd769('0x18')]['code']===0x1f4){logger[_0xd769('0x18')](_0xd769('0x19'),_0x354de8,_0x51f2df[_0xd769('0x18')][_0xd769('0x1a')]);return _0x5a5660(_0x51f2df[_0xd769('0x18')][_0xd769('0x1a')]);}logger[_0xd769('0x18')](_0xd769('0x19'),_0x354de8,_0x51f2df['error']['message']);return _0x11b051(_0x51f2df['error'][_0xd769('0x1a')]);}else{logger['info'](_0xd769('0x19'),_0x354de8,'request\x20sent');_0x11b051(_0x51f2df[_0xd769('0x1b')][_0xd769('0x1a')]);}})[_0xd769('0x1c')](function(_0x43a7d2){logger['error']('Plugin,\x20%s,\x20%s',_0x354de8,_0x43a7d2);_0x5a5660(_0x43a7d2);});});}exports['CreatePlugin']=function(_0x112594){var _0x32ded4=this;return new Promise(function(_0x30a1c9,_0x322771){return db['Plugin'][_0xd769('0x1d')](_0x112594[_0xd769('0x1e')],{'raw':_0x112594['options']?_0x112594[_0xd769('0x1f')][_0xd769('0x20')]===undefined?!![]:![]:!![]})[_0xd769('0x12')](function(_0x4d00dd){logger[_0xd769('0x13')](_0xd769('0x21'),_0x112594);logger[_0xd769('0x15')]('CreatePlugin',_0x112594,JSON[_0xd769('0x17')](_0x4d00dd));_0x30a1c9(_0x4d00dd);})['catch'](function(_0x5b9ac8){logger[_0xd769('0x18')](_0xd769('0x21'),_0x5b9ac8[_0xd769('0x1a')],_0x112594);_0x322771(_0x32ded4[_0xd769('0x18')](0x1f4,_0x5b9ac8[_0xd769('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 6c4199a..dc08ae0 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 _0x8cbb=['update','emit','removeListener','register','length','./plugin.events','remove'];(function(_0x461163,_0x281c13){var _0xea10e0=function(_0x2d0eae){while(--_0x2d0eae){_0x461163['push'](_0x461163['shift']());}};_0xea10e0(++_0x281c13);}(_0x8cbb,0x147));var _0xb8cb=function(_0x3b9007,_0x482404){_0x3b9007=_0x3b9007-0x0;var _0xfe01e7=_0x8cbb[_0x3b9007];return _0xfe01e7;};'use strict';var PluginEvents=require(_0xb8cb('0x0'));var events=['save',_0xb8cb('0x1'),_0xb8cb('0x2')];function createListener(_0x23418f,_0x581f6b){return function(_0x256bd5){_0x581f6b[_0xb8cb('0x3')](_0x23418f,_0x256bd5);};}function removeListener(_0x4510a5,_0x85ce13){return function(){PluginEvents[_0xb8cb('0x4')](_0x4510a5,_0x85ce13);};}exports[_0xb8cb('0x5')]=function(_0x747a04){for(var _0xa93a26=0x0,_0x1ecee2=events[_0xb8cb('0x6')];_0xa93a26<_0x1ecee2;_0xa93a26++){var _0x1df2ce=events[_0xa93a26];var _0x3ed4ff=createListener('plugin:'+_0x1df2ce,_0x747a04);PluginEvents['on'](_0x1df2ce,_0x3ed4ff);}}; \ No newline at end of file +var _0xbe0b=['./plugin.events','save','remove','emit','register'];(function(_0x3b90ab,_0x174a22){var _0x206e92=function(_0x21fbd3){while(--_0x21fbd3){_0x3b90ab['push'](_0x3b90ab['shift']());}};_0x206e92(++_0x174a22);}(_0xbe0b,0x15e));var _0xbbe0=function(_0x274253,_0x2aabdf){_0x274253=_0x274253-0x0;var _0x353ad9=_0xbe0b[_0x274253];return _0x353ad9;};'use strict';var PluginEvents=require(_0xbbe0('0x0'));var events=[_0xbbe0('0x1'),_0xbbe0('0x2'),'update'];function createListener(_0xe9cb1c,_0x2fcc7b){return function(_0x9efff9){_0x2fcc7b[_0xbbe0('0x3')](_0xe9cb1c,_0x9efff9);};}function removeListener(_0x3845b6,_0x2c9b7a){return function(){PluginEvents['removeListener'](_0x3845b6,_0x2c9b7a);};}exports[_0xbbe0('0x4')]=function(_0x55ab72){for(var _0xd60702=0x0,_0x558334=events['length'];_0xd60702<_0x558334;_0xd60702++){var _0x52ea1c=events[_0xd60702];var _0x3fe3e4=createListener('plugin:'+_0x52ea1c,_0x55ab72);PluginEvents['on'](_0x52ea1c,_0x3fe3e4);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 3bb5aa3..49520de 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(_0x1638a6,_0x2b2359){var _0x5a7a78=function(_0x160ce0){while(--_0x160ce0){_0x1638a6['push'](_0x1638a6['shift']());}};_0x5a7a78(++_0x2b2359);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x36d45d,_0x183513){var _0x203085=function(_0x82efe0){while(--_0x82efe0){_0x36d45d['push'](_0x36d45d['shift']());}};_0x203085(++_0x183513);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 466a947..20a994e 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 _0x6f7a=['../../files/plugins','cwd','chdir','start','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','dump','lodash','../../config/pm2','../../config/logger','api','child_process','exec','bluebird','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then','express','motion2','catch','show','params','body','script','join'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x487511,_0x12c631){_0x487511=_0x487511-0x0;var _0x46ea89=_0x6f7a[_0x487511];return _0x46ea89;};'use strict';var _=require(_0xa6f7('0x0'));var pm2=require(_0xa6f7('0x1'));var logger=require(_0xa6f7('0x2'))(_0xa6f7('0x3'));var path=require('path');var exec=require(_0xa6f7('0x4'))[_0xa6f7('0x5')];var BPromise=require(_0xa6f7('0x6'));function handleEntityNotFound(_0x1da6dc,_0x22e529){return function(_0x1f5922){if(!_0x1f5922){_0x1da6dc[_0xa6f7('0x7')](0x194);;}return _0x1f5922;};}function respondWithResult(_0x20cccd,_0x1fdd5f){_0x1fdd5f=_0x1fdd5f||0xc8;return function(_0x335aaa){if(_0x335aaa){return _0x20cccd[_0xa6f7('0x8')](_0x1fdd5f)['json'](_0x335aaa);}return null;};}function handleError(_0x4b4f9e,_0x30f2a7){_0x30f2a7=_0x30f2a7||0x1f4;return function(_0x2674c9){logger[_0xa6f7('0x9')](_0x2674c9[_0xa6f7('0xa')]);if(_0x2674c9[_0xa6f7('0xb')]){delete _0x2674c9['name'];}_0x4b4f9e['status'](_0x30f2a7)[_0xa6f7('0xc')](_0x2674c9);};}function execChildProcess(){return new BPromise(function(_0x225da4,_0x4e30bc){exec(_0xa6f7('0xd'),function(_0x5623bf,_0x315096,_0x1303c3){logger[_0xa6f7('0xe')](_0x315096);logger[_0xa6f7('0xe')](_0x1303c3);if(_0x5623bf){logger['error'](_0x5623bf);return _0x4e30bc(_0x5623bf);}return _0x225da4(_0x315096);});});}exports[_0xa6f7('0xf')]=function(_0x532352,_0x25b48f){return pm2[_0xa6f7('0x10')]()[_0xa6f7('0x11')](function(_0x4d3d59){if(_0x4d3d59){var _0x34c02d=_['reject'](_0x4d3d59,function(_0x41bc4d){return _0x41bc4d['name']===_0xa6f7('0x12')||_0x41bc4d[_0xa6f7('0xb')]===_0xa6f7('0x13');});return{'rows':_0x34c02d,'count':_0x34c02d['length']};}return null;})[_0xa6f7('0x11')](respondWithResult(_0x25b48f,null))[_0xa6f7('0x14')](handleError(_0x25b48f,null));};exports[_0xa6f7('0x15')]=function(_0x2401b9,_0x5681d5){return pm2['describe'](_0x2401b9[_0xa6f7('0x16')]['id'])['then'](respondWithResult(_0x5681d5,null))[_0xa6f7('0x11')](handleEntityNotFound(_0x5681d5,null))[_0xa6f7('0x14')](handleError(_0x5681d5,null));};exports['create']=function(_0x18fc4a,_0xb2cfaa){if(_0x18fc4a[_0xa6f7('0x17')][_0xa6f7('0xb')]&&_0x18fc4a[_0xa6f7('0x17')][_0xa6f7('0x18')]){var _0x4887ad=path[_0xa6f7('0x19')](__dirname,_0xa6f7('0x1a'),_0x18fc4a['body']['script']);var _0x5ddc8d=process[_0xa6f7('0x1b')]();process[_0xa6f7('0x1c')](path['dirname'](_0x4887ad));return execChildProcess()['then'](function(_0x50e2be){process[_0xa6f7('0x1c')](_0x5ddc8d);return pm2[_0xa6f7('0x1d')]({'name':_0x18fc4a[_0xa6f7('0x17')]['name'],'script':_0x4887ad});})['then'](function(_0x2f4907){pm2['dump']();return _0x2f4907[0x0];})['then'](respondWithResult(_0xb2cfaa,0xc9))[_0xa6f7('0x14')](handleError(_0xb2cfaa,null));}else{return _0xb2cfaa['status'](0x1f4)[_0xa6f7('0xc')]({'message':_0xa6f7('0x1e')});}};exports[_0xa6f7('0x1f')]=function(_0x2b4c6c,_0x3a3508){if(_0x2b4c6c['body']['id']){delete _0x2b4c6c['body']['id'];}var _0x1c419b={'online':_0xa6f7('0x20'),'stopped':'stop'};if(_0x1c419b[_0xa6f7('0x21')](_0x2b4c6c[_0xa6f7('0x17')][_0xa6f7('0x8')])){return pm2[_0x1c419b[_0x2b4c6c[_0xa6f7('0x17')][_0xa6f7('0x8')]]](_0x2b4c6c[_0xa6f7('0x16')]['id'])[_0xa6f7('0x11')](respondWithResult(_0x3a3508,0xc8))[_0xa6f7('0x14')](handleError(_0x3a3508,null));}else{return _0x3a3508[_0xa6f7('0x8')](0x1f4)[_0xa6f7('0xc')]({'message':_0xa6f7('0x22')});}};exports[_0xa6f7('0x23')]=function(_0x52f9c1,_0x442ccf){if(_0x52f9c1[_0xa6f7('0x17')]['id']){delete _0x52f9c1['body']['id'];}if(_0x52f9c1[_0xa6f7('0x16')]['id']){return pm2[_0xa6f7('0x24')](_0x52f9c1['params']['id'])['then'](function(_0x176378){pm2[_0xa6f7('0x25')]();return _0x176378[0x0];})[_0xa6f7('0x11')](respondWithResult(_0x442ccf,null))[_0xa6f7('0x14')](handleError(_0x442ccf,null));}else{return _0x442ccf[_0xa6f7('0x8')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x0565=['script','../../files/plugins','cwd','chdir','send','update','restart','stop','hasOwnProperty','params','Unknown\x20status','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','error','stack','name','status','npm\x20install','index','list','then','reject','express','length','catch','show','describe','body'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x0565,0xf2));var _0x5056=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x0565[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0x5056('0x0'));var pm2=require(_0x5056('0x1'));var logger=require(_0x5056('0x2'))(_0x5056('0x3'));var path=require(_0x5056('0x4'));var exec=require(_0x5056('0x5'))[_0x5056('0x6')];var BPromise=require(_0x5056('0x7'));function handleEntityNotFound(_0x3657a8,_0x2b0883){return function(_0x554040){if(!_0x554040){_0x3657a8[_0x5056('0x8')](0x194);;}return _0x554040;};}function respondWithResult(_0x105ea8,_0x1143df){_0x1143df=_0x1143df||0xc8;return function(_0x22afb7){if(_0x22afb7){return _0x105ea8['status'](_0x1143df)['json'](_0x22afb7);}return null;};}function handleError(_0x38f74,_0x223c92){_0x223c92=_0x223c92||0x1f4;return function(_0x417065){logger[_0x5056('0x9')](_0x417065[_0x5056('0xa')]);if(_0x417065[_0x5056('0xb')]){delete _0x417065[_0x5056('0xb')];}_0x38f74[_0x5056('0xc')](_0x223c92)['send'](_0x417065);};}function execChildProcess(){return new BPromise(function(_0x78f7e4,_0xf04ea3){exec(_0x5056('0xd'),function(_0x5ab4b2,_0x4c0255,_0x17f43e){logger['info'](_0x4c0255);logger['info'](_0x17f43e);if(_0x5ab4b2){logger['error'](_0x5ab4b2);return _0xf04ea3(_0x5ab4b2);}return _0x78f7e4(_0x4c0255);});});}exports[_0x5056('0xe')]=function(_0x4b183a,_0x3e523b){return pm2[_0x5056('0xf')]()[_0x5056('0x10')](function(_0x543cee){if(_0x543cee){var _0x1e8b64=_[_0x5056('0x11')](_0x543cee,function(_0x15f52d){return _0x15f52d[_0x5056('0xb')]===_0x5056('0x12')||_0x15f52d[_0x5056('0xb')]==='motion2';});return{'rows':_0x1e8b64,'count':_0x1e8b64[_0x5056('0x13')]};}return null;})['then'](respondWithResult(_0x3e523b,null))[_0x5056('0x14')](handleError(_0x3e523b,null));};exports[_0x5056('0x15')]=function(_0x1c0ee9,_0x1f2ac6){return pm2[_0x5056('0x16')](_0x1c0ee9['params']['id'])[_0x5056('0x10')](respondWithResult(_0x1f2ac6,null))[_0x5056('0x10')](handleEntityNotFound(_0x1f2ac6,null))['catch'](handleError(_0x1f2ac6,null));};exports['create']=function(_0x20776c,_0x517bf3){if(_0x20776c[_0x5056('0x17')][_0x5056('0xb')]&&_0x20776c[_0x5056('0x17')][_0x5056('0x18')]){var _0x33035c=path['join'](__dirname,_0x5056('0x19'),_0x20776c[_0x5056('0x17')]['script']);var _0x271efc=process[_0x5056('0x1a')]();process[_0x5056('0x1b')](path['dirname'](_0x33035c));return execChildProcess()[_0x5056('0x10')](function(_0x26a3c2){process['chdir'](_0x271efc);return pm2['start']({'name':_0x20776c[_0x5056('0x17')][_0x5056('0xb')],'script':_0x33035c});})[_0x5056('0x10')](function(_0x37f7b5){pm2['dump']();return _0x37f7b5[0x0];})[_0x5056('0x10')](respondWithResult(_0x517bf3,0xc9))[_0x5056('0x14')](handleError(_0x517bf3,null));}else{return _0x517bf3['status'](0x1f4)[_0x5056('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x5056('0x1d')]=function(_0x39d539,_0x1106e5){if(_0x39d539[_0x5056('0x17')]['id']){delete _0x39d539[_0x5056('0x17')]['id'];}var _0x50f2a8={'online':_0x5056('0x1e'),'stopped':_0x5056('0x1f')};if(_0x50f2a8[_0x5056('0x20')](_0x39d539[_0x5056('0x17')]['status'])){return pm2[_0x50f2a8[_0x39d539[_0x5056('0x17')]['status']]](_0x39d539[_0x5056('0x21')]['id'])['then'](respondWithResult(_0x1106e5,0xc8))['catch'](handleError(_0x1106e5,null));}else{return _0x1106e5['status'](0x1f4)[_0x5056('0x1c')]({'message':_0x5056('0x22')});}};exports['destroy']=function(_0x27f4be,_0x2c5728){if(_0x27f4be[_0x5056('0x17')]['id']){delete _0x27f4be[_0x5056('0x17')]['id'];}if(_0x27f4be[_0x5056('0x21')]['id']){return pm2[_0x5056('0x23')](_0x27f4be[_0x5056('0x21')]['id'])[_0x5056('0x10')](function(_0xd1aa24){pm2[_0x5056('0x24')]();return _0xd1aa24[0x0];})[_0x5056('0x10')](respondWithResult(_0x2c5728,null))['catch'](handleError(_0x2c5728,null));}else{return _0x2c5728['status'](0x1f4)[_0x5056('0x1c')]({'message':_0x5056('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index c719bfb..08f6d09 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 _0x8b75=['isAuthenticated','get','/queues','exports','express','Router','../../components/auth/service','./realtime.controller','/agents'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x8b75,0x199));var _0x58b7=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x8b75[_0x58afd5];return _0x3e503b;};'use strict';var express=require(_0x58b7('0x0'));var router=express[_0x58b7('0x1')]();var auth=require(_0x58b7('0x2'));var controller=require(_0x58b7('0x3'));router['get'](_0x58b7('0x4'),auth[_0x58b7('0x5')](),controller['getAgents']);router[_0x58b7('0x6')](_0x58b7('0x7'),auth[_0x58b7('0x5')](),controller['getQueues']);module[_0x58b7('0x8')]=router; \ No newline at end of file +var _0x7e4e=['isAuthenticated','getAgents','/queues','getQueues','express','Router','../../components/auth/service','get','/agents'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0x7e4e,0x1b4));var _0xe7e4=function(_0x4da382,_0x4cfc5d){_0x4da382=_0x4da382-0x0;var _0x10073f=_0x7e4e[_0x4da382];return _0x10073f;};'use strict';var express=require(_0xe7e4('0x0'));var router=express[_0xe7e4('0x1')]();var auth=require(_0xe7e4('0x2'));var controller=require('./realtime.controller');router[_0xe7e4('0x3')](_0xe7e4('0x4'),auth[_0xe7e4('0x5')](),controller[_0xe7e4('0x6')]);router[_0xe7e4('0x3')](_0xe7e4('0x7'),auth[_0xe7e4('0x5')](),controller[_0xe7e4('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index e7fd278..1b55ae9 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 _0x5d17=['Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','loggedIn','available','waiting','outbound','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','paused','talking','busy','originated','find','pick','length','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','loggedInDb','push','User','Queue','findAll','QueueId','idle','unknown','unavailable','ringing','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','every','filter','pause','faxStatus','mailStatus','openchannelStatus','whatsappStatus','getAgents','userpic','lastPauseAt','chatPause','smsPause','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','smsStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','resolve','rawAttributes','fieldName','type','key','role','agent','query','getOptions','raw','user','userProfileId','sort','UserProfile','getResources','findAndCountAll','count','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','pauseType','getQueues','mail','chat','sms','openchannel','fax','whatsapp','channel','includes','toLowerCase','QueueCampaigns','all','util','lodash','../../config/logger','api','../../mysqldb','http','client','offset','undefined','limit','status','set','Content-Range','json','error','stack','name','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','Queues'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x5d17,0x114));var _0x75d1=function(_0x494f7f,_0x34a09b){_0x494f7f=_0x494f7f-0x0;var _0x18ebe4=_0x5d17[_0x494f7f];return _0x18ebe4;};'use strict';var util=require(_0x75d1('0x0'));var _=require(_0x75d1('0x1'));var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require(_0x75d1('0x2'))(_0x75d1('0x3'));var db=require(_0x75d1('0x4'))['db'];var amiClient=jayson['client'][_0x75d1('0x5')]({'port':0x232a});var routingClient=jayson[_0x75d1('0x6')][_0x75d1('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x32bd45,_0x56ac0a){return function(_0x458681){if(_0x458681){var _0x116a51=typeof _0x56ac0a[_0x75d1('0x7')]===_0x75d1('0x8')&&typeof _0x56ac0a[_0x75d1('0x9')]===_0x75d1('0x8');var _0xf9f8e=_0x458681['count'];var _0x4cf632=_0x116a51?0x0:_0x56ac0a[_0x75d1('0x7')];var _0x4a3bb3=_0x116a51?_0x458681['count']:_0x56ac0a[_0x75d1('0x7')]+_0x56ac0a[_0x75d1('0x9')];var _0x4d4aa1;if(_0x4a3bb3>=_0xf9f8e){_0x4a3bb3=_0xf9f8e;_0x4d4aa1=0xc8;}else{_0x4d4aa1=0xce;}_0x32bd45[_0x75d1('0xa')](_0x4d4aa1);return _0x32bd45[_0x75d1('0xb')](_0x75d1('0xc'),_0x4cf632+'-'+_0x4a3bb3+'/'+_0xf9f8e)[_0x75d1('0xd')](_0x458681);}return null;};}function handleError(_0x6c1265,_0xd089cf){_0xd089cf=_0xd089cf||0x1f4;return function(_0x49667a){logger[_0x75d1('0xe')](_0x49667a[_0x75d1('0xf')]);if(_0x49667a[_0x75d1('0x10')]){delete _0x49667a[_0x75d1('0x10')];}_0x6c1265['status'](_0xd089cf)['send'](_0x49667a);};}function getRealtimeAgents(){return new Promise(function(_0x55b8a0,_0x24ba98){return amiClient[_0x75d1('0x11')](_0x75d1('0x12'),{})['then'](function(_0x1f9620){if(_0x1f9620[_0x75d1('0xe')])throw new Error(_0x75d1('0x13'));var _0x269e82=_0x1f9620[_0x75d1('0x14')];return routingClient[_0x75d1('0x11')](_0x75d1('0x12'),{})[_0x75d1('0x15')](function(_0x1bc5de){if(_0x1bc5de[_0x75d1('0xe')])throw new Error(_0x75d1('0x16'));var _0x5761db=_0x1bc5de['result'];return _0x55b8a0(_[_0x75d1('0x17')]({},_0x269e82,_0x5761db));});})[_0x75d1('0x18')](function(_0x56730d){_0x24ba98(_0x56730d);});});}function getRealtimeQueues(_0x31eb88,_0x406143){return new Promise(function(_0x579731,_0xf6cc70){var _0xa42dbe=_0x406143===_0x75d1('0x19')?amiClient:routingClient;return _0xa42dbe['request'](_[_0x75d1('0x1a')](_0x406143)+_0x75d1('0x1b'),_0x31eb88)['then'](function(_0x1cb58c){if(_0x1cb58c[_0x75d1('0xe')])throw new Error(util['format'](_0x75d1('0x1c'),_0x406143));return _0x579731(_0x1cb58c['result']);})[_0x75d1('0x18')](function(_0xc256af){_0xf6cc70(_0xc256af);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x345cf5,_0x4b2a25){return amiClient['request'](_0x75d1('0x1d'),{})[_0x75d1('0x15')](function(_0x315ce5){if(_0x315ce5[_0x75d1('0xe')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x345cf5(_0x315ce5[_0x75d1('0x14')]);})[_0x75d1('0x18')](function(_0x367238){_0x4b2a25(_0x367238);});});}function initializeQueues(_0x51138e,_0x54095d,_0x57efd6,_0x364dc9){var _0x30d9f3=[_0x75d1('0x1e'),_0x75d1('0x1f'),_0x75d1('0x20'),'talking','paused'];if(_0x57efd6===_0x75d1('0x19')&&_0x364dc9===_0x75d1('0x21')){_0x30d9f3['push'](_0x75d1('0x22'),'originated',_0x75d1('0x23'),_0x75d1('0x24'),_0x75d1('0x25'),_0x75d1('0x26'),_0x75d1('0x27'),'startProgressive',_0x75d1('0x28'),_0x75d1('0x29'),_0x75d1('0x2a'),_0x75d1('0x2b'),'dialPredictiveInterval',_0x75d1('0x2c'),'dialPredictiveIntervalMinThreshold',_0x75d1('0x2d'),_0x75d1('0x2e'),'predictiveIntervalAnsweredCalls',_0x75d1('0x2f'),_0x75d1('0x30'),_0x75d1('0x31'),_0x75d1('0x32'));}return _0x51138e[_0x75d1('0x33')](function(_0x495aa4){var _0x23f94a=_0x495aa4[_0x75d1('0x34')]({'plain':!![]});_0x23f94a[_0x75d1('0x35')]=[];_0x23f94a[_0x75d1('0x36')]=0x0;_0x23f94a['loggedInDb']=0x0;_0x23f94a['loggedIn']=0x0;_0x23f94a['available']=0x0;_0x23f94a[_0x75d1('0x20')]=0x0;if(_0x57efd6===_0x75d1('0x19')){_0x23f94a[_0x75d1('0x37')]=0x0;_0x23f94a[_0x75d1('0x38')]=0x0;if(_0x364dc9===_0x75d1('0x21')){_0x23f94a[_0x75d1('0x22')]=0x0;_0x23f94a[_0x75d1('0x39')]=0x0;}}var _0x2dce68=_[_0x75d1('0x3a')](_0x54095d,['id',_0x23f94a['id']]);if(_0x2dce68)_['merge'](_0x23f94a,_[_0x75d1('0x3b')](_0x2dce68,_0x30d9f3));return _0x23f94a;});}function updateAgentVoiceStatus(_0x429c38,_0x39ac3e,_0x62b37e){var _0x6d48a5=_['filter'](_0x62b37e,['queue',_0x39ac3e['name']]);if(_0x6d48a5[_0x75d1('0x3c')]===0x0)return _0x429c38[_0x75d1('0x38')]=!![];if(_[_0x75d1('0x3d')](_0x6d48a5,[_0x75d1('0x3e'),_0x429c38[_0x75d1('0x3f')][_0x75d1('0x40')]()]))return _0x429c38['talking']=!![];if(!_0x429c38['talking'])return _0x429c38['busy']=!![];}function getVoiceQueueAgents(_0x3f2569,_0x4cb084,_0x53a1af,_0x450aa5){var _0x21bfd8=_[_0x75d1('0x3a')](_0x4cb084,['id',_0x3f2569['id']]);if(!_0x21bfd8)return _0x3f2569;return _0x21bfd8[_0x75d1('0x41')]({'raw':!![]})['then'](function(_0x44e6c2){for(var _0x2acdc8=0x0;_0x2acdc8<_0x44e6c2[_0x75d1('0x3c')];_0x2acdc8++){var _0x3d4137=_[_0x75d1('0x3a')](_0x53a1af,['id',_0x44e6c2[_0x2acdc8][_0x75d1('0x42')]]);if(!_0x3d4137){_0x3d4137={'id':_0x44e6c2[_0x2acdc8][_0x75d1('0x42')],'name':_0x44e6c2[_0x2acdc8][_0x75d1('0x42')],'accountcode':'','online':![]};}var _0x2c88f2={'id':_0x3d4137['id'],'name':_0x3d4137[_0x75d1('0x10')],'internal':_0x3d4137[_0x75d1('0x43')],'online':Boolean(_0x3d4137[_0x75d1('0x44')]),'paused':Boolean(_0x44e6c2[_0x2acdc8][_0x75d1('0x36')])};if(_0x3d4137[_0x75d1('0x45')]===_0x75d1('0x37'))updateAgentVoiceStatus(_0x2c88f2,_0x3f2569,_0x450aa5);if(_0x2c88f2[_0x75d1('0x44')])_0x3f2569[_0x75d1('0x46')]++;if(_0x2c88f2[_0x75d1('0x38')])_0x3f2569[_0x75d1('0x38')]++;if(_0x2c88f2[_0x75d1('0x36')]&&!_0x2c88f2[_0x75d1('0x38')]&&!_0x2c88f2[_0x75d1('0x37')])_0x3f2569['paused']++;_0x3f2569['agents'][_0x75d1('0x47')](_0x2c88f2);}return _0x3f2569;});}function getQueueAgents(_0x40b74e,_0x429909,_0x1d9853){var _0x4af3bb=_0x75d1('0x48')+_[_0x75d1('0x1a')](_0x1d9853)+_0x75d1('0x49');var _0x329cec=_0x1d9853+'Pause';return db[_0x4af3bb][_0x75d1('0x4a')]({'where':{[_[_0x75d1('0x1a')](_0x1d9853)+_0x75d1('0x4b')]:_0x40b74e['id']},'raw':!![]})[_0x75d1('0x15')](function(_0x5b486d){for(var _0x34d132=0x0;_0x34d132<_0x5b486d['length'];_0x34d132++){var _0x130dd3=_[_0x75d1('0x3a')](_0x429909,['id',_0x5b486d[_0x34d132][_0x75d1('0x42')]]);if(!_0x130dd3){_0x130dd3={'id':_0x5b486d[_0x34d132][_0x75d1('0x42')],'name':_0x5b486d[_0x34d132][_0x75d1('0x42')],'online':![],['pauseField']:![]};}var _0x2137e1={'id':_0x130dd3['id'],'name':_0x130dd3['name'],'online':Boolean(_0x130dd3[_0x75d1('0x44')]),'paused':Boolean(_0x130dd3[_0x329cec])};if(_0x2137e1['online'])_0x40b74e['loggedInDb']++;_0x40b74e[_0x75d1('0x35')][_0x75d1('0x47')](_0x2137e1);}return _0x40b74e;});}function isIdle(_0x4760cf){return _0x4760cf===_0x75d1('0x4c')||_0x4760cf===_0x75d1('0x4d')||_0x4760cf===_0x75d1('0x4e')||_0x4760cf===_0x75d1('0x4f')||_['isNil'](_0x4760cf);}function isAgentPaused(_0x5d7ebf,_0x1edc9d){var _0x8ce3d2=[_0x5d7ebf['chatPause'],_0x5d7ebf[_0x75d1('0x50')],_0x5d7ebf[_0x75d1('0x51')],_0x5d7ebf[_0x75d1('0x52')],_0x5d7ebf['smsPause'],_0x5d7ebf[_0x75d1('0x53')],_0x5d7ebf[_0x75d1('0x54')]];if(!_0x1edc9d)return _[_0x75d1('0x55')](_0x8ce3d2);var _0x3be4b5=_[_0x75d1('0x56')](_0x8ce3d2);return _0x3be4b5[_0x75d1('0x3c')]>0x0&&_0x3be4b5[_0x75d1('0x3c')]<_0x8ce3d2['length']?!![]:![];}function isAgentIdle(_0x1eaa66){if(_0x1eaa66[_0x75d1('0x45')]!==_0x75d1('0x4c')&&_0x1eaa66[_0x75d1('0x53')]){_0x1eaa66[_0x75d1('0x45')]=_0x75d1('0x57');return![];}return _[_0x75d1('0x55')]([_0x1eaa66['chatStatus'],_0x1eaa66[_0x75d1('0x58')],_0x1eaa66[_0x75d1('0x59')],_0x1eaa66[_0x75d1('0x5a')],_0x1eaa66['smsStatus'],_0x1eaa66[_0x75d1('0x45')],_0x1eaa66[_0x75d1('0x5b')]],isIdle);}function getAgentStatus(_0x16c51){var _0x382760=_0x75d1('0x4d');if(isAgentPaused(_0x16c51))_0x382760=_0x75d1('0x57');else if(isAgentPaused(_0x16c51,!![]))_0x382760='*pause';else if(isAgentIdle(_0x16c51))_0x382760=_0x75d1('0x4c');else _0x382760=_0x75d1('0x38');return _0x382760;}exports[_0x75d1('0x5c')]=function(_0x46e665,_0x2e746a){var _0x2f6048={'count':0x0,'rows':[]},_0x2d1648={},_0x104a44,_0x131082,_0x43769e=[_0x75d1('0x5d'),'online','lastLoginAt',_0x75d1('0x5e'),'pauseType',_0x75d1('0x5e'),_0x75d1('0x3f'),'address',_0x75d1('0x5f'),_0x75d1('0x52'),_0x75d1('0x51'),_0x75d1('0x60'),_0x75d1('0x54'),_0x75d1('0x50'),_0x75d1('0x53'),'chatCapacity',_0x75d1('0x61'),_0x75d1('0x62'),_0x75d1('0x63'),_0x75d1('0x64'),_0x75d1('0x65'),_0x75d1('0x66'),_0x75d1('0x67'),_0x75d1('0x68'),_0x75d1('0x69'),_0x75d1('0x6a'),'faxCurrentCapacity','chatStatus',_0x75d1('0x5a'),_0x75d1('0x59'),_0x75d1('0x6b'),'whatsappStatus',_0x75d1('0x58'),'voiceStatus',_0x75d1('0x6c'),_0x75d1('0x6d'),_0x75d1('0x6e'),_0x75d1('0x6f'),'whatsappStatusTime',_0x75d1('0x70'),'voiceStatusTime','queue',_0x75d1('0x71'),_0x75d1('0x72'),_0x75d1('0x73'),_0x75d1('0x74'),'routealias'],_0x1038d2=['chatPause',_0x75d1('0x52'),_0x75d1('0x51'),_0x75d1('0x60'),_0x75d1('0x54'),_0x75d1('0x50'),'voicePause',_0x75d1('0x44')];Promise[_0x75d1('0x75')]()[_0x75d1('0x15')](function(){var _0x3c6bd7=_[_0x75d1('0x33')](db[_0x75d1('0x48')][_0x75d1('0x76')],function(_0x1092fb){return{'name':_0x1092fb[_0x75d1('0x77')],'type':_0x1092fb[_0x75d1('0x78')][_0x75d1('0x79')]};});_0x46e665['query'][_0x75d1('0x7a')]=_0x75d1('0x7b');_0x46e665[_0x75d1('0x7c')][_0x75d1('0x44')]=!![];_0x2d1648=qs[_0x75d1('0x7d')](_0x3c6bd7,_0x46e665);_0x2d1648[_0x75d1('0x7e')]=!![];if(_0x46e665[_0x75d1('0x7f')]['role']==='user'){var _0x1b1cc4={'params':{'id':_0x46e665[_0x75d1('0x7f')][_0x75d1('0x80')]},'query':{'section':_0x75d1('0x12'),'role':_0x75d1('0x7b'),'online':!![],'nolimit':_0x46e665['query']['nolimit'],'sort':_0x46e665[_0x75d1('0x7c')][_0x75d1('0x81')],'filter':_0x46e665['query'][_0x75d1('0x56')],'raw':!![]}};return db[_0x75d1('0x82')][_0x75d1('0x83')](_0x1b1cc4);}return db[_0x75d1('0x48')][_0x75d1('0x84')](_0x2d1648);})[_0x75d1('0x15')](function(_0x5a4abc){_0x2f6048['count']=_0x5a4abc[_0x75d1('0x85')];_0x104a44=_0x5a4abc[_0x75d1('0x86')];return getRealtimeAgents();})['then'](function(_0x45e61a){_0x131082=_0x45e61a['rows'];return _0x104a44[_0x75d1('0x33')](function(_0x2730f6){var _0x30fd13=_['find'](_0x131082,['id',_0x2730f6['id']]);if(_0x30fd13)_[_0x75d1('0x17')](_0x2730f6,_[_0x75d1('0x3b')](_[_0x75d1('0x87')](_0x30fd13,_0x1038d2),_0x43769e));_0x2730f6[_0x75d1('0x88')]=getAgentStatus(_0x2730f6);return _0x2730f6;});})[_0x75d1('0x15')](function(_0x50d202){if(_0x46e665['query'][_0x75d1('0x89')]){var _0x58d20b=_[_0x75d1('0x56')](_0x50d202,[_0x75d1('0x88'),_0x46e665[_0x75d1('0x7c')]['globalStatusFilter']]);if(_0x46e665['query'][_0x75d1('0x8a')]){_0x58d20b=_['filter'](_0x58d20b,[_0x75d1('0x8b'),_0x46e665[_0x75d1('0x7c')][_0x75d1('0x8a')]]);}}_0x2f6048['rows']=_0x58d20b||_0x50d202;return _0x2f6048;})[_0x75d1('0x15')](respondWithFilteredResult(_0x2e746a,_0x2d1648))[_0x75d1('0x18')](handleError(_0x2e746a,null));};exports[_0x75d1('0x8c')]=function(_0x41981f,_0x3e2334){var _0x1a40b5=[_0x75d1('0x8d'),_0x75d1('0x8e'),_0x75d1('0x8f'),_0x75d1('0x90'),_0x75d1('0x91'),_0x75d1('0x92'),_0x75d1('0x19')];var _0x44ef76={'count':0x0,'rows':[]},_0x4b4a52={},_0x574cb0,_0x410fa1,_0x1eb55e,_0x58079c,_0xf54f;Promise['resolve']()['then'](function(){if(_0x41981f['query'][_0x75d1('0x93')]){if(!_[_0x75d1('0x94')](_0x1a40b5,_0x41981f[_0x75d1('0x7c')][_0x75d1('0x93')][_0x75d1('0x95')]()))throw new Error('Invalid\x20channel');_0x574cb0=_0x41981f[_0x75d1('0x7c')][_0x75d1('0x93')][_0x75d1('0x95')]();}var _0x13f54a=_[_0x75d1('0x1a')](_0x574cb0)+'Queue';var _0x1113a8=_['map'](db[_0x13f54a][_0x75d1('0x76')],function(_0x26e1ad){return{'name':_0x26e1ad[_0x75d1('0x77')],'type':_0x26e1ad['type']['key']};});_0x4b4a52=qs['getOptions'](_0x1113a8,_0x41981f);if(_0x41981f[_0x75d1('0x7f')][_0x75d1('0x7a')]===_0x75d1('0x7f')){var _0x22caf3={'params':{'id':_0x41981f[_0x75d1('0x7f')][_0x75d1('0x80')]},'query':{'section':_0x574cb0==='voice'&&_0x41981f[_0x75d1('0x7c')][_0x75d1('0x78')]==='outbound'?_0x75d1('0x96'):_['startCase'](_0x574cb0)+'Queues','type':_0x41981f['query'][_0x75d1('0x78')],'nolimit':!![],'sort':'name','filter':_0x41981f['query'][_0x75d1('0x56')]}};return db['UserProfile'][_0x75d1('0x83')](_0x22caf3);}return db[_0x13f54a][_0x75d1('0x84')](_0x4b4a52);})[_0x75d1('0x15')](function(_0xc939c9){_0x44ef76[_0x75d1('0x85')]=_0xc939c9[_0x75d1('0x85')];_0x410fa1=_0xc939c9[_0x75d1('0x86')];return getRealtimeQueues(_0x41981f,_0x574cb0);})[_0x75d1('0x15')](function(_0x51b682){_0x58079c=_0x51b682[_0x75d1('0x86')];return getRealtimeAgents();})['then'](function(_0x9ec663){_0x1eb55e=_0x9ec663[_0x75d1('0x86')];if(_0x574cb0!=_0x75d1('0x19'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x10bc92){_0xf54f=_0x10bc92?_0x10bc92[_0x75d1('0x86')]:[];return initializeQueues(_0x410fa1,_0x58079c,_0x574cb0,_0x41981f[_0x75d1('0x7c')][_0x75d1('0x78')]);})[_0x75d1('0x15')](function(_0x2ee3a0){var _0x1bb574=_0x2ee3a0['map'](function(_0xccae6a){if(_0x574cb0===_0x75d1('0x19'))return getVoiceQueueAgents(_0xccae6a,_0x410fa1,_0x1eb55e,_0xf54f);else return getQueueAgents(_0xccae6a,_0x1eb55e,_0x574cb0);});return Promise[_0x75d1('0x97')](_0x1bb574);})[_0x75d1('0x15')](function(_0x44143e){_0x44ef76['rows']=_0x44143e;return _0x44ef76;})['then'](respondWithFilteredResult(_0x3e2334,_0x4b4a52))[_0x75d1('0x18')](handleError(_0x3e2334,null));}; \ No newline at end of file +var _0x2eb2=['voice','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','agents','loggedInDb','waiting','talking','busy','merge','pick','filter','queue','length','connectedlinenum','internal','toString','find','getMembers','UserId','accountcode','online','voiceStatus','User','startCase','Pause','unknown','chatPause','faxPause','openchannelPause','voicePause','whatsappPause','every','idle','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','getAgents','lastLoginAt','lastPauseAt','pauseType','address','mailPause','smsPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','openchannelStatusTime','mailStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','map','rawAttributes','fieldName','type','query','role','getOptions','raw','user','agent','nolimit','sort','UserProfile','findAndCountAll','rows','omit','globalStatus','pauseTypeFilter','getQueues','mail','fax','whatsapp','Invalid\x20channel','key','Queues','getResources','all','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','offset','undefined','limit','count','set','Content-Range','error','stack','name','status','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2eb2,0x19f));var _0x22eb=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x2eb2[_0x1c546c];return _0x2cc384;};'use strict';var util=require('util');var _=require(_0x22eb('0x0'));var jayson=require(_0x22eb('0x1'));var qs=require(_0x22eb('0x2'));var logger=require(_0x22eb('0x3'))(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var amiClient=jayson['client'][_0x22eb('0x6')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithFilteredResult(_0x1dfef7,_0x10e116){return function(_0x35dd5b){if(_0x35dd5b){var _0x2a9850=typeof _0x10e116[_0x22eb('0x7')]===_0x22eb('0x8')&&typeof _0x10e116[_0x22eb('0x9')]===_0x22eb('0x8');var _0x419601=_0x35dd5b[_0x22eb('0xa')];var _0xb9c8a4=_0x2a9850?0x0:_0x10e116[_0x22eb('0x7')];var _0x489260=_0x2a9850?_0x35dd5b[_0x22eb('0xa')]:_0x10e116['offset']+_0x10e116['limit'];var _0x1aa348;if(_0x489260>=_0x419601){_0x489260=_0x419601;_0x1aa348=0xc8;}else{_0x1aa348=0xce;}_0x1dfef7['status'](_0x1aa348);return _0x1dfef7[_0x22eb('0xb')](_0x22eb('0xc'),_0xb9c8a4+'-'+_0x489260+'/'+_0x419601)['json'](_0x35dd5b);}return null;};}function handleError(_0x5068ea,_0x1f286c){_0x1f286c=_0x1f286c||0x1f4;return function(_0x189f05){logger[_0x22eb('0xd')](_0x189f05[_0x22eb('0xe')]);if(_0x189f05[_0x22eb('0xf')]){delete _0x189f05['name'];}_0x5068ea[_0x22eb('0x10')](_0x1f286c)['send'](_0x189f05);};}function getRealtimeAgents(){return new Promise(function(_0x1f5089,_0x55ede8){return amiClient[_0x22eb('0x11')](_0x22eb('0x12'),{})['then'](function(_0x48b63c){if(_0x48b63c['error'])throw new Error(_0x22eb('0x13'));var _0x5245fe=_0x48b63c['result'];return routingClient[_0x22eb('0x11')]('Agents',{})['then'](function(_0xb7a73a){if(_0xb7a73a[_0x22eb('0xd')])throw new Error(_0x22eb('0x14'));var _0x1ff041=_0xb7a73a[_0x22eb('0x15')];return _0x1f5089(_['merge']({},_0x5245fe,_0x1ff041));});})[_0x22eb('0x16')](function(_0x12bbd1){_0x55ede8(_0x12bbd1);});});}function getRealtimeQueues(_0x10d182,_0x410c25){return new Promise(function(_0x36be50,_0x517313){var _0x2eb115=_0x410c25===_0x22eb('0x17')?amiClient:routingClient;return _0x2eb115[_0x22eb('0x11')](_['startCase'](_0x410c25)+'Queues',_0x10d182)[_0x22eb('0x18')](function(_0x267d97){if(_0x267d97[_0x22eb('0xd')])throw new Error(util[_0x22eb('0x19')](_0x22eb('0x1a'),_0x410c25));return _0x36be50(_0x267d97[_0x22eb('0x15')]);})[_0x22eb('0x16')](function(_0x4e7e69){_0x517313(_0x4e7e69);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x2e8f7c,_0x11edbd){return amiClient[_0x22eb('0x11')](_0x22eb('0x1b'),{})[_0x22eb('0x18')](function(_0x4da252){if(_0x4da252[_0x22eb('0xd')])throw new Error(_0x22eb('0x1c'));return _0x2e8f7c(_0x4da252[_0x22eb('0x15')]);})['catch'](function(_0xe0783c){_0x11edbd(_0xe0783c);});});}function initializeQueues(_0x259847,_0x4b409a,_0x32a4b6,_0x222ef3){var _0x1e3015=[_0x22eb('0x1d'),_0x22eb('0x1e'),'waiting','talking',_0x22eb('0x1f')];if(_0x32a4b6===_0x22eb('0x17')&&_0x222ef3===_0x22eb('0x20')){_0x1e3015[_0x22eb('0x21')](_0x22eb('0x22'),_0x22eb('0x23'),_0x22eb('0x24'),_0x22eb('0x25'),_0x22eb('0x26'),_0x22eb('0x27'),_0x22eb('0x28'),_0x22eb('0x29'),'erlangCalls',_0x22eb('0x2a'),'erlangAbandonmentRate',_0x22eb('0x2b'),_0x22eb('0x2c'),_0x22eb('0x2d'),_0x22eb('0x2e'),_0x22eb('0x2f'),_0x22eb('0x30'),_0x22eb('0x31'),_0x22eb('0x32'),_0x22eb('0x33'),_0x22eb('0x34'),'predictiveIntervalAvgTalktime');}return _0x259847['map'](function(_0x239a41){var _0x5ceec1=_0x239a41['get']({'plain':!![]});_0x5ceec1[_0x22eb('0x35')]=[];_0x5ceec1[_0x22eb('0x1f')]=0x0;_0x5ceec1[_0x22eb('0x36')]=0x0;_0x5ceec1[_0x22eb('0x1d')]=0x0;_0x5ceec1[_0x22eb('0x1e')]=0x0;_0x5ceec1[_0x22eb('0x37')]=0x0;if(_0x32a4b6===_0x22eb('0x17')){_0x5ceec1[_0x22eb('0x38')]=0x0;_0x5ceec1[_0x22eb('0x39')]=0x0;if(_0x222ef3===_0x22eb('0x20')){_0x5ceec1['pTalking']=0x0;_0x5ceec1[_0x22eb('0x23')]=0x0;}}var _0x47be01=_['find'](_0x4b409a,['id',_0x5ceec1['id']]);if(_0x47be01)_[_0x22eb('0x3a')](_0x5ceec1,_[_0x22eb('0x3b')](_0x47be01,_0x1e3015));return _0x5ceec1;});}function updateAgentVoiceStatus(_0x48e47e,_0x42e9bd,_0x121c04){var _0x236def=_[_0x22eb('0x3c')](_0x121c04,[_0x22eb('0x3d'),_0x42e9bd['name']]);if(_0x236def[_0x22eb('0x3e')]===0x0)return _0x48e47e[_0x22eb('0x39')]=!![];if(_['some'](_0x236def,[_0x22eb('0x3f'),_0x48e47e[_0x22eb('0x40')][_0x22eb('0x41')]()]))return _0x48e47e[_0x22eb('0x38')]=!![];if(!_0x48e47e[_0x22eb('0x38')])return _0x48e47e['busy']=!![];}function getVoiceQueueAgents(_0x51c8b5,_0x2b1ae1,_0x6cd651,_0x541153){var _0x595d76=_[_0x22eb('0x42')](_0x2b1ae1,['id',_0x51c8b5['id']]);if(!_0x595d76)return _0x51c8b5;return _0x595d76[_0x22eb('0x43')]({'raw':!![]})['then'](function(_0x1d977c){for(var _0x3377eb=0x0;_0x3377eb<_0x1d977c[_0x22eb('0x3e')];_0x3377eb++){var _0x2a8517=_[_0x22eb('0x42')](_0x6cd651,['id',_0x1d977c[_0x3377eb][_0x22eb('0x44')]]);if(!_0x2a8517){_0x2a8517={'id':_0x1d977c[_0x3377eb]['UserId'],'name':_0x1d977c[_0x3377eb][_0x22eb('0x44')],'accountcode':'','online':![]};}var _0x3d2d1d={'id':_0x2a8517['id'],'name':_0x2a8517['name'],'internal':_0x2a8517[_0x22eb('0x45')],'online':Boolean(_0x2a8517[_0x22eb('0x46')]),'paused':Boolean(_0x1d977c[_0x3377eb][_0x22eb('0x1f')])};if(_0x2a8517[_0x22eb('0x47')]===_0x22eb('0x38'))updateAgentVoiceStatus(_0x3d2d1d,_0x51c8b5,_0x541153);if(_0x3d2d1d[_0x22eb('0x46')])_0x51c8b5[_0x22eb('0x36')]++;if(_0x3d2d1d[_0x22eb('0x39')])_0x51c8b5[_0x22eb('0x39')]++;if(_0x3d2d1d[_0x22eb('0x1f')]&&!_0x3d2d1d[_0x22eb('0x39')]&&!_0x3d2d1d[_0x22eb('0x38')])_0x51c8b5[_0x22eb('0x1f')]++;_0x51c8b5[_0x22eb('0x35')][_0x22eb('0x21')](_0x3d2d1d);}return _0x51c8b5;});}function getQueueAgents(_0x471657,_0x6996b4,_0x46e3ec){var _0x507f21=_0x22eb('0x48')+_[_0x22eb('0x49')](_0x46e3ec)+'Queue';var _0x10462d=_0x46e3ec+_0x22eb('0x4a');return db[_0x507f21]['findAll']({'where':{[_['startCase'](_0x46e3ec)+'QueueId']:_0x471657['id']},'raw':!![]})[_0x22eb('0x18')](function(_0x1efc65){for(var _0x4e4c6d=0x0;_0x4e4c6d<_0x1efc65['length'];_0x4e4c6d++){var _0xa7c642=_[_0x22eb('0x42')](_0x6996b4,['id',_0x1efc65[_0x4e4c6d][_0x22eb('0x44')]]);if(!_0xa7c642){_0xa7c642={'id':_0x1efc65[_0x4e4c6d][_0x22eb('0x44')],'name':_0x1efc65[_0x4e4c6d][_0x22eb('0x44')],'online':![],['pauseField']:![]};}var _0x3b30a3={'id':_0xa7c642['id'],'name':_0xa7c642[_0x22eb('0xf')],'online':Boolean(_0xa7c642[_0x22eb('0x46')]),'paused':Boolean(_0xa7c642[_0x10462d])};if(_0x3b30a3['online'])_0x471657['loggedInDb']++;_0x471657[_0x22eb('0x35')]['push'](_0x3b30a3);}return _0x471657;});}function isIdle(_0x5e695c){return _0x5e695c==='idle'||_0x5e695c===_0x22eb('0x4b')||_0x5e695c==='unavailable'||_0x5e695c==='ringing'||_['isNil'](_0x5e695c);}function isAgentPaused(_0x517784,_0x36b174){var _0x4b5c03=[_0x517784[_0x22eb('0x4c')],_0x517784[_0x22eb('0x4d')],_0x517784['mailPause'],_0x517784[_0x22eb('0x4e')],_0x517784['smsPause'],_0x517784[_0x22eb('0x4f')],_0x517784[_0x22eb('0x50')]];if(!_0x36b174)return _[_0x22eb('0x51')](_0x4b5c03);var _0x111cbe=_[_0x22eb('0x3c')](_0x4b5c03);return _0x111cbe[_0x22eb('0x3e')]>0x0&&_0x111cbe[_0x22eb('0x3e')]<_0x4b5c03[_0x22eb('0x3e')]?!![]:![];}function isAgentIdle(_0x11942d){if(_0x11942d['voiceStatus']!==_0x22eb('0x52')&&_0x11942d[_0x22eb('0x4f')]){_0x11942d['voiceStatus']=_0x22eb('0x53');return![];}return _[_0x22eb('0x51')]([_0x11942d[_0x22eb('0x54')],_0x11942d[_0x22eb('0x55')],_0x11942d['mailStatus'],_0x11942d[_0x22eb('0x56')],_0x11942d[_0x22eb('0x57')],_0x11942d[_0x22eb('0x47')],_0x11942d[_0x22eb('0x58')]],isIdle);}function getAgentStatus(_0x447177){var _0x10393b='unknown';if(isAgentPaused(_0x447177))_0x10393b=_0x22eb('0x53');else if(isAgentPaused(_0x447177,!![]))_0x10393b='*pause';else if(isAgentIdle(_0x447177))_0x10393b=_0x22eb('0x52');else _0x10393b='busy';return _0x10393b;}exports[_0x22eb('0x59')]=function(_0x254b53,_0x4028ef){var _0x2c1b87={'count':0x0,'rows':[]},_0x3f03df={},_0x4aa0c5,_0x4896ed,_0xfbf2e7=['userpic',_0x22eb('0x46'),_0x22eb('0x5a'),_0x22eb('0x5b'),_0x22eb('0x5c'),_0x22eb('0x5b'),_0x22eb('0x40'),_0x22eb('0x5d'),_0x22eb('0x4c'),_0x22eb('0x4e'),_0x22eb('0x5e'),_0x22eb('0x5f'),'whatsappPause',_0x22eb('0x4d'),_0x22eb('0x4f'),_0x22eb('0x60'),_0x22eb('0x61'),_0x22eb('0x62'),_0x22eb('0x63'),_0x22eb('0x64'),_0x22eb('0x65'),_0x22eb('0x66'),_0x22eb('0x67'),_0x22eb('0x68'),_0x22eb('0x69'),_0x22eb('0x6a'),_0x22eb('0x6b'),'chatStatus','openchannelStatus',_0x22eb('0x6c'),_0x22eb('0x57'),_0x22eb('0x58'),_0x22eb('0x55'),_0x22eb('0x47'),'chatStatusTime',_0x22eb('0x6d'),_0x22eb('0x6e'),'smsStatusTime','whatsappStatusTime',_0x22eb('0x6f'),_0x22eb('0x70'),_0x22eb('0x3d'),_0x22eb('0x71'),_0x22eb('0x72'),_0x22eb('0x73'),_0x22eb('0x74'),_0x22eb('0x75')],_0x8e3864=[_0x22eb('0x4c'),_0x22eb('0x4e'),_0x22eb('0x5e'),_0x22eb('0x5f'),_0x22eb('0x50'),_0x22eb('0x4d'),'voicePause',_0x22eb('0x46')];Promise[_0x22eb('0x76')]()[_0x22eb('0x18')](function(){var _0x5dbc43=_[_0x22eb('0x77')](db['User'][_0x22eb('0x78')],function(_0x5347b4){return{'name':_0x5347b4[_0x22eb('0x79')],'type':_0x5347b4[_0x22eb('0x7a')]['key']};});_0x254b53[_0x22eb('0x7b')][_0x22eb('0x7c')]='agent';_0x254b53['query'][_0x22eb('0x46')]=!![];_0x3f03df=qs[_0x22eb('0x7d')](_0x5dbc43,_0x254b53);_0x3f03df[_0x22eb('0x7e')]=!![];if(_0x254b53[_0x22eb('0x7f')][_0x22eb('0x7c')]===_0x22eb('0x7f')){var _0x4f5eee={'params':{'id':_0x254b53[_0x22eb('0x7f')]['userProfileId']},'query':{'section':'Agents','role':_0x22eb('0x80'),'online':!![],'nolimit':_0x254b53[_0x22eb('0x7b')][_0x22eb('0x81')],'sort':_0x254b53[_0x22eb('0x7b')][_0x22eb('0x82')],'filter':_0x254b53[_0x22eb('0x7b')][_0x22eb('0x3c')],'raw':!![]}};return db[_0x22eb('0x83')]['getResources'](_0x4f5eee);}return db['User'][_0x22eb('0x84')](_0x3f03df);})[_0x22eb('0x18')](function(_0x49f182){_0x2c1b87[_0x22eb('0xa')]=_0x49f182[_0x22eb('0xa')];_0x4aa0c5=_0x49f182[_0x22eb('0x85')];return getRealtimeAgents();})[_0x22eb('0x18')](function(_0x40faf6){_0x4896ed=_0x40faf6[_0x22eb('0x85')];return _0x4aa0c5['map'](function(_0x3dd49b){var _0x29d4a7=_[_0x22eb('0x42')](_0x4896ed,['id',_0x3dd49b['id']]);if(_0x29d4a7)_['merge'](_0x3dd49b,_['pick'](_[_0x22eb('0x86')](_0x29d4a7,_0x8e3864),_0xfbf2e7));_0x3dd49b[_0x22eb('0x87')]=getAgentStatus(_0x3dd49b);return _0x3dd49b;});})[_0x22eb('0x18')](function(_0x5ebeb5){if(_0x254b53[_0x22eb('0x7b')]['globalStatusFilter']){var _0x1a305d=_[_0x22eb('0x3c')](_0x5ebeb5,[_0x22eb('0x87'),_0x254b53[_0x22eb('0x7b')]['globalStatusFilter']]);if(_0x254b53[_0x22eb('0x7b')][_0x22eb('0x88')]){_0x1a305d=_[_0x22eb('0x3c')](_0x1a305d,[_0x22eb('0x5c'),_0x254b53[_0x22eb('0x7b')][_0x22eb('0x88')]]);}}_0x2c1b87[_0x22eb('0x85')]=_0x1a305d||_0x5ebeb5;return _0x2c1b87;})[_0x22eb('0x18')](respondWithFilteredResult(_0x4028ef,_0x3f03df))[_0x22eb('0x16')](handleError(_0x4028ef,null));};exports[_0x22eb('0x89')]=function(_0x14006f,_0x5b4e6a){var _0x1d0749=[_0x22eb('0x8a'),'chat','sms','openchannel',_0x22eb('0x8b'),_0x22eb('0x8c'),'voice'];var _0x10726f={'count':0x0,'rows':[]},_0x15e08a={},_0xe6e71d,_0x41c50e,_0x8cbc83,_0x4ab4f8,_0x5e01b5;Promise[_0x22eb('0x76')]()[_0x22eb('0x18')](function(){if(_0x14006f[_0x22eb('0x7b')]['channel']){if(!_['includes'](_0x1d0749,_0x14006f[_0x22eb('0x7b')]['channel']['toLowerCase']()))throw new Error(_0x22eb('0x8d'));_0xe6e71d=_0x14006f[_0x22eb('0x7b')]['channel']['toLowerCase']();}var _0x1e393a=_[_0x22eb('0x49')](_0xe6e71d)+'Queue';var _0x17f51b=_[_0x22eb('0x77')](db[_0x1e393a][_0x22eb('0x78')],function(_0x5823d0){return{'name':_0x5823d0[_0x22eb('0x79')],'type':_0x5823d0[_0x22eb('0x7a')][_0x22eb('0x8e')]};});_0x15e08a=qs[_0x22eb('0x7d')](_0x17f51b,_0x14006f);if(_0x14006f[_0x22eb('0x7f')]['role']===_0x22eb('0x7f')){var _0x2ecc24={'params':{'id':_0x14006f[_0x22eb('0x7f')]['userProfileId']},'query':{'section':_0xe6e71d==='voice'&&_0x14006f[_0x22eb('0x7b')][_0x22eb('0x7a')]===_0x22eb('0x20')?'QueueCampaigns':_[_0x22eb('0x49')](_0xe6e71d)+_0x22eb('0x8f'),'type':_0x14006f[_0x22eb('0x7b')]['type'],'nolimit':!![],'sort':_0x22eb('0xf'),'filter':_0x14006f['query']['filter']}};return db[_0x22eb('0x83')][_0x22eb('0x90')](_0x2ecc24);}return db[_0x1e393a][_0x22eb('0x84')](_0x15e08a);})['then'](function(_0x3fc402){_0x10726f[_0x22eb('0xa')]=_0x3fc402[_0x22eb('0xa')];_0x41c50e=_0x3fc402[_0x22eb('0x85')];return getRealtimeQueues(_0x14006f,_0xe6e71d);})[_0x22eb('0x18')](function(_0x545c0a){_0x4ab4f8=_0x545c0a[_0x22eb('0x85')];return getRealtimeAgents();})['then'](function(_0x36dde2){_0x8cbc83=_0x36dde2[_0x22eb('0x85')];if(_0xe6e71d!=_0x22eb('0x17'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0xe19621){_0x5e01b5=_0xe19621?_0xe19621[_0x22eb('0x85')]:[];return initializeQueues(_0x41c50e,_0x4ab4f8,_0xe6e71d,_0x14006f[_0x22eb('0x7b')][_0x22eb('0x7a')]);})[_0x22eb('0x18')](function(_0xeaf655){var _0x45b691=_0xeaf655[_0x22eb('0x77')](function(_0x1ef974){if(_0xe6e71d===_0x22eb('0x17'))return getVoiceQueueAgents(_0x1ef974,_0x41c50e,_0x8cbc83,_0x5e01b5);else return getQueueAgents(_0x1ef974,_0x8cbc83,_0xe6e71d);});return Promise[_0x22eb('0x91')](_0x45b691);})['then'](function(_0x30e721){_0x10726f[_0x22eb('0x85')]=_0x30e721;return _0x10726f;})[_0x22eb('0x18')](respondWithFilteredResult(_0x5b4e6a,_0x15e08a))[_0x22eb('0x16')](handleError(_0x5b4e6a,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 3e0802a..70cd027 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3e86e7,_0x548b37){var _0x56355c=function(_0x44be2e){while(--_0x44be2e){_0x3e86e7['push'](_0x3e86e7['shift']());}};_0x56355c(++_0x548b37);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4cbac3,_0x1c73d0){var _0x31451b=function(_0x47500f){while(--_0x47500f){_0x4cbac3['push'](_0x4cbac3['shift']());}};_0x31451b(++_0x1c73d0);}(_0xe706,0xa3));var _0x6e70=function(_0x2cc374,_0x21c582){_0x2cc374=_0x2cc374-0x0;var _0x306658=_0xe706[_0x2cc374];return _0x306658;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 6b0c664..a178378 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 _0x6b8f=['exports','STRING','DATE'];(function(_0x1084bc,_0x581375){var _0x7ab067=function(_0x802512){while(--_0x802512){_0x1084bc['push'](_0x1084bc['shift']());}};_0x7ab067(++_0x581375);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x4cee49,_0x2e2dde){_0x4cee49=_0x4cee49-0x0;var _0x247dcb=_0x6b8f[_0x4cee49];return _0x247dcb;};'use strict';var Sequelize=require('sequelize');module[_0xf6b8('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf6b8('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xf6b8('0x2')]},'responsetime':{'type':Sequelize[_0xf6b8('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf6b8('0x1')]},'campaigntype':{'type':Sequelize[_0xf6b8('0x1')]},'membername':{'type':Sequelize[_0xf6b8('0x1')]}}; \ No newline at end of file +var _0x0e76=['sequelize','STRING','DATE','INTEGER'];(function(_0x3c4fd5,_0x1de0bc){var _0x448cea=function(_0x1da63d){while(--_0x1da63d){_0x3c4fd5['push'](_0x3c4fd5['shift']());}};_0x448cea(++_0x1de0bc);}(_0x0e76,0xc4));var _0x60e7=function(_0x17cb63,_0x4c0e90){_0x17cb63=_0x17cb63-0x0;var _0x4340bc=_0x0e76[_0x17cb63];return _0x4340bc;};'use strict';var Sequelize=require(_0x60e7('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x60e7('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x60e7('0x1')]},'starttime':{'type':Sequelize[_0x60e7('0x2')]},'responsetime':{'type':Sequelize[_0x60e7('0x2')]},'ringtime':{'type':Sequelize[_0x60e7('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x60e7('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x60e7('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 4bdbaf8..aba03ed 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 _0x8063=['../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2dc3db,_0x18ee6d){var _0x13645b=function(_0x5cf87e){while(--_0x5cf87e){_0x2dc3db['push'](_0x2dc3db['shift']());}};_0x13645b(++_0x18ee6d);}(_0x8063,0x14a));var _0x3806=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8063[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x3806('0x0'));var util=require(_0x3806('0x1'));var logger=require(_0x3806('0x2'))(_0x3806('0x3'));var moment=require(_0x3806('0x4'));var BPromise=require(_0x3806('0x5'));var rp=require(_0x3806('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3806('0x7'));var config=require(_0x3806('0x8'));var attributes=require(_0x3806('0x9'));module[_0x3806('0xa')]=function(_0x4fd47e,_0x3f4c8a){return _0x4fd47e[_0x3806('0xb')](_0x3806('0xc'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c57=['api','bluebird','request-promise','rimraf','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0c57,0x1d4));var _0x70c5=function(_0x226e3c,_0x17928e){_0x226e3c=_0x226e3c-0x0;var _0x334a4a=_0x0c57[_0x226e3c];return _0x334a4a;};'use strict';var _=require(_0x70c5('0x0'));var util=require('util');var logger=require(_0x70c5('0x1'))(_0x70c5('0x2'));var moment=require('moment');var BPromise=require(_0x70c5('0x3'));var rp=require(_0x70c5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x70c5('0x5'));var config=require('../../config/environment');var attributes=require(_0x70c5('0x6'));module[_0x70c5('0x7')]=function(_0xdc0037,_0x2c039e){return _0xdc0037['define'](_0x70c5('0x8'),attributes,{'tableName':_0x70c5('0x9'),'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 d9e77d5..c5a2e4f 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 _0xffb3=['util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview'];(function(_0x5b7ef8,_0x1110a0){var _0x55874f=function(_0xdfbb28){while(--_0xdfbb28){_0x5b7ef8['push'](_0x5b7ef8['shift']());}};_0x55874f(++_0x1110a0);}(_0xffb3,0x152));var _0x3ffb=function(_0x595e3e,_0xf60260){_0x595e3e=_0x595e3e-0x0;var _0x196235=_0xffb3[_0x595e3e];return _0x196235;};'use strict';var _=require('lodash');var util=require(_0x3ffb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ffb('0x1'));var db=require(_0x3ffb('0x2'))['db'];var utils=require(_0x3ffb('0x3'));var logger=require(_0x3ffb('0x4'))(_0x3ffb('0x5'));var config=require(_0x3ffb('0x6'));var jayson=require(_0x3ffb('0x7'));var client=jayson['client'][_0x3ffb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b8544,_0x135fa7,_0x51607a){return new BPromise(function(_0x38c52e,_0x41e9c1){return client['request'](_0x5b8544,_0x51607a)[_0x3ffb('0x9')](function(_0x1fa558){logger['info'](_0x3ffb('0xa'),_0x135fa7,_0x3ffb('0xb'));logger[_0x3ffb('0xc')](_0x3ffb('0xd'),_0x135fa7,_0x3ffb('0xb'),JSON[_0x3ffb('0xe')](_0x1fa558));if(_0x1fa558[_0x3ffb('0xf')]){if(_0x1fa558[_0x3ffb('0xf')]['code']===0x1f4){logger[_0x3ffb('0xf')](_0x3ffb('0xa'),_0x135fa7,_0x1fa558[_0x3ffb('0xf')]['message']);return _0x41e9c1(_0x1fa558[_0x3ffb('0xf')][_0x3ffb('0x10')]);}logger['error'](_0x3ffb('0xa'),_0x135fa7,_0x1fa558[_0x3ffb('0xf')][_0x3ffb('0x10')]);return _0x38c52e(_0x1fa558[_0x3ffb('0xf')][_0x3ffb('0x10')]);}else{logger[_0x3ffb('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x135fa7,_0x3ffb('0xb'));_0x38c52e(_0x1fa558[_0x3ffb('0x12')][_0x3ffb('0x10')]);}})[_0x3ffb('0x13')](function(_0x4511cc){logger['error'](_0x3ffb('0xa'),_0x135fa7,_0x4511cc);_0x41e9c1(_0x4511cc);});});}exports['CreateReportAgentPreview']=function(_0x1178ab){var _0x22ceab=this;return new Promise(function(_0x577619,_0x49129e){return db[_0x3ffb('0x14')][_0x3ffb('0x15')](_0x1178ab[_0x3ffb('0x16')],{'raw':_0x1178ab['options']?_0x1178ab[_0x3ffb('0x17')][_0x3ffb('0x18')]===undefined?!![]:![]:!![]})[_0x3ffb('0x9')](function(_0x22c9a8){logger['info']('CreateReportAgentPreview',_0x1178ab);logger[_0x3ffb('0xc')](_0x3ffb('0x19'),_0x1178ab,JSON[_0x3ffb('0xe')](_0x22c9a8));_0x577619(_0x22c9a8);})[_0x3ffb('0x13')](function(_0x4a580d){logger[_0x3ffb('0xf')](_0x3ffb('0x19'),_0x4a580d[_0x3ffb('0x10')],_0x1178ab);_0x49129e(_0x22ceab[_0x3ffb('0xf')](0x1f4,_0x4a580d[_0x3ffb('0x10')]));});});}; \ No newline at end of file +var _0xf202=['body','options','raw','stringify','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message','result','CreateReportAgentPreview','ReportAgentPreview','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf202,0xb3));var _0x2f20=function(_0x8e736f,_0x5e637b){_0x8e736f=_0x8e736f-0x0;var _0x1c5747=_0xf202[_0x8e736f];return _0x1c5747;};'use strict';var _=require(_0x2f20('0x0'));var util=require(_0x2f20('0x1'));var moment=require('moment');var BPromise=require(_0x2f20('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f20('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f20('0x4'));var logger=require(_0x2f20('0x5'))(_0x2f20('0x6'));var config=require('../../config/environment');var jayson=require(_0x2f20('0x7'));var client=jayson[_0x2f20('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcd06a8,_0x2739a0,_0x3fccfc){return new BPromise(function(_0x459c55,_0x50da6a){return client[_0x2f20('0x9')](_0xcd06a8,_0x3fccfc)[_0x2f20('0xa')](function(_0xf96232){logger['info'](_0x2f20('0xb'),_0x2739a0,_0x2f20('0xc'));logger[_0x2f20('0xd')](_0x2f20('0xe'),_0x2739a0,'request\x20sent',JSON['stringify'](_0xf96232));if(_0xf96232[_0x2f20('0xf')]){if(_0xf96232['error']['code']===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x2739a0,_0xf96232[_0x2f20('0xf')][_0x2f20('0x10')]);return _0x50da6a(_0xf96232['error'][_0x2f20('0x10')]);}logger['error'](_0x2f20('0xb'),_0x2739a0,_0xf96232[_0x2f20('0xf')]['message']);return _0x459c55(_0xf96232[_0x2f20('0xf')][_0x2f20('0x10')]);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x2739a0,'request\x20sent');_0x459c55(_0xf96232[_0x2f20('0x11')][_0x2f20('0x10')]);}})['catch'](function(_0x649df3){logger[_0x2f20('0xf')](_0x2f20('0xb'),_0x2739a0,_0x649df3);_0x50da6a(_0x649df3);});});}exports[_0x2f20('0x12')]=function(_0x5d42bf){var _0x12b0f7=this;return new Promise(function(_0x7d389e,_0x3e106a){return db[_0x2f20('0x13')][_0x2f20('0x14')](_0x5d42bf[_0x2f20('0x15')],{'raw':_0x5d42bf[_0x2f20('0x16')]?_0x5d42bf[_0x2f20('0x16')][_0x2f20('0x17')]===undefined?!![]:![]:!![]})[_0x2f20('0xa')](function(_0x13d113){logger['info'](_0x2f20('0x12'),_0x5d42bf);logger['debug'](_0x2f20('0x12'),_0x5d42bf,JSON[_0x2f20('0x18')](_0x13d113));_0x7d389e(_0x13d113);})['catch'](function(_0xb47ed7){logger[_0x2f20('0xf')](_0x2f20('0x12'),_0xb47ed7['message'],_0x5d42bf);_0x3e106a(_0x12b0f7[_0x2f20('0xf')](0x1f4,_0xb47ed7[_0x2f20('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index b96bb09..44a7a3e 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 _0x3645=['voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','get','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','/campaigns','/fax/accounts','faxAccounts','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','queueNotify','/mail/queues/:id','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','/voice/channels'];(function(_0x564b82,_0x4c0db0){var _0x4111d9=function(_0x3d0b66){while(--_0x3d0b66){_0x564b82['push'](_0x564b82['shift']());}};_0x4111d9(++_0x4c0db0);}(_0x3645,0x198));var _0x5364=function(_0x3f25db,_0x1d3686){_0x3f25db=_0x3f25db-0x0;var _0x54f29d=_0x3645[_0x3f25db];return _0x54f29d;};'use strict';var multer=require(_0x5364('0x0'));var util=require(_0x5364('0x1'));var path=require(_0x5364('0x2'));var express=require(_0x5364('0x3'));var router=express[_0x5364('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0x5364('0x5'));router['get'](_0x5364('0x6'),auth['isAuthenticated'](),controller[_0x5364('0x7')]);router['get'](_0x5364('0x8'),auth[_0x5364('0x9')](),controller[_0x5364('0xa')]);router[_0x5364('0xb')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x5364('0x9')](),controller[_0x5364('0xc')]);router[_0x5364('0xb')](_0x5364('0xd'),auth[_0x5364('0x9')](),controller[_0x5364('0xe')]);router[_0x5364('0xb')](_0x5364('0xf'),auth[_0x5364('0x9')](),controller[_0x5364('0x10')]);router[_0x5364('0xb')]('/mail/queues',auth[_0x5364('0x9')](),controller['mailQueues']);router['get'](_0x5364('0x11'),auth['isAuthenticated'](),controller[_0x5364('0x12')]);router[_0x5364('0xb')](_0x5364('0x13'),auth[_0x5364('0x9')](),controller[_0x5364('0x14')]);router[_0x5364('0xb')](_0x5364('0x15'),auth['isAuthenticated'](),controller[_0x5364('0x16')]);router[_0x5364('0xb')](_0x5364('0x17'),auth[_0x5364('0x9')](),controller[_0x5364('0x18')]);router[_0x5364('0xb')]('/fax/queues',auth[_0x5364('0x9')](),controller[_0x5364('0x19')]);router[_0x5364('0xb')](_0x5364('0x1a'),auth[_0x5364('0x9')](),controller[_0x5364('0x1b')]);router[_0x5364('0xb')](_0x5364('0x1c'),auth[_0x5364('0x9')](),controller[_0x5364('0x1d')]);router['get'](_0x5364('0x1e'),auth[_0x5364('0x9')](),controller['voiceQueuesChannel']);router[_0x5364('0xb')](_0x5364('0x1f'),auth[_0x5364('0x9')](),controller[_0x5364('0x20')]);router[_0x5364('0xb')](_0x5364('0x21'),auth[_0x5364('0x9')](),controller[_0x5364('0x22')]);router[_0x5364('0xb')](_0x5364('0x23'),auth[_0x5364('0x9')](),controller[_0x5364('0x24')]);router[_0x5364('0x25')](_0x5364('0x23'),auth[_0x5364('0x9')](),controller[_0x5364('0x26')]);router[_0x5364('0xb')](_0x5364('0x27'),auth[_0x5364('0x9')](),controller[_0x5364('0x28')]);router[_0x5364('0xb')](_0x5364('0x29'),auth[_0x5364('0x9')](),controller[_0x5364('0x2a')]);router['get'](_0x5364('0x2b'),auth['isAuthenticated'](),controller[_0x5364('0x2c')]);router[_0x5364('0x25')](_0x5364('0x2d'),auth[_0x5364('0x9')](),controller[_0x5364('0x2e')]);router[_0x5364('0xb')]('/telephones',auth[_0x5364('0x9')](),controller[_0x5364('0x2f')]);router['get'](_0x5364('0x30'),auth[_0x5364('0x9')](),controller['trunks']);router['get'](_0x5364('0x31'),auth[_0x5364('0x9')](),controller['campaigns']);router[_0x5364('0xb')](_0x5364('0x32'),auth[_0x5364('0x9')](),controller[_0x5364('0x33')]);router[_0x5364('0xb')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x5364('0xb')](_0x5364('0x34'),auth[_0x5364('0x9')](),controller['mailQueuesWaitingInteractions']);router[_0x5364('0xb')]('/openchannel/queues/waitinginteractions',auth[_0x5364('0x9')](),controller[_0x5364('0x35')]);router[_0x5364('0xb')](_0x5364('0x36'),auth[_0x5364('0x9')](),controller[_0x5364('0x37')]);router[_0x5364('0xb')](_0x5364('0x38'),auth[_0x5364('0x9')](),controller[_0x5364('0x39')]);router['get'](_0x5364('0x3a'),auth[_0x5364('0x9')](),controller[_0x5364('0x3b')]);router[_0x5364('0xb')](_0x5364('0x3c'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x5364('0x3d')]('/mail/queues/:id/notify',auth[_0x5364('0x9')](),controller[_0x5364('0x3e')]('mail'));router[_0x5364('0xb')](_0x5364('0x3f'),auth[_0x5364('0x9')](),controller['showMailQueues']);router[_0x5364('0x3d')](_0x5364('0x40'),auth[_0x5364('0x9')](),controller[_0x5364('0x3e')]('chat'));router[_0x5364('0xb')](_0x5364('0x41'),auth[_0x5364('0x9')](),controller[_0x5364('0x42')]);router['post'](_0x5364('0x43'),auth[_0x5364('0x9')](),controller['queueNotify']('fax'));router[_0x5364('0xb')](_0x5364('0x44'),auth[_0x5364('0x9')](),controller[_0x5364('0x45')]);router[_0x5364('0x3d')](_0x5364('0x46'),auth['isAuthenticated'](),controller[_0x5364('0x3e')](_0x5364('0x47')));router[_0x5364('0xb')](_0x5364('0x48'),auth['isAuthenticated'](),controller[_0x5364('0x49')]);router['post'](_0x5364('0x4a'),auth[_0x5364('0x9')](),controller[_0x5364('0x3e')]('sms'));router[_0x5364('0x3d')](_0x5364('0x4b'),auth[_0x5364('0x9')](),controller[_0x5364('0x3e')](_0x5364('0x4c')));router[_0x5364('0xb')](_0x5364('0x4d'),auth[_0x5364('0x9')](),controller[_0x5364('0x4e')]);router[_0x5364('0xb')](_0x5364('0x4f'),auth[_0x5364('0x9')](),controller['showWhatsappQueues']);router[_0x5364('0x3d')](_0x5364('0x50'),auth['isAuthenticated'](),controller[_0x5364('0x51')]);module[_0x5364('0x52')]=router; \ No newline at end of file +var _0x0344=['showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x0344,0x14b));var _0x4034=function(_0x192a6b,_0x1b84c2){_0x192a6b=_0x192a6b-0x0;var _0x124061=_0x0344[_0x192a6b];return _0x124061;};'use strict';var multer=require(_0x4034('0x0'));var util=require(_0x4034('0x1'));var path=require('path');var express=require(_0x4034('0x2'));var router=express[_0x4034('0x3')]();var auth=require(_0x4034('0x4'));var controller=require(_0x4034('0x5'));router['get'](_0x4034('0x6'),auth['isAuthenticated'](),controller[_0x4034('0x7')]);router[_0x4034('0x8')](_0x4034('0x9'),auth[_0x4034('0xa')](),controller[_0x4034('0xb')]);router[_0x4034('0x8')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x4034('0xa')](),controller['voiceChannelStopMixMonitor']);router[_0x4034('0x8')](_0x4034('0xc'),auth[_0x4034('0xa')](),controller[_0x4034('0xd')]);router[_0x4034('0x8')]('/chat/queues',auth[_0x4034('0xa')](),controller[_0x4034('0xe')]);router[_0x4034('0x8')](_0x4034('0xf'),auth[_0x4034('0xa')](),controller[_0x4034('0x10')]);router[_0x4034('0x8')](_0x4034('0x11'),auth[_0x4034('0xa')](),controller[_0x4034('0x12')]);router[_0x4034('0x8')](_0x4034('0x13'),auth[_0x4034('0xa')](),controller[_0x4034('0x14')]);router[_0x4034('0x8')](_0x4034('0x15'),auth[_0x4034('0xa')](),controller[_0x4034('0x16')]);router[_0x4034('0x8')](_0x4034('0x17'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0x4034('0x8')](_0x4034('0x18'),auth[_0x4034('0xa')](),controller[_0x4034('0x19')]);router['get'](_0x4034('0x1a'),auth[_0x4034('0xa')](),controller[_0x4034('0x1b')]);router[_0x4034('0x8')]('/voice/queues/channels',auth[_0x4034('0xa')](),controller[_0x4034('0x1c')]);router[_0x4034('0x8')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x4034('0x1d')]);router[_0x4034('0x8')](_0x4034('0x1e'),auth[_0x4034('0xa')](),controller[_0x4034('0x1f')]);router[_0x4034('0x8')](_0x4034('0x20'),auth[_0x4034('0xa')](),controller[_0x4034('0x21')]);router[_0x4034('0x8')](_0x4034('0x22'),auth[_0x4034('0xa')](),controller[_0x4034('0x23')]);router[_0x4034('0x24')]('/voice/queues/:id',auth[_0x4034('0xa')](),controller['updateVoiceQueue']);router['get'](_0x4034('0x25'),auth[_0x4034('0xa')](),controller[_0x4034('0x26')]);router[_0x4034('0x8')](_0x4034('0x27'),auth['isAuthenticated'](),controller[_0x4034('0x28')]);router['get'](_0x4034('0x29'),auth[_0x4034('0xa')](),controller[_0x4034('0x2a')]);router['put'](_0x4034('0x2b'),auth[_0x4034('0xa')](),controller[_0x4034('0x2c')]);router['get'](_0x4034('0x2d'),auth[_0x4034('0xa')](),controller[_0x4034('0x2e')]);router['get']('/trunks',auth[_0x4034('0xa')](),controller[_0x4034('0x2f')]);router[_0x4034('0x8')]('/campaigns',auth[_0x4034('0xa')](),controller[_0x4034('0x30')]);router['get'](_0x4034('0x31'),auth[_0x4034('0xa')](),controller[_0x4034('0x32')]);router[_0x4034('0x8')](_0x4034('0x33'),auth[_0x4034('0xa')](),controller['chatQueuesWaitingInteractions']);router[_0x4034('0x8')](_0x4034('0x34'),auth[_0x4034('0xa')](),controller['mailQueuesWaitingInteractions']);router['get'](_0x4034('0x35'),auth[_0x4034('0xa')](),controller['openchannelQueuesWaitingInteractions']);router[_0x4034('0x8')](_0x4034('0x36'),auth[_0x4034('0xa')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x4034('0x8')](_0x4034('0x37'),auth[_0x4034('0xa')](),controller['smsQueuesWaitingInteractions']);router[_0x4034('0x8')]('/whatsapp/queues/waitinginteractions',auth[_0x4034('0xa')](),controller[_0x4034('0x38')]);router[_0x4034('0x8')](_0x4034('0x39'),auth[_0x4034('0xa')](),controller[_0x4034('0x3a')]);router[_0x4034('0x3b')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0x4034('0x3c')](_0x4034('0x3d')));router[_0x4034('0x8')](_0x4034('0x3e'),auth[_0x4034('0xa')](),controller[_0x4034('0x3f')]);router[_0x4034('0x3b')](_0x4034('0x40'),auth[_0x4034('0xa')](),controller[_0x4034('0x3c')](_0x4034('0x41')));router[_0x4034('0x8')](_0x4034('0x42'),auth['isAuthenticated'](),controller['showChatQueues']);router['post'](_0x4034('0x43'),auth['isAuthenticated'](),controller[_0x4034('0x3c')](_0x4034('0x44')));router[_0x4034('0x8')](_0x4034('0x45'),auth[_0x4034('0xa')](),controller['showFaxQueues']);router[_0x4034('0x3b')](_0x4034('0x46'),auth[_0x4034('0xa')](),controller[_0x4034('0x3c')](_0x4034('0x47')));router[_0x4034('0x8')](_0x4034('0x48'),auth[_0x4034('0xa')](),controller[_0x4034('0x49')]);router[_0x4034('0x3b')](_0x4034('0x4a'),auth[_0x4034('0xa')](),controller[_0x4034('0x3c')](_0x4034('0x4b')));router[_0x4034('0x3b')]('/whatsapp/queues/:id/notify',auth[_0x4034('0xa')](),controller['queueNotify'](_0x4034('0x4c')));router[_0x4034('0x8')](_0x4034('0x4d'),auth['isAuthenticated'](),controller[_0x4034('0x4e')]);router[_0x4034('0x8')]('/whatsapp/queues/:id',auth[_0x4034('0xa')](),controller[_0x4034('0x4f')]);router[_0x4034('0x3b')](_0x4034('0x50'),auth[_0x4034('0xa')](),controller[_0x4034('0x51')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 201556c..1df336c 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 _0x7fbe=['VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','SIP/%s','user','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','rows','filter','map','queue_id','uniq','value','indexOf','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','create','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','Website','User','Agent\x20not\x20found','From','TransferReport','Start','agentTransferTimeout','*,*,*,*','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','code','message','result','catch','status','json','stack','name','send','isNil','find','voiceChannels','query','VoiceChannelMixMonitor','merge','params','then','voiceQueues','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','body'];(function(_0x1b892b,_0x4efe48){var _0xa99e57=function(_0x3f957a){while(--_0x3f957a){_0x1b892b['push'](_0x1b892b['shift']());}};_0xa99e57(++_0x4efe48);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1e7ead,_0x7f6227){_0x1e7ead=_0x1e7ead-0x0;var _0x3912b2=_0x7fbe[_0x1e7ead];return _0x3912b2;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xe7fb('0x0'));var util=require(_0xe7fb('0x1'));var db=require(_0xe7fb('0x2'))['db'];var logger=require(_0xe7fb('0x3'))(_0xe7fb('0x4'));var jayson=require(_0xe7fb('0x5'));var amiClient=jayson[_0xe7fb('0x6')][_0xe7fb('0x7')]({'port':0x232a});var mailClient=jayson[_0xe7fb('0x6')][_0xe7fb('0x7')]({'port':0x232b});var routingClient=jayson[_0xe7fb('0x6')][_0xe7fb('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){var _0x1d0741=_0x5ad75b?_0x5ad75b:amiClient;return _0x1d0741[_0xe7fb('0x8')](_0x24cd67,_0x1f943f)['then'](function(_0x558857){if(_0x558857[_0xe7fb('0x9')]){if(_0x558857[_0xe7fb('0x9')][_0xe7fb('0xa')]===0x1f4){return _0x228f6b(_0x558857[_0xe7fb('0x9')][_0xe7fb('0xb')]);}return _0x213ebc(_0x558857[_0xe7fb('0x9')][_0xe7fb('0xb')]);}else{_0x213ebc(_0x558857[_0xe7fb('0xc')]);}})[_0xe7fb('0xd')](function(_0x2fe8ab){_0x228f6b(_0x2fe8ab);});});}function respondWithResult(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xc8;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0xe')](_0x188e1d)[_0xe7fb('0xf')](_0xdf9760);}return _0x2437d4['sendStatus'](0x194);};}function handleError(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0x1f4;return function(_0x5573ab){logger[_0xe7fb('0x9')](_0x5573ab[_0xe7fb('0x10')]);if(_0x5573ab['name']){delete _0x5573ab[_0xe7fb('0x11')];}_0x278b75['status'](_0x2225e5)[_0xe7fb('0x12')](_0x5573ab);};}function findById(_0x18d23c){return function(_0x12603d){if(!_[_0xe7fb('0x13')](_0x18d23c)&&!_['isNil'](_0x12603d)&&!_[_0xe7fb('0x13')](_0x12603d['rows'])){return _[_0xe7fb('0x14')](_0x12603d['rows'],function(_0x1e77fd){return _0x1e77fd['id']==_0x18d23c;});}return null;};}exports[_0xe7fb('0x15')]=function(_0x3f96a7,_0x182269){return respondWithRpcPromise('VoiceChannels',_0x3f96a7[_0xe7fb('0x16')])['then'](respondWithResult(_0x182269,null))[_0xe7fb('0xd')](handleError(_0x182269,null));};exports['voiceChannelMixMonitor']=function(_0x15f7a4,_0x4ea664){return respondWithRpcPromise(_0xe7fb('0x17'),_[_0xe7fb('0x18')](_0x15f7a4['query'],_0x15f7a4[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x4ea664,null))[_0xe7fb('0xd')](handleError(_0x4ea664,null));};exports['voiceChannelStopMixMonitor']=function(_0x469d50,_0x469ead){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x469d50['query'],_0x469d50[_0xe7fb('0x19')]))['then'](respondWithResult(_0x469ead,null))['catch'](handleError(_0x469ead,null));};exports[_0xe7fb('0x1b')]=function(_0x32e8b2,_0x2996ae){return respondWithRpcPromise('VoiceQueues',_0x32e8b2[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x2996ae,null))[_0xe7fb('0xd')](handleError(_0x2996ae,null));};exports[_0xe7fb('0x1c')]=function(_0x392d75,_0x16237a){return respondWithRpcPromise(_0xe7fb('0x1d'),_0x392d75['query'])['then'](findById(_0x392d75[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x16237a,null))[_0xe7fb('0xd')](handleError(_0x16237a,null));};exports['updateVoiceQueue']=function(_0xb1f2f4,_0x251807){return respondWithRpcPromise(_0xe7fb('0x1e'),_[_0xe7fb('0x18')](_0xb1f2f4[_0xe7fb('0x1f')],_0xb1f2f4[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x251807,null))[_0xe7fb('0xd')](handleError(_0x251807,null));};exports['voiceQueuesPreview']=function(_0x3d1fb5,_0x1742f3){return respondWithRpcPromise(_0xe7fb('0x20'),_['merge'](_0x3d1fb5['query'],_0x3d1fb5[_0xe7fb('0x19')]))['then'](respondWithResult(_0x1742f3,null))[_0xe7fb('0xd')](handleError(_0x1742f3,null));};exports[_0xe7fb('0x21')]=function(_0xe49053,_0x2a4745){return respondWithRpcPromise('VoiceQueuesChannels',_0xe49053[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x2a4745,null))[_0xe7fb('0xd')](handleError(_0x2a4745,null));};exports[_0xe7fb('0x22')]=function(_0x2d650d,_0x480819){return respondWithRpcPromise(_0xe7fb('0x23'),_[_0xe7fb('0x18')](_0x2d650d[_0xe7fb('0x16')],_0x2d650d[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x480819,null))[_0xe7fb('0xd')](handleError(_0x480819,null));};exports[_0xe7fb('0x24')]=function(_0x147eb1,_0x389903){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xe7fb('0x18')](_0x147eb1[_0xe7fb('0x16')],_0x147eb1[_0xe7fb('0x19')]))['then'](respondWithResult(_0x389903,null))[_0xe7fb('0xd')](handleError(_0x389903,null));};exports[_0xe7fb('0x25')]=function(_0x4218bc,_0x1530b1){return respondWithRpcPromise(_0xe7fb('0x26'),_[_0xe7fb('0x18')](_0x4218bc[_0xe7fb('0x16')],_0x4218bc[_0xe7fb('0x19')]))[_0xe7fb('0x1a')](respondWithResult(_0x1530b1,null))[_0xe7fb('0xd')](handleError(_0x1530b1,null));};exports[_0xe7fb('0x27')]=function(_0x3c4f4b,_0x1544f2){return respondWithRpcPromise(_0xe7fb('0x28'),_0x3c4f4b[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x1544f2,null))[_0xe7fb('0xd')](handleError(_0x1544f2,null));};exports[_0xe7fb('0x29')]=function(_0x21e35c,_0x4d6fe6){return respondWithRpcPromise(_0xe7fb('0x2a'),_0x21e35c[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x4d6fe6,null))[_0xe7fb('0xd')](handleError(_0x4d6fe6,null));};exports['agents']=function(_0x3426a9,_0x186418){var _0xd472d;return respondWithRpcPromise(_0xe7fb('0x2b'),_0x3426a9['query'])[_0xe7fb('0x1a')](function(_0x451a6c){_0xd472d=_0x451a6c;return respondWithRpcPromise(_0xe7fb('0x2b'),_0x3426a9[_0xe7fb('0x16')],routingClient);})[_0xe7fb('0x1a')](function(_0xb729fc){return _['merge']({},_0xb729fc,_0xd472d);})[_0xe7fb('0x1a')](respondWithResult(_0x186418,null))[_0xe7fb('0xd')](handleError(_0x186418,null));};exports[_0xe7fb('0x2c')]=function(_0x4b263d,_0x36a341){if(_0x4b263d[_0xe7fb('0x1f')]&&_0x4b263d['body']['interaction']&&_0x4b263d['user']&&_0x4b263d['user']['name']){for(var _0x900d67 in _0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')]){if(_0x4b263d['body'][_0xe7fb('0x2d')]['hasOwnProperty'](_0x900d67)){db[_0xe7fb('0x2e')][_0xe7fb('0x2f')]({'where':{'channel':_0x900d67,'membername':_0x4b263d['user'][_0xe7fb('0x11')],'type':_0xe7fb('0x30'),'exitAt':null,'uniqueid':_0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')][_0x900d67]&&_0x4b263d['body'][_0xe7fb('0x2d')][_0x900d67][_0xe7fb('0x31')]?{'$notIn':_0x4b263d[_0xe7fb('0x1f')]['interaction'][_0x900d67]}:{'$ne':null}}})[_0xe7fb('0x1a')](function(_0x6eb1ab){var _0x13b17f=moment()[_0xe7fb('0x32')](_0xe7fb('0x33'));for(var _0x5a1ce1=0x0,_0x2eb999=_0x6eb1ab['length'];_0x5a1ce1<_0x2eb999;_0x5a1ce1+=0x1){_0x6eb1ab[_0x5a1ce1][_0xe7fb('0x34')]({'exitAt':_0x13b17f});}});for(var _0x468c62=0x0;_0x468c62<_0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')][_0x900d67][_0xe7fb('0x31')];_0x468c62+=0x1){db['MemberReport'][_0xe7fb('0x35')]({'where':{'channel':_0x900d67,'membername':_0x4b263d['user']['name'],'type':_0xe7fb('0x30'),'uniqueid':_0x4b263d[_0xe7fb('0x1f')][_0xe7fb('0x2d')][_0x900d67][_0x468c62],'exitAt':null},'defaults':{'channel':_0x900d67,'membername':_0x4b263d['user'][_0xe7fb('0x11')],'interface':_[_0xe7fb('0x13')](_0x4b263d['user']['interface'])?util[_0xe7fb('0x32')](_0xe7fb('0x36'),_0x4b263d[_0xe7fb('0x37')][_0xe7fb('0x11')]):_0x4b263d[_0xe7fb('0x37')][_0xe7fb('0x38')],'type':_0xe7fb('0x30'),'enterAt':moment()[_0xe7fb('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xe7fb('0x39'),'internal':_0x4b263d['user'][_0xe7fb('0x3a')],'uniqueid':_0x4b263d[_0xe7fb('0x1f')]['interaction'][_0x900d67][_0x468c62]}});}}}}return respondWithRpcPromise(_0xe7fb('0x3b'),{'id':_0x4b263d['params']['id'],'capacity':_0x4b263d[_0xe7fb('0x1f')]['capacity']},routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x36a341,null))['catch'](handleError(_0x36a341,null));};exports[_0xe7fb('0x3c')]=function(_0x59158c,_0x1fff6c){return respondWithRpcPromise(_0xe7fb('0x3d'),_0x59158c[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x1fff6c,null))[_0xe7fb('0xd')](handleError(_0x1fff6c,null));};exports[_0xe7fb('0x3e')]=function(_0x2f4760,_0x582a4a){return respondWithRpcPromise('Trunks',_0x2f4760[_0xe7fb('0x16')])['then'](respondWithResult(_0x582a4a,null))['catch'](handleError(_0x582a4a,null));};exports['campaigns']=function(_0x50b8df,_0x539252){return respondWithRpcPromise(_0xe7fb('0x3f'),_0x50b8df[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0x539252,null))[_0xe7fb('0xd')](handleError(_0x539252,null));};exports['chatQueues']=function(_0x37af37,_0x236b35){return respondWithRpcPromise(_0xe7fb('0x40'),_0x37af37['query'],routingClient)['then'](respondWithResult(_0x236b35,null))[_0xe7fb('0xd')](handleError(_0x236b35,null));};exports[_0xe7fb('0x41')]=function(_0x300b8e,_0x4f4ba3){return respondWithRpcPromise(_0xe7fb('0x40'),_0x300b8e[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x300b8e[_0xe7fb('0x19')]['id']))['then'](respondWithResult(_0x4f4ba3,null))['catch'](handleError(_0x4f4ba3,null));};exports[_0xe7fb('0x42')]=function(_0x3104c2,_0x1f16b2){return respondWithRpcPromise(_0xe7fb('0x43'),_0x3104c2[_0xe7fb('0x16')],routingClient)['then'](respondWithResult(_0x1f16b2,null))[_0xe7fb('0xd')](handleError(_0x1f16b2,null));};exports[_0xe7fb('0x44')]=function(_0x23755b,_0x590d7a){return respondWithRpcPromise('MailQueues',_0x23755b[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x23755b[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x590d7a,null))[_0xe7fb('0xd')](handleError(_0x590d7a,null));};exports[_0xe7fb('0x45')]=function(_0x585b7c,_0x1e21e4){return respondWithRpcPromise(_0xe7fb('0x46'),_0x585b7c[_0xe7fb('0x16')],mailClient)[_0xe7fb('0x1a')](respondWithResult(_0x1e21e4,null))[_0xe7fb('0xd')](handleError(_0x1e21e4,null));};exports[_0xe7fb('0x47')]=function(_0x554092,_0x2e457c){return respondWithRpcPromise('OpenchannelQueues',_0x554092[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x2e457c,null))[_0xe7fb('0xd')](handleError(_0x2e457c,null));};exports[_0xe7fb('0x48')]=function(_0x5925e6,_0x47ac92){return respondWithRpcPromise(_0xe7fb('0x49'),_0x5925e6[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x5925e6[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x47ac92,null))['catch'](handleError(_0x47ac92,null));};exports[_0xe7fb('0x4a')]=function(_0x58d4ec,_0x127b0e){return respondWithRpcPromise('SmsQueues',_0x58d4ec['query'],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x127b0e,null))[_0xe7fb('0xd')](handleError(_0x127b0e,null));};exports[_0xe7fb('0x4b')]=function(_0x5da884,_0x475716){return respondWithRpcPromise(_0xe7fb('0x4c'),_0x5da884[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x5da884[_0xe7fb('0x19')]['id']))['then'](respondWithResult(_0x475716,null))[_0xe7fb('0xd')](handleError(_0x475716,null));};exports[_0xe7fb('0x4d')]=function(_0x5151ec,_0x4136ae){return respondWithRpcPromise(_0xe7fb('0x4e'),_0x5151ec['query'],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x4136ae,null))['catch'](handleError(_0x4136ae,null));};exports[_0xe7fb('0x4f')]=function(_0x1dc9c1,_0xa93f35){return respondWithRpcPromise('WhatsappQueues',_0x1dc9c1[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x1dc9c1[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0xa93f35,null))[_0xe7fb('0xd')](handleError(_0xa93f35,null));};exports[_0xe7fb('0x50')]=function(_0xcdc72e,_0x187040){return respondWithRpcPromise('FaxQueues',_0xcdc72e['query'],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x187040,null))[_0xe7fb('0xd')](handleError(_0x187040,null));};exports[_0xe7fb('0x51')]=function(_0x50c705,_0x519c5f){return respondWithRpcPromise(_0xe7fb('0x52'),_0x50c705[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](findById(_0x50c705[_0xe7fb('0x19')]['id']))[_0xe7fb('0x1a')](respondWithResult(_0x519c5f,null))[_0xe7fb('0xd')](handleError(_0x519c5f,null));};exports[_0xe7fb('0x53')]=function(_0x3f11f1,_0xb06693){return respondWithRpcPromise(_0xe7fb('0x54'),_0x3f11f1[_0xe7fb('0x16')])[_0xe7fb('0x1a')](respondWithResult(_0xb06693,null))[_0xe7fb('0xd')](handleError(_0xb06693,null));};exports['chatQueuesWaitingInteractions']=function(_0x4fa142,_0x125427){return respondWithRpcPromise(_0xe7fb('0x55'),_0x4fa142[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x125427,null))[_0xe7fb('0xd')](handleError(_0x125427,null));};exports['mailQueuesWaitingInteractions']=function(_0x43f14b,_0x1beb13){return respondWithRpcPromise(_0xe7fb('0x56'),_0x43f14b[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x1beb13,null))[_0xe7fb('0xd')](handleError(_0x1beb13,null));};exports[_0xe7fb('0x57')]=function(_0x1e6256,_0xa7fa61){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1e6256[_0xe7fb('0x16')],routingClient)['then'](respondWithResult(_0xa7fa61,null))[_0xe7fb('0xd')](handleError(_0xa7fa61,null));};exports[_0xe7fb('0x58')]=function(_0x2a2079,_0x31c159){return respondWithRpcPromise(_0xe7fb('0x59'),_0x2a2079['query'],routingClient)[_0xe7fb('0x1a')](function(_0x38e66a){if(_0x2a2079[_0xe7fb('0x16')][_0xe7fb('0x5a')]!==undefined){var _0x15d881=_(_0x38e66a[_0xe7fb('0x5b')])[_0xe7fb('0x5c')]([_0x2a2079[_0xe7fb('0x16')][_0xe7fb('0x5a')],_0x2a2079[_0xe7fb('0x19')]['id']])[_0xe7fb('0x5d')](_0xe7fb('0x5e'))[_0xe7fb('0x5f')]()[_0xe7fb('0x60')]();return _0x38e66a['rows']['filter'](function(_0x48a015){return _0x15d881[_0xe7fb('0x61')](_0x48a015[_0xe7fb('0x5e')])>-0x1;});}else{return _0x38e66a[_0xe7fb('0x5b')][_0xe7fb('0x5c')](function(_0x535e8b){return _0x535e8b[_0xe7fb('0x5e')]===parseInt(_0x2a2079[_0xe7fb('0x19')]['id']);});}})[_0xe7fb('0x1a')](respondWithResult(_0x31c159,null))[_0xe7fb('0xd')](handleError(_0x31c159,null));};exports['smsQueuesWaitingInteractions']=function(_0x2f7fa6,_0x5650c6){return respondWithRpcPromise(_0xe7fb('0x62'),_0x2f7fa6[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x5650c6,null))[_0xe7fb('0xd')](handleError(_0x5650c6,null));};exports[_0xe7fb('0x63')]=function(_0x4ab541,_0x3ffd6c){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x4ab541[_0xe7fb('0x16')],routingClient)['then'](respondWithResult(_0x3ffd6c,null))[_0xe7fb('0xd')](handleError(_0x3ffd6c,null));};exports[_0xe7fb('0x64')]=function(_0x4c37cd,_0x2b6d69){return respondWithRpcPromise(_0xe7fb('0x65'),_0x4c37cd[_0xe7fb('0x16')],routingClient)[_0xe7fb('0x1a')](respondWithResult(_0x2b6d69,null))['catch'](handleError(_0x2b6d69,null));};exports[_0xe7fb('0x66')]=function(_0x277335){return function(_0x1412e2,_0x4d0eed){var _0x11d5b6,_0x4b2cc4;var _0x5b1e28=_['capitalize'](_0x277335);var _0x3c99e7=_0x277335===_0xe7fb('0x67')?'Website':_0xe7fb('0x68');return db[_0x5b1e28+_0xe7fb('0x69')][_0xe7fb('0x6a')]({'raw':!![],'where':{'id':_0x1412e2[_0xe7fb('0x19')]['id']}})[_0xe7fb('0x1a')](function(_0x1cc21d){if(_[_0xe7fb('0x13')](_0x1cc21d)){throw new Error(_0x5b1e28+_0xe7fb('0x6b'));}_0x11d5b6=_0x1cc21d;return db[_0x5b1e28+_0xe7fb('0x6c')][_0xe7fb('0x6a')]({'where':{'id':_0x1412e2[_0xe7fb('0x1f')][_0xe7fb('0x6d')]},'include':[{'model':db[_0x5b1e28+_0xe7fb('0x6e')],'as':_0xe7fb('0x6e')},{'model':db[_0x5b1e28+_0x3c99e7],'as':_0xe7fb('0x68')}]});})[_0xe7fb('0x1a')](function(_0x3c5bd9){if(_[_0xe7fb('0x13')](_0x3c5bd9)){throw new Error(_0x5b1e28+_0xe7fb('0x6f'));}_0x4b2cc4=_0x3c5bd9;return _0x3c5bd9[_0xe7fb('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x47568c={'uniqueid':_0x277335+'.'+_0x4b2cc4['id']+'.'+_0x4b2cc4[_0xe7fb('0x6e')]['id'],'FromUserId':_0x1412e2[_0xe7fb('0x37')]['id'],'type':_0xe7fb('0x71')};_0x47568c[_0x5b1e28+_0xe7fb('0x72')]=_0x4b2cc4['id'];_0x47568c[_0x5b1e28+_0xe7fb('0x73')]=_0x4b2cc4[_0xe7fb('0x6e')]['id'];_0x47568c['From'+_0x5b1e28+_0x3c99e7+'Id']=_0x4b2cc4['Account']['id'];_0x47568c['To'+_0x5b1e28+_0xe7fb('0x74')]=_0x11d5b6['id'];return db[_0x5b1e28+'TransferReport'][_0xe7fb('0x75')](_0x47568c);})[_0xe7fb('0x1a')](function(){return respondWithRpcPromise('Start',{'channel':_0x277335,'interaction':_0x4b2cc4[_0xe7fb('0x6e')],'message':_0x4b2cc4,'account':_0x4b2cc4[_0xe7fb('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7fb('0x71'),'appdata':_0x11d5b6[_0xe7fb('0x11')]+','+(_0x4b2cc4[_0xe7fb('0x68')][_0xe7fb('0x76')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe7fb('0x1a')](respondWithResult(_0x4d0eed,null))[_0xe7fb('0xd')](handleError(_0x4d0eed,null));};};exports[_0xe7fb('0x77')]=function(_0xae9441,_0x276c28){var _0xd5a417,_0x48de0c;if(_['isNil'](_0xae9441['body'][_0xe7fb('0x78')])){throw new Error(_0xe7fb('0x79'));}var _0x2b0600=_0xae9441['body'][_0xe7fb('0x78')];var _0x57ee3b=_[_0xe7fb('0x7a')](_0x2b0600);var _0x278a6c=_0x2b0600===_0xe7fb('0x67')?_0xe7fb('0x7b'):'Account';return db[_0xe7fb('0x7c')][_0xe7fb('0x6a')]({'raw':!![],'where':{'id':_0xae9441[_0xe7fb('0x19')]['id'],'role':_0xe7fb('0x39')}})[_0xe7fb('0x1a')](function(_0x33262f){if(_[_0xe7fb('0x13')](_0x33262f)){throw new Error(_0xe7fb('0x7d'));}_0xd5a417=_0x33262f;return db[_0x57ee3b+'Message']['findOne']({'where':{'id':_0xae9441[_0xe7fb('0x1f')]['messageId']},'include':[{'model':db[_0x57ee3b+_0xe7fb('0x6e')],'as':_0xe7fb('0x6e')},{'model':db[_0x57ee3b+_0x278a6c],'as':_0xe7fb('0x68')}]});})[_0xe7fb('0x1a')](function(_0x58352d){if(_['isNil'](_0x58352d)){throw new Error(_0x57ee3b+_0xe7fb('0x6f'));}_0x48de0c=_0x58352d;return _0x58352d[_0xe7fb('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x21cb12={'uniqueid':_0x2b0600+'.'+_0x48de0c['id']+'.'+_0x48de0c[_0xe7fb('0x6e')]['id'],'FromUserId':_0xae9441[_0xe7fb('0x37')]['id'],'type':_0xe7fb('0x71'),'ToUserId':_0xd5a417['id']};_0x21cb12[_0x57ee3b+_0xe7fb('0x72')]=_0x48de0c['id'];_0x21cb12[_0x57ee3b+_0xe7fb('0x73')]=_0x48de0c['Interaction']['id'];_0x21cb12[_0xe7fb('0x7e')+_0x57ee3b+_0x278a6c+'Id']=_0x48de0c[_0xe7fb('0x68')]['id'];return db[_0x57ee3b+_0xe7fb('0x7f')][_0xe7fb('0x75')](_0x21cb12);})[_0xe7fb('0x1a')](function(){return respondWithRpcPromise(_0xe7fb('0x80'),{'channel':_0x2b0600,'interaction':_0x48de0c[_0xe7fb('0x6e')],'message':_0x48de0c,'account':_0x48de0c[_0xe7fb('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7fb('0x39'),'appdata':_0xd5a417[_0xe7fb('0x11')]+','+(_0x48de0c[_0xe7fb('0x68')][_0xe7fb('0x81')]||0x12c),'interval':_0xe7fb('0x82')}]},routingClient);})[_0xe7fb('0x1a')](respondWithResult(_0x276c28,null))[_0xe7fb('0xd')](handleError(_0x276c28,null));}; \ No newline at end of file +var _0xbd51=['chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','value','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','create','Start','queue','*,*,*,*','Channel\x20field\x20is\x20mandatory','channel','capitalize','Agent\x20not\x20found','TransferReport','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','client','http','request','error','code','message','catch','status','json','stack','send','isNil','rows','find','voiceChannels','VoiceChannels','query','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','interaction','user','name','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','interface','SIP/%s','agent','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts'];(function(_0x28094e,_0x177dea){var _0x391994=function(_0x5a9b1a){while(--_0x5a9b1a){_0x28094e['push'](_0x28094e['shift']());}};_0x391994(++_0x177dea);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3798fd,_0x5de55b){_0x3798fd=_0x3798fd-0x0;var _0x436e24=_0xbd51[_0x3798fd];return _0x436e24;};'use strict';var BPromise=require(_0x1bd5('0x0'));var moment=require('moment');var _=require(_0x1bd5('0x1'));var util=require(_0x1bd5('0x2'));var db=require(_0x1bd5('0x3'))['db'];var logger=require(_0x1bd5('0x4'))('api');var jayson=require('jayson/promise');var amiClient=jayson['client']['http']({'port':0x232a});var mailClient=jayson[_0x1bd5('0x5')][_0x1bd5('0x6')]({'port':0x232b});var routingClient=jayson[_0x1bd5('0x5')]['http']({'port':0x232c});function respondWithRpcPromise(_0x29abea,_0x30a385,_0x19077c){return new BPromise(function(_0x27d58f,_0xd8418f){var _0x4a7f90=_0x19077c?_0x19077c:amiClient;return _0x4a7f90[_0x1bd5('0x7')](_0x29abea,_0x30a385)['then'](function(_0x2bd975){if(_0x2bd975[_0x1bd5('0x8')]){if(_0x2bd975[_0x1bd5('0x8')][_0x1bd5('0x9')]===0x1f4){return _0xd8418f(_0x2bd975[_0x1bd5('0x8')][_0x1bd5('0xa')]);}return _0x27d58f(_0x2bd975['error'][_0x1bd5('0xa')]);}else{_0x27d58f(_0x2bd975['result']);}})[_0x1bd5('0xb')](function(_0x24e38c){_0xd8418f(_0x24e38c);});});}function respondWithResult(_0x37e8e1,_0x14606b){_0x14606b=_0x14606b||0xc8;return function(_0x177be0){if(_0x177be0){return _0x37e8e1[_0x1bd5('0xc')](_0x14606b)[_0x1bd5('0xd')](_0x177be0);}return _0x37e8e1['sendStatus'](0x194);};}function handleError(_0x5650b5,_0x8b2390){_0x8b2390=_0x8b2390||0x1f4;return function(_0x6d2c40){logger[_0x1bd5('0x8')](_0x6d2c40[_0x1bd5('0xe')]);if(_0x6d2c40['name']){delete _0x6d2c40['name'];}_0x5650b5[_0x1bd5('0xc')](_0x8b2390)[_0x1bd5('0xf')](_0x6d2c40);};}function findById(_0x2b2c57){return function(_0x4793dd){if(!_[_0x1bd5('0x10')](_0x2b2c57)&&!_[_0x1bd5('0x10')](_0x4793dd)&&!_[_0x1bd5('0x10')](_0x4793dd[_0x1bd5('0x11')])){return _[_0x1bd5('0x12')](_0x4793dd['rows'],function(_0x53ad5e){return _0x53ad5e['id']==_0x2b2c57;});}return null;};}exports[_0x1bd5('0x13')]=function(_0x260827,_0x476bd1){return respondWithRpcPromise(_0x1bd5('0x14'),_0x260827[_0x1bd5('0x15')])[_0x1bd5('0x16')](respondWithResult(_0x476bd1,null))[_0x1bd5('0xb')](handleError(_0x476bd1,null));};exports[_0x1bd5('0x17')]=function(_0x456051,_0xb1ac1e){return respondWithRpcPromise(_0x1bd5('0x18'),_[_0x1bd5('0x19')](_0x456051[_0x1bd5('0x15')],_0x456051[_0x1bd5('0x1a')]))[_0x1bd5('0x16')](respondWithResult(_0xb1ac1e,null))[_0x1bd5('0xb')](handleError(_0xb1ac1e,null));};exports[_0x1bd5('0x1b')]=function(_0x29c340,_0x5567c9){return respondWithRpcPromise(_0x1bd5('0x1c'),_['merge'](_0x29c340[_0x1bd5('0x15')],_0x29c340[_0x1bd5('0x1a')]))[_0x1bd5('0x16')](respondWithResult(_0x5567c9,null))['catch'](handleError(_0x5567c9,null));};exports[_0x1bd5('0x1d')]=function(_0x4fa37c,_0x2ed551){return respondWithRpcPromise(_0x1bd5('0x1e'),_0x4fa37c[_0x1bd5('0x15')])[_0x1bd5('0x16')](respondWithResult(_0x2ed551,null))['catch'](handleError(_0x2ed551,null));};exports[_0x1bd5('0x1f')]=function(_0x69bb17,_0x20245c){return respondWithRpcPromise(_0x1bd5('0x1e'),_0x69bb17['query'])[_0x1bd5('0x16')](findById(_0x69bb17[_0x1bd5('0x1a')]['id']))[_0x1bd5('0x16')](respondWithResult(_0x20245c,null))[_0x1bd5('0xb')](handleError(_0x20245c,null));};exports[_0x1bd5('0x20')]=function(_0xc73670,_0x4e72b2){return respondWithRpcPromise(_0x1bd5('0x21'),_[_0x1bd5('0x19')](_0xc73670[_0x1bd5('0x22')],_0xc73670['params']))[_0x1bd5('0x16')](respondWithResult(_0x4e72b2,null))[_0x1bd5('0xb')](handleError(_0x4e72b2,null));};exports[_0x1bd5('0x23')]=function(_0x3430bf,_0x1f4456){return respondWithRpcPromise(_0x1bd5('0x24'),_['merge'](_0x3430bf['query'],_0x3430bf[_0x1bd5('0x1a')]))[_0x1bd5('0x16')](respondWithResult(_0x1f4456,null))['catch'](handleError(_0x1f4456,null));};exports[_0x1bd5('0x25')]=function(_0x198b88,_0x1efa8c){return respondWithRpcPromise(_0x1bd5('0x26'),_0x198b88['query'])[_0x1bd5('0x16')](respondWithResult(_0x1efa8c,null))[_0x1bd5('0xb')](handleError(_0x1efa8c,null));};exports[_0x1bd5('0x27')]=function(_0x233743,_0x209ce1){return respondWithRpcPromise(_0x1bd5('0x28'),_[_0x1bd5('0x19')](_0x233743[_0x1bd5('0x15')],_0x233743['params']))[_0x1bd5('0x16')](respondWithResult(_0x209ce1,null))[_0x1bd5('0xb')](handleError(_0x209ce1,null));};exports[_0x1bd5('0x29')]=function(_0x24c92e,_0x11a6d2){return respondWithRpcPromise(_0x1bd5('0x2a'),_[_0x1bd5('0x19')](_0x24c92e['query'],_0x24c92e[_0x1bd5('0x1a')]))[_0x1bd5('0x16')](respondWithResult(_0x11a6d2,null))[_0x1bd5('0xb')](handleError(_0x11a6d2,null));};exports[_0x1bd5('0x2b')]=function(_0x3cf898,_0x192ca7){return respondWithRpcPromise(_0x1bd5('0x2c'),_['merge'](_0x3cf898['query'],_0x3cf898[_0x1bd5('0x1a')]))[_0x1bd5('0x16')](respondWithResult(_0x192ca7,null))[_0x1bd5('0xb')](handleError(_0x192ca7,null));};exports['outbound']=function(_0x4595a0,_0x5af974){return respondWithRpcPromise(_0x1bd5('0x2d'),_0x4595a0[_0x1bd5('0x15')])[_0x1bd5('0x16')](respondWithResult(_0x5af974,null))[_0x1bd5('0xb')](handleError(_0x5af974,null));};exports[_0x1bd5('0x2e')]=function(_0x2470ec,_0x41096d){return respondWithRpcPromise(_0x1bd5('0x2f'),_0x2470ec['query'])[_0x1bd5('0x16')](respondWithResult(_0x41096d,null))[_0x1bd5('0xb')](handleError(_0x41096d,null));};exports['agents']=function(_0x3b5a0d,_0x77ebcf){var _0x20b25c;return respondWithRpcPromise('Agents',_0x3b5a0d[_0x1bd5('0x15')])[_0x1bd5('0x16')](function(_0x2997a2){_0x20b25c=_0x2997a2;return respondWithRpcPromise(_0x1bd5('0x30'),_0x3b5a0d['query'],routingClient);})[_0x1bd5('0x16')](function(_0x22f437){return _[_0x1bd5('0x19')]({},_0x22f437,_0x20b25c);})[_0x1bd5('0x16')](respondWithResult(_0x77ebcf,null))['catch'](handleError(_0x77ebcf,null));};exports['agentCapacity']=function(_0x40eeff,_0x35afc7){if(_0x40eeff[_0x1bd5('0x22')]&&_0x40eeff['body'][_0x1bd5('0x31')]&&_0x40eeff[_0x1bd5('0x32')]&&_0x40eeff['user'][_0x1bd5('0x33')]){for(var _0x5761b8 in _0x40eeff[_0x1bd5('0x22')][_0x1bd5('0x31')]){if(_0x40eeff['body'][_0x1bd5('0x31')][_0x1bd5('0x34')](_0x5761b8)){db[_0x1bd5('0x35')][_0x1bd5('0x36')]({'where':{'channel':_0x5761b8,'membername':_0x40eeff[_0x1bd5('0x32')][_0x1bd5('0x33')],'type':_0x1bd5('0x37'),'exitAt':null,'uniqueid':_0x40eeff[_0x1bd5('0x22')][_0x1bd5('0x31')][_0x5761b8]&&_0x40eeff[_0x1bd5('0x22')][_0x1bd5('0x31')][_0x5761b8][_0x1bd5('0x38')]?{'$notIn':_0x40eeff['body'][_0x1bd5('0x31')][_0x5761b8]}:{'$ne':null}}})[_0x1bd5('0x16')](function(_0x335125){var _0x52ade4=moment()[_0x1bd5('0x39')](_0x1bd5('0x3a'));for(var _0x5bb8a6=0x0,_0x1dbde9=_0x335125['length'];_0x5bb8a6<_0x1dbde9;_0x5bb8a6+=0x1){_0x335125[_0x5bb8a6][_0x1bd5('0x3b')]({'exitAt':_0x52ade4});}});for(var _0x558fec=0x0;_0x558fec<_0x40eeff[_0x1bd5('0x22')][_0x1bd5('0x31')][_0x5761b8]['length'];_0x558fec+=0x1){db[_0x1bd5('0x35')]['findOrCreate']({'where':{'channel':_0x5761b8,'membername':_0x40eeff[_0x1bd5('0x32')][_0x1bd5('0x33')],'type':_0x1bd5('0x37'),'uniqueid':_0x40eeff[_0x1bd5('0x22')][_0x1bd5('0x31')][_0x5761b8][_0x558fec],'exitAt':null},'defaults':{'channel':_0x5761b8,'membername':_0x40eeff[_0x1bd5('0x32')][_0x1bd5('0x33')],'interface':_[_0x1bd5('0x10')](_0x40eeff['user'][_0x1bd5('0x3c')])?util[_0x1bd5('0x39')](_0x1bd5('0x3d'),_0x40eeff[_0x1bd5('0x32')][_0x1bd5('0x33')]):_0x40eeff[_0x1bd5('0x32')]['interface'],'type':_0x1bd5('0x37'),'enterAt':moment()[_0x1bd5('0x39')](_0x1bd5('0x3a')),'role':_0x1bd5('0x3e'),'internal':_0x40eeff[_0x1bd5('0x32')][_0x1bd5('0x3f')],'uniqueid':_0x40eeff[_0x1bd5('0x22')]['interaction'][_0x5761b8][_0x558fec]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x40eeff[_0x1bd5('0x1a')]['id'],'capacity':_0x40eeff[_0x1bd5('0x22')][_0x1bd5('0x40')]},routingClient)['then'](respondWithResult(_0x35afc7,null))[_0x1bd5('0xb')](handleError(_0x35afc7,null));};exports[_0x1bd5('0x41')]=function(_0x1ad2ff,_0x1f2d7e){return respondWithRpcPromise(_0x1bd5('0x42'),_0x1ad2ff[_0x1bd5('0x15')])[_0x1bd5('0x16')](respondWithResult(_0x1f2d7e,null))['catch'](handleError(_0x1f2d7e,null));};exports[_0x1bd5('0x43')]=function(_0x2bcd23,_0x4f2d91){return respondWithRpcPromise(_0x1bd5('0x44'),_0x2bcd23['query'])[_0x1bd5('0x16')](respondWithResult(_0x4f2d91,null))['catch'](handleError(_0x4f2d91,null));};exports[_0x1bd5('0x45')]=function(_0x555ba1,_0x5a011e){return respondWithRpcPromise(_0x1bd5('0x46'),_0x555ba1[_0x1bd5('0x15')])[_0x1bd5('0x16')](respondWithResult(_0x5a011e,null))[_0x1bd5('0xb')](handleError(_0x5a011e,null));};exports[_0x1bd5('0x47')]=function(_0x33f011,_0x35c478){return respondWithRpcPromise('ChatQueues',_0x33f011[_0x1bd5('0x15')],routingClient)['then'](respondWithResult(_0x35c478,null))[_0x1bd5('0xb')](handleError(_0x35c478,null));};exports[_0x1bd5('0x48')]=function(_0x2cc5ba,_0x5a8132){return respondWithRpcPromise('ChatQueues',_0x2cc5ba[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](findById(_0x2cc5ba[_0x1bd5('0x1a')]['id']))[_0x1bd5('0x16')](respondWithResult(_0x5a8132,null))[_0x1bd5('0xb')](handleError(_0x5a8132,null));};exports[_0x1bd5('0x49')]=function(_0x46e36c,_0x383a68){return respondWithRpcPromise(_0x1bd5('0x4a'),_0x46e36c[_0x1bd5('0x15')],routingClient)['then'](respondWithResult(_0x383a68,null))[_0x1bd5('0xb')](handleError(_0x383a68,null));};exports['showMailQueues']=function(_0x2fe8f4,_0x34d93b){return respondWithRpcPromise(_0x1bd5('0x4a'),_0x2fe8f4['query'],routingClient)[_0x1bd5('0x16')](findById(_0x2fe8f4[_0x1bd5('0x1a')]['id']))[_0x1bd5('0x16')](respondWithResult(_0x34d93b,null))['catch'](handleError(_0x34d93b,null));};exports[_0x1bd5('0x4b')]=function(_0x10103a,_0x39f973){return respondWithRpcPromise(_0x1bd5('0x4c'),_0x10103a['query'],mailClient)['then'](respondWithResult(_0x39f973,null))[_0x1bd5('0xb')](handleError(_0x39f973,null));};exports[_0x1bd5('0x4d')]=function(_0x1790af,_0x54a8c4){return respondWithRpcPromise('OpenchannelQueues',_0x1790af[_0x1bd5('0x15')],routingClient)['then'](respondWithResult(_0x54a8c4,null))[_0x1bd5('0xb')](handleError(_0x54a8c4,null));};exports[_0x1bd5('0x4e')]=function(_0x5068ae,_0x32f646){return respondWithRpcPromise('OpenchannelQueues',_0x5068ae[_0x1bd5('0x15')],routingClient)['then'](findById(_0x5068ae[_0x1bd5('0x1a')]['id']))[_0x1bd5('0x16')](respondWithResult(_0x32f646,null))['catch'](handleError(_0x32f646,null));};exports[_0x1bd5('0x4f')]=function(_0x19f765,_0x47ca3f){return respondWithRpcPromise('SmsQueues',_0x19f765[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x47ca3f,null))['catch'](handleError(_0x47ca3f,null));};exports[_0x1bd5('0x50')]=function(_0x40b508,_0x5da595){return respondWithRpcPromise('SmsQueues',_0x40b508[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](findById(_0x40b508[_0x1bd5('0x1a')]['id']))['then'](respondWithResult(_0x5da595,null))[_0x1bd5('0xb')](handleError(_0x5da595,null));};exports[_0x1bd5('0x51')]=function(_0x5c1db7,_0x4b317d){return respondWithRpcPromise(_0x1bd5('0x52'),_0x5c1db7[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x4b317d,null))[_0x1bd5('0xb')](handleError(_0x4b317d,null));};exports[_0x1bd5('0x53')]=function(_0x53c6de,_0x3827d7){return respondWithRpcPromise('WhatsappQueues',_0x53c6de[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](findById(_0x53c6de[_0x1bd5('0x1a')]['id']))[_0x1bd5('0x16')](respondWithResult(_0x3827d7,null))['catch'](handleError(_0x3827d7,null));};exports['faxQueues']=function(_0x3a7dd6,_0x36d62e){return respondWithRpcPromise(_0x1bd5('0x54'),_0x3a7dd6[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x36d62e,null))[_0x1bd5('0xb')](handleError(_0x36d62e,null));};exports[_0x1bd5('0x55')]=function(_0xc080d5,_0x1a35cf){return respondWithRpcPromise(_0x1bd5('0x54'),_0xc080d5[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](findById(_0xc080d5[_0x1bd5('0x1a')]['id']))[_0x1bd5('0x16')](respondWithResult(_0x1a35cf,null))[_0x1bd5('0xb')](handleError(_0x1a35cf,null));};exports[_0x1bd5('0x56')]=function(_0x1b99ff,_0x195176){return respondWithRpcPromise(_0x1bd5('0x57'),_0x1b99ff[_0x1bd5('0x15')])[_0x1bd5('0x16')](respondWithResult(_0x195176,null))[_0x1bd5('0xb')](handleError(_0x195176,null));};exports[_0x1bd5('0x58')]=function(_0x3ddf27,_0x56e99c){return respondWithRpcPromise(_0x1bd5('0x59'),_0x3ddf27[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x56e99c,null))[_0x1bd5('0xb')](handleError(_0x56e99c,null));};exports[_0x1bd5('0x5a')]=function(_0x37a6f3,_0x1e282c){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x37a6f3[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x1e282c,null))[_0x1bd5('0xb')](handleError(_0x1e282c,null));};exports[_0x1bd5('0x5b')]=function(_0x590b3d,_0x2ed59d){return respondWithRpcPromise(_0x1bd5('0x5c'),_0x590b3d[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x2ed59d,null))[_0x1bd5('0xb')](handleError(_0x2ed59d,null));};exports[_0x1bd5('0x5d')]=function(_0x32a878,_0x4cc7a5){return respondWithRpcPromise(_0x1bd5('0x5c'),_0x32a878['query'],routingClient)['then'](function(_0x34f98c){if(_0x32a878['query'][_0x1bd5('0x5e')]!==undefined){var _0x1a4ee6=_(_0x34f98c['rows'])[_0x1bd5('0x5f')]([_0x32a878[_0x1bd5('0x15')][_0x1bd5('0x5e')],_0x32a878[_0x1bd5('0x1a')]['id']])[_0x1bd5('0x60')](_0x1bd5('0x61'))['uniq']()[_0x1bd5('0x62')]();return _0x34f98c[_0x1bd5('0x11')][_0x1bd5('0x5f')](function(_0x1c9cec){return _0x1a4ee6['indexOf'](_0x1c9cec['queue_id'])>-0x1;});}else{return _0x34f98c[_0x1bd5('0x11')][_0x1bd5('0x5f')](function(_0x2fe037){return _0x2fe037[_0x1bd5('0x61')]===parseInt(_0x32a878['params']['id']);});}})[_0x1bd5('0x16')](respondWithResult(_0x4cc7a5,null))['catch'](handleError(_0x4cc7a5,null));};exports['smsQueuesWaitingInteractions']=function(_0x3a203f,_0x5045f9){return respondWithRpcPromise(_0x1bd5('0x63'),_0x3a203f[_0x1bd5('0x15')],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x5045f9,null))[_0x1bd5('0xb')](handleError(_0x5045f9,null));};exports[_0x1bd5('0x64')]=function(_0xab4ed6,_0x232077){return respondWithRpcPromise(_0x1bd5('0x65'),_0xab4ed6[_0x1bd5('0x15')],routingClient)['then'](respondWithResult(_0x232077,null))[_0x1bd5('0xb')](handleError(_0x232077,null));};exports['faxQueuesWaitingInteractions']=function(_0x58c715,_0x59b491){return respondWithRpcPromise(_0x1bd5('0x66'),_0x58c715['query'],routingClient)[_0x1bd5('0x16')](respondWithResult(_0x59b491,null))[_0x1bd5('0xb')](handleError(_0x59b491,null));};exports[_0x1bd5('0x67')]=function(_0x4a3f74){return function(_0x201968,_0x91bcf8){var _0x3410f8,_0x52cd5f;var _0xfc9282=_['capitalize'](_0x4a3f74);var _0x327eb6=_0x4a3f74===_0x1bd5('0x68')?_0x1bd5('0x69'):'Account';return db[_0xfc9282+'Queue'][_0x1bd5('0x6a')]({'raw':!![],'where':{'id':_0x201968['params']['id']}})[_0x1bd5('0x16')](function(_0x53be05){if(_[_0x1bd5('0x10')](_0x53be05)){throw new Error(_0xfc9282+_0x1bd5('0x6b'));}_0x3410f8=_0x53be05;return db[_0xfc9282+_0x1bd5('0x6c')][_0x1bd5('0x6a')]({'where':{'id':_0x201968[_0x1bd5('0x22')][_0x1bd5('0x6d')]},'include':[{'model':db[_0xfc9282+_0x1bd5('0x6e')],'as':_0x1bd5('0x6e')},{'model':db[_0xfc9282+_0x327eb6],'as':_0x1bd5('0x6f')}]});})[_0x1bd5('0x16')](function(_0x3c90dc){if(_[_0x1bd5('0x10')](_0x3c90dc)){throw new Error(_0xfc9282+_0x1bd5('0x70'));}_0x52cd5f=_0x3c90dc;return _0x3c90dc[_0x1bd5('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2a1b4a={'uniqueid':_0x4a3f74+'.'+_0x52cd5f['id']+'.'+_0x52cd5f[_0x1bd5('0x6e')]['id'],'FromUserId':_0x201968[_0x1bd5('0x32')]['id'],'type':'queue'};_0x2a1b4a[_0xfc9282+_0x1bd5('0x72')]=_0x52cd5f['id'];_0x2a1b4a[_0xfc9282+_0x1bd5('0x73')]=_0x52cd5f['Interaction']['id'];_0x2a1b4a[_0x1bd5('0x74')+_0xfc9282+_0x327eb6+'Id']=_0x52cd5f[_0x1bd5('0x6f')]['id'];_0x2a1b4a['To'+_0xfc9282+_0x1bd5('0x75')]=_0x3410f8['id'];return db[_0xfc9282+'TransferReport'][_0x1bd5('0x76')](_0x2a1b4a);})[_0x1bd5('0x16')](function(){return respondWithRpcPromise(_0x1bd5('0x77'),{'channel':_0x4a3f74,'interaction':_0x52cd5f[_0x1bd5('0x6e')],'message':_0x52cd5f,'account':_0x52cd5f['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x1bd5('0x78'),'appdata':_0x3410f8[_0x1bd5('0x33')]+','+(_0x52cd5f[_0x1bd5('0x6f')]['queueTransferTimeout']||0x12c),'interval':_0x1bd5('0x79')}]},routingClient);})[_0x1bd5('0x16')](respondWithResult(_0x91bcf8,null))['catch'](handleError(_0x91bcf8,null));};};exports['agentNotify']=function(_0x4230e9,_0x182d75){var _0x5c9098,_0x5d6b17;if(_[_0x1bd5('0x10')](_0x4230e9['body']['channel'])){throw new Error(_0x1bd5('0x7a'));}var _0x5cb13d=_0x4230e9[_0x1bd5('0x22')][_0x1bd5('0x7b')];var _0x5df043=_[_0x1bd5('0x7c')](_0x5cb13d);var _0x254c8d=_0x5cb13d===_0x1bd5('0x68')?'Website':_0x1bd5('0x6f');return db['User'][_0x1bd5('0x6a')]({'raw':!![],'where':{'id':_0x4230e9[_0x1bd5('0x1a')]['id'],'role':_0x1bd5('0x3e')}})[_0x1bd5('0x16')](function(_0x2f9dff){if(_['isNil'](_0x2f9dff)){throw new Error(_0x1bd5('0x7d'));}_0x5c9098=_0x2f9dff;return db[_0x5df043+'Message'][_0x1bd5('0x6a')]({'where':{'id':_0x4230e9['body']['messageId']},'include':[{'model':db[_0x5df043+_0x1bd5('0x6e')],'as':_0x1bd5('0x6e')},{'model':db[_0x5df043+_0x254c8d],'as':_0x1bd5('0x6f')}]});})[_0x1bd5('0x16')](function(_0x4c9931){if(_[_0x1bd5('0x10')](_0x4c9931)){throw new Error(_0x5df043+_0x1bd5('0x70'));}_0x5d6b17=_0x4c9931;return _0x4c9931[_0x1bd5('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x1bd5('0x16')](function(){var _0x15e584={'uniqueid':_0x5cb13d+'.'+_0x5d6b17['id']+'.'+_0x5d6b17[_0x1bd5('0x6e')]['id'],'FromUserId':_0x4230e9[_0x1bd5('0x32')]['id'],'type':_0x1bd5('0x78'),'ToUserId':_0x5c9098['id']};_0x15e584[_0x5df043+_0x1bd5('0x72')]=_0x5d6b17['id'];_0x15e584[_0x5df043+_0x1bd5('0x73')]=_0x5d6b17[_0x1bd5('0x6e')]['id'];_0x15e584[_0x1bd5('0x74')+_0x5df043+_0x254c8d+'Id']=_0x5d6b17[_0x1bd5('0x6f')]['id'];return db[_0x5df043+_0x1bd5('0x7e')]['create'](_0x15e584);})[_0x1bd5('0x16')](function(){return respondWithRpcPromise(_0x1bd5('0x77'),{'channel':_0x5cb13d,'interaction':_0x5d6b17[_0x1bd5('0x6e')],'message':_0x5d6b17,'account':_0x5d6b17[_0x1bd5('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x1bd5('0x3e'),'appdata':_0x5c9098[_0x1bd5('0x33')]+','+(_0x5d6b17[_0x1bd5('0x6f')][_0x1bd5('0x7f')]||0x12c),'interval':_0x1bd5('0x79')}]},routingClient);})[_0x1bd5('0x16')](respondWithResult(_0x182d75,null))[_0x1bd5('0xb')](handleError(_0x182d75,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index a43b7b0..dcf489b 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 _0xdaac=['post','create','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run'];(function(_0x2fa695,_0x9c46d3){var _0x5e03a4=function(_0x8f2258){while(--_0x8f2258){_0x2fa695['push'](_0x2fa695['shift']());}};_0x5e03a4(++_0x9c46d3);}(_0xdaac,0xf5));var _0xcdaa=function(_0x37c086,_0x42a11c){_0x37c086=_0x37c086-0x0;var _0x3fd2a3=_0xdaac[_0x37c086];return _0x3fd2a3;};'use strict';var multer=require(_0xcdaa('0x0'));var util=require(_0xcdaa('0x1'));var path=require(_0xcdaa('0x2'));var timeout=require('connect-timeout');var express=require(_0xcdaa('0x3'));var router=express['Router']();var fs_extra=require(_0xcdaa('0x4'));var auth=require(_0xcdaa('0x5'));var interaction=require(_0xcdaa('0x6'));var config=require(_0xcdaa('0x7'));var controller=require(_0xcdaa('0x8'));router[_0xcdaa('0x9')]('/',auth[_0xcdaa('0xa')](),controller[_0xcdaa('0xb')]);router['get'](_0xcdaa('0xc'),auth['isAuthenticated'](),controller[_0xcdaa('0xd')]);router[_0xcdaa('0x9')](_0xcdaa('0xe'),auth[_0xcdaa('0xa')](),controller['run']);router[_0xcdaa('0xf')]('/',auth[_0xcdaa('0xa')](),controller[_0xcdaa('0x10')]);router['put'](_0xcdaa('0xc'),auth[_0xcdaa('0xa')](),controller['update']);router[_0xcdaa('0x11')](_0xcdaa('0xc'),auth[_0xcdaa('0xa')](),controller[_0xcdaa('0x12')]);module[_0xcdaa('0x13')]=router; \ No newline at end of file +var _0x24bd=['../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','/:id/run','create','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x25467b,_0x45c7c2){var _0x27310b=function(_0x245b88){while(--_0x245b88){_0x25467b['push'](_0x25467b['shift']());}};_0x27310b(++_0x45c7c2);}(_0x24bd,0x10a));var _0xd24b=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x24bd[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0xd24b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd24b('0x1'));var express=require(_0xd24b('0x2'));var router=express[_0xd24b('0x3')]();var fs_extra=require(_0xd24b('0x4'));var auth=require(_0xd24b('0x5'));var interaction=require(_0xd24b('0x6'));var config=require(_0xd24b('0x7'));var controller=require(_0xd24b('0x8'));router[_0xd24b('0x9')]('/',auth[_0xd24b('0xa')](),controller[_0xd24b('0xb')]);router['get'](_0xd24b('0xc'),auth[_0xd24b('0xa')](),controller['show']);router[_0xd24b('0x9')](_0xd24b('0xd'),auth[_0xd24b('0xa')](),controller['run']);router['post']('/',auth['isAuthenticated'](),controller[_0xd24b('0xe')]);router['put']('/:id',auth[_0xd24b('0xa')](),controller[_0xd24b('0xf')]);router['delete'](_0xd24b('0xc'),auth[_0xd24b('0xa')](),controller['destroy']);module[_0xd24b('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 127de7a..012e1fa 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 _0xf45b=['days','minutes','pdf','xlsx','csv','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','months','weeks'];(function(_0x3a3e9d,_0xb2e9d8){var _0xe2d9fb=function(_0x2e28e0){while(--_0x2e28e0){_0x3a3e9d['push'](_0x3a3e9d['shift']());}};_0xe2d9fb(++_0xb2e9d8);}(_0xf45b,0x98));var _0xbf45=function(_0x1b9629,_0x5554b4){_0x1b9629=_0x1b9629-0x0;var _0x4ade3a=_0xf45b[_0x1b9629];return _0x4ade3a;};'use strict';var Sequelize=require(_0xbf45('0x0'));module[_0xbf45('0x1')]={'name':{'type':Sequelize[_0xbf45('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbf45('0x2')]},'active':{'type':Sequelize[_0xbf45('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xbf45('0x2')],'allowNull':![],'defaultValue':_0xbf45('0x4')},'startAt':{'type':Sequelize[_0xbf45('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xbf45('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xbf45('0x7')]('years','quarters',_0xbf45('0x8'),_0xbf45('0x9'),_0xbf45('0xa'),'hours',_0xbf45('0xb')),'allowNull':![],'defaultValue':_0xbf45('0xa')},'output':{'type':Sequelize[_0xbf45('0x7')]('csv',_0xbf45('0xc'),_0xbf45('0xd')),'allowNull':![],'defaultValue':_0xbf45('0xe')},'type':{'type':Sequelize[_0xbf45('0x7')](_0xbf45('0xf'),_0xbf45('0x10')),'allowNull':![],'defaultValue':_0xbf45('0xf')},'sendMail':{'type':Sequelize[_0xbf45('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xbf45('0x2')]},'cc':{'type':Sequelize[_0xbf45('0x11')]},'bcc':{'type':Sequelize[_0xbf45('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xbf45('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x10e7=['STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','weeks','days','hours','minutes','pdf','csv','custom','default','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x10e7,0x88));var _0x710e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x10e7[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x710e('0x0')]},'active':{'type':Sequelize[_0x710e('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x710e('0x0')],'allowNull':![],'defaultValue':_0x710e('0x2')},'startAt':{'type':Sequelize[_0x710e('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x710e('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x710e('0x5')](_0x710e('0x6'),_0x710e('0x7'),'months',_0x710e('0x8'),_0x710e('0x9'),_0x710e('0xa'),_0x710e('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x710e('0x5')]('csv',_0x710e('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0x710e('0xd')},'type':{'type':Sequelize[_0x710e('0x5')](_0x710e('0xe'),_0x710e('0xf')),'allowNull':![],'defaultValue':_0x710e('0xe')},'sendMail':{'type':Sequelize[_0x710e('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x710e('0x0')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x710e('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x710e('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index aa2db86..e68edd5 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 _0xf1d8=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Scheduler','UserProfileResource','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','merge','create','body','get','role','user','UserProfileSection','find','autoAssociation','error','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment'];(function(_0x192d96,_0x312f2f){var _0x24b76b=function(_0x45d8b0){while(--_0x45d8b0){_0x192d96['push'](_0x192d96['shift']());}};_0x24b76b(++_0x312f2f);}(_0xf1d8,0x192));var _0x8f1d=function(_0x15797a,_0x16274f){_0x15797a=_0x15797a-0x0;var _0x3e2618=_0xf1d8[_0x15797a];return _0x3e2618;};'use strict';var emlformat=require(_0x8f1d('0x0'));var rimraf=require(_0x8f1d('0x1'));var zipdir=require(_0x8f1d('0x2'));var jsonpatch=require(_0x8f1d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8f1d('0x4'));var Mustache=require(_0x8f1d('0x5'));var util=require(_0x8f1d('0x6'));var path=require(_0x8f1d('0x7'));var sox=require('sox');var csv=require(_0x8f1d('0x8'));var ejs=require(_0x8f1d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f1d('0xa'));var squel=require(_0x8f1d('0xb'));var crypto=require(_0x8f1d('0xc'));var jsforce=require(_0x8f1d('0xd'));var deskjs=require(_0x8f1d('0xe'));var toCsv=require(_0x8f1d('0x8'));var querystring=require(_0x8f1d('0xf'));var Papa=require(_0x8f1d('0x10'));var Redis=require(_0x8f1d('0x11'));var authService=require(_0x8f1d('0x12'));var qs=require(_0x8f1d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f1d('0x14'))('api');var utils=require(_0x8f1d('0x15'));var config=require(_0x8f1d('0x16'));var licenseUtil=require(_0x8f1d('0x17'));var db=require(_0x8f1d('0x18'))['db'];function respondWithStatusCode(_0x104871,_0x178a7c){_0x178a7c=_0x178a7c||0xcc;return function(_0x15ad23){if(_0x15ad23){return _0x104871[_0x8f1d('0x19')](_0x178a7c);}return _0x104871[_0x8f1d('0x1a')](_0x178a7c)[_0x8f1d('0x1b')]();};}function respondWithResult(_0x3952a7,_0x9f1e92){_0x9f1e92=_0x9f1e92||0xc8;return function(_0x547a30){if(_0x547a30){return _0x3952a7[_0x8f1d('0x1a')](_0x9f1e92)[_0x8f1d('0x1c')](_0x547a30);}};}function respondWithFilteredResult(_0x4ddab6,_0x7747c){return function(_0xf452a8){if(_0xf452a8){var _0x44feb1=typeof _0x7747c['offset']===_0x8f1d('0x1d')&&typeof _0x7747c['limit']===_0x8f1d('0x1d');var _0x5c6a6a=_0xf452a8[_0x8f1d('0x1e')];var _0x1a5cd7=_0x44feb1?0x0:_0x7747c[_0x8f1d('0x1f')];var _0x47e22c=_0x44feb1?_0xf452a8[_0x8f1d('0x1e')]:_0x7747c['offset']+_0x7747c[_0x8f1d('0x20')];var _0x4af9ed;if(_0x47e22c>=_0x5c6a6a){_0x47e22c=_0x5c6a6a;_0x4af9ed=0xc8;}else{_0x4af9ed=0xce;}_0x4ddab6[_0x8f1d('0x1a')](_0x4af9ed);return _0x4ddab6[_0x8f1d('0x21')](_0x8f1d('0x22'),_0x1a5cd7+'-'+_0x47e22c+'/'+_0x5c6a6a)[_0x8f1d('0x1c')](_0xf452a8);}return null;};}function patchUpdates(_0x5a6a84){return function(_0x1f6f4c){try{jsonpatch[_0x8f1d('0x23')](_0x1f6f4c,_0x5a6a84,!![]);}catch(_0xd9bb05){return BPromise[_0x8f1d('0x24')](_0xd9bb05);}return _0x1f6f4c[_0x8f1d('0x25')]();};}function saveUpdates(_0x1ca623,_0x171632){return function(_0x25da30){if(_0x25da30){return _0x25da30[_0x8f1d('0x26')](_0x1ca623)[_0x8f1d('0x27')](function(_0x17b6f3){return _0x17b6f3;});}return null;};}function removeEntity(_0xc9f3da,_0x5455a2){return function(_0x4df270){if(_0x4df270){return _0x4df270[_0x8f1d('0x28')]()[_0x8f1d('0x27')](function(){var _0xda7ddb=_0x4df270['get']({'plain':!![]});var _0x2628d1=_0x8f1d('0x29');return db[_0x8f1d('0x2a')]['destroy']({'where':{'type':_0x2628d1,'resourceId':_0xda7ddb['id']}})[_0x8f1d('0x27')](function(){return _0x4df270;});})[_0x8f1d('0x27')](function(){_0xc9f3da[_0x8f1d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x303c5c,_0x1fe2c7){return function(_0x4c2452){if(!_0x4c2452){_0x303c5c[_0x8f1d('0x19')](0x194);}return _0x4c2452;};}function handleError(_0x26f8d7,_0x4647e7){_0x4647e7=_0x4647e7||0x1f4;return function(_0x3fec7a){logger['error'](_0x3fec7a[_0x8f1d('0x2b')]);if(_0x3fec7a[_0x8f1d('0x2c')]){delete _0x3fec7a[_0x8f1d('0x2c')];}_0x26f8d7[_0x8f1d('0x1a')](_0x4647e7)[_0x8f1d('0x2d')](_0x3fec7a);};}exports[_0x8f1d('0x2e')]=function(_0x3ad8fc,_0x5a7521){var _0x4bd8b9={},_0x27f8c1={},_0x5f0396={'count':0x0,'rows':[]};var _0x22eee0=_[_0x8f1d('0x2f')](db[_0x8f1d('0x30')][_0x8f1d('0x31')],function(_0x10ea24){return{'name':_0x10ea24[_0x8f1d('0x32')],'type':_0x10ea24[_0x8f1d('0x33')]['key']};});_0x27f8c1[_0x8f1d('0x34')]=_[_0x8f1d('0x2f')](_0x22eee0,_0x8f1d('0x2c'));_0x27f8c1[_0x8f1d('0x35')]=_[_0x8f1d('0x36')](_0x3ad8fc['query']);_0x27f8c1['filters']=_['intersection'](_0x27f8c1[_0x8f1d('0x34')],_0x27f8c1[_0x8f1d('0x35')]);_0x4bd8b9[_0x8f1d('0x37')]=_[_0x8f1d('0x38')](_0x27f8c1[_0x8f1d('0x34')],qs[_0x8f1d('0x39')](_0x3ad8fc[_0x8f1d('0x35')]['fields']));_0x4bd8b9[_0x8f1d('0x37')]=_0x4bd8b9[_0x8f1d('0x37')]['length']?_0x4bd8b9[_0x8f1d('0x37')]:_0x27f8c1['model'];if(!_0x3ad8fc['query'][_0x8f1d('0x3a')]('nolimit')){_0x4bd8b9['limit']=qs[_0x8f1d('0x20')](_0x3ad8fc[_0x8f1d('0x35')]['limit']);_0x4bd8b9[_0x8f1d('0x1f')]=qs['offset'](_0x3ad8fc[_0x8f1d('0x35')][_0x8f1d('0x1f')]);}_0x4bd8b9[_0x8f1d('0x3b')]=qs[_0x8f1d('0x3c')](_0x3ad8fc[_0x8f1d('0x35')]['sort']);_0x4bd8b9[_0x8f1d('0x3d')]=qs['filters'](_['pick'](_0x3ad8fc['query'],_0x27f8c1[_0x8f1d('0x3e')]),_0x22eee0);if(_0x3ad8fc[_0x8f1d('0x35')][_0x8f1d('0x3f')]){_0x4bd8b9[_0x8f1d('0x3d')]=_['merge'](_0x4bd8b9[_0x8f1d('0x3d')],{'$or':_[_0x8f1d('0x2f')](_0x22eee0,function(_0xc4c0b1){if(_0xc4c0b1[_0x8f1d('0x33')]!==_0x8f1d('0x40')){var _0x921272={};_0x921272[_0xc4c0b1[_0x8f1d('0x2c')]]={'$like':'%'+_0x3ad8fc[_0x8f1d('0x35')][_0x8f1d('0x3f')]+'%'};return _0x921272;}})});}_0x4bd8b9=_['merge']({},_0x4bd8b9,_0x3ad8fc[_0x8f1d('0x41')]);var _0x4f6306={'where':_0x4bd8b9[_0x8f1d('0x3d')]};return db[_0x8f1d('0x30')][_0x8f1d('0x1e')](_0x4f6306)[_0x8f1d('0x27')](function(_0x364d77){_0x5f0396[_0x8f1d('0x1e')]=_0x364d77;if(_0x3ad8fc[_0x8f1d('0x35')]['includeAll']){_0x4bd8b9[_0x8f1d('0x42')]=[{'all':!![]}];}return db[_0x8f1d('0x30')][_0x8f1d('0x43')](_0x4bd8b9);})[_0x8f1d('0x27')](function(_0x1c2956){_0x5f0396['rows']=_0x1c2956;return _0x5f0396;})[_0x8f1d('0x27')](respondWithFilteredResult(_0x5a7521,_0x4bd8b9))[_0x8f1d('0x44')](handleError(_0x5a7521,null));};exports[_0x8f1d('0x45')]=function(_0x1fa68a,_0x21e2dc){var _0x1b6af7={'raw':![],'where':{'id':_0x1fa68a[_0x8f1d('0x46')]['id']}},_0x4ea1b2={};_0x4ea1b2['model']=_[_0x8f1d('0x36')](db[_0x8f1d('0x30')][_0x8f1d('0x31')]);_0x4ea1b2[_0x8f1d('0x35')]=_['keys'](_0x1fa68a['query']);_0x4ea1b2['filters']=_['intersection'](_0x4ea1b2[_0x8f1d('0x34')],_0x4ea1b2['query']);_0x1b6af7[_0x8f1d('0x37')]=_[_0x8f1d('0x38')](_0x4ea1b2[_0x8f1d('0x34')],qs['fields'](_0x1fa68a['query'][_0x8f1d('0x39')]));_0x1b6af7[_0x8f1d('0x37')]=_0x1b6af7[_0x8f1d('0x37')][_0x8f1d('0x47')]?_0x1b6af7[_0x8f1d('0x37')]:_0x4ea1b2[_0x8f1d('0x34')];if(_0x1fa68a[_0x8f1d('0x35')][_0x8f1d('0x48')]){_0x1b6af7['include']=[{'all':!![]}];}_0x1b6af7=_[_0x8f1d('0x49')]({},_0x1b6af7,_0x1fa68a['options']);return db[_0x8f1d('0x30')]['find'](_0x1b6af7)['then'](handleEntityNotFound(_0x21e2dc,null))[_0x8f1d('0x27')](respondWithResult(_0x21e2dc,null))[_0x8f1d('0x44')](handleError(_0x21e2dc,null));};exports[_0x8f1d('0x4a')]=function(_0x3b08bf,_0x3082ef){return db['Schedule']['create'](_0x3b08bf[_0x8f1d('0x4b')],{})[_0x8f1d('0x27')](function(_0x335cea){var _0x3538e2=_0x3b08bf['user'][_0x8f1d('0x4c')]({'plain':!![]});if(!_0x3538e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3538e2[_0x8f1d('0x4d')]===_0x8f1d('0x4e')){var _0x2bcf38=_0x335cea[_0x8f1d('0x4c')]({'plain':!![]});var _0x36c9f4=_0x8f1d('0x29');return db[_0x8f1d('0x4f')][_0x8f1d('0x50')]({'where':{'name':_0x36c9f4,'userProfileId':_0x3538e2['userProfileId']},'raw':!![]})['then'](function(_0xc7d8d8){if(_0xc7d8d8&&_0xc7d8d8[_0x8f1d('0x51')]===0x0){return db[_0x8f1d('0x2a')][_0x8f1d('0x4a')]({'name':_0x2bcf38[_0x8f1d('0x2c')],'resourceId':_0x2bcf38['id'],'type':_0xc7d8d8['name'],'sectionId':_0xc7d8d8['id']},{})[_0x8f1d('0x27')](function(){return _0x335cea;});}else{return _0x335cea;}})['catch'](function(_0x21b550){logger[_0x8f1d('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21b550);throw _0x21b550;});}return _0x335cea;})[_0x8f1d('0x27')](respondWithResult(_0x3082ef,0xc9))[_0x8f1d('0x44')](handleError(_0x3082ef,null));};exports[_0x8f1d('0x26')]=function(_0x383e3f,_0x7dbca3){if(_0x383e3f[_0x8f1d('0x4b')]['id']){delete _0x383e3f[_0x8f1d('0x4b')]['id'];}return db[_0x8f1d('0x30')][_0x8f1d('0x50')]({'where':{'id':_0x383e3f[_0x8f1d('0x46')]['id']}})[_0x8f1d('0x27')](handleEntityNotFound(_0x7dbca3,null))[_0x8f1d('0x27')](saveUpdates(_0x383e3f[_0x8f1d('0x4b')],null))[_0x8f1d('0x27')](respondWithResult(_0x7dbca3,null))[_0x8f1d('0x44')](handleError(_0x7dbca3,null));};exports[_0x8f1d('0x28')]=function(_0x1c3348,_0x520ddf){return db[_0x8f1d('0x30')][_0x8f1d('0x50')]({'where':{'id':_0x1c3348['params']['id']}})[_0x8f1d('0x27')](handleEntityNotFound(_0x520ddf,null))['then'](removeEntity(_0x520ddf,null))[_0x8f1d('0x44')](handleError(_0x520ddf,null));};exports[_0x8f1d('0x53')]=function(_0x1e8c5f,_0x31b38a,_0x1c2dc6){var _0x2ba720=require(_0x8f1d('0x54'));return db[_0x8f1d('0x30')][_0x8f1d('0x50')]({'where':{'id':_0x1e8c5f['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x31b38a,null))[_0x8f1d('0x27')](function(){_0x2ba720[_0x8f1d('0x53')](_0x1e8c5f['params']['id']);})['then'](respondWithStatusCode(_0x31b38a,null))[_0x8f1d('0x44')](handleError(_0x31b38a,null));}; \ No newline at end of file +var _0xd8aa=['type','key','model','map','query','intersection','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','keys','fields','length','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Scheduler','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','name','send','Schedule','rawAttributes'];(function(_0x197a1e,_0x1e2cc7){var _0x49de13=function(_0x543164){while(--_0x543164){_0x197a1e['push'](_0x197a1e['shift']());}};_0x49de13(++_0x1e2cc7);}(_0xd8aa,0x119));var _0xad8a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd8aa[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad8a('0x0'));var zipdir=require(_0xad8a('0x1'));var jsonpatch=require(_0xad8a('0x2'));var rp=require(_0xad8a('0x3'));var moment=require(_0xad8a('0x4'));var BPromise=require(_0xad8a('0x5'));var Mustache=require(_0xad8a('0x6'));var util=require('util');var path=require('path');var sox=require(_0xad8a('0x7'));var csv=require(_0xad8a('0x8'));var ejs=require(_0xad8a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xad8a('0xa'));var crypto=require('crypto');var jsforce=require(_0xad8a('0xb'));var deskjs=require(_0xad8a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xad8a('0xd'));var Redis=require(_0xad8a('0xe'));var authService=require(_0xad8a('0xf'));var qs=require(_0xad8a('0x10'));var as=require(_0xad8a('0x11'));var hardwareService=require(_0xad8a('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xad8a('0x13'));var db=require(_0xad8a('0x14'))['db'];function respondWithStatusCode(_0x5684ac,_0x4a1c62){_0x4a1c62=_0x4a1c62||0xcc;return function(_0x144522){if(_0x144522){return _0x5684ac[_0xad8a('0x15')](_0x4a1c62);}return _0x5684ac[_0xad8a('0x16')](_0x4a1c62)['end']();};}function respondWithResult(_0x12de49,_0x4a4ad8){_0x4a4ad8=_0x4a4ad8||0xc8;return function(_0x2df48c){if(_0x2df48c){return _0x12de49[_0xad8a('0x16')](_0x4a4ad8)[_0xad8a('0x17')](_0x2df48c);}};}function respondWithFilteredResult(_0x1f7b71,_0x2e9c1c){return function(_0x3d66d4){if(_0x3d66d4){var _0x51c023=typeof _0x2e9c1c[_0xad8a('0x18')]==='undefined'&&typeof _0x2e9c1c[_0xad8a('0x19')]===_0xad8a('0x1a');var _0x28970c=_0x3d66d4['count'];var _0x2e403b=_0x51c023?0x0:_0x2e9c1c[_0xad8a('0x18')];var _0x6901f0=_0x51c023?_0x3d66d4[_0xad8a('0x1b')]:_0x2e9c1c[_0xad8a('0x18')]+_0x2e9c1c[_0xad8a('0x19')];var _0x5edd8e;if(_0x6901f0>=_0x28970c){_0x6901f0=_0x28970c;_0x5edd8e=0xc8;}else{_0x5edd8e=0xce;}_0x1f7b71[_0xad8a('0x16')](_0x5edd8e);return _0x1f7b71[_0xad8a('0x1c')](_0xad8a('0x1d'),_0x2e403b+'-'+_0x6901f0+'/'+_0x28970c)[_0xad8a('0x17')](_0x3d66d4);}return null;};}function patchUpdates(_0x1e60ee){return function(_0x3f6c5d){try{jsonpatch['apply'](_0x3f6c5d,_0x1e60ee,!![]);}catch(_0x15f326){return BPromise[_0xad8a('0x1e')](_0x15f326);}return _0x3f6c5d[_0xad8a('0x1f')]();};}function saveUpdates(_0x1eb72e,_0x186581){return function(_0x3239c2){if(_0x3239c2){return _0x3239c2['update'](_0x1eb72e)['then'](function(_0x3208f9){return _0x3208f9;});}return null;};}function removeEntity(_0x411d27,_0x49bf78){return function(_0x1df8c9){if(_0x1df8c9){return _0x1df8c9['destroy']()[_0xad8a('0x20')](function(){var _0x43e739=_0x1df8c9['get']({'plain':!![]});var _0x388b15='Scheduler';return db['UserProfileResource'][_0xad8a('0x21')]({'where':{'type':_0x388b15,'resourceId':_0x43e739['id']}})[_0xad8a('0x20')](function(){return _0x1df8c9;});})[_0xad8a('0x20')](function(){_0x411d27[_0xad8a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdd8dfc,_0x5bb034){return function(_0x377a94){if(!_0x377a94){_0xdd8dfc[_0xad8a('0x15')](0x194);}return _0x377a94;};}function handleError(_0x12e6a4,_0x4938ad){_0x4938ad=_0x4938ad||0x1f4;return function(_0x48cded){logger[_0xad8a('0x22')](_0x48cded['stack']);if(_0x48cded[_0xad8a('0x23')]){delete _0x48cded[_0xad8a('0x23')];}_0x12e6a4[_0xad8a('0x16')](_0x4938ad)[_0xad8a('0x24')](_0x48cded);};}exports['index']=function(_0x36e6d9,_0x2695a4){var _0x6beac8={},_0x1a0d34={},_0x2ed34f={'count':0x0,'rows':[]};var _0x206614=_['map'](db[_0xad8a('0x25')][_0xad8a('0x26')],function(_0x56a226){return{'name':_0x56a226['fieldName'],'type':_0x56a226[_0xad8a('0x27')][_0xad8a('0x28')]};});_0x1a0d34[_0xad8a('0x29')]=_[_0xad8a('0x2a')](_0x206614,'name');_0x1a0d34[_0xad8a('0x2b')]=_['keys'](_0x36e6d9[_0xad8a('0x2b')]);_0x1a0d34['filters']=_[_0xad8a('0x2c')](_0x1a0d34[_0xad8a('0x29')],_0x1a0d34[_0xad8a('0x2b')]);_0x6beac8[_0xad8a('0x2d')]=_[_0xad8a('0x2c')](_0x1a0d34['model'],qs['fields'](_0x36e6d9[_0xad8a('0x2b')]['fields']));_0x6beac8[_0xad8a('0x2d')]=_0x6beac8['attributes']['length']?_0x6beac8[_0xad8a('0x2d')]:_0x1a0d34[_0xad8a('0x29')];if(!_0x36e6d9['query'][_0xad8a('0x2e')]('nolimit')){_0x6beac8[_0xad8a('0x19')]=qs[_0xad8a('0x19')](_0x36e6d9['query']['limit']);_0x6beac8['offset']=qs[_0xad8a('0x18')](_0x36e6d9[_0xad8a('0x2b')][_0xad8a('0x18')]);}_0x6beac8[_0xad8a('0x2f')]=qs[_0xad8a('0x30')](_0x36e6d9[_0xad8a('0x2b')]['sort']);_0x6beac8[_0xad8a('0x31')]=qs[_0xad8a('0x32')](_[_0xad8a('0x33')](_0x36e6d9['query'],_0x1a0d34['filters']),_0x206614);if(_0x36e6d9[_0xad8a('0x2b')][_0xad8a('0x34')]){_0x6beac8[_0xad8a('0x31')]=_[_0xad8a('0x35')](_0x6beac8[_0xad8a('0x31')],{'$or':_[_0xad8a('0x2a')](_0x206614,function(_0x9c6cbd){if(_0x9c6cbd['type']!==_0xad8a('0x36')){var _0x50f8a0={};_0x50f8a0[_0x9c6cbd['name']]={'$like':'%'+_0x36e6d9[_0xad8a('0x2b')][_0xad8a('0x34')]+'%'};return _0x50f8a0;}})});}_0x6beac8=_[_0xad8a('0x35')]({},_0x6beac8,_0x36e6d9[_0xad8a('0x37')]);var _0x88399c={'where':_0x6beac8[_0xad8a('0x31')]};return db[_0xad8a('0x25')][_0xad8a('0x1b')](_0x88399c)[_0xad8a('0x20')](function(_0x4d46de){_0x2ed34f[_0xad8a('0x1b')]=_0x4d46de;if(_0x36e6d9[_0xad8a('0x2b')]['includeAll']){_0x6beac8[_0xad8a('0x38')]=[{'all':!![]}];}return db[_0xad8a('0x25')][_0xad8a('0x39')](_0x6beac8);})['then'](function(_0x4ce35d){_0x2ed34f['rows']=_0x4ce35d;return _0x2ed34f;})[_0xad8a('0x20')](respondWithFilteredResult(_0x2695a4,_0x6beac8))[_0xad8a('0x3a')](handleError(_0x2695a4,null));};exports[_0xad8a('0x3b')]=function(_0xd9b4f5,_0x4fdf2f){var _0x4cdb5b={'raw':![],'where':{'id':_0xd9b4f5['params']['id']}},_0x3938f4={};_0x3938f4[_0xad8a('0x29')]=_[_0xad8a('0x3c')](db[_0xad8a('0x25')][_0xad8a('0x26')]);_0x3938f4[_0xad8a('0x2b')]=_[_0xad8a('0x3c')](_0xd9b4f5['query']);_0x3938f4['filters']=_[_0xad8a('0x2c')](_0x3938f4[_0xad8a('0x29')],_0x3938f4['query']);_0x4cdb5b[_0xad8a('0x2d')]=_['intersection'](_0x3938f4[_0xad8a('0x29')],qs['fields'](_0xd9b4f5[_0xad8a('0x2b')][_0xad8a('0x3d')]));_0x4cdb5b['attributes']=_0x4cdb5b[_0xad8a('0x2d')][_0xad8a('0x3e')]?_0x4cdb5b[_0xad8a('0x2d')]:_0x3938f4[_0xad8a('0x29')];if(_0xd9b4f5[_0xad8a('0x2b')][_0xad8a('0x3f')]){_0x4cdb5b['include']=[{'all':!![]}];}_0x4cdb5b=_['merge']({},_0x4cdb5b,_0xd9b4f5[_0xad8a('0x37')]);return db[_0xad8a('0x25')][_0xad8a('0x40')](_0x4cdb5b)[_0xad8a('0x20')](handleEntityNotFound(_0x4fdf2f,null))['then'](respondWithResult(_0x4fdf2f,null))['catch'](handleError(_0x4fdf2f,null));};exports[_0xad8a('0x41')]=function(_0x1ee838,_0x428382){return db[_0xad8a('0x25')][_0xad8a('0x41')](_0x1ee838[_0xad8a('0x42')],{})['then'](function(_0x516df5){var _0x52b100=_0x1ee838['user'][_0xad8a('0x43')]({'plain':!![]});if(!_0x52b100)throw new Error(_0xad8a('0x44'));if(_0x52b100[_0xad8a('0x45')]===_0xad8a('0x46')){var _0x5079b4=_0x516df5[_0xad8a('0x43')]({'plain':!![]});var _0xc44f96=_0xad8a('0x47');return db[_0xad8a('0x48')]['find']({'where':{'name':_0xc44f96,'userProfileId':_0x52b100['userProfileId']},'raw':!![]})['then'](function(_0x455d13){if(_0x455d13&&_0x455d13[_0xad8a('0x49')]===0x0){return db[_0xad8a('0x4a')][_0xad8a('0x41')]({'name':_0x5079b4[_0xad8a('0x23')],'resourceId':_0x5079b4['id'],'type':_0x455d13[_0xad8a('0x23')],'sectionId':_0x455d13['id']},{})[_0xad8a('0x20')](function(){return _0x516df5;});}else{return _0x516df5;}})[_0xad8a('0x3a')](function(_0x47231b){logger[_0xad8a('0x22')](_0xad8a('0x4b'),_0x47231b);throw _0x47231b;});}return _0x516df5;})[_0xad8a('0x20')](respondWithResult(_0x428382,0xc9))[_0xad8a('0x3a')](handleError(_0x428382,null));};exports[_0xad8a('0x4c')]=function(_0x2dc736,_0xf53ba9){if(_0x2dc736[_0xad8a('0x42')]['id']){delete _0x2dc736['body']['id'];}return db[_0xad8a('0x25')][_0xad8a('0x40')]({'where':{'id':_0x2dc736[_0xad8a('0x4d')]['id']}})[_0xad8a('0x20')](handleEntityNotFound(_0xf53ba9,null))[_0xad8a('0x20')](saveUpdates(_0x2dc736[_0xad8a('0x42')],null))[_0xad8a('0x20')](respondWithResult(_0xf53ba9,null))['catch'](handleError(_0xf53ba9,null));};exports[_0xad8a('0x21')]=function(_0xa653c3,_0x475b80){return db['Schedule'][_0xad8a('0x40')]({'where':{'id':_0xa653c3[_0xad8a('0x4d')]['id']}})[_0xad8a('0x20')](handleEntityNotFound(_0x475b80,null))[_0xad8a('0x20')](removeEntity(_0x475b80,null))[_0xad8a('0x3a')](handleError(_0x475b80,null));};exports[_0xad8a('0x4e')]=function(_0x59df0f,_0x1e5c9a,_0x1036d4){var _0x58908c=require(_0xad8a('0x4f'));return db['Schedule']['find']({'where':{'id':_0x59df0f[_0xad8a('0x4d')]['id']},'raw':!![]})[_0xad8a('0x20')](handleEntityNotFound(_0x1e5c9a,null))[_0xad8a('0x20')](function(){_0x58908c[_0xad8a('0x4e')](_0x59df0f[_0xad8a('0x4d')]['id']);})['then'](respondWithStatusCode(_0x1e5c9a,null))['catch'](handleError(_0x1e5c9a,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index afd1d5b..0fb4836 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 _0xa3c1=['rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','moment','bluebird','request-promise','path'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0xa3c1,0xb0));var _0x1a3c=function(_0x3dd7f0,_0x401bec){_0x3dd7f0=_0x3dd7f0-0x0;var _0x5333e0=_0xa3c1[_0x3dd7f0];return _0x5333e0;};'use strict';var _=require(_0x1a3c('0x0'));var util=require(_0x1a3c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1a3c('0x2'));var BPromise=require(_0x1a3c('0x3'));var rp=require(_0x1a3c('0x4'));var fs=require('fs');var path=require(_0x1a3c('0x5'));var rimraf=require(_0x1a3c('0x6'));var config=require(_0x1a3c('0x7'));var attributes=require(_0x1a3c('0x8'));module[_0x1a3c('0x9')]=function(_0x1d167f,_0xcacf69){return _0x1d167f[_0x1a3c('0xa')](_0x1a3c('0xb'),attributes,{'tableName':_0x1a3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b14=['bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','Schedule','tools_schedules','lodash','util','../../config/logger','api'];(function(_0x2a9036,_0x5f3ebd){var _0x27f456=function(_0xcb2983){while(--_0xcb2983){_0x2a9036['push'](_0x2a9036['shift']());}};_0x27f456(++_0x5f3ebd);}(_0x1b14,0x14c));var _0x41b1=function(_0x11023a,_0x3fcbd5){_0x11023a=_0x11023a-0x0;var _0x2a0f9d=_0x1b14[_0x11023a];return _0x2a0f9d;};'use strict';var _=require(_0x41b1('0x0'));var util=require(_0x41b1('0x1'));var logger=require(_0x41b1('0x2'))(_0x41b1('0x3'));var moment=require('moment');var BPromise=require(_0x41b1('0x4'));var rp=require(_0x41b1('0x5'));var fs=require('fs');var path=require(_0x41b1('0x6'));var rimraf=require(_0x41b1('0x7'));var config=require(_0x41b1('0x8'));var attributes=require(_0x41b1('0x9'));module['exports']=function(_0x11953c,_0x3eb6a7){return _0x11953c['define'](_0x41b1('0xa'),attributes,{'tableName':_0x41b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index dc3785c..dd9c12e 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 _0x6b04=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','Schedule,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x30ae91,_0x3295f5){var _0x3f182b=function(_0x1dc94f){while(--_0x1dc94f){_0x30ae91['push'](_0x30ae91['shift']());}};_0x3f182b(++_0x3295f5);}(_0x6b04,0x127));var _0x46b0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x6b04[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x46b0('0x0'));var moment=require(_0x46b0('0x1'));var BPromise=require(_0x46b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46b0('0x3'));var db=require(_0x46b0('0x4'))['db'];var utils=require(_0x46b0('0x5'));var logger=require(_0x46b0('0x6'))(_0x46b0('0x7'));var config=require(_0x46b0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46b0('0x9')][_0x46b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f2402,_0x2357a4,_0x3eb08d){return new BPromise(function(_0x46979f,_0x1d1fe1){return client['request'](_0x4f2402,_0x3eb08d)[_0x46b0('0xb')](function(_0x2779d5){logger['info'](_0x46b0('0xc'),_0x2357a4,_0x46b0('0xd'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x2357a4,'request\x20sent',JSON[_0x46b0('0xe')](_0x2779d5));if(_0x2779d5[_0x46b0('0xf')]){if(_0x2779d5[_0x46b0('0xf')][_0x46b0('0x10')]===0x1f4){logger[_0x46b0('0xf')](_0x46b0('0xc'),_0x2357a4,_0x2779d5[_0x46b0('0xf')][_0x46b0('0x11')]);return _0x1d1fe1(_0x2779d5[_0x46b0('0xf')][_0x46b0('0x11')]);}logger[_0x46b0('0xf')]('Schedule,\x20%s,\x20%s',_0x2357a4,_0x2779d5['error'][_0x46b0('0x11')]);return _0x46979f(_0x2779d5[_0x46b0('0xf')][_0x46b0('0x11')]);}else{logger[_0x46b0('0x12')](_0x46b0('0xc'),_0x2357a4,_0x46b0('0xd'));_0x46979f(_0x2779d5[_0x46b0('0x13')][_0x46b0('0x11')]);}})[_0x46b0('0x14')](function(_0x48a5c9){logger[_0x46b0('0xf')](_0x46b0('0xc'),_0x2357a4,_0x48a5c9);_0x1d1fe1(_0x48a5c9);});});} \ No newline at end of file +var _0x3d4c=['jayson/promise','http','then','Schedule,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','moment','bluebird','../../config/logger','rpc','../../config/environment'];(function(_0x3cb21e,_0x11849a){var _0xeacd6a=function(_0xef5a2e){while(--_0xef5a2e){_0x3cb21e['push'](_0x3cb21e['shift']());}};_0xeacd6a(++_0x11849a);}(_0x3d4c,0x14e));var _0xc3d4=function(_0x6447ff,_0x367c10){_0x6447ff=_0x6447ff-0x0;var _0x3a8aed=_0x3d4c[_0x6447ff];return _0x3a8aed;};'use strict';var _=require(_0xc3d4('0x0'));var util=require('util');var moment=require(_0xc3d4('0x1'));var BPromise=require(_0xc3d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc3d4('0x3'))(_0xc3d4('0x4'));var config=require(_0xc3d4('0x5'));var jayson=require(_0xc3d4('0x6'));var client=jayson['client'][_0xc3d4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x41c990,_0x278a53,_0x456df7){return new BPromise(function(_0x2e330f,_0x3b13e2){return client['request'](_0x41c990,_0x456df7)[_0xc3d4('0x8')](function(_0xde9319){logger['info'](_0xc3d4('0x9'),_0x278a53,_0xc3d4('0xa'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x278a53,_0xc3d4('0xa'),JSON[_0xc3d4('0xb')](_0xde9319));if(_0xde9319[_0xc3d4('0xc')]){if(_0xde9319[_0xc3d4('0xc')][_0xc3d4('0xd')]===0x1f4){logger[_0xc3d4('0xc')](_0xc3d4('0x9'),_0x278a53,_0xde9319[_0xc3d4('0xc')]['message']);return _0x3b13e2(_0xde9319[_0xc3d4('0xc')]['message']);}logger[_0xc3d4('0xc')]('Schedule,\x20%s,\x20%s',_0x278a53,_0xde9319[_0xc3d4('0xc')][_0xc3d4('0xe')]);return _0x2e330f(_0xde9319[_0xc3d4('0xc')][_0xc3d4('0xe')]);}else{logger[_0xc3d4('0xf')]('Schedule,\x20%s,\x20%s',_0x278a53,'request\x20sent');_0x2e330f(_0xde9319['result'][_0xc3d4('0xe')]);}})[_0xc3d4('0x10')](function(_0x36224e){logger[_0xc3d4('0xc')](_0xc3d4('0x9'),_0x278a53,_0x36224e);_0x3b13e2(_0x36224e);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 03bcf55..2baf231 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 _0x37e1=['download','post','create','put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x26aaab,_0xd8d125){var _0x2d421a=function(_0xd35b3c){while(--_0xd35b3c){_0x26aaab['push'](_0x26aaab['shift']());}};_0x2d421a(++_0xd8d125);}(_0x37e1,0x104));var _0x137e=function(_0x53ffe8,_0xcb1629){_0x53ffe8=_0x53ffe8-0x0;var _0x2412bb=_0x37e1[_0x53ffe8];return _0x2412bb;};'use strict';var multer=require(_0x137e('0x0'));var util=require('util');var path=require(_0x137e('0x1'));var timeout=require(_0x137e('0x2'));var express=require('express');var router=express[_0x137e('0x3')]();var fs_extra=require(_0x137e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x137e('0x5'));var config=require(_0x137e('0x6'));var controller=require(_0x137e('0x7'));router[_0x137e('0x8')]('/',auth[_0x137e('0x9')](),controller[_0x137e('0xa')]);router[_0x137e('0x8')](_0x137e('0xb'),auth[_0x137e('0x9')](),controller[_0x137e('0xc')]);router['get'](_0x137e('0xd'),auth['isAuthenticated'](),controller[_0x137e('0xe')]);router[_0x137e('0x8')](_0x137e('0xf'),auth['isAuthenticated'](),controller[_0x137e('0x10')]);router[_0x137e('0x11')]('/',auth[_0x137e('0x9')](),controller[_0x137e('0x12')]);router[_0x137e('0x13')](_0x137e('0xd'),auth['isAuthenticated'](),controller[_0x137e('0x14')]);router['delete'](_0x137e('0xd'),auth['isAuthenticated'](),controller[_0x137e('0x15')]);module[_0x137e('0x16')]=router; \ No newline at end of file +var _0xab3c=['get','/describe','/:id','isAuthenticated','download','post','create','update','delete','destroy','exports','multer','path','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0xab3c,0x1e7));var _0xcab3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab3c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xcab3('0x0'));var util=require('util');var path=require(_0xcab3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xcab3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xcab3('0x3'));var config=require(_0xcab3('0x4'));var controller=require(_0xcab3('0x5'));router[_0xcab3('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcab3('0x6')](_0xcab3('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0xcab3('0x6')](_0xcab3('0x8'),auth[_0xcab3('0x9')](),controller['show']);router[_0xcab3('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0xcab3('0xa')]);router[_0xcab3('0xb')]('/',auth[_0xcab3('0x9')](),controller[_0xcab3('0xc')]);router['put']('/:id',auth[_0xcab3('0x9')](),controller[_0xcab3('0xd')]);router[_0xcab3('0xe')](_0xcab3('0x8'),auth['isAuthenticated'](),controller[_0xcab3('0xf')]);module[_0xcab3('0x10')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index a937f76..c1db2f8 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 _0x7cd6=['startedAt','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','sequelize','moment','path','../../config/environment','getDataValue','value','extname','STRING','INTEGER','setDataValue','closedAt','duration','DATE'];(function(_0x2cbc82,_0x30d15a){var _0x222f31=function(_0x51bc14){while(--_0x51bc14){_0x2cbc82['push'](_0x2cbc82['shift']());}};_0x222f31(++_0x30d15a);}(_0x7cd6,0x1f4));var _0x67cd=function(_0x35f394,_0x541851){_0x35f394=_0x35f394-0x0;var _0xd76544=_0x7cd6[_0x35f394];return _0xd76544;};'use strict';var Sequelize=require(_0x67cd('0x0'));var moment=require(_0x67cd('0x1'));var path=require(_0x67cd('0x2'));var config=require(_0x67cd('0x3'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x67cd('0x4')](_0x67cd('0x5'))?path[_0x67cd('0x6')](this['getDataValue'](_0x67cd('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x67cd('0x7')]},'value':{'type':Sequelize[_0x67cd('0x7')],'set':function(_0xcdc210){var _0x2bb791=_0xcdc210['replace'](/\\/g,'/');this['setDataValue']('value',_0x2bb791);}},'rating':{'type':Sequelize[_0x67cd('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x67cd('0x8')],'set':function(_0x4a92b3){this[_0x67cd('0x9')]('startedAt',moment()['subtract'](_0x4a92b3,'ms'));this['setDataValue'](_0x67cd('0xa'),moment());this[_0x67cd('0x9')](_0x67cd('0xb'),_0x4a92b3);}},'startedAt':{'type':Sequelize[_0x67cd('0xc')],'get':function(){return moment(this[_0x67cd('0x4')](_0x67cd('0xd')))['format'](_0x67cd('0xe'))[_0x67cd('0xf')]();}},'closedAt':{'type':Sequelize[_0x67cd('0xc')],'get':function(){return moment(this[_0x67cd('0x4')](_0x67cd('0xa')))[_0x67cd('0x10')](_0x67cd('0xe'))[_0x67cd('0xf')]();}},'createdAt':{'type':Sequelize[_0x67cd('0xc')],'get':function(){return moment(this[_0x67cd('0x4')](_0x67cd('0x11')))[_0x67cd('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x67cd('0xf')]();}},'updatedAt':{'type':Sequelize[_0x67cd('0xc')],'get':function(){return moment(this[_0x67cd('0x4')](_0x67cd('0x12')))[_0x67cd('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x67cd('0xf')]();}}}; \ No newline at end of file +var _0x202a=['createdAt','updatedAt','moment','path','../../config/environment','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','toString','DATE','MM-DD-YYYY\x20HH:mm'];(function(_0x493cc4,_0x43b1d6){var _0x13fba3=function(_0x497ffc){while(--_0x497ffc){_0x493cc4['push'](_0x493cc4['shift']());}};_0x13fba3(++_0x43b1d6);}(_0x202a,0xc0));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa202('0x0'));var path=require(_0xa202('0x1'));var config=require(_0xa202('0x2'));module['exports']={'format':{'type':Sequelize[_0xa202('0x3')],'get':function(){return this['getDataValue']('value')?path['extname'](this[_0xa202('0x4')](_0xa202('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xa202('0x6')],'set':function(_0x4cb469){var _0x4f0a59=_0x4cb469['replace'](/\\/g,'/');this[_0xa202('0x7')](_0xa202('0x5'),_0x4f0a59);}},'rating':{'type':Sequelize[_0xa202('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa202('0x8')],'set':function(_0x572036){this['setDataValue'](_0xa202('0x9'),moment()[_0xa202('0xa')](_0x572036,'ms'));this[_0xa202('0x7')](_0xa202('0xb'),moment());this['setDataValue'](_0xa202('0xc'),_0x572036);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa202('0x4')](_0xa202('0x9')))[_0xa202('0xd')]('MM-DD-YYYY\x20HH:mm')[_0xa202('0xe')]();}},'closedAt':{'type':Sequelize[_0xa202('0xf')],'get':function(){return moment(this[_0xa202('0x4')](_0xa202('0xb')))[_0xa202('0xd')](_0xa202('0x10'))['toString']();}},'createdAt':{'type':Sequelize[_0xa202('0xf')],'get':function(){return moment(this[_0xa202('0x4')](_0xa202('0x11')))[_0xa202('0xd')](_0xa202('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0xa202('0xf')],'get':function(){return moment(this[_0xa202('0x4')](_0xa202('0x12')))[_0xa202('0xd')](_0xa202('0x10'))[_0xa202('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 0fc71a5..89c092d 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 _0x4c4e=['findAll','rows','catch','params','keys','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','name','index','map','ScreenRecording','rawAttributes','type','key','model','differenceBy','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0x4c4e,0x152));var _0xe4c4=function(_0x1eba2a,_0x14ae37){_0x1eba2a=_0x1eba2a-0x0;var _0x3f1e81=_0x4c4e[_0x1eba2a];return _0x3f1e81;};'use strict';var emlformat=require(_0xe4c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4c4('0x1'));var jsonpatch=require(_0xe4c4('0x2'));var rp=require(_0xe4c4('0x3'));var moment=require('moment');var BPromise=require(_0xe4c4('0x4'));var Mustache=require(_0xe4c4('0x5'));var util=require(_0xe4c4('0x6'));var path=require('path');var sox=require(_0xe4c4('0x7'));var csv=require('to-csv');var ejs=require(_0xe4c4('0x8'));var fs=require('fs');var fs_extra=require(_0xe4c4('0x9'));var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4c4('0x10'));var authService=require(_0xe4c4('0x11'));var qs=require(_0xe4c4('0x12'));var as=require(_0xe4c4('0x13'));var hardwareService=require(_0xe4c4('0x14'));var logger=require(_0xe4c4('0x15'))('api');var utils=require(_0xe4c4('0x16'));var config=require(_0xe4c4('0x17'));var licenseUtil=require(_0xe4c4('0x18'));var db=require(_0xe4c4('0x19'))['db'];function respondWithStatusCode(_0x50bfab,_0x262083){_0x262083=_0x262083||0xcc;return function(_0x115802){if(_0x115802){return _0x50bfab['sendStatus'](_0x262083);}return _0x50bfab[_0xe4c4('0x1a')](_0x262083)[_0xe4c4('0x1b')]();};}function respondWithResult(_0x5aa89b,_0x42ce9e){_0x42ce9e=_0x42ce9e||0xc8;return function(_0x29766a){if(_0x29766a){return _0x5aa89b['status'](_0x42ce9e)[_0xe4c4('0x1c')](_0x29766a);}};}function respondWithFilteredResult(_0x465c9b,_0x26ea05){return function(_0x40a36e){if(_0x40a36e){var _0x19e59b=typeof _0x26ea05[_0xe4c4('0x1d')]===_0xe4c4('0x1e')&&typeof _0x26ea05[_0xe4c4('0x1f')]===_0xe4c4('0x1e');var _0x36b10c=_0x40a36e[_0xe4c4('0x20')];var _0x42242c=_0x19e59b?0x0:_0x26ea05[_0xe4c4('0x1d')];var _0x43a9ce=_0x19e59b?_0x40a36e[_0xe4c4('0x20')]:_0x26ea05['offset']+_0x26ea05[_0xe4c4('0x1f')];var _0x24f946;if(_0x43a9ce>=_0x36b10c){_0x43a9ce=_0x36b10c;_0x24f946=0xc8;}else{_0x24f946=0xce;}_0x465c9b[_0xe4c4('0x1a')](_0x24f946);return _0x465c9b[_0xe4c4('0x21')]('Content-Range',_0x42242c+'-'+_0x43a9ce+'/'+_0x36b10c)[_0xe4c4('0x1c')](_0x40a36e);}return null;};}function patchUpdates(_0x1cad5d){return function(_0x1727eb){try{jsonpatch[_0xe4c4('0x22')](_0x1727eb,_0x1cad5d,!![]);}catch(_0x2c5aea){return BPromise[_0xe4c4('0x23')](_0x2c5aea);}return _0x1727eb[_0xe4c4('0x24')]();};}function saveUpdates(_0x393c96,_0x21bbb1){return function(_0x1a7690){if(_0x1a7690){return _0x1a7690[_0xe4c4('0x25')](_0x393c96)[_0xe4c4('0x26')](function(_0x138ead){return _0x138ead;});}return null;};}function removeEntity(_0x1db719,_0x15873e){return function(_0x59498e){if(_0x59498e){return _0x59498e['destroy']()[_0xe4c4('0x26')](function(){_0x1db719['status'](0xcc)[_0xe4c4('0x1b')]();});}};}function handleEntityNotFound(_0x5374fd,_0x3adfcb){return function(_0x5efc4c){if(!_0x5efc4c){_0x5374fd[_0xe4c4('0x27')](0x194);}return _0x5efc4c;};}function handleError(_0x583393,_0xba53ef){_0xba53ef=_0xba53ef||0x1f4;return function(_0x4a0199){logger['error'](_0x4a0199['stack']);if(_0x4a0199['name']){delete _0x4a0199[_0xe4c4('0x28')];}_0x583393['status'](_0xba53ef)['send'](_0x4a0199);};}exports[_0xe4c4('0x29')]=function(_0x11deab,_0x4bb911){var _0x57ba43={},_0x7428ad={},_0x33de43={'count':0x0,'rows':[]};var _0x4aa6c1=_[_0xe4c4('0x2a')](db[_0xe4c4('0x2b')][_0xe4c4('0x2c')],function(_0x48060e){return{'name':_0x48060e['fieldName'],'type':_0x48060e[_0xe4c4('0x2d')][_0xe4c4('0x2e')]};});_0x7428ad[_0xe4c4('0x2f')]=_[_0xe4c4('0x30')](_['map'](_0x4aa6c1,'name'),[_0xe4c4('0x31')]);_0x7428ad[_0xe4c4('0x32')]=_['keys'](_0x11deab[_0xe4c4('0x32')]);_0x7428ad[_0xe4c4('0x33')]=_[_0xe4c4('0x34')](_0x7428ad['model'],_0x7428ad[_0xe4c4('0x32')]);_0x57ba43['attributes']=_[_0xe4c4('0x34')](_0x7428ad[_0xe4c4('0x2f')],qs[_0xe4c4('0x35')](_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x35')]));_0x57ba43[_0xe4c4('0x36')]=_0x57ba43[_0xe4c4('0x36')][_0xe4c4('0x37')]?_0x57ba43[_0xe4c4('0x36')]:_0x7428ad[_0xe4c4('0x2f')];if(!_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x38')]('nolimit')){_0x57ba43[_0xe4c4('0x1f')]=qs[_0xe4c4('0x1f')](_0x11deab[_0xe4c4('0x32')]['limit']);_0x57ba43[_0xe4c4('0x1d')]=qs[_0xe4c4('0x1d')](_0x11deab[_0xe4c4('0x32')]['offset']);}_0x57ba43[_0xe4c4('0x39')]=qs[_0xe4c4('0x3a')](_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x3a')]);_0x57ba43[_0xe4c4('0x3b')]=qs[_0xe4c4('0x33')](_[_0xe4c4('0x3c')](_0x11deab[_0xe4c4('0x32')],_0x7428ad[_0xe4c4('0x33')]),_0x4aa6c1);if(_0x11deab[_0xe4c4('0x32')]['filter']){_0x57ba43[_0xe4c4('0x3b')]=_[_0xe4c4('0x3d')](_0x57ba43[_0xe4c4('0x3b')],{'$or':_[_0xe4c4('0x2a')](_0x4aa6c1,function(_0x4c5551){if(_0x4c5551[_0xe4c4('0x2d')]!==_0xe4c4('0x3e')){var _0x4e6bd9={};_0x4e6bd9[_0x4c5551[_0xe4c4('0x28')]]={'$like':'%'+_0x11deab[_0xe4c4('0x32')]['filter']+'%'};return _0x4e6bd9;}})});}_0x57ba43=_[_0xe4c4('0x3d')]({},_0x57ba43,_0x11deab[_0xe4c4('0x3f')]);var _0x127bcd={'where':_0x57ba43[_0xe4c4('0x3b')]};return db[_0xe4c4('0x2b')][_0xe4c4('0x20')](_0x127bcd)[_0xe4c4('0x26')](function(_0x43201e){_0x33de43[_0xe4c4('0x20')]=_0x43201e;if(_0x11deab[_0xe4c4('0x32')][_0xe4c4('0x40')]){_0x57ba43[_0xe4c4('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0xe4c4('0x42')](_0x57ba43);})[_0xe4c4('0x26')](function(_0x2b306d){_0x33de43[_0xe4c4('0x43')]=_0x2b306d;return _0x33de43;})[_0xe4c4('0x26')](respondWithFilteredResult(_0x4bb911,_0x57ba43))[_0xe4c4('0x44')](handleError(_0x4bb911,null));};exports['show']=function(_0x312a49,_0x526bef){var _0xca07dc={'raw':![],'where':{'id':_0x312a49[_0xe4c4('0x45')]['id']}},_0x3c067a={};_0x3c067a[_0xe4c4('0x2f')]=_[_0xe4c4('0x46')](db['ScreenRecording']['rawAttributes']);_0x3c067a[_0xe4c4('0x32')]=_[_0xe4c4('0x46')](_0x312a49[_0xe4c4('0x32')]);_0x3c067a['filters']=_[_0xe4c4('0x34')](_0x3c067a[_0xe4c4('0x2f')],_0x3c067a[_0xe4c4('0x32')]);_0xca07dc[_0xe4c4('0x36')]=_['intersection'](_0x3c067a[_0xe4c4('0x2f')],qs[_0xe4c4('0x35')](_0x312a49[_0xe4c4('0x32')][_0xe4c4('0x35')]));_0xca07dc[_0xe4c4('0x36')]=_0xca07dc[_0xe4c4('0x36')][_0xe4c4('0x37')]?_0xca07dc[_0xe4c4('0x36')]:_0x3c067a[_0xe4c4('0x2f')];if(_0x312a49['query'][_0xe4c4('0x40')]){_0xca07dc['include']=[{'all':!![]}];}_0xca07dc=_[_0xe4c4('0x3d')]({},_0xca07dc,_0x312a49[_0xe4c4('0x3f')]);return db[_0xe4c4('0x2b')][_0xe4c4('0x47')](_0xca07dc)[_0xe4c4('0x26')](handleEntityNotFound(_0x526bef,null))[_0xe4c4('0x26')](respondWithResult(_0x526bef,null))[_0xe4c4('0x44')](handleError(_0x526bef,null));};exports[_0xe4c4('0x48')]=function(_0x36f8ad,_0x18fb82){return db[_0xe4c4('0x2b')][_0xe4c4('0x48')](_0x36f8ad[_0xe4c4('0x49')],{})[_0xe4c4('0x26')](respondWithResult(_0x18fb82,0xc9))['catch'](handleError(_0x18fb82,null));};exports['update']=function(_0xe0e351,_0x198961){if(_0xe0e351['body']['id']){delete _0xe0e351[_0xe4c4('0x49')]['id'];}delete _0xe0e351[_0xe4c4('0x49')][_0xe4c4('0x4a')];delete _0xe0e351[_0xe4c4('0x49')][_0xe4c4('0x4b')];delete _0xe0e351['body'][_0xe4c4('0x4c')];delete _0xe0e351[_0xe4c4('0x49')]['value'];return db[_0xe4c4('0x2b')][_0xe4c4('0x47')]({'where':{'id':_0xe0e351['params']['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x198961,null))['then'](saveUpdates(_0xe0e351[_0xe4c4('0x49')],null))[_0xe4c4('0x26')](respondWithResult(_0x198961,null))[_0xe4c4('0x44')](handleError(_0x198961,null));};exports[_0xe4c4('0x4d')]=function(_0x12eaed,_0x525534){return db[_0xe4c4('0x2b')][_0xe4c4('0x4d')]()[_0xe4c4('0x26')](respondWithResult(_0x525534,null))[_0xe4c4('0x44')](handleError(_0x525534,null));};exports[_0xe4c4('0x4e')]=function(_0x32a50e,_0x3ddcbe,_0x3aa205){var _0x1a96ba=require(_0xe4c4('0x4f'));var _0x1fe354=![];var _0x1940e3={};if(_0x32a50e[_0xe4c4('0x32')][_0xe4c4('0x2d')]&&_0x32a50e[_0xe4c4('0x32')][_0xe4c4('0x2d')]==='uniqueid'){_0x1940e3[_0xe4c4('0x50')]=_0x32a50e[_0xe4c4('0x45')]['id'];}else{_0x1940e3['id']=_0x32a50e[_0xe4c4('0x45')]['id'];}return db['ScreenRecording'][_0xe4c4('0x47')]({'where':_0x1940e3,'attributes':['id',_0xe4c4('0x51')],'raw':!![]})[_0xe4c4('0x26')](handleEntityNotFound(_0x3ddcbe,null))['then'](function(_0x45f959){if(_0x45f959){var _0x485c50=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x45f959['value']);var _0x479361=util[_0xe4c4('0x31')](_0xe4c4('0x55'),_0x485c50);if(fs[_0xe4c4('0x56')](_0x479361)){_0x1fe354=!![];return _0x1a96ba['decryptFile'](_0x479361,_0x485c50,config[_0xe4c4('0x57')]['recording'])['then'](function(){return _0x45f959;});}return _0x45f959;}})['then'](function(_0x4e08ec){if(_0x4e08ec){var _0x1ca931=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x4e08ec[_0xe4c4('0x51')]);if(!fs[_0xe4c4('0x56')](_0x1ca931)){throw new db['Sequelize'][(_0xe4c4('0x58'))](_0xe4c4('0x59'));}if(_0x4e08ec[_0xe4c4('0x5a')]){return _0x3ddcbe[_0xe4c4('0x4e')](_0x1ca931,_0x4e08ec[_0xe4c4('0x5a')]+path[_0xe4c4('0x5b')](_0x1ca931),function(){if(_0x1fe354){fs['unlink'](_0x1ca931);}});}else{return _0x3ddcbe['download'](_0x1ca931,function(_0x27599b){if(_0x1fe354){fs[_0xe4c4('0x5c')](_0x1ca931);}});}}})[_0xe4c4('0x44')](function(_0x3c8e44){if(_0x3c8e44[_0xe4c4('0x5d')]===_0xe4c4('0x59')){_0x3ddcbe[_0xe4c4('0x1a')](0x194)[_0xe4c4('0x5e')](_0xe4c4('0x5f'));}else{return handleError(_0x3ddcbe,null);}});};exports['destroy']=function(_0x59f033,_0x5a4138){return db['ScreenRecording'][_0xe4c4('0x47')]({'where':{'id':_0x59f033[_0xe4c4('0x45')]['id']}})[_0xe4c4('0x26')](function(_0x58f2dd){if(_[_0xe4c4('0x60')](_0x58f2dd)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58f2dd;})[_0xe4c4('0x26')](function(_0x56ead3){var _0x5d6c0a=path[_0xe4c4('0x52')](config[_0xe4c4('0x53')],_0xe4c4('0x54'),_0x56ead3['value']);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x5d6c0a);if(!_[_0xe4c4('0x60')](_0x56ead3[_0xe4c4('0x51')])&&fs['existsSync'](_0x5d6c0a)){logger[_0xe4c4('0x61')](_0xe4c4('0x62')+_0x5d6c0a+_0xe4c4('0x63'));fs['unlinkSync'](_0x5d6c0a);}_0x5d6c0a=_0x5d6c0a+'.cypher';if(!_[_0xe4c4('0x60')](_0x56ead3[_0xe4c4('0x51')])&&fs[_0xe4c4('0x56')](_0x5d6c0a)){logger[_0xe4c4('0x61')](_0xe4c4('0x62')+_0x5d6c0a+_0xe4c4('0x63'));fs['unlinkSync'](_0x5d6c0a);}return _0x56ead3;})[_0xe4c4('0x26')](function(_0x1bddd5){if(!_0x1bddd5)throw new InternalError();return _0x1bddd5[_0xe4c4('0x64')]();})['then'](function(){_0x5a4138[_0xe4c4('0x1a')](0xcc)[_0xe4c4('0x1b')]();})[_0xe4c4('0x44')](handleError(_0x5a4138,null));}; \ No newline at end of file +var _0x24ca=['server/files/screen_recordings','Sequelize','ScreenRecording\x20not\x20found','filename','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','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','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','options','ScreenRecording','include','findAll','rows','catch','show','model','includeAll','find','create','body','duration','createdAt','closedAt','params','describe','download','uniqueid','value','root','format','%s.cypher','existsSync','decryptFile','secrets','recording','join'];(function(_0x2df95c,_0x2e9f21){var _0x29eeb0=function(_0x2d78dc){while(--_0x2d78dc){_0x2df95c['push'](_0x2df95c['shift']());}};_0x29eeb0(++_0x2e9f21);}(_0x24ca,0x1bc));var _0xa24c=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x24ca[_0x51c819];return _0x15c5d2;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){_0x346ee8['status'](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x5cc9cb,_0x2365f9){return function(_0x3951ae){if(!_0x3951ae){_0x5cc9cb[_0xa24c('0x29')](0x194);}return _0x3951ae;};}function handleError(_0x51dc3f,_0x1beb55){_0x1beb55=_0x1beb55||0x1f4;return function(_0x31c4d9){logger[_0xa24c('0x2a')](_0x31c4d9[_0xa24c('0x2b')]);if(_0x31c4d9[_0xa24c('0x2c')]){delete _0x31c4d9[_0xa24c('0x2c')];}_0x51dc3f[_0xa24c('0x1b')](_0x1beb55)['send'](_0x31c4d9);};}exports[_0xa24c('0x2d')]=function(_0x28675f,_0x152120){var _0x12dbdc={},_0x5e491e={},_0x21d2a8={'count':0x0,'rows':[]};var _0xc96ce7=_[_0xa24c('0x2e')](db['ScreenRecording'][_0xa24c('0x2f')],function(_0x3dcb1b){return{'name':_0x3dcb1b[_0xa24c('0x30')],'type':_0x3dcb1b['type'][_0xa24c('0x31')]};});_0x5e491e['model']=_[_0xa24c('0x32')](_[_0xa24c('0x2e')](_0xc96ce7,_0xa24c('0x2c')),['format']);_0x5e491e[_0xa24c('0x33')]=_[_0xa24c('0x34')](_0x28675f[_0xa24c('0x33')]);_0x5e491e['filters']=_[_0xa24c('0x35')](_0x5e491e['model'],_0x5e491e[_0xa24c('0x33')]);_0x12dbdc[_0xa24c('0x36')]=_['intersection'](_0x5e491e['model'],qs[_0xa24c('0x37')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x37')]));_0x12dbdc[_0xa24c('0x36')]=_0x12dbdc[_0xa24c('0x36')][_0xa24c('0x38')]?_0x12dbdc[_0xa24c('0x36')]:_0x5e491e['model'];if(!_0x28675f[_0xa24c('0x33')][_0xa24c('0x39')](_0xa24c('0x3a'))){_0x12dbdc[_0xa24c('0x1e')]=qs[_0xa24c('0x1e')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x1e')]);_0x12dbdc[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x28675f[_0xa24c('0x33')]['offset']);}_0x12dbdc[_0xa24c('0x3b')]=qs[_0xa24c('0x3c')](_0x28675f[_0xa24c('0x33')][_0xa24c('0x3c')]);_0x12dbdc['where']=qs['filters'](_[_0xa24c('0x3d')](_0x28675f['query'],_0x5e491e[_0xa24c('0x3e')]),_0xc96ce7);if(_0x28675f[_0xa24c('0x33')][_0xa24c('0x3f')]){_0x12dbdc[_0xa24c('0x40')]=_[_0xa24c('0x41')](_0x12dbdc['where'],{'$or':_['map'](_0xc96ce7,function(_0x3121e){if(_0x3121e[_0xa24c('0x42')]!==_0xa24c('0x43')){var _0x213dc3={};_0x213dc3[_0x3121e[_0xa24c('0x2c')]]={'$like':'%'+_0x28675f[_0xa24c('0x33')]['filter']+'%'};return _0x213dc3;}})});}_0x12dbdc=_['merge']({},_0x12dbdc,_0x28675f[_0xa24c('0x44')]);var _0x1ce83e={'where':_0x12dbdc[_0xa24c('0x40')]};return db[_0xa24c('0x45')][_0xa24c('0x20')](_0x1ce83e)['then'](function(_0x171c51){_0x21d2a8[_0xa24c('0x20')]=_0x171c51;if(_0x28675f['query']['includeAll']){_0x12dbdc[_0xa24c('0x46')]=[{'all':!![]}];}return db[_0xa24c('0x45')][_0xa24c('0x47')](_0x12dbdc);})['then'](function(_0x58ac8b){_0x21d2a8[_0xa24c('0x48')]=_0x58ac8b;return _0x21d2a8;})[_0xa24c('0x27')](respondWithFilteredResult(_0x152120,_0x12dbdc))[_0xa24c('0x49')](handleError(_0x152120,null));};exports[_0xa24c('0x4a')]=function(_0x3f640e,_0x1b7faf){var _0x23d1e0={'raw':![],'where':{'id':_0x3f640e['params']['id']}},_0x394d19={};_0x394d19['model']=_[_0xa24c('0x34')](db[_0xa24c('0x45')][_0xa24c('0x2f')]);_0x394d19['query']=_[_0xa24c('0x34')](_0x3f640e[_0xa24c('0x33')]);_0x394d19[_0xa24c('0x3e')]=_[_0xa24c('0x35')](_0x394d19[_0xa24c('0x4b')],_0x394d19[_0xa24c('0x33')]);_0x23d1e0[_0xa24c('0x36')]=_[_0xa24c('0x35')](_0x394d19[_0xa24c('0x4b')],qs[_0xa24c('0x37')](_0x3f640e['query'][_0xa24c('0x37')]));_0x23d1e0[_0xa24c('0x36')]=_0x23d1e0[_0xa24c('0x36')]['length']?_0x23d1e0[_0xa24c('0x36')]:_0x394d19[_0xa24c('0x4b')];if(_0x3f640e[_0xa24c('0x33')][_0xa24c('0x4c')]){_0x23d1e0[_0xa24c('0x46')]=[{'all':!![]}];}_0x23d1e0=_[_0xa24c('0x41')]({},_0x23d1e0,_0x3f640e[_0xa24c('0x44')]);return db[_0xa24c('0x45')][_0xa24c('0x4d')](_0x23d1e0)[_0xa24c('0x27')](handleEntityNotFound(_0x1b7faf,null))[_0xa24c('0x27')](respondWithResult(_0x1b7faf,null))['catch'](handleError(_0x1b7faf,null));};exports[_0xa24c('0x4e')]=function(_0x96b977,_0x42028b){return db[_0xa24c('0x45')][_0xa24c('0x4e')](_0x96b977[_0xa24c('0x4f')],{})[_0xa24c('0x27')](respondWithResult(_0x42028b,0xc9))[_0xa24c('0x49')](handleError(_0x42028b,null));};exports[_0xa24c('0x26')]=function(_0x4f56ae,_0x540da8){if(_0x4f56ae[_0xa24c('0x4f')]['id']){delete _0x4f56ae['body']['id'];}delete _0x4f56ae[_0xa24c('0x4f')][_0xa24c('0x50')];delete _0x4f56ae['body'][_0xa24c('0x51')];delete _0x4f56ae[_0xa24c('0x4f')][_0xa24c('0x52')];delete _0x4f56ae['body']['value'];return db[_0xa24c('0x45')]['find']({'where':{'id':_0x4f56ae[_0xa24c('0x53')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x540da8,null))[_0xa24c('0x27')](saveUpdates(_0x4f56ae[_0xa24c('0x4f')],null))[_0xa24c('0x27')](respondWithResult(_0x540da8,null))[_0xa24c('0x49')](handleError(_0x540da8,null));};exports[_0xa24c('0x54')]=function(_0x286d57,_0x22a0db){return db[_0xa24c('0x45')]['describe']()[_0xa24c('0x27')](respondWithResult(_0x22a0db,null))[_0xa24c('0x49')](handleError(_0x22a0db,null));};exports[_0xa24c('0x55')]=function(_0x513271,_0x5bde94,_0x487cc9){var _0x2da4f0=require('../../components/encryptor');var _0x4757ff=![];var _0x21d0fc={};if(_0x513271['query'][_0xa24c('0x42')]&&_0x513271[_0xa24c('0x33')][_0xa24c('0x42')]===_0xa24c('0x56')){_0x21d0fc[_0xa24c('0x56')]=_0x513271[_0xa24c('0x53')]['id'];}else{_0x21d0fc['id']=_0x513271[_0xa24c('0x53')]['id'];}return db[_0xa24c('0x45')]['find']({'where':_0x21d0fc,'attributes':['id',_0xa24c('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x5bde94,null))['then'](function(_0x565f0a){if(_0x565f0a){var _0x5bd2af=path['join'](config[_0xa24c('0x58')],'server/files/screen_recordings',_0x565f0a[_0xa24c('0x57')]);var _0x3fd3f9=util[_0xa24c('0x59')](_0xa24c('0x5a'),_0x5bd2af);if(fs[_0xa24c('0x5b')](_0x3fd3f9)){_0x4757ff=!![];return _0x2da4f0[_0xa24c('0x5c')](_0x3fd3f9,_0x5bd2af,config[_0xa24c('0x5d')][_0xa24c('0x5e')])[_0xa24c('0x27')](function(){return _0x565f0a;});}return _0x565f0a;}})[_0xa24c('0x27')](function(_0x303b7d){if(_0x303b7d){var _0x37dbbd=path[_0xa24c('0x5f')](config[_0xa24c('0x58')],_0xa24c('0x60'),_0x303b7d['value']);if(!fs[_0xa24c('0x5b')](_0x37dbbd)){throw new db[(_0xa24c('0x61'))]['ValidationError'](_0xa24c('0x62'));}if(_0x303b7d[_0xa24c('0x63')]){return _0x5bde94[_0xa24c('0x55')](_0x37dbbd,_0x303b7d[_0xa24c('0x63')]+path['extname'](_0x37dbbd),function(){if(_0x4757ff){fs['unlink'](_0x37dbbd);}});}else{return _0x5bde94[_0xa24c('0x55')](_0x37dbbd,function(_0x5e9631){if(_0x4757ff){fs['unlink'](_0x37dbbd);}});}}})[_0xa24c('0x49')](function(_0x2515b1){if(_0x2515b1[_0xa24c('0x64')]===_0xa24c('0x62')){_0x5bde94['status'](0x194)['send'](_0xa24c('0x65'));}else{return handleError(_0x5bde94,null);}});};exports['destroy']=function(_0x52a895,_0xfcc193){return db[_0xa24c('0x45')][_0xa24c('0x4d')]({'where':{'id':_0x52a895['params']['id']}})[_0xa24c('0x27')](function(_0x128e5b){if(_['isNil'](_0x128e5b)){throw new ReferenceError(_0xa24c('0x66'));}return _0x128e5b;})[_0xa24c('0x27')](function(_0x3096bf){var _0x4bee5c=path[_0xa24c('0x5f')](config[_0xa24c('0x58')],_0xa24c('0x60'),_0x3096bf[_0xa24c('0x57')]);logger[_0xa24c('0x67')]('cancellazione\x20fisica\x20documento\x20%s',_0x4bee5c);if(!_[_0xa24c('0x68')](_0x3096bf[_0xa24c('0x57')])&&fs[_0xa24c('0x5b')](_0x4bee5c)){logger[_0xa24c('0x67')](_0xa24c('0x69')+_0x4bee5c+_0xa24c('0x6a'));fs[_0xa24c('0x6b')](_0x4bee5c);}_0x4bee5c=_0x4bee5c+'.cypher';if(!_[_0xa24c('0x68')](_0x3096bf[_0xa24c('0x57')])&&fs['existsSync'](_0x4bee5c)){logger[_0xa24c('0x67')](_0xa24c('0x69')+_0x4bee5c+_0xa24c('0x6a'));fs[_0xa24c('0x6b')](_0x4bee5c);}return _0x3096bf;})[_0xa24c('0x27')](function(_0x3a241a){if(!_0x3a241a)throw new InternalError();return _0x3a241a[_0xa24c('0x28')]();})[_0xa24c('0x27')](function(){_0xfcc193[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();})['catch'](handleError(_0xfcc193,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index b36ba94..d5d5efe 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 _0x4cb5=['define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x5934a9,_0xae28bd){var _0x3a4758=function(_0x31586e){while(--_0x31586e){_0x5934a9['push'](_0x5934a9['shift']());}};_0x3a4758(++_0xae28bd);}(_0x4cb5,0x1c0));var _0x54cb=function(_0x1547b1,_0x4fab78){_0x1547b1=_0x1547b1-0x0;var _0x1b4fcf=_0x4cb5[_0x1547b1];return _0x1b4fcf;};'use strict';var _=require('lodash');var util=require(_0x54cb('0x0'));var logger=require(_0x54cb('0x1'))(_0x54cb('0x2'));var moment=require(_0x54cb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x54cb('0x4'));var rimraf=require(_0x54cb('0x5'));var config=require(_0x54cb('0x6'));var attributes=require(_0x54cb('0x7'));module['exports']=function(_0x48d420,_0x325f8e){return _0x48d420[_0x54cb('0x8')](_0x54cb('0x9'),attributes,{'tableName':_0x54cb('0xa'),'paranoid':![],'indexes':[{'name':_0x54cb('0xb'),'fields':[_0x54cb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ee0=['ScreenRecording','screen_recordings','interactionid','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0x2ee0,0x1a7));var _0x02ee=function(_0x1b8e16,_0x39132e){_0x1b8e16=_0x1b8e16-0x0;var _0x28eb39=_0x2ee0[_0x1b8e16];return _0x28eb39;};'use strict';var _=require(_0x02ee('0x0'));var util=require(_0x02ee('0x1'));var logger=require('../../config/logger')(_0x02ee('0x2'));var moment=require('moment');var BPromise=require(_0x02ee('0x3'));var rp=require(_0x02ee('0x4'));var fs=require('fs');var path=require(_0x02ee('0x5'));var rimraf=require(_0x02ee('0x6'));var config=require(_0x02ee('0x7'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0xa8cc52,_0x1c0c6e){return _0xa8cc52[_0x02ee('0x8')](_0x02ee('0x9'),attributes,{'tableName':_0x02ee('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x02ee('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index fc1bcd6..9ddc940 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 _0x15de=['jayson/promise','client','http','request','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x15de,0xac));var _0xe15d=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0x15de[_0x1347f8];return _0x218368;};'use strict';var _=require(_0xe15d('0x0'));var util=require(_0xe15d('0x1'));var moment=require('moment');var BPromise=require(_0xe15d('0x2'));var rs=require(_0xe15d('0x3'));var fs=require('fs');var Redis=require(_0xe15d('0x4'));var db=require(_0xe15d('0x5'))['db'];var utils=require(_0xe15d('0x6'));var logger=require(_0xe15d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe15d('0x8'));var client=jayson[_0xe15d('0x9')][_0xe15d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ecf45,_0xa7961e,_0xf91baa){return new BPromise(function(_0x55d46b,_0x14d0d9){return client[_0xe15d('0xb')](_0x1ecf45,_0xf91baa)['then'](function(_0xb855c5){logger['info'](_0xe15d('0xc'),_0xa7961e,_0xe15d('0xd'));logger[_0xe15d('0xe')](_0xe15d('0xf'),_0xa7961e,_0xe15d('0xd'),JSON[_0xe15d('0x10')](_0xb855c5));if(_0xb855c5[_0xe15d('0x11')]){if(_0xb855c5['error']['code']===0x1f4){logger[_0xe15d('0x11')](_0xe15d('0xc'),_0xa7961e,_0xb855c5[_0xe15d('0x11')][_0xe15d('0x12')]);return _0x14d0d9(_0xb855c5[_0xe15d('0x11')][_0xe15d('0x12')]);}logger['error'](_0xe15d('0xc'),_0xa7961e,_0xb855c5[_0xe15d('0x11')][_0xe15d('0x12')]);return _0x55d46b(_0xb855c5[_0xe15d('0x11')][_0xe15d('0x12')]);}else{logger[_0xe15d('0x13')](_0xe15d('0xc'),_0xa7961e,_0xe15d('0xd'));_0x55d46b(_0xb855c5['result'][_0xe15d('0x12')]);}})['catch'](function(_0x7af7f6){logger[_0xe15d('0x11')](_0xe15d('0xc'),_0xa7961e,_0x7af7f6);_0x14d0d9(_0x7af7f6);});});} \ No newline at end of file +var _0x575a=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x8b7be0,_0x2450a1){var _0x25eeef=function(_0x1e01a9){while(--_0x1e01a9){_0x8b7be0['push'](_0x8b7be0['shift']());}};_0x25eeef(++_0x2450a1);}(_0x575a,0xe7));var _0xa575=function(_0x10e840,_0x5b3935){_0x10e840=_0x10e840-0x0;var _0x405caa=_0x575a[_0x10e840];return _0x405caa;};'use strict';var _=require(_0xa575('0x0'));var util=require('util');var moment=require(_0xa575('0x1'));var BPromise=require(_0xa575('0x2'));var rs=require(_0xa575('0x3'));var fs=require('fs');var Redis=require(_0xa575('0x4'));var db=require(_0xa575('0x5'))['db'];var utils=require(_0xa575('0x6'));var logger=require(_0xa575('0x7'))(_0xa575('0x8'));var config=require('../../config/environment');var jayson=require(_0xa575('0x9'));var client=jayson[_0xa575('0xa')][_0xa575('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdb953d,_0x329cd7,_0x9f169b){return new BPromise(function(_0x21de6d,_0x37a41b){return client[_0xa575('0xc')](_0xdb953d,_0x9f169b)['then'](function(_0x41be22){logger['info'](_0xa575('0xd'),_0x329cd7,_0xa575('0xe'));logger[_0xa575('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x329cd7,_0xa575('0xe'),JSON[_0xa575('0x10')](_0x41be22));if(_0x41be22[_0xa575('0x11')]){if(_0x41be22['error'][_0xa575('0x12')]===0x1f4){logger['error'](_0xa575('0xd'),_0x329cd7,_0x41be22[_0xa575('0x11')][_0xa575('0x13')]);return _0x37a41b(_0x41be22[_0xa575('0x11')][_0xa575('0x13')]);}logger[_0xa575('0x11')](_0xa575('0xd'),_0x329cd7,_0x41be22[_0xa575('0x11')][_0xa575('0x13')]);return _0x21de6d(_0x41be22[_0xa575('0x11')][_0xa575('0x13')]);}else{logger[_0xa575('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x329cd7,_0xa575('0xe'));_0x21de6d(_0x41be22[_0xa575('0x15')]['message']);}})[_0xa575('0x16')](function(_0x4e5d3e){logger[_0xa575('0x11')](_0xa575('0xd'),_0x329cd7,_0x4e5d3e);_0x37a41b(_0x4e5d3e);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 618d1dd..635dc61 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 _0x9645=['root','server/files/images/logos/','format','logo','extname','originalname','post','single','addLogo','%s%s','logologin','/:id/logo_login','file','addLogoLogin','preferred','/:id/preferred','favicon','put','update','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','/now','getDate','get','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/favicon','diskStorage','join'];(function(_0xe59ebc,_0x1c2bc8){var _0x3c21ce=function(_0x462585){while(--_0x462585){_0xe59ebc['push'](_0xe59ebc['shift']());}};_0x3c21ce(++_0x1c2bc8);}(_0x9645,0x160));var _0x5964=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0x9645[_0xa3fadc];return _0x23ecb8;};'use strict';var multer=require('multer');var util=require(_0x5964('0x0'));var path=require('path');var timeout=require(_0x5964('0x1'));var express=require(_0x5964('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5964('0x3'));var config=require(_0x5964('0x4'));var controller=require(_0x5964('0x5'));router['get']('/',auth[_0x5964('0x6')](),controller['index']);router['get'](_0x5964('0x7'),controller[_0x5964('0x8')]);router[_0x5964('0x9')]('/:id',controller['show']);router[_0x5964('0x9')](_0x5964('0xa'),controller[_0x5964('0xb')]);router[_0x5964('0x9')]('/:id/logo_login',controller[_0x5964('0xc')]);router[_0x5964('0x9')](_0x5964('0xd'),controller[_0x5964('0xe')]);router[_0x5964('0x9')]('/:id/preferred',controller['getPreferred']);router[_0x5964('0x9')](_0x5964('0xf'),controller['getFavicon']);var upload=multer({'storage':multer[_0x5964('0x10')]({'destination':function(_0x3e2707,_0x3f30bf,_0x3c0617){_0x3c0617(null,path[_0x5964('0x11')](config[_0x5964('0x12')],_0x5964('0x13')));},'filename':function(_0x463fbf,_0x53487b,_0x3aac2c){_0x3aac2c(null,util[_0x5964('0x14')]('%s%s',_0x5964('0x15'),path[_0x5964('0x16')](_0x53487b[_0x5964('0x17')])));}})});router[_0x5964('0x18')](_0x5964('0xa'),upload[_0x5964('0x19')]('file'),controller[_0x5964('0x1a')]);var upload=multer({'storage':multer[_0x5964('0x10')]({'destination':function(_0x1c01f1,_0x54016b,_0x56f929){_0x56f929(null,path[_0x5964('0x11')](config[_0x5964('0x12')],_0x5964('0x13')));},'filename':function(_0x944005,_0x5d56c8,_0x10e180){_0x10e180(null,util[_0x5964('0x14')](_0x5964('0x1b'),_0x5964('0x1c'),path['extname'](_0x5d56c8[_0x5964('0x17')])));}})});router[_0x5964('0x18')](_0x5964('0x1d'),upload[_0x5964('0x19')](_0x5964('0x1e')),controller[_0x5964('0x1f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3860ab,_0xe92fbb,_0x4fc1ce){_0x4fc1ce(null,path[_0x5964('0x11')](config[_0x5964('0x12')],_0x5964('0x13')));},'filename':function(_0x389d7c,_0x3ca1af,_0x591d3f){_0x591d3f(null,util[_0x5964('0x14')](_0x5964('0x1b'),_0x5964('0x20'),path['extname'](_0x3ca1af[_0x5964('0x17')])));}})});router[_0x5964('0x18')](_0x5964('0x21'),upload[_0x5964('0x19')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x5964('0x10')]({'destination':function(_0x1979b2,_0x11bf00,_0xc3d98){_0xc3d98(null,path[_0x5964('0x11')](config['root'],_0x5964('0x13')));},'filename':function(_0x24fbe2,_0x2fecbe,_0x557767){_0x557767(null,util[_0x5964('0x14')](_0x5964('0x1b'),_0x5964('0x22'),path[_0x5964('0x16')](_0x2fecbe[_0x5964('0x17')])));}})});router[_0x5964('0x18')](_0x5964('0xf'),upload['single'](_0x5964('0x1e')),controller['addFavicon']);router[_0x5964('0x23')]('/:id',auth[_0x5964('0x6')](),controller[_0x5964('0x24')]);module['exports']=router; \ No newline at end of file +var _0xa9a5=['join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','addLogo','single','file','preferred','addPreferred','addFavicon','put','update','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xa9a5,0x1d9));var _0x5a9a=function(_0x15ae4a,_0x3db5fa){_0x15ae4a=_0x15ae4a-0x0;var _0x25aa72=_0xa9a5[_0x15ae4a];return _0x25aa72;};'use strict';var multer=require(_0x5a9a('0x0'));var util=require(_0x5a9a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5a9a('0x2'));var router=express['Router']();var fs_extra=require(_0x5a9a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5a9a('0x4'));var config=require(_0x5a9a('0x5'));var controller=require(_0x5a9a('0x6'));router[_0x5a9a('0x7')]('/',auth[_0x5a9a('0x8')](),controller['index']);router['get'](_0x5a9a('0x9'),controller[_0x5a9a('0xa')]);router[_0x5a9a('0x7')]('/:id',controller['show']);router[_0x5a9a('0x7')](_0x5a9a('0xb'),controller[_0x5a9a('0xc')]);router[_0x5a9a('0x7')](_0x5a9a('0xd'),controller[_0x5a9a('0xe')]);router['get']('/:id/gdpr',controller[_0x5a9a('0xf')]);router[_0x5a9a('0x7')](_0x5a9a('0x10'),controller[_0x5a9a('0x11')]);router['get'](_0x5a9a('0x12'),controller[_0x5a9a('0x13')]);var upload=multer({'storage':multer[_0x5a9a('0x14')]({'destination':function(_0x236aeb,_0x392df6,_0xeec1e8){_0xeec1e8(null,path[_0x5a9a('0x15')](config[_0x5a9a('0x16')],_0x5a9a('0x17')));},'filename':function(_0x45887a,_0x19e881,_0x56d60d){_0x56d60d(null,util[_0x5a9a('0x18')](_0x5a9a('0x19'),_0x5a9a('0x1a'),path[_0x5a9a('0x1b')](_0x19e881[_0x5a9a('0x1c')])));}})});router[_0x5a9a('0x1d')](_0x5a9a('0xb'),upload['single']('file'),controller[_0x5a9a('0x1e')]);var upload=multer({'storage':multer[_0x5a9a('0x14')]({'destination':function(_0x4b3a14,_0x200dd3,_0xc32d3a){_0xc32d3a(null,path[_0x5a9a('0x15')](config[_0x5a9a('0x16')],_0x5a9a('0x17')));},'filename':function(_0xa83700,_0x21e0cf,_0xf2e2aa){_0xf2e2aa(null,util[_0x5a9a('0x18')](_0x5a9a('0x19'),'logologin',path[_0x5a9a('0x1b')](_0x21e0cf[_0x5a9a('0x1c')])));}})});router[_0x5a9a('0x1d')]('/:id/logo_login',upload[_0x5a9a('0x1f')](_0x5a9a('0x20')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x5a9a('0x14')]({'destination':function(_0x11ad04,_0x4550a6,_0x50ee05){_0x50ee05(null,path['join'](config[_0x5a9a('0x16')],_0x5a9a('0x17')));},'filename':function(_0x357407,_0xe9b71f,_0x59faa3){_0x59faa3(null,util[_0x5a9a('0x18')](_0x5a9a('0x19'),_0x5a9a('0x21'),path[_0x5a9a('0x1b')](_0xe9b71f['originalname'])));}})});router[_0x5a9a('0x1d')](_0x5a9a('0x10'),upload[_0x5a9a('0x1f')]('file'),controller[_0x5a9a('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x424341,_0x2100ec,_0x5dcb30){_0x5dcb30(null,path['join'](config['root'],_0x5a9a('0x17')));},'filename':function(_0x3dc08c,_0x4d3429,_0x62228f){_0x62228f(null,util[_0x5a9a('0x18')](_0x5a9a('0x19'),'favicon',path[_0x5a9a('0x1b')](_0x4d3429[_0x5a9a('0x1c')])));}})});router[_0x5a9a('0x1d')](_0x5a9a('0x12'),upload['single'](_0x5a9a('0x20')),controller[_0x5a9a('0x23')]);router[_0x5a9a('0x24')]('/:id',auth[_0x5a9a('0x8')](),controller[_0x5a9a('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 6fc7aea..e054ddb 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 _0x27f3=['exports','min_internal','INTEGER','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize'];(function(_0x1b2712,_0x5e4848){var _0x5a5d7a=function(_0x361a3c){while(--_0x361a3c){_0x1b2712['push'](_0x1b2712['shift']());}};_0x5a5d7a(++_0x5e4848);}(_0x27f3,0x1e9));var _0x327f=function(_0x3b632f,_0x453380){_0x3b632f=_0x3b632f-0x0;var _0x10e788=_0x27f3[_0x3b632f];return _0x10e788;};'use strict';var Sequelize=require(_0x327f('0x0'));module[_0x327f('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x327f('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x327f('0x3')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x327f('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x327f('0x4')},'logo':{'type':Sequelize[_0x327f('0x5')]},'defaultLogo':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x327f('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x327f('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x327f('0x5')]},'turnaddr':{'type':Sequelize[_0x327f('0x5')]},'turnusername':{'type':Sequelize[_0x327f('0x5')]},'turnpassword':{'type':Sequelize[_0x327f('0x5')]},'pageTitle':{'type':Sequelize[_0x327f('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x327f('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x327f('0x5')],'defaultValue':_0x327f('0x7')},'enableEmailPreview':{'type':Sequelize[_0x327f('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x327f('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x327f('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x327f('0x5')],'defaultValue':_0x327f('0x8')},'chatTimeout':{'type':Sequelize[_0x327f('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x327f('0x5')]},'defaultPreferred':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x327f('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x327f('0x5')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x327f('0x5')]},'defaultFavicon':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x327f('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x327f('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x327f('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x327f('0x3')]},'transcribeRegion':{'type':Sequelize[_0x327f('0x5')]},'sentiment':{'type':Sequelize[_0x327f('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x327f('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x327f('0x3')]},'sentimentRegion':{'type':Sequelize[_0x327f('0x5')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x327f('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x327f('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x327f('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x327f('0x3')](0x2)[_0x327f('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x327f('0x3')](0x2)[_0x327f('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x327f('0x3')](0x2)[_0x327f('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x327f('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x327f('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x327f('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x327f('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x327f('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x327f('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x327f('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x327f('0x3')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0x327f('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x327f('0x3')],'defaultValue':0x14}}; \ No newline at end of file +var _0x184d=['alternate','UNSIGNED','exports','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x337641,_0x26ba45){var _0xcf00de=function(_0x14ca1f){while(--_0x14ca1f){_0x337641['push'](_0x337641['shift']());}};_0xcf00de(++_0x26ba45);}(_0x184d,0x1d0));var _0xd184=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x184d[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require('sequelize');module[_0xd184('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xd184('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xd184('0x2')],'defaultValue':_0xd184('0x3')},'logo':{'type':Sequelize[_0xd184('0x2')]},'defaultLogo':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xd184('0x2')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xd184('0x2')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xd184('0x2')]},'defaultPageTitle':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xd184('0x4')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xd184('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xd184('0x2')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xd184('0x4')],'defaultValue':![]},'split':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xd184('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xd184('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd184('0x5')},'chatTimeout':{'type':Sequelize[_0xd184('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xd184('0x2')]},'defaultPreferred':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xd184('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0xd184('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xd184('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xd184('0x2')]},'defaultFavicon':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xd184('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xd184('0x4')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xd184('0x4')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xd184('0x1')]},'transcribeRegion':{'type':Sequelize[_0xd184('0x2')]},'sentiment':{'type':Sequelize[_0xd184('0x4')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd184('0x2')]},'bucket':{'type':Sequelize[_0xd184('0x2')]},'googleSsoEnabled':{'type':Sequelize[_0xd184('0x4')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xd184('0x4')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xd184('0x1')](0x2)[_0xd184('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0xd184('0x6')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xd184('0x1')](0x2)[_0xd184('0x6')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xd184('0x1')](0x2)[_0xd184('0x6')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xd184('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xd184('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xd184('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xd184('0x4')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xd184('0x4')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xd184('0x1')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'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 ee2c065..f208240 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 _0xffc1=['filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','body','addLogo','file','filename','../../config/license/util','getLogo','server/files/images/logos','getLicense','logo','loginLogo','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','join','toLower','root','default','upperFirst','existsSync','ValidationError','\x20not\x20found','download','getLogoLogin','defaultLogo','default_loginLogo.svg','custom','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','Sequelize','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','send','index','map','Setting','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick'];(function(_0x2d0a55,_0x540aba){var _0x1f86f7=function(_0x30f4c0){while(--_0x30f4c0){_0x2d0a55['push'](_0x2d0a55['shift']());}};_0x1f86f7(++_0x540aba);}(_0xffc1,0x1b4));var _0x1ffc=function(_0xfa9e04,_0x309093){_0xfa9e04=_0xfa9e04-0x0;var _0x2e32cc=_0xffc1[_0xfa9e04];return _0x2e32cc;};'use strict';var emlformat=require(_0x1ffc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ffc('0x1'));var jsonpatch=require(_0x1ffc('0x2'));var rp=require(_0x1ffc('0x3'));var moment=require(_0x1ffc('0x4'));var BPromise=require(_0x1ffc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1ffc('0x6'));var sox=require(_0x1ffc('0x7'));var csv=require('to-csv');var ejs=require(_0x1ffc('0x8'));var fs=require('fs');var fs_extra=require(_0x1ffc('0x9'));var _=require(_0x1ffc('0xa'));var squel=require(_0x1ffc('0xb'));var crypto=require('crypto');var jsforce=require(_0x1ffc('0xc'));var deskjs=require(_0x1ffc('0xd'));var toCsv=require(_0x1ffc('0xe'));var querystring=require(_0x1ffc('0xf'));var Papa=require('papaparse');var Redis=require(_0x1ffc('0x10'));var authService=require(_0x1ffc('0x11'));var qs=require(_0x1ffc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ffc('0x13'));var logger=require(_0x1ffc('0x14'))(_0x1ffc('0x15'));var utils=require(_0x1ffc('0x16'));var config=require(_0x1ffc('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ffc('0x18'))['db'];var jayson=require(_0x1ffc('0x19'));var client=jayson[_0x1ffc('0x1a')][_0x1ffc('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xf17d69,_0x5f0d3a,_0x827033,_0x2b176b){return new BPromise(function(_0xd65a02,_0x598a33){var _0x45175c=_0x2b176b||client;return _0x45175c[_0x1ffc('0x1c')](_0xf17d69,_0x827033)[_0x1ffc('0x1d')](function(_0x82e415){logger[_0x1ffc('0x1e')](_0x1ffc('0x1f'),_0x5f0d3a,'request\x20sent');logger['debug'](_0x1ffc('0x20'),_0x5f0d3a,'request\x20sent',JSON[_0x1ffc('0x21')](_0x82e415));if(_0x82e415[_0x1ffc('0x22')]){if(_0x82e415['error'][_0x1ffc('0x23')]===0x1f4){logger[_0x1ffc('0x22')](_0x1ffc('0x1f'),_0x5f0d3a,_0x82e415[_0x1ffc('0x22')][_0x1ffc('0x24')]);return _0x598a33(_0x82e415[_0x1ffc('0x22')][_0x1ffc('0x24')]);}logger['error']('Setting,\x20%s,\x20%s',_0x5f0d3a,_0x82e415[_0x1ffc('0x22')]['message']);return _0xd65a02(_0x82e415[_0x1ffc('0x22')][_0x1ffc('0x24')]);}else{logger['info'](_0x1ffc('0x1f'),_0x5f0d3a,_0x1ffc('0x25'));_0xd65a02(_0x82e415[_0x1ffc('0x26')][_0x1ffc('0x24')]);}})[_0x1ffc('0x27')](function(_0x2f7bcf){logger[_0x1ffc('0x22')](_0x1ffc('0x1f'),_0x5f0d3a,_0x2f7bcf);_0x598a33(_0x2f7bcf);});});}function respondWithStatusCode(_0x5b0953,_0x536cec){_0x536cec=_0x536cec||0xcc;return function(_0x423911){if(_0x423911){return _0x5b0953[_0x1ffc('0x28')](_0x536cec);}return _0x5b0953[_0x1ffc('0x29')](_0x536cec)[_0x1ffc('0x2a')]();};}function respondWithResult(_0x34116d,_0x40309a){_0x40309a=_0x40309a||0xc8;return function(_0x34164d){if(_0x34164d){return _0x34116d[_0x1ffc('0x29')](_0x40309a)['json'](_0x34164d);}};}function respondWithFilteredResult(_0x5d2ebd,_0x25ed4b){return function(_0x50314d){if(_0x50314d){var _0x46aa4d=typeof _0x25ed4b[_0x1ffc('0x2b')]===_0x1ffc('0x2c')&&typeof _0x25ed4b['limit']==='undefined';var _0x335951=_0x50314d[_0x1ffc('0x2d')];var _0x3cb458=_0x46aa4d?0x0:_0x25ed4b[_0x1ffc('0x2b')];var _0x469783=_0x46aa4d?_0x50314d[_0x1ffc('0x2d')]:_0x25ed4b[_0x1ffc('0x2b')]+_0x25ed4b[_0x1ffc('0x2e')];var _0x2b97c8;if(_0x469783>=_0x335951){_0x469783=_0x335951;_0x2b97c8=0xc8;}else{_0x2b97c8=0xce;}_0x5d2ebd[_0x1ffc('0x29')](_0x2b97c8);return _0x5d2ebd[_0x1ffc('0x2f')](_0x1ffc('0x30'),_0x3cb458+'-'+_0x469783+'/'+_0x335951)[_0x1ffc('0x31')](_0x50314d);}return null;};}function patchUpdates(_0x5ae0c2){return function(_0x3b2243){try{jsonpatch[_0x1ffc('0x32')](_0x3b2243,_0x5ae0c2,!![]);}catch(_0x228fd7){return BPromise[_0x1ffc('0x33')](_0x228fd7);}return _0x3b2243[_0x1ffc('0x34')]();};}function saveUpdates(_0xe78613,_0x5ad206){return function(_0x2d5b3a){if(_0x2d5b3a){return _0x2d5b3a[_0x1ffc('0x35')](_0xe78613)[_0x1ffc('0x1d')](function(_0xe2db3c){return _0xe2db3c;});}return null;};}function removeEntity(_0x23c317,_0x4f9307){return function(_0x97e378){if(_0x97e378){return _0x97e378[_0x1ffc('0x36')]()['then'](function(){_0x23c317[_0x1ffc('0x29')](0xcc)[_0x1ffc('0x2a')]();});}};}function handleEntityNotFound(_0x1049a4,_0x59e758){return function(_0x4414a4){if(!_0x4414a4){_0x1049a4['sendStatus'](0x194);}return _0x4414a4;};}function handleError(_0x169f5f,_0x17fe46){_0x17fe46=_0x17fe46||0x1f4;return function(_0x1469c7){logger[_0x1ffc('0x22')](_0x1469c7[_0x1ffc('0x37')]);if(_0x1469c7['name']){delete _0x1469c7['name'];}_0x169f5f[_0x1ffc('0x29')](_0x17fe46)[_0x1ffc('0x38')](_0x1469c7);};}exports[_0x1ffc('0x39')]=function(_0x4b4e86,_0x30f51f){var _0x260923={},_0x1661c3={},_0x24d614={'count':0x0,'rows':[]};var _0x34a476=_[_0x1ffc('0x3a')](db[_0x1ffc('0x3b')][_0x1ffc('0x3c')],function(_0x5d88e9){return{'name':_0x5d88e9[_0x1ffc('0x3d')],'type':_0x5d88e9[_0x1ffc('0x3e')][_0x1ffc('0x3f')]};});_0x1661c3[_0x1ffc('0x40')]=_[_0x1ffc('0x3a')](_0x34a476,_0x1ffc('0x41'));_0x1661c3['query']=_['keys'](_0x4b4e86[_0x1ffc('0x42')]);_0x1661c3[_0x1ffc('0x43')]=_['intersection'](_0x1661c3[_0x1ffc('0x40')],_0x1661c3[_0x1ffc('0x42')]);_0x260923[_0x1ffc('0x44')]=_[_0x1ffc('0x45')](_0x1661c3[_0x1ffc('0x40')],qs[_0x1ffc('0x46')](_0x4b4e86[_0x1ffc('0x42')]['fields']));_0x260923['attributes']=_0x260923['attributes'][_0x1ffc('0x47')]?_0x260923[_0x1ffc('0x44')]:_0x1661c3[_0x1ffc('0x40')];if(!_0x4b4e86['query'][_0x1ffc('0x48')](_0x1ffc('0x49'))){_0x260923[_0x1ffc('0x2e')]=qs[_0x1ffc('0x2e')](_0x4b4e86['query'][_0x1ffc('0x2e')]);_0x260923[_0x1ffc('0x2b')]=qs[_0x1ffc('0x2b')](_0x4b4e86[_0x1ffc('0x42')][_0x1ffc('0x2b')]);}_0x260923['order']=qs[_0x1ffc('0x4a')](_0x4b4e86[_0x1ffc('0x42')][_0x1ffc('0x4a')]);_0x260923['where']=qs['filters'](_[_0x1ffc('0x4b')](_0x4b4e86[_0x1ffc('0x42')],_0x1661c3['filters']),_0x34a476);if(_0x4b4e86['query'][_0x1ffc('0x4c')]){_0x260923[_0x1ffc('0x4d')]=_['merge'](_0x260923[_0x1ffc('0x4d')],{'$or':_[_0x1ffc('0x3a')](_0x34a476,function(_0x2dc066){if(_0x2dc066[_0x1ffc('0x3e')]!==_0x1ffc('0x4e')){var _0x2da6c2={};_0x2da6c2[_0x2dc066[_0x1ffc('0x41')]]={'$like':'%'+_0x4b4e86['query']['filter']+'%'};return _0x2da6c2;}})});}_0x260923=_[_0x1ffc('0x4f')]({},_0x260923,_0x4b4e86[_0x1ffc('0x50')]);var _0x30c0b1={'where':_0x260923[_0x1ffc('0x4d')]};return db['Setting']['count'](_0x30c0b1)[_0x1ffc('0x1d')](function(_0x372dda){_0x24d614[_0x1ffc('0x2d')]=_0x372dda;if(_0x4b4e86[_0x1ffc('0x42')][_0x1ffc('0x51')]){_0x260923[_0x1ffc('0x52')]=[{'all':!![]}];}return db[_0x1ffc('0x3b')][_0x1ffc('0x53')](_0x260923);})[_0x1ffc('0x1d')](function(_0x1e1db9){_0x24d614[_0x1ffc('0x54')]=_0x1e1db9;return _0x24d614;})['then'](respondWithFilteredResult(_0x30f51f,_0x260923))['catch'](handleError(_0x30f51f,null));};exports['show']=function(_0x221301,_0x1cc6b5){var _0x55d96f={'raw':![],'where':{'id':_0x221301[_0x1ffc('0x55')]['id']}},_0x2457c1={};_0x2457c1[_0x1ffc('0x40')]=_['keys'](db[_0x1ffc('0x3b')][_0x1ffc('0x3c')]);_0x2457c1[_0x1ffc('0x42')]=_[_0x1ffc('0x56')](_0x221301['query']);_0x2457c1['filters']=_[_0x1ffc('0x45')](_0x2457c1['model'],_0x2457c1[_0x1ffc('0x42')]);_0x55d96f[_0x1ffc('0x44')]=_['intersection'](_0x2457c1[_0x1ffc('0x40')],qs[_0x1ffc('0x46')](_0x221301[_0x1ffc('0x42')][_0x1ffc('0x46')]));_0x55d96f['attributes']=_0x55d96f[_0x1ffc('0x44')][_0x1ffc('0x47')]?_0x55d96f['attributes']:_0x2457c1[_0x1ffc('0x40')];if(_0x221301[_0x1ffc('0x42')][_0x1ffc('0x51')]){_0x55d96f[_0x1ffc('0x52')]=[{'all':!![]}];}_0x55d96f=_[_0x1ffc('0x4f')]({},_0x55d96f,_0x221301[_0x1ffc('0x50')]);return db[_0x1ffc('0x3b')][_0x1ffc('0x57')](_0x55d96f)[_0x1ffc('0x1d')](handleEntityNotFound(_0x1cc6b5,null))[_0x1ffc('0x1d')](respondWithResult(_0x1cc6b5,null))[_0x1ffc('0x27')](handleError(_0x1cc6b5,null));};exports[_0x1ffc('0x35')]=function(_0x30ca47,_0x1dff62){if(_0x30ca47[_0x1ffc('0x58')]['id']){delete _0x30ca47[_0x1ffc('0x58')]['id'];}return db[_0x1ffc('0x3b')][_0x1ffc('0x57')]({'where':{'id':_0x30ca47['params']['id']}})[_0x1ffc('0x1d')](handleEntityNotFound(_0x1dff62,null))[_0x1ffc('0x1d')](saveUpdates(_0x30ca47[_0x1ffc('0x58')],null))[_0x1ffc('0x1d')](respondWithResult(_0x1dff62,null))[_0x1ffc('0x27')](handleError(_0x1dff62,null));};exports[_0x1ffc('0x59')]=function(_0x5d9879,_0x279e59,_0x219692){if(_0x5d9879[_0x1ffc('0x5a')]&&_0x5d9879[_0x1ffc('0x5a')][_0x1ffc('0x5b')]){_0x5d9879[_0x1ffc('0x58')]['logo']=_0x5d9879[_0x1ffc('0x5a')][_0x1ffc('0x5b')];}return db['Setting']['find']({'where':{'id':_0x5d9879[_0x1ffc('0x55')]['id']}})[_0x1ffc('0x1d')](handleEntityNotFound(_0x279e59,null))[_0x1ffc('0x1d')](saveUpdates(_0x5d9879[_0x1ffc('0x58')],null))[_0x1ffc('0x1d')](respondWithResult(_0x279e59,null))[_0x1ffc('0x27')](handleError(_0x279e59,null));};exports['addLogoLogin']=function(_0x896a42,_0x5ebd69,_0x3c6351){if(_0x896a42[_0x1ffc('0x5a')]&&_0x896a42[_0x1ffc('0x5a')][_0x1ffc('0x5b')]){_0x896a42[_0x1ffc('0x58')]['loginLogo']=_0x896a42['file'][_0x1ffc('0x5b')];}return db[_0x1ffc('0x3b')][_0x1ffc('0x57')]({'where':{'id':_0x896a42[_0x1ffc('0x55')]['id']}})[_0x1ffc('0x1d')](handleEntityNotFound(_0x5ebd69,null))[_0x1ffc('0x1d')](saveUpdates(_0x896a42['body'],null))[_0x1ffc('0x1d')](respondWithResult(_0x5ebd69,null))[_0x1ffc('0x27')](handleError(_0x5ebd69,null));};var utilLicense=require(_0x1ffc('0x5c'));exports[_0x1ffc('0x5d')]=function(_0x46e459,_0x5ba49f,_0x2a4682){var _0x24682e=_0x1ffc('0x5e');var _0x5614aa={'custom':![]};return utilLicense[_0x1ffc('0x5f')]()[_0x1ffc('0x1d')](function(_0x5bfc71){if(_0x5bfc71){_0x5614aa=_0x5bfc71;}return db['Setting'][_0x1ffc('0x57')]({'where':{'id':_0x46e459['params']['id']},'attributes':[_0x1ffc('0x60'),_0x1ffc('0x61'),_0x1ffc('0x62'),_0x1ffc('0x63'),'defaultLogo',_0x1ffc('0x64'),_0x1ffc('0x65'),_0x1ffc('0x66')],'raw':!![]});})['then'](handleEntityNotFound(_0x5ba49f,null))[_0x1ffc('0x1d')](function(_0x4d9e5c){if(_0x4d9e5c){var _0x2d482f=_0x4d9e5c[_0x1ffc('0x60')]&&fs['existsSync'](path[_0x1ffc('0x67')](config['root'],_0x24682e,_[_0x1ffc('0x68')](_0x4d9e5c[_0x1ffc('0x60')])))?path[_0x1ffc('0x67')](config[_0x1ffc('0x69')],_0x24682e,_[_0x1ffc('0x68')](_0x4d9e5c[_0x1ffc('0x60')])):path[_0x1ffc('0x67')](config[_0x1ffc('0x69')],_0x24682e,_[_0x1ffc('0x68')]('default_logo.svg'));var _0x24fe37=_0x1ffc('0x6a')+_[_0x1ffc('0x6b')]('logo');if(_0x4d9e5c[_0x24fe37]||!_0x5614aa['custom']){_0x2d482f=path[_0x1ffc('0x67')](config[_0x1ffc('0x69')],_0x24682e,_['toLower']('default_logo.svg'));}if(!fs[_0x1ffc('0x6c')](_0x2d482f)){throw new db['Sequelize'][(_0x1ffc('0x6d'))](_[_0x1ffc('0x6b')]('logo')+_0x1ffc('0x6e'));}return _0x5ba49f[_0x1ffc('0x6f')](_0x2d482f);}})['catch'](handleError(_0x5ba49f,null));};var utilLicense=require(_0x1ffc('0x5c'));exports[_0x1ffc('0x70')]=function(_0x4f85df,_0x50fc81,_0x53fe57){var _0x416147=_0x1ffc('0x5e');var _0x311fbb={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x785889){if(_0x785889){_0x311fbb=_0x785889;}return db[_0x1ffc('0x3b')]['find']({'where':{'id':_0x4f85df[_0x1ffc('0x55')]['id']},'attributes':[_0x1ffc('0x60'),_0x1ffc('0x61'),_0x1ffc('0x62'),_0x1ffc('0x63'),_0x1ffc('0x71'),_0x1ffc('0x64'),'defaultPreferred',_0x1ffc('0x66')],'raw':!![]});})[_0x1ffc('0x1d')](handleEntityNotFound(_0x50fc81,null))[_0x1ffc('0x1d')](function(_0x26589a){if(_0x26589a){var _0x4fcc5b=_0x26589a[_0x1ffc('0x61')]&&fs['existsSync'](path[_0x1ffc('0x67')](config[_0x1ffc('0x69')],_0x416147,_[_0x1ffc('0x68')](_0x26589a['loginLogo'])))?path['join'](config['root'],_0x416147,_[_0x1ffc('0x68')](_0x26589a[_0x1ffc('0x61')])):path[_0x1ffc('0x67')](config['root'],_0x416147,_[_0x1ffc('0x68')](_0x1ffc('0x72')));var _0x5e8bee='default'+_['upperFirst'](_0x1ffc('0x61'));if(_0x26589a[_0x5e8bee]||!_0x311fbb[_0x1ffc('0x73')]){_0x4fcc5b=path[_0x1ffc('0x67')](config[_0x1ffc('0x69')],_0x416147,_[_0x1ffc('0x68')](_0x1ffc('0x72')));}if(!fs[_0x1ffc('0x6c')](_0x4fcc5b)){throw new db['Sequelize'][(_0x1ffc('0x6d'))](_[_0x1ffc('0x6b')](_0x1ffc('0x61'))+_0x1ffc('0x6e'));}return _0x50fc81[_0x1ffc('0x6f')](_0x4fcc5b);}})[_0x1ffc('0x27')](handleError(_0x50fc81,null));};exports[_0x1ffc('0x74')]=function(_0x3343ab,_0x529da3){return db[_0x1ffc('0x3b')][_0x1ffc('0x57')]({'where':{'id':_0x3343ab['params']['id']},'attributes':[_0x1ffc('0x75')]})['then'](respondWithResult(_0x529da3,null))['catch'](handleError(_0x529da3,null));};exports[_0x1ffc('0x76')]=function(_0x47e9cc,_0x542f9a,_0x7844b0){if(_0x47e9cc[_0x1ffc('0x5a')]&&_0x47e9cc[_0x1ffc('0x5a')][_0x1ffc('0x5b')]){_0x47e9cc[_0x1ffc('0x58')]['preferred']=_0x47e9cc[_0x1ffc('0x5a')][_0x1ffc('0x5b')];}return db['Setting']['find']({'where':{'id':_0x47e9cc[_0x1ffc('0x55')]['id']}})[_0x1ffc('0x1d')](handleEntityNotFound(_0x542f9a,null))[_0x1ffc('0x1d')](saveUpdates(_0x47e9cc[_0x1ffc('0x58')],null))[_0x1ffc('0x1d')](respondWithResult(_0x542f9a,null))[_0x1ffc('0x27')](handleError(_0x542f9a,null));};var utilLicense=require('../../config/license/util');exports[_0x1ffc('0x77')]=function(_0x34dd43,_0x20ef67,_0x21b38a){var _0x20b0dc='server/files/images/logos';var _0x344f36={'custom':![]};return utilLicense[_0x1ffc('0x5f')]()['then'](function(_0x4516b5){if(_0x4516b5){_0x344f36=_0x4516b5;}return db['Setting'][_0x1ffc('0x57')]({'where':{'id':_0x34dd43[_0x1ffc('0x55')]['id']},'attributes':[_0x1ffc('0x60'),'loginLogo',_0x1ffc('0x62'),'favicon','defaultLogo',_0x1ffc('0x64'),'defaultPreferred',_0x1ffc('0x66')],'raw':!![]});})['then'](handleEntityNotFound(_0x20ef67,null))[_0x1ffc('0x1d')](function(_0x5eb6f2){if(_0x5eb6f2){var _0x372796=_0x5eb6f2[_0x1ffc('0x62')]&&fs[_0x1ffc('0x6c')](path[_0x1ffc('0x67')](config['root'],_0x20b0dc,_[_0x1ffc('0x68')](_0x5eb6f2[_0x1ffc('0x62')])))?path[_0x1ffc('0x67')](config[_0x1ffc('0x69')],_0x20b0dc,_['toLower'](_0x5eb6f2[_0x1ffc('0x62')])):path[_0x1ffc('0x67')](config[_0x1ffc('0x69')],_0x20b0dc,_[_0x1ffc('0x68')](_0x1ffc('0x78')));var _0x219201='default'+_[_0x1ffc('0x6b')](_0x1ffc('0x62'));if(_0x5eb6f2[_0x219201]||!_0x344f36[_0x1ffc('0x73')]||!_0x344f36[_0x1ffc('0x62')]){_0x372796=path[_0x1ffc('0x67')](config[_0x1ffc('0x69')],_0x20b0dc,_[_0x1ffc('0x68')]('default_preferred.png'));}if(!fs[_0x1ffc('0x6c')](_0x372796)){throw new db[(_0x1ffc('0x79'))][(_0x1ffc('0x6d'))](_[_0x1ffc('0x6b')](_0x1ffc('0x62'))+_0x1ffc('0x6e'));}return _0x20ef67['download'](_0x372796);}})[_0x1ffc('0x27')](handleError(_0x20ef67,null));};exports['addFavicon']=function(_0x348205,_0x5aa45f,_0x506e0f){if(_0x348205['file']&&_0x348205[_0x1ffc('0x5a')][_0x1ffc('0x5b')]){_0x348205[_0x1ffc('0x58')][_0x1ffc('0x63')]=_0x348205['file']['filename'];}return db[_0x1ffc('0x3b')][_0x1ffc('0x57')]({'where':{'id':_0x348205['params']['id']}})[_0x1ffc('0x1d')](handleEntityNotFound(_0x5aa45f,null))[_0x1ffc('0x1d')](saveUpdates(_0x348205['body'],null))[_0x1ffc('0x1d')](respondWithResult(_0x5aa45f,null))[_0x1ffc('0x27')](handleError(_0x5aa45f,null));};var utilLicense=require(_0x1ffc('0x5c'));exports['getFavicon']=function(_0xef8386,_0x197ea0,_0x2059c5){var _0x456426='server/files/images/logos';var _0x49f657={'custom':![]};return utilLicense['getLicense']()[_0x1ffc('0x1d')](function(_0x52035b){if(_0x52035b){_0x49f657=_0x52035b;}return db['Setting'][_0x1ffc('0x57')]({'where':{'id':_0xef8386['params']['id']},'attributes':[_0x1ffc('0x60'),_0x1ffc('0x61'),_0x1ffc('0x62'),_0x1ffc('0x63'),_0x1ffc('0x71'),'defaultLoginLogo','defaultPreferred',_0x1ffc('0x66')],'raw':!![]});})[_0x1ffc('0x1d')](handleEntityNotFound(_0x197ea0,null))[_0x1ffc('0x1d')](function(_0x2c2094){if(_0x2c2094){var _0x31cb06=_0x2c2094[_0x1ffc('0x63')]&&fs['existsSync'](path[_0x1ffc('0x67')](config[_0x1ffc('0x69')],_0x456426,_[_0x1ffc('0x68')](_0x2c2094[_0x1ffc('0x63')])))?path['join'](config[_0x1ffc('0x69')],_0x456426,_[_0x1ffc('0x68')](_0x2c2094[_0x1ffc('0x63')])):path['join'](config[_0x1ffc('0x69')],_0x456426,_[_0x1ffc('0x68')](_0x1ffc('0x7a')));var _0x3cda17='default'+_[_0x1ffc('0x6b')](_0x1ffc('0x63'));if(_0x2c2094[_0x3cda17]||!_0x49f657[_0x1ffc('0x73')]){_0x31cb06=path[_0x1ffc('0x67')](config[_0x1ffc('0x69')],_0x456426,_[_0x1ffc('0x68')](_0x1ffc('0x7a')));}if(!fs[_0x1ffc('0x6c')](_0x31cb06)){throw new db[(_0x1ffc('0x79'))][(_0x1ffc('0x6d'))](_[_0x1ffc('0x6b')]('favicon')+'\x20not\x20found');}return _0x197ea0[_0x1ffc('0x6f')](_0x31cb06);}})[_0x1ffc('0x27')](handleError(_0x197ea0,null));};exports[_0x1ffc('0x7b')]=function(_0x3146c4,_0x636426){var _0x32f534={'offset':moment()[_0x1ffc('0x7c')]()};_0x32f534[_0x1ffc('0x7d')]=moment()['utcOffset'](_0x32f534[_0x1ffc('0x2b')])[_0x1ffc('0x7e')](_0x1ffc('0x7f'));return _0x636426['status'](0xc8)['send'](_0x32f534);}; \ No newline at end of file +var _0xb223=['options','includeAll','rows','catch','find','body','params','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','getLicense','logo','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','root','toLower','join','default_logo.svg','default','existsSync','Sequelize','upperFirst','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.svg','custom','ValidationError','securePassword','addPreferred','getPreferred','defaultLogo','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','where','pick','filter','VIRTUAL','merge'];(function(_0x24655b,_0x347615){var _0x3b0ee0=function(_0x57c537){while(--_0x57c537){_0x24655b['push'](_0x24655b['shift']());}};_0x3b0ee0(++_0x347615);}(_0xb223,0x194));var _0x3b22=function(_0x81696c,_0x57ce72){_0x81696c=_0x81696c-0x0;var _0x2f7233=_0xb223[_0x81696c];return _0x2f7233;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b22('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3b22('0x1'));var moment=require(_0x3b22('0x2'));var BPromise=require(_0x3b22('0x3'));var Mustache=require(_0x3b22('0x4'));var util=require(_0x3b22('0x5'));var path=require('path');var sox=require(_0x3b22('0x6'));var csv=require(_0x3b22('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b22('0x8'));var _=require(_0x3b22('0x9'));var squel=require(_0x3b22('0xa'));var crypto=require(_0x3b22('0xb'));var jsforce=require(_0x3b22('0xc'));var deskjs=require(_0x3b22('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3b22('0xe'));var Papa=require(_0x3b22('0xf'));var Redis=require(_0x3b22('0x10'));var authService=require(_0x3b22('0x11'));var qs=require(_0x3b22('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3b22('0x13'));var utils=require(_0x3b22('0x14'));var config=require(_0x3b22('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b22('0x16'))['db'];var jayson=require(_0x3b22('0x17'));var client=jayson[_0x3b22('0x18')][_0x3b22('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x58e2c0,_0x4ea4a1,_0x273c50,_0x7a4f85){return new BPromise(function(_0x185aba,_0x3495b9){var _0x4501be=_0x7a4f85||client;return _0x4501be['request'](_0x58e2c0,_0x273c50)['then'](function(_0x35ae87){logger[_0x3b22('0x1a')](_0x3b22('0x1b'),_0x4ea4a1,_0x3b22('0x1c'));logger[_0x3b22('0x1d')](_0x3b22('0x1e'),_0x4ea4a1,_0x3b22('0x1c'),JSON['stringify'](_0x35ae87));if(_0x35ae87[_0x3b22('0x1f')]){if(_0x35ae87[_0x3b22('0x1f')]['code']===0x1f4){logger[_0x3b22('0x1f')](_0x3b22('0x1b'),_0x4ea4a1,_0x35ae87[_0x3b22('0x1f')]['message']);return _0x3495b9(_0x35ae87[_0x3b22('0x1f')][_0x3b22('0x20')]);}logger['error'](_0x3b22('0x1b'),_0x4ea4a1,_0x35ae87[_0x3b22('0x1f')][_0x3b22('0x20')]);return _0x185aba(_0x35ae87[_0x3b22('0x1f')]['message']);}else{logger['info'](_0x3b22('0x1b'),_0x4ea4a1,_0x3b22('0x1c'));_0x185aba(_0x35ae87[_0x3b22('0x21')][_0x3b22('0x20')]);}})['catch'](function(_0x32e767){logger[_0x3b22('0x1f')](_0x3b22('0x1b'),_0x4ea4a1,_0x32e767);_0x3495b9(_0x32e767);});});}function respondWithStatusCode(_0x2a3bff,_0x4e0c86){_0x4e0c86=_0x4e0c86||0xcc;return function(_0x28a284){if(_0x28a284){return _0x2a3bff[_0x3b22('0x22')](_0x4e0c86);}return _0x2a3bff[_0x3b22('0x23')](_0x4e0c86)[_0x3b22('0x24')]();};}function respondWithResult(_0x53d9c6,_0x30a949){_0x30a949=_0x30a949||0xc8;return function(_0x1ac4e8){if(_0x1ac4e8){return _0x53d9c6[_0x3b22('0x23')](_0x30a949)[_0x3b22('0x25')](_0x1ac4e8);}};}function respondWithFilteredResult(_0x4bd052,_0x2705f0){return function(_0x3b87de){if(_0x3b87de){var _0x151410=typeof _0x2705f0[_0x3b22('0x26')]===_0x3b22('0x27')&&typeof _0x2705f0[_0x3b22('0x28')]===_0x3b22('0x27');var _0x377d74=_0x3b87de[_0x3b22('0x29')];var _0x17260d=_0x151410?0x0:_0x2705f0[_0x3b22('0x26')];var _0x21aaaf=_0x151410?_0x3b87de[_0x3b22('0x29')]:_0x2705f0['offset']+_0x2705f0[_0x3b22('0x28')];var _0x40a6d3;if(_0x21aaaf>=_0x377d74){_0x21aaaf=_0x377d74;_0x40a6d3=0xc8;}else{_0x40a6d3=0xce;}_0x4bd052[_0x3b22('0x23')](_0x40a6d3);return _0x4bd052['set'](_0x3b22('0x2a'),_0x17260d+'-'+_0x21aaaf+'/'+_0x377d74)['json'](_0x3b87de);}return null;};}function patchUpdates(_0x3775ea){return function(_0x72a0c1){try{jsonpatch[_0x3b22('0x2b')](_0x72a0c1,_0x3775ea,!![]);}catch(_0x4e509b){return BPromise[_0x3b22('0x2c')](_0x4e509b);}return _0x72a0c1['save']();};}function saveUpdates(_0x4d370f,_0x43d051){return function(_0x129dca){if(_0x129dca){return _0x129dca[_0x3b22('0x2d')](_0x4d370f)[_0x3b22('0x2e')](function(_0x33ae05){return _0x33ae05;});}return null;};}function removeEntity(_0x3101cb,_0x353554){return function(_0x23cef4){if(_0x23cef4){return _0x23cef4[_0x3b22('0x2f')]()[_0x3b22('0x2e')](function(){_0x3101cb['status'](0xcc)[_0x3b22('0x24')]();});}};}function handleEntityNotFound(_0x342e3f,_0xac56ee){return function(_0x4a919f){if(!_0x4a919f){_0x342e3f[_0x3b22('0x22')](0x194);}return _0x4a919f;};}function handleError(_0x14600f,_0x26d70a){_0x26d70a=_0x26d70a||0x1f4;return function(_0x2a129f){logger['error'](_0x2a129f[_0x3b22('0x30')]);if(_0x2a129f[_0x3b22('0x31')]){delete _0x2a129f[_0x3b22('0x31')];}_0x14600f[_0x3b22('0x23')](_0x26d70a)[_0x3b22('0x32')](_0x2a129f);};}exports[_0x3b22('0x33')]=function(_0x5a7fc4,_0x218147){var _0x281c5c={},_0x2d6a61={},_0x56dde3={'count':0x0,'rows':[]};var _0x382f3a=_[_0x3b22('0x34')](db[_0x3b22('0x35')][_0x3b22('0x36')],function(_0x429864){return{'name':_0x429864[_0x3b22('0x37')],'type':_0x429864[_0x3b22('0x38')][_0x3b22('0x39')]};});_0x2d6a61[_0x3b22('0x3a')]=_[_0x3b22('0x34')](_0x382f3a,_0x3b22('0x31'));_0x2d6a61[_0x3b22('0x3b')]=_[_0x3b22('0x3c')](_0x5a7fc4[_0x3b22('0x3b')]);_0x2d6a61[_0x3b22('0x3d')]=_[_0x3b22('0x3e')](_0x2d6a61[_0x3b22('0x3a')],_0x2d6a61[_0x3b22('0x3b')]);_0x281c5c[_0x3b22('0x3f')]=_[_0x3b22('0x3e')](_0x2d6a61[_0x3b22('0x3a')],qs[_0x3b22('0x40')](_0x5a7fc4[_0x3b22('0x3b')][_0x3b22('0x40')]));_0x281c5c[_0x3b22('0x3f')]=_0x281c5c[_0x3b22('0x3f')][_0x3b22('0x41')]?_0x281c5c['attributes']:_0x2d6a61['model'];if(!_0x5a7fc4[_0x3b22('0x3b')]['hasOwnProperty']('nolimit')){_0x281c5c[_0x3b22('0x28')]=qs[_0x3b22('0x28')](_0x5a7fc4[_0x3b22('0x3b')][_0x3b22('0x28')]);_0x281c5c[_0x3b22('0x26')]=qs[_0x3b22('0x26')](_0x5a7fc4['query'][_0x3b22('0x26')]);}_0x281c5c[_0x3b22('0x42')]=qs['sort'](_0x5a7fc4[_0x3b22('0x3b')]['sort']);_0x281c5c[_0x3b22('0x43')]=qs['filters'](_[_0x3b22('0x44')](_0x5a7fc4[_0x3b22('0x3b')],_0x2d6a61['filters']),_0x382f3a);if(_0x5a7fc4[_0x3b22('0x3b')][_0x3b22('0x45')]){_0x281c5c[_0x3b22('0x43')]=_['merge'](_0x281c5c[_0x3b22('0x43')],{'$or':_['map'](_0x382f3a,function(_0x410d6d){if(_0x410d6d['type']!==_0x3b22('0x46')){var _0x21549f={};_0x21549f[_0x410d6d['name']]={'$like':'%'+_0x5a7fc4[_0x3b22('0x3b')][_0x3b22('0x45')]+'%'};return _0x21549f;}})});}_0x281c5c=_[_0x3b22('0x47')]({},_0x281c5c,_0x5a7fc4[_0x3b22('0x48')]);var _0xffff1={'where':_0x281c5c[_0x3b22('0x43')]};return db[_0x3b22('0x35')][_0x3b22('0x29')](_0xffff1)[_0x3b22('0x2e')](function(_0x1aeb00){_0x56dde3[_0x3b22('0x29')]=_0x1aeb00;if(_0x5a7fc4[_0x3b22('0x3b')][_0x3b22('0x49')]){_0x281c5c['include']=[{'all':!![]}];}return db[_0x3b22('0x35')]['findAll'](_0x281c5c);})['then'](function(_0xcf11b8){_0x56dde3[_0x3b22('0x4a')]=_0xcf11b8;return _0x56dde3;})['then'](respondWithFilteredResult(_0x218147,_0x281c5c))[_0x3b22('0x4b')](handleError(_0x218147,null));};exports['show']=function(_0x51a618,_0x503df6){var _0x45c4fb={'raw':![],'where':{'id':_0x51a618['params']['id']}},_0x55e02a={};_0x55e02a[_0x3b22('0x3a')]=_[_0x3b22('0x3c')](db[_0x3b22('0x35')][_0x3b22('0x36')]);_0x55e02a['query']=_[_0x3b22('0x3c')](_0x51a618[_0x3b22('0x3b')]);_0x55e02a['filters']=_[_0x3b22('0x3e')](_0x55e02a['model'],_0x55e02a[_0x3b22('0x3b')]);_0x45c4fb[_0x3b22('0x3f')]=_['intersection'](_0x55e02a[_0x3b22('0x3a')],qs[_0x3b22('0x40')](_0x51a618[_0x3b22('0x3b')][_0x3b22('0x40')]));_0x45c4fb['attributes']=_0x45c4fb[_0x3b22('0x3f')][_0x3b22('0x41')]?_0x45c4fb[_0x3b22('0x3f')]:_0x55e02a[_0x3b22('0x3a')];if(_0x51a618['query'][_0x3b22('0x49')]){_0x45c4fb['include']=[{'all':!![]}];}_0x45c4fb=_[_0x3b22('0x47')]({},_0x45c4fb,_0x51a618[_0x3b22('0x48')]);return db[_0x3b22('0x35')][_0x3b22('0x4c')](_0x45c4fb)['then'](handleEntityNotFound(_0x503df6,null))[_0x3b22('0x2e')](respondWithResult(_0x503df6,null))[_0x3b22('0x4b')](handleError(_0x503df6,null));};exports[_0x3b22('0x2d')]=function(_0x20a5c3,_0xbb15f2){if(_0x20a5c3[_0x3b22('0x4d')]['id']){delete _0x20a5c3[_0x3b22('0x4d')]['id'];}return db['Setting']['find']({'where':{'id':_0x20a5c3[_0x3b22('0x4e')]['id']}})['then'](handleEntityNotFound(_0xbb15f2,null))[_0x3b22('0x2e')](saveUpdates(_0x20a5c3['body'],null))[_0x3b22('0x2e')](respondWithResult(_0xbb15f2,null))[_0x3b22('0x4b')](handleError(_0xbb15f2,null));};exports['addLogo']=function(_0x3f5e9e,_0x30615e,_0x15c788){if(_0x3f5e9e[_0x3b22('0x4f')]&&_0x3f5e9e['file'][_0x3b22('0x50')]){_0x3f5e9e[_0x3b22('0x4d')]['logo']=_0x3f5e9e[_0x3b22('0x4f')][_0x3b22('0x50')];}return db[_0x3b22('0x35')][_0x3b22('0x4c')]({'where':{'id':_0x3f5e9e[_0x3b22('0x4e')]['id']}})[_0x3b22('0x2e')](handleEntityNotFound(_0x30615e,null))['then'](saveUpdates(_0x3f5e9e[_0x3b22('0x4d')],null))[_0x3b22('0x2e')](respondWithResult(_0x30615e,null))[_0x3b22('0x4b')](handleError(_0x30615e,null));};exports[_0x3b22('0x51')]=function(_0x1d381c,_0x3cbc3a,_0x3b0fd3){if(_0x1d381c[_0x3b22('0x4f')]&&_0x1d381c['file']['filename']){_0x1d381c[_0x3b22('0x4d')][_0x3b22('0x52')]=_0x1d381c[_0x3b22('0x4f')][_0x3b22('0x50')];}return db['Setting'][_0x3b22('0x4c')]({'where':{'id':_0x1d381c[_0x3b22('0x4e')]['id']}})[_0x3b22('0x2e')](handleEntityNotFound(_0x3cbc3a,null))['then'](saveUpdates(_0x1d381c[_0x3b22('0x4d')],null))[_0x3b22('0x2e')](respondWithResult(_0x3cbc3a,null))['catch'](handleError(_0x3cbc3a,null));};var utilLicense=require(_0x3b22('0x53'));exports[_0x3b22('0x54')]=function(_0x4ae2bf,_0x11ce75,_0x2de5d6){var _0x2cc01c='server/files/images/logos';var _0x490392={'custom':![]};return utilLicense[_0x3b22('0x55')]()[_0x3b22('0x2e')](function(_0x20cf72){if(_0x20cf72){_0x490392=_0x20cf72;}return db['Setting'][_0x3b22('0x4c')]({'where':{'id':_0x4ae2bf[_0x3b22('0x4e')]['id']},'attributes':[_0x3b22('0x56'),'loginLogo',_0x3b22('0x57'),_0x3b22('0x58'),'defaultLogo',_0x3b22('0x59'),_0x3b22('0x5a'),_0x3b22('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x11ce75,null))[_0x3b22('0x2e')](function(_0x417958){if(_0x417958){var _0xe331f9=_0x417958[_0x3b22('0x56')]&&fs['existsSync'](path['join'](config[_0x3b22('0x5c')],_0x2cc01c,_[_0x3b22('0x5d')](_0x417958[_0x3b22('0x56')])))?path[_0x3b22('0x5e')](config[_0x3b22('0x5c')],_0x2cc01c,_['toLower'](_0x417958[_0x3b22('0x56')])):path['join'](config[_0x3b22('0x5c')],_0x2cc01c,_[_0x3b22('0x5d')](_0x3b22('0x5f')));var _0x4c8414=_0x3b22('0x60')+_['upperFirst'](_0x3b22('0x56'));if(_0x417958[_0x4c8414]||!_0x490392['custom']){_0xe331f9=path[_0x3b22('0x5e')](config[_0x3b22('0x5c')],_0x2cc01c,_[_0x3b22('0x5d')]('default_logo.svg'));}if(!fs[_0x3b22('0x61')](_0xe331f9)){throw new db[(_0x3b22('0x62'))]['ValidationError'](_[_0x3b22('0x63')](_0x3b22('0x56'))+_0x3b22('0x64'));}return _0x11ce75[_0x3b22('0x65')](_0xe331f9);}})[_0x3b22('0x4b')](handleError(_0x11ce75,null));};var utilLicense=require('../../config/license/util');exports[_0x3b22('0x66')]=function(_0x236964,_0x4476df,_0x65f98f){var _0x53ee5=_0x3b22('0x67');var _0x7f06d8={'custom':![]};return utilLicense[_0x3b22('0x55')]()[_0x3b22('0x2e')](function(_0x221c52){if(_0x221c52){_0x7f06d8=_0x221c52;}return db['Setting'][_0x3b22('0x4c')]({'where':{'id':_0x236964['params']['id']},'attributes':['logo',_0x3b22('0x52'),'preferred','favicon','defaultLogo','defaultLoginLogo',_0x3b22('0x5a'),_0x3b22('0x5b')],'raw':!![]});})[_0x3b22('0x2e')](handleEntityNotFound(_0x4476df,null))[_0x3b22('0x2e')](function(_0x28fbff){if(_0x28fbff){var _0x317164=_0x28fbff[_0x3b22('0x52')]&&fs['existsSync'](path[_0x3b22('0x5e')](config[_0x3b22('0x5c')],_0x53ee5,_[_0x3b22('0x5d')](_0x28fbff[_0x3b22('0x52')])))?path['join'](config[_0x3b22('0x5c')],_0x53ee5,_[_0x3b22('0x5d')](_0x28fbff['loginLogo'])):path[_0x3b22('0x5e')](config[_0x3b22('0x5c')],_0x53ee5,_[_0x3b22('0x5d')](_0x3b22('0x68')));var _0x4ffb90=_0x3b22('0x60')+_[_0x3b22('0x63')](_0x3b22('0x52'));if(_0x28fbff[_0x4ffb90]||!_0x7f06d8[_0x3b22('0x69')]){_0x317164=path[_0x3b22('0x5e')](config[_0x3b22('0x5c')],_0x53ee5,_[_0x3b22('0x5d')](_0x3b22('0x68')));}if(!fs['existsSync'](_0x317164)){throw new db[(_0x3b22('0x62'))][(_0x3b22('0x6a'))](_['upperFirst']('loginLogo')+_0x3b22('0x64'));}return _0x4476df[_0x3b22('0x65')](_0x317164);}})[_0x3b22('0x4b')](handleError(_0x4476df,null));};exports['gdpr']=function(_0x32d6dd,_0x53475a){return db[_0x3b22('0x35')][_0x3b22('0x4c')]({'where':{'id':_0x32d6dd[_0x3b22('0x4e')]['id']},'attributes':[_0x3b22('0x6b')]})[_0x3b22('0x2e')](respondWithResult(_0x53475a,null))['catch'](handleError(_0x53475a,null));};exports[_0x3b22('0x6c')]=function(_0xb660f7,_0x1025fd,_0x2f1355){if(_0xb660f7[_0x3b22('0x4f')]&&_0xb660f7[_0x3b22('0x4f')]['filename']){_0xb660f7['body'][_0x3b22('0x57')]=_0xb660f7['file'][_0x3b22('0x50')];}return db[_0x3b22('0x35')][_0x3b22('0x4c')]({'where':{'id':_0xb660f7[_0x3b22('0x4e')]['id']}})[_0x3b22('0x2e')](handleEntityNotFound(_0x1025fd,null))[_0x3b22('0x2e')](saveUpdates(_0xb660f7[_0x3b22('0x4d')],null))['then'](respondWithResult(_0x1025fd,null))[_0x3b22('0x4b')](handleError(_0x1025fd,null));};var utilLicense=require(_0x3b22('0x53'));exports[_0x3b22('0x6d')]=function(_0xb534e9,_0x539192,_0x403938){var _0x5462b3=_0x3b22('0x67');var _0x1f22e6={'custom':![]};return utilLicense['getLicense']()[_0x3b22('0x2e')](function(_0x4ecaca){if(_0x4ecaca){_0x1f22e6=_0x4ecaca;}return db[_0x3b22('0x35')]['find']({'where':{'id':_0xb534e9[_0x3b22('0x4e')]['id']},'attributes':['logo','loginLogo',_0x3b22('0x57'),_0x3b22('0x58'),_0x3b22('0x6e'),'defaultLoginLogo',_0x3b22('0x5a'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x539192,null))[_0x3b22('0x2e')](function(_0x19eb92){if(_0x19eb92){var _0x56796b=_0x19eb92[_0x3b22('0x57')]&&fs[_0x3b22('0x61')](path['join'](config['root'],_0x5462b3,_[_0x3b22('0x5d')](_0x19eb92[_0x3b22('0x57')])))?path['join'](config[_0x3b22('0x5c')],_0x5462b3,_[_0x3b22('0x5d')](_0x19eb92['preferred'])):path['join'](config[_0x3b22('0x5c')],_0x5462b3,_[_0x3b22('0x5d')](_0x3b22('0x6f')));var _0x2d4313=_0x3b22('0x60')+_[_0x3b22('0x63')](_0x3b22('0x57'));if(_0x19eb92[_0x2d4313]||!_0x1f22e6[_0x3b22('0x69')]||!_0x1f22e6['preferred']){_0x56796b=path[_0x3b22('0x5e')](config[_0x3b22('0x5c')],_0x5462b3,_[_0x3b22('0x5d')](_0x3b22('0x6f')));}if(!fs['existsSync'](_0x56796b)){throw new db['Sequelize'][(_0x3b22('0x6a'))](_[_0x3b22('0x63')]('preferred')+_0x3b22('0x64'));}return _0x539192[_0x3b22('0x65')](_0x56796b);}})[_0x3b22('0x4b')](handleError(_0x539192,null));};exports[_0x3b22('0x70')]=function(_0x33d4dd,_0x386b89,_0x2c5231){if(_0x33d4dd[_0x3b22('0x4f')]&&_0x33d4dd[_0x3b22('0x4f')]['filename']){_0x33d4dd[_0x3b22('0x4d')][_0x3b22('0x58')]=_0x33d4dd[_0x3b22('0x4f')]['filename'];}return db[_0x3b22('0x35')][_0x3b22('0x4c')]({'where':{'id':_0x33d4dd[_0x3b22('0x4e')]['id']}})[_0x3b22('0x2e')](handleEntityNotFound(_0x386b89,null))[_0x3b22('0x2e')](saveUpdates(_0x33d4dd['body'],null))[_0x3b22('0x2e')](respondWithResult(_0x386b89,null))[_0x3b22('0x4b')](handleError(_0x386b89,null));};var utilLicense=require(_0x3b22('0x53'));exports[_0x3b22('0x71')]=function(_0x351ee4,_0x3812e7,_0x4ccf59){var _0x1f5241=_0x3b22('0x67');var _0x5bc3d8={'custom':![]};return utilLicense['getLicense']()[_0x3b22('0x2e')](function(_0x3c35a8){if(_0x3c35a8){_0x5bc3d8=_0x3c35a8;}return db[_0x3b22('0x35')]['find']({'where':{'id':_0x351ee4[_0x3b22('0x4e')]['id']},'attributes':[_0x3b22('0x56'),_0x3b22('0x52'),_0x3b22('0x57'),_0x3b22('0x58'),_0x3b22('0x6e'),_0x3b22('0x59'),_0x3b22('0x5a'),_0x3b22('0x5b')],'raw':!![]});})[_0x3b22('0x2e')](handleEntityNotFound(_0x3812e7,null))[_0x3b22('0x2e')](function(_0x57879a){if(_0x57879a){var _0x4122eb=_0x57879a[_0x3b22('0x58')]&&fs[_0x3b22('0x61')](path[_0x3b22('0x5e')](config[_0x3b22('0x5c')],_0x1f5241,_[_0x3b22('0x5d')](_0x57879a['favicon'])))?path['join'](config['root'],_0x1f5241,_['toLower'](_0x57879a[_0x3b22('0x58')])):path[_0x3b22('0x5e')](config[_0x3b22('0x5c')],_0x1f5241,_['toLower'](_0x3b22('0x72')));var _0x405c70=_0x3b22('0x60')+_[_0x3b22('0x63')](_0x3b22('0x58'));if(_0x57879a[_0x405c70]||!_0x5bc3d8[_0x3b22('0x69')]){_0x4122eb=path[_0x3b22('0x5e')](config[_0x3b22('0x5c')],_0x1f5241,_[_0x3b22('0x5d')](_0x3b22('0x72')));}if(!fs[_0x3b22('0x61')](_0x4122eb)){throw new db[(_0x3b22('0x62'))][(_0x3b22('0x6a'))](_[_0x3b22('0x63')](_0x3b22('0x58'))+'\x20not\x20found');}return _0x3812e7[_0x3b22('0x65')](_0x4122eb);}})['catch'](handleError(_0x3812e7,null));};exports['getDate']=function(_0x185562,_0x37b9bc){var _0x3a98db={'offset':moment()[_0x3b22('0x73')]()};_0x3a98db[_0x3b22('0x74')]=moment()[_0x3b22('0x73')](_0x3a98db[_0x3b22('0x26')])[_0x3b22('0x75')](_0x3b22('0x76'));return _0x37b9bc[_0x3b22('0x23')](0xc8)[_0x3b22('0x32')](_0x3a98db);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 224b3ac..086d91f 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x38fb8b,_0x70dd0a){var _0x1ec681=function(_0x58f130){while(--_0x58f130){_0x38fb8b['push'](_0x38fb8b['shift']());}};_0x1ec681(++_0x70dd0a);}(_0x55ca,0x126));var _0xa55c=function(_0x3c1304,_0x219ae5){_0x3c1304=_0x3c1304-0x0;var _0x11b071=_0x55ca[_0x3c1304];return _0x11b071;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x4e2f07,_0x4a787c){var _0x33d6f2=function(_0x40837a){while(--_0x40837a){_0x4e2f07['push'](_0x4e2f07['shift']());}};_0x33d6f2(++_0x4a787c);}(_0xedd9,0xfc));var _0x9edd=function(_0x3149f4,_0x4e9c3f){_0x3149f4=_0x3149f4-0x0;var _0x3c762c=_0xedd9[_0x3149f4];return _0x3c762c;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index e73ad86..4d309f3 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 _0xb075=['attributes','model','ShowSetting','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','code','message','error','result','catch','Setting','find','options','raw','where','include','map'];(function(_0x321c51,_0x5268f9){var _0x36fd8e=function(_0x181a1e){while(--_0x181a1e){_0x321c51['push'](_0x321c51['shift']());}};_0x36fd8e(++_0x5268f9);}(_0xb075,0x16b));var _0x5b07=function(_0x4fc1af,_0x325903){_0x4fc1af=_0x4fc1af-0x0;var _0x47cadb=_0xb075[_0x4fc1af];return _0x47cadb;};'use strict';var _=require(_0x5b07('0x0'));var util=require(_0x5b07('0x1'));var moment=require(_0x5b07('0x2'));var BPromise=require('bluebird');var rs=require(_0x5b07('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b07('0x4'));var logger=require(_0x5b07('0x5'))('rpc');var config=require(_0x5b07('0x6'));var jayson=require(_0x5b07('0x7'));var client=jayson[_0x5b07('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x118e13,_0x3f9877,_0x5b8f6){return new BPromise(function(_0x183ffb,_0x411348){return client[_0x5b07('0x9')](_0x118e13,_0x5b8f6)['then'](function(_0x5303d4){logger[_0x5b07('0xa')](_0x5b07('0xb'),_0x3f9877,_0x5b07('0xc'));logger[_0x5b07('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x3f9877,_0x5b07('0xc'),JSON[_0x5b07('0xe')](_0x5303d4));if(_0x5303d4['error']){if(_0x5303d4['error'][_0x5b07('0xf')]===0x1f4){logger['error'](_0x5b07('0xb'),_0x3f9877,_0x5303d4['error'][_0x5b07('0x10')]);return _0x411348(_0x5303d4[_0x5b07('0x11')]['message']);}logger['error']('Setting,\x20%s,\x20%s',_0x3f9877,_0x5303d4[_0x5b07('0x11')][_0x5b07('0x10')]);return _0x183ffb(_0x5303d4[_0x5b07('0x11')][_0x5b07('0x10')]);}else{logger[_0x5b07('0xa')](_0x5b07('0xb'),_0x3f9877,_0x5b07('0xc'));_0x183ffb(_0x5303d4[_0x5b07('0x12')][_0x5b07('0x10')]);}})[_0x5b07('0x13')](function(_0xf76119){logger[_0x5b07('0x11')]('Setting,\x20%s,\x20%s',_0x3f9877,_0xf76119);_0x411348(_0xf76119);});});}exports['ShowSetting']=function(_0x17d09b){var _0x5827ea=this;return new Promise(function(_0x532acd,_0x2fb3be){return db[_0x5b07('0x14')][_0x5b07('0x15')]({'raw':_0x17d09b['options']?_0x17d09b[_0x5b07('0x16')][_0x5b07('0x17')]===undefined?!![]:![]:!![],'where':_0x17d09b[_0x5b07('0x16')]?_0x17d09b[_0x5b07('0x16')][_0x5b07('0x18')]||null:null,'attributes':_0x17d09b[_0x5b07('0x16')]?_0x17d09b[_0x5b07('0x16')]['attributes']||null:null,'include':_0x17d09b['options']?_0x17d09b[_0x5b07('0x16')][_0x5b07('0x19')]?_[_0x5b07('0x1a')](_0x17d09b['options']['include'],function(_0x3fd7b8){return{'model':db[_0x3fd7b8['model']],'as':_0x3fd7b8['as'],'attributes':_0x3fd7b8[_0x5b07('0x1b')],'include':_0x3fd7b8[_0x5b07('0x19')]?_[_0x5b07('0x1a')](_0x3fd7b8['include'],function(_0x39410e){return{'model':db[_0x39410e[_0x5b07('0x1c')]],'as':_0x39410e['as'],'attributes':_0x39410e[_0x5b07('0x1b')],'include':_0x39410e[_0x5b07('0x19')]?_[_0x5b07('0x1a')](_0x39410e[_0x5b07('0x19')],function(_0x5915cf){return{'model':db[_0x5915cf[_0x5b07('0x1c')]],'as':_0x5915cf['as'],'attributes':_0x5915cf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c5615){logger['info']('ShowSetting',_0x17d09b);logger[_0x5b07('0xd')](_0x5b07('0x1d'),_0x17d09b,JSON[_0x5b07('0xe')](_0x3c5615));_0x532acd(_0x3c5615);})[_0x5b07('0x13')](function(_0x1adf4a){logger[_0x5b07('0x11')](_0x5b07('0x1d'),_0x1adf4a[_0x5b07('0x10')],_0x17d09b);_0x2fb3be(_0x5827ea[_0x5b07('0x11')](0x1f4,_0x1adf4a['message']));});});}; \ No newline at end of file +var _0x0425=['../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','stringify','lodash','moment','randomstring'];(function(_0x22b95b,_0x2c695e){var _0x32728b=function(_0x434be1){while(--_0x434be1){_0x22b95b['push'](_0x22b95b['shift']());}};_0x32728b(++_0x2c695e);}(_0x0425,0x8e));var _0x5042=function(_0x17cc4d,_0x51d267){_0x17cc4d=_0x17cc4d-0x0;var _0x416aad=_0x0425[_0x17cc4d];return _0x416aad;};'use strict';var _=require(_0x5042('0x0'));var util=require('util');var moment=require(_0x5042('0x1'));var BPromise=require('bluebird');var rs=require(_0x5042('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5042('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5042('0x4'));var jayson=require(_0x5042('0x5'));var client=jayson[_0x5042('0x6')][_0x5042('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ada7f,_0xd83c7,_0x5f52ab){return new BPromise(function(_0x2270d4,_0x154e5a){return client['request'](_0x2ada7f,_0x5f52ab)[_0x5042('0x8')](function(_0x1b6e93){logger[_0x5042('0x9')](_0x5042('0xa'),_0xd83c7,'request\x20sent');logger[_0x5042('0xb')](_0x5042('0xc'),_0xd83c7,'request\x20sent',JSON['stringify'](_0x1b6e93));if(_0x1b6e93['error']){if(_0x1b6e93[_0x5042('0xd')][_0x5042('0xe')]===0x1f4){logger[_0x5042('0xd')](_0x5042('0xa'),_0xd83c7,_0x1b6e93[_0x5042('0xd')][_0x5042('0xf')]);return _0x154e5a(_0x1b6e93[_0x5042('0xd')][_0x5042('0xf')]);}logger['error'](_0x5042('0xa'),_0xd83c7,_0x1b6e93[_0x5042('0xd')][_0x5042('0xf')]);return _0x2270d4(_0x1b6e93['error'][_0x5042('0xf')]);}else{logger[_0x5042('0x9')](_0x5042('0xa'),_0xd83c7,_0x5042('0x10'));_0x2270d4(_0x1b6e93[_0x5042('0x11')]['message']);}})['catch'](function(_0x2339c6){logger[_0x5042('0xd')]('Setting,\x20%s,\x20%s',_0xd83c7,_0x2339c6);_0x154e5a(_0x2339c6);});});}exports[_0x5042('0x12')]=function(_0x5ab989){var _0x58204c=this;return new Promise(function(_0x2009b6,_0x4d05f3){return db[_0x5042('0x13')][_0x5042('0x14')]({'raw':_0x5ab989[_0x5042('0x15')]?_0x5ab989[_0x5042('0x15')][_0x5042('0x16')]===undefined?!![]:![]:!![],'where':_0x5ab989[_0x5042('0x15')]?_0x5ab989[_0x5042('0x15')][_0x5042('0x17')]||null:null,'attributes':_0x5ab989[_0x5042('0x15')]?_0x5ab989[_0x5042('0x15')][_0x5042('0x18')]||null:null,'include':_0x5ab989['options']?_0x5ab989[_0x5042('0x15')][_0x5042('0x19')]?_['map'](_0x5ab989['options'][_0x5042('0x19')],function(_0x576ca1){return{'model':db[_0x576ca1[_0x5042('0x1a')]],'as':_0x576ca1['as'],'attributes':_0x576ca1[_0x5042('0x18')],'include':_0x576ca1[_0x5042('0x19')]?_['map'](_0x576ca1[_0x5042('0x19')],function(_0x802323){return{'model':db[_0x802323[_0x5042('0x1a')]],'as':_0x802323['as'],'attributes':_0x802323[_0x5042('0x18')],'include':_0x802323[_0x5042('0x19')]?_[_0x5042('0x1b')](_0x802323[_0x5042('0x19')],function(_0x3181e9){return{'model':db[_0x3181e9[_0x5042('0x1a')]],'as':_0x3181e9['as'],'attributes':_0x3181e9[_0x5042('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5042('0x8')](function(_0x19aa1d){logger[_0x5042('0x9')](_0x5042('0x12'),_0x5ab989);logger[_0x5042('0xb')](_0x5042('0x12'),_0x5ab989,JSON[_0x5042('0x1c')](_0x19aa1d));_0x2009b6(_0x19aa1d);})['catch'](function(_0x4ac3c1){logger[_0x5042('0xd')](_0x5042('0x12'),_0x4ac3c1[_0x5042('0xf')],_0x5ab989);_0x4d05f3(_0x58204c[_0x5042('0xd')](0x1f4,_0x4ac3c1[_0x5042('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index a7fa8a2..e5dc316 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 _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x4c7141,_0x534ab0){var _0x346785=function(_0x17fb60){while(--_0x17fb60){_0x4c7141['push'](_0x4c7141['shift']());}};_0x346785(++_0x534ab0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5a6e7b,_0x3dabdc){_0x5a6e7b=_0x5a6e7b-0x0;var _0x5bef75=_0x7fbe[_0x5a6e7b];return _0x5bef75;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0xe18f1d,_0x37e113){var _0x568ae8=function(_0x30ac84){while(--_0x30ac84){_0xe18f1d['push'](_0xe18f1d['shift']());}};_0x568ae8(++_0x37e113);}(_0x53ec,0x192));var _0xc53e=function(_0x115785,_0x4d16fa){_0x115785=_0x115785-0x0;var _0x35224b=_0x53ec[_0x115785];return _0x35224b;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 808fd23..36f46c0 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 _0x525f=['intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','name','STRING','generate','ENUM','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip'];(function(_0x523b3a,_0xae9ce5){var _0x5b94f7=function(_0x5619b3){while(--_0x5619b3){_0x523b3a['push'](_0x523b3a['shift']());}};_0x5b94f7(++_0xae9ce5);}(_0x525f,0xf9));var _0xf525=function(_0x23d935,_0xbad71e){_0x23d935=_0x23d935-0x0;var _0xd0b294=_0x525f[_0x23d935];return _0xd0b294;};'use strict';var Sequelize=require(_0xf525('0x0'));var rs=require(_0xf525('0x1'));module[_0xf525('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xf525('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xf525('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xf525('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xf525('0x4')],'defaultValue':function(){return rs[_0xf525('0x5')]();}},'phone':{'type':Sequelize[_0xf525('0x4')]},'type':{'type':Sequelize[_0xf525('0x6')]('twilio',_0xf525('0x7'),_0xf525('0x8'),_0xf525('0x9'),_0xf525('0xa'),_0xf525('0xb'),_0xf525('0xc'),_0xf525('0xd'),_0xf525('0xe'),_0xf525('0xf'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xf525('0x4')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xf525('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0xf525('0x4')]},'password':{'type':Sequelize[_0xf525('0x4')]},'apiKey':{'type':Sequelize[_0xf525('0x4')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xf525('0x4')]},'deliveryReport':{'type':Sequelize[_0xf525('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0xf525('0x4')]},'notificationTemplate':{'type':Sequelize[_0xf525('0x11')],'defaultValue':function(){return _0xf525('0x12');}},'notificationSound':{'type':Sequelize[_0xf525('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf525('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf525('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf525('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf525('0x13')],'comment':_0xf525('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xf525('0x10')],'defaultValue':![],'comment':_0xf525('0x15'),'set':function(_0x15769d){if(!_0x15769d)this[_0xf525('0x16')](_0xf525('0x17'),null);this['setDataValue']('mandatoryDisposition',_0x15769d);}}}; \ No newline at end of file +var _0xb6a2=['csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring','exports','STRING','generate','ENUM','twilio','connectel','clicksend','plivo','clickatell','bandwidth'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb6a2,0xfd));var _0x2b6a=function(_0x105e18,_0x3a85c2){_0x105e18=_0x105e18-0x0;var _0x30a4b=_0xb6a2[_0x105e18];return _0x30a4b;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x2b6a('0x0'));module[_0x2b6a('0x1')]={'name':{'type':Sequelize[_0x2b6a('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x2b6a('0x2')],'defaultValue':function(){return rs[_0x2b6a('0x3')]();}},'phone':{'type':Sequelize[_0x2b6a('0x2')]},'type':{'type':Sequelize[_0x2b6a('0x4')](_0x2b6a('0x5'),'skebby',_0x2b6a('0x6'),_0x2b6a('0x7'),_0x2b6a('0x8'),_0x2b6a('0x9'),_0x2b6a('0xa'),_0x2b6a('0xb'),_0x2b6a('0xc'),_0x2b6a('0xd'))},'accountSid':{'type':Sequelize[_0x2b6a('0x2')]},'authId':{'type':Sequelize[_0x2b6a('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x2b6a('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x2b6a('0x2')]},'applicationId':{'type':Sequelize[_0x2b6a('0x2')]},'accountId':{'type':Sequelize[_0x2b6a('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x2b6a('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2b6a('0xf')],'defaultValue':function(){return _0x2b6a('0x10');}},'notificationSound':{'type':Sequelize[_0x2b6a('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2b6a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2b6a('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2b6a('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2b6a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x2b6a('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2b6a('0x11')],'comment':_0x2b6a('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4a1d84){if(!_0x4a1d84)this['setDataValue'](_0x2b6a('0x13'),null);this[_0x2b6a('0x14')](_0x2b6a('0x15'),_0x4a1d84);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 7a7a355..afc79d1 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 _0x0a33=['connectel','clicksend','message_id','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','refid','isNil','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','CmList','DESC','list','omit','Contacts','CmContact','SmsInteraction','spread','interaction','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Contact','Owner','fullname','color','tag','to\x20is\x20mandatory','List','ListId','out','dataValues','push','inspect','skebby_dispatch_id','statusInt','requestid','status_code','DELIVERED','groupName','redif','error_code','infobip','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','limit','count','set','apply','save','destroy','get','stack','name','send','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','Pause','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addDisposition','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','SmsAccountId','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','account','applications','priority','Applications','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text'];(function(_0x326982,_0x2d6fab){var _0x117bf6=function(_0x2ece6c){while(--_0x2ece6c){_0x326982['push'](_0x326982['shift']());}};_0x117bf6(++_0x2d6fab);}(_0x0a33,0x144));var _0x30a3=function(_0x4fe684,_0x3b6019){_0x4fe684=_0x4fe684-0x0;var _0x2c1667=_0x0a33[_0x4fe684];return _0x2c1667;};'use strict';var emlformat=require(_0x30a3('0x0'));var rimraf=require(_0x30a3('0x1'));var zipdir=require(_0x30a3('0x2'));var jsonpatch=require(_0x30a3('0x3'));var rp=require(_0x30a3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x30a3('0x5'));var util=require(_0x30a3('0x6'));var path=require(_0x30a3('0x7'));var sox=require(_0x30a3('0x8'));var csv=require(_0x30a3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x30a3('0xa'));var _=require(_0x30a3('0xb'));var squel=require('squel');var crypto=require(_0x30a3('0xc'));var jsforce=require(_0x30a3('0xd'));var deskjs=require(_0x30a3('0xe'));var toCsv=require(_0x30a3('0x9'));var querystring=require(_0x30a3('0xf'));var Papa=require('papaparse');var Redis=require(_0x30a3('0x10'));var authService=require(_0x30a3('0x11'));var qs=require(_0x30a3('0x12'));var as=require(_0x30a3('0x13'));var hardwareService=require(_0x30a3('0x14'));var logger=require(_0x30a3('0x15'))(_0x30a3('0x16'));var utils=require(_0x30a3('0x17'));var config=require(_0x30a3('0x18'));var licenseUtil=require(_0x30a3('0x19'));var db=require(_0x30a3('0x1a'))['db'];config[_0x30a3('0x1b')]=_[_0x30a3('0x1c')](config[_0x30a3('0x1b')],{'host':_0x30a3('0x1d'),'port':0x18eb});var socket=require(_0x30a3('0x1e'))(new Redis(config[_0x30a3('0x1b')]));require(_0x30a3('0x1f'))[_0x30a3('0x20')](socket);var jayson=require(_0x30a3('0x21'));var client=jayson[_0x30a3('0x22')][_0x30a3('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x3573cc,_0x1241da,_0x213ecf,_0x230518){return new BPromise(function(_0x1a8ded,_0x5ab806){var _0x5a9a32=_0x230518||client;return _0x5a9a32[_0x30a3('0x24')](_0x3573cc,_0x213ecf)[_0x30a3('0x25')](function(_0x166eed){logger[_0x30a3('0x26')](_0x30a3('0x27'),_0x1241da,_0x30a3('0x28'));logger[_0x30a3('0x29')](_0x30a3('0x2a'),_0x1241da,_0x30a3('0x28'),JSON[_0x30a3('0x2b')](_0x166eed));if(_0x166eed[_0x30a3('0x2c')]){if(_0x166eed[_0x30a3('0x2c')][_0x30a3('0x2d')]===0x1f4){logger[_0x30a3('0x2c')](_0x30a3('0x27'),_0x1241da,_0x166eed[_0x30a3('0x2c')][_0x30a3('0x2e')]);return _0x5ab806(_0x166eed['error'][_0x30a3('0x2e')]);}logger[_0x30a3('0x2c')](_0x30a3('0x27'),_0x1241da,_0x166eed['error']['message']);return _0x1a8ded(_0x166eed[_0x30a3('0x2c')][_0x30a3('0x2e')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x1241da,_0x30a3('0x28'));_0x1a8ded(_0x166eed[_0x30a3('0x2f')]['message']);}})['catch'](function(_0x1a8162){logger[_0x30a3('0x2c')](_0x30a3('0x27'),_0x1241da,_0x1a8162);_0x5ab806(_0x1a8162);});});}function respondWithStatusCode(_0x568fbd,_0x2fedfd){_0x2fedfd=_0x2fedfd||0xcc;return function(_0x336f40){if(_0x336f40){return _0x568fbd[_0x30a3('0x30')](_0x2fedfd);}return _0x568fbd['status'](_0x2fedfd)[_0x30a3('0x31')]();};}function respondWithResult(_0x79b238,_0x19a88e){_0x19a88e=_0x19a88e||0xc8;return function(_0x5995b5){if(_0x5995b5){return _0x79b238[_0x30a3('0x32')](_0x19a88e)[_0x30a3('0x33')](_0x5995b5);}};}function respondWithFilteredResult(_0x108736,_0x4640a4){return function(_0x18aeae){if(_0x18aeae){var _0x20e1cc=typeof _0x4640a4[_0x30a3('0x34')]==='undefined'&&typeof _0x4640a4[_0x30a3('0x35')]==='undefined';var _0x21446b=_0x18aeae[_0x30a3('0x36')];var _0x2a21ba=_0x20e1cc?0x0:_0x4640a4[_0x30a3('0x34')];var _0xc3ab64=_0x20e1cc?_0x18aeae['count']:_0x4640a4[_0x30a3('0x34')]+_0x4640a4[_0x30a3('0x35')];var _0x2f4e20;if(_0xc3ab64>=_0x21446b){_0xc3ab64=_0x21446b;_0x2f4e20=0xc8;}else{_0x2f4e20=0xce;}_0x108736['status'](_0x2f4e20);return _0x108736[_0x30a3('0x37')]('Content-Range',_0x2a21ba+'-'+_0xc3ab64+'/'+_0x21446b)[_0x30a3('0x33')](_0x18aeae);}return null;};}function patchUpdates(_0x5f4a3e){return function(_0x43c03f){try{jsonpatch[_0x30a3('0x38')](_0x43c03f,_0x5f4a3e,!![]);}catch(_0x3a6e6c){return BPromise['reject'](_0x3a6e6c);}return _0x43c03f[_0x30a3('0x39')]();};}function saveUpdates(_0x3ba0f9,_0x5e6f7f){return function(_0x4c0d6e){if(_0x4c0d6e){return _0x4c0d6e['update'](_0x3ba0f9)[_0x30a3('0x25')](function(_0x63475){return _0x63475;});}return null;};}function removeEntity(_0x44b2e1,_0x475192){return function(_0x5b84d7){if(_0x5b84d7){return _0x5b84d7[_0x30a3('0x3a')]()['then'](function(){var _0x4b34a9=_0x5b84d7[_0x30a3('0x3b')]({'plain':!![]});var _0x4d4556='SmsAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x4d4556,'resourceId':_0x4b34a9['id']}})[_0x30a3('0x25')](function(){return _0x5b84d7;});})[_0x30a3('0x25')](function(){_0x44b2e1[_0x30a3('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5217ad,_0xf3a76c){return function(_0xa67b1c){if(!_0xa67b1c){_0x5217ad[_0x30a3('0x30')](0x194);}return _0xa67b1c;};}function handleError(_0x47a7a2,_0x59f6a1){_0x59f6a1=_0x59f6a1||0x1f4;return function(_0x5321fb){logger[_0x30a3('0x2c')](_0x5321fb[_0x30a3('0x3c')]);if(_0x5321fb[_0x30a3('0x3d')]){delete _0x5321fb[_0x30a3('0x3d')];}_0x47a7a2[_0x30a3('0x32')](_0x59f6a1)[_0x30a3('0x3e')](_0x5321fb);};}exports['index']=function(_0x5cdbfa,_0x40c7ae){var _0x2670de={'include':[{'model':db['Pause'],'as':_0x30a3('0x3f')}]},_0x55d9c6={},_0x68b26a={'count':0x0,'rows':[]};var _0x7f6995=_[_0x30a3('0x40')](db[_0x30a3('0x41')][_0x30a3('0x42')],function(_0x3e854b){return{'name':_0x3e854b[_0x30a3('0x43')],'type':_0x3e854b['type'][_0x30a3('0x44')]};});_0x55d9c6[_0x30a3('0x45')]=_['map'](_0x7f6995,_0x30a3('0x3d'));_0x55d9c6['query']=_[_0x30a3('0x46')](_0x5cdbfa[_0x30a3('0x47')]);_0x55d9c6[_0x30a3('0x48')]=_[_0x30a3('0x49')](_0x55d9c6[_0x30a3('0x45')],_0x55d9c6[_0x30a3('0x47')]);_0x2670de[_0x30a3('0x4a')]=_[_0x30a3('0x49')](_0x55d9c6[_0x30a3('0x45')],qs[_0x30a3('0x4b')](_0x5cdbfa[_0x30a3('0x47')][_0x30a3('0x4b')]));_0x2670de[_0x30a3('0x4a')]=_0x2670de[_0x30a3('0x4a')][_0x30a3('0x4c')]?_0x2670de[_0x30a3('0x4a')]:_0x55d9c6[_0x30a3('0x45')];if(!_0x5cdbfa[_0x30a3('0x47')][_0x30a3('0x4d')](_0x30a3('0x4e'))){_0x2670de[_0x30a3('0x35')]=qs['limit'](_0x5cdbfa['query']['limit']);_0x2670de['offset']=qs[_0x30a3('0x34')](_0x5cdbfa[_0x30a3('0x47')][_0x30a3('0x34')]);}_0x2670de['order']=qs[_0x30a3('0x4f')](_0x5cdbfa[_0x30a3('0x47')][_0x30a3('0x4f')]);_0x2670de[_0x30a3('0x50')]=qs[_0x30a3('0x48')](_[_0x30a3('0x51')](_0x5cdbfa[_0x30a3('0x47')],_0x55d9c6[_0x30a3('0x48')]),_0x7f6995);if(_0x5cdbfa[_0x30a3('0x47')][_0x30a3('0x52')]){_0x2670de['where']=_[_0x30a3('0x53')](_0x2670de[_0x30a3('0x50')],{'$or':_[_0x30a3('0x40')](_0x7f6995,function(_0x86e8e4){if(_0x86e8e4[_0x30a3('0x54')]!=='VIRTUAL'){var _0x40ef53={};_0x40ef53[_0x86e8e4['name']]={'$like':'%'+_0x5cdbfa['query']['filter']+'%'};return _0x40ef53;}})});}_0x2670de=_[_0x30a3('0x53')]({},_0x2670de,_0x5cdbfa[_0x30a3('0x55')]);var _0x2a3fab={'where':_0x2670de['where']};return db[_0x30a3('0x41')]['count'](_0x2a3fab)['then'](function(_0x3bbe96){_0x68b26a[_0x30a3('0x36')]=_0x3bbe96;if(_0x5cdbfa[_0x30a3('0x47')][_0x30a3('0x56')]){_0x2670de[_0x30a3('0x57')]=[{'all':!![]}];}return db[_0x30a3('0x41')][_0x30a3('0x58')](_0x2670de);})['then'](function(_0x1f0f6e){_0x68b26a[_0x30a3('0x59')]=_0x1f0f6e;return _0x68b26a;})['then'](respondWithFilteredResult(_0x40c7ae,_0x2670de))[_0x30a3('0x5a')](handleError(_0x40c7ae,null));};exports[_0x30a3('0x5b')]=function(_0x3a9ce2,_0x49889f){var _0x14f443={'raw':![],'where':{'id':_0x3a9ce2['params']['id']},'include':[{'model':db[_0x30a3('0x5c')],'as':'mandatoryDispositionPause'}]},_0xc1f383={};_0xc1f383['model']=_[_0x30a3('0x46')](db[_0x30a3('0x41')][_0x30a3('0x42')]);_0xc1f383[_0x30a3('0x47')]=_[_0x30a3('0x46')](_0x3a9ce2['query']);_0xc1f383['filters']=_['intersection'](_0xc1f383[_0x30a3('0x45')],_0xc1f383[_0x30a3('0x47')]);_0x14f443[_0x30a3('0x4a')]=_['intersection'](_0xc1f383[_0x30a3('0x45')],qs[_0x30a3('0x4b')](_0x3a9ce2[_0x30a3('0x47')][_0x30a3('0x4b')]));_0x14f443[_0x30a3('0x4a')]=_0x14f443[_0x30a3('0x4a')]['length']?_0x14f443[_0x30a3('0x4a')]:_0xc1f383[_0x30a3('0x45')];if(_0x3a9ce2[_0x30a3('0x47')][_0x30a3('0x56')]){_0x14f443[_0x30a3('0x57')]=[{'all':!![]}];}_0x14f443=_[_0x30a3('0x53')]({},_0x14f443,_0x3a9ce2[_0x30a3('0x55')]);return db[_0x30a3('0x41')][_0x30a3('0x5d')](_0x14f443)[_0x30a3('0x25')](handleEntityNotFound(_0x49889f,null))[_0x30a3('0x25')](respondWithResult(_0x49889f,null))[_0x30a3('0x5a')](handleError(_0x49889f,null));};exports['create']=function(_0x4d9e64,_0x613465){return db[_0x30a3('0x41')][_0x30a3('0x5e')](_0x4d9e64['body'],{})[_0x30a3('0x25')](function(_0x5d7706){var _0x51f426=_0x4d9e64[_0x30a3('0x5f')]['get']({'plain':!![]});if(!_0x51f426)throw new Error(_0x30a3('0x60'));if(_0x51f426[_0x30a3('0x61')]==='user'){var _0xeeed86=_0x5d7706['get']({'plain':!![]});var _0x4d9ce2=_0x30a3('0x62');return db[_0x30a3('0x63')][_0x30a3('0x5d')]({'where':{'name':_0x4d9ce2,'userProfileId':_0x51f426['userProfileId']},'raw':!![]})['then'](function(_0x3a63c3){if(_0x3a63c3&&_0x3a63c3[_0x30a3('0x64')]===0x0){return db[_0x30a3('0x65')][_0x30a3('0x5e')]({'name':_0xeeed86[_0x30a3('0x3d')],'resourceId':_0xeeed86['id'],'type':_0x3a63c3[_0x30a3('0x3d')],'sectionId':_0x3a63c3['id']},{})[_0x30a3('0x25')](function(){return _0x5d7706;});}else{return _0x5d7706;}})[_0x30a3('0x5a')](function(_0x2d9c72){logger[_0x30a3('0x2c')](_0x30a3('0x66'),_0x2d9c72);throw _0x2d9c72;});}return _0x5d7706;})[_0x30a3('0x25')](respondWithResult(_0x613465,0xc9))['catch'](handleError(_0x613465,null));};exports[_0x30a3('0x67')]=function(_0x4b8b75,_0x23542d){if(_0x4b8b75[_0x30a3('0x68')]['id']){delete _0x4b8b75[_0x30a3('0x68')]['id'];}return db[_0x30a3('0x41')]['find']({'where':{'id':_0x4b8b75[_0x30a3('0x69')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x30a3('0x25')](handleEntityNotFound(_0x23542d,null))[_0x30a3('0x25')](saveUpdates(_0x4b8b75[_0x30a3('0x68')],null))[_0x30a3('0x25')](respondWithResult(_0x23542d,null))['catch'](handleError(_0x23542d,null));};exports[_0x30a3('0x3a')]=function(_0x16b7ea,_0x395f2b){return db['SmsAccount'][_0x30a3('0x5d')]({'where':{'id':_0x16b7ea[_0x30a3('0x69')]['id']}})[_0x30a3('0x25')](handleEntityNotFound(_0x395f2b,null))[_0x30a3('0x25')](removeEntity(_0x395f2b,null))[_0x30a3('0x5a')](handleError(_0x395f2b,null));};exports['describe']=function(_0x50dfb4,_0xdec3a3){return db['SmsAccount'][_0x30a3('0x6a')]()[_0x30a3('0x25')](respondWithResult(_0xdec3a3,null))[_0x30a3('0x5a')](handleError(_0xdec3a3,null));};exports[_0x30a3('0x6b')]=function(_0x29d8a2,_0x5ccfb6,_0x429fd9){if(_0x29d8a2[_0x30a3('0x68')]['id']){delete _0x29d8a2[_0x30a3('0x68')]['id'];}return db[_0x30a3('0x41')][_0x30a3('0x5d')]({'where':{'id':_0x29d8a2[_0x30a3('0x69')]['id']}})['then'](handleEntityNotFound(_0x5ccfb6,null))['then'](function(_0xa6ddb5){if(_0xa6ddb5){_0x29d8a2[_0x30a3('0x68')]['SmsAccountId']=_0xa6ddb5['id'];return db[_0x30a3('0x6c')]['create'](_0x29d8a2[_0x30a3('0x68')]);}})[_0x30a3('0x25')](respondWithResult(_0x5ccfb6,null))[_0x30a3('0x5a')](handleError(_0x5ccfb6,null));};exports[_0x30a3('0x6d')]=function(_0x42c751,_0xff1591,_0x4fefd5){var _0xb76628={'raw':![],'where':{}};var _0x4305ff={};var _0x51029e={'count':0x0,'rows':[]};return db[_0x30a3('0x41')][_0x30a3('0x6e')]({'where':{'id':_0x42c751[_0x30a3('0x69')]['id']}})[_0x30a3('0x25')](handleEntityNotFound(_0xff1591,null))[_0x30a3('0x25')](function(_0x15fdf5){if(_0x15fdf5){_0x4305ff[_0x30a3('0x45')]=_[_0x30a3('0x46')](db[_0x30a3('0x6c')][_0x30a3('0x42')]);_0x4305ff['query']=_[_0x30a3('0x46')](_0x42c751[_0x30a3('0x47')]);_0x4305ff[_0x30a3('0x48')]=_[_0x30a3('0x49')](_0x4305ff['model'],_0x4305ff[_0x30a3('0x47')]);_0xb76628[_0x30a3('0x4a')]=_[_0x30a3('0x49')](_0x4305ff[_0x30a3('0x45')],qs[_0x30a3('0x4b')](_0x42c751['query'][_0x30a3('0x4b')]));_0xb76628[_0x30a3('0x4a')]=_0xb76628[_0x30a3('0x4a')][_0x30a3('0x4c')]?_0xb76628[_0x30a3('0x4a')]:_0x4305ff['model'];if(!_0x42c751[_0x30a3('0x47')][_0x30a3('0x4d')]('nolimit')){_0xb76628[_0x30a3('0x35')]=qs[_0x30a3('0x35')](_0x42c751[_0x30a3('0x47')][_0x30a3('0x35')]);_0xb76628[_0x30a3('0x34')]=qs['offset'](_0x42c751[_0x30a3('0x47')][_0x30a3('0x34')]);}_0xb76628[_0x30a3('0x6f')]=qs['sort'](_0x42c751[_0x30a3('0x47')][_0x30a3('0x4f')]);_0xb76628[_0x30a3('0x50')]=qs[_0x30a3('0x48')](_[_0x30a3('0x51')](_0x42c751[_0x30a3('0x47')],_0x4305ff[_0x30a3('0x48')]));_0xb76628[_0x30a3('0x50')]['SmsAccountId']=_0x15fdf5['id'];if(_0x42c751[_0x30a3('0x47')][_0x30a3('0x52')]){_0xb76628[_0x30a3('0x50')]=_['merge'](_0xb76628['where'],{'$or':_[_0x30a3('0x40')](_0xb76628[_0x30a3('0x4a')],function(_0x2aa20a){var _0x174f55={};_0x174f55[_0x2aa20a]={'$like':'%'+_0x42c751[_0x30a3('0x47')]['filter']+'%'};return _0x174f55;})});}_0xb76628=_[_0x30a3('0x53')]({},_0xb76628,_0x42c751[_0x30a3('0x55')]);return db[_0x30a3('0x6c')][_0x30a3('0x36')]({'where':_0xb76628[_0x30a3('0x50')]})[_0x30a3('0x25')](function(_0x1287ad){_0x51029e[_0x30a3('0x36')]=_0x1287ad;if(_0x42c751[_0x30a3('0x47')][_0x30a3('0x56')]){_0xb76628['include']=[{'all':!![]}];}return db[_0x30a3('0x6c')][_0x30a3('0x58')](_0xb76628);})[_0x30a3('0x25')](function(_0x1fa066){_0x51029e[_0x30a3('0x59')]=_0x1fa066;return _0x51029e;});}})[_0x30a3('0x25')](respondWithFilteredResult(_0xff1591,_0xb76628))['catch'](handleError(_0xff1591,null));};exports[_0x30a3('0x70')]=function(_0x13b6d2,_0x541959,_0x1f7ed6){return db[_0x30a3('0x41')]['find']({'where':{'id':_0x13b6d2['params']['id']}})[_0x30a3('0x25')](handleEntityNotFound(_0x541959,null))[_0x30a3('0x25')](function(_0x286270){if(_0x286270){return _0x286270[_0x30a3('0x70')](_0x13b6d2[_0x30a3('0x47')][_0x30a3('0x71')]);}})['then'](respondWithStatusCode(_0x541959,null))[_0x30a3('0x5a')](handleError(_0x541959,null));};exports[_0x30a3('0x72')]=function(_0x13c285,_0x5b747d,_0x4b5735){if(_0x13c285[_0x30a3('0x68')]['id']){delete _0x13c285[_0x30a3('0x68')]['id'];}return db[_0x30a3('0x41')]['find']({'where':{'id':_0x13c285[_0x30a3('0x69')]['id']}})[_0x30a3('0x25')](handleEntityNotFound(_0x5b747d,null))['then'](function(_0x18ac3f){if(_0x18ac3f){_0x13c285['body'][_0x30a3('0x73')]=_0x18ac3f['id'];return db[_0x30a3('0x74')][_0x30a3('0x5e')](_0x13c285[_0x30a3('0x68')]);}})['then'](respondWithResult(_0x5b747d,null))['catch'](handleError(_0x5b747d,null));};exports[_0x30a3('0x75')]=function(_0x5f245f,_0x511dce,_0x514a68){var _0x3bc12c={'raw':![],'where':{}};var _0x40b4dd={};var _0x346b3e={'count':0x0,'rows':[]};return db[_0x30a3('0x41')][_0x30a3('0x6e')]({'where':{'id':_0x5f245f[_0x30a3('0x69')]['id']}})[_0x30a3('0x25')](handleEntityNotFound(_0x511dce,null))[_0x30a3('0x25')](function(_0x418070){if(_0x418070){_0x40b4dd[_0x30a3('0x45')]=_[_0x30a3('0x46')](db['CannedAnswer'][_0x30a3('0x42')]);_0x40b4dd[_0x30a3('0x47')]=_[_0x30a3('0x46')](_0x5f245f[_0x30a3('0x47')]);_0x40b4dd[_0x30a3('0x48')]=_['intersection'](_0x40b4dd['model'],_0x40b4dd[_0x30a3('0x47')]);_0x3bc12c['attributes']=_[_0x30a3('0x49')](_0x40b4dd[_0x30a3('0x45')],qs['fields'](_0x5f245f['query']['fields']));_0x3bc12c['attributes']=_0x3bc12c[_0x30a3('0x4a')]['length']?_0x3bc12c['attributes']:_0x40b4dd[_0x30a3('0x45')];if(!_0x5f245f[_0x30a3('0x47')][_0x30a3('0x4d')](_0x30a3('0x4e'))){_0x3bc12c[_0x30a3('0x35')]=qs['limit'](_0x5f245f[_0x30a3('0x47')]['limit']);_0x3bc12c[_0x30a3('0x34')]=qs[_0x30a3('0x34')](_0x5f245f[_0x30a3('0x47')]['offset']);}_0x3bc12c[_0x30a3('0x6f')]=qs[_0x30a3('0x4f')](_0x5f245f[_0x30a3('0x47')][_0x30a3('0x4f')]);_0x3bc12c['where']=qs['filters'](_[_0x30a3('0x51')](_0x5f245f[_0x30a3('0x47')],_0x40b4dd[_0x30a3('0x48')]));_0x3bc12c[_0x30a3('0x50')][_0x30a3('0x73')]=_0x418070['id'];if(_0x5f245f[_0x30a3('0x47')][_0x30a3('0x52')]){_0x3bc12c['where']=_[_0x30a3('0x53')](_0x3bc12c['where'],{'$or':_[_0x30a3('0x40')](_0x3bc12c['attributes'],function(_0x53b131){var _0x49f424={};_0x49f424[_0x53b131]={'$like':'%'+_0x5f245f[_0x30a3('0x47')][_0x30a3('0x52')]+'%'};return _0x49f424;})});}_0x3bc12c=_[_0x30a3('0x53')]({},_0x3bc12c,_0x5f245f['options']);return db['CannedAnswer'][_0x30a3('0x36')]({'where':_0x3bc12c[_0x30a3('0x50')]})[_0x30a3('0x25')](function(_0x6d8af8){_0x346b3e['count']=_0x6d8af8;if(_0x5f245f['query'][_0x30a3('0x56')]){_0x3bc12c[_0x30a3('0x57')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3bc12c);})['then'](function(_0x5536b6){_0x346b3e[_0x30a3('0x59')]=_0x5536b6;return _0x346b3e;});}})[_0x30a3('0x25')](respondWithFilteredResult(_0x511dce,_0x3bc12c))['catch'](handleError(_0x511dce,null));};exports[_0x30a3('0x76')]=function(_0x39bbcd,_0x4ad7c6,_0x54319d){return db[_0x30a3('0x41')][_0x30a3('0x5d')]({'where':{'id':_0x39bbcd[_0x30a3('0x69')]['id']}})[_0x30a3('0x25')](handleEntityNotFound(_0x4ad7c6,null))[_0x30a3('0x25')](function(_0x183c47){if(_0x183c47){return _0x183c47[_0x30a3('0x76')](_0x39bbcd[_0x30a3('0x47')][_0x30a3('0x71')]);}})['then'](respondWithStatusCode(_0x4ad7c6,null))[_0x30a3('0x5a')](handleError(_0x4ad7c6,null));};exports[_0x30a3('0x77')]=function(_0x15a0dd,_0xe7c22,_0x3b180a){var _0x3ec379={'channel':_0x30a3('0x78')};var _0x5b4a7f=[];var _0x14a7ef=[];var _0x3acf49={};return db['SmsAccount'][_0x30a3('0x5d')]({'where':{'id':_0x15a0dd[_0x30a3('0x69')]['id']},'include':[{'model':db[_0x30a3('0x79')],'as':'Applications'}]})[_0x30a3('0x25')](handleEntityNotFound(_0xe7c22,null))[_0x30a3('0x25')](function(_0x3a505f){_0x3ec379[_0x30a3('0x7a')]=_0x3a505f;_0x3ec379[_0x30a3('0x7b')]=_['orderBy'](_0x3a505f['Applications'],[_0x30a3('0x7c')],['asc']);if(_0x3ec379[_0x30a3('0x7a')][_0x30a3('0x7d')]){delete _0x3ec379['account']['Applications'];}return db['CmContact'][_0x30a3('0x6a')]();})[_0x30a3('0x25')](function(_0x5560e8){if(!_0x5560e8){throw new db[(_0x30a3('0x7e'))]['ValidationError'](_0x30a3('0x7f'));}_0x5b4a7f=_[_0x30a3('0x80')](_[_0x30a3('0x46')](_0x5560e8),[_0x30a3('0x81'),_0x30a3('0x82')]);_0x14a7ef=_[_0x30a3('0x80')](_[_0x30a3('0x46')](_0x5560e8),[_0x30a3('0x81'),'updatedAt',_0x30a3('0x83'),'ListId']);_0x3ec379[_0x30a3('0x68')]={'mapKey':_0x30a3('0x84')};if(_0x3ec379[_0x30a3('0x7a')][_0x30a3('0x54')]){switch(_0x3ec379[_0x30a3('0x7a')]['type']){case _0x30a3('0x85'):_0x3ec379[_0x30a3('0x68')][_0x30a3('0x86')]=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x87')];_0x3ec379[_0x30a3('0x68')][_0x30a3('0x68')]=_0x15a0dd['body'][_0x30a3('0x88')];_0x3ec379[_0x30a3('0x68')][_0x30a3('0x89')]=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x8a')];break;case _0x30a3('0x8b'):_0x3ec379['body']['from']='+'+_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x8c')];_0x3ec379[_0x30a3('0x68')][_0x30a3('0x68')]=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x8d')];break;case _0x30a3('0x8e'):_0x3ec379[_0x30a3('0x68')][_0x30a3('0x86')]=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x86')];_0x3ec379['body'][_0x30a3('0x68')]=_0x15a0dd['body']['message'];break;case _0x30a3('0x8f'):_0x3ec379[_0x30a3('0x68')][_0x30a3('0x86')]=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x86')];_0x3ec379[_0x30a3('0x68')][_0x30a3('0x68')]=_0x15a0dd['body'][_0x30a3('0x68')];_0x3ec379[_0x30a3('0x68')][_0x30a3('0x89')]=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x90')];break;case'plivo':_0x3ec379[_0x30a3('0x68')][_0x30a3('0x86')]=_0x15a0dd[_0x30a3('0x68')]['From'];_0x3ec379['body'][_0x30a3('0x68')]=_0x15a0dd[_0x30a3('0x68')]['Text'];_0x3ec379[_0x30a3('0x68')]['messageId']=_0x15a0dd[_0x30a3('0x68')]['MessageUUID'];break;case'infobip':_0x3ec379[_0x30a3('0x68')][_0x30a3('0x86')]='+'+_0x15a0dd['body']['results'][0x0][_0x30a3('0x86')];_0x3ec379['body'][_0x30a3('0x68')]=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x91')][0x0][_0x30a3('0x8d')];_0x3ec379[_0x30a3('0x68')][_0x30a3('0x89')]=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x91')][0x0][_0x30a3('0x89')];break;case _0x30a3('0x92'):_0x3ec379['body']['from']=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x93')];_0x3ec379[_0x30a3('0x68')]['body']=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x94')][_0x30a3('0x2e')];break;case _0x30a3('0x95'):_0x3ec379[_0x30a3('0x68')][_0x30a3('0x86')]=_0x15a0dd[_0x30a3('0x68')]['fromNumber'];_0x3ec379[_0x30a3('0x68')]['body']=_0x15a0dd[_0x30a3('0x68')]['text'];_0x3ec379[_0x30a3('0x68')][_0x30a3('0x89')]=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x96')];break;case _0x30a3('0x97'):_0x3ec379['body'][_0x30a3('0x89')]=_0x15a0dd[_0x30a3('0x68')][0x0][_0x30a3('0x2e')]['id'];_0x3ec379['body'][_0x30a3('0x86')]=_0x15a0dd[_0x30a3('0x68')][0x0][_0x30a3('0x2e')][_0x30a3('0x86')];_0x3ec379['body'][_0x30a3('0x68')]=_0x15a0dd[_0x30a3('0x68')][0x0]['message'][_0x30a3('0x8d')];break;case _0x30a3('0x98'):_0x3ec379['body'][_0x30a3('0x86')]=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x86')];_0x3ec379[_0x30a3('0x68')][_0x30a3('0x68')]=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x2e')];_0x3ec379[_0x30a3('0x68')][_0x30a3('0x89')]=_0x15a0dd[_0x30a3('0x68')][_0x30a3('0x99')];break;}}if(_0x3ec379[_0x30a3('0x68')]['id']){delete _0x3ec379[_0x30a3('0x68')]['id'];}if(_[_0x30a3('0x9a')](_0x3ec379[_0x30a3('0x68')]['from'])){throw new db[(_0x30a3('0x7e'))][(_0x30a3('0x9b'))](_0x30a3('0x9c'));}if(_[_0x30a3('0x9a')](_0x3ec379[_0x30a3('0x68')][_0x30a3('0x68')])||_0x3ec379[_0x30a3('0x68')][_0x30a3('0x68')]===''){throw new db[(_0x30a3('0x7e'))][(_0x30a3('0x9b'))](_0x30a3('0x9d'));}if(_['isNil'](_0x3ec379[_0x30a3('0x68')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x30a3('0x9e')+_0x14a7ef);}if(!_[_0x30a3('0x9f')](_0x14a7ef,_0x3ec379[_0x30a3('0x68')][_0x30a3('0xa0')])){throw new db[(_0x30a3('0x7e'))]['ValidationError'](_0x30a3('0xa1')+_0x14a7ef);}_0x3acf49[_0x3ec379[_0x30a3('0x68')][_0x30a3('0xa0')]]=_0x3ec379['body']['from'];return db[_0x30a3('0xa2')]['find']({'where':{'id':_0x3ec379['account']['ListId']},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3acf49,'limit':0x1,'order':[['updatedAt',_0x30a3('0xa3')]]}]});})[_0x30a3('0x25')](handleEntityNotFound(_0xe7c22,null))[_0x30a3('0x25')](function(_0x1e77dc){if(_0x1e77dc){_0x3ec379[_0x30a3('0xa4')]=_[_0x30a3('0xa5')](_0x1e77dc,['Contacts']);if(_0x1e77dc[_0x30a3('0xa6')]['length']){return _0x1e77dc[_0x30a3('0xa6')][0x0];}var _0x27720d=_[_0x30a3('0x1c')](_0x3ec379[_0x30a3('0x68')],{'firstName':_0x3ec379[_0x30a3('0x68')][_0x30a3('0x86')],'ListId':_0x1e77dc['id']});_0x27720d[_0x3ec379[_0x30a3('0x68')]['mapKey']]=_0x3ec379['body'][_0x30a3('0x86')];return db[_0x30a3('0xa7')][_0x30a3('0x5e')](_0x27720d,{'fields':_0x5b4a7f,'raw':!![]});}})[_0x30a3('0x25')](handleEntityNotFound(_0xe7c22,null))[_0x30a3('0x25')](function(_0x4e4fd3){if(_0x4e4fd3){_0x3ec379['contact']=_0x4e4fd3;var _0x20bc12={'ContactId':_0x4e4fd3['id'],'phone':_0x3ec379[_0x30a3('0x68')][_0x30a3('0x86')],'SmsAccountId':_0x15a0dd[_0x30a3('0x69')]['id']};var _0x220225={'ContactId':_0x4e4fd3['id'],'SmsAccountId':_0x15a0dd[_0x30a3('0x69')]['id'],'closed':![]};return db[_0x30a3('0xa8')][_0x30a3('0x5d')]({'where':_0x220225})[_0x30a3('0x25')](function(_0x4bd057){if(_0x4bd057){return[_0x4bd057,![]];}return db[_0x30a3('0xa8')]['create'](_0x20bc12)[_0x30a3('0x25')](function(_0x175f18){return[_0x175f18,!![]];});});}})[_0x30a3('0xa9')](function(_0x1ec319,_0x4033e0){_0x3ec379[_0x30a3('0xaa')]=_0x1ec319[_0x30a3('0x3b')]({'plain':!![]});_0x3ec379[_0x30a3('0xaa')]['created']=![];if(_0x4033e0){if(_0x3ec379[_0x30a3('0x7a')]['autoclose']){_0x3ec379[_0x30a3('0x7b')]['push']({'id':0x0,'priority':_0x3ec379[_0x30a3('0x7b')][_0x30a3('0x4c')]+0x1,'app':_0x30a3('0xab'),'appdata':_0x30a3('0xac'),'interval':_0x30a3('0xad')});}_0x3ec379['interaction']['created']=!![];}return db[_0x30a3('0xae')]['create']({'phone':_0x3ec379[_0x30a3('0x68')][_0x30a3('0x86')],'messageId':_0x3ec379[_0x30a3('0x68')][_0x30a3('0x89')],'body':_0x3ec379[_0x30a3('0x68')][_0x30a3('0x68')],'SmsAccountId':_0x15a0dd[_0x30a3('0x69')]['id'],'SmsInteractionId':_0x1ec319['id'],'direction':'in','ContactId':_0x1ec319['ContactId'],'AttachmentId':_0x3ec379['body'][_0x30a3('0xaf')]});})[_0x30a3('0x25')](function(_0x4e773d){_0x3ec379['message']=_0x4e773d;if(_0x3ec379[_0x30a3('0xaa')][_0x30a3('0xb0')]){return db[_0x30a3('0xb1')][_0x30a3('0x5d')]({'attributes':['id',_0x30a3('0x3d')],'where':{'id':_0x3ec379[_0x30a3('0xaa')][_0x30a3('0xb0')]}})[_0x30a3('0x25')](function(_0x21b41b){if(_0x21b41b){_0x3ec379[_0x30a3('0x7b')][_0x30a3('0xb2')]({'id':0x0,'priority':0x0,'app':_0x30a3('0xb3'),'appdata':_0x21b41b[_0x30a3('0x3d')]+','+(_0x3ec379[_0x30a3('0x7a')][_0x30a3('0xb4')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x30a3('0xb5'),_0x3ec379);});}return respondWithRpcPromise(_0x30a3('0xb6'),_0x30a3('0xb5'),_0x3ec379);})[_0x30a3('0x25')](function(_0x41dba9){if(_0x41dba9){var _0x277428=0xc8;var _0x421cc7=_0x30a3('0xb7');logger[_0x30a3('0x26')](_0x30a3('0x2a'),_0x421cc7,_0x277428,_0x30a3('0xb8'));logger[_0x30a3('0x29')](_0x30a3('0xb9'),_0x421cc7,_0x277428,_0x30a3('0xb8'),JSON[_0x30a3('0x2b')](_0x41dba9));if(_0x3ec379[_0x30a3('0x7a')][_0x30a3('0x54')]===_0x30a3('0x85')){return _0xe7c22[_0x30a3('0x32')](_0x277428)[_0x30a3('0x37')](_0x30a3('0xba'),_0x30a3('0xbb'))[_0x30a3('0x3e')]('\x0a');}else{return _0xe7c22[_0x30a3('0x32')](_0x277428)[_0x30a3('0x33')](_0x41dba9);}}})[_0x30a3('0x5a')](handleError(_0xe7c22,null));};exports[_0x30a3('0xbc')]=function(_0x42d0b2,_0x4142e9){var _0x37a31b=_0x42d0b2[_0x30a3('0x69')]['id'];var _0x4bac20=_0x42d0b2[_0x30a3('0x68')];var _0x327436=0xc8;var _0x58abd0=null;return db[_0x30a3('0xbd')][_0x30a3('0xbe')]({'isolationLevel':db[_0x30a3('0xbd')][_0x30a3('0xbf')]['ISOLATION_LEVELS'][_0x30a3('0xc0')]},function(_0x1b5792){return db[_0x30a3('0x41')][_0x30a3('0x6e')]({'where':{'id':_0x37a31b},'transaction':_0x1b5792})[_0x30a3('0x25')](function(_0x1d7da1){if(_0x1d7da1){return db[_0x30a3('0x79')]['destroy']({'where':{'SmsAccountId':_0x37a31b},'transaction':_0x1b5792})[_0x30a3('0x25')](function(){var _0x2a4334=_['map'](_0x4bac20,function(_0x25f3a6){_0x25f3a6['SmsAccountId']=_0x37a31b;return _0x25f3a6;});return db[_0x30a3('0x79')][_0x30a3('0xc1')](_0x2a4334,{'transaction':_0x1b5792});});}else{_0x327436=0x194;_0x58abd0=[];}});})[_0x30a3('0x25')](function(){if(_0x327436!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x37a31b},'order':'priority'})[_0x30a3('0x25')](function(_0x17740c){_0x58abd0=_0x17740c;});}})[_0x30a3('0x5a')](function(_0x150b70){_0x327436=0x1f4;logger[_0x30a3('0x2c')](_0x150b70[_0x30a3('0x3c')]);if(_0x150b70['name']){delete _0x150b70[_0x30a3('0x3d')];}_0x58abd0=_0x150b70;})[_0x30a3('0xc2')](function(){if(_0x58abd0===null){_0x4142e9['sendStatus'](_0x327436);}else{if(_0x327436===0x1f4){_0x4142e9['status'](_0x327436)[_0x30a3('0x3e')](_0x58abd0);}else{_0x4142e9[_0x30a3('0x32')](_0x327436)[_0x30a3('0x33')](_0x58abd0);}}});};exports[_0x30a3('0xc3')]=function(_0x24d783,_0x10d0ec,_0x3ed212){var _0x3b5b7d={};var _0xd6dee1={};var _0x38b8ea;var _0x3482f5;return db[_0x30a3('0x41')][_0x30a3('0x6e')]({'where':{'id':_0x24d783['params']['id']}})[_0x30a3('0x25')](handleEntityNotFound(_0x10d0ec,null))[_0x30a3('0x25')](function(_0x1e53c1){if(_0x1e53c1){_0x38b8ea=_0x1e53c1;_0xd6dee1[_0x30a3('0x45')]=_['keys'](db[_0x30a3('0x79')][_0x30a3('0x42')]);_0xd6dee1[_0x30a3('0x47')]=_[_0x30a3('0x46')](_0x24d783[_0x30a3('0x47')]);_0xd6dee1['filters']=_[_0x30a3('0x49')](_0xd6dee1[_0x30a3('0x45')],_0xd6dee1[_0x30a3('0x47')]);_0x3b5b7d[_0x30a3('0x4a')]=_['intersection'](_0xd6dee1[_0x30a3('0x45')],qs[_0x30a3('0x4b')](_0x24d783['query'][_0x30a3('0x4b')]));_0x3b5b7d[_0x30a3('0x4a')]=_0x3b5b7d[_0x30a3('0x4a')][_0x30a3('0x4c')]?_0x3b5b7d[_0x30a3('0x4a')]:_0xd6dee1[_0x30a3('0x45')];_0x3b5b7d[_0x30a3('0x6f')]=qs[_0x30a3('0x4f')](_0x24d783[_0x30a3('0x47')][_0x30a3('0x4f')]);_0x3b5b7d['where']=qs[_0x30a3('0x48')](_[_0x30a3('0x51')](_0x24d783[_0x30a3('0x47')],_0xd6dee1[_0x30a3('0x48')]));if(_0x24d783[_0x30a3('0x47')]['filter']){_0x3b5b7d[_0x30a3('0x50')]=_['merge'](_0x3b5b7d[_0x30a3('0x50')],{'$or':_[_0x30a3('0x40')](_0x3b5b7d[_0x30a3('0x4a')],function(_0x4d69ee){var _0x290407={};_0x290407[_0x4d69ee]={'$like':'%'+_0x24d783[_0x30a3('0x47')][_0x30a3('0x52')]+'%'};return _0x290407;})});}_0x3b5b7d=_[_0x30a3('0x53')]({},_0x3b5b7d,_0x24d783[_0x30a3('0x55')]);return _0x38b8ea[_0x30a3('0xc3')](_0x3b5b7d);}})[_0x30a3('0x25')](function(_0x2d00cb){if(_0x2d00cb){_0x3482f5=_0x2d00cb[_0x30a3('0x4c')];if(!_0x24d783[_0x30a3('0x47')]['hasOwnProperty']('nolimit')){_0x3b5b7d[_0x30a3('0x35')]=qs[_0x30a3('0x35')](_0x24d783[_0x30a3('0x47')][_0x30a3('0x35')]);_0x3b5b7d[_0x30a3('0x34')]=qs[_0x30a3('0x34')](_0x24d783[_0x30a3('0x47')][_0x30a3('0x34')]);}return _0x38b8ea[_0x30a3('0xc3')](_0x3b5b7d);}})[_0x30a3('0x25')](function(_0x1ff3ed){if(_0x1ff3ed){return _0x1ff3ed?{'count':_0x3482f5,'rows':_0x1ff3ed}:null;}})[_0x30a3('0x25')](respondWithResult(_0x10d0ec,null))[_0x30a3('0x5a')](handleError(_0x10d0ec,null));};exports[_0x30a3('0xc4')]=function(_0x3351b2,_0x42a57d,_0x5b0d38){var _0xeb47cc={'raw':![],'where':{}};var _0xa2ff88={};var _0x445509={'count':0x0,'rows':[]};return db[_0x30a3('0x41')][_0x30a3('0x6e')]({'where':{'id':_0x3351b2[_0x30a3('0x69')]['id']}})['then'](handleEntityNotFound(_0x42a57d,null))['then'](function(_0x4f153b){if(_0x4f153b){_0xa2ff88[_0x30a3('0x45')]=_[_0x30a3('0x46')](db[_0x30a3('0xa8')][_0x30a3('0x42')]);_0xa2ff88[_0x30a3('0x47')]=_[_0x30a3('0x46')](_0x3351b2[_0x30a3('0x47')]);_0xa2ff88[_0x30a3('0x48')]=_[_0x30a3('0x49')](_0xa2ff88['model'],_0xa2ff88['query']);_0xeb47cc[_0x30a3('0x4a')]=_[_0x30a3('0x49')](_0xa2ff88[_0x30a3('0x45')],qs[_0x30a3('0x4b')](_0x3351b2[_0x30a3('0x47')]['fields']));_0xeb47cc[_0x30a3('0x4a')]=_0xeb47cc[_0x30a3('0x4a')][_0x30a3('0x4c')]?_0xeb47cc[_0x30a3('0x4a')]:_0xa2ff88['model'];if(!_0x3351b2['query'][_0x30a3('0x4d')]('nolimit')){_0xeb47cc[_0x30a3('0x35')]=qs['limit'](_0x3351b2[_0x30a3('0x47')][_0x30a3('0x35')]);_0xeb47cc[_0x30a3('0x34')]=qs[_0x30a3('0x34')](_0x3351b2['query']['offset']);}_0xeb47cc[_0x30a3('0x6f')]=qs[_0x30a3('0x4f')](_0x3351b2[_0x30a3('0x47')][_0x30a3('0x4f')]);_0xeb47cc[_0x30a3('0x50')]=qs[_0x30a3('0x48')](_['pick'](_0x3351b2[_0x30a3('0x47')],_0xa2ff88[_0x30a3('0x48')]));_0xeb47cc['where'][_0x30a3('0x73')]=_0x4f153b['id'];if(_0x3351b2[_0x30a3('0x47')][_0x30a3('0x52')]){_0xeb47cc[_0x30a3('0x50')]=_[_0x30a3('0x53')](_0xeb47cc[_0x30a3('0x50')],{'$or':_[_0x30a3('0x40')](_0xeb47cc[_0x30a3('0x4a')],function(_0x648020){var _0x3fd554={};_0x3fd554[_0x648020]={'$like':'%'+_0x3351b2[_0x30a3('0x47')]['filter']+'%'};return _0x3fd554;})});}_0xeb47cc=_[_0x30a3('0x53')]({},_0xeb47cc,_0x3351b2[_0x30a3('0x55')]);return db[_0x30a3('0xa8')]['count']({'where':_0xeb47cc[_0x30a3('0x50')]})[_0x30a3('0x25')](function(_0x440da0){_0x445509[_0x30a3('0x36')]=_0x440da0;if(_0x3351b2[_0x30a3('0x47')][_0x30a3('0x56')]){_0xeb47cc[_0x30a3('0x57')]=[{'model':db[_0x30a3('0xa7')],'as':_0x30a3('0xc5'),'required':![]},{'model':db['User'],'as':_0x30a3('0xc6'),'attributes':[_0x30a3('0x3d'),_0x30a3('0xc7'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x30a3('0x3d'),_0x30a3('0xc8')],'where':_0x3351b2[_0x30a3('0x47')][_0x30a3('0xc9')]?{'id':_0x3351b2[_0x30a3('0x47')][_0x30a3('0xc9')]}:undefined,'required':_0x3351b2['query'][_0x30a3('0xc9')]?!![]:![]}];}return db[_0x30a3('0xa8')][_0x30a3('0x58')](_0xeb47cc);})[_0x30a3('0x25')](function(_0x4496b6){_0x445509['rows']=_0x4496b6;return _0x445509;});}})[_0x30a3('0x25')](respondWithFilteredResult(_0x42a57d,_0xeb47cc))[_0x30a3('0x5a')](handleError(_0x42a57d,null));};exports[_0x30a3('0x3e')]=function(_0x52d0cf,_0x5cb065,_0x440b71){var _0x20c6db,_0x5b8adb,_0x474696;if(_['isNil'](_0x52d0cf[_0x30a3('0x68')][_0x30a3('0x68')])||_0x52d0cf[_0x30a3('0x68')]['body']===''){throw new db[(_0x30a3('0x7e'))][(_0x30a3('0x9b'))](_0x30a3('0x9d'));}if(_[_0x30a3('0x9a')](_0x52d0cf[_0x30a3('0x68')]['to'])){throw new db[(_0x30a3('0x7e'))][(_0x30a3('0x9b'))](_0x30a3('0xca'));}_0x20c6db=_0x52d0cf[_0x30a3('0x68')]['to'];return db[_0x30a3('0x41')]['find']({'where':{'id':_0x52d0cf[_0x30a3('0x69')]['id']},'include':[{'model':db[_0x30a3('0xa2')],'as':_0x30a3('0xcb'),'include':[{'model':db[_0x30a3('0xa7')],'as':_0x30a3('0xa6'),'where':{'mobile':_0x20c6db},'limit':0x1,'order':[[_0x30a3('0x82'),_0x30a3('0xa3')]]}]}]})[_0x30a3('0x25')](handleEntityNotFound(_0x5cb065,null))[_0x30a3('0x25')](function(_0x36e52c){if(_0x36e52c&&_0x36e52c[_0x30a3('0xcb')]){_0x5b8adb=_0x36e52c[_0x30a3('0x3b')]({'plain':!![]});if(_0x5b8adb[_0x30a3('0xcb')]&&_0x5b8adb['List'][_0x30a3('0xa6')][_0x30a3('0x4c')]){return _0x5b8adb[_0x30a3('0xcb')][_0x30a3('0xa6')][0x0];}return db['CmContact'][_0x30a3('0x5e')](_[_0x30a3('0x1c')](_0x52d0cf[_0x30a3('0x68')],{'firstName':_0x20c6db,'mobile':_0x20c6db,'phone':_0x20c6db,'ListId':_0x5b8adb[_0x30a3('0xcc')]}));}})[_0x30a3('0x25')](handleEntityNotFound(_0x5cb065,null))[_0x30a3('0x25')](function(_0x38f4ae){if(_0x38f4ae){_0x474696=_0x38f4ae;return db['SmsInteraction']['find']({'where':{'ContactId':_0x474696['id'],'closed':![],'SmsAccountId':_0x5b8adb['id']}})[_0x30a3('0x25')](function(_0x5d2703){if(_0x5d2703){return[_0x5d2703,![]];}return db['SmsInteraction']['create']({'UserId':_0x52d0cf[_0x30a3('0x5f')]['id'],'ContactId':_0x474696['id'],'SmsAccountId':_0x5b8adb['id'],'phone':_0x20c6db,'firstMsgDirection':_0x30a3('0xcd'),'Messages':[_[_0x30a3('0x53')](_0x52d0cf['body'],{'read':![],'body':_0x52d0cf[_0x30a3('0x68')][_0x30a3('0x68')],'phone':_0x20c6db,'SmsAccountId':_0x5b8adb['id'],'UserId':_0x52d0cf['user']['id'],'ContactId':_0x474696['id']})]},{'include':[{'model':db[_0x30a3('0xae')],'as':'Messages'}]})[_0x30a3('0x25')](function(_0x222d4d){return[_0x222d4d,!![]];});});}})[_0x30a3('0xa9')](function(_0x2d0775,_0x486967){if(_0x486967){return _0x2d0775;}return db[_0x30a3('0xae')][_0x30a3('0x5e')](_[_0x30a3('0x53')](_0x52d0cf['body'],{'read':![],'body':_0x52d0cf[_0x30a3('0x68')][_0x30a3('0x68')],'phone':_0x20c6db,'SmsAccountId':_0x5b8adb['id'],'SmsInteractionId':_0x2d0775['id'],'UserId':_0x52d0cf[_0x30a3('0x5f')]['id'],'ContactId':_0x474696['id']}))[_0x30a3('0x25')](function(_0x18ab68){_0x2d0775[_0x30a3('0xce')]['Messages']=[];_0x2d0775[_0x30a3('0xce')]['Messages'][_0x30a3('0xcf')](_0x18ab68[_0x30a3('0xce')]);return _0x2d0775;});})[_0x30a3('0x25')](respondWithResult(_0x5cb065,null))[_0x30a3('0x5a')](handleError(_0x5cb065,null));};exports[_0x30a3('0x32')]=function(_0x36046d,_0x3f6917,_0x485cef){if(_0x36046d[_0x30a3('0x68')]['id']){delete _0x36046d[_0x30a3('0x68')]['id'];}var _0x596af7,_0x13f9a6,_0x507871;return db[_0x30a3('0x41')][_0x30a3('0x5d')]({'where':{'id':_0x36046d['params']['id']}})['then'](handleEntityNotFound(_0x3f6917,null))[_0x30a3('0x25')](function(_0x1464dd){if(_0x1464dd){_0x507871=_0x1464dd;logger[_0x30a3('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x30a3('0x32'),'received\x20delivery\x20report\x20from',_0x1464dd[_0x30a3('0x54')],util[_0x30a3('0xd0')](_0x36046d[_0x30a3('0x68')],{'showHidden':![],'depth':null}));switch(_0x1464dd['type']){case _0x30a3('0x8b'):if(_0x36046d['body']['skebby_dispatch_id']&&_0x36046d[_0x30a3('0x68')]['status']){_0x13f9a6=_0x36046d['body']['status'];return db[_0x30a3('0xae')]['find']({'where':{'messageId':_0x36046d[_0x30a3('0x68')][_0x30a3('0xd1')]}});}break;case _0x30a3('0x8e'):if(_0x36046d[_0x30a3('0x68')]['requestid']&&_0x36046d['body']['statusInt']){_0x13f9a6=_0x36046d[_0x30a3('0x68')][_0x30a3('0xd2')];return db[_0x30a3('0xae')][_0x30a3('0x5d')]({'where':{'messageId':_0x36046d[_0x30a3('0x68')][_0x30a3('0xd3')]}});}break;case _0x30a3('0x8f'):if(_0x36046d[_0x30a3('0x68')][_0x30a3('0x90')]&&_0x36046d[_0x30a3('0x68')][_0x30a3('0xd4')]){_0x13f9a6=_0x36046d[_0x30a3('0x68')][_0x30a3('0xd4')];return db[_0x30a3('0xae')][_0x30a3('0x5d')]({'where':{'messageId':_0x36046d[_0x30a3('0x68')][_0x30a3('0x90')]}});}break;case'infobip':var _0x5e04e3=_0x36046d['body'][_0x30a3('0x91')][0x0];if(_0x5e04e3['messageId']&&_0x5e04e3[_0x30a3('0x32')]['groupName']===_0x30a3('0xd5')){_0x13f9a6=_0x5e04e3[_0x30a3('0x32')][_0x30a3('0xd6')];return db[_0x30a3('0xae')][_0x30a3('0x5d')]({'where':{'messageId':_0x5e04e3[_0x30a3('0x89')]}});}break;case _0x30a3('0x95'):if(_0x36046d[_0x30a3('0x68')][_0x30a3('0x89')]&&_0x36046d[_0x30a3('0x68')][_0x30a3('0x32')]){_0x13f9a6=_0x36046d[_0x30a3('0x68')][_0x30a3('0x32')];return db[_0x30a3('0xae')][_0x30a3('0x5d')]({'where':{'messageId':_0x36046d['body']['messageId']}});}break;case _0x30a3('0x97'):if(_0x36046d[_0x30a3('0x68')][0x0]['message']['id']){_0x13f9a6=_0x36046d[_0x30a3('0x68')][0x0][_0x30a3('0x54')];return db['SmsMessage']['find']({'where':{'messageId':_0x36046d[_0x30a3('0x68')][0x0][_0x30a3('0x2e')]['id']}});}break;case _0x30a3('0x98'):if(_0x36046d[_0x30a3('0x68')]['redif']&&_0x36046d[_0x30a3('0x68')]['status']){_0x13f9a6=_0x36046d[_0x30a3('0x68')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x36046d['body'][_0x30a3('0xd7')]}});}break;}}})[_0x30a3('0x25')](handleEntityNotFound(_0x3f6917,null))[_0x30a3('0x25')](function(_0x379f2c){if(_0x379f2c){_0x596af7=_0x379f2c;switch(_0x507871[_0x30a3('0x54')]){case _0x30a3('0x8b'):if(_0x13f9a6===_0x30a3('0xd5')){return _0x596af7[_0x30a3('0x67')]({'read':!![]});}else{logger[_0x30a3('0x2c')](_0x30a3('0x2a'),'status','skebby',util[_0x30a3('0xd0')](_0x36046d[_0x30a3('0x68')],{'showHidden':![],'depth':null}));}break;case _0x30a3('0x8e'):if(_0x13f9a6==='1'){return _0x596af7['update']({'read':!![]});}else{logger[_0x30a3('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x30a3('0x32'),_0x30a3('0x8b'),util[_0x30a3('0xd0')](_0x36046d[_0x30a3('0x68')],{'showHidden':![],'depth':null}));}break;case _0x30a3('0x8f'):if(!_0x36046d[_0x30a3('0x68')][_0x30a3('0xd8')]&&_0x13f9a6>=0xc8&&_0x13f9a6<=0xce){return _0x596af7[_0x30a3('0x67')]({'read':!![]});}else{logger[_0x30a3('0x2c')](_0x30a3('0x2a'),'status',_0x30a3('0x8f'),util[_0x30a3('0xd0')](_0x36046d[_0x30a3('0x68')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x553ec4=_0x36046d[_0x30a3('0x68')][_0x30a3('0x91')][0x0];if(_0x553ec4[_0x30a3('0x32')][_0x30a3('0xd6')]==='DELIVERED'){return _0x596af7[_0x30a3('0x67')]({'read':!![]});}else{logger[_0x30a3('0x2c')](_0x30a3('0x2a'),_0x30a3('0x32'),_0x30a3('0xd9'),util[_0x30a3('0xd0')](_0x36046d['body'],{'showHidden':![],'depth':null}));}break;case _0x30a3('0x95'):if(_0x13f9a6==_0x30a3('0xda')||_0x13f9a6==_0x30a3('0xdb')){return _0x596af7[_0x30a3('0x67')]({'read':!![]});}else{logger[_0x30a3('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x30a3('0x32'),_0x30a3('0x95'),util['inspect'](_0x36046d[_0x30a3('0x68')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x13f9a6=='message-delivered'){return _0x596af7['update']({'read':!![]});}else{logger[_0x30a3('0x2c')](_0x30a3('0x2a'),_0x30a3('0x32'),'bandwidth',util['inspect'](_0x36046d[_0x30a3('0x68')],{'showHidden':![],'depth':null}));}break;case _0x30a3('0x98'):if(_0x13f9a6===_0x30a3('0xdc')||_0x13f9a6===_0x30a3('0xdd')){return _0x596af7[_0x30a3('0x67')]({'read':!![]});}else{logger[_0x30a3('0x2c')](_0x30a3('0x2a'),_0x30a3('0x32'),'intelepeer',util[_0x30a3('0xd0')](_0x36046d['body'],{'showHidden':![],'depth':null}));}break;}return _0x596af7;}})[_0x30a3('0x25')](respondWithResult(_0x3f6917,null))[_0x30a3('0x5a')](handleError(_0x3f6917,null));};exports[_0x30a3('0xde')]=function(_0x4edaa4,_0x474739,_0x268363){var _0x2a17cb,_0x3e9386,_0x3ab48f;return db[_0x30a3('0x41')][_0x30a3('0x5d')]({'where':{'id':_0x4edaa4[_0x30a3('0x69')]['id']}})['then'](handleEntityNotFound(_0x474739,null))[_0x30a3('0x25')](function(_0x40b293){if(_0x40b293){_0x3ab48f=_0x40b293;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x30a3('0x32'),_0x30a3('0xdf'),_0x40b293[_0x30a3('0x54')],util[_0x30a3('0xd0')](_0x4edaa4[_0x30a3('0x47')],{'showHidden':![],'depth':null}));switch(_0x40b293[_0x30a3('0x54')]){case _0x30a3('0x92'):if(_0x4edaa4[_0x30a3('0x47')]['message-id']&&_0x4edaa4[_0x30a3('0x47')][_0x30a3('0xe0')]){_0x3e9386=_0x4edaa4[_0x30a3('0x47')][_0x30a3('0xe0')];return db[_0x30a3('0xae')][_0x30a3('0x5d')]({'where':{'messageId':_0x4edaa4['query'][_0x30a3('0xe1')]}});}break;}}})[_0x30a3('0x25')](handleEntityNotFound(_0x474739,null))['then'](function(_0x5722fa){if(_0x5722fa){_0x2a17cb=_0x5722fa;switch(_0x3ab48f[_0x30a3('0x54')]){case _0x30a3('0x92'):if(_0x3e9386==='2'||_0x3e9386==='6'){return _0x2a17cb[_0x30a3('0x67')]({'read':!![]});}else{logger[_0x30a3('0x2c')](_0x30a3('0x2a'),_0x30a3('0x32'),_0x30a3('0x92'),util['inspect'](_0x4edaa4['query'],{'showHidden':![],'depth':null}));};break;}return _0x2a17cb;}})[_0x30a3('0x25')](respondWithResult(_0x474739,null))[_0x30a3('0x5a')](handleError(_0x474739,null));};exports[_0x30a3('0xe2')]=function(_0x42f61f,_0xadd994,_0x46e7e3){return db[_0x30a3('0x41')][_0x30a3('0x5d')]({'where':{'id':_0x42f61f[_0x30a3('0x69')]['id']}})[_0x30a3('0x25')](handleEntityNotFound(_0xadd994,null))[_0x30a3('0x25')](function(_0x969aca){if(_0x969aca){return _0x969aca[_0x30a3('0xe2')](_0x42f61f[_0x30a3('0x68')][_0x30a3('0x71')],_[_0x30a3('0xa5')](_0x42f61f[_0x30a3('0x68')],[_0x30a3('0x71'),'id'])||{})[_0x30a3('0xa9')](function(_0x5f2512){for(var _0x536089=0x0;_0x536089<_0x42f61f['body']['ids'][_0x30a3('0x4c')];_0x536089+=0x1){socket[_0x30a3('0xe3')](_0x30a3('0xe4'),{'UserId':Number(_0x42f61f[_0x30a3('0x68')]['ids'][_0x536089]),'SmsAccountId':Number(_0x42f61f[_0x30a3('0x69')]['id'])});}return _0x5f2512;});}})[_0x30a3('0x25')](respondWithResult(_0xadd994,null))[_0x30a3('0x5a')](handleError(_0xadd994,null));};exports[_0x30a3('0xe5')]=function(_0x5773bb,_0x4b4bad,_0x51eb02){return db[_0x30a3('0x41')][_0x30a3('0x5d')]({'where':{'id':_0x5773bb[_0x30a3('0x69')]['id']}})['then'](handleEntityNotFound(_0x4b4bad,null))[_0x30a3('0x25')](function(_0x432280){if(_0x432280){return _0x432280[_0x30a3('0xe5')](_0x5773bb['query']['ids'])[_0x30a3('0x25')](function(){if(_[_0x30a3('0xe6')](_0x5773bb[_0x30a3('0x47')]['ids'])){for(var _0x336447=0x0;_0x336447<_0x5773bb[_0x30a3('0x47')][_0x30a3('0x71')][_0x30a3('0x4c')];_0x336447+=0x1){socket[_0x30a3('0xe3')]('userSmsAccount:remove',{'UserId':Number(_0x5773bb['query'][_0x30a3('0x71')][_0x336447]),'SmsAccountId':Number(_0x5773bb[_0x30a3('0x69')]['id'])});}}else{socket[_0x30a3('0xe3')](_0x30a3('0xe7'),{'UserId':Number(_0x5773bb['query']['ids']),'SmsAccountId':Number(_0x5773bb[_0x30a3('0x69')]['id'])});}});}})[_0x30a3('0x25')](respondWithStatusCode(_0x4b4bad,null))[_0x30a3('0x5a')](handleError(_0x4b4bad,null));};exports[_0x30a3('0xe8')]=function(_0x43c04f,_0x559038,_0x416013){var _0x590a57={};var _0x11e3b8={};var _0x2b62c5;var _0x230b94;return db[_0x30a3('0x41')][_0x30a3('0x6e')]({'where':{'id':_0x43c04f[_0x30a3('0x69')]['id']}})[_0x30a3('0x25')](handleEntityNotFound(_0x559038,null))['then'](function(_0x426f84){if(_0x426f84){_0x2b62c5=_0x426f84;_0x11e3b8[_0x30a3('0x45')]=_[_0x30a3('0x46')](db[_0x30a3('0xb1')][_0x30a3('0x42')]);_0x11e3b8[_0x30a3('0x47')]=_['keys'](_0x43c04f[_0x30a3('0x47')]);_0x11e3b8[_0x30a3('0x48')]=_[_0x30a3('0x49')](_0x11e3b8[_0x30a3('0x45')],_0x11e3b8[_0x30a3('0x47')]);_0x590a57[_0x30a3('0x4a')]=_['intersection'](_0x11e3b8[_0x30a3('0x45')],qs[_0x30a3('0x4b')](_0x43c04f['query'][_0x30a3('0x4b')]));_0x590a57[_0x30a3('0x4a')]=_0x590a57[_0x30a3('0x4a')]['length']?_0x590a57[_0x30a3('0x4a')]:_0x11e3b8[_0x30a3('0x45')];_0x590a57[_0x30a3('0x6f')]=qs[_0x30a3('0x4f')](_0x43c04f[_0x30a3('0x47')]['sort']);_0x590a57[_0x30a3('0x50')]=qs[_0x30a3('0x48')](_[_0x30a3('0x51')](_0x43c04f[_0x30a3('0x47')],_0x11e3b8[_0x30a3('0x48')]));if(_0x43c04f['query'][_0x30a3('0x52')]){_0x590a57[_0x30a3('0x50')]=_[_0x30a3('0x53')](_0x590a57[_0x30a3('0x50')],{'$or':_[_0x30a3('0x40')](_0x590a57[_0x30a3('0x4a')],function(_0xa03c41){var _0x12f313={};_0x12f313[_0xa03c41]={'$like':'%'+_0x43c04f[_0x30a3('0x47')][_0x30a3('0x52')]+'%'};return _0x12f313;})});}_0x590a57=_[_0x30a3('0x53')]({},_0x590a57,_0x43c04f[_0x30a3('0x55')]);return _0x2b62c5[_0x30a3('0xe8')](_0x590a57);}})['then'](function(_0x161c01){if(_0x161c01){_0x230b94=_0x161c01['length'];if(!_0x43c04f[_0x30a3('0x47')][_0x30a3('0x4d')]('nolimit')){_0x590a57[_0x30a3('0x35')]=qs[_0x30a3('0x35')](_0x43c04f['query']['limit']);_0x590a57[_0x30a3('0x34')]=qs[_0x30a3('0x34')](_0x43c04f['query']['offset']);}return _0x2b62c5[_0x30a3('0xe8')](_0x590a57);}})[_0x30a3('0x25')](function(_0x11aefc){if(_0x11aefc){return _0x11aefc?{'count':_0x230b94,'rows':_0x11aefc}:null;}})[_0x30a3('0x25')](respondWithResult(_0x559038,null))[_0x30a3('0x5a')](handleError(_0x559038,null));}; \ No newline at end of file +var _0xfffc=['AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','Contact','User','Owner','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','DESC','Messages','dataValues','push','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','update','error_code','infobip','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./smsAccount.socket','register','client','http','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','destroy','get','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SmsAccounts','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','getDispositions','intersection','ids','getAnswers','findOne','CannedAnswer','nolimit','order','removeAnswers','sms','Applications','account','orderBy','priority','asc','Sequelize','difference','createdAt','updatedAt','CompanyId','mobile','twilio','Body','messageId','MessageSid','skebby','from','sender','connectel','clicksend','message_id','plivo','From','MessageUUID','results','text','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','ListId','CmContact','Contacts','list','SmsInteraction','spread','interaction','created','autoclose','applications','close','*,*,*,*','SmsMessage'];(function(_0xdf951c,_0x8dc57d){var _0xc368ec=function(_0x10943a){while(--_0x10943a){_0xdf951c['push'](_0xdf951c['shift']());}};_0xc368ec(++_0x8dc57d);}(_0xfffc,0x124));var _0xcfff=function(_0x5a22f3,_0x43376a){_0x5a22f3=_0x5a22f3-0x0;var _0x1f066d=_0xfffc[_0x5a22f3];return _0x1f066d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcfff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcfff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcfff('0x2'));var util=require(_0xcfff('0x3'));var path=require(_0xcfff('0x4'));var sox=require(_0xcfff('0x5'));var csv=require(_0xcfff('0x6'));var ejs=require(_0xcfff('0x7'));var fs=require('fs');var fs_extra=require(_0xcfff('0x8'));var _=require(_0xcfff('0x9'));var squel=require(_0xcfff('0xa'));var crypto=require(_0xcfff('0xb'));var jsforce=require(_0xcfff('0xc'));var deskjs=require(_0xcfff('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcfff('0xe'));var Redis=require(_0xcfff('0xf'));var authService=require(_0xcfff('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcfff('0x11'));var hardwareService=require(_0xcfff('0x12'));var logger=require('../../config/logger')(_0xcfff('0x13'));var utils=require(_0xcfff('0x14'));var config=require(_0xcfff('0x15'));var licenseUtil=require(_0xcfff('0x16'));var db=require(_0xcfff('0x17'))['db'];config['redis']=_[_0xcfff('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcfff('0x19'))(new Redis(config[_0xcfff('0x1a')]));require(_0xcfff('0x1b'))[_0xcfff('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xcfff('0x1d')][_0xcfff('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x321408,_0x5ebc48,_0x5a69b1,_0x281ebb){return new BPromise(function(_0x3ca95c,_0x5ea9b7){var _0x1b3255=_0x281ebb||client;return _0x1b3255[_0xcfff('0x1f')](_0x321408,_0x5a69b1)[_0xcfff('0x20')](function(_0x5b4bcb){logger['info'](_0xcfff('0x21'),_0x5ebc48,_0xcfff('0x22'));logger[_0xcfff('0x23')](_0xcfff('0x24'),_0x5ebc48,_0xcfff('0x22'),JSON['stringify'](_0x5b4bcb));if(_0x5b4bcb['error']){if(_0x5b4bcb[_0xcfff('0x25')][_0xcfff('0x26')]===0x1f4){logger[_0xcfff('0x25')](_0xcfff('0x21'),_0x5ebc48,_0x5b4bcb[_0xcfff('0x25')][_0xcfff('0x27')]);return _0x5ea9b7(_0x5b4bcb[_0xcfff('0x25')][_0xcfff('0x27')]);}logger[_0xcfff('0x25')](_0xcfff('0x21'),_0x5ebc48,_0x5b4bcb[_0xcfff('0x25')]['message']);return _0x3ca95c(_0x5b4bcb[_0xcfff('0x25')]['message']);}else{logger[_0xcfff('0x28')](_0xcfff('0x21'),_0x5ebc48,_0xcfff('0x22'));_0x3ca95c(_0x5b4bcb['result']['message']);}})['catch'](function(_0x4f1df8){logger[_0xcfff('0x25')](_0xcfff('0x21'),_0x5ebc48,_0x4f1df8);_0x5ea9b7(_0x4f1df8);});});}function respondWithStatusCode(_0x663b7,_0x4a4d80){_0x4a4d80=_0x4a4d80||0xcc;return function(_0x35b154){if(_0x35b154){return _0x663b7[_0xcfff('0x29')](_0x4a4d80);}return _0x663b7[_0xcfff('0x2a')](_0x4a4d80)[_0xcfff('0x2b')]();};}function respondWithResult(_0x6a261e,_0x1150c5){_0x1150c5=_0x1150c5||0xc8;return function(_0x280cfa){if(_0x280cfa){return _0x6a261e[_0xcfff('0x2a')](_0x1150c5)['json'](_0x280cfa);}};}function respondWithFilteredResult(_0x3951b4,_0x1d5b4f){return function(_0x2a1dd1){if(_0x2a1dd1){var _0x25db93=typeof _0x1d5b4f[_0xcfff('0x2c')]==='undefined'&&typeof _0x1d5b4f[_0xcfff('0x2d')]===_0xcfff('0x2e');var _0x4170c8=_0x2a1dd1[_0xcfff('0x2f')];var _0x580b10=_0x25db93?0x0:_0x1d5b4f['offset'];var _0x843000=_0x25db93?_0x2a1dd1[_0xcfff('0x2f')]:_0x1d5b4f[_0xcfff('0x2c')]+_0x1d5b4f[_0xcfff('0x2d')];var _0x4288d3;if(_0x843000>=_0x4170c8){_0x843000=_0x4170c8;_0x4288d3=0xc8;}else{_0x4288d3=0xce;}_0x3951b4[_0xcfff('0x2a')](_0x4288d3);return _0x3951b4[_0xcfff('0x30')](_0xcfff('0x31'),_0x580b10+'-'+_0x843000+'/'+_0x4170c8)[_0xcfff('0x32')](_0x2a1dd1);}return null;};}function patchUpdates(_0x320e51){return function(_0x3a867a){try{jsonpatch[_0xcfff('0x33')](_0x3a867a,_0x320e51,!![]);}catch(_0x120025){return BPromise[_0xcfff('0x34')](_0x120025);}return _0x3a867a['save']();};}function saveUpdates(_0x2d27d2,_0x1eb13f){return function(_0x3063de){if(_0x3063de){return _0x3063de['update'](_0x2d27d2)['then'](function(_0xbc7ed4){return _0xbc7ed4;});}return null;};}function removeEntity(_0x357b59,_0x2a3761){return function(_0x317993){if(_0x317993){return _0x317993[_0xcfff('0x35')]()['then'](function(){var _0x56d385=_0x317993[_0xcfff('0x36')]({'plain':!![]});var _0x48362a='SmsAccounts';return db[_0xcfff('0x37')][_0xcfff('0x35')]({'where':{'type':_0x48362a,'resourceId':_0x56d385['id']}})[_0xcfff('0x20')](function(){return _0x317993;});})[_0xcfff('0x20')](function(){_0x357b59[_0xcfff('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c17,_0x251aa3){return function(_0x379191){if(!_0x379191){_0x3e5c17[_0xcfff('0x29')](0x194);}return _0x379191;};}function handleError(_0x885d4,_0x5cc71d){_0x5cc71d=_0x5cc71d||0x1f4;return function(_0x241527){logger['error'](_0x241527[_0xcfff('0x38')]);if(_0x241527['name']){delete _0x241527[_0xcfff('0x39')];}_0x885d4['status'](_0x5cc71d)[_0xcfff('0x3a')](_0x241527);};}exports['index']=function(_0xf7b73e,_0x25e18f){var _0x81bf9f={'include':[{'model':db[_0xcfff('0x3b')],'as':_0xcfff('0x3c')}]},_0x341071={},_0x30894c={'count':0x0,'rows':[]};var _0x143c05=_[_0xcfff('0x3d')](db[_0xcfff('0x3e')][_0xcfff('0x3f')],function(_0x5d440b){return{'name':_0x5d440b[_0xcfff('0x40')],'type':_0x5d440b[_0xcfff('0x41')][_0xcfff('0x42')]};});_0x341071[_0xcfff('0x43')]=_[_0xcfff('0x3d')](_0x143c05,_0xcfff('0x39'));_0x341071[_0xcfff('0x44')]=_[_0xcfff('0x45')](_0xf7b73e[_0xcfff('0x44')]);_0x341071[_0xcfff('0x46')]=_['intersection'](_0x341071[_0xcfff('0x43')],_0x341071['query']);_0x81bf9f[_0xcfff('0x47')]=_['intersection'](_0x341071['model'],qs[_0xcfff('0x48')](_0xf7b73e['query'][_0xcfff('0x48')]));_0x81bf9f[_0xcfff('0x47')]=_0x81bf9f[_0xcfff('0x47')][_0xcfff('0x49')]?_0x81bf9f[_0xcfff('0x47')]:_0x341071['model'];if(!_0xf7b73e[_0xcfff('0x44')][_0xcfff('0x4a')]('nolimit')){_0x81bf9f[_0xcfff('0x2d')]=qs['limit'](_0xf7b73e[_0xcfff('0x44')][_0xcfff('0x2d')]);_0x81bf9f[_0xcfff('0x2c')]=qs[_0xcfff('0x2c')](_0xf7b73e[_0xcfff('0x44')][_0xcfff('0x2c')]);}_0x81bf9f['order']=qs[_0xcfff('0x4b')](_0xf7b73e['query'][_0xcfff('0x4b')]);_0x81bf9f['where']=qs[_0xcfff('0x46')](_[_0xcfff('0x4c')](_0xf7b73e[_0xcfff('0x44')],_0x341071[_0xcfff('0x46')]),_0x143c05);if(_0xf7b73e['query']['filter']){_0x81bf9f[_0xcfff('0x4d')]=_[_0xcfff('0x4e')](_0x81bf9f[_0xcfff('0x4d')],{'$or':_[_0xcfff('0x3d')](_0x143c05,function(_0x245eba){if(_0x245eba[_0xcfff('0x41')]!==_0xcfff('0x4f')){var _0x514d45={};_0x514d45[_0x245eba[_0xcfff('0x39')]]={'$like':'%'+_0xf7b73e[_0xcfff('0x44')][_0xcfff('0x50')]+'%'};return _0x514d45;}})});}_0x81bf9f=_['merge']({},_0x81bf9f,_0xf7b73e[_0xcfff('0x51')]);var _0x367169={'where':_0x81bf9f[_0xcfff('0x4d')]};return db[_0xcfff('0x3e')]['count'](_0x367169)[_0xcfff('0x20')](function(_0x5aa323){_0x30894c[_0xcfff('0x2f')]=_0x5aa323;if(_0xf7b73e[_0xcfff('0x44')][_0xcfff('0x52')]){_0x81bf9f[_0xcfff('0x53')]=[{'all':!![]}];}return db[_0xcfff('0x3e')][_0xcfff('0x54')](_0x81bf9f);})['then'](function(_0x58c0f1){_0x30894c[_0xcfff('0x55')]=_0x58c0f1;return _0x30894c;})[_0xcfff('0x20')](respondWithFilteredResult(_0x25e18f,_0x81bf9f))[_0xcfff('0x56')](handleError(_0x25e18f,null));};exports[_0xcfff('0x57')]=function(_0x53a342,_0x127c2e){var _0x4b4915={'raw':![],'where':{'id':_0x53a342[_0xcfff('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xcfff('0x3c')}]},_0x1ff6cc={};_0x1ff6cc[_0xcfff('0x43')]=_['keys'](db['SmsAccount'][_0xcfff('0x3f')]);_0x1ff6cc[_0xcfff('0x44')]=_[_0xcfff('0x45')](_0x53a342[_0xcfff('0x44')]);_0x1ff6cc[_0xcfff('0x46')]=_['intersection'](_0x1ff6cc['model'],_0x1ff6cc[_0xcfff('0x44')]);_0x4b4915[_0xcfff('0x47')]=_['intersection'](_0x1ff6cc[_0xcfff('0x43')],qs[_0xcfff('0x48')](_0x53a342[_0xcfff('0x44')]['fields']));_0x4b4915[_0xcfff('0x47')]=_0x4b4915[_0xcfff('0x47')][_0xcfff('0x49')]?_0x4b4915[_0xcfff('0x47')]:_0x1ff6cc[_0xcfff('0x43')];if(_0x53a342[_0xcfff('0x44')][_0xcfff('0x52')]){_0x4b4915['include']=[{'all':!![]}];}_0x4b4915=_[_0xcfff('0x4e')]({},_0x4b4915,_0x53a342[_0xcfff('0x51')]);return db[_0xcfff('0x3e')][_0xcfff('0x59')](_0x4b4915)[_0xcfff('0x20')](handleEntityNotFound(_0x127c2e,null))[_0xcfff('0x20')](respondWithResult(_0x127c2e,null))[_0xcfff('0x56')](handleError(_0x127c2e,null));};exports['create']=function(_0x46110d,_0x4b7ebe){return db['SmsAccount'][_0xcfff('0x5a')](_0x46110d[_0xcfff('0x5b')],{})[_0xcfff('0x20')](function(_0x45473f){var _0x232bdb=_0x46110d['user'][_0xcfff('0x36')]({'plain':!![]});if(!_0x232bdb)throw new Error(_0xcfff('0x5c'));if(_0x232bdb[_0xcfff('0x5d')]===_0xcfff('0x5e')){var _0x522205=_0x45473f[_0xcfff('0x36')]({'plain':!![]});var _0x32f5ef=_0xcfff('0x5f');return db[_0xcfff('0x60')]['find']({'where':{'name':_0x32f5ef,'userProfileId':_0x232bdb['userProfileId']},'raw':!![]})['then'](function(_0x39653a){if(_0x39653a&&_0x39653a[_0xcfff('0x61')]===0x0){return db[_0xcfff('0x37')][_0xcfff('0x5a')]({'name':_0x522205['name'],'resourceId':_0x522205['id'],'type':_0x39653a[_0xcfff('0x39')],'sectionId':_0x39653a['id']},{})[_0xcfff('0x20')](function(){return _0x45473f;});}else{return _0x45473f;}})[_0xcfff('0x56')](function(_0x2b9022){logger['error'](_0xcfff('0x62'),_0x2b9022);throw _0x2b9022;});}return _0x45473f;})[_0xcfff('0x20')](respondWithResult(_0x4b7ebe,0xc9))['catch'](handleError(_0x4b7ebe,null));};exports['update']=function(_0x1c9c32,_0x3e46a3){if(_0x1c9c32[_0xcfff('0x5b')]['id']){delete _0x1c9c32[_0xcfff('0x5b')]['id'];}return db[_0xcfff('0x3e')][_0xcfff('0x59')]({'where':{'id':_0x1c9c32[_0xcfff('0x58')]['id']},'include':[{'model':db[_0xcfff('0x3b')],'as':_0xcfff('0x3c')}]})[_0xcfff('0x20')](handleEntityNotFound(_0x3e46a3,null))[_0xcfff('0x20')](saveUpdates(_0x1c9c32['body'],null))[_0xcfff('0x20')](respondWithResult(_0x3e46a3,null))[_0xcfff('0x56')](handleError(_0x3e46a3,null));};exports[_0xcfff('0x35')]=function(_0x16d62c,_0x5a77a1){return db[_0xcfff('0x3e')][_0xcfff('0x59')]({'where':{'id':_0x16d62c['params']['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x5a77a1,null))[_0xcfff('0x20')](removeEntity(_0x5a77a1,null))[_0xcfff('0x56')](handleError(_0x5a77a1,null));};exports[_0xcfff('0x63')]=function(_0x490ccf,_0x393040){return db[_0xcfff('0x3e')][_0xcfff('0x63')]()[_0xcfff('0x20')](respondWithResult(_0x393040,null))[_0xcfff('0x56')](handleError(_0x393040,null));};exports[_0xcfff('0x64')]=function(_0xfdaa6f,_0x3937da,_0x1e42bd){if(_0xfdaa6f[_0xcfff('0x5b')]['id']){delete _0xfdaa6f[_0xcfff('0x5b')]['id'];}return db[_0xcfff('0x3e')][_0xcfff('0x59')]({'where':{'id':_0xfdaa6f[_0xcfff('0x58')]['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x3937da,null))[_0xcfff('0x20')](function(_0x55de45){if(_0x55de45){_0xfdaa6f['body'][_0xcfff('0x65')]=_0x55de45['id'];return db[_0xcfff('0x66')][_0xcfff('0x5a')](_0xfdaa6f[_0xcfff('0x5b')]);}})['then'](respondWithResult(_0x3937da,null))[_0xcfff('0x56')](handleError(_0x3937da,null));};exports[_0xcfff('0x67')]=function(_0x5c8b77,_0x306b98,_0x22b70e){var _0x534b03={'raw':![],'where':{}};var _0x418089={};var _0x212b37={'count':0x0,'rows':[]};return db[_0xcfff('0x3e')]['findOne']({'where':{'id':_0x5c8b77[_0xcfff('0x58')]['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x306b98,null))[_0xcfff('0x20')](function(_0x3dbd79){if(_0x3dbd79){_0x418089[_0xcfff('0x43')]=_[_0xcfff('0x45')](db['Disposition'][_0xcfff('0x3f')]);_0x418089[_0xcfff('0x44')]=_[_0xcfff('0x45')](_0x5c8b77[_0xcfff('0x44')]);_0x418089[_0xcfff('0x46')]=_['intersection'](_0x418089[_0xcfff('0x43')],_0x418089[_0xcfff('0x44')]);_0x534b03[_0xcfff('0x47')]=_[_0xcfff('0x68')](_0x418089['model'],qs[_0xcfff('0x48')](_0x5c8b77[_0xcfff('0x44')]['fields']));_0x534b03[_0xcfff('0x47')]=_0x534b03[_0xcfff('0x47')][_0xcfff('0x49')]?_0x534b03[_0xcfff('0x47')]:_0x418089['model'];if(!_0x5c8b77['query']['hasOwnProperty']('nolimit')){_0x534b03[_0xcfff('0x2d')]=qs[_0xcfff('0x2d')](_0x5c8b77[_0xcfff('0x44')][_0xcfff('0x2d')]);_0x534b03[_0xcfff('0x2c')]=qs[_0xcfff('0x2c')](_0x5c8b77['query']['offset']);}_0x534b03['order']=qs[_0xcfff('0x4b')](_0x5c8b77[_0xcfff('0x44')][_0xcfff('0x4b')]);_0x534b03['where']=qs['filters'](_[_0xcfff('0x4c')](_0x5c8b77['query'],_0x418089['filters']));_0x534b03['where'][_0xcfff('0x65')]=_0x3dbd79['id'];if(_0x5c8b77['query'][_0xcfff('0x50')]){_0x534b03[_0xcfff('0x4d')]=_['merge'](_0x534b03[_0xcfff('0x4d')],{'$or':_[_0xcfff('0x3d')](_0x534b03[_0xcfff('0x47')],function(_0xdbc0ba){var _0x370578={};_0x370578[_0xdbc0ba]={'$like':'%'+_0x5c8b77[_0xcfff('0x44')][_0xcfff('0x50')]+'%'};return _0x370578;})});}_0x534b03=_[_0xcfff('0x4e')]({},_0x534b03,_0x5c8b77[_0xcfff('0x51')]);return db[_0xcfff('0x66')][_0xcfff('0x2f')]({'where':_0x534b03['where']})[_0xcfff('0x20')](function(_0x49b173){_0x212b37[_0xcfff('0x2f')]=_0x49b173;if(_0x5c8b77[_0xcfff('0x44')]['includeAll']){_0x534b03[_0xcfff('0x53')]=[{'all':!![]}];}return db[_0xcfff('0x66')]['findAll'](_0x534b03);})[_0xcfff('0x20')](function(_0x3a5656){_0x212b37['rows']=_0x3a5656;return _0x212b37;});}})[_0xcfff('0x20')](respondWithFilteredResult(_0x306b98,_0x534b03))['catch'](handleError(_0x306b98,null));};exports['removeDispositions']=function(_0x254d2e,_0x42aa96,_0x288119){return db[_0xcfff('0x3e')][_0xcfff('0x59')]({'where':{'id':_0x254d2e['params']['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x42aa96,null))[_0xcfff('0x20')](function(_0x8f50d){if(_0x8f50d){return _0x8f50d['removeDispositions'](_0x254d2e[_0xcfff('0x44')][_0xcfff('0x69')]);}})['then'](respondWithStatusCode(_0x42aa96,null))[_0xcfff('0x56')](handleError(_0x42aa96,null));};exports['addAnswer']=function(_0x26a95e,_0x5d251b,_0x4faace){if(_0x26a95e['body']['id']){delete _0x26a95e[_0xcfff('0x5b')]['id'];}return db[_0xcfff('0x3e')][_0xcfff('0x59')]({'where':{'id':_0x26a95e[_0xcfff('0x58')]['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x5d251b,null))[_0xcfff('0x20')](function(_0x12ca94){if(_0x12ca94){_0x26a95e['body'][_0xcfff('0x65')]=_0x12ca94['id'];return db['CannedAnswer'][_0xcfff('0x5a')](_0x26a95e[_0xcfff('0x5b')]);}})[_0xcfff('0x20')](respondWithResult(_0x5d251b,null))[_0xcfff('0x56')](handleError(_0x5d251b,null));};exports[_0xcfff('0x6a')]=function(_0x20d9ae,_0x2822ce,_0x1401ae){var _0x22cb8b={'raw':![],'where':{}};var _0x5a19ca={};var _0x4cf4fc={'count':0x0,'rows':[]};return db[_0xcfff('0x3e')][_0xcfff('0x6b')]({'where':{'id':_0x20d9ae[_0xcfff('0x58')]['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x2822ce,null))[_0xcfff('0x20')](function(_0xe72575){if(_0xe72575){_0x5a19ca[_0xcfff('0x43')]=_[_0xcfff('0x45')](db[_0xcfff('0x6c')]['rawAttributes']);_0x5a19ca['query']=_[_0xcfff('0x45')](_0x20d9ae[_0xcfff('0x44')]);_0x5a19ca[_0xcfff('0x46')]=_[_0xcfff('0x68')](_0x5a19ca['model'],_0x5a19ca[_0xcfff('0x44')]);_0x22cb8b[_0xcfff('0x47')]=_[_0xcfff('0x68')](_0x5a19ca['model'],qs[_0xcfff('0x48')](_0x20d9ae[_0xcfff('0x44')][_0xcfff('0x48')]));_0x22cb8b[_0xcfff('0x47')]=_0x22cb8b[_0xcfff('0x47')][_0xcfff('0x49')]?_0x22cb8b[_0xcfff('0x47')]:_0x5a19ca[_0xcfff('0x43')];if(!_0x20d9ae[_0xcfff('0x44')][_0xcfff('0x4a')](_0xcfff('0x6d'))){_0x22cb8b['limit']=qs[_0xcfff('0x2d')](_0x20d9ae['query'][_0xcfff('0x2d')]);_0x22cb8b[_0xcfff('0x2c')]=qs[_0xcfff('0x2c')](_0x20d9ae[_0xcfff('0x44')][_0xcfff('0x2c')]);}_0x22cb8b[_0xcfff('0x6e')]=qs['sort'](_0x20d9ae[_0xcfff('0x44')][_0xcfff('0x4b')]);_0x22cb8b[_0xcfff('0x4d')]=qs[_0xcfff('0x46')](_['pick'](_0x20d9ae[_0xcfff('0x44')],_0x5a19ca[_0xcfff('0x46')]));_0x22cb8b[_0xcfff('0x4d')]['SmsAccountId']=_0xe72575['id'];if(_0x20d9ae[_0xcfff('0x44')]['filter']){_0x22cb8b[_0xcfff('0x4d')]=_[_0xcfff('0x4e')](_0x22cb8b[_0xcfff('0x4d')],{'$or':_[_0xcfff('0x3d')](_0x22cb8b[_0xcfff('0x47')],function(_0x139034){var _0x2c4d4f={};_0x2c4d4f[_0x139034]={'$like':'%'+_0x20d9ae[_0xcfff('0x44')][_0xcfff('0x50')]+'%'};return _0x2c4d4f;})});}_0x22cb8b=_['merge']({},_0x22cb8b,_0x20d9ae[_0xcfff('0x51')]);return db[_0xcfff('0x6c')][_0xcfff('0x2f')]({'where':_0x22cb8b['where']})['then'](function(_0x5ebe96){_0x4cf4fc['count']=_0x5ebe96;if(_0x20d9ae[_0xcfff('0x44')]['includeAll']){_0x22cb8b[_0xcfff('0x53')]=[{'all':!![]}];}return db[_0xcfff('0x6c')][_0xcfff('0x54')](_0x22cb8b);})[_0xcfff('0x20')](function(_0x20a8ac){_0x4cf4fc[_0xcfff('0x55')]=_0x20a8ac;return _0x4cf4fc;});}})['then'](respondWithFilteredResult(_0x2822ce,_0x22cb8b))[_0xcfff('0x56')](handleError(_0x2822ce,null));};exports[_0xcfff('0x6f')]=function(_0x46b6e0,_0x684f0b,_0x49a833){return db[_0xcfff('0x3e')]['find']({'where':{'id':_0x46b6e0['params']['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x684f0b,null))[_0xcfff('0x20')](function(_0x266737){if(_0x266737){return _0x266737[_0xcfff('0x6f')](_0x46b6e0[_0xcfff('0x44')][_0xcfff('0x69')]);}})[_0xcfff('0x20')](respondWithStatusCode(_0x684f0b,null))[_0xcfff('0x56')](handleError(_0x684f0b,null));};exports['notify']=function(_0x53e698,_0x4798ce,_0x1b5f07){var _0x10b4ad={'channel':_0xcfff('0x70')};var _0x4d9026=[];var _0x3c58e6=[];var _0x419058={};return db['SmsAccount'][_0xcfff('0x59')]({'where':{'id':_0x53e698[_0xcfff('0x58')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xcfff('0x71')}]})['then'](handleEntityNotFound(_0x4798ce,null))[_0xcfff('0x20')](function(_0x5561de){_0x10b4ad[_0xcfff('0x72')]=_0x5561de;_0x10b4ad['applications']=_[_0xcfff('0x73')](_0x5561de[_0xcfff('0x71')],[_0xcfff('0x74')],[_0xcfff('0x75')]);if(_0x10b4ad[_0xcfff('0x72')][_0xcfff('0x71')]){delete _0x10b4ad['account'][_0xcfff('0x71')];}return db['CmContact']['describe']();})[_0xcfff('0x20')](function(_0x1e5002){if(!_0x1e5002){throw new db[(_0xcfff('0x76'))]['ValidationError']('no\x20available\x20attributes');}_0x4d9026=_[_0xcfff('0x77')](_['keys'](_0x1e5002),[_0xcfff('0x78'),'updatedAt']);_0x3c58e6=_[_0xcfff('0x77')](_[_0xcfff('0x45')](_0x1e5002),['createdAt',_0xcfff('0x79'),_0xcfff('0x7a'),'ListId']);_0x10b4ad[_0xcfff('0x5b')]={'mapKey':_0xcfff('0x7b')};if(_0x10b4ad[_0xcfff('0x72')]['type']){switch(_0x10b4ad[_0xcfff('0x72')][_0xcfff('0x41')]){case _0xcfff('0x7c'):_0x10b4ad[_0xcfff('0x5b')]['from']=_0x53e698['body']['From'];_0x10b4ad['body']['body']=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x7d')];_0x10b4ad['body'][_0xcfff('0x7e')]=_0x53e698['body'][_0xcfff('0x7f')];break;case _0xcfff('0x80'):_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x81')]='+'+_0x53e698[_0xcfff('0x5b')][_0xcfff('0x82')];_0x10b4ad['body'][_0xcfff('0x5b')]=_0x53e698[_0xcfff('0x5b')]['text'];break;case _0xcfff('0x83'):_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x81')]=_0x53e698['body'][_0xcfff('0x81')];_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x5b')]=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x27')];break;case _0xcfff('0x84'):_0x10b4ad[_0xcfff('0x5b')]['from']=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x81')];_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x5b')]=_0x53e698['body'][_0xcfff('0x5b')];_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x7e')]=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x85')];break;case _0xcfff('0x86'):_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x81')]=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x87')];_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x5b')]=_0x53e698[_0xcfff('0x5b')]['Text'];_0x10b4ad['body'][_0xcfff('0x7e')]=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x88')];break;case'infobip':_0x10b4ad['body'][_0xcfff('0x81')]='+'+_0x53e698[_0xcfff('0x5b')][_0xcfff('0x89')][0x0]['from'];_0x10b4ad[_0xcfff('0x5b')]['body']=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x89')][0x0][_0xcfff('0x8a')];_0x10b4ad['body'][_0xcfff('0x7e')]=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x89')][0x0][_0xcfff('0x7e')];break;case _0xcfff('0x8b'):_0x10b4ad[_0xcfff('0x5b')]['from']=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x8c')];_0x10b4ad['body'][_0xcfff('0x5b')]=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x8d')][_0xcfff('0x27')];break;case _0xcfff('0x8e'):_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x81')]=_0x53e698['body']['fromNumber'];_0x10b4ad['body'][_0xcfff('0x5b')]=_0x53e698['body'][_0xcfff('0x8a')];_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x7e')]=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x8f')];break;case _0xcfff('0x90'):_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x7e')]=_0x53e698[_0xcfff('0x5b')][0x0][_0xcfff('0x27')]['id'];_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x81')]=_0x53e698[_0xcfff('0x5b')][0x0][_0xcfff('0x27')][_0xcfff('0x81')];_0x10b4ad['body'][_0xcfff('0x5b')]=_0x53e698[_0xcfff('0x5b')][0x0][_0xcfff('0x27')][_0xcfff('0x8a')];break;case _0xcfff('0x91'):_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x81')]=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x81')];_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x5b')]=_0x53e698[_0xcfff('0x5b')][_0xcfff('0x27')];_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x7e')]=_0x53e698['body'][_0xcfff('0x92')];break;}}if(_0x10b4ad[_0xcfff('0x5b')]['id']){delete _0x10b4ad[_0xcfff('0x5b')]['id'];}if(_[_0xcfff('0x93')](_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x81')])){throw new db[(_0xcfff('0x76'))][(_0xcfff('0x94'))](_0xcfff('0x95'));}if(_['isNil'](_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x5b')])||_0x10b4ad['body'][_0xcfff('0x5b')]===''){throw new db['Sequelize'][(_0xcfff('0x94'))](_0xcfff('0x96'));}if(_['isNil'](_0x10b4ad[_0xcfff('0x5b')]['mapKey'])){throw new db[(_0xcfff('0x76'))][(_0xcfff('0x94'))](_0xcfff('0x97')+_0x3c58e6);}if(!_[_0xcfff('0x98')](_0x3c58e6,_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x99')])){throw new db[(_0xcfff('0x76'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c58e6);}_0x419058[_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x99')]]=_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x81')];return db[_0xcfff('0x9a')][_0xcfff('0x59')]({'where':{'id':_0x10b4ad[_0xcfff('0x72')][_0xcfff('0x9b')]},'include':[{'model':db[_0xcfff('0x9c')],'as':_0xcfff('0x9d'),'where':_0x419058,'limit':0x1,'order':[[_0xcfff('0x79'),'DESC']]}]});})[_0xcfff('0x20')](handleEntityNotFound(_0x4798ce,null))['then'](function(_0x4fbea1){if(_0x4fbea1){_0x10b4ad[_0xcfff('0x9e')]=_['omit'](_0x4fbea1,[_0xcfff('0x9d')]);if(_0x4fbea1[_0xcfff('0x9d')]['length']){return _0x4fbea1['Contacts'][0x0];}var _0x3419e8=_[_0xcfff('0x18')](_0x10b4ad[_0xcfff('0x5b')],{'firstName':_0x10b4ad['body'][_0xcfff('0x81')],'ListId':_0x4fbea1['id']});_0x3419e8[_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x99')]]=_0x10b4ad['body']['from'];return db['CmContact'][_0xcfff('0x5a')](_0x3419e8,{'fields':_0x4d9026,'raw':!![]});}})[_0xcfff('0x20')](handleEntityNotFound(_0x4798ce,null))['then'](function(_0x2584e7){if(_0x2584e7){_0x10b4ad['contact']=_0x2584e7;var _0x5f0efe={'ContactId':_0x2584e7['id'],'phone':_0x10b4ad['body'][_0xcfff('0x81')],'SmsAccountId':_0x53e698[_0xcfff('0x58')]['id']};var _0x107057={'ContactId':_0x2584e7['id'],'SmsAccountId':_0x53e698[_0xcfff('0x58')]['id'],'closed':![]};return db[_0xcfff('0x9f')][_0xcfff('0x59')]({'where':_0x107057})[_0xcfff('0x20')](function(_0x2c7b55){if(_0x2c7b55){return[_0x2c7b55,![]];}return db['SmsInteraction']['create'](_0x5f0efe)[_0xcfff('0x20')](function(_0x397b59){return[_0x397b59,!![]];});});}})[_0xcfff('0xa0')](function(_0xf7d58,_0x173aba){_0x10b4ad[_0xcfff('0xa1')]=_0xf7d58[_0xcfff('0x36')]({'plain':!![]});_0x10b4ad[_0xcfff('0xa1')][_0xcfff('0xa2')]=![];if(_0x173aba){if(_0x10b4ad[_0xcfff('0x72')][_0xcfff('0xa3')]){_0x10b4ad[_0xcfff('0xa4')]['push']({'id':0x0,'priority':_0x10b4ad[_0xcfff('0xa4')][_0xcfff('0x49')]+0x1,'app':_0xcfff('0xa5'),'appdata':'unmanaged','interval':_0xcfff('0xa6')});}_0x10b4ad[_0xcfff('0xa1')][_0xcfff('0xa2')]=!![];}return db[_0xcfff('0xa7')][_0xcfff('0x5a')]({'phone':_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x81')],'messageId':_0x10b4ad[_0xcfff('0x5b')]['messageId'],'body':_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0x5b')],'SmsAccountId':_0x53e698[_0xcfff('0x58')]['id'],'SmsInteractionId':_0xf7d58['id'],'direction':'in','ContactId':_0xf7d58['ContactId'],'AttachmentId':_0x10b4ad[_0xcfff('0x5b')][_0xcfff('0xa8')]});})['then'](function(_0x4c1f8e){_0x10b4ad[_0xcfff('0x27')]=_0x4c1f8e;if(_0x10b4ad['interaction'][_0xcfff('0xa9')]){return db['User']['find']({'attributes':['id',_0xcfff('0x39')],'where':{'id':_0x10b4ad[_0xcfff('0xa1')]['UserId']}})[_0xcfff('0x20')](function(_0x1ea0ee){if(_0x1ea0ee){_0x10b4ad[_0xcfff('0xa4')][_0xcfff('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1ea0ee[_0xcfff('0x39')]+','+(_0x10b4ad[_0xcfff('0x72')][_0xcfff('0xab')]||0xa),'interval':_0xcfff('0xa6')});}return respondWithRpcPromise(_0xcfff('0xac'),_0xcfff('0xad'),_0x10b4ad);});}return respondWithRpcPromise(_0xcfff('0xac'),'startRouting',_0x10b4ad);})['then'](function(_0x2bccc3){if(_0x2bccc3){var _0x8d0be3=0xc8;var _0x3d410e=_0xcfff('0xae');logger[_0xcfff('0x28')](_0xcfff('0x24'),_0x3d410e,_0x8d0be3,_0xcfff('0xaf'));logger[_0xcfff('0x23')](_0xcfff('0xb0'),_0x3d410e,_0x8d0be3,_0xcfff('0xaf'),JSON[_0xcfff('0xb1')](_0x2bccc3));if(_0x10b4ad[_0xcfff('0x72')][_0xcfff('0x41')]===_0xcfff('0x7c')){return _0x4798ce[_0xcfff('0x2a')](_0x8d0be3)[_0xcfff('0x30')](_0xcfff('0xb2'),_0xcfff('0xb3'))['send'](_0xcfff('0xb4'));}else{return _0x4798ce[_0xcfff('0x2a')](_0x8d0be3)[_0xcfff('0x32')](_0x2bccc3);}}})[_0xcfff('0x56')](handleError(_0x4798ce,null));};exports[_0xcfff('0xb5')]=function(_0xc4ddcd,_0x51530a){var _0x1c7e21=_0xc4ddcd[_0xcfff('0x58')]['id'];var _0xa3f77c=_0xc4ddcd[_0xcfff('0x5b')];var _0x31147f=0xc8;var _0x34825c=null;return db[_0xcfff('0xb6')][_0xcfff('0xb7')]({'isolationLevel':db[_0xcfff('0xb6')]['Transaction']['ISOLATION_LEVELS'][_0xcfff('0xb8')]},function(_0x574c5c){return db[_0xcfff('0x3e')][_0xcfff('0x6b')]({'where':{'id':_0x1c7e21},'transaction':_0x574c5c})[_0xcfff('0x20')](function(_0x2caf37){if(_0x2caf37){return db[_0xcfff('0xb9')][_0xcfff('0x35')]({'where':{'SmsAccountId':_0x1c7e21},'transaction':_0x574c5c})[_0xcfff('0x20')](function(){var _0x5f3af2=_[_0xcfff('0x3d')](_0xa3f77c,function(_0x3221e5){_0x3221e5[_0xcfff('0x65')]=_0x1c7e21;return _0x3221e5;});return db['SmsApplication'][_0xcfff('0xba')](_0x5f3af2,{'transaction':_0x574c5c});});}else{_0x31147f=0x194;_0x34825c=[];}});})['then'](function(){if(_0x31147f!==0x194){return db[_0xcfff('0xb9')][_0xcfff('0xbb')]({'where':{'SmsAccountId':_0x1c7e21},'order':'priority'})[_0xcfff('0x20')](function(_0x171c9a){_0x34825c=_0x171c9a;});}})['catch'](function(_0x2990f7){_0x31147f=0x1f4;logger[_0xcfff('0x25')](_0x2990f7[_0xcfff('0x38')]);if(_0x2990f7['name']){delete _0x2990f7[_0xcfff('0x39')];}_0x34825c=_0x2990f7;})[_0xcfff('0xbc')](function(){if(_0x34825c===null){_0x51530a[_0xcfff('0x29')](_0x31147f);}else{if(_0x31147f===0x1f4){_0x51530a[_0xcfff('0x2a')](_0x31147f)[_0xcfff('0x3a')](_0x34825c);}else{_0x51530a[_0xcfff('0x2a')](_0x31147f)[_0xcfff('0x32')](_0x34825c);}}});};exports[_0xcfff('0xbd')]=function(_0x4997bf,_0x1c17f7,_0x41415e){var _0x44fd14={};var _0x1b10ac={};var _0x36c5ca;var _0x175792;return db[_0xcfff('0x3e')][_0xcfff('0x6b')]({'where':{'id':_0x4997bf['params']['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x1c17f7,null))['then'](function(_0x362e28){if(_0x362e28){_0x36c5ca=_0x362e28;_0x1b10ac[_0xcfff('0x43')]=_[_0xcfff('0x45')](db[_0xcfff('0xb9')][_0xcfff('0x3f')]);_0x1b10ac['query']=_['keys'](_0x4997bf['query']);_0x1b10ac[_0xcfff('0x46')]=_[_0xcfff('0x68')](_0x1b10ac[_0xcfff('0x43')],_0x1b10ac[_0xcfff('0x44')]);_0x44fd14['attributes']=_[_0xcfff('0x68')](_0x1b10ac[_0xcfff('0x43')],qs[_0xcfff('0x48')](_0x4997bf[_0xcfff('0x44')]['fields']));_0x44fd14[_0xcfff('0x47')]=_0x44fd14[_0xcfff('0x47')]['length']?_0x44fd14[_0xcfff('0x47')]:_0x1b10ac[_0xcfff('0x43')];_0x44fd14[_0xcfff('0x6e')]=qs[_0xcfff('0x4b')](_0x4997bf[_0xcfff('0x44')]['sort']);_0x44fd14[_0xcfff('0x4d')]=qs['filters'](_[_0xcfff('0x4c')](_0x4997bf[_0xcfff('0x44')],_0x1b10ac[_0xcfff('0x46')]));if(_0x4997bf[_0xcfff('0x44')][_0xcfff('0x50')]){_0x44fd14[_0xcfff('0x4d')]=_['merge'](_0x44fd14['where'],{'$or':_[_0xcfff('0x3d')](_0x44fd14['attributes'],function(_0x41401e){var _0x415fd4={};_0x415fd4[_0x41401e]={'$like':'%'+_0x4997bf['query']['filter']+'%'};return _0x415fd4;})});}_0x44fd14=_[_0xcfff('0x4e')]({},_0x44fd14,_0x4997bf[_0xcfff('0x51')]);return _0x36c5ca[_0xcfff('0xbd')](_0x44fd14);}})[_0xcfff('0x20')](function(_0x4c8737){if(_0x4c8737){_0x175792=_0x4c8737[_0xcfff('0x49')];if(!_0x4997bf[_0xcfff('0x44')][_0xcfff('0x4a')](_0xcfff('0x6d'))){_0x44fd14[_0xcfff('0x2d')]=qs[_0xcfff('0x2d')](_0x4997bf['query']['limit']);_0x44fd14[_0xcfff('0x2c')]=qs[_0xcfff('0x2c')](_0x4997bf['query'][_0xcfff('0x2c')]);}return _0x36c5ca[_0xcfff('0xbd')](_0x44fd14);}})[_0xcfff('0x20')](function(_0x127aeb){if(_0x127aeb){return _0x127aeb?{'count':_0x175792,'rows':_0x127aeb}:null;}})['then'](respondWithResult(_0x1c17f7,null))['catch'](handleError(_0x1c17f7,null));};exports['getInteractions']=function(_0x2c79e0,_0x39e73f,_0x1022a){var _0x5348a1={'raw':![],'where':{}};var _0x7e3553={};var _0x5e402e={'count':0x0,'rows':[]};return db[_0xcfff('0x3e')]['findOne']({'where':{'id':_0x2c79e0['params']['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x39e73f,null))['then'](function(_0x28c7db){if(_0x28c7db){_0x7e3553[_0xcfff('0x43')]=_[_0xcfff('0x45')](db['SmsInteraction']['rawAttributes']);_0x7e3553['query']=_[_0xcfff('0x45')](_0x2c79e0[_0xcfff('0x44')]);_0x7e3553[_0xcfff('0x46')]=_[_0xcfff('0x68')](_0x7e3553[_0xcfff('0x43')],_0x7e3553[_0xcfff('0x44')]);_0x5348a1[_0xcfff('0x47')]=_['intersection'](_0x7e3553[_0xcfff('0x43')],qs[_0xcfff('0x48')](_0x2c79e0[_0xcfff('0x44')]['fields']));_0x5348a1[_0xcfff('0x47')]=_0x5348a1[_0xcfff('0x47')]['length']?_0x5348a1[_0xcfff('0x47')]:_0x7e3553[_0xcfff('0x43')];if(!_0x2c79e0[_0xcfff('0x44')][_0xcfff('0x4a')](_0xcfff('0x6d'))){_0x5348a1['limit']=qs[_0xcfff('0x2d')](_0x2c79e0['query'][_0xcfff('0x2d')]);_0x5348a1[_0xcfff('0x2c')]=qs[_0xcfff('0x2c')](_0x2c79e0[_0xcfff('0x44')][_0xcfff('0x2c')]);}_0x5348a1[_0xcfff('0x6e')]=qs[_0xcfff('0x4b')](_0x2c79e0[_0xcfff('0x44')]['sort']);_0x5348a1[_0xcfff('0x4d')]=qs[_0xcfff('0x46')](_[_0xcfff('0x4c')](_0x2c79e0[_0xcfff('0x44')],_0x7e3553['filters']));_0x5348a1[_0xcfff('0x4d')][_0xcfff('0x65')]=_0x28c7db['id'];if(_0x2c79e0[_0xcfff('0x44')][_0xcfff('0x50')]){_0x5348a1[_0xcfff('0x4d')]=_[_0xcfff('0x4e')](_0x5348a1['where'],{'$or':_['map'](_0x5348a1[_0xcfff('0x47')],function(_0x1df084){var _0x2f1976={};_0x2f1976[_0x1df084]={'$like':'%'+_0x2c79e0[_0xcfff('0x44')]['filter']+'%'};return _0x2f1976;})});}_0x5348a1=_['merge']({},_0x5348a1,_0x2c79e0['options']);return db[_0xcfff('0x9f')]['count']({'where':_0x5348a1[_0xcfff('0x4d')]})[_0xcfff('0x20')](function(_0x5a7acc){_0x5e402e['count']=_0x5a7acc;if(_0x2c79e0[_0xcfff('0x44')][_0xcfff('0x52')]){_0x5348a1[_0xcfff('0x53')]=[{'model':db[_0xcfff('0x9c')],'as':_0xcfff('0xbe'),'required':![]},{'model':db[_0xcfff('0xbf')],'as':_0xcfff('0xc0'),'attributes':[_0xcfff('0x39'),_0xcfff('0xc1'),_0xcfff('0xc2')],'required':![]},{'model':db[_0xcfff('0xc3')],'as':'Tags','attributes':['id',_0xcfff('0x39'),_0xcfff('0xc4')],'where':_0x2c79e0[_0xcfff('0x44')][_0xcfff('0xc5')]?{'id':_0x2c79e0[_0xcfff('0x44')][_0xcfff('0xc5')]}:undefined,'required':_0x2c79e0[_0xcfff('0x44')][_0xcfff('0xc5')]?!![]:![]}];}return db[_0xcfff('0x9f')][_0xcfff('0x54')](_0x5348a1);})[_0xcfff('0x20')](function(_0x467c32){_0x5e402e[_0xcfff('0x55')]=_0x467c32;return _0x5e402e;});}})[_0xcfff('0x20')](respondWithFilteredResult(_0x39e73f,_0x5348a1))[_0xcfff('0x56')](handleError(_0x39e73f,null));};exports[_0xcfff('0x3a')]=function(_0xb5564b,_0x9c66c9,_0x202630){var _0x459c70,_0x55712c,_0x1c2947;if(_[_0xcfff('0x93')](_0xb5564b['body'][_0xcfff('0x5b')])||_0xb5564b['body'][_0xcfff('0x5b')]===''){throw new db['Sequelize'][(_0xcfff('0x94'))](_0xcfff('0x96'));}if(_['isNil'](_0xb5564b['body']['to'])){throw new db[(_0xcfff('0x76'))][(_0xcfff('0x94'))](_0xcfff('0xc6'));}_0x459c70=_0xb5564b['body']['to'];return db[_0xcfff('0x3e')]['find']({'where':{'id':_0xb5564b[_0xcfff('0x58')]['id']},'include':[{'model':db[_0xcfff('0x9a')],'as':_0xcfff('0xc7'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x459c70},'limit':0x1,'order':[[_0xcfff('0x79'),_0xcfff('0xc8')]]}]}]})[_0xcfff('0x20')](handleEntityNotFound(_0x9c66c9,null))[_0xcfff('0x20')](function(_0x37ce48){if(_0x37ce48&&_0x37ce48[_0xcfff('0xc7')]){_0x55712c=_0x37ce48['get']({'plain':!![]});if(_0x55712c['List']&&_0x55712c[_0xcfff('0xc7')]['Contacts'][_0xcfff('0x49')]){return _0x55712c['List'][_0xcfff('0x9d')][0x0];}return db[_0xcfff('0x9c')][_0xcfff('0x5a')](_['defaults'](_0xb5564b[_0xcfff('0x5b')],{'firstName':_0x459c70,'mobile':_0x459c70,'phone':_0x459c70,'ListId':_0x55712c[_0xcfff('0x9b')]}));}})[_0xcfff('0x20')](handleEntityNotFound(_0x9c66c9,null))[_0xcfff('0x20')](function(_0x31c915){if(_0x31c915){_0x1c2947=_0x31c915;return db['SmsInteraction'][_0xcfff('0x59')]({'where':{'ContactId':_0x1c2947['id'],'closed':![],'SmsAccountId':_0x55712c['id']}})[_0xcfff('0x20')](function(_0x3ab9f0){if(_0x3ab9f0){return[_0x3ab9f0,![]];}return db['SmsInteraction'][_0xcfff('0x5a')]({'UserId':_0xb5564b['user']['id'],'ContactId':_0x1c2947['id'],'SmsAccountId':_0x55712c['id'],'phone':_0x459c70,'firstMsgDirection':'out','Messages':[_[_0xcfff('0x4e')](_0xb5564b[_0xcfff('0x5b')],{'read':![],'body':_0xb5564b[_0xcfff('0x5b')][_0xcfff('0x5b')],'phone':_0x459c70,'SmsAccountId':_0x55712c['id'],'UserId':_0xb5564b[_0xcfff('0x5e')]['id'],'ContactId':_0x1c2947['id']})]},{'include':[{'model':db[_0xcfff('0xa7')],'as':_0xcfff('0xc9')}]})[_0xcfff('0x20')](function(_0x1d6331){return[_0x1d6331,!![]];});});}})[_0xcfff('0xa0')](function(_0x2d577a,_0x422ff8){if(_0x422ff8){return _0x2d577a;}return db[_0xcfff('0xa7')][_0xcfff('0x5a')](_[_0xcfff('0x4e')](_0xb5564b[_0xcfff('0x5b')],{'read':![],'body':_0xb5564b[_0xcfff('0x5b')][_0xcfff('0x5b')],'phone':_0x459c70,'SmsAccountId':_0x55712c['id'],'SmsInteractionId':_0x2d577a['id'],'UserId':_0xb5564b[_0xcfff('0x5e')]['id'],'ContactId':_0x1c2947['id']}))[_0xcfff('0x20')](function(_0x1aad5d){_0x2d577a['dataValues'][_0xcfff('0xc9')]=[];_0x2d577a[_0xcfff('0xca')]['Messages'][_0xcfff('0xcb')](_0x1aad5d[_0xcfff('0xca')]);return _0x2d577a;});})[_0xcfff('0x20')](respondWithResult(_0x9c66c9,null))[_0xcfff('0x56')](handleError(_0x9c66c9,null));};exports['status']=function(_0x163b6e,_0x2e21ef,_0x407f5d){if(_0x163b6e['body']['id']){delete _0x163b6e[_0xcfff('0x5b')]['id'];}var _0x7d2e20,_0x302add,_0x414aaa;return db[_0xcfff('0x3e')][_0xcfff('0x59')]({'where':{'id':_0x163b6e[_0xcfff('0x58')]['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x2e21ef,null))[_0xcfff('0x20')](function(_0x574bd4){if(_0x574bd4){_0x414aaa=_0x574bd4;logger['debug'](_0xcfff('0x24'),_0xcfff('0x2a'),'received\x20delivery\x20report\x20from',_0x574bd4[_0xcfff('0x41')],util[_0xcfff('0xcc')](_0x163b6e['body'],{'showHidden':![],'depth':null}));switch(_0x574bd4[_0xcfff('0x41')]){case _0xcfff('0x80'):if(_0x163b6e[_0xcfff('0x5b')][_0xcfff('0xcd')]&&_0x163b6e[_0xcfff('0x5b')][_0xcfff('0x2a')]){_0x302add=_0x163b6e[_0xcfff('0x5b')][_0xcfff('0x2a')];return db[_0xcfff('0xa7')][_0xcfff('0x59')]({'where':{'messageId':_0x163b6e[_0xcfff('0x5b')][_0xcfff('0xcd')]}});}break;case'connectel':if(_0x163b6e[_0xcfff('0x5b')][_0xcfff('0xce')]&&_0x163b6e['body']['statusInt']){_0x302add=_0x163b6e['body'][_0xcfff('0xcf')];return db[_0xcfff('0xa7')][_0xcfff('0x59')]({'where':{'messageId':_0x163b6e['body'][_0xcfff('0xce')]}});}break;case _0xcfff('0x84'):if(_0x163b6e['body']['message_id']&&_0x163b6e['body'][_0xcfff('0xd0')]){_0x302add=_0x163b6e['body'][_0xcfff('0xd0')];return db['SmsMessage'][_0xcfff('0x59')]({'where':{'messageId':_0x163b6e['body'][_0xcfff('0x85')]}});}break;case'infobip':var _0x48a30f=_0x163b6e[_0xcfff('0x5b')][_0xcfff('0x89')][0x0];if(_0x48a30f[_0xcfff('0x7e')]&&_0x48a30f[_0xcfff('0x2a')][_0xcfff('0xd1')]===_0xcfff('0xd2')){_0x302add=_0x48a30f[_0xcfff('0x2a')][_0xcfff('0xd1')];return db[_0xcfff('0xa7')][_0xcfff('0x59')]({'where':{'messageId':_0x48a30f[_0xcfff('0x7e')]}});}break;case _0xcfff('0x8e'):if(_0x163b6e[_0xcfff('0x5b')][_0xcfff('0x7e')]&&_0x163b6e[_0xcfff('0x5b')]['status']){_0x302add=_0x163b6e['body'][_0xcfff('0x2a')];return db[_0xcfff('0xa7')][_0xcfff('0x59')]({'where':{'messageId':_0x163b6e[_0xcfff('0x5b')][_0xcfff('0x7e')]}});}break;case'bandwidth':if(_0x163b6e[_0xcfff('0x5b')][0x0]['message']['id']){_0x302add=_0x163b6e['body'][0x0][_0xcfff('0x41')];return db[_0xcfff('0xa7')][_0xcfff('0x59')]({'where':{'messageId':_0x163b6e['body'][0x0]['message']['id']}});}break;case _0xcfff('0x91'):if(_0x163b6e[_0xcfff('0x5b')]['redif']&&_0x163b6e[_0xcfff('0x5b')][_0xcfff('0x2a')]){_0x302add=_0x163b6e[_0xcfff('0x5b')][_0xcfff('0x2a')];return db[_0xcfff('0xa7')][_0xcfff('0x59')]({'where':{'messageId':_0x163b6e['body'][_0xcfff('0xd3')]}});}break;}}})[_0xcfff('0x20')](handleEntityNotFound(_0x2e21ef,null))[_0xcfff('0x20')](function(_0x3735ac){if(_0x3735ac){_0x7d2e20=_0x3735ac;switch(_0x414aaa[_0xcfff('0x41')]){case _0xcfff('0x80'):if(_0x302add===_0xcfff('0xd2')){return _0x7d2e20[_0xcfff('0xd4')]({'read':!![]});}else{logger[_0xcfff('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xcfff('0x80'),util[_0xcfff('0xcc')](_0x163b6e[_0xcfff('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xcfff('0x83'):if(_0x302add==='1'){return _0x7d2e20[_0xcfff('0xd4')]({'read':!![]});}else{logger[_0xcfff('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xcfff('0x2a'),_0xcfff('0x80'),util[_0xcfff('0xcc')](_0x163b6e[_0xcfff('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xcfff('0x84'):if(!_0x163b6e[_0xcfff('0x5b')][_0xcfff('0xd5')]&&_0x302add>=0xc8&&_0x302add<=0xce){return _0x7d2e20[_0xcfff('0xd4')]({'read':!![]});}else{logger['error'](_0xcfff('0x24'),_0xcfff('0x2a'),_0xcfff('0x84'),util[_0xcfff('0xcc')](_0x163b6e['body'],{'showHidden':![],'depth':null}));}break;case _0xcfff('0xd6'):var _0x53a94e=_0x163b6e[_0xcfff('0x5b')]['results'][0x0];if(_0x53a94e['status'][_0xcfff('0xd1')]===_0xcfff('0xd2')){return _0x7d2e20[_0xcfff('0xd4')]({'read':!![]});}else{logger[_0xcfff('0x25')](_0xcfff('0x24'),_0xcfff('0x2a'),_0xcfff('0xd6'),util[_0xcfff('0xcc')](_0x163b6e[_0xcfff('0x5b')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x302add==_0xcfff('0xd7')||_0x302add==_0xcfff('0xd8')){return _0x7d2e20['update']({'read':!![]});}else{logger['error'](_0xcfff('0x24'),'status',_0xcfff('0x8e'),util[_0xcfff('0xcc')](_0x163b6e['body'],{'showHidden':![],'depth':null}));}break;case _0xcfff('0x90'):if(_0x302add==_0xcfff('0xd9')){return _0x7d2e20['update']({'read':!![]});}else{logger[_0xcfff('0x25')](_0xcfff('0x24'),_0xcfff('0x2a'),_0xcfff('0x90'),util['inspect'](_0x163b6e['body'],{'showHidden':![],'depth':null}));}break;case _0xcfff('0x91'):if(_0x302add===_0xcfff('0xda')||_0x302add===_0xcfff('0xdb')){return _0x7d2e20[_0xcfff('0xd4')]({'read':!![]});}else{logger[_0xcfff('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xcfff('0x2a'),_0xcfff('0x91'),util[_0xcfff('0xcc')](_0x163b6e[_0xcfff('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x7d2e20;}})['then'](respondWithResult(_0x2e21ef,null))[_0xcfff('0x56')](handleError(_0x2e21ef,null));};exports[_0xcfff('0xdc')]=function(_0x3bd775,_0x4d57c4,_0x2a2cbc){var _0x37b092,_0x374606,_0xe4e74f;return db[_0xcfff('0x3e')]['find']({'where':{'id':_0x3bd775[_0xcfff('0x58')]['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x4d57c4,null))['then'](function(_0x1e483a){if(_0x1e483a){_0xe4e74f=_0x1e483a;logger['debug'](_0xcfff('0x24'),_0xcfff('0x2a'),'received\x20delivery\x20report\x20from',_0x1e483a[_0xcfff('0x41')],util[_0xcfff('0xcc')](_0x3bd775[_0xcfff('0x44')],{'showHidden':![],'depth':null}));switch(_0x1e483a[_0xcfff('0x41')]){case _0xcfff('0x8b'):if(_0x3bd775[_0xcfff('0x44')][_0xcfff('0xdd')]&&_0x3bd775[_0xcfff('0x44')][_0xcfff('0xde')]){_0x374606=_0x3bd775[_0xcfff('0x44')][_0xcfff('0xde')];return db[_0xcfff('0xa7')]['find']({'where':{'messageId':_0x3bd775[_0xcfff('0x44')][_0xcfff('0xdd')]}});}break;}}})['then'](handleEntityNotFound(_0x4d57c4,null))[_0xcfff('0x20')](function(_0x59c829){if(_0x59c829){_0x37b092=_0x59c829;switch(_0xe4e74f[_0xcfff('0x41')]){case _0xcfff('0x8b'):if(_0x374606==='2'||_0x374606==='6'){return _0x37b092['update']({'read':!![]});}else{logger[_0xcfff('0x25')](_0xcfff('0x24'),_0xcfff('0x2a'),_0xcfff('0x8b'),util[_0xcfff('0xcc')](_0x3bd775[_0xcfff('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x37b092;}})[_0xcfff('0x20')](respondWithResult(_0x4d57c4,null))[_0xcfff('0x56')](handleError(_0x4d57c4,null));};exports[_0xcfff('0xdf')]=function(_0x47978b,_0x242982,_0x4e2929){return db['SmsAccount'][_0xcfff('0x59')]({'where':{'id':_0x47978b[_0xcfff('0x58')]['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x242982,null))[_0xcfff('0x20')](function(_0x3dfcfd){if(_0x3dfcfd){return _0x3dfcfd[_0xcfff('0xdf')](_0x47978b['body']['ids'],_[_0xcfff('0xe0')](_0x47978b['body'],[_0xcfff('0x69'),'id'])||{})['spread'](function(_0x384ef6){for(var _0x5b0766=0x0;_0x5b0766<_0x47978b['body'][_0xcfff('0x69')]['length'];_0x5b0766+=0x1){socket[_0xcfff('0xe1')](_0xcfff('0xe2'),{'UserId':Number(_0x47978b['body'][_0xcfff('0x69')][_0x5b0766]),'SmsAccountId':Number(_0x47978b['params']['id'])});}return _0x384ef6;});}})[_0xcfff('0x20')](respondWithResult(_0x242982,null))[_0xcfff('0x56')](handleError(_0x242982,null));};exports[_0xcfff('0xe3')]=function(_0x335b96,_0x3dafbc,_0x202c83){return db[_0xcfff('0x3e')]['find']({'where':{'id':_0x335b96[_0xcfff('0x58')]['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x3dafbc,null))[_0xcfff('0x20')](function(_0x365e32){if(_0x365e32){return _0x365e32['removeAgents'](_0x335b96[_0xcfff('0x44')][_0xcfff('0x69')])['then'](function(){if(_['isArray'](_0x335b96[_0xcfff('0x44')][_0xcfff('0x69')])){for(var _0xae4d24=0x0;_0xae4d24<_0x335b96[_0xcfff('0x44')][_0xcfff('0x69')]['length'];_0xae4d24+=0x1){socket[_0xcfff('0xe1')](_0xcfff('0xe4'),{'UserId':Number(_0x335b96['query'][_0xcfff('0x69')][_0xae4d24]),'SmsAccountId':Number(_0x335b96[_0xcfff('0x58')]['id'])});}}else{socket[_0xcfff('0xe1')]('userSmsAccount:remove',{'UserId':Number(_0x335b96[_0xcfff('0x44')][_0xcfff('0x69')]),'SmsAccountId':Number(_0x335b96[_0xcfff('0x58')]['id'])});}});}})[_0xcfff('0x20')](respondWithStatusCode(_0x3dafbc,null))[_0xcfff('0x56')](handleError(_0x3dafbc,null));};exports[_0xcfff('0xe5')]=function(_0x156952,_0x28b978,_0x22cdd1){var _0x47ea42={};var _0x3e0e57={};var _0x1f19b6;var _0x2d1e26;return db[_0xcfff('0x3e')][_0xcfff('0x6b')]({'where':{'id':_0x156952[_0xcfff('0x58')]['id']}})[_0xcfff('0x20')](handleEntityNotFound(_0x28b978,null))[_0xcfff('0x20')](function(_0x539163){if(_0x539163){_0x1f19b6=_0x539163;_0x3e0e57['model']=_[_0xcfff('0x45')](db[_0xcfff('0xbf')]['rawAttributes']);_0x3e0e57[_0xcfff('0x44')]=_[_0xcfff('0x45')](_0x156952[_0xcfff('0x44')]);_0x3e0e57[_0xcfff('0x46')]=_[_0xcfff('0x68')](_0x3e0e57[_0xcfff('0x43')],_0x3e0e57[_0xcfff('0x44')]);_0x47ea42[_0xcfff('0x47')]=_[_0xcfff('0x68')](_0x3e0e57[_0xcfff('0x43')],qs[_0xcfff('0x48')](_0x156952[_0xcfff('0x44')]['fields']));_0x47ea42[_0xcfff('0x47')]=_0x47ea42[_0xcfff('0x47')][_0xcfff('0x49')]?_0x47ea42[_0xcfff('0x47')]:_0x3e0e57[_0xcfff('0x43')];_0x47ea42[_0xcfff('0x6e')]=qs['sort'](_0x156952[_0xcfff('0x44')][_0xcfff('0x4b')]);_0x47ea42[_0xcfff('0x4d')]=qs[_0xcfff('0x46')](_['pick'](_0x156952[_0xcfff('0x44')],_0x3e0e57[_0xcfff('0x46')]));if(_0x156952[_0xcfff('0x44')][_0xcfff('0x50')]){_0x47ea42[_0xcfff('0x4d')]=_[_0xcfff('0x4e')](_0x47ea42[_0xcfff('0x4d')],{'$or':_[_0xcfff('0x3d')](_0x47ea42[_0xcfff('0x47')],function(_0x5a2ce7){var _0x1bcc21={};_0x1bcc21[_0x5a2ce7]={'$like':'%'+_0x156952['query'][_0xcfff('0x50')]+'%'};return _0x1bcc21;})});}_0x47ea42=_[_0xcfff('0x4e')]({},_0x47ea42,_0x156952['options']);return _0x1f19b6[_0xcfff('0xe5')](_0x47ea42);}})[_0xcfff('0x20')](function(_0x1857df){if(_0x1857df){_0x2d1e26=_0x1857df[_0xcfff('0x49')];if(!_0x156952[_0xcfff('0x44')][_0xcfff('0x4a')](_0xcfff('0x6d'))){_0x47ea42[_0xcfff('0x2d')]=qs[_0xcfff('0x2d')](_0x156952[_0xcfff('0x44')]['limit']);_0x47ea42[_0xcfff('0x2c')]=qs['offset'](_0x156952[_0xcfff('0x44')][_0xcfff('0x2c')]);}return _0x1f19b6['getAgents'](_0x47ea42);}})[_0xcfff('0x20')](function(_0x4020cb){if(_0x4020cb){return _0x4020cb?{'count':_0x2d1e26,'rows':_0x4020cb}:null;}})[_0xcfff('0x20')](respondWithResult(_0x28b978,null))['catch'](handleError(_0x28b978,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index de472fe..f7f6304 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 _0xf268=['emit','hasOwnProperty','hook','events','../../mysqldb','SmsAccount','setMaxListeners','remove'];(function(_0x202410,_0x6076bb){var _0x1a92ab=function(_0x35be06){while(--_0x35be06){_0x202410['push'](_0x202410['shift']());}};_0x1a92ab(++_0x6076bb);}(_0xf268,0x1f3));var _0x8f26=function(_0x44d6b8,_0xe7e065){_0x44d6b8=_0x44d6b8-0x0;var _0x18cbfa=_0xf268[_0x44d6b8];return _0x18cbfa;};'use strict';var EventEmitter=require(_0x8f26('0x0'));var SmsAccount=require(_0x8f26('0x1'))['db'][_0x8f26('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x8f26('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8f26('0x4')};function emitEvent(_0x5d98cd){return function(_0x1be2ae,_0xd60699,_0x5e67ee){SmsAccountEvents[_0x8f26('0x5')](_0x5d98cd+':'+_0x1be2ae['id'],_0x1be2ae);SmsAccountEvents['emit'](_0x5d98cd,_0x1be2ae);_0x5e67ee(null);};}for(var e in events){if(events[_0x8f26('0x6')](e)){var event=events[e];SmsAccount[_0x8f26('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x56a7=['emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x56976b,_0x4cc384){var _0x3b873c=function(_0x401268){while(--_0x401268){_0x56976b['push'](_0x56976b['shift']());}};_0x3b873c(++_0x4cc384);}(_0x56a7,0x162));var _0x756a=function(_0x51c726,_0x332b95){_0x51c726=_0x51c726-0x0;var _0x23fe86=_0x56a7[_0x51c726];return _0x23fe86;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x756a('0x0'))['db'][_0x756a('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x756a('0x2')](0x0);var events={'afterCreate':_0x756a('0x3'),'afterUpdate':_0x756a('0x4'),'afterDestroy':_0x756a('0x5')};function emitEvent(_0x21a15f){return function(_0x2cf27b,_0x34bef2,_0x36aa92){SmsAccountEvents[_0x756a('0x6')](_0x21a15f+':'+_0x2cf27b['id'],_0x2cf27b);SmsAccountEvents['emit'](_0x21a15f,_0x2cf27b);_0x36aa92(null);};}for(var e in events){if(events[_0x756a('0x7')](e)){var event=events[e];SmsAccount[_0x756a('0x8')](e,emitEvent(event));}}module[_0x756a('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 5e00849..8a96210 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 _0xe831=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash'];(function(_0x173155,_0x507c3e){var _0x5a40a2=function(_0x48481d){while(--_0x48481d){_0x173155['push'](_0x173155['shift']());}};_0x5a40a2(++_0x507c3e);}(_0xe831,0x1a3));var _0x1e83=function(_0x37a3e4,_0xef2e68){_0x37a3e4=_0x37a3e4-0x0;var _0x554a9c=_0xe831[_0x37a3e4];return _0x554a9c;};'use strict';var _=require(_0x1e83('0x0'));var util=require(_0x1e83('0x1'));var logger=require(_0x1e83('0x2'))(_0x1e83('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1e83('0x4'));var fs=require('fs');var path=require(_0x1e83('0x5'));var rimraf=require(_0x1e83('0x6'));var config=require(_0x1e83('0x7'));var attributes=require(_0x1e83('0x8'));module['exports']=function(_0x58a821,_0x21f4ab){return _0x58a821[_0x1e83('0x9')](_0x1e83('0xa'),attributes,{'tableName':_0x1e83('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd44d=['rimraf','../../config/environment','./smsAccount.attributes','exports','sms_accounts','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xd44d,0xb5));var _0xdd44=function(_0xecea38,_0x2a1ca4){_0xecea38=_0xecea38-0x0;var _0xdac4b1=_0xd44d[_0xecea38];return _0xdac4b1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdd44('0x0'))(_0xdd44('0x1'));var moment=require(_0xdd44('0x2'));var BPromise=require(_0xdd44('0x3'));var rp=require(_0xdd44('0x4'));var fs=require('fs');var path=require(_0xdd44('0x5'));var rimraf=require(_0xdd44('0x6'));var config=require(_0xdd44('0x7'));var attributes=require(_0xdd44('0x8'));module[_0xdd44('0x9')]=function(_0x5ccf8b,_0x39dc79){return _0x5ccf8b['define']('SmsAccount',attributes,{'tableName':_0xdd44('0xa'),'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 f994e41..0d0a1e4 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 _0x49aa=['message','result','catch','ShowSmsAccount','SmsAccount','options','where','attributes','map','include','model','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0x49aa,0xeb));var _0xa49a=function(_0x44cb1e,_0x5a1432){_0x44cb1e=_0x44cb1e-0x0;var _0x17fe9d=_0x49aa[_0x44cb1e];return _0x17fe9d;};'use strict';var _=require(_0xa49a('0x0'));var util=require(_0xa49a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa49a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa49a('0x3'))['db'];var utils=require(_0xa49a('0x4'));var logger=require(_0xa49a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa49a('0x6')][_0xa49a('0x7')]({'port':0x232a});config[_0xa49a('0x8')]=_[_0xa49a('0x9')](config[_0xa49a('0x8')],{'host':_0xa49a('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa49a('0xb'))['register'](socket);function respondWithRpcPromise(_0x3e9cf4,_0x2db56c,_0x10fb4b){return new BPromise(function(_0x5cb081,_0x5066a2){return client[_0xa49a('0xc')](_0x3e9cf4,_0x10fb4b)[_0xa49a('0xd')](function(_0x8f914f){logger[_0xa49a('0xe')](_0xa49a('0xf'),_0x2db56c,_0xa49a('0x10'));logger[_0xa49a('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2db56c,_0xa49a('0x10'),JSON[_0xa49a('0x12')](_0x8f914f));if(_0x8f914f[_0xa49a('0x13')]){if(_0x8f914f[_0xa49a('0x13')][_0xa49a('0x14')]===0x1f4){logger[_0xa49a('0x13')]('SmsAccount,\x20%s,\x20%s',_0x2db56c,_0x8f914f[_0xa49a('0x13')]['message']);return _0x5066a2(_0x8f914f[_0xa49a('0x13')][_0xa49a('0x15')]);}logger['error'](_0xa49a('0xf'),_0x2db56c,_0x8f914f[_0xa49a('0x13')]['message']);return _0x5cb081(_0x8f914f[_0xa49a('0x13')][_0xa49a('0x15')]);}else{logger[_0xa49a('0xe')](_0xa49a('0xf'),_0x2db56c,_0xa49a('0x10'));_0x5cb081(_0x8f914f[_0xa49a('0x16')][_0xa49a('0x15')]);}})[_0xa49a('0x17')](function(_0x35d88c){logger[_0xa49a('0x13')](_0xa49a('0xf'),_0x2db56c,_0x35d88c);_0x5066a2(_0x35d88c);});});}exports[_0xa49a('0x18')]=function(_0x1b2ed6){var _0x562c94=this;return new Promise(function(_0x3500d1,_0xc11b4a){return db[_0xa49a('0x19')]['find']({'raw':_0x1b2ed6[_0xa49a('0x1a')]?_0x1b2ed6[_0xa49a('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1b2ed6[_0xa49a('0x1a')]?_0x1b2ed6[_0xa49a('0x1a')][_0xa49a('0x1b')]||null:null,'attributes':_0x1b2ed6[_0xa49a('0x1a')]?_0x1b2ed6[_0xa49a('0x1a')][_0xa49a('0x1c')]||null:null,'include':_0x1b2ed6[_0xa49a('0x1a')]?_0x1b2ed6[_0xa49a('0x1a')]['include']?_[_0xa49a('0x1d')](_0x1b2ed6['options']['include'],function(_0x485bef){return{'model':db[_0x485bef['model']],'as':_0x485bef['as'],'attributes':_0x485bef['attributes'],'include':_0x485bef[_0xa49a('0x1e')]?_[_0xa49a('0x1d')](_0x485bef[_0xa49a('0x1e')],function(_0x477457){return{'model':db[_0x477457[_0xa49a('0x1f')]],'as':_0x477457['as'],'attributes':_0x477457[_0xa49a('0x1c')],'include':_0x477457[_0xa49a('0x1e')]?_[_0xa49a('0x1d')](_0x477457['include'],function(_0x4920b2){return{'model':db[_0x4920b2[_0xa49a('0x1f')]],'as':_0x4920b2['as'],'attributes':_0x4920b2[_0xa49a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa49a('0xd')](function(_0x11cebb){logger[_0xa49a('0xe')](_0xa49a('0x18'),_0x1b2ed6);logger[_0xa49a('0x11')](_0xa49a('0x18'),_0x1b2ed6,JSON[_0xa49a('0x12')](_0x11cebb));_0x3500d1(_0x11cebb);})[_0xa49a('0x17')](function(_0xb4b4f1){logger[_0xa49a('0x13')](_0xa49a('0x18'),_0xb4b4f1['message'],_0x1b2ed6);_0xc11b4a(_0x562c94[_0xa49a('0x13')](0x1f4,_0xb4b4f1[_0xa49a('0x15')]));});});}; \ No newline at end of file +var _0xf9ac=['../../config/environment','client','http','defaults','redis','socket.io-emitter','./smsAccount.socket','request','then','info','debug','stringify','error','SmsAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','model','include','map','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc'];(function(_0x54bafd,_0x1c6df6){var _0x8206c5=function(_0x5064ce){while(--_0x5064ce){_0x54bafd['push'](_0x54bafd['shift']());}};_0x8206c5(++_0x1c6df6);}(_0xf9ac,0x17a));var _0xcf9a=function(_0x25fcc5,_0x4ba475){_0x25fcc5=_0x25fcc5-0x0;var _0x10fc68=_0xf9ac[_0x25fcc5];return _0x10fc68;};'use strict';var _=require(_0xcf9a('0x0'));var util=require(_0xcf9a('0x1'));var moment=require(_0xcf9a('0x2'));var BPromise=require(_0xcf9a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf9a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcf9a('0x5'))(_0xcf9a('0x6'));var config=require(_0xcf9a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcf9a('0x8')][_0xcf9a('0x9')]({'port':0x232a});config['redis']=_[_0xcf9a('0xa')](config[_0xcf9a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xcf9a('0xc'))(new Redis(config[_0xcf9a('0xb')]));require(_0xcf9a('0xd'))['register'](socket);function respondWithRpcPromise(_0x77c668,_0x424b62,_0x2b7a09){return new BPromise(function(_0x4417ca,_0x550393){return client[_0xcf9a('0xe')](_0x77c668,_0x2b7a09)[_0xcf9a('0xf')](function(_0x787f03){logger[_0xcf9a('0x10')]('SmsAccount,\x20%s,\x20%s',_0x424b62,'request\x20sent');logger[_0xcf9a('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x424b62,'request\x20sent',JSON[_0xcf9a('0x12')](_0x787f03));if(_0x787f03['error']){if(_0x787f03[_0xcf9a('0x13')]['code']===0x1f4){logger[_0xcf9a('0x13')](_0xcf9a('0x14'),_0x424b62,_0x787f03[_0xcf9a('0x13')]['message']);return _0x550393(_0x787f03[_0xcf9a('0x13')]['message']);}logger[_0xcf9a('0x13')](_0xcf9a('0x14'),_0x424b62,_0x787f03[_0xcf9a('0x13')][_0xcf9a('0x15')]);return _0x4417ca(_0x787f03[_0xcf9a('0x13')][_0xcf9a('0x15')]);}else{logger['info'](_0xcf9a('0x14'),_0x424b62,_0xcf9a('0x16'));_0x4417ca(_0x787f03[_0xcf9a('0x17')][_0xcf9a('0x15')]);}})[_0xcf9a('0x18')](function(_0x368ac3){logger[_0xcf9a('0x13')](_0xcf9a('0x14'),_0x424b62,_0x368ac3);_0x550393(_0x368ac3);});});}exports[_0xcf9a('0x19')]=function(_0x27d5ff){var _0x5a0170=this;return new Promise(function(_0x3c6ea6,_0x5b7ebc){return db[_0xcf9a('0x1a')][_0xcf9a('0x1b')]({'raw':_0x27d5ff[_0xcf9a('0x1c')]?_0x27d5ff[_0xcf9a('0x1c')][_0xcf9a('0x1d')]===undefined?!![]:![]:!![],'where':_0x27d5ff['options']?_0x27d5ff[_0xcf9a('0x1c')][_0xcf9a('0x1e')]||null:null,'attributes':_0x27d5ff[_0xcf9a('0x1c')]?_0x27d5ff[_0xcf9a('0x1c')][_0xcf9a('0x1f')]||null:null,'include':_0x27d5ff[_0xcf9a('0x1c')]?_0x27d5ff[_0xcf9a('0x1c')]['include']?_['map'](_0x27d5ff[_0xcf9a('0x1c')]['include'],function(_0x485029){return{'model':db[_0x485029[_0xcf9a('0x20')]],'as':_0x485029['as'],'attributes':_0x485029['attributes'],'include':_0x485029[_0xcf9a('0x21')]?_[_0xcf9a('0x22')](_0x485029['include'],function(_0xf3174c){return{'model':db[_0xf3174c[_0xcf9a('0x20')]],'as':_0xf3174c['as'],'attributes':_0xf3174c[_0xcf9a('0x1f')],'include':_0xf3174c[_0xcf9a('0x21')]?_['map'](_0xf3174c[_0xcf9a('0x21')],function(_0x275b94){return{'model':db[_0x275b94[_0xcf9a('0x20')]],'as':_0x275b94['as'],'attributes':_0x275b94[_0xcf9a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcf9a('0xf')](function(_0x2ee0ea){logger['info'](_0xcf9a('0x19'),_0x27d5ff);logger[_0xcf9a('0x11')]('ShowSmsAccount',_0x27d5ff,JSON['stringify'](_0x2ee0ea));_0x3c6ea6(_0x2ee0ea);})[_0xcf9a('0x18')](function(_0x38b685){logger[_0xcf9a('0x13')](_0xcf9a('0x19'),_0x38b685['message'],_0x27d5ff);_0x5b7ebc(_0x5a0170[_0xcf9a('0x13')](0x1f4,_0x38b685[_0xcf9a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index f1b2a62..45d00f6 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 444bc41..b0157f2 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 _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x59d8ae,_0x364785){var _0x128622=function(_0x358027){while(--_0x358027){_0x59d8ae['push'](_0x59d8ae['shift']());}};_0x128622(++_0x364785);}(_0xe14b,0x93));var _0xbe14=function(_0x114ac4,_0x15fb02){_0x114ac4=_0x114ac4-0x0;var _0x51d41d=_0xe14b[_0x114ac4];return _0x51d41d;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5bfdc3,_0x59e843){var _0x457616=function(_0x534503){while(--_0x534503){_0x5bfdc3['push'](_0x5bfdc3['shift']());}};_0x457616(++_0x59e843);}(_0x7217,0x19e));var _0x7721=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7217[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 5216477..20001af 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 _0x5da6=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x5da6,0xdd));var _0x65da=function(_0xb2f144,_0x38aba2){_0xb2f144=_0xb2f144-0x0;var _0x1dedc2=_0x5da6[_0xb2f144];return _0x1dedc2;};'use strict';var Sequelize=require(_0x65da('0x0'));module[_0x65da('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x65da('0x2')],'allowNull':![],'defaultValue':_0x65da('0x3')},'appdata':{'type':Sequelize[_0x65da('0x4')]()},'description':{'type':Sequelize[_0x65da('0x2')]},'interval':{'type':Sequelize[_0x65da('0x2')],'defaultValue':_0x65da('0x5')}}; \ No newline at end of file +var _0x496e=['sequelize','exports','noop','TEXT','STRING'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x496e,0x127));var _0xe496=function(_0x53bd2b,_0x1ac86d){_0x53bd2b=_0x53bd2b-0x0;var _0x40ec28=_0x496e[_0x53bd2b];return _0x40ec28;};'use strict';var Sequelize=require(_0xe496('0x0'));module[_0xe496('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe496('0x2')},'appdata':{'type':Sequelize[_0xe496('0x3')]()},'description':{'type':Sequelize[_0xe496('0x4')]},'interval':{'type':Sequelize[_0xe496('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 320c48c..5eeacbf 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 _0xaede=['update','then','stack','name','send','index','map','SmsApplication','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x11908b,_0x2fcdd9){var _0x1f7b25=function(_0x22770a){while(--_0x22770a){_0x11908b['push'](_0x11908b['shift']());}};_0x1f7b25(++_0x2fcdd9);}(_0xaede,0x148));var _0xeaed=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xaede[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xeaed('0x0'));var rimraf=require(_0xeaed('0x1'));var zipdir=require(_0xeaed('0x2'));var jsonpatch=require(_0xeaed('0x3'));var rp=require('request-promise');var moment=require(_0xeaed('0x4'));var BPromise=require(_0xeaed('0x5'));var Mustache=require('mustache');var util=require(_0xeaed('0x6'));var path=require('path');var sox=require(_0xeaed('0x7'));var csv=require(_0xeaed('0x8'));var ejs=require(_0xeaed('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeaed('0xa'));var squel=require('squel');var crypto=require(_0xeaed('0xb'));var jsforce=require(_0xeaed('0xc'));var deskjs=require(_0xeaed('0xd'));var toCsv=require(_0xeaed('0x8'));var querystring=require(_0xeaed('0xe'));var Papa=require(_0xeaed('0xf'));var Redis=require(_0xeaed('0x10'));var authService=require(_0xeaed('0x11'));var qs=require(_0xeaed('0x12'));var as=require(_0xeaed('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeaed('0x14'))(_0xeaed('0x15'));var utils=require(_0xeaed('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeaed('0x17'));var db=require(_0xeaed('0x18'))['db'];function respondWithStatusCode(_0x3666a9,_0x14ea04){_0x14ea04=_0x14ea04||0xcc;return function(_0x2ce04c){if(_0x2ce04c){return _0x3666a9[_0xeaed('0x19')](_0x14ea04);}return _0x3666a9[_0xeaed('0x1a')](_0x14ea04)[_0xeaed('0x1b')]();};}function respondWithResult(_0x2f1853,_0x1d10c7){_0x1d10c7=_0x1d10c7||0xc8;return function(_0x3d7168){if(_0x3d7168){return _0x2f1853[_0xeaed('0x1a')](_0x1d10c7)['json'](_0x3d7168);}};}function respondWithFilteredResult(_0x12209e,_0x2208ee){return function(_0xb65c){if(_0xb65c){var _0x11ce36=typeof _0x2208ee[_0xeaed('0x1c')]===_0xeaed('0x1d')&&typeof _0x2208ee[_0xeaed('0x1e')]==='undefined';var _0x47c84c=_0xb65c[_0xeaed('0x1f')];var _0x3e53c9=_0x11ce36?0x0:_0x2208ee[_0xeaed('0x1c')];var _0x16e23d=_0x11ce36?_0xb65c['count']:_0x2208ee[_0xeaed('0x1c')]+_0x2208ee[_0xeaed('0x1e')];var _0x45e742;if(_0x16e23d>=_0x47c84c){_0x16e23d=_0x47c84c;_0x45e742=0xc8;}else{_0x45e742=0xce;}_0x12209e[_0xeaed('0x1a')](_0x45e742);return _0x12209e[_0xeaed('0x20')](_0xeaed('0x21'),_0x3e53c9+'-'+_0x16e23d+'/'+_0x47c84c)[_0xeaed('0x22')](_0xb65c);}return null;};}function patchUpdates(_0x510817){return function(_0x5c0712){try{jsonpatch[_0xeaed('0x23')](_0x5c0712,_0x510817,!![]);}catch(_0xd5be54){return BPromise[_0xeaed('0x24')](_0xd5be54);}return _0x5c0712['save']();};}function saveUpdates(_0x14f440,_0x2db396){return function(_0x583241){if(_0x583241){return _0x583241[_0xeaed('0x25')](_0x14f440)[_0xeaed('0x26')](function(_0x2472ac){return _0x2472ac;});}return null;};}function removeEntity(_0x51f342,_0xb9d9ac){return function(_0x4d91c2){if(_0x4d91c2){return _0x4d91c2['destroy']()[_0xeaed('0x26')](function(){_0x51f342[_0xeaed('0x1a')](0xcc)[_0xeaed('0x1b')]();});}};}function handleEntityNotFound(_0x496579,_0x5dc120){return function(_0x145b5){if(!_0x145b5){_0x496579[_0xeaed('0x19')](0x194);}return _0x145b5;};}function handleError(_0x429f4b,_0x35de36){_0x35de36=_0x35de36||0x1f4;return function(_0x87fdfd){logger['error'](_0x87fdfd[_0xeaed('0x27')]);if(_0x87fdfd[_0xeaed('0x28')]){delete _0x87fdfd['name'];}_0x429f4b[_0xeaed('0x1a')](_0x35de36)[_0xeaed('0x29')](_0x87fdfd);};}exports[_0xeaed('0x2a')]=function(_0x77c8f8,_0x358fa0){var _0x51349e={},_0x39afb5={},_0x4121c5={'count':0x0,'rows':[]};var _0x29f754=_[_0xeaed('0x2b')](db[_0xeaed('0x2c')][_0xeaed('0x2d')],function(_0x5abc14){return{'name':_0x5abc14['fieldName'],'type':_0x5abc14[_0xeaed('0x2e')][_0xeaed('0x2f')]};});_0x39afb5[_0xeaed('0x30')]=_[_0xeaed('0x2b')](_0x29f754,_0xeaed('0x28'));_0x39afb5[_0xeaed('0x31')]=_[_0xeaed('0x32')](_0x77c8f8[_0xeaed('0x31')]);_0x39afb5[_0xeaed('0x33')]=_['intersection'](_0x39afb5[_0xeaed('0x30')],_0x39afb5[_0xeaed('0x31')]);_0x51349e[_0xeaed('0x34')]=_[_0xeaed('0x35')](_0x39afb5[_0xeaed('0x30')],qs[_0xeaed('0x36')](_0x77c8f8[_0xeaed('0x31')]['fields']));_0x51349e[_0xeaed('0x34')]=_0x51349e[_0xeaed('0x34')]['length']?_0x51349e[_0xeaed('0x34')]:_0x39afb5[_0xeaed('0x30')];if(!_0x77c8f8[_0xeaed('0x31')]['hasOwnProperty']('nolimit')){_0x51349e[_0xeaed('0x1e')]=qs['limit'](_0x77c8f8[_0xeaed('0x31')]['limit']);_0x51349e['offset']=qs[_0xeaed('0x1c')](_0x77c8f8[_0xeaed('0x31')][_0xeaed('0x1c')]);}_0x51349e['order']=qs[_0xeaed('0x37')](_0x77c8f8['query'][_0xeaed('0x37')]);_0x51349e[_0xeaed('0x38')]=qs[_0xeaed('0x33')](_[_0xeaed('0x39')](_0x77c8f8[_0xeaed('0x31')],_0x39afb5[_0xeaed('0x33')]),_0x29f754);if(_0x77c8f8['query'][_0xeaed('0x3a')]){_0x51349e[_0xeaed('0x38')]=_[_0xeaed('0x3b')](_0x51349e[_0xeaed('0x38')],{'$or':_['map'](_0x29f754,function(_0x5bc44a){if(_0x5bc44a[_0xeaed('0x2e')]!=='VIRTUAL'){var _0x387ea8={};_0x387ea8[_0x5bc44a[_0xeaed('0x28')]]={'$like':'%'+_0x77c8f8['query'][_0xeaed('0x3a')]+'%'};return _0x387ea8;}})});}_0x51349e=_[_0xeaed('0x3b')]({},_0x51349e,_0x77c8f8[_0xeaed('0x3c')]);var _0x571d16={'where':_0x51349e['where']};return db[_0xeaed('0x2c')][_0xeaed('0x1f')](_0x571d16)[_0xeaed('0x26')](function(_0x1f6d8b){_0x4121c5[_0xeaed('0x1f')]=_0x1f6d8b;if(_0x77c8f8[_0xeaed('0x31')][_0xeaed('0x3d')]){_0x51349e[_0xeaed('0x3e')]=[{'all':!![]}];}return db[_0xeaed('0x2c')][_0xeaed('0x3f')](_0x51349e);})[_0xeaed('0x26')](function(_0x3242b8){_0x4121c5[_0xeaed('0x40')]=_0x3242b8;return _0x4121c5;})[_0xeaed('0x26')](respondWithFilteredResult(_0x358fa0,_0x51349e))[_0xeaed('0x41')](handleError(_0x358fa0,null));};exports[_0xeaed('0x42')]=function(_0x23f0c2,_0x43a393){var _0x40acc2={'raw':!![],'where':{'id':_0x23f0c2['params']['id']}},_0x530e27={};_0x530e27[_0xeaed('0x30')]=_[_0xeaed('0x32')](db['SmsApplication'][_0xeaed('0x2d')]);_0x530e27[_0xeaed('0x31')]=_[_0xeaed('0x32')](_0x23f0c2[_0xeaed('0x31')]);_0x530e27[_0xeaed('0x33')]=_['intersection'](_0x530e27[_0xeaed('0x30')],_0x530e27[_0xeaed('0x31')]);_0x40acc2[_0xeaed('0x34')]=_[_0xeaed('0x35')](_0x530e27[_0xeaed('0x30')],qs[_0xeaed('0x36')](_0x23f0c2[_0xeaed('0x31')]['fields']));_0x40acc2[_0xeaed('0x34')]=_0x40acc2[_0xeaed('0x34')][_0xeaed('0x43')]?_0x40acc2['attributes']:_0x530e27[_0xeaed('0x30')];if(_0x23f0c2['query']['includeAll']){_0x40acc2[_0xeaed('0x3e')]=[{'all':!![]}];}_0x40acc2=_['merge']({},_0x40acc2,_0x23f0c2['options']);return db['SmsApplication']['find'](_0x40acc2)[_0xeaed('0x26')](handleEntityNotFound(_0x43a393,null))[_0xeaed('0x26')](respondWithResult(_0x43a393,null))['catch'](handleError(_0x43a393,null));};exports['create']=function(_0x41de0d,_0x869398){return db[_0xeaed('0x2c')][_0xeaed('0x44')](_0x41de0d['body'],{})['then'](respondWithResult(_0x869398,0xc9))['catch'](handleError(_0x869398,null));};exports[_0xeaed('0x25')]=function(_0x5a09fe,_0x1d94ca){if(_0x5a09fe['body']['id']){delete _0x5a09fe[_0xeaed('0x45')]['id'];}return db[_0xeaed('0x2c')][_0xeaed('0x46')]({'where':{'id':_0x5a09fe[_0xeaed('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d94ca,null))[_0xeaed('0x26')](saveUpdates(_0x5a09fe['body'],null))['then'](respondWithResult(_0x1d94ca,null))['catch'](handleError(_0x1d94ca,null));};exports[_0xeaed('0x48')]=function(_0x559a3d,_0x397118){return db[_0xeaed('0x2c')][_0xeaed('0x46')]({'where':{'id':_0x559a3d[_0xeaed('0x47')]['id']}})['then'](handleEntityNotFound(_0x397118,null))[_0xeaed('0x26')](removeEntity(_0x397118,null))[_0xeaed('0x41')](handleError(_0x397118,null));}; \ No newline at end of file +var _0x3be8=['type','VIRTUAL','filter','options','findAll','catch','show','params','includeAll','include','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','end','error','stack','send','index','map','SmsApplication','rawAttributes','fieldName','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge'];(function(_0x19dd0f,_0x2902e6){var _0x5db55d=function(_0xdbd02f){while(--_0xdbd02f){_0x19dd0f['push'](_0x19dd0f['shift']());}};_0x5db55d(++_0x2902e6);}(_0x3be8,0x185));var _0x83be=function(_0x3b5031,_0x38057f){_0x3b5031=_0x3b5031-0x0;var _0x57ad35=_0x3be8[_0x3b5031];return _0x57ad35;};'use strict';var emlformat=require(_0x83be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x83be('0x1'));var jsonpatch=require(_0x83be('0x2'));var rp=require(_0x83be('0x3'));var moment=require('moment');var BPromise=require(_0x83be('0x4'));var Mustache=require(_0x83be('0x5'));var util=require(_0x83be('0x6'));var path=require(_0x83be('0x7'));var sox=require('sox');var csv=require(_0x83be('0x8'));var ejs=require(_0x83be('0x9'));var fs=require('fs');var fs_extra=require(_0x83be('0xa'));var _=require(_0x83be('0xb'));var squel=require('squel');var crypto=require(_0x83be('0xc'));var jsforce=require(_0x83be('0xd'));var deskjs=require(_0x83be('0xe'));var toCsv=require(_0x83be('0x8'));var querystring=require(_0x83be('0xf'));var Papa=require(_0x83be('0x10'));var Redis=require(_0x83be('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x83be('0x12'));var hardwareService=require(_0x83be('0x13'));var logger=require(_0x83be('0x14'))(_0x83be('0x15'));var utils=require(_0x83be('0x16'));var config=require(_0x83be('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x891642,_0x3850c8){_0x3850c8=_0x3850c8||0xcc;return function(_0x327a9e){if(_0x327a9e){return _0x891642[_0x83be('0x18')](_0x3850c8);}return _0x891642[_0x83be('0x19')](_0x3850c8)['end']();};}function respondWithResult(_0x577e10,_0x37c31c){_0x37c31c=_0x37c31c||0xc8;return function(_0x276cf8){if(_0x276cf8){return _0x577e10[_0x83be('0x19')](_0x37c31c)['json'](_0x276cf8);}};}function respondWithFilteredResult(_0x112ee0,_0x53b9dc){return function(_0x3c0908){if(_0x3c0908){var _0x37ee1b=typeof _0x53b9dc[_0x83be('0x1a')]===_0x83be('0x1b')&&typeof _0x53b9dc['limit']===_0x83be('0x1b');var _0x2ee0dc=_0x3c0908[_0x83be('0x1c')];var _0xac771f=_0x37ee1b?0x0:_0x53b9dc[_0x83be('0x1a')];var _0x4de604=_0x37ee1b?_0x3c0908['count']:_0x53b9dc[_0x83be('0x1a')]+_0x53b9dc[_0x83be('0x1d')];var _0x3fbf2e;if(_0x4de604>=_0x2ee0dc){_0x4de604=_0x2ee0dc;_0x3fbf2e=0xc8;}else{_0x3fbf2e=0xce;}_0x112ee0[_0x83be('0x19')](_0x3fbf2e);return _0x112ee0[_0x83be('0x1e')](_0x83be('0x1f'),_0xac771f+'-'+_0x4de604+'/'+_0x2ee0dc)[_0x83be('0x20')](_0x3c0908);}return null;};}function patchUpdates(_0x5c2754){return function(_0x7af870){try{jsonpatch[_0x83be('0x21')](_0x7af870,_0x5c2754,!![]);}catch(_0x1f4a1a){return BPromise['reject'](_0x1f4a1a);}return _0x7af870[_0x83be('0x22')]();};}function saveUpdates(_0x48703b,_0x400d22){return function(_0x549332){if(_0x549332){return _0x549332[_0x83be('0x23')](_0x48703b)['then'](function(_0x150de1){return _0x150de1;});}return null;};}function removeEntity(_0x1692dc,_0x59a86c){return function(_0x1c4b0d){if(_0x1c4b0d){return _0x1c4b0d['destroy']()[_0x83be('0x24')](function(){_0x1692dc[_0x83be('0x19')](0xcc)[_0x83be('0x25')]();});}};}function handleEntityNotFound(_0x4d9554,_0x46f898){return function(_0x1966d3){if(!_0x1966d3){_0x4d9554['sendStatus'](0x194);}return _0x1966d3;};}function handleError(_0x4ad132,_0x2b9b90){_0x2b9b90=_0x2b9b90||0x1f4;return function(_0x9718d3){logger[_0x83be('0x26')](_0x9718d3[_0x83be('0x27')]);if(_0x9718d3['name']){delete _0x9718d3['name'];}_0x4ad132[_0x83be('0x19')](_0x2b9b90)[_0x83be('0x28')](_0x9718d3);};}exports[_0x83be('0x29')]=function(_0x2da360,_0x4a4381){var _0x1f6211={},_0x2c91df={},_0x281f9e={'count':0x0,'rows':[]};var _0x4fac76=_[_0x83be('0x2a')](db[_0x83be('0x2b')][_0x83be('0x2c')],function(_0x2dcef7){return{'name':_0x2dcef7[_0x83be('0x2d')],'type':_0x2dcef7['type']['key']};});_0x2c91df[_0x83be('0x2e')]=_[_0x83be('0x2a')](_0x4fac76,_0x83be('0x2f'));_0x2c91df[_0x83be('0x30')]=_[_0x83be('0x31')](_0x2da360[_0x83be('0x30')]);_0x2c91df[_0x83be('0x32')]=_[_0x83be('0x33')](_0x2c91df[_0x83be('0x2e')],_0x2c91df[_0x83be('0x30')]);_0x1f6211[_0x83be('0x34')]=_[_0x83be('0x33')](_0x2c91df[_0x83be('0x2e')],qs['fields'](_0x2da360[_0x83be('0x30')][_0x83be('0x35')]));_0x1f6211['attributes']=_0x1f6211['attributes']['length']?_0x1f6211['attributes']:_0x2c91df[_0x83be('0x2e')];if(!_0x2da360[_0x83be('0x30')][_0x83be('0x36')](_0x83be('0x37'))){_0x1f6211[_0x83be('0x1d')]=qs['limit'](_0x2da360[_0x83be('0x30')][_0x83be('0x1d')]);_0x1f6211[_0x83be('0x1a')]=qs[_0x83be('0x1a')](_0x2da360[_0x83be('0x30')][_0x83be('0x1a')]);}_0x1f6211[_0x83be('0x38')]=qs['sort'](_0x2da360[_0x83be('0x30')][_0x83be('0x39')]);_0x1f6211[_0x83be('0x3a')]=qs['filters'](_[_0x83be('0x3b')](_0x2da360['query'],_0x2c91df['filters']),_0x4fac76);if(_0x2da360[_0x83be('0x30')]['filter']){_0x1f6211[_0x83be('0x3a')]=_[_0x83be('0x3c')](_0x1f6211['where'],{'$or':_[_0x83be('0x2a')](_0x4fac76,function(_0x1a1061){if(_0x1a1061[_0x83be('0x3d')]!==_0x83be('0x3e')){var _0x22dd82={};_0x22dd82[_0x1a1061['name']]={'$like':'%'+_0x2da360[_0x83be('0x30')][_0x83be('0x3f')]+'%'};return _0x22dd82;}})});}_0x1f6211=_['merge']({},_0x1f6211,_0x2da360[_0x83be('0x40')]);var _0x34a14b={'where':_0x1f6211[_0x83be('0x3a')]};return db[_0x83be('0x2b')][_0x83be('0x1c')](_0x34a14b)[_0x83be('0x24')](function(_0x30a407){_0x281f9e[_0x83be('0x1c')]=_0x30a407;if(_0x2da360['query']['includeAll']){_0x1f6211['include']=[{'all':!![]}];}return db['SmsApplication'][_0x83be('0x41')](_0x1f6211);})[_0x83be('0x24')](function(_0x1bd879){_0x281f9e['rows']=_0x1bd879;return _0x281f9e;})[_0x83be('0x24')](respondWithFilteredResult(_0x4a4381,_0x1f6211))[_0x83be('0x42')](handleError(_0x4a4381,null));};exports[_0x83be('0x43')]=function(_0x206059,_0x3124f6){var _0x580bdd={'raw':!![],'where':{'id':_0x206059[_0x83be('0x44')]['id']}},_0xdb62d2={};_0xdb62d2[_0x83be('0x2e')]=_[_0x83be('0x31')](db[_0x83be('0x2b')]['rawAttributes']);_0xdb62d2[_0x83be('0x30')]=_[_0x83be('0x31')](_0x206059[_0x83be('0x30')]);_0xdb62d2[_0x83be('0x32')]=_[_0x83be('0x33')](_0xdb62d2['model'],_0xdb62d2[_0x83be('0x30')]);_0x580bdd[_0x83be('0x34')]=_[_0x83be('0x33')](_0xdb62d2[_0x83be('0x2e')],qs[_0x83be('0x35')](_0x206059[_0x83be('0x30')][_0x83be('0x35')]));_0x580bdd['attributes']=_0x580bdd[_0x83be('0x34')]['length']?_0x580bdd[_0x83be('0x34')]:_0xdb62d2['model'];if(_0x206059[_0x83be('0x30')][_0x83be('0x45')]){_0x580bdd[_0x83be('0x46')]=[{'all':!![]}];}_0x580bdd=_[_0x83be('0x3c')]({},_0x580bdd,_0x206059[_0x83be('0x40')]);return db[_0x83be('0x2b')][_0x83be('0x47')](_0x580bdd)[_0x83be('0x24')](handleEntityNotFound(_0x3124f6,null))['then'](respondWithResult(_0x3124f6,null))[_0x83be('0x42')](handleError(_0x3124f6,null));};exports[_0x83be('0x48')]=function(_0x28460f,_0x1bd18d){return db['SmsApplication'][_0x83be('0x48')](_0x28460f[_0x83be('0x49')],{})[_0x83be('0x24')](respondWithResult(_0x1bd18d,0xc9))[_0x83be('0x42')](handleError(_0x1bd18d,null));};exports[_0x83be('0x23')]=function(_0x3518be,_0x495659){if(_0x3518be['body']['id']){delete _0x3518be['body']['id'];}return db['SmsApplication']['find']({'where':{'id':_0x3518be[_0x83be('0x44')]['id']}})[_0x83be('0x24')](handleEntityNotFound(_0x495659,null))['then'](saveUpdates(_0x3518be['body'],null))['then'](respondWithResult(_0x495659,null))[_0x83be('0x42')](handleError(_0x495659,null));};exports[_0x83be('0x4a')]=function(_0xcde85,_0x2cd9b3){return db['SmsApplication']['find']({'where':{'id':_0xcde85[_0x83be('0x44')]['id']}})[_0x83be('0x24')](handleEntityNotFound(_0x2cd9b3,null))[_0x83be('0x24')](removeEntity(_0x2cd9b3,null))[_0x83be('0x42')](handleError(_0x2cd9b3,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 19e8888..3a80be7 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 _0xbf88=['request-promise','path','rimraf','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x236414,_0x3aeabd){var _0x3227be=function(_0x4c35b4){while(--_0x4c35b4){_0x236414['push'](_0x236414['shift']());}};_0x3227be(++_0x3aeabd);}(_0xbf88,0x19e));var _0x8bf8=function(_0x2ec4af,_0x450ff4){_0x2ec4af=_0x2ec4af-0x0;var _0x22ef33=_0xbf88[_0x2ec4af];return _0x22ef33;};'use strict';var _=require(_0x8bf8('0x0'));var util=require(_0x8bf8('0x1'));var logger=require(_0x8bf8('0x2'))(_0x8bf8('0x3'));var moment=require(_0x8bf8('0x4'));var BPromise=require(_0x8bf8('0x5'));var rp=require(_0x8bf8('0x6'));var fs=require('fs');var path=require(_0x8bf8('0x7'));var rimraf=require(_0x8bf8('0x8'));var config=require('../../config/environment');var attributes=require(_0x8bf8('0x9'));module[_0x8bf8('0xa')]=function(_0x5e8064,_0x36a0f6){return _0x5e8064[_0x8bf8('0xb')](_0x8bf8('0xc'),attributes,{'tableName':_0x8bf8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8bf8('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1af1=['path','rimraf','../../config/environment','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x1af1,0x1e9));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x11af('0x0'));var util=require(_0x11af('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x11af('0x2'));var BPromise=require(_0x11af('0x3'));var rp=require(_0x11af('0x4'));var fs=require('fs');var path=require(_0x11af('0x5'));var rimraf=require(_0x11af('0x6'));var config=require(_0x11af('0x7'));var attributes=require('./smsApplication.attributes');module[_0x11af('0x8')]=function(_0x1534f0,_0x17830a){return _0x1534f0['define'](_0x11af('0x9'),attributes,{'tableName':_0x11af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x11af('0xb'),'collate':_0x11af('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 84ff8f0..2d780e9 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 _0xa017=['error','code','message','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x1d1343,_0x4c0e82){var _0x54c55f=function(_0x5a10d1){while(--_0x5a10d1){_0x1d1343['push'](_0x1d1343['shift']());}};_0x54c55f(++_0x4c0e82);}(_0xa017,0x1f1));var _0x7a01=function(_0x31ef37,_0x353a24){_0x31ef37=_0x31ef37-0x0;var _0x1abd49=_0xa017[_0x31ef37];return _0x1abd49;};'use strict';var _=require(_0x7a01('0x0'));var util=require(_0x7a01('0x1'));var moment=require(_0x7a01('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a01('0x3'));var db=require(_0x7a01('0x4'))['db'];var utils=require(_0x7a01('0x5'));var logger=require(_0x7a01('0x6'))(_0x7a01('0x7'));var config=require(_0x7a01('0x8'));var jayson=require(_0x7a01('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x154915,_0x2ba0cd,_0x4e5cb2){return new BPromise(function(_0x501506,_0x5eb7eb){return client[_0x7a01('0xa')](_0x154915,_0x4e5cb2)['then'](function(_0x12fd3c){logger[_0x7a01('0xb')](_0x7a01('0xc'),_0x2ba0cd,_0x7a01('0xd'));logger[_0x7a01('0xe')](_0x7a01('0xf'),_0x2ba0cd,_0x7a01('0xd'),JSON['stringify'](_0x12fd3c));if(_0x12fd3c[_0x7a01('0x10')]){if(_0x12fd3c['error'][_0x7a01('0x11')]===0x1f4){logger[_0x7a01('0x10')](_0x7a01('0xc'),_0x2ba0cd,_0x12fd3c['error'][_0x7a01('0x12')]);return _0x5eb7eb(_0x12fd3c[_0x7a01('0x10')][_0x7a01('0x12')]);}logger[_0x7a01('0x10')](_0x7a01('0xc'),_0x2ba0cd,_0x12fd3c[_0x7a01('0x10')][_0x7a01('0x12')]);return _0x501506(_0x12fd3c[_0x7a01('0x10')][_0x7a01('0x12')]);}else{logger[_0x7a01('0xb')](_0x7a01('0xc'),_0x2ba0cd,_0x7a01('0xd'));_0x501506(_0x12fd3c['result']['message']);}})['catch'](function(_0x2ab749){logger['error'](_0x7a01('0xc'),_0x2ba0cd,_0x2ab749);_0x5eb7eb(_0x2ab749);});});} \ No newline at end of file +var _0x2ff5=['SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3527b5,_0x4246d0){var _0x2d178a=function(_0x438532){while(--_0x438532){_0x3527b5['push'](_0x3527b5['shift']());}};_0x2d178a(++_0x4246d0);}(_0x2ff5,0x1d5));var _0x52ff=function(_0x14f838,_0x48bc08){_0x14f838=_0x14f838-0x0;var _0x5796c6=_0x2ff5[_0x14f838];return _0x5796c6;};'use strict';var _=require('lodash');var util=require(_0x52ff('0x0'));var moment=require(_0x52ff('0x1'));var BPromise=require('bluebird');var rs=require(_0x52ff('0x2'));var fs=require('fs');var Redis=require(_0x52ff('0x3'));var db=require(_0x52ff('0x4'))['db'];var utils=require(_0x52ff('0x5'));var logger=require(_0x52ff('0x6'))(_0x52ff('0x7'));var config=require('../../config/environment');var jayson=require(_0x52ff('0x8'));var client=jayson[_0x52ff('0x9')][_0x52ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47e375,_0x33be91,_0xbbba62){return new BPromise(function(_0x3cfd13,_0x17ca0b){return client[_0x52ff('0xb')](_0x47e375,_0xbbba62)[_0x52ff('0xc')](function(_0x27c199){logger[_0x52ff('0xd')](_0x52ff('0xe'),_0x33be91,_0x52ff('0xf'));logger[_0x52ff('0x10')](_0x52ff('0x11'),_0x33be91,_0x52ff('0xf'),JSON[_0x52ff('0x12')](_0x27c199));if(_0x27c199[_0x52ff('0x13')]){if(_0x27c199['error']['code']===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x33be91,_0x27c199[_0x52ff('0x13')]['message']);return _0x17ca0b(_0x27c199[_0x52ff('0x13')][_0x52ff('0x14')]);}logger['error'](_0x52ff('0xe'),_0x33be91,_0x27c199[_0x52ff('0x13')][_0x52ff('0x14')]);return _0x3cfd13(_0x27c199[_0x52ff('0x13')][_0x52ff('0x14')]);}else{logger[_0x52ff('0xd')]('SmsApplication,\x20%s,\x20%s',_0x33be91,_0x52ff('0xf'));_0x3cfd13(_0x27c199[_0x52ff('0x15')][_0x52ff('0x14')]);}})[_0x52ff('0x16')](function(_0xa7ce6c){logger[_0x52ff('0x13')]('SmsApplication,\x20%s,\x20%s',_0x33be91,_0xa7ce6c);_0x17ca0b(_0xa7ce6c);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 89ea7fa..6fbb11a 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 _0xd7d1=['update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x500657,_0x5b7749){_0x500657=_0x500657-0x0;var _0x470e8d=_0xd7d1[_0x500657];return _0x470e8d;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getMessages']);router[_0x1d7d('0xb')]('/:id/download',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/',auth[_0x1d7d('0xc')](),controller['create']);router[_0x1d7d('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router[_0x1d7d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x1d7d('0x15')](_0x1d7d('0x16'),_0x1d7d('0x17')),controller[_0x1d7d('0x18')]);router[_0x1d7d('0x19')]('/:id',auth[_0x1d7d('0xc')](),interaction[_0x1d7d('0x15')]('sms',_0x1d7d('0x1a')),controller[_0x1d7d('0x1b')]);router[_0x1d7d('0x1c')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),interaction['tracked'](_0x1d7d('0x16'),_0x1d7d('0x1d')),controller['destroy']);router['delete'](_0x1d7d('0x1e'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1f')]);module[_0x1d7d('0x20')]=router; \ No newline at end of file +var _0x4cf8=['/:id','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','describe'];(function(_0x1ecebd,_0x2da8ab){var _0x59bed2=function(_0x437c15){while(--_0x437c15){_0x1ecebd['push'](_0x1ecebd['shift']());}};_0x59bed2(++_0x2da8ab);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x4cf8[_0x5c6244];return _0x5800ce;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/describe',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['get'](_0x84cf('0xe'),auth[_0x84cf('0xc')](),controller['show']);router[_0x84cf('0xb')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router['get'](_0x84cf('0x11'),auth[_0x84cf('0xc')](),controller['download']);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);router[_0x84cf('0x13')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x14')]);router[_0x84cf('0x13')](_0x84cf('0x15'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x18')),controller[_0x84cf('0x19')]);router[_0x84cf('0x1a')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1b')),controller['update']);router[_0x84cf('0x1c')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1d')),controller[_0x84cf('0x1e')]);router['delete']('/:id/tags',auth[_0x84cf('0xc')](),controller[_0x84cf('0x1f')]);module[_0x84cf('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index ad7ec46..2d35ca3 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 _0xa7be=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x188945,_0x2aafa5){var _0x4959c2=function(_0x534f43){while(--_0x534f43){_0x188945['push'](_0x188945['shift']());}};_0x4959c2(++_0x2aafa5);}(_0xa7be,0xfd));var _0xea7b=function(_0x3022d9,_0x19f200){_0x3022d9=_0x3022d9-0x0;var _0x2bd88c=_0xa7be[_0x3022d9];return _0x2bd88c;};'use strict';var Sequelize=require(_0xea7b('0x0'));var moment=require(_0xea7b('0x1'));module[_0xea7b('0x2')]={'closed':{'type':Sequelize[_0xea7b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xea7b('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xea7b('0x5')]},'note':{'type':Sequelize[_0xea7b('0x5')]},'phone':{'type':Sequelize[_0xea7b('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xea7b('0x6')]('in',_0xea7b('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xea7b('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xea7b('0x6')]('in',_0xea7b('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xea7b('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xc73a=['ENUM','out','moment','exports','BOOLEAN','STRING','DATE'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0xc73a,0x72));var _0xac73=function(_0x1db5ae,_0x5daba6){_0x1db5ae=_0x1db5ae-0x0;var _0x1e2e49=_0xc73a[_0x1db5ae];return _0x1e2e49;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xac73('0x0'));module[_0xac73('0x1')]={'closed':{'type':Sequelize[_0xac73('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xac73('0x3')]},'thirdDisposition':{'type':Sequelize[_0xac73('0x3')]},'note':{'type':Sequelize[_0xac73('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xac73('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xac73('0x5')]('in',_0xac73('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xac73('0x5')]('in',_0xac73('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xac73('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 15371cc..1d41b3c 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 _0xf12f=['from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','some','SmsAccountId','where','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SmsInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','show','params','rawAttributes','intersection','includeAll','include','create','describe','addMessage','ids','getMessages','SmsMessage','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','addTags','setTags','omit','removeTags','download','join','files','root','server','attachments','CmContact','lastName','Messages','secret','SmsAccount','Account','get','mkdirSync','Sms','Owner','N.A.','disposition','direction','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','unmanaged','total','closed','UserId','waiting','answered','talking','index','fieldName','type','key','model','query','keys','filters','fields','attributes','length','nolimit','order','sort','pick','select','field','color'];(function(_0x3723f3,_0x4cf1f8){var _0x395f21=function(_0x109f75){while(--_0x109f75){_0x3723f3['push'](_0x3723f3['shift']());}};_0x395f21(++_0x4cf1f8);}(_0xf12f,0x9c));var _0xff12=function(_0x42bce4,_0x2fe33e){_0x42bce4=_0x42bce4-0x0;var _0x1c1f71=_0xf12f[_0x42bce4];return _0x1c1f71;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff12('0x0'));var zipdir=require(_0xff12('0x1'));var jsonpatch=require(_0xff12('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xff12('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xff12('0x4'));var sox=require(_0xff12('0x5'));var csv=require(_0xff12('0x6'));var ejs=require(_0xff12('0x7'));var fs=require('fs');var fs_extra=require(_0xff12('0x8'));var _=require(_0xff12('0x9'));var squel=require(_0xff12('0xa'));var crypto=require(_0xff12('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xff12('0x6'));var querystring=require('querystring');var Papa=require(_0xff12('0xc'));var Redis=require(_0xff12('0xd'));var authService=require(_0xff12('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xff12('0xf'));var pdf=require(_0xff12('0x10'));var hardwareService=require(_0xff12('0x11'));var logger=require(_0xff12('0x12'))('api');var utils=require(_0xff12('0x13'));var config=require(_0xff12('0x14'));var licenseUtil=require(_0xff12('0x15'));var db=require('../../mysqldb')['db'];config[_0xff12('0x16')]=_['defaults'](config[_0xff12('0x16')],{'host':_0xff12('0x17'),'port':0x18eb});var socket=require(_0xff12('0x18'))(new Redis(config[_0xff12('0x16')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x26afae,_0x3bab41){_0x3bab41=_0x3bab41||0xcc;return function(_0x46990b){if(_0x46990b){return _0x26afae[_0xff12('0x19')](_0x3bab41);}return _0x26afae[_0xff12('0x1a')](_0x3bab41)[_0xff12('0x1b')]();};}function respondWithResult(_0x42610f,_0x59e703){_0x59e703=_0x59e703||0xc8;return function(_0x54dc0a){if(_0x54dc0a){return _0x42610f[_0xff12('0x1a')](_0x59e703)[_0xff12('0x1c')](_0x54dc0a);}};}function respondWithFilteredResult(_0x21edfa,_0x37bb28){return function(_0x5a5d4a){if(_0x5a5d4a){var _0x464462=typeof _0x37bb28[_0xff12('0x1d')]===_0xff12('0x1e')&&typeof _0x37bb28[_0xff12('0x1f')]===_0xff12('0x1e');var _0xd0bd83=_0x5a5d4a[_0xff12('0x20')];var _0x5c01cb=_0x464462?0x0:_0x37bb28[_0xff12('0x1d')];var _0x20a01d=_0x464462?_0x5a5d4a[_0xff12('0x20')]:_0x37bb28[_0xff12('0x1d')]+_0x37bb28[_0xff12('0x1f')];var _0x2b7b91;if(_0x20a01d>=_0xd0bd83){_0x20a01d=_0xd0bd83;_0x2b7b91=0xc8;}else{_0x2b7b91=0xce;}_0x21edfa[_0xff12('0x1a')](_0x2b7b91);return _0x21edfa[_0xff12('0x21')](_0xff12('0x22'),_0x5c01cb+'-'+_0x20a01d+'/'+_0xd0bd83)[_0xff12('0x1c')](_0x5a5d4a);}return null;};}function patchUpdates(_0x2dc113){return function(_0x1e0e00){try{jsonpatch[_0xff12('0x23')](_0x1e0e00,_0x2dc113,!![]);}catch(_0x23f707){return BPromise['reject'](_0x23f707);}return _0x1e0e00[_0xff12('0x24')]();};}function saveUpdates(_0xe8a838,_0x119b64){return function(_0x41fa20){if(_0x41fa20){return _0x41fa20[_0xff12('0x25')](_0xe8a838)[_0xff12('0x26')](function(_0x286c1f){return _0x286c1f;});}return null;};}function removeEntity(_0x34dbc6,_0x29b1b5){return function(_0x33e584){if(_0x33e584){return _0x33e584[_0xff12('0x27')]()[_0xff12('0x26')](function(){_0x34dbc6[_0xff12('0x1a')](0xcc)[_0xff12('0x1b')]();});}};}function handleEntityNotFound(_0x57f4d4,_0x20f089){return function(_0x5330de){if(!_0x5330de){_0x57f4d4[_0xff12('0x19')](0x194);}return _0x5330de;};}function handleError(_0x2a947f,_0x2f76cc){_0x2f76cc=_0x2f76cc||0x1f4;return function(_0x108803){logger[_0xff12('0x28')](_0x108803[_0xff12('0x29')]);if(_0x108803[_0xff12('0x2a')]){delete _0x108803['name'];}_0x2a947f[_0xff12('0x1a')](_0x2f76cc)['send'](_0x108803);};}function getInteractionUsers(_0x240284,_0x503bd5){return new BPromise(function(_0x2c2820,_0x2f01cf){try{if(_0x503bd5[_0x240284['id']]){_0x240284[_0xff12('0x2b')]=_[_0xff12('0x2c')](_0x503bd5[_0x240284['id']],function(_0x4e74fc){return{'id':_0x4e74fc['id'],'fullname':_0x4e74fc[_0xff12('0x2d')]};});}}catch(_0x4de54d){_0x2f01cf(_0x4de54d);}_0x2c2820(_0x240284);});}function getInteractionTags(_0x5b124e,_0x40f7f1){return new BPromise(function(_0x369907,_0x182b6e){try{if(_0x5b124e[_0xff12('0x2e')]){_0x5b124e[_0xff12('0x2f')]=[];_0x5b124e['TagIds'][_0xff12('0x30')](',')[_0xff12('0x31')](function(_0x1f6e61){_0x5b124e['Tags'][_0xff12('0x32')](_0x40f7f1[_0x1f6e61]);});}delete _0x5b124e[_0xff12('0x2e')];}catch(_0xfbd479){_0x182b6e(_0xfbd479);}_0x369907(_0x5b124e);});}function updateSmsInteraction(_0x24cbe0,_0xb4aa66,_0xd5b78f){return new BPromise(function(_0x464652,_0x2fb2c2){return getInteractionUsers(_0x24cbe0,_0xd5b78f)[_0xff12('0x26')](function(_0x28ece7){return getInteractionTags(_0x28ece7,_0xb4aa66);})['then'](function(_0x4fe59f){return getStateInteraction(_0x4fe59f);})[_0xff12('0x26')](function(_0x49bf6e){_0x464652(_0x49bf6e);})[_0xff12('0x33')](function(_0x4589a3){_0x2fb2c2(_0x4589a3);});});}function getStateInteraction(_0x57997f){return new BPromise(function(_0x4ba267){_0x57997f['waiting']=0x0;_0x57997f['talking']=0x0;_0x57997f['answered']=0x0;_0x57997f[_0xff12('0x34')]=0x0;_0x57997f[_0xff12('0x35')]=0x0;if(!_0x57997f[_0xff12('0x36')]&&!_0x57997f[_0xff12('0x37')]){_0x57997f[_0xff12('0x38')]+=0x1;}if(!_0x57997f[_0xff12('0x36')]&&_0x57997f[_0xff12('0x37')]){_0x57997f['talking']+=0x1;if(_0x57997f[_0xff12('0x38')]){_0x57997f[_0xff12('0x38')]-=0x1;}}if(_0x57997f[_0xff12('0x36')]&&_0x57997f[_0xff12('0x37')]){_0x57997f[_0xff12('0x39')]+=0x1;if(_0x57997f['talking']){_0x57997f[_0xff12('0x3a')]-=0x1;}}if(_0x57997f[_0xff12('0x36')]&&!_0x57997f[_0xff12('0x37')]){_0x57997f[_0xff12('0x34')]+=0x1;if(_0x57997f[_0xff12('0x38')]){_0x57997f['waiting']-=0x1;}}_0x57997f[_0xff12('0x35')]+=0x1;_0x4ba267(_0x57997f);});}exports[_0xff12('0x3b')]=function(_0x5d3b4a,_0x2a24db){var _0x391968={},_0x3922fe={},_0x20eee3={'count':0x0,'rows':[]};var _0x2a0909=_['map'](db['SmsInteraction']['rawAttributes'],function(_0x421a85){return{'name':_0x421a85[_0xff12('0x3c')],'type':_0x421a85[_0xff12('0x3d')][_0xff12('0x3e')]};});_0x3922fe[_0xff12('0x3f')]=_['map'](_0x2a0909,_0xff12('0x2a'));_0x3922fe[_0xff12('0x40')]=_[_0xff12('0x41')](_0x5d3b4a['query']);_0x3922fe[_0xff12('0x42')]=_['intersection'](_0x3922fe[_0xff12('0x3f')],_0x3922fe[_0xff12('0x40')]);_0x391968['attributes']=_['intersection'](_0x3922fe[_0xff12('0x3f')],qs[_0xff12('0x43')](_0x5d3b4a['query'][_0xff12('0x43')]));_0x391968[_0xff12('0x44')]=_0x391968[_0xff12('0x44')][_0xff12('0x45')]?_0x391968[_0xff12('0x44')]:_0x3922fe[_0xff12('0x3f')];if(!_0x5d3b4a[_0xff12('0x40')]['hasOwnProperty'](_0xff12('0x46'))){_0x391968[_0xff12('0x1f')]=qs[_0xff12('0x1f')](_0x5d3b4a[_0xff12('0x40')][_0xff12('0x1f')]);_0x391968[_0xff12('0x1d')]=qs['offset'](_0x5d3b4a[_0xff12('0x40')]['offset']);}_0x391968[_0xff12('0x47')]=qs['sort'](_0x5d3b4a['query'][_0xff12('0x48')]);_0x391968['where']=qs['filters'](_[_0xff12('0x49')](_0x5d3b4a['query'],_0x3922fe[_0xff12('0x42')]),_0x2a0909);var _0x5d9afc=[];var _0x5ae57=squel[_0xff12('0x4a')]()[_0xff12('0x4b')]('id')[_0xff12('0x4b')](_0xff12('0x2a'))[_0xff12('0x4b')](_0xff12('0x4c'))[_0xff12('0x4d')](_0xff12('0x4e'));var _0x38ea13=squel[_0xff12('0x4a')]()['field'](_0xff12('0x4f'))[_0xff12('0x4b')](_0xff12('0x50'))[_0xff12('0x4b')](_0xff12('0x51'))[_0xff12('0x4d')](_0xff12('0x52'),'ui')[_0xff12('0x53')](_0xff12('0x54'),'u',_0xff12('0x55'));var _0xfbc4a5=squel[_0xff12('0x4a')]()[_0xff12('0x4d')](_0xff12('0x56'),'i')[_0xff12('0x53')]('cm_contacts','c',_0xff12('0x57'))[_0xff12('0x53')](_0xff12('0x54'),'o',_0xff12('0x58'))[_0xff12('0x53')]('sms_accounts','a',_0xff12('0x59'))[_0xff12('0x53')](_0xff12('0x5a'),'me',_0xff12('0x5b'))[_0xff12('0x53')](_0xff12('0x5c'),'it',_0xff12('0x5d'))['left_join'](_0xff12('0x4e'),'t','t.id\x20=\x20it.TagId');var _0x578446=squel['expr']();var _0x36c574=[];var _0x4e6ecd=squel[_0xff12('0x5e')]();var _0x4e8fac;if(_0x5d3b4a['query'][_0xff12('0x5f')]){_0x4e8fac=as[_0xff12('0x60')](_0x5d3b4a[_0xff12('0x40')][_0xff12('0x5f')]);var _0x2ca86a=_0x4e8fac[_0xff12('0x61')];for(var _0x4a7c8a=0x0;_0x4a7c8a<_0x4e8fac[_0xff12('0x62')][_0xff12('0x45')];_0x4a7c8a++){var _0x3b3189=_0x4e8fac[_0xff12('0x62')][_0x4a7c8a];var _0x135da2='i';var _0x3bf8d7=_[_0xff12('0x63')](_0x2a0909,[_0xff12('0x2a'),_0x3b3189['field']]);if(!_0x3bf8d7){switch(_0x3b3189['field']){case'unreadMessages':if(_0x3b3189[_0xff12('0x64')]==0x1){_0xfbc4a5[_0xff12('0x65')]('`'+_0x3b3189[_0xff12('0x4b')]+'`\x20=\x200');}else{_0xfbc4a5[_0xff12('0x65')]('`'+_0x3b3189['field']+'`\x20>\x200');}break;case _0xff12('0x66'):if(_0x3b3189[_0xff12('0x67')]===_0xff12('0x68')){if(_0x3b3189[_0xff12('0x64')]['split']('\x20')[_0xff12('0x45')]>0x1){_0x578446[_0x2ca86a](_0xff12('0x69'),qs['getFullTextValue'](_0x3b3189['value']),null);}else{var _0x59acc3='%'+_0x3b3189[_0xff12('0x64')]+'%';_0x578446[_0x2ca86a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x59acc3,_0x59acc3,_0x59acc3);}}else{_0x3bf8d7=_[_0xff12('0x63')](_0x2a0909,[_0xff12('0x2a'),_0xff12('0x6a')]);_0x3b3189[_0xff12('0x4b')]=_0xff12('0x6a');_0x2d2bcb=as[_0xff12('0x6b')](_0x135da2,_0x3bf8d7[_0xff12('0x3d')],_0x3b3189);_0x578446[_0x2ca86a](_0x2d2bcb[_0xff12('0x6c')],_0x2d2bcb['value']['start'],_0x2d2bcb['value'][_0xff12('0x1b')]);}break;case _0xff12('0x6d'):var _0x54255f=_0x3b3189[_0xff12('0x64')][_0xff12('0x30')](',')[_0xff12('0x2c')](function(_0x3507ef){return Number(_0x3507ef);});_0x54255f[_0xff12('0x31')](function(_0x39595f){_0x4e6ecd['or'](_0xff12('0x6e'),'%,'+_0x39595f+',%');});_0x36c574=_[_0xff12('0x6f')](_0x36c574,_0x54255f);break;case _0xff12('0x70'):if(_0x3b3189[_0xff12('0x67')]===_0xff12('0x68')){_0x578446[_0x2ca86a](_0xff12('0x71'),'%'+_0x3b3189['value']+'%',null);}else{_0x3bf8d7=_['find'](_0x2a0909,[_0xff12('0x2a'),_0xff12('0x37')]);_0x3b3189[_0xff12('0x4b')]=_0xff12('0x37');_0x2d2bcb=as[_0xff12('0x6b')](_0x135da2,_0x3bf8d7[_0xff12('0x3d')],_0x3b3189);_0x578446[_0x2ca86a](_0x2d2bcb[_0xff12('0x6c')],_0x2d2bcb[_0xff12('0x64')][_0xff12('0x72')],_0x2d2bcb[_0xff12('0x64')]['end']);}break;case _0xff12('0x73'):_0x2d2bcb=as[_0xff12('0x6b')]('me',null,_0x3b3189);_0x578446[_0x2ca86a](_0x2d2bcb[_0xff12('0x6c')],_0x2d2bcb['value'][_0xff12('0x72')],_0x2d2bcb[_0xff12('0x64')][_0xff12('0x1b')]);break;}}else{var _0x2d2bcb=as[_0xff12('0x6b')](_0x135da2,_0x3bf8d7[_0xff12('0x3d')],_0x3b3189);_0x578446[_0x2ca86a](_0x2d2bcb[_0xff12('0x6c')],_0x2d2bcb[_0xff12('0x64')][_0xff12('0x72')],_0x2d2bcb[_0xff12('0x64')]['end']);}}}else{var _0x2706c9=_(_0x5d3b4a[_0xff12('0x40')])['keys']()[_0xff12('0x2c')](function(_0x25822f){return _[_0xff12('0x74')](_0x2a0909,[_0xff12('0x2a'),_0x25822f])?_0x25822f:undefined;})['compact']()[_0xff12('0x64')]();if(!_['isEmpty'](_0x2706c9)){_0x2706c9[_0xff12('0x31')](function(_0x10eaa6){if(_0x10eaa6===_0xff12('0x75')){_0xfbc4a5[_0xff12('0x76')]('i.SmsAccountId\x20IN\x20?',[][_0xff12('0x77')](_0x5d3b4a[_0xff12('0x40')][_0x10eaa6]));}else if(_0x10eaa6===_0xff12('0x78')){var _0x44f217=JSON[_0xff12('0x79')](_0x5d3b4a[_0xff12('0x40')][_0x10eaa6])[_0xff12('0x7a')];var _0x48c468=JSON['parse'](_0x5d3b4a['query'][_0x10eaa6])[_0xff12('0x7b')];_0xfbc4a5['where'](_0xff12('0x7c'),_0x44f217,_0x48c468);}else{if(_0x5d3b4a[_0xff12('0x40')][_0x10eaa6]===_0xff12('0x7d')){_0xfbc4a5[_0xff12('0x76')]('i.'+_0x10eaa6+_0xff12('0x7e'));}else{_0xfbc4a5['where']('i.'+_0x10eaa6+_0xff12('0x7f'),_0x5d3b4a[_0xff12('0x40')][_0x10eaa6]);}}});}if(_0x5d3b4a['query'][_0xff12('0x80')]){if(_0x5d3b4a[_0xff12('0x40')][_0xff12('0x80')]==0x1){_0xfbc4a5[_0xff12('0x65')]('`unreadMessages`\x20=\x200');}else{_0xfbc4a5[_0xff12('0x65')](_0xff12('0x81'));}}if(_0x5d3b4a[_0xff12('0x40')][_0xff12('0x82')]){_0x36c574=_[_0xff12('0x83')](_0x5d3b4a[_0xff12('0x40')]['tag'])?_0x5d3b4a['query']['tag']:new Array(_0x5d3b4a[_0xff12('0x40')]['tag']);_0x36c574[_0xff12('0x31')](function(_0x3496a0){_0x4e6ecd['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3496a0+',%');});}if(_0x5d3b4a[_0xff12('0x40')][_0xff12('0x84')]){var _0x569e58=_0x5d3b4a['query']['filter'][_0xff12('0x85')]('\x5c','\x5c\x5c')[_0xff12('0x85')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x569e58)){_0x578446['or'](_0xff12('0x86'),_0x569e58+'%')['or'](_0xff12('0x87'),_0x569e58+'%');}else{_0x578446['or'](_0xff12('0x88'),qs['getFullTextValue'](_0x569e58))['or'](_0xff12('0x89'),_0x569e58+'%');}}}_0xfbc4a5['where'](_0x578446);_0xfbc4a5[_0xff12('0x8a')](_0xff12('0x8b'));var _0xbc9ccd={'type':db[_0xff12('0x8c')][_0xff12('0x8d')][_0xff12('0x8e')],'raw':!![]};var _0x2fbb59=_0xfbc4a5[_0xff12('0x8f')]();_0x2fbb59['field'](_0xff12('0x8b'));_0x2fbb59[_0xff12('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xff12('0x90'));if(_0x391968[_0xff12('0x47')]){_0x391968[_0xff12('0x47')][_0xff12('0x31')](function(_0xacb15c){var _0x26b17b=_0xacb15c[0x0]===_0xff12('0x91')?_0xacb15c[0x0]:'i.'+_0xacb15c[0x0];_0xfbc4a5[_0xff12('0x47')](_0x26b17b,_0xacb15c[0x1]===_0xff12('0x92')?![]:!![]);});}if(!_[_0xff12('0x93')](_0x36c574)){_0xfbc4a5['having'](_0x4e6ecd);_0x2fbb59[_0xff12('0x76')](_0xff12('0x94'),_0x36c574);}BPromise[_0xff12('0x95')]()[_0xff12('0x26')](function(){if(!_0x4e8fac){if(_0x5d3b4a[_0xff12('0x40')][_0xff12('0x75')])return;_0x2fbb59['where'](_0xff12('0x96'));_0xfbc4a5[_0xff12('0x76')](_0xff12('0x96'));return;}if(_0x5d3b4a[_0xff12('0x97')][_0xff12('0x98')]!==_0xff12('0x99'))return;return _0x5d3b4a[_0xff12('0x97')][_0xff12('0x9a')]({'attributes':['id'],'raw':!![]})[_0xff12('0x26')](function(_0x42b265){if(_['isEmpty'](_0x42b265)){_0x2fbb59[_0xff12('0x76')](_0xff12('0x9b'));_0xfbc4a5['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x2fbb59[_0xff12('0x76')](_0xff12('0x9c'),_['map'](_0x42b265,'id'));_0xfbc4a5[_0xff12('0x76')](_0xff12('0x9c'),_[_0xff12('0x2c')](_0x42b265,'id'));}});})[_0xff12('0x26')](function(){if(_0x5d3b4a[_0xff12('0x97')][_0xff12('0x98')]===_0xff12('0x99')&&!_0x4e8fac&&!_0x5d3b4a['query'][_0xff12('0x75')])return[];return db[_0xff12('0x9d')][_0xff12('0x40')](_0x2fbb59[_0xff12('0x9e')](),_0xbc9ccd);})[_0xff12('0x26')](function(_0x223aa4){_0x20eee3['count']=_0x223aa4[_0xff12('0x45')];if(_0x20eee3[_0xff12('0x20')]===0x0)return[];return db['sequelize'][_0xff12('0x40')](_0x5ae57['toString'](),_0xbc9ccd)[_0xff12('0x26')](function(_0x4d4f25){_0x5d9afc=_[_0xff12('0x9f')](_0x4d4f25,'id');_0xbc9ccd=_[_0xff12('0xa0')](_0xbc9ccd,{'model':db[_0xff12('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d3b4a[_0xff12('0x40')][_0xff12('0x43')]){_0x391968['attributes'][_0xff12('0x31')](function(_0x3a64b0){_0xfbc4a5[_0xff12('0x4b')]('i.'+_0x3a64b0);});}else{_0xfbc4a5['field'](_0xff12('0xa2'),_0xff12('0x90'));_0xfbc4a5[_0xff12('0x4b')]('a.key','Account.key');_0xfbc4a5[_0xff12('0x4b')](_0xff12('0xa3'),_0xff12('0xa4'));_0xfbc4a5[_0xff12('0x4b')]('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',_0xff12('0x91'));_0xfbc4a5[_0xff12('0x4b')](_0xff12('0xa5'));_0xfbc4a5['field'](_0xff12('0xa6'),'Contact.firstName');_0xfbc4a5[_0xff12('0x4b')](_0xff12('0xa7'),'Contact.lastName');_0xfbc4a5[_0xff12('0x4b')]('c.email','Contact.email');_0xfbc4a5['field']('c.phone',_0xff12('0xa8'));_0xfbc4a5['field'](_0xff12('0xa9'),_0xff12('0xaa'));_0xfbc4a5[_0xff12('0x4b')](_0xff12('0xab'),_0xff12('0xac'));_0xfbc4a5['field'](_0xff12('0xad'),_0xff12('0xae'));_0xfbc4a5[_0xff12('0x4b')](_0xff12('0xaf'),_0xff12('0xb0'));_0xfbc4a5['field'](_0xff12('0xb1'),_0xff12('0x2e'));}if(_0x391968[_0xff12('0x1f')])_0xfbc4a5[_0xff12('0x1f')](_0x391968[_0xff12('0x1f')]);if(_0x391968[_0xff12('0x1d')])_0xfbc4a5[_0xff12('0x1d')](_0x391968[_0xff12('0x1d')]);return db[_0xff12('0x9d')][_0xff12('0x40')](_0xfbc4a5['toString'](),_0xbc9ccd);})['then'](function(_0x5d9dc1){if(_0x5d9dc1[_0xff12('0x45')]>0x0)_0x38ea13['where'](_0xff12('0xb2'),_['map'](_0x5d9dc1,'id'));return db[_0xff12('0x9d')][_0xff12('0x40')](_0x38ea13[_0xff12('0x9e')](),_0xbc9ccd)['then'](function(_0x58ef12){var _0x98364d=_[_0xff12('0xb3')](_0x58ef12,_0xff12('0xb4'));var _0x25534e=[];_0x5d9dc1[_0xff12('0x31')](function(_0x3e2b22){_0x25534e[_0xff12('0x32')](updateSmsInteraction(_0x3e2b22,_0x5d9afc,_0x98364d));});return BPromise['all'](_0x25534e);});});})[_0xff12('0x26')](function(_0x14fff0){_0x20eee3['rows']=_0x14fff0;return _0x20eee3;})[_0xff12('0x26')](respondWithFilteredResult(_0x2a24db,_0x391968))[_0xff12('0x33')](handleError(_0x2a24db,null));};exports[_0xff12('0xb5')]=function(_0x45f694,_0x309f17){var _0x3b01ed={'raw':![],'where':{'id':_0x45f694[_0xff12('0xb6')]['id']}},_0x3e6d9b={};_0x3e6d9b['model']=_[_0xff12('0x41')](db[_0xff12('0xa1')][_0xff12('0xb7')]);_0x3e6d9b['query']=_['keys'](_0x45f694[_0xff12('0x40')]);_0x3e6d9b[_0xff12('0x42')]=_[_0xff12('0xb8')](_0x3e6d9b[_0xff12('0x3f')],_0x3e6d9b[_0xff12('0x40')]);_0x3b01ed[_0xff12('0x44')]=_[_0xff12('0xb8')](_0x3e6d9b[_0xff12('0x3f')],qs['fields'](_0x45f694[_0xff12('0x40')][_0xff12('0x43')]));_0x3b01ed[_0xff12('0x44')]=_0x3b01ed['attributes'][_0xff12('0x45')]?_0x3b01ed[_0xff12('0x44')]:_0x3e6d9b[_0xff12('0x3f')];if(_0x45f694[_0xff12('0x40')][_0xff12('0xb9')]){_0x3b01ed[_0xff12('0xba')]=[{'all':!![]}];}_0x3b01ed=_['merge']({},_0x3b01ed,_0x45f694['options']);return db['SmsInteraction'][_0xff12('0x63')](_0x3b01ed)[_0xff12('0x26')](handleEntityNotFound(_0x309f17,null))[_0xff12('0x26')](respondWithResult(_0x309f17,null))[_0xff12('0x33')](handleError(_0x309f17,null));};exports[_0xff12('0xbb')]=function(_0x89044d,_0x272160){return db[_0xff12('0xa1')][_0xff12('0xbb')](_0x89044d[_0xff12('0x73')],{})[_0xff12('0x26')](respondWithResult(_0x272160,0xc9))[_0xff12('0x33')](handleError(_0x272160,null));};exports[_0xff12('0x25')]=function(_0x4e1997,_0x3d9eb8){if(_0x4e1997['body']['id']){delete _0x4e1997[_0xff12('0x73')]['id'];}return db[_0xff12('0xa1')]['find']({'where':{'id':_0x4e1997['params']['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x3d9eb8,null))[_0xff12('0x26')](saveUpdates(_0x4e1997[_0xff12('0x73')],null))[_0xff12('0x26')](respondWithResult(_0x3d9eb8,null))['catch'](handleError(_0x3d9eb8,null));};exports['destroy']=function(_0x560ac8,_0x10ef77){return db['SmsInteraction']['find']({'where':{'id':_0x560ac8[_0xff12('0xb6')]['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x10ef77,null))['then'](removeEntity(_0x10ef77,null))['catch'](handleError(_0x10ef77,null));};exports['describe']=function(_0x1dce7f,_0x4426e6){return db[_0xff12('0xa1')][_0xff12('0xbc')]()[_0xff12('0x26')](respondWithResult(_0x4426e6,null))['catch'](handleError(_0x4426e6,null));};exports[_0xff12('0xbd')]=function(_0x5bc5f5,_0x2b63d3,_0x15b792){return db['SmsMessage'][_0xff12('0x63')]({'where':{'id':_0x5bc5f5['params']['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x2b63d3,null))['then'](function(_0x1e1656){if(_0x1e1656){return _0x1e1656[_0xff12('0xbd')](_0x5bc5f5[_0xff12('0x73')][_0xff12('0xbe')],_['omit'](_0x5bc5f5[_0xff12('0x73')],[_0xff12('0xbe'),'id'])||{});}})['then'](respondWithResult(_0x2b63d3,null))[_0xff12('0x33')](handleError(_0x2b63d3,null));};exports[_0xff12('0xbf')]=function(_0x4c5612,_0x5cd9ed,_0x5ba5e1){var _0x16189a={'raw':![],'where':{}};var _0x1c4681={};var _0x23aa26={'count':0x0,'rows':[]};return db[_0xff12('0xa1')]['findOne']({'where':{'id':_0x4c5612[_0xff12('0xb6')]['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x5cd9ed,null))[_0xff12('0x26')](function(_0xe31aac){if(_0xe31aac){_0x1c4681[_0xff12('0x3f')]=_[_0xff12('0x41')](db[_0xff12('0xc0')]['rawAttributes']);_0x1c4681[_0xff12('0x40')]=_[_0xff12('0x41')](_0x4c5612['query']);_0x1c4681[_0xff12('0x42')]=_[_0xff12('0xb8')](_0x1c4681[_0xff12('0x3f')],_0x1c4681[_0xff12('0x40')]);_0x16189a[_0xff12('0x44')]=_[_0xff12('0xb8')](_0x1c4681[_0xff12('0x3f')],qs[_0xff12('0x43')](_0x4c5612[_0xff12('0x40')]['fields']));_0x16189a[_0xff12('0x44')]=_0x16189a[_0xff12('0x44')][_0xff12('0x45')]?_0x16189a[_0xff12('0x44')]:_0x1c4681[_0xff12('0x3f')];if(!_0x4c5612[_0xff12('0x40')][_0xff12('0xc1')](_0xff12('0x46'))){_0x16189a[_0xff12('0x1f')]=qs['limit'](_0x4c5612[_0xff12('0x40')][_0xff12('0x1f')]);_0x16189a[_0xff12('0x1d')]=qs['offset'](_0x4c5612[_0xff12('0x40')][_0xff12('0x1d')]);}_0x16189a[_0xff12('0x47')]=qs['sort'](_0x4c5612['query'][_0xff12('0x48')]);_0x16189a[_0xff12('0x76')]=qs[_0xff12('0x42')](_[_0xff12('0x49')](_0x4c5612[_0xff12('0x40')],_0x1c4681['filters']));_0x16189a['where'][_0xff12('0xb4')]=_0xe31aac['id'];if(_0x4c5612[_0xff12('0x40')][_0xff12('0x84')]){_0x16189a['where']=_[_0xff12('0xa0')](_0x16189a[_0xff12('0x76')],{'$or':_[_0xff12('0x2c')](_0x16189a[_0xff12('0x44')],function(_0x8a32a2){var _0x55e9c3={};_0x55e9c3[_0x8a32a2]={'$like':'%'+_0x4c5612[_0xff12('0x40')][_0xff12('0x84')]+'%'};return _0x55e9c3;})});}if(_0x4c5612[_0xff12('0x40')]['$gte']){var _0x54c01f=_0x4c5612['query']['$gte']['split'](',');var _0x1e61b5={};_0x1e61b5[_0x54c01f[0x0]]={'$gte':moment(_0x54c01f[0x1])[_0xff12('0xc2')](_0xff12('0xc3'))};_0x16189a[_0xff12('0x76')]=_[_0xff12('0xa0')](_0x16189a[_0xff12('0x76')],_0x1e61b5);}_0x16189a=_['merge']({},_0x16189a,_0x4c5612[_0xff12('0xc4')]);return db[_0xff12('0xc0')][_0xff12('0x20')]({'where':_0x16189a['where']})[_0xff12('0x26')](function(_0x2d0e1e){_0x23aa26[_0xff12('0x20')]=_0x2d0e1e;if(_0x4c5612[_0xff12('0x40')]['includeAll']){_0x16189a[_0xff12('0xba')]=[{'all':!![]}];}return db[_0xff12('0xc0')][_0xff12('0xc5')](_0x16189a);})[_0xff12('0x26')](function(_0x495aca){_0x23aa26[_0xff12('0xc6')]=_0x495aca;return _0x23aa26;});}})[_0xff12('0x26')](respondWithFilteredResult(_0x5cd9ed,_0x16189a))[_0xff12('0x33')](handleError(_0x5cd9ed,null));};exports[_0xff12('0xc7')]=function(_0x99f3dd,_0x4d1c86,_0x1d3d70){return db['SmsInteraction']['find']({'where':{'id':_0x99f3dd[_0xff12('0xb6')]['id']}})[_0xff12('0x26')](handleEntityNotFound(_0x4d1c86,null))['then'](function(_0x1de0c3){if(_0x1de0c3){return _0x1de0c3[_0xff12('0xc8')](_0x99f3dd[_0xff12('0x73')]['ids'],_[_0xff12('0xc9')](_0x99f3dd[_0xff12('0x73')],[_0xff12('0xbe'),'id'])||{})['spread'](function(){return db[_0xff12('0x6d')][_0xff12('0xc5')]({'attributes':['id',_0xff12('0x2a'),_0xff12('0x4c')],'where':{'id':_0x99f3dd['body'][_0xff12('0xbe')]}});})[_0xff12('0x26')](function(_0x1db250){socket['emit']('smsInteractionTags:save',{'id':Number(_0x99f3dd['params']['id']),'tags':_0x1db250||[]});return{'id':Number(_0x99f3dd['params']['id']),'tags':_0x1db250||[]};});}})[_0xff12('0x26')](respondWithResult(_0x4d1c86,null))[_0xff12('0x33')](handleError(_0x4d1c86,null));};exports['removeTags']=function(_0x574fa7,_0xd687f8,_0x1c23d0){return db[_0xff12('0xa1')][_0xff12('0x63')]({'where':{'id':_0x574fa7['params']['id']}})[_0xff12('0x26')](handleEntityNotFound(_0xd687f8,null))[_0xff12('0x26')](function(_0x2a32ec){if(_0x2a32ec){return _0x2a32ec[_0xff12('0xca')](_0x574fa7['query'][_0xff12('0xbe')]);}})[_0xff12('0x26')](respondWithStatusCode(_0xd687f8,null))[_0xff12('0x33')](handleError(_0xd687f8,null));};exports[_0xff12('0xcb')]=function(_0x3f1a20,_0x332384){var _0x3fb61a=moment()['unix']()[_0xff12('0x9e')]();var _0xd3c920=path[_0xff12('0xcc')](config['root'],'server',_0xff12('0xcd'),'tmp');var _0x350fc8=path['join'](config[_0xff12('0xce')],_0xff12('0xcf'),_0xff12('0xcd'),_0xff12('0xd0'));var _0x2d9ba7=path[_0xff12('0xcc')](_0xd3c920,_0x3fb61a);var _0x3713f5=util[_0xff12('0xc2')]('transcript-%d-%s.zip',_0x3f1a20[_0xff12('0xb6')]['id'],_0x3fb61a);var _0x368561=path[_0xff12('0xcc')](_0xd3c920,_0x3713f5);var _0x207c2f=[];_0x207c2f[_0xff12('0x32')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x207c2f[_0xff12('0x32')]({'model':db[_0xff12('0xd1')],'as':_0xff12('0x66'),'attributes':['id','firstName',_0xff12('0xd2')],'raw':!![]});var _0x4c548f=[{'model':db[_0xff12('0xc0')],'as':_0xff12('0xd3'),'attributes':['id',_0xff12('0x73'),'createdAt','direction',_0xff12('0xd4'),_0xff12('0x80')],'include':_0x207c2f}];_0x4c548f[_0xff12('0x32')]({'model':db[_0xff12('0xd5')],'as':_0xff12('0xd6'),'attributes':['id','name']});_0x4c548f[_0xff12('0x32')]({'model':db[_0xff12('0x70')],'as':'Owner','attributes':['id',_0xff12('0x2d')]});return db['SmsInteraction'][_0xff12('0x63')]({'where':{'id':_0x3f1a20[_0xff12('0xb6')]['id']},'include':_0x4c548f})['then'](handleEntityNotFound(_0x332384,null))[_0xff12('0x26')](function(_0x2170ef){if(_0x2170ef){var _0x2dc73d=_0x2170ef[_0xff12('0xd7')]({'plain':!![]});fs[_0xff12('0xd8')](_0x2d9ba7);var _0x458704={'channel':_0xff12('0xd9'),'account':_0x2dc73d[_0xff12('0xd6')]['name'],'agent':_0x2dc73d['Owner']?_0x2dc73d[_0xff12('0xda')]['fullname']:_0xff12('0xdb'),'createdAt':moment(_0x2dc73d[_0xff12('0x78')])['format'](_0xff12('0xc3'))['toString'](),'closedAt':_0x2dc73d[_0xff12('0x36')]?moment(_0x2dc73d['closedAt'])['format'](_0xff12('0xc3'))[_0xff12('0x9e')]():'','disposition':_0x2dc73d[_0xff12('0xdc')],'messages':_(_0x2dc73d['Messages'])[_0xff12('0x84')]({'secret':![]})[_0xff12('0x2c')](function(_0x23d195){return{'date':moment(_0x23d195[_0xff12('0x78')])[_0xff12('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0xff12('0x9e')](),'sender':_0x23d195[_0xff12('0xdd')]===_0xff12('0xde')?_0x23d195[_0xff12('0x70')]?_0x23d195[_0xff12('0x70')][_0xff12('0x2d')]:_0xff12('0xdf'):_0x23d195[_0xff12('0x66')]['firstName']+(_0x23d195[_0xff12('0x66')][_0xff12('0xd2')]?'\x20'+_0x23d195['Contact'][_0xff12('0xd2')]:''),'body':_0x23d195['body'],'direction':_0x23d195['direction']==='out'?'A':'C','secret':_0x23d195[_0xff12('0xd4')],'read':_0x23d195[_0xff12('0x80')]};})['value']()};return ejs[_0xff12('0xe0')](path['join'](config[_0xff12('0xce')],'server',_0xff12('0xe1'),_0xff12('0xe2')),{'interaction':_0x458704})[_0xff12('0x26')](function(_0x3af31c){var _0x41274c=path[_0xff12('0xcc')](_0x2d9ba7,_0xff12('0xe3')+_0x2dc73d['id']+'-'+_0x3fb61a+_0xff12('0xe4'));var _0xa1e875={'path':_0x41274c,'channel':'Sms','interactionId':_0x2dc73d['id']};return pdf[_0xff12('0xe5')](_0x3af31c,_0xa1e875);})[_0xff12('0x26')](function(){return new BPromise(function(_0x52fd73,_0x46aea7){zipdir(_0x2d9ba7,{'saveTo':_0x368561},function(_0x589d1d,_0x4dffdc){if(_0x589d1d)return _0x46aea7(_0x589d1d);return _0x52fd73(_0x4dffdc);});})[_0xff12('0x26')](function(){return new BPromise(function(_0x1e039c,_0x225b63){rimraf(_0x2d9ba7,function(_0x386517){if(_0x386517)_0x225b63(_0x386517);return _0x1e039c();});});})['then'](function(){return _0x332384['download'](_0x368561,_0x3713f5,function(_0x5dc280){if(_0x5dc280){console[_0xff12('0xe6')](_0xff12('0xe7'),_0x5dc280);}else{fs[_0xff12('0xe8')](_0x368561);}});});});}else{return _0x332384[_0xff12('0x19')](0xc8);}})[_0xff12('0x33')](handleError(_0x332384,null));}; \ No newline at end of file +var _0x6714=['search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','isArray','tag','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','getFullTextValue','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','includeAll','options','catch','create','describe','addMessage','ids','findOne','SmsMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','omit','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','root','tmp','server','files','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','createdAt','direction','secret','read','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','closedAt','disposition','Messages','out','System','renderFile','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','status','offset','undefined','limit','count','set','json','apply','save','then','destroy','end','sendStatus','error','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','push','waiting','talking','answered','unmanaged','total','closed','UserId','index','SmsInteraction','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','tools_tags','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr'];(function(_0x14437f,_0xc14167){var _0x4d0175=function(_0xb74854){while(--_0xb74854){_0x14437f['push'](_0x14437f['shift']());}};_0x4d0175(++_0xc14167);}(_0x6714,0x172));var _0x4671=function(_0x842858,_0x3a3ca0){_0x842858=_0x842858-0x0;var _0x46c2a2=_0x6714[_0x842858];return _0x46c2a2;};'use strict';var emlformat=require(_0x4671('0x0'));var rimraf=require(_0x4671('0x1'));var zipdir=require(_0x4671('0x2'));var jsonpatch=require(_0x4671('0x3'));var rp=require(_0x4671('0x4'));var moment=require(_0x4671('0x5'));var BPromise=require(_0x4671('0x6'));var Mustache=require(_0x4671('0x7'));var util=require(_0x4671('0x8'));var path=require(_0x4671('0x9'));var sox=require(_0x4671('0xa'));var csv=require('to-csv');var ejs=require(_0x4671('0xb'));var fs=require('fs');var fs_extra=require(_0x4671('0xc'));var _=require(_0x4671('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4671('0xe'));var deskjs=require(_0x4671('0xf'));var toCsv=require(_0x4671('0x10'));var querystring=require(_0x4671('0x11'));var Papa=require('papaparse');var Redis=require(_0x4671('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4671('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x4671('0x14'));var hardwareService=require(_0x4671('0x15'));var logger=require('../../config/logger')(_0x4671('0x16'));var utils=require(_0x4671('0x17'));var config=require(_0x4671('0x18'));var licenseUtil=require(_0x4671('0x19'));var db=require(_0x4671('0x1a'))['db'];config['redis']=_[_0x4671('0x1b')](config[_0x4671('0x1c')],{'host':_0x4671('0x1d'),'port':0x18eb});var socket=require(_0x4671('0x1e'))(new Redis(config['redis']));require(_0x4671('0x1f'))[_0x4671('0x20')](socket);function respondWithStatusCode(_0x17936f,_0x5ba45e){_0x5ba45e=_0x5ba45e||0xcc;return function(_0x2ee75b){if(_0x2ee75b){return _0x17936f['sendStatus'](_0x5ba45e);}return _0x17936f[_0x4671('0x21')](_0x5ba45e)['end']();};}function respondWithResult(_0x42fdf6,_0x4ad456){_0x4ad456=_0x4ad456||0xc8;return function(_0x55aa71){if(_0x55aa71){return _0x42fdf6['status'](_0x4ad456)['json'](_0x55aa71);}};}function respondWithFilteredResult(_0x319c0d,_0x1b0e98){return function(_0xeaba5c){if(_0xeaba5c){var _0xc4225c=typeof _0x1b0e98[_0x4671('0x22')]===_0x4671('0x23')&&typeof _0x1b0e98[_0x4671('0x24')]==='undefined';var _0x3726f0=_0xeaba5c[_0x4671('0x25')];var _0xf1dc4a=_0xc4225c?0x0:_0x1b0e98[_0x4671('0x22')];var _0x8da50a=_0xc4225c?_0xeaba5c['count']:_0x1b0e98[_0x4671('0x22')]+_0x1b0e98[_0x4671('0x24')];var _0x1e4fbe;if(_0x8da50a>=_0x3726f0){_0x8da50a=_0x3726f0;_0x1e4fbe=0xc8;}else{_0x1e4fbe=0xce;}_0x319c0d['status'](_0x1e4fbe);return _0x319c0d[_0x4671('0x26')]('Content-Range',_0xf1dc4a+'-'+_0x8da50a+'/'+_0x3726f0)[_0x4671('0x27')](_0xeaba5c);}return null;};}function patchUpdates(_0x4464c4){return function(_0x486003){try{jsonpatch[_0x4671('0x28')](_0x486003,_0x4464c4,!![]);}catch(_0x5ad61a){return BPromise['reject'](_0x5ad61a);}return _0x486003[_0x4671('0x29')]();};}function saveUpdates(_0xce516,_0x559bb6){return function(_0x26c24a){if(_0x26c24a){return _0x26c24a['update'](_0xce516)[_0x4671('0x2a')](function(_0x5c28dc){return _0x5c28dc;});}return null;};}function removeEntity(_0x4d2487,_0x10ef92){return function(_0x1bbbbf){if(_0x1bbbbf){return _0x1bbbbf[_0x4671('0x2b')]()[_0x4671('0x2a')](function(){_0x4d2487[_0x4671('0x21')](0xcc)[_0x4671('0x2c')]();});}};}function handleEntityNotFound(_0x25eda3,_0x5603d9){return function(_0x973bf){if(!_0x973bf){_0x25eda3[_0x4671('0x2d')](0x194);}return _0x973bf;};}function handleError(_0x49731a,_0x4bc13b){_0x4bc13b=_0x4bc13b||0x1f4;return function(_0x316953){logger[_0x4671('0x2e')](_0x316953[_0x4671('0x2f')]);if(_0x316953[_0x4671('0x30')]){delete _0x316953[_0x4671('0x30')];}_0x49731a[_0x4671('0x21')](_0x4bc13b)[_0x4671('0x31')](_0x316953);};}function getInteractionUsers(_0x11cb0a,_0x4befba){return new BPromise(function(_0x320d1e,_0x9c74c9){try{if(_0x4befba[_0x11cb0a['id']]){_0x11cb0a[_0x4671('0x32')]=_[_0x4671('0x33')](_0x4befba[_0x11cb0a['id']],function(_0x393ece){return{'id':_0x393ece['id'],'fullname':_0x393ece[_0x4671('0x34')]};});}}catch(_0x5e4148){_0x9c74c9(_0x5e4148);}_0x320d1e(_0x11cb0a);});}function getInteractionTags(_0x4e8c36,_0x3dbd59){return new BPromise(function(_0x115b19,_0x17a64b){try{if(_0x4e8c36['TagIds']){_0x4e8c36[_0x4671('0x35')]=[];_0x4e8c36[_0x4671('0x36')][_0x4671('0x37')](',')[_0x4671('0x38')](function(_0x3ee72f){_0x4e8c36['Tags'][_0x4671('0x39')](_0x3dbd59[_0x3ee72f]);});}delete _0x4e8c36[_0x4671('0x36')];}catch(_0x4a6fea){_0x17a64b(_0x4a6fea);}_0x115b19(_0x4e8c36);});}function updateSmsInteraction(_0x24976b,_0x24db8c,_0x2abb43){return new BPromise(function(_0x37453c,_0x17fd20){return getInteractionUsers(_0x24976b,_0x2abb43)['then'](function(_0x55d111){return getInteractionTags(_0x55d111,_0x24db8c);})[_0x4671('0x2a')](function(_0x4108e3){return getStateInteraction(_0x4108e3);})[_0x4671('0x2a')](function(_0x4a0f48){_0x37453c(_0x4a0f48);})['catch'](function(_0x18da26){_0x17fd20(_0x18da26);});});}function getStateInteraction(_0x3a5528){return new BPromise(function(_0x7de5df){_0x3a5528[_0x4671('0x3a')]=0x0;_0x3a5528[_0x4671('0x3b')]=0x0;_0x3a5528[_0x4671('0x3c')]=0x0;_0x3a5528[_0x4671('0x3d')]=0x0;_0x3a5528[_0x4671('0x3e')]=0x0;if(!_0x3a5528[_0x4671('0x3f')]&&!_0x3a5528[_0x4671('0x40')]){_0x3a5528['waiting']+=0x1;}if(!_0x3a5528['closed']&&_0x3a5528[_0x4671('0x40')]){_0x3a5528[_0x4671('0x3b')]+=0x1;if(_0x3a5528[_0x4671('0x3a')]){_0x3a5528[_0x4671('0x3a')]-=0x1;}}if(_0x3a5528[_0x4671('0x3f')]&&_0x3a5528[_0x4671('0x40')]){_0x3a5528['answered']+=0x1;if(_0x3a5528['talking']){_0x3a5528[_0x4671('0x3b')]-=0x1;}}if(_0x3a5528[_0x4671('0x3f')]&&!_0x3a5528[_0x4671('0x40')]){_0x3a5528[_0x4671('0x3d')]+=0x1;if(_0x3a5528[_0x4671('0x3a')]){_0x3a5528[_0x4671('0x3a')]-=0x1;}}_0x3a5528['total']+=0x1;_0x7de5df(_0x3a5528);});}exports[_0x4671('0x41')]=function(_0xa1e61,_0x3de02a){var _0xad39aa={},_0x38e376={},_0x28edc9={'count':0x0,'rows':[]};var _0x12de28=_[_0x4671('0x33')](db[_0x4671('0x42')][_0x4671('0x43')],function(_0x558d39){return{'name':_0x558d39['fieldName'],'type':_0x558d39['type'][_0x4671('0x44')]};});_0x38e376[_0x4671('0x45')]=_[_0x4671('0x33')](_0x12de28,_0x4671('0x30'));_0x38e376[_0x4671('0x46')]=_['keys'](_0xa1e61['query']);_0x38e376['filters']=_[_0x4671('0x47')](_0x38e376['model'],_0x38e376[_0x4671('0x46')]);_0xad39aa[_0x4671('0x48')]=_['intersection'](_0x38e376[_0x4671('0x45')],qs[_0x4671('0x49')](_0xa1e61[_0x4671('0x46')]['fields']));_0xad39aa[_0x4671('0x48')]=_0xad39aa[_0x4671('0x48')][_0x4671('0x4a')]?_0xad39aa[_0x4671('0x48')]:_0x38e376[_0x4671('0x45')];if(!_0xa1e61[_0x4671('0x46')][_0x4671('0x4b')](_0x4671('0x4c'))){_0xad39aa[_0x4671('0x24')]=qs['limit'](_0xa1e61[_0x4671('0x46')][_0x4671('0x24')]);_0xad39aa[_0x4671('0x22')]=qs[_0x4671('0x22')](_0xa1e61['query'][_0x4671('0x22')]);}_0xad39aa[_0x4671('0x4d')]=qs[_0x4671('0x4e')](_0xa1e61[_0x4671('0x46')]['sort']);_0xad39aa[_0x4671('0x4f')]=qs[_0x4671('0x50')](_[_0x4671('0x51')](_0xa1e61[_0x4671('0x46')],_0x38e376['filters']),_0x12de28);var _0x4b3c50=[];var _0x45f13b=squel[_0x4671('0x52')]()[_0x4671('0x53')]('id')[_0x4671('0x53')](_0x4671('0x30'))['field'](_0x4671('0x54'))['from'](_0x4671('0x55'));var _0x131130=squel['select']()['field']('u.id')[_0x4671('0x53')]('u.fullname')['field'](_0x4671('0x56'))['from'](_0x4671('0x57'),'ui')[_0x4671('0x58')](_0x4671('0x59'),'u',_0x4671('0x5a'));var _0x3860e6=squel['select']()[_0x4671('0x5b')](_0x4671('0x5c'),'i')[_0x4671('0x58')](_0x4671('0x5d'),'c',_0x4671('0x5e'))['left_join'](_0x4671('0x59'),'o','o.id\x20=\x20i.UserId')[_0x4671('0x58')](_0x4671('0x5f'),'a',_0x4671('0x60'))[_0x4671('0x58')]('sms_messages','me',_0x4671('0x61'))[_0x4671('0x58')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0x4671('0x62'));var _0x3740eb=squel[_0x4671('0x63')]();var _0x4fbb20=[];var _0x5cca48=squel[_0x4671('0x63')]();var _0x410580;if(_0xa1e61[_0x4671('0x46')][_0x4671('0x64')]){_0x410580=as['parseSearch'](_0xa1e61[_0x4671('0x46')][_0x4671('0x64')]);var _0x2d7653=_0x410580[_0x4671('0x65')];for(var _0x14eb88=0x0;_0x14eb88<_0x410580[_0x4671('0x66')]['length'];_0x14eb88++){var _0xb0f8cf=_0x410580['conditions'][_0x14eb88];var _0x3e9aa3='i';var _0x2e2d9b=_['find'](_0x12de28,['name',_0xb0f8cf['field']]);if(!_0x2e2d9b){switch(_0xb0f8cf[_0x4671('0x53')]){case _0x4671('0x67'):if(_0xb0f8cf[_0x4671('0x68')]==0x1){_0x3860e6[_0x4671('0x69')]('`'+_0xb0f8cf['field']+_0x4671('0x6a'));}else{_0x3860e6[_0x4671('0x69')]('`'+_0xb0f8cf[_0x4671('0x53')]+_0x4671('0x6b'));}break;case _0x4671('0x6c'):if(_0xb0f8cf['operator']==='$substring'){if(_0xb0f8cf[_0x4671('0x68')][_0x4671('0x37')]('\x20')[_0x4671('0x4a')]>0x1){_0x3740eb[_0x2d7653]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xb0f8cf[_0x4671('0x68')]),null);}else{var _0x138778='%'+_0xb0f8cf[_0x4671('0x68')]+'%';_0x3740eb[_0x2d7653](_0x4671('0x6d'),_0x138778,_0x138778,_0x138778);}}else{_0x2e2d9b=_[_0x4671('0x6e')](_0x12de28,[_0x4671('0x30'),'ContactId']);_0xb0f8cf['field']='ContactId';_0x53f636=as[_0x4671('0x6f')](_0x3e9aa3,_0x2e2d9b[_0x4671('0x70')],_0xb0f8cf);_0x3740eb[_0x2d7653](_0x53f636[_0x4671('0x71')],_0x53f636[_0x4671('0x68')][_0x4671('0x72')],_0x53f636[_0x4671('0x68')][_0x4671('0x2c')]);}break;case _0x4671('0x73'):var _0x11627d=_0xb0f8cf[_0x4671('0x68')][_0x4671('0x37')](',')[_0x4671('0x33')](function(_0x58585e){return Number(_0x58585e);});_0x11627d[_0x4671('0x38')](function(_0x5a067d){_0x5cca48['or'](_0x4671('0x74'),'%,'+_0x5a067d+',%');});_0x4fbb20=_['union'](_0x4fbb20,_0x11627d);break;case _0x4671('0x75'):if(_0xb0f8cf['operator']===_0x4671('0x76')){_0x3740eb[_0x2d7653](_0x4671('0x77'),'%'+_0xb0f8cf[_0x4671('0x68')]+'%',null);}else{_0x2e2d9b=_[_0x4671('0x6e')](_0x12de28,[_0x4671('0x30'),_0x4671('0x40')]);_0xb0f8cf[_0x4671('0x53')]='UserId';_0x53f636=as[_0x4671('0x6f')](_0x3e9aa3,_0x2e2d9b[_0x4671('0x70')],_0xb0f8cf);_0x3740eb[_0x2d7653](_0x53f636[_0x4671('0x71')],_0x53f636['value'][_0x4671('0x72')],_0x53f636[_0x4671('0x68')][_0x4671('0x2c')]);}break;case _0x4671('0x78'):_0x53f636=as['buildExpression']('me',null,_0xb0f8cf);_0x3740eb[_0x2d7653](_0x53f636['text'],_0x53f636[_0x4671('0x68')][_0x4671('0x72')],_0x53f636[_0x4671('0x68')][_0x4671('0x2c')]);break;}}else{var _0x53f636=as[_0x4671('0x6f')](_0x3e9aa3,_0x2e2d9b[_0x4671('0x70')],_0xb0f8cf);_0x3740eb[_0x2d7653](_0x53f636['text'],_0x53f636[_0x4671('0x68')][_0x4671('0x72')],_0x53f636[_0x4671('0x68')][_0x4671('0x2c')]);}}}else{var _0x2a1f6a=_(_0xa1e61['query'])[_0x4671('0x79')]()[_0x4671('0x33')](function(_0x304955){return _[_0x4671('0x7a')](_0x12de28,['name',_0x304955])?_0x304955:undefined;})[_0x4671('0x7b')]()[_0x4671('0x68')]();if(!_[_0x4671('0x7c')](_0x2a1f6a)){_0x2a1f6a['forEach'](function(_0x5ead97){if(_0x5ead97===_0x4671('0x7d')){_0x3860e6[_0x4671('0x4f')](_0x4671('0x7e'),[][_0x4671('0x7f')](_0xa1e61[_0x4671('0x46')][_0x5ead97]));}else if(_0x5ead97==='createdAt'){var _0x225430=JSON[_0x4671('0x80')](_0xa1e61[_0x4671('0x46')][_0x5ead97])[_0x4671('0x81')];var _0xd391f2=JSON[_0x4671('0x80')](_0xa1e61[_0x4671('0x46')][_0x5ead97])['$lte'];_0x3860e6[_0x4671('0x4f')](_0x4671('0x82'),_0x225430,_0xd391f2);}else{if(_0xa1e61[_0x4671('0x46')][_0x5ead97]===_0x4671('0x83')){_0x3860e6[_0x4671('0x4f')]('i.'+_0x5ead97+'\x20IS\x20NULL');}else{_0x3860e6[_0x4671('0x4f')]('i.'+_0x5ead97+_0x4671('0x84'),_0xa1e61['query'][_0x5ead97]);}}});}if(_0xa1e61[_0x4671('0x46')]['read']){if(_0xa1e61[_0x4671('0x46')]['read']==0x1){_0x3860e6[_0x4671('0x69')]('`unreadMessages`\x20=\x200');}else{_0x3860e6['having']('`unreadMessages`\x20>\x200');}}if(_0xa1e61[_0x4671('0x46')]['tag']){_0x4fbb20=_[_0x4671('0x85')](_0xa1e61['query'][_0x4671('0x86')])?_0xa1e61[_0x4671('0x46')][_0x4671('0x86')]:new Array(_0xa1e61[_0x4671('0x46')]['tag']);_0x4fbb20[_0x4671('0x38')](function(_0x1161e0){_0x5cca48['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1161e0+',%');});}if(_0xa1e61[_0x4671('0x46')][_0x4671('0x87')]){var _0x428f31=_0xa1e61[_0x4671('0x46')]['filter'][_0x4671('0x88')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x428f31)){_0x3740eb['or'](_0x4671('0x89'),_0x428f31+'%')['or'](_0x4671('0x8a'),_0x428f31+'%');}else{_0x3740eb['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4671('0x8b')](_0x428f31))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x428f31+'%');}}}_0x3860e6[_0x4671('0x4f')](_0x3740eb);_0x3860e6[_0x4671('0x8c')](_0x4671('0x8d'));var _0x5f31eb={'type':db[_0x4671('0x8e')][_0x4671('0x8f')][_0x4671('0x90')],'raw':!![]};var _0x595507=_0x3860e6[_0x4671('0x91')]();_0x595507[_0x4671('0x53')](_0x4671('0x8d'));_0x595507[_0x4671('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4671('0x67'));if(_0xad39aa[_0x4671('0x4d')]){_0xad39aa[_0x4671('0x4d')][_0x4671('0x38')](function(_0x8bb6d5){var _0xa84480=_0x8bb6d5[0x0]===_0x4671('0x92')?_0x8bb6d5[0x0]:'i.'+_0x8bb6d5[0x0];_0x3860e6[_0x4671('0x4d')](_0xa84480,_0x8bb6d5[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4671('0x7c')](_0x4fbb20)){_0x3860e6[_0x4671('0x69')](_0x5cca48);_0x595507['where'](_0x4671('0x93'),_0x4fbb20);}BPromise[_0x4671('0x94')]()[_0x4671('0x2a')](function(){if(!_0x410580){if(_0xa1e61[_0x4671('0x46')][_0x4671('0x7d')])return;_0x595507['where'](_0x4671('0x95'));_0x3860e6[_0x4671('0x4f')](_0x4671('0x95'));return;}if(_0xa1e61[_0x4671('0x96')][_0x4671('0x97')]!==_0x4671('0x98'))return;return _0xa1e61['user'][_0x4671('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2c2190){if(_[_0x4671('0x7c')](_0x2c2190)){_0x595507[_0x4671('0x4f')](_0x4671('0x9a'));_0x3860e6[_0x4671('0x4f')](_0x4671('0x9a'));}else{_0x595507['where']('i.SmsAccountId\x20IN\x20?',_['map'](_0x2c2190,'id'));_0x3860e6[_0x4671('0x4f')](_0x4671('0x7e'),_[_0x4671('0x33')](_0x2c2190,'id'));}});})['then'](function(){if(_0xa1e61['user'][_0x4671('0x97')]===_0x4671('0x98')&&!_0x410580&&!_0xa1e61[_0x4671('0x46')][_0x4671('0x7d')])return[];return db[_0x4671('0x9b')][_0x4671('0x46')](_0x595507['toString'](),_0x5f31eb);})[_0x4671('0x2a')](function(_0x2b214d){_0x28edc9[_0x4671('0x25')]=_0x2b214d['length'];if(_0x28edc9['count']===0x0)return[];return db[_0x4671('0x9b')][_0x4671('0x46')](_0x45f13b[_0x4671('0x9c')](),_0x5f31eb)[_0x4671('0x2a')](function(_0x233373){_0x4b3c50=_[_0x4671('0x9d')](_0x233373,'id');_0x5f31eb=_[_0x4671('0x9e')](_0x5f31eb,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xa1e61['query'][_0x4671('0x49')]){_0xad39aa['attributes']['forEach'](function(_0x19961f){_0x3860e6[_0x4671('0x53')]('i.'+_0x19961f);});}else{_0x3860e6[_0x4671('0x53')](_0x4671('0x9f'),'unreadMessages');_0x3860e6['field'](_0x4671('0xa0'),_0x4671('0xa1'));_0x3860e6[_0x4671('0x53')](_0x4671('0xa2'),_0x4671('0xa3'));_0x3860e6[_0x4671('0x53')]('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',_0x4671('0x92'));_0x3860e6[_0x4671('0x53')](_0x4671('0xa4'));_0x3860e6[_0x4671('0x53')](_0x4671('0xa5'),_0x4671('0xa6'));_0x3860e6[_0x4671('0x53')]('c.lastName',_0x4671('0xa7'));_0x3860e6['field']('c.email',_0x4671('0xa8'));_0x3860e6[_0x4671('0x53')](_0x4671('0xa9'),'Contact.phone');_0x3860e6[_0x4671('0x53')](_0x4671('0xaa'),_0x4671('0xab'));_0x3860e6[_0x4671('0x53')](_0x4671('0xac'),_0x4671('0xad'));_0x3860e6[_0x4671('0x53')]('o.fullname',_0x4671('0xae'));_0x3860e6[_0x4671('0x53')](_0x4671('0xaf'),_0x4671('0xb0'));_0x3860e6['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4671('0x36'));}if(_0xad39aa[_0x4671('0x24')])_0x3860e6[_0x4671('0x24')](_0xad39aa['limit']);if(_0xad39aa[_0x4671('0x22')])_0x3860e6['offset'](_0xad39aa[_0x4671('0x22')]);return db[_0x4671('0x9b')][_0x4671('0x46')](_0x3860e6[_0x4671('0x9c')](),_0x5f31eb);})[_0x4671('0x2a')](function(_0x3afc43){if(_0x3afc43[_0x4671('0x4a')]>0x0)_0x131130['where'](_0x4671('0xb1'),_[_0x4671('0x33')](_0x3afc43,'id'));return db['sequelize'][_0x4671('0x46')](_0x131130[_0x4671('0x9c')](),_0x5f31eb)[_0x4671('0x2a')](function(_0x2e5d90){var _0x569d6c=_[_0x4671('0xb2')](_0x2e5d90,_0x4671('0xb3'));var _0x93548b=[];_0x3afc43[_0x4671('0x38')](function(_0x2f6290){_0x93548b['push'](updateSmsInteraction(_0x2f6290,_0x4b3c50,_0x569d6c));});return BPromise[_0x4671('0xb4')](_0x93548b);});});})['then'](function(_0x993c91){_0x28edc9[_0x4671('0xb5')]=_0x993c91;return _0x28edc9;})[_0x4671('0x2a')](respondWithFilteredResult(_0x3de02a,_0xad39aa))['catch'](handleError(_0x3de02a,null));};exports[_0x4671('0xb6')]=function(_0x13c499,_0x862203){var _0x312722={'raw':![],'where':{'id':_0x13c499[_0x4671('0xb7')]['id']}},_0x3a908a={};_0x3a908a[_0x4671('0x45')]=_[_0x4671('0x79')](db[_0x4671('0x42')]['rawAttributes']);_0x3a908a[_0x4671('0x46')]=_[_0x4671('0x79')](_0x13c499[_0x4671('0x46')]);_0x3a908a['filters']=_[_0x4671('0x47')](_0x3a908a[_0x4671('0x45')],_0x3a908a[_0x4671('0x46')]);_0x312722[_0x4671('0x48')]=_[_0x4671('0x47')](_0x3a908a[_0x4671('0x45')],qs['fields'](_0x13c499[_0x4671('0x46')]['fields']));_0x312722[_0x4671('0x48')]=_0x312722[_0x4671('0x48')][_0x4671('0x4a')]?_0x312722[_0x4671('0x48')]:_0x3a908a[_0x4671('0x45')];if(_0x13c499['query'][_0x4671('0xb8')]){_0x312722['include']=[{'all':!![]}];}_0x312722=_[_0x4671('0x9e')]({},_0x312722,_0x13c499[_0x4671('0xb9')]);return db[_0x4671('0x42')]['find'](_0x312722)[_0x4671('0x2a')](handleEntityNotFound(_0x862203,null))[_0x4671('0x2a')](respondWithResult(_0x862203,null))[_0x4671('0xba')](handleError(_0x862203,null));};exports[_0x4671('0xbb')]=function(_0x645473,_0x474596){return db[_0x4671('0x42')]['create'](_0x645473[_0x4671('0x78')],{})['then'](respondWithResult(_0x474596,0xc9))[_0x4671('0xba')](handleError(_0x474596,null));};exports['update']=function(_0xeff0c3,_0x355a9d){if(_0xeff0c3['body']['id']){delete _0xeff0c3[_0x4671('0x78')]['id'];}return db[_0x4671('0x42')][_0x4671('0x6e')]({'where':{'id':_0xeff0c3[_0x4671('0xb7')]['id']}})[_0x4671('0x2a')](handleEntityNotFound(_0x355a9d,null))[_0x4671('0x2a')](saveUpdates(_0xeff0c3[_0x4671('0x78')],null))[_0x4671('0x2a')](respondWithResult(_0x355a9d,null))[_0x4671('0xba')](handleError(_0x355a9d,null));};exports[_0x4671('0x2b')]=function(_0x30b931,_0x1dbcc1){return db[_0x4671('0x42')][_0x4671('0x6e')]({'where':{'id':_0x30b931[_0x4671('0xb7')]['id']}})['then'](handleEntityNotFound(_0x1dbcc1,null))[_0x4671('0x2a')](removeEntity(_0x1dbcc1,null))[_0x4671('0xba')](handleError(_0x1dbcc1,null));};exports['describe']=function(_0x3923c3,_0x21b072){return db[_0x4671('0x42')][_0x4671('0xbc')]()[_0x4671('0x2a')](respondWithResult(_0x21b072,null))[_0x4671('0xba')](handleError(_0x21b072,null));};exports[_0x4671('0xbd')]=function(_0x2bc785,_0x2f9eb7,_0x17475a){return db['SmsMessage'][_0x4671('0x6e')]({'where':{'id':_0x2bc785[_0x4671('0xb7')]['id']}})[_0x4671('0x2a')](handleEntityNotFound(_0x2f9eb7,null))[_0x4671('0x2a')](function(_0x34d3e2){if(_0x34d3e2){return _0x34d3e2['addMessage'](_0x2bc785[_0x4671('0x78')][_0x4671('0xbe')],_['omit'](_0x2bc785[_0x4671('0x78')],[_0x4671('0xbe'),'id'])||{});}})[_0x4671('0x2a')](respondWithResult(_0x2f9eb7,null))['catch'](handleError(_0x2f9eb7,null));};exports['getMessages']=function(_0x223860,_0x5b2868,_0x1363ea){var _0x77f321={'raw':![],'where':{}};var _0x3213bb={};var _0x3828c6={'count':0x0,'rows':[]};return db[_0x4671('0x42')][_0x4671('0xbf')]({'where':{'id':_0x223860[_0x4671('0xb7')]['id']}})[_0x4671('0x2a')](handleEntityNotFound(_0x5b2868,null))[_0x4671('0x2a')](function(_0x1dec27){if(_0x1dec27){_0x3213bb['model']=_[_0x4671('0x79')](db[_0x4671('0xc0')][_0x4671('0x43')]);_0x3213bb['query']=_[_0x4671('0x79')](_0x223860[_0x4671('0x46')]);_0x3213bb[_0x4671('0x50')]=_[_0x4671('0x47')](_0x3213bb[_0x4671('0x45')],_0x3213bb[_0x4671('0x46')]);_0x77f321[_0x4671('0x48')]=_['intersection'](_0x3213bb['model'],qs['fields'](_0x223860[_0x4671('0x46')][_0x4671('0x49')]));_0x77f321[_0x4671('0x48')]=_0x77f321[_0x4671('0x48')][_0x4671('0x4a')]?_0x77f321['attributes']:_0x3213bb[_0x4671('0x45')];if(!_0x223860[_0x4671('0x46')][_0x4671('0x4b')](_0x4671('0x4c'))){_0x77f321[_0x4671('0x24')]=qs[_0x4671('0x24')](_0x223860[_0x4671('0x46')][_0x4671('0x24')]);_0x77f321['offset']=qs['offset'](_0x223860[_0x4671('0x46')][_0x4671('0x22')]);}_0x77f321[_0x4671('0x4d')]=qs[_0x4671('0x4e')](_0x223860[_0x4671('0x46')][_0x4671('0x4e')]);_0x77f321[_0x4671('0x4f')]=qs[_0x4671('0x50')](_[_0x4671('0x51')](_0x223860[_0x4671('0x46')],_0x3213bb[_0x4671('0x50')]));_0x77f321[_0x4671('0x4f')][_0x4671('0xb3')]=_0x1dec27['id'];if(_0x223860['query'][_0x4671('0x87')]){_0x77f321[_0x4671('0x4f')]=_['merge'](_0x77f321[_0x4671('0x4f')],{'$or':_[_0x4671('0x33')](_0x77f321[_0x4671('0x48')],function(_0x324744){var _0xdd15d8={};_0xdd15d8[_0x324744]={'$like':'%'+_0x223860[_0x4671('0x46')]['filter']+'%'};return _0xdd15d8;})});}if(_0x223860[_0x4671('0x46')][_0x4671('0x81')]){var _0x2732e0=_0x223860[_0x4671('0x46')][_0x4671('0x81')][_0x4671('0x37')](',');var _0x1f7273={};_0x1f7273[_0x2732e0[0x0]]={'$gte':moment(_0x2732e0[0x1])[_0x4671('0xc1')](_0x4671('0xc2'))};_0x77f321['where']=_['merge'](_0x77f321[_0x4671('0x4f')],_0x1f7273);}_0x77f321=_[_0x4671('0x9e')]({},_0x77f321,_0x223860[_0x4671('0xb9')]);return db[_0x4671('0xc0')][_0x4671('0x25')]({'where':_0x77f321[_0x4671('0x4f')]})[_0x4671('0x2a')](function(_0x4b10d0){_0x3828c6[_0x4671('0x25')]=_0x4b10d0;if(_0x223860[_0x4671('0x46')][_0x4671('0xb8')]){_0x77f321['include']=[{'all':!![]}];}return db['SmsMessage'][_0x4671('0xc3')](_0x77f321);})['then'](function(_0x285bd4){_0x3828c6[_0x4671('0xb5')]=_0x285bd4;return _0x3828c6;});}})[_0x4671('0x2a')](respondWithFilteredResult(_0x5b2868,_0x77f321))[_0x4671('0xba')](handleError(_0x5b2868,null));};exports['addTags']=function(_0x4481fa,_0x3e489b,_0x4b5644){return db[_0x4671('0x42')][_0x4671('0x6e')]({'where':{'id':_0x4481fa[_0x4671('0xb7')]['id']}})[_0x4671('0x2a')](handleEntityNotFound(_0x3e489b,null))[_0x4671('0x2a')](function(_0x45e77a){if(_0x45e77a){return _0x45e77a[_0x4671('0xc4')](_0x4481fa[_0x4671('0x78')][_0x4671('0xbe')],_[_0x4671('0xc5')](_0x4481fa[_0x4671('0x78')],['ids','id'])||{})[_0x4671('0xc6')](function(){return db[_0x4671('0x73')][_0x4671('0xc3')]({'attributes':['id',_0x4671('0x30'),'color'],'where':{'id':_0x4481fa[_0x4671('0x78')]['ids']}});})[_0x4671('0x2a')](function(_0x48fdf2){socket[_0x4671('0xc7')](_0x4671('0xc8'),{'id':Number(_0x4481fa[_0x4671('0xb7')]['id']),'tags':_0x48fdf2||[]});return{'id':Number(_0x4481fa[_0x4671('0xb7')]['id']),'tags':_0x48fdf2||[]};});}})[_0x4671('0x2a')](respondWithResult(_0x3e489b,null))[_0x4671('0xba')](handleError(_0x3e489b,null));};exports[_0x4671('0xc9')]=function(_0x526edc,_0x514391,_0x2026d9){return db['SmsInteraction']['find']({'where':{'id':_0x526edc['params']['id']}})['then'](handleEntityNotFound(_0x514391,null))['then'](function(_0x49e708){if(_0x49e708){return _0x49e708[_0x4671('0xc9')](_0x526edc[_0x4671('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x514391,null))[_0x4671('0xba')](handleError(_0x514391,null));};exports[_0x4671('0xca')]=function(_0x4d92fb,_0x26b78d){var _0x3c1dfe=moment()[_0x4671('0xcb')]()[_0x4671('0x9c')]();var _0x10a063=path[_0x4671('0xcc')](config[_0x4671('0xcd')],'server','files',_0x4671('0xce'));var _0x103038=path[_0x4671('0xcc')](config[_0x4671('0xcd')],_0x4671('0xcf'),_0x4671('0xd0'),_0x4671('0xd1'));var _0x2b1a06=path[_0x4671('0xcc')](_0x10a063,_0x3c1dfe);var _0x501074=util['format'](_0x4671('0xd2'),_0x4d92fb[_0x4671('0xb7')]['id'],_0x3c1dfe);var _0x38f6cb=path[_0x4671('0xcc')](_0x10a063,_0x501074);var _0x15457b=[];_0x15457b[_0x4671('0x39')]({'model':db[_0x4671('0x75')],'as':_0x4671('0x75'),'attributes':['id','fullname'],'raw':!![]});_0x15457b['push']({'model':db[_0x4671('0xd3')],'as':_0x4671('0x6c'),'attributes':['id',_0x4671('0xd4'),_0x4671('0xd5')],'raw':!![]});var _0x1450d5=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x4671('0x78'),_0x4671('0xd6'),_0x4671('0xd7'),_0x4671('0xd8'),_0x4671('0xd9')],'include':_0x15457b}];_0x1450d5[_0x4671('0x39')]({'model':db[_0x4671('0xda')],'as':_0x4671('0xdb'),'attributes':['id',_0x4671('0x30')]});_0x1450d5['push']({'model':db[_0x4671('0x75')],'as':_0x4671('0xdc'),'attributes':['id',_0x4671('0x34')]});return db[_0x4671('0x42')]['find']({'where':{'id':_0x4d92fb[_0x4671('0xb7')]['id']},'include':_0x1450d5})[_0x4671('0x2a')](handleEntityNotFound(_0x26b78d,null))[_0x4671('0x2a')](function(_0x4a1eca){if(_0x4a1eca){var _0x25328a=_0x4a1eca[_0x4671('0xdd')]({'plain':!![]});fs[_0x4671('0xde')](_0x2b1a06);var _0x44289d={'channel':_0x4671('0xdf'),'account':_0x25328a['Account']['name'],'agent':_0x25328a[_0x4671('0xdc')]?_0x25328a[_0x4671('0xdc')][_0x4671('0x34')]:_0x4671('0xe0'),'createdAt':moment(_0x25328a[_0x4671('0xd6')])[_0x4671('0xc1')](_0x4671('0xc2'))[_0x4671('0x9c')](),'closedAt':_0x25328a['closed']?moment(_0x25328a[_0x4671('0xe1')])[_0x4671('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4671('0x9c')]():'','disposition':_0x25328a[_0x4671('0xe2')],'messages':_(_0x25328a[_0x4671('0xe3')])['filter']({'secret':![]})[_0x4671('0x33')](function(_0xf8fea0){return{'date':moment(_0xf8fea0[_0x4671('0xd6')])[_0x4671('0xc1')](_0x4671('0xc2'))[_0x4671('0x9c')](),'sender':_0xf8fea0['direction']===_0x4671('0xe4')?_0xf8fea0[_0x4671('0x75')]?_0xf8fea0['User'][_0x4671('0x34')]:_0x4671('0xe5'):_0xf8fea0[_0x4671('0x6c')]['firstName']+(_0xf8fea0[_0x4671('0x6c')]['lastName']?'\x20'+_0xf8fea0['Contact'][_0x4671('0xd5')]:''),'body':_0xf8fea0['body'],'direction':_0xf8fea0['direction']===_0x4671('0xe4')?'A':'C','secret':_0xf8fea0[_0x4671('0xd8')],'read':_0xf8fea0[_0x4671('0xd9')]};})[_0x4671('0x68')]()};return ejs[_0x4671('0xe6')](path['join'](config[_0x4671('0xcd')],'server','views','downloadInteraction.ejs'),{'interaction':_0x44289d})[_0x4671('0x2a')](function(_0x29998a){var _0x266ca8=path[_0x4671('0xcc')](_0x2b1a06,'transcript-'+_0x25328a['id']+'-'+_0x3c1dfe+'.pdf');var _0x28607b={'path':_0x266ca8,'channel':_0x4671('0xdf'),'interactionId':_0x25328a['id']};return pdf[_0x4671('0xe7')](_0x29998a,_0x28607b);})[_0x4671('0x2a')](function(){return new BPromise(function(_0x384ca0,_0x14892b){zipdir(_0x2b1a06,{'saveTo':_0x38f6cb},function(_0x5afe25,_0x3eee0c){if(_0x5afe25)return _0x14892b(_0x5afe25);return _0x384ca0(_0x3eee0c);});})[_0x4671('0x2a')](function(){return new BPromise(function(_0x331e5b,_0x19c0b0){rimraf(_0x2b1a06,function(_0x513fa5){if(_0x513fa5)_0x19c0b0(_0x513fa5);return _0x331e5b();});});})[_0x4671('0x2a')](function(){return _0x26b78d[_0x4671('0xca')](_0x38f6cb,_0x501074,function(_0x364485){if(_0x364485){console[_0x4671('0xe8')](_0x4671('0xe9'),_0x364485);}else{fs[_0x4671('0xea')](_0x38f6cb);}});});});}else{return _0x26b78d[_0x4671('0x2d')](0xc8);}})[_0x4671('0xba')](handleError(_0x26b78d,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index da16516..e373b80 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 _0x0598=['catch','hasOwnProperty','events','../../mysqldb','save','update','setDataValue','Users','map','then','unreadMessages','length'];(function(_0xa1e9e9,_0x31e58a){var _0x458625=function(_0x1a8e1a){while(--_0x1a8e1a){_0xa1e9e9['push'](_0xa1e9e9['shift']());}};_0x458625(++_0x31e58a);}(_0x0598,0x92));var _0x8059=function(_0x347c27,_0x4670a7){_0x347c27=_0x347c27-0x0;var _0x141e65=_0x0598[_0x347c27];return _0x141e65;};'use strict';var EventEmitter=require(_0x8059('0x0'));var SmsInteraction=require(_0x8059('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x8059('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8059('0x2'),'afterUpdate':_0x8059('0x3'),'afterDestroy':'remove'};function emitEvent(_0x54f42f){return function(_0x555fb5,_0x467206,_0xa7d7c1){_0x555fb5['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x248273){_0x555fb5[_0x8059('0x4')](_0x8059('0x5'),_0x248273[_0x8059('0x6')](function(_0x5df268){return{'id':_0x5df268['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x555fb5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8059('0x7')](function(_0x1bf5fd){_0x555fb5[_0x8059('0x4')](_0x8059('0x8'),_0x1bf5fd[_0x8059('0x9')]);SmsInteractionEvents['emit'](_0x54f42f+':'+_0x555fb5['id'],_0x555fb5);SmsInteractionEvents['emit'](_0x54f42f,_0x555fb5);_0xa7d7c1(null);})[_0x8059('0xa')](_0xa7d7c1(null));};}for(var e in events){if(events[_0x8059('0xb')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x1c9a=['then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users','findAll'];(function(_0x206e59,_0x204450){var _0x5f0aef=function(_0x26a54d){while(--_0x26a54d){_0x206e59['push'](_0x206e59['shift']());}};_0x5f0aef(++_0x204450);}(_0x1c9a,0x98));var _0xa1c9=function(_0x2e7f01,_0x59a267){_0x2e7f01=_0x2e7f01-0x0;var _0x18b185=_0x1c9a[_0x2e7f01];return _0x18b185;};'use strict';var EventEmitter=require(_0xa1c9('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xa1c9('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0xa1c9('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xa1c9('0x3')](0x0);var events={'afterCreate':_0xa1c9('0x4'),'afterUpdate':'update','afterDestroy':_0xa1c9('0x5')};function emitEvent(_0x45d1f7){return function(_0x20f0bf,_0x3a4387,_0x572229){_0x20f0bf[_0xa1c9('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x222624){_0x20f0bf[_0xa1c9('0x7')](_0xa1c9('0x8'),_0x222624['map'](function(_0x2dfa54){return{'id':_0x2dfa54['id']};}));return SmsMessage[_0xa1c9('0x9')]({'where':{'SmsInteractionId':_0x20f0bf['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa1c9('0xa')](function(_0x1efbab){_0x20f0bf['setDataValue'](_0xa1c9('0xb'),_0x1efbab[_0xa1c9('0xc')]);SmsInteractionEvents[_0xa1c9('0xd')](_0x45d1f7+':'+_0x20f0bf['id'],_0x20f0bf);SmsInteractionEvents[_0xa1c9('0xd')](_0x45d1f7,_0x20f0bf);_0x572229(null);})[_0xa1c9('0xe')](_0x572229(null));};}for(var e in events){if(events[_0xa1c9('0xf')](e)){var event=events[e];SmsInteraction[_0xa1c9('0x10')](e,emitEvent(event));}}module[_0xa1c9('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 1920380..eb0e441 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 _0x44f3=['sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','request-promise','path','./smsInteraction.attributes','exports','define'];(function(_0xb2dab9,_0x2f6f99){var _0x10c6ae=function(_0x40bd7b){while(--_0x40bd7b){_0xb2dab9['push'](_0xb2dab9['shift']());}};_0x10c6ae(++_0x2f6f99);}(_0x44f3,0x9c));var _0x344f=function(_0x4333f4,_0x45563c){_0x4333f4=_0x4333f4-0x0;var _0x2c4645=_0x44f3[_0x4333f4];return _0x2c4645;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x344f('0x0'))(_0x344f('0x1'));var moment=require(_0x344f('0x2'));var BPromise=require(_0x344f('0x3'));var rp=require(_0x344f('0x4'));var fs=require('fs');var path=require(_0x344f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x344f('0x6'));module[_0x344f('0x7')]=function(_0x42c750,_0x33f60e){return _0x42c750[_0x344f('0x8')]('SmsInteraction',attributes,{'tableName':_0x344f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xfd7060,_0x588d3b,_0x1bdf40){if(_0xfd7060[_0x344f('0xa')](_0x344f('0xb'))){_0xfd7060[_0x344f('0xc')]=moment()[_0x344f('0xd')](_0x344f('0xe'));}_0x1bdf40(null,_0xfd7060);}}});}; \ No newline at end of file +var _0x993b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','closed','format','lodash'];(function(_0x1e50fc,_0x3d2684){var _0x497f51=function(_0x2f744b){while(--_0x2f744b){_0x1e50fc['push'](_0x1e50fc['shift']());}};_0x497f51(++_0x3d2684);}(_0x993b,0xdf));var _0xb993=function(_0x5dfbe5,_0x5e0b5e){_0x5dfbe5=_0x5dfbe5-0x0;var _0x2e49b8=_0x993b[_0x5dfbe5];return _0x2e49b8;};'use strict';var _=require(_0xb993('0x0'));var util=require(_0xb993('0x1'));var logger=require(_0xb993('0x2'))(_0xb993('0x3'));var moment=require(_0xb993('0x4'));var BPromise=require(_0xb993('0x5'));var rp=require(_0xb993('0x6'));var fs=require('fs');var path=require(_0xb993('0x7'));var rimraf=require(_0xb993('0x8'));var config=require(_0xb993('0x9'));var attributes=require(_0xb993('0xa'));module['exports']=function(_0xf9f413,_0x522649){return _0xf9f413[_0xb993('0xb')](_0xb993('0xc'),attributes,{'tableName':_0xb993('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x177dac,_0x530234,_0x26020c){if(_0x177dac['changed'](_0xb993('0xe'))){_0x177dac['closedAt']=moment()[_0xb993('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x26020c(null,_0x177dac);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index bf50a11..ab469a6 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 _0x484a=['then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','update','body','options','raw','where','attributes','limit','UpdateSmsInteraction','debug','stringify','AddTagsToSmsInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','./smsInteraction.socket','register','request'];(function(_0x247038,_0x4abaa5){var _0x2ed51b=function(_0x242c48){while(--_0x242c48){_0x247038['push'](_0x247038['shift']());}};_0x2ed51b(++_0x4abaa5);}(_0x484a,0x18a));var _0xa484=function(_0x3bfb47,_0x4ea756){_0x3bfb47=_0x3bfb47-0x0;var _0x49eeeb=_0x484a[_0x3bfb47];return _0x49eeeb;};'use strict';var _=require(_0xa484('0x0'));var util=require(_0xa484('0x1'));var moment=require(_0xa484('0x2'));var BPromise=require(_0xa484('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa484('0x4'));var db=require(_0xa484('0x5'))['db'];var utils=require(_0xa484('0x6'));var logger=require(_0xa484('0x7'))('rpc');var config=require(_0xa484('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa484('0x9')][_0xa484('0xa')]({'port':0x232a});config[_0xa484('0xb')]=_['defaults'](config[_0xa484('0xb')],{'host':_0xa484('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa484('0xd'))[_0xa484('0xe')](socket);function respondWithRpcPromise(_0x3c219b,_0xc90dac,_0x538dd5){return new BPromise(function(_0x2d390a,_0x193e58){return client[_0xa484('0xf')](_0x3c219b,_0x538dd5)[_0xa484('0x10')](function(_0x508139){logger[_0xa484('0x11')](_0xa484('0x12'),_0xc90dac,_0xa484('0x13'));logger['debug'](_0xa484('0x14'),_0xc90dac,_0xa484('0x13'),JSON['stringify'](_0x508139));if(_0x508139[_0xa484('0x15')]){if(_0x508139['error']['code']===0x1f4){logger[_0xa484('0x15')](_0xa484('0x12'),_0xc90dac,_0x508139['error'][_0xa484('0x16')]);return _0x193e58(_0x508139['error'][_0xa484('0x16')]);}logger[_0xa484('0x15')](_0xa484('0x12'),_0xc90dac,_0x508139[_0xa484('0x15')][_0xa484('0x16')]);return _0x2d390a(_0x508139['error'][_0xa484('0x16')]);}else{logger[_0xa484('0x11')]('SmsInteraction,\x20%s,\x20%s',_0xc90dac,_0xa484('0x13'));_0x2d390a(_0x508139[_0xa484('0x17')][_0xa484('0x16')]);}})[_0xa484('0x18')](function(_0x3de91e){logger[_0xa484('0x15')]('SmsInteraction,\x20%s,\x20%s',_0xc90dac,_0x3de91e);_0x193e58(_0x3de91e);});});}exports['UpdateSmsInteraction']=function(_0x49cb4f){var _0x1b2c81=this;return new Promise(function(_0x187088,_0x280502){return db['SmsInteraction'][_0xa484('0x19')](_0x49cb4f[_0xa484('0x1a')],{'raw':_0x49cb4f[_0xa484('0x1b')]?_0x49cb4f[_0xa484('0x1b')][_0xa484('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49cb4f[_0xa484('0x1b')]?_0x49cb4f[_0xa484('0x1b')][_0xa484('0x1d')]||null:null,'attributes':_0x49cb4f[_0xa484('0x1b')]?_0x49cb4f[_0xa484('0x1b')][_0xa484('0x1e')]||null:null,'limit':_0x49cb4f[_0xa484('0x1b')]?_0x49cb4f['options'][_0xa484('0x1f')]||null:null})[_0xa484('0x10')](function(_0x2b77fe){logger[_0xa484('0x11')](_0xa484('0x20'),_0x49cb4f);logger[_0xa484('0x21')](_0xa484('0x20'),_0x49cb4f,JSON[_0xa484('0x22')](_0x2b77fe));_0x187088(_0x2b77fe);})[_0xa484('0x18')](function(_0x128209){logger[_0xa484('0x15')](_0xa484('0x20'),_0x128209[_0xa484('0x16')],_0x49cb4f);_0x280502(_0x1b2c81[_0xa484('0x15')](0x1f4,_0x128209[_0xa484('0x16')]));});});};exports[_0xa484('0x23')]=function(_0x247d90){return new Promise(function(_0x765454,_0xa670d8){return db['SmsInteraction'][_0xa484('0x24')]({'where':_0x247d90['options']?_0x247d90[_0xa484('0x1b')]['where']||null:null})[_0xa484('0x10')](function(_0x54db46){if(_0x54db46){return _0x54db46[_0xa484('0x25')](_0x247d90[_0xa484('0x1a')][_0xa484('0x26')],_[_0xa484('0x27')](_0x247d90[_0xa484('0x1a')],[_0xa484('0x26'),'id'])||{});}})['spread'](function(_0x4f8380){logger[_0xa484('0x11')](_0xa484('0x28'),_0x247d90);logger[_0xa484('0x21')](_0xa484('0x28'),_0x247d90,JSON[_0xa484('0x22')](_0x4f8380));_0x765454(_0x4f8380);})['catch'](function(_0x13cf2e){logger[_0xa484('0x15')](_0xa484('0x28'),_0x13cf2e[_0xa484('0x16')],_0x247d90);_0xa670d8(_this[_0xa484('0x15')](0x1f4,_0x13cf2e['message']));});});}; \ No newline at end of file +var _0xf288=['AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','socket.io-emitter','./smsInteraction.socket','then','info','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','limit','AddTagsToSmsInteraction','find','ids','debug'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0xf288,0x169));var _0x8f28=function(_0xec034,_0x16c358){_0xec034=_0xec034-0x0;var _0x2c5a19=_0xf288[_0xec034];return _0x2c5a19;};'use strict';var _=require(_0x8f28('0x0'));var util=require(_0x8f28('0x1'));var moment=require('moment');var BPromise=require(_0x8f28('0x2'));var rs=require(_0x8f28('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f28('0x4'))['db'];var utils=require(_0x8f28('0x5'));var logger=require('../../config/logger')(_0x8f28('0x6'));var config=require(_0x8f28('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8f28('0x8')][_0x8f28('0x9')]({'port':0x232a});config[_0x8f28('0xa')]=_['defaults'](config[_0x8f28('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8f28('0xb'))(new Redis(config['redis']));require(_0x8f28('0xc'))['register'](socket);function respondWithRpcPromise(_0x290643,_0x46ec06,_0x2dff20){return new BPromise(function(_0x53828b,_0x5e90e4){return client['request'](_0x290643,_0x2dff20)[_0x8f28('0xd')](function(_0x2a5bf5){logger[_0x8f28('0xe')]('SmsInteraction,\x20%s,\x20%s',_0x46ec06,'request\x20sent');logger['debug'](_0x8f28('0xf'),_0x46ec06,_0x8f28('0x10'),JSON[_0x8f28('0x11')](_0x2a5bf5));if(_0x2a5bf5[_0x8f28('0x12')]){if(_0x2a5bf5[_0x8f28('0x12')][_0x8f28('0x13')]===0x1f4){logger[_0x8f28('0x12')](_0x8f28('0x14'),_0x46ec06,_0x2a5bf5['error'][_0x8f28('0x15')]);return _0x5e90e4(_0x2a5bf5['error'][_0x8f28('0x15')]);}logger[_0x8f28('0x12')](_0x8f28('0x14'),_0x46ec06,_0x2a5bf5[_0x8f28('0x12')][_0x8f28('0x15')]);return _0x53828b(_0x2a5bf5[_0x8f28('0x12')][_0x8f28('0x15')]);}else{logger[_0x8f28('0xe')](_0x8f28('0x14'),_0x46ec06,_0x8f28('0x10'));_0x53828b(_0x2a5bf5[_0x8f28('0x16')]['message']);}})[_0x8f28('0x17')](function(_0x43476a){logger[_0x8f28('0x12')](_0x8f28('0x14'),_0x46ec06,_0x43476a);_0x5e90e4(_0x43476a);});});}exports[_0x8f28('0x18')]=function(_0xdc72d6){var _0x3bbe8e=this;return new Promise(function(_0xb23f4e,_0x23819f){return db[_0x8f28('0x19')]['update'](_0xdc72d6[_0x8f28('0x1a')],{'raw':_0xdc72d6[_0x8f28('0x1b')]?_0xdc72d6[_0x8f28('0x1b')][_0x8f28('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdc72d6[_0x8f28('0x1b')]?_0xdc72d6['options'][_0x8f28('0x1d')]||null:null,'attributes':_0xdc72d6[_0x8f28('0x1b')]?_0xdc72d6[_0x8f28('0x1b')]['attributes']||null:null,'limit':_0xdc72d6['options']?_0xdc72d6[_0x8f28('0x1b')][_0x8f28('0x1e')]||null:null})[_0x8f28('0xd')](function(_0x18c027){logger['info'](_0x8f28('0x18'),_0xdc72d6);logger['debug'](_0x8f28('0x18'),_0xdc72d6,JSON['stringify'](_0x18c027));_0xb23f4e(_0x18c027);})[_0x8f28('0x17')](function(_0x5cfe05){logger[_0x8f28('0x12')]('UpdateSmsInteraction',_0x5cfe05[_0x8f28('0x15')],_0xdc72d6);_0x23819f(_0x3bbe8e[_0x8f28('0x12')](0x1f4,_0x5cfe05['message']));});});};exports[_0x8f28('0x1f')]=function(_0x501b1f){return new Promise(function(_0x5cb022,_0x52869f){return db[_0x8f28('0x19')][_0x8f28('0x20')]({'where':_0x501b1f[_0x8f28('0x1b')]?_0x501b1f[_0x8f28('0x1b')][_0x8f28('0x1d')]||null:null})[_0x8f28('0xd')](function(_0x3cb9b5){if(_0x3cb9b5){return _0x3cb9b5['addTags'](_0x501b1f[_0x8f28('0x1a')][_0x8f28('0x21')],_['omit'](_0x501b1f[_0x8f28('0x1a')],[_0x8f28('0x21'),'id'])||{});}})['spread'](function(_0x4a3c4f){logger[_0x8f28('0xe')]('AddTags',_0x501b1f);logger[_0x8f28('0x22')]('AddTags',_0x501b1f,JSON['stringify'](_0x4a3c4f));_0x5cb022(_0x4a3c4f);})[_0x8f28('0x17')](function(_0x553a4a){logger[_0x8f28('0x12')](_0x8f28('0x23'),_0x553a4a[_0x8f28('0x15')],_0x501b1f);_0x52869f(_this[_0x8f28('0x12')](0x1f4,_0x553a4a[_0x8f28('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index fcee5c5..f312d5a 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 _0x67fd=['update','emit','removeListener','register','length','./smsInteraction.events','remove'];(function(_0x78fb00,_0x9f9a67){var _0x25b737=function(_0x5d4ee1){while(--_0x5d4ee1){_0x78fb00['push'](_0x78fb00['shift']());}};_0x25b737(++_0x9f9a67);}(_0x67fd,0x67));var _0xd67f=function(_0x49ec1f,_0x4abf59){_0x49ec1f=_0x49ec1f-0x0;var _0x5640d9=_0x67fd[_0x49ec1f];return _0x5640d9;};'use strict';var SmsInteractionEvents=require(_0xd67f('0x0'));var events=['save',_0xd67f('0x1'),_0xd67f('0x2')];function createListener(_0x39482e,_0x343246){return function(_0x5c2093){_0x343246[_0xd67f('0x3')](_0x39482e,_0x5c2093);};}function removeListener(_0x1dd91b,_0x5f0c61){return function(){SmsInteractionEvents[_0xd67f('0x4')](_0x1dd91b,_0x5f0c61);};}exports[_0xd67f('0x5')]=function(_0x525ae3){for(var _0x27194b=0x0,_0x5c084d=events[_0xd67f('0x6')];_0x27194b<_0x5c084d;_0x27194b++){var _0x3847f4=events[_0x27194b];var _0x4d5582=createListener('smsInteraction:'+_0x3847f4,_0x525ae3);SmsInteractionEvents['on'](_0x3847f4,_0x4d5582);}}; \ No newline at end of file +var _0x7e9e=['length','smsInteraction:','./smsInteraction.events','remove','update','emit','removeListener','register'];(function(_0x2d4661,_0x2da65c){var _0x42ed1e=function(_0x263c50){while(--_0x263c50){_0x2d4661['push'](_0x2d4661['shift']());}};_0x42ed1e(++_0x2da65c);}(_0x7e9e,0x1b2));var _0xe7e9=function(_0x208505,_0x241a77){_0x208505=_0x208505-0x0;var _0x1a985f=_0x7e9e[_0x208505];return _0x1a985f;};'use strict';var SmsInteractionEvents=require(_0xe7e9('0x0'));var events=['save',_0xe7e9('0x1'),_0xe7e9('0x2')];function createListener(_0x5c947e,_0x1c41a6){return function(_0x52416d){_0x1c41a6[_0xe7e9('0x3')](_0x5c947e,_0x52416d);};}function removeListener(_0x1c1cfc,_0xf6d13f){return function(){SmsInteractionEvents[_0xe7e9('0x4')](_0x1c1cfc,_0xf6d13f);};}exports[_0xe7e9('0x5')]=function(_0x103083){for(var _0x5c202d=0x0,_0x5555db=events[_0xe7e9('0x6')];_0x5c202d<_0x5555db;_0x5c202d++){var _0x5dfe53=events[_0x5c202d];var _0x42647e=createListener(_0xe7e9('0x7')+_0x5dfe53,_0x103083);SmsInteractionEvents['on'](_0x5dfe53,_0x42647e);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 8811713..0718f38 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 _0x2138=['/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','sms','smsmessage:create','/:id/status','status','put','update','/:id/accept','accept'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x2138,0x18b));var _0x8213=function(_0x17d5d8,_0x2a542d){_0x17d5d8=_0x17d5d8-0x0;var _0x4d193c=_0x2138[_0x17d5d8];return _0x4d193c;};'use strict';var multer=require('multer');var util=require(_0x8213('0x0'));var path=require(_0x8213('0x1'));var timeout=require(_0x8213('0x2'));var express=require(_0x8213('0x3'));var router=express[_0x8213('0x4')]();var fs_extra=require(_0x8213('0x5'));var auth=require(_0x8213('0x6'));var interaction=require(_0x8213('0x7'));var config=require(_0x8213('0x8'));var controller=require(_0x8213('0x9'));router[_0x8213('0xa')]('/',auth[_0x8213('0xb')](),controller[_0x8213('0xc')]);router[_0x8213('0xa')]('/describe',auth[_0x8213('0xb')](),controller[_0x8213('0xd')]);router['get'](_0x8213('0xe'),auth['isAuthenticated'](),controller[_0x8213('0xf')]);router[_0x8213('0x10')]('/',auth[_0x8213('0xb')](),interaction['tracked'](_0x8213('0x11'),_0x8213('0x12')),controller['create']);router[_0x8213('0x10')](_0x8213('0x13'),controller[_0x8213('0x14')]);router[_0x8213('0x15')](_0x8213('0xe'),auth[_0x8213('0xb')](),controller[_0x8213('0x16')]);router[_0x8213('0x15')](_0x8213('0x17'),auth['isAuthenticated'](),controller[_0x8213('0x18')]);router[_0x8213('0x15')](_0x8213('0x19'),auth[_0x8213('0xb')](),controller[_0x8213('0x1a')]);router[_0x8213('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x8213('0x1c')]);module[_0x8213('0x1d')]=router; \ No newline at end of file +var _0x9338=['/:id/reject','reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','tracked','sms','smsmessage:create','create','post','/:id/status','status','put','update','/:id/accept','accept'];(function(_0x3d4609,_0x5ab398){var _0x264a66=function(_0x5708e1){while(--_0x5708e1){_0x3d4609['push'](_0x3d4609['shift']());}};_0x264a66(++_0x5ab398);}(_0x9338,0x1b6));var _0x8933=function(_0x822a3f,_0x32fd83){_0x822a3f=_0x822a3f-0x0;var _0x1053e7=_0x9338[_0x822a3f];return _0x1053e7;};'use strict';var multer=require('multer');var util=require(_0x8933('0x0'));var path=require(_0x8933('0x1'));var timeout=require(_0x8933('0x2'));var express=require(_0x8933('0x3'));var router=express[_0x8933('0x4')]();var fs_extra=require(_0x8933('0x5'));var auth=require(_0x8933('0x6'));var interaction=require(_0x8933('0x7'));var config=require(_0x8933('0x8'));var controller=require(_0x8933('0x9'));router[_0x8933('0xa')]('/',auth[_0x8933('0xb')](),controller['index']);router[_0x8933('0xa')](_0x8933('0xc'),auth['isAuthenticated'](),controller[_0x8933('0xd')]);router['get'](_0x8933('0xe'),auth['isAuthenticated'](),controller[_0x8933('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x8933('0x10')](_0x8933('0x11'),_0x8933('0x12')),controller[_0x8933('0x13')]);router[_0x8933('0x14')](_0x8933('0x15'),controller[_0x8933('0x16')]);router[_0x8933('0x17')]('/:id',auth[_0x8933('0xb')](),controller[_0x8933('0x18')]);router['put'](_0x8933('0x19'),auth['isAuthenticated'](),controller[_0x8933('0x1a')]);router[_0x8933('0x17')](_0x8933('0x1b'),auth[_0x8933('0xb')](),controller[_0x8933('0x1c')]);router[_0x8933('0x1d')](_0x8933('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x8933('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 48bcfb1..9b9f958 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 _0x3783=['STRING','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x5673e0,_0x2c8b06){var _0x33925a=function(_0x3b6ac5){while(--_0x3b6ac5){_0x5673e0['push'](_0x5673e0['shift']());}};_0x33925a(++_0x2c8b06);}(_0x3783,0x1dd));var _0x3378=function(_0x32a672,_0x23a765){_0x32a672=_0x32a672-0x0;var _0x231dca=_0x3783[_0x32a672];return _0x231dca;};'use strict';var Sequelize=require('sequelize');module[_0x3378('0x0')]={'body':{'type':Sequelize[_0x3378('0x1')](_0x3378('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3378('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3378('0x4')]('in',_0x3378('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x3378('0x6')](0xbe)},'phone':{'type':Sequelize[_0x3378('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x3378('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3378('0x6')]},'providerResponse':{'type':Sequelize[_0x3378('0x1')]}}; \ No newline at end of file +var _0xc30e=['sequelize','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x522762,_0x3028a7){var _0x5a36f0=function(_0xfbe96b){while(--_0xfbe96b){_0x522762['push'](_0x522762['shift']());}};_0x5a36f0(++_0x3028a7);}(_0xc30e,0x1d8));var _0xec30=function(_0x49d1b6,_0x186ec6){_0x49d1b6=_0x49d1b6-0x0;var _0x1d95ec=_0xc30e[_0x49d1b6];return _0x1d95ec;};'use strict';var Sequelize=require(_0xec30('0x0'));module['exports']={'body':{'type':Sequelize[_0xec30('0x1')](_0xec30('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xec30('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xec30('0x4')]('in',_0xec30('0x5')),'defaultValue':_0xec30('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xec30('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xec30('0x7')]},'secret':{'type':Sequelize[_0xec30('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xec30('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index f894358..b080802 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 _0xd5eb=['filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','accept','read','readAt','format','UserId','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','channel','event','EventManager','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','interface','motionChannel','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','delivered','infobip','results','groupName','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','fieldName','key','query','keys'];(function(_0x13af75,_0x58ca0d){var _0x19bec2=function(_0xa72ab3){while(--_0xa72ab3){_0x13af75['push'](_0x13af75['shift']());}};_0x19bec2(++_0x58ca0d);}(_0xd5eb,0x183));var _0xbd5e=function(_0x4a1e28,_0x8eb471){_0x4a1e28=_0x4a1e28-0x0;var _0x386a9f=_0xd5eb[_0x4a1e28];return _0x386a9f;};'use strict';var emlformat=require(_0xbd5e('0x0'));var rimraf=require(_0xbd5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbd5e('0x2'));var rp=require(_0xbd5e('0x3'));var moment=require(_0xbd5e('0x4'));var BPromise=require(_0xbd5e('0x5'));var Mustache=require(_0xbd5e('0x6'));var util=require(_0xbd5e('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbd5e('0x8'));var fs=require('fs');var fs_extra=require(_0xbd5e('0x9'));var _=require('lodash');var squel=require(_0xbd5e('0xa'));var crypto=require(_0xbd5e('0xb'));var jsforce=require(_0xbd5e('0xc'));var deskjs=require(_0xbd5e('0xd'));var toCsv=require(_0xbd5e('0xe'));var querystring=require(_0xbd5e('0xf'));var Papa=require(_0xbd5e('0x10'));var Redis=require('ioredis');var authService=require(_0xbd5e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbd5e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd5e('0x13'))(_0xbd5e('0x14'));var utils=require(_0xbd5e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbd5e('0x16'));var db=require(_0xbd5e('0x17'))['db'];config[_0xbd5e('0x18')]=_[_0xbd5e('0x19')](config[_0xbd5e('0x18')],{'host':_0xbd5e('0x1a'),'port':0x18eb});var socket=require(_0xbd5e('0x1b'))(new Redis(config[_0xbd5e('0x18')]));require(_0xbd5e('0x1c'))[_0xbd5e('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbd5e('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0xbd5e('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4eec01,_0x57f8c9,_0x42a848,_0xb8f56b){return new BPromise(function(_0x1c1f45,_0xcfd624){var _0x55ab78=_0xb8f56b||client;return _0x55ab78[_0xbd5e('0x20')](_0x4eec01,_0x42a848)[_0xbd5e('0x21')](function(_0x571103){logger[_0xbd5e('0x22')](_0xbd5e('0x23'),_0x57f8c9,_0xbd5e('0x24'));logger[_0xbd5e('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x57f8c9,_0xbd5e('0x24'),JSON[_0xbd5e('0x26')](_0x571103));if(_0x571103['error']){if(_0x571103[_0xbd5e('0x27')][_0xbd5e('0x28')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x57f8c9,_0x571103['error'][_0xbd5e('0x29')]);return _0xcfd624(_0x571103[_0xbd5e('0x27')][_0xbd5e('0x29')]);}logger[_0xbd5e('0x27')](_0xbd5e('0x23'),_0x57f8c9,_0x571103[_0xbd5e('0x27')][_0xbd5e('0x29')]);return _0x1c1f45(_0x571103[_0xbd5e('0x27')][_0xbd5e('0x29')]);}else{logger[_0xbd5e('0x22')](_0xbd5e('0x23'),_0x57f8c9,_0xbd5e('0x24'));_0x1c1f45(_0x571103['result'][_0xbd5e('0x29')]);}})['catch'](function(_0x5f387d){logger['error'](_0xbd5e('0x23'),_0x57f8c9,_0x5f387d);_0xcfd624(_0x5f387d);});});}function respondWithStatusCode(_0x568271,_0x2798a9){_0x2798a9=_0x2798a9||0xcc;return function(_0x84baf3){if(_0x84baf3){return _0x568271[_0xbd5e('0x2a')](_0x2798a9);}return _0x568271['status'](_0x2798a9)[_0xbd5e('0x2b')]();};}function respondWithResult(_0x34bef4,_0x57fd7b){_0x57fd7b=_0x57fd7b||0xc8;return function(_0x149ba3){if(_0x149ba3){return _0x34bef4[_0xbd5e('0x2c')](_0x57fd7b)[_0xbd5e('0x2d')](_0x149ba3);}};}function respondWithFilteredResult(_0x1ced21,_0x3dcc17){return function(_0x3789ec){if(_0x3789ec){var _0x115deb=typeof _0x3dcc17[_0xbd5e('0x2e')]===_0xbd5e('0x2f')&&typeof _0x3dcc17[_0xbd5e('0x30')]===_0xbd5e('0x2f');var _0x12e032=_0x3789ec[_0xbd5e('0x31')];var _0x3ae907=_0x115deb?0x0:_0x3dcc17[_0xbd5e('0x2e')];var _0xe8da0b=_0x115deb?_0x3789ec[_0xbd5e('0x31')]:_0x3dcc17[_0xbd5e('0x2e')]+_0x3dcc17['limit'];var _0x1fac55;if(_0xe8da0b>=_0x12e032){_0xe8da0b=_0x12e032;_0x1fac55=0xc8;}else{_0x1fac55=0xce;}_0x1ced21['status'](_0x1fac55);return _0x1ced21[_0xbd5e('0x32')](_0xbd5e('0x33'),_0x3ae907+'-'+_0xe8da0b+'/'+_0x12e032)[_0xbd5e('0x2d')](_0x3789ec);}return null;};}function patchUpdates(_0x2c5298){return function(_0x3d4d5d){try{jsonpatch['apply'](_0x3d4d5d,_0x2c5298,!![]);}catch(_0x4ed1c1){return BPromise[_0xbd5e('0x34')](_0x4ed1c1);}return _0x3d4d5d[_0xbd5e('0x35')]();};}function saveUpdates(_0xdc029a,_0x99bcbd){return function(_0x1574aa){if(_0x1574aa){return _0x1574aa[_0xbd5e('0x36')](_0xdc029a)[_0xbd5e('0x21')](function(_0x578e56){return _0x578e56;});}return null;};}function removeEntity(_0x5b0465,_0x140340){return function(_0x27f5cc){if(_0x27f5cc){return _0x27f5cc[_0xbd5e('0x37')]()['then'](function(){_0x5b0465['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25ca89,_0x3bd6f9){return function(_0x404dad){if(!_0x404dad){_0x25ca89[_0xbd5e('0x2a')](0x194);}return _0x404dad;};}function handleError(_0x5568ef,_0x1dbe6e){_0x1dbe6e=_0x1dbe6e||0x1f4;return function(_0x3bb600){logger['error'](_0x3bb600[_0xbd5e('0x38')]);if(_0x3bb600[_0xbd5e('0x39')]){delete _0x3bb600[_0xbd5e('0x39')];}_0x5568ef[_0xbd5e('0x2c')](_0x1dbe6e)[_0xbd5e('0x3a')](_0x3bb600);};}exports[_0xbd5e('0x3b')]=function(_0x5e8d99,_0x588593){var _0x177a52={},_0x978a39={},_0x253129={'count':0x0,'rows':[]};var _0x2bec9e=_[_0xbd5e('0x3c')](db[_0xbd5e('0x3d')]['rawAttributes'],function(_0x413949){return{'name':_0x413949[_0xbd5e('0x3e')],'type':_0x413949['type'][_0xbd5e('0x3f')]};});_0x978a39['model']=_[_0xbd5e('0x3c')](_0x2bec9e,_0xbd5e('0x39'));_0x978a39[_0xbd5e('0x40')]=_[_0xbd5e('0x41')](_0x5e8d99[_0xbd5e('0x40')]);_0x978a39[_0xbd5e('0x42')]=_[_0xbd5e('0x43')](_0x978a39[_0xbd5e('0x44')],_0x978a39[_0xbd5e('0x40')]);_0x177a52['attributes']=_[_0xbd5e('0x43')](_0x978a39['model'],qs[_0xbd5e('0x45')](_0x5e8d99[_0xbd5e('0x40')]['fields']));_0x177a52['attributes']=_0x177a52['attributes'][_0xbd5e('0x46')]?_0x177a52[_0xbd5e('0x47')]:_0x978a39[_0xbd5e('0x44')];if(!_0x5e8d99[_0xbd5e('0x40')][_0xbd5e('0x48')](_0xbd5e('0x49'))){_0x177a52[_0xbd5e('0x30')]=qs[_0xbd5e('0x30')](_0x5e8d99[_0xbd5e('0x40')][_0xbd5e('0x30')]);_0x177a52['offset']=qs[_0xbd5e('0x2e')](_0x5e8d99[_0xbd5e('0x40')]['offset']);}_0x177a52[_0xbd5e('0x4a')]=qs[_0xbd5e('0x4b')](_0x5e8d99[_0xbd5e('0x40')]['sort']);_0x177a52[_0xbd5e('0x4c')]=qs[_0xbd5e('0x42')](_[_0xbd5e('0x4d')](_0x5e8d99[_0xbd5e('0x40')],_0x978a39[_0xbd5e('0x42')]),_0x2bec9e);if(_0x5e8d99[_0xbd5e('0x40')][_0xbd5e('0x4e')]){_0x177a52['where']=_['merge'](_0x177a52[_0xbd5e('0x4c')],{'$or':_[_0xbd5e('0x3c')](_0x2bec9e,function(_0x43e2a9){if(_0x43e2a9[_0xbd5e('0x4f')]!==_0xbd5e('0x50')){var _0xb2e24a={};_0xb2e24a[_0x43e2a9[_0xbd5e('0x39')]]={'$like':'%'+_0x5e8d99[_0xbd5e('0x40')]['filter']+'%'};return _0xb2e24a;}})});}_0x177a52=_[_0xbd5e('0x51')]({},_0x177a52,_0x5e8d99[_0xbd5e('0x52')]);var _0x39cc23={'where':_0x177a52['where']};return db[_0xbd5e('0x3d')][_0xbd5e('0x31')](_0x39cc23)['then'](function(_0x5ef449){_0x253129[_0xbd5e('0x31')]=_0x5ef449;if(_0x5e8d99[_0xbd5e('0x40')]['includeAll']){_0x177a52[_0xbd5e('0x53')]=[{'all':!![]}];}return db[_0xbd5e('0x3d')][_0xbd5e('0x54')](_0x177a52);})[_0xbd5e('0x21')](function(_0xa95f0){_0x253129[_0xbd5e('0x55')]=_0xa95f0;return _0x253129;})[_0xbd5e('0x21')](respondWithFilteredResult(_0x588593,_0x177a52))[_0xbd5e('0x56')](handleError(_0x588593,null));};exports[_0xbd5e('0x57')]=function(_0xcfde3d,_0x299c0b){var _0x54e417={'raw':!![],'where':{'id':_0xcfde3d[_0xbd5e('0x58')]['id']}},_0x256537={};_0x256537['model']=_[_0xbd5e('0x41')](db[_0xbd5e('0x3d')][_0xbd5e('0x59')]);_0x256537[_0xbd5e('0x40')]=_['keys'](_0xcfde3d[_0xbd5e('0x40')]);_0x256537[_0xbd5e('0x42')]=_[_0xbd5e('0x43')](_0x256537[_0xbd5e('0x44')],_0x256537[_0xbd5e('0x40')]);_0x54e417[_0xbd5e('0x47')]=_[_0xbd5e('0x43')](_0x256537[_0xbd5e('0x44')],qs['fields'](_0xcfde3d['query'][_0xbd5e('0x45')]));_0x54e417[_0xbd5e('0x47')]=_0x54e417[_0xbd5e('0x47')][_0xbd5e('0x46')]?_0x54e417[_0xbd5e('0x47')]:_0x256537['model'];if(_0xcfde3d[_0xbd5e('0x40')][_0xbd5e('0x5a')]){_0x54e417[_0xbd5e('0x53')]=[{'all':!![]}];}_0x54e417=_[_0xbd5e('0x51')]({},_0x54e417,_0xcfde3d['options']);return db[_0xbd5e('0x3d')][_0xbd5e('0x5b')](_0x54e417)[_0xbd5e('0x21')](handleEntityNotFound(_0x299c0b,null))[_0xbd5e('0x21')](respondWithResult(_0x299c0b,null))[_0xbd5e('0x56')](handleError(_0x299c0b,null));};exports[_0xbd5e('0x5c')]=function(_0x1fa02c,_0x48a125){return db[_0xbd5e('0x3d')][_0xbd5e('0x5c')](_0x1fa02c[_0xbd5e('0x5d')],{})['then'](respondWithResult(_0x48a125,0xc9))['catch'](handleError(_0x48a125,null));};exports[_0xbd5e('0x36')]=function(_0x1350ce,_0x58ad6a){if(_0x1350ce['body']['id']){delete _0x1350ce['body']['id'];}return db[_0xbd5e('0x3d')]['find']({'where':{'id':_0x1350ce['params']['id']}})[_0xbd5e('0x21')](handleEntityNotFound(_0x58ad6a,null))[_0xbd5e('0x21')](saveUpdates(_0x1350ce[_0xbd5e('0x5d')],null))[_0xbd5e('0x21')](respondWithResult(_0x58ad6a,null))[_0xbd5e('0x56')](handleError(_0x58ad6a,null));};exports['destroy']=function(_0x33a84c,_0x3d8bbc){return db[_0xbd5e('0x3d')][_0xbd5e('0x5b')]({'where':{'id':_0x33a84c['params']['id']}})[_0xbd5e('0x21')](handleEntityNotFound(_0x3d8bbc,null))[_0xbd5e('0x21')](removeEntity(_0x3d8bbc,null))[_0xbd5e('0x56')](handleError(_0x3d8bbc,null));};exports[_0xbd5e('0x5e')]=function(_0x396202,_0x377371){return db['SmsMessage'][_0xbd5e('0x5e')]()[_0xbd5e('0x21')](respondWithResult(_0x377371,null))[_0xbd5e('0x56')](handleError(_0x377371,null));};var interaction_log=require(_0xbd5e('0x13'))('sms-interactions');exports[_0xbd5e('0x5f')]=function(_0x33105f,_0x266dc4,_0x2a100f){var _0xd4572d={'agent':{},'channel':'sms'};if(_0x33105f['body']['id']){delete _0x33105f[_0xbd5e('0x5d')]['id'];}_0x33105f[_0xbd5e('0x5d')][_0xbd5e('0x60')]=!![];_0x33105f[_0xbd5e('0x5d')][_0xbd5e('0x61')]=moment()[_0xbd5e('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x33105f[_0xbd5e('0x5d')][_0xbd5e('0x63')]=_0x33105f[_0xbd5e('0x5d')][_0xbd5e('0x63')]||_0x33105f['user']['id'];_0xd4572d['agent']['id']=_0x33105f[_0xbd5e('0x5d')][_0xbd5e('0x63')];return db[_0xbd5e('0x3d')][_0xbd5e('0x5b')]({'where':{'id':_0x33105f[_0xbd5e('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x266dc4,null))[_0xbd5e('0x21')](saveUpdates(_0x33105f[_0xbd5e('0x5d')],null))[_0xbd5e('0x21')](function(_0x209738){if(_0x209738){_0xd4572d[_0xbd5e('0x29')]=_0x209738['get']({'plain':!![]});return db[_0xbd5e('0x64')]['find']({'where':{'id':_0x209738[_0xbd5e('0x65')]}});}return null;})[_0xbd5e('0x21')](handleEntityNotFound(_0x266dc4,null))['then'](function(_0x5e20a8){if(_0x5e20a8){return _0x5e20a8['update']({'UserId':_0x33105f[_0xbd5e('0x5d')][_0xbd5e('0x63')],'read1stAt':_[_0xbd5e('0x66')](_0x5e20a8[_0xbd5e('0x67')])?moment()[_0xbd5e('0x62')](_0xbd5e('0x68')):undefined});}return null;})[_0xbd5e('0x21')](function(_0x4f0fd4){if(_0x4f0fd4){_0xd4572d[_0xbd5e('0x69')]=_0x4f0fd4[_0xbd5e('0x6a')]({'plain':!![]});interaction_log[_0xbd5e('0x22')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x33105f[_0xbd5e('0x6b')]['id'],_0x33105f[_0xbd5e('0x6b')]['name'],_0x33105f['user'][_0xbd5e('0x6c')],_0xd4572d[_0xbd5e('0x69')]['id'],_0x33105f[_0xbd5e('0x5d')]?JSON[_0xbd5e('0x26')](_0x33105f[_0xbd5e('0x5d')]):_0xbd5e('0x6d'));return respondWithRpcPromise(_0xbd5e('0x6e'),_0xbd5e('0x6f'),_0xd4572d);}return null;})['then'](function(_0x377087){var _0x4c04ce=_0xbd5e('0x70')+_0x377087[_0xbd5e('0x29')][_0xbd5e('0x71')];return db[_0xbd5e('0x72')][_0xbd5e('0x40')](_0x4c04ce,{'type':db[_0xbd5e('0x73')][_0xbd5e('0x74')][_0xbd5e('0x75')],'raw':!![]})[_0xbd5e('0x21')](function(_0x11108d){return _0x11108d;});})[_0xbd5e('0x21')](function(_0x5db1bb){if(_0x5db1bb){_0xd4572d[_0xbd5e('0x29')]['contact']=_0x5db1bb[0x0];if(!_0x33105f['body'][_0xbd5e('0x63')])return;return db[_0xbd5e('0x76')][_0xbd5e('0x5b')]({'where':{'id':_0x33105f[_0xbd5e('0x5d')][_0xbd5e('0x63')],'role':_0xbd5e('0x77')},'attributes':['id','name',_0xbd5e('0x78'),_0xbd5e('0x79'),_0xbd5e('0x7a')],'raw':!![]});}return null;})[_0xbd5e('0x21')](function(_0x4e6d81){if(!_0x4e6d81)return null;_0xd4572d[_0xbd5e('0x29')]['agent']=_0x4e6d81;return _0xd4572d;})[_0xbd5e('0x21')](function(_0x4d2e4c){if(_0x4d2e4c){if(_0x33105f['body'][_0xbd5e('0x7b')]){_0xd4572d[_0xbd5e('0x29')]['interface']=util[_0xbd5e('0x62')]('SIP/%s',_0x33105f['user'][_0xbd5e('0x39')]);_0xd4572d[_0xbd5e('0x29')][_0xbd5e('0x7c')]=_0xd4572d[_0xbd5e('0x7c')];_0xd4572d[_0xbd5e('0x29')]['motionChannel']=_0xd4572d[_0xbd5e('0x7c')];_0xd4572d['message'][_0xbd5e('0x7d')]='accept';return respondWithRpcPromise(_0xbd5e('0x7e'),_0xbd5e('0x7e'),{'event':'acceptmessage','message':_0xd4572d['message']},client9002)[_0xbd5e('0x21')](function(){return _0xd4572d;});}return _0xd4572d;}return null;})[_0xbd5e('0x21')](respondWithResult(_0x266dc4,null))['catch'](handleError(_0x266dc4,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports['reject']=function(_0x3b75b9,_0x74864f,_0x16d832){var _0x4fbdd2={'agent':{},'channel':_0xbd5e('0x7f')};if(_0x3b75b9['body']['id']){delete _0x3b75b9[_0xbd5e('0x5d')]['id'];}_0x3b75b9['body'][_0xbd5e('0x63')]=_0x3b75b9[_0xbd5e('0x5d')]['UserId']||_0x3b75b9['user']['id'];_0x4fbdd2['agent']['id']=_0x3b75b9[_0xbd5e('0x5d')][_0xbd5e('0x63')];return db[_0xbd5e('0x3d')][_0xbd5e('0x5b')]({'where':{'id':_0x3b75b9[_0xbd5e('0x58')]['id'],'UserId':null}})[_0xbd5e('0x21')](handleEntityNotFound(_0x74864f,null))['then'](function(_0x502d11){if(_0x502d11){_0x4fbdd2['message']=_0x502d11[_0xbd5e('0x6a')]({'plain':!![]});return db[_0xbd5e('0x64')]['find']({'where':{'id':_0x502d11[_0xbd5e('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x74864f,null))[_0xbd5e('0x21')](function(_0x394833){if(_0x394833){_0x4fbdd2[_0xbd5e('0x69')]=_0x394833[_0xbd5e('0x6a')]({'plain':!![]});interaction_log[_0xbd5e('0x22')](_0xbd5e('0x80'),_0x3b75b9[_0xbd5e('0x6b')]['id'],_0x3b75b9[_0xbd5e('0x6b')][_0xbd5e('0x39')],_0x3b75b9[_0xbd5e('0x6b')][_0xbd5e('0x6c')],_0x4fbdd2['interaction']['id'],_0x3b75b9[_0xbd5e('0x5d')]?JSON[_0xbd5e('0x26')](_0x3b75b9[_0xbd5e('0x5d')]):_0xbd5e('0x6d'));return respondWithRpcPromise(_0xbd5e('0x81'),_0xbd5e('0x82'),_0x4fbdd2);}return null;})[_0xbd5e('0x21')](function(_0x19f9a7){var _0x4561c7=_0xbd5e('0x70')+_0x19f9a7[_0xbd5e('0x29')][_0xbd5e('0x71')];return db[_0xbd5e('0x72')][_0xbd5e('0x40')](_0x4561c7,{'type':db[_0xbd5e('0x73')][_0xbd5e('0x74')]['SELECT'],'raw':!![]})[_0xbd5e('0x21')](function(_0x3f9d0f){return _0x3f9d0f;});})[_0xbd5e('0x21')](function(_0x271c82){if(_0x271c82){_0x4fbdd2[_0xbd5e('0x29')][_0xbd5e('0x83')]=_0x271c82[0x0];if(!_0x3b75b9[_0xbd5e('0x5d')][_0xbd5e('0x63')])return;return db[_0xbd5e('0x76')][_0xbd5e('0x5b')]({'where':{'id':_0x3b75b9[_0xbd5e('0x5d')][_0xbd5e('0x63')],'role':_0xbd5e('0x77')},'attributes':['id',_0xbd5e('0x39'),_0xbd5e('0x78'),_0xbd5e('0x79'),'internal'],'raw':!![]});}return null;})[_0xbd5e('0x21')](function(_0x70dbb2){if(!_0x70dbb2)return null;_0x4fbdd2[_0xbd5e('0x29')][_0xbd5e('0x77')]=_0x70dbb2;return _0x4fbdd2;})['then'](function(_0x3f9ebe){if(_0x3f9ebe){_0x3f9ebe[_0xbd5e('0x29')][_0xbd5e('0x84')]=util[_0xbd5e('0x62')]('SIP/%s',_0x3b75b9[_0xbd5e('0x6b')][_0xbd5e('0x39')]);_0x3f9ebe[_0xbd5e('0x29')][_0xbd5e('0x7c')]=_0x4fbdd2[_0xbd5e('0x7c')];_0x3f9ebe[_0xbd5e('0x29')][_0xbd5e('0x85')]=_0x4fbdd2[_0xbd5e('0x7c')];_0x3f9ebe[_0xbd5e('0x29')][_0xbd5e('0x7d')]='reject';respondWithRpcPromise('EventManager',_0xbd5e('0x7e'),{'event':_0xbd5e('0x86'),'message':_0x3f9ebe['message']},client9002);return _0x4fbdd2;}return null;})['then'](respondWithResult(_0x74864f,null))[_0xbd5e('0x56')](handleError(_0x74864f,null));};exports[_0xbd5e('0x2c')]=function(_0x1c1b0d,_0x1ea83d,_0x36716f){if(_0x1c1b0d[_0xbd5e('0x5d')]['id']){delete _0x1c1b0d[_0xbd5e('0x5d')]['id'];}var _0x21a7f2;return db[_0xbd5e('0x3d')]['find']({'where':{'id':_0x1c1b0d[_0xbd5e('0x58')]['id']}})[_0xbd5e('0x21')](handleEntityNotFound(_0x1ea83d,null))[_0xbd5e('0x21')](function(_0x3294a5){if(_0x3294a5){_0x21a7f2=_0x3294a5;return db[_0xbd5e('0x87')][_0xbd5e('0x5b')]({'where':{'id':_0x3294a5[_0xbd5e('0x88')]}});}})[_0xbd5e('0x21')](handleEntityNotFound(_0x1ea83d,null))[_0xbd5e('0x21')](function(_0x101a33){if(_0x101a33){logger[_0xbd5e('0x25')](_0xbd5e('0x89'),_0xbd5e('0x2c'),_0xbd5e('0x8a'),_0x101a33[_0xbd5e('0x4f')],util[_0xbd5e('0x8b')](_0x1c1b0d[_0xbd5e('0x5d')],{'showHidden':![],'depth':null}));switch(_0x101a33[_0xbd5e('0x4f')]){case _0xbd5e('0x8c'):if(_0x1c1b0d[_0xbd5e('0x5d')][_0xbd5e('0x8d')]&&_0x1c1b0d['body'][_0xbd5e('0x8d')]===_0x21a7f2[_0xbd5e('0x8e')]){return _0x21a7f2['update']({'read':!![]});}else{logger[_0xbd5e('0x27')](_0xbd5e('0x8f'),_0xbd5e('0x2c'),'twilio',util[_0xbd5e('0x8b')](_0x1c1b0d[_0xbd5e('0x5d')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1c1b0d[_0xbd5e('0x5d')]['MessageUUID']&&_0x1c1b0d[_0xbd5e('0x5d')][_0xbd5e('0x90')]===_0x21a7f2[_0xbd5e('0x8e')]&&_[_0xbd5e('0x91')](['sent',_0xbd5e('0x92')],_0x1c1b0d['body']['Status'])>=0x0){return _0x21a7f2[_0xbd5e('0x36')]({'read':!![]});}else{logger['error'](_0xbd5e('0x8f'),_0xbd5e('0x2c'),'plivio',util[_0xbd5e('0x8b')](_0x1c1b0d['body'],{'showHidden':![],'depth':null}));}break;case _0xbd5e('0x93'):var _0x3b2ee4=_0x1c1b0d[_0xbd5e('0x5d')][_0xbd5e('0x94')][0x0];if(_0x3b2ee4[_0xbd5e('0x2c')][_0xbd5e('0x95')]===_0xbd5e('0x96')){return _0x21a7f2[_0xbd5e('0x36')]({'read':!![]});}else{logger[_0xbd5e('0x27')](_0xbd5e('0x8f'),_0xbd5e('0x2c'),_0xbd5e('0x93'),util['inspect'](_0x1c1b0d['body'],{'showHidden':![],'depth':null}));}break;}return _0x21a7f2;}})['then'](respondWithResult(_0x1ea83d,null))[_0xbd5e('0x56')](handleError(_0x1ea83d,null));}; \ No newline at end of file +var _0x7939=['../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','then','info','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','show','params','length','includeAll','include','find','create','body','describe','sms-interactions','sms','read','readAt','format','UserId','user','agent','get','SmsInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','SmsInteractionId','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','contact','event','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','sent','delivered','Status','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3be1c0,_0x23d2a7){var _0x4d77c0=function(_0x509382){while(--_0x509382){_0x3be1c0['push'](_0x3be1c0['shift']());}};_0x4d77c0(++_0x23d2a7);}(_0x7939,0x11c));var _0x9793=function(_0x49e81c,_0x1294dd){_0x49e81c=_0x49e81c-0x0;var _0x1830ab=_0x7939[_0x49e81c];return _0x1830ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9793('0x0'));var zipdir=require(_0x9793('0x1'));var jsonpatch=require(_0x9793('0x2'));var rp=require(_0x9793('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9793('0x4'));var path=require(_0x9793('0x5'));var sox=require(_0x9793('0x6'));var csv=require(_0x9793('0x7'));var ejs=require(_0x9793('0x8'));var fs=require('fs');var fs_extra=require(_0x9793('0x9'));var _=require(_0x9793('0xa'));var squel=require('squel');var crypto=require(_0x9793('0xb'));var jsforce=require(_0x9793('0xc'));var deskjs=require(_0x9793('0xd'));var toCsv=require(_0x9793('0x7'));var querystring=require('querystring');var Papa=require(_0x9793('0xe'));var Redis=require('ioredis');var authService=require(_0x9793('0xf'));var qs=require(_0x9793('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9793('0x11'));var logger=require(_0x9793('0x12'))(_0x9793('0x13'));var utils=require(_0x9793('0x14'));var config=require(_0x9793('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9793('0x16')]=_[_0x9793('0x17')](config[_0x9793('0x16')],{'host':_0x9793('0x18'),'port':0x18eb});var socket=require(_0x9793('0x19'))(new Redis(config[_0x9793('0x16')]));require(_0x9793('0x1a'))[_0x9793('0x1b')](socket);var jayson=require(_0x9793('0x1c'));var client=jayson[_0x9793('0x1d')][_0x9793('0x1e')]({'port':0x232c});var client9002=jayson[_0x9793('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x277e9b,_0x2953f9,_0x54cacc,_0x5cf237){return new BPromise(function(_0x16aa79,_0x4fe0be){var _0x39b676=_0x5cf237||client;return _0x39b676['request'](_0x277e9b,_0x54cacc)[_0x9793('0x1f')](function(_0x41617c){logger[_0x9793('0x20')]('SmsMessage,\x20%s,\x20%s',_0x2953f9,'request\x20sent');logger[_0x9793('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2953f9,'request\x20sent',JSON[_0x9793('0x22')](_0x41617c));if(_0x41617c['error']){if(_0x41617c[_0x9793('0x23')][_0x9793('0x24')]===0x1f4){logger[_0x9793('0x23')](_0x9793('0x25'),_0x2953f9,_0x41617c[_0x9793('0x23')]['message']);return _0x4fe0be(_0x41617c[_0x9793('0x23')][_0x9793('0x26')]);}logger['error'](_0x9793('0x25'),_0x2953f9,_0x41617c['error'][_0x9793('0x26')]);return _0x16aa79(_0x41617c[_0x9793('0x23')]['message']);}else{logger['info'](_0x9793('0x25'),_0x2953f9,_0x9793('0x27'));_0x16aa79(_0x41617c[_0x9793('0x28')]['message']);}})[_0x9793('0x29')](function(_0xd94215){logger[_0x9793('0x23')](_0x9793('0x25'),_0x2953f9,_0xd94215);_0x4fe0be(_0xd94215);});});}function respondWithStatusCode(_0x2de478,_0x97f89){_0x97f89=_0x97f89||0xcc;return function(_0x37c608){if(_0x37c608){return _0x2de478[_0x9793('0x2a')](_0x97f89);}return _0x2de478[_0x9793('0x2b')](_0x97f89)[_0x9793('0x2c')]();};}function respondWithResult(_0x92f198,_0xf8e48d){_0xf8e48d=_0xf8e48d||0xc8;return function(_0x2ff4ea){if(_0x2ff4ea){return _0x92f198['status'](_0xf8e48d)[_0x9793('0x2d')](_0x2ff4ea);}};}function respondWithFilteredResult(_0x1b26ff,_0x11ec8d){return function(_0x11edd4){if(_0x11edd4){var _0x481e8a=typeof _0x11ec8d[_0x9793('0x2e')]===_0x9793('0x2f')&&typeof _0x11ec8d['limit']===_0x9793('0x2f');var _0x233242=_0x11edd4[_0x9793('0x30')];var _0x53ba5f=_0x481e8a?0x0:_0x11ec8d[_0x9793('0x2e')];var _0x3a8897=_0x481e8a?_0x11edd4[_0x9793('0x30')]:_0x11ec8d['offset']+_0x11ec8d[_0x9793('0x31')];var _0xbea55d;if(_0x3a8897>=_0x233242){_0x3a8897=_0x233242;_0xbea55d=0xc8;}else{_0xbea55d=0xce;}_0x1b26ff['status'](_0xbea55d);return _0x1b26ff[_0x9793('0x32')](_0x9793('0x33'),_0x53ba5f+'-'+_0x3a8897+'/'+_0x233242)['json'](_0x11edd4);}return null;};}function patchUpdates(_0x222525){return function(_0x31fef5){try{jsonpatch[_0x9793('0x34')](_0x31fef5,_0x222525,!![]);}catch(_0x34cc53){return BPromise[_0x9793('0x35')](_0x34cc53);}return _0x31fef5[_0x9793('0x36')]();};}function saveUpdates(_0x2ecdd1,_0x373565){return function(_0x38f020){if(_0x38f020){return _0x38f020[_0x9793('0x37')](_0x2ecdd1)[_0x9793('0x1f')](function(_0xa5cca3){return _0xa5cca3;});}return null;};}function removeEntity(_0x504d9c,_0x11487c){return function(_0x454295){if(_0x454295){return _0x454295[_0x9793('0x38')]()['then'](function(){_0x504d9c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a6db,_0x4c5c50){return function(_0x36eab2){if(!_0x36eab2){_0x28a6db[_0x9793('0x2a')](0x194);}return _0x36eab2;};}function handleError(_0x431e73,_0x146850){_0x146850=_0x146850||0x1f4;return function(_0x8fdac4){logger[_0x9793('0x23')](_0x8fdac4[_0x9793('0x39')]);if(_0x8fdac4[_0x9793('0x3a')]){delete _0x8fdac4['name'];}_0x431e73[_0x9793('0x2b')](_0x146850)[_0x9793('0x3b')](_0x8fdac4);};}exports[_0x9793('0x3c')]=function(_0x1ff1c8,_0x3466e9){var _0x59e364={},_0x48a739={},_0x2ceca1={'count':0x0,'rows':[]};var _0x3c0f99=_[_0x9793('0x3d')](db[_0x9793('0x3e')][_0x9793('0x3f')],function(_0x131941){return{'name':_0x131941['fieldName'],'type':_0x131941[_0x9793('0x40')][_0x9793('0x41')]};});_0x48a739[_0x9793('0x42')]=_['map'](_0x3c0f99,_0x9793('0x3a'));_0x48a739['query']=_[_0x9793('0x43')](_0x1ff1c8[_0x9793('0x44')]);_0x48a739['filters']=_['intersection'](_0x48a739[_0x9793('0x42')],_0x48a739[_0x9793('0x44')]);_0x59e364[_0x9793('0x45')]=_[_0x9793('0x46')](_0x48a739['model'],qs[_0x9793('0x47')](_0x1ff1c8['query']['fields']));_0x59e364[_0x9793('0x45')]=_0x59e364[_0x9793('0x45')]['length']?_0x59e364['attributes']:_0x48a739[_0x9793('0x42')];if(!_0x1ff1c8[_0x9793('0x44')][_0x9793('0x48')](_0x9793('0x49'))){_0x59e364['limit']=qs[_0x9793('0x31')](_0x1ff1c8['query'][_0x9793('0x31')]);_0x59e364[_0x9793('0x2e')]=qs[_0x9793('0x2e')](_0x1ff1c8[_0x9793('0x44')][_0x9793('0x2e')]);}_0x59e364[_0x9793('0x4a')]=qs[_0x9793('0x4b')](_0x1ff1c8[_0x9793('0x44')][_0x9793('0x4b')]);_0x59e364[_0x9793('0x4c')]=qs[_0x9793('0x4d')](_['pick'](_0x1ff1c8[_0x9793('0x44')],_0x48a739[_0x9793('0x4d')]),_0x3c0f99);if(_0x1ff1c8[_0x9793('0x44')]['filter']){_0x59e364[_0x9793('0x4c')]=_[_0x9793('0x4e')](_0x59e364[_0x9793('0x4c')],{'$or':_[_0x9793('0x3d')](_0x3c0f99,function(_0x4a5ef5){if(_0x4a5ef5[_0x9793('0x40')]!==_0x9793('0x4f')){var _0x53e7b1={};_0x53e7b1[_0x4a5ef5[_0x9793('0x3a')]]={'$like':'%'+_0x1ff1c8['query'][_0x9793('0x50')]+'%'};return _0x53e7b1;}})});}_0x59e364=_['merge']({},_0x59e364,_0x1ff1c8[_0x9793('0x51')]);var _0x45df62={'where':_0x59e364[_0x9793('0x4c')]};return db[_0x9793('0x3e')][_0x9793('0x30')](_0x45df62)[_0x9793('0x1f')](function(_0x2e7dd3){_0x2ceca1[_0x9793('0x30')]=_0x2e7dd3;if(_0x1ff1c8[_0x9793('0x44')]['includeAll']){_0x59e364['include']=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x59e364);})[_0x9793('0x1f')](function(_0x3817b6){_0x2ceca1['rows']=_0x3817b6;return _0x2ceca1;})[_0x9793('0x1f')](respondWithFilteredResult(_0x3466e9,_0x59e364))[_0x9793('0x29')](handleError(_0x3466e9,null));};exports[_0x9793('0x52')]=function(_0x18c6b5,_0x2ed443){var _0x5ca010={'raw':!![],'where':{'id':_0x18c6b5[_0x9793('0x53')]['id']}},_0x51b722={};_0x51b722['model']=_['keys'](db[_0x9793('0x3e')][_0x9793('0x3f')]);_0x51b722['query']=_[_0x9793('0x43')](_0x18c6b5[_0x9793('0x44')]);_0x51b722[_0x9793('0x4d')]=_[_0x9793('0x46')](_0x51b722['model'],_0x51b722[_0x9793('0x44')]);_0x5ca010[_0x9793('0x45')]=_[_0x9793('0x46')](_0x51b722[_0x9793('0x42')],qs[_0x9793('0x47')](_0x18c6b5['query'][_0x9793('0x47')]));_0x5ca010[_0x9793('0x45')]=_0x5ca010[_0x9793('0x45')][_0x9793('0x54')]?_0x5ca010['attributes']:_0x51b722['model'];if(_0x18c6b5[_0x9793('0x44')][_0x9793('0x55')]){_0x5ca010[_0x9793('0x56')]=[{'all':!![]}];}_0x5ca010=_['merge']({},_0x5ca010,_0x18c6b5['options']);return db[_0x9793('0x3e')][_0x9793('0x57')](_0x5ca010)[_0x9793('0x1f')](handleEntityNotFound(_0x2ed443,null))[_0x9793('0x1f')](respondWithResult(_0x2ed443,null))['catch'](handleError(_0x2ed443,null));};exports[_0x9793('0x58')]=function(_0x27e023,_0x216226){return db[_0x9793('0x3e')]['create'](_0x27e023['body'],{})[_0x9793('0x1f')](respondWithResult(_0x216226,0xc9))[_0x9793('0x29')](handleError(_0x216226,null));};exports[_0x9793('0x37')]=function(_0x40c043,_0x4a8f6e){if(_0x40c043['body']['id']){delete _0x40c043[_0x9793('0x59')]['id'];}return db[_0x9793('0x3e')][_0x9793('0x57')]({'where':{'id':_0x40c043[_0x9793('0x53')]['id']}})[_0x9793('0x1f')](handleEntityNotFound(_0x4a8f6e,null))[_0x9793('0x1f')](saveUpdates(_0x40c043[_0x9793('0x59')],null))['then'](respondWithResult(_0x4a8f6e,null))[_0x9793('0x29')](handleError(_0x4a8f6e,null));};exports[_0x9793('0x38')]=function(_0x49b58e,_0x3680cb){return db[_0x9793('0x3e')][_0x9793('0x57')]({'where':{'id':_0x49b58e[_0x9793('0x53')]['id']}})[_0x9793('0x1f')](handleEntityNotFound(_0x3680cb,null))[_0x9793('0x1f')](removeEntity(_0x3680cb,null))['catch'](handleError(_0x3680cb,null));};exports[_0x9793('0x5a')]=function(_0x3572db,_0x7f0a6b){return db[_0x9793('0x3e')][_0x9793('0x5a')]()[_0x9793('0x1f')](respondWithResult(_0x7f0a6b,null))['catch'](handleError(_0x7f0a6b,null));};var interaction_log=require(_0x9793('0x12'))(_0x9793('0x5b'));exports['accept']=function(_0x4a0a69,_0x31fad5,_0x484f0b){var _0x3cccfa={'agent':{},'channel':_0x9793('0x5c')};if(_0x4a0a69[_0x9793('0x59')]['id']){delete _0x4a0a69[_0x9793('0x59')]['id'];}_0x4a0a69[_0x9793('0x59')][_0x9793('0x5d')]=!![];_0x4a0a69[_0x9793('0x59')][_0x9793('0x5e')]=moment()[_0x9793('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a0a69['body'][_0x9793('0x60')]=_0x4a0a69['body'][_0x9793('0x60')]||_0x4a0a69[_0x9793('0x61')]['id'];_0x3cccfa[_0x9793('0x62')]['id']=_0x4a0a69[_0x9793('0x59')][_0x9793('0x60')];return db['SmsMessage'][_0x9793('0x57')]({'where':{'id':_0x4a0a69[_0x9793('0x53')]['id'],'UserId':null}})[_0x9793('0x1f')](handleEntityNotFound(_0x31fad5,null))[_0x9793('0x1f')](saveUpdates(_0x4a0a69[_0x9793('0x59')],null))[_0x9793('0x1f')](function(_0x278a19){if(_0x278a19){_0x3cccfa[_0x9793('0x26')]=_0x278a19[_0x9793('0x63')]({'plain':!![]});return db[_0x9793('0x64')][_0x9793('0x57')]({'where':{'id':_0x278a19['SmsInteractionId']}});}return null;})[_0x9793('0x1f')](handleEntityNotFound(_0x31fad5,null))['then'](function(_0x12bcdb){if(_0x12bcdb){return _0x12bcdb[_0x9793('0x37')]({'UserId':_0x4a0a69['body'][_0x9793('0x60')],'read1stAt':_[_0x9793('0x65')](_0x12bcdb[_0x9793('0x66')])?moment()['format'](_0x9793('0x67')):undefined});}return null;})[_0x9793('0x1f')](function(_0x3269fa){if(_0x3269fa){_0x3cccfa[_0x9793('0x68')]=_0x3269fa[_0x9793('0x63')]({'plain':!![]});interaction_log['info'](_0x9793('0x69'),_0x4a0a69[_0x9793('0x61')]['id'],_0x4a0a69['user']['name'],_0x4a0a69[_0x9793('0x61')][_0x9793('0x6a')],_0x3cccfa[_0x9793('0x68')]['id'],_0x4a0a69['body']?JSON[_0x9793('0x22')](_0x4a0a69[_0x9793('0x59')]):'null');return respondWithRpcPromise(_0x9793('0x6b'),_0x9793('0x6c'),_0x3cccfa);}return null;})[_0x9793('0x1f')](function(_0x163446){var _0x1cbf12='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x163446[_0x9793('0x26')][_0x9793('0x6d')];return db[_0x9793('0x6e')][_0x9793('0x44')](_0x1cbf12,{'type':db['Sequelize'][_0x9793('0x6f')]['SELECT'],'raw':!![]})[_0x9793('0x1f')](function(_0x144d79){return _0x144d79;});})[_0x9793('0x1f')](function(_0x380427){if(_0x380427){_0x3cccfa[_0x9793('0x26')]['contact']=_0x380427[0x0];if(!_0x4a0a69[_0x9793('0x59')][_0x9793('0x60')])return;return db[_0x9793('0x70')][_0x9793('0x57')]({'where':{'id':_0x4a0a69[_0x9793('0x59')]['UserId'],'role':_0x9793('0x62')},'attributes':['id','name',_0x9793('0x71'),_0x9793('0x72'),_0x9793('0x73')],'raw':!![]});}return null;})[_0x9793('0x1f')](function(_0x216f42){if(!_0x216f42)return null;_0x3cccfa['message'][_0x9793('0x62')]=_0x216f42;return _0x3cccfa;})[_0x9793('0x1f')](function(_0x42ba4f){if(_0x42ba4f){if(_0x4a0a69[_0x9793('0x59')][_0x9793('0x74')]){_0x3cccfa[_0x9793('0x26')][_0x9793('0x75')]=util[_0x9793('0x5f')](_0x9793('0x76'),_0x4a0a69[_0x9793('0x61')]['name']);_0x3cccfa['message']['channel']=_0x3cccfa[_0x9793('0x77')];_0x3cccfa[_0x9793('0x26')][_0x9793('0x78')]=_0x3cccfa['channel'];_0x3cccfa[_0x9793('0x26')]['event']=_0x9793('0x79');return respondWithRpcPromise(_0x9793('0x7a'),_0x9793('0x7a'),{'event':_0x9793('0x7b'),'message':_0x3cccfa['message']},client9002)['then'](function(){return _0x3cccfa;});}return _0x3cccfa;}return null;})[_0x9793('0x1f')](respondWithResult(_0x31fad5,null))[_0x9793('0x29')](handleError(_0x31fad5,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x9793('0x35')]=function(_0x1229c6,_0x423eaa,_0x1c8bbb){var _0x463501={'agent':{},'channel':_0x9793('0x5c')};if(_0x1229c6[_0x9793('0x59')]['id']){delete _0x1229c6['body']['id'];}_0x1229c6[_0x9793('0x59')][_0x9793('0x60')]=_0x1229c6['body'][_0x9793('0x60')]||_0x1229c6[_0x9793('0x61')]['id'];_0x463501[_0x9793('0x62')]['id']=_0x1229c6[_0x9793('0x59')][_0x9793('0x60')];return db[_0x9793('0x3e')][_0x9793('0x57')]({'where':{'id':_0x1229c6[_0x9793('0x53')]['id'],'UserId':null}})[_0x9793('0x1f')](handleEntityNotFound(_0x423eaa,null))['then'](function(_0x567815){if(_0x567815){_0x463501[_0x9793('0x26')]=_0x567815[_0x9793('0x63')]({'plain':!![]});return db['SmsInteraction'][_0x9793('0x57')]({'where':{'id':_0x567815[_0x9793('0x7c')]}});}return null;})[_0x9793('0x1f')](handleEntityNotFound(_0x423eaa,null))['then'](function(_0x34021e){if(_0x34021e){_0x463501[_0x9793('0x68')]=_0x34021e[_0x9793('0x63')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1229c6[_0x9793('0x61')]['id'],_0x1229c6['user'][_0x9793('0x3a')],_0x1229c6[_0x9793('0x61')]['role'],_0x463501[_0x9793('0x68')]['id'],_0x1229c6[_0x9793('0x59')]?JSON[_0x9793('0x22')](_0x1229c6['body']):_0x9793('0x7d'));return respondWithRpcPromise(_0x9793('0x7e'),_0x9793('0x7f'),_0x463501);}return null;})[_0x9793('0x1f')](function(_0x24ffc2){var _0x2edf4e=_0x9793('0x80')+_0x24ffc2['message']['ContactId'];return db[_0x9793('0x6e')][_0x9793('0x44')](_0x2edf4e,{'type':db[_0x9793('0x81')][_0x9793('0x6f')][_0x9793('0x82')],'raw':!![]})[_0x9793('0x1f')](function(_0x5a4ad5){return _0x5a4ad5;});})[_0x9793('0x1f')](function(_0x290338){if(_0x290338){_0x463501[_0x9793('0x26')][_0x9793('0x83')]=_0x290338[0x0];if(!_0x1229c6[_0x9793('0x59')][_0x9793('0x60')])return;return db['User']['find']({'where':{'id':_0x1229c6['body'][_0x9793('0x60')],'role':_0x9793('0x62')},'attributes':['id',_0x9793('0x3a'),_0x9793('0x71'),'email',_0x9793('0x73')],'raw':!![]});}return null;})[_0x9793('0x1f')](function(_0x3839be){if(!_0x3839be)return null;_0x463501['message']['agent']=_0x3839be;return _0x463501;})[_0x9793('0x1f')](function(_0x2c5e70){if(_0x2c5e70){_0x2c5e70[_0x9793('0x26')][_0x9793('0x75')]=util[_0x9793('0x5f')](_0x9793('0x76'),_0x1229c6[_0x9793('0x61')][_0x9793('0x3a')]);_0x2c5e70[_0x9793('0x26')][_0x9793('0x77')]=_0x463501[_0x9793('0x77')];_0x2c5e70['message']['motionChannel']=_0x463501[_0x9793('0x77')];_0x2c5e70[_0x9793('0x26')][_0x9793('0x84')]='reject';respondWithRpcPromise(_0x9793('0x7a'),'EventManager',{'event':_0x9793('0x85'),'message':_0x2c5e70[_0x9793('0x26')]},client9002);return _0x463501;}return null;})[_0x9793('0x1f')](respondWithResult(_0x423eaa,null))[_0x9793('0x29')](handleError(_0x423eaa,null));};exports[_0x9793('0x2b')]=function(_0xe004e6,_0x5e3dc3,_0x1a0810){if(_0xe004e6[_0x9793('0x59')]['id']){delete _0xe004e6[_0x9793('0x59')]['id'];}var _0x5970b8;return db['SmsMessage'][_0x9793('0x57')]({'where':{'id':_0xe004e6[_0x9793('0x53')]['id']}})[_0x9793('0x1f')](handleEntityNotFound(_0x5e3dc3,null))['then'](function(_0x1b42b8){if(_0x1b42b8){_0x5970b8=_0x1b42b8;return db[_0x9793('0x86')][_0x9793('0x57')]({'where':{'id':_0x1b42b8[_0x9793('0x87')]}});}})[_0x9793('0x1f')](handleEntityNotFound(_0x5e3dc3,null))[_0x9793('0x1f')](function(_0x220307){if(_0x220307){logger[_0x9793('0x21')](_0x9793('0x88'),_0x9793('0x2b'),'received\x20delivery\x20report\x20from',_0x220307[_0x9793('0x40')],util[_0x9793('0x89')](_0xe004e6[_0x9793('0x59')],{'showHidden':![],'depth':null}));switch(_0x220307[_0x9793('0x40')]){case'twilio':if(_0xe004e6['body'][_0x9793('0x8a')]&&_0xe004e6[_0x9793('0x59')][_0x9793('0x8a')]===_0x5970b8[_0x9793('0x8b')]){return _0x5970b8[_0x9793('0x37')]({'read':!![]});}else{logger[_0x9793('0x23')](_0x9793('0x8c'),_0x9793('0x2b'),_0x9793('0x8d'),util[_0x9793('0x89')](_0xe004e6[_0x9793('0x59')],{'showHidden':![],'depth':null}));}break;case _0x9793('0x8e'):if(_0xe004e6['body'][_0x9793('0x8f')]&&_0xe004e6['body'][_0x9793('0x8f')]===_0x5970b8[_0x9793('0x8b')]&&_['indexOf']([_0x9793('0x90'),_0x9793('0x91')],_0xe004e6[_0x9793('0x59')][_0x9793('0x92')])>=0x0){return _0x5970b8[_0x9793('0x37')]({'read':!![]});}else{logger[_0x9793('0x23')](_0x9793('0x8c'),_0x9793('0x2b'),'plivio',util[_0x9793('0x89')](_0xe004e6['body'],{'showHidden':![],'depth':null}));}break;case _0x9793('0x93'):var _0x6dad31=_0xe004e6['body'][_0x9793('0x94')][0x0];if(_0x6dad31[_0x9793('0x2b')][_0x9793('0x95')]===_0x9793('0x96')){return _0x5970b8[_0x9793('0x37')]({'read':!![]});}else{logger[_0x9793('0x23')](_0x9793('0x8c'),_0x9793('0x2b'),_0x9793('0x93'),util['inspect'](_0xe004e6[_0x9793('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x5970b8;}})[_0x9793('0x1f')](respondWithResult(_0x5e3dc3,null))[_0x9793('0x29')](handleError(_0x5e3dc3,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index bd20d66..7b2c062 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 _0x1e2a=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','save','update'];(function(_0x5d68bb,_0x131909){var _0x3dfcd9=function(_0x4d593d){while(--_0x4d593d){_0x5d68bb['push'](_0x5d68bb['shift']());}};_0x3dfcd9(++_0x131909);}(_0x1e2a,0x136));var _0xa1e2=function(_0x3a1ac7,_0x32d08d){_0x3a1ac7=_0x3a1ac7-0x0;var _0x4f02da=_0x1e2a[_0x3a1ac7];return _0x4f02da;};'use strict';var EventEmitter=require(_0xa1e2('0x0'));var SmsMessage=require(_0xa1e2('0x1'))['db'][_0xa1e2('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa1e2('0x3'),'afterUpdate':_0xa1e2('0x4'),'afterDestroy':_0xa1e2('0x5')};function emitEvent(_0x2df6cf){return function(_0x58f4cf,_0x224642,_0x1927aa){SmsMessageEvents[_0xa1e2('0x6')](_0x2df6cf+':'+_0x58f4cf['id'],_0x58f4cf);SmsMessageEvents[_0xa1e2('0x6')](_0x2df6cf,_0x58f4cf);_0x1927aa(null);};}for(var e in events){if(events[_0xa1e2('0x7')](e)){var event=events[e];SmsMessage[_0xa1e2('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xcce6=['../../mysqldb','SmsMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x1fa381,_0x758c2a){var _0x47eefe=function(_0x127f8c){while(--_0x127f8c){_0x1fa381['push'](_0x1fa381['shift']());}};_0x47eefe(++_0x758c2a);}(_0xcce6,0x158));var _0x6cce=function(_0x443494,_0x51fc7e){_0x443494=_0x443494-0x0;var _0x4a6794=_0xcce6[_0x443494];return _0x4a6794;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x6cce('0x0'))['db'][_0x6cce('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6cce('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6cce('0x3'),'afterDestroy':_0x6cce('0x4')};function emitEvent(_0x5494e0){return function(_0x5858cd,_0x151635,_0x56c74b){SmsMessageEvents[_0x6cce('0x5')](_0x5494e0+':'+_0x5858cd['id'],_0x5858cd);SmsMessageEvents[_0x6cce('0x5')](_0x5494e0,_0x5858cd);_0x56c74b(null);};}for(var e in events){if(events[_0x6cce('0x6')](e)){var event=events[e];SmsMessage[_0x6cce('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 0711db3..952598e 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 _0x3b65=['requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','apiKey','login','timestamp','keys','sort','length','createHash','md5','hex','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','get','toLowerCase','out','isNil','SmsInteractionId','SmsInteraction','findOne','then','createdAt','direction','error','secret','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','/api/sms/messages/','/status?token=','token','sid','catch','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','https://api.skebby.it/API/v1.0/REST/','password','body','smsMethod','sender','login?username=','username','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','update','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/'];(function(_0x15d24a,_0x53a9f2){var _0x57d686=function(_0x46627a){while(--_0x46627a){_0x15d24a['push'](_0x15d24a['shift']());}};_0x57d686(++_0x53a9f2);}(_0x3b65,0x13c));var _0x53b6=function(_0x20f4c8,_0x24aa43){_0x20f4c8=_0x20f4c8-0x0;var _0x334b87=_0x3b65[_0x20f4c8];return _0x334b87;};'use strict';var _=require(_0x53b6('0x0'));var util=require(_0x53b6('0x1'));var logger=require(_0x53b6('0x2'))('api');var moment=require(_0x53b6('0x3'));var BPromise=require(_0x53b6('0x4'));var rp=require(_0x53b6('0x5'));var fs=require('fs');var path=require(_0x53b6('0x6'));var rimraf=require(_0x53b6('0x7'));var config=require('../../config/environment');var attributes=require(_0x53b6('0x8'));module[_0x53b6('0x9')]=function(_0x55a321,_0x2232a9){return _0x55a321[_0x53b6('0xa')](_0x53b6('0xb'),attributes,{'tableName':_0x53b6('0xc'),'paranoid':![],'indexes':[{'name':_0x53b6('0xd'),'fields':[_0x53b6('0xd')]},{'name':_0x53b6('0xe'),'fields':['body'],'type':_0x53b6('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f4749,_0x237d23,_0x53ceec){var _0x4e1a2b=_0x55a321['models'];var _0x542a48=_0x3f4749[_0x53b6('0x10')]({'plain':!![]});if(_0x542a48['direction'][_0x53b6('0x11')]()==='in'||_0x542a48['direction'][_0x53b6('0x11')]()===_0x53b6('0x12')&&!_0x542a48['secret']&&!_[_0x53b6('0x13')](_0x542a48['UserId'])&&!_[_0x53b6('0x13')](_0x542a48[_0x53b6('0x14')])){_0x4e1a2b[_0x53b6('0x15')][_0x53b6('0x16')]({'where':{'id':_0x542a48['SmsInteractionId']}})[_0x53b6('0x17')](function(_0x169c03){if(_0x169c03){_0x169c03['update']({'lastMsgAt':_0x542a48[_0x53b6('0x18')],'lastMsgDirection':_0x542a48[_0x53b6('0x19')][_0x53b6('0x11')]()});}})['catch'](function(_0x518003){console[_0x53b6('0x1a')](_0x518003);});}if(_0x542a48[_0x53b6('0x19')]===_0x53b6('0x12')&&!_0x542a48[_0x53b6('0x1b')]){var _0x49167f;_0x4e1a2b['SmsAccount'][_0x53b6('0x1c')]({'where':{'id':_0x542a48[_0x53b6('0x1d')]},'raw':!![]})['then'](function(_0x1170d9){_0x49167f=_0x1170d9;if(_0x49167f&&_0x49167f[_0x53b6('0x1e')]){switch(_0x49167f[_0x53b6('0x1e')]){case _0x53b6('0x1f'):var _0x5dce1c=require(_0x53b6('0x1f'));if(_0x49167f[_0x53b6('0x20')]&&_0x49167f[_0x53b6('0x21')]&&_0x49167f[_0x53b6('0x22')]){var _0x2bf240=new _0x5dce1c(_0x49167f['accountSid'],_0x49167f[_0x53b6('0x21')]);_0x2bf240[_0x53b6('0x23')][_0x53b6('0x24')]({'body':_0x542a48['body'],'to':_0x542a48['phone'],'from':_0x49167f[_0x53b6('0x22')],'statusCallback':_0x49167f['remote']+_0x53b6('0x25')+_0x542a48['id']+_0x53b6('0x26')+_0x49167f[_0x53b6('0x27')]})['then'](function(_0x3cb326){if(_0x3cb326[_0x53b6('0x28')]){return _0x3f4749['update']({'messageId':_0x3cb326[_0x53b6('0x28')]});}})[_0x53b6('0x29')](function(_0x192d64){logger[_0x53b6('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x53b6('0x2a'),_0x53b6('0x1f'),util[_0x53b6('0x2b')](_0x192d64,{'showHidden':![],'depth':null}));});}else{logger[_0x53b6('0x1a')](_0x53b6('0x2c'),'afterCreate',_0x53b6('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x94d1bf=_0x53b6('0x2d');if(_0x49167f['username']&&_0x49167f[_0x53b6('0x2e')]){var _0x3b901e={'recipient':[_0x542a48[_0x53b6('0x22')]],'message':_0x542a48[_0x53b6('0x2f')],'message_type':_0x49167f[_0x53b6('0x30')]};if(_0x49167f[_0x53b6('0x30')]&&_0x49167f[_0x53b6('0x30')]!=='SI'){_0x3b901e[_0x53b6('0x31')]=_0x49167f[_0x53b6('0x22')];}var _0x20269f={'url':_0x94d1bf+_0x53b6('0x32')+_0x49167f[_0x53b6('0x33')]+_0x53b6('0x34')+_0x49167f[_0x53b6('0x2e')],'method':_0x53b6('0x35')};rp(_0x20269f)['then'](function(_0x493963){var _0x44a2e1=_0x493963[_0x53b6('0x36')](';');var _0x20ee19={'user_key':_0x44a2e1[0x0],'session_key':_0x44a2e1[0x1]};_0x20269f={'url':_0x94d1bf+_0x53b6('0x37'),'method':_0x53b6('0x38'),'headers':{'user_key':_0x20ee19[_0x53b6('0x39')],'Session_key':_0x20ee19[_0x53b6('0x3a')]},'json':!![],'body':_0x3b901e};return rp(_0x20269f);})[_0x53b6('0x17')](function(_0x260845){if(_0x260845[_0x53b6('0x3b')]>=0x1){var _0x48474b={'messageId':_0x260845[_0x53b6('0x3c')]};if(_0x49167f[_0x53b6('0x30')]!=='GP'||!_0x49167f['deliveryReport']){_0x48474b[_0x53b6('0x3d')]=!![];}return _0x3f4749[_0x53b6('0x3e')](_0x48474b);}else{return logger[_0x53b6('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x53b6('0x2a'),'skebby',util[_0x53b6('0x2b')](_0x260845,{'showHidden':![],'depth':null}));}})[_0x53b6('0x29')](function(_0x39dfb4){return logger[_0x53b6('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x53b6('0x2a'),_0x53b6('0x3f'),util['inspect'](_0x39dfb4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x53b6('0x2c'),_0x53b6('0x2a'),_0x53b6('0x3f'),_0x53b6('0x40'));}break;case _0x53b6('0x41'):if(_0x49167f[_0x53b6('0x21')]){var _0xcb0eb3={'recipient':_0x542a48[_0x53b6('0x22')],'message':_0x542a48[_0x53b6('0x2f')],'sender':_0x49167f[_0x53b6('0x42')]||_0x49167f['phone'],'authorization':_0x49167f[_0x53b6('0x21')]};var _0x237d23={'method':'POST','uri':_0x53b6('0x43'),'body':_0xcb0eb3,'json':!![]};rp(_0x237d23)[_0x53b6('0x17')](function(_0x1cc521){var _0x7302fd={'messageId':_0x1cc521[_0x53b6('0x44')]};if(!_0x49167f[_0x53b6('0x45')]){_0x7302fd[_0x53b6('0x3d')]=!![];}return _0x3f4749['update'](_0x7302fd);})[_0x53b6('0x29')](function(_0x3ec4de){logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),_0x53b6('0x41'),util['inspect'](_0x3ec4de,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x53b6('0x2a'),_0x53b6('0x41'),_0x53b6('0x46'));}break;case _0x53b6('0x47'):if(_0x49167f[_0x53b6('0x33')]&&_0x49167f['password']){var _0xcb0eb3={'messages':[{'source':_0x53b6('0x48'),'to':_0x542a48['phone'],'body':_0x542a48[_0x53b6('0x2f')],'from':_0x49167f['senderString']||_0x49167f[_0x53b6('0x22')]}]};var _0x3cf905=util['format'](_0x53b6('0x49'),_0x49167f[_0x53b6('0x33')],_0x49167f[_0x53b6('0x2e')]);var _0x237d23={'method':_0x53b6('0x38'),'uri':_0x53b6('0x4a'),'body':_0xcb0eb3,'headers':{'Authorization':util[_0x53b6('0x4b')](_0x53b6('0x4c'),new Buffer(_0x3cf905)[_0x53b6('0x4d')](_0x53b6('0x4e')))},'json':!![]};rp(_0x237d23)[_0x53b6('0x17')](function(_0x250bd2){if(_0x250bd2[_0x53b6('0x4f')]>=0xc8&&_0x250bd2['http_code']<=0xce){if(_0x250bd2[_0x53b6('0x50')]&&_0x250bd2['data'][_0x53b6('0x51')]>0x0){var _0x58a4d6=_[_0x53b6('0x52')](_0x250bd2[_0x53b6('0x50')][_0x53b6('0x23')]);var _0x3209c7={'messageId':_0x58a4d6[_0x53b6('0x53')]};if(!_0x49167f[_0x53b6('0x45')]){_0x3209c7[_0x53b6('0x3d')]=!![];}return _0x3f4749[_0x53b6('0x3e')](_0x3209c7);}else{logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),_0x53b6('0x54'),util[_0x53b6('0x2b')](_0x250bd2,{'showHidden':![],'depth':null}));}}else{logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),'clickSend',util[_0x53b6('0x2b')](_0x250bd2,{'showHidden':![],'depth':null}));}})[_0x53b6('0x29')](function(_0x32f416){logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),_0x53b6('0x54'),util['inspect'](_0x32f416,{'showHidden':![],'depth':null}));});}else{logger[_0x53b6('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x53b6('0x2a'),_0x53b6('0x54'),_0x53b6('0x40'));}break;case'plivo':if(_0x49167f[_0x53b6('0x55')]&&_0x49167f[_0x53b6('0x21')]){var _0xcb0eb3={'dst':_0x542a48['phone'],'text':_0x542a48[_0x53b6('0x2f')],'src':_0x49167f['senderString']||_0x49167f[_0x53b6('0x22')],'url':_0x49167f[_0x53b6('0x56')]+_0x53b6('0x25')+_0x542a48['id']+_0x53b6('0x26')+_0x49167f[_0x53b6('0x27')]};var _0x3cf905=util['format'](_0x53b6('0x49'),_0x49167f[_0x53b6('0x55')],_0x49167f[_0x53b6('0x21')]);var _0x237d23={'method':'POST','uri':util[_0x53b6('0x4b')](_0x53b6('0x57'),_0x49167f[_0x53b6('0x55')]),'body':_0xcb0eb3,'headers':{'Authorization':util[_0x53b6('0x4b')](_0x53b6('0x4c'),new Buffer(_0x3cf905)['toString'](_0x53b6('0x4e')))},'json':!![]};rp(_0x237d23)[_0x53b6('0x17')](function(_0x57a915){var _0x50aaa8={'messageId':_0x57a915[_0x53b6('0x58')][0x0]};return _0x3f4749[_0x53b6('0x3e')](_0x50aaa8);})[_0x53b6('0x29')](function(_0x5055f1){logger['error'](_0x53b6('0x2c'),'afterCreate','plivo',util['inspect'](_0x5055f1,{'showHidden':![],'depth':null}));});}else{logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),_0x53b6('0x59'),_0x53b6('0x5a'));}break;case'infobip':if(_0x49167f[_0x53b6('0x33')]&&_0x49167f[_0x53b6('0x2e')]){if(_0x49167f['baseUrl']){var _0x2f38bb={'method':'POST','uri':_0x49167f[_0x53b6('0x5b')]+_0x53b6('0x5c'),'body':{'username':_0x49167f[_0x53b6('0x33')],'password':_0x49167f[_0x53b6('0x2e')]},'json':!![]};return rp(_0x2f38bb)[_0x53b6('0x17')](function(_0x18cc6c){var _0x5f4ed0={'method':_0x53b6('0x38'),'uri':_0x49167f[_0x53b6('0x5b')]+_0x53b6('0x5d'),'body':{'messages':[{'from':_0x49167f[_0x53b6('0x22')],'destinations':[{'to':_0x542a48['phone']}],'text':_0x542a48[_0x53b6('0x2f')],'notifyUrl':_0x49167f[_0x53b6('0x56')]+_0x53b6('0x25')+_0x542a48['id']+_0x53b6('0x26')+_0x49167f['token'],'notifyContentType':_0x53b6('0x5e'),'callbackData':_0x49167f['phone']+';'+_0x542a48[_0x53b6('0x2f')]}]},'headers':{'Authorization':_0x53b6('0x5f')+_0x18cc6c['token']},'json':!![]};return rp(_0x5f4ed0)[_0x53b6('0x17')](function(_0x31bb70){if(_0x31bb70[_0x53b6('0x23')]){var _0x4af115={'messageId':_0x31bb70['messages'][0x0]['messageId']};if(!_0x49167f[_0x53b6('0x45')]){_0x4af115[_0x53b6('0x3d')]=!![];}return _0x3f4749[_0x53b6('0x3e')](_0x4af115);}else{return logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),'infobip',util[_0x53b6('0x2b')](_0x31bb70,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x5a0eee){return logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),'infobip',util[_0x53b6('0x2b')](_0x5a0eee,{'showHidden':![],'depth':null}));});}else{logger[_0x53b6('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x53b6('0x2a'),_0x53b6('0x60'),_0x53b6('0x61'));}}else{logger['error'](_0x53b6('0x2c'),_0x53b6('0x2a'),_0x53b6('0x60'),_0x53b6('0x40'));}break;case _0x53b6('0x62'):var _0x447d21=require('crypto');if(_0x49167f[_0x53b6('0x63')]){var _0x14f874={};_0x14f874[_0x53b6('0x64')]=_0x49167f['username'];_0x14f874[_0x53b6('0x22')]=_0x542a48[_0x53b6('0x22')];_0x14f874[_0x53b6('0x31')]=_0x49167f[_0x53b6('0x22')];_0x14f874['text']=_0x542a48[_0x53b6('0x2f')];_0x14f874[_0x53b6('0x65')]=+new Date();var _0xb3adbc='';var _0x32f8d6='';var _0x5fde1a=Object[_0x53b6('0x66')](_0x14f874);_0x5fde1a[_0x53b6('0x67')]();for(var _0x29a072=0x0;_0x29a072<_0x5fde1a[_0x53b6('0x68')];_0x29a072++){if(_0xb3adbc!=''){_0xb3adbc+='&';}_0xb3adbc+=_0x5fde1a[_0x29a072]+'='+encodeURIComponent(_0x14f874[_0x5fde1a[_0x29a072]]);_0x32f8d6+=_0x14f874[_0x5fde1a[_0x29a072]];}_0x32f8d6+=_0x49167f['apiKey'];_0x32f8d6=_0x447d21[_0x53b6('0x69')](_0x53b6('0x6a'))[_0x53b6('0x3e')](_0x32f8d6)['digest'](_0x53b6('0x6b'));if(_0xb3adbc!==''){_0xb3adbc+='&';}_0xb3adbc+='signature='+_0x32f8d6;var _0x20269f={'method':_0x53b6('0x35'),'uri':_0x49167f['baseUrl']+'/external/get/send.php?'+_0xb3adbc,'json':!![]};return rp(_0x20269f)[_0x53b6('0x17')](function(_0x29fa32){var _0x52663d=Object[_0x53b6('0x66')](_0x29fa32);if(_0x29fa32[_0x52663d[0x0]][_0x53b6('0x1a')]&&parseInt(_0x29fa32[_0x52663d[0x0]][_0x53b6('0x1a')])===0x0){var _0x59708c={'messageId':_0x29fa32[_0x52663d[0x0]][_0x53b6('0x6c')]};if(!_0x49167f['deliveryReport']){_0x59708c[_0x53b6('0x3d')]=!![];}return _0x3f4749[_0x53b6('0x3e')](_0x59708c);}else{return logger[_0x53b6('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x53b6('0x2a'),_0x53b6('0x62'),util['inspect'](_0x29fa32['error'],{'showHidden':![],'depth':null}));}})[_0x53b6('0x29')](function(_0x33aeb7){return logger[_0x53b6('0x1a')](_0x53b6('0x2c'),'afterCreate',_0x53b6('0x62'),util[_0x53b6('0x2b')](_0x33aeb7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x53b6('0x2c'),_0x53b6('0x2a'),'csc',_0x53b6('0x6d'));}break;case _0x53b6('0x6e'):if(_0x49167f[_0x53b6('0x63')]){var _0x483290={'method':_0x53b6('0x38'),'uri':_0x53b6('0x6f'),'headers':{'Authorization':_0x49167f[_0x53b6('0x63')]},'body':{'content':_0x542a48[_0x53b6('0x2f')],'to':[_0x542a48['phone']],'from':_0x49167f[_0x53b6('0x22')],'binary':![],'clientMessageId':_0x53b6('0x70'),'charset':'UTF-8'},'json':!![]};rp(_0x483290)['then'](function(_0x4b7516){if(!_0x4b7516[_0x53b6('0x1a')]){var _0x40d5ee={'messageId':_0x4b7516[_0x53b6('0x23')][0x0][_0x53b6('0x71')]};if(!_0x49167f[_0x53b6('0x45')]){_0x40d5ee[_0x53b6('0x3d')]=!![];}return _0x3f4749[_0x53b6('0x3e')](_0x40d5ee);}else{return logger[_0x53b6('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x53b6('0x2a'),_0x53b6('0x6e'),util['inspect'](_0x4b7516[_0x53b6('0x1a')],{'showHidden':![],'depth':null}));}})[_0x53b6('0x29')](function(_0x419400){return logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),_0x53b6('0x6e'),util[_0x53b6('0x2b')](_0x419400,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x53b6('0x2c'),_0x53b6('0x2a'),_0x53b6('0x6e'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x49167f[_0x53b6('0x33')]&&_0x49167f[_0x53b6('0x2e')]){var _0x3cf905=util[_0x53b6('0x4b')](_0x53b6('0x49'),_0x49167f[_0x53b6('0x33')],_0x49167f['password']);var _0x237d23={'method':'POST','uri':_0x53b6('0x72')+_0x49167f[_0x53b6('0x73')]+_0x53b6('0x74'),'body':{'to':[_0x542a48[_0x53b6('0x22')]],'text':_0x542a48[_0x53b6('0x2f')],'from':_0x49167f[_0x53b6('0x22')],'applicationId':_0x49167f[_0x53b6('0x75')]},'headers':{'Authorization':util['format'](_0x53b6('0x4c'),new Buffer(_0x3cf905)[_0x53b6('0x4d')](_0x53b6('0x4e')))},'json':!![]};rp(_0x237d23)[_0x53b6('0x17')](function(_0x4258c6){if(_0x4258c6['id']){var _0x174c5a={'messageId':_0x4258c6['id']};return _0x3f4749[_0x53b6('0x3e')](_0x174c5a);}else{logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),_0x53b6('0x76'),util['inspect'](_0x4258c6,{'showHidden':![],'depth':null}));}})[_0x53b6('0x29')](function(_0x1c3d2f){logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),'bandwidth',util[_0x53b6('0x2b')](_0x1c3d2f,{'showHidden':![],'depth':null}));});}else{logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),_0x53b6('0x76'),_0x53b6('0x40'));}break;case _0x53b6('0x77'):if(_0x49167f[_0x53b6('0x63')]){var _0x43cb0c={};var _0x20269f={'method':_0x53b6('0x38'),'uri':_0x53b6('0x78'),'headers':{'Authorization':_0x53b6('0x79')+_0x49167f['apiKey'],'Content-Type':_0x53b6('0x5e')},'body':{'from':_0x49167f[_0x53b6('0x22')],'to':_0x542a48[_0x53b6('0x22')],'text':_0x542a48[_0x53b6('0x2f')]},'json':!![]};return rp(_0x20269f)['then'](function(_0x1ea25e){if(_0x1ea25e['code']==0xca){_0x43cb0c[_0x53b6('0x7a')]=_0x1ea25e;var _0x488b1d={'method':'POST','uri':_0x53b6('0x7b'),'headers':{'Authorization':_0x53b6('0x79')+_0x49167f[_0x53b6('0x63')],'Content-Type':'application/json'},'body':{'refid':_0x43cb0c[_0x53b6('0x7a')]['refid']},'json':!![]};return rp(_0x488b1d)[_0x53b6('0x17')](function(_0x50a2aa){_0x43cb0c[_0x53b6('0x7c')]=_0x50a2aa;var _0x3c4a3c={'messageId':_0x43cb0c[_0x53b6('0x7a')]['refid'],'read':!![]};return _0x3f4749[_0x53b6('0x3e')](_0x3c4a3c);});}else{return logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),_0x53b6('0x77'),util[_0x53b6('0x2b')](_0x1ea25e,{'showHidden':![],'depth':null}));}})[_0x53b6('0x29')](function(_0xf6e2c6){return logger[_0x53b6('0x1a')](_0x53b6('0x2c'),_0x53b6('0x2a'),'intelepeer',util[_0x53b6('0x2b')](_0xf6e2c6,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x53b6('0x2c'),_0x53b6('0x2a'),_0x53b6('0x77'),_0x53b6('0x7d'));}break;}}})['finally'](function(){_0x53ceec();});}else{_0x53ceec();}}},'charset':_0x53b6('0x7e'),'collate':_0x53b6('0x7f')});}; \ No newline at end of file +var _0x825d=['secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','find','SmsAccountId','type','twilio','accountSid','authToken','messages','phone','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','smsMethod','GET','split','POST','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','password','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','remote','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','sender','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x4971ca,_0x2ae39a){var _0x10c18e=function(_0x469242){while(--_0x469242){_0x4971ca['push'](_0x4971ca['shift']());}};_0x10c18e(++_0x2ae39a);}(_0x825d,0x1dc));var _0xd825=function(_0x4e2712,_0x3cb979){_0x4e2712=_0x4e2712-0x0;var _0x540399=_0x825d[_0x4e2712];return _0x540399;};'use strict';var _=require(_0xd825('0x0'));var util=require('util');var logger=require(_0xd825('0x1'))('api');var moment=require(_0xd825('0x2'));var BPromise=require('bluebird');var rp=require(_0xd825('0x3'));var fs=require('fs');var path=require(_0xd825('0x4'));var rimraf=require('rimraf');var config=require(_0xd825('0x5'));var attributes=require(_0xd825('0x6'));module[_0xd825('0x7')]=function(_0x24c6dc,_0x128645){return _0x24c6dc[_0xd825('0x8')](_0xd825('0x9'),attributes,{'tableName':_0xd825('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xd825('0xb')]},{'name':_0xd825('0xc'),'fields':[_0xd825('0xd')],'type':_0xd825('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x644067,_0x4cc6f5,_0x40ca0b){var _0x444691=_0x24c6dc[_0xd825('0xf')];var _0x10a887=_0x644067[_0xd825('0x10')]({'plain':!![]});if(_0x10a887[_0xd825('0x11')][_0xd825('0x12')]()==='in'||_0x10a887[_0xd825('0x11')][_0xd825('0x12')]()===_0xd825('0x13')&&!_0x10a887[_0xd825('0x14')]&&!_[_0xd825('0x15')](_0x10a887[_0xd825('0x16')])&&!_[_0xd825('0x15')](_0x10a887[_0xd825('0x17')])){_0x444691[_0xd825('0x18')][_0xd825('0x19')]({'where':{'id':_0x10a887[_0xd825('0x17')]}})[_0xd825('0x1a')](function(_0x54d3ee){if(_0x54d3ee){_0x54d3ee[_0xd825('0x1b')]({'lastMsgAt':_0x10a887[_0xd825('0x1c')],'lastMsgDirection':_0x10a887['direction'][_0xd825('0x12')]()});}})[_0xd825('0x1d')](function(_0x51c671){console[_0xd825('0x1e')](_0x51c671);});}if(_0x10a887[_0xd825('0x11')]===_0xd825('0x13')&&!_0x10a887[_0xd825('0x14')]){var _0x5161b6;_0x444691['SmsAccount'][_0xd825('0x1f')]({'where':{'id':_0x10a887[_0xd825('0x20')]},'raw':!![]})[_0xd825('0x1a')](function(_0x6ce55d){_0x5161b6=_0x6ce55d;if(_0x5161b6&&_0x5161b6['type']){switch(_0x5161b6[_0xd825('0x21')]){case'twilio':var _0x1b0cd7=require(_0xd825('0x22'));if(_0x5161b6[_0xd825('0x23')]&&_0x5161b6[_0xd825('0x24')]&&_0x5161b6['phone']){var _0x28cd65=new _0x1b0cd7(_0x5161b6[_0xd825('0x23')],_0x5161b6[_0xd825('0x24')]);_0x28cd65[_0xd825('0x25')]['create']({'body':_0x10a887[_0xd825('0xd')],'to':_0x10a887['phone'],'from':_0x5161b6[_0xd825('0x26')],'statusCallback':_0x5161b6['remote']+_0xd825('0x27')+_0x10a887['id']+_0xd825('0x28')+_0x5161b6['token']})[_0xd825('0x1a')](function(_0x907a8){if(_0x907a8[_0xd825('0x29')]){return _0x644067[_0xd825('0x1b')]({'messageId':_0x907a8[_0xd825('0x29')]});}})['catch'](function(_0x55c2dc){logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x22'),util['inspect'](_0x55c2dc,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd825('0x2a'),'afterCreate','twilio',_0xd825('0x2c'));}break;case'skebby':var _0x260773='https://api.skebby.it/API/v1.0/REST/';if(_0x5161b6[_0xd825('0x2d')]&&_0x5161b6['password']){var _0x35c473={'recipient':[_0x10a887['phone']],'message':_0x10a887[_0xd825('0xd')],'message_type':_0x5161b6[_0xd825('0x2e')]};if(_0x5161b6[_0xd825('0x2e')]&&_0x5161b6[_0xd825('0x2e')]!=='SI'){_0x35c473['sender']=_0x5161b6[_0xd825('0x26')];}var _0x444fa5={'url':_0x260773+'login?username='+_0x5161b6[_0xd825('0x2d')]+'&password='+_0x5161b6['password'],'method':_0xd825('0x2f')};rp(_0x444fa5)[_0xd825('0x1a')](function(_0x2a8a48){var _0x16ac33=_0x2a8a48[_0xd825('0x30')](';');var _0x2238b4={'user_key':_0x16ac33[0x0],'session_key':_0x16ac33[0x1]};_0x444fa5={'url':_0x260773+'sms','method':_0xd825('0x31'),'headers':{'user_key':_0x2238b4['user_key'],'Session_key':_0x2238b4[_0xd825('0x32')]},'json':!![],'body':_0x35c473};return rp(_0x444fa5);})[_0xd825('0x1a')](function(_0x15528f){if(_0x15528f[_0xd825('0x33')]>=0x1){var _0x34f2b5={'messageId':_0x15528f[_0xd825('0x34')]};if(_0x5161b6[_0xd825('0x2e')]!=='GP'||!_0x5161b6[_0xd825('0x35')]){_0x34f2b5[_0xd825('0x36')]=!![];}return _0x644067[_0xd825('0x1b')](_0x34f2b5);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd825('0x2b'),_0xd825('0x37'),util[_0xd825('0x38')](_0x15528f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x322458){return logger[_0xd825('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd825('0x37'),util[_0xd825('0x38')](_0x322458,{'showHidden':![],'depth':null}));});}else{logger[_0xd825('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd825('0x37'),_0xd825('0x39'));}break;case _0xd825('0x3a'):if(_0x5161b6[_0xd825('0x24')]){var _0x998a1b={'recipient':_0x10a887[_0xd825('0x26')],'message':_0x10a887[_0xd825('0xd')],'sender':_0x5161b6[_0xd825('0x3b')]||_0x5161b6[_0xd825('0x26')],'authorization':_0x5161b6[_0xd825('0x24')]};var _0x4cc6f5={'method':'POST','uri':_0xd825('0x3c'),'body':_0x998a1b,'json':!![]};rp(_0x4cc6f5)['then'](function(_0x33e289){var _0x3653f8={'messageId':_0x33e289[_0xd825('0x3d')]};if(!_0x5161b6['deliveryReport']){_0x3653f8[_0xd825('0x36')]=!![];}return _0x644067['update'](_0x3653f8);})[_0xd825('0x1d')](function(_0x23b670){logger['error'](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x3a'),util[_0xd825('0x38')](_0x23b670,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd825('0x2b'),_0xd825('0x3a'),_0xd825('0x3e'));}break;case'clicksend':if(_0x5161b6[_0xd825('0x2d')]&&_0x5161b6[_0xd825('0x3f')]){var _0x998a1b={'messages':[{'source':_0xd825('0x40'),'to':_0x10a887[_0xd825('0x26')],'body':_0x10a887[_0xd825('0xd')],'from':_0x5161b6[_0xd825('0x3b')]||_0x5161b6[_0xd825('0x26')]}]};var _0x46bd9b=util['format'](_0xd825('0x41'),_0x5161b6[_0xd825('0x2d')],_0x5161b6[_0xd825('0x3f')]);var _0x4cc6f5={'method':_0xd825('0x31'),'uri':_0xd825('0x42'),'body':_0x998a1b,'headers':{'Authorization':util[_0xd825('0x43')](_0xd825('0x44'),new Buffer(_0x46bd9b)[_0xd825('0x45')](_0xd825('0x46')))},'json':!![]};rp(_0x4cc6f5)[_0xd825('0x1a')](function(_0x543952){if(_0x543952[_0xd825('0x47')]>=0xc8&&_0x543952['http_code']<=0xce){if(_0x543952['data']&&_0x543952[_0xd825('0x48')][_0xd825('0x49')]>0x0){var _0x22a295=_['head'](_0x543952['data'][_0xd825('0x25')]);var _0x2a139d={'messageId':_0x22a295[_0xd825('0x4a')]};if(!_0x5161b6[_0xd825('0x35')]){_0x2a139d[_0xd825('0x36')]=!![];}return _0x644067['update'](_0x2a139d);}else{logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x4b'),util['inspect'](_0x543952,{'showHidden':![],'depth':null}));}}else{logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x4b'),util[_0xd825('0x38')](_0x543952,{'showHidden':![],'depth':null}));}})['catch'](function(_0x305247){logger[_0xd825('0x1e')](_0xd825('0x2a'),'afterCreate',_0xd825('0x4b'),util[_0xd825('0x38')](_0x305247,{'showHidden':![],'depth':null}));});}else{logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0xd825('0x4c'):if(_0x5161b6[_0xd825('0x4d')]&&_0x5161b6['authToken']){var _0x998a1b={'dst':_0x10a887[_0xd825('0x26')],'text':_0x10a887[_0xd825('0xd')],'src':_0x5161b6[_0xd825('0x3b')]||_0x5161b6['phone'],'url':_0x5161b6['remote']+'/api/sms/messages/'+_0x10a887['id']+_0xd825('0x28')+_0x5161b6[_0xd825('0x4e')]};var _0x46bd9b=util[_0xd825('0x43')]('%s:%s',_0x5161b6['authId'],_0x5161b6[_0xd825('0x24')]);var _0x4cc6f5={'method':'POST','uri':util[_0xd825('0x43')](_0xd825('0x4f'),_0x5161b6[_0xd825('0x4d')]),'body':_0x998a1b,'headers':{'Authorization':util[_0xd825('0x43')](_0xd825('0x44'),new Buffer(_0x46bd9b)['toString'](_0xd825('0x46')))},'json':!![]};rp(_0x4cc6f5)[_0xd825('0x1a')](function(_0x3cab57){var _0x573852={'messageId':_0x3cab57[_0xd825('0x50')][0x0]};return _0x644067[_0xd825('0x1b')](_0x573852);})['catch'](function(_0x5df15d){logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x4c'),util[_0xd825('0x38')](_0x5df15d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x4c'),_0xd825('0x51'));}break;case _0xd825('0x52'):if(_0x5161b6[_0xd825('0x2d')]&&_0x5161b6[_0xd825('0x3f')]){if(_0x5161b6[_0xd825('0x53')]){var _0x245630={'method':_0xd825('0x31'),'uri':_0x5161b6[_0xd825('0x53')]+_0xd825('0x54'),'body':{'username':_0x5161b6[_0xd825('0x2d')],'password':_0x5161b6[_0xd825('0x3f')]},'json':!![]};return rp(_0x245630)[_0xd825('0x1a')](function(_0x30bd1a){var _0x3bd99b={'method':_0xd825('0x31'),'uri':_0x5161b6[_0xd825('0x53')]+_0xd825('0x55'),'body':{'messages':[{'from':_0x5161b6[_0xd825('0x26')],'destinations':[{'to':_0x10a887[_0xd825('0x26')]}],'text':_0x10a887[_0xd825('0xd')],'notifyUrl':_0x5161b6[_0xd825('0x56')]+'/api/sms/messages/'+_0x10a887['id']+_0xd825('0x28')+_0x5161b6[_0xd825('0x4e')],'notifyContentType':'application/json','callbackData':_0x5161b6['phone']+';'+_0x10a887[_0xd825('0xd')]}]},'headers':{'Authorization':_0xd825('0x57')+_0x30bd1a[_0xd825('0x4e')]},'json':!![]};return rp(_0x3bd99b)['then'](function(_0x1bee09){if(_0x1bee09[_0xd825('0x25')]){var _0x1d1d65={'messageId':_0x1bee09[_0xd825('0x25')][0x0]['messageId']};if(!_0x5161b6[_0xd825('0x35')]){_0x1d1d65['read']=!![];}return _0x644067[_0xd825('0x1b')](_0x1d1d65);}else{return logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x52'),util['inspect'](_0x1bee09,{'showHidden':![],'depth':null}));}});})[_0xd825('0x1d')](function(_0x147721){return logger['error'](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x52'),util[_0xd825('0x38')](_0x147721,{'showHidden':![],'depth':null}));});}else{logger[_0xd825('0x1e')](_0xd825('0x2a'),'afterCreate','infobip',_0xd825('0x58'));}}else{logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x52'),_0xd825('0x39'));}break;case _0xd825('0x59'):var _0x51857e=require('crypto');if(_0x5161b6[_0xd825('0x5a')]){var _0x4d0ce2={};_0x4d0ce2['login']=_0x5161b6['username'];_0x4d0ce2['phone']=_0x10a887[_0xd825('0x26')];_0x4d0ce2[_0xd825('0x5b')]=_0x5161b6['phone'];_0x4d0ce2['text']=_0x10a887[_0xd825('0xd')];_0x4d0ce2[_0xd825('0x5c')]=+new Date();var _0x4bcdb9='';var _0x35473c='';var _0x9f0092=Object[_0xd825('0x5d')](_0x4d0ce2);_0x9f0092[_0xd825('0x5e')]();for(var _0x9b5f36=0x0;_0x9b5f36<_0x9f0092[_0xd825('0x5f')];_0x9b5f36++){if(_0x4bcdb9!=''){_0x4bcdb9+='&';}_0x4bcdb9+=_0x9f0092[_0x9b5f36]+'='+encodeURIComponent(_0x4d0ce2[_0x9f0092[_0x9b5f36]]);_0x35473c+=_0x4d0ce2[_0x9f0092[_0x9b5f36]];}_0x35473c+=_0x5161b6[_0xd825('0x5a')];_0x35473c=_0x51857e[_0xd825('0x60')](_0xd825('0x61'))[_0xd825('0x1b')](_0x35473c)[_0xd825('0x62')](_0xd825('0x63'));if(_0x4bcdb9!==''){_0x4bcdb9+='&';}_0x4bcdb9+=_0xd825('0x64')+_0x35473c;var _0x444fa5={'method':_0xd825('0x2f'),'uri':_0x5161b6[_0xd825('0x53')]+_0xd825('0x65')+_0x4bcdb9,'json':!![]};return rp(_0x444fa5)['then'](function(_0x57702f){var _0x3e5707=Object['keys'](_0x57702f);if(_0x57702f[_0x3e5707[0x0]][_0xd825('0x1e')]&&parseInt(_0x57702f[_0x3e5707[0x0]]['error'])===0x0){var _0x408936={'messageId':_0x57702f[_0x3e5707[0x0]][_0xd825('0x66')]};if(!_0x5161b6[_0xd825('0x35')]){_0x408936[_0xd825('0x36')]=!![];}return _0x644067[_0xd825('0x1b')](_0x408936);}else{return logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x59'),util[_0xd825('0x38')](_0x57702f[_0xd825('0x1e')],{'showHidden':![],'depth':null}));}})[_0xd825('0x1d')](function(_0x53ffbf){return logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x59'),util[_0xd825('0x38')](_0x53ffbf,{'showHidden':![],'depth':null}));});}else{logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x59'),'Missing\x20parameters:\x20apiKey');}break;case _0xd825('0x67'):if(_0x5161b6[_0xd825('0x5a')]){var _0x47bf3b={'method':_0xd825('0x31'),'uri':_0xd825('0x68'),'headers':{'Authorization':_0x5161b6['apiKey']},'body':{'content':_0x10a887[_0xd825('0xd')],'to':[_0x10a887[_0xd825('0x26')]],'from':_0x5161b6['phone'],'binary':![],'clientMessageId':_0xd825('0x69'),'charset':_0xd825('0x6a')},'json':!![]};rp(_0x47bf3b)['then'](function(_0xf5f557){if(!_0xf5f557[_0xd825('0x1e')]){var _0x3b1ae5={'messageId':_0xf5f557['messages'][0x0]['apiMessageId']};if(!_0x5161b6[_0xd825('0x35')]){_0x3b1ae5['read']=!![];}return _0x644067[_0xd825('0x1b')](_0x3b1ae5);}else{return logger[_0xd825('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd825('0x67'),util[_0xd825('0x38')](_0xf5f557[_0xd825('0x1e')],{'showHidden':![],'depth':null}));}})['catch'](function(_0xf49595){return logger[_0xd825('0x1e')](_0xd825('0x2a'),'afterCreate',_0xd825('0x67'),util['inspect'](_0xf49595,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd825('0x2a'),'afterCreate','clickatell',_0xd825('0x6b'));}break;case _0xd825('0x6c'):if(_0x5161b6[_0xd825('0x2d')]&&_0x5161b6[_0xd825('0x3f')]){var _0x46bd9b=util['format'](_0xd825('0x41'),_0x5161b6[_0xd825('0x2d')],_0x5161b6[_0xd825('0x3f')]);var _0x4cc6f5={'method':_0xd825('0x31'),'uri':_0xd825('0x6d')+_0x5161b6['accountId']+_0xd825('0x6e'),'body':{'to':[_0x10a887[_0xd825('0x26')]],'text':_0x10a887['body'],'from':_0x5161b6[_0xd825('0x26')],'applicationId':_0x5161b6[_0xd825('0x6f')]},'headers':{'Authorization':util[_0xd825('0x43')]('Basic\x20%s',new Buffer(_0x46bd9b)[_0xd825('0x45')]('base64'))},'json':!![]};rp(_0x4cc6f5)[_0xd825('0x1a')](function(_0x55b963){if(_0x55b963['id']){var _0x3f8915={'messageId':_0x55b963['id']};return _0x644067['update'](_0x3f8915);}else{logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x6c'),util['inspect'](_0x55b963,{'showHidden':![],'depth':null}));}})['catch'](function(_0x149d25){logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),'bandwidth',util[_0xd825('0x38')](_0x149d25,{'showHidden':![],'depth':null}));});}else{logger[_0xd825('0x1e')](_0xd825('0x2a'),'afterCreate',_0xd825('0x6c'),_0xd825('0x39'));}break;case _0xd825('0x70'):if(_0x5161b6[_0xd825('0x5a')]){var _0x3bb417={};var _0x444fa5={'method':'POST','uri':_0xd825('0x71'),'headers':{'Authorization':_0xd825('0x72')+_0x5161b6['apiKey'],'Content-Type':_0xd825('0x73')},'body':{'from':_0x5161b6[_0xd825('0x26')],'to':_0x10a887['phone'],'text':_0x10a887[_0xd825('0xd')]},'json':!![]};return rp(_0x444fa5)[_0xd825('0x1a')](function(_0x350f09){if(_0x350f09[_0xd825('0x74')]==0xca){_0x3bb417[_0xd825('0x75')]=_0x350f09;var _0x5214eb={'method':_0xd825('0x31'),'uri':_0xd825('0x76'),'headers':{'Authorization':_0xd825('0x72')+_0x5161b6[_0xd825('0x5a')],'Content-Type':_0xd825('0x73')},'body':{'refid':_0x3bb417[_0xd825('0x75')]['refid']},'json':!![]};return rp(_0x5214eb)[_0xd825('0x1a')](function(_0x2e6525){_0x3bb417[_0xd825('0x77')]=_0x2e6525;var _0x2633e3={'messageId':_0x3bb417['message'][_0xd825('0x78')],'read':!![]};return _0x644067[_0xd825('0x1b')](_0x2633e3);});}else{return logger[_0xd825('0x1e')](_0xd825('0x2a'),_0xd825('0x2b'),'intelepeer',util['inspect'](_0x350f09,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2364da){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd825('0x70'),util[_0xd825('0x38')](_0x2364da,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xd825('0x2a'),_0xd825('0x2b'),_0xd825('0x70'),'Token\x20not\x20received');}break;}}})[_0xd825('0x79')](function(){_0x40ca0b();});}else{_0x40ca0b();}}},'charset':_0xd825('0x7a'),'collate':_0xd825('0x7b')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index fda4b3e..15b79f3 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 _0x4a2e=['message','result','CreateSmsMessage','create','options','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x4cc6f6,_0xb80ef){var _0x3bf0c9=function(_0x4b7f22){while(--_0x4b7f22){_0x4cc6f6['push'](_0x4cc6f6['shift']());}};_0x3bf0c9(++_0xb80ef);}(_0x4a2e,0x64));var _0xe4a2=function(_0x4ae58a,_0x72bd08){_0x4ae58a=_0x4ae58a-0x0;var _0x3c0445=_0x4a2e[_0x4ae58a];return _0x3c0445;};'use strict';var _=require('lodash');var util=require(_0xe4a2('0x0'));var moment=require(_0xe4a2('0x1'));var BPromise=require(_0xe4a2('0x2'));var rs=require(_0xe4a2('0x3'));var fs=require('fs');var Redis=require(_0xe4a2('0x4'));var db=require(_0xe4a2('0x5'))['db'];var utils=require(_0xe4a2('0x6'));var logger=require(_0xe4a2('0x7'))(_0xe4a2('0x8'));var config=require('../../config/environment');var jayson=require(_0xe4a2('0x9'));var client=jayson[_0xe4a2('0xa')][_0xe4a2('0xb')]({'port':0x232a});config[_0xe4a2('0xc')]=_[_0xe4a2('0xd')](config[_0xe4a2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe4a2('0xe'))(new Redis(config['redis']));require(_0xe4a2('0xf'))[_0xe4a2('0x10')](socket);function respondWithRpcPromise(_0x4760ab,_0xfd23a3,_0x10ec87){return new BPromise(function(_0x2cf032,_0x58c69d){return client[_0xe4a2('0x11')](_0x4760ab,_0x10ec87)[_0xe4a2('0x12')](function(_0x49320c){logger[_0xe4a2('0x13')](_0xe4a2('0x14'),_0xfd23a3,_0xe4a2('0x15'));logger['debug'](_0xe4a2('0x16'),_0xfd23a3,'request\x20sent',JSON['stringify'](_0x49320c));if(_0x49320c[_0xe4a2('0x17')]){if(_0x49320c[_0xe4a2('0x17')]['code']===0x1f4){logger[_0xe4a2('0x17')](_0xe4a2('0x14'),_0xfd23a3,_0x49320c[_0xe4a2('0x17')][_0xe4a2('0x18')]);return _0x58c69d(_0x49320c[_0xe4a2('0x17')]['message']);}logger[_0xe4a2('0x17')]('SmsMessage,\x20%s,\x20%s',_0xfd23a3,_0x49320c['error'][_0xe4a2('0x18')]);return _0x2cf032(_0x49320c[_0xe4a2('0x17')][_0xe4a2('0x18')]);}else{logger[_0xe4a2('0x13')](_0xe4a2('0x14'),_0xfd23a3,_0xe4a2('0x15'));_0x2cf032(_0x49320c[_0xe4a2('0x19')]['message']);}})['catch'](function(_0x3ec5c1){logger[_0xe4a2('0x17')](_0xe4a2('0x14'),_0xfd23a3,_0x3ec5c1);_0x58c69d(_0x3ec5c1);});});}exports[_0xe4a2('0x1a')]=function(_0x120cfc){var _0x5d55d4=this;return new Promise(function(_0x54a8d8,_0x4a4f20){return db['SmsMessage'][_0xe4a2('0x1b')](_0x120cfc['body'],{'raw':_0x120cfc[_0xe4a2('0x1c')]?_0x120cfc[_0xe4a2('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xe4a2('0x12')](function(_0x177372){logger['info'](_0xe4a2('0x1a'),_0x120cfc);logger[_0xe4a2('0x1d')]('CreateSmsMessage',_0x120cfc,JSON['stringify'](_0x177372));_0x54a8d8(_0x177372);})[_0xe4a2('0x1e')](function(_0x3cf43a){logger[_0xe4a2('0x17')]('CreateSmsMessage',_0x3cf43a['message'],_0x120cfc);_0x4a4f20(_0x5d55d4[_0xe4a2('0x17')](0x1f4,_0x3cf43a[_0xe4a2('0x18')]));});});}; \ No newline at end of file +var _0x4645=['defaults','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','CreateSmsMessage','body','options','raw','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x50c09e,_0x1c4dbb){var _0x355565=function(_0x405cf6){while(--_0x405cf6){_0x50c09e['push'](_0x50c09e['shift']());}};_0x355565(++_0x1c4dbb);}(_0x4645,0x152));var _0x5464=function(_0x33d20e,_0x3d4cb4){_0x33d20e=_0x33d20e-0x0;var _0x2844a5=_0x4645[_0x33d20e];return _0x2844a5;};'use strict';var _=require(_0x5464('0x0'));var util=require('util');var moment=require(_0x5464('0x1'));var BPromise=require('bluebird');var rs=require(_0x5464('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5464('0x3'));var logger=require(_0x5464('0x4'))(_0x5464('0x5'));var config=require(_0x5464('0x6'));var jayson=require(_0x5464('0x7'));var client=jayson['client'][_0x5464('0x8')]({'port':0x232a});config[_0x5464('0x9')]=_[_0x5464('0xa')](config[_0x5464('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x5464('0xb'))(new Redis(config[_0x5464('0x9')]));require('./smsMessage.socket')[_0x5464('0xc')](socket);function respondWithRpcPromise(_0x3812bf,_0x125275,_0x3badc6){return new BPromise(function(_0x5bbe00,_0x2b93df){return client[_0x5464('0xd')](_0x3812bf,_0x3badc6)[_0x5464('0xe')](function(_0x15470d){logger[_0x5464('0xf')](_0x5464('0x10'),_0x125275,_0x5464('0x11'));logger[_0x5464('0x12')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x125275,_0x5464('0x11'),JSON[_0x5464('0x13')](_0x15470d));if(_0x15470d['error']){if(_0x15470d['error'][_0x5464('0x14')]===0x1f4){logger[_0x5464('0x15')](_0x5464('0x10'),_0x125275,_0x15470d[_0x5464('0x15')]['message']);return _0x2b93df(_0x15470d[_0x5464('0x15')][_0x5464('0x16')]);}logger[_0x5464('0x15')](_0x5464('0x10'),_0x125275,_0x15470d[_0x5464('0x15')]['message']);return _0x5bbe00(_0x15470d[_0x5464('0x15')][_0x5464('0x16')]);}else{logger[_0x5464('0xf')](_0x5464('0x10'),_0x125275,_0x5464('0x11'));_0x5bbe00(_0x15470d[_0x5464('0x17')][_0x5464('0x16')]);}})[_0x5464('0x18')](function(_0x3730d3){logger[_0x5464('0x15')](_0x5464('0x10'),_0x125275,_0x3730d3);_0x2b93df(_0x3730d3);});});}exports[_0x5464('0x19')]=function(_0xb9826a){var _0x442bb5=this;return new Promise(function(_0x3ee07a,_0x36fc9a){return db['SmsMessage']['create'](_0xb9826a[_0x5464('0x1a')],{'raw':_0xb9826a[_0x5464('0x1b')]?_0xb9826a[_0x5464('0x1b')][_0x5464('0x1c')]===undefined?!![]:![]:!![]})[_0x5464('0xe')](function(_0x33104c){logger[_0x5464('0xf')](_0x5464('0x19'),_0xb9826a);logger['debug'](_0x5464('0x19'),_0xb9826a,JSON[_0x5464('0x13')](_0x33104c));_0x3ee07a(_0x33104c);})[_0x5464('0x18')](function(_0x28905f){logger[_0x5464('0x15')](_0x5464('0x19'),_0x28905f[_0x5464('0x16')],_0xb9826a);_0x36fc9a(_0x442bb5[_0x5464('0x15')](0x1f4,_0x28905f[_0x5464('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index f948dc0..864a7d6 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 _0x34af=['register','length','smsMessage:','emit','removeListener'];(function(_0x99675b,_0x25bfee){var _0x417997=function(_0x6c32cd){while(--_0x6c32cd){_0x99675b['push'](_0x99675b['shift']());}};_0x417997(++_0x25bfee);}(_0x34af,0x67));var _0xf34a=function(_0xbf5fc0,_0x310afc){_0xbf5fc0=_0xbf5fc0-0x0;var _0x29a4c1=_0x34af[_0xbf5fc0];return _0x29a4c1;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save','remove','update'];function createListener(_0x3d5821,_0x734e73){return function(_0x200a35){_0x734e73[_0xf34a('0x0')](_0x3d5821,_0x200a35);};}function removeListener(_0x2de7ee,_0xbb05c2){return function(){SmsMessageEvents[_0xf34a('0x1')](_0x2de7ee,_0xbb05c2);};}exports[_0xf34a('0x2')]=function(_0x5c8714){for(var _0x20aabb=0x0,_0x5513e8=events[_0xf34a('0x3')];_0x20aabb<_0x5513e8;_0x20aabb++){var _0x54f5c3=events[_0x20aabb];var _0x481053=createListener(_0xf34a('0x4')+_0x54f5c3,_0x5c8714);SmsMessageEvents['on'](_0x54f5c3,_0x481053);}}; \ No newline at end of file +var _0x0897=['smsMessage:','./smsMessage.events','save','remove','update','removeListener','length'];(function(_0x56fcf6,_0x401b3c){var _0x2078a7=function(_0x4f2790){while(--_0x4f2790){_0x56fcf6['push'](_0x56fcf6['shift']());}};_0x2078a7(++_0x401b3c);}(_0x0897,0x135));var _0x7089=function(_0x463499,_0x41c22d){_0x463499=_0x463499-0x0;var _0x5dccb2=_0x0897[_0x463499];return _0x5dccb2;};'use strict';var SmsMessageEvents=require(_0x7089('0x0'));var events=[_0x7089('0x1'),_0x7089('0x2'),_0x7089('0x3')];function createListener(_0x38d97c,_0x3dfafe){return function(_0x199a38){_0x3dfafe['emit'](_0x38d97c,_0x199a38);};}function removeListener(_0x1f2465,_0x1e8963){return function(){SmsMessageEvents[_0x7089('0x4')](_0x1f2465,_0x1e8963);};}exports['register']=function(_0x2b9cbc){for(var _0x29d818=0x0,_0x40cb58=events[_0x7089('0x5')];_0x29d818<_0x40cb58;_0x29d818++){var _0x158e14=events[_0x29d818];var _0x3c6e22=createListener(_0x7089('0x6')+_0x158e14,_0x2b9cbc);SmsMessageEvents['on'](_0x158e14,_0x3c6e22);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 9d2fe22..2dd5bac 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 _0x004c=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','delete','destroy','removeAgents','exports','util','path'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x004c,0xe8));var _0xc004=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x004c[_0xfa634c];return _0x73e478;};'use strict';var multer=require('multer');var util=require(_0xc004('0x0'));var path=require(_0xc004('0x1'));var timeout=require(_0xc004('0x2'));var express=require('express');var router=express[_0xc004('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc004('0x4'));var interaction=require(_0xc004('0x5'));var config=require('../../config/environment');var controller=require(_0xc004('0x6'));router[_0xc004('0x7')]('/',auth[_0xc004('0x8')](),controller[_0xc004('0x9')]);router['get'](_0xc004('0xa'),auth[_0xc004('0x8')](),controller[_0xc004('0xb')]);router[_0xc004('0x7')](_0xc004('0xc'),auth[_0xc004('0x8')](),controller[_0xc004('0xd')]);router[_0xc004('0x7')](_0xc004('0xe'),auth[_0xc004('0x8')](),controller['getMembers']);router[_0xc004('0x7')](_0xc004('0xf'),auth[_0xc004('0x8')](),controller['getTeams']);router[_0xc004('0x7')](_0xc004('0x10'),auth['isAuthenticated'](),controller[_0xc004('0x11')]);router[_0xc004('0x12')]('/',auth[_0xc004('0x8')](),controller[_0xc004('0x13')]);router[_0xc004('0x12')](_0xc004('0xf'),auth['isAuthenticated'](),controller[_0xc004('0x14')]);router[_0xc004('0x12')](_0xc004('0x10'),auth[_0xc004('0x8')](),controller[_0xc004('0x15')]);router['put'](_0xc004('0xc'),auth[_0xc004('0x8')](),controller['update']);router[_0xc004('0x16')](_0xc004('0xc'),auth[_0xc004('0x8')](),controller[_0xc004('0x17')]);router[_0xc004('0x16')](_0xc004('0xf'),auth[_0xc004('0x8')](),controller['removeTeams']);router['delete'](_0xc004('0x10'),auth[_0xc004('0x8')](),controller[_0xc004('0x18')]);module[_0xc004('0x19')]=router; \ No newline at end of file +var _0xaa25=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','delete','destroy','removeTeams','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x190cbc,_0x988b4e){var _0x484f99=function(_0x4dfa59){while(--_0x4dfa59){_0x190cbc['push'](_0x190cbc['shift']());}};_0x484f99(++_0x988b4e);}(_0xaa25,0x1ed));var _0x5aa2=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xaa25[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0x5aa2('0x0'));var util=require(_0x5aa2('0x1'));var path=require(_0x5aa2('0x2'));var timeout=require('connect-timeout');var express=require(_0x5aa2('0x3'));var router=express[_0x5aa2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5aa2('0x5'));var interaction=require(_0x5aa2('0x6'));var config=require(_0x5aa2('0x7'));var controller=require('./smsQueue.controller');router[_0x5aa2('0x8')]('/',auth[_0x5aa2('0x9')](),controller['index']);router[_0x5aa2('0x8')](_0x5aa2('0xa'),auth[_0x5aa2('0x9')](),controller[_0x5aa2('0xb')]);router[_0x5aa2('0x8')](_0x5aa2('0xc'),auth['isAuthenticated'](),controller[_0x5aa2('0xd')]);router[_0x5aa2('0x8')](_0x5aa2('0xe'),auth[_0x5aa2('0x9')](),controller['getMembers']);router[_0x5aa2('0x8')](_0x5aa2('0xf'),auth[_0x5aa2('0x9')](),controller[_0x5aa2('0x10')]);router['get'](_0x5aa2('0x11'),auth[_0x5aa2('0x9')](),controller[_0x5aa2('0x12')]);router[_0x5aa2('0x13')]('/',auth[_0x5aa2('0x9')](),controller['create']);router[_0x5aa2('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5aa2('0x14')]);router[_0x5aa2('0x13')]('/:id/users',auth[_0x5aa2('0x9')](),controller['addAgents']);router['put'](_0x5aa2('0xc'),auth[_0x5aa2('0x9')](),controller['update']);router[_0x5aa2('0x15')](_0x5aa2('0xc'),auth['isAuthenticated'](),controller[_0x5aa2('0x16')]);router[_0x5aa2('0x15')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5aa2('0x17')]);router['delete'](_0x5aa2('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x5aa2('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 1eefead..b358430 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 _0xde84=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1aaa62,_0x2c74d8){var _0x110b39=function(_0x72ba2a){while(--_0x72ba2a){_0x1aaa62['push'](_0x1aaa62['shift']());}};_0x110b39(++_0x2c74d8);}(_0xde84,0x132));var _0x4de8=function(_0x2b949e,_0x559d7e){_0x2b949e=_0x2b949e-0x0;var _0x403566=_0xde84[_0x2b949e];return _0x403566;};'use strict';var Sequelize=require(_0x4de8('0x0'));module[_0x4de8('0x1')]={'name':{'type':Sequelize[_0x4de8('0x2')],'unique':_0x4de8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4de8('0x2')]},'timeout':{'type':Sequelize[_0x4de8('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4de8('0x5')](_0x4de8('0x6'),_0x4de8('0x7'),_0x4de8('0x8'))}}; \ No newline at end of file +var _0x5e9c=['beepall','roundrobin','sequelize','STRING','INTEGER','rrmemory'];(function(_0x102881,_0x58d723){var _0x5c63d0=function(_0x955c59){while(--_0x955c59){_0x102881['push'](_0x102881['shift']());}};_0x5c63d0(++_0x58d723);}(_0x5e9c,0x1e2));var _0xc5e9=function(_0x506563,_0x2ba439){_0x506563=_0x506563-0x0;var _0x5cbe67=_0x5e9c[_0x506563];return _0x5cbe67;};'use strict';var Sequelize=require(_0xc5e9('0x0'));module['exports']={'name':{'type':Sequelize[_0xc5e9('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc5e9('0x1')]},'timeout':{'type':Sequelize[_0xc5e9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc5e9('0x3'),_0xc5e9('0x4'),_0xc5e9('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b8fb40d..87b9729 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 _0x7177=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','error','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','SmsQueue','includeAll','include','rows','catch','params','keys','find','body','user','role','UserProfileSection','autoAssociation','create','describe','getMembers','findOne','UserSmsQueue','nolimit','SmsQueueId','findAll','findAndCountAll','UserId','agent','smsPause','updatedAt','format','SIP','createdAt','Team','getTeams','User','Agents','online','voicePause','interface','flatMap','addTeams','each','forEach','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_sms_queues','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','transaction','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0x7177,0x101));var _0x7717=function(_0x1b4695,_0x3a90e3){_0x1b4695=_0x1b4695-0x0;var _0x376a90=_0x7177[_0x1b4695];return _0x376a90;};'use strict';var emlformat=require(_0x7717('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7717('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7717('0x2'));var moment=require(_0x7717('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7717('0x4'));var util=require(_0x7717('0x5'));var path=require('path');var sox=require(_0x7717('0x6'));var csv=require(_0x7717('0x7'));var ejs=require(_0x7717('0x8'));var fs=require('fs');var fs_extra=require(_0x7717('0x9'));var _=require(_0x7717('0xa'));var squel=require(_0x7717('0xb'));var crypto=require(_0x7717('0xc'));var jsforce=require(_0x7717('0xd'));var deskjs=require(_0x7717('0xe'));var toCsv=require(_0x7717('0x7'));var querystring=require(_0x7717('0xf'));var Papa=require('papaparse');var Redis=require(_0x7717('0x10'));var authService=require(_0x7717('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7717('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7717('0x13'))(_0x7717('0x14'));var utils=require(_0x7717('0x15'));var config=require(_0x7717('0x16'));var licenseUtil=require(_0x7717('0x17'));var db=require('../../mysqldb')['db'];config[_0x7717('0x18')]=_[_0x7717('0x19')](config[_0x7717('0x18')],{'host':_0x7717('0x1a'),'port':0x18eb});var socket=require(_0x7717('0x1b'))(new Redis(config[_0x7717('0x18')]));require(_0x7717('0x1c'))['register'](socket);function respondWithStatusCode(_0xcb6d5c,_0x2cbe7b){_0x2cbe7b=_0x2cbe7b||0xcc;return function(_0x445bfd){if(_0x445bfd){return _0xcb6d5c[_0x7717('0x1d')](_0x2cbe7b);}return _0xcb6d5c[_0x7717('0x1e')](_0x2cbe7b)[_0x7717('0x1f')]();};}function respondWithResult(_0x1a63c4,_0x54671f){_0x54671f=_0x54671f||0xc8;return function(_0x546926){if(_0x546926){return _0x1a63c4[_0x7717('0x1e')](_0x54671f)['json'](_0x546926);}};}function respondWithFilteredResult(_0x2c9333,_0x48441c){return function(_0x11940a){if(_0x11940a){var _0x11fd4c=typeof _0x48441c[_0x7717('0x20')]==='undefined'&&typeof _0x48441c[_0x7717('0x21')]===_0x7717('0x22');var _0x4513d2=_0x11940a[_0x7717('0x23')];var _0x7c44aa=_0x11fd4c?0x0:_0x48441c['offset'];var _0x2c25c5=_0x11fd4c?_0x11940a[_0x7717('0x23')]:_0x48441c[_0x7717('0x20')]+_0x48441c[_0x7717('0x21')];var _0x54039f;if(_0x2c25c5>=_0x4513d2){_0x2c25c5=_0x4513d2;_0x54039f=0xc8;}else{_0x54039f=0xce;}_0x2c9333[_0x7717('0x1e')](_0x54039f);return _0x2c9333[_0x7717('0x24')](_0x7717('0x25'),_0x7c44aa+'-'+_0x2c25c5+'/'+_0x4513d2)['json'](_0x11940a);}return null;};}function patchUpdates(_0xd36587){return function(_0x31c2f6){try{jsonpatch[_0x7717('0x26')](_0x31c2f6,_0xd36587,!![]);}catch(_0x52abe9){return BPromise[_0x7717('0x27')](_0x52abe9);}return _0x31c2f6[_0x7717('0x28')]();};}function saveUpdates(_0x2e9001,_0x32ee21){return function(_0x1ab276){if(_0x1ab276){return _0x1ab276[_0x7717('0x29')](_0x2e9001)['then'](function(_0x33e592){return _0x33e592;});}return null;};}function removeEntity(_0x584fa6,_0x431d91){return function(_0x39fc4f){if(_0x39fc4f){return _0x39fc4f[_0x7717('0x2a')]()[_0x7717('0x2b')](function(){var _0xa4428b=_0x39fc4f[_0x7717('0x2c')]({'plain':!![]});var _0x7fa7a7='SmsQueues';return db[_0x7717('0x2d')][_0x7717('0x2a')]({'where':{'type':_0x7fa7a7,'resourceId':_0xa4428b['id']}})[_0x7717('0x2b')](function(){return _0x39fc4f;});})[_0x7717('0x2b')](function(){_0x584fa6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b33dd,_0x566a8b){return function(_0x145986){if(!_0x145986){_0x5b33dd['sendStatus'](0x194);}return _0x145986;};}function handleError(_0x2090eb,_0x29330e){_0x29330e=_0x29330e||0x1f4;return function(_0x18c831){logger[_0x7717('0x2e')](_0x18c831['stack']);if(_0x18c831['name']){delete _0x18c831['name'];}_0x2090eb[_0x7717('0x1e')](_0x29330e)['send'](_0x18c831);};}exports['index']=function(_0x5bc64d,_0x18bf7a){var _0x2bf307={},_0x110c82={},_0x4b667d={'count':0x0,'rows':[]};var _0x39451f=_[_0x7717('0x2f')](db['SmsQueue'][_0x7717('0x30')],function(_0x5d631b){return{'name':_0x5d631b[_0x7717('0x31')],'type':_0x5d631b[_0x7717('0x32')]['key']};});_0x110c82[_0x7717('0x33')]=_[_0x7717('0x2f')](_0x39451f,'name');_0x110c82[_0x7717('0x34')]=_['keys'](_0x5bc64d[_0x7717('0x34')]);_0x110c82[_0x7717('0x35')]=_['intersection'](_0x110c82[_0x7717('0x33')],_0x110c82[_0x7717('0x34')]);_0x2bf307['attributes']=_[_0x7717('0x36')](_0x110c82['model'],qs[_0x7717('0x37')](_0x5bc64d[_0x7717('0x34')][_0x7717('0x37')]));_0x2bf307[_0x7717('0x38')]=_0x2bf307[_0x7717('0x38')][_0x7717('0x39')]?_0x2bf307[_0x7717('0x38')]:_0x110c82['model'];if(!_0x5bc64d['query'][_0x7717('0x3a')]('nolimit')){_0x2bf307[_0x7717('0x21')]=qs['limit'](_0x5bc64d[_0x7717('0x34')][_0x7717('0x21')]);_0x2bf307[_0x7717('0x20')]=qs[_0x7717('0x20')](_0x5bc64d[_0x7717('0x34')]['offset']);}_0x2bf307[_0x7717('0x3b')]=qs[_0x7717('0x3c')](_0x5bc64d[_0x7717('0x34')][_0x7717('0x3c')]);_0x2bf307[_0x7717('0x3d')]=qs[_0x7717('0x35')](_[_0x7717('0x3e')](_0x5bc64d[_0x7717('0x34')],_0x110c82[_0x7717('0x35')]),_0x39451f);if(_0x5bc64d['query'][_0x7717('0x3f')]){_0x2bf307['where']=_[_0x7717('0x40')](_0x2bf307[_0x7717('0x3d')],{'$or':_[_0x7717('0x2f')](_0x39451f,function(_0x260ad2){if(_0x260ad2[_0x7717('0x32')]!==_0x7717('0x41')){var _0x3a42f1={};_0x3a42f1[_0x260ad2[_0x7717('0x42')]]={'$like':'%'+_0x5bc64d[_0x7717('0x34')]['filter']+'%'};return _0x3a42f1;}})});}_0x2bf307=_[_0x7717('0x40')]({},_0x2bf307,_0x5bc64d[_0x7717('0x43')]);var _0x52d39d={'where':_0x2bf307[_0x7717('0x3d')]};return db[_0x7717('0x44')][_0x7717('0x23')](_0x52d39d)['then'](function(_0x32be90){_0x4b667d[_0x7717('0x23')]=_0x32be90;if(_0x5bc64d[_0x7717('0x34')][_0x7717('0x45')]){_0x2bf307[_0x7717('0x46')]=[{'all':!![]}];}return db[_0x7717('0x44')]['findAll'](_0x2bf307);})[_0x7717('0x2b')](function(_0x1376de){_0x4b667d[_0x7717('0x47')]=_0x1376de;return _0x4b667d;})['then'](respondWithFilteredResult(_0x18bf7a,_0x2bf307))[_0x7717('0x48')](handleError(_0x18bf7a,null));};exports['show']=function(_0x3f5405,_0x1601eb){var _0xff4d69={'raw':!![],'where':{'id':_0x3f5405[_0x7717('0x49')]['id']}},_0x53a420={};_0x53a420[_0x7717('0x33')]=_['keys'](db[_0x7717('0x44')][_0x7717('0x30')]);_0x53a420[_0x7717('0x34')]=_[_0x7717('0x4a')](_0x3f5405[_0x7717('0x34')]);_0x53a420[_0x7717('0x35')]=_[_0x7717('0x36')](_0x53a420['model'],_0x53a420['query']);_0xff4d69[_0x7717('0x38')]=_[_0x7717('0x36')](_0x53a420[_0x7717('0x33')],qs[_0x7717('0x37')](_0x3f5405[_0x7717('0x34')][_0x7717('0x37')]));_0xff4d69['attributes']=_0xff4d69[_0x7717('0x38')][_0x7717('0x39')]?_0xff4d69[_0x7717('0x38')]:_0x53a420['model'];if(_0x3f5405[_0x7717('0x34')][_0x7717('0x45')]){_0xff4d69[_0x7717('0x46')]=[{'all':!![]}];}_0xff4d69=_[_0x7717('0x40')]({},_0xff4d69,_0x3f5405[_0x7717('0x43')]);return db['SmsQueue'][_0x7717('0x4b')](_0xff4d69)['then'](handleEntityNotFound(_0x1601eb,null))[_0x7717('0x2b')](respondWithResult(_0x1601eb,null))[_0x7717('0x48')](handleError(_0x1601eb,null));};exports['create']=function(_0x566ad7,_0x377d5d){return db['SmsQueue']['create'](_0x566ad7[_0x7717('0x4c')],{})[_0x7717('0x2b')](function(_0x1ca8e5){var _0x549f61=_0x566ad7[_0x7717('0x4d')]['get']({'plain':!![]});if(!_0x549f61)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x549f61[_0x7717('0x4e')]===_0x7717('0x4d')){var _0x3385ad=_0x1ca8e5[_0x7717('0x2c')]({'plain':!![]});var _0x44304f='SmsQueues';return db[_0x7717('0x4f')][_0x7717('0x4b')]({'where':{'name':_0x44304f,'userProfileId':_0x549f61['userProfileId']},'raw':!![]})[_0x7717('0x2b')](function(_0x1767ba){if(_0x1767ba&&_0x1767ba[_0x7717('0x50')]===0x0){return db[_0x7717('0x2d')][_0x7717('0x51')]({'name':_0x3385ad[_0x7717('0x42')],'resourceId':_0x3385ad['id'],'type':_0x1767ba['name'],'sectionId':_0x1767ba['id']},{})[_0x7717('0x2b')](function(){return _0x1ca8e5;});}else{return _0x1ca8e5;}})[_0x7717('0x48')](function(_0x2f5ba8){logger[_0x7717('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f5ba8);throw _0x2f5ba8;});}return _0x1ca8e5;})[_0x7717('0x2b')](respondWithResult(_0x377d5d,0xc9))['catch'](handleError(_0x377d5d,null));};exports[_0x7717('0x29')]=function(_0x55167b,_0x45d26a){if(_0x55167b['body']['id']){delete _0x55167b[_0x7717('0x4c')]['id'];}return db[_0x7717('0x44')][_0x7717('0x4b')]({'where':{'id':_0x55167b['params']['id']}})[_0x7717('0x2b')](handleEntityNotFound(_0x45d26a,null))['then'](saveUpdates(_0x55167b['body'],null))[_0x7717('0x2b')](respondWithResult(_0x45d26a,null))[_0x7717('0x48')](handleError(_0x45d26a,null));};exports['destroy']=function(_0x534949,_0x421d03){return db[_0x7717('0x44')][_0x7717('0x4b')]({'where':{'id':_0x534949[_0x7717('0x49')]['id']}})['then'](handleEntityNotFound(_0x421d03,null))[_0x7717('0x2b')](removeEntity(_0x421d03,null))[_0x7717('0x48')](handleError(_0x421d03,null));};exports[_0x7717('0x52')]=function(_0x1e146,_0x192469){return db[_0x7717('0x44')][_0x7717('0x52')]()[_0x7717('0x2b')](respondWithResult(_0x192469,null))[_0x7717('0x48')](handleError(_0x192469,null));};exports[_0x7717('0x53')]=function(_0x1dced2,_0x939d4a,_0x3e997d){var _0x4bc26a={'raw':!![],'where':{}},_0x59c136={},_0x542f5b;return db[_0x7717('0x44')][_0x7717('0x54')]({'where':{'id':_0x1dced2[_0x7717('0x49')]['id']}})[_0x7717('0x2b')](handleEntityNotFound(_0x939d4a,null))[_0x7717('0x2b')](function(_0x17f879){if(_0x17f879){_0x542f5b=_0x17f879[_0x7717('0x2c')]({'plain':!![]});_0x59c136[_0x7717('0x33')]=_[_0x7717('0x4a')](db[_0x7717('0x55')]['rawAttributes']);_0x59c136[_0x7717('0x34')]=_['keys'](_0x1dced2[_0x7717('0x34')]);_0x59c136[_0x7717('0x35')]=_[_0x7717('0x36')](_0x59c136['model'],_0x59c136[_0x7717('0x34')]);_0x4bc26a[_0x7717('0x38')]=_[_0x7717('0x36')](_0x59c136['model'],qs['fields'](_0x1dced2[_0x7717('0x34')]['fields']));_0x4bc26a[_0x7717('0x38')]=_0x4bc26a[_0x7717('0x38')][_0x7717('0x39')]?_0x4bc26a['attributes']:_0x59c136['model'];if(!_0x1dced2[_0x7717('0x34')][_0x7717('0x3a')](_0x7717('0x56'))){_0x4bc26a[_0x7717('0x21')]=qs[_0x7717('0x21')](_0x1dced2[_0x7717('0x34')][_0x7717('0x21')]);_0x4bc26a[_0x7717('0x20')]=qs[_0x7717('0x20')](_0x1dced2['query'][_0x7717('0x20')]);}_0x4bc26a['order']=qs['sort'](_0x1dced2[_0x7717('0x34')][_0x7717('0x3c')]);_0x4bc26a[_0x7717('0x3d')]=qs[_0x7717('0x35')](_[_0x7717('0x3e')](_0x1dced2[_0x7717('0x34')],_0x59c136['filters']));_0x4bc26a[_0x7717('0x3d')][_0x7717('0x57')]=_0x17f879['id'];if(_0x1dced2[_0x7717('0x34')][_0x7717('0x3f')]){_0x4bc26a['where']=_[_0x7717('0x40')](_0x4bc26a[_0x7717('0x3d')],{'$or':_[_0x7717('0x2f')](_0x4bc26a[_0x7717('0x38')],function(_0x35ed45){var _0xc28921={};_0xc28921[_0x35ed45]={'$like':'%'+_0x1dced2[_0x7717('0x34')][_0x7717('0x3f')]+'%'};return _0xc28921;})});}_0x4bc26a=_[_0x7717('0x40')]({},_0x4bc26a,_0x1dced2['options']);return db[_0x7717('0x55')][_0x7717('0x58')](_0x4bc26a);}})[_0x7717('0x2b')](function(_0x20fd73){if(_0x20fd73){return db['User'][_0x7717('0x59')]({'where':{'id':_[_0x7717('0x2f')](_0x20fd73,_0x7717('0x5a')),'role':_0x7717('0x5b')},'attributes':['id','name',_0x7717('0x5c'),_0x7717('0x5d'),'createdAt']});}})[_0x7717('0x2b')](function(_0x1c56b4){if(_0x1c56b4){return{'count':_0x1c56b4[_0x7717('0x23')],'rows':_[_0x7717('0x2f')](_0x1c56b4['rows'],function(_0x3528de){return{'membername':_0x3528de[_0x7717('0x42')],'UserId':_0x3528de['id'],'queue_name':_0x542f5b[_0x7717('0x42')],'SmsQueueId':_0x542f5b['id'],'interface':util[_0x7717('0x5e')]('%s/%s',_0x7717('0x5f'),_0x3528de['name']),'penalty':0x0,'paused':_0x3528de[_0x7717('0x5c')],'createdAt':_0x3528de[_0x7717('0x60')],'updatedAt':_0x3528de[_0x7717('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7717('0x2b')](respondWithFilteredResult(_0x939d4a,_0x4bc26a))[_0x7717('0x48')](handleError(_0x939d4a,null));};exports['getTeams']=function(_0x58be0e,_0x380041,_0x4066e0){var _0x4914d4={};var _0x3f221d={};var _0x1475ee;var _0xa08167;return db['SmsQueue'][_0x7717('0x54')]({'where':{'id':_0x58be0e[_0x7717('0x49')]['id']}})['then'](handleEntityNotFound(_0x380041,null))[_0x7717('0x2b')](function(_0x4284ec){if(_0x4284ec){_0x1475ee=_0x4284ec;_0x3f221d[_0x7717('0x33')]=_[_0x7717('0x4a')](db[_0x7717('0x61')][_0x7717('0x30')]);_0x3f221d['query']=_[_0x7717('0x4a')](_0x58be0e[_0x7717('0x34')]);_0x3f221d[_0x7717('0x35')]=_[_0x7717('0x36')](_0x3f221d[_0x7717('0x33')],_0x3f221d[_0x7717('0x34')]);_0x4914d4[_0x7717('0x38')]=_[_0x7717('0x36')](_0x3f221d[_0x7717('0x33')],qs['fields'](_0x58be0e[_0x7717('0x34')][_0x7717('0x37')]));_0x4914d4['attributes']=_0x4914d4[_0x7717('0x38')][_0x7717('0x39')]?_0x4914d4['attributes']:_0x3f221d[_0x7717('0x33')];_0x4914d4[_0x7717('0x3b')]=qs[_0x7717('0x3c')](_0x58be0e[_0x7717('0x34')][_0x7717('0x3c')]);_0x4914d4[_0x7717('0x3d')]=qs[_0x7717('0x35')](_[_0x7717('0x3e')](_0x58be0e['query'],_0x3f221d['filters']));if(_0x58be0e['query'][_0x7717('0x3f')]){_0x4914d4[_0x7717('0x3d')]=_['merge'](_0x4914d4['where'],{'$or':_[_0x7717('0x2f')](_0x4914d4[_0x7717('0x38')],function(_0x2b6c79){var _0x348aac={};_0x348aac[_0x2b6c79]={'$like':'%'+_0x58be0e[_0x7717('0x34')]['filter']+'%'};return _0x348aac;})});}_0x4914d4=_['merge']({},_0x4914d4,_0x58be0e[_0x7717('0x43')]);return _0x1475ee[_0x7717('0x62')](_0x4914d4);}})[_0x7717('0x2b')](function(_0x57c854){if(_0x57c854){_0xa08167=_0x57c854[_0x7717('0x39')];if(!_0x58be0e[_0x7717('0x34')][_0x7717('0x3a')]('nolimit')){_0x4914d4[_0x7717('0x21')]=qs[_0x7717('0x21')](_0x58be0e[_0x7717('0x34')][_0x7717('0x21')]);_0x4914d4[_0x7717('0x20')]=qs[_0x7717('0x20')](_0x58be0e[_0x7717('0x34')][_0x7717('0x20')]);}return _0x1475ee[_0x7717('0x62')](_0x4914d4);}})[_0x7717('0x2b')](function(_0x583911){if(_0x583911){return _0x583911?{'count':_0xa08167,'rows':_0x583911}:null;}})[_0x7717('0x2b')](respondWithResult(_0x380041,null))['catch'](handleError(_0x380041,null));};exports['addTeams']=function(_0x408f08,_0x4c8ed1,_0x4da064){var _0x2e59a6=_0x408f08[_0x7717('0x4c')]['ids'];return db[_0x7717('0x61')][_0x7717('0x58')]({'where':{'id':_0x2e59a6},'attributes':['id'],'include':[{'model':db[_0x7717('0x63')],'as':_0x7717('0x64'),'attributes':['id',_0x7717('0x42'),_0x7717('0x65'),_0x7717('0x66'),_0x7717('0x67')],'raw':!![]}]})[_0x7717('0x2b')](function(_0x107b44){if(_0x107b44){var _0x310259=_[_0x7717('0x68')](_0x107b44,function(_0x19edc2){var _0xe1ed07=_0x19edc2[_0x7717('0x2c')]({'plain':!![]});return _0xe1ed07[_0x7717('0x64')];});return db[_0x7717('0x44')][_0x7717('0x4b')]({'where':{'id':_0x408f08[_0x7717('0x49')]['id']}})['then'](function(_0x18625f){return db['sequelize']['transaction'](function(_0x5421a9){return _0x18625f[_0x7717('0x69')](_0x2e59a6,{'transaction':_0x5421a9})['then'](function(){return BPromise[_0x7717('0x6a')](_0x310259,function(_0x783216){return db[_0x7717('0x55')]['findOrCreate']({'where':{'UserId':_0x783216['id'],'SmsQueueId':_0x408f08[_0x7717('0x49')]['id']},'transaction':_0x5421a9});});})[_0x7717('0x2b')](function(){_0x310259[_0x7717('0x6b')](function(_0x55269a){socket['emit'](_0x7717('0x6c'),{'UserId':_0x55269a['id'],'SmsQueueId':_0x18625f['id']});});});});});}})[_0x7717('0x2b')](respondWithStatusCode(_0x4c8ed1,null))['catch'](handleError(_0x4c8ed1,null));};exports[_0x7717('0x6d')]=function(_0x27f1d4,_0x4e11db,_0x3d3251){return db['Team'][_0x7717('0x58')]({'where':{'id':_0x27f1d4[_0x7717('0x34')][_0x7717('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x7717('0x63')],'as':_0x7717('0x64'),'attributes':['id'],'raw':!![]}]})[_0x7717('0x2b')](handleEntityNotFound(_0x4e11db,null))['then'](function(_0x4dcf3b){var _0x48cac4=_[_0x7717('0x2f')](_0x4dcf3b,'id');var _0x471a93=[];var _0xc8441f=[];var _0xb98030=squel[_0x7717('0x6f')]();_0xb98030[_0x7717('0x70')](_0x7717('0x71'))[_0x7717('0x72')](_0x7717('0x73'),'tq')['join']('user_has_teams','ut',_0x7717('0x74'))[_0x7717('0x3d')](_0x7717('0x75'),_0x27f1d4[_0x7717('0x49')]['id']);for(var _0x101f1c=0x0;_0x101f1c<_0x4dcf3b[_0x7717('0x39')];_0x101f1c+=0x1){let _0x4d9556=_0x4dcf3b[_0x101f1c];for(var _0x36166e=0x0;_0x36166e<_0x4d9556['Agents'][_0x7717('0x39')];_0x36166e+=0x1){let _0x468ca9=_0x4d9556[_0x7717('0x64')][_0x36166e];var _0x3e5232=_0xb98030[_0x7717('0x76')]();_0x3e5232[_0x7717('0x3d')]('ut.UserId\x20=\x20?',_0x468ca9['id']);_0xc8441f[_0x7717('0x77')](db[_0x7717('0x78')][_0x7717('0x34')](_0x3e5232['toString'](),{'type':db[_0x7717('0x78')][_0x7717('0x79')][_0x7717('0x7a')]})[_0x7717('0x2b')](function(_0x3308a8){if(_0x3308a8['length']===0x1){return _0x468ca9['id'];}else{var _0x2f7c5d=_[_0x7717('0x7b')](_['map'](_0x3308a8,_0x7717('0x7c')),function(_0x49faa8){return _[_0x7717('0x7d')](_0x48cac4,_0x49faa8);});if(_0x2f7c5d){return _0x468ca9['id'];}}}));}}return BPromise['all'](_0xc8441f)[_0x7717('0x2b')](function(_0x11491a){_0x471a93=_(_0x471a93)[_0x7717('0x7e')](_0x11491a)[_0x7717('0x7f')]()['value']();return db['SmsQueue'][_0x7717('0x4b')]({'where':{'id':_0x27f1d4[_0x7717('0x49')]['id']}})[_0x7717('0x2b')](function(_0x17d08f){return db[_0x7717('0x78')][_0x7717('0x80')](function(_0x1dfe00){return _0x17d08f[_0x7717('0x6d')](_0x27f1d4[_0x7717('0x34')][_0x7717('0x6e')],{'transaction':_0x1dfe00})[_0x7717('0x2b')](function(){if(!_['isEmpty'](_0x471a93)){return _0x17d08f[_0x7717('0x81')](_0x471a93,{'transaction':_0x1dfe00});}})[_0x7717('0x2b')](function(){_0x471a93[_0x7717('0x6b')](function(_0x10dcc2){socket[_0x7717('0x82')](_0x7717('0x83'),{'UserId':_0x10dcc2,'SmsQueueId':_0x17d08f['id']});});});});});});})[_0x7717('0x2b')](respondWithStatusCode(_0x4e11db,null))['catch'](handleError(_0x4e11db,null));};exports[_0x7717('0x84')]=function(_0x624c3b,_0x4fd480,_0xd0e5aa){return db['SmsQueue'][_0x7717('0x4b')]({'where':{'id':_0x624c3b['params']['id']}})['then'](handleEntityNotFound(_0x4fd480,null))['then'](function(_0x1f8a89){if(_0x1f8a89){return _0x1f8a89[_0x7717('0x84')](_0x624c3b[_0x7717('0x4c')][_0x7717('0x6e')],_[_0x7717('0x85')](_0x624c3b[_0x7717('0x4c')],[_0x7717('0x6e'),'id'])||{})[_0x7717('0x86')](function(_0x7a3c5d){for(var _0x11bead=0x0;_0x11bead<_0x624c3b[_0x7717('0x4c')][_0x7717('0x6e')][_0x7717('0x39')];_0x11bead+=0x1){socket[_0x7717('0x82')](_0x7717('0x6c'),{'UserId':Number(_0x624c3b['body']['ids'][_0x11bead]),'SmsQueueId':Number(_0x624c3b[_0x7717('0x49')]['id'])});}return _0x7a3c5d;});}})[_0x7717('0x2b')](respondWithResult(_0x4fd480,null))[_0x7717('0x48')](handleError(_0x4fd480,null));};exports[_0x7717('0x81')]=function(_0x2cf0f3,_0x232a49,_0x45fab0){return db['SmsQueue'][_0x7717('0x4b')]({'where':{'id':_0x2cf0f3[_0x7717('0x49')]['id']}})[_0x7717('0x2b')](handleEntityNotFound(_0x232a49,null))[_0x7717('0x2b')](function(_0x4e5021){if(_0x4e5021){return _0x4e5021['removeAgents'](_0x2cf0f3[_0x7717('0x34')][_0x7717('0x6e')])[_0x7717('0x2b')](function(){if(_[_0x7717('0x87')](_0x2cf0f3[_0x7717('0x34')][_0x7717('0x6e')])){for(var _0x25eba5=0x0;_0x25eba5<_0x2cf0f3['query'][_0x7717('0x6e')]['length'];_0x25eba5+=0x1){socket[_0x7717('0x82')](_0x7717('0x83'),{'UserId':Number(_0x2cf0f3['query'][_0x7717('0x6e')][_0x25eba5]),'SmsQueueId':Number(_0x2cf0f3[_0x7717('0x49')]['id'])});}}else{socket['emit'](_0x7717('0x83'),{'UserId':Number(_0x2cf0f3[_0x7717('0x34')][_0x7717('0x6e')]),'SmsQueueId':Number(_0x2cf0f3[_0x7717('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x232a49,null))[_0x7717('0x48')](handleError(_0x232a49,null));};exports[_0x7717('0x88')]=function(_0x3cb873,_0x18d0d4,_0x525a34){var _0x4b25b4={};var _0x377646={};var _0x3875d3;var _0x4aceaa;return db[_0x7717('0x44')][_0x7717('0x54')]({'where':{'id':_0x3cb873[_0x7717('0x49')]['id']}})[_0x7717('0x2b')](handleEntityNotFound(_0x18d0d4,null))[_0x7717('0x2b')](function(_0x481104){if(_0x481104){_0x3875d3=_0x481104;_0x377646['model']=_[_0x7717('0x4a')](db[_0x7717('0x63')][_0x7717('0x30')]);_0x377646[_0x7717('0x34')]=_[_0x7717('0x4a')](_0x3cb873[_0x7717('0x34')]);_0x377646[_0x7717('0x35')]=_[_0x7717('0x36')](_0x377646[_0x7717('0x33')],_0x377646[_0x7717('0x34')]);_0x4b25b4[_0x7717('0x38')]=_[_0x7717('0x36')](_0x377646[_0x7717('0x33')],qs[_0x7717('0x37')](_0x3cb873[_0x7717('0x34')][_0x7717('0x37')]));_0x4b25b4['attributes']=_0x4b25b4['attributes']['length']?_0x4b25b4['attributes']:_0x377646[_0x7717('0x33')];_0x4b25b4['order']=qs[_0x7717('0x3c')](_0x3cb873[_0x7717('0x34')][_0x7717('0x3c')]);_0x4b25b4[_0x7717('0x3d')]=qs[_0x7717('0x35')](_[_0x7717('0x3e')](_0x3cb873[_0x7717('0x34')],_0x377646[_0x7717('0x35')]));if(_0x3cb873[_0x7717('0x34')][_0x7717('0x3f')]){_0x4b25b4[_0x7717('0x3d')]=_['merge'](_0x4b25b4[_0x7717('0x3d')],{'$or':_[_0x7717('0x2f')](_0x4b25b4['attributes'],function(_0x3a98d8){var _0x1f079d={};_0x1f079d[_0x3a98d8]={'$like':'%'+_0x3cb873[_0x7717('0x34')]['filter']+'%'};return _0x1f079d;})});}_0x4b25b4=_[_0x7717('0x40')]({},_0x4b25b4,_0x3cb873[_0x7717('0x43')]);return _0x3875d3[_0x7717('0x88')](_0x4b25b4);}})[_0x7717('0x2b')](function(_0x561867){if(_0x561867){_0x4aceaa=_0x561867[_0x7717('0x39')];if(!_0x3cb873[_0x7717('0x34')]['hasOwnProperty'](_0x7717('0x56'))){_0x4b25b4[_0x7717('0x21')]=qs[_0x7717('0x21')](_0x3cb873[_0x7717('0x34')][_0x7717('0x21')]);_0x4b25b4[_0x7717('0x20')]=qs['offset'](_0x3cb873[_0x7717('0x34')][_0x7717('0x20')]);}return _0x3875d3[_0x7717('0x88')](_0x4b25b4);}})['then'](function(_0x2adae4){if(_0x2adae4){return _0x2adae4?{'count':_0x4aceaa,'rows':_0x2adae4}:null;}})[_0x7717('0x2b')](respondWithResult(_0x18d0d4,null))[_0x7717('0x48')](handleError(_0x18d0d4,null));}; \ No newline at end of file +var _0xa76e=['register','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SmsQueue','includeAll','include','rows','keys','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','smsPause','Team','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','userSmsQueue:remove','addAgents','omit','spread','emit','removeAgents','isArray','getAgents','rimraf','zip-dir','moment','mustache','util','path','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa76e,0xfe));var _0xea76=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xa76e[_0x6cf19c];return _0xce14f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea76('0x0'));var zipdir=require(_0xea76('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xea76('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xea76('0x3'));var util=require(_0xea76('0x4'));var path=require(_0xea76('0x5'));var sox=require('sox');var csv=require(_0xea76('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea76('0x7'));var _=require('lodash');var squel=require(_0xea76('0x8'));var crypto=require(_0xea76('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xea76('0x6'));var querystring=require(_0xea76('0xa'));var Papa=require(_0xea76('0xb'));var Redis=require(_0xea76('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xea76('0xd'));var as=require(_0xea76('0xe'));var hardwareService=require(_0xea76('0xf'));var logger=require('../../config/logger')(_0xea76('0x10'));var utils=require(_0xea76('0x11'));var config=require(_0xea76('0x12'));var licenseUtil=require(_0xea76('0x13'));var db=require(_0xea76('0x14'))['db'];config[_0xea76('0x15')]=_[_0xea76('0x16')](config[_0xea76('0x15')],{'host':_0xea76('0x17'),'port':0x18eb});var socket=require(_0xea76('0x18'))(new Redis(config[_0xea76('0x15')]));require(_0xea76('0x19'))[_0xea76('0x1a')](socket);function respondWithStatusCode(_0x4184f3,_0x7fb08e){_0x7fb08e=_0x7fb08e||0xcc;return function(_0x4b250f){if(_0x4b250f){return _0x4184f3[_0xea76('0x1b')](_0x7fb08e);}return _0x4184f3[_0xea76('0x1c')](_0x7fb08e)[_0xea76('0x1d')]();};}function respondWithResult(_0x418f9a,_0x20e1a1){_0x20e1a1=_0x20e1a1||0xc8;return function(_0x855c08){if(_0x855c08){return _0x418f9a[_0xea76('0x1c')](_0x20e1a1)[_0xea76('0x1e')](_0x855c08);}};}function respondWithFilteredResult(_0x9ed6e1,_0xd8985c){return function(_0x210e27){if(_0x210e27){var _0x1efdfa=typeof _0xd8985c['offset']==='undefined'&&typeof _0xd8985c[_0xea76('0x1f')]==='undefined';var _0x1f588c=_0x210e27[_0xea76('0x20')];var _0x3765b0=_0x1efdfa?0x0:_0xd8985c['offset'];var _0x5d7f91=_0x1efdfa?_0x210e27['count']:_0xd8985c[_0xea76('0x21')]+_0xd8985c[_0xea76('0x1f')];var _0x227ef9;if(_0x5d7f91>=_0x1f588c){_0x5d7f91=_0x1f588c;_0x227ef9=0xc8;}else{_0x227ef9=0xce;}_0x9ed6e1[_0xea76('0x1c')](_0x227ef9);return _0x9ed6e1['set'](_0xea76('0x22'),_0x3765b0+'-'+_0x5d7f91+'/'+_0x1f588c)['json'](_0x210e27);}return null;};}function patchUpdates(_0x2c1a26){return function(_0x19202a){try{jsonpatch[_0xea76('0x23')](_0x19202a,_0x2c1a26,!![]);}catch(_0x337459){return BPromise[_0xea76('0x24')](_0x337459);}return _0x19202a[_0xea76('0x25')]();};}function saveUpdates(_0x3d6f4e,_0x4020b7){return function(_0x46b7ec){if(_0x46b7ec){return _0x46b7ec[_0xea76('0x26')](_0x3d6f4e)[_0xea76('0x27')](function(_0x1729a2){return _0x1729a2;});}return null;};}function removeEntity(_0xb511a6,_0x44d877){return function(_0x3fb762){if(_0x3fb762){return _0x3fb762[_0xea76('0x28')]()['then'](function(){var _0x163dc7=_0x3fb762['get']({'plain':!![]});var _0x5911c2=_0xea76('0x29');return db[_0xea76('0x2a')][_0xea76('0x28')]({'where':{'type':_0x5911c2,'resourceId':_0x163dc7['id']}})[_0xea76('0x27')](function(){return _0x3fb762;});})[_0xea76('0x27')](function(){_0xb511a6[_0xea76('0x1c')](0xcc)[_0xea76('0x1d')]();});}};}function handleEntityNotFound(_0x5d2826,_0x5c7960){return function(_0x2335de){if(!_0x2335de){_0x5d2826[_0xea76('0x1b')](0x194);}return _0x2335de;};}function handleError(_0x1b2152,_0x4736f3){_0x4736f3=_0x4736f3||0x1f4;return function(_0x1e7a30){logger[_0xea76('0x2b')](_0x1e7a30[_0xea76('0x2c')]);if(_0x1e7a30[_0xea76('0x2d')]){delete _0x1e7a30[_0xea76('0x2d')];}_0x1b2152[_0xea76('0x1c')](_0x4736f3)[_0xea76('0x2e')](_0x1e7a30);};}exports[_0xea76('0x2f')]=function(_0x40e4ad,_0x3421da){var _0x1c12b2={},_0x4c2dfb={},_0x41fd11={'count':0x0,'rows':[]};var _0x6d046e=_[_0xea76('0x30')](db['SmsQueue'][_0xea76('0x31')],function(_0x2350e8){return{'name':_0x2350e8[_0xea76('0x32')],'type':_0x2350e8[_0xea76('0x33')]['key']};});_0x4c2dfb[_0xea76('0x34')]=_['map'](_0x6d046e,'name');_0x4c2dfb[_0xea76('0x35')]=_['keys'](_0x40e4ad['query']);_0x4c2dfb[_0xea76('0x36')]=_[_0xea76('0x37')](_0x4c2dfb[_0xea76('0x34')],_0x4c2dfb[_0xea76('0x35')]);_0x1c12b2[_0xea76('0x38')]=_['intersection'](_0x4c2dfb[_0xea76('0x34')],qs['fields'](_0x40e4ad[_0xea76('0x35')][_0xea76('0x39')]));_0x1c12b2[_0xea76('0x38')]=_0x1c12b2['attributes'][_0xea76('0x3a')]?_0x1c12b2['attributes']:_0x4c2dfb['model'];if(!_0x40e4ad[_0xea76('0x35')][_0xea76('0x3b')](_0xea76('0x3c'))){_0x1c12b2[_0xea76('0x1f')]=qs[_0xea76('0x1f')](_0x40e4ad[_0xea76('0x35')][_0xea76('0x1f')]);_0x1c12b2[_0xea76('0x21')]=qs[_0xea76('0x21')](_0x40e4ad[_0xea76('0x35')][_0xea76('0x21')]);}_0x1c12b2[_0xea76('0x3d')]=qs[_0xea76('0x3e')](_0x40e4ad[_0xea76('0x35')][_0xea76('0x3e')]);_0x1c12b2[_0xea76('0x3f')]=qs[_0xea76('0x36')](_[_0xea76('0x40')](_0x40e4ad[_0xea76('0x35')],_0x4c2dfb['filters']),_0x6d046e);if(_0x40e4ad[_0xea76('0x35')][_0xea76('0x41')]){_0x1c12b2[_0xea76('0x3f')]=_[_0xea76('0x42')](_0x1c12b2[_0xea76('0x3f')],{'$or':_[_0xea76('0x30')](_0x6d046e,function(_0x384e1a){if(_0x384e1a[_0xea76('0x33')]!==_0xea76('0x43')){var _0x281063={};_0x281063[_0x384e1a[_0xea76('0x2d')]]={'$like':'%'+_0x40e4ad['query']['filter']+'%'};return _0x281063;}})});}_0x1c12b2=_[_0xea76('0x42')]({},_0x1c12b2,_0x40e4ad['options']);var _0x5403ab={'where':_0x1c12b2['where']};return db[_0xea76('0x44')][_0xea76('0x20')](_0x5403ab)[_0xea76('0x27')](function(_0x46ae07){_0x41fd11['count']=_0x46ae07;if(_0x40e4ad[_0xea76('0x35')][_0xea76('0x45')]){_0x1c12b2[_0xea76('0x46')]=[{'all':!![]}];}return db[_0xea76('0x44')]['findAll'](_0x1c12b2);})[_0xea76('0x27')](function(_0x2cc051){_0x41fd11[_0xea76('0x47')]=_0x2cc051;return _0x41fd11;})['then'](respondWithFilteredResult(_0x3421da,_0x1c12b2))['catch'](handleError(_0x3421da,null));};exports['show']=function(_0x3a8034,_0x52732e){var _0x380396={'raw':!![],'where':{'id':_0x3a8034['params']['id']}},_0x241192={};_0x241192['model']=_[_0xea76('0x48')](db[_0xea76('0x44')][_0xea76('0x31')]);_0x241192[_0xea76('0x35')]=_[_0xea76('0x48')](_0x3a8034['query']);_0x241192['filters']=_['intersection'](_0x241192['model'],_0x241192[_0xea76('0x35')]);_0x380396[_0xea76('0x38')]=_[_0xea76('0x37')](_0x241192[_0xea76('0x34')],qs['fields'](_0x3a8034[_0xea76('0x35')]['fields']));_0x380396[_0xea76('0x38')]=_0x380396[_0xea76('0x38')]['length']?_0x380396[_0xea76('0x38')]:_0x241192['model'];if(_0x3a8034['query'][_0xea76('0x45')]){_0x380396[_0xea76('0x46')]=[{'all':!![]}];}_0x380396=_[_0xea76('0x42')]({},_0x380396,_0x3a8034[_0xea76('0x49')]);return db['SmsQueue'][_0xea76('0x4a')](_0x380396)['then'](handleEntityNotFound(_0x52732e,null))[_0xea76('0x27')](respondWithResult(_0x52732e,null))[_0xea76('0x4b')](handleError(_0x52732e,null));};exports[_0xea76('0x4c')]=function(_0x3f1164,_0x29a08c){return db[_0xea76('0x44')][_0xea76('0x4c')](_0x3f1164[_0xea76('0x4d')],{})[_0xea76('0x27')](function(_0x2fc405){var _0x2a0966=_0x3f1164[_0xea76('0x4e')]['get']({'plain':!![]});if(!_0x2a0966)throw new Error(_0xea76('0x4f'));if(_0x2a0966['role']==='user'){var _0x87c06d=_0x2fc405[_0xea76('0x50')]({'plain':!![]});var _0x535f58=_0xea76('0x29');return db['UserProfileSection'][_0xea76('0x4a')]({'where':{'name':_0x535f58,'userProfileId':_0x2a0966['userProfileId']},'raw':!![]})[_0xea76('0x27')](function(_0x108280){if(_0x108280&&_0x108280[_0xea76('0x51')]===0x0){return db[_0xea76('0x2a')]['create']({'name':_0x87c06d[_0xea76('0x2d')],'resourceId':_0x87c06d['id'],'type':_0x108280[_0xea76('0x2d')],'sectionId':_0x108280['id']},{})['then'](function(){return _0x2fc405;});}else{return _0x2fc405;}})['catch'](function(_0x221131){logger[_0xea76('0x2b')](_0xea76('0x52'),_0x221131);throw _0x221131;});}return _0x2fc405;})[_0xea76('0x27')](respondWithResult(_0x29a08c,0xc9))[_0xea76('0x4b')](handleError(_0x29a08c,null));};exports[_0xea76('0x26')]=function(_0x2cf36f,_0x269d1d){if(_0x2cf36f[_0xea76('0x4d')]['id']){delete _0x2cf36f[_0xea76('0x4d')]['id'];}return db[_0xea76('0x44')][_0xea76('0x4a')]({'where':{'id':_0x2cf36f[_0xea76('0x53')]['id']}})[_0xea76('0x27')](handleEntityNotFound(_0x269d1d,null))[_0xea76('0x27')](saveUpdates(_0x2cf36f['body'],null))['then'](respondWithResult(_0x269d1d,null))['catch'](handleError(_0x269d1d,null));};exports['destroy']=function(_0x2169d9,_0x5e3680){return db[_0xea76('0x44')][_0xea76('0x4a')]({'where':{'id':_0x2169d9[_0xea76('0x53')]['id']}})[_0xea76('0x27')](handleEntityNotFound(_0x5e3680,null))['then'](removeEntity(_0x5e3680,null))['catch'](handleError(_0x5e3680,null));};exports[_0xea76('0x54')]=function(_0x1b4677,_0x35d274){return db[_0xea76('0x44')][_0xea76('0x54')]()[_0xea76('0x27')](respondWithResult(_0x35d274,null))[_0xea76('0x4b')](handleError(_0x35d274,null));};exports[_0xea76('0x55')]=function(_0x46e7e1,_0x416d48,_0x1e175b){var _0x56e9f6={'raw':!![],'where':{}},_0x191afb={},_0x457982;return db[_0xea76('0x44')][_0xea76('0x56')]({'where':{'id':_0x46e7e1[_0xea76('0x53')]['id']}})[_0xea76('0x27')](handleEntityNotFound(_0x416d48,null))[_0xea76('0x27')](function(_0x4e4587){if(_0x4e4587){_0x457982=_0x4e4587[_0xea76('0x50')]({'plain':!![]});_0x191afb[_0xea76('0x34')]=_[_0xea76('0x48')](db[_0xea76('0x57')]['rawAttributes']);_0x191afb[_0xea76('0x35')]=_[_0xea76('0x48')](_0x46e7e1['query']);_0x191afb[_0xea76('0x36')]=_[_0xea76('0x37')](_0x191afb[_0xea76('0x34')],_0x191afb[_0xea76('0x35')]);_0x56e9f6['attributes']=_[_0xea76('0x37')](_0x191afb['model'],qs[_0xea76('0x39')](_0x46e7e1['query'][_0xea76('0x39')]));_0x56e9f6[_0xea76('0x38')]=_0x56e9f6[_0xea76('0x38')]['length']?_0x56e9f6[_0xea76('0x38')]:_0x191afb[_0xea76('0x34')];if(!_0x46e7e1[_0xea76('0x35')]['hasOwnProperty'](_0xea76('0x3c'))){_0x56e9f6['limit']=qs[_0xea76('0x1f')](_0x46e7e1[_0xea76('0x35')][_0xea76('0x1f')]);_0x56e9f6[_0xea76('0x21')]=qs[_0xea76('0x21')](_0x46e7e1[_0xea76('0x35')][_0xea76('0x21')]);}_0x56e9f6['order']=qs[_0xea76('0x3e')](_0x46e7e1['query']['sort']);_0x56e9f6[_0xea76('0x3f')]=qs[_0xea76('0x36')](_[_0xea76('0x40')](_0x46e7e1[_0xea76('0x35')],_0x191afb['filters']));_0x56e9f6[_0xea76('0x3f')][_0xea76('0x58')]=_0x4e4587['id'];if(_0x46e7e1['query']['filter']){_0x56e9f6[_0xea76('0x3f')]=_[_0xea76('0x42')](_0x56e9f6['where'],{'$or':_[_0xea76('0x30')](_0x56e9f6['attributes'],function(_0x5cabba){var _0x4b294c={};_0x4b294c[_0x5cabba]={'$like':'%'+_0x46e7e1[_0xea76('0x35')][_0xea76('0x41')]+'%'};return _0x4b294c;})});}_0x56e9f6=_[_0xea76('0x42')]({},_0x56e9f6,_0x46e7e1['options']);return db[_0xea76('0x57')][_0xea76('0x59')](_0x56e9f6);}})[_0xea76('0x27')](function(_0x177b71){if(_0x177b71){return db[_0xea76('0x5a')][_0xea76('0x5b')]({'where':{'id':_['map'](_0x177b71,_0xea76('0x5c')),'role':_0xea76('0x5d')},'attributes':['id',_0xea76('0x2d'),'smsPause',_0xea76('0x5e'),_0xea76('0x5f')]});}})[_0xea76('0x27')](function(_0x52e007){if(_0x52e007){return{'count':_0x52e007[_0xea76('0x20')],'rows':_[_0xea76('0x30')](_0x52e007[_0xea76('0x47')],function(_0x20771d){return{'membername':_0x20771d[_0xea76('0x2d')],'UserId':_0x20771d['id'],'queue_name':_0x457982[_0xea76('0x2d')],'SmsQueueId':_0x457982['id'],'interface':util[_0xea76('0x60')](_0xea76('0x61'),_0xea76('0x62'),_0x20771d[_0xea76('0x2d')]),'penalty':0x0,'paused':_0x20771d[_0xea76('0x63')],'createdAt':_0x20771d[_0xea76('0x5f')],'updatedAt':_0x20771d[_0xea76('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x416d48,_0x56e9f6))[_0xea76('0x4b')](handleError(_0x416d48,null));};exports['getTeams']=function(_0x1c2f13,_0x1ee775,_0x2099c2){var _0x243b06={};var _0x1fd417={};var _0x40cad0;var _0x17bb89;return db[_0xea76('0x44')][_0xea76('0x56')]({'where':{'id':_0x1c2f13[_0xea76('0x53')]['id']}})['then'](handleEntityNotFound(_0x1ee775,null))[_0xea76('0x27')](function(_0x299cfd){if(_0x299cfd){_0x40cad0=_0x299cfd;_0x1fd417['model']=_[_0xea76('0x48')](db[_0xea76('0x64')][_0xea76('0x31')]);_0x1fd417['query']=_['keys'](_0x1c2f13['query']);_0x1fd417[_0xea76('0x36')]=_[_0xea76('0x37')](_0x1fd417['model'],_0x1fd417['query']);_0x243b06[_0xea76('0x38')]=_[_0xea76('0x37')](_0x1fd417[_0xea76('0x34')],qs[_0xea76('0x39')](_0x1c2f13['query'][_0xea76('0x39')]));_0x243b06[_0xea76('0x38')]=_0x243b06[_0xea76('0x38')]['length']?_0x243b06[_0xea76('0x38')]:_0x1fd417[_0xea76('0x34')];_0x243b06[_0xea76('0x3d')]=qs[_0xea76('0x3e')](_0x1c2f13['query']['sort']);_0x243b06['where']=qs[_0xea76('0x36')](_[_0xea76('0x40')](_0x1c2f13[_0xea76('0x35')],_0x1fd417['filters']));if(_0x1c2f13['query']['filter']){_0x243b06[_0xea76('0x3f')]=_[_0xea76('0x42')](_0x243b06[_0xea76('0x3f')],{'$or':_[_0xea76('0x30')](_0x243b06[_0xea76('0x38')],function(_0x4b2865){var _0x171e9b={};_0x171e9b[_0x4b2865]={'$like':'%'+_0x1c2f13[_0xea76('0x35')][_0xea76('0x41')]+'%'};return _0x171e9b;})});}_0x243b06=_[_0xea76('0x42')]({},_0x243b06,_0x1c2f13['options']);return _0x40cad0[_0xea76('0x65')](_0x243b06);}})[_0xea76('0x27')](function(_0x443c68){if(_0x443c68){_0x17bb89=_0x443c68[_0xea76('0x3a')];if(!_0x1c2f13['query'][_0xea76('0x3b')]('nolimit')){_0x243b06[_0xea76('0x1f')]=qs['limit'](_0x1c2f13['query'][_0xea76('0x1f')]);_0x243b06[_0xea76('0x21')]=qs['offset'](_0x1c2f13['query'][_0xea76('0x21')]);}return _0x40cad0[_0xea76('0x65')](_0x243b06);}})[_0xea76('0x27')](function(_0xb555f0){if(_0xb555f0){return _0xb555f0?{'count':_0x17bb89,'rows':_0xb555f0}:null;}})[_0xea76('0x27')](respondWithResult(_0x1ee775,null))[_0xea76('0x4b')](handleError(_0x1ee775,null));};exports['addTeams']=function(_0x1904ee,_0x1babba,_0x14bbef){var _0x454ae6=_0x1904ee['body'][_0xea76('0x66')];return db[_0xea76('0x64')]['findAll']({'where':{'id':_0x454ae6},'attributes':['id'],'include':[{'model':db[_0xea76('0x5a')],'as':_0xea76('0x67'),'attributes':['id',_0xea76('0x2d'),_0xea76('0x68'),_0xea76('0x69'),_0xea76('0x6a')],'raw':!![]}]})[_0xea76('0x27')](function(_0x166028){if(_0x166028){var _0x506e5e=_[_0xea76('0x6b')](_0x166028,function(_0x1ebe65){var _0x5920bd=_0x1ebe65[_0xea76('0x50')]({'plain':!![]});return _0x5920bd[_0xea76('0x67')];});return db[_0xea76('0x44')][_0xea76('0x4a')]({'where':{'id':_0x1904ee[_0xea76('0x53')]['id']}})[_0xea76('0x27')](function(_0x4557bc){return db[_0xea76('0x6c')][_0xea76('0x6d')](function(_0x24a370){return _0x4557bc['addTeams'](_0x454ae6,{'transaction':_0x24a370})['then'](function(){return BPromise[_0xea76('0x6e')](_0x506e5e,function(_0xc0b6a3){return db[_0xea76('0x57')]['findOrCreate']({'where':{'UserId':_0xc0b6a3['id'],'SmsQueueId':_0x1904ee[_0xea76('0x53')]['id']},'transaction':_0x24a370});});})[_0xea76('0x27')](function(){_0x506e5e[_0xea76('0x6f')](function(_0x1c30b2){socket['emit'](_0xea76('0x70'),{'UserId':_0x1c30b2['id'],'SmsQueueId':_0x4557bc['id']});});});});});}})[_0xea76('0x27')](respondWithStatusCode(_0x1babba,null))[_0xea76('0x4b')](handleError(_0x1babba,null));};exports[_0xea76('0x71')]=function(_0x4a7b2f,_0xb1ca6,_0x17cd9f){return db[_0xea76('0x64')][_0xea76('0x59')]({'where':{'id':_0x4a7b2f['query'][_0xea76('0x66')]},'attributes':['id'],'include':[{'model':db[_0xea76('0x5a')],'as':_0xea76('0x67'),'attributes':['id'],'raw':!![]}]})[_0xea76('0x27')](handleEntityNotFound(_0xb1ca6,null))['then'](function(_0x13c653){var _0x53f36b=_[_0xea76('0x30')](_0x13c653,'id');var _0x31fbfd=[];var _0x1ce028=[];var _0x116855=squel['select']();_0x116855[_0xea76('0x72')]('tq.TeamId')[_0xea76('0x73')](_0xea76('0x74'),'tq')[_0xea76('0x75')](_0xea76('0x76'),'ut',_0xea76('0x77'))[_0xea76('0x3f')](_0xea76('0x78'),_0x4a7b2f[_0xea76('0x53')]['id']);for(var _0x3ce12c=0x0;_0x3ce12c<_0x13c653[_0xea76('0x3a')];_0x3ce12c+=0x1){let _0x118095=_0x13c653[_0x3ce12c];for(var _0x5281b2=0x0;_0x5281b2<_0x118095[_0xea76('0x67')][_0xea76('0x3a')];_0x5281b2+=0x1){let _0x16a182=_0x118095[_0xea76('0x67')][_0x5281b2];var _0x4b102c=_0x116855[_0xea76('0x79')]();_0x4b102c['where'](_0xea76('0x7a'),_0x16a182['id']);_0x1ce028[_0xea76('0x7b')](db['sequelize'][_0xea76('0x35')](_0x4b102c[_0xea76('0x7c')](),{'type':db[_0xea76('0x6c')][_0xea76('0x7d')][_0xea76('0x7e')]})['then'](function(_0x5576c7){if(_0x5576c7[_0xea76('0x3a')]===0x1){return _0x16a182['id'];}else{var _0x20f25c=_[_0xea76('0x7f')](_[_0xea76('0x30')](_0x5576c7,_0xea76('0x80')),function(_0x27bb47){return _[_0xea76('0x81')](_0x53f36b,_0x27bb47);});if(_0x20f25c){return _0x16a182['id'];}}}));}}return BPromise[_0xea76('0x82')](_0x1ce028)[_0xea76('0x27')](function(_0x23a363){_0x31fbfd=_(_0x31fbfd)['union'](_0x23a363)['compact']()[_0xea76('0x83')]();return db[_0xea76('0x44')][_0xea76('0x4a')]({'where':{'id':_0x4a7b2f['params']['id']}})[_0xea76('0x27')](function(_0x1e887d){return db[_0xea76('0x6c')]['transaction'](function(_0x2cdeae){return _0x1e887d[_0xea76('0x71')](_0x4a7b2f[_0xea76('0x35')]['ids'],{'transaction':_0x2cdeae})[_0xea76('0x27')](function(){if(!_['isEmpty'](_0x31fbfd)){return _0x1e887d['removeAgents'](_0x31fbfd,{'transaction':_0x2cdeae});}})[_0xea76('0x27')](function(){_0x31fbfd[_0xea76('0x6f')](function(_0x300a6c){socket['emit'](_0xea76('0x84'),{'UserId':_0x300a6c,'SmsQueueId':_0x1e887d['id']});});});});});});})[_0xea76('0x27')](respondWithStatusCode(_0xb1ca6,null))['catch'](handleError(_0xb1ca6,null));};exports[_0xea76('0x85')]=function(_0x3207cb,_0x11c865,_0xa92ba0){return db[_0xea76('0x44')]['find']({'where':{'id':_0x3207cb[_0xea76('0x53')]['id']}})['then'](handleEntityNotFound(_0x11c865,null))[_0xea76('0x27')](function(_0xdb8e24){if(_0xdb8e24){return _0xdb8e24['addAgents'](_0x3207cb[_0xea76('0x4d')]['ids'],_[_0xea76('0x86')](_0x3207cb[_0xea76('0x4d')],[_0xea76('0x66'),'id'])||{})[_0xea76('0x87')](function(_0xee6ce2){for(var _0x1e0393=0x0;_0x1e0393<_0x3207cb[_0xea76('0x4d')][_0xea76('0x66')][_0xea76('0x3a')];_0x1e0393+=0x1){socket[_0xea76('0x88')](_0xea76('0x70'),{'UserId':Number(_0x3207cb['body']['ids'][_0x1e0393]),'SmsQueueId':Number(_0x3207cb[_0xea76('0x53')]['id'])});}return _0xee6ce2;});}})[_0xea76('0x27')](respondWithResult(_0x11c865,null))[_0xea76('0x4b')](handleError(_0x11c865,null));};exports[_0xea76('0x89')]=function(_0x4b96d3,_0x35e415,_0x447f24){return db[_0xea76('0x44')][_0xea76('0x4a')]({'where':{'id':_0x4b96d3[_0xea76('0x53')]['id']}})['then'](handleEntityNotFound(_0x35e415,null))[_0xea76('0x27')](function(_0x87df58){if(_0x87df58){return _0x87df58[_0xea76('0x89')](_0x4b96d3[_0xea76('0x35')][_0xea76('0x66')])[_0xea76('0x27')](function(){if(_[_0xea76('0x8a')](_0x4b96d3[_0xea76('0x35')][_0xea76('0x66')])){for(var _0x5b0d05=0x0;_0x5b0d05<_0x4b96d3[_0xea76('0x35')][_0xea76('0x66')][_0xea76('0x3a')];_0x5b0d05+=0x1){socket[_0xea76('0x88')](_0xea76('0x84'),{'UserId':Number(_0x4b96d3['query']['ids'][_0x5b0d05]),'SmsQueueId':Number(_0x4b96d3['params']['id'])});}}else{socket[_0xea76('0x88')](_0xea76('0x84'),{'UserId':Number(_0x4b96d3[_0xea76('0x35')][_0xea76('0x66')]),'SmsQueueId':Number(_0x4b96d3[_0xea76('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x35e415,null))[_0xea76('0x4b')](handleError(_0x35e415,null));};exports[_0xea76('0x8b')]=function(_0x5da5ed,_0x4d1e71,_0x757b18){var _0x548db5={};var _0x536f50={};var _0x42e6fd;var _0x400bbd;return db['SmsQueue']['findOne']({'where':{'id':_0x5da5ed['params']['id']}})[_0xea76('0x27')](handleEntityNotFound(_0x4d1e71,null))[_0xea76('0x27')](function(_0x3b3635){if(_0x3b3635){_0x42e6fd=_0x3b3635;_0x536f50[_0xea76('0x34')]=_[_0xea76('0x48')](db[_0xea76('0x5a')][_0xea76('0x31')]);_0x536f50[_0xea76('0x35')]=_[_0xea76('0x48')](_0x5da5ed[_0xea76('0x35')]);_0x536f50[_0xea76('0x36')]=_[_0xea76('0x37')](_0x536f50[_0xea76('0x34')],_0x536f50[_0xea76('0x35')]);_0x548db5[_0xea76('0x38')]=_['intersection'](_0x536f50[_0xea76('0x34')],qs[_0xea76('0x39')](_0x5da5ed[_0xea76('0x35')][_0xea76('0x39')]));_0x548db5[_0xea76('0x38')]=_0x548db5['attributes']['length']?_0x548db5[_0xea76('0x38')]:_0x536f50[_0xea76('0x34')];_0x548db5[_0xea76('0x3d')]=qs[_0xea76('0x3e')](_0x5da5ed[_0xea76('0x35')][_0xea76('0x3e')]);_0x548db5[_0xea76('0x3f')]=qs[_0xea76('0x36')](_['pick'](_0x5da5ed[_0xea76('0x35')],_0x536f50['filters']));if(_0x5da5ed[_0xea76('0x35')][_0xea76('0x41')]){_0x548db5['where']=_[_0xea76('0x42')](_0x548db5[_0xea76('0x3f')],{'$or':_['map'](_0x548db5[_0xea76('0x38')],function(_0x20974d){var _0x3ac855={};_0x3ac855[_0x20974d]={'$like':'%'+_0x5da5ed[_0xea76('0x35')]['filter']+'%'};return _0x3ac855;})});}_0x548db5=_[_0xea76('0x42')]({},_0x548db5,_0x5da5ed['options']);return _0x42e6fd[_0xea76('0x8b')](_0x548db5);}})['then'](function(_0x50b810){if(_0x50b810){_0x400bbd=_0x50b810[_0xea76('0x3a')];if(!_0x5da5ed[_0xea76('0x35')]['hasOwnProperty']('nolimit')){_0x548db5[_0xea76('0x1f')]=qs[_0xea76('0x1f')](_0x5da5ed[_0xea76('0x35')]['limit']);_0x548db5[_0xea76('0x21')]=qs[_0xea76('0x21')](_0x5da5ed[_0xea76('0x35')][_0xea76('0x21')]);}return _0x42e6fd[_0xea76('0x8b')](_0x548db5);}})[_0xea76('0x27')](function(_0x27b88f){if(_0x27b88f){return _0x27b88f?{'count':_0x400bbd,'rows':_0x27b88f}:null;}})[_0xea76('0x27')](respondWithResult(_0x4d1e71,null))[_0xea76('0x4b')](handleError(_0x4d1e71,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 77d9ff9..ac2069c 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 _0x35ff=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x36d2a1,_0x176456){var _0x5de65d=function(_0xb44b57){while(--_0xb44b57){_0x36d2a1['push'](_0x36d2a1['shift']());}};_0x5de65d(++_0x176456);}(_0x35ff,0x128));var _0xf35f=function(_0x1f228b,_0x1577fe){_0x1f228b=_0x1f228b-0x0;var _0x268934=_0x35ff[_0x1f228b];return _0x268934;};'use strict';var EventEmitter=require(_0xf35f('0x0'));var SmsQueue=require(_0xf35f('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf35f('0x2')](0x0);var events={'afterCreate':_0xf35f('0x3'),'afterUpdate':_0xf35f('0x4'),'afterDestroy':_0xf35f('0x5')};function emitEvent(_0x4cbb7e){return function(_0x4a14f4,_0x990171,_0x41b2ea){SmsQueueEvents[_0xf35f('0x6')](_0x4cbb7e+':'+_0x4a14f4['id'],_0x4a14f4);SmsQueueEvents[_0xf35f('0x6')](_0x4cbb7e,_0x4a14f4);_0x41b2ea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xf35f('0x7')](e,emitEvent(event));}}module[_0xf35f('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x2107=['update','remove','emit','events','../../mysqldb','SmsQueue','save'];(function(_0x1664fe,_0x31bd8c){var _0x36dd20=function(_0x55a98a){while(--_0x55a98a){_0x1664fe['push'](_0x1664fe['shift']());}};_0x36dd20(++_0x31bd8c);}(_0x2107,0xa4));var _0x7210=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0x2107[_0x1ccbcc];return _0x1e873f;};'use strict';var EventEmitter=require(_0x7210('0x0'));var SmsQueue=require(_0x7210('0x1'))['db'][_0x7210('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7210('0x3'),'afterUpdate':_0x7210('0x4'),'afterDestroy':_0x7210('0x5')};function emitEvent(_0x3b85f7){return function(_0x51797f,_0x2a2696,_0x39ea3c){SmsQueueEvents[_0x7210('0x6')](_0x3b85f7+':'+_0x51797f['id'],_0x51797f);SmsQueueEvents[_0x7210('0x6')](_0x3b85f7,_0x51797f);_0x39ea3c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 47028ea..4391175 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 _0x450a=['sms_queues','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue'];(function(_0x476c48,_0x4a9203){var _0x1ec757=function(_0x143b92){while(--_0x143b92){_0x476c48['push'](_0x476c48['shift']());}};_0x1ec757(++_0x4a9203);}(_0x450a,0x9d));var _0xa450=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x450a[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xa450('0x0'));var util=require(_0xa450('0x1'));var logger=require(_0xa450('0x2'))(_0xa450('0x3'));var moment=require(_0xa450('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa450('0x5'));var rimraf=require(_0xa450('0x6'));var config=require(_0xa450('0x7'));var attributes=require(_0xa450('0x8'));module['exports']=function(_0x4d0681,_0x8a9d27){return _0x4d0681[_0xa450('0x9')](_0xa450('0xa'),attributes,{'tableName':_0xa450('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ad4=['lodash','util','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue'];(function(_0x41930e,_0x34c35d){var _0x2fb492=function(_0x511c17){while(--_0x511c17){_0x41930e['push'](_0x41930e['shift']());}};_0x2fb492(++_0x34c35d);}(_0x2ad4,0xbd));var _0x42ad=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x2ad4[_0x368fb9];return _0x4892fb;};'use strict';var _=require(_0x42ad('0x0'));var util=require(_0x42ad('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x42ad('0x2'));var fs=require('fs');var path=require(_0x42ad('0x3'));var rimraf=require(_0x42ad('0x4'));var config=require(_0x42ad('0x5'));var attributes=require(_0x42ad('0x6'));module['exports']=function(_0x247410,_0x1c30c8){return _0x247410[_0x42ad('0x7')](_0x42ad('0x8'),attributes,{'tableName':'sms_queues','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 578f7f4..3a3f931 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 _0x6843=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowSmsQueue','find','lodash','util','bluebird','randomstring','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6843,0x70));var _0x3684=function(_0x27ba4d,_0x3146af){_0x27ba4d=_0x27ba4d-0x0;var _0x2e833b=_0x6843[_0x27ba4d];return _0x2e833b;};'use strict';var _=require(_0x3684('0x0'));var util=require(_0x3684('0x1'));var moment=require('moment');var BPromise=require(_0x3684('0x2'));var rs=require(_0x3684('0x3'));var fs=require('fs');var Redis=require(_0x3684('0x4'));var db=require(_0x3684('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3684('0x6'))(_0x3684('0x7'));var config=require(_0x3684('0x8'));var jayson=require(_0x3684('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x3684('0xa')](config[_0x3684('0xb')],{'host':_0x3684('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3684('0xb')]));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x286c34,_0x28173b,_0x400a12){return new BPromise(function(_0x18ab17,_0x13e5bd){return client[_0x3684('0xd')](_0x286c34,_0x400a12)[_0x3684('0xe')](function(_0x1d8f0a){logger[_0x3684('0xf')](_0x3684('0x10'),_0x28173b,_0x3684('0x11'));logger[_0x3684('0x12')](_0x3684('0x13'),_0x28173b,_0x3684('0x11'),JSON[_0x3684('0x14')](_0x1d8f0a));if(_0x1d8f0a[_0x3684('0x15')]){if(_0x1d8f0a[_0x3684('0x15')][_0x3684('0x16')]===0x1f4){logger[_0x3684('0x15')](_0x3684('0x10'),_0x28173b,_0x1d8f0a['error'][_0x3684('0x17')]);return _0x13e5bd(_0x1d8f0a[_0x3684('0x15')][_0x3684('0x17')]);}logger[_0x3684('0x15')](_0x3684('0x10'),_0x28173b,_0x1d8f0a['error'][_0x3684('0x17')]);return _0x18ab17(_0x1d8f0a[_0x3684('0x15')]['message']);}else{logger[_0x3684('0xf')]('SmsQueue,\x20%s,\x20%s',_0x28173b,_0x3684('0x11'));_0x18ab17(_0x1d8f0a[_0x3684('0x18')]['message']);}})[_0x3684('0x19')](function(_0x288242){logger[_0x3684('0x15')]('SmsQueue,\x20%s,\x20%s',_0x28173b,_0x288242);_0x13e5bd(_0x288242);});});}exports[_0x3684('0x1a')]=function(_0x5afcb1){var _0x560c56=this;return new Promise(function(_0x23c30e,_0x1e47dd){return db[_0x3684('0x1b')][_0x3684('0x1c')]({'raw':_0x5afcb1[_0x3684('0x1d')]?_0x5afcb1['options'][_0x3684('0x1e')]===undefined?!![]:![]:!![],'where':_0x5afcb1['options']?_0x5afcb1[_0x3684('0x1d')][_0x3684('0x1f')]||null:null,'attributes':_0x5afcb1[_0x3684('0x1d')]?_0x5afcb1['options'][_0x3684('0x20')]||null:null,'limit':_0x5afcb1[_0x3684('0x1d')]?_0x5afcb1[_0x3684('0x1d')][_0x3684('0x21')]||null:null,'include':_0x5afcb1[_0x3684('0x1d')]?_0x5afcb1[_0x3684('0x1d')]['include']?_[_0x3684('0x22')](_0x5afcb1[_0x3684('0x1d')][_0x3684('0x23')],function(_0x4525d0){return{'model':db[_0x4525d0[_0x3684('0x24')]],'as':_0x4525d0['as'],'attributes':_0x4525d0[_0x3684('0x20')],'include':_0x4525d0[_0x3684('0x23')]?_[_0x3684('0x22')](_0x4525d0[_0x3684('0x23')],function(_0x2ab668){return{'model':db[_0x2ab668[_0x3684('0x24')]],'as':_0x2ab668['as'],'attributes':_0x2ab668[_0x3684('0x20')],'include':_0x2ab668['include']?_[_0x3684('0x22')](_0x2ab668[_0x3684('0x23')],function(_0x359209){return{'model':db[_0x359209[_0x3684('0x24')]],'as':_0x359209['as'],'attributes':_0x359209[_0x3684('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58d2b3){logger[_0x3684('0xf')](_0x3684('0x1a'),_0x5afcb1);logger['debug'](_0x3684('0x1a'),_0x5afcb1,JSON[_0x3684('0x14')](_0x58d2b3));_0x23c30e(_0x58d2b3);})[_0x3684('0x19')](function(_0x412d7f){logger['error'](_0x3684('0x1a'),_0x412d7f['message'],_0x5afcb1);_0x1e47dd(_0x560c56[_0x3684('0x15')](0x1f4,_0x412d7f[_0x3684('0x17')]));});});};exports[_0x3684('0x25')]=function(_0x3cb039){var _0x409d28=this;return new Promise(function(_0x28a49b,_0x1e89de){return db[_0x3684('0x1b')][_0x3684('0x26')]({'raw':_0x3cb039[_0x3684('0x1d')]?_0x3cb039[_0x3684('0x1d')][_0x3684('0x1e')]===undefined?!![]:![]:!![],'where':_0x3cb039[_0x3684('0x1d')]?_0x3cb039['options'][_0x3684('0x1f')]||null:null,'attributes':_0x3cb039[_0x3684('0x1d')]?_0x3cb039[_0x3684('0x1d')][_0x3684('0x20')]||null:null,'include':_0x3cb039[_0x3684('0x1d')]?_0x3cb039[_0x3684('0x1d')]['include']?_['map'](_0x3cb039[_0x3684('0x1d')][_0x3684('0x23')],function(_0x44cb50){return{'model':db[_0x44cb50[_0x3684('0x24')]],'as':_0x44cb50['as'],'attributes':_0x44cb50[_0x3684('0x20')],'include':_0x44cb50['include']?_['map'](_0x44cb50['include'],function(_0x47a197){return{'model':db[_0x47a197['model']],'as':_0x47a197['as'],'attributes':_0x47a197[_0x3684('0x20')],'include':_0x47a197[_0x3684('0x23')]?_[_0x3684('0x22')](_0x47a197[_0x3684('0x23')],function(_0x5444f5){return{'model':db[_0x5444f5[_0x3684('0x24')]],'as':_0x5444f5['as'],'attributes':_0x5444f5[_0x3684('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3684('0xe')](function(_0x3e03b3){logger[_0x3684('0xf')](_0x3684('0x25'),_0x3cb039);logger[_0x3684('0x12')](_0x3684('0x25'),_0x3cb039,JSON[_0x3684('0x14')](_0x3e03b3));_0x28a49b(_0x3e03b3);})[_0x3684('0x19')](function(_0x260ced){logger[_0x3684('0x15')]('ShowSmsQueue',_0x260ced[_0x3684('0x17')],_0x3cb039);_0x1e89de(_0x409d28[_0x3684('0x15')](0x1f4,_0x260ced[_0x3684('0x17')]));});});}; \ No newline at end of file +var _0x66f0=['error','code','message','info','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','map','model','then','catch','ShowSmsQueue','find','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4bf991,_0x3601af){var _0x5aa517=function(_0x12c098){while(--_0x12c098){_0x4bf991['push'](_0x4bf991['shift']());}};_0x5aa517(++_0x3601af);}(_0x66f0,0x65));var _0x066f=function(_0x4a209a,_0x575ff9){_0x4a209a=_0x4a209a-0x0;var _0x4b3c20=_0x66f0[_0x4a209a];return _0x4b3c20;};'use strict';var _=require(_0x066f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x066f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x066f('0x2'));var db=require(_0x066f('0x3'))['db'];var utils=require(_0x066f('0x4'));var logger=require(_0x066f('0x5'))(_0x066f('0x6'));var config=require(_0x066f('0x7'));var jayson=require(_0x066f('0x8'));var client=jayson[_0x066f('0x9')][_0x066f('0xa')]({'port':0x232a});config[_0x066f('0xb')]=_[_0x066f('0xc')](config['redis'],{'host':_0x066f('0xd'),'port':0x18eb});var socket=require(_0x066f('0xe'))(new Redis(config[_0x066f('0xb')]));require('./smsQueue.socket')[_0x066f('0xf')](socket);function respondWithRpcPromise(_0x220b34,_0x411318,_0x57ee72){return new BPromise(function(_0x32bc66,_0x18fedd){return client[_0x066f('0x10')](_0x220b34,_0x57ee72)['then'](function(_0x192429){logger['info'](_0x066f('0x11'),_0x411318,_0x066f('0x12'));logger[_0x066f('0x13')](_0x066f('0x14'),_0x411318,_0x066f('0x12'),JSON[_0x066f('0x15')](_0x192429));if(_0x192429[_0x066f('0x16')]){if(_0x192429[_0x066f('0x16')][_0x066f('0x17')]===0x1f4){logger[_0x066f('0x16')](_0x066f('0x11'),_0x411318,_0x192429[_0x066f('0x16')][_0x066f('0x18')]);return _0x18fedd(_0x192429['error'][_0x066f('0x18')]);}logger[_0x066f('0x16')](_0x066f('0x11'),_0x411318,_0x192429[_0x066f('0x16')][_0x066f('0x18')]);return _0x32bc66(_0x192429[_0x066f('0x16')][_0x066f('0x18')]);}else{logger[_0x066f('0x19')]('SmsQueue,\x20%s,\x20%s',_0x411318,_0x066f('0x12'));_0x32bc66(_0x192429[_0x066f('0x1a')][_0x066f('0x18')]);}})['catch'](function(_0x15480f){logger[_0x066f('0x16')]('SmsQueue,\x20%s,\x20%s',_0x411318,_0x15480f);_0x18fedd(_0x15480f);});});}exports[_0x066f('0x1b')]=function(_0x4ce0c2){var _0x4a6814=this;return new Promise(function(_0x10cde5,_0xf864d3){return db[_0x066f('0x1c')][_0x066f('0x1d')]({'raw':_0x4ce0c2['options']?_0x4ce0c2[_0x066f('0x1e')][_0x066f('0x1f')]===undefined?!![]:![]:!![],'where':_0x4ce0c2[_0x066f('0x1e')]?_0x4ce0c2[_0x066f('0x1e')][_0x066f('0x20')]||null:null,'attributes':_0x4ce0c2[_0x066f('0x1e')]?_0x4ce0c2[_0x066f('0x1e')][_0x066f('0x21')]||null:null,'limit':_0x4ce0c2[_0x066f('0x1e')]?_0x4ce0c2[_0x066f('0x1e')]['limit']||null:null,'include':_0x4ce0c2[_0x066f('0x1e')]?_0x4ce0c2[_0x066f('0x1e')][_0x066f('0x22')]?_[_0x066f('0x23')](_0x4ce0c2[_0x066f('0x1e')]['include'],function(_0x3f8944){return{'model':db[_0x3f8944[_0x066f('0x24')]],'as':_0x3f8944['as'],'attributes':_0x3f8944[_0x066f('0x21')],'include':_0x3f8944['include']?_['map'](_0x3f8944[_0x066f('0x22')],function(_0x49d14a){return{'model':db[_0x49d14a['model']],'as':_0x49d14a['as'],'attributes':_0x49d14a['attributes'],'include':_0x49d14a[_0x066f('0x22')]?_[_0x066f('0x23')](_0x49d14a[_0x066f('0x22')],function(_0x484691){return{'model':db[_0x484691[_0x066f('0x24')]],'as':_0x484691['as'],'attributes':_0x484691[_0x066f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x066f('0x25')](function(_0x53f284){logger[_0x066f('0x19')](_0x066f('0x1b'),_0x4ce0c2);logger[_0x066f('0x13')]('GetSmsQueue',_0x4ce0c2,JSON[_0x066f('0x15')](_0x53f284));_0x10cde5(_0x53f284);})[_0x066f('0x26')](function(_0x534c1d){logger[_0x066f('0x16')](_0x066f('0x1b'),_0x534c1d[_0x066f('0x18')],_0x4ce0c2);_0xf864d3(_0x4a6814[_0x066f('0x16')](0x1f4,_0x534c1d['message']));});});};exports[_0x066f('0x27')]=function(_0x33cee7){var _0x5f208b=this;return new Promise(function(_0x1ff1ff,_0x2c3bb9){return db[_0x066f('0x1c')][_0x066f('0x28')]({'raw':_0x33cee7[_0x066f('0x1e')]?_0x33cee7[_0x066f('0x1e')][_0x066f('0x1f')]===undefined?!![]:![]:!![],'where':_0x33cee7['options']?_0x33cee7[_0x066f('0x1e')]['where']||null:null,'attributes':_0x33cee7[_0x066f('0x1e')]?_0x33cee7[_0x066f('0x1e')][_0x066f('0x21')]||null:null,'include':_0x33cee7[_0x066f('0x1e')]?_0x33cee7[_0x066f('0x1e')][_0x066f('0x22')]?_['map'](_0x33cee7[_0x066f('0x1e')]['include'],function(_0x141fb5){return{'model':db[_0x141fb5[_0x066f('0x24')]],'as':_0x141fb5['as'],'attributes':_0x141fb5[_0x066f('0x21')],'include':_0x141fb5[_0x066f('0x22')]?_[_0x066f('0x23')](_0x141fb5[_0x066f('0x22')],function(_0x3f73da){return{'model':db[_0x3f73da[_0x066f('0x24')]],'as':_0x3f73da['as'],'attributes':_0x3f73da['attributes'],'include':_0x3f73da[_0x066f('0x22')]?_[_0x066f('0x23')](_0x3f73da[_0x066f('0x22')],function(_0x3469d4){return{'model':db[_0x3469d4[_0x066f('0x24')]],'as':_0x3469d4['as'],'attributes':_0x3469d4[_0x066f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x066f('0x25')](function(_0x30b26b){logger[_0x066f('0x19')]('ShowSmsQueue',_0x33cee7);logger[_0x066f('0x13')](_0x066f('0x27'),_0x33cee7,JSON[_0x066f('0x15')](_0x30b26b));_0x1ff1ff(_0x30b26b);})['catch'](function(_0x312483){logger['error']('ShowSmsQueue',_0x312483[_0x066f('0x18')],_0x33cee7);_0x2c3bb9(_0x5f208b['error'](0x1f4,_0x312483[_0x066f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 49595a4..ecd3993 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 _0xfe24=['emit','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0xc2cd4a,_0x494adc){var _0x5ab104=function(_0x2ac2fd){while(--_0x2ac2fd){_0xc2cd4a['push'](_0xc2cd4a['shift']());}};_0x5ab104(++_0x494adc);}(_0xfe24,0x13e));var _0x4fe2=function(_0xe5a4bd,_0x1dfb4c){_0xe5a4bd=_0xe5a4bd-0x0;var _0xaa0610=_0xfe24[_0xe5a4bd];return _0xaa0610;};'use strict';var SmsQueueEvents=require(_0x4fe2('0x0'));var events=[_0x4fe2('0x1'),_0x4fe2('0x2'),_0x4fe2('0x3')];function createListener(_0x2b4fdd,_0x392dea){return function(_0x418a41){_0x392dea[_0x4fe2('0x4')](_0x2b4fdd,_0x418a41);};}function removeListener(_0xc61ce5,_0x4ca554){return function(){SmsQueueEvents['removeListener'](_0xc61ce5,_0x4ca554);};}exports['register']=function(_0x13b3ff){for(var _0x5dbddc=0x0,_0x12d40b=events[_0x4fe2('0x5')];_0x5dbddc<_0x12d40b;_0x5dbddc++){var _0x5208e9=events[_0x5dbddc];var _0x115214=createListener(_0x4fe2('0x6')+_0x5208e9,_0x13b3ff);SmsQueueEvents['on'](_0x5208e9,_0x115214);}}; \ No newline at end of file +var _0xaeb9=['removeListener','register','save','remove','update','emit'];(function(_0x44a61d,_0x5e3ddd){var _0x308f62=function(_0x405cba){while(--_0x405cba){_0x44a61d['push'](_0x44a61d['shift']());}};_0x308f62(++_0x5e3ddd);}(_0xaeb9,0x10a));var _0x9aeb=function(_0xf6303,_0x1ee1fd){_0xf6303=_0xf6303-0x0;var _0x3f6b45=_0xaeb9[_0xf6303];return _0x3f6b45;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x9aeb('0x0'),_0x9aeb('0x1'),_0x9aeb('0x2')];function createListener(_0x1d1bfb,_0x4dba32){return function(_0xa9900e){_0x4dba32[_0x9aeb('0x3')](_0x1d1bfb,_0xa9900e);};}function removeListener(_0x29792f,_0x32f1c6){return function(){SmsQueueEvents[_0x9aeb('0x4')](_0x29792f,_0x32f1c6);};}exports[_0x9aeb('0x5')]=function(_0x4644bd){for(var _0x17ab96=0x0,_0x4de0e3=events['length'];_0x17ab96<_0x4de0e3;_0x17ab96++){var _0x1c8470=events[_0x17ab96];var _0x192652=createListener('smsQueue:'+_0x1c8470,_0x4644bd);SmsQueueEvents['on'](_0x1c8470,_0x192652);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 47bf604..aa6fe38 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 _0xacea=['isAuthenticated','index','/describe','describe','create','put','/:id','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get'];(function(_0x269c21,_0x257c03){var _0x265086=function(_0x21e39a){while(--_0x21e39a){_0x269c21['push'](_0x269c21['shift']());}};_0x265086(++_0x257c03);}(_0xacea,0x1d2));var _0xaace=function(_0x58931c,_0x5a9288){_0x58931c=_0x58931c-0x0;var _0x19b9de=_0xacea[_0x58931c];return _0x19b9de;};'use strict';var multer=require(_0xaace('0x0'));var util=require(_0xaace('0x1'));var path=require(_0xaace('0x2'));var timeout=require('connect-timeout');var express=require(_0xaace('0x3'));var router=express[_0xaace('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaace('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaace('0x6'));var controller=require(_0xaace('0x7'));router[_0xaace('0x8')]('/',auth[_0xaace('0x9')](),controller[_0xaace('0xa')]);router[_0xaace('0x8')](_0xaace('0xb'),auth[_0xaace('0x9')](),controller[_0xaace('0xc')]);router['get']('/:id',auth[_0xaace('0x9')](),controller['show']);router['post']('/',auth[_0xaace('0x9')](),controller[_0xaace('0xd')]);router[_0xaace('0xe')](_0xaace('0xf'),auth['isAuthenticated'](),controller[_0xaace('0x10')]);router[_0xaace('0x11')](_0xaace('0xf'),auth[_0xaace('0x9')](),controller['destroy']);module[_0xaace('0x12')]=router; \ No newline at end of file +var _0x2220=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','util'];(function(_0x362f81,_0x25e6c8){var _0x14a94e=function(_0x3042a2){while(--_0x3042a2){_0x362f81['push'](_0x362f81['shift']());}};_0x14a94e(++_0x25e6c8);}(_0x2220,0x14e));var _0x0222=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x2220[_0x50007c];return _0x5c1ec7;};'use strict';var multer=require(_0x0222('0x0'));var util=require(_0x0222('0x1'));var path=require(_0x0222('0x2'));var timeout=require(_0x0222('0x3'));var express=require(_0x0222('0x4'));var router=express[_0x0222('0x5')]();var fs_extra=require(_0x0222('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0222('0x7'));var config=require(_0x0222('0x8'));var controller=require(_0x0222('0x9'));router[_0x0222('0xa')]('/',auth[_0x0222('0xb')](),controller['index']);router[_0x0222('0xa')](_0x0222('0xc'),auth['isAuthenticated'](),controller[_0x0222('0xd')]);router[_0x0222('0xa')](_0x0222('0xe'),auth['isAuthenticated'](),controller[_0x0222('0xf')]);router[_0x0222('0x10')]('/',auth[_0x0222('0xb')](),controller[_0x0222('0x11')]);router['put'](_0x0222('0xe'),auth[_0x0222('0xb')](),controller[_0x0222('0x12')]);router[_0x0222('0x13')]('/:id',auth[_0x0222('0xb')](),controller['destroy']);module[_0x0222('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 3ba88b2..733db66 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 _0x7ae5=['STRING','DATE','moment','sequelize','exports'];(function(_0x2c3acb,_0x4a1f80){var _0x5a83b3=function(_0x18750c){while(--_0x18750c){_0x2c3acb['push'](_0x2c3acb['shift']());}};_0x5a83b3(++_0x4a1f80);}(_0x7ae5,0x133));var _0x57ae=function(_0x474035,_0x41e639){_0x474035=_0x474035-0x0;var _0x1b58e0=_0x7ae5[_0x474035];return _0x1b58e0;};'use strict';var moment=require(_0x57ae('0x0'));var Sequelize=require(_0x57ae('0x1'));module[_0x57ae('0x2')]={'uniqueid':{'type':Sequelize[_0x57ae('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x57ae('0x4')]},'leaveAt':{'type':Sequelize[_0x57ae('0x4')]},'acceptAt':{'type':Sequelize[_0x57ae('0x4')]},'exitAt':{'type':Sequelize[_0x57ae('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc240=['STRING','DATE','moment','sequelize','exports'];(function(_0x1db251,_0xf0443d){var _0x56685a=function(_0x6ec6b7){while(--_0x6ec6b7){_0x1db251['push'](_0x1db251['shift']());}};_0x56685a(++_0xf0443d);}(_0xc240,0xa7));var _0x0c24=function(_0x435193,_0x24b26b){_0x435193=_0x435193-0x0;var _0x429c61=_0xc240[_0x435193];return _0x429c61;};'use strict';var moment=require(_0x0c24('0x0'));var Sequelize=require(_0x0c24('0x1'));module[_0x0c24('0x2')]={'uniqueid':{'type':Sequelize[_0x0c24('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0c24('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0c24('0x4')]},'acceptAt':{'type':Sequelize[_0x0c24('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x0c24('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 1f6f1eb..2bf9c3d 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 _0x164e=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce'];(function(_0x2a6982,_0x24f27c){var _0x81af8a=function(_0x3f88b0){while(--_0x3f88b0){_0x2a6982['push'](_0x2a6982['shift']());}};_0x81af8a(++_0x24f27c);}(_0x164e,0x182));var _0xe164=function(_0x271d08,_0x513d4a){_0x271d08=_0x271d08-0x0;var _0x47454f=_0x164e[_0x271d08];return _0x47454f;};'use strict';var emlformat=require(_0xe164('0x0'));var rimraf=require(_0xe164('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe164('0x2'));var moment=require(_0xe164('0x3'));var BPromise=require(_0xe164('0x4'));var Mustache=require(_0xe164('0x5'));var util=require(_0xe164('0x6'));var path=require(_0xe164('0x7'));var sox=require(_0xe164('0x8'));var csv=require(_0xe164('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe164('0xa'));var _=require('lodash');var squel=require(_0xe164('0xb'));var crypto=require(_0xe164('0xc'));var jsforce=require(_0xe164('0xd'));var deskjs=require(_0xe164('0xe'));var toCsv=require(_0xe164('0x9'));var querystring=require(_0xe164('0xf'));var Papa=require(_0xe164('0x10'));var Redis=require(_0xe164('0x11'));var authService=require(_0xe164('0x12'));var qs=require(_0xe164('0x13'));var as=require(_0xe164('0x14'));var hardwareService=require(_0xe164('0x15'));var logger=require(_0xe164('0x16'))(_0xe164('0x17'));var utils=require(_0xe164('0x18'));var config=require(_0xe164('0x19'));var licenseUtil=require(_0xe164('0x1a'));var db=require(_0xe164('0x1b'))['db'];function respondWithStatusCode(_0x3e4400,_0x2af422){_0x2af422=_0x2af422||0xcc;return function(_0x2dd5fb){if(_0x2dd5fb){return _0x3e4400['sendStatus'](_0x2af422);}return _0x3e4400[_0xe164('0x1c')](_0x2af422)[_0xe164('0x1d')]();};}function respondWithResult(_0xc08e2c,_0x49fed0){_0x49fed0=_0x49fed0||0xc8;return function(_0x4135af){if(_0x4135af){return _0xc08e2c['status'](_0x49fed0)[_0xe164('0x1e')](_0x4135af);}};}function respondWithFilteredResult(_0x1f7c06,_0xdcf5fa){return function(_0x2e38e1){if(_0x2e38e1){var _0x138dd6=typeof _0xdcf5fa[_0xe164('0x1f')]==='undefined'&&typeof _0xdcf5fa[_0xe164('0x20')]===_0xe164('0x21');var _0x3deffa=_0x2e38e1[_0xe164('0x22')];var _0x4f8939=_0x138dd6?0x0:_0xdcf5fa[_0xe164('0x1f')];var _0x2bdf60=_0x138dd6?_0x2e38e1[_0xe164('0x22')]:_0xdcf5fa[_0xe164('0x1f')]+_0xdcf5fa[_0xe164('0x20')];var _0x1bc8b8;if(_0x2bdf60>=_0x3deffa){_0x2bdf60=_0x3deffa;_0x1bc8b8=0xc8;}else{_0x1bc8b8=0xce;}_0x1f7c06[_0xe164('0x1c')](_0x1bc8b8);return _0x1f7c06[_0xe164('0x23')]('Content-Range',_0x4f8939+'-'+_0x2bdf60+'/'+_0x3deffa)['json'](_0x2e38e1);}return null;};}function patchUpdates(_0x354a59){return function(_0x58187d){try{jsonpatch['apply'](_0x58187d,_0x354a59,!![]);}catch(_0x141095){return BPromise[_0xe164('0x24')](_0x141095);}return _0x58187d[_0xe164('0x25')]();};}function saveUpdates(_0x1faf7e,_0x2c88f1){return function(_0x2bcedb){if(_0x2bcedb){return _0x2bcedb['update'](_0x1faf7e)[_0xe164('0x26')](function(_0x3d8682){return _0x3d8682;});}return null;};}function removeEntity(_0x20c7bb,_0x5b5327){return function(_0xec8c5){if(_0xec8c5){return _0xec8c5[_0xe164('0x27')]()[_0xe164('0x26')](function(){_0x20c7bb[_0xe164('0x1c')](0xcc)[_0xe164('0x1d')]();});}};}function handleEntityNotFound(_0x2f3d90,_0xedc885){return function(_0x3c6f61){if(!_0x3c6f61){_0x2f3d90[_0xe164('0x28')](0x194);}return _0x3c6f61;};}function handleError(_0x5b262a,_0x553efe){_0x553efe=_0x553efe||0x1f4;return function(_0x5a7e4d){logger[_0xe164('0x29')](_0x5a7e4d[_0xe164('0x2a')]);if(_0x5a7e4d['name']){delete _0x5a7e4d[_0xe164('0x2b')];}_0x5b262a[_0xe164('0x1c')](_0x553efe)[_0xe164('0x2c')](_0x5a7e4d);};}exports[_0xe164('0x2d')]=function(_0x1f5348,_0x3ae955){var _0x111f0d={},_0x1d6c34={},_0x5cb454={'count':0x0,'rows':[]};var _0x26bb6b=_[_0xe164('0x2e')](db[_0xe164('0x2f')][_0xe164('0x30')],function(_0xac49c){return{'name':_0xac49c['fieldName'],'type':_0xac49c[_0xe164('0x31')][_0xe164('0x32')]};});_0x1d6c34[_0xe164('0x33')]=_[_0xe164('0x2e')](_0x26bb6b,_0xe164('0x2b'));_0x1d6c34[_0xe164('0x34')]=_[_0xe164('0x35')](_0x1f5348[_0xe164('0x34')]);_0x1d6c34['filters']=_[_0xe164('0x36')](_0x1d6c34[_0xe164('0x33')],_0x1d6c34[_0xe164('0x34')]);_0x111f0d[_0xe164('0x37')]=_[_0xe164('0x36')](_0x1d6c34[_0xe164('0x33')],qs[_0xe164('0x38')](_0x1f5348['query'][_0xe164('0x38')]));_0x111f0d[_0xe164('0x37')]=_0x111f0d['attributes'][_0xe164('0x39')]?_0x111f0d['attributes']:_0x1d6c34['model'];if(!_0x1f5348[_0xe164('0x34')][_0xe164('0x3a')]('nolimit')){_0x111f0d[_0xe164('0x20')]=qs[_0xe164('0x20')](_0x1f5348[_0xe164('0x34')]['limit']);_0x111f0d['offset']=qs['offset'](_0x1f5348[_0xe164('0x34')][_0xe164('0x1f')]);}_0x111f0d[_0xe164('0x3b')]=qs[_0xe164('0x3c')](_0x1f5348[_0xe164('0x34')][_0xe164('0x3c')]);_0x111f0d[_0xe164('0x3d')]=qs[_0xe164('0x3e')](_[_0xe164('0x3f')](_0x1f5348[_0xe164('0x34')],_0x1d6c34[_0xe164('0x3e')]),_0x26bb6b);if(_0x1f5348[_0xe164('0x34')][_0xe164('0x40')]){_0x111f0d[_0xe164('0x3d')]=_[_0xe164('0x41')](_0x111f0d[_0xe164('0x3d')],{'$or':_[_0xe164('0x2e')](_0x26bb6b,function(_0x4acc68){if(_0x4acc68[_0xe164('0x31')]!==_0xe164('0x42')){var _0x573f55={};_0x573f55[_0x4acc68[_0xe164('0x2b')]]={'$like':'%'+_0x1f5348[_0xe164('0x34')][_0xe164('0x40')]+'%'};return _0x573f55;}})});}_0x111f0d=_['merge']({},_0x111f0d,_0x1f5348[_0xe164('0x43')]);var _0x1dc7b5={'where':_0x111f0d[_0xe164('0x3d')]};return db[_0xe164('0x2f')][_0xe164('0x22')](_0x1dc7b5)[_0xe164('0x26')](function(_0x4c4f77){_0x5cb454[_0xe164('0x22')]=_0x4c4f77;if(_0x1f5348[_0xe164('0x34')][_0xe164('0x44')]){_0x111f0d[_0xe164('0x45')]=[{'all':!![]}];}return db[_0xe164('0x2f')][_0xe164('0x46')](_0x111f0d);})[_0xe164('0x26')](function(_0x2a09f2){_0x5cb454[_0xe164('0x47')]=_0x2a09f2;return _0x5cb454;})[_0xe164('0x26')](respondWithFilteredResult(_0x3ae955,_0x111f0d))['catch'](handleError(_0x3ae955,null));};exports[_0xe164('0x48')]=function(_0x2e339c,_0x11deac){var _0xb0672={'raw':!![],'where':{'id':_0x2e339c[_0xe164('0x49')]['id']}},_0x36d080={};_0x36d080[_0xe164('0x33')]=_[_0xe164('0x35')](db[_0xe164('0x2f')]['rawAttributes']);_0x36d080[_0xe164('0x34')]=_['keys'](_0x2e339c['query']);_0x36d080['filters']=_[_0xe164('0x36')](_0x36d080[_0xe164('0x33')],_0x36d080[_0xe164('0x34')]);_0xb0672[_0xe164('0x37')]=_[_0xe164('0x36')](_0x36d080['model'],qs[_0xe164('0x38')](_0x2e339c[_0xe164('0x34')][_0xe164('0x38')]));_0xb0672[_0xe164('0x37')]=_0xb0672[_0xe164('0x37')][_0xe164('0x39')]?_0xb0672[_0xe164('0x37')]:_0x36d080['model'];if(_0x2e339c['query'][_0xe164('0x44')]){_0xb0672['include']=[{'all':!![]}];}_0xb0672=_['merge']({},_0xb0672,_0x2e339c['options']);return db[_0xe164('0x2f')][_0xe164('0x4a')](_0xb0672)['then'](handleEntityNotFound(_0x11deac,null))[_0xe164('0x26')](respondWithResult(_0x11deac,null))[_0xe164('0x4b')](handleError(_0x11deac,null));};exports['create']=function(_0x266b51,_0x23e84e){return db[_0xe164('0x2f')][_0xe164('0x4c')](_0x266b51[_0xe164('0x4d')],{})[_0xe164('0x26')](respondWithResult(_0x23e84e,0xc9))[_0xe164('0x4b')](handleError(_0x23e84e,null));};exports[_0xe164('0x4e')]=function(_0xbb75b8,_0x26a5e2){if(_0xbb75b8[_0xe164('0x4d')]['id']){delete _0xbb75b8[_0xe164('0x4d')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0xbb75b8[_0xe164('0x49')]['id']}})['then'](handleEntityNotFound(_0x26a5e2,null))[_0xe164('0x26')](saveUpdates(_0xbb75b8[_0xe164('0x4d')],null))['then'](respondWithResult(_0x26a5e2,null))[_0xe164('0x4b')](handleError(_0x26a5e2,null));};exports[_0xe164('0x27')]=function(_0x4b112c,_0x23e2e3){return db[_0xe164('0x2f')][_0xe164('0x4a')]({'where':{'id':_0x4b112c[_0xe164('0x49')]['id']}})[_0xe164('0x26')](handleEntityNotFound(_0x23e2e3,null))[_0xe164('0x26')](removeEntity(_0x23e2e3,null))[_0xe164('0x4b')](handleError(_0x23e2e3,null));};exports[_0xe164('0x4f')]=function(_0x2cae37,_0x386500){return db[_0xe164('0x2f')]['describe']()['then'](respondWithResult(_0x386500,null))['catch'](handleError(_0x386500,null));}; \ No newline at end of file +var _0x5ea7=['describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','SmsQueueReport','findAll','rows','catch','show','params','find','create','body','update'];(function(_0x7e5a34,_0x17a287){var _0x1d62fc=function(_0x1e2a1a){while(--_0x1e2a1a){_0x7e5a34['push'](_0x7e5a34['shift']());}};_0x1d62fc(++_0x17a287);}(_0x5ea7,0x11d));var _0x75ea=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x5ea7[_0x47aa64];return _0x549c7a;};'use strict';var emlformat=require(_0x75ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x75ea('0x1'));var jsonpatch=require(_0x75ea('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x75ea('0x3'));var Mustache=require(_0x75ea('0x4'));var util=require(_0x75ea('0x5'));var path=require(_0x75ea('0x6'));var sox=require(_0x75ea('0x7'));var csv=require(_0x75ea('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75ea('0x9'));var _=require(_0x75ea('0xa'));var squel=require(_0x75ea('0xb'));var crypto=require(_0x75ea('0xc'));var jsforce=require(_0x75ea('0xd'));var deskjs=require(_0x75ea('0xe'));var toCsv=require(_0x75ea('0x8'));var querystring=require(_0x75ea('0xf'));var Papa=require(_0x75ea('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75ea('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x75ea('0x12'))('api');var utils=require(_0x75ea('0x13'));var config=require(_0x75ea('0x14'));var licenseUtil=require(_0x75ea('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22ee25,_0x67a66){_0x67a66=_0x67a66||0xcc;return function(_0x272039){if(_0x272039){return _0x22ee25[_0x75ea('0x16')](_0x67a66);}return _0x22ee25[_0x75ea('0x17')](_0x67a66)[_0x75ea('0x18')]();};}function respondWithResult(_0x10c189,_0x4c870c){_0x4c870c=_0x4c870c||0xc8;return function(_0x1281fb){if(_0x1281fb){return _0x10c189[_0x75ea('0x17')](_0x4c870c)['json'](_0x1281fb);}};}function respondWithFilteredResult(_0x4d0c57,_0x4abd3d){return function(_0x3bde79){if(_0x3bde79){var _0xbc5afc=typeof _0x4abd3d[_0x75ea('0x19')]===_0x75ea('0x1a')&&typeof _0x4abd3d[_0x75ea('0x1b')]===_0x75ea('0x1a');var _0x474a1d=_0x3bde79[_0x75ea('0x1c')];var _0x122341=_0xbc5afc?0x0:_0x4abd3d[_0x75ea('0x19')];var _0x2f16a1=_0xbc5afc?_0x3bde79[_0x75ea('0x1c')]:_0x4abd3d[_0x75ea('0x19')]+_0x4abd3d['limit'];var _0x47c29e;if(_0x2f16a1>=_0x474a1d){_0x2f16a1=_0x474a1d;_0x47c29e=0xc8;}else{_0x47c29e=0xce;}_0x4d0c57[_0x75ea('0x17')](_0x47c29e);return _0x4d0c57[_0x75ea('0x1d')](_0x75ea('0x1e'),_0x122341+'-'+_0x2f16a1+'/'+_0x474a1d)['json'](_0x3bde79);}return null;};}function patchUpdates(_0x2102b3){return function(_0x40972c){try{jsonpatch[_0x75ea('0x1f')](_0x40972c,_0x2102b3,!![]);}catch(_0x28e6c1){return BPromise[_0x75ea('0x20')](_0x28e6c1);}return _0x40972c[_0x75ea('0x21')]();};}function saveUpdates(_0x35a957,_0x580a4c){return function(_0x5ca5d0){if(_0x5ca5d0){return _0x5ca5d0['update'](_0x35a957)[_0x75ea('0x22')](function(_0x1057fe){return _0x1057fe;});}return null;};}function removeEntity(_0x556ee3,_0x32a3fb){return function(_0x4126ea){if(_0x4126ea){return _0x4126ea[_0x75ea('0x23')]()[_0x75ea('0x22')](function(){_0x556ee3[_0x75ea('0x17')](0xcc)[_0x75ea('0x18')]();});}};}function handleEntityNotFound(_0x117940,_0x182162){return function(_0x232f29){if(!_0x232f29){_0x117940[_0x75ea('0x16')](0x194);}return _0x232f29;};}function handleError(_0x50321a,_0x5f6323){_0x5f6323=_0x5f6323||0x1f4;return function(_0x13f239){logger['error'](_0x13f239['stack']);if(_0x13f239[_0x75ea('0x24')]){delete _0x13f239[_0x75ea('0x24')];}_0x50321a[_0x75ea('0x17')](_0x5f6323)[_0x75ea('0x25')](_0x13f239);};}exports[_0x75ea('0x26')]=function(_0x1c8c9e,_0x23364b){var _0x5186ec={},_0x59505e={},_0x23cf11={'count':0x0,'rows':[]};var _0x401aae=_[_0x75ea('0x27')](db['SmsQueueReport'][_0x75ea('0x28')],function(_0x1a2791){return{'name':_0x1a2791['fieldName'],'type':_0x1a2791[_0x75ea('0x29')][_0x75ea('0x2a')]};});_0x59505e[_0x75ea('0x2b')]=_[_0x75ea('0x27')](_0x401aae,_0x75ea('0x24'));_0x59505e[_0x75ea('0x2c')]=_[_0x75ea('0x2d')](_0x1c8c9e[_0x75ea('0x2c')]);_0x59505e['filters']=_['intersection'](_0x59505e[_0x75ea('0x2b')],_0x59505e[_0x75ea('0x2c')]);_0x5186ec[_0x75ea('0x2e')]=_[_0x75ea('0x2f')](_0x59505e[_0x75ea('0x2b')],qs[_0x75ea('0x30')](_0x1c8c9e[_0x75ea('0x2c')][_0x75ea('0x30')]));_0x5186ec[_0x75ea('0x2e')]=_0x5186ec[_0x75ea('0x2e')]['length']?_0x5186ec[_0x75ea('0x2e')]:_0x59505e[_0x75ea('0x2b')];if(!_0x1c8c9e[_0x75ea('0x2c')][_0x75ea('0x31')](_0x75ea('0x32'))){_0x5186ec[_0x75ea('0x1b')]=qs[_0x75ea('0x1b')](_0x1c8c9e[_0x75ea('0x2c')][_0x75ea('0x1b')]);_0x5186ec[_0x75ea('0x19')]=qs[_0x75ea('0x19')](_0x1c8c9e['query'][_0x75ea('0x19')]);}_0x5186ec['order']=qs[_0x75ea('0x33')](_0x1c8c9e[_0x75ea('0x2c')][_0x75ea('0x33')]);_0x5186ec[_0x75ea('0x34')]=qs[_0x75ea('0x35')](_[_0x75ea('0x36')](_0x1c8c9e[_0x75ea('0x2c')],_0x59505e[_0x75ea('0x35')]),_0x401aae);if(_0x1c8c9e[_0x75ea('0x2c')][_0x75ea('0x37')]){_0x5186ec['where']=_[_0x75ea('0x38')](_0x5186ec[_0x75ea('0x34')],{'$or':_['map'](_0x401aae,function(_0x51fed2){if(_0x51fed2[_0x75ea('0x29')]!==_0x75ea('0x39')){var _0x314f40={};_0x314f40[_0x51fed2[_0x75ea('0x24')]]={'$like':'%'+_0x1c8c9e['query'][_0x75ea('0x37')]+'%'};return _0x314f40;}})});}_0x5186ec=_[_0x75ea('0x38')]({},_0x5186ec,_0x1c8c9e['options']);var _0x218e2a={'where':_0x5186ec[_0x75ea('0x34')]};return db['SmsQueueReport']['count'](_0x218e2a)['then'](function(_0x15b7d6){_0x23cf11[_0x75ea('0x1c')]=_0x15b7d6;if(_0x1c8c9e[_0x75ea('0x2c')][_0x75ea('0x3a')]){_0x5186ec[_0x75ea('0x3b')]=[{'all':!![]}];}return db[_0x75ea('0x3c')][_0x75ea('0x3d')](_0x5186ec);})[_0x75ea('0x22')](function(_0x133ae6){_0x23cf11[_0x75ea('0x3e')]=_0x133ae6;return _0x23cf11;})[_0x75ea('0x22')](respondWithFilteredResult(_0x23364b,_0x5186ec))[_0x75ea('0x3f')](handleError(_0x23364b,null));};exports[_0x75ea('0x40')]=function(_0x3ae31c,_0x189937){var _0x210201={'raw':!![],'where':{'id':_0x3ae31c[_0x75ea('0x41')]['id']}},_0x39d70a={};_0x39d70a[_0x75ea('0x2b')]=_[_0x75ea('0x2d')](db[_0x75ea('0x3c')][_0x75ea('0x28')]);_0x39d70a[_0x75ea('0x2c')]=_['keys'](_0x3ae31c[_0x75ea('0x2c')]);_0x39d70a['filters']=_[_0x75ea('0x2f')](_0x39d70a[_0x75ea('0x2b')],_0x39d70a[_0x75ea('0x2c')]);_0x210201[_0x75ea('0x2e')]=_[_0x75ea('0x2f')](_0x39d70a[_0x75ea('0x2b')],qs['fields'](_0x3ae31c['query'][_0x75ea('0x30')]));_0x210201[_0x75ea('0x2e')]=_0x210201['attributes']['length']?_0x210201[_0x75ea('0x2e')]:_0x39d70a[_0x75ea('0x2b')];if(_0x3ae31c[_0x75ea('0x2c')]['includeAll']){_0x210201[_0x75ea('0x3b')]=[{'all':!![]}];}_0x210201=_[_0x75ea('0x38')]({},_0x210201,_0x3ae31c['options']);return db[_0x75ea('0x3c')][_0x75ea('0x42')](_0x210201)['then'](handleEntityNotFound(_0x189937,null))[_0x75ea('0x22')](respondWithResult(_0x189937,null))[_0x75ea('0x3f')](handleError(_0x189937,null));};exports[_0x75ea('0x43')]=function(_0x2114d4,_0x178db7){return db[_0x75ea('0x3c')][_0x75ea('0x43')](_0x2114d4[_0x75ea('0x44')],{})[_0x75ea('0x22')](respondWithResult(_0x178db7,0xc9))[_0x75ea('0x3f')](handleError(_0x178db7,null));};exports[_0x75ea('0x45')]=function(_0x42f876,_0x4066e6){if(_0x42f876[_0x75ea('0x44')]['id']){delete _0x42f876[_0x75ea('0x44')]['id'];}return db[_0x75ea('0x3c')][_0x75ea('0x42')]({'where':{'id':_0x42f876['params']['id']}})[_0x75ea('0x22')](handleEntityNotFound(_0x4066e6,null))[_0x75ea('0x22')](saveUpdates(_0x42f876[_0x75ea('0x44')],null))[_0x75ea('0x22')](respondWithResult(_0x4066e6,null))[_0x75ea('0x3f')](handleError(_0x4066e6,null));};exports[_0x75ea('0x23')]=function(_0xfd7db5,_0x2a9f15){return db[_0x75ea('0x3c')][_0x75ea('0x42')]({'where':{'id':_0xfd7db5['params']['id']}})[_0x75ea('0x22')](handleEntityNotFound(_0x2a9f15,null))[_0x75ea('0x22')](removeEntity(_0x2a9f15,null))[_0x75ea('0x3f')](handleError(_0x2a9f15,null));};exports[_0x75ea('0x46')]=function(_0x5b65b8,_0x450fca){return db[_0x75ea('0x3c')][_0x75ea('0x46')]()[_0x75ea('0x22')](respondWithResult(_0x450fca,null))[_0x75ea('0x3f')](handleError(_0x450fca,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index a609ac3..44a2b8c 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x1785bf,_0x1110c6){var _0x3c16f1=function(_0x55fca7){while(--_0x55fca7){_0x1785bf['push'](_0x1785bf['shift']());}};_0x3c16f1(++_0x1110c6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xb7e7[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x29ee03,_0x14f698){var _0xa81d66=function(_0x11ff9e){while(--_0x11ff9e){_0x29ee03['push'](_0x29ee03['shift']());}};_0xa81d66(++_0x14f698);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0xcb91[_0x510c60];return _0x49c4aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 65eadd0..56c632a 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 _0x441c=['error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','catch','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1dbdc4,_0x56bcfa){var _0x5b194a=function(_0x2e7b49){while(--_0x2e7b49){_0x1dbdc4['push'](_0x1dbdc4['shift']());}};_0x5b194a(++_0x56bcfa);}(_0x441c,0x1f1));var _0xc441=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x441c[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xc441('0x0'));var util=require(_0xc441('0x1'));var moment=require(_0xc441('0x2'));var BPromise=require(_0xc441('0x3'));var rs=require(_0xc441('0x4'));var fs=require('fs');var Redis=require(_0xc441('0x5'));var db=require(_0xc441('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc441('0x7'))(_0xc441('0x8'));var config=require(_0xc441('0x9'));var jayson=require(_0xc441('0xa'));var client=jayson[_0xc441('0xb')][_0xc441('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1bfe14,_0x239ce0,_0x77f016){return new BPromise(function(_0x36c56a,_0x10a33f){return client[_0xc441('0xd')](_0x1bfe14,_0x77f016)[_0xc441('0xe')](function(_0x168cb1){logger[_0xc441('0xf')](_0xc441('0x10'),_0x239ce0,_0xc441('0x11'));logger[_0xc441('0x12')](_0xc441('0x13'),_0x239ce0,_0xc441('0x11'),JSON[_0xc441('0x14')](_0x168cb1));if(_0x168cb1[_0xc441('0x15')]){if(_0x168cb1['error'][_0xc441('0x16')]===0x1f4){logger['error'](_0xc441('0x10'),_0x239ce0,_0x168cb1[_0xc441('0x15')][_0xc441('0x17')]);return _0x10a33f(_0x168cb1[_0xc441('0x15')][_0xc441('0x17')]);}logger['error'](_0xc441('0x10'),_0x239ce0,_0x168cb1[_0xc441('0x15')]['message']);return _0x36c56a(_0x168cb1[_0xc441('0x15')][_0xc441('0x17')]);}else{logger[_0xc441('0xf')](_0xc441('0x10'),_0x239ce0,_0xc441('0x11'));_0x36c56a(_0x168cb1[_0xc441('0x18')][_0xc441('0x17')]);}})['catch'](function(_0x18191b){logger[_0xc441('0x15')]('SmsQueueReport,\x20%s,\x20%s',_0x239ce0,_0x18191b);_0x10a33f(_0x18191b);});});}exports[_0xc441('0x19')]=function(_0x4dc7e1){var _0x783269=this;return new Promise(function(_0x1156a3,_0x431fd3){return db[_0xc441('0x1a')][_0xc441('0x1b')](_0x4dc7e1[_0xc441('0x1c')],{'raw':_0x4dc7e1[_0xc441('0x1d')]?_0x4dc7e1[_0xc441('0x1d')][_0xc441('0x1e')]===undefined?!![]:![]:!![]})[_0xc441('0xe')](function(_0x4ae92f){logger['info']('CreateSmsQueueReport',_0x4dc7e1);logger[_0xc441('0x12')]('CreateSmsQueueReport',_0x4dc7e1,JSON[_0xc441('0x14')](_0x4ae92f));_0x1156a3(_0x4ae92f);})[_0xc441('0x1f')](function(_0x197318){logger[_0xc441('0x15')](_0xc441('0x19'),_0x197318['message'],_0x4dc7e1);_0x431fd3(_0x783269['error'](0x1f4,_0x197318['message']));});});};exports[_0xc441('0x20')]=function(_0x3da4d9){var _0x51a661=this;return new Promise(function(_0x769aad,_0x5a2f88){return db[_0xc441('0x1a')][_0xc441('0x21')](_0x3da4d9[_0xc441('0x1c')],{'raw':_0x3da4d9['options']?_0x3da4d9[_0xc441('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3da4d9[_0xc441('0x1d')]?_0x3da4d9[_0xc441('0x1d')][_0xc441('0x22')]||null:null,'attributes':_0x3da4d9[_0xc441('0x1d')]?_0x3da4d9['options'][_0xc441('0x23')]||null:null,'limit':_0x3da4d9[_0xc441('0x1d')]?_0x3da4d9['options'][_0xc441('0x24')]||null:null})[_0xc441('0xe')](function(_0x4cfe1){logger['info']('UpdateSmsQueueReport',_0x3da4d9);logger['debug'](_0xc441('0x20'),_0x3da4d9,JSON[_0xc441('0x14')](_0x4cfe1));_0x769aad(_0x4cfe1);})[_0xc441('0x1f')](function(_0x1c8e0f){logger['error']('UpdateSmsQueueReport',_0x1c8e0f[_0xc441('0x17')],_0x3da4d9);_0x5a2f88(_0x51a661[_0xc441('0x15')](0x1f4,_0x1c8e0f[_0xc441('0x17')]));});});}; \ No newline at end of file +var _0x02d3=['catch','UpdateSmsQueueReport','SmsQueueReport','update','raw','where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSmsQueueReport','create','body','options'];(function(_0x31038b,_0x3ac1c9){var _0x1c9d3c=function(_0xe00e97){while(--_0xe00e97){_0x31038b['push'](_0x31038b['shift']());}};_0x1c9d3c(++_0x3ac1c9);}(_0x02d3,0x1a0));var _0x302d=function(_0xc170c2,_0x234145){_0xc170c2=_0xc170c2-0x0;var _0x91cd13=_0x02d3[_0xc170c2];return _0x91cd13;};'use strict';var _=require(_0x302d('0x0'));var util=require('util');var moment=require(_0x302d('0x1'));var BPromise=require(_0x302d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x302d('0x3'));var db=require(_0x302d('0x4'))['db'];var utils=require(_0x302d('0x5'));var logger=require('../../config/logger')(_0x302d('0x6'));var config=require(_0x302d('0x7'));var jayson=require(_0x302d('0x8'));var client=jayson[_0x302d('0x9')][_0x302d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1568d6,_0x3f3fba,_0x431d2f){return new BPromise(function(_0x4f9541,_0x332e9e){return client['request'](_0x1568d6,_0x431d2f)[_0x302d('0xb')](function(_0x69e2d4){logger[_0x302d('0xc')](_0x302d('0xd'),_0x3f3fba,_0x302d('0xe'));logger[_0x302d('0xf')](_0x302d('0x10'),_0x3f3fba,_0x302d('0xe'),JSON[_0x302d('0x11')](_0x69e2d4));if(_0x69e2d4[_0x302d('0x12')]){if(_0x69e2d4[_0x302d('0x12')][_0x302d('0x13')]===0x1f4){logger[_0x302d('0x12')](_0x302d('0xd'),_0x3f3fba,_0x69e2d4[_0x302d('0x12')][_0x302d('0x14')]);return _0x332e9e(_0x69e2d4['error'][_0x302d('0x14')]);}logger[_0x302d('0x12')](_0x302d('0xd'),_0x3f3fba,_0x69e2d4[_0x302d('0x12')][_0x302d('0x14')]);return _0x4f9541(_0x69e2d4[_0x302d('0x12')][_0x302d('0x14')]);}else{logger[_0x302d('0xc')](_0x302d('0xd'),_0x3f3fba,_0x302d('0xe'));_0x4f9541(_0x69e2d4[_0x302d('0x15')][_0x302d('0x14')]);}})['catch'](function(_0xac4c3e){logger[_0x302d('0x12')](_0x302d('0xd'),_0x3f3fba,_0xac4c3e);_0x332e9e(_0xac4c3e);});});}exports[_0x302d('0x16')]=function(_0x2d3ed5){var _0x2f782c=this;return new Promise(function(_0x2293db,_0x4ffeea){return db['SmsQueueReport'][_0x302d('0x17')](_0x2d3ed5[_0x302d('0x18')],{'raw':_0x2d3ed5[_0x302d('0x19')]?_0x2d3ed5[_0x302d('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x302d('0xb')](function(_0x4d26fb){logger['info']('CreateSmsQueueReport',_0x2d3ed5);logger[_0x302d('0xf')](_0x302d('0x16'),_0x2d3ed5,JSON['stringify'](_0x4d26fb));_0x2293db(_0x4d26fb);})[_0x302d('0x1a')](function(_0x5cf103){logger[_0x302d('0x12')](_0x302d('0x16'),_0x5cf103['message'],_0x2d3ed5);_0x4ffeea(_0x2f782c[_0x302d('0x12')](0x1f4,_0x5cf103[_0x302d('0x14')]));});});};exports[_0x302d('0x1b')]=function(_0x31bbca){var _0x100f41=this;return new Promise(function(_0x32f7bc,_0x1ea777){return db[_0x302d('0x1c')][_0x302d('0x1d')](_0x31bbca[_0x302d('0x18')],{'raw':_0x31bbca[_0x302d('0x19')]?_0x31bbca[_0x302d('0x19')][_0x302d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31bbca[_0x302d('0x19')]?_0x31bbca['options'][_0x302d('0x1f')]||null:null,'attributes':_0x31bbca[_0x302d('0x19')]?_0x31bbca[_0x302d('0x19')][_0x302d('0x20')]||null:null,'limit':_0x31bbca[_0x302d('0x19')]?_0x31bbca[_0x302d('0x19')][_0x302d('0x21')]||null:null})[_0x302d('0xb')](function(_0xa8c8b5){logger[_0x302d('0xc')](_0x302d('0x1b'),_0x31bbca);logger[_0x302d('0xf')](_0x302d('0x1b'),_0x31bbca,JSON['stringify'](_0xa8c8b5));_0x32f7bc(_0xa8c8b5);})[_0x302d('0x1a')](function(_0x807e87){logger[_0x302d('0x12')]('UpdateSmsQueueReport',_0x807e87['message'],_0x31bbca);_0x1ea777(_0x100f41[_0x302d('0x12')](0x1f4,_0x807e87['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index b0f040d..770e5d8 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 _0x1b20=['show','post','create','put','/:id','delete','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x1e5f61,_0x58f4c1){var _0x27e6d8=function(_0x4f5e30){while(--_0x4f5e30){_0x1e5f61['push'](_0x1e5f61['shift']());}};_0x27e6d8(++_0x58f4c1);}(_0x1b20,0x66));var _0x01b2=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1b20[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0x01b2('0x0'));var path=require(_0x01b2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x01b2('0x2')]();var fs_extra=require(_0x01b2('0x3'));var auth=require(_0x01b2('0x4'));var interaction=require(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var controller=require(_0x01b2('0x7'));router[_0x01b2('0x8')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xa')]);router[_0x01b2('0x8')](_0x01b2('0xb'),auth[_0x01b2('0x9')](),controller['describe']);router[_0x01b2('0x8')]('/:id',auth[_0x01b2('0x9')](),controller[_0x01b2('0xc')]);router[_0x01b2('0xd')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xe')]);router[_0x01b2('0xf')](_0x01b2('0x10'),auth[_0x01b2('0x9')](),controller['update']);router[_0x01b2('0x11')]('/:id',auth[_0x01b2('0x9')](),controller['destroy']);module[_0x01b2('0x12')]=router; \ No newline at end of file +var _0x4300=['describe','/:id','show','post','put','update','delete','destroy','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4300,0x1a6));var _0x0430=function(_0x282cf2,_0xca844c){_0x282cf2=_0x282cf2-0x0;var _0x5dada8=_0x4300[_0x282cf2];return _0x5dada8;};'use strict';var multer=require(_0x0430('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0430('0x1')]();var fs_extra=require(_0x0430('0x2'));var auth=require(_0x0430('0x3'));var interaction=require(_0x0430('0x4'));var config=require(_0x0430('0x5'));var controller=require('./smsTransferReport.controller');router[_0x0430('0x6')]('/',auth['isAuthenticated'](),controller[_0x0430('0x7')]);router['get'](_0x0430('0x8'),auth[_0x0430('0x9')](),controller[_0x0430('0xa')]);router[_0x0430('0x6')](_0x0430('0xb'),auth[_0x0430('0x9')](),controller[_0x0430('0xc')]);router[_0x0430('0xd')]('/',auth[_0x0430('0x9')](),controller['create']);router[_0x0430('0xe')](_0x0430('0xb'),auth[_0x0430('0x9')](),controller[_0x0430('0xf')]);router[_0x0430('0x10')](_0x0430('0xb'),auth[_0x0430('0x9')](),controller[_0x0430('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a60ccf9..ed7b968 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3e7188,_0x34b428){var _0x1b59aa=function(_0x310b3b){while(--_0x310b3b){_0x3e7188['push'](_0x3e7188['shift']());}};_0x1b59aa(++_0x34b428);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1ec67f,_0x4d27d0){_0x1ec67f=_0x1ec67f-0x0;var _0x434a63=_0xf4eb[_0x1ec67f];return _0x434a63;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x2eb22a,_0x23697f){var _0x53859b=function(_0x32a77b){while(--_0x32a77b){_0x2eb22a['push'](_0x2eb22a['shift']());}};_0x53859b(++_0x23697f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0xcb91[_0x36bff5];return _0x80ade5;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 8d4f07d..2a3b272 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 _0xf2f6=['json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','end','sendStatus','error','stack','send','SmsTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','name','rows','show','params','includeAll','options','find','create','body','catch','destroy','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf2f6,0x110));var _0x6f2f=function(_0x1ae173,_0x316991){_0x1ae173=_0x1ae173-0x0;var _0x2ff86b=_0xf2f6[_0x1ae173];return _0x2ff86b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f2f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f2f('0x1'));var rp=require('request-promise');var moment=require(_0x6f2f('0x2'));var BPromise=require(_0x6f2f('0x3'));var Mustache=require(_0x6f2f('0x4'));var util=require(_0x6f2f('0x5'));var path=require('path');var sox=require(_0x6f2f('0x6'));var csv=require(_0x6f2f('0x7'));var ejs=require(_0x6f2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6f2f('0x9'));var crypto=require(_0x6f2f('0xa'));var jsforce=require(_0x6f2f('0xb'));var deskjs=require(_0x6f2f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6f2f('0xd'));var Papa=require(_0x6f2f('0xe'));var Redis=require(_0x6f2f('0xf'));var authService=require(_0x6f2f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6f2f('0x11'));var hardwareService=require(_0x6f2f('0x12'));var logger=require('../../config/logger')(_0x6f2f('0x13'));var utils=require(_0x6f2f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6f2f('0x15'));var db=require(_0x6f2f('0x16'))['db'];function respondWithStatusCode(_0xd3402c,_0x4e7e36){_0x4e7e36=_0x4e7e36||0xcc;return function(_0x348bcd){if(_0x348bcd){return _0xd3402c['sendStatus'](_0x4e7e36);}return _0xd3402c[_0x6f2f('0x17')](_0x4e7e36)['end']();};}function respondWithResult(_0x1892de,_0x20be3e){_0x20be3e=_0x20be3e||0xc8;return function(_0x16de7b){if(_0x16de7b){return _0x1892de['status'](_0x20be3e)[_0x6f2f('0x18')](_0x16de7b);}};}function respondWithFilteredResult(_0x6e06ac,_0xecf226){return function(_0x394c52){if(_0x394c52){var _0x3ebbe1=typeof _0xecf226[_0x6f2f('0x19')]===_0x6f2f('0x1a')&&typeof _0xecf226['limit']==='undefined';var _0x5cbc64=_0x394c52[_0x6f2f('0x1b')];var _0xc7a49a=_0x3ebbe1?0x0:_0xecf226[_0x6f2f('0x19')];var _0x36207f=_0x3ebbe1?_0x394c52[_0x6f2f('0x1b')]:_0xecf226[_0x6f2f('0x19')]+_0xecf226[_0x6f2f('0x1c')];var _0x1d3eba;if(_0x36207f>=_0x5cbc64){_0x36207f=_0x5cbc64;_0x1d3eba=0xc8;}else{_0x1d3eba=0xce;}_0x6e06ac[_0x6f2f('0x17')](_0x1d3eba);return _0x6e06ac[_0x6f2f('0x1d')](_0x6f2f('0x1e'),_0xc7a49a+'-'+_0x36207f+'/'+_0x5cbc64)[_0x6f2f('0x18')](_0x394c52);}return null;};}function patchUpdates(_0x3dee7d){return function(_0x1d21b2){try{jsonpatch[_0x6f2f('0x1f')](_0x1d21b2,_0x3dee7d,!![]);}catch(_0xbfdabf){return BPromise['reject'](_0xbfdabf);}return _0x1d21b2[_0x6f2f('0x20')]();};}function saveUpdates(_0x40e737,_0x7b2a61){return function(_0xa11b7){if(_0xa11b7){return _0xa11b7[_0x6f2f('0x21')](_0x40e737)[_0x6f2f('0x22')](function(_0x122581){return _0x122581;});}return null;};}function removeEntity(_0x43649b,_0x229911){return function(_0x163ce5){if(_0x163ce5){return _0x163ce5['destroy']()[_0x6f2f('0x22')](function(){_0x43649b['status'](0xcc)[_0x6f2f('0x23')]();});}};}function handleEntityNotFound(_0x11fff4,_0x1fafa9){return function(_0x3c1b22){if(!_0x3c1b22){_0x11fff4[_0x6f2f('0x24')](0x194);}return _0x3c1b22;};}function handleError(_0x31e70f,_0x2408c1){_0x2408c1=_0x2408c1||0x1f4;return function(_0x45b1b2){logger[_0x6f2f('0x25')](_0x45b1b2[_0x6f2f('0x26')]);if(_0x45b1b2['name']){delete _0x45b1b2['name'];}_0x31e70f[_0x6f2f('0x17')](_0x2408c1)[_0x6f2f('0x27')](_0x45b1b2);};}exports['index']=function(_0x51ef76,_0x450efd){var _0x2f1fa3={},_0x36c01e={},_0x3e6f1b={'count':0x0,'rows':[]};var _0x3889c4=_['map'](db[_0x6f2f('0x28')][_0x6f2f('0x29')],function(_0x50c282){return{'name':_0x50c282[_0x6f2f('0x2a')],'type':_0x50c282[_0x6f2f('0x2b')][_0x6f2f('0x2c')]};});_0x36c01e[_0x6f2f('0x2d')]=_[_0x6f2f('0x2e')](_0x3889c4,'name');_0x36c01e[_0x6f2f('0x2f')]=_[_0x6f2f('0x30')](_0x51ef76['query']);_0x36c01e['filters']=_[_0x6f2f('0x31')](_0x36c01e[_0x6f2f('0x2d')],_0x36c01e[_0x6f2f('0x2f')]);_0x2f1fa3[_0x6f2f('0x32')]=_[_0x6f2f('0x31')](_0x36c01e[_0x6f2f('0x2d')],qs[_0x6f2f('0x33')](_0x51ef76['query'][_0x6f2f('0x33')]));_0x2f1fa3['attributes']=_0x2f1fa3[_0x6f2f('0x32')][_0x6f2f('0x34')]?_0x2f1fa3[_0x6f2f('0x32')]:_0x36c01e[_0x6f2f('0x2d')];if(!_0x51ef76[_0x6f2f('0x2f')][_0x6f2f('0x35')]('nolimit')){_0x2f1fa3[_0x6f2f('0x1c')]=qs['limit'](_0x51ef76['query']['limit']);_0x2f1fa3[_0x6f2f('0x19')]=qs['offset'](_0x51ef76['query'][_0x6f2f('0x19')]);}_0x2f1fa3[_0x6f2f('0x36')]=qs[_0x6f2f('0x37')](_0x51ef76[_0x6f2f('0x2f')][_0x6f2f('0x37')]);_0x2f1fa3['where']=qs[_0x6f2f('0x38')](_[_0x6f2f('0x39')](_0x51ef76[_0x6f2f('0x2f')],_0x36c01e[_0x6f2f('0x38')]),_0x3889c4);if(_0x51ef76[_0x6f2f('0x2f')][_0x6f2f('0x3a')]){_0x2f1fa3[_0x6f2f('0x3b')]=_[_0x6f2f('0x3c')](_0x2f1fa3[_0x6f2f('0x3b')],{'$or':_[_0x6f2f('0x2e')](_0x3889c4,function(_0x2ce25a){if(_0x2ce25a[_0x6f2f('0x2b')]!==_0x6f2f('0x3d')){var _0x21553b={};_0x21553b[_0x2ce25a[_0x6f2f('0x3e')]]={'$like':'%'+_0x51ef76[_0x6f2f('0x2f')][_0x6f2f('0x3a')]+'%'};return _0x21553b;}})});}_0x2f1fa3=_['merge']({},_0x2f1fa3,_0x51ef76['options']);var _0x1d936a={'where':_0x2f1fa3[_0x6f2f('0x3b')]};return db[_0x6f2f('0x28')][_0x6f2f('0x1b')](_0x1d936a)[_0x6f2f('0x22')](function(_0x2564db){_0x3e6f1b['count']=_0x2564db;if(_0x51ef76[_0x6f2f('0x2f')]['includeAll']){_0x2f1fa3['include']=[{'all':!![]}];}return db[_0x6f2f('0x28')]['findAll'](_0x2f1fa3);})[_0x6f2f('0x22')](function(_0x119249){_0x3e6f1b[_0x6f2f('0x3f')]=_0x119249;return _0x3e6f1b;})['then'](respondWithFilteredResult(_0x450efd,_0x2f1fa3))['catch'](handleError(_0x450efd,null));};exports[_0x6f2f('0x40')]=function(_0x20f60c,_0x436a28){var _0x61ec18={'raw':!![],'where':{'id':_0x20f60c[_0x6f2f('0x41')]['id']}},_0x471752={};_0x471752[_0x6f2f('0x2d')]=_['keys'](db['SmsTransferReport'][_0x6f2f('0x29')]);_0x471752[_0x6f2f('0x2f')]=_[_0x6f2f('0x30')](_0x20f60c[_0x6f2f('0x2f')]);_0x471752[_0x6f2f('0x38')]=_[_0x6f2f('0x31')](_0x471752[_0x6f2f('0x2d')],_0x471752[_0x6f2f('0x2f')]);_0x61ec18['attributes']=_[_0x6f2f('0x31')](_0x471752[_0x6f2f('0x2d')],qs[_0x6f2f('0x33')](_0x20f60c['query'][_0x6f2f('0x33')]));_0x61ec18[_0x6f2f('0x32')]=_0x61ec18[_0x6f2f('0x32')][_0x6f2f('0x34')]?_0x61ec18['attributes']:_0x471752[_0x6f2f('0x2d')];if(_0x20f60c[_0x6f2f('0x2f')][_0x6f2f('0x42')]){_0x61ec18['include']=[{'all':!![]}];}_0x61ec18=_[_0x6f2f('0x3c')]({},_0x61ec18,_0x20f60c[_0x6f2f('0x43')]);return db[_0x6f2f('0x28')][_0x6f2f('0x44')](_0x61ec18)[_0x6f2f('0x22')](handleEntityNotFound(_0x436a28,null))[_0x6f2f('0x22')](respondWithResult(_0x436a28,null))['catch'](handleError(_0x436a28,null));};exports[_0x6f2f('0x45')]=function(_0x2dd7af,_0x228470){return db[_0x6f2f('0x28')][_0x6f2f('0x45')](_0x2dd7af[_0x6f2f('0x46')],{})[_0x6f2f('0x22')](respondWithResult(_0x228470,0xc9))['catch'](handleError(_0x228470,null));};exports[_0x6f2f('0x21')]=function(_0x54f4a1,_0x59c4e8){if(_0x54f4a1[_0x6f2f('0x46')]['id']){delete _0x54f4a1['body']['id'];}return db[_0x6f2f('0x28')][_0x6f2f('0x44')]({'where':{'id':_0x54f4a1['params']['id']}})[_0x6f2f('0x22')](handleEntityNotFound(_0x59c4e8,null))[_0x6f2f('0x22')](saveUpdates(_0x54f4a1['body'],null))['then'](respondWithResult(_0x59c4e8,null))[_0x6f2f('0x47')](handleError(_0x59c4e8,null));};exports[_0x6f2f('0x48')]=function(_0xbb8ea2,_0x537a3e){return db[_0x6f2f('0x28')][_0x6f2f('0x44')]({'where':{'id':_0xbb8ea2[_0x6f2f('0x41')]['id']}})[_0x6f2f('0x22')](handleEntityNotFound(_0x537a3e,null))[_0x6f2f('0x22')](removeEntity(_0x537a3e,null))[_0x6f2f('0x47')](handleError(_0x537a3e,null));};exports['describe']=function(_0x5e00fb,_0x144fa8){return db[_0x6f2f('0x28')][_0x6f2f('0x49')]()[_0x6f2f('0x22')](respondWithResult(_0x144fa8,null))['catch'](handleError(_0x144fa8,null));}; \ No newline at end of file +var _0x17f1=['../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','then','destroy','stack','name','send','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','SmsTransferReport','includeAll','findAll','show','params','include','find','catch','body','update','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x324b12,_0x86c735){var _0x46addd=function(_0x3285b4){while(--_0x3285b4){_0x324b12['push'](_0x324b12['shift']());}};_0x46addd(++_0x86c735);}(_0x17f1,0x19d));var _0x117f=function(_0x2f7f62,_0x48fa3a){_0x2f7f62=_0x2f7f62-0x0;var _0x477878=_0x17f1[_0x2f7f62];return _0x477878;};'use strict';var emlformat=require(_0x117f('0x0'));var rimraf=require(_0x117f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x117f('0x2'));var moment=require(_0x117f('0x3'));var BPromise=require(_0x117f('0x4'));var Mustache=require(_0x117f('0x5'));var util=require(_0x117f('0x6'));var path=require('path');var sox=require(_0x117f('0x7'));var csv=require(_0x117f('0x8'));var ejs=require(_0x117f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x117f('0xa'));var squel=require(_0x117f('0xb'));var crypto=require(_0x117f('0xc'));var jsforce=require(_0x117f('0xd'));var deskjs=require(_0x117f('0xe'));var toCsv=require(_0x117f('0x8'));var querystring=require(_0x117f('0xf'));var Papa=require(_0x117f('0x10'));var Redis=require(_0x117f('0x11'));var authService=require(_0x117f('0x12'));var qs=require(_0x117f('0x13'));var as=require(_0x117f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x117f('0x15'))(_0x117f('0x16'));var utils=require(_0x117f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x117f('0x18'));var db=require(_0x117f('0x19'))['db'];function respondWithStatusCode(_0x2f225a,_0x2b65c4){_0x2b65c4=_0x2b65c4||0xcc;return function(_0x9e149d){if(_0x9e149d){return _0x2f225a[_0x117f('0x1a')](_0x2b65c4);}return _0x2f225a[_0x117f('0x1b')](_0x2b65c4)[_0x117f('0x1c')]();};}function respondWithResult(_0xd9c5d0,_0x25f1c4){_0x25f1c4=_0x25f1c4||0xc8;return function(_0x2faa4e){if(_0x2faa4e){return _0xd9c5d0[_0x117f('0x1b')](_0x25f1c4)['json'](_0x2faa4e);}};}function respondWithFilteredResult(_0x2734bd,_0x593c32){return function(_0x319c83){if(_0x319c83){var _0x58099e=typeof _0x593c32[_0x117f('0x1d')]==='undefined'&&typeof _0x593c32[_0x117f('0x1e')]===_0x117f('0x1f');var _0x403219=_0x319c83[_0x117f('0x20')];var _0x71bee1=_0x58099e?0x0:_0x593c32[_0x117f('0x1d')];var _0x464a21=_0x58099e?_0x319c83[_0x117f('0x20')]:_0x593c32[_0x117f('0x1d')]+_0x593c32[_0x117f('0x1e')];var _0x194bf4;if(_0x464a21>=_0x403219){_0x464a21=_0x403219;_0x194bf4=0xc8;}else{_0x194bf4=0xce;}_0x2734bd[_0x117f('0x1b')](_0x194bf4);return _0x2734bd['set'](_0x117f('0x21'),_0x71bee1+'-'+_0x464a21+'/'+_0x403219)[_0x117f('0x22')](_0x319c83);}return null;};}function patchUpdates(_0x30f44e){return function(_0x1ec830){try{jsonpatch['apply'](_0x1ec830,_0x30f44e,!![]);}catch(_0x3bb5a7){return BPromise[_0x117f('0x23')](_0x3bb5a7);}return _0x1ec830[_0x117f('0x24')]();};}function saveUpdates(_0x2d0720,_0x388073){return function(_0x2d869b){if(_0x2d869b){return _0x2d869b['update'](_0x2d0720)[_0x117f('0x25')](function(_0x454db8){return _0x454db8;});}return null;};}function removeEntity(_0xee61ac,_0x40f6de){return function(_0x6bfad9){if(_0x6bfad9){return _0x6bfad9[_0x117f('0x26')]()['then'](function(){_0xee61ac[_0x117f('0x1b')](0xcc)[_0x117f('0x1c')]();});}};}function handleEntityNotFound(_0x58b33f,_0x4a11cd){return function(_0x4e2fb5){if(!_0x4e2fb5){_0x58b33f['sendStatus'](0x194);}return _0x4e2fb5;};}function handleError(_0x170e6f,_0x477007){_0x477007=_0x477007||0x1f4;return function(_0x23d5fe){logger['error'](_0x23d5fe[_0x117f('0x27')]);if(_0x23d5fe['name']){delete _0x23d5fe[_0x117f('0x28')];}_0x170e6f['status'](_0x477007)[_0x117f('0x29')](_0x23d5fe);};}exports['index']=function(_0x390587,_0xcd3d15){var _0xe8aa68={},_0x35ebc2={},_0x31e262={'count':0x0,'rows':[]};var _0x132176=_['map'](db['SmsTransferReport'][_0x117f('0x2a')],function(_0x283f1e){return{'name':_0x283f1e[_0x117f('0x2b')],'type':_0x283f1e[_0x117f('0x2c')]['key']};});_0x35ebc2[_0x117f('0x2d')]=_['map'](_0x132176,_0x117f('0x28'));_0x35ebc2[_0x117f('0x2e')]=_[_0x117f('0x2f')](_0x390587[_0x117f('0x2e')]);_0x35ebc2[_0x117f('0x30')]=_[_0x117f('0x31')](_0x35ebc2['model'],_0x35ebc2[_0x117f('0x2e')]);_0xe8aa68[_0x117f('0x32')]=_['intersection'](_0x35ebc2[_0x117f('0x2d')],qs[_0x117f('0x33')](_0x390587[_0x117f('0x2e')][_0x117f('0x33')]));_0xe8aa68[_0x117f('0x32')]=_0xe8aa68[_0x117f('0x32')][_0x117f('0x34')]?_0xe8aa68[_0x117f('0x32')]:_0x35ebc2['model'];if(!_0x390587['query'][_0x117f('0x35')](_0x117f('0x36'))){_0xe8aa68['limit']=qs[_0x117f('0x1e')](_0x390587[_0x117f('0x2e')][_0x117f('0x1e')]);_0xe8aa68['offset']=qs['offset'](_0x390587[_0x117f('0x2e')]['offset']);}_0xe8aa68['order']=qs[_0x117f('0x37')](_0x390587['query'][_0x117f('0x37')]);_0xe8aa68[_0x117f('0x38')]=qs[_0x117f('0x30')](_[_0x117f('0x39')](_0x390587[_0x117f('0x2e')],_0x35ebc2[_0x117f('0x30')]),_0x132176);if(_0x390587[_0x117f('0x2e')][_0x117f('0x3a')]){_0xe8aa68[_0x117f('0x38')]=_[_0x117f('0x3b')](_0xe8aa68[_0x117f('0x38')],{'$or':_[_0x117f('0x3c')](_0x132176,function(_0x4ff5af){if(_0x4ff5af['type']!==_0x117f('0x3d')){var _0x406242={};_0x406242[_0x4ff5af[_0x117f('0x28')]]={'$like':'%'+_0x390587['query'][_0x117f('0x3a')]+'%'};return _0x406242;}})});}_0xe8aa68=_[_0x117f('0x3b')]({},_0xe8aa68,_0x390587['options']);var _0x54f5d2={'where':_0xe8aa68['where']};return db[_0x117f('0x3e')][_0x117f('0x20')](_0x54f5d2)[_0x117f('0x25')](function(_0x295873){_0x31e262['count']=_0x295873;if(_0x390587[_0x117f('0x2e')][_0x117f('0x3f')]){_0xe8aa68['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x117f('0x40')](_0xe8aa68);})[_0x117f('0x25')](function(_0xcd18fa){_0x31e262['rows']=_0xcd18fa;return _0x31e262;})[_0x117f('0x25')](respondWithFilteredResult(_0xcd3d15,_0xe8aa68))['catch'](handleError(_0xcd3d15,null));};exports[_0x117f('0x41')]=function(_0x2f6bbc,_0x45eec1){var _0x2c21f7={'raw':!![],'where':{'id':_0x2f6bbc[_0x117f('0x42')]['id']}},_0x2e44d0={};_0x2e44d0['model']=_['keys'](db[_0x117f('0x3e')][_0x117f('0x2a')]);_0x2e44d0[_0x117f('0x2e')]=_[_0x117f('0x2f')](_0x2f6bbc[_0x117f('0x2e')]);_0x2e44d0[_0x117f('0x30')]=_[_0x117f('0x31')](_0x2e44d0['model'],_0x2e44d0[_0x117f('0x2e')]);_0x2c21f7[_0x117f('0x32')]=_['intersection'](_0x2e44d0['model'],qs[_0x117f('0x33')](_0x2f6bbc[_0x117f('0x2e')][_0x117f('0x33')]));_0x2c21f7['attributes']=_0x2c21f7[_0x117f('0x32')][_0x117f('0x34')]?_0x2c21f7[_0x117f('0x32')]:_0x2e44d0[_0x117f('0x2d')];if(_0x2f6bbc[_0x117f('0x2e')]['includeAll']){_0x2c21f7[_0x117f('0x43')]=[{'all':!![]}];}_0x2c21f7=_[_0x117f('0x3b')]({},_0x2c21f7,_0x2f6bbc['options']);return db[_0x117f('0x3e')][_0x117f('0x44')](_0x2c21f7)[_0x117f('0x25')](handleEntityNotFound(_0x45eec1,null))[_0x117f('0x25')](respondWithResult(_0x45eec1,null))[_0x117f('0x45')](handleError(_0x45eec1,null));};exports['create']=function(_0x2b99ef,_0x3ae7e5){return db[_0x117f('0x3e')]['create'](_0x2b99ef[_0x117f('0x46')],{})[_0x117f('0x25')](respondWithResult(_0x3ae7e5,0xc9))[_0x117f('0x45')](handleError(_0x3ae7e5,null));};exports[_0x117f('0x47')]=function(_0x437fe0,_0x3f7493){if(_0x437fe0[_0x117f('0x46')]['id']){delete _0x437fe0[_0x117f('0x46')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x437fe0['params']['id']}})['then'](handleEntityNotFound(_0x3f7493,null))[_0x117f('0x25')](saveUpdates(_0x437fe0[_0x117f('0x46')],null))['then'](respondWithResult(_0x3f7493,null))[_0x117f('0x45')](handleError(_0x3f7493,null));};exports['destroy']=function(_0x447242,_0x13dda9){return db['SmsTransferReport'][_0x117f('0x44')]({'where':{'id':_0x447242[_0x117f('0x42')]['id']}})[_0x117f('0x25')](handleEntityNotFound(_0x13dda9,null))['then'](removeEntity(_0x13dda9,null))[_0x117f('0x45')](handleError(_0x13dda9,null));};exports[_0x117f('0x48')]=function(_0x5c1a5b,_0x21a825){return db[_0x117f('0x3e')]['describe']()['then'](respondWithResult(_0x21a825,null))[_0x117f('0x45')](handleError(_0x21a825,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 2053eb5..a3195d8 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 _0x0b14=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0xe44064,_0x22950c){var _0x243b9d=function(_0x1e22d1){while(--_0x1e22d1){_0xe44064['push'](_0xe44064['shift']());}};_0x243b9d(++_0x22950c);}(_0x0b14,0x117));var _0x40b1=function(_0x447c29,_0x1254d5){_0x447c29=_0x447c29-0x0;var _0x4516af=_0x0b14[_0x447c29];return _0x4516af;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x40b1('0x0'))(_0x40b1('0x1'));var moment=require(_0x40b1('0x2'));var BPromise=require(_0x40b1('0x3'));var rp=require(_0x40b1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x40b1('0x5'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x23683f,_0x3d34e2){return _0x23683f['define'](_0x40b1('0x6'),attributes,{'tableName':_0x40b1('0x7'),'paranoid':![],'indexes':[{'name':_0x40b1('0x8'),'fields':[_0x40b1('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x22f6=['bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','moment'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0x22f6,0x10e));var _0x622f=function(_0x4f9d1f,_0x45682b){_0x4f9d1f=_0x4f9d1f-0x0;var _0x3ce0b5=_0x22f6[_0x4f9d1f];return _0x3ce0b5;};'use strict';var _=require(_0x622f('0x0'));var util=require('util');var logger=require(_0x622f('0x1'))('api');var moment=require(_0x622f('0x2'));var BPromise=require(_0x622f('0x3'));var rp=require(_0x622f('0x4'));var fs=require('fs');var path=require(_0x622f('0x5'));var rimraf=require(_0x622f('0x6'));var config=require(_0x622f('0x7'));var attributes=require(_0x622f('0x8'));module[_0x622f('0x9')]=function(_0x659c64,_0x342d96){return _0x659c64['define'](_0x622f('0xa'),attributes,{'tableName':_0x622f('0xb'),'paranoid':![],'indexes':[{'name':_0x622f('0xc'),'fields':[_0x622f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 7ae70c6..3c49f84 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 _0xd8af=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x3ed5fb,_0x1be775){var _0x4327c2=function(_0x2d5f2b){while(--_0x2d5f2b){_0x3ed5fb['push'](_0x3ed5fb['shift']());}};_0x4327c2(++_0x1be775);}(_0xd8af,0x18d));var _0xfd8a=function(_0x40b9f5,_0x50d64e){_0x40b9f5=_0x40b9f5-0x0;var _0x34ce01=_0xd8af[_0x40b9f5];return _0x34ce01;};'use strict';var _=require(_0xfd8a('0x0'));var util=require(_0xfd8a('0x1'));var moment=require(_0xfd8a('0x2'));var BPromise=require(_0xfd8a('0x3'));var rs=require(_0xfd8a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd8a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd8a('0x6'))(_0xfd8a('0x7'));var config=require(_0xfd8a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfd8a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8b725c,_0xdb72fc,_0x31fdfc){return new BPromise(function(_0x1d1fb4,_0x5d2f8d){return client[_0xfd8a('0xa')](_0x8b725c,_0x31fdfc)[_0xfd8a('0xb')](function(_0x2c7d72){logger[_0xfd8a('0xc')](_0xfd8a('0xd'),_0xdb72fc,_0xfd8a('0xe'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0xdb72fc,_0xfd8a('0xe'),JSON[_0xfd8a('0xf')](_0x2c7d72));if(_0x2c7d72[_0xfd8a('0x10')]){if(_0x2c7d72['error']['code']===0x1f4){logger['error'](_0xfd8a('0xd'),_0xdb72fc,_0x2c7d72[_0xfd8a('0x10')]['message']);return _0x5d2f8d(_0x2c7d72['error'][_0xfd8a('0x11')]);}logger[_0xfd8a('0x10')](_0xfd8a('0xd'),_0xdb72fc,_0x2c7d72[_0xfd8a('0x10')][_0xfd8a('0x11')]);return _0x1d1fb4(_0x2c7d72[_0xfd8a('0x10')][_0xfd8a('0x11')]);}else{logger[_0xfd8a('0xc')](_0xfd8a('0xd'),_0xdb72fc,_0xfd8a('0xe'));_0x1d1fb4(_0x2c7d72[_0xfd8a('0x12')][_0xfd8a('0x11')]);}})[_0xfd8a('0x13')](function(_0x25eed2){logger[_0xfd8a('0x10')](_0xfd8a('0xd'),_0xdb72fc,_0x25eed2);_0x5d2f8d(_0x25eed2);});});} \ No newline at end of file +var _0x4e00=['http','request','then','info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x20c205,_0x39bc5e){var _0x3d6cf2=function(_0x209286){while(--_0x209286){_0x20c205['push'](_0x20c205['shift']());}};_0x3d6cf2(++_0x39bc5e);}(_0x4e00,0xa0));var _0x04e0=function(_0x3898a9,_0x19c09b){_0x3898a9=_0x3898a9-0x0;var _0x4d1028=_0x4e00[_0x3898a9];return _0x4d1028;};'use strict';var _=require('lodash');var util=require(_0x04e0('0x0'));var moment=require('moment');var BPromise=require(_0x04e0('0x1'));var rs=require(_0x04e0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x04e0('0x3'));var logger=require('../../config/logger')(_0x04e0('0x4'));var config=require(_0x04e0('0x5'));var jayson=require(_0x04e0('0x6'));var client=jayson[_0x04e0('0x7')][_0x04e0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42521b,_0x45ed1b,_0x4c3fb0){return new BPromise(function(_0x10cada,_0x3a47a6){return client[_0x04e0('0x9')](_0x42521b,_0x4c3fb0)[_0x04e0('0xa')](function(_0x553f83){logger[_0x04e0('0xb')](_0x04e0('0xc'),_0x45ed1b,'request\x20sent');logger['debug'](_0x04e0('0xd'),_0x45ed1b,'request\x20sent',JSON[_0x04e0('0xe')](_0x553f83));if(_0x553f83[_0x04e0('0xf')]){if(_0x553f83[_0x04e0('0xf')][_0x04e0('0x10')]===0x1f4){logger[_0x04e0('0xf')](_0x04e0('0xc'),_0x45ed1b,_0x553f83[_0x04e0('0xf')][_0x04e0('0x11')]);return _0x3a47a6(_0x553f83['error'][_0x04e0('0x11')]);}logger['error'](_0x04e0('0xc'),_0x45ed1b,_0x553f83[_0x04e0('0xf')][_0x04e0('0x11')]);return _0x10cada(_0x553f83['error'][_0x04e0('0x11')]);}else{logger[_0x04e0('0xb')](_0x04e0('0xc'),_0x45ed1b,_0x04e0('0x12'));_0x10cada(_0x553f83[_0x04e0('0x13')][_0x04e0('0x11')]);}})[_0x04e0('0x14')](function(_0x2cacbc){logger[_0x04e0('0xf')](_0x04e0('0xc'),_0x45ed1b,_0x2cacbc);_0x3a47a6(_0x2cacbc);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 349ff23..766d5c5 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 _0xb5c5=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./sound.controller','index','get','/:id','isAuthenticated','show','diskStorage','join','root','server/files/sounds/original/','replace','%s-%s%s','basename','originalname','extname','now','post','create','put','delete','exports'];(function(_0x307ba9,_0x55cb03){var _0x198dcb=function(_0x4ec59c){while(--_0x4ec59c){_0x307ba9['push'](_0x307ba9['shift']());}};_0x198dcb(++_0x55cb03);}(_0xb5c5,0xae));var _0x5b5c=function(_0x302b09,_0x5681d5){_0x302b09=_0x302b09-0x0;var _0x1fd725=_0xb5c5[_0x302b09];return _0x1fd725;};'use strict';var multer=require(_0x5b5c('0x0'));var util=require('util');var path=require(_0x5b5c('0x1'));var timeout=require(_0x5b5c('0x2'));var express=require(_0x5b5c('0x3'));var router=express[_0x5b5c('0x4')]();var fs_extra=require(_0x5b5c('0x5'));var auth=require(_0x5b5c('0x6'));var interaction=require(_0x5b5c('0x7'));var config=require('../../config/environment');var controller=require(_0x5b5c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5b5c('0x9')]);router[_0x5b5c('0xa')](_0x5b5c('0xb'),auth[_0x5b5c('0xc')](),controller[_0x5b5c('0xd')]);router[_0x5b5c('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x5b5c('0xe')]({'destination':function(_0x11b248,_0x1fe550,_0x1c17d1){_0x1c17d1(null,path[_0x5b5c('0xf')](config[_0x5b5c('0x10')],_0x5b5c('0x11')));},'filename':function(_0x5339cc,_0xd9dcc7,_0xfd0620){_0xd9dcc7['originalname']=_0xd9dcc7['originalname'][_0x5b5c('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xfd0620(null,util['format'](_0x5b5c('0x13'),path[_0x5b5c('0x14')](_0xd9dcc7[_0x5b5c('0x15')],path[_0x5b5c('0x16')](_0xd9dcc7[_0x5b5c('0x15')])),Date[_0x5b5c('0x17')](),path[_0x5b5c('0x16')](_0xd9dcc7['originalname'])));}})});router[_0x5b5c('0x18')]('/',upload['single']('file'),controller[_0x5b5c('0x19')]);router[_0x5b5c('0x1a')](_0x5b5c('0xb'),auth[_0x5b5c('0xc')](),controller['update']);router[_0x5b5c('0x1b')](_0x5b5c('0xb'),auth[_0x5b5c('0xc')](),controller['delete']);module[_0x5b5c('0x1c')]=router; \ No newline at end of file +var _0xd2e3=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','now','file','create','put'];(function(_0x15dc14,_0x45ad25){var _0x1a4954=function(_0x32a722){while(--_0x32a722){_0x15dc14['push'](_0x15dc14['shift']());}};_0x1a4954(++_0x45ad25);}(_0xd2e3,0x183));var _0x3d2e=function(_0x283340,_0x5239bc){_0x283340=_0x283340-0x0;var _0x5c0f29=_0xd2e3[_0x283340];return _0x5c0f29;};'use strict';var multer=require(_0x3d2e('0x0'));var util=require(_0x3d2e('0x1'));var path=require(_0x3d2e('0x2'));var timeout=require(_0x3d2e('0x3'));var express=require(_0x3d2e('0x4'));var router=express[_0x3d2e('0x5')]();var fs_extra=require(_0x3d2e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3d2e('0x7'));var config=require('../../config/environment');var controller=require(_0x3d2e('0x8'));router[_0x3d2e('0x9')]('/',auth['isAuthenticated'](),controller[_0x3d2e('0xa')]);router[_0x3d2e('0x9')](_0x3d2e('0xb'),auth[_0x3d2e('0xc')](),controller[_0x3d2e('0xd')]);router[_0x3d2e('0x9')](_0x3d2e('0xe'),auth[_0x3d2e('0xc')](),controller[_0x3d2e('0xf')]);var upload=multer({'storage':multer[_0x3d2e('0x10')]({'destination':function(_0x57f750,_0x5954ae,_0xf54804){_0xf54804(null,path[_0x3d2e('0x11')](config[_0x3d2e('0x12')],_0x3d2e('0x13')));},'filename':function(_0x2a9f6d,_0x3d7894,_0x26b867){_0x3d7894[_0x3d2e('0x14')]=_0x3d7894[_0x3d2e('0x14')][_0x3d2e('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x26b867(null,util[_0x3d2e('0x16')](_0x3d2e('0x17'),path[_0x3d2e('0x18')](_0x3d7894[_0x3d2e('0x14')],path['extname'](_0x3d7894[_0x3d2e('0x14')])),Date[_0x3d2e('0x19')](),path['extname'](_0x3d7894[_0x3d2e('0x14')])));}})});router['post']('/',upload['single'](_0x3d2e('0x1a')),controller[_0x3d2e('0x1b')]);router[_0x3d2e('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x3d2e('0x1d')]);router[_0x3d2e('0x1e')](_0x3d2e('0xb'),auth['isAuthenticated'](),controller[_0x3d2e('0x1e')]);module[_0x3d2e('0x1f')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 5e7c7ca..774ddcb 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 _0x1fa2=['sequelize','exports','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x6cfdbc,_0x44d818){var _0x30bf4f=function(_0x47fd89){while(--_0x47fd89){_0x6cfdbc['push'](_0x6cfdbc['shift']());}};_0x30bf4f(++_0x44d818);}(_0x1fa2,0x150));var _0x21fa=function(_0x1daba2,_0xbb63fd){_0x1daba2=_0x1daba2-0x0;var _0x32d30f=_0x1fa2[_0x1daba2];return _0x32d30f;};'use strict';var Sequelize=require(_0x21fa('0x0'));module[_0x21fa('0x1')]={'name':{'type':Sequelize[_0x21fa('0x2')],'unique':_0x21fa('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x21fa('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x21fa('0x4')]},'original_sampleCount':{'type':Sequelize[_0x21fa('0x5')]},'original_channelCount':{'type':Sequelize[_0x21fa('0x6')]},'original_bitRate':{'type':Sequelize[_0x21fa('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x21fa('0x5')]},'converted_channelCount':{'type':Sequelize[_0x21fa('0x6')]},'converted_bitRate':{'type':Sequelize[_0x21fa('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x21fa('0x6')]}}; \ No newline at end of file +var _0x9c04=['name','STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x22cc92,_0x428489){var _0x3ec769=function(_0x3a925d){while(--_0x3a925d){_0x22cc92['push'](_0x22cc92['shift']());}};_0x3ec769(++_0x428489);}(_0x9c04,0xe3));var _0x49c0=function(_0x701566,_0x7de6cb){_0x701566=_0x701566-0x0;var _0x64b6c9=_0x9c04[_0x701566];return _0x64b6c9;};'use strict';var Sequelize=require(_0x49c0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x49c0('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x49c0('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x49c0('0x2')]},'original_duration':{'type':Sequelize[_0x49c0('0x3')]},'original_sampleCount':{'type':Sequelize[_0x49c0('0x4')]},'original_channelCount':{'type':Sequelize[_0x49c0('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x49c0('0x5')]},'converted_format':{'type':Sequelize[_0x49c0('0x2')]},'converted_duration':{'type':Sequelize[_0x49c0('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x49c0('0x4')]},'converted_channelCount':{'type':Sequelize[_0x49c0('0x5')]},'converted_bitRate':{'type':Sequelize[_0x49c0('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index a1a6061..1df7754 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 _0x73ef=['includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','download','save_name','converted_format','existsSync','root','server/files/sounds/converted','ValidationError','join','format','%s.%s','create','file','originalname','extname','basename','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','src','original_duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','start','description','server/files/sounds/original','original_format','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','get','Sounds','destroy','error','name','send','index','map','Sound','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x73ef,0x1b7));var _0xf73e=function(_0x2ba89f,_0x5c1e6d){_0x2ba89f=_0x2ba89f-0x0;var _0x29f5fa=_0x73ef[_0x2ba89f];return _0x29f5fa;};'use strict';var emlformat=require(_0xf73e('0x0'));var rimraf=require(_0xf73e('0x1'));var zipdir=require(_0xf73e('0x2'));var jsonpatch=require(_0xf73e('0x3'));var rp=require(_0xf73e('0x4'));var moment=require(_0xf73e('0x5'));var BPromise=require(_0xf73e('0x6'));var Mustache=require(_0xf73e('0x7'));var util=require(_0xf73e('0x8'));var path=require(_0xf73e('0x9'));var sox=require('sox');var csv=require(_0xf73e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf73e('0xb'));var squel=require('squel');var crypto=require(_0xf73e('0xc'));var jsforce=require(_0xf73e('0xd'));var deskjs=require(_0xf73e('0xe'));var toCsv=require(_0xf73e('0xa'));var querystring=require(_0xf73e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf73e('0x10'));var authService=require(_0xf73e('0x11'));var qs=require(_0xf73e('0x12'));var as=require(_0xf73e('0x13'));var hardwareService=require(_0xf73e('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf73e('0x15'));var config=require(_0xf73e('0x16'));var licenseUtil=require(_0xf73e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c2a83,_0x2bd216){_0x2bd216=_0x2bd216||0xcc;return function(_0x26ca10){if(_0x26ca10){return _0x4c2a83['sendStatus'](_0x2bd216);}return _0x4c2a83[_0xf73e('0x18')](_0x2bd216)[_0xf73e('0x19')]();};}function respondWithResult(_0x7e502e,_0xe7dc90){_0xe7dc90=_0xe7dc90||0xc8;return function(_0x333436){if(_0x333436){return _0x7e502e[_0xf73e('0x18')](_0xe7dc90)[_0xf73e('0x1a')](_0x333436);}};}function respondWithFilteredResult(_0x514129,_0x156590){return function(_0x401bab){if(_0x401bab){var _0x2b2232=typeof _0x156590['offset']===_0xf73e('0x1b')&&typeof _0x156590[_0xf73e('0x1c')]==='undefined';var _0x373342=_0x401bab[_0xf73e('0x1d')];var _0x34ed48=_0x2b2232?0x0:_0x156590[_0xf73e('0x1e')];var _0x4b7d20=_0x2b2232?_0x401bab[_0xf73e('0x1d')]:_0x156590['offset']+_0x156590[_0xf73e('0x1c')];var _0xdf49ac;if(_0x4b7d20>=_0x373342){_0x4b7d20=_0x373342;_0xdf49ac=0xc8;}else{_0xdf49ac=0xce;}_0x514129[_0xf73e('0x18')](_0xdf49ac);return _0x514129[_0xf73e('0x1f')](_0xf73e('0x20'),_0x34ed48+'-'+_0x4b7d20+'/'+_0x373342)['json'](_0x401bab);}return null;};}function patchUpdates(_0x1d85f5){return function(_0xe92db3){try{jsonpatch[_0xf73e('0x21')](_0xe92db3,_0x1d85f5,!![]);}catch(_0x88d35){return BPromise['reject'](_0x88d35);}return _0xe92db3[_0xf73e('0x22')]();};}function saveUpdates(_0x57bad6,_0x16b86e){return function(_0x36407e){if(_0x36407e){return _0x36407e['update'](_0x57bad6)[_0xf73e('0x23')](function(_0x2f0602){return _0x2f0602;});}return null;};}function removeEntity(_0x1765c7,_0x58d5ac){return function(_0x2d4eb4){if(_0x2d4eb4){return _0x2d4eb4['destroy']()['then'](function(){var _0x24eec0=_0x2d4eb4[_0xf73e('0x24')]({'plain':!![]});var _0x43ec92=_0xf73e('0x25');return db['UserProfileResource'][_0xf73e('0x26')]({'where':{'type':_0x43ec92,'resourceId':_0x24eec0['id']}})['then'](function(){return _0x2d4eb4;});})[_0xf73e('0x23')](function(){_0x1765c7[_0xf73e('0x18')](0xcc)[_0xf73e('0x19')]();});}};}function handleEntityNotFound(_0x35076c,_0x5bb405){return function(_0x5d0ecc){if(!_0x5d0ecc){_0x35076c['sendStatus'](0x194);}return _0x5d0ecc;};}function handleError(_0x42c9f5,_0x264d09){_0x264d09=_0x264d09||0x1f4;return function(_0x45ecbf){logger[_0xf73e('0x27')](_0x45ecbf['stack']);if(_0x45ecbf['name']){delete _0x45ecbf[_0xf73e('0x28')];}_0x42c9f5['status'](_0x264d09)[_0xf73e('0x29')](_0x45ecbf);};}exports[_0xf73e('0x2a')]=function(_0x122d43,_0x58ef46){var _0x532449={},_0x1568cb={},_0x389181={'count':0x0,'rows':[]};var _0x923994=_[_0xf73e('0x2b')](db[_0xf73e('0x2c')]['rawAttributes'],function(_0x1a4f44){return{'name':_0x1a4f44['fieldName'],'type':_0x1a4f44[_0xf73e('0x2d')][_0xf73e('0x2e')]};});_0x1568cb[_0xf73e('0x2f')]=_[_0xf73e('0x2b')](_0x923994,_0xf73e('0x28'));_0x1568cb[_0xf73e('0x30')]=_[_0xf73e('0x31')](_0x122d43[_0xf73e('0x30')]);_0x1568cb['filters']=_[_0xf73e('0x32')](_0x1568cb[_0xf73e('0x2f')],_0x1568cb['query']);_0x532449[_0xf73e('0x33')]=_[_0xf73e('0x32')](_0x1568cb[_0xf73e('0x2f')],qs[_0xf73e('0x34')](_0x122d43['query']['fields']));_0x532449[_0xf73e('0x33')]=_0x532449[_0xf73e('0x33')][_0xf73e('0x35')]?_0x532449[_0xf73e('0x33')]:_0x1568cb[_0xf73e('0x2f')];if(!_0x122d43[_0xf73e('0x30')][_0xf73e('0x36')](_0xf73e('0x37'))){_0x532449['limit']=qs[_0xf73e('0x1c')](_0x122d43[_0xf73e('0x30')][_0xf73e('0x1c')]);_0x532449['offset']=qs[_0xf73e('0x1e')](_0x122d43[_0xf73e('0x30')][_0xf73e('0x1e')]);}_0x532449[_0xf73e('0x38')]=qs[_0xf73e('0x39')](_0x122d43[_0xf73e('0x30')][_0xf73e('0x39')]);_0x532449[_0xf73e('0x3a')]=qs[_0xf73e('0x3b')](_[_0xf73e('0x3c')](_0x122d43[_0xf73e('0x30')],_0x1568cb[_0xf73e('0x3b')]),_0x923994);if(_0x122d43['query'][_0xf73e('0x3d')]){_0x532449[_0xf73e('0x3a')]=_[_0xf73e('0x3e')](_0x532449[_0xf73e('0x3a')],{'$or':_[_0xf73e('0x2b')](_0x923994,function(_0x467d5b){if(_0x467d5b[_0xf73e('0x2d')]!==_0xf73e('0x3f')){var _0x23af26={};_0x23af26[_0x467d5b['name']]={'$like':'%'+_0x122d43['query'][_0xf73e('0x3d')]+'%'};return _0x23af26;}})});}_0x532449=_[_0xf73e('0x3e')]({},_0x532449,_0x122d43[_0xf73e('0x40')]);var _0x128803={'where':_0x532449[_0xf73e('0x3a')]};return db['Sound'][_0xf73e('0x1d')](_0x128803)[_0xf73e('0x23')](function(_0x5e9493){_0x389181[_0xf73e('0x1d')]=_0x5e9493;if(_0x122d43['query'][_0xf73e('0x41')]){_0x532449[_0xf73e('0x42')]=[{'all':!![]}];}return db['Sound'][_0xf73e('0x43')](_0x532449);})['then'](function(_0x2273f5){_0x389181[_0xf73e('0x44')]=_0x2273f5;return _0x389181;})[_0xf73e('0x23')](respondWithFilteredResult(_0x58ef46,_0x532449))['catch'](handleError(_0x58ef46,null));};exports[_0xf73e('0x45')]=function(_0x3321a4,_0x47a6a2){var _0x12e181={'raw':!![],'where':{'id':_0x3321a4[_0xf73e('0x46')]['id']}},_0x4928d0={};_0x4928d0['model']=_['keys'](db[_0xf73e('0x2c')][_0xf73e('0x47')]);_0x4928d0[_0xf73e('0x30')]=_[_0xf73e('0x31')](_0x3321a4[_0xf73e('0x30')]);_0x4928d0[_0xf73e('0x3b')]=_['intersection'](_0x4928d0[_0xf73e('0x2f')],_0x4928d0[_0xf73e('0x30')]);_0x12e181[_0xf73e('0x33')]=_[_0xf73e('0x32')](_0x4928d0[_0xf73e('0x2f')],qs[_0xf73e('0x34')](_0x3321a4['query']['fields']));_0x12e181[_0xf73e('0x33')]=_0x12e181[_0xf73e('0x33')][_0xf73e('0x35')]?_0x12e181['attributes']:_0x4928d0[_0xf73e('0x2f')];if(_0x3321a4['query']['includeAll']){_0x12e181['include']=[{'all':!![]}];}_0x12e181=_['merge']({},_0x12e181,_0x3321a4[_0xf73e('0x40')]);return db[_0xf73e('0x2c')][_0xf73e('0x48')](_0x12e181)['then'](handleEntityNotFound(_0x47a6a2,null))[_0xf73e('0x23')](respondWithResult(_0x47a6a2,null))[_0xf73e('0x49')](handleError(_0x47a6a2,null));};exports[_0xf73e('0x4a')]=function(_0x412a2f,_0x573adb,_0x4cfa68){return db[_0xf73e('0x2c')][_0xf73e('0x48')]({'where':{'id':_0x412a2f[_0xf73e('0x46')]['id']},'attributes':[_0xf73e('0x28'),_0xf73e('0x4b'),_0xf73e('0x4c')],'raw':!![]})[_0xf73e('0x23')](handleEntityNotFound(_0x573adb,null))[_0xf73e('0x23')](function(_0x4cc665){if(_0x4cc665){if(!fs[_0xf73e('0x4d')](path['join'](config[_0xf73e('0x4e')],_0xf73e('0x4f'),_0x4cc665[_0xf73e('0x4b')]+'.'+_0x4cc665[_0xf73e('0x4c')]))){throw new db['Sequelize'][(_0xf73e('0x50'))]('Sound\x20not\x20found');}return _0x573adb[_0xf73e('0x4a')](path[_0xf73e('0x51')](config[_0xf73e('0x4e')],'server/files/sounds/converted',util[_0xf73e('0x52')](_0xf73e('0x53'),_0x4cc665['save_name'],_0x4cc665[_0xf73e('0x4c')])),util['format'](_0xf73e('0x53'),_0x4cc665[_0xf73e('0x28')],_0x4cc665['converted_format']));}return null;})[_0xf73e('0x49')](handleError(_0x573adb,null));};exports[_0xf73e('0x54')]=function(_0xdfed1f,_0x445795,_0x3d1ad8){var _0x20d6e9={'name':path['basename'](_0xdfed1f[_0xf73e('0x55')][_0xf73e('0x56')],path[_0xf73e('0x57')](_0xdfed1f[_0xf73e('0x55')]['originalname'])),'save_name':path[_0xf73e('0x58')](_0xdfed1f[_0xf73e('0x55')][_0xf73e('0x59')],path['extname'](_0xdfed1f[_0xf73e('0x55')][_0xf73e('0x59')])),'original_format':path[_0xf73e('0x57')](_0xdfed1f[_0xf73e('0x55')][_0xf73e('0x56')])[_0xf73e('0x5a')](0x1),'converted_format':_0xf73e('0x5b')};var _0x1c3577=path[_0xf73e('0x51')](config[_0xf73e('0x4e')],'server/files/sounds/original',_0xdfed1f[_0xf73e('0x55')][_0xf73e('0x59')]);var _0x1467f5=path[_0xf73e('0x51')](config['root'],_0xf73e('0x4f'),util[_0xf73e('0x52')]('%s.%s',path[_0xf73e('0x58')](_0xdfed1f[_0xf73e('0x55')][_0xf73e('0x59')],path[_0xf73e('0x57')](_0xdfed1f[_0xf73e('0x55')][_0xf73e('0x59')])),_0x20d6e9[_0xf73e('0x4c')]));logger[_0xf73e('0x5c')](_0xf73e('0x5d'),_0x1c3577);logger['info'](_0xf73e('0x5e'),_0x1467f5);try{fs[_0xf73e('0x5f')](_0x1c3577,parseInt(_0xf73e('0x60'),0x8));var _0x138900=sox[_0xf73e('0x61')](_0x1c3577,_0x1467f5,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x138900['on']('error',function(_0x77fe90){fs['unlinkSync'](_0x1c3577);_0x445795[_0xf73e('0x18')](0x1f4)[_0xf73e('0x29')](_0x77fe90);});_0x138900['on'](_0xf73e('0x62'),function(_0xd3ae96){_0x20d6e9[_0xf73e('0x63')]=isNaN(_0xd3ae96['duration'])?null:_0xd3ae96['duration']*0x3e8;_0x20d6e9[_0xf73e('0x64')]=isNaN(_0xd3ae96[_0xf73e('0x65')])?null:_0xd3ae96[_0xf73e('0x65')];_0x20d6e9[_0xf73e('0x66')]=isNaN(_0xd3ae96[_0xf73e('0x67')])?null:_0xd3ae96[_0xf73e('0x67')];_0x20d6e9[_0xf73e('0x68')]=isNaN(_0xd3ae96[_0xf73e('0x69')])?null:_0xd3ae96['bitRate'];_0x20d6e9[_0xf73e('0x6a')]=isNaN(_0xd3ae96[_0xf73e('0x6b')])?null:_0xd3ae96[_0xf73e('0x6b')];});_0x138900['on']('dest',function(_0x333558){_0x20d6e9[_0xf73e('0x6c')]=isNaN(_0x333558[_0xf73e('0x6d')])?null:_0x333558[_0xf73e('0x6d')]*0x3e8;_0x20d6e9[_0xf73e('0x6e')]=isNaN(_0x333558[_0xf73e('0x65')])?null:_0x333558[_0xf73e('0x65')];_0x20d6e9[_0xf73e('0x6f')]=isNaN(_0x333558[_0xf73e('0x67')])?null:_0x333558['channelCount'];_0x20d6e9[_0xf73e('0x70')]=isNaN(_0x333558[_0xf73e('0x69')])?null:_0x333558[_0xf73e('0x69')];_0x20d6e9[_0xf73e('0x71')]=isNaN(_0x333558[_0xf73e('0x6b')])?null:_0x333558[_0xf73e('0x6b')];});_0x138900['on'](_0xf73e('0x19'),function(){fs['chmodSync'](_0x1467f5,parseInt(_0xf73e('0x60'),0x8));return db[_0xf73e('0x2c')][_0xf73e('0x54')](_0x20d6e9)[_0xf73e('0x23')](function(_0x183c91){var _0x1199a0={'role':_0xdfed1f[_0xf73e('0x72')][_0xf73e('0x73')],'userProfileId':_0xdfed1f[_0xf73e('0x72')][_0xf73e('0x74')]};if(!_0x1199a0)throw new Error(_0xf73e('0x75'));if(_0x1199a0[_0xf73e('0x73')]==='user'){var _0x36212f=_0x183c91[_0xf73e('0x24')]({'plain':!![]});return db[_0xf73e('0x76')]['find']({'where':{'name':_0xf73e('0x25'),'userProfileId':_0x1199a0['userProfileId']},'raw':!![]})[_0xf73e('0x23')](function(_0x3b6a66){if(_0x3b6a66&&_0x3b6a66[_0xf73e('0x77')]===0x0){return db[_0xf73e('0x78')]['create']({'name':_0x36212f[_0xf73e('0x28')],'resourceId':_0x36212f['id'],'type':_0x3b6a66[_0xf73e('0x28')],'sectionId':_0x3b6a66['id']},{})[_0xf73e('0x23')](function(){return _0x183c91;});}else{return _0x183c91;}})[_0xf73e('0x49')](function(_0x54fd11){logger[_0xf73e('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54fd11);throw _0x54fd11;});}return _0x183c91;})[_0xf73e('0x23')](respondWithResult(_0x445795,null))[_0xf73e('0x49')](handleError(_0x445795,null));});_0x138900[_0xf73e('0x79')]();}catch(_0x449ecd){_0x445795[_0xf73e('0x18')](0x1f4)[_0xf73e('0x29')](_0x449ecd);}};exports['update']=function(_0x4a5b0c,_0x402962,_0x21634a){return db[_0xf73e('0x2c')][_0xf73e('0x48')]({'where':{'id':_0x4a5b0c[_0xf73e('0x46')]['id']}})[_0xf73e('0x23')](handleEntityNotFound(_0x402962,null))['then'](saveUpdates(_[_0xf73e('0x3c')](_0x4a5b0c[_0xf73e('0x72')],[_0xf73e('0x28'),_0xf73e('0x7a')]),null))[_0xf73e('0x23')](respondWithResult(_0x402962,null))[_0xf73e('0x49')](handleError(_0x402962,null));};exports['delete']=function(_0xe41f21,_0x590501,_0x4e27b1){return db[_0xf73e('0x2c')][_0xf73e('0x48')]({'where':{'id':_0xe41f21[_0xf73e('0x46')]['id']}})[_0xf73e('0x23')](function(_0x1ee041){if(_0x1ee041){return _0x1ee041[_0xf73e('0x26')]();}})['then'](function(_0x2da891){var _0x333393=path[_0xf73e('0x51')](config[_0xf73e('0x4e')],_0xf73e('0x7b'),util[_0xf73e('0x52')](_0xf73e('0x53'),_0x2da891['save_name'],_0x2da891[_0xf73e('0x7c')]));var _0x3d17ad=path[_0xf73e('0x51')](config[_0xf73e('0x4e')],'server/files/sounds/converted',util[_0xf73e('0x52')](_0xf73e('0x53'),_0x2da891[_0xf73e('0x4b')],_0x2da891[_0xf73e('0x4c')]));fs[_0xf73e('0x7d')](_0x333393);fs['unlinkSync'](_0x3d17ad);return _0x2da891;})['then'](function(_0x1c470c){if(_0x1c470c){return _0x590501[_0xf73e('0x18')](0xcc)[_0xf73e('0x19')]();}})[_0xf73e('0x23')](handleEntityNotFound(_0x590501,null))[_0xf73e('0x49')](handleError(_0x590501,null));}; \ No newline at end of file +var _0xa396=['converted_sampleCount','converted_channelCount','converted_bitRate','create','body','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','apply','reject','update','then','destroy','get','Sounds','error','stack','name','send','Sound','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','map','includeAll','include','rows','catch','show','keys','options','find','download','params','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','basename','originalname','extname','file','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','chmodSync','0777','transcode','unlinkSync','src','duration','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration'];(function(_0x212d90,_0x3d0bac){var _0x546d43=function(_0x29a5f4){while(--_0x29a5f4){_0x212d90['push'](_0x212d90['shift']());}};_0x546d43(++_0x3d0bac);}(_0xa396,0x182));var _0x6a39=function(_0x12ab01,_0x37d8e2){_0x12ab01=_0x12ab01-0x0;var _0x24e2f9=_0xa396[_0x12ab01];return _0x24e2f9;};'use strict';var emlformat=require(_0x6a39('0x0'));var rimraf=require(_0x6a39('0x1'));var zipdir=require(_0x6a39('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a39('0x3'));var moment=require(_0x6a39('0x4'));var BPromise=require(_0x6a39('0x5'));var Mustache=require(_0x6a39('0x6'));var util=require(_0x6a39('0x7'));var path=require(_0x6a39('0x8'));var sox=require(_0x6a39('0x9'));var csv=require(_0x6a39('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a39('0xb'));var squel=require(_0x6a39('0xc'));var crypto=require(_0x6a39('0xd'));var jsforce=require(_0x6a39('0xe'));var deskjs=require(_0x6a39('0xf'));var toCsv=require(_0x6a39('0xa'));var querystring=require(_0x6a39('0x10'));var Papa=require('papaparse');var Redis=require(_0x6a39('0x11'));var authService=require(_0x6a39('0x12'));var qs=require(_0x6a39('0x13'));var as=require(_0x6a39('0x14'));var hardwareService=require(_0x6a39('0x15'));var logger=require(_0x6a39('0x16'))(_0x6a39('0x17'));var utils=require(_0x6a39('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6a39('0x19'));var db=require(_0x6a39('0x1a'))['db'];function respondWithStatusCode(_0x5d23b1,_0x48b5cd){_0x48b5cd=_0x48b5cd||0xcc;return function(_0x1bb426){if(_0x1bb426){return _0x5d23b1['sendStatus'](_0x48b5cd);}return _0x5d23b1['status'](_0x48b5cd)[_0x6a39('0x1b')]();};}function respondWithResult(_0x36de47,_0x2fe959){_0x2fe959=_0x2fe959||0xc8;return function(_0x1a59fd){if(_0x1a59fd){return _0x36de47[_0x6a39('0x1c')](_0x2fe959)[_0x6a39('0x1d')](_0x1a59fd);}};}function respondWithFilteredResult(_0x53a07b,_0x29df98){return function(_0x5b1e71){if(_0x5b1e71){var _0x78787c=typeof _0x29df98[_0x6a39('0x1e')]===_0x6a39('0x1f')&&typeof _0x29df98['limit']==='undefined';var _0x414ca6=_0x5b1e71['count'];var _0x40bdef=_0x78787c?0x0:_0x29df98[_0x6a39('0x1e')];var _0x1f89fa=_0x78787c?_0x5b1e71[_0x6a39('0x20')]:_0x29df98[_0x6a39('0x1e')]+_0x29df98['limit'];var _0x577b73;if(_0x1f89fa>=_0x414ca6){_0x1f89fa=_0x414ca6;_0x577b73=0xc8;}else{_0x577b73=0xce;}_0x53a07b['status'](_0x577b73);return _0x53a07b['set']('Content-Range',_0x40bdef+'-'+_0x1f89fa+'/'+_0x414ca6)['json'](_0x5b1e71);}return null;};}function patchUpdates(_0x2e8d1d){return function(_0x491c89){try{jsonpatch[_0x6a39('0x21')](_0x491c89,_0x2e8d1d,!![]);}catch(_0xcd4ec){return BPromise[_0x6a39('0x22')](_0xcd4ec);}return _0x491c89['save']();};}function saveUpdates(_0x33e3a7,_0x5867a3){return function(_0x2284d7){if(_0x2284d7){return _0x2284d7[_0x6a39('0x23')](_0x33e3a7)[_0x6a39('0x24')](function(_0x5ac238){return _0x5ac238;});}return null;};}function removeEntity(_0x1aa5af,_0x234abb){return function(_0x3da263){if(_0x3da263){return _0x3da263[_0x6a39('0x25')]()[_0x6a39('0x24')](function(){var _0x1efe28=_0x3da263[_0x6a39('0x26')]({'plain':!![]});var _0x4a4010=_0x6a39('0x27');return db['UserProfileResource'][_0x6a39('0x25')]({'where':{'type':_0x4a4010,'resourceId':_0x1efe28['id']}})[_0x6a39('0x24')](function(){return _0x3da263;});})[_0x6a39('0x24')](function(){_0x1aa5af['status'](0xcc)[_0x6a39('0x1b')]();});}};}function handleEntityNotFound(_0x249d35,_0x44a9c8){return function(_0x3fd04f){if(!_0x3fd04f){_0x249d35['sendStatus'](0x194);}return _0x3fd04f;};}function handleError(_0x2790fc,_0x4c978a){_0x4c978a=_0x4c978a||0x1f4;return function(_0x52cebd){logger[_0x6a39('0x28')](_0x52cebd[_0x6a39('0x29')]);if(_0x52cebd[_0x6a39('0x2a')]){delete _0x52cebd[_0x6a39('0x2a')];}_0x2790fc['status'](_0x4c978a)[_0x6a39('0x2b')](_0x52cebd);};}exports['index']=function(_0x18204e,_0x391e88){var _0x3fe2ff={},_0x422463={},_0x5f3c7e={'count':0x0,'rows':[]};var _0x80540b=_['map'](db[_0x6a39('0x2c')][_0x6a39('0x2d')],function(_0x34813f){return{'name':_0x34813f['fieldName'],'type':_0x34813f[_0x6a39('0x2e')][_0x6a39('0x2f')]};});_0x422463['model']=_['map'](_0x80540b,'name');_0x422463[_0x6a39('0x30')]=_['keys'](_0x18204e[_0x6a39('0x30')]);_0x422463[_0x6a39('0x31')]=_[_0x6a39('0x32')](_0x422463[_0x6a39('0x33')],_0x422463['query']);_0x3fe2ff[_0x6a39('0x34')]=_[_0x6a39('0x32')](_0x422463[_0x6a39('0x33')],qs[_0x6a39('0x35')](_0x18204e[_0x6a39('0x30')][_0x6a39('0x35')]));_0x3fe2ff[_0x6a39('0x34')]=_0x3fe2ff[_0x6a39('0x34')][_0x6a39('0x36')]?_0x3fe2ff['attributes']:_0x422463[_0x6a39('0x33')];if(!_0x18204e[_0x6a39('0x30')][_0x6a39('0x37')](_0x6a39('0x38'))){_0x3fe2ff[_0x6a39('0x39')]=qs[_0x6a39('0x39')](_0x18204e[_0x6a39('0x30')]['limit']);_0x3fe2ff['offset']=qs[_0x6a39('0x1e')](_0x18204e[_0x6a39('0x30')][_0x6a39('0x1e')]);}_0x3fe2ff[_0x6a39('0x3a')]=qs['sort'](_0x18204e[_0x6a39('0x30')][_0x6a39('0x3b')]);_0x3fe2ff['where']=qs['filters'](_[_0x6a39('0x3c')](_0x18204e[_0x6a39('0x30')],_0x422463[_0x6a39('0x31')]),_0x80540b);if(_0x18204e[_0x6a39('0x30')][_0x6a39('0x3d')]){_0x3fe2ff[_0x6a39('0x3e')]=_[_0x6a39('0x3f')](_0x3fe2ff['where'],{'$or':_[_0x6a39('0x40')](_0x80540b,function(_0x1ce9a9){if(_0x1ce9a9['type']!=='VIRTUAL'){var _0x587602={};_0x587602[_0x1ce9a9[_0x6a39('0x2a')]]={'$like':'%'+_0x18204e[_0x6a39('0x30')][_0x6a39('0x3d')]+'%'};return _0x587602;}})});}_0x3fe2ff=_[_0x6a39('0x3f')]({},_0x3fe2ff,_0x18204e['options']);var _0x48d316={'where':_0x3fe2ff[_0x6a39('0x3e')]};return db[_0x6a39('0x2c')][_0x6a39('0x20')](_0x48d316)[_0x6a39('0x24')](function(_0x3c3f8b){_0x5f3c7e[_0x6a39('0x20')]=_0x3c3f8b;if(_0x18204e['query'][_0x6a39('0x41')]){_0x3fe2ff[_0x6a39('0x42')]=[{'all':!![]}];}return db[_0x6a39('0x2c')]['findAll'](_0x3fe2ff);})[_0x6a39('0x24')](function(_0x2734b){_0x5f3c7e[_0x6a39('0x43')]=_0x2734b;return _0x5f3c7e;})['then'](respondWithFilteredResult(_0x391e88,_0x3fe2ff))[_0x6a39('0x44')](handleError(_0x391e88,null));};exports[_0x6a39('0x45')]=function(_0x45ba3b,_0x473ea1){var _0x418a90={'raw':!![],'where':{'id':_0x45ba3b['params']['id']}},_0x28d3ee={};_0x28d3ee['model']=_[_0x6a39('0x46')](db[_0x6a39('0x2c')][_0x6a39('0x2d')]);_0x28d3ee[_0x6a39('0x30')]=_[_0x6a39('0x46')](_0x45ba3b[_0x6a39('0x30')]);_0x28d3ee['filters']=_[_0x6a39('0x32')](_0x28d3ee[_0x6a39('0x33')],_0x28d3ee[_0x6a39('0x30')]);_0x418a90[_0x6a39('0x34')]=_[_0x6a39('0x32')](_0x28d3ee[_0x6a39('0x33')],qs[_0x6a39('0x35')](_0x45ba3b[_0x6a39('0x30')][_0x6a39('0x35')]));_0x418a90[_0x6a39('0x34')]=_0x418a90[_0x6a39('0x34')][_0x6a39('0x36')]?_0x418a90[_0x6a39('0x34')]:_0x28d3ee[_0x6a39('0x33')];if(_0x45ba3b[_0x6a39('0x30')]['includeAll']){_0x418a90[_0x6a39('0x42')]=[{'all':!![]}];}_0x418a90=_[_0x6a39('0x3f')]({},_0x418a90,_0x45ba3b[_0x6a39('0x47')]);return db['Sound'][_0x6a39('0x48')](_0x418a90)[_0x6a39('0x24')](handleEntityNotFound(_0x473ea1,null))[_0x6a39('0x24')](respondWithResult(_0x473ea1,null))['catch'](handleError(_0x473ea1,null));};exports[_0x6a39('0x49')]=function(_0xdca18c,_0x23623e,_0x521721){return db[_0x6a39('0x2c')][_0x6a39('0x48')]({'where':{'id':_0xdca18c[_0x6a39('0x4a')]['id']},'attributes':[_0x6a39('0x2a'),_0x6a39('0x4b'),_0x6a39('0x4c')],'raw':!![]})[_0x6a39('0x24')](handleEntityNotFound(_0x23623e,null))[_0x6a39('0x24')](function(_0x39f27b){if(_0x39f27b){if(!fs[_0x6a39('0x4d')](path[_0x6a39('0x4e')](config[_0x6a39('0x4f')],_0x6a39('0x50'),_0x39f27b['save_name']+'.'+_0x39f27b[_0x6a39('0x4c')]))){throw new db[(_0x6a39('0x51'))][(_0x6a39('0x52'))](_0x6a39('0x53'));}return _0x23623e['download'](path[_0x6a39('0x4e')](config[_0x6a39('0x4f')],_0x6a39('0x50'),util[_0x6a39('0x54')](_0x6a39('0x55'),_0x39f27b[_0x6a39('0x4b')],_0x39f27b[_0x6a39('0x4c')])),util[_0x6a39('0x54')](_0x6a39('0x55'),_0x39f27b['name'],_0x39f27b[_0x6a39('0x4c')]));}return null;})[_0x6a39('0x44')](handleError(_0x23623e,null));};exports['create']=function(_0x54101b,_0x13f3d8,_0x1c6c04){var _0x241373={'name':path[_0x6a39('0x56')](_0x54101b['file'][_0x6a39('0x57')],path[_0x6a39('0x58')](_0x54101b[_0x6a39('0x59')][_0x6a39('0x57')])),'save_name':path[_0x6a39('0x56')](_0x54101b[_0x6a39('0x59')][_0x6a39('0x5a')],path['extname'](_0x54101b[_0x6a39('0x59')][_0x6a39('0x5a')])),'original_format':path[_0x6a39('0x58')](_0x54101b[_0x6a39('0x59')][_0x6a39('0x57')])[_0x6a39('0x5b')](0x1),'converted_format':_0x6a39('0x5c')};var _0x234f7a=path[_0x6a39('0x4e')](config[_0x6a39('0x4f')],_0x6a39('0x5d'),_0x54101b[_0x6a39('0x59')][_0x6a39('0x5a')]);var _0x5c9734=path['join'](config[_0x6a39('0x4f')],_0x6a39('0x50'),util[_0x6a39('0x54')](_0x6a39('0x55'),path[_0x6a39('0x56')](_0x54101b[_0x6a39('0x59')][_0x6a39('0x5a')],path[_0x6a39('0x58')](_0x54101b['file'][_0x6a39('0x5a')])),_0x241373[_0x6a39('0x4c')]));logger['info'](_0x6a39('0x5e'),_0x234f7a);logger[_0x6a39('0x5f')]('Sound\x20upload\x20destination:\x20%s',_0x5c9734);try{fs[_0x6a39('0x60')](_0x234f7a,parseInt(_0x6a39('0x61'),0x8));var _0x187e6c=sox[_0x6a39('0x62')](_0x234f7a,_0x5c9734,{'sampleRate':0x1f40,'format':_0x6a39('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x187e6c['on'](_0x6a39('0x28'),function(_0x47c799){fs[_0x6a39('0x63')](_0x234f7a);_0x13f3d8[_0x6a39('0x1c')](0x1f4)[_0x6a39('0x2b')](_0x47c799);});_0x187e6c['on'](_0x6a39('0x64'),function(_0x293aa1){_0x241373['original_duration']=isNaN(_0x293aa1['duration'])?null:_0x293aa1[_0x6a39('0x65')]*0x3e8;_0x241373['original_sampleCount']=isNaN(_0x293aa1[_0x6a39('0x66')])?null:_0x293aa1['sampleCount'];_0x241373[_0x6a39('0x67')]=isNaN(_0x293aa1[_0x6a39('0x68')])?null:_0x293aa1[_0x6a39('0x68')];_0x241373['original_bitRate']=isNaN(_0x293aa1['bitRate'])?null:_0x293aa1[_0x6a39('0x69')];_0x241373[_0x6a39('0x6a')]=isNaN(_0x293aa1[_0x6a39('0x6b')])?null:_0x293aa1[_0x6a39('0x6b')];});_0x187e6c['on'](_0x6a39('0x6c'),function(_0x461dc1){_0x241373[_0x6a39('0x6d')]=isNaN(_0x461dc1[_0x6a39('0x65')])?null:_0x461dc1['duration']*0x3e8;_0x241373[_0x6a39('0x6e')]=isNaN(_0x461dc1[_0x6a39('0x66')])?null:_0x461dc1[_0x6a39('0x66')];_0x241373[_0x6a39('0x6f')]=isNaN(_0x461dc1[_0x6a39('0x68')])?null:_0x461dc1[_0x6a39('0x68')];_0x241373[_0x6a39('0x70')]=isNaN(_0x461dc1[_0x6a39('0x69')])?null:_0x461dc1[_0x6a39('0x69')];_0x241373['converted_sampleRate']=isNaN(_0x461dc1[_0x6a39('0x6b')])?null:_0x461dc1[_0x6a39('0x6b')];});_0x187e6c['on'](_0x6a39('0x1b'),function(){fs[_0x6a39('0x60')](_0x5c9734,parseInt(_0x6a39('0x61'),0x8));return db[_0x6a39('0x2c')][_0x6a39('0x71')](_0x241373)[_0x6a39('0x24')](function(_0x186a90){var _0x548f78={'role':_0x54101b[_0x6a39('0x72')][_0x6a39('0x73')],'userProfileId':_0x54101b[_0x6a39('0x72')]['userProfileId']};if(!_0x548f78)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x548f78[_0x6a39('0x73')]===_0x6a39('0x74')){var _0x14facc=_0x186a90[_0x6a39('0x26')]({'plain':!![]});return db[_0x6a39('0x75')]['find']({'where':{'name':_0x6a39('0x27'),'userProfileId':_0x548f78['userProfileId']},'raw':!![]})[_0x6a39('0x24')](function(_0x40c670){if(_0x40c670&&_0x40c670[_0x6a39('0x76')]===0x0){return db['UserProfileResource'][_0x6a39('0x71')]({'name':_0x14facc[_0x6a39('0x2a')],'resourceId':_0x14facc['id'],'type':_0x40c670[_0x6a39('0x2a')],'sectionId':_0x40c670['id']},{})[_0x6a39('0x24')](function(){return _0x186a90;});}else{return _0x186a90;}})[_0x6a39('0x44')](function(_0x12a272){logger['error'](_0x6a39('0x77'),_0x12a272);throw _0x12a272;});}return _0x186a90;})[_0x6a39('0x24')](respondWithResult(_0x13f3d8,null))[_0x6a39('0x44')](handleError(_0x13f3d8,null));});_0x187e6c[_0x6a39('0x78')]();}catch(_0x558d37){_0x13f3d8[_0x6a39('0x1c')](0x1f4)['send'](_0x558d37);}};exports[_0x6a39('0x23')]=function(_0x5b1207,_0x40f10e,_0x15aa1e){return db[_0x6a39('0x2c')][_0x6a39('0x48')]({'where':{'id':_0x5b1207[_0x6a39('0x4a')]['id']}})[_0x6a39('0x24')](handleEntityNotFound(_0x40f10e,null))[_0x6a39('0x24')](saveUpdates(_[_0x6a39('0x3c')](_0x5b1207[_0x6a39('0x72')],[_0x6a39('0x2a'),_0x6a39('0x79')]),null))[_0x6a39('0x24')](respondWithResult(_0x40f10e,null))['catch'](handleError(_0x40f10e,null));};exports[_0x6a39('0x7a')]=function(_0x82dc42,_0x16c5cb,_0x33e77d){return db[_0x6a39('0x2c')][_0x6a39('0x48')]({'where':{'id':_0x82dc42[_0x6a39('0x4a')]['id']}})[_0x6a39('0x24')](function(_0x1f2abc){if(_0x1f2abc){return _0x1f2abc['destroy']();}})['then'](function(_0x5b55fe){var _0x33d331=path['join'](config[_0x6a39('0x4f')],_0x6a39('0x5d'),util[_0x6a39('0x54')](_0x6a39('0x55'),_0x5b55fe[_0x6a39('0x4b')],_0x5b55fe[_0x6a39('0x7b')]));var _0x591e31=path[_0x6a39('0x4e')](config[_0x6a39('0x4f')],_0x6a39('0x50'),util[_0x6a39('0x54')](_0x6a39('0x55'),_0x5b55fe[_0x6a39('0x4b')],_0x5b55fe['converted_format']));fs[_0x6a39('0x63')](_0x33d331);fs[_0x6a39('0x63')](_0x591e31);return _0x5b55fe;})[_0x6a39('0x24')](function(_0x261008){if(_0x261008){return _0x16c5cb[_0x6a39('0x1c')](0xcc)['end']();}})[_0x6a39('0x24')](handleEntityNotFound(_0x16c5cb,null))[_0x6a39('0x44')](handleError(_0x16c5cb,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 535c9c5..fe04960 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 _0x85e5=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','tools_sounds','lodash'];(function(_0x103342,_0x3b4b76){var _0x1fe59f=function(_0x396896){while(--_0x396896){_0x103342['push'](_0x103342['shift']());}};_0x1fe59f(++_0x3b4b76);}(_0x85e5,0x112));var _0x585e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x85e5[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x585e('0x0'));var util=require(_0x585e('0x1'));var logger=require(_0x585e('0x2'))(_0x585e('0x3'));var moment=require('moment');var BPromise=require(_0x585e('0x4'));var rp=require(_0x585e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x585e('0x6'));var config=require(_0x585e('0x7'));var attributes=require('./sound.attributes');module[_0x585e('0x8')]=function(_0x396d79,_0x22b072){return _0x396d79[_0x585e('0x9')]('Sound',attributes,{'tableName':_0x585e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c1c=['../../config/environment','exports','define','Sound','tools_sounds','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x2368f5,_0x204aff){var _0x5b3b26=function(_0x1dc5c5){while(--_0x1dc5c5){_0x2368f5['push'](_0x2368f5['shift']());}};_0x5b3b26(++_0x204aff);}(_0x4c1c,0x102));var _0xc4c1=function(_0x4964d8,_0x15b0f3){_0x4964d8=_0x4964d8-0x0;var _0x42a13d=_0x4c1c[_0x4964d8];return _0x42a13d;};'use strict';var _=require(_0xc4c1('0x0'));var util=require(_0xc4c1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc4c1('0x2'));var rp=require(_0xc4c1('0x3'));var fs=require('fs');var path=require(_0xc4c1('0x4'));var rimraf=require(_0xc4c1('0x5'));var config=require(_0xc4c1('0x6'));var attributes=require('./sound.attributes');module[_0xc4c1('0x7')]=function(_0x8b382c,_0x638a3e){return _0x8b382c[_0xc4c1('0x8')](_0xc4c1('0x9'),attributes,{'tableName':_0xc4c1('0xa'),'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 59c3afd..5cd4675 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 _0x21cd=['ShowSound','Sound','find','options','where','attributes','include','model','map','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','stringify','error','code','message','Sound,\x20%s,\x20%s'];(function(_0xf31050,_0x2c35a8){var _0x1fc373=function(_0x436a6a){while(--_0x436a6a){_0xf31050['push'](_0xf31050['shift']());}};_0x1fc373(++_0x2c35a8);}(_0x21cd,0x190));var _0xd21c=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x21cd[_0x5627e1];return _0x2f013f;};'use strict';var _=require(_0xd21c('0x0'));var util=require(_0xd21c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd21c('0x2'));var fs=require('fs');var Redis=require(_0xd21c('0x3'));var db=require(_0xd21c('0x4'))['db'];var utils=require(_0xd21c('0x5'));var logger=require(_0xd21c('0x6'))(_0xd21c('0x7'));var config=require(_0xd21c('0x8'));var jayson=require(_0xd21c('0x9'));var client=jayson[_0xd21c('0xa')][_0xd21c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38ad34,_0x16ab51,_0x12d3cb){return new BPromise(function(_0x32dee9,_0x4a5936){return client['request'](_0x38ad34,_0x12d3cb)[_0xd21c('0xc')](function(_0x4f6711){logger[_0xd21c('0xd')]('Sound,\x20%s,\x20%s',_0x16ab51,'request\x20sent');logger[_0xd21c('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x16ab51,'request\x20sent',JSON[_0xd21c('0xf')](_0x4f6711));if(_0x4f6711[_0xd21c('0x10')]){if(_0x4f6711[_0xd21c('0x10')][_0xd21c('0x11')]===0x1f4){logger[_0xd21c('0x10')]('Sound,\x20%s,\x20%s',_0x16ab51,_0x4f6711[_0xd21c('0x10')][_0xd21c('0x12')]);return _0x4a5936(_0x4f6711[_0xd21c('0x10')]['message']);}logger[_0xd21c('0x10')](_0xd21c('0x13'),_0x16ab51,_0x4f6711[_0xd21c('0x10')]['message']);return _0x32dee9(_0x4f6711[_0xd21c('0x10')][_0xd21c('0x12')]);}else{logger[_0xd21c('0xd')]('Sound,\x20%s,\x20%s',_0x16ab51,'request\x20sent');_0x32dee9(_0x4f6711['result'][_0xd21c('0x12')]);}})['catch'](function(_0x132e2a){logger['error']('Sound,\x20%s,\x20%s',_0x16ab51,_0x132e2a);_0x4a5936(_0x132e2a);});});}exports[_0xd21c('0x14')]=function(_0x5c8929){var _0x237efd=this;return new Promise(function(_0x4c0fb7,_0x52010e){return db[_0xd21c('0x15')][_0xd21c('0x16')]({'raw':_0x5c8929[_0xd21c('0x17')]?_0x5c8929['options']['raw']===undefined?!![]:![]:!![],'where':_0x5c8929['options']?_0x5c8929[_0xd21c('0x17')][_0xd21c('0x18')]||null:null,'attributes':_0x5c8929[_0xd21c('0x17')]?_0x5c8929[_0xd21c('0x17')][_0xd21c('0x19')]||null:null,'include':_0x5c8929[_0xd21c('0x17')]?_0x5c8929[_0xd21c('0x17')][_0xd21c('0x1a')]?_['map'](_0x5c8929[_0xd21c('0x17')]['include'],function(_0xfb0eea){return{'model':db[_0xfb0eea[_0xd21c('0x1b')]],'as':_0xfb0eea['as'],'attributes':_0xfb0eea[_0xd21c('0x19')],'include':_0xfb0eea[_0xd21c('0x1a')]?_[_0xd21c('0x1c')](_0xfb0eea[_0xd21c('0x1a')],function(_0xd9d3){return{'model':db[_0xd9d3[_0xd21c('0x1b')]],'as':_0xd9d3['as'],'attributes':_0xd9d3[_0xd21c('0x19')],'include':_0xd9d3[_0xd21c('0x1a')]?_[_0xd21c('0x1c')](_0xd9d3['include'],function(_0x352166){return{'model':db[_0x352166['model']],'as':_0x352166['as'],'attributes':_0x352166[_0xd21c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd21c('0xc')](function(_0x1fdf43){logger['info']('ShowSound',_0x5c8929);logger['debug']('ShowSound',_0x5c8929,JSON[_0xd21c('0xf')](_0x1fdf43));_0x4c0fb7(_0x1fdf43);})[_0xd21c('0x1d')](function(_0x56aafa){logger[_0xd21c('0x10')](_0xd21c('0x14'),_0x56aafa[_0xd21c('0x12')],_0x5c8929);_0x52010e(_0x237efd[_0xd21c('0x10')](0x1f4,_0x56aafa[_0xd21c('0x12')]));});});}; \ No newline at end of file +var _0x276c=['model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map'];(function(_0x667ff8,_0x59e7df){var _0x2ddfc7=function(_0x5a4a46){while(--_0x5a4a46){_0x667ff8['push'](_0x667ff8['shift']());}};_0x2ddfc7(++_0x59e7df);}(_0x276c,0xf6));var _0xc276=function(_0x41816c,_0x4bdaee){_0x41816c=_0x41816c-0x0;var _0x1c96b7=_0x276c[_0x41816c];return _0x1c96b7;};'use strict';var _=require(_0xc276('0x0'));var util=require(_0xc276('0x1'));var moment=require(_0xc276('0x2'));var BPromise=require(_0xc276('0x3'));var rs=require(_0xc276('0x4'));var fs=require('fs');var Redis=require(_0xc276('0x5'));var db=require(_0xc276('0x6'))['db'];var utils=require(_0xc276('0x7'));var logger=require(_0xc276('0x8'))(_0xc276('0x9'));var config=require(_0xc276('0xa'));var jayson=require(_0xc276('0xb'));var client=jayson[_0xc276('0xc')][_0xc276('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x53f80f,_0x3501c2,_0x3c6e08){return new BPromise(function(_0x52991b,_0x36934a){return client['request'](_0x53f80f,_0x3c6e08)[_0xc276('0xe')](function(_0x2783ca){logger[_0xc276('0xf')](_0xc276('0x10'),_0x3501c2,'request\x20sent');logger[_0xc276('0x11')]('Sound,\x20%s,\x20%s,\x20%s',_0x3501c2,_0xc276('0x12'),JSON[_0xc276('0x13')](_0x2783ca));if(_0x2783ca[_0xc276('0x14')]){if(_0x2783ca[_0xc276('0x14')][_0xc276('0x15')]===0x1f4){logger[_0xc276('0x14')]('Sound,\x20%s,\x20%s',_0x3501c2,_0x2783ca[_0xc276('0x14')][_0xc276('0x16')]);return _0x36934a(_0x2783ca[_0xc276('0x14')][_0xc276('0x16')]);}logger[_0xc276('0x14')](_0xc276('0x10'),_0x3501c2,_0x2783ca[_0xc276('0x14')]['message']);return _0x52991b(_0x2783ca[_0xc276('0x14')]['message']);}else{logger[_0xc276('0xf')](_0xc276('0x10'),_0x3501c2,'request\x20sent');_0x52991b(_0x2783ca[_0xc276('0x17')]['message']);}})[_0xc276('0x18')](function(_0x31f719){logger[_0xc276('0x14')]('Sound,\x20%s,\x20%s',_0x3501c2,_0x31f719);_0x36934a(_0x31f719);});});}exports[_0xc276('0x19')]=function(_0x528d6b){var _0x3e6cc3=this;return new Promise(function(_0x103fee,_0x1d324b){return db[_0xc276('0x1a')][_0xc276('0x1b')]({'raw':_0x528d6b[_0xc276('0x1c')]?_0x528d6b[_0xc276('0x1c')][_0xc276('0x1d')]===undefined?!![]:![]:!![],'where':_0x528d6b[_0xc276('0x1c')]?_0x528d6b[_0xc276('0x1c')][_0xc276('0x1e')]||null:null,'attributes':_0x528d6b['options']?_0x528d6b[_0xc276('0x1c')][_0xc276('0x1f')]||null:null,'include':_0x528d6b[_0xc276('0x1c')]?_0x528d6b['options'][_0xc276('0x20')]?_[_0xc276('0x21')](_0x528d6b['options'][_0xc276('0x20')],function(_0x3add5d){return{'model':db[_0x3add5d[_0xc276('0x22')]],'as':_0x3add5d['as'],'attributes':_0x3add5d[_0xc276('0x1f')],'include':_0x3add5d[_0xc276('0x20')]?_['map'](_0x3add5d[_0xc276('0x20')],function(_0x18d13a){return{'model':db[_0x18d13a[_0xc276('0x22')]],'as':_0x18d13a['as'],'attributes':_0x18d13a[_0xc276('0x1f')],'include':_0x18d13a[_0xc276('0x20')]?_[_0xc276('0x21')](_0x18d13a[_0xc276('0x20')],function(_0x354e03){return{'model':db[_0x354e03['model']],'as':_0x354e03['as'],'attributes':_0x354e03[_0xc276('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc276('0xe')](function(_0x18d71d){logger[_0xc276('0xf')](_0xc276('0x19'),_0x528d6b);logger[_0xc276('0x11')](_0xc276('0x19'),_0x528d6b,JSON[_0xc276('0x13')](_0x18d71d));_0x103fee(_0x18d71d);})[_0xc276('0x18')](function(_0x3c5718){logger['error']('ShowSound',_0x3c5718['message'],_0x528d6b);_0x1d324b(_0x3e6cc3[_0xc276('0x14')](0x1f4,_0x3c5718[_0xc276('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 79eae9b..0e037d5 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 _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0xe48e98,_0x49e854){var _0x51e227=function(_0x17fb0a){while(--_0x17fb0a){_0xe48e98['push'](_0xe48e98['shift']());}};_0x51e227(++_0x49e854);}(_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('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x2ae22a,_0x4fe753){var _0x286a82=function(_0x256e58){while(--_0x256e58){_0x2ae22a['push'](_0x2ae22a['shift']());}};_0x286a82(++_0x4fe753);}(_0x4fc2,0x111));var _0x24fc=function(_0x508a3a,_0x2eff16){_0x508a3a=_0x508a3a-0x0;var _0x4cc5e2=_0x4fc2[_0x508a3a];return _0x4cc5e2;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('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 ed2cea7..673265b 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 _0x7e9b=['out','exports','STRING','TEXT','ENUM'];(function(_0x3a607d,_0x3943c6){var _0x4286b4=function(_0x25d13b){while(--_0x25d13b){_0x3a607d['push'](_0x3a607d['shift']());}};_0x4286b4(++_0x3943c6);}(_0x7e9b,0x119));var _0xb7e9=function(_0x52970c,_0x169b40){_0x52970c=_0x52970c-0x0;var _0x3bc546=_0x7e9b[_0x52970c];return _0x3bc546;};'use strict';var Sequelize=require('sequelize');module[_0xb7e9('0x0')]={'uniqueid':{'type':Sequelize[_0xb7e9('0x1')]},'body':{'type':Sequelize[_0xb7e9('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xb7e9('0x3')]('in',_0xb7e9('0x4')),'defaultValue':_0xb7e9('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xb7e9('0x1')]},'providerResponse':{'type':Sequelize[_0xb7e9('0x2')]}}; \ No newline at end of file +var _0xa356=['STRING','out','TEXT'];(function(_0x37d3f3,_0xca010f){var _0x185c9c=function(_0x5e2bf2){while(--_0x5e2bf2){_0x37d3f3['push'](_0x37d3f3['shift']());}};_0x185c9c(++_0xca010f);}(_0xa356,0x1ec));var _0x6a35=function(_0x59e681,_0x56ddb5){_0x59e681=_0x59e681-0x0;var _0x2f8efb=_0xa356[_0x59e681];return _0x2f8efb;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x6a35('0x0')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6a35('0x1')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x6a35('0x0')]},'providerResponse':{'type':Sequelize[_0x6a35('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index c56a79f..abddc83 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 _0x5b92=['then','sendStatus','name','index','map','SquareMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','rows','catch','show','includeAll','include','find','body','params','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','destroy'];(function(_0x4bb794,_0x1e6e9d){var _0xc03b38=function(_0x17d722){while(--_0x17d722){_0x4bb794['push'](_0x4bb794['shift']());}};_0xc03b38(++_0x1e6e9d);}(_0x5b92,0x1cd));var _0x25b9=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x5b92[_0x134c2e];return _0x2825db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x25b9('0x0'));var zipdir=require(_0x25b9('0x1'));var jsonpatch=require(_0x25b9('0x2'));var rp=require(_0x25b9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x25b9('0x4'));var path=require(_0x25b9('0x5'));var sox=require(_0x25b9('0x6'));var csv=require(_0x25b9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25b9('0x8'));var _=require(_0x25b9('0x9'));var squel=require(_0x25b9('0xa'));var crypto=require(_0x25b9('0xb'));var jsforce=require(_0x25b9('0xc'));var deskjs=require(_0x25b9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x25b9('0xe'));var Papa=require(_0x25b9('0xf'));var Redis=require('ioredis');var authService=require(_0x25b9('0x10'));var qs=require(_0x25b9('0x11'));var as=require(_0x25b9('0x12'));var hardwareService=require(_0x25b9('0x13'));var logger=require(_0x25b9('0x14'))(_0x25b9('0x15'));var utils=require(_0x25b9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x25b9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16fbe6,_0x2d5ed1){_0x2d5ed1=_0x2d5ed1||0xcc;return function(_0x5f551a){if(_0x5f551a){return _0x16fbe6['sendStatus'](_0x2d5ed1);}return _0x16fbe6[_0x25b9('0x18')](_0x2d5ed1)[_0x25b9('0x19')]();};}function respondWithResult(_0x2171fe,_0x52dcb1){_0x52dcb1=_0x52dcb1||0xc8;return function(_0xa3de18){if(_0xa3de18){return _0x2171fe[_0x25b9('0x18')](_0x52dcb1)[_0x25b9('0x1a')](_0xa3de18);}};}function respondWithFilteredResult(_0x2300a8,_0x571a04){return function(_0x393636){if(_0x393636){var _0x217175=typeof _0x571a04[_0x25b9('0x1b')]==='undefined'&&typeof _0x571a04['limit']===_0x25b9('0x1c');var _0xc1f746=_0x393636[_0x25b9('0x1d')];var _0x25c7f5=_0x217175?0x0:_0x571a04['offset'];var _0x1aab93=_0x217175?_0x393636[_0x25b9('0x1d')]:_0x571a04[_0x25b9('0x1b')]+_0x571a04[_0x25b9('0x1e')];var _0x48bd3c;if(_0x1aab93>=_0xc1f746){_0x1aab93=_0xc1f746;_0x48bd3c=0xc8;}else{_0x48bd3c=0xce;}_0x2300a8[_0x25b9('0x18')](_0x48bd3c);return _0x2300a8['set'](_0x25b9('0x1f'),_0x25c7f5+'-'+_0x1aab93+'/'+_0xc1f746)[_0x25b9('0x1a')](_0x393636);}return null;};}function patchUpdates(_0x506ffb){return function(_0x3158a8){try{jsonpatch['apply'](_0x3158a8,_0x506ffb,!![]);}catch(_0x1dee88){return BPromise[_0x25b9('0x20')](_0x1dee88);}return _0x3158a8[_0x25b9('0x21')]();};}function saveUpdates(_0x4ff3d9,_0x530247){return function(_0x2ec63a){if(_0x2ec63a){return _0x2ec63a[_0x25b9('0x22')](_0x4ff3d9)['then'](function(_0x43ca4f){return _0x43ca4f;});}return null;};}function removeEntity(_0x2fdff6,_0x4a155d){return function(_0x5056d5){if(_0x5056d5){return _0x5056d5[_0x25b9('0x23')]()[_0x25b9('0x24')](function(){_0x2fdff6['status'](0xcc)[_0x25b9('0x19')]();});}};}function handleEntityNotFound(_0x4b960c,_0x4bc4c9){return function(_0x6dd708){if(!_0x6dd708){_0x4b960c[_0x25b9('0x25')](0x194);}return _0x6dd708;};}function handleError(_0x166455,_0x484bdb){_0x484bdb=_0x484bdb||0x1f4;return function(_0x3494e6){logger['error'](_0x3494e6['stack']);if(_0x3494e6[_0x25b9('0x26')]){delete _0x3494e6[_0x25b9('0x26')];}_0x166455[_0x25b9('0x18')](_0x484bdb)['send'](_0x3494e6);};}exports[_0x25b9('0x27')]=function(_0x448461,_0x227336){var _0x52844b={},_0x42e647={},_0x58d860={'count':0x0,'rows':[]};var _0x424251=_[_0x25b9('0x28')](db[_0x25b9('0x29')][_0x25b9('0x2a')],function(_0x2745da){return{'name':_0x2745da['fieldName'],'type':_0x2745da[_0x25b9('0x2b')][_0x25b9('0x2c')]};});_0x42e647[_0x25b9('0x2d')]=_[_0x25b9('0x28')](_0x424251,_0x25b9('0x26'));_0x42e647[_0x25b9('0x2e')]=_[_0x25b9('0x2f')](_0x448461[_0x25b9('0x2e')]);_0x42e647[_0x25b9('0x30')]=_[_0x25b9('0x31')](_0x42e647['model'],_0x42e647[_0x25b9('0x2e')]);_0x52844b['attributes']=_['intersection'](_0x42e647['model'],qs[_0x25b9('0x32')](_0x448461['query'][_0x25b9('0x32')]));_0x52844b[_0x25b9('0x33')]=_0x52844b[_0x25b9('0x33')][_0x25b9('0x34')]?_0x52844b[_0x25b9('0x33')]:_0x42e647['model'];if(!_0x448461[_0x25b9('0x2e')][_0x25b9('0x35')](_0x25b9('0x36'))){_0x52844b[_0x25b9('0x1e')]=qs[_0x25b9('0x1e')](_0x448461[_0x25b9('0x2e')][_0x25b9('0x1e')]);_0x52844b[_0x25b9('0x1b')]=qs['offset'](_0x448461['query']['offset']);}_0x52844b[_0x25b9('0x37')]=qs['sort'](_0x448461[_0x25b9('0x2e')][_0x25b9('0x38')]);_0x52844b['where']=qs['filters'](_[_0x25b9('0x39')](_0x448461[_0x25b9('0x2e')],_0x42e647[_0x25b9('0x30')]),_0x424251);if(_0x448461[_0x25b9('0x2e')][_0x25b9('0x3a')]){_0x52844b['where']=_['merge'](_0x52844b[_0x25b9('0x3b')],{'$or':_[_0x25b9('0x28')](_0x424251,function(_0x2ff391){if(_0x2ff391[_0x25b9('0x2b')]!==_0x25b9('0x3c')){var _0x5a3cc8={};_0x5a3cc8[_0x2ff391['name']]={'$like':'%'+_0x448461[_0x25b9('0x2e')][_0x25b9('0x3a')]+'%'};return _0x5a3cc8;}})});}_0x52844b=_[_0x25b9('0x3d')]({},_0x52844b,_0x448461[_0x25b9('0x3e')]);var _0x333262={'where':_0x52844b[_0x25b9('0x3b')]};return db[_0x25b9('0x29')][_0x25b9('0x1d')](_0x333262)['then'](function(_0x5aed04){_0x58d860['count']=_0x5aed04;if(_0x448461[_0x25b9('0x2e')]['includeAll']){_0x52844b['include']=[{'all':!![]}];}return db[_0x25b9('0x29')]['findAll'](_0x52844b);})[_0x25b9('0x24')](function(_0x3b091d){_0x58d860[_0x25b9('0x3f')]=_0x3b091d;return _0x58d860;})['then'](respondWithFilteredResult(_0x227336,_0x52844b))[_0x25b9('0x40')](handleError(_0x227336,null));};exports[_0x25b9('0x41')]=function(_0x164efc,_0x320776){var _0xc064b1={'raw':!![],'where':{'id':_0x164efc['params']['id']}},_0x5a5420={};_0x5a5420['model']=_[_0x25b9('0x2f')](db[_0x25b9('0x29')]['rawAttributes']);_0x5a5420[_0x25b9('0x2e')]=_[_0x25b9('0x2f')](_0x164efc[_0x25b9('0x2e')]);_0x5a5420[_0x25b9('0x30')]=_[_0x25b9('0x31')](_0x5a5420[_0x25b9('0x2d')],_0x5a5420[_0x25b9('0x2e')]);_0xc064b1[_0x25b9('0x33')]=_[_0x25b9('0x31')](_0x5a5420['model'],qs['fields'](_0x164efc['query']['fields']));_0xc064b1['attributes']=_0xc064b1[_0x25b9('0x33')][_0x25b9('0x34')]?_0xc064b1['attributes']:_0x5a5420[_0x25b9('0x2d')];if(_0x164efc[_0x25b9('0x2e')][_0x25b9('0x42')]){_0xc064b1[_0x25b9('0x43')]=[{'all':!![]}];}_0xc064b1=_[_0x25b9('0x3d')]({},_0xc064b1,_0x164efc['options']);return db[_0x25b9('0x29')][_0x25b9('0x44')](_0xc064b1)[_0x25b9('0x24')](handleEntityNotFound(_0x320776,null))[_0x25b9('0x24')](respondWithResult(_0x320776,null))[_0x25b9('0x40')](handleError(_0x320776,null));};exports['create']=function(_0x49ce75,_0x593790){return db['SquareMessage']['create'](_0x49ce75[_0x25b9('0x45')],{})[_0x25b9('0x24')](respondWithResult(_0x593790,0xc9))['catch'](handleError(_0x593790,null));};exports[_0x25b9('0x22')]=function(_0x2dec8f,_0x4d5fa8){if(_0x2dec8f[_0x25b9('0x45')]['id']){delete _0x2dec8f['body']['id'];}return db[_0x25b9('0x29')][_0x25b9('0x44')]({'where':{'id':_0x2dec8f[_0x25b9('0x46')]['id']}})[_0x25b9('0x24')](handleEntityNotFound(_0x4d5fa8,null))[_0x25b9('0x24')](saveUpdates(_0x2dec8f[_0x25b9('0x45')],null))[_0x25b9('0x24')](respondWithResult(_0x4d5fa8,null))[_0x25b9('0x40')](handleError(_0x4d5fa8,null));};exports[_0x25b9('0x23')]=function(_0x41c9f3,_0x4c7821){return db[_0x25b9('0x29')][_0x25b9('0x44')]({'where':{'id':_0x41c9f3[_0x25b9('0x46')]['id']}})[_0x25b9('0x24')](handleEntityNotFound(_0x4c7821,null))['then'](removeEntity(_0x4c7821,null))[_0x25b9('0x40')](handleError(_0x4c7821,null));}; \ No newline at end of file +var _0x0e08=['error','stack','name','SquareMessage','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','includeAll','findAll','catch','show','params','keys','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus'];(function(_0x200fde,_0x54ed1c){var _0x5d68f0=function(_0x1c6d5b){while(--_0x1c6d5b){_0x200fde['push'](_0x200fde['shift']());}};_0x5d68f0(++_0x54ed1c);}(_0x0e08,0x18e));var _0x80e0=function(_0x52bcf1,_0x3976dc){_0x52bcf1=_0x52bcf1-0x0;var _0x1ecf86=_0x0e08[_0x52bcf1];return _0x1ecf86;};'use strict';var emlformat=require(_0x80e0('0x0'));var rimraf=require(_0x80e0('0x1'));var zipdir=require(_0x80e0('0x2'));var jsonpatch=require(_0x80e0('0x3'));var rp=require(_0x80e0('0x4'));var moment=require(_0x80e0('0x5'));var BPromise=require(_0x80e0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x80e0('0x7'));var sox=require(_0x80e0('0x8'));var csv=require('to-csv');var ejs=require(_0x80e0('0x9'));var fs=require('fs');var fs_extra=require(_0x80e0('0xa'));var _=require(_0x80e0('0xb'));var squel=require('squel');var crypto=require(_0x80e0('0xc'));var jsforce=require(_0x80e0('0xd'));var deskjs=require(_0x80e0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x80e0('0xf'));var Papa=require(_0x80e0('0x10'));var Redis=require(_0x80e0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x80e0('0x12'));var as=require(_0x80e0('0x13'));var hardwareService=require(_0x80e0('0x14'));var logger=require('../../config/logger')(_0x80e0('0x15'));var utils=require(_0x80e0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x80e0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38bc2e,_0x1e038c){_0x1e038c=_0x1e038c||0xcc;return function(_0xb69720){if(_0xb69720){return _0x38bc2e['sendStatus'](_0x1e038c);}return _0x38bc2e[_0x80e0('0x18')](_0x1e038c)[_0x80e0('0x19')]();};}function respondWithResult(_0x5a26bd,_0x5e6fdf){_0x5e6fdf=_0x5e6fdf||0xc8;return function(_0x53effd){if(_0x53effd){return _0x5a26bd['status'](_0x5e6fdf)[_0x80e0('0x1a')](_0x53effd);}};}function respondWithFilteredResult(_0x52d3f4,_0xc90791){return function(_0x5a72bd){if(_0x5a72bd){var _0x452e78=typeof _0xc90791[_0x80e0('0x1b')]===_0x80e0('0x1c')&&typeof _0xc90791['limit']===_0x80e0('0x1c');var _0x3fe88e=_0x5a72bd[_0x80e0('0x1d')];var _0x2483d3=_0x452e78?0x0:_0xc90791[_0x80e0('0x1b')];var _0x1b48e0=_0x452e78?_0x5a72bd[_0x80e0('0x1d')]:_0xc90791[_0x80e0('0x1b')]+_0xc90791[_0x80e0('0x1e')];var _0x1e15ae;if(_0x1b48e0>=_0x3fe88e){_0x1b48e0=_0x3fe88e;_0x1e15ae=0xc8;}else{_0x1e15ae=0xce;}_0x52d3f4['status'](_0x1e15ae);return _0x52d3f4[_0x80e0('0x1f')](_0x80e0('0x20'),_0x2483d3+'-'+_0x1b48e0+'/'+_0x3fe88e)[_0x80e0('0x1a')](_0x5a72bd);}return null;};}function patchUpdates(_0x1fdc21){return function(_0x2f1ef6){try{jsonpatch[_0x80e0('0x21')](_0x2f1ef6,_0x1fdc21,!![]);}catch(_0x5e7140){return BPromise[_0x80e0('0x22')](_0x5e7140);}return _0x2f1ef6[_0x80e0('0x23')]();};}function saveUpdates(_0x1cefff,_0x3558d0){return function(_0xad5ea9){if(_0xad5ea9){return _0xad5ea9[_0x80e0('0x24')](_0x1cefff)[_0x80e0('0x25')](function(_0x1dd823){return _0x1dd823;});}return null;};}function removeEntity(_0x718402,_0x1515db){return function(_0x3bd986){if(_0x3bd986){return _0x3bd986[_0x80e0('0x26')]()[_0x80e0('0x25')](function(){_0x718402['status'](0xcc)[_0x80e0('0x19')]();});}};}function handleEntityNotFound(_0x2c344d,_0x33c7aa){return function(_0x4505f7){if(!_0x4505f7){_0x2c344d[_0x80e0('0x27')](0x194);}return _0x4505f7;};}function handleError(_0x147c6f,_0x5dcc1a){_0x5dcc1a=_0x5dcc1a||0x1f4;return function(_0x36a58f){logger[_0x80e0('0x28')](_0x36a58f[_0x80e0('0x29')]);if(_0x36a58f[_0x80e0('0x2a')]){delete _0x36a58f[_0x80e0('0x2a')];}_0x147c6f[_0x80e0('0x18')](_0x5dcc1a)['send'](_0x36a58f);};}exports['index']=function(_0x56c659,_0x50e1ad){var _0x2169fd={},_0xe2d2f0={},_0x2fd02e={'count':0x0,'rows':[]};var _0x504b57=_['map'](db[_0x80e0('0x2b')][_0x80e0('0x2c')],function(_0x551085){return{'name':_0x551085[_0x80e0('0x2d')],'type':_0x551085['type'][_0x80e0('0x2e')]};});_0xe2d2f0[_0x80e0('0x2f')]=_[_0x80e0('0x30')](_0x504b57,_0x80e0('0x2a'));_0xe2d2f0['query']=_['keys'](_0x56c659[_0x80e0('0x31')]);_0xe2d2f0['filters']=_[_0x80e0('0x32')](_0xe2d2f0[_0x80e0('0x2f')],_0xe2d2f0['query']);_0x2169fd[_0x80e0('0x33')]=_[_0x80e0('0x32')](_0xe2d2f0[_0x80e0('0x2f')],qs[_0x80e0('0x34')](_0x56c659[_0x80e0('0x31')][_0x80e0('0x34')]));_0x2169fd[_0x80e0('0x33')]=_0x2169fd[_0x80e0('0x33')][_0x80e0('0x35')]?_0x2169fd[_0x80e0('0x33')]:_0xe2d2f0[_0x80e0('0x2f')];if(!_0x56c659['query'][_0x80e0('0x36')](_0x80e0('0x37'))){_0x2169fd[_0x80e0('0x1e')]=qs[_0x80e0('0x1e')](_0x56c659['query'][_0x80e0('0x1e')]);_0x2169fd[_0x80e0('0x1b')]=qs[_0x80e0('0x1b')](_0x56c659[_0x80e0('0x31')]['offset']);}_0x2169fd[_0x80e0('0x38')]=qs[_0x80e0('0x39')](_0x56c659[_0x80e0('0x31')][_0x80e0('0x39')]);_0x2169fd[_0x80e0('0x3a')]=qs['filters'](_['pick'](_0x56c659[_0x80e0('0x31')],_0xe2d2f0['filters']),_0x504b57);if(_0x56c659[_0x80e0('0x31')][_0x80e0('0x3b')]){_0x2169fd[_0x80e0('0x3a')]=_[_0x80e0('0x3c')](_0x2169fd[_0x80e0('0x3a')],{'$or':_['map'](_0x504b57,function(_0x1075af){if(_0x1075af[_0x80e0('0x3d')]!=='VIRTUAL'){var _0x36fb01={};_0x36fb01[_0x1075af['name']]={'$like':'%'+_0x56c659[_0x80e0('0x31')][_0x80e0('0x3b')]+'%'};return _0x36fb01;}})});}_0x2169fd=_[_0x80e0('0x3c')]({},_0x2169fd,_0x56c659['options']);var _0x1911db={'where':_0x2169fd['where']};return db[_0x80e0('0x2b')]['count'](_0x1911db)[_0x80e0('0x25')](function(_0x5f356b){_0x2fd02e['count']=_0x5f356b;if(_0x56c659['query'][_0x80e0('0x3e')]){_0x2169fd['include']=[{'all':!![]}];}return db['SquareMessage'][_0x80e0('0x3f')](_0x2169fd);})[_0x80e0('0x25')](function(_0x4735aa){_0x2fd02e['rows']=_0x4735aa;return _0x2fd02e;})[_0x80e0('0x25')](respondWithFilteredResult(_0x50e1ad,_0x2169fd))[_0x80e0('0x40')](handleError(_0x50e1ad,null));};exports[_0x80e0('0x41')]=function(_0x37ef41,_0x4ac82b){var _0x4e8983={'raw':!![],'where':{'id':_0x37ef41[_0x80e0('0x42')]['id']}},_0x32975c={};_0x32975c[_0x80e0('0x2f')]=_['keys'](db[_0x80e0('0x2b')][_0x80e0('0x2c')]);_0x32975c[_0x80e0('0x31')]=_[_0x80e0('0x43')](_0x37ef41[_0x80e0('0x31')]);_0x32975c['filters']=_[_0x80e0('0x32')](_0x32975c['model'],_0x32975c[_0x80e0('0x31')]);_0x4e8983[_0x80e0('0x33')]=_[_0x80e0('0x32')](_0x32975c[_0x80e0('0x2f')],qs['fields'](_0x37ef41['query'][_0x80e0('0x34')]));_0x4e8983['attributes']=_0x4e8983['attributes'][_0x80e0('0x35')]?_0x4e8983[_0x80e0('0x33')]:_0x32975c[_0x80e0('0x2f')];if(_0x37ef41[_0x80e0('0x31')][_0x80e0('0x3e')]){_0x4e8983[_0x80e0('0x44')]=[{'all':!![]}];}_0x4e8983=_[_0x80e0('0x3c')]({},_0x4e8983,_0x37ef41[_0x80e0('0x45')]);return db[_0x80e0('0x2b')][_0x80e0('0x46')](_0x4e8983)['then'](handleEntityNotFound(_0x4ac82b,null))[_0x80e0('0x25')](respondWithResult(_0x4ac82b,null))[_0x80e0('0x40')](handleError(_0x4ac82b,null));};exports[_0x80e0('0x47')]=function(_0x485f0b,_0x5e794c){return db['SquareMessage']['create'](_0x485f0b['body'],{})[_0x80e0('0x25')](respondWithResult(_0x5e794c,0xc9))[_0x80e0('0x40')](handleError(_0x5e794c,null));};exports[_0x80e0('0x24')]=function(_0x254116,_0x36e0c1){if(_0x254116['body']['id']){delete _0x254116[_0x80e0('0x48')]['id'];}return db[_0x80e0('0x2b')]['find']({'where':{'id':_0x254116[_0x80e0('0x42')]['id']}})['then'](handleEntityNotFound(_0x36e0c1,null))[_0x80e0('0x25')](saveUpdates(_0x254116[_0x80e0('0x48')],null))[_0x80e0('0x25')](respondWithResult(_0x36e0c1,null))[_0x80e0('0x40')](handleError(_0x36e0c1,null));};exports[_0x80e0('0x26')]=function(_0x1d48a7,_0x3982a0){return db[_0x80e0('0x2b')][_0x80e0('0x46')]({'where':{'id':_0x1d48a7[_0x80e0('0x42')]['id']}})[_0x80e0('0x25')](handleEntityNotFound(_0x3982a0,null))[_0x80e0('0x25')](removeEntity(_0x3982a0,null))[_0x80e0('0x40')](handleError(_0x3982a0,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index de61e88..8aa8189 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 _0x3e1d=['exports','define','square_messages','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x21ae60,_0x2aefed){var _0x175fbd=function(_0xfce39f){while(--_0xfce39f){_0x21ae60['push'](_0x21ae60['shift']());}};_0x175fbd(++_0x2aefed);}(_0x3e1d,0x12c));var _0xd3e1=function(_0x53d4f7,_0x1e0f8c){_0x53d4f7=_0x53d4f7-0x0;var _0x339e61=_0x3e1d[_0x53d4f7];return _0x339e61;};'use strict';var _=require(_0xd3e1('0x0'));var util=require(_0xd3e1('0x1'));var logger=require(_0xd3e1('0x2'))('api');var moment=require(_0xd3e1('0x3'));var BPromise=require(_0xd3e1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3e1('0x5'));var rimraf=require(_0xd3e1('0x6'));var config=require(_0xd3e1('0x7'));var attributes=require('./squareMessage.attributes');module[_0xd3e1('0x8')]=function(_0x18aeb1,_0x358015){return _0x18aeb1[_0xd3e1('0x9')]('SquareMessage',attributes,{'tableName':_0xd3e1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fe8=['SquareMessage','square_messages','lodash','util','api','moment','request-promise','path','rimraf','./squareMessage.attributes'];(function(_0x5a9795,_0x3ec720){var _0x1003e6=function(_0x52334f){while(--_0x52334f){_0x5a9795['push'](_0x5a9795['shift']());}};_0x1003e6(++_0x3ec720);}(_0x8fe8,0x138));var _0x88fe=function(_0x3e5dac,_0x284ce7){_0x3e5dac=_0x3e5dac-0x0;var _0x1ccbab=_0x8fe8[_0x3e5dac];return _0x1ccbab;};'use strict';var _=require(_0x88fe('0x0'));var util=require(_0x88fe('0x1'));var logger=require('../../config/logger')(_0x88fe('0x2'));var moment=require(_0x88fe('0x3'));var BPromise=require('bluebird');var rp=require(_0x88fe('0x4'));var fs=require('fs');var path=require(_0x88fe('0x5'));var rimraf=require(_0x88fe('0x6'));var config=require('../../config/environment');var attributes=require(_0x88fe('0x7'));module['exports']=function(_0x421347,_0x157b80){return _0x421347['define'](_0x88fe('0x8'),attributes,{'tableName':_0x88fe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index e4c96ce..fd18e72 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 _0x1a43=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','then','debug','util','bluebird','randomstring','ioredis'];(function(_0xd58fc1,_0x1d931c){var _0xc71c40=function(_0x8f4d82){while(--_0x8f4d82){_0xd58fc1['push'](_0xd58fc1['shift']());}};_0xc71c40(++_0x1d931c);}(_0x1a43,0x1a0));var _0x31a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a43[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x31a4('0x0'));var moment=require('moment');var BPromise=require(_0x31a4('0x1'));var rs=require(_0x31a4('0x2'));var fs=require('fs');var Redis=require(_0x31a4('0x3'));var db=require(_0x31a4('0x4'))['db'];var utils=require(_0x31a4('0x5'));var logger=require(_0x31a4('0x6'))(_0x31a4('0x7'));var config=require(_0x31a4('0x8'));var jayson=require(_0x31a4('0x9'));var client=jayson[_0x31a4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x342b36,_0x52460e,_0x4604d4){return new BPromise(function(_0x4b2066,_0x219dd5){return client[_0x31a4('0xb')](_0x342b36,_0x4604d4)['then'](function(_0x5a3f87){logger[_0x31a4('0xc')](_0x31a4('0xd'),_0x52460e,_0x31a4('0xe'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x52460e,'request\x20sent',JSON[_0x31a4('0xf')](_0x5a3f87));if(_0x5a3f87[_0x31a4('0x10')]){if(_0x5a3f87[_0x31a4('0x10')][_0x31a4('0x11')]===0x1f4){logger['error'](_0x31a4('0xd'),_0x52460e,_0x5a3f87[_0x31a4('0x10')][_0x31a4('0x12')]);return _0x219dd5(_0x5a3f87[_0x31a4('0x10')][_0x31a4('0x12')]);}logger[_0x31a4('0x10')]('SquareMessage,\x20%s,\x20%s',_0x52460e,_0x5a3f87['error'][_0x31a4('0x12')]);return _0x4b2066(_0x5a3f87[_0x31a4('0x10')][_0x31a4('0x12')]);}else{logger['info'](_0x31a4('0xd'),_0x52460e,_0x31a4('0xe'));_0x4b2066(_0x5a3f87[_0x31a4('0x13')][_0x31a4('0x12')]);}})[_0x31a4('0x14')](function(_0x38b641){logger['error'](_0x31a4('0xd'),_0x52460e,_0x38b641);_0x219dd5(_0x38b641);});});}exports[_0x31a4('0x15')]=function(_0xae179d){var _0x4ff53e=this;return new Promise(function(_0x3e8d75,_0x10c4d7){return db[_0x31a4('0x16')][_0x31a4('0x17')](_0xae179d[_0x31a4('0x18')],{'raw':_0xae179d['options']?_0xae179d[_0x31a4('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x31a4('0x1a')](function(_0x57baf2){logger[_0x31a4('0xc')](_0x31a4('0x15'),_0xae179d);logger[_0x31a4('0x1b')]('CreateSquareMessage',_0xae179d,JSON['stringify'](_0x57baf2));_0x3e8d75(_0x57baf2);})[_0x31a4('0x14')](function(_0x3beba0){logger[_0x31a4('0x10')]('CreateSquareMessage',_0x3beba0[_0x31a4('0x12')],_0xae179d);_0x10c4d7(_0x4ff53e[_0x31a4('0x10')](0x1f4,_0x3beba0[_0x31a4('0x12')]));});});}; \ No newline at end of file +var _0x54ac=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','body','options','then','debug','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x54ac,0x1e1));var _0xc54a=function(_0x5c2d75,_0x4035fc){_0x5c2d75=_0x5c2d75-0x0;var _0x48f399=_0x54ac[_0x5c2d75];return _0x48f399;};'use strict';var _=require(_0xc54a('0x0'));var util=require(_0xc54a('0x1'));var moment=require(_0xc54a('0x2'));var BPromise=require(_0xc54a('0x3'));var rs=require(_0xc54a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc54a('0x5'))['db'];var utils=require(_0xc54a('0x6'));var logger=require(_0xc54a('0x7'))('rpc');var config=require(_0xc54a('0x8'));var jayson=require(_0xc54a('0x9'));var client=jayson['client'][_0xc54a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x119347,_0x473d57,_0x53cf19){return new BPromise(function(_0x204b41,_0x4b2db1){return client['request'](_0x119347,_0x53cf19)['then'](function(_0x29a396){logger[_0xc54a('0xb')]('SquareMessage,\x20%s,\x20%s',_0x473d57,_0xc54a('0xc'));logger['debug'](_0xc54a('0xd'),_0x473d57,_0xc54a('0xc'),JSON['stringify'](_0x29a396));if(_0x29a396[_0xc54a('0xe')]){if(_0x29a396[_0xc54a('0xe')][_0xc54a('0xf')]===0x1f4){logger[_0xc54a('0xe')](_0xc54a('0x10'),_0x473d57,_0x29a396['error']['message']);return _0x4b2db1(_0x29a396[_0xc54a('0xe')]['message']);}logger[_0xc54a('0xe')]('SquareMessage,\x20%s,\x20%s',_0x473d57,_0x29a396[_0xc54a('0xe')][_0xc54a('0x11')]);return _0x204b41(_0x29a396['error']['message']);}else{logger[_0xc54a('0xb')](_0xc54a('0x10'),_0x473d57,'request\x20sent');_0x204b41(_0x29a396[_0xc54a('0x12')][_0xc54a('0x11')]);}})[_0xc54a('0x13')](function(_0x23b427){logger['error'](_0xc54a('0x10'),_0x473d57,_0x23b427);_0x4b2db1(_0x23b427);});});}exports[_0xc54a('0x14')]=function(_0x2a002d){var _0x496d8d=this;return new Promise(function(_0x385c70,_0x3f3cdd){return db[_0xc54a('0x15')]['create'](_0x2a002d[_0xc54a('0x16')],{'raw':_0x2a002d[_0xc54a('0x17')]?_0x2a002d[_0xc54a('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xc54a('0x18')](function(_0x54765f){logger[_0xc54a('0xb')](_0xc54a('0x14'),_0x2a002d);logger[_0xc54a('0x19')](_0xc54a('0x14'),_0x2a002d,JSON[_0xc54a('0x1a')](_0x54765f));_0x385c70(_0x54765f);})[_0xc54a('0x13')](function(_0x15ed59){logger['error'](_0xc54a('0x14'),_0x15ed59['message'],_0x2a002d);_0x3f3cdd(_0x496d8d[_0xc54a('0xe')](0x1f4,_0x15ed59[_0xc54a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 815ef17..ff8ebb2 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 _0x4a4b=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','/:id','isAuthenticated','15s','test','put'];(function(_0x593d4b,_0x4239fc){var _0xc3b504=function(_0x6bdda3){while(--_0x6bdda3){_0x593d4b['push'](_0x593d4b['shift']());}};_0xc3b504(++_0x4239fc);}(_0x4a4b,0x1e3));var _0xb4a4=function(_0x562c21,_0x2e8fa4){_0x562c21=_0x562c21-0x0;var _0x2c628f=_0x4a4b[_0x562c21];return _0x2c628f;};'use strict';var multer=require(_0xb4a4('0x0'));var util=require(_0xb4a4('0x1'));var path=require(_0xb4a4('0x2'));var timeout=require(_0xb4a4('0x3'));var express=require(_0xb4a4('0x4'));var router=express[_0xb4a4('0x5')]();var fs_extra=require(_0xb4a4('0x6'));var auth=require(_0xb4a4('0x7'));var interaction=require(_0xb4a4('0x8'));var config=require(_0xb4a4('0x9'));var controller=require(_0xb4a4('0xa'));router[_0xb4a4('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb4a4('0xb')](_0xb4a4('0xc'),auth[_0xb4a4('0xd')](),controller['show']);router[_0xb4a4('0xb')]('/:id/test',auth[_0xb4a4('0xd')](),timeout(_0xb4a4('0xe')),controller[_0xb4a4('0xf')]);router['post']('/',auth[_0xb4a4('0xd')](),controller['create']);router[_0xb4a4('0x10')](_0xb4a4('0xc'),auth[_0xb4a4('0xd')](),controller[_0xb4a4('0x11')]);router[_0xb4a4('0x12')](_0xb4a4('0xc'),auth['isAuthenticated'](),controller[_0xb4a4('0x13')]);module['exports']=router; \ No newline at end of file +var _0x22a8=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id','show','/:id/test','15s','test','put','destroy'];(function(_0x3487c4,_0x5457dc){var _0x1622fa=function(_0x4ab6e8){while(--_0x4ab6e8){_0x3487c4['push'](_0x3487c4['shift']());}};_0x1622fa(++_0x5457dc);}(_0x22a8,0xa0));var _0x822a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x22a8[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x822a('0x0'));var util=require(_0x822a('0x1'));var path=require(_0x822a('0x2'));var timeout=require(_0x822a('0x3'));var express=require(_0x822a('0x4'));var router=express[_0x822a('0x5')]();var fs_extra=require(_0x822a('0x6'));var auth=require(_0x822a('0x7'));var interaction=require(_0x822a('0x8'));var config=require(_0x822a('0x9'));var controller=require(_0x822a('0xa'));router[_0x822a('0xb')]('/',auth[_0x822a('0xc')](),controller['index']);router[_0x822a('0xb')](_0x822a('0xd'),auth['isAuthenticated'](),controller[_0x822a('0xe')]);router[_0x822a('0xb')](_0x822a('0xf'),auth[_0x822a('0xc')](),timeout(_0x822a('0x10')),controller[_0x822a('0x11')]);router['post']('/',auth[_0x822a('0xc')](),controller['create']);router[_0x822a('0x12')](_0x822a('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x822a('0xd'),auth[_0x822a('0xc')](),controller[_0x822a('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 6d63a46..60179de 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 _0xac6f=['STRING','name'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xac6f,0xf0));var _0xfac6=function(_0x4b570f,_0x1b2f2e){_0x4b570f=_0x4b570f-0x0;var _0x3f7990=_0xac6f[_0x4b570f];return _0x3f7990;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfac6('0x0')],'unique':_0xfac6('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xfac6('0x0')]},'description':{'type':Sequelize[_0xfac6('0x0')]}}; \ No newline at end of file +var _0xa110=['sequelize','exports','STRING','name'];(function(_0x4f0441,_0x429eab){var _0x4c1f4f=function(_0x15b5af){while(--_0x15b5af){_0x4f0441['push'](_0x4f0441['shift']());}};_0x4c1f4f(++_0x429eab);}(_0xa110,0x64));var _0x0a11=function(_0x40f9d0,_0x51a3ec){_0x40f9d0=_0x40f9d0-0x0;var _0x4f09a2=_0xa110[_0x40f9d0];return _0x4f09a2;};'use strict';var Sequelize=require(_0x0a11('0x0'));module[_0x0a11('0x1')]={'name':{'type':Sequelize[_0x0a11('0x2')],'unique':_0x0a11('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0a11('0x2')]},'description':{'type':Sequelize[_0x0a11('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 90d8b83..a86a186 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 _0x3cd7=['sort','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','include','findAll','rows','catch','show','params','intersection','length','includeAll','create','role','user','get','find','userProfileId','autoAssociation','body','test','dsn','openSync','closeSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','fields','limit','order'];(function(_0x455f81,_0x3f371e){var _0xa45cd4=function(_0x4a9342){while(--_0x4a9342){_0x455f81['push'](_0x455f81['shift']());}};_0xa45cd4(++_0x3f371e);}(_0x3cd7,0x11c));var _0x73cd=function(_0x28df36,_0x4b6080){_0x28df36=_0x28df36-0x0;var _0xd095b3=_0x3cd7[_0x28df36];return _0xd095b3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x73cd('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73cd('0x1'));var moment=require(_0x73cd('0x2'));var BPromise=require(_0x73cd('0x3'));var Mustache=require(_0x73cd('0x4'));var util=require(_0x73cd('0x5'));var path=require(_0x73cd('0x6'));var sox=require(_0x73cd('0x7'));var csv=require(_0x73cd('0x8'));var ejs=require(_0x73cd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x73cd('0xa'));var squel=require(_0x73cd('0xb'));var crypto=require(_0x73cd('0xc'));var jsforce=require(_0x73cd('0xd'));var deskjs=require(_0x73cd('0xe'));var toCsv=require(_0x73cd('0x8'));var querystring=require(_0x73cd('0xf'));var Papa=require(_0x73cd('0x10'));var Redis=require('ioredis');var authService=require(_0x73cd('0x11'));var qs=require(_0x73cd('0x12'));var as=require(_0x73cd('0x13'));var hardwareService=require(_0x73cd('0x14'));var logger=require(_0x73cd('0x15'))(_0x73cd('0x16'));var utils=require('../../config/utils');var config=require(_0x73cd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x73cd('0x18'))['db'];function respondWithStatusCode(_0x5810c4,_0x2b2449){_0x2b2449=_0x2b2449||0xcc;return function(_0x33475c){if(_0x33475c){return _0x5810c4[_0x73cd('0x19')](_0x2b2449);}return _0x5810c4[_0x73cd('0x1a')](_0x2b2449)['end']();};}function respondWithResult(_0x20ded1,_0xa364d1){_0xa364d1=_0xa364d1||0xc8;return function(_0x225c58){if(_0x225c58){return _0x20ded1[_0x73cd('0x1a')](_0xa364d1)['json'](_0x225c58);}};}function respondWithFilteredResult(_0xb62be1,_0x1bc6dd){return function(_0x1f2a2c){if(_0x1f2a2c){var _0x4fb850=typeof _0x1bc6dd[_0x73cd('0x1b')]===_0x73cd('0x1c')&&typeof _0x1bc6dd['limit']==='undefined';var _0x5a2616=_0x1f2a2c[_0x73cd('0x1d')];var _0x4b8a37=_0x4fb850?0x0:_0x1bc6dd[_0x73cd('0x1b')];var _0x50bd5f=_0x4fb850?_0x1f2a2c[_0x73cd('0x1d')]:_0x1bc6dd['offset']+_0x1bc6dd['limit'];var _0x5932a4;if(_0x50bd5f>=_0x5a2616){_0x50bd5f=_0x5a2616;_0x5932a4=0xc8;}else{_0x5932a4=0xce;}_0xb62be1[_0x73cd('0x1a')](_0x5932a4);return _0xb62be1['set'](_0x73cd('0x1e'),_0x4b8a37+'-'+_0x50bd5f+'/'+_0x5a2616)[_0x73cd('0x1f')](_0x1f2a2c);}return null;};}function patchUpdates(_0x1abdef){return function(_0x42dd02){try{jsonpatch[_0x73cd('0x20')](_0x42dd02,_0x1abdef,!![]);}catch(_0x258cac){return BPromise['reject'](_0x258cac);}return _0x42dd02[_0x73cd('0x21')]();};}function saveUpdates(_0x248167,_0x162237){return function(_0x30b018){if(_0x30b018){return _0x30b018[_0x73cd('0x22')](_0x248167)[_0x73cd('0x23')](function(_0x22c729){return _0x22c729;});}return null;};}function removeEntity(_0x531016,_0x46f7bd){return function(_0x22c94e){if(_0x22c94e){return _0x22c94e[_0x73cd('0x24')]()[_0x73cd('0x23')](function(){var _0x1e67fa=_0x22c94e['get']({'plain':!![]});var _0x5ae20e='ODBC';return db[_0x73cd('0x25')][_0x73cd('0x24')]({'where':{'type':_0x5ae20e,'resourceId':_0x1e67fa['id']}})[_0x73cd('0x23')](function(){return _0x22c94e;});})[_0x73cd('0x23')](function(){_0x531016[_0x73cd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45cb27,_0x338378){return function(_0x7aea98){if(!_0x7aea98){_0x45cb27[_0x73cd('0x19')](0x194);}return _0x7aea98;};}function handleError(_0x570847,_0x440c3d){_0x440c3d=_0x440c3d||0x1f4;return function(_0x148c6d){logger[_0x73cd('0x26')](_0x148c6d[_0x73cd('0x27')]);if(_0x148c6d[_0x73cd('0x28')]){delete _0x148c6d['name'];}_0x570847[_0x73cd('0x1a')](_0x440c3d)[_0x73cd('0x29')](_0x148c6d);};}exports[_0x73cd('0x2a')]=function(_0x467323,_0x4f362b){var _0x3e3ad1={},_0x5802ee={},_0x180580={'count':0x0,'rows':[]};var _0x5b905d=_[_0x73cd('0x2b')](db['SquareOdbc'][_0x73cd('0x2c')],function(_0x149a39){return{'name':_0x149a39[_0x73cd('0x2d')],'type':_0x149a39[_0x73cd('0x2e')][_0x73cd('0x2f')]};});_0x5802ee['model']=_[_0x73cd('0x2b')](_0x5b905d,'name');_0x5802ee['query']=_[_0x73cd('0x30')](_0x467323[_0x73cd('0x31')]);_0x5802ee[_0x73cd('0x32')]=_['intersection'](_0x5802ee[_0x73cd('0x33')],_0x5802ee[_0x73cd('0x31')]);_0x3e3ad1[_0x73cd('0x34')]=_['intersection'](_0x5802ee['model'],qs[_0x73cd('0x35')](_0x467323[_0x73cd('0x31')][_0x73cd('0x35')]));_0x3e3ad1['attributes']=_0x3e3ad1['attributes']['length']?_0x3e3ad1[_0x73cd('0x34')]:_0x5802ee['model'];if(!_0x467323['query']['hasOwnProperty']('nolimit')){_0x3e3ad1[_0x73cd('0x36')]=qs[_0x73cd('0x36')](_0x467323[_0x73cd('0x31')][_0x73cd('0x36')]);_0x3e3ad1['offset']=qs['offset'](_0x467323['query']['offset']);}_0x3e3ad1[_0x73cd('0x37')]=qs[_0x73cd('0x38')](_0x467323[_0x73cd('0x31')][_0x73cd('0x38')]);_0x3e3ad1[_0x73cd('0x39')]=qs['filters'](_[_0x73cd('0x3a')](_0x467323['query'],_0x5802ee[_0x73cd('0x32')]),_0x5b905d);if(_0x467323[_0x73cd('0x31')][_0x73cd('0x3b')]){_0x3e3ad1[_0x73cd('0x39')]=_[_0x73cd('0x3c')](_0x3e3ad1['where'],{'$or':_['map'](_0x5b905d,function(_0xd1a21){if(_0xd1a21[_0x73cd('0x2e')]!==_0x73cd('0x3d')){var _0x44bb4b={};_0x44bb4b[_0xd1a21['name']]={'$like':'%'+_0x467323['query'][_0x73cd('0x3b')]+'%'};return _0x44bb4b;}})});}_0x3e3ad1=_['merge']({},_0x3e3ad1,_0x467323[_0x73cd('0x3e')]);var _0x30aa0f={'where':_0x3e3ad1[_0x73cd('0x39')]};return db[_0x73cd('0x3f')][_0x73cd('0x1d')](_0x30aa0f)[_0x73cd('0x23')](function(_0x5cb98e){_0x180580['count']=_0x5cb98e;if(_0x467323[_0x73cd('0x31')]['includeAll']){_0x3e3ad1[_0x73cd('0x40')]=[{'all':!![]}];}return db[_0x73cd('0x3f')][_0x73cd('0x41')](_0x3e3ad1);})['then'](function(_0x5d9c92){_0x180580[_0x73cd('0x42')]=_0x5d9c92;return _0x180580;})[_0x73cd('0x23')](respondWithFilteredResult(_0x4f362b,_0x3e3ad1))[_0x73cd('0x43')](handleError(_0x4f362b,null));};exports[_0x73cd('0x44')]=function(_0x2e9339,_0x58576b){var _0xa67573={'raw':!![],'where':{'id':_0x2e9339[_0x73cd('0x45')]['id']}},_0x38b8f6={};_0x38b8f6[_0x73cd('0x33')]=_[_0x73cd('0x30')](db['SquareOdbc']['rawAttributes']);_0x38b8f6[_0x73cd('0x31')]=_[_0x73cd('0x30')](_0x2e9339[_0x73cd('0x31')]);_0x38b8f6['filters']=_[_0x73cd('0x46')](_0x38b8f6['model'],_0x38b8f6['query']);_0xa67573[_0x73cd('0x34')]=_[_0x73cd('0x46')](_0x38b8f6[_0x73cd('0x33')],qs[_0x73cd('0x35')](_0x2e9339[_0x73cd('0x31')][_0x73cd('0x35')]));_0xa67573[_0x73cd('0x34')]=_0xa67573['attributes'][_0x73cd('0x47')]?_0xa67573[_0x73cd('0x34')]:_0x38b8f6[_0x73cd('0x33')];if(_0x2e9339[_0x73cd('0x31')][_0x73cd('0x48')]){_0xa67573[_0x73cd('0x40')]=[{'all':!![]}];}_0xa67573=_['merge']({},_0xa67573,_0x2e9339['options']);return db[_0x73cd('0x3f')]['find'](_0xa67573)[_0x73cd('0x23')](handleEntityNotFound(_0x58576b,null))[_0x73cd('0x23')](respondWithResult(_0x58576b,null))['catch'](handleError(_0x58576b,null));};exports['create']=function(_0x46762e,_0x22fafd){return db[_0x73cd('0x3f')][_0x73cd('0x49')](_0x46762e['body'],{})[_0x73cd('0x23')](function(_0x33a10f){var _0x2ea5a6=_0x46762e['user']['get']({'plain':!![]});if(!_0x2ea5a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ea5a6[_0x73cd('0x4a')]===_0x73cd('0x4b')){var _0x382323=_0x33a10f[_0x73cd('0x4c')]({'plain':!![]});var _0x3cde20='ODBC';return db['UserProfileSection'][_0x73cd('0x4d')]({'where':{'name':_0x3cde20,'userProfileId':_0x2ea5a6[_0x73cd('0x4e')]},'raw':!![]})['then'](function(_0xfc1bd0){if(_0xfc1bd0&&_0xfc1bd0[_0x73cd('0x4f')]===0x0){return db[_0x73cd('0x25')][_0x73cd('0x49')]({'name':_0x382323[_0x73cd('0x28')],'resourceId':_0x382323['id'],'type':_0xfc1bd0[_0x73cd('0x28')],'sectionId':_0xfc1bd0['id']},{})[_0x73cd('0x23')](function(){return _0x33a10f;});}else{return _0x33a10f;}})[_0x73cd('0x43')](function(_0x1dfa15){logger[_0x73cd('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1dfa15);throw _0x1dfa15;});}return _0x33a10f;})['then'](respondWithResult(_0x22fafd,0xc9))[_0x73cd('0x43')](handleError(_0x22fafd,null));};exports['update']=function(_0xd2db3b,_0xb4e6d1){if(_0xd2db3b[_0x73cd('0x50')]['id']){delete _0xd2db3b[_0x73cd('0x50')]['id'];}return db[_0x73cd('0x3f')][_0x73cd('0x4d')]({'where':{'id':_0xd2db3b[_0x73cd('0x45')]['id']}})[_0x73cd('0x23')](handleEntityNotFound(_0xb4e6d1,null))[_0x73cd('0x23')](saveUpdates(_0xd2db3b[_0x73cd('0x50')],null))[_0x73cd('0x23')](respondWithResult(_0xb4e6d1,null))[_0x73cd('0x43')](handleError(_0xb4e6d1,null));};exports[_0x73cd('0x24')]=function(_0x16c87d,_0x28a66d){return db[_0x73cd('0x3f')][_0x73cd('0x4d')]({'where':{'id':_0x16c87d[_0x73cd('0x45')]['id']}})['then'](handleEntityNotFound(_0x28a66d,null))[_0x73cd('0x23')](removeEntity(_0x28a66d,null))[_0x73cd('0x43')](handleError(_0x28a66d,null));};exports[_0x73cd('0x51')]=function(_0x4281d6,_0x5c3c04,_0x1daad9){var _0x4da0cd;return db['SquareOdbc'][_0x73cd('0x4d')]({'where':{'id':_0x4281d6['params']['id']},'attributes':['id',_0x73cd('0x52')]})['then'](handleEntityNotFound(_0x5c3c04,null))[_0x73cd('0x23')](function(_0x3d5788){if(_0x3d5788){var _0x4fc3cd=require('odbc')();_0x4fc3cd[_0x73cd('0x53')](_0x3d5788[_0x73cd('0x52')]);_0x4fc3cd[_0x73cd('0x54')]();return _0x3d5788;}})[_0x73cd('0x23')](respondWithResult(_0x5c3c04,null))[_0x73cd('0x43')](handleError(_0x5c3c04,null));}; \ No newline at end of file +var _0x8b4f=['../../mysqldb','status','json','offset','count','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','merge','VIRTUAL','SquareOdbc','include','rows','show','params','intersection','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','odbc','openSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b4f,0x197));var _0xf8b4=function(_0x3de7e0,_0x28cbff){_0x3de7e0=_0x3de7e0-0x0;var _0x11d0b3=_0x8b4f[_0x3de7e0];return _0x11d0b3;};'use strict';var emlformat=require(_0xf8b4('0x0'));var rimraf=require(_0xf8b4('0x1'));var zipdir=require(_0xf8b4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8b4('0x3'));var moment=require(_0xf8b4('0x4'));var BPromise=require(_0xf8b4('0x5'));var Mustache=require('mustache');var util=require(_0xf8b4('0x6'));var path=require('path');var sox=require(_0xf8b4('0x7'));var csv=require(_0xf8b4('0x8'));var ejs=require(_0xf8b4('0x9'));var fs=require('fs');var fs_extra=require(_0xf8b4('0xa'));var _=require(_0xf8b4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf8b4('0xc'));var deskjs=require(_0xf8b4('0xd'));var toCsv=require(_0xf8b4('0x8'));var querystring=require(_0xf8b4('0xe'));var Papa=require(_0xf8b4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf8b4('0x10'));var as=require(_0xf8b4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8b4('0x12'))(_0xf8b4('0x13'));var utils=require(_0xf8b4('0x14'));var config=require(_0xf8b4('0x15'));var licenseUtil=require(_0xf8b4('0x16'));var db=require(_0xf8b4('0x17'))['db'];function respondWithStatusCode(_0x594749,_0x1aeb42){_0x1aeb42=_0x1aeb42||0xcc;return function(_0x2b9000){if(_0x2b9000){return _0x594749['sendStatus'](_0x1aeb42);}return _0x594749[_0xf8b4('0x18')](_0x1aeb42)['end']();};}function respondWithResult(_0x4d5471,_0x29e2ed){_0x29e2ed=_0x29e2ed||0xc8;return function(_0x242fc6){if(_0x242fc6){return _0x4d5471['status'](_0x29e2ed)[_0xf8b4('0x19')](_0x242fc6);}};}function respondWithFilteredResult(_0x50eb22,_0x45872b){return function(_0x4f8718){if(_0x4f8718){var _0x5bffbf=typeof _0x45872b[_0xf8b4('0x1a')]==='undefined'&&typeof _0x45872b['limit']==='undefined';var _0x115b9f=_0x4f8718[_0xf8b4('0x1b')];var _0x2e2499=_0x5bffbf?0x0:_0x45872b['offset'];var _0x5bb1bf=_0x5bffbf?_0x4f8718[_0xf8b4('0x1b')]:_0x45872b[_0xf8b4('0x1a')]+_0x45872b['limit'];var _0x54be0f;if(_0x5bb1bf>=_0x115b9f){_0x5bb1bf=_0x115b9f;_0x54be0f=0xc8;}else{_0x54be0f=0xce;}_0x50eb22[_0xf8b4('0x18')](_0x54be0f);return _0x50eb22['set'](_0xf8b4('0x1c'),_0x2e2499+'-'+_0x5bb1bf+'/'+_0x115b9f)[_0xf8b4('0x19')](_0x4f8718);}return null;};}function patchUpdates(_0x3a3547){return function(_0x20df64){try{jsonpatch[_0xf8b4('0x1d')](_0x20df64,_0x3a3547,!![]);}catch(_0x54db4c){return BPromise[_0xf8b4('0x1e')](_0x54db4c);}return _0x20df64[_0xf8b4('0x1f')]();};}function saveUpdates(_0x4b0b1b,_0x369107){return function(_0x31b794){if(_0x31b794){return _0x31b794[_0xf8b4('0x20')](_0x4b0b1b)[_0xf8b4('0x21')](function(_0x490fd8){return _0x490fd8;});}return null;};}function removeEntity(_0x50c5fd,_0x1ebfc8){return function(_0x232d68){if(_0x232d68){return _0x232d68['destroy']()[_0xf8b4('0x21')](function(){var _0x190422=_0x232d68[_0xf8b4('0x22')]({'plain':!![]});var _0x36dda9=_0xf8b4('0x23');return db[_0xf8b4('0x24')]['destroy']({'where':{'type':_0x36dda9,'resourceId':_0x190422['id']}})[_0xf8b4('0x21')](function(){return _0x232d68;});})[_0xf8b4('0x21')](function(){_0x50c5fd[_0xf8b4('0x18')](0xcc)[_0xf8b4('0x25')]();});}};}function handleEntityNotFound(_0xc93c3c,_0x50b1b6){return function(_0x55bbf9){if(!_0x55bbf9){_0xc93c3c[_0xf8b4('0x26')](0x194);}return _0x55bbf9;};}function handleError(_0x19ae9e,_0x262af1){_0x262af1=_0x262af1||0x1f4;return function(_0x1e0ee5){logger['error'](_0x1e0ee5[_0xf8b4('0x27')]);if(_0x1e0ee5[_0xf8b4('0x28')]){delete _0x1e0ee5[_0xf8b4('0x28')];}_0x19ae9e['status'](_0x262af1)[_0xf8b4('0x29')](_0x1e0ee5);};}exports[_0xf8b4('0x2a')]=function(_0x49d22e,_0x45c56d){var _0x1f4084={},_0x331291={},_0x4ccda3={'count':0x0,'rows':[]};var _0x40e54a=_[_0xf8b4('0x2b')](db['SquareOdbc'][_0xf8b4('0x2c')],function(_0x27ff93){return{'name':_0x27ff93[_0xf8b4('0x2d')],'type':_0x27ff93[_0xf8b4('0x2e')][_0xf8b4('0x2f')]};});_0x331291[_0xf8b4('0x30')]=_[_0xf8b4('0x2b')](_0x40e54a,'name');_0x331291[_0xf8b4('0x31')]=_[_0xf8b4('0x32')](_0x49d22e[_0xf8b4('0x31')]);_0x331291['filters']=_['intersection'](_0x331291['model'],_0x331291['query']);_0x1f4084[_0xf8b4('0x33')]=_['intersection'](_0x331291[_0xf8b4('0x30')],qs[_0xf8b4('0x34')](_0x49d22e[_0xf8b4('0x31')][_0xf8b4('0x34')]));_0x1f4084[_0xf8b4('0x33')]=_0x1f4084[_0xf8b4('0x33')][_0xf8b4('0x35')]?_0x1f4084[_0xf8b4('0x33')]:_0x331291[_0xf8b4('0x30')];if(!_0x49d22e[_0xf8b4('0x31')][_0xf8b4('0x36')](_0xf8b4('0x37'))){_0x1f4084[_0xf8b4('0x38')]=qs[_0xf8b4('0x38')](_0x49d22e[_0xf8b4('0x31')]['limit']);_0x1f4084['offset']=qs[_0xf8b4('0x1a')](_0x49d22e['query'][_0xf8b4('0x1a')]);}_0x1f4084[_0xf8b4('0x39')]=qs[_0xf8b4('0x3a')](_0x49d22e['query'][_0xf8b4('0x3a')]);_0x1f4084[_0xf8b4('0x3b')]=qs['filters'](_[_0xf8b4('0x3c')](_0x49d22e[_0xf8b4('0x31')],_0x331291[_0xf8b4('0x3d')]),_0x40e54a);if(_0x49d22e[_0xf8b4('0x31')]['filter']){_0x1f4084['where']=_[_0xf8b4('0x3e')](_0x1f4084['where'],{'$or':_[_0xf8b4('0x2b')](_0x40e54a,function(_0x4b99ff){if(_0x4b99ff[_0xf8b4('0x2e')]!==_0xf8b4('0x3f')){var _0x577ed0={};_0x577ed0[_0x4b99ff[_0xf8b4('0x28')]]={'$like':'%'+_0x49d22e[_0xf8b4('0x31')]['filter']+'%'};return _0x577ed0;}})});}_0x1f4084=_['merge']({},_0x1f4084,_0x49d22e['options']);var _0x2cd0f6={'where':_0x1f4084[_0xf8b4('0x3b')]};return db[_0xf8b4('0x40')]['count'](_0x2cd0f6)[_0xf8b4('0x21')](function(_0x3daa69){_0x4ccda3[_0xf8b4('0x1b')]=_0x3daa69;if(_0x49d22e['query']['includeAll']){_0x1f4084[_0xf8b4('0x41')]=[{'all':!![]}];}return db[_0xf8b4('0x40')]['findAll'](_0x1f4084);})['then'](function(_0x2a05f2){_0x4ccda3[_0xf8b4('0x42')]=_0x2a05f2;return _0x4ccda3;})[_0xf8b4('0x21')](respondWithFilteredResult(_0x45c56d,_0x1f4084))['catch'](handleError(_0x45c56d,null));};exports[_0xf8b4('0x43')]=function(_0x6aa041,_0x408021){var _0xf02ab9={'raw':!![],'where':{'id':_0x6aa041[_0xf8b4('0x44')]['id']}},_0x44e605={};_0x44e605[_0xf8b4('0x30')]=_['keys'](db[_0xf8b4('0x40')]['rawAttributes']);_0x44e605['query']=_['keys'](_0x6aa041[_0xf8b4('0x31')]);_0x44e605[_0xf8b4('0x3d')]=_[_0xf8b4('0x45')](_0x44e605[_0xf8b4('0x30')],_0x44e605[_0xf8b4('0x31')]);_0xf02ab9[_0xf8b4('0x33')]=_[_0xf8b4('0x45')](_0x44e605[_0xf8b4('0x30')],qs['fields'](_0x6aa041[_0xf8b4('0x31')]['fields']));_0xf02ab9[_0xf8b4('0x33')]=_0xf02ab9['attributes'][_0xf8b4('0x35')]?_0xf02ab9[_0xf8b4('0x33')]:_0x44e605[_0xf8b4('0x30')];if(_0x6aa041[_0xf8b4('0x31')]['includeAll']){_0xf02ab9['include']=[{'all':!![]}];}_0xf02ab9=_['merge']({},_0xf02ab9,_0x6aa041[_0xf8b4('0x46')]);return db['SquareOdbc'][_0xf8b4('0x47')](_0xf02ab9)['then'](handleEntityNotFound(_0x408021,null))[_0xf8b4('0x21')](respondWithResult(_0x408021,null))[_0xf8b4('0x48')](handleError(_0x408021,null));};exports['create']=function(_0x3d2f96,_0x4d20c9){return db[_0xf8b4('0x40')][_0xf8b4('0x49')](_0x3d2f96['body'],{})[_0xf8b4('0x21')](function(_0x25ea53){var _0x4763ef=_0x3d2f96[_0xf8b4('0x4a')][_0xf8b4('0x22')]({'plain':!![]});if(!_0x4763ef)throw new Error(_0xf8b4('0x4b'));if(_0x4763ef[_0xf8b4('0x4c')]===_0xf8b4('0x4a')){var _0x30bce3=_0x25ea53[_0xf8b4('0x22')]({'plain':!![]});var _0x4bf578=_0xf8b4('0x23');return db[_0xf8b4('0x4d')][_0xf8b4('0x47')]({'where':{'name':_0x4bf578,'userProfileId':_0x4763ef[_0xf8b4('0x4e')]},'raw':!![]})[_0xf8b4('0x21')](function(_0xb6fbca){if(_0xb6fbca&&_0xb6fbca[_0xf8b4('0x4f')]===0x0){return db[_0xf8b4('0x24')]['create']({'name':_0x30bce3[_0xf8b4('0x28')],'resourceId':_0x30bce3['id'],'type':_0xb6fbca['name'],'sectionId':_0xb6fbca['id']},{})[_0xf8b4('0x21')](function(){return _0x25ea53;});}else{return _0x25ea53;}})[_0xf8b4('0x48')](function(_0x5a803a){logger[_0xf8b4('0x50')](_0xf8b4('0x51'),_0x5a803a);throw _0x5a803a;});}return _0x25ea53;})[_0xf8b4('0x21')](respondWithResult(_0x4d20c9,0xc9))[_0xf8b4('0x48')](handleError(_0x4d20c9,null));};exports[_0xf8b4('0x20')]=function(_0x1afc05,_0x4529eb){if(_0x1afc05[_0xf8b4('0x52')]['id']){delete _0x1afc05[_0xf8b4('0x52')]['id'];}return db[_0xf8b4('0x40')]['find']({'where':{'id':_0x1afc05['params']['id']}})[_0xf8b4('0x21')](handleEntityNotFound(_0x4529eb,null))[_0xf8b4('0x21')](saveUpdates(_0x1afc05[_0xf8b4('0x52')],null))[_0xf8b4('0x21')](respondWithResult(_0x4529eb,null))[_0xf8b4('0x48')](handleError(_0x4529eb,null));};exports['destroy']=function(_0x19a3e7,_0x241002){return db[_0xf8b4('0x40')][_0xf8b4('0x47')]({'where':{'id':_0x19a3e7[_0xf8b4('0x44')]['id']}})['then'](handleEntityNotFound(_0x241002,null))['then'](removeEntity(_0x241002,null))[_0xf8b4('0x48')](handleError(_0x241002,null));};exports[_0xf8b4('0x53')]=function(_0x1dcce0,_0x3f1ddf,_0xdc7630){var _0x3b1d1c;return db['SquareOdbc'][_0xf8b4('0x47')]({'where':{'id':_0x1dcce0[_0xf8b4('0x44')]['id']},'attributes':['id','dsn']})[_0xf8b4('0x21')](handleEntityNotFound(_0x3f1ddf,null))[_0xf8b4('0x21')](function(_0x269f31){if(_0x269f31){var _0xdb5509=require(_0xf8b4('0x54'))();_0xdb5509[_0xf8b4('0x55')](_0x269f31['dsn']);_0xdb5509['closeSync']();return _0x269f31;}})[_0xf8b4('0x21')](respondWithResult(_0x3f1ddf,null))['catch'](handleError(_0x3f1ddf,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index b6f9216..1387e83 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 _0x43c9=['../../config/environment','define','SquareOdbc','square_odbc','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0xd6f7ec,_0x153865){var _0x2922f4=function(_0x44fb74){while(--_0x44fb74){_0xd6f7ec['push'](_0xd6f7ec['shift']());}};_0x2922f4(++_0x153865);}(_0x43c9,0x1e8));var _0x943c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x43c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x943c('0x0'));var util=require(_0x943c('0x1'));var logger=require('../../config/logger')(_0x943c('0x2'));var moment=require('moment');var BPromise=require(_0x943c('0x3'));var rp=require(_0x943c('0x4'));var fs=require('fs');var path=require(_0x943c('0x5'));var rimraf=require(_0x943c('0x6'));var config=require(_0x943c('0x7'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x2bbb14,_0x123b81){return _0x2bbb14[_0x943c('0x8')](_0x943c('0x9'),attributes,{'tableName':_0x943c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4bc=['rimraf','../../config/environment','./squareOdbc.attributes','lodash','util','path'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0xa4bc,0x1ad));var _0xca4b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa4bc[_0x5b561d];return _0x431060;};'use strict';var _=require(_0xca4b('0x0'));var util=require(_0xca4b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xca4b('0x2'));var rimraf=require(_0xca4b('0x3'));var config=require(_0xca4b('0x4'));var attributes=require(_0xca4b('0x5'));module['exports']=function(_0x5cff80,_0x59306f){return _0x5cff80['define']('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 63d9e04..122cb75 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 _0x609e=['result','catch','ShowSquareOdbc','find','options','where','include','map','attributes','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x34bbd5,_0x3c810a){var _0x46244f=function(_0x5884b9){while(--_0x5884b9){_0x34bbd5['push'](_0x34bbd5['shift']());}};_0x46244f(++_0x3c810a);}(_0x609e,0xd0));var _0xe609=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x609e[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xe609('0x0'));var util=require(_0xe609('0x1'));var moment=require(_0xe609('0x2'));var BPromise=require('bluebird');var rs=require(_0xe609('0x3'));var fs=require('fs');var Redis=require(_0xe609('0x4'));var db=require(_0xe609('0x5'))['db'];var utils=require(_0xe609('0x6'));var logger=require(_0xe609('0x7'))(_0xe609('0x8'));var config=require(_0xe609('0x9'));var jayson=require(_0xe609('0xa'));var client=jayson[_0xe609('0xb')][_0xe609('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xec0d7c,_0x29517e,_0x2400ef){return new BPromise(function(_0xb6ee62,_0x306adb){return client['request'](_0xec0d7c,_0x2400ef)[_0xe609('0xd')](function(_0x5a4559){logger[_0xe609('0xe')](_0xe609('0xf'),_0x29517e,'request\x20sent');logger[_0xe609('0x10')](_0xe609('0x11'),_0x29517e,'request\x20sent',JSON[_0xe609('0x12')](_0x5a4559));if(_0x5a4559[_0xe609('0x13')]){if(_0x5a4559['error'][_0xe609('0x14')]===0x1f4){logger[_0xe609('0x13')](_0xe609('0xf'),_0x29517e,_0x5a4559['error']['message']);return _0x306adb(_0x5a4559[_0xe609('0x13')]['message']);}logger[_0xe609('0x13')](_0xe609('0xf'),_0x29517e,_0x5a4559['error'][_0xe609('0x15')]);return _0xb6ee62(_0x5a4559[_0xe609('0x13')]['message']);}else{logger[_0xe609('0xe')](_0xe609('0xf'),_0x29517e,_0xe609('0x16'));_0xb6ee62(_0x5a4559[_0xe609('0x17')][_0xe609('0x15')]);}})[_0xe609('0x18')](function(_0x1b83de){logger[_0xe609('0x13')](_0xe609('0xf'),_0x29517e,_0x1b83de);_0x306adb(_0x1b83de);});});}exports[_0xe609('0x19')]=function(_0x3c4eae){var _0x21debd=this;return new Promise(function(_0x144a01,_0x5f2da5){return db['SquareOdbc'][_0xe609('0x1a')]({'raw':_0x3c4eae['options']?_0x3c4eae[_0xe609('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3c4eae['options']?_0x3c4eae[_0xe609('0x1b')][_0xe609('0x1c')]||null:null,'attributes':_0x3c4eae['options']?_0x3c4eae['options']['attributes']||null:null,'include':_0x3c4eae[_0xe609('0x1b')]?_0x3c4eae[_0xe609('0x1b')][_0xe609('0x1d')]?_[_0xe609('0x1e')](_0x3c4eae['options'][_0xe609('0x1d')],function(_0x3d4b53){return{'model':db[_0x3d4b53['model']],'as':_0x3d4b53['as'],'attributes':_0x3d4b53[_0xe609('0x1f')],'include':_0x3d4b53[_0xe609('0x1d')]?_[_0xe609('0x1e')](_0x3d4b53['include'],function(_0x16e01d){return{'model':db[_0x16e01d[_0xe609('0x20')]],'as':_0x16e01d['as'],'attributes':_0x16e01d[_0xe609('0x1f')],'include':_0x16e01d[_0xe609('0x1d')]?_[_0xe609('0x1e')](_0x16e01d[_0xe609('0x1d')],function(_0x3c467e){return{'model':db[_0x3c467e[_0xe609('0x20')]],'as':_0x3c467e['as'],'attributes':_0x3c467e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe609('0xd')](function(_0x26a0d9){logger[_0xe609('0xe')](_0xe609('0x19'),_0x3c4eae);logger[_0xe609('0x10')](_0xe609('0x19'),_0x3c4eae,JSON['stringify'](_0x26a0d9));_0x144a01(_0x26a0d9);})['catch'](function(_0x5c793c){logger['error'](_0xe609('0x19'),_0x5c793c[_0xe609('0x15')],_0x3c4eae);_0x5f2da5(_0x21debd[_0xe609('0x13')](0x1f4,_0x5c793c[_0xe609('0x15')]));});});}; \ No newline at end of file +var _0x5db0=['attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where'];(function(_0xea3ca8,_0xbfa6d3){var _0xc9c4a9=function(_0x307473){while(--_0x307473){_0xea3ca8['push'](_0xea3ca8['shift']());}};_0xc9c4a9(++_0xbfa6d3);}(_0x5db0,0x9f));var _0x05db=function(_0x449363,_0x49c688){_0x449363=_0x449363-0x0;var _0x2a8f64=_0x5db0[_0x449363];return _0x2a8f64;};'use strict';var _=require(_0x05db('0x0'));var util=require(_0x05db('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05db('0x2'));var db=require(_0x05db('0x3'))['db'];var utils=require(_0x05db('0x4'));var logger=require(_0x05db('0x5'))(_0x05db('0x6'));var config=require('../../config/environment');var jayson=require(_0x05db('0x7'));var client=jayson[_0x05db('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56994b,_0x2dd125,_0x460b8a){return new BPromise(function(_0x12e004,_0x35d4d8){return client['request'](_0x56994b,_0x460b8a)[_0x05db('0x9')](function(_0x3a6040){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x2dd125,_0x05db('0xa'));logger[_0x05db('0xb')](_0x05db('0xc'),_0x2dd125,_0x05db('0xa'),JSON[_0x05db('0xd')](_0x3a6040));if(_0x3a6040['error']){if(_0x3a6040[_0x05db('0xe')][_0x05db('0xf')]===0x1f4){logger[_0x05db('0xe')](_0x05db('0x10'),_0x2dd125,_0x3a6040[_0x05db('0xe')][_0x05db('0x11')]);return _0x35d4d8(_0x3a6040[_0x05db('0xe')][_0x05db('0x11')]);}logger['error'](_0x05db('0x10'),_0x2dd125,_0x3a6040['error'][_0x05db('0x11')]);return _0x12e004(_0x3a6040[_0x05db('0xe')]['message']);}else{logger[_0x05db('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x2dd125,_0x05db('0xa'));_0x12e004(_0x3a6040[_0x05db('0x13')]['message']);}})[_0x05db('0x14')](function(_0x305103){logger['error'](_0x05db('0x10'),_0x2dd125,_0x305103);_0x35d4d8(_0x305103);});});}exports[_0x05db('0x15')]=function(_0x2066e8){var _0xb98d09=this;return new Promise(function(_0x3d4a2a,_0x424db5){return db[_0x05db('0x16')][_0x05db('0x17')]({'raw':_0x2066e8['options']?_0x2066e8[_0x05db('0x18')][_0x05db('0x19')]===undefined?!![]:![]:!![],'where':_0x2066e8['options']?_0x2066e8[_0x05db('0x18')][_0x05db('0x1a')]||null:null,'attributes':_0x2066e8[_0x05db('0x18')]?_0x2066e8[_0x05db('0x18')][_0x05db('0x1b')]||null:null,'include':_0x2066e8[_0x05db('0x18')]?_0x2066e8['options'][_0x05db('0x1c')]?_[_0x05db('0x1d')](_0x2066e8[_0x05db('0x18')][_0x05db('0x1c')],function(_0x357f13){return{'model':db[_0x357f13['model']],'as':_0x357f13['as'],'attributes':_0x357f13['attributes'],'include':_0x357f13[_0x05db('0x1c')]?_['map'](_0x357f13[_0x05db('0x1c')],function(_0x383f11){return{'model':db[_0x383f11[_0x05db('0x1e')]],'as':_0x383f11['as'],'attributes':_0x383f11[_0x05db('0x1b')],'include':_0x383f11[_0x05db('0x1c')]?_['map'](_0x383f11[_0x05db('0x1c')],function(_0x4885e0){return{'model':db[_0x4885e0['model']],'as':_0x4885e0['as'],'attributes':_0x4885e0[_0x05db('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x05db('0x9')](function(_0x3a6343){logger[_0x05db('0x12')](_0x05db('0x15'),_0x2066e8);logger[_0x05db('0xb')](_0x05db('0x15'),_0x2066e8,JSON[_0x05db('0xd')](_0x3a6343));_0x3d4a2a(_0x3a6343);})[_0x05db('0x14')](function(_0x180fa1){logger[_0x05db('0xe')]('ShowSquareOdbc',_0x180fa1[_0x05db('0x11')],_0x2066e8);_0x424db5(_0xb98d09[_0x05db('0xe')](0x1f4,_0x180fa1[_0x05db('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 69c8bf6..5cdf0cb 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 _0xef0f=['get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create','addUsers','put','update','destroy','delete','removeUsers','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller'];(function(_0x23f12a,_0x277be7){var _0x390cae=function(_0x14400b){while(--_0x14400b){_0x23f12a['push'](_0x23f12a['shift']());}};_0x390cae(++_0x277be7);}(_0xef0f,0x168));var _0xfef0=function(_0x3d8ee5,_0x4b5ae0){_0x3d8ee5=_0x3d8ee5-0x0;var _0x1d8ac7=_0xef0f[_0x3d8ee5];return _0x1d8ac7;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0xf')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0xf')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x11')]);router[_0xfef0('0x12')](_0xfef0('0xb'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x13')]);router['delete'](_0xfef0('0xb'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x14')]);router[_0xfef0('0x15')](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x16')]);module['exports']=router; \ No newline at end of file +var _0x0c07=['get','index','isAuthenticated','show','/:id/users','getUsers','post','addUsers','update','delete','/:id','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller'];(function(_0x5ed15b,_0x370bb8){var _0x3f2826=function(_0x3c7da1){while(--_0x3c7da1){_0x5ed15b['push'](_0x5ed15b['shift']());}};_0x3f2826(++_0x370bb8);}(_0x0c07,0x8b));var _0x70c0=function(_0x310215,_0x541b20){_0x310215=_0x310215-0x0;var _0x1e9d59=_0x0c07[_0x310215];return _0x1e9d59;};'use strict';var multer=require(_0x70c0('0x0'));var util=require(_0x70c0('0x1'));var path=require(_0x70c0('0x2'));var timeout=require(_0x70c0('0x3'));var express=require(_0x70c0('0x4'));var router=express[_0x70c0('0x5')]();var fs_extra=require(_0x70c0('0x6'));var auth=require(_0x70c0('0x7'));var interaction=require(_0x70c0('0x8'));var config=require(_0x70c0('0x9'));var controller=require(_0x70c0('0xa'));router[_0x70c0('0xb')]('/',auth['isAuthenticated'](),controller[_0x70c0('0xc')]);router['get']('/:id',auth[_0x70c0('0xd')](),controller[_0x70c0('0xe')]);router[_0x70c0('0xb')](_0x70c0('0xf'),auth['isAuthenticated'](),controller[_0x70c0('0x10')]);router['post']('/',auth[_0x70c0('0xd')](),controller['create']);router[_0x70c0('0x11')]('/:id/users',auth[_0x70c0('0xd')](),controller[_0x70c0('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x70c0('0x13')]);router[_0x70c0('0x14')](_0x70c0('0x15'),auth['isAuthenticated'](),controller[_0x70c0('0x16')]);router['delete'](_0x70c0('0xf'),auth[_0x70c0('0xd')](),controller[_0x70c0('0x17')]);module[_0x70c0('0x18')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 98d2ecb..eec1081 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 _0x233b=['production','DATE','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8'];(function(_0x48dbf2,_0x39e8c1){var _0x12d880=function(_0x91c972){while(--_0x91c972){_0x48dbf2['push'](_0x48dbf2['shift']());}};_0x12d880(++_0x39e8c1);}(_0x233b,0x92));var _0xb233=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x233b[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require('sequelize');module[_0xb233('0x0')]={'name':{'type':Sequelize[_0xb233('0x1')],'unique':_0xb233('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xb233('0x1')]},'notes':{'type':Sequelize[_0xb233('0x3')]},'preproduction':{'type':Sequelize[_0xb233('0x4')](_0xb233('0x5')),'get':function(){if(this[_0xb233('0x6')]('preproduction')){return this['getDataValue'](_0xb233('0x7'))[_0xb233('0x8')](_0xb233('0x9'));}}},'production':{'type':Sequelize[_0xb233('0x4')](_0xb233('0x5')),'get':function(){if(this[_0xb233('0x6')]('production')){return this[_0xb233('0x6')](_0xb233('0xa'))[_0xb233('0x8')](_0xb233('0x9'));}}},'savedAt':{'type':Sequelize[_0xb233('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x5edb=['long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','TEXT','BLOB'];(function(_0x3ad421,_0x320546){var _0x39fb9d=function(_0x40e8a5){while(--_0x40e8a5){_0x3ad421['push'](_0x3ad421['shift']());}};_0x39fb9d(++_0x320546);}(_0x5edb,0x187));var _0xb5ed=function(_0x43870,_0x5aa1e7){_0x43870=_0x43870-0x0;var _0x375191=_0x5edb[_0x43870];return _0x375191;};'use strict';var Sequelize=require(_0xb5ed('0x0'));module[_0xb5ed('0x1')]={'name':{'type':Sequelize[_0xb5ed('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xb5ed('0x2')]},'notes':{'type':Sequelize[_0xb5ed('0x3')]},'preproduction':{'type':Sequelize[_0xb5ed('0x4')](_0xb5ed('0x5')),'get':function(){if(this[_0xb5ed('0x6')]('preproduction')){return this[_0xb5ed('0x6')](_0xb5ed('0x7'))[_0xb5ed('0x8')](_0xb5ed('0x9'));}}},'production':{'type':Sequelize[_0xb5ed('0x4')](_0xb5ed('0x5')),'get':function(){if(this[_0xb5ed('0x6')](_0xb5ed('0xa'))){return this[_0xb5ed('0x6')](_0xb5ed('0xa'))[_0xb5ed('0x8')](_0xb5ed('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xb5ed('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 6e02145..3109198 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 _0x0aab=['lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','sendStatus','offset','undefined','limit','count','status','set','update','then','destroy','get','SquareProjects','end','error','stack','name','send','index','map','SquareProject','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','catch','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra'];(function(_0x1155e6,_0x233e73){var _0x35dd79=function(_0x5b7d96){while(--_0x5b7d96){_0x1155e6['push'](_0x1155e6['shift']());}};_0x35dd79(++_0x233e73);}(_0x0aab,0x107));var _0xb0aa=function(_0x246f0c,_0x39f734){_0x246f0c=_0x246f0c-0x0;var _0x30fe50=_0x0aab[_0x246f0c];return _0x30fe50;};'use strict';var emlformat=require(_0xb0aa('0x0'));var rimraf=require(_0xb0aa('0x1'));var zipdir=require(_0xb0aa('0x2'));var jsonpatch=require(_0xb0aa('0x3'));var rp=require(_0xb0aa('0x4'));var moment=require('moment');var BPromise=require(_0xb0aa('0x5'));var Mustache=require(_0xb0aa('0x6'));var util=require('util');var path=require(_0xb0aa('0x7'));var sox=require(_0xb0aa('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0aa('0x9'));var _=require(_0xb0aa('0xa'));var squel=require(_0xb0aa('0xb'));var crypto=require('crypto');var jsforce=require(_0xb0aa('0xc'));var deskjs=require(_0xb0aa('0xd'));var toCsv=require(_0xb0aa('0xe'));var querystring=require(_0xb0aa('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb0aa('0x10'));var qs=require(_0xb0aa('0x11'));var as=require(_0xb0aa('0x12'));var hardwareService=require(_0xb0aa('0x13'));var logger=require(_0xb0aa('0x14'))(_0xb0aa('0x15'));var utils=require(_0xb0aa('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb0aa('0x17'))['db'];config['redis']=_[_0xb0aa('0x18')](config[_0xb0aa('0x19')],{'host':_0xb0aa('0x1a'),'port':0x18eb});var socket=require(_0xb0aa('0x1b'))(new Redis(config[_0xb0aa('0x19')]));require(_0xb0aa('0x1c'))['register'](socket);function respondWithStatusCode(_0x4635cb,_0x2c6ce6){_0x2c6ce6=_0x2c6ce6||0xcc;return function(_0x285f40){if(_0x285f40){return _0x4635cb[_0xb0aa('0x1d')](_0x2c6ce6);}return _0x4635cb['status'](_0x2c6ce6)['end']();};}function respondWithResult(_0x4ba659,_0x558a7b){_0x558a7b=_0x558a7b||0xc8;return function(_0x713eb2){if(_0x713eb2){return _0x4ba659['status'](_0x558a7b)['json'](_0x713eb2);}};}function respondWithFilteredResult(_0x1e2bf2,_0x266e31){return function(_0x355c10){if(_0x355c10){var _0x15b4b0=typeof _0x266e31[_0xb0aa('0x1e')]===_0xb0aa('0x1f')&&typeof _0x266e31[_0xb0aa('0x20')]===_0xb0aa('0x1f');var _0x3ad689=_0x355c10[_0xb0aa('0x21')];var _0xd90159=_0x15b4b0?0x0:_0x266e31[_0xb0aa('0x1e')];var _0x505477=_0x15b4b0?_0x355c10[_0xb0aa('0x21')]:_0x266e31['offset']+_0x266e31[_0xb0aa('0x20')];var _0x33ddd9;if(_0x505477>=_0x3ad689){_0x505477=_0x3ad689;_0x33ddd9=0xc8;}else{_0x33ddd9=0xce;}_0x1e2bf2[_0xb0aa('0x22')](_0x33ddd9);return _0x1e2bf2[_0xb0aa('0x23')]('Content-Range',_0xd90159+'-'+_0x505477+'/'+_0x3ad689)['json'](_0x355c10);}return null;};}function patchUpdates(_0x3e522c){return function(_0x5ec8bb){try{jsonpatch['apply'](_0x5ec8bb,_0x3e522c,!![]);}catch(_0x334030){return BPromise['reject'](_0x334030);}return _0x5ec8bb['save']();};}function saveUpdates(_0x3f49d8,_0x134b3f){return function(_0x2b9856){if(_0x2b9856){return _0x2b9856[_0xb0aa('0x24')](_0x3f49d8)[_0xb0aa('0x25')](function(_0x393e9f){return _0x393e9f;});}return null;};}function removeEntity(_0x32b10a,_0x3d9b91){return function(_0x5620b4){if(_0x5620b4){return _0x5620b4[_0xb0aa('0x26')]()[_0xb0aa('0x25')](function(){var _0x397d9a=_0x5620b4[_0xb0aa('0x27')]({'plain':!![]});var _0x3a60f8=_0xb0aa('0x28');return db['UserProfileResource'][_0xb0aa('0x26')]({'where':{'type':_0x3a60f8,'resourceId':_0x397d9a['id']}})[_0xb0aa('0x25')](function(){return _0x5620b4;});})[_0xb0aa('0x25')](function(){_0x32b10a[_0xb0aa('0x22')](0xcc)[_0xb0aa('0x29')]();});}};}function handleEntityNotFound(_0x3ea7b9,_0x3745ff){return function(_0x33a0e1){if(!_0x33a0e1){_0x3ea7b9[_0xb0aa('0x1d')](0x194);}return _0x33a0e1;};}function handleError(_0x1341a4,_0x3e654d){_0x3e654d=_0x3e654d||0x1f4;return function(_0x5965e0){logger[_0xb0aa('0x2a')](_0x5965e0[_0xb0aa('0x2b')]);if(_0x5965e0[_0xb0aa('0x2c')]){delete _0x5965e0['name'];}_0x1341a4[_0xb0aa('0x22')](_0x3e654d)[_0xb0aa('0x2d')](_0x5965e0);};}exports[_0xb0aa('0x2e')]=function(_0x919928,_0x3ea207){var _0x776340={},_0x2533fb={},_0x2799e6={'count':0x0,'rows':[]};var _0x39ad93=_[_0xb0aa('0x2f')](db[_0xb0aa('0x30')]['rawAttributes'],function(_0x23a2a3){return{'name':_0x23a2a3[_0xb0aa('0x31')],'type':_0x23a2a3['type'][_0xb0aa('0x32')]};});_0x2533fb[_0xb0aa('0x33')]=_[_0xb0aa('0x2f')](_0x39ad93,'name');_0x2533fb[_0xb0aa('0x34')]=_[_0xb0aa('0x35')](_0x919928[_0xb0aa('0x34')]);_0x2533fb[_0xb0aa('0x36')]=_[_0xb0aa('0x37')](_0x2533fb[_0xb0aa('0x33')],_0x2533fb['query']);_0x776340[_0xb0aa('0x38')]=_[_0xb0aa('0x37')](_0x2533fb['model'],qs[_0xb0aa('0x39')](_0x919928['query']['fields']));_0x776340[_0xb0aa('0x38')]=_0x776340[_0xb0aa('0x38')][_0xb0aa('0x3a')]?_0x776340[_0xb0aa('0x38')]:_0x2533fb['model'];if(!_0x919928[_0xb0aa('0x34')][_0xb0aa('0x3b')]('nolimit')){_0x776340[_0xb0aa('0x20')]=qs[_0xb0aa('0x20')](_0x919928['query'][_0xb0aa('0x20')]);_0x776340[_0xb0aa('0x1e')]=qs[_0xb0aa('0x1e')](_0x919928[_0xb0aa('0x34')][_0xb0aa('0x1e')]);}_0x776340['order']=qs[_0xb0aa('0x3c')](_0x919928[_0xb0aa('0x34')]['sort']);_0x776340[_0xb0aa('0x3d')]=qs[_0xb0aa('0x36')](_[_0xb0aa('0x3e')](_0x919928[_0xb0aa('0x34')],_0x2533fb[_0xb0aa('0x36')]),_0x39ad93);if(_0x919928[_0xb0aa('0x34')][_0xb0aa('0x3f')]){_0x776340[_0xb0aa('0x3d')]=_[_0xb0aa('0x40')](_0x776340[_0xb0aa('0x3d')],{'$or':_[_0xb0aa('0x2f')](_0x39ad93,function(_0x7d95b5){if(_0x7d95b5[_0xb0aa('0x41')]!==_0xb0aa('0x42')){var _0x973ba9={};_0x973ba9[_0x7d95b5[_0xb0aa('0x2c')]]={'$like':'%'+_0x919928[_0xb0aa('0x34')][_0xb0aa('0x3f')]+'%'};return _0x973ba9;}})});}_0x776340=_[_0xb0aa('0x40')]({},_0x776340,_0x919928['options']);var _0x5da314={'where':_0x776340['where']};return db[_0xb0aa('0x30')][_0xb0aa('0x21')](_0x5da314)[_0xb0aa('0x25')](function(_0x4cc501){_0x2799e6[_0xb0aa('0x21')]=_0x4cc501;if(_0x919928['query'][_0xb0aa('0x43')]){_0x776340[_0xb0aa('0x44')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x776340);})[_0xb0aa('0x25')](function(_0xdae6a8){_0x2799e6['rows']=_0xdae6a8;return _0x2799e6;})[_0xb0aa('0x25')](respondWithFilteredResult(_0x3ea207,_0x776340))[_0xb0aa('0x45')](handleError(_0x3ea207,null));};exports['show']=function(_0x295cbe,_0x579269){var _0x547b2d={'raw':![],'where':{'id':_0x295cbe['params']['id']}},_0x4e5f63={};_0x4e5f63[_0xb0aa('0x33')]=_['keys'](db[_0xb0aa('0x30')][_0xb0aa('0x46')]);_0x4e5f63[_0xb0aa('0x34')]=_[_0xb0aa('0x35')](_0x295cbe[_0xb0aa('0x34')]);_0x4e5f63[_0xb0aa('0x36')]=_['intersection'](_0x4e5f63[_0xb0aa('0x33')],_0x4e5f63[_0xb0aa('0x34')]);_0x547b2d['attributes']=_[_0xb0aa('0x37')](_0x4e5f63[_0xb0aa('0x33')],qs[_0xb0aa('0x39')](_0x295cbe['query'][_0xb0aa('0x39')]));_0x547b2d['attributes']=_0x547b2d[_0xb0aa('0x38')]['length']?_0x547b2d[_0xb0aa('0x38')]:_0x4e5f63[_0xb0aa('0x33')];if(_0x295cbe['query']['includeAll']){_0x547b2d[_0xb0aa('0x44')]=[{'all':!![]}];}_0x547b2d=_[_0xb0aa('0x40')]({},_0x547b2d,_0x295cbe[_0xb0aa('0x47')]);return db[_0xb0aa('0x30')][_0xb0aa('0x48')](_0x547b2d)[_0xb0aa('0x25')](handleEntityNotFound(_0x579269,null))[_0xb0aa('0x25')](respondWithResult(_0x579269,null))[_0xb0aa('0x45')](handleError(_0x579269,null));};exports['create']=function(_0x233ec1,_0x10dce5){return db[_0xb0aa('0x30')][_0xb0aa('0x49')](_0x233ec1[_0xb0aa('0x4a')],{})[_0xb0aa('0x25')](function(_0x34d0fd){var _0x328a6e=_0x233ec1['user'][_0xb0aa('0x27')]({'plain':!![]});if(!_0x328a6e)throw new Error(_0xb0aa('0x4b'));if(_0x328a6e[_0xb0aa('0x4c')]===_0xb0aa('0x4d')){var _0x2c3ccc=_0x34d0fd[_0xb0aa('0x27')]({'plain':!![]});var _0x4e5f34=_0xb0aa('0x28');return db['UserProfileSection'][_0xb0aa('0x48')]({'where':{'name':_0x4e5f34,'userProfileId':_0x328a6e[_0xb0aa('0x4e')]},'raw':!![]})['then'](function(_0x2bfcee){if(_0x2bfcee&&_0x2bfcee['autoAssociation']===0x0){return db[_0xb0aa('0x4f')][_0xb0aa('0x49')]({'name':_0x2c3ccc['name'],'resourceId':_0x2c3ccc['id'],'type':_0x2bfcee[_0xb0aa('0x2c')],'sectionId':_0x2bfcee['id']},{})['then'](function(){return _0x34d0fd;});}else{return _0x34d0fd;}})[_0xb0aa('0x45')](function(_0x36ab9e){logger['error'](_0xb0aa('0x50'),_0x36ab9e);throw _0x36ab9e;});}return _0x34d0fd;})[_0xb0aa('0x25')](respondWithResult(_0x10dce5,0xc9))[_0xb0aa('0x45')](handleError(_0x10dce5,null));};exports[_0xb0aa('0x24')]=function(_0x3fe1bc,_0x25e75e){if(_0x3fe1bc[_0xb0aa('0x4a')]['id']){delete _0x3fe1bc[_0xb0aa('0x4a')]['id'];}return db[_0xb0aa('0x30')][_0xb0aa('0x48')]({'where':{'id':_0x3fe1bc[_0xb0aa('0x51')]['id']}})[_0xb0aa('0x25')](handleEntityNotFound(_0x25e75e,null))[_0xb0aa('0x25')](saveUpdates(_0x3fe1bc[_0xb0aa('0x4a')],null))[_0xb0aa('0x25')](respondWithResult(_0x25e75e,null))[_0xb0aa('0x45')](handleError(_0x25e75e,null));};exports[_0xb0aa('0x26')]=function(_0x434785,_0x8910af){return db[_0xb0aa('0x30')][_0xb0aa('0x48')]({'where':{'id':_0x434785[_0xb0aa('0x51')]['id']}})[_0xb0aa('0x25')](handleEntityNotFound(_0x8910af,null))[_0xb0aa('0x25')](removeEntity(_0x8910af,null))[_0xb0aa('0x45')](handleError(_0x8910af,null));};exports[_0xb0aa('0x52')]=function(_0x3de9bb,_0x112b40,_0x49e411){return db[_0xb0aa('0x30')][_0xb0aa('0x48')]({'where':{'id':_0x3de9bb[_0xb0aa('0x51')]['id']}})[_0xb0aa('0x25')](handleEntityNotFound(_0x112b40,null))[_0xb0aa('0x25')](function(_0x4a1c27){if(_0x4a1c27){return _0x4a1c27['addUsers'](_0x3de9bb[_0xb0aa('0x4a')][_0xb0aa('0x53')],_['omit'](_0x3de9bb[_0xb0aa('0x4a')],[_0xb0aa('0x53'),'id'])||{});}})['then'](respondWithResult(_0x112b40,null))[_0xb0aa('0x45')](handleError(_0x112b40,null));};exports[_0xb0aa('0x54')]=function(_0x2e9259,_0x45032a,_0x34d888){return db['SquareProject'][_0xb0aa('0x48')]({'where':{'id':_0x2e9259['params']['id']}})[_0xb0aa('0x25')](handleEntityNotFound(_0x45032a,null))[_0xb0aa('0x25')](function(_0x11f42a){if(_0x11f42a){return _0x11f42a[_0xb0aa('0x54')](_0x2e9259[_0xb0aa('0x34')][_0xb0aa('0x53')])['then'](function(){if(_[_0xb0aa('0x55')](_0x2e9259[_0xb0aa('0x34')][_0xb0aa('0x53')])){for(var _0xb43950=0x0;_0xb43950<_0x2e9259[_0xb0aa('0x34')]['ids']['length'];_0xb43950+=0x1){socket[_0xb0aa('0x56')]('userSquareProject:remove',{'UserId':Number(_0x2e9259[_0xb0aa('0x34')][_0xb0aa('0x53')][_0xb43950]),'SquareProjectId':Number(_0x2e9259[_0xb0aa('0x51')]['id'])});}}else{socket['emit'](_0xb0aa('0x57'),{'UserId':Number(_0x2e9259['query'][_0xb0aa('0x53')]),'SquareProjectId':Number(_0x2e9259[_0xb0aa('0x51')]['id'])});}});}})[_0xb0aa('0x25')](respondWithStatusCode(_0x45032a,null))[_0xb0aa('0x45')](handleError(_0x45032a,null));};exports[_0xb0aa('0x58')]=function(_0x3313c4,_0x2736a1,_0x1c4d67){var _0x24d630={};var _0x4ea117={};var _0x1d321e;var _0x4cd7db;return db[_0xb0aa('0x30')][_0xb0aa('0x59')]({'where':{'id':_0x3313c4[_0xb0aa('0x51')]['id']}})['then'](handleEntityNotFound(_0x2736a1,null))['then'](function(_0x1ea323){if(_0x1ea323){_0x1d321e=_0x1ea323;_0x4ea117[_0xb0aa('0x33')]=_[_0xb0aa('0x35')](db[_0xb0aa('0x5a')][_0xb0aa('0x46')]);_0x4ea117['query']=_['keys'](_0x3313c4[_0xb0aa('0x34')]);_0x4ea117[_0xb0aa('0x36')]=_[_0xb0aa('0x37')](_0x4ea117[_0xb0aa('0x33')],_0x4ea117[_0xb0aa('0x34')]);_0x24d630[_0xb0aa('0x38')]=_[_0xb0aa('0x37')](_0x4ea117[_0xb0aa('0x33')],qs[_0xb0aa('0x39')](_0x3313c4[_0xb0aa('0x34')][_0xb0aa('0x39')]));_0x24d630[_0xb0aa('0x38')]=_0x24d630[_0xb0aa('0x38')]['length']?_0x24d630[_0xb0aa('0x38')]:_0x4ea117[_0xb0aa('0x33')];_0x24d630['order']=qs[_0xb0aa('0x3c')](_0x3313c4[_0xb0aa('0x34')]['sort']);_0x24d630[_0xb0aa('0x3d')]=qs[_0xb0aa('0x36')](_[_0xb0aa('0x3e')](_0x3313c4[_0xb0aa('0x34')],_0x4ea117[_0xb0aa('0x36')]));if(_0x3313c4[_0xb0aa('0x34')]['filter']){_0x24d630[_0xb0aa('0x3d')]=_[_0xb0aa('0x40')](_0x24d630[_0xb0aa('0x3d')],{'$or':_[_0xb0aa('0x2f')](_0x24d630[_0xb0aa('0x38')],function(_0x55deb2){var _0x2a707c={};_0x2a707c[_0x55deb2]={'$like':'%'+_0x3313c4[_0xb0aa('0x34')][_0xb0aa('0x3f')]+'%'};return _0x2a707c;})});}_0x24d630=_[_0xb0aa('0x40')]({},_0x24d630,_0x3313c4[_0xb0aa('0x47')]);return _0x1d321e['getUsers'](_0x24d630);}})[_0xb0aa('0x25')](function(_0x36526d){if(_0x36526d){_0x4cd7db=_0x36526d['length'];if(!_0x3313c4[_0xb0aa('0x34')][_0xb0aa('0x3b')]('nolimit')){_0x24d630[_0xb0aa('0x20')]=qs['limit'](_0x3313c4[_0xb0aa('0x34')][_0xb0aa('0x20')]);_0x24d630['offset']=qs[_0xb0aa('0x1e')](_0x3313c4['query'][_0xb0aa('0x1e')]);}return _0x1d321e[_0xb0aa('0x58')](_0x24d630);}})[_0xb0aa('0x25')](function(_0x316ef1){if(_0x316ef1){return _0x316ef1?{'count':_0x4cd7db,'rows':_0x316ef1}:null;}})[_0xb0aa('0x25')](respondWithResult(_0x2736a1,null))[_0xb0aa('0x45')](handleError(_0x2736a1,null));}; \ No newline at end of file +var _0x0365=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','SquareProjects','UserProfileResource','error','name','send','SquareProject','rawAttributes','type','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','params','keys','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','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'];(function(_0x29ae90,_0x3e69fa){var _0x1bc532=function(_0x146078){while(--_0x146078){_0x29ae90['push'](_0x29ae90['shift']());}};_0x1bc532(++_0x3e69fa);}(_0x0365,0xb9));var _0x5036=function(_0x566816,_0x73fea5){_0x566816=_0x566816-0x0;var _0x36719c=_0x0365[_0x566816];return _0x36719c;};'use strict';var emlformat=require(_0x5036('0x0'));var rimraf=require(_0x5036('0x1'));var zipdir=require(_0x5036('0x2'));var jsonpatch=require(_0x5036('0x3'));var rp=require(_0x5036('0x4'));var moment=require(_0x5036('0x5'));var BPromise=require(_0x5036('0x6'));var Mustache=require(_0x5036('0x7'));var util=require(_0x5036('0x8'));var path=require('path');var sox=require(_0x5036('0x9'));var csv=require(_0x5036('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5036('0xb'));var _=require(_0x5036('0xc'));var squel=require(_0x5036('0xd'));var crypto=require(_0x5036('0xe'));var jsforce=require(_0x5036('0xf'));var deskjs=require(_0x5036('0x10'));var toCsv=require(_0x5036('0xa'));var querystring=require(_0x5036('0x11'));var Papa=require(_0x5036('0x12'));var Redis=require(_0x5036('0x13'));var authService=require(_0x5036('0x14'));var qs=require(_0x5036('0x15'));var as=require(_0x5036('0x16'));var hardwareService=require(_0x5036('0x17'));var logger=require(_0x5036('0x18'))(_0x5036('0x19'));var utils=require(_0x5036('0x1a'));var config=require(_0x5036('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x5036('0x1c'))['db'];config[_0x5036('0x1d')]=_[_0x5036('0x1e')](config[_0x5036('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x5036('0x1f'))(new Redis(config[_0x5036('0x1d')]));require(_0x5036('0x20'))[_0x5036('0x21')](socket);function respondWithStatusCode(_0x22ff75,_0x28e470){_0x28e470=_0x28e470||0xcc;return function(_0x414947){if(_0x414947){return _0x22ff75[_0x5036('0x22')](_0x28e470);}return _0x22ff75['status'](_0x28e470)[_0x5036('0x23')]();};}function respondWithResult(_0x47325e,_0x5698da){_0x5698da=_0x5698da||0xc8;return function(_0x2311d8){if(_0x2311d8){return _0x47325e[_0x5036('0x24')](_0x5698da)['json'](_0x2311d8);}};}function respondWithFilteredResult(_0x23a8c6,_0x431ea){return function(_0x43c229){if(_0x43c229){var _0x14b338=typeof _0x431ea[_0x5036('0x25')]===_0x5036('0x26')&&typeof _0x431ea['limit']===_0x5036('0x26');var _0x2dba85=_0x43c229['count'];var _0x14c8b8=_0x14b338?0x0:_0x431ea[_0x5036('0x25')];var _0x5ad041=_0x14b338?_0x43c229[_0x5036('0x27')]:_0x431ea[_0x5036('0x25')]+_0x431ea[_0x5036('0x28')];var _0x160501;if(_0x5ad041>=_0x2dba85){_0x5ad041=_0x2dba85;_0x160501=0xc8;}else{_0x160501=0xce;}_0x23a8c6[_0x5036('0x24')](_0x160501);return _0x23a8c6[_0x5036('0x29')](_0x5036('0x2a'),_0x14c8b8+'-'+_0x5ad041+'/'+_0x2dba85)[_0x5036('0x2b')](_0x43c229);}return null;};}function patchUpdates(_0x3eec45){return function(_0x40b0db){try{jsonpatch[_0x5036('0x2c')](_0x40b0db,_0x3eec45,!![]);}catch(_0xc458c8){return BPromise[_0x5036('0x2d')](_0xc458c8);}return _0x40b0db[_0x5036('0x2e')]();};}function saveUpdates(_0x526b72,_0x43a5e9){return function(_0x387c47){if(_0x387c47){return _0x387c47['update'](_0x526b72)[_0x5036('0x2f')](function(_0x40ae04){return _0x40ae04;});}return null;};}function removeEntity(_0xd70ddb,_0x4d5e55){return function(_0x466a0f){if(_0x466a0f){return _0x466a0f[_0x5036('0x30')]()[_0x5036('0x2f')](function(){var _0x36416e=_0x466a0f[_0x5036('0x31')]({'plain':!![]});var _0x5a42ea=_0x5036('0x32');return db[_0x5036('0x33')][_0x5036('0x30')]({'where':{'type':_0x5a42ea,'resourceId':_0x36416e['id']}})['then'](function(){return _0x466a0f;});})['then'](function(){_0xd70ddb[_0x5036('0x24')](0xcc)[_0x5036('0x23')]();});}};}function handleEntityNotFound(_0xf083c0,_0xbed48b){return function(_0x47b1a9){if(!_0x47b1a9){_0xf083c0[_0x5036('0x22')](0x194);}return _0x47b1a9;};}function handleError(_0x1b3280,_0x38d9da){_0x38d9da=_0x38d9da||0x1f4;return function(_0x87b6f3){logger[_0x5036('0x34')](_0x87b6f3['stack']);if(_0x87b6f3[_0x5036('0x35')]){delete _0x87b6f3[_0x5036('0x35')];}_0x1b3280[_0x5036('0x24')](_0x38d9da)[_0x5036('0x36')](_0x87b6f3);};}exports['index']=function(_0xd3f407,_0x1579c0){var _0x3382cc={},_0x4a4cd2={},_0x390933={'count':0x0,'rows':[]};var _0x20d0c=_['map'](db[_0x5036('0x37')][_0x5036('0x38')],function(_0x27bcbc){return{'name':_0x27bcbc['fieldName'],'type':_0x27bcbc[_0x5036('0x39')]['key']};});_0x4a4cd2[_0x5036('0x3a')]=_[_0x5036('0x3b')](_0x20d0c,'name');_0x4a4cd2[_0x5036('0x3c')]=_['keys'](_0xd3f407[_0x5036('0x3c')]);_0x4a4cd2[_0x5036('0x3d')]=_['intersection'](_0x4a4cd2[_0x5036('0x3a')],_0x4a4cd2[_0x5036('0x3c')]);_0x3382cc[_0x5036('0x3e')]=_[_0x5036('0x3f')](_0x4a4cd2[_0x5036('0x3a')],qs[_0x5036('0x40')](_0xd3f407[_0x5036('0x3c')][_0x5036('0x40')]));_0x3382cc[_0x5036('0x3e')]=_0x3382cc['attributes'][_0x5036('0x41')]?_0x3382cc[_0x5036('0x3e')]:_0x4a4cd2[_0x5036('0x3a')];if(!_0xd3f407[_0x5036('0x3c')][_0x5036('0x42')](_0x5036('0x43'))){_0x3382cc[_0x5036('0x28')]=qs[_0x5036('0x28')](_0xd3f407['query'][_0x5036('0x28')]);_0x3382cc['offset']=qs[_0x5036('0x25')](_0xd3f407[_0x5036('0x3c')][_0x5036('0x25')]);}_0x3382cc[_0x5036('0x44')]=qs[_0x5036('0x45')](_0xd3f407[_0x5036('0x3c')][_0x5036('0x45')]);_0x3382cc[_0x5036('0x46')]=qs['filters'](_[_0x5036('0x47')](_0xd3f407[_0x5036('0x3c')],_0x4a4cd2['filters']),_0x20d0c);if(_0xd3f407[_0x5036('0x3c')][_0x5036('0x48')]){_0x3382cc[_0x5036('0x46')]=_[_0x5036('0x49')](_0x3382cc['where'],{'$or':_[_0x5036('0x3b')](_0x20d0c,function(_0x38cc6a){if(_0x38cc6a[_0x5036('0x39')]!=='VIRTUAL'){var _0x10a964={};_0x10a964[_0x38cc6a['name']]={'$like':'%'+_0xd3f407['query'][_0x5036('0x48')]+'%'};return _0x10a964;}})});}_0x3382cc=_[_0x5036('0x49')]({},_0x3382cc,_0xd3f407['options']);var _0x23c245={'where':_0x3382cc[_0x5036('0x46')]};return db[_0x5036('0x37')][_0x5036('0x27')](_0x23c245)[_0x5036('0x2f')](function(_0x12a365){_0x390933[_0x5036('0x27')]=_0x12a365;if(_0xd3f407[_0x5036('0x3c')][_0x5036('0x4a')]){_0x3382cc[_0x5036('0x4b')]=[{'all':!![]}];}return db[_0x5036('0x37')][_0x5036('0x4c')](_0x3382cc);})[_0x5036('0x2f')](function(_0x570d37){_0x390933['rows']=_0x570d37;return _0x390933;})[_0x5036('0x2f')](respondWithFilteredResult(_0x1579c0,_0x3382cc))[_0x5036('0x4d')](handleError(_0x1579c0,null));};exports['show']=function(_0x5ddbc4,_0x33910c){var _0x4ca790={'raw':![],'where':{'id':_0x5ddbc4[_0x5036('0x4e')]['id']}},_0x49c221={};_0x49c221['model']=_[_0x5036('0x4f')](db[_0x5036('0x37')][_0x5036('0x38')]);_0x49c221[_0x5036('0x3c')]=_[_0x5036('0x4f')](_0x5ddbc4[_0x5036('0x3c')]);_0x49c221[_0x5036('0x3d')]=_[_0x5036('0x3f')](_0x49c221['model'],_0x49c221[_0x5036('0x3c')]);_0x4ca790['attributes']=_[_0x5036('0x3f')](_0x49c221[_0x5036('0x3a')],qs['fields'](_0x5ddbc4['query']['fields']));_0x4ca790['attributes']=_0x4ca790[_0x5036('0x3e')][_0x5036('0x41')]?_0x4ca790[_0x5036('0x3e')]:_0x49c221[_0x5036('0x3a')];if(_0x5ddbc4[_0x5036('0x3c')]['includeAll']){_0x4ca790['include']=[{'all':!![]}];}_0x4ca790=_['merge']({},_0x4ca790,_0x5ddbc4[_0x5036('0x50')]);return db['SquareProject'][_0x5036('0x51')](_0x4ca790)[_0x5036('0x2f')](handleEntityNotFound(_0x33910c,null))[_0x5036('0x2f')](respondWithResult(_0x33910c,null))['catch'](handleError(_0x33910c,null));};exports[_0x5036('0x52')]=function(_0x5ee064,_0x47b708){return db[_0x5036('0x37')][_0x5036('0x52')](_0x5ee064[_0x5036('0x53')],{})[_0x5036('0x2f')](function(_0x8cdede){var _0x2885c9=_0x5ee064[_0x5036('0x54')][_0x5036('0x31')]({'plain':!![]});if(!_0x2885c9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2885c9[_0x5036('0x55')]===_0x5036('0x54')){var _0x1584ae=_0x8cdede['get']({'plain':!![]});var _0xc0e9a6='SquareProjects';return db[_0x5036('0x56')][_0x5036('0x51')]({'where':{'name':_0xc0e9a6,'userProfileId':_0x2885c9[_0x5036('0x57')]},'raw':!![]})[_0x5036('0x2f')](function(_0x35fd67){if(_0x35fd67&&_0x35fd67[_0x5036('0x58')]===0x0){return db[_0x5036('0x33')][_0x5036('0x52')]({'name':_0x1584ae['name'],'resourceId':_0x1584ae['id'],'type':_0x35fd67['name'],'sectionId':_0x35fd67['id']},{})[_0x5036('0x2f')](function(){return _0x8cdede;});}else{return _0x8cdede;}})[_0x5036('0x4d')](function(_0x866d40){logger['error'](_0x5036('0x59'),_0x866d40);throw _0x866d40;});}return _0x8cdede;})[_0x5036('0x2f')](respondWithResult(_0x47b708,0xc9))['catch'](handleError(_0x47b708,null));};exports[_0x5036('0x5a')]=function(_0x39f235,_0x84cb02){if(_0x39f235[_0x5036('0x53')]['id']){delete _0x39f235['body']['id'];}return db[_0x5036('0x37')]['find']({'where':{'id':_0x39f235['params']['id']}})[_0x5036('0x2f')](handleEntityNotFound(_0x84cb02,null))[_0x5036('0x2f')](saveUpdates(_0x39f235['body'],null))['then'](respondWithResult(_0x84cb02,null))[_0x5036('0x4d')](handleError(_0x84cb02,null));};exports[_0x5036('0x30')]=function(_0x49cbbb,_0x3ebdfe){return db[_0x5036('0x37')]['find']({'where':{'id':_0x49cbbb[_0x5036('0x4e')]['id']}})[_0x5036('0x2f')](handleEntityNotFound(_0x3ebdfe,null))['then'](removeEntity(_0x3ebdfe,null))[_0x5036('0x4d')](handleError(_0x3ebdfe,null));};exports[_0x5036('0x5b')]=function(_0x50531e,_0x3cbc3c,_0x50f096){return db[_0x5036('0x37')][_0x5036('0x51')]({'where':{'id':_0x50531e[_0x5036('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3cbc3c,null))[_0x5036('0x2f')](function(_0x4141d8){if(_0x4141d8){return _0x4141d8['addUsers'](_0x50531e['body'][_0x5036('0x5c')],_[_0x5036('0x5d')](_0x50531e[_0x5036('0x53')],[_0x5036('0x5c'),'id'])||{});}})[_0x5036('0x2f')](respondWithResult(_0x3cbc3c,null))[_0x5036('0x4d')](handleError(_0x3cbc3c,null));};exports[_0x5036('0x5e')]=function(_0x1b22cb,_0x5315df,_0x376e53){return db[_0x5036('0x37')][_0x5036('0x51')]({'where':{'id':_0x1b22cb[_0x5036('0x4e')]['id']}})[_0x5036('0x2f')](handleEntityNotFound(_0x5315df,null))['then'](function(_0x10be28){if(_0x10be28){return _0x10be28[_0x5036('0x5e')](_0x1b22cb[_0x5036('0x3c')]['ids'])[_0x5036('0x2f')](function(){if(_[_0x5036('0x5f')](_0x1b22cb[_0x5036('0x3c')]['ids'])){for(var _0x2e42df=0x0;_0x2e42df<_0x1b22cb[_0x5036('0x3c')][_0x5036('0x5c')]['length'];_0x2e42df+=0x1){socket[_0x5036('0x60')](_0x5036('0x61'),{'UserId':Number(_0x1b22cb[_0x5036('0x3c')][_0x5036('0x5c')][_0x2e42df]),'SquareProjectId':Number(_0x1b22cb['params']['id'])});}}else{socket[_0x5036('0x60')](_0x5036('0x61'),{'UserId':Number(_0x1b22cb[_0x5036('0x3c')][_0x5036('0x5c')]),'SquareProjectId':Number(_0x1b22cb['params']['id'])});}});}})[_0x5036('0x2f')](respondWithStatusCode(_0x5315df,null))['catch'](handleError(_0x5315df,null));};exports[_0x5036('0x62')]=function(_0x4c7edd,_0x2e4b6c,_0x3cee8f){var _0xa2b13b={};var _0x252b66={};var _0x1c52af;var _0xb5a1f8;return db[_0x5036('0x37')][_0x5036('0x63')]({'where':{'id':_0x4c7edd[_0x5036('0x4e')]['id']}})[_0x5036('0x2f')](handleEntityNotFound(_0x2e4b6c,null))[_0x5036('0x2f')](function(_0x2bea67){if(_0x2bea67){_0x1c52af=_0x2bea67;_0x252b66[_0x5036('0x3a')]=_[_0x5036('0x4f')](db[_0x5036('0x64')][_0x5036('0x38')]);_0x252b66[_0x5036('0x3c')]=_[_0x5036('0x4f')](_0x4c7edd[_0x5036('0x3c')]);_0x252b66[_0x5036('0x3d')]=_[_0x5036('0x3f')](_0x252b66[_0x5036('0x3a')],_0x252b66['query']);_0xa2b13b[_0x5036('0x3e')]=_[_0x5036('0x3f')](_0x252b66[_0x5036('0x3a')],qs[_0x5036('0x40')](_0x4c7edd[_0x5036('0x3c')][_0x5036('0x40')]));_0xa2b13b[_0x5036('0x3e')]=_0xa2b13b[_0x5036('0x3e')][_0x5036('0x41')]?_0xa2b13b[_0x5036('0x3e')]:_0x252b66['model'];_0xa2b13b[_0x5036('0x44')]=qs[_0x5036('0x45')](_0x4c7edd[_0x5036('0x3c')]['sort']);_0xa2b13b[_0x5036('0x46')]=qs[_0x5036('0x3d')](_['pick'](_0x4c7edd[_0x5036('0x3c')],_0x252b66['filters']));if(_0x4c7edd['query'][_0x5036('0x48')]){_0xa2b13b[_0x5036('0x46')]=_[_0x5036('0x49')](_0xa2b13b[_0x5036('0x46')],{'$or':_['map'](_0xa2b13b['attributes'],function(_0x11156b){var _0x5be7be={};_0x5be7be[_0x11156b]={'$like':'%'+_0x4c7edd['query'][_0x5036('0x48')]+'%'};return _0x5be7be;})});}_0xa2b13b=_[_0x5036('0x49')]({},_0xa2b13b,_0x4c7edd[_0x5036('0x50')]);return _0x1c52af[_0x5036('0x62')](_0xa2b13b);}})[_0x5036('0x2f')](function(_0x16ed64){if(_0x16ed64){_0xb5a1f8=_0x16ed64['length'];if(!_0x4c7edd[_0x5036('0x3c')][_0x5036('0x42')](_0x5036('0x43'))){_0xa2b13b[_0x5036('0x28')]=qs[_0x5036('0x28')](_0x4c7edd['query']['limit']);_0xa2b13b[_0x5036('0x25')]=qs[_0x5036('0x25')](_0x4c7edd[_0x5036('0x3c')][_0x5036('0x25')]);}return _0x1c52af['getUsers'](_0xa2b13b);}})[_0x5036('0x2f')](function(_0xc6613c){if(_0xc6613c){return _0xc6613c?{'count':_0xb5a1f8,'rows':_0xc6613c}:null;}})[_0x5036('0x2f')](respondWithResult(_0x2e4b6c,null))[_0x5036('0x4d')](handleError(_0x2e4b6c,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 3bfaab6..0d483d7 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 _0x3380=['../../mysqldb','SquareProject','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x5ca3d2,_0x2af128){var _0x5312f1=function(_0x4ac50b){while(--_0x4ac50b){_0x5ca3d2['push'](_0x5ca3d2['shift']());}};_0x5312f1(++_0x2af128);}(_0x3380,0xf7));var _0x0338=function(_0x11d867,_0x429591){_0x11d867=_0x11d867-0x0;var _0x58d56e=_0x3380[_0x11d867];return _0x58d56e;};'use strict';var EventEmitter=require(_0x0338('0x0'));var SquareProject=require(_0x0338('0x1'))['db'][_0x0338('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0338('0x3'),'afterUpdate':'update','afterDestroy':_0x0338('0x4')};function emitEvent(_0x449731){return function(_0x8d6184,_0x561f2f,_0x4436cc){SquareProjectEvents['emit'](_0x449731+':'+_0x8d6184['id'],_0x8d6184);SquareProjectEvents[_0x0338('0x5')](_0x449731,_0x8d6184);_0x4436cc(null);};}for(var e in events){if(events[_0x0338('0x6')](e)){var event=events[e];SquareProject[_0x0338('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0xc9a4=['hook','exports','events','../../mysqldb','SquareProject','save','update','remove','emit'];(function(_0x562701,_0x197590){var _0x3862f9=function(_0x9588c9){while(--_0x9588c9){_0x562701['push'](_0x562701['shift']());}};_0x3862f9(++_0x197590);}(_0xc9a4,0x197));var _0x4c9a=function(_0x3ddada,_0x4086c5){_0x3ddada=_0x3ddada-0x0;var _0x572a0e=_0xc9a4[_0x3ddada];return _0x572a0e;};'use strict';var EventEmitter=require(_0x4c9a('0x0'));var SquareProject=require(_0x4c9a('0x1'))['db'][_0x4c9a('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c9a('0x3'),'afterUpdate':_0x4c9a('0x4'),'afterDestroy':_0x4c9a('0x5')};function emitEvent(_0x593588){return function(_0x5db054,_0x18cabf,_0x2a0124){SquareProjectEvents[_0x4c9a('0x6')](_0x593588+':'+_0x5db054['id'],_0x5db054);SquareProjectEvents[_0x4c9a('0x6')](_0x593588,_0x5db054);_0x2a0124(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x4c9a('0x7')](e,emitEvent(event));}}module[_0x4c9a('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index d23bdc3..8df695f 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 _0xc3bb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api'];(function(_0x41a835,_0x15c94d){var _0xafc4e3=function(_0x3a3024){while(--_0x3a3024){_0x41a835['push'](_0x41a835['shift']());}};_0xafc4e3(++_0x15c94d);}(_0xc3bb,0x1c0));var _0xbc3b=function(_0x28bd40,_0x3382a0){_0x28bd40=_0x28bd40-0x0;var _0x374f3d=_0xc3bb[_0x28bd40];return _0x374f3d;};'use strict';var _=require(_0xbc3b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbc3b('0x1'));var moment=require(_0xbc3b('0x2'));var BPromise=require(_0xbc3b('0x3'));var rp=require(_0xbc3b('0x4'));var fs=require('fs');var path=require(_0xbc3b('0x5'));var rimraf=require(_0xbc3b('0x6'));var config=require(_0xbc3b('0x7'));var attributes=require(_0xbc3b('0x8'));module[_0xbc3b('0x9')]=function(_0x4ecf59,_0x2ed4c5){return _0x4ecf59[_0xbc3b('0xa')](_0xbc3b('0xb'),attributes,{'tableName':_0xbc3b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4406a4,_0x42ba56,_0x21cf72){if(_0x4406a4[_0xbc3b('0xd')](_0xbc3b('0xe'))){_0x4406a4[_0xbc3b('0xf')]=moment()[_0xbc3b('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4406a4[_0xbc3b('0xd')]('production')){_0x4406a4['publishedAt']=moment()['format'](_0xbc3b('0x11'));}_0x21cf72(null,_0x4406a4);}}});}; \ No newline at end of file +var _0x0596=['format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','changed','preproduction'];(function(_0x4fc435,_0x45eddf){var _0x3c5db1=function(_0x1d18c1){while(--_0x1d18c1){_0x4fc435['push'](_0x4fc435['shift']());}};_0x3c5db1(++_0x45eddf);}(_0x0596,0x100));var _0x6059=function(_0x4e5502,_0x183eb4){_0x4e5502=_0x4e5502-0x0;var _0xd61cf7=_0x0596[_0x4e5502];return _0xd61cf7;};'use strict';var _=require(_0x6059('0x0'));var util=require(_0x6059('0x1'));var logger=require(_0x6059('0x2'))('api');var moment=require(_0x6059('0x3'));var BPromise=require(_0x6059('0x4'));var rp=require(_0x6059('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6059('0x6'));var config=require(_0x6059('0x7'));var attributes=require(_0x6059('0x8'));module[_0x6059('0x9')]=function(_0x5267d2,_0x507a6c){return _0x5267d2['define'](_0x6059('0xa'),attributes,{'tableName':_0x6059('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d9dc0,_0x201726,_0x4f5834){if(_0x4d9dc0[_0x6059('0xc')](_0x6059('0xd'))){_0x4d9dc0['savedAt']=moment()[_0x6059('0xe')](_0x6059('0xf'));}if(_0x4d9dc0[_0x6059('0xc')](_0x6059('0x10'))){_0x4d9dc0[_0x6059('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4f5834(null,_0x4d9dc0);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index dc00cd5..c624d2b 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 _0x6e73=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','debug','lodash','util'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x6e73,0xcb));var _0x36e7=function(_0x2a37b8,_0x52b7ac){_0x2a37b8=_0x2a37b8-0x0;var _0x1752c9=_0x6e73[_0x2a37b8];return _0x1752c9;};'use strict';var _=require(_0x36e7('0x0'));var util=require(_0x36e7('0x1'));var moment=require(_0x36e7('0x2'));var BPromise=require(_0x36e7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36e7('0x4'));var db=require(_0x36e7('0x5'))['db'];var utils=require(_0x36e7('0x6'));var logger=require(_0x36e7('0x7'))(_0x36e7('0x8'));var config=require(_0x36e7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x36e7('0xa')][_0x36e7('0xb')]({'port':0x232a});config[_0x36e7('0xc')]=_[_0x36e7('0xd')](config[_0x36e7('0xc')],{'host':_0x36e7('0xe'),'port':0x18eb});var socket=require(_0x36e7('0xf'))(new Redis(config[_0x36e7('0xc')]));require(_0x36e7('0x10'))[_0x36e7('0x11')](socket);function respondWithRpcPromise(_0x5a6fcd,_0x1a4a92,_0x56996c){return new BPromise(function(_0x3b1b78,_0x21734b){return client[_0x36e7('0x12')](_0x5a6fcd,_0x56996c)[_0x36e7('0x13')](function(_0x4eec65){logger[_0x36e7('0x14')](_0x36e7('0x15'),_0x1a4a92,_0x36e7('0x16'));logger['debug'](_0x36e7('0x17'),_0x1a4a92,'request\x20sent',JSON[_0x36e7('0x18')](_0x4eec65));if(_0x4eec65[_0x36e7('0x19')]){if(_0x4eec65[_0x36e7('0x19')][_0x36e7('0x1a')]===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x1a4a92,_0x4eec65[_0x36e7('0x19')][_0x36e7('0x1b')]);return _0x21734b(_0x4eec65[_0x36e7('0x19')][_0x36e7('0x1b')]);}logger[_0x36e7('0x19')](_0x36e7('0x15'),_0x1a4a92,_0x4eec65['error']['message']);return _0x3b1b78(_0x4eec65[_0x36e7('0x19')][_0x36e7('0x1b')]);}else{logger['info']('SquareProject,\x20%s,\x20%s',_0x1a4a92,_0x36e7('0x16'));_0x3b1b78(_0x4eec65[_0x36e7('0x1c')]['message']);}})[_0x36e7('0x1d')](function(_0x41efa1){logger[_0x36e7('0x19')]('SquareProject,\x20%s,\x20%s',_0x1a4a92,_0x41efa1);_0x21734b(_0x41efa1);});});}exports[_0x36e7('0x1e')]=function(_0x585cdd){var _0x348753=this;return new Promise(function(_0x3e6a52,_0x2347b3){return db[_0x36e7('0x1f')][_0x36e7('0x20')]({'raw':_0x585cdd[_0x36e7('0x21')]?_0x585cdd['options'][_0x36e7('0x22')]===undefined?!![]:![]:!![],'where':_0x585cdd[_0x36e7('0x21')]?_0x585cdd['options'][_0x36e7('0x23')]||null:null,'attributes':_0x585cdd[_0x36e7('0x21')]?_0x585cdd[_0x36e7('0x21')][_0x36e7('0x24')]||null:null,'include':_0x585cdd[_0x36e7('0x21')]?_0x585cdd[_0x36e7('0x21')][_0x36e7('0x25')]?_[_0x36e7('0x26')](_0x585cdd[_0x36e7('0x21')]['include'],function(_0x352438){return{'model':db[_0x352438[_0x36e7('0x27')]],'as':_0x352438['as'],'attributes':_0x352438[_0x36e7('0x24')],'include':_0x352438[_0x36e7('0x25')]?_[_0x36e7('0x26')](_0x352438['include'],function(_0x17a4d8){return{'model':db[_0x17a4d8['model']],'as':_0x17a4d8['as'],'attributes':_0x17a4d8[_0x36e7('0x24')],'include':_0x17a4d8[_0x36e7('0x25')]?_[_0x36e7('0x26')](_0x17a4d8[_0x36e7('0x25')],function(_0x57ffcc){return{'model':db[_0x57ffcc[_0x36e7('0x27')]],'as':_0x57ffcc['as'],'attributes':_0x57ffcc[_0x36e7('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31c2c9){logger[_0x36e7('0x14')](_0x36e7('0x1e'),_0x585cdd);logger[_0x36e7('0x28')]('ShowSquareProject',_0x585cdd,JSON[_0x36e7('0x18')](_0x31c2c9));_0x3e6a52(_0x31c2c9);})[_0x36e7('0x1d')](function(_0x5430f9){logger[_0x36e7('0x19')]('ShowSquareProject',_0x5430f9['message'],_0x585cdd);_0x2347b3(_0x348753[_0x36e7('0x19')](0x1f4,_0x5430f9[_0x36e7('0x1b')]));});});}; \ No newline at end of file +var _0x8e58=['request\x20sent','stringify','error','code','result','message','ShowSquareProject','find','options','raw','where','include','map','model','attributes','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s'];(function(_0x2ed632,_0x5cc598){var _0x353cab=function(_0x11869c){while(--_0x11869c){_0x2ed632['push'](_0x2ed632['shift']());}};_0x353cab(++_0x5cc598);}(_0x8e58,0xe8));var _0x88e5=function(_0x5c859d,_0x4164cf){_0x5c859d=_0x5c859d-0x0;var _0x4da867=_0x8e58[_0x5c859d];return _0x4da867;};'use strict';var _=require(_0x88e5('0x0'));var util=require(_0x88e5('0x1'));var moment=require(_0x88e5('0x2'));var BPromise=require(_0x88e5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88e5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x88e5('0x5'))(_0x88e5('0x6'));var config=require(_0x88e5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x88e5('0x8')]['http']({'port':0x232a});config[_0x88e5('0x9')]=_[_0x88e5('0xa')](config[_0x88e5('0x9')],{'host':_0x88e5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88e5('0x9')]));require(_0x88e5('0xc'))[_0x88e5('0xd')](socket);function respondWithRpcPromise(_0x49fb32,_0x425dd3,_0x3d49b5){return new BPromise(function(_0x21623b,_0xb56f06){return client[_0x88e5('0xe')](_0x49fb32,_0x3d49b5)[_0x88e5('0xf')](function(_0x47d79f){logger[_0x88e5('0x10')](_0x88e5('0x11'),_0x425dd3,'request\x20sent');logger[_0x88e5('0x12')](_0x88e5('0x13'),_0x425dd3,_0x88e5('0x14'),JSON[_0x88e5('0x15')](_0x47d79f));if(_0x47d79f[_0x88e5('0x16')]){if(_0x47d79f['error'][_0x88e5('0x17')]===0x1f4){logger['error'](_0x88e5('0x11'),_0x425dd3,_0x47d79f[_0x88e5('0x16')]['message']);return _0xb56f06(_0x47d79f[_0x88e5('0x16')]['message']);}logger[_0x88e5('0x16')](_0x88e5('0x11'),_0x425dd3,_0x47d79f[_0x88e5('0x16')]['message']);return _0x21623b(_0x47d79f[_0x88e5('0x16')]['message']);}else{logger[_0x88e5('0x10')](_0x88e5('0x11'),_0x425dd3,_0x88e5('0x14'));_0x21623b(_0x47d79f[_0x88e5('0x18')][_0x88e5('0x19')]);}})['catch'](function(_0x16a1be){logger['error']('SquareProject,\x20%s,\x20%s',_0x425dd3,_0x16a1be);_0xb56f06(_0x16a1be);});});}exports[_0x88e5('0x1a')]=function(_0x2a1e71){var _0x30ea68=this;return new Promise(function(_0x255536,_0x5e2d14){return db['SquareProject'][_0x88e5('0x1b')]({'raw':_0x2a1e71[_0x88e5('0x1c')]?_0x2a1e71['options'][_0x88e5('0x1d')]===undefined?!![]:![]:!![],'where':_0x2a1e71[_0x88e5('0x1c')]?_0x2a1e71[_0x88e5('0x1c')][_0x88e5('0x1e')]||null:null,'attributes':_0x2a1e71[_0x88e5('0x1c')]?_0x2a1e71[_0x88e5('0x1c')]['attributes']||null:null,'include':_0x2a1e71[_0x88e5('0x1c')]?_0x2a1e71['options'][_0x88e5('0x1f')]?_[_0x88e5('0x20')](_0x2a1e71[_0x88e5('0x1c')]['include'],function(_0x17658f){return{'model':db[_0x17658f[_0x88e5('0x21')]],'as':_0x17658f['as'],'attributes':_0x17658f[_0x88e5('0x22')],'include':_0x17658f[_0x88e5('0x1f')]?_['map'](_0x17658f[_0x88e5('0x1f')],function(_0x55e9ee){return{'model':db[_0x55e9ee['model']],'as':_0x55e9ee['as'],'attributes':_0x55e9ee[_0x88e5('0x22')],'include':_0x55e9ee[_0x88e5('0x1f')]?_[_0x88e5('0x20')](_0x55e9ee[_0x88e5('0x1f')],function(_0x55a4d0){return{'model':db[_0x55a4d0[_0x88e5('0x21')]],'as':_0x55a4d0['as'],'attributes':_0x55a4d0['attributes']};}):[]};}):[]};}):[]:[]})[_0x88e5('0xf')](function(_0x80db6b){logger[_0x88e5('0x10')]('ShowSquareProject',_0x2a1e71);logger[_0x88e5('0x12')](_0x88e5('0x1a'),_0x2a1e71,JSON[_0x88e5('0x15')](_0x80db6b));_0x255536(_0x80db6b);})[_0x88e5('0x23')](function(_0x51243d){logger[_0x88e5('0x16')](_0x88e5('0x1a'),_0x51243d[_0x88e5('0x19')],_0x2a1e71);_0x5e2d14(_0x30ea68[_0x88e5('0x16')](0x1f4,_0x51243d[_0x88e5('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 5708b7f..f715808 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 _0xcd1b=['register','length','squareProject:','./squareProject.events','save','update'];(function(_0x4f7c64,_0x334f93){var _0x50a084=function(_0x2c4778){while(--_0x2c4778){_0x4f7c64['push'](_0x4f7c64['shift']());}};_0x50a084(++_0x334f93);}(_0xcd1b,0xc9));var _0xbcd1=function(_0x8f3f8e,_0x173886){_0x8f3f8e=_0x8f3f8e-0x0;var _0x283c58=_0xcd1b[_0x8f3f8e];return _0x283c58;};'use strict';var SquareProjectEvents=require(_0xbcd1('0x0'));var events=[_0xbcd1('0x1'),'remove',_0xbcd1('0x2')];function createListener(_0x50d58f,_0x1badbb){return function(_0xfc2b54){_0x1badbb['emit'](_0x50d58f,_0xfc2b54);};}function removeListener(_0xa64670,_0x2f0dab){return function(){SquareProjectEvents['removeListener'](_0xa64670,_0x2f0dab);};}exports[_0xbcd1('0x3')]=function(_0x57cd92){for(var _0x9f8d23=0x0,_0x9c4b86=events[_0xbcd1('0x4')];_0x9f8d23<_0x9c4b86;_0x9f8d23++){var _0x57fafb=events[_0x9f8d23];var _0x2064e1=createListener(_0xbcd1('0x5')+_0x57fafb,_0x57cd92);SquareProjectEvents['on'](_0x57fafb,_0x2064e1);}}; \ No newline at end of file +var _0xce1a=['remove','update','emit','register','length','./squareProject.events','save'];(function(_0x3fc5fb,_0x4d9572){var _0x5cc678=function(_0x31785b){while(--_0x31785b){_0x3fc5fb['push'](_0x3fc5fb['shift']());}};_0x5cc678(++_0x4d9572);}(_0xce1a,0x1cc));var _0xace1=function(_0x3171f1,_0x28c520){_0x3171f1=_0x3171f1-0x0;var _0x244bc2=_0xce1a[_0x3171f1];return _0x244bc2;};'use strict';var SquareProjectEvents=require(_0xace1('0x0'));var events=[_0xace1('0x1'),_0xace1('0x2'),_0xace1('0x3')];function createListener(_0x1d5420,_0x4e4728){return function(_0x59a510){_0x4e4728[_0xace1('0x4')](_0x1d5420,_0x59a510);};}function removeListener(_0x2428df,_0x3a4e6c){return function(){SquareProjectEvents['removeListener'](_0x2428df,_0x3a4e6c);};}exports[_0xace1('0x5')]=function(_0x337025){for(var _0xa24db=0x0,_0x3c12a9=events[_0xace1('0x6')];_0xa24db<_0x3c12a9;_0xa24db++){var _0x3cbf2d=events[_0xa24db];var _0x40cee2=createListener('squareProject:'+_0x3cbf2d,_0x337025);SquareProjectEvents['on'](_0x3cbf2d,_0x40cee2);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index fa69d90..d880453 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 _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x2fe64f,_0x1fca75){var _0xd77946=function(_0x3c614f){while(--_0x3c614f){_0x2fe64f['push'](_0x2fe64f['shift']());}};_0xd77946(++_0x1fca75);}(_0x1261,0x144));var _0x1126=function(_0xd6a568,_0x4d39e9){_0xd6a568=_0xd6a568-0x0;var _0x56e5ab=_0x1261[_0xd6a568];return _0x56e5ab;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=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(_0x280ead,_0x21b4f4){var _0x1a7b4f=function(_0x46e649){while(--_0x46e649){_0x280ead['push'](_0x280ead['shift']());}};_0x1a7b4f(++_0x21b4f4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xc4aa[_0xaa1b3e];return _0x454d7d;};'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 9484495..b11c84d 100644 --- a/server/api/squareRecording/squareRecording.attributes.js +++ b/server/api/squareRecording/squareRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bd8=['STRING','VIRTUAL','getDataValue','substring','sequelize'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x2bd8,0x130));var _0x82bd=function(_0x1a3bff,_0x165d9c){_0x1a3bff=_0x1a3bff-0x0;var _0x4c3873=_0x2bd8[_0x1a3bff];return _0x4c3873;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x82bd('0x1')]},'callerid':{'type':Sequelize[_0x82bd('0x1')]},'calleridname':{'type':Sequelize[_0x82bd('0x1')]},'context':{'type':Sequelize[_0x82bd('0x1')]},'extension':{'type':Sequelize[_0x82bd('0x1')]},'priority':{'type':Sequelize[_0x82bd('0x1')]},'accountcode':{'type':Sequelize[_0x82bd('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x82bd('0x1')]},'saveName':{'type':Sequelize[_0x82bd('0x1')]},'filename':{'type':Sequelize[_0x82bd('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x82bd('0x2')],'get':function(){var _0x77d7a9='';var _0x226f60=this[_0x82bd('0x3')]('savePath');if(_0x226f60){_0x77d7a9=_0x226f60[_0x82bd('0x4')](_0x226f60['lastIndexOf']('.'));}return _0x77d7a9;}}}; \ No newline at end of file +var _0xbd51=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','STRING'];(function(_0x3c6c58,_0x5b0fa2){var _0x1ced4f=function(_0x2e09b4){while(--_0x2e09b4){_0x3c6c58['push'](_0x3c6c58['shift']());}};_0x1ced4f(++_0x5b0fa2);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x5df097,_0x4d68f8){_0x5df097=_0x5df097-0x0;var _0xc95a59=_0xbd51[_0x5df097];return _0xc95a59;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1bd5('0x1')]},'callerid':{'type':Sequelize[_0x1bd5('0x1')]},'calleridname':{'type':Sequelize[_0x1bd5('0x1')]},'context':{'type':Sequelize[_0x1bd5('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x1bd5('0x1')]},'saveName':{'type':Sequelize[_0x1bd5('0x1')]},'filename':{'type':Sequelize[_0x1bd5('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x1bd5('0x2')],'get':function(){var _0x30a385='';var _0x19077c=this[_0x1bd5('0x3')](_0x1bd5('0x4'));if(_0x19077c){_0x30a385=_0x19077c['substring'](_0x19077c[_0x1bd5('0x5')]('.'));}return _0x30a385;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index d774d21..b43dc4f 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 _0xd6c7=['../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','status','sendStatus','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x28f153,_0x4852ed){var _0x56b861=function(_0x3cbf02){while(--_0x3cbf02){_0x28f153['push'](_0x28f153['shift']());}};_0x56b861(++_0x4852ed);}(_0xd6c7,0x167));var _0x7d6c=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xd6c7[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d6c('0x0'));var zipdir=require(_0x7d6c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d6c('0x2'));var moment=require(_0x7d6c('0x3'));var BPromise=require(_0x7d6c('0x4'));var Mustache=require(_0x7d6c('0x5'));var util=require(_0x7d6c('0x6'));var path=require(_0x7d6c('0x7'));var sox=require('sox');var csv=require(_0x7d6c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d6c('0x9'));var squel=require('squel');var crypto=require(_0x7d6c('0xa'));var jsforce=require(_0x7d6c('0xb'));var deskjs=require(_0x7d6c('0xc'));var toCsv=require(_0x7d6c('0x8'));var querystring=require(_0x7d6c('0xd'));var Papa=require('papaparse');var Redis=require(_0x7d6c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7d6c('0xf'));var as=require(_0x7d6c('0x10'));var hardwareService=require(_0x7d6c('0x11'));var logger=require(_0x7d6c('0x12'))(_0x7d6c('0x13'));var utils=require(_0x7d6c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7d6c('0x15'));var db=require(_0x7d6c('0x16'))['db'];function respondWithStatusCode(_0x4feea0,_0x3dd169){_0x3dd169=_0x3dd169||0xcc;return function(_0x22e03f){if(_0x22e03f){return _0x4feea0['sendStatus'](_0x3dd169);}return _0x4feea0['status'](_0x3dd169)[_0x7d6c('0x17')]();};}function respondWithResult(_0x2cf695,_0x33bf50){_0x33bf50=_0x33bf50||0xc8;return function(_0x438d87){if(_0x438d87){return _0x2cf695['status'](_0x33bf50)['json'](_0x438d87);}};}function respondWithFilteredResult(_0x9b10bf,_0x5cdf5f){return function(_0x155be1){if(_0x155be1){var _0x3dfec7=typeof _0x5cdf5f[_0x7d6c('0x18')]===_0x7d6c('0x19')&&typeof _0x5cdf5f[_0x7d6c('0x1a')]===_0x7d6c('0x19');var _0x24ee2f=_0x155be1[_0x7d6c('0x1b')];var _0x530787=_0x3dfec7?0x0:_0x5cdf5f[_0x7d6c('0x18')];var _0x2b1e00=_0x3dfec7?_0x155be1[_0x7d6c('0x1b')]:_0x5cdf5f[_0x7d6c('0x18')]+_0x5cdf5f[_0x7d6c('0x1a')];var _0x3e7914;if(_0x2b1e00>=_0x24ee2f){_0x2b1e00=_0x24ee2f;_0x3e7914=0xc8;}else{_0x3e7914=0xce;}_0x9b10bf['status'](_0x3e7914);return _0x9b10bf['set'](_0x7d6c('0x1c'),_0x530787+'-'+_0x2b1e00+'/'+_0x24ee2f)['json'](_0x155be1);}return null;};}function patchUpdates(_0x5e3eb7){return function(_0x333c2b){try{jsonpatch[_0x7d6c('0x1d')](_0x333c2b,_0x5e3eb7,!![]);}catch(_0x278a34){return BPromise[_0x7d6c('0x1e')](_0x278a34);}return _0x333c2b[_0x7d6c('0x1f')]();};}function saveUpdates(_0x2aa123,_0x283e0b){return function(_0x3cc29a){if(_0x3cc29a){return _0x3cc29a[_0x7d6c('0x20')](_0x2aa123)[_0x7d6c('0x21')](function(_0x5e8894){return _0x5e8894;});}return null;};}function removeEntity(_0x21ea23,_0x5a3d70){return function(_0x54cb7e){if(_0x54cb7e){return _0x54cb7e[_0x7d6c('0x22')]()[_0x7d6c('0x21')](function(){_0x21ea23[_0x7d6c('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23ec85,_0x4675bd){return function(_0xd8e80f){if(!_0xd8e80f){_0x23ec85[_0x7d6c('0x24')](0x194);}return _0xd8e80f;};}function handleError(_0x4540df,_0x4b5461){_0x4b5461=_0x4b5461||0x1f4;return function(_0x3b0a73){logger[_0x7d6c('0x25')](_0x3b0a73[_0x7d6c('0x26')]);if(_0x3b0a73[_0x7d6c('0x27')]){delete _0x3b0a73[_0x7d6c('0x27')];}_0x4540df[_0x7d6c('0x23')](_0x4b5461)[_0x7d6c('0x28')](_0x3b0a73);};}exports[_0x7d6c('0x29')]=function(_0x28dfc1,_0x5ebb64){var _0x4c737c={},_0xf61ebf={},_0x4b5116={'count':0x0,'rows':[]};var _0x3cfe7e=_['map'](db[_0x7d6c('0x2a')][_0x7d6c('0x2b')],function(_0x494ddc){return{'name':_0x494ddc[_0x7d6c('0x2c')],'type':_0x494ddc[_0x7d6c('0x2d')][_0x7d6c('0x2e')]};});_0xf61ebf[_0x7d6c('0x2f')]=_[_0x7d6c('0x30')](_0x3cfe7e,_0x7d6c('0x27'));_0xf61ebf[_0x7d6c('0x31')]=_[_0x7d6c('0x32')](_0x28dfc1[_0x7d6c('0x31')]);_0xf61ebf[_0x7d6c('0x33')]=_[_0x7d6c('0x34')](_0xf61ebf[_0x7d6c('0x2f')],_0xf61ebf[_0x7d6c('0x31')]);_0x4c737c[_0x7d6c('0x35')]=_[_0x7d6c('0x34')](_0xf61ebf['model'],qs['fields'](_0x28dfc1[_0x7d6c('0x31')][_0x7d6c('0x36')]));_0x4c737c[_0x7d6c('0x35')]=_0x4c737c[_0x7d6c('0x35')][_0x7d6c('0x37')]?_0x4c737c[_0x7d6c('0x35')]:_0xf61ebf[_0x7d6c('0x2f')];if(!_0x28dfc1[_0x7d6c('0x31')][_0x7d6c('0x38')](_0x7d6c('0x39'))){_0x4c737c[_0x7d6c('0x1a')]=qs[_0x7d6c('0x1a')](_0x28dfc1[_0x7d6c('0x31')][_0x7d6c('0x1a')]);_0x4c737c['offset']=qs[_0x7d6c('0x18')](_0x28dfc1[_0x7d6c('0x31')][_0x7d6c('0x18')]);}_0x4c737c[_0x7d6c('0x3a')]=qs[_0x7d6c('0x3b')](_0x28dfc1['query'][_0x7d6c('0x3b')]);_0x4c737c['where']=qs[_0x7d6c('0x33')](_['pick'](_0x28dfc1[_0x7d6c('0x31')],_0xf61ebf[_0x7d6c('0x33')]),_0x3cfe7e);if(_0x28dfc1['query'][_0x7d6c('0x3c')]){_0x4c737c[_0x7d6c('0x3d')]=_['merge'](_0x4c737c['where'],{'$or':_['map'](_0x3cfe7e,function(_0x189ca5){if(_0x189ca5[_0x7d6c('0x2d')]!=='VIRTUAL'){var _0x33748f={};_0x33748f[_0x189ca5[_0x7d6c('0x27')]]={'$like':'%'+_0x28dfc1[_0x7d6c('0x31')][_0x7d6c('0x3c')]+'%'};return _0x33748f;}})});}_0x4c737c=_[_0x7d6c('0x3e')]({},_0x4c737c,_0x28dfc1[_0x7d6c('0x3f')]);var _0x5e38d5={'where':_0x4c737c[_0x7d6c('0x3d')]};return db['SquareRecording']['count'](_0x5e38d5)[_0x7d6c('0x21')](function(_0x4c8d65){_0x4b5116['count']=_0x4c8d65;if(_0x28dfc1[_0x7d6c('0x31')][_0x7d6c('0x40')]){_0x4c737c[_0x7d6c('0x41')]=[{'all':!![]}];}return db['SquareRecording'][_0x7d6c('0x42')](_0x4c737c);})['then'](function(_0x4118ea){_0x4b5116[_0x7d6c('0x43')]=_0x4118ea;return _0x4b5116;})[_0x7d6c('0x21')](respondWithFilteredResult(_0x5ebb64,_0x4c737c))['catch'](handleError(_0x5ebb64,null));};exports[_0x7d6c('0x44')]=function(_0xb84053,_0x5af850){var _0x228f78={'raw':!![],'where':{'id':_0xb84053[_0x7d6c('0x45')]['id']}},_0x5537b2={};_0x5537b2[_0x7d6c('0x2f')]=_[_0x7d6c('0x32')](db[_0x7d6c('0x2a')][_0x7d6c('0x2b')]);_0x5537b2['query']=_[_0x7d6c('0x32')](_0xb84053['query']);_0x5537b2[_0x7d6c('0x33')]=_['intersection'](_0x5537b2['model'],_0x5537b2[_0x7d6c('0x31')]);_0x228f78['attributes']=_[_0x7d6c('0x34')](_0x5537b2[_0x7d6c('0x2f')],qs['fields'](_0xb84053['query'][_0x7d6c('0x36')]));_0x228f78[_0x7d6c('0x35')]=_0x228f78[_0x7d6c('0x35')]['length']?_0x228f78['attributes']:_0x5537b2[_0x7d6c('0x2f')];if(_0xb84053[_0x7d6c('0x31')][_0x7d6c('0x40')]){_0x228f78[_0x7d6c('0x41')]=[{'all':!![]}];}_0x228f78=_['merge']({},_0x228f78,_0xb84053[_0x7d6c('0x3f')]);return db[_0x7d6c('0x2a')]['find'](_0x228f78)['then'](handleEntityNotFound(_0x5af850,null))['then'](respondWithResult(_0x5af850,null))[_0x7d6c('0x46')](handleError(_0x5af850,null));};exports[_0x7d6c('0x47')]=function(_0x5cab67,_0x1eed82){return db[_0x7d6c('0x2a')][_0x7d6c('0x47')](_0x5cab67[_0x7d6c('0x48')],{})['then'](respondWithResult(_0x1eed82,0xc9))[_0x7d6c('0x46')](handleError(_0x1eed82,null));};exports[_0x7d6c('0x20')]=function(_0x583078,_0x399f2b){if(_0x583078[_0x7d6c('0x48')]['id']){delete _0x583078[_0x7d6c('0x48')]['id'];}return db['SquareRecording'][_0x7d6c('0x49')]({'where':{'id':_0x583078[_0x7d6c('0x45')]['id']}})['then'](handleEntityNotFound(_0x399f2b,null))[_0x7d6c('0x21')](saveUpdates(_0x583078[_0x7d6c('0x48')],null))[_0x7d6c('0x21')](respondWithResult(_0x399f2b,null))[_0x7d6c('0x46')](handleError(_0x399f2b,null));};exports[_0x7d6c('0x4a')]=function(_0x42b233,_0x492ca0,_0x212a40){var _0xde3709=require(_0x7d6c('0x4b'));var _0x4ab227=![];var _0x58f677={};if(_0x42b233[_0x7d6c('0x31')][_0x7d6c('0x2d')]&&_0x42b233[_0x7d6c('0x31')][_0x7d6c('0x2d')]===_0x7d6c('0x4c')){_0x58f677['uniqueid']=_0x42b233[_0x7d6c('0x45')]['id'];}else{_0x58f677['id']=_0x42b233[_0x7d6c('0x45')]['id'];}return db['SquareRecording'][_0x7d6c('0x49')]({'where':_0x58f677,'attributes':['id',_0x7d6c('0x4d'),_0x7d6c('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x492ca0,null))[_0x7d6c('0x21')](function(_0xb68224){if(_0xb68224){var _0x3963d3=_0xb68224['savePath'];var _0x39fdae=util[_0x7d6c('0x4f')](_0x7d6c('0x50'),_0x3963d3);if(fs['existsSync'](_0x39fdae)){_0x4ab227=!![];return _0xde3709['decryptFile'](_0x39fdae,_0x3963d3,config['secrets']['recording'])[_0x7d6c('0x21')](function(){return _0xb68224;});}return _0xb68224;}})['then'](function(_0x800814){if(_0x800814){var _0x4d15b5=_0x800814[_0x7d6c('0x4d')];if(!fs['existsSync'](_0x4d15b5)){throw new db[(_0x7d6c('0x51'))]['ValidationError'](_0x7d6c('0x52'));}if(_0x800814['filename']){return _0x492ca0[_0x7d6c('0x4a')](_0x4d15b5,_0x800814[_0x7d6c('0x4e')]+path[_0x7d6c('0x53')](_0x4d15b5),function(){if(_0x4ab227){fs[_0x7d6c('0x54')](_0x4d15b5);}});}else{return _0x492ca0[_0x7d6c('0x4a')](_0x4d15b5,function(_0x4eccef){if(_0x4ab227){fs[_0x7d6c('0x54')](_0x4d15b5);}});}}})[_0x7d6c('0x46')](function(_0x22f8bc){if(_0x22f8bc[_0x7d6c('0x55')]===_0x7d6c('0x52')){_0x492ca0[_0x7d6c('0x23')](0x194)[_0x7d6c('0x28')](_0x7d6c('0x56'));}else{return handleError(_0x492ca0,null);}});};exports[_0x7d6c('0x22')]=function(_0x12d833,_0x5de4c8){return db[_0x7d6c('0x2a')][_0x7d6c('0x49')]({'where':{'id':_0x12d833['params']['id']}})[_0x7d6c('0x21')](function(_0x38e1e1){if(_[_0x7d6c('0x57')](_0x38e1e1)){throw new ReferenceError(_0x7d6c('0x58'));}return _0x38e1e1;})[_0x7d6c('0x21')](function(_0x89e328){var _0x2064d7=_0x89e328[_0x7d6c('0x4d')];logger[_0x7d6c('0x59')](_0x7d6c('0x5a'),_0x2064d7);if(!_[_0x7d6c('0x57')](_0x89e328[_0x7d6c('0x4d')])&&fs[_0x7d6c('0x5b')](_0x2064d7)){logger['info'](_0x7d6c('0x5c')+_0x2064d7+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7d6c('0x5d')](_0x2064d7);}_0x2064d7=_0x2064d7+'.cypher';if(!_[_0x7d6c('0x57')](_0x89e328[_0x7d6c('0x4d')])&&fs['existsSync'](_0x2064d7)){logger[_0x7d6c('0x59')](_0x7d6c('0x5c')+_0x2064d7+_0x7d6c('0x5e'));fs['unlinkSync'](_0x2064d7);}return _0x89e328;})[_0x7d6c('0x21')](function(_0x4a7aca){if(!_0x4a7aca)throw new InternalError();return _0x4a7aca['destroy']();})[_0x7d6c('0x21')](function(){_0x5de4c8['status'](0xcc)['end']();})[_0x7d6c('0x46')](handleError(_0x5de4c8,null));}; \ No newline at end of file +var _0x84d3=['../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','filters','find','create','body','catch','download','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','filename','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x84d3,0xfd));var _0x384d=function(_0xc3f901,_0x3590c4){_0xc3f901=_0xc3f901-0x0;var _0x112340=_0x84d3[_0xc3f901];return _0x112340;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x384d('0x0'));var rp=require(_0x384d('0x1'));var moment=require(_0x384d('0x2'));var BPromise=require(_0x384d('0x3'));var Mustache=require('mustache');var util=require(_0x384d('0x4'));var path=require('path');var sox=require(_0x384d('0x5'));var csv=require('to-csv');var ejs=require(_0x384d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x384d('0x7'));var squel=require(_0x384d('0x8'));var crypto=require('crypto');var jsforce=require(_0x384d('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x384d('0xa'));var querystring=require(_0x384d('0xb'));var Papa=require(_0x384d('0xc'));var Redis=require(_0x384d('0xd'));var authService=require(_0x384d('0xe'));var qs=require(_0x384d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x384d('0x10'));var logger=require(_0x384d('0x11'))(_0x384d('0x12'));var utils=require(_0x384d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x384d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35b7d4,_0x373c51){_0x373c51=_0x373c51||0xcc;return function(_0x349036){if(_0x349036){return _0x35b7d4[_0x384d('0x15')](_0x373c51);}return _0x35b7d4['status'](_0x373c51)[_0x384d('0x16')]();};}function respondWithResult(_0xc8cc7f,_0x21df9b){_0x21df9b=_0x21df9b||0xc8;return function(_0x1da8c5){if(_0x1da8c5){return _0xc8cc7f['status'](_0x21df9b)[_0x384d('0x17')](_0x1da8c5);}};}function respondWithFilteredResult(_0x1c2887,_0x25f900){return function(_0x3572ed){if(_0x3572ed){var _0x76f186=typeof _0x25f900[_0x384d('0x18')]===_0x384d('0x19')&&typeof _0x25f900[_0x384d('0x1a')]===_0x384d('0x19');var _0x2b417b=_0x3572ed[_0x384d('0x1b')];var _0x373d00=_0x76f186?0x0:_0x25f900[_0x384d('0x18')];var _0x148bff=_0x76f186?_0x3572ed['count']:_0x25f900[_0x384d('0x18')]+_0x25f900[_0x384d('0x1a')];var _0x5f0447;if(_0x148bff>=_0x2b417b){_0x148bff=_0x2b417b;_0x5f0447=0xc8;}else{_0x5f0447=0xce;}_0x1c2887[_0x384d('0x1c')](_0x5f0447);return _0x1c2887['set'](_0x384d('0x1d'),_0x373d00+'-'+_0x148bff+'/'+_0x2b417b)['json'](_0x3572ed);}return null;};}function patchUpdates(_0x479cd2){return function(_0x4d796a){try{jsonpatch[_0x384d('0x1e')](_0x4d796a,_0x479cd2,!![]);}catch(_0x5650b4){return BPromise['reject'](_0x5650b4);}return _0x4d796a[_0x384d('0x1f')]();};}function saveUpdates(_0x40b0fa,_0x45b929){return function(_0xf3b992){if(_0xf3b992){return _0xf3b992[_0x384d('0x20')](_0x40b0fa)['then'](function(_0x259367){return _0x259367;});}return null;};}function removeEntity(_0x41d87e,_0x5ef64c){return function(_0x40fff4){if(_0x40fff4){return _0x40fff4[_0x384d('0x21')]()[_0x384d('0x22')](function(){_0x41d87e[_0x384d('0x1c')](0xcc)[_0x384d('0x16')]();});}};}function handleEntityNotFound(_0x537931,_0xdad1dd){return function(_0x5eedc2){if(!_0x5eedc2){_0x537931[_0x384d('0x15')](0x194);}return _0x5eedc2;};}function handleError(_0x5cd7df,_0x228235){_0x228235=_0x228235||0x1f4;return function(_0x449b52){logger[_0x384d('0x23')](_0x449b52[_0x384d('0x24')]);if(_0x449b52[_0x384d('0x25')]){delete _0x449b52[_0x384d('0x25')];}_0x5cd7df['status'](_0x228235)[_0x384d('0x26')](_0x449b52);};}exports[_0x384d('0x27')]=function(_0x141b03,_0x411b03){var _0xa7bbb2={},_0x198131={},_0x3ef9b7={'count':0x0,'rows':[]};var _0x1a7d9c=_[_0x384d('0x28')](db[_0x384d('0x29')][_0x384d('0x2a')],function(_0x350b52){return{'name':_0x350b52[_0x384d('0x2b')],'type':_0x350b52[_0x384d('0x2c')]['key']};});_0x198131[_0x384d('0x2d')]=_[_0x384d('0x28')](_0x1a7d9c,'name');_0x198131[_0x384d('0x2e')]=_[_0x384d('0x2f')](_0x141b03[_0x384d('0x2e')]);_0x198131['filters']=_[_0x384d('0x30')](_0x198131[_0x384d('0x2d')],_0x198131['query']);_0xa7bbb2[_0x384d('0x31')]=_['intersection'](_0x198131[_0x384d('0x2d')],qs[_0x384d('0x32')](_0x141b03[_0x384d('0x2e')][_0x384d('0x32')]));_0xa7bbb2[_0x384d('0x31')]=_0xa7bbb2[_0x384d('0x31')][_0x384d('0x33')]?_0xa7bbb2[_0x384d('0x31')]:_0x198131[_0x384d('0x2d')];if(!_0x141b03[_0x384d('0x2e')]['hasOwnProperty']('nolimit')){_0xa7bbb2[_0x384d('0x1a')]=qs[_0x384d('0x1a')](_0x141b03[_0x384d('0x2e')][_0x384d('0x1a')]);_0xa7bbb2['offset']=qs['offset'](_0x141b03[_0x384d('0x2e')]['offset']);}_0xa7bbb2['order']=qs[_0x384d('0x34')](_0x141b03[_0x384d('0x2e')][_0x384d('0x34')]);_0xa7bbb2[_0x384d('0x35')]=qs['filters'](_['pick'](_0x141b03[_0x384d('0x2e')],_0x198131['filters']),_0x1a7d9c);if(_0x141b03[_0x384d('0x2e')][_0x384d('0x36')]){_0xa7bbb2[_0x384d('0x35')]=_[_0x384d('0x37')](_0xa7bbb2[_0x384d('0x35')],{'$or':_['map'](_0x1a7d9c,function(_0x506f75){if(_0x506f75['type']!==_0x384d('0x38')){var _0x32a9b3={};_0x32a9b3[_0x506f75['name']]={'$like':'%'+_0x141b03[_0x384d('0x2e')][_0x384d('0x36')]+'%'};return _0x32a9b3;}})});}_0xa7bbb2=_[_0x384d('0x37')]({},_0xa7bbb2,_0x141b03[_0x384d('0x39')]);var _0x35034e={'where':_0xa7bbb2[_0x384d('0x35')]};return db[_0x384d('0x29')]['count'](_0x35034e)[_0x384d('0x22')](function(_0xeb3013){_0x3ef9b7[_0x384d('0x1b')]=_0xeb3013;if(_0x141b03[_0x384d('0x2e')][_0x384d('0x3a')]){_0xa7bbb2[_0x384d('0x3b')]=[{'all':!![]}];}return db[_0x384d('0x29')][_0x384d('0x3c')](_0xa7bbb2);})[_0x384d('0x22')](function(_0x2d9eec){_0x3ef9b7[_0x384d('0x3d')]=_0x2d9eec;return _0x3ef9b7;})[_0x384d('0x22')](respondWithFilteredResult(_0x411b03,_0xa7bbb2))['catch'](handleError(_0x411b03,null));};exports[_0x384d('0x3e')]=function(_0x13fb51,_0x21ee49){var _0x388b1f={'raw':!![],'where':{'id':_0x13fb51[_0x384d('0x3f')]['id']}},_0x1e9900={};_0x1e9900['model']=_['keys'](db[_0x384d('0x29')][_0x384d('0x2a')]);_0x1e9900[_0x384d('0x2e')]=_[_0x384d('0x2f')](_0x13fb51[_0x384d('0x2e')]);_0x1e9900[_0x384d('0x40')]=_[_0x384d('0x30')](_0x1e9900['model'],_0x1e9900['query']);_0x388b1f[_0x384d('0x31')]=_['intersection'](_0x1e9900[_0x384d('0x2d')],qs[_0x384d('0x32')](_0x13fb51[_0x384d('0x2e')][_0x384d('0x32')]));_0x388b1f['attributes']=_0x388b1f[_0x384d('0x31')][_0x384d('0x33')]?_0x388b1f[_0x384d('0x31')]:_0x1e9900[_0x384d('0x2d')];if(_0x13fb51[_0x384d('0x2e')][_0x384d('0x3a')]){_0x388b1f[_0x384d('0x3b')]=[{'all':!![]}];}_0x388b1f=_[_0x384d('0x37')]({},_0x388b1f,_0x13fb51['options']);return db[_0x384d('0x29')][_0x384d('0x41')](_0x388b1f)[_0x384d('0x22')](handleEntityNotFound(_0x21ee49,null))[_0x384d('0x22')](respondWithResult(_0x21ee49,null))['catch'](handleError(_0x21ee49,null));};exports['create']=function(_0x328865,_0x386621){return db['SquareRecording'][_0x384d('0x42')](_0x328865[_0x384d('0x43')],{})[_0x384d('0x22')](respondWithResult(_0x386621,0xc9))['catch'](handleError(_0x386621,null));};exports['update']=function(_0x241e4f,_0x5edc90){if(_0x241e4f['body']['id']){delete _0x241e4f[_0x384d('0x43')]['id'];}return db[_0x384d('0x29')][_0x384d('0x41')]({'where':{'id':_0x241e4f[_0x384d('0x3f')]['id']}})[_0x384d('0x22')](handleEntityNotFound(_0x5edc90,null))[_0x384d('0x22')](saveUpdates(_0x241e4f['body'],null))[_0x384d('0x22')](respondWithResult(_0x5edc90,null))[_0x384d('0x44')](handleError(_0x5edc90,null));};exports[_0x384d('0x45')]=function(_0x2bc3be,_0x5ec8e6,_0x46c8e8){var _0x2f14f1=require('../../components/encryptor');var _0xb8cd51=![];var _0x409057={};if(_0x2bc3be[_0x384d('0x2e')][_0x384d('0x2c')]&&_0x2bc3be['query']['type']===_0x384d('0x46')){_0x409057[_0x384d('0x46')]=_0x2bc3be[_0x384d('0x3f')]['id'];}else{_0x409057['id']=_0x2bc3be[_0x384d('0x3f')]['id'];}return db['SquareRecording'][_0x384d('0x41')]({'where':_0x409057,'attributes':['id',_0x384d('0x47'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x5ec8e6,null))[_0x384d('0x22')](function(_0x1e32ca){if(_0x1e32ca){var _0x4a3c20=_0x1e32ca['savePath'];var _0x27f3c2=util[_0x384d('0x48')](_0x384d('0x49'),_0x4a3c20);if(fs[_0x384d('0x4a')](_0x27f3c2)){_0xb8cd51=!![];return _0x2f14f1[_0x384d('0x4b')](_0x27f3c2,_0x4a3c20,config[_0x384d('0x4c')][_0x384d('0x4d')])['then'](function(){return _0x1e32ca;});}return _0x1e32ca;}})['then'](function(_0x5e212a){if(_0x5e212a){var _0x17882f=_0x5e212a[_0x384d('0x47')];if(!fs['existsSync'](_0x17882f)){throw new db[(_0x384d('0x4e'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x5e212a[_0x384d('0x4f')]){return _0x5ec8e6['download'](_0x17882f,_0x5e212a[_0x384d('0x4f')]+path[_0x384d('0x50')](_0x17882f),function(){if(_0xb8cd51){fs[_0x384d('0x51')](_0x17882f);}});}else{return _0x5ec8e6[_0x384d('0x45')](_0x17882f,function(_0xc3ff9){if(_0xb8cd51){fs[_0x384d('0x51')](_0x17882f);}});}}})[_0x384d('0x44')](function(_0x2e474e){if(_0x2e474e[_0x384d('0x52')]===_0x384d('0x53')){_0x5ec8e6[_0x384d('0x1c')](0x194)[_0x384d('0x26')](_0x384d('0x54'));}else{return handleError(_0x5ec8e6,null);}});};exports[_0x384d('0x21')]=function(_0x8c22,_0x284bea){return db[_0x384d('0x29')][_0x384d('0x41')]({'where':{'id':_0x8c22['params']['id']}})[_0x384d('0x22')](function(_0x2d6ea6){if(_['isNil'](_0x2d6ea6)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2d6ea6;})[_0x384d('0x22')](function(_0x50aa2a){var _0x157960=_0x50aa2a[_0x384d('0x47')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x157960);if(!_[_0x384d('0x55')](_0x50aa2a[_0x384d('0x47')])&&fs[_0x384d('0x4a')](_0x157960)){logger[_0x384d('0x56')]('File:\x20\x22'+_0x157960+_0x384d('0x57'));fs[_0x384d('0x58')](_0x157960);}_0x157960=_0x157960+'.cypher';if(!_[_0x384d('0x55')](_0x50aa2a[_0x384d('0x47')])&&fs['existsSync'](_0x157960)){logger[_0x384d('0x56')](_0x384d('0x59')+_0x157960+_0x384d('0x57'));fs[_0x384d('0x58')](_0x157960);}return _0x50aa2a;})[_0x384d('0x22')](function(_0x5d318f){if(!_0x5d318f)throw new InternalError();return _0x5d318f[_0x384d('0x21')]();})[_0x384d('0x22')](function(){_0x284bea[_0x384d('0x1c')](0xcc)[_0x384d('0x16')]();})['catch'](handleError(_0x284bea,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index f1ad581..ebc1182 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 _0xa5aa=['bluebird','request-promise','path','rimraf','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','util','api','moment'];(function(_0x369ed2,_0x31d5c9){var _0x5caff4=function(_0x53aaee){while(--_0x53aaee){_0x369ed2['push'](_0x369ed2['shift']());}};_0x5caff4(++_0x31d5c9);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x31c0ad,_0x5e8c3a){_0x31c0ad=_0x31c0ad-0x0;var _0x2a1a0a=_0xa5aa[_0x31c0ad];return _0x2a1a0a;};'use strict';var _=require(_0xaa5a('0x0'));var util=require(_0xaa5a('0x1'));var logger=require('../../config/logger')(_0xaa5a('0x2'));var moment=require(_0xaa5a('0x3'));var BPromise=require(_0xaa5a('0x4'));var rp=require(_0xaa5a('0x5'));var fs=require('fs');var path=require(_0xaa5a('0x6'));var rimraf=require(_0xaa5a('0x7'));var config=require('../../config/environment');var attributes=require(_0xaa5a('0x8'));module[_0xaa5a('0x9')]=function(_0x46c8cc,_0x561d19){return _0x46c8cc['define'](_0xaa5a('0xa'),attributes,{'tableName':_0xaa5a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedf1=['SquareRecording','square_recordings','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./squareRecording.attributes','define'];(function(_0x59dde9,_0x1032d2){var _0x339832=function(_0x65e108){while(--_0x65e108){_0x59dde9['push'](_0x59dde9['shift']());}};_0x339832(++_0x1032d2);}(_0xedf1,0xb2));var _0x1edf=function(_0x4d96cd,_0x47e7c5){_0x4d96cd=_0x4d96cd-0x0;var _0x26e3ce=_0xedf1[_0x4d96cd];return _0x26e3ce;};'use strict';var _=require(_0x1edf('0x0'));var util=require(_0x1edf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1edf('0x2'));var BPromise=require(_0x1edf('0x3'));var rp=require(_0x1edf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1edf('0x5'));var config=require(_0x1edf('0x6'));var attributes=require(_0x1edf('0x7'));module['exports']=function(_0x52238d,_0x1b84af){return _0x52238d[_0x1edf('0x8')](_0x1edf('0x9'),attributes,{'tableName':_0x1edf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 9e5a6e1..7554449 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 _0xff25=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','SquareRecording','body','options','lodash','moment'];(function(_0x1cb4ca,_0xa0a655){var _0x198af5=function(_0x3f6ad7){while(--_0x3f6ad7){_0x1cb4ca['push'](_0x1cb4ca['shift']());}};_0x198af5(++_0xa0a655);}(_0xff25,0xb4));var _0x5ff2=function(_0x33d0ff,_0x399a87){_0x33d0ff=_0x33d0ff-0x0;var _0x39c84a=_0xff25[_0x33d0ff];return _0x39c84a;};'use strict';var _=require(_0x5ff2('0x0'));var util=require('util');var moment=require(_0x5ff2('0x1'));var BPromise=require('bluebird');var rs=require(_0x5ff2('0x2'));var fs=require('fs');var Redis=require(_0x5ff2('0x3'));var db=require(_0x5ff2('0x4'))['db'];var utils=require(_0x5ff2('0x5'));var logger=require(_0x5ff2('0x6'))(_0x5ff2('0x7'));var config=require('../../config/environment');var jayson=require(_0x5ff2('0x8'));var client=jayson[_0x5ff2('0x9')][_0x5ff2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b16b8,_0x569cff,_0x5cdb9f){return new BPromise(function(_0x1e53c8,_0x38b603){return client[_0x5ff2('0xb')](_0x5b16b8,_0x5cdb9f)[_0x5ff2('0xc')](function(_0x4be4ed){logger[_0x5ff2('0xd')](_0x5ff2('0xe'),_0x569cff,'request\x20sent');logger[_0x5ff2('0xf')](_0x5ff2('0x10'),_0x569cff,_0x5ff2('0x11'),JSON[_0x5ff2('0x12')](_0x4be4ed));if(_0x4be4ed[_0x5ff2('0x13')]){if(_0x4be4ed[_0x5ff2('0x13')]['code']===0x1f4){logger['error'](_0x5ff2('0xe'),_0x569cff,_0x4be4ed[_0x5ff2('0x13')][_0x5ff2('0x14')]);return _0x38b603(_0x4be4ed['error'][_0x5ff2('0x14')]);}logger[_0x5ff2('0x13')]('SquareRecording,\x20%s,\x20%s',_0x569cff,_0x4be4ed[_0x5ff2('0x13')][_0x5ff2('0x14')]);return _0x1e53c8(_0x4be4ed[_0x5ff2('0x13')][_0x5ff2('0x14')]);}else{logger[_0x5ff2('0xd')]('SquareRecording,\x20%s,\x20%s',_0x569cff,'request\x20sent');_0x1e53c8(_0x4be4ed[_0x5ff2('0x15')]['message']);}})[_0x5ff2('0x16')](function(_0x10327d){logger[_0x5ff2('0x13')](_0x5ff2('0xe'),_0x569cff,_0x10327d);_0x38b603(_0x10327d);});});}exports['CreateSquareRecording']=function(_0xbb2b6d){var _0x225671=this;return new Promise(function(_0x284a48,_0x49c373){return db[_0x5ff2('0x17')]['create'](_0xbb2b6d[_0x5ff2('0x18')],{'raw':_0xbb2b6d['options']?_0xbb2b6d[_0x5ff2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x5ff2('0xc')](function(_0x29cfc2){logger[_0x5ff2('0xd')]('CreateSquareRecording',_0xbb2b6d);logger[_0x5ff2('0xf')]('CreateSquareRecording',_0xbb2b6d,JSON[_0x5ff2('0x12')](_0x29cfc2));_0x284a48(_0x29cfc2);})[_0x5ff2('0x16')](function(_0x5e1ab7){logger[_0x5ff2('0x13')]('CreateSquareRecording',_0x5e1ab7[_0x5ff2('0x14')],_0xbb2b6d);_0x49c373(_0x225671[_0x5ff2('0x13')](0x1f4,_0x5e1ab7[_0x5ff2('0x14')]));});});}; \ No newline at end of file +var _0xa93d=['body','options','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareRecording','SquareRecording','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa93d,0x109));var _0xda93=function(_0x366d79,_0x4e55e1){_0x366d79=_0x366d79-0x0;var _0x5529ca=_0xa93d[_0x366d79];return _0x5529ca;};'use strict';var _=require(_0xda93('0x0'));var util=require(_0xda93('0x1'));var moment=require(_0xda93('0x2'));var BPromise=require(_0xda93('0x3'));var rs=require(_0xda93('0x4'));var fs=require('fs');var Redis=require(_0xda93('0x5'));var db=require(_0xda93('0x6'))['db'];var utils=require(_0xda93('0x7'));var logger=require(_0xda93('0x8'))('rpc');var config=require(_0xda93('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xda93('0xa')][_0xda93('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39b6af,_0x45f052,_0x452b29){return new BPromise(function(_0x55ac4c,_0x5a333c){return client[_0xda93('0xc')](_0x39b6af,_0x452b29)['then'](function(_0x307d24){logger[_0xda93('0xd')](_0xda93('0xe'),_0x45f052,_0xda93('0xf'));logger[_0xda93('0x10')](_0xda93('0x11'),_0x45f052,'request\x20sent',JSON['stringify'](_0x307d24));if(_0x307d24[_0xda93('0x12')]){if(_0x307d24[_0xda93('0x12')]['code']===0x1f4){logger[_0xda93('0x12')](_0xda93('0xe'),_0x45f052,_0x307d24[_0xda93('0x12')][_0xda93('0x13')]);return _0x5a333c(_0x307d24[_0xda93('0x12')][_0xda93('0x13')]);}logger['error'](_0xda93('0xe'),_0x45f052,_0x307d24[_0xda93('0x12')]['message']);return _0x55ac4c(_0x307d24[_0xda93('0x12')]['message']);}else{logger[_0xda93('0xd')]('SquareRecording,\x20%s,\x20%s',_0x45f052,_0xda93('0xf'));_0x55ac4c(_0x307d24[_0xda93('0x14')][_0xda93('0x13')]);}})[_0xda93('0x15')](function(_0x2f01ac){logger[_0xda93('0x12')](_0xda93('0xe'),_0x45f052,_0x2f01ac);_0x5a333c(_0x2f01ac);});});}exports[_0xda93('0x16')]=function(_0x454670){var _0x2deb23=this;return new Promise(function(_0x3e465f,_0x99dfc3){return db[_0xda93('0x17')][_0xda93('0x18')](_0x454670[_0xda93('0x19')],{'raw':_0x454670[_0xda93('0x1a')]?_0x454670[_0xda93('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xda93('0x1b')](function(_0x303ec8){logger[_0xda93('0xd')](_0xda93('0x16'),_0x454670);logger[_0xda93('0x10')](_0xda93('0x16'),_0x454670,JSON[_0xda93('0x1c')](_0x303ec8));_0x3e465f(_0x303ec8);})[_0xda93('0x15')](function(_0x582601){logger[_0xda93('0x12')](_0xda93('0x16'),_0x582601[_0xda93('0x13')],_0x454670);_0x99dfc3(_0x2deb23['error'](0x1f4,_0x582601[_0xda93('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 92458f9..287b4ee 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x287b43,_0x2ddfc6){var _0x2ec5af=function(_0x55e7ca){while(--_0x55e7ca){_0x287b43['push'](_0x287b43['shift']());}};_0x2ec5af(++_0x2ddfc6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _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(_0x303008,_0x1e07c2){var _0x2a93f8=function(_0x41bcca){while(--_0x41bcca){_0x303008['push'](_0x303008['shift']());}};_0x2a93f8(++_0x1e07c2);}(_0xe706,0xa3));var _0x6e70=function(_0x38954c,_0x357891){_0x38954c=_0x38954c-0x0;var _0x19fd62=_0xe706[_0x38954c];return _0x19fd62;};'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 diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index b2717f1..540b59d 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 _0x023d=['STRING','DATE','BOOLEAN','exports'];(function(_0x19c43d,_0x2ebc9a){var _0x25cdc9=function(_0x46ba6c){while(--_0x46ba6c){_0x19c43d['push'](_0x19c43d['shift']());}};_0x25cdc9(++_0x2ebc9a);}(_0x023d,0x67));var _0xd023=function(_0x5300aa,_0x308196){_0x5300aa=_0x5300aa-0x0;var _0x2dcef4=_0x023d[_0x5300aa];return _0x2dcef4;};'use strict';var Sequelize=require('sequelize');module[_0xd023('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xd023('0x1')]},'request':{'type':Sequelize[_0xd023('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd023('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xd023('0x1')]},'callerid':{'type':Sequelize[_0xd023('0x1')]},'calleridname':{'type':Sequelize[_0xd023('0x1')]},'callingpres':{'type':Sequelize[_0xd023('0x1')]},'callingani2':{'type':Sequelize[_0xd023('0x1')]},'callington':{'type':Sequelize[_0xd023('0x1')]},'callingtns':{'type':Sequelize[_0xd023('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd023('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd023('0x1')]},'enhanced':{'type':Sequelize[_0xd023('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xd023('0x1')]},'project_name':{'type':Sequelize[_0xd023('0x1')]},'joinAt':{'type':Sequelize[_0xd023('0x2')]},'leaveAt':{'type':Sequelize[_0xd023('0x2')]},'bot':{'type':Sequelize[_0xd023('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x667f=['STRING','DATE'];(function(_0x3bc4dd,_0xeb3de7){var _0x3168eb=function(_0x56b4a6){while(--_0x56b4a6){_0x3bc4dd['push'](_0x3bc4dd['shift']());}};_0x3168eb(++_0xeb3de7);}(_0x667f,0x1b0));var _0xf667=function(_0x59f9dc,_0x4862f6){_0x59f9dc=_0x59f9dc-0x0;var _0x24c754=_0x667f[_0x59f9dc];return _0x24c754;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0xf667('0x0')]},'network_script':{'type':Sequelize[_0xf667('0x0')]},'request':{'type':Sequelize[_0xf667('0x0')]},'channel':{'type':Sequelize[_0xf667('0x0')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf667('0x0')]},'uniqueid':{'type':Sequelize[_0xf667('0x0')]},'version':{'type':Sequelize[_0xf667('0x0')]},'callerid':{'type':Sequelize[_0xf667('0x0')]},'calleridname':{'type':Sequelize[_0xf667('0x0')]},'callingpres':{'type':Sequelize[_0xf667('0x0')]},'callingani2':{'type':Sequelize[_0xf667('0x0')]},'callington':{'type':Sequelize[_0xf667('0x0')]},'callingtns':{'type':Sequelize[_0xf667('0x0')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xf667('0x0')]},'context':{'type':Sequelize[_0xf667('0x0')]},'extension':{'type':Sequelize[_0xf667('0x0')]},'priority':{'type':Sequelize[_0xf667('0x0')]},'enhanced':{'type':Sequelize[_0xf667('0x0')]},'accountcode':{'type':Sequelize[_0xf667('0x0')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xf667('0x0')]},'joinAt':{'type':Sequelize[_0xf667('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 99469f6..2ba132a 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 _0xa650=['../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','name','options','include','findAll','rows','catch','params','intersection','includeAll','find','create','body','describe','eml-format','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x132f7f,_0x2ae1a2){var _0x24da0e=function(_0x56c6d6){while(--_0x56c6d6){_0x132f7f['push'](_0x132f7f['shift']());}};_0x24da0e(++_0x2ae1a2);}(_0xa650,0x19d));var _0x0a65=function(_0x16873a,_0x319eda){_0x16873a=_0x16873a-0x0;var _0xc4c0df=_0xa650[_0x16873a];return _0xc4c0df;};'use strict';var emlformat=require(_0x0a65('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a65('0x1'));var moment=require(_0x0a65('0x2'));var BPromise=require(_0x0a65('0x3'));var Mustache=require(_0x0a65('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0a65('0x5'));var csv=require(_0x0a65('0x6'));var ejs=require(_0x0a65('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a65('0x8'));var squel=require('squel');var crypto=require(_0x0a65('0x9'));var jsforce=require(_0x0a65('0xa'));var deskjs=require(_0x0a65('0xb'));var toCsv=require(_0x0a65('0x6'));var querystring=require(_0x0a65('0xc'));var Papa=require(_0x0a65('0xd'));var Redis=require(_0x0a65('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0a65('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a65('0x10'));var logger=require('../../config/logger')(_0x0a65('0x11'));var utils=require(_0x0a65('0x12'));var config=require(_0x0a65('0x13'));var licenseUtil=require(_0x0a65('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bf499,_0x27ad3b){_0x27ad3b=_0x27ad3b||0xcc;return function(_0x598810){if(_0x598810){return _0x5bf499['sendStatus'](_0x27ad3b);}return _0x5bf499['status'](_0x27ad3b)[_0x0a65('0x15')]();};}function respondWithResult(_0x4a0688,_0x3617cb){_0x3617cb=_0x3617cb||0xc8;return function(_0x1a4f13){if(_0x1a4f13){return _0x4a0688[_0x0a65('0x16')](_0x3617cb)[_0x0a65('0x17')](_0x1a4f13);}};}function respondWithFilteredResult(_0x549e44,_0x52b76a){return function(_0x491eb3){if(_0x491eb3){var _0x38fd12=typeof _0x52b76a[_0x0a65('0x18')]===_0x0a65('0x19')&&typeof _0x52b76a[_0x0a65('0x1a')]===_0x0a65('0x19');var _0xeb9c39=_0x491eb3[_0x0a65('0x1b')];var _0x3e73b1=_0x38fd12?0x0:_0x52b76a[_0x0a65('0x18')];var _0x286921=_0x38fd12?_0x491eb3['count']:_0x52b76a[_0x0a65('0x18')]+_0x52b76a[_0x0a65('0x1a')];var _0x49afd4;if(_0x286921>=_0xeb9c39){_0x286921=_0xeb9c39;_0x49afd4=0xc8;}else{_0x49afd4=0xce;}_0x549e44[_0x0a65('0x16')](_0x49afd4);return _0x549e44[_0x0a65('0x1c')]('Content-Range',_0x3e73b1+'-'+_0x286921+'/'+_0xeb9c39)[_0x0a65('0x17')](_0x491eb3);}return null;};}function patchUpdates(_0x290813){return function(_0x45a7bc){try{jsonpatch[_0x0a65('0x1d')](_0x45a7bc,_0x290813,!![]);}catch(_0x2a9823){return BPromise[_0x0a65('0x1e')](_0x2a9823);}return _0x45a7bc[_0x0a65('0x1f')]();};}function saveUpdates(_0x1a367a,_0x2a6ae9){return function(_0x459286){if(_0x459286){return _0x459286[_0x0a65('0x20')](_0x1a367a)[_0x0a65('0x21')](function(_0x4d5a25){return _0x4d5a25;});}return null;};}function removeEntity(_0x42419b,_0x3ab696){return function(_0x35a148){if(_0x35a148){return _0x35a148[_0x0a65('0x22')]()[_0x0a65('0x21')](function(){_0x42419b[_0x0a65('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40614c,_0x2896d8){return function(_0x513c38){if(!_0x513c38){_0x40614c[_0x0a65('0x23')](0x194);}return _0x513c38;};}function handleError(_0x23bd7e,_0x89c5bd){_0x89c5bd=_0x89c5bd||0x1f4;return function(_0x2333e6){logger[_0x0a65('0x24')](_0x2333e6[_0x0a65('0x25')]);if(_0x2333e6['name']){delete _0x2333e6['name'];}_0x23bd7e['status'](_0x89c5bd)[_0x0a65('0x26')](_0x2333e6);};}exports[_0x0a65('0x27')]=function(_0x2a1ac2,_0x52f390){var _0x113d3c={},_0x1957e1={},_0x32087d={'count':0x0,'rows':[]};var _0x42beb5=_[_0x0a65('0x28')](db[_0x0a65('0x29')][_0x0a65('0x2a')],function(_0x458139){return{'name':_0x458139[_0x0a65('0x2b')],'type':_0x458139[_0x0a65('0x2c')][_0x0a65('0x2d')]};});_0x1957e1[_0x0a65('0x2e')]=_['map'](_0x42beb5,'name');_0x1957e1[_0x0a65('0x2f')]=_[_0x0a65('0x30')](_0x2a1ac2['query']);_0x1957e1['filters']=_['intersection'](_0x1957e1[_0x0a65('0x2e')],_0x1957e1[_0x0a65('0x2f')]);_0x113d3c[_0x0a65('0x31')]=_['intersection'](_0x1957e1['model'],qs['fields'](_0x2a1ac2[_0x0a65('0x2f')][_0x0a65('0x32')]));_0x113d3c[_0x0a65('0x31')]=_0x113d3c[_0x0a65('0x31')][_0x0a65('0x33')]?_0x113d3c[_0x0a65('0x31')]:_0x1957e1[_0x0a65('0x2e')];if(!_0x2a1ac2[_0x0a65('0x2f')][_0x0a65('0x34')]('nolimit')){_0x113d3c['limit']=qs['limit'](_0x2a1ac2['query'][_0x0a65('0x1a')]);_0x113d3c[_0x0a65('0x18')]=qs[_0x0a65('0x18')](_0x2a1ac2['query'][_0x0a65('0x18')]);}_0x113d3c['order']=qs[_0x0a65('0x35')](_0x2a1ac2[_0x0a65('0x2f')]['sort']);_0x113d3c[_0x0a65('0x36')]=qs[_0x0a65('0x37')](_[_0x0a65('0x38')](_0x2a1ac2[_0x0a65('0x2f')],_0x1957e1[_0x0a65('0x37')]),_0x42beb5);if(_0x2a1ac2[_0x0a65('0x2f')][_0x0a65('0x39')]){_0x113d3c['where']=_[_0x0a65('0x3a')](_0x113d3c['where'],{'$or':_['map'](_0x42beb5,function(_0xe1177f){if(_0xe1177f['type']!=='VIRTUAL'){var _0x1b6f84={};_0x1b6f84[_0xe1177f[_0x0a65('0x3b')]]={'$like':'%'+_0x2a1ac2[_0x0a65('0x2f')][_0x0a65('0x39')]+'%'};return _0x1b6f84;}})});}_0x113d3c=_['merge']({},_0x113d3c,_0x2a1ac2[_0x0a65('0x3c')]);var _0x156bea={'where':_0x113d3c[_0x0a65('0x36')]};return db[_0x0a65('0x29')]['count'](_0x156bea)[_0x0a65('0x21')](function(_0x1af218){_0x32087d[_0x0a65('0x1b')]=_0x1af218;if(_0x2a1ac2[_0x0a65('0x2f')]['includeAll']){_0x113d3c[_0x0a65('0x3d')]=[{'all':!![]}];}return db[_0x0a65('0x29')][_0x0a65('0x3e')](_0x113d3c);})[_0x0a65('0x21')](function(_0x2be229){_0x32087d[_0x0a65('0x3f')]=_0x2be229;return _0x32087d;})[_0x0a65('0x21')](respondWithFilteredResult(_0x52f390,_0x113d3c))[_0x0a65('0x40')](handleError(_0x52f390,null));};exports['show']=function(_0x5eada2,_0x14ffc4){var _0x4e0b01={'raw':!![],'where':{'id':_0x5eada2[_0x0a65('0x41')]['id']}},_0x2c4b5a={};_0x2c4b5a[_0x0a65('0x2e')]=_[_0x0a65('0x30')](db['SquareReport'][_0x0a65('0x2a')]);_0x2c4b5a[_0x0a65('0x2f')]=_['keys'](_0x5eada2[_0x0a65('0x2f')]);_0x2c4b5a[_0x0a65('0x37')]=_[_0x0a65('0x42')](_0x2c4b5a['model'],_0x2c4b5a[_0x0a65('0x2f')]);_0x4e0b01[_0x0a65('0x31')]=_[_0x0a65('0x42')](_0x2c4b5a[_0x0a65('0x2e')],qs[_0x0a65('0x32')](_0x5eada2[_0x0a65('0x2f')][_0x0a65('0x32')]));_0x4e0b01['attributes']=_0x4e0b01['attributes'][_0x0a65('0x33')]?_0x4e0b01[_0x0a65('0x31')]:_0x2c4b5a[_0x0a65('0x2e')];if(_0x5eada2[_0x0a65('0x2f')][_0x0a65('0x43')]){_0x4e0b01[_0x0a65('0x3d')]=[{'all':!![]}];}_0x4e0b01=_[_0x0a65('0x3a')]({},_0x4e0b01,_0x5eada2[_0x0a65('0x3c')]);return db['SquareReport'][_0x0a65('0x44')](_0x4e0b01)['then'](handleEntityNotFound(_0x14ffc4,null))[_0x0a65('0x21')](respondWithResult(_0x14ffc4,null))[_0x0a65('0x40')](handleError(_0x14ffc4,null));};exports[_0x0a65('0x45')]=function(_0x21079a,_0x48d3fa){return db[_0x0a65('0x29')][_0x0a65('0x45')](_0x21079a[_0x0a65('0x46')],{})[_0x0a65('0x21')](respondWithResult(_0x48d3fa,0xc9))[_0x0a65('0x40')](handleError(_0x48d3fa,null));};exports[_0x0a65('0x20')]=function(_0x3e3397,_0xe47e09){if(_0x3e3397[_0x0a65('0x46')]['id']){delete _0x3e3397[_0x0a65('0x46')]['id'];}return db[_0x0a65('0x29')][_0x0a65('0x44')]({'where':{'id':_0x3e3397[_0x0a65('0x41')]['id']}})[_0x0a65('0x21')](handleEntityNotFound(_0xe47e09,null))[_0x0a65('0x21')](saveUpdates(_0x3e3397[_0x0a65('0x46')],null))[_0x0a65('0x21')](respondWithResult(_0xe47e09,null))['catch'](handleError(_0xe47e09,null));};exports[_0x0a65('0x22')]=function(_0x12a1bc,_0x4b0f00){return db[_0x0a65('0x29')][_0x0a65('0x44')]({'where':{'id':_0x12a1bc[_0x0a65('0x41')]['id']}})[_0x0a65('0x21')](handleEntityNotFound(_0x4b0f00,null))['then'](removeEntity(_0x4b0f00,null))[_0x0a65('0x40')](handleError(_0x4b0f00,null));};exports[_0x0a65('0x47')]=function(_0x25f21c,_0x3aed77){return db[_0x0a65('0x29')][_0x0a65('0x47')]()[_0x0a65('0x21')](respondWithResult(_0x3aed77,null))[_0x0a65('0x40')](handleError(_0x3aed77,null));}; \ No newline at end of file +var _0x8755=['bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','SquareReport','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','moment'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x8755,0xda));var _0x5875=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8755[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x5875('0x0'));var rimraf=require(_0x5875('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5875('0x2'));var rp=require('request-promise');var moment=require(_0x5875('0x3'));var BPromise=require(_0x5875('0x4'));var Mustache=require(_0x5875('0x5'));var util=require(_0x5875('0x6'));var path=require('path');var sox=require(_0x5875('0x7'));var csv=require('to-csv');var ejs=require(_0x5875('0x8'));var fs=require('fs');var fs_extra=require(_0x5875('0x9'));var _=require('lodash');var squel=require(_0x5875('0xa'));var crypto=require(_0x5875('0xb'));var jsforce=require(_0x5875('0xc'));var deskjs=require(_0x5875('0xd'));var toCsv=require(_0x5875('0xe'));var querystring=require('querystring');var Papa=require(_0x5875('0xf'));var Redis=require(_0x5875('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5875('0x11'));var as=require(_0x5875('0x12'));var hardwareService=require(_0x5875('0x13'));var logger=require('../../config/logger')(_0x5875('0x14'));var utils=require(_0x5875('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5875('0x16'));var db=require(_0x5875('0x17'))['db'];function respondWithStatusCode(_0x292f22,_0x51ef64){_0x51ef64=_0x51ef64||0xcc;return function(_0x224f37){if(_0x224f37){return _0x292f22['sendStatus'](_0x51ef64);}return _0x292f22['status'](_0x51ef64)[_0x5875('0x18')]();};}function respondWithResult(_0x56f6fb,_0x477e72){_0x477e72=_0x477e72||0xc8;return function(_0x465dcb){if(_0x465dcb){return _0x56f6fb[_0x5875('0x19')](_0x477e72)[_0x5875('0x1a')](_0x465dcb);}};}function respondWithFilteredResult(_0x10e8fd,_0x56f01d){return function(_0x5c4df6){if(_0x5c4df6){var _0x39dc65=typeof _0x56f01d[_0x5875('0x1b')]===_0x5875('0x1c')&&typeof _0x56f01d[_0x5875('0x1d')]==='undefined';var _0x1d05b2=_0x5c4df6[_0x5875('0x1e')];var _0x2712e7=_0x39dc65?0x0:_0x56f01d[_0x5875('0x1b')];var _0x94d684=_0x39dc65?_0x5c4df6['count']:_0x56f01d[_0x5875('0x1b')]+_0x56f01d[_0x5875('0x1d')];var _0x54562d;if(_0x94d684>=_0x1d05b2){_0x94d684=_0x1d05b2;_0x54562d=0xc8;}else{_0x54562d=0xce;}_0x10e8fd[_0x5875('0x19')](_0x54562d);return _0x10e8fd[_0x5875('0x1f')](_0x5875('0x20'),_0x2712e7+'-'+_0x94d684+'/'+_0x1d05b2)[_0x5875('0x1a')](_0x5c4df6);}return null;};}function patchUpdates(_0xd5442){return function(_0x3e06d2){try{jsonpatch[_0x5875('0x21')](_0x3e06d2,_0xd5442,!![]);}catch(_0x17f93f){return BPromise['reject'](_0x17f93f);}return _0x3e06d2[_0x5875('0x22')]();};}function saveUpdates(_0x1cdb0d,_0x1d863c){return function(_0x4f725a){if(_0x4f725a){return _0x4f725a[_0x5875('0x23')](_0x1cdb0d)[_0x5875('0x24')](function(_0x22c9aa){return _0x22c9aa;});}return null;};}function removeEntity(_0x4bf097,_0x47ac09){return function(_0x35fd1c){if(_0x35fd1c){return _0x35fd1c[_0x5875('0x25')]()[_0x5875('0x24')](function(){_0x4bf097[_0x5875('0x19')](0xcc)[_0x5875('0x18')]();});}};}function handleEntityNotFound(_0x4f7232,_0x3c5f28){return function(_0x419dfa){if(!_0x419dfa){_0x4f7232[_0x5875('0x26')](0x194);}return _0x419dfa;};}function handleError(_0x5b9538,_0x3e9b10){_0x3e9b10=_0x3e9b10||0x1f4;return function(_0x4a4c60){logger[_0x5875('0x27')](_0x4a4c60[_0x5875('0x28')]);if(_0x4a4c60[_0x5875('0x29')]){delete _0x4a4c60[_0x5875('0x29')];}_0x5b9538[_0x5875('0x19')](_0x3e9b10)[_0x5875('0x2a')](_0x4a4c60);};}exports['index']=function(_0x2ad86f,_0x572429){var _0x1b0f6a={},_0x304a64={},_0x573753={'count':0x0,'rows':[]};var _0xc0f2fa=_[_0x5875('0x2b')](db[_0x5875('0x2c')]['rawAttributes'],function(_0x24c264){return{'name':_0x24c264[_0x5875('0x2d')],'type':_0x24c264['type'][_0x5875('0x2e')]};});_0x304a64[_0x5875('0x2f')]=_['map'](_0xc0f2fa,_0x5875('0x29'));_0x304a64['query']=_[_0x5875('0x30')](_0x2ad86f['query']);_0x304a64[_0x5875('0x31')]=_[_0x5875('0x32')](_0x304a64[_0x5875('0x2f')],_0x304a64[_0x5875('0x33')]);_0x1b0f6a['attributes']=_[_0x5875('0x32')](_0x304a64[_0x5875('0x2f')],qs[_0x5875('0x34')](_0x2ad86f[_0x5875('0x33')][_0x5875('0x34')]));_0x1b0f6a[_0x5875('0x35')]=_0x1b0f6a[_0x5875('0x35')][_0x5875('0x36')]?_0x1b0f6a[_0x5875('0x35')]:_0x304a64[_0x5875('0x2f')];if(!_0x2ad86f[_0x5875('0x33')][_0x5875('0x37')](_0x5875('0x38'))){_0x1b0f6a['limit']=qs[_0x5875('0x1d')](_0x2ad86f[_0x5875('0x33')]['limit']);_0x1b0f6a[_0x5875('0x1b')]=qs[_0x5875('0x1b')](_0x2ad86f['query']['offset']);}_0x1b0f6a[_0x5875('0x39')]=qs[_0x5875('0x3a')](_0x2ad86f['query'][_0x5875('0x3a')]);_0x1b0f6a[_0x5875('0x3b')]=qs[_0x5875('0x31')](_[_0x5875('0x3c')](_0x2ad86f[_0x5875('0x33')],_0x304a64['filters']),_0xc0f2fa);if(_0x2ad86f['query']['filter']){_0x1b0f6a[_0x5875('0x3b')]=_[_0x5875('0x3d')](_0x1b0f6a[_0x5875('0x3b')],{'$or':_[_0x5875('0x2b')](_0xc0f2fa,function(_0x10eec4){if(_0x10eec4[_0x5875('0x3e')]!=='VIRTUAL'){var _0x13895d={};_0x13895d[_0x10eec4[_0x5875('0x29')]]={'$like':'%'+_0x2ad86f[_0x5875('0x33')][_0x5875('0x3f')]+'%'};return _0x13895d;}})});}_0x1b0f6a=_['merge']({},_0x1b0f6a,_0x2ad86f[_0x5875('0x40')]);var _0x1ec536={'where':_0x1b0f6a['where']};return db[_0x5875('0x2c')][_0x5875('0x1e')](_0x1ec536)[_0x5875('0x24')](function(_0x3b91ef){_0x573753[_0x5875('0x1e')]=_0x3b91ef;if(_0x2ad86f['query'][_0x5875('0x41')]){_0x1b0f6a[_0x5875('0x42')]=[{'all':!![]}];}return db[_0x5875('0x2c')][_0x5875('0x43')](_0x1b0f6a);})[_0x5875('0x24')](function(_0xe0d88c){_0x573753['rows']=_0xe0d88c;return _0x573753;})[_0x5875('0x24')](respondWithFilteredResult(_0x572429,_0x1b0f6a))[_0x5875('0x44')](handleError(_0x572429,null));};exports[_0x5875('0x45')]=function(_0x3faa1e,_0x2ef159){var _0x16174f={'raw':!![],'where':{'id':_0x3faa1e[_0x5875('0x46')]['id']}},_0x1695af={};_0x1695af['model']=_['keys'](db[_0x5875('0x2c')]['rawAttributes']);_0x1695af[_0x5875('0x33')]=_[_0x5875('0x30')](_0x3faa1e[_0x5875('0x33')]);_0x1695af['filters']=_[_0x5875('0x32')](_0x1695af[_0x5875('0x2f')],_0x1695af[_0x5875('0x33')]);_0x16174f[_0x5875('0x35')]=_[_0x5875('0x32')](_0x1695af[_0x5875('0x2f')],qs['fields'](_0x3faa1e[_0x5875('0x33')]['fields']));_0x16174f[_0x5875('0x35')]=_0x16174f[_0x5875('0x35')][_0x5875('0x36')]?_0x16174f[_0x5875('0x35')]:_0x1695af[_0x5875('0x2f')];if(_0x3faa1e['query'][_0x5875('0x41')]){_0x16174f['include']=[{'all':!![]}];}_0x16174f=_[_0x5875('0x3d')]({},_0x16174f,_0x3faa1e[_0x5875('0x40')]);return db[_0x5875('0x2c')][_0x5875('0x47')](_0x16174f)[_0x5875('0x24')](handleEntityNotFound(_0x2ef159,null))[_0x5875('0x24')](respondWithResult(_0x2ef159,null))[_0x5875('0x44')](handleError(_0x2ef159,null));};exports[_0x5875('0x48')]=function(_0x313b26,_0x3c9c06){return db[_0x5875('0x2c')][_0x5875('0x48')](_0x313b26[_0x5875('0x49')],{})[_0x5875('0x24')](respondWithResult(_0x3c9c06,0xc9))[_0x5875('0x44')](handleError(_0x3c9c06,null));};exports[_0x5875('0x23')]=function(_0x5cb9aa,_0x2d9f48){if(_0x5cb9aa[_0x5875('0x49')]['id']){delete _0x5cb9aa[_0x5875('0x49')]['id'];}return db[_0x5875('0x2c')][_0x5875('0x47')]({'where':{'id':_0x5cb9aa[_0x5875('0x46')]['id']}})['then'](handleEntityNotFound(_0x2d9f48,null))[_0x5875('0x24')](saveUpdates(_0x5cb9aa[_0x5875('0x49')],null))[_0x5875('0x24')](respondWithResult(_0x2d9f48,null))[_0x5875('0x44')](handleError(_0x2d9f48,null));};exports[_0x5875('0x25')]=function(_0x4f11df,_0x28b5b9){return db[_0x5875('0x2c')][_0x5875('0x47')]({'where':{'id':_0x4f11df[_0x5875('0x46')]['id']}})['then'](handleEntityNotFound(_0x28b5b9,null))[_0x5875('0x24')](removeEntity(_0x28b5b9,null))[_0x5875('0x44')](handleError(_0x28b5b9,null));};exports['describe']=function(_0x3fd230,_0xad5fb2){return db['SquareReport']['describe']()[_0x5875('0x24')](respondWithResult(_0xad5fb2,null))['catch'](handleError(_0xad5fb2,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 3588a8f..a486255 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 _0x43d1=['path','rimraf','../../config/environment','exports','uid_pname','uniqueid','leaveAt','lodash','../../config/logger','bluebird','request-promise'];(function(_0x3f3a39,_0x379cc5){var _0x5cea55=function(_0x22fd29){while(--_0x22fd29){_0x3f3a39['push'](_0x3f3a39['shift']());}};_0x5cea55(++_0x379cc5);}(_0x43d1,0x1a9));var _0x143d=function(_0x31e779,_0x2576a3){_0x31e779=_0x31e779-0x0;var _0x240b6d=_0x43d1[_0x31e779];return _0x240b6d;};'use strict';var _=require(_0x143d('0x0'));var util=require('util');var logger=require(_0x143d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x143d('0x2'));var rp=require(_0x143d('0x3'));var fs=require('fs');var path=require(_0x143d('0x4'));var rimraf=require(_0x143d('0x5'));var config=require(_0x143d('0x6'));var attributes=require('./squareReport.attributes');module[_0x143d('0x7')]=function(_0x462f13,_0x12cca5){return _0x462f13['define']('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x143d('0x8'),'fields':[_0x143d('0x9'),'project_name']},{'name':_0x143d('0xa'),'fields':[_0x143d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c9a=['bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square','uid_pname','leaveAt','lodash','util','../../config/logger','api'];(function(_0x563403,_0x49dd9a){var _0x5a86a4=function(_0x52e790){while(--_0x52e790){_0x563403['push'](_0x563403['shift']());}};_0x5a86a4(++_0x49dd9a);}(_0x6c9a,0xa1));var _0xa6c9=function(_0x3ec079,_0x518c91){_0x3ec079=_0x3ec079-0x0;var _0x3e509b=_0x6c9a[_0x3ec079];return _0x3e509b;};'use strict';var _=require(_0xa6c9('0x0'));var util=require(_0xa6c9('0x1'));var logger=require(_0xa6c9('0x2'))(_0xa6c9('0x3'));var moment=require('moment');var BPromise=require(_0xa6c9('0x4'));var rp=require(_0xa6c9('0x5'));var fs=require('fs');var path=require(_0xa6c9('0x6'));var rimraf=require(_0xa6c9('0x7'));var config=require(_0xa6c9('0x8'));var attributes=require(_0xa6c9('0x9'));module[_0xa6c9('0xa')]=function(_0x39bdb8,_0x4c2437){return _0x39bdb8['define'](_0xa6c9('0xb'),attributes,{'tableName':_0xa6c9('0xc'),'paranoid':![],'indexes':[{'name':_0xa6c9('0xd'),'fields':['uniqueid','project_name']},{'name':_0xa6c9('0xe'),'fields':[_0xa6c9('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index ad4b97f..48327de 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 _0x2f84=['request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','stringify','UpdateSquareReport','update','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s'];(function(_0x1f921f,_0x54639b){var _0x5180af=function(_0x8a69d4){while(--_0x8a69d4){_0x1f921f['push'](_0x1f921f['shift']());}};_0x5180af(++_0x54639b);}(_0x2f84,0x13d));var _0x42f8=function(_0x426a6e,_0x5a674b){_0x426a6e=_0x426a6e-0x0;var _0x13c543=_0x2f84[_0x426a6e];return _0x13c543;};'use strict';var _=require(_0x42f8('0x0'));var util=require('util');var moment=require(_0x42f8('0x1'));var BPromise=require(_0x42f8('0x2'));var rs=require(_0x42f8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x42f8('0x4'));var logger=require(_0x42f8('0x5'))(_0x42f8('0x6'));var config=require('../../config/environment');var jayson=require(_0x42f8('0x7'));var client=jayson[_0x42f8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a6055,_0x41478f,_0x3cd04d){return new BPromise(function(_0x19e590,_0x2f9ee2){return client[_0x42f8('0x9')](_0x5a6055,_0x3cd04d)[_0x42f8('0xa')](function(_0x2eb314){logger[_0x42f8('0xb')](_0x42f8('0xc'),_0x41478f,_0x42f8('0xd'));logger[_0x42f8('0xe')](_0x42f8('0xf'),_0x41478f,_0x42f8('0xd'),JSON['stringify'](_0x2eb314));if(_0x2eb314[_0x42f8('0x10')]){if(_0x2eb314['error']['code']===0x1f4){logger[_0x42f8('0x10')](_0x42f8('0xc'),_0x41478f,_0x2eb314[_0x42f8('0x10')]['message']);return _0x2f9ee2(_0x2eb314[_0x42f8('0x10')][_0x42f8('0x11')]);}logger[_0x42f8('0x10')]('SquareReport,\x20%s,\x20%s',_0x41478f,_0x2eb314['error'][_0x42f8('0x11')]);return _0x19e590(_0x2eb314['error'][_0x42f8('0x11')]);}else{logger[_0x42f8('0xb')]('SquareReport,\x20%s,\x20%s',_0x41478f,_0x42f8('0xd'));_0x19e590(_0x2eb314[_0x42f8('0x12')][_0x42f8('0x11')]);}})[_0x42f8('0x13')](function(_0x57292d){logger[_0x42f8('0x10')](_0x42f8('0xc'),_0x41478f,_0x57292d);_0x2f9ee2(_0x57292d);});});}exports[_0x42f8('0x14')]=function(_0x3133e8){var _0x329274=this;return new Promise(function(_0x36414e,_0x147172){return db[_0x42f8('0x15')][_0x42f8('0x16')](_0x3133e8[_0x42f8('0x17')],{'raw':_0x3133e8[_0x42f8('0x18')]?_0x3133e8[_0x42f8('0x18')][_0x42f8('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x20007a){logger[_0x42f8('0xb')](_0x42f8('0x14'),_0x3133e8);logger[_0x42f8('0xe')](_0x42f8('0x14'),_0x3133e8,JSON[_0x42f8('0x1a')](_0x20007a));_0x36414e(_0x20007a);})['catch'](function(_0x3c5c73){logger[_0x42f8('0x10')](_0x42f8('0x14'),_0x3c5c73[_0x42f8('0x11')],_0x3133e8);_0x147172(_0x329274[_0x42f8('0x10')](0x1f4,_0x3c5c73[_0x42f8('0x11')]));});});};exports[_0x42f8('0x1b')]=function(_0x34be71){var _0x2a07f0=this;return new Promise(function(_0x1e8273,_0x49fd67){return db[_0x42f8('0x15')][_0x42f8('0x1c')](_0x34be71[_0x42f8('0x17')],{'raw':_0x34be71[_0x42f8('0x18')]?_0x34be71[_0x42f8('0x18')][_0x42f8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34be71[_0x42f8('0x18')]?_0x34be71[_0x42f8('0x18')]['where']||null:null,'attributes':_0x34be71['options']?_0x34be71[_0x42f8('0x18')]['attributes']||null:null,'limit':_0x34be71['options']?_0x34be71['options'][_0x42f8('0x1d')]||null:null})[_0x42f8('0xa')](function(_0x380d41){logger[_0x42f8('0xb')]('UpdateSquareReport',_0x34be71);logger[_0x42f8('0xe')](_0x42f8('0x1b'),_0x34be71,JSON[_0x42f8('0x1a')](_0x380d41));_0x1e8273(_0x380d41);})['catch'](function(_0x79bc1){logger[_0x42f8('0x10')]('UpdateSquareReport',_0x79bc1[_0x42f8('0x11')],_0x34be71);_0x49fd67(_0x2a07f0[_0x42f8('0x10')](0x1f4,_0x79bc1[_0x42f8('0x11')]));});});}; \ No newline at end of file +var _0x593b=['create','body','options','raw','debug','stringify','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','SquareReport'];(function(_0x502e26,_0x24b4b6){var _0x43b768=function(_0xb6079d){while(--_0xb6079d){_0x502e26['push'](_0x502e26['shift']());}};_0x43b768(++_0x24b4b6);}(_0x593b,0xba));var _0xb593=function(_0x4632d3,_0x35f57a){_0x4632d3=_0x4632d3-0x0;var _0x1bd627=_0x593b[_0x4632d3];return _0x1bd627;};'use strict';var _=require(_0xb593('0x0'));var util=require(_0xb593('0x1'));var moment=require(_0xb593('0x2'));var BPromise=require(_0xb593('0x3'));var rs=require(_0xb593('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb593('0x5'))['db'];var utils=require(_0xb593('0x6'));var logger=require(_0xb593('0x7'))('rpc');var config=require(_0xb593('0x8'));var jayson=require(_0xb593('0x9'));var client=jayson['client'][_0xb593('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x831ba8,_0x4881d2,_0x1e17af){return new BPromise(function(_0x415eef,_0x1d31ef){return client[_0xb593('0xb')](_0x831ba8,_0x1e17af)[_0xb593('0xc')](function(_0x249a05){logger[_0xb593('0xd')]('SquareReport,\x20%s,\x20%s',_0x4881d2,_0xb593('0xe'));logger['debug'](_0xb593('0xf'),_0x4881d2,_0xb593('0xe'),JSON['stringify'](_0x249a05));if(_0x249a05[_0xb593('0x10')]){if(_0x249a05['error'][_0xb593('0x11')]===0x1f4){logger[_0xb593('0x10')](_0xb593('0x12'),_0x4881d2,_0x249a05[_0xb593('0x10')][_0xb593('0x13')]);return _0x1d31ef(_0x249a05[_0xb593('0x10')]['message']);}logger[_0xb593('0x10')](_0xb593('0x12'),_0x4881d2,_0x249a05[_0xb593('0x10')]['message']);return _0x415eef(_0x249a05[_0xb593('0x10')]['message']);}else{logger[_0xb593('0xd')]('SquareReport,\x20%s,\x20%s',_0x4881d2,_0xb593('0xe'));_0x415eef(_0x249a05[_0xb593('0x14')][_0xb593('0x13')]);}})[_0xb593('0x15')](function(_0x4b31dd){logger[_0xb593('0x10')](_0xb593('0x12'),_0x4881d2,_0x4b31dd);_0x1d31ef(_0x4b31dd);});});}exports[_0xb593('0x16')]=function(_0x1c0389){var _0xd65840=this;return new Promise(function(_0x5abbf3,_0x3914b6){return db[_0xb593('0x17')][_0xb593('0x18')](_0x1c0389[_0xb593('0x19')],{'raw':_0x1c0389[_0xb593('0x1a')]?_0x1c0389[_0xb593('0x1a')][_0xb593('0x1b')]===undefined?!![]:![]:!![]})[_0xb593('0xc')](function(_0x3aede5){logger[_0xb593('0xd')]('CreateSquareReport',_0x1c0389);logger[_0xb593('0x1c')](_0xb593('0x16'),_0x1c0389,JSON[_0xb593('0x1d')](_0x3aede5));_0x5abbf3(_0x3aede5);})[_0xb593('0x15')](function(_0x273390){logger['error']('CreateSquareReport',_0x273390[_0xb593('0x13')],_0x1c0389);_0x3914b6(_0xd65840[_0xb593('0x10')](0x1f4,_0x273390[_0xb593('0x13')]));});});};exports[_0xb593('0x1e')]=function(_0x13cb1f){var _0x23499c=this;return new Promise(function(_0x264b45,_0x4de22b){return db[_0xb593('0x17')][_0xb593('0x1f')](_0x13cb1f[_0xb593('0x19')],{'raw':_0x13cb1f['options']?_0x13cb1f[_0xb593('0x1a')][_0xb593('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13cb1f[_0xb593('0x1a')]?_0x13cb1f[_0xb593('0x1a')][_0xb593('0x20')]||null:null,'attributes':_0x13cb1f[_0xb593('0x1a')]?_0x13cb1f[_0xb593('0x1a')][_0xb593('0x21')]||null:null,'limit':_0x13cb1f['options']?_0x13cb1f[_0xb593('0x1a')][_0xb593('0x22')]||null:null})[_0xb593('0xc')](function(_0x1157e2){logger[_0xb593('0xd')](_0xb593('0x1e'),_0x13cb1f);logger[_0xb593('0x1c')](_0xb593('0x1e'),_0x13cb1f,JSON[_0xb593('0x1d')](_0x1157e2));_0x264b45(_0x1157e2);})[_0xb593('0x15')](function(_0x105818){logger['error']('UpdateSquareReport',_0x105818[_0xb593('0x13')],_0x13cb1f);_0x4de22b(_0x23499c[_0xb593('0x10')](0x1f4,_0x105818[_0xb593('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 7a2593a..d6ddfb1 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 _0x14f0=['./squareReportDetail.controller','get','index','/describe','isAuthenticated','show','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xafa225,_0xd29c03){var _0x4f546a=function(_0x565b3f){while(--_0x565b3f){_0xafa225['push'](_0xafa225['shift']());}};_0x4f546a(++_0xd29c03);}(_0x14f0,0x19a));var _0x014f=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x14f0[_0x5c9307];return _0x373e29;};'use strict';var multer=require(_0x014f('0x0'));var util=require(_0x014f('0x1'));var path=require(_0x014f('0x2'));var timeout=require(_0x014f('0x3'));var express=require(_0x014f('0x4'));var router=express['Router']();var fs_extra=require(_0x014f('0x5'));var auth=require(_0x014f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x014f('0x7'));var controller=require(_0x014f('0x8'));router[_0x014f('0x9')]('/',auth['isAuthenticated'](),controller[_0x014f('0xa')]);router[_0x014f('0x9')](_0x014f('0xb'),auth[_0x014f('0xc')](),controller['describe']);router[_0x014f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x014f('0xd')]);router['post']('/',auth[_0x014f('0xc')](),controller['create']);router[_0x014f('0xe')](_0x014f('0xf'),auth['isAuthenticated'](),controller[_0x014f('0x10')]);router['delete'](_0x014f('0xf'),auth['isAuthenticated'](),controller[_0x014f('0x11')]);module[_0x014f('0x12')]=router; \ No newline at end of file +var _0x2d7a=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','/describe','describe','get','/:id','create','put','update','delete','destroy','exports'];(function(_0x131602,_0x36c825){var _0x3521b2=function(_0x375f47){while(--_0x375f47){_0x131602['push'](_0x131602['shift']());}};_0x3521b2(++_0x36c825);}(_0x2d7a,0xd2));var _0xa2d7=function(_0x25b6a6,_0x2dd1ce){_0x25b6a6=_0x25b6a6-0x0;var _0x3e0d14=_0x2d7a[_0x25b6a6];return _0x3e0d14;};'use strict';var multer=require(_0xa2d7('0x0'));var util=require(_0xa2d7('0x1'));var path=require(_0xa2d7('0x2'));var timeout=require(_0xa2d7('0x3'));var express=require(_0xa2d7('0x4'));var router=express[_0xa2d7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa2d7('0x6'));var config=require(_0xa2d7('0x7'));var controller=require(_0xa2d7('0x8'));router['get']('/',auth[_0xa2d7('0x9')](),controller[_0xa2d7('0xa')]);router['get'](_0xa2d7('0xb'),auth[_0xa2d7('0x9')](),controller[_0xa2d7('0xc')]);router[_0xa2d7('0xd')](_0xa2d7('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xa2d7('0x9')](),controller[_0xa2d7('0xf')]);router[_0xa2d7('0x10')](_0xa2d7('0xe'),auth[_0xa2d7('0x9')](),controller[_0xa2d7('0x11')]);router[_0xa2d7('0x12')]('/:id',auth[_0xa2d7('0x9')](),controller[_0xa2d7('0x13')]);module[_0xa2d7('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index ad043d2..30caa91 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 _0x2970=['STRING','TEXT','sequelize','exports'];(function(_0x23e02e,_0x4d26cb){var _0x2a6db8=function(_0x46e7af){while(--_0x46e7af){_0x23e02e['push'](_0x23e02e['shift']());}};_0x2a6db8(++_0x4d26cb);}(_0x2970,0xd6));var _0x0297=function(_0xe4ee1e,_0xea8b9b){_0xe4ee1e=_0xe4ee1e-0x0;var _0x22f903=_0x2970[_0xe4ee1e];return _0x22f903;};'use strict';var Sequelize=require(_0x0297('0x0'));module[_0x0297('0x1')]={'uniqueid':{'type':Sequelize[_0x0297('0x2')]},'node':{'type':Sequelize[_0x0297('0x2')]},'application':{'type':Sequelize[_0x0297('0x2')]},'data':{'type':Sequelize[_0x0297('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0297('0x2')]}}; \ No newline at end of file +var _0xea1c=['TEXT','sequelize','exports','STRING'];(function(_0x19d514,_0x17e234){var _0x2c1bc9=function(_0x38b4f3){while(--_0x38b4f3){_0x19d514['push'](_0x19d514['shift']());}};_0x2c1bc9(++_0x17e234);}(_0xea1c,0xb1));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcea1('0x0'));module[_0xcea1('0x1')]={'uniqueid':{'type':Sequelize[_0xcea1('0x2')]},'node':{'type':Sequelize[_0xcea1('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xcea1('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xcea1('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 9033b91..d5c630a 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 _0x9cc8=['../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','save','update','destroy','then','error','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2a12b9,_0x8bf906){var _0x1bf6e8=function(_0x65cfb){while(--_0x65cfb){_0x2a12b9['push'](_0x2a12b9['shift']());}};_0x1bf6e8(++_0x8bf906);}(_0x9cc8,0x163));var _0x89cc=function(_0x479431,_0x5207e0){_0x479431=_0x479431-0x0;var _0x4fe7b2=_0x9cc8[_0x479431];return _0x4fe7b2;};'use strict';var emlformat=require(_0x89cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x89cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x89cc('0x2'));var moment=require(_0x89cc('0x3'));var BPromise=require(_0x89cc('0x4'));var Mustache=require(_0x89cc('0x5'));var util=require(_0x89cc('0x6'));var path=require('path');var sox=require(_0x89cc('0x7'));var csv=require(_0x89cc('0x8'));var ejs=require(_0x89cc('0x9'));var fs=require('fs');var fs_extra=require(_0x89cc('0xa'));var _=require(_0x89cc('0xb'));var squel=require(_0x89cc('0xc'));var crypto=require(_0x89cc('0xd'));var jsforce=require(_0x89cc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x89cc('0x8'));var querystring=require(_0x89cc('0xf'));var Papa=require(_0x89cc('0x10'));var Redis=require(_0x89cc('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x89cc('0x12'));var hardwareService=require(_0x89cc('0x13'));var logger=require(_0x89cc('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x89cc('0x15'));var db=require(_0x89cc('0x16'))['db'];function respondWithStatusCode(_0x35b345,_0x323b46){_0x323b46=_0x323b46||0xcc;return function(_0x15bbaf){if(_0x15bbaf){return _0x35b345[_0x89cc('0x17')](_0x323b46);}return _0x35b345['status'](_0x323b46)[_0x89cc('0x18')]();};}function respondWithResult(_0x55dad7,_0x30314e){_0x30314e=_0x30314e||0xc8;return function(_0x2d0fd4){if(_0x2d0fd4){return _0x55dad7['status'](_0x30314e)[_0x89cc('0x19')](_0x2d0fd4);}};}function respondWithFilteredResult(_0x6e3b4,_0x15471b){return function(_0x29e9db){if(_0x29e9db){var _0x312ac5=typeof _0x15471b[_0x89cc('0x1a')]==='undefined'&&typeof _0x15471b['limit']===_0x89cc('0x1b');var _0x57dbc1=_0x29e9db[_0x89cc('0x1c')];var _0x399c48=_0x312ac5?0x0:_0x15471b[_0x89cc('0x1a')];var _0x15484f=_0x312ac5?_0x29e9db[_0x89cc('0x1c')]:_0x15471b['offset']+_0x15471b[_0x89cc('0x1d')];var _0x4c6bef;if(_0x15484f>=_0x57dbc1){_0x15484f=_0x57dbc1;_0x4c6bef=0xc8;}else{_0x4c6bef=0xce;}_0x6e3b4[_0x89cc('0x1e')](_0x4c6bef);return _0x6e3b4[_0x89cc('0x1f')]('Content-Range',_0x399c48+'-'+_0x15484f+'/'+_0x57dbc1)['json'](_0x29e9db);}return null;};}function patchUpdates(_0x2d0b32){return function(_0x159d20){try{jsonpatch[_0x89cc('0x20')](_0x159d20,_0x2d0b32,!![]);}catch(_0x692671){return BPromise[_0x89cc('0x21')](_0x692671);}return _0x159d20[_0x89cc('0x22')]();};}function saveUpdates(_0x1c8992,_0x2b1884){return function(_0x4fc929){if(_0x4fc929){return _0x4fc929[_0x89cc('0x23')](_0x1c8992)['then'](function(_0x53636d){return _0x53636d;});}return null;};}function removeEntity(_0x29cae2,_0x4411f9){return function(_0x3cae67){if(_0x3cae67){return _0x3cae67[_0x89cc('0x24')]()[_0x89cc('0x25')](function(){_0x29cae2[_0x89cc('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x270242,_0x4f1d9b){return function(_0x2a950d){if(!_0x2a950d){_0x270242[_0x89cc('0x17')](0x194);}return _0x2a950d;};}function handleError(_0x4ee3c8,_0x38b946){_0x38b946=_0x38b946||0x1f4;return function(_0x3a4c14){logger[_0x89cc('0x26')](_0x3a4c14[_0x89cc('0x27')]);if(_0x3a4c14[_0x89cc('0x28')]){delete _0x3a4c14[_0x89cc('0x28')];}_0x4ee3c8['status'](_0x38b946)[_0x89cc('0x29')](_0x3a4c14);};}exports['index']=function(_0x5a385e,_0x3f2b7c){var _0x1e6d0e={},_0x22c94b={},_0x22e2f4={'count':0x0,'rows':[]};var _0x2dd163=_[_0x89cc('0x2a')](db[_0x89cc('0x2b')][_0x89cc('0x2c')],function(_0x3b36d0){return{'name':_0x3b36d0[_0x89cc('0x2d')],'type':_0x3b36d0[_0x89cc('0x2e')][_0x89cc('0x2f')]};});_0x22c94b[_0x89cc('0x30')]=_[_0x89cc('0x2a')](_0x2dd163,'name');_0x22c94b[_0x89cc('0x31')]=_['keys'](_0x5a385e[_0x89cc('0x31')]);_0x22c94b[_0x89cc('0x32')]=_['intersection'](_0x22c94b[_0x89cc('0x30')],_0x22c94b[_0x89cc('0x31')]);_0x1e6d0e[_0x89cc('0x33')]=_[_0x89cc('0x34')](_0x22c94b[_0x89cc('0x30')],qs[_0x89cc('0x35')](_0x5a385e[_0x89cc('0x31')]['fields']));_0x1e6d0e[_0x89cc('0x33')]=_0x1e6d0e[_0x89cc('0x33')][_0x89cc('0x36')]?_0x1e6d0e[_0x89cc('0x33')]:_0x22c94b['model'];if(!_0x5a385e[_0x89cc('0x31')][_0x89cc('0x37')]('nolimit')){_0x1e6d0e[_0x89cc('0x1d')]=qs[_0x89cc('0x1d')](_0x5a385e[_0x89cc('0x31')][_0x89cc('0x1d')]);_0x1e6d0e[_0x89cc('0x1a')]=qs['offset'](_0x5a385e['query'][_0x89cc('0x1a')]);}_0x1e6d0e['order']=qs['sort'](_0x5a385e[_0x89cc('0x31')][_0x89cc('0x38')]);_0x1e6d0e['where']=qs[_0x89cc('0x32')](_[_0x89cc('0x39')](_0x5a385e[_0x89cc('0x31')],_0x22c94b['filters']),_0x2dd163);if(_0x5a385e[_0x89cc('0x31')][_0x89cc('0x3a')]){_0x1e6d0e[_0x89cc('0x3b')]=_[_0x89cc('0x3c')](_0x1e6d0e[_0x89cc('0x3b')],{'$or':_[_0x89cc('0x2a')](_0x2dd163,function(_0x39dcba){if(_0x39dcba[_0x89cc('0x2e')]!==_0x89cc('0x3d')){var _0x202124={};_0x202124[_0x39dcba[_0x89cc('0x28')]]={'$like':'%'+_0x5a385e[_0x89cc('0x31')]['filter']+'%'};return _0x202124;}})});}_0x1e6d0e=_[_0x89cc('0x3c')]({},_0x1e6d0e,_0x5a385e[_0x89cc('0x3e')]);var _0x4045d={'where':_0x1e6d0e[_0x89cc('0x3b')]};return db[_0x89cc('0x2b')][_0x89cc('0x1c')](_0x4045d)[_0x89cc('0x25')](function(_0x21aace){_0x22e2f4['count']=_0x21aace;if(_0x5a385e[_0x89cc('0x31')][_0x89cc('0x3f')]){_0x1e6d0e[_0x89cc('0x40')]=[{'all':!![]}];}return db[_0x89cc('0x2b')][_0x89cc('0x41')](_0x1e6d0e);})['then'](function(_0x197910){_0x22e2f4[_0x89cc('0x42')]=_0x197910;return _0x22e2f4;})['then'](respondWithFilteredResult(_0x3f2b7c,_0x1e6d0e))[_0x89cc('0x43')](handleError(_0x3f2b7c,null));};exports[_0x89cc('0x44')]=function(_0x58547d,_0x4399a5){var _0x51a131={'raw':!![],'where':{'id':_0x58547d[_0x89cc('0x45')]['id']}},_0x76db0f={};_0x76db0f[_0x89cc('0x30')]=_['keys'](db[_0x89cc('0x2b')][_0x89cc('0x2c')]);_0x76db0f['query']=_[_0x89cc('0x46')](_0x58547d[_0x89cc('0x31')]);_0x76db0f['filters']=_[_0x89cc('0x34')](_0x76db0f[_0x89cc('0x30')],_0x76db0f[_0x89cc('0x31')]);_0x51a131['attributes']=_[_0x89cc('0x34')](_0x76db0f[_0x89cc('0x30')],qs['fields'](_0x58547d[_0x89cc('0x31')][_0x89cc('0x35')]));_0x51a131[_0x89cc('0x33')]=_0x51a131[_0x89cc('0x33')][_0x89cc('0x36')]?_0x51a131[_0x89cc('0x33')]:_0x76db0f[_0x89cc('0x30')];if(_0x58547d['query'][_0x89cc('0x3f')]){_0x51a131[_0x89cc('0x40')]=[{'all':!![]}];}_0x51a131=_[_0x89cc('0x3c')]({},_0x51a131,_0x58547d['options']);return db['SquareDetailsReport'][_0x89cc('0x47')](_0x51a131)[_0x89cc('0x25')](handleEntityNotFound(_0x4399a5,null))[_0x89cc('0x25')](respondWithResult(_0x4399a5,null))['catch'](handleError(_0x4399a5,null));};exports[_0x89cc('0x48')]=function(_0x110dab,_0x5674e7){return db['SquareDetailsReport'][_0x89cc('0x48')](_0x110dab[_0x89cc('0x49')],{})[_0x89cc('0x25')](respondWithResult(_0x5674e7,0xc9))[_0x89cc('0x43')](handleError(_0x5674e7,null));};exports[_0x89cc('0x23')]=function(_0x1ec6b8,_0x78e584){if(_0x1ec6b8[_0x89cc('0x49')]['id']){delete _0x1ec6b8[_0x89cc('0x49')]['id'];}return db[_0x89cc('0x2b')][_0x89cc('0x47')]({'where':{'id':_0x1ec6b8[_0x89cc('0x45')]['id']}})['then'](handleEntityNotFound(_0x78e584,null))[_0x89cc('0x25')](saveUpdates(_0x1ec6b8[_0x89cc('0x49')],null))[_0x89cc('0x25')](respondWithResult(_0x78e584,null))[_0x89cc('0x43')](handleError(_0x78e584,null));};exports[_0x89cc('0x24')]=function(_0xa1b453,_0x543b03){return db[_0x89cc('0x2b')]['find']({'where':{'id':_0xa1b453[_0x89cc('0x45')]['id']}})[_0x89cc('0x25')](handleEntityNotFound(_0x543b03,null))[_0x89cc('0x25')](removeEntity(_0x543b03,null))[_0x89cc('0x43')](handleError(_0x543b03,null));};exports['describe']=function(_0x9df617,_0x20c380){return db[_0x89cc('0x2b')][_0x89cc('0x4a')]()[_0x89cc('0x25')](respondWithResult(_0x20c380,null))[_0x89cc('0x43')](handleError(_0x20c380,null));}; \ No newline at end of file +var _0xa11f=['filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','destroy','describe','eml-format','rimraf','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','name','index','map','SquareDetailsReport','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x330788,_0x57a6d2){var _0x549769=function(_0x40991b){while(--_0x40991b){_0x330788['push'](_0x330788['shift']());}};_0x549769(++_0x57a6d2);}(_0xa11f,0xe7));var _0xfa11=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0xa11f[_0x1bc013];return _0x55df36;};'use strict';var emlformat=require(_0xfa11('0x0'));var rimraf=require(_0xfa11('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfa11('0x2'));var Mustache=require('mustache');var util=require(_0xfa11('0x3'));var path=require(_0xfa11('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfa11('0x5'));var fs=require('fs');var fs_extra=require(_0xfa11('0x6'));var _=require(_0xfa11('0x7'));var squel=require(_0xfa11('0x8'));var crypto=require(_0xfa11('0x9'));var jsforce=require(_0xfa11('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfa11('0xb'));var Papa=require(_0xfa11('0xc'));var Redis=require(_0xfa11('0xd'));var authService=require(_0xfa11('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfa11('0xf'));var hardwareService=require(_0xfa11('0x10'));var logger=require('../../config/logger')(_0xfa11('0x11'));var utils=require('../../config/utils');var config=require(_0xfa11('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa11('0x13'))['db'];function respondWithStatusCode(_0xd08484,_0x4b9a3c){_0x4b9a3c=_0x4b9a3c||0xcc;return function(_0x3afa2f){if(_0x3afa2f){return _0xd08484['sendStatus'](_0x4b9a3c);}return _0xd08484[_0xfa11('0x14')](_0x4b9a3c)[_0xfa11('0x15')]();};}function respondWithResult(_0x24b840,_0x5759aa){_0x5759aa=_0x5759aa||0xc8;return function(_0x402123){if(_0x402123){return _0x24b840[_0xfa11('0x14')](_0x5759aa)[_0xfa11('0x16')](_0x402123);}};}function respondWithFilteredResult(_0x40aaa2,_0x13baf7){return function(_0x2c9393){if(_0x2c9393){var _0x351d74=typeof _0x13baf7[_0xfa11('0x17')]===_0xfa11('0x18')&&typeof _0x13baf7[_0xfa11('0x19')]===_0xfa11('0x18');var _0x2ce1a0=_0x2c9393[_0xfa11('0x1a')];var _0xcfc916=_0x351d74?0x0:_0x13baf7[_0xfa11('0x17')];var _0x48d279=_0x351d74?_0x2c9393[_0xfa11('0x1a')]:_0x13baf7[_0xfa11('0x17')]+_0x13baf7[_0xfa11('0x19')];var _0x100ae1;if(_0x48d279>=_0x2ce1a0){_0x48d279=_0x2ce1a0;_0x100ae1=0xc8;}else{_0x100ae1=0xce;}_0x40aaa2[_0xfa11('0x14')](_0x100ae1);return _0x40aaa2[_0xfa11('0x1b')](_0xfa11('0x1c'),_0xcfc916+'-'+_0x48d279+'/'+_0x2ce1a0)[_0xfa11('0x16')](_0x2c9393);}return null;};}function patchUpdates(_0x24cce1){return function(_0x1d6d83){try{jsonpatch[_0xfa11('0x1d')](_0x1d6d83,_0x24cce1,!![]);}catch(_0xa80158){return BPromise[_0xfa11('0x1e')](_0xa80158);}return _0x1d6d83[_0xfa11('0x1f')]();};}function saveUpdates(_0x3c133f,_0x5043a9){return function(_0x1bc6c6){if(_0x1bc6c6){return _0x1bc6c6[_0xfa11('0x20')](_0x3c133f)['then'](function(_0x49fd2a){return _0x49fd2a;});}return null;};}function removeEntity(_0x31c7b4,_0x3eac26){return function(_0x4f99b8){if(_0x4f99b8){return _0x4f99b8['destroy']()['then'](function(){_0x31c7b4[_0xfa11('0x14')](0xcc)[_0xfa11('0x15')]();});}};}function handleEntityNotFound(_0x51df96,_0x2e845b){return function(_0x54f07a){if(!_0x54f07a){_0x51df96['sendStatus'](0x194);}return _0x54f07a;};}function handleError(_0x910b4e,_0x41f219){_0x41f219=_0x41f219||0x1f4;return function(_0x5c8bdd){logger[_0xfa11('0x21')](_0x5c8bdd['stack']);if(_0x5c8bdd[_0xfa11('0x22')]){delete _0x5c8bdd['name'];}_0x910b4e[_0xfa11('0x14')](_0x41f219)['send'](_0x5c8bdd);};}exports[_0xfa11('0x23')]=function(_0xf35143,_0x276c89){var _0x375449={},_0x59ce8d={},_0xf940b4={'count':0x0,'rows':[]};var _0x41deea=_[_0xfa11('0x24')](db[_0xfa11('0x25')]['rawAttributes'],function(_0x4d4807){return{'name':_0x4d4807[_0xfa11('0x26')],'type':_0x4d4807['type'][_0xfa11('0x27')]};});_0x59ce8d[_0xfa11('0x28')]=_['map'](_0x41deea,_0xfa11('0x22'));_0x59ce8d['query']=_[_0xfa11('0x29')](_0xf35143[_0xfa11('0x2a')]);_0x59ce8d[_0xfa11('0x2b')]=_[_0xfa11('0x2c')](_0x59ce8d[_0xfa11('0x28')],_0x59ce8d[_0xfa11('0x2a')]);_0x375449[_0xfa11('0x2d')]=_[_0xfa11('0x2c')](_0x59ce8d[_0xfa11('0x28')],qs['fields'](_0xf35143[_0xfa11('0x2a')][_0xfa11('0x2e')]));_0x375449[_0xfa11('0x2d')]=_0x375449['attributes'][_0xfa11('0x2f')]?_0x375449[_0xfa11('0x2d')]:_0x59ce8d[_0xfa11('0x28')];if(!_0xf35143[_0xfa11('0x2a')][_0xfa11('0x30')]('nolimit')){_0x375449[_0xfa11('0x19')]=qs[_0xfa11('0x19')](_0xf35143[_0xfa11('0x2a')]['limit']);_0x375449[_0xfa11('0x17')]=qs['offset'](_0xf35143[_0xfa11('0x2a')]['offset']);}_0x375449[_0xfa11('0x31')]=qs[_0xfa11('0x32')](_0xf35143[_0xfa11('0x2a')][_0xfa11('0x32')]);_0x375449[_0xfa11('0x33')]=qs[_0xfa11('0x2b')](_[_0xfa11('0x34')](_0xf35143[_0xfa11('0x2a')],_0x59ce8d[_0xfa11('0x2b')]),_0x41deea);if(_0xf35143[_0xfa11('0x2a')][_0xfa11('0x35')]){_0x375449[_0xfa11('0x33')]=_[_0xfa11('0x36')](_0x375449['where'],{'$or':_['map'](_0x41deea,function(_0x2e9cc2){if(_0x2e9cc2[_0xfa11('0x37')]!==_0xfa11('0x38')){var _0x55ac8f={};_0x55ac8f[_0x2e9cc2['name']]={'$like':'%'+_0xf35143[_0xfa11('0x2a')][_0xfa11('0x35')]+'%'};return _0x55ac8f;}})});}_0x375449=_[_0xfa11('0x36')]({},_0x375449,_0xf35143[_0xfa11('0x39')]);var _0x3d42ae={'where':_0x375449['where']};return db[_0xfa11('0x25')][_0xfa11('0x1a')](_0x3d42ae)[_0xfa11('0x3a')](function(_0x186877){_0xf940b4['count']=_0x186877;if(_0xf35143[_0xfa11('0x2a')][_0xfa11('0x3b')]){_0x375449[_0xfa11('0x3c')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0xfa11('0x3d')](_0x375449);})['then'](function(_0x390026){_0xf940b4['rows']=_0x390026;return _0xf940b4;})[_0xfa11('0x3a')](respondWithFilteredResult(_0x276c89,_0x375449))[_0xfa11('0x3e')](handleError(_0x276c89,null));};exports[_0xfa11('0x3f')]=function(_0x4756bd,_0x4b4650){var _0x5f36a2={'raw':!![],'where':{'id':_0x4756bd[_0xfa11('0x40')]['id']}},_0x295869={};_0x295869['model']=_[_0xfa11('0x29')](db[_0xfa11('0x25')][_0xfa11('0x41')]);_0x295869[_0xfa11('0x2a')]=_['keys'](_0x4756bd[_0xfa11('0x2a')]);_0x295869['filters']=_[_0xfa11('0x2c')](_0x295869['model'],_0x295869['query']);_0x5f36a2['attributes']=_['intersection'](_0x295869[_0xfa11('0x28')],qs[_0xfa11('0x2e')](_0x4756bd[_0xfa11('0x2a')][_0xfa11('0x2e')]));_0x5f36a2[_0xfa11('0x2d')]=_0x5f36a2['attributes'][_0xfa11('0x2f')]?_0x5f36a2['attributes']:_0x295869[_0xfa11('0x28')];if(_0x4756bd['query']['includeAll']){_0x5f36a2[_0xfa11('0x3c')]=[{'all':!![]}];}_0x5f36a2=_[_0xfa11('0x36')]({},_0x5f36a2,_0x4756bd[_0xfa11('0x39')]);return db['SquareDetailsReport'][_0xfa11('0x42')](_0x5f36a2)[_0xfa11('0x3a')](handleEntityNotFound(_0x4b4650,null))['then'](respondWithResult(_0x4b4650,null))['catch'](handleError(_0x4b4650,null));};exports[_0xfa11('0x43')]=function(_0x2e9fd5,_0x507507){return db[_0xfa11('0x25')][_0xfa11('0x43')](_0x2e9fd5[_0xfa11('0x44')],{})[_0xfa11('0x3a')](respondWithResult(_0x507507,0xc9))[_0xfa11('0x3e')](handleError(_0x507507,null));};exports['update']=function(_0x27911e,_0x193336){if(_0x27911e[_0xfa11('0x44')]['id']){delete _0x27911e[_0xfa11('0x44')]['id'];}return db[_0xfa11('0x25')]['find']({'where':{'id':_0x27911e['params']['id']}})[_0xfa11('0x3a')](handleEntityNotFound(_0x193336,null))['then'](saveUpdates(_0x27911e[_0xfa11('0x44')],null))['then'](respondWithResult(_0x193336,null))[_0xfa11('0x3e')](handleError(_0x193336,null));};exports[_0xfa11('0x45')]=function(_0x33978a,_0x2d75e1){return db[_0xfa11('0x25')][_0xfa11('0x42')]({'where':{'id':_0x33978a[_0xfa11('0x40')]['id']}})[_0xfa11('0x3a')](handleEntityNotFound(_0x2d75e1,null))[_0xfa11('0x3a')](removeEntity(_0x2d75e1,null))['catch'](handleError(_0x2d75e1,null));};exports[_0xfa11('0x46')]=function(_0x9f6bdc,_0x4a8ad4){return db[_0xfa11('0x25')]['describe']()[_0xfa11('0x3a')](respondWithResult(_0x4a8ad4,null))['catch'](handleError(_0x4a8ad4,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index c15fd6b..618588e 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 _0x0890=['report_square_details','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport'];(function(_0x35fb79,_0x47f0dc){var _0x1f6764=function(_0x219ad9){while(--_0x219ad9){_0x35fb79['push'](_0x35fb79['shift']());}};_0x1f6764(++_0x47f0dc);}(_0x0890,0xb7));var _0x0089=function(_0x31e9d7,_0x5bdda2){_0x31e9d7=_0x31e9d7-0x0;var _0x1e3b6e=_0x0890[_0x31e9d7];return _0x1e3b6e;};'use strict';var _=require('lodash');var util=require(_0x0089('0x0'));var logger=require(_0x0089('0x1'))(_0x0089('0x2'));var moment=require('moment');var BPromise=require(_0x0089('0x3'));var rp=require(_0x0089('0x4'));var fs=require('fs');var path=require(_0x0089('0x5'));var rimraf=require(_0x0089('0x6'));var config=require(_0x0089('0x7'));var attributes=require(_0x0089('0x8'));module[_0x0089('0x9')]=function(_0x391154,_0x3c61fa){return _0x391154[_0x0089('0xa')](_0x0089('0xb'),attributes,{'tableName':_0x0089('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7b8=['path','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','util','../../config/logger','bluebird','request-promise'];(function(_0x5c5d43,_0x55dc02){var _0x4edcc7=function(_0x258d64){while(--_0x258d64){_0x5c5d43['push'](_0x5c5d43['shift']());}};_0x4edcc7(++_0x55dc02);}(_0xa7b8,0xce));var _0x8a7b=function(_0x403fbe,_0x3bade8){_0x403fbe=_0x403fbe-0x0;var _0x1721c1=_0xa7b8[_0x403fbe];return _0x1721c1;};'use strict';var _=require('lodash');var util=require(_0x8a7b('0x0'));var logger=require(_0x8a7b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8a7b('0x2'));var rp=require(_0x8a7b('0x3'));var fs=require('fs');var path=require(_0x8a7b('0x4'));var rimraf=require('rimraf');var config=require(_0x8a7b('0x5'));var attributes=require(_0x8a7b('0x6'));module[_0x8a7b('0x7')]=function(_0x22d768,_0x25d690){return _0x22d768[_0x8a7b('0x8')](_0x8a7b('0x9'),attributes,{'tableName':'report_square_details','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 e8e9f9d..fe7e8de 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 _0xab40=['create','body','options','then','CreateSquareDetailsReport','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','SquareDetailsReport'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xab40,0xcd));var _0x0ab4=function(_0x47f89f,_0x1d2b6d){_0x47f89f=_0x47f89f-0x0;var _0x75628a=_0xab40[_0x47f89f];return _0x75628a;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10d92b,_0x46d16a,_0x11e99f){return new BPromise(function(_0x6d135d,_0x4cf8de){return client['request'](_0x10d92b,_0x11e99f)['then'](function(_0x24271e){logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));logger[_0x0ab4('0xb')](_0x0ab4('0xc'),_0x46d16a,_0x0ab4('0xa'),JSON[_0x0ab4('0xd')](_0x24271e));if(_0x24271e['error']){if(_0x24271e['error'][_0x0ab4('0xe')]===0x1f4){logger['error'](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x4cf8de(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}logger[_0x0ab4('0xf')](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x6d135d(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}else{logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));_0x6d135d(_0x24271e[_0x0ab4('0x11')][_0x0ab4('0x10')]);}})[_0x0ab4('0x12')](function(_0x2bdda7){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x46d16a,_0x2bdda7);_0x4cf8de(_0x2bdda7);});});}exports['CreateSquareDetailsReport']=function(_0x17422f){var _0x30d5df=this;return new Promise(function(_0x2f50d2,_0x53723c){return db[_0x0ab4('0x13')][_0x0ab4('0x14')](_0x17422f[_0x0ab4('0x15')],{'raw':_0x17422f[_0x0ab4('0x16')]?_0x17422f['options']['raw']===undefined?!![]:![]:!![]})[_0x0ab4('0x17')](function(_0x5b1ed5){logger[_0x0ab4('0x8')](_0x0ab4('0x18'),_0x17422f);logger['debug'](_0x0ab4('0x18'),_0x17422f,JSON[_0x0ab4('0xd')](_0x5b1ed5));_0x2f50d2(_0x5b1ed5);})[_0x0ab4('0x12')](function(_0x1d5c14){logger[_0x0ab4('0xf')]('CreateSquareDetailsReport',_0x1d5c14['message'],_0x17422f);_0x53723c(_0x30d5df[_0x0ab4('0xf')](0x1f4,_0x1d5c14[_0x0ab4('0x10')]));});});}; \ No newline at end of file +var _0x1775=['code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2cbe74,_0x31195c){var _0x3b7e5c=function(_0x51ac2c){while(--_0x51ac2c){_0x2cbe74['push'](_0x2cbe74['shift']());}};_0x3b7e5c(++_0x31195c);}(_0x1775,0x1db));var _0x5177=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1775[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ac1c6,_0x300b43,_0x245c12){return new BPromise(function(_0x363611,_0x3ce288){return client[_0x5177('0xd')](_0x2ac1c6,_0x245c12)[_0x5177('0xe')](function(_0x2c23d8){logger[_0x5177('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x300b43,'request\x20sent');logger[_0x5177('0x10')](_0x5177('0x11'),_0x300b43,_0x5177('0x12'),JSON[_0x5177('0x13')](_0x2c23d8));if(_0x2c23d8[_0x5177('0x14')]){if(_0x2c23d8['error'][_0x5177('0x15')]===0x1f4){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x3ce288(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x363611(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}else{logger[_0x5177('0xf')](_0x5177('0x16'),_0x300b43,_0x5177('0x12'));_0x363611(_0x2c23d8[_0x5177('0x18')][_0x5177('0x17')]);}})[_0x5177('0x19')](function(_0x50ce2c){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x50ce2c);_0x3ce288(_0x50ce2c);});});}exports[_0x5177('0x1a')]=function(_0x1b4102){var _0x5f5bd4=this;return new Promise(function(_0x3e6944,_0x2ebf91){return db[_0x5177('0x1b')]['create'](_0x1b4102[_0x5177('0x1c')],{'raw':_0x1b4102['options']?_0x1b4102[_0x5177('0x1d')][_0x5177('0x1e')]===undefined?!![]:![]:!![]})[_0x5177('0xe')](function(_0x27b732){logger[_0x5177('0xf')](_0x5177('0x1a'),_0x1b4102);logger[_0x5177('0x10')](_0x5177('0x1a'),_0x1b4102,JSON[_0x5177('0x13')](_0x27b732));_0x3e6944(_0x27b732);})[_0x5177('0x19')](function(_0x23dad2){logger[_0x5177('0x14')]('CreateSquareDetailsReport',_0x23dad2[_0x5177('0x17')],_0x1b4102);_0x2ebf91(_0x5f5bd4['error'](0x1f4,_0x23dad2[_0x5177('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index b918ced..3b047b1 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 _0x35a4=['exports','express','Router','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess'];(function(_0x37ee3b,_0x29dbcd){var _0x14c2b8=function(_0x3925ce){while(--_0x3925ce){_0x37ee3b['push'](_0x37ee3b['shift']());}};_0x14c2b8(++_0x29dbcd);}(_0x35a4,0x18d));var _0x435a=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0x35a4[_0x29d623];return _0x242e59;};'use strict';var express=require(_0x435a('0x0'));var router=express[_0x435a('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x435a('0x2'));router[_0x435a('0x3')]('/',auth['isAuthenticated'](),controller[_0x435a('0x4')]);router[_0x435a('0x3')](_0x435a('0x5'),auth[_0x435a('0x6')](),controller[_0x435a('0x7')]);module[_0x435a('0x8')]=router; \ No newline at end of file +var _0x2e8a=['killProcess','express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x24333e,_0x1e11c5){var _0x161a97=function(_0x3c115b){while(--_0x3c115b){_0x24333e['push'](_0x24333e['shift']());}};_0x161a97(++_0x1e11c5);}(_0x2e8a,0x1c3));var _0xa2e8=function(_0x5bafd3,_0x474626){_0x5bafd3=_0x5bafd3-0x0;var _0x4aeb83=_0x2e8a[_0x5bafd3];return _0x4aeb83;};'use strict';var express=require(_0xa2e8('0x0'));var router=express[_0xa2e8('0x1')]();var auth=require(_0xa2e8('0x2'));var controller=require(_0xa2e8('0x3'));router[_0xa2e8('0x4')]('/',auth[_0xa2e8('0x5')](),controller[_0xa2e8('0x6')]);router[_0xa2e8('0x4')](_0xa2e8('0x7'),auth[_0xa2e8('0x5')](),controller[_0xa2e8('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index b91ad09..5342acf 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 _0xf1aa=['systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','getAllData','then','json','components/import/cm','params','pid','split','length','indexOf','format','kill','SIGINT','catch'];(function(_0x7f8b61,_0x4fa837){var _0x16e761=function(_0x1872ee){while(--_0x1872ee){_0x7f8b61['push'](_0x7f8b61['shift']());}};_0x16e761(++_0x4fa837);}(_0xf1aa,0x9c));var _0xaf1a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf1aa[_0x2641f9];return _0x585741;};'use strict';var info=require(_0xaf1a('0x0'));var exec=require(_0xaf1a('0x1'))[_0xaf1a('0x2')];var logger=require(_0xaf1a('0x3'))(_0xaf1a('0x4'));var util=require(_0xaf1a('0x5'));var BPromise=require(_0xaf1a('0x6'));var _=require(_0xaf1a('0x7'));function handleError(_0x2673de,_0x21a79f,_0x183ba4){_0x21a79f=_0x21a79f||0x1f4;return function(_0x4d7703){logger['error'](_0xaf1a('0x8'),_0x183ba4,_0x21a79f,util[_0xaf1a('0x9')](_0x4d7703,{'showHidden':![],'depth':null}));delete _0x4d7703[_0xaf1a('0xa')];_0x2673de[_0xaf1a('0xb')](_0x21a79f)[_0xaf1a('0xc')](_0x4d7703);};}exports['index']=function(_0x10852f,_0x347d34){return info[_0xaf1a('0xd')]()[_0xaf1a('0xe')](function(_0x583231){return _0x347d34['status'](0xc8)[_0xaf1a('0xf')](_0x583231);})['catch'](function(_0x49b8ee){return _0x347d34[_0xaf1a('0xb')](0x1f4)[_0xaf1a('0xf')](_0x49b8ee);});};exports['killProcess']=function(_0x5955ee,_0x35bf08){var _0x5ac1d7=[_0xaf1a('0x10')];return new BPromise(function(_0x162abf,_0x133eb2){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x5955ee[_0xaf1a('0x11')][_0xaf1a('0x12')]),function(_0x574f46,_0x375fea,_0x3fd180){if(_0x574f46){return _0x133eb2(_0x574f46);}return _0x162abf(_0x375fea);});})[_0xaf1a('0xe')](function(_0x3478a2){var _0x1af322=![];var _0x36e38c=_0x3478a2[_0xaf1a('0x13')](/\n/);for(var _0x44e934=0x0,_0xac9cd8=_0x5ac1d7[_0xaf1a('0x14')];_0x44e934<_0xac9cd8,_0x1af322===![];_0x44e934+=0x1){if(_0x3478a2[_0xaf1a('0x15')](_0x5ac1d7[_0x44e934])>=0x0){_0x1af322=!![];}}if(!_0x1af322){throw new Error(util[_0xaf1a('0x16')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x5955ee[_0xaf1a('0x11')][_0xaf1a('0x12')]));}process[_0xaf1a('0x17')](_0x5955ee[_0xaf1a('0x11')][_0xaf1a('0x12')],_0xaf1a('0x18'));return _0x35bf08[_0xaf1a('0xb')](0xc8)[_0xaf1a('0xf')]({'message':util[_0xaf1a('0x16')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x5955ee['params']['pid'])});})[_0xaf1a('0x19')](handleError(_0x35bf08,null,'killProcess'));}; \ No newline at end of file +var _0x656e=['split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','status','Process\x20with\x20pid\x20%s\x20killed\x20correctly','exec','../../config/logger','api','util','bluebird','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','send','getAllData','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','then'];(function(_0x2e524b,_0x77d26d){var _0x2c037a=function(_0x4ae91b){while(--_0x4ae91b){_0x2e524b['push'](_0x2e524b['shift']());}};_0x2c037a(++_0x77d26d);}(_0x656e,0x86));var _0xe656=function(_0x243dce,_0x548bcf){_0x243dce=_0x243dce-0x0;var _0x482b9d=_0x656e[_0x243dce];return _0x482b9d;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0xe656('0x0')];var logger=require(_0xe656('0x1'))(_0xe656('0x2'));var util=require(_0xe656('0x3'));var BPromise=require(_0xe656('0x4'));var _=require('lodash');function handleError(_0x46766f,_0x4fc4b3,_0x2f281e){_0x4fc4b3=_0x4fc4b3||0x1f4;return function(_0x28d1d8){logger['error'](_0xe656('0x5'),_0x2f281e,_0x4fc4b3,util['inspect'](_0x28d1d8,{'showHidden':![],'depth':null}));delete _0x28d1d8[_0xe656('0x6')];_0x46766f['status'](_0x4fc4b3)[_0xe656('0x7')](_0x28d1d8);};}exports['index']=function(_0xa20d1e,_0x524caf){return info[_0xe656('0x8')]()['then'](function(_0x4443e5){return _0x524caf['status'](0xc8)[_0xe656('0x9')](_0x4443e5);})[_0xe656('0xa')](function(_0x26ac07){return _0x524caf['status'](0x1f4)['json'](_0x26ac07);});};exports[_0xe656('0xb')]=function(_0x3a2dc2,_0x29291e){var _0x3ffdbf=[_0xe656('0xc')];return new BPromise(function(_0xdc17b1,_0x599adb){return exec(util['format'](_0xe656('0xd'),_0x3a2dc2['params'][_0xe656('0xe')]),function(_0x4853f5,_0x16bb00,_0x387b80){if(_0x4853f5){return _0x599adb(_0x4853f5);}return _0xdc17b1(_0x16bb00);});})[_0xe656('0xf')](function(_0x32c0cf){var _0x324916=![];var _0x3e33c2=_0x32c0cf[_0xe656('0x10')](/\n/);for(var _0x2d89d3=0x0,_0x4c58c1=_0x3ffdbf[_0xe656('0x11')];_0x2d89d3<_0x4c58c1,_0x324916===![];_0x2d89d3+=0x1){if(_0x32c0cf[_0xe656('0x12')](_0x3ffdbf[_0x2d89d3])>=0x0){_0x324916=!![];}}if(!_0x324916){throw new Error(util[_0xe656('0x13')](_0xe656('0x14'),_0x3a2dc2[_0xe656('0x15')][_0xe656('0xe')]));}process[_0xe656('0x16')](_0x3a2dc2[_0xe656('0x15')][_0xe656('0xe')],'SIGINT');return _0x29291e[_0xe656('0x17')](0xc8)[_0xe656('0x9')]({'message':util[_0xe656('0x13')](_0xe656('0x18'),_0x3a2dc2[_0xe656('0x15')]['pid'])});})['catch'](handleError(_0x29291e,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 8f8e687..f0dfd59 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 _0xe09d=['put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./tag.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x51a6d6,_0x3c9c49){var _0x5ef1a8=function(_0x8ff84a){while(--_0x8ff84a){_0x51a6d6['push'](_0x51a6d6['shift']());}};_0x5ef1a8(++_0x3c9c49);}(_0xe09d,0x9d));var _0xde09=function(_0x32073a,_0x5867cf){_0x32073a=_0x32073a-0x0;var _0x24b72e=_0xe09d[_0x32073a];return _0x24b72e;};'use strict';var multer=require(_0xde09('0x0'));var util=require(_0xde09('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xde09('0x2'));var router=express[_0xde09('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xde09('0x4'));var interaction=require(_0xde09('0x5'));var config=require('../../config/environment');var controller=require(_0xde09('0x6'));router[_0xde09('0x7')]('/',auth[_0xde09('0x8')](),controller[_0xde09('0x9')]);router[_0xde09('0x7')](_0xde09('0xa'),auth[_0xde09('0x8')](),controller[_0xde09('0xb')]);router[_0xde09('0xc')]('/',auth[_0xde09('0x8')](),controller[_0xde09('0xd')]);router[_0xde09('0xe')](_0xde09('0xa'),auth[_0xde09('0x8')](),controller[_0xde09('0xf')]);router[_0xde09('0x10')](_0xde09('0xa'),auth[_0xde09('0x8')](),controller[_0xde09('0x11')]);module[_0xde09('0x12')]=router; \ No newline at end of file +var _0xbb27=['index','/:id','show','post','create','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./tag.controller','get','isAuthenticated'];(function(_0x629264,_0x1e8ef9){var _0x52baa6=function(_0x48f16a){while(--_0x48f16a){_0x629264['push'](_0x629264['shift']());}};_0x52baa6(++_0x1e8ef9);}(_0xbb27,0x146));var _0x7bb2=function(_0x6e115e,_0x4af09d){_0x6e115e=_0x6e115e-0x0;var _0x2f9a2e=_0xbb27[_0x6e115e];return _0x2f9a2e;};'use strict';var multer=require(_0x7bb2('0x0'));var util=require(_0x7bb2('0x1'));var path=require(_0x7bb2('0x2'));var timeout=require('connect-timeout');var express=require(_0x7bb2('0x3'));var router=express[_0x7bb2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7bb2('0x5'));var interaction=require(_0x7bb2('0x6'));var config=require('../../config/environment');var controller=require(_0x7bb2('0x7'));router[_0x7bb2('0x8')]('/',auth[_0x7bb2('0x9')](),controller[_0x7bb2('0xa')]);router[_0x7bb2('0x8')](_0x7bb2('0xb'),auth[_0x7bb2('0x9')](),controller[_0x7bb2('0xc')]);router[_0x7bb2('0xd')]('/',auth[_0x7bb2('0x9')](),controller[_0x7bb2('0xe')]);router['put'](_0x7bb2('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7bb2('0xb'),auth[_0x7bb2('0x9')](),controller['destroy']);module[_0x7bb2('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index b99f4e2..bee757d 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 _0x83e1=['#0091EA','sequelize','exports','name'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x83e1,0x1ad));var _0x183e=function(_0x55d016,_0x30fdcf){_0x55d016=_0x55d016-0x0;var _0x57cdc5=_0x83e1[_0x55d016];return _0x57cdc5;};'use strict';var Sequelize=require(_0x183e('0x0'));module[_0x183e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x183e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x183e('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0ca5=['name','#0091EA','sequelize','exports','STRING'];(function(_0x4dccf4,_0x546161){var _0x41d2ef=function(_0x3ab006){while(--_0x3ab006){_0x4dccf4['push'](_0x4dccf4['shift']());}};_0x41d2ef(++_0x546161);}(_0x0ca5,0xfc));var _0x50ca=function(_0x428ccc,_0x2d3040){_0x428ccc=_0x428ccc-0x0;var _0x23eb1d=_0x0ca5[_0x428ccc];return _0x23eb1d;};'use strict';var Sequelize=require(_0x50ca('0x0'));module[_0x50ca('0x1')]={'name':{'type':Sequelize[_0x50ca('0x2')],'unique':_0x50ca('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x50ca('0x2')],'defaultValue':_0x50ca('0x4')},'description':{'type':Sequelize[_0x50ca('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index baeefd0..a359203 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 _0x54f3=['Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','Tag','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','user','get','role','Tags','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset'];(function(_0x150aef,_0xb74cf6){var _0x254a5e=function(_0x51017a){while(--_0x51017a){_0x150aef['push'](_0x150aef['shift']());}};_0x254a5e(++_0xb74cf6);}(_0x54f3,0x120));var _0x354f=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x54f3[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x354f('0x0'));var zipdir=require(_0x354f('0x1'));var jsonpatch=require(_0x354f('0x2'));var rp=require(_0x354f('0x3'));var moment=require(_0x354f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x354f('0x5'));var path=require(_0x354f('0x6'));var sox=require(_0x354f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x354f('0x8'));var _=require('lodash');var squel=require(_0x354f('0x9'));var crypto=require(_0x354f('0xa'));var jsforce=require(_0x354f('0xb'));var deskjs=require(_0x354f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x354f('0xd'));var Papa=require('papaparse');var Redis=require(_0x354f('0xe'));var authService=require(_0x354f('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x354f('0x10'));var logger=require(_0x354f('0x11'))('api');var utils=require(_0x354f('0x12'));var config=require(_0x354f('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x354f('0x14'))['db'];function respondWithStatusCode(_0x824bf4,_0x13d871){_0x13d871=_0x13d871||0xcc;return function(_0x97c0da){if(_0x97c0da){return _0x824bf4[_0x354f('0x15')](_0x13d871);}return _0x824bf4[_0x354f('0x16')](_0x13d871)[_0x354f('0x17')]();};}function respondWithResult(_0x4ff8e7,_0xf2e013){_0xf2e013=_0xf2e013||0xc8;return function(_0x4b811d){if(_0x4b811d){return _0x4ff8e7[_0x354f('0x16')](_0xf2e013)['json'](_0x4b811d);}};}function respondWithFilteredResult(_0x103388,_0x234484){return function(_0x18cf66){if(_0x18cf66){var _0x4cc0e9=typeof _0x234484['offset']===_0x354f('0x18')&&typeof _0x234484[_0x354f('0x19')]===_0x354f('0x18');var _0x2ef866=_0x18cf66[_0x354f('0x1a')];var _0x36402d=_0x4cc0e9?0x0:_0x234484[_0x354f('0x1b')];var _0x598777=_0x4cc0e9?_0x18cf66[_0x354f('0x1a')]:_0x234484[_0x354f('0x1b')]+_0x234484[_0x354f('0x19')];var _0x4b87dd;if(_0x598777>=_0x2ef866){_0x598777=_0x2ef866;_0x4b87dd=0xc8;}else{_0x4b87dd=0xce;}_0x103388[_0x354f('0x16')](_0x4b87dd);return _0x103388['set'](_0x354f('0x1c'),_0x36402d+'-'+_0x598777+'/'+_0x2ef866)[_0x354f('0x1d')](_0x18cf66);}return null;};}function patchUpdates(_0x5e930c){return function(_0x14c4be){try{jsonpatch[_0x354f('0x1e')](_0x14c4be,_0x5e930c,!![]);}catch(_0x4ef4f1){return BPromise['reject'](_0x4ef4f1);}return _0x14c4be[_0x354f('0x1f')]();};}function saveUpdates(_0x574753,_0x52e7cb){return function(_0xa6050f){if(_0xa6050f){return _0xa6050f[_0x354f('0x20')](_0x574753)[_0x354f('0x21')](function(_0x2f4277){return _0x2f4277;});}return null;};}function removeEntity(_0xc0d4ca,_0x158117){return function(_0x273603){if(_0x273603){return _0x273603['destroy']()[_0x354f('0x21')](function(){var _0x519d66=_0x273603['get']({'plain':!![]});var _0x22594b='Tags';return db['UserProfileResource'][_0x354f('0x22')]({'where':{'type':_0x22594b,'resourceId':_0x519d66['id']}})['then'](function(){return _0x273603;});})[_0x354f('0x21')](function(){_0xc0d4ca[_0x354f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x73c95e,_0x3c5c38){return function(_0x1467e7){if(!_0x1467e7){_0x73c95e['sendStatus'](0x194);}return _0x1467e7;};}function handleError(_0x1a968d,_0x503b2d){_0x503b2d=_0x503b2d||0x1f4;return function(_0x227d9b){logger[_0x354f('0x23')](_0x227d9b[_0x354f('0x24')]);if(_0x227d9b[_0x354f('0x25')]){delete _0x227d9b['name'];}_0x1a968d[_0x354f('0x16')](_0x503b2d)[_0x354f('0x26')](_0x227d9b);};}exports[_0x354f('0x27')]=function(_0x34a498,_0x223464){var _0x55afe1={},_0x5a8208={},_0x42caa2={'count':0x0,'rows':[]};var _0x156dba=_[_0x354f('0x28')](db[_0x354f('0x29')]['rawAttributes'],function(_0x576a95){return{'name':_0x576a95[_0x354f('0x2a')],'type':_0x576a95[_0x354f('0x2b')][_0x354f('0x2c')]};});_0x5a8208[_0x354f('0x2d')]=_['map'](_0x156dba,_0x354f('0x25'));_0x5a8208[_0x354f('0x2e')]=_[_0x354f('0x2f')](_0x34a498[_0x354f('0x2e')]);_0x5a8208['filters']=_['intersection'](_0x5a8208[_0x354f('0x2d')],_0x5a8208[_0x354f('0x2e')]);_0x55afe1[_0x354f('0x30')]=_[_0x354f('0x31')](_0x5a8208[_0x354f('0x2d')],qs[_0x354f('0x32')](_0x34a498[_0x354f('0x2e')][_0x354f('0x32')]));_0x55afe1[_0x354f('0x30')]=_0x55afe1[_0x354f('0x30')][_0x354f('0x33')]?_0x55afe1['attributes']:_0x5a8208[_0x354f('0x2d')];if(!_0x34a498['query'][_0x354f('0x34')](_0x354f('0x35'))){_0x55afe1[_0x354f('0x19')]=qs[_0x354f('0x19')](_0x34a498[_0x354f('0x2e')][_0x354f('0x19')]);_0x55afe1['offset']=qs[_0x354f('0x1b')](_0x34a498[_0x354f('0x2e')]['offset']);}_0x55afe1[_0x354f('0x36')]=qs[_0x354f('0x37')](_0x34a498[_0x354f('0x2e')]['sort']);_0x55afe1[_0x354f('0x38')]=qs[_0x354f('0x39')](_[_0x354f('0x3a')](_0x34a498[_0x354f('0x2e')],_0x5a8208['filters']),_0x156dba);if(_0x34a498[_0x354f('0x2e')]['filter']){_0x55afe1[_0x354f('0x38')]=_[_0x354f('0x3b')](_0x55afe1[_0x354f('0x38')],{'$or':_[_0x354f('0x28')](_0x156dba,function(_0x27c208){if(_0x27c208['type']!=='VIRTUAL'){var _0x162a10={};_0x162a10[_0x27c208[_0x354f('0x25')]]={'$like':'%'+_0x34a498[_0x354f('0x2e')][_0x354f('0x3c')]+'%'};return _0x162a10;}})});}_0x55afe1=_[_0x354f('0x3b')]({},_0x55afe1,_0x34a498[_0x354f('0x3d')]);var _0x58ae82={'where':_0x55afe1[_0x354f('0x38')]};return db[_0x354f('0x29')][_0x354f('0x1a')](_0x58ae82)[_0x354f('0x21')](function(_0x512592){_0x42caa2[_0x354f('0x1a')]=_0x512592;if(_0x34a498[_0x354f('0x2e')][_0x354f('0x3e')]){_0x55afe1[_0x354f('0x3f')]=[{'all':!![]}];}return db[_0x354f('0x29')][_0x354f('0x40')](_0x55afe1);})['then'](function(_0x66b4cc){_0x42caa2[_0x354f('0x41')]=_0x66b4cc;return _0x42caa2;})[_0x354f('0x21')](respondWithFilteredResult(_0x223464,_0x55afe1))['catch'](handleError(_0x223464,null));};exports['show']=function(_0x7835a0,_0x433ff0){var _0xff4402={'raw':!![],'where':{'id':_0x7835a0[_0x354f('0x42')]['id']}},_0x3b34ca={};_0x3b34ca[_0x354f('0x2d')]=_[_0x354f('0x2f')](db[_0x354f('0x29')]['rawAttributes']);_0x3b34ca[_0x354f('0x2e')]=_[_0x354f('0x2f')](_0x7835a0[_0x354f('0x2e')]);_0x3b34ca[_0x354f('0x39')]=_[_0x354f('0x31')](_0x3b34ca[_0x354f('0x2d')],_0x3b34ca[_0x354f('0x2e')]);_0xff4402[_0x354f('0x30')]=_[_0x354f('0x31')](_0x3b34ca['model'],qs[_0x354f('0x32')](_0x7835a0[_0x354f('0x2e')]['fields']));_0xff4402['attributes']=_0xff4402[_0x354f('0x30')][_0x354f('0x33')]?_0xff4402[_0x354f('0x30')]:_0x3b34ca[_0x354f('0x2d')];if(_0x7835a0[_0x354f('0x2e')][_0x354f('0x3e')]){_0xff4402['include']=[{'all':!![]}];}_0xff4402=_['merge']({},_0xff4402,_0x7835a0[_0x354f('0x3d')]);return db[_0x354f('0x29')][_0x354f('0x43')](_0xff4402)[_0x354f('0x21')](handleEntityNotFound(_0x433ff0,null))[_0x354f('0x21')](respondWithResult(_0x433ff0,null))[_0x354f('0x44')](handleError(_0x433ff0,null));};exports['create']=function(_0x55f2c9,_0x6b7a2c){return db['Tag'][_0x354f('0x45')](_0x55f2c9[_0x354f('0x46')],{})[_0x354f('0x21')](function(_0x4e270d){var _0x59963e=_0x55f2c9[_0x354f('0x47')][_0x354f('0x48')]({'plain':!![]});if(!_0x59963e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59963e[_0x354f('0x49')]===_0x354f('0x47')){var _0xf71a4f=_0x4e270d[_0x354f('0x48')]({'plain':!![]});var _0xf46a61=_0x354f('0x4a');return db[_0x354f('0x4b')]['find']({'where':{'name':_0xf46a61,'userProfileId':_0x59963e[_0x354f('0x4c')]},'raw':!![]})[_0x354f('0x21')](function(_0x9ccdaa){if(_0x9ccdaa&&_0x9ccdaa[_0x354f('0x4d')]===0x0){return db[_0x354f('0x4e')]['create']({'name':_0xf71a4f[_0x354f('0x25')],'resourceId':_0xf71a4f['id'],'type':_0x9ccdaa[_0x354f('0x25')],'sectionId':_0x9ccdaa['id']},{})['then'](function(){return _0x4e270d;});}else{return _0x4e270d;}})['catch'](function(_0x44495b){logger[_0x354f('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44495b);throw _0x44495b;});}return _0x4e270d;})['then'](respondWithResult(_0x6b7a2c,0xc9))[_0x354f('0x44')](handleError(_0x6b7a2c,null));};exports[_0x354f('0x20')]=function(_0x4df08f,_0x43a0b1){if(_0x4df08f[_0x354f('0x46')]['id']){delete _0x4df08f[_0x354f('0x46')]['id'];}return db[_0x354f('0x29')][_0x354f('0x43')]({'where':{'id':_0x4df08f[_0x354f('0x42')]['id']}})[_0x354f('0x21')](handleEntityNotFound(_0x43a0b1,null))['then'](saveUpdates(_0x4df08f[_0x354f('0x46')],null))[_0x354f('0x21')](respondWithResult(_0x43a0b1,null))[_0x354f('0x44')](handleError(_0x43a0b1,null));};exports[_0x354f('0x22')]=function(_0x5a6baf,_0x2edb7c){return db[_0x354f('0x29')][_0x354f('0x43')]({'where':{'id':_0x5a6baf[_0x354f('0x42')]['id']}})['then'](handleEntityNotFound(_0x2edb7c,null))[_0x354f('0x21')](removeEntity(_0x2edb7c,null))[_0x354f('0x44')](handleError(_0x2edb7c,null));}; \ No newline at end of file +var _0x3140=['filter','options','count','include','findAll','catch','show','keys','rawAttributes','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','update','then','get','Tags','UserProfileResource','error','stack','send','map','Tag','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','name'];(function(_0x5d8778,_0x3c2f0e){var _0x133e42=function(_0x2c23aa){while(--_0x2c23aa){_0x5d8778['push'](_0x5d8778['shift']());}};_0x133e42(++_0x3c2f0e);}(_0x3140,0xaf));var _0x0314=function(_0x37b0da,_0x42982f){_0x37b0da=_0x37b0da-0x0;var _0x18c5b6=_0x3140[_0x37b0da];return _0x18c5b6;};'use strict';var emlformat=require(_0x0314('0x0'));var rimraf=require(_0x0314('0x1'));var zipdir=require(_0x0314('0x2'));var jsonpatch=require(_0x0314('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0314('0x4'));var Mustache=require(_0x0314('0x5'));var util=require(_0x0314('0x6'));var path=require(_0x0314('0x7'));var sox=require(_0x0314('0x8'));var csv=require(_0x0314('0x9'));var ejs=require(_0x0314('0xa'));var fs=require('fs');var fs_extra=require(_0x0314('0xb'));var _=require(_0x0314('0xc'));var squel=require(_0x0314('0xd'));var crypto=require(_0x0314('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0314('0xf'));var toCsv=require(_0x0314('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0314('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0314('0x11'));var as=require(_0x0314('0x12'));var hardwareService=require(_0x0314('0x13'));var logger=require(_0x0314('0x14'))(_0x0314('0x15'));var utils=require(_0x0314('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0314('0x17'));var db=require(_0x0314('0x18'))['db'];function respondWithStatusCode(_0xd85ddf,_0x4602ec){_0x4602ec=_0x4602ec||0xcc;return function(_0x153077){if(_0x153077){return _0xd85ddf[_0x0314('0x19')](_0x4602ec);}return _0xd85ddf[_0x0314('0x1a')](_0x4602ec)['end']();};}function respondWithResult(_0x1c26ff,_0xbe0b07){_0xbe0b07=_0xbe0b07||0xc8;return function(_0x1316a0){if(_0x1316a0){return _0x1c26ff[_0x0314('0x1a')](_0xbe0b07)[_0x0314('0x1b')](_0x1316a0);}};}function respondWithFilteredResult(_0x398c91,_0x413bfa){return function(_0x3ea356){if(_0x3ea356){var _0x5e460f=typeof _0x413bfa[_0x0314('0x1c')]===_0x0314('0x1d')&&typeof _0x413bfa[_0x0314('0x1e')]==='undefined';var _0x6c48cb=_0x3ea356['count'];var _0x575b68=_0x5e460f?0x0:_0x413bfa[_0x0314('0x1c')];var _0x329679=_0x5e460f?_0x3ea356['count']:_0x413bfa[_0x0314('0x1c')]+_0x413bfa[_0x0314('0x1e')];var _0x583ffa;if(_0x329679>=_0x6c48cb){_0x329679=_0x6c48cb;_0x583ffa=0xc8;}else{_0x583ffa=0xce;}_0x398c91[_0x0314('0x1a')](_0x583ffa);return _0x398c91['set'](_0x0314('0x1f'),_0x575b68+'-'+_0x329679+'/'+_0x6c48cb)[_0x0314('0x1b')](_0x3ea356);}return null;};}function patchUpdates(_0x16d273){return function(_0x77ddfd){try{jsonpatch[_0x0314('0x20')](_0x77ddfd,_0x16d273,!![]);}catch(_0xdfad84){return BPromise['reject'](_0xdfad84);}return _0x77ddfd['save']();};}function saveUpdates(_0x20305b,_0xbd3ad0){return function(_0x1945f8){if(_0x1945f8){return _0x1945f8[_0x0314('0x21')](_0x20305b)[_0x0314('0x22')](function(_0xd7638b){return _0xd7638b;});}return null;};}function removeEntity(_0x58a1c9,_0x3c743e){return function(_0x43fb0e){if(_0x43fb0e){return _0x43fb0e['destroy']()[_0x0314('0x22')](function(){var _0xfc4893=_0x43fb0e[_0x0314('0x23')]({'plain':!![]});var _0x26c6a4=_0x0314('0x24');return db[_0x0314('0x25')]['destroy']({'where':{'type':_0x26c6a4,'resourceId':_0xfc4893['id']}})[_0x0314('0x22')](function(){return _0x43fb0e;});})[_0x0314('0x22')](function(){_0x58a1c9[_0x0314('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29b4b5,_0x5e3eba){return function(_0x47c102){if(!_0x47c102){_0x29b4b5['sendStatus'](0x194);}return _0x47c102;};}function handleError(_0x2fc520,_0x21d6a5){_0x21d6a5=_0x21d6a5||0x1f4;return function(_0x550dc4){logger[_0x0314('0x26')](_0x550dc4[_0x0314('0x27')]);if(_0x550dc4['name']){delete _0x550dc4['name'];}_0x2fc520[_0x0314('0x1a')](_0x21d6a5)[_0x0314('0x28')](_0x550dc4);};}exports['index']=function(_0x44adb3,_0x16e74a){var _0x3d6652={},_0x4da71c={},_0x5b82b2={'count':0x0,'rows':[]};var _0x37ab90=_[_0x0314('0x29')](db[_0x0314('0x2a')]['rawAttributes'],function(_0x1d01b5){return{'name':_0x1d01b5['fieldName'],'type':_0x1d01b5['type'][_0x0314('0x2b')]};});_0x4da71c[_0x0314('0x2c')]=_[_0x0314('0x29')](_0x37ab90,'name');_0x4da71c[_0x0314('0x2d')]=_['keys'](_0x44adb3[_0x0314('0x2d')]);_0x4da71c['filters']=_['intersection'](_0x4da71c[_0x0314('0x2c')],_0x4da71c['query']);_0x3d6652[_0x0314('0x2e')]=_[_0x0314('0x2f')](_0x4da71c[_0x0314('0x2c')],qs[_0x0314('0x30')](_0x44adb3[_0x0314('0x2d')][_0x0314('0x30')]));_0x3d6652[_0x0314('0x2e')]=_0x3d6652['attributes'][_0x0314('0x31')]?_0x3d6652[_0x0314('0x2e')]:_0x4da71c[_0x0314('0x2c')];if(!_0x44adb3[_0x0314('0x2d')][_0x0314('0x32')](_0x0314('0x33'))){_0x3d6652['limit']=qs[_0x0314('0x1e')](_0x44adb3['query'][_0x0314('0x1e')]);_0x3d6652['offset']=qs[_0x0314('0x1c')](_0x44adb3['query']['offset']);}_0x3d6652['order']=qs[_0x0314('0x34')](_0x44adb3[_0x0314('0x2d')][_0x0314('0x34')]);_0x3d6652[_0x0314('0x35')]=qs[_0x0314('0x36')](_['pick'](_0x44adb3[_0x0314('0x2d')],_0x4da71c[_0x0314('0x36')]),_0x37ab90);if(_0x44adb3[_0x0314('0x2d')]['filter']){_0x3d6652[_0x0314('0x35')]=_['merge'](_0x3d6652[_0x0314('0x35')],{'$or':_['map'](_0x37ab90,function(_0x24fe65){if(_0x24fe65['type']!=='VIRTUAL'){var _0x370539={};_0x370539[_0x24fe65[_0x0314('0x37')]]={'$like':'%'+_0x44adb3['query'][_0x0314('0x38')]+'%'};return _0x370539;}})});}_0x3d6652=_['merge']({},_0x3d6652,_0x44adb3[_0x0314('0x39')]);var _0x438ddd={'where':_0x3d6652[_0x0314('0x35')]};return db[_0x0314('0x2a')][_0x0314('0x3a')](_0x438ddd)['then'](function(_0x52a71c){_0x5b82b2[_0x0314('0x3a')]=_0x52a71c;if(_0x44adb3[_0x0314('0x2d')]['includeAll']){_0x3d6652[_0x0314('0x3b')]=[{'all':!![]}];}return db[_0x0314('0x2a')][_0x0314('0x3c')](_0x3d6652);})['then'](function(_0x2b328c){_0x5b82b2['rows']=_0x2b328c;return _0x5b82b2;})[_0x0314('0x22')](respondWithFilteredResult(_0x16e74a,_0x3d6652))[_0x0314('0x3d')](handleError(_0x16e74a,null));};exports[_0x0314('0x3e')]=function(_0x583aba,_0xcafd05){var _0xf4c4a1={'raw':!![],'where':{'id':_0x583aba['params']['id']}},_0x588e65={};_0x588e65['model']=_[_0x0314('0x3f')](db[_0x0314('0x2a')][_0x0314('0x40')]);_0x588e65['query']=_[_0x0314('0x3f')](_0x583aba[_0x0314('0x2d')]);_0x588e65[_0x0314('0x36')]=_[_0x0314('0x2f')](_0x588e65[_0x0314('0x2c')],_0x588e65['query']);_0xf4c4a1[_0x0314('0x2e')]=_[_0x0314('0x2f')](_0x588e65[_0x0314('0x2c')],qs[_0x0314('0x30')](_0x583aba[_0x0314('0x2d')][_0x0314('0x30')]));_0xf4c4a1[_0x0314('0x2e')]=_0xf4c4a1['attributes'][_0x0314('0x31')]?_0xf4c4a1[_0x0314('0x2e')]:_0x588e65['model'];if(_0x583aba[_0x0314('0x2d')][_0x0314('0x41')]){_0xf4c4a1[_0x0314('0x3b')]=[{'all':!![]}];}_0xf4c4a1=_['merge']({},_0xf4c4a1,_0x583aba['options']);return db[_0x0314('0x2a')][_0x0314('0x42')](_0xf4c4a1)[_0x0314('0x22')](handleEntityNotFound(_0xcafd05,null))[_0x0314('0x22')](respondWithResult(_0xcafd05,null))[_0x0314('0x3d')](handleError(_0xcafd05,null));};exports[_0x0314('0x43')]=function(_0x36a72a,_0x478b8b){return db[_0x0314('0x2a')]['create'](_0x36a72a[_0x0314('0x44')],{})[_0x0314('0x22')](function(_0x3003dd){var _0x362b60=_0x36a72a[_0x0314('0x45')]['get']({'plain':!![]});if(!_0x362b60)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x362b60[_0x0314('0x46')]===_0x0314('0x45')){var _0x20070c=_0x3003dd[_0x0314('0x23')]({'plain':!![]});var _0x5b3c49=_0x0314('0x24');return db[_0x0314('0x47')][_0x0314('0x42')]({'where':{'name':_0x5b3c49,'userProfileId':_0x362b60[_0x0314('0x48')]},'raw':!![]})[_0x0314('0x22')](function(_0x458bd8){if(_0x458bd8&&_0x458bd8[_0x0314('0x49')]===0x0){return db['UserProfileResource'][_0x0314('0x43')]({'name':_0x20070c[_0x0314('0x37')],'resourceId':_0x20070c['id'],'type':_0x458bd8[_0x0314('0x37')],'sectionId':_0x458bd8['id']},{})['then'](function(){return _0x3003dd;});}else{return _0x3003dd;}})[_0x0314('0x3d')](function(_0x11695d){logger['error'](_0x0314('0x4a'),_0x11695d);throw _0x11695d;});}return _0x3003dd;})[_0x0314('0x22')](respondWithResult(_0x478b8b,0xc9))[_0x0314('0x3d')](handleError(_0x478b8b,null));};exports[_0x0314('0x21')]=function(_0x544a03,_0x39b4c1){if(_0x544a03[_0x0314('0x44')]['id']){delete _0x544a03[_0x0314('0x44')]['id'];}return db[_0x0314('0x2a')][_0x0314('0x42')]({'where':{'id':_0x544a03[_0x0314('0x4b')]['id']}})[_0x0314('0x22')](handleEntityNotFound(_0x39b4c1,null))[_0x0314('0x22')](saveUpdates(_0x544a03[_0x0314('0x44')],null))[_0x0314('0x22')](respondWithResult(_0x39b4c1,null))['catch'](handleError(_0x39b4c1,null));};exports[_0x0314('0x4c')]=function(_0x305568,_0xf29a33){return db[_0x0314('0x2a')][_0x0314('0x42')]({'where':{'id':_0x305568[_0x0314('0x4b')]['id']}})[_0x0314('0x22')](handleEntityNotFound(_0xf29a33,null))['then'](removeEntity(_0xf29a33,null))['catch'](handleError(_0xf29a33,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index bffcc28..b4d7eb9 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 _0xa321=['../../config/environment','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5124b6,_0x4af43c){var _0x43c76b=function(_0x29c6ba){while(--_0x29c6ba){_0x5124b6['push'](_0x5124b6['shift']());}};_0x43c76b(++_0x4af43c);}(_0xa321,0x101));var _0x1a32=function(_0x56f6c0,_0x37c097){_0x56f6c0=_0x56f6c0-0x0;var _0x249342=_0xa321[_0x56f6c0];return _0x249342;};'use strict';var _=require(_0x1a32('0x0'));var util=require(_0x1a32('0x1'));var logger=require(_0x1a32('0x2'))(_0x1a32('0x3'));var moment=require(_0x1a32('0x4'));var BPromise=require(_0x1a32('0x5'));var rp=require(_0x1a32('0x6'));var fs=require('fs');var path=require(_0x1a32('0x7'));var rimraf=require(_0x1a32('0x8'));var config=require(_0x1a32('0x9'));var attributes=require('./tag.attributes');module[_0x1a32('0xa')]=function(_0x6d2281,_0x1df3a0){return _0x6d2281[_0x1a32('0xb')](_0x1a32('0xc'),attributes,{'tableName':_0x1a32('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa12b=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./tag.attributes','define','tools_tags'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0xa12b,0xf0));var _0xba12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa12b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xba12('0x0'));var util=require('util');var logger=require(_0xba12('0x1'))(_0xba12('0x2'));var moment=require(_0xba12('0x3'));var BPromise=require('bluebird');var rp=require(_0xba12('0x4'));var fs=require('fs');var path=require(_0xba12('0x5'));var rimraf=require('rimraf');var config=require(_0xba12('0x6'));var attributes=require(_0xba12('0x7'));module['exports']=function(_0x13c13c,_0x1970dd){return _0x13c13c[_0xba12('0x8')]('Tag',attributes,{'tableName':_0xba12('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index a55711b..e10aa19 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 _0x9221=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x4ecdad,_0x25101e){var _0x187dab=function(_0x27bd8a){while(--_0x27bd8a){_0x4ecdad['push'](_0x4ecdad['shift']());}};_0x187dab(++_0x25101e);}(_0x9221,0x64));var _0x1922=function(_0x57e18a,_0x199383){_0x57e18a=_0x57e18a-0x0;var _0x1181c7=_0x9221[_0x57e18a];return _0x1181c7;};'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);});});} \ No newline at end of file +var _0xadb8=['Tag,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2a9b46,_0x5a7f1c){var _0x16bd08=function(_0x268cd8){while(--_0x268cd8){_0x2a9b46['push'](_0x2a9b46['shift']());}};_0x16bd08(++_0x5a7f1c);}(_0xadb8,0x1d0));var _0x8adb=function(_0x34b87f,_0x28aef2){_0x34b87f=_0x34b87f-0x0;var _0x449805=_0xadb8[_0x34b87f];return _0x449805;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8adb('0x0'));var BPromise=require('bluebird');var rs=require(_0x8adb('0x1'));var fs=require('fs');var Redis=require(_0x8adb('0x2'));var db=require(_0x8adb('0x3'))['db'];var utils=require(_0x8adb('0x4'));var logger=require(_0x8adb('0x5'))(_0x8adb('0x6'));var config=require(_0x8adb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8adb('0x8')][_0x8adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9f435,_0x2bebfe,_0x271bed){return new BPromise(function(_0x16b932,_0x27d994){return client['request'](_0x9f435,_0x271bed)['then'](function(_0x58ad1a){logger[_0x8adb('0xa')]('Tag,\x20%s,\x20%s',_0x2bebfe,'request\x20sent');logger['debug'](_0x8adb('0xb'),_0x2bebfe,_0x8adb('0xc'),JSON[_0x8adb('0xd')](_0x58ad1a));if(_0x58ad1a[_0x8adb('0xe')]){if(_0x58ad1a[_0x8adb('0xe')][_0x8adb('0xf')]===0x1f4){logger[_0x8adb('0xe')](_0x8adb('0x10'),_0x2bebfe,_0x58ad1a[_0x8adb('0xe')][_0x8adb('0x11')]);return _0x27d994(_0x58ad1a['error']['message']);}logger['error'](_0x8adb('0x10'),_0x2bebfe,_0x58ad1a['error'][_0x8adb('0x11')]);return _0x16b932(_0x58ad1a[_0x8adb('0xe')][_0x8adb('0x11')]);}else{logger['info'](_0x8adb('0x10'),_0x2bebfe,_0x8adb('0xc'));_0x16b932(_0x58ad1a[_0x8adb('0x12')][_0x8adb('0x11')]);}})[_0x8adb('0x13')](function(_0x13659c){logger['error'](_0x8adb('0x10'),_0x2bebfe,_0x13659c);_0x27d994(_0x13659c);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 37ccb79..4f0c088 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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 66849a9..2003c8c 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(_0x277220,_0x2a6b21){var _0x18a6b5=function(_0x523547){while(--_0x523547){_0x277220['push'](_0x277220['shift']());}};_0x18a6b5(++_0x2a6b21);}(_0xb10b,0x12a));var _0xbb10=function(_0x367bad,_0x1eea19){_0x367bad=_0x367bad-0x0;var _0x3a99d3=_0xb10b[_0x367bad];return _0x3a99d3;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x34a279,_0x4cc105){var _0x2cee7f=function(_0x4daad3){while(--_0x4daad3){_0x34a279['push'](_0x34a279['shift']());}};_0x2cee7f(++_0x4cc105);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 2fff722..4358c5e 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 _0x7051=['toLowerCase','Queue','addQueues','Unknown\x20channel','add','Queues','ids','removeQueues','addAgents','isArray','Voice','Chat','Mail','Fax','Openchannel','through','penalty','QueueId','TeamVoiceQueue','findOrCreate','emit','User','online','voicePause','UserVoiceQueueRt','isNil','interface','format','SIP/%s','all','upsert','spread','removeAgents','Sms','Whatsapp','getAgents','nolimit','eml-format','rimraf','zip-dir','request-promise','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','map','Team','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','SmsQueueId','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','end','send','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize'];(function(_0x23841f,_0x3f13ab){var _0x456f9a=function(_0x33d233){while(--_0x33d233){_0x23841f['push'](_0x23841f['shift']());}};_0x456f9a(++_0x3f13ab);}(_0x7051,0x1ed));var _0x1705=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x7051[_0x2642cb];return _0xe6e41;};'use strict';var emlformat=require(_0x1705('0x0'));var rimraf=require(_0x1705('0x1'));var zipdir=require(_0x1705('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1705('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1705('0x4'));var util=require('util');var path=require(_0x1705('0x5'));var sox=require('sox');var csv=require(_0x1705('0x6'));var ejs=require(_0x1705('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1705('0x8'));var squel=require(_0x1705('0x9'));var crypto=require(_0x1705('0xa'));var jsforce=require(_0x1705('0xb'));var deskjs=require(_0x1705('0xc'));var toCsv=require(_0x1705('0x6'));var querystring=require('querystring');var Papa=require(_0x1705('0xd'));var Redis=require(_0x1705('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1705('0xf'));var as=require(_0x1705('0x10'));var hardwareService=require(_0x1705('0x11'));var logger=require(_0x1705('0x12'))(_0x1705('0x13'));var utils=require('../../config/utils');var config=require(_0x1705('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1705('0x15'))['db'];config[_0x1705('0x16')]=_[_0x1705('0x17')](config[_0x1705('0x16')],{'host':_0x1705('0x18'),'port':0x18eb});var socket=require(_0x1705('0x19'))(new Redis(config[_0x1705('0x16')]));require(_0x1705('0x1a'))[_0x1705('0x1b')](socket);function respondWithStatusCode(_0x11e030,_0x43b041){_0x43b041=_0x43b041||0xcc;return function(_0x32d6a0){if(_0x32d6a0){return _0x11e030['sendStatus'](_0x43b041);}return _0x11e030[_0x1705('0x1c')](_0x43b041)['end']();};}function respondWithResult(_0x3c908b,_0x33034a){_0x33034a=_0x33034a||0xc8;return function(_0x11db26){if(_0x11db26){return _0x3c908b['status'](_0x33034a)[_0x1705('0x1d')](_0x11db26);}};}function respondWithFilteredResult(_0x5e9665,_0x120f92){return function(_0x24327d){if(_0x24327d){var _0x4d5ca0=typeof _0x120f92[_0x1705('0x1e')]===_0x1705('0x1f')&&typeof _0x120f92[_0x1705('0x20')]==='undefined';var _0x13ac9e=_0x24327d['count'];var _0x7b9369=_0x4d5ca0?0x0:_0x120f92[_0x1705('0x1e')];var _0x38683=_0x4d5ca0?_0x24327d['count']:_0x120f92[_0x1705('0x1e')]+_0x120f92[_0x1705('0x20')];var _0x4292bc;if(_0x38683>=_0x13ac9e){_0x38683=_0x13ac9e;_0x4292bc=0xc8;}else{_0x4292bc=0xce;}_0x5e9665[_0x1705('0x1c')](_0x4292bc);return _0x5e9665[_0x1705('0x21')](_0x1705('0x22'),_0x7b9369+'-'+_0x38683+'/'+_0x13ac9e)[_0x1705('0x1d')](_0x24327d);}return null;};}function patchUpdates(_0x4644e8){return function(_0x455da0){try{jsonpatch['apply'](_0x455da0,_0x4644e8,!![]);}catch(_0x204e2c){return BPromise[_0x1705('0x23')](_0x204e2c);}return _0x455da0[_0x1705('0x24')]();};}function saveUpdates(_0x5c5fa9,_0xd68c9c){return function(_0x969960){if(_0x969960){return _0x969960[_0x1705('0x25')](_0x5c5fa9)[_0x1705('0x26')](function(_0x3ce7e2){return _0x3ce7e2;});}return null;};}function handleEntityNotFound(_0x2b55eb,_0x45493d){return function(_0x5cc17c){if(!_0x5cc17c){_0x2b55eb[_0x1705('0x27')](0x194);}return _0x5cc17c;};}function handleError(_0x384121,_0x33e400){_0x33e400=_0x33e400||0x1f4;return function(_0x56d9af){logger[_0x1705('0x28')](_0x56d9af[_0x1705('0x29')]);if(_0x56d9af[_0x1705('0x2a')]){delete _0x56d9af[_0x1705('0x2a')];}_0x384121[_0x1705('0x1c')](_0x33e400)['send'](_0x56d9af);};}exports['index']=function(_0x36ed5d,_0x1a1527){var _0x309090={},_0x32e0c9={},_0x285b0d={'count':0x0,'rows':[]};var _0xee6658=_[_0x1705('0x2b')](db[_0x1705('0x2c')][_0x1705('0x2d')],function(_0x438a66){return{'name':_0x438a66['fieldName'],'type':_0x438a66['type']['key']};});_0x32e0c9[_0x1705('0x2e')]=_[_0x1705('0x2b')](_0xee6658,_0x1705('0x2a'));_0x32e0c9['query']=_['keys'](_0x36ed5d[_0x1705('0x2f')]);_0x32e0c9[_0x1705('0x30')]=_['intersection'](_0x32e0c9[_0x1705('0x2e')],_0x32e0c9[_0x1705('0x2f')]);_0x309090['attributes']=_[_0x1705('0x31')](_0x32e0c9[_0x1705('0x2e')],qs[_0x1705('0x32')](_0x36ed5d['query'][_0x1705('0x32')]));_0x309090[_0x1705('0x33')]=_0x309090[_0x1705('0x33')][_0x1705('0x34')]?_0x309090[_0x1705('0x33')]:_0x32e0c9['model'];if(!_0x36ed5d[_0x1705('0x2f')][_0x1705('0x35')]('nolimit')){_0x309090[_0x1705('0x20')]=qs[_0x1705('0x20')](_0x36ed5d[_0x1705('0x2f')]['limit']);_0x309090['offset']=qs[_0x1705('0x1e')](_0x36ed5d[_0x1705('0x2f')][_0x1705('0x1e')]);}_0x309090[_0x1705('0x36')]=qs[_0x1705('0x37')](_0x36ed5d[_0x1705('0x2f')][_0x1705('0x37')]);_0x309090[_0x1705('0x38')]=qs[_0x1705('0x30')](_[_0x1705('0x39')](_0x36ed5d[_0x1705('0x2f')],_0x32e0c9[_0x1705('0x30')]),_0xee6658);if(_0x36ed5d[_0x1705('0x2f')][_0x1705('0x3a')]){_0x309090[_0x1705('0x38')]=_[_0x1705('0x3b')](_0x309090[_0x1705('0x38')],{'$or':_[_0x1705('0x2b')](_0xee6658,function(_0x89623f){if(_0x89623f[_0x1705('0x3c')]!==_0x1705('0x3d')){var _0x4f8eef={};_0x4f8eef[_0x89623f[_0x1705('0x2a')]]={'$like':'%'+_0x36ed5d[_0x1705('0x2f')][_0x1705('0x3a')]+'%'};return _0x4f8eef;}})});}_0x309090=_[_0x1705('0x3b')]({},_0x309090,_0x36ed5d[_0x1705('0x3e')]);var _0xa60dea={'where':_0x309090[_0x1705('0x38')]};return db[_0x1705('0x2c')][_0x1705('0x3f')](_0xa60dea)[_0x1705('0x26')](function(_0x4f3f68){_0x285b0d['count']=_0x4f3f68;if(_0x36ed5d[_0x1705('0x2f')][_0x1705('0x40')]){_0x309090[_0x1705('0x41')]=[{'all':!![]}];}return db['Team'][_0x1705('0x42')](_0x309090);})['then'](function(_0x967a29){_0x285b0d[_0x1705('0x43')]=_0x967a29;return _0x285b0d;})[_0x1705('0x26')](respondWithFilteredResult(_0x1a1527,_0x309090))[_0x1705('0x44')](handleError(_0x1a1527,null));};exports[_0x1705('0x45')]=function(_0x33c8ba,_0x5d81c0){var _0x25fb8a={'raw':![],'where':{'id':_0x33c8ba[_0x1705('0x46')]['id']}},_0x3ac253={};_0x3ac253[_0x1705('0x2e')]=_[_0x1705('0x47')](db['Team'][_0x1705('0x2d')]);_0x3ac253[_0x1705('0x2f')]=_['keys'](_0x33c8ba[_0x1705('0x2f')]);_0x3ac253[_0x1705('0x30')]=_[_0x1705('0x31')](_0x3ac253[_0x1705('0x2e')],_0x3ac253[_0x1705('0x2f')]);_0x25fb8a[_0x1705('0x33')]=_[_0x1705('0x31')](_0x3ac253[_0x1705('0x2e')],qs[_0x1705('0x32')](_0x33c8ba[_0x1705('0x2f')][_0x1705('0x32')]));_0x25fb8a[_0x1705('0x33')]=_0x25fb8a[_0x1705('0x33')]['length']?_0x25fb8a[_0x1705('0x33')]:_0x3ac253['model'];if(_0x33c8ba['query']['includeAll']){_0x25fb8a[_0x1705('0x41')]=[{'all':!![]}];}_0x25fb8a=_[_0x1705('0x3b')]({},_0x25fb8a,_0x33c8ba[_0x1705('0x3e')]);return db[_0x1705('0x2c')][_0x1705('0x48')](_0x25fb8a)[_0x1705('0x26')](handleEntityNotFound(_0x5d81c0,null))[_0x1705('0x26')](respondWithResult(_0x5d81c0,null))[_0x1705('0x44')](handleError(_0x5d81c0,null));};exports[_0x1705('0x49')]=function(_0x34bd0b,_0x1e8e74){return db[_0x1705('0x2c')]['create'](_0x34bd0b[_0x1705('0x4a')],{})[_0x1705('0x26')](function(_0x5b10c1){var _0x31dded=_0x34bd0b[_0x1705('0x4b')]['get']({'plain':!![]});if(!_0x31dded)throw new Error(_0x1705('0x4c'));if(_0x31dded[_0x1705('0x4d')]===_0x1705('0x4b')){var _0x1bf327=_0x5b10c1[_0x1705('0x4e')]({'plain':!![]});var _0x224022=_0x1705('0x4f');return db[_0x1705('0x50')][_0x1705('0x48')]({'where':{'name':_0x224022,'userProfileId':_0x31dded[_0x1705('0x51')]},'raw':!![]})[_0x1705('0x26')](function(_0x50170b){if(_0x50170b&&_0x50170b[_0x1705('0x52')]===0x0){return db[_0x1705('0x53')][_0x1705('0x49')]({'name':_0x1bf327['name'],'resourceId':_0x1bf327['id'],'type':_0x50170b[_0x1705('0x2a')],'sectionId':_0x50170b['id']},{})['then'](function(){return _0x5b10c1;});}else{return _0x5b10c1;}})[_0x1705('0x44')](function(_0x404f13){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x404f13);throw _0x404f13;});}return _0x5b10c1;})[_0x1705('0x26')](respondWithResult(_0x1e8e74,0xc9))[_0x1705('0x44')](handleError(_0x1e8e74,null));};exports['update']=function(_0x281a29,_0x21dbdb){if(_0x281a29[_0x1705('0x4a')]['id']){delete _0x281a29[_0x1705('0x4a')]['id'];}return db[_0x1705('0x2c')][_0x1705('0x48')]({'where':{'id':_0x281a29[_0x1705('0x46')]['id']}})['then'](handleEntityNotFound(_0x21dbdb,null))[_0x1705('0x26')](saveUpdates(_0x281a29[_0x1705('0x4a')],null))[_0x1705('0x26')](respondWithResult(_0x21dbdb,null))[_0x1705('0x44')](handleError(_0x21dbdb,null));};exports[_0x1705('0x54')]=function(_0x37698e,_0x5c1a45){var _0x125164=_0x37698e[_0x1705('0x46')]['id'];var _0x115f20=[];return db[_0x1705('0x55')][_0x1705('0x56')](function(_0x2d01b9){var _0x610228=_0x1705('0x57')+_0x125164;return db['sequelize'][_0x1705('0x2f')](_0x610228,{'type':db[_0x1705('0x58')][_0x1705('0x59')]['SELECT'],'raw':!![],'transaction':_0x2d01b9})[_0x1705('0x26')](function(_0xe84d62){_0x115f20=_[_0x1705('0x2b')](_0xe84d62,function(_0x17378b){return Number(_0x17378b[_0x1705('0x5a')]);});})[_0x1705('0x26')](function(){var _0x2c0bdd=_0x1705('0x5b')+_0x125164;return db['sequelize'][_0x1705('0x2f')](_0x2c0bdd,{'type':db['Sequelize'][_0x1705('0x59')][_0x1705('0x5c')],'raw':!![],'transaction':_0x2d01b9});})[_0x1705('0x26')](function(_0x256a8f){var _0x54b057=_[_0x1705('0x2b')](_0x256a8f,function(_0x7511c8){return Number(_0x7511c8[_0x1705('0x5d')]);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x115f20},'VoiceQueueId':{'$in':_0x54b057}},'transaction':_0x2d01b9});})[_0x1705('0x26')](function(){var _0x4bfc63='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x125164;return db[_0x1705('0x55')][_0x1705('0x2f')](_0x4bfc63,{'type':db[_0x1705('0x58')][_0x1705('0x59')][_0x1705('0x5c')],'raw':!![],'transaction':_0x2d01b9});})[_0x1705('0x26')](function(_0x7eaf7d){var _0x45910d=_[_0x1705('0x2b')](_0x7eaf7d,function(_0x15d3ab){return Number(_0x15d3ab['MailQueueId']);});return db['UserMailQueue'][_0x1705('0x54')]({'where':{'UserId':{'$in':_0x115f20},'MailQueueId':{'$in':_0x45910d}},'transaction':_0x2d01b9});})['then'](function(){var _0xf53e19='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x125164;return db[_0x1705('0x55')]['query'](_0xf53e19,{'type':db[_0x1705('0x58')][_0x1705('0x59')][_0x1705('0x5c')],'raw':!![],'transaction':_0x2d01b9});})[_0x1705('0x26')](function(_0x44a719){var _0x23b30f=_[_0x1705('0x2b')](_0x44a719,function(_0x3b1f8f){return Number(_0x3b1f8f[_0x1705('0x5e')]);});return db['UserSmsQueue'][_0x1705('0x54')]({'where':{'UserId':{'$in':_0x115f20},'SmsQueueId':{'$in':_0x23b30f}},'transaction':_0x2d01b9});})['then'](function(){var _0x174d2d='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x125164;return db[_0x1705('0x55')][_0x1705('0x2f')](_0x174d2d,{'type':db[_0x1705('0x58')][_0x1705('0x59')][_0x1705('0x5c')],'raw':!![],'transaction':_0x2d01b9});})[_0x1705('0x26')](function(_0x312ef3){var _0x11d103=_[_0x1705('0x2b')](_0x312ef3,function(_0x10ab70){return Number(_0x10ab70[_0x1705('0x5f')]);});return db['UserChatQueue']['destroy']({'where':{'UserId':{'$in':_0x115f20},'ChatQueueId':{'$in':_0x11d103}},'transaction':_0x2d01b9});})[_0x1705('0x26')](function(){var _0x34229e=_0x1705('0x60')+_0x125164;return db[_0x1705('0x55')]['query'](_0x34229e,{'type':db['Sequelize'][_0x1705('0x59')]['SELECT'],'raw':!![],'transaction':_0x2d01b9});})[_0x1705('0x26')](function(_0xc26ce3){var _0xc4f4e2=_[_0x1705('0x2b')](_0xc26ce3,function(_0xb58db0){return Number(_0xb58db0[_0x1705('0x61')]);});return db[_0x1705('0x62')][_0x1705('0x54')]({'where':{'UserId':{'$in':_0x115f20},'FaxQueueId':{'$in':_0xc4f4e2}},'transaction':_0x2d01b9});})['then'](function(){var _0x5568e9=_0x1705('0x63')+_0x125164;return db['sequelize'][_0x1705('0x2f')](_0x5568e9,{'type':db[_0x1705('0x58')][_0x1705('0x59')]['SELECT'],'raw':!![],'transaction':_0x2d01b9});})[_0x1705('0x26')](function(_0x2f5b13){var _0xe9372a=_['map'](_0x2f5b13,function(_0x33f578){return Number(_0x33f578['OpenchannelQueueId']);});return db[_0x1705('0x64')]['destroy']({'where':{'UserId':{'$in':_0x115f20},'OpenchannelQueueId':{'$in':_0xe9372a}},'transaction':_0x2d01b9});})[_0x1705('0x26')](function(){var _0x4674d9=_0x1705('0x65')+_0x125164;return db[_0x1705('0x55')][_0x1705('0x2f')](_0x4674d9,{'type':db[_0x1705('0x58')][_0x1705('0x59')][_0x1705('0x5c')],'raw':!![],'transaction':_0x2d01b9});})[_0x1705('0x26')](function(_0x4b20a3){var _0x234aec=_[_0x1705('0x2b')](_0x4b20a3,function(_0x26c3c6){return Number(_0x26c3c6[_0x1705('0x66')]);});return db[_0x1705('0x67')]['destroy']({'where':{'UserId':{'$in':_0x115f20},'WhatsappQueueId':{'$in':_0x234aec}},'transaction':_0x2d01b9});})[_0x1705('0x26')](function(){return db[_0x1705('0x68')][_0x1705('0x48')]({'where':{'TeamId':_0x125164}});})[_0x1705('0x26')](function(_0x54a1be){if(_0x54a1be===null){return;}return db[_0x1705('0x69')][_0x1705('0x54')]({'where':{'UserId':{'$in':_0x115f20},'VoicePrefixId':_0x54a1be[_0x1705('0x6a')]},'transaction':_0x2d01b9});})[_0x1705('0x26')](function(){return db[_0x1705('0x2c')][_0x1705('0x54')]({'where':{'id':_0x125164},'cascade':!![],'transaction':_0x2d01b9});})['then'](function(_0x56e307){if(_0x56e307===0x0){_0x5c1a45['sendStatus'](0x194);}else{return db[_0x1705('0x53')][_0x1705('0x54')]({'where':{'type':'Teams','resourceId':_0x125164},'cascade':!![],'transaction':_0x2d01b9})[_0x1705('0x26')](function(){_0x5c1a45['status'](0xcc)[_0x1705('0x6b')]();});}})['catch'](function(_0x36f3a6){_0x5c1a45[_0x1705('0x1c')](0x1f4)[_0x1705('0x6c')](_0x36f3a6);});});};exports[_0x1705('0x6d')]=function(_0x277655,_0x2c6317,_0x3d6412){return db['Team'][_0x1705('0x6e')]({'where':{'id':_0x277655[_0x1705('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c6317,null))[_0x1705('0x26')](function(_0x34119f){if(!_0x277655[_0x1705('0x2f')][_0x1705('0x6f')]||!utils[_0x1705('0x70')](_0x277655[_0x1705('0x2f')][_0x1705('0x6f')])){throw new db[(_0x1705('0x58'))][(_0x1705('0x71'))]('Unknown\x20channel');}var _0x382d81={};var _0x57984b={};_0x57984b['model']=_[_0x1705('0x47')](db[_[_0x1705('0x72')](_0x277655['query'][_0x1705('0x6f')][_0x1705('0x73')]())+_0x1705('0x74')][_0x1705('0x2d')]);_0x57984b[_0x1705('0x2f')]=_['keys'](_0x277655[_0x1705('0x2f')]);_0x57984b['filters']=_[_0x1705('0x31')](_0x57984b[_0x1705('0x2e')],_0x57984b[_0x1705('0x2f')]);_0x382d81[_0x1705('0x33')]=_[_0x1705('0x31')](_0x57984b[_0x1705('0x2e')],qs['fields'](_0x277655['query'][_0x1705('0x32')]));_0x382d81['attributes']=_0x382d81[_0x1705('0x33')]['length']?_0x382d81[_0x1705('0x33')]:_0x57984b['model'];_0x382d81[_0x1705('0x20')]=qs['limit'](_0x277655[_0x1705('0x2f')][_0x1705('0x20')]);_0x382d81['offset']=qs[_0x1705('0x1e')](_0x277655['query'][_0x1705('0x1e')]);_0x382d81[_0x1705('0x36')]=qs[_0x1705('0x37')](_0x277655[_0x1705('0x2f')][_0x1705('0x37')]);_0x382d81['where']=qs[_0x1705('0x30')](_[_0x1705('0x39')](_0x277655[_0x1705('0x2f')],_0x57984b[_0x1705('0x30')]));_0x382d81=_[_0x1705('0x3b')]({},_0x382d81,_0x277655[_0x1705('0x3e')]);return _0x34119f[_0x1705('0x4e')+_[_0x1705('0x72')](_0x277655[_0x1705('0x2f')][_0x1705('0x6f')][_0x1705('0x73')]())+'Queues'](_0x382d81);})[_0x1705('0x26')](respondWithResult(_0x2c6317,null))['catch'](handleError(_0x2c6317,null));};exports[_0x1705('0x75')]=function(_0x3cc04a,_0x2ad951,_0x4e63ff){return db[_0x1705('0x2c')]['findOne']({'where':{'id':_0x3cc04a[_0x1705('0x46')]['id']}})[_0x1705('0x26')](function(_0x51922a){if(_0x51922a){if(!_0x3cc04a[_0x1705('0x4a')][_0x1705('0x6f')]||!utils['isValidChannel'](_0x3cc04a['body'][_0x1705('0x6f')])){throw new db[(_0x1705('0x58'))][(_0x1705('0x71'))](_0x1705('0x76'));}return _0x51922a[_0x1705('0x77')+_[_0x1705('0x72')](_0x3cc04a[_0x1705('0x4a')]['channel'][_0x1705('0x73')]())+_0x1705('0x78')](_0x3cc04a[_0x1705('0x4a')][_0x1705('0x79')]);}return null;})[_0x1705('0x26')](handleEntityNotFound(_0x2ad951,null))[_0x1705('0x26')](respondWithStatusCode(_0x2ad951,null))[_0x1705('0x44')](handleError(_0x2ad951,null));};exports[_0x1705('0x7a')]=function(_0x4f7a49,_0x4b43e6,_0xd1587a){return db[_0x1705('0x2c')]['findOne']({'where':{'id':_0x4f7a49['params']['id']}})[_0x1705('0x26')](function(_0x3d73df){if(_0x3d73df){if(!_0x4f7a49[_0x1705('0x2f')][_0x1705('0x6f')]||!utils[_0x1705('0x70')](_0x4f7a49['query'][_0x1705('0x6f')])){throw new db['Sequelize'][(_0x1705('0x71'))](_0x1705('0x76'));}return _0x3d73df['remove'+_[_0x1705('0x72')](_0x4f7a49[_0x1705('0x2f')][_0x1705('0x6f')][_0x1705('0x73')]())+_0x1705('0x78')](_0x4f7a49[_0x1705('0x2f')][_0x1705('0x79')]);}return null;})[_0x1705('0x26')](handleEntityNotFound(_0x4b43e6,null))[_0x1705('0x26')](respondWithStatusCode(_0x4b43e6,null))[_0x1705('0x44')](handleError(_0x4b43e6,null));};exports[_0x1705('0x7b')]=function(_0x4c7bd0,_0x370490){var _0xfa26b4=_[_0x1705('0x7c')](_0x4c7bd0[_0x1705('0x4a')][_0x1705('0x79')])?_0x4c7bd0['body'][_0x1705('0x79')]:[_0x4c7bd0['body'][_0x1705('0x79')]];var _0x156ed7=_0x4c7bd0[_0x1705('0x46')]['id'];return db['Team']['find']({'where':{'id':_0x156ed7}})[_0x1705('0x26')](handleEntityNotFound(_0x370490,null))[_0x1705('0x26')](function(_0x8520e){if(_0x8520e){var _0x7d6f85=[_0x1705('0x7d'),_0x1705('0x7e'),_0x1705('0x7f'),'Sms',_0x1705('0x80'),_0x1705('0x81'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x209be6){var _0xb19217=_[_0x1705('0x2b')](_0x7d6f85,function(_0x3f867a){var _0x557e26={'attributes':['id','name']};if(_0x3f867a===_0x1705('0x7d')){_0x557e26[_0x1705('0x82')]={'attributes':[_0x1705('0x83')]};}return _0x8520e[_0x1705('0x4e')+_0x3f867a+_0x1705('0x78')](_0x557e26)[_0x1705('0x26')](function(_0x495b43){var _0x5f3214=_['map'](_0x495b43,function(_0x4b4fdb){var _0x569a64=_['map'](_0xfa26b4,function(_0x33c10a){var _0x214aa9={'where':{'UserId':_0x33c10a,[_0x3f867a+_0x1705('0x84')]:_0x4b4fdb['id']},'transaction':_0x209be6};if(_0x3f867a===_0x1705('0x7d')){_0x214aa9[_0x1705('0x17')]={'penalty':_0x4b4fdb[_0x1705('0x85')][_0x1705('0x83')]};}return db['User'+_0x3f867a+'Queue'][_0x1705('0x86')](_0x214aa9)[_0x1705('0x26')](function(){socket[_0x1705('0x87')](_0x1705('0x4b')+_0x3f867a+'Queue:save',{'UserId':_0x33c10a,[_0x3f867a+_0x1705('0x84')]:_0x4b4fdb['id']});if(_0x3f867a!==_0x1705('0x7d')){return;}return db[_0x1705('0x88')][_0x1705('0x42')]({'where':{'id':_0xfa26b4,'online':0x1},'attributes':['id',_0x1705('0x2a'),_0x1705('0x89'),_0x1705('0x8a'),'interface'],'raw':!![]})[_0x1705('0x26')](function(_0x42947d){var _0x557b3b=_[_0x1705('0x2b')](_0x42947d,function(_0x25b9eb){return db[_0x1705('0x8b')]['upsert']({'membername':_0x25b9eb[_0x1705('0x2a')],'UserId':_0x25b9eb['id'],'queue_name':_0x4b4fdb[_0x1705('0x2a')],'VoiceQueueId':_0x4b4fdb['id'],'interface':_[_0x1705('0x8c')](_0x25b9eb[_0x1705('0x8d')])?util[_0x1705('0x8e')](_0x1705('0x8f'),_0x25b9eb[_0x1705('0x2a')]):_0x25b9eb[_0x1705('0x8d')],'paused':_0x25b9eb[_0x1705('0x8a')]||![],'penalty':_0x4b4fdb[_0x1705('0x85')][_0x1705('0x83')]},{'transaction':_0x209be6});});return Promise[_0x1705('0x90')](_0x557b3b);});});});return Promise[_0x1705('0x90')](_0x569a64);});return Promise['all'](_0x5f3214);})[_0x1705('0x26')](function(){return db[_0x1705('0x68')][_0x1705('0x6e')]({'where':{'teamId':_0x156ed7}})[_0x1705('0x26')](function(_0x5b79d6){if(_0x5b79d6){var _0x26aced=_['map'](_0xfa26b4,function(_0x48548c){db[_0x1705('0x69')][_0x1705('0x91')]({'UserId':_0x48548c,'VoicePrefixId':_0x5b79d6[_0x1705('0x6a')]});});return Promise['all'](_0x26aced);}});});});return Promise[_0x1705('0x90')](_0xb19217)[_0x1705('0x26')](function(){return _0x8520e[_0x1705('0x7b')](_0xfa26b4,{'transaction':_0x209be6})[_0x1705('0x92')](function(_0x5baae7){return _0x5baae7;});});});}})[_0x1705('0x26')](respondWithResult(_0x370490,null))[_0x1705('0x44')](handleError(_0x370490,null));};exports[_0x1705('0x93')]=function(_0x1bb53f,_0x4ffbb8){var _0x57ba5e=_[_0x1705('0x7c')](_0x1bb53f[_0x1705('0x2f')]['ids'])?_0x1bb53f[_0x1705('0x2f')][_0x1705('0x79')]:[_0x1bb53f[_0x1705('0x2f')][_0x1705('0x79')]];var _0x585449=_0x1bb53f['params']['id'];return db[_0x1705('0x2c')][_0x1705('0x48')]({'where':{'id':_0x585449}})['then'](handleEntityNotFound(_0x4ffbb8,null))[_0x1705('0x26')](function(_0x340311){if(_0x340311){var _0x51b0f9=[_0x1705('0x7d'),_0x1705('0x7e'),'Mail',_0x1705('0x94'),_0x1705('0x80'),'Openchannel',_0x1705('0x95')];return db[_0x1705('0x55')]['transaction'](function(_0x21f4e6){var _0x5e532f=_[_0x1705('0x2b')](_0x51b0f9,function(_0xd9557c){var _0x42ca60={'attributes':['id','name']};return _0x340311[_0x1705('0x4e')+_0xd9557c+_0x1705('0x78')](_0x42ca60)[_0x1705('0x26')](function(_0xcd29e6){var _0xaec2cb=_['map'](_0xcd29e6,function(_0x1af3bc){return _0x1af3bc[_0x1705('0x93')](_0x57ba5e,{'transaction':_0x21f4e6})[_0x1705('0x26')](function(){var _0x404b34=_['map'](_0x57ba5e,function(_0x27b218){socket[_0x1705('0x87')](_0x1705('0x4b')+_0xd9557c+'Queue:remove',{'UserId':Number(_0x27b218),[_0xd9557c+_0x1705('0x84')]:_0x1af3bc['id']});if(_0xd9557c!==_0x1705('0x7d')){return;}return db['UserVoiceQueueRt'][_0x1705('0x54')]({'where':{'VoiceQueueId':_0x1af3bc['id'],'UserId':_0x27b218},'transaction':_0x21f4e6});});return Promise[_0x1705('0x90')](_0x404b34);});});return Promise[_0x1705('0x90')](_0xaec2cb);});});return Promise[_0x1705('0x90')](_0x5e532f)['then'](function(){return _0x340311[_0x1705('0x93')](_0x57ba5e,{'transaction':_0x21f4e6});})['then'](function(){return db[_0x1705('0x68')][_0x1705('0x6e')]({'where':{'teamId':_0x585449}})[_0x1705('0x26')](function(_0x445955){if(_0x445955){var _0x12c795=_['map'](_0x57ba5e,function(_0x1a015e){db[_0x1705('0x69')][_0x1705('0x54')]({'where':{'UserId':_0x1a015e,'VoicePrefixId':_0x445955[_0x1705('0x6a')]}});});return Promise['all'](_0x12c795);}});});});}})[_0x1705('0x26')](respondWithStatusCode(_0x4ffbb8,null))['catch'](handleError(_0x4ffbb8,null));};exports['getAgents']=function(_0x873670,_0x51dc56,_0xb76bd0){var _0x1b2c20={};var _0x57f2fc={};var _0x59ac65;var _0x1c1c01;return db[_0x1705('0x2c')]['findOne']({'where':{'id':_0x873670['params']['id']}})[_0x1705('0x26')](handleEntityNotFound(_0x51dc56,null))[_0x1705('0x26')](function(_0x4c795e){if(_0x4c795e){_0x59ac65=_0x4c795e;_0x57f2fc[_0x1705('0x2e')]=_[_0x1705('0x47')](db[_0x1705('0x88')][_0x1705('0x2d')]);_0x57f2fc[_0x1705('0x2f')]=_['keys'](_0x873670['query']);_0x57f2fc[_0x1705('0x30')]=_['intersection'](_0x57f2fc[_0x1705('0x2e')],_0x57f2fc['query']);_0x1b2c20['attributes']=_[_0x1705('0x31')](_0x57f2fc[_0x1705('0x2e')],qs['fields'](_0x873670[_0x1705('0x2f')][_0x1705('0x32')]));_0x1b2c20[_0x1705('0x33')]=_0x1b2c20['attributes']['length']?_0x1b2c20[_0x1705('0x33')]:_0x57f2fc[_0x1705('0x2e')];_0x1b2c20[_0x1705('0x36')]=qs[_0x1705('0x37')](_0x873670[_0x1705('0x2f')][_0x1705('0x37')]);_0x1b2c20[_0x1705('0x38')]=qs['filters'](_[_0x1705('0x39')](_0x873670[_0x1705('0x2f')],_0x57f2fc['filters']));if(_0x873670[_0x1705('0x2f')][_0x1705('0x3a')]){_0x1b2c20[_0x1705('0x38')]=_[_0x1705('0x3b')](_0x1b2c20[_0x1705('0x38')],{'$or':_[_0x1705('0x2b')](_0x1b2c20[_0x1705('0x33')],function(_0x115290){var _0x15ab40={};_0x15ab40[_0x115290]={'$like':'%'+_0x873670[_0x1705('0x2f')][_0x1705('0x3a')]+'%'};return _0x15ab40;})});}_0x1b2c20=_[_0x1705('0x3b')]({},_0x1b2c20,_0x873670[_0x1705('0x3e')]);return _0x59ac65[_0x1705('0x96')](_0x1b2c20);}})[_0x1705('0x26')](function(_0x4cc3e7){if(_0x4cc3e7){_0x1c1c01=_0x4cc3e7[_0x1705('0x34')];if(!_0x873670[_0x1705('0x2f')]['hasOwnProperty'](_0x1705('0x97'))){_0x1b2c20[_0x1705('0x20')]=qs[_0x1705('0x20')](_0x873670[_0x1705('0x2f')][_0x1705('0x20')]);_0x1b2c20[_0x1705('0x1e')]=qs[_0x1705('0x1e')](_0x873670[_0x1705('0x2f')][_0x1705('0x1e')]);}return _0x59ac65[_0x1705('0x96')](_0x1b2c20);}})[_0x1705('0x26')](function(_0xcb5ed){if(_0xcb5ed){return _0xcb5ed?{'count':_0x1c1c01,'rows':_0xcb5ed}:null;}})[_0x1705('0x26')](respondWithResult(_0x51dc56,null))[_0x1705('0x44')](handleError(_0x51dc56,null));}; \ No newline at end of file +var _0x1561=['offset','undefined','limit','count','Content-Range','apply','save','update','error','stack','name','send','index','map','Team','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','TeamVoicePrefix','UserVoicePrefix','end','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','toLowerCase','Queue','ValidationError','add','capitalize','Queues','ids','remove','addAgents','isArray','Voice','Sms','Fax','through','penalty','TeamVoiceQueue','User','emit','Queue:save','QueueId','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','spread','removeAgents','Chat','Whatsapp','Queue:remove','VoicePrefixId','getAgents','length','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','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/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json'];(function(_0x4b7f28,_0x27d23a){var _0xf5b553=function(_0x1cb9c1){while(--_0x1cb9c1){_0x4b7f28['push'](_0x4b7f28['shift']());}};_0xf5b553(++_0x27d23a);}(_0x1561,0x110));var _0x1156=function(_0x1307b5,_0x551a84){_0x1307b5=_0x1307b5-0x0;var _0x256d68=_0x1561[_0x1307b5];return _0x256d68;};'use strict';var emlformat=require(_0x1156('0x0'));var rimraf=require(_0x1156('0x1'));var zipdir=require(_0x1156('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1156('0x3'));var moment=require(_0x1156('0x4'));var BPromise=require(_0x1156('0x5'));var Mustache=require(_0x1156('0x6'));var util=require('util');var path=require(_0x1156('0x7'));var sox=require('sox');var csv=require(_0x1156('0x8'));var ejs=require(_0x1156('0x9'));var fs=require('fs');var fs_extra=require(_0x1156('0xa'));var _=require(_0x1156('0xb'));var squel=require(_0x1156('0xc'));var crypto=require(_0x1156('0xd'));var jsforce=require(_0x1156('0xe'));var deskjs=require(_0x1156('0xf'));var toCsv=require(_0x1156('0x8'));var querystring=require(_0x1156('0x10'));var Papa=require('papaparse');var Redis=require(_0x1156('0x11'));var authService=require(_0x1156('0x12'));var qs=require(_0x1156('0x13'));var as=require(_0x1156('0x14'));var hardwareService=require(_0x1156('0x15'));var logger=require(_0x1156('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x1156('0x17'));var licenseUtil=require(_0x1156('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1156('0x19')](config[_0x1156('0x1a')],{'host':_0x1156('0x1b'),'port':0x18eb});var socket=require(_0x1156('0x1c'))(new Redis(config[_0x1156('0x1a')]));require(_0x1156('0x1d'))[_0x1156('0x1e')](socket);function respondWithStatusCode(_0xbca596,_0x344771){_0x344771=_0x344771||0xcc;return function(_0x402e13){if(_0x402e13){return _0xbca596[_0x1156('0x1f')](_0x344771);}return _0xbca596[_0x1156('0x20')](_0x344771)['end']();};}function respondWithResult(_0x33bab9,_0x4cd465){_0x4cd465=_0x4cd465||0xc8;return function(_0x133200){if(_0x133200){return _0x33bab9['status'](_0x4cd465)[_0x1156('0x21')](_0x133200);}};}function respondWithFilteredResult(_0x3cdb16,_0x3bcf5e){return function(_0x3d00b1){if(_0x3d00b1){var _0x4750c6=typeof _0x3bcf5e[_0x1156('0x22')]===_0x1156('0x23')&&typeof _0x3bcf5e[_0x1156('0x24')]===_0x1156('0x23');var _0x287415=_0x3d00b1[_0x1156('0x25')];var _0x5d8680=_0x4750c6?0x0:_0x3bcf5e['offset'];var _0x10f388=_0x4750c6?_0x3d00b1['count']:_0x3bcf5e[_0x1156('0x22')]+_0x3bcf5e['limit'];var _0x38e836;if(_0x10f388>=_0x287415){_0x10f388=_0x287415;_0x38e836=0xc8;}else{_0x38e836=0xce;}_0x3cdb16['status'](_0x38e836);return _0x3cdb16['set'](_0x1156('0x26'),_0x5d8680+'-'+_0x10f388+'/'+_0x287415)['json'](_0x3d00b1);}return null;};}function patchUpdates(_0x5135ce){return function(_0x7d4eed){try{jsonpatch[_0x1156('0x27')](_0x7d4eed,_0x5135ce,!![]);}catch(_0x193409){return BPromise['reject'](_0x193409);}return _0x7d4eed[_0x1156('0x28')]();};}function saveUpdates(_0x2393a8,_0x53344b){return function(_0x4cac29){if(_0x4cac29){return _0x4cac29[_0x1156('0x29')](_0x2393a8)['then'](function(_0x460e54){return _0x460e54;});}return null;};}function handleEntityNotFound(_0x176285,_0x3d5337){return function(_0x2c9639){if(!_0x2c9639){_0x176285[_0x1156('0x1f')](0x194);}return _0x2c9639;};}function handleError(_0x233654,_0x40146d){_0x40146d=_0x40146d||0x1f4;return function(_0x4ff435){logger[_0x1156('0x2a')](_0x4ff435[_0x1156('0x2b')]);if(_0x4ff435[_0x1156('0x2c')]){delete _0x4ff435[_0x1156('0x2c')];}_0x233654[_0x1156('0x20')](_0x40146d)[_0x1156('0x2d')](_0x4ff435);};}exports[_0x1156('0x2e')]=function(_0x3ecfcd,_0x42d656){var _0x42dfea={},_0x46607d={},_0x1913f9={'count':0x0,'rows':[]};var _0x52120a=_[_0x1156('0x2f')](db[_0x1156('0x30')][_0x1156('0x31')],function(_0x4221e2){return{'name':_0x4221e2['fieldName'],'type':_0x4221e2[_0x1156('0x32')][_0x1156('0x33')]};});_0x46607d[_0x1156('0x34')]=_[_0x1156('0x2f')](_0x52120a,'name');_0x46607d[_0x1156('0x35')]=_[_0x1156('0x36')](_0x3ecfcd[_0x1156('0x35')]);_0x46607d['filters']=_[_0x1156('0x37')](_0x46607d[_0x1156('0x34')],_0x46607d['query']);_0x42dfea[_0x1156('0x38')]=_[_0x1156('0x37')](_0x46607d['model'],qs['fields'](_0x3ecfcd['query'][_0x1156('0x39')]));_0x42dfea[_0x1156('0x38')]=_0x42dfea[_0x1156('0x38')]['length']?_0x42dfea['attributes']:_0x46607d[_0x1156('0x34')];if(!_0x3ecfcd[_0x1156('0x35')][_0x1156('0x3a')](_0x1156('0x3b'))){_0x42dfea[_0x1156('0x24')]=qs[_0x1156('0x24')](_0x3ecfcd['query'][_0x1156('0x24')]);_0x42dfea[_0x1156('0x22')]=qs['offset'](_0x3ecfcd[_0x1156('0x35')][_0x1156('0x22')]);}_0x42dfea[_0x1156('0x3c')]=qs[_0x1156('0x3d')](_0x3ecfcd['query'][_0x1156('0x3d')]);_0x42dfea[_0x1156('0x3e')]=qs['filters'](_[_0x1156('0x3f')](_0x3ecfcd[_0x1156('0x35')],_0x46607d[_0x1156('0x40')]),_0x52120a);if(_0x3ecfcd['query'][_0x1156('0x41')]){_0x42dfea[_0x1156('0x3e')]=_[_0x1156('0x42')](_0x42dfea[_0x1156('0x3e')],{'$or':_[_0x1156('0x2f')](_0x52120a,function(_0x14218d){if(_0x14218d[_0x1156('0x32')]!==_0x1156('0x43')){var _0x3e41e2={};_0x3e41e2[_0x14218d[_0x1156('0x2c')]]={'$like':'%'+_0x3ecfcd['query'][_0x1156('0x41')]+'%'};return _0x3e41e2;}})});}_0x42dfea=_[_0x1156('0x42')]({},_0x42dfea,_0x3ecfcd[_0x1156('0x44')]);var _0x1d3d8e={'where':_0x42dfea['where']};return db[_0x1156('0x30')]['count'](_0x1d3d8e)['then'](function(_0x9fc2ca){_0x1913f9[_0x1156('0x25')]=_0x9fc2ca;if(_0x3ecfcd[_0x1156('0x35')][_0x1156('0x45')]){_0x42dfea[_0x1156('0x46')]=[{'all':!![]}];}return db[_0x1156('0x30')][_0x1156('0x47')](_0x42dfea);})[_0x1156('0x48')](function(_0x385e32){_0x1913f9[_0x1156('0x49')]=_0x385e32;return _0x1913f9;})[_0x1156('0x48')](respondWithFilteredResult(_0x42d656,_0x42dfea))['catch'](handleError(_0x42d656,null));};exports['show']=function(_0x5b2f47,_0x1d37c9){var _0xe71aa5={'raw':![],'where':{'id':_0x5b2f47['params']['id']}},_0x348d01={};_0x348d01[_0x1156('0x34')]=_[_0x1156('0x36')](db[_0x1156('0x30')][_0x1156('0x31')]);_0x348d01[_0x1156('0x35')]=_[_0x1156('0x36')](_0x5b2f47[_0x1156('0x35')]);_0x348d01[_0x1156('0x40')]=_[_0x1156('0x37')](_0x348d01[_0x1156('0x34')],_0x348d01['query']);_0xe71aa5['attributes']=_[_0x1156('0x37')](_0x348d01[_0x1156('0x34')],qs[_0x1156('0x39')](_0x5b2f47[_0x1156('0x35')][_0x1156('0x39')]));_0xe71aa5[_0x1156('0x38')]=_0xe71aa5[_0x1156('0x38')]['length']?_0xe71aa5['attributes']:_0x348d01['model'];if(_0x5b2f47[_0x1156('0x35')]['includeAll']){_0xe71aa5[_0x1156('0x46')]=[{'all':!![]}];}_0xe71aa5=_[_0x1156('0x42')]({},_0xe71aa5,_0x5b2f47[_0x1156('0x44')]);return db[_0x1156('0x30')][_0x1156('0x4a')](_0xe71aa5)['then'](handleEntityNotFound(_0x1d37c9,null))[_0x1156('0x48')](respondWithResult(_0x1d37c9,null))['catch'](handleError(_0x1d37c9,null));};exports['create']=function(_0x56e70d,_0x4f2ed4){return db['Team'][_0x1156('0x4b')](_0x56e70d[_0x1156('0x4c')],{})['then'](function(_0x38b42e){var _0x540c21=_0x56e70d[_0x1156('0x4d')][_0x1156('0x4e')]({'plain':!![]});if(!_0x540c21)throw new Error(_0x1156('0x4f'));if(_0x540c21[_0x1156('0x50')]===_0x1156('0x4d')){var _0x316954=_0x38b42e['get']({'plain':!![]});var _0x3fa2da=_0x1156('0x51');return db['UserProfileSection'][_0x1156('0x4a')]({'where':{'name':_0x3fa2da,'userProfileId':_0x540c21[_0x1156('0x52')]},'raw':!![]})[_0x1156('0x48')](function(_0x5c2cf7){if(_0x5c2cf7&&_0x5c2cf7['autoAssociation']===0x0){return db[_0x1156('0x53')][_0x1156('0x4b')]({'name':_0x316954['name'],'resourceId':_0x316954['id'],'type':_0x5c2cf7['name'],'sectionId':_0x5c2cf7['id']},{})[_0x1156('0x48')](function(){return _0x38b42e;});}else{return _0x38b42e;}})[_0x1156('0x54')](function(_0x28ea7b){logger[_0x1156('0x2a')](_0x1156('0x55'),_0x28ea7b);throw _0x28ea7b;});}return _0x38b42e;})[_0x1156('0x48')](respondWithResult(_0x4f2ed4,0xc9))[_0x1156('0x54')](handleError(_0x4f2ed4,null));};exports['update']=function(_0x319497,_0x3153fb){if(_0x319497['body']['id']){delete _0x319497[_0x1156('0x4c')]['id'];}return db[_0x1156('0x30')]['find']({'where':{'id':_0x319497[_0x1156('0x56')]['id']}})[_0x1156('0x48')](handleEntityNotFound(_0x3153fb,null))['then'](saveUpdates(_0x319497[_0x1156('0x4c')],null))['then'](respondWithResult(_0x3153fb,null))[_0x1156('0x54')](handleError(_0x3153fb,null));};exports[_0x1156('0x57')]=function(_0xf4f21a,_0x3d86bf){var _0x250617=_0xf4f21a[_0x1156('0x56')]['id'];var _0x44937c=[];return db[_0x1156('0x58')][_0x1156('0x59')](function(_0x183a28){var _0x59d13f=_0x1156('0x5a')+_0x250617;return db[_0x1156('0x58')][_0x1156('0x35')](_0x59d13f,{'type':db[_0x1156('0x5b')][_0x1156('0x5c')]['SELECT'],'raw':!![],'transaction':_0x183a28})[_0x1156('0x48')](function(_0x303cd9){_0x44937c=_[_0x1156('0x2f')](_0x303cd9,function(_0x2c1463){return Number(_0x2c1463['UserId']);});})[_0x1156('0x48')](function(){var _0x531923=_0x1156('0x5d')+_0x250617;return db[_0x1156('0x58')][_0x1156('0x35')](_0x531923,{'type':db[_0x1156('0x5b')][_0x1156('0x5c')][_0x1156('0x5e')],'raw':!![],'transaction':_0x183a28});})[_0x1156('0x48')](function(_0x11d1d5){var _0x1e373c=_[_0x1156('0x2f')](_0x11d1d5,function(_0x3d37fe){return Number(_0x3d37fe[_0x1156('0x5f')]);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x44937c},'VoiceQueueId':{'$in':_0x1e373c}},'transaction':_0x183a28});})[_0x1156('0x48')](function(){var _0x2f1bee='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x250617;return db['sequelize'][_0x1156('0x35')](_0x2f1bee,{'type':db[_0x1156('0x5b')][_0x1156('0x5c')][_0x1156('0x5e')],'raw':!![],'transaction':_0x183a28});})[_0x1156('0x48')](function(_0x366dd1){var _0x2b4d29=_[_0x1156('0x2f')](_0x366dd1,function(_0x2d04f1){return Number(_0x2d04f1[_0x1156('0x60')]);});return db[_0x1156('0x61')][_0x1156('0x57')]({'where':{'UserId':{'$in':_0x44937c},'MailQueueId':{'$in':_0x2b4d29}},'transaction':_0x183a28});})[_0x1156('0x48')](function(){var _0x3a619d=_0x1156('0x62')+_0x250617;return db[_0x1156('0x58')][_0x1156('0x35')](_0x3a619d,{'type':db['Sequelize'][_0x1156('0x5c')]['SELECT'],'raw':!![],'transaction':_0x183a28});})[_0x1156('0x48')](function(_0x778486){var _0x2c8919=_[_0x1156('0x2f')](_0x778486,function(_0x3219e4){return Number(_0x3219e4[_0x1156('0x63')]);});return db[_0x1156('0x64')][_0x1156('0x57')]({'where':{'UserId':{'$in':_0x44937c},'SmsQueueId':{'$in':_0x2c8919}},'transaction':_0x183a28});})[_0x1156('0x48')](function(){var _0x15adc8=_0x1156('0x65')+_0x250617;return db[_0x1156('0x58')][_0x1156('0x35')](_0x15adc8,{'type':db[_0x1156('0x5b')][_0x1156('0x5c')][_0x1156('0x5e')],'raw':!![],'transaction':_0x183a28});})[_0x1156('0x48')](function(_0x171517){var _0x18209c=_['map'](_0x171517,function(_0x3eb291){return Number(_0x3eb291['ChatQueueId']);});return db[_0x1156('0x66')][_0x1156('0x57')]({'where':{'UserId':{'$in':_0x44937c},'ChatQueueId':{'$in':_0x18209c}},'transaction':_0x183a28});})['then'](function(){var _0x453e29=_0x1156('0x67')+_0x250617;return db[_0x1156('0x58')][_0x1156('0x35')](_0x453e29,{'type':db[_0x1156('0x5b')][_0x1156('0x5c')][_0x1156('0x5e')],'raw':!![],'transaction':_0x183a28});})[_0x1156('0x48')](function(_0x317db2){var _0x55548c=_[_0x1156('0x2f')](_0x317db2,function(_0x184aae){return Number(_0x184aae[_0x1156('0x68')]);});return db['UserFaxQueue'][_0x1156('0x57')]({'where':{'UserId':{'$in':_0x44937c},'FaxQueueId':{'$in':_0x55548c}},'transaction':_0x183a28});})[_0x1156('0x48')](function(){var _0x137b7c=_0x1156('0x69')+_0x250617;return db[_0x1156('0x58')][_0x1156('0x35')](_0x137b7c,{'type':db[_0x1156('0x5b')][_0x1156('0x5c')]['SELECT'],'raw':!![],'transaction':_0x183a28});})['then'](function(_0x1677de){var _0x4d00a7=_['map'](_0x1677de,function(_0x5c0986){return Number(_0x5c0986['OpenchannelQueueId']);});return db[_0x1156('0x6a')][_0x1156('0x57')]({'where':{'UserId':{'$in':_0x44937c},'OpenchannelQueueId':{'$in':_0x4d00a7}},'transaction':_0x183a28});})[_0x1156('0x48')](function(){var _0x5b5362=_0x1156('0x6b')+_0x250617;return db[_0x1156('0x58')][_0x1156('0x35')](_0x5b5362,{'type':db['Sequelize']['QueryTypes'][_0x1156('0x5e')],'raw':!![],'transaction':_0x183a28});})[_0x1156('0x48')](function(_0x53d4d2){var _0x3db30f=_[_0x1156('0x2f')](_0x53d4d2,function(_0x2942af){return Number(_0x2942af['WhatsappQueueId']);});return db['UserWhatsappQueue'][_0x1156('0x57')]({'where':{'UserId':{'$in':_0x44937c},'WhatsappQueueId':{'$in':_0x3db30f}},'transaction':_0x183a28});})[_0x1156('0x48')](function(){return db[_0x1156('0x6c')]['find']({'where':{'TeamId':_0x250617}});})['then'](function(_0x2c5993){if(_0x2c5993===null){return;}return db[_0x1156('0x6d')][_0x1156('0x57')]({'where':{'UserId':{'$in':_0x44937c},'VoicePrefixId':_0x2c5993['VoicePrefixId']},'transaction':_0x183a28});})[_0x1156('0x48')](function(){return db[_0x1156('0x30')][_0x1156('0x57')]({'where':{'id':_0x250617},'cascade':!![],'transaction':_0x183a28});})[_0x1156('0x48')](function(_0x5b3e37){if(_0x5b3e37===0x0){_0x3d86bf['sendStatus'](0x194);}else{return db['UserProfileResource'][_0x1156('0x57')]({'where':{'type':_0x1156('0x51'),'resourceId':_0x250617},'cascade':!![],'transaction':_0x183a28})[_0x1156('0x48')](function(){_0x3d86bf[_0x1156('0x20')](0xcc)[_0x1156('0x6e')]();});}})['catch'](function(_0xfaadd5){_0x3d86bf[_0x1156('0x20')](0x1f4)[_0x1156('0x2d')](_0xfaadd5);});});};exports[_0x1156('0x6f')]=function(_0x5da064,_0x596f7c,_0x52c199){return db['Team'][_0x1156('0x70')]({'where':{'id':_0x5da064[_0x1156('0x56')]['id']}})['then'](handleEntityNotFound(_0x596f7c,null))[_0x1156('0x48')](function(_0x2b7825){if(!_0x5da064[_0x1156('0x35')][_0x1156('0x71')]||!utils[_0x1156('0x72')](_0x5da064[_0x1156('0x35')][_0x1156('0x71')])){throw new db[(_0x1156('0x5b'))]['ValidationError'](_0x1156('0x73'));}var _0x1ca9f4={};var _0x48a37f={};_0x48a37f[_0x1156('0x34')]=_[_0x1156('0x36')](db[_['capitalize'](_0x5da064[_0x1156('0x35')]['channel'][_0x1156('0x74')]())+_0x1156('0x75')][_0x1156('0x31')]);_0x48a37f[_0x1156('0x35')]=_['keys'](_0x5da064[_0x1156('0x35')]);_0x48a37f['filters']=_[_0x1156('0x37')](_0x48a37f[_0x1156('0x34')],_0x48a37f[_0x1156('0x35')]);_0x1ca9f4[_0x1156('0x38')]=_[_0x1156('0x37')](_0x48a37f['model'],qs[_0x1156('0x39')](_0x5da064['query'][_0x1156('0x39')]));_0x1ca9f4[_0x1156('0x38')]=_0x1ca9f4[_0x1156('0x38')]['length']?_0x1ca9f4[_0x1156('0x38')]:_0x48a37f[_0x1156('0x34')];_0x1ca9f4['limit']=qs[_0x1156('0x24')](_0x5da064[_0x1156('0x35')][_0x1156('0x24')]);_0x1ca9f4['offset']=qs[_0x1156('0x22')](_0x5da064['query'][_0x1156('0x22')]);_0x1ca9f4[_0x1156('0x3c')]=qs['sort'](_0x5da064['query'][_0x1156('0x3d')]);_0x1ca9f4['where']=qs['filters'](_[_0x1156('0x3f')](_0x5da064[_0x1156('0x35')],_0x48a37f[_0x1156('0x40')]));_0x1ca9f4=_[_0x1156('0x42')]({},_0x1ca9f4,_0x5da064[_0x1156('0x44')]);return _0x2b7825[_0x1156('0x4e')+_['capitalize'](_0x5da064[_0x1156('0x35')][_0x1156('0x71')][_0x1156('0x74')]())+'Queues'](_0x1ca9f4);})['then'](respondWithResult(_0x596f7c,null))[_0x1156('0x54')](handleError(_0x596f7c,null));};exports['addQueues']=function(_0x59b828,_0x35f915,_0x55988f){return db[_0x1156('0x30')][_0x1156('0x70')]({'where':{'id':_0x59b828['params']['id']}})[_0x1156('0x48')](function(_0x5cb488){if(_0x5cb488){if(!_0x59b828[_0x1156('0x4c')][_0x1156('0x71')]||!utils[_0x1156('0x72')](_0x59b828[_0x1156('0x4c')][_0x1156('0x71')])){throw new db[(_0x1156('0x5b'))][(_0x1156('0x76'))](_0x1156('0x73'));}return _0x5cb488[_0x1156('0x77')+_[_0x1156('0x78')](_0x59b828[_0x1156('0x4c')][_0x1156('0x71')][_0x1156('0x74')]())+_0x1156('0x79')](_0x59b828[_0x1156('0x4c')][_0x1156('0x7a')]);}return null;})[_0x1156('0x48')](handleEntityNotFound(_0x35f915,null))['then'](respondWithStatusCode(_0x35f915,null))[_0x1156('0x54')](handleError(_0x35f915,null));};exports['removeQueues']=function(_0x5976f1,_0x344013,_0xc88fc3){return db['Team'][_0x1156('0x70')]({'where':{'id':_0x5976f1[_0x1156('0x56')]['id']}})['then'](function(_0x28220f){if(_0x28220f){if(!_0x5976f1[_0x1156('0x35')][_0x1156('0x71')]||!utils['isValidChannel'](_0x5976f1[_0x1156('0x35')][_0x1156('0x71')])){throw new db['Sequelize'][(_0x1156('0x76'))](_0x1156('0x73'));}return _0x28220f[_0x1156('0x7b')+_[_0x1156('0x78')](_0x5976f1[_0x1156('0x35')]['channel']['toLowerCase']())+_0x1156('0x79')](_0x5976f1[_0x1156('0x35')][_0x1156('0x7a')]);}return null;})[_0x1156('0x48')](handleEntityNotFound(_0x344013,null))['then'](respondWithStatusCode(_0x344013,null))['catch'](handleError(_0x344013,null));};exports[_0x1156('0x7c')]=function(_0x202ca9,_0x41be2d){var _0x4f98d8=_[_0x1156('0x7d')](_0x202ca9[_0x1156('0x4c')][_0x1156('0x7a')])?_0x202ca9['body']['ids']:[_0x202ca9[_0x1156('0x4c')][_0x1156('0x7a')]];var _0x1397a4=_0x202ca9[_0x1156('0x56')]['id'];return db[_0x1156('0x30')][_0x1156('0x4a')]({'where':{'id':_0x1397a4}})[_0x1156('0x48')](handleEntityNotFound(_0x41be2d,null))[_0x1156('0x48')](function(_0x57cdc5){if(_0x57cdc5){var _0x4cbb73=[_0x1156('0x7e'),'Chat','Mail',_0x1156('0x7f'),_0x1156('0x80'),'Openchannel','Whatsapp'];return db[_0x1156('0x58')][_0x1156('0x59')](function(_0x3a2a97){var _0x565f54=_[_0x1156('0x2f')](_0x4cbb73,function(_0x336dac){var _0xa2f4d={'attributes':['id','name']};if(_0x336dac===_0x1156('0x7e')){_0xa2f4d[_0x1156('0x81')]={'attributes':[_0x1156('0x82')]};}return _0x57cdc5[_0x1156('0x4e')+_0x336dac+_0x1156('0x79')](_0xa2f4d)[_0x1156('0x48')](function(_0x384274){var _0x4f6609=_[_0x1156('0x2f')](_0x384274,function(_0x3f3a90){var _0x276afc=_[_0x1156('0x2f')](_0x4f98d8,function(_0x3b8a8d){var _0xbad81d={'where':{'UserId':_0x3b8a8d,[_0x336dac+'QueueId']:_0x3f3a90['id']},'transaction':_0x3a2a97};if(_0x336dac===_0x1156('0x7e')){_0xbad81d[_0x1156('0x19')]={'penalty':_0x3f3a90[_0x1156('0x83')][_0x1156('0x82')]};}return db[_0x1156('0x84')+_0x336dac+'Queue']['findOrCreate'](_0xbad81d)['then'](function(){socket[_0x1156('0x85')](_0x1156('0x4d')+_0x336dac+_0x1156('0x86'),{'UserId':_0x3b8a8d,[_0x336dac+_0x1156('0x87')]:_0x3f3a90['id']});if(_0x336dac!==_0x1156('0x7e')){return;}return db['User'][_0x1156('0x47')]({'where':{'id':_0x4f98d8,'online':0x1},'attributes':['id',_0x1156('0x2c'),_0x1156('0x88'),_0x1156('0x89'),_0x1156('0x8a')],'raw':!![]})[_0x1156('0x48')](function(_0x344d45){var _0x52c96e=_[_0x1156('0x2f')](_0x344d45,function(_0x5e7db8){return db[_0x1156('0x8b')][_0x1156('0x8c')]({'membername':_0x5e7db8[_0x1156('0x2c')],'UserId':_0x5e7db8['id'],'queue_name':_0x3f3a90['name'],'VoiceQueueId':_0x3f3a90['id'],'interface':_[_0x1156('0x8d')](_0x5e7db8[_0x1156('0x8a')])?util[_0x1156('0x8e')](_0x1156('0x8f'),_0x5e7db8[_0x1156('0x2c')]):_0x5e7db8['interface'],'paused':_0x5e7db8[_0x1156('0x89')]||![],'penalty':_0x3f3a90[_0x1156('0x83')]['penalty']},{'transaction':_0x3a2a97});});return Promise[_0x1156('0x90')](_0x52c96e);});});});return Promise['all'](_0x276afc);});return Promise[_0x1156('0x90')](_0x4f6609);})[_0x1156('0x48')](function(){return db[_0x1156('0x6c')][_0x1156('0x70')]({'where':{'teamId':_0x1397a4}})[_0x1156('0x48')](function(_0x2503d4){if(_0x2503d4){var _0x24bb54=_[_0x1156('0x2f')](_0x4f98d8,function(_0x46f994){db[_0x1156('0x6d')]['upsert']({'UserId':_0x46f994,'VoicePrefixId':_0x2503d4['VoicePrefixId']});});return Promise[_0x1156('0x90')](_0x24bb54);}});});});return Promise[_0x1156('0x90')](_0x565f54)[_0x1156('0x48')](function(){return _0x57cdc5[_0x1156('0x7c')](_0x4f98d8,{'transaction':_0x3a2a97})[_0x1156('0x91')](function(_0x5dcb1f){return _0x5dcb1f;});});});}})[_0x1156('0x48')](respondWithResult(_0x41be2d,null))[_0x1156('0x54')](handleError(_0x41be2d,null));};exports[_0x1156('0x92')]=function(_0x39fd6c,_0x5c6433){var _0x419334=_['isArray'](_0x39fd6c[_0x1156('0x35')]['ids'])?_0x39fd6c[_0x1156('0x35')][_0x1156('0x7a')]:[_0x39fd6c[_0x1156('0x35')]['ids']];var _0x4fe19c=_0x39fd6c[_0x1156('0x56')]['id'];return db['Team']['find']({'where':{'id':_0x4fe19c}})[_0x1156('0x48')](handleEntityNotFound(_0x5c6433,null))[_0x1156('0x48')](function(_0x1bb95d){if(_0x1bb95d){var _0x3c681e=[_0x1156('0x7e'),_0x1156('0x93'),'Mail',_0x1156('0x7f'),_0x1156('0x80'),'Openchannel',_0x1156('0x94')];return db[_0x1156('0x58')][_0x1156('0x59')](function(_0x5e9e52){var _0x3d0765=_[_0x1156('0x2f')](_0x3c681e,function(_0x39cbb1){var _0x299b6e={'attributes':['id','name']};return _0x1bb95d['get'+_0x39cbb1+_0x1156('0x79')](_0x299b6e)[_0x1156('0x48')](function(_0x214fb1){var _0x4494ae=_[_0x1156('0x2f')](_0x214fb1,function(_0x284cb2){return _0x284cb2['removeAgents'](_0x419334,{'transaction':_0x5e9e52})['then'](function(){var _0x29b9b6=_[_0x1156('0x2f')](_0x419334,function(_0x2eae39){socket[_0x1156('0x85')]('user'+_0x39cbb1+_0x1156('0x95'),{'UserId':Number(_0x2eae39),[_0x39cbb1+_0x1156('0x87')]:_0x284cb2['id']});if(_0x39cbb1!==_0x1156('0x7e')){return;}return db[_0x1156('0x8b')]['destroy']({'where':{'VoiceQueueId':_0x284cb2['id'],'UserId':_0x2eae39},'transaction':_0x5e9e52});});return Promise[_0x1156('0x90')](_0x29b9b6);});});return Promise[_0x1156('0x90')](_0x4494ae);});});return Promise[_0x1156('0x90')](_0x3d0765)[_0x1156('0x48')](function(){return _0x1bb95d[_0x1156('0x92')](_0x419334,{'transaction':_0x5e9e52});})[_0x1156('0x48')](function(){return db[_0x1156('0x6c')]['findOne']({'where':{'teamId':_0x4fe19c}})[_0x1156('0x48')](function(_0x169bd3){if(_0x169bd3){var _0x21fd5d=_['map'](_0x419334,function(_0x433851){db[_0x1156('0x6d')][_0x1156('0x57')]({'where':{'UserId':_0x433851,'VoicePrefixId':_0x169bd3[_0x1156('0x96')]}});});return Promise[_0x1156('0x90')](_0x21fd5d);}});});});}})['then'](respondWithStatusCode(_0x5c6433,null))['catch'](handleError(_0x5c6433,null));};exports[_0x1156('0x97')]=function(_0x20e2a1,_0x4dd098,_0x3103b6){var _0x240b98={};var _0x5d4c54={};var _0xed0d73;var _0x1c298d;return db[_0x1156('0x30')][_0x1156('0x70')]({'where':{'id':_0x20e2a1[_0x1156('0x56')]['id']}})[_0x1156('0x48')](handleEntityNotFound(_0x4dd098,null))['then'](function(_0x2aae4a){if(_0x2aae4a){_0xed0d73=_0x2aae4a;_0x5d4c54[_0x1156('0x34')]=_['keys'](db['User'][_0x1156('0x31')]);_0x5d4c54[_0x1156('0x35')]=_['keys'](_0x20e2a1[_0x1156('0x35')]);_0x5d4c54[_0x1156('0x40')]=_[_0x1156('0x37')](_0x5d4c54['model'],_0x5d4c54[_0x1156('0x35')]);_0x240b98[_0x1156('0x38')]=_['intersection'](_0x5d4c54[_0x1156('0x34')],qs[_0x1156('0x39')](_0x20e2a1[_0x1156('0x35')][_0x1156('0x39')]));_0x240b98[_0x1156('0x38')]=_0x240b98[_0x1156('0x38')]['length']?_0x240b98[_0x1156('0x38')]:_0x5d4c54[_0x1156('0x34')];_0x240b98[_0x1156('0x3c')]=qs[_0x1156('0x3d')](_0x20e2a1[_0x1156('0x35')]['sort']);_0x240b98[_0x1156('0x3e')]=qs[_0x1156('0x40')](_[_0x1156('0x3f')](_0x20e2a1[_0x1156('0x35')],_0x5d4c54['filters']));if(_0x20e2a1[_0x1156('0x35')][_0x1156('0x41')]){_0x240b98['where']=_[_0x1156('0x42')](_0x240b98[_0x1156('0x3e')],{'$or':_['map'](_0x240b98[_0x1156('0x38')],function(_0x28fec1){var _0x209fda={};_0x209fda[_0x28fec1]={'$like':'%'+_0x20e2a1[_0x1156('0x35')]['filter']+'%'};return _0x209fda;})});}_0x240b98=_['merge']({},_0x240b98,_0x20e2a1['options']);return _0xed0d73[_0x1156('0x97')](_0x240b98);}})['then'](function(_0x2ee2d2){if(_0x2ee2d2){_0x1c298d=_0x2ee2d2[_0x1156('0x98')];if(!_0x20e2a1[_0x1156('0x35')][_0x1156('0x3a')](_0x1156('0x3b'))){_0x240b98['limit']=qs[_0x1156('0x24')](_0x20e2a1[_0x1156('0x35')][_0x1156('0x24')]);_0x240b98[_0x1156('0x22')]=qs[_0x1156('0x22')](_0x20e2a1[_0x1156('0x35')][_0x1156('0x22')]);}return _0xed0d73[_0x1156('0x97')](_0x240b98);}})[_0x1156('0x48')](function(_0x5c3951){if(_0x5c3951){return _0x5c3951?{'count':_0x1c298d,'rows':_0x5c3951}:null;}})[_0x1156('0x48')](respondWithResult(_0x4dd098,null))[_0x1156('0x54')](handleError(_0x4dd098,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 0441ae2..e3e257e 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 _0x27c3=['save','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x29f077,_0x5a807e){var _0x2b653b=function(_0x419db6){while(--_0x419db6){_0x29f077['push'](_0x29f077['shift']());}};_0x2b653b(++_0x5a807e);}(_0x27c3,0x132));var _0x327c=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x27c3[_0x1b5aea];return _0x15cfc6;};'use strict';var EventEmitter=require('events');var Team=require(_0x327c('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x327c('0x1')](0x0);var events={'afterCreate':_0x327c('0x2'),'afterUpdate':'update','afterDestroy':_0x327c('0x3')};function emitEvent(_0x11c35d){return function(_0x3d0ded,_0x49339c,_0x103496){TeamEvents[_0x327c('0x4')](_0x11c35d+':'+_0x3d0ded['id'],_0x3d0ded);TeamEvents[_0x327c('0x4')](_0x11c35d,_0x3d0ded);_0x103496(null);};}for(var e in events){if(events[_0x327c('0x5')](e)){var event=events[e];Team[_0x327c('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x3cbc=['Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5c7d62,_0x1e3900){var _0x7c08e=function(_0x5ea388){while(--_0x5ea388){_0x5c7d62['push'](_0x5c7d62['shift']());}};_0x7c08e(++_0x1e3900);}(_0x3cbc,0x10c));var _0xc3cb=function(_0x54bc99,_0x3bd175){_0x54bc99=_0x54bc99-0x0;var _0x118d05=_0x3cbc[_0x54bc99];return _0x118d05;};'use strict';var EventEmitter=require(_0xc3cb('0x0'));var Team=require(_0xc3cb('0x1'))['db'][_0xc3cb('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xc3cb('0x3')](0x0);var events={'afterCreate':_0xc3cb('0x4'),'afterUpdate':_0xc3cb('0x5'),'afterDestroy':_0xc3cb('0x6')};function emitEvent(_0x3589fa){return function(_0xe18904,_0x150075,_0x455f49){TeamEvents[_0xc3cb('0x7')](_0x3589fa+':'+_0xe18904['id'],_0xe18904);TeamEvents[_0xc3cb('0x7')](_0x3589fa,_0xe18904);_0x455f49(null);};}for(var e in events){if(events[_0xc3cb('0x8')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xc3cb('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 9988934..6eb547e 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 _0xd71f=['api','path','../../config/environment','./team.attributes','exports','define','Team','teams','lodash','util','../../config/logger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd71f,0x17e));var _0xfd71=function(_0x59dd66,_0x85b77a){_0x59dd66=_0x59dd66-0x0;var _0x58ac43=_0xd71f[_0x59dd66];return _0x58ac43;};'use strict';var _=require(_0xfd71('0x0'));var util=require(_0xfd71('0x1'));var logger=require(_0xfd71('0x2'))(_0xfd71('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd71('0x4'));var rimraf=require('rimraf');var config=require(_0xfd71('0x5'));var attributes=require(_0xfd71('0x6'));module[_0xfd71('0x7')]=function(_0x5807e2,_0x5cd9be){return _0x5807e2[_0xfd71('0x8')](_0xfd71('0x9'),attributes,{'tableName':_0xfd71('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4e3=['api','moment','request-promise','path','rimraf','../../config/environment','./team.attributes','Team','lodash','../../config/logger'];(function(_0x500fc8,_0x3bf0cd){var _0x58cbf9=function(_0x17f34f){while(--_0x17f34f){_0x500fc8['push'](_0x500fc8['shift']());}};_0x58cbf9(++_0x3bf0cd);}(_0xe4e3,0x170));var _0x3e4e=function(_0x4577bc,_0x4bd697){_0x4577bc=_0x4577bc-0x0;var _0x585978=_0xe4e3[_0x4577bc];return _0x585978;};'use strict';var _=require(_0x3e4e('0x0'));var util=require('util');var logger=require(_0x3e4e('0x1'))(_0x3e4e('0x2'));var moment=require(_0x3e4e('0x3'));var BPromise=require('bluebird');var rp=require(_0x3e4e('0x4'));var fs=require('fs');var path=require(_0x3e4e('0x5'));var rimraf=require(_0x3e4e('0x6'));var config=require(_0x3e4e('0x7'));var attributes=require(_0x3e4e('0x8'));module['exports']=function(_0x17ec11,_0x2a4119){return _0x17ec11['define'](_0x3e4e('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 7bcbf44..3403675 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 _0xfc24=['socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0xd25111,_0x47b276){var _0x370a48=function(_0x4a352f){while(--_0x4a352f){_0xd25111['push'](_0xd25111['shift']());}};_0x370a48(++_0x47b276);}(_0xfc24,0x15e));var _0x4fc2=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0xfc24[_0x374ccf];return _0x443cde;};'use strict';var _=require(_0x4fc2('0x0'));var util=require(_0x4fc2('0x1'));var moment=require(_0x4fc2('0x2'));var BPromise=require(_0x4fc2('0x3'));var rs=require(_0x4fc2('0x4'));var fs=require('fs');var Redis=require(_0x4fc2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4fc2('0x6'));var logger=require(_0x4fc2('0x7'))(_0x4fc2('0x8'));var config=require(_0x4fc2('0x9'));var jayson=require(_0x4fc2('0xa'));var client=jayson[_0x4fc2('0xb')]['http']({'port':0x232a});config[_0x4fc2('0xc')]=_['defaults'](config[_0x4fc2('0xc')],{'host':_0x4fc2('0xd'),'port':0x18eb});var socket=require(_0x4fc2('0xe'))(new Redis(config['redis']));require(_0x4fc2('0xf'))[_0x4fc2('0x10')](socket);function respondWithRpcPromise(_0x518127,_0x1549e2,_0xa4c61a){return new BPromise(function(_0x168e4d,_0x549263){return client[_0x4fc2('0x11')](_0x518127,_0xa4c61a)['then'](function(_0x58e8a2){logger[_0x4fc2('0x12')](_0x4fc2('0x13'),_0x1549e2,_0x4fc2('0x14'));logger['debug'](_0x4fc2('0x15'),_0x1549e2,_0x4fc2('0x14'),JSON[_0x4fc2('0x16')](_0x58e8a2));if(_0x58e8a2[_0x4fc2('0x17')]){if(_0x58e8a2['error'][_0x4fc2('0x18')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x1549e2,_0x58e8a2['error'][_0x4fc2('0x19')]);return _0x549263(_0x58e8a2[_0x4fc2('0x17')]['message']);}logger['error'](_0x4fc2('0x13'),_0x1549e2,_0x58e8a2[_0x4fc2('0x17')][_0x4fc2('0x19')]);return _0x168e4d(_0x58e8a2[_0x4fc2('0x17')]['message']);}else{logger[_0x4fc2('0x12')](_0x4fc2('0x13'),_0x1549e2,'request\x20sent');_0x168e4d(_0x58e8a2[_0x4fc2('0x1a')][_0x4fc2('0x19')]);}})[_0x4fc2('0x1b')](function(_0x5677e6){logger[_0x4fc2('0x17')](_0x4fc2('0x13'),_0x1549e2,_0x5677e6);_0x549263(_0x5677e6);});});} \ No newline at end of file +var _0xca4a=['code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca4a,0xa6));var _0xaca4=function(_0x5a0b3a,_0x1137eb){_0x5a0b3a=_0x5a0b3a-0x0;var _0x718d5d=_0xca4a[_0x5a0b3a];return _0x718d5d;};'use strict';var _=require(_0xaca4('0x0'));var util=require('util');var moment=require(_0xaca4('0x1'));var BPromise=require(_0xaca4('0x2'));var rs=require(_0xaca4('0x3'));var fs=require('fs');var Redis=require(_0xaca4('0x4'));var db=require(_0xaca4('0x5'))['db'];var utils=require(_0xaca4('0x6'));var logger=require(_0xaca4('0x7'))(_0xaca4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaca4('0x9')][_0xaca4('0xa')]({'port':0x232a});config[_0xaca4('0xb')]=_[_0xaca4('0xc')](config[_0xaca4('0xb')],{'host':_0xaca4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaca4('0xe'))[_0xaca4('0xf')](socket);function respondWithRpcPromise(_0x4b3ba1,_0x3d8c49,_0x4aea77){return new BPromise(function(_0x2185af,_0x2d584c){return client[_0xaca4('0x10')](_0x4b3ba1,_0x4aea77)[_0xaca4('0x11')](function(_0x594984){logger['info'](_0xaca4('0x12'),_0x3d8c49,_0xaca4('0x13'));logger[_0xaca4('0x14')](_0xaca4('0x15'),_0x3d8c49,'request\x20sent',JSON['stringify'](_0x594984));if(_0x594984[_0xaca4('0x16')]){if(_0x594984['error'][_0xaca4('0x17')]===0x1f4){logger[_0xaca4('0x16')](_0xaca4('0x12'),_0x3d8c49,_0x594984['error']['message']);return _0x2d584c(_0x594984[_0xaca4('0x16')][_0xaca4('0x18')]);}logger[_0xaca4('0x16')](_0xaca4('0x12'),_0x3d8c49,_0x594984[_0xaca4('0x16')][_0xaca4('0x18')]);return _0x2185af(_0x594984[_0xaca4('0x16')][_0xaca4('0x18')]);}else{logger[_0xaca4('0x19')](_0xaca4('0x12'),_0x3d8c49,_0xaca4('0x13'));_0x2185af(_0x594984[_0xaca4('0x1a')][_0xaca4('0x18')]);}})['catch'](function(_0x493600){logger[_0xaca4('0x16')](_0xaca4('0x12'),_0x3d8c49,_0x493600);_0x2d584c(_0x493600);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 35b6b71..f50bad8 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 _0xb240=['remove','update','emit','removeListener','register','team:','./team.events','save'];(function(_0x3e0354,_0x32b40a){var _0x20d004=function(_0x22f85e){while(--_0x22f85e){_0x3e0354['push'](_0x3e0354['shift']());}};_0x20d004(++_0x32b40a);}(_0xb240,0x7e));var _0x0b24=function(_0x4303fd,_0x32effd){_0x4303fd=_0x4303fd-0x0;var _0x52ea3a=_0xb240[_0x4303fd];return _0x52ea3a;};'use strict';var TeamEvents=require(_0x0b24('0x0'));var events=[_0x0b24('0x1'),_0x0b24('0x2'),_0x0b24('0x3')];function createListener(_0x28ed39,_0x2c87e6){return function(_0x219e2d){_0x2c87e6[_0x0b24('0x4')](_0x28ed39,_0x219e2d);};}function removeListener(_0x30083a,_0x567c96){return function(){TeamEvents[_0x0b24('0x5')](_0x30083a,_0x567c96);};}exports[_0x0b24('0x6')]=function(_0x21c0aa){for(var _0x1cbc06=0x0,_0x162a50=events['length'];_0x1cbc06<_0x162a50;_0x1cbc06++){var _0x238a19=events[_0x1cbc06];var _0x34be24=createListener(_0x0b24('0x7')+_0x238a19,_0x21c0aa);TeamEvents['on'](_0x238a19,_0x34be24);}}; \ No newline at end of file +var _0xb720=['length','team:','./team.events','remove','update','emit','removeListener'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xb720,0x191));var _0x0b72=function(_0xdbfe3,_0x4ebddd){_0xdbfe3=_0xdbfe3-0x0;var _0x3454b0=_0xb720[_0xdbfe3];return _0x3454b0;};'use strict';var TeamEvents=require(_0x0b72('0x0'));var events=['save',_0x0b72('0x1'),_0x0b72('0x2')];function createListener(_0x75789f,_0x402832){return function(_0x2dbf83){_0x402832[_0x0b72('0x3')](_0x75789f,_0x2dbf83);};}function removeListener(_0x2f69a5,_0xb8af0c){return function(){TeamEvents[_0x0b72('0x4')](_0x2f69a5,_0xb8af0c);};}exports['register']=function(_0x1fbb71){for(var _0x51679c=0x0,_0x2a365d=events[_0x0b72('0x5')];_0x51679c<_0x2a365d;_0x51679c++){var _0x473736=events[_0x51679c];var _0x303d11=createListener(_0x0b72('0x6')+_0x473736,_0x1fbb71);TeamEvents['on'](_0x473736,_0x303d11);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 81ea23c..3e82ceb 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 _0xa75b=['sequelize','INTEGER'];(function(_0xe358b4,_0x18b8e2){var _0x550c3a=function(_0x5713bf){while(--_0x5713bf){_0xe358b4['push'](_0xe358b4['shift']());}};_0x550c3a(++_0x18b8e2);}(_0xa75b,0x170));var _0xba75=function(_0x3b0015,_0x28e28a){_0x3b0015=_0x3b0015-0x0;var _0x559e74=_0xa75b[_0x3b0015];return _0x559e74;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xba75('0x1')]}}; \ No newline at end of file +var _0xd85c=['INTEGER','sequelize','exports'];(function(_0xb016d0,_0x3d3d14){var _0x41bf1a=function(_0x4f58ca){while(--_0x4f58ca){_0xb016d0['push'](_0xb016d0['shift']());}};_0x41bf1a(++_0x3d3d14);}(_0xd85c,0xb5));var _0xcd85=function(_0x40514c,_0x387dc3){_0x40514c=_0x40514c-0x0;var _0x48f285=_0xd85c[_0x40514c];return _0x48f285;};'use strict';var Sequelize=require(_0xcd85('0x0'));module[_0xcd85('0x1')]={'TeamId':{'type':Sequelize[_0xcd85('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xcd85('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index fb41867..f7b3c53 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 _0x12c9=['define','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports'];(function(_0x4d09d3,_0x57b3fb){var _0x3452f9=function(_0x2c77fa){while(--_0x2c77fa){_0x4d09d3['push'](_0x4d09d3['shift']());}};_0x3452f9(++_0x57b3fb);}(_0x12c9,0x9f));var _0x912c=function(_0x43f03c,_0x194d08){_0x43f03c=_0x43f03c-0x0;var _0x2a16c0=_0x12c9[_0x43f03c];return _0x2a16c0;};'use strict';var _=require(_0x912c('0x0'));var util=require('util');var logger=require(_0x912c('0x1'))('api');var moment=require(_0x912c('0x2'));var BPromise=require('bluebird');var rp=require(_0x912c('0x3'));var fs=require('fs');var path=require(_0x912c('0x4'));var rimraf=require(_0x912c('0x5'));var config=require(_0x912c('0x6'));var attributes=require(_0x912c('0x7'));module[_0x912c('0x8')]=function(_0x572179,_0x5daa7d){return _0x572179[_0x912c('0x9')](_0x912c('0xa'),attributes,{'tableName':_0x912c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xceb0=['moment','request-promise','path','rimraf','exports','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xceb0,0x173));var _0x0ceb=function(_0x47dc4f,_0x36c829){_0x47dc4f=_0x47dc4f-0x0;var _0x357d19=_0xceb0[_0x47dc4f];return _0x357d19;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0ceb('0x0'));var BPromise=require('bluebird');var rp=require(_0x0ceb('0x1'));var fs=require('fs');var path=require(_0x0ceb('0x2'));var rimraf=require(_0x0ceb('0x3'));var config=require('../../config/environment');var attributes=require('./teamVoicePrefix.attributes');module[_0x0ceb('0x4')]=function(_0x218237,_0x3f650d){return _0x218237['define'](_0x0ceb('0x5'),attributes,{'tableName':_0x0ceb('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index d4b5430..1cca197 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x420aa5,_0x4076e5){var _0x9a45b3=function(_0x522b1d){while(--_0x522b1d){_0x420aa5['push'](_0x420aa5['shift']());}};_0x9a45b3(++_0x4076e5);}(_0xe706,0xa3));var _0x6e70=function(_0x4ef05e,_0x18b00a){_0x4ef05e=_0x4ef05e-0x0;var _0x241f30=_0xe706[_0x4ef05e];return _0x241f30;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x253b46,_0x26265a){var _0x49282e=function(_0x3dbe38){while(--_0x3dbe38){_0x253b46['push'](_0x253b46['shift']());}};_0x49282e(++_0x26265a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index fd7a40c..dc061af 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 _0x5eda=['INTEGER','sequelize'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x5eda,0xef));var _0xa5ed=function(_0x2116f1,_0x1df1ae){_0x2116f1=_0x2116f1-0x0;var _0x5144ef=_0x5eda[_0x2116f1];return _0x5144ef;};'use strict';var Sequelize=require(_0xa5ed('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa5ed('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5b17=['exports','INTEGER','sequelize'];(function(_0x11f6e6,_0x32cf34){var _0x15f6f1=function(_0x87b4c6){while(--_0x87b4c6){_0x11f6e6['push'](_0x11f6e6['shift']());}};_0x15f6f1(++_0x32cf34);}(_0x5b17,0xc5));var _0x75b1=function(_0x1e0e2f,_0x4c4a29){_0x1e0e2f=_0x1e0e2f-0x0;var _0x46ee08=_0x5b17[_0x1e0e2f];return _0x46ee08;};'use strict';var Sequelize=require(_0x75b1('0x0'));module[_0x75b1('0x1')]={'penalty':{'type':Sequelize[_0x75b1('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 7326e35..c2acc7a 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 _0x3248=['exports','define','TeamVoiceQueue','team_has_voice_queues','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x320ed3,_0x378fb9){var _0x471707=function(_0x110738){while(--_0x110738){_0x320ed3['push'](_0x320ed3['shift']());}};_0x471707(++_0x378fb9);}(_0x3248,0x1bc));var _0x8324=function(_0x1a14dc,_0x3be3f3){_0x1a14dc=_0x1a14dc-0x0;var _0x266d72=_0x3248[_0x1a14dc];return _0x266d72;};'use strict';var _=require('lodash');var util=require(_0x8324('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8324('0x1'));var BPromise=require(_0x8324('0x2'));var rp=require(_0x8324('0x3'));var fs=require('fs');var path=require(_0x8324('0x4'));var rimraf=require(_0x8324('0x5'));var config=require(_0x8324('0x6'));var attributes=require('./teamVoiceQueue.attributes');module[_0x8324('0x7')]=function(_0x1c5c2a,_0x5157f4){return _0x1c5c2a[_0x8324('0x8')](_0x8324('0x9'),attributes,{'tableName':_0x8324('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb53=['define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x37c981,_0x22a780){var _0x4deca9=function(_0x38cf21){while(--_0x38cf21){_0x37c981['push'](_0x37c981['shift']());}};_0x4deca9(++_0x22a780);}(_0xbb53,0x121));var _0x3bb5=function(_0x309c25,_0x343e51){_0x309c25=_0x309c25-0x0;var _0x3fa29e=_0xbb53[_0x309c25];return _0x3fa29e;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var logger=require(_0x3bb5('0x2'))(_0x3bb5('0x3'));var moment=require(_0x3bb5('0x4'));var BPromise=require(_0x3bb5('0x5'));var rp=require(_0x3bb5('0x6'));var fs=require('fs');var path=require(_0x3bb5('0x7'));var rimraf=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x23f11e,_0x2460b0){return _0x23f11e[_0x3bb5('0xa')](_0x3bb5('0xb'),attributes,{'tableName':_0x3bb5('0xc'),'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 c741c7d..eff06a0 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 _0xa8d3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch'];(function(_0x239b98,_0x49c015){var _0xef0722=function(_0x18bd08){while(--_0x18bd08){_0x239b98['push'](_0x239b98['shift']());}};_0xef0722(++_0x49c015);}(_0xa8d3,0x121));var _0x3a8d=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa8d3[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x3a8d('0x0'));var util=require(_0x3a8d('0x1'));var moment=require(_0x3a8d('0x2'));var BPromise=require(_0x3a8d('0x3'));var rs=require(_0x3a8d('0x4'));var fs=require('fs');var Redis=require(_0x3a8d('0x5'));var db=require(_0x3a8d('0x6'))['db'];var utils=require(_0x3a8d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3a8d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3a8d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x465c3b,_0x3e831e,_0x3e6536){return new BPromise(function(_0x53431e,_0x2a07dd){return client['request'](_0x465c3b,_0x3e6536)['then'](function(_0x26d45e){logger['info'](_0x3a8d('0xa'),_0x3e831e,_0x3a8d('0xb'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3e831e,'request\x20sent',JSON['stringify'](_0x26d45e));if(_0x26d45e['error']){if(_0x26d45e[_0x3a8d('0xc')][_0x3a8d('0xd')]===0x1f4){logger[_0x3a8d('0xc')](_0x3a8d('0xa'),_0x3e831e,_0x26d45e[_0x3a8d('0xc')][_0x3a8d('0xe')]);return _0x2a07dd(_0x26d45e[_0x3a8d('0xc')][_0x3a8d('0xe')]);}logger['error'](_0x3a8d('0xa'),_0x3e831e,_0x26d45e[_0x3a8d('0xc')][_0x3a8d('0xe')]);return _0x53431e(_0x26d45e[_0x3a8d('0xc')][_0x3a8d('0xe')]);}else{logger[_0x3a8d('0xf')](_0x3a8d('0xa'),_0x3e831e,_0x3a8d('0xb'));_0x53431e(_0x26d45e['result'][_0x3a8d('0xe')]);}})[_0x3a8d('0x10')](function(_0x5b8115){logger[_0x3a8d('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3e831e,_0x5b8115);_0x2a07dd(_0x5b8115);});});} \ No newline at end of file +var _0x3482=['code','message','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x32729c,_0xf5afd8){var _0x482cfd=function(_0x231471){while(--_0x231471){_0x32729c['push'](_0x32729c['shift']());}};_0x482cfd(++_0xf5afd8);}(_0x3482,0x1bc));var _0x2348=function(_0x2ab8f4,_0x192abd){_0x2ab8f4=_0x2ab8f4-0x0;var _0xf1bee6=_0x3482[_0x2ab8f4];return _0xf1bee6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2348('0x0'));var BPromise=require(_0x2348('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2348('0x2'));var db=require(_0x2348('0x3'))['db'];var utils=require(_0x2348('0x4'));var logger=require(_0x2348('0x5'))(_0x2348('0x6'));var config=require(_0x2348('0x7'));var jayson=require(_0x2348('0x8'));var client=jayson[_0x2348('0x9')][_0x2348('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c7b2a,_0x316bd6,_0x131a9a){return new BPromise(function(_0x308afb,_0x3cdc9a){return client[_0x2348('0xb')](_0x2c7b2a,_0x131a9a)[_0x2348('0xc')](function(_0x24191c){logger[_0x2348('0xd')](_0x2348('0xe'),_0x316bd6,_0x2348('0xf'));logger[_0x2348('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x316bd6,_0x2348('0xf'),JSON['stringify'](_0x24191c));if(_0x24191c[_0x2348('0x11')]){if(_0x24191c[_0x2348('0x11')][_0x2348('0x12')]===0x1f4){logger[_0x2348('0x11')](_0x2348('0xe'),_0x316bd6,_0x24191c[_0x2348('0x11')]['message']);return _0x3cdc9a(_0x24191c['error']['message']);}logger[_0x2348('0x11')](_0x2348('0xe'),_0x316bd6,_0x24191c[_0x2348('0x11')][_0x2348('0x13')]);return _0x308afb(_0x24191c[_0x2348('0x11')][_0x2348('0x13')]);}else{logger[_0x2348('0xd')](_0x2348('0xe'),_0x316bd6,_0x2348('0xf'));_0x308afb(_0x24191c[_0x2348('0x14')][_0x2348('0x13')]);}})['catch'](function(_0x446a7d){logger[_0x2348('0x11')](_0x2348('0xe'),_0x316bd6,_0x446a7d);_0x3cdc9a(_0x446a7d);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 01328a8..980c269 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 _0x5ae9=['/:id','post','create','put','update','delete','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x162c7a,_0x2693c8){var _0x1ce15b=function(_0x4566b8){while(--_0x4566b8){_0x162c7a['push'](_0x162c7a['shift']());}};_0x1ce15b(++_0x2693c8);}(_0x5ae9,0x19b));var _0x95ae=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0x5ae9[_0x576d8a];return _0x3dc3ef;};'use strict';var multer=require(_0x95ae('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x95ae('0x1'));var express=require(_0x95ae('0x2'));var router=express['Router']();var fs_extra=require(_0x95ae('0x3'));var auth=require(_0x95ae('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x95ae('0x5'));var controller=require('./template.controller');router[_0x95ae('0x6')]('/',auth[_0x95ae('0x7')](),controller[_0x95ae('0x8')]);router[_0x95ae('0x6')](_0x95ae('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x95ae('0xa')]('/',auth[_0x95ae('0x7')](),controller[_0x95ae('0xb')]);router[_0x95ae('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x95ae('0xd')]);router[_0x95ae('0xe')](_0x95ae('0x9'),auth[_0x95ae('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1280=['./template.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x1280,0xac));var _0x0128=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x1280[_0x3a0c4f];return _0x247049;};'use strict';var multer=require(_0x0128('0x0'));var util=require('util');var path=require(_0x0128('0x1'));var timeout=require(_0x0128('0x2'));var express=require(_0x0128('0x3'));var router=express[_0x0128('0x4')]();var fs_extra=require(_0x0128('0x5'));var auth=require(_0x0128('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0128('0x7'));var controller=require(_0x0128('0x8'));router[_0x0128('0x9')]('/',auth[_0x0128('0xa')](),controller['index']);router['get'](_0x0128('0xb'),auth[_0x0128('0xa')](),controller[_0x0128('0xc')]);router[_0x0128('0xd')]('/',auth['isAuthenticated'](),controller[_0x0128('0xe')]);router[_0x0128('0xf')]('/:id',auth[_0x0128('0xa')](),controller[_0x0128('0x10')]);router[_0x0128('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0128('0x12')]);module[_0x0128('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index f92004d..706eac2 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 _0x716a=['STRING','TEXT','exports'];(function(_0x54c3a9,_0x1a5057){var _0x5edfa9=function(_0x396ca6){while(--_0x396ca6){_0x54c3a9['push'](_0x54c3a9['shift']());}};_0x5edfa9(++_0x1a5057);}(_0x716a,0x1a0));var _0xa716=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0x716a[_0x2b55b5];return _0x103d28;};'use strict';var Sequelize=require('sequelize');module[_0xa716('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa716('0x1')]},'html':{'type':Sequelize[_0xa716('0x2')]}}; \ No newline at end of file +var _0x4744=['TEXT','sequelize','exports','STRING'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x4744,0xf9));var _0x4474=function(_0x235fd1,_0x5a55c6){_0x235fd1=_0x235fd1-0x0;var _0x1fb2fd=_0x4744[_0x235fd1];return _0x1fb2fd;};'use strict';var Sequelize=require(_0x4474('0x0'));module[_0x4474('0x1')]={'name':{'type':Sequelize[_0x4474('0x2')]},'description':{'type':Sequelize[_0x4474('0x2')]},'html':{'type':Sequelize[_0x4474('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index b1f22f9..d96c3c0 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 _0x86c6=['send','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','merge','type','VIRTUAL','filter','options','includeAll','Template','rows','catch','show','params','length','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','autoAssociation','error','body','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','status','stack','name'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x86c6,0x15f));var _0x686c=function(_0x324cb7,_0x5e6d83){_0x324cb7=_0x324cb7-0x0;var _0x1f6d51=_0x86c6[_0x324cb7];return _0x1f6d51;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x686c('0x0'));var jsonpatch=require(_0x686c('0x1'));var rp=require(_0x686c('0x2'));var moment=require(_0x686c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x686c('0x4'));var util=require('util');var path=require('path');var sox=require(_0x686c('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x686c('0x6'));var _=require(_0x686c('0x7'));var squel=require(_0x686c('0x8'));var crypto=require(_0x686c('0x9'));var jsforce=require(_0x686c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x686c('0xb'));var querystring=require(_0x686c('0xc'));var Papa=require(_0x686c('0xd'));var Redis=require(_0x686c('0xe'));var authService=require(_0x686c('0xf'));var qs=require(_0x686c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x686c('0x11'));var logger=require('../../config/logger')(_0x686c('0x12'));var utils=require(_0x686c('0x13'));var config=require(_0x686c('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x78b7ea,_0x3077af){_0x3077af=_0x3077af||0xcc;return function(_0x4e2ca5){if(_0x4e2ca5){return _0x78b7ea['sendStatus'](_0x3077af);}return _0x78b7ea['status'](_0x3077af)[_0x686c('0x15')]();};}function respondWithResult(_0x3d11cf,_0x5b5819){_0x5b5819=_0x5b5819||0xc8;return function(_0x46e4cc){if(_0x46e4cc){return _0x3d11cf['status'](_0x5b5819)[_0x686c('0x16')](_0x46e4cc);}};}function respondWithFilteredResult(_0x456e02,_0x136b86){return function(_0x4b47e5){if(_0x4b47e5){var _0x174205=typeof _0x136b86[_0x686c('0x17')]===_0x686c('0x18')&&typeof _0x136b86['limit']===_0x686c('0x18');var _0x2e8ecc=_0x4b47e5[_0x686c('0x19')];var _0x3b840b=_0x174205?0x0:_0x136b86[_0x686c('0x17')];var _0x25f14a=_0x174205?_0x4b47e5[_0x686c('0x19')]:_0x136b86[_0x686c('0x17')]+_0x136b86[_0x686c('0x1a')];var _0x9abcb1;if(_0x25f14a>=_0x2e8ecc){_0x25f14a=_0x2e8ecc;_0x9abcb1=0xc8;}else{_0x9abcb1=0xce;}_0x456e02['status'](_0x9abcb1);return _0x456e02['set'](_0x686c('0x1b'),_0x3b840b+'-'+_0x25f14a+'/'+_0x2e8ecc)[_0x686c('0x16')](_0x4b47e5);}return null;};}function patchUpdates(_0x26bca8){return function(_0x2125d4){try{jsonpatch[_0x686c('0x1c')](_0x2125d4,_0x26bca8,!![]);}catch(_0x20ebfb){return BPromise[_0x686c('0x1d')](_0x20ebfb);}return _0x2125d4[_0x686c('0x1e')]();};}function saveUpdates(_0x1b1c2d,_0x1f1de7){return function(_0x332a75){if(_0x332a75){return _0x332a75[_0x686c('0x1f')](_0x1b1c2d)['then'](function(_0x1925c6){return _0x1925c6;});}return null;};}function removeEntity(_0x22d4f0,_0x1bb986){return function(_0x231035){if(_0x231035){return _0x231035[_0x686c('0x20')]()[_0x686c('0x21')](function(){var _0x45fd96=_0x231035[_0x686c('0x22')]({'plain':!![]});var _0x2146d2='Templates';return db[_0x686c('0x23')]['destroy']({'where':{'type':_0x2146d2,'resourceId':_0x45fd96['id']}})[_0x686c('0x21')](function(){return _0x231035;});})[_0x686c('0x21')](function(){_0x22d4f0[_0x686c('0x24')](0xcc)[_0x686c('0x15')]();});}};}function handleEntityNotFound(_0xbfbfec,_0x205097){return function(_0x59272f){if(!_0x59272f){_0xbfbfec['sendStatus'](0x194);}return _0x59272f;};}function handleError(_0xe012a6,_0x1df38c){_0x1df38c=_0x1df38c||0x1f4;return function(_0x5a4835){logger['error'](_0x5a4835[_0x686c('0x25')]);if(_0x5a4835[_0x686c('0x26')]){delete _0x5a4835[_0x686c('0x26')];}_0xe012a6[_0x686c('0x24')](_0x1df38c)[_0x686c('0x27')](_0x5a4835);};}exports['index']=function(_0x2d4fc8,_0x37fb74){var _0x1cb34c={},_0x232784={},_0x47c4e4={'count':0x0,'rows':[]};var _0x5b69c5=_[_0x686c('0x28')](db['Template']['rawAttributes'],function(_0xa3aeae){return{'name':_0xa3aeae[_0x686c('0x29')],'type':_0xa3aeae['type'][_0x686c('0x2a')]};});_0x232784[_0x686c('0x2b')]=_[_0x686c('0x28')](_0x5b69c5,_0x686c('0x26'));_0x232784['query']=_[_0x686c('0x2c')](_0x2d4fc8[_0x686c('0x2d')]);_0x232784[_0x686c('0x2e')]=_[_0x686c('0x2f')](_0x232784[_0x686c('0x2b')],_0x232784['query']);_0x1cb34c[_0x686c('0x30')]=_[_0x686c('0x2f')](_0x232784[_0x686c('0x2b')],qs[_0x686c('0x31')](_0x2d4fc8[_0x686c('0x2d')][_0x686c('0x31')]));_0x1cb34c[_0x686c('0x30')]=_0x1cb34c[_0x686c('0x30')]['length']?_0x1cb34c[_0x686c('0x30')]:_0x232784['model'];if(!_0x2d4fc8[_0x686c('0x2d')][_0x686c('0x32')](_0x686c('0x33'))){_0x1cb34c[_0x686c('0x1a')]=qs[_0x686c('0x1a')](_0x2d4fc8[_0x686c('0x2d')]['limit']);_0x1cb34c['offset']=qs[_0x686c('0x17')](_0x2d4fc8['query'][_0x686c('0x17')]);}_0x1cb34c['order']=qs[_0x686c('0x34')](_0x2d4fc8[_0x686c('0x2d')][_0x686c('0x34')]);_0x1cb34c['where']=qs[_0x686c('0x2e')](_[_0x686c('0x35')](_0x2d4fc8[_0x686c('0x2d')],_0x232784[_0x686c('0x2e')]),_0x5b69c5);if(_0x2d4fc8[_0x686c('0x2d')]['filter']){_0x1cb34c['where']=_[_0x686c('0x36')](_0x1cb34c['where'],{'$or':_[_0x686c('0x28')](_0x5b69c5,function(_0x35980d){if(_0x35980d[_0x686c('0x37')]!==_0x686c('0x38')){var _0xd5072f={};_0xd5072f[_0x35980d[_0x686c('0x26')]]={'$like':'%'+_0x2d4fc8[_0x686c('0x2d')][_0x686c('0x39')]+'%'};return _0xd5072f;}})});}_0x1cb34c=_['merge']({},_0x1cb34c,_0x2d4fc8[_0x686c('0x3a')]);var _0x26bb1f={'where':_0x1cb34c['where']};return db['Template'][_0x686c('0x19')](_0x26bb1f)['then'](function(_0x5e38b1){_0x47c4e4[_0x686c('0x19')]=_0x5e38b1;if(_0x2d4fc8['query'][_0x686c('0x3b')]){_0x1cb34c['include']=[{'all':!![]}];}return db[_0x686c('0x3c')]['findAll'](_0x1cb34c);})['then'](function(_0x302420){_0x47c4e4[_0x686c('0x3d')]=_0x302420;return _0x47c4e4;})[_0x686c('0x21')](respondWithFilteredResult(_0x37fb74,_0x1cb34c))[_0x686c('0x3e')](handleError(_0x37fb74,null));};exports[_0x686c('0x3f')]=function(_0x16918d,_0x1d5188){var _0x15e6d4={'raw':!![],'where':{'id':_0x16918d[_0x686c('0x40')]['id']}},_0x5610c7={};_0x5610c7[_0x686c('0x2b')]=_[_0x686c('0x2c')](db[_0x686c('0x3c')]['rawAttributes']);_0x5610c7['query']=_[_0x686c('0x2c')](_0x16918d['query']);_0x5610c7[_0x686c('0x2e')]=_[_0x686c('0x2f')](_0x5610c7[_0x686c('0x2b')],_0x5610c7['query']);_0x15e6d4['attributes']=_['intersection'](_0x5610c7[_0x686c('0x2b')],qs[_0x686c('0x31')](_0x16918d[_0x686c('0x2d')][_0x686c('0x31')]));_0x15e6d4['attributes']=_0x15e6d4[_0x686c('0x30')][_0x686c('0x41')]?_0x15e6d4[_0x686c('0x30')]:_0x5610c7[_0x686c('0x2b')];if(_0x16918d[_0x686c('0x2d')]['includeAll']){_0x15e6d4[_0x686c('0x42')]=[{'all':!![]}];}_0x15e6d4=_[_0x686c('0x36')]({},_0x15e6d4,_0x16918d[_0x686c('0x3a')]);return db['Template'][_0x686c('0x43')](_0x15e6d4)[_0x686c('0x21')](handleEntityNotFound(_0x1d5188,null))[_0x686c('0x21')](respondWithResult(_0x1d5188,null))['catch'](handleError(_0x1d5188,null));};exports[_0x686c('0x44')]=function(_0x549afd,_0x14cd82){return db['Template'][_0x686c('0x44')](_0x549afd['body'],{})[_0x686c('0x21')](function(_0x10e432){var _0x3df12d=_0x549afd[_0x686c('0x45')][_0x686c('0x22')]({'plain':!![]});if(!_0x3df12d)throw new Error(_0x686c('0x46'));if(_0x3df12d[_0x686c('0x47')]===_0x686c('0x45')){var _0x85c3b5=_0x10e432[_0x686c('0x22')]({'plain':!![]});var _0x1723fa=_0x686c('0x48');return db[_0x686c('0x49')][_0x686c('0x43')]({'where':{'name':_0x1723fa,'userProfileId':_0x3df12d[_0x686c('0x4a')]},'raw':!![]})[_0x686c('0x21')](function(_0x224286){if(_0x224286&&_0x224286[_0x686c('0x4b')]===0x0){return db[_0x686c('0x23')][_0x686c('0x44')]({'name':_0x85c3b5[_0x686c('0x26')],'resourceId':_0x85c3b5['id'],'type':_0x224286[_0x686c('0x26')],'sectionId':_0x224286['id']},{})[_0x686c('0x21')](function(){return _0x10e432;});}else{return _0x10e432;}})[_0x686c('0x3e')](function(_0x3e4725){logger[_0x686c('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e4725);throw _0x3e4725;});}return _0x10e432;})[_0x686c('0x21')](respondWithResult(_0x14cd82,0xc9))[_0x686c('0x3e')](handleError(_0x14cd82,null));};exports[_0x686c('0x1f')]=function(_0x1601c2,_0x1e995f){if(_0x1601c2[_0x686c('0x4d')]['id']){delete _0x1601c2[_0x686c('0x4d')]['id'];}return db[_0x686c('0x3c')][_0x686c('0x43')]({'where':{'id':_0x1601c2[_0x686c('0x40')]['id']}})[_0x686c('0x21')](handleEntityNotFound(_0x1e995f,null))[_0x686c('0x21')](saveUpdates(_0x1601c2[_0x686c('0x4d')],null))['then'](respondWithResult(_0x1e995f,null))[_0x686c('0x3e')](handleError(_0x1e995f,null));};exports[_0x686c('0x20')]=function(_0x28b8ef,_0x415217){return db[_0x686c('0x3c')][_0x686c('0x43')]({'where':{'id':_0x28b8ef[_0x686c('0x40')]['id']}})[_0x686c('0x21')](handleEntityNotFound(_0x415217,null))[_0x686c('0x21')](removeEntity(_0x415217,null))[_0x686c('0x3e')](handleError(_0x415217,null));}; \ No newline at end of file +var _0x9d8c=['eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','count','set','json','apply','reject','save','update','destroy','then','get','Templates','UserProfileResource','end','name','send','index','map','Template','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','type','filter','options','includeAll','findAll','show','params','rawAttributes','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x2bd641,_0x2a0677){var _0x441732=function(_0x46eff4){while(--_0x46eff4){_0x2bd641['push'](_0x2bd641['shift']());}};_0x441732(++_0x2a0677);}(_0x9d8c,0x172));var _0xc9d8=function(_0x5ca0b9,_0x410bd6){_0x5ca0b9=_0x5ca0b9-0x0;var _0x42fe7f=_0x9d8c[_0x5ca0b9];return _0x42fe7f;};'use strict';var emlformat=require(_0xc9d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc9d8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9d8('0x2'));var moment=require(_0xc9d8('0x3'));var BPromise=require(_0xc9d8('0x4'));var Mustache=require(_0xc9d8('0x5'));var util=require(_0xc9d8('0x6'));var path=require('path');var sox=require(_0xc9d8('0x7'));var csv=require(_0xc9d8('0x8'));var ejs=require(_0xc9d8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9d8('0xa'));var squel=require(_0xc9d8('0xb'));var crypto=require(_0xc9d8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc9d8('0x8'));var querystring=require('querystring');var Papa=require(_0xc9d8('0xd'));var Redis=require(_0xc9d8('0xe'));var authService=require(_0xc9d8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc9d8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc9d8('0x11'));var config=require(_0xc9d8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc9d8('0x13'))['db'];function respondWithStatusCode(_0x3e2889,_0x39ad62){_0x39ad62=_0x39ad62||0xcc;return function(_0x1bf619){if(_0x1bf619){return _0x3e2889[_0xc9d8('0x14')](_0x39ad62);}return _0x3e2889['status'](_0x39ad62)['end']();};}function respondWithResult(_0xa9579b,_0x375b1a){_0x375b1a=_0x375b1a||0xc8;return function(_0x37ee35){if(_0x37ee35){return _0xa9579b[_0xc9d8('0x15')](_0x375b1a)['json'](_0x37ee35);}};}function respondWithFilteredResult(_0x36e081,_0xa67122){return function(_0x582284){if(_0x582284){var _0x868426=typeof _0xa67122[_0xc9d8('0x16')]==='undefined'&&typeof _0xa67122[_0xc9d8('0x17')]==='undefined';var _0x3f5d0a=_0x582284['count'];var _0x1705d7=_0x868426?0x0:_0xa67122['offset'];var _0x10d5c7=_0x868426?_0x582284[_0xc9d8('0x18')]:_0xa67122[_0xc9d8('0x16')]+_0xa67122[_0xc9d8('0x17')];var _0x3c9f22;if(_0x10d5c7>=_0x3f5d0a){_0x10d5c7=_0x3f5d0a;_0x3c9f22=0xc8;}else{_0x3c9f22=0xce;}_0x36e081[_0xc9d8('0x15')](_0x3c9f22);return _0x36e081[_0xc9d8('0x19')]('Content-Range',_0x1705d7+'-'+_0x10d5c7+'/'+_0x3f5d0a)[_0xc9d8('0x1a')](_0x582284);}return null;};}function patchUpdates(_0x508868){return function(_0x14da24){try{jsonpatch[_0xc9d8('0x1b')](_0x14da24,_0x508868,!![]);}catch(_0x2feb7b){return BPromise[_0xc9d8('0x1c')](_0x2feb7b);}return _0x14da24[_0xc9d8('0x1d')]();};}function saveUpdates(_0x38d935,_0x238ed4){return function(_0x4f7d13){if(_0x4f7d13){return _0x4f7d13[_0xc9d8('0x1e')](_0x38d935)['then'](function(_0xd67e95){return _0xd67e95;});}return null;};}function removeEntity(_0x14c210,_0x2982f4){return function(_0x58da33){if(_0x58da33){return _0x58da33[_0xc9d8('0x1f')]()[_0xc9d8('0x20')](function(){var _0x34a02d=_0x58da33[_0xc9d8('0x21')]({'plain':!![]});var _0xaa8e00=_0xc9d8('0x22');return db[_0xc9d8('0x23')][_0xc9d8('0x1f')]({'where':{'type':_0xaa8e00,'resourceId':_0x34a02d['id']}})[_0xc9d8('0x20')](function(){return _0x58da33;});})[_0xc9d8('0x20')](function(){_0x14c210[_0xc9d8('0x15')](0xcc)[_0xc9d8('0x24')]();});}};}function handleEntityNotFound(_0x16f8ff,_0xb77ed4){return function(_0x221794){if(!_0x221794){_0x16f8ff[_0xc9d8('0x14')](0x194);}return _0x221794;};}function handleError(_0x1f6482,_0x5b0f1b){_0x5b0f1b=_0x5b0f1b||0x1f4;return function(_0x74ccb8){logger['error'](_0x74ccb8['stack']);if(_0x74ccb8[_0xc9d8('0x25')]){delete _0x74ccb8[_0xc9d8('0x25')];}_0x1f6482['status'](_0x5b0f1b)[_0xc9d8('0x26')](_0x74ccb8);};}exports[_0xc9d8('0x27')]=function(_0x3af615,_0x27ec9b){var _0x2c4637={},_0x27189c={},_0xf20141={'count':0x0,'rows':[]};var _0x3fcf4e=_[_0xc9d8('0x28')](db[_0xc9d8('0x29')]['rawAttributes'],function(_0xb9330f){return{'name':_0xb9330f['fieldName'],'type':_0xb9330f['type'][_0xc9d8('0x2a')]};});_0x27189c[_0xc9d8('0x2b')]=_['map'](_0x3fcf4e,'name');_0x27189c[_0xc9d8('0x2c')]=_[_0xc9d8('0x2d')](_0x3af615['query']);_0x27189c[_0xc9d8('0x2e')]=_[_0xc9d8('0x2f')](_0x27189c[_0xc9d8('0x2b')],_0x27189c[_0xc9d8('0x2c')]);_0x2c4637['attributes']=_[_0xc9d8('0x2f')](_0x27189c['model'],qs[_0xc9d8('0x30')](_0x3af615[_0xc9d8('0x2c')][_0xc9d8('0x30')]));_0x2c4637['attributes']=_0x2c4637[_0xc9d8('0x31')][_0xc9d8('0x32')]?_0x2c4637[_0xc9d8('0x31')]:_0x27189c[_0xc9d8('0x2b')];if(!_0x3af615[_0xc9d8('0x2c')][_0xc9d8('0x33')]('nolimit')){_0x2c4637[_0xc9d8('0x17')]=qs[_0xc9d8('0x17')](_0x3af615['query']['limit']);_0x2c4637['offset']=qs[_0xc9d8('0x16')](_0x3af615[_0xc9d8('0x2c')][_0xc9d8('0x16')]);}_0x2c4637[_0xc9d8('0x34')]=qs[_0xc9d8('0x35')](_0x3af615[_0xc9d8('0x2c')]['sort']);_0x2c4637[_0xc9d8('0x36')]=qs[_0xc9d8('0x2e')](_[_0xc9d8('0x37')](_0x3af615[_0xc9d8('0x2c')],_0x27189c[_0xc9d8('0x2e')]),_0x3fcf4e);if(_0x3af615[_0xc9d8('0x2c')]['filter']){_0x2c4637[_0xc9d8('0x36')]=_[_0xc9d8('0x38')](_0x2c4637[_0xc9d8('0x36')],{'$or':_['map'](_0x3fcf4e,function(_0x4d7b68){if(_0x4d7b68[_0xc9d8('0x39')]!=='VIRTUAL'){var _0x370a89={};_0x370a89[_0x4d7b68[_0xc9d8('0x25')]]={'$like':'%'+_0x3af615[_0xc9d8('0x2c')][_0xc9d8('0x3a')]+'%'};return _0x370a89;}})});}_0x2c4637=_['merge']({},_0x2c4637,_0x3af615[_0xc9d8('0x3b')]);var _0x43bb08={'where':_0x2c4637[_0xc9d8('0x36')]};return db[_0xc9d8('0x29')][_0xc9d8('0x18')](_0x43bb08)[_0xc9d8('0x20')](function(_0x42f4e6){_0xf20141[_0xc9d8('0x18')]=_0x42f4e6;if(_0x3af615[_0xc9d8('0x2c')][_0xc9d8('0x3c')]){_0x2c4637['include']=[{'all':!![]}];}return db[_0xc9d8('0x29')][_0xc9d8('0x3d')](_0x2c4637);})[_0xc9d8('0x20')](function(_0x4471ad){_0xf20141['rows']=_0x4471ad;return _0xf20141;})[_0xc9d8('0x20')](respondWithFilteredResult(_0x27ec9b,_0x2c4637))['catch'](handleError(_0x27ec9b,null));};exports[_0xc9d8('0x3e')]=function(_0x516ea8,_0x8f0b9){var _0xcbd19b={'raw':!![],'where':{'id':_0x516ea8[_0xc9d8('0x3f')]['id']}},_0x59cd4b={};_0x59cd4b[_0xc9d8('0x2b')]=_[_0xc9d8('0x2d')](db[_0xc9d8('0x29')][_0xc9d8('0x40')]);_0x59cd4b[_0xc9d8('0x2c')]=_[_0xc9d8('0x2d')](_0x516ea8[_0xc9d8('0x2c')]);_0x59cd4b[_0xc9d8('0x2e')]=_[_0xc9d8('0x2f')](_0x59cd4b[_0xc9d8('0x2b')],_0x59cd4b['query']);_0xcbd19b[_0xc9d8('0x31')]=_[_0xc9d8('0x2f')](_0x59cd4b[_0xc9d8('0x2b')],qs[_0xc9d8('0x30')](_0x516ea8[_0xc9d8('0x2c')][_0xc9d8('0x30')]));_0xcbd19b[_0xc9d8('0x31')]=_0xcbd19b[_0xc9d8('0x31')][_0xc9d8('0x32')]?_0xcbd19b[_0xc9d8('0x31')]:_0x59cd4b[_0xc9d8('0x2b')];if(_0x516ea8['query']['includeAll']){_0xcbd19b['include']=[{'all':!![]}];}_0xcbd19b=_['merge']({},_0xcbd19b,_0x516ea8[_0xc9d8('0x3b')]);return db['Template']['find'](_0xcbd19b)['then'](handleEntityNotFound(_0x8f0b9,null))[_0xc9d8('0x20')](respondWithResult(_0x8f0b9,null))[_0xc9d8('0x41')](handleError(_0x8f0b9,null));};exports[_0xc9d8('0x42')]=function(_0x2e8aae,_0x1f2412){return db[_0xc9d8('0x29')][_0xc9d8('0x42')](_0x2e8aae['body'],{})[_0xc9d8('0x20')](function(_0x34e4f2){var _0x3fa2e7=_0x2e8aae[_0xc9d8('0x43')][_0xc9d8('0x21')]({'plain':!![]});if(!_0x3fa2e7)throw new Error(_0xc9d8('0x44'));if(_0x3fa2e7['role']===_0xc9d8('0x43')){var _0x14e3de=_0x34e4f2[_0xc9d8('0x21')]({'plain':!![]});var _0x4ba31d=_0xc9d8('0x22');return db[_0xc9d8('0x45')][_0xc9d8('0x46')]({'where':{'name':_0x4ba31d,'userProfileId':_0x3fa2e7['userProfileId']},'raw':!![]})[_0xc9d8('0x20')](function(_0x2b25b4){if(_0x2b25b4&&_0x2b25b4['autoAssociation']===0x0){return db[_0xc9d8('0x23')]['create']({'name':_0x14e3de[_0xc9d8('0x25')],'resourceId':_0x14e3de['id'],'type':_0x2b25b4[_0xc9d8('0x25')],'sectionId':_0x2b25b4['id']},{})[_0xc9d8('0x20')](function(){return _0x34e4f2;});}else{return _0x34e4f2;}})[_0xc9d8('0x41')](function(_0x21ab62){logger[_0xc9d8('0x47')](_0xc9d8('0x48'),_0x21ab62);throw _0x21ab62;});}return _0x34e4f2;})[_0xc9d8('0x20')](respondWithResult(_0x1f2412,0xc9))[_0xc9d8('0x41')](handleError(_0x1f2412,null));};exports[_0xc9d8('0x1e')]=function(_0x138c05,_0x279329){if(_0x138c05[_0xc9d8('0x49')]['id']){delete _0x138c05['body']['id'];}return db['Template'][_0xc9d8('0x46')]({'where':{'id':_0x138c05[_0xc9d8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x279329,null))[_0xc9d8('0x20')](saveUpdates(_0x138c05[_0xc9d8('0x49')],null))[_0xc9d8('0x20')](respondWithResult(_0x279329,null))['catch'](handleError(_0x279329,null));};exports[_0xc9d8('0x1f')]=function(_0x1c3a29,_0x14dfa6){return db[_0xc9d8('0x29')][_0xc9d8('0x46')]({'where':{'id':_0x1c3a29[_0xc9d8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x14dfa6,null))[_0xc9d8('0x20')](removeEntity(_0x14dfa6,null))[_0xc9d8('0x41')](handleError(_0x14dfa6,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 7b891a0..a1e3787 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 _0xb6df=['define','Template','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports'];(function(_0x42b306,_0x273689){var _0x32105e=function(_0x54c3ab){while(--_0x54c3ab){_0x42b306['push'](_0x42b306['shift']());}};_0x32105e(++_0x273689);}(_0xb6df,0xa7));var _0xfb6d=function(_0x396430,_0x3e7ee0){_0x396430=_0x396430-0x0;var _0x3f4729=_0xb6df[_0x396430];return _0x3f4729;};'use strict';var _=require(_0xfb6d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfb6d('0x1'));var BPromise=require(_0xfb6d('0x2'));var rp=require(_0xfb6d('0x3'));var fs=require('fs');var path=require(_0xfb6d('0x4'));var rimraf=require(_0xfb6d('0x5'));var config=require(_0xfb6d('0x6'));var attributes=require(_0xfb6d('0x7'));module[_0xfb6d('0x8')]=function(_0x38aa15,_0x394c11){return _0x38aa15[_0xfb6d('0x9')](_0xfb6d('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x891e=['exports','define','Template','tools_templates','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1da13d,_0x22ed77){var _0x834533=function(_0x426164){while(--_0x426164){_0x1da13d['push'](_0x1da13d['shift']());}};_0x834533(++_0x22ed77);}(_0x891e,0x130));var _0xe891=function(_0x4bedce,_0x265ebf){_0x4bedce=_0x4bedce-0x0;var _0x4fd2fb=_0x891e[_0x4bedce];return _0x4fd2fb;};'use strict';var _=require('lodash');var util=require(_0xe891('0x0'));var logger=require(_0xe891('0x1'))(_0xe891('0x2'));var moment=require('moment');var BPromise=require(_0xe891('0x3'));var rp=require(_0xe891('0x4'));var fs=require('fs');var path=require(_0xe891('0x5'));var rimraf=require(_0xe891('0x6'));var config=require(_0xe891('0x7'));var attributes=require('./template.attributes');module[_0xe891('0x8')]=function(_0x119e3d,_0x206fb0){return _0x119e3d[_0xe891('0x9')](_0xe891('0xa'),attributes,{'tableName':_0xe891('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 2ce56d4..67da817 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 _0x95c0=['debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','options','where','limit','include','map','model','attributes','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent'];(function(_0x4378b6,_0x26dfad){var _0x3072e2=function(_0x288ec9){while(--_0x288ec9){_0x4378b6['push'](_0x4378b6['shift']());}};_0x3072e2(++_0x26dfad);}(_0x95c0,0x74));var _0x095c=function(_0x18674f,_0xd18629){_0x18674f=_0x18674f-0x0;var _0x33543d=_0x95c0[_0x18674f];return _0x33543d;};'use strict';var _=require(_0x095c('0x0'));var util=require('util');var moment=require(_0x095c('0x1'));var BPromise=require(_0x095c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x095c('0x3'));var db=require(_0x095c('0x4'))['db'];var utils=require(_0x095c('0x5'));var logger=require(_0x095c('0x6'))('rpc');var config=require(_0x095c('0x7'));var jayson=require(_0x095c('0x8'));var client=jayson[_0x095c('0x9')][_0x095c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b48f2,_0xb85389,_0x528371){return new BPromise(function(_0x3ea2e5,_0x469deb){return client[_0x095c('0xb')](_0x3b48f2,_0x528371)[_0x095c('0xc')](function(_0x4c8bb3){logger[_0x095c('0xd')](_0x095c('0xe'),_0xb85389,_0x095c('0xf'));logger[_0x095c('0x10')](_0x095c('0x11'),_0xb85389,_0x095c('0xf'),JSON[_0x095c('0x12')](_0x4c8bb3));if(_0x4c8bb3[_0x095c('0x13')]){if(_0x4c8bb3[_0x095c('0x13')][_0x095c('0x14')]===0x1f4){logger['error'](_0x095c('0xe'),_0xb85389,_0x4c8bb3[_0x095c('0x13')][_0x095c('0x15')]);return _0x469deb(_0x4c8bb3['error'][_0x095c('0x15')]);}logger['error']('Template,\x20%s,\x20%s',_0xb85389,_0x4c8bb3[_0x095c('0x13')][_0x095c('0x15')]);return _0x3ea2e5(_0x4c8bb3[_0x095c('0x13')][_0x095c('0x15')]);}else{logger[_0x095c('0xd')](_0x095c('0xe'),_0xb85389,_0x095c('0xf'));_0x3ea2e5(_0x4c8bb3[_0x095c('0x16')]['message']);}})[_0x095c('0x17')](function(_0x2d19fc){logger[_0x095c('0x13')](_0x095c('0xe'),_0xb85389,_0x2d19fc);_0x469deb(_0x2d19fc);});});}exports[_0x095c('0x18')]=function(_0x439ca5){var _0x379807=this;return new Promise(function(_0x4d1b02,_0x461d26){return db[_0x095c('0x19')]['findAll']({'raw':_0x439ca5[_0x095c('0x1a')]?_0x439ca5[_0x095c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x439ca5[_0x095c('0x1a')]?_0x439ca5[_0x095c('0x1a')][_0x095c('0x1b')]||null:null,'attributes':_0x439ca5[_0x095c('0x1a')]?_0x439ca5[_0x095c('0x1a')]['attributes']||null:null,'limit':_0x439ca5[_0x095c('0x1a')]?_0x439ca5[_0x095c('0x1a')][_0x095c('0x1c')]||null:null,'include':_0x439ca5[_0x095c('0x1a')]?_0x439ca5['options'][_0x095c('0x1d')]?_[_0x095c('0x1e')](_0x439ca5[_0x095c('0x1a')][_0x095c('0x1d')],function(_0x396115){return{'model':db[_0x396115['model']],'as':_0x396115['as'],'attributes':_0x396115['attributes'],'include':_0x396115[_0x095c('0x1d')]?_['map'](_0x396115['include'],function(_0x2f88cd){return{'model':db[_0x2f88cd[_0x095c('0x1f')]],'as':_0x2f88cd['as'],'attributes':_0x2f88cd[_0x095c('0x20')],'include':_0x2f88cd[_0x095c('0x1d')]?_[_0x095c('0x1e')](_0x2f88cd[_0x095c('0x1d')],function(_0x21283c){return{'model':db[_0x21283c['model']],'as':_0x21283c['as'],'attributes':_0x21283c[_0x095c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x095c('0xc')](function(_0x38ee33){logger[_0x095c('0xd')](_0x095c('0x18'),_0x439ca5);logger['debug'](_0x095c('0x18'),_0x439ca5,JSON['stringify'](_0x38ee33));_0x4d1b02(_0x38ee33);})[_0x095c('0x17')](function(_0x3e613e){logger[_0x095c('0x13')]('GetTemplate',_0x3e613e['message'],_0x439ca5);_0x461d26(_0x379807['error'](0x1f4,_0x3e613e[_0x095c('0x15')]));});});}; \ No newline at end of file +var _0x2567=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','where','attributes','limit','include','map','model','lodash','util','moment'];(function(_0x3b876c,_0x340f60){var _0x2d5333=function(_0x2d5bf1){while(--_0x2d5bf1){_0x3b876c['push'](_0x3b876c['shift']());}};_0x2d5333(++_0x340f60);}(_0x2567,0x14a));var _0x7256=function(_0x11499b,_0x56cdad){_0x11499b=_0x11499b-0x0;var _0x5e207b=_0x2567[_0x11499b];return _0x5e207b;};'use strict';var _=require(_0x7256('0x0'));var util=require(_0x7256('0x1'));var moment=require(_0x7256('0x2'));var BPromise=require(_0x7256('0x3'));var rs=require(_0x7256('0x4'));var fs=require('fs');var Redis=require(_0x7256('0x5'));var db=require(_0x7256('0x6'))['db'];var utils=require(_0x7256('0x7'));var logger=require(_0x7256('0x8'))(_0x7256('0x9'));var config=require(_0x7256('0xa'));var jayson=require(_0x7256('0xb'));var client=jayson[_0x7256('0xc')][_0x7256('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x94de30,_0x55aba0,_0x18d39f){return new BPromise(function(_0x41ea59,_0x55723d){return client[_0x7256('0xe')](_0x94de30,_0x18d39f)[_0x7256('0xf')](function(_0x14eee4){logger[_0x7256('0x10')](_0x7256('0x11'),_0x55aba0,_0x7256('0x12'));logger[_0x7256('0x13')](_0x7256('0x14'),_0x55aba0,_0x7256('0x12'),JSON[_0x7256('0x15')](_0x14eee4));if(_0x14eee4[_0x7256('0x16')]){if(_0x14eee4[_0x7256('0x16')][_0x7256('0x17')]===0x1f4){logger[_0x7256('0x16')]('Template,\x20%s,\x20%s',_0x55aba0,_0x14eee4['error'][_0x7256('0x18')]);return _0x55723d(_0x14eee4[_0x7256('0x16')][_0x7256('0x18')]);}logger[_0x7256('0x16')]('Template,\x20%s,\x20%s',_0x55aba0,_0x14eee4[_0x7256('0x16')][_0x7256('0x18')]);return _0x41ea59(_0x14eee4['error'][_0x7256('0x18')]);}else{logger[_0x7256('0x10')](_0x7256('0x11'),_0x55aba0,_0x7256('0x12'));_0x41ea59(_0x14eee4[_0x7256('0x19')]['message']);}})[_0x7256('0x1a')](function(_0x21eb01){logger[_0x7256('0x16')](_0x7256('0x11'),_0x55aba0,_0x21eb01);_0x55723d(_0x21eb01);});});}exports[_0x7256('0x1b')]=function(_0xa08eaa){var _0x13277a=this;return new Promise(function(_0x16d98a,_0xaf2b84){return db[_0x7256('0x1c')][_0x7256('0x1d')]({'raw':_0xa08eaa[_0x7256('0x1e')]?_0xa08eaa[_0x7256('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xa08eaa[_0x7256('0x1e')]?_0xa08eaa[_0x7256('0x1e')][_0x7256('0x1f')]||null:null,'attributes':_0xa08eaa[_0x7256('0x1e')]?_0xa08eaa[_0x7256('0x1e')][_0x7256('0x20')]||null:null,'limit':_0xa08eaa[_0x7256('0x1e')]?_0xa08eaa[_0x7256('0x1e')][_0x7256('0x21')]||null:null,'include':_0xa08eaa[_0x7256('0x1e')]?_0xa08eaa[_0x7256('0x1e')][_0x7256('0x22')]?_[_0x7256('0x23')](_0xa08eaa[_0x7256('0x1e')][_0x7256('0x22')],function(_0x3f2554){return{'model':db[_0x3f2554[_0x7256('0x24')]],'as':_0x3f2554['as'],'attributes':_0x3f2554['attributes'],'include':_0x3f2554[_0x7256('0x22')]?_[_0x7256('0x23')](_0x3f2554[_0x7256('0x22')],function(_0xf68163){return{'model':db[_0xf68163[_0x7256('0x24')]],'as':_0xf68163['as'],'attributes':_0xf68163[_0x7256('0x20')],'include':_0xf68163[_0x7256('0x22')]?_['map'](_0xf68163['include'],function(_0x924b10){return{'model':db[_0x924b10[_0x7256('0x24')]],'as':_0x924b10['as'],'attributes':_0x924b10[_0x7256('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7256('0xf')](function(_0x506935){logger[_0x7256('0x10')]('GetTemplate',_0xa08eaa);logger[_0x7256('0x13')](_0x7256('0x1b'),_0xa08eaa,JSON['stringify'](_0x506935));_0x16d98a(_0x506935);})[_0x7256('0x1a')](function(_0x16e75a){logger[_0x7256('0x16')](_0x7256('0x1b'),_0x16e75a[_0x7256('0x18')],_0xa08eaa);_0xaf2b84(_0x13277a[_0x7256('0x16')](0x1f4,_0x16e75a[_0x7256('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 824b2b8..7a07d9a 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 _0xe5a9=['/:id','isAuthenticated','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','post','create','addAllCondition','/:id/actions','addAction','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get'];(function(_0x10a41d,_0x1aada0){var _0x864366=function(_0x513932){while(--_0x513932){_0x10a41d['push'](_0x10a41d['shift']());}};_0x864366(++_0x1aada0);}(_0xe5a9,0x9e));var _0x9e5a=function(_0x13292f,_0x203f6f){_0x13292f=_0x13292f-0x0;var _0x4a2038=_0xe5a9[_0x13292f];return _0x4a2038;};'use strict';var multer=require('multer');var util=require(_0x9e5a('0x0'));var path=require(_0x9e5a('0x1'));var timeout=require(_0x9e5a('0x2'));var express=require(_0x9e5a('0x3'));var router=express[_0x9e5a('0x4')]();var fs_extra=require(_0x9e5a('0x5'));var auth=require(_0x9e5a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9e5a('0x7'));var controller=require(_0x9e5a('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9e5a('0x9')](_0x9e5a('0xa'),auth[_0x9e5a('0xb')](),controller['show']);router[_0x9e5a('0x9')](_0x9e5a('0xc'),auth[_0x9e5a('0xb')](),controller[_0x9e5a('0xd')]);router['get'](_0x9e5a('0xe'),auth[_0x9e5a('0xb')](),controller[_0x9e5a('0xf')]);router['get']('/:id/actions',auth[_0x9e5a('0xb')](),controller['getActions']);router[_0x9e5a('0x10')]('/',auth[_0x9e5a('0xb')](),controller[_0x9e5a('0x11')]);router['post'](_0x9e5a('0xc'),auth[_0x9e5a('0xb')](),controller[_0x9e5a('0x12')]);router['post'](_0x9e5a('0xe'),auth[_0x9e5a('0xb')](),controller['addAnyCondition']);router[_0x9e5a('0x10')](_0x9e5a('0x13'),auth[_0x9e5a('0xb')](),controller[_0x9e5a('0x14')]);router[_0x9e5a('0x15')](_0x9e5a('0xa'),auth[_0x9e5a('0xb')](),controller[_0x9e5a('0x16')]);router[_0x9e5a('0x17')](_0x9e5a('0xa'),auth[_0x9e5a('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x234b=['addAnyCondition','addAction','put','delete','/:id','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','show','/:id/any_conditions','getAnyConditions','/:id/actions','post','/:id/all_conditions','addAllCondition'];(function(_0x689b17,_0x3aafdb){var _0x28461a=function(_0xd69922){while(--_0xd69922){_0x689b17['push'](_0x689b17['shift']());}};_0x28461a(++_0x3aafdb);}(_0x234b,0x8a));var _0xb234=function(_0x42204c,_0x39d3f1){_0x42204c=_0x42204c-0x0;var _0x530e87=_0x234b[_0x42204c];return _0x530e87;};'use strict';var multer=require(_0xb234('0x0'));var util=require(_0xb234('0x1'));var path=require(_0xb234('0x2'));var timeout=require(_0xb234('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb234('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb234('0x5'));var controller=require(_0xb234('0x6'));router[_0xb234('0x7')]('/',auth[_0xb234('0x8')](),controller['index']);router['get']('/:id',auth[_0xb234('0x8')](),controller[_0xb234('0x9')]);router[_0xb234('0x7')]('/:id/all_conditions',auth['isAuthenticated'](),controller['getAllConditions']);router['get'](_0xb234('0xa'),auth[_0xb234('0x8')](),controller[_0xb234('0xb')]);router['get'](_0xb234('0xc'),auth[_0xb234('0x8')](),controller['getActions']);router['post']('/',auth[_0xb234('0x8')](),controller['create']);router[_0xb234('0xd')](_0xb234('0xe'),auth[_0xb234('0x8')](),controller[_0xb234('0xf')]);router[_0xb234('0xd')](_0xb234('0xa'),auth['isAuthenticated'](),controller[_0xb234('0x10')]);router[_0xb234('0xd')](_0xb234('0xc'),auth[_0xb234('0x8')](),controller[_0xb234('0x11')]);router[_0xb234('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb234('0x13')](_0xb234('0x14'),auth[_0xb234('0x8')](),controller['destroy']);module[_0xb234('0x15')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index f59ca4f..b727c9b 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 _0x58f4=['STRING','BOOLEAN','exports'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0x58f4,0x1b2));var _0x458f=function(_0x451619,_0x1c7bb9){_0x451619=_0x451619-0x0;var _0x1b6455=_0x58f4[_0x451619];return _0x1b6455;};'use strict';var Sequelize=require('sequelize');module[_0x458f('0x0')]={'name':{'type':Sequelize[_0x458f('0x1')]},'channel':{'type':Sequelize[_0x458f('0x1')]},'description':{'type':Sequelize[_0x458f('0x1')]},'status':{'type':Sequelize[_0x458f('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3fa8=['BOOLEAN','sequelize','exports','STRING'];(function(_0x1b96fb,_0x22cffe){var _0x4e011d=function(_0x126d48){while(--_0x126d48){_0x1b96fb['push'](_0x1b96fb['shift']());}};_0x4e011d(++_0x22cffe);}(_0x3fa8,0x191));var _0x83fa=function(_0x149768,_0x1efa83){_0x149768=_0x149768-0x0;var _0x41644f=_0x3fa8[_0x149768];return _0x41644f;};'use strict';var Sequelize=require(_0x83fa('0x0'));module[_0x83fa('0x1')]={'name':{'type':Sequelize[_0x83fa('0x2')]},'channel':{'type':Sequelize[_0x83fa('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x83fa('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index b2bdd75..689110f 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 _0x3f61=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','nolimit','addAction','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','get','Triggers','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','Trigger','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','filter','options','count','includeAll','findAll','rows','catch','show','params','length','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x20f9a9,_0x1536e6){var _0x273941=function(_0xe4a5c7){while(--_0xe4a5c7){_0x20f9a9['push'](_0x20f9a9['shift']());}};_0x273941(++_0x1536e6);}(_0x3f61,0xd6));var _0x13f6=function(_0x2fadc1,_0x261757){_0x2fadc1=_0x2fadc1-0x0;var _0x50f074=_0x3f61[_0x2fadc1];return _0x50f074;};'use strict';var emlformat=require(_0x13f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x13f6('0x1'));var jsonpatch=require(_0x13f6('0x2'));var rp=require(_0x13f6('0x3'));var moment=require('moment');var BPromise=require(_0x13f6('0x4'));var Mustache=require(_0x13f6('0x5'));var util=require('util');var path=require(_0x13f6('0x6'));var sox=require('sox');var csv=require(_0x13f6('0x7'));var ejs=require(_0x13f6('0x8'));var fs=require('fs');var fs_extra=require(_0x13f6('0x9'));var _=require(_0x13f6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x13f6('0xb'));var toCsv=require(_0x13f6('0x7'));var querystring=require('querystring');var Papa=require(_0x13f6('0xc'));var Redis=require(_0x13f6('0xd'));var authService=require(_0x13f6('0xe'));var qs=require(_0x13f6('0xf'));var as=require(_0x13f6('0x10'));var hardwareService=require(_0x13f6('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x13f6('0x12'));var config=require(_0x13f6('0x13'));var licenseUtil=require(_0x13f6('0x14'));var db=require(_0x13f6('0x15'))['db'];function respondWithStatusCode(_0x15ef75,_0x49a5ab){_0x49a5ab=_0x49a5ab||0xcc;return function(_0x4392db){if(_0x4392db){return _0x15ef75['sendStatus'](_0x49a5ab);}return _0x15ef75[_0x13f6('0x16')](_0x49a5ab)[_0x13f6('0x17')]();};}function respondWithResult(_0x24b161,_0x2037b6){_0x2037b6=_0x2037b6||0xc8;return function(_0x1424b4){if(_0x1424b4){return _0x24b161['status'](_0x2037b6)[_0x13f6('0x18')](_0x1424b4);}};}function respondWithFilteredResult(_0x20526f,_0x4defb8){return function(_0x49496b){if(_0x49496b){var _0x214b5b=typeof _0x4defb8[_0x13f6('0x19')]===_0x13f6('0x1a')&&typeof _0x4defb8[_0x13f6('0x1b')]===_0x13f6('0x1a');var _0x17bfcb=_0x49496b['count'];var _0x47658a=_0x214b5b?0x0:_0x4defb8[_0x13f6('0x19')];var _0x334d79=_0x214b5b?_0x49496b['count']:_0x4defb8[_0x13f6('0x19')]+_0x4defb8[_0x13f6('0x1b')];var _0x42b7f9;if(_0x334d79>=_0x17bfcb){_0x334d79=_0x17bfcb;_0x42b7f9=0xc8;}else{_0x42b7f9=0xce;}_0x20526f['status'](_0x42b7f9);return _0x20526f[_0x13f6('0x1c')](_0x13f6('0x1d'),_0x47658a+'-'+_0x334d79+'/'+_0x17bfcb)[_0x13f6('0x18')](_0x49496b);}return null;};}function patchUpdates(_0x1515ae){return function(_0x444f31){try{jsonpatch[_0x13f6('0x1e')](_0x444f31,_0x1515ae,!![]);}catch(_0x44bc26){return BPromise[_0x13f6('0x1f')](_0x44bc26);}return _0x444f31['save']();};}function saveUpdates(_0xcb92c7,_0x5d3ec5){return function(_0x2a7c75){if(_0x2a7c75){return _0x2a7c75[_0x13f6('0x20')](_0xcb92c7)[_0x13f6('0x21')](function(_0x19e543){return _0x19e543;});}return null;};}function removeEntity(_0x20c00b,_0x5ebb75){return function(_0x560877){if(_0x560877){return _0x560877['destroy']()[_0x13f6('0x21')](function(){var _0x57fee7=_0x560877[_0x13f6('0x22')]({'plain':!![]});var _0x35ae4e=_0x13f6('0x23');return db[_0x13f6('0x24')][_0x13f6('0x25')]({'where':{'type':_0x35ae4e,'resourceId':_0x57fee7['id']}})[_0x13f6('0x21')](function(){return _0x560877;});})['then'](function(){_0x20c00b[_0x13f6('0x16')](0xcc)[_0x13f6('0x17')]();});}};}function handleEntityNotFound(_0x598f3f,_0x52e224){return function(_0x2006b2){if(!_0x2006b2){_0x598f3f[_0x13f6('0x26')](0x194);}return _0x2006b2;};}function handleError(_0x50569f,_0x575851){_0x575851=_0x575851||0x1f4;return function(_0x45bc7e){logger[_0x13f6('0x27')](_0x45bc7e[_0x13f6('0x28')]);if(_0x45bc7e[_0x13f6('0x29')]){delete _0x45bc7e[_0x13f6('0x29')];}_0x50569f['status'](_0x575851)[_0x13f6('0x2a')](_0x45bc7e);};}exports[_0x13f6('0x2b')]=function(_0x4d840c,_0x44a9d5){var _0x2e4e8b={},_0x4d0d06={},_0x5dbf46={'count':0x0,'rows':[]};var _0x2f0c28=_['map'](db[_0x13f6('0x2c')][_0x13f6('0x2d')],function(_0x23895b){return{'name':_0x23895b[_0x13f6('0x2e')],'type':_0x23895b['type'][_0x13f6('0x2f')]};});_0x4d0d06[_0x13f6('0x30')]=_[_0x13f6('0x31')](_0x2f0c28,_0x13f6('0x29'));_0x4d0d06[_0x13f6('0x32')]=_[_0x13f6('0x33')](_0x4d840c[_0x13f6('0x32')]);_0x4d0d06[_0x13f6('0x34')]=_['intersection'](_0x4d0d06[_0x13f6('0x30')],_0x4d0d06['query']);_0x2e4e8b[_0x13f6('0x35')]=_[_0x13f6('0x36')](_0x4d0d06[_0x13f6('0x30')],qs[_0x13f6('0x37')](_0x4d840c[_0x13f6('0x32')][_0x13f6('0x37')]));_0x2e4e8b['attributes']=_0x2e4e8b[_0x13f6('0x35')]['length']?_0x2e4e8b[_0x13f6('0x35')]:_0x4d0d06[_0x13f6('0x30')];if(!_0x4d840c[_0x13f6('0x32')][_0x13f6('0x38')]('nolimit')){_0x2e4e8b[_0x13f6('0x1b')]=qs[_0x13f6('0x1b')](_0x4d840c['query'][_0x13f6('0x1b')]);_0x2e4e8b[_0x13f6('0x19')]=qs['offset'](_0x4d840c['query']['offset']);}_0x2e4e8b[_0x13f6('0x39')]=qs[_0x13f6('0x3a')](_0x4d840c[_0x13f6('0x32')][_0x13f6('0x3a')]);_0x2e4e8b['where']=qs[_0x13f6('0x34')](_[_0x13f6('0x3b')](_0x4d840c['query'],_0x4d0d06[_0x13f6('0x34')]),_0x2f0c28);if(_0x4d840c[_0x13f6('0x32')]['filter']){_0x2e4e8b[_0x13f6('0x3c')]=_[_0x13f6('0x3d')](_0x2e4e8b['where'],{'$or':_[_0x13f6('0x31')](_0x2f0c28,function(_0x391e00){if(_0x391e00[_0x13f6('0x3e')]!==_0x13f6('0x3f')){var _0x2746de={};_0x2746de[_0x391e00['name']]={'$like':'%'+_0x4d840c[_0x13f6('0x32')][_0x13f6('0x40')]+'%'};return _0x2746de;}})});}_0x2e4e8b=_[_0x13f6('0x3d')]({},_0x2e4e8b,_0x4d840c[_0x13f6('0x41')]);var _0x8ba6c0={'where':_0x2e4e8b[_0x13f6('0x3c')]};return db[_0x13f6('0x2c')][_0x13f6('0x42')](_0x8ba6c0)[_0x13f6('0x21')](function(_0x1e8401){_0x5dbf46[_0x13f6('0x42')]=_0x1e8401;if(_0x4d840c[_0x13f6('0x32')][_0x13f6('0x43')]){_0x2e4e8b['include']=[{'all':!![]}];}return db[_0x13f6('0x2c')][_0x13f6('0x44')](_0x2e4e8b);})[_0x13f6('0x21')](function(_0x51cec1){_0x5dbf46[_0x13f6('0x45')]=_0x51cec1;return _0x5dbf46;})[_0x13f6('0x21')](respondWithFilteredResult(_0x44a9d5,_0x2e4e8b))[_0x13f6('0x46')](handleError(_0x44a9d5,null));};exports[_0x13f6('0x47')]=function(_0x27abd6,_0x5bf983){var _0x3fe26d={'raw':![],'where':{'id':_0x27abd6[_0x13f6('0x48')]['id']}},_0x73f8af={};_0x73f8af['model']=_[_0x13f6('0x33')](db['Trigger'][_0x13f6('0x2d')]);_0x73f8af['query']=_[_0x13f6('0x33')](_0x27abd6[_0x13f6('0x32')]);_0x73f8af['filters']=_[_0x13f6('0x36')](_0x73f8af[_0x13f6('0x30')],_0x73f8af[_0x13f6('0x32')]);_0x3fe26d[_0x13f6('0x35')]=_['intersection'](_0x73f8af[_0x13f6('0x30')],qs[_0x13f6('0x37')](_0x27abd6[_0x13f6('0x32')][_0x13f6('0x37')]));_0x3fe26d[_0x13f6('0x35')]=_0x3fe26d[_0x13f6('0x35')][_0x13f6('0x49')]?_0x3fe26d[_0x13f6('0x35')]:_0x73f8af[_0x13f6('0x30')];if(_0x27abd6[_0x13f6('0x32')][_0x13f6('0x43')]){_0x3fe26d[_0x13f6('0x4a')]=[{'all':!![]}];}_0x3fe26d=_['merge']({},_0x3fe26d,_0x27abd6[_0x13f6('0x41')]);return db[_0x13f6('0x2c')][_0x13f6('0x4b')](_0x3fe26d)[_0x13f6('0x21')](handleEntityNotFound(_0x5bf983,null))[_0x13f6('0x21')](respondWithResult(_0x5bf983,null))[_0x13f6('0x46')](handleError(_0x5bf983,null));};exports['create']=function(_0x44983b,_0x5efe9d){return db['Trigger'][_0x13f6('0x4c')](_0x44983b['body'],{})['then'](function(_0x5965ae){var _0x1522e4=_0x44983b[_0x13f6('0x4d')][_0x13f6('0x22')]({'plain':!![]});if(!_0x1522e4)throw new Error(_0x13f6('0x4e'));if(_0x1522e4[_0x13f6('0x4f')]===_0x13f6('0x4d')){var _0xc26b0a=_0x5965ae[_0x13f6('0x22')]({'plain':!![]});var _0x3e04f3=_0x13f6('0x23');return db[_0x13f6('0x50')][_0x13f6('0x4b')]({'where':{'name':_0x3e04f3,'userProfileId':_0x1522e4[_0x13f6('0x51')]},'raw':!![]})['then'](function(_0x4d927a){if(_0x4d927a&&_0x4d927a[_0x13f6('0x52')]===0x0){return db[_0x13f6('0x24')][_0x13f6('0x4c')]({'name':_0xc26b0a[_0x13f6('0x29')],'resourceId':_0xc26b0a['id'],'type':_0x4d927a[_0x13f6('0x29')],'sectionId':_0x4d927a['id']},{})[_0x13f6('0x21')](function(){return _0x5965ae;});}else{return _0x5965ae;}})[_0x13f6('0x46')](function(_0x4e4a5d){logger['error'](_0x13f6('0x53'),_0x4e4a5d);throw _0x4e4a5d;});}return _0x5965ae;})[_0x13f6('0x21')](respondWithResult(_0x5efe9d,0xc9))[_0x13f6('0x46')](handleError(_0x5efe9d,null));};exports[_0x13f6('0x20')]=function(_0x573200,_0x583d23){if(_0x573200[_0x13f6('0x54')]['id']){delete _0x573200['body']['id'];}return db[_0x13f6('0x2c')][_0x13f6('0x4b')]({'where':{'id':_0x573200[_0x13f6('0x48')]['id']}})[_0x13f6('0x21')](handleEntityNotFound(_0x583d23,null))['then'](saveUpdates(_0x573200['body'],null))[_0x13f6('0x21')](respondWithResult(_0x583d23,null))[_0x13f6('0x46')](handleError(_0x583d23,null));};exports[_0x13f6('0x25')]=function(_0x45bba0,_0x3ec285){return db['Trigger'][_0x13f6('0x4b')]({'where':{'id':_0x45bba0['params']['id']}})['then'](handleEntityNotFound(_0x3ec285,null))[_0x13f6('0x21')](removeEntity(_0x3ec285,null))['catch'](handleError(_0x3ec285,null));};exports[_0x13f6('0x55')]=function(_0xe223cc,_0x12b76d,_0x28fbef){if(_0xe223cc['body']['id']){delete _0xe223cc[_0x13f6('0x54')]['id'];}return db[_0x13f6('0x2c')][_0x13f6('0x4b')]({'where':{'id':_0xe223cc['params']['id']}})[_0x13f6('0x21')](handleEntityNotFound(_0x12b76d,null))['then'](function(_0x302170){if(_0x302170){_0xe223cc[_0x13f6('0x54')][_0x13f6('0x56')]=_0x302170['id'];return db[_0x13f6('0x57')][_0x13f6('0x4c')](_0xe223cc[_0x13f6('0x54')]);}})[_0x13f6('0x21')](respondWithResult(_0x12b76d,null))[_0x13f6('0x46')](handleError(_0x12b76d,null));};exports[_0x13f6('0x58')]=function(_0x20c394,_0x68419d,_0x4c7356){if(_0x20c394[_0x13f6('0x54')]['id']){delete _0x20c394['body']['id'];}return db[_0x13f6('0x2c')][_0x13f6('0x4b')]({'where':{'id':_0x20c394[_0x13f6('0x48')]['id']}})[_0x13f6('0x21')](handleEntityNotFound(_0x68419d,null))[_0x13f6('0x21')](function(_0x31123a){if(_0x31123a){_0x20c394[_0x13f6('0x54')][_0x13f6('0x59')]=_0x31123a['id'];return db[_0x13f6('0x57')]['create'](_0x20c394[_0x13f6('0x54')]);}})['then'](respondWithResult(_0x68419d,null))['catch'](handleError(_0x68419d,null));};exports[_0x13f6('0x5a')]=function(_0x5c8dc1,_0xc0b9ab,_0x3e5fbc){var _0x16aad0={};var _0x201dde={};var _0x53a43e;var _0x260012;return db[_0x13f6('0x2c')][_0x13f6('0x5b')]({'where':{'id':_0x5c8dc1[_0x13f6('0x48')]['id']}})[_0x13f6('0x21')](handleEntityNotFound(_0xc0b9ab,null))[_0x13f6('0x21')](function(_0x3ca2ea){if(_0x3ca2ea){_0x53a43e=_0x3ca2ea;_0x201dde[_0x13f6('0x30')]=_[_0x13f6('0x33')](db[_0x13f6('0x57')][_0x13f6('0x2d')]);_0x201dde['query']=_[_0x13f6('0x33')](_0x5c8dc1['query']);_0x201dde[_0x13f6('0x34')]=_[_0x13f6('0x36')](_0x201dde[_0x13f6('0x30')],_0x201dde['query']);_0x16aad0[_0x13f6('0x35')]=_[_0x13f6('0x36')](_0x201dde[_0x13f6('0x30')],qs[_0x13f6('0x37')](_0x5c8dc1[_0x13f6('0x32')][_0x13f6('0x37')]));_0x16aad0[_0x13f6('0x35')]=_0x16aad0['attributes']['length']?_0x16aad0[_0x13f6('0x35')]:_0x201dde[_0x13f6('0x30')];_0x16aad0[_0x13f6('0x39')]=qs[_0x13f6('0x3a')](_0x5c8dc1[_0x13f6('0x32')][_0x13f6('0x3a')]);_0x16aad0[_0x13f6('0x3c')]=qs[_0x13f6('0x34')](_[_0x13f6('0x3b')](_0x5c8dc1['query'],_0x201dde[_0x13f6('0x34')]));if(_0x5c8dc1[_0x13f6('0x32')]['filter']){_0x16aad0['where']=_['merge'](_0x16aad0['where'],{'$or':_['map'](_0x16aad0['attributes'],function(_0x11a052){var _0x255ffe={};_0x255ffe[_0x11a052]={'$like':'%'+_0x5c8dc1[_0x13f6('0x32')]['filter']+'%'};return _0x255ffe;})});}_0x16aad0=_[_0x13f6('0x3d')]({},_0x16aad0,_0x5c8dc1[_0x13f6('0x41')]);return _0x53a43e[_0x13f6('0x5a')](_0x16aad0);}})['then'](function(_0x29ae69){if(_0x29ae69){_0x260012=_0x29ae69['length'];if(!_0x5c8dc1[_0x13f6('0x32')][_0x13f6('0x38')]('nolimit')){_0x16aad0[_0x13f6('0x1b')]=qs[_0x13f6('0x1b')](_0x5c8dc1[_0x13f6('0x32')][_0x13f6('0x1b')]);_0x16aad0['offset']=qs[_0x13f6('0x19')](_0x5c8dc1[_0x13f6('0x32')][_0x13f6('0x19')]);}return _0x53a43e[_0x13f6('0x5a')](_0x16aad0);}})[_0x13f6('0x21')](function(_0x208a5b){if(_0x208a5b){return _0x208a5b?{'count':_0x260012,'rows':_0x208a5b}:null;}})[_0x13f6('0x21')](respondWithResult(_0xc0b9ab,null))['catch'](handleError(_0xc0b9ab,null));};exports[_0x13f6('0x5c')]=function(_0x3fa823,_0x185b85,_0xf5ab92){var _0x48978e={};var _0x2ae9de={};var _0x1f6a59;var _0x215292;return db[_0x13f6('0x2c')]['findOne']({'where':{'id':_0x3fa823[_0x13f6('0x48')]['id']}})[_0x13f6('0x21')](handleEntityNotFound(_0x185b85,null))[_0x13f6('0x21')](function(_0x410d5f){if(_0x410d5f){_0x1f6a59=_0x410d5f;_0x2ae9de['model']=_['keys'](db[_0x13f6('0x57')][_0x13f6('0x2d')]);_0x2ae9de[_0x13f6('0x32')]=_['keys'](_0x3fa823['query']);_0x2ae9de[_0x13f6('0x34')]=_['intersection'](_0x2ae9de['model'],_0x2ae9de['query']);_0x48978e['attributes']=_[_0x13f6('0x36')](_0x2ae9de['model'],qs[_0x13f6('0x37')](_0x3fa823[_0x13f6('0x32')][_0x13f6('0x37')]));_0x48978e['attributes']=_0x48978e[_0x13f6('0x35')]['length']?_0x48978e['attributes']:_0x2ae9de['model'];_0x48978e[_0x13f6('0x39')]=qs[_0x13f6('0x3a')](_0x3fa823['query'][_0x13f6('0x3a')]);_0x48978e['where']=qs[_0x13f6('0x34')](_[_0x13f6('0x3b')](_0x3fa823[_0x13f6('0x32')],_0x2ae9de[_0x13f6('0x34')]));if(_0x3fa823[_0x13f6('0x32')][_0x13f6('0x40')]){_0x48978e[_0x13f6('0x3c')]=_[_0x13f6('0x3d')](_0x48978e['where'],{'$or':_[_0x13f6('0x31')](_0x48978e[_0x13f6('0x35')],function(_0x20430d){var _0xa2c6cd={};_0xa2c6cd[_0x20430d]={'$like':'%'+_0x3fa823[_0x13f6('0x32')][_0x13f6('0x40')]+'%'};return _0xa2c6cd;})});}_0x48978e=_['merge']({},_0x48978e,_0x3fa823[_0x13f6('0x41')]);return _0x1f6a59[_0x13f6('0x5c')](_0x48978e);}})[_0x13f6('0x21')](function(_0x2b3b52){if(_0x2b3b52){_0x215292=_0x2b3b52[_0x13f6('0x49')];if(!_0x3fa823[_0x13f6('0x32')][_0x13f6('0x38')](_0x13f6('0x5d'))){_0x48978e[_0x13f6('0x1b')]=qs[_0x13f6('0x1b')](_0x3fa823['query']['limit']);_0x48978e[_0x13f6('0x19')]=qs[_0x13f6('0x19')](_0x3fa823['query']['offset']);}return _0x1f6a59['getAnyConditions'](_0x48978e);}})[_0x13f6('0x21')](function(_0x31bee1){if(_0x31bee1){return _0x31bee1?{'count':_0x215292,'rows':_0x31bee1}:null;}})[_0x13f6('0x21')](respondWithResult(_0x185b85,null))[_0x13f6('0x46')](handleError(_0x185b85,null));};exports[_0x13f6('0x5e')]=function(_0x13d1c1,_0x353670,_0xe3d4d4){if(_0x13d1c1[_0x13f6('0x54')]['id']){delete _0x13d1c1[_0x13f6('0x54')]['id'];}return db[_0x13f6('0x2c')][_0x13f6('0x4b')]({'where':{'id':_0x13d1c1[_0x13f6('0x48')]['id']}})['then'](handleEntityNotFound(_0x353670,null))['then'](function(_0x5be0cc){if(_0x5be0cc){_0x13d1c1[_0x13f6('0x54')][_0x13f6('0x5f')]=_0x5be0cc['id'];return db[_0x13f6('0x60')][_0x13f6('0x4c')](_0x13d1c1[_0x13f6('0x54')]);}})['then'](respondWithResult(_0x353670,null))['catch'](handleError(_0x353670,null));};exports['getActions']=function(_0x26007a,_0x149de7,_0x10e437){var _0x4798be={};var _0xd86af7={};var _0x27b59e;var _0x4c7034;return db[_0x13f6('0x2c')][_0x13f6('0x5b')]({'where':{'id':_0x26007a[_0x13f6('0x48')]['id']}})['then'](handleEntityNotFound(_0x149de7,null))[_0x13f6('0x21')](function(_0x4a25af){if(_0x4a25af){_0x27b59e=_0x4a25af;_0xd86af7[_0x13f6('0x30')]=_[_0x13f6('0x33')](db[_0x13f6('0x60')][_0x13f6('0x2d')]);_0xd86af7[_0x13f6('0x32')]=_[_0x13f6('0x33')](_0x26007a[_0x13f6('0x32')]);_0xd86af7[_0x13f6('0x34')]=_[_0x13f6('0x36')](_0xd86af7[_0x13f6('0x30')],_0xd86af7['query']);_0x4798be[_0x13f6('0x35')]=_[_0x13f6('0x36')](_0xd86af7[_0x13f6('0x30')],qs[_0x13f6('0x37')](_0x26007a[_0x13f6('0x32')][_0x13f6('0x37')]));_0x4798be[_0x13f6('0x35')]=_0x4798be['attributes'][_0x13f6('0x49')]?_0x4798be[_0x13f6('0x35')]:_0xd86af7[_0x13f6('0x30')];_0x4798be[_0x13f6('0x39')]=qs[_0x13f6('0x3a')](_0x26007a[_0x13f6('0x32')][_0x13f6('0x3a')]);_0x4798be['where']=qs[_0x13f6('0x34')](_[_0x13f6('0x3b')](_0x26007a[_0x13f6('0x32')],_0xd86af7[_0x13f6('0x34')]));if(_0x26007a[_0x13f6('0x32')][_0x13f6('0x40')]){_0x4798be[_0x13f6('0x3c')]=_[_0x13f6('0x3d')](_0x4798be[_0x13f6('0x3c')],{'$or':_[_0x13f6('0x31')](_0x4798be['attributes'],function(_0x50bf83){var _0x20a125={};_0x20a125[_0x50bf83]={'$like':'%'+_0x26007a[_0x13f6('0x32')][_0x13f6('0x40')]+'%'};return _0x20a125;})});}_0x4798be=_['merge']({},_0x4798be,_0x26007a[_0x13f6('0x41')]);return _0x27b59e[_0x13f6('0x61')](_0x4798be);}})['then'](function(_0x3a167a){if(_0x3a167a){_0x4c7034=_0x3a167a['length'];if(!_0x26007a[_0x13f6('0x32')][_0x13f6('0x38')]('nolimit')){_0x4798be[_0x13f6('0x1b')]=qs['limit'](_0x26007a[_0x13f6('0x32')][_0x13f6('0x1b')]);_0x4798be['offset']=qs['offset'](_0x26007a[_0x13f6('0x32')][_0x13f6('0x19')]);}return _0x27b59e[_0x13f6('0x61')](_0x4798be);}})[_0x13f6('0x21')](function(_0x49f494){if(_0x49f494){return _0x49f494?{'count':_0x4c7034,'rows':_0x49f494}:null;}})['then'](respondWithResult(_0x149de7,null))[_0x13f6('0x46')](handleError(_0x149de7,null));}; \ No newline at end of file +var _0x81cd=['Content-Range','apply','reject','save','destroy','then','get','Triggers','UserProfileResource','error','stack','name','send','index','map','fieldName','key','keys','model','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','Trigger','includeAll','include','findAll','catch','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','params','TriggerAllId','Condition','addAnyCondition','getAllConditions','getAnyConditions','findOne','addAction','Action','pick','getActions','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set'];(function(_0x2d1908,_0x45352d){var _0x14e672=function(_0x184888){while(--_0x184888){_0x2d1908['push'](_0x2d1908['shift']());}};_0x14e672(++_0x45352d);}(_0x81cd,0xa3));var _0xd81c=function(_0x2fdd4a,_0x521804){_0x2fdd4a=_0x2fdd4a-0x0;var _0xed9eb5=_0x81cd[_0x2fdd4a];return _0xed9eb5;};'use strict';var emlformat=require(_0xd81c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd81c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd81c('0x2'));var Mustache=require(_0xd81c('0x3'));var util=require(_0xd81c('0x4'));var path=require(_0xd81c('0x5'));var sox=require(_0xd81c('0x6'));var csv=require(_0xd81c('0x7'));var ejs=require(_0xd81c('0x8'));var fs=require('fs');var fs_extra=require(_0xd81c('0x9'));var _=require(_0xd81c('0xa'));var squel=require(_0xd81c('0xb'));var crypto=require(_0xd81c('0xc'));var jsforce=require(_0xd81c('0xd'));var deskjs=require(_0xd81c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd81c('0xf'));var Papa=require(_0xd81c('0x10'));var Redis=require(_0xd81c('0x11'));var authService=require(_0xd81c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd81c('0x13'));var hardwareService=require(_0xd81c('0x14'));var logger=require('../../config/logger')(_0xd81c('0x15'));var utils=require(_0xd81c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd81c('0x17'));var db=require(_0xd81c('0x18'))['db'];function respondWithStatusCode(_0xe05631,_0x507ef4){_0x507ef4=_0x507ef4||0xcc;return function(_0x733815){if(_0x733815){return _0xe05631[_0xd81c('0x19')](_0x507ef4);}return _0xe05631['status'](_0x507ef4)[_0xd81c('0x1a')]();};}function respondWithResult(_0x134d5e,_0x3a9e47){_0x3a9e47=_0x3a9e47||0xc8;return function(_0x5dc440){if(_0x5dc440){return _0x134d5e[_0xd81c('0x1b')](_0x3a9e47)[_0xd81c('0x1c')](_0x5dc440);}};}function respondWithFilteredResult(_0x251443,_0x4af6a8){return function(_0x4a8aac){if(_0x4a8aac){var _0x40c2e8=typeof _0x4af6a8[_0xd81c('0x1d')]===_0xd81c('0x1e')&&typeof _0x4af6a8['limit']===_0xd81c('0x1e');var _0x1feaeb=_0x4a8aac[_0xd81c('0x1f')];var _0x2e6ca8=_0x40c2e8?0x0:_0x4af6a8[_0xd81c('0x1d')];var _0x176b4b=_0x40c2e8?_0x4a8aac[_0xd81c('0x1f')]:_0x4af6a8['offset']+_0x4af6a8['limit'];var _0x3faae1;if(_0x176b4b>=_0x1feaeb){_0x176b4b=_0x1feaeb;_0x3faae1=0xc8;}else{_0x3faae1=0xce;}_0x251443[_0xd81c('0x1b')](_0x3faae1);return _0x251443[_0xd81c('0x20')](_0xd81c('0x21'),_0x2e6ca8+'-'+_0x176b4b+'/'+_0x1feaeb)[_0xd81c('0x1c')](_0x4a8aac);}return null;};}function patchUpdates(_0x53d015){return function(_0x500bd3){try{jsonpatch[_0xd81c('0x22')](_0x500bd3,_0x53d015,!![]);}catch(_0x3292dd){return BPromise[_0xd81c('0x23')](_0x3292dd);}return _0x500bd3[_0xd81c('0x24')]();};}function saveUpdates(_0x2a7d0f,_0x2cd321){return function(_0x49224b){if(_0x49224b){return _0x49224b['update'](_0x2a7d0f)['then'](function(_0x40450d){return _0x40450d;});}return null;};}function removeEntity(_0x5bcd85,_0x27c7ee){return function(_0x60a3e6){if(_0x60a3e6){return _0x60a3e6[_0xd81c('0x25')]()[_0xd81c('0x26')](function(){var _0x20b0c2=_0x60a3e6[_0xd81c('0x27')]({'plain':!![]});var _0x2c1604=_0xd81c('0x28');return db[_0xd81c('0x29')][_0xd81c('0x25')]({'where':{'type':_0x2c1604,'resourceId':_0x20b0c2['id']}})[_0xd81c('0x26')](function(){return _0x60a3e6;});})[_0xd81c('0x26')](function(){_0x5bcd85[_0xd81c('0x1b')](0xcc)[_0xd81c('0x1a')]();});}};}function handleEntityNotFound(_0x3deaac,_0x2c9533){return function(_0x17b459){if(!_0x17b459){_0x3deaac['sendStatus'](0x194);}return _0x17b459;};}function handleError(_0x2ef826,_0x3d71c2){_0x3d71c2=_0x3d71c2||0x1f4;return function(_0x272128){logger[_0xd81c('0x2a')](_0x272128[_0xd81c('0x2b')]);if(_0x272128['name']){delete _0x272128[_0xd81c('0x2c')];}_0x2ef826[_0xd81c('0x1b')](_0x3d71c2)[_0xd81c('0x2d')](_0x272128);};}exports[_0xd81c('0x2e')]=function(_0x359d44,_0x54a609){var _0x3a7587={},_0x3084f1={},_0x69e115={'count':0x0,'rows':[]};var _0x58828e=_[_0xd81c('0x2f')](db['Trigger']['rawAttributes'],function(_0x3e64bd){return{'name':_0x3e64bd[_0xd81c('0x30')],'type':_0x3e64bd['type'][_0xd81c('0x31')]};});_0x3084f1['model']=_['map'](_0x58828e,_0xd81c('0x2c'));_0x3084f1['query']=_[_0xd81c('0x32')](_0x359d44['query']);_0x3084f1['filters']=_['intersection'](_0x3084f1[_0xd81c('0x33')],_0x3084f1['query']);_0x3a7587['attributes']=_[_0xd81c('0x34')](_0x3084f1[_0xd81c('0x33')],qs[_0xd81c('0x35')](_0x359d44[_0xd81c('0x36')]['fields']));_0x3a7587[_0xd81c('0x37')]=_0x3a7587[_0xd81c('0x37')][_0xd81c('0x38')]?_0x3a7587[_0xd81c('0x37')]:_0x3084f1[_0xd81c('0x33')];if(!_0x359d44['query'][_0xd81c('0x39')](_0xd81c('0x3a'))){_0x3a7587[_0xd81c('0x3b')]=qs[_0xd81c('0x3b')](_0x359d44[_0xd81c('0x36')][_0xd81c('0x3b')]);_0x3a7587[_0xd81c('0x1d')]=qs[_0xd81c('0x1d')](_0x359d44[_0xd81c('0x36')][_0xd81c('0x1d')]);}_0x3a7587[_0xd81c('0x3c')]=qs[_0xd81c('0x3d')](_0x359d44[_0xd81c('0x36')][_0xd81c('0x3d')]);_0x3a7587[_0xd81c('0x3e')]=qs['filters'](_['pick'](_0x359d44[_0xd81c('0x36')],_0x3084f1[_0xd81c('0x3f')]),_0x58828e);if(_0x359d44['query'][_0xd81c('0x40')]){_0x3a7587[_0xd81c('0x3e')]=_[_0xd81c('0x41')](_0x3a7587[_0xd81c('0x3e')],{'$or':_[_0xd81c('0x2f')](_0x58828e,function(_0x2f52ee){if(_0x2f52ee[_0xd81c('0x42')]!==_0xd81c('0x43')){var _0x3c857f={};_0x3c857f[_0x2f52ee[_0xd81c('0x2c')]]={'$like':'%'+_0x359d44[_0xd81c('0x36')][_0xd81c('0x40')]+'%'};return _0x3c857f;}})});}_0x3a7587=_[_0xd81c('0x41')]({},_0x3a7587,_0x359d44[_0xd81c('0x44')]);var _0x50b92c={'where':_0x3a7587[_0xd81c('0x3e')]};return db[_0xd81c('0x45')][_0xd81c('0x1f')](_0x50b92c)[_0xd81c('0x26')](function(_0x5be91c){_0x69e115[_0xd81c('0x1f')]=_0x5be91c;if(_0x359d44[_0xd81c('0x36')][_0xd81c('0x46')]){_0x3a7587[_0xd81c('0x47')]=[{'all':!![]}];}return db[_0xd81c('0x45')][_0xd81c('0x48')](_0x3a7587);})[_0xd81c('0x26')](function(_0x484617){_0x69e115['rows']=_0x484617;return _0x69e115;})[_0xd81c('0x26')](respondWithFilteredResult(_0x54a609,_0x3a7587))[_0xd81c('0x49')](handleError(_0x54a609,null));};exports['show']=function(_0x4a15f7,_0x156f74){var _0x545f03={'raw':![],'where':{'id':_0x4a15f7['params']['id']}},_0x4df11c={};_0x4df11c[_0xd81c('0x33')]=_[_0xd81c('0x32')](db[_0xd81c('0x45')][_0xd81c('0x4a')]);_0x4df11c['query']=_[_0xd81c('0x32')](_0x4a15f7[_0xd81c('0x36')]);_0x4df11c[_0xd81c('0x3f')]=_[_0xd81c('0x34')](_0x4df11c[_0xd81c('0x33')],_0x4df11c[_0xd81c('0x36')]);_0x545f03[_0xd81c('0x37')]=_[_0xd81c('0x34')](_0x4df11c[_0xd81c('0x33')],qs['fields'](_0x4a15f7[_0xd81c('0x36')][_0xd81c('0x35')]));_0x545f03[_0xd81c('0x37')]=_0x545f03[_0xd81c('0x37')][_0xd81c('0x38')]?_0x545f03['attributes']:_0x4df11c[_0xd81c('0x33')];if(_0x4a15f7[_0xd81c('0x36')][_0xd81c('0x46')]){_0x545f03[_0xd81c('0x47')]=[{'all':!![]}];}_0x545f03=_[_0xd81c('0x41')]({},_0x545f03,_0x4a15f7['options']);return db[_0xd81c('0x45')]['find'](_0x545f03)[_0xd81c('0x26')](handleEntityNotFound(_0x156f74,null))[_0xd81c('0x26')](respondWithResult(_0x156f74,null))['catch'](handleError(_0x156f74,null));};exports[_0xd81c('0x4b')]=function(_0x221a27,_0x11d31d){return db[_0xd81c('0x45')][_0xd81c('0x4b')](_0x221a27[_0xd81c('0x4c')],{})[_0xd81c('0x26')](function(_0x3610e0){var _0x33b2c5=_0x221a27[_0xd81c('0x4d')][_0xd81c('0x27')]({'plain':!![]});if(!_0x33b2c5)throw new Error(_0xd81c('0x4e'));if(_0x33b2c5[_0xd81c('0x4f')]==='user'){var _0x783291=_0x3610e0[_0xd81c('0x27')]({'plain':!![]});var _0x282bc5=_0xd81c('0x28');return db[_0xd81c('0x50')][_0xd81c('0x51')]({'where':{'name':_0x282bc5,'userProfileId':_0x33b2c5[_0xd81c('0x52')]},'raw':!![]})[_0xd81c('0x26')](function(_0x3738f3){if(_0x3738f3&&_0x3738f3[_0xd81c('0x53')]===0x0){return db['UserProfileResource'][_0xd81c('0x4b')]({'name':_0x783291[_0xd81c('0x2c')],'resourceId':_0x783291['id'],'type':_0x3738f3[_0xd81c('0x2c')],'sectionId':_0x3738f3['id']},{})['then'](function(){return _0x3610e0;});}else{return _0x3610e0;}})[_0xd81c('0x49')](function(_0x44ace7){logger[_0xd81c('0x2a')](_0xd81c('0x54'),_0x44ace7);throw _0x44ace7;});}return _0x3610e0;})[_0xd81c('0x26')](respondWithResult(_0x11d31d,0xc9))['catch'](handleError(_0x11d31d,null));};exports[_0xd81c('0x55')]=function(_0x4c54c5,_0x397abf){if(_0x4c54c5[_0xd81c('0x4c')]['id']){delete _0x4c54c5[_0xd81c('0x4c')]['id'];}return db[_0xd81c('0x45')][_0xd81c('0x51')]({'where':{'id':_0x4c54c5['params']['id']}})['then'](handleEntityNotFound(_0x397abf,null))[_0xd81c('0x26')](saveUpdates(_0x4c54c5[_0xd81c('0x4c')],null))['then'](respondWithResult(_0x397abf,null))[_0xd81c('0x49')](handleError(_0x397abf,null));};exports[_0xd81c('0x25')]=function(_0x309be1,_0x30a7f3){return db[_0xd81c('0x45')][_0xd81c('0x51')]({'where':{'id':_0x309be1['params']['id']}})[_0xd81c('0x26')](handleEntityNotFound(_0x30a7f3,null))[_0xd81c('0x26')](removeEntity(_0x30a7f3,null))[_0xd81c('0x49')](handleError(_0x30a7f3,null));};exports[_0xd81c('0x56')]=function(_0x46eb7d,_0x2c2065,_0x48c0f3){if(_0x46eb7d[_0xd81c('0x4c')]['id']){delete _0x46eb7d[_0xd81c('0x4c')]['id'];}return db[_0xd81c('0x45')][_0xd81c('0x51')]({'where':{'id':_0x46eb7d[_0xd81c('0x57')]['id']}})['then'](handleEntityNotFound(_0x2c2065,null))[_0xd81c('0x26')](function(_0x103364){if(_0x103364){_0x46eb7d[_0xd81c('0x4c')][_0xd81c('0x58')]=_0x103364['id'];return db[_0xd81c('0x59')][_0xd81c('0x4b')](_0x46eb7d['body']);}})['then'](respondWithResult(_0x2c2065,null))[_0xd81c('0x49')](handleError(_0x2c2065,null));};exports[_0xd81c('0x5a')]=function(_0x30dbf4,_0x29e016,_0x1e0f9e){if(_0x30dbf4[_0xd81c('0x4c')]['id']){delete _0x30dbf4[_0xd81c('0x4c')]['id'];}return db[_0xd81c('0x45')][_0xd81c('0x51')]({'where':{'id':_0x30dbf4['params']['id']}})[_0xd81c('0x26')](handleEntityNotFound(_0x29e016,null))[_0xd81c('0x26')](function(_0x7bea8){if(_0x7bea8){_0x30dbf4[_0xd81c('0x4c')]['TriggerAnyId']=_0x7bea8['id'];return db[_0xd81c('0x59')]['create'](_0x30dbf4[_0xd81c('0x4c')]);}})['then'](respondWithResult(_0x29e016,null))[_0xd81c('0x49')](handleError(_0x29e016,null));};exports[_0xd81c('0x5b')]=function(_0x1c87a8,_0x1dc167,_0xe4aee7){var _0x3a2fb4={};var _0x321119={};var _0x27b41a;var _0x1d8735;return db[_0xd81c('0x45')]['findOne']({'where':{'id':_0x1c87a8[_0xd81c('0x57')]['id']}})['then'](handleEntityNotFound(_0x1dc167,null))['then'](function(_0x5cafa6){if(_0x5cafa6){_0x27b41a=_0x5cafa6;_0x321119[_0xd81c('0x33')]=_[_0xd81c('0x32')](db['Condition'][_0xd81c('0x4a')]);_0x321119[_0xd81c('0x36')]=_[_0xd81c('0x32')](_0x1c87a8['query']);_0x321119[_0xd81c('0x3f')]=_['intersection'](_0x321119['model'],_0x321119['query']);_0x3a2fb4[_0xd81c('0x37')]=_[_0xd81c('0x34')](_0x321119['model'],qs['fields'](_0x1c87a8[_0xd81c('0x36')][_0xd81c('0x35')]));_0x3a2fb4['attributes']=_0x3a2fb4[_0xd81c('0x37')][_0xd81c('0x38')]?_0x3a2fb4[_0xd81c('0x37')]:_0x321119[_0xd81c('0x33')];_0x3a2fb4['order']=qs[_0xd81c('0x3d')](_0x1c87a8[_0xd81c('0x36')][_0xd81c('0x3d')]);_0x3a2fb4[_0xd81c('0x3e')]=qs[_0xd81c('0x3f')](_['pick'](_0x1c87a8[_0xd81c('0x36')],_0x321119[_0xd81c('0x3f')]));if(_0x1c87a8[_0xd81c('0x36')][_0xd81c('0x40')]){_0x3a2fb4[_0xd81c('0x3e')]=_[_0xd81c('0x41')](_0x3a2fb4[_0xd81c('0x3e')],{'$or':_[_0xd81c('0x2f')](_0x3a2fb4[_0xd81c('0x37')],function(_0x4d3e0d){var _0x58fe69={};_0x58fe69[_0x4d3e0d]={'$like':'%'+_0x1c87a8[_0xd81c('0x36')][_0xd81c('0x40')]+'%'};return _0x58fe69;})});}_0x3a2fb4=_['merge']({},_0x3a2fb4,_0x1c87a8[_0xd81c('0x44')]);return _0x27b41a[_0xd81c('0x5b')](_0x3a2fb4);}})[_0xd81c('0x26')](function(_0x56f264){if(_0x56f264){_0x1d8735=_0x56f264[_0xd81c('0x38')];if(!_0x1c87a8[_0xd81c('0x36')]['hasOwnProperty'](_0xd81c('0x3a'))){_0x3a2fb4[_0xd81c('0x3b')]=qs[_0xd81c('0x3b')](_0x1c87a8[_0xd81c('0x36')][_0xd81c('0x3b')]);_0x3a2fb4[_0xd81c('0x1d')]=qs[_0xd81c('0x1d')](_0x1c87a8['query'][_0xd81c('0x1d')]);}return _0x27b41a[_0xd81c('0x5b')](_0x3a2fb4);}})[_0xd81c('0x26')](function(_0x232b09){if(_0x232b09){return _0x232b09?{'count':_0x1d8735,'rows':_0x232b09}:null;}})[_0xd81c('0x26')](respondWithResult(_0x1dc167,null))[_0xd81c('0x49')](handleError(_0x1dc167,null));};exports[_0xd81c('0x5c')]=function(_0x2ad269,_0x2b2fb8,_0x3cd749){var _0x2ad585={};var _0x332f4a={};var _0x1ca647;var _0x1a7d79;return db[_0xd81c('0x45')][_0xd81c('0x5d')]({'where':{'id':_0x2ad269[_0xd81c('0x57')]['id']}})[_0xd81c('0x26')](handleEntityNotFound(_0x2b2fb8,null))[_0xd81c('0x26')](function(_0x132f24){if(_0x132f24){_0x1ca647=_0x132f24;_0x332f4a['model']=_[_0xd81c('0x32')](db['Condition'][_0xd81c('0x4a')]);_0x332f4a['query']=_['keys'](_0x2ad269['query']);_0x332f4a[_0xd81c('0x3f')]=_[_0xd81c('0x34')](_0x332f4a[_0xd81c('0x33')],_0x332f4a[_0xd81c('0x36')]);_0x2ad585[_0xd81c('0x37')]=_['intersection'](_0x332f4a[_0xd81c('0x33')],qs['fields'](_0x2ad269[_0xd81c('0x36')][_0xd81c('0x35')]));_0x2ad585[_0xd81c('0x37')]=_0x2ad585['attributes'][_0xd81c('0x38')]?_0x2ad585[_0xd81c('0x37')]:_0x332f4a[_0xd81c('0x33')];_0x2ad585[_0xd81c('0x3c')]=qs[_0xd81c('0x3d')](_0x2ad269[_0xd81c('0x36')]['sort']);_0x2ad585['where']=qs[_0xd81c('0x3f')](_['pick'](_0x2ad269[_0xd81c('0x36')],_0x332f4a[_0xd81c('0x3f')]));if(_0x2ad269[_0xd81c('0x36')][_0xd81c('0x40')]){_0x2ad585[_0xd81c('0x3e')]=_[_0xd81c('0x41')](_0x2ad585[_0xd81c('0x3e')],{'$or':_[_0xd81c('0x2f')](_0x2ad585['attributes'],function(_0x5ad8a0){var _0x9212f1={};_0x9212f1[_0x5ad8a0]={'$like':'%'+_0x2ad269['query'][_0xd81c('0x40')]+'%'};return _0x9212f1;})});}_0x2ad585=_[_0xd81c('0x41')]({},_0x2ad585,_0x2ad269[_0xd81c('0x44')]);return _0x1ca647[_0xd81c('0x5c')](_0x2ad585);}})[_0xd81c('0x26')](function(_0x6e10fb){if(_0x6e10fb){_0x1a7d79=_0x6e10fb[_0xd81c('0x38')];if(!_0x2ad269[_0xd81c('0x36')][_0xd81c('0x39')]('nolimit')){_0x2ad585[_0xd81c('0x3b')]=qs[_0xd81c('0x3b')](_0x2ad269['query'][_0xd81c('0x3b')]);_0x2ad585['offset']=qs[_0xd81c('0x1d')](_0x2ad269[_0xd81c('0x36')][_0xd81c('0x1d')]);}return _0x1ca647[_0xd81c('0x5c')](_0x2ad585);}})[_0xd81c('0x26')](function(_0x34830f){if(_0x34830f){return _0x34830f?{'count':_0x1a7d79,'rows':_0x34830f}:null;}})[_0xd81c('0x26')](respondWithResult(_0x2b2fb8,null))['catch'](handleError(_0x2b2fb8,null));};exports[_0xd81c('0x5e')]=function(_0x4d7c65,_0x21cd4b,_0x3dce96){if(_0x4d7c65[_0xd81c('0x4c')]['id']){delete _0x4d7c65[_0xd81c('0x4c')]['id'];}return db[_0xd81c('0x45')][_0xd81c('0x51')]({'where':{'id':_0x4d7c65[_0xd81c('0x57')]['id']}})[_0xd81c('0x26')](handleEntityNotFound(_0x21cd4b,null))[_0xd81c('0x26')](function(_0x40fc3e){if(_0x40fc3e){_0x4d7c65[_0xd81c('0x4c')]['TriggerId']=_0x40fc3e['id'];return db[_0xd81c('0x5f')][_0xd81c('0x4b')](_0x4d7c65[_0xd81c('0x4c')]);}})[_0xd81c('0x26')](respondWithResult(_0x21cd4b,null))[_0xd81c('0x49')](handleError(_0x21cd4b,null));};exports['getActions']=function(_0x291915,_0x2c3a4a,_0x48235f){var _0x597c8d={};var _0x46e1d0={};var _0x20dc0e;var _0x27eb4f;return db[_0xd81c('0x45')][_0xd81c('0x5d')]({'where':{'id':_0x291915['params']['id']}})['then'](handleEntityNotFound(_0x2c3a4a,null))['then'](function(_0x1f6f5b){if(_0x1f6f5b){_0x20dc0e=_0x1f6f5b;_0x46e1d0['model']=_[_0xd81c('0x32')](db[_0xd81c('0x5f')][_0xd81c('0x4a')]);_0x46e1d0[_0xd81c('0x36')]=_['keys'](_0x291915[_0xd81c('0x36')]);_0x46e1d0[_0xd81c('0x3f')]=_[_0xd81c('0x34')](_0x46e1d0[_0xd81c('0x33')],_0x46e1d0[_0xd81c('0x36')]);_0x597c8d[_0xd81c('0x37')]=_['intersection'](_0x46e1d0[_0xd81c('0x33')],qs[_0xd81c('0x35')](_0x291915[_0xd81c('0x36')][_0xd81c('0x35')]));_0x597c8d[_0xd81c('0x37')]=_0x597c8d[_0xd81c('0x37')][_0xd81c('0x38')]?_0x597c8d[_0xd81c('0x37')]:_0x46e1d0[_0xd81c('0x33')];_0x597c8d[_0xd81c('0x3c')]=qs['sort'](_0x291915[_0xd81c('0x36')][_0xd81c('0x3d')]);_0x597c8d[_0xd81c('0x3e')]=qs[_0xd81c('0x3f')](_[_0xd81c('0x60')](_0x291915[_0xd81c('0x36')],_0x46e1d0['filters']));if(_0x291915[_0xd81c('0x36')][_0xd81c('0x40')]){_0x597c8d[_0xd81c('0x3e')]=_[_0xd81c('0x41')](_0x597c8d[_0xd81c('0x3e')],{'$or':_[_0xd81c('0x2f')](_0x597c8d[_0xd81c('0x37')],function(_0x47781b){var _0x1b6ba4={};_0x1b6ba4[_0x47781b]={'$like':'%'+_0x291915[_0xd81c('0x36')][_0xd81c('0x40')]+'%'};return _0x1b6ba4;})});}_0x597c8d=_[_0xd81c('0x41')]({},_0x597c8d,_0x291915[_0xd81c('0x44')]);return _0x20dc0e['getActions'](_0x597c8d);}})['then'](function(_0x45ecd1){if(_0x45ecd1){_0x27eb4f=_0x45ecd1[_0xd81c('0x38')];if(!_0x291915[_0xd81c('0x36')]['hasOwnProperty'](_0xd81c('0x3a'))){_0x597c8d[_0xd81c('0x3b')]=qs[_0xd81c('0x3b')](_0x291915['query'][_0xd81c('0x3b')]);_0x597c8d['offset']=qs[_0xd81c('0x1d')](_0x291915[_0xd81c('0x36')][_0xd81c('0x1d')]);}return _0x20dc0e[_0xd81c('0x61')](_0x597c8d);}})[_0xd81c('0x26')](function(_0x40f382){if(_0x40f382){return _0x40f382?{'count':_0x27eb4f,'rows':_0x40f382}:null;}})[_0xd81c('0x26')](respondWithResult(_0x2c3a4a,null))['catch'](handleError(_0x2c3a4a,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 78779ac..ba23a3b 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 _0xa101=['define','lodash','util','api','moment','request-promise','path','../../config/environment','./trigger.attributes','exports'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0xa101,0x15f));var _0x1a10=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa101[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x1a10('0x0'));var util=require(_0x1a10('0x1'));var logger=require('../../config/logger')(_0x1a10('0x2'));var moment=require(_0x1a10('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a10('0x4'));var fs=require('fs');var path=require(_0x1a10('0x5'));var rimraf=require('rimraf');var config=require(_0x1a10('0x6'));var attributes=require(_0x1a10('0x7'));module[_0x1a10('0x8')]=function(_0x1a9d22,_0x2eb3c8){return _0x1a9d22[_0x1a10('0x9')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c6d=['moment','request-promise','path','rimraf','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger','api'];(function(_0x5993de,_0x1e902f){var _0x481faf=function(_0x11dea1){while(--_0x11dea1){_0x5993de['push'](_0x5993de['shift']());}};_0x481faf(++_0x1e902f);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x2221c7,_0x526d17){_0x2221c7=_0x2221c7-0x0;var _0x1d6e2c=_0x4c6d[_0x2221c7];return _0x1d6e2c;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var logger=require(_0xd4c6('0x2'))(_0xd4c6('0x3'));var moment=require(_0xd4c6('0x4'));var BPromise=require('bluebird');var rp=require(_0xd4c6('0x5'));var fs=require('fs');var path=require(_0xd4c6('0x6'));var rimraf=require(_0xd4c6('0x7'));var config=require('../../config/environment');var attributes=require(_0xd4c6('0x8'));module[_0xd4c6('0x9')]=function(_0x56279c,_0x182671){return _0x56279c[_0xd4c6('0xa')](_0xd4c6('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 57cf46b..85104a9 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 _0x0998=['result','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','GetTrigger','catch','ShowTrigger','find','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','code','error','Trigger,\x20%s,\x20%s','message'];(function(_0x937b4c,_0x23bbf7){var _0x43bc05=function(_0x4f83d4){while(--_0x4f83d4){_0x937b4c['push'](_0x937b4c['shift']());}};_0x43bc05(++_0x23bbf7);}(_0x0998,0xf4));var _0x8099=function(_0x33b6f6,_0x4f5636){_0x33b6f6=_0x33b6f6-0x0;var _0x2d7daf=_0x0998[_0x33b6f6];return _0x2d7daf;};'use strict';var _=require(_0x8099('0x0'));var util=require(_0x8099('0x1'));var moment=require(_0x8099('0x2'));var BPromise=require('bluebird');var rs=require(_0x8099('0x3'));var fs=require('fs');var Redis=require(_0x8099('0x4'));var db=require(_0x8099('0x5'))['db'];var utils=require(_0x8099('0x6'));var logger=require(_0x8099('0x7'))(_0x8099('0x8'));var config=require(_0x8099('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8099('0xa')][_0x8099('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ecdf4,_0x4468d2,_0x4a31e6){return new BPromise(function(_0x161a95,_0x3a4246){return client[_0x8099('0xc')](_0x1ecdf4,_0x4a31e6)[_0x8099('0xd')](function(_0x50fca9){logger[_0x8099('0xe')]('Trigger,\x20%s,\x20%s',_0x4468d2,_0x8099('0xf'));logger[_0x8099('0x10')](_0x8099('0x11'),_0x4468d2,_0x8099('0xf'),JSON['stringify'](_0x50fca9));if(_0x50fca9['error']){if(_0x50fca9['error'][_0x8099('0x12')]===0x1f4){logger[_0x8099('0x13')]('Trigger,\x20%s,\x20%s',_0x4468d2,_0x50fca9[_0x8099('0x13')]['message']);return _0x3a4246(_0x50fca9[_0x8099('0x13')]['message']);}logger[_0x8099('0x13')](_0x8099('0x14'),_0x4468d2,_0x50fca9[_0x8099('0x13')][_0x8099('0x15')]);return _0x161a95(_0x50fca9[_0x8099('0x13')][_0x8099('0x15')]);}else{logger[_0x8099('0xe')]('Trigger,\x20%s,\x20%s',_0x4468d2,_0x8099('0xf'));_0x161a95(_0x50fca9[_0x8099('0x16')][_0x8099('0x15')]);}})['catch'](function(_0x4f36b6){logger[_0x8099('0x13')](_0x8099('0x14'),_0x4468d2,_0x4f36b6);_0x3a4246(_0x4f36b6);});});}exports['GetTrigger']=function(_0x2cd53e){var _0x4f3173=this;return new Promise(function(_0x4fe12f,_0x5f4954){return db[_0x8099('0x17')][_0x8099('0x18')]({'raw':_0x2cd53e['options']?_0x2cd53e[_0x8099('0x19')][_0x8099('0x1a')]===undefined?!![]:![]:!![],'where':_0x2cd53e[_0x8099('0x19')]?_0x2cd53e['options'][_0x8099('0x1b')]||null:null,'attributes':_0x2cd53e['options']?_0x2cd53e['options'][_0x8099('0x1c')]||null:null,'limit':_0x2cd53e[_0x8099('0x19')]?_0x2cd53e[_0x8099('0x19')][_0x8099('0x1d')]||null:null,'include':_0x2cd53e['options']?_0x2cd53e[_0x8099('0x19')][_0x8099('0x1e')]?_[_0x8099('0x1f')](_0x2cd53e[_0x8099('0x19')]['include'],function(_0x4e5e68){return{'model':db[_0x4e5e68[_0x8099('0x20')]],'as':_0x4e5e68['as'],'attributes':_0x4e5e68[_0x8099('0x1c')],'include':_0x4e5e68[_0x8099('0x1e')]?_[_0x8099('0x1f')](_0x4e5e68['include'],function(_0x38c500){return{'model':db[_0x38c500[_0x8099('0x20')]],'as':_0x38c500['as'],'attributes':_0x38c500['attributes'],'include':_0x38c500[_0x8099('0x1e')]?_[_0x8099('0x1f')](_0x38c500['include'],function(_0x433093){return{'model':db[_0x433093[_0x8099('0x20')]],'as':_0x433093['as'],'attributes':_0x433093[_0x8099('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cb912){logger['info'](_0x8099('0x21'),_0x2cd53e);logger[_0x8099('0x10')]('GetTrigger',_0x2cd53e,JSON['stringify'](_0x3cb912));_0x4fe12f(_0x3cb912);})[_0x8099('0x22')](function(_0x14427b){logger[_0x8099('0x13')](_0x8099('0x21'),_0x14427b['message'],_0x2cd53e);_0x5f4954(_0x4f3173[_0x8099('0x13')](0x1f4,_0x14427b['message']));});});};exports[_0x8099('0x23')]=function(_0xcbd2d8){var _0x4ac17e=this;return new Promise(function(_0x33b64c,_0x519aa3){return db['Trigger'][_0x8099('0x24')]({'raw':_0xcbd2d8['options']?_0xcbd2d8[_0x8099('0x19')][_0x8099('0x1a')]===undefined?!![]:![]:!![],'where':_0xcbd2d8[_0x8099('0x19')]?_0xcbd2d8[_0x8099('0x19')]['where']||null:null,'attributes':_0xcbd2d8[_0x8099('0x19')]?_0xcbd2d8['options']['attributes']||null:null,'include':_0xcbd2d8[_0x8099('0x19')]?_0xcbd2d8[_0x8099('0x19')][_0x8099('0x1e')]?_[_0x8099('0x1f')](_0xcbd2d8[_0x8099('0x19')][_0x8099('0x1e')],function(_0x30f856){return{'model':db[_0x30f856['model']],'as':_0x30f856['as'],'attributes':_0x30f856[_0x8099('0x1c')],'include':_0x30f856[_0x8099('0x1e')]?_[_0x8099('0x1f')](_0x30f856[_0x8099('0x1e')],function(_0x5ccdff){return{'model':db[_0x5ccdff[_0x8099('0x20')]],'as':_0x5ccdff['as'],'attributes':_0x5ccdff[_0x8099('0x1c')],'include':_0x5ccdff[_0x8099('0x1e')]?_[_0x8099('0x1f')](_0x5ccdff[_0x8099('0x1e')],function(_0x373cf6){return{'model':db[_0x373cf6[_0x8099('0x20')]],'as':_0x373cf6['as'],'attributes':_0x373cf6[_0x8099('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f3ad0){logger['info'](_0x8099('0x23'),_0xcbd2d8);logger[_0x8099('0x10')](_0x8099('0x23'),_0xcbd2d8,JSON[_0x8099('0x25')](_0x4f3ad0));_0x33b64c(_0x4f3ad0);})['catch'](function(_0x10828c){logger[_0x8099('0x13')](_0x8099('0x23'),_0x10828c[_0x8099('0x15')],_0xcbd2d8);_0x519aa3(_0x4ac17e[_0x8099('0x13')](0x1f4,_0x10828c['message']));});});}; \ No newline at end of file +var _0xdef6=['GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','map','include','model','find','then','ShowTrigger','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0xdea482,_0x5158f4){var _0x83a9c=function(_0x576866){while(--_0x576866){_0xdea482['push'](_0xdea482['shift']());}};_0x83a9c(++_0x5158f4);}(_0xdef6,0xe0));var _0x6def=function(_0x5f0432,_0x2b29c8){_0x5f0432=_0x5f0432-0x0;var _0x48eb08=_0xdef6[_0x5f0432];return _0x48eb08;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6def('0x0'));var BPromise=require(_0x6def('0x1'));var rs=require(_0x6def('0x2'));var fs=require('fs');var Redis=require(_0x6def('0x3'));var db=require(_0x6def('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6def('0x5'))(_0x6def('0x6'));var config=require('../../config/environment');var jayson=require(_0x6def('0x7'));var client=jayson[_0x6def('0x8')][_0x6def('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b2278,_0xa665d5,_0x189d7d){return new BPromise(function(_0x31b11d,_0x301e88){return client[_0x6def('0xa')](_0x2b2278,_0x189d7d)['then'](function(_0x33c739){logger[_0x6def('0xb')](_0x6def('0xc'),_0xa665d5,_0x6def('0xd'));logger[_0x6def('0xe')](_0x6def('0xf'),_0xa665d5,'request\x20sent',JSON[_0x6def('0x10')](_0x33c739));if(_0x33c739[_0x6def('0x11')]){if(_0x33c739['error']['code']===0x1f4){logger[_0x6def('0x11')]('Trigger,\x20%s,\x20%s',_0xa665d5,_0x33c739[_0x6def('0x11')][_0x6def('0x12')]);return _0x301e88(_0x33c739['error'][_0x6def('0x12')]);}logger[_0x6def('0x11')](_0x6def('0xc'),_0xa665d5,_0x33c739[_0x6def('0x11')][_0x6def('0x12')]);return _0x31b11d(_0x33c739[_0x6def('0x11')]['message']);}else{logger[_0x6def('0xb')]('Trigger,\x20%s,\x20%s',_0xa665d5,'request\x20sent');_0x31b11d(_0x33c739[_0x6def('0x13')][_0x6def('0x12')]);}})[_0x6def('0x14')](function(_0x5b21e1){logger['error']('Trigger,\x20%s,\x20%s',_0xa665d5,_0x5b21e1);_0x301e88(_0x5b21e1);});});}exports[_0x6def('0x15')]=function(_0x1b9cf5){var _0x590ce1=this;return new Promise(function(_0x5bd208,_0x5765a5){return db[_0x6def('0x16')][_0x6def('0x17')]({'raw':_0x1b9cf5[_0x6def('0x18')]?_0x1b9cf5['options'][_0x6def('0x19')]===undefined?!![]:![]:!![],'where':_0x1b9cf5[_0x6def('0x18')]?_0x1b9cf5[_0x6def('0x18')][_0x6def('0x1a')]||null:null,'attributes':_0x1b9cf5['options']?_0x1b9cf5[_0x6def('0x18')][_0x6def('0x1b')]||null:null,'limit':_0x1b9cf5['options']?_0x1b9cf5[_0x6def('0x18')][_0x6def('0x1c')]||null:null,'include':_0x1b9cf5['options']?_0x1b9cf5[_0x6def('0x18')]['include']?_[_0x6def('0x1d')](_0x1b9cf5[_0x6def('0x18')][_0x6def('0x1e')],function(_0x449929){return{'model':db[_0x449929[_0x6def('0x1f')]],'as':_0x449929['as'],'attributes':_0x449929[_0x6def('0x1b')],'include':_0x449929['include']?_[_0x6def('0x1d')](_0x449929[_0x6def('0x1e')],function(_0x1bb0fe){return{'model':db[_0x1bb0fe[_0x6def('0x1f')]],'as':_0x1bb0fe['as'],'attributes':_0x1bb0fe[_0x6def('0x1b')],'include':_0x1bb0fe[_0x6def('0x1e')]?_[_0x6def('0x1d')](_0x1bb0fe[_0x6def('0x1e')],function(_0x42650c){return{'model':db[_0x42650c[_0x6def('0x1f')]],'as':_0x42650c['as'],'attributes':_0x42650c[_0x6def('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53fd05){logger[_0x6def('0xb')](_0x6def('0x15'),_0x1b9cf5);logger[_0x6def('0xe')](_0x6def('0x15'),_0x1b9cf5,JSON[_0x6def('0x10')](_0x53fd05));_0x5bd208(_0x53fd05);})[_0x6def('0x14')](function(_0x2f0f5d){logger[_0x6def('0x11')]('GetTrigger',_0x2f0f5d[_0x6def('0x12')],_0x1b9cf5);_0x5765a5(_0x590ce1[_0x6def('0x11')](0x1f4,_0x2f0f5d[_0x6def('0x12')]));});});};exports['ShowTrigger']=function(_0x218cb0){var _0x2cc520=this;return new Promise(function(_0x252c84,_0x12b54a){return db['Trigger'][_0x6def('0x20')]({'raw':_0x218cb0[_0x6def('0x18')]?_0x218cb0['options'][_0x6def('0x19')]===undefined?!![]:![]:!![],'where':_0x218cb0[_0x6def('0x18')]?_0x218cb0[_0x6def('0x18')]['where']||null:null,'attributes':_0x218cb0['options']?_0x218cb0[_0x6def('0x18')][_0x6def('0x1b')]||null:null,'include':_0x218cb0[_0x6def('0x18')]?_0x218cb0[_0x6def('0x18')][_0x6def('0x1e')]?_[_0x6def('0x1d')](_0x218cb0['options'][_0x6def('0x1e')],function(_0xf5d507){return{'model':db[_0xf5d507[_0x6def('0x1f')]],'as':_0xf5d507['as'],'attributes':_0xf5d507[_0x6def('0x1b')],'include':_0xf5d507[_0x6def('0x1e')]?_['map'](_0xf5d507[_0x6def('0x1e')],function(_0x150d2){return{'model':db[_0x150d2[_0x6def('0x1f')]],'as':_0x150d2['as'],'attributes':_0x150d2[_0x6def('0x1b')],'include':_0x150d2[_0x6def('0x1e')]?_['map'](_0x150d2[_0x6def('0x1e')],function(_0x47086c){return{'model':db[_0x47086c[_0x6def('0x1f')]],'as':_0x47086c['as'],'attributes':_0x47086c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6def('0x21')](function(_0x106359){logger['info'](_0x6def('0x22'),_0x218cb0);logger['debug'](_0x6def('0x22'),_0x218cb0,JSON['stringify'](_0x106359));_0x252c84(_0x106359);})[_0x6def('0x14')](function(_0x237e95){logger[_0x6def('0x11')]('ShowTrigger',_0x237e95[_0x6def('0x12')],_0x218cb0);_0x12b54a(_0x2cc520[_0x6def('0x11')](0x1f4,_0x237e95[_0x6def('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 448b001..b2bffaf 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 _0x4f9a=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','index','get','show','post','create','/:id','update','delete'];(function(_0x236f3b,_0x1f626f){var _0x55009a=function(_0x161da2){while(--_0x161da2){_0x236f3b['push'](_0x236f3b['shift']());}};_0x55009a(++_0x1f626f);}(_0x4f9a,0x1a6));var _0xa4f9=function(_0x3a11ce,_0x3b203e){_0x3a11ce=_0x3a11ce-0x0;var _0x159267=_0x4f9a[_0x3a11ce];return _0x159267;};'use strict';var multer=require(_0xa4f9('0x0'));var util=require(_0xa4f9('0x1'));var path=require('path');var timeout=require(_0xa4f9('0x2'));var express=require(_0xa4f9('0x3'));var router=express[_0xa4f9('0x4')]();var fs_extra=require(_0xa4f9('0x5'));var auth=require(_0xa4f9('0x6'));var interaction=require(_0xa4f9('0x7'));var config=require('../../config/environment');var controller=require(_0xa4f9('0x8'));router['get']('/',auth[_0xa4f9('0x9')](),controller[_0xa4f9('0xa')]);router[_0xa4f9('0xb')]('/:id',auth[_0xa4f9('0x9')](),controller[_0xa4f9('0xc')]);router[_0xa4f9('0xd')]('/:id/clone',auth[_0xa4f9('0x9')](),controller['clone']);router[_0xa4f9('0xd')]('/',auth[_0xa4f9('0x9')](),controller[_0xa4f9('0xe')]);router['put'](_0xa4f9('0xf'),auth[_0xa4f9('0x9')](),controller[_0xa4f9('0x10')]);router[_0xa4f9('0x11')](_0xa4f9('0xf'),auth[_0xa4f9('0x9')](),controller[_0xa4f9('0x12')]);module[_0xa4f9('0x13')]=router; \ No newline at end of file +var _0x0655=['get','/:id','isAuthenticated','show','post','/:id/clone','clone','create','put','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./trunk.controller','index'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x0655,0xf0));var _0x5065=function(_0x1840b1,_0x2d021e){_0x1840b1=_0x1840b1-0x0;var _0x54ee73=_0x0655[_0x1840b1];return _0x54ee73;};'use strict';var multer=require('multer');var util=require(_0x5065('0x0'));var path=require('path');var timeout=require(_0x5065('0x1'));var express=require('express');var router=express[_0x5065('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5065('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5065('0x4'));var controller=require(_0x5065('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x5065('0x6')]);router[_0x5065('0x7')](_0x5065('0x8'),auth[_0x5065('0x9')](),controller[_0x5065('0xa')]);router[_0x5065('0xb')](_0x5065('0xc'),auth[_0x5065('0x9')](),controller[_0x5065('0xd')]);router[_0x5065('0xb')]('/',auth[_0x5065('0x9')](),controller[_0x5065('0xe')]);router[_0x5065('0xf')](_0x5065('0x8'),auth[_0x5065('0x9')](),controller['update']);router[_0x5065('0x10')](_0x5065('0x8'),auth[_0x5065('0x9')](),controller[_0x5065('0x11')]);module[_0x5065('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 60d6101..27a3c66 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 _0xec51=['getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','yes','update','outgoing','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','certificate','active','actpass','dynamic','nonat','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport'];(function(_0x63e376,_0x43084d){var _0x43bc68=function(_0x192221){while(--_0x192221){_0x63e376['push'](_0x63e376['shift']());}};_0x43bc68(++_0x43084d);}(_0xec51,0xf6));var _0x1ec5=function(_0x2874a5,_0x32b680){_0x2874a5=_0x2874a5-0x0;var _0x1e427a=_0xec51[_0x2874a5];return _0x1e427a;};'use strict';var Sequelize=require(_0x1ec5('0x0'));module[_0x1ec5('0x1')]={'name':{'type':Sequelize[_0x1ec5('0x2')],'allowNull':![],'unique':_0x1ec5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x5'),_0x1ec5('0x6'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x1ec5('0x2')],'allowNull':![],'defaultValue':_0x1ec5('0x7')},'callingpres':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x8'),_0x1ec5('0x9'),_0x1ec5('0xa'),_0x1ec5('0xb'),_0x1ec5('0xc'),_0x1ec5('0xd'),_0x1ec5('0xe'),_0x1ec5('0xf'))},'deny':{'type':Sequelize[_0x1ec5('0x2')]},'permit':{'type':Sequelize[_0x1ec5('0x2')]},'secret':{'type':Sequelize[_0x1ec5('0x2')]},'md5secret':{'type':Sequelize[_0x1ec5('0x2')]},'remotesecret':{'type':Sequelize[_0x1ec5('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x1ec5('0x10'),'set':function(_0x485bea){this[_0x1ec5('0x11')](_0x1ec5('0x12'),_0x485bea?_0x485bea['join'](','):null);},'get':function(){return this[_0x1ec5('0x13')](_0x1ec5('0x12'))?this[_0x1ec5('0x13')](_0x1ec5('0x12'))[_0x1ec5('0x14')](','):null;},'comment':_0x1ec5('0x15')},'dtmfmode':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x16'),_0x1ec5('0x17'),'shortinfo',_0x1ec5('0x18'),'auto'),'defaultValue':_0x1ec5('0x16')},'directmedia':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no','nonat',_0x1ec5('0x1a'),_0x1ec5('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1ec5('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x1ec5('0x2')],'defaultValue':_0x1ec5('0x1c'),'set':function(_0x3ae642){this['setDataValue'](_0x1ec5('0x1d'),_0x3ae642?_0x3ae642[_0x1ec5('0x1e')](','):null);},'get':function(){return this[_0x1ec5('0x13')](_0x1ec5('0x1d'))?this['getDataValue'](_0x1ec5('0x1d'))['split'](','):null;},'comment':_0x1ec5('0x1f')},'callgroup':{'type':Sequelize[_0x1ec5('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x1ec5('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x1ec5('0x2')]},'language':{'type':Sequelize[_0x1ec5('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1ec5('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x1ec5('0x2')],'defaultValue':_0x1ec5('0x20')},'allow':{'type':Sequelize[_0x1ec5('0x2')],'allowNull':![],'defaultValue':_0x1ec5('0x21'),'set':function(_0x500921){this[_0x1ec5('0x11')]('allow',_0x500921?_0x500921[_0x1ec5('0x1e')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x1ec5('0x13')]('allow')?this[_0x1ec5('0x13')](_0x1ec5('0x22'))[_0x1ec5('0x14')](';'):null;},'comment':_0x1ec5('0x23')},'autoframing':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no')},'insecure':{'type':Sequelize[_0x1ec5('0x2')],'defaultValue':_0x1ec5('0x24'),'set':function(_0x52886e){this[_0x1ec5('0x11')]('insecure',_0x52886e?_0x52886e['join'](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x1ec5('0x13')]('insecure')[_0x1ec5('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1ec5('0x4')]('yes','no',_0x1ec5('0x25'))},'promiscredir':{'type':Sequelize[_0x1ec5('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0x1ec5('0x4')]('yes','no')},'accountcode':{'type':Sequelize[_0x1ec5('0x26')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x1ec5('0x2')],'defaultValue':_0x1ec5('0x27')},'amaflags':{'type':Sequelize[_0x1ec5('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0x1ec5('0x19'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x1ec5('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x1ec5('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x1ec5('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x1ec5('0x2')]},'videosupport':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1ec5('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no')},'mailbox':{'type':Sequelize[_0x1ec5('0x2')]},'session_timers':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x28'),_0x1ec5('0x29'),_0x1ec5('0x2a'))},'session_expires':{'type':Sequelize[_0x1ec5('0x26')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x2b'),_0x1ec5('0x2c')),'defaultValue':_0x1ec5('0x2c')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x1ec5('0x2')]},'fromdomain':{'type':Sequelize[_0x1ec5('0x2')]},'fromuser':{'type':Sequelize[_0x1ec5('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no'),'defaultValue':_0x1ec5('0x19')},'keepalive':{'type':Sequelize[_0x1ec5('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x1ec5('0x2')]},'rtptimeout':{'type':Sequelize[_0x1ec5('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x1ec5('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x1ec5('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no',_0x1ec5('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1ec5('0x2')]},'callbackextension':{'type':Sequelize[_0x1ec5('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x1ec5('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x1ec5('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x1ec5('0x2')]},'contactdeny':{'type':Sequelize[_0x1ec5('0x2')]},'contactacl':{'type':Sequelize[_0x1ec5('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x1ec5('0x2')]},'maxforwards':{'type':Sequelize[_0x1ec5('0x26')](0xb)},'encryption':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no')},'force_avp':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no')},'icesupport':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x1ec5('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no','fingerprint',_0x1ec5('0x2e'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x1ec5('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x1ec5('0x2')]},'dtlscipher':{'type':Sequelize[_0x1ec5('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x2f'),'passive',_0x1ec5('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1ec5('0x2')]},'usereqphone':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x1ec5('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x1ec5('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no')},'vmexten':{'type':Sequelize[_0x1ec5('0x2')]},'mohinterpret':{'type':Sequelize[_0x1ec5('0x2')]},'mohsuggest':{'type':Sequelize[_0x1ec5('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x1ec5('0x31')},'canreinvite':{'type':Sequelize[_0x1ec5('0x4')](_0x1ec5('0x19'),'no',_0x1ec5('0x32'),_0x1ec5('0x1a'),_0x1ec5('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x1ec5('0x2')]},'otherFields':{'type':Sequelize[_0x1ec5('0x2')]},'active':{'type':Sequelize[_0x1ec5('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xcc39=['ENUM','friend','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','accept','originate','uac','uas','pai','fingerprint','active','passive','actpass','nonat','update','update,nonat','BOOLEAN','sequelize','exports','name'];(function(_0x1ed9df,_0x1b8265){var _0x5dc9c3=function(_0x59f854){while(--_0x59f854){_0x1ed9df['push'](_0x1ed9df['shift']());}};_0x5dc9c3(++_0x1b8265);}(_0xcc39,0x154));var _0x9cc3=function(_0x11b1b3,_0xf3cc69){_0x11b1b3=_0x11b1b3-0x0;var _0x437029=_0xcc39[_0x11b1b3];return _0x437029;};'use strict';var Sequelize=require(_0x9cc3('0x0'));module[_0x9cc3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9cc3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x4'),'user',_0x9cc3('0x5')),'allowNull':![],'defaultValue':_0x9cc3('0x4')},'context':{'type':Sequelize[_0x9cc3('0x6')],'allowNull':![],'defaultValue':_0x9cc3('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x9cc3('0x8'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x9cc3('0x9'),_0x9cc3('0xa'),_0x9cc3('0xb'),_0x9cc3('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0x9cc3('0x6')]},'permit':{'type':Sequelize[_0x9cc3('0x6')]},'secret':{'type':Sequelize[_0x9cc3('0x6')]},'md5secret':{'type':Sequelize[_0x9cc3('0x6')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x9cc3('0xd'),'set':function(_0x460394){this[_0x9cc3('0xe')](_0x9cc3('0xf'),_0x460394?_0x460394['join'](','):null);},'get':function(){return this[_0x9cc3('0x10')](_0x9cc3('0xf'))?this[_0x9cc3('0x10')](_0x9cc3('0xf'))['split'](','):null;},'comment':_0x9cc3('0x11')},'dtmfmode':{'type':Sequelize['ENUM'](_0x9cc3('0x12'),_0x9cc3('0x13'),_0x9cc3('0x14'),_0x9cc3('0x15'),'auto'),'defaultValue':_0x9cc3('0x12')},'directmedia':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no','nonat','update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9cc3('0x6')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x9cc3('0x6')],'defaultValue':'force_rport,comedia','set':function(_0x1ffeb9){this[_0x9cc3('0xe')](_0x9cc3('0x17'),_0x1ffeb9?_0x1ffeb9[_0x9cc3('0x18')](','):null);},'get':function(){return this[_0x9cc3('0x10')](_0x9cc3('0x17'))?this[_0x9cc3('0x10')](_0x9cc3('0x17'))['split'](','):null;},'comment':_0x9cc3('0x19')},'callgroup':{'type':Sequelize[_0x9cc3('0x6')]},'namedcallgroup':{'type':Sequelize[_0x9cc3('0x6')]},'pickupgroup':{'type':Sequelize[_0x9cc3('0x6')]},'namedpickupgroup':{'type':Sequelize[_0x9cc3('0x6')]},'language':{'type':Sequelize[_0x9cc3('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x9cc3('0x6')],'defaultValue':_0x9cc3('0x1a')},'allow':{'type':Sequelize[_0x9cc3('0x6')],'allowNull':![],'defaultValue':_0x9cc3('0x1b'),'set':function(_0x43e6ac){this[_0x9cc3('0xe')](_0x9cc3('0x1c'),_0x43e6ac?_0x43e6ac[_0x9cc3('0x18')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x9cc3('0x10')](_0x9cc3('0x1c'))?this[_0x9cc3('0x10')](_0x9cc3('0x1c'))[_0x9cc3('0x1d')](';'):null;},'comment':_0x9cc3('0x1e')},'autoframing':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no')},'insecure':{'type':Sequelize[_0x9cc3('0x6')],'defaultValue':_0x9cc3('0x1f'),'set':function(_0x12934c){this[_0x9cc3('0xe')](_0x9cc3('0x20'),_0x12934c?_0x12934c[_0x9cc3('0x18')](','):null);},'get':function(){return this[_0x9cc3('0x10')](_0x9cc3('0x20'))?this[_0x9cc3('0x10')]('insecure')[_0x9cc3('0x1d')](','):null;},'comment':_0x9cc3('0x21')},'trustrpid':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no','never')},'promiscredir':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x9cc3('0x16'),'no')},'accountcode':{'type':Sequelize[_0x9cc3('0x22')](0xb)},'setvar':{'type':Sequelize[_0x9cc3('0x6')]},'callerid':{'type':Sequelize[_0x9cc3('0x6')],'defaultValue':_0x9cc3('0x23')},'amaflags':{'type':Sequelize[_0x9cc3('0x6')]},'callcounter':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x9cc3('0x22')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x9cc3('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x9cc3('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x9cc3('0x6')]},'template':{'type':Sequelize[_0x9cc3('0x6')]},'videosupport':{'type':Sequelize[_0x9cc3('0x3')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9cc3('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no')},'mailbox':{'type':Sequelize[_0x9cc3('0x6')]},'session_timers':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x24'),'refuse',_0x9cc3('0x25'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x26'),'uas'),'defaultValue':_0x9cc3('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x9cc3('0x6')]},'regexten':{'type':Sequelize[_0x9cc3('0x6')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x9cc3('0x6')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no'),'defaultValue':_0x9cc3('0x16')},'keepalive':{'type':Sequelize[_0x9cc3('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x9cc3('0x6')]},'defaultuser':{'type':Sequelize[_0x9cc3('0x6')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9cc3('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9cc3('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no',_0x9cc3('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x9cc3('0x6')]},'timert1':{'type':Sequelize[_0x9cc3('0x22')](0xb)},'timerb':{'type':Sequelize[_0x9cc3('0x22')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x9cc3('0x6')]},'contactdeny':{'type':Sequelize[_0x9cc3('0x6')]},'contactacl':{'type':Sequelize[_0x9cc3('0x6')]},'unsolicited_mailbox':{'type':Sequelize[_0x9cc3('0x6')]},'use_q850_reason':{'type':Sequelize[_0x9cc3('0x6')]},'maxforwards':{'type':Sequelize[_0x9cc3('0x22')](0xb)},'encryption':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no')},'force_avp':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x9cc3('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0x9cc3('0x3')]('yes','no',_0x9cc3('0x29'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x9cc3('0x22')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x9cc3('0x6')]},'dtlscipher':{'type':Sequelize[_0x9cc3('0x6')]},'dtlscafile':{'type':Sequelize[_0x9cc3('0x6')]},'dtlscapath':{'type':Sequelize[_0x9cc3('0x6')]},'dtlssetup':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x2a'),_0x9cc3('0x2b'),_0x9cc3('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9cc3('0x6')]},'usereqphone':{'type':Sequelize[_0x9cc3('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9cc3('0x6')]},'recordofffeature':{'type':Sequelize[_0x9cc3('0x6')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x9cc3('0x16'),'no')},'vmexten':{'type':Sequelize[_0x9cc3('0x6')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x9cc3('0x6')]},'parkinglot':{'type':Sequelize[_0x9cc3('0x6')]},'description':{'type':Sequelize[_0x9cc3('0x6')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x9cc3('0x3')](_0x9cc3('0x16'),'no',_0x9cc3('0x2d'),_0x9cc3('0x2e'),_0x9cc3('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9cc3('0x6')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x9cc3('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x9cc3('0x6')],'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 2c5a0e1..861e57c 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 _0x84ab=['../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','fields','attributes','length','model','order','sort','where','filters','pick','merge','filter','options','Trunk','count','includeAll','rows','params','include','find','createdAt','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','autoAssociation','root','chan_sip.so','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1fdf47,_0x1da0d0){var _0x2f42d3=function(_0x56f2b3){while(--_0x56f2b3){_0x1fdf47['push'](_0x1fdf47['shift']());}};_0x2f42d3(++_0x1da0d0);}(_0x84ab,0x12f));var _0xb84a=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0x84ab[_0xabbd2f];return _0x34a040;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb84a('0x16')][_0xb84a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x39a0df,_0x3c161c,_0x44b26b,_0x11dfe9){return new BPromise(function(_0x12ccab,_0x475b){var _0x3113a2=_0x11dfe9||client;return _0x3113a2[_0xb84a('0x18')](_0x39a0df,_0x44b26b)[_0xb84a('0x19')](function(_0x1251ec){logger['info'](_0xb84a('0x1a'),_0x3c161c,_0xb84a('0x1b'));logger[_0xb84a('0x1c')](_0xb84a('0x1d'),_0x3c161c,_0xb84a('0x1b'),JSON[_0xb84a('0x1e')](_0x1251ec));if(_0x1251ec[_0xb84a('0x1f')]){if(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x20')]===0x1f4){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);return _0x475b(_0x1251ec[_0xb84a('0x1f')]['message']);}logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x1251ec['error'][_0xb84a('0x21')]);return _0x12ccab(_0x1251ec[_0xb84a('0x1f')][_0xb84a('0x21')]);}else{logger[_0xb84a('0x22')]('Trunk,\x20%s,\x20%s',_0x3c161c,'request\x20sent');_0x12ccab(_0x1251ec[_0xb84a('0x23')][_0xb84a('0x21')]);}})[_0xb84a('0x24')](function(_0x259f74){logger[_0xb84a('0x1f')](_0xb84a('0x1a'),_0x3c161c,_0x259f74);_0x475b(_0x259f74);});});}function respondWithStatusCode(_0x8b28cd,_0x21d0d3){_0x21d0d3=_0x21d0d3||0xcc;return function(_0x3aa06f){if(_0x3aa06f){return _0x8b28cd[_0xb84a('0x25')](_0x21d0d3);}return _0x8b28cd[_0xb84a('0x26')](_0x21d0d3)[_0xb84a('0x27')]();};}function respondWithResult(_0x218aef,_0x409df0){_0x409df0=_0x409df0||0xc8;return function(_0x19bdfa){if(_0x19bdfa){return _0x218aef[_0xb84a('0x26')](_0x409df0)[_0xb84a('0x28')](_0x19bdfa);}};}function respondWithFilteredResult(_0x3ff0bc,_0x3b6805){return function(_0xd468c3){if(_0xd468c3){var _0x33bf1d=typeof _0x3b6805[_0xb84a('0x29')]===_0xb84a('0x2a')&&typeof _0x3b6805[_0xb84a('0x2b')]===_0xb84a('0x2a');var _0x97d71b=_0xd468c3['count'];var _0x582954=_0x33bf1d?0x0:_0x3b6805[_0xb84a('0x29')];var _0x2c30b0=_0x33bf1d?_0xd468c3['count']:_0x3b6805[_0xb84a('0x29')]+_0x3b6805[_0xb84a('0x2b')];var _0x52c23c;if(_0x2c30b0>=_0x97d71b){_0x2c30b0=_0x97d71b;_0x52c23c=0xc8;}else{_0x52c23c=0xce;}_0x3ff0bc['status'](_0x52c23c);return _0x3ff0bc[_0xb84a('0x2c')](_0xb84a('0x2d'),_0x582954+'-'+_0x2c30b0+'/'+_0x97d71b)['json'](_0xd468c3);}return null;};}function patchUpdates(_0x251778){return function(_0xba1147){try{jsonpatch[_0xb84a('0x2e')](_0xba1147,_0x251778,!![]);}catch(_0x44a405){return BPromise[_0xb84a('0x2f')](_0x44a405);}return _0xba1147[_0xb84a('0x30')]();};}function saveUpdates(_0x34b212,_0xac214f){return function(_0x54ec50){if(_0x54ec50){return _0x54ec50[_0xb84a('0x31')](_0x34b212)['then'](function(_0x4bca85){return _0x4bca85;});}return null;};}function removeEntity(_0x2eea7e,_0x3b4515){return function(_0x47a5b6){if(_0x47a5b6){return _0x47a5b6['destroy']()[_0xb84a('0x19')](function(){var _0x13c167=_0x47a5b6[_0xb84a('0x32')]({'plain':!![]});var _0x308240=_0xb84a('0x33');return db[_0xb84a('0x34')][_0xb84a('0x35')]({'where':{'type':_0x308240,'resourceId':_0x13c167['id']}})[_0xb84a('0x19')](function(){return _0x47a5b6;});})['then'](function(){_0x2eea7e[_0xb84a('0x26')](0xcc)[_0xb84a('0x27')]();});}};}function handleEntityNotFound(_0x10b944,_0xf894a6){return function(_0x36aa07){if(!_0x36aa07){_0x10b944[_0xb84a('0x25')](0x194);}return _0x36aa07;};}function handleError(_0x2a5130,_0x5aa2ae){_0x5aa2ae=_0x5aa2ae||0x1f4;return function(_0x30d22d){logger['error'](_0x30d22d[_0xb84a('0x36')]);if(_0x30d22d[_0xb84a('0x37')]){delete _0x30d22d[_0xb84a('0x37')];}_0x2a5130['status'](_0x5aa2ae)['send'](_0x30d22d);};}exports[_0xb84a('0x38')]=function(_0x75e6e6,_0x4a3737){var _0x2d3e08={},_0xab76ce={},_0x4cb5d4={'count':0x0,'rows':[]};var _0x19aa4c=_[_0xb84a('0x39')](db['Trunk'][_0xb84a('0x3a')],function(_0xe6f19e){return{'name':_0xe6f19e[_0xb84a('0x3b')],'type':_0xe6f19e[_0xb84a('0x3c')]['key']};});_0xab76ce['model']=_['map'](_0x19aa4c,_0xb84a('0x37'));_0xab76ce[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x75e6e6[_0xb84a('0x3d')]);_0xab76ce['filters']=_[_0xb84a('0x3f')](_0xab76ce['model'],_0xab76ce[_0xb84a('0x3d')]);_0x2d3e08['attributes']=_['intersection'](_0xab76ce['model'],qs[_0xb84a('0x40')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x2d3e08[_0xb84a('0x41')]=_0x2d3e08['attributes'][_0xb84a('0x42')]?_0x2d3e08[_0xb84a('0x41')]:_0xab76ce[_0xb84a('0x43')];if(!_0x75e6e6[_0xb84a('0x3d')]['hasOwnProperty']('nolimit')){_0x2d3e08[_0xb84a('0x2b')]=qs[_0xb84a('0x2b')](_0x75e6e6['query'][_0xb84a('0x2b')]);_0x2d3e08[_0xb84a('0x29')]=qs[_0xb84a('0x29')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x29')]);}_0x2d3e08[_0xb84a('0x44')]=qs[_0xb84a('0x45')](_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x45')]);_0x2d3e08[_0xb84a('0x46')]=qs[_0xb84a('0x47')](_[_0xb84a('0x48')](_0x75e6e6[_0xb84a('0x3d')],_0xab76ce[_0xb84a('0x47')]),_0x19aa4c);if(_0x75e6e6[_0xb84a('0x3d')]['filter']){_0x2d3e08[_0xb84a('0x46')]=_[_0xb84a('0x49')](_0x2d3e08[_0xb84a('0x46')],{'$or':_[_0xb84a('0x39')](_0x19aa4c,function(_0x37f4fe){if(_0x37f4fe[_0xb84a('0x3c')]!=='VIRTUAL'){var _0xfd2927={};_0xfd2927[_0x37f4fe['name']]={'$like':'%'+_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4a')]+'%'};return _0xfd2927;}})});}_0x2d3e08=_[_0xb84a('0x49')]({},_0x2d3e08,_0x75e6e6[_0xb84a('0x4b')]);var _0x5e7327={'where':_0x2d3e08[_0xb84a('0x46')]};return db[_0xb84a('0x4c')][_0xb84a('0x4d')](_0x5e7327)['then'](function(_0x55f39f){_0x4cb5d4[_0xb84a('0x4d')]=_0x55f39f;if(_0x75e6e6[_0xb84a('0x3d')][_0xb84a('0x4e')]){_0x2d3e08['include']=[{'all':!![]}];}return db['Trunk']['findAll'](_0x2d3e08);})[_0xb84a('0x19')](function(_0x384a0d){_0x4cb5d4[_0xb84a('0x4f')]=_0x384a0d;return _0x4cb5d4;})[_0xb84a('0x19')](respondWithFilteredResult(_0x4a3737,_0x2d3e08))[_0xb84a('0x24')](handleError(_0x4a3737,null));};exports['show']=function(_0x4b40fe,_0x5b853a){var _0x53d4d6={'raw':![],'where':{'id':_0x4b40fe[_0xb84a('0x50')]['id']}},_0x421ba0={};_0x421ba0['model']=_[_0xb84a('0x3e')](db[_0xb84a('0x4c')][_0xb84a('0x3a')]);_0x421ba0[_0xb84a('0x3d')]=_[_0xb84a('0x3e')](_0x4b40fe[_0xb84a('0x3d')]);_0x421ba0['filters']=_['intersection'](_0x421ba0[_0xb84a('0x43')],_0x421ba0['query']);_0x53d4d6[_0xb84a('0x41')]=_['intersection'](_0x421ba0['model'],qs['fields'](_0x4b40fe[_0xb84a('0x3d')][_0xb84a('0x40')]));_0x53d4d6[_0xb84a('0x41')]=_0x53d4d6[_0xb84a('0x41')][_0xb84a('0x42')]?_0x53d4d6[_0xb84a('0x41')]:_0x421ba0[_0xb84a('0x43')];if(_0x4b40fe[_0xb84a('0x3d')]['includeAll']){_0x53d4d6['include']=[{'all':!![]}];}_0x53d4d6=_['merge']({},_0x53d4d6,_0x4b40fe[_0xb84a('0x4b')]);return db[_0xb84a('0x4c')]['find'](_0x53d4d6)[_0xb84a('0x19')](handleEntityNotFound(_0x5b853a,null))['then'](respondWithResult(_0x5b853a,null))['catch'](handleError(_0x5b853a,null));};exports['clone']=function(_0x419e27,_0x172076){var _0x49a0e2={'where':{'id':_0x419e27[_0xb84a('0x50')]['id']}},_0x51c415={};_0x51c415[_0xb84a('0x43')]=_[_0xb84a('0x3e')](db['Trunk'][_0xb84a('0x3a')]);_0x49a0e2['attributes']=_['intersection'](_0x51c415[_0xb84a('0x43')],qs['fields'](_0x419e27[_0xb84a('0x3d')]['fields']));_0x49a0e2[_0xb84a('0x41')]=_0x49a0e2[_0xb84a('0x41')][_0xb84a('0x42')]?_0x49a0e2[_0xb84a('0x41')]:_0x51c415['model'];if(_0x419e27['query']['includeAll']){_0x49a0e2[_0xb84a('0x51')]=[{'all':!![]}];}_0x49a0e2=_[_0xb84a('0x49')]({},_0x49a0e2,_0x419e27['options']);return db['Trunk'][_0xb84a('0x52')](_0x49a0e2)[_0xb84a('0x19')](handleEntityNotFound(_0x172076,null))[_0xb84a('0x19')](function(_0x5f415d){if(_0x5f415d){var _0x29f67f=_0x5f415d[_0xb84a('0x32')]({'plain':!![]});_0x29f67f=qs['omit'](_0x29f67f,['id',_0xb84a('0x53'),_0xb84a('0x54')]);_0x419e27[_0xb84a('0x55')]=_[_0xb84a('0x56')](_0x419e27[_0xb84a('0x55')],['id',_0xb84a('0x53'),_0xb84a('0x54')]);return db['Trunk'][_0xb84a('0x57')](_[_0xb84a('0x49')](_0x29f67f,_0x419e27['body']),{'include':_0x419e27[_0xb84a('0x3d')][_0xb84a('0x4e')]?[{'all':!![]}]:undefined})[_0xb84a('0x19')](function(_0x3e16d8){var _0x347998=_0x419e27[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x347998)throw new Error(_0xb84a('0x59'));if(_0x347998[_0xb84a('0x5a')]==='user'){var _0x291008=_0x3e16d8['get']({'plain':!![]});var _0x5a2d44=_0xb84a('0x33');return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0x5a2d44,'userProfileId':_0x347998['userProfileId']},'raw':!![]})[_0xb84a('0x19')](function(_0x44e508){if(_0x44e508&&_0x44e508['autoAssociation']===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x291008[_0xb84a('0x37')],'resourceId':_0x291008['id'],'type':_0x44e508[_0xb84a('0x37')],'sectionId':_0x44e508['id']},{})[_0xb84a('0x19')](function(){return _0x3e16d8;});}else{return _0x3e16d8;}})[_0xb84a('0x24')](function(_0x4514f0){logger['error'](_0xb84a('0x5b'),_0x4514f0);throw _0x4514f0;});}return _0x3e16d8;});}})['then'](respondWithResult(_0x172076,0xc9))['catch'](handleError(_0x172076,null));};exports[_0xb84a('0x57')]=function(_0x2a2dc0,_0x2ee241,_0x32a455){var _0x5612f3;return db['Trunk'][_0xb84a('0x57')](_0x2a2dc0[_0xb84a('0x55')],{'raw':!![]})[_0xb84a('0x19')](function(_0x1a2e1a){_0x5612f3=_0x1a2e1a;return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x1eec1f){var _0x57b784=fs[_0xb84a('0x5d')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0xf936f1=fs[_0xb84a('0x5d')](path[_0xb84a('0x5f')](config['root'],_0xb84a('0x60')),_0xb84a('0x5e'));var _0x33d416=ejs[_0xb84a('0x61')](_0x57b784,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x63'),_0x33d416);if(_0x5612f3[_0xb84a('0x64')]){var _0x542d70=ejs[_0xb84a('0x61')](_0xf936f1,{'trunks':_0x1eec1f||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0x542d70);}})[_0xb84a('0x19')](function(){return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x57'),{'module':'chan_sip.so'});})[_0xb84a('0x19')](function(){var _0x6f8f=_0x2a2dc0[_0xb84a('0x58')][_0xb84a('0x32')]({'plain':!![]});if(!_0x6f8f)throw new Error(_0xb84a('0x59'));if(_0x6f8f['role']===_0xb84a('0x58')){var _0x4b0b18=_0x5612f3[_0xb84a('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xb84a('0x52')]({'where':{'name':_0xb84a('0x33'),'userProfileId':_0x6f8f[_0xb84a('0x67')]},'raw':!![]})['then'](function(_0x121fda){if(_0x121fda&&_0x121fda[_0xb84a('0x68')]===0x0){return db[_0xb84a('0x34')][_0xb84a('0x57')]({'name':_0x4b0b18[_0xb84a('0x37')],'resourceId':_0x4b0b18['id'],'type':_0x121fda['name'],'sectionId':_0x121fda['id']},{})[_0xb84a('0x19')](function(){return _0x5612f3;});}else{return _0x5612f3;}})[_0xb84a('0x24')](function(_0x287d25){logger['error'](_0xb84a('0x5b'),_0x287d25);throw _0x287d25;});}return _0x5612f3;})['then'](respondWithResult(_0x2ee241,0xc9))['catch'](handleError(_0x2ee241,null));};exports[_0xb84a('0x31')]=function(_0x35cb8b,_0x13c7b7,_0x3b2a2d){var _0x2047f5;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x35cb8b[_0xb84a('0x50')]['id']}})[_0xb84a('0x19')](handleEntityNotFound(_0x13c7b7,null))[_0xb84a('0x19')](saveUpdates(_0x35cb8b[_0xb84a('0x55')],null))[_0xb84a('0x19')](function(_0x3ec1fb){if(_0x3ec1fb){_0x2047f5=_0x3ec1fb;return db[_0xb84a('0x4c')][_0xb84a('0x5c')]({'raw':!![]});}})[_0xb84a('0x19')](function(_0xb18756){if(_0xb18756){var _0x1169d1=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],'server/files/templates/trunk.ejs'),_0xb84a('0x5e'));var _0x576df5=fs[_0xb84a('0x5d')](path['join'](config[_0xb84a('0x69')],'server/files/templates/registry.ejs'),'utf8');var _0xf3f253=ejs[_0xb84a('0x61')](_0x1169d1,{'trunks':_0xb18756||[]});fs['writeFileSync'](_0xb84a('0x63'),_0xf3f253);var _0xcf9bc2=ejs[_0xb84a('0x61')](_0x576df5,{'trunks':_0xb18756||[]});fs[_0xb84a('0x62')](_0xb84a('0x65'),_0xcf9bc2);return respondWithRpcPromise('Reload',_0xb84a('0x31'),{'module':_0xb84a('0x6a')});}return null;})[_0xb84a('0x19')](function(_0x30f7cd){if(_0x30f7cd){return _0x2047f5;}})['then'](respondWithResult(_0x13c7b7,null))[_0xb84a('0x24')](handleError(_0x13c7b7,null));};exports['destroy']=function(_0x14118c,_0x12d796,_0x54ae3e){var _0xf6765a;return db[_0xb84a('0x4c')][_0xb84a('0x52')]({'where':{'id':_0x14118c['params']['id']}})['then'](handleEntityNotFound(_0x12d796,null))[_0xb84a('0x19')](removeEntity(_0x12d796,null))[_0xb84a('0x19')](function(){return db['Trunk'][_0xb84a('0x5c')]({'raw':!![]});})['then'](function(_0x166d75){var _0x54161c=fs['readFileSync'](path[_0xb84a('0x5f')](config[_0xb84a('0x69')],_0xb84a('0x6b')),_0xb84a('0x5e'));var _0x403a3e=fs['readFileSync'](path['join'](config[_0xb84a('0x69')],_0xb84a('0x60')),'utf8');var _0x305b67=ejs[_0xb84a('0x61')](_0x54161c,{'trunks':_0x166d75});var _0x385a05=ejs[_0xb84a('0x61')](_0x403a3e,{'trunks':_0x166d75});fs['writeFileSync'](_0xb84a('0x63'),_0x305b67);fs['writeFileSync'](_0xb84a('0x65'),_0x385a05);return respondWithRpcPromise(_0xb84a('0x66'),_0xb84a('0x35'),{'module':_0xb84a('0x6a')});})[_0xb84a('0x24')](handleError(_0x12d796,null));}; \ No newline at end of file +var _0xe14d=['options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','omit','createdAt','updatedAt','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','UserProfileSection','autoAssociation','readFileSync','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Trunks','UserProfileResource','destroy','stack','name','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','merge','VIRTUAL'];(function(_0x1c409f,_0x3c5ef6){var _0x1f6448=function(_0x12109f){while(--_0x12109f){_0x1c409f['push'](_0x1c409f['shift']());}};_0x1f6448(++_0x3c5ef6);}(_0xe14d,0x1ee));var _0xde14=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xe14d[_0xdea41a];return _0x15d0d8;};'use strict';var emlformat=require(_0xde14('0x0'));var rimraf=require(_0xde14('0x1'));var zipdir=require(_0xde14('0x2'));var jsonpatch=require(_0xde14('0x3'));var rp=require('request-promise');var moment=require(_0xde14('0x4'));var BPromise=require(_0xde14('0x5'));var Mustache=require('mustache');var util=require(_0xde14('0x6'));var path=require(_0xde14('0x7'));var sox=require(_0xde14('0x8'));var csv=require(_0xde14('0x9'));var ejs=require(_0xde14('0xa'));var fs=require('fs');var fs_extra=require(_0xde14('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xde14('0xc'));var jsforce=require(_0xde14('0xd'));var deskjs=require(_0xde14('0xe'));var toCsv=require(_0xde14('0x9'));var querystring=require(_0xde14('0xf'));var Papa=require(_0xde14('0x10'));var Redis=require(_0xde14('0x11'));var authService=require(_0xde14('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xde14('0x13'));var hardwareService=require(_0xde14('0x14'));var logger=require(_0xde14('0x15'))(_0xde14('0x16'));var utils=require(_0xde14('0x17'));var config=require(_0xde14('0x18'));var licenseUtil=require(_0xde14('0x19'));var db=require(_0xde14('0x1a'))['db'];var jayson=require(_0xde14('0x1b'));var client=jayson[_0xde14('0x1c')][_0xde14('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x464624,_0x3521d4,_0x281c54,_0x1489e9){return new BPromise(function(_0x54c58b,_0x584959){var _0x23c878=_0x1489e9||client;return _0x23c878[_0xde14('0x1e')](_0x464624,_0x281c54)[_0xde14('0x1f')](function(_0x4c86ff){logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));logger[_0xde14('0x23')](_0xde14('0x24'),_0x3521d4,_0xde14('0x22'),JSON[_0xde14('0x25')](_0x4c86ff));if(_0x4c86ff[_0xde14('0x26')]){if(_0x4c86ff[_0xde14('0x26')][_0xde14('0x27')]===0x1f4){logger['error'](_0xde14('0x21'),_0x3521d4,_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);return _0x584959(_0x4c86ff[_0xde14('0x26')]['message']);}logger[_0xde14('0x26')]('Trunk,\x20%s,\x20%s',_0x3521d4,_0x4c86ff[_0xde14('0x26')]['message']);return _0x54c58b(_0x4c86ff[_0xde14('0x26')][_0xde14('0x28')]);}else{logger[_0xde14('0x20')](_0xde14('0x21'),_0x3521d4,_0xde14('0x22'));_0x54c58b(_0x4c86ff[_0xde14('0x29')][_0xde14('0x28')]);}})[_0xde14('0x2a')](function(_0xdd8d59){logger[_0xde14('0x26')](_0xde14('0x21'),_0x3521d4,_0xdd8d59);_0x584959(_0xdd8d59);});});}function respondWithStatusCode(_0xbaa078,_0x8f8033){_0x8f8033=_0x8f8033||0xcc;return function(_0x5ae4c1){if(_0x5ae4c1){return _0xbaa078[_0xde14('0x2b')](_0x8f8033);}return _0xbaa078[_0xde14('0x2c')](_0x8f8033)[_0xde14('0x2d')]();};}function respondWithResult(_0xbd05d6,_0x1bb7be){_0x1bb7be=_0x1bb7be||0xc8;return function(_0x21ef15){if(_0x21ef15){return _0xbd05d6[_0xde14('0x2c')](_0x1bb7be)[_0xde14('0x2e')](_0x21ef15);}};}function respondWithFilteredResult(_0x1618e1,_0x350a78){return function(_0x4eff65){if(_0x4eff65){var _0x309922=typeof _0x350a78[_0xde14('0x2f')]===_0xde14('0x30')&&typeof _0x350a78[_0xde14('0x31')]==='undefined';var _0x3fc2a4=_0x4eff65[_0xde14('0x32')];var _0x30c4a8=_0x309922?0x0:_0x350a78['offset'];var _0x4655fb=_0x309922?_0x4eff65['count']:_0x350a78[_0xde14('0x2f')]+_0x350a78[_0xde14('0x31')];var _0x3bb1da;if(_0x4655fb>=_0x3fc2a4){_0x4655fb=_0x3fc2a4;_0x3bb1da=0xc8;}else{_0x3bb1da=0xce;}_0x1618e1[_0xde14('0x2c')](_0x3bb1da);return _0x1618e1[_0xde14('0x33')](_0xde14('0x34'),_0x30c4a8+'-'+_0x4655fb+'/'+_0x3fc2a4)[_0xde14('0x2e')](_0x4eff65);}return null;};}function patchUpdates(_0x464666){return function(_0x4e7c5b){try{jsonpatch[_0xde14('0x35')](_0x4e7c5b,_0x464666,!![]);}catch(_0xbf49ac){return BPromise['reject'](_0xbf49ac);}return _0x4e7c5b[_0xde14('0x36')]();};}function saveUpdates(_0x4c9b15,_0x2e40ad){return function(_0x44e88a){if(_0x44e88a){return _0x44e88a[_0xde14('0x37')](_0x4c9b15)[_0xde14('0x1f')](function(_0x13c164){return _0x13c164;});}return null;};}function removeEntity(_0x57fc47,_0x26dfa9){return function(_0x57b98b){if(_0x57b98b){return _0x57b98b['destroy']()[_0xde14('0x1f')](function(){var _0x3c943b=_0x57b98b[_0xde14('0x38')]({'plain':!![]});var _0x319136=_0xde14('0x39');return db[_0xde14('0x3a')][_0xde14('0x3b')]({'where':{'type':_0x319136,'resourceId':_0x3c943b['id']}})[_0xde14('0x1f')](function(){return _0x57b98b;});})[_0xde14('0x1f')](function(){_0x57fc47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7136,_0x403007){return function(_0x20913d){if(!_0x20913d){_0x1c7136[_0xde14('0x2b')](0x194);}return _0x20913d;};}function handleError(_0x31cad4,_0x23813f){_0x23813f=_0x23813f||0x1f4;return function(_0x1f42ab){logger[_0xde14('0x26')](_0x1f42ab[_0xde14('0x3c')]);if(_0x1f42ab['name']){delete _0x1f42ab[_0xde14('0x3d')];}_0x31cad4['status'](_0x23813f)['send'](_0x1f42ab);};}exports['index']=function(_0xb0eba6,_0x258759){var _0x398f63={},_0x152dab={},_0x1228d8={'count':0x0,'rows':[]};var _0x8b5bb4=_[_0xde14('0x3e')](db[_0xde14('0x3f')]['rawAttributes'],function(_0xc2a39d){return{'name':_0xc2a39d[_0xde14('0x40')],'type':_0xc2a39d[_0xde14('0x41')][_0xde14('0x42')]};});_0x152dab[_0xde14('0x43')]=_[_0xde14('0x3e')](_0x8b5bb4,_0xde14('0x3d'));_0x152dab[_0xde14('0x44')]=_['keys'](_0xb0eba6[_0xde14('0x44')]);_0x152dab[_0xde14('0x45')]=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],_0x152dab['query']);_0x398f63['attributes']=_[_0xde14('0x46')](_0x152dab[_0xde14('0x43')],qs[_0xde14('0x47')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x47')]));_0x398f63['attributes']=_0x398f63[_0xde14('0x48')][_0xde14('0x49')]?_0x398f63[_0xde14('0x48')]:_0x152dab['model'];if(!_0xb0eba6[_0xde14('0x44')]['hasOwnProperty'](_0xde14('0x4a'))){_0x398f63['limit']=qs[_0xde14('0x31')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x31')]);_0x398f63[_0xde14('0x2f')]=qs[_0xde14('0x2f')](_0xb0eba6[_0xde14('0x44')][_0xde14('0x2f')]);}_0x398f63[_0xde14('0x4b')]=qs['sort'](_0xb0eba6[_0xde14('0x44')]['sort']);_0x398f63[_0xde14('0x4c')]=qs['filters'](_[_0xde14('0x4d')](_0xb0eba6[_0xde14('0x44')],_0x152dab[_0xde14('0x45')]),_0x8b5bb4);if(_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]){_0x398f63[_0xde14('0x4c')]=_[_0xde14('0x4f')](_0x398f63[_0xde14('0x4c')],{'$or':_['map'](_0x8b5bb4,function(_0x15859c){if(_0x15859c[_0xde14('0x41')]!==_0xde14('0x50')){var _0x4b1ef7={};_0x4b1ef7[_0x15859c['name']]={'$like':'%'+_0xb0eba6[_0xde14('0x44')][_0xde14('0x4e')]+'%'};return _0x4b1ef7;}})});}_0x398f63=_[_0xde14('0x4f')]({},_0x398f63,_0xb0eba6[_0xde14('0x51')]);var _0x39572b={'where':_0x398f63[_0xde14('0x4c')]};return db['Trunk'][_0xde14('0x32')](_0x39572b)['then'](function(_0xa408ec){_0x1228d8[_0xde14('0x32')]=_0xa408ec;if(_0xb0eba6['query'][_0xde14('0x52')]){_0x398f63[_0xde14('0x53')]=[{'all':!![]}];}return db[_0xde14('0x3f')][_0xde14('0x54')](_0x398f63);})[_0xde14('0x1f')](function(_0x1c87e1){_0x1228d8[_0xde14('0x55')]=_0x1c87e1;return _0x1228d8;})['then'](respondWithFilteredResult(_0x258759,_0x398f63))[_0xde14('0x2a')](handleError(_0x258759,null));};exports['show']=function(_0xfa80c8,_0x6aa9ab){var _0x237be4={'raw':![],'where':{'id':_0xfa80c8[_0xde14('0x56')]['id']}},_0x235202={};_0x235202[_0xde14('0x43')]=_[_0xde14('0x57')](db[_0xde14('0x3f')][_0xde14('0x58')]);_0x235202[_0xde14('0x44')]=_['keys'](_0xfa80c8[_0xde14('0x44')]);_0x235202[_0xde14('0x45')]=_[_0xde14('0x46')](_0x235202[_0xde14('0x43')],_0x235202[_0xde14('0x44')]);_0x237be4['attributes']=_[_0xde14('0x46')](_0x235202['model'],qs[_0xde14('0x47')](_0xfa80c8[_0xde14('0x44')][_0xde14('0x47')]));_0x237be4[_0xde14('0x48')]=_0x237be4[_0xde14('0x48')]['length']?_0x237be4['attributes']:_0x235202[_0xde14('0x43')];if(_0xfa80c8['query'][_0xde14('0x52')]){_0x237be4[_0xde14('0x53')]=[{'all':!![]}];}_0x237be4=_[_0xde14('0x4f')]({},_0x237be4,_0xfa80c8[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x237be4)[_0xde14('0x1f')](handleEntityNotFound(_0x6aa9ab,null))[_0xde14('0x1f')](respondWithResult(_0x6aa9ab,null))[_0xde14('0x2a')](handleError(_0x6aa9ab,null));};exports['clone']=function(_0x205a94,_0x2c972b){var _0x1ea6d2={'where':{'id':_0x205a94[_0xde14('0x56')]['id']}},_0x21d226={};_0x21d226['model']=_[_0xde14('0x57')](db['Trunk'][_0xde14('0x58')]);_0x1ea6d2[_0xde14('0x48')]=_[_0xde14('0x46')](_0x21d226[_0xde14('0x43')],qs[_0xde14('0x47')](_0x205a94[_0xde14('0x44')][_0xde14('0x47')]));_0x1ea6d2[_0xde14('0x48')]=_0x1ea6d2['attributes']['length']?_0x1ea6d2['attributes']:_0x21d226[_0xde14('0x43')];if(_0x205a94['query']['includeAll']){_0x1ea6d2[_0xde14('0x53')]=[{'all':!![]}];}_0x1ea6d2=_[_0xde14('0x4f')]({},_0x1ea6d2,_0x205a94[_0xde14('0x51')]);return db[_0xde14('0x3f')][_0xde14('0x59')](_0x1ea6d2)[_0xde14('0x1f')](handleEntityNotFound(_0x2c972b,null))[_0xde14('0x1f')](function(_0x13f698){if(_0x13f698){var _0x2dd108=_0x13f698['get']({'plain':!![]});_0x2dd108=qs[_0xde14('0x5a')](_0x2dd108,['id',_0xde14('0x5b'),_0xde14('0x5c')]);_0x205a94['body']=_[_0xde14('0x5a')](_0x205a94['body'],['id',_0xde14('0x5b'),_0xde14('0x5c')]);return db[_0xde14('0x3f')][_0xde14('0x5d')](_[_0xde14('0x4f')](_0x2dd108,_0x205a94[_0xde14('0x5e')]),{'include':_0x205a94[_0xde14('0x44')]['includeAll']?[{'all':!![]}]:undefined})[_0xde14('0x1f')](function(_0x25ba7e){var _0x1a0bb1=_0x205a94[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x1a0bb1)throw new Error(_0xde14('0x60'));if(_0x1a0bb1[_0xde14('0x61')]==='user'){var _0x4a9e85=_0x25ba7e[_0xde14('0x38')]({'plain':!![]});var _0x19a162=_0xde14('0x39');return db['UserProfileSection'][_0xde14('0x59')]({'where':{'name':_0x19a162,'userProfileId':_0x1a0bb1[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x32e075){if(_0x32e075&&_0x32e075['autoAssociation']===0x0){return db['UserProfileResource'][_0xde14('0x5d')]({'name':_0x4a9e85[_0xde14('0x3d')],'resourceId':_0x4a9e85['id'],'type':_0x32e075[_0xde14('0x3d')],'sectionId':_0x32e075['id']},{})[_0xde14('0x1f')](function(){return _0x25ba7e;});}else{return _0x25ba7e;}})[_0xde14('0x2a')](function(_0x120284){logger[_0xde14('0x26')](_0xde14('0x63'),_0x120284);throw _0x120284;});}return _0x25ba7e;});}})[_0xde14('0x1f')](respondWithResult(_0x2c972b,0xc9))[_0xde14('0x2a')](handleError(_0x2c972b,null));};exports[_0xde14('0x5d')]=function(_0x299b69,_0x1ff577,_0x42329a){var _0x6a641f;return db[_0xde14('0x3f')][_0xde14('0x5d')](_0x299b69[_0xde14('0x5e')],{'raw':!![]})[_0xde14('0x1f')](function(_0x1b5d70){_0x6a641f=_0x1b5d70;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})[_0xde14('0x1f')](function(_0x4809fa){var _0x1084fb=fs['readFileSync'](path[_0xde14('0x64')](config['root'],_0xde14('0x65')),_0xde14('0x66'));var _0x3aaba2=fs['readFileSync'](path['join'](config[_0xde14('0x67')],_0xde14('0x68')),_0xde14('0x66'));var _0x430bdb=ejs['render'](_0x1084fb,{'trunks':_0x4809fa||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x430bdb);if(_0x6a641f[_0xde14('0x6b')]){var _0x500344=ejs['render'](_0x3aaba2,{'trunks':_0x4809fa||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x500344);}})[_0xde14('0x1f')](function(){return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x5d'),{'module':'chan_sip.so'});})[_0xde14('0x1f')](function(){var _0x37f7c3=_0x299b69[_0xde14('0x5f')][_0xde14('0x38')]({'plain':!![]});if(!_0x37f7c3)throw new Error(_0xde14('0x60'));if(_0x37f7c3[_0xde14('0x61')]==='user'){var _0x579a6c=_0x6a641f[_0xde14('0x38')]({'plain':!![]});return db[_0xde14('0x6d')]['find']({'where':{'name':_0xde14('0x39'),'userProfileId':_0x37f7c3[_0xde14('0x62')]},'raw':!![]})[_0xde14('0x1f')](function(_0x367ede){if(_0x367ede&&_0x367ede[_0xde14('0x6e')]===0x0){return db[_0xde14('0x3a')][_0xde14('0x5d')]({'name':_0x579a6c['name'],'resourceId':_0x579a6c['id'],'type':_0x367ede['name'],'sectionId':_0x367ede['id']},{})['then'](function(){return _0x6a641f;});}else{return _0x6a641f;}})['catch'](function(_0x3dbda9){logger[_0xde14('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3dbda9);throw _0x3dbda9;});}return _0x6a641f;})['then'](respondWithResult(_0x1ff577,0xc9))[_0xde14('0x2a')](handleError(_0x1ff577,null));};exports[_0xde14('0x37')]=function(_0xe2b9f5,_0x5805ec,_0x1aa75d){var _0x2b1e2e;return db['Trunk'][_0xde14('0x59')]({'where':{'id':_0xe2b9f5[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5805ec,null))[_0xde14('0x1f')](saveUpdates(_0xe2b9f5['body'],null))[_0xde14('0x1f')](function(_0x5a5b25){if(_0x5a5b25){_0x2b1e2e=_0x5a5b25;return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});}})[_0xde14('0x1f')](function(_0x5f49d1){if(_0x5f49d1){var _0x283eb8=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],_0xde14('0x65')),'utf8');var _0x53433d=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),_0xde14('0x66'));var _0x1a12b5=ejs[_0xde14('0x70')](_0x283eb8,{'trunks':_0x5f49d1||[]});fs[_0xde14('0x69')](_0xde14('0x6a'),_0x1a12b5);var _0x2cc5b7=ejs[_0xde14('0x70')](_0x53433d,{'trunks':_0x5f49d1||[]});fs['writeFileSync'](_0xde14('0x71'),_0x2cc5b7);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x37'),{'module':_0xde14('0x72')});}return null;})[_0xde14('0x1f')](function(_0x1732d0){if(_0x1732d0){return _0x2b1e2e;}})[_0xde14('0x1f')](respondWithResult(_0x5805ec,null))['catch'](handleError(_0x5805ec,null));};exports[_0xde14('0x3b')]=function(_0x1bdeae,_0x5f4b92,_0x4543f1){var _0x4a0108;return db[_0xde14('0x3f')]['find']({'where':{'id':_0x1bdeae[_0xde14('0x56')]['id']}})[_0xde14('0x1f')](handleEntityNotFound(_0x5f4b92,null))[_0xde14('0x1f')](removeEntity(_0x5f4b92,null))[_0xde14('0x1f')](function(){return db[_0xde14('0x3f')][_0xde14('0x54')]({'raw':!![]});})['then'](function(_0x43a155){var _0x58cf06=fs[_0xde14('0x6f')](path['join'](config[_0xde14('0x67')],_0xde14('0x65')),_0xde14('0x66'));var _0x4a1114=fs[_0xde14('0x6f')](path[_0xde14('0x64')](config[_0xde14('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x495741=ejs['render'](_0x58cf06,{'trunks':_0x43a155});var _0x381d6d=ejs[_0xde14('0x70')](_0x4a1114,{'trunks':_0x43a155});fs['writeFileSync'](_0xde14('0x6a'),_0x495741);fs[_0xde14('0x69')](_0xde14('0x71'),_0x381d6d);return respondWithRpcPromise(_0xde14('0x6c'),_0xde14('0x3b'),{'module':'chan_sip.so'});})[_0xde14('0x2a')](handleError(_0x5f4b92,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index a5aaef8..4339d17 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 _0xc89e=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash'];(function(_0x4fddef,_0x310de0){var _0x4bf833=function(_0x36f3a1){while(--_0x36f3a1){_0x4fddef['push'](_0x4fddef['shift']());}};_0x4bf833(++_0x310de0);}(_0xc89e,0xcf));var _0xec89=function(_0x2c21a9,_0x2b4abe){_0x2c21a9=_0x2c21a9-0x0;var _0x92ba4=_0xc89e[_0x2c21a9];return _0x92ba4;};'use strict';var _=require(_0xec89('0x0'));var util=require('util');var logger=require(_0xec89('0x1'))('api');var moment=require(_0xec89('0x2'));var BPromise=require(_0xec89('0x3'));var rp=require(_0xec89('0x4'));var fs=require('fs');var path=require(_0xec89('0x5'));var rimraf=require(_0xec89('0x6'));var config=require(_0xec89('0x7'));var attributes=require(_0xec89('0x8'));module[_0xec89('0x9')]=function(_0xe03165,_0x100d0d){return _0xe03165[_0xec89('0xa')](_0xec89('0xb'),attributes,{'tableName':_0xec89('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24b3=['moment','bluebird','rimraf','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','../../config/logger','api'];(function(_0x2bf40f,_0x36c9da){var _0x57c391=function(_0x1be4da){while(--_0x1be4da){_0x2bf40f['push'](_0x2bf40f['shift']());}};_0x57c391(++_0x36c9da);}(_0x24b3,0x13c));var _0x324b=function(_0x18f4cf,_0x58a059){_0x18f4cf=_0x18f4cf-0x0;var _0x3a9d12=_0x24b3[_0x18f4cf];return _0x3a9d12;};'use strict';var _=require(_0x324b('0x0'));var util=require('util');var logger=require(_0x324b('0x1'))(_0x324b('0x2'));var moment=require(_0x324b('0x3'));var BPromise=require(_0x324b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x324b('0x5'));var config=require('../../config/environment');var attributes=require(_0x324b('0x6'));module[_0x324b('0x7')]=function(_0x2ea281,_0x44d5da){return _0x2ea281[_0x324b('0x8')](_0x324b('0x9'),attributes,{'tableName':_0x324b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 674a870..d0f9731 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 _0x0153=['client','http','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','Trunk','findAll','options','raw','attributes','limit','map','model','include','GetTrunk','stringify','ShowTrunk','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dbae1,_0x1ae144){var _0x18b150=function(_0x5d1d3a){while(--_0x5d1d3a){_0x3dbae1['push'](_0x3dbae1['shift']());}};_0x18b150(++_0x1ae144);}(_0x0153,0x1e3));var _0x3015=function(_0x4cb8cf,_0x534140){_0x4cb8cf=_0x4cb8cf-0x0;var _0x56a35e=_0x0153[_0x4cb8cf];return _0x56a35e;};'use strict';var _=require('lodash');var util=require(_0x3015('0x0'));var moment=require(_0x3015('0x1'));var BPromise=require(_0x3015('0x2'));var rs=require(_0x3015('0x3'));var fs=require('fs');var Redis=require(_0x3015('0x4'));var db=require(_0x3015('0x5'))['db'];var utils=require(_0x3015('0x6'));var logger=require(_0x3015('0x7'))(_0x3015('0x8'));var config=require(_0x3015('0x9'));var jayson=require(_0x3015('0xa'));var client=jayson[_0x3015('0xb')][_0x3015('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe3fb1d,_0x524441,_0x2569a8){return new BPromise(function(_0x2e226e,_0x5a5770){return client['request'](_0xe3fb1d,_0x2569a8)[_0x3015('0xd')](function(_0xd2d020){logger[_0x3015('0xe')](_0x3015('0xf'),_0x524441,'request\x20sent');logger[_0x3015('0x10')](_0x3015('0x11'),_0x524441,_0x3015('0x12'),JSON['stringify'](_0xd2d020));if(_0xd2d020[_0x3015('0x13')]){if(_0xd2d020['error'][_0x3015('0x14')]===0x1f4){logger[_0x3015('0x13')](_0x3015('0xf'),_0x524441,_0xd2d020[_0x3015('0x13')]['message']);return _0x5a5770(_0xd2d020[_0x3015('0x13')][_0x3015('0x15')]);}logger[_0x3015('0x13')](_0x3015('0xf'),_0x524441,_0xd2d020[_0x3015('0x13')][_0x3015('0x15')]);return _0x2e226e(_0xd2d020[_0x3015('0x13')][_0x3015('0x15')]);}else{logger['info'](_0x3015('0xf'),_0x524441,_0x3015('0x12'));_0x2e226e(_0xd2d020[_0x3015('0x16')][_0x3015('0x15')]);}})[_0x3015('0x17')](function(_0x3700ee){logger[_0x3015('0x13')]('Trunk,\x20%s,\x20%s',_0x524441,_0x3700ee);_0x5a5770(_0x3700ee);});});}exports['GetTrunk']=function(_0x391940){var _0x1e8065=this;return new Promise(function(_0x15512e,_0x3996dd){return db[_0x3015('0x18')][_0x3015('0x19')]({'raw':_0x391940[_0x3015('0x1a')]?_0x391940[_0x3015('0x1a')][_0x3015('0x1b')]===undefined?!![]:![]:!![],'where':_0x391940['options']?_0x391940[_0x3015('0x1a')]['where']||null:null,'attributes':_0x391940[_0x3015('0x1a')]?_0x391940['options'][_0x3015('0x1c')]||null:null,'limit':_0x391940[_0x3015('0x1a')]?_0x391940['options'][_0x3015('0x1d')]||null:null,'include':_0x391940['options']?_0x391940[_0x3015('0x1a')]['include']?_[_0x3015('0x1e')](_0x391940[_0x3015('0x1a')]['include'],function(_0x1bfa5c){return{'model':db[_0x1bfa5c[_0x3015('0x1f')]],'as':_0x1bfa5c['as'],'attributes':_0x1bfa5c['attributes'],'include':_0x1bfa5c[_0x3015('0x20')]?_[_0x3015('0x1e')](_0x1bfa5c['include'],function(_0x1c8e1c){return{'model':db[_0x1c8e1c[_0x3015('0x1f')]],'as':_0x1c8e1c['as'],'attributes':_0x1c8e1c[_0x3015('0x1c')],'include':_0x1c8e1c[_0x3015('0x20')]?_[_0x3015('0x1e')](_0x1c8e1c[_0x3015('0x20')],function(_0x187cd1){return{'model':db[_0x187cd1[_0x3015('0x1f')]],'as':_0x187cd1['as'],'attributes':_0x187cd1[_0x3015('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3015('0xd')](function(_0x25c84d){logger['info']('GetTrunk',_0x391940);logger[_0x3015('0x10')](_0x3015('0x21'),_0x391940,JSON[_0x3015('0x22')](_0x25c84d));_0x15512e(_0x25c84d);})['catch'](function(_0x158e0a){logger[_0x3015('0x13')]('GetTrunk',_0x158e0a['message'],_0x391940);_0x3996dd(_0x1e8065[_0x3015('0x13')](0x1f4,_0x158e0a[_0x3015('0x15')]));});});};exports[_0x3015('0x23')]=function(_0x22f696){var _0x45b6ec=this;return new Promise(function(_0x1e2d1a,_0x25dbaa){return db['Trunk'][_0x3015('0x24')]({'raw':_0x22f696['options']?_0x22f696['options'][_0x3015('0x1b')]===undefined?!![]:![]:!![],'where':_0x22f696[_0x3015('0x1a')]?_0x22f696['options'][_0x3015('0x25')]||null:null,'attributes':_0x22f696[_0x3015('0x1a')]?_0x22f696[_0x3015('0x1a')]['attributes']||null:null,'include':_0x22f696[_0x3015('0x1a')]?_0x22f696[_0x3015('0x1a')][_0x3015('0x20')]?_['map'](_0x22f696[_0x3015('0x1a')]['include'],function(_0x2c80cc){return{'model':db[_0x2c80cc['model']],'as':_0x2c80cc['as'],'attributes':_0x2c80cc[_0x3015('0x1c')],'include':_0x2c80cc['include']?_[_0x3015('0x1e')](_0x2c80cc[_0x3015('0x20')],function(_0x5156cb){return{'model':db[_0x5156cb[_0x3015('0x1f')]],'as':_0x5156cb['as'],'attributes':_0x5156cb[_0x3015('0x1c')],'include':_0x5156cb[_0x3015('0x20')]?_[_0x3015('0x1e')](_0x5156cb[_0x3015('0x20')],function(_0x1a79de){return{'model':db[_0x1a79de[_0x3015('0x1f')]],'as':_0x1a79de['as'],'attributes':_0x1a79de['attributes']};}):[]};}):[]};}):[]:[]})[_0x3015('0xd')](function(_0x3da01b){logger['info']('ShowTrunk',_0x22f696);logger[_0x3015('0x10')](_0x3015('0x23'),_0x22f696,JSON['stringify'](_0x3da01b));_0x1e2d1a(_0x3da01b);})[_0x3015('0x17')](function(_0x91fbb3){logger[_0x3015('0x13')](_0x3015('0x23'),_0x91fbb3[_0x3015('0x15')],_0x22f696);_0x25dbaa(_0x45b6ec[_0x3015('0x13')](0x1f4,_0x91fbb3['message']));});});}; \ No newline at end of file +var _0x5d6c=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','options','raw','where','attributes','limit','map','include','model','info','GetTrunk','catch','ShowTrunk','Trunk','lodash','util','randomstring','ioredis'];(function(_0x3b590d,_0x9ebc64){var _0x2c4c26=function(_0x2dcdad){while(--_0x2dcdad){_0x3b590d['push'](_0x3b590d['shift']());}};_0x2c4c26(++_0x9ebc64);}(_0x5d6c,0xfc));var _0xc5d6=function(_0xf8c39b,_0xd19d6f){_0xf8c39b=_0xf8c39b-0x0;var _0x25d860=_0x5d6c[_0xf8c39b];return _0x25d860;};'use strict';var _=require(_0xc5d6('0x0'));var util=require(_0xc5d6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc5d6('0x2'));var fs=require('fs');var Redis=require(_0xc5d6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5d6('0x4'));var logger=require(_0xc5d6('0x5'))('rpc');var config=require(_0xc5d6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc5d6('0x7')][_0xc5d6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16704f,_0x140307,_0x3f14a3){return new BPromise(function(_0xd9b8b,_0x1666cf){return client[_0xc5d6('0x9')](_0x16704f,_0x3f14a3)[_0xc5d6('0xa')](function(_0x2fb46e){logger['info'](_0xc5d6('0xb'),_0x140307,'request\x20sent');logger[_0xc5d6('0xc')]('Trunk,\x20%s,\x20%s,\x20%s',_0x140307,_0xc5d6('0xd'),JSON[_0xc5d6('0xe')](_0x2fb46e));if(_0x2fb46e['error']){if(_0x2fb46e[_0xc5d6('0xf')][_0xc5d6('0x10')]===0x1f4){logger[_0xc5d6('0xf')](_0xc5d6('0xb'),_0x140307,_0x2fb46e[_0xc5d6('0xf')][_0xc5d6('0x11')]);return _0x1666cf(_0x2fb46e[_0xc5d6('0xf')][_0xc5d6('0x11')]);}logger[_0xc5d6('0xf')]('Trunk,\x20%s,\x20%s',_0x140307,_0x2fb46e['error'][_0xc5d6('0x11')]);return _0xd9b8b(_0x2fb46e[_0xc5d6('0xf')][_0xc5d6('0x11')]);}else{logger['info'](_0xc5d6('0xb'),_0x140307,_0xc5d6('0xd'));_0xd9b8b(_0x2fb46e[_0xc5d6('0x12')][_0xc5d6('0x11')]);}})['catch'](function(_0x315d58){logger[_0xc5d6('0xf')](_0xc5d6('0xb'),_0x140307,_0x315d58);_0x1666cf(_0x315d58);});});}exports['GetTrunk']=function(_0x40ca02){var _0x3d3339=this;return new Promise(function(_0x374788,_0x27598e){return db['Trunk']['findAll']({'raw':_0x40ca02['options']?_0x40ca02[_0xc5d6('0x13')][_0xc5d6('0x14')]===undefined?!![]:![]:!![],'where':_0x40ca02[_0xc5d6('0x13')]?_0x40ca02['options'][_0xc5d6('0x15')]||null:null,'attributes':_0x40ca02['options']?_0x40ca02[_0xc5d6('0x13')][_0xc5d6('0x16')]||null:null,'limit':_0x40ca02[_0xc5d6('0x13')]?_0x40ca02[_0xc5d6('0x13')][_0xc5d6('0x17')]||null:null,'include':_0x40ca02[_0xc5d6('0x13')]?_0x40ca02[_0xc5d6('0x13')]['include']?_[_0xc5d6('0x18')](_0x40ca02[_0xc5d6('0x13')][_0xc5d6('0x19')],function(_0x5c3d55){return{'model':db[_0x5c3d55[_0xc5d6('0x1a')]],'as':_0x5c3d55['as'],'attributes':_0x5c3d55['attributes'],'include':_0x5c3d55[_0xc5d6('0x19')]?_[_0xc5d6('0x18')](_0x5c3d55[_0xc5d6('0x19')],function(_0x413e6f){return{'model':db[_0x413e6f[_0xc5d6('0x1a')]],'as':_0x413e6f['as'],'attributes':_0x413e6f[_0xc5d6('0x16')],'include':_0x413e6f[_0xc5d6('0x19')]?_[_0xc5d6('0x18')](_0x413e6f[_0xc5d6('0x19')],function(_0x64014a){return{'model':db[_0x64014a['model']],'as':_0x64014a['as'],'attributes':_0x64014a[_0xc5d6('0x16')]};}):[]};}):[]};}):[]:[]})[_0xc5d6('0xa')](function(_0x5e8da0){logger[_0xc5d6('0x1b')](_0xc5d6('0x1c'),_0x40ca02);logger[_0xc5d6('0xc')](_0xc5d6('0x1c'),_0x40ca02,JSON['stringify'](_0x5e8da0));_0x374788(_0x5e8da0);})[_0xc5d6('0x1d')](function(_0x23795f){logger[_0xc5d6('0xf')](_0xc5d6('0x1c'),_0x23795f['message'],_0x40ca02);_0x27598e(_0x3d3339[_0xc5d6('0xf')](0x1f4,_0x23795f[_0xc5d6('0x11')]));});});};exports[_0xc5d6('0x1e')]=function(_0x1f1563){var _0x4f15be=this;return new Promise(function(_0x44d6e5,_0x53af83){return db[_0xc5d6('0x1f')]['find']({'raw':_0x1f1563[_0xc5d6('0x13')]?_0x1f1563[_0xc5d6('0x13')][_0xc5d6('0x14')]===undefined?!![]:![]:!![],'where':_0x1f1563[_0xc5d6('0x13')]?_0x1f1563[_0xc5d6('0x13')][_0xc5d6('0x15')]||null:null,'attributes':_0x1f1563['options']?_0x1f1563[_0xc5d6('0x13')][_0xc5d6('0x16')]||null:null,'include':_0x1f1563['options']?_0x1f1563['options'][_0xc5d6('0x19')]?_[_0xc5d6('0x18')](_0x1f1563[_0xc5d6('0x13')][_0xc5d6('0x19')],function(_0x17b642){return{'model':db[_0x17b642[_0xc5d6('0x1a')]],'as':_0x17b642['as'],'attributes':_0x17b642['attributes'],'include':_0x17b642['include']?_[_0xc5d6('0x18')](_0x17b642[_0xc5d6('0x19')],function(_0x494035){return{'model':db[_0x494035[_0xc5d6('0x1a')]],'as':_0x494035['as'],'attributes':_0x494035[_0xc5d6('0x16')],'include':_0x494035['include']?_['map'](_0x494035['include'],function(_0x499cd9){return{'model':db[_0x499cd9[_0xc5d6('0x1a')]],'as':_0x499cd9['as'],'attributes':_0x499cd9[_0xc5d6('0x16')]};}):[]};}):[]};}):[]:[]})[_0xc5d6('0xa')](function(_0x34e373){logger['info']('ShowTrunk',_0x1f1563);logger[_0xc5d6('0xc')](_0xc5d6('0x1e'),_0x1f1563,JSON['stringify'](_0x34e373));_0x44d6e5(_0x34e373);})[_0xc5d6('0x1d')](function(_0x277fab){logger[_0xc5d6('0xf')]('ShowTrunk',_0x277fab[_0xc5d6('0x11')],_0x1f1563);_0x53af83(_0x4f15be['error'](0x1f4,_0x277fab[_0xc5d6('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 04d813b..c3e5edb 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 _0x899a=['update','express','Router','../../components/auth/service','put','isAuthenticated'];(function(_0x279c10,_0x5daad0){var _0x1dff0f=function(_0x418b25){while(--_0x418b25){_0x279c10['push'](_0x279c10['shift']());}};_0x1dff0f(++_0x5daad0);}(_0x899a,0x91));var _0xa899=function(_0x73ec68,_0x5f28e5){_0x73ec68=_0x73ec68-0x0;var _0x295f00=_0x899a[_0x73ec68];return _0x295f00;};'use strict';var express=require(_0xa899('0x0'));var router=express[_0xa899('0x1')]();var auth=require(_0xa899('0x2'));var controller=require('./user-setting.controller');router[_0xa899('0x3')]('/:id',auth[_0xa899('0x4')](),controller[_0xa899('0x5')]);module['exports']=router; \ No newline at end of file +var _0x4dab=['../../components/auth/service','./user-setting.controller','/:id','exports'];(function(_0x2eb41e,_0x2bdf4c){var _0x493e89=function(_0x180d7f){while(--_0x180d7f){_0x2eb41e['push'](_0x2eb41e['shift']());}};_0x493e89(++_0x2bdf4c);}(_0x4dab,0xf0));var _0xb4da=function(_0x3cef37,_0xb207b8){_0x3cef37=_0x3cef37-0x0;var _0x1f712a=_0x4dab[_0x3cef37];return _0x1f712a;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xb4da('0x0'));var controller=require(_0xb4da('0x1'));router['put'](_0xb4da('0x2'),auth['isAuthenticated'](),controller['update']);module[_0xb4da('0x3')]=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 e26063b..6c17268 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 _0x3321=['ENUM','BOOLEAN','DATE','UserId','sequelize','error','warning','info','exports'];(function(_0xf4e9f6,_0x211505){var _0x292356=function(_0x228e04){while(--_0x228e04){_0xf4e9f6['push'](_0xf4e9f6['shift']());}};_0x292356(++_0x211505);}(_0x3321,0xdc));var _0x1332=function(_0x2cf02d,_0x26129b){_0x2cf02d=_0x2cf02d-0x0;var _0x3651f3=_0x3321[_0x2cf02d];return _0x3651f3;};'use strict';var Sequelize=require(_0x1332('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x1332('0x1'),_0x1332('0x2'),_0x1332('0x3'),'debug'];module[_0x1332('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x1332('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x1332('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x1332('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x1332('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x1332('0x8')}}; \ No newline at end of file +var _0x8998=['debug','ENUM','error','BOOLEAN','DATE','INTEGER','UserId','sequelize','warning','info'];(function(_0x547302,_0x5c1853){var _0x120aa6=function(_0x54de1c){while(--_0x54de1c){_0x547302['push'](_0x547302['shift']());}};_0x120aa6(++_0x5c1853);}(_0x8998,0xcf));var _0x8899=function(_0x4a1a43,_0x4017eb){_0x4a1a43=_0x4a1a43-0x0;var _0x57b5b6=_0x8998[_0x4a1a43];return _0x57b5b6;};'use strict';var Sequelize=require(_0x8899('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x8899('0x1'),_0x8899('0x2'),_0x8899('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x8899('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x8899('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x8899('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x8899('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x8899('0x8')],'unique':_0x8899('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index f6d695a..5431c0e 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 _0x27c5=['defaults','json','then','sendStatus','error','stack','name','send','update','role','admin','Invalid\x20user\x20setting\x20id','params','catch','../../config/logger','api','../../config/environment','socket.io-emitter','redis','./user-setting.socket','register'];(function(_0x21c8a0,_0xf7d1d){var _0x116c76=function(_0x1a08b9){while(--_0x1a08b9){_0x21c8a0['push'](_0x21c8a0['shift']());}};_0x116c76(++_0xf7d1d);}(_0x27c5,0x173));var _0x527c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x27c5[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0x527c('0x0'))(_0x527c('0x1'));var config=require(_0x527c('0x2'));var db=require('../../mysqldb')['db'];var socket=require(_0x527c('0x3'))(new Redis(config[_0x527c('0x4')]));require(_0x527c('0x5'))[_0x527c('0x6')](socket);config[_0x527c('0x4')]=_[_0x527c('0x7')](config[_0x527c('0x4')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x18c413,_0x5a68e8){_0x5a68e8=_0x5a68e8||0xc8;return function(_0x2db820){if(_0x2db820){return _0x18c413['status'](_0x5a68e8)[_0x527c('0x8')](_0x2db820);}};}function saveUpdates(_0x38f876){return function(_0xf25395){if(_0xf25395){return _0xf25395['update'](_0x38f876)[_0x527c('0x9')](function(_0x99813d){return _0x99813d;});}return null;};}function handleEntityNotFound(_0x1961cd){return function(_0x369374){if(!_0x369374){_0x1961cd[_0x527c('0xa')](0x194);}return _0x369374;};}function handleError(_0x6c5ef7,_0x8519ed){_0x8519ed=_0x8519ed||0x1f4;return function(_0x10984e){logger[_0x527c('0xb')](_0x10984e[_0x527c('0xc')]);if(_0x10984e[_0x527c('0xd')]){delete _0x10984e['name'];}_0x6c5ef7['status'](_0x8519ed)[_0x527c('0xe')](_0x10984e);};}exports[_0x527c('0xf')]=function(_0x30a65a,_0x331325){if(_0x30a65a['user'][_0x527c('0x10')]!==_0x527c('0x11'))throw new Error('Unauthorized');if(isNaN(Number(_0x30a65a['params']['id'])))throw new Error(_0x527c('0x12'));return db['UserSetting']['find']({'where':{'id':_0x30a65a[_0x527c('0x13')]['id']}})[_0x527c('0x9')](handleEntityNotFound(_0x331325,null))[_0x527c('0x9')](saveUpdates(_0x30a65a['body'],null))[_0x527c('0x9')](respondWithResult(_0x331325,null))[_0x527c('0x14')](handleError(_0x331325,null));}; \ No newline at end of file +var _0xdeb7=['json','then','stack','name','update','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','defaults','localhost','status'];(function(_0x316af7,_0x72e80c){var _0x286d96=function(_0x1c1d7b){while(--_0x1c1d7b){_0x316af7['push'](_0x316af7['shift']());}};_0x286d96(++_0x72e80c);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7deb('0x0'));var Redis=require(_0x7deb('0x1'));var logger=require(_0x7deb('0x2'))('api');var config=require(_0x7deb('0x3'));var db=require(_0x7deb('0x4'))['db'];var socket=require(_0x7deb('0x5'))(new Redis(config[_0x7deb('0x6')]));require(_0x7deb('0x7'))['register'](socket);config[_0x7deb('0x6')]=_[_0x7deb('0x8')](config[_0x7deb('0x6')],{'host':_0x7deb('0x9'),'port':0x18eb});function respondWithResult(_0x1d4de9,_0x1a5058){_0x1a5058=_0x1a5058||0xc8;return function(_0x4e3d14){if(_0x4e3d14){return _0x1d4de9[_0x7deb('0xa')](_0x1a5058)[_0x7deb('0xb')](_0x4e3d14);}};}function saveUpdates(_0x3cb5d4){return function(_0x4468bb){if(_0x4468bb){return _0x4468bb['update'](_0x3cb5d4)[_0x7deb('0xc')](function(_0x5e37c9){return _0x5e37c9;});}return null;};}function handleEntityNotFound(_0x49b193){return function(_0x453eaf){if(!_0x453eaf){_0x49b193['sendStatus'](0x194);}return _0x453eaf;};}function handleError(_0x3940ec,_0xee4a85){_0xee4a85=_0xee4a85||0x1f4;return function(_0x2b749e){logger['error'](_0x2b749e[_0x7deb('0xd')]);if(_0x2b749e[_0x7deb('0xe')]){delete _0x2b749e[_0x7deb('0xe')];}_0x3940ec[_0x7deb('0xa')](_0xee4a85)['send'](_0x2b749e);};}exports[_0x7deb('0xf')]=function(_0x10ea17,_0xe8e818){if(_0x10ea17[_0x7deb('0x10')][_0x7deb('0x11')]!==_0x7deb('0x12'))throw new Error(_0x7deb('0x13'));if(isNaN(Number(_0x10ea17[_0x7deb('0x14')]['id'])))throw new Error(_0x7deb('0x15'));return db[_0x7deb('0x16')][_0x7deb('0x17')]({'where':{'id':_0x10ea17[_0x7deb('0x14')]['id']}})[_0x7deb('0xc')](handleEntityNotFound(_0xe8e818,null))[_0x7deb('0xc')](saveUpdates(_0x10ea17[_0x7deb('0x18')],null))['then'](respondWithResult(_0xe8e818,null))[_0x7deb('0x19')](handleError(_0xe8e818,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 387c31f..409f6a9 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 _0xc9d2=['update','emit','exports','events','../../mysqldb','setMaxListeners'];(function(_0x331bf5,_0x8f3919){var _0x4e8c2a=function(_0x43f81e){while(--_0x43f81e){_0x331bf5['push'](_0x331bf5['shift']());}};_0x4e8c2a(++_0x8f3919);}(_0xc9d2,0x1d7));var _0x2c9d=function(_0x6fe25a,_0x438340){_0x6fe25a=_0x6fe25a-0x0;var _0x364558=_0xc9d2[_0x6fe25a];return _0x364558;};'use strict';var EventEmitter=require(_0x2c9d('0x0'));var UserSetting=require(_0x2c9d('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x2c9d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c9d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x126bbf){return function(_0x3bc3a6,_0x4a0d6e,_0x59f5a9){UserSettingEvents[_0x2c9d('0x4')](_0x126bbf+':'+_0x3bc3a6['id'],_0x3bc3a6);UserSettingEvents['emit'](_0x126bbf,_0x3bc3a6);_0x59f5a9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x2c9d('0x5')]=UserSettingEvents; \ No newline at end of file +var _0x011b=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x5c6244,_0x112ab8){var _0x5800ce=function(_0x304e3d){while(--_0x304e3d){_0x5c6244['push'](_0x5c6244['shift']());}};_0x5800ce(++_0x112ab8);}(_0x011b,0x1c4));var _0xb011=function(_0x1c336b,_0x14c2cd){_0x1c336b=_0x1c336b-0x0;var _0x125e29=_0x011b[_0x1c336b];return _0x125e29;};'use strict';var EventEmitter=require(_0xb011('0x0'));var UserSetting=require(_0xb011('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xb011('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb011('0x3'),'afterDestroy':_0xb011('0x4')};function emitEvent(_0x8435ec){return function(_0x2afd0e,_0x45e9dc,_0x5b6a44){UserSettingEvents[_0xb011('0x5')](_0x8435ec+':'+_0x2afd0e['id'],_0x2afd0e);UserSettingEvents['emit'](_0x8435ec,_0x2afd0e);_0x5b6a44(null);};}for(var e in events){if(events[_0xb011('0x6')](e)){var event=events[e];UserSetting[_0xb011('0x7')](e,emitEvent(event));}}module[_0xb011('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 571b4cf..3ef6683 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 _0x9d02=['./user-setting.attributes','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9d02,0x118));var _0x29d0=function(_0x591546,_0x27e94a){_0x591546=_0x591546-0x0;var _0x20014e=_0x9d02[_0x591546];return _0x20014e;};'use strict';var attributes=require(_0x29d0('0x0'));module['exports']=function(_0x38b711){return _0x38b711['define'](_0x29d0('0x1'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10d9e4){if(!_0x10d9e4[_0x29d0('0x2')])_0x10d9e4['clientSideLoggingEnabledSince']=null;else if(_0x10d9e4[_0x29d0('0x3')]===null)_0x10d9e4[_0x29d0('0x3')]=new Date();}}});}; \ No newline at end of file +var _0x373d=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define','UserSetting','user_settings'];(function(_0x1eb585,_0x202476){var _0x497ee2=function(_0x36dffa){while(--_0x36dffa){_0x1eb585['push'](_0x1eb585['shift']());}};_0x497ee2(++_0x202476);}(_0x373d,0x1e2));var _0xd373=function(_0x40b43c,_0x269319){_0x40b43c=_0x40b43c-0x0;var _0x1d31b7=_0x373d[_0x40b43c];return _0x1d31b7;};'use strict';var attributes=require(_0xd373('0x0'));module['exports']=function(_0x3d3d31){return _0x3d3d31[_0xd373('0x1')](_0xd373('0x2'),attributes,{'tableName':_0xd373('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x50ed19){if(!_0x50ed19[_0xd373('0x4')])_0x50ed19[_0xd373('0x5')]=null;else if(_0x50ed19[_0xd373('0x5')]===null)_0x50ed19['clientSideLoggingEnabledSince']=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 b0ce474..0b65429 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 _0xdba7=['update','emit','user-setting:update','register','length','user-setting:','./user-setting.events'];(function(_0x3419b0,_0x255acd){var _0x2fddb6=function(_0x3de0a1){while(--_0x3de0a1){_0x3419b0['push'](_0x3419b0['shift']());}};_0x2fddb6(++_0x255acd);}(_0xdba7,0x125));var _0x7dba=function(_0x590065,_0x49c7ea){_0x590065=_0x590065-0x0;var _0x485307=_0xdba7[_0x590065];return _0x485307;};'use strict';var UserSettingEvents=require(_0x7dba('0x0'));var events=['save','remove',_0x7dba('0x1')];function createListener(_0x2a8e37,_0xda004e){return function(_0x540245){_0xda004e[_0x7dba('0x2')](_0x2a8e37,_0x540245);if(_0x2a8e37===_0x7dba('0x3')){_0xda004e[_0x7dba('0x2')]('user-setting:update:user-'+_0x540245['UserId'],_0x540245);}};}exports[_0x7dba('0x4')]=function(_0x1f005f){for(var _0x1c08fc=0x0,_0x502eff=events[_0x7dba('0x5')];_0x1c08fc<_0x502eff;_0x1c08fc++){var _0x3d7873=events[_0x1c08fc];var _0x2b9ced=createListener(_0x7dba('0x6')+_0x3d7873,_0x1f005f);UserSettingEvents['on'](_0x3d7873,_0x2b9ced);}}; \ No newline at end of file +var _0xcab6=['user-setting:','./user-setting.events','update','emit','user-setting:update','UserId','length'];(function(_0x83cdee,_0x3c19ac){var _0x117300=function(_0xbace86){while(--_0xbace86){_0x83cdee['push'](_0x83cdee['shift']());}};_0x117300(++_0x3c19ac);}(_0xcab6,0xfd));var _0x6cab=function(_0x3d4779,_0x41e221){_0x3d4779=_0x3d4779-0x0;var _0x4fc60f=_0xcab6[_0x3d4779];return _0x4fc60f;};'use strict';var UserSettingEvents=require(_0x6cab('0x0'));var events=['save','remove',_0x6cab('0x1')];function createListener(_0xfeb697,_0x3b0e13){return function(_0x19a2a1){_0x3b0e13[_0x6cab('0x2')](_0xfeb697,_0x19a2a1);if(_0xfeb697===_0x6cab('0x3')){_0x3b0e13[_0x6cab('0x2')]('user-setting:update:user-'+_0x19a2a1[_0x6cab('0x4')],_0x19a2a1);}};}exports['register']=function(_0x2d8842){for(var _0x195c4b=0x0,_0x35ffd3=events[_0x6cab('0x5')];_0x195c4b<_0x35ffd3;_0x195c4b++){var _0x49e6f3=events[_0x195c4b];var _0xffb1e9=createListener(_0x6cab('0x6')+_0x49e6f3,_0x2d8842);UserSettingEvents['on'](_0x49e6f3,_0xffb1e9);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 725f0b1..22104f1 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 _0x0bfd=['/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','update','put','/:id/password','changePassword','delete','removeTeams','removeChatInteractions','removeFaxInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','/:id/fax_accounts','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./user.controller','get','isAuthenticated','index','whoami','getPresence','/:id','show','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','addContacts','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format','now','originalname','/:id/avatar','addAvatar','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions'];(function(_0x54a76f,_0x39adb2){var _0x64ab42=function(_0x610d9b){while(--_0x610d9b){_0x54a76f['push'](_0x54a76f['shift']());}};_0x64ab42(++_0x39adb2);}(_0x0bfd,0x106));var _0xd0bf=function(_0x3a2348,_0x5f0b0f){_0x3a2348=_0x3a2348-0x0;var _0x141a86=_0x0bfd[_0x3a2348];return _0x141a86;};'use strict';var multer=require(_0xd0bf('0x0'));var util=require('util');var path=require(_0xd0bf('0x1'));var timeout=require(_0xd0bf('0x2'));var express=require(_0xd0bf('0x3'));var router=express[_0xd0bf('0x4')]();var fs_extra=require(_0xd0bf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd0bf('0x6'));var config=require('../../config/environment');var controller=require(_0xd0bf('0x7'));router[_0xd0bf('0x8')]('/',auth[_0xd0bf('0x9')](),controller[_0xd0bf('0xa')]);router['get']('/describe',auth[_0xd0bf('0x9')](),controller['describe']);router[_0xd0bf('0x8')]('/whoami',auth['isAuthenticated'](),controller[_0xd0bf('0xb')]);router[_0xd0bf('0x8')]('/presence',auth[_0xd0bf('0x9')](),controller[_0xd0bf('0xc')]);router[_0xd0bf('0x8')](_0xd0bf('0xd'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0xe')]);router[_0xd0bf('0x8')]('/:id/avatar',controller[_0xd0bf('0xf')]);router[_0xd0bf('0x8')](_0xd0bf('0x10'),auth[_0xd0bf('0x9')](),controller['getOpenTabs']);router[_0xd0bf('0x8')](_0xd0bf('0x11'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x12')]);router[_0xd0bf('0x8')]('/:id/queues',auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x13')]);router[_0xd0bf('0x8')](_0xd0bf('0x14'),auth[_0xd0bf('0x9')](),controller['getVoiceQueuesRt']);router[_0xd0bf('0x8')](_0xd0bf('0x15'),auth['isAuthenticated'](),controller[_0xd0bf('0x16')]);router[_0xd0bf('0x8')](_0xd0bf('0x17'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x18')]);router[_0xd0bf('0x8')](_0xd0bf('0x19'),auth[_0xd0bf('0x9')](),controller['getScreenRecordings']);router['get'](_0xd0bf('0x1a'),auth[_0xd0bf('0x9')](),controller['getChatInteractions']);router[_0xd0bf('0x8')]('/:id/openchannel/interactions',auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x1b')]);router['get']('/:id/mail/interactions',auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x1c')]);router[_0xd0bf('0x8')](_0xd0bf('0x1d'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x1e')]);router['get'](_0xd0bf('0x1f'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x20')]);router[_0xd0bf('0x8')](_0xd0bf('0x21'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x22')]);router[_0xd0bf('0x8')](_0xd0bf('0x23'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x24')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0xd0bf('0x25')]);router[_0xd0bf('0x8')](_0xd0bf('0x26'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x27')]);router[_0xd0bf('0x8')]('/:id/prefixes',auth[_0xd0bf('0x9')](),controller['getVoicePrefixes']);router[_0xd0bf('0x8')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xd0bf('0x28')]);router[_0xd0bf('0x8')](_0xd0bf('0x29'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x2a')]);router[_0xd0bf('0x8')]('/:id/openchannel_accounts',auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x2b')]);router[_0xd0bf('0x8')](_0xd0bf('0x2c'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x2d')]);router[_0xd0bf('0x8')](_0xd0bf('0x2e'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x2f')]);router['get'](_0xd0bf('0x30'),auth['isAuthenticated'](),controller[_0xd0bf('0x31')]);router[_0xd0bf('0x8')](_0xd0bf('0x32'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x33')]);router[_0xd0bf('0x8')](_0xd0bf('0x34'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x35')]);router[_0xd0bf('0x8')](_0xd0bf('0x36'),auth['isAuthenticated'](),controller['getApiKey']);router[_0xd0bf('0x37')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xd0bf('0x38')]);router[_0xd0bf('0x37')]('/',auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x39')]);router['post'](_0xd0bf('0x3a'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x3b')]);router['post'](_0xd0bf('0x3c'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x3d')]);var upload=multer({'storage':multer[_0xd0bf('0x3e')]({'destination':function(_0x504f16,_0x47f1f6,_0x32a6cb){_0x32a6cb(null,path[_0xd0bf('0x3f')](config[_0xd0bf('0x40')],_0xd0bf('0x41')));},'filename':function(_0x413927,_0x2be9d7,_0x9b57e3){_0x9b57e3(null,util[_0xd0bf('0x42')]('%s-%s',Date[_0xd0bf('0x43')](),_0x2be9d7[_0xd0bf('0x44')]));}})});router[_0xd0bf('0x37')](_0xd0bf('0x45'),upload['single']('file'),controller[_0xd0bf('0x46')]);router['post'](_0xd0bf('0x47'),auth[_0xd0bf('0x9')](),controller['login']);router[_0xd0bf('0x37')](_0xd0bf('0x48'),auth[_0xd0bf('0x9')](),controller['logout']);router[_0xd0bf('0x37')](_0xd0bf('0x49'),auth['isAuthenticated'](),controller[_0xd0bf('0x4a')]);router[_0xd0bf('0x37')](_0xd0bf('0x4b'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x4c')]);router[_0xd0bf('0x37')](_0xd0bf('0x23'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x4d')]);router[_0xd0bf('0x37')](_0xd0bf('0x4e'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x4f')]);router['post'](_0xd0bf('0x50'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x51')]);router[_0xd0bf('0x37')](_0xd0bf('0x52'),auth[_0xd0bf('0x9')](),controller['addFaxInteractions']);router['post'](_0xd0bf('0x53'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x54')]);router[_0xd0bf('0x37')](_0xd0bf('0x55'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x56')]);router[_0xd0bf('0x37')]('/:id/whatsapp_interactions',auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x57')]);router[_0xd0bf('0x37')]('/:id/fax_accounts',auth[_0xd0bf('0x9')](),controller['addFaxAccounts']);router[_0xd0bf('0x37')](_0xd0bf('0x29'),auth[_0xd0bf('0x9')](),controller['addMailAccounts']);router[_0xd0bf('0x37')](_0xd0bf('0x58'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x59')]);router['post'](_0xd0bf('0x2c'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x5a')]);router[_0xd0bf('0x37')](_0xd0bf('0x2e'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x5b')]);router[_0xd0bf('0x37')](_0xd0bf('0x30'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x5c')]);router[_0xd0bf('0x37')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xd0bf('0x5d')]);router[_0xd0bf('0x37')](_0xd0bf('0x36'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x5e')]);router['put']('/:id',auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x5f')]);router[_0xd0bf('0x60')](_0xd0bf('0x61'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x62')]);router[_0xd0bf('0x63')](_0xd0bf('0x3c'),auth[_0xd0bf('0x9')](),controller['removeQueues']);router[_0xd0bf('0x63')](_0xd0bf('0x23'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x64')]);router['delete']('/:id',auth[_0xd0bf('0x9')](),controller['destroy']);router[_0xd0bf('0x63')](_0xd0bf('0x4e'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x65')]);router[_0xd0bf('0x63')](_0xd0bf('0x50'),auth[_0xd0bf('0x9')](),controller['removeMailInteractions']);router[_0xd0bf('0x63')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0xd0bf('0x66')]);router[_0xd0bf('0x63')](_0xd0bf('0x53'),auth[_0xd0bf('0x9')](),controller['removeSmsInteractions']);router[_0xd0bf('0x63')](_0xd0bf('0x55'),auth['isAuthenticated'](),controller[_0xd0bf('0x67')]);router[_0xd0bf('0x63')](_0xd0bf('0x68'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x69')]);router['delete'](_0xd0bf('0x6a'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x6b')]);router[_0xd0bf('0x63')](_0xd0bf('0x29'),auth['isAuthenticated'](),controller[_0xd0bf('0x6c')]);router['delete'](_0xd0bf('0x58'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x6d')]);router[_0xd0bf('0x63')](_0xd0bf('0x2c'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x6e')]);router['delete'](_0xd0bf('0x2e'),auth['isAuthenticated'](),controller[_0xd0bf('0x6f')]);router[_0xd0bf('0x63')](_0xd0bf('0x30'),auth[_0xd0bf('0x9')](),controller[_0xd0bf('0x70')]);router['delete'](_0xd0bf('0x32'),auth[_0xd0bf('0x9')](),controller['removeSquareProjects']);router[_0xd0bf('0x63')]('/:id/api_key',auth[_0xd0bf('0x9')](),controller['removeApiKey']);module[_0xd0bf('0x71')]=router; \ No newline at end of file +var _0xe11f=['/:id/api_key','removeApiKey','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/:id/contacts','addContacts','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','root','format','%s-%s','now','originalname','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','/:id/teams','addTeams','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','/:id/square_projects','addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','destroy','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','/:id/chat_websites','removeChatWebsites','removeSquareProjects'];(function(_0x140535,_0x375f02){var _0x297a72=function(_0x50f6b5){while(--_0x50f6b5){_0x140535['push'](_0x140535['shift']());}};_0x297a72(++_0x375f02);}(_0xe11f,0x152));var _0xfe11=function(_0x308982,_0x1ee045){_0x308982=_0x308982-0x0;var _0x3fb834=_0xe11f[_0x308982];return _0x3fb834;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfe11('0x0'));var timeout=require('connect-timeout');var express=require(_0xfe11('0x1'));var router=express[_0xfe11('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfe11('0x3'));var interaction=require(_0xfe11('0x4'));var config=require('../../config/environment');var controller=require('./user.controller');router[_0xfe11('0x5')]('/',auth[_0xfe11('0x6')](),controller[_0xfe11('0x7')]);router[_0xfe11('0x5')](_0xfe11('0x8'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x9')]);router[_0xfe11('0x5')](_0xfe11('0xa'),auth[_0xfe11('0x6')](),controller['whoami']);router[_0xfe11('0x5')](_0xfe11('0xb'),auth[_0xfe11('0x6')](),controller[_0xfe11('0xc')]);router[_0xfe11('0x5')](_0xfe11('0xd'),auth[_0xfe11('0x6')](),controller[_0xfe11('0xe')]);router['get'](_0xfe11('0xf'),controller['getAvatar']);router['get'](_0xfe11('0x10'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x11')]);router['get']('/:id/contacts',auth[_0xfe11('0x6')](),controller[_0xfe11('0x12')]);router['get']('/:id/queues',auth[_0xfe11('0x6')](),controller['getQueues']);router[_0xfe11('0x5')](_0xfe11('0x13'),auth['isAuthenticated'](),controller[_0xfe11('0x14')]);router[_0xfe11('0x5')]('/:id/groups',auth['isAuthenticated'](),controller[_0xfe11('0x15')]);router[_0xfe11('0x5')](_0xfe11('0x16'),auth[_0xfe11('0x6')](),controller['getRecordings']);router[_0xfe11('0x5')](_0xfe11('0x17'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x18')]);router[_0xfe11('0x5')](_0xfe11('0x19'),auth[_0xfe11('0x6')](),controller['getChatInteractions']);router['get']('/:id/openchannel/interactions',auth[_0xfe11('0x6')](),controller['getOpenchannelInteractions']);router[_0xfe11('0x5')]('/:id/mail/interactions',auth[_0xfe11('0x6')](),controller[_0xfe11('0x1a')]);router['get'](_0xfe11('0x1b'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x1c')]);router['get'](_0xfe11('0x1d'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0xfe11('0x5')](_0xfe11('0x1e'),auth[_0xfe11('0x6')](),controller['getWhatsappInteractions']);router['get']('/:id/teams',auth[_0xfe11('0x6')](),controller[_0xfe11('0x1f')]);router['get'](_0xfe11('0x20'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x21')]);router[_0xfe11('0x5')](_0xfe11('0x22'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x23')]);router['get'](_0xfe11('0x24'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x25')]);router[_0xfe11('0x5')]('/:id/fax_accounts',auth[_0xfe11('0x6')](),controller[_0xfe11('0x26')]);router[_0xfe11('0x5')](_0xfe11('0x27'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x28')]);router['get'](_0xfe11('0x29'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x2a')]);router[_0xfe11('0x5')](_0xfe11('0x2b'),auth['isAuthenticated'](),controller[_0xfe11('0x2c')]);router[_0xfe11('0x5')]('/:id/chat_websites',auth['isAuthenticated'](),controller['getChatWebsites']);router[_0xfe11('0x5')](_0xfe11('0x2d'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x2e')]);router[_0xfe11('0x5')]('/:id/square_projects',auth[_0xfe11('0x6')](),controller[_0xfe11('0x2f')]);router[_0xfe11('0x5')](_0xfe11('0x30'),auth['isAuthenticated'](),controller[_0xfe11('0x31')]);router[_0xfe11('0x5')]('/:id/api_key',auth[_0xfe11('0x6')](),controller[_0xfe11('0x32')]);router[_0xfe11('0x33')](_0xfe11('0x34'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x35')]);router[_0xfe11('0x33')]('/',auth[_0xfe11('0x6')](),controller[_0xfe11('0x36')]);router[_0xfe11('0x33')](_0xfe11('0x37'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x38')]);router[_0xfe11('0x33')](_0xfe11('0x39'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x3a')]);var upload=multer({'storage':multer[_0xfe11('0x3b')]({'destination':function(_0x5149c6,_0x19f5d3,_0x39902c){_0x39902c(null,path['join'](config[_0xfe11('0x3c')],'server/files/images/'));},'filename':function(_0x53776f,_0x3c5597,_0x7aff89){_0x7aff89(null,util[_0xfe11('0x3d')](_0xfe11('0x3e'),Date[_0xfe11('0x3f')](),_0x3c5597[_0xfe11('0x40')]));}})});router[_0xfe11('0x33')]('/:id/avatar',upload['single'](_0xfe11('0x41')),controller[_0xfe11('0x42')]);router[_0xfe11('0x33')](_0xfe11('0x43'),auth['isAuthenticated'](),controller[_0xfe11('0x44')]);router['post'](_0xfe11('0x45'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x46')]);router['post'](_0xfe11('0x47'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x48')]);router[_0xfe11('0x33')]('/:id/unpause',auth['isAuthenticated'](),controller[_0xfe11('0x49')]);router[_0xfe11('0x33')](_0xfe11('0x4a'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x4b')]);router[_0xfe11('0x33')]('/:id/chat_interactions',auth[_0xfe11('0x6')](),controller[_0xfe11('0x4c')]);router['post']('/:id/mail_interactions',auth[_0xfe11('0x6')](),controller[_0xfe11('0x4d')]);router[_0xfe11('0x33')](_0xfe11('0x4e'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x4f')]);router[_0xfe11('0x33')](_0xfe11('0x50'),auth['isAuthenticated'](),controller[_0xfe11('0x51')]);router['post']('/:id/openchannel_interactions',auth[_0xfe11('0x6')](),controller['addOpenchannelInteractions']);router[_0xfe11('0x33')](_0xfe11('0x52'),auth['isAuthenticated'](),controller[_0xfe11('0x53')]);router[_0xfe11('0x33')](_0xfe11('0x54'),auth[_0xfe11('0x6')](),controller['addFaxAccounts']);router[_0xfe11('0x33')](_0xfe11('0x27'),auth[_0xfe11('0x6')](),controller['addMailAccounts']);router[_0xfe11('0x33')](_0xfe11('0x29'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x55')]);router[_0xfe11('0x33')](_0xfe11('0x2b'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x56')]);router[_0xfe11('0x33')]('/:id/chat_websites',auth[_0xfe11('0x6')](),controller['addChatWebsites']);router[_0xfe11('0x33')](_0xfe11('0x2d'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x57')]);router['post'](_0xfe11('0x58'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x59')]);router[_0xfe11('0x33')]('/:id/api_key',auth[_0xfe11('0x6')](),controller[_0xfe11('0x5a')]);router[_0xfe11('0x5b')](_0xfe11('0xd'),auth['isAuthenticated'](),controller[_0xfe11('0x5c')]);router['put']('/:id/password',auth['isAuthenticated'](),controller[_0xfe11('0x5d')]);router[_0xfe11('0x5e')]('/:id/queues',auth[_0xfe11('0x6')](),controller[_0xfe11('0x5f')]);router[_0xfe11('0x5e')](_0xfe11('0x4a'),auth[_0xfe11('0x6')](),controller['removeTeams']);router[_0xfe11('0x5e')](_0xfe11('0xd'),auth['isAuthenticated'](),controller[_0xfe11('0x60')]);router[_0xfe11('0x5e')](_0xfe11('0x61'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x62')]);router[_0xfe11('0x5e')](_0xfe11('0x63'),auth['isAuthenticated'](),controller[_0xfe11('0x64')]);router[_0xfe11('0x5e')](_0xfe11('0x4e'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x65')]);router[_0xfe11('0x5e')](_0xfe11('0x50'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x66')]);router[_0xfe11('0x5e')](_0xfe11('0x67'),auth[_0xfe11('0x6')](),controller['removeOpenchannelInteractions']);router[_0xfe11('0x5e')]('/:id/whatsapp_interactions',auth[_0xfe11('0x6')](),controller['removeWhatsappInteractions']);router[_0xfe11('0x5e')](_0xfe11('0x54'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x68')]);router[_0xfe11('0x5e')](_0xfe11('0x27'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x69')]);router['delete'](_0xfe11('0x29'),auth['isAuthenticated'](),controller[_0xfe11('0x6a')]);router['delete'](_0xfe11('0x2b'),auth[_0xfe11('0x6')](),controller['removeSmsAccounts']);router[_0xfe11('0x5e')](_0xfe11('0x6b'),auth['isAuthenticated'](),controller[_0xfe11('0x6c')]);router[_0xfe11('0x5e')]('/:id/whatsapp_accounts',auth[_0xfe11('0x6')](),controller['removeWhatsappAccounts']);router[_0xfe11('0x5e')](_0xfe11('0x58'),auth[_0xfe11('0x6')](),controller[_0xfe11('0x6d')]);router[_0xfe11('0x5e')](_0xfe11('0x6e'),auth['isAuthenticated'](),controller[_0xfe11('0x6f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index d3c6fe8..f76c65f 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 _0x77c5=['user','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','update','outgoing','yes','force_rport,comedia','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\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','nonat','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','local','INTEGER','accountcode','BOOLEAN','DATE','dynamic'];(function(_0x21fd48,_0x5290d4){var _0x16721a=function(_0x287073){while(--_0x287073){_0x21fd48['push'](_0x21fd48['shift']());}};_0x16721a(++_0x5290d4);}(_0x77c5,0x16b));var _0x577c=function(_0x2766db,_0x561683){_0x2766db=_0x2766db-0x0;var _0x4e8699=_0x77c5[_0x2766db];return _0x4e8699;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x577c('0x0'));var util=require(_0x577c('0x1'));var _=require(_0x577c('0x2'));module[_0x577c('0x3')]={'name':{'type':Sequelize[_0x577c('0x4')],'allowNull':![],'unique':_0x577c('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xda72e4){this[_0x577c('0x6')]('name',_0xda72e4);this['setDataValue'](_0x577c('0x7'),_0xda72e4);},'comment':_0x577c('0x8')},'fullname':{'type':Sequelize[_0x577c('0x4')],'allowNull':![],'set':function(_0x17f937){this[_0x577c('0x6')]('fullname',_0x17f937);this[_0x577c('0x6')](_0x577c('0x9'),util[_0x577c('0xa')](_0x577c('0xb'),_0x17f937,this[_0x577c('0xc')](_0x577c('0xd'))));}},'alias':{'type':Sequelize[_0x577c('0x4')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x577c('0xe'),'validate':{'isEmail':!![]},'set':function(_0x2a82c9){if(_0x2a82c9){this[_0x577c('0x6')](_0x577c('0xe'),_0x2a82c9[_0x577c('0xf')]());}}},'role':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x11'),'user',_0x577c('0x12'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x577c('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x577c('0x4')],'defaultValue':_0x577c('0x13')},'internal':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':![],'unique':_0x577c('0xd'),'set':function(_0x34f586){this[_0x577c('0x6')](_0x577c('0xd'),_0x34f586);this[_0x577c('0x6')](_0x577c('0x15'),_0x34f586);this[_0x577c('0x6')](_0x577c('0x9'),util[_0x577c('0xa')](_0x577c('0xb'),this[_0x577c('0xc')]('fullname'),_0x34f586));}},'salt':{'type':Sequelize[_0x577c('0x4')]},'phone':{'type':Sequelize[_0x577c('0x4')]},'mobile':{'type':Sequelize[_0x577c('0x4')]},'address':{'type':Sequelize[_0x577c('0x4')]},'zipcode':{'type':Sequelize[_0x577c('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x577c('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x577c('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x577c('0x17')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x577c('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x577c('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x577c('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x577c('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x577c('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x577c('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![],'defaultValue':_0x577c('0x18')},'ipaddr':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x577c('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x577c('0x10')]('friend',_0x577c('0x19'),_0x577c('0x1a')),'allowNull':!![],'defaultValue':_0x577c('0x1b')},'context':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![],'defaultValue':_0x577c('0x1c')},'callingpres':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x1d'),_0x577c('0x1e'),_0x577c('0x1f'),_0x577c('0x20'),'PROHIB_NOT_SCREENED',_0x577c('0x21'),_0x577c('0x22'),_0x577c('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x577c('0x24'),'set':function(_0x23647b){this[_0x577c('0x6')]('transport',_0x23647b?_0x23647b[_0x577c('0x25')](','):null);},'get':function(){return this['getDataValue'](_0x577c('0x26'))?this[_0x577c('0xc')](_0x577c('0x26'))[_0x577c('0x27')](','):null;},'comment':_0x577c('0x28')},'dtmfmode':{'type':Sequelize['ENUM'](_0x577c('0x29'),'info',_0x577c('0x2a'),_0x577c('0x2b'),'auto'),'allowNull':!![],'defaultValue':_0x577c('0x29')},'directmedia':{'type':Sequelize[_0x577c('0x10')]('yes','no','nonat',_0x577c('0x2c'),_0x577c('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![],'defaultValue':_0x577c('0x2f'),'set':function(_0x4fbc5b){this[_0x577c('0x6')](_0x577c('0x30'),_0x4fbc5b?_0x4fbc5b[_0x577c('0x25')](','):null);},'get':function(){return this[_0x577c('0xc')](_0x577c('0x30'))?this[_0x577c('0xc')]('nat')[_0x577c('0x27')](','):null;},'comment':_0x577c('0x31')},'callgroup':{'type':Sequelize[_0x577c('0x4')]},'namedcallgroup':{'type':Sequelize[_0x577c('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x577c('0x4')]},'language':{'type':Sequelize[_0x577c('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x577c('0x4')]},'disallow':{'type':Sequelize[_0x577c('0x4')],'allowNull':![],'defaultValue':_0x577c('0x32')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x577c('0x33'),'set':function(_0x23f889){this['setDataValue']('allow',_0x23f889?_0x23f889['join'](';'):_0x577c('0x33'));},'get':function(){return this['getDataValue'](_0x577c('0x34'))?this[_0x577c('0xc')](_0x577c('0x34'))['split'](';'):null;},'comment':_0x577c('0x35')},'autoframing':{'type':Sequelize['ENUM'](_0x577c('0x2e'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![],'set':function(_0x491d2e){this[_0x577c('0x6')](_0x577c('0x36'),_0x491d2e?_0x491d2e['join'](','):null);},'get':function(){return this[_0x577c('0xc')](_0x577c('0x36'))?this['getDataValue'](_0x577c('0x36'))[_0x577c('0x27')](','):null;},'comment':_0x577c('0x37')},'trustrpid':{'type':Sequelize[_0x577c('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no',_0x577c('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![],'defaultValue':_0x577c('0x39')},'amaflags':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'allowNull':!![],'defaultValue':_0x577c('0x2e')},'busylevel':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x577c('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x577c('0x2e'),'no',_0x577c('0x3a')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x3b'),_0x577c('0x3c'),_0x577c('0x3d')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x3e'),_0x577c('0x3f')),'allowNull':!![],'defaultValue':_0x577c('0x3f')},'t38pt_usertpsource':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'allowNull':!![],'defaultValue':_0x577c('0x2e')},'keepalive':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x577c('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x577c('0x2e'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no',_0x577c('0x40'),_0x577c('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x42'),_0x577c('0x43'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x577c('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x577c('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x577c('0x2e'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no',_0x577c('0x44'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x577c('0x17')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x577c('0x45')]},'showWebBar':{'type':Sequelize[_0x577c('0x14')],'defaultValue':0x0,'set':function(_0x49a56d){this[_0x577c('0x6')](_0x577c('0x46'),_0x49a56d);var _0x1da351=this[_0x577c('0x47')]({'plain':!![]});switch(_0x49a56d){case 0x0:case 0x1:var _0x47d562=_0x1da351[_0x577c('0x26')]?_[_0x577c('0x48')](_0x1da351['transport'])?_0x1da351[_0x577c('0x26')][_0x577c('0x25')]():_0x1da351[_0x577c('0x26')]:_0x577c('0x24');if(_0x47d562===_0x577c('0x49')){_0x47d562=_0x577c('0x24');}this[_0x577c('0x6')](_0x577c('0x26'),_0x47d562);this['setDataValue'](_0x577c('0x4a'),'no');this['setDataValue'](_0x577c('0x4b'),null);this[_0x577c('0x6')](_0x577c('0x4c'),null);this[_0x577c('0x6')](_0x577c('0x4d'),null);this[_0x577c('0x6')](_0x577c('0x4e'),null);this[_0x577c('0x6')](_0x577c('0x4f'),null);this[_0x577c('0x6')]('dtlssetup',null);this[_0x577c('0x6')](_0x577c('0x50'),null);this[_0x577c('0x6')](_0x577c('0x51'),null);this['setDataValue'](_0x577c('0x52'),'no');break;case 0x2:this[_0x577c('0x6')](_0x577c('0x26'),'wss');this[_0x577c('0x6')](_0x577c('0x4a'),'yes');this[_0x577c('0x6')](_0x577c('0x4b'),_0x577c('0x2e'));this[_0x577c('0x6')](_0x577c('0x4c'),'yes');this[_0x577c('0x6')]('icesupport',_0x577c('0x2e'));this[_0x577c('0x6')](_0x577c('0x4e'),'yes');this[_0x577c('0x6')](_0x577c('0x4f'),'no');this[_0x577c('0x6')](_0x577c('0x53'),_0x577c('0x54'));this[_0x577c('0x6')](_0x577c('0x50'),_0x1da351[_0x577c('0x50')]||_0x577c('0x55'));this[_0x577c('0x6')](_0x577c('0x51'),_0x1da351[_0x577c('0x51')]||'/etc/pki/tls/private/motion.key');this[_0x577c('0x6')](_0x577c('0x52'),_0x577c('0x2e'));break;default:}}},'permissions':{'type':Sequelize[_0x577c('0x45')],'set':function(_0x1454c3){this[_0x577c('0x6')](_0x577c('0x56'),_0x1454c3?_0x1454c3[_0x577c('0x25')](','):[]);},'get':function(){return this[_0x577c('0xc')]('permissions')?_[_0x577c('0x57')](this[_0x577c('0xc')](_0x577c('0x56'))[_0x577c('0x27')](','),function(_0x48e137){return parseInt(_0x48e137,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x577c('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x577c('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x577c('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x577c('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x577c('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x577c('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x577c('0x10')](_0x577c('0x2e'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x577c('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x577c('0x58')],'get':function(){return this[_0x577c('0xc')](_0x577c('0x59'))?this['getDataValue'](_0x577c('0x59')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x577c('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x577c('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4a4f1c){if(typeof _0x4a4f1c===_0x577c('0x5a')){var _0x24383e=_0x4a4f1c==='1'?!![]:_0x4a4f1c==='0'?![]:_0x4a4f1c==='true'?!![]:_0x4a4f1c===_0x577c('0x5b')?![]:![];this[_0x577c('0x6')](_0x577c('0x5c'),_0x24383e);}else{this[_0x577c('0x6')](_0x577c('0x5c'),_0x4a4f1c);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf5ed84){this['setDataValue'](_0x577c('0x5d'),_0xf5ed84);if(_0xf5ed84===!![]){this[_0x577c('0x6')](_0x577c('0x5e'),moment());this['setDataValue'](_0x577c('0x5f'),0x0);}else{this[_0x577c('0x6')](_0x577c('0x5e'),null);}}},'blockedAt':{'type':Sequelize[_0x577c('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x577c('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x577c('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x577c('0x14')](0x5)[_0x577c('0x60')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x577c('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x577c('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x577c('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0xbc22=['accept','refuse','uas','fingerprint','certificate','active','nonat','update,nonat','TEXT','showWebBar','get','isArray','udp','encryption','avpf','force_avp','icesupport','dtlsverify','dtlssetup','dtlsprivatekey','wss','dtlsenable','actpass','dtlscertfile','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','name','setDataValue','defaultuser','STRING','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','user','agent','INTEGER','accountcode','callerid','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xbc22,0x182));var _0x2bc2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbc22[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x2bc2('0x0'));var moment=require(_0x2bc2('0x1'));var util=require(_0x2bc2('0x2'));var _=require(_0x2bc2('0x3'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2bc2('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5be216){this['setDataValue'](_0x2bc2('0x4'),_0x5be216);this[_0x2bc2('0x5')](_0x2bc2('0x6'),_0x5be216);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':![],'set':function(_0x3e5a8e){this[_0x2bc2('0x5')](_0x2bc2('0x8'),_0x3e5a8e);this['setDataValue']('callerid',util[_0x2bc2('0x9')](_0x2bc2('0xa'),_0x3e5a8e,this[_0x2bc2('0xb')](_0x2bc2('0xc'))));}},'alias':{'type':Sequelize[_0x2bc2('0x7')]},'email':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':![],'unique':_0x2bc2('0xd'),'validate':{'isEmail':!![]},'set':function(_0x544c9d){if(_0x544c9d){this[_0x2bc2('0x5')](_0x2bc2('0xd'),_0x544c9d['toLowerCase']());}}},'role':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0xf'),_0x2bc2('0x10'),_0x2bc2('0x11'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x2bc2('0x12')](0xb),'allowNull':![],'unique':_0x2bc2('0xc'),'set':function(_0xadf5a9){this[_0x2bc2('0x5')]('internal',_0xadf5a9);this['setDataValue'](_0x2bc2('0x13'),_0xadf5a9);this[_0x2bc2('0x5')](_0x2bc2('0x14'),util[_0x2bc2('0x9')](_0x2bc2('0xa'),this[_0x2bc2('0xb')](_0x2bc2('0x8')),_0xadf5a9));}},'salt':{'type':Sequelize[_0x2bc2('0x7')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x2bc2('0x7')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x2bc2('0x7')]},'userpic':{'type':Sequelize[_0x2bc2('0x7')]},'city':{'type':Sequelize[_0x2bc2('0x7')]},'country':{'type':Sequelize[_0x2bc2('0x7')]},'online':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x2bc2('0x16')]},'voicePause':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x2bc2('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x2bc2('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x2bc2('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x2bc2('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x2bc2('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x2bc2('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x2bc2('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x2bc2('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x18'),_0x2bc2('0x10'),_0x2bc2('0x19')),'allowNull':!![],'defaultValue':_0x2bc2('0x18')},'context':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![],'defaultValue':_0x2bc2('0x1a')},'callingpres':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x1b'),_0x2bc2('0x1c'),'ALLOWED_FAILED_SCREEN',_0x2bc2('0x1d'),'PROHIB_NOT_SCREENED',_0x2bc2('0x1e'),_0x2bc2('0x1f'),_0x2bc2('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'permit':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'transport':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![],'defaultValue':'udp','set':function(_0x1dbbaa){this[_0x2bc2('0x5')](_0x2bc2('0x21'),_0x1dbbaa?_0x1dbbaa[_0x2bc2('0x22')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x2bc2('0xb')](_0x2bc2('0x21'))[_0x2bc2('0x23')](','):null;},'comment':_0x2bc2('0x24')},'dtmfmode':{'type':Sequelize[_0x2bc2('0xe')]('rfc2833',_0x2bc2('0x25'),_0x2bc2('0x26'),_0x2bc2('0x27'),_0x2bc2('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no','nonat',_0x2bc2('0x2a'),_0x2bc2('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![],'defaultValue':_0x2bc2('0x2c'),'set':function(_0xb96bc){this['setDataValue'](_0x2bc2('0x2d'),_0xb96bc?_0xb96bc[_0x2bc2('0x22')](','):null);},'get':function(){return this[_0x2bc2('0xb')](_0x2bc2('0x2d'))?this['getDataValue'](_0x2bc2('0x2d'))[_0x2bc2('0x23')](','):null;},'comment':_0x2bc2('0x2e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x2bc2('0x7')]},'pickupgroup':{'type':Sequelize[_0x2bc2('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x2bc2('0x7')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2bc2('0x7')]},'disallow':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':![],'defaultValue':_0x2bc2('0x2f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3a2506){this['setDataValue'](_0x2bc2('0x30'),_0x3a2506?_0x3a2506[_0x2bc2('0x22')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0x2bc2('0xb')]('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x2bc2('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![],'set':function(_0x46dd9f){this[_0x2bc2('0x5')](_0x2bc2('0x31'),_0x46dd9f?_0x46dd9f[_0x2bc2('0x22')](','):null);},'get':function(){return this[_0x2bc2('0xb')](_0x2bc2('0x31'))?this[_0x2bc2('0xb')](_0x2bc2('0x31'))[_0x2bc2('0x23')](','):null;},'comment':_0x2bc2('0x32')},'trustrpid':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x2bc2('0x29'),'no',_0x2bc2('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x2bc2('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![],'defaultValue':_0x2bc2('0x34')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![],'defaultValue':_0x2bc2('0x29')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x2bc2('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x2bc2('0xe')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x2bc2('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'template':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x2bc2('0xe')]('yes','no',_0x2bc2('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2bc2('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x36'),_0x2bc2('0x37'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x2bc2('0xe')]('uac','uas'),'allowNull':!![],'defaultValue':_0x2bc2('0x38')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2bc2('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x2bc2('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x2bc2('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x2bc2('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x2bc2('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x2bc2('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x2bc2('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x2bc2('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x2bc2('0xe')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x2bc2('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no',_0x2bc2('0x39'),_0x2bc2('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x3b'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x2bc2('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x2bc2('0xe')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x2bc2('0x29'),'no',_0x2bc2('0x3c'),'update',_0x2bc2('0x3d')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x2bc2('0x7')]},'resetPasswordExpires':{'type':Sequelize[_0x2bc2('0x16')]},'passwordResetAt':{'type':Sequelize[_0x2bc2('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x2bc2('0x3e')]},'showWebBar':{'type':Sequelize[_0x2bc2('0x12')],'defaultValue':0x0,'set':function(_0x577828){this['setDataValue'](_0x2bc2('0x3f'),_0x577828);var _0x9645f6=this[_0x2bc2('0x40')]({'plain':!![]});switch(_0x577828){case 0x0:case 0x1:var _0x399983=_0x9645f6[_0x2bc2('0x21')]?_[_0x2bc2('0x41')](_0x9645f6[_0x2bc2('0x21')])?_0x9645f6[_0x2bc2('0x21')][_0x2bc2('0x22')]():_0x9645f6[_0x2bc2('0x21')]:_0x2bc2('0x42');if(_0x399983==='wss'){_0x399983=_0x2bc2('0x42');}this[_0x2bc2('0x5')](_0x2bc2('0x21'),_0x399983);this['setDataValue'](_0x2bc2('0x43'),'no');this[_0x2bc2('0x5')](_0x2bc2('0x44'),null);this[_0x2bc2('0x5')](_0x2bc2('0x45'),null);this[_0x2bc2('0x5')](_0x2bc2('0x46'),null);this[_0x2bc2('0x5')]('dtlsenable',null);this[_0x2bc2('0x5')](_0x2bc2('0x47'),null);this[_0x2bc2('0x5')](_0x2bc2('0x48'),null);this['setDataValue']('dtlscertfile',null);this['setDataValue'](_0x2bc2('0x49'),null);this[_0x2bc2('0x5')]('rtcp_mux','no');break;case 0x2:this[_0x2bc2('0x5')]('transport',_0x2bc2('0x4a'));this[_0x2bc2('0x5')](_0x2bc2('0x43'),'yes');this['setDataValue'](_0x2bc2('0x44'),_0x2bc2('0x29'));this['setDataValue'](_0x2bc2('0x45'),_0x2bc2('0x29'));this[_0x2bc2('0x5')](_0x2bc2('0x46'),'yes');this['setDataValue'](_0x2bc2('0x4b'),_0x2bc2('0x29'));this[_0x2bc2('0x5')]('dtlsverify','no');this[_0x2bc2('0x5')](_0x2bc2('0x48'),_0x2bc2('0x4c'));this[_0x2bc2('0x5')](_0x2bc2('0x4d'),_0x9645f6['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0x2bc2('0x5')](_0x2bc2('0x49'),_0x9645f6[_0x2bc2('0x49')]||_0x2bc2('0x4e'));this[_0x2bc2('0x5')]('rtcp_mux',_0x2bc2('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0x2bc2('0x3e')],'set':function(_0x180c2c){this[_0x2bc2('0x5')](_0x2bc2('0x4f'),_0x180c2c?_0x180c2c[_0x2bc2('0x22')](','):[]);},'get':function(){return this[_0x2bc2('0xb')](_0x2bc2('0x4f'))?_[_0x2bc2('0x50')](this[_0x2bc2('0xb')](_0x2bc2('0x4f'))[_0x2bc2('0x23')](','),function(_0x4bbac1){return parseInt(_0x4bbac1,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x2bc2('0x7')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x2bc2('0x7')]},'phoneBarUnconditional':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x2bc2('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x2bc2('0x7')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x2bc2('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x2bc2('0xe')](_0x2bc2('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x2bc2('0x7')]},'phoneBarEnableJaws':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x2bc2('0x51')],'get':function(){return this[_0x2bc2('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0x2bc2('0xb')](_0x2bc2('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x2bc2('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x2bc2('0x7')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xbc77af){if(typeof _0xbc77af===_0x2bc2('0x53')){var _0xfa976b=_0xbc77af==='1'?!![]:_0xbc77af==='0'?![]:_0xbc77af==='true'?!![]:_0xbc77af===_0x2bc2('0x54')?![]:![];this['setDataValue']('screenrecording',_0xfa976b);}else{this[_0x2bc2('0x5')]('screenrecording',_0xbc77af);}}},'blocked':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![],'set':function(_0x287ce3){this['setDataValue']('blocked',_0x287ce3);if(_0x287ce3===!![]){this[_0x2bc2('0x5')](_0x2bc2('0x55'),moment());this[_0x2bc2('0x5')](_0x2bc2('0x56'),0x0);}else{this[_0x2bc2('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x2bc2('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x2bc2('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x2bc2('0x12')](0x5)[_0x2bc2('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x2bc2('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x2bc2('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 9b716f9..e4cbb68 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 _0xedf9=['settingsEnabled','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','UserProfileSection','compact','changePassword','newPassword','ValidationError','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Sequelize','findOne','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','voicePause','isValidChannel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','voice','VoiceQueue','get','interface','format','SIP/%s','UserVoiceQueueRt','Unknown\x20channel','remove','isArray','Queue:remove','emit','addAvatar','userpic','root','server/files/images/logos/default_profile.png','download','existsSync','join','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FAX','MailOpenTabs','WhatsappOpenTabs','getContacts','CmContact','filters','order','sort','pick','options','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','getVoiceQueuesRt','getGroups','VoiceRecording','UserId','ScreenRecording','getChatInteractions','OpenchannelInteraction','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','loginInPause','LOGININPAUSE','bulkCreate','isMiddleware','resolve','logout','pause','PAUSE','updateAttributes','type','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','Pause','QueuePause','getTeams','Team','addTeams','setDataValue','getChatQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','Voice','upsert','TeamVoicePrefix','UserVoicePrefix','removeTeams','Chat','getMailQueues','removeAgent','VoicePrefixId','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','concat','$and','$or','$gt','$gte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','CmHopper','firstName','lastName','dialActive','getApiKey','retrieveApiKey','token','json','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','isEmpty','inbound','flatten','lower','col','toString','asc','desc','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','SELECT','field','ui.createdAt','user_has_','_interactions','OpenTabs','bluebird','util','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','socket.io-emitter','redis','defaults','localhost','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','offset','undefined','limit','count','set','Content-Range','update','destroy','admin','Users','user','Agents','agent','Telephones','telephone','filter','map','value','includes','role','find','UserProfileResource','sendStatus','stack','name','index','rawAttributes','key','password','salt','getOptions','where','User','query','includeAll','include','UserSetting','userSetting','attributes','push','findAll','openTabs','true','rows','length','chat','dataValues','sms','fax','mail','openchannel','all','catch','show','params','model','differenceBy','keys','intersection','fields','merge','whatsapp','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','isNil','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','sequelize','QueryTypes','from','voicemail','mailbox','VoiceMail','fullname','permissions','101','103','113','110','104','105','107','108','100','111','114','create','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'];(function(_0xc09951,_0x3f3fb1){var _0x473609=function(_0x4cf6c3){while(--_0x4cf6c3){_0xc09951['push'](_0xc09951['shift']());}};_0x473609(++_0x3f3fb1);}(_0xedf9,0x116));var _0x9edf=function(_0x5e6c43,_0x132a12){_0x5e6c43=_0x5e6c43-0x0;var _0x23d90e=_0xedf9[_0x5e6c43];return _0x23d90e;};'use strict';var moment=require('moment');var BPromise=require(_0x9edf('0x0'));var util=require(_0x9edf('0x1'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x9edf('0x2'));var jayson=require('jayson/promise');var Redis=require(_0x9edf('0x3'));var authService=require(_0x9edf('0x4'));var qs=require(_0x9edf('0x5'));var logger=require(_0x9edf('0x6'))(_0x9edf('0x7'));var utils=require(_0x9edf('0x8'));var config=require('../../config/environment');var licenseUtil=require(_0x9edf('0x9'));var db=require(_0x9edf('0xa'))['db'];var socket=require(_0x9edf('0xb'))(new Redis(config[_0x9edf('0xc')]));require('./user.socket')['register'](socket);config[_0x9edf('0xc')]=_[_0x9edf('0xd')](config[_0x9edf('0xc')],{'host':_0x9edf('0xe'),'port':0x18eb});var client=jayson['client'][_0x9edf('0xf')]({'port':0x232a});var values;function respondWithRpcPromise(_0xee018a,_0xa567c2,_0x220ebf,_0x3aef7f){return new BPromise(function(_0x1f4442,_0x277e09){var _0x5af2e3=_0x3aef7f||client;return _0x5af2e3[_0x9edf('0x10')](_0xee018a,_0x220ebf)[_0x9edf('0x11')](function(_0x4ae42d){logger[_0x9edf('0x12')](_0x9edf('0x13'),_0xa567c2,_0x9edf('0x14'));logger[_0x9edf('0x15')](_0x9edf('0x16'),_0xa567c2,'request\x20sent',JSON[_0x9edf('0x17')](_0x4ae42d));if(_0x4ae42d[_0x9edf('0x18')]){if(_0x4ae42d[_0x9edf('0x18')][_0x9edf('0x19')]===0x1f4){logger['error'](_0x9edf('0x13'),_0xa567c2,_0x4ae42d[_0x9edf('0x18')][_0x9edf('0x1a')]);return _0x277e09(_0x4ae42d[_0x9edf('0x18')][_0x9edf('0x1a')]);}logger[_0x9edf('0x18')](_0x9edf('0x13'),_0xa567c2,_0x4ae42d[_0x9edf('0x18')][_0x9edf('0x1a')]);return _0x1f4442(_0x4ae42d[_0x9edf('0x18')][_0x9edf('0x1a')]);}else{logger[_0x9edf('0x12')](_0x9edf('0x13'),_0xa567c2,_0x9edf('0x14'));_0x1f4442(_0x4ae42d[_0x9edf('0x1b')][_0x9edf('0x1a')]);}})['catch'](function(_0x5db1d7){logger[_0x9edf('0x18')]('User,\x20%s,\x20%s',_0xa567c2,_0x5db1d7);_0x277e09(_0x5db1d7);});});}function respondWithStatusCode(_0x2a05b9,_0xbbbb2a){_0xbbbb2a=_0xbbbb2a||0xcc;return function(_0xde486c){if(_0xde486c){return _0x2a05b9['sendStatus'](_0xbbbb2a);}return _0x2a05b9[_0x9edf('0x1c')](_0xbbbb2a)[_0x9edf('0x1d')]();};}function respondWithResult(_0x1572ba,_0x33c50e){_0x33c50e=_0x33c50e||0xc8;return function(_0x4dc79d){if(_0x4dc79d){return _0x1572ba[_0x9edf('0x1c')](_0x33c50e)['json'](_0x4dc79d);}};}function respondWithFilteredResult(_0x254ee1,_0x3822f1){return function(_0x4c34a4){if(_0x4c34a4){var _0x5d0380=typeof _0x3822f1[_0x9edf('0x1e')]===_0x9edf('0x1f')&&typeof _0x3822f1[_0x9edf('0x20')]===_0x9edf('0x1f');var _0x5106c1=_0x4c34a4[_0x9edf('0x21')];var _0x1a2215=_0x5d0380?0x0:_0x3822f1[_0x9edf('0x1e')];var _0x1c8895=_0x5d0380?_0x4c34a4[_0x9edf('0x21')]:_0x3822f1[_0x9edf('0x1e')]+_0x3822f1[_0x9edf('0x20')];var _0x3ebf4c;if(_0x1c8895>=_0x5106c1){_0x1c8895=_0x5106c1;_0x3ebf4c=0xc8;}else{_0x3ebf4c=0xce;}_0x254ee1[_0x9edf('0x1c')](_0x3ebf4c);return _0x254ee1[_0x9edf('0x22')](_0x9edf('0x23'),_0x1a2215+'-'+_0x1c8895+'/'+_0x5106c1)['json'](_0x4c34a4);}return null;};}function saveUpdates(_0x70e2f9){return function(_0x4a5947){if(_0x4a5947){return _0x4a5947[_0x9edf('0x24')](_0x70e2f9)[_0x9edf('0x11')](function(_0x83b549){return _0x83b549;});}return null;};}function removeEntity(_0x2017fa){return function(_0x331b5c){if(_0x331b5c){return _0x331b5c[_0x9edf('0x25')]()['then'](function(){var _0xcad734=_0x331b5c['get']({'plain':!![]});if(_0xcad734['role']===_0x9edf('0x26'))return;var _0x2938c6=[{'name':_0x9edf('0x27'),'value':_0x9edf('0x28'),'ignore':!![]},{'name':_0x9edf('0x29'),'value':_0x9edf('0x2a'),'ignore':![]},{'name':_0x9edf('0x2b'),'value':_0x9edf('0x2c'),'ignore':![]}];var _0x367bab=_(_0x2938c6)[_0x9edf('0x2d')]('ignore')[_0x9edf('0x2e')]('value')[_0x9edf('0x2f')]();if(_[_0x9edf('0x30')](_0x367bab,_0xcad734[_0x9edf('0x31')])){return;}var _0x59ecc5=_[_0x9edf('0x32')](_0x2938c6,[_0x9edf('0x2f'),_0xcad734['role']])['name'];return db[_0x9edf('0x33')][_0x9edf('0x25')]({'where':{'type':_0x59ecc5,'resourceId':_0xcad734['id']}})['then'](function(){return _0x331b5c;});})[_0x9edf('0x11')](function(){_0x2017fa[_0x9edf('0x1c')](0xcc)[_0x9edf('0x1d')]();});}};}function handleEntityNotFound(_0x540e23){return function(_0x3ca284){if(!_0x3ca284){_0x540e23[_0x9edf('0x34')](0x194);}return _0x3ca284;};}function handleError(_0x55e536,_0x5611b6){_0x5611b6=_0x5611b6||0x1f4;return function(_0x4aabf8){logger['error'](_0x4aabf8[_0x9edf('0x35')]);if(_0x4aabf8[_0x9edf('0x36')]){delete _0x4aabf8['name'];}_0x55e536[_0x9edf('0x1c')](_0x5611b6)['send'](_0x4aabf8);};}exports[_0x9edf('0x37')]=function(_0x429e2d,_0x3add01){var _0x4b4cce={},_0x225b16={'count':0x0,'rows':[]};var _0x47a7fd=_(db['User'][_0x9edf('0x38')])[_0x9edf('0x2e')](function(_0x25c1cf){return{'name':_0x25c1cf['fieldName'],'type':_0x25c1cf['type'][_0x9edf('0x39')]};})['filter'](function(_0x4a7c1e){return!_[_0x9edf('0x30')]([_0x9edf('0x3a'),_0x9edf('0x3b')],_0x4a7c1e[_0x9edf('0x36')]);})[_0x9edf('0x2f')]();_0x4b4cce=qs[_0x9edf('0x3c')](_0x47a7fd,_0x429e2d);var _0xb1189a={'where':_0x4b4cce[_0x9edf('0x3d')]};return db[_0x9edf('0x3e')][_0x9edf('0x21')](_0xb1189a)[_0x9edf('0x11')](function(_0x42adfb){_0x225b16[_0x9edf('0x21')]=_0x42adfb;if(_0x429e2d[_0x9edf('0x3f')][_0x9edf('0x40')]){_0x4b4cce['include']=[{'all':!![]}];}if(_0x429e2d[_0x9edf('0x3f')]['userSetting']==='true'){_0x4b4cce[_0x9edf('0x41')]=[{'model':db[_0x9edf('0x42')],'as':_0x9edf('0x43')}];}if(!_[_0x9edf('0x30')](_0x4b4cce[_0x9edf('0x44')],'id')){_0x4b4cce[_0x9edf('0x44')][_0x9edf('0x45')]('id');}return db[_0x9edf('0x3e')][_0x9edf('0x46')](_0x4b4cce);})['then'](function(_0x3878c6){_0x225b16['rows']=_0x3878c6;if(_0x429e2d[_0x9edf('0x3f')][_0x9edf('0x47')]===_0x9edf('0x48')){var _0x48336b=[];for(var _0x1ed71a=0x0;_0x1ed71a<_0x225b16[_0x9edf('0x49')][_0x9edf('0x4a')];_0x1ed71a++){_0x48336b[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x4b'),_0x225b16[_0x9edf('0x49')][_0x1ed71a][_0x9edf('0x4c')]));_0x48336b[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x4d'),_0x225b16[_0x9edf('0x49')][_0x1ed71a][_0x9edf('0x4c')]));_0x48336b[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x4e'),_0x225b16[_0x9edf('0x49')][_0x1ed71a]['dataValues']));_0x48336b[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x4f'),_0x225b16[_0x9edf('0x49')][_0x1ed71a][_0x9edf('0x4c')]));_0x48336b[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x50'),_0x225b16[_0x9edf('0x49')][_0x1ed71a]['dataValues']));_0x48336b['push'](get_open_tabs('whatsapp',_0x225b16['rows'][_0x1ed71a][_0x9edf('0x4c')]));}return BPromise[_0x9edf('0x51')](_0x48336b)['then'](function(){return _0x225b16;});}else{return _0x225b16;}})[_0x9edf('0x11')](respondWithFilteredResult(_0x3add01,_0x4b4cce))[_0x9edf('0x52')](handleError(_0x3add01,null));};exports[_0x9edf('0x53')]=function(_0x468e8a,_0x379151){var _0xbf768d={'raw':![],'where':{'id':_0x468e8a[_0x9edf('0x54')]['id']}},_0x136a2e={};_0x136a2e[_0x9edf('0x55')]=_[_0x9edf('0x56')](_[_0x9edf('0x57')](db[_0x9edf('0x3e')][_0x9edf('0x38')]),['password',_0x9edf('0x3b')]);_0x136a2e[_0x9edf('0x3f')]=_[_0x9edf('0x57')](_0x468e8a[_0x9edf('0x3f')]);_0x136a2e['filters']=_[_0x9edf('0x58')](_0x136a2e[_0x9edf('0x55')],_0x136a2e[_0x9edf('0x3f')]);_0xbf768d[_0x9edf('0x44')]=_[_0x9edf('0x58')](_0x136a2e[_0x9edf('0x55')],qs['fields'](_0x468e8a[_0x9edf('0x3f')][_0x9edf('0x59')]));_0xbf768d[_0x9edf('0x44')]=_0xbf768d['attributes'][_0x9edf('0x4a')]?_0xbf768d[_0x9edf('0x44')]:_0x136a2e['model'];if(_0x468e8a[_0x9edf('0x3f')][_0x9edf('0x40')]){_0xbf768d[_0x9edf('0x41')]=[{'all':!![]}];}if(_0x468e8a[_0x9edf('0x3f')][_0x9edf('0x43')]==='true'){_0xbf768d['include']=[{'model':db[_0x9edf('0x42')],'as':_0x9edf('0x43')}];}_0xbf768d=_[_0x9edf('0x5a')]({},_0xbf768d,_0x468e8a['options']);if(!_[_0x9edf('0x30')](_0xbf768d[_0x9edf('0x44')],'id')){_0xbf768d[_0x9edf('0x44')][_0x9edf('0x45')]('id');}return db[_0x9edf('0x3e')][_0x9edf('0x32')](_0xbf768d)[_0x9edf('0x11')](handleEntityNotFound(_0x379151,null))['then'](function(_0x124b4b){var _0x2678d3=[];values=_0x124b4b;if(_0x468e8a[_0x9edf('0x3f')][_0x9edf('0x47')]==='true'){_0x2678d3[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x4b'),_0x124b4b[_0x9edf('0x4c')]));_0x2678d3[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x4d'),_0x124b4b[_0x9edf('0x4c')]));_0x2678d3[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x50'),_0x124b4b[_0x9edf('0x4c')]));_0x2678d3[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x5b'),_0x124b4b[_0x9edf('0x4c')]));_0x2678d3[_0x9edf('0x45')](get_open_tabs('fax',_0x124b4b['dataValues']));_0x2678d3[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x4f'),_0x124b4b[_0x9edf('0x4c')]));return BPromise['all'](_0x2678d3);}else{return values;}})[_0x9edf('0x11')](function(){return values;})[_0x9edf('0x11')](respondWithResult(_0x379151,null))[_0x9edf('0x52')](handleError(_0x379151,null));};exports['update']=function(_0x2766ca,_0x39d943){if(_0x2766ca[_0x9edf('0x5c')]['id']){delete _0x2766ca[_0x9edf('0x5c')]['id'];}delete _0x2766ca[_0x9edf('0x5c')]['role'];return db[_0x9edf('0x3e')][_0x9edf('0x32')]({'where':{'id':_0x2766ca['params']['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x39d943,null))[_0x9edf('0x11')](saveUpdates(_0x2766ca[_0x9edf('0x5c')],null))[_0x9edf('0x11')](respondWithResult(_0x39d943,null))[_0x9edf('0x52')](handleError(_0x39d943,null));};exports['describe']=function(_0x4d01e1,_0x674be){return db[_0x9edf('0x3e')][_0x9edf('0x5d')]()[_0x9edf('0x11')](respondWithResult(_0x674be,null))[_0x9edf('0x52')](handleError(_0x674be,null));};exports[_0x9edf('0x5e')]=function(_0x7e12c,_0x2dd0f9){return db[_0x9edf('0x3e')][_0x9edf('0x32')]({'where':{'id':_0x7e12c['params']['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x2dd0f9,null))[_0x9edf('0x11')](function(_0x5ddcfa){if(_0x5ddcfa){return _0x5ddcfa[_0x9edf('0x5e')](_0x7e12c[_0x9edf('0x5c')][_0x9edf('0x5f')],_[_0x9edf('0x60')](_0x7e12c['body'],['ids','id'])||{});}})[_0x9edf('0x11')](respondWithResult(_0x2dd0f9,null))[_0x9edf('0x52')](handleError(_0x2dd0f9,null));};function validateUser(_0x349c8c){return new BPromise(function(_0x250d6f,_0x1b48fa){if(_0x349c8c[_0x9edf('0x61')])return _0x250d6f(_0x349c8c);return db[_0x9edf('0x62')][_0x9edf('0x63')](0x1)['then'](function(_0x4a1a31){if(_0x4a1a31[_0x9edf('0x64')])authService[_0x9edf('0x65')](_0x349c8c[_0x9edf('0x3a')]);db['User']['max'](_0x9edf('0x61'))[_0x9edf('0x11')](function(_0x19879f){if(_['isNil'](_0x19879f)){_0x349c8c[_0x9edf('0x61')]=_0x4a1a31['min_internal']||0x1;return;}if(_[_0x9edf('0x66')](_0x4a1a31[_0x9edf('0x67')])||_0x4a1a31[_0x9edf('0x67')]===_0x19879f){_0x349c8c[_0x9edf('0x61')]=_0x19879f+0x1;return;}if(_0x4a1a31[_0x9edf('0x67')]>_0x19879f){_0x349c8c[_0x9edf('0x61')]=_0x4a1a31['min_internal'];return;}return db['sequelize'][_0x9edf('0x3f')](_0x9edf('0x68'),{'type':db[_0x9edf('0x69')][_0x9edf('0x6a')]['SELECT']})[_0x9edf('0x11')](function(_0x57001f){if(_0x57001f&&_0x57001f['length']){for(var _0x4fc407=0x0,_0x344395=_0x57001f[_0x9edf('0x4a')];_0x4fc407<_0x344395&&_[_0x9edf('0x66')](_0x349c8c[_0x9edf('0x61')]);_0x4fc407++){if(_0x4a1a31['min_internal']<=_0x57001f[_0x4fc407]['from']){_0x349c8c[_0x9edf('0x61')]=_0x57001f[_0x4fc407]['from'];}else if(_0x4a1a31[_0x9edf('0x67')]>_0x57001f[_0x4fc407][_0x9edf('0x6b')]&&_0x4a1a31[_0x9edf('0x67')]<=_0x57001f[_0x4fc407]['to']){_0x349c8c['internal']=_0x4a1a31['min_internal'];}}}if(_[_0x9edf('0x66')](_0x349c8c[_0x9edf('0x61')])){_0x349c8c[_0x9edf('0x61')]=_0x19879f+0x1;}return _0x250d6f(_0x349c8c);});});})['catch'](function(_0x56ac4a){_0x1b48fa(_0x56ac4a);});});}function updateUser(_0x291f14){return new BPromise(function(_0x52b88a,_0x52f9be){try{if(_0x291f14[_0x9edf('0x6c')]){_0x291f14[_0x9edf('0x6d')]=_0x291f14[_0x9edf('0x61')];_0x291f14[_0x9edf('0x6e')]={'mailbox':_0x291f14[_0x9edf('0x61')],'password':_0x291f14['password'],'fullname':_0x291f14[_0x9edf('0x6f')],'email':_0x291f14['email']};}if(_0x291f14[_0x9edf('0x31')]===_0x9edf('0x2a')){if(!_0x291f14[_0x9edf('0x70')])_0x291f14[_0x9edf('0x70')]=[_0x9edf('0x71'),'102',_0x9edf('0x72'),_0x9edf('0x73'),_0x9edf('0x74'),_0x9edf('0x75'),_0x9edf('0x76'),'106',_0x9edf('0x77'),_0x9edf('0x78'),'109',_0x9edf('0x79'),_0x9edf('0x7a'),_0x9edf('0x7b'),'115'];}_0x52b88a(_0x291f14);}catch(_0x4d39ea){_0x52f9be(_0x4d39ea);}});}exports[_0x9edf('0x7c')]=function(_0x210ce8,_0x55fcbb){if(_0x210ce8[_0x9edf('0x28')][_0x9edf('0x31')]==='agent')throw new Error('Unauthorized');if(_0x210ce8['body'][_0x9edf('0x31')]===_0x9edf('0x28')&&_0x210ce8[_0x9edf('0x28')]['role']!==_0x9edf('0x26')){throw new Error(_0x9edf('0x7d'));}if(_0x210ce8[_0x9edf('0x5c')][_0x9edf('0x31')]===_0x9edf('0x26')&&_0x210ce8[_0x9edf('0x28')][_0x9edf('0x31')]!==_0x9edf('0x26')){throw new Error(_0x9edf('0x7e'));}return licenseUtil[_0x9edf('0x7f')]([_0x210ce8[_0x9edf('0x5c')]])[_0x9edf('0x11')](function(){return validateUser(_0x210ce8[_0x9edf('0x5c')]);})[_0x9edf('0x11')](function(_0x44c240){return updateUser(_0x44c240)['then'](function(_0x1bd018){if(_0x1bd018[_0x9edf('0x31')]==='admin'){_0x1bd018[_0x9edf('0x80')]=_0x210ce8[_0x9edf('0x28')]['settingsEnabled'];delete _0x1bd018['userProfileId'];}return _0x1bd018;});})[_0x9edf('0x11')](function(_0x2362fb){return db[_0x9edf('0x3e')][_0x9edf('0x7c')](_0x2362fb,{'include':[{'model':db[_0x9edf('0x6e')],'as':_0x9edf('0x6e')}]});})[_0x9edf('0x11')](function(_0x11d1da){if(_0x210ce8[_0x9edf('0x5c')][_0x9edf('0x31')]===_0x9edf('0x28'))return _0x11d1da;if(_0x210ce8[_0x9edf('0x28')][_0x9edf('0x31')]!==_0x9edf('0x28'))return _0x11d1da;return db['UserProfileSection'][_0x9edf('0x32')]({'where':{'name':_0x11d1da[_0x9edf('0x31')]===_0x9edf('0x2a')?_0x9edf('0x29'):_0x9edf('0x2b'),'userProfileId':_0x210ce8['user'][_0x9edf('0x81')]},'raw':!![]})[_0x9edf('0x11')](function(_0x38831c){if(!_0x38831c||_0x38831c[_0x9edf('0x82')]!=0x0)return _0x11d1da;return db[_0x9edf('0x33')][_0x9edf('0x7c')]({'name':_0x11d1da[_0x9edf('0x36')],'resourceId':_0x11d1da['id'],'type':_0x38831c[_0x9edf('0x36')],'sectionId':_0x38831c['id']},{})[_0x9edf('0x11')](function(){return _0x11d1da;});})['catch'](function(_0x35c17c){logger['error'](_0x9edf('0x83'),_0x35c17c);throw _0x35c17c;});})['then'](respondWithResult(_0x55fcbb,0xc9))[_0x9edf('0x52')](handleError(_0x55fcbb,null));};exports['bulkCreate']=function(_0xcb5c30,_0x5233cf){var _0x5aa806=_0xcb5c30[_0x9edf('0x5c')];var _0x55ff8c=[];if(_0xcb5c30[_0x9edf('0x28')][_0x9edf('0x31')]==='agent')throw new Error(_0x9edf('0x84'));if(_[_0x9edf('0x85')](_0x5aa806,[_0x9edf('0x31'),_0x9edf('0x28')])&&_0xcb5c30[_0x9edf('0x28')][_0x9edf('0x31')]!=='admin'){throw new Error(_0x9edf('0x7d'));}if(_[_0x9edf('0x85')](_0x5aa806,[_0x9edf('0x31'),_0x9edf('0x26')])&&_0xcb5c30['user'][_0x9edf('0x31')]!==_0x9edf('0x26')){throw new Error(_0x9edf('0x86'));}return licenseUtil['checkUserLimits'](_0x5aa806)[_0x9edf('0x11')](function(){return validateUser(_0x5aa806[0x0]);})[_0x9edf('0x11')](function(){for(var _0x5143d8=0x1;_0x5143d8<_0x5aa806['length'];_0x5143d8++){var _0x15a43a=_0x5aa806[_0x5143d8-0x1]['internal'];if(!_0x5aa806[_0x5143d8][_0x9edf('0x61')])_0x5aa806[_0x5143d8][_0x9edf('0x61')]=_0x15a43a+0x1;_0x55ff8c[_0x9edf('0x45')](validateUser(_0x5aa806[_0x5143d8]));}return BPromise[_0x9edf('0x51')](_0x55ff8c);})['then'](function(){_0x55ff8c=[];for(var _0x1a83c6=0x0;_0x1a83c6<_0x5aa806['length'];_0x1a83c6++){_0x55ff8c[_0x9edf('0x45')](updateUser(_0x5aa806[_0x1a83c6]));}return BPromise[_0x9edf('0x51')](_0x55ff8c);})[_0x9edf('0x11')](function(){return BPromise[_0x9edf('0x87')](_0x5aa806,function(_0x235586){return db[_0x9edf('0x3e')][_0x9edf('0x7c')](_0x235586,{'include':[{'model':db[_0x9edf('0x6e')],'as':'VoiceMail'}]})[_0x9edf('0x11')](function(_0x26476f){_0x235586['id']=_0x26476f['id'];return _0x235586;});});})['then'](function(_0x4a9023){if(_0xcb5c30[_0x9edf('0x5c')][_0x9edf('0x31')]==='user')return _0x4a9023;if(_0xcb5c30[_0x9edf('0x28')]['role']!==_0x9edf('0x28'))return _0x4a9023;var _0x17762c=_[_0x9edf('0x85')](_0x4a9023,function(_0x321a62){return _0x321a62[_0x9edf('0x31')]===_0x9edf('0x2a')||_0x321a62[_0x9edf('0x31')]==='telephone';});if(!_0x17762c)return _0x4a9023;return db[_0x9edf('0x88')][_0x9edf('0x46')]({'where':{'name':{'$or':[_0x9edf('0x29'),'Telephones']},'userProfileId':_0xcb5c30[_0x9edf('0x28')][_0x9edf('0x81')]},'raw':!![]})[_0x9edf('0x11')](function(_0x4665c1){if(_['isEmpty'](_0x4665c1)||!_[_0x9edf('0x85')](_0x4665c1,[_0x9edf('0x82'),0x0]))return _0x4a9023;_0x55ff8c=[];var _0x599683=_(_0x4665c1)[_0x9edf('0x2e')](function(_0x3e5a68){if(_0x3e5a68[_0x9edf('0x82')]===0x1)return;return _0x3e5a68[_0x9edf('0x36')]===_0x9edf('0x29')?_0x9edf('0x2a'):_0x9edf('0x2c');})[_0x9edf('0x89')]()['value']();for(var _0x2036a0=0x0;_0x2036a0<_0x4a9023[_0x9edf('0x4a')];_0x2036a0++){if(!_[_0x9edf('0x30')](_0x599683,_0x4a9023[_0x2036a0][_0x9edf('0x31')]))return;var _0x63d5ce=_0x4a9023[_0x2036a0]['role']===_0x9edf('0x2a')?_0x9edf('0x29'):_0x9edf('0x2b');_0x55ff8c[_0x9edf('0x45')](db['UserProfileResource'][_0x9edf('0x7c')]({'name':_0x4a9023[_0x2036a0][_0x9edf('0x36')],'resourceId':_0x4a9023[_0x2036a0]['id'],'type':_0x63d5ce,'sectionId':_['find'](_0x4665c1,[_0x9edf('0x36'),_0x63d5ce])['id']},{}));}return BPromise[_0x9edf('0x51')](_0x55ff8c);});})[_0x9edf('0x11')](respondWithResult(_0x5233cf,0xc9))[_0x9edf('0x52')](handleError(_0x5233cf,null));};exports[_0x9edf('0x8a')]=function(_0x5d054e,_0x269bc5){if(_0x5d054e['body']['id']){delete _0x5d054e[_0x9edf('0x5c')]['id'];}return db[_0x9edf('0x3e')]['find']({'where':{'id':_0x5d054e[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](function(_0x5bf81c){if(!_0x5bf81c)return null;if(_0x5bf81c['id']===_0x5d054e[_0x9edf('0x28')]['id']){if(!_0x5d054e[_0x9edf('0x5c')]['oldPassword']||!_0x5d054e[_0x9edf('0x5c')][_0x9edf('0x8b')]){throw new db['Sequelize'][(_0x9edf('0x8c'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x5bf81c['authenticate'](_0x5d054e[_0x9edf('0x5c')][_0x9edf('0x8d')])){throw new db['Sequelize'][(_0x9edf('0x8c'))](_0x9edf('0x8e'));}if(_0x5d054e[_0x9edf('0x5c')][_0x9edf('0x8d')]===_0x5d054e[_0x9edf('0x5c')]['newPassword']){throw new db['Sequelize'][(_0x9edf('0x8c'))](_0x9edf('0x8f'));}}else if(_0x5d054e[_0x9edf('0x28')]['role']===_0x9edf('0x26')){if(!_0x5d054e[_0x9edf('0x5c')][_0x9edf('0x8b')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x5d054e[_0x9edf('0x28')][_0x9edf('0x31')]===_0x9edf('0x28')){if(!_0x5d054e[_0x9edf('0x5c')][_0x9edf('0x8b')]){throw new db['Sequelize'][(_0x9edf('0x8c'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x5bf81c[_0x9edf('0x31')]!=='agent'){throw new db[(_0x9edf('0x90'))][(_0x9edf('0x8c'))]('Unauthorized');}}else{throw new db[(_0x9edf('0x90'))]['ValidationError'](_0x9edf('0x84'));}return _0x5bf81c;})[_0x9edf('0x11')](handleEntityNotFound(_0x269bc5,null))[_0x9edf('0x11')](function(_0x163ac0){return db[_0x9edf('0x62')][_0x9edf('0x91')]({'attributes':['id',_0x9edf('0x64'),_0x9edf('0x92'),'passwordHistoryLimit']})[_0x9edf('0x11')](function(_0x407ef5){if(_0x407ef5[_0x9edf('0x64')])authService[_0x9edf('0x65')](_0x5d054e[_0x9edf('0x5c')]['newPassword']);if(!_0x407ef5['enforcePasswordHistory']||!_0x163ac0[_0x9edf('0x93')])return _0x163ac0;authService[_0x9edf('0x94')](_0x5d054e[_0x9edf('0x5c')]['newPassword'],_0x163ac0[_0x9edf('0x93')],_0x407ef5['passwordHistoryLimit']);return _0x163ac0;})[_0x9edf('0x11')](saveUpdates({'password':_0x5d054e['body'][_0x9edf('0x8b')],'passwordResetAt':_0x5d054e[_0x9edf('0x28')]['id']==_0x5d054e[_0x9edf('0x54')]['id']?moment():null,'previousPasswords':authService[_0x9edf('0x95')](_0x5d054e[_0x9edf('0x5c')]['newPassword'],_0x163ac0[_0x9edf('0x93')])},null));})['then'](respondWithResult(_0x269bc5,null))[_0x9edf('0x52')](handleError(_0x269bc5,null));};exports[_0x9edf('0x96')]=function(_0x52c178,_0x23bf5a){var _0x1f12ae=_0x52c178[_0x9edf('0x5c')][_0x9edf('0x97')];return db[_0x9edf('0x3e')]['find']({'where':{'id':_0x52c178['params']['id']},'attributes':['id',_0x9edf('0x36'),_0x9edf('0x31'),_0x9edf('0x98'),'loginInPause',_0x9edf('0x99'),'interface']})[_0x9edf('0x11')](handleEntityNotFound(_0x23bf5a,null))[_0x9edf('0x11')](function(_0x170d24){if(_0x170d24){if(!utils[_0x9edf('0x9a')](_0x1f12ae)){throw new db[(_0x9edf('0x90'))]['ValidationError']('Unknown\x20channel');}return _0x170d24[_0x9edf('0x9b')+_[_0x9edf('0x9c')](_0x1f12ae[_0x9edf('0x9d')]())+_0x9edf('0x9e')](_0x52c178[_0x9edf('0x5c')][_0x9edf('0x5f')],{'penalty':_0x52c178['body'][_0x9edf('0x9f')]||0x0})[_0x9edf('0xa0')](function(_0x40feed){for(var _0x232cde=0x0;_0x232cde<_0x52c178['body'][_0x9edf('0x5f')][_0x9edf('0x4a')];_0x232cde+=0x1){var _0x23f749={'UserId':Number(_0x52c178[_0x9edf('0x54')]['id'])};_0x23f749[_[_0x9edf('0x9c')](_0x1f12ae[_0x9edf('0x9d')]())+_0x9edf('0xa1')]=Number(_0x52c178[_0x9edf('0x5c')][_0x9edf('0x5f')][_0x232cde]);socket['emit'](_0x9edf('0x28')+_[_0x9edf('0x9c')](_0x1f12ae[_0x9edf('0x9d')]())+_0x9edf('0xa2'),_0x23f749);}return _0x40feed;})['then'](function(){if(_0x1f12ae===_0x9edf('0xa3')){return db[_0x9edf('0xa4')][_0x9edf('0x46')]({'where':{'id':_0x52c178[_0x9edf('0x5c')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0x9edf('0x11')](function(_0x4f6bfe){var _0x2fed59=_0x170d24[_0x9edf('0xa5')]({'plain':!![]});var _0x2a7264=[];if(_0x1f12ae==='voice'&&_0x2fed59[_0x9edf('0x31')]==='agent'&&_0x2fed59['online']){for(var _0x1c4f33=0x0;_0x1c4f33<_0x4f6bfe[_0x9edf('0x4a')];_0x1c4f33+=0x1){_0x2a7264[_0x9edf('0x45')]({'membername':_0x2fed59['name'],'UserId':_0x2fed59['id'],'queue_name':_0x4f6bfe[_0x1c4f33][_0x9edf('0x36')],'VoiceQueueId':_0x4f6bfe[_0x1c4f33]['id'],'interface':_[_0x9edf('0x66')](_0x2fed59[_0x9edf('0xa6')])?util[_0x9edf('0xa7')](_0x9edf('0xa8'),_0x2fed59['name']):_0x2fed59[_0x9edf('0xa6')],'paused':_0x2fed59[_0x9edf('0x99')]||![],'penalty':_0x52c178[_0x9edf('0x5c')]['penalty']||0x0});}return BPromise[_0x9edf('0x87')](_0x2a7264,function(_0x3ffee7){return db[_0x9edf('0xa9')]['upsert'](_0x3ffee7);});}return _0x170d24;});}})['then'](respondWithStatusCode(_0x23bf5a,null))['catch'](handleError(_0x23bf5a,null));};exports['removeQueues']=function(_0x4a3ed2,_0x52f9e2){var _0x50fd29,_0x2833f1;return db[_0x9edf('0x3e')][_0x9edf('0x32')]({'where':{'id':_0x4a3ed2[_0x9edf('0x54')]['id']},'attributes':['id',_0x9edf('0x36'),'role']})[_0x9edf('0x11')](handleEntityNotFound(_0x52f9e2,null))[_0x9edf('0x11')](function(_0x176bc7){if(_0x176bc7){_0x50fd29=_0x176bc7;if(!_0x4a3ed2[_0x9edf('0x3f')]['channel']||!utils[_0x9edf('0x9a')](_0x4a3ed2[_0x9edf('0x3f')][_0x9edf('0x97')])){throw new db[(_0x9edf('0x90'))][(_0x9edf('0x8c'))](_0x9edf('0xaa'));}return _0x176bc7[_0x9edf('0xab')+_[_0x9edf('0x9c')](_0x4a3ed2[_0x9edf('0x3f')]['channel'][_0x9edf('0x9d')]())+'Queues'](_0x4a3ed2[_0x9edf('0x3f')][_0x9edf('0x5f')]);}})[_0x9edf('0x11')](function(_0x26d540){if(_[_0x9edf('0xac')](_0x4a3ed2[_0x9edf('0x3f')][_0x9edf('0x5f')])){for(var _0x1346ab=0x0;_0x1346ab<_0x4a3ed2[_0x9edf('0x3f')]['ids']['length'];_0x1346ab+=0x1){_0x2833f1={'UserId':Number(_0x4a3ed2[_0x9edf('0x54')]['id'])};_0x2833f1[_[_0x9edf('0x9c')](_0x4a3ed2[_0x9edf('0x3f')][_0x9edf('0x97')]['toLowerCase']())+'QueueId']=Number(_0x4a3ed2[_0x9edf('0x3f')][_0x9edf('0x5f')][_0x1346ab]);socket['emit']('user'+_[_0x9edf('0x9c')](_0x4a3ed2[_0x9edf('0x3f')][_0x9edf('0x97')]['toLowerCase']())+_0x9edf('0xad'),_0x2833f1);}}else{_0x2833f1={'UserId':Number(_0x4a3ed2['params']['id'])};_0x2833f1[_[_0x9edf('0x9c')](_0x4a3ed2['query'][_0x9edf('0x97')][_0x9edf('0x9d')]())+_0x9edf('0xa1')]=Number(_0x4a3ed2[_0x9edf('0x3f')]['ids']);socket[_0x9edf('0xae')]('user'+_[_0x9edf('0x9c')](_0x4a3ed2[_0x9edf('0x3f')]['channel'][_0x9edf('0x9d')]())+_0x9edf('0xad'),_0x2833f1);}return _0x26d540;})[_0x9edf('0x11')](function(){if(_0x4a3ed2[_0x9edf('0x3f')][_0x9edf('0x97')]===_0x9edf('0xa3')){return db[_0x9edf('0xa9')][_0x9edf('0x25')]({'where':{'UserId':_0x4a3ed2[_0x9edf('0x54')]['id'],'VoiceQueueId':_0x4a3ed2[_0x9edf('0x3f')][_0x9edf('0x5f')]},'individualHooks':!![]})[_0x9edf('0x11')](function(){return _0x50fd29;});}return _0x50fd29;})['then'](respondWithStatusCode(_0x52f9e2,null))[_0x9edf('0x52')](handleError(_0x52f9e2,null));};exports[_0x9edf('0xaf')]=function(_0x114b58,_0x3af178){_0x114b58[_0x9edf('0x5c')][_0x9edf('0xb0')]=_0x114b58['file']['filename'];return db['User']['find']({'where':{'id':_0x114b58[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x3af178,null))[_0x9edf('0x11')](saveUpdates(_0x114b58[_0x9edf('0x5c')],null))[_0x9edf('0x11')](respondWithResult(_0x3af178,null))[_0x9edf('0x52')](handleError(_0x3af178,null));};exports['getAvatar']=function(_0x4d4d3d,_0x380d0a){var _0xb19707=path['join'](config[_0x9edf('0xb1')],_0x9edf('0xb2'));return db[_0x9edf('0x3e')]['find']({'where':{'id':_0x4d4d3d[_0x9edf('0x54')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x9edf('0x11')](handleEntityNotFound(_0x380d0a,null))['then'](function(_0x258c8d){if(_0x258c8d){if(_[_0x9edf('0x66')](_0x258c8d[_0x9edf('0xb0')])){return _0x380d0a[_0x9edf('0xb3')](_0xb19707);}else{if(!fs[_0x9edf('0xb4')](path[_0x9edf('0xb5')](config[_0x9edf('0xb1')],_0x9edf('0xb6'),_0x258c8d[_0x9edf('0xb0')]))){return _0x380d0a[_0x9edf('0xb3')](_0xb19707);}return _0x380d0a[_0x9edf('0xb3')](path[_0x9edf('0xb5')](config[_0x9edf('0xb1')],_0x9edf('0xb6'),_0x258c8d[_0x9edf('0xb0')]));}}})['catch'](handleError(_0x380d0a,null));};exports[_0x9edf('0xb7')]=function(_0x308c92,_0x540b5e){return db['User'][_0x9edf('0x32')]({'where':{'id':_0x308c92[_0x9edf('0x54')]['id']},'attributes':['id']})[_0x9edf('0x11')](handleEntityNotFound(_0x540b5e,null))[_0x9edf('0x11')](function(_0x4ec875){var _0x4872fb=[];values=_0x4ec875['dataValues'];_0x4872fb[_0x9edf('0x45')](get_open_tabs('chat',_0x4ec875['dataValues']));_0x4872fb[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x4d'),_0x4ec875[_0x9edf('0x4c')]));_0x4872fb['push'](get_open_tabs(_0x9edf('0x50'),_0x4ec875[_0x9edf('0x4c')]));_0x4872fb[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x5b'),_0x4ec875[_0x9edf('0x4c')]));_0x4872fb[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x4e'),_0x4ec875['dataValues']));_0x4872fb[_0x9edf('0x45')](get_open_tabs(_0x9edf('0x4f'),_0x4ec875[_0x9edf('0x4c')]));return BPromise[_0x9edf('0x51')](_0x4872fb);})['then'](function(_0x5a190e){if(_0x5a190e){var _0x122f1a=_[_0x9edf('0x2e')](values[_0x9edf('0xb8')],function(_0x137eca){return{'channel':_0x9edf('0xb9'),'id':_0x137eca['id'],'createdAt':_0x137eca[_0x9edf('0xba')]};});var _0x1cdd43=_[_0x9edf('0x2e')](values['FaxOpenTabs'],function(_0x46701e){return{'channel':_0x9edf('0xbb'),'id':_0x46701e['id'],'createdAt':_0x46701e['createdAt']};});var _0x2efeab=_[_0x9edf('0x2e')](values['OpenchannelOpenTabs'],function(_0x124ba5){return{'channel':'OPENCHANNEL','id':_0x124ba5['id'],'createdAt':_0x124ba5[_0x9edf('0xba')]};});var _0x2b0c35=_['map'](values[_0x9edf('0xbc')],function(_0x26f79f){return{'channel':'MAIL','id':_0x26f79f['id'],'createdAt':_0x26f79f[_0x9edf('0xba')]};});var _0x129a5d=_[_0x9edf('0x2e')](values['SmsOpenTabs'],function(_0x578d41){return{'channel':'SMS','id':_0x578d41['id'],'createdAt':_0x578d41[_0x9edf('0xba')]};});var _0x302274=_['map'](values[_0x9edf('0xbd')],function(_0x30da0c){return{'channel':'WHATSAPP','id':_0x30da0c['id'],'createdAt':_0x30da0c[_0x9edf('0xba')]};});var _0x220d05=_['concat'](_0x122f1a,_0x1cdd43,_0x2efeab,_0x2b0c35,_0x129a5d,_0x302274);var _0x44d252={'count':_0x220d05['length'],'rows':_0x220d05};return _0x44d252;}else return null;})[_0x9edf('0x11')](respondWithResult(_0x540b5e,null))[_0x9edf('0x52')](handleError(_0x540b5e,null));};exports[_0x9edf('0xbe')]=function(_0x29b6e8,_0x16415a){var _0x5489b7={};var _0x4d6bed={};var _0x4220e4;var _0xe617f4;return db[_0x9edf('0x3e')]['findOne']({'where':{'id':_0x29b6e8[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x16415a,null))[_0x9edf('0x11')](function(_0x498a1d){if(_0x498a1d){_0x4220e4=_0x498a1d;_0x4d6bed[_0x9edf('0x55')]=_[_0x9edf('0x57')](db[_0x9edf('0xbf')][_0x9edf('0x38')]);_0x4d6bed[_0x9edf('0x3f')]=_['keys'](_0x29b6e8[_0x9edf('0x3f')]);_0x4d6bed[_0x9edf('0xc0')]=_['intersection'](_0x4d6bed['model'],_0x4d6bed[_0x9edf('0x3f')]);_0x5489b7[_0x9edf('0x44')]=_[_0x9edf('0x58')](_0x4d6bed['model'],qs[_0x9edf('0x59')](_0x29b6e8[_0x9edf('0x3f')][_0x9edf('0x59')]));_0x5489b7['attributes']=_0x5489b7[_0x9edf('0x44')][_0x9edf('0x4a')]?_0x5489b7[_0x9edf('0x44')]:_0x4d6bed[_0x9edf('0x55')];_0x5489b7[_0x9edf('0xc1')]=qs[_0x9edf('0xc2')](_0x29b6e8['query'][_0x9edf('0xc2')]);_0x5489b7[_0x9edf('0x3d')]=qs[_0x9edf('0xc0')](_[_0x9edf('0xc3')](_0x29b6e8[_0x9edf('0x3f')],_0x4d6bed[_0x9edf('0xc0')]));if(_0x29b6e8['query'][_0x9edf('0x2d')]){_0x5489b7[_0x9edf('0x3d')]=_[_0x9edf('0x5a')](_0x5489b7['where'],{'$or':_['map'](_0x5489b7[_0x9edf('0x44')],function(_0xba1c1a){var _0x38c539={};_0x38c539[_0xba1c1a]={'$like':'%'+_0x29b6e8['query'][_0x9edf('0x2d')]+'%'};return _0x38c539;})});}_0x5489b7=_['merge']({},_0x5489b7,_0x29b6e8[_0x9edf('0xc4')]);return _0x4220e4['getContacts'](_0x5489b7);}})[_0x9edf('0x11')](function(_0x99d543){if(_0x99d543){_0xe617f4=_0x99d543[_0x9edf('0x4a')];if(_0x29b6e8[_0x9edf('0x3f')][_0x9edf('0xc5')](_0x9edf('0x40'))){_0x5489b7[_0x9edf('0x41')]=[{'model':db[_0x9edf('0xc6')],'as':_0x9edf('0xc7'),'required':![]},{'model':db[_0x9edf('0xc8')],'as':_0x9edf('0xc9'),'attributes':['id',_0x9edf('0x36'),_0x9edf('0xca')],'where':_0x29b6e8[_0x9edf('0x3f')][_0x9edf('0xcb')]?{'id':_0x29b6e8['query'][_0x9edf('0xcb')]}:undefined,'required':_0x29b6e8[_0x9edf('0x3f')][_0x9edf('0xcb')]?!![]:![]}];}if(!_0x29b6e8[_0x9edf('0x3f')][_0x9edf('0xc5')](_0x9edf('0xcc'))){_0x5489b7[_0x9edf('0x20')]=qs[_0x9edf('0x20')](_0x29b6e8[_0x9edf('0x3f')][_0x9edf('0x20')]);_0x5489b7[_0x9edf('0x1e')]=qs['offset'](_0x29b6e8[_0x9edf('0x3f')]['offset']);}return _0x4220e4['getContacts'](_0x5489b7);}})[_0x9edf('0x11')](function(_0x59c53d){if(_0x59c53d){return _0x59c53d?{'count':_0xe617f4,'rows':_0x59c53d}:null;}})[_0x9edf('0x11')](respondWithResult(_0x16415a,null))[_0x9edf('0x52')](handleError(_0x16415a,null));};exports[_0x9edf('0xcd')]=function(_0x4eec8b,_0x45c13a){var _0x14cac3;var _0x4adb55={};var _0x1d8177;return db[_0x9edf('0x3e')][_0x9edf('0x91')]({'where':{'id':_0x4eec8b[_0x9edf('0x54')]['id']},'attributes':['id',_0x9edf('0x36'),_0x9edf('0x31')]})[_0x9edf('0x11')](handleEntityNotFound(_0x45c13a,null))['then'](function(_0x1a4534){if(!utils[_0x9edf('0x9a')](_0x4eec8b['query'][_0x9edf('0x97')])){throw new db['Sequelize'][(_0x9edf('0x8c'))]('Unknown\x20channel');}_0x14cac3=_0x1a4534;var _0x2ed646={};_0x2ed646[_0x9edf('0x55')]=_[_0x9edf('0x57')](db[_[_0x9edf('0x9c')](_0x4eec8b['query'][_0x9edf('0x97')])+_0x9edf('0xce')][_0x9edf('0x38')]);_0x2ed646[_0x9edf('0x3f')]=_['keys'](_0x4eec8b[_0x9edf('0x3f')]);_0x2ed646['filters']=_['intersection'](_0x2ed646[_0x9edf('0x55')],_0x2ed646['query']);_0x4adb55['attributes']=_[_0x9edf('0x58')](_0x2ed646[_0x9edf('0x55')],qs[_0x9edf('0x59')](_0x4eec8b['query'][_0x9edf('0x59')]));_0x4adb55['attributes']=_0x4adb55[_0x9edf('0x44')][_0x9edf('0x4a')]?_0x4adb55[_0x9edf('0x44')]:_0x2ed646[_0x9edf('0x55')];_0x4adb55[_0x9edf('0xc1')]=qs['sort'](_0x4eec8b[_0x9edf('0x3f')][_0x9edf('0xc2')]);_0x4adb55[_0x9edf('0x3d')]=qs[_0x9edf('0xc0')](_[_0x9edf('0xc3')](_0x4eec8b[_0x9edf('0x3f')],_0x2ed646[_0x9edf('0xc0')]));if(_0x4eec8b[_0x9edf('0x3f')][_0x9edf('0x2d')]){_0x4adb55[_0x9edf('0x3d')]=_['merge'](_0x4adb55[_0x9edf('0x3d')],{'$or':_[_0x9edf('0x2e')](_0x4adb55[_0x9edf('0x44')],function(_0x3d5403){var _0x3d38bd={};_0x3d38bd[_0x3d5403]={'$like':'%'+_0x4eec8b[_0x9edf('0x3f')]['filter']+'%'};return _0x3d38bd;})});}_0x4adb55=_['merge']({},_0x4adb55,_0x4eec8b[_0x9edf('0xc4')]);switch(_0x14cac3[_0x9edf('0x31')]){case _0x9edf('0x26'):return db[_[_0x9edf('0x9c')](_0x4eec8b[_0x9edf('0x3f')][_0x9edf('0x97')])+_0x9edf('0xce')]['findAll'](_0x4adb55);case _0x9edf('0x28'):case _0x9edf('0x2a'):return _0x14cac3[_0x9edf('0xa5')+_[_0x9edf('0x9c')](_0x4eec8b[_0x9edf('0x3f')][_0x9edf('0x97')])+'Queues'](_0x4adb55);default:throw new db[(_0x9edf('0x90'))][(_0x9edf('0x8c'))]('Unknown\x20role');}})[_0x9edf('0x11')](function(_0x1f4d58){_0x1d8177=_0x1f4d58[_0x9edf('0x4a')];if(!_0x4eec8b['query']['hasOwnProperty'](_0x9edf('0xcc'))){_0x4adb55['limit']=qs[_0x9edf('0x20')](_0x4eec8b[_0x9edf('0x3f')][_0x9edf('0x20')]);_0x4adb55[_0x9edf('0x1e')]=qs[_0x9edf('0x1e')](_0x4eec8b['query']['offset']);}switch(_0x14cac3[_0x9edf('0x31')]){case _0x9edf('0x26'):return db[_[_0x9edf('0x9c')](_0x4eec8b[_0x9edf('0x3f')][_0x9edf('0x97')])+_0x9edf('0xce')][_0x9edf('0x46')](_0x4adb55);case _0x9edf('0x28'):case _0x9edf('0x2a'):return _0x14cac3[_0x9edf('0xa5')+_[_0x9edf('0x9c')](_0x4eec8b['query'][_0x9edf('0x97')])+_0x9edf('0x9e')](_0x4adb55);}})[_0x9edf('0x11')](function(_0x2a5d0b){return{'count':_0x1d8177,'rows':_0x2a5d0b};})[_0x9edf('0x11')](respondWithResult(_0x45c13a,null))[_0x9edf('0x52')](handleError(_0x45c13a,null));};exports[_0x9edf('0xcf')]=function(_0x44505f,_0x5991a6){var _0x6409e7={};var _0x943e51={};var _0x11521a;var _0x253d36;return db[_0x9edf('0x3e')][_0x9edf('0x91')]({'where':{'id':_0x44505f[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x5991a6,null))[_0x9edf('0x11')](function(_0x32d218){if(_0x32d218){_0x11521a=_0x32d218;_0x943e51[_0x9edf('0x55')]=_[_0x9edf('0x57')](db[_0x9edf('0xa9')][_0x9edf('0x38')]);_0x943e51[_0x9edf('0x3f')]=_[_0x9edf('0x57')](_0x44505f[_0x9edf('0x3f')]);_0x943e51[_0x9edf('0xc0')]=_[_0x9edf('0x58')](_0x943e51[_0x9edf('0x55')],_0x943e51[_0x9edf('0x3f')]);_0x6409e7['attributes']=_[_0x9edf('0x58')](_0x943e51[_0x9edf('0x55')],qs[_0x9edf('0x59')](_0x44505f[_0x9edf('0x3f')][_0x9edf('0x59')]));_0x6409e7['attributes']=_0x6409e7[_0x9edf('0x44')]['length']?_0x6409e7[_0x9edf('0x44')]:_0x943e51[_0x9edf('0x55')];_0x6409e7[_0x9edf('0xc1')]=qs[_0x9edf('0xc2')](_0x44505f[_0x9edf('0x3f')][_0x9edf('0xc2')]);_0x6409e7[_0x9edf('0x3d')]=qs[_0x9edf('0xc0')](_[_0x9edf('0xc3')](_0x44505f[_0x9edf('0x3f')],_0x943e51['filters']));if(_0x44505f[_0x9edf('0x3f')][_0x9edf('0x2d')]){_0x6409e7[_0x9edf('0x3d')]=_['merge'](_0x6409e7[_0x9edf('0x3d')],{'$or':_[_0x9edf('0x2e')](_0x6409e7[_0x9edf('0x44')],function(_0x1516f2){var _0x1ab40b={};_0x1ab40b[_0x1516f2]={'$like':'%'+_0x44505f[_0x9edf('0x3f')][_0x9edf('0x2d')]+'%'};return _0x1ab40b;})});}_0x6409e7=_[_0x9edf('0x5a')]({},_0x6409e7,_0x44505f[_0x9edf('0xc4')]);return _0x11521a[_0x9edf('0xcf')](_0x6409e7);}})[_0x9edf('0x11')](function(_0x4f476f){if(_0x4f476f){_0x253d36=_0x4f476f[_0x9edf('0x4a')];if(!_0x44505f[_0x9edf('0x3f')]['hasOwnProperty'](_0x9edf('0xcc'))){_0x6409e7['limit']=qs['limit'](_0x44505f['query'][_0x9edf('0x20')]);_0x6409e7['offset']=qs['offset'](_0x44505f[_0x9edf('0x3f')][_0x9edf('0x1e')]);}return _0x11521a[_0x9edf('0xcf')](_0x6409e7);}})[_0x9edf('0x11')](function(_0x5c5f9c){if(_0x5c5f9c){return _0x5c5f9c?{'count':_0x253d36,'rows':_0x5c5f9c}:null;}})['then'](respondWithResult(_0x5991a6,null))[_0x9edf('0x52')](handleError(_0x5991a6,null));};exports['getGroups']=function(_0x3d3f30,_0x6c689d){var _0x2a5141={};var _0x39f29e={};var _0x42051a;var _0x7be770;return db['User'][_0x9edf('0x91')]({'where':{'id':_0x3d3f30[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x6c689d,null))[_0x9edf('0x11')](function(_0x2a2fd2){if(_0x2a2fd2){_0x42051a=_0x2a2fd2;_0x39f29e[_0x9edf('0x55')]=_['keys'](db['ChatGroup'][_0x9edf('0x38')]);_0x39f29e[_0x9edf('0x3f')]=_[_0x9edf('0x57')](_0x3d3f30[_0x9edf('0x3f')]);_0x39f29e[_0x9edf('0xc0')]=_[_0x9edf('0x58')](_0x39f29e[_0x9edf('0x55')],_0x39f29e[_0x9edf('0x3f')]);_0x2a5141[_0x9edf('0x44')]=_[_0x9edf('0x58')](_0x39f29e[_0x9edf('0x55')],qs[_0x9edf('0x59')](_0x3d3f30[_0x9edf('0x3f')]['fields']));_0x2a5141['attributes']=_0x2a5141[_0x9edf('0x44')]['length']?_0x2a5141[_0x9edf('0x44')]:_0x39f29e[_0x9edf('0x55')];_0x2a5141[_0x9edf('0xc1')]=qs['sort'](_0x3d3f30['query']['sort']);_0x2a5141['where']=qs['filters'](_[_0x9edf('0xc3')](_0x3d3f30['query'],_0x39f29e[_0x9edf('0xc0')]));if(_0x3d3f30[_0x9edf('0x3f')][_0x9edf('0x2d')]){_0x2a5141[_0x9edf('0x3d')]=_['merge'](_0x2a5141['where'],{'$or':_[_0x9edf('0x2e')](_0x2a5141[_0x9edf('0x44')],function(_0x2f15b7){var _0x5a5d8f={};_0x5a5d8f[_0x2f15b7]={'$like':'%'+_0x3d3f30['query'][_0x9edf('0x2d')]+'%'};return _0x5a5d8f;})});}_0x2a5141=_['merge']({},_0x2a5141,_0x3d3f30[_0x9edf('0xc4')]);return _0x42051a[_0x9edf('0xd0')](_0x2a5141);}})[_0x9edf('0x11')](function(_0x594b85){if(_0x594b85){_0x7be770=_0x594b85[_0x9edf('0x4a')];if(!_0x3d3f30[_0x9edf('0x3f')][_0x9edf('0xc5')](_0x9edf('0xcc'))){_0x2a5141[_0x9edf('0x20')]=qs['limit'](_0x3d3f30[_0x9edf('0x3f')][_0x9edf('0x20')]);_0x2a5141['offset']=qs[_0x9edf('0x1e')](_0x3d3f30[_0x9edf('0x3f')]['offset']);}return _0x42051a[_0x9edf('0xd0')](_0x2a5141);}})[_0x9edf('0x11')](function(_0x1fe95a){if(_0x1fe95a){return _0x1fe95a?{'count':_0x7be770,'rows':_0x1fe95a}:null;}})['then'](respondWithResult(_0x6c689d,null))[_0x9edf('0x52')](handleError(_0x6c689d,null));};exports['getRecordings']=function(_0x14def,_0x40c031){var _0x189de9={'raw':!![],'where':{}};var _0x3d87d8={};var _0x317630={'count':0x0,'rows':[]};return db['User'][_0x9edf('0x91')]({'where':{'id':_0x14def[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x40c031,null))[_0x9edf('0x11')](function(_0x2d5913){if(_0x2d5913){_0x3d87d8[_0x9edf('0x55')]=_['keys'](db[_0x9edf('0xd1')][_0x9edf('0x38')]);_0x3d87d8[_0x9edf('0x3f')]=_[_0x9edf('0x57')](_0x14def[_0x9edf('0x3f')]);_0x3d87d8['filters']=_[_0x9edf('0x58')](_0x3d87d8['model'],_0x3d87d8[_0x9edf('0x3f')]);_0x189de9[_0x9edf('0x44')]=_[_0x9edf('0x58')](_0x3d87d8[_0x9edf('0x55')],qs[_0x9edf('0x59')](_0x14def[_0x9edf('0x3f')][_0x9edf('0x59')]));_0x189de9['attributes']=_0x189de9[_0x9edf('0x44')][_0x9edf('0x4a')]?_0x189de9[_0x9edf('0x44')]:_0x3d87d8[_0x9edf('0x55')];if(!_0x14def[_0x9edf('0x3f')][_0x9edf('0xc5')]('nolimit')){_0x189de9['limit']=qs[_0x9edf('0x20')](_0x14def['query']['limit']);_0x189de9[_0x9edf('0x1e')]=qs[_0x9edf('0x1e')](_0x14def['query'][_0x9edf('0x1e')]);}_0x189de9[_0x9edf('0xc1')]=qs[_0x9edf('0xc2')](_0x14def[_0x9edf('0x3f')][_0x9edf('0xc2')]);_0x189de9[_0x9edf('0x3d')]=qs[_0x9edf('0xc0')](_[_0x9edf('0xc3')](_0x14def[_0x9edf('0x3f')],_0x3d87d8[_0x9edf('0xc0')]));_0x189de9[_0x9edf('0x3d')][_0x9edf('0xd2')]=_0x2d5913['id'];if(_0x14def['query'][_0x9edf('0x2d')]){_0x189de9[_0x9edf('0x3d')]=_[_0x9edf('0x5a')](_0x189de9[_0x9edf('0x3d')],{'$or':_[_0x9edf('0x2e')](_0x189de9['attributes'],function(_0x150473){var _0x535eac={};_0x535eac[_0x150473]={'$like':'%'+_0x14def['query'][_0x9edf('0x2d')]+'%'};return _0x535eac;})});}_0x189de9=_[_0x9edf('0x5a')]({},_0x189de9,_0x14def[_0x9edf('0xc4')]);return db[_0x9edf('0xd1')]['count']({'where':_0x189de9[_0x9edf('0x3d')]})[_0x9edf('0x11')](function(_0xad00fe){_0x317630[_0x9edf('0x21')]=_0xad00fe;if(_0x14def[_0x9edf('0x3f')][_0x9edf('0x40')]){_0x189de9[_0x9edf('0x41')]=[{'all':!![]}];}return db[_0x9edf('0xd1')]['findAll'](_0x189de9);})['then'](function(_0x2fa853){_0x317630[_0x9edf('0x49')]=_0x2fa853;return _0x317630;});}})[_0x9edf('0x11')](respondWithFilteredResult(_0x40c031,_0x189de9))[_0x9edf('0x52')](handleError(_0x40c031,null));};exports['getScreenRecordings']=function(_0x5800ce,_0x527b60){var _0x30b878={'raw':!![],'where':{}};var _0x34384b={};var _0x574b45={'count':0x0,'rows':[]};return db[_0x9edf('0x3e')]['findOne']({'where':{'id':_0x5800ce['params']['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x527b60,null))['then'](function(_0x15ce30){if(_0x15ce30){_0x34384b[_0x9edf('0x55')]=_['keys'](db[_0x9edf('0xd3')][_0x9edf('0x38')]);_0x34384b[_0x9edf('0x3f')]=_[_0x9edf('0x57')](_0x5800ce[_0x9edf('0x3f')]);_0x34384b[_0x9edf('0xc0')]=_[_0x9edf('0x58')](_0x34384b['model'],_0x34384b[_0x9edf('0x3f')]);_0x30b878[_0x9edf('0x44')]=_['intersection'](_0x34384b[_0x9edf('0x55')],qs[_0x9edf('0x59')](_0x5800ce['query'][_0x9edf('0x59')]));_0x30b878[_0x9edf('0x44')]=_0x30b878[_0x9edf('0x44')]['length']?_0x30b878[_0x9edf('0x44')]:_0x34384b[_0x9edf('0x55')];if(!_0x5800ce['query']['hasOwnProperty'](_0x9edf('0xcc'))){_0x30b878[_0x9edf('0x20')]=qs['limit'](_0x5800ce[_0x9edf('0x3f')]['limit']);_0x30b878['offset']=qs[_0x9edf('0x1e')](_0x5800ce[_0x9edf('0x3f')][_0x9edf('0x1e')]);}_0x30b878[_0x9edf('0xc1')]=qs[_0x9edf('0xc2')](_0x5800ce[_0x9edf('0x3f')][_0x9edf('0xc2')]);_0x30b878[_0x9edf('0x3d')]=qs['filters'](_[_0x9edf('0xc3')](_0x5800ce[_0x9edf('0x3f')],_0x34384b['filters']));_0x30b878[_0x9edf('0x3d')][_0x9edf('0xd2')]=_0x15ce30['id'];if(_0x5800ce[_0x9edf('0x3f')][_0x9edf('0x2d')]){_0x30b878['where']=_[_0x9edf('0x5a')](_0x30b878['where'],{'$or':_['map'](_0x30b878[_0x9edf('0x44')],function(_0x5be5ff){var _0x396b0a={};_0x396b0a[_0x5be5ff]={'$like':'%'+_0x5800ce[_0x9edf('0x3f')][_0x9edf('0x2d')]+'%'};return _0x396b0a;})});}_0x30b878=_[_0x9edf('0x5a')]({},_0x30b878,_0x5800ce[_0x9edf('0xc4')]);return db[_0x9edf('0xd3')][_0x9edf('0x21')]({'where':_0x30b878[_0x9edf('0x3d')]})['then'](function(_0x4d55b7){_0x574b45['count']=_0x4d55b7;if(_0x5800ce[_0x9edf('0x3f')][_0x9edf('0x40')]){_0x30b878['include']=[{'all':!![]}];}return db[_0x9edf('0xd3')][_0x9edf('0x46')](_0x30b878);})[_0x9edf('0x11')](function(_0x2c7b9b){_0x574b45[_0x9edf('0x49')]=_0x2c7b9b;return _0x574b45;});}})['then'](respondWithFilteredResult(_0x527b60,_0x30b878))['catch'](handleError(_0x527b60,null));};exports[_0x9edf('0xd4')]=function(_0x1a4ee7,_0x4de302){var _0x581cef={};var _0x91101a={};var _0xb59ba0;var _0xe1e6c4;return db['User'][_0x9edf('0x91')]({'where':{'id':_0x1a4ee7['params']['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x4de302,null))[_0x9edf('0x11')](function(_0x306b88){if(_0x306b88){_0xb59ba0=_0x306b88;_0x91101a[_0x9edf('0x55')]=_[_0x9edf('0x57')](db['ChatInteraction']['rawAttributes']);_0x91101a[_0x9edf('0x3f')]=_[_0x9edf('0x57')](_0x1a4ee7[_0x9edf('0x3f')]);_0x91101a[_0x9edf('0xc0')]=_[_0x9edf('0x58')](_0x91101a[_0x9edf('0x55')],_0x91101a[_0x9edf('0x3f')]);_0x581cef[_0x9edf('0x44')]=_['intersection'](_0x91101a[_0x9edf('0x55')],qs[_0x9edf('0x59')](_0x1a4ee7['query'][_0x9edf('0x59')]));_0x581cef[_0x9edf('0x44')]=_0x581cef['attributes'][_0x9edf('0x4a')]?_0x581cef[_0x9edf('0x44')]:_0x91101a['model'];_0x581cef['order']=qs[_0x9edf('0xc2')](_0x1a4ee7['query'][_0x9edf('0xc2')]);_0x581cef['where']=qs['filters'](_[_0x9edf('0xc3')](_0x1a4ee7[_0x9edf('0x3f')],_0x91101a[_0x9edf('0xc0')]));if(_0x1a4ee7[_0x9edf('0x3f')][_0x9edf('0x2d')]){_0x581cef[_0x9edf('0x3d')]=_[_0x9edf('0x5a')](_0x581cef[_0x9edf('0x3d')],{'$or':_['map'](_0x581cef[_0x9edf('0x44')],function(_0x414113){var _0x4880af={};_0x4880af[_0x414113]={'$like':'%'+_0x1a4ee7[_0x9edf('0x3f')][_0x9edf('0x2d')]+'%'};return _0x4880af;})});}_0x581cef=_[_0x9edf('0x5a')]({},_0x581cef,_0x1a4ee7[_0x9edf('0xc4')]);return _0xb59ba0[_0x9edf('0xd4')](_0x581cef);}})[_0x9edf('0x11')](function(_0x15ebd4){if(_0x15ebd4){_0xe1e6c4=_0x15ebd4[_0x9edf('0x4a')];if(!_0x1a4ee7[_0x9edf('0x3f')][_0x9edf('0xc5')](_0x9edf('0xcc'))){_0x581cef[_0x9edf('0x20')]=qs['limit'](_0x1a4ee7[_0x9edf('0x3f')][_0x9edf('0x20')]);_0x581cef[_0x9edf('0x1e')]=qs['offset'](_0x1a4ee7[_0x9edf('0x3f')][_0x9edf('0x1e')]);}return _0xb59ba0[_0x9edf('0xd4')](_0x581cef);}})[_0x9edf('0x11')](function(_0x51bc4d){if(_0x51bc4d){return _0x51bc4d?{'count':_0xe1e6c4,'rows':_0x51bc4d}:null;}})[_0x9edf('0x11')](respondWithResult(_0x4de302,null))[_0x9edf('0x52')](handleError(_0x4de302,null));};exports['getOpenchannelInteractions']=function(_0x52d0c1,_0x1f3689){var _0x2c9f68={};var _0x19df01={};var _0x1896a7;var _0x5f173b;return db[_0x9edf('0x3e')][_0x9edf('0x91')]({'where':{'id':_0x52d0c1['params']['id']}})['then'](handleEntityNotFound(_0x1f3689,null))[_0x9edf('0x11')](function(_0x2eaf25){if(_0x2eaf25){_0x1896a7=_0x2eaf25;_0x19df01[_0x9edf('0x55')]=_[_0x9edf('0x57')](db[_0x9edf('0xd5')][_0x9edf('0x38')]);_0x19df01[_0x9edf('0x3f')]=_[_0x9edf('0x57')](_0x52d0c1['query']);_0x19df01[_0x9edf('0xc0')]=_[_0x9edf('0x58')](_0x19df01['model'],_0x19df01[_0x9edf('0x3f')]);_0x2c9f68['attributes']=_['intersection'](_0x19df01['model'],qs[_0x9edf('0x59')](_0x52d0c1[_0x9edf('0x3f')][_0x9edf('0x59')]));_0x2c9f68[_0x9edf('0x44')]=_0x2c9f68[_0x9edf('0x44')][_0x9edf('0x4a')]?_0x2c9f68[_0x9edf('0x44')]:_0x19df01[_0x9edf('0x55')];_0x2c9f68[_0x9edf('0xc1')]=qs[_0x9edf('0xc2')](_0x52d0c1[_0x9edf('0x3f')][_0x9edf('0xc2')]);_0x2c9f68[_0x9edf('0x3d')]=qs[_0x9edf('0xc0')](_[_0x9edf('0xc3')](_0x52d0c1[_0x9edf('0x3f')],_0x19df01[_0x9edf('0xc0')]));if(_0x52d0c1[_0x9edf('0x3f')]['filter']){_0x2c9f68[_0x9edf('0x3d')]=_[_0x9edf('0x5a')](_0x2c9f68[_0x9edf('0x3d')],{'$or':_[_0x9edf('0x2e')](_0x2c9f68['attributes'],function(_0x24a8cf){var _0x536ca3={};_0x536ca3[_0x24a8cf]={'$like':'%'+_0x52d0c1[_0x9edf('0x3f')][_0x9edf('0x2d')]+'%'};return _0x536ca3;})});}_0x2c9f68=_[_0x9edf('0x5a')]({},_0x2c9f68,_0x52d0c1[_0x9edf('0xc4')]);return _0x1896a7['getOpenchannelInteractions'](_0x2c9f68);}})[_0x9edf('0x11')](function(_0xf4db7f){if(_0xf4db7f){_0x5f173b=_0xf4db7f['length'];if(!_0x52d0c1['query'][_0x9edf('0xc5')](_0x9edf('0xcc'))){_0x2c9f68[_0x9edf('0x20')]=qs[_0x9edf('0x20')](_0x52d0c1[_0x9edf('0x3f')][_0x9edf('0x20')]);_0x2c9f68[_0x9edf('0x1e')]=qs['offset'](_0x52d0c1[_0x9edf('0x3f')]['offset']);}return _0x1896a7['getOpenchannelInteractions'](_0x2c9f68);}})[_0x9edf('0x11')](function(_0x5f2e2e){if(_0x5f2e2e){return _0x5f2e2e?{'count':_0x5f173b,'rows':_0x5f2e2e}:null;}})[_0x9edf('0x11')](respondWithResult(_0x1f3689,null))[_0x9edf('0x52')](handleError(_0x1f3689,null));};exports['getMailInteractions']=function(_0x50c5dd,_0x34faf7){var _0x5e379c={'raw':!![],'where':{}};var _0x319a94={};var _0x53a9b3={'count':0x0,'rows':[]};return db[_0x9edf('0x3e')][_0x9edf('0x91')]({'where':{'id':_0x50c5dd['params']['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x34faf7,null))[_0x9edf('0x11')](function(_0x4ecc9f){if(_0x4ecc9f){_0x319a94['model']=_[_0x9edf('0x57')](db['MailInteraction']['rawAttributes']);_0x319a94[_0x9edf('0x3f')]=_['keys'](_0x50c5dd[_0x9edf('0x3f')]);_0x319a94[_0x9edf('0xc0')]=_['intersection'](_0x319a94[_0x9edf('0x55')],_0x319a94[_0x9edf('0x3f')]);_0x5e379c[_0x9edf('0x44')]=_['intersection'](_0x319a94[_0x9edf('0x55')],qs['fields'](_0x50c5dd[_0x9edf('0x3f')]['fields']));_0x5e379c['attributes']=_0x5e379c[_0x9edf('0x44')][_0x9edf('0x4a')]?_0x5e379c[_0x9edf('0x44')]:_0x319a94['model'];if(!_0x50c5dd[_0x9edf('0x3f')][_0x9edf('0xc5')](_0x9edf('0xcc'))){_0x5e379c[_0x9edf('0x20')]=qs['limit'](_0x50c5dd[_0x9edf('0x3f')][_0x9edf('0x20')]);_0x5e379c['offset']=qs['offset'](_0x50c5dd[_0x9edf('0x3f')][_0x9edf('0x1e')]);}_0x5e379c['order']=qs[_0x9edf('0xc2')](_0x50c5dd[_0x9edf('0x3f')][_0x9edf('0xc2')]);_0x5e379c[_0x9edf('0x3d')]=qs[_0x9edf('0xc0')](_['pick'](_0x50c5dd[_0x9edf('0x3f')],_0x319a94[_0x9edf('0xc0')]));_0x5e379c[_0x9edf('0x3d')][_0x9edf('0xd2')]=_0x4ecc9f['id'];if(_0x50c5dd[_0x9edf('0x3f')][_0x9edf('0x2d')]){_0x5e379c[_0x9edf('0x3d')]=_[_0x9edf('0x5a')](_0x5e379c[_0x9edf('0x3d')],{'$or':_['map'](_0x5e379c['attributes'],function(_0x231dc8){var _0xcecaa1={};_0xcecaa1[_0x231dc8]={'$like':'%'+_0x50c5dd[_0x9edf('0x3f')][_0x9edf('0x2d')]+'%'};return _0xcecaa1;})});}_0x5e379c=_['merge']({},_0x5e379c,_0x50c5dd['options']);return db['MailInteraction'][_0x9edf('0x21')]({'where':_0x5e379c[_0x9edf('0x3d')]})['then'](function(_0x496cb7){_0x53a9b3[_0x9edf('0x21')]=_0x496cb7;if(_0x50c5dd['query'][_0x9edf('0x40')]){_0x5e379c['include']=[{'all':!![]}];}return db[_0x9edf('0xd6')][_0x9edf('0x46')](_0x5e379c);})['then'](function(_0x482b09){_0x53a9b3[_0x9edf('0x49')]=_0x482b09;return _0x53a9b3;});}})['then'](respondWithFilteredResult(_0x34faf7,_0x5e379c))['catch'](handleError(_0x34faf7,null));};exports['getSmsInteractions']=function(_0x590eb7,_0x2f84a5){var _0x552c58={};var _0x251e01={};var _0x2434b7;var _0xa1c4ba;return db[_0x9edf('0x3e')][_0x9edf('0x91')]({'where':{'id':_0x590eb7[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x2f84a5,null))[_0x9edf('0x11')](function(_0x44e706){if(_0x44e706){_0x2434b7=_0x44e706;_0x251e01[_0x9edf('0x55')]=_[_0x9edf('0x57')](db[_0x9edf('0xd7')][_0x9edf('0x38')]);_0x251e01['query']=_[_0x9edf('0x57')](_0x590eb7['query']);_0x251e01[_0x9edf('0xc0')]=_[_0x9edf('0x58')](_0x251e01[_0x9edf('0x55')],_0x251e01[_0x9edf('0x3f')]);_0x552c58['attributes']=_[_0x9edf('0x58')](_0x251e01[_0x9edf('0x55')],qs[_0x9edf('0x59')](_0x590eb7[_0x9edf('0x3f')]['fields']));_0x552c58[_0x9edf('0x44')]=_0x552c58['attributes'][_0x9edf('0x4a')]?_0x552c58[_0x9edf('0x44')]:_0x251e01[_0x9edf('0x55')];_0x552c58['order']=qs['sort'](_0x590eb7[_0x9edf('0x3f')][_0x9edf('0xc2')]);_0x552c58[_0x9edf('0x3d')]=qs['filters'](_['pick'](_0x590eb7[_0x9edf('0x3f')],_0x251e01[_0x9edf('0xc0')]));if(_0x590eb7[_0x9edf('0x3f')]['filter']){_0x552c58[_0x9edf('0x3d')]=_[_0x9edf('0x5a')](_0x552c58['where'],{'$or':_['map'](_0x552c58[_0x9edf('0x44')],function(_0x477923){var _0x505ba2={};_0x505ba2[_0x477923]={'$like':'%'+_0x590eb7[_0x9edf('0x3f')]['filter']+'%'};return _0x505ba2;})});}_0x552c58=_[_0x9edf('0x5a')]({},_0x552c58,_0x590eb7['options']);return _0x2434b7[_0x9edf('0xd8')](_0x552c58);}})[_0x9edf('0x11')](function(_0x16e77c){if(_0x16e77c){_0xa1c4ba=_0x16e77c['length'];if(!_0x590eb7[_0x9edf('0x3f')][_0x9edf('0xc5')]('nolimit')){_0x552c58['limit']=qs[_0x9edf('0x20')](_0x590eb7[_0x9edf('0x3f')][_0x9edf('0x20')]);_0x552c58['offset']=qs[_0x9edf('0x1e')](_0x590eb7[_0x9edf('0x3f')][_0x9edf('0x1e')]);}return _0x2434b7['getSmsInteractions'](_0x552c58);}})[_0x9edf('0x11')](function(_0x469a3e){if(_0x469a3e){return _0x469a3e?{'count':_0xa1c4ba,'rows':_0x469a3e}:null;}})[_0x9edf('0x11')](respondWithResult(_0x2f84a5,null))[_0x9edf('0x52')](handleError(_0x2f84a5,null));};exports[_0x9edf('0xd9')]=function(_0x7d00e1,_0x5cb417){var _0x128c91={};var _0x1fcc99={};var _0x121bae;var _0x50c89e;return db['User'][_0x9edf('0x91')]({'where':{'id':_0x7d00e1[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x5cb417,null))[_0x9edf('0x11')](function(_0x29b1f4){if(_0x29b1f4){_0x121bae=_0x29b1f4;_0x1fcc99['model']=_[_0x9edf('0x57')](db[_0x9edf('0xda')][_0x9edf('0x38')]);_0x1fcc99[_0x9edf('0x3f')]=_['keys'](_0x7d00e1[_0x9edf('0x3f')]);_0x1fcc99[_0x9edf('0xc0')]=_[_0x9edf('0x58')](_0x1fcc99[_0x9edf('0x55')],_0x1fcc99[_0x9edf('0x3f')]);_0x128c91[_0x9edf('0x44')]=_[_0x9edf('0x58')](_0x1fcc99[_0x9edf('0x55')],qs[_0x9edf('0x59')](_0x7d00e1[_0x9edf('0x3f')][_0x9edf('0x59')]));_0x128c91[_0x9edf('0x44')]=_0x128c91[_0x9edf('0x44')]['length']?_0x128c91[_0x9edf('0x44')]:_0x1fcc99[_0x9edf('0x55')];_0x128c91[_0x9edf('0xc1')]=qs[_0x9edf('0xc2')](_0x7d00e1[_0x9edf('0x3f')][_0x9edf('0xc2')]);_0x128c91[_0x9edf('0x3d')]=qs['filters'](_[_0x9edf('0xc3')](_0x7d00e1['query'],_0x1fcc99[_0x9edf('0xc0')]));if(_0x7d00e1[_0x9edf('0x3f')][_0x9edf('0x2d')]){_0x128c91['where']=_[_0x9edf('0x5a')](_0x128c91[_0x9edf('0x3d')],{'$or':_[_0x9edf('0x2e')](_0x128c91[_0x9edf('0x44')],function(_0x4b8ad4){var _0x21c08e={};_0x21c08e[_0x4b8ad4]={'$like':'%'+_0x7d00e1['query'][_0x9edf('0x2d')]+'%'};return _0x21c08e;})});}_0x128c91=_[_0x9edf('0x5a')]({},_0x128c91,_0x7d00e1[_0x9edf('0xc4')]);return _0x121bae[_0x9edf('0xd9')](_0x128c91);}})[_0x9edf('0x11')](function(_0x1ab2e2){if(_0x1ab2e2){_0x50c89e=_0x1ab2e2['length'];if(!_0x7d00e1['query'][_0x9edf('0xc5')](_0x9edf('0xcc'))){_0x128c91[_0x9edf('0x20')]=qs[_0x9edf('0x20')](_0x7d00e1[_0x9edf('0x3f')]['limit']);_0x128c91['offset']=qs[_0x9edf('0x1e')](_0x7d00e1[_0x9edf('0x3f')][_0x9edf('0x1e')]);}return _0x121bae['getFaxInteractions'](_0x128c91);}})['then'](function(_0x13969d){if(_0x13969d){return _0x13969d?{'count':_0x50c89e,'rows':_0x13969d}:null;}})[_0x9edf('0x11')](respondWithResult(_0x5cb417,null))[_0x9edf('0x52')](handleError(_0x5cb417,null));};exports[_0x9edf('0xdb')]=function(_0x2d9fb4,_0x21a0b7){var _0x1176f2={};var _0x28e0bd={};var _0x1084b3;var _0x41af43;return db[_0x9edf('0x3e')][_0x9edf('0x91')]({'where':{'id':_0x2d9fb4[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x21a0b7,null))[_0x9edf('0x11')](function(_0x2cde88){if(_0x2cde88){_0x1084b3=_0x2cde88;_0x28e0bd[_0x9edf('0x55')]=_[_0x9edf('0x57')](db['WhatsappInteraction']['rawAttributes']);_0x28e0bd[_0x9edf('0x3f')]=_[_0x9edf('0x57')](_0x2d9fb4[_0x9edf('0x3f')]);_0x28e0bd[_0x9edf('0xc0')]=_[_0x9edf('0x58')](_0x28e0bd[_0x9edf('0x55')],_0x28e0bd[_0x9edf('0x3f')]);_0x1176f2['attributes']=_['intersection'](_0x28e0bd[_0x9edf('0x55')],qs['fields'](_0x2d9fb4[_0x9edf('0x3f')][_0x9edf('0x59')]));_0x1176f2[_0x9edf('0x44')]=_0x1176f2[_0x9edf('0x44')]['length']?_0x1176f2['attributes']:_0x28e0bd['model'];_0x1176f2['order']=qs['sort'](_0x2d9fb4[_0x9edf('0x3f')][_0x9edf('0xc2')]);_0x1176f2[_0x9edf('0x3d')]=qs[_0x9edf('0xc0')](_[_0x9edf('0xc3')](_0x2d9fb4[_0x9edf('0x3f')],_0x28e0bd[_0x9edf('0xc0')]));if(_0x2d9fb4[_0x9edf('0x3f')][_0x9edf('0x2d')]){_0x1176f2['where']=_['merge'](_0x1176f2[_0x9edf('0x3d')],{'$or':_[_0x9edf('0x2e')](_0x1176f2[_0x9edf('0x44')],function(_0x46fee8){var _0x5d18bb={};_0x5d18bb[_0x46fee8]={'$like':'%'+_0x2d9fb4[_0x9edf('0x3f')][_0x9edf('0x2d')]+'%'};return _0x5d18bb;})});}_0x1176f2=_[_0x9edf('0x5a')]({},_0x1176f2,_0x2d9fb4['options']);return _0x1084b3[_0x9edf('0xdb')](_0x1176f2);}})[_0x9edf('0x11')](function(_0x2c6468){if(_0x2c6468){_0x41af43=_0x2c6468[_0x9edf('0x4a')];if(!_0x2d9fb4[_0x9edf('0x3f')]['hasOwnProperty'](_0x9edf('0xcc'))){_0x1176f2[_0x9edf('0x20')]=qs['limit'](_0x2d9fb4[_0x9edf('0x3f')][_0x9edf('0x20')]);_0x1176f2['offset']=qs[_0x9edf('0x1e')](_0x2d9fb4[_0x9edf('0x3f')][_0x9edf('0x1e')]);}return _0x1084b3[_0x9edf('0xdb')](_0x1176f2);}})[_0x9edf('0x11')](function(_0x5ef47d){if(_0x5ef47d){return _0x5ef47d?{'count':_0x41af43,'rows':_0x5ef47d}:null;}})['then'](respondWithResult(_0x21a0b7,null))['catch'](handleError(_0x21a0b7,null));};exports[_0x9edf('0xdc')]=function(_0x2212d1,_0x142bfe,_0x8e94e6){var _0x5c8a09;var _0x3fe22d;var _0x388231;var _0x6a5887=!_['isNil'](_0x2212d1[_0x9edf('0x54')]['id'])?_0x2212d1['params']['id']:!_['isNil'](_0x2212d1['user']['id'])?_0x2212d1[_0x9edf('0x28')]['id']:null;return db['User'][_0x9edf('0x32')]({'where':{'id':_0x6a5887,'role':{'$or':[_0x9edf('0x26'),_0x9edf('0x28'),'agent']}},'attributes':['id',_0x9edf('0x36'),_0x9edf('0xdd'),_0x9edf('0xde'),_0x9edf('0x31'),_0x9edf('0x61'),'loginInPause']})[_0x9edf('0x11')](function(_0x4ae4f1){if(_0x4ae4f1){if(_0x4ae4f1[_0x9edf('0x31')]===_0x9edf('0x2a')){_0x5c8a09=_0x4ae4f1;if(_0x2212d1[_0x9edf('0x5c')][_0x9edf('0xa6')]){_0x388231=util['format'](_0x9edf('0xdf'),_0x5c8a09[_0x2212d1[_0x9edf('0x5c')]['interface']]);}else if(_0x2212d1['body'][_0x9edf('0xe0')]){_0x388231=util[_0x9edf('0xa7')](_0x9edf('0xa8'),_0x2212d1['body'][_0x9edf('0xe0')]);}else{_0x388231=util[_0x9edf('0xa7')](_0x9edf('0xa8'),_0x5c8a09['name']);}socket['to'](util[_0x9edf('0xa7')](_0x9edf('0xe1'),_0x5c8a09['name']))[_0x9edf('0xae')](_0x9edf('0xe2'),{'user':{'id':_0x5c8a09['id'],'name':_0x5c8a09[_0x9edf('0x36')]},'ip':_0x2212d1[_0x9edf('0xe3')]['x-forwarded-for']||_0x2212d1[_0x9edf('0xe4')][_0x9edf('0xe5')]||_0x2212d1['socket'][_0x9edf('0xe5')]||_0x2212d1[_0x9edf('0xe4')][_0x9edf('0xe6')][_0x9edf('0xe5')]});return db[_0x9edf('0xa9')][_0x9edf('0x25')]({'where':{'membername':_0x5c8a09[_0x9edf('0x36')]},'individualHooks':!![]});}}else{throw new db[(_0x9edf('0x90'))][(_0x9edf('0x8c'))](_0x9edf('0xe7'));}})[_0x9edf('0x11')](function(){if(_0x5c8a09){return _0x5c8a09[_0x9edf('0xe8')]({'raw':!![]});}})['then'](function(_0x342dd3){if(_0x5c8a09){var _0x1da3a0=[];if(_0x342dd3){_0x3fe22d=_0x342dd3;if(_0x3fe22d[_0x9edf('0x4a')]){for(var _0x19d48f=0x0;_0x19d48f<_0x3fe22d[_0x9edf('0x4a')];_0x19d48f++){_0x1da3a0[_0x9edf('0x45')]({'membername':_0x5c8a09[_0x9edf('0x36')],'UserId':_0x5c8a09['id'],'queue_name':_0x3fe22d[_0x19d48f][_0x9edf('0x36')],'VoiceQueueId':_0x3fe22d[_0x19d48f]['id'],'interface':_0x388231,'paused':_0x5c8a09['loginInPause']||![],'penalty':_0x3fe22d[_0x19d48f]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x1da3a0,function(_0x526a0a){return db[_0x9edf('0xa9')]['upsert'](_0x526a0a);});}}}})[_0x9edf('0x11')](function(){if(_0x5c8a09){return db[_0x9edf('0xe9')]['findAll']({'where':{'membername':_0x5c8a09[_0x9edf('0x36')],'exitAt':null}});}})['then'](function(_0x109702){if(_0x5c8a09){var _0x5c4377=[];_0x109702[_0x9edf('0xea')](function(_0x4afadc){_0x5c4377['push'](_0x4afadc[_0x9edf('0x24')]({'exitAt':moment()[_0x9edf('0xa7')](_0x9edf('0xeb'))}));});return BPromise[_0x9edf('0x51')](_0x5c4377);}})[_0x9edf('0x11')](function(){if(_0x5c8a09){var _0x2d8421=[];var _0x221097=[];var _0x45c1be=utils[_0x9edf('0xec')]();var _0x118978={'membername':_0x5c8a09['name'],'interface':_0x388231,'enterAt':moment()[_0x9edf('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x5c8a09[_0x9edf('0x31')],'internal':_0x5c8a09[_0x9edf('0x61')]};_0x45c1be[_0x9edf('0xea')](function(_0x2d9027){_0x2d8421[_0x9edf('0x45')](_[_0x9edf('0x5a')]({'channel':_0x2d9027,'type':_0x9edf('0xed'),'data1':_0x2212d1[_0x9edf('0x5c')][_0x9edf('0xee')],'data2':_0x388231},_0x118978));if(_0x5c8a09[_0x9edf('0xef')]){_0x221097[_0x9edf('0x45')](_['merge']({'channel':_0x2d9027,'type':'PAUSE','data1':_0x9edf('0xf0')},_0x118978));}});return db[_0x9edf('0xe9')][_0x9edf('0xf1')](_0x2d8421['concat'](_0x221097),{'individualHooks':!![]});}})['then'](function(){if(_0x5c8a09){return _0x5c8a09[_0x9edf('0x24')]({'online':!![],'lastLoginAt':moment()[_0x9edf('0xa7')](_0x9edf('0xeb')),'voicePause':_0x5c8a09['loginInPause']||![],'mailPause':_0x5c8a09[_0x9edf('0xef')]||![],'chatPause':_0x5c8a09[_0x9edf('0xef')]||![],'faxPause':_0x5c8a09[_0x9edf('0xef')]||![],'smsPause':_0x5c8a09[_0x9edf('0xef')]||![],'openchannelPause':_0x5c8a09[_0x9edf('0xef')]||![],'whatsappPause':_0x5c8a09[_0x9edf('0xef')]||![],'pauseType':_0x5c8a09['loginInPause']?_0x9edf('0xf0'):null,'interface':_0x388231,'lastPauseAt':moment()['format'](_0x9edf('0xeb'))});}})[_0x9edf('0x11')](function(_0x540a1f){if(_0x2212d1[_0x9edf('0xf2')]){return _0x8e94e6();}else{return BPromise[_0x9edf('0xf3')](_0x540a1f)[_0x9edf('0x11')](respondWithResult(_0x142bfe,null));}})[_0x9edf('0x52')](handleError(_0x142bfe,null));};exports[_0x9edf('0xf4')]=function(_0x1b07de,_0x1efdcf){var _0xc48b4;return db[_0x9edf('0x3e')][_0x9edf('0x32')]({'where':{'id':_0x1b07de[_0x9edf('0x54')]['id'],'role':_0x9edf('0x2a')},'attributes':['id',_0x9edf('0x36'),_0x9edf('0x31')]})[_0x9edf('0x11')](handleEntityNotFound(_0x1efdcf,null))['then'](function(_0xd4af90){if(_0xd4af90){_0xc48b4=_0xd4af90;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0xc48b4[_0x9edf('0x36')]},'individualHooks':!![]});}})[_0x9edf('0x11')](function(){return db[_0x9edf('0xe9')][_0x9edf('0x46')]({'where':{'membername':_0xc48b4[_0x9edf('0x36')],'exitAt':null}});})[_0x9edf('0x11')](function(_0x1683e2){var _0x14ab99=[];_0x1683e2[_0x9edf('0xea')](function(_0x4aa6b5){_0x14ab99[_0x9edf('0x45')](_0x4aa6b5['update']({'exitAt':moment()[_0x9edf('0xa7')](_0x9edf('0xeb'))}));});return BPromise[_0x9edf('0x51')](_0x14ab99);})[_0x9edf('0x11')](function(){return _0xc48b4[_0x9edf('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x9edf('0x11')](respondWithResult(_0x1efdcf,null))[_0x9edf('0x52')](handleError(_0x1efdcf,null));};exports['pause']=function(_0x250b4c,_0x1ea81a){var _0x7e9dfc;return db[_0x9edf('0xa9')][_0x9edf('0x24')]({'paused':0x1},{'where':{'UserId':_0x250b4c[_0x9edf('0x54')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x9edf('0x3e')][_0x9edf('0x32')]({'where':{'id':_0x250b4c[_0x9edf('0x54')]['id'],'role':'agent'},'attributes':['id',_0x9edf('0x36'),_0x9edf('0x31'),_0x9edf('0x61'),'interface']});})['then'](handleEntityNotFound(_0x1ea81a,null))['then'](function(_0x5cb0a8){if(_0x5cb0a8){_0x7e9dfc=_0x5cb0a8;return respondWithRpcPromise('QueuePause',_0x9edf('0xf5'),{'id':_0x7e9dfc['id'],'name':_0x7e9dfc['name'],'pause':!![]});}})[_0x9edf('0x11')](function(){if(_0x7e9dfc){return db[_0x9edf('0xe9')]['findAll']({'where':{'membername':_0x7e9dfc[_0x9edf('0x36')],'type':_0x9edf('0xf6'),'exitAt':null}});}})[_0x9edf('0x11')](function(_0x104a0e){if(_0x104a0e[_0x9edf('0x4a')]){var _0x95709d=moment()[_0x9edf('0xa7')](_0x9edf('0xeb'));for(var _0x54b201=0x0,_0x668ea8=_0x104a0e[_0x9edf('0x4a')];_0x54b201<_0x668ea8;_0x54b201++){_0x104a0e[_0x54b201][_0x9edf('0xf7')]({'exitAt':_0x95709d});}}})[_0x9edf('0x11')](function(){var _0x245453=[];var _0x454541=utils[_0x9edf('0xec')]();_0x454541['forEach'](function(_0x4eb1f7){_0x245453['push']({'channel':_0x4eb1f7,'membername':_0x7e9dfc['name'],'interface':_[_0x9edf('0x66')](_0x7e9dfc[_0x9edf('0xa6')])?util[_0x9edf('0xa7')](_0x9edf('0xa8'),_0x7e9dfc['name']):_0x7e9dfc[_0x9edf('0xa6')],'type':_0x9edf('0xf6'),'enterAt':moment()[_0x9edf('0xa7')](_0x9edf('0xeb')),'data1':_0x250b4c[_0x9edf('0x5c')][_0x9edf('0xf8')]||_0x9edf('0xf9'),'role':_0x7e9dfc[_0x9edf('0x31')],'internal':_0x7e9dfc['internal']});});return db[_0x9edf('0xe9')]['bulkCreate'](_0x245453,{'individualHooks':!![]});})[_0x9edf('0x11')](function(){return _0x7e9dfc[_0x9edf('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x250b4c[_0x9edf('0x5c')]['type']||_0x9edf('0xf9'),'lastPauseAt':moment()[_0x9edf('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x9edf('0x11')](respondWithResult(_0x1ea81a,null))[_0x9edf('0x52')](handleError(_0x1ea81a,null));};exports[_0x9edf('0xfa')]=function(_0x176a01,_0xd45bcc){var _0x3965da;return db[_0x9edf('0x3e')][_0x9edf('0x32')]({'where':{'id':_0x176a01[_0x9edf('0x54')]['id']},'attributes':['id','name','role',_0x9edf('0x99'),_0x9edf('0xfb'),_0x9edf('0xfc'),_0x9edf('0xfd'),_0x9edf('0xfe'),_0x9edf('0xff'),_0x9edf('0x100'),_0x9edf('0x101'),_0x9edf('0x102')]})[_0x9edf('0x11')](handleEntityNotFound(_0xd45bcc,null))[_0x9edf('0x11')](function(_0x5637a9){if(_0x5637a9){_0x3965da=_0x5637a9;if(_0x176a01['body']['channel']&&!utils[_0x9edf('0x9a')](_0x176a01['body'][_0x9edf('0x97')])){throw new db['Sequelize'][(_0x9edf('0x8c'))]('Unknown\x20channel');}switch(_0x176a01[_0x9edf('0x5c')][_0x9edf('0x97')]){case _0x9edf('0xa3'):return respondWithRpcPromise('QueuePause','unpause',{'id':_0x3965da['id'],'name':_0x3965da[_0x9edf('0x36')],'pause':![]})[_0x9edf('0x11')](function(){return db[_0x9edf('0xa9')]['update']({'paused':0x0},{'where':{'UserId':_0x3965da['id']},'individualHooks':!![]});})[_0x9edf('0x11')](function(){return db[_0x9edf('0xe9')][_0x9edf('0x32')]({'where':{'channel':_0x176a01[_0x9edf('0x5c')]['channel'],'membername':_0x3965da[_0x9edf('0x36')],'type':_0x9edf('0xf6'),'exitAt':null}});})[_0x9edf('0x11')](function(_0x16bcac){if(_0x16bcac){return _0x16bcac[_0x9edf('0x24')]({'exitAt':moment()['format'](_0x9edf('0xeb')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x3965da[_0x9edf('0x24')]({'voicePause':![]});});case _0x9edf('0x4f'):case _0x9edf('0x4b'):case _0x9edf('0x4e'):case'sms':case _0x9edf('0x5b'):case _0x9edf('0x50'):return db[_0x9edf('0xe9')][_0x9edf('0x32')]({'where':{'channel':_0x176a01['body'][_0x9edf('0x97')],'membername':_0x3965da['name'],'type':_0x9edf('0xf6'),'exitAt':null}})[_0x9edf('0x11')](function(_0x1c4c2f){if(_0x1c4c2f){return _0x1c4c2f[_0x9edf('0x24')]({'exitAt':moment()[_0x9edf('0xa7')](_0x9edf('0xeb')),'data2':_0x9edf('0x103')},{'individualHooks':!![]});}return null;})[_0x9edf('0x11')](function(){var _0x250a1a={};_[_0x9edf('0x22')](_0x250a1a,util[_0x9edf('0xa7')](_0x9edf('0x104'),_0x176a01[_0x9edf('0x5c')][_0x9edf('0x97')],_0x9edf('0x105')),![]);return _0x3965da[_0x9edf('0x24')](_0x250a1a);});default:return respondWithRpcPromise(_0x9edf('0x106'),_0x9edf('0xfa'),{'id':_0x3965da['id'],'name':_0x3965da[_0x9edf('0x36')],'pause':![]})[_0x9edf('0x11')](function(){return db[_0x9edf('0xa9')][_0x9edf('0x24')]({'paused':0x0},{'where':{'UserId':_0x3965da['id']}});})[_0x9edf('0x11')](function(){return db[_0x9edf('0xe9')]['findAll']({'where':{'membername':_0x3965da[_0x9edf('0x36')],'type':_0x9edf('0xf6'),'exitAt':null}});})[_0x9edf('0x11')](function(_0x188a94){var _0x1c11e1=[];_0x188a94[_0x9edf('0xea')](function(_0x3fc4bd){_0x1c11e1['push'](_0x3fc4bd['update']({'exitAt':moment()[_0x9edf('0xa7')](_0x9edf('0xeb')),'data2':'manual'}));});return BPromise[_0x9edf('0x51')](_0x1c11e1);})['then'](function(){return _0x3965da[_0x9edf('0x24')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x9edf('0x11')](respondWithResult(_0xd45bcc,null))[_0x9edf('0x52')](handleError(_0xd45bcc,null));};exports[_0x9edf('0x107')]=function(_0x90b777,_0x20403b){var _0x5ec9ea={};var _0x3754bc={};var _0x34f5d1;var _0x503416;return db[_0x9edf('0x3e')]['findOne']({'where':{'id':_0x90b777[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x20403b,null))[_0x9edf('0x11')](function(_0x36473c){if(_0x36473c){_0x34f5d1=_0x36473c;_0x3754bc[_0x9edf('0x55')]=_[_0x9edf('0x57')](db[_0x9edf('0x108')]['rawAttributes']);_0x3754bc[_0x9edf('0x3f')]=_[_0x9edf('0x57')](_0x90b777[_0x9edf('0x3f')]);_0x3754bc['filters']=_[_0x9edf('0x58')](_0x3754bc[_0x9edf('0x55')],_0x3754bc[_0x9edf('0x3f')]);_0x5ec9ea[_0x9edf('0x44')]=_[_0x9edf('0x58')](_0x3754bc[_0x9edf('0x55')],qs[_0x9edf('0x59')](_0x90b777[_0x9edf('0x3f')]['fields']));_0x5ec9ea['attributes']=_0x5ec9ea[_0x9edf('0x44')][_0x9edf('0x4a')]?_0x5ec9ea[_0x9edf('0x44')]:_0x3754bc[_0x9edf('0x55')];_0x5ec9ea['order']=qs['sort'](_0x90b777[_0x9edf('0x3f')][_0x9edf('0xc2')]);_0x5ec9ea[_0x9edf('0x3d')]=qs[_0x9edf('0xc0')](_[_0x9edf('0xc3')](_0x90b777[_0x9edf('0x3f')],_0x3754bc[_0x9edf('0xc0')]));if(_0x90b777['query'][_0x9edf('0x2d')]){_0x5ec9ea[_0x9edf('0x3d')]=_[_0x9edf('0x5a')](_0x5ec9ea[_0x9edf('0x3d')],{'$or':_[_0x9edf('0x2e')](_0x5ec9ea['attributes'],function(_0x1eba0a){var _0xc00ab={};_0xc00ab[_0x1eba0a]={'$like':'%'+_0x90b777[_0x9edf('0x3f')][_0x9edf('0x2d')]+'%'};return _0xc00ab;})});}_0x5ec9ea=_[_0x9edf('0x5a')]({},_0x5ec9ea,_0x90b777[_0x9edf('0xc4')]);return _0x34f5d1['getTeams'](_0x5ec9ea);}})['then'](function(_0x3b2458){if(_0x3b2458){_0x503416=_0x3b2458[_0x9edf('0x4a')];if(!_0x90b777[_0x9edf('0x3f')][_0x9edf('0xc5')](_0x9edf('0xcc'))){_0x5ec9ea[_0x9edf('0x20')]=qs[_0x9edf('0x20')](_0x90b777['query'][_0x9edf('0x20')]);_0x5ec9ea[_0x9edf('0x1e')]=qs[_0x9edf('0x1e')](_0x90b777['query'][_0x9edf('0x1e')]);}return _0x34f5d1['getTeams'](_0x5ec9ea);}})[_0x9edf('0x11')](function(_0x1120ff){if(_0x1120ff){return _0x1120ff?{'count':_0x503416,'rows':_0x1120ff}:null;}})['then'](respondWithResult(_0x20403b,null))[_0x9edf('0x52')](handleError(_0x20403b,null));};exports[_0x9edf('0x109')]=function(_0x2f5b29,_0x3cb7db){return db[_0x9edf('0x3e')][_0x9edf('0x32')]({'where':{'id':_0x2f5b29[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x3cb7db,null))[_0x9edf('0x11')](function(_0xb1e7c2){if(_0xb1e7c2){var _0x487ffb=_0xb1e7c2[_0x9edf('0xa5')]({'plain':!![]});return _0xb1e7c2[_0x9edf('0x109')](_0x2f5b29[_0x9edf('0x5c')][_0x9edf('0x5f')],_[_0x9edf('0x60')](_0x2f5b29['body'],[_0x9edf('0x5f'),'id'])||{})['then'](function(){for(var _0x51b1f6=0x0;_0x51b1f6<_0x2f5b29[_0x9edf('0x5c')]['ids'][_0x9edf('0x4a')];_0x51b1f6++){var _0x264a48=[];var _0x37165e={};db[_0x9edf('0x108')]['findOne']({'where':{'id':_0x2f5b29['body'][_0x9edf('0x5f')][_0x51b1f6]}})[_0x9edf('0x11')](function(_0x1c5ac0){_0x37165e=_0x1c5ac0['dataValues'];_0x264a48[_0x9edf('0x45')](_0x1c5ac0[_0x9edf('0xe8')]()[_0x9edf('0x11')](function(_0x51e82b){for(var _0x4eb980=0x0;_0x4eb980<_0x51e82b[_0x9edf('0x4a')];_0x4eb980++){_0x51e82b[_0x4eb980][_0x9edf('0x10a')](_0x9edf('0x97'),'Voice');}return _0x51e82b;}));_0x264a48[_0x9edf('0x45')](_0x1c5ac0[_0x9edf('0x10b')]()[_0x9edf('0x11')](function(_0x58d312){for(var _0x47d9f9=0x0;_0x47d9f9<_0x58d312[_0x9edf('0x4a')];_0x47d9f9++){_0x58d312[_0x47d9f9]['setDataValue'](_0x9edf('0x97'),'Chat');}return _0x58d312;}));_0x264a48['push'](_0x1c5ac0['getMailQueues']()[_0x9edf('0x11')](function(_0x282f10){for(var _0x37c8a5=0x0;_0x37c8a5<_0x282f10[_0x9edf('0x4a')];_0x37c8a5++){_0x282f10[_0x37c8a5][_0x9edf('0x10a')](_0x9edf('0x97'),_0x9edf('0x10c'));}return _0x282f10;}));_0x264a48[_0x9edf('0x45')](_0x1c5ac0[_0x9edf('0x10d')]()[_0x9edf('0x11')](function(_0x17812f){for(var _0x545ef7=0x0;_0x545ef7<_0x17812f[_0x9edf('0x4a')];_0x545ef7++){_0x17812f[_0x545ef7][_0x9edf('0x10a')](_0x9edf('0x97'),_0x9edf('0x10e'));}return _0x17812f;}));_0x264a48[_0x9edf('0x45')](_0x1c5ac0[_0x9edf('0x10f')]()['then'](function(_0x299bd7){for(var _0x10740f=0x0;_0x10740f<_0x299bd7[_0x9edf('0x4a')];_0x10740f++){_0x299bd7[_0x10740f]['setDataValue'](_0x9edf('0x97'),_0x9edf('0x110'));}return _0x299bd7;}));_0x264a48['push'](_0x1c5ac0[_0x9edf('0x111')]()[_0x9edf('0x11')](function(_0x2e5b76){for(var _0x4df25e=0x0;_0x4df25e<_0x2e5b76[_0x9edf('0x4a')];_0x4df25e++){_0x2e5b76[_0x4df25e]['setDataValue'](_0x9edf('0x97'),_0x9edf('0x112'));}return _0x2e5b76;}));_0x264a48[_0x9edf('0x45')](_0x1c5ac0[_0x9edf('0x113')]()[_0x9edf('0x11')](function(_0x19e5da){for(var _0x47275c=0x0;_0x47275c<_0x19e5da[_0x9edf('0x4a')];_0x47275c++){_0x19e5da[_0x47275c]['setDataValue'](_0x9edf('0x97'),_0x9edf('0x114'));}return _0x19e5da;}));return BPromise[_0x9edf('0x51')](_0x264a48);})[_0x9edf('0x11')](function(_0x427a6c){var _0x1587a4=_['flatten'](_0x427a6c);_0x264a48=[];return db[_0x9edf('0x69')][_0x9edf('0x115')](function(_0x3f0962){for(var _0x5e0397=0x0;_0x5e0397<_0x1587a4['length'];_0x5e0397++){_0x264a48[_0x9edf('0x45')](_0x1587a4[_0x5e0397][_0x9edf('0x116')](_0x487ffb['id']),{'transaction':_0x3f0962});}return BPromise[_0x9edf('0x51')](_0x264a48)[_0x9edf('0x11')](function(){if(_0x487ffb[_0x9edf('0x98')]){return BPromise[_0x9edf('0x87')](_[_0x9edf('0x2d')](_0x1587a4,function(_0x5e8311){return _0x5e8311[_0x9edf('0x117')](_0x9edf('0x97'))===_0x9edf('0x118');}),function(_0x18c0f3){return db[_0x9edf('0xa9')][_0x9edf('0x119')]({'membername':_0x487ffb['name'],'UserId':_0x487ffb['id'],'queue_name':_0x18c0f3['name'],'VoiceQueueId':_0x18c0f3['id'],'interface':_[_0x9edf('0x66')](_0x487ffb['interface'])?util['format'](_0x9edf('0xa8'),_0x487ffb[_0x9edf('0x36')]):_0x487ffb['interface'],'paused':_0x487ffb['voicePause']||![],'penalty':_0x487ffb['penalty']},{'transaction':_0x3f0962});});}else{return;}})['then'](function(){for(var _0x3d4ba2=0x0;_0x3d4ba2<_0x1587a4[_0x9edf('0x4a')];_0x3d4ba2++){var _0x391040=_0x1587a4[_0x3d4ba2][_0x9edf('0x117')](_0x9edf('0x97'));var _0x44d60a=_0x391040+_0x9edf('0xa1');socket[_0x9edf('0xae')](_0x9edf('0x28')+_0x391040+_0x9edf('0xa2'),{'UserId':_0x487ffb['id'],['queueField']:_0x1587a4[_0x3d4ba2]['id']});}});});})[_0x9edf('0x11')](function(){db[_0x9edf('0x11a')][_0x9edf('0x91')]({'where':{'teamId':_0x37165e['id']}})[_0x9edf('0x11')](function(_0x3036ca){if(_0x3036ca){db[_0x9edf('0x11b')]['create']({'UserId':_0x2f5b29[_0x9edf('0x54')]['id'],'VoicePrefixId':_0x3036ca['VoicePrefixId']});}});});}});}})['then'](respondWithStatusCode(_0x3cb7db,null))[_0x9edf('0x52')](handleError(_0x3cb7db,null));};exports['removeTeams']=function(_0x3d21a2,_0x47aef4){return db[_0x9edf('0x3e')][_0x9edf('0x91')]({'where':{'id':_0x3d21a2[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x47aef4,null))[_0x9edf('0x11')](function(_0x4b91ff){if(_0x4b91ff){var _0x4bad5d=_0x4b91ff[_0x9edf('0xa5')]({'plain':!![]});var _0x50b67e=_0x3d21a2['query'][_0x9edf('0x5f')];return _0x4b91ff[_0x9edf('0x11c')](_0x50b67e)[_0x9edf('0x11')](function(){for(var _0x17085b=0x0;_0x17085b<_0x50b67e[_0x9edf('0x4a')];_0x17085b++){var _0x3e2694=[];var _0xbbbeeb={};db[_0x9edf('0x108')][_0x9edf('0x91')]({'where':{'id':_0x50b67e[_0x17085b]}})[_0x9edf('0x11')](function(_0x3c6869){_0xbbbeeb=_0x3c6869['dataValues'];_0x3e2694[_0x9edf('0x45')](_0x3c6869[_0x9edf('0xe8')]()['then'](function(_0x4d7df0){for(var _0x67fddf=0x0;_0x67fddf<_0x4d7df0[_0x9edf('0x4a')];_0x67fddf++){_0x4d7df0[_0x67fddf][_0x9edf('0x10a')]('channel',_0x9edf('0x118'));}return _0x4d7df0;}));_0x3e2694['push'](_0x3c6869['getChatQueues']()[_0x9edf('0x11')](function(_0x382888){for(var _0x420295=0x0;_0x420295<_0x382888[_0x9edf('0x4a')];_0x420295++){_0x382888[_0x420295][_0x9edf('0x10a')](_0x9edf('0x97'),_0x9edf('0x11d'));}return _0x382888;}));_0x3e2694[_0x9edf('0x45')](_0x3c6869[_0x9edf('0x11e')]()[_0x9edf('0x11')](function(_0xd6fde8){for(var _0x52792f=0x0;_0x52792f<_0xd6fde8[_0x9edf('0x4a')];_0x52792f++){_0xd6fde8[_0x52792f][_0x9edf('0x10a')](_0x9edf('0x97'),'Mail');}return _0xd6fde8;}));_0x3e2694[_0x9edf('0x45')](_0x3c6869[_0x9edf('0x10d')]()[_0x9edf('0x11')](function(_0x18129f){for(var _0x18de75=0x0;_0x18de75<_0x18129f['length'];_0x18de75++){_0x18129f[_0x18de75]['setDataValue'](_0x9edf('0x97'),_0x9edf('0x10e'));}return _0x18129f;}));_0x3e2694[_0x9edf('0x45')](_0x3c6869[_0x9edf('0x10f')]()['then'](function(_0x4455fb){for(var _0x284731=0x0;_0x284731<_0x4455fb[_0x9edf('0x4a')];_0x284731++){_0x4455fb[_0x284731][_0x9edf('0x10a')]('channel',_0x9edf('0x110'));}return _0x4455fb;}));_0x3e2694['push'](_0x3c6869[_0x9edf('0x111')]()[_0x9edf('0x11')](function(_0x4a39b0){for(var _0x1caad5=0x0;_0x1caad5<_0x4a39b0[_0x9edf('0x4a')];_0x1caad5++){_0x4a39b0[_0x1caad5][_0x9edf('0x10a')](_0x9edf('0x97'),_0x9edf('0x112'));}return _0x4a39b0;}));_0x3e2694[_0x9edf('0x45')](_0x3c6869[_0x9edf('0x113')]()[_0x9edf('0x11')](function(_0x3f8b8f){for(var _0x56e069=0x0;_0x56e069<_0x3f8b8f[_0x9edf('0x4a')];_0x56e069++){_0x3f8b8f[_0x56e069][_0x9edf('0x10a')](_0x9edf('0x97'),_0x9edf('0x114'));}return _0x3f8b8f;}));return BPromise[_0x9edf('0x51')](_0x3e2694);})['then'](function(_0x3680c2){var _0x50bbd0=_['flatten'](_0x3680c2);_0x3e2694=[];return db['sequelize'][_0x9edf('0x115')](function(_0x4c55b1){for(var _0x4463fb=0x0;_0x4463fb<_0x50bbd0[_0x9edf('0x4a')];_0x4463fb++){_0x3e2694[_0x9edf('0x45')](_0x50bbd0[_0x4463fb][_0x9edf('0x11f')](_0x4bad5d['id']),{'transaction':_0x4c55b1});}return BPromise[_0x9edf('0x51')](_0x3e2694)[_0x9edf('0x11')](function(){if(_0x4bad5d['online']){return BPromise[_0x9edf('0x87')](_['filter'](_0x50bbd0,function(_0x30c198){return _0x30c198[_0x9edf('0x117')](_0x9edf('0x97'))===_0x9edf('0x118');}),function(_0x5b93c3){return db['UserVoiceQueueRt'][_0x9edf('0x25')]({'where':{'VoiceQueueId':_0x5b93c3['id'],'UserId':_0x4bad5d['id']},'transaction':_0x4c55b1});});}else{return;}})['then'](function(){db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0xbbbeeb['id']}})['then'](function(_0x34d30e){if(_0x34d30e){return db[_0x9edf('0x11b')]['destroy']({'where':{'UserId':_0x4bad5d['id'],'VoicePrefixId':_0x34d30e['dataValues'][_0x9edf('0x120')]}});}});})[_0x9edf('0x11')](function(){for(var _0x2ca673=0x0;_0x2ca673<_0x50bbd0[_0x9edf('0x4a')];_0x2ca673++){var _0x2cfbb9=_0x50bbd0[_0x2ca673][_0x9edf('0x117')](_0x9edf('0x97'));var _0x23f053=_0x2cfbb9+_0x9edf('0xa1');socket[_0x9edf('0xae')](_0x9edf('0x28')+_0x2cfbb9+'Queue:remove',{'UserId':_0x4bad5d['id'],['queueField']:_0x50bbd0[_0x2ca673]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x47aef4,null))[_0x9edf('0x52')](handleError(_0x47aef4,null));};exports[_0x9edf('0x121')]=function(_0x4fbd64,_0x1b11ca){var _0x219ba7={};var _0x51131b={};var _0xe47de2;var _0x59a17c;return db[_0x9edf('0x3e')][_0x9edf('0x91')]({'where':{'id':_0x4fbd64[_0x9edf('0x54')]['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x1b11ca,null))[_0x9edf('0x11')](function(_0x3e8006){if(_0x3e8006){_0xe47de2=_0x3e8006;_0x51131b[_0x9edf('0x55')]=_['keys'](db['CmList'][_0x9edf('0x38')]);_0x51131b[_0x9edf('0x3f')]=_['keys'](_0x4fbd64[_0x9edf('0x3f')]);_0x51131b['filters']=_[_0x9edf('0x58')](_0x51131b[_0x9edf('0x55')],_0x51131b[_0x9edf('0x3f')]);_0x219ba7[_0x9edf('0x44')]=_[_0x9edf('0x58')](_0x51131b['model'],qs[_0x9edf('0x59')](_0x4fbd64[_0x9edf('0x3f')][_0x9edf('0x59')]));_0x219ba7[_0x9edf('0x44')]=_0x219ba7['attributes']['length']?_0x219ba7[_0x9edf('0x44')]:_0x51131b[_0x9edf('0x55')];_0x219ba7[_0x9edf('0xc1')]=qs[_0x9edf('0xc2')](_0x4fbd64['query'][_0x9edf('0xc2')]);_0x219ba7[_0x9edf('0x3d')]=qs[_0x9edf('0xc0')](_[_0x9edf('0xc3')](_0x4fbd64[_0x9edf('0x3f')],_0x51131b[_0x9edf('0xc0')]));if(_0x4fbd64['query']['filter']){_0x219ba7[_0x9edf('0x3d')]=_[_0x9edf('0x5a')](_0x219ba7[_0x9edf('0x3d')],{'$or':_['map'](_0x219ba7[_0x9edf('0x44')],function(_0x50eb6a){var _0x4bcd7a={};_0x4bcd7a[_0x50eb6a]={'$like':'%'+_0x4fbd64[_0x9edf('0x3f')][_0x9edf('0x2d')]+'%'};return _0x4bcd7a;})});}_0x219ba7=_[_0x9edf('0x5a')]({},_0x219ba7,_0x4fbd64[_0x9edf('0xc4')]);return _0xe47de2[_0x9edf('0x121')](_0x219ba7);}})[_0x9edf('0x11')](function(_0x3bc7b1){if(_0x3bc7b1){_0x59a17c=_0x3bc7b1[_0x9edf('0x4a')];if(!_0x4fbd64['query']['hasOwnProperty']('nolimit')){_0x219ba7[_0x9edf('0x20')]=qs[_0x9edf('0x20')](_0x4fbd64['query'][_0x9edf('0x20')]);_0x219ba7[_0x9edf('0x1e')]=qs[_0x9edf('0x1e')](_0x4fbd64[_0x9edf('0x3f')][_0x9edf('0x1e')]);}return _0xe47de2[_0x9edf('0x121')](_0x219ba7);}})[_0x9edf('0x11')](function(_0x5e6655){if(_0x5e6655){return _0x5e6655?{'count':_0x59a17c,'rows':_0x5e6655}:null;}})[_0x9edf('0x11')](respondWithResult(_0x1b11ca,null))[_0x9edf('0x52')](handleError(_0x1b11ca,null));};exports[_0x9edf('0x122')]=function(_0x480a21,_0x139d7f){var _0xfebfc0={};var _0x280355={};var _0x54d5d7;return db[_0x9edf('0x3e')][_0x9edf('0x91')]({'where':{'id':_0x480a21['params']['id']}})[_0x9edf('0x11')](handleEntityNotFound(_0x139d7f,null))[_0x9edf('0x11')](function(_0x4261da){if(_0x4261da){_0x54d5d7=_0x4261da;_0x280355[_0x9edf('0x55')]=_[_0x9edf('0x57')](db[_0x9edf('0x3e')][_0x9edf('0x38')]);_0x280355[_0x9edf('0x3f')]=_[_0x9edf('0x57')](_0x480a21[_0x9edf('0x3f')]);_0x280355[_0x9edf('0xc0')]=_[_0x9edf('0x58')](_0x280355[_0x9edf('0x55')],_0x280355[_0x9edf('0x3f')]);_0xfebfc0[_0x9edf('0x44')]=_[_0x9edf('0x58')](_0x280355['model'],qs[_0x9edf('0x59')](_0x480a21[_0x9edf('0x3f')]['fields']));_0xfebfc0[_0x9edf('0x44')]=_0xfebfc0[_0x9edf('0x44')][_0x9edf('0x4a')]?_0xfebfc0[_0x9edf('0x44')]:_0x280355[_0x9edf('0x55')];_0xfebfc0['order']=qs['sort'](_0x480a21[_0x9edf('0x3f')][_0x9edf('0xc2')]);_0xfebfc0['where']=qs[_0x9edf('0xc0')](_[_0x9edf('0xc3')](_0x480a21[_0x9edf('0x3f')],_0x280355[_0x9edf('0xc0')]));if(_0x480a21[_0x9edf('0x3f')][_0x9edf('0x2d')]){_0xfebfc0['where']=_[_0x9edf('0x5a')](_0xfebfc0[_0x9edf('0x3d')],{'$or':_[_0x9edf('0x2e')](_0xfebfc0[_0x9edf('0x44')],function(_0x176827){var _0x3167fc={};_0x3167fc[_0x176827]={'$like':'%'+_0x480a21[_0x9edf('0x3f')]['filter']+'%'};return _0x3167fc;})});}_0xfebfc0['model']=db[_0x9edf('0x3e')];_0xfebfc0['as']=_0x9edf('0x29');_0xfebfc0=_[_0x9edf('0x5a')]({},_0xfebfc0,_0x480a21[_0x9edf('0xc4')]);return _0x54d5d7[_0x9edf('0xe8')]({'include':[_0xfebfc0]});}})[_0x9edf('0x11')](function(_0x263d53){if(_0x263d53){var _0x40ebbc={},_0x44de32=[];for(var _0x21f348=0x0;_0x21f348<_0x263d53[_0x9edf('0x4a')];_0x21f348+=0x1){for(var _0x20b947=0x0,_0x9900db;_0x20b947<_0x263d53[_0x21f348][_0x9edf('0x29')]['length'];_0x20b947+=0x1){_0x9900db=_0x263d53[_0x21f348][_0x9edf('0x29')][_0x20b947]['get']({'plain':!![]});_0x40ebbc[_0x9900db['id']]=_0x9900db;}}_0x40ebbc=_[_0x9edf('0x123')](_0x40ebbc);for(var _0x5e0033=qs['offset'](_0x480a21[_0x9edf('0x3f')][_0x9edf('0x1e')]);_0x5e0033<_0x40ebbc[_0x9edf('0x4a')]&&_0x44de32[_0x9edf('0x4a')]=_0x1b9b3b){_0x112513=_0x1b9b3b;_0x3809e5=0xc8;}else{_0x3809e5=0xce;}_0x1b548f[_0x8742('0x1a')](_0x3809e5);return _0x1b548f[_0x8742('0x20')](_0x8742('0x21'),_0x25e361+'-'+_0x112513+'/'+_0x1b9b3b)['json'](_0x31b288);}return null;};}function saveUpdates(_0x625215){return function(_0x53b523){if(_0x53b523){return _0x53b523[_0x8742('0x22')](_0x625215)[_0x8742('0xf')](function(_0x1a5745){return _0x1a5745;});}return null;};}function removeEntity(_0x42b1cb){return function(_0x4418ba){if(_0x4418ba){return _0x4418ba[_0x8742('0x23')]()[_0x8742('0xf')](function(){var _0x14fded=_0x4418ba[_0x8742('0x24')]({'plain':!![]});if(_0x14fded['role']===_0x8742('0x25'))return;var _0x2474a5=[{'name':_0x8742('0x26'),'value':'user','ignore':!![]},{'name':_0x8742('0x27'),'value':'agent','ignore':![]},{'name':_0x8742('0x28'),'value':_0x8742('0x29'),'ignore':![]}];var _0xbe0f1e=_(_0x2474a5)[_0x8742('0x2a')](_0x8742('0x2b'))['map']('value')[_0x8742('0x2c')]();if(_[_0x8742('0x2d')](_0xbe0f1e,_0x14fded['role'])){return;}var _0x30f9fd=_[_0x8742('0x2e')](_0x2474a5,[_0x8742('0x2c'),_0x14fded[_0x8742('0x2f')]])[_0x8742('0x30')];return db[_0x8742('0x31')]['destroy']({'where':{'type':_0x30f9fd,'resourceId':_0x14fded['id']}})['then'](function(){return _0x4418ba;});})[_0x8742('0xf')](function(){_0x42b1cb[_0x8742('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fdb18){return function(_0x30ec36){if(!_0x30ec36){_0x2fdb18[_0x8742('0x32')](0x194);}return _0x30ec36;};}function handleError(_0x398f93,_0x16a10c){_0x16a10c=_0x16a10c||0x1f4;return function(_0x1d5827){logger[_0x8742('0x13')](_0x1d5827[_0x8742('0x33')]);if(_0x1d5827[_0x8742('0x30')]){delete _0x1d5827['name'];}_0x398f93[_0x8742('0x1a')](_0x16a10c)[_0x8742('0x34')](_0x1d5827);};}exports[_0x8742('0x35')]=function(_0x71f59a,_0x519215){var _0x526c13={},_0x7e49d1={'count':0x0,'rows':[]};var _0x58c357=_(db[_0x8742('0x36')][_0x8742('0x37')])[_0x8742('0x38')](function(_0x2e9821){return{'name':_0x2e9821['fieldName'],'type':_0x2e9821[_0x8742('0x39')][_0x8742('0x3a')]};})['filter'](function(_0x26c30f){return!_[_0x8742('0x2d')](['password','salt'],_0x26c30f[_0x8742('0x30')]);})['value']();_0x526c13=qs['getOptions'](_0x58c357,_0x71f59a);var _0x36c8e0={'where':_0x526c13[_0x8742('0x3b')]};return db[_0x8742('0x36')][_0x8742('0x1f')](_0x36c8e0)['then'](function(_0x5015b5){_0x7e49d1['count']=_0x5015b5;if(_0x71f59a[_0x8742('0x3c')][_0x8742('0x3d')]){_0x526c13[_0x8742('0x3e')]=[{'all':!![]}];}if(_0x71f59a[_0x8742('0x3c')]['userSetting']===_0x8742('0x3f')){_0x526c13[_0x8742('0x3e')]=[{'model':db[_0x8742('0x40')],'as':_0x8742('0x41')}];}if(!_[_0x8742('0x2d')](_0x526c13['attributes'],'id')){_0x526c13[_0x8742('0x42')][_0x8742('0x43')]('id');}return db['User'][_0x8742('0x44')](_0x526c13);})['then'](function(_0x335974){_0x7e49d1[_0x8742('0x45')]=_0x335974;if(_0x71f59a['query'][_0x8742('0x46')]===_0x8742('0x3f')){var _0x494406=[];for(var _0x15e2d7=0x0;_0x15e2d7<_0x7e49d1[_0x8742('0x45')]['length'];_0x15e2d7++){_0x494406[_0x8742('0x43')](get_open_tabs(_0x8742('0x47'),_0x7e49d1[_0x8742('0x45')][_0x15e2d7][_0x8742('0x48')]));_0x494406[_0x8742('0x43')](get_open_tabs('sms',_0x7e49d1[_0x8742('0x45')][_0x15e2d7]['dataValues']));_0x494406[_0x8742('0x43')](get_open_tabs(_0x8742('0x49'),_0x7e49d1[_0x8742('0x45')][_0x15e2d7][_0x8742('0x48')]));_0x494406['push'](get_open_tabs(_0x8742('0x4a'),_0x7e49d1['rows'][_0x15e2d7][_0x8742('0x48')]));_0x494406[_0x8742('0x43')](get_open_tabs('openchannel',_0x7e49d1[_0x8742('0x45')][_0x15e2d7][_0x8742('0x48')]));_0x494406['push'](get_open_tabs(_0x8742('0x4b'),_0x7e49d1[_0x8742('0x45')][_0x15e2d7][_0x8742('0x48')]));}return BPromise[_0x8742('0x4c')](_0x494406)[_0x8742('0xf')](function(){return _0x7e49d1;});}else{return _0x7e49d1;}})[_0x8742('0xf')](respondWithFilteredResult(_0x519215,_0x526c13))['catch'](handleError(_0x519215,null));};exports[_0x8742('0x4d')]=function(_0x202020,_0x5c172b){var _0x653e37={'raw':![],'where':{'id':_0x202020[_0x8742('0x4e')]['id']}},_0x455928={};_0x455928[_0x8742('0x4f')]=_[_0x8742('0x50')](_[_0x8742('0x51')](db[_0x8742('0x36')]['rawAttributes']),[_0x8742('0x52'),'salt']);_0x455928[_0x8742('0x3c')]=_[_0x8742('0x51')](_0x202020[_0x8742('0x3c')]);_0x455928[_0x8742('0x53')]=_['intersection'](_0x455928['model'],_0x455928[_0x8742('0x3c')]);_0x653e37['attributes']=_[_0x8742('0x54')](_0x455928[_0x8742('0x4f')],qs[_0x8742('0x55')](_0x202020['query'][_0x8742('0x55')]));_0x653e37['attributes']=_0x653e37['attributes']['length']?_0x653e37[_0x8742('0x42')]:_0x455928[_0x8742('0x4f')];if(_0x202020['query'][_0x8742('0x3d')]){_0x653e37[_0x8742('0x3e')]=[{'all':!![]}];}if(_0x202020[_0x8742('0x3c')]['userSetting']===_0x8742('0x3f')){_0x653e37[_0x8742('0x3e')]=[{'model':db[_0x8742('0x40')],'as':'userSetting'}];}_0x653e37=_[_0x8742('0x56')]({},_0x653e37,_0x202020['options']);if(!_[_0x8742('0x2d')](_0x653e37['attributes'],'id')){_0x653e37[_0x8742('0x42')]['push']('id');}return db[_0x8742('0x36')]['find'](_0x653e37)[_0x8742('0xf')](handleEntityNotFound(_0x5c172b,null))[_0x8742('0xf')](function(_0x2a4663){var _0x54a117=[];values=_0x2a4663;if(_0x202020[_0x8742('0x3c')][_0x8742('0x46')]===_0x8742('0x3f')){_0x54a117[_0x8742('0x43')](get_open_tabs(_0x8742('0x47'),_0x2a4663[_0x8742('0x48')]));_0x54a117[_0x8742('0x43')](get_open_tabs(_0x8742('0x57'),_0x2a4663[_0x8742('0x48')]));_0x54a117[_0x8742('0x43')](get_open_tabs(_0x8742('0x58'),_0x2a4663[_0x8742('0x48')]));_0x54a117[_0x8742('0x43')](get_open_tabs(_0x8742('0x4b'),_0x2a4663[_0x8742('0x48')]));_0x54a117[_0x8742('0x43')](get_open_tabs(_0x8742('0x49'),_0x2a4663[_0x8742('0x48')]));_0x54a117[_0x8742('0x43')](get_open_tabs(_0x8742('0x4a'),_0x2a4663[_0x8742('0x48')]));return BPromise[_0x8742('0x4c')](_0x54a117);}else{return values;}})[_0x8742('0xf')](function(){return values;})[_0x8742('0xf')](respondWithResult(_0x5c172b,null))[_0x8742('0x19')](handleError(_0x5c172b,null));};exports[_0x8742('0x22')]=function(_0x2eab74,_0x4fac61){if(_0x2eab74[_0x8742('0x59')]['id']){delete _0x2eab74[_0x8742('0x59')]['id'];}delete _0x2eab74[_0x8742('0x59')][_0x8742('0x2f')];return db[_0x8742('0x36')][_0x8742('0x2e')]({'where':{'id':_0x2eab74[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x4fac61,null))[_0x8742('0xf')](saveUpdates(_0x2eab74[_0x8742('0x59')],null))[_0x8742('0xf')](respondWithResult(_0x4fac61,null))[_0x8742('0x19')](handleError(_0x4fac61,null));};exports[_0x8742('0x5a')]=function(_0x3595a8,_0x4b2e32){return db[_0x8742('0x36')]['describe']()[_0x8742('0xf')](respondWithResult(_0x4b2e32,null))[_0x8742('0x19')](handleError(_0x4b2e32,null));};exports['addContacts']=function(_0x198550,_0x491d6a){return db[_0x8742('0x36')][_0x8742('0x2e')]({'where':{'id':_0x198550[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x491d6a,null))[_0x8742('0xf')](function(_0x3f13da){if(_0x3f13da){return _0x3f13da[_0x8742('0x5b')](_0x198550[_0x8742('0x59')][_0x8742('0x5c')],_['omit'](_0x198550[_0x8742('0x59')],[_0x8742('0x5c'),'id'])||{});}})[_0x8742('0xf')](respondWithResult(_0x491d6a,null))[_0x8742('0x19')](handleError(_0x491d6a,null));};function validateUser(_0xf34b7a){return new BPromise(function(_0x59dd73,_0xb1bdbd){if(_0xf34b7a[_0x8742('0x5d')])return _0x59dd73(_0xf34b7a);return db['Setting']['findById'](0x1)[_0x8742('0xf')](function(_0x5657fe){if(_0x5657fe[_0x8742('0x5e')])authService[_0x8742('0x5f')](_0xf34b7a[_0x8742('0x52')]);db['User'][_0x8742('0x60')](_0x8742('0x5d'))['then'](function(_0x5662a3){if(_[_0x8742('0x61')](_0x5662a3)){_0xf34b7a['internal']=_0x5657fe['min_internal']||0x1;return;}if(_[_0x8742('0x61')](_0x5657fe['min_internal'])||_0x5657fe[_0x8742('0x62')]===_0x5662a3){_0xf34b7a[_0x8742('0x5d')]=_0x5662a3+0x1;return;}if(_0x5657fe[_0x8742('0x62')]>_0x5662a3){_0xf34b7a[_0x8742('0x5d')]=_0x5657fe[_0x8742('0x62')];return;}return db[_0x8742('0x63')][_0x8742('0x3c')](_0x8742('0x64'),{'type':db[_0x8742('0x63')][_0x8742('0x65')][_0x8742('0x66')]})[_0x8742('0xf')](function(_0x21f8e8){if(_0x21f8e8&&_0x21f8e8[_0x8742('0x67')]){for(var _0x376f25=0x0,_0x3db2d4=_0x21f8e8[_0x8742('0x67')];_0x376f25<_0x3db2d4&&_['isNil'](_0xf34b7a[_0x8742('0x5d')]);_0x376f25++){if(_0x5657fe[_0x8742('0x62')]<=_0x21f8e8[_0x376f25][_0x8742('0x68')]){_0xf34b7a[_0x8742('0x5d')]=_0x21f8e8[_0x376f25]['from'];}else if(_0x5657fe[_0x8742('0x62')]>_0x21f8e8[_0x376f25][_0x8742('0x68')]&&_0x5657fe[_0x8742('0x62')]<=_0x21f8e8[_0x376f25]['to']){_0xf34b7a[_0x8742('0x5d')]=_0x5657fe['min_internal'];}}}if(_[_0x8742('0x61')](_0xf34b7a[_0x8742('0x5d')])){_0xf34b7a[_0x8742('0x5d')]=_0x5662a3+0x1;}return _0x59dd73(_0xf34b7a);});});})[_0x8742('0x19')](function(_0x4122bf){_0xb1bdbd(_0x4122bf);});});}function updateUser(_0x1a21ef){return new BPromise(function(_0x2104f2,_0x179dd5){try{if(_0x1a21ef[_0x8742('0x69')]){_0x1a21ef[_0x8742('0x6a')]=_0x1a21ef[_0x8742('0x5d')];_0x1a21ef[_0x8742('0x6b')]={'mailbox':_0x1a21ef[_0x8742('0x5d')],'password':_0x1a21ef[_0x8742('0x52')],'fullname':_0x1a21ef[_0x8742('0x6c')],'email':_0x1a21ef['email']};}if(_0x1a21ef['role']===_0x8742('0x6d')){if(!_0x1a21ef['permissions'])_0x1a21ef[_0x8742('0x6e')]=[_0x8742('0x6f'),_0x8742('0x70'),_0x8742('0x71'),_0x8742('0x72'),_0x8742('0x73'),_0x8742('0x74'),_0x8742('0x75'),_0x8742('0x76'),_0x8742('0x77'),_0x8742('0x78'),_0x8742('0x79'),_0x8742('0x7a'),_0x8742('0x7b'),_0x8742('0x7c'),'115'];}_0x2104f2(_0x1a21ef);}catch(_0x22d413){_0x179dd5(_0x22d413);}});}exports[_0x8742('0x7d')]=function(_0x523c64,_0x4794dc){if(_0x523c64[_0x8742('0x7e')][_0x8742('0x2f')]===_0x8742('0x6d'))throw new Error(_0x8742('0x7f'));if(_0x523c64[_0x8742('0x59')]['role']==='user'&&_0x523c64[_0x8742('0x7e')]['role']!==_0x8742('0x25')){throw new Error(_0x8742('0x80'));}if(_0x523c64[_0x8742('0x59')]['role']===_0x8742('0x25')&&_0x523c64[_0x8742('0x7e')][_0x8742('0x2f')]!=='admin'){throw new Error(_0x8742('0x81'));}return licenseUtil['checkUserLimits']([_0x523c64[_0x8742('0x59')]])[_0x8742('0xf')](function(){return validateUser(_0x523c64['body']);})['then'](function(_0x44e30d){return updateUser(_0x44e30d)['then'](function(_0x342ddc){if(_0x342ddc[_0x8742('0x2f')]===_0x8742('0x25')){_0x342ddc[_0x8742('0x82')]=_0x523c64[_0x8742('0x7e')][_0x8742('0x82')];delete _0x342ddc[_0x8742('0x83')];}return _0x342ddc;});})['then'](function(_0x274197){return db[_0x8742('0x36')][_0x8742('0x7d')](_0x274197,{'include':[{'model':db[_0x8742('0x6b')],'as':_0x8742('0x6b')}]});})[_0x8742('0xf')](function(_0x3290e5){if(_0x523c64['body'][_0x8742('0x2f')]==='user')return _0x3290e5;if(_0x523c64['user'][_0x8742('0x2f')]!==_0x8742('0x7e'))return _0x3290e5;return db['UserProfileSection'][_0x8742('0x2e')]({'where':{'name':_0x3290e5[_0x8742('0x2f')]===_0x8742('0x6d')?'Agents':_0x8742('0x28'),'userProfileId':_0x523c64[_0x8742('0x7e')]['userProfileId']},'raw':!![]})[_0x8742('0xf')](function(_0x2b793d){if(!_0x2b793d||_0x2b793d['autoAssociation']!=0x0)return _0x3290e5;return db['UserProfileResource'][_0x8742('0x7d')]({'name':_0x3290e5['name'],'resourceId':_0x3290e5['id'],'type':_0x2b793d['name'],'sectionId':_0x2b793d['id']},{})[_0x8742('0xf')](function(){return _0x3290e5;});})[_0x8742('0x19')](function(_0x4fbe06){logger['error'](_0x8742('0x84'),_0x4fbe06);throw _0x4fbe06;});})['then'](respondWithResult(_0x4794dc,0xc9))[_0x8742('0x19')](handleError(_0x4794dc,null));};exports['bulkCreate']=function(_0x94c25f,_0x1aa94a){var _0x377372=_0x94c25f[_0x8742('0x59')];var _0x337bf1=[];if(_0x94c25f['user'][_0x8742('0x2f')]===_0x8742('0x6d'))throw new Error(_0x8742('0x7f'));if(_[_0x8742('0x85')](_0x377372,[_0x8742('0x2f'),'user'])&&_0x94c25f[_0x8742('0x7e')][_0x8742('0x2f')]!==_0x8742('0x25')){throw new Error(_0x8742('0x80'));}if(_[_0x8742('0x85')](_0x377372,[_0x8742('0x2f'),_0x8742('0x25')])&&_0x94c25f[_0x8742('0x7e')][_0x8742('0x2f')]!==_0x8742('0x25')){throw new Error(_0x8742('0x86'));}return licenseUtil[_0x8742('0x87')](_0x377372)[_0x8742('0xf')](function(){return validateUser(_0x377372[0x0]);})[_0x8742('0xf')](function(){for(var _0x51f772=0x1;_0x51f772<_0x377372[_0x8742('0x67')];_0x51f772++){var _0xf06134=_0x377372[_0x51f772-0x1][_0x8742('0x5d')];if(!_0x377372[_0x51f772][_0x8742('0x5d')])_0x377372[_0x51f772]['internal']=_0xf06134+0x1;_0x337bf1[_0x8742('0x43')](validateUser(_0x377372[_0x51f772]));}return BPromise[_0x8742('0x4c')](_0x337bf1);})[_0x8742('0xf')](function(){_0x337bf1=[];for(var _0x3ff03c=0x0;_0x3ff03c<_0x377372['length'];_0x3ff03c++){_0x337bf1[_0x8742('0x43')](updateUser(_0x377372[_0x3ff03c]));}return BPromise['all'](_0x337bf1);})[_0x8742('0xf')](function(){return BPromise[_0x8742('0x88')](_0x377372,function(_0x2888a7){return db[_0x8742('0x36')][_0x8742('0x7d')](_0x2888a7,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})[_0x8742('0xf')](function(_0x16920d){_0x2888a7['id']=_0x16920d['id'];return _0x2888a7;});});})[_0x8742('0xf')](function(_0xe3b978){if(_0x94c25f[_0x8742('0x59')][_0x8742('0x2f')]===_0x8742('0x7e'))return _0xe3b978;if(_0x94c25f[_0x8742('0x7e')][_0x8742('0x2f')]!=='user')return _0xe3b978;var _0x58ab2a=_[_0x8742('0x85')](_0xe3b978,function(_0x41c833){return _0x41c833[_0x8742('0x2f')]===_0x8742('0x6d')||_0x41c833[_0x8742('0x2f')]===_0x8742('0x29');});if(!_0x58ab2a)return _0xe3b978;return db[_0x8742('0x89')][_0x8742('0x44')]({'where':{'name':{'$or':[_0x8742('0x27'),_0x8742('0x28')]},'userProfileId':_0x94c25f[_0x8742('0x7e')][_0x8742('0x83')]},'raw':!![]})[_0x8742('0xf')](function(_0x558634){if(_['isEmpty'](_0x558634)||!_[_0x8742('0x85')](_0x558634,[_0x8742('0x8a'),0x0]))return _0xe3b978;_0x337bf1=[];var _0x39dcd5=_(_0x558634)[_0x8742('0x38')](function(_0xa8270e){if(_0xa8270e[_0x8742('0x8a')]===0x1)return;return _0xa8270e['name']===_0x8742('0x27')?'agent':_0x8742('0x29');})[_0x8742('0x8b')]()[_0x8742('0x2c')]();for(var _0x3bc4ad=0x0;_0x3bc4ad<_0xe3b978[_0x8742('0x67')];_0x3bc4ad++){if(!_[_0x8742('0x2d')](_0x39dcd5,_0xe3b978[_0x3bc4ad][_0x8742('0x2f')]))return;var _0x487239=_0xe3b978[_0x3bc4ad]['role']===_0x8742('0x6d')?_0x8742('0x27'):_0x8742('0x28');_0x337bf1['push'](db[_0x8742('0x31')][_0x8742('0x7d')]({'name':_0xe3b978[_0x3bc4ad][_0x8742('0x30')],'resourceId':_0xe3b978[_0x3bc4ad]['id'],'type':_0x487239,'sectionId':_['find'](_0x558634,[_0x8742('0x30'),_0x487239])['id']},{}));}return BPromise['all'](_0x337bf1);});})['then'](respondWithResult(_0x1aa94a,0xc9))['catch'](handleError(_0x1aa94a,null));};exports[_0x8742('0x8c')]=function(_0xbcbc17,_0x13685d){if(_0xbcbc17['body']['id']){delete _0xbcbc17['body']['id'];}return db[_0x8742('0x36')]['find']({'where':{'id':_0xbcbc17[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](function(_0x3ec4cb){if(!_0x3ec4cb)return null;if(_0x3ec4cb['id']===_0xbcbc17['user']['id']){if(!_0xbcbc17[_0x8742('0x59')][_0x8742('0x8d')]||!_0xbcbc17[_0x8742('0x59')][_0x8742('0x8e')]){throw new db[(_0x8742('0x8f'))][(_0x8742('0x90'))](_0x8742('0x91'));}if(!_0x3ec4cb[_0x8742('0x92')](_0xbcbc17['body'][_0x8742('0x8d')])){throw new db[(_0x8742('0x8f'))][(_0x8742('0x90'))](_0x8742('0x93'));}if(_0xbcbc17[_0x8742('0x59')][_0x8742('0x8d')]===_0xbcbc17[_0x8742('0x59')][_0x8742('0x8e')]){throw new db[(_0x8742('0x8f'))][(_0x8742('0x90'))](_0x8742('0x94'));}}else if(_0xbcbc17[_0x8742('0x7e')]['role']==='admin'){if(!_0xbcbc17[_0x8742('0x59')][_0x8742('0x8e')]){throw new db[(_0x8742('0x8f'))][(_0x8742('0x90'))](_0x8742('0x95'));}}else if(_0xbcbc17['user'][_0x8742('0x2f')]===_0x8742('0x7e')){if(!_0xbcbc17[_0x8742('0x59')][_0x8742('0x8e')]){throw new db[(_0x8742('0x8f'))][(_0x8742('0x90'))](_0x8742('0x95'));}if(_0x3ec4cb[_0x8742('0x2f')]!==_0x8742('0x6d')){throw new db[(_0x8742('0x8f'))]['ValidationError'](_0x8742('0x7f'));}}else{throw new db[(_0x8742('0x8f'))][(_0x8742('0x90'))]('Unauthorized');}return _0x3ec4cb;})['then'](handleEntityNotFound(_0x13685d,null))[_0x8742('0xf')](function(_0x1e3c09){return db[_0x8742('0x96')]['findOne']({'attributes':['id',_0x8742('0x5e'),_0x8742('0x97'),_0x8742('0x98')]})[_0x8742('0xf')](function(_0x2df2d1){if(_0x2df2d1['securePassword'])authService[_0x8742('0x5f')](_0xbcbc17[_0x8742('0x59')][_0x8742('0x8e')]);if(!_0x2df2d1[_0x8742('0x97')]||!_0x1e3c09[_0x8742('0x99')])return _0x1e3c09;authService[_0x8742('0x9a')](_0xbcbc17[_0x8742('0x59')]['newPassword'],_0x1e3c09[_0x8742('0x99')],_0x2df2d1[_0x8742('0x98')]);return _0x1e3c09;})[_0x8742('0xf')](saveUpdates({'password':_0xbcbc17[_0x8742('0x59')][_0x8742('0x8e')],'passwordResetAt':_0xbcbc17[_0x8742('0x7e')]['id']==_0xbcbc17[_0x8742('0x4e')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0xbcbc17[_0x8742('0x59')][_0x8742('0x8e')],_0x1e3c09[_0x8742('0x99')])},null));})['then'](respondWithResult(_0x13685d,null))[_0x8742('0x19')](handleError(_0x13685d,null));};exports[_0x8742('0x9b')]=function(_0x44a03a,_0x5beab1){var _0x1558ef=_0x44a03a['body'][_0x8742('0x9c')];return db[_0x8742('0x36')][_0x8742('0x2e')]({'where':{'id':_0x44a03a[_0x8742('0x4e')]['id']},'attributes':['id','name',_0x8742('0x2f'),_0x8742('0x9d'),'loginInPause','voicePause',_0x8742('0x9e')]})['then'](handleEntityNotFound(_0x5beab1,null))[_0x8742('0xf')](function(_0x1d9736){if(_0x1d9736){if(!utils['isValidChannel'](_0x1558ef)){throw new db[(_0x8742('0x8f'))][(_0x8742('0x90'))](_0x8742('0x9f'));}return _0x1d9736[_0x8742('0xa0')+_[_0x8742('0xa1')](_0x1558ef['toLowerCase']())+_0x8742('0xa2')](_0x44a03a['body'][_0x8742('0x5c')],{'penalty':_0x44a03a[_0x8742('0x59')][_0x8742('0xa3')]||0x0})[_0x8742('0xa4')](function(_0x2015cd){for(var _0x1e512b=0x0;_0x1e512b<_0x44a03a[_0x8742('0x59')]['ids'][_0x8742('0x67')];_0x1e512b+=0x1){var _0x2e75a9={'UserId':Number(_0x44a03a[_0x8742('0x4e')]['id'])};_0x2e75a9[_[_0x8742('0xa1')](_0x1558ef[_0x8742('0xa5')]())+_0x8742('0xa6')]=Number(_0x44a03a[_0x8742('0x59')][_0x8742('0x5c')][_0x1e512b]);socket['emit'](_0x8742('0x7e')+_['capitalize'](_0x1558ef[_0x8742('0xa5')]())+_0x8742('0xa7'),_0x2e75a9);}return _0x2015cd;})[_0x8742('0xf')](function(){if(_0x1558ef===_0x8742('0xa8')){return db[_0x8742('0xa9')][_0x8742('0x44')]({'where':{'id':_0x44a03a['body'][_0x8742('0x5c')]||[]},'raw':!![],'attributes':['id',_0x8742('0x30')]});}})['then'](function(_0x1d5aae){var _0x3c0495=_0x1d9736[_0x8742('0x24')]({'plain':!![]});var _0x2a2930=[];if(_0x1558ef===_0x8742('0xa8')&&_0x3c0495['role']===_0x8742('0x6d')&&_0x3c0495[_0x8742('0x9d')]){for(var _0x30619d=0x0;_0x30619d<_0x1d5aae['length'];_0x30619d+=0x1){_0x2a2930[_0x8742('0x43')]({'membername':_0x3c0495[_0x8742('0x30')],'UserId':_0x3c0495['id'],'queue_name':_0x1d5aae[_0x30619d][_0x8742('0x30')],'VoiceQueueId':_0x1d5aae[_0x30619d]['id'],'interface':_[_0x8742('0x61')](_0x3c0495[_0x8742('0x9e')])?util[_0x8742('0xaa')](_0x8742('0xab'),_0x3c0495[_0x8742('0x30')]):_0x3c0495[_0x8742('0x9e')],'paused':_0x3c0495[_0x8742('0xac')]||![],'penalty':_0x44a03a['body'][_0x8742('0xa3')]||0x0});}return BPromise[_0x8742('0x88')](_0x2a2930,function(_0x4e4754){return db[_0x8742('0xad')][_0x8742('0xae')](_0x4e4754);});}return _0x1d9736;});}})['then'](respondWithStatusCode(_0x5beab1,null))[_0x8742('0x19')](handleError(_0x5beab1,null));};exports[_0x8742('0xaf')]=function(_0x579a7e,_0x28fce8){var _0xb6de0c,_0x4f4037;return db[_0x8742('0x36')][_0x8742('0x2e')]({'where':{'id':_0x579a7e[_0x8742('0x4e')]['id']},'attributes':['id','name',_0x8742('0x2f')]})[_0x8742('0xf')](handleEntityNotFound(_0x28fce8,null))[_0x8742('0xf')](function(_0x53919c){if(_0x53919c){_0xb6de0c=_0x53919c;if(!_0x579a7e[_0x8742('0x3c')][_0x8742('0x9c')]||!utils[_0x8742('0xb0')](_0x579a7e[_0x8742('0x3c')][_0x8742('0x9c')])){throw new db[(_0x8742('0x8f'))]['ValidationError'](_0x8742('0x9f'));}return _0x53919c[_0x8742('0xb1')+_[_0x8742('0xa1')](_0x579a7e[_0x8742('0x3c')][_0x8742('0x9c')][_0x8742('0xa5')]())+_0x8742('0xa2')](_0x579a7e[_0x8742('0x3c')]['ids']);}})[_0x8742('0xf')](function(_0x5ced2e){if(_[_0x8742('0xb2')](_0x579a7e['query'][_0x8742('0x5c')])){for(var _0x36b2ad=0x0;_0x36b2ad<_0x579a7e['query'][_0x8742('0x5c')][_0x8742('0x67')];_0x36b2ad+=0x1){_0x4f4037={'UserId':Number(_0x579a7e['params']['id'])};_0x4f4037[_[_0x8742('0xa1')](_0x579a7e[_0x8742('0x3c')]['channel'][_0x8742('0xa5')]())+_0x8742('0xa6')]=Number(_0x579a7e[_0x8742('0x3c')][_0x8742('0x5c')][_0x36b2ad]);socket[_0x8742('0xb3')](_0x8742('0x7e')+_[_0x8742('0xa1')](_0x579a7e[_0x8742('0x3c')]['channel'][_0x8742('0xa5')]())+_0x8742('0xb4'),_0x4f4037);}}else{_0x4f4037={'UserId':Number(_0x579a7e[_0x8742('0x4e')]['id'])};_0x4f4037[_['capitalize'](_0x579a7e[_0x8742('0x3c')][_0x8742('0x9c')][_0x8742('0xa5')]())+_0x8742('0xa6')]=Number(_0x579a7e['query'][_0x8742('0x5c')]);socket[_0x8742('0xb3')](_0x8742('0x7e')+_[_0x8742('0xa1')](_0x579a7e[_0x8742('0x3c')]['channel'][_0x8742('0xa5')]())+_0x8742('0xb4'),_0x4f4037);}return _0x5ced2e;})[_0x8742('0xf')](function(){if(_0x579a7e[_0x8742('0x3c')][_0x8742('0x9c')]==='voice'){return db['UserVoiceQueueRt'][_0x8742('0x23')]({'where':{'UserId':_0x579a7e[_0x8742('0x4e')]['id'],'VoiceQueueId':_0x579a7e[_0x8742('0x3c')]['ids']},'individualHooks':!![]})['then'](function(){return _0xb6de0c;});}return _0xb6de0c;})[_0x8742('0xf')](respondWithStatusCode(_0x28fce8,null))[_0x8742('0x19')](handleError(_0x28fce8,null));};exports[_0x8742('0xb5')]=function(_0x1035ef,_0x220149){_0x1035ef[_0x8742('0x59')][_0x8742('0xb6')]=_0x1035ef['file']['filename'];return db[_0x8742('0x36')][_0x8742('0x2e')]({'where':{'id':_0x1035ef[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x220149,null))['then'](saveUpdates(_0x1035ef['body'],null))[_0x8742('0xf')](respondWithResult(_0x220149,null))['catch'](handleError(_0x220149,null));};exports['getAvatar']=function(_0x831528,_0x57248d){var _0x42ce13=path[_0x8742('0xb7')](config[_0x8742('0xb8')],_0x8742('0xb9'));return db[_0x8742('0x36')]['find']({'where':{'id':_0x831528[_0x8742('0x4e')]['id']},'attributes':['id',_0x8742('0xb6')],'raw':!![]})[_0x8742('0xf')](handleEntityNotFound(_0x57248d,null))[_0x8742('0xf')](function(_0x517b55){if(_0x517b55){if(_['isNil'](_0x517b55[_0x8742('0xb6')])){return _0x57248d['download'](_0x42ce13);}else{if(!fs[_0x8742('0xba')](path['join'](config['root'],'server/files/images/',_0x517b55[_0x8742('0xb6')]))){return _0x57248d[_0x8742('0xbb')](_0x42ce13);}return _0x57248d[_0x8742('0xbb')](path[_0x8742('0xb7')](config[_0x8742('0xb8')],'server/files/images/',_0x517b55[_0x8742('0xb6')]));}}})['catch'](handleError(_0x57248d,null));};exports[_0x8742('0xbc')]=function(_0x5839a0,_0xf112c){return db[_0x8742('0x36')][_0x8742('0x2e')]({'where':{'id':_0x5839a0['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0xf112c,null))[_0x8742('0xf')](function(_0x8fd7e0){var _0x5f253a=[];values=_0x8fd7e0[_0x8742('0x48')];_0x5f253a['push'](get_open_tabs('chat',_0x8fd7e0[_0x8742('0x48')]));_0x5f253a[_0x8742('0x43')](get_open_tabs('sms',_0x8fd7e0['dataValues']));_0x5f253a[_0x8742('0x43')](get_open_tabs(_0x8742('0x58'),_0x8fd7e0[_0x8742('0x48')]));_0x5f253a[_0x8742('0x43')](get_open_tabs(_0x8742('0x4b'),_0x8fd7e0[_0x8742('0x48')]));_0x5f253a[_0x8742('0x43')](get_open_tabs(_0x8742('0x49'),_0x8fd7e0[_0x8742('0x48')]));_0x5f253a[_0x8742('0x43')](get_open_tabs(_0x8742('0x4a'),_0x8fd7e0[_0x8742('0x48')]));return BPromise[_0x8742('0x4c')](_0x5f253a);})[_0x8742('0xf')](function(_0x479e6a){if(_0x479e6a){var _0x76e4cb=_[_0x8742('0x38')](values['ChatOpenTabs'],function(_0x23b540){return{'channel':_0x8742('0xbd'),'id':_0x23b540['id'],'createdAt':_0x23b540['createdAt']};});var _0x1df0db=_[_0x8742('0x38')](values[_0x8742('0xbe')],function(_0x21e51a){return{'channel':_0x8742('0xbf'),'id':_0x21e51a['id'],'createdAt':_0x21e51a[_0x8742('0xc0')]};});var _0x3adb09=_[_0x8742('0x38')](values[_0x8742('0xc1')],function(_0x596c42){return{'channel':_0x8742('0xc2'),'id':_0x596c42['id'],'createdAt':_0x596c42[_0x8742('0xc0')]};});var _0x38eed9=_[_0x8742('0x38')](values[_0x8742('0xc3')],function(_0x2d84b7){return{'channel':_0x8742('0xc4'),'id':_0x2d84b7['id'],'createdAt':_0x2d84b7[_0x8742('0xc0')]};});var _0x59a2c1=_[_0x8742('0x38')](values[_0x8742('0xc5')],function(_0x477110){return{'channel':_0x8742('0xc6'),'id':_0x477110['id'],'createdAt':_0x477110['createdAt']};});var _0x4e6517=_[_0x8742('0x38')](values['WhatsappOpenTabs'],function(_0x4591b6){return{'channel':_0x8742('0xc7'),'id':_0x4591b6['id'],'createdAt':_0x4591b6['createdAt']};});var _0x137272=_[_0x8742('0xc8')](_0x76e4cb,_0x1df0db,_0x3adb09,_0x38eed9,_0x59a2c1,_0x4e6517);var _0x5466fc={'count':_0x137272[_0x8742('0x67')],'rows':_0x137272};return _0x5466fc;}else return null;})[_0x8742('0xf')](respondWithResult(_0xf112c,null))[_0x8742('0x19')](handleError(_0xf112c,null));};exports[_0x8742('0xc9')]=function(_0x19425e,_0x59f89c){var _0x1884c9={};var _0x41c453={};var _0x1ec258;var _0x16ad60;return db[_0x8742('0x36')][_0x8742('0xca')]({'where':{'id':_0x19425e[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x59f89c,null))[_0x8742('0xf')](function(_0x3b1007){if(_0x3b1007){_0x1ec258=_0x3b1007;_0x41c453['model']=_[_0x8742('0x51')](db['CmContact'][_0x8742('0x37')]);_0x41c453[_0x8742('0x3c')]=_['keys'](_0x19425e[_0x8742('0x3c')]);_0x41c453[_0x8742('0x53')]=_['intersection'](_0x41c453[_0x8742('0x4f')],_0x41c453['query']);_0x1884c9['attributes']=_[_0x8742('0x54')](_0x41c453['model'],qs[_0x8742('0x55')](_0x19425e[_0x8742('0x3c')][_0x8742('0x55')]));_0x1884c9[_0x8742('0x42')]=_0x1884c9[_0x8742('0x42')][_0x8742('0x67')]?_0x1884c9['attributes']:_0x41c453[_0x8742('0x4f')];_0x1884c9[_0x8742('0xcb')]=qs['sort'](_0x19425e[_0x8742('0x3c')][_0x8742('0xcc')]);_0x1884c9[_0x8742('0x3b')]=qs[_0x8742('0x53')](_[_0x8742('0xcd')](_0x19425e[_0x8742('0x3c')],_0x41c453['filters']));if(_0x19425e[_0x8742('0x3c')][_0x8742('0x2a')]){_0x1884c9[_0x8742('0x3b')]=_[_0x8742('0x56')](_0x1884c9['where'],{'$or':_[_0x8742('0x38')](_0x1884c9['attributes'],function(_0x4d382c){var _0x47eed1={};_0x47eed1[_0x4d382c]={'$like':'%'+_0x19425e[_0x8742('0x3c')][_0x8742('0x2a')]+'%'};return _0x47eed1;})});}_0x1884c9=_[_0x8742('0x56')]({},_0x1884c9,_0x19425e[_0x8742('0xce')]);return _0x1ec258['getContacts'](_0x1884c9);}})[_0x8742('0xf')](function(_0x5dfc85){if(_0x5dfc85){_0x16ad60=_0x5dfc85[_0x8742('0x67')];if(_0x19425e[_0x8742('0x3c')]['hasOwnProperty'](_0x8742('0x3d'))){_0x1884c9['include']=[{'model':db[_0x8742('0xcf')],'as':_0x8742('0xd0'),'required':![]},{'model':db[_0x8742('0xd1')],'as':_0x8742('0xd2'),'attributes':['id','name','color'],'where':_0x19425e[_0x8742('0x3c')][_0x8742('0xd3')]?{'id':_0x19425e[_0x8742('0x3c')][_0x8742('0xd3')]}:undefined,'required':_0x19425e[_0x8742('0x3c')][_0x8742('0xd3')]?!![]:![]}];}if(!_0x19425e[_0x8742('0x3c')]['hasOwnProperty'](_0x8742('0xd4'))){_0x1884c9[_0x8742('0x1d')]=qs['limit'](_0x19425e[_0x8742('0x3c')]['limit']);_0x1884c9[_0x8742('0x1c')]=qs[_0x8742('0x1c')](_0x19425e['query'][_0x8742('0x1c')]);}return _0x1ec258['getContacts'](_0x1884c9);}})['then'](function(_0x42fb41){if(_0x42fb41){return _0x42fb41?{'count':_0x16ad60,'rows':_0x42fb41}:null;}})['then'](respondWithResult(_0x59f89c,null))[_0x8742('0x19')](handleError(_0x59f89c,null));};exports['getQueues']=function(_0x246e61,_0x3f31b3){var _0x3b7205;var _0x158b44={};var _0x390e5a;return db[_0x8742('0x36')][_0x8742('0xca')]({'where':{'id':_0x246e61['params']['id']},'attributes':['id','name',_0x8742('0x2f')]})[_0x8742('0xf')](handleEntityNotFound(_0x3f31b3,null))['then'](function(_0x2a4c13){if(!utils[_0x8742('0xb0')](_0x246e61['query'][_0x8742('0x9c')])){throw new db[(_0x8742('0x8f'))][(_0x8742('0x90'))](_0x8742('0x9f'));}_0x3b7205=_0x2a4c13;var _0x329aa3={};_0x329aa3['model']=_[_0x8742('0x51')](db[_[_0x8742('0xa1')](_0x246e61[_0x8742('0x3c')]['channel'])+_0x8742('0xd5')][_0x8742('0x37')]);_0x329aa3[_0x8742('0x3c')]=_[_0x8742('0x51')](_0x246e61['query']);_0x329aa3[_0x8742('0x53')]=_['intersection'](_0x329aa3[_0x8742('0x4f')],_0x329aa3['query']);_0x158b44[_0x8742('0x42')]=_[_0x8742('0x54')](_0x329aa3[_0x8742('0x4f')],qs['fields'](_0x246e61['query'][_0x8742('0x55')]));_0x158b44[_0x8742('0x42')]=_0x158b44[_0x8742('0x42')][_0x8742('0x67')]?_0x158b44[_0x8742('0x42')]:_0x329aa3[_0x8742('0x4f')];_0x158b44[_0x8742('0xcb')]=qs[_0x8742('0xcc')](_0x246e61['query'][_0x8742('0xcc')]);_0x158b44[_0x8742('0x3b')]=qs[_0x8742('0x53')](_[_0x8742('0xcd')](_0x246e61[_0x8742('0x3c')],_0x329aa3[_0x8742('0x53')]));if(_0x246e61[_0x8742('0x3c')][_0x8742('0x2a')]){_0x158b44[_0x8742('0x3b')]=_[_0x8742('0x56')](_0x158b44[_0x8742('0x3b')],{'$or':_[_0x8742('0x38')](_0x158b44[_0x8742('0x42')],function(_0x5c1000){var _0x516fbc={};_0x516fbc[_0x5c1000]={'$like':'%'+_0x246e61['query'][_0x8742('0x2a')]+'%'};return _0x516fbc;})});}_0x158b44=_['merge']({},_0x158b44,_0x246e61['options']);switch(_0x3b7205[_0x8742('0x2f')]){case _0x8742('0x25'):return db[_[_0x8742('0xa1')](_0x246e61[_0x8742('0x3c')][_0x8742('0x9c')])+_0x8742('0xd5')][_0x8742('0x44')](_0x158b44);case'user':case _0x8742('0x6d'):return _0x3b7205[_0x8742('0x24')+_['capitalize'](_0x246e61[_0x8742('0x3c')]['channel'])+'Queues'](_0x158b44);default:throw new db[(_0x8742('0x8f'))]['ValidationError'](_0x8742('0xd6'));}})[_0x8742('0xf')](function(_0x1acc5d){_0x390e5a=_0x1acc5d[_0x8742('0x67')];if(!_0x246e61['query']['hasOwnProperty'](_0x8742('0xd4'))){_0x158b44[_0x8742('0x1d')]=qs[_0x8742('0x1d')](_0x246e61[_0x8742('0x3c')]['limit']);_0x158b44[_0x8742('0x1c')]=qs['offset'](_0x246e61[_0x8742('0x3c')][_0x8742('0x1c')]);}switch(_0x3b7205['role']){case _0x8742('0x25'):return db[_[_0x8742('0xa1')](_0x246e61[_0x8742('0x3c')][_0x8742('0x9c')])+_0x8742('0xd5')][_0x8742('0x44')](_0x158b44);case _0x8742('0x7e'):case _0x8742('0x6d'):return _0x3b7205[_0x8742('0x24')+_['capitalize'](_0x246e61[_0x8742('0x3c')][_0x8742('0x9c')])+_0x8742('0xa2')](_0x158b44);}})['then'](function(_0x249ecd){return{'count':_0x390e5a,'rows':_0x249ecd};})[_0x8742('0xf')](respondWithResult(_0x3f31b3,null))[_0x8742('0x19')](handleError(_0x3f31b3,null));};exports[_0x8742('0xd7')]=function(_0x193fd6,_0x4a2353){var _0x930948={};var _0x58df1c={};var _0x4c1f04;var _0x135348;return db[_0x8742('0x36')]['findOne']({'where':{'id':_0x193fd6[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x4a2353,null))[_0x8742('0xf')](function(_0x52d4b7){if(_0x52d4b7){_0x4c1f04=_0x52d4b7;_0x58df1c[_0x8742('0x4f')]=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x58df1c['query']=_[_0x8742('0x51')](_0x193fd6['query']);_0x58df1c[_0x8742('0x53')]=_[_0x8742('0x54')](_0x58df1c['model'],_0x58df1c[_0x8742('0x3c')]);_0x930948[_0x8742('0x42')]=_[_0x8742('0x54')](_0x58df1c['model'],qs[_0x8742('0x55')](_0x193fd6[_0x8742('0x3c')][_0x8742('0x55')]));_0x930948[_0x8742('0x42')]=_0x930948[_0x8742('0x42')]['length']?_0x930948[_0x8742('0x42')]:_0x58df1c[_0x8742('0x4f')];_0x930948[_0x8742('0xcb')]=qs[_0x8742('0xcc')](_0x193fd6[_0x8742('0x3c')][_0x8742('0xcc')]);_0x930948['where']=qs['filters'](_[_0x8742('0xcd')](_0x193fd6[_0x8742('0x3c')],_0x58df1c['filters']));if(_0x193fd6[_0x8742('0x3c')][_0x8742('0x2a')]){_0x930948[_0x8742('0x3b')]=_[_0x8742('0x56')](_0x930948[_0x8742('0x3b')],{'$or':_['map'](_0x930948[_0x8742('0x42')],function(_0x38b35a){var _0x3f4132={};_0x3f4132[_0x38b35a]={'$like':'%'+_0x193fd6['query'][_0x8742('0x2a')]+'%'};return _0x3f4132;})});}_0x930948=_['merge']({},_0x930948,_0x193fd6[_0x8742('0xce')]);return _0x4c1f04['getVoiceQueuesRt'](_0x930948);}})['then'](function(_0x28d85c){if(_0x28d85c){_0x135348=_0x28d85c[_0x8742('0x67')];if(!_0x193fd6['query'][_0x8742('0xd8')](_0x8742('0xd4'))){_0x930948[_0x8742('0x1d')]=qs[_0x8742('0x1d')](_0x193fd6[_0x8742('0x3c')]['limit']);_0x930948[_0x8742('0x1c')]=qs[_0x8742('0x1c')](_0x193fd6[_0x8742('0x3c')][_0x8742('0x1c')]);}return _0x4c1f04[_0x8742('0xd7')](_0x930948);}})[_0x8742('0xf')](function(_0x5a6f3d){if(_0x5a6f3d){return _0x5a6f3d?{'count':_0x135348,'rows':_0x5a6f3d}:null;}})[_0x8742('0xf')](respondWithResult(_0x4a2353,null))[_0x8742('0x19')](handleError(_0x4a2353,null));};exports[_0x8742('0xd9')]=function(_0x4722e1,_0x5acacf){var _0xb8e92={};var _0x2da938={};var _0x453050;var _0x4dda1a;return db[_0x8742('0x36')][_0x8742('0xca')]({'where':{'id':_0x4722e1[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x5acacf,null))['then'](function(_0x11ae1b){if(_0x11ae1b){_0x453050=_0x11ae1b;_0x2da938['model']=_['keys'](db[_0x8742('0xda')][_0x8742('0x37')]);_0x2da938[_0x8742('0x3c')]=_[_0x8742('0x51')](_0x4722e1[_0x8742('0x3c')]);_0x2da938[_0x8742('0x53')]=_[_0x8742('0x54')](_0x2da938[_0x8742('0x4f')],_0x2da938[_0x8742('0x3c')]);_0xb8e92[_0x8742('0x42')]=_['intersection'](_0x2da938[_0x8742('0x4f')],qs['fields'](_0x4722e1[_0x8742('0x3c')][_0x8742('0x55')]));_0xb8e92['attributes']=_0xb8e92[_0x8742('0x42')][_0x8742('0x67')]?_0xb8e92['attributes']:_0x2da938[_0x8742('0x4f')];_0xb8e92['order']=qs[_0x8742('0xcc')](_0x4722e1[_0x8742('0x3c')][_0x8742('0xcc')]);_0xb8e92[_0x8742('0x3b')]=qs[_0x8742('0x53')](_[_0x8742('0xcd')](_0x4722e1[_0x8742('0x3c')],_0x2da938['filters']));if(_0x4722e1['query'][_0x8742('0x2a')]){_0xb8e92[_0x8742('0x3b')]=_[_0x8742('0x56')](_0xb8e92[_0x8742('0x3b')],{'$or':_[_0x8742('0x38')](_0xb8e92[_0x8742('0x42')],function(_0xb126b1){var _0x5b6e86={};_0x5b6e86[_0xb126b1]={'$like':'%'+_0x4722e1[_0x8742('0x3c')]['filter']+'%'};return _0x5b6e86;})});}_0xb8e92=_['merge']({},_0xb8e92,_0x4722e1[_0x8742('0xce')]);return _0x453050[_0x8742('0xd9')](_0xb8e92);}})[_0x8742('0xf')](function(_0x50a5b0){if(_0x50a5b0){_0x4dda1a=_0x50a5b0['length'];if(!_0x4722e1[_0x8742('0x3c')]['hasOwnProperty']('nolimit')){_0xb8e92['limit']=qs[_0x8742('0x1d')](_0x4722e1[_0x8742('0x3c')][_0x8742('0x1d')]);_0xb8e92[_0x8742('0x1c')]=qs['offset'](_0x4722e1[_0x8742('0x3c')][_0x8742('0x1c')]);}return _0x453050['getGroups'](_0xb8e92);}})[_0x8742('0xf')](function(_0x5326f9){if(_0x5326f9){return _0x5326f9?{'count':_0x4dda1a,'rows':_0x5326f9}:null;}})[_0x8742('0xf')](respondWithResult(_0x5acacf,null))[_0x8742('0x19')](handleError(_0x5acacf,null));};exports[_0x8742('0xdb')]=function(_0x3f22f7,_0x498ffa){var _0x3c5c3f={'raw':!![],'where':{}};var _0x30821d={};var _0x2c8155={'count':0x0,'rows':[]};return db[_0x8742('0x36')]['findOne']({'where':{'id':_0x3f22f7[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x498ffa,null))[_0x8742('0xf')](function(_0x163abb){if(_0x163abb){_0x30821d['model']=_[_0x8742('0x51')](db[_0x8742('0xdc')][_0x8742('0x37')]);_0x30821d[_0x8742('0x3c')]=_[_0x8742('0x51')](_0x3f22f7[_0x8742('0x3c')]);_0x30821d[_0x8742('0x53')]=_[_0x8742('0x54')](_0x30821d[_0x8742('0x4f')],_0x30821d[_0x8742('0x3c')]);_0x3c5c3f[_0x8742('0x42')]=_[_0x8742('0x54')](_0x30821d[_0x8742('0x4f')],qs[_0x8742('0x55')](_0x3f22f7[_0x8742('0x3c')][_0x8742('0x55')]));_0x3c5c3f[_0x8742('0x42')]=_0x3c5c3f['attributes'][_0x8742('0x67')]?_0x3c5c3f[_0x8742('0x42')]:_0x30821d['model'];if(!_0x3f22f7['query'][_0x8742('0xd8')](_0x8742('0xd4'))){_0x3c5c3f['limit']=qs[_0x8742('0x1d')](_0x3f22f7['query'][_0x8742('0x1d')]);_0x3c5c3f[_0x8742('0x1c')]=qs[_0x8742('0x1c')](_0x3f22f7[_0x8742('0x3c')][_0x8742('0x1c')]);}_0x3c5c3f['order']=qs[_0x8742('0xcc')](_0x3f22f7[_0x8742('0x3c')][_0x8742('0xcc')]);_0x3c5c3f[_0x8742('0x3b')]=qs[_0x8742('0x53')](_[_0x8742('0xcd')](_0x3f22f7[_0x8742('0x3c')],_0x30821d[_0x8742('0x53')]));_0x3c5c3f['where'][_0x8742('0xdd')]=_0x163abb['id'];if(_0x3f22f7[_0x8742('0x3c')][_0x8742('0x2a')]){_0x3c5c3f[_0x8742('0x3b')]=_['merge'](_0x3c5c3f[_0x8742('0x3b')],{'$or':_[_0x8742('0x38')](_0x3c5c3f[_0x8742('0x42')],function(_0x376598){var _0x183740={};_0x183740[_0x376598]={'$like':'%'+_0x3f22f7[_0x8742('0x3c')][_0x8742('0x2a')]+'%'};return _0x183740;})});}_0x3c5c3f=_['merge']({},_0x3c5c3f,_0x3f22f7[_0x8742('0xce')]);return db[_0x8742('0xdc')][_0x8742('0x1f')]({'where':_0x3c5c3f[_0x8742('0x3b')]})[_0x8742('0xf')](function(_0xcebb77){_0x2c8155['count']=_0xcebb77;if(_0x3f22f7['query'][_0x8742('0x3d')]){_0x3c5c3f[_0x8742('0x3e')]=[{'all':!![]}];}return db[_0x8742('0xdc')][_0x8742('0x44')](_0x3c5c3f);})['then'](function(_0x517b9d){_0x2c8155[_0x8742('0x45')]=_0x517b9d;return _0x2c8155;});}})['then'](respondWithFilteredResult(_0x498ffa,_0x3c5c3f))[_0x8742('0x19')](handleError(_0x498ffa,null));};exports[_0x8742('0xde')]=function(_0x2dce03,_0x5ba7a4){var _0x5f0156={'raw':!![],'where':{}};var _0x50c80d={};var _0x189537={'count':0x0,'rows':[]};return db[_0x8742('0x36')][_0x8742('0xca')]({'where':{'id':_0x2dce03[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x5ba7a4,null))[_0x8742('0xf')](function(_0x214dbc){if(_0x214dbc){_0x50c80d[_0x8742('0x4f')]=_[_0x8742('0x51')](db['ScreenRecording']['rawAttributes']);_0x50c80d[_0x8742('0x3c')]=_[_0x8742('0x51')](_0x2dce03[_0x8742('0x3c')]);_0x50c80d[_0x8742('0x53')]=_[_0x8742('0x54')](_0x50c80d[_0x8742('0x4f')],_0x50c80d[_0x8742('0x3c')]);_0x5f0156[_0x8742('0x42')]=_[_0x8742('0x54')](_0x50c80d[_0x8742('0x4f')],qs[_0x8742('0x55')](_0x2dce03[_0x8742('0x3c')]['fields']));_0x5f0156['attributes']=_0x5f0156[_0x8742('0x42')][_0x8742('0x67')]?_0x5f0156[_0x8742('0x42')]:_0x50c80d[_0x8742('0x4f')];if(!_0x2dce03['query']['hasOwnProperty'](_0x8742('0xd4'))){_0x5f0156[_0x8742('0x1d')]=qs[_0x8742('0x1d')](_0x2dce03['query'][_0x8742('0x1d')]);_0x5f0156[_0x8742('0x1c')]=qs[_0x8742('0x1c')](_0x2dce03[_0x8742('0x3c')][_0x8742('0x1c')]);}_0x5f0156[_0x8742('0xcb')]=qs[_0x8742('0xcc')](_0x2dce03['query'][_0x8742('0xcc')]);_0x5f0156['where']=qs['filters'](_['pick'](_0x2dce03[_0x8742('0x3c')],_0x50c80d[_0x8742('0x53')]));_0x5f0156['where'][_0x8742('0xdd')]=_0x214dbc['id'];if(_0x2dce03[_0x8742('0x3c')]['filter']){_0x5f0156[_0x8742('0x3b')]=_[_0x8742('0x56')](_0x5f0156['where'],{'$or':_['map'](_0x5f0156[_0x8742('0x42')],function(_0xd5bbd6){var _0xb3cfd5={};_0xb3cfd5[_0xd5bbd6]={'$like':'%'+_0x2dce03['query']['filter']+'%'};return _0xb3cfd5;})});}_0x5f0156=_['merge']({},_0x5f0156,_0x2dce03['options']);return db[_0x8742('0xdf')][_0x8742('0x1f')]({'where':_0x5f0156[_0x8742('0x3b')]})[_0x8742('0xf')](function(_0x450529){_0x189537['count']=_0x450529;if(_0x2dce03[_0x8742('0x3c')][_0x8742('0x3d')]){_0x5f0156[_0x8742('0x3e')]=[{'all':!![]}];}return db[_0x8742('0xdf')][_0x8742('0x44')](_0x5f0156);})[_0x8742('0xf')](function(_0x46e79f){_0x189537[_0x8742('0x45')]=_0x46e79f;return _0x189537;});}})[_0x8742('0xf')](respondWithFilteredResult(_0x5ba7a4,_0x5f0156))[_0x8742('0x19')](handleError(_0x5ba7a4,null));};exports[_0x8742('0xe0')]=function(_0x84860e,_0x44685a){var _0xf4a7c6={};var _0xbfe259={};var _0x13ade9;var _0x39fa74;return db[_0x8742('0x36')][_0x8742('0xca')]({'where':{'id':_0x84860e['params']['id']}})['then'](handleEntityNotFound(_0x44685a,null))[_0x8742('0xf')](function(_0x1bfe6e){if(_0x1bfe6e){_0x13ade9=_0x1bfe6e;_0xbfe259['model']=_[_0x8742('0x51')](db[_0x8742('0xe1')]['rawAttributes']);_0xbfe259[_0x8742('0x3c')]=_[_0x8742('0x51')](_0x84860e[_0x8742('0x3c')]);_0xbfe259[_0x8742('0x53')]=_[_0x8742('0x54')](_0xbfe259['model'],_0xbfe259[_0x8742('0x3c')]);_0xf4a7c6['attributes']=_['intersection'](_0xbfe259['model'],qs[_0x8742('0x55')](_0x84860e['query']['fields']));_0xf4a7c6[_0x8742('0x42')]=_0xf4a7c6[_0x8742('0x42')][_0x8742('0x67')]?_0xf4a7c6[_0x8742('0x42')]:_0xbfe259[_0x8742('0x4f')];_0xf4a7c6['order']=qs['sort'](_0x84860e[_0x8742('0x3c')][_0x8742('0xcc')]);_0xf4a7c6[_0x8742('0x3b')]=qs[_0x8742('0x53')](_['pick'](_0x84860e[_0x8742('0x3c')],_0xbfe259[_0x8742('0x53')]));if(_0x84860e[_0x8742('0x3c')][_0x8742('0x2a')]){_0xf4a7c6['where']=_[_0x8742('0x56')](_0xf4a7c6[_0x8742('0x3b')],{'$or':_['map'](_0xf4a7c6['attributes'],function(_0x45b180){var _0x4bde8b={};_0x4bde8b[_0x45b180]={'$like':'%'+_0x84860e[_0x8742('0x3c')][_0x8742('0x2a')]+'%'};return _0x4bde8b;})});}_0xf4a7c6=_[_0x8742('0x56')]({},_0xf4a7c6,_0x84860e[_0x8742('0xce')]);return _0x13ade9[_0x8742('0xe0')](_0xf4a7c6);}})['then'](function(_0x5baa23){if(_0x5baa23){_0x39fa74=_0x5baa23[_0x8742('0x67')];if(!_0x84860e[_0x8742('0x3c')][_0x8742('0xd8')](_0x8742('0xd4'))){_0xf4a7c6['limit']=qs[_0x8742('0x1d')](_0x84860e['query'][_0x8742('0x1d')]);_0xf4a7c6[_0x8742('0x1c')]=qs[_0x8742('0x1c')](_0x84860e['query'][_0x8742('0x1c')]);}return _0x13ade9[_0x8742('0xe0')](_0xf4a7c6);}})[_0x8742('0xf')](function(_0x2e07ed){if(_0x2e07ed){return _0x2e07ed?{'count':_0x39fa74,'rows':_0x2e07ed}:null;}})[_0x8742('0xf')](respondWithResult(_0x44685a,null))['catch'](handleError(_0x44685a,null));};exports[_0x8742('0xe2')]=function(_0x99af21,_0x34d995){var _0x1d6fb7={};var _0x4e1de7={};var _0x2d8e77;var _0x2c4669;return db[_0x8742('0x36')][_0x8742('0xca')]({'where':{'id':_0x99af21[_0x8742('0x4e')]['id']}})['then'](handleEntityNotFound(_0x34d995,null))[_0x8742('0xf')](function(_0x457e18){if(_0x457e18){_0x2d8e77=_0x457e18;_0x4e1de7[_0x8742('0x4f')]=_[_0x8742('0x51')](db['OpenchannelInteraction'][_0x8742('0x37')]);_0x4e1de7['query']=_[_0x8742('0x51')](_0x99af21[_0x8742('0x3c')]);_0x4e1de7[_0x8742('0x53')]=_[_0x8742('0x54')](_0x4e1de7['model'],_0x4e1de7[_0x8742('0x3c')]);_0x1d6fb7['attributes']=_[_0x8742('0x54')](_0x4e1de7[_0x8742('0x4f')],qs[_0x8742('0x55')](_0x99af21['query'][_0x8742('0x55')]));_0x1d6fb7[_0x8742('0x42')]=_0x1d6fb7[_0x8742('0x42')][_0x8742('0x67')]?_0x1d6fb7[_0x8742('0x42')]:_0x4e1de7[_0x8742('0x4f')];_0x1d6fb7[_0x8742('0xcb')]=qs[_0x8742('0xcc')](_0x99af21[_0x8742('0x3c')][_0x8742('0xcc')]);_0x1d6fb7[_0x8742('0x3b')]=qs[_0x8742('0x53')](_[_0x8742('0xcd')](_0x99af21[_0x8742('0x3c')],_0x4e1de7[_0x8742('0x53')]));if(_0x99af21[_0x8742('0x3c')][_0x8742('0x2a')]){_0x1d6fb7['where']=_[_0x8742('0x56')](_0x1d6fb7[_0x8742('0x3b')],{'$or':_['map'](_0x1d6fb7['attributes'],function(_0x4f09b2){var _0x1ff030={};_0x1ff030[_0x4f09b2]={'$like':'%'+_0x99af21[_0x8742('0x3c')]['filter']+'%'};return _0x1ff030;})});}_0x1d6fb7=_[_0x8742('0x56')]({},_0x1d6fb7,_0x99af21[_0x8742('0xce')]);return _0x2d8e77[_0x8742('0xe2')](_0x1d6fb7);}})[_0x8742('0xf')](function(_0x2177da){if(_0x2177da){_0x2c4669=_0x2177da[_0x8742('0x67')];if(!_0x99af21['query'][_0x8742('0xd8')]('nolimit')){_0x1d6fb7['limit']=qs['limit'](_0x99af21[_0x8742('0x3c')]['limit']);_0x1d6fb7[_0x8742('0x1c')]=qs[_0x8742('0x1c')](_0x99af21[_0x8742('0x3c')]['offset']);}return _0x2d8e77[_0x8742('0xe2')](_0x1d6fb7);}})[_0x8742('0xf')](function(_0x2a3207){if(_0x2a3207){return _0x2a3207?{'count':_0x2c4669,'rows':_0x2a3207}:null;}})['then'](respondWithResult(_0x34d995,null))[_0x8742('0x19')](handleError(_0x34d995,null));};exports[_0x8742('0xe3')]=function(_0x125c06,_0x404c87){var _0x5f19f5={'raw':!![],'where':{}};var _0x1e8b93={};var _0x58a33f={'count':0x0,'rows':[]};return db[_0x8742('0x36')][_0x8742('0xca')]({'where':{'id':_0x125c06['params']['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x404c87,null))[_0x8742('0xf')](function(_0x5bfd4a){if(_0x5bfd4a){_0x1e8b93[_0x8742('0x4f')]=_['keys'](db[_0x8742('0xe4')]['rawAttributes']);_0x1e8b93[_0x8742('0x3c')]=_[_0x8742('0x51')](_0x125c06[_0x8742('0x3c')]);_0x1e8b93['filters']=_[_0x8742('0x54')](_0x1e8b93[_0x8742('0x4f')],_0x1e8b93[_0x8742('0x3c')]);_0x5f19f5['attributes']=_[_0x8742('0x54')](_0x1e8b93['model'],qs[_0x8742('0x55')](_0x125c06[_0x8742('0x3c')][_0x8742('0x55')]));_0x5f19f5['attributes']=_0x5f19f5['attributes'][_0x8742('0x67')]?_0x5f19f5[_0x8742('0x42')]:_0x1e8b93['model'];if(!_0x125c06['query'][_0x8742('0xd8')](_0x8742('0xd4'))){_0x5f19f5[_0x8742('0x1d')]=qs[_0x8742('0x1d')](_0x125c06['query'][_0x8742('0x1d')]);_0x5f19f5['offset']=qs[_0x8742('0x1c')](_0x125c06[_0x8742('0x3c')]['offset']);}_0x5f19f5[_0x8742('0xcb')]=qs[_0x8742('0xcc')](_0x125c06['query'][_0x8742('0xcc')]);_0x5f19f5[_0x8742('0x3b')]=qs[_0x8742('0x53')](_[_0x8742('0xcd')](_0x125c06[_0x8742('0x3c')],_0x1e8b93[_0x8742('0x53')]));_0x5f19f5['where']['UserId']=_0x5bfd4a['id'];if(_0x125c06[_0x8742('0x3c')][_0x8742('0x2a')]){_0x5f19f5[_0x8742('0x3b')]=_[_0x8742('0x56')](_0x5f19f5[_0x8742('0x3b')],{'$or':_[_0x8742('0x38')](_0x5f19f5[_0x8742('0x42')],function(_0x54b0a4){var _0x409c49={};_0x409c49[_0x54b0a4]={'$like':'%'+_0x125c06['query'][_0x8742('0x2a')]+'%'};return _0x409c49;})});}_0x5f19f5=_[_0x8742('0x56')]({},_0x5f19f5,_0x125c06[_0x8742('0xce')]);return db[_0x8742('0xe4')]['count']({'where':_0x5f19f5['where']})['then'](function(_0x498da2){_0x58a33f['count']=_0x498da2;if(_0x125c06[_0x8742('0x3c')]['includeAll']){_0x5f19f5[_0x8742('0x3e')]=[{'all':!![]}];}return db[_0x8742('0xe4')][_0x8742('0x44')](_0x5f19f5);})[_0x8742('0xf')](function(_0x2238f6){_0x58a33f['rows']=_0x2238f6;return _0x58a33f;});}})['then'](respondWithFilteredResult(_0x404c87,_0x5f19f5))['catch'](handleError(_0x404c87,null));};exports[_0x8742('0xe5')]=function(_0x1109c5,_0x3d5e7c){var _0x3af2da={};var _0x346787={};var _0x3db0aa;var _0x557e5e;return db[_0x8742('0x36')][_0x8742('0xca')]({'where':{'id':_0x1109c5[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x3d5e7c,null))[_0x8742('0xf')](function(_0x2b0b61){if(_0x2b0b61){_0x3db0aa=_0x2b0b61;_0x346787[_0x8742('0x4f')]=_[_0x8742('0x51')](db[_0x8742('0xe6')][_0x8742('0x37')]);_0x346787[_0x8742('0x3c')]=_[_0x8742('0x51')](_0x1109c5[_0x8742('0x3c')]);_0x346787[_0x8742('0x53')]=_[_0x8742('0x54')](_0x346787['model'],_0x346787[_0x8742('0x3c')]);_0x3af2da['attributes']=_[_0x8742('0x54')](_0x346787[_0x8742('0x4f')],qs[_0x8742('0x55')](_0x1109c5[_0x8742('0x3c')]['fields']));_0x3af2da['attributes']=_0x3af2da[_0x8742('0x42')][_0x8742('0x67')]?_0x3af2da[_0x8742('0x42')]:_0x346787['model'];_0x3af2da['order']=qs[_0x8742('0xcc')](_0x1109c5[_0x8742('0x3c')]['sort']);_0x3af2da[_0x8742('0x3b')]=qs[_0x8742('0x53')](_[_0x8742('0xcd')](_0x1109c5[_0x8742('0x3c')],_0x346787['filters']));if(_0x1109c5['query'][_0x8742('0x2a')]){_0x3af2da[_0x8742('0x3b')]=_[_0x8742('0x56')](_0x3af2da[_0x8742('0x3b')],{'$or':_['map'](_0x3af2da['attributes'],function(_0x1a6b63){var _0x5e9be4={};_0x5e9be4[_0x1a6b63]={'$like':'%'+_0x1109c5[_0x8742('0x3c')][_0x8742('0x2a')]+'%'};return _0x5e9be4;})});}_0x3af2da=_['merge']({},_0x3af2da,_0x1109c5[_0x8742('0xce')]);return _0x3db0aa['getSmsInteractions'](_0x3af2da);}})[_0x8742('0xf')](function(_0x21c08b){if(_0x21c08b){_0x557e5e=_0x21c08b[_0x8742('0x67')];if(!_0x1109c5[_0x8742('0x3c')][_0x8742('0xd8')](_0x8742('0xd4'))){_0x3af2da[_0x8742('0x1d')]=qs['limit'](_0x1109c5[_0x8742('0x3c')][_0x8742('0x1d')]);_0x3af2da[_0x8742('0x1c')]=qs[_0x8742('0x1c')](_0x1109c5[_0x8742('0x3c')][_0x8742('0x1c')]);}return _0x3db0aa[_0x8742('0xe5')](_0x3af2da);}})[_0x8742('0xf')](function(_0x13f651){if(_0x13f651){return _0x13f651?{'count':_0x557e5e,'rows':_0x13f651}:null;}})[_0x8742('0xf')](respondWithResult(_0x3d5e7c,null))[_0x8742('0x19')](handleError(_0x3d5e7c,null));};exports[_0x8742('0xe7')]=function(_0x4f7aea,_0x1a167f){var _0xd59a2={};var _0xa03a7f={};var _0x856281;var _0x4d40db;return db['User'][_0x8742('0xca')]({'where':{'id':_0x4f7aea[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x1a167f,null))[_0x8742('0xf')](function(_0x25fc4f){if(_0x25fc4f){_0x856281=_0x25fc4f;_0xa03a7f[_0x8742('0x4f')]=_[_0x8742('0x51')](db[_0x8742('0xe8')]['rawAttributes']);_0xa03a7f[_0x8742('0x3c')]=_[_0x8742('0x51')](_0x4f7aea[_0x8742('0x3c')]);_0xa03a7f[_0x8742('0x53')]=_['intersection'](_0xa03a7f[_0x8742('0x4f')],_0xa03a7f[_0x8742('0x3c')]);_0xd59a2[_0x8742('0x42')]=_[_0x8742('0x54')](_0xa03a7f[_0x8742('0x4f')],qs[_0x8742('0x55')](_0x4f7aea['query']['fields']));_0xd59a2[_0x8742('0x42')]=_0xd59a2[_0x8742('0x42')][_0x8742('0x67')]?_0xd59a2['attributes']:_0xa03a7f[_0x8742('0x4f')];_0xd59a2[_0x8742('0xcb')]=qs[_0x8742('0xcc')](_0x4f7aea[_0x8742('0x3c')]['sort']);_0xd59a2['where']=qs[_0x8742('0x53')](_['pick'](_0x4f7aea[_0x8742('0x3c')],_0xa03a7f[_0x8742('0x53')]));if(_0x4f7aea[_0x8742('0x3c')][_0x8742('0x2a')]){_0xd59a2['where']=_[_0x8742('0x56')](_0xd59a2[_0x8742('0x3b')],{'$or':_[_0x8742('0x38')](_0xd59a2[_0x8742('0x42')],function(_0x521a1f){var _0x5c8278={};_0x5c8278[_0x521a1f]={'$like':'%'+_0x4f7aea['query'][_0x8742('0x2a')]+'%'};return _0x5c8278;})});}_0xd59a2=_[_0x8742('0x56')]({},_0xd59a2,_0x4f7aea[_0x8742('0xce')]);return _0x856281[_0x8742('0xe7')](_0xd59a2);}})[_0x8742('0xf')](function(_0x2627ff){if(_0x2627ff){_0x4d40db=_0x2627ff[_0x8742('0x67')];if(!_0x4f7aea['query'][_0x8742('0xd8')](_0x8742('0xd4'))){_0xd59a2[_0x8742('0x1d')]=qs[_0x8742('0x1d')](_0x4f7aea[_0x8742('0x3c')]['limit']);_0xd59a2['offset']=qs['offset'](_0x4f7aea[_0x8742('0x3c')][_0x8742('0x1c')]);}return _0x856281[_0x8742('0xe7')](_0xd59a2);}})[_0x8742('0xf')](function(_0x2c3979){if(_0x2c3979){return _0x2c3979?{'count':_0x4d40db,'rows':_0x2c3979}:null;}})[_0x8742('0xf')](respondWithResult(_0x1a167f,null))[_0x8742('0x19')](handleError(_0x1a167f,null));};exports[_0x8742('0xe9')]=function(_0x28c90f,_0x2e73bc){var _0x389895={};var _0xd2cb9b={};var _0x50deba;var _0x508d1d;return db['User']['findOne']({'where':{'id':_0x28c90f[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x2e73bc,null))[_0x8742('0xf')](function(_0x15bce5){if(_0x15bce5){_0x50deba=_0x15bce5;_0xd2cb9b['model']=_[_0x8742('0x51')](db[_0x8742('0xea')][_0x8742('0x37')]);_0xd2cb9b[_0x8742('0x3c')]=_[_0x8742('0x51')](_0x28c90f[_0x8742('0x3c')]);_0xd2cb9b[_0x8742('0x53')]=_[_0x8742('0x54')](_0xd2cb9b['model'],_0xd2cb9b[_0x8742('0x3c')]);_0x389895[_0x8742('0x42')]=_[_0x8742('0x54')](_0xd2cb9b[_0x8742('0x4f')],qs[_0x8742('0x55')](_0x28c90f['query']['fields']));_0x389895[_0x8742('0x42')]=_0x389895['attributes'][_0x8742('0x67')]?_0x389895[_0x8742('0x42')]:_0xd2cb9b[_0x8742('0x4f')];_0x389895[_0x8742('0xcb')]=qs[_0x8742('0xcc')](_0x28c90f[_0x8742('0x3c')][_0x8742('0xcc')]);_0x389895['where']=qs['filters'](_[_0x8742('0xcd')](_0x28c90f[_0x8742('0x3c')],_0xd2cb9b['filters']));if(_0x28c90f['query']['filter']){_0x389895[_0x8742('0x3b')]=_[_0x8742('0x56')](_0x389895[_0x8742('0x3b')],{'$or':_[_0x8742('0x38')](_0x389895['attributes'],function(_0x33750c){var _0x44ebee={};_0x44ebee[_0x33750c]={'$like':'%'+_0x28c90f[_0x8742('0x3c')]['filter']+'%'};return _0x44ebee;})});}_0x389895=_[_0x8742('0x56')]({},_0x389895,_0x28c90f[_0x8742('0xce')]);return _0x50deba[_0x8742('0xe9')](_0x389895);}})[_0x8742('0xf')](function(_0x371914){if(_0x371914){_0x508d1d=_0x371914[_0x8742('0x67')];if(!_0x28c90f['query'][_0x8742('0xd8')](_0x8742('0xd4'))){_0x389895[_0x8742('0x1d')]=qs[_0x8742('0x1d')](_0x28c90f[_0x8742('0x3c')][_0x8742('0x1d')]);_0x389895[_0x8742('0x1c')]=qs['offset'](_0x28c90f[_0x8742('0x3c')]['offset']);}return _0x50deba['getWhatsappInteractions'](_0x389895);}})[_0x8742('0xf')](function(_0x14689e){if(_0x14689e){return _0x14689e?{'count':_0x508d1d,'rows':_0x14689e}:null;}})[_0x8742('0xf')](respondWithResult(_0x2e73bc,null))[_0x8742('0x19')](handleError(_0x2e73bc,null));};exports['login']=function(_0x5bd406,_0x3fcc78,_0x4320d9){var _0x1dab96;var _0x270d34;var _0x4cc0ae;var _0x1ad502=!_[_0x8742('0x61')](_0x5bd406[_0x8742('0x4e')]['id'])?_0x5bd406[_0x8742('0x4e')]['id']:!_[_0x8742('0x61')](_0x5bd406[_0x8742('0x7e')]['id'])?_0x5bd406['user']['id']:null;return db[_0x8742('0x36')][_0x8742('0x2e')]({'where':{'id':_0x1ad502,'role':{'$or':[_0x8742('0x25'),_0x8742('0x7e'),_0x8742('0x6d')]}},'attributes':['id',_0x8742('0x30'),_0x8742('0xeb'),_0x8742('0xec'),'role',_0x8742('0x5d'),_0x8742('0xed')]})[_0x8742('0xf')](function(_0x1e709b){if(_0x1e709b){if(_0x1e709b[_0x8742('0x2f')]===_0x8742('0x6d')){_0x1dab96=_0x1e709b;if(_0x5bd406[_0x8742('0x59')][_0x8742('0x9e')]){_0x4cc0ae=util[_0x8742('0xaa')](_0x8742('0xee'),_0x1dab96[_0x5bd406['body']['interface']]);}else if(_0x5bd406[_0x8742('0x59')][_0x8742('0xef')]){_0x4cc0ae=util['format'](_0x8742('0xab'),_0x5bd406[_0x8742('0x59')]['intrf']);}else{_0x4cc0ae=util[_0x8742('0xaa')](_0x8742('0xab'),_0x1dab96[_0x8742('0x30')]);}socket['to'](util[_0x8742('0xaa')](_0x8742('0xf0'),_0x1dab96[_0x8742('0x30')]))['emit'](_0x8742('0xf1'),{'user':{'id':_0x1dab96['id'],'name':_0x1dab96[_0x8742('0x30')]},'ip':_0x5bd406[_0x8742('0xf2')][_0x8742('0xf3')]||_0x5bd406['connection']['remoteAddress']||_0x5bd406['socket'][_0x8742('0xf4')]||_0x5bd406['connection'][_0x8742('0xf5')][_0x8742('0xf4')]});return db[_0x8742('0xad')][_0x8742('0x23')]({'where':{'membername':_0x1dab96['name']},'individualHooks':!![]});}}else{throw new db[(_0x8742('0x8f'))][(_0x8742('0x90'))](_0x8742('0xf6'));}})['then'](function(){if(_0x1dab96){return _0x1dab96['getVoiceQueues']({'raw':!![]});}})[_0x8742('0xf')](function(_0x46d3da){if(_0x1dab96){var _0x2e751e=[];if(_0x46d3da){_0x270d34=_0x46d3da;if(_0x270d34['length']){for(var _0x4dc469=0x0;_0x4dc469<_0x270d34[_0x8742('0x67')];_0x4dc469++){_0x2e751e[_0x8742('0x43')]({'membername':_0x1dab96[_0x8742('0x30')],'UserId':_0x1dab96['id'],'queue_name':_0x270d34[_0x4dc469][_0x8742('0x30')],'VoiceQueueId':_0x270d34[_0x4dc469]['id'],'interface':_0x4cc0ae,'paused':_0x1dab96[_0x8742('0xed')]||![],'penalty':_0x270d34[_0x4dc469][_0x8742('0xf7')]||0x0});}return BPromise[_0x8742('0x88')](_0x2e751e,function(_0x278c59){return db['UserVoiceQueueRt'][_0x8742('0xae')](_0x278c59);});}}}})[_0x8742('0xf')](function(){if(_0x1dab96){return db[_0x8742('0xf8')][_0x8742('0x44')]({'where':{'membername':_0x1dab96[_0x8742('0x30')],'exitAt':null}});}})[_0x8742('0xf')](function(_0x2c305f){if(_0x1dab96){var _0x3ac7c2=[];_0x2c305f[_0x8742('0xf9')](function(_0x28af24){_0x3ac7c2[_0x8742('0x43')](_0x28af24[_0x8742('0x22')]({'exitAt':moment()[_0x8742('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x8742('0x4c')](_0x3ac7c2);}})[_0x8742('0xf')](function(){if(_0x1dab96){var _0x5e9210=[];var _0x2208ce=[];var _0x176872=utils[_0x8742('0xfa')]();var _0x55350f={'membername':_0x1dab96[_0x8742('0x30')],'interface':_0x4cc0ae,'enterAt':moment()[_0x8742('0xaa')](_0x8742('0xfb')),'role':_0x1dab96['role'],'internal':_0x1dab96[_0x8742('0x5d')]};_0x176872['forEach'](function(_0x139a5e){_0x5e9210[_0x8742('0x43')](_[_0x8742('0x56')]({'channel':_0x139a5e,'type':_0x8742('0xfc'),'data1':_0x5bd406[_0x8742('0x59')][_0x8742('0xfd')],'data2':_0x4cc0ae},_0x55350f));if(_0x1dab96[_0x8742('0xed')]){_0x2208ce[_0x8742('0x43')](_[_0x8742('0x56')]({'channel':_0x139a5e,'type':'PAUSE','data1':_0x8742('0xfe')},_0x55350f));}});return db['MemberReport'][_0x8742('0xff')](_0x5e9210['concat'](_0x2208ce),{'individualHooks':!![]});}})[_0x8742('0xf')](function(){if(_0x1dab96){return _0x1dab96[_0x8742('0x22')]({'online':!![],'lastLoginAt':moment()[_0x8742('0xaa')](_0x8742('0xfb')),'voicePause':_0x1dab96['loginInPause']||![],'mailPause':_0x1dab96[_0x8742('0xed')]||![],'chatPause':_0x1dab96[_0x8742('0xed')]||![],'faxPause':_0x1dab96[_0x8742('0xed')]||![],'smsPause':_0x1dab96['loginInPause']||![],'openchannelPause':_0x1dab96[_0x8742('0xed')]||![],'whatsappPause':_0x1dab96[_0x8742('0xed')]||![],'pauseType':_0x1dab96[_0x8742('0xed')]?'LOGININPAUSE':null,'interface':_0x4cc0ae,'lastPauseAt':moment()[_0x8742('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x8742('0xf')](function(_0x46d895){if(_0x5bd406[_0x8742('0x100')]){return _0x4320d9();}else{return BPromise[_0x8742('0x101')](_0x46d895)[_0x8742('0xf')](respondWithResult(_0x3fcc78,null));}})[_0x8742('0x19')](handleError(_0x3fcc78,null));};exports[_0x8742('0x102')]=function(_0x10d164,_0x2d618c){var _0x5df56a;return db[_0x8742('0x36')][_0x8742('0x2e')]({'where':{'id':_0x10d164[_0x8742('0x4e')]['id'],'role':_0x8742('0x6d')},'attributes':['id','name',_0x8742('0x2f')]})[_0x8742('0xf')](handleEntityNotFound(_0x2d618c,null))[_0x8742('0xf')](function(_0x6151b0){if(_0x6151b0){_0x5df56a=_0x6151b0;return db[_0x8742('0xad')][_0x8742('0x23')]({'where':{'membername':_0x5df56a[_0x8742('0x30')]},'individualHooks':!![]});}})['then'](function(){return db[_0x8742('0xf8')][_0x8742('0x44')]({'where':{'membername':_0x5df56a['name'],'exitAt':null}});})['then'](function(_0x244ac1){var _0x49d7a3=[];_0x244ac1['forEach'](function(_0xe3fbaa){_0x49d7a3[_0x8742('0x43')](_0xe3fbaa['update']({'exitAt':moment()[_0x8742('0xaa')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x8742('0x4c')](_0x49d7a3);})[_0x8742('0xf')](function(){return _0x5df56a[_0x8742('0x22')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x8742('0xf')](respondWithResult(_0x2d618c,null))[_0x8742('0x19')](handleError(_0x2d618c,null));};exports[_0x8742('0x103')]=function(_0x381cb7,_0x16ef22){var _0x5d7e55;return db[_0x8742('0xad')]['update']({'paused':0x1},{'where':{'UserId':_0x381cb7[_0x8742('0x4e')]['id']},'individualHooks':!![]})[_0x8742('0xf')](function(){return db[_0x8742('0x36')][_0x8742('0x2e')]({'where':{'id':_0x381cb7[_0x8742('0x4e')]['id'],'role':_0x8742('0x6d')},'attributes':['id',_0x8742('0x30'),_0x8742('0x2f'),_0x8742('0x5d'),_0x8742('0x9e')]});})[_0x8742('0xf')](handleEntityNotFound(_0x16ef22,null))['then'](function(_0x5f44e1){if(_0x5f44e1){_0x5d7e55=_0x5f44e1;return respondWithRpcPromise(_0x8742('0x104'),_0x8742('0x103'),{'id':_0x5d7e55['id'],'name':_0x5d7e55[_0x8742('0x30')],'pause':!![]});}})['then'](function(){if(_0x5d7e55){return db[_0x8742('0xf8')]['findAll']({'where':{'membername':_0x5d7e55[_0x8742('0x30')],'type':_0x8742('0x105'),'exitAt':null}});}})[_0x8742('0xf')](function(_0x22b43b){if(_0x22b43b[_0x8742('0x67')]){var _0x30b34d=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x510dc1=0x0,_0x1aab8d=_0x22b43b[_0x8742('0x67')];_0x510dc1<_0x1aab8d;_0x510dc1++){_0x22b43b[_0x510dc1][_0x8742('0x106')]({'exitAt':_0x30b34d});}}})[_0x8742('0xf')](function(){var _0x2371a9=[];var _0x5d300f=utils[_0x8742('0xfa')]();_0x5d300f[_0x8742('0xf9')](function(_0x584e01){_0x2371a9[_0x8742('0x43')]({'channel':_0x584e01,'membername':_0x5d7e55[_0x8742('0x30')],'interface':_[_0x8742('0x61')](_0x5d7e55[_0x8742('0x9e')])?util[_0x8742('0xaa')](_0x8742('0xab'),_0x5d7e55[_0x8742('0x30')]):_0x5d7e55[_0x8742('0x9e')],'type':_0x8742('0x105'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x381cb7[_0x8742('0x59')]['type']||_0x8742('0x107'),'role':_0x5d7e55['role'],'internal':_0x5d7e55[_0x8742('0x5d')]});});return db[_0x8742('0xf8')][_0x8742('0xff')](_0x2371a9,{'individualHooks':!![]});})[_0x8742('0xf')](function(){return _0x5d7e55['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x381cb7[_0x8742('0x59')][_0x8742('0x39')]||_0x8742('0x107'),'lastPauseAt':moment()[_0x8742('0xaa')](_0x8742('0xfb'))});})['then'](respondWithResult(_0x16ef22,null))['catch'](handleError(_0x16ef22,null));};exports['unpause']=function(_0x350141,_0x5475d1){var _0x180928;return db[_0x8742('0x36')][_0x8742('0x2e')]({'where':{'id':_0x350141['params']['id']},'attributes':['id',_0x8742('0x30'),'role',_0x8742('0xac'),'mailPause',_0x8742('0x108'),_0x8742('0x109'),_0x8742('0x10a'),_0x8742('0x10b'),_0x8742('0x10c'),_0x8742('0x10d'),_0x8742('0x10e')]})[_0x8742('0xf')](handleEntityNotFound(_0x5475d1,null))['then'](function(_0x2535f3){if(_0x2535f3){_0x180928=_0x2535f3;if(_0x350141[_0x8742('0x59')][_0x8742('0x9c')]&&!utils[_0x8742('0xb0')](_0x350141[_0x8742('0x59')]['channel'])){throw new db[(_0x8742('0x8f'))]['ValidationError'](_0x8742('0x9f'));}switch(_0x350141['body'][_0x8742('0x9c')]){case _0x8742('0xa8'):return respondWithRpcPromise(_0x8742('0x104'),_0x8742('0x10f'),{'id':_0x180928['id'],'name':_0x180928[_0x8742('0x30')],'pause':![]})[_0x8742('0xf')](function(){return db[_0x8742('0xad')][_0x8742('0x22')]({'paused':0x0},{'where':{'UserId':_0x180928['id']},'individualHooks':!![]});})['then'](function(){return db[_0x8742('0xf8')][_0x8742('0x2e')]({'where':{'channel':_0x350141[_0x8742('0x59')]['channel'],'membername':_0x180928[_0x8742('0x30')],'type':_0x8742('0x105'),'exitAt':null}});})['then'](function(_0x236a32){if(_0x236a32){return _0x236a32[_0x8742('0x22')]({'exitAt':moment()[_0x8742('0xaa')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x8742('0x110')},{'individualHooks':!![]});}return null;})[_0x8742('0xf')](function(){return _0x180928[_0x8742('0x22')]({'voicePause':![]});});case'mail':case _0x8742('0x47'):case _0x8742('0x49'):case _0x8742('0x57'):case _0x8742('0x4b'):case _0x8742('0x58'):return db['MemberReport'][_0x8742('0x2e')]({'where':{'channel':_0x350141[_0x8742('0x59')][_0x8742('0x9c')],'membername':_0x180928[_0x8742('0x30')],'type':_0x8742('0x105'),'exitAt':null}})['then'](function(_0xc99ce1){if(_0xc99ce1){return _0xc99ce1[_0x8742('0x22')]({'exitAt':moment()[_0x8742('0xaa')](_0x8742('0xfb')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x8742('0xf')](function(){var _0xda9b0c={};_[_0x8742('0x20')](_0xda9b0c,util[_0x8742('0xaa')]('%s%s',_0x350141[_0x8742('0x59')][_0x8742('0x9c')],_0x8742('0x111')),![]);return _0x180928[_0x8742('0x22')](_0xda9b0c);});default:return respondWithRpcPromise(_0x8742('0x104'),_0x8742('0x10f'),{'id':_0x180928['id'],'name':_0x180928[_0x8742('0x30')],'pause':![]})[_0x8742('0xf')](function(){return db[_0x8742('0xad')][_0x8742('0x22')]({'paused':0x0},{'where':{'UserId':_0x180928['id']}});})[_0x8742('0xf')](function(){return db[_0x8742('0xf8')]['findAll']({'where':{'membername':_0x180928['name'],'type':_0x8742('0x105'),'exitAt':null}});})[_0x8742('0xf')](function(_0x5315ae){var _0x413bf4=[];_0x5315ae[_0x8742('0xf9')](function(_0x5891d1){_0x413bf4['push'](_0x5891d1[_0x8742('0x22')]({'exitAt':moment()['format'](_0x8742('0xfb')),'data2':_0x8742('0x110')}));});return BPromise[_0x8742('0x4c')](_0x413bf4);})[_0x8742('0xf')](function(){return _0x180928[_0x8742('0x22')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x8742('0xf')](respondWithResult(_0x5475d1,null))[_0x8742('0x19')](handleError(_0x5475d1,null));};exports[_0x8742('0x112')]=function(_0xd54c8,_0x42930f){var _0x32a3ec={};var _0x1808ee={};var _0x25229b;var _0x2c12f3;return db[_0x8742('0x36')][_0x8742('0xca')]({'where':{'id':_0xd54c8[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x42930f,null))[_0x8742('0xf')](function(_0x22ca11){if(_0x22ca11){_0x25229b=_0x22ca11;_0x1808ee[_0x8742('0x4f')]=_[_0x8742('0x51')](db[_0x8742('0x113')][_0x8742('0x37')]);_0x1808ee[_0x8742('0x3c')]=_[_0x8742('0x51')](_0xd54c8[_0x8742('0x3c')]);_0x1808ee[_0x8742('0x53')]=_[_0x8742('0x54')](_0x1808ee[_0x8742('0x4f')],_0x1808ee[_0x8742('0x3c')]);_0x32a3ec[_0x8742('0x42')]=_[_0x8742('0x54')](_0x1808ee[_0x8742('0x4f')],qs[_0x8742('0x55')](_0xd54c8[_0x8742('0x3c')]['fields']));_0x32a3ec[_0x8742('0x42')]=_0x32a3ec[_0x8742('0x42')][_0x8742('0x67')]?_0x32a3ec['attributes']:_0x1808ee[_0x8742('0x4f')];_0x32a3ec[_0x8742('0xcb')]=qs[_0x8742('0xcc')](_0xd54c8[_0x8742('0x3c')][_0x8742('0xcc')]);_0x32a3ec[_0x8742('0x3b')]=qs[_0x8742('0x53')](_['pick'](_0xd54c8[_0x8742('0x3c')],_0x1808ee[_0x8742('0x53')]));if(_0xd54c8[_0x8742('0x3c')][_0x8742('0x2a')]){_0x32a3ec[_0x8742('0x3b')]=_[_0x8742('0x56')](_0x32a3ec[_0x8742('0x3b')],{'$or':_[_0x8742('0x38')](_0x32a3ec[_0x8742('0x42')],function(_0x24828b){var _0x331a02={};_0x331a02[_0x24828b]={'$like':'%'+_0xd54c8[_0x8742('0x3c')][_0x8742('0x2a')]+'%'};return _0x331a02;})});}_0x32a3ec=_[_0x8742('0x56')]({},_0x32a3ec,_0xd54c8[_0x8742('0xce')]);return _0x25229b[_0x8742('0x112')](_0x32a3ec);}})[_0x8742('0xf')](function(_0x51b6fc){if(_0x51b6fc){_0x2c12f3=_0x51b6fc[_0x8742('0x67')];if(!_0xd54c8[_0x8742('0x3c')][_0x8742('0xd8')](_0x8742('0xd4'))){_0x32a3ec[_0x8742('0x1d')]=qs[_0x8742('0x1d')](_0xd54c8[_0x8742('0x3c')][_0x8742('0x1d')]);_0x32a3ec['offset']=qs['offset'](_0xd54c8[_0x8742('0x3c')][_0x8742('0x1c')]);}return _0x25229b[_0x8742('0x112')](_0x32a3ec);}})[_0x8742('0xf')](function(_0x49156e){if(_0x49156e){return _0x49156e?{'count':_0x2c12f3,'rows':_0x49156e}:null;}})[_0x8742('0xf')](respondWithResult(_0x42930f,null))[_0x8742('0x19')](handleError(_0x42930f,null));};exports[_0x8742('0x114')]=function(_0x18b4c3,_0x5919f4){return db[_0x8742('0x36')][_0x8742('0x2e')]({'where':{'id':_0x18b4c3[_0x8742('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5919f4,null))[_0x8742('0xf')](function(_0x8dd9f2){if(_0x8dd9f2){var _0x3bde0f=_0x8dd9f2['get']({'plain':!![]});return _0x8dd9f2[_0x8742('0x114')](_0x18b4c3[_0x8742('0x59')][_0x8742('0x5c')],_[_0x8742('0x115')](_0x18b4c3[_0x8742('0x59')],['ids','id'])||{})[_0x8742('0xf')](function(){for(var _0x147ba9=0x0;_0x147ba9<_0x18b4c3[_0x8742('0x59')][_0x8742('0x5c')][_0x8742('0x67')];_0x147ba9++){var _0x4f1e74=[];var _0x27b195={};db[_0x8742('0x113')][_0x8742('0xca')]({'where':{'id':_0x18b4c3[_0x8742('0x59')][_0x8742('0x5c')][_0x147ba9]}})[_0x8742('0xf')](function(_0xcc6a11){_0x27b195=_0xcc6a11[_0x8742('0x48')];_0x4f1e74[_0x8742('0x43')](_0xcc6a11['getVoiceQueues']()[_0x8742('0xf')](function(_0x3d0980){for(var _0xaf4284=0x0;_0xaf4284<_0x3d0980[_0x8742('0x67')];_0xaf4284++){_0x3d0980[_0xaf4284][_0x8742('0x116')](_0x8742('0x9c'),_0x8742('0x117'));}return _0x3d0980;}));_0x4f1e74[_0x8742('0x43')](_0xcc6a11[_0x8742('0x118')]()['then'](function(_0x59ebb1){for(var _0x130c2e=0x0;_0x130c2e<_0x59ebb1[_0x8742('0x67')];_0x130c2e++){_0x59ebb1[_0x130c2e]['setDataValue']('channel',_0x8742('0x119'));}return _0x59ebb1;}));_0x4f1e74[_0x8742('0x43')](_0xcc6a11[_0x8742('0x11a')]()[_0x8742('0xf')](function(_0x33f408){for(var _0x1a4e32=0x0;_0x1a4e32<_0x33f408[_0x8742('0x67')];_0x1a4e32++){_0x33f408[_0x1a4e32][_0x8742('0x116')]('channel',_0x8742('0x11b'));}return _0x33f408;}));_0x4f1e74[_0x8742('0x43')](_0xcc6a11[_0x8742('0x11c')]()['then'](function(_0x5cb5c2){for(var _0x56feca=0x0;_0x56feca<_0x5cb5c2[_0x8742('0x67')];_0x56feca++){_0x5cb5c2[_0x56feca]['setDataValue'](_0x8742('0x9c'),_0x8742('0x11d'));}return _0x5cb5c2;}));_0x4f1e74[_0x8742('0x43')](_0xcc6a11[_0x8742('0x11e')]()[_0x8742('0xf')](function(_0x16d228){for(var _0x2799f4=0x0;_0x2799f4<_0x16d228['length'];_0x2799f4++){_0x16d228[_0x2799f4][_0x8742('0x116')]('channel',_0x8742('0x11f'));}return _0x16d228;}));_0x4f1e74[_0x8742('0x43')](_0xcc6a11[_0x8742('0x120')]()[_0x8742('0xf')](function(_0x4714ef){for(var _0x27605d=0x0;_0x27605d<_0x4714ef[_0x8742('0x67')];_0x27605d++){_0x4714ef[_0x27605d][_0x8742('0x116')](_0x8742('0x9c'),_0x8742('0x121'));}return _0x4714ef;}));_0x4f1e74['push'](_0xcc6a11[_0x8742('0x122')]()[_0x8742('0xf')](function(_0x122363){for(var _0x168af1=0x0;_0x168af1<_0x122363[_0x8742('0x67')];_0x168af1++){_0x122363[_0x168af1][_0x8742('0x116')](_0x8742('0x9c'),_0x8742('0x123'));}return _0x122363;}));return BPromise['all'](_0x4f1e74);})[_0x8742('0xf')](function(_0x43b42a){var _0x3c0c62=_[_0x8742('0x124')](_0x43b42a);_0x4f1e74=[];return db[_0x8742('0x63')][_0x8742('0x125')](function(_0x52a80e){for(var _0x53bb5c=0x0;_0x53bb5c<_0x3c0c62[_0x8742('0x67')];_0x53bb5c++){_0x4f1e74['push'](_0x3c0c62[_0x53bb5c][_0x8742('0x126')](_0x3bde0f['id']),{'transaction':_0x52a80e});}return BPromise[_0x8742('0x4c')](_0x4f1e74)[_0x8742('0xf')](function(){if(_0x3bde0f['online']){return BPromise['each'](_[_0x8742('0x2a')](_0x3c0c62,function(_0x3e72d0){return _0x3e72d0[_0x8742('0x127')](_0x8742('0x9c'))==='Voice';}),function(_0xf1c2b0){return db[_0x8742('0xad')][_0x8742('0xae')]({'membername':_0x3bde0f[_0x8742('0x30')],'UserId':_0x3bde0f['id'],'queue_name':_0xf1c2b0[_0x8742('0x30')],'VoiceQueueId':_0xf1c2b0['id'],'interface':_[_0x8742('0x61')](_0x3bde0f[_0x8742('0x9e')])?util[_0x8742('0xaa')](_0x8742('0xab'),_0x3bde0f[_0x8742('0x30')]):_0x3bde0f[_0x8742('0x9e')],'paused':_0x3bde0f[_0x8742('0xac')]||![],'penalty':_0x3bde0f[_0x8742('0xa3')]},{'transaction':_0x52a80e});});}else{return;}})[_0x8742('0xf')](function(){for(var _0x4513c7=0x0;_0x4513c7<_0x3c0c62['length'];_0x4513c7++){var _0x51bc42=_0x3c0c62[_0x4513c7]['getDataValue']('channel');var _0x392220=_0x51bc42+'QueueId';socket[_0x8742('0xb3')]('user'+_0x51bc42+_0x8742('0xa7'),{'UserId':_0x3bde0f['id'],['queueField']:_0x3c0c62[_0x4513c7]['id']});}});});})[_0x8742('0xf')](function(){db[_0x8742('0x128')][_0x8742('0xca')]({'where':{'teamId':_0x27b195['id']}})['then'](function(_0x78a940){if(_0x78a940){db[_0x8742('0x129')][_0x8742('0x7d')]({'UserId':_0x18b4c3[_0x8742('0x4e')]['id'],'VoicePrefixId':_0x78a940[_0x8742('0x12a')]});}});});}});}})[_0x8742('0xf')](respondWithStatusCode(_0x5919f4,null))[_0x8742('0x19')](handleError(_0x5919f4,null));};exports[_0x8742('0x12b')]=function(_0x4fb62f,_0x4084f7){return db['User']['findOne']({'where':{'id':_0x4fb62f[_0x8742('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4084f7,null))[_0x8742('0xf')](function(_0x322b81){if(_0x322b81){var _0x167e64=_0x322b81['get']({'plain':!![]});var _0xd13ed9=_0x4fb62f['query']['ids'];return _0x322b81[_0x8742('0x12b')](_0xd13ed9)[_0x8742('0xf')](function(){for(var _0x1d0340=0x0;_0x1d0340<_0xd13ed9['length'];_0x1d0340++){var _0x1e290f=[];var _0x130149={};db[_0x8742('0x113')][_0x8742('0xca')]({'where':{'id':_0xd13ed9[_0x1d0340]}})[_0x8742('0xf')](function(_0x3030a1){_0x130149=_0x3030a1['dataValues'];_0x1e290f[_0x8742('0x43')](_0x3030a1[_0x8742('0x12c')]()['then'](function(_0x345953){for(var _0x1e74da=0x0;_0x1e74da<_0x345953[_0x8742('0x67')];_0x1e74da++){_0x345953[_0x1e74da][_0x8742('0x116')](_0x8742('0x9c'),_0x8742('0x117'));}return _0x345953;}));_0x1e290f[_0x8742('0x43')](_0x3030a1[_0x8742('0x118')]()[_0x8742('0xf')](function(_0x17d3f9){for(var _0x5dfe0e=0x0;_0x5dfe0e<_0x17d3f9['length'];_0x5dfe0e++){_0x17d3f9[_0x5dfe0e][_0x8742('0x116')](_0x8742('0x9c'),_0x8742('0x119'));}return _0x17d3f9;}));_0x1e290f['push'](_0x3030a1[_0x8742('0x11a')]()['then'](function(_0x587309){for(var _0x39ec26=0x0;_0x39ec26<_0x587309[_0x8742('0x67')];_0x39ec26++){_0x587309[_0x39ec26][_0x8742('0x116')](_0x8742('0x9c'),_0x8742('0x11b'));}return _0x587309;}));_0x1e290f['push'](_0x3030a1[_0x8742('0x11c')]()[_0x8742('0xf')](function(_0x231640){for(var _0x4449f7=0x0;_0x4449f7<_0x231640[_0x8742('0x67')];_0x4449f7++){_0x231640[_0x4449f7][_0x8742('0x116')](_0x8742('0x9c'),_0x8742('0x11d'));}return _0x231640;}));_0x1e290f[_0x8742('0x43')](_0x3030a1[_0x8742('0x11e')]()[_0x8742('0xf')](function(_0x1c059d){for(var _0xe9795f=0x0;_0xe9795f<_0x1c059d[_0x8742('0x67')];_0xe9795f++){_0x1c059d[_0xe9795f]['setDataValue'](_0x8742('0x9c'),_0x8742('0x11f'));}return _0x1c059d;}));_0x1e290f[_0x8742('0x43')](_0x3030a1['getFaxQueues']()['then'](function(_0x464fdd){for(var _0x3ad48b=0x0;_0x3ad48b<_0x464fdd[_0x8742('0x67')];_0x3ad48b++){_0x464fdd[_0x3ad48b][_0x8742('0x116')]('channel','Fax');}return _0x464fdd;}));_0x1e290f[_0x8742('0x43')](_0x3030a1[_0x8742('0x122')]()[_0x8742('0xf')](function(_0x122d6c){for(var _0x4d7a67=0x0;_0x4d7a67<_0x122d6c[_0x8742('0x67')];_0x4d7a67++){_0x122d6c[_0x4d7a67][_0x8742('0x116')](_0x8742('0x9c'),'Openchannel');}return _0x122d6c;}));return BPromise[_0x8742('0x4c')](_0x1e290f);})[_0x8742('0xf')](function(_0x232e3a){var _0x3193bc=_['flatten'](_0x232e3a);_0x1e290f=[];return db[_0x8742('0x63')]['transaction'](function(_0x2dc78f){for(var _0x55fc10=0x0;_0x55fc10<_0x3193bc[_0x8742('0x67')];_0x55fc10++){_0x1e290f[_0x8742('0x43')](_0x3193bc[_0x55fc10][_0x8742('0x12d')](_0x167e64['id']),{'transaction':_0x2dc78f});}return BPromise[_0x8742('0x4c')](_0x1e290f)['then'](function(){if(_0x167e64[_0x8742('0x9d')]){return BPromise[_0x8742('0x88')](_[_0x8742('0x2a')](_0x3193bc,function(_0x4e0d0c){return _0x4e0d0c['getDataValue']('channel')===_0x8742('0x117');}),function(_0x1d7589){return db[_0x8742('0xad')][_0x8742('0x23')]({'where':{'VoiceQueueId':_0x1d7589['id'],'UserId':_0x167e64['id']},'transaction':_0x2dc78f});});}else{return;}})[_0x8742('0xf')](function(){db[_0x8742('0x128')][_0x8742('0xca')]({'where':{'teamId':_0x130149['id']}})['then'](function(_0xd11878){if(_0xd11878){return db['UserVoicePrefix'][_0x8742('0x23')]({'where':{'UserId':_0x167e64['id'],'VoicePrefixId':_0xd11878[_0x8742('0x48')][_0x8742('0x12a')]}});}});})['then'](function(){for(var _0x24df5b=0x0;_0x24df5b<_0x3193bc['length'];_0x24df5b++){var _0x119728=_0x3193bc[_0x24df5b][_0x8742('0x127')](_0x8742('0x9c'));var _0x64dac3=_0x119728+_0x8742('0xa6');socket[_0x8742('0xb3')](_0x8742('0x7e')+_0x119728+'Queue:remove',{'UserId':_0x167e64['id'],['queueField']:_0x3193bc[_0x24df5b]['id']});}});});});}});}})[_0x8742('0xf')](respondWithStatusCode(_0x4084f7,null))[_0x8742('0x19')](handleError(_0x4084f7,null));};exports[_0x8742('0x12e')]=function(_0x5e100a,_0x5e088e){var _0x2fbccf={};var _0x98caa6={};var _0x5a981f;var _0x430d06;return db[_0x8742('0x36')]['findOne']({'where':{'id':_0x5e100a['params']['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x5e088e,null))[_0x8742('0xf')](function(_0x184fc3){if(_0x184fc3){_0x5a981f=_0x184fc3;_0x98caa6['model']=_[_0x8742('0x51')](db[_0x8742('0xcf')][_0x8742('0x37')]);_0x98caa6['query']=_[_0x8742('0x51')](_0x5e100a['query']);_0x98caa6[_0x8742('0x53')]=_['intersection'](_0x98caa6['model'],_0x98caa6['query']);_0x2fbccf[_0x8742('0x42')]=_[_0x8742('0x54')](_0x98caa6[_0x8742('0x4f')],qs[_0x8742('0x55')](_0x5e100a['query'][_0x8742('0x55')]));_0x2fbccf[_0x8742('0x42')]=_0x2fbccf[_0x8742('0x42')]['length']?_0x2fbccf['attributes']:_0x98caa6[_0x8742('0x4f')];_0x2fbccf[_0x8742('0xcb')]=qs[_0x8742('0xcc')](_0x5e100a[_0x8742('0x3c')][_0x8742('0xcc')]);_0x2fbccf[_0x8742('0x3b')]=qs['filters'](_[_0x8742('0xcd')](_0x5e100a[_0x8742('0x3c')],_0x98caa6[_0x8742('0x53')]));if(_0x5e100a[_0x8742('0x3c')]['filter']){_0x2fbccf[_0x8742('0x3b')]=_[_0x8742('0x56')](_0x2fbccf[_0x8742('0x3b')],{'$or':_[_0x8742('0x38')](_0x2fbccf[_0x8742('0x42')],function(_0x3edfc5){var _0x5eab4e={};_0x5eab4e[_0x3edfc5]={'$like':'%'+_0x5e100a[_0x8742('0x3c')][_0x8742('0x2a')]+'%'};return _0x5eab4e;})});}_0x2fbccf=_[_0x8742('0x56')]({},_0x2fbccf,_0x5e100a[_0x8742('0xce')]);return _0x5a981f[_0x8742('0x12e')](_0x2fbccf);}})[_0x8742('0xf')](function(_0x380f8e){if(_0x380f8e){_0x430d06=_0x380f8e[_0x8742('0x67')];if(!_0x5e100a[_0x8742('0x3c')]['hasOwnProperty'](_0x8742('0xd4'))){_0x2fbccf[_0x8742('0x1d')]=qs[_0x8742('0x1d')](_0x5e100a[_0x8742('0x3c')][_0x8742('0x1d')]);_0x2fbccf['offset']=qs[_0x8742('0x1c')](_0x5e100a[_0x8742('0x3c')][_0x8742('0x1c')]);}return _0x5a981f['getLists'](_0x2fbccf);}})['then'](function(_0x3f52d2){if(_0x3f52d2){return _0x3f52d2?{'count':_0x430d06,'rows':_0x3f52d2}:null;}})['then'](respondWithResult(_0x5e088e,null))[_0x8742('0x19')](handleError(_0x5e088e,null));};exports[_0x8742('0x12f')]=function(_0xfbf9e0,_0x3f314e){var _0x245c7b={};var _0x2ec73b={};var _0x1dd630;return db['User'][_0x8742('0xca')]({'where':{'id':_0xfbf9e0[_0x8742('0x4e')]['id']}})[_0x8742('0xf')](handleEntityNotFound(_0x3f314e,null))['then'](function(_0xbc4a15){if(_0xbc4a15){_0x1dd630=_0xbc4a15;_0x2ec73b[_0x8742('0x4f')]=_[_0x8742('0x51')](db[_0x8742('0x36')][_0x8742('0x37')]);_0x2ec73b['query']=_['keys'](_0xfbf9e0[_0x8742('0x3c')]);_0x2ec73b[_0x8742('0x53')]=_['intersection'](_0x2ec73b[_0x8742('0x4f')],_0x2ec73b[_0x8742('0x3c')]);_0x245c7b[_0x8742('0x42')]=_['intersection'](_0x2ec73b[_0x8742('0x4f')],qs[_0x8742('0x55')](_0xfbf9e0[_0x8742('0x3c')][_0x8742('0x55')]));_0x245c7b[_0x8742('0x42')]=_0x245c7b['attributes'][_0x8742('0x67')]?_0x245c7b[_0x8742('0x42')]:_0x2ec73b[_0x8742('0x4f')];_0x245c7b[_0x8742('0xcb')]=qs[_0x8742('0xcc')](_0xfbf9e0[_0x8742('0x3c')][_0x8742('0xcc')]);_0x245c7b[_0x8742('0x3b')]=qs['filters'](_[_0x8742('0xcd')](_0xfbf9e0['query'],_0x2ec73b[_0x8742('0x53')]));if(_0xfbf9e0[_0x8742('0x3c')][_0x8742('0x2a')]){_0x245c7b['where']=_[_0x8742('0x56')](_0x245c7b['where'],{'$or':_[_0x8742('0x38')](_0x245c7b['attributes'],function(_0x431137){var _0x176cfc={};_0x176cfc[_0x431137]={'$like':'%'+_0xfbf9e0[_0x8742('0x3c')]['filter']+'%'};return _0x176cfc;})});}_0x245c7b['model']=db[_0x8742('0x36')];_0x245c7b['as']=_0x8742('0x27');_0x245c7b=_['merge']({},_0x245c7b,_0xfbf9e0[_0x8742('0xce')]);return _0x1dd630[_0x8742('0x12c')]({'include':[_0x245c7b]});}})[_0x8742('0xf')](function(_0x2643dd){if(_0x2643dd){var _0x1e6bbb={},_0x4f4221=[];for(var _0x35d24f=0x0;_0x35d24f<_0x2643dd[_0x8742('0x67')];_0x35d24f+=0x1){for(var _0x46c9c9=0x0,_0x40b4fa;_0x46c9c9<_0x2643dd[_0x35d24f][_0x8742('0x27')]['length'];_0x46c9c9+=0x1){_0x40b4fa=_0x2643dd[_0x35d24f][_0x8742('0x27')][_0x46c9c9]['get']({'plain':!![]});_0x1e6bbb[_0x40b4fa['id']]=_0x40b4fa;}}_0x1e6bbb=_[_0x8742('0x130')](_0x1e6bbb);for(var _0x59f1bf=qs[_0x8742('0x1c')](_0xfbf9e0[_0x8742('0x3c')][_0x8742('0x1c')]);_0x59f1bf<_0x1e6bbb[_0x8742('0x67')]&&_0x4f4221[_0x8742('0x67')]=_0x1a8d06[_0xa229('0x54')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xa229('0x12')](function(){if(_0x33ae1a){return db[_0xa229('0x41')][_0xa229('0x4e')]({'where':{'membername':_0x33ae1a[_0xa229('0x2b')]},'individualHooks':!![]});}})[_0xa229('0x12')](function(){if(_0x33ae1a){return _0x33ae1a[_0xa229('0x55')]({'raw':!![]});}})['then'](function(_0xa8fd74){if(_0x33ae1a){if(_0xa8fd74){var _0x4761d0=[];_0x2a0d94=_0xa8fd74;if(_0x2a0d94['length']){for(var _0x1391f3=0x0;_0x1391f3<_0x2a0d94[_0xa229('0x34')];_0x1391f3++){_0x4761d0[_0xa229('0x35')](db[_0xa229('0x41')][_0xa229('0x56')]({'membername':_0x33ae1a[_0xa229('0x2b')],'UserId':_0x33ae1a['id'],'queue_name':_0x2a0d94[_0x1391f3][_0xa229('0x2b')],'VoiceQueueId':_0x2a0d94[_0x1391f3]['id'],'interface':_0x5f0f16,'paused':_0x33ae1a[_0xa229('0x57')]||![],'penalty':_0x2a0d94[_0x1391f3][_0xa229('0x58')]||0x0}));}return BPromise['all'](_0x4761d0);}}}})[_0xa229('0x12')](function(){if(_0x33ae1a){return db['MemberReport']['findAll']({'where':{'membername':_0x33ae1a[_0xa229('0x2b')],'exitAt':null}});}})['then'](function(_0x354771){if(_0x33ae1a){if(_0x354771&&_0x354771['length']){var _0x32a661=[];_0x354771[_0xa229('0x4b')](function(_0x5dda9c){_0x32a661['push'](_0x5dda9c[_0xa229('0x2f')]({'exitAt':moment()[_0xa229('0x32')](_0xa229('0x33'))}));});return BPromise[_0xa229('0x4c')](_0x32a661);}}})[_0xa229('0x12')](function(_0x500c48){if(_0x33ae1a){var _0x1e3eb1=[];var _0x1ff66a=[];var _0x4e483c=utils[_0xa229('0x59')]();var _0xb8bae0={'membername':_0x33ae1a[_0xa229('0x2b')],'interface':_0x5f0f16,'enterAt':moment()[_0xa229('0x32')](_0xa229('0x33')),'role':_0x33ae1a[_0xa229('0x2c')],'internal':_0x33ae1a[_0xa229('0x2d')]};_0x4e483c[_0xa229('0x4b')](function(_0x13b43c){_0x1e3eb1[_0xa229('0x35')](_[_0xa229('0x5a')]({'channel':_0x13b43c,'type':_0xa229('0x5b'),'data1':_0xa229('0x5c'),'data2':_0x5f0f16},_0xb8bae0));if(_0x33ae1a[_0xa229('0x57')]){_0x1ff66a['push'](_[_0xa229('0x5a')]({'channel':_0x13b43c,'type':_0xa229('0x31'),'data1':_0xa229('0x5d')},_0xb8bae0));}});return db['MemberReport'][_0xa229('0x5e')](_0x1e3eb1[_0xa229('0x5f')](_0x1ff66a),{'individualHooks':!![]});}})[_0xa229('0x12')](function(){if(_0x33ae1a){return _0x33ae1a['update']({'online':!![],'lastLoginAt':moment()['format'](_0xa229('0x33')),'voicePause':_0x33ae1a[_0xa229('0x57')]||![],'mailPause':_0x33ae1a[_0xa229('0x57')]||![],'chatPause':_0x33ae1a[_0xa229('0x57')]||![],'faxPause':_0x33ae1a[_0xa229('0x57')]||![],'smsPause':_0x33ae1a[_0xa229('0x57')]||![],'openchannelPause':_0x33ae1a[_0xa229('0x57')]||![],'pauseType':_0x33ae1a['loginInPause']?_0xa229('0x5d'):null,'lastPauseAt':moment()[_0xa229('0x32')](_0xa229('0x33')),'interface':_0x5f0f16});}})[_0xa229('0x12')](function(_0x208cb2){_0x5caf62(_0x208cb2);})['catch'](function(_0x34c3d3){_0x25b4c6(_0x13af2e[_0xa229('0x18')](0x1f4,_0x34c3d3[_0xa229('0x1a')]));});});}; \ No newline at end of file +var _0xae86=['loginInPause','merge','LOGIN','callysquare','LOGININPAUSE','concat','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','./user.socket','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','map','include','model','debug','ShowUser','PauseUser','find','name','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','getChannels','push','SIP/%s','type','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','findOne','channel','isValidChannel','Unknown\x20channel','voice','system','mail','chat','fax','sms','openchannel','whatsapp','set','%s%s','Pause','LogoutUser','destroy','forEach','all','LoginUser','role','mobile','phone','count','agent','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert'];(function(_0x3d5cfa,_0x768461){var _0x23e598=function(_0x2e0e10){while(--_0x2e0e10){_0x3d5cfa['push'](_0x3d5cfa['shift']());}};_0x23e598(++_0x768461);}(_0xae86,0xbc));var _0x6ae8=function(_0x1d1a90,_0x40f97){_0x1d1a90=_0x1d1a90-0x0;var _0x36fc75=_0xae86[_0x1d1a90];return _0x36fc75;};'use strict';var _=require('lodash');var util=require(_0x6ae8('0x0'));var moment=require(_0x6ae8('0x1'));var BPromise=require(_0x6ae8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ae8('0x3'));var db=require(_0x6ae8('0x4'))['db'];var utils=require(_0x6ae8('0x5'));var logger=require(_0x6ae8('0x6'))(_0x6ae8('0x7'));var config=require(_0x6ae8('0x8'));var jayson=require(_0x6ae8('0x9'));var client=jayson[_0x6ae8('0xa')]['http']({'port':0x232a});config['redis']=_[_0x6ae8('0xb')](config['redis'],{'host':_0x6ae8('0xc'),'port':0x18eb});var socket=require(_0x6ae8('0xd'))(new Redis(config['redis']));require(_0x6ae8('0xe'))['register'](socket);function respondWithRpcPromise(_0x2ec8ce,_0x4c9a57,_0x543ac9){return new BPromise(function(_0x4161bf,_0x1b7dc5){return client['request'](_0x2ec8ce,_0x543ac9)[_0x6ae8('0xf')](function(_0x1b5eaf){logger[_0x6ae8('0x10')](_0x6ae8('0x11'),_0x4c9a57,_0x6ae8('0x12'));logger['debug'](_0x6ae8('0x13'),_0x4c9a57,_0x6ae8('0x12'),JSON[_0x6ae8('0x14')](_0x1b5eaf));if(_0x1b5eaf['error']){if(_0x1b5eaf[_0x6ae8('0x15')]['code']===0x1f4){logger[_0x6ae8('0x15')](_0x6ae8('0x11'),_0x4c9a57,_0x1b5eaf[_0x6ae8('0x15')][_0x6ae8('0x16')]);return _0x1b7dc5(_0x1b5eaf[_0x6ae8('0x15')]['message']);}logger[_0x6ae8('0x15')]('User,\x20%s,\x20%s',_0x4c9a57,_0x1b5eaf['error'][_0x6ae8('0x16')]);return _0x4161bf(_0x1b5eaf['error'][_0x6ae8('0x16')]);}else{logger[_0x6ae8('0x10')](_0x6ae8('0x11'),_0x4c9a57,_0x6ae8('0x12'));_0x4161bf(_0x1b5eaf[_0x6ae8('0x17')][_0x6ae8('0x16')]);}})[_0x6ae8('0x18')](function(_0x48ebce){logger[_0x6ae8('0x15')](_0x6ae8('0x11'),_0x4c9a57,_0x48ebce);_0x1b7dc5(_0x48ebce);});});}exports[_0x6ae8('0x19')]=function(_0x23175f){var _0x11dca1=this;return new Promise(function(_0x931cf1,_0x263164){return db[_0x6ae8('0x1a')][_0x6ae8('0x1b')]({'raw':_0x23175f[_0x6ae8('0x1c')]?_0x23175f[_0x6ae8('0x1c')][_0x6ae8('0x1d')]===undefined?!![]:![]:!![],'where':_0x23175f[_0x6ae8('0x1c')]?_0x23175f[_0x6ae8('0x1c')][_0x6ae8('0x1e')]||null:null,'attributes':_0x23175f['options']?_0x23175f[_0x6ae8('0x1c')][_0x6ae8('0x1f')]||null:null,'limit':_0x23175f[_0x6ae8('0x1c')]?_0x23175f[_0x6ae8('0x1c')]['limit']||null:null,'include':_0x23175f['options']?_0x23175f['options']['include']?_[_0x6ae8('0x20')](_0x23175f[_0x6ae8('0x1c')][_0x6ae8('0x21')],function(_0x27b867){return{'model':db[_0x27b867['model']],'as':_0x27b867['as'],'attributes':_0x27b867[_0x6ae8('0x1f')],'include':_0x27b867[_0x6ae8('0x21')]?_[_0x6ae8('0x20')](_0x27b867['include'],function(_0x595944){return{'model':db[_0x595944[_0x6ae8('0x22')]],'as':_0x595944['as'],'attributes':_0x595944[_0x6ae8('0x1f')],'include':_0x595944[_0x6ae8('0x21')]?_[_0x6ae8('0x20')](_0x595944[_0x6ae8('0x21')],function(_0x4f26a7){return{'model':db[_0x4f26a7['model']],'as':_0x4f26a7['as'],'attributes':_0x4f26a7[_0x6ae8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x99be86){logger[_0x6ae8('0x10')](_0x6ae8('0x19'),_0x23175f);logger[_0x6ae8('0x23')](_0x6ae8('0x19'),_0x23175f,JSON[_0x6ae8('0x14')](_0x99be86));_0x931cf1(_0x99be86);})[_0x6ae8('0x18')](function(_0x37511a){logger['error'](_0x6ae8('0x19'),_0x37511a[_0x6ae8('0x16')],_0x23175f);_0x263164(_0x11dca1[_0x6ae8('0x15')](0x1f4,_0x37511a['message']));});});};exports[_0x6ae8('0x24')]=function(_0x34616a){var _0x40ed12=this;return new Promise(function(_0x493deb,_0x4d54c5){return db[_0x6ae8('0x1a')]['find']({'raw':_0x34616a[_0x6ae8('0x1c')]?_0x34616a['options'][_0x6ae8('0x1d')]===undefined?!![]:![]:!![],'where':_0x34616a[_0x6ae8('0x1c')]?_0x34616a['options'][_0x6ae8('0x1e')]||null:null,'attributes':_0x34616a[_0x6ae8('0x1c')]?_0x34616a[_0x6ae8('0x1c')][_0x6ae8('0x1f')]||null:null,'include':_0x34616a[_0x6ae8('0x1c')]?_0x34616a[_0x6ae8('0x1c')]['include']?_[_0x6ae8('0x20')](_0x34616a[_0x6ae8('0x1c')][_0x6ae8('0x21')],function(_0x1adef1){return{'model':db[_0x1adef1[_0x6ae8('0x22')]],'as':_0x1adef1['as'],'attributes':_0x1adef1[_0x6ae8('0x1f')],'include':_0x1adef1[_0x6ae8('0x21')]?_['map'](_0x1adef1[_0x6ae8('0x21')],function(_0x5d32b1){return{'model':db[_0x5d32b1[_0x6ae8('0x22')]],'as':_0x5d32b1['as'],'attributes':_0x5d32b1['attributes'],'include':_0x5d32b1[_0x6ae8('0x21')]?_['map'](_0x5d32b1[_0x6ae8('0x21')],function(_0x3f2415){return{'model':db[_0x3f2415[_0x6ae8('0x22')]],'as':_0x3f2415['as'],'attributes':_0x3f2415['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ae8('0xf')](function(_0x46daf8){logger['info'](_0x6ae8('0x24'),_0x34616a);logger['debug'](_0x6ae8('0x24'),_0x34616a,JSON[_0x6ae8('0x14')](_0x46daf8));_0x493deb(_0x46daf8);})[_0x6ae8('0x18')](function(_0x5cb2bb){logger[_0x6ae8('0x15')]('ShowUser',_0x5cb2bb[_0x6ae8('0x16')],_0x34616a);_0x4d54c5(_0x40ed12[_0x6ae8('0x15')](0x1f4,_0x5cb2bb[_0x6ae8('0x16')]));});});};exports[_0x6ae8('0x25')]=function(_0x47cf79){var _0x4bbc15=this;return new Promise(function(_0x537f0e,_0x1a89e3){var _0x592590;return db['User'][_0x6ae8('0x26')]({'where':_0x47cf79[_0x6ae8('0x1c')]['where']||{},'attributes':['id',_0x6ae8('0x27'),'role',_0x6ae8('0x28'),_0x6ae8('0x29')]})['then'](function(_0x143607){if(_0x143607){_0x592590=_0x143607;return db[_0x6ae8('0x2a')][_0x6ae8('0x2b')]({'paused':0x1},{'where':{'UserId':_0x592590['id']},'individualHooks':!![]});}})[_0x6ae8('0xf')](function(){if(_0x592590){return db[_0x6ae8('0x2c')][_0x6ae8('0x1b')]({'where':{'membername':_0x592590[_0x6ae8('0x27')],'type':_0x6ae8('0x2d'),'exitAt':null}});}})[_0x6ae8('0xf')](function(_0x547773){if(_0x592590){if(_0x547773&&_0x547773[_0x6ae8('0x2e')]){var _0x3fa803=moment()[_0x6ae8('0x2f')](_0x6ae8('0x30'));for(var _0x4a9dc6=0x0,_0x3628d2=_0x547773['length'];_0x4a9dc6<_0x3628d2;_0x4a9dc6++){_0x547773[_0x4a9dc6]['updateAttributes']({'exitAt':_0x3fa803});}}}})['then'](function(){if(_0x592590){var _0xede893=[];var _0x3cb1c6=utils[_0x6ae8('0x31')]();_0x3cb1c6['forEach'](function(_0x3128a9){_0xede893[_0x6ae8('0x32')]({'channel':_0x3128a9,'membername':_0x592590[_0x6ae8('0x27')],'interface':_['isNil'](_0x592590['interface'])?util[_0x6ae8('0x2f')](_0x6ae8('0x33'),_0x592590[_0x6ae8('0x27')]):_0x592590[_0x6ae8('0x29')],'type':'PAUSE','enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x47cf79['body'][_0x6ae8('0x34')]||_0x6ae8('0x35'),'role':_0x592590['role'],'internal':_0x592590[_0x6ae8('0x28')],'uniqueid':_0x47cf79[_0x6ae8('0x36')][_0x6ae8('0x37')]||null});});return db['MemberReport'][_0x6ae8('0x38')](_0xede893,{'individualHooks':!![]});}})[_0x6ae8('0xf')](function(){if(_0x592590){return _0x592590['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x47cf79['body']['type']||_0x6ae8('0x35'),'lastPauseAt':moment()[_0x6ae8('0x2f')](_0x6ae8('0x30'))});}})[_0x6ae8('0xf')](function(_0x42d91f){_0x537f0e(_0x42d91f);})['catch'](function(_0x5e1ef0){_0x1a89e3(_0x4bbc15[_0x6ae8('0x15')](0x1f4,_0x5e1ef0[_0x6ae8('0x16')]));});});};exports['UnpauseUser']=function(_0x47f195){var _0x32f502=this;return new Promise(function(_0x950db1,_0x2f18f2){var _0x5815b5;return db[_0x6ae8('0x1a')][_0x6ae8('0x39')]({'where':_0x47f195['options'][_0x6ae8('0x1e')]||{},'attributes':['id','name']})[_0x6ae8('0xf')](function(_0x2778c6){if(_0x2778c6){_0x5815b5=_0x2778c6;if(_0x47f195[_0x6ae8('0x36')][_0x6ae8('0x3a')]&&!utils[_0x6ae8('0x3b')](_0x47f195['body']['channel'])){throw new Error(_0x6ae8('0x3c'));}switch(_0x47f195[_0x6ae8('0x36')]['channel']){case _0x6ae8('0x3d'):return db[_0x6ae8('0x2a')][_0x6ae8('0x2b')]({'paused':0x0},{'where':{'UserId':_0x5815b5['id']}})['then'](function(){return db[_0x6ae8('0x2c')][_0x6ae8('0x26')]({'where':{'channel':_0x47f195[_0x6ae8('0x36')][_0x6ae8('0x3a')],'membername':_0x5815b5['name'],'type':_0x6ae8('0x2d'),'exitAt':null}});})[_0x6ae8('0xf')](function(_0x77e9ff){if(_0x77e9ff){return _0x77e9ff[_0x6ae8('0x2b')]({'exitAt':moment()['format'](_0x6ae8('0x30')),'data2':_0x6ae8('0x3e')},{'individualHooks':!![]});}return null;})[_0x6ae8('0xf')](function(){return _0x5815b5[_0x6ae8('0x2b')]({'voicePause':![]});});case _0x6ae8('0x3f'):case _0x6ae8('0x40'):case _0x6ae8('0x41'):case _0x6ae8('0x42'):case _0x6ae8('0x43'):case _0x6ae8('0x44'):return db[_0x6ae8('0x2c')][_0x6ae8('0x26')]({'where':{'channel':_0x47f195['body'][_0x6ae8('0x3a')],'membername':_0x5815b5[_0x6ae8('0x27')],'type':_0x6ae8('0x2d'),'exitAt':null}})[_0x6ae8('0xf')](function(_0x4aa812){return _0x4aa812[_0x6ae8('0x2b')]({'exitAt':moment()[_0x6ae8('0x2f')](_0x6ae8('0x30')),'data2':_0x6ae8('0x3e')},{'individualHooks':!![]});})[_0x6ae8('0xf')](function(){var _0x2215a1={};_[_0x6ae8('0x45')](_0x2215a1,util[_0x6ae8('0x2f')](_0x6ae8('0x46'),_0x47f195[_0x6ae8('0x36')][_0x6ae8('0x3a')],_0x6ae8('0x47')),![]);return _0x5815b5['update'](_0x2215a1);});default:return db[_0x6ae8('0x2a')][_0x6ae8('0x2b')]({'paused':0x0},{'where':{'UserId':_0x5815b5['id']}})[_0x6ae8('0xf')](function(){return db[_0x6ae8('0x2c')][_0x6ae8('0x1b')]({'where':{'membername':_0x5815b5[_0x6ae8('0x27')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x46e588){var _0x6b6980=[];_0x46e588['forEach'](function(_0x449c13){_0x6b6980[_0x6ae8('0x32')](_0x449c13['update']({'exitAt':moment()[_0x6ae8('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6ae8('0x3e')}));});return BPromise['all'](_0x6b6980);})['then'](function(){return _0x5815b5[_0x6ae8('0x2b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x1505d8){_0x950db1(_0x1505d8);})['catch'](function(_0x4e149d){_0x2f18f2(_0x32f502[_0x6ae8('0x15')](0x1f4,_0x4e149d[_0x6ae8('0x16')]));});});};exports[_0x6ae8('0x48')]=function(_0x3ef959){var _0x999236=this;return new Promise(function(_0x585d10,_0x545fe0){var _0x56a504;return db[_0x6ae8('0x1a')]['findOne']({'where':_0x3ef959['options'][_0x6ae8('0x1e')]||{},'attributes':['id',_0x6ae8('0x27')]})[_0x6ae8('0xf')](function(_0x120855){if(_0x120855){_0x56a504=_0x120855;return db[_0x6ae8('0x2a')][_0x6ae8('0x49')]({'where':{'membername':_0x56a504[_0x6ae8('0x27')]},'individualHooks':!![]});}})[_0x6ae8('0xf')](function(){if(_0x56a504){return db[_0x6ae8('0x2c')][_0x6ae8('0x1b')]({'where':{'membername':_0x56a504[_0x6ae8('0x27')],'exitAt':null}});}})[_0x6ae8('0xf')](function(_0x27dc82){if(_0x56a504){if(_0x27dc82&&_0x27dc82[_0x6ae8('0x2e')]){var _0xad92ce=[];_0x27dc82[_0x6ae8('0x4a')](function(_0xd0107b){_0xad92ce[_0x6ae8('0x32')](_0xd0107b[_0x6ae8('0x2b')]({'exitAt':moment()[_0x6ae8('0x2f')](_0x6ae8('0x30'))}));});return BPromise[_0x6ae8('0x4b')](_0xad92ce);}}})[_0x6ae8('0xf')](function(){if(_0x56a504){return _0x56a504[_0x6ae8('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x6ae8('0xf')](function(_0x98cf27){_0x585d10(_0x98cf27);})[_0x6ae8('0x18')](function(_0x14dde1){_0x545fe0(_0x999236[_0x6ae8('0x15')](0x1f4,_0x14dde1[_0x6ae8('0x16')]));});});};exports[_0x6ae8('0x4c')]=function(_0x18cf7d){var _0x2e6791=this;return new Promise(function(_0x5e3823,_0x3168f1){var _0x2f6e16;var _0x252f25;var _0x24ea3d;var _0x6fe932;return db['User']['findOne']({'where':_0x18cf7d['options'][_0x6ae8('0x1e')]||{},'attributes':['id','name',_0x6ae8('0x4d'),_0x6ae8('0x4e'),_0x6ae8('0x4f'),_0x6ae8('0x28'),'loginInPause',_0x6ae8('0x29')]})['then'](function(_0x557c58){if(_0x557c58){_0x2f6e16=_0x557c58;_0x6fe932=_0x18cf7d[_0x6ae8('0x36')]['interface']?_0x18cf7d[_0x6ae8('0x36')][_0x6ae8('0x29')]:util['format'](_0x6ae8('0x33'),_0x2f6e16[_0x6ae8('0x27')]);return db[_0x6ae8('0x1a')][_0x6ae8('0x50')]({'where':{'role':_0x6ae8('0x51'),'online':!![],'id':{'$ne':_0x2f6e16['id']}}});}})[_0x6ae8('0xf')](function(_0x38eacc){if(_0x38eacc){_0x24ea3d=_0x38eacc;return require('../../config/license/util')['getLicense']();}})[_0x6ae8('0xf')](function(_0x2cca3a){if(_0x2cca3a&&_0x2cca3a['agents']&&_0x24ea3d>=_0x2cca3a['agents']){throw new Error(_0x6ae8('0x52'));}})[_0x6ae8('0xf')](function(){if(_0x2f6e16){return db[_0x6ae8('0x2a')][_0x6ae8('0x49')]({'where':{'membername':_0x2f6e16['name']},'individualHooks':!![]});}})['then'](function(){if(_0x2f6e16){return _0x2f6e16[_0x6ae8('0x53')]({'raw':!![]});}})[_0x6ae8('0xf')](function(_0x91beee){if(_0x2f6e16){if(_0x91beee){var _0x1e2361=[];_0x252f25=_0x91beee;if(_0x252f25[_0x6ae8('0x2e')]){for(var _0x242b09=0x0;_0x242b09<_0x252f25['length'];_0x242b09++){_0x1e2361[_0x6ae8('0x32')](db[_0x6ae8('0x2a')][_0x6ae8('0x54')]({'membername':_0x2f6e16['name'],'UserId':_0x2f6e16['id'],'queue_name':_0x252f25[_0x242b09]['name'],'VoiceQueueId':_0x252f25[_0x242b09]['id'],'interface':_0x6fe932,'paused':_0x2f6e16[_0x6ae8('0x55')]||![],'penalty':_0x252f25[_0x242b09]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x6ae8('0x4b')](_0x1e2361);}}}})['then'](function(){if(_0x2f6e16){return db[_0x6ae8('0x2c')][_0x6ae8('0x1b')]({'where':{'membername':_0x2f6e16['name'],'exitAt':null}});}})['then'](function(_0x3aba11){if(_0x2f6e16){if(_0x3aba11&&_0x3aba11[_0x6ae8('0x2e')]){var _0x99ed08=[];_0x3aba11[_0x6ae8('0x4a')](function(_0x5224dc){_0x99ed08[_0x6ae8('0x32')](_0x5224dc[_0x6ae8('0x2b')]({'exitAt':moment()[_0x6ae8('0x2f')](_0x6ae8('0x30'))}));});return BPromise['all'](_0x99ed08);}}})['then'](function(_0x2243b2){if(_0x2f6e16){var _0x52426c=[];var _0x285960=[];var _0x7e0535=utils['getChannels']();var _0x226831={'membername':_0x2f6e16[_0x6ae8('0x27')],'interface':_0x6fe932,'enterAt':moment()[_0x6ae8('0x2f')](_0x6ae8('0x30')),'role':_0x2f6e16[_0x6ae8('0x4d')],'internal':_0x2f6e16[_0x6ae8('0x28')]};_0x7e0535['forEach'](function(_0x3ca2e1){_0x52426c['push'](_[_0x6ae8('0x56')]({'channel':_0x3ca2e1,'type':_0x6ae8('0x57'),'data1':_0x6ae8('0x58'),'data2':_0x6fe932},_0x226831));if(_0x2f6e16[_0x6ae8('0x55')]){_0x285960[_0x6ae8('0x32')](_['merge']({'channel':_0x3ca2e1,'type':'PAUSE','data1':_0x6ae8('0x59')},_0x226831));}});return db[_0x6ae8('0x2c')][_0x6ae8('0x38')](_0x52426c[_0x6ae8('0x5a')](_0x285960),{'individualHooks':!![]});}})[_0x6ae8('0xf')](function(){if(_0x2f6e16){return _0x2f6e16[_0x6ae8('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x6ae8('0x2f')](_0x6ae8('0x30')),'voicePause':_0x2f6e16['loginInPause']||![],'mailPause':_0x2f6e16[_0x6ae8('0x55')]||![],'chatPause':_0x2f6e16[_0x6ae8('0x55')]||![],'faxPause':_0x2f6e16['loginInPause']||![],'smsPause':_0x2f6e16[_0x6ae8('0x55')]||![],'openchannelPause':_0x2f6e16['loginInPause']||![],'pauseType':_0x2f6e16['loginInPause']?_0x6ae8('0x59'):null,'lastPauseAt':moment()[_0x6ae8('0x2f')](_0x6ae8('0x30')),'interface':_0x6fe932});}})[_0x6ae8('0xf')](function(_0x1bcaf4){_0x5e3823(_0x1bcaf4);})[_0x6ae8('0x18')](function(_0x4d6a88){_0x3168f1(_0x2e6791['error'](0x1f4,_0x4d6a88[_0x6ae8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index c3054d0..8612484 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 _0x1fdf=['length','user:','./user.events','save','remove','emit','register'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x1fdf,0x6b));var _0xf1fd=function(_0x56d1b7,_0x1d88f5){_0x56d1b7=_0x56d1b7-0x0;var _0x184d91=_0x1fdf[_0x56d1b7];return _0x184d91;};'use strict';var UserEvents=require(_0xf1fd('0x0'));var events=[_0xf1fd('0x1'),_0xf1fd('0x2'),'update'];function createListener(_0x4dee08,_0x38fc79){return function(_0x3eb83c){_0x38fc79[_0xf1fd('0x3')](_0x4dee08,_0x3eb83c);};}function removeListener(_0x2f0374,_0x10a216){return function(){UserEvents['removeListener'](_0x2f0374,_0x10a216);};}exports[_0xf1fd('0x4')]=function(_0x3dd6dc){for(var _0x27c9e3=0x0,_0x220986=events[_0xf1fd('0x5')];_0x27c9e3<_0x220986;_0x27c9e3++){var _0x396362=events[_0x27c9e3];var _0xb55ef7=createListener(_0xf1fd('0x6')+_0x396362,_0x3dd6dc);UserEvents['on'](_0x396362,_0xb55ef7);}}; \ No newline at end of file +var _0x42eb=['remove','update','emit','removeListener','register','length','user:','./user.events','save'];(function(_0x219384,_0xb1699a){var _0x4425d1=function(_0x5c18e5){while(--_0x5c18e5){_0x219384['push'](_0x219384['shift']());}};_0x4425d1(++_0xb1699a);}(_0x42eb,0x6a));var _0xb42e=function(_0x1dac7a,_0x1828ce){_0x1dac7a=_0x1dac7a-0x0;var _0x4cb363=_0x42eb[_0x1dac7a];return _0x4cb363;};'use strict';var UserEvents=require(_0xb42e('0x0'));var events=[_0xb42e('0x1'),_0xb42e('0x2'),_0xb42e('0x3')];function createListener(_0x3ff3e9,_0x57be1d){return function(_0x107009){_0x57be1d[_0xb42e('0x4')](_0x3ff3e9,_0x107009);};}function removeListener(_0x3680ba,_0x3e109e){return function(){UserEvents[_0xb42e('0x5')](_0x3680ba,_0x3e109e);};}exports[_0xb42e('0x6')]=function(_0x20f101){for(var _0xfc192b=0x0,_0x38be1d=events[_0xb42e('0x7')];_0xfc192b<_0x38be1d;_0xfc192b++){var _0x25f226=events[_0xfc192b];var _0x26d482=createListener(_0xb42e('0x8')+_0x25f226,_0x20f101);UserEvents['on'](_0x25f226,_0x26d482);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index c378e7e..6b1e379 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1d5cbb,_0x425e7f){var _0x1da5d5=function(_0x462f8d){while(--_0x462f8d){_0x1d5cbb['push'](_0x1d5cbb['shift']());}};_0x1da5d5(++_0x425e7f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x48161d,_0x2f543c){var _0x399160=function(_0x7479ed){while(--_0x7479ed){_0x48161d['push'](_0x48161d['shift']());}};_0x399160(++_0x2f543c);}(_0x70e0,0x17b));var _0x070e=function(_0x32bddb,_0x82eac){_0x32bddb=_0x32bddb-0x0;var _0x5b1344=_0x70e0[_0x32bddb];return _0x5b1344;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 1bb7c41..469025c 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 _0xa50d=['sequelize','exports','INTEGER'];(function(_0x582274,_0x2cbd9c){var _0x8f14d3=function(_0x1cfe08){while(--_0x1cfe08){_0x582274['push'](_0x582274['shift']());}};_0x8f14d3(++_0x2cbd9c);}(_0xa50d,0x7b));var _0xda50=function(_0x15d93a,_0x3b3ad6){_0x15d93a=_0x15d93a-0x0;var _0x46eb78=_0xa50d[_0x15d93a];return _0x46eb78;};'use strict';var Sequelize=require(_0xda50('0x0'));module[_0xda50('0x1')]={'penalty':{'type':Sequelize[_0xda50('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3ea3=['exports','INTEGER','sequelize'];(function(_0x93172e,_0x397713){var _0x3d1675=function(_0x17e999){while(--_0x17e999){_0x93172e['push'](_0x93172e['shift']());}};_0x3d1675(++_0x397713);}(_0x3ea3,0xc5));var _0x33ea=function(_0x9474e9,_0x4cec31){_0x9474e9=_0x9474e9-0x0;var _0x39f843=_0x3ea3[_0x9474e9];return _0x39f843;};'use strict';var Sequelize=require(_0x33ea('0x0'));module[_0x33ea('0x1')]={'penalty':{'type':Sequelize[_0x33ea('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 3d8616e..0eba387 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 _0xef21=['UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./userChatQueue.attributes','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xef21,0x120));var _0x1ef2=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xef21[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x1ef2('0x0'));var util=require('util');var logger=require(_0x1ef2('0x1'))(_0x1ef2('0x2'));var moment=require(_0x1ef2('0x3'));var BPromise=require(_0x1ef2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ef2('0x5'));var rimraf=require('rimraf');var config=require(_0x1ef2('0x6'));var attributes=require(_0x1ef2('0x7'));module['exports']=function(_0x1b64a9,_0x3e7cf1){return _0x1b64a9[_0x1ef2('0x8')](_0x1ef2('0x9'),attributes,{'tableName':_0x1ef2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x486b=['define','user_has_chat_queues','lodash','util','api','moment','rimraf','../../config/environment','./userChatQueue.attributes','exports'];(function(_0x48a8cc,_0x431fc9){var _0x1451d5=function(_0x2dd66b){while(--_0x2dd66b){_0x48a8cc['push'](_0x48a8cc['shift']());}};_0x1451d5(++_0x431fc9);}(_0x486b,0x174));var _0xb486=function(_0x1c2692,_0x1a4ec4){_0x1c2692=_0x1c2692-0x0;var _0xe370f0=_0x486b[_0x1c2692];return _0xe370f0;};'use strict';var _=require(_0xb486('0x0'));var util=require(_0xb486('0x1'));var logger=require('../../config/logger')(_0xb486('0x2'));var moment=require(_0xb486('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb486('0x4'));var config=require(_0xb486('0x5'));var attributes=require(_0xb486('0x6'));module[_0xb486('0x7')]=function(_0x3265ce,_0x2307c3){return _0x3265ce[_0xb486('0x8')]('UserChatQueue',attributes,{'tableName':_0xb486('0x9'),'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 307a487..7a4d0c5 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 _0x734f=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x734f,0x105));var _0xf734=function(_0x4db341,_0xb12794){_0x4db341=_0x4db341-0x0;var _0x193cb0=_0x734f[_0x4db341];return _0x193cb0;};'use strict';var _=require(_0xf734('0x0'));var util=require(_0xf734('0x1'));var moment=require(_0xf734('0x2'));var BPromise=require(_0xf734('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf734('0x4'));var db=require(_0xf734('0x5'))['db'];var utils=require(_0xf734('0x6'));var logger=require(_0xf734('0x7'))('rpc');var config=require(_0xf734('0x8'));var jayson=require(_0xf734('0x9'));var client=jayson['client'][_0xf734('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf9d4ee,_0x1fded6,_0x4503fc){return new BPromise(function(_0x3d345a,_0x46c57e){return client[_0xf734('0xb')](_0xf9d4ee,_0x4503fc)[_0xf734('0xc')](function(_0x546825){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x1fded6,_0xf734('0xd'));logger[_0xf734('0xe')](_0xf734('0xf'),_0x1fded6,_0xf734('0xd'),JSON[_0xf734('0x10')](_0x546825));if(_0x546825[_0xf734('0x11')]){if(_0x546825[_0xf734('0x11')][_0xf734('0x12')]===0x1f4){logger['error'](_0xf734('0x13'),_0x1fded6,_0x546825[_0xf734('0x11')][_0xf734('0x14')]);return _0x46c57e(_0x546825[_0xf734('0x11')]['message']);}logger[_0xf734('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x1fded6,_0x546825['error'][_0xf734('0x14')]);return _0x3d345a(_0x546825[_0xf734('0x11')][_0xf734('0x14')]);}else{logger[_0xf734('0x15')](_0xf734('0x13'),_0x1fded6,_0xf734('0xd'));_0x3d345a(_0x546825[_0xf734('0x16')][_0xf734('0x14')]);}})[_0xf734('0x17')](function(_0x252da2){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x1fded6,_0x252da2);_0x46c57e(_0x252da2);});});} \ No newline at end of file +var _0x07a7=['request','then','info','request\x20sent','debug','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x3d62e0,_0x183b08){var _0x29d7de=function(_0x27936f){while(--_0x27936f){_0x3d62e0['push'](_0x3d62e0['shift']());}};_0x29d7de(++_0x183b08);}(_0x07a7,0x1af));var _0x707a=function(_0x2c46f1,_0x2e9eb1){_0x2c46f1=_0x2c46f1-0x0;var _0x192097=_0x07a7[_0x2c46f1];return _0x192097;};'use strict';var _=require(_0x707a('0x0'));var util=require(_0x707a('0x1'));var moment=require('moment');var BPromise=require(_0x707a('0x2'));var rs=require(_0x707a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x707a('0x4'))['db'];var utils=require(_0x707a('0x5'));var logger=require('../../config/logger')(_0x707a('0x6'));var config=require(_0x707a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x707a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44498d,_0x1ca72f,_0x127480){return new BPromise(function(_0x2dd863,_0xf3c5b8){return client[_0x707a('0x9')](_0x44498d,_0x127480)[_0x707a('0xa')](function(_0x212000){logger[_0x707a('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x1ca72f,_0x707a('0xc'));logger[_0x707a('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x1ca72f,_0x707a('0xc'),JSON['stringify'](_0x212000));if(_0x212000[_0x707a('0xe')]){if(_0x212000[_0x707a('0xe')][_0x707a('0xf')]===0x1f4){logger[_0x707a('0xe')](_0x707a('0x10'),_0x1ca72f,_0x212000[_0x707a('0xe')][_0x707a('0x11')]);return _0xf3c5b8(_0x212000['error']['message']);}logger[_0x707a('0xe')](_0x707a('0x10'),_0x1ca72f,_0x212000[_0x707a('0xe')][_0x707a('0x11')]);return _0x2dd863(_0x212000[_0x707a('0xe')]['message']);}else{logger[_0x707a('0xb')](_0x707a('0x10'),_0x1ca72f,'request\x20sent');_0x2dd863(_0x212000[_0x707a('0x12')][_0x707a('0x11')]);}})[_0x707a('0x13')](function(_0x445396){logger[_0x707a('0xe')](_0x707a('0x10'),_0x1ca72f,_0x445396);_0xf3c5b8(_0x445396);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 350bcf5..046e712 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x10f851,_0x118a53){var _0x3637b8=function(_0x2c72b8){while(--_0x2c72b8){_0x10f851['push'](_0x10f851['shift']());}};_0x3637b8(++_0x118a53);}(_0xe706,0xa3));var _0x6e70=function(_0x50c50b,_0x3a6fb3){_0x50c50b=_0x50c50b-0x0;var _0x423c29=_0xe706[_0x50c50b];return _0x423c29;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x29941f,_0x187d20){var _0x453246=function(_0x762c5e){while(--_0x762c5e){_0x29941f['push'](_0x29941f['shift']());}};_0x453246(++_0x187d20);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 55fbbdd..7e927ca 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 _0x36f0=['INTEGER','STRING','sequelize','exports'];(function(_0x15fa77,_0x93eaff){var _0x1385ff=function(_0x165e02){while(--_0x165e02){_0x15fa77['push'](_0x15fa77['shift']());}};_0x1385ff(++_0x93eaff);}(_0x36f0,0x12e));var _0x036f=function(_0x26b3be,_0x71dc78){_0x26b3be=_0x26b3be-0x0;var _0x12379e=_0x36f0[_0x26b3be];return _0x12379e;};'use strict';var Sequelize=require(_0x036f('0x0'));module[_0x036f('0x1')]={'penalty':{'type':Sequelize[_0x036f('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x036f('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x036f('0x3')]}}; \ No newline at end of file +var _0xd553=['INTEGER','STRING','sequelize','exports'];(function(_0x1d762a,_0x41cc91){var _0x4bf5ce=function(_0x417043){while(--_0x417043){_0x1d762a['push'](_0x1d762a['shift']());}};_0x4bf5ce(++_0x41cc91);}(_0xd553,0x17a));var _0x3d55=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xd553[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require(_0x3d55('0x0'));module[_0x3d55('0x1')]={'penalty':{'type':Sequelize[_0x3d55('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3d55('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x3d55('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 06c484a..b06ca5c 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 _0x6d59=['user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6d59,0x17b));var _0x96d5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6d59[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x96d5('0x0'));var util=require(_0x96d5('0x1'));var logger=require(_0x96d5('0x2'))(_0x96d5('0x3'));var moment=require(_0x96d5('0x4'));var BPromise=require(_0x96d5('0x5'));var rp=require(_0x96d5('0x6'));var fs=require('fs');var path=require(_0x96d5('0x7'));var rimraf=require(_0x96d5('0x8'));var config=require(_0x96d5('0x9'));var attributes=require(_0x96d5('0xa'));module[_0x96d5('0xb')]=function(_0x3f26fb,_0x5c356d){return _0x3f26fb[_0x96d5('0xc')]('UserFaxQueue',attributes,{'tableName':_0x96d5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6f1=['api','bluebird','request-promise','rimraf','./userFaxQueue.attributes','exports','UserFaxQueue','../../config/logger'];(function(_0x3f8811,_0x1f30e9){var _0x4ef8ce=function(_0x11524d){while(--_0x11524d){_0x3f8811['push'](_0x3f8811['shift']());}};_0x4ef8ce(++_0x1f30e9);}(_0xd6f1,0x8f));var _0x1d6f=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xd6f1[_0x2dea24];return _0x309d58;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1d6f('0x0'))(_0x1d6f('0x1'));var moment=require('moment');var BPromise=require(_0x1d6f('0x2'));var rp=require(_0x1d6f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d6f('0x4'));var config=require('../../config/environment');var attributes=require(_0x1d6f('0x5'));module[_0x1d6f('0x6')]=function(_0x370908,_0xc87f00){return _0x370908['define'](_0x1d6f('0x7'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 90a36cf..bf9ddf6 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 _0x9481=['message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0x9481,0x1a5));var _0x1948=function(_0x5a5ad8,_0x34911c){_0x5a5ad8=_0x5a5ad8-0x0;var _0x5512e5=_0x9481[_0x5a5ad8];return _0x5512e5;};'use strict';var _=require('lodash');var util=require(_0x1948('0x0'));var moment=require(_0x1948('0x1'));var BPromise=require(_0x1948('0x2'));var rs=require(_0x1948('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1948('0x4'));var logger=require(_0x1948('0x5'))(_0x1948('0x6'));var config=require(_0x1948('0x7'));var jayson=require(_0x1948('0x8'));var client=jayson['client'][_0x1948('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e97fe,_0x354e89,_0x5e7246){return new BPromise(function(_0x55f7af,_0x56fe7f){return client[_0x1948('0xa')](_0x3e97fe,_0x5e7246)[_0x1948('0xb')](function(_0x341b57){logger[_0x1948('0xc')](_0x1948('0xd'),_0x354e89,_0x1948('0xe'));logger[_0x1948('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x354e89,_0x1948('0xe'),JSON[_0x1948('0x10')](_0x341b57));if(_0x341b57['error']){if(_0x341b57[_0x1948('0x11')][_0x1948('0x12')]===0x1f4){logger[_0x1948('0x11')](_0x1948('0xd'),_0x354e89,_0x341b57[_0x1948('0x11')]['message']);return _0x56fe7f(_0x341b57[_0x1948('0x11')][_0x1948('0x13')]);}logger['error'](_0x1948('0xd'),_0x354e89,_0x341b57['error'][_0x1948('0x13')]);return _0x55f7af(_0x341b57[_0x1948('0x11')][_0x1948('0x13')]);}else{logger['info'](_0x1948('0xd'),_0x354e89,_0x1948('0xe'));_0x55f7af(_0x341b57[_0x1948('0x14')][_0x1948('0x13')]);}})[_0x1948('0x15')](function(_0x3c0c43){logger[_0x1948('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x354e89,_0x3c0c43);_0x56fe7f(_0x3c0c43);});});} \ No newline at end of file +var _0x350b=['request','then','info','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','client'];(function(_0x4a6b92,_0x53929c){var _0x303f17=function(_0x30a218){while(--_0x30a218){_0x4a6b92['push'](_0x4a6b92['shift']());}};_0x303f17(++_0x53929c);}(_0x350b,0x13e));var _0xb350=function(_0x1c545d,_0xa3b3c8){_0x1c545d=_0x1c545d-0x0;var _0x3e0712=_0x350b[_0x1c545d];return _0x3e0712;};'use strict';var _=require(_0xb350('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb350('0x1'));var rs=require(_0xb350('0x2'));var fs=require('fs');var Redis=require(_0xb350('0x3'));var db=require(_0xb350('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb350('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2efbf3,_0x36b032,_0x1125ef){return new BPromise(function(_0x544ca8,_0x1edd0d){return client[_0xb350('0x6')](_0x2efbf3,_0x1125ef)[_0xb350('0x7')](function(_0x2cdb5d){logger[_0xb350('0x8')]('UserFaxQueue,\x20%s,\x20%s',_0x36b032,'request\x20sent');logger[_0xb350('0x9')](_0xb350('0xa'),_0x36b032,_0xb350('0xb'),JSON[_0xb350('0xc')](_0x2cdb5d));if(_0x2cdb5d[_0xb350('0xd')]){if(_0x2cdb5d[_0xb350('0xd')][_0xb350('0xe')]===0x1f4){logger[_0xb350('0xd')](_0xb350('0xf'),_0x36b032,_0x2cdb5d[_0xb350('0xd')][_0xb350('0x10')]);return _0x1edd0d(_0x2cdb5d[_0xb350('0xd')][_0xb350('0x10')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x36b032,_0x2cdb5d[_0xb350('0xd')]['message']);return _0x544ca8(_0x2cdb5d[_0xb350('0xd')][_0xb350('0x10')]);}else{logger[_0xb350('0x8')](_0xb350('0xf'),_0x36b032,_0xb350('0xb'));_0x544ca8(_0x2cdb5d['result']['message']);}})[_0xb350('0x11')](function(_0x11a4c7){logger[_0xb350('0xd')](_0xb350('0xf'),_0x36b032,_0x11a4c7);_0x1edd0d(_0x11a4c7);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 250618e..d2e9e3d 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x30cece,_0x105926){var _0x212f7e=function(_0x455a7e){while(--_0x455a7e){_0x30cece['push'](_0x30cece['shift']());}};_0x212f7e(++_0x105926);}(_0xe706,0xa3));var _0x6e70=function(_0x202c99,_0x121caf){_0x202c99=_0x202c99-0x0;var _0x256a0f=_0xe706[_0x202c99];return _0x256a0f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x568e59,_0x1a411c){var _0x223993=function(_0xfaf2e6){while(--_0xfaf2e6){_0x568e59['push'](_0x568e59['shift']());}};_0x223993(++_0x1a411c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xcb91[_0x1f36bb];return _0xaf97fa;};'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 eefbaea..f5ca1da 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbfe=['exports','INTEGER'];(function(_0x2dda08,_0xbda994){var _0x4526ae=function(_0x293f7d){while(--_0x293f7d){_0x2dda08['push'](_0x2dda08['shift']());}};_0x4526ae(++_0xbda994);}(_0xdbfe,0xd0));var _0xedbf=function(_0x5e8064,_0x134d37){_0x5e8064=_0x5e8064-0x0;var _0x12f550=_0xdbfe[_0x5e8064];return _0x12f550;};'use strict';var Sequelize=require('sequelize');module[_0xedbf('0x0')]={'penalty':{'type':Sequelize[_0xedbf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e81=['exports','INTEGER','sequelize'];(function(_0x24fdba,_0x21bd61){var _0x4a93f=function(_0x60b32d){while(--_0x60b32d){_0x24fdba['push'](_0x24fdba['shift']());}};_0x4a93f(++_0x21bd61);}(_0x8e81,0x1d0));var _0x18e8=function(_0x2ba495,_0x25503e){_0x2ba495=_0x2ba495-0x0;var _0x5d7c00=_0x8e81[_0x2ba495];return _0x5d7c00;};'use strict';var Sequelize=require(_0x18e8('0x0'));module[_0x18e8('0x1')]={'penalty':{'type':Sequelize[_0x18e8('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index bbea30f..ae6c45f 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 _0x29af=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues'];(function(_0x241076,_0xab63d7){var _0x41470d=function(_0x5b2b5a){while(--_0x5b2b5a){_0x241076['push'](_0x241076['shift']());}};_0x41470d(++_0xab63d7);}(_0x29af,0x1c2));var _0xf29a=function(_0x30ef36,_0x347503){_0x30ef36=_0x30ef36-0x0;var _0x13d3ae=_0x29af[_0x30ef36];return _0x13d3ae;};'use strict';var _=require('lodash');var util=require(_0xf29a('0x0'));var logger=require(_0xf29a('0x1'))('api');var moment=require(_0xf29a('0x2'));var BPromise=require('bluebird');var rp=require(_0xf29a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf29a('0x4'));var config=require(_0xf29a('0x5'));var attributes=require(_0xf29a('0x6'));module['exports']=function(_0x2db28b,_0x4702a1){return _0x2db28b[_0xf29a('0x7')](_0xf29a('0x8'),attributes,{'tableName':_0xf29a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71ee=['UserMailQueue','user_has_mail_queues','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','define'];(function(_0x588f96,_0x2df201){var _0x30395e=function(_0x4d4656){while(--_0x4d4656){_0x588f96['push'](_0x588f96['shift']());}};_0x30395e(++_0x2df201);}(_0x71ee,0xb2));var _0xe71e=function(_0x4fc9c1,_0x570e05){_0x4fc9c1=_0x4fc9c1-0x0;var _0x15d7a1=_0x71ee[_0x4fc9c1];return _0x15d7a1;};'use strict';var _=require(_0xe71e('0x0'));var util=require(_0xe71e('0x1'));var logger=require('../../config/logger')(_0xe71e('0x2'));var moment=require(_0xe71e('0x3'));var BPromise=require(_0xe71e('0x4'));var rp=require(_0xe71e('0x5'));var fs=require('fs');var path=require(_0xe71e('0x6'));var rimraf=require('rimraf');var config=require(_0xe71e('0x7'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x399aaf,_0x1b39d6){return _0x399aaf[_0xe71e('0x8')](_0xe71e('0x9'),attributes,{'tableName':_0xe71e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 2999d81..d4972ee 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x5c0075,_0xf065c4){var _0x58823a=function(_0x37c7ab){while(--_0x37c7ab){_0x5c0075['push'](_0x5c0075['shift']());}};_0x58823a(++_0xf065c4);}(_0x3e74,0x175));var _0x43e7=function(_0x5f1897,_0x208d64){_0x5f1897=_0x5f1897-0x0;var _0x38a964=_0x3e74[_0x5f1897];return _0x38a964;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2819a9,_0xc7c5d){var _0x6a7fa2=function(_0x12195f){while(--_0x12195f){_0x2819a9['push'](_0x2819a9['shift']());}};_0x6a7fa2(++_0xc7c5d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 37553af..a50c75f 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 _0x2099=['Router','fs-extra','../../config/environment','./userNotification.controller','post','isAuthenticated','multer','util','path'];(function(_0x391316,_0x2a747d){var _0x9634d2=function(_0x342e7d){while(--_0x342e7d){_0x391316['push'](_0x391316['shift']());}};_0x9634d2(++_0x2a747d);}(_0x2099,0x12f));var _0x9209=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2099[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x9209('0x0'));var util=require(_0x9209('0x1'));var path=require(_0x9209('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9209('0x3')]();var fs_extra=require(_0x9209('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9209('0x5'));var controller=require(_0x9209('0x6'));router[_0x9209('0x7')]('/',auth[_0x9209('0x8')](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file +var _0xdac5=['sendUserNotification','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post'];(function(_0x342b4c,_0x381e5d){var _0x4aa2dc=function(_0x22c3d1){while(--_0x22c3d1){_0x342b4c['push'](_0x342b4c['shift']());}};_0x4aa2dc(++_0x381e5d);}(_0xdac5,0x176));var _0x5dac=function(_0x4f35f6,_0x45ece2){_0x4f35f6=_0x4f35f6-0x0;var _0x18fb88=_0xdac5[_0x4f35f6];return _0x18fb88;};'use strict';var multer=require(_0x5dac('0x0'));var util=require(_0x5dac('0x1'));var path=require('path');var timeout=require(_0x5dac('0x2'));var express=require('express');var router=express[_0x5dac('0x3')]();var fs_extra=require(_0x5dac('0x4'));var auth=require(_0x5dac('0x5'));var interaction=require(_0x5dac('0x6'));var config=require(_0x5dac('0x7'));var controller=require(_0x5dac('0x8'));router[_0x5dac('0x9')]('/',auth['isAuthenticated'](),controller[_0x5dac('0xa')]);module[_0x5dac('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index c33adf4..bac5c38 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 _0x95a8=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0x95a8,0xdc));var _0x895a=function(_0xfbce65,_0x3f2d34){_0xfbce65=_0xfbce65-0x0;var _0x596900=_0x95a8[_0xfbce65];return _0x596900;};'use strict';var Sequelize=require(_0x895a('0x0'));module[_0x895a('0x1')]={'body':{'type':Sequelize[_0x895a('0x2')]},'senderName':{'type':Sequelize[_0x895a('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x895a('0x3')]},'beep':{'type':Sequelize[_0x895a('0x4')]}}; \ No newline at end of file +var _0xe235=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x38121a,_0xca4044){var _0x268c8c=function(_0x594961){while(--_0x594961){_0x38121a['push'](_0x38121a['shift']());}};_0x268c8c(++_0xca4044);}(_0xe235,0x1a7));var _0x5e23=function(_0x18c679,_0x5f0393){_0x18c679=_0x18c679-0x0;var _0x2476fd=_0xe235[_0x18c679];return _0x2476fd;};'use strict';var Sequelize=require(_0x5e23('0x0'));module[_0x5e23('0x1')]={'body':{'type':Sequelize[_0x5e23('0x2')]},'senderName':{'type':Sequelize[_0x5e23('0x3')]},'recipientsId':{'type':Sequelize[_0x5e23('0x2')]},'recipientsDescription':{'type':Sequelize[_0x5e23('0x3')]},'beep':{'type':Sequelize[_0x5e23('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index d20bc43..254208b 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 _0xe9b3=['ids','queue','replace','Queue','push','all','flatten','getAgents','map','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./userNotification.socket','register','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Sequelize','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','sortBy','sequelize','create','recipient','emit','userNotification:send','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','html','forEach','model','toLowerCase','User','union'];(function(_0x8f37c3,_0x3640eb){var _0x2a920d=function(_0x1f7edc){while(--_0x1f7edc){_0x8f37c3['push'](_0x8f37c3['shift']());}};_0x2a920d(++_0x3640eb);}(_0xe9b3,0xcc));var _0x3e9b=function(_0x451d47,_0x3db835){_0x451d47=_0x451d47-0x0;var _0x1a4219=_0xe9b3[_0x451d47];return _0x1a4219;};'use strict';var emlformat=require(_0x3e9b('0x0'));var rimraf=require(_0x3e9b('0x1'));var zipdir=require(_0x3e9b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e9b('0x3'));var moment=require(_0x3e9b('0x4'));var BPromise=require(_0x3e9b('0x5'));var Mustache=require(_0x3e9b('0x6'));var util=require('util');var path=require(_0x3e9b('0x7'));var sox=require(_0x3e9b('0x8'));var csv=require(_0x3e9b('0x9'));var ejs=require(_0x3e9b('0xa'));var fs=require('fs');var fs_extra=require(_0x3e9b('0xb'));var _=require('lodash');var squel=require(_0x3e9b('0xc'));var crypto=require('crypto');var jsforce=require(_0x3e9b('0xd'));var deskjs=require(_0x3e9b('0xe'));var toCsv=require(_0x3e9b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e9b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3e9b('0x10'));var as=require(_0x3e9b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e9b('0x12'));var utils=require(_0x3e9b('0x13'));var config=require(_0x3e9b('0x14'));var licenseUtil=require(_0x3e9b('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x3e9b('0x16')],{'host':_0x3e9b('0x17'),'port':0x18eb});var socket=require(_0x3e9b('0x18'))(new Redis(config['redis']));require(_0x3e9b('0x19'))[_0x3e9b('0x1a')](socket);function respondWithStatusCode(_0x1eda75,_0x249b1d){_0x249b1d=_0x249b1d||0xcc;return function(_0x3cb07a){if(_0x3cb07a){return _0x1eda75['sendStatus'](_0x249b1d);}return _0x1eda75['status'](_0x249b1d)[_0x3e9b('0x1b')]();};}function respondWithResult(_0x3271bc,_0x579b55){_0x579b55=_0x579b55||0xc8;return function(_0x2ac30f){if(_0x2ac30f){return _0x3271bc[_0x3e9b('0x1c')](_0x579b55)[_0x3e9b('0x1d')](_0x2ac30f);}};}function respondWithFilteredResult(_0x120d8c,_0x48a6c7){return function(_0x508b16){if(_0x508b16){var _0x24aea9=typeof _0x48a6c7['offset']===_0x3e9b('0x1e')&&typeof _0x48a6c7[_0x3e9b('0x1f')]===_0x3e9b('0x1e');var _0x19ceb4=_0x508b16[_0x3e9b('0x20')];var _0x35faaf=_0x24aea9?0x0:_0x48a6c7[_0x3e9b('0x21')];var _0x4afa03=_0x24aea9?_0x508b16[_0x3e9b('0x20')]:_0x48a6c7[_0x3e9b('0x21')]+_0x48a6c7[_0x3e9b('0x1f')];var _0x47959e;if(_0x4afa03>=_0x19ceb4){_0x4afa03=_0x19ceb4;_0x47959e=0xc8;}else{_0x47959e=0xce;}_0x120d8c[_0x3e9b('0x1c')](_0x47959e);return _0x120d8c['set'](_0x3e9b('0x22'),_0x35faaf+'-'+_0x4afa03+'/'+_0x19ceb4)[_0x3e9b('0x1d')](_0x508b16);}return null;};}function patchUpdates(_0x14ee64){return function(_0x116599){try{jsonpatch[_0x3e9b('0x23')](_0x116599,_0x14ee64,!![]);}catch(_0x412f65){return BPromise[_0x3e9b('0x24')](_0x412f65);}return _0x116599[_0x3e9b('0x25')]();};}function saveUpdates(_0x55ef87,_0x7641f3){return function(_0xcdd22b){if(_0xcdd22b){return _0xcdd22b['update'](_0x55ef87)[_0x3e9b('0x26')](function(_0x52d280){return _0x52d280;});}return null;};}function removeEntity(_0xf8bf54,_0xc76094){return function(_0x34e2a3){if(_0x34e2a3){return _0x34e2a3[_0x3e9b('0x27')]()['then'](function(){_0xf8bf54[_0x3e9b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb96ae6,_0x3bd4ff){return function(_0x45c290){if(!_0x45c290){_0xb96ae6[_0x3e9b('0x28')](0x194);}return _0x45c290;};}function handleError(_0x3e1162,_0x1131a3){_0x1131a3=_0x1131a3||0x1f4;return function(_0x115842){logger['error'](_0x115842[_0x3e9b('0x29')]);if(_0x115842[_0x3e9b('0x2a')]){delete _0x115842[_0x3e9b('0x2a')];}_0x3e1162['status'](_0x1131a3)[_0x3e9b('0x2b')](_0x115842);};}exports[_0x3e9b('0x2c')]=function(_0x397ddf,_0x2facc8,_0x92c702){if(!_0x397ddf[_0x3e9b('0x2d')]['hasOwnProperty'](_0x3e9b('0x2e'))&&!_0x397ddf[_0x3e9b('0x2d')][_0x3e9b('0x2f')](_0x3e9b('0x30'))){throw new db['Sequelize'][(_0x3e9b('0x31'))](_0x3e9b('0x32'));}else{if(_0x397ddf[_0x3e9b('0x2d')]['hasOwnProperty'](_0x3e9b('0x30'))&&!_0x397ddf['body']['hasOwnProperty'](_0x3e9b('0x33'))){throw new db['Sequelize']['ValidationError'](_0x3e9b('0x34'));}if(!_0x397ddf[_0x3e9b('0x2d')][_0x3e9b('0x2f')](_0x3e9b('0x35'))){throw new db[(_0x3e9b('0x36'))]['ValidationError'](_0x3e9b('0x37'));}else{try{var _0x4b8a5b=JSON['parse'](_0x397ddf[_0x3e9b('0x2d')]['recipients']);}catch(_0x39452b){logger['error'](_0x39452b);throw new db[(_0x3e9b('0x36'))][(_0x3e9b('0x31'))](_0x3e9b('0x38'));}var _0x40d11b=[_0x3e9b('0x39'),_0x3e9b('0x3a'),'mailqueue',_0x3e9b('0x3b'),_0x3e9b('0x3c'),'voicequeue',_0x3e9b('0x3d'),_0x3e9b('0x3e'),_0x3e9b('0x3f')];if(_[_0x3e9b('0x40')](_0x4b8a5b,function(_0x38d2b5){return!_[_0x3e9b('0x41')](_0x40d11b,_0x38d2b5['model']['toLowerCase']());})){throw new db[(_0x3e9b('0x36'))]['ValidationError'](_0x3e9b('0x42'));}}}var _0x17ad77={};_0x17ad77['senderName']=_0x397ddf['body'][_0x3e9b('0x2f')]('senderName')?_0x397ddf[_0x3e9b('0x2d')][_0x3e9b('0x43')]:_0x397ddf['user'][_0x3e9b('0x44')];_0x17ad77['recipientsDescription']=_[_0x3e9b('0x45')](_0x397ddf[_0x3e9b('0x2d')][_0x3e9b('0x46')])?null:_0x397ddf['body'][_0x3e9b('0x46')];_0x17ad77[_0x3e9b('0x47')]=_0x397ddf['body']['beep']||![];_0x17ad77[_0x3e9b('0x48')]=_0x397ddf[_0x3e9b('0x3f')]['id'];return getContent(_0x397ddf[_0x3e9b('0x2d')])[_0x3e9b('0x26')](function(_0x4792c1){_0x17ad77[_0x3e9b('0x2d')]=_0x4792c1;return getRecipients(_0x4b8a5b);})[_0x3e9b('0x26')](function(_0x21af37){_0x17ad77['recipientsId']=_[_0x3e9b('0x49')](_0x21af37)['join'](',');return db[_0x3e9b('0x4a')]['transaction'](function(_0x1378b1){return db['UserNotification'][_0x3e9b('0x4b')](_0x17ad77,{'raw':!![],'transaction':_0x1378b1})['then'](function(_0x141250){var _0x1f2e83={'sender':_0x17ad77[_0x3e9b('0x43')],'description':_0x17ad77[_0x3e9b('0x46')],'content':_0x17ad77[_0x3e9b('0x2d')],'beep':_0x17ad77[_0x3e9b('0x47')]};_0x21af37['forEach'](function(_0xa638b7){_0x1f2e83[_0x3e9b('0x4c')]=_0xa638b7;socket[_0x3e9b('0x4d')](_0x3e9b('0x4e'),_0x1f2e83);});return _0x141250;});});})[_0x3e9b('0x26')](respondWithResult(_0x2facc8,0xc9))['catch'](handleError(_0x2facc8,null));};function getContent(_0x1b618e){return new BPromise(function(_0x2ddd34,_0x184393){if(_0x1b618e[_0x3e9b('0x2e')]){_0x2ddd34(_0x1b618e['text']);return;}return db['Template'][_0x3e9b('0x4f')]({'attributes':['html'],'where':{'id':_0x1b618e['TemplateId']},'raw':!![]})[_0x3e9b('0x26')](function(_0x2378e9){if(!_0x2378e9)throw new db['Sequelize'][(_0x3e9b('0x31'))](_0x3e9b('0x50'));var _0x1d7548=Mustache['render'](_0x2378e9[_0x3e9b('0x51')],_0x1b618e['view']);_0x2ddd34(_0x1d7548);})['catch'](function(_0x528678){_0x184393(_0x528678);});});}function getRecipients(_0x297df4){return new BPromise(function(_0x1717df,_0x431bf9){var _0x2591f1=[];var _0x3b9d33=[];_0x297df4[_0x3e9b('0x52')](function(_0x5d9f76){var _0x3f3625=_['startCase'](_0x5d9f76[_0x3e9b('0x53')][_0x3e9b('0x54')]());if(_0x3f3625===_0x3e9b('0x55')){_0x2591f1=_[_0x3e9b('0x56')](_0x2591f1,_0x5d9f76[_0x3e9b('0x57')]);}else{if(_[_0x3e9b('0x41')](_0x3f3625,_0x3e9b('0x58')))_0x3f3625=_0x3f3625[_0x3e9b('0x59')]('queue',_0x3e9b('0x5a'));_0x5d9f76[_0x3e9b('0x57')]['forEach'](function(_0x14fdf7){_0x3b9d33[_0x3e9b('0x5b')](getAgents(_0x3f3625,_0x14fdf7));});}});return BPromise[_0x3e9b('0x5c')](_0x3b9d33)[_0x3e9b('0x26')](function(_0x29772e){_0x2591f1=_[_0x3e9b('0x56')](_0x2591f1,_[_0x3e9b('0x5d')](_0x29772e));_0x1717df(_0x2591f1);})['catch'](function(_0x3df7b9){_0x431bf9(_0x3df7b9);});});}function getAgents(_0x33b997,_0x3146a7){return new BPromise(function(_0x59091f,_0x39ec7){return db[_0x33b997][_0x3e9b('0x4f')]({'where':{'id':_0x3146a7}})[_0x3e9b('0x26')](function(_0x4c0096){return _0x4c0096[_0x3e9b('0x5e')]({'attributes':['id'],'raw':!![]})[_0x3e9b('0x26')](function(_0x108127){var _0xfbf4b1=_[_0x3e9b('0x5f')](_0x108127,'id');_0x59091f(_0xfbf4b1);});})[_0x3e9b('0x60')](function(_0xbd9129){_0x39ec7(_0xbd9129);});});} \ No newline at end of file +var _0x6f1a=['offset','undefined','count','limit','set','Content-Range','reject','then','destroy','end','error','stack','name','send','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','parse','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','team','some','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','join','sequelize','transaction','UserNotification','create','recipient','userNotification:send','catch','text','html','Invalid\x20\x27TemplateId\x27\x20parameter','forEach','startCase','toLowerCase','User','union','ids','queue','replace','Queue','all','flatten','findOne','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status'];(function(_0x33c2af,_0x163198){var _0x13c04a=function(_0x4de68e){while(--_0x4de68e){_0x33c2af['push'](_0x33c2af['shift']());}};_0x13c04a(++_0x163198);}(_0x6f1a,0xfb));var _0xa6f1=function(_0x1cbf5c,_0x43b975){_0x1cbf5c=_0x1cbf5c-0x0;var _0x207a03=_0x6f1a[_0x1cbf5c];return _0x207a03;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6f1('0x0'));var zipdir=require(_0xa6f1('0x1'));var jsonpatch=require(_0xa6f1('0x2'));var rp=require(_0xa6f1('0x3'));var moment=require(_0xa6f1('0x4'));var BPromise=require(_0xa6f1('0x5'));var Mustache=require('mustache');var util=require(_0xa6f1('0x6'));var path=require('path');var sox=require(_0xa6f1('0x7'));var csv=require(_0xa6f1('0x8'));var ejs=require(_0xa6f1('0x9'));var fs=require('fs');var fs_extra=require(_0xa6f1('0xa'));var _=require('lodash');var squel=require(_0xa6f1('0xb'));var crypto=require(_0xa6f1('0xc'));var jsforce=require(_0xa6f1('0xd'));var deskjs=require(_0xa6f1('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa6f1('0xf'));var Redis=require(_0xa6f1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa6f1('0x11'));var as=require(_0xa6f1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6f1('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa6f1('0x14'));var licenseUtil=require(_0xa6f1('0x15'));var db=require(_0xa6f1('0x16'))['db'];config[_0xa6f1('0x17')]=_[_0xa6f1('0x18')](config[_0xa6f1('0x17')],{'host':_0xa6f1('0x19'),'port':0x18eb});var socket=require(_0xa6f1('0x1a'))(new Redis(config[_0xa6f1('0x17')]));require(_0xa6f1('0x1b'))[_0xa6f1('0x1c')](socket);function respondWithStatusCode(_0x556cb5,_0x10da61){_0x10da61=_0x10da61||0xcc;return function(_0x2eda61){if(_0x2eda61){return _0x556cb5[_0xa6f1('0x1d')](_0x10da61);}return _0x556cb5[_0xa6f1('0x1e')](_0x10da61)['end']();};}function respondWithResult(_0x2760f2,_0x13f984){_0x13f984=_0x13f984||0xc8;return function(_0xa84dc5){if(_0xa84dc5){return _0x2760f2[_0xa6f1('0x1e')](_0x13f984)['json'](_0xa84dc5);}};}function respondWithFilteredResult(_0x48ddad,_0x847c55){return function(_0x354d10){if(_0x354d10){var _0x4fa2a5=typeof _0x847c55[_0xa6f1('0x1f')]===_0xa6f1('0x20')&&typeof _0x847c55['limit']===_0xa6f1('0x20');var _0x18fe1b=_0x354d10[_0xa6f1('0x21')];var _0x336b37=_0x4fa2a5?0x0:_0x847c55[_0xa6f1('0x1f')];var _0xa5cd0a=_0x4fa2a5?_0x354d10[_0xa6f1('0x21')]:_0x847c55[_0xa6f1('0x1f')]+_0x847c55[_0xa6f1('0x22')];var _0x228492;if(_0xa5cd0a>=_0x18fe1b){_0xa5cd0a=_0x18fe1b;_0x228492=0xc8;}else{_0x228492=0xce;}_0x48ddad[_0xa6f1('0x1e')](_0x228492);return _0x48ddad[_0xa6f1('0x23')](_0xa6f1('0x24'),_0x336b37+'-'+_0xa5cd0a+'/'+_0x18fe1b)['json'](_0x354d10);}return null;};}function patchUpdates(_0x17df99){return function(_0x1b84ae){try{jsonpatch['apply'](_0x1b84ae,_0x17df99,!![]);}catch(_0xa58df){return BPromise[_0xa6f1('0x25')](_0xa58df);}return _0x1b84ae['save']();};}function saveUpdates(_0xd327a0,_0x4cca02){return function(_0x1f0699){if(_0x1f0699){return _0x1f0699['update'](_0xd327a0)[_0xa6f1('0x26')](function(_0x444dd5){return _0x444dd5;});}return null;};}function removeEntity(_0xb6dd7b,_0x11a417){return function(_0x4a8661){if(_0x4a8661){return _0x4a8661[_0xa6f1('0x27')]()[_0xa6f1('0x26')](function(){_0xb6dd7b[_0xa6f1('0x1e')](0xcc)[_0xa6f1('0x28')]();});}};}function handleEntityNotFound(_0x4725e6,_0x2a714c){return function(_0x5f11de){if(!_0x5f11de){_0x4725e6[_0xa6f1('0x1d')](0x194);}return _0x5f11de;};}function handleError(_0x5b4144,_0x1b2816){_0x1b2816=_0x1b2816||0x1f4;return function(_0x2ac98b){logger[_0xa6f1('0x29')](_0x2ac98b[_0xa6f1('0x2a')]);if(_0x2ac98b[_0xa6f1('0x2b')]){delete _0x2ac98b['name'];}_0x5b4144[_0xa6f1('0x1e')](_0x1b2816)[_0xa6f1('0x2c')](_0x2ac98b);};}exports['sendUserNotification']=function(_0x545515,_0x59bac1,_0x5d6e96){if(!_0x545515[_0xa6f1('0x2d')][_0xa6f1('0x2e')]('text')&&!_0x545515[_0xa6f1('0x2d')][_0xa6f1('0x2e')](_0xa6f1('0x2f'))){throw new db[(_0xa6f1('0x30'))][(_0xa6f1('0x31'))](_0xa6f1('0x32'));}else{if(_0x545515[_0xa6f1('0x2d')]['hasOwnProperty'](_0xa6f1('0x2f'))&&!_0x545515[_0xa6f1('0x2d')][_0xa6f1('0x2e')](_0xa6f1('0x33'))){throw new db[(_0xa6f1('0x30'))][(_0xa6f1('0x31'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x545515['body'][_0xa6f1('0x2e')](_0xa6f1('0x34'))){throw new db['Sequelize'][(_0xa6f1('0x31'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x495e0e=JSON[_0xa6f1('0x35')](_0x545515[_0xa6f1('0x2d')]['recipients']);}catch(_0x2a97dc){logger[_0xa6f1('0x29')](_0x2a97dc);throw new db['Sequelize'][(_0xa6f1('0x31'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x4ba5e3=[_0xa6f1('0x36'),_0xa6f1('0x37'),_0xa6f1('0x38'),_0xa6f1('0x39'),'smsqueue',_0xa6f1('0x3a'),_0xa6f1('0x3b'),_0xa6f1('0x3c'),'user'];if(_[_0xa6f1('0x3d')](_0x495e0e,function(_0x52da42){return!_['includes'](_0x4ba5e3,_0x52da42[_0xa6f1('0x3e')]['toLowerCase']());})){throw new db[(_0xa6f1('0x30'))][(_0xa6f1('0x31'))](_0xa6f1('0x3f'));}}}var _0x417299={};_0x417299[_0xa6f1('0x40')]=_0x545515[_0xa6f1('0x2d')][_0xa6f1('0x2e')]('senderName')?_0x545515[_0xa6f1('0x2d')][_0xa6f1('0x40')]:_0x545515['user']['fullname'];_0x417299[_0xa6f1('0x41')]=_[_0xa6f1('0x42')](_0x545515[_0xa6f1('0x2d')][_0xa6f1('0x41')])?null:_0x545515[_0xa6f1('0x2d')][_0xa6f1('0x41')];_0x417299[_0xa6f1('0x43')]=_0x545515[_0xa6f1('0x2d')][_0xa6f1('0x43')]||![];_0x417299[_0xa6f1('0x44')]=_0x545515['user']['id'];return getContent(_0x545515[_0xa6f1('0x2d')])['then'](function(_0x5d2da7){_0x417299[_0xa6f1('0x2d')]=_0x5d2da7;return getRecipients(_0x495e0e);})[_0xa6f1('0x26')](function(_0x5bb90d){_0x417299['recipientsId']=_['sortBy'](_0x5bb90d)[_0xa6f1('0x45')](',');return db[_0xa6f1('0x46')][_0xa6f1('0x47')](function(_0x1eeb29){return db[_0xa6f1('0x48')][_0xa6f1('0x49')](_0x417299,{'raw':!![],'transaction':_0x1eeb29})[_0xa6f1('0x26')](function(_0x5513ed){var _0x1f4fcd={'sender':_0x417299[_0xa6f1('0x40')],'description':_0x417299[_0xa6f1('0x41')],'content':_0x417299['body'],'beep':_0x417299['beep']};_0x5bb90d['forEach'](function(_0x22c309){_0x1f4fcd[_0xa6f1('0x4a')]=_0x22c309;socket['emit'](_0xa6f1('0x4b'),_0x1f4fcd);});return _0x5513ed;});});})[_0xa6f1('0x26')](respondWithResult(_0x59bac1,0xc9))[_0xa6f1('0x4c')](handleError(_0x59bac1,null));};function getContent(_0x4bcf29){return new BPromise(function(_0x4aeb88,_0x2d09a8){if(_0x4bcf29['text']){_0x4aeb88(_0x4bcf29[_0xa6f1('0x4d')]);return;}return db['Template']['findOne']({'attributes':[_0xa6f1('0x4e')],'where':{'id':_0x4bcf29[_0xa6f1('0x2f')]},'raw':!![]})[_0xa6f1('0x26')](function(_0x141bc4){if(!_0x141bc4)throw new db['Sequelize']['ValidationError'](_0xa6f1('0x4f'));var _0x4436fe=Mustache['render'](_0x141bc4[_0xa6f1('0x4e')],_0x4bcf29[_0xa6f1('0x33')]);_0x4aeb88(_0x4436fe);})[_0xa6f1('0x4c')](function(_0x1031ab){_0x2d09a8(_0x1031ab);});});}function getRecipients(_0x1e8141){return new BPromise(function(_0x326232,_0x59e2ca){var _0x228f94=[];var _0x1454b2=[];_0x1e8141[_0xa6f1('0x50')](function(_0x5ca960){var _0x28a4c4=_[_0xa6f1('0x51')](_0x5ca960[_0xa6f1('0x3e')][_0xa6f1('0x52')]());if(_0x28a4c4===_0xa6f1('0x53')){_0x228f94=_[_0xa6f1('0x54')](_0x228f94,_0x5ca960[_0xa6f1('0x55')]);}else{if(_['includes'](_0x28a4c4,_0xa6f1('0x56')))_0x28a4c4=_0x28a4c4[_0xa6f1('0x57')]('queue',_0xa6f1('0x58'));_0x5ca960[_0xa6f1('0x55')][_0xa6f1('0x50')](function(_0x47ced9){_0x1454b2['push'](getAgents(_0x28a4c4,_0x47ced9));});}});return BPromise[_0xa6f1('0x59')](_0x1454b2)[_0xa6f1('0x26')](function(_0x1425b6){_0x228f94=_[_0xa6f1('0x54')](_0x228f94,_[_0xa6f1('0x5a')](_0x1425b6));_0x326232(_0x228f94);})['catch'](function(_0xf6a15){_0x59e2ca(_0xf6a15);});});}function getAgents(_0x1164d1,_0x577f9a){return new BPromise(function(_0x3ca064,_0x55e192){return db[_0x1164d1][_0xa6f1('0x5b')]({'where':{'id':_0x577f9a}})[_0xa6f1('0x26')](function(_0x582150){return _0x582150[_0xa6f1('0x5c')]({'attributes':['id'],'raw':!![]})[_0xa6f1('0x26')](function(_0x114e1a){var _0x18736c=_[_0xa6f1('0x5d')](_0x114e1a,'id');_0x3ca064(_0x18736c);});})[_0xa6f1('0x4c')](function(_0x58f72f){_0x55e192(_0x58f72f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index baffb2a..130add5 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 _0x1a61=['UserNotification','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1580f8,_0x1b448f){var _0x190c06=function(_0x45c2f3){while(--_0x45c2f3){_0x1580f8['push'](_0x1580f8['shift']());}};_0x190c06(++_0x1b448f);}(_0x1a61,0x130));var _0x11a6=function(_0x362d54,_0x3b33df){_0x362d54=_0x362d54-0x0;var _0x557b4f=_0x1a61[_0x362d54];return _0x557b4f;};'use strict';var EventEmitter=require(_0x11a6('0x0'));var UserNotification=require(_0x11a6('0x1'))['db'][_0x11a6('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x11a6('0x3')](0x0);var events={'afterCreate':_0x11a6('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x21fd3b){return function(_0x551c81,_0x18d4b2,_0x3d63ea){UserNotificationEvents[_0x11a6('0x5')](_0x21fd3b+':'+_0x551c81['id'],_0x551c81);UserNotificationEvents[_0x11a6('0x5')](_0x21fd3b,_0x551c81);_0x3d63ea(null);};}for(var e in events){if(events[_0x11a6('0x6')](e)){var event=events[e];UserNotification[_0x11a6('0x7')](e,emitEvent(event));}}module[_0x11a6('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x4da8=['../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','events'];(function(_0x363386,_0x133d90){var _0x231f49=function(_0x2ecb44){while(--_0x2ecb44){_0x363386['push'](_0x363386['shift']());}};_0x231f49(++_0x133d90);}(_0x4da8,0x13f));var _0x84da=function(_0x18b6b3,_0x4fb3cf){_0x18b6b3=_0x18b6b3-0x0;var _0x51579d=_0x4da8[_0x18b6b3];return _0x51579d;};'use strict';var EventEmitter=require(_0x84da('0x0'));var UserNotification=require(_0x84da('0x1'))['db'][_0x84da('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x84da('0x3')](0x0);var events={'afterCreate':_0x84da('0x4'),'afterUpdate':_0x84da('0x5'),'afterDestroy':_0x84da('0x6')};function emitEvent(_0x357f0d){return function(_0x4080ef,_0x12c491,_0x2f113a){UserNotificationEvents[_0x84da('0x7')](_0x357f0d+':'+_0x4080ef['id'],_0x4080ef);UserNotificationEvents['emit'](_0x357f0d,_0x4080ef);_0x2f113a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 5bf6507..1feaa6b 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 _0x61a5=['api','bluebird','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x46ce92,_0x16d867){var _0x4da1c7=function(_0x49428d){while(--_0x49428d){_0x46ce92['push'](_0x46ce92['shift']());}};_0x4da1c7(++_0x16d867);}(_0x61a5,0x19e));var _0x561a=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0x61a5[_0x15ea09];return _0x3e9c78;};'use strict';var _=require(_0x561a('0x0'));var util=require('util');var logger=require(_0x561a('0x1'))(_0x561a('0x2'));var moment=require('moment');var BPromise=require(_0x561a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x561a('0x4'));var rimraf=require(_0x561a('0x5'));var config=require(_0x561a('0x6'));var attributes=require(_0x561a('0x7'));module[_0x561a('0x8')]=function(_0x28ff42,_0x1e2ce1){return _0x28ff42[_0x561a('0x9')]('UserNotification',attributes,{'tableName':_0x561a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x561a('0xb'),'collate':_0x561a('0xc')});}; \ No newline at end of file +var _0x86ba=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userNotification.attributes','exports','userNotifications'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86ba,0x1bd));var _0xa86b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x86ba[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xa86b('0x0'));var util=require('util');var logger=require(_0xa86b('0x1'))(_0xa86b('0x2'));var moment=require(_0xa86b('0x3'));var BPromise=require(_0xa86b('0x4'));var rp=require(_0xa86b('0x5'));var fs=require('fs');var path=require(_0xa86b('0x6'));var rimraf=require('rimraf');var config=require(_0xa86b('0x7'));var attributes=require(_0xa86b('0x8'));module[_0xa86b('0x9')]=function(_0x8092d0,_0x8e5171){return _0x8092d0['define']('UserNotification',attributes,{'tableName':_0xa86b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa86b('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 9221336..77bc46a 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 _0xe604=['socket.io-emitter','./userNotification.socket','register','request','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','localhost'];(function(_0x395928,_0x51afb0){var _0x4efda4=function(_0x3a422e){while(--_0x3a422e){_0x395928['push'](_0x395928['shift']());}};_0x4efda4(++_0x51afb0);}(_0xe604,0x1ee));var _0x4e60=function(_0x57a2f9,_0x55231b){_0x57a2f9=_0x57a2f9-0x0;var _0x3c68b9=_0xe604[_0x57a2f9];return _0x3c68b9;};'use strict';var _=require(_0x4e60('0x0'));var util=require(_0x4e60('0x1'));var moment=require(_0x4e60('0x2'));var BPromise=require(_0x4e60('0x3'));var rs=require(_0x4e60('0x4'));var fs=require('fs');var Redis=require(_0x4e60('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e60('0x6'));var logger=require(_0x4e60('0x7'))(_0x4e60('0x8'));var config=require(_0x4e60('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x4e60('0xa')]=_['defaults'](config[_0x4e60('0xa')],{'host':_0x4e60('0xb'),'port':0x18eb});var socket=require(_0x4e60('0xc'))(new Redis(config[_0x4e60('0xa')]));require(_0x4e60('0xd'))[_0x4e60('0xe')](socket);function respondWithRpcPromise(_0x2ed5f8,_0x5c74f9,_0x177c91){return new BPromise(function(_0x525ce7,_0x13d3c3){return client[_0x4e60('0xf')](_0x2ed5f8,_0x177c91)['then'](function(_0x5ceb73){logger['info'](_0x4e60('0x10'),_0x5c74f9,_0x4e60('0x11'));logger['debug'](_0x4e60('0x12'),_0x5c74f9,_0x4e60('0x11'),JSON['stringify'](_0x5ceb73));if(_0x5ceb73[_0x4e60('0x13')]){if(_0x5ceb73[_0x4e60('0x13')][_0x4e60('0x14')]===0x1f4){logger[_0x4e60('0x13')](_0x4e60('0x10'),_0x5c74f9,_0x5ceb73['error'][_0x4e60('0x15')]);return _0x13d3c3(_0x5ceb73['error']['message']);}logger['error'](_0x4e60('0x10'),_0x5c74f9,_0x5ceb73[_0x4e60('0x13')][_0x4e60('0x15')]);return _0x525ce7(_0x5ceb73['error'][_0x4e60('0x15')]);}else{logger[_0x4e60('0x16')](_0x4e60('0x10'),_0x5c74f9,'request\x20sent');_0x525ce7(_0x5ceb73['result']['message']);}})['catch'](function(_0x35e577){logger['error'](_0x4e60('0x10'),_0x5c74f9,_0x35e577);_0x13d3c3(_0x35e577);});});} \ No newline at end of file +var _0x90c7=['http','redis','defaults','socket.io-emitter','./userNotification.socket','register','request','info','request\x20sent','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x2af46d,_0x2e7acb){var _0x2251c7=function(_0x5056da){while(--_0x5056da){_0x2af46d['push'](_0x2af46d['shift']());}};_0x2251c7(++_0x2e7acb);}(_0x90c7,0x168));var _0x790c=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x90c7[_0x5b561d];return _0x431060;};'use strict';var _=require('lodash');var util=require(_0x790c('0x0'));var moment=require(_0x790c('0x1'));var BPromise=require(_0x790c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x790c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x790c('0x4'))(_0x790c('0x5'));var config=require(_0x790c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x790c('0x7')][_0x790c('0x8')]({'port':0x232a});config[_0x790c('0x9')]=_[_0x790c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x790c('0xb'))(new Redis(config[_0x790c('0x9')]));require(_0x790c('0xc'))[_0x790c('0xd')](socket);function respondWithRpcPromise(_0x10100f,_0x5f2807,_0x663d2){return new BPromise(function(_0x448f97,_0x57d694){return client[_0x790c('0xe')](_0x10100f,_0x663d2)['then'](function(_0x5f0221){logger[_0x790c('0xf')]('UserNotification,\x20%s,\x20%s',_0x5f2807,_0x790c('0x10'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x5f2807,_0x790c('0x10'),JSON[_0x790c('0x11')](_0x5f0221));if(_0x5f0221[_0x790c('0x12')]){if(_0x5f0221[_0x790c('0x12')][_0x790c('0x13')]===0x1f4){logger[_0x790c('0x12')](_0x790c('0x14'),_0x5f2807,_0x5f0221[_0x790c('0x12')]['message']);return _0x57d694(_0x5f0221[_0x790c('0x12')]['message']);}logger[_0x790c('0x12')](_0x790c('0x14'),_0x5f2807,_0x5f0221[_0x790c('0x12')][_0x790c('0x15')]);return _0x448f97(_0x5f0221['error']['message']);}else{logger[_0x790c('0xf')](_0x790c('0x14'),_0x5f2807,_0x790c('0x10'));_0x448f97(_0x5f0221[_0x790c('0x16')][_0x790c('0x15')]);}})['catch'](function(_0x408857){logger['error']('UserNotification,\x20%s,\x20%s',_0x5f2807,_0x408857);_0x57d694(_0x408857);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 87b4b02..5f5ba27 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 _0x80e4=['userNotification:','./userNotification.events','remove','emit','removeListener','register','length'];(function(_0x49a93b,_0x581d92){var _0x1d589d=function(_0x2de326){while(--_0x2de326){_0x49a93b['push'](_0x49a93b['shift']());}};_0x1d589d(++_0x581d92);}(_0x80e4,0x112));var _0x480e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x80e4[_0x29b609];return _0x54c952;};'use strict';var UserNotificationEvents=require(_0x480e('0x0'));var events=['save',_0x480e('0x1'),'update'];function createListener(_0x5a4114,_0x243577){return function(_0x2a8a3c){_0x243577[_0x480e('0x2')](_0x5a4114,_0x2a8a3c);};}function removeListener(_0x1701d2,_0x3703d2){return function(){UserNotificationEvents[_0x480e('0x3')](_0x1701d2,_0x3703d2);};}exports[_0x480e('0x4')]=function(_0x4eb6b2){for(var _0x3f048e=0x0,_0x25111a=events[_0x480e('0x5')];_0x3f048e<_0x25111a;_0x3f048e++){var _0x21cc8c=events[_0x3f048e];var _0x356fb6=createListener(_0x480e('0x6')+_0x21cc8c,_0x4eb6b2);UserNotificationEvents['on'](_0x21cc8c,_0x356fb6);}}; \ No newline at end of file +var _0x5aad=['removeListener','register','length','userNotification:','./userNotification.events','save','update'];(function(_0x2c183f,_0x1be236){var _0x54a114=function(_0x19e8d8){while(--_0x19e8d8){_0x2c183f['push'](_0x2c183f['shift']());}};_0x54a114(++_0x1be236);}(_0x5aad,0x1a8));var _0xd5aa=function(_0x14668d,_0x39ccff){_0x14668d=_0x14668d-0x0;var _0x1efea6=_0x5aad[_0x14668d];return _0x1efea6;};'use strict';var UserNotificationEvents=require(_0xd5aa('0x0'));var events=[_0xd5aa('0x1'),'remove',_0xd5aa('0x2')];function createListener(_0x2f8398,_0x4b6ac0){return function(_0x34eaee){_0x4b6ac0['emit'](_0x2f8398,_0x34eaee);};}function removeListener(_0xad2cc4,_0x19cd1c){return function(){UserNotificationEvents[_0xd5aa('0x3')](_0xad2cc4,_0x19cd1c);};}exports[_0xd5aa('0x4')]=function(_0x3b7897){for(var _0x1953e8=0x0,_0x2d2c57=events[_0xd5aa('0x5')];_0x1953e8<_0x2d2c57;_0x1953e8++){var _0x1adc03=events[_0x1953e8];var _0x5db07e=createListener(_0xd5aa('0x6')+_0x1adc03,_0x3b7897);UserNotificationEvents['on'](_0x1adc03,_0x5db07e);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index cb86f9b..3e8cb8d 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3b3997,_0x1150d6){var _0x51e093=function(_0x1fd66d){while(--_0x1fd66d){_0x3b3997['push'](_0x3b3997['shift']());}};_0x51e093(++_0x1150d6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4acb60,_0x4413b4){var _0x5c75e6=function(_0x4912a2){while(--_0x4912a2){_0x4acb60['push'](_0x4acb60['shift']());}};_0x5c75e6(++_0x4413b4);}(_0xe706,0xa3));var _0x6e70=function(_0x389213,_0x14a50d){_0x389213=_0x389213-0x0;var _0x4ad6ca=_0xe706[_0x389213];return _0x4ad6ca;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index aeee6de..a4e78c2 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 _0x9512=['exports','INTEGER','sequelize'];(function(_0x18cfab,_0x4586ff){var _0x4dd5e5=function(_0x24c31a){while(--_0x24c31a){_0x18cfab['push'](_0x18cfab['shift']());}};_0x4dd5e5(++_0x4586ff);}(_0x9512,0x1ac));var _0x2951=function(_0x21e034,_0x59fc14){_0x21e034=_0x21e034-0x0;var _0x1faab3=_0x9512[_0x21e034];return _0x1faab3;};'use strict';var Sequelize=require(_0x2951('0x0'));module[_0x2951('0x1')]={'penalty':{'type':Sequelize[_0x2951('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4226=['exports'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x4226,0x1dc));var _0x6422=function(_0x2332a9,_0x25c511){_0x2332a9=_0x2332a9-0x0;var _0x459e7e=_0x4226[_0x2332a9];return _0x459e7e;};'use strict';var Sequelize=require('sequelize');module[_0x6422('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 537dd22..d6fc7d1 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 _0x122a=['api','moment','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','util','../../config/logger'];(function(_0x1b6bad,_0x25fcf2){var _0x19f321=function(_0x3230bd){while(--_0x3230bd){_0x1b6bad['push'](_0x1b6bad['shift']());}};_0x19f321(++_0x25fcf2);}(_0x122a,0x76));var _0xa122=function(_0x5bf2f0,_0x1dde34){_0x5bf2f0=_0x5bf2f0-0x0;var _0x40f1a3=_0x122a[_0x5bf2f0];return _0x40f1a3;};'use strict';var _=require('lodash');var util=require(_0xa122('0x0'));var logger=require(_0xa122('0x1'))(_0xa122('0x2'));var moment=require(_0xa122('0x3'));var BPromise=require(_0xa122('0x4'));var rp=require(_0xa122('0x5'));var fs=require('fs');var path=require(_0xa122('0x6'));var rimraf=require('rimraf');var config=require(_0xa122('0x7'));var attributes=require(_0xa122('0x8'));module[_0xa122('0x9')]=function(_0x3acb4f,_0x501432){return _0x3acb4f[_0xa122('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0xa122('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb521=['./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4ccad7,_0x2daf62){var _0x3a1bc0=function(_0x179659){while(--_0x179659){_0x4ccad7['push'](_0x4ccad7['shift']());}};_0x3a1bc0(++_0x2daf62);}(_0xb521,0xe6));var _0x1b52=function(_0x494729,_0x5e7943){_0x494729=_0x494729-0x0;var _0x5223bf=_0xb521[_0x494729];return _0x5223bf;};'use strict';var _=require(_0x1b52('0x0'));var util=require(_0x1b52('0x1'));var logger=require(_0x1b52('0x2'))(_0x1b52('0x3'));var moment=require(_0x1b52('0x4'));var BPromise=require(_0x1b52('0x5'));var rp=require(_0x1b52('0x6'));var fs=require('fs');var path=require(_0x1b52('0x7'));var rimraf=require(_0x1b52('0x8'));var config=require(_0x1b52('0x9'));var attributes=require(_0x1b52('0xa'));module[_0x1b52('0xb')]=function(_0x431807,_0x5cc693){return _0x431807[_0x1b52('0xc')](_0x1b52('0xd'),attributes,{'tableName':_0x1b52('0xe'),'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 a088c8b..d3efd6d 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 _0x697b=['../../config/environment','jayson/promise','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4c2080,_0x57e205){var _0x521734=function(_0xde51df){while(--_0xde51df){_0x4c2080['push'](_0x4c2080['shift']());}};_0x521734(++_0x57e205);}(_0x697b,0x14f));var _0xb697=function(_0x306835,_0x537326){_0x306835=_0x306835-0x0;var _0x5d6215=_0x697b[_0x306835];return _0x5d6215;};'use strict';var _=require(_0xb697('0x0'));var util=require(_0xb697('0x1'));var moment=require(_0xb697('0x2'));var BPromise=require('bluebird');var rs=require(_0xb697('0x3'));var fs=require('fs');var Redis=require(_0xb697('0x4'));var db=require(_0xb697('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb697('0x6'))('rpc');var config=require(_0xb697('0x7'));var jayson=require(_0xb697('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29274f,_0xd48289,_0x50aedb){return new BPromise(function(_0xb69390,_0x453241){return client[_0xb697('0x9')](_0x29274f,_0x50aedb)[_0xb697('0xa')](function(_0x3d61ed){logger[_0xb697('0xb')](_0xb697('0xc'),_0xd48289,'request\x20sent');logger[_0xb697('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0xd48289,_0xb697('0xe'),JSON[_0xb697('0xf')](_0x3d61ed));if(_0x3d61ed[_0xb697('0x10')]){if(_0x3d61ed[_0xb697('0x10')]['code']===0x1f4){logger['error'](_0xb697('0xc'),_0xd48289,_0x3d61ed['error'][_0xb697('0x11')]);return _0x453241(_0x3d61ed[_0xb697('0x10')][_0xb697('0x11')]);}logger['error'](_0xb697('0xc'),_0xd48289,_0x3d61ed[_0xb697('0x10')][_0xb697('0x11')]);return _0xb69390(_0x3d61ed[_0xb697('0x10')][_0xb697('0x11')]);}else{logger['info'](_0xb697('0xc'),_0xd48289,_0xb697('0xe'));_0xb69390(_0x3d61ed['result'][_0xb697('0x11')]);}})[_0xb697('0x12')](function(_0x309ac2){logger[_0xb697('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xd48289,_0x309ac2);_0x453241(_0x309ac2);});});} \ No newline at end of file +var _0x94d1=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x5a4bcb,_0x546a3e){var _0x5e8c97=function(_0x210f8e){while(--_0x210f8e){_0x5a4bcb['push'](_0x5a4bcb['shift']());}};_0x5e8c97(++_0x546a3e);}(_0x94d1,0x1a0));var _0x194d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94d1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x194d('0x0'));var util=require(_0x194d('0x1'));var moment=require('moment');var BPromise=require(_0x194d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x194d('0x3'));var db=require(_0x194d('0x4'))['db'];var utils=require(_0x194d('0x5'));var logger=require(_0x194d('0x6'))(_0x194d('0x7'));var config=require(_0x194d('0x8'));var jayson=require(_0x194d('0x9'));var client=jayson[_0x194d('0xa')][_0x194d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f25d2,_0x26c2fc,_0x2c4b4f){return new BPromise(function(_0x4bcfb7,_0xc2cff2){return client[_0x194d('0xc')](_0x3f25d2,_0x2c4b4f)[_0x194d('0xd')](function(_0x1930ce){logger[_0x194d('0xe')](_0x194d('0xf'),_0x26c2fc,_0x194d('0x10'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x26c2fc,_0x194d('0x10'),JSON[_0x194d('0x11')](_0x1930ce));if(_0x1930ce['error']){if(_0x1930ce[_0x194d('0x12')][_0x194d('0x13')]===0x1f4){logger[_0x194d('0x12')](_0x194d('0xf'),_0x26c2fc,_0x1930ce[_0x194d('0x12')][_0x194d('0x14')]);return _0xc2cff2(_0x1930ce[_0x194d('0x12')][_0x194d('0x14')]);}logger[_0x194d('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x26c2fc,_0x1930ce[_0x194d('0x12')][_0x194d('0x14')]);return _0x4bcfb7(_0x1930ce[_0x194d('0x12')][_0x194d('0x14')]);}else{logger[_0x194d('0xe')](_0x194d('0xf'),_0x26c2fc,_0x194d('0x10'));_0x4bcfb7(_0x1930ce[_0x194d('0x15')]['message']);}})['catch'](function(_0xdc4ae6){logger[_0x194d('0x12')](_0x194d('0xf'),_0x26c2fc,_0xdc4ae6);_0xc2cff2(_0xdc4ae6);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index c06153c..f689d3c 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 _0xc43c=['removeSections','removeResources','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','getResources','post','create','/:id/resources','addResources','put','delete','destroy'];(function(_0x41ddca,_0x57e1c0){var _0x516a45=function(_0x54c0b8){while(--_0x54c0b8){_0x41ddca['push'](_0x41ddca['shift']());}};_0x516a45(++_0x57e1c0);}(_0xc43c,0x152));var _0xcc43=function(_0x1690e4,_0x46ec39){_0x1690e4=_0x1690e4-0x0;var _0x37ad42=_0xc43c[_0x1690e4];return _0x37ad42;};'use strict';var multer=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var path=require(_0xcc43('0x2'));var timeout=require(_0xcc43('0x3'));var express=require(_0xcc43('0x4'));var router=express[_0xcc43('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcc43('0x6'));var interaction=require(_0xcc43('0x7'));var config=require('../../config/environment');var controller=require(_0xcc43('0x8'));router[_0xcc43('0x9')]('/',auth[_0xcc43('0xa')](),controller[_0xcc43('0xb')]);router[_0xcc43('0x9')](_0xcc43('0xc'),auth[_0xcc43('0xa')](),controller[_0xcc43('0xd')]);router[_0xcc43('0x9')](_0xcc43('0xe'),auth['isAuthenticated'](),controller[_0xcc43('0xf')]);router[_0xcc43('0x9')](_0xcc43('0x10'),auth[_0xcc43('0xa')](),controller[_0xcc43('0x11')]);router[_0xcc43('0x9')]('/:id/resources',auth[_0xcc43('0xa')](),controller[_0xcc43('0x12')]);router[_0xcc43('0x13')]('/',auth[_0xcc43('0xa')](),controller[_0xcc43('0x14')]);router[_0xcc43('0x13')]('/:id/clone',auth[_0xcc43('0xa')](),controller['clone']);router[_0xcc43('0x13')](_0xcc43('0x10'),auth['isAuthenticated'](),controller['addSections']);router[_0xcc43('0x13')](_0xcc43('0x15'),auth[_0xcc43('0xa')](),controller[_0xcc43('0x16')]);router[_0xcc43('0x17')](_0xcc43('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xcc43('0x18')](_0xcc43('0xe'),auth[_0xcc43('0xa')](),controller[_0xcc43('0x19')]);router['delete'](_0xcc43('0x10'),auth[_0xcc43('0xa')](),controller[_0xcc43('0x1a')]);router['delete']('/:id/resources',auth[_0xcc43('0xa')](),controller[_0xcc43('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xafb9=['removeResources','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','put','update','delete','destroy','removeSections'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xafb9,0x7d));var _0x9afb=function(_0xe17b06,_0x51cb33){_0xe17b06=_0xe17b06-0x0;var _0x38374f=_0xafb9[_0xe17b06];return _0x38374f;};'use strict';var multer=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var path=require(_0x9afb('0x2'));var timeout=require(_0x9afb('0x3'));var express=require('express');var router=express[_0x9afb('0x4')]();var fs_extra=require(_0x9afb('0x5'));var auth=require(_0x9afb('0x6'));var interaction=require(_0x9afb('0x7'));var config=require(_0x9afb('0x8'));var controller=require(_0x9afb('0x9'));router[_0x9afb('0xa')]('/',auth[_0x9afb('0xb')](),controller[_0x9afb('0xc')]);router[_0x9afb('0xa')](_0x9afb('0xd'),auth[_0x9afb('0xb')](),controller['describe']);router['get'](_0x9afb('0xe'),auth['isAuthenticated'](),controller[_0x9afb('0xf')]);router['get'](_0x9afb('0x10'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x11')]);router[_0x9afb('0xa')](_0x9afb('0x12'),auth['isAuthenticated'](),controller[_0x9afb('0x13')]);router[_0x9afb('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9afb('0x14')](_0x9afb('0x15'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x16')]);router[_0x9afb('0x14')](_0x9afb('0x10'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x17')]);router['post'](_0x9afb('0x12'),auth['isAuthenticated'](),controller[_0x9afb('0x18')]);router[_0x9afb('0x19')](_0x9afb('0xe'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x1a')]);router[_0x9afb('0x1b')](_0x9afb('0xe'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x1c')]);router[_0x9afb('0x1b')](_0x9afb('0x10'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x1d')]);router[_0x9afb('0x1b')](_0x9afb('0x12'),auth[_0x9afb('0xb')](),controller[_0x9afb('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 9445c84..5f6606e 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 _0xc043=['BOOLEAN','sequelize','exports','STRING','name','crudPermissions','join','getDataValue'];(function(_0x3ef3c2,_0x230b77){var _0x2c1466=function(_0x1fa99f){while(--_0x1fa99f){_0x3ef3c2['push'](_0x3ef3c2['shift']());}};_0x2c1466(++_0x230b77);}(_0xc043,0xd1));var _0x3c04=function(_0x4354ca,_0x28aa39){_0x4354ca=_0x4354ca-0x0;var _0x2d35c7=_0xc043[_0x4354ca];return _0x2d35c7;};'use strict';var Sequelize=require(_0x3c04('0x0'));module[_0x3c04('0x1')]={'name':{'type':Sequelize[_0x3c04('0x2')],'allowNull':![],'unique':_0x3c04('0x3')},'crudPermissions':{'type':Sequelize[_0x3c04('0x2')],'set':function(_0x3ffe8c){this['setDataValue'](_0x3c04('0x4'),_0x3ffe8c?_0x3ffe8c[_0x3c04('0x5')](''):[]);},'get':function(){return this[_0x3c04('0x6')](_0x3c04('0x4'))?this[_0x3c04('0x6')](_0x3c04('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x3c04('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x3c04('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x3c04('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x3c04('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x3c04('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x3c04('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x3c04('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8a2c=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join'];(function(_0x122ee6,_0x28f035){var _0x130259=function(_0x5c88bd){while(--_0x5c88bd){_0x122ee6['push'](_0x122ee6['shift']());}};_0x130259(++_0x28f035);}(_0x8a2c,0x107));var _0xc8a2=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x8a2c[_0xbf8ebe];return _0x1e25e8;};'use strict';var Sequelize=require(_0xc8a2('0x0'));module[_0xc8a2('0x1')]={'name':{'type':Sequelize[_0xc8a2('0x2')],'allowNull':![],'unique':_0xc8a2('0x3')},'crudPermissions':{'type':Sequelize[_0xc8a2('0x2')],'set':function(_0x1be94a){this[_0xc8a2('0x4')](_0xc8a2('0x5'),_0x1be94a?_0x1be94a[_0xc8a2('0x6')](''):[]);},'get':function(){return this[_0xc8a2('0x7')]('crudPermissions')?this[_0xc8a2('0x7')](_0xc8a2('0x5'))[_0xc8a2('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xc8a2('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xc8a2('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xc8a2('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xc8a2('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xc8a2('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index fcca6b1..3878ad1 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 _0xf19c=['omit','updatedAt','crudPermissions','body','createdAt','sequelize','transaction','UserProfileSection','findAll','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','addSections','each','get','removeSections','ids','enabled','includes','isEmpty','subsections','push','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','end','name','send','map','UserProfile','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','pick','VIRTUAL','filter','merge','options','include','rows','catch','show','params','keys','includeAll','find','create','clone'];(function(_0x439204,_0x402d9a){var _0x24bc7c=function(_0x3cc582){while(--_0x3cc582){_0x439204['push'](_0x439204['shift']());}};_0x24bc7c(++_0x402d9a);}(_0xf19c,0x10b));var _0xcf19=function(_0x45e0bb,_0x4b1d6e){_0x45e0bb=_0x45e0bb-0x0;var _0x522f19=_0xf19c[_0x45e0bb];return _0x522f19;};'use strict';var emlformat=require(_0xcf19('0x0'));var rimraf=require(_0xcf19('0x1'));var zipdir=require(_0xcf19('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf19('0x3'));var moment=require(_0xcf19('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcf19('0x5'));var util=require(_0xcf19('0x6'));var path=require(_0xcf19('0x7'));var sox=require(_0xcf19('0x8'));var csv=require(_0xcf19('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf19('0xa'));var _=require(_0xcf19('0xb'));var squel=require(_0xcf19('0xc'));var crypto=require(_0xcf19('0xd'));var jsforce=require(_0xcf19('0xe'));var deskjs=require(_0xcf19('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcf19('0x10'));var Papa=require(_0xcf19('0x11'));var Redis=require(_0xcf19('0x12'));var authService=require(_0xcf19('0x13'));var qs=require(_0xcf19('0x14'));var as=require(_0xcf19('0x15'));var hardwareService=require(_0xcf19('0x16'));var logger=require(_0xcf19('0x17'))(_0xcf19('0x18'));var utils=require('../../config/utils');var config=require(_0xcf19('0x19'));var licenseUtil=require(_0xcf19('0x1a'));var db=require(_0xcf19('0x1b'))['db'];config[_0xcf19('0x1c')]=_[_0xcf19('0x1d')](config[_0xcf19('0x1c')],{'host':_0xcf19('0x1e'),'port':0x18eb});var socket=require(_0xcf19('0x1f'))(new Redis(config[_0xcf19('0x1c')]));require(_0xcf19('0x20'))[_0xcf19('0x21')](socket);function respondWithStatusCode(_0x1c196a,_0x29d157){_0x29d157=_0x29d157||0xcc;return function(_0x2ecd0b){if(_0x2ecd0b){return _0x1c196a[_0xcf19('0x22')](_0x29d157);}return _0x1c196a[_0xcf19('0x23')](_0x29d157)['end']();};}function respondWithResult(_0x5c932c,_0x1161bb){_0x1161bb=_0x1161bb||0xc8;return function(_0x1d15dd){if(_0x1d15dd){return _0x5c932c[_0xcf19('0x23')](_0x1161bb)[_0xcf19('0x24')](_0x1d15dd);}};}function respondWithFilteredResult(_0x22d313,_0xbd06db){return function(_0x5f3fc0){if(_0x5f3fc0){var _0xe1a1e3=typeof _0xbd06db[_0xcf19('0x25')]==='undefined'&&typeof _0xbd06db[_0xcf19('0x26')]==='undefined';var _0x3ccc9f=_0x5f3fc0['count'];var _0x24bfb2=_0xe1a1e3?0x0:_0xbd06db[_0xcf19('0x25')];var _0x3cc3e3=_0xe1a1e3?_0x5f3fc0[_0xcf19('0x27')]:_0xbd06db[_0xcf19('0x25')]+_0xbd06db[_0xcf19('0x26')];var _0x4d68ad;if(_0x3cc3e3>=_0x3ccc9f){_0x3cc3e3=_0x3ccc9f;_0x4d68ad=0xc8;}else{_0x4d68ad=0xce;}_0x22d313['status'](_0x4d68ad);return _0x22d313[_0xcf19('0x28')](_0xcf19('0x29'),_0x24bfb2+'-'+_0x3cc3e3+'/'+_0x3ccc9f)[_0xcf19('0x24')](_0x5f3fc0);}return null;};}function patchUpdates(_0x58ed76){return function(_0x3adcf){try{jsonpatch[_0xcf19('0x2a')](_0x3adcf,_0x58ed76,!![]);}catch(_0x3cc7a1){return BPromise[_0xcf19('0x2b')](_0x3cc7a1);}return _0x3adcf['save']();};}function saveUpdates(_0x5d4004,_0xf2bda6){return function(_0x381dfa){if(_0x381dfa){return _0x381dfa[_0xcf19('0x2c')](_0x5d4004)[_0xcf19('0x2d')](function(_0x237e8b){return _0x237e8b;});}return null;};}function removeEntity(_0x1e87d8,_0x1d9742){return function(_0x5907c8){if(_0x5907c8){return _0x5907c8['destroy']()[_0xcf19('0x2d')](function(){_0x1e87d8[_0xcf19('0x23')](0xcc)[_0xcf19('0x2e')]();});}};}function handleEntityNotFound(_0x982593,_0x341d8b){return function(_0x188b9c){if(!_0x188b9c){_0x982593[_0xcf19('0x22')](0x194);}return _0x188b9c;};}function handleError(_0x1d303d,_0x36c681){_0x36c681=_0x36c681||0x1f4;return function(_0x64481){logger['error'](_0x64481['stack']);if(_0x64481[_0xcf19('0x2f')]){delete _0x64481['name'];}_0x1d303d[_0xcf19('0x23')](_0x36c681)[_0xcf19('0x30')](_0x64481);};}exports['index']=function(_0x1c96ab,_0x1a47a1){var _0x150215={},_0x4bfe2c={},_0x5654bc={'count':0x0,'rows':[]};var _0xfe9d04=_[_0xcf19('0x31')](db[_0xcf19('0x32')][_0xcf19('0x33')],function(_0x4b094a){return{'name':_0x4b094a[_0xcf19('0x34')],'type':_0x4b094a[_0xcf19('0x35')]['key']};});_0x4bfe2c[_0xcf19('0x36')]=_[_0xcf19('0x31')](_0xfe9d04,_0xcf19('0x2f'));_0x4bfe2c[_0xcf19('0x37')]=_['keys'](_0x1c96ab['query']);_0x4bfe2c[_0xcf19('0x38')]=_['intersection'](_0x4bfe2c[_0xcf19('0x36')],_0x4bfe2c[_0xcf19('0x37')]);_0x150215['attributes']=_[_0xcf19('0x39')](_0x4bfe2c[_0xcf19('0x36')],qs[_0xcf19('0x3a')](_0x1c96ab[_0xcf19('0x37')][_0xcf19('0x3a')]));_0x150215[_0xcf19('0x3b')]=_0x150215[_0xcf19('0x3b')][_0xcf19('0x3c')]?_0x150215[_0xcf19('0x3b')]:_0x4bfe2c['model'];if(!_0x1c96ab[_0xcf19('0x37')]['hasOwnProperty'](_0xcf19('0x3d'))){_0x150215[_0xcf19('0x26')]=qs[_0xcf19('0x26')](_0x1c96ab[_0xcf19('0x37')]['limit']);_0x150215[_0xcf19('0x25')]=qs[_0xcf19('0x25')](_0x1c96ab[_0xcf19('0x37')][_0xcf19('0x25')]);}_0x150215[_0xcf19('0x3e')]=qs['sort'](_0x1c96ab['query']['sort']);_0x150215['where']=qs[_0xcf19('0x38')](_[_0xcf19('0x3f')](_0x1c96ab[_0xcf19('0x37')],_0x4bfe2c[_0xcf19('0x38')]),_0xfe9d04);if(_0x1c96ab[_0xcf19('0x37')]['filter']){_0x150215['where']=_['merge'](_0x150215['where'],{'$or':_['map'](_0xfe9d04,function(_0x5127f3){if(_0x5127f3[_0xcf19('0x35')]!==_0xcf19('0x40')){var _0x134335={};_0x134335[_0x5127f3[_0xcf19('0x2f')]]={'$like':'%'+_0x1c96ab[_0xcf19('0x37')][_0xcf19('0x41')]+'%'};return _0x134335;}})});}_0x150215=_[_0xcf19('0x42')]({},_0x150215,_0x1c96ab[_0xcf19('0x43')]);var _0x5e7e65={'where':_0x150215['where']};return db[_0xcf19('0x32')][_0xcf19('0x27')](_0x5e7e65)[_0xcf19('0x2d')](function(_0x3a3a14){_0x5654bc['count']=_0x3a3a14;if(_0x1c96ab['query']['includeAll']){_0x150215[_0xcf19('0x44')]=[{'all':!![]}];}return db[_0xcf19('0x32')]['findAll'](_0x150215);})[_0xcf19('0x2d')](function(_0x3bb253){_0x5654bc[_0xcf19('0x45')]=_0x3bb253;return _0x5654bc;})[_0xcf19('0x2d')](respondWithFilteredResult(_0x1a47a1,_0x150215))[_0xcf19('0x46')](handleError(_0x1a47a1,null));};exports[_0xcf19('0x47')]=function(_0x11d67f,_0x535f89){var _0xcca645={'raw':![],'where':{'id':_0x11d67f[_0xcf19('0x48')]['id']}},_0x4072be={};_0x4072be['model']=_[_0xcf19('0x49')](db[_0xcf19('0x32')]['rawAttributes']);_0x4072be[_0xcf19('0x37')]=_[_0xcf19('0x49')](_0x11d67f[_0xcf19('0x37')]);_0x4072be[_0xcf19('0x38')]=_[_0xcf19('0x39')](_0x4072be['model'],_0x4072be[_0xcf19('0x37')]);_0xcca645['attributes']=_[_0xcf19('0x39')](_0x4072be[_0xcf19('0x36')],qs[_0xcf19('0x3a')](_0x11d67f[_0xcf19('0x37')][_0xcf19('0x3a')]));_0xcca645['attributes']=_0xcca645[_0xcf19('0x3b')]['length']?_0xcca645[_0xcf19('0x3b')]:_0x4072be[_0xcf19('0x36')];if(_0x11d67f[_0xcf19('0x37')][_0xcf19('0x4a')]){_0xcca645[_0xcf19('0x44')]=[{'all':!![]}];}_0xcca645=_[_0xcf19('0x42')]({},_0xcca645,_0x11d67f['options']);return db['UserProfile'][_0xcf19('0x4b')](_0xcca645)['then'](handleEntityNotFound(_0x535f89,null))[_0xcf19('0x2d')](respondWithResult(_0x535f89,null))['catch'](handleError(_0x535f89,null));};exports[_0xcf19('0x4c')]=function(_0x38c833,_0x5f1801){return db[_0xcf19('0x32')][_0xcf19('0x4c')](_0x38c833['body'],{})[_0xcf19('0x2d')](respondWithResult(_0x5f1801,0xc9))[_0xcf19('0x46')](handleError(_0x5f1801,null));};exports[_0xcf19('0x4d')]=function(_0x210635,_0x39a0d1){var _0x5ef0d7={'where':{'id':_0x210635[_0xcf19('0x48')]['id']}},_0x3f6e5e={};_0x3f6e5e[_0xcf19('0x36')]=_[_0xcf19('0x49')](db['UserProfile']['rawAttributes']);_0x5ef0d7[_0xcf19('0x3b')]=_['intersection'](_0x3f6e5e[_0xcf19('0x36')],qs[_0xcf19('0x3a')](_0x210635[_0xcf19('0x37')][_0xcf19('0x3a')]));_0x5ef0d7[_0xcf19('0x3b')]=_0x5ef0d7[_0xcf19('0x3b')][_0xcf19('0x3c')]?_0x5ef0d7['attributes']:_0x3f6e5e[_0xcf19('0x36')];if(_0x210635[_0xcf19('0x37')]['includeAll']){_0x5ef0d7[_0xcf19('0x44')]=[{'all':!![]}];}_0x5ef0d7=_[_0xcf19('0x42')]({},_0x5ef0d7,_0x210635[_0xcf19('0x43')]);return db[_0xcf19('0x32')][_0xcf19('0x4b')](_0x5ef0d7)[_0xcf19('0x2d')](handleEntityNotFound(_0x39a0d1,null))[_0xcf19('0x2d')](function(_0x341160){if(_0x341160){var _0x3cd220=_0x341160['get']({'plain':!![]});_0x3cd220=qs[_0xcf19('0x4e')](_0x3cd220,['id','createdAt',_0xcf19('0x4f'),_0xcf19('0x50')]);_0x210635[_0xcf19('0x51')]=_[_0xcf19('0x4e')](_0x210635[_0xcf19('0x51')],['id',_0xcf19('0x52'),_0xcf19('0x4f')]);return db[_0xcf19('0x53')][_0xcf19('0x54')](function(_0x11a9b3){return db[_0xcf19('0x32')][_0xcf19('0x4c')](_[_0xcf19('0x42')](_0x3cd220,_0x210635[_0xcf19('0x51')]),{'include':_0x210635['query'][_0xcf19('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0x11a9b3})['then'](function(_0x1b2524){var _0x43fbae=_0x1b2524['get']({'plain':!![]});return db[_0xcf19('0x55')][_0xcf19('0x56')]({'where':{'userProfileId':_0x210635[_0xcf19('0x48')]['id']},'raw':!![]})[_0xcf19('0x2d')](function(_0x2ee879){if(_0x2ee879){return BPromise['each'](_0x2ee879,function(_0x30846e){return new BPromise(function(_0xd7e52d,_0x528c98){if(_0x30846e['autoAssociation']===null||_0x30846e[_0xcf19('0x57')]===0x1)_0xd7e52d(null);return db[_0xcf19('0x58')][_0xcf19('0x56')]({'where':{'sectionId':_0x30846e['id']},'raw':!![]})[_0xcf19('0x2d')](function(_0x4bd874){var _0x57650c=_['map'](_0x4bd874,function(_0x24482c){return qs[_0xcf19('0x4e')](_0x24482c,['id',_0xcf19('0x52'),_0xcf19('0x4f'),_0xcf19('0x59')]);});_0xd7e52d(_0x57650c);})[_0xcf19('0x46')](function(_0x1ad1b5){_0x528c98(_0x1ad1b5);});})[_0xcf19('0x2d')](function(_0x336b13){var _0xd5e619=qs['omit'](_0x30846e,['id',_0xcf19('0x52'),_0xcf19('0x4f')]);_0xd5e619[_0xcf19('0x5a')]=_0x43fbae['id'];if(_0x336b13)_0xd5e619['Resources']=_0x336b13;return _0xd5e619;})[_0xcf19('0x2d')](function(_0x5c710a){return db[_0xcf19('0x55')][_0xcf19('0x4c')](_0x5c710a,{'include':[{'model':db[_0xcf19('0x58')],'as':_0xcf19('0x5b')}],'raw':!![],'transaction':_0x11a9b3});});})['then'](function(){return _0x43fbae;});}});});});}})['then'](respondWithResult(_0x39a0d1,0xc9))[_0xcf19('0x46')](handleError(_0x39a0d1,null));};exports[_0xcf19('0x2c')]=function(_0x1a83e3,_0x1ba098){if(_0x1a83e3['body']['id']){delete _0x1a83e3['body']['id'];}return db[_0xcf19('0x32')]['find']({'where':{'id':_0x1a83e3['params']['id']}})['then'](handleEntityNotFound(_0x1ba098,null))[_0xcf19('0x2d')](saveUpdates(_0x1a83e3['body'],null))[_0xcf19('0x2d')](respondWithResult(_0x1ba098,null))['catch'](handleError(_0x1ba098,null));};exports[_0xcf19('0x5c')]=function(_0x375b22,_0x5879ea){return db['UserProfile']['find']({'where':{'id':_0x375b22[_0xcf19('0x48')]['id']}})[_0xcf19('0x2d')](handleEntityNotFound(_0x5879ea,null))[_0xcf19('0x2d')](removeEntity(_0x5879ea,null))[_0xcf19('0x46')](handleError(_0x5879ea,null));};exports[_0xcf19('0x5d')]=function(_0x1ddaf0,_0x4e630f){return db[_0xcf19('0x32')][_0xcf19('0x5d')]()['then'](respondWithResult(_0x4e630f,null))[_0xcf19('0x46')](handleError(_0x4e630f,null));};exports[_0xcf19('0x5e')]=function(_0x514520,_0x526ae7){var _0x6406c9=_0x514520[_0xcf19('0x51')];return db['UserProfile'][_0xcf19('0x4b')]({'where':{'id':_0x514520[_0xcf19('0x48')]['id']}})[_0xcf19('0x2d')](handleEntityNotFound(_0x526ae7,null))[_0xcf19('0x2d')](function(_0xb03e6f){if(_0xb03e6f){return db['sequelize'][_0xcf19('0x54')](function(_0x4a1256){return db[_0xcf19('0x55')][_0xcf19('0x5c')]({'where':{'userProfileId':_0x514520[_0xcf19('0x48')]['id'],'sectionId':_['map'](_0x6406c9,function(_0x7bc15){return _0x7bc15['sectionId'];})},'transaction':_0x4a1256})['then'](function(){var _0xc911c1=_['map'](_0x6406c9,function(_0x9c7e0d){_0x9c7e0d['userProfileId']=_0x514520[_0xcf19('0x48')]['id'];return _0x9c7e0d;});var _0x13ba43=[];return BPromise[_0xcf19('0x5f')](_0xc911c1,function(_0x477389){return db[_0xcf19('0x55')][_0xcf19('0x4c')](_0x477389,{'include':[{'model':db[_0xcf19('0x58')],'as':'Resources'}],'raw':!![],'transaction':_0x4a1256})['then'](function(_0x5ed372){_0x13ba43['push'](_0x5ed372[_0xcf19('0x60')]({'plain':!![]}));});})['then'](function(){return _0x13ba43;});});});}})[_0xcf19('0x2d')](function(_0x26124f){return _0x26124f;})[_0xcf19('0x2d')](respondWithResult(_0x526ae7,null))['catch'](handleError(_0x526ae7,null));};exports[_0xcf19('0x61')]=function(_0x16a007,_0x1b5db4){var _0x2795a0;return db[_0xcf19('0x32')][_0xcf19('0x4b')]({'where':{'id':_0x16a007[_0xcf19('0x48')]['id']},'attributes':['id',_0xcf19('0x2f')]})[_0xcf19('0x2d')](handleEntityNotFound(_0x1b5db4,null))[_0xcf19('0x2d')](function(_0xef73c5){if(_0xef73c5){_0x2795a0=_0xef73c5;return db['UserProfileSection'][_0xcf19('0x5c')]({'where':{'userProfileId':_0x16a007[_0xcf19('0x48')]['id'],'sectionId':_0x16a007['query'][_0xcf19('0x62')]}});}})[_0xcf19('0x2d')](function(){return _0x2795a0;})['then'](respondWithStatusCode(_0x1b5db4,null))[_0xcf19('0x46')](handleError(_0x1b5db4,null));};exports['getSections']=function(_0x4e675d,_0x2709d3){var _0x135ee2=[];var _0x260fbc=[];return db[_0xcf19('0x55')]['findAll']({'where':{'userProfileId':_0x4e675d[_0xcf19('0x48')]['id']},'raw':!![]})['then'](function(_0x465ea2){_0x135ee2=_[_0xcf19('0x41')](_0x465ea2,function(_0x246624){return _0x246624[_0xcf19('0x63')]===0x1||_[_0xcf19('0x64')]([0x3eb,0x709],_0x246624[_0xcf19('0x59')]);});if(!_[_0xcf19('0x65')](_0x135ee2)){return _[_0xcf19('0x31')](_0x135ee2,function(_0xfccda3){return _0xfccda3[_0xcf19('0x59')];});}else{return;}})['then'](function(_0x402f15){if(_0x402f15)_0x260fbc=_0x402f15;if(_[_0xcf19('0x64')](_0x260fbc,0x64)){var _0x26a10b=_[_0xcf19('0x4b')](_0x135ee2,{'sectionId':0x64});return hasDefaultDashboard(_0x26a10b)[_0xcf19('0x2d')](function(_0x37712d){return _[_0xcf19('0x31')](_0x135ee2,function(_0xbfefa8){if(_0xbfefa8[_0xcf19('0x59')]===0x64){_0xbfefa8[_0xcf19('0x66')]=_0x37712d;}return _0xbfefa8;});});}else{return;}})[_0xcf19('0x2d')](function(_0x59f4da){if(_0x59f4da)_0x135ee2=_0x59f4da;if(_[_0xcf19('0x64')](_0x260fbc,0x3eb)){var _0x1afdb5=_[_0xcf19('0x4b')](_0x135ee2,{'sectionId':0x3eb});return getCustomDashboards(_0x1afdb5)[_0xcf19('0x2d')](function(_0x50efca){return _['map'](_0x135ee2,function(_0x43613c){if(_0x1afdb5[_0xcf19('0x63')]){if(_0x43613c[_0xcf19('0x59')]===0x3eb){_0x43613c[_0xcf19('0x66')]=_0x50efca;}}else{if(_0x43613c[_0xcf19('0x59')]===0x64){_0x43613c[_0xcf19('0x66')]=_0x50efca;}}return _0x43613c;});});}else{return;}})[_0xcf19('0x2d')](function(_0x22f062){if(_0x22f062)_0x135ee2=_0x22f062;if(_[_0xcf19('0x64')](_0x260fbc,0x709)){var _0x403306=_[_0xcf19('0x4b')](_0x135ee2,{'sectionId':0x709});return getPlugins(_0x403306)[_0xcf19('0x2d')](function(_0x4e28bd){if(_0x403306['enabled']){return _[_0xcf19('0x31')](_0x135ee2,function(_0x444eb3){if(_0x444eb3[_0xcf19('0x59')]===0x709){_0x444eb3[_0xcf19('0x66')]=_0x4e28bd;}return _0x444eb3;});}else{var _0x4d6496={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4e28bd};var _0x1603a9=_['map'](_0x135ee2);_0x1603a9[_0xcf19('0x67')](_0x4d6496);return _0x1603a9;}});}else{return;}})[_0xcf19('0x2d')](function(_0xa8babc){if(_0xa8babc)_0x135ee2=_0xa8babc;return _['filter'](_0x135ee2,['enabled',0x1]);})[_0xcf19('0x2d')](respondWithResult(_0x2709d3,null))[_0xcf19('0x46')](handleError(_0x2709d3,null));};function hasDefaultDashboard(_0x2bef37){var _0x29de5d=[0x65];return new BPromise(function(_0x782334,_0x101010){try{if(_0x2bef37[_0xcf19('0x57')]){_0x782334(_0x29de5d);}else{return db[_0xcf19('0x58')]['findOne']({'where':{'sectionId':_0x2bef37['id']},'raw':!![]})['then'](function(_0x5997f1){_0x5997f1?_0x782334(_0x29de5d):_0x782334();});}}catch(_0x20521f){_0x101010(_0x20521f);}});}function getCustomDashboards(_0x24cf66){var _0x4c610e=[];return new BPromise(function(_0x1a8875,_0x23b02d){try{if(_0x24cf66[_0xcf19('0x57')]){return db[_0xcf19('0x68')][_0xcf19('0x56')]({'raw':!![]})['then'](function(_0x4fdb00){_0x4fdb00['forEach'](function(_0x26f70e){_0x4c610e['push'](_0x26f70e['id']+0x1869f);});_0x1a8875(_0x4c610e);});}else{return db[_0xcf19('0x58')][_0xcf19('0x56')]({'where':{'sectionId':_0x24cf66['id']},'raw':!![]})[_0xcf19('0x2d')](function(_0x87a6c){_0x87a6c[_0xcf19('0x69')](function(_0x82b486){_0x4c610e[_0xcf19('0x67')](_0x82b486[_0xcf19('0x6a')]+0x1869f);});_0x1a8875(_0x4c610e);});}}catch(_0x1c5282){_0x23b02d(_0x1c5282);}});}function getPlugins(_0x411e38){var _0x6c8255=[];return new BPromise(function(_0x5f5812,_0x3ad90f){try{if(_0x411e38[_0xcf19('0x57')]){return db[_0xcf19('0x6b')]['findAll']({'raw':!![]})[_0xcf19('0x2d')](function(_0x217056){_0x217056[_0xcf19('0x69')](function(_0x2b9739){_0x6c8255[_0xcf19('0x67')](_0x2b9739['id']+0x15b38);});_0x5f5812(_0x6c8255);});}else{return db[_0xcf19('0x58')][_0xcf19('0x56')]({'where':{'sectionId':_0x411e38['id']},'raw':!![]})[_0xcf19('0x2d')](function(_0x14d4d0){_0x14d4d0[_0xcf19('0x69')](function(_0x3b912d){_0x6c8255['push'](_0x3b912d[_0xcf19('0x6a')]+0x15b38);});_0x5f5812(_0x6c8255);});}}catch(_0x30e536){_0x3ad90f(_0x30e536);}});}exports[_0xcf19('0x6c')]=function(_0xd300f9,_0x55d120){return db[_0xcf19('0x32')][_0xcf19('0x4b')]({'where':{'id':_0xd300f9[_0xcf19('0x48')]['id']}})[_0xcf19('0x2d')](handleEntityNotFound(_0x55d120,null))[_0xcf19('0x2d')](function(_0x15f79f){if(_0x15f79f){return db[_0xcf19('0x53')][_0xcf19('0x54')](function(_0x50f212){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0xd300f9['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x448ce1){if(_0x448ce1){return db['UserProfileSection'][_0xcf19('0x5c')]({'where':{'userProfileId':_0xd300f9[_0xcf19('0x48')]['id'],'id':_[_0xcf19('0x31')](_0x448ce1,function(_0x370805){return _0x370805['id'];})},'transaction':_0x50f212});}})['then'](function(_0x2fdc4c){var _0x1fb162=_[_0xcf19('0x31')](_0xd300f9[_0xcf19('0x51')],function(_0x5f4ea5){_0x5f4ea5[_0xcf19('0x5a')]=_0xd300f9[_0xcf19('0x48')]['id'];return _0x5f4ea5;});return db['UserProfileSection'][_0xcf19('0x6d')](_0x1fb162,{'raw':!![],'transaction':_0x50f212});})['then'](function(_0x37628b){var _0x1e7423=_[_0xcf19('0x41')](_[_0xcf19('0x31')](_0x37628b,function(_0x228f69){return _0x228f69[_0xcf19('0x60')]({'plain':!![]});}),{'includeAll':![]});if(_0x1e7423){return db[_0xcf19('0x55')][_0xcf19('0x56')]({'where':{'userProfileId':_0xd300f9[_0xcf19('0x48')]['id'],'sectionId':_[_0xcf19('0x31')](_0x1e7423,function(_0x2dc263){return _0x2dc263['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x14ebce){var _0x365f6f=_['map'](_0xd300f9['body'],function(_0x42ab5d){_0x42ab5d[_0xcf19('0x5a')]=_0xd300f9[_0xcf19('0x48')]['id'];return _0x42ab5d;});return db[_0xcf19('0x58')][_0xcf19('0x6d')](_0x365f6f,{'raw':!![],'transaction':_0x50f212});});}})['catch'](handleError(_0x55d120,null));});}})[_0xcf19('0x2d')](function(_0x451e34){var _0x13e36a=_['map'](_0x451e34,function(_0x8a3e8d){return _0x8a3e8d[_0xcf19('0x60')]({'plain':!![]});});})[_0xcf19('0x2d')](respondWithResult(_0x55d120,null))[_0xcf19('0x46')](handleError(_0x55d120,null));};exports[_0xcf19('0x6e')]=function(_0x1aeb22,_0x31733d,_0x31d64f){return db['UserProfile'][_0xcf19('0x4b')]({'where':{'id':_0x1aeb22[_0xcf19('0x48')]['id']}})[_0xcf19('0x2d')](handleEntityNotFound(_0x31733d,null))[_0xcf19('0x2d')](function(_0x40b978){if(_0x40b978){return _0x40b978[_0xcf19('0x6e')](_0x1aeb22[_0xcf19('0x37')][_0xcf19('0x62')]);}})[_0xcf19('0x2d')](respondWithStatusCode(_0x31733d,null))[_0xcf19('0x46')](handleError(_0x31733d,null));};exports['getResources']=function(_0x508eef,_0x381366){var _0x1197aa={};if(!_0x508eef['query'][_0xcf19('0x6f')])throw new Error(_0xcf19('0x70'));if(!_0x508eef[_0xcf19('0x37')][_0xcf19('0x71')](_0xcf19('0x3d'))){_0x1197aa['limit']=qs[_0xcf19('0x26')](_0x508eef[_0xcf19('0x37')][_0xcf19('0x26')]);_0x1197aa['offset']=qs[_0xcf19('0x25')](_0x508eef[_0xcf19('0x37')][_0xcf19('0x25')]);}return db['UserProfile'][_0xcf19('0x4b')]({'where':{'id':_0x508eef['params']['id']}})[_0xcf19('0x2d')](function(_0x53f985){if(!_0x53f985)throw new Error(_0xcf19('0x72')+_0x508eef[_0xcf19('0x48')]['id']);return db[_0xcf19('0x32')]['getResources'](_0x508eef);})[_0xcf19('0x2d')](respondWithFilteredResult(_0x381366,_0x1197aa))[_0xcf19('0x46')](handleError(_0x381366,null));}; \ No newline at end of file +var _0x731b=['UserProfileSection','sectionId','each','push','ids','getSections','includes','isEmpty','subsections','enabled','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','json','offset','undefined','limit','count','save','update','then','destroy','error','name','send','index','UserProfile','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','find','body','clone','get','updatedAt','crudPermissions','omit','createdAt','sequelize','transaction','create','autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections'];(function(_0x5ad4f0,_0x10ef60){var _0x149f1d=function(_0x5ea995){while(--_0x5ea995){_0x5ad4f0['push'](_0x5ad4f0['shift']());}};_0x149f1d(++_0x10ef60);}(_0x731b,0xf7));var _0xb731=function(_0x3d62c7,_0xe62610){_0x3d62c7=_0x3d62c7-0x0;var _0x5464ff=_0x731b[_0x3d62c7];return _0x5464ff;};'use strict';var emlformat=require(_0xb731('0x0'));var rimraf=require(_0xb731('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb731('0x2'));var rp=require(_0xb731('0x3'));var moment=require(_0xb731('0x4'));var BPromise=require(_0xb731('0x5'));var Mustache=require(_0xb731('0x6'));var util=require(_0xb731('0x7'));var path=require('path');var sox=require(_0xb731('0x8'));var csv=require(_0xb731('0x9'));var ejs=require(_0xb731('0xa'));var fs=require('fs');var fs_extra=require(_0xb731('0xb'));var _=require(_0xb731('0xc'));var squel=require(_0xb731('0xd'));var crypto=require(_0xb731('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb731('0xf'));var toCsv=require(_0xb731('0x9'));var querystring=require(_0xb731('0x10'));var Papa=require(_0xb731('0x11'));var Redis=require(_0xb731('0x12'));var authService=require(_0xb731('0x13'));var qs=require(_0xb731('0x14'));var as=require(_0xb731('0x15'));var hardwareService=require(_0xb731('0x16'));var logger=require(_0xb731('0x17'))(_0xb731('0x18'));var utils=require(_0xb731('0x19'));var config=require(_0xb731('0x1a'));var licenseUtil=require(_0xb731('0x1b'));var db=require(_0xb731('0x1c'))['db'];config['redis']=_[_0xb731('0x1d')](config['redis'],{'host':_0xb731('0x1e'),'port':0x18eb});var socket=require(_0xb731('0x1f'))(new Redis(config[_0xb731('0x20')]));require('./userProfile.socket')[_0xb731('0x21')](socket);function respondWithStatusCode(_0x4b433a,_0x524c0d){_0x524c0d=_0x524c0d||0xcc;return function(_0x579641){if(_0x579641){return _0x4b433a[_0xb731('0x22')](_0x524c0d);}return _0x4b433a[_0xb731('0x23')](_0x524c0d)['end']();};}function respondWithResult(_0x47829e,_0x15c596){_0x15c596=_0x15c596||0xc8;return function(_0x5e4ca6){if(_0x5e4ca6){return _0x47829e[_0xb731('0x23')](_0x15c596)[_0xb731('0x24')](_0x5e4ca6);}};}function respondWithFilteredResult(_0x35baac,_0x299073){return function(_0x4e0c6d){if(_0x4e0c6d){var _0x162a9b=typeof _0x299073[_0xb731('0x25')]===_0xb731('0x26')&&typeof _0x299073[_0xb731('0x27')]==='undefined';var _0x1f9de6=_0x4e0c6d['count'];var _0x4b4cb4=_0x162a9b?0x0:_0x299073[_0xb731('0x25')];var _0x537556=_0x162a9b?_0x4e0c6d[_0xb731('0x28')]:_0x299073[_0xb731('0x25')]+_0x299073[_0xb731('0x27')];var _0x36374e;if(_0x537556>=_0x1f9de6){_0x537556=_0x1f9de6;_0x36374e=0xc8;}else{_0x36374e=0xce;}_0x35baac[_0xb731('0x23')](_0x36374e);return _0x35baac['set']('Content-Range',_0x4b4cb4+'-'+_0x537556+'/'+_0x1f9de6)[_0xb731('0x24')](_0x4e0c6d);}return null;};}function patchUpdates(_0x3e4623){return function(_0x4f7424){try{jsonpatch['apply'](_0x4f7424,_0x3e4623,!![]);}catch(_0x12a0df){return BPromise['reject'](_0x12a0df);}return _0x4f7424[_0xb731('0x29')]();};}function saveUpdates(_0x15be09,_0x573432){return function(_0x396790){if(_0x396790){return _0x396790[_0xb731('0x2a')](_0x15be09)[_0xb731('0x2b')](function(_0x29944a){return _0x29944a;});}return null;};}function removeEntity(_0x5d30e1,_0x9fabd8){return function(_0x14904e){if(_0x14904e){return _0x14904e[_0xb731('0x2c')]()[_0xb731('0x2b')](function(){_0x5d30e1[_0xb731('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x582989,_0x21ccd0){return function(_0x3519c8){if(!_0x3519c8){_0x582989['sendStatus'](0x194);}return _0x3519c8;};}function handleError(_0x5b6df7,_0x26abc9){_0x26abc9=_0x26abc9||0x1f4;return function(_0x5e4a21){logger[_0xb731('0x2d')](_0x5e4a21['stack']);if(_0x5e4a21[_0xb731('0x2e')]){delete _0x5e4a21[_0xb731('0x2e')];}_0x5b6df7[_0xb731('0x23')](_0x26abc9)[_0xb731('0x2f')](_0x5e4a21);};}exports[_0xb731('0x30')]=function(_0x485e86,_0x53ba29){var _0x5edd1f={},_0x4c0a33={},_0x257dd2={'count':0x0,'rows':[]};var _0x325a04=_['map'](db[_0xb731('0x31')]['rawAttributes'],function(_0x1423ff){return{'name':_0x1423ff[_0xb731('0x32')],'type':_0x1423ff['type'][_0xb731('0x33')]};});_0x4c0a33[_0xb731('0x34')]=_['map'](_0x325a04,_0xb731('0x2e'));_0x4c0a33[_0xb731('0x35')]=_[_0xb731('0x36')](_0x485e86[_0xb731('0x35')]);_0x4c0a33[_0xb731('0x37')]=_[_0xb731('0x38')](_0x4c0a33[_0xb731('0x34')],_0x4c0a33['query']);_0x5edd1f[_0xb731('0x39')]=_[_0xb731('0x38')](_0x4c0a33[_0xb731('0x34')],qs[_0xb731('0x3a')](_0x485e86[_0xb731('0x35')][_0xb731('0x3a')]));_0x5edd1f[_0xb731('0x39')]=_0x5edd1f[_0xb731('0x39')][_0xb731('0x3b')]?_0x5edd1f[_0xb731('0x39')]:_0x4c0a33[_0xb731('0x34')];if(!_0x485e86[_0xb731('0x35')][_0xb731('0x3c')](_0xb731('0x3d'))){_0x5edd1f[_0xb731('0x27')]=qs[_0xb731('0x27')](_0x485e86[_0xb731('0x35')][_0xb731('0x27')]);_0x5edd1f['offset']=qs[_0xb731('0x25')](_0x485e86['query'][_0xb731('0x25')]);}_0x5edd1f[_0xb731('0x3e')]=qs[_0xb731('0x3f')](_0x485e86['query']['sort']);_0x5edd1f[_0xb731('0x40')]=qs[_0xb731('0x37')](_[_0xb731('0x41')](_0x485e86['query'],_0x4c0a33['filters']),_0x325a04);if(_0x485e86['query'][_0xb731('0x42')]){_0x5edd1f[_0xb731('0x40')]=_[_0xb731('0x43')](_0x5edd1f[_0xb731('0x40')],{'$or':_[_0xb731('0x44')](_0x325a04,function(_0x186c72){if(_0x186c72[_0xb731('0x45')]!==_0xb731('0x46')){var _0x350a4d={};_0x350a4d[_0x186c72[_0xb731('0x2e')]]={'$like':'%'+_0x485e86[_0xb731('0x35')][_0xb731('0x42')]+'%'};return _0x350a4d;}})});}_0x5edd1f=_[_0xb731('0x43')]({},_0x5edd1f,_0x485e86[_0xb731('0x47')]);var _0x381496={'where':_0x5edd1f[_0xb731('0x40')]};return db[_0xb731('0x31')][_0xb731('0x28')](_0x381496)[_0xb731('0x2b')](function(_0x373f07){_0x257dd2[_0xb731('0x28')]=_0x373f07;if(_0x485e86[_0xb731('0x35')][_0xb731('0x48')]){_0x5edd1f['include']=[{'all':!![]}];}return db[_0xb731('0x31')][_0xb731('0x49')](_0x5edd1f);})[_0xb731('0x2b')](function(_0x2078d1){_0x257dd2['rows']=_0x2078d1;return _0x257dd2;})['then'](respondWithFilteredResult(_0x53ba29,_0x5edd1f))[_0xb731('0x4a')](handleError(_0x53ba29,null));};exports[_0xb731('0x4b')]=function(_0x2d03de,_0x829f78){var _0x132a97={'raw':![],'where':{'id':_0x2d03de[_0xb731('0x4c')]['id']}},_0x46a1e1={};_0x46a1e1['model']=_[_0xb731('0x36')](db[_0xb731('0x31')][_0xb731('0x4d')]);_0x46a1e1['query']=_[_0xb731('0x36')](_0x2d03de[_0xb731('0x35')]);_0x46a1e1[_0xb731('0x37')]=_[_0xb731('0x38')](_0x46a1e1[_0xb731('0x34')],_0x46a1e1[_0xb731('0x35')]);_0x132a97[_0xb731('0x39')]=_[_0xb731('0x38')](_0x46a1e1[_0xb731('0x34')],qs['fields'](_0x2d03de['query'][_0xb731('0x3a')]));_0x132a97[_0xb731('0x39')]=_0x132a97[_0xb731('0x39')][_0xb731('0x3b')]?_0x132a97[_0xb731('0x39')]:_0x46a1e1[_0xb731('0x34')];if(_0x2d03de[_0xb731('0x35')][_0xb731('0x48')]){_0x132a97['include']=[{'all':!![]}];}_0x132a97=_['merge']({},_0x132a97,_0x2d03de[_0xb731('0x47')]);return db[_0xb731('0x31')][_0xb731('0x4e')](_0x132a97)[_0xb731('0x2b')](handleEntityNotFound(_0x829f78,null))['then'](respondWithResult(_0x829f78,null))[_0xb731('0x4a')](handleError(_0x829f78,null));};exports['create']=function(_0x301d34,_0x37ab96){return db['UserProfile']['create'](_0x301d34[_0xb731('0x4f')],{})['then'](respondWithResult(_0x37ab96,0xc9))[_0xb731('0x4a')](handleError(_0x37ab96,null));};exports[_0xb731('0x50')]=function(_0xb699d,_0x4db993){var _0x261e2d={'where':{'id':_0xb699d[_0xb731('0x4c')]['id']}},_0x166419={};_0x166419[_0xb731('0x34')]=_[_0xb731('0x36')](db['UserProfile'][_0xb731('0x4d')]);_0x261e2d['attributes']=_['intersection'](_0x166419[_0xb731('0x34')],qs[_0xb731('0x3a')](_0xb699d[_0xb731('0x35')][_0xb731('0x3a')]));_0x261e2d[_0xb731('0x39')]=_0x261e2d[_0xb731('0x39')][_0xb731('0x3b')]?_0x261e2d['attributes']:_0x166419[_0xb731('0x34')];if(_0xb699d[_0xb731('0x35')][_0xb731('0x48')]){_0x261e2d['include']=[{'all':!![]}];}_0x261e2d=_['merge']({},_0x261e2d,_0xb699d[_0xb731('0x47')]);return db['UserProfile'][_0xb731('0x4e')](_0x261e2d)[_0xb731('0x2b')](handleEntityNotFound(_0x4db993,null))[_0xb731('0x2b')](function(_0x1b82c1){if(_0x1b82c1){var _0x58a4cc=_0x1b82c1[_0xb731('0x51')]({'plain':!![]});_0x58a4cc=qs['omit'](_0x58a4cc,['id','createdAt',_0xb731('0x52'),_0xb731('0x53')]);_0xb699d[_0xb731('0x4f')]=_[_0xb731('0x54')](_0xb699d[_0xb731('0x4f')],['id',_0xb731('0x55'),'updatedAt']);return db[_0xb731('0x56')][_0xb731('0x57')](function(_0x3c9ad2){return db[_0xb731('0x31')][_0xb731('0x58')](_['merge'](_0x58a4cc,_0xb699d['body']),{'include':_0xb699d[_0xb731('0x35')][_0xb731('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x3c9ad2})[_0xb731('0x2b')](function(_0x84a0c3){var _0x14daea=_0x84a0c3[_0xb731('0x51')]({'plain':!![]});return db['UserProfileSection'][_0xb731('0x49')]({'where':{'userProfileId':_0xb699d[_0xb731('0x4c')]['id']},'raw':!![]})[_0xb731('0x2b')](function(_0x5a4eab){if(_0x5a4eab){return BPromise['each'](_0x5a4eab,function(_0x14085e){return new BPromise(function(_0xbf2334,_0xfec28d){if(_0x14085e[_0xb731('0x59')]===null||_0x14085e[_0xb731('0x59')]===0x1)_0xbf2334(null);return db[_0xb731('0x5a')]['findAll']({'where':{'sectionId':_0x14085e['id']},'raw':!![]})[_0xb731('0x2b')](function(_0x34e80d){var _0x39f272=_[_0xb731('0x44')](_0x34e80d,function(_0x260983){return qs[_0xb731('0x54')](_0x260983,['id',_0xb731('0x55'),'updatedAt','sectionId']);});_0xbf2334(_0x39f272);})['catch'](function(_0x26ce8e){_0xfec28d(_0x26ce8e);});})[_0xb731('0x2b')](function(_0x50f9ea){var _0x386fda=qs[_0xb731('0x54')](_0x14085e,['id','createdAt',_0xb731('0x52')]);_0x386fda[_0xb731('0x5b')]=_0x14daea['id'];if(_0x50f9ea)_0x386fda['Resources']=_0x50f9ea;return _0x386fda;})[_0xb731('0x2b')](function(_0x142ccb){return db['UserProfileSection'][_0xb731('0x58')](_0x142ccb,{'include':[{'model':db[_0xb731('0x5a')],'as':_0xb731('0x5c')}],'raw':!![],'transaction':_0x3c9ad2});});})['then'](function(){return _0x14daea;});}});});});}})[_0xb731('0x2b')](respondWithResult(_0x4db993,0xc9))[_0xb731('0x4a')](handleError(_0x4db993,null));};exports[_0xb731('0x2a')]=function(_0x2a05e9,_0x1536ed){if(_0x2a05e9['body']['id']){delete _0x2a05e9[_0xb731('0x4f')]['id'];}return db[_0xb731('0x31')][_0xb731('0x4e')]({'where':{'id':_0x2a05e9[_0xb731('0x4c')]['id']}})[_0xb731('0x2b')](handleEntityNotFound(_0x1536ed,null))[_0xb731('0x2b')](saveUpdates(_0x2a05e9[_0xb731('0x4f')],null))[_0xb731('0x2b')](respondWithResult(_0x1536ed,null))[_0xb731('0x4a')](handleError(_0x1536ed,null));};exports['destroy']=function(_0xd091f9,_0x417fc2){return db[_0xb731('0x31')]['find']({'where':{'id':_0xd091f9['params']['id']}})[_0xb731('0x2b')](handleEntityNotFound(_0x417fc2,null))['then'](removeEntity(_0x417fc2,null))[_0xb731('0x4a')](handleError(_0x417fc2,null));};exports[_0xb731('0x5d')]=function(_0x197ab3,_0x4354e3){return db[_0xb731('0x31')]['describe']()[_0xb731('0x2b')](respondWithResult(_0x4354e3,null))[_0xb731('0x4a')](handleError(_0x4354e3,null));};exports[_0xb731('0x5e')]=function(_0x29f095,_0x56af26){var _0x556a1e=_0x29f095[_0xb731('0x4f')];return db[_0xb731('0x31')][_0xb731('0x4e')]({'where':{'id':_0x29f095['params']['id']}})[_0xb731('0x2b')](handleEntityNotFound(_0x56af26,null))[_0xb731('0x2b')](function(_0x44ffa6){if(_0x44ffa6){return db[_0xb731('0x56')][_0xb731('0x57')](function(_0x583cc6){return db[_0xb731('0x5f')][_0xb731('0x2c')]({'where':{'userProfileId':_0x29f095[_0xb731('0x4c')]['id'],'sectionId':_[_0xb731('0x44')](_0x556a1e,function(_0x171ffd){return _0x171ffd[_0xb731('0x60')];})},'transaction':_0x583cc6})[_0xb731('0x2b')](function(){var _0x465b60=_[_0xb731('0x44')](_0x556a1e,function(_0x77e202){_0x77e202[_0xb731('0x5b')]=_0x29f095[_0xb731('0x4c')]['id'];return _0x77e202;});var _0x57a47a=[];return BPromise[_0xb731('0x61')](_0x465b60,function(_0xa8c787){return db['UserProfileSection'][_0xb731('0x58')](_0xa8c787,{'include':[{'model':db[_0xb731('0x5a')],'as':_0xb731('0x5c')}],'raw':!![],'transaction':_0x583cc6})['then'](function(_0x92f2a0){_0x57a47a[_0xb731('0x62')](_0x92f2a0[_0xb731('0x51')]({'plain':!![]}));});})['then'](function(){return _0x57a47a;});});});}})['then'](function(_0x13d9f3){return _0x13d9f3;})['then'](respondWithResult(_0x56af26,null))[_0xb731('0x4a')](handleError(_0x56af26,null));};exports['removeSections']=function(_0x5ad44c,_0x5bdf28){var _0x185cf0;return db[_0xb731('0x31')][_0xb731('0x4e')]({'where':{'id':_0x5ad44c[_0xb731('0x4c')]['id']},'attributes':['id',_0xb731('0x2e')]})['then'](handleEntityNotFound(_0x5bdf28,null))[_0xb731('0x2b')](function(_0xec8e02){if(_0xec8e02){_0x185cf0=_0xec8e02;return db['UserProfileSection'][_0xb731('0x2c')]({'where':{'userProfileId':_0x5ad44c[_0xb731('0x4c')]['id'],'sectionId':_0x5ad44c['query'][_0xb731('0x63')]}});}})[_0xb731('0x2b')](function(){return _0x185cf0;})[_0xb731('0x2b')](respondWithStatusCode(_0x5bdf28,null))[_0xb731('0x4a')](handleError(_0x5bdf28,null));};exports[_0xb731('0x64')]=function(_0x42ec02,_0x29545c){var _0x4263de=[];var _0xeebf6=[];return db[_0xb731('0x5f')][_0xb731('0x49')]({'where':{'userProfileId':_0x42ec02['params']['id']},'raw':!![]})[_0xb731('0x2b')](function(_0x3c47e1){_0x4263de=_[_0xb731('0x42')](_0x3c47e1,function(_0x14b07b){return _0x14b07b['enabled']===0x1||_[_0xb731('0x65')]([0x3eb,0x709],_0x14b07b[_0xb731('0x60')]);});if(!_[_0xb731('0x66')](_0x4263de)){return _[_0xb731('0x44')](_0x4263de,function(_0x4aed22){return _0x4aed22[_0xb731('0x60')];});}else{return;}})['then'](function(_0x59d39c){if(_0x59d39c)_0xeebf6=_0x59d39c;if(_[_0xb731('0x65')](_0xeebf6,0x64)){var _0x928b61=_['find'](_0x4263de,{'sectionId':0x64});return hasDefaultDashboard(_0x928b61)[_0xb731('0x2b')](function(_0x199cd7){return _[_0xb731('0x44')](_0x4263de,function(_0x52ed0a){if(_0x52ed0a[_0xb731('0x60')]===0x64){_0x52ed0a[_0xb731('0x67')]=_0x199cd7;}return _0x52ed0a;});});}else{return;}})[_0xb731('0x2b')](function(_0x27101d){if(_0x27101d)_0x4263de=_0x27101d;if(_['includes'](_0xeebf6,0x3eb)){var _0x3fb3ec=_['find'](_0x4263de,{'sectionId':0x3eb});return getCustomDashboards(_0x3fb3ec)[_0xb731('0x2b')](function(_0x1aafc9){return _[_0xb731('0x44')](_0x4263de,function(_0x45c126){if(_0x3fb3ec[_0xb731('0x68')]){if(_0x45c126[_0xb731('0x60')]===0x3eb){_0x45c126['subsections']=_0x1aafc9;}}else{if(_0x45c126[_0xb731('0x60')]===0x64){_0x45c126[_0xb731('0x67')]=_0x1aafc9;}}return _0x45c126;});});}else{return;}})['then'](function(_0x188e5e){if(_0x188e5e)_0x4263de=_0x188e5e;if(_[_0xb731('0x65')](_0xeebf6,0x709)){var _0x30c379=_[_0xb731('0x4e')](_0x4263de,{'sectionId':0x709});return getPlugins(_0x30c379)['then'](function(_0x2f219f){if(_0x30c379[_0xb731('0x68')]){return _[_0xb731('0x44')](_0x4263de,function(_0x5f360d){if(_0x5f360d[_0xb731('0x60')]===0x709){_0x5f360d['subsections']=_0x2f219f;}return _0x5f360d;});}else{var _0x30a29d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2f219f};var _0x3e4dee=_[_0xb731('0x44')](_0x4263de);_0x3e4dee[_0xb731('0x62')](_0x30a29d);return _0x3e4dee;}});}else{return;}})['then'](function(_0x50a6ea){if(_0x50a6ea)_0x4263de=_0x50a6ea;return _[_0xb731('0x42')](_0x4263de,['enabled',0x1]);})[_0xb731('0x2b')](respondWithResult(_0x29545c,null))[_0xb731('0x4a')](handleError(_0x29545c,null));};function hasDefaultDashboard(_0x49303a){var _0x20f3af=[0x65];return new BPromise(function(_0x4b12d1,_0x38f4fd){try{if(_0x49303a[_0xb731('0x59')]){_0x4b12d1(_0x20f3af);}else{return db[_0xb731('0x5a')]['findOne']({'where':{'sectionId':_0x49303a['id']},'raw':!![]})['then'](function(_0x1b45ed){_0x1b45ed?_0x4b12d1(_0x20f3af):_0x4b12d1();});}}catch(_0x38dfdf){_0x38f4fd(_0x38dfdf);}});}function getCustomDashboards(_0x423ab0){var _0x3501cf=[];return new BPromise(function(_0x3af421,_0x190c75){try{if(_0x423ab0['autoAssociation']){return db['Dashboard']['findAll']({'raw':!![]})[_0xb731('0x2b')](function(_0x3d83a0){_0x3d83a0[_0xb731('0x69')](function(_0x32ea63){_0x3501cf[_0xb731('0x62')](_0x32ea63['id']+0x1869f);});_0x3af421(_0x3501cf);});}else{return db['UserProfileResource'][_0xb731('0x49')]({'where':{'sectionId':_0x423ab0['id']},'raw':!![]})[_0xb731('0x2b')](function(_0x50e196){_0x50e196[_0xb731('0x69')](function(_0x33c1dc){_0x3501cf['push'](_0x33c1dc[_0xb731('0x6a')]+0x1869f);});_0x3af421(_0x3501cf);});}}catch(_0x1cbcc4){_0x190c75(_0x1cbcc4);}});}function getPlugins(_0x5b9065){var _0x5d9830=[];return new BPromise(function(_0xf64460,_0xf2be71){try{if(_0x5b9065['autoAssociation']){return db[_0xb731('0x6b')]['findAll']({'raw':!![]})['then'](function(_0xd8ff93){_0xd8ff93[_0xb731('0x69')](function(_0x4a5312){_0x5d9830[_0xb731('0x62')](_0x4a5312['id']+0x15b38);});_0xf64460(_0x5d9830);});}else{return db[_0xb731('0x5a')][_0xb731('0x49')]({'where':{'sectionId':_0x5b9065['id']},'raw':!![]})[_0xb731('0x2b')](function(_0x2f1656){_0x2f1656['forEach'](function(_0xe46489){_0x5d9830['push'](_0xe46489[_0xb731('0x6a')]+0x15b38);});_0xf64460(_0x5d9830);});}}catch(_0x3ffe9c){_0xf2be71(_0x3ffe9c);}});}exports[_0xb731('0x6c')]=function(_0x3b3116,_0x3931f3){return db['UserProfile'][_0xb731('0x4e')]({'where':{'id':_0x3b3116[_0xb731('0x4c')]['id']}})[_0xb731('0x2b')](handleEntityNotFound(_0x3931f3,null))[_0xb731('0x2b')](function(_0x316076){if(_0x316076){return db[_0xb731('0x56')][_0xb731('0x57')](function(_0x4b38fc){return db[_0xb731('0x5f')][_0xb731('0x49')]({'where':{'userProfileId':_0x3b3116['params']['id']},'attributes':['id'],'raw':!![]})[_0xb731('0x2b')](function(_0x5755fb){if(_0x5755fb){return db[_0xb731('0x5f')][_0xb731('0x2c')]({'where':{'userProfileId':_0x3b3116[_0xb731('0x4c')]['id'],'id':_[_0xb731('0x44')](_0x5755fb,function(_0x3c5db9){return _0x3c5db9['id'];})},'transaction':_0x4b38fc});}})['then'](function(_0x46b95c){var _0x51b275=_[_0xb731('0x44')](_0x3b3116['body'],function(_0x5715ad){_0x5715ad['userProfileId']=_0x3b3116['params']['id'];return _0x5715ad;});return db['UserProfileSection']['bulkCreate'](_0x51b275,{'raw':!![],'transaction':_0x4b38fc});})[_0xb731('0x2b')](function(_0x1b50c9){var _0x395781=_[_0xb731('0x42')](_[_0xb731('0x44')](_0x1b50c9,function(_0x2b5c21){return _0x2b5c21[_0xb731('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x395781){return db[_0xb731('0x5f')][_0xb731('0x49')]({'where':{'userProfileId':_0x3b3116[_0xb731('0x4c')]['id'],'sectionId':_['map'](_0x395781,function(_0x1887da){return _0x1887da['sectionId'];})},'attributes':['id',_0xb731('0x60')],'raw':!![]})['then'](function(_0x2fa625){var _0x314e4d=_[_0xb731('0x44')](_0x3b3116['body'],function(_0x9eaff5){_0x9eaff5[_0xb731('0x5b')]=_0x3b3116['params']['id'];return _0x9eaff5;});return db[_0xb731('0x5a')][_0xb731('0x6d')](_0x314e4d,{'raw':!![],'transaction':_0x4b38fc});});}})[_0xb731('0x4a')](handleError(_0x3931f3,null));});}})[_0xb731('0x2b')](function(_0x56d68b){var _0x57fd99=_[_0xb731('0x44')](_0x56d68b,function(_0x3d806a){return _0x3d806a['get']({'plain':!![]});});})[_0xb731('0x2b')](respondWithResult(_0x3931f3,null))[_0xb731('0x4a')](handleError(_0x3931f3,null));};exports[_0xb731('0x6e')]=function(_0x1c0efe,_0x21735a,_0x43dcb4){return db[_0xb731('0x31')][_0xb731('0x4e')]({'where':{'id':_0x1c0efe[_0xb731('0x4c')]['id']}})['then'](handleEntityNotFound(_0x21735a,null))[_0xb731('0x2b')](function(_0x379fd8){if(_0x379fd8){return _0x379fd8[_0xb731('0x6e')](_0x1c0efe['query']['ids']);}})[_0xb731('0x2b')](respondWithStatusCode(_0x21735a,null))[_0xb731('0x4a')](handleError(_0x21735a,null));};exports[_0xb731('0x6f')]=function(_0xb6ca10,_0x20245c){var _0x32da25={};if(!_0xb6ca10['query']['section'])throw new Error(_0xb731('0x70'));if(!_0xb6ca10[_0xb731('0x35')]['hasOwnProperty'](_0xb731('0x3d'))){_0x32da25[_0xb731('0x27')]=qs[_0xb731('0x27')](_0xb6ca10['query']['limit']);_0x32da25[_0xb731('0x25')]=qs[_0xb731('0x25')](_0xb6ca10['query'][_0xb731('0x25')]);}return db[_0xb731('0x31')][_0xb731('0x4e')]({'where':{'id':_0xb6ca10[_0xb731('0x4c')]['id']}})['then'](function(_0x456f59){if(!_0x456f59)throw new Error(_0xb731('0x71')+_0xb6ca10[_0xb731('0x4c')]['id']);return db[_0xb731('0x31')][_0xb731('0x6f')](_0xb6ca10);})['then'](respondWithFilteredResult(_0x20245c,_0x32da25))['catch'](handleError(_0x20245c,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index ca4d010..96e91d0 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 _0x202a=['update','hasOwnProperty','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x202a,0xc0));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa202('0x0'))['db'][_0xa202('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa202('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa202('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4878f5){return function(_0x595945,_0x32f8b7,_0x1ce932){UserProfileEvents['emit'](_0x4878f5+':'+_0x595945['id'],_0x595945);UserProfileEvents['emit'](_0x4878f5,_0x595945);_0x1ce932(null);};}for(var e in events){if(events[_0xa202('0x4')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0xe2fe=['exports','events','setMaxListeners','update','remove','emit','hook'];(function(_0x3f7200,_0x18cf3c){var _0x3ff267=function(_0x1b2fa2){while(--_0x1b2fa2){_0x3f7200['push'](_0x3f7200['shift']());}};_0x3ff267(++_0x18cf3c);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xee2f('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xee2f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xee2f('0x2'),'afterDestroy':_0xee2f('0x3')};function emitEvent(_0xe5ad8a){return function(_0x2d2b03,_0xcb45e6,_0x4ba89f){UserProfileEvents[_0xee2f('0x4')](_0xe5ad8a+':'+_0x2d2b03['id'],_0x2d2b03);UserProfileEvents[_0xee2f('0x4')](_0xe5ad8a,_0x2d2b03);_0x4ba89f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xee2f('0x5')](e,emitEvent(event));}}module[_0xee2f('0x6')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index fab0451..6c1c4cc 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 _0x237a=['deskaccounts','DeskAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','pauses','Pause','Schedule','sounds','Sound','tags','Trigger','trunks','variables','plugins','Plugin','extractedreports','Reports','reportId','metrics','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','params','all','union','ignore','push','rawAttributes','filters','attributes','intersection','fields','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','find','foreignKey','options','autoAssociation','includeAll','include','forEach','reportType','default','DefaultReports','custom','CustomReports','count','rows','Tag','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','associatedResources','map','model','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','parentSections','ListId','companies','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelAccount','smsqueues','SmsAccount','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x237a,0x11f));var _0xa237=function(_0x30c61e,_0x5bb78d){_0x30c61e=_0x30c61e-0x0;var _0x4924bc=_0x237a[_0x30c61e];return _0x4924bc;};'use strict';var _=require(_0xa237('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xa237('0x1'));var squel=require(_0xa237('0x2'));module['exports']=function(_0x780bdb){var _0x27c5f3=_0x780bdb[_0xa237('0x3')];function _0x2d7f9c(_0x3d3a1e,_0xc57b0b){return new Promise(function(_0x22927b,_0x1a17d5){if(!_0xc57b0b)return _0x22927b(null);var _0x50db42=_0xc57b0b[_0xa237('0x4')]?{[_0xc57b0b['filter'][_0xa237('0x5')]]:_0xc57b0b['filter'][_0xa237('0x6')]}:undefined;return _0x27c5f3[_0x3d3a1e][_0xa237('0x7')]({'where':_0x50db42,'raw':!![]})[_0xa237('0x8')](function(_0x1b0d99){_0xc57b0b[_0xa237('0x9')]=_[_0xa237('0xa')](_0x1b0d99,'id');_0x22927b(_0xc57b0b);})['catch'](function(_0x4ead9e){_0x1a17d5(_0x4ead9e);});});}function _0x55d8e7(_0x36f167,_0x2e4cc6){return new Promise(function(_0x599d69,_0x9f78d7){var _0x598ef1=_0x36f167[_0xa237('0x4')]?{[_0x36f167[_0xa237('0x4')][_0xa237('0x5')]]:_0x36f167['filter'][_0xa237('0x6')]}:undefined;return _0x27c5f3[_0x36f167[_0xa237('0xb')]][_0xa237('0x7')]({'where':_0x598ef1,'raw':!![]})['then'](function(_0x352975){_0x2e4cc6[_0xa237('0x9')]=_['map'](_0x352975,function(_0x3bcbfd){return _0x3bcbfd[_0xa237('0xc')];});_0x599d69(_0x2e4cc6);})[_0xa237('0xd')](function(_0x3d2350){_0x9f78d7(_0x3d2350);});});}function _0x23fac8(_0x3143ac,_0x12c9f6,_0x1a586b){if(!_0x12c9f6)return Promise[_0xa237('0xe')](null);return new Promise(function(_0x2b770b,_0x1b896e){return _0x27c5f3[_0xa237('0xf')]['findAll']({'where':{'sectionId':_0x12c9f6['id']},'raw':!![]})[_0xa237('0x8')](function(_0x377cf8){if(_0x3143ac[_0xa237('0x5')]&&_0x3143ac['field']!=='id'){_0x12c9f6['associatedResources']=_['map'](_0x377cf8,function(_0x1cc14f){return _0x1cc14f[_0x3143ac[_0xa237('0x5')]];});}else{if(_0x1a586b===_0xa237('0x10')){_0x12c9f6[_0xa237('0x9')]=_[_0xa237('0xa')](_0x377cf8,function(_0x4e463b){return{'id':_0x4e463b[_0xa237('0x11')],'type':_0x4e463b['type']};});}else{_0x12c9f6['associatedResources']=_[_0xa237('0xa')](_0x377cf8,function(_0x2aa527){return _0x2aa527['resourceId'];});}}_0x2b770b(_0x12c9f6);})[_0xa237('0xd')](function(_0x493716){_0x1b896e(_0x493716);});});}function _0x58aea1(_0x504856,_0x2f4408){var _0xc1f32b={'parentSections':[]};switch(_0x504856[_0xa237('0x12')]()){case _0xa237('0x13'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x15');break;case _0xa237('0x16'):_0xc1f32b['childModel']=_0xa237('0x17');break;case _0xa237('0x18'):_0xc1f32b['childModel']=_0xa237('0x19');_0xc1f32b['parentSections']=[{'name':_0xa237('0x1a'),'field':_0xa237('0xc'),'foreignKey':_0xa237('0x1b')}];break;case _0xa237('0x1c'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x1d');break;case _0xa237('0x1e'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x1f');_0xc1f32b[_0xa237('0x20')]=[{'name':'Lists','field':'id','foreignKey':_0xa237('0x21')}];break;case'lists':_0xc1f32b[_0xa237('0x14')]='CmList';break;case _0xa237('0x22'):_0xc1f32b[_0xa237('0x14')]='CmCompany';break;case'globalcustomfields':_0xc1f32b[_0xa237('0x14')]='CmCustomField';break;case'chatqueues':_0xc1f32b['childModel']=_0xa237('0x23');break;case _0xa237('0x24'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x25');break;case _0xa237('0x26'):_0xc1f32b['childModel']=_0xa237('0x27');break;case _0xa237('0x28'):_0xc1f32b[_0xa237('0x14')]='FaxAccount';break;case _0xa237('0x29'):case _0xa237('0x2a'):case _0xa237('0x2b'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x2c');break;case'contexts':_0xc1f32b[_0xa237('0x14')]=_0xa237('0x2d');break;case _0xa237('0x2e'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x2f');break;case _0xa237('0x30'):_0xc1f32b['childModel']=_0xa237('0x31');_0xc1f32b['parentSections']=[{'name':_0xa237('0x32'),'field':_0xa237('0xc'),'foreignKey':_0xa237('0x33'),'model':_0xa237('0x34'),'filter':{'field':_0xa237('0x35'),'value':[_0xa237('0x36')]}},{'name':_0xa237('0x37'),'field':_0xa237('0xc'),'foreignKey':_0xa237('0x33'),'model':_0xa237('0x34'),'filter':{'field':_0xa237('0x35'),'value':['telephone']}},{'name':_0xa237('0x38'),'field':_0xa237('0xc'),'foreignKey':_0xa237('0x39'),'model':_0xa237('0x3a'),'filter':{'field':_0xa237('0x3b'),'value':[_0xa237('0x3c')]}},{'name':_0xa237('0x3d'),'field':_0xa237('0xc'),'foreignKey':_0xa237('0x39'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xa237('0x3e')]}}];break;case _0xa237('0x3f'):_0xc1f32b['childModel']=_0xa237('0x40');break;case _0xa237('0x41'):_0xc1f32b['childModel']=_0xa237('0x42');break;case _0xa237('0x43'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x44');break;case'ivrcampaigns':_0xc1f32b['childModel']=_0xa237('0x45');break;case _0xa237('0x46'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x47');break;case _0xa237('0x48'):_0xc1f32b['childModel']='MailAccount';break;case _0xa237('0x49'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x4a');break;case _0xa237('0x4b'):_0xc1f32b[_0xa237('0x14')]='OpenchannelQueue';break;case'openchannelaccounts':_0xc1f32b[_0xa237('0x14')]=_0xa237('0x4c');break;case _0xa237('0x4d'):_0xc1f32b[_0xa237('0x14')]='SmsQueue';break;case'smsaccounts':_0xc1f32b[_0xa237('0x14')]=_0xa237('0x4e');break;case'whatsappqueues':_0xc1f32b[_0xa237('0x14')]='WhatsappQueue';break;case _0xa237('0x4f'):_0xc1f32b['childModel']=_0xa237('0x50');break;case _0xa237('0x51'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x52');break;case _0xa237('0x53'):case _0xa237('0x54'):_0xc1f32b[_0xa237('0x14')]='VoiceQueue';if(_0x2f4408){_0xc1f32b[_0xa237('0x20')]=[{'name':_0xa237('0x38')},{'name':_0xa237('0x3d')}];}break;case _0xa237('0x55'):case _0xa237('0x56'):case _0xa237('0x57'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x34');if(_0x2f4408){_0xc1f32b[_0xa237('0x20')]=[{'name':_0xa237('0x58'),'filter':{'field':_0xa237('0x35'),'value':[_0xa237('0x59'),'user']},'ignore':!![]},{'name':_0xa237('0x32')},{'name':_0xa237('0x37')}];}break;case'zendeskaccounts':_0xc1f32b[_0xa237('0x14')]=_0xa237('0x5a');break;case _0xa237('0x5b'):_0xc1f32b[_0xa237('0x14')]='SalesforceAccount';break;case _0xa237('0x5c'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x5d');break;case _0xa237('0x5e'):_0xc1f32b['childModel']='SugarcrmAccount';break;case _0xa237('0x5f'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x60');break;case'zohoaccounts':_0xc1f32b[_0xa237('0x14')]='ZohoAccount';break;case'vtigeraccounts':_0xc1f32b[_0xa237('0x14')]=_0xa237('0x34');break;case _0xa237('0x61'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x62');break;case _0xa237('0x63'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x64');break;case _0xa237('0x65'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x66');break;case _0xa237('0x67'):_0xc1f32b[_0xa237('0x14')]='Interval';break;case _0xa237('0x68'):_0xc1f32b['childModel']=_0xa237('0x69');break;case'scheduler':_0xc1f32b[_0xa237('0x14')]=_0xa237('0x6a');break;case _0xa237('0x6b'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x6c');break;case _0xa237('0x6d'):_0xc1f32b['childModel']='Tag';break;case'templates':_0xc1f32b[_0xa237('0x14')]='Template';break;case'triggers':_0xc1f32b['childModel']=_0xa237('0x6e');break;case _0xa237('0x6f'):_0xc1f32b[_0xa237('0x14')]='Trunk';break;case _0xa237('0x70'):_0xc1f32b['childModel']='Variable';break;case _0xa237('0x71'):_0xc1f32b['childModel']=_0xa237('0x72');break;case _0xa237('0x73'):_0xc1f32b[_0xa237('0x14')]=_0xa237('0x10');_0xc1f32b[_0xa237('0x20')]=[{'name':_0xa237('0x74'),'field':'id','foreignKey':_0xa237('0x75')}];break;case _0xa237('0x76'):_0xc1f32b[_0xa237('0x14')]='AnalyticMetric';break;}return _0xc1f32b;}function _0x40f7ca(_0x86fb2d,_0x22431c){var _0x37afb5=_0x86fb2d[_0xa237('0x77')](0x0)['toUpperCase']()+_0x86fb2d[_0xa237('0x78')](0x1);var _0x36a367={'type':_0x27c5f3[_0xa237('0x79')][_0xa237('0x7a')][_0xa237('0x7b')],'raw':!![]};return new Promise(function(_0x1e933a,_0x5f57e0){var _0x5cd07b=squel[_0xa237('0x7c')]()[_0xa237('0x5')](_0xa237('0x7d')+_0x37afb5+_0xa237('0x7e'),'id')[_0xa237('0x5')](_0xa237('0x7f'))[_0xa237('0x80')](_0xa237('0x81')+_0x86fb2d+_0xa237('0x82'),'ui')[_0xa237('0x83')](_0xa237('0x84'),_0x22431c['id']);return _0x27c5f3[_0xa237('0x85')][_0xa237('0x86')](_0x5cd07b[_0xa237('0x87')](),_0x36a367)[_0xa237('0x8')](function(_0x24393a){_0x22431c[_0x37afb5+_0xa237('0x88')]=_0x24393a;_0x1e933a(_0x24393a);})[_0xa237('0xd')](function(_0x4543cb){_0x5f57e0(_0x4543cb);});});}return _0x780bdb[_0xa237('0x89')](_0xa237('0x8a'),attributes,{'tableName':_0xa237('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1cc0f1){var _0x30951e={'raw':_0x1cc0f1['query']['raw'],'where':{}};var _0x223253={};var _0x170eb9={'count':0x0,'rows':[]};var _0x2da169=_0x1cc0f1['query']['section'];var _0x15bbf4=_0x1cc0f1[_0xa237('0x86')][_0xa237('0x8c')]||![];var _0x3e63bd=_0x58aea1(_0x2da169,_0x15bbf4);if(!_0x3e63bd['childModel'])throw new Error(_0xa237('0x8d')+_0x2da169+'\x27');var _0xbfd201=[{'name':_0x2da169}];if(!_[_0xa237('0x8e')](_0x3e63bd[_0xa237('0x20')]))_0xbfd201=_0x3e63bd['parentSections'];var _0x52e1fb=[];for(var _0x4d1d81=0x0;_0x4d1d81<_0xbfd201[_0xa237('0x8f')];_0x4d1d81++){_0x52e1fb['push'](_0x27c5f3[_0xa237('0x90')]['find']({'where':{'userProfileId':_0x1cc0f1[_0xa237('0x91')]['id'],'name':_0xbfd201[_0x4d1d81]['name']},'raw':!![]}));}return Promise[_0xa237('0x92')](_0x52e1fb)[_0xa237('0x8')](function(_0x4e434a){var _0x5abcd7=_[_0xa237('0x4')](_0x4e434a,function(_0x4c3abe){return _0x4c3abe?_0x4c3abe:undefined;});var _0x45d61c=_[_0xa237('0x4')](_0xbfd201,['ignore',!![]]);var _0x5b6b01=_[_0xa237('0x8e')](_0x5abcd7)&&_['isEmpty'](_0x45d61c)?null:_[_0xa237('0x93')](_0x45d61c,_0x5abcd7);if(!_0x5b6b01)return null;var _0x881afb=[];for(var _0x49289a=0x0;_0x49289a<_0x5b6b01[_0xa237('0x8f')];_0x49289a++){var _0x21e35c=_['find'](_0xbfd201,function(_0x587329){return _0x5b6b01[_0x49289a]?_0x587329[_0xa237('0xc')]===_0x5b6b01[_0x49289a][_0xa237('0xc')]:null;});if(_0x21e35c){if(_0x5b6b01[_0x49289a][_0xa237('0x94')]){_0x881afb[_0xa237('0x95')](_0x2d7f9c(_0x3e63bd[_0xa237('0x14')],_0x5b6b01[_0x49289a]));}else{if(!_0x5b6b01[_0x49289a]['autoAssociation']){_0x881afb[_0xa237('0x95')](_0x23fac8(_0x21e35c,_0x5b6b01[_0x49289a],_0x3e63bd[_0xa237('0x14')]));}else{if(_0x21e35c['model']){_0x881afb[_0xa237('0x95')](_0x55d8e7(_0x21e35c,_0x5b6b01[_0x49289a]));}}}}}return Promise[_0xa237('0x92')](_0x881afb);})['then'](function(_0x3d47ed){var _0x2eb79e=_0x3d47ed;var _0x507828=null;if(_0x2eb79e){_0x507828=_0x2eb79e['length']===0x1?_0x2eb79e[0x0]:null;}if(!_0x507828&&!_0x2eb79e)return _0x170eb9;var _0x68465b=_0x27c5f3[_0x3e63bd[_0xa237('0x14')]][_0xa237('0x96')];_0x223253[_0xa237('0xb')]=_['keys'](_0x68465b);_0x223253[_0xa237('0x86')]=_['keys'](_0x1cc0f1['query']);_0x223253[_0xa237('0x97')]=_['intersection'](_0x223253[_0xa237('0xb')],_0x223253['query']);_0x30951e[_0xa237('0x98')]=_[_0xa237('0x99')](_0x223253[_0xa237('0xb')],qs[_0xa237('0x9a')](_0x1cc0f1['query'][_0xa237('0x9a')]));_0x30951e['attributes']=_0x30951e[_0xa237('0x98')][_0xa237('0x8f')]?_0x30951e[_0xa237('0x98')]:_0x223253[_0xa237('0xb')];if(!_0x1cc0f1[_0xa237('0x86')]['hasOwnProperty'](_0xa237('0x9b'))){_0x30951e[_0xa237('0x9c')]=qs['limit'](_0x1cc0f1['query'][_0xa237('0x9c')]);_0x30951e[_0xa237('0x9d')]=qs[_0xa237('0x9d')](_0x1cc0f1[_0xa237('0x86')][_0xa237('0x9d')]);}_0x30951e[_0xa237('0x9e')]=qs[_0xa237('0x9f')](_0x1cc0f1[_0xa237('0x86')][_0xa237('0x9f')]);_0x30951e[_0xa237('0x83')]=qs[_0xa237('0x97')](_[_0xa237('0xa0')](_0x1cc0f1['query'],_0x223253[_0xa237('0x97')]));if(_0x1cc0f1[_0xa237('0x86')][_0xa237('0x4')]){_0x30951e['where']=_[_0xa237('0xa1')](_0x30951e[_0xa237('0x83')],{'$or':_[_0xa237('0xa')](_0x68465b,function(_0x220f40){if(_0x220f40['type'][_0xa237('0xa2')]!==_0xa237('0xa3')){var _0x2553aa={};_0x2553aa[_0x220f40[_0xa237('0x5')]]={'$like':'%'+_0x1cc0f1['query']['filter']+'%'};return _0x2553aa;}})});}var _0xc415e9=[];var _0x191756=null;var _0x4a4edb={};if(_0x507828){_0x191756=_[_0xa237('0xa4')](_0xbfd201,[_0xa237('0xc'),_0x507828[_0xa237('0xc')]]);if(_0x191756[_0xa237('0x5')]){_0x4a4edb={};if(_0x3e63bd[_0xa237('0x14')]===_0xa237('0x10')){_0x4a4edb[_0x191756[_0xa237('0xa5')]]=_[_0xa237('0xa')](_0x507828[_0xa237('0x9')],'id');}else{_0x4a4edb[_0x191756[_0xa237('0xa5')]]=_0x507828[_0xa237('0x9')];}_0xc415e9['push'](_0x4a4edb);}else{_0x30951e[_0xa237('0x83')]['id']=_0x507828[_0xa237('0x9')];}}else{for(var _0x3fcab9=0x0;_0x3fcab9<_0x2eb79e[_0xa237('0x8f')];_0x3fcab9++){_0x191756=_[_0xa237('0xa4')](_0xbfd201,['name',_0x2eb79e[_0x3fcab9][_0xa237('0xc')]]);if(_0x191756[_0xa237('0x5')]){_0x4a4edb={};_0x4a4edb[_0x191756[_0xa237('0xa5')]]=_0x2eb79e[_0x3fcab9][_0xa237('0x9')];_0xc415e9[_0xa237('0x95')](_0x4a4edb);}else{if(!_0x30951e[_0xa237('0x83')]['id'])_0x30951e[_0xa237('0x83')]['id']=[];_0x2eb79e[_0x3fcab9]['associatedResources']['forEach'](function(_0x33c42e){_0x30951e[_0xa237('0x83')]['id']['push'](_0x33c42e);});}}}if(!_[_0xa237('0x8e')](_0xc415e9)){_0x30951e[_0xa237('0x83')]=_[_0xa237('0xa1')](_0x30951e[_0xa237('0x83')],{'$and':{'$or':_0xc415e9}});}_0x30951e=_[_0xa237('0xa1')]({},_0x30951e,_0x1cc0f1[_0xa237('0xa6')]);if(_0x507828&&!_0x507828[_0xa237('0xa7')]&&_0x3e63bd[_0xa237('0x14')]===_0xa237('0x10')){if(_0x1cc0f1[_0xa237('0x86')][_0xa237('0xa8')]){_0x30951e[_0xa237('0xa9')]=[{'all':!![]}];}return _0x27c5f3[_0x3e63bd['childModel']][_0xa237('0x7')](_0x30951e)[_0xa237('0x8')](function(_0x302f7b){var _0x342a5d=[];_0x302f7b[_0xa237('0xaa')](function(_0x302c80){var _0x57538c;switch(_0x302c80[_0xa237('0xab')]){case _0xa237('0xac'):_0x57538c=_[_0xa237('0xa4')](_0x507828[_0xa237('0x9')],function(_0x201e27){return _0x201e27['id']===_0x302c80[_0xa237('0x75')]&&_0x201e27[_0xa237('0x3b')]===_0xa237('0xad');});break;case _0xa237('0xae'):_0x57538c=_['find'](_0x507828['associatedResources'],function(_0x549f96){return _0x549f96['id']===_0x302c80[_0xa237('0x75')]&&_0x549f96[_0xa237('0x3b')]===_0xa237('0xaf');});break;}if(_0x57538c)_0x342a5d[_0xa237('0x95')](_0x302c80);});_0x170eb9[_0xa237('0xb0')]=_0x342a5d[_0xa237('0x8f')];_0x170eb9[_0xa237('0xb1')]=_0x342a5d;return _0x170eb9;});}else{return _0x27c5f3[_0x3e63bd[_0xa237('0x14')]]['count']({'where':_0x30951e[_0xa237('0x83')]})[_0xa237('0x8')](function(_0x4ea18b){_0x170eb9[_0xa237('0xb0')]=_0x4ea18b;if(_0x1cc0f1['query'][_0xa237('0xa8')]){if(_0x3e63bd['childModel']===_0xa237('0x1f')){_0x30951e[_0xa237('0xa9')]=[{'model':_0x27c5f3[_0xa237('0xb2')],'as':_0xa237('0xb3'),'attributes':['id',_0xa237('0xc'),_0xa237('0xb4')],'required':_0x1cc0f1[_0xa237('0x86')][_0xa237('0xb5')]?!![]:![]},{'model':_0x27c5f3['Tag'],'as':_0xa237('0xb6'),'attributes':['id','name',_0xa237('0xb4')],'through':_0x1cc0f1[_0xa237('0x86')]['tag']?{'attributes':[],'where':{'TagId':_0x1cc0f1[_0xa237('0x86')]['tag']||undefined}}:{},'required':_0x1cc0f1[_0xa237('0x86')][_0xa237('0xb5')]?!![]:![]}];}else{_0x30951e[_0xa237('0xa9')]=[{'all':!![]}];}}return _0x27c5f3[_0x3e63bd[_0xa237('0x14')]][_0xa237('0x7')](_0x30951e);})['then'](function(_0x392e6c){_0x170eb9['rows']=_0x392e6c;if(_0x2da169===_0xa237('0x32')&&_0x1cc0f1[_0xa237('0x86')][_0xa237('0xb7')]===_0xa237('0xb8')){var _0x2b49c7=[];for(var _0x1338c6=0x0;_0x1338c6<_0x170eb9['rows'][_0xa237('0x8f')];_0x1338c6++){_0x2b49c7['push'](_0x40f7ca(_0xa237('0xb9'),_0x170eb9['rows'][_0x1338c6][_0xa237('0xba')]));_0x2b49c7[_0xa237('0x95')](_0x40f7ca(_0xa237('0xbb'),_0x170eb9[_0xa237('0xb1')][_0x1338c6][_0xa237('0xba')]));_0x2b49c7[_0xa237('0x95')](_0x40f7ca('fax',_0x170eb9[_0xa237('0xb1')][_0x1338c6][_0xa237('0xba')]));_0x2b49c7[_0xa237('0x95')](_0x40f7ca(_0xa237('0xbc'),_0x170eb9[_0xa237('0xb1')][_0x1338c6]['dataValues']));_0x2b49c7['push'](_0x40f7ca(_0xa237('0xbd'),_0x170eb9[_0xa237('0xb1')][_0x1338c6][_0xa237('0xba')]));_0x2b49c7[_0xa237('0x95')](_0x40f7ca(_0xa237('0xbe'),_0x170eb9[_0xa237('0xb1')][_0x1338c6][_0xa237('0xba')]));}return Promise['all'](_0x2b49c7)['then'](function(){return _0x170eb9;});}return _0x170eb9;});}});}}});}; \ No newline at end of file +var _0xfce9=['musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','WhatsappAccount','teams','voicequeues','queuecampaigns','QueueCampaigns','users','telephones','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','charAt','toUpperCase','slice','select','ui.','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','user_profiles','raw','section','Invalid\x20section\x20\x27','UserProfileSection','params','all','ignore','isEmpty','union','push','autoAssociation','model','length','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','merge','foreignKey','forEach','options','includeAll','reportType','default','reportId','custom','CustomReports','count','rows','CmContact','include','color','tag','ThroughTags','Agents','openTabs','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','exports','models','filter','field','value','findAll','associatedResources','then','catch','resolve','UserProfileResource','map','AnalyticExtractedReport','resourceId','childModel','SquareProject','odbc','SquareOdbc','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','membername','User','role','agent','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','outbound'];(function(_0x41d592,_0x3f8c09){var _0x536cf2=function(_0x4fe7c9){while(--_0x4fe7c9){_0x41d592['push'](_0x41d592['shift']());}};_0x536cf2(++_0x3f8c09);}(_0xfce9,0x85));var _0x9fce=function(_0x59dec3,_0x4864ec){_0x59dec3=_0x59dec3-0x0;var _0x23d28d=_0xfce9[_0x59dec3];return _0x23d28d;};'use strict';var _=require(_0x9fce('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x9fce('0x1')]=function(_0x43321f){var _0x5d34a7=_0x43321f[_0x9fce('0x2')];function _0x2b375d(_0x56bac6,_0x3e3f40){return new Promise(function(_0x12038d,_0xadeaaf){if(!_0x3e3f40)return _0x12038d(null);var _0x3dc8c7=_0x3e3f40['filter']?{[_0x3e3f40[_0x9fce('0x3')][_0x9fce('0x4')]]:_0x3e3f40['filter'][_0x9fce('0x5')]}:undefined;return _0x5d34a7[_0x56bac6][_0x9fce('0x6')]({'where':_0x3dc8c7,'raw':!![]})['then'](function(_0x45d1da){_0x3e3f40[_0x9fce('0x7')]=_['map'](_0x45d1da,'id');_0x12038d(_0x3e3f40);})['catch'](function(_0x5d0f69){_0xadeaaf(_0x5d0f69);});});}function _0x3750fc(_0x2d9df4,_0x5bfdaf){return new Promise(function(_0x47ddb8,_0x1ea7f7){var _0x35eadf=_0x2d9df4[_0x9fce('0x3')]?{[_0x2d9df4[_0x9fce('0x3')][_0x9fce('0x4')]]:_0x2d9df4[_0x9fce('0x3')][_0x9fce('0x5')]}:undefined;return _0x5d34a7[_0x2d9df4['model']][_0x9fce('0x6')]({'where':_0x35eadf,'raw':!![]})[_0x9fce('0x8')](function(_0x5bf99e){_0x5bfdaf['associatedResources']=_['map'](_0x5bf99e,function(_0xb40566){return _0xb40566['name'];});_0x47ddb8(_0x5bfdaf);})[_0x9fce('0x9')](function(_0x5f2b2c){_0x1ea7f7(_0x5f2b2c);});});}function _0x4d68d6(_0x52c72b,_0x36e884,_0x4d71e8){if(!_0x36e884)return Promise[_0x9fce('0xa')](null);return new Promise(function(_0x1a7482,_0xe1b999){return _0x5d34a7[_0x9fce('0xb')][_0x9fce('0x6')]({'where':{'sectionId':_0x36e884['id']},'raw':!![]})[_0x9fce('0x8')](function(_0x1e8dde){if(_0x52c72b[_0x9fce('0x4')]&&_0x52c72b[_0x9fce('0x4')]!=='id'){_0x36e884['associatedResources']=_[_0x9fce('0xc')](_0x1e8dde,function(_0x3461ff){return _0x3461ff[_0x52c72b[_0x9fce('0x4')]];});}else{if(_0x4d71e8===_0x9fce('0xd')){_0x36e884[_0x9fce('0x7')]=_[_0x9fce('0xc')](_0x1e8dde,function(_0x3b857b){return{'id':_0x3b857b[_0x9fce('0xe')],'type':_0x3b857b['type']};});}else{_0x36e884[_0x9fce('0x7')]=_['map'](_0x1e8dde,function(_0x5a112f){return _0x5a112f[_0x9fce('0xe')];});}}_0x1a7482(_0x36e884);})[_0x9fce('0x9')](function(_0x2f6f4f){_0xe1b999(_0x2f6f4f);});});}function _0x583a28(_0x22080b,_0x1acbb2){var _0x3cdd74={'parentSections':[]};switch(_0x22080b['toLowerCase']()){case'squareprojects':_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x10');break;case _0x9fce('0x11'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x12');break;case'squarerecordings':_0x3cdd74[_0x9fce('0xf')]='SquareRecording';_0x3cdd74[_0x9fce('0x13')]=[{'name':_0x9fce('0x14'),'field':_0x9fce('0x15'),'foreignKey':_0x9fce('0x16')}];break;case _0x9fce('0x17'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x18');break;case _0x9fce('0x19'):_0x3cdd74['childModel']='CmContact';_0x3cdd74[_0x9fce('0x13')]=[{'name':_0x9fce('0x1a'),'field':'id','foreignKey':_0x9fce('0x1b')}];break;case _0x9fce('0x1c'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x1d');break;case'companies':_0x3cdd74['childModel']='CmCompany';break;case _0x9fce('0x1e'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x1f');break;case _0x9fce('0x20'):_0x3cdd74['childModel']=_0x9fce('0x21');break;case _0x9fce('0x22'):_0x3cdd74['childModel']=_0x9fce('0x23');break;case _0x9fce('0x24'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x25');break;case _0x9fce('0x26'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x27');break;case _0x9fce('0x28'):case'internalroutes':case _0x9fce('0x29'):_0x3cdd74[_0x9fce('0xf')]='VoiceExtension';break;case _0x9fce('0x2a'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x2b');break;case _0x9fce('0x2c'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x2d');break;case _0x9fce('0x2e'):_0x3cdd74[_0x9fce('0xf')]='VoiceRecording';_0x3cdd74['parentSections']=[{'name':'Agents','field':_0x9fce('0x15'),'foreignKey':_0x9fce('0x2f'),'model':_0x9fce('0x30'),'filter':{'field':_0x9fce('0x31'),'value':[_0x9fce('0x32')]}},{'name':'Telephones','field':'name','foreignKey':_0x9fce('0x2f'),'model':_0x9fce('0x30'),'filter':{'field':'role','value':[_0x9fce('0x33')]}},{'name':_0x9fce('0x34'),'field':_0x9fce('0x15'),'foreignKey':_0x9fce('0x35'),'model':_0x9fce('0x36'),'filter':{'field':_0x9fce('0x37'),'value':[_0x9fce('0x38')]}},{'name':'QueueCampaigns','field':_0x9fce('0x15'),'foreignKey':_0x9fce('0x35'),'model':_0x9fce('0x36'),'filter':{'field':_0x9fce('0x37'),'value':[_0x9fce('0x39')]}}];break;case _0x9fce('0x3a'):_0x3cdd74['childModel']=_0x9fce('0x3b');break;case _0x9fce('0x3c'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x3d');break;case'voiceprefixes':_0x3cdd74[_0x9fce('0xf')]='VoicePrefix';break;case _0x9fce('0x3e'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x3f');break;case _0x9fce('0x40'):_0x3cdd74['childModel']=_0x9fce('0x41');break;case _0x9fce('0x42'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x43');break;case _0x9fce('0x44'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x45');break;case'openchannelqueues':_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x46');break;case _0x9fce('0x47'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x48');break;case _0x9fce('0x49'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x4a');break;case _0x9fce('0x4b'):_0x3cdd74[_0x9fce('0xf')]='SmsAccount';break;case _0x9fce('0x4c'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x4d');break;case'whatsappaccounts':_0x3cdd74['childModel']=_0x9fce('0x4e');break;case _0x9fce('0x4f'):_0x3cdd74[_0x9fce('0xf')]='Team';break;case _0x9fce('0x50'):case _0x9fce('0x51'):_0x3cdd74['childModel']=_0x9fce('0x36');if(_0x1acbb2){_0x3cdd74['parentSections']=[{'name':_0x9fce('0x34')},{'name':_0x9fce('0x52')}];}break;case _0x9fce('0x53'):case'agents':case _0x9fce('0x54'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x30');if(_0x1acbb2){_0x3cdd74[_0x9fce('0x13')]=[{'name':'Users','filter':{'field':_0x9fce('0x31'),'value':[_0x9fce('0x55'),_0x9fce('0x56')]},'ignore':!![]},{'name':'Agents'},{'name':_0x9fce('0x57')}];}break;case _0x9fce('0x58'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x59');break;case _0x9fce('0x5a'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x5b');break;case _0x9fce('0x5c'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x5d');break;case _0x9fce('0x5e'):_0x3cdd74['childModel']=_0x9fce('0x5f');break;case _0x9fce('0x60'):_0x3cdd74[_0x9fce('0xf')]='DeskAccount';break;case'zohoaccounts':_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x61');break;case _0x9fce('0x62'):_0x3cdd74['childModel']=_0x9fce('0x30');break;case _0x9fce('0x63'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x64');break;case _0x9fce('0x65'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x66');break;case _0x9fce('0x67'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x68');break;case _0x9fce('0x69'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x6a');break;case _0x9fce('0x6b'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x6c');break;case _0x9fce('0x6d'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x6e');break;case _0x9fce('0x6f'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x70');break;case'tags':_0x3cdd74['childModel']=_0x9fce('0x71');break;case _0x9fce('0x72'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x73');break;case'triggers':_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x74');break;case _0x9fce('0x75'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x76');break;case _0x9fce('0x77'):_0x3cdd74[_0x9fce('0xf')]=_0x9fce('0x78');break;case _0x9fce('0x79'):_0x3cdd74['childModel']=_0x9fce('0x7a');break;case _0x9fce('0x7b'):_0x3cdd74[_0x9fce('0xf')]='AnalyticExtractedReport';_0x3cdd74[_0x9fce('0x13')]=[{'name':_0x9fce('0x7c'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x3cdd74[_0x9fce('0xf')]='AnalyticMetric';break;}return _0x3cdd74;}function _0x1a3363(_0x11491f,_0x237f82){var _0x222588=_0x11491f[_0x9fce('0x7d')](0x0)[_0x9fce('0x7e')]()+_0x11491f[_0x9fce('0x7f')](0x1);var _0x44dee7={'type':_0x5d34a7['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x1b2959,_0xef5fc){var _0x4c1ca7=squel[_0x9fce('0x80')]()[_0x9fce('0x4')](_0x9fce('0x81')+_0x222588+'InteractionId','id')[_0x9fce('0x4')](_0x9fce('0x82'))[_0x9fce('0x83')](_0x9fce('0x84')+_0x11491f+_0x9fce('0x85'),'ui')[_0x9fce('0x86')](_0x9fce('0x87'),_0x237f82['id']);return _0x5d34a7[_0x9fce('0x88')][_0x9fce('0x89')](_0x4c1ca7[_0x9fce('0x8a')](),_0x44dee7)[_0x9fce('0x8')](function(_0x4cd193){_0x237f82[_0x222588+_0x9fce('0x8b')]=_0x4cd193;_0x1b2959(_0x4cd193);})[_0x9fce('0x9')](function(_0x50daa4){_0xef5fc(_0x50daa4);});});}return _0x43321f[_0x9fce('0x8c')]('UserProfile',attributes,{'tableName':_0x9fce('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x56cdc2){var _0x2036e5={'raw':_0x56cdc2[_0x9fce('0x89')][_0x9fce('0x8e')],'where':{}};var _0x45aff4={};var _0x3367d7={'count':0x0,'rows':[]};var _0x3e46e1=_0x56cdc2[_0x9fce('0x89')][_0x9fce('0x8f')];var _0x30b1b6=_0x56cdc2[_0x9fce('0x89')]['mergeResources']||![];var _0x4d9ce9=_0x583a28(_0x3e46e1,_0x30b1b6);if(!_0x4d9ce9[_0x9fce('0xf')])throw new Error(_0x9fce('0x90')+_0x3e46e1+'\x27');var _0x412624=[{'name':_0x3e46e1}];if(!_['isEmpty'](_0x4d9ce9[_0x9fce('0x13')]))_0x412624=_0x4d9ce9[_0x9fce('0x13')];var _0x3949de=[];for(var _0x4541b8=0x0;_0x4541b8<_0x412624['length'];_0x4541b8++){_0x3949de['push'](_0x5d34a7[_0x9fce('0x91')]['find']({'where':{'userProfileId':_0x56cdc2[_0x9fce('0x92')]['id'],'name':_0x412624[_0x4541b8][_0x9fce('0x15')]},'raw':!![]}));}return Promise[_0x9fce('0x93')](_0x3949de)[_0x9fce('0x8')](function(_0x2deb4d){var _0xda45c4=_['filter'](_0x2deb4d,function(_0x365669){return _0x365669?_0x365669:undefined;});var _0x5fb4f6=_[_0x9fce('0x3')](_0x412624,[_0x9fce('0x94'),!![]]);var _0x250468=_[_0x9fce('0x95')](_0xda45c4)&&_[_0x9fce('0x95')](_0x5fb4f6)?null:_[_0x9fce('0x96')](_0x5fb4f6,_0xda45c4);if(!_0x250468)return null;var _0x379fdd=[];for(var _0x2c842a=0x0;_0x2c842a<_0x250468['length'];_0x2c842a++){var _0x35959e=_['find'](_0x412624,function(_0x5f2c04){return _0x250468[_0x2c842a]?_0x5f2c04['name']===_0x250468[_0x2c842a]['name']:null;});if(_0x35959e){if(_0x250468[_0x2c842a]['ignore']){_0x379fdd[_0x9fce('0x97')](_0x2b375d(_0x4d9ce9[_0x9fce('0xf')],_0x250468[_0x2c842a]));}else{if(!_0x250468[_0x2c842a][_0x9fce('0x98')]){_0x379fdd[_0x9fce('0x97')](_0x4d68d6(_0x35959e,_0x250468[_0x2c842a],_0x4d9ce9[_0x9fce('0xf')]));}else{if(_0x35959e[_0x9fce('0x99')]){_0x379fdd[_0x9fce('0x97')](_0x3750fc(_0x35959e,_0x250468[_0x2c842a]));}}}}}return Promise['all'](_0x379fdd);})[_0x9fce('0x8')](function(_0x51ddd1){var _0x335304=_0x51ddd1;var _0x23d6c2=null;if(_0x335304){_0x23d6c2=_0x335304[_0x9fce('0x9a')]===0x1?_0x335304[0x0]:null;}if(!_0x23d6c2&&!_0x335304)return _0x3367d7;var _0x379a15=_0x5d34a7[_0x4d9ce9[_0x9fce('0xf')]][_0x9fce('0x9b')];_0x45aff4[_0x9fce('0x99')]=_[_0x9fce('0x9c')](_0x379a15);_0x45aff4['query']=_[_0x9fce('0x9c')](_0x56cdc2[_0x9fce('0x89')]);_0x45aff4[_0x9fce('0x9d')]=_[_0x9fce('0x9e')](_0x45aff4[_0x9fce('0x99')],_0x45aff4[_0x9fce('0x89')]);_0x2036e5[_0x9fce('0x9f')]=_[_0x9fce('0x9e')](_0x45aff4[_0x9fce('0x99')],qs[_0x9fce('0xa0')](_0x56cdc2[_0x9fce('0x89')][_0x9fce('0xa0')]));_0x2036e5[_0x9fce('0x9f')]=_0x2036e5[_0x9fce('0x9f')][_0x9fce('0x9a')]?_0x2036e5[_0x9fce('0x9f')]:_0x45aff4['model'];if(!_0x56cdc2['query']['hasOwnProperty'](_0x9fce('0xa1'))){_0x2036e5[_0x9fce('0xa2')]=qs[_0x9fce('0xa2')](_0x56cdc2[_0x9fce('0x89')]['limit']);_0x2036e5[_0x9fce('0xa3')]=qs['offset'](_0x56cdc2[_0x9fce('0x89')][_0x9fce('0xa3')]);}_0x2036e5[_0x9fce('0xa4')]=qs[_0x9fce('0xa5')](_0x56cdc2[_0x9fce('0x89')][_0x9fce('0xa5')]);_0x2036e5[_0x9fce('0x86')]=qs[_0x9fce('0x9d')](_['pick'](_0x56cdc2[_0x9fce('0x89')],_0x45aff4[_0x9fce('0x9d')]));if(_0x56cdc2[_0x9fce('0x89')][_0x9fce('0x3')]){_0x2036e5[_0x9fce('0x86')]=_[_0x9fce('0xa6')](_0x2036e5[_0x9fce('0x86')],{'$or':_[_0x9fce('0xc')](_0x379a15,function(_0x2f4614){if(_0x2f4614['type']['key']!=='VIRTUAL'){var _0xc03531={};_0xc03531[_0x2f4614[_0x9fce('0x4')]]={'$like':'%'+_0x56cdc2[_0x9fce('0x89')][_0x9fce('0x3')]+'%'};return _0xc03531;}})});}var _0xca5292=[];var _0x54744a=null;var _0x17031f={};if(_0x23d6c2){_0x54744a=_['find'](_0x412624,[_0x9fce('0x15'),_0x23d6c2[_0x9fce('0x15')]]);if(_0x54744a[_0x9fce('0x4')]){_0x17031f={};if(_0x4d9ce9[_0x9fce('0xf')]===_0x9fce('0xd')){_0x17031f[_0x54744a['foreignKey']]=_[_0x9fce('0xc')](_0x23d6c2['associatedResources'],'id');}else{_0x17031f[_0x54744a[_0x9fce('0xa7')]]=_0x23d6c2[_0x9fce('0x7')];}_0xca5292[_0x9fce('0x97')](_0x17031f);}else{_0x2036e5[_0x9fce('0x86')]['id']=_0x23d6c2['associatedResources'];}}else{for(var _0x32e128=0x0;_0x32e128<_0x335304[_0x9fce('0x9a')];_0x32e128++){_0x54744a=_['find'](_0x412624,['name',_0x335304[_0x32e128][_0x9fce('0x15')]]);if(_0x54744a['field']){_0x17031f={};_0x17031f[_0x54744a[_0x9fce('0xa7')]]=_0x335304[_0x32e128][_0x9fce('0x7')];_0xca5292[_0x9fce('0x97')](_0x17031f);}else{if(!_0x2036e5[_0x9fce('0x86')]['id'])_0x2036e5['where']['id']=[];_0x335304[_0x32e128][_0x9fce('0x7')][_0x9fce('0xa8')](function(_0x498820){_0x2036e5['where']['id']['push'](_0x498820);});}}}if(!_[_0x9fce('0x95')](_0xca5292)){_0x2036e5[_0x9fce('0x86')]=_[_0x9fce('0xa6')](_0x2036e5[_0x9fce('0x86')],{'$and':{'$or':_0xca5292}});}_0x2036e5=_[_0x9fce('0xa6')]({},_0x2036e5,_0x56cdc2[_0x9fce('0xa9')]);if(_0x23d6c2&&!_0x23d6c2['autoAssociation']&&_0x4d9ce9[_0x9fce('0xf')]===_0x9fce('0xd')){if(_0x56cdc2[_0x9fce('0x89')][_0x9fce('0xaa')]){_0x2036e5['include']=[{'all':!![]}];}return _0x5d34a7[_0x4d9ce9[_0x9fce('0xf')]]['findAll'](_0x2036e5)[_0x9fce('0x8')](function(_0x4c1ef9){var _0xe27e65=[];_0x4c1ef9[_0x9fce('0xa8')](function(_0xdba659){var _0x499179;switch(_0xdba659[_0x9fce('0xab')]){case _0x9fce('0xac'):_0x499179=_['find'](_0x23d6c2['associatedResources'],function(_0x5b6b3b){return _0x5b6b3b['id']===_0xdba659[_0x9fce('0xad')]&&_0x5b6b3b[_0x9fce('0x37')]==='DefaultReports';});break;case _0x9fce('0xae'):_0x499179=_['find'](_0x23d6c2[_0x9fce('0x7')],function(_0x3e61d0){return _0x3e61d0['id']===_0xdba659[_0x9fce('0xad')]&&_0x3e61d0[_0x9fce('0x37')]===_0x9fce('0xaf');});break;}if(_0x499179)_0xe27e65[_0x9fce('0x97')](_0xdba659);});_0x3367d7[_0x9fce('0xb0')]=_0xe27e65[_0x9fce('0x9a')];_0x3367d7[_0x9fce('0xb1')]=_0xe27e65;return _0x3367d7;});}else{return _0x5d34a7[_0x4d9ce9[_0x9fce('0xf')]][_0x9fce('0xb0')]({'where':_0x2036e5[_0x9fce('0x86')]})[_0x9fce('0x8')](function(_0x316586){_0x3367d7[_0x9fce('0xb0')]=_0x316586;if(_0x56cdc2[_0x9fce('0x89')][_0x9fce('0xaa')]){if(_0x4d9ce9[_0x9fce('0xf')]===_0x9fce('0xb2')){_0x2036e5[_0x9fce('0xb3')]=[{'model':_0x5d34a7[_0x9fce('0x71')],'as':'Tags','attributes':['id',_0x9fce('0x15'),_0x9fce('0xb4')],'required':_0x56cdc2[_0x9fce('0x89')][_0x9fce('0xb5')]?!![]:![]},{'model':_0x5d34a7['Tag'],'as':_0x9fce('0xb6'),'attributes':['id',_0x9fce('0x15'),_0x9fce('0xb4')],'through':_0x56cdc2[_0x9fce('0x89')]['tag']?{'attributes':[],'where':{'TagId':_0x56cdc2[_0x9fce('0x89')][_0x9fce('0xb5')]||undefined}}:{},'required':_0x56cdc2['query'][_0x9fce('0xb5')]?!![]:![]}];}else{_0x2036e5[_0x9fce('0xb3')]=[{'all':!![]}];}}return _0x5d34a7[_0x4d9ce9[_0x9fce('0xf')]][_0x9fce('0x6')](_0x2036e5);})[_0x9fce('0x8')](function(_0x2722f9){_0x3367d7[_0x9fce('0xb1')]=_0x2722f9;if(_0x3e46e1===_0x9fce('0xb7')&&_0x56cdc2['query'][_0x9fce('0xb8')]==='true'){var _0x48e289=[];for(var _0xa12506=0x0;_0xa12506<_0x3367d7['rows'][_0x9fce('0x9a')];_0xa12506++){_0x48e289[_0x9fce('0x97')](_0x1a3363('chat',_0x3367d7[_0x9fce('0xb1')][_0xa12506][_0x9fce('0xb9')]));_0x48e289[_0x9fce('0x97')](_0x1a3363(_0x9fce('0xba'),_0x3367d7[_0x9fce('0xb1')][_0xa12506][_0x9fce('0xb9')]));_0x48e289[_0x9fce('0x97')](_0x1a3363(_0x9fce('0xbb'),_0x3367d7[_0x9fce('0xb1')][_0xa12506]['dataValues']));_0x48e289[_0x9fce('0x97')](_0x1a3363(_0x9fce('0xbc'),_0x3367d7[_0x9fce('0xb1')][_0xa12506]['dataValues']));_0x48e289[_0x9fce('0x97')](_0x1a3363(_0x9fce('0xbd'),_0x3367d7[_0x9fce('0xb1')][_0xa12506]['dataValues']));_0x48e289[_0x9fce('0x97')](_0x1a3363(_0x9fce('0xbe'),_0x3367d7[_0x9fce('0xb1')][_0xa12506][_0x9fce('0xb9')]));}return Promise[_0x9fce('0x93')](_0x48e289)[_0x9fce('0x8')](function(){return _0x3367d7;});}return _0x3367d7;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index bf12010..2d04514 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 _0xdbb1=['UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','randomstring','../../config/utils','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','info','UserProfile,\x20%s,\x20%s','debug'];(function(_0x30fa0f,_0x323946){var _0x49bacf=function(_0x282b95){while(--_0x282b95){_0x30fa0f['push'](_0x30fa0f['shift']());}};_0x49bacf(++_0x323946);}(_0xdbb1,0x105));var _0x1dbb=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xdbb1[_0x257642];return _0x3d813b;};'use strict';var _=require(_0x1dbb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1dbb('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1dbb('0x2'));var logger=require('../../config/logger')(_0x1dbb('0x3'));var config=require(_0x1dbb('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1dbb('0x5')]({'port':0x232a});config[_0x1dbb('0x6')]=_[_0x1dbb('0x7')](config[_0x1dbb('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x1dbb('0x8'))(new Redis(config[_0x1dbb('0x6')]));require('./userProfile.socket')[_0x1dbb('0x9')](socket);function respondWithRpcPromise(_0x232c1c,_0x1e7ac5,_0x3ce7e9){return new BPromise(function(_0x40b115,_0x183120){return client[_0x1dbb('0xa')](_0x232c1c,_0x3ce7e9)[_0x1dbb('0xb')](function(_0x3e71bd){logger[_0x1dbb('0xc')](_0x1dbb('0xd'),_0x1e7ac5,'request\x20sent');logger[_0x1dbb('0xe')](_0x1dbb('0xf'),_0x1e7ac5,_0x1dbb('0x10'),JSON[_0x1dbb('0x11')](_0x3e71bd));if(_0x3e71bd['error']){if(_0x3e71bd['error'][_0x1dbb('0x12')]===0x1f4){logger[_0x1dbb('0x13')](_0x1dbb('0xd'),_0x1e7ac5,_0x3e71bd[_0x1dbb('0x13')][_0x1dbb('0x14')]);return _0x183120(_0x3e71bd['error'][_0x1dbb('0x14')]);}logger[_0x1dbb('0x13')](_0x1dbb('0xd'),_0x1e7ac5,_0x3e71bd['error'][_0x1dbb('0x14')]);return _0x40b115(_0x3e71bd[_0x1dbb('0x13')]['message']);}else{logger[_0x1dbb('0xc')](_0x1dbb('0xd'),_0x1e7ac5,_0x1dbb('0x10'));_0x40b115(_0x3e71bd[_0x1dbb('0x15')][_0x1dbb('0x14')]);}})[_0x1dbb('0x16')](function(_0x2ae3f2){logger[_0x1dbb('0x13')]('UserProfile,\x20%s,\x20%s',_0x1e7ac5,_0x2ae3f2);_0x183120(_0x2ae3f2);});});} \ No newline at end of file +var _0x77d4=['util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./userProfile.socket','register','then','UserProfile,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0x77d4,0x108));var _0x477d=function(_0x24d560,_0x2e0e7b){_0x24d560=_0x24d560-0x0;var _0x18f7b3=_0x77d4[_0x24d560];return _0x18f7b3;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var moment=require('moment');var BPromise=require(_0x477d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x477d('0x4'));var config=require(_0x477d('0x5'));var jayson=require(_0x477d('0x6'));var client=jayson[_0x477d('0x7')][_0x477d('0x8')]({'port':0x232a});config[_0x477d('0x9')]=_['defaults'](config['redis'],{'host':_0x477d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x477d('0xb'))[_0x477d('0xc')](socket);function respondWithRpcPromise(_0x204cb9,_0x2c326c,_0x1cef1c){return new BPromise(function(_0x58ff29,_0x932cc9){return client['request'](_0x204cb9,_0x1cef1c)[_0x477d('0xd')](function(_0x462ac1){logger['info'](_0x477d('0xe'),_0x2c326c,_0x477d('0xf'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x2c326c,_0x477d('0xf'),JSON[_0x477d('0x10')](_0x462ac1));if(_0x462ac1['error']){if(_0x462ac1[_0x477d('0x11')][_0x477d('0x12')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x2c326c,_0x462ac1[_0x477d('0x11')]['message']);return _0x932cc9(_0x462ac1[_0x477d('0x11')][_0x477d('0x13')]);}logger[_0x477d('0x11')]('UserProfile,\x20%s,\x20%s',_0x2c326c,_0x462ac1[_0x477d('0x11')][_0x477d('0x13')]);return _0x58ff29(_0x462ac1[_0x477d('0x11')][_0x477d('0x13')]);}else{logger['info'](_0x477d('0xe'),_0x2c326c,'request\x20sent');_0x58ff29(_0x462ac1[_0x477d('0x14')][_0x477d('0x13')]);}})[_0x477d('0x15')](function(_0x458489){logger[_0x477d('0x11')](_0x477d('0xe'),_0x2c326c,_0x458489);_0x932cc9(_0x458489);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index a9fdd90..d7d3fca 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 _0x5431=['userProfile:','./userProfile.events','save','remove','update','emit','removeListener','register'];(function(_0x40a33a,_0x296e04){var _0x1399dd=function(_0x172c0f){while(--_0x172c0f){_0x40a33a['push'](_0x40a33a['shift']());}};_0x1399dd(++_0x296e04);}(_0x5431,0x71));var _0x1543=function(_0x420e95,_0x566c1b){_0x420e95=_0x420e95-0x0;var _0x1f225e=_0x5431[_0x420e95];return _0x1f225e;};'use strict';var UserProfileEvents=require(_0x1543('0x0'));var events=[_0x1543('0x1'),_0x1543('0x2'),_0x1543('0x3')];function createListener(_0x267acb,_0x685785){return function(_0x5e602b){_0x685785[_0x1543('0x4')](_0x267acb,_0x5e602b);};}function removeListener(_0x4b5d4e,_0x37b0d6){return function(){UserProfileEvents[_0x1543('0x5')](_0x4b5d4e,_0x37b0d6);};}exports[_0x1543('0x6')]=function(_0x2a42e8){for(var _0x1fce87=0x0,_0x16fed7=events['length'];_0x1fce87<_0x16fed7;_0x1fce87++){var _0x5b4bdb=events[_0x1fce87];var _0x5b9817=createListener(_0x1543('0x7')+_0x5b4bdb,_0x2a42e8);UserProfileEvents['on'](_0x5b4bdb,_0x5b9817);}}; \ No newline at end of file +var _0x7d5a=['length','userProfile:','./userProfile.events','remove','update','emit','removeListener','register'];(function(_0x5d9cb6,_0x2b03a1){var _0x579e4e=function(_0x4f5771){while(--_0x4f5771){_0x5d9cb6['push'](_0x5d9cb6['shift']());}};_0x579e4e(++_0x2b03a1);}(_0x7d5a,0x14a));var _0xa7d5=function(_0x100b7,_0x595657){_0x100b7=_0x100b7-0x0;var _0x3e5d5c=_0x7d5a[_0x100b7];return _0x3e5d5c;};'use strict';var UserProfileEvents=require(_0xa7d5('0x0'));var events=['save',_0xa7d5('0x1'),_0xa7d5('0x2')];function createListener(_0x2c8174,_0x36f9c5){return function(_0x1379e3){_0x36f9c5[_0xa7d5('0x3')](_0x2c8174,_0x1379e3);};}function removeListener(_0x5c44b3,_0x4483b7){return function(){UserProfileEvents[_0xa7d5('0x4')](_0x5c44b3,_0x4483b7);};}exports[_0xa7d5('0x5')]=function(_0x411577){for(var _0x4ae8b3=0x0,_0x17a7fc=events[_0xa7d5('0x6')];_0x4ae8b3<_0x17a7fc;_0x4ae8b3++){var _0x59fdf8=events[_0x4ae8b3];var _0x4fcfba=createListener(_0xa7d5('0x7')+_0x59fdf8,_0x411577);UserProfileEvents['on'](_0x59fdf8,_0x4fcfba);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index f60cf0b..00e96f2 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 _0x6188=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x3faf09,_0x45940b){var _0x4da257=function(_0x41ed61){while(--_0x41ed61){_0x3faf09['push'](_0x3faf09['shift']());}};_0x4da257(++_0x45940b);}(_0x6188,0x6b));var _0x8618=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x6188[_0x3a2a3c];return _0x50ac9a;};'use strict';var multer=require(_0x8618('0x0'));var util=require(_0x8618('0x1'));var path=require(_0x8618('0x2'));var timeout=require(_0x8618('0x3'));var express=require(_0x8618('0x4'));var router=express[_0x8618('0x5')]();var fs_extra=require(_0x8618('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8618('0x7'));var config=require(_0x8618('0x8'));var controller=require('./userProfileResource.controller');router[_0x8618('0x9')]('/',auth['isAuthenticated'](),controller[_0x8618('0xa')]);router['get'](_0x8618('0xb'),auth[_0x8618('0xc')](),controller[_0x8618('0xd')]);router[_0x8618('0x9')](_0x8618('0xe'),auth[_0x8618('0xc')](),controller[_0x8618('0xf')]);router[_0x8618('0x10')]('/',auth[_0x8618('0xc')](),controller[_0x8618('0x11')]);router[_0x8618('0x12')]('/:id',auth[_0x8618('0xc')](),controller[_0x8618('0x13')]);router['delete']('/:id',auth[_0x8618('0xc')](),controller[_0x8618('0x14')]);module[_0x8618('0x15')]=router; \ No newline at end of file +var _0x6d96=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete'];(function(_0x8c510d,_0x42f46f){var _0x120eb8=function(_0x108b59){while(--_0x108b59){_0x8c510d['push'](_0x8c510d['shift']());}};_0x120eb8(++_0x42f46f);}(_0x6d96,0x13c));var _0x66d9=function(_0x4c2bdc,_0x5915d7){_0x4c2bdc=_0x4c2bdc-0x0;var _0x5a3222=_0x6d96[_0x4c2bdc];return _0x5a3222;};'use strict';var multer=require(_0x66d9('0x0'));var util=require(_0x66d9('0x1'));var path=require(_0x66d9('0x2'));var timeout=require(_0x66d9('0x3'));var express=require(_0x66d9('0x4'));var router=express[_0x66d9('0x5')]();var fs_extra=require(_0x66d9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x66d9('0x7'));var config=require(_0x66d9('0x8'));var controller=require(_0x66d9('0x9'));router[_0x66d9('0xa')]('/',auth[_0x66d9('0xb')](),controller[_0x66d9('0xc')]);router[_0x66d9('0xa')](_0x66d9('0xd'),auth['isAuthenticated'](),controller[_0x66d9('0xe')]);router[_0x66d9('0xa')](_0x66d9('0xf'),auth[_0x66d9('0xb')](),controller[_0x66d9('0x10')]);router['post']('/',auth[_0x66d9('0xb')](),controller['create']);router[_0x66d9('0x11')](_0x66d9('0xf'),auth['isAuthenticated'](),controller[_0x66d9('0x12')]);router[_0x66d9('0x13')](_0x66d9('0xf'),auth[_0x66d9('0xb')](),controller[_0x66d9('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index bc73a1f..42419ff 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 _0x79eb=['exports','sequelize'];(function(_0x2d8599,_0xdbe593){var _0x33b1d7=function(_0x121ea3){while(--_0x121ea3){_0x2d8599['push'](_0x2d8599['shift']());}};_0x33b1d7(++_0xdbe593);}(_0x79eb,0xfb));var _0xb79e=function(_0x23fa37,_0x57ebef){_0x23fa37=_0x23fa37-0x0;var _0x148179=_0x79eb[_0x23fa37];return _0x148179;};'use strict';var Sequelize=require(_0xb79e('0x0'));module[_0xb79e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x560e=['STRING','sequelize','INTEGER'];(function(_0x2653a7,_0x4a61bf){var _0x1fd413=function(_0x5d95db){while(--_0x5d95db){_0x2653a7['push'](_0x2653a7['shift']());}};_0x1fd413(++_0x4a61bf);}(_0x560e,0xf4));var _0xe560=function(_0xc8da78,_0x3e3967){_0xc8da78=_0xc8da78-0x0;var _0x406374=_0x560e[_0xc8da78];return _0x406374;};'use strict';var Sequelize=require(_0xe560('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xe560('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe560('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 7797ec3..8e024f9 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 _0x1623=['filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','UserProfileResource','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x1623,0xab));var _0x3162=function(_0x2870f8,_0x176601){_0x2870f8=_0x2870f8-0x0;var _0x3d5223=_0x1623[_0x2870f8];return _0x3d5223;};'use strict';var emlformat=require(_0x3162('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3162('0x1'));var rp=require(_0x3162('0x2'));var moment=require(_0x3162('0x3'));var BPromise=require(_0x3162('0x4'));var Mustache=require(_0x3162('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3162('0x6'));var csv=require('to-csv');var ejs=require(_0x3162('0x7'));var fs=require('fs');var fs_extra=require(_0x3162('0x8'));var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0xd'));var querystring=require(_0x3162('0xe'));var Papa=require(_0x3162('0xf'));var Redis=require(_0x3162('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x11'));var hardwareService=require(_0x3162('0x12'));var logger=require(_0x3162('0x13'))(_0x3162('0x14'));var utils=require(_0x3162('0x15'));var config=require(_0x3162('0x16'));var licenseUtil=require(_0x3162('0x17'));var db=require(_0x3162('0x18'))['db'];function respondWithStatusCode(_0x157ab8,_0x4c3625){_0x4c3625=_0x4c3625||0xcc;return function(_0x2d11c5){if(_0x2d11c5){return _0x157ab8['sendStatus'](_0x4c3625);}return _0x157ab8[_0x3162('0x19')](_0x4c3625)[_0x3162('0x1a')]();};}function respondWithResult(_0x49d1ad,_0x4a393a){_0x4a393a=_0x4a393a||0xc8;return function(_0x198764){if(_0x198764){return _0x49d1ad[_0x3162('0x19')](_0x4a393a)[_0x3162('0x1b')](_0x198764);}};}function respondWithFilteredResult(_0x4b8a3b,_0x15e348){return function(_0x3d0bea){if(_0x3d0bea){var _0x2705d1=typeof _0x15e348['offset']===_0x3162('0x1c')&&typeof _0x15e348[_0x3162('0x1d')]===_0x3162('0x1c');var _0xc3ee06=_0x3d0bea[_0x3162('0x1e')];var _0x1eed46=_0x2705d1?0x0:_0x15e348[_0x3162('0x1f')];var _0x4b2bf3=_0x2705d1?_0x3d0bea[_0x3162('0x1e')]:_0x15e348[_0x3162('0x1f')]+_0x15e348[_0x3162('0x1d')];var _0x36ca97;if(_0x4b2bf3>=_0xc3ee06){_0x4b2bf3=_0xc3ee06;_0x36ca97=0xc8;}else{_0x36ca97=0xce;}_0x4b8a3b['status'](_0x36ca97);return _0x4b8a3b[_0x3162('0x20')]('Content-Range',_0x1eed46+'-'+_0x4b2bf3+'/'+_0xc3ee06)['json'](_0x3d0bea);}return null;};}function patchUpdates(_0xa5c62b){return function(_0x3e4d23){try{jsonpatch[_0x3162('0x21')](_0x3e4d23,_0xa5c62b,!![]);}catch(_0x523fab){return BPromise['reject'](_0x523fab);}return _0x3e4d23[_0x3162('0x22')]();};}function saveUpdates(_0x396372,_0x32c051){return function(_0x26c90d){if(_0x26c90d){return _0x26c90d[_0x3162('0x23')](_0x396372)[_0x3162('0x24')](function(_0x52ae25){return _0x52ae25;});}return null;};}function removeEntity(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(_0xd283d6){return _0xd283d6[_0x3162('0x25')]()[_0x3162('0x24')](function(){_0x1b2713[_0x3162('0x19')](0xcc)[_0x3162('0x1a')]();});}};}function handleEntityNotFound(_0x3c543e,_0x30552f){return function(_0x5f8f7){if(!_0x5f8f7){_0x3c543e[_0x3162('0x26')](0x194);}return _0x5f8f7;};}function handleError(_0x356c5d,_0x8fa09f){_0x8fa09f=_0x8fa09f||0x1f4;return function(_0x2f62d7){logger[_0x3162('0x27')](_0x2f62d7['stack']);if(_0x2f62d7[_0x3162('0x28')]){delete _0x2f62d7['name'];}_0x356c5d[_0x3162('0x19')](_0x8fa09f)[_0x3162('0x29')](_0x2f62d7);};}exports[_0x3162('0x2a')]=function(_0x57f567,_0x4903e7){var _0xda0389={},_0xaa1f35={},_0x14df16={'count':0x0,'rows':[]};var _0x399148=_[_0x3162('0x2b')](db['UserProfileResource'][_0x3162('0x2c')],function(_0x4e3cc2){return{'name':_0x4e3cc2[_0x3162('0x2d')],'type':_0x4e3cc2[_0x3162('0x2e')][_0x3162('0x2f')]};});_0xaa1f35[_0x3162('0x30')]=_[_0x3162('0x2b')](_0x399148,_0x3162('0x28'));_0xaa1f35[_0x3162('0x31')]=_[_0x3162('0x32')](_0x57f567['query']);_0xaa1f35[_0x3162('0x33')]=_[_0x3162('0x34')](_0xaa1f35['model'],_0xaa1f35[_0x3162('0x31')]);_0xda0389[_0x3162('0x35')]=_['intersection'](_0xaa1f35['model'],qs[_0x3162('0x36')](_0x57f567['query'][_0x3162('0x36')]));_0xda0389[_0x3162('0x35')]=_0xda0389[_0x3162('0x35')]['length']?_0xda0389['attributes']:_0xaa1f35[_0x3162('0x30')];if(!_0x57f567[_0x3162('0x31')]['hasOwnProperty'](_0x3162('0x37'))){_0xda0389['limit']=qs[_0x3162('0x1d')](_0x57f567[_0x3162('0x31')][_0x3162('0x1d')]);_0xda0389[_0x3162('0x1f')]=qs[_0x3162('0x1f')](_0x57f567[_0x3162('0x31')][_0x3162('0x1f')]);}_0xda0389[_0x3162('0x38')]=qs[_0x3162('0x39')](_0x57f567[_0x3162('0x31')][_0x3162('0x39')]);_0xda0389['where']=qs[_0x3162('0x33')](_[_0x3162('0x3a')](_0x57f567[_0x3162('0x31')],_0xaa1f35['filters']),_0x399148);if(_0x57f567['query'][_0x3162('0x3b')]){_0xda0389[_0x3162('0x3c')]=_[_0x3162('0x3d')](_0xda0389[_0x3162('0x3c')],{'$or':_['map'](_0x399148,function(_0x4186b6){if(_0x4186b6['type']!=='VIRTUAL'){var _0x5dee49={};_0x5dee49[_0x4186b6[_0x3162('0x28')]]={'$like':'%'+_0x57f567[_0x3162('0x31')][_0x3162('0x3b')]+'%'};return _0x5dee49;}})});}_0xda0389=_['merge']({},_0xda0389,_0x57f567[_0x3162('0x3e')]);var _0x2ce9c6={'where':_0xda0389[_0x3162('0x3c')]};return db[_0x3162('0x3f')][_0x3162('0x1e')](_0x2ce9c6)['then'](function(_0x5447d6){_0x14df16[_0x3162('0x1e')]=_0x5447d6;if(_0x57f567[_0x3162('0x31')]['includeAll']){_0xda0389['include']=[{'all':!![]}];}return db[_0x3162('0x3f')][_0x3162('0x40')](_0xda0389);})[_0x3162('0x24')](function(_0x4883ac){_0x14df16[_0x3162('0x41')]=_0x4883ac;return _0x14df16;})[_0x3162('0x24')](respondWithFilteredResult(_0x4903e7,_0xda0389))[_0x3162('0x42')](handleError(_0x4903e7,null));};exports[_0x3162('0x43')]=function(_0x534708,_0x2617d3){var _0x282e3e={'raw':![],'where':{'id':_0x534708[_0x3162('0x44')]['id']}},_0x522cce={};_0x522cce[_0x3162('0x30')]=_['keys'](db[_0x3162('0x3f')][_0x3162('0x2c')]);_0x522cce['query']=_[_0x3162('0x32')](_0x534708['query']);_0x522cce[_0x3162('0x33')]=_[_0x3162('0x34')](_0x522cce[_0x3162('0x30')],_0x522cce[_0x3162('0x31')]);_0x282e3e[_0x3162('0x35')]=_[_0x3162('0x34')](_0x522cce['model'],qs[_0x3162('0x36')](_0x534708[_0x3162('0x31')][_0x3162('0x36')]));_0x282e3e['attributes']=_0x282e3e[_0x3162('0x35')][_0x3162('0x45')]?_0x282e3e['attributes']:_0x522cce[_0x3162('0x30')];if(_0x534708['query']['includeAll']){_0x282e3e['include']=[{'all':!![]}];}_0x282e3e=_[_0x3162('0x3d')]({},_0x282e3e,_0x534708[_0x3162('0x3e')]);return db[_0x3162('0x3f')][_0x3162('0x46')](_0x282e3e)[_0x3162('0x24')](handleEntityNotFound(_0x2617d3,null))[_0x3162('0x24')](respondWithResult(_0x2617d3,null))[_0x3162('0x42')](handleError(_0x2617d3,null));};exports[_0x3162('0x47')]=function(_0x3d2958,_0x28865c){return db[_0x3162('0x3f')][_0x3162('0x47')](_0x3d2958[_0x3162('0x48')],{})['then'](respondWithResult(_0x28865c,0xc9))[_0x3162('0x42')](handleError(_0x28865c,null));};exports['update']=function(_0x4f1dde,_0x12d791){if(_0x4f1dde[_0x3162('0x48')]['id']){delete _0x4f1dde[_0x3162('0x48')]['id'];}return db[_0x3162('0x3f')]['find']({'where':{'id':_0x4f1dde[_0x3162('0x44')]['id']}})['then'](handleEntityNotFound(_0x12d791,null))[_0x3162('0x24')](saveUpdates(_0x4f1dde[_0x3162('0x48')],null))['then'](respondWithResult(_0x12d791,null))[_0x3162('0x42')](handleError(_0x12d791,null));};exports['destroy']=function(_0x516599,_0x13e7c4){return db[_0x3162('0x3f')][_0x3162('0x46')]({'where':{'id':_0x516599[_0x3162('0x44')]['id']}})[_0x3162('0x24')](handleEntityNotFound(_0x13e7c4,null))[_0x3162('0x24')](removeEntity(_0x13e7c4,null))[_0x3162('0x42')](handleError(_0x13e7c4,null));};exports[_0x3162('0x49')]=function(_0x554a03,_0x48b81d){return db['UserProfileResource'][_0x3162('0x49')]()[_0x3162('0x24')](respondWithResult(_0x48b81d,null))[_0x3162('0x42')](handleError(_0x48b81d,null));}; \ No newline at end of file +var _0xafc4=['update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','UserProfileResource','includeAll','catch','show','params','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x540172,_0x130547){var _0x77d499=function(_0x573e54){while(--_0x573e54){_0x540172['push'](_0x540172['shift']());}};_0x77d499(++_0x130547);}(_0xafc4,0x69));var _0x4afc=function(_0x671313,_0x7f3337){_0x671313=_0x671313-0x0;var _0x466abe=_0xafc4[_0x671313];return _0x466abe;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['UserProfileResource'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['UserProfileResource']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));};exports[_0x4afc('0x45')]=function(_0x3625c9,_0x387834){return db[_0x4afc('0x3d')][_0x4afc('0x45')]()[_0x4afc('0x25')](respondWithResult(_0x387834,null))[_0x4afc('0x3f')](handleError(_0x387834,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index a9a4f6a..140e368 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 _0xe410=['UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x1365bb,_0x51ccf8){var _0x1cb742=function(_0x3ab2b9){while(--_0x3ab2b9){_0x1365bb['push'](_0x1365bb['shift']());}};_0x1cb742(++_0x51ccf8);}(_0xe410,0x163));var _0x0e41=function(_0x3cbe3a,_0x78bfce){_0x3cbe3a=_0x3cbe3a-0x0;var _0x24ffc1=_0xe410[_0x3cbe3a];return _0x24ffc1;};'use strict';var _=require(_0x0e41('0x0'));var util=require('util');var logger=require(_0x0e41('0x1'))(_0x0e41('0x2'));var moment=require('moment');var BPromise=require(_0x0e41('0x3'));var rp=require(_0x0e41('0x4'));var fs=require('fs');var path=require(_0x0e41('0x5'));var rimraf=require(_0x0e41('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0x0e41('0x7')]=function(_0x3b6e6c,_0xfe70ca){return _0x3b6e6c[_0x0e41('0x8')](_0x0e41('0x9'),attributes,{'tableName':_0x0e41('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x0e41('0xb'),_0x0e41('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5906=['rimraf','../../config/environment','define','user_profile_has_resources','compositeIndex','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x48c10c,_0x2cd4a2){var _0x2a3540=function(_0x3dcfb6){while(--_0x3dcfb6){_0x48c10c['push'](_0x48c10c['shift']());}};_0x2a3540(++_0x2cd4a2);}(_0x5906,0x131));var _0x6590=function(_0x334f64,_0x1e0b74){_0x334f64=_0x334f64-0x0;var _0x2de374=_0x5906[_0x334f64];return _0x2de374;};'use strict';var _=require(_0x6590('0x0'));var util=require(_0x6590('0x1'));var logger=require(_0x6590('0x2'))(_0x6590('0x3'));var moment=require('moment');var BPromise=require(_0x6590('0x4'));var rp=require(_0x6590('0x5'));var fs=require('fs');var path=require(_0x6590('0x6'));var rimraf=require(_0x6590('0x7'));var config=require(_0x6590('0x8'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x54c01a,_0x433bf6){return _0x54c01a[_0x6590('0x9')]('UserProfileResource',attributes,{'tableName':_0x6590('0xa'),'paranoid':![],'indexes':[{'name':_0x6590('0xb'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 36cda15..4641097 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 _0xab40=['../../config/utils','../../config/logger','rpc','client','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','ioredis','../../mysqldb'];(function(_0xe273eb,_0x249b21){var _0x397041=function(_0x20e5e7){while(--_0x20e5e7){_0xe273eb['push'](_0xe273eb['shift']());}};_0x397041(++_0x249b21);}(_0xab40,0xcd));var _0x0ab4=function(_0x4f83e0,_0x5c900f){_0x4f83e0=_0x4f83e0-0x0;var _0x5baff2=_0xab40[_0x4f83e0];return _0x5baff2;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10d92b,_0x46d16a,_0x11e99f){return new BPromise(function(_0x6d135d,_0x4cf8de){return client['request'](_0x10d92b,_0x11e99f)['then'](function(_0x24271e){logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));logger[_0x0ab4('0xb')](_0x0ab4('0xc'),_0x46d16a,_0x0ab4('0xa'),JSON[_0x0ab4('0xd')](_0x24271e));if(_0x24271e['error']){if(_0x24271e['error'][_0x0ab4('0xe')]===0x1f4){logger['error'](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x4cf8de(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}logger[_0x0ab4('0xf')](_0x0ab4('0x9'),_0x46d16a,_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);return _0x6d135d(_0x24271e[_0x0ab4('0xf')][_0x0ab4('0x10')]);}else{logger[_0x0ab4('0x8')](_0x0ab4('0x9'),_0x46d16a,_0x0ab4('0xa'));_0x6d135d(_0x24271e[_0x0ab4('0x11')][_0x0ab4('0x10')]);}})[_0x0ab4('0x12')](function(_0x2bdda7){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x46d16a,_0x2bdda7);_0x4cf8de(_0x2bdda7);});});} \ No newline at end of file +var _0x63db=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1442a8,_0x58496c){var _0x4cad6b=function(_0x34a34a){while(--_0x34a34a){_0x1442a8['push'](_0x1442a8['shift']());}};_0x4cad6b(++_0x58496c);}(_0x63db,0x117));var _0xb63d=function(_0x788c70,_0x5120fd){_0x788c70=_0x788c70-0x0;var _0x361503=_0x63db[_0x788c70];return _0x361503;};'use strict';var _=require('lodash');var util=require(_0xb63d('0x0'));var moment=require(_0xb63d('0x1'));var BPromise=require(_0xb63d('0x2'));var rs=require(_0xb63d('0x3'));var fs=require('fs');var Redis=require(_0xb63d('0x4'));var db=require(_0xb63d('0x5'))['db'];var utils=require(_0xb63d('0x6'));var logger=require(_0xb63d('0x7'))(_0xb63d('0x8'));var config=require(_0xb63d('0x9'));var jayson=require(_0xb63d('0xa'));var client=jayson[_0xb63d('0xb')][_0xb63d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x198bd7,_0x3290a5,_0x195ee0){return new BPromise(function(_0x5cf650,_0x4062ff){return client[_0xb63d('0xd')](_0x198bd7,_0x195ee0)[_0xb63d('0xe')](function(_0x88f21){logger[_0xb63d('0xf')](_0xb63d('0x10'),_0x3290a5,_0xb63d('0x11'));logger[_0xb63d('0x12')](_0xb63d('0x13'),_0x3290a5,_0xb63d('0x11'),JSON[_0xb63d('0x14')](_0x88f21));if(_0x88f21[_0xb63d('0x15')]){if(_0x88f21[_0xb63d('0x15')][_0xb63d('0x16')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x3290a5,_0x88f21[_0xb63d('0x15')][_0xb63d('0x17')]);return _0x4062ff(_0x88f21['error'][_0xb63d('0x17')]);}logger[_0xb63d('0x15')]('UserProfileResource,\x20%s,\x20%s',_0x3290a5,_0x88f21['error'][_0xb63d('0x17')]);return _0x5cf650(_0x88f21[_0xb63d('0x15')][_0xb63d('0x17')]);}else{logger[_0xb63d('0xf')](_0xb63d('0x10'),_0x3290a5,'request\x20sent');_0x5cf650(_0x88f21[_0xb63d('0x18')][_0xb63d('0x17')]);}})[_0xb63d('0x19')](function(_0x5904c8){logger[_0xb63d('0x15')](_0xb63d('0x10'),_0x3290a5,_0x5904c8);_0x4062ff(_0x5904c8);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9c17210..bfe1b84 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 _0xa524=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/:id','show','post','create','update','multer','connect-timeout','express'];(function(_0x31cb18,_0x597fc0){var _0x35d3c4=function(_0x2ef59c){while(--_0x2ef59c){_0x31cb18['push'](_0x31cb18['shift']());}};_0x35d3c4(++_0x597fc0);}(_0xa524,0x129));var _0x4a52=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0xa524[_0x446208];return _0xe49563;};'use strict';var multer=require(_0x4a52('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4a52('0x1'));var express=require(_0x4a52('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4a52('0x3'));var interaction=require(_0x4a52('0x4'));var config=require(_0x4a52('0x5'));var controller=require(_0x4a52('0x6'));router['get']('/',auth[_0x4a52('0x7')](),controller[_0x4a52('0x8')]);router[_0x4a52('0x9')]('/describe',auth[_0x4a52('0x7')](),controller['describe']);router[_0x4a52('0x9')](_0x4a52('0xa'),auth[_0x4a52('0x7')](),controller[_0x4a52('0xb')]);router[_0x4a52('0xc')]('/',auth['isAuthenticated'](),controller[_0x4a52('0xd')]);router['put'](_0x4a52('0xa'),auth['isAuthenticated'](),controller[_0x4a52('0xe')]);router['delete'](_0x4a52('0xa'),auth[_0x4a52('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x767e=['put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x5f4895,_0x27fb35){var _0x19c216=function(_0x122b7d){while(--_0x122b7d){_0x5f4895['push'](_0x5f4895['shift']());}};_0x19c216(++_0x27fb35);}(_0x767e,0xdf));var _0xe767=function(_0x291352,_0x2dc03f){_0x291352=_0x291352-0x0;var _0x503856=_0x767e[_0x291352];return _0x503856;};'use strict';var multer=require(_0xe767('0x0'));var util=require(_0xe767('0x1'));var path=require(_0xe767('0x2'));var timeout=require(_0xe767('0x3'));var express=require(_0xe767('0x4'));var router=express[_0xe767('0x5')]();var fs_extra=require(_0xe767('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe767('0x7'));router[_0xe767('0x8')]('/',auth[_0xe767('0x9')](),controller[_0xe767('0xa')]);router[_0xe767('0x8')](_0xe767('0xb'),auth['isAuthenticated'](),controller[_0xe767('0xc')]);router[_0xe767('0x8')](_0xe767('0xd'),auth[_0xe767('0x9')](),controller[_0xe767('0xe')]);router[_0xe767('0xf')]('/',auth[_0xe767('0x9')](),controller[_0xe767('0x10')]);router[_0xe767('0x11')]('/:id',auth[_0xe767('0x9')](),controller['update']);router['delete'](_0xe767('0xd'),auth[_0xe767('0x9')](),controller[_0xe767('0x12')]);module[_0xe767('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 601d88f..65e6550 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 _0x955f=['split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','join','getDataValue','crudPermissions'];(function(_0x1a1985,_0x4bba31){var _0x56717a=function(_0x5ce67f){while(--_0x5ce67f){_0x1a1985['push'](_0x1a1985['shift']());}};_0x56717a(++_0x4bba31);}(_0x955f,0x1eb));var _0xf955=function(_0x1c28a9,_0x5e5ff5){_0x1c28a9=_0x1c28a9-0x0;var _0x545ff6=_0x955f[_0x1c28a9];return _0x545ff6;};'use strict';var Sequelize=require(_0xf955('0x0'));module[_0xf955('0x1')]={'name':{'type':Sequelize[_0xf955('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xf955('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xf955('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xf955('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x5d0c95){this[_0xf955('0x5')]('crudPermissions',_0x5d0c95?_0x5d0c95[_0xf955('0x6')](''):[]);},'get':function(){return this[_0xf955('0x7')](_0xf955('0x8'))?this['getDataValue'](_0xf955('0x8'))[_0xf955('0x9')](''):[];}}}; \ No newline at end of file +var _0x3c81=['join','getDataValue','sequelize','exports','STRING','INTEGER','setDataValue','crudPermissions'];(function(_0x332389,_0x1e56d7){var _0x4aac40=function(_0x4df42c){while(--_0x4df42c){_0x332389['push'](_0x332389['shift']());}};_0x4aac40(++_0x1e56d7);}(_0x3c81,0x102));var _0x13c8=function(_0x5bef50,_0x548be2){_0x5bef50=_0x5bef50-0x0;var _0x37005d=_0x3c81[_0x5bef50];return _0x37005d;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x13c8('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x13c8('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x548599){this[_0x13c8('0x4')](_0x13c8('0x5'),_0x548599?_0x548599[_0x13c8('0x6')](''):[]);},'get':function(){return this[_0x13c8('0x7')](_0x13c8('0x5'))?this[_0x13c8('0x7')](_0x13c8('0x5'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 18c9f9b..9beef7d 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 _0x97c3=['rawAttributes','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','UserProfileSection'];(function(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0x97c3,0x18d));var _0x397c=function(_0x40be86,_0x68fe5d){_0x40be86=_0x40be86-0x0;var _0xda3c3b=_0x97c3[_0x40be86];return _0xda3c3b;};'use strict';var emlformat=require(_0x397c('0x0'));var rimraf=require(_0x397c('0x1'));var zipdir=require(_0x397c('0x2'));var jsonpatch=require(_0x397c('0x3'));var rp=require(_0x397c('0x4'));var moment=require(_0x397c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x397c('0x6'));var util=require('util');var path=require(_0x397c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x397c('0x8'));var _=require(_0x397c('0x9'));var squel=require(_0x397c('0xa'));var crypto=require(_0x397c('0xb'));var jsforce=require(_0x397c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x397c('0xd'));var Papa=require(_0x397c('0xe'));var Redis=require(_0x397c('0xf'));var authService=require(_0x397c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x397c('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x397c('0x12'));var licenseUtil=require(_0x397c('0x13'));var db=require(_0x397c('0x14'))['db'];function respondWithStatusCode(_0xcf4eb6,_0x5daaaa){_0x5daaaa=_0x5daaaa||0xcc;return function(_0x17493b){if(_0x17493b){return _0xcf4eb6[_0x397c('0x15')](_0x5daaaa);}return _0xcf4eb6[_0x397c('0x16')](_0x5daaaa)[_0x397c('0x17')]();};}function respondWithResult(_0x51c9a6,_0x1a8939){_0x1a8939=_0x1a8939||0xc8;return function(_0x39ccbc){if(_0x39ccbc){return _0x51c9a6['status'](_0x1a8939)[_0x397c('0x18')](_0x39ccbc);}};}function respondWithFilteredResult(_0x17b8c7,_0x36d49c){return function(_0x16b031){if(_0x16b031){var _0x352594=typeof _0x36d49c[_0x397c('0x19')]===_0x397c('0x1a')&&typeof _0x36d49c['limit']==='undefined';var _0x1d4297=_0x16b031[_0x397c('0x1b')];var _0x35241e=_0x352594?0x0:_0x36d49c[_0x397c('0x19')];var _0x4f51c6=_0x352594?_0x16b031[_0x397c('0x1b')]:_0x36d49c['offset']+_0x36d49c[_0x397c('0x1c')];var _0x5d7cc4;if(_0x4f51c6>=_0x1d4297){_0x4f51c6=_0x1d4297;_0x5d7cc4=0xc8;}else{_0x5d7cc4=0xce;}_0x17b8c7['status'](_0x5d7cc4);return _0x17b8c7[_0x397c('0x1d')](_0x397c('0x1e'),_0x35241e+'-'+_0x4f51c6+'/'+_0x1d4297)[_0x397c('0x18')](_0x16b031);}return null;};}function patchUpdates(_0x62eeae){return function(_0x3ecbf3){try{jsonpatch[_0x397c('0x1f')](_0x3ecbf3,_0x62eeae,!![]);}catch(_0x1bd0fa){return BPromise[_0x397c('0x20')](_0x1bd0fa);}return _0x3ecbf3[_0x397c('0x21')]();};}function saveUpdates(_0x4d9725,_0x3fc504){return function(_0x210996){if(_0x210996){return _0x210996['update'](_0x4d9725)[_0x397c('0x22')](function(_0x9b5f37){return _0x9b5f37;});}return null;};}function removeEntity(_0x11ed7a,_0x104001){return function(_0xe06b77){if(_0xe06b77){return _0xe06b77[_0x397c('0x23')]()[_0x397c('0x22')](function(){_0x11ed7a[_0x397c('0x16')](0xcc)[_0x397c('0x17')]();});}};}function handleEntityNotFound(_0x5ad712,_0x1c7ac9){return function(_0x3b4637){if(!_0x3b4637){_0x5ad712[_0x397c('0x15')](0x194);}return _0x3b4637;};}function handleError(_0x4ba49e,_0x16ab79){_0x16ab79=_0x16ab79||0x1f4;return function(_0x54571d){logger[_0x397c('0x24')](_0x54571d['stack']);if(_0x54571d[_0x397c('0x25')]){delete _0x54571d['name'];}_0x4ba49e[_0x397c('0x16')](_0x16ab79)[_0x397c('0x26')](_0x54571d);};}exports[_0x397c('0x27')]=function(_0xb8824f,_0x2e4811){var _0x1aa50f={},_0x4f7838={},_0x28cc0a={'count':0x0,'rows':[]};var _0x3bdbc3=_['map'](db[_0x397c('0x28')][_0x397c('0x29')],function(_0x4dea6a){return{'name':_0x4dea6a['fieldName'],'type':_0x4dea6a[_0x397c('0x2a')][_0x397c('0x2b')]};});_0x4f7838['model']=_[_0x397c('0x2c')](_0x3bdbc3,_0x397c('0x25'));_0x4f7838['query']=_['keys'](_0xb8824f[_0x397c('0x2d')]);_0x4f7838['filters']=_[_0x397c('0x2e')](_0x4f7838[_0x397c('0x2f')],_0x4f7838[_0x397c('0x2d')]);_0x1aa50f['attributes']=_[_0x397c('0x2e')](_0x4f7838[_0x397c('0x2f')],qs['fields'](_0xb8824f[_0x397c('0x2d')][_0x397c('0x30')]));_0x1aa50f[_0x397c('0x31')]=_0x1aa50f[_0x397c('0x31')][_0x397c('0x32')]?_0x1aa50f['attributes']:_0x4f7838[_0x397c('0x2f')];if(!_0xb8824f[_0x397c('0x2d')][_0x397c('0x33')](_0x397c('0x34'))){_0x1aa50f[_0x397c('0x1c')]=qs[_0x397c('0x1c')](_0xb8824f[_0x397c('0x2d')][_0x397c('0x1c')]);_0x1aa50f[_0x397c('0x19')]=qs[_0x397c('0x19')](_0xb8824f[_0x397c('0x2d')][_0x397c('0x19')]);}_0x1aa50f[_0x397c('0x35')]=qs['sort'](_0xb8824f['query'][_0x397c('0x36')]);_0x1aa50f['where']=qs['filters'](_['pick'](_0xb8824f['query'],_0x4f7838[_0x397c('0x37')]),_0x3bdbc3);if(_0xb8824f[_0x397c('0x2d')][_0x397c('0x38')]){_0x1aa50f[_0x397c('0x39')]=_[_0x397c('0x3a')](_0x1aa50f[_0x397c('0x39')],{'$or':_[_0x397c('0x2c')](_0x3bdbc3,function(_0x16515b){if(_0x16515b[_0x397c('0x2a')]!==_0x397c('0x3b')){var _0x336cb0={};_0x336cb0[_0x16515b[_0x397c('0x25')]]={'$like':'%'+_0xb8824f[_0x397c('0x2d')][_0x397c('0x38')]+'%'};return _0x336cb0;}})});}_0x1aa50f=_[_0x397c('0x3a')]({},_0x1aa50f,_0xb8824f['options']);var _0x3a78c0={'where':_0x1aa50f[_0x397c('0x39')]};return db[_0x397c('0x28')][_0x397c('0x1b')](_0x3a78c0)[_0x397c('0x22')](function(_0x271fe9){_0x28cc0a['count']=_0x271fe9;if(_0xb8824f[_0x397c('0x2d')]['includeAll']){_0x1aa50f[_0x397c('0x3c')]=[{'all':!![]}];}return db[_0x397c('0x28')][_0x397c('0x3d')](_0x1aa50f);})[_0x397c('0x22')](function(_0x51ca25){_0x28cc0a[_0x397c('0x3e')]=_0x51ca25;return _0x28cc0a;})[_0x397c('0x22')](respondWithFilteredResult(_0x2e4811,_0x1aa50f))[_0x397c('0x3f')](handleError(_0x2e4811,null));};exports[_0x397c('0x40')]=function(_0x22fc9d,_0x3d98d6){var _0xe40df6={'raw':![],'where':{'id':_0x22fc9d[_0x397c('0x41')]['id']}},_0x4827f3={};_0x4827f3[_0x397c('0x2f')]=_['keys'](db[_0x397c('0x28')][_0x397c('0x29')]);_0x4827f3[_0x397c('0x2d')]=_['keys'](_0x22fc9d[_0x397c('0x2d')]);_0x4827f3['filters']=_['intersection'](_0x4827f3['model'],_0x4827f3[_0x397c('0x2d')]);_0xe40df6[_0x397c('0x31')]=_['intersection'](_0x4827f3['model'],qs[_0x397c('0x30')](_0x22fc9d['query'][_0x397c('0x30')]));_0xe40df6['attributes']=_0xe40df6[_0x397c('0x31')]['length']?_0xe40df6['attributes']:_0x4827f3[_0x397c('0x2f')];if(_0x22fc9d[_0x397c('0x2d')][_0x397c('0x42')]){_0xe40df6[_0x397c('0x3c')]=[{'all':!![]}];}_0xe40df6=_[_0x397c('0x3a')]({},_0xe40df6,_0x22fc9d[_0x397c('0x43')]);return db['UserProfileSection']['find'](_0xe40df6)[_0x397c('0x22')](handleEntityNotFound(_0x3d98d6,null))['then'](respondWithResult(_0x3d98d6,null))[_0x397c('0x3f')](handleError(_0x3d98d6,null));};exports[_0x397c('0x44')]=function(_0x147a07,_0x3538a9){return db[_0x397c('0x28')][_0x397c('0x44')](_0x147a07[_0x397c('0x45')],{})[_0x397c('0x22')](respondWithResult(_0x3538a9,0xc9))[_0x397c('0x3f')](handleError(_0x3538a9,null));};exports[_0x397c('0x46')]=function(_0x8fa99c,_0x4005d1){if(_0x8fa99c[_0x397c('0x45')]['id']){delete _0x8fa99c[_0x397c('0x45')]['id'];}return db[_0x397c('0x28')]['find']({'where':{'id':_0x8fa99c['params']['id']}})[_0x397c('0x22')](handleEntityNotFound(_0x4005d1,null))[_0x397c('0x22')](saveUpdates(_0x8fa99c[_0x397c('0x45')],null))[_0x397c('0x22')](respondWithResult(_0x4005d1,null))['catch'](handleError(_0x4005d1,null));};exports[_0x397c('0x23')]=function(_0x4c21eb,_0x5c3306){return db[_0x397c('0x28')][_0x397c('0x47')]({'where':{'id':_0x4c21eb[_0x397c('0x41')]['id']}})[_0x397c('0x22')](handleEntityNotFound(_0x5c3306,null))[_0x397c('0x22')](removeEntity(_0x5c3306,null))[_0x397c('0x3f')](handleError(_0x5c3306,null));};exports[_0x397c('0x48')]=function(_0x44a4e2,_0xa315b5){return db[_0x397c('0x28')][_0x397c('0x48')]()[_0x397c('0x22')](respondWithResult(_0xa315b5,null))['catch'](handleError(_0xa315b5,null));}; \ No newline at end of file +var _0xe10c=['count','Content-Range','apply','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','UserProfileSection','includeAll','include','show','catch','create','body','find','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x55a692,_0xf0703d){var _0x18a653=function(_0x25bfd7){while(--_0x25bfd7){_0x55a692['push'](_0x55a692['shift']());}};_0x18a653(++_0xf0703d);}(_0xe10c,0x72));var _0xce10=function(_0x119d2d,_0x41a734){_0x119d2d=_0x119d2d-0x0;var _0x494ced=_0xe10c[_0x119d2d];return _0x494ced;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xce10('0x0'));var jsonpatch=require(_0xce10('0x1'));var rp=require(_0xce10('0x2'));var moment=require(_0xce10('0x3'));var BPromise=require(_0xce10('0x4'));var Mustache=require(_0xce10('0x5'));var util=require(_0xce10('0x6'));var path=require(_0xce10('0x7'));var sox=require(_0xce10('0x8'));var csv=require('to-csv');var ejs=require(_0xce10('0x9'));var fs=require('fs');var fs_extra=require(_0xce10('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xce10('0xb'));var jsforce=require(_0xce10('0xc'));var deskjs=require(_0xce10('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xce10('0xe'));var authService=require(_0xce10('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xce10('0x10'));var hardwareService=require(_0xce10('0x11'));var logger=require(_0xce10('0x12'))(_0xce10('0x13'));var utils=require(_0xce10('0x14'));var config=require(_0xce10('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xce10('0x16'))['db'];function respondWithStatusCode(_0x1aafd0,_0x303fea){_0x303fea=_0x303fea||0xcc;return function(_0x16da24){if(_0x16da24){return _0x1aafd0[_0xce10('0x17')](_0x303fea);}return _0x1aafd0[_0xce10('0x18')](_0x303fea)[_0xce10('0x19')]();};}function respondWithResult(_0x4176ea,_0x51b1fc){_0x51b1fc=_0x51b1fc||0xc8;return function(_0x3531ff){if(_0x3531ff){return _0x4176ea[_0xce10('0x18')](_0x51b1fc)[_0xce10('0x1a')](_0x3531ff);}};}function respondWithFilteredResult(_0xfc36aa,_0x47a4b1){return function(_0x36c155){if(_0x36c155){var _0x1cd8c5=typeof _0x47a4b1[_0xce10('0x1b')]==='undefined'&&typeof _0x47a4b1[_0xce10('0x1c')]===_0xce10('0x1d');var _0x39a2ab=_0x36c155['count'];var _0x50cff8=_0x1cd8c5?0x0:_0x47a4b1[_0xce10('0x1b')];var _0x2815a9=_0x1cd8c5?_0x36c155[_0xce10('0x1e')]:_0x47a4b1['offset']+_0x47a4b1['limit'];var _0x3635b3;if(_0x2815a9>=_0x39a2ab){_0x2815a9=_0x39a2ab;_0x3635b3=0xc8;}else{_0x3635b3=0xce;}_0xfc36aa[_0xce10('0x18')](_0x3635b3);return _0xfc36aa['set'](_0xce10('0x1f'),_0x50cff8+'-'+_0x2815a9+'/'+_0x39a2ab)['json'](_0x36c155);}return null;};}function patchUpdates(_0x52301c){return function(_0x4f68f7){try{jsonpatch[_0xce10('0x20')](_0x4f68f7,_0x52301c,!![]);}catch(_0x410c99){return BPromise['reject'](_0x410c99);}return _0x4f68f7[_0xce10('0x21')]();};}function saveUpdates(_0x26e394,_0x42ff2d){return function(_0x22db01){if(_0x22db01){return _0x22db01[_0xce10('0x22')](_0x26e394)[_0xce10('0x23')](function(_0x2376b2){return _0x2376b2;});}return null;};}function removeEntity(_0x131150,_0x260211){return function(_0x5d8918){if(_0x5d8918){return _0x5d8918[_0xce10('0x24')]()[_0xce10('0x23')](function(){_0x131150['status'](0xcc)[_0xce10('0x19')]();});}};}function handleEntityNotFound(_0x147839,_0x381794){return function(_0x374606){if(!_0x374606){_0x147839[_0xce10('0x17')](0x194);}return _0x374606;};}function handleError(_0x137a99,_0x4a89e8){_0x4a89e8=_0x4a89e8||0x1f4;return function(_0x1daa0b){logger['error'](_0x1daa0b['stack']);if(_0x1daa0b[_0xce10('0x25')]){delete _0x1daa0b[_0xce10('0x25')];}_0x137a99['status'](_0x4a89e8)[_0xce10('0x26')](_0x1daa0b);};}exports[_0xce10('0x27')]=function(_0x40eee6,_0x222f49){var _0x728c59={},_0x4a0098={},_0x4a9ffa={'count':0x0,'rows':[]};var _0x2ae93c=_[_0xce10('0x28')](db['UserProfileSection'][_0xce10('0x29')],function(_0x3d7446){return{'name':_0x3d7446[_0xce10('0x2a')],'type':_0x3d7446[_0xce10('0x2b')]['key']};});_0x4a0098[_0xce10('0x2c')]=_[_0xce10('0x28')](_0x2ae93c,_0xce10('0x25'));_0x4a0098['query']=_[_0xce10('0x2d')](_0x40eee6[_0xce10('0x2e')]);_0x4a0098[_0xce10('0x2f')]=_['intersection'](_0x4a0098[_0xce10('0x2c')],_0x4a0098[_0xce10('0x2e')]);_0x728c59['attributes']=_[_0xce10('0x30')](_0x4a0098['model'],qs[_0xce10('0x31')](_0x40eee6[_0xce10('0x2e')]['fields']));_0x728c59[_0xce10('0x32')]=_0x728c59[_0xce10('0x32')][_0xce10('0x33')]?_0x728c59[_0xce10('0x32')]:_0x4a0098[_0xce10('0x2c')];if(!_0x40eee6[_0xce10('0x2e')][_0xce10('0x34')](_0xce10('0x35'))){_0x728c59['limit']=qs[_0xce10('0x1c')](_0x40eee6[_0xce10('0x2e')][_0xce10('0x1c')]);_0x728c59[_0xce10('0x1b')]=qs[_0xce10('0x1b')](_0x40eee6['query'][_0xce10('0x1b')]);}_0x728c59[_0xce10('0x36')]=qs[_0xce10('0x37')](_0x40eee6[_0xce10('0x2e')][_0xce10('0x37')]);_0x728c59['where']=qs[_0xce10('0x2f')](_[_0xce10('0x38')](_0x40eee6[_0xce10('0x2e')],_0x4a0098['filters']),_0x2ae93c);if(_0x40eee6[_0xce10('0x2e')][_0xce10('0x39')]){_0x728c59[_0xce10('0x3a')]=_[_0xce10('0x3b')](_0x728c59[_0xce10('0x3a')],{'$or':_[_0xce10('0x28')](_0x2ae93c,function(_0x533a30){if(_0x533a30['type']!==_0xce10('0x3c')){var _0x497662={};_0x497662[_0x533a30[_0xce10('0x25')]]={'$like':'%'+_0x40eee6['query'][_0xce10('0x39')]+'%'};return _0x497662;}})});}_0x728c59=_[_0xce10('0x3b')]({},_0x728c59,_0x40eee6[_0xce10('0x3d')]);var _0x576cc0={'where':_0x728c59[_0xce10('0x3a')]};return db[_0xce10('0x3e')][_0xce10('0x1e')](_0x576cc0)[_0xce10('0x23')](function(_0x4daf8c){_0x4a9ffa[_0xce10('0x1e')]=_0x4daf8c;if(_0x40eee6[_0xce10('0x2e')][_0xce10('0x3f')]){_0x728c59[_0xce10('0x40')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x728c59);})[_0xce10('0x23')](function(_0x446443){_0x4a9ffa['rows']=_0x446443;return _0x4a9ffa;})[_0xce10('0x23')](respondWithFilteredResult(_0x222f49,_0x728c59))['catch'](handleError(_0x222f49,null));};exports[_0xce10('0x41')]=function(_0x2fe1fa,_0x521c8b){var _0x57d140={'raw':![],'where':{'id':_0x2fe1fa['params']['id']}},_0x3a7fe5={};_0x3a7fe5[_0xce10('0x2c')]=_[_0xce10('0x2d')](db[_0xce10('0x3e')][_0xce10('0x29')]);_0x3a7fe5['query']=_[_0xce10('0x2d')](_0x2fe1fa[_0xce10('0x2e')]);_0x3a7fe5['filters']=_[_0xce10('0x30')](_0x3a7fe5[_0xce10('0x2c')],_0x3a7fe5[_0xce10('0x2e')]);_0x57d140[_0xce10('0x32')]=_[_0xce10('0x30')](_0x3a7fe5['model'],qs[_0xce10('0x31')](_0x2fe1fa['query'][_0xce10('0x31')]));_0x57d140['attributes']=_0x57d140[_0xce10('0x32')][_0xce10('0x33')]?_0x57d140['attributes']:_0x3a7fe5[_0xce10('0x2c')];if(_0x2fe1fa[_0xce10('0x2e')][_0xce10('0x3f')]){_0x57d140[_0xce10('0x40')]=[{'all':!![]}];}_0x57d140=_[_0xce10('0x3b')]({},_0x57d140,_0x2fe1fa[_0xce10('0x3d')]);return db[_0xce10('0x3e')]['find'](_0x57d140)['then'](handleEntityNotFound(_0x521c8b,null))[_0xce10('0x23')](respondWithResult(_0x521c8b,null))[_0xce10('0x42')](handleError(_0x521c8b,null));};exports[_0xce10('0x43')]=function(_0x2a81a0,_0x434bd8){return db[_0xce10('0x3e')][_0xce10('0x43')](_0x2a81a0[_0xce10('0x44')],{})['then'](respondWithResult(_0x434bd8,0xc9))[_0xce10('0x42')](handleError(_0x434bd8,null));};exports[_0xce10('0x22')]=function(_0x2aff36,_0x2e04c8){if(_0x2aff36[_0xce10('0x44')]['id']){delete _0x2aff36['body']['id'];}return db['UserProfileSection'][_0xce10('0x45')]({'where':{'id':_0x2aff36[_0xce10('0x46')]['id']}})[_0xce10('0x23')](handleEntityNotFound(_0x2e04c8,null))[_0xce10('0x23')](saveUpdates(_0x2aff36['body'],null))[_0xce10('0x23')](respondWithResult(_0x2e04c8,null))[_0xce10('0x42')](handleError(_0x2e04c8,null));};exports[_0xce10('0x24')]=function(_0xf21d13,_0x412c66){return db[_0xce10('0x3e')][_0xce10('0x45')]({'where':{'id':_0xf21d13[_0xce10('0x46')]['id']}})[_0xce10('0x23')](handleEntityNotFound(_0x412c66,null))['then'](removeEntity(_0x412c66,null))[_0xce10('0x42')](handleError(_0x412c66,null));};exports[_0xce10('0x47')]=function(_0x2895c4,_0x35091a){return db[_0xce10('0x3e')][_0xce10('0x47')]()[_0xce10('0x23')](respondWithResult(_0x35091a,null))[_0xce10('0x42')](handleError(_0x35091a,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index c014871..562ba14 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 _0x4ea9=['compositeIndex','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections'];(function(_0x8695c0,_0x4179f6){var _0x50cce4=function(_0x45bba7){while(--_0x45bba7){_0x8695c0['push'](_0x8695c0['shift']());}};_0x50cce4(++_0x4179f6);}(_0x4ea9,0xa2));var _0x94ea=function(_0xb95fb,_0x31183d){_0xb95fb=_0xb95fb-0x0;var _0x2b32c6=_0x4ea9[_0xb95fb];return _0x2b32c6;};'use strict';var _=require(_0x94ea('0x0'));var util=require(_0x94ea('0x1'));var logger=require(_0x94ea('0x2'))(_0x94ea('0x3'));var moment=require(_0x94ea('0x4'));var BPromise=require(_0x94ea('0x5'));var rp=require(_0x94ea('0x6'));var fs=require('fs');var path=require(_0x94ea('0x7'));var rimraf=require(_0x94ea('0x8'));var config=require(_0x94ea('0x9'));var attributes=require(_0x94ea('0xa'));module[_0x94ea('0xb')]=function(_0x1f0238,_0x3a569e){return _0x1f0238['define'](_0x94ea('0xc'),attributes,{'tableName':_0x94ea('0xd'),'paranoid':![],'indexes':[{'name':_0x94ea('0xe'),'fields':[_0x94ea('0xf'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe12c=['path','rimraf','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','sectionId','lodash','util','api','moment','bluebird'];(function(_0x1bdcc3,_0x357cfa){var _0x9287b1=function(_0x5a6418){while(--_0x5a6418){_0x1bdcc3['push'](_0x1bdcc3['shift']());}};_0x9287b1(++_0x357cfa);}(_0xe12c,0xd8));var _0xce12=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xe12c[_0xa8883];return _0x479426;};'use strict';var _=require(_0xce12('0x0'));var util=require(_0xce12('0x1'));var logger=require('../../config/logger')(_0xce12('0x2'));var moment=require(_0xce12('0x3'));var BPromise=require(_0xce12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce12('0x5'));var rimraf=require(_0xce12('0x6'));var config=require('../../config/environment');var attributes=require(_0xce12('0x7'));module[_0xce12('0x8')]=function(_0x5427a4,_0x4833a0){return _0x5427a4[_0xce12('0x9')]('UserProfileSection',attributes,{'tableName':_0xce12('0xa'),'paranoid':![],'indexes':[{'name':_0xce12('0xb'),'fields':[_0xce12('0xc'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 3d5cf8a..a37645d 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 _0x3b61=['jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5d3f91,_0x5631f9){var _0x741224=function(_0x2d8343){while(--_0x2d8343){_0x5d3f91['push'](_0x5d3f91['shift']());}};_0x741224(++_0x5631f9);}(_0x3b61,0x1c5));var _0x13b6=function(_0x4013ce,_0x22df92){_0x4013ce=_0x4013ce-0x0;var _0x35740e=_0x3b61[_0x4013ce];return _0x35740e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x13b6('0x0'));var BPromise=require(_0x13b6('0x1'));var rs=require(_0x13b6('0x2'));var fs=require('fs');var Redis=require(_0x13b6('0x3'));var db=require(_0x13b6('0x4'))['db'];var utils=require(_0x13b6('0x5'));var logger=require('../../config/logger')(_0x13b6('0x6'));var config=require('../../config/environment');var jayson=require(_0x13b6('0x7'));var client=jayson['client'][_0x13b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x321e83,_0xec2a5,_0x415264){return new BPromise(function(_0x2bf66e,_0x5a8e07){return client[_0x13b6('0x9')](_0x321e83,_0x415264)[_0x13b6('0xa')](function(_0x5ab522){logger[_0x13b6('0xb')](_0x13b6('0xc'),_0xec2a5,_0x13b6('0xd'));logger['debug'](_0x13b6('0xe'),_0xec2a5,'request\x20sent',JSON['stringify'](_0x5ab522));if(_0x5ab522['error']){if(_0x5ab522['error'][_0x13b6('0xf')]===0x1f4){logger[_0x13b6('0x10')](_0x13b6('0xc'),_0xec2a5,_0x5ab522['error']['message']);return _0x5a8e07(_0x5ab522[_0x13b6('0x10')][_0x13b6('0x11')]);}logger[_0x13b6('0x10')](_0x13b6('0xc'),_0xec2a5,_0x5ab522[_0x13b6('0x10')]['message']);return _0x2bf66e(_0x5ab522['error'][_0x13b6('0x11')]);}else{logger['info'](_0x13b6('0xc'),_0xec2a5,'request\x20sent');_0x2bf66e(_0x5ab522[_0x13b6('0x12')]['message']);}})[_0x13b6('0x13')](function(_0x2b6bbd){logger[_0x13b6('0x10')]('UserProfileSection,\x20%s,\x20%s',_0xec2a5,_0x2b6bbd);_0x5a8e07(_0x2b6bbd);});});} \ No newline at end of file +var _0x444e=['client','http','request','then','request\x20sent','debug','error','UserProfileSection,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x50bca7,_0x35485d){var _0x3fa9b0=function(_0x431053){while(--_0x431053){_0x50bca7['push'](_0x50bca7['shift']());}};_0x3fa9b0(++_0x35485d);}(_0x444e,0xe8));var _0xe444=function(_0x4fc84f,_0x25dd59){_0x4fc84f=_0x4fc84f-0x0;var _0xec4518=_0x444e[_0x4fc84f];return _0xec4518;};'use strict';var _=require(_0xe444('0x0'));var util=require('util');var moment=require(_0xe444('0x1'));var BPromise=require('bluebird');var rs=require(_0xe444('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe444('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe444('0x4'))(_0xe444('0x5'));var config=require(_0xe444('0x6'));var jayson=require(_0xe444('0x7'));var client=jayson[_0xe444('0x8')][_0xe444('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4834c7,_0xfbd88b,_0x4b5b7d){return new BPromise(function(_0x29a2b7,_0x482b98){return client[_0xe444('0xa')](_0x4834c7,_0x4b5b7d)[_0xe444('0xb')](function(_0x40a368){logger['info']('UserProfileSection,\x20%s,\x20%s',_0xfbd88b,_0xe444('0xc'));logger[_0xe444('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0xfbd88b,_0xe444('0xc'),JSON['stringify'](_0x40a368));if(_0x40a368['error']){if(_0x40a368[_0xe444('0xe')]['code']===0x1f4){logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x40a368['error'][_0xe444('0x10')]);return _0x482b98(_0x40a368['error']['message']);}logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x40a368['error'][_0xe444('0x10')]);return _0x29a2b7(_0x40a368['error'][_0xe444('0x10')]);}else{logger[_0xe444('0x11')](_0xe444('0xf'),_0xfbd88b,_0xe444('0xc'));_0x29a2b7(_0x40a368[_0xe444('0x12')][_0xe444('0x10')]);}})[_0xe444('0x13')](function(_0x3e1b57){logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x3e1b57);_0x482b98(_0x3e1b57);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 746b7dc..cd98699 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x264c84,_0x598700){var _0x1fd84c=function(_0x271c3d){while(--_0x271c3d){_0x264c84['push'](_0x264c84['shift']());}};_0x1fd84c(++_0x598700);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1cbee1,_0x1b1590){var _0x5424af=function(_0x531e22){while(--_0x531e22){_0x1cbee1['push'](_0x1cbee1['shift']());}};_0x5424af(++_0x1b1590);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0xcb91[_0x13594e];return _0x1a4f42;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 11a03d3..9962deb 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 _0xa780=['INTEGER','sequelize'];(function(_0x3faa2e,_0x553a82){var _0x2cbf65=function(_0x4cf17b){while(--_0x4cf17b){_0x3faa2e['push'](_0x3faa2e['shift']());}};_0x2cbf65(++_0x553a82);}(_0xa780,0x139));var _0x0a78=function(_0x37dd48,_0x1dca03){_0x37dd48=_0x37dd48-0x0;var _0xc5aefb=_0xa780[_0x37dd48];return _0xc5aefb;};'use strict';var Sequelize=require(_0x0a78('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0a78('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x61c8=['INTEGER','sequelize','exports'];(function(_0x1b51ea,_0x394fd9){var _0x18bbdc=function(_0x45b83f){while(--_0x45b83f){_0x1b51ea['push'](_0x1b51ea['shift']());}};_0x18bbdc(++_0x394fd9);}(_0x61c8,0x199));var _0x861c=function(_0x3eff21,_0x5bf36c){_0x3eff21=_0x3eff21-0x0;var _0x1945bb=_0x61c8[_0x3eff21];return _0x1945bb;};'use strict';var Sequelize=require(_0x861c('0x0'));module[_0x861c('0x1')]={'penalty':{'type':Sequelize[_0x861c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 7bf9f11..1f7145d 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 _0x71ab=['exports','define','UserSmsQueue','user_has_sms_queues','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes'];(function(_0x1a8622,_0x43fe11){var _0x4d9ad6=function(_0x4e18eb){while(--_0x4e18eb){_0x1a8622['push'](_0x1a8622['shift']());}};_0x4d9ad6(++_0x43fe11);}(_0x71ab,0x64));var _0xb71a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x71ab[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bd9=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x3a24b8,_0x1b7651){_0x3a24b8=_0x3a24b8-0x0;var _0x502dd8=_0x9bd9[_0x3a24b8];return _0x502dd8;};'use strict';var _=require(_0x99bd('0x0'));var util=require(_0x99bd('0x1'));var logger=require(_0x99bd('0x2'))(_0x99bd('0x3'));var moment=require(_0x99bd('0x4'));var BPromise=require(_0x99bd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99bd('0x6'));var rimraf=require('rimraf');var config=require(_0x99bd('0x7'));var attributes=require(_0x99bd('0x8'));module['exports']=function(_0xa1cd99,_0x45b939){return _0xa1cd99[_0x99bd('0x9')](_0x99bd('0xa'),attributes,{'tableName':_0x99bd('0xb'),'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 0667878..3deb114 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 _0x5481=['error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1b5b29,_0xfd5dd8){var _0x2b125e=function(_0x336ec2){while(--_0x336ec2){_0x1b5b29['push'](_0x1b5b29['shift']());}};_0x2b125e(++_0xfd5dd8);}(_0x5481,0xc0));var _0x1548=function(_0x34b095,_0x39410f){_0x34b095=_0x34b095-0x0;var _0x47877a=_0x5481[_0x34b095];return _0x47877a;};'use strict';var _=require(_0x1548('0x0'));var util=require(_0x1548('0x1'));var moment=require('moment');var BPromise=require(_0x1548('0x2'));var rs=require(_0x1548('0x3'));var fs=require('fs');var Redis=require(_0x1548('0x4'));var db=require(_0x1548('0x5'))['db'];var utils=require(_0x1548('0x6'));var logger=require(_0x1548('0x7'))(_0x1548('0x8'));var config=require('../../config/environment');var jayson=require(_0x1548('0x9'));var client=jayson['client'][_0x1548('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a718,_0x122283,_0xa85cf6){return new BPromise(function(_0xed7ef5,_0x489b06){return client[_0x1548('0xb')](_0x35a718,_0xa85cf6)['then'](function(_0x69bc28){logger[_0x1548('0xc')](_0x1548('0xd'),_0x122283,'request\x20sent');logger[_0x1548('0xe')](_0x1548('0xf'),_0x122283,_0x1548('0x10'),JSON[_0x1548('0x11')](_0x69bc28));if(_0x69bc28[_0x1548('0x12')]){if(_0x69bc28['error']['code']===0x1f4){logger[_0x1548('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x122283,_0x69bc28['error']['message']);return _0x489b06(_0x69bc28[_0x1548('0x12')][_0x1548('0x13')]);}logger['error'](_0x1548('0xd'),_0x122283,_0x69bc28[_0x1548('0x12')][_0x1548('0x13')]);return _0xed7ef5(_0x69bc28['error'][_0x1548('0x13')]);}else{logger[_0x1548('0xc')](_0x1548('0xd'),_0x122283,'request\x20sent');_0xed7ef5(_0x69bc28[_0x1548('0x14')][_0x1548('0x13')]);}})['catch'](function(_0x115750){logger['error'](_0x1548('0xd'),_0x122283,_0x115750);_0x489b06(_0x115750);});});} \ No newline at end of file +var _0xb768=['info','UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x5a4839,_0x3a36f3){var _0x2fed0f=function(_0x160d5d){while(--_0x160d5d){_0x5a4839['push'](_0x5a4839['shift']());}};_0x2fed0f(++_0x3a36f3);}(_0xb768,0x6c));var _0x8b76=function(_0x429780,_0x15c4e5){_0x429780=_0x429780-0x0;var _0x4d19fb=_0xb768[_0x429780];return _0x4d19fb;};'use strict';var _=require(_0x8b76('0x0'));var util=require(_0x8b76('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8b76('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b76('0x3'))['db'];var utils=require(_0x8b76('0x4'));var logger=require(_0x8b76('0x5'))(_0x8b76('0x6'));var config=require(_0x8b76('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8b76('0x8')][_0x8b76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x353ed9,_0x58de02,_0x4ee0a6){return new BPromise(function(_0x39fc65,_0x5d22d1){return client[_0x8b76('0xa')](_0x353ed9,_0x4ee0a6)[_0x8b76('0xb')](function(_0x439130){logger[_0x8b76('0xc')](_0x8b76('0xd'),_0x58de02,'request\x20sent');logger['debug'](_0x8b76('0xe'),_0x58de02,_0x8b76('0xf'),JSON['stringify'](_0x439130));if(_0x439130[_0x8b76('0x10')]){if(_0x439130[_0x8b76('0x10')][_0x8b76('0x11')]===0x1f4){logger[_0x8b76('0x10')](_0x8b76('0xd'),_0x58de02,_0x439130[_0x8b76('0x10')][_0x8b76('0x12')]);return _0x5d22d1(_0x439130[_0x8b76('0x10')]['message']);}logger['error'](_0x8b76('0xd'),_0x58de02,_0x439130[_0x8b76('0x10')]['message']);return _0x39fc65(_0x439130['error'][_0x8b76('0x12')]);}else{logger[_0x8b76('0xc')](_0x8b76('0xd'),_0x58de02,_0x8b76('0xf'));_0x39fc65(_0x439130['result'][_0x8b76('0x12')]);}})[_0x8b76('0x13')](function(_0x255e1b){logger[_0x8b76('0x10')](_0x8b76('0xd'),_0x58de02,_0x255e1b);_0x5d22d1(_0x255e1b);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index b9bd7e1..cdeeb01 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 _0xa206=['INTEGER','sequelize','exports'];(function(_0x15d640,_0x1e438c){var _0x4cc3a9=function(_0x2e7d01){while(--_0x2e7d01){_0x15d640['push'](_0x15d640['shift']());}};_0x4cc3a9(++_0x1e438c);}(_0xa206,0x70));var _0x6a20=function(_0x51076e,_0x1dcfbe){_0x51076e=_0x51076e-0x0;var _0x3215a9=_0xa206[_0x51076e];return _0x3215a9;};'use strict';var Sequelize=require(_0x6a20('0x0'));module[_0x6a20('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x6a20('0x2')]}}; \ No newline at end of file +var _0x6094=['INTEGER'];(function(_0x2d95d0,_0x58f7f2){var _0x12c666=function(_0x155f48){while(--_0x155f48){_0x2d95d0['push'](_0x2d95d0['shift']());}};_0x12c666(++_0x58f7f2);}(_0x6094,0x144));var _0x4609=function(_0x933022,_0x4d8339){_0x933022=_0x933022-0x0;var _0x32e4d4=_0x6094[_0x933022];return _0x32e4d4;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x4609('0x0')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index f4b5925..81d6510 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(_0x4c75b5,_0x328e2c){var _0x4ae071=function(_0x4fe2f2){while(--_0x4fe2f2){_0x4c75b5['push'](_0x4c75b5['shift']());}};_0x4ae071(++_0x328e2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x49a287,_0x392135){var _0x43f481=function(_0x4af450){while(--_0x4af450){_0x49a287['push'](_0x49a287['shift']());}};_0x43f481(++_0x392135);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 46c9eb2..89f624c 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(_0x1bc7cd,_0x4422f1){var _0x1290f0=function(_0x325864){while(--_0x325864){_0x1bc7cd['push'](_0x1bc7cd['shift']());}};_0x1290f0(++_0x4422f1);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3a9815,_0x47eb16){var _0x188653=function(_0x203e84){while(--_0x203e84){_0x3a9815['push'](_0x3a9815['shift']());}};_0x188653(++_0x47eb16);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index e292b9d..8442877 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 _0x9ee6=['exports'];(function(_0x20c893,_0xbef2b4){var _0xc705e8=function(_0x449739){while(--_0x449739){_0x20c893['push'](_0x20c893['shift']());}};_0xc705e8(++_0xbef2b4);}(_0x9ee6,0x94));var _0x69ee=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0x9ee6[_0x57486e];return _0x5f110b;};'use strict';var Sequelize=require('sequelize');module[_0x69ee('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbf4b=['exports','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbf4b,0x99));var _0xbbf4=function(_0x1ca907,_0x318ca2){_0x1ca907=_0x1ca907-0x0;var _0x4eb2c1=_0xbf4b[_0x1ca907];return _0x4eb2c1;};'use strict';var Sequelize=require(_0xbbf4('0x0'));module[_0xbbf4('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index b58541f..93417b4 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 _0xf95a=['UserVoiceQueue','user_has_voice_queues','lodash','util','api','bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes','exports','define'];(function(_0x27f11f,_0x2256c8){var _0x3baf31=function(_0x7226e){while(--_0x7226e){_0x27f11f['push'](_0x27f11f['shift']());}};_0x3baf31(++_0x2256c8);}(_0xf95a,0xda));var _0xaf95=function(_0x464465,_0x237013){_0x464465=_0x464465-0x0;var _0x54d1a6=_0xf95a[_0x464465];return _0x54d1a6;};'use strict';var _=require(_0xaf95('0x0'));var util=require(_0xaf95('0x1'));var logger=require('../../config/logger')(_0xaf95('0x2'));var moment=require('moment');var BPromise=require(_0xaf95('0x3'));var rp=require(_0xaf95('0x4'));var fs=require('fs');var path=require(_0xaf95('0x5'));var rimraf=require('rimraf');var config=require(_0xaf95('0x6'));var attributes=require(_0xaf95('0x7'));module[_0xaf95('0x8')]=function(_0x4b0924,_0x32f85e){return _0x4b0924[_0xaf95('0x9')](_0xaf95('0xa'),attributes,{'tableName':_0xaf95('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22f7=['bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash','../../config/logger','api','moment'];(function(_0x561f66,_0x55e196){var _0x65271e=function(_0x4f335a){while(--_0x4f335a){_0x561f66['push'](_0x561f66['shift']());}};_0x65271e(++_0x55e196);}(_0x22f7,0x8c));var _0x722f=function(_0x2b69a2,_0x4d7126){_0x2b69a2=_0x2b69a2-0x0;var _0x1209bd=_0x22f7[_0x2b69a2];return _0x1209bd;};'use strict';var _=require(_0x722f('0x0'));var util=require('util');var logger=require(_0x722f('0x1'))(_0x722f('0x2'));var moment=require(_0x722f('0x3'));var BPromise=require(_0x722f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x722f('0x5'));var rimraf=require(_0x722f('0x6'));var config=require(_0x722f('0x7'));var attributes=require(_0x722f('0x8'));module[_0x722f('0x9')]=function(_0x438f17,_0x402f75){return _0x438f17[_0x722f('0xa')]('UserVoiceQueue',attributes,{'tableName':_0x722f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 26550db..e5348fa 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 _0xcc1b=['client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x33e4a7,_0x2e80a2){var _0x598620=function(_0x65d618){while(--_0x65d618){_0x33e4a7['push'](_0x33e4a7['shift']());}};_0x598620(++_0x2e80a2);}(_0xcc1b,0x1d6));var _0xbcc1=function(_0x43161f,_0x440f58){_0x43161f=_0x43161f-0x0;var _0x149a82=_0xcc1b[_0x43161f];return _0x149a82;};'use strict';var _=require(_0xbcc1('0x0'));var util=require(_0xbcc1('0x1'));var moment=require('moment');var BPromise=require(_0xbcc1('0x2'));var rs=require(_0xbcc1('0x3'));var fs=require('fs');var Redis=require(_0xbcc1('0x4'));var db=require(_0xbcc1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbcc1('0x6'))(_0xbcc1('0x7'));var config=require(_0xbcc1('0x8'));var jayson=require(_0xbcc1('0x9'));var client=jayson[_0xbcc1('0xa')][_0xbcc1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43c947,_0x3f96bb,_0x115253){return new BPromise(function(_0x29a188,_0x379d61){return client[_0xbcc1('0xc')](_0x43c947,_0x115253)[_0xbcc1('0xd')](function(_0x57669e){logger['info'](_0xbcc1('0xe'),_0x3f96bb,_0xbcc1('0xf'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3f96bb,_0xbcc1('0xf'),JSON[_0xbcc1('0x10')](_0x57669e));if(_0x57669e[_0xbcc1('0x11')]){if(_0x57669e[_0xbcc1('0x11')]['code']===0x1f4){logger[_0xbcc1('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x3f96bb,_0x57669e[_0xbcc1('0x11')][_0xbcc1('0x12')]);return _0x379d61(_0x57669e[_0xbcc1('0x11')]['message']);}logger[_0xbcc1('0x11')](_0xbcc1('0xe'),_0x3f96bb,_0x57669e[_0xbcc1('0x11')]['message']);return _0x29a188(_0x57669e[_0xbcc1('0x11')][_0xbcc1('0x12')]);}else{logger['info'](_0xbcc1('0xe'),_0x3f96bb,_0xbcc1('0xf'));_0x29a188(_0x57669e[_0xbcc1('0x13')][_0xbcc1('0x12')]);}})['catch'](function(_0x97f47d){logger['error'](_0xbcc1('0xe'),_0x3f96bb,_0x97f47d);_0x379d61(_0x97f47d);});});} \ No newline at end of file +var _0xab90=['client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5efa48,_0x4a9279){var _0x5a4442=function(_0x4ed9aa){while(--_0x4ed9aa){_0x5efa48['push'](_0x5efa48['shift']());}};_0x5a4442(++_0x4a9279);}(_0xab90,0x1f1));var _0x0ab9=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xab90[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var util=require(_0x0ab9('0x0'));var moment=require(_0x0ab9('0x1'));var BPromise=require(_0x0ab9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0ab9('0x3'))(_0x0ab9('0x4'));var config=require(_0x0ab9('0x5'));var jayson=require(_0x0ab9('0x6'));var client=jayson[_0x0ab9('0x7')][_0x0ab9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d1248,_0x438358,_0x26e2ad){return new BPromise(function(_0x4054dd,_0x566a80){return client[_0x0ab9('0x9')](_0x5d1248,_0x26e2ad)[_0x0ab9('0xa')](function(_0x57be28){logger[_0x0ab9('0xb')](_0x0ab9('0xc'),_0x438358,'request\x20sent');logger['debug'](_0x0ab9('0xd'),_0x438358,_0x0ab9('0xe'),JSON['stringify'](_0x57be28));if(_0x57be28[_0x0ab9('0xf')]){if(_0x57be28['error'][_0x0ab9('0x10')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x438358,_0x57be28['error'][_0x0ab9('0x11')]);return _0x566a80(_0x57be28['error'][_0x0ab9('0x11')]);}logger['error'](_0x0ab9('0xc'),_0x438358,_0x57be28[_0x0ab9('0xf')][_0x0ab9('0x11')]);return _0x4054dd(_0x57be28[_0x0ab9('0xf')][_0x0ab9('0x11')]);}else{logger[_0x0ab9('0xb')](_0x0ab9('0xc'),_0x438358,_0x0ab9('0xe'));_0x4054dd(_0x57be28['result'][_0x0ab9('0x11')]);}})['catch'](function(_0x2989b2){logger[_0x0ab9('0xf')](_0x0ab9('0xc'),_0x438358,_0x2989b2);_0x566a80(_0x2989b2);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 4a9f9a3..6b40c7e 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3d0a87,_0x5654a0){var _0xe5659e=function(_0x2ef050){while(--_0x2ef050){_0x3d0a87['push'](_0x3d0a87['shift']());}};_0xe5659e(++_0x5654a0);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1649ee,_0x12e255){var _0x303c03=function(_0xababbf){while(--_0xababbf){_0x1649ee['push'](_0x1649ee['shift']());}};_0x303c03(++_0x12e255);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x470f63,_0x48d80b){_0x470f63=_0x470f63-0x0;var _0x4f09e2=_0xcb91[_0x470f63];return _0x4f09e2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 0a998ba..5db901f 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 _0xdcdc=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdcdc,0x8c));var _0xcdcd=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xdcdc[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xcdcd('0x0'));module[_0xcdcd('0x1')]={'uniqueid':{'type':Sequelize[_0xcdcd('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xcdcd('0x3')},'membername':{'type':Sequelize[_0xcdcd('0x4')],'allowNull':![],'comment':_0xcdcd('0x3')},'UserId':{'type':Sequelize[_0xcdcd('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xcdcd('0x4')],'allowNull':![],'unique':_0xcdcd('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xcdcd('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcdcd('0x5'),'comment':_0xcdcd('0x3')},'penalty':{'type':Sequelize[_0xcdcd('0x2')](0xb),'defaultValue':0x0,'comment':_0xcdcd('0x3')},'paused':{'type':Sequelize[_0xcdcd('0x2')](0xb),'defaultValue':0x0,'comment':_0xcdcd('0x3')}}; \ No newline at end of file +var _0xeedb=['sequelize','exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xeedb,0xc6));var _0xbeed=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xeedb[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xbeed('0x0'));module[_0xbeed('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xbeed('0x2')},'membername':{'type':Sequelize[_0xbeed('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xbeed('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xbeed('0x2')},'VoiceQueueId':{'type':Sequelize[_0xbeed('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0xbeed('0x3')],'allowNull':![],'unique':_0xbeed('0x5'),'comment':_0xbeed('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xbeed('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xbeed('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 29fb990..2c906bc 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 _0x2a95=['setMaxListeners','remove','emit','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x3a6dfb,_0x5d78a6){var _0x10ae92=function(_0x50cf0b){while(--_0x50cf0b){_0x3a6dfb['push'](_0x3a6dfb['shift']());}};_0x10ae92(++_0x5d78a6);}(_0x2a95,0xdb));var _0x52a9=function(_0xd3d9d1,_0x42be62){_0xd3d9d1=_0xd3d9d1-0x0;var _0x4c2521=_0x2a95[_0xd3d9d1];return _0x4c2521;};'use strict';var EventEmitter=require(_0x52a9('0x0'));var UserVoiceQueueRt=require(_0x52a9('0x1'))['db'][_0x52a9('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x52a9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x52a9('0x4')};function emitEvent(_0x3de198){return function(_0x21ac6a,_0x23f341,_0x3f4133){UserVoiceQueueRtEvents[_0x52a9('0x5')](_0x3de198+':'+_0x21ac6a['id'],_0x21ac6a);UserVoiceQueueRtEvents[_0x52a9('0x5')](_0x3de198,_0x21ac6a);_0x3f4133(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xd5c4=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x506ff5,_0x16d10f){var _0x2bd51b=function(_0x1a7f2b){while(--_0x1a7f2b){_0x506ff5['push'](_0x506ff5['shift']());}};_0x2bd51b(++_0x16d10f);}(_0xd5c4,0x15b));var _0x4d5c=function(_0x201948,_0xe034e0){_0x201948=_0x201948-0x0;var _0x10ad14=_0xd5c4[_0x201948];return _0x10ad14;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x4d5c('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4d5c('0x1')](0x0);var events={'afterCreate':_0x4d5c('0x2'),'afterUpdate':_0x4d5c('0x3'),'afterDestroy':_0x4d5c('0x4')};function emitEvent(_0x34341f){return function(_0x2dd8f9,_0x4eca48,_0xe90faf){UserVoiceQueueRtEvents['emit'](_0x34341f+':'+_0x2dd8f9['id'],_0x2dd8f9);UserVoiceQueueRtEvents[_0x4d5c('0x5')](_0x34341f,_0x2dd8f9);_0xe90faf(null);};}for(var e in events){if(events[_0x4d5c('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x4d5c('0x7')](e,emitEvent(event));}}module[_0x4d5c('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 96c01fb..465a32f 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 _0xd1fe=['UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define'];(function(_0xe178f8,_0x4de332){var _0x45748b=function(_0x51c186){while(--_0x51c186){_0xe178f8['push'](_0xe178f8['shift']());}};_0x45748b(++_0x4de332);}(_0xd1fe,0x1ec));var _0xed1f=function(_0x86667,_0x344ce7){_0x86667=_0x86667-0x0;var _0x481305=_0xd1fe[_0x86667];return _0x481305;};'use strict';var _=require('lodash');var util=require(_0xed1f('0x0'));var logger=require(_0xed1f('0x1'))(_0xed1f('0x2'));var moment=require('moment');var BPromise=require(_0xed1f('0x3'));var rp=require(_0xed1f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xed1f('0x5'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xed1f('0x6')]=function(_0x2e8a37,_0x146bf2){return _0x2e8a37[_0xed1f('0x7')](_0xed1f('0x8'),attributes,{'tableName':_0xed1f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6c1=['path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1ffa1b,_0x205ae8){var _0x471fee=function(_0x256a09){while(--_0x256a09){_0x1ffa1b['push'](_0x1ffa1b['shift']());}};_0x471fee(++_0x205ae8);}(_0xc6c1,0xde));var _0x1c6c=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0xc6c1[_0x4e8286];return _0x44a440;};'use strict';var _=require(_0x1c6c('0x0'));var util=require('util');var logger=require(_0x1c6c('0x1'))(_0x1c6c('0x2'));var moment=require(_0x1c6c('0x3'));var BPromise=require(_0x1c6c('0x4'));var rp=require(_0x1c6c('0x5'));var fs=require('fs');var path=require(_0x1c6c('0x6'));var rimraf=require(_0x1c6c('0x7'));var config=require(_0x1c6c('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x1c6c('0x9')]=function(_0xba99bf,_0x2e4275){return _0xba99bf[_0x1c6c('0xa')](_0x1c6c('0xb'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index f00694b..716d32e 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 _0x870b=['./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x870b,0x139));var _0xb870=function(_0x24232f,_0x2747fd){_0x24232f=_0x24232f-0x0;var _0x2792ad=_0x870b[_0x24232f];return _0x2792ad;};'use strict';var _=require(_0xb870('0x0'));var util=require('util');var moment=require(_0xb870('0x1'));var BPromise=require(_0xb870('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb870('0x3'))['db'];var utils=require(_0xb870('0x4'));var logger=require(_0xb870('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb870('0x6'));var client=jayson[_0xb870('0x7')][_0xb870('0x8')]({'port':0x232a});config[_0xb870('0x9')]=_['defaults'](config[_0xb870('0x9')],{'host':_0xb870('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb870('0x9')]));require(_0xb870('0xb'))['register'](socket);function respondWithRpcPromise(_0x58dab8,_0x137f4a,_0x1471eb){return new BPromise(function(_0xcfe158,_0x437ff4){return client[_0xb870('0xc')](_0x58dab8,_0x1471eb)[_0xb870('0xd')](function(_0x5a7b96){logger[_0xb870('0xe')](_0xb870('0xf'),_0x137f4a,'request\x20sent');logger[_0xb870('0x10')](_0xb870('0x11'),_0x137f4a,_0xb870('0x12'),JSON['stringify'](_0x5a7b96));if(_0x5a7b96[_0xb870('0x13')]){if(_0x5a7b96[_0xb870('0x13')][_0xb870('0x14')]===0x1f4){logger[_0xb870('0x13')](_0xb870('0xf'),_0x137f4a,_0x5a7b96[_0xb870('0x13')][_0xb870('0x15')]);return _0x437ff4(_0x5a7b96[_0xb870('0x13')][_0xb870('0x15')]);}logger[_0xb870('0x13')](_0xb870('0xf'),_0x137f4a,_0x5a7b96[_0xb870('0x13')][_0xb870('0x15')]);return _0xcfe158(_0x5a7b96[_0xb870('0x13')][_0xb870('0x15')]);}else{logger[_0xb870('0xe')](_0xb870('0xf'),_0x137f4a,'request\x20sent');_0xcfe158(_0x5a7b96[_0xb870('0x16')][_0xb870('0x15')]);}})[_0xb870('0x17')](function(_0x453b1a){logger[_0xb870('0x13')](_0xb870('0xf'),_0x137f4a,_0x453b1a);_0x437ff4(_0x453b1a);});});}exports[_0xb870('0x18')]=function(_0x563e1a){var _0x30bdd1=this;return new Promise(function(_0x1e2b0c,_0x211d56){return db[_0xb870('0x19')][_0xb870('0x1a')]({'raw':_0x563e1a[_0xb870('0x1b')]?_0x563e1a[_0xb870('0x1b')][_0xb870('0x1c')]===undefined?!![]:![]:!![],'where':_0x563e1a[_0xb870('0x1b')]?_0x563e1a[_0xb870('0x1b')][_0xb870('0x1d')]||null:null,'attributes':[[db[_0xb870('0x1e')]['fn'](_0xb870('0x1f'),db[_0xb870('0x1e')]['fn']('IF',db[_0xb870('0x1e')][_0xb870('0x20')](_0xb870('0x21')))),_0xb870('0x22')]]})[_0xb870('0xd')](function(_0x5e1b06){logger[_0xb870('0xe')](_0xb870('0x18'),_0x563e1a);logger[_0xb870('0x10')](_0xb870('0x18'),_0x563e1a,JSON[_0xb870('0x23')](_0x5e1b06));_0x1e2b0c(_0x5e1b06);})[_0xb870('0x17')](function(_0x204ee7){logger[_0xb870('0x13')](_0xb870('0x18'),_0x204ee7['message'],_0x563e1a);_0x211d56(_0x30bdd1[_0xb870('0x13')](0x1f4,_0x204ee7['message']));});});}; \ No newline at end of file +var _0x76de=['then','GetVoiceQueueRtPauses','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','./userVoiceQueueRt.socket','register','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses'];(function(_0x23f510,_0x5bc3c8){var _0x47039e=function(_0x8f903f){while(--_0x8f903f){_0x23f510['push'](_0x23f510['shift']());}};_0x47039e(++_0x5bc3c8);}(_0x76de,0x14c));var _0xe76d=function(_0x491cb8,_0x2e36dc){_0x491cb8=_0x491cb8-0x0;var _0x35b8c9=_0x76de[_0x491cb8];return _0x35b8c9;};'use strict';var _=require(_0xe76d('0x0'));var util=require('util');var moment=require(_0xe76d('0x1'));var BPromise=require(_0xe76d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe76d('0x3'));var db=require(_0xe76d('0x4'))['db'];var utils=require(_0xe76d('0x5'));var logger=require(_0xe76d('0x6'))(_0xe76d('0x7'));var config=require('../../config/environment');var jayson=require(_0xe76d('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xe76d('0x9')]=_['defaults'](config[_0xe76d('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe76d('0x9')]));require(_0xe76d('0xa'))[_0xe76d('0xb')](socket);function respondWithRpcPromise(_0x44ab3f,_0x142007,_0x3190f8){return new BPromise(function(_0x5613a5,_0x4937d9){return client['request'](_0x44ab3f,_0x3190f8)['then'](function(_0x4c7213){logger[_0xe76d('0xc')](_0xe76d('0xd'),_0x142007,_0xe76d('0xe'));logger[_0xe76d('0xf')](_0xe76d('0x10'),_0x142007,'request\x20sent',JSON[_0xe76d('0x11')](_0x4c7213));if(_0x4c7213[_0xe76d('0x12')]){if(_0x4c7213['error'][_0xe76d('0x13')]===0x1f4){logger[_0xe76d('0x12')](_0xe76d('0xd'),_0x142007,_0x4c7213[_0xe76d('0x12')]['message']);return _0x4937d9(_0x4c7213[_0xe76d('0x12')][_0xe76d('0x14')]);}logger['error'](_0xe76d('0xd'),_0x142007,_0x4c7213[_0xe76d('0x12')][_0xe76d('0x14')]);return _0x5613a5(_0x4c7213[_0xe76d('0x12')][_0xe76d('0x14')]);}else{logger[_0xe76d('0xc')](_0xe76d('0xd'),_0x142007,_0xe76d('0xe'));_0x5613a5(_0x4c7213[_0xe76d('0x15')][_0xe76d('0x14')]);}})[_0xe76d('0x16')](function(_0x226241){logger[_0xe76d('0x12')](_0xe76d('0xd'),_0x142007,_0x226241);_0x4937d9(_0x226241);});});}exports['GetVoiceQueueRtPauses']=function(_0x1a90ab){var _0x23eacf=this;return new Promise(function(_0x12e7f9,_0x372ca2){return db['UserVoiceQueueRt'][_0xe76d('0x17')]({'raw':_0x1a90ab[_0xe76d('0x18')]?_0x1a90ab[_0xe76d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1a90ab[_0xe76d('0x18')]?_0x1a90ab[_0xe76d('0x18')][_0xe76d('0x19')]||null:null,'attributes':[[db[_0xe76d('0x1a')]['fn'](_0xe76d('0x1b'),db['sequelize']['fn']('IF',db['sequelize'][_0xe76d('0x1c')](_0xe76d('0x1d')))),_0xe76d('0x1e')]]})[_0xe76d('0x1f')](function(_0x2f7135){logger[_0xe76d('0xc')](_0xe76d('0x20'),_0x1a90ab);logger[_0xe76d('0xf')](_0xe76d('0x20'),_0x1a90ab,JSON[_0xe76d('0x11')](_0x2f7135));_0x12e7f9(_0x2f7135);})[_0xe76d('0x16')](function(_0x21d609){logger[_0xe76d('0x12')](_0xe76d('0x20'),_0x21d609[_0xe76d('0x14')],_0x1a90ab);_0x372ca2(_0x23eacf[_0xe76d('0x12')](0x1f4,_0x21d609['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 99ee07b..a643a26 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 _0x6dac=['update','emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x16ddb2,_0x40e6c8){var _0x247878=function(_0x256eb5){while(--_0x256eb5){_0x16ddb2['push'](_0x16ddb2['shift']());}};_0x247878(++_0x40e6c8);}(_0x6dac,0x16e));var _0xc6da=function(_0x355fa5,_0x1806ca){_0x355fa5=_0x355fa5-0x0;var _0x568cb1=_0x6dac[_0x355fa5];return _0x568cb1;};'use strict';var UserVoiceQueueRtEvents=require(_0xc6da('0x0'));var events=[_0xc6da('0x1'),_0xc6da('0x2'),_0xc6da('0x3')];function createListener(_0x133ecc,_0x224a52){return function(_0x3391f5){_0x224a52[_0xc6da('0x4')](_0x133ecc,_0x3391f5);};}function removeListener(_0x28663f,_0x338470){return function(){UserVoiceQueueRtEvents[_0xc6da('0x5')](_0x28663f,_0x338470);};}exports[_0xc6da('0x6')]=function(_0x325f49){for(var _0x5caf49=0x0,_0x1ebd11=events[_0xc6da('0x7')];_0x5caf49<_0x1ebd11;_0x5caf49++){var _0x5a0d8d=events[_0x5caf49];var _0x3047d3=createListener(_0xc6da('0x8')+_0x5a0d8d,_0x325f49);UserVoiceQueueRtEvents['on'](_0x5a0d8d,_0x3047d3);}}; \ No newline at end of file +var _0x4d61=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','removeListener'];(function(_0x3166f6,_0x4f0867){var _0xaf5375=function(_0x13bc8d){while(--_0x13bc8d){_0x3166f6['push'](_0x3166f6['shift']());}};_0xaf5375(++_0x4f0867);}(_0x4d61,0x147));var _0x14d6=function(_0x5d247d,_0xb91986){_0x5d247d=_0x5d247d-0x0;var _0x49dfa9=_0x4d61[_0x5d247d];return _0x49dfa9;};'use strict';var UserVoiceQueueRtEvents=require(_0x14d6('0x0'));var events=[_0x14d6('0x1'),_0x14d6('0x2'),_0x14d6('0x3')];function createListener(_0x128a58,_0x1f3eb8){return function(_0x1f4d14){_0x1f3eb8[_0x14d6('0x4')](_0x128a58,_0x1f4d14);};}function removeListener(_0x2950b7,_0x5da268){return function(){UserVoiceQueueRtEvents[_0x14d6('0x5')](_0x2950b7,_0x5da268);};}exports[_0x14d6('0x6')]=function(_0x2920fe){for(var _0x11b2c0=0x0,_0x349eac=events[_0x14d6('0x7')];_0x11b2c0<_0x349eac;_0x11b2c0++){var _0x344fb8=events[_0x11b2c0];var _0x52eb2d=createListener(_0x14d6('0x8')+_0x344fb8,_0x2920fe);UserVoiceQueueRtEvents['on'](_0x344fb8,_0x52eb2d);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index a0aa53e..f29f900 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5d1ff3,_0x14c5d6){var _0x1c0076=function(_0x1b20ad){while(--_0x1b20ad){_0x5d1ff3['push'](_0x5d1ff3['shift']());}};_0x1c0076(++_0x14c5d6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0xcb91[_0x462fe4];return _0x82b23a;};'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(_0xc814e9,_0x2d1d0f){var _0x5f4d06=function(_0x41f1ef){while(--_0x41f1ef){_0xc814e9['push'](_0xc814e9['shift']());}};_0x5f4d06(++_0x2d1d0f);}(_0x70e0,0x17b));var _0x070e=function(_0x3e3d60,_0x25004d){_0x3e3d60=_0x3e3d60-0x0;var _0x2f1982=_0x70e0[_0x3e3d60];return _0x2f1982;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 1bd2165..1068056 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 _0x626d=['sequelize'];(function(_0x43e243,_0x47ff81){var _0x16482b=function(_0x397002){while(--_0x397002){_0x43e243['push'](_0x43e243['shift']());}};_0x16482b(++_0x47ff81);}(_0x626d,0x89));var _0xd626=function(_0x52b63e,_0x141710){_0x52b63e=_0x52b63e-0x0;var _0x2cc4e9=_0x626d[_0x52b63e];return _0x2cc4e9;};'use strict';var Sequelize=require(_0xd626('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe0ff=['exports','INTEGER','sequelize'];(function(_0x55a144,_0x4242ca){var _0x5722f9=function(_0x5cd81c){while(--_0x5cd81c){_0x55a144['push'](_0x55a144['shift']());}};_0x5722f9(++_0x4242ca);}(_0xe0ff,0x116));var _0xfe0f=function(_0xbbf96e,_0x5250b3){_0xbbf96e=_0xbbf96e-0x0;var _0x3f7af1=_0xe0ff[_0xbbf96e];return _0x3f7af1;};'use strict';var Sequelize=require(_0xfe0f('0x0'));module[_0xfe0f('0x1')]={'penalty':{'type':Sequelize[_0xfe0f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 438505c..68ac6f0 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 _0x0576=['api','moment','bluebird','request-promise','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0576,0x10d));var _0x6057=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0576[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6057('0x0'))(_0x6057('0x1'));var moment=require(_0x6057('0x2'));var BPromise=require(_0x6057('0x3'));var rp=require(_0x6057('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6057('0x5'));module[_0x6057('0x6')]=function(_0x164dc6,_0x1068b6){return _0x164dc6['define'](_0x6057('0x7'),attributes,{'tableName':_0x6057('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fed=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0xf6dc14,_0x113164){var _0x2643c0=function(_0x48afdc){while(--_0x48afdc){_0xf6dc14['push'](_0xf6dc14['shift']());}};_0x2643c0(++_0x113164);}(_0x6fed,0x1e3));var _0xd6fe=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6fed[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xd6fe('0x0'));var util=require(_0xd6fe('0x1'));var logger=require(_0xd6fe('0x2'))(_0xd6fe('0x3'));var moment=require(_0xd6fe('0x4'));var BPromise=require(_0xd6fe('0x5'));var rp=require(_0xd6fe('0x6'));var fs=require('fs');var path=require(_0xd6fe('0x7'));var rimraf=require(_0xd6fe('0x8'));var config=require(_0xd6fe('0x9'));var attributes=require(_0xd6fe('0xa'));module[_0xd6fe('0xb')]=function(_0x2a66c0,_0x34dea2){return _0x2a66c0[_0xd6fe('0xc')](_0xd6fe('0xd'),attributes,{'tableName':_0xd6fe('0xe'),'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 52bcbe2..4fe71e4 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 _0x52b2=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','util'];(function(_0x3b58c9,_0x1f46c3){var _0x5b653a=function(_0xecac3b){while(--_0xecac3b){_0x3b58c9['push'](_0x3b58c9['shift']());}};_0x5b653a(++_0x1f46c3);}(_0x52b2,0x141));var _0x252b=function(_0x34af3a,_0x2916ca){_0x34af3a=_0x34af3a-0x0;var _0x547621=_0x52b2[_0x34af3a];return _0x547621;};'use strict';var _=require('lodash');var util=require(_0x252b('0x0'));var moment=require(_0x252b('0x1'));var BPromise=require(_0x252b('0x2'));var rs=require(_0x252b('0x3'));var fs=require('fs');var Redis=require(_0x252b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x252b('0x5'));var logger=require(_0x252b('0x6'))('rpc');var config=require(_0x252b('0x7'));var jayson=require(_0x252b('0x8'));var client=jayson[_0x252b('0x9')][_0x252b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5761ad,_0x3141bc,_0x450579){return new BPromise(function(_0x486b16,_0x42aa03){return client[_0x252b('0xb')](_0x5761ad,_0x450579)[_0x252b('0xc')](function(_0x383376){logger[_0x252b('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3141bc,'request\x20sent');logger['debug'](_0x252b('0xe'),_0x3141bc,_0x252b('0xf'),JSON[_0x252b('0x10')](_0x383376));if(_0x383376[_0x252b('0x11')]){if(_0x383376[_0x252b('0x11')][_0x252b('0x12')]===0x1f4){logger[_0x252b('0x11')](_0x252b('0x13'),_0x3141bc,_0x383376[_0x252b('0x11')][_0x252b('0x14')]);return _0x42aa03(_0x383376[_0x252b('0x11')][_0x252b('0x14')]);}logger[_0x252b('0x11')](_0x252b('0x13'),_0x3141bc,_0x383376[_0x252b('0x11')]['message']);return _0x486b16(_0x383376[_0x252b('0x11')][_0x252b('0x14')]);}else{logger[_0x252b('0xd')](_0x252b('0x13'),_0x3141bc,_0x252b('0xf'));_0x486b16(_0x383376[_0x252b('0x15')][_0x252b('0x14')]);}})[_0x252b('0x16')](function(_0x17a932){logger[_0x252b('0x11')](_0x252b('0x13'),_0x3141bc,_0x17a932);_0x42aa03(_0x17a932);});});} \ No newline at end of file +var _0x6f52=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserWhatsappQueue,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f52,0x199));var _0x26f5=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x6f52[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x26f5('0x0'));var util=require(_0x26f5('0x1'));var moment=require(_0x26f5('0x2'));var BPromise=require(_0x26f5('0x3'));var rs=require(_0x26f5('0x4'));var fs=require('fs');var Redis=require(_0x26f5('0x5'));var db=require(_0x26f5('0x6'))['db'];var utils=require(_0x26f5('0x7'));var logger=require(_0x26f5('0x8'))('rpc');var config=require(_0x26f5('0x9'));var jayson=require(_0x26f5('0xa'));var client=jayson[_0x26f5('0xb')][_0x26f5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20f636,_0x47a581,_0x2e6e00){return new BPromise(function(_0x50254d,_0x506c5d){return client[_0x26f5('0xd')](_0x20f636,_0x2e6e00)['then'](function(_0x43b651){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x47a581,_0x26f5('0xe'));logger[_0x26f5('0xf')](_0x26f5('0x10'),_0x47a581,_0x26f5('0xe'),JSON[_0x26f5('0x11')](_0x43b651));if(_0x43b651[_0x26f5('0x12')]){if(_0x43b651[_0x26f5('0x12')]['code']===0x1f4){logger[_0x26f5('0x12')](_0x26f5('0x13'),_0x47a581,_0x43b651[_0x26f5('0x12')][_0x26f5('0x14')]);return _0x506c5d(_0x43b651[_0x26f5('0x12')]['message']);}logger[_0x26f5('0x12')](_0x26f5('0x13'),_0x47a581,_0x43b651[_0x26f5('0x12')][_0x26f5('0x14')]);return _0x50254d(_0x43b651['error'][_0x26f5('0x14')]);}else{logger[_0x26f5('0x15')](_0x26f5('0x13'),_0x47a581,_0x26f5('0xe'));_0x50254d(_0x43b651['result'][_0x26f5('0x14')]);}})[_0x26f5('0x16')](function(_0x225462){logger[_0x26f5('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x47a581,_0x225462);_0x506c5d(_0x225462);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index cbad4e2..80a94ff 100644 --- a/server/api/variable/index.js +++ b/server/api/variable/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1d5b=['../../config/environment','isAuthenticated','index','get','/:id','show','post','put','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5aa7da,_0x425418){var _0x2fd5ff=function(_0x2d1f97){while(--_0x2d1f97){_0x5aa7da['push'](_0x5aa7da['shift']());}};_0x2fd5ff(++_0x425418);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x540b71,_0x330ee4){_0x540b71=_0x540b71-0x0;var _0x50b52d=_0x1d5b[_0x540b71];return _0x50b52d;};'use strict';var multer=require(_0xb1d5('0x0'));var util=require(_0xb1d5('0x1'));var path=require(_0xb1d5('0x2'));var timeout=require('connect-timeout');var express=require(_0xb1d5('0x3'));var router=express['Router']();var fs_extra=require(_0xb1d5('0x4'));var auth=require(_0xb1d5('0x5'));var interaction=require(_0xb1d5('0x6'));var config=require(_0xb1d5('0x7'));var controller=require('./variable.controller');router['get']('/',auth[_0xb1d5('0x8')](),controller[_0xb1d5('0x9')]);router[_0xb1d5('0xa')](_0xb1d5('0xb'),auth[_0xb1d5('0x8')](),controller[_0xb1d5('0xc')]);router[_0xb1d5('0xd')]('/',auth[_0xb1d5('0x8')](),controller['create']);router[_0xb1d5('0xe')](_0xb1d5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xb1d5('0xf')](_0xb1d5('0xb'),auth[_0xb1d5('0x8')](),controller['destroy']);module[_0xb1d5('0x10')]=router; \ No newline at end of file +var _0x2209=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2209,0x95));var _0x9220=function(_0x5dc595,_0x468797){_0x5dc595=_0x5dc595-0x0;var _0x4d83a0=_0x2209[_0x5dc595];return _0x4d83a0;};'use strict';var multer=require(_0x9220('0x0'));var util=require(_0x9220('0x1'));var path=require(_0x9220('0x2'));var timeout=require(_0x9220('0x3'));var express=require(_0x9220('0x4'));var router=express['Router']();var fs_extra=require(_0x9220('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9220('0x6'));var config=require(_0x9220('0x7'));var controller=require(_0x9220('0x8'));router[_0x9220('0x9')]('/',auth[_0x9220('0xa')](),controller[_0x9220('0xb')]);router[_0x9220('0x9')](_0x9220('0xc'),auth[_0x9220('0xa')](),controller['show']);router[_0x9220('0xd')]('/',auth[_0x9220('0xa')](),controller['create']);router[_0x9220('0xe')](_0x9220('0xc'),auth[_0x9220('0xa')](),controller[_0x9220('0xf')]);router['delete'](_0x9220('0xc'),auth[_0x9220('0xa')](),controller[_0x9220('0x10')]);module[_0x9220('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 3ae97fc..73e36bc 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 _0x1a42=['exports','STRING','name'];(function(_0x5856d9,_0x18dc16){var _0x3030a2=function(_0x57af59){while(--_0x57af59){_0x5856d9['push'](_0x5856d9['shift']());}};_0x3030a2(++_0x18dc16);}(_0x1a42,0x12c));var _0x21a4=function(_0x469d01,_0x18c899){_0x469d01=_0x469d01-0x0;var _0x5078d3=_0x1a42[_0x469d01];return _0x5078d3;};'use strict';var Sequelize=require('sequelize');module[_0x21a4('0x0')]={'name':{'type':Sequelize[_0x21a4('0x1')],'unique':_0x21a4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x21a4('0x1')]}}; \ No newline at end of file +var _0xc285=['sequelize','exports','STRING','name'];(function(_0x55c97f,_0x19c312){var _0x91a967=function(_0x28caee){while(--_0x28caee){_0x55c97f['push'](_0x55c97f['shift']());}};_0x91a967(++_0x19c312);}(_0xc285,0xcc));var _0x5c28=function(_0x3cb0c1,_0x3abf86){_0x3cb0c1=_0x3cb0c1-0x0;var _0x568306=_0xc285[_0x3cb0c1];return _0x568306;};'use strict';var Sequelize=require(_0x5c28('0x0'));module[_0x5c28('0x1')]={'name':{'type':Sequelize[_0x5c28('0x2')],'unique':_0x5c28('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 55d34ae..c7e144d 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 _0x1c73=['nolimit','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','show','params','rawAttributes','length','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Variables','destroy','error','stack','name','send','Variable','fieldName','key','model','map','query','keys','intersection','attributes','fields'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x1c73,0x6d));var _0x31c7=function(_0x2859b9,_0x1df68e){_0x2859b9=_0x2859b9-0x0;var _0x191dbd=_0x1c73[_0x2859b9];return _0x191dbd;};'use strict';var emlformat=require(_0x31c7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x31c7('0x1'));var jsonpatch=require(_0x31c7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x31c7('0x3'));var Mustache=require(_0x31c7('0x4'));var util=require('util');var path=require(_0x31c7('0x5'));var sox=require(_0x31c7('0x6'));var csv=require(_0x31c7('0x7'));var ejs=require(_0x31c7('0x8'));var fs=require('fs');var fs_extra=require(_0x31c7('0x9'));var _=require(_0x31c7('0xa'));var squel=require('squel');var crypto=require(_0x31c7('0xb'));var jsforce=require(_0x31c7('0xc'));var deskjs=require(_0x31c7('0xd'));var toCsv=require(_0x31c7('0x7'));var querystring=require(_0x31c7('0xe'));var Papa=require(_0x31c7('0xf'));var Redis=require(_0x31c7('0x10'));var authService=require(_0x31c7('0x11'));var qs=require(_0x31c7('0x12'));var as=require(_0x31c7('0x13'));var hardwareService=require(_0x31c7('0x14'));var logger=require('../../config/logger')(_0x31c7('0x15'));var utils=require(_0x31c7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x31c7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e51ef,_0x5a1450){_0x5a1450=_0x5a1450||0xcc;return function(_0x3f4ec8){if(_0x3f4ec8){return _0x5e51ef[_0x31c7('0x18')](_0x5a1450);}return _0x5e51ef[_0x31c7('0x19')](_0x5a1450)[_0x31c7('0x1a')]();};}function respondWithResult(_0x2a4e95,_0x50eecb){_0x50eecb=_0x50eecb||0xc8;return function(_0xd8db4b){if(_0xd8db4b){return _0x2a4e95[_0x31c7('0x19')](_0x50eecb)[_0x31c7('0x1b')](_0xd8db4b);}};}function respondWithFilteredResult(_0x1f2c97,_0x47d4bc){return function(_0x5ad6ca){if(_0x5ad6ca){var _0x5af604=typeof _0x47d4bc['offset']===_0x31c7('0x1c')&&typeof _0x47d4bc[_0x31c7('0x1d')]===_0x31c7('0x1c');var _0x57646f=_0x5ad6ca[_0x31c7('0x1e')];var _0x34724c=_0x5af604?0x0:_0x47d4bc[_0x31c7('0x1f')];var _0x10477d=_0x5af604?_0x5ad6ca['count']:_0x47d4bc[_0x31c7('0x1f')]+_0x47d4bc[_0x31c7('0x1d')];var _0x2952c3;if(_0x10477d>=_0x57646f){_0x10477d=_0x57646f;_0x2952c3=0xc8;}else{_0x2952c3=0xce;}_0x1f2c97[_0x31c7('0x19')](_0x2952c3);return _0x1f2c97['set'](_0x31c7('0x20'),_0x34724c+'-'+_0x10477d+'/'+_0x57646f)[_0x31c7('0x1b')](_0x5ad6ca);}return null;};}function patchUpdates(_0x277e46){return function(_0x4c33c1){try{jsonpatch[_0x31c7('0x21')](_0x4c33c1,_0x277e46,!![]);}catch(_0x39323c){return BPromise[_0x31c7('0x22')](_0x39323c);}return _0x4c33c1[_0x31c7('0x23')]();};}function saveUpdates(_0xddf3a0,_0x3da31d){return function(_0x200c7f){if(_0x200c7f){return _0x200c7f[_0x31c7('0x24')](_0xddf3a0)[_0x31c7('0x25')](function(_0x28e3e6){return _0x28e3e6;});}return null;};}function removeEntity(_0x4f23ed,_0x436b6b){return function(_0x1e420b){if(_0x1e420b){return _0x1e420b['destroy']()['then'](function(){var _0x1d5ac3=_0x1e420b[_0x31c7('0x26')]({'plain':!![]});var _0x4ba0b1=_0x31c7('0x27');return db['UserProfileResource'][_0x31c7('0x28')]({'where':{'type':_0x4ba0b1,'resourceId':_0x1d5ac3['id']}})[_0x31c7('0x25')](function(){return _0x1e420b;});})[_0x31c7('0x25')](function(){_0x4f23ed['status'](0xcc)[_0x31c7('0x1a')]();});}};}function handleEntityNotFound(_0x651e40,_0x4a2650){return function(_0x1f3a20){if(!_0x1f3a20){_0x651e40[_0x31c7('0x18')](0x194);}return _0x1f3a20;};}function handleError(_0x57e932,_0x77e2d7){_0x77e2d7=_0x77e2d7||0x1f4;return function(_0x535420){logger[_0x31c7('0x29')](_0x535420[_0x31c7('0x2a')]);if(_0x535420['name']){delete _0x535420[_0x31c7('0x2b')];}_0x57e932['status'](_0x77e2d7)[_0x31c7('0x2c')](_0x535420);};}exports['index']=function(_0xb85ce1,_0x2fef22){var _0x514c30={},_0x3f5c54={},_0x5d2e84={'count':0x0,'rows':[]};var _0x4be09f=_['map'](db[_0x31c7('0x2d')]['rawAttributes'],function(_0x5c9124){return{'name':_0x5c9124[_0x31c7('0x2e')],'type':_0x5c9124['type'][_0x31c7('0x2f')]};});_0x3f5c54[_0x31c7('0x30')]=_[_0x31c7('0x31')](_0x4be09f,_0x31c7('0x2b'));_0x3f5c54[_0x31c7('0x32')]=_[_0x31c7('0x33')](_0xb85ce1[_0x31c7('0x32')]);_0x3f5c54['filters']=_[_0x31c7('0x34')](_0x3f5c54[_0x31c7('0x30')],_0x3f5c54['query']);_0x514c30[_0x31c7('0x35')]=_['intersection'](_0x3f5c54[_0x31c7('0x30')],qs[_0x31c7('0x36')](_0xb85ce1['query']['fields']));_0x514c30[_0x31c7('0x35')]=_0x514c30[_0x31c7('0x35')]['length']?_0x514c30['attributes']:_0x3f5c54[_0x31c7('0x30')];if(!_0xb85ce1[_0x31c7('0x32')]['hasOwnProperty'](_0x31c7('0x37'))){_0x514c30[_0x31c7('0x1d')]=qs[_0x31c7('0x1d')](_0xb85ce1[_0x31c7('0x32')][_0x31c7('0x1d')]);_0x514c30[_0x31c7('0x1f')]=qs[_0x31c7('0x1f')](_0xb85ce1[_0x31c7('0x32')][_0x31c7('0x1f')]);}_0x514c30[_0x31c7('0x38')]=qs[_0x31c7('0x39')](_0xb85ce1[_0x31c7('0x32')][_0x31c7('0x39')]);_0x514c30[_0x31c7('0x3a')]=qs[_0x31c7('0x3b')](_[_0x31c7('0x3c')](_0xb85ce1[_0x31c7('0x32')],_0x3f5c54[_0x31c7('0x3b')]),_0x4be09f);if(_0xb85ce1['query'][_0x31c7('0x3d')]){_0x514c30[_0x31c7('0x3a')]=_['merge'](_0x514c30[_0x31c7('0x3a')],{'$or':_[_0x31c7('0x31')](_0x4be09f,function(_0x3ec8e5){if(_0x3ec8e5[_0x31c7('0x3e')]!=='VIRTUAL'){var _0x741ee0={};_0x741ee0[_0x3ec8e5['name']]={'$like':'%'+_0xb85ce1[_0x31c7('0x32')]['filter']+'%'};return _0x741ee0;}})});}_0x514c30=_[_0x31c7('0x3f')]({},_0x514c30,_0xb85ce1[_0x31c7('0x40')]);var _0x24ccfd={'where':_0x514c30[_0x31c7('0x3a')]};return db[_0x31c7('0x2d')]['count'](_0x24ccfd)['then'](function(_0x53675b){_0x5d2e84[_0x31c7('0x1e')]=_0x53675b;if(_0xb85ce1[_0x31c7('0x32')][_0x31c7('0x41')]){_0x514c30[_0x31c7('0x42')]=[{'all':!![]}];}return db[_0x31c7('0x2d')][_0x31c7('0x43')](_0x514c30);})['then'](function(_0x5f0a99){_0x5d2e84['rows']=_0x5f0a99;return _0x5d2e84;})[_0x31c7('0x25')](respondWithFilteredResult(_0x2fef22,_0x514c30))['catch'](handleError(_0x2fef22,null));};exports[_0x31c7('0x44')]=function(_0x449c3b,_0x111258){var _0xf8d937={'raw':!![],'where':{'id':_0x449c3b[_0x31c7('0x45')]['id']}},_0x303ee3={};_0x303ee3[_0x31c7('0x30')]=_[_0x31c7('0x33')](db[_0x31c7('0x2d')][_0x31c7('0x46')]);_0x303ee3[_0x31c7('0x32')]=_['keys'](_0x449c3b[_0x31c7('0x32')]);_0x303ee3['filters']=_['intersection'](_0x303ee3[_0x31c7('0x30')],_0x303ee3[_0x31c7('0x32')]);_0xf8d937[_0x31c7('0x35')]=_[_0x31c7('0x34')](_0x303ee3['model'],qs[_0x31c7('0x36')](_0x449c3b[_0x31c7('0x32')][_0x31c7('0x36')]));_0xf8d937['attributes']=_0xf8d937[_0x31c7('0x35')][_0x31c7('0x47')]?_0xf8d937[_0x31c7('0x35')]:_0x303ee3['model'];if(_0x449c3b['query'][_0x31c7('0x41')]){_0xf8d937[_0x31c7('0x42')]=[{'all':!![]}];}_0xf8d937=_['merge']({},_0xf8d937,_0x449c3b['options']);return db[_0x31c7('0x2d')][_0x31c7('0x48')](_0xf8d937)['then'](handleEntityNotFound(_0x111258,null))['then'](respondWithResult(_0x111258,null))[_0x31c7('0x49')](handleError(_0x111258,null));};exports[_0x31c7('0x4a')]=function(_0x4da173,_0x4ca19f){return db[_0x31c7('0x2d')][_0x31c7('0x4a')](_0x4da173[_0x31c7('0x4b')],{})[_0x31c7('0x25')](function(_0x1ac4c0){var _0x5e6ba6=_0x4da173[_0x31c7('0x4c')]['get']({'plain':!![]});if(!_0x5e6ba6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e6ba6[_0x31c7('0x4d')]===_0x31c7('0x4c')){var _0x587e0e=_0x1ac4c0[_0x31c7('0x26')]({'plain':!![]});var _0x56c0c2=_0x31c7('0x27');return db[_0x31c7('0x4e')]['find']({'where':{'name':_0x56c0c2,'userProfileId':_0x5e6ba6[_0x31c7('0x4f')]},'raw':!![]})['then'](function(_0xdc84e6){if(_0xdc84e6&&_0xdc84e6[_0x31c7('0x50')]===0x0){return db[_0x31c7('0x51')][_0x31c7('0x4a')]({'name':_0x587e0e[_0x31c7('0x2b')],'resourceId':_0x587e0e['id'],'type':_0xdc84e6[_0x31c7('0x2b')],'sectionId':_0xdc84e6['id']},{})[_0x31c7('0x25')](function(){return _0x1ac4c0;});}else{return _0x1ac4c0;}})[_0x31c7('0x49')](function(_0x57d41b){logger[_0x31c7('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57d41b);throw _0x57d41b;});}return _0x1ac4c0;})[_0x31c7('0x25')](respondWithResult(_0x4ca19f,0xc9))[_0x31c7('0x49')](handleError(_0x4ca19f,null));};exports[_0x31c7('0x24')]=function(_0x2ff5e3,_0x2022a9){if(_0x2ff5e3[_0x31c7('0x4b')]['id']){delete _0x2ff5e3[_0x31c7('0x4b')]['id'];}return db['Variable'][_0x31c7('0x48')]({'where':{'id':_0x2ff5e3[_0x31c7('0x45')]['id']}})[_0x31c7('0x25')](handleEntityNotFound(_0x2022a9,null))[_0x31c7('0x25')](saveUpdates(_0x2ff5e3[_0x31c7('0x4b')],null))[_0x31c7('0x25')](respondWithResult(_0x2022a9,null))[_0x31c7('0x49')](handleError(_0x2022a9,null));};exports[_0x31c7('0x28')]=function(_0x573815,_0x21de1c){return db['Variable']['find']({'where':{'id':_0x573815[_0x31c7('0x45')]['id']}})[_0x31c7('0x25')](handleEntityNotFound(_0x21de1c,null))[_0x31c7('0x25')](removeEntity(_0x21de1c,null))['catch'](handleError(_0x21de1c,null));}; \ No newline at end of file +var _0xba6f=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Variables','UserProfileResource','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','Variable','includeAll','findAll','rows','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x2cdfe7,_0x34edf9){var _0x5900e0=function(_0x127b8c){while(--_0x127b8c){_0x2cdfe7['push'](_0x2cdfe7['shift']());}};_0x5900e0(++_0x34edf9);}(_0xba6f,0xa4));var _0xfba6=function(_0x2f10e3,_0x5018fe){_0x2f10e3=_0x2f10e3-0x0;var _0x37264=_0xba6f[_0x2f10e3];return _0x37264;};'use strict';var emlformat=require(_0xfba6('0x0'));var rimraf=require(_0xfba6('0x1'));var zipdir=require(_0xfba6('0x2'));var jsonpatch=require(_0xfba6('0x3'));var rp=require('request-promise');var moment=require(_0xfba6('0x4'));var BPromise=require(_0xfba6('0x5'));var Mustache=require(_0xfba6('0x6'));var util=require('util');var path=require(_0xfba6('0x7'));var sox=require(_0xfba6('0x8'));var csv=require(_0xfba6('0x9'));var ejs=require(_0xfba6('0xa'));var fs=require('fs');var fs_extra=require(_0xfba6('0xb'));var _=require(_0xfba6('0xc'));var squel=require(_0xfba6('0xd'));var crypto=require(_0xfba6('0xe'));var jsforce=require(_0xfba6('0xf'));var deskjs=require(_0xfba6('0x10'));var toCsv=require(_0xfba6('0x9'));var querystring=require(_0xfba6('0x11'));var Papa=require(_0xfba6('0x12'));var Redis=require(_0xfba6('0x13'));var authService=require(_0xfba6('0x14'));var qs=require(_0xfba6('0x15'));var as=require(_0xfba6('0x16'));var hardwareService=require(_0xfba6('0x17'));var logger=require(_0xfba6('0x18'))(_0xfba6('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfba6('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfa0c5b,_0x3a671e){_0x3a671e=_0x3a671e||0xcc;return function(_0x14546f){if(_0x14546f){return _0xfa0c5b['sendStatus'](_0x3a671e);}return _0xfa0c5b[_0xfba6('0x1b')](_0x3a671e)[_0xfba6('0x1c')]();};}function respondWithResult(_0x472b0a,_0x2f24ab){_0x2f24ab=_0x2f24ab||0xc8;return function(_0x110b16){if(_0x110b16){return _0x472b0a['status'](_0x2f24ab)[_0xfba6('0x1d')](_0x110b16);}};}function respondWithFilteredResult(_0x4df819,_0x282b31){return function(_0x4d15d5){if(_0x4d15d5){var _0x19613c=typeof _0x282b31[_0xfba6('0x1e')]===_0xfba6('0x1f')&&typeof _0x282b31[_0xfba6('0x20')]===_0xfba6('0x1f');var _0x3b02f9=_0x4d15d5[_0xfba6('0x21')];var _0x27b8a6=_0x19613c?0x0:_0x282b31[_0xfba6('0x1e')];var _0x104e13=_0x19613c?_0x4d15d5[_0xfba6('0x21')]:_0x282b31['offset']+_0x282b31[_0xfba6('0x20')];var _0x5c5b30;if(_0x104e13>=_0x3b02f9){_0x104e13=_0x3b02f9;_0x5c5b30=0xc8;}else{_0x5c5b30=0xce;}_0x4df819[_0xfba6('0x1b')](_0x5c5b30);return _0x4df819[_0xfba6('0x22')](_0xfba6('0x23'),_0x27b8a6+'-'+_0x104e13+'/'+_0x3b02f9)['json'](_0x4d15d5);}return null;};}function patchUpdates(_0x2ce597){return function(_0x50c14c){try{jsonpatch[_0xfba6('0x24')](_0x50c14c,_0x2ce597,!![]);}catch(_0x2bb6c8){return BPromise[_0xfba6('0x25')](_0x2bb6c8);}return _0x50c14c[_0xfba6('0x26')]();};}function saveUpdates(_0x56eab8,_0x4dbcc5){return function(_0x3616a0){if(_0x3616a0){return _0x3616a0[_0xfba6('0x27')](_0x56eab8)[_0xfba6('0x28')](function(_0x4297e7){return _0x4297e7;});}return null;};}function removeEntity(_0x208c4e,_0x36f96f){return function(_0x51c991){if(_0x51c991){return _0x51c991[_0xfba6('0x29')]()['then'](function(){var _0x27e3a5=_0x51c991['get']({'plain':!![]});var _0x4ba8a0=_0xfba6('0x2a');return db[_0xfba6('0x2b')]['destroy']({'where':{'type':_0x4ba8a0,'resourceId':_0x27e3a5['id']}})[_0xfba6('0x28')](function(){return _0x51c991;});})['then'](function(){_0x208c4e['status'](0xcc)[_0xfba6('0x1c')]();});}};}function handleEntityNotFound(_0x5d7012,_0x5ddae1){return function(_0x5b1d64){if(!_0x5b1d64){_0x5d7012[_0xfba6('0x2c')](0x194);}return _0x5b1d64;};}function handleError(_0x4e229e,_0x43de34){_0x43de34=_0x43de34||0x1f4;return function(_0x48e77f){logger[_0xfba6('0x2d')](_0x48e77f[_0xfba6('0x2e')]);if(_0x48e77f[_0xfba6('0x2f')]){delete _0x48e77f[_0xfba6('0x2f')];}_0x4e229e[_0xfba6('0x1b')](_0x43de34)[_0xfba6('0x30')](_0x48e77f);};}exports['index']=function(_0x24d0df,_0x46b2ed){var _0xe2c83f={},_0x20d098={},_0x401b61={'count':0x0,'rows':[]};var _0x1c177b=_['map'](db['Variable'][_0xfba6('0x31')],function(_0x5c1fd2){return{'name':_0x5c1fd2[_0xfba6('0x32')],'type':_0x5c1fd2[_0xfba6('0x33')][_0xfba6('0x34')]};});_0x20d098[_0xfba6('0x35')]=_['map'](_0x1c177b,_0xfba6('0x2f'));_0x20d098[_0xfba6('0x36')]=_[_0xfba6('0x37')](_0x24d0df[_0xfba6('0x36')]);_0x20d098[_0xfba6('0x38')]=_[_0xfba6('0x39')](_0x20d098['model'],_0x20d098[_0xfba6('0x36')]);_0xe2c83f[_0xfba6('0x3a')]=_[_0xfba6('0x39')](_0x20d098[_0xfba6('0x35')],qs[_0xfba6('0x3b')](_0x24d0df[_0xfba6('0x36')][_0xfba6('0x3b')]));_0xe2c83f['attributes']=_0xe2c83f['attributes'][_0xfba6('0x3c')]?_0xe2c83f[_0xfba6('0x3a')]:_0x20d098['model'];if(!_0x24d0df['query'][_0xfba6('0x3d')](_0xfba6('0x3e'))){_0xe2c83f[_0xfba6('0x20')]=qs[_0xfba6('0x20')](_0x24d0df[_0xfba6('0x36')][_0xfba6('0x20')]);_0xe2c83f[_0xfba6('0x1e')]=qs['offset'](_0x24d0df[_0xfba6('0x36')][_0xfba6('0x1e')]);}_0xe2c83f[_0xfba6('0x3f')]=qs[_0xfba6('0x40')](_0x24d0df[_0xfba6('0x36')][_0xfba6('0x40')]);_0xe2c83f[_0xfba6('0x41')]=qs[_0xfba6('0x38')](_[_0xfba6('0x42')](_0x24d0df[_0xfba6('0x36')],_0x20d098[_0xfba6('0x38')]),_0x1c177b);if(_0x24d0df[_0xfba6('0x36')][_0xfba6('0x43')]){_0xe2c83f[_0xfba6('0x41')]=_['merge'](_0xe2c83f[_0xfba6('0x41')],{'$or':_[_0xfba6('0x44')](_0x1c177b,function(_0x502bf7){if(_0x502bf7['type']!==_0xfba6('0x45')){var _0x3d27e9={};_0x3d27e9[_0x502bf7[_0xfba6('0x2f')]]={'$like':'%'+_0x24d0df['query'][_0xfba6('0x43')]+'%'};return _0x3d27e9;}})});}_0xe2c83f=_[_0xfba6('0x46')]({},_0xe2c83f,_0x24d0df[_0xfba6('0x47')]);var _0x2b5f6b={'where':_0xe2c83f[_0xfba6('0x41')]};return db[_0xfba6('0x48')][_0xfba6('0x21')](_0x2b5f6b)[_0xfba6('0x28')](function(_0x10da57){_0x401b61[_0xfba6('0x21')]=_0x10da57;if(_0x24d0df[_0xfba6('0x36')][_0xfba6('0x49')]){_0xe2c83f['include']=[{'all':!![]}];}return db[_0xfba6('0x48')][_0xfba6('0x4a')](_0xe2c83f);})[_0xfba6('0x28')](function(_0xc9705f){_0x401b61[_0xfba6('0x4b')]=_0xc9705f;return _0x401b61;})[_0xfba6('0x28')](respondWithFilteredResult(_0x46b2ed,_0xe2c83f))['catch'](handleError(_0x46b2ed,null));};exports[_0xfba6('0x4c')]=function(_0x118648,_0x188fe8){var _0x1e1983={'raw':!![],'where':{'id':_0x118648[_0xfba6('0x4d')]['id']}},_0x104453={};_0x104453[_0xfba6('0x35')]=_[_0xfba6('0x37')](db['Variable'][_0xfba6('0x31')]);_0x104453['query']=_[_0xfba6('0x37')](_0x118648['query']);_0x104453[_0xfba6('0x38')]=_[_0xfba6('0x39')](_0x104453[_0xfba6('0x35')],_0x104453[_0xfba6('0x36')]);_0x1e1983[_0xfba6('0x3a')]=_[_0xfba6('0x39')](_0x104453[_0xfba6('0x35')],qs[_0xfba6('0x3b')](_0x118648[_0xfba6('0x36')][_0xfba6('0x3b')]));_0x1e1983['attributes']=_0x1e1983[_0xfba6('0x3a')][_0xfba6('0x3c')]?_0x1e1983['attributes']:_0x104453['model'];if(_0x118648[_0xfba6('0x36')]['includeAll']){_0x1e1983[_0xfba6('0x4e')]=[{'all':!![]}];}_0x1e1983=_[_0xfba6('0x46')]({},_0x1e1983,_0x118648['options']);return db[_0xfba6('0x48')][_0xfba6('0x4f')](_0x1e1983)[_0xfba6('0x28')](handleEntityNotFound(_0x188fe8,null))['then'](respondWithResult(_0x188fe8,null))['catch'](handleError(_0x188fe8,null));};exports[_0xfba6('0x50')]=function(_0xe76628,_0x4c7696){return db[_0xfba6('0x48')][_0xfba6('0x50')](_0xe76628[_0xfba6('0x51')],{})[_0xfba6('0x28')](function(_0x5165cc){var _0x24907a=_0xe76628[_0xfba6('0x52')][_0xfba6('0x53')]({'plain':!![]});if(!_0x24907a)throw new Error(_0xfba6('0x54'));if(_0x24907a[_0xfba6('0x55')]===_0xfba6('0x52')){var _0x5d0668=_0x5165cc[_0xfba6('0x53')]({'plain':!![]});var _0x58fefd='Variables';return db[_0xfba6('0x56')][_0xfba6('0x4f')]({'where':{'name':_0x58fefd,'userProfileId':_0x24907a[_0xfba6('0x57')]},'raw':!![]})[_0xfba6('0x28')](function(_0x1c6ec7){if(_0x1c6ec7&&_0x1c6ec7[_0xfba6('0x58')]===0x0){return db[_0xfba6('0x2b')][_0xfba6('0x50')]({'name':_0x5d0668[_0xfba6('0x2f')],'resourceId':_0x5d0668['id'],'type':_0x1c6ec7[_0xfba6('0x2f')],'sectionId':_0x1c6ec7['id']},{})[_0xfba6('0x28')](function(){return _0x5165cc;});}else{return _0x5165cc;}})[_0xfba6('0x59')](function(_0x1c6557){logger[_0xfba6('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c6557);throw _0x1c6557;});}return _0x5165cc;})[_0xfba6('0x28')](respondWithResult(_0x4c7696,0xc9))[_0xfba6('0x59')](handleError(_0x4c7696,null));};exports[_0xfba6('0x27')]=function(_0x7a495d,_0x7651ab){if(_0x7a495d[_0xfba6('0x51')]['id']){delete _0x7a495d[_0xfba6('0x51')]['id'];}return db[_0xfba6('0x48')][_0xfba6('0x4f')]({'where':{'id':_0x7a495d[_0xfba6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x7651ab,null))[_0xfba6('0x28')](saveUpdates(_0x7a495d['body'],null))[_0xfba6('0x28')](respondWithResult(_0x7651ab,null))[_0xfba6('0x59')](handleError(_0x7651ab,null));};exports[_0xfba6('0x29')]=function(_0xaca955,_0xf1ed1a){return db['Variable'][_0xfba6('0x4f')]({'where':{'id':_0xaca955['params']['id']}})[_0xfba6('0x28')](handleEntityNotFound(_0xf1ed1a,null))[_0xfba6('0x28')](removeEntity(_0xf1ed1a,null))[_0xfba6('0x59')](handleError(_0xf1ed1a,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index d448ed5..4ebb9de 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 _0xca85=['api','moment','bluebird','request-promise','path','../../config/environment','./variable.attributes','exports','Variable','tools_variables','util','../../config/logger'];(function(_0x319cb9,_0x4b8d35){var _0x1735fc=function(_0x43b061){while(--_0x43b061){_0x319cb9['push'](_0x319cb9['shift']());}};_0x1735fc(++_0x4b8d35);}(_0xca85,0x11e));var _0x5ca8=function(_0x1254c8,_0x34e836){_0x1254c8=_0x1254c8-0x0;var _0x4c2496=_0xca85[_0x1254c8];return _0x4c2496;};'use strict';var _=require('lodash');var util=require(_0x5ca8('0x0'));var logger=require(_0x5ca8('0x1'))(_0x5ca8('0x2'));var moment=require(_0x5ca8('0x3'));var BPromise=require(_0x5ca8('0x4'));var rp=require(_0x5ca8('0x5'));var fs=require('fs');var path=require(_0x5ca8('0x6'));var rimraf=require('rimraf');var config=require(_0x5ca8('0x7'));var attributes=require(_0x5ca8('0x8'));module[_0x5ca8('0x9')]=function(_0x318d6b,_0x39af45){return _0x318d6b['define'](_0x5ca8('0xa'),attributes,{'tableName':_0x5ca8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56c8=['exports','define','Variable','tools_variables','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x16e8a7,_0x5ce524){var _0x47e8ed=function(_0x26bb84){while(--_0x26bb84){_0x16e8a7['push'](_0x16e8a7['shift']());}};_0x47e8ed(++_0x5ce524);}(_0x56c8,0x12f));var _0x856c=function(_0x36090b,_0x6c3b56){_0x36090b=_0x36090b-0x0;var _0x1575fe=_0x56c8[_0x36090b];return _0x1575fe;};'use strict';var _=require(_0x856c('0x0'));var util=require(_0x856c('0x1'));var logger=require(_0x856c('0x2'))(_0x856c('0x3'));var moment=require('moment');var BPromise=require(_0x856c('0x4'));var rp=require(_0x856c('0x5'));var fs=require('fs');var path=require(_0x856c('0x6'));var rimraf=require(_0x856c('0x7'));var config=require(_0x856c('0x8'));var attributes=require('./variable.attributes');module[_0x856c('0x9')]=function(_0x1922f4,_0x413964){return _0x1922f4[_0x856c('0xa')](_0x856c('0xb'),attributes,{'tableName':_0x856c('0xc'),'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 e63e025..c2d7fd2 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 _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xa41a,0x6b));var _0xaa41=function(_0x102542,_0x54d549){_0x102542=_0x102542-0x0;var _0x19c54c=_0xa41a[_0x102542];return _0x19c54c;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa41a,0x6b));var _0xaa41=function(_0x3a1124,_0x1a6d16){_0x3a1124=_0x3a1124-0x0;var _0x500dfe=_0xa41a[_0x3a1124];return _0x500dfe;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 43b8db8..b3efbe0 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 _0xdc26=['/pull','pull','/restart','migrations','exports','express','../../components/auth/service','get','isAuthenticated','canUpdate','/reset','reset'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0xdc26,0x7d));var _0x6dc2=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0xdc26[_0xe4d6c6];return _0x3a8935;};'use strict';var express=require(_0x6dc2('0x0'));var router=express['Router']();var auth=require(_0x6dc2('0x1'));var controller=require('./version.controller');router['get']('/',controller['index']);router[_0x6dc2('0x2')]('/fetch',auth[_0x6dc2('0x3')](),auth[_0x6dc2('0x4')](),controller['fetch']);router[_0x6dc2('0x2')](_0x6dc2('0x5'),auth['isAuthenticated'](),auth[_0x6dc2('0x4')](),controller[_0x6dc2('0x6')]);router[_0x6dc2('0x2')](_0x6dc2('0x7'),auth[_0x6dc2('0x3')](),auth['canUpdate'](),controller[_0x6dc2('0x8')]);router[_0x6dc2('0x2')](_0x6dc2('0x9'),auth[_0x6dc2('0x3')](),controller['restart']);router[_0x6dc2('0x2')]('/migrations',controller[_0x6dc2('0xa')]);module[_0x6dc2('0xb')]=router; \ No newline at end of file +var _0x5b4e=['express','Router','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart','restart','/migrations','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5b4e,0x1ed));var _0xe5b4=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x5b4e[_0x4565bf];return _0x5610ba;};'use strict';var express=require(_0xe5b4('0x0'));var router=express[_0xe5b4('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xe5b4('0x2'));router[_0xe5b4('0x3')]('/',controller[_0xe5b4('0x4')]);router[_0xe5b4('0x3')](_0xe5b4('0x5'),auth[_0xe5b4('0x6')](),auth[_0xe5b4('0x7')](),controller[_0xe5b4('0x8')]);router[_0xe5b4('0x3')](_0xe5b4('0x9'),auth[_0xe5b4('0x6')](),auth['canUpdate'](),controller[_0xe5b4('0xa')]);router[_0xe5b4('0x3')](_0xe5b4('0xb'),auth[_0xe5b4('0x6')](),auth['canUpdate'](),controller[_0xe5b4('0xc')]);router['get'](_0xe5b4('0xd'),auth['isAuthenticated'](),controller[_0xe5b4('0xe')]);router[_0xe5b4('0x3')](_0xe5b4('0xf'),controller['migrations']);module[_0xe5b4('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 828b8b0..8061384 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 _0xa8cb=['root','length','replace','.js','push','sort','Migration','getQueryInterface','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','index','exports','query','latest','fetch','2.0.0','status','json','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join'];(function(_0xa5bf01,_0x2d508f){var _0x4166c1=function(_0x3ecfd7){while(--_0x3ecfd7){_0xa5bf01['push'](_0xa5bf01['shift']());}};_0x4166c1(++_0x2d508f);}(_0xa8cb,0xf7));var _0xba8c=function(_0x99c471,_0x2626fe){_0x99c471=_0x99c471-0x0;var _0x3d4584=_0xa8cb[_0x99c471];return _0x3d4584;};'use strict';var Umzug=require(_0xba8c('0x0'));var path=require(_0xba8c('0x1'));var fs=require('fs');var _=require(_0xba8c('0x2'));var pkginfo=require(_0xba8c('0x3'))(module,_0xba8c('0x4'));var compareVersions=require(_0xba8c('0x5'));var exec=require('child_process')[_0xba8c('0x6')];var db=require(_0xba8c('0x7'))['db'];var config=require(_0xba8c('0x8'));var pm2=require(_0xba8c('0x9'));var logger=require(_0xba8c('0xa'))(_0xba8c('0xb'));var git=require('simple-git')(config['root']);exports[_0xba8c('0xc')]=function(_0x479b2c,_0x1cf756){var _0x2371bc={'current':module[_0xba8c('0xd')][_0xba8c('0x4')],'phonebar':0x2};if(_0x479b2c[_0xba8c('0xe')]&&_0x479b2c[_0xba8c('0xe')][_0xba8c('0xf')]){return git[_0xba8c('0x10')]()['tags'](function(_0x3fce69,_0x2eae94){_0x2371bc[_0xba8c('0xf')]=(_0x3fce69?module[_0xba8c('0xd')][_0xba8c('0x4')]:_0x2eae94[_0xba8c('0xf')])||_0xba8c('0x11');return _0x1cf756[_0xba8c('0x12')](0xc8)[_0xba8c('0x13')](_0x2371bc);});}else{return _0x1cf756[_0xba8c('0x12')](0xc8)['json'](_0x2371bc);}};exports['fetch']=function(_0x1c2edb,_0x3e9015){return git['fetch'](['origin',_0xba8c('0x14')],function(_0x5f2bbb){if(_0x5f2bbb){logger[_0xba8c('0x15')](_0x5f2bbb);return _0x3e9015[_0xba8c('0x12')](0x1f4)[_0xba8c('0x13')](_0x5f2bbb);}logger[_0xba8c('0x16')]('git\x20fetch');return _0x3e9015[_0xba8c('0x12')](0xc8)[_0xba8c('0x13')]({'output':_0xba8c('0x17')});});};exports['reset']=function(_0x4c9b4c,_0x20c709){return git[_0xba8c('0x18')]([_0xba8c('0x19'),_0xba8c('0x1a')],function(_0x1e783e){if(_0x1e783e){logger[_0xba8c('0x15')](_0x1e783e);return _0x20c709[_0xba8c('0x12')](0x1f4)[_0xba8c('0x13')](_0x1e783e);}logger[_0xba8c('0x16')](_0xba8c('0x1b'));return _0x20c709['status'](0xc8)['json']({'output':_0xba8c('0x1c')});});};exports[_0xba8c('0x1d')]=function(_0x212ea7,_0x2fdfff){exec(_0xba8c('0x1e'),function(_0x3edf46,_0x2cac16,_0x4f8d66){logger['info'](_0x2cac16);logger[_0xba8c('0x16')](_0x4f8d66);if(_0x3edf46){logger[_0xba8c('0x15')](_0x3edf46);return _0x2fdfff[_0xba8c('0x12')](0x1f4)[_0xba8c('0x13')](_0x3edf46);}return _0x2fdfff['status'](0xc8)[_0xba8c('0x13')]({'output':_0x2cac16});});};exports[_0xba8c('0x1f')]=function(_0x18a574,_0x436e26){return pm2[_0xba8c('0x1f')](_0xba8c('0x20'))[_0xba8c('0x21')](function(_0x16c8f3){logger[_0xba8c('0x16')]('pm2\x20restart\x20motion\x20%s',_0x16c8f3);return _0x436e26[_0xba8c('0x12')](0xc8)[_0xba8c('0x13')]({'output':_0xba8c('0x22')});})['catch'](function(_0x1594c0){logger[_0xba8c('0x15')](_0x1594c0);return _0x436e26[_0xba8c('0x12')](0x1f4)['json'](_0x1594c0);});};exports[_0xba8c('0x23')]=function(_0x134abe,_0x37fe40){var _0xbc8a10=fs[_0xba8c('0x24')](path[_0xba8c('0x25')](config[_0xba8c('0x26')],'server',_0xba8c('0x23')));var _0x5a2ae5=[];for(var _0x413447=0x0;_0x413447<_0xbc8a10[_0xba8c('0x27')];_0x413447++){var _0x1866d2=_0xbc8a10[_0x413447][_0xba8c('0x28')](_0xba8c('0x29'),'');if(compareVersions(module[_0xba8c('0xd')][_0xba8c('0x4')],_0x1866d2)===-0x1){_0x5a2ae5[_0xba8c('0x2a')](_0x1866d2);}}if(_0x5a2ae5[_0xba8c('0x27')]){var _0x219745=_0x5a2ae5[_0xba8c('0x2b')](compareVersions);var _0x301b3c=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0xba8c('0x2c'),'columnName':_0xba8c('0x4')},'migrations':{'params':[db['sequelize'][_0xba8c('0x2d')](),db[_0xba8c('0x2e')][_0xba8c('0x2f')],function(){throw new Error(_0xba8c('0x30'));}],'path':path['join'](config[_0xba8c('0x26')],_0xba8c('0x31'),'migrations'),'pattern':/\.js$/}});_0x301b3c['up']({'migrations':_[_0xba8c('0x32')](_0x219745,function(_0x56fa7f){return _0x56fa7f+'.js';})})[_0xba8c('0x21')](function(){return _0x37fe40[_0xba8c('0x12')](0xc8)[_0xba8c('0x13')]({'output':_0xba8c('0x33')+module[_0xba8c('0xd')][_0xba8c('0x4')]+_0xba8c('0x34')+_[_0xba8c('0x35')](_0x219745),'migrations':_['join'](_0x219745)});})[_0xba8c('0x36')](function(_0x3934be){if(_0x3934be instanceof db[_0xba8c('0x2e')][_0xba8c('0x37')]){return _0x37fe40[_0xba8c('0x12')](0xc8)['json']({'output':_0xba8c('0x38')});}else{return _0x37fe40['status'](0x1f4)[_0xba8c('0x13')](_0x3934be);}});}else{return _0x37fe40[_0xba8c('0x12')](0xc8)['json']({'output':_0xba8c('0x38')});}}; \ No newline at end of file +var _0x7a2c=['push','sort','Migration','getQueryInterface','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','.js','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','simple-git','root','index','latest','fetch','tags','2.0.0','status','json','master','error','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','exports'];(function(_0x448255,_0x2e681d){var _0x55d7ec=function(_0x52434e){while(--_0x52434e){_0x448255['push'](_0x448255['shift']());}};_0x55d7ec(++_0x2e681d);}(_0x7a2c,0x14d));var _0xc7a2=function(_0x1632ac,_0x541d68){_0x1632ac=_0x1632ac-0x0;var _0x3a4d4b=_0x7a2c[_0x1632ac];return _0x3a4d4b;};'use strict';var Umzug=require('umzug');var path=require(_0xc7a2('0x0'));var fs=require('fs');var _=require(_0xc7a2('0x1'));var pkginfo=require(_0xc7a2('0x2'))(module,_0xc7a2('0x3'));var compareVersions=require(_0xc7a2('0x4'));var exec=require(_0xc7a2('0x5'))[_0xc7a2('0x6')];var db=require(_0xc7a2('0x7'))['db'];var config=require(_0xc7a2('0x8'));var pm2=require(_0xc7a2('0x9'));var logger=require('../../config/logger')('update');var git=require(_0xc7a2('0xa'))(config[_0xc7a2('0xb')]);exports[_0xc7a2('0xc')]=function(_0x580ea8,_0x5c93a0){var _0x418277={'current':module['exports']['version'],'phonebar':0x2};if(_0x580ea8['query']&&_0x580ea8['query'][_0xc7a2('0xd')]){return git[_0xc7a2('0xe')]()[_0xc7a2('0xf')](function(_0x10aa07,_0x1b2a92){_0x418277[_0xc7a2('0xd')]=(_0x10aa07?module['exports']['version']:_0x1b2a92[_0xc7a2('0xd')])||_0xc7a2('0x10');return _0x5c93a0[_0xc7a2('0x11')](0xc8)[_0xc7a2('0x12')](_0x418277);});}else{return _0x5c93a0['status'](0xc8)[_0xc7a2('0x12')](_0x418277);}};exports['fetch']=function(_0x3ef2e1,_0x5d99d1){return git[_0xc7a2('0xe')](['origin',_0xc7a2('0x13')],function(_0x2db6a3){if(_0x2db6a3){logger[_0xc7a2('0x14')](_0x2db6a3);return _0x5d99d1['status'](0x1f4)['json'](_0x2db6a3);}logger['info']('git\x20fetch');return _0x5d99d1[_0xc7a2('0x11')](0xc8)['json']({'output':_0xc7a2('0x15')});});};exports[_0xc7a2('0x16')]=function(_0x548e39,_0x54049b){return git[_0xc7a2('0x16')]([_0xc7a2('0x17'),_0xc7a2('0x18')],function(_0x5af396){if(_0x5af396){logger[_0xc7a2('0x14')](_0x5af396);return _0x54049b[_0xc7a2('0x11')](0x1f4)['json'](_0x5af396);}logger[_0xc7a2('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x54049b[_0xc7a2('0x11')](0xc8)[_0xc7a2('0x12')]({'output':_0xc7a2('0x1a')});});};exports[_0xc7a2('0x1b')]=function(_0x5c4b6d,_0x2a8824){exec(_0xc7a2('0x1c'),function(_0x50066b,_0x3cd2f0,_0x30fbeb){logger[_0xc7a2('0x19')](_0x3cd2f0);logger[_0xc7a2('0x19')](_0x30fbeb);if(_0x50066b){logger[_0xc7a2('0x14')](_0x50066b);return _0x2a8824[_0xc7a2('0x11')](0x1f4)[_0xc7a2('0x12')](_0x50066b);}return _0x2a8824['status'](0xc8)[_0xc7a2('0x12')]({'output':_0x3cd2f0});});};exports[_0xc7a2('0x1d')]=function(_0x3edacd,_0x505eae){return pm2[_0xc7a2('0x1d')](_0xc7a2('0x1e'))['then'](function(_0x2d9747){logger['info'](_0xc7a2('0x1f'),_0x2d9747);return _0x505eae[_0xc7a2('0x11')](0xc8)[_0xc7a2('0x12')]({'output':_0xc7a2('0x20')});})[_0xc7a2('0x21')](function(_0x46b674){logger['error'](_0x46b674);return _0x505eae[_0xc7a2('0x11')](0x1f4)[_0xc7a2('0x12')](_0x46b674);});};exports[_0xc7a2('0x22')]=function(_0x1b7145,_0x1ba8b2){var _0x1b57db=fs[_0xc7a2('0x23')](path['join'](config['root'],_0xc7a2('0x24'),_0xc7a2('0x22')));var _0x231abc=[];for(var _0x46ded7=0x0;_0x46ded7<_0x1b57db['length'];_0x46ded7++){var _0x1706a6=_0x1b57db[_0x46ded7]['replace']('.js','');if(compareVersions(module[_0xc7a2('0x25')][_0xc7a2('0x3')],_0x1706a6)===-0x1){_0x231abc[_0xc7a2('0x26')](_0x1706a6);}}if(_0x231abc['length']){var _0x13ff07=_0x231abc[_0xc7a2('0x27')](compareVersions);var _0xcdbd41=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xc7a2('0x28')],'modelName':_0xc7a2('0x28'),'columnName':_0xc7a2('0x3')},'migrations':{'params':[db['sequelize'][_0xc7a2('0x29')](),db[_0xc7a2('0x2a')][_0xc7a2('0x2b')],function(){throw new Error(_0xc7a2('0x2c'));}],'path':path[_0xc7a2('0x2d')](config[_0xc7a2('0xb')],'server',_0xc7a2('0x22')),'pattern':/\.js$/}});_0xcdbd41['up']({'migrations':_[_0xc7a2('0x2e')](_0x13ff07,function(_0x4f319a){return _0x4f319a+_0xc7a2('0x2f');})})[_0xc7a2('0x30')](function(){return _0x1ba8b2['status'](0xc8)[_0xc7a2('0x12')]({'output':_0xc7a2('0x31')+module['exports'][_0xc7a2('0x3')]+_0xc7a2('0x32')+_['last'](_0x13ff07),'migrations':_[_0xc7a2('0x2d')](_0x13ff07)});})['catch'](function(_0x3528d6){if(_0x3528d6 instanceof db[_0xc7a2('0x2a')][_0xc7a2('0x33')]){return _0x1ba8b2['status'](0xc8)[_0xc7a2('0x12')]({'output':_0xc7a2('0x34')});}else{return _0x1ba8b2[_0xc7a2('0x11')](0x1f4)['json'](_0x3528d6);}});}else{return _0x1ba8b2[_0xc7a2('0x11')](0xc8)[_0xc7a2('0x12')]({'output':_0xc7a2('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 84da216..7c8e300 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 _0x9538=['get','isAuthenticated','index','/describe','describe','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x38e3ec,_0x4afa07){var _0x361ef2=function(_0x5a2af4){while(--_0x5a2af4){_0x38e3ec['push'](_0x38e3ec['shift']());}};_0x361ef2(++_0x4afa07);}(_0x9538,0x7b));var _0x8953=function(_0xfb4572,_0x27c2c3){_0xfb4572=_0xfb4572-0x0;var _0x21a1b7=_0x9538[_0xfb4572];return _0x21a1b7;};'use strict';var multer=require(_0x8953('0x0'));var util=require('util');var path=require(_0x8953('0x1'));var timeout=require(_0x8953('0x2'));var express=require(_0x8953('0x3'));var router=express[_0x8953('0x4')]();var fs_extra=require(_0x8953('0x5'));var auth=require(_0x8953('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8953('0x7'));var controller=require(_0x8953('0x8'));router[_0x8953('0x9')]('/',auth[_0x8953('0xa')](),controller[_0x8953('0xb')]);router[_0x8953('0x9')](_0x8953('0xc'),auth[_0x8953('0xa')](),controller[_0x8953('0xd')]);router['get']('/:id',auth[_0x8953('0xa')](),controller['show']);router[_0x8953('0xe')]('/',auth[_0x8953('0xa')](),controller[_0x8953('0xf')]);router[_0x8953('0x10')]('/:id',auth[_0x8953('0xa')](),controller[_0x8953('0x11')]);router[_0x8953('0x12')](_0x8953('0x13'),auth[_0x8953('0xa')](),controller[_0x8953('0x14')]);module[_0x8953('0x15')]=router; \ No newline at end of file +var _0xa700=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get'];(function(_0x421a74,_0x592a57){var _0x4dde2e=function(_0x393651){while(--_0x393651){_0x421a74['push'](_0x421a74['shift']());}};_0x4dde2e(++_0x592a57);}(_0xa700,0x1ba));var _0x0a70=function(_0x276221,_0x378da4){_0x276221=_0x276221-0x0;var _0x4fa716=_0xa700[_0x276221];return _0x4fa716;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0a70('0x0'));var timeout=require('connect-timeout');var express=require(_0x0a70('0x1'));var router=express[_0x0a70('0x2')]();var fs_extra=require(_0x0a70('0x3'));var auth=require(_0x0a70('0x4'));var interaction=require(_0x0a70('0x5'));var config=require('../../config/environment');var controller=require(_0x0a70('0x6'));router[_0x0a70('0x7')]('/',auth[_0x0a70('0x8')](),controller[_0x0a70('0x9')]);router[_0x0a70('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x0a70('0x7')](_0x0a70('0xa'),auth[_0x0a70('0x8')](),controller[_0x0a70('0xb')]);router[_0x0a70('0xc')]('/',auth[_0x0a70('0x8')](),controller[_0x0a70('0xd')]);router[_0x0a70('0xe')](_0x0a70('0xa'),auth[_0x0a70('0x8')](),controller['update']);router[_0x0a70('0xf')](_0x0a70('0xa'),auth[_0x0a70('0x8')](),controller[_0x0a70('0x10')]);module[_0x0a70('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 002115c..e9154cf 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 _0xf7d9=['BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x43df22,_0x35b5cc){var _0xb36577=function(_0x5bc085){while(--_0x5bc085){_0x43df22['push'](_0x43df22['shift']());}};_0xb36577(++_0x35b5cc);}(_0xf7d9,0x122));var _0x9f7d=function(_0x5ce88d,_0x30f5c8){_0x5ce88d=_0x5ce88d-0x0;var _0x221a0e=_0xf7d9[_0x5ce88d];return _0x221a0e;};'use strict';var Sequelize=require(_0x9f7d('0x0'));module[_0x9f7d('0x1')]={'type':{'type':Sequelize[_0x9f7d('0x2')]},'uniqueid':{'type':Sequelize[_0x9f7d('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9f7d('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9f7d('0x2')]},'agentcalledAt':{'type':Sequelize[_0x9f7d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x9f7d('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x9f7d('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x9f7d('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x9f7d('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9f7d('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9f7d('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9f7d('0x5')]},'agentacw':{'type':Sequelize[_0x9f7d('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9f7d('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x9f7d('0x2')]},'channel':{'type':Sequelize[_0x9f7d('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9f7d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9f7d('0x2')]},'connectedlinename':{'type':Sequelize[_0x9f7d('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9f7d('0x2')]},'context':{'type':Sequelize[_0x9f7d('0x2')]},'exten':{'type':Sequelize[_0x9f7d('0x2')]},'priority':{'type':Sequelize[_0x9f7d('0x2')]},'destchannel':{'type':Sequelize[_0x9f7d('0x2')]},'destchannelstate':{'type':Sequelize[_0x9f7d('0x5')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x9f7d('0x2')]},'destcalleridname':{'type':Sequelize[_0x9f7d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9f7d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x9f7d('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x9f7d('0x2')]},'destcontext':{'type':Sequelize[_0x9f7d('0x2')]},'destexten':{'type':Sequelize[_0x9f7d('0x2')]},'destpriority':{'type':Sequelize[_0x9f7d('0x2')]},'destuniqueid':{'type':Sequelize[_0x9f7d('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9f7d('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x9f7d('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9f7d('0x6')},'transferexten':{'type':Sequelize[_0x9f7d('0x2')]},'transferuniqueid':{'type':Sequelize[_0x9f7d('0x2')]},'agententerreason':{'type':Sequelize[_0x9f7d('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x536f=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x4bebb3,_0x4c1796){var _0x3421de=function(_0x4a17f6){while(--_0x4a17f6){_0x4bebb3['push'](_0x4bebb3['shift']());}};_0x3421de(++_0x4c1796);}(_0x536f,0x70));var _0xf536=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x536f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf536('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf536('0x1')]},'queue':{'type':Sequelize[_0xf536('0x1')]},'interface':{'type':Sequelize[_0xf536('0x1')]},'membername':{'type':Sequelize[_0xf536('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xf536('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xf536('0x2')]},'agentdumpAt':{'type':Sequelize[_0xf536('0x2')]},'holdtime':{'type':Sequelize[_0xf536('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xf536('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xf536('0x3')]},'agentacw':{'type':Sequelize[_0xf536('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf536('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf536('0x1')]},'channelstate':{'type':Sequelize[_0xf536('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xf536('0x1')]},'language':{'type':Sequelize[_0xf536('0x1')]},'accountcode':{'type':Sequelize[_0xf536('0x1')]},'context':{'type':Sequelize[_0xf536('0x1')]},'exten':{'type':Sequelize[_0xf536('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf536('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf536('0x1')]},'destcalleridnum':{'type':Sequelize[_0xf536('0x1')]},'destcalleridname':{'type':Sequelize[_0xf536('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xf536('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xf536('0x1')]},'destlanguage':{'type':Sequelize[_0xf536('0x1')]},'destaccountcode':{'type':Sequelize[_0xf536('0x1')]},'destcontext':{'type':Sequelize[_0xf536('0x1')]},'destexten':{'type':Sequelize[_0xf536('0x1')]},'destpriority':{'type':Sequelize[_0xf536('0x1')]},'destuniqueid':{'type':Sequelize[_0xf536('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xf536('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xf536('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xf536('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xf536('0x1')]},'agententerreason':{'type':Sequelize[_0xf536('0x3')],'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 212c3f4..7177bec 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 ef71383..5eb8b2b 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 _0x5b20=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0x5b20,0x86));var _0x05b2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5b20[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x05b2('0x0'));var util=require(_0x05b2('0x1'));var logger=require(_0x05b2('0x2'))(_0x05b2('0x3'));var moment=require(_0x05b2('0x4'));var BPromise=require(_0x05b2('0x5'));var rp=require(_0x05b2('0x6'));var fs=require('fs');var path=require(_0x05b2('0x7'));var rimraf=require(_0x05b2('0x8'));var config=require(_0x05b2('0x9'));var attributes=require(_0x05b2('0xa'));module['exports']=function(_0x22e0e2,_0x83fd18){return _0x22e0e2['define'](_0x05b2('0xb'),attributes,{'tableName':_0x05b2('0xc'),'paranoid':![],'indexes':[{'fields':[_0x05b2('0xd'),_0x05b2('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x60c2=['rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x395489,_0x193cfb){var _0xa97b0f=function(_0x2a3980){while(--_0x2a3980){_0x395489['push'](_0x395489['shift']());}};_0xa97b0f(++_0x193cfb);}(_0x60c2,0x8f));var _0x260c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x60c2[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x260c('0x0'));var logger=require(_0x260c('0x1'))(_0x260c('0x2'));var moment=require(_0x260c('0x3'));var BPromise=require(_0x260c('0x4'));var rp=require(_0x260c('0x5'));var fs=require('fs');var path=require(_0x260c('0x6'));var rimraf=require(_0x260c('0x7'));var config=require(_0x260c('0x8'));var attributes=require(_0x260c('0x9'));module[_0x260c('0xa')]=function(_0x13c7d0,_0x558b0c){return _0x13c7d0[_0x260c('0xb')](_0x260c('0xc'),attributes,{'tableName':_0x260c('0xd'),'paranoid':![],'indexes':[{'fields':[_0x260c('0xe'),'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 ee15b4c..b2ba2c1 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 _0x70ee=['info','stringify','UpdateVoiceAgentReport','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw'];(function(_0x54230b,_0x23f348){var _0x41371a=function(_0x526c8a){while(--_0x526c8a){_0x54230b['push'](_0x54230b['shift']());}};_0x41371a(++_0x23f348);}(_0x70ee,0x1c1));var _0xe70e=function(_0x48b7b3,_0x17a16e){_0x48b7b3=_0x48b7b3-0x0;var _0x4afb77=_0x70ee[_0x48b7b3];return _0x4afb77;};'use strict';var _=require(_0xe70e('0x0'));var util=require(_0xe70e('0x1'));var moment=require(_0xe70e('0x2'));var BPromise=require(_0xe70e('0x3'));var rs=require(_0xe70e('0x4'));var fs=require('fs');var Redis=require(_0xe70e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe70e('0x6'));var logger=require(_0xe70e('0x7'))(_0xe70e('0x8'));var config=require('../../config/environment');var jayson=require(_0xe70e('0x9'));var client=jayson[_0xe70e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e51e2,_0x2c910f,_0x19fa4b){return new BPromise(function(_0x59dbb4,_0x188286){return client[_0xe70e('0xb')](_0x4e51e2,_0x19fa4b)['then'](function(_0x36914b){logger['info'](_0xe70e('0xc'),_0x2c910f,_0xe70e('0xd'));logger[_0xe70e('0xe')](_0xe70e('0xf'),_0x2c910f,_0xe70e('0xd'),JSON['stringify'](_0x36914b));if(_0x36914b[_0xe70e('0x10')]){if(_0x36914b['error'][_0xe70e('0x11')]===0x1f4){logger[_0xe70e('0x10')](_0xe70e('0xc'),_0x2c910f,_0x36914b[_0xe70e('0x10')]['message']);return _0x188286(_0x36914b[_0xe70e('0x10')]['message']);}logger[_0xe70e('0x10')](_0xe70e('0xc'),_0x2c910f,_0x36914b[_0xe70e('0x10')][_0xe70e('0x12')]);return _0x59dbb4(_0x36914b[_0xe70e('0x10')][_0xe70e('0x12')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x2c910f,_0xe70e('0xd'));_0x59dbb4(_0x36914b[_0xe70e('0x13')]['message']);}})[_0xe70e('0x14')](function(_0x3a3ec9){logger[_0xe70e('0x10')](_0xe70e('0xc'),_0x2c910f,_0x3a3ec9);_0x188286(_0x3a3ec9);});});}exports[_0xe70e('0x15')]=function(_0x4d79c2){var _0x5a2ad4=this;return new Promise(function(_0x51985a,_0x4549cd){return db[_0xe70e('0x16')][_0xe70e('0x17')](_0x4d79c2[_0xe70e('0x18')],{'raw':_0x4d79c2[_0xe70e('0x19')]?_0x4d79c2[_0xe70e('0x19')][_0xe70e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x22f346){logger[_0xe70e('0x1b')](_0xe70e('0x15'),_0x4d79c2);logger[_0xe70e('0xe')](_0xe70e('0x15'),_0x4d79c2,JSON[_0xe70e('0x1c')](_0x22f346));_0x51985a(_0x22f346);})[_0xe70e('0x14')](function(_0x46d278){logger['error'](_0xe70e('0x15'),_0x46d278[_0xe70e('0x12')],_0x4d79c2);_0x4549cd(_0x5a2ad4[_0xe70e('0x10')](0x1f4,_0x46d278[_0xe70e('0x12')]));});});};exports[_0xe70e('0x1d')]=function(_0x1e2aef){var _0x2f444b=this;return new Promise(function(_0x42e0fe,_0x374c03){return db[_0xe70e('0x16')]['update'](_0x1e2aef[_0xe70e('0x18')],{'raw':_0x1e2aef[_0xe70e('0x19')]?_0x1e2aef[_0xe70e('0x19')][_0xe70e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e2aef[_0xe70e('0x19')]?_0x1e2aef[_0xe70e('0x19')][_0xe70e('0x1e')]||null:null,'attributes':_0x1e2aef[_0xe70e('0x19')]?_0x1e2aef[_0xe70e('0x19')][_0xe70e('0x1f')]||null:null,'limit':_0x1e2aef[_0xe70e('0x19')]?_0x1e2aef[_0xe70e('0x19')][_0xe70e('0x20')]||null:null})[_0xe70e('0x21')](function(_0x4fda38){logger[_0xe70e('0x1b')](_0xe70e('0x1d'),_0x1e2aef);logger[_0xe70e('0xe')](_0xe70e('0x1d'),_0x1e2aef,JSON[_0xe70e('0x1c')](_0x4fda38));_0x42e0fe(_0x4fda38);})['catch'](function(_0x14eebf){logger['error'](_0xe70e('0x1d'),_0x14eebf[_0xe70e('0x12')],_0x1e2aef);_0x374c03(_0x2f444b[_0xe70e('0x10')](0x1f4,_0x14eebf[_0xe70e('0x12')]));});});}; \ No newline at end of file +var _0xf201=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','VoiceAgentReport','create','options','then','CreateVoiceAgentReport','debug','catch','UpdateVoiceAgentReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x207b8c,_0x255b28){var _0xe485f1=function(_0x777447){while(--_0x777447){_0x207b8c['push'](_0x207b8c['shift']());}};_0xe485f1(++_0x255b28);}(_0xf201,0x192));var _0x1f20=function(_0x5e1cd1,_0x21ff05){_0x5e1cd1=_0x5e1cd1-0x0;var _0x3a65be=_0xf201[_0x5e1cd1];return _0x3a65be;};'use strict';var _=require(_0x1f20('0x0'));var util=require(_0x1f20('0x1'));var moment=require(_0x1f20('0x2'));var BPromise=require(_0x1f20('0x3'));var rs=require(_0x1f20('0x4'));var fs=require('fs');var Redis=require(_0x1f20('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f20('0x6'));var logger=require('../../config/logger')(_0x1f20('0x7'));var config=require(_0x1f20('0x8'));var jayson=require(_0x1f20('0x9'));var client=jayson[_0x1f20('0xa')][_0x1f20('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x485549,_0x543f16,_0x49af2a){return new BPromise(function(_0x4ea786,_0x209ade){return client[_0x1f20('0xc')](_0x485549,_0x49af2a)['then'](function(_0x29e491){logger[_0x1f20('0xd')](_0x1f20('0xe'),_0x543f16,_0x1f20('0xf'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x543f16,'request\x20sent',JSON[_0x1f20('0x10')](_0x29e491));if(_0x29e491['error']){if(_0x29e491[_0x1f20('0x11')][_0x1f20('0x12')]===0x1f4){logger[_0x1f20('0x11')](_0x1f20('0xe'),_0x543f16,_0x29e491[_0x1f20('0x11')][_0x1f20('0x13')]);return _0x209ade(_0x29e491[_0x1f20('0x11')]['message']);}logger[_0x1f20('0x11')](_0x1f20('0xe'),_0x543f16,_0x29e491[_0x1f20('0x11')][_0x1f20('0x13')]);return _0x4ea786(_0x29e491[_0x1f20('0x11')][_0x1f20('0x13')]);}else{logger['info'](_0x1f20('0xe'),_0x543f16,'request\x20sent');_0x4ea786(_0x29e491[_0x1f20('0x14')]['message']);}})['catch'](function(_0x4c2546){logger[_0x1f20('0x11')](_0x1f20('0xe'),_0x543f16,_0x4c2546);_0x209ade(_0x4c2546);});});}exports['CreateVoiceAgentReport']=function(_0x14cfb1){var _0x3d782d=this;return new Promise(function(_0x1b50f0,_0x1a13df){return db[_0x1f20('0x15')][_0x1f20('0x16')](_0x14cfb1['body'],{'raw':_0x14cfb1[_0x1f20('0x17')]?_0x14cfb1[_0x1f20('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x1f20('0x18')](function(_0x13bd98){logger[_0x1f20('0xd')](_0x1f20('0x19'),_0x14cfb1);logger[_0x1f20('0x1a')](_0x1f20('0x19'),_0x14cfb1,JSON[_0x1f20('0x10')](_0x13bd98));_0x1b50f0(_0x13bd98);})[_0x1f20('0x1b')](function(_0x23966f){logger[_0x1f20('0x11')](_0x1f20('0x19'),_0x23966f['message'],_0x14cfb1);_0x1a13df(_0x3d782d[_0x1f20('0x11')](0x1f4,_0x23966f[_0x1f20('0x13')]));});});};exports[_0x1f20('0x1c')]=function(_0x41f358){var _0xfebdbf=this;return new Promise(function(_0x2b2ea2,_0x145468){return db[_0x1f20('0x15')][_0x1f20('0x1d')](_0x41f358['body'],{'raw':_0x41f358['options']?_0x41f358[_0x1f20('0x17')][_0x1f20('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41f358[_0x1f20('0x17')]?_0x41f358[_0x1f20('0x17')][_0x1f20('0x1f')]||null:null,'attributes':_0x41f358[_0x1f20('0x17')]?_0x41f358['options'][_0x1f20('0x20')]||null:null,'limit':_0x41f358[_0x1f20('0x17')]?_0x41f358[_0x1f20('0x17')][_0x1f20('0x21')]||null:null})[_0x1f20('0x18')](function(_0x344d57){logger['info']('UpdateVoiceAgentReport',_0x41f358);logger[_0x1f20('0x1a')](_0x1f20('0x1c'),_0x41f358,JSON[_0x1f20('0x10')](_0x344d57));_0x2b2ea2(_0x344d57);})[_0x1f20('0x1b')](function(_0x328e55){logger[_0x1f20('0x11')](_0x1f20('0x1c'),_0x328e55[_0x1f20('0x13')],_0x41f358);_0x145468(_0xfebdbf[_0x1f20('0x11')](0x1f4,_0x328e55['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 35af7a2..c918f96 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 _0xd67b=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy'];(function(_0x51e4f9,_0x2d18b3){var _0x297530=function(_0x421d1e){while(--_0x421d1e){_0x51e4f9['push'](_0x51e4f9['shift']());}};_0x297530(++_0x2d18b3);}(_0xd67b,0x133));var _0xbd67=function(_0x6eb97a,_0x1cc009){_0x6eb97a=_0x6eb97a-0x0;var _0x54fd33=_0xd67b[_0x6eb97a];return _0x54fd33;};'use strict';var multer=require('multer');var util=require(_0xbd67('0x0'));var path=require('path');var timeout=require(_0xbd67('0x1'));var express=require(_0xbd67('0x2'));var router=express[_0xbd67('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbd67('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbd67('0x5'));var controller=require('./voiceCallReport.controller');router[_0xbd67('0x6')]('/',auth[_0xbd67('0x7')](),controller[_0xbd67('0x8')]);router[_0xbd67('0x6')](_0xbd67('0x9'),auth[_0xbd67('0x7')](),controller[_0xbd67('0xa')]);router[_0xbd67('0x6')](_0xbd67('0xb'),auth[_0xbd67('0x7')](),controller[_0xbd67('0xc')]);router[_0xbd67('0xd')]('/',auth[_0xbd67('0x7')](),controller['create']);router['put'](_0xbd67('0xb'),auth['isAuthenticated'](),controller[_0xbd67('0xe')]);router[_0xbd67('0xf')](_0xbd67('0xb'),auth[_0xbd67('0x7')](),controller[_0xbd67('0x10')]);module[_0xbd67('0x11')]=router; \ No newline at end of file +var _0x885a=['describe','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0x885a,0x180));var _0xa885=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x885a[_0x1cc8fe];return _0x230054;};'use strict';var multer=require('multer');var util=require(_0xa885('0x0'));var path=require(_0xa885('0x1'));var timeout=require(_0xa885('0x2'));var express=require(_0xa885('0x3'));var router=express['Router']();var fs_extra=require(_0xa885('0x4'));var auth=require(_0xa885('0x5'));var interaction=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var controller=require(_0xa885('0x8'));router[_0xa885('0x9')]('/',auth['isAuthenticated'](),controller[_0xa885('0xa')]);router[_0xa885('0x9')](_0xa885('0xb'),auth['isAuthenticated'](),controller[_0xa885('0xc')]);router[_0xa885('0x9')](_0xa885('0xd'),auth['isAuthenticated'](),controller[_0xa885('0xe')]);router[_0xa885('0xf')]('/',auth[_0xa885('0x10')](),controller[_0xa885('0x11')]);router[_0xa885('0x12')](_0xa885('0xd'),auth[_0xa885('0x10')](),controller['update']);router[_0xa885('0x13')](_0xa885('0xd'),auth[_0xa885('0x10')](),controller[_0xa885('0x14')]);module[_0xa885('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index e43f41c..2934225 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 _0xdb9a=['STRING','inbound','internal','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0xdb9a,0xce));var _0xadb9=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xdb9a[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xadb9('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xadb9('0x1')]},'type':{'type':Sequelize['ENUM'](_0xadb9('0x2'),_0xadb9('0x3'),'outbound','inbound-fax',_0xadb9('0x4'),_0xadb9('0x5'))},'tag':{'type':Sequelize[_0xadb9('0x1')]},'accountcode':{'type':Sequelize[_0xadb9('0x1')]},'source':{'type':Sequelize[_0xadb9('0x1')]},'destination':{'type':Sequelize[_0xadb9('0x1')]},'destinationcontext':{'type':Sequelize[_0xadb9('0x1')]},'callerid':{'type':Sequelize[_0xadb9('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xadb9('0x1')]},'lastapplication':{'type':Sequelize[_0xadb9('0x1')]},'lastdata':{'type':Sequelize[_0xadb9('0x6')]},'starttime':{'type':Sequelize[_0xadb9('0x7')]},'systemanswertime':{'type':Sequelize[_0xadb9('0x7')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xadb9('0x7')]},'duration':{'type':Sequelize[_0xadb9('0x8')]},'billableseconds':{'type':Sequelize[_0xadb9('0x8')]},'mohtime':{'type':Sequelize[_0xadb9('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xadb9('0x1')]},'amaflags':{'type':Sequelize[_0xadb9('0x1')]},'userfield':{'type':Sequelize[_0xadb9('0x1')]},'userDisposition':{'type':Sequelize[_0xadb9('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xadb9('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xadb9('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xadb9('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xadb9('0x1')]}}; \ No newline at end of file +var _0x38bd=['INTEGER','exports','STRING','ENUM','inbound','inbound-fax','dialer','TEXT','DATE'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x38bd,0x6d));var _0xd38b=function(_0x355904,_0x523f98){_0x355904=_0x355904-0x0;var _0x2e43f6=_0x38bd[_0x355904];return _0x2e43f6;};'use strict';var Sequelize=require('sequelize');module[_0xd38b('0x0')]={'uniqueid':{'type':Sequelize[_0xd38b('0x1')]},'type':{'type':Sequelize[_0xd38b('0x2')](_0xd38b('0x3'),'internal','outbound',_0xd38b('0x4'),'outbound-fax',_0xd38b('0x5'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xd38b('0x1')]},'destination':{'type':Sequelize[_0xd38b('0x1')]},'destinationcontext':{'type':Sequelize[_0xd38b('0x1')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd38b('0x1')]},'destinationchannel':{'type':Sequelize[_0xd38b('0x1')]},'lastapplication':{'type':Sequelize[_0xd38b('0x1')]},'lastdata':{'type':Sequelize[_0xd38b('0x6')]},'starttime':{'type':Sequelize[_0xd38b('0x7')]},'systemanswertime':{'type':Sequelize[_0xd38b('0x7')]},'answertime':{'type':Sequelize[_0xd38b('0x7')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xd38b('0x8')]},'billableseconds':{'type':Sequelize[_0xd38b('0x8')]},'mohtime':{'type':Sequelize[_0xd38b('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd38b('0x1')]},'amaflags':{'type':Sequelize[_0xd38b('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xd38b('0x1')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xd38b('0x1')]},'note':{'type':Sequelize[_0xd38b('0x1')]},'prefix':{'type':Sequelize[_0xd38b('0x1')]},'routeid':{'type':Sequelize[_0xd38b('0x8')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 2cdd264..ff80bb3 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 _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(_0x219fa0,_0x18b239){var _0xc603fb=function(_0x3371ad){while(--_0x3371ad){_0x219fa0['push'](_0x219fa0['shift']());}};_0xc603fb(++_0x18b239);}(_0xadb5,0xad));var _0x5adb=function(_0xa54986,_0x15005a){_0xa54986=_0xa54986-0x0;var _0x2659d=_0xadb5[_0xa54986];return _0x2659d;};'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 +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x2ef3,0xba));var _0x32ef=function(_0x21373a,_0x346a46){_0x21373a=_0x21373a-0x0;var _0x223390=_0x2ef3[_0x21373a];return _0x223390;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 5f87d3b..ae12abe 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 _0x4ca0=['report_call','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport'];(function(_0x4e42cf,_0x5eac7c){var _0x1a1700=function(_0x4210cc){while(--_0x4210cc){_0x4e42cf['push'](_0x4e42cf['shift']());}};_0x1a1700(++_0x5eac7c);}(_0x4ca0,0x1c1));var _0x04ca=function(_0x2a9548,_0x2742f6){_0x2a9548=_0x2a9548-0x0;var _0xf55c55=_0x4ca0[_0x2a9548];return _0xf55c55;};'use strict';var _=require(_0x04ca('0x0'));var util=require(_0x04ca('0x1'));var logger=require(_0x04ca('0x2'))('api');var moment=require(_0x04ca('0x3'));var BPromise=require(_0x04ca('0x4'));var rp=require(_0x04ca('0x5'));var fs=require('fs');var path=require(_0x04ca('0x6'));var rimraf=require(_0x04ca('0x7'));var config=require(_0x04ca('0x8'));var attributes=require(_0x04ca('0x9'));module[_0x04ca('0xa')]=function(_0x32c73b,_0x338dd6){return _0x32c73b[_0x04ca('0xb')](_0x04ca('0xc'),attributes,{'tableName':_0x04ca('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xff4b=['../../config/logger','moment','request-promise','path','rimraf','define','uniqueid','lodash'];(function(_0x314079,_0x5473ff){var _0x1f1ece=function(_0x4d8161){while(--_0x4d8161){_0x314079['push'](_0x314079['shift']());}};_0x1f1ece(++_0x5473ff);}(_0xff4b,0x6f));var _0xbff4=function(_0x4983bd,_0x2bf81f){_0x4983bd=_0x4983bd-0x0;var _0x5c1067=_0xff4b[_0x4983bd];return _0x5c1067;};'use strict';var _=require(_0xbff4('0x0'));var util=require('util');var logger=require(_0xbff4('0x1'))('api');var moment=require(_0xbff4('0x2'));var BPromise=require('bluebird');var rp=require(_0xbff4('0x3'));var fs=require('fs');var path=require(_0xbff4('0x4'));var rimraf=require(_0xbff4('0x5'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x179935,_0x58e50c){return _0x179935[_0xbff4('0x6')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xbff4('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index aca781c..587765c 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 _0x4e0e=['ioredis','../../mysqldb','rpc','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','where','limit','include','map','model','attributes','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','util','moment','bluebird'];(function(_0x43aeff,_0x892cd2){var _0x122212=function(_0x305c2a){while(--_0x305c2a){_0x43aeff['push'](_0x43aeff['shift']());}};_0x122212(++_0x892cd2);}(_0x4e0e,0x147));var _0xe4e0=function(_0x1f3ed0,_0x4ea192){_0x1f3ed0=_0x1f3ed0-0x0;var _0x507358=_0x4e0e[_0x1f3ed0];return _0x507358;};'use strict';var _=require('lodash');var util=require(_0xe4e0('0x0'));var moment=require(_0xe4e0('0x1'));var BPromise=require(_0xe4e0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4e0('0x3'));var db=require(_0xe4e0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe4e0('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe4e0('0x6')][_0xe4e0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x439250,_0x471334,_0x516035){return new BPromise(function(_0x1484b2,_0x5d79c0){return client[_0xe4e0('0x8')](_0x439250,_0x516035)[_0xe4e0('0x9')](function(_0x48aedd){logger[_0xe4e0('0xa')](_0xe4e0('0xb'),_0x471334,_0xe4e0('0xc'));logger[_0xe4e0('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x471334,'request\x20sent',JSON[_0xe4e0('0xe')](_0x48aedd));if(_0x48aedd[_0xe4e0('0xf')]){if(_0x48aedd['error']['code']===0x1f4){logger[_0xe4e0('0xf')](_0xe4e0('0xb'),_0x471334,_0x48aedd[_0xe4e0('0xf')]['message']);return _0x5d79c0(_0x48aedd[_0xe4e0('0xf')][_0xe4e0('0x10')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x471334,_0x48aedd[_0xe4e0('0xf')]['message']);return _0x1484b2(_0x48aedd['error'][_0xe4e0('0x10')]);}else{logger[_0xe4e0('0xa')]('VoiceCallReport,\x20%s,\x20%s',_0x471334,_0xe4e0('0xc'));_0x1484b2(_0x48aedd[_0xe4e0('0x11')][_0xe4e0('0x10')]);}})[_0xe4e0('0x12')](function(_0x313319){logger[_0xe4e0('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x471334,_0x313319);_0x5d79c0(_0x313319);});});}exports[_0xe4e0('0x13')]=function(_0x41dfe8){var _0x47f9cc=this;return new Promise(function(_0x51f67f,_0x4f7c49){return db[_0xe4e0('0x14')]['findAll']({'raw':_0x41dfe8[_0xe4e0('0x15')]?_0x41dfe8[_0xe4e0('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x41dfe8[_0xe4e0('0x15')]?_0x41dfe8[_0xe4e0('0x15')][_0xe4e0('0x16')]||null:null,'attributes':_0x41dfe8['options']?_0x41dfe8[_0xe4e0('0x15')]['attributes']||null:null,'limit':_0x41dfe8[_0xe4e0('0x15')]?_0x41dfe8[_0xe4e0('0x15')][_0xe4e0('0x17')]||null:null,'include':_0x41dfe8[_0xe4e0('0x15')]?_0x41dfe8['options'][_0xe4e0('0x18')]?_[_0xe4e0('0x19')](_0x41dfe8[_0xe4e0('0x15')][_0xe4e0('0x18')],function(_0x1550a2){return{'model':db[_0x1550a2[_0xe4e0('0x1a')]],'as':_0x1550a2['as'],'attributes':_0x1550a2['attributes'],'include':_0x1550a2[_0xe4e0('0x18')]?_[_0xe4e0('0x19')](_0x1550a2[_0xe4e0('0x18')],function(_0x240812){return{'model':db[_0x240812['model']],'as':_0x240812['as'],'attributes':_0x240812[_0xe4e0('0x1b')],'include':_0x240812[_0xe4e0('0x18')]?_[_0xe4e0('0x19')](_0x240812['include'],function(_0x2cb3e7){return{'model':db[_0x2cb3e7[_0xe4e0('0x1a')]],'as':_0x2cb3e7['as'],'attributes':_0x2cb3e7[_0xe4e0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe4e0('0x9')](function(_0x528b9d){logger[_0xe4e0('0xa')]('GetVoiceCallReport',_0x41dfe8);logger[_0xe4e0('0xd')]('GetVoiceCallReport',_0x41dfe8,JSON['stringify'](_0x528b9d));_0x51f67f(_0x528b9d);})['catch'](function(_0x59ae16){logger[_0xe4e0('0xf')](_0xe4e0('0x13'),_0x59ae16['message'],_0x41dfe8);_0x4f7c49(_0x47f9cc[_0xe4e0('0xf')](0x1f4,_0x59ae16['message']));});});};exports[_0xe4e0('0x1c')]=function(_0x45e1ea){var _0x56643c=this;return new Promise(function(_0x2dbe58,_0x5bdbcf){return db['VoiceCallReport'][_0xe4e0('0x1d')](_0x45e1ea[_0xe4e0('0x1e')],{'raw':_0x45e1ea[_0xe4e0('0x15')]?_0x45e1ea['options']['raw']===undefined?!![]:![]:!![]})[_0xe4e0('0x9')](function(_0x381cc3){logger['info'](_0xe4e0('0x1c'),_0x45e1ea);logger[_0xe4e0('0xd')](_0xe4e0('0x1c'),_0x45e1ea,JSON[_0xe4e0('0xe')](_0x381cc3));_0x2dbe58(_0x381cc3);})[_0xe4e0('0x12')](function(_0x4acbf0){logger['error']('CreateVoiceCallReport',_0x4acbf0['message'],_0x45e1ea);_0x5bdbcf(_0x56643c['error'](0x1f4,_0x4acbf0[_0xe4e0('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0xb039d3){var _0x2d0d9f=this;return new Promise(function(_0x691d5e,_0x495fbb){return db[_0xe4e0('0x14')]['update'](_0xb039d3['body'],{'raw':_0xb039d3[_0xe4e0('0x15')]?_0xb039d3[_0xe4e0('0x15')][_0xe4e0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb039d3[_0xe4e0('0x15')]?_0xb039d3[_0xe4e0('0x15')][_0xe4e0('0x16')]||null:null,'attributes':_0xb039d3[_0xe4e0('0x15')]?_0xb039d3['options'][_0xe4e0('0x1b')]||null:null,'limit':_0xb039d3['options']?_0xb039d3[_0xe4e0('0x15')]['limit']||null:null})[_0xe4e0('0x9')](function(_0x3d4bc3){logger[_0xe4e0('0xa')](_0xe4e0('0x20'),_0xb039d3);logger['debug'](_0xe4e0('0x20'),_0xb039d3,JSON[_0xe4e0('0xe')](_0x3d4bc3));_0x691d5e(_0x3d4bc3);})['catch'](function(_0x69e87c){logger['error'](_0xe4e0('0x20'),_0x69e87c['message'],_0xb039d3);_0x495fbb(_0x2d0d9f['error'](0x1f4,_0x69e87c[_0xe4e0('0x10')]));});});}; \ No newline at end of file +var _0x9173=['options','raw','attributes','include','map','model','then','stringify','CreateVoiceCallReport','create','body','update','where','limit','UpdateVoiceCallReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceCallReport'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9173,0x81));var _0x3917=function(_0x539c5f,_0x4b9bb4){_0x539c5f=_0x539c5f-0x0;var _0x3975f5=_0x9173[_0x539c5f];return _0x3975f5;};'use strict';var _=require(_0x3917('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3917('0x1'));var rs=require(_0x3917('0x2'));var fs=require('fs');var Redis=require(_0x3917('0x3'));var db=require(_0x3917('0x4'))['db'];var utils=require(_0x3917('0x5'));var logger=require(_0x3917('0x6'))(_0x3917('0x7'));var config=require('../../config/environment');var jayson=require(_0x3917('0x8'));var client=jayson[_0x3917('0x9')][_0x3917('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16c261,_0x3e0dbe,_0x3cfcd7){return new BPromise(function(_0x14e6af,_0x4718bf){return client[_0x3917('0xb')](_0x16c261,_0x3cfcd7)['then'](function(_0xefa820){logger[_0x3917('0xc')](_0x3917('0xd'),_0x3e0dbe,_0x3917('0xe'));logger[_0x3917('0xf')](_0x3917('0x10'),_0x3e0dbe,_0x3917('0xe'),JSON['stringify'](_0xefa820));if(_0xefa820[_0x3917('0x11')]){if(_0xefa820[_0x3917('0x11')][_0x3917('0x12')]===0x1f4){logger[_0x3917('0x11')](_0x3917('0xd'),_0x3e0dbe,_0xefa820[_0x3917('0x11')][_0x3917('0x13')]);return _0x4718bf(_0xefa820['error'][_0x3917('0x13')]);}logger[_0x3917('0x11')](_0x3917('0xd'),_0x3e0dbe,_0xefa820[_0x3917('0x11')][_0x3917('0x13')]);return _0x14e6af(_0xefa820[_0x3917('0x11')][_0x3917('0x13')]);}else{logger[_0x3917('0xc')](_0x3917('0xd'),_0x3e0dbe,_0x3917('0xe'));_0x14e6af(_0xefa820[_0x3917('0x14')][_0x3917('0x13')]);}})[_0x3917('0x15')](function(_0x12597e){logger[_0x3917('0x11')](_0x3917('0xd'),_0x3e0dbe,_0x12597e);_0x4718bf(_0x12597e);});});}exports[_0x3917('0x16')]=function(_0x1669c2){var _0x100cc4=this;return new Promise(function(_0x1e5fbf,_0x513129){return db['VoiceCallReport']['findAll']({'raw':_0x1669c2[_0x3917('0x17')]?_0x1669c2[_0x3917('0x17')][_0x3917('0x18')]===undefined?!![]:![]:!![],'where':_0x1669c2[_0x3917('0x17')]?_0x1669c2[_0x3917('0x17')]['where']||null:null,'attributes':_0x1669c2[_0x3917('0x17')]?_0x1669c2[_0x3917('0x17')][_0x3917('0x19')]||null:null,'limit':_0x1669c2[_0x3917('0x17')]?_0x1669c2['options']['limit']||null:null,'include':_0x1669c2[_0x3917('0x17')]?_0x1669c2['options'][_0x3917('0x1a')]?_[_0x3917('0x1b')](_0x1669c2['options'][_0x3917('0x1a')],function(_0x54cdf9){return{'model':db[_0x54cdf9[_0x3917('0x1c')]],'as':_0x54cdf9['as'],'attributes':_0x54cdf9['attributes'],'include':_0x54cdf9[_0x3917('0x1a')]?_['map'](_0x54cdf9[_0x3917('0x1a')],function(_0x1bce53){return{'model':db[_0x1bce53[_0x3917('0x1c')]],'as':_0x1bce53['as'],'attributes':_0x1bce53[_0x3917('0x19')],'include':_0x1bce53['include']?_[_0x3917('0x1b')](_0x1bce53[_0x3917('0x1a')],function(_0x1dba55){return{'model':db[_0x1dba55[_0x3917('0x1c')]],'as':_0x1dba55['as'],'attributes':_0x1dba55['attributes']};}):[]};}):[]};}):[]:[]})[_0x3917('0x1d')](function(_0x1294e5){logger['info']('GetVoiceCallReport',_0x1669c2);logger[_0x3917('0xf')](_0x3917('0x16'),_0x1669c2,JSON[_0x3917('0x1e')](_0x1294e5));_0x1e5fbf(_0x1294e5);})[_0x3917('0x15')](function(_0x2723e1){logger[_0x3917('0x11')]('GetVoiceCallReport',_0x2723e1[_0x3917('0x13')],_0x1669c2);_0x513129(_0x100cc4[_0x3917('0x11')](0x1f4,_0x2723e1['message']));});});};exports[_0x3917('0x1f')]=function(_0x700bf4){var _0x4d1f38=this;return new Promise(function(_0x247bf5,_0x443d20){return db['VoiceCallReport'][_0x3917('0x20')](_0x700bf4[_0x3917('0x21')],{'raw':_0x700bf4[_0x3917('0x17')]?_0x700bf4[_0x3917('0x17')][_0x3917('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x510fda){logger[_0x3917('0xc')](_0x3917('0x1f'),_0x700bf4);logger[_0x3917('0xf')](_0x3917('0x1f'),_0x700bf4,JSON[_0x3917('0x1e')](_0x510fda));_0x247bf5(_0x510fda);})[_0x3917('0x15')](function(_0x4c3bb1){logger[_0x3917('0x11')](_0x3917('0x1f'),_0x4c3bb1[_0x3917('0x13')],_0x700bf4);_0x443d20(_0x4d1f38[_0x3917('0x11')](0x1f4,_0x4c3bb1[_0x3917('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0x3cf416){var _0x2f5a2f=this;return new Promise(function(_0x263054,_0x111dda){return db['VoiceCallReport'][_0x3917('0x22')](_0x3cf416[_0x3917('0x21')],{'raw':_0x3cf416[_0x3917('0x17')]?_0x3cf416[_0x3917('0x17')][_0x3917('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cf416[_0x3917('0x17')]?_0x3cf416[_0x3917('0x17')][_0x3917('0x23')]||null:null,'attributes':_0x3cf416['options']?_0x3cf416['options'][_0x3917('0x19')]||null:null,'limit':_0x3cf416['options']?_0x3cf416['options'][_0x3917('0x24')]||null:null})[_0x3917('0x1d')](function(_0x43970a){logger['info'](_0x3917('0x25'),_0x3cf416);logger['debug']('UpdateVoiceCallReport',_0x3cf416,JSON[_0x3917('0x1e')](_0x43970a));_0x263054(_0x43970a);})[_0x3917('0x15')](function(_0x22e506){logger[_0x3917('0x11')]('UpdateVoiceCallReport',_0x22e506['message'],_0x3cf416);_0x111dda(_0x2f5a2f['error'](0x1f4,_0x22e506[_0x3917('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 3f12b03..b676c25 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 _0xf004=['destroy','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','/:id','post','isAuthenticated','create','put','update','delete'];(function(_0x39adb3,_0x2af102){var _0x124b2e=function(_0x56352b){while(--_0x56352b){_0x39adb3['push'](_0x39adb3['shift']());}};_0x124b2e(++_0x2af102);}(_0xf004,0x81));var _0x4f00=function(_0x260073,_0x4dc24e){_0x260073=_0x260073-0x0;var _0x1382c0=_0xf004[_0x260073];return _0x1382c0;};'use strict';var multer=require(_0x4f00('0x0'));var util=require(_0x4f00('0x1'));var path=require(_0x4f00('0x2'));var timeout=require(_0x4f00('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f00('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4f00('0x5'));var controller=require(_0x4f00('0x6'));router[_0x4f00('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4f00('0x7')](_0x4f00('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x4f00('0x9')]('/',auth[_0x4f00('0xa')](),controller[_0x4f00('0xb')]);router[_0x4f00('0xc')](_0x4f00('0x8'),auth[_0x4f00('0xa')](),controller[_0x4f00('0xd')]);router[_0x4f00('0xe')](_0x4f00('0x8'),auth[_0x4f00('0xa')](),controller[_0x4f00('0xf')]);module['exports']=router; \ No newline at end of file +var _0x3e09=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports'];(function(_0x45c5bc,_0xf506f3){var _0x448bc7=function(_0x11a514){while(--_0x11a514){_0x45c5bc['push'](_0x45c5bc['shift']());}};_0x448bc7(++_0xf506f3);}(_0x3e09,0x70));var _0x93e0=function(_0x204191,_0x55d566){_0x204191=_0x204191-0x0;var _0x526ccf=_0x3e09[_0x204191];return _0x526ccf;};'use strict';var multer=require(_0x93e0('0x0'));var util=require(_0x93e0('0x1'));var path=require(_0x93e0('0x2'));var timeout=require(_0x93e0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x93e0('0x4'));var auth=require(_0x93e0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x93e0('0x6')]('/',auth[_0x93e0('0x7')](),controller[_0x93e0('0x8')]);router['get'](_0x93e0('0x9'),auth[_0x93e0('0x7')](),controller[_0x93e0('0xa')]);router[_0x93e0('0xb')]('/',auth[_0x93e0('0x7')](),controller[_0x93e0('0xc')]);router[_0x93e0('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x93e0('0x9'),auth[_0x93e0('0x7')](),controller[_0x93e0('0xe')]);module[_0x93e0('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 351b7a6..eb1a6d2 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 _0x2a6b=['sequelize','exports','STRING','name','setDataValue','join','options','getDataValue','split','BOOLEAN'];(function(_0x390f69,_0x4a4105){var _0xbd1c2c=function(_0x42bb0d){while(--_0x42bb0d){_0x390f69['push'](_0x390f69['shift']());}};_0xbd1c2c(++_0x4a4105);}(_0x2a6b,0x78));var _0xb2a6=function(_0x469c0e,_0x2f5679){_0x469c0e=_0x469c0e-0x0;var _0x491e4d=_0x2a6b[_0x469c0e];return _0x491e4d;};'use strict';var Sequelize=require(_0xb2a6('0x0'));module[_0xb2a6('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xb2a6('0x2')],'unique':_0xb2a6('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xb2a6('0x2')],'set':function(_0x2748b0){this[_0xb2a6('0x4')]('options',_0x2748b0?_0x2748b0[_0xb2a6('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xb2a6('0x6'))?this[_0xb2a6('0x7')](_0xb2a6('0x6'))[_0xb2a6('0x8')](''):[];}},'auth':{'type':Sequelize[_0xb2a6('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0xb2a6('0x2')]},'record':{'type':Sequelize[_0xb2a6('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb2a6('0x2')]}}; \ No newline at end of file +var _0x3349=['exports','STRING','name','setDataValue','options','join','getDataValue','BOOLEAN','sequelize'];(function(_0x20f0e3,_0x56d69b){var _0x22e149=function(_0x46c0e8){while(--_0x46c0e8){_0x20f0e3['push'](_0x20f0e3['shift']());}};_0x22e149(++_0x56d69b);}(_0x3349,0xd7));var _0x9334=function(_0x9ded14,_0x34dbc9){_0x9ded14=_0x9ded14-0x0;var _0x20c47c=_0x3349[_0x9ded14];return _0x20c47c;};'use strict';var Sequelize=require(_0x9334('0x0'));module[_0x9334('0x1')]={'name':{'type':Sequelize[_0x9334('0x2')]},'prefix':{'type':Sequelize[_0x9334('0x2')],'unique':_0x9334('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x9334('0x2')],'set':function(_0x5d71fc){this[_0x9334('0x4')](_0x9334('0x5'),_0x5d71fc?_0x5d71fc[_0x9334('0x6')](''):[]);},'get':function(){return this[_0x9334('0x7')](_0x9334('0x5'))?this[_0x9334('0x7')](_0x9334('0x5'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x9334('0x2')]},'record':{'type':Sequelize[_0x9334('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9334('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 3de6272..fcbc97b 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 _0x7117=['rawAttributes','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','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','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','send','map','VoiceChanSpy','fieldName','key','model','name','filters','intersection','attributes','fields','query','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params'];(function(_0x2c9116,_0x33b3db){var _0x4e9e1f=function(_0x551261){while(--_0x551261){_0x2c9116['push'](_0x2c9116['shift']());}};_0x4e9e1f(++_0x33b3db);}(_0x7117,0x1ec));var _0x7711=function(_0x2d08d8,_0x2aa61f){_0x2d08d8=_0x2d08d8-0x0;var _0x571563=_0x7117[_0x2d08d8];return _0x571563;};'use strict';var emlformat=require(_0x7711('0x0'));var rimraf=require(_0x7711('0x1'));var zipdir=require(_0x7711('0x2'));var jsonpatch=require(_0x7711('0x3'));var rp=require('request-promise');var moment=require(_0x7711('0x4'));var BPromise=require(_0x7711('0x5'));var Mustache=require('mustache');var util=require(_0x7711('0x6'));var path=require('path');var sox=require(_0x7711('0x7'));var csv=require(_0x7711('0x8'));var ejs=require(_0x7711('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7711('0xa'));var deskjs=require(_0x7711('0xb'));var toCsv=require(_0x7711('0x8'));var querystring=require(_0x7711('0xc'));var Papa=require('papaparse');var Redis=require(_0x7711('0xd'));var authService=require(_0x7711('0xe'));var qs=require(_0x7711('0xf'));var as=require(_0x7711('0x10'));var hardwareService=require(_0x7711('0x11'));var logger=require('../../config/logger')(_0x7711('0x12'));var utils=require(_0x7711('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7711('0x14'));var db=require(_0x7711('0x15'))['db'];function respondWithStatusCode(_0x3d9269,_0x4c4e01){_0x4c4e01=_0x4c4e01||0xcc;return function(_0x2b13cb){if(_0x2b13cb){return _0x3d9269[_0x7711('0x16')](_0x4c4e01);}return _0x3d9269['status'](_0x4c4e01)[_0x7711('0x17')]();};}function respondWithResult(_0xe1ebfd,_0xf2cc5c){_0xf2cc5c=_0xf2cc5c||0xc8;return function(_0x223eea){if(_0x223eea){return _0xe1ebfd['status'](_0xf2cc5c)[_0x7711('0x18')](_0x223eea);}};}function respondWithFilteredResult(_0x2dbb60,_0xee7b2d){return function(_0x8ad57e){if(_0x8ad57e){var _0x28b28e=typeof _0xee7b2d[_0x7711('0x19')]===_0x7711('0x1a')&&typeof _0xee7b2d[_0x7711('0x1b')]===_0x7711('0x1a');var _0x3e3dcd=_0x8ad57e['count'];var _0x2b182f=_0x28b28e?0x0:_0xee7b2d['offset'];var _0x1bbea3=_0x28b28e?_0x8ad57e[_0x7711('0x1c')]:_0xee7b2d[_0x7711('0x19')]+_0xee7b2d[_0x7711('0x1b')];var _0x477234;if(_0x1bbea3>=_0x3e3dcd){_0x1bbea3=_0x3e3dcd;_0x477234=0xc8;}else{_0x477234=0xce;}_0x2dbb60[_0x7711('0x1d')](_0x477234);return _0x2dbb60[_0x7711('0x1e')](_0x7711('0x1f'),_0x2b182f+'-'+_0x1bbea3+'/'+_0x3e3dcd)[_0x7711('0x18')](_0x8ad57e);}return null;};}function patchUpdates(_0x5895c6){return function(_0x1d227f){try{jsonpatch[_0x7711('0x20')](_0x1d227f,_0x5895c6,!![]);}catch(_0x3dd245){return BPromise['reject'](_0x3dd245);}return _0x1d227f[_0x7711('0x21')]();};}function saveUpdates(_0x5180f6,_0x451e2e){return function(_0x217edf){if(_0x217edf){return _0x217edf[_0x7711('0x22')](_0x5180f6)[_0x7711('0x23')](function(_0x223cd5){return _0x223cd5;});}return null;};}function removeEntity(_0x18ac2a,_0x14874a){return function(_0x29da2b){if(_0x29da2b){return _0x29da2b[_0x7711('0x24')]()[_0x7711('0x23')](function(){var _0x2f9657=_0x29da2b[_0x7711('0x25')]({'plain':!![]});var _0xb2a5aa=_0x7711('0x26');return db[_0x7711('0x27')][_0x7711('0x24')]({'where':{'type':_0xb2a5aa,'resourceId':_0x2f9657['id']}})[_0x7711('0x23')](function(){return _0x29da2b;});})[_0x7711('0x23')](function(){_0x18ac2a[_0x7711('0x1d')](0xcc)[_0x7711('0x17')]();});}};}function handleEntityNotFound(_0x182675,_0x20c718){return function(_0x34ca6c){if(!_0x34ca6c){_0x182675[_0x7711('0x16')](0x194);}return _0x34ca6c;};}function handleError(_0x21004f,_0x2b8a00){_0x2b8a00=_0x2b8a00||0x1f4;return function(_0x4d1fd9){logger[_0x7711('0x28')](_0x4d1fd9[_0x7711('0x29')]);if(_0x4d1fd9['name']){delete _0x4d1fd9['name'];}_0x21004f[_0x7711('0x1d')](_0x2b8a00)[_0x7711('0x2a')](_0x4d1fd9);};}exports['index']=function(_0x5ad2f0,_0x3c1024){var _0x4e37f5={},_0x1979cd={},_0x3b9a07={'count':0x0,'rows':[]};var _0x4077b3=_[_0x7711('0x2b')](db[_0x7711('0x2c')]['rawAttributes'],function(_0x47ec57){return{'name':_0x47ec57[_0x7711('0x2d')],'type':_0x47ec57['type'][_0x7711('0x2e')]};});_0x1979cd[_0x7711('0x2f')]=_[_0x7711('0x2b')](_0x4077b3,_0x7711('0x30'));_0x1979cd['query']=_['keys'](_0x5ad2f0['query']);_0x1979cd[_0x7711('0x31')]=_[_0x7711('0x32')](_0x1979cd['model'],_0x1979cd['query']);_0x4e37f5[_0x7711('0x33')]=_[_0x7711('0x32')](_0x1979cd[_0x7711('0x2f')],qs[_0x7711('0x34')](_0x5ad2f0[_0x7711('0x35')][_0x7711('0x34')]));_0x4e37f5[_0x7711('0x33')]=_0x4e37f5['attributes']['length']?_0x4e37f5[_0x7711('0x33')]:_0x1979cd['model'];if(!_0x5ad2f0['query']['hasOwnProperty'](_0x7711('0x36'))){_0x4e37f5[_0x7711('0x1b')]=qs[_0x7711('0x1b')](_0x5ad2f0['query'][_0x7711('0x1b')]);_0x4e37f5['offset']=qs[_0x7711('0x19')](_0x5ad2f0['query'][_0x7711('0x19')]);}_0x4e37f5[_0x7711('0x37')]=qs[_0x7711('0x38')](_0x5ad2f0[_0x7711('0x35')]['sort']);_0x4e37f5[_0x7711('0x39')]=qs[_0x7711('0x31')](_[_0x7711('0x3a')](_0x5ad2f0[_0x7711('0x35')],_0x1979cd['filters']),_0x4077b3);if(_0x5ad2f0[_0x7711('0x35')]['filter']){_0x4e37f5[_0x7711('0x39')]=_[_0x7711('0x3b')](_0x4e37f5[_0x7711('0x39')],{'$or':_['map'](_0x4077b3,function(_0x388522){if(_0x388522['type']!==_0x7711('0x3c')){var _0x267e53={};_0x267e53[_0x388522[_0x7711('0x30')]]={'$like':'%'+_0x5ad2f0[_0x7711('0x35')][_0x7711('0x3d')]+'%'};return _0x267e53;}})});}_0x4e37f5=_[_0x7711('0x3b')]({},_0x4e37f5,_0x5ad2f0['options']);var _0x46e018={'where':_0x4e37f5[_0x7711('0x39')]};return db[_0x7711('0x2c')]['count'](_0x46e018)['then'](function(_0x35ad7f){_0x3b9a07['count']=_0x35ad7f;if(_0x5ad2f0[_0x7711('0x35')][_0x7711('0x3e')]){_0x4e37f5['include']=[{'all':!![]}];}return db[_0x7711('0x2c')][_0x7711('0x3f')](_0x4e37f5);})[_0x7711('0x23')](function(_0x5cb857){_0x3b9a07[_0x7711('0x40')]=_0x5cb857;return _0x3b9a07;})[_0x7711('0x23')](respondWithFilteredResult(_0x3c1024,_0x4e37f5))[_0x7711('0x41')](handleError(_0x3c1024,null));};exports[_0x7711('0x42')]=function(_0x4defc7,_0x1af6ee){var _0x340180={'raw':![],'where':{'id':_0x4defc7[_0x7711('0x43')]['id']}},_0x244500={};_0x244500[_0x7711('0x2f')]=_['keys'](db[_0x7711('0x2c')][_0x7711('0x44')]);_0x244500[_0x7711('0x35')]=_[_0x7711('0x45')](_0x4defc7['query']);_0x244500[_0x7711('0x31')]=_[_0x7711('0x32')](_0x244500['model'],_0x244500[_0x7711('0x35')]);_0x340180[_0x7711('0x33')]=_[_0x7711('0x32')](_0x244500['model'],qs[_0x7711('0x34')](_0x4defc7[_0x7711('0x35')][_0x7711('0x34')]));_0x340180[_0x7711('0x33')]=_0x340180[_0x7711('0x33')]['length']?_0x340180[_0x7711('0x33')]:_0x244500[_0x7711('0x2f')];if(_0x4defc7[_0x7711('0x35')][_0x7711('0x3e')]){_0x340180['include']=[{'all':!![]}];}_0x340180=_[_0x7711('0x3b')]({},_0x340180,_0x4defc7['options']);return db[_0x7711('0x2c')][_0x7711('0x46')](_0x340180)[_0x7711('0x23')](handleEntityNotFound(_0x1af6ee,null))[_0x7711('0x23')](respondWithResult(_0x1af6ee,null))[_0x7711('0x41')](handleError(_0x1af6ee,null));};exports[_0x7711('0x47')]=function(_0xc44e62,_0x226578){return db[_0x7711('0x2c')]['create'](_0xc44e62[_0x7711('0x48')],{})['then'](function(_0x235d8f){var _0x3ddda1=_0xc44e62['user'][_0x7711('0x25')]({'plain':!![]});if(!_0x3ddda1)throw new Error(_0x7711('0x49'));if(_0x3ddda1[_0x7711('0x4a')]===_0x7711('0x4b')){var _0x37f77c=_0x235d8f[_0x7711('0x25')]({'plain':!![]});var _0x443596=_0x7711('0x26');return db[_0x7711('0x4c')][_0x7711('0x46')]({'where':{'name':_0x443596,'userProfileId':_0x3ddda1[_0x7711('0x4d')]},'raw':!![]})[_0x7711('0x23')](function(_0x5eb49){if(_0x5eb49&&_0x5eb49[_0x7711('0x4e')]===0x0){return db[_0x7711('0x27')]['create']({'name':_0x37f77c[_0x7711('0x30')],'resourceId':_0x37f77c['id'],'type':_0x5eb49['name'],'sectionId':_0x5eb49['id']},{})[_0x7711('0x23')](function(){return _0x235d8f;});}else{return _0x235d8f;}})[_0x7711('0x41')](function(_0x3664da){logger[_0x7711('0x28')](_0x7711('0x4f'),_0x3664da);throw _0x3664da;});}return _0x235d8f;})[_0x7711('0x23')](respondWithResult(_0x226578,0xc9))['catch'](handleError(_0x226578,null));};exports[_0x7711('0x22')]=function(_0x1acc6f,_0x2615fa){if(_0x1acc6f[_0x7711('0x48')]['id']){delete _0x1acc6f['body']['id'];}return db['VoiceChanSpy'][_0x7711('0x46')]({'where':{'id':_0x1acc6f[_0x7711('0x43')]['id']}})[_0x7711('0x23')](handleEntityNotFound(_0x2615fa,null))[_0x7711('0x23')](saveUpdates(_0x1acc6f[_0x7711('0x48')],null))[_0x7711('0x23')](respondWithResult(_0x2615fa,null))[_0x7711('0x41')](handleError(_0x2615fa,null));};exports[_0x7711('0x24')]=function(_0x5ea62a,_0x1c0b4f){return db[_0x7711('0x2c')][_0x7711('0x46')]({'where':{'id':_0x5ea62a[_0x7711('0x43')]['id']}})[_0x7711('0x23')](handleEntityNotFound(_0x1c0b4f,null))[_0x7711('0x23')](removeEntity(_0x1c0b4f,null))['catch'](handleError(_0x1c0b4f,null));}; \ No newline at end of file +var _0xa047=['fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','ChanSpies','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','nolimit','where','pick','filters','filter','merge','options','include','VoiceChanSpy','findAll','rows','catch','show','params','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','find','eml-format','rimraf','zip-dir'];(function(_0x35d7ec,_0x2ca937){var _0xf59b04=function(_0x14b041){while(--_0x14b041){_0x35d7ec['push'](_0x35d7ec['shift']());}};_0xf59b04(++_0x2ca937);}(_0xa047,0x1c5));var _0x7a04=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0xa047[_0x4c98b9];return _0x3a257a;};'use strict';var emlformat=require(_0x7a04('0x0'));var rimraf=require(_0x7a04('0x1'));var zipdir=require(_0x7a04('0x2'));var jsonpatch=require(_0x7a04('0x3'));var rp=require('request-promise');var moment=require(_0x7a04('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7a04('0x5'));var util=require(_0x7a04('0x6'));var path=require(_0x7a04('0x7'));var sox=require(_0x7a04('0x8'));var csv=require(_0x7a04('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a04('0xa'));var _=require(_0x7a04('0xb'));var squel=require(_0x7a04('0xc'));var crypto=require('crypto');var jsforce=require(_0x7a04('0xd'));var deskjs=require(_0x7a04('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7a04('0xf'));var Papa=require(_0x7a04('0x10'));var Redis=require('ioredis');var authService=require(_0x7a04('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a04('0x12'));var logger=require(_0x7a04('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7a04('0x14'));var db=require(_0x7a04('0x15'))['db'];function respondWithStatusCode(_0x3e8692,_0x15a002){_0x15a002=_0x15a002||0xcc;return function(_0x10931c){if(_0x10931c){return _0x3e8692[_0x7a04('0x16')](_0x15a002);}return _0x3e8692[_0x7a04('0x17')](_0x15a002)[_0x7a04('0x18')]();};}function respondWithResult(_0x3630a2,_0x5ae457){_0x5ae457=_0x5ae457||0xc8;return function(_0x3b601d){if(_0x3b601d){return _0x3630a2[_0x7a04('0x17')](_0x5ae457)[_0x7a04('0x19')](_0x3b601d);}};}function respondWithFilteredResult(_0x377fa1,_0x2bb838){return function(_0x328973){if(_0x328973){var _0x4f434f=typeof _0x2bb838[_0x7a04('0x1a')]===_0x7a04('0x1b')&&typeof _0x2bb838[_0x7a04('0x1c')]==='undefined';var _0x5cf6ba=_0x328973[_0x7a04('0x1d')];var _0x4310a2=_0x4f434f?0x0:_0x2bb838[_0x7a04('0x1a')];var _0x5716f5=_0x4f434f?_0x328973[_0x7a04('0x1d')]:_0x2bb838[_0x7a04('0x1a')]+_0x2bb838['limit'];var _0x1ba187;if(_0x5716f5>=_0x5cf6ba){_0x5716f5=_0x5cf6ba;_0x1ba187=0xc8;}else{_0x1ba187=0xce;}_0x377fa1['status'](_0x1ba187);return _0x377fa1[_0x7a04('0x1e')]('Content-Range',_0x4310a2+'-'+_0x5716f5+'/'+_0x5cf6ba)[_0x7a04('0x19')](_0x328973);}return null;};}function patchUpdates(_0x10c327){return function(_0x51b13b){try{jsonpatch[_0x7a04('0x1f')](_0x51b13b,_0x10c327,!![]);}catch(_0x298006){return BPromise['reject'](_0x298006);}return _0x51b13b[_0x7a04('0x20')]();};}function saveUpdates(_0x258346,_0x57eaa5){return function(_0x281562){if(_0x281562){return _0x281562[_0x7a04('0x21')](_0x258346)[_0x7a04('0x22')](function(_0x212d52){return _0x212d52;});}return null;};}function removeEntity(_0x2f8ff6,_0x21b668){return function(_0x1deb47){if(_0x1deb47){return _0x1deb47[_0x7a04('0x23')]()['then'](function(){var _0x166e0b=_0x1deb47['get']({'plain':!![]});var _0x303004=_0x7a04('0x24');return db[_0x7a04('0x25')][_0x7a04('0x23')]({'where':{'type':_0x303004,'resourceId':_0x166e0b['id']}})[_0x7a04('0x22')](function(){return _0x1deb47;});})[_0x7a04('0x22')](function(){_0x2f8ff6[_0x7a04('0x17')](0xcc)[_0x7a04('0x18')]();});}};}function handleEntityNotFound(_0x3671b5,_0xa4e3bc){return function(_0x16df74){if(!_0x16df74){_0x3671b5['sendStatus'](0x194);}return _0x16df74;};}function handleError(_0xb9a6fe,_0x49cd48){_0x49cd48=_0x49cd48||0x1f4;return function(_0x2cfd76){logger[_0x7a04('0x26')](_0x2cfd76[_0x7a04('0x27')]);if(_0x2cfd76[_0x7a04('0x28')]){delete _0x2cfd76[_0x7a04('0x28')];}_0xb9a6fe[_0x7a04('0x17')](_0x49cd48)['send'](_0x2cfd76);};}exports[_0x7a04('0x29')]=function(_0x487b74,_0x274a67){var _0x444daa={},_0x553f2a={},_0x767ff1={'count':0x0,'rows':[]};var _0x4323e3=_['map'](db['VoiceChanSpy'][_0x7a04('0x2a')],function(_0x2891b0){return{'name':_0x2891b0[_0x7a04('0x2b')],'type':_0x2891b0[_0x7a04('0x2c')][_0x7a04('0x2d')]};});_0x553f2a[_0x7a04('0x2e')]=_[_0x7a04('0x2f')](_0x4323e3,_0x7a04('0x28'));_0x553f2a['query']=_[_0x7a04('0x30')](_0x487b74[_0x7a04('0x31')]);_0x553f2a['filters']=_[_0x7a04('0x32')](_0x553f2a[_0x7a04('0x2e')],_0x553f2a[_0x7a04('0x31')]);_0x444daa[_0x7a04('0x33')]=_[_0x7a04('0x32')](_0x553f2a[_0x7a04('0x2e')],qs[_0x7a04('0x34')](_0x487b74['query'][_0x7a04('0x34')]));_0x444daa[_0x7a04('0x33')]=_0x444daa['attributes']['length']?_0x444daa[_0x7a04('0x33')]:_0x553f2a['model'];if(!_0x487b74[_0x7a04('0x31')]['hasOwnProperty'](_0x7a04('0x35'))){_0x444daa[_0x7a04('0x1c')]=qs[_0x7a04('0x1c')](_0x487b74[_0x7a04('0x31')][_0x7a04('0x1c')]);_0x444daa[_0x7a04('0x1a')]=qs[_0x7a04('0x1a')](_0x487b74[_0x7a04('0x31')][_0x7a04('0x1a')]);}_0x444daa['order']=qs['sort'](_0x487b74['query']['sort']);_0x444daa[_0x7a04('0x36')]=qs['filters'](_[_0x7a04('0x37')](_0x487b74[_0x7a04('0x31')],_0x553f2a[_0x7a04('0x38')]),_0x4323e3);if(_0x487b74[_0x7a04('0x31')][_0x7a04('0x39')]){_0x444daa[_0x7a04('0x36')]=_[_0x7a04('0x3a')](_0x444daa['where'],{'$or':_[_0x7a04('0x2f')](_0x4323e3,function(_0x2f7baf){if(_0x2f7baf[_0x7a04('0x2c')]!=='VIRTUAL'){var _0x1752c4={};_0x1752c4[_0x2f7baf[_0x7a04('0x28')]]={'$like':'%'+_0x487b74[_0x7a04('0x31')][_0x7a04('0x39')]+'%'};return _0x1752c4;}})});}_0x444daa=_[_0x7a04('0x3a')]({},_0x444daa,_0x487b74[_0x7a04('0x3b')]);var _0x277f19={'where':_0x444daa[_0x7a04('0x36')]};return db['VoiceChanSpy']['count'](_0x277f19)[_0x7a04('0x22')](function(_0x1a429d){_0x767ff1['count']=_0x1a429d;if(_0x487b74['query']['includeAll']){_0x444daa[_0x7a04('0x3c')]=[{'all':!![]}];}return db[_0x7a04('0x3d')][_0x7a04('0x3e')](_0x444daa);})[_0x7a04('0x22')](function(_0x4780dd){_0x767ff1[_0x7a04('0x3f')]=_0x4780dd;return _0x767ff1;})['then'](respondWithFilteredResult(_0x274a67,_0x444daa))[_0x7a04('0x40')](handleError(_0x274a67,null));};exports[_0x7a04('0x41')]=function(_0x5a8ce0,_0x5bcd1f){var _0x212ac3={'raw':![],'where':{'id':_0x5a8ce0[_0x7a04('0x42')]['id']}},_0x340483={};_0x340483[_0x7a04('0x2e')]=_[_0x7a04('0x30')](db[_0x7a04('0x3d')]['rawAttributes']);_0x340483[_0x7a04('0x31')]=_[_0x7a04('0x30')](_0x5a8ce0[_0x7a04('0x31')]);_0x340483[_0x7a04('0x38')]=_[_0x7a04('0x32')](_0x340483[_0x7a04('0x2e')],_0x340483[_0x7a04('0x31')]);_0x212ac3['attributes']=_[_0x7a04('0x32')](_0x340483[_0x7a04('0x2e')],qs['fields'](_0x5a8ce0['query']['fields']));_0x212ac3[_0x7a04('0x33')]=_0x212ac3[_0x7a04('0x33')][_0x7a04('0x43')]?_0x212ac3[_0x7a04('0x33')]:_0x340483[_0x7a04('0x2e')];if(_0x5a8ce0['query']['includeAll']){_0x212ac3[_0x7a04('0x3c')]=[{'all':!![]}];}_0x212ac3=_[_0x7a04('0x3a')]({},_0x212ac3,_0x5a8ce0[_0x7a04('0x3b')]);return db[_0x7a04('0x3d')]['find'](_0x212ac3)['then'](handleEntityNotFound(_0x5bcd1f,null))[_0x7a04('0x22')](respondWithResult(_0x5bcd1f,null))['catch'](handleError(_0x5bcd1f,null));};exports[_0x7a04('0x44')]=function(_0x4d159d,_0x467fcf){return db[_0x7a04('0x3d')][_0x7a04('0x44')](_0x4d159d[_0x7a04('0x45')],{})[_0x7a04('0x22')](function(_0x31e1ed){var _0x46bd71=_0x4d159d['user']['get']({'plain':!![]});if(!_0x46bd71)throw new Error(_0x7a04('0x46'));if(_0x46bd71[_0x7a04('0x47')]===_0x7a04('0x48')){var _0x40e1d7=_0x31e1ed[_0x7a04('0x49')]({'plain':!![]});var _0x43e537=_0x7a04('0x24');return db[_0x7a04('0x4a')]['find']({'where':{'name':_0x43e537,'userProfileId':_0x46bd71['userProfileId']},'raw':!![]})[_0x7a04('0x22')](function(_0x3cf11d){if(_0x3cf11d&&_0x3cf11d['autoAssociation']===0x0){return db[_0x7a04('0x25')]['create']({'name':_0x40e1d7['name'],'resourceId':_0x40e1d7['id'],'type':_0x3cf11d[_0x7a04('0x28')],'sectionId':_0x3cf11d['id']},{})['then'](function(){return _0x31e1ed;});}else{return _0x31e1ed;}})[_0x7a04('0x40')](function(_0x44b4ba){logger[_0x7a04('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44b4ba);throw _0x44b4ba;});}return _0x31e1ed;})[_0x7a04('0x22')](respondWithResult(_0x467fcf,0xc9))[_0x7a04('0x40')](handleError(_0x467fcf,null));};exports[_0x7a04('0x21')]=function(_0x53f355,_0x5e29e0){if(_0x53f355[_0x7a04('0x45')]['id']){delete _0x53f355[_0x7a04('0x45')]['id'];}return db[_0x7a04('0x3d')][_0x7a04('0x4b')]({'where':{'id':_0x53f355[_0x7a04('0x42')]['id']}})[_0x7a04('0x22')](handleEntityNotFound(_0x5e29e0,null))[_0x7a04('0x22')](saveUpdates(_0x53f355[_0x7a04('0x45')],null))[_0x7a04('0x22')](respondWithResult(_0x5e29e0,null))[_0x7a04('0x40')](handleError(_0x5e29e0,null));};exports[_0x7a04('0x23')]=function(_0xdcc457,_0x1da429){return db['VoiceChanSpy']['find']({'where':{'id':_0xdcc457['params']['id']}})[_0x7a04('0x22')](handleEntityNotFound(_0x1da429,null))[_0x7a04('0x22')](removeEntity(_0x1da429,null))['catch'](handleError(_0x1da429,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index e07d4a1..5aa44bd 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 _0xaf25=['options','length','concat','internal','name','findAll','agent','then','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','catch','lodash','util','./voiceChanSpy.attributes','from-sip','prefix','system','push','Set','format','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s'];(function(_0x38a26d,_0x19ba99){var _0xd90c30=function(_0xf7da89){while(--_0xf7da89){_0x38a26d['push'](_0x38a26d['shift']());}};_0xd90c30(++_0x19ba99);}(_0xaf25,0x178));var _0x5af2=function(_0x520101,_0x48c05c){_0x520101=_0x520101-0x0;var _0xe4777b=_0xaf25[_0x520101];return _0xe4777b;};'use strict';var _=require(_0x5af2('0x0'));var util=require(_0x5af2('0x1'));var BPromise=require('bluebird');var attributes=require(_0x5af2('0x2'));var getUserApplications=function(_0x2aa320,_0x127ed2,_0x2fa0d7){var _0x11864b=0x1;var _0x4077e1=[];var _0x44e1bf={'context':_0x127ed2['context']||_0x5af2('0x3'),'exten':util['format']('%s%s',_0x2aa320[_0x5af2('0x4')],_0x2fa0d7),'type':_0x5af2('0x5'),'isApp':![],'ChanSpyId':_0x2aa320['id'],'UserId':_0x127ed2['id']};_0x4077e1[_0x5af2('0x6')](_['merge']({'app':_0x5af2('0x7'),'appdata':util[_0x5af2('0x8')](_0x5af2('0x9'),_0x5af2('0xa')),'priority':_0x11864b++},_0x44e1bf));if(_0x2aa320[_0x5af2('0xb')]){_0x4077e1[_0x5af2('0x6')](_[_0x5af2('0xc')]({'app':_0x5af2('0xd'),'appdata':util[_0x5af2('0x8')](_0x5af2('0xe'),_0x2aa320[_0x5af2('0xf')]),'priority':_0x11864b++},_0x44e1bf));}if(_0x2aa320['auth']){_0x4077e1[_0x5af2('0x6')](_[_0x5af2('0xc')]({'app':_0x5af2('0x10'),'appdata':_0x2aa320[_0x5af2('0x11')],'priority':_0x11864b++},_0x44e1bf));}_0x4077e1[_0x5af2('0x6')](_['merge']({'app':_0x5af2('0x12'),'appdata':util[_0x5af2('0x8')](_0x5af2('0x13'),_0x127ed2['name'],_0x2aa320[_0x5af2('0x14')]?_0x2aa320['options']['join'](''):''),'priority':_0x11864b++},_0x44e1bf));if(_0x2aa320['record']){_0x4077e1['push'](_[_0x5af2('0xc')]({'app':'StopMixMonitor','priority':_0x11864b++},_0x44e1bf));}return _0x4077e1;};var getChanSpyApplications=function(_0x1abe44,_0x2eb207){var _0x6638a9=[];for(var _0xa4440a=0x0,_0x2399c4=0x1;_0xa4440a<_0x2eb207[_0x5af2('0x15')];_0xa4440a++,_0x2399c4=0x1){_0x6638a9=_0x6638a9[_0x5af2('0x16')](getUserApplications(_0x1abe44,_0x2eb207[_0xa4440a],_0x2eb207[_0xa4440a][_0x5af2('0x17')]));if(_0x2eb207[_0xa4440a]['internal']!=_0x2eb207[_0xa4440a][_0x5af2('0x18')]){_0x6638a9=_0x6638a9[_0x5af2('0x16')](getUserApplications(_0x1abe44,_0x2eb207[_0xa4440a],_0x2eb207[_0xa4440a][_0x5af2('0x18')]));}}return _0x6638a9;};var getChanSpyPromise=function(_0x24a42d,_0x463287){return new BPromise(function(_0x540e0a,_0x439c45){return _0x24a42d['User'][_0x5af2('0x19')]({'attributes':['id',_0x5af2('0x18'),_0x5af2('0x17')],'where':{'role':_0x5af2('0x1a'),'chanspy':!![]},'raw':!![]})[_0x5af2('0x1b')](function(_0x4c82eb){if(_0x4c82eb){return _0x540e0a(getChanSpyApplications(_0x463287,_0x4c82eb));}return _0x540e0a([]);})['catch'](function(_0x5e8858){_0x439c45(_0x5e8858);});});};module['exports']=function(_0x3e0e99,_0x1b6b96){var _0x24b0a2=_0x3e0e99[_0x5af2('0x1c')];return _0x3e0e99[_0x5af2('0x1d')](_0x5af2('0x1e'),attributes,{'tableName':_0x5af2('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f869d,_0x49f41f,_0x32a2fd){return getChanSpyPromise(_0x24b0a2,_0x1f869d)[_0x5af2('0x1b')](function(_0xf29381){if(_0xf29381&&_0xf29381[_0x5af2('0x15')]){return _0x24b0a2[_0x5af2('0x20')][_0x5af2('0x21')](_0xf29381);}})[_0x5af2('0x1b')](function(){_0x32a2fd();})['catch'](function(_0x443833){_0x32a2fd(_0x443833);});},'afterUpdate':function(_0x5daa12,_0x31a1e7,_0x2f0c67){return _0x24b0a2[_0x5af2('0x20')][_0x5af2('0x22')]({'where':{'ChanSpyId':_0x5daa12['id']}})['then'](function(){return getChanSpyPromise(_0x24b0a2,_0x5daa12);})[_0x5af2('0x1b')](function(_0x2db72f){if(_0x2db72f&&_0x2db72f[_0x5af2('0x15')]){return _0x24b0a2[_0x5af2('0x20')][_0x5af2('0x21')](_0x2db72f);}})[_0x5af2('0x1b')](function(){_0x2f0c67();})['catch'](function(_0x3095ae){_0x2f0c67(_0x3095ae);});},'afterDestroy':function(_0x5770f3,_0x3f4163,_0x44a773){return _0x24b0a2[_0x5af2('0x20')][_0x5af2('0x22')]({'where':{'ChanSpyId':_0x5770f3['id']}})['then'](function(){_0x44a773();})[_0x5af2('0x23')](function(_0x40f966){_0x44a773(_0x40f966);});}}});}; \ No newline at end of file +var _0x98a7=['models','VoiceChanSpy','voice_chanspy','VoiceExtension','catch','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','merge','Set','CDR(type)=%s','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','internal','concat','User','findAll','agent','then'];(function(_0x17563b,_0x497a67){var _0x42f55d=function(_0x48a332){while(--_0x48a332){_0x17563b['push'](_0x17563b['shift']());}};_0x42f55d(++_0x497a67);}(_0x98a7,0x166));var _0x798a=function(_0x2723d8,_0x2ac102){_0x2723d8=_0x2723d8-0x0;var _0x2820a4=_0x98a7[_0x2723d8];return _0x2820a4;};'use strict';var _=require(_0x798a('0x0'));var util=require(_0x798a('0x1'));var BPromise=require(_0x798a('0x2'));var attributes=require(_0x798a('0x3'));var getUserApplications=function(_0x14bad9,_0x16bb17,_0x463f4a){var _0x16c925=0x1;var _0x4efa0b=[];var _0xdef7cc={'context':_0x16bb17[_0x798a('0x4')]||_0x798a('0x5'),'exten':util[_0x798a('0x6')](_0x798a('0x7'),_0x14bad9['prefix'],_0x463f4a),'type':'system','isApp':![],'ChanSpyId':_0x14bad9['id'],'UserId':_0x16bb17['id']};_0x4efa0b['push'](_[_0x798a('0x8')]({'app':_0x798a('0x9'),'appdata':util[_0x798a('0x6')](_0x798a('0xa'),_0x798a('0xb')),'priority':_0x16c925++},_0xdef7cc));if(_0x14bad9[_0x798a('0xc')]){_0x4efa0b[_0x798a('0xd')](_[_0x798a('0x8')]({'app':_0x798a('0xe'),'appdata':util['format'](_0x798a('0xf'),_0x14bad9['recordingFormat']),'priority':_0x16c925++},_0xdef7cc));}if(_0x14bad9[_0x798a('0x10')]){_0x4efa0b['push'](_['merge']({'app':_0x798a('0x11'),'appdata':_0x14bad9[_0x798a('0x12')],'priority':_0x16c925++},_0xdef7cc));}_0x4efa0b[_0x798a('0xd')](_['merge']({'app':_0x798a('0x13'),'appdata':util[_0x798a('0x6')](_0x798a('0x14'),_0x16bb17[_0x798a('0x15')],_0x14bad9['options']?_0x14bad9[_0x798a('0x16')][_0x798a('0x17')](''):''),'priority':_0x16c925++},_0xdef7cc));if(_0x14bad9[_0x798a('0xc')]){_0x4efa0b['push'](_[_0x798a('0x8')]({'app':_0x798a('0x18'),'priority':_0x16c925++},_0xdef7cc));}return _0x4efa0b;};var getChanSpyApplications=function(_0x27a1e5,_0x2f92ba){var _0x44915c=[];for(var _0x192b8a=0x0,_0x505c60=0x1;_0x192b8a<_0x2f92ba[_0x798a('0x19')];_0x192b8a++,_0x505c60=0x1){_0x44915c=_0x44915c['concat'](getUserApplications(_0x27a1e5,_0x2f92ba[_0x192b8a],_0x2f92ba[_0x192b8a][_0x798a('0x1a')]));if(_0x2f92ba[_0x192b8a]['internal']!=_0x2f92ba[_0x192b8a][_0x798a('0x15')]){_0x44915c=_0x44915c[_0x798a('0x1b')](getUserApplications(_0x27a1e5,_0x2f92ba[_0x192b8a],_0x2f92ba[_0x192b8a][_0x798a('0x15')]));}}return _0x44915c;};var getChanSpyPromise=function(_0x5494d0,_0x21e726){return new BPromise(function(_0x54896e,_0x1c776d){return _0x5494d0[_0x798a('0x1c')][_0x798a('0x1d')]({'attributes':['id',_0x798a('0x15'),'internal'],'where':{'role':_0x798a('0x1e'),'chanspy':!![]},'raw':!![]})[_0x798a('0x1f')](function(_0x3a10a3){if(_0x3a10a3){return _0x54896e(getChanSpyApplications(_0x21e726,_0x3a10a3));}return _0x54896e([]);})['catch'](function(_0x482a29){_0x1c776d(_0x482a29);});});};module['exports']=function(_0x5afe4d,_0x3badd4){var _0x42f4fd=_0x5afe4d[_0x798a('0x20')];return _0x5afe4d['define'](_0x798a('0x21'),attributes,{'tableName':_0x798a('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x104132,_0x239a3b,_0x118343){return getChanSpyPromise(_0x42f4fd,_0x104132)['then'](function(_0x1e8237){if(_0x1e8237&&_0x1e8237[_0x798a('0x19')]){return _0x42f4fd[_0x798a('0x23')]['bulkCreate'](_0x1e8237);}})[_0x798a('0x1f')](function(){_0x118343();})[_0x798a('0x24')](function(_0x20c341){_0x118343(_0x20c341);});},'afterUpdate':function(_0x5cc392,_0x52917c,_0x3d49a8){return _0x42f4fd[_0x798a('0x23')][_0x798a('0x25')]({'where':{'ChanSpyId':_0x5cc392['id']}})['then'](function(){return getChanSpyPromise(_0x42f4fd,_0x5cc392);})[_0x798a('0x1f')](function(_0x1c317f){if(_0x1c317f&&_0x1c317f[_0x798a('0x19')]){return _0x42f4fd['VoiceExtension'][_0x798a('0x26')](_0x1c317f);}})[_0x798a('0x1f')](function(){_0x3d49a8();})[_0x798a('0x24')](function(_0x123810){_0x3d49a8(_0x123810);});},'afterDestroy':function(_0x4c15e1,_0x46239a,_0x295507){return _0x42f4fd['VoiceExtension'][_0x798a('0x25')]({'where':{'ChanSpyId':_0x4c15e1['id']}})['then'](function(){_0x295507();})['catch'](function(_0x250661){_0x295507(_0x250661);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 92e3139..688b366 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 _0xa902=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xa902,0x8d));var _0x2a90=function(_0x3fd25b,_0x159e24){_0x3fd25b=_0x3fd25b-0x0;var _0x47d207=_0xa902[_0x3fd25b];return _0x47d207;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});} \ No newline at end of file +var _0x9e0d=['stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x5dd589,_0x27fd6f){_0x5dd589=_0x5dd589-0x0;var _0x39ac3e=_0x9e0d[_0x5dd589];return _0x39ac3e;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9e0('0x4'));var db=require(_0xd9e0('0x5'))['db'];var utils=require(_0xd9e0('0x6'));var logger=require(_0xd9e0('0x7'))(_0xd9e0('0x8'));var config=require(_0xd9e0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd9e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28ce1e,_0x36d1c7,_0x3f8bb2){return new BPromise(function(_0x256df0,_0x3315d8){return client['request'](_0x28ce1e,_0x3f8bb2)[_0xd9e0('0xb')](function(_0x36e6e7){logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,_0xd9e0('0xe'));logger[_0xd9e0('0xf')](_0xd9e0('0x10'),_0x36d1c7,'request\x20sent',JSON[_0xd9e0('0x11')](_0x36e6e7));if(_0x36e6e7[_0xd9e0('0x12')]){if(_0x36e6e7['error'][_0xd9e0('0x13')]===0x1f4){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);return _0x3315d8(_0x36e6e7['error'][_0xd9e0('0x14')]);}logger['error'](_0xd9e0('0xd'),_0x36d1c7,_0x36e6e7['error'][_0xd9e0('0x14')]);return _0x256df0(_0x36e6e7[_0xd9e0('0x12')][_0xd9e0('0x14')]);}else{logger[_0xd9e0('0xc')](_0xd9e0('0xd'),_0x36d1c7,'request\x20sent');_0x256df0(_0x36e6e7['result']['message']);}})[_0xd9e0('0x15')](function(_0x386816){logger[_0xd9e0('0x12')](_0xd9e0('0xd'),_0x36d1c7,_0x386816);_0x3315d8(_0x386816);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index df8fcd0..4d64bc6 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 _0xffca=['index','isAuthenticated','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','./voiceContext.controller','get'];(function(_0x205a4c,_0x42d7f8){var _0x55ff29=function(_0x5d78b4){while(--_0x5d78b4){_0x205a4c['push'](_0x205a4c['shift']());}};_0x55ff29(++_0x42d7f8);}(_0xffca,0x1e8));var _0xaffc=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xffca[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xaffc('0x0'));var util=require(_0xaffc('0x1'));var path=require('path');var timeout=require(_0xaffc('0x2'));var express=require(_0xaffc('0x3'));var router=express[_0xaffc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaffc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaffc('0x6'));router[_0xaffc('0x7')]('/',auth['isAuthenticated'](),controller[_0xaffc('0x8')]);router['get']('/:id',auth[_0xaffc('0x9')](),controller['show']);router['post']('/',auth[_0xaffc('0x9')](),controller[_0xaffc('0xa')]);router[_0xaffc('0xb')](_0xaffc('0xc'),auth[_0xaffc('0x9')](),controller[_0xaffc('0xd')]);router[_0xaffc('0xe')](_0xaffc('0xc'),auth[_0xaffc('0x9')](),controller[_0xaffc('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9f42=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util'];(function(_0x131dfa,_0x211476){var _0x1bd6e4=function(_0xc16647){while(--_0xc16647){_0x131dfa['push'](_0x131dfa['shift']());}};_0x1bd6e4(++_0x211476);}(_0x9f42,0xfe));var _0x29f4=function(_0x40c08f,_0x2020b8){_0x40c08f=_0x40c08f-0x0;var _0x4ef613=_0x9f42[_0x40c08f];return _0x4ef613;};'use strict';var multer=require(_0x29f4('0x0'));var util=require(_0x29f4('0x1'));var path=require('path');var timeout=require(_0x29f4('0x2'));var express=require('express');var router=express[_0x29f4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x29f4('0x4'));var interaction=require(_0x29f4('0x5'));var config=require('../../config/environment');var controller=require(_0x29f4('0x6'));router['get']('/',auth[_0x29f4('0x7')](),controller[_0x29f4('0x8')]);router['get'](_0x29f4('0x9'),auth[_0x29f4('0x7')](),controller[_0x29f4('0xa')]);router[_0x29f4('0xb')]('/',auth[_0x29f4('0x7')](),controller['create']);router[_0x29f4('0xc')]('/:id',auth[_0x29f4('0x7')](),controller[_0x29f4('0xd')]);router[_0x29f4('0xe')](_0x29f4('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x29f4('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 355cb1b..4ced36e 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 _0x22ac=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x50c585,_0x24b2d5){var _0x3a7c03=function(_0x1861b0){while(--_0x1861b0){_0x50c585['push'](_0x50c585['shift']());}};_0x3a7c03(++_0x24b2d5);}(_0x22ac,0x77));var _0xc22a=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0x22ac[_0x400322];return _0xfdd597;};'use strict';var Sequelize=require(_0xc22a('0x0'));module[_0xc22a('0x1')]={'name':{'type':Sequelize[_0xc22a('0x2')],'unique':_0xc22a('0x3')},'description':{'type':Sequelize[_0xc22a('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xc22a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcc01=['STRING','BOOLEAN','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc01,0x1bb));var _0x1cc0=function(_0x584283,_0x1032da){_0x584283=_0x584283-0x0;var _0x47beaf=_0xcc01[_0x584283];return _0x47beaf;};'use strict';var Sequelize=require('sequelize');module[_0x1cc0('0x0')]={'name':{'type':Sequelize[_0x1cc0('0x1')],'unique':'name'},'description':{'type':Sequelize[_0x1cc0('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x1cc0('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 71d1f22..331b3ba 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 _0x3948=['debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','save','update','get','stack','name','send','index','VoiceContext','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','includeAll','include','params','keys','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','info','request\x20sent'];(function(_0x3c162a,_0x56d4ac){var _0x340794=function(_0x2c3c14){while(--_0x2c3c14){_0x3c162a['push'](_0x3c162a['shift']());}};_0x340794(++_0x56d4ac);}(_0x3948,0x168));var _0x8394=function(_0x3fb725,_0x118ff6){_0x3fb725=_0x3fb725-0x0;var _0x21238e=_0x3948[_0x3fb725];return _0x21238e;};'use strict';var emlformat=require(_0x8394('0x0'));var rimraf=require(_0x8394('0x1'));var zipdir=require(_0x8394('0x2'));var jsonpatch=require(_0x8394('0x3'));var rp=require(_0x8394('0x4'));var moment=require(_0x8394('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8394('0x6'));var path=require(_0x8394('0x7'));var sox=require(_0x8394('0x8'));var csv=require(_0x8394('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8394('0xa'));var _=require('lodash');var squel=require(_0x8394('0xb'));var crypto=require(_0x8394('0xc'));var jsforce=require(_0x8394('0xd'));var deskjs=require(_0x8394('0xe'));var toCsv=require(_0x8394('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8394('0xf'));var hardwareService=require(_0x8394('0x10'));var logger=require(_0x8394('0x11'))(_0x8394('0x12'));var utils=require(_0x8394('0x13'));var config=require(_0x8394('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8394('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x8394('0x16')][_0x8394('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x71ed05,_0x414a69,_0x1dfbcf,_0x4f3e5d){return new BPromise(function(_0xdde336,_0x1c87fb){var _0x6cc641=_0x4f3e5d||client;return _0x6cc641[_0x8394('0x18')](_0x71ed05,_0x1dfbcf)[_0x8394('0x19')](function(_0x2a8962){logger[_0x8394('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x414a69,_0x8394('0x1b'));logger[_0x8394('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x414a69,_0x8394('0x1b'),JSON[_0x8394('0x1d')](_0x2a8962));if(_0x2a8962[_0x8394('0x1e')]){if(_0x2a8962[_0x8394('0x1e')][_0x8394('0x1f')]===0x1f4){logger[_0x8394('0x1e')](_0x8394('0x20'),_0x414a69,_0x2a8962['error'][_0x8394('0x21')]);return _0x1c87fb(_0x2a8962['error'][_0x8394('0x21')]);}logger[_0x8394('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x414a69,_0x2a8962[_0x8394('0x1e')][_0x8394('0x21')]);return _0xdde336(_0x2a8962['error'][_0x8394('0x21')]);}else{logger[_0x8394('0x1a')](_0x8394('0x20'),_0x414a69,_0x8394('0x1b'));_0xdde336(_0x2a8962[_0x8394('0x22')][_0x8394('0x21')]);}})[_0x8394('0x23')](function(_0x26f235){logger[_0x8394('0x1e')](_0x8394('0x20'),_0x414a69,_0x26f235);_0x1c87fb(_0x26f235);});});}function respondWithStatusCode(_0x36acd5,_0x4dc776){_0x4dc776=_0x4dc776||0xcc;return function(_0x4a0958){if(_0x4a0958){return _0x36acd5[_0x8394('0x24')](_0x4dc776);}return _0x36acd5['status'](_0x4dc776)[_0x8394('0x25')]();};}function respondWithResult(_0x42ec93,_0x1132e4){_0x1132e4=_0x1132e4||0xc8;return function(_0x5356bb){if(_0x5356bb){return _0x42ec93[_0x8394('0x26')](_0x1132e4)[_0x8394('0x27')](_0x5356bb);}};}function respondWithFilteredResult(_0x40697e,_0x39c0a7){return function(_0x215919){if(_0x215919){var _0x3c1a0d=typeof _0x39c0a7[_0x8394('0x28')]==='undefined'&&typeof _0x39c0a7['limit']===_0x8394('0x29');var _0x343a36=_0x215919[_0x8394('0x2a')];var _0x326103=_0x3c1a0d?0x0:_0x39c0a7['offset'];var _0x4fa478=_0x3c1a0d?_0x215919[_0x8394('0x2a')]:_0x39c0a7[_0x8394('0x28')]+_0x39c0a7[_0x8394('0x2b')];var _0x2cf3ba;if(_0x4fa478>=_0x343a36){_0x4fa478=_0x343a36;_0x2cf3ba=0xc8;}else{_0x2cf3ba=0xce;}_0x40697e[_0x8394('0x26')](_0x2cf3ba);return _0x40697e[_0x8394('0x2c')]('Content-Range',_0x326103+'-'+_0x4fa478+'/'+_0x343a36)[_0x8394('0x27')](_0x215919);}return null;};}function patchUpdates(_0x1fb063){return function(_0x620ad2){try{jsonpatch['apply'](_0x620ad2,_0x1fb063,!![]);}catch(_0x305fc6){return BPromise[_0x8394('0x2d')](_0x305fc6);}return _0x620ad2[_0x8394('0x2e')]();};}function saveUpdates(_0x18ee8b,_0x12fe2f){return function(_0x396d5a){if(_0x396d5a){return _0x396d5a[_0x8394('0x2f')](_0x18ee8b)[_0x8394('0x19')](function(_0x151c68){return _0x151c68;});}return null;};}function removeEntity(_0x25ab86,_0x22f7b3){return function(_0x441d2e){if(_0x441d2e){return _0x441d2e['destroy']()[_0x8394('0x19')](function(){var _0x5e61bc=_0x441d2e[_0x8394('0x30')]({'plain':!![]});var _0x11c1b5='Contexts';return db['UserProfileResource']['destroy']({'where':{'type':_0x11c1b5,'resourceId':_0x5e61bc['id']}})[_0x8394('0x19')](function(){return _0x441d2e;});})[_0x8394('0x19')](function(){_0x25ab86[_0x8394('0x26')](0xcc)[_0x8394('0x25')]();});}};}function handleEntityNotFound(_0x1dab5d,_0x4321d9){return function(_0x5595c2){if(!_0x5595c2){_0x1dab5d['sendStatus'](0x194);}return _0x5595c2;};}function handleError(_0x1c52b8,_0x335631){_0x335631=_0x335631||0x1f4;return function(_0x5bee3b){logger[_0x8394('0x1e')](_0x5bee3b[_0x8394('0x31')]);if(_0x5bee3b['name']){delete _0x5bee3b[_0x8394('0x32')];}_0x1c52b8[_0x8394('0x26')](_0x335631)[_0x8394('0x33')](_0x5bee3b);};}exports[_0x8394('0x34')]=function(_0x6e658d,_0x1fbefe){var _0x519145={},_0x40e8bd={},_0x18158c={'count':0x0,'rows':[]};var _0x1ff041=_['map'](db[_0x8394('0x35')][_0x8394('0x36')],function(_0x2f4a43){return{'name':_0x2f4a43['fieldName'],'type':_0x2f4a43[_0x8394('0x37')]['key']};});_0x40e8bd[_0x8394('0x38')]=_[_0x8394('0x39')](_0x1ff041,_0x8394('0x32'));_0x40e8bd[_0x8394('0x3a')]=_['keys'](_0x6e658d[_0x8394('0x3a')]);_0x40e8bd[_0x8394('0x3b')]=_[_0x8394('0x3c')](_0x40e8bd['model'],_0x40e8bd[_0x8394('0x3a')]);_0x519145[_0x8394('0x3d')]=_[_0x8394('0x3c')](_0x40e8bd[_0x8394('0x38')],qs[_0x8394('0x3e')](_0x6e658d['query'][_0x8394('0x3e')]));_0x519145[_0x8394('0x3d')]=_0x519145[_0x8394('0x3d')][_0x8394('0x3f')]?_0x519145[_0x8394('0x3d')]:_0x40e8bd[_0x8394('0x38')];if(!_0x6e658d['query'][_0x8394('0x40')](_0x8394('0x41'))){_0x519145['limit']=qs[_0x8394('0x2b')](_0x6e658d[_0x8394('0x3a')][_0x8394('0x2b')]);_0x519145[_0x8394('0x28')]=qs[_0x8394('0x28')](_0x6e658d[_0x8394('0x3a')][_0x8394('0x28')]);}_0x519145[_0x8394('0x42')]=qs['sort'](_0x6e658d['query']['sort']);_0x519145[_0x8394('0x43')]=qs[_0x8394('0x3b')](_[_0x8394('0x44')](_0x6e658d[_0x8394('0x3a')],_0x40e8bd[_0x8394('0x3b')]),_0x1ff041);if(_0x6e658d[_0x8394('0x3a')][_0x8394('0x45')]){_0x519145[_0x8394('0x43')]=_[_0x8394('0x46')](_0x519145[_0x8394('0x43')],{'$or':_[_0x8394('0x39')](_0x1ff041,function(_0x41291b){if(_0x41291b[_0x8394('0x37')]!=='VIRTUAL'){var _0x1253e5={};_0x1253e5[_0x41291b[_0x8394('0x32')]]={'$like':'%'+_0x6e658d[_0x8394('0x3a')]['filter']+'%'};return _0x1253e5;}})});}_0x519145=_[_0x8394('0x46')]({},_0x519145,_0x6e658d['options']);var _0x952cc0={'where':_0x519145[_0x8394('0x43')]};return db[_0x8394('0x35')][_0x8394('0x2a')](_0x952cc0)['then'](function(_0x489a20){_0x18158c[_0x8394('0x2a')]=_0x489a20;if(_0x6e658d[_0x8394('0x3a')][_0x8394('0x47')]){_0x519145[_0x8394('0x48')]=[{'all':!![]}];}return db[_0x8394('0x35')]['findAll'](_0x519145);})[_0x8394('0x19')](function(_0x3c54ee){_0x18158c['rows']=_0x3c54ee;return _0x18158c;})['then'](respondWithFilteredResult(_0x1fbefe,_0x519145))[_0x8394('0x23')](handleError(_0x1fbefe,null));};exports['show']=function(_0x5cb388,_0x430f11){var _0x46f93b={'raw':![],'where':{'id':_0x5cb388[_0x8394('0x49')]['id']}},_0x919b0={};_0x919b0[_0x8394('0x38')]=_[_0x8394('0x4a')](db[_0x8394('0x35')]['rawAttributes']);_0x919b0[_0x8394('0x3a')]=_['keys'](_0x5cb388[_0x8394('0x3a')]);_0x919b0[_0x8394('0x3b')]=_[_0x8394('0x3c')](_0x919b0[_0x8394('0x38')],_0x919b0[_0x8394('0x3a')]);_0x46f93b['attributes']=_[_0x8394('0x3c')](_0x919b0['model'],qs['fields'](_0x5cb388[_0x8394('0x3a')][_0x8394('0x3e')]));_0x46f93b[_0x8394('0x3d')]=_0x46f93b['attributes'][_0x8394('0x3f')]?_0x46f93b['attributes']:_0x919b0[_0x8394('0x38')];if(_0x5cb388[_0x8394('0x3a')][_0x8394('0x47')]){_0x46f93b['include']=[{'all':!![]}];}_0x46f93b=_['merge']({},_0x46f93b,_0x5cb388['options']);return db[_0x8394('0x35')][_0x8394('0x4b')](_0x46f93b)['then'](handleEntityNotFound(_0x430f11,null))['then'](respondWithResult(_0x430f11,null))[_0x8394('0x23')](handleError(_0x430f11,null));};exports[_0x8394('0x4c')]=function(_0x3db4c9,_0x5244e9,_0x5a8719){var _0x25c03f;return db[_0x8394('0x35')][_0x8394('0x4c')](_0x3db4c9[_0x8394('0x4d')],{'raw':!![]})[_0x8394('0x19')](function(_0x2e4825){_0x25c03f=_0x2e4825;return db[_0x8394('0x35')][_0x8394('0x4e')]({'raw':!![]});})['then'](function(_0x3c9cf1){var _0x1dc923=fs[_0x8394('0x4f')](path[_0x8394('0x50')](config[_0x8394('0x51')],_0x8394('0x52')),_0x8394('0x53'));var _0x21f412=ejs[_0x8394('0x54')](_0x1dc923,{'contexts':_0x3c9cf1||[]});fs[_0x8394('0x55')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x21f412);})[_0x8394('0x19')](function(){return respondWithRpcPromise(_0x8394('0x56'),_0x8394('0x4c'),{'module':'chan_sip.so'});})[_0x8394('0x19')](function(){var _0x3a7ce2=_0x3db4c9[_0x8394('0x57')]['get']({'plain':!![]});if(!_0x3a7ce2)throw new Error(_0x8394('0x58'));if(_0x3a7ce2[_0x8394('0x59')]===_0x8394('0x57')){var _0x25a991=_0x25c03f[_0x8394('0x30')]({'plain':!![]});return db[_0x8394('0x5a')]['find']({'where':{'name':_0x8394('0x5b'),'userProfileId':_0x3a7ce2[_0x8394('0x5c')]},'raw':!![]})[_0x8394('0x19')](function(_0x2880d0){if(_0x2880d0&&_0x2880d0[_0x8394('0x5d')]===0x0){return db['UserProfileResource'][_0x8394('0x4c')]({'name':_0x25a991[_0x8394('0x32')],'resourceId':_0x25a991['id'],'type':_0x2880d0[_0x8394('0x32')],'sectionId':_0x2880d0['id']},{})['then'](function(){return _0x25c03f;});}else{return _0x25c03f;}})['catch'](function(_0x1b0045){logger[_0x8394('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b0045);throw _0x1b0045;});}return _0x25c03f;})[_0x8394('0x19')](respondWithResult(_0x5244e9,0xc9))[_0x8394('0x23')](handleError(_0x5244e9,null));};exports[_0x8394('0x2f')]=function(_0x4a5de0,_0x22876e,_0x1357a5){var _0x5080b1;return db[_0x8394('0x35')][_0x8394('0x4b')]({'where':{'id':_0x4a5de0[_0x8394('0x49')]['id']}})['then'](handleEntityNotFound(_0x22876e,null))[_0x8394('0x19')](saveUpdates(_0x4a5de0[_0x8394('0x4d')],null))[_0x8394('0x19')](function(_0x457c0e){if(_0x457c0e){_0x5080b1=_0x457c0e;return db['VoiceContext'][_0x8394('0x4e')]({'raw':!![]});}})['then'](function(_0x37266c){var _0xb665a5=fs[_0x8394('0x4f')](path['join'](config['root'],_0x8394('0x52')),_0x8394('0x53'));var _0x413ee0=ejs[_0x8394('0x54')](_0xb665a5,{'contexts':_0x37266c||[]});fs[_0x8394('0x55')](_0x8394('0x5e'),_0x413ee0);})[_0x8394('0x19')](function(){return respondWithRpcPromise(_0x8394('0x56'),_0x8394('0x2f'),{'module':_0x8394('0x5f')});})['then'](function(){return _0x5080b1;})['then'](respondWithResult(_0x22876e,null))[_0x8394('0x23')](handleError(_0x22876e,null));};exports['destroy']=function(_0x49f085,_0x3e6a7c,_0x3f0f63){var _0x25cfdc;return db['VoiceContext'][_0x8394('0x4b')]({'where':{'id':_0x49f085[_0x8394('0x49')]['id']}})[_0x8394('0x19')](handleEntityNotFound(_0x3e6a7c,null))['then'](removeEntity(_0x3e6a7c,null))[_0x8394('0x19')](function(){return db[_0x8394('0x35')][_0x8394('0x4e')]({'raw':!![]});})[_0x8394('0x19')](function(_0x3ee923){var _0x4e41ff=fs['readFileSync'](path[_0x8394('0x50')](config[_0x8394('0x51')],_0x8394('0x52')),_0x8394('0x53'));var _0x334886=ejs[_0x8394('0x54')](_0x4e41ff,{'contexts':_0x3ee923});fs[_0x8394('0x55')](_0x8394('0x5e'),_0x334886);return respondWithRpcPromise(_0x8394('0x56'),_0x8394('0x60'),{'module':'chan_sip.so'});})[_0x8394('0x23')](handleError(_0x3e6a7c,null));}; \ No newline at end of file +var _0xe449=['server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','utf8','join','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','model','length','merge','find','create','body','root'];(function(_0x4d0e33,_0x21d7dd){var _0x155593=function(_0x2320a6){while(--_0x2320a6){_0x4d0e33['push'](_0x4d0e33['shift']());}};_0x155593(++_0x21d7dd);}(_0xe449,0x7b));var _0x9e44=function(_0x175fd7,_0xd98c9c){_0x175fd7=_0x175fd7-0x0;var _0x25e2a2=_0xe449[_0x175fd7];return _0x25e2a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e44('0x0'));var zipdir=require(_0x9e44('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e44('0x2'));var moment=require(_0x9e44('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9e44('0x4'));var util=require('util');var path=require(_0x9e44('0x5'));var sox=require(_0x9e44('0x6'));var csv=require(_0x9e44('0x7'));var ejs=require(_0x9e44('0x8'));var fs=require('fs');var fs_extra=require(_0x9e44('0x9'));var _=require(_0x9e44('0xa'));var squel=require(_0x9e44('0xb'));var crypto=require(_0x9e44('0xc'));var jsforce=require(_0x9e44('0xd'));var deskjs=require(_0x9e44('0xe'));var toCsv=require(_0x9e44('0x7'));var querystring=require('querystring');var Papa=require(_0x9e44('0xf'));var Redis=require(_0x9e44('0x10'));var authService=require(_0x9e44('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9e44('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e44('0x13'))(_0x9e44('0x14'));var utils=require('../../config/utils');var config=require(_0x9e44('0x15'));var licenseUtil=require(_0x9e44('0x16'));var db=require(_0x9e44('0x17'))['db'];var jayson=require(_0x9e44('0x18'));var client=jayson[_0x9e44('0x19')][_0x9e44('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3aec9a,_0x22a529,_0x4ee23f,_0x306eda){return new BPromise(function(_0x2f9b95,_0x2476ec){var _0x595c7e=_0x306eda||client;return _0x595c7e[_0x9e44('0x1b')](_0x3aec9a,_0x4ee23f)['then'](function(_0x34f43a){logger[_0x9e44('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x22a529,_0x9e44('0x1d'));logger[_0x9e44('0x1e')](_0x9e44('0x1f'),_0x22a529,_0x9e44('0x1d'),JSON['stringify'](_0x34f43a));if(_0x34f43a[_0x9e44('0x20')]){if(_0x34f43a[_0x9e44('0x20')][_0x9e44('0x21')]===0x1f4){logger[_0x9e44('0x20')](_0x9e44('0x22'),_0x22a529,_0x34f43a[_0x9e44('0x20')][_0x9e44('0x23')]);return _0x2476ec(_0x34f43a[_0x9e44('0x20')]['message']);}logger[_0x9e44('0x20')](_0x9e44('0x22'),_0x22a529,_0x34f43a[_0x9e44('0x20')][_0x9e44('0x23')]);return _0x2f9b95(_0x34f43a[_0x9e44('0x20')]['message']);}else{logger[_0x9e44('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x22a529,_0x9e44('0x1d'));_0x2f9b95(_0x34f43a[_0x9e44('0x24')]['message']);}})[_0x9e44('0x25')](function(_0x26d8b1){logger['error'](_0x9e44('0x22'),_0x22a529,_0x26d8b1);_0x2476ec(_0x26d8b1);});});}function respondWithStatusCode(_0x4ea87f,_0x54d8e7){_0x54d8e7=_0x54d8e7||0xcc;return function(_0x1212b3){if(_0x1212b3){return _0x4ea87f['sendStatus'](_0x54d8e7);}return _0x4ea87f[_0x9e44('0x26')](_0x54d8e7)['end']();};}function respondWithResult(_0x4d1a07,_0x1c5f5f){_0x1c5f5f=_0x1c5f5f||0xc8;return function(_0x10b2ae){if(_0x10b2ae){return _0x4d1a07['status'](_0x1c5f5f)[_0x9e44('0x27')](_0x10b2ae);}};}function respondWithFilteredResult(_0xdb5060,_0x270586){return function(_0x1f1758){if(_0x1f1758){var _0x2338a3=typeof _0x270586['offset']===_0x9e44('0x28')&&typeof _0x270586[_0x9e44('0x29')]===_0x9e44('0x28');var _0x44226d=_0x1f1758[_0x9e44('0x2a')];var _0x45cf33=_0x2338a3?0x0:_0x270586[_0x9e44('0x2b')];var _0x54ad01=_0x2338a3?_0x1f1758[_0x9e44('0x2a')]:_0x270586['offset']+_0x270586[_0x9e44('0x29')];var _0x540f0a;if(_0x54ad01>=_0x44226d){_0x54ad01=_0x44226d;_0x540f0a=0xc8;}else{_0x540f0a=0xce;}_0xdb5060[_0x9e44('0x26')](_0x540f0a);return _0xdb5060[_0x9e44('0x2c')](_0x9e44('0x2d'),_0x45cf33+'-'+_0x54ad01+'/'+_0x44226d)[_0x9e44('0x27')](_0x1f1758);}return null;};}function patchUpdates(_0x30da1d){return function(_0x355e27){try{jsonpatch[_0x9e44('0x2e')](_0x355e27,_0x30da1d,!![]);}catch(_0x35b3f5){return BPromise[_0x9e44('0x2f')](_0x35b3f5);}return _0x355e27[_0x9e44('0x30')]();};}function saveUpdates(_0xfda4d4,_0x2d1a33){return function(_0x1062ae){if(_0x1062ae){return _0x1062ae[_0x9e44('0x31')](_0xfda4d4)[_0x9e44('0x32')](function(_0x34a462){return _0x34a462;});}return null;};}function removeEntity(_0xff81d6,_0x5a6758){return function(_0x30a4e7){if(_0x30a4e7){return _0x30a4e7[_0x9e44('0x33')]()['then'](function(){var _0x40fcce=_0x30a4e7[_0x9e44('0x34')]({'plain':!![]});var _0xbff08f='Contexts';return db[_0x9e44('0x35')]['destroy']({'where':{'type':_0xbff08f,'resourceId':_0x40fcce['id']}})[_0x9e44('0x32')](function(){return _0x30a4e7;});})['then'](function(){_0xff81d6[_0x9e44('0x26')](0xcc)[_0x9e44('0x36')]();});}};}function handleEntityNotFound(_0x13158e,_0x3e4d6b){return function(_0x4d7d78){if(!_0x4d7d78){_0x13158e[_0x9e44('0x37')](0x194);}return _0x4d7d78;};}function handleError(_0x36cbd0,_0x292f96){_0x292f96=_0x292f96||0x1f4;return function(_0x5d1c80){logger[_0x9e44('0x20')](_0x5d1c80[_0x9e44('0x38')]);if(_0x5d1c80[_0x9e44('0x39')]){delete _0x5d1c80[_0x9e44('0x39')];}_0x36cbd0[_0x9e44('0x26')](_0x292f96)[_0x9e44('0x3a')](_0x5d1c80);};}exports[_0x9e44('0x3b')]=function(_0x182d37,_0x2f8f9c){var _0x38b0d1={},_0x3ac64f={},_0x19b8e1={'count':0x0,'rows':[]};var _0x1e37fa=_[_0x9e44('0x3c')](db[_0x9e44('0x3d')][_0x9e44('0x3e')],function(_0xfe8f86){return{'name':_0xfe8f86[_0x9e44('0x3f')],'type':_0xfe8f86[_0x9e44('0x40')][_0x9e44('0x41')]};});_0x3ac64f['model']=_['map'](_0x1e37fa,'name');_0x3ac64f[_0x9e44('0x42')]=_[_0x9e44('0x43')](_0x182d37[_0x9e44('0x42')]);_0x3ac64f[_0x9e44('0x44')]=_['intersection'](_0x3ac64f['model'],_0x3ac64f['query']);_0x38b0d1[_0x9e44('0x45')]=_[_0x9e44('0x46')](_0x3ac64f['model'],qs[_0x9e44('0x47')](_0x182d37[_0x9e44('0x42')][_0x9e44('0x47')]));_0x38b0d1[_0x9e44('0x45')]=_0x38b0d1['attributes']['length']?_0x38b0d1[_0x9e44('0x45')]:_0x3ac64f['model'];if(!_0x182d37['query']['hasOwnProperty'](_0x9e44('0x48'))){_0x38b0d1[_0x9e44('0x29')]=qs[_0x9e44('0x29')](_0x182d37[_0x9e44('0x42')]['limit']);_0x38b0d1[_0x9e44('0x2b')]=qs[_0x9e44('0x2b')](_0x182d37[_0x9e44('0x42')][_0x9e44('0x2b')]);}_0x38b0d1[_0x9e44('0x49')]=qs['sort'](_0x182d37[_0x9e44('0x42')][_0x9e44('0x4a')]);_0x38b0d1['where']=qs[_0x9e44('0x44')](_[_0x9e44('0x4b')](_0x182d37[_0x9e44('0x42')],_0x3ac64f[_0x9e44('0x44')]),_0x1e37fa);if(_0x182d37[_0x9e44('0x42')][_0x9e44('0x4c')]){_0x38b0d1[_0x9e44('0x4d')]=_['merge'](_0x38b0d1['where'],{'$or':_[_0x9e44('0x3c')](_0x1e37fa,function(_0x1a0ccd){if(_0x1a0ccd[_0x9e44('0x40')]!==_0x9e44('0x4e')){var _0x31058a={};_0x31058a[_0x1a0ccd[_0x9e44('0x39')]]={'$like':'%'+_0x182d37['query'][_0x9e44('0x4c')]+'%'};return _0x31058a;}})});}_0x38b0d1=_['merge']({},_0x38b0d1,_0x182d37[_0x9e44('0x4f')]);var _0x1a8785={'where':_0x38b0d1[_0x9e44('0x4d')]};return db[_0x9e44('0x3d')][_0x9e44('0x2a')](_0x1a8785)['then'](function(_0x39c63f){_0x19b8e1[_0x9e44('0x2a')]=_0x39c63f;if(_0x182d37[_0x9e44('0x42')][_0x9e44('0x50')]){_0x38b0d1[_0x9e44('0x51')]=[{'all':!![]}];}return db[_0x9e44('0x3d')][_0x9e44('0x52')](_0x38b0d1);})[_0x9e44('0x32')](function(_0x137abf){_0x19b8e1[_0x9e44('0x53')]=_0x137abf;return _0x19b8e1;})[_0x9e44('0x32')](respondWithFilteredResult(_0x2f8f9c,_0x38b0d1))[_0x9e44('0x25')](handleError(_0x2f8f9c,null));};exports[_0x9e44('0x54')]=function(_0x3e5ae3,_0x548bed){var _0x3610c4={'raw':![],'where':{'id':_0x3e5ae3[_0x9e44('0x55')]['id']}},_0x298590={};_0x298590[_0x9e44('0x56')]=_[_0x9e44('0x43')](db['VoiceContext'][_0x9e44('0x3e')]);_0x298590[_0x9e44('0x42')]=_[_0x9e44('0x43')](_0x3e5ae3[_0x9e44('0x42')]);_0x298590['filters']=_[_0x9e44('0x46')](_0x298590[_0x9e44('0x56')],_0x298590[_0x9e44('0x42')]);_0x3610c4[_0x9e44('0x45')]=_[_0x9e44('0x46')](_0x298590[_0x9e44('0x56')],qs['fields'](_0x3e5ae3[_0x9e44('0x42')]['fields']));_0x3610c4[_0x9e44('0x45')]=_0x3610c4['attributes'][_0x9e44('0x57')]?_0x3610c4['attributes']:_0x298590[_0x9e44('0x56')];if(_0x3e5ae3[_0x9e44('0x42')][_0x9e44('0x50')]){_0x3610c4[_0x9e44('0x51')]=[{'all':!![]}];}_0x3610c4=_[_0x9e44('0x58')]({},_0x3610c4,_0x3e5ae3[_0x9e44('0x4f')]);return db[_0x9e44('0x3d')][_0x9e44('0x59')](_0x3610c4)[_0x9e44('0x32')](handleEntityNotFound(_0x548bed,null))[_0x9e44('0x32')](respondWithResult(_0x548bed,null))[_0x9e44('0x25')](handleError(_0x548bed,null));};exports[_0x9e44('0x5a')]=function(_0x13cb19,_0x197feb,_0xd37b44){var _0x47001;return db[_0x9e44('0x3d')][_0x9e44('0x5a')](_0x13cb19[_0x9e44('0x5b')],{'raw':!![]})[_0x9e44('0x32')](function(_0x5db4b4){_0x47001=_0x5db4b4;return db[_0x9e44('0x3d')]['findAll']({'raw':!![]});})['then'](function(_0xbd5ed7){var _0x29513d=fs['readFileSync'](path['join'](config[_0x9e44('0x5c')],_0x9e44('0x5d')),'utf8');var _0x5aa72f=ejs[_0x9e44('0x5e')](_0x29513d,{'contexts':_0xbd5ed7||[]});fs[_0x9e44('0x5f')](_0x9e44('0x60'),_0x5aa72f);})[_0x9e44('0x32')](function(){return respondWithRpcPromise(_0x9e44('0x61'),_0x9e44('0x5a'),{'module':_0x9e44('0x62')});})[_0x9e44('0x32')](function(){var _0x4e0cdc=_0x13cb19['user'][_0x9e44('0x34')]({'plain':!![]});if(!_0x4e0cdc)throw new Error(_0x9e44('0x63'));if(_0x4e0cdc[_0x9e44('0x64')]==='user'){var _0x1ca54f=_0x47001['get']({'plain':!![]});return db[_0x9e44('0x65')][_0x9e44('0x59')]({'where':{'name':'Contexts','userProfileId':_0x4e0cdc[_0x9e44('0x66')]},'raw':!![]})[_0x9e44('0x32')](function(_0x12820c){if(_0x12820c&&_0x12820c[_0x9e44('0x67')]===0x0){return db[_0x9e44('0x35')][_0x9e44('0x5a')]({'name':_0x1ca54f[_0x9e44('0x39')],'resourceId':_0x1ca54f['id'],'type':_0x12820c[_0x9e44('0x39')],'sectionId':_0x12820c['id']},{})['then'](function(){return _0x47001;});}else{return _0x47001;}})['catch'](function(_0x15aa31){logger[_0x9e44('0x20')](_0x9e44('0x68'),_0x15aa31);throw _0x15aa31;});}return _0x47001;})['then'](respondWithResult(_0x197feb,0xc9))['catch'](handleError(_0x197feb,null));};exports[_0x9e44('0x31')]=function(_0x4097d7,_0x2583a2,_0x252c03){var _0x4af899;return db['VoiceContext'][_0x9e44('0x59')]({'where':{'id':_0x4097d7[_0x9e44('0x55')]['id']}})[_0x9e44('0x32')](handleEntityNotFound(_0x2583a2,null))['then'](saveUpdates(_0x4097d7[_0x9e44('0x5b')],null))[_0x9e44('0x32')](function(_0x12f143){if(_0x12f143){_0x4af899=_0x12f143;return db[_0x9e44('0x3d')][_0x9e44('0x52')]({'raw':!![]});}})[_0x9e44('0x32')](function(_0x12fd09){var _0x383d1d=fs[_0x9e44('0x69')](path['join'](config[_0x9e44('0x5c')],_0x9e44('0x5d')),_0x9e44('0x6a'));var _0x31816f=ejs[_0x9e44('0x5e')](_0x383d1d,{'contexts':_0x12fd09||[]});fs[_0x9e44('0x5f')](_0x9e44('0x60'),_0x31816f);})[_0x9e44('0x32')](function(){return respondWithRpcPromise(_0x9e44('0x61'),_0x9e44('0x31'),{'module':_0x9e44('0x62')});})[_0x9e44('0x32')](function(){return _0x4af899;})['then'](respondWithResult(_0x2583a2,null))['catch'](handleError(_0x2583a2,null));};exports['destroy']=function(_0xf0bb7e,_0x263e33,_0x4939a7){var _0x89236e;return db[_0x9e44('0x3d')][_0x9e44('0x59')]({'where':{'id':_0xf0bb7e[_0x9e44('0x55')]['id']}})[_0x9e44('0x32')](handleEntityNotFound(_0x263e33,null))[_0x9e44('0x32')](removeEntity(_0x263e33,null))[_0x9e44('0x32')](function(){return db['VoiceContext'][_0x9e44('0x52')]({'raw':!![]});})[_0x9e44('0x32')](function(_0x45906f){var _0x4f6bc6=fs[_0x9e44('0x69')](path[_0x9e44('0x6b')](config[_0x9e44('0x5c')],_0x9e44('0x5d')),'utf8');var _0x518c3e=ejs[_0x9e44('0x5e')](_0x4f6bc6,{'contexts':_0x45906f});fs[_0x9e44('0x5f')](_0x9e44('0x60'),_0x518c3e);return respondWithRpcPromise(_0x9e44('0x61'),'destroy',{'module':'chan_sip.so'});})[_0x9e44('0x25')](handleError(_0x263e33,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 87dd930..c6cfcdf 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 _0x10ff=['request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash','api','moment'];(function(_0x15e6fe,_0x1a5c39){var _0x34894d=function(_0x32eec2){while(--_0x32eec2){_0x15e6fe['push'](_0x15e6fe['shift']());}};_0x34894d(++_0x1a5c39);}(_0x10ff,0x1b5));var _0xf10f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x10ff[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xf10f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf10f('0x1'));var moment=require(_0xf10f('0x2'));var BPromise=require('bluebird');var rp=require(_0xf10f('0x3'));var fs=require('fs');var path=require(_0xf10f('0x4'));var rimraf=require(_0xf10f('0x5'));var config=require(_0xf10f('0x6'));var attributes=require(_0xf10f('0x7'));module[_0xf10f('0x8')]=function(_0x12186e,_0x38820d){return _0x12186e[_0xf10f('0x9')](_0xf10f('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42dc=['moment','path','rimraf','../../config/environment','./voiceContext.attributes','exports','voice_contexts','../../config/logger'];(function(_0x304dfb,_0x2a0af8){var _0x4f8cfd=function(_0x2a6c33){while(--_0x2a6c33){_0x304dfb['push'](_0x304dfb['shift']());}};_0x4f8cfd(++_0x2a0af8);}(_0x42dc,0x1ef));var _0xc42d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x42dc[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc42d('0x0'))('api');var moment=require(_0xc42d('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc42d('0x2'));var rimraf=require(_0xc42d('0x3'));var config=require(_0xc42d('0x4'));var attributes=require(_0xc42d('0x5'));module[_0xc42d('0x6')]=function(_0x3d2f19,_0x2bbccd){return _0x3d2f19['define']('VoiceContext',attributes,{'tableName':_0xc42d('0x7'),'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 78cb0b7..ecbc034 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 _0x4e64=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x229532,_0x1c0e67){var _0x598c8a=function(_0x3e25ac){while(--_0x3e25ac){_0x229532['push'](_0x229532['shift']());}};_0x598c8a(++_0x1c0e67);}(_0x4e64,0x165));var _0x44e6=function(_0x200af4,_0x8416e8){_0x200af4=_0x200af4-0x0;var _0x3831b6=_0x4e64[_0x200af4];return _0x3831b6;};'use strict';var _=require(_0x44e6('0x0'));var util=require('util');var moment=require(_0x44e6('0x1'));var BPromise=require(_0x44e6('0x2'));var rs=require(_0x44e6('0x3'));var fs=require('fs');var Redis=require(_0x44e6('0x4'));var db=require(_0x44e6('0x5'))['db'];var utils=require(_0x44e6('0x6'));var logger=require(_0x44e6('0x7'))('rpc');var config=require(_0x44e6('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x44e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f956a,_0x5c6460,_0x3e489f){return new BPromise(function(_0x4ff58e,_0x27669c){return client[_0x44e6('0xa')](_0x2f956a,_0x3e489f)[_0x44e6('0xb')](function(_0x1a9d61){logger[_0x44e6('0xc')](_0x44e6('0xd'),_0x5c6460,_0x44e6('0xe'));logger[_0x44e6('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5c6460,_0x44e6('0xe'),JSON[_0x44e6('0x10')](_0x1a9d61));if(_0x1a9d61[_0x44e6('0x11')]){if(_0x1a9d61[_0x44e6('0x11')][_0x44e6('0x12')]===0x1f4){logger['error'](_0x44e6('0xd'),_0x5c6460,_0x1a9d61[_0x44e6('0x11')][_0x44e6('0x13')]);return _0x27669c(_0x1a9d61[_0x44e6('0x11')]['message']);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x5c6460,_0x1a9d61[_0x44e6('0x11')][_0x44e6('0x13')]);return _0x4ff58e(_0x1a9d61[_0x44e6('0x11')][_0x44e6('0x13')]);}else{logger['info'](_0x44e6('0xd'),_0x5c6460,_0x44e6('0xe'));_0x4ff58e(_0x1a9d61[_0x44e6('0x14')][_0x44e6('0x13')]);}})[_0x44e6('0x15')](function(_0xed1d89){logger[_0x44e6('0x11')](_0x44e6('0xd'),_0x5c6460,_0xed1d89);_0x27669c(_0xed1d89);});});} \ No newline at end of file +var _0xd61e=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0xd61e,0x13d));var _0xed61=function(_0x104a57,_0x2ef974){_0x104a57=_0x104a57-0x0;var _0x19822e=_0xd61e[_0x104a57];return _0x19822e;};'use strict';var _=require(_0xed61('0x0'));var util=require(_0xed61('0x1'));var moment=require(_0xed61('0x2'));var BPromise=require(_0xed61('0x3'));var rs=require(_0xed61('0x4'));var fs=require('fs');var Redis=require(_0xed61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xed61('0x6'));var logger=require(_0xed61('0x7'))(_0xed61('0x8'));var config=require(_0xed61('0x9'));var jayson=require(_0xed61('0xa'));var client=jayson[_0xed61('0xb')][_0xed61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b7469,_0x5e6173,_0x59ef0e){return new BPromise(function(_0x5cbbd7,_0x4a2d4c){return client[_0xed61('0xd')](_0x5b7469,_0x59ef0e)[_0xed61('0xe')](function(_0x2964de){logger[_0xed61('0xf')](_0xed61('0x10'),_0x5e6173,'request\x20sent');logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5e6173,_0xed61('0x11'),JSON[_0xed61('0x12')](_0x2964de));if(_0x2964de['error']){if(_0x2964de['error']['code']===0x1f4){logger['error'](_0xed61('0x10'),_0x5e6173,_0x2964de[_0xed61('0x13')][_0xed61('0x14')]);return _0x4a2d4c(_0x2964de[_0xed61('0x13')]['message']);}logger[_0xed61('0x13')](_0xed61('0x10'),_0x5e6173,_0x2964de[_0xed61('0x13')]['message']);return _0x5cbbd7(_0x2964de[_0xed61('0x13')][_0xed61('0x14')]);}else{logger[_0xed61('0xf')](_0xed61('0x10'),_0x5e6173,'request\x20sent');_0x5cbbd7(_0x2964de[_0xed61('0x15')][_0xed61('0x14')]);}})[_0xed61('0x16')](function(_0x6d05cd){logger['error'](_0xed61('0x10'),_0x5e6173,_0x6d05cd);_0x4a2d4c(_0x6d05cd);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index a30f4aa..eab7ec6 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 _0x0410=['/describe','describe','/:id','show','create','put','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index'];(function(_0x5d3421,_0x41f743){var _0x3677e7=function(_0x18717e){while(--_0x18717e){_0x5d3421['push'](_0x5d3421['shift']());}};_0x3677e7(++_0x41f743);}(_0x0410,0x198));var _0x0041=function(_0xf2bc13,_0x18e3bf){_0xf2bc13=_0xf2bc13-0x0;var _0x487df8=_0x0410[_0xf2bc13];return _0x487df8;};'use strict';var multer=require(_0x0041('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0041('0x1'));var express=require(_0x0041('0x2'));var router=express['Router']();var fs_extra=require(_0x0041('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0041('0x4'));var config=require(_0x0041('0x5'));var controller=require(_0x0041('0x6'));router[_0x0041('0x7')]('/',auth[_0x0041('0x8')](),controller[_0x0041('0x9')]);router[_0x0041('0x7')](_0x0041('0xa'),auth[_0x0041('0x8')](),controller[_0x0041('0xb')]);router['get'](_0x0041('0xc'),auth['isAuthenticated'](),controller[_0x0041('0xd')]);router['post']('/',auth[_0x0041('0x8')](),controller[_0x0041('0xe')]);router[_0x0041('0xf')](_0x0041('0xc'),auth[_0x0041('0x8')](),controller[_0x0041('0x10')]);router[_0x0041('0x11')](_0x0041('0xc'),auth[_0x0041('0x8')](),controller['destroy']);module[_0x0041('0x12')]=router; \ No newline at end of file +var _0xce92=['../../components/auth/service','get','index','/describe','isAuthenticated','describe','/:id','post','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5884ee,_0x16f817){var _0x149634=function(_0x58bd22){while(--_0x58bd22){_0x5884ee['push'](_0x5884ee['shift']());}};_0x149634(++_0x16f817);}(_0xce92,0x186));var _0x2ce9=function(_0x2cd9e8,_0x3520ed){_0x2cd9e8=_0x2cd9e8-0x0;var _0x2f712f=_0xce92[_0x2cd9e8];return _0x2f712f;};'use strict';var multer=require(_0x2ce9('0x0'));var util=require('util');var path=require(_0x2ce9('0x1'));var timeout=require(_0x2ce9('0x2'));var express=require(_0x2ce9('0x3'));var router=express[_0x2ce9('0x4')]();var fs_extra=require(_0x2ce9('0x5'));var auth=require(_0x2ce9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x2ce9('0x7')]('/',auth['isAuthenticated'](),controller[_0x2ce9('0x8')]);router[_0x2ce9('0x7')](_0x2ce9('0x9'),auth[_0x2ce9('0xa')](),controller[_0x2ce9('0xb')]);router[_0x2ce9('0x7')](_0x2ce9('0xc'),auth[_0x2ce9('0xa')](),controller['show']);router[_0x2ce9('0xd')]('/',auth[_0x2ce9('0xa')](),controller['create']);router['put'](_0x2ce9('0xc'),auth[_0x2ce9('0xa')](),controller[_0x2ce9('0xe')]);router[_0x2ce9('0xf')]('/:id',auth[_0x2ce9('0xa')](),controller[_0x2ce9('0x10')]);module[_0x2ce9('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 163e7cd..b42671b 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 _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x4c08ee,_0x3ba7e0){var _0x43112a=function(_0x396ec2){while(--_0x396ec2){_0x4c08ee['push'](_0x4c08ee['shift']());}};_0x43112a(++_0x3ba7e0);}(_0xa41a,0x6b));var _0xaa41=function(_0x14221a,_0x5c1b54){_0x14221a=_0x14221a-0x0;var _0x5316cb=_0xa41a[_0x14221a];return _0x5316cb;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x2')]},'channelstate':{'type':Sequelize[_0xaa41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'calleridnum':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'language':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa41('0x2')]},'exten':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaa41('0x2')]},'destchannel':{'type':Sequelize[_0xaa41('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'destlanguage':{'type':Sequelize[_0xaa41('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa41('0x2')]},'destcontext':{'type':Sequelize[_0xaa41('0x2')]},'destexten':{'type':Sequelize[_0xaa41('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaa41('0x2')]},'destlinkedid':{'type':Sequelize[_0xaa41('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa41('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xaa41('0x4')]},'lastevent':{'type':Sequelize[_0xaa41('0x2')],'comment':_0xaa41('0x5')},'routeId':{'type':Sequelize[_0xaa41('0x3')]},'duration':{'type':Sequelize[_0xaa41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xaa41('0x3')]}}; \ No newline at end of file +var _0x84ab=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0xf64e53,_0x4db24b){var _0x1e185e=function(_0x451dc3){while(--_0x451dc3){_0xf64e53['push'](_0xf64e53['shift']());}};_0x1e185e(++_0x4db24b);}(_0x84ab,0x12f));var _0xb84a=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x84ab[_0x1e4150];return _0x1ce3ee;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'privilege':{'type':Sequelize[_0xb84a('0x2')]},'channel':{'type':Sequelize[_0xb84a('0x2')]},'channelstate':{'type':Sequelize[_0xb84a('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb84a('0x2')]},'calleridname':{'type':Sequelize[_0xb84a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'language':{'type':Sequelize[_0xb84a('0x2')]},'accountcode':{'type':Sequelize[_0xb84a('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xb84a('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xb84a('0x2')]},'destchannelstate':{'type':Sequelize[_0xb84a('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb84a('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb84a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'destlanguage':{'type':Sequelize[_0xb84a('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb84a('0x3')]},'destuniqueid':{'type':Sequelize[_0xb84a('0x2')]},'destlinkedid':{'type':Sequelize[_0xb84a('0x2')]},'dialstring':{'type':Sequelize[_0xb84a('0x2')]},'dialstatus':{'type':Sequelize[_0xb84a('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb84a('0x4')]},'endtime':{'type':Sequelize[_0xb84a('0x4')]},'lastevent':{'type':Sequelize[_0xb84a('0x2')],'comment':_0xb84a('0x5')},'routeId':{'type':Sequelize[_0xb84a('0x3')]},'duration':{'type':Sequelize[_0xb84a('0x3')]},'holdtime':{'type':Sequelize[_0xb84a('0x3')]},'billableseconds':{'type':Sequelize[_0xb84a('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 0d9e5d0..70f4aa6 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 _0xb9e0=['error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','VoiceDialReport','findAll','rows','show','params','keys','includeAll','find','catch','body','describe','rimraf','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus'];(function(_0x21c3ac,_0x2a46bb){var _0x3c45ad=function(_0xa506ae){while(--_0xa506ae){_0x21c3ac['push'](_0x21c3ac['shift']());}};_0x3c45ad(++_0x2a46bb);}(_0xb9e0,0xb1));var _0x0b9e=function(_0x2ddf0c,_0x134849){_0x2ddf0c=_0x2ddf0c-0x0;var _0x1cb3d2=_0xb9e0[_0x2ddf0c];return _0x1cb3d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b9e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0b9e('0x1'));var Mustache=require('mustache');var util=require(_0x0b9e('0x2'));var path=require(_0x0b9e('0x3'));var sox=require('sox');var csv=require(_0x0b9e('0x4'));var ejs=require(_0x0b9e('0x5'));var fs=require('fs');var fs_extra=require(_0x0b9e('0x6'));var _=require(_0x0b9e('0x7'));var squel=require(_0x0b9e('0x8'));var crypto=require(_0x0b9e('0x9'));var jsforce=require(_0x0b9e('0xa'));var deskjs=require(_0x0b9e('0xb'));var toCsv=require(_0x0b9e('0x4'));var querystring=require(_0x0b9e('0xc'));var Papa=require(_0x0b9e('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0b9e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b9e('0xf'));var logger=require(_0x0b9e('0x10'))('api');var utils=require(_0x0b9e('0x11'));var config=require(_0x0b9e('0x12'));var licenseUtil=require(_0x0b9e('0x13'));var db=require(_0x0b9e('0x14'))['db'];function respondWithStatusCode(_0x32e10c,_0xc8945d){_0xc8945d=_0xc8945d||0xcc;return function(_0x3adaf6){if(_0x3adaf6){return _0x32e10c['sendStatus'](_0xc8945d);}return _0x32e10c[_0x0b9e('0x15')](_0xc8945d)[_0x0b9e('0x16')]();};}function respondWithResult(_0x215d97,_0x27819a){_0x27819a=_0x27819a||0xc8;return function(_0x8c898f){if(_0x8c898f){return _0x215d97[_0x0b9e('0x15')](_0x27819a)[_0x0b9e('0x17')](_0x8c898f);}};}function respondWithFilteredResult(_0x5ad849,_0x507964){return function(_0x18d1af){if(_0x18d1af){var _0x4650f6=typeof _0x507964['offset']===_0x0b9e('0x18')&&typeof _0x507964[_0x0b9e('0x19')]===_0x0b9e('0x18');var _0x59e6ff=_0x18d1af[_0x0b9e('0x1a')];var _0x2854be=_0x4650f6?0x0:_0x507964['offset'];var _0x53c641=_0x4650f6?_0x18d1af['count']:_0x507964[_0x0b9e('0x1b')]+_0x507964[_0x0b9e('0x19')];var _0x5ee55f;if(_0x53c641>=_0x59e6ff){_0x53c641=_0x59e6ff;_0x5ee55f=0xc8;}else{_0x5ee55f=0xce;}_0x5ad849[_0x0b9e('0x15')](_0x5ee55f);return _0x5ad849[_0x0b9e('0x1c')](_0x0b9e('0x1d'),_0x2854be+'-'+_0x53c641+'/'+_0x59e6ff)['json'](_0x18d1af);}return null;};}function patchUpdates(_0x299369){return function(_0x106510){try{jsonpatch[_0x0b9e('0x1e')](_0x106510,_0x299369,!![]);}catch(_0x182c89){return BPromise[_0x0b9e('0x1f')](_0x182c89);}return _0x106510['save']();};}function saveUpdates(_0x199683,_0xc6cefc){return function(_0xf7e557){if(_0xf7e557){return _0xf7e557[_0x0b9e('0x20')](_0x199683)[_0x0b9e('0x21')](function(_0x463502){return _0x463502;});}return null;};}function removeEntity(_0x6f7670,_0x57775c){return function(_0x68d919){if(_0x68d919){return _0x68d919[_0x0b9e('0x22')]()[_0x0b9e('0x21')](function(){_0x6f7670['status'](0xcc)[_0x0b9e('0x16')]();});}};}function handleEntityNotFound(_0x56f6ef,_0x1ad3fd){return function(_0x151871){if(!_0x151871){_0x56f6ef[_0x0b9e('0x23')](0x194);}return _0x151871;};}function handleError(_0x4e52b5,_0x24393c){_0x24393c=_0x24393c||0x1f4;return function(_0x4d5a97){logger[_0x0b9e('0x24')](_0x4d5a97[_0x0b9e('0x25')]);if(_0x4d5a97[_0x0b9e('0x26')]){delete _0x4d5a97[_0x0b9e('0x26')];}_0x4e52b5['status'](_0x24393c)[_0x0b9e('0x27')](_0x4d5a97);};}exports[_0x0b9e('0x28')]=function(_0x871937,_0x26e330){var _0x44cc84={},_0x3d5fa1={},_0x861a8f={'count':0x0,'rows':[]};var _0x405bbc=_[_0x0b9e('0x29')](db['VoiceDialReport'][_0x0b9e('0x2a')],function(_0x5028f4){return{'name':_0x5028f4['fieldName'],'type':_0x5028f4[_0x0b9e('0x2b')][_0x0b9e('0x2c')]};});_0x3d5fa1[_0x0b9e('0x2d')]=_[_0x0b9e('0x29')](_0x405bbc,'name');_0x3d5fa1[_0x0b9e('0x2e')]=_['keys'](_0x871937[_0x0b9e('0x2e')]);_0x3d5fa1[_0x0b9e('0x2f')]=_[_0x0b9e('0x30')](_0x3d5fa1['model'],_0x3d5fa1[_0x0b9e('0x2e')]);_0x44cc84[_0x0b9e('0x31')]=_['intersection'](_0x3d5fa1['model'],qs[_0x0b9e('0x32')](_0x871937[_0x0b9e('0x2e')][_0x0b9e('0x32')]));_0x44cc84[_0x0b9e('0x31')]=_0x44cc84[_0x0b9e('0x31')][_0x0b9e('0x33')]?_0x44cc84[_0x0b9e('0x31')]:_0x3d5fa1[_0x0b9e('0x2d')];if(!_0x871937[_0x0b9e('0x2e')][_0x0b9e('0x34')]('nolimit')){_0x44cc84[_0x0b9e('0x19')]=qs[_0x0b9e('0x19')](_0x871937[_0x0b9e('0x2e')][_0x0b9e('0x19')]);_0x44cc84[_0x0b9e('0x1b')]=qs['offset'](_0x871937[_0x0b9e('0x2e')][_0x0b9e('0x1b')]);}_0x44cc84[_0x0b9e('0x35')]=qs[_0x0b9e('0x36')](_0x871937[_0x0b9e('0x2e')]['sort']);_0x44cc84[_0x0b9e('0x37')]=qs[_0x0b9e('0x2f')](_['pick'](_0x871937[_0x0b9e('0x2e')],_0x3d5fa1[_0x0b9e('0x2f')]),_0x405bbc);if(_0x871937[_0x0b9e('0x2e')][_0x0b9e('0x38')]){_0x44cc84[_0x0b9e('0x37')]=_[_0x0b9e('0x39')](_0x44cc84['where'],{'$or':_[_0x0b9e('0x29')](_0x405bbc,function(_0xd5242){if(_0xd5242['type']!==_0x0b9e('0x3a')){var _0x22dc58={};_0x22dc58[_0xd5242[_0x0b9e('0x26')]]={'$like':'%'+_0x871937[_0x0b9e('0x2e')]['filter']+'%'};return _0x22dc58;}})});}_0x44cc84=_[_0x0b9e('0x39')]({},_0x44cc84,_0x871937[_0x0b9e('0x3b')]);var _0xb7da80={'where':_0x44cc84[_0x0b9e('0x37')]};return db[_0x0b9e('0x3c')][_0x0b9e('0x1a')](_0xb7da80)[_0x0b9e('0x21')](function(_0x288dd1){_0x861a8f[_0x0b9e('0x1a')]=_0x288dd1;if(_0x871937[_0x0b9e('0x2e')]['includeAll']){_0x44cc84['include']=[{'all':!![]}];}return db[_0x0b9e('0x3c')][_0x0b9e('0x3d')](_0x44cc84);})[_0x0b9e('0x21')](function(_0xdc2c15){_0x861a8f[_0x0b9e('0x3e')]=_0xdc2c15;return _0x861a8f;})['then'](respondWithFilteredResult(_0x26e330,_0x44cc84))['catch'](handleError(_0x26e330,null));};exports[_0x0b9e('0x3f')]=function(_0x775f3b,_0x120abe){var _0x4131e7={'raw':!![],'where':{'id':_0x775f3b[_0x0b9e('0x40')]['id']}},_0x126780={};_0x126780[_0x0b9e('0x2d')]=_[_0x0b9e('0x41')](db[_0x0b9e('0x3c')]['rawAttributes']);_0x126780['query']=_[_0x0b9e('0x41')](_0x775f3b[_0x0b9e('0x2e')]);_0x126780[_0x0b9e('0x2f')]=_[_0x0b9e('0x30')](_0x126780[_0x0b9e('0x2d')],_0x126780[_0x0b9e('0x2e')]);_0x4131e7[_0x0b9e('0x31')]=_[_0x0b9e('0x30')](_0x126780[_0x0b9e('0x2d')],qs[_0x0b9e('0x32')](_0x775f3b['query']['fields']));_0x4131e7['attributes']=_0x4131e7[_0x0b9e('0x31')][_0x0b9e('0x33')]?_0x4131e7['attributes']:_0x126780[_0x0b9e('0x2d')];if(_0x775f3b[_0x0b9e('0x2e')][_0x0b9e('0x42')]){_0x4131e7['include']=[{'all':!![]}];}_0x4131e7=_['merge']({},_0x4131e7,_0x775f3b['options']);return db[_0x0b9e('0x3c')][_0x0b9e('0x43')](_0x4131e7)[_0x0b9e('0x21')](handleEntityNotFound(_0x120abe,null))['then'](respondWithResult(_0x120abe,null))[_0x0b9e('0x44')](handleError(_0x120abe,null));};exports['create']=function(_0x50dc44,_0x42608a){return db[_0x0b9e('0x3c')]['create'](_0x50dc44[_0x0b9e('0x45')],{})[_0x0b9e('0x21')](respondWithResult(_0x42608a,0xc9))['catch'](handleError(_0x42608a,null));};exports[_0x0b9e('0x20')]=function(_0x4c0c4b,_0x6c5eae){if(_0x4c0c4b['body']['id']){delete _0x4c0c4b[_0x0b9e('0x45')]['id'];}return db[_0x0b9e('0x3c')][_0x0b9e('0x43')]({'where':{'id':_0x4c0c4b[_0x0b9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x6c5eae,null))[_0x0b9e('0x21')](saveUpdates(_0x4c0c4b[_0x0b9e('0x45')],null))[_0x0b9e('0x21')](respondWithResult(_0x6c5eae,null))['catch'](handleError(_0x6c5eae,null));};exports[_0x0b9e('0x22')]=function(_0x2164ad,_0x5ea6cc){return db[_0x0b9e('0x3c')][_0x0b9e('0x43')]({'where':{'id':_0x2164ad[_0x0b9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x5ea6cc,null))[_0x0b9e('0x21')](removeEntity(_0x5ea6cc,null))[_0x0b9e('0x44')](handleError(_0x5ea6cc,null));};exports[_0x0b9e('0x46')]=function(_0x2d309f,_0x1dbcb0){return db[_0x0b9e('0x3c')]['describe']()[_0x0b9e('0x21')](respondWithResult(_0x1dbcb0,null))[_0x0b9e('0x44')](handleError(_0x1dbcb0,null));}; \ No newline at end of file +var _0x2bb7=['query','keys','intersection','fields','attributes','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','filters','length','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','key','model'];(function(_0x2d8db5,_0x3c9c8d){var _0xdc5579=function(_0x36f14f){while(--_0x36f14f){_0x2d8db5['push'](_0x2d8db5['shift']());}};_0xdc5579(++_0x3c9c8d);}(_0x2bb7,0x194));var _0x72bb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2bb7[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x72bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72bb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x72bb('0x2'));var moment=require(_0x72bb('0x3'));var BPromise=require(_0x72bb('0x4'));var Mustache=require(_0x72bb('0x5'));var util=require('util');var path=require(_0x72bb('0x6'));var sox=require(_0x72bb('0x7'));var csv=require(_0x72bb('0x8'));var ejs=require(_0x72bb('0x9'));var fs=require('fs');var fs_extra=require(_0x72bb('0xa'));var _=require(_0x72bb('0xb'));var squel=require(_0x72bb('0xc'));var crypto=require(_0x72bb('0xd'));var jsforce=require(_0x72bb('0xe'));var deskjs=require(_0x72bb('0xf'));var toCsv=require(_0x72bb('0x8'));var querystring=require(_0x72bb('0x10'));var Papa=require('papaparse');var Redis=require(_0x72bb('0x11'));var authService=require(_0x72bb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x72bb('0x13'));var hardwareService=require(_0x72bb('0x14'));var logger=require(_0x72bb('0x15'))(_0x72bb('0x16'));var utils=require(_0x72bb('0x17'));var config=require(_0x72bb('0x18'));var licenseUtil=require(_0x72bb('0x19'));var db=require(_0x72bb('0x1a'))['db'];function respondWithStatusCode(_0x2abfbd,_0x2cd1a4){_0x2cd1a4=_0x2cd1a4||0xcc;return function(_0x2a1a20){if(_0x2a1a20){return _0x2abfbd[_0x72bb('0x1b')](_0x2cd1a4);}return _0x2abfbd[_0x72bb('0x1c')](_0x2cd1a4)[_0x72bb('0x1d')]();};}function respondWithResult(_0x18028b,_0x37a0d9){_0x37a0d9=_0x37a0d9||0xc8;return function(_0x5c0756){if(_0x5c0756){return _0x18028b[_0x72bb('0x1c')](_0x37a0d9)[_0x72bb('0x1e')](_0x5c0756);}};}function respondWithFilteredResult(_0x508680,_0x3f1958){return function(_0x4d0e9b){if(_0x4d0e9b){var _0xc8591e=typeof _0x3f1958['offset']===_0x72bb('0x1f')&&typeof _0x3f1958[_0x72bb('0x20')]===_0x72bb('0x1f');var _0xb9e128=_0x4d0e9b[_0x72bb('0x21')];var _0x26a107=_0xc8591e?0x0:_0x3f1958[_0x72bb('0x22')];var _0x380f23=_0xc8591e?_0x4d0e9b[_0x72bb('0x21')]:_0x3f1958[_0x72bb('0x22')]+_0x3f1958[_0x72bb('0x20')];var _0xc1434d;if(_0x380f23>=_0xb9e128){_0x380f23=_0xb9e128;_0xc1434d=0xc8;}else{_0xc1434d=0xce;}_0x508680['status'](_0xc1434d);return _0x508680['set'](_0x72bb('0x23'),_0x26a107+'-'+_0x380f23+'/'+_0xb9e128)['json'](_0x4d0e9b);}return null;};}function patchUpdates(_0x1a6221){return function(_0x4fd53f){try{jsonpatch[_0x72bb('0x24')](_0x4fd53f,_0x1a6221,!![]);}catch(_0x3e1b7e){return BPromise[_0x72bb('0x25')](_0x3e1b7e);}return _0x4fd53f[_0x72bb('0x26')]();};}function saveUpdates(_0x48d4ec,_0x203a75){return function(_0x56f009){if(_0x56f009){return _0x56f009['update'](_0x48d4ec)[_0x72bb('0x27')](function(_0x2f01e6){return _0x2f01e6;});}return null;};}function removeEntity(_0x41c73c,_0x425276){return function(_0x2775b3){if(_0x2775b3){return _0x2775b3[_0x72bb('0x28')]()['then'](function(){_0x41c73c['status'](0xcc)[_0x72bb('0x1d')]();});}};}function handleEntityNotFound(_0xa1ce09,_0x3bbe50){return function(_0x1540e0){if(!_0x1540e0){_0xa1ce09[_0x72bb('0x1b')](0x194);}return _0x1540e0;};}function handleError(_0x39ff3f,_0x166ed6){_0x166ed6=_0x166ed6||0x1f4;return function(_0x15cc7e){logger[_0x72bb('0x29')](_0x15cc7e[_0x72bb('0x2a')]);if(_0x15cc7e['name']){delete _0x15cc7e[_0x72bb('0x2b')];}_0x39ff3f['status'](_0x166ed6)[_0x72bb('0x2c')](_0x15cc7e);};}exports[_0x72bb('0x2d')]=function(_0x54af7e,_0x694f38){var _0x304d53={},_0x55f333={},_0x739178={'count':0x0,'rows':[]};var _0x139850=_[_0x72bb('0x2e')](db[_0x72bb('0x2f')][_0x72bb('0x30')],function(_0xf0d054){return{'name':_0xf0d054[_0x72bb('0x31')],'type':_0xf0d054['type'][_0x72bb('0x32')]};});_0x55f333[_0x72bb('0x33')]=_['map'](_0x139850,'name');_0x55f333[_0x72bb('0x34')]=_[_0x72bb('0x35')](_0x54af7e[_0x72bb('0x34')]);_0x55f333['filters']=_['intersection'](_0x55f333[_0x72bb('0x33')],_0x55f333['query']);_0x304d53['attributes']=_[_0x72bb('0x36')](_0x55f333[_0x72bb('0x33')],qs['fields'](_0x54af7e['query'][_0x72bb('0x37')]));_0x304d53[_0x72bb('0x38')]=_0x304d53[_0x72bb('0x38')]['length']?_0x304d53[_0x72bb('0x38')]:_0x55f333[_0x72bb('0x33')];if(!_0x54af7e[_0x72bb('0x34')]['hasOwnProperty'](_0x72bb('0x39'))){_0x304d53[_0x72bb('0x20')]=qs[_0x72bb('0x20')](_0x54af7e[_0x72bb('0x34')]['limit']);_0x304d53[_0x72bb('0x22')]=qs[_0x72bb('0x22')](_0x54af7e[_0x72bb('0x34')]['offset']);}_0x304d53['order']=qs['sort'](_0x54af7e[_0x72bb('0x34')]['sort']);_0x304d53[_0x72bb('0x3a')]=qs['filters'](_[_0x72bb('0x3b')](_0x54af7e[_0x72bb('0x34')],_0x55f333['filters']),_0x139850);if(_0x54af7e['query'][_0x72bb('0x3c')]){_0x304d53[_0x72bb('0x3a')]=_[_0x72bb('0x3d')](_0x304d53['where'],{'$or':_[_0x72bb('0x2e')](_0x139850,function(_0x589324){if(_0x589324['type']!==_0x72bb('0x3e')){var _0x43fcc4={};_0x43fcc4[_0x589324[_0x72bb('0x2b')]]={'$like':'%'+_0x54af7e[_0x72bb('0x34')][_0x72bb('0x3c')]+'%'};return _0x43fcc4;}})});}_0x304d53=_[_0x72bb('0x3d')]({},_0x304d53,_0x54af7e[_0x72bb('0x3f')]);var _0x143925={'where':_0x304d53['where']};return db[_0x72bb('0x2f')][_0x72bb('0x21')](_0x143925)[_0x72bb('0x27')](function(_0xb8a472){_0x739178[_0x72bb('0x21')]=_0xb8a472;if(_0x54af7e['query'][_0x72bb('0x40')]){_0x304d53[_0x72bb('0x41')]=[{'all':!![]}];}return db[_0x72bb('0x2f')][_0x72bb('0x42')](_0x304d53);})[_0x72bb('0x27')](function(_0x4a071f){_0x739178['rows']=_0x4a071f;return _0x739178;})['then'](respondWithFilteredResult(_0x694f38,_0x304d53))[_0x72bb('0x43')](handleError(_0x694f38,null));};exports[_0x72bb('0x44')]=function(_0x589d29,_0x138e3f){var _0x3b9f00={'raw':!![],'where':{'id':_0x589d29[_0x72bb('0x45')]['id']}},_0x42dbf5={};_0x42dbf5['model']=_['keys'](db[_0x72bb('0x2f')][_0x72bb('0x30')]);_0x42dbf5[_0x72bb('0x34')]=_[_0x72bb('0x35')](_0x589d29[_0x72bb('0x34')]);_0x42dbf5[_0x72bb('0x46')]=_['intersection'](_0x42dbf5['model'],_0x42dbf5[_0x72bb('0x34')]);_0x3b9f00['attributes']=_[_0x72bb('0x36')](_0x42dbf5[_0x72bb('0x33')],qs[_0x72bb('0x37')](_0x589d29['query'][_0x72bb('0x37')]));_0x3b9f00[_0x72bb('0x38')]=_0x3b9f00[_0x72bb('0x38')][_0x72bb('0x47')]?_0x3b9f00[_0x72bb('0x38')]:_0x42dbf5['model'];if(_0x589d29[_0x72bb('0x34')][_0x72bb('0x40')]){_0x3b9f00[_0x72bb('0x41')]=[{'all':!![]}];}_0x3b9f00=_['merge']({},_0x3b9f00,_0x589d29[_0x72bb('0x3f')]);return db[_0x72bb('0x2f')]['find'](_0x3b9f00)[_0x72bb('0x27')](handleEntityNotFound(_0x138e3f,null))[_0x72bb('0x27')](respondWithResult(_0x138e3f,null))[_0x72bb('0x43')](handleError(_0x138e3f,null));};exports[_0x72bb('0x48')]=function(_0x37f963,_0xc36907){return db['VoiceDialReport'][_0x72bb('0x48')](_0x37f963[_0x72bb('0x49')],{})[_0x72bb('0x27')](respondWithResult(_0xc36907,0xc9))[_0x72bb('0x43')](handleError(_0xc36907,null));};exports['update']=function(_0x4db35c,_0x4f1c0a){if(_0x4db35c[_0x72bb('0x49')]['id']){delete _0x4db35c[_0x72bb('0x49')]['id'];}return db[_0x72bb('0x2f')][_0x72bb('0x4a')]({'where':{'id':_0x4db35c[_0x72bb('0x45')]['id']}})[_0x72bb('0x27')](handleEntityNotFound(_0x4f1c0a,null))[_0x72bb('0x27')](saveUpdates(_0x4db35c['body'],null))[_0x72bb('0x27')](respondWithResult(_0x4f1c0a,null))[_0x72bb('0x43')](handleError(_0x4f1c0a,null));};exports['destroy']=function(_0x784682,_0x5e6019){return db[_0x72bb('0x2f')][_0x72bb('0x4a')]({'where':{'id':_0x784682[_0x72bb('0x45')]['id']}})['then'](handleEntityNotFound(_0x5e6019,null))[_0x72bb('0x27')](removeEntity(_0x5e6019,null))[_0x72bb('0x43')](handleError(_0x5e6019,null));};exports[_0x72bb('0x4b')]=function(_0x11cede,_0x399c0f){return db[_0x72bb('0x2f')]['describe']()[_0x72bb('0x27')](respondWithResult(_0x399c0f,null))[_0x72bb('0x43')](handleError(_0x399c0f,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 0a91250..570b193 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 _0xf227=['define','VoiceDialReport','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x272cee,_0x153b02){var _0x31c95c=function(_0x23cb40){while(--_0x23cb40){_0x272cee['push'](_0x272cee['shift']());}};_0x31c95c(++_0x153b02);}(_0xf227,0x18f));var _0x7f22=function(_0x5eecd9,_0x11b11c){_0x5eecd9=_0x5eecd9-0x0;var _0x1bc3a7=_0xf227[_0x5eecd9];return _0x1bc3a7;};'use strict';var _=require(_0x7f22('0x0'));var util=require(_0x7f22('0x1'));var logger=require(_0x7f22('0x2'))(_0x7f22('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7f22('0x4'));var fs=require('fs');var path=require(_0x7f22('0x5'));var rimraf=require(_0x7f22('0x6'));var config=require(_0x7f22('0x7'));var attributes=require(_0x7f22('0x8'));module['exports']=function(_0x6f338,_0x51b846){return _0x6f338[_0x7f22('0x9')](_0x7f22('0xa'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x7f22('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a05=['report_dial','util','../../config/logger','api','bluebird','request-promise','path','exports','VoiceDialReport'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5a05,0x17b));var _0x55a0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5a05[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x55a0('0x0'));var logger=require(_0x55a0('0x1'))(_0x55a0('0x2'));var moment=require('moment');var BPromise=require(_0x55a0('0x3'));var rp=require(_0x55a0('0x4'));var fs=require('fs');var path=require(_0x55a0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0x55a0('0x6')]=function(_0x2c9910,_0x31e6e2){return _0x2c9910['define'](_0x55a0('0x7'),attributes,{'tableName':_0x55a0('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 7bb8e4f..660a2e6 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 _0xb433=['request','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceDialReport,\x20%s,\x20%s','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','then','info','UpdateVoiceDialReport','update','where','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x3fa80b,_0x5b3693){var _0x33b479=function(_0x37acf7){while(--_0x37acf7){_0x3fa80b['push'](_0x3fa80b['shift']());}};_0x33b479(++_0x5b3693);}(_0xb433,0x16a));var _0x3b43=function(_0x53cc0a,_0x30848e){_0x53cc0a=_0x53cc0a-0x0;var _0x58044c=_0xb433[_0x53cc0a];return _0x58044c;};'use strict';var _=require('lodash');var util=require(_0x3b43('0x0'));var moment=require(_0x3b43('0x1'));var BPromise=require(_0x3b43('0x2'));var rs=require(_0x3b43('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b43('0x4'));var logger=require(_0x3b43('0x5'))('rpc');var config=require(_0x3b43('0x6'));var jayson=require(_0x3b43('0x7'));var client=jayson[_0x3b43('0x8')][_0x3b43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x487c93,_0x5cf834,_0x60bf32){return new BPromise(function(_0x49be95,_0x349d5d){return client[_0x3b43('0xa')](_0x487c93,_0x60bf32)['then'](function(_0x3aecae){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x5cf834,_0x3b43('0xb'));logger[_0x3b43('0xc')](_0x3b43('0xd'),_0x5cf834,_0x3b43('0xb'),JSON[_0x3b43('0xe')](_0x3aecae));if(_0x3aecae[_0x3b43('0xf')]){if(_0x3aecae[_0x3b43('0xf')][_0x3b43('0x10')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x5cf834,_0x3aecae[_0x3b43('0xf')][_0x3b43('0x11')]);return _0x349d5d(_0x3aecae['error'][_0x3b43('0x11')]);}logger['error'](_0x3b43('0x12'),_0x5cf834,_0x3aecae['error'][_0x3b43('0x11')]);return _0x49be95(_0x3aecae['error'][_0x3b43('0x11')]);}else{logger['info'](_0x3b43('0x12'),_0x5cf834,_0x3b43('0xb'));_0x49be95(_0x3aecae[_0x3b43('0x13')][_0x3b43('0x11')]);}})[_0x3b43('0x14')](function(_0x3ffe06){logger[_0x3b43('0xf')](_0x3b43('0x12'),_0x5cf834,_0x3ffe06);_0x349d5d(_0x3ffe06);});});}exports[_0x3b43('0x15')]=function(_0x4e968f){var _0x537c28=this;return new Promise(function(_0x10e4af,_0x546e0a){return db[_0x3b43('0x16')][_0x3b43('0x17')](_0x4e968f[_0x3b43('0x18')],{'raw':_0x4e968f[_0x3b43('0x19')]?_0x4e968f[_0x3b43('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x3b43('0x1a')](function(_0x4a7155){logger[_0x3b43('0x1b')]('CreateVoiceDialReport',_0x4e968f);logger[_0x3b43('0xc')](_0x3b43('0x15'),_0x4e968f,JSON[_0x3b43('0xe')](_0x4a7155));_0x10e4af(_0x4a7155);})[_0x3b43('0x14')](function(_0x22bc53){logger[_0x3b43('0xf')](_0x3b43('0x15'),_0x22bc53[_0x3b43('0x11')],_0x4e968f);_0x546e0a(_0x537c28[_0x3b43('0xf')](0x1f4,_0x22bc53['message']));});});};exports[_0x3b43('0x1c')]=function(_0x350983){var _0xa335f=this;return new Promise(function(_0x510e28,_0xc023fd){return db[_0x3b43('0x16')][_0x3b43('0x1d')](_0x350983[_0x3b43('0x18')],{'raw':_0x350983['options']?_0x350983[_0x3b43('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x350983['options']?_0x350983[_0x3b43('0x19')][_0x3b43('0x1e')]||null:null,'attributes':_0x350983[_0x3b43('0x19')]?_0x350983[_0x3b43('0x19')]['attributes']||null:null,'limit':_0x350983[_0x3b43('0x19')]?_0x350983[_0x3b43('0x19')]['limit']||null:null})[_0x3b43('0x1a')](function(_0x1657dd){logger[_0x3b43('0x1b')]('UpdateVoiceDialReport',_0x350983);logger[_0x3b43('0xc')](_0x3b43('0x1c'),_0x350983,JSON[_0x3b43('0xe')](_0x1657dd));_0x510e28(_0x1657dd);})['catch'](function(_0x123d34){logger[_0x3b43('0xf')]('UpdateVoiceDialReport',_0x123d34[_0x3b43('0x11')],_0x350983);_0xc023fd(_0xa335f[_0x3b43('0xf')](0x1f4,_0x123d34['message']));});});}; \ No newline at end of file +var _0xb94e=['util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateVoiceDialReport','body','options','UpdateVoiceDialReport','update','where','attributes','limit','stringify','lodash'];(function(_0x3dec83,_0x31e3e9){var _0x1979a8=function(_0x2d46b1){while(--_0x2d46b1){_0x3dec83['push'](_0x3dec83['shift']());}};_0x1979a8(++_0x31e3e9);}(_0xb94e,0x95));var _0xeb94=function(_0x4da3b6,_0x170416){_0x4da3b6=_0x4da3b6-0x0;var _0xc22def=_0xb94e[_0x4da3b6];return _0xc22def;};'use strict';var _=require(_0xeb94('0x0'));var util=require(_0xeb94('0x1'));var moment=require(_0xeb94('0x2'));var BPromise=require(_0xeb94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb94('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb94('0x5'))(_0xeb94('0x6'));var config=require(_0xeb94('0x7'));var jayson=require(_0xeb94('0x8'));var client=jayson[_0xeb94('0x9')][_0xeb94('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5372a8,_0x1e5bc4,_0x2043e4){return new BPromise(function(_0x3da195,_0x3ea890){return client['request'](_0x5372a8,_0x2043e4)[_0xeb94('0xb')](function(_0x360095){logger['info'](_0xeb94('0xc'),_0x1e5bc4,_0xeb94('0xd'));logger[_0xeb94('0xe')](_0xeb94('0xf'),_0x1e5bc4,_0xeb94('0xd'),JSON['stringify'](_0x360095));if(_0x360095[_0xeb94('0x10')]){if(_0x360095['error'][_0xeb94('0x11')]===0x1f4){logger[_0xeb94('0x10')](_0xeb94('0xc'),_0x1e5bc4,_0x360095[_0xeb94('0x10')][_0xeb94('0x12')]);return _0x3ea890(_0x360095[_0xeb94('0x10')][_0xeb94('0x12')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x1e5bc4,_0x360095[_0xeb94('0x10')]['message']);return _0x3da195(_0x360095[_0xeb94('0x10')]['message']);}else{logger[_0xeb94('0x13')](_0xeb94('0xc'),_0x1e5bc4,_0xeb94('0xd'));_0x3da195(_0x360095['result'][_0xeb94('0x12')]);}})[_0xeb94('0x14')](function(_0x9727a2){logger[_0xeb94('0x10')](_0xeb94('0xc'),_0x1e5bc4,_0x9727a2);_0x3ea890(_0x9727a2);});});}exports[_0xeb94('0x15')]=function(_0x514394){var _0x4c42e1=this;return new Promise(function(_0x30111b,_0x1b89db){return db['VoiceDialReport']['create'](_0x514394[_0xeb94('0x16')],{'raw':_0x514394[_0xeb94('0x17')]?_0x514394[_0xeb94('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x120f88){logger[_0xeb94('0x13')]('CreateVoiceDialReport',_0x514394);logger['debug']('CreateVoiceDialReport',_0x514394,JSON['stringify'](_0x120f88));_0x30111b(_0x120f88);})[_0xeb94('0x14')](function(_0x33c4b5){logger['error'](_0xeb94('0x15'),_0x33c4b5[_0xeb94('0x12')],_0x514394);_0x1b89db(_0x4c42e1[_0xeb94('0x10')](0x1f4,_0x33c4b5[_0xeb94('0x12')]));});});};exports[_0xeb94('0x18')]=function(_0x2e1228){var _0x4a3379=this;return new Promise(function(_0x226f52,_0x25969c){return db['VoiceDialReport'][_0xeb94('0x19')](_0x2e1228[_0xeb94('0x16')],{'raw':_0x2e1228[_0xeb94('0x17')]?_0x2e1228[_0xeb94('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e1228[_0xeb94('0x17')]?_0x2e1228[_0xeb94('0x17')][_0xeb94('0x1a')]||null:null,'attributes':_0x2e1228[_0xeb94('0x17')]?_0x2e1228[_0xeb94('0x17')][_0xeb94('0x1b')]||null:null,'limit':_0x2e1228[_0xeb94('0x17')]?_0x2e1228[_0xeb94('0x17')][_0xeb94('0x1c')]||null:null})[_0xeb94('0xb')](function(_0x4f10cf){logger[_0xeb94('0x13')](_0xeb94('0x18'),_0x2e1228);logger['debug'](_0xeb94('0x18'),_0x2e1228,JSON[_0xeb94('0x1d')](_0x4f10cf));_0x226f52(_0x4f10cf);})[_0xeb94('0x14')](function(_0x482d22){logger['error']('UpdateVoiceDialReport',_0x482d22[_0xeb94('0x12')],_0x2e1228);_0x25969c(_0x4a3379[_0xeb94('0x10')](0x1f4,_0x482d22[_0xeb94('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index ec4821a..db4c60a 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 _0x968e=['update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','post','isAuthenticated','/:id/applications','addApplications','put'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x968e,0x159));var _0xe968=function(_0x2da8e3,_0x397415){_0x2da8e3=_0x2da8e3-0x0;var _0x281fd5=_0x968e[_0x2da8e3];return _0x281fd5;};'use strict';var multer=require(_0xe968('0x0'));var util=require(_0xe968('0x1'));var path=require(_0xe968('0x2'));var timeout=require('connect-timeout');var express=require(_0xe968('0x3'));var router=express[_0xe968('0x4')]();var fs_extra=require(_0xe968('0x5'));var auth=require(_0xe968('0x6'));var interaction=require(_0xe968('0x7'));var config=require(_0xe968('0x8'));var controller=require('./voiceExtension.controller');router[_0xe968('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe968('0x9')](_0xe968('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xe968('0xb')]('/',auth[_0xe968('0xc')](),controller['create']);router[_0xe968('0xb')](_0xe968('0xd'),auth['isAuthenticated'](),controller[_0xe968('0xe')]);router[_0xe968('0xf')](_0xe968('0xa'),auth[_0xe968('0xc')](),controller[_0xe968('0x10')]);router[_0xe968('0x11')](_0xe968('0xa'),auth[_0xe968('0xc')](),controller[_0xe968('0x12')]);module['exports']=router; \ No newline at end of file +var _0x88c1=['update','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','./voiceExtension.controller','get','index','/:id','isAuthenticated','show','post','create','/:id/applications','addApplications','put'];(function(_0x1f8ce9,_0x3d538a){var _0x3530f4=function(_0x2952e7){while(--_0x2952e7){_0x1f8ce9['push'](_0x1f8ce9['shift']());}};_0x3530f4(++_0x3d538a);}(_0x88c1,0x9a));var _0x188c=function(_0x5d408c,_0x3b3c2d){_0x5d408c=_0x5d408c-0x0;var _0x534a9b=_0x88c1[_0x5d408c];return _0x534a9b;};'use strict';var multer=require(_0x188c('0x0'));var util=require('util');var path=require(_0x188c('0x1'));var timeout=require(_0x188c('0x2'));var express=require(_0x188c('0x3'));var router=express['Router']();var fs_extra=require(_0x188c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x188c('0x5'));var config=require('../../config/environment');var controller=require(_0x188c('0x6'));router[_0x188c('0x7')]('/',auth['isAuthenticated'](),controller[_0x188c('0x8')]);router[_0x188c('0x7')](_0x188c('0x9'),auth[_0x188c('0xa')](),controller[_0x188c('0xb')]);router[_0x188c('0xc')]('/',auth[_0x188c('0xa')](),controller[_0x188c('0xd')]);router[_0x188c('0xc')](_0x188c('0xe'),auth[_0x188c('0xa')](),controller[_0x188c('0xf')]);router[_0x188c('0x10')](_0x188c('0x9'),auth['isAuthenticated'](),controller[_0x188c('0x11')]);router['delete'](_0x188c('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x188c('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index c6550ac..7693b32 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 _0x6f5b=['internal','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','exports','STRING','compositeIndex','ENUM','outbound'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0x6f5b,0x16a));var _0xb6f5=function(_0x1b40bd,_0x4fe954){_0x1b40bd=_0x1b40bd-0x0;var _0x257276=_0x6f5b[_0x1b40bd];return _0x257276;};'use strict';var Sequelize=require(_0xb6f5('0x0'));module[_0xb6f5('0x1')]={'context':{'type':Sequelize[_0xb6f5('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xb6f5('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xb6f5('0x3')},'tag':{'type':Sequelize[_0xb6f5('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xb6f5('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xb6f5('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xb6f5('0x4')]('inbound',_0xb6f5('0x5'),_0xb6f5('0x6'),_0xb6f5('0x7'),_0xb6f5('0x8'),'system',_0xb6f5('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xb6f5('0x2')]},'interval':{'type':Sequelize[_0xb6f5('0x2')],'allowNull':![],'defaultValue':_0xb6f5('0xa')},'IntervalId':{'type':Sequelize[_0xb6f5('0xb')]},'isApp':{'type':Sequelize[_0xb6f5('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xb6f5('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xb6f5('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xb6f5('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xb6f5('0xd')},'answer':{'type':Sequelize[_0xb6f5('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xb6f5('0xe')],'get':function(_0x184fed){return this[_0xb6f5('0xf')]('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xa824=['VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav'];(function(_0x3740f7,_0x1194aa){var _0x191401=function(_0x2fb0f8){while(--_0x2fb0f8){_0x3740f7['push'](_0x3740f7['shift']());}};_0x191401(++_0x1194aa);}(_0xa824,0x1a7));var _0x4a82=function(_0xa03c26,_0x2edd5b){_0xa03c26=_0xa03c26-0x0;var _0x37f407=_0xa824[_0xa03c26];return _0x37f407;};'use strict';var Sequelize=require(_0x4a82('0x0'));module[_0x4a82('0x1')]={'context':{'type':Sequelize[_0x4a82('0x2')],'allowNull':![],'unique':_0x4a82('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4a82('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x4a82('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x4a82('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4a82('0x2')],'allowNull':![],'defaultValue':_0x4a82('0x4')},'appdata':{'type':Sequelize[_0x4a82('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4a82('0x5')](_0x4a82('0x6'),_0x4a82('0x7'),_0x4a82('0x8'),_0x4a82('0x9'),_0x4a82('0xa'),_0x4a82('0xb'),_0x4a82('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0x4a82('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4a82('0xd')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x4a82('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x4a82('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x4a82('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x4a82('0xf')]},'recordingFormat':{'type':Sequelize[_0x4a82('0x2')],'defaultValue':_0x4a82('0x10')},'answer':{'type':Sequelize[_0x4a82('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4a82('0x11')],'get':function(_0x1d2081){return this[_0x4a82('0x12')](_0x4a82('0x13'));}},'alias':{'type':Sequelize[_0x4a82('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 64e64ae..2011e57 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 _0x5438=['pick','filters','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','startsWith','exten','concat','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','VoiceExtensionId','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./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','type','UserProfileResource','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4d2a33,_0x4608b2){var _0x4cdb1b=function(_0x546148){while(--_0x546148){_0x4d2a33['push'](_0x4d2a33['shift']());}};_0x4cdb1b(++_0x4608b2);}(_0x5438,0x140));var _0x8543=function(_0x776a04,_0x13a95d){_0x776a04=_0x776a04-0x0;var _0x38d783=_0x5438[_0x776a04];return _0x38d783;};'use strict';var _=require(_0x8543('0x0'));var Redis=require(_0x8543('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x8543('0x2'));var config=require(_0x8543('0x3'));var db=require(_0x8543('0x4'))['db'];config[_0x8543('0x5')]=_[_0x8543('0x6')](config[_0x8543('0x5')],{'host':_0x8543('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8543('0x8'))['register'](socket);function respondWithStatusCode(_0x441579,_0xfe675d){_0xfe675d=_0xfe675d||0xcc;return function(_0x1c2f65){if(_0x1c2f65){return _0x441579[_0x8543('0x9')](_0xfe675d);}return _0x441579[_0x8543('0xa')](_0xfe675d)[_0x8543('0xb')]();};}function respondWithResult(_0xd228ef,_0x1ae072){_0x1ae072=_0x1ae072||0xc8;return function(_0x574561){if(_0x574561){return _0xd228ef[_0x8543('0xa')](_0x1ae072)[_0x8543('0xc')](_0x574561);}};}function respondWithFilteredResult(_0x5d1c07,_0x48eb91){return function(_0x4796ac){if(_0x4796ac){var _0x56d810=typeof _0x48eb91[_0x8543('0xd')]===_0x8543('0xe')&&typeof _0x48eb91[_0x8543('0xf')]===_0x8543('0xe');var _0x6683b0=_0x4796ac[_0x8543('0x10')];var _0x5357cd=_0x56d810?0x0:_0x48eb91[_0x8543('0xd')];var _0x2fc7bd=_0x56d810?_0x4796ac[_0x8543('0x10')]:_0x48eb91[_0x8543('0xd')]+_0x48eb91['limit'];var _0x5db447;if(_0x2fc7bd>=_0x6683b0){_0x2fc7bd=_0x6683b0;_0x5db447=0xc8;}else{_0x5db447=0xce;}_0x5d1c07['status'](_0x5db447);return _0x5d1c07[_0x8543('0x11')](_0x8543('0x12'),_0x5357cd+'-'+_0x2fc7bd+'/'+_0x6683b0)[_0x8543('0xc')](_0x4796ac);}return null;};}function removeEntity(_0x2446b4){return function(_0x3efab3){if(_0x3efab3){return _0x3efab3[_0x8543('0x13')]()[_0x8543('0x14')](function(){var _0x3ea18e=_0x3efab3[_0x8543('0x15')]({'plain':!![]});var _0x1964e3=[{'name':_0x8543('0x16'),'value':_0x8543('0x17'),'ignore':![]},{'name':_0x8543('0x18'),'value':_0x8543('0x19'),'ignore':![]},{'name':_0x8543('0x1a'),'value':_0x8543('0x1b'),'ignore':![]}];var _0xa28415=_(_0x1964e3)[_0x8543('0x1c')](_0x8543('0x1d'))[_0x8543('0x1e')](_0x8543('0x1f'))[_0x8543('0x1f')]();if(_['includes'](_0xa28415,_0x3ea18e[_0x8543('0x20')])){return;}var _0x34b900=_['find'](_0x1964e3,[_0x8543('0x1f'),_0x3ea18e[_0x8543('0x20')]])['name'];return db[_0x8543('0x21')]['destroy']({'where':{'type':_0x34b900,'resourceId':_0x3ea18e['id']}})[_0x8543('0x14')](function(){return _0x3efab3;});})['then'](function(){_0x2446b4[_0x8543('0xa')](0xcc)[_0x8543('0xb')]();});}};}function handleEntityNotFound(_0x567de1){return function(_0x483786){if(!_0x483786){_0x567de1[_0x8543('0x9')](0x194);}return _0x483786;};}function handleError(_0x581045,_0x4f5af0){_0x4f5af0=_0x4f5af0||0x1f4;return function(_0x2479cd){logger['error'](_0x2479cd[_0x8543('0x22')]);if(_0x2479cd[_0x8543('0x23')]){delete _0x2479cd['name'];}_0x581045[_0x8543('0xa')](_0x4f5af0)[_0x8543('0x24')](_0x2479cd);};}exports[_0x8543('0x25')]=function(_0x271d4c,_0x13b9b9){var _0x2b99ae={},_0xb9d537={},_0x5e45={'count':0x0,'rows':[]};var _0x5f4f09=_[_0x8543('0x1e')](db[_0x8543('0x26')][_0x8543('0x27')],function(_0x3a8658){return{'name':_0x3a8658[_0x8543('0x28')],'type':_0x3a8658[_0x8543('0x20')]['key']};});_0xb9d537['model']=_[_0x8543('0x1e')](_0x5f4f09,_0x8543('0x23'));_0xb9d537[_0x8543('0x29')]=_['keys'](_0x271d4c[_0x8543('0x29')]);_0xb9d537['filters']=_['intersection'](_0xb9d537[_0x8543('0x2a')],_0xb9d537[_0x8543('0x29')]);_0x2b99ae[_0x8543('0x2b')]=_[_0x8543('0x2c')](_0xb9d537['model'],qs[_0x8543('0x2d')](_0x271d4c['query'][_0x8543('0x2d')]));_0x2b99ae[_0x8543('0x2b')]=_0x2b99ae[_0x8543('0x2b')][_0x8543('0x2e')]?_0x2b99ae[_0x8543('0x2b')]:_0xb9d537[_0x8543('0x2a')];if(!_0x271d4c['query'][_0x8543('0x2f')](_0x8543('0x30'))){_0x2b99ae[_0x8543('0xf')]=qs[_0x8543('0xf')](_0x271d4c[_0x8543('0x29')][_0x8543('0xf')]);_0x2b99ae[_0x8543('0xd')]=qs[_0x8543('0xd')](_0x271d4c[_0x8543('0x29')][_0x8543('0xd')]);}_0x2b99ae[_0x8543('0x31')]=qs['sort'](_0x271d4c[_0x8543('0x29')][_0x8543('0x32')]);_0x2b99ae[_0x8543('0x33')]=qs['filters'](_[_0x8543('0x34')](_0x271d4c[_0x8543('0x29')],_0xb9d537[_0x8543('0x35')]),_0x5f4f09);if(_0x271d4c[_0x8543('0x29')][_0x8543('0x1c')]){_0x2b99ae[_0x8543('0x33')]=_['merge'](_0x2b99ae[_0x8543('0x33')],{'$or':_[_0x8543('0x1e')](_0x5f4f09,function(_0x933e3b){if(_0x933e3b[_0x8543('0x20')]!==_0x8543('0x36')){var _0x40409f={};_0x40409f[_0x933e3b['name']]={'$like':'%'+_0x271d4c[_0x8543('0x29')][_0x8543('0x1c')]+'%'};return _0x40409f;}})});}_0x2b99ae=_[_0x8543('0x37')]({},_0x2b99ae,_0x271d4c[_0x8543('0x38')]);var _0x45164e={'where':_0x2b99ae[_0x8543('0x33')]};return db[_0x8543('0x26')][_0x8543('0x10')](_0x45164e)['then'](function(_0x10cc41){_0x5e45['count']=_0x10cc41;if(_0x271d4c[_0x8543('0x29')][_0x8543('0x39')]){_0x2b99ae[_0x8543('0x3a')]=[{'all':!![]}];}return db[_0x8543('0x26')][_0x8543('0x3b')](_0x2b99ae);})[_0x8543('0x14')](function(_0x260806){_0x5e45[_0x8543('0x3c')]=_0x260806;return _0x5e45;})[_0x8543('0x14')](respondWithFilteredResult(_0x13b9b9,_0x2b99ae))[_0x8543('0x3d')](handleError(_0x13b9b9,null));};exports[_0x8543('0x3e')]=function(_0x2e8566,_0x300cb8){var _0x24d420={'raw':![],'where':{'id':_0x2e8566[_0x8543('0x3f')]['id']}},_0x883385={};_0x883385[_0x8543('0x2a')]=_['keys'](db[_0x8543('0x26')][_0x8543('0x27')]);_0x883385[_0x8543('0x29')]=_[_0x8543('0x40')](_0x2e8566[_0x8543('0x29')]);_0x883385[_0x8543('0x35')]=_[_0x8543('0x2c')](_0x883385[_0x8543('0x2a')],_0x883385['query']);_0x24d420['attributes']=_[_0x8543('0x2c')](_0x883385[_0x8543('0x2a')],qs[_0x8543('0x2d')](_0x2e8566[_0x8543('0x29')][_0x8543('0x2d')]));_0x24d420[_0x8543('0x2b')]=_0x24d420['attributes'][_0x8543('0x2e')]?_0x24d420['attributes']:_0x883385[_0x8543('0x2a')];if(_0x2e8566[_0x8543('0x29')][_0x8543('0x39')]){_0x24d420['include']=[{'all':!![]}];}_0x24d420=_[_0x8543('0x37')]({},_0x24d420,_0x2e8566['options']);return db[_0x8543('0x26')]['find'](_0x24d420)[_0x8543('0x14')](handleEntityNotFound(_0x300cb8,null))[_0x8543('0x14')](respondWithResult(_0x300cb8,null))[_0x8543('0x3d')](handleError(_0x300cb8,null));};exports['destroy']=function(_0x4aa882,_0x45962b){return db['VoiceExtension'][_0x8543('0x41')]({'where':{'id':_0x4aa882['params']['id']}})[_0x8543('0x14')](handleEntityNotFound(_0x45962b,null))[_0x8543('0x14')](removeEntity(_0x45962b,null))[_0x8543('0x3d')](handleError(_0x45962b,null));};exports[_0x8543('0x42')]=function(_0x1d3de9,_0x5a12e7){if(_0x1d3de9[_0x8543('0x43')][_0x8543('0x20')]===_0x8543('0x19')&&!_[_0x8543('0x44')](_0x1d3de9[_0x8543('0x43')][_0x8543('0x45')],'_')){_0x1d3de9[_0x8543('0x43')]['exten']='_'[_0x8543('0x46')](_0x1d3de9[_0x8543('0x43')][_0x8543('0x45')]);}return db[_0x8543('0x26')][_0x8543('0x42')](_0x1d3de9[_0x8543('0x43')],{'raw':![]})['then'](function(_0x124cb7){var _0x570765=_0x1d3de9[_0x8543('0x47')][_0x8543('0x15')]({'plain':!![]});if(!_0x570765)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x570765[_0x8543('0x48')]===_0x8543('0x47')){var _0x3024e5=_0x124cb7[_0x8543('0x15')]({'plain':!![]});var _0x176ef3=[{'name':_0x8543('0x16'),'value':_0x8543('0x17')},{'name':_0x8543('0x18'),'value':_0x8543('0x19')},{'name':_0x8543('0x1a'),'value':_0x8543('0x1b')}];var _0x5dad23=_[_0x8543('0x41')](_0x176ef3,[_0x8543('0x1f'),_0x3024e5[_0x8543('0x20')]])['name'];return db[_0x8543('0x49')][_0x8543('0x41')]({'where':{'name':_0x5dad23,'userProfileId':_0x570765[_0x8543('0x4a')]},'raw':!![]})[_0x8543('0x14')](function(_0x271a4b){if(_0x271a4b&&_0x271a4b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3024e5[_0x8543('0x23')],'resourceId':_0x3024e5['id'],'type':_0x271a4b[_0x8543('0x23')],'sectionId':_0x271a4b['id']},{})[_0x8543('0x14')](function(){return _0x124cb7;});}else{return _0x124cb7;}})[_0x8543('0x3d')](function(_0x572bdc){logger[_0x8543('0x4b')](_0x8543('0x4c'),_0x572bdc);throw _0x572bdc;});}return _0x124cb7;})[_0x8543('0x14')](respondWithResult(_0x5a12e7,0xc9))['catch'](handleError(_0x5a12e7,null));};exports[_0x8543('0x4d')]=function(_0x8e4ed,_0x3c32f6){if(_0x8e4ed[_0x8543('0x43')]['id']){delete _0x8e4ed[_0x8543('0x43')]['id'];}return db[_0x8543('0x26')][_0x8543('0x41')]({'where':{'id':_0x8e4ed['params']['id']}})[_0x8543('0x14')](handleEntityNotFound(_0x3c32f6,null))['then'](function(_0x36f0aa){if(_0x36f0aa){return db[_0x8543('0x26')][_0x8543('0x4d')](_['pick'](_0x8e4ed[_0x8543('0x43')],[_0x8543('0x45'),_0x8543('0x4e'),_0x8543('0x4f'),_0x8543('0x50'),_0x8543('0x51'),_0x8543('0x52'),_0x8543('0x53')]),{'where':{'context':_0x36f0aa[_0x8543('0x4e')],'exten':_0x36f0aa[_0x8543('0x45')]},'individualHooks':!![]})[_0x8543('0x14')](function(_0x5559de){return _0x5559de;});}return null;})[_0x8543('0x14')](respondWithStatusCode(_0x3c32f6,null))[_0x8543('0x3d')](handleError(_0x3c32f6,null));};exports[_0x8543('0x54')]=function(_0x55256e,_0x1e596c){var _0x45d518=_0x55256e[_0x8543('0x3f')]['id'];var _0x31c206=_0x55256e[_0x8543('0x43')];var _0x34e2f9=0xc8;var _0x4ca6a4=null;return db[_0x8543('0x55')][_0x8543('0x56')]({'isolationLevel':db[_0x8543('0x55')][_0x8543('0x57')][_0x8543('0x58')]['READ_COMMITTED']},function(_0x3d8795){return db['VoiceExtension']['findOne']({'where':{'id':_0x45d518},'transaction':_0x3d8795})[_0x8543('0x14')](function(_0x5bbe02){if(_0x5bbe02){return db[_0x8543('0x26')]['destroy']({'where':{'VoiceExtensionId':_0x45d518},'transaction':_0x3d8795})[_0x8543('0x14')](function(){var _0x28c856=_[_0x8543('0x1e')](_0x31c206,function(_0x161bb8){_0x161bb8[_0x8543('0x59')]=_0x45d518;_0x161bb8['isApp']=!![];return _0x161bb8;});return _0x5bbe02['createRouting'](_0x28c856);})[_0x8543('0x14')](function(_0x21fa25){return db[_0x8543('0x26')]['bulkCreate'](_0x21fa25,{'transaction':_0x3d8795});});}else{_0x34e2f9=0x194;_0x4ca6a4=[];}});})[_0x8543('0x14')](function(){if(_0x34e2f9!==0x194){return db[_0x8543('0x26')][_0x8543('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x45d518},'order':_0x8543('0x5b')})[_0x8543('0x14')](function(_0x7b7341){_0x4ca6a4=_0x7b7341;});}})[_0x8543('0x3d')](function(_0x20c460){_0x34e2f9=0x1f4;logger[_0x8543('0x4b')](_0x20c460[_0x8543('0x22')]);if(_0x20c460[_0x8543('0x23')]){delete _0x20c460[_0x8543('0x23')];}_0x4ca6a4=_0x20c460;})[_0x8543('0x5c')](function(){if(_0x4ca6a4===null){_0x1e596c[_0x8543('0x9')](_0x34e2f9);}else{if(_0x34e2f9===0x1f4){_0x1e596c['status'](_0x34e2f9)['send'](_0x4ca6a4);}else{_0x1e596c['status'](_0x34e2f9)[_0x8543('0xc')](_0x4ca6a4);}}});}; \ No newline at end of file +var _0x51a6=['undefined','count','set','Content-Range','destroy','then','get','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','find','type','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','keys','filters','intersection','query','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','rows','show','params','catch','startsWith','body','exten','concat','create','user','role','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','end','status','json','offset','limit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x51a6,0x166));var _0x651a=function(_0x356b9e,_0x306f73){_0x356b9e=_0x356b9e-0x0;var _0x15e910=_0x51a6[_0x356b9e];return _0x15e910;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x651a('0x0'));var logger=require(_0x651a('0x1'))(_0x651a('0x2'));var config=require(_0x651a('0x3'));var db=require(_0x651a('0x4'))['db'];config[_0x651a('0x5')]=_[_0x651a('0x6')](config[_0x651a('0x5')],{'host':_0x651a('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x651a('0x5')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x5e6573,_0x5cd237){_0x5cd237=_0x5cd237||0xcc;return function(_0x9d360){if(_0x9d360){return _0x5e6573[_0x651a('0x8')](_0x5cd237);}return _0x5e6573['status'](_0x5cd237)[_0x651a('0x9')]();};}function respondWithResult(_0x4172b8,_0x43226f){_0x43226f=_0x43226f||0xc8;return function(_0x575a16){if(_0x575a16){return _0x4172b8[_0x651a('0xa')](_0x43226f)[_0x651a('0xb')](_0x575a16);}};}function respondWithFilteredResult(_0x437e17,_0x18d5d6){return function(_0x4e2f42){if(_0x4e2f42){var _0x53b026=typeof _0x18d5d6[_0x651a('0xc')]==='undefined'&&typeof _0x18d5d6[_0x651a('0xd')]===_0x651a('0xe');var _0x2c07e0=_0x4e2f42[_0x651a('0xf')];var _0x452917=_0x53b026?0x0:_0x18d5d6[_0x651a('0xc')];var _0x1613b4=_0x53b026?_0x4e2f42[_0x651a('0xf')]:_0x18d5d6[_0x651a('0xc')]+_0x18d5d6[_0x651a('0xd')];var _0x498ace;if(_0x1613b4>=_0x2c07e0){_0x1613b4=_0x2c07e0;_0x498ace=0xc8;}else{_0x498ace=0xce;}_0x437e17[_0x651a('0xa')](_0x498ace);return _0x437e17[_0x651a('0x10')](_0x651a('0x11'),_0x452917+'-'+_0x1613b4+'/'+_0x2c07e0)[_0x651a('0xb')](_0x4e2f42);}return null;};}function removeEntity(_0x153d68){return function(_0x40f76b){if(_0x40f76b){return _0x40f76b[_0x651a('0x12')]()[_0x651a('0x13')](function(){var _0x3197cd=_0x40f76b[_0x651a('0x14')]({'plain':!![]});var _0x153412=[{'name':'InboundRoutes','value':_0x651a('0x15'),'ignore':![]},{'name':_0x651a('0x16'),'value':_0x651a('0x17'),'ignore':![]},{'name':'InternalRoutes','value':_0x651a('0x18'),'ignore':![]}];var _0x1d11de=_(_0x153412)[_0x651a('0x19')](_0x651a('0x1a'))[_0x651a('0x1b')](_0x651a('0x1c'))['value']();if(_[_0x651a('0x1d')](_0x1d11de,_0x3197cd['type'])){return;}var _0x56d30a=_[_0x651a('0x1e')](_0x153412,['value',_0x3197cd[_0x651a('0x1f')]])[_0x651a('0x20')];return db[_0x651a('0x21')][_0x651a('0x12')]({'where':{'type':_0x56d30a,'resourceId':_0x3197cd['id']}})[_0x651a('0x13')](function(){return _0x40f76b;});})[_0x651a('0x13')](function(){_0x153d68[_0x651a('0xa')](0xcc)[_0x651a('0x9')]();});}};}function handleEntityNotFound(_0x2d3960){return function(_0x572eb7){if(!_0x572eb7){_0x2d3960[_0x651a('0x8')](0x194);}return _0x572eb7;};}function handleError(_0x10d5f8,_0x5de277){_0x5de277=_0x5de277||0x1f4;return function(_0x5630d7){logger[_0x651a('0x22')](_0x5630d7[_0x651a('0x23')]);if(_0x5630d7['name']){delete _0x5630d7[_0x651a('0x20')];}_0x10d5f8[_0x651a('0xa')](_0x5de277)[_0x651a('0x24')](_0x5630d7);};}exports[_0x651a('0x25')]=function(_0x527c03,_0x1d5ef9){var _0x363a89={},_0xc643f1={},_0x5d81df={'count':0x0,'rows':[]};var _0x51d930=_['map'](db[_0x651a('0x26')][_0x651a('0x27')],function(_0x9a6580){return{'name':_0x9a6580[_0x651a('0x28')],'type':_0x9a6580[_0x651a('0x1f')][_0x651a('0x29')]};});_0xc643f1['model']=_[_0x651a('0x1b')](_0x51d930,_0x651a('0x20'));_0xc643f1['query']=_[_0x651a('0x2a')](_0x527c03['query']);_0xc643f1[_0x651a('0x2b')]=_[_0x651a('0x2c')](_0xc643f1['model'],_0xc643f1[_0x651a('0x2d')]);_0x363a89[_0x651a('0x2e')]=_['intersection'](_0xc643f1[_0x651a('0x2f')],qs['fields'](_0x527c03['query'][_0x651a('0x30')]));_0x363a89[_0x651a('0x2e')]=_0x363a89['attributes']['length']?_0x363a89[_0x651a('0x2e')]:_0xc643f1[_0x651a('0x2f')];if(!_0x527c03['query'][_0x651a('0x31')](_0x651a('0x32'))){_0x363a89[_0x651a('0xd')]=qs[_0x651a('0xd')](_0x527c03[_0x651a('0x2d')][_0x651a('0xd')]);_0x363a89[_0x651a('0xc')]=qs[_0x651a('0xc')](_0x527c03[_0x651a('0x2d')][_0x651a('0xc')]);}_0x363a89[_0x651a('0x33')]=qs[_0x651a('0x34')](_0x527c03[_0x651a('0x2d')]['sort']);_0x363a89[_0x651a('0x35')]=qs[_0x651a('0x2b')](_[_0x651a('0x36')](_0x527c03['query'],_0xc643f1[_0x651a('0x2b')]),_0x51d930);if(_0x527c03[_0x651a('0x2d')][_0x651a('0x19')]){_0x363a89[_0x651a('0x35')]=_[_0x651a('0x37')](_0x363a89[_0x651a('0x35')],{'$or':_[_0x651a('0x1b')](_0x51d930,function(_0x1322ae){if(_0x1322ae[_0x651a('0x1f')]!=='VIRTUAL'){var _0x17c9b6={};_0x17c9b6[_0x1322ae[_0x651a('0x20')]]={'$like':'%'+_0x527c03[_0x651a('0x2d')][_0x651a('0x19')]+'%'};return _0x17c9b6;}})});}_0x363a89=_[_0x651a('0x37')]({},_0x363a89,_0x527c03[_0x651a('0x38')]);var _0x3c9c10={'where':_0x363a89[_0x651a('0x35')]};return db[_0x651a('0x26')]['count'](_0x3c9c10)['then'](function(_0x777866){_0x5d81df[_0x651a('0xf')]=_0x777866;if(_0x527c03[_0x651a('0x2d')][_0x651a('0x39')]){_0x363a89[_0x651a('0x3a')]=[{'all':!![]}];}return db[_0x651a('0x26')]['findAll'](_0x363a89);})['then'](function(_0x2f50e7){_0x5d81df[_0x651a('0x3b')]=_0x2f50e7;return _0x5d81df;})[_0x651a('0x13')](respondWithFilteredResult(_0x1d5ef9,_0x363a89))['catch'](handleError(_0x1d5ef9,null));};exports[_0x651a('0x3c')]=function(_0x511a8b,_0x57797f){var _0x420e6e={'raw':![],'where':{'id':_0x511a8b[_0x651a('0x3d')]['id']}},_0x1d4a48={};_0x1d4a48[_0x651a('0x2f')]=_[_0x651a('0x2a')](db[_0x651a('0x26')][_0x651a('0x27')]);_0x1d4a48[_0x651a('0x2d')]=_['keys'](_0x511a8b['query']);_0x1d4a48[_0x651a('0x2b')]=_['intersection'](_0x1d4a48[_0x651a('0x2f')],_0x1d4a48[_0x651a('0x2d')]);_0x420e6e[_0x651a('0x2e')]=_[_0x651a('0x2c')](_0x1d4a48[_0x651a('0x2f')],qs[_0x651a('0x30')](_0x511a8b['query'][_0x651a('0x30')]));_0x420e6e[_0x651a('0x2e')]=_0x420e6e[_0x651a('0x2e')]['length']?_0x420e6e['attributes']:_0x1d4a48[_0x651a('0x2f')];if(_0x511a8b[_0x651a('0x2d')][_0x651a('0x39')]){_0x420e6e[_0x651a('0x3a')]=[{'all':!![]}];}_0x420e6e=_['merge']({},_0x420e6e,_0x511a8b[_0x651a('0x38')]);return db[_0x651a('0x26')]['find'](_0x420e6e)[_0x651a('0x13')](handleEntityNotFound(_0x57797f,null))['then'](respondWithResult(_0x57797f,null))[_0x651a('0x3e')](handleError(_0x57797f,null));};exports[_0x651a('0x12')]=function(_0x8a26b4,_0xb49fbc){return db[_0x651a('0x26')][_0x651a('0x1e')]({'where':{'id':_0x8a26b4['params']['id']}})[_0x651a('0x13')](handleEntityNotFound(_0xb49fbc,null))[_0x651a('0x13')](removeEntity(_0xb49fbc,null))[_0x651a('0x3e')](handleError(_0xb49fbc,null));};exports['create']=function(_0x5b2555,_0x1d827c){if(_0x5b2555['body'][_0x651a('0x1f')]===_0x651a('0x17')&&!_[_0x651a('0x3f')](_0x5b2555[_0x651a('0x40')][_0x651a('0x41')],'_')){_0x5b2555[_0x651a('0x40')][_0x651a('0x41')]='_'[_0x651a('0x42')](_0x5b2555['body'][_0x651a('0x41')]);}return db[_0x651a('0x26')][_0x651a('0x43')](_0x5b2555[_0x651a('0x40')],{'raw':![]})[_0x651a('0x13')](function(_0x594449){var _0x3508a2=_0x5b2555[_0x651a('0x44')][_0x651a('0x14')]({'plain':!![]});if(!_0x3508a2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3508a2[_0x651a('0x45')]===_0x651a('0x44')){var _0x25f948=_0x594449[_0x651a('0x14')]({'plain':!![]});var _0x280d8a=[{'name':'InboundRoutes','value':_0x651a('0x15')},{'name':_0x651a('0x16'),'value':_0x651a('0x17')},{'name':_0x651a('0x46'),'value':_0x651a('0x18')}];var _0x3f3922=_[_0x651a('0x1e')](_0x280d8a,[_0x651a('0x1c'),_0x25f948['type']])[_0x651a('0x20')];return db[_0x651a('0x47')]['find']({'where':{'name':_0x3f3922,'userProfileId':_0x3508a2[_0x651a('0x48')]},'raw':!![]})['then'](function(_0x186ece){if(_0x186ece&&_0x186ece[_0x651a('0x49')]===0x0){return db[_0x651a('0x21')]['create']({'name':_0x25f948[_0x651a('0x20')],'resourceId':_0x25f948['id'],'type':_0x186ece[_0x651a('0x20')],'sectionId':_0x186ece['id']},{})[_0x651a('0x13')](function(){return _0x594449;});}else{return _0x594449;}})[_0x651a('0x3e')](function(_0x3c12c3){logger['error'](_0x651a('0x4a'),_0x3c12c3);throw _0x3c12c3;});}return _0x594449;})[_0x651a('0x13')](respondWithResult(_0x1d827c,0xc9))[_0x651a('0x3e')](handleError(_0x1d827c,null));};exports['update']=function(_0x3e8220,_0x269155){if(_0x3e8220[_0x651a('0x40')]['id']){delete _0x3e8220[_0x651a('0x40')]['id'];}return db[_0x651a('0x26')][_0x651a('0x1e')]({'where':{'id':_0x3e8220['params']['id']}})['then'](handleEntityNotFound(_0x269155,null))[_0x651a('0x13')](function(_0x41231f){if(_0x41231f){return db[_0x651a('0x26')][_0x651a('0x4b')](_[_0x651a('0x36')](_0x3e8220[_0x651a('0x40')],[_0x651a('0x41'),'context','description','recordingFormat',_0x651a('0x4c'),_0x651a('0x4d'),_0x651a('0x4e')]),{'where':{'context':_0x41231f[_0x651a('0x4f')],'exten':_0x41231f[_0x651a('0x41')]},'individualHooks':!![]})[_0x651a('0x13')](function(_0x372534){return _0x372534;});}return null;})[_0x651a('0x13')](respondWithStatusCode(_0x269155,null))['catch'](handleError(_0x269155,null));};exports[_0x651a('0x50')]=function(_0x2e13e8,_0x41b447){var _0x379b76=_0x2e13e8[_0x651a('0x3d')]['id'];var _0x55a50b=_0x2e13e8[_0x651a('0x40')];var _0x58bbe5=0xc8;var _0x2f77fc=null;return db[_0x651a('0x51')][_0x651a('0x52')]({'isolationLevel':db[_0x651a('0x51')][_0x651a('0x53')][_0x651a('0x54')][_0x651a('0x55')]},function(_0x59b26c){return db['VoiceExtension']['findOne']({'where':{'id':_0x379b76},'transaction':_0x59b26c})['then'](function(_0x3fce1c){if(_0x3fce1c){return db[_0x651a('0x26')][_0x651a('0x12')]({'where':{'VoiceExtensionId':_0x379b76},'transaction':_0x59b26c})[_0x651a('0x13')](function(){var _0x33ff4f=_['map'](_0x55a50b,function(_0x42d57b){_0x42d57b[_0x651a('0x56')]=_0x379b76;_0x42d57b[_0x651a('0x57')]=!![];return _0x42d57b;});return _0x3fce1c[_0x651a('0x58')](_0x33ff4f);})[_0x651a('0x13')](function(_0x4bc8a1){return db[_0x651a('0x26')][_0x651a('0x59')](_0x4bc8a1,{'transaction':_0x59b26c});});}else{_0x58bbe5=0x194;_0x2f77fc=[];}});})[_0x651a('0x13')](function(){if(_0x58bbe5!==0x194){return db[_0x651a('0x26')][_0x651a('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x379b76},'order':_0x651a('0x5b')})['then'](function(_0x2f3f11){_0x2f77fc=_0x2f3f11;});}})[_0x651a('0x3e')](function(_0x25b64d){_0x58bbe5=0x1f4;logger[_0x651a('0x22')](_0x25b64d[_0x651a('0x23')]);if(_0x25b64d[_0x651a('0x20')]){delete _0x25b64d[_0x651a('0x20')];}_0x2f77fc=_0x25b64d;})[_0x651a('0x5c')](function(){if(_0x2f77fc===null){_0x41b447['sendStatus'](_0x58bbe5);}else{if(_0x58bbe5===0x1f4){_0x41b447[_0x651a('0xa')](_0x58bbe5)[_0x651a('0x24')](_0x2f77fc);}else{_0x41b447['status'](_0x58bbe5)['json'](_0x2f77fc);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 3bf3eeb..bac774d 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 _0xb60f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','VoiceExtension'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0xb60f,0x8e));var _0xfb60=function(_0x3d30a8,_0x3bc438){_0x3d30a8=_0x3d30a8-0x0;var _0xbda361=_0xb60f[_0x3d30a8];return _0xbda361;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xfb60('0x0'))['db'][_0xfb60('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xfb60('0x2')](0x0);var events={'afterCreate':_0xfb60('0x3'),'afterUpdate':_0xfb60('0x4'),'afterDestroy':_0xfb60('0x5')};function emitEvent(_0x34dc43){return function(_0x28181d,_0xa7d3ec,_0x1e3a50){VoiceExtensionEvents[_0xfb60('0x6')](_0x34dc43+':'+_0x28181d['id'],_0x28181d);VoiceExtensionEvents['emit'](_0x34dc43,_0x28181d);_0x1e3a50(null);};}for(var e in events){if(events[_0xfb60('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xfb60('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xe994=['hook','exports','events','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x168230,_0x696a35){var _0x3daa18=function(_0x40e88b){while(--_0x40e88b){_0x168230['push'](_0x168230['shift']());}};_0x3daa18(++_0x696a35);}(_0xe994,0x80));var _0x4e99=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0xe994[_0x2c0be1];return _0x3d4bd2;};'use strict';var EventEmitter=require(_0x4e99('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x4e99('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x4e99('0x2')](0x0);var events={'afterCreate':_0x4e99('0x3'),'afterUpdate':_0x4e99('0x4'),'afterDestroy':_0x4e99('0x5')};function emitEvent(_0x3d8e29){return function(_0x4e5f9f,_0x405942,_0x5b5e2d){VoiceExtensionEvents[_0x4e99('0x6')](_0x3d8e29+':'+_0x4e5f9f['id'],_0x4e5f9f);VoiceExtensionEvents[_0x4e99('0x6')](_0x3d8e29,_0x4e5f9f);_0x5b5e2d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x4e99('0x7')](e,emitEvent(event));}}module[_0x4e99('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index c363078..05b7984 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 _0xc090=['appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','context','alias','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','${EXTEN:','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','options','url','split','name','trunk','param','phone','prefix','SIP','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','interval','IntervalId','then','length','*,*,*,*','intervals','map','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial'];(function(_0x514f3c,_0xe31fa9){var _0x215c34=function(_0x2b53b7){while(--_0x2b53b7){_0x514f3c['push'](_0x514f3c['shift']());}};_0x215c34(++_0xe31fa9);}(_0xc090,0x112));var _0x0c09=function(_0x4c3d64,_0x5c9fe2){_0x4c3d64=_0x4c3d64-0x0;var _0x5974dd=_0xc090[_0x4c3d64];return _0x5974dd;};'use strict';var _=require(_0x0c09('0x0'));var attributes=require(_0x0c09('0x1'));module[_0x0c09('0x2')]=function(_0xb5d246){var _0x1b6b5c=_0xb5d246[_0x0c09('0x3')];function _0x289436(_0x260c36){var _0x11984f=0x2;var _0x487f03=[{'type':_0x260c36[_0x0c09('0x4')],'app':_0x0c09('0x5'),'appdata':'CDR(type)='+_0x260c36['type'],'context':_0x260c36[_0x0c09('0x6')],'exten':_0x260c36['exten'],'priority':_0x11984f++,'VoiceExtensionId':_0x260c36['id']},{'type':_0x260c36[_0x0c09('0x4')],'app':_0x260c36[_0x0c09('0x7')]?_0x0c09('0x5'):'NoOp','appdata':_0x260c36[_0x0c09('0x7')]?_0x0c09('0x8')+_0x260c36['alias']:_0x0c09('0x9'),'context':_0x260c36['context'],'exten':_0x260c36[_0x0c09('0xa')],'priority':_0x11984f++,'VoiceExtensionId':_0x260c36['id']}];if(_0x260c36[_0x0c09('0x4')]===_0x0c09('0xb')){_0x487f03[_0x0c09('0xc')]({'type':'inbound','app':'Set','appdata':'CDR(routeid)='+_0x260c36['id'],'context':_0x260c36[_0x0c09('0x6')],'exten':_0x260c36['exten'],'priority':_0x11984f++,'VoiceExtensionId':_0x260c36['id']});}_0x487f03['push']({'type':_0x260c36[_0x0c09('0x4')],'app':'Set','appdata':_0x0c09('0xd'),'context':_0x260c36[_0x0c09('0x6')],'exten':_0x260c36[_0x0c09('0xa')],'priority':_0x11984f++,'VoiceExtensionId':_0x260c36['id']},{'type':_0x260c36[_0x0c09('0x4')],'app':_0x0c09('0x5'),'appdata':_0x0c09('0xe'),'context':_0x260c36[_0x0c09('0x6')],'exten':_0x260c36[_0x0c09('0xa')],'priority':_0x11984f++,'VoiceExtensionId':_0x260c36['id']},{'type':_0x260c36[_0x0c09('0x4')],'app':_0x0c09('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x260c36[_0x0c09('0x6')],'exten':_0x260c36[_0x0c09('0xa')],'priority':_0x11984f++,'VoiceExtensionId':_0x260c36['id']});return _0x487f03;}function _0x173f4c(_0x7d5c3c){var _0x20ad8a=0x2;var _0x14995e=[{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x0c09('0x10'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x7d5c3c['alias']?_0x0c09('0x5'):_0x0c09('0x11'),'appdata':_0x7d5c3c['alias']?'CDR(routeAlias)='+_0x7d5c3c[_0x0c09('0x7')]:_0x0c09('0x9'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c['exten'],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x0c09('0x12')+(_0x7d5c3c['cutdigits']?_0x0c09('0x13')+_0x7d5c3c['cutdigits']+'}':_0x0c09('0x14')),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x0c09('0x15')+_0x7d5c3c['id'],'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':'outbound','app':'ExecIf','appdata':_0x0c09('0x16')+(_0x20ad8a+0x2)+_0x0c09('0x17')+(_0x20ad8a+0x1)+')','context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x7d5c3c[_0x0c09('0x18')]?'CDR(prefix)=${EXTEN:0:'+_0x7d5c3c['cutdigits']+'}':_0x0c09('0x19'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x0c09('0xd'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x7d5c3c['context'],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':'Set','appdata':_0x0c09('0x1a'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x0c09('0x1b')+_0x7d5c3c['id'],'context':_0x7d5c3c['context'],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']}];if(_0x7d5c3c[_0x0c09('0x1c')](_0x0c09('0x1d'))&&_0x7d5c3c['recordingFormat']!==_0x0c09('0x1e')){_0x14995e['push']({'type':'outbound','app':'Set','appdata':_0x0c09('0x1f'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c[_0x0c09('0xa')],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']},{'type':_0x0c09('0xf'),'app':_0x0c09('0x5'),'appdata':_0x0c09('0x20')+_0x7d5c3c['recordingFormat']||_0x0c09('0x21'),'context':_0x7d5c3c[_0x0c09('0x6')],'exten':_0x7d5c3c['exten'],'priority':_0x20ad8a++,'VoiceExtensionId':_0x7d5c3c['id']});}return _0x14995e;}function _0x1a72a2(_0x5ccd87,_0x5728f2){var _0x3dde4a=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':_0x0c09('0x22'),'param':0x2},{'name':_0x0c09('0x23'),'param':0x3}];var _0x2ff36c={};var _0x1fef88=_0x5728f2[_0x0c09('0x24')](',');var _0x1b602c=[];for(var _0x10d06f=0x0;_0x10d06f<_0x3dde4a['length'];_0x10d06f++){switch(_0x3dde4a[_0x10d06f][_0x0c09('0x25')]){case _0x0c09('0x26'):_0x2ff36c[_0x0c09('0x26')]=_0x1fef88[_0x3dde4a[_0x10d06f][_0x0c09('0x27')]][_0x0c09('0x24')]('/')[0x1];_0x2ff36c[_0x0c09('0x28')]=_0x1fef88[_0x3dde4a[_0x10d06f][_0x0c09('0x27')]][_0x0c09('0x24')]('/')[0x2];_0x2ff36c[_0x0c09('0x29')]=_0x2ff36c[_0x0c09('0x28')]?_0x2ff36c[_0x0c09('0x28')][_0x0c09('0x24')]('$')[0x0]:undefined;_0x2ff36c[_0x0c09('0x28')]=_0x5ccd87[_0x0c09('0x18')]?(_0x2ff36c[_0x0c09('0x29')]||'')+_0x0c09('0x13')+_0x5ccd87[_0x0c09('0x18')]+'}':(_0x2ff36c[_0x0c09('0x29')]||'')+_0x0c09('0x14');_0x1b602c[_0x3dde4a[_0x10d06f][_0x0c09('0x27')]]=[_0x0c09('0x2a'),_0x2ff36c[_0x0c09('0x26')],_0x2ff36c['phone']]['join']('/');break;case'options':_0x2ff36c[_0x0c09('0x22')]=_0x1fef88[_0x3dde4a[_0x10d06f][_0x0c09('0x27')]];if(_0x5ccd87[_0x0c09('0x1d')]!==_0x0c09('0x1e')){if(_0x2ff36c[_0x0c09('0x22')][_0x0c09('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x2ff36c[_0x0c09('0x22')]+=_0x0c09('0x2c');}}else{_0x2ff36c['options']=_0x2ff36c[_0x0c09('0x22')][_0x0c09('0x2d')]('U(xcally-mixmonitor-context)','');}_0x1b602c[_0x3dde4a[_0x10d06f][_0x0c09('0x27')]]=_0x2ff36c[_0x0c09('0x22')];break;default:_0x1b602c[_0x3dde4a[_0x10d06f]['param']]=_0x1fef88[_0x3dde4a[_0x10d06f][_0x0c09('0x27')]];}}return _0x1b602c[_0x0c09('0x2e')](',');}function _0x5aeb49(_0x448c7c,_0x245372,_0x2ccde9){return new Promise(function(_0x2819d2,_0x24bbbf){var _0x2ab418=[];if(_[_0x0c09('0x2f')](_0x245372))return _0x2819d2(_0x2ab418);_0x1b6b5c[_0x0c09('0x30')]['findAll']({'attributes':['id',_0x0c09('0x31'),_0x0c09('0x32')],'raw':!![]})[_0x0c09('0x33')](function(_0x5395a5){for(var _0xc705be=0x0,_0x3bbd5a=0x0;_0xc705be<_0x245372[_0x0c09('0x34')];_0xc705be++,_0x3bbd5a=0x0){var _0x164f52=_0x245372[_0xc705be];var _0x1ea838=[];var _0x225a72=[];delete _0x164f52['id'];if(_0x164f52[_0x0c09('0x31')]!==_0x0c09('0x35')){_0x164f52['intervals']=[_0x164f52[_0x0c09('0x31')]];}else{_0x164f52[_0x0c09('0x36')]=_0x164f52[_0x0c09('0x32')]?_[_0x0c09('0x37')](_['filter'](_0x5395a5,{'IntervalId':_0x164f52[_0x0c09('0x32')]}),_0x0c09('0x31')):[];}_0x164f52[_0x0c09('0x6')]=_0x448c7c[_0x0c09('0x6')];_0x164f52[_0x0c09('0xa')]=_0x448c7c[_0x0c09('0xa')];if(_0x164f52[_0x0c09('0x4')])_0x164f52[_0x0c09('0x4')]=_0x164f52[_0x0c09('0x4')][_0x0c09('0x38')]();if(_0x448c7c['type']==='outbound'){if(_0x164f52[_0x0c09('0x1c')](_0x0c09('0x39'))&&_0x164f52[_0x0c09('0x39')]&&_0x164f52[_0x0c09('0x39')]!=='--'){_0x1ea838[_0x0c09('0xc')]({'type':_0x164f52[_0x0c09('0x4')][_0x0c09('0x38')](),'app':'Set','appdata':_0x0c09('0x3a')+_0x164f52[_0x0c09('0x39')],'context':_0x448c7c['context'],'exten':_0x448c7c[_0x0c09('0xa')],'priority':_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')]+_0x2ccde9+_0x3bbd5a++,'VoiceExtensionId':_0x448c7c['id']});}_0x1ea838['push']({'type':_0x164f52['type'][_0x0c09('0x38')](),'app':_0x0c09('0x3b'),'appdata':_0x0c09('0x3c')+(_0x164f52[_0x0c09('0x3d')]?_0x0c09('0x3e')+_0x164f52['callerID']+')':_0x0c09('0x3f')),'context':_0x448c7c[_0x0c09('0x6')],'exten':_0x448c7c[_0x0c09('0xa')],'priority':_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')]+_0x2ccde9+_0x3bbd5a++,'VoiceExtensionId':_0x448c7c['id']});}else{if(_0x164f52[_0x0c09('0x1c')](_0x0c09('0x40'))){if([_0x0c09('0x41'),'playback'][_0x0c09('0x42')](_0x164f52[_0x0c09('0x43')]['toLowerCase']())&&_0x164f52[_0x0c09('0x44')]!==_0x0c09('0x45')){if(_0x164f52[_0x0c09('0x40')]){_0x1ea838['push']({'type':_0x164f52[_0x0c09('0x4')][_0x0c09('0x38')](),'app':_0x0c09('0x3b'),'appdata':_0x0c09('0x46'),'context':_0x448c7c[_0x0c09('0x6')],'exten':_0x448c7c[_0x0c09('0xa')],'priority':_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')]+_0x2ccde9+_0x3bbd5a++,'VoiceExtensionId':_0x448c7c['id']});_0x1ea838[_0x0c09('0xc')]({'type':_0x164f52[_0x0c09('0x4')][_0x0c09('0x38')](),'app':_0x0c09('0x5'),'appdata':_0x0c09('0x47'),'context':_0x448c7c[_0x0c09('0x6')],'exten':_0x448c7c[_0x0c09('0xa')],'priority':_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')]+_0x2ccde9+_0x3bbd5a++,'VoiceExtensionId':_0x448c7c['id']});}else{_0x1ea838[_0x0c09('0xc')]({'type':_0x164f52[_0x0c09('0x4')][_0x0c09('0x38')](),'app':'ExecIf','appdata':_0x0c09('0x48'),'context':_0x448c7c[_0x0c09('0x6')],'exten':_0x448c7c[_0x0c09('0xa')],'priority':_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')]+_0x2ccde9+_0x3bbd5a++,'VoiceExtensionId':_0x448c7c['id']});_0x1ea838['push']({'type':_0x164f52['type'][_0x0c09('0x38')](),'app':'Set','appdata':_0x0c09('0x49'),'context':_0x448c7c[_0x0c09('0x6')],'exten':_0x448c7c['exten'],'priority':_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')]+_0x2ccde9+_0x3bbd5a++,'VoiceExtensionId':_0x448c7c['id']});}}}}for(var _0x1ade1a=0x0;_0x1ade1a<_0x164f52[_0x0c09('0x36')]['length'];_0x1ade1a++){var _0x21a0e4=_0x2ccde9+_0x164f52[_0x0c09('0x36')][_0x0c09('0x34')];var _0x2a7942=_0x1ade1a===_0x164f52[_0x0c09('0x36')]['length']-0x1?_0x2ccde9+_0x1ea838[_0x0c09('0x34')]+_0x225a72[_0x0c09('0x34')]+0x2:_0x2ccde9+_0x1ade1a+0x1;_0x1ea838[_0x0c09('0x4a')](_0x1ade1a,0x0,{'type':_0x448c7c[_0x0c09('0x4')],'app':_0x0c09('0x4b'),'appdata':_0x164f52[_0x0c09('0x36')][_0x1ade1a]+'?'+_0x448c7c['context']+_0x0c09('0x4c')+_0x21a0e4+':'+_0x448c7c[_0x0c09('0x6')]+_0x0c09('0x4c')+_0x2a7942,'exten':_0x448c7c[_0x0c09('0xa')],'context':_0x448c7c[_0x0c09('0x6')],'priority':_0x2ccde9+_0x1ade1a,'VoiceExtensionId':_0x448c7c['id']});}if(_0x164f52['appType']===_0x0c09('0x4d'))_0x164f52[_0x0c09('0x4e')]=_0x1a72a2(_0x448c7c,_0x164f52['appdata']);_0x164f52[_0x0c09('0x4f')]=_0x1ea838['length']?_[_0x0c09('0x50')](_0x1ea838)[_0x0c09('0x4f')]+0x1:_0x2ccde9;_0x2ab418=_[_0x0c09('0x51')](_0x2ab418,_0x1ea838,[_0x164f52],_0x225a72);_0x2ccde9=_['last'](_0x2ab418)[_0x0c09('0x4f')]+0x1;}return _0x2819d2(_0x2ab418);})[_0x0c09('0x52')](function(_0x45de80){_0x24bbbf(_0x45de80);});});}return _0xb5d246[_0x0c09('0x53')](_0x0c09('0x54'),attributes,{'tableName':_0x0c09('0x55'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4f5587){var _0x22f93c=this[_0x0c09('0x56')]({'plain':!![]});var _0x4c6f8d=_0x22f93c[_0x0c09('0x4')]===_0x0c09('0xf')?_0x173f4c(_0x22f93c):_0x289436(_0x22f93c);return _0x5aeb49(_0x22f93c,_0x4f5587,_[_0x0c09('0x50')](_0x4c6f8d)['priority']+0x1)[_0x0c09('0x33')](function(_0x24a148){var _0x169b82=_[_0x0c09('0x51')](_0x4c6f8d,_0x24a148);_0x169b82[_0x0c09('0xc')]({'type':_0x22f93c[_0x0c09('0x4')],'app':_0x0c09('0x57'),'exten':_0x22f93c[_0x0c09('0xa')],'context':_0x22f93c[_0x0c09('0x6')],'priority':_[_0x0c09('0x50')](_0x169b82)[_0x0c09('0x4f')]+0x1,'VoiceExtensionId':_0x22f93c['id']});return _0x169b82;});}}});}; \ No newline at end of file +var _0x4fe0=['CDR(type)=','exten','alias','NoOp','CDR(routeAlias)=','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','No\x20alias\x20set','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','get','concat','./voiceExtension.attributes','exports','models','type','Set'];(function(_0x30494b,_0x47c496){var _0x4ee2fa=function(_0x1b5c20){while(--_0x1b5c20){_0x30494b['push'](_0x30494b['shift']());}};_0x4ee2fa(++_0x47c496);}(_0x4fe0,0x195));var _0x04fe=function(_0x1ec2e4,_0x499c13){_0x1ec2e4=_0x1ec2e4-0x0;var _0x139e02=_0x4fe0[_0x1ec2e4];return _0x139e02;};'use strict';var _=require('lodash');var attributes=require(_0x04fe('0x0'));module[_0x04fe('0x1')]=function(_0x17f3c8){var _0x3065e4=_0x17f3c8[_0x04fe('0x2')];function _0x22f3a6(_0x4de1fd){var _0x158919=0x2;var _0x55000a=[{'type':_0x4de1fd[_0x04fe('0x3')],'app':_0x04fe('0x4'),'appdata':_0x04fe('0x5')+_0x4de1fd[_0x04fe('0x3')],'context':_0x4de1fd['context'],'exten':_0x4de1fd[_0x04fe('0x6')],'priority':_0x158919++,'VoiceExtensionId':_0x4de1fd['id']},{'type':_0x4de1fd['type'],'app':_0x4de1fd[_0x04fe('0x7')]?_0x04fe('0x4'):_0x04fe('0x8'),'appdata':_0x4de1fd[_0x04fe('0x7')]?_0x04fe('0x9')+_0x4de1fd['alias']:'No\x20alias\x20set','context':_0x4de1fd[_0x04fe('0xa')],'exten':_0x4de1fd[_0x04fe('0x6')],'priority':_0x158919++,'VoiceExtensionId':_0x4de1fd['id']}];if(_0x4de1fd[_0x04fe('0x3')]===_0x04fe('0xb')){_0x55000a[_0x04fe('0xc')]({'type':_0x04fe('0xb'),'app':_0x04fe('0x4'),'appdata':_0x04fe('0xd')+_0x4de1fd['id'],'context':_0x4de1fd[_0x04fe('0xa')],'exten':_0x4de1fd[_0x04fe('0x6')],'priority':_0x158919++,'VoiceExtensionId':_0x4de1fd['id']});}_0x55000a[_0x04fe('0xc')]({'type':_0x4de1fd[_0x04fe('0x3')],'app':_0x04fe('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4de1fd['context'],'exten':_0x4de1fd[_0x04fe('0x6')],'priority':_0x158919++,'VoiceExtensionId':_0x4de1fd['id']},{'type':_0x4de1fd[_0x04fe('0x3')],'app':_0x04fe('0x4'),'appdata':_0x04fe('0xe'),'context':_0x4de1fd[_0x04fe('0xa')],'exten':_0x4de1fd[_0x04fe('0x6')],'priority':_0x158919++,'VoiceExtensionId':_0x4de1fd['id']},{'type':_0x4de1fd[_0x04fe('0x3')],'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x4de1fd[_0x04fe('0xa')],'exten':_0x4de1fd[_0x04fe('0x6')],'priority':_0x158919++,'VoiceExtensionId':_0x4de1fd['id']});return _0x55000a;}function _0x128485(_0x477938){var _0x1e0cfd=0x2;var _0x443fe5=[{'type':_0x04fe('0xf'),'app':_0x04fe('0x4'),'appdata':_0x04fe('0x10'),'context':_0x477938[_0x04fe('0xa')],'exten':_0x477938[_0x04fe('0x6')],'priority':_0x1e0cfd++,'VoiceExtensionId':_0x477938['id']},{'type':_0x04fe('0xf'),'app':_0x477938['alias']?_0x04fe('0x4'):_0x04fe('0x8'),'appdata':_0x477938['alias']?_0x04fe('0x9')+_0x477938['alias']:_0x04fe('0x11'),'context':_0x477938[_0x04fe('0xa')],'exten':_0x477938[_0x04fe('0x6')],'priority':_0x1e0cfd++,'VoiceExtensionId':_0x477938['id']},{'type':'outbound','app':_0x04fe('0x4'),'appdata':'CDR(destination)='+(_0x477938[_0x04fe('0x12')]?_0x04fe('0x13')+_0x477938[_0x04fe('0x12')]+'}':_0x04fe('0x14')),'context':_0x477938[_0x04fe('0xa')],'exten':_0x477938[_0x04fe('0x6')],'priority':_0x1e0cfd++,'VoiceExtensionId':_0x477938['id']},{'type':_0x04fe('0xf'),'app':'Set','appdata':_0x04fe('0xd')+_0x477938['id'],'context':_0x477938[_0x04fe('0xa')],'exten':_0x477938['exten'],'priority':_0x1e0cfd++,'VoiceExtensionId':_0x477938['id']},{'type':_0x04fe('0xf'),'app':_0x04fe('0x15'),'appdata':_0x04fe('0x16')+(_0x1e0cfd+0x2)+'):Goto('+(_0x1e0cfd+0x1)+')','context':_0x477938[_0x04fe('0xa')],'exten':_0x477938['exten'],'priority':_0x1e0cfd++,'VoiceExtensionId':_0x477938['id']},{'type':'outbound','app':_0x04fe('0x4'),'appdata':_0x477938['cutdigits']?_0x04fe('0x17')+_0x477938[_0x04fe('0x12')]+'}':_0x04fe('0x18'),'context':_0x477938[_0x04fe('0xa')],'exten':_0x477938[_0x04fe('0x6')],'priority':_0x1e0cfd++,'VoiceExtensionId':_0x477938['id']},{'type':_0x04fe('0xf'),'app':'Set','appdata':_0x04fe('0x19'),'context':_0x477938['context'],'exten':_0x477938[_0x04fe('0x6')],'priority':_0x1e0cfd++,'VoiceExtensionId':_0x477938['id']},{'type':_0x04fe('0xf'),'app':_0x04fe('0x4'),'appdata':_0x04fe('0xe'),'context':_0x477938[_0x04fe('0xa')],'exten':_0x477938[_0x04fe('0x6')],'priority':_0x1e0cfd++,'VoiceExtensionId':_0x477938['id']},{'type':_0x04fe('0xf'),'app':_0x04fe('0x4'),'appdata':_0x04fe('0x1a'),'context':_0x477938[_0x04fe('0xa')],'exten':_0x477938[_0x04fe('0x6')],'priority':_0x1e0cfd++,'VoiceExtensionId':_0x477938['id']},{'type':_0x04fe('0xf'),'app':'Set','appdata':_0x04fe('0x1b')+_0x477938['id'],'context':_0x477938[_0x04fe('0xa')],'exten':_0x477938[_0x04fe('0x6')],'priority':_0x1e0cfd++,'VoiceExtensionId':_0x477938['id']}];if(_0x477938[_0x04fe('0x1c')](_0x04fe('0x1d'))&&_0x477938[_0x04fe('0x1d')]!==_0x04fe('0x1e')){_0x443fe5[_0x04fe('0xc')]({'type':'outbound','app':_0x04fe('0x4'),'appdata':_0x04fe('0x1f'),'context':_0x477938[_0x04fe('0xa')],'exten':_0x477938[_0x04fe('0x6')],'priority':_0x1e0cfd++,'VoiceExtensionId':_0x477938['id']},{'type':_0x04fe('0xf'),'app':_0x04fe('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x477938[_0x04fe('0x1d')]||_0x04fe('0x20'),'context':_0x477938[_0x04fe('0xa')],'exten':_0x477938['exten'],'priority':_0x1e0cfd++,'VoiceExtensionId':_0x477938['id']});}return _0x443fe5;}function _0xaf7079(_0x4e5e6e,_0x8023e6){var _0x4fb3b1=[{'name':_0x04fe('0x21'),'param':0x0},{'name':_0x04fe('0x22'),'param':0x1},{'name':_0x04fe('0x23'),'param':0x2},{'name':_0x04fe('0x24'),'param':0x3}];var _0x810917={};var _0x377e0a=_0x8023e6[_0x04fe('0x25')](',');var _0x10f879=[];for(var _0x2cbe39=0x0;_0x2cbe39<_0x4fb3b1[_0x04fe('0x26')];_0x2cbe39++){switch(_0x4fb3b1[_0x2cbe39][_0x04fe('0x27')]){case'trunk':_0x810917['trunk']=_0x377e0a[_0x4fb3b1[_0x2cbe39][_0x04fe('0x28')]][_0x04fe('0x25')]('/')[0x1];_0x810917[_0x04fe('0x29')]=_0x377e0a[_0x4fb3b1[_0x2cbe39]['param']][_0x04fe('0x25')]('/')[0x2];_0x810917[_0x04fe('0x2a')]=_0x810917[_0x04fe('0x29')]?_0x810917['phone'][_0x04fe('0x25')]('$')[0x0]:undefined;_0x810917[_0x04fe('0x29')]=_0x4e5e6e['cutdigits']?(_0x810917[_0x04fe('0x2a')]||'')+_0x04fe('0x13')+_0x4e5e6e[_0x04fe('0x12')]+'}':(_0x810917[_0x04fe('0x2a')]||'')+_0x04fe('0x14');_0x10f879[_0x4fb3b1[_0x2cbe39][_0x04fe('0x28')]]=[_0x04fe('0x2b'),_0x810917[_0x04fe('0x21')],_0x810917[_0x04fe('0x29')]][_0x04fe('0x2c')]('/');break;case _0x04fe('0x23'):_0x810917['options']=_0x377e0a[_0x4fb3b1[_0x2cbe39][_0x04fe('0x28')]];if(_0x4e5e6e[_0x04fe('0x1d')]!==_0x04fe('0x1e')){if(_0x810917[_0x04fe('0x23')][_0x04fe('0x2d')]('U(xcally-mixmonitor-context)')<0x0){_0x810917[_0x04fe('0x23')]+=_0x04fe('0x2e');}}else{_0x810917[_0x04fe('0x23')]=_0x810917[_0x04fe('0x23')]['replace'](_0x04fe('0x2e'),'');}_0x10f879[_0x4fb3b1[_0x2cbe39]['param']]=_0x810917[_0x04fe('0x23')];break;default:_0x10f879[_0x4fb3b1[_0x2cbe39][_0x04fe('0x28')]]=_0x377e0a[_0x4fb3b1[_0x2cbe39][_0x04fe('0x28')]];}}return _0x10f879[_0x04fe('0x2c')](',');}function _0x518892(_0x5a2571,_0x5aa84c,_0x4cfeaa){return new Promise(function(_0x13dd0b,_0xc07dd3){var _0x5994b3=[];if(_['isEmpty'](_0x5aa84c))return _0x13dd0b(_0x5994b3);_0x3065e4[_0x04fe('0x2f')][_0x04fe('0x30')]({'attributes':['id',_0x04fe('0x31'),_0x04fe('0x32')],'raw':!![]})[_0x04fe('0x33')](function(_0x46ba06){for(var _0x24a41e=0x0,_0x34b9fa=0x0;_0x24a41e<_0x5aa84c[_0x04fe('0x26')];_0x24a41e++,_0x34b9fa=0x0){var _0x3d97cb=_0x5aa84c[_0x24a41e];var _0x34983d=[];var _0x4daedb=[];delete _0x3d97cb['id'];if(_0x3d97cb['interval']!==_0x04fe('0x34')){_0x3d97cb['intervals']=[_0x3d97cb[_0x04fe('0x31')]];}else{_0x3d97cb[_0x04fe('0x35')]=_0x3d97cb[_0x04fe('0x32')]?_[_0x04fe('0x36')](_[_0x04fe('0x37')](_0x46ba06,{'IntervalId':_0x3d97cb[_0x04fe('0x32')]}),_0x04fe('0x31')):[];}_0x3d97cb[_0x04fe('0xa')]=_0x5a2571[_0x04fe('0xa')];_0x3d97cb[_0x04fe('0x6')]=_0x5a2571['exten'];if(_0x3d97cb[_0x04fe('0x3')])_0x3d97cb[_0x04fe('0x3')]=_0x3d97cb[_0x04fe('0x3')][_0x04fe('0x38')]();if(_0x5a2571['type']==='outbound'){if(_0x3d97cb[_0x04fe('0x1c')](_0x04fe('0x39'))&&_0x3d97cb[_0x04fe('0x39')]&&_0x3d97cb[_0x04fe('0x39')]!=='--'){_0x34983d[_0x04fe('0xc')]({'type':_0x3d97cb[_0x04fe('0x3')][_0x04fe('0x38')](),'app':_0x04fe('0x4'),'appdata':_0x04fe('0x3a')+_0x3d97cb['tag'],'context':_0x5a2571['context'],'exten':_0x5a2571['exten'],'priority':_0x3d97cb[_0x04fe('0x35')]['length']+_0x4cfeaa+_0x34b9fa++,'VoiceExtensionId':_0x5a2571['id']});}_0x34983d[_0x04fe('0xc')]({'type':_0x3d97cb['type']['toLowerCase'](),'app':_0x04fe('0x15'),'appdata':_0x04fe('0x3b')+(_0x3d97cb[_0x04fe('0x3c')]?'Set(CALLERID(all)='+_0x3d97cb['callerID']+')':_0x04fe('0x3d')),'context':_0x5a2571[_0x04fe('0xa')],'exten':_0x5a2571['exten'],'priority':_0x3d97cb['intervals'][_0x04fe('0x26')]+_0x4cfeaa+_0x34b9fa++,'VoiceExtensionId':_0x5a2571['id']});}else{if(_0x3d97cb[_0x04fe('0x1c')](_0x04fe('0x3e'))){if([_0x04fe('0x3f'),'playback'][_0x04fe('0x40')](_0x3d97cb['app']['toLowerCase']())&&_0x3d97cb[_0x04fe('0x41')]!==_0x04fe('0x42')){if(_0x3d97cb[_0x04fe('0x3e')]){_0x34983d[_0x04fe('0xc')]({'type':_0x3d97cb[_0x04fe('0x3')][_0x04fe('0x38')](),'app':'ExecIf','appdata':_0x04fe('0x43'),'context':_0x5a2571[_0x04fe('0xa')],'exten':_0x5a2571[_0x04fe('0x6')],'priority':_0x3d97cb['intervals'][_0x04fe('0x26')]+_0x4cfeaa+_0x34b9fa++,'VoiceExtensionId':_0x5a2571['id']});_0x34983d[_0x04fe('0xc')]({'type':_0x3d97cb[_0x04fe('0x3')][_0x04fe('0x38')](),'app':'Set','appdata':_0x04fe('0x44'),'context':_0x5a2571[_0x04fe('0xa')],'exten':_0x5a2571[_0x04fe('0x6')],'priority':_0x3d97cb[_0x04fe('0x35')]['length']+_0x4cfeaa+_0x34b9fa++,'VoiceExtensionId':_0x5a2571['id']});}else{_0x34983d[_0x04fe('0xc')]({'type':_0x3d97cb[_0x04fe('0x3')][_0x04fe('0x38')](),'app':_0x04fe('0x15'),'appdata':_0x04fe('0x45'),'context':_0x5a2571[_0x04fe('0xa')],'exten':_0x5a2571[_0x04fe('0x6')],'priority':_0x3d97cb[_0x04fe('0x35')][_0x04fe('0x26')]+_0x4cfeaa+_0x34b9fa++,'VoiceExtensionId':_0x5a2571['id']});_0x34983d[_0x04fe('0xc')]({'type':_0x3d97cb[_0x04fe('0x3')][_0x04fe('0x38')](),'app':_0x04fe('0x4'),'appdata':_0x04fe('0x46'),'context':_0x5a2571['context'],'exten':_0x5a2571[_0x04fe('0x6')],'priority':_0x3d97cb[_0x04fe('0x35')][_0x04fe('0x26')]+_0x4cfeaa+_0x34b9fa++,'VoiceExtensionId':_0x5a2571['id']});}}}}for(var _0x5e34be=0x0;_0x5e34be<_0x3d97cb[_0x04fe('0x35')][_0x04fe('0x26')];_0x5e34be++){var _0x41b96e=_0x4cfeaa+_0x3d97cb['intervals'][_0x04fe('0x26')];var _0x1c5ea6=_0x5e34be===_0x3d97cb[_0x04fe('0x35')][_0x04fe('0x26')]-0x1?_0x4cfeaa+_0x34983d[_0x04fe('0x26')]+_0x4daedb['length']+0x2:_0x4cfeaa+_0x5e34be+0x1;_0x34983d['splice'](_0x5e34be,0x0,{'type':_0x5a2571[_0x04fe('0x3')],'app':_0x04fe('0x47'),'appdata':_0x3d97cb[_0x04fe('0x35')][_0x5e34be]+'?'+_0x5a2571['context']+_0x04fe('0x48')+_0x41b96e+':'+_0x5a2571[_0x04fe('0xa')]+',${EXTEN},'+_0x1c5ea6,'exten':_0x5a2571[_0x04fe('0x6')],'context':_0x5a2571[_0x04fe('0xa')],'priority':_0x4cfeaa+_0x5e34be,'VoiceExtensionId':_0x5a2571['id']});}if(_0x3d97cb[_0x04fe('0x41')]===_0x04fe('0x49'))_0x3d97cb['appdata']=_0xaf7079(_0x5a2571,_0x3d97cb[_0x04fe('0x4a')]);_0x3d97cb['priority']=_0x34983d[_0x04fe('0x26')]?_['last'](_0x34983d)[_0x04fe('0x4b')]+0x1:_0x4cfeaa;_0x5994b3=_['concat'](_0x5994b3,_0x34983d,[_0x3d97cb],_0x4daedb);_0x4cfeaa=_[_0x04fe('0x4c')](_0x5994b3)[_0x04fe('0x4b')]+0x1;}return _0x13dd0b(_0x5994b3);})[_0x04fe('0x4d')](function(_0x3223e3){_0xc07dd3(_0x3223e3);});});}return _0x17f3c8[_0x04fe('0x4e')](_0x04fe('0x4f'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x49ccf1){var _0x42472d=this[_0x04fe('0x50')]({'plain':!![]});var _0x2363f9=_0x42472d[_0x04fe('0x3')]===_0x04fe('0xf')?_0x128485(_0x42472d):_0x22f3a6(_0x42472d);return _0x518892(_0x42472d,_0x49ccf1,_[_0x04fe('0x4c')](_0x2363f9)['priority']+0x1)['then'](function(_0xf3a6cd){var _0x4f7d4f=_[_0x04fe('0x51')](_0x2363f9,_0xf3a6cd);_0x4f7d4f[_0x04fe('0xc')]({'type':_0x42472d['type'],'app':'Hangup','exten':_0x42472d[_0x04fe('0x6')],'context':_0x42472d['context'],'priority':_[_0x04fe('0x4c')](_0x4f7d4f)['priority']+0x1,'VoiceExtensionId':_0x42472d['id']});return _0x4f7d4f;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 9a2ff4a..7f17f14 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 _0x126e=['where','limit','include','map','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x126e,0x108));var _0xe126=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x126e[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var moment=require(_0xe126('0x1'));var BPromise=require(_0xe126('0x2'));var rs=require(_0xe126('0x3'));var fs=require('fs');var Redis=require(_0xe126('0x4'));var db=require(_0xe126('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe126('0x6'))(_0xe126('0x7'));var config=require(_0xe126('0x8'));var jayson=require(_0xe126('0x9'));var client=jayson[_0xe126('0xa')][_0xe126('0xb')]({'port':0x232a});config[_0xe126('0xc')]=_['defaults'](config[_0xe126('0xc')],{'host':_0xe126('0xd'),'port':0x18eb});var socket=require(_0xe126('0xe'))(new Redis(config[_0xe126('0xc')]));require(_0xe126('0xf'))['register'](socket);function respondWithRpcPromise(_0x1bc461,_0x1708a0,_0x5e3e34){return new BPromise(function(_0xd69bf4,_0x2ac33c){return client['request'](_0x1bc461,_0x5e3e34)[_0xe126('0x10')](function(_0x5bd113){logger[_0xe126('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x1708a0,_0xe126('0x12'));logger[_0xe126('0x13')](_0xe126('0x14'),_0x1708a0,_0xe126('0x12'),JSON[_0xe126('0x15')](_0x5bd113));if(_0x5bd113[_0xe126('0x16')]){if(_0x5bd113[_0xe126('0x16')]['code']===0x1f4){logger[_0xe126('0x16')](_0xe126('0x17'),_0x1708a0,_0x5bd113['error'][_0xe126('0x18')]);return _0x2ac33c(_0x5bd113[_0xe126('0x16')][_0xe126('0x18')]);}logger[_0xe126('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x1708a0,_0x5bd113[_0xe126('0x16')][_0xe126('0x18')]);return _0xd69bf4(_0x5bd113[_0xe126('0x16')]['message']);}else{logger[_0xe126('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x1708a0,_0xe126('0x12'));_0xd69bf4(_0x5bd113[_0xe126('0x19')][_0xe126('0x18')]);}})[_0xe126('0x1a')](function(_0x3f3dfc){logger[_0xe126('0x16')](_0xe126('0x17'),_0x1708a0,_0x3f3dfc);_0x2ac33c(_0x3f3dfc);});});}exports[_0xe126('0x1b')]=function(_0x5cc73b){var _0x3e0a77=this;return new Promise(function(_0x614bde,_0x35ab64){return db[_0xe126('0x1c')][_0xe126('0x1d')]({'raw':_0x5cc73b[_0xe126('0x1e')]?_0x5cc73b[_0xe126('0x1e')][_0xe126('0x1f')]===undefined?!![]:![]:!![],'where':_0x5cc73b['options']?_0x5cc73b['options'][_0xe126('0x20')]||null:null,'attributes':_0x5cc73b[_0xe126('0x1e')]?_0x5cc73b[_0xe126('0x1e')]['attributes']||null:null,'limit':_0x5cc73b['options']?_0x5cc73b['options'][_0xe126('0x21')]||null:null,'include':_0x5cc73b[_0xe126('0x1e')]?_0x5cc73b['options'][_0xe126('0x22')]?_[_0xe126('0x23')](_0x5cc73b[_0xe126('0x1e')][_0xe126('0x22')],function(_0x532409){return{'model':db[_0x532409['model']],'as':_0x532409['as'],'attributes':_0x532409[_0xe126('0x24')],'include':_0x532409['include']?_[_0xe126('0x23')](_0x532409[_0xe126('0x22')],function(_0x630bcc){return{'model':db[_0x630bcc['model']],'as':_0x630bcc['as'],'attributes':_0x630bcc[_0xe126('0x24')],'include':_0x630bcc[_0xe126('0x22')]?_['map'](_0x630bcc[_0xe126('0x22')],function(_0x259059){return{'model':db[_0x259059['model']],'as':_0x259059['as'],'attributes':_0x259059[_0xe126('0x24')]};}):[]};}):[]};}):[]:[]})[_0xe126('0x10')](function(_0x29dec4){logger[_0xe126('0x11')]('GetVoiceExtension',_0x5cc73b);logger[_0xe126('0x13')](_0xe126('0x1b'),_0x5cc73b,JSON['stringify'](_0x29dec4));_0x614bde(_0x29dec4);})['catch'](function(_0x267582){logger['error'](_0xe126('0x1b'),_0x267582[_0xe126('0x18')],_0x5cc73b);_0x35ab64(_0x3e0a77[_0xe126('0x16')](0x1f4,_0x267582['message']));});});}; \ No newline at end of file +var _0x3eea=['jayson/promise','client','defaults','localhost','redis','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x43ca62,_0x19d4ba){var _0x3ae462=function(_0x715f87){while(--_0x715f87){_0x43ca62['push'](_0x43ca62['shift']());}};_0x3ae462(++_0x19d4ba);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x47359b,_0x41b6e2){_0x47359b=_0x47359b-0x0;var _0x3c4072=_0x3eea[_0x47359b];return _0x3c4072;};'use strict';var _=require(_0xa3ee('0x0'));var util=require('util');var moment=require(_0xa3ee('0x1'));var BPromise=require(_0xa3ee('0x2'));var rs=require(_0xa3ee('0x3'));var fs=require('fs');var Redis=require(_0xa3ee('0x4'));var db=require(_0xa3ee('0x5'))['db'];var utils=require(_0xa3ee('0x6'));var logger=require(_0xa3ee('0x7'))(_0xa3ee('0x8'));var config=require(_0xa3ee('0x9'));var jayson=require(_0xa3ee('0xa'));var client=jayson[_0xa3ee('0xb')]['http']({'port':0x232a});config['redis']=_[_0xa3ee('0xc')](config['redis'],{'host':_0xa3ee('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa3ee('0xe')]));require('./voiceExtension.socket')[_0xa3ee('0xf')](socket);function respondWithRpcPromise(_0x5ef236,_0x28aeb1,_0x1a3ab0){return new BPromise(function(_0x188966,_0x50f5e6){return client[_0xa3ee('0x10')](_0x5ef236,_0x1a3ab0)[_0xa3ee('0x11')](function(_0x4dc361){logger['info'](_0xa3ee('0x12'),_0x28aeb1,_0xa3ee('0x13'));logger[_0xa3ee('0x14')](_0xa3ee('0x15'),_0x28aeb1,'request\x20sent',JSON[_0xa3ee('0x16')](_0x4dc361));if(_0x4dc361['error']){if(_0x4dc361[_0xa3ee('0x17')][_0xa3ee('0x18')]===0x1f4){logger[_0xa3ee('0x17')](_0xa3ee('0x12'),_0x28aeb1,_0x4dc361['error'][_0xa3ee('0x19')]);return _0x50f5e6(_0x4dc361[_0xa3ee('0x17')]['message']);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x28aeb1,_0x4dc361[_0xa3ee('0x17')][_0xa3ee('0x19')]);return _0x188966(_0x4dc361[_0xa3ee('0x17')][_0xa3ee('0x19')]);}else{logger['info'](_0xa3ee('0x12'),_0x28aeb1,_0xa3ee('0x13'));_0x188966(_0x4dc361[_0xa3ee('0x1a')][_0xa3ee('0x19')]);}})[_0xa3ee('0x1b')](function(_0x4aac0e){logger[_0xa3ee('0x17')](_0xa3ee('0x12'),_0x28aeb1,_0x4aac0e);_0x50f5e6(_0x4aac0e);});});}exports[_0xa3ee('0x1c')]=function(_0xad8187){var _0x216b7d=this;return new Promise(function(_0x3195a7,_0x4f8c56){return db[_0xa3ee('0x1d')][_0xa3ee('0x1e')]({'raw':_0xad8187['options']?_0xad8187[_0xa3ee('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xad8187[_0xa3ee('0x1f')]?_0xad8187[_0xa3ee('0x1f')][_0xa3ee('0x20')]||null:null,'attributes':_0xad8187[_0xa3ee('0x1f')]?_0xad8187[_0xa3ee('0x1f')][_0xa3ee('0x21')]||null:null,'limit':_0xad8187[_0xa3ee('0x1f')]?_0xad8187[_0xa3ee('0x1f')][_0xa3ee('0x22')]||null:null,'include':_0xad8187[_0xa3ee('0x1f')]?_0xad8187['options'][_0xa3ee('0x23')]?_[_0xa3ee('0x24')](_0xad8187[_0xa3ee('0x1f')][_0xa3ee('0x23')],function(_0x2c48db){return{'model':db[_0x2c48db['model']],'as':_0x2c48db['as'],'attributes':_0x2c48db[_0xa3ee('0x21')],'include':_0x2c48db[_0xa3ee('0x23')]?_[_0xa3ee('0x24')](_0x2c48db[_0xa3ee('0x23')],function(_0x42e97c){return{'model':db[_0x42e97c[_0xa3ee('0x25')]],'as':_0x42e97c['as'],'attributes':_0x42e97c[_0xa3ee('0x21')],'include':_0x42e97c[_0xa3ee('0x23')]?_[_0xa3ee('0x24')](_0x42e97c[_0xa3ee('0x23')],function(_0x59c6f9){return{'model':db[_0x59c6f9['model']],'as':_0x59c6f9['as'],'attributes':_0x59c6f9['attributes']};}):[]};}):[]};}):[]:[]})[_0xa3ee('0x11')](function(_0x481358){logger[_0xa3ee('0x26')](_0xa3ee('0x1c'),_0xad8187);logger[_0xa3ee('0x14')](_0xa3ee('0x1c'),_0xad8187,JSON[_0xa3ee('0x16')](_0x481358));_0x3195a7(_0x481358);})[_0xa3ee('0x1b')](function(_0x30ba4e){logger[_0xa3ee('0x17')](_0xa3ee('0x1c'),_0x30ba4e[_0xa3ee('0x19')],_0xad8187);_0x4f8c56(_0x216b7d['error'](0x1f4,_0x30ba4e[_0xa3ee('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 270f1a9..0b083fc 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 _0x0295=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','update'];(function(_0xba47f4,_0x34d4ed){var _0x4a2220=function(_0xb48fc1){while(--_0xb48fc1){_0xba47f4['push'](_0xba47f4['shift']());}};_0x4a2220(++_0x34d4ed);}(_0x0295,0x1f0));var _0x5029=function(_0x360076,_0x481a6f){_0x360076=_0x360076-0x0;var _0x1d593d=_0x0295[_0x360076];return _0x1d593d;};'use strict';var VoiceExtensionEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){VoiceExtensionEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);VoiceExtensionEvents['on'](_0x54978f,_0x4ee867);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x131950,_0x2c837c){var _0xce6737=function(_0xb3ed48){while(--_0xb3ed48){_0x131950['push'](_0x131950['shift']());}};_0xce6737(++_0x2c837c);}(_0xe14b,0x93));var _0xbe14=function(_0xbf3b83,_0x2d1b3e){_0xbf3b83=_0xbf3b83-0x0;var _0x15848f=_0xe14b[_0xbf3b83];return _0x15848f;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index afa2456..7e3a9b4 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb016=['get','isAuthenticated','index','show','getMessages','post','create','update','delete','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x49ab20,_0x204482){var _0x3c10b4=function(_0x654c44){while(--_0x654c44){_0x49ab20['push'](_0x49ab20['shift']());}};_0x3c10b4(++_0x204482);}(_0xb016,0x159));var _0x6b01=function(_0x4f3a05,_0x4944f3){_0x4f3a05=_0x4f3a05-0x0;var _0x4c753c=_0xb016[_0x4f3a05];return _0x4c753c;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var fs_extra=require(_0x6b01('0x3'));var auth=require(_0x6b01('0x4'));var interaction=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var controller=require('./voiceMail.controller');router[_0x6b01('0x7')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0x9')]);router['get']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xa')]);router['get']('/:id/messages',auth[_0x6b01('0x8')](),controller[_0x6b01('0xb')]);router[_0x6b01('0xc')]('/',auth[_0x6b01('0x8')](),controller[_0x6b01('0xd')]);router['put']('/:id',auth[_0x6b01('0x8')](),controller[_0x6b01('0xe')]);router[_0x6b01('0xf')]('/:id',auth[_0x6b01('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6050=['/:id/messages','isAuthenticated','getMessages','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','show','get'];(function(_0x2ceae3,_0x2caeea){var _0xabb5a4=function(_0x7428f1){while(--_0x7428f1){_0x2ceae3['push'](_0x2ceae3['shift']());}};_0xabb5a4(++_0x2caeea);}(_0x6050,0x196));var _0x0605=function(_0x214914,_0x599809){_0x214914=_0x214914-0x0;var _0xfea824=_0x6050[_0x214914];return _0xfea824;};'use strict';var multer=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var path=require(_0x0605('0x2'));var timeout=require(_0x0605('0x3'));var express=require(_0x0605('0x4'));var router=express[_0x0605('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0605('0x6'));var interaction=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var controller=require('./voiceMail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0605('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0605('0xa')]);router[_0x0605('0xb')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0xe')]);router['post']('/',auth[_0x0605('0xd')](),controller[_0x0605('0xf')]);router[_0x0605('0x10')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x12')]);router[_0x0605('0x13')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x14')]);module[_0x0605('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index ae3214d..41a7306 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 _0x8f40=['from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING'];(function(_0x4c592c,_0x21c9ee){var _0x1e4928=function(_0x3cd748){while(--_0x3cd748){_0x4c592c['push'](_0x4c592c['shift']());}};_0x1e4928(++_0x21c9ee);}(_0x8f40,0x8e));var _0x08f4=function(_0x1d5383,_0x2e5de3){_0x1d5383=_0x1d5383-0x0;var _0x1f8677=_0x8f40[_0x1d5383];return _0x1f8677;};'use strict';var Sequelize=require(_0x08f4('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x08f4('0x1')]},'context':{'type':Sequelize[_0x08f4('0x1')],'defaultValue':_0x08f4('0x2'),'unique':_0x08f4('0x3')},'mailbox':{'type':Sequelize[_0x08f4('0x1')],'defaultValue':'','allowNull':![],'unique':_0x08f4('0x3')},'password':{'type':Sequelize[_0x08f4('0x1')]},'fullname':{'type':Sequelize[_0x08f4('0x1')]},'email':{'type':Sequelize[_0x08f4('0x1')],'validate':{'isEmail':!![]},'set':function(_0x594aea){this[_0x08f4('0x4')](_0x08f4('0x5'),typeof _0x594aea===_0x08f4('0x6')&&_0x594aea[_0x08f4('0x7')]()?_0x594aea[_0x08f4('0x7')]():null);}},'pager':{'type':Sequelize[_0x08f4('0x1')]},'tz':{'type':Sequelize[_0x08f4('0x1')],'defaultValue':_0x08f4('0x8')},'attach':{'type':Sequelize['ENUM'](_0x08f4('0x9'),'no'),'defaultValue':_0x08f4('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x08f4('0xa')](_0x08f4('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x08f4('0x1')]},'callback':{'type':Sequelize[_0x08f4('0x1')]},'review':{'type':Sequelize[_0x08f4('0xa')](_0x08f4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x08f4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x08f4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x08f4('0xa')](_0x08f4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x08f4('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x08f4('0xa')](_0x08f4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x08f4('0xa')](_0x08f4('0x9'),'no'),'defaultValue':_0x08f4('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x08f4('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x08f4('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x08f4('0x9'),'allowNull':![]},'stamp':{'type':_0x08f4('0xb')},'emailsubject':{'type':Sequelize[_0x08f4('0x1')]},'emailbody':{'type':Sequelize[_0x08f4('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x08f4('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x08f4('0xd')],'get':function(){return this[_0x08f4('0xe')](_0x08f4('0xf'))+_0x08f4('0x10')+this[_0x08f4('0xe')](_0x08f4('0x11'));}}}; \ No newline at end of file +var _0xc240=['mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','central','yes','ENUM','TINYINT(4)','INTEGER','fullname','getDataValue'];(function(_0x29eb79,_0x54e411){var _0x44e7d5=function(_0x1dcea9){while(--_0x1dcea9){_0x29eb79['push'](_0x29eb79['shift']());}};_0x44e7d5(++_0x54e411);}(_0xc240,0x181));var _0x0c24=function(_0x4bb265,_0x5a3252){_0x4bb265=_0x4bb265-0x0;var _0x33430a=_0xc240[_0x4bb265];return _0x33430a;};'use strict';var Sequelize=require(_0x0c24('0x0'));module[_0x0c24('0x1')]={'customer_id':{'type':Sequelize[_0x0c24('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x0c24('0x3'),'unique':_0x0c24('0x4')},'mailbox':{'type':Sequelize[_0x0c24('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x0c24('0x2')]},'fullname':{'type':Sequelize[_0x0c24('0x2')]},'email':{'type':Sequelize[_0x0c24('0x2')],'validate':{'isEmail':!![]},'set':function(_0xfbd30e){this[_0x0c24('0x5')](_0x0c24('0x6'),typeof _0xfbd30e===_0x0c24('0x7')&&_0xfbd30e['trim']()?_0xfbd30e['trim']():null);}},'pager':{'type':Sequelize[_0x0c24('0x2')]},'tz':{'type':Sequelize[_0x0c24('0x2')],'defaultValue':_0x0c24('0x8')},'attach':{'type':Sequelize['ENUM'](_0x0c24('0x9'),'no'),'defaultValue':_0x0c24('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x0c24('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x0c24('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0c24('0xa')](_0x0c24('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0c24('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x0c24('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0c24('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0c24('0xa')](_0x0c24('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0c24('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0c24('0xa')](_0x0c24('0x9'),'no'),'defaultValue':_0x0c24('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x0c24('0xa')](_0x0c24('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0c24('0xa')](_0x0c24('0x9'),'no'),'defaultValue':_0x0c24('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x0c24('0x2')]},'maxsecs':{'type':Sequelize[_0x0c24('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0c24('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x0c24('0xd'))+'\x20-\x20'+this[_0x0c24('0xe')](_0x0c24('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 03bfbdd..1a941a3 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 _0x4024=['limit','count','Content-Range','apply','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','index','map','VoiceMail','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','order','pick','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x2948ba,_0x119762){var _0x39859e=function(_0x5cb1cc){while(--_0x5cb1cc){_0x2948ba['push'](_0x2948ba['shift']());}};_0x39859e(++_0x119762);}(_0x4024,0x89));var _0x4402=function(_0x2e6893,_0x2eccb1){_0x2e6893=_0x2e6893-0x0;var _0x250602=_0x4024[_0x2e6893];return _0x250602;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];function respondWithStatusCode(_0xa819e9,_0x4c9032){_0x4c9032=_0x4c9032||0xcc;return function(_0x7e4475){if(_0x7e4475){return _0xa819e9[_0x4402('0x13')](_0x4c9032);}return _0xa819e9[_0x4402('0x14')](_0x4c9032)[_0x4402('0x15')]();};}function respondWithResult(_0x248ad9,_0x31710c){_0x31710c=_0x31710c||0xc8;return function(_0x18c7a8){if(_0x18c7a8){return _0x248ad9[_0x4402('0x14')](_0x31710c)[_0x4402('0x16')](_0x18c7a8);}};}function respondWithFilteredResult(_0x263a57,_0x375166){return function(_0xc03f65){if(_0xc03f65){var _0x2a2ce8=typeof _0x375166[_0x4402('0x17')]===_0x4402('0x18')&&typeof _0x375166[_0x4402('0x19')]===_0x4402('0x18');var _0x25e88b=_0xc03f65[_0x4402('0x1a')];var _0x231382=_0x2a2ce8?0x0:_0x375166['offset'];var _0x494389=_0x2a2ce8?_0xc03f65[_0x4402('0x1a')]:_0x375166[_0x4402('0x17')]+_0x375166['limit'];var _0x756962;if(_0x494389>=_0x25e88b){_0x494389=_0x25e88b;_0x756962=0xc8;}else{_0x756962=0xce;}_0x263a57[_0x4402('0x14')](_0x756962);return _0x263a57['set'](_0x4402('0x1b'),_0x231382+'-'+_0x494389+'/'+_0x25e88b)['json'](_0xc03f65);}return null;};}function patchUpdates(_0x55cc8c){return function(_0x1b9599){try{jsonpatch[_0x4402('0x1c')](_0x1b9599,_0x55cc8c,!![]);}catch(_0x28f44b){return BPromise['reject'](_0x28f44b);}return _0x1b9599[_0x4402('0x1d')]();};}function saveUpdates(_0x57a25e,_0x47ab54){return function(_0x6f1f72){if(_0x6f1f72){return _0x6f1f72[_0x4402('0x1e')](_0x57a25e)[_0x4402('0x1f')](function(_0xc583b){return _0xc583b;});}return null;};}function removeEntity(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(_0x289a3e){return _0x289a3e[_0x4402('0x20')]()[_0x4402('0x1f')](function(){var _0x4d6846=_0x289a3e[_0x4402('0x21')]({'plain':!![]});var _0x4e1c04=_0x4402('0x22');return db[_0x4402('0x23')][_0x4402('0x20')]({'where':{'type':_0x4e1c04,'resourceId':_0x4d6846['id']}})[_0x4402('0x1f')](function(){return _0x289a3e;});})['then'](function(){_0x258d10[_0x4402('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d52f,_0x1be54d){return function(_0x395e49){if(!_0x395e49){_0x59d52f[_0x4402('0x13')](0x194);}return _0x395e49;};}function handleError(_0xabf61b,_0x3eb796){_0x3eb796=_0x3eb796||0x1f4;return function(_0x514e41){logger[_0x4402('0x24')](_0x514e41['stack']);if(_0x514e41[_0x4402('0x25')]){delete _0x514e41[_0x4402('0x25')];}_0xabf61b[_0x4402('0x14')](_0x3eb796)['send'](_0x514e41);};}exports[_0x4402('0x26')]=function(_0x6c87f6,_0x316239){var _0x3f4bcb={},_0x2526d1={},_0x605702={'count':0x0,'rows':[]};var _0x1189b8=_[_0x4402('0x27')](db[_0x4402('0x28')][_0x4402('0x29')],function(_0xcea26b){return{'name':_0xcea26b['fieldName'],'type':_0xcea26b[_0x4402('0x2a')]['key']};});_0x2526d1[_0x4402('0x2b')]=_['map'](_0x1189b8,_0x4402('0x25'));_0x2526d1[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x6c87f6[_0x4402('0x2c')]);_0x2526d1[_0x4402('0x2e')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],_0x2526d1[_0x4402('0x2c')]);_0x3f4bcb[_0x4402('0x2f')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x6c87f6['query'][_0x4402('0x30')]));_0x3f4bcb[_0x4402('0x2f')]=_0x3f4bcb[_0x4402('0x2f')][_0x4402('0x31')]?_0x3f4bcb[_0x4402('0x2f')]:_0x2526d1[_0x4402('0x2b')];if(!_0x6c87f6[_0x4402('0x2c')][_0x4402('0x32')](_0x4402('0x33'))){_0x3f4bcb['limit']=qs[_0x4402('0x19')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x19')]);_0x3f4bcb['offset']=qs[_0x4402('0x17')](_0x6c87f6[_0x4402('0x2c')]['offset']);}_0x3f4bcb['order']=qs[_0x4402('0x34')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x34')]);_0x3f4bcb[_0x4402('0x35')]=qs['filters'](_['pick'](_0x6c87f6['query'],_0x2526d1[_0x4402('0x2e')]),_0x1189b8);if(_0x6c87f6[_0x4402('0x2c')][_0x4402('0x36')]){_0x3f4bcb[_0x4402('0x35')]=_['merge'](_0x3f4bcb[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x1189b8,function(_0x35f877){if(_0x35f877['type']!==_0x4402('0x37')){var _0x5aca7b={};_0x5aca7b[_0x35f877[_0x4402('0x25')]]={'$like':'%'+_0x6c87f6[_0x4402('0x2c')]['filter']+'%'};return _0x5aca7b;}})});}_0x3f4bcb=_[_0x4402('0x38')]({},_0x3f4bcb,_0x6c87f6['options']);var _0x423628={'where':_0x3f4bcb[_0x4402('0x35')]};return db['VoiceMail'][_0x4402('0x1a')](_0x423628)[_0x4402('0x1f')](function(_0x250f09){_0x605702[_0x4402('0x1a')]=_0x250f09;if(_0x6c87f6['query']['includeAll']){_0x3f4bcb[_0x4402('0x39')]=[{'all':!![]}];}return db['VoiceMail'][_0x4402('0x3a')](_0x3f4bcb);})[_0x4402('0x1f')](function(_0xb9cf85){_0x605702[_0x4402('0x3b')]=_0xb9cf85;return _0x605702;})[_0x4402('0x1f')](respondWithFilteredResult(_0x316239,_0x3f4bcb))[_0x4402('0x3c')](handleError(_0x316239,null));};exports[_0x4402('0x3d')]=function(_0x390169,_0x1f9b3e){var _0x42812b={'raw':!![],'where':{'id':_0x390169[_0x4402('0x3e')]['id']}},_0x486e43={};_0x486e43[_0x4402('0x2b')]=_['keys'](db[_0x4402('0x28')][_0x4402('0x29')]);_0x486e43['query']=_[_0x4402('0x2d')](_0x390169[_0x4402('0x2c')]);_0x486e43[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],_0x486e43['query']);_0x42812b[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x390169[_0x4402('0x2c')][_0x4402('0x30')]));_0x42812b[_0x4402('0x2f')]=_0x42812b[_0x4402('0x2f')][_0x4402('0x31')]?_0x42812b[_0x4402('0x2f')]:_0x486e43[_0x4402('0x2b')];if(_0x390169['query'][_0x4402('0x40')]){_0x42812b['include']=[{'all':!![]}];}_0x42812b=_[_0x4402('0x38')]({},_0x42812b,_0x390169[_0x4402('0x41')]);return db['VoiceMail'][_0x4402('0x42')](_0x42812b)[_0x4402('0x1f')](handleEntityNotFound(_0x1f9b3e,null))[_0x4402('0x1f')](respondWithResult(_0x1f9b3e,null))[_0x4402('0x3c')](handleError(_0x1f9b3e,null));};exports[_0x4402('0x43')]=function(_0x2503eb,_0x5b094b){return db[_0x4402('0x28')][_0x4402('0x43')](_0x2503eb[_0x4402('0x44')],{})[_0x4402('0x1f')](function(_0x2b2ed3){var _0x24d51c=_0x2503eb[_0x4402('0x45')][_0x4402('0x21')]({'plain':!![]});if(!_0x24d51c)throw new Error(_0x4402('0x46'));if(_0x24d51c['role']==='user'){var _0x5ab12b=_0x2b2ed3['get']({'plain':!![]});var _0x257010=_0x4402('0x22');return db[_0x4402('0x47')][_0x4402('0x42')]({'where':{'name':_0x257010,'userProfileId':_0x24d51c['userProfileId']},'raw':!![]})[_0x4402('0x1f')](function(_0x12d6de){if(_0x12d6de&&_0x12d6de[_0x4402('0x48')]===0x0){return db[_0x4402('0x23')][_0x4402('0x43')]({'name':_0x5ab12b[_0x4402('0x25')],'resourceId':_0x5ab12b['id'],'type':_0x12d6de[_0x4402('0x25')],'sectionId':_0x12d6de['id']},{})['then'](function(){return _0x2b2ed3;});}else{return _0x2b2ed3;}})[_0x4402('0x3c')](function(_0x2a8085){logger[_0x4402('0x24')](_0x4402('0x49'),_0x2a8085);throw _0x2a8085;});}return _0x2b2ed3;})[_0x4402('0x1f')](respondWithResult(_0x5b094b,0xc9))[_0x4402('0x3c')](handleError(_0x5b094b,null));};exports['update']=function(_0xe8a8e9,_0x642ab4){if(_0xe8a8e9[_0x4402('0x44')]['id']){delete _0xe8a8e9[_0x4402('0x44')]['id'];}return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0xe8a8e9[_0x4402('0x3e')]['id']}})['then'](handleEntityNotFound(_0x642ab4,null))['then'](saveUpdates(_0xe8a8e9[_0x4402('0x44')],null))[_0x4402('0x1f')](respondWithResult(_0x642ab4,null))[_0x4402('0x3c')](handleError(_0x642ab4,null));};exports['destroy']=function(_0x5a076a,_0x258926){return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x5a076a[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x258926,null))[_0x4402('0x1f')](removeEntity(_0x258926,null))[_0x4402('0x3c')](handleError(_0x258926,null));};exports[_0x4402('0x4a')]=function(_0x394ac9,_0x3f2599,_0x353679){return db[_0x4402('0x28')][_0x4402('0x4b')]({'where':{'id':_0x394ac9['params']['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x3f2599,null))['then'](function(_0xe4530a){var _0x55922e;var _0x3fb9f0={},_0x1e5891={};_0x1e5891[_0x4402('0x2b')]=_[_0x4402('0x2d')](db[_0x4402('0x4c')][_0x4402('0x29')]);_0x1e5891['query']=_[_0x4402('0x2d')](_0x394ac9[_0x4402('0x2c')]);_0x1e5891[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x1e5891[_0x4402('0x2b')],_0x1e5891['query']);_0x3fb9f0[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x1e5891[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x394ac9[_0x4402('0x2c')][_0x4402('0x30')]));_0x3fb9f0[_0x4402('0x2f')]=_0x3fb9f0[_0x4402('0x2f')]['length']?_0x3fb9f0[_0x4402('0x2f')]:_0x1e5891[_0x4402('0x2b')];if(!_0x394ac9['query'][_0x4402('0x32')](_0x4402('0x33'))){_0x3fb9f0['limit']=qs['limit'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x19')]);_0x3fb9f0[_0x4402('0x17')]=qs['offset'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x17')]);}_0x3fb9f0[_0x4402('0x4d')]=qs['sort'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x34')]);_0x3fb9f0[_0x4402('0x35')]=qs['filters'](_[_0x4402('0x4e')](_0x394ac9[_0x4402('0x2c')],_0x1e5891['filters']));if(_0x394ac9['query'][_0x4402('0x36')]){_0x3fb9f0['where']=_[_0x4402('0x38')](_0x3fb9f0[_0x4402('0x35')],{'$or':_['map'](_0x3fb9f0['attributes'],function(_0x432c2e){var _0x42cdd6={};_0x42cdd6[_0x432c2e]={'$like':'%'+_0x394ac9[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x42cdd6;})});}_0x3fb9f0['where']=_[_0x4402('0x38')](_0x3fb9f0[_0x4402('0x35')],{'mailboxuser':_0xe4530a[_0x4402('0x4f')]});_0x3fb9f0=_[_0x4402('0x38')]({},_0x3fb9f0,_0x394ac9[_0x4402('0x41')]);return db[_0x4402('0x4c')][_0x4402('0x50')](_0x3fb9f0)['then'](respondWithFilteredResult(_0x3f2599,_0x3fb9f0));})[_0x4402('0x3c')](handleError(_0x3f2599,null));}; \ No newline at end of file +var _0x34b7=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','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','update','getMessages','VoiceMailMessage','nolimit','mailbox','findAndCountAll','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Voicemails','UserProfileResource','end','error','name','send','index','map','VoiceMail','fieldName','type','key','model','query','keys'];(function(_0x92a083,_0x35783f){var _0xf9718a=function(_0x486738){while(--_0x486738){_0x92a083['push'](_0x92a083['shift']());}};_0xf9718a(++_0x35783f);}(_0x34b7,0x196));var _0x734b=function(_0x1f3c56,_0x598757){_0x1f3c56=_0x1f3c56-0x0;var _0x569524=_0x34b7[_0x1f3c56];return _0x569524;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x734b('0x0'));var jsonpatch=require(_0x734b('0x1'));var rp=require(_0x734b('0x2'));var moment=require(_0x734b('0x3'));var BPromise=require(_0x734b('0x4'));var Mustache=require(_0x734b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x734b('0x6'));var csv=require(_0x734b('0x7'));var ejs=require(_0x734b('0x8'));var fs=require('fs');var fs_extra=require(_0x734b('0x9'));var _=require(_0x734b('0xa'));var squel=require(_0x734b('0xb'));var crypto=require('crypto');var jsforce=require(_0x734b('0xc'));var deskjs=require(_0x734b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x734b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x734b('0xf'));var as=require(_0x734b('0x10'));var hardwareService=require(_0x734b('0x11'));var logger=require(_0x734b('0x12'))(_0x734b('0x13'));var utils=require(_0x734b('0x14'));var config=require(_0x734b('0x15'));var licenseUtil=require(_0x734b('0x16'));var db=require(_0x734b('0x17'))['db'];function respondWithStatusCode(_0x1e0fca,_0x189a82){_0x189a82=_0x189a82||0xcc;return function(_0xff9ddf){if(_0xff9ddf){return _0x1e0fca[_0x734b('0x18')](_0x189a82);}return _0x1e0fca[_0x734b('0x19')](_0x189a82)['end']();};}function respondWithResult(_0x18fc18,_0x252510){_0x252510=_0x252510||0xc8;return function(_0x47791c){if(_0x47791c){return _0x18fc18[_0x734b('0x19')](_0x252510)[_0x734b('0x1a')](_0x47791c);}};}function respondWithFilteredResult(_0x2e00ad,_0x2372bd){return function(_0x2c03bd){if(_0x2c03bd){var _0xa6d111=typeof _0x2372bd[_0x734b('0x1b')]===_0x734b('0x1c')&&typeof _0x2372bd['limit']===_0x734b('0x1c');var _0x2ee290=_0x2c03bd[_0x734b('0x1d')];var _0x5edbe9=_0xa6d111?0x0:_0x2372bd['offset'];var _0x56a95c=_0xa6d111?_0x2c03bd[_0x734b('0x1d')]:_0x2372bd[_0x734b('0x1b')]+_0x2372bd[_0x734b('0x1e')];var _0x41ba87;if(_0x56a95c>=_0x2ee290){_0x56a95c=_0x2ee290;_0x41ba87=0xc8;}else{_0x41ba87=0xce;}_0x2e00ad[_0x734b('0x19')](_0x41ba87);return _0x2e00ad[_0x734b('0x1f')](_0x734b('0x20'),_0x5edbe9+'-'+_0x56a95c+'/'+_0x2ee290)[_0x734b('0x1a')](_0x2c03bd);}return null;};}function patchUpdates(_0x67eed){return function(_0x1d2b27){try{jsonpatch[_0x734b('0x21')](_0x1d2b27,_0x67eed,!![]);}catch(_0x3d0ffd){return BPromise[_0x734b('0x22')](_0x3d0ffd);}return _0x1d2b27[_0x734b('0x23')]();};}function saveUpdates(_0x56f807,_0x1e4dcc){return function(_0x7856d7){if(_0x7856d7){return _0x7856d7['update'](_0x56f807)[_0x734b('0x24')](function(_0x1f81de){return _0x1f81de;});}return null;};}function removeEntity(_0x1a7908,_0x11fb8e){return function(_0x46d432){if(_0x46d432){return _0x46d432[_0x734b('0x25')]()[_0x734b('0x24')](function(){var _0x104fff=_0x46d432[_0x734b('0x26')]({'plain':!![]});var _0x3abbe6=_0x734b('0x27');return db[_0x734b('0x28')][_0x734b('0x25')]({'where':{'type':_0x3abbe6,'resourceId':_0x104fff['id']}})['then'](function(){return _0x46d432;});})['then'](function(){_0x1a7908[_0x734b('0x19')](0xcc)[_0x734b('0x29')]();});}};}function handleEntityNotFound(_0x47a0a9,_0x32ea00){return function(_0x2dd51a){if(!_0x2dd51a){_0x47a0a9[_0x734b('0x18')](0x194);}return _0x2dd51a;};}function handleError(_0x41b501,_0x43edea){_0x43edea=_0x43edea||0x1f4;return function(_0x1b8295){logger[_0x734b('0x2a')](_0x1b8295['stack']);if(_0x1b8295[_0x734b('0x2b')]){delete _0x1b8295[_0x734b('0x2b')];}_0x41b501[_0x734b('0x19')](_0x43edea)[_0x734b('0x2c')](_0x1b8295);};}exports[_0x734b('0x2d')]=function(_0x427c36,_0x1fed72){var _0x21ed3c={},_0x371ead={},_0x3065b0={'count':0x0,'rows':[]};var _0x5dcabf=_[_0x734b('0x2e')](db[_0x734b('0x2f')]['rawAttributes'],function(_0xbbe037){return{'name':_0xbbe037[_0x734b('0x30')],'type':_0xbbe037[_0x734b('0x31')][_0x734b('0x32')]};});_0x371ead[_0x734b('0x33')]=_[_0x734b('0x2e')](_0x5dcabf,_0x734b('0x2b'));_0x371ead[_0x734b('0x34')]=_[_0x734b('0x35')](_0x427c36[_0x734b('0x34')]);_0x371ead[_0x734b('0x36')]=_[_0x734b('0x37')](_0x371ead[_0x734b('0x33')],_0x371ead[_0x734b('0x34')]);_0x21ed3c[_0x734b('0x38')]=_['intersection'](_0x371ead[_0x734b('0x33')],qs['fields'](_0x427c36[_0x734b('0x34')][_0x734b('0x39')]));_0x21ed3c[_0x734b('0x38')]=_0x21ed3c[_0x734b('0x38')][_0x734b('0x3a')]?_0x21ed3c[_0x734b('0x38')]:_0x371ead['model'];if(!_0x427c36['query'][_0x734b('0x3b')]('nolimit')){_0x21ed3c[_0x734b('0x1e')]=qs['limit'](_0x427c36[_0x734b('0x34')]['limit']);_0x21ed3c[_0x734b('0x1b')]=qs['offset'](_0x427c36[_0x734b('0x34')][_0x734b('0x1b')]);}_0x21ed3c[_0x734b('0x3c')]=qs[_0x734b('0x3d')](_0x427c36[_0x734b('0x34')][_0x734b('0x3d')]);_0x21ed3c[_0x734b('0x3e')]=qs['filters'](_[_0x734b('0x3f')](_0x427c36[_0x734b('0x34')],_0x371ead['filters']),_0x5dcabf);if(_0x427c36[_0x734b('0x34')][_0x734b('0x40')]){_0x21ed3c[_0x734b('0x3e')]=_[_0x734b('0x41')](_0x21ed3c['where'],{'$or':_[_0x734b('0x2e')](_0x5dcabf,function(_0x352d28){if(_0x352d28['type']!==_0x734b('0x42')){var _0x1e1689={};_0x1e1689[_0x352d28['name']]={'$like':'%'+_0x427c36[_0x734b('0x34')][_0x734b('0x40')]+'%'};return _0x1e1689;}})});}_0x21ed3c=_[_0x734b('0x41')]({},_0x21ed3c,_0x427c36[_0x734b('0x43')]);var _0x56eb35={'where':_0x21ed3c['where']};return db[_0x734b('0x2f')]['count'](_0x56eb35)['then'](function(_0x121a00){_0x3065b0['count']=_0x121a00;if(_0x427c36[_0x734b('0x34')]['includeAll']){_0x21ed3c[_0x734b('0x44')]=[{'all':!![]}];}return db[_0x734b('0x2f')][_0x734b('0x45')](_0x21ed3c);})['then'](function(_0x5cf3a0){_0x3065b0[_0x734b('0x46')]=_0x5cf3a0;return _0x3065b0;})['then'](respondWithFilteredResult(_0x1fed72,_0x21ed3c))['catch'](handleError(_0x1fed72,null));};exports[_0x734b('0x47')]=function(_0x159db9,_0x58f78a){var _0x2e789e={'raw':!![],'where':{'id':_0x159db9[_0x734b('0x48')]['id']}},_0x513f07={};_0x513f07[_0x734b('0x33')]=_[_0x734b('0x35')](db['VoiceMail'][_0x734b('0x49')]);_0x513f07[_0x734b('0x34')]=_[_0x734b('0x35')](_0x159db9[_0x734b('0x34')]);_0x513f07['filters']=_['intersection'](_0x513f07['model'],_0x513f07[_0x734b('0x34')]);_0x2e789e['attributes']=_['intersection'](_0x513f07[_0x734b('0x33')],qs['fields'](_0x159db9[_0x734b('0x34')][_0x734b('0x39')]));_0x2e789e[_0x734b('0x38')]=_0x2e789e[_0x734b('0x38')]['length']?_0x2e789e[_0x734b('0x38')]:_0x513f07['model'];if(_0x159db9[_0x734b('0x34')][_0x734b('0x4a')]){_0x2e789e[_0x734b('0x44')]=[{'all':!![]}];}_0x2e789e=_['merge']({},_0x2e789e,_0x159db9[_0x734b('0x43')]);return db['VoiceMail'][_0x734b('0x4b')](_0x2e789e)[_0x734b('0x24')](handleEntityNotFound(_0x58f78a,null))['then'](respondWithResult(_0x58f78a,null))[_0x734b('0x4c')](handleError(_0x58f78a,null));};exports[_0x734b('0x4d')]=function(_0x145ced,_0x38125a){return db[_0x734b('0x2f')]['create'](_0x145ced[_0x734b('0x4e')],{})['then'](function(_0x171575){var _0x5de7b7=_0x145ced[_0x734b('0x4f')][_0x734b('0x26')]({'plain':!![]});if(!_0x5de7b7)throw new Error(_0x734b('0x50'));if(_0x5de7b7[_0x734b('0x51')]===_0x734b('0x4f')){var _0x4b70f2=_0x171575['get']({'plain':!![]});var _0x484156=_0x734b('0x27');return db[_0x734b('0x52')]['find']({'where':{'name':_0x484156,'userProfileId':_0x5de7b7[_0x734b('0x53')]},'raw':!![]})[_0x734b('0x24')](function(_0x588ceb){if(_0x588ceb&&_0x588ceb[_0x734b('0x54')]===0x0){return db[_0x734b('0x28')][_0x734b('0x4d')]({'name':_0x4b70f2['name'],'resourceId':_0x4b70f2['id'],'type':_0x588ceb[_0x734b('0x2b')],'sectionId':_0x588ceb['id']},{})[_0x734b('0x24')](function(){return _0x171575;});}else{return _0x171575;}})[_0x734b('0x4c')](function(_0xe605be){logger['error'](_0x734b('0x55'),_0xe605be);throw _0xe605be;});}return _0x171575;})[_0x734b('0x24')](respondWithResult(_0x38125a,0xc9))[_0x734b('0x4c')](handleError(_0x38125a,null));};exports[_0x734b('0x56')]=function(_0x4b65bf,_0x27f0ff){if(_0x4b65bf['body']['id']){delete _0x4b65bf[_0x734b('0x4e')]['id'];}return db[_0x734b('0x2f')][_0x734b('0x4b')]({'where':{'id':_0x4b65bf[_0x734b('0x48')]['id']}})['then'](handleEntityNotFound(_0x27f0ff,null))[_0x734b('0x24')](saveUpdates(_0x4b65bf[_0x734b('0x4e')],null))['then'](respondWithResult(_0x27f0ff,null))['catch'](handleError(_0x27f0ff,null));};exports[_0x734b('0x25')]=function(_0x577735,_0x16b461){return db[_0x734b('0x2f')][_0x734b('0x4b')]({'where':{'id':_0x577735['params']['id']}})[_0x734b('0x24')](handleEntityNotFound(_0x16b461,null))['then'](removeEntity(_0x16b461,null))[_0x734b('0x4c')](handleError(_0x16b461,null));};exports[_0x734b('0x57')]=function(_0x3c3359,_0x10660d,_0x49a43b){return db[_0x734b('0x2f')]['findOne']({'where':{'id':_0x3c3359[_0x734b('0x48')]['id']}})[_0x734b('0x24')](handleEntityNotFound(_0x10660d,null))[_0x734b('0x24')](function(_0x59b7d8){var _0x18e187;var _0x55c699={},_0x2c81a1={};_0x2c81a1[_0x734b('0x33')]=_[_0x734b('0x35')](db[_0x734b('0x58')]['rawAttributes']);_0x2c81a1[_0x734b('0x34')]=_['keys'](_0x3c3359[_0x734b('0x34')]);_0x2c81a1[_0x734b('0x36')]=_[_0x734b('0x37')](_0x2c81a1['model'],_0x2c81a1[_0x734b('0x34')]);_0x55c699[_0x734b('0x38')]=_[_0x734b('0x37')](_0x2c81a1[_0x734b('0x33')],qs[_0x734b('0x39')](_0x3c3359[_0x734b('0x34')][_0x734b('0x39')]));_0x55c699['attributes']=_0x55c699[_0x734b('0x38')][_0x734b('0x3a')]?_0x55c699[_0x734b('0x38')]:_0x2c81a1['model'];if(!_0x3c3359['query'][_0x734b('0x3b')](_0x734b('0x59'))){_0x55c699[_0x734b('0x1e')]=qs[_0x734b('0x1e')](_0x3c3359['query']['limit']);_0x55c699['offset']=qs[_0x734b('0x1b')](_0x3c3359[_0x734b('0x34')][_0x734b('0x1b')]);}_0x55c699[_0x734b('0x3c')]=qs[_0x734b('0x3d')](_0x3c3359[_0x734b('0x34')][_0x734b('0x3d')]);_0x55c699[_0x734b('0x3e')]=qs[_0x734b('0x36')](_[_0x734b('0x3f')](_0x3c3359[_0x734b('0x34')],_0x2c81a1[_0x734b('0x36')]));if(_0x3c3359[_0x734b('0x34')][_0x734b('0x40')]){_0x55c699[_0x734b('0x3e')]=_[_0x734b('0x41')](_0x55c699[_0x734b('0x3e')],{'$or':_[_0x734b('0x2e')](_0x55c699[_0x734b('0x38')],function(_0x39d4e7){var _0x379a33={};_0x379a33[_0x39d4e7]={'$like':'%'+_0x3c3359['query'][_0x734b('0x40')]+'%'};return _0x379a33;})});}_0x55c699[_0x734b('0x3e')]=_[_0x734b('0x41')](_0x55c699[_0x734b('0x3e')],{'mailboxuser':_0x59b7d8[_0x734b('0x5a')]});_0x55c699=_['merge']({},_0x55c699,_0x3c3359[_0x734b('0x43')]);return db[_0x734b('0x58')][_0x734b('0x5b')](_0x55c699)[_0x734b('0x24')](respondWithFilteredResult(_0x10660d,_0x55c699));})[_0x734b('0x4c')](handleError(_0x10660d,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 4165f4d..9f0d03c 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 _0xbcdd=['rimraf','./voiceMail.attributes','exports','voice_voicemail','mailbox_context','mailbox','lodash','bluebird','request-promise','path'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xbcdd,0xec));var _0xdbcd=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0xbcdd[_0x4a93bb];return _0x208468;};'use strict';var _=require(_0xdbcd('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xdbcd('0x1'));var rp=require(_0xdbcd('0x2'));var fs=require('fs');var path=require(_0xdbcd('0x3'));var rimraf=require(_0xdbcd('0x4'));var config=require('../../config/environment');var attributes=require(_0xdbcd('0x5'));module[_0xdbcd('0x6')]=function(_0x57d708,_0x33d480){return _0x57d708['define']('VoiceMail',attributes,{'tableName':_0xdbcd('0x7'),'paranoid':![],'indexes':[{'name':_0xdbcd('0x8'),'fields':[_0xdbcd('0x9'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3a06=['./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','context','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x99900a,_0x5ab0b6){var _0x1666eb=function(_0x2fe650){while(--_0x2fe650){_0x99900a['push'](_0x99900a['shift']());}};_0x1666eb(++_0x5ab0b6);}(_0x3a06,0x180));var _0x63a0=function(_0x31e76a,_0x51bc97){_0x31e76a=_0x31e76a-0x0;var _0x5488ec=_0x3a06[_0x31e76a];return _0x5488ec;};'use strict';var _=require(_0x63a0('0x0'));var util=require(_0x63a0('0x1'));var logger=require(_0x63a0('0x2'))(_0x63a0('0x3'));var moment=require(_0x63a0('0x4'));var BPromise=require(_0x63a0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x63a0('0x6'));var config=require(_0x63a0('0x7'));var attributes=require(_0x63a0('0x8'));module[_0x63a0('0x9')]=function(_0x53e290,_0x5815a1){return _0x53e290[_0x63a0('0xa')](_0x63a0('0xb'),attributes,{'tableName':_0x63a0('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0x63a0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 5ef9694..9282c69 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 _0xa08e=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','moment','bluebird','randomstring'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa08e,0x18b));var _0xea08=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0xa08e[_0x214266];return _0x568f75;};'use strict';var _=require(_0xea08('0x0'));var util=require('util');var moment=require(_0xea08('0x1'));var BPromise=require(_0xea08('0x2'));var rs=require(_0xea08('0x3'));var fs=require('fs');var Redis=require(_0xea08('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea08('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xea08('0x6'));var jayson=require(_0xea08('0x7'));var client=jayson[_0xea08('0x8')][_0xea08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe63c79,_0x2582bd,_0x188b19){return new BPromise(function(_0x368d10,_0x432f78){return client[_0xea08('0xa')](_0xe63c79,_0x188b19)[_0xea08('0xb')](function(_0x5a4daa){logger[_0xea08('0xc')](_0xea08('0xd'),_0x2582bd,'request\x20sent');logger[_0xea08('0xe')](_0xea08('0xf'),_0x2582bd,'request\x20sent',JSON['stringify'](_0x5a4daa));if(_0x5a4daa[_0xea08('0x10')]){if(_0x5a4daa['error'][_0xea08('0x11')]===0x1f4){logger[_0xea08('0x10')](_0xea08('0xd'),_0x2582bd,_0x5a4daa[_0xea08('0x10')][_0xea08('0x12')]);return _0x432f78(_0x5a4daa[_0xea08('0x10')][_0xea08('0x12')]);}logger[_0xea08('0x10')](_0xea08('0xd'),_0x2582bd,_0x5a4daa[_0xea08('0x10')][_0xea08('0x12')]);return _0x368d10(_0x5a4daa[_0xea08('0x10')][_0xea08('0x12')]);}else{logger[_0xea08('0xc')](_0xea08('0xd'),_0x2582bd,_0xea08('0x13'));_0x368d10(_0x5a4daa['result'][_0xea08('0x12')]);}})[_0xea08('0x14')](function(_0x588768){logger[_0xea08('0x10')](_0xea08('0xd'),_0x2582bd,_0x588768);_0x432f78(_0x588768);});});} \ No newline at end of file +var _0xe5b8=['error','code','message','VoiceMail,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x185305,_0x183729){var _0x36bf36=function(_0x596a2c){while(--_0x596a2c){_0x185305['push'](_0x185305['shift']());}};_0x36bf36(++_0x183729);}(_0xe5b8,0x103));var _0x8e5b=function(_0x4883ec,_0x15cbcd){_0x4883ec=_0x4883ec-0x0;var _0x4bb8ac=_0xe5b8[_0x4883ec];return _0x4bb8ac;};'use strict';var _=require(_0x8e5b('0x0'));var util=require(_0x8e5b('0x1'));var moment=require('moment');var BPromise=require(_0x8e5b('0x2'));var rs=require(_0x8e5b('0x3'));var fs=require('fs');var Redis=require(_0x8e5b('0x4'));var db=require(_0x8e5b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e5b('0x6'))(_0x8e5b('0x7'));var config=require(_0x8e5b('0x8'));var jayson=require(_0x8e5b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x55e48f,_0x5a0383,_0x3ebd1f){return new BPromise(function(_0x43183d,_0x7c8c0b){return client[_0x8e5b('0xa')](_0x55e48f,_0x3ebd1f)[_0x8e5b('0xb')](function(_0x499405){logger[_0x8e5b('0xc')]('VoiceMail,\x20%s,\x20%s',_0x5a0383,_0x8e5b('0xd'));logger[_0x8e5b('0xe')](_0x8e5b('0xf'),_0x5a0383,_0x8e5b('0xd'),JSON[_0x8e5b('0x10')](_0x499405));if(_0x499405[_0x8e5b('0x11')]){if(_0x499405[_0x8e5b('0x11')][_0x8e5b('0x12')]===0x1f4){logger[_0x8e5b('0x11')]('VoiceMail,\x20%s,\x20%s',_0x5a0383,_0x499405[_0x8e5b('0x11')][_0x8e5b('0x13')]);return _0x7c8c0b(_0x499405[_0x8e5b('0x11')]['message']);}logger[_0x8e5b('0x11')]('VoiceMail,\x20%s,\x20%s',_0x5a0383,_0x499405[_0x8e5b('0x11')][_0x8e5b('0x13')]);return _0x43183d(_0x499405[_0x8e5b('0x11')][_0x8e5b('0x13')]);}else{logger[_0x8e5b('0xc')](_0x8e5b('0x14'),_0x5a0383,_0x8e5b('0xd'));_0x43183d(_0x499405[_0x8e5b('0x15')]['message']);}})[_0x8e5b('0x16')](function(_0xbbb0f7){logger[_0x8e5b('0x11')](_0x8e5b('0x14'),_0x5a0383,_0xbbb0f7);_0x7c8c0b(_0xbbb0f7);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 3f75202..1583a96 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 _0xd77b=['util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1c4039,_0x474897){var _0x3e8cf2=function(_0x45cfca){while(--_0x45cfca){_0x1c4039['push'](_0x1c4039['shift']());}};_0x3e8cf2(++_0x474897);}(_0xd77b,0xb4));var _0xbd77=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd77b[_0x42cae2];return _0x5f256f;};'use strict';var multer=require('multer');var util=require(_0xbd77('0x0'));var path=require(_0xbd77('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd77('0x2'));var router=express['Router']();var fs_extra=require(_0xbd77('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xbd77('0x4'));var config=require(_0xbd77('0x5'));var controller=require(_0xbd77('0x6'));router[_0xbd77('0x7')]('/',auth[_0xbd77('0x8')](),controller['index']);router[_0xbd77('0x7')](_0xbd77('0x9'),auth[_0xbd77('0x8')](),controller[_0xbd77('0xa')]);router[_0xbd77('0x7')]('/:id/download',auth[_0xbd77('0x8')](),controller['download']);router[_0xbd77('0xb')]('/',auth['isAuthenticated'](),controller[_0xbd77('0xc')]);router[_0xbd77('0xd')](_0xbd77('0x9'),auth[_0xbd77('0x8')](),controller[_0xbd77('0xe')]);router[_0xbd77('0xf')]('/:id',auth[_0xbd77('0x8')](),controller[_0xbd77('0x10')]);module[_0xbd77('0x11')]=router; \ No newline at end of file +var _0x064b=['express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','post','create','delete','destroy','multer','path','connect-timeout'];(function(_0xf6c3e9,_0x608df7){var _0x4de0a0=function(_0x47654e){while(--_0x47654e){_0xf6c3e9['push'](_0xf6c3e9['shift']());}};_0x4de0a0(++_0x608df7);}(_0x064b,0x6d));var _0xb064=function(_0x1340c7,_0x5ba427){_0x1340c7=_0x1340c7-0x0;var _0x153758=_0x064b[_0x1340c7];return _0x153758;};'use strict';var multer=require(_0xb064('0x0'));var util=require('util');var path=require(_0xb064('0x1'));var timeout=require(_0xb064('0x2'));var express=require(_0xb064('0x3'));var router=express[_0xb064('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb064('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb064('0x6'));var controller=require('./voiceMailMessage.controller');router[_0xb064('0x7')]('/',auth[_0xb064('0x8')](),controller[_0xb064('0x9')]);router[_0xb064('0x7')](_0xb064('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xb064('0x7')](_0xb064('0xb'),auth[_0xb064('0x8')](),controller['download']);router[_0xb064('0xc')]('/',auth[_0xb064('0x8')](),controller[_0xb064('0xd')]);router['put'](_0xb064('0xa'),auth[_0xb064('0x8')](),controller['update']);router[_0xb064('0xe')](_0xb064('0xa'),auth['isAuthenticated'](),controller[_0xb064('0xf')]);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 95ffd91..25cab96 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 _0x82ca=['exports','VIRTUAL','INTEGER','STRING','BLOB','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x82ca,0x87));var _0xa82c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x82ca[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xa82c('0x0'));module[_0xa82c('0x1')]={'name':{'type':Sequelize[_0xa82c('0x2')],'get':function(_0x5bcb66){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xa82c('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xa82c('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xa82c('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xa82c('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xa82c('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xa82c('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xa82c('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xa82c('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xa82c('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xa82c('0x6')](_0xa82c('0x7'))}}; \ No newline at end of file +var _0xa34c=['sequelize','VIRTUAL','getDataValue','INTEGER','STRING','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x3b88f5,_0x5d2c77){var _0x35c1e4=function(_0x5f2d4e){while(--_0x5f2d4e){_0x3b88f5['push'](_0x3b88f5['shift']());}};_0x35c1e4(++_0x5d2c77);}(_0xa34c,0x1b8));var _0xca34=function(_0x171769,_0x2457fa){_0x171769=_0x171769-0x0;var _0x23fae8=_0xa34c[_0x171769];return _0x23fae8;};'use strict';var Sequelize=require(_0xca34('0x0'));module['exports']={'name':{'type':Sequelize[_0xca34('0x1')],'get':function(_0x29dbb7){return this[_0xca34('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xca34('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xca34('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xca34('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xca34('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xca34('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xca34('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xca34('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xca34('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xca34('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xca34('0x4')],'defaultValue':''},'stamp':{'type':_0xca34('0x5'),'defaultValue':Sequelize[_0xca34('0x6')](_0xca34('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 495cdee..0e23179 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 _0x895b=['find','destroy','download','msg_id','recording','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','update','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','include','VoiceMailMessage','findAll','rows','params','catch','create','body'];(function(_0x557e20,_0x22849c){var _0x22abef=function(_0x26ffa6){while(--_0x26ffa6){_0x557e20['push'](_0x557e20['shift']());}};_0x22abef(++_0x22849c);}(_0x895b,0x106));var _0xb895=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x895b[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xb895('0x0'));var rimraf=require(_0xb895('0x1'));var zipdir=require(_0xb895('0x2'));var jsonpatch=require(_0xb895('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb895('0x4'));var Mustache=require('mustache');var util=require(_0xb895('0x5'));var path=require(_0xb895('0x6'));var sox=require(_0xb895('0x7'));var csv=require('to-csv');var ejs=require(_0xb895('0x8'));var fs=require('fs');var fs_extra=require(_0xb895('0x9'));var _=require('lodash');var squel=require(_0xb895('0xa'));var crypto=require(_0xb895('0xb'));var jsforce=require(_0xb895('0xc'));var deskjs=require(_0xb895('0xd'));var toCsv=require(_0xb895('0xe'));var querystring=require(_0xb895('0xf'));var Papa=require(_0xb895('0x10'));var Redis=require(_0xb895('0x11'));var authService=require(_0xb895('0x12'));var qs=require(_0xb895('0x13'));var as=require(_0xb895('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb895('0x15'))(_0xb895('0x16'));var utils=require(_0xb895('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb895('0x18'));var db=require(_0xb895('0x19'))['db'];function respondWithStatusCode(_0x45c411,_0x30b046){_0x30b046=_0x30b046||0xcc;return function(_0x39573b){if(_0x39573b){return _0x45c411[_0xb895('0x1a')](_0x30b046);}return _0x45c411[_0xb895('0x1b')](_0x30b046)['end']();};}function respondWithResult(_0x3362be,_0x3a5970){_0x3a5970=_0x3a5970||0xc8;return function(_0x3968c5){if(_0x3968c5){return _0x3362be[_0xb895('0x1b')](_0x3a5970)['json'](_0x3968c5);}};}function respondWithFilteredResult(_0x43f9db,_0x359e32){return function(_0x4531d1){if(_0x4531d1){var _0x1d557d=typeof _0x359e32['offset']===_0xb895('0x1c')&&typeof _0x359e32[_0xb895('0x1d')]==='undefined';var _0x1365fb=_0x4531d1['count'];var _0x468106=_0x1d557d?0x0:_0x359e32[_0xb895('0x1e')];var _0x4eeee1=_0x1d557d?_0x4531d1[_0xb895('0x1f')]:_0x359e32[_0xb895('0x1e')]+_0x359e32[_0xb895('0x1d')];var _0x575267;if(_0x4eeee1>=_0x1365fb){_0x4eeee1=_0x1365fb;_0x575267=0xc8;}else{_0x575267=0xce;}_0x43f9db[_0xb895('0x1b')](_0x575267);return _0x43f9db[_0xb895('0x20')](_0xb895('0x21'),_0x468106+'-'+_0x4eeee1+'/'+_0x1365fb)[_0xb895('0x22')](_0x4531d1);}return null;};}function patchUpdates(_0x5edbcf){return function(_0x5bb9a1){try{jsonpatch[_0xb895('0x23')](_0x5bb9a1,_0x5edbcf,!![]);}catch(_0x436305){return BPromise[_0xb895('0x24')](_0x436305);}return _0x5bb9a1['save']();};}function saveUpdates(_0x4aa0de,_0x50e4cc){return function(_0x4c00c7){if(_0x4c00c7){return _0x4c00c7[_0xb895('0x25')](_0x4aa0de)[_0xb895('0x26')](function(_0x6a85e2){return _0x6a85e2;});}return null;};}function removeEntity(_0x372427,_0x2b990e){return function(_0x11628c){if(_0x11628c){return _0x11628c['destroy']()[_0xb895('0x26')](function(){_0x372427[_0xb895('0x1b')](0xcc)[_0xb895('0x27')]();});}};}function handleEntityNotFound(_0x5ccf81,_0x297085){return function(_0x439237){if(!_0x439237){_0x5ccf81[_0xb895('0x1a')](0x194);}return _0x439237;};}function handleError(_0xbe8478,_0x5180d8){_0x5180d8=_0x5180d8||0x1f4;return function(_0x15ed96){logger[_0xb895('0x28')](_0x15ed96[_0xb895('0x29')]);if(_0x15ed96[_0xb895('0x2a')]){delete _0x15ed96[_0xb895('0x2a')];}_0xbe8478[_0xb895('0x1b')](_0x5180d8)[_0xb895('0x2b')](_0x15ed96);};}exports[_0xb895('0x2c')]=function(_0x16afb3,_0x2f9a60){var _0x256c3b={},_0x3e8321={},_0x50d20f={'count':0x0,'rows':[]};var _0x1a2901=_[_0xb895('0x2d')](db['VoiceMailMessage'][_0xb895('0x2e')],function(_0x301cc7){return{'name':_0x301cc7[_0xb895('0x2f')],'type':_0x301cc7[_0xb895('0x30')][_0xb895('0x31')]};});_0x3e8321[_0xb895('0x32')]=_[_0xb895('0x33')](_[_0xb895('0x2d')](_0x1a2901,_0xb895('0x2a')),[_0xb895('0x2a')]);_0x3e8321[_0xb895('0x34')]=_[_0xb895('0x35')](_0x16afb3[_0xb895('0x34')]);_0x3e8321[_0xb895('0x36')]=_['intersection'](_0x3e8321[_0xb895('0x32')],_0x3e8321[_0xb895('0x34')]);_0x256c3b[_0xb895('0x37')]=_[_0xb895('0x38')](_0x3e8321[_0xb895('0x32')],qs[_0xb895('0x39')](_0x16afb3[_0xb895('0x34')][_0xb895('0x39')]));_0x256c3b['attributes']=_0x256c3b[_0xb895('0x37')][_0xb895('0x3a')]?_0x256c3b[_0xb895('0x37')]:_0x3e8321[_0xb895('0x32')];if(!_0x16afb3[_0xb895('0x34')][_0xb895('0x3b')](_0xb895('0x3c'))){_0x256c3b['limit']=qs[_0xb895('0x1d')](_0x16afb3[_0xb895('0x34')][_0xb895('0x1d')]);_0x256c3b[_0xb895('0x1e')]=qs[_0xb895('0x1e')](_0x16afb3[_0xb895('0x34')][_0xb895('0x1e')]);}_0x256c3b['order']=qs[_0xb895('0x3d')](_0x16afb3['query'][_0xb895('0x3d')]);_0x256c3b[_0xb895('0x3e')]=qs[_0xb895('0x36')](_[_0xb895('0x3f')](_0x16afb3['query'],_0x3e8321[_0xb895('0x36')]),_0x1a2901);if(_0x16afb3[_0xb895('0x34')]['filter']){_0x256c3b[_0xb895('0x3e')]=_[_0xb895('0x40')](_0x256c3b[_0xb895('0x3e')],{'$or':_[_0xb895('0x2d')](_0x1a2901,function(_0x2b384f){if(_0x2b384f[_0xb895('0x30')]!=='VIRTUAL'){var _0x42ee2a={};_0x42ee2a[_0x2b384f[_0xb895('0x2a')]]={'$like':'%'+_0x16afb3[_0xb895('0x34')]['filter']+'%'};return _0x42ee2a;}})});}_0x256c3b=_[_0xb895('0x40')]({},_0x256c3b,_0x16afb3[_0xb895('0x41')]);var _0x80293e={'where':_0x256c3b[_0xb895('0x3e')]};return db['VoiceMailMessage'][_0xb895('0x1f')](_0x80293e)[_0xb895('0x26')](function(_0x3d9fee){_0x50d20f[_0xb895('0x1f')]=_0x3d9fee;if(_0x16afb3[_0xb895('0x34')]['includeAll']){_0x256c3b[_0xb895('0x42')]=[{'all':!![]}];}return db[_0xb895('0x43')][_0xb895('0x44')](_0x256c3b);})['then'](function(_0xcb31fb){_0x50d20f[_0xb895('0x45')]=_0xcb31fb;return _0x50d20f;})[_0xb895('0x26')](respondWithFilteredResult(_0x2f9a60,_0x256c3b))['catch'](handleError(_0x2f9a60,null));};exports['show']=function(_0x5507b0,_0x48bbf1){var _0x24d05c={'raw':!![],'where':{'id':_0x5507b0[_0xb895('0x46')]['id']}},_0x224927={};_0x224927[_0xb895('0x32')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x224927[_0xb895('0x34')]=_['keys'](_0x5507b0[_0xb895('0x34')]);_0x224927['filters']=_[_0xb895('0x38')](_0x224927['model'],_0x224927[_0xb895('0x34')]);_0x24d05c['attributes']=_['intersection'](_0x224927[_0xb895('0x32')],qs['fields'](_0x5507b0['query'][_0xb895('0x39')]));_0x24d05c[_0xb895('0x37')]=_0x24d05c[_0xb895('0x37')]['length']?_0x24d05c[_0xb895('0x37')]:_0x224927[_0xb895('0x32')];if(_0x5507b0['query']['includeAll']){_0x24d05c[_0xb895('0x42')]=[{'all':!![]}];}_0x24d05c=_[_0xb895('0x40')]({},_0x24d05c,_0x5507b0[_0xb895('0x41')]);return db[_0xb895('0x43')]['find'](_0x24d05c)[_0xb895('0x26')](handleEntityNotFound(_0x48bbf1,null))[_0xb895('0x26')](respondWithResult(_0x48bbf1,null))[_0xb895('0x47')](handleError(_0x48bbf1,null));};exports[_0xb895('0x48')]=function(_0x34a5b3,_0x48cf8c){return db[_0xb895('0x43')][_0xb895('0x48')](_0x34a5b3[_0xb895('0x49')],{})[_0xb895('0x26')](respondWithResult(_0x48cf8c,0xc9))[_0xb895('0x47')](handleError(_0x48cf8c,null));};exports[_0xb895('0x25')]=function(_0x261bff,_0x1fbe23){if(_0x261bff['body']['id']){delete _0x261bff[_0xb895('0x49')]['id'];}return db['VoiceMailMessage'][_0xb895('0x4a')]({'where':{'id':_0x261bff[_0xb895('0x46')]['id']}})['then'](handleEntityNotFound(_0x1fbe23,null))[_0xb895('0x26')](saveUpdates(_0x261bff['body'],null))[_0xb895('0x26')](respondWithResult(_0x1fbe23,null))[_0xb895('0x47')](handleError(_0x1fbe23,null));};exports[_0xb895('0x4b')]=function(_0x346f8f,_0x5e5624){return db[_0xb895('0x43')][_0xb895('0x4a')]({'where':{'id':_0x346f8f[_0xb895('0x46')]['id']}})[_0xb895('0x26')](handleEntityNotFound(_0x5e5624,null))['then'](removeEntity(_0x5e5624,null))['catch'](handleError(_0x5e5624,null));};exports[_0xb895('0x4c')]=function(_0x14ef72,_0x292135,_0x390500){return db['VoiceMailMessage']['find']({'where':{'id':_0x14ef72[_0xb895('0x46')]['id']},'attributes':['id','recording',_0xb895('0x4d')]})[_0xb895('0x26')](handleEntityNotFound(_0x292135,null))[_0xb895('0x26')](function(_0x10afef){if(_0x10afef){if(!_0x10afef[_0xb895('0x4e')]){throw new db['Sequelize'][(_0xb895('0x4f'))](_0xb895('0x50'));}var _0x1558d6={'Content-Type':'audio/wav','Content-Disposition':_0xb895('0x51')};if(_0x10afef['msg_id']){_0x1558d6[_0xb895('0x52')]=_0xb895('0x53')+_0x10afef[_0xb895('0x4d')]+'.wav\x22';}_0x292135[_0xb895('0x20')](_0x1558d6);return _0x292135[_0xb895('0x2b')](new Buffer(_0x10afef[_0xb895('0x4e')]));}})[_0xb895('0x47')](handleError(_0x292135,null));}; \ No newline at end of file +var _0x5bac=['set','apply','reject','save','destroy','error','stack','name','send','index','map','VoiceMailMessage','fieldName','type','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','then','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','catch','create','body','update','download','recording','Sequelize','VoiceMailMessage\x20not\x20found','attachment','msg_id','Content-Disposition','.wav\x22','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count'];(function(_0x5607bf,_0x7e20f6){var _0x5a3b04=function(_0x1c4938){while(--_0x1c4938){_0x5607bf['push'](_0x5607bf['shift']());}};_0x5a3b04(++_0x7e20f6);}(_0x5bac,0x134));var _0xc5ba=function(_0x475126,_0x18c947){_0x475126=_0x475126-0x0;var _0x23d536=_0x5bac[_0x475126];return _0x23d536;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5ba('0x0'));var zipdir=require(_0xc5ba('0x1'));var jsonpatch=require(_0xc5ba('0x2'));var rp=require(_0xc5ba('0x3'));var moment=require(_0xc5ba('0x4'));var BPromise=require(_0xc5ba('0x5'));var Mustache=require('mustache');var util=require(_0xc5ba('0x6'));var path=require(_0xc5ba('0x7'));var sox=require(_0xc5ba('0x8'));var csv=require(_0xc5ba('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5ba('0xa'));var _=require(_0xc5ba('0xb'));var squel=require(_0xc5ba('0xc'));var crypto=require(_0xc5ba('0xd'));var jsforce=require(_0xc5ba('0xe'));var deskjs=require(_0xc5ba('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc5ba('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc5ba('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc5ba('0x12'))(_0xc5ba('0x13'));var utils=require(_0xc5ba('0x14'));var config=require(_0xc5ba('0x15'));var licenseUtil=require(_0xc5ba('0x16'));var db=require(_0xc5ba('0x17'))['db'];function respondWithStatusCode(_0x3148a1,_0x3215dd){_0x3215dd=_0x3215dd||0xcc;return function(_0x5e993d){if(_0x5e993d){return _0x3148a1[_0xc5ba('0x18')](_0x3215dd);}return _0x3148a1['status'](_0x3215dd)[_0xc5ba('0x19')]();};}function respondWithResult(_0x16d16d,_0x567a46){_0x567a46=_0x567a46||0xc8;return function(_0xb7ff3f){if(_0xb7ff3f){return _0x16d16d[_0xc5ba('0x1a')](_0x567a46)[_0xc5ba('0x1b')](_0xb7ff3f);}};}function respondWithFilteredResult(_0x1e6128,_0x1f6d09){return function(_0x5db9a4){if(_0x5db9a4){var _0x2959a6=typeof _0x1f6d09[_0xc5ba('0x1c')]===_0xc5ba('0x1d')&&typeof _0x1f6d09[_0xc5ba('0x1e')]===_0xc5ba('0x1d');var _0x3c5a3a=_0x5db9a4[_0xc5ba('0x1f')];var _0x49a507=_0x2959a6?0x0:_0x1f6d09[_0xc5ba('0x1c')];var _0x385cac=_0x2959a6?_0x5db9a4[_0xc5ba('0x1f')]:_0x1f6d09[_0xc5ba('0x1c')]+_0x1f6d09[_0xc5ba('0x1e')];var _0x38e7f9;if(_0x385cac>=_0x3c5a3a){_0x385cac=_0x3c5a3a;_0x38e7f9=0xc8;}else{_0x38e7f9=0xce;}_0x1e6128[_0xc5ba('0x1a')](_0x38e7f9);return _0x1e6128[_0xc5ba('0x20')]('Content-Range',_0x49a507+'-'+_0x385cac+'/'+_0x3c5a3a)['json'](_0x5db9a4);}return null;};}function patchUpdates(_0x20efcc){return function(_0x1cfdd2){try{jsonpatch[_0xc5ba('0x21')](_0x1cfdd2,_0x20efcc,!![]);}catch(_0x5ce288){return BPromise[_0xc5ba('0x22')](_0x5ce288);}return _0x1cfdd2[_0xc5ba('0x23')]();};}function saveUpdates(_0x555e70,_0x1af987){return function(_0x428fe0){if(_0x428fe0){return _0x428fe0['update'](_0x555e70)['then'](function(_0xbd449){return _0xbd449;});}return null;};}function removeEntity(_0x583d82,_0x41c2b5){return function(_0x221a4b){if(_0x221a4b){return _0x221a4b[_0xc5ba('0x24')]()['then'](function(){_0x583d82[_0xc5ba('0x1a')](0xcc)[_0xc5ba('0x19')]();});}};}function handleEntityNotFound(_0x591235,_0x46bff9){return function(_0x4dd53d){if(!_0x4dd53d){_0x591235[_0xc5ba('0x18')](0x194);}return _0x4dd53d;};}function handleError(_0x29885c,_0x2a8b88){_0x2a8b88=_0x2a8b88||0x1f4;return function(_0x41fdd8){logger[_0xc5ba('0x25')](_0x41fdd8[_0xc5ba('0x26')]);if(_0x41fdd8[_0xc5ba('0x27')]){delete _0x41fdd8[_0xc5ba('0x27')];}_0x29885c['status'](_0x2a8b88)[_0xc5ba('0x28')](_0x41fdd8);};}exports[_0xc5ba('0x29')]=function(_0x5504cf,_0x267c2b){var _0x544686={},_0x50ef18={},_0x13eea3={'count':0x0,'rows':[]};var _0x29c9cb=_[_0xc5ba('0x2a')](db[_0xc5ba('0x2b')]['rawAttributes'],function(_0xcf5047){return{'name':_0xcf5047[_0xc5ba('0x2c')],'type':_0xcf5047[_0xc5ba('0x2d')]['key']};});_0x50ef18[_0xc5ba('0x2e')]=_[_0xc5ba('0x2f')](_[_0xc5ba('0x2a')](_0x29c9cb,_0xc5ba('0x27')),[_0xc5ba('0x27')]);_0x50ef18[_0xc5ba('0x30')]=_['keys'](_0x5504cf[_0xc5ba('0x30')]);_0x50ef18[_0xc5ba('0x31')]=_[_0xc5ba('0x32')](_0x50ef18[_0xc5ba('0x2e')],_0x50ef18[_0xc5ba('0x30')]);_0x544686[_0xc5ba('0x33')]=_[_0xc5ba('0x32')](_0x50ef18[_0xc5ba('0x2e')],qs['fields'](_0x5504cf['query'][_0xc5ba('0x34')]));_0x544686[_0xc5ba('0x33')]=_0x544686['attributes'][_0xc5ba('0x35')]?_0x544686[_0xc5ba('0x33')]:_0x50ef18['model'];if(!_0x5504cf[_0xc5ba('0x30')][_0xc5ba('0x36')](_0xc5ba('0x37'))){_0x544686[_0xc5ba('0x1e')]=qs[_0xc5ba('0x1e')](_0x5504cf['query'][_0xc5ba('0x1e')]);_0x544686[_0xc5ba('0x1c')]=qs[_0xc5ba('0x1c')](_0x5504cf['query']['offset']);}_0x544686[_0xc5ba('0x38')]=qs[_0xc5ba('0x39')](_0x5504cf[_0xc5ba('0x30')][_0xc5ba('0x39')]);_0x544686['where']=qs[_0xc5ba('0x31')](_[_0xc5ba('0x3a')](_0x5504cf['query'],_0x50ef18[_0xc5ba('0x31')]),_0x29c9cb);if(_0x5504cf['query']['filter']){_0x544686[_0xc5ba('0x3b')]=_[_0xc5ba('0x3c')](_0x544686[_0xc5ba('0x3b')],{'$or':_[_0xc5ba('0x2a')](_0x29c9cb,function(_0x3a175a){if(_0x3a175a[_0xc5ba('0x2d')]!=='VIRTUAL'){var _0x108a18={};_0x108a18[_0x3a175a[_0xc5ba('0x27')]]={'$like':'%'+_0x5504cf[_0xc5ba('0x30')][_0xc5ba('0x3d')]+'%'};return _0x108a18;}})});}_0x544686=_['merge']({},_0x544686,_0x5504cf[_0xc5ba('0x3e')]);var _0x2f24ac={'where':_0x544686[_0xc5ba('0x3b')]};return db[_0xc5ba('0x2b')][_0xc5ba('0x1f')](_0x2f24ac)[_0xc5ba('0x3f')](function(_0x2a7f30){_0x13eea3[_0xc5ba('0x1f')]=_0x2a7f30;if(_0x5504cf['query']['includeAll']){_0x544686[_0xc5ba('0x40')]=[{'all':!![]}];}return db[_0xc5ba('0x2b')][_0xc5ba('0x41')](_0x544686);})['then'](function(_0x3baa39){_0x13eea3[_0xc5ba('0x42')]=_0x3baa39;return _0x13eea3;})[_0xc5ba('0x3f')](respondWithFilteredResult(_0x267c2b,_0x544686))['catch'](handleError(_0x267c2b,null));};exports[_0xc5ba('0x43')]=function(_0x1328dd,_0x5d49dd){var _0x22b211={'raw':!![],'where':{'id':_0x1328dd[_0xc5ba('0x44')]['id']}},_0x1692a6={};_0x1692a6['model']=_[_0xc5ba('0x45')](db[_0xc5ba('0x2b')][_0xc5ba('0x46')]);_0x1692a6[_0xc5ba('0x30')]=_[_0xc5ba('0x45')](_0x1328dd['query']);_0x1692a6['filters']=_[_0xc5ba('0x32')](_0x1692a6[_0xc5ba('0x2e')],_0x1692a6[_0xc5ba('0x30')]);_0x22b211[_0xc5ba('0x33')]=_[_0xc5ba('0x32')](_0x1692a6[_0xc5ba('0x2e')],qs[_0xc5ba('0x34')](_0x1328dd[_0xc5ba('0x30')][_0xc5ba('0x34')]));_0x22b211[_0xc5ba('0x33')]=_0x22b211[_0xc5ba('0x33')][_0xc5ba('0x35')]?_0x22b211['attributes']:_0x1692a6[_0xc5ba('0x2e')];if(_0x1328dd[_0xc5ba('0x30')][_0xc5ba('0x47')]){_0x22b211[_0xc5ba('0x40')]=[{'all':!![]}];}_0x22b211=_[_0xc5ba('0x3c')]({},_0x22b211,_0x1328dd[_0xc5ba('0x3e')]);return db[_0xc5ba('0x2b')][_0xc5ba('0x48')](_0x22b211)[_0xc5ba('0x3f')](handleEntityNotFound(_0x5d49dd,null))[_0xc5ba('0x3f')](respondWithResult(_0x5d49dd,null))[_0xc5ba('0x49')](handleError(_0x5d49dd,null));};exports[_0xc5ba('0x4a')]=function(_0x8c7c9c,_0x43976a){return db[_0xc5ba('0x2b')]['create'](_0x8c7c9c[_0xc5ba('0x4b')],{})[_0xc5ba('0x3f')](respondWithResult(_0x43976a,0xc9))[_0xc5ba('0x49')](handleError(_0x43976a,null));};exports[_0xc5ba('0x4c')]=function(_0x468e63,_0x122aed){if(_0x468e63[_0xc5ba('0x4b')]['id']){delete _0x468e63['body']['id'];}return db[_0xc5ba('0x2b')][_0xc5ba('0x48')]({'where':{'id':_0x468e63['params']['id']}})['then'](handleEntityNotFound(_0x122aed,null))[_0xc5ba('0x3f')](saveUpdates(_0x468e63[_0xc5ba('0x4b')],null))[_0xc5ba('0x3f')](respondWithResult(_0x122aed,null))['catch'](handleError(_0x122aed,null));};exports['destroy']=function(_0x517583,_0x19cbbe){return db[_0xc5ba('0x2b')][_0xc5ba('0x48')]({'where':{'id':_0x517583[_0xc5ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x19cbbe,null))[_0xc5ba('0x3f')](removeEntity(_0x19cbbe,null))[_0xc5ba('0x49')](handleError(_0x19cbbe,null));};exports[_0xc5ba('0x4d')]=function(_0x1c9635,_0x3725cc,_0x563843){return db[_0xc5ba('0x2b')]['find']({'where':{'id':_0x1c9635[_0xc5ba('0x44')]['id']},'attributes':['id',_0xc5ba('0x4e'),'msg_id']})[_0xc5ba('0x3f')](handleEntityNotFound(_0x3725cc,null))[_0xc5ba('0x3f')](function(_0x247059){if(_0x247059){if(!_0x247059[_0xc5ba('0x4e')]){throw new db[(_0xc5ba('0x4f'))]['ValidationError'](_0xc5ba('0x50'));}var _0x591a33={'Content-Type':'audio/wav','Content-Disposition':_0xc5ba('0x51')};if(_0x247059[_0xc5ba('0x52')]){_0x591a33[_0xc5ba('0x53')]='attachment;\x20filename=\x22'+_0x247059[_0xc5ba('0x52')]+_0xc5ba('0x54');}_0x3725cc[_0xc5ba('0x20')](_0x591a33);return _0x3725cc[_0xc5ba('0x28')](new Buffer(_0x247059[_0xc5ba('0x4e')]));}})['catch'](handleError(_0x3725cc,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 46f764d..e69f455 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 _0x8b92=['../../config/logger','api','moment','bluebird','request-promise','path','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','util'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0x8b92,0xbf));var _0x28b9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8b92[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x28b9('0x0'));var logger=require(_0x28b9('0x1'))(_0x28b9('0x2'));var moment=require(_0x28b9('0x3'));var BPromise=require(_0x28b9('0x4'));var rp=require(_0x28b9('0x5'));var fs=require('fs');var path=require(_0x28b9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x28b9('0x7'));module[_0x28b9('0x8')]=function(_0x248399,_0x49312f){return _0x248399[_0x28b9('0x9')]('VoiceMailMessage',attributes,{'tableName':_0x28b9('0xa'),'paranoid':![],'indexes':[{'name':_0x28b9('0xb'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0xc1a4=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','VoiceMailMessage','dir','lodash'];(function(_0x51ef0e,_0x111fb6){var _0x32f1d2=function(_0x53b06e){while(--_0x53b06e){_0x51ef0e['push'](_0x51ef0e['shift']());}};_0x32f1d2(++_0x111fb6);}(_0xc1a4,0x1eb));var _0x4c1a=function(_0x5bb49b,_0x3a97c1){_0x5bb49b=_0x5bb49b-0x0;var _0x5d81a2=_0xc1a4[_0x5bb49b];return _0x5d81a2;};'use strict';var _=require(_0x4c1a('0x0'));var util=require(_0x4c1a('0x1'));var logger=require(_0x4c1a('0x2'))(_0x4c1a('0x3'));var moment=require('moment');var BPromise=require(_0x4c1a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c1a('0x5'));var rimraf=require(_0x4c1a('0x6'));var config=require(_0x4c1a('0x7'));var attributes=require('./voiceMailMessage.attributes');module[_0x4c1a('0x8')]=function(_0x1b09de,_0x59b050){return _0x1b09de[_0x4c1a('0x9')](_0x4c1a('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x4c1a('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 2f38b2d..d144289 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 _0xb34a=['info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xfd6262,_0x178f17){var _0x3ff788=function(_0xde9c66){while(--_0xde9c66){_0xfd6262['push'](_0xfd6262['shift']());}};_0x3ff788(++_0x178f17);}(_0xb34a,0xb3));var _0xab34=function(_0x56f67f,_0x2caef4){_0x56f67f=_0x56f67f-0x0;var _0x4d5493=_0xb34a[_0x56f67f];return _0x4d5493;};'use strict';var _=require(_0xab34('0x0'));var util=require(_0xab34('0x1'));var moment=require('moment');var BPromise=require(_0xab34('0x2'));var rs=require(_0xab34('0x3'));var fs=require('fs');var Redis=require(_0xab34('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xab34('0x5'));var logger=require(_0xab34('0x6'))(_0xab34('0x7'));var config=require(_0xab34('0x8'));var jayson=require(_0xab34('0x9'));var client=jayson[_0xab34('0xa')][_0xab34('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43b6f8,_0x2690e1,_0x2b36a5){return new BPromise(function(_0x1aa5c0,_0x162311){return client[_0xab34('0xc')](_0x43b6f8,_0x2b36a5)['then'](function(_0x3547f2){logger[_0xab34('0xd')](_0xab34('0xe'),_0x2690e1,_0xab34('0xf'));logger[_0xab34('0x10')](_0xab34('0x11'),_0x2690e1,_0xab34('0xf'),JSON[_0xab34('0x12')](_0x3547f2));if(_0x3547f2['error']){if(_0x3547f2[_0xab34('0x13')][_0xab34('0x14')]===0x1f4){logger[_0xab34('0x13')](_0xab34('0xe'),_0x2690e1,_0x3547f2[_0xab34('0x13')][_0xab34('0x15')]);return _0x162311(_0x3547f2[_0xab34('0x13')]['message']);}logger[_0xab34('0x13')](_0xab34('0xe'),_0x2690e1,_0x3547f2[_0xab34('0x13')][_0xab34('0x15')]);return _0x1aa5c0(_0x3547f2[_0xab34('0x13')][_0xab34('0x15')]);}else{logger[_0xab34('0xd')](_0xab34('0xe'),_0x2690e1,_0xab34('0xf'));_0x1aa5c0(_0x3547f2[_0xab34('0x16')][_0xab34('0x15')]);}})[_0xab34('0x17')](function(_0x554ebd){logger[_0xab34('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x2690e1,_0x554ebd);_0x162311(_0x554ebd);});});} \ No newline at end of file +var _0x4e12=['request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x4e12,0xe8));var _0x24e1=function(_0x3cad0f,_0x1f2ad8){_0x3cad0f=_0x3cad0f-0x0;var _0x40c62c=_0x4e12[_0x3cad0f];return _0x40c62c;};'use strict';var _=require('lodash');var util=require(_0x24e1('0x0'));var moment=require(_0x24e1('0x1'));var BPromise=require('bluebird');var rs=require(_0x24e1('0x2'));var fs=require('fs');var Redis=require(_0x24e1('0x3'));var db=require(_0x24e1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x24e1('0x5'))(_0x24e1('0x6'));var config=require(_0x24e1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x24e1('0x8')][_0x24e1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x456dea,_0x18057a,_0x11083b){return new BPromise(function(_0x5ee291,_0x239f57){return client[_0x24e1('0xa')](_0x456dea,_0x11083b)[_0x24e1('0xb')](function(_0xa3617f){logger[_0x24e1('0xc')](_0x24e1('0xd'),_0x18057a,_0x24e1('0xe'));logger[_0x24e1('0xf')](_0x24e1('0x10'),_0x18057a,_0x24e1('0xe'),JSON['stringify'](_0xa3617f));if(_0xa3617f[_0x24e1('0x11')]){if(_0xa3617f['error'][_0x24e1('0x12')]===0x1f4){logger[_0x24e1('0x11')](_0x24e1('0xd'),_0x18057a,_0xa3617f[_0x24e1('0x11')][_0x24e1('0x13')]);return _0x239f57(_0xa3617f[_0x24e1('0x11')][_0x24e1('0x13')]);}logger[_0x24e1('0x11')](_0x24e1('0xd'),_0x18057a,_0xa3617f[_0x24e1('0x11')][_0x24e1('0x13')]);return _0x5ee291(_0xa3617f[_0x24e1('0x11')][_0x24e1('0x13')]);}else{logger[_0x24e1('0xc')](_0x24e1('0xd'),_0x18057a,_0x24e1('0xe'));_0x5ee291(_0xa3617f[_0x24e1('0x14')][_0x24e1('0x13')]);}})[_0x24e1('0x15')](function(_0x41a53b){logger[_0x24e1('0x11')](_0x24e1('0xd'),_0x18057a,_0x41a53b);_0x239f57(_0x41a53b);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index f24d045..7af7e7b 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 _0x48b9=['/:id/sounds','post','addSound','put','update','delete','/:id/sounds/:id2','removeSound','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0x48b9,0xe5));var _0x948b=function(_0x40b9d0,_0x3537da){_0x40b9d0=_0x40b9d0-0x0;var _0x144b8d=_0x48b9[_0x40b9d0];return _0x144b8d;};'use strict';var multer=require('multer');var util=require(_0x948b('0x0'));var path=require('path');var timeout=require(_0x948b('0x1'));var express=require(_0x948b('0x2'));var router=express[_0x948b('0x3')]();var fs_extra=require(_0x948b('0x4'));var auth=require(_0x948b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x948b('0x6'));router[_0x948b('0x7')]('/',auth['isAuthenticated'](),controller[_0x948b('0x8')]);router[_0x948b('0x7')](_0x948b('0x9'),auth[_0x948b('0xa')](),controller['show']);router[_0x948b('0x7')](_0x948b('0xb'),auth[_0x948b('0xa')](),controller['getSounds']);router[_0x948b('0xc')]('/',auth[_0x948b('0xa')](),controller['create']);router[_0x948b('0xc')](_0x948b('0xb'),auth[_0x948b('0xa')](),controller[_0x948b('0xd')]);router[_0x948b('0xe')](_0x948b('0x9'),auth[_0x948b('0xa')](),controller[_0x948b('0xf')]);router[_0x948b('0x10')](_0x948b('0x9'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x948b('0x11'),auth[_0x948b('0xa')](),controller[_0x948b('0x12')]);module[_0x948b('0x13')]=router; \ No newline at end of file +var _0x372c=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','create','addSound','delete','destroy','/:id/sounds/:id2','multer'];(function(_0x47287c,_0x349944){var _0x3926b3=function(_0x314e83){while(--_0x314e83){_0x47287c['push'](_0x47287c['shift']());}};_0x3926b3(++_0x349944);}(_0x372c,0x197));var _0xc372=function(_0x132a1f,_0x2fa3a1){_0x132a1f=_0x132a1f-0x0;var _0x1e10bd=_0x372c[_0x132a1f];return _0x1e10bd;};'use strict';var multer=require(_0xc372('0x0'));var util=require(_0xc372('0x1'));var path=require(_0xc372('0x2'));var timeout=require(_0xc372('0x3'));var express=require(_0xc372('0x4'));var router=express[_0xc372('0x5')]();var fs_extra=require(_0xc372('0x6'));var auth=require(_0xc372('0x7'));var interaction=require(_0xc372('0x8'));var config=require(_0xc372('0x9'));var controller=require(_0xc372('0xa'));router[_0xc372('0xb')]('/',auth[_0xc372('0xc')](),controller[_0xc372('0xd')]);router[_0xc372('0xb')](_0xc372('0xe'),auth[_0xc372('0xc')](),controller[_0xc372('0xf')]);router[_0xc372('0xb')](_0xc372('0x10'),auth[_0xc372('0xc')](),controller[_0xc372('0x11')]);router[_0xc372('0x12')]('/',auth[_0xc372('0xc')](),controller[_0xc372('0x13')]);router[_0xc372('0x12')](_0xc372('0x10'),auth[_0xc372('0xc')](),controller[_0xc372('0x14')]);router['put'](_0xc372('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xc372('0x15')](_0xc372('0xe'),auth['isAuthenticated'](),controller[_0xc372('0x16')]);router['delete'](_0xc372('0x17'),auth['isAuthenticated'](),controller['removeSound']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 38c23bb..319e546 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 _0x7e41=['STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name','custom','files','mp3nb','quietmp3','mp3'];(function(_0x1312e9,_0x5eb642){var _0x677ab8=function(_0x493645){while(--_0x493645){_0x1312e9['push'](_0x1312e9['shift']());}};_0x677ab8(++_0x5eb642);}(_0x7e41,0xac));var _0x17e4=function(_0x452a31,_0x77fa6f){_0x452a31=_0x452a31-0x0;var _0x37de3e=_0x7e41[_0x452a31];return _0x37de3e;};'use strict';var Sequelize=require(_0x17e4('0x0'));module[_0x17e4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x17e4('0x2')},'mode':{'type':Sequelize['ENUM'](_0x17e4('0x3'),_0x17e4('0x4'),_0x17e4('0x5'),'quietmp3nb',_0x17e4('0x6'),_0x17e4('0x7')),'allowNull':!![],'defaultValue':_0x17e4('0x4')},'directory':{'type':Sequelize[_0x17e4('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0x17e4('0x8')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x17e4('0x8')],'allowNull':!![],'defaultValue':_0x17e4('0x9')},'format':{'type':Sequelize[_0x17e4('0x8')],'allowNull':!![]},'stamp':{'type':_0x17e4('0xa')},'defaultEntry':{'type':Sequelize[_0x17e4('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x42a6=['quietmp3','STRING','alpha','TIMESTAMP','BOOLEAN','exports','quietmp3nb'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x42a6,0xd7));var _0x642a=function(_0x53e3de,_0x13da7b){_0x53e3de=_0x53e3de-0x0;var _0x7b905b=_0x42a6[_0x53e3de];return _0x7b905b;};'use strict';var Sequelize=require('sequelize');module[_0x642a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM']('custom','files','mp3nb',_0x642a('0x1'),_0x642a('0x2'),'mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x642a('0x3')],'allowNull':!![]},'application':{'type':Sequelize[_0x642a('0x3')],'allowNull':!![]},'digit':{'type':Sequelize[_0x642a('0x3')],'allowNull':!![]},'sort':{'type':Sequelize[_0x642a('0x3')],'allowNull':!![],'defaultValue':_0x642a('0x4')},'format':{'type':Sequelize[_0x642a('0x3')],'allowNull':!![]},'stamp':{'type':_0x642a('0x5')},'defaultEntry':{'type':Sequelize[_0x642a('0x6')],'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 98d899b..7b839bb 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 _0x300d=['attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','intersection','fields','includeAll','update','body','create','sequelize','files','directory','join','server/files/moh','mode','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','find','readdirSync','forEach','rmdirSync','message','addSound','Sound','findOne','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','save_name','symlinkSync','Sequelize','ValidationError','removeSound','id2','unlinkSync','getSounds','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','get','MusicOnHolds','end','error','stack','name','index','map','VoiceMusicOnHold','fieldName','type','key','query','keys','filters','model'];(function(_0x275e44,_0x12af3a){var _0x44dfd3=function(_0x30c942){while(--_0x30c942){_0x275e44['push'](_0x275e44['shift']());}};_0x44dfd3(++_0x12af3a);}(_0x300d,0x119));var _0xd300=function(_0x217cc9,_0x2aa548){_0x217cc9=_0x217cc9-0x0;var _0x434329=_0x300d[_0x217cc9];return _0x434329;};'use strict';var emlformat=require(_0xd300('0x0'));var rimraf=require(_0xd300('0x1'));var zipdir=require(_0xd300('0x2'));var jsonpatch=require(_0xd300('0x3'));var rp=require(_0xd300('0x4'));var moment=require(_0xd300('0x5'));var BPromise=require(_0xd300('0x6'));var Mustache=require(_0xd300('0x7'));var util=require(_0xd300('0x8'));var path=require(_0xd300('0x9'));var sox=require(_0xd300('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd300('0xb'));var _=require(_0xd300('0xc'));var squel=require('squel');var crypto=require(_0xd300('0xd'));var jsforce=require(_0xd300('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd300('0xf'));var Redis=require('ioredis');var authService=require(_0xd300('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd300('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd300('0x12'));var utils=require('../../config/utils');var config=require(_0xd300('0x13'));var licenseUtil=require(_0xd300('0x14'));var db=require(_0xd300('0x15'))['db'];function respondWithStatusCode(_0x5b4e39,_0x8d356d){_0x8d356d=_0x8d356d||0xcc;return function(_0x44ca9f){if(_0x44ca9f){return _0x5b4e39['sendStatus'](_0x8d356d);}return _0x5b4e39[_0xd300('0x16')](_0x8d356d)['end']();};}function respondWithResult(_0x3bee8f,_0x7e1081){_0x7e1081=_0x7e1081||0xc8;return function(_0x2aebc7){if(_0x2aebc7){return _0x3bee8f[_0xd300('0x16')](_0x7e1081)[_0xd300('0x17')](_0x2aebc7);}};}function respondWithFilteredResult(_0xd93635,_0x27ca1d){return function(_0xf620b5){if(_0xf620b5){var _0x521b08=typeof _0x27ca1d[_0xd300('0x18')]===_0xd300('0x19')&&typeof _0x27ca1d[_0xd300('0x1a')]===_0xd300('0x19');var _0x12113f=_0xf620b5['count'];var _0x3c1d26=_0x521b08?0x0:_0x27ca1d[_0xd300('0x18')];var _0x58193c=_0x521b08?_0xf620b5[_0xd300('0x1b')]:_0x27ca1d['offset']+_0x27ca1d['limit'];var _0x6b46e6;if(_0x58193c>=_0x12113f){_0x58193c=_0x12113f;_0x6b46e6=0xc8;}else{_0x6b46e6=0xce;}_0xd93635[_0xd300('0x16')](_0x6b46e6);return _0xd93635[_0xd300('0x1c')](_0xd300('0x1d'),_0x3c1d26+'-'+_0x58193c+'/'+_0x12113f)['json'](_0xf620b5);}return null;};}function patchUpdates(_0x3adb6f){return function(_0x11e787){try{jsonpatch[_0xd300('0x1e')](_0x11e787,_0x3adb6f,!![]);}catch(_0x4ebdab){return BPromise['reject'](_0x4ebdab);}return _0x11e787[_0xd300('0x1f')]();};}function saveUpdates(_0x21a443,_0x31f692){return function(_0x1511ba){if(_0x1511ba){return _0x1511ba['update'](_0x21a443)[_0xd300('0x20')](function(_0x238125){return _0x238125;});}return null;};}function removeEntity(_0x156f13,_0x2f04d8){return function(_0x39975e){if(_0x39975e){return _0x39975e['destroy']()[_0xd300('0x20')](function(){var _0x1d80c8=_0x39975e[_0xd300('0x21')]({'plain':!![]});var _0x16dda7=_0xd300('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x16dda7,'resourceId':_0x1d80c8['id']}})['then'](function(){return _0x39975e;});})[_0xd300('0x20')](function(){_0x156f13[_0xd300('0x16')](0xcc)[_0xd300('0x23')]();});}};}function handleEntityNotFound(_0x3bc579,_0xc53198){return function(_0x16a310){if(!_0x16a310){_0x3bc579['sendStatus'](0x194);}return _0x16a310;};}function handleError(_0x56915f,_0x15f910){_0x15f910=_0x15f910||0x1f4;return function(_0x1f300a){logger[_0xd300('0x24')](_0x1f300a[_0xd300('0x25')]);if(_0x1f300a['name']){delete _0x1f300a[_0xd300('0x26')];}_0x56915f[_0xd300('0x16')](_0x15f910)['send'](_0x1f300a);};}exports[_0xd300('0x27')]=function(_0x45d33b,_0x28c789){var _0x50b6c9={},_0x21b41f={},_0x2bc7d4={'count':0x0,'rows':[]};var _0x29d199=_[_0xd300('0x28')](db[_0xd300('0x29')]['rawAttributes'],function(_0x212845){return{'name':_0x212845[_0xd300('0x2a')],'type':_0x212845[_0xd300('0x2b')][_0xd300('0x2c')]};});_0x21b41f['model']=_['map'](_0x29d199,_0xd300('0x26'));_0x21b41f[_0xd300('0x2d')]=_[_0xd300('0x2e')](_0x45d33b[_0xd300('0x2d')]);_0x21b41f[_0xd300('0x2f')]=_['intersection'](_0x21b41f[_0xd300('0x30')],_0x21b41f['query']);_0x50b6c9[_0xd300('0x31')]=_['intersection'](_0x21b41f[_0xd300('0x30')],qs['fields'](_0x45d33b['query']['fields']));_0x50b6c9[_0xd300('0x31')]=_0x50b6c9['attributes'][_0xd300('0x32')]?_0x50b6c9['attributes']:_0x21b41f[_0xd300('0x30')];if(!_0x45d33b[_0xd300('0x2d')][_0xd300('0x33')](_0xd300('0x34'))){_0x50b6c9[_0xd300('0x1a')]=qs[_0xd300('0x1a')](_0x45d33b['query'][_0xd300('0x1a')]);_0x50b6c9[_0xd300('0x18')]=qs[_0xd300('0x18')](_0x45d33b['query'][_0xd300('0x18')]);}_0x50b6c9['order']=qs[_0xd300('0x35')](_0x45d33b['query'][_0xd300('0x35')]);delete _0x45d33b[_0xd300('0x2d')][_0xd300('0x35')];_0x50b6c9[_0xd300('0x36')]=qs[_0xd300('0x2f')](_[_0xd300('0x37')](_0x45d33b['query'],_0x21b41f['filters']),_0x29d199);if(_0x45d33b[_0xd300('0x2d')]['filter']){_0x50b6c9['where']=_[_0xd300('0x38')](_0x50b6c9[_0xd300('0x36')],{'$or':_[_0xd300('0x28')](_0x29d199,function(_0x4aadb7){if(_0x4aadb7[_0xd300('0x2b')]!==_0xd300('0x39')){var _0x4511cd={};_0x4511cd[_0x4aadb7['name']]={'$like':'%'+_0x45d33b['query'][_0xd300('0x3a')]+'%'};return _0x4511cd;}})});}_0x50b6c9=_[_0xd300('0x38')]({},_0x50b6c9,_0x45d33b[_0xd300('0x3b')]);var _0x5e8538={'where':_0x50b6c9[_0xd300('0x36')]};return db['VoiceMusicOnHold'][_0xd300('0x1b')](_0x5e8538)[_0xd300('0x20')](function(_0x2bc374){_0x2bc7d4[_0xd300('0x1b')]=_0x2bc374;if(_0x45d33b[_0xd300('0x2d')]['includeAll']){_0x50b6c9[_0xd300('0x3c')]=[{'all':!![]}];}return db[_0xd300('0x29')][_0xd300('0x3d')](_0x50b6c9);})[_0xd300('0x20')](function(_0x3df509){_0x2bc7d4[_0xd300('0x3e')]=_0x3df509;return _0x2bc7d4;})[_0xd300('0x20')](respondWithFilteredResult(_0x28c789,_0x50b6c9))[_0xd300('0x3f')](handleError(_0x28c789,null));};exports[_0xd300('0x40')]=function(_0x450b26,_0x58d34c){var _0x163d0e={'raw':![],'where':{'id':_0x450b26[_0xd300('0x41')]['id']}},_0x322e4c={};_0x322e4c[_0xd300('0x30')]=_[_0xd300('0x2e')](db[_0xd300('0x29')][_0xd300('0x42')]);_0x322e4c[_0xd300('0x2d')]=_[_0xd300('0x2e')](_0x450b26[_0xd300('0x2d')]);_0x322e4c[_0xd300('0x2f')]=_[_0xd300('0x43')](_0x322e4c['model'],_0x322e4c[_0xd300('0x2d')]);_0x163d0e[_0xd300('0x31')]=_[_0xd300('0x43')](_0x322e4c[_0xd300('0x30')],qs[_0xd300('0x44')](_0x450b26[_0xd300('0x2d')][_0xd300('0x44')]));_0x163d0e[_0xd300('0x31')]=_0x163d0e[_0xd300('0x31')]['length']?_0x163d0e['attributes']:_0x322e4c[_0xd300('0x30')];if(_0x450b26[_0xd300('0x2d')][_0xd300('0x45')]){_0x163d0e[_0xd300('0x3c')]=[{'all':!![]}];}_0x163d0e=_['merge']({},_0x163d0e,_0x450b26['options']);return db['VoiceMusicOnHold']['find'](_0x163d0e)[_0xd300('0x20')](handleEntityNotFound(_0x58d34c,null))[_0xd300('0x20')](respondWithResult(_0x58d34c,null))[_0xd300('0x3f')](handleError(_0x58d34c,null));};exports[_0xd300('0x46')]=function(_0x1d9aaa,_0x4bd708){if(_0x1d9aaa['body']['id']){delete _0x1d9aaa[_0xd300('0x47')]['id'];}return db[_0xd300('0x29')]['find']({'where':{'id':_0x1d9aaa[_0xd300('0x41')]['id']}})[_0xd300('0x20')](handleEntityNotFound(_0x4bd708,null))['then'](saveUpdates(_0x1d9aaa['body'],null))[_0xd300('0x20')](respondWithResult(_0x4bd708,null))[_0xd300('0x3f')](handleError(_0x4bd708,null));};exports[_0xd300('0x48')]=function(_0x3bf5a9,_0x4b11df,_0x5255d0){return db[_0xd300('0x49')]['transaction'](function(_0x37874b){if(_0x3bf5a9['body']['mode']===_0xd300('0x4a')){_0x3bf5a9['body'][_0xd300('0x4b')]=path[_0xd300('0x4c')](config['root'],_0xd300('0x4d'),_0x3bf5a9[_0xd300('0x47')][_0xd300('0x26')]);}return db[_0xd300('0x29')][_0xd300('0x48')](_0x3bf5a9[_0xd300('0x47')],{'transaction':_0x37874b})['then'](function(_0x2dc6a5){if(_0x3bf5a9[_0xd300('0x47')][_0xd300('0x4e')]===_0xd300('0x4a')){fs['mkdirSync'](_0x2dc6a5[_0xd300('0x4b')],parseInt('0777',0x8));}var _0x1856db=_0x3bf5a9['user']['get']({'plain':!![]});if(!_0x1856db)throw new Error(_0xd300('0x4f'));if(_0x1856db[_0xd300('0x50')]===_0xd300('0x51')){var _0x414f3c=_0x2dc6a5[_0xd300('0x21')]({'plain':!![]});return db[_0xd300('0x52')]['find']({'where':{'name':_0xd300('0x22'),'userProfileId':_0x1856db[_0xd300('0x53')]},'raw':!![]})[_0xd300('0x20')](function(_0x4096a6){if(_0x4096a6&&_0x4096a6['autoAssociation']===0x0){return db[_0xd300('0x54')][_0xd300('0x48')]({'name':_0x414f3c['name'],'resourceId':_0x414f3c['id'],'type':_0x4096a6[_0xd300('0x26')],'sectionId':_0x4096a6['id']},{})[_0xd300('0x20')](function(){return _0x2dc6a5;});}else{return _0x2dc6a5;}})[_0xd300('0x3f')](function(_0x2b035f){logger[_0xd300('0x24')](_0xd300('0x55'),_0x2b035f);});}return _0x2dc6a5;});})[_0xd300('0x20')](respondWithResult(_0x4b11df,0xc9))[_0xd300('0x3f')](handleError(_0x4b11df,null));};exports[_0xd300('0x56')]=function(_0x36412b,_0x282c73,_0x10acfc){var _0x597947;return db[_0xd300('0x29')][_0xd300('0x57')]({'where':{'id':_0x36412b[_0xd300('0x41')]['id']}})[_0xd300('0x20')](function(_0x591d69){if(_0x591d69){return db[_0xd300('0x49')]['transaction'](function(_0x3f656b){return _0x591d69[_0xd300('0x56')]({'transaction':_0x3f656b,'raw':!![]})[_0xd300('0x20')](function(_0x41792d){if(_0x41792d['directory']){fs[_0xd300('0x58')](_0x41792d[_0xd300('0x4b')])[_0xd300('0x59')](function(_0x2c4c30){fs['unlinkSync'](path[_0xd300('0x4c')](_0x41792d['directory'],_0x2c4c30));});fs[_0xd300('0x5a')](_0x41792d[_0xd300('0x4b')]);}return _0x41792d;});})[_0xd300('0x3f')](function(_0x2adf40){throw new db['Sequelize']['ValidationError'](_0x2adf40[_0xd300('0x5b')]);});}})[_0xd300('0x20')](handleEntityNotFound(_0x282c73,null))['then'](removeEntity(_0x282c73,null))[_0xd300('0x3f')](handleError(_0x282c73,null));};exports[_0xd300('0x5c')]=function(_0x300834,_0x2c3aa1,_0x4db5a9){return db[_0xd300('0x49')]['transaction'](function(_0x25b4f2){var _0x511d0f;return db[_0xd300('0x29')]['find']({'where':{'id':_0x300834[_0xd300('0x41')]['id']}})[_0xd300('0x20')](function(_0x8ae106){if(_0x8ae106){_0x511d0f=_0x8ae106;return _0x8ae106[_0xd300('0x5c')](_0x300834['body']['id'],{'transaction':_0x25b4f2});}})[_0xd300('0x20')](function(_0xe8bd15){if(_0xe8bd15){return db[_0xd300('0x5d')][_0xd300('0x5e')]({'where':{'id':_0x300834[_0xd300('0x47')]['id']},'attributes':['id','name','save_name',_0xd300('0x5f'),_0xd300('0x60')],'raw':!![]});}})[_0xd300('0x20')](function(_0x248ebd){if(_0x248ebd){var _0x4767fe=path['join'](config[_0xd300('0x61')],_0xd300('0x62'),util[_0xd300('0x63')](_0xd300('0x64'),path['basename'](_0x248ebd[_0xd300('0x65')],path['extname'](_0x248ebd[_0xd300('0x65')])),_0x248ebd[_0xd300('0x5f')]));var _0x3e57ef=path[_0xd300('0x4c')](config[_0xd300('0x61')],'server/files/moh',_0x511d0f[_0xd300('0x26')],util[_0xd300('0x63')](_0xd300('0x64'),_0x248ebd['name'],_0x248ebd['converted_format']));fs[_0xd300('0x66')](_0x4767fe,_0x3e57ef);return _0x248ebd;}})['catch'](function(_0x1ea86a){throw new db[(_0xd300('0x67'))][(_0xd300('0x68'))](_0x1ea86a['message']);});})['then'](handleEntityNotFound(_0x2c3aa1,null))['then'](respondWithResult(_0x2c3aa1,0xc9))['catch'](handleError(_0x2c3aa1,null));};exports[_0xd300('0x69')]=function(_0xca13ef,_0x2b8a12,_0x3aac74){return db['sequelize']['transaction'](function(_0x45b6e5){var _0x22c0ab;return db[_0xd300('0x29')][_0xd300('0x5e')]({'where':{'id':_0xca13ef['params']['id']}})[_0xd300('0x20')](handleEntityNotFound(_0x2b8a12,null))[_0xd300('0x20')](function(_0x3df505){if(_0x3df505){_0x22c0ab=_0x3df505;return _0x3df505[_0xd300('0x69')](_0xca13ef[_0xd300('0x41')][_0xd300('0x6a')]);}})[_0xd300('0x20')](function(_0x3f0c7d){if(_0x3f0c7d){return db[_0xd300('0x5d')][_0xd300('0x5e')]({'where':{'id':_0xca13ef['params'][_0xd300('0x6a')]},'attributes':['id',_0xd300('0x26'),_0xd300('0x65'),_0xd300('0x5f'),_0xd300('0x60')],'raw':!![]});}})['then'](function(_0x4a1a3f){if(_0x4a1a3f){fs[_0xd300('0x6b')](path[_0xd300('0x4c')](_0x22c0ab['directory'],util[_0xd300('0x63')]('%s.%s',_0x4a1a3f[_0xd300('0x26')],_0x4a1a3f['converted_format'])));return _0x4a1a3f;}})[_0xd300('0x3f')](function(_0x4fb267){throw new db[(_0xd300('0x67'))][(_0xd300('0x68'))](_0x4fb267[_0xd300('0x5b')]);});})[_0xd300('0x20')](handleEntityNotFound(_0x2b8a12,null))[_0xd300('0x20')](respondWithStatusCode(_0x2b8a12,0xcc))['catch'](handleError(_0x2b8a12,null));};exports[_0xd300('0x6c')]=function(_0x1a4940,_0x7c4ff9,_0x544e87){var _0x3ecadd={};var _0x30fc24={};var _0x5a9f00;var _0x15aa6e;return db[_0xd300('0x29')][_0xd300('0x5e')]({'where':{'id':_0x1a4940[_0xd300('0x41')]['id']}})['then'](handleEntityNotFound(_0x7c4ff9,null))[_0xd300('0x20')](function(_0x3f662a){if(_0x3f662a){_0x5a9f00=_0x3f662a;_0x30fc24[_0xd300('0x30')]=_['keys'](db[_0xd300('0x5d')][_0xd300('0x42')]);_0x30fc24[_0xd300('0x2d')]=_[_0xd300('0x2e')](_0x1a4940[_0xd300('0x2d')]);_0x30fc24[_0xd300('0x2f')]=_[_0xd300('0x43')](_0x30fc24[_0xd300('0x30')],_0x30fc24[_0xd300('0x2d')]);_0x3ecadd[_0xd300('0x31')]=_[_0xd300('0x43')](_0x30fc24[_0xd300('0x30')],qs[_0xd300('0x44')](_0x1a4940['query'][_0xd300('0x44')]));_0x3ecadd['attributes']=_0x3ecadd[_0xd300('0x31')][_0xd300('0x32')]?_0x3ecadd[_0xd300('0x31')]:_0x30fc24[_0xd300('0x30')];_0x3ecadd[_0xd300('0x6d')]=qs[_0xd300('0x35')](_0x1a4940[_0xd300('0x2d')]['sort']);_0x3ecadd[_0xd300('0x36')]=qs[_0xd300('0x2f')](_[_0xd300('0x37')](_0x1a4940[_0xd300('0x2d')],_0x30fc24[_0xd300('0x2f')]));if(_0x1a4940[_0xd300('0x2d')][_0xd300('0x3a')]){_0x3ecadd['where']=_['merge'](_0x3ecadd['where'],{'$or':_[_0xd300('0x28')](_0x3ecadd[_0xd300('0x31')],function(_0x57d535){var _0x4c56aa={};_0x4c56aa[_0x57d535]={'$like':'%'+_0x1a4940[_0xd300('0x2d')][_0xd300('0x3a')]+'%'};return _0x4c56aa;})});}_0x3ecadd=_[_0xd300('0x38')]({},_0x3ecadd,_0x1a4940[_0xd300('0x3b')]);return _0x5a9f00[_0xd300('0x6c')](_0x3ecadd);}})['then'](function(_0x581e20){if(_0x581e20){_0x15aa6e=_0x581e20[_0xd300('0x32')];if(!_0x1a4940[_0xd300('0x2d')][_0xd300('0x33')]('nolimit')){_0x3ecadd[_0xd300('0x1a')]=qs[_0xd300('0x1a')](_0x1a4940[_0xd300('0x2d')][_0xd300('0x1a')]);_0x3ecadd['offset']=qs[_0xd300('0x18')](_0x1a4940[_0xd300('0x2d')]['offset']);}return _0x5a9f00[_0xd300('0x6c')](_0x3ecadd);}})[_0xd300('0x20')](function(_0x287632){if(_0x287632){return _0x287632?{'count':_0x15aa6e,'rows':_0x287632}:null;}})[_0xd300('0x20')](respondWithResult(_0x7c4ff9,null))[_0xd300('0x3f')](handleError(_0x7c4ff9,null));}; \ No newline at end of file +var _0x31d3=['util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','reject','save','update','then','destroy','get','MusicOnHolds','error','stack','name','index','map','VoiceMusicOnHold','fieldName','type','key','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','body','find','sequelize','transaction','files','root','server/files/moh','create','mode','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','join','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','basename','format','%s.%s','symlinkSync','Sequelize','message','removeSound','id2','unlinkSync','getSounds','rawAttributes','pick','eml-format','rimraf','mustache'];(function(_0x5e4c60,_0x27fb14){var _0x50e15e=function(_0x51ad67){while(--_0x51ad67){_0x5e4c60['push'](_0x5e4c60['shift']());}};_0x50e15e(++_0x27fb14);}(_0x31d3,0x6c));var _0x331d=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0x31d3[_0x1d8119];return _0x3e30f6;};'use strict';var emlformat=require(_0x331d('0x0'));var rimraf=require(_0x331d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x331d('0x2'));var util=require(_0x331d('0x3'));var path=require(_0x331d('0x4'));var sox=require(_0x331d('0x5'));var csv=require(_0x331d('0x6'));var ejs=require(_0x331d('0x7'));var fs=require('fs');var fs_extra=require(_0x331d('0x8'));var _=require('lodash');var squel=require(_0x331d('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x331d('0xa'));var toCsv=require(_0x331d('0x6'));var querystring=require(_0x331d('0xb'));var Papa=require(_0x331d('0xc'));var Redis=require(_0x331d('0xd'));var authService=require(_0x331d('0xe'));var qs=require(_0x331d('0xf'));var as=require(_0x331d('0x10'));var hardwareService=require(_0x331d('0x11'));var logger=require(_0x331d('0x12'))('api');var utils=require(_0x331d('0x13'));var config=require(_0x331d('0x14'));var licenseUtil=require(_0x331d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e7081,_0x181379){_0x181379=_0x181379||0xcc;return function(_0x455b28){if(_0x455b28){return _0x4e7081[_0x331d('0x16')](_0x181379);}return _0x4e7081[_0x331d('0x17')](_0x181379)[_0x331d('0x18')]();};}function respondWithResult(_0x520853,_0x57121c){_0x57121c=_0x57121c||0xc8;return function(_0x1dde84){if(_0x1dde84){return _0x520853[_0x331d('0x17')](_0x57121c)[_0x331d('0x19')](_0x1dde84);}};}function respondWithFilteredResult(_0xd8e326,_0x36d9f0){return function(_0x603597){if(_0x603597){var _0x4fd0f6=typeof _0x36d9f0['offset']==='undefined'&&typeof _0x36d9f0[_0x331d('0x1a')]===_0x331d('0x1b');var _0x2788be=_0x603597['count'];var _0x1ebc07=_0x4fd0f6?0x0:_0x36d9f0[_0x331d('0x1c')];var _0x535cdb=_0x4fd0f6?_0x603597[_0x331d('0x1d')]:_0x36d9f0[_0x331d('0x1c')]+_0x36d9f0['limit'];var _0x1ba6fb;if(_0x535cdb>=_0x2788be){_0x535cdb=_0x2788be;_0x1ba6fb=0xc8;}else{_0x1ba6fb=0xce;}_0xd8e326[_0x331d('0x17')](_0x1ba6fb);return _0xd8e326[_0x331d('0x1e')](_0x331d('0x1f'),_0x1ebc07+'-'+_0x535cdb+'/'+_0x2788be)[_0x331d('0x19')](_0x603597);}return null;};}function patchUpdates(_0x3c396f){return function(_0x390d5b){try{jsonpatch['apply'](_0x390d5b,_0x3c396f,!![]);}catch(_0x12eb8e){return BPromise[_0x331d('0x20')](_0x12eb8e);}return _0x390d5b[_0x331d('0x21')]();};}function saveUpdates(_0xc88a84,_0x12a706){return function(_0x121e77){if(_0x121e77){return _0x121e77[_0x331d('0x22')](_0xc88a84)[_0x331d('0x23')](function(_0x46f117){return _0x46f117;});}return null;};}function removeEntity(_0x50643e,_0x265fe7){return function(_0x43d423){if(_0x43d423){return _0x43d423[_0x331d('0x24')]()[_0x331d('0x23')](function(){var _0x5e18cf=_0x43d423[_0x331d('0x25')]({'plain':!![]});var _0x309236=_0x331d('0x26');return db['UserProfileResource'][_0x331d('0x24')]({'where':{'type':_0x309236,'resourceId':_0x5e18cf['id']}})[_0x331d('0x23')](function(){return _0x43d423;});})[_0x331d('0x23')](function(){_0x50643e[_0x331d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb7707d,_0xb6f3de){return function(_0xf030ec){if(!_0xf030ec){_0xb7707d[_0x331d('0x16')](0x194);}return _0xf030ec;};}function handleError(_0x2a9d44,_0x309cfa){_0x309cfa=_0x309cfa||0x1f4;return function(_0x525ea8){logger[_0x331d('0x27')](_0x525ea8[_0x331d('0x28')]);if(_0x525ea8['name']){delete _0x525ea8[_0x331d('0x29')];}_0x2a9d44['status'](_0x309cfa)['send'](_0x525ea8);};}exports[_0x331d('0x2a')]=function(_0x740f02,_0x2ea115){var _0x19a2cc={},_0x42fdbf={},_0x6ed1c1={'count':0x0,'rows':[]};var _0xe75d59=_[_0x331d('0x2b')](db[_0x331d('0x2c')]['rawAttributes'],function(_0x29321b){return{'name':_0x29321b[_0x331d('0x2d')],'type':_0x29321b[_0x331d('0x2e')][_0x331d('0x2f')]};});_0x42fdbf['model']=_[_0x331d('0x2b')](_0xe75d59,_0x331d('0x29'));_0x42fdbf['query']=_[_0x331d('0x30')](_0x740f02[_0x331d('0x31')]);_0x42fdbf['filters']=_['intersection'](_0x42fdbf['model'],_0x42fdbf['query']);_0x19a2cc['attributes']=_[_0x331d('0x32')](_0x42fdbf[_0x331d('0x33')],qs['fields'](_0x740f02[_0x331d('0x31')]['fields']));_0x19a2cc[_0x331d('0x34')]=_0x19a2cc[_0x331d('0x34')][_0x331d('0x35')]?_0x19a2cc[_0x331d('0x34')]:_0x42fdbf['model'];if(!_0x740f02[_0x331d('0x31')][_0x331d('0x36')](_0x331d('0x37'))){_0x19a2cc[_0x331d('0x1a')]=qs[_0x331d('0x1a')](_0x740f02['query'][_0x331d('0x1a')]);_0x19a2cc[_0x331d('0x1c')]=qs[_0x331d('0x1c')](_0x740f02[_0x331d('0x31')][_0x331d('0x1c')]);}_0x19a2cc[_0x331d('0x38')]=qs[_0x331d('0x39')](_0x740f02[_0x331d('0x31')][_0x331d('0x39')]);delete _0x740f02[_0x331d('0x31')][_0x331d('0x39')];_0x19a2cc[_0x331d('0x3a')]=qs[_0x331d('0x3b')](_['pick'](_0x740f02[_0x331d('0x31')],_0x42fdbf['filters']),_0xe75d59);if(_0x740f02['query'][_0x331d('0x3c')]){_0x19a2cc['where']=_[_0x331d('0x3d')](_0x19a2cc['where'],{'$or':_[_0x331d('0x2b')](_0xe75d59,function(_0x45128f){if(_0x45128f[_0x331d('0x2e')]!==_0x331d('0x3e')){var _0x1b1902={};_0x1b1902[_0x45128f[_0x331d('0x29')]]={'$like':'%'+_0x740f02[_0x331d('0x31')][_0x331d('0x3c')]+'%'};return _0x1b1902;}})});}_0x19a2cc=_[_0x331d('0x3d')]({},_0x19a2cc,_0x740f02[_0x331d('0x3f')]);var _0x4614c2={'where':_0x19a2cc['where']};return db['VoiceMusicOnHold'][_0x331d('0x1d')](_0x4614c2)[_0x331d('0x23')](function(_0x35aede){_0x6ed1c1[_0x331d('0x1d')]=_0x35aede;if(_0x740f02[_0x331d('0x31')][_0x331d('0x40')]){_0x19a2cc[_0x331d('0x41')]=[{'all':!![]}];}return db[_0x331d('0x2c')][_0x331d('0x42')](_0x19a2cc);})[_0x331d('0x23')](function(_0x5b52ab){_0x6ed1c1[_0x331d('0x43')]=_0x5b52ab;return _0x6ed1c1;})[_0x331d('0x23')](respondWithFilteredResult(_0x2ea115,_0x19a2cc))[_0x331d('0x44')](handleError(_0x2ea115,null));};exports[_0x331d('0x45')]=function(_0x5910b0,_0x5d5bc7){var _0x31bdb6={'raw':![],'where':{'id':_0x5910b0[_0x331d('0x46')]['id']}},_0x60b11e={};_0x60b11e[_0x331d('0x33')]=_[_0x331d('0x30')](db[_0x331d('0x2c')]['rawAttributes']);_0x60b11e['query']=_[_0x331d('0x30')](_0x5910b0[_0x331d('0x31')]);_0x60b11e[_0x331d('0x3b')]=_['intersection'](_0x60b11e[_0x331d('0x33')],_0x60b11e['query']);_0x31bdb6['attributes']=_[_0x331d('0x32')](_0x60b11e[_0x331d('0x33')],qs['fields'](_0x5910b0[_0x331d('0x31')][_0x331d('0x47')]));_0x31bdb6[_0x331d('0x34')]=_0x31bdb6['attributes']['length']?_0x31bdb6[_0x331d('0x34')]:_0x60b11e[_0x331d('0x33')];if(_0x5910b0['query']['includeAll']){_0x31bdb6[_0x331d('0x41')]=[{'all':!![]}];}_0x31bdb6=_[_0x331d('0x3d')]({},_0x31bdb6,_0x5910b0['options']);return db['VoiceMusicOnHold']['find'](_0x31bdb6)[_0x331d('0x23')](handleEntityNotFound(_0x5d5bc7,null))[_0x331d('0x23')](respondWithResult(_0x5d5bc7,null))[_0x331d('0x44')](handleError(_0x5d5bc7,null));};exports['update']=function(_0x1b055c,_0x469bdd){if(_0x1b055c['body']['id']){delete _0x1b055c[_0x331d('0x48')]['id'];}return db[_0x331d('0x2c')][_0x331d('0x49')]({'where':{'id':_0x1b055c['params']['id']}})['then'](handleEntityNotFound(_0x469bdd,null))[_0x331d('0x23')](saveUpdates(_0x1b055c[_0x331d('0x48')],null))[_0x331d('0x23')](respondWithResult(_0x469bdd,null))[_0x331d('0x44')](handleError(_0x469bdd,null));};exports['create']=function(_0x53631e,_0x5c3d98,_0xd89f07){return db[_0x331d('0x4a')][_0x331d('0x4b')](function(_0x41d3da){if(_0x53631e[_0x331d('0x48')]['mode']===_0x331d('0x4c')){_0x53631e[_0x331d('0x48')]['directory']=path['join'](config[_0x331d('0x4d')],_0x331d('0x4e'),_0x53631e[_0x331d('0x48')][_0x331d('0x29')]);}return db['VoiceMusicOnHold'][_0x331d('0x4f')](_0x53631e[_0x331d('0x48')],{'transaction':_0x41d3da})[_0x331d('0x23')](function(_0xb763c1){if(_0x53631e[_0x331d('0x48')][_0x331d('0x50')]===_0x331d('0x4c')){fs[_0x331d('0x51')](_0xb763c1[_0x331d('0x52')],parseInt(_0x331d('0x53'),0x8));}var _0x528703=_0x53631e[_0x331d('0x54')][_0x331d('0x25')]({'plain':!![]});if(!_0x528703)throw new Error(_0x331d('0x55'));if(_0x528703[_0x331d('0x56')]===_0x331d('0x54')){var _0x4dd2c8=_0xb763c1[_0x331d('0x25')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x331d('0x26'),'userProfileId':_0x528703['userProfileId']},'raw':!![]})[_0x331d('0x23')](function(_0x54da96){if(_0x54da96&&_0x54da96['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4dd2c8[_0x331d('0x29')],'resourceId':_0x4dd2c8['id'],'type':_0x54da96[_0x331d('0x29')],'sectionId':_0x54da96['id']},{})[_0x331d('0x23')](function(){return _0xb763c1;});}else{return _0xb763c1;}})['catch'](function(_0x2d5026){logger[_0x331d('0x27')](_0x331d('0x57'),_0x2d5026);});}return _0xb763c1;});})[_0x331d('0x23')](respondWithResult(_0x5c3d98,0xc9))[_0x331d('0x44')](handleError(_0x5c3d98,null));};exports[_0x331d('0x24')]=function(_0x594949,_0xca51de,_0x45be12){var _0x1da3d7;return db[_0x331d('0x2c')]['find']({'where':{'id':_0x594949[_0x331d('0x46')]['id']}})[_0x331d('0x23')](function(_0x18608e){if(_0x18608e){return db[_0x331d('0x4a')]['transaction'](function(_0x35ed03){return _0x18608e[_0x331d('0x24')]({'transaction':_0x35ed03,'raw':!![]})['then'](function(_0x111b32){if(_0x111b32[_0x331d('0x52')]){fs[_0x331d('0x58')](_0x111b32['directory'])[_0x331d('0x59')](function(_0x3d78a7){fs['unlinkSync'](path[_0x331d('0x5a')](_0x111b32[_0x331d('0x52')],_0x3d78a7));});fs['rmdirSync'](_0x111b32[_0x331d('0x52')]);}return _0x111b32;});})[_0x331d('0x44')](function(_0xe768b){throw new db['Sequelize'][(_0x331d('0x5b'))](_0xe768b['message']);});}})[_0x331d('0x23')](handleEntityNotFound(_0xca51de,null))[_0x331d('0x23')](removeEntity(_0xca51de,null))[_0x331d('0x44')](handleError(_0xca51de,null));};exports['addSound']=function(_0x9ab8d,_0xf9d68,_0x4821da){return db['sequelize'][_0x331d('0x4b')](function(_0x5d01df){var _0x207b5d;return db[_0x331d('0x2c')][_0x331d('0x49')]({'where':{'id':_0x9ab8d[_0x331d('0x46')]['id']}})[_0x331d('0x23')](function(_0x3c5f8e){if(_0x3c5f8e){_0x207b5d=_0x3c5f8e;return _0x3c5f8e[_0x331d('0x5c')](_0x9ab8d[_0x331d('0x48')]['id'],{'transaction':_0x5d01df});}})[_0x331d('0x23')](function(_0x59526f){if(_0x59526f){return db[_0x331d('0x5d')][_0x331d('0x5e')]({'where':{'id':_0x9ab8d['body']['id']},'attributes':['id',_0x331d('0x29'),_0x331d('0x5f'),_0x331d('0x60'),_0x331d('0x61')],'raw':!![]});}})[_0x331d('0x23')](function(_0x4a9325){if(_0x4a9325){var _0x4a3414=path[_0x331d('0x5a')](config[_0x331d('0x4d')],_0x331d('0x62'),util['format']('%s.%s',path[_0x331d('0x63')](_0x4a9325[_0x331d('0x5f')],path['extname'](_0x4a9325[_0x331d('0x5f')])),_0x4a9325[_0x331d('0x60')]));var _0x42f60c=path['join'](config[_0x331d('0x4d')],_0x331d('0x4e'),_0x207b5d['name'],util[_0x331d('0x64')](_0x331d('0x65'),_0x4a9325[_0x331d('0x29')],_0x4a9325['converted_format']));fs[_0x331d('0x66')](_0x4a3414,_0x42f60c);return _0x4a9325;}})['catch'](function(_0x419f3){throw new db[(_0x331d('0x67'))][(_0x331d('0x5b'))](_0x419f3[_0x331d('0x68')]);});})[_0x331d('0x23')](handleEntityNotFound(_0xf9d68,null))[_0x331d('0x23')](respondWithResult(_0xf9d68,0xc9))['catch'](handleError(_0xf9d68,null));};exports[_0x331d('0x69')]=function(_0x35a8ee,_0x1a463c,_0x169ae2){return db[_0x331d('0x4a')]['transaction'](function(_0x500585){var _0x2209d5;return db['VoiceMusicOnHold'][_0x331d('0x5e')]({'where':{'id':_0x35a8ee[_0x331d('0x46')]['id']}})[_0x331d('0x23')](handleEntityNotFound(_0x1a463c,null))[_0x331d('0x23')](function(_0x395cc3){if(_0x395cc3){_0x2209d5=_0x395cc3;return _0x395cc3[_0x331d('0x69')](_0x35a8ee[_0x331d('0x46')][_0x331d('0x6a')]);}})[_0x331d('0x23')](function(_0x2c8567){if(_0x2c8567){return db[_0x331d('0x5d')][_0x331d('0x5e')]({'where':{'id':_0x35a8ee['params'][_0x331d('0x6a')]},'attributes':['id','name',_0x331d('0x5f'),_0x331d('0x60'),_0x331d('0x61')],'raw':!![]});}})[_0x331d('0x23')](function(_0xe60447){if(_0xe60447){fs[_0x331d('0x6b')](path[_0x331d('0x5a')](_0x2209d5[_0x331d('0x52')],util[_0x331d('0x64')]('%s.%s',_0xe60447['name'],_0xe60447[_0x331d('0x60')])));return _0xe60447;}})['catch'](function(_0x91dc40){throw new db[(_0x331d('0x67'))][(_0x331d('0x5b'))](_0x91dc40['message']);});})[_0x331d('0x23')](handleEntityNotFound(_0x1a463c,null))[_0x331d('0x23')](respondWithStatusCode(_0x1a463c,0xcc))[_0x331d('0x44')](handleError(_0x1a463c,null));};exports[_0x331d('0x6c')]=function(_0x4392f2,_0x5ae565,_0x11a7e5){var _0x24b7a2={};var _0x160b34={};var _0x61f982;var _0x557d15;return db[_0x331d('0x2c')][_0x331d('0x5e')]({'where':{'id':_0x4392f2[_0x331d('0x46')]['id']}})[_0x331d('0x23')](handleEntityNotFound(_0x5ae565,null))[_0x331d('0x23')](function(_0x3bd274){if(_0x3bd274){_0x61f982=_0x3bd274;_0x160b34[_0x331d('0x33')]=_[_0x331d('0x30')](db[_0x331d('0x5d')][_0x331d('0x6d')]);_0x160b34[_0x331d('0x31')]=_[_0x331d('0x30')](_0x4392f2[_0x331d('0x31')]);_0x160b34[_0x331d('0x3b')]=_[_0x331d('0x32')](_0x160b34[_0x331d('0x33')],_0x160b34[_0x331d('0x31')]);_0x24b7a2[_0x331d('0x34')]=_[_0x331d('0x32')](_0x160b34[_0x331d('0x33')],qs[_0x331d('0x47')](_0x4392f2['query']['fields']));_0x24b7a2[_0x331d('0x34')]=_0x24b7a2[_0x331d('0x34')][_0x331d('0x35')]?_0x24b7a2[_0x331d('0x34')]:_0x160b34[_0x331d('0x33')];_0x24b7a2[_0x331d('0x38')]=qs[_0x331d('0x39')](_0x4392f2['query'][_0x331d('0x39')]);_0x24b7a2[_0x331d('0x3a')]=qs[_0x331d('0x3b')](_[_0x331d('0x6e')](_0x4392f2[_0x331d('0x31')],_0x160b34[_0x331d('0x3b')]));if(_0x4392f2['query'][_0x331d('0x3c')]){_0x24b7a2[_0x331d('0x3a')]=_[_0x331d('0x3d')](_0x24b7a2['where'],{'$or':_[_0x331d('0x2b')](_0x24b7a2[_0x331d('0x34')],function(_0x1184de){var _0x2f03a9={};_0x2f03a9[_0x1184de]={'$like':'%'+_0x4392f2['query'][_0x331d('0x3c')]+'%'};return _0x2f03a9;})});}_0x24b7a2=_['merge']({},_0x24b7a2,_0x4392f2[_0x331d('0x3f')]);return _0x61f982['getSounds'](_0x24b7a2);}})[_0x331d('0x23')](function(_0x3c8542){if(_0x3c8542){_0x557d15=_0x3c8542[_0x331d('0x35')];if(!_0x4392f2['query']['hasOwnProperty'](_0x331d('0x37'))){_0x24b7a2[_0x331d('0x1a')]=qs[_0x331d('0x1a')](_0x4392f2['query'][_0x331d('0x1a')]);_0x24b7a2[_0x331d('0x1c')]=qs['offset'](_0x4392f2['query']['offset']);}return _0x61f982[_0x331d('0x6c')](_0x24b7a2);}})['then'](function(_0x8accfd){if(_0x8accfd){return _0x8accfd?{'count':_0x557d15,'rows':_0x8accfd}:null;}})['then'](respondWithResult(_0x5ae565,null))[_0x331d('0x44')](handleError(_0x5ae565,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 11b06ac..9eb0909 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 _0x5d2e=['define','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x37636b,_0x1e8164){var _0x19ade3=function(_0x2b102e){while(--_0x2b102e){_0x37636b['push'](_0x37636b['shift']());}};_0x19ade3(++_0x1e8164);}(_0x5d2e,0x17d));var _0xe5d2=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x5d2e[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require(_0xe5d2('0x0'));var logger=require('../../config/logger')(_0xe5d2('0x1'));var moment=require('moment');var BPromise=require(_0xe5d2('0x2'));var rp=require(_0xe5d2('0x3'));var fs=require('fs');var path=require(_0xe5d2('0x4'));var rimraf=require(_0xe5d2('0x5'));var config=require(_0xe5d2('0x6'));var attributes=require(_0xe5d2('0x7'));module[_0xe5d2('0x8')]=function(_0x5a3b85,_0x477982){return _0x5a3b85[_0xe5d2('0x9')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa1d=['VoiceMusicOnHold','util','api','moment','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x30c32a,_0x3cd413){var _0x12f330=function(_0x2f38f3){while(--_0x2f38f3){_0x30c32a['push'](_0x30c32a['shift']());}};_0x12f330(++_0x3cd413);}(_0xaa1d,0xf4));var _0xdaa1=function(_0x36fe59,_0x244914){_0x36fe59=_0x36fe59-0x0;var _0x5a1158=_0xaa1d[_0x36fe59];return _0x5a1158;};'use strict';var _=require('lodash');var util=require(_0xdaa1('0x0'));var logger=require('../../config/logger')(_0xdaa1('0x1'));var moment=require(_0xdaa1('0x2'));var BPromise=require(_0xdaa1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdaa1('0x4'));var config=require(_0xdaa1('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xdaa1('0x6')]=function(_0x48464b,_0x38389a){return _0x48464b[_0xdaa1('0x7')](_0xdaa1('0x8'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index f5bd16d..bccbae9 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x3bb352,_0x46f078){var _0x408312=function(_0x413826){while(--_0x413826){_0x3bb352['push'](_0x3bb352['shift']());}};_0x408312(++_0x46f078);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1327f3,_0x47c691){var _0x259aa3=function(_0x5c3293){while(--_0x5c3293){_0x1327f3['push'](_0x1327f3['shift']());}};_0x259aa3(++_0x47c691);}(_0x70e0,0x17b));var _0x070e=function(_0x41a3f2,_0x709166){_0x41a3f2=_0x41a3f2-0x0;var _0x59251f=_0x70e0[_0x41a3f2];return _0x59251f;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 6972a26..3ef321d 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 _0x5127=['put','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','getTeams','post','create','addAgents','/:id/teams','addTeams'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x5127,0x64));var _0x7512=function(_0x2c4d22,_0x4ca120){_0x2c4d22=_0x2c4d22-0x0;var _0x1f0537=_0x5127[_0x2c4d22];return _0x1f0537;};'use strict';var multer=require(_0x7512('0x0'));var util=require(_0x7512('0x1'));var path=require(_0x7512('0x2'));var timeout=require(_0x7512('0x3'));var express=require('express');var router=express[_0x7512('0x4')]();var fs_extra=require(_0x7512('0x5'));var auth=require(_0x7512('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7512('0x7'));var controller=require(_0x7512('0x8'));router[_0x7512('0x9')]('/',auth[_0x7512('0xa')](),controller[_0x7512('0xb')]);router['get'](_0x7512('0xc'),auth[_0x7512('0xa')](),controller[_0x7512('0xd')]);router['get'](_0x7512('0xe'),auth[_0x7512('0xa')](),controller[_0x7512('0xf')]);router['get'](_0x7512('0x10'),auth[_0x7512('0xa')](),controller[_0x7512('0x11')]);router['get']('/:id/teams',auth[_0x7512('0xa')](),controller[_0x7512('0x12')]);router[_0x7512('0x13')]('/',auth['isAuthenticated'](),controller[_0x7512('0x14')]);router['post'](_0x7512('0x10'),auth['isAuthenticated'](),controller[_0x7512('0x15')]);router[_0x7512('0x13')](_0x7512('0x16'),auth[_0x7512('0xa')](),controller[_0x7512('0x17')]);router[_0x7512('0x18')](_0x7512('0xe'),auth['isAuthenticated'](),controller[_0x7512('0x19')]);router[_0x7512('0x1a')](_0x7512('0xe'),auth[_0x7512('0xa')](),controller[_0x7512('0x1b')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x7512('0x1c')]);router[_0x7512('0x1a')](_0x7512('0x16'),auth['isAuthenticated'](),controller[_0x7512('0x1d')]);module[_0x7512('0x1e')]=router; \ No newline at end of file +var _0xd295=['/:id/users','getAgents','getTeams','post','create','addAgents','/:id/teams','addTeams','put','/:id','update','delete','destroy','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x4348bd,_0x383a93){var _0x18bc66=function(_0x28d2e7){while(--_0x28d2e7){_0x4348bd['push'](_0x4348bd['shift']());}};_0x18bc66(++_0x383a93);}(_0xd295,0x145));var _0x5d29=function(_0x5cd832,_0x329c09){_0x5cd832=_0x5cd832-0x0;var _0x480c0e=_0xd295[_0x5cd832];return _0x480c0e;};'use strict';var multer=require(_0x5d29('0x0'));var util=require(_0x5d29('0x1'));var path=require(_0x5d29('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5d29('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5d29('0x4'));var config=require(_0x5d29('0x5'));var controller=require(_0x5d29('0x6'));router[_0x5d29('0x7')]('/',auth[_0x5d29('0x8')](),controller[_0x5d29('0x9')]);router[_0x5d29('0x7')](_0x5d29('0xa'),auth[_0x5d29('0x8')](),controller[_0x5d29('0xb')]);router[_0x5d29('0x7')]('/:id',auth[_0x5d29('0x8')](),controller[_0x5d29('0xc')]);router[_0x5d29('0x7')](_0x5d29('0xd'),auth[_0x5d29('0x8')](),controller[_0x5d29('0xe')]);router[_0x5d29('0x7')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5d29('0xf')]);router[_0x5d29('0x10')]('/',auth[_0x5d29('0x8')](),controller[_0x5d29('0x11')]);router[_0x5d29('0x10')](_0x5d29('0xd'),auth[_0x5d29('0x8')](),controller[_0x5d29('0x12')]);router[_0x5d29('0x10')](_0x5d29('0x13'),auth['isAuthenticated'](),controller[_0x5d29('0x14')]);router[_0x5d29('0x15')](_0x5d29('0x16'),auth[_0x5d29('0x8')](),controller[_0x5d29('0x17')]);router[_0x5d29('0x18')](_0x5d29('0x16'),auth[_0x5d29('0x8')](),controller[_0x5d29('0x19')]);router[_0x5d29('0x18')](_0x5d29('0xd'),auth[_0x5d29('0x8')](),controller['removeAgents']);router[_0x5d29('0x18')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index b324b0f..c5d65e0 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 _0xf36f=['sequelize','VIRTUAL','system-','STRING','INTEGER'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0xf36f,0x131));var _0xff36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf36f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xff36('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xff36('0x1')],'get':function(_0x3cd165){return _0xff36('0x2')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize[_0xff36('0x3')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xff36('0x4')]}}; \ No newline at end of file +var _0xcbfc=['VIRTUAL','getDataValue','INTEGER','STRING','name'];(function(_0x367648,_0x1ec395){var _0x4741a1=function(_0x1e7f4d){while(--_0x1e7f4d){_0x367648['push'](_0x367648['shift']());}};_0x4741a1(++_0x1ec395);}(_0xcbfc,0x80));var _0xccbf=function(_0x45810d,_0xaed5ea){_0x45810d=_0x45810d-0x0;var _0x1ea558=_0xcbfc[_0x45810d];return _0x1ea558;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xccbf('0x0')],'allowNull':![],'unique':_0xccbf('0x1')},'prefix':{'type':Sequelize[_0xccbf('0x2')],'get':function(_0xebbf32){return'system-'+this[_0xccbf('0x3')](_0xccbf('0x1'))+'-';}},'description':{'type':Sequelize[_0xccbf('0x0')]},'callerIdAll':{'type':Sequelize[_0xccbf('0x0')]},'VoiceExtensionId':{'type':Sequelize[_0xccbf('0x4')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 66498df..29acc8c 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 _0x1eba=['UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','compact','removeTeams','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','stack','name','send','index','map','VoicePrefix','fieldName','type','key','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','options','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','voicePause','flatMap','Agents','addTeams','each'];(function(_0x2c1b48,_0x4ed424){var _0xf0a21=function(_0x2bacba){while(--_0x2bacba){_0x2c1b48['push'](_0x2c1b48['shift']());}};_0xf0a21(++_0x4ed424);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x1eba[_0x1b349a];return _0x5d1f7c;};'use strict';var emlformat=require(_0xa1eb('0x0'));var rimraf=require(_0xa1eb('0x1'));var zipdir=require(_0xa1eb('0x2'));var jsonpatch=require(_0xa1eb('0x3'));var rp=require(_0xa1eb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1eb('0x5'));var util=require(_0xa1eb('0x6'));var path=require(_0xa1eb('0x7'));var sox=require(_0xa1eb('0x8'));var csv=require(_0xa1eb('0x9'));var ejs=require(_0xa1eb('0xa'));var fs=require('fs');var fs_extra=require(_0xa1eb('0xb'));var _=require(_0xa1eb('0xc'));var squel=require(_0xa1eb('0xd'));var crypto=require(_0xa1eb('0xe'));var jsforce=require(_0xa1eb('0xf'));var deskjs=require(_0xa1eb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1eb('0x11'));var Papa=require('papaparse');var Redis=require(_0xa1eb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa1eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1eb('0x14'));var logger=require('../../config/logger')(_0xa1eb('0x15'));var utils=require(_0xa1eb('0x16'));var config=require(_0xa1eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa1eb('0x18'))['db'];config[_0xa1eb('0x19')]=_['defaults'](config[_0xa1eb('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1eb('0x19')]));require('./voicePrefix.socket')[_0xa1eb('0x1a')](socket);function respondWithStatusCode(_0x2178e2,_0x14e048){_0x14e048=_0x14e048||0xcc;return function(_0x2877cb){if(_0x2877cb){return _0x2178e2[_0xa1eb('0x1b')](_0x14e048);}return _0x2178e2[_0xa1eb('0x1c')](_0x14e048)[_0xa1eb('0x1d')]();};}function respondWithResult(_0x45d6dd,_0x211e42){_0x211e42=_0x211e42||0xc8;return function(_0x4aa527){if(_0x4aa527){return _0x45d6dd[_0xa1eb('0x1c')](_0x211e42)['json'](_0x4aa527);}};}function respondWithFilteredResult(_0x1401ef,_0x3dafcd){return function(_0x33c4e3){if(_0x33c4e3){var _0x1a5d2c=typeof _0x3dafcd['offset']===_0xa1eb('0x1e')&&typeof _0x3dafcd[_0xa1eb('0x1f')]===_0xa1eb('0x1e');var _0xcf45c1=_0x33c4e3[_0xa1eb('0x20')];var _0x3b8607=_0x1a5d2c?0x0:_0x3dafcd[_0xa1eb('0x21')];var _0x166f7f=_0x1a5d2c?_0x33c4e3['count']:_0x3dafcd[_0xa1eb('0x21')]+_0x3dafcd['limit'];var _0x2258d1;if(_0x166f7f>=_0xcf45c1){_0x166f7f=_0xcf45c1;_0x2258d1=0xc8;}else{_0x2258d1=0xce;}_0x1401ef[_0xa1eb('0x1c')](_0x2258d1);return _0x1401ef[_0xa1eb('0x22')](_0xa1eb('0x23'),_0x3b8607+'-'+_0x166f7f+'/'+_0xcf45c1)['json'](_0x33c4e3);}return null;};}function patchUpdates(_0x539634){return function(_0x168221){try{jsonpatch[_0xa1eb('0x24')](_0x168221,_0x539634,!![]);}catch(_0x5b0903){return BPromise[_0xa1eb('0x25')](_0x5b0903);}return _0x168221[_0xa1eb('0x26')]();};}function saveUpdates(_0x258d3a,_0xa6b20c){return function(_0x23b49e){if(_0x23b49e){return _0x23b49e[_0xa1eb('0x27')](_0x258d3a)[_0xa1eb('0x28')](function(_0x364b1c){return _0x364b1c;});}return null;};}function removeEntity(_0xd7bb88,_0x352796){return function(_0xb77fd6){if(_0xb77fd6){return _0xb77fd6[_0xa1eb('0x29')]()['then'](function(){var _0x7c617e=_0xb77fd6[_0xa1eb('0x2a')]({'plain':!![]});var _0x491f37=_0xa1eb('0x2b');return db['UserProfileResource'][_0xa1eb('0x29')]({'where':{'type':_0x491f37,'resourceId':_0x7c617e['id']}})[_0xa1eb('0x28')](function(){return _0xb77fd6;});})['then'](function(){_0xd7bb88[_0xa1eb('0x1c')](0xcc)[_0xa1eb('0x1d')]();});}};}function handleEntityNotFound(_0x136835,_0x4f64bb){return function(_0x12cf56){if(!_0x12cf56){_0x136835[_0xa1eb('0x1b')](0x194);}return _0x12cf56;};}function handleError(_0x55f5cc,_0x273a42){_0x273a42=_0x273a42||0x1f4;return function(_0xb27bf9){logger[_0xa1eb('0x2c')](_0xb27bf9[_0xa1eb('0x2d')]);if(_0xb27bf9[_0xa1eb('0x2e')]){delete _0xb27bf9['name'];}_0x55f5cc[_0xa1eb('0x1c')](_0x273a42)[_0xa1eb('0x2f')](_0xb27bf9);};}exports[_0xa1eb('0x30')]=function(_0x2ae21d,_0x383e26){var _0xcd9efd={},_0x1d5b64={},_0xcfda64={'count':0x0,'rows':[]};var _0x254727=_[_0xa1eb('0x31')](db[_0xa1eb('0x32')]['rawAttributes'],function(_0x563b11){return{'name':_0x563b11[_0xa1eb('0x33')],'type':_0x563b11[_0xa1eb('0x34')][_0xa1eb('0x35')]};});_0x1d5b64[_0xa1eb('0x36')]=_[_0xa1eb('0x31')](_0x254727,'name');_0x1d5b64['query']=_[_0xa1eb('0x37')](_0x2ae21d[_0xa1eb('0x38')]);_0x1d5b64['filters']=_['intersection'](_0x1d5b64[_0xa1eb('0x36')],_0x1d5b64['query']);_0xcd9efd[_0xa1eb('0x39')]=_['intersection'](_0x1d5b64[_0xa1eb('0x36')],qs[_0xa1eb('0x3a')](_0x2ae21d[_0xa1eb('0x38')]['fields']));_0xcd9efd[_0xa1eb('0x39')]=_0xcd9efd[_0xa1eb('0x39')][_0xa1eb('0x3b')]?_0xcd9efd['attributes']:_0x1d5b64[_0xa1eb('0x36')];if(!_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x3c')](_0xa1eb('0x3d'))){_0xcd9efd[_0xa1eb('0x1f')]=qs['limit'](_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x1f')]);_0xcd9efd[_0xa1eb('0x21')]=qs[_0xa1eb('0x21')](_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x21')]);}_0xcd9efd[_0xa1eb('0x3e')]=qs[_0xa1eb('0x3f')](_0x2ae21d['query'][_0xa1eb('0x3f')]);_0xcd9efd[_0xa1eb('0x40')]=qs[_0xa1eb('0x41')](_[_0xa1eb('0x42')](_0x2ae21d[_0xa1eb('0x38')],_0x1d5b64['filters']),_0x254727);if(_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x43')]){_0xcd9efd[_0xa1eb('0x40')]=_['merge'](_0xcd9efd[_0xa1eb('0x40')],{'$or':_[_0xa1eb('0x31')](_0x254727,function(_0x2ae6d8){if(_0x2ae6d8[_0xa1eb('0x34')]!==_0xa1eb('0x44')){var _0x1e5b3b={};_0x1e5b3b[_0x2ae6d8[_0xa1eb('0x2e')]]={'$like':'%'+_0x2ae21d['query'][_0xa1eb('0x43')]+'%'};return _0x1e5b3b;}})});}_0xcd9efd=_[_0xa1eb('0x45')]({},_0xcd9efd,_0x2ae21d['options']);var _0xf6c04b={'where':_0xcd9efd['where']};return db[_0xa1eb('0x32')][_0xa1eb('0x20')](_0xf6c04b)[_0xa1eb('0x28')](function(_0x361675){_0xcfda64[_0xa1eb('0x20')]=_0x361675;if(_0x2ae21d[_0xa1eb('0x38')][_0xa1eb('0x46')]){_0xcd9efd[_0xa1eb('0x47')]=[{'all':!![]}];}return db[_0xa1eb('0x32')][_0xa1eb('0x48')](_0xcd9efd);})[_0xa1eb('0x28')](function(_0x3c4690){_0xcfda64[_0xa1eb('0x49')]=_0x3c4690;return _0xcfda64;})[_0xa1eb('0x28')](respondWithFilteredResult(_0x383e26,_0xcd9efd))[_0xa1eb('0x4a')](handleError(_0x383e26,null));};exports[_0xa1eb('0x4b')]=function(_0x4e068d,_0x10f983){var _0x4fd053={'raw':![],'where':{'id':_0x4e068d[_0xa1eb('0x4c')]['id']}},_0x3edc6b={};_0x3edc6b['model']=_['keys'](db[_0xa1eb('0x32')][_0xa1eb('0x4d')]);_0x3edc6b[_0xa1eb('0x38')]=_['keys'](_0x4e068d[_0xa1eb('0x38')]);_0x3edc6b[_0xa1eb('0x41')]=_[_0xa1eb('0x4e')](_0x3edc6b[_0xa1eb('0x36')],_0x3edc6b[_0xa1eb('0x38')]);_0x4fd053[_0xa1eb('0x39')]=_[_0xa1eb('0x4e')](_0x3edc6b[_0xa1eb('0x36')],qs[_0xa1eb('0x3a')](_0x4e068d[_0xa1eb('0x38')][_0xa1eb('0x3a')]));_0x4fd053[_0xa1eb('0x39')]=_0x4fd053[_0xa1eb('0x39')][_0xa1eb('0x3b')]?_0x4fd053['attributes']:_0x3edc6b[_0xa1eb('0x36')];if(_0x4e068d[_0xa1eb('0x38')][_0xa1eb('0x46')]){_0x4fd053[_0xa1eb('0x47')]=[{'all':!![]}];}_0x4fd053=_[_0xa1eb('0x45')]({},_0x4fd053,_0x4e068d[_0xa1eb('0x4f')]);return db[_0xa1eb('0x32')]['find'](_0x4fd053)[_0xa1eb('0x28')](handleEntityNotFound(_0x10f983,null))[_0xa1eb('0x28')](respondWithResult(_0x10f983,null))[_0xa1eb('0x4a')](handleError(_0x10f983,null));};exports[_0xa1eb('0x29')]=function(_0x8975a1,_0x1302f6){return db[_0xa1eb('0x32')][_0xa1eb('0x50')]({'where':{'id':_0x8975a1[_0xa1eb('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1302f6,null))[_0xa1eb('0x28')](removeEntity(_0x1302f6,null))['catch'](handleError(_0x1302f6,null));};exports[_0xa1eb('0x51')]=function(_0x495c01,_0x1a815e){return db[_0xa1eb('0x32')][_0xa1eb('0x51')]()['then'](respondWithResult(_0x1a815e,null))[_0xa1eb('0x4a')](handleError(_0x1a815e,null));};exports[_0xa1eb('0x52')]=function(_0x549c95,_0x10d6d5){var _0x2926e7;return db[_0xa1eb('0x53')][_0xa1eb('0x54')](function(_0x11cc84){return db[_0xa1eb('0x32')][_0xa1eb('0x52')](_0x549c95[_0xa1eb('0x55')],{'transaction':_0x11cc84})[_0xa1eb('0x28')](function(_0x3d9a41){_0x2926e7=_0x3d9a41[_0xa1eb('0x2a')]({'plain':!![]});return db[_0xa1eb('0x56')][_0xa1eb('0x50')]({'where':{'id':_0x2926e7[_0xa1eb('0x57')]},'raw':!![]})[_0xa1eb('0x28')](function(_0x2ba6c0){return createVoicePrefixExtensions(_0x2926e7,_0x2ba6c0,_0x11cc84);});});})[_0xa1eb('0x28')](function(){var _0x589186=_0x549c95[_0xa1eb('0x58')][_0xa1eb('0x2a')]({'plain':!![]});if(!_0x589186)throw new Error(_0xa1eb('0x59'));if(_0x589186[_0xa1eb('0x5a')]===_0xa1eb('0x58')){var _0x1f5da6=_0x2926e7;return db['UserProfileSection'][_0xa1eb('0x50')]({'where':{'name':_0xa1eb('0x2b'),'userProfileId':_0x589186[_0xa1eb('0x5b')]},'raw':!![]})[_0xa1eb('0x28')](function(_0xa46d79){if(_0xa46d79&&_0xa46d79[_0xa1eb('0x5c')]===0x0){return db[_0xa1eb('0x5d')]['create']({'name':_0x1f5da6[_0xa1eb('0x2e')],'resourceId':_0x1f5da6['id'],'type':_0xa46d79[_0xa1eb('0x2e')],'sectionId':_0xa46d79['id']},{})[_0xa1eb('0x28')](function(){return _0x2926e7;});}else{return _0x2926e7;}})[_0xa1eb('0x4a')](function(_0x4c30ad){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c30ad);throw _0x4c30ad;});}return _0x2926e7;})['then'](respondWithResult(_0x10d6d5,null))[_0xa1eb('0x4a')](handleError(_0x10d6d5,null));};function Extension(_0x1e1e5d,_0x591907,_0x4643f3,_0x3e2d2f){this[_0xa1eb('0x5e')]=_0xa1eb('0x5f');this['exten']=_0x1e1e5d;this['app']=_0x4643f3;this[_0xa1eb('0x34')]=_0xa1eb('0x60');this[_0xa1eb('0x61')]=_0xa1eb('0x62');this[_0xa1eb('0x63')]=_0x591907;this[_0xa1eb('0x64')]=_0x3e2d2f;}function createVoicePrefixExtensions(_0x51580f,_0x532dfa,_0x43f223){return new BPromise(function(_0x5afc3e,_0x3ea940){var _0x57172d=new Extension(formatPrefixName(_0x51580f[_0xa1eb('0x65')]),0x1,_0xa1eb('0x66'),'Voice\x20Prefix');_0x57172d[_0xa1eb('0x67')]=_0x51580f['id'];return db[_0xa1eb('0x56')]['create'](_0x57172d,{'transaction':_0x43f223})[_0xa1eb('0x28')](function(_0x17feb5){var _0x3b97c7=_0x17feb5['get']({'plain':!![]});var _0x9799d3=_[_0xa1eb('0x31')](addVoicePrefixExtensions(_0x51580f,_0x532dfa),function(_0x4af59a){_0x4af59a[_0xa1eb('0x57')]=_0x3b97c7['id'];_0x4af59a[_0xa1eb('0x67')]=_0x51580f['id'];return _0x4af59a;});return db[_0xa1eb('0x56')]['bulkCreate'](_0x9799d3,{'transaction':_0x43f223})[_0xa1eb('0x28')](function(_0x5aa916){if(!_0x5aa916){return _0x3ea940(_0xa1eb('0x68'));}else{return _0x5afc3e(_0x5aa916);}})[_0xa1eb('0x4a')](function(_0x40eae0){return _0x3ea940(_0x40eae0);});});;});};function addVoicePrefixExtensions(_0x331a80,_0x2df867){var _0x48f49d=[];var _0x2aba03=formatPrefixName(_0x331a80[_0xa1eb('0x65')]);_0x48f49d[_0xa1eb('0x69')](new Extension(_0x2aba03,0x2,'Set',_0xa1eb('0x6a')+_0x331a80['name']));if(_0x331a80['callerIdAll']){_0x48f49d['push'](new Extension(_0x2aba03,0x3,'Set',_0xa1eb('0x6b')+_0x331a80[_0xa1eb('0x6c')]));}else{_0x48f49d[_0xa1eb('0x69')](new Extension(_0x2aba03,0x3,_0xa1eb('0x66'),_0xa1eb('0x6d')));}_0x48f49d[_0xa1eb('0x69')](new Extension(_0x2aba03,0x4,_0xa1eb('0x6e'),_0x2df867[_0xa1eb('0x5e')]+','+_0xa1eb('0x6f')+(0x8+_0x331a80[_0xa1eb('0x2e')]['length'])+'}'+','+0x1));return _0x48f49d;}function formatPrefixName(_0x79bee8){var _0x1d1c91='_';for(var _0x46207c=0x0;_0x46207c<_0x79bee8[_0xa1eb('0x3b')];_0x46207c++){if(_0x79bee8[_0xa1eb('0x70')](_0x46207c)=='-'){_0x1d1c91+=_0x79bee8[_0xa1eb('0x70')](_0x46207c);}else{_0x1d1c91+='['+_0x79bee8['charAt'](_0x46207c)+']';}}_0x1d1c91+='.';return _0x1d1c91;}exports[_0xa1eb('0x27')]=function(_0x2b6996,_0x16c5a3,_0x58147f){var _0x1434a1=_0x2b6996[_0xa1eb('0x55')];_0x1434a1[_0xa1eb('0x65')]=_0xa1eb('0x71')+_0x1434a1[_0xa1eb('0x2e')]+'-';return db['sequelize'][_0xa1eb('0x54')](function(_0x50eff6){return db[_0xa1eb('0x32')]['update'](_0x1434a1,{'where':{'id':_0x1434a1['id']},'transaction':_0x50eff6})[_0xa1eb('0x28')](function(){return db[_0xa1eb('0x56')][_0xa1eb('0x29')]({'where':{'VoicePrefixId':_0x1434a1['id']},'transaction':_0x50eff6})[_0xa1eb('0x28')](function(){return db['VoiceExtension'][_0xa1eb('0x50')]({'where':{'id':_0x1434a1[_0xa1eb('0x57')]},'raw':!![]})[_0xa1eb('0x28')](function(_0x293f74){return createVoicePrefixExtensions(_0x1434a1,_0x293f74,_0x50eff6);});});});})['then'](function(){return db[_0xa1eb('0x32')][_0xa1eb('0x72')](_0x1434a1['id']);})[_0xa1eb('0x28')](respondWithResult(_0x16c5a3,null))[_0xa1eb('0x4a')](handleError(_0x16c5a3,null));};exports[_0xa1eb('0x73')]=function(_0x22a7cb,_0x389e44,_0x471633){return db[_0xa1eb('0x32')]['find']({'where':{'id':_0x22a7cb['params']['id']}})['then'](handleEntityNotFound(_0x389e44,null))[_0xa1eb('0x28')](function(_0x5b7785){if(_0x5b7785){return _0x5b7785[_0xa1eb('0x73')](_0x22a7cb[_0xa1eb('0x55')]['ids'],_['omit'](_0x22a7cb[_0xa1eb('0x55')],[_0xa1eb('0x74'),'id'])||{})[_0xa1eb('0x75')](function(_0x6027f7){for(var _0x470489=0x0;_0x470489<_0x22a7cb['body']['ids'][_0xa1eb('0x3b')];_0x470489+=0x1){socket[_0xa1eb('0x76')](_0xa1eb('0x77'),{'UserId':Number(_0x22a7cb[_0xa1eb('0x55')]['ids'][_0x470489]),'VoicePrefixId':Number(_0x22a7cb[_0xa1eb('0x4c')]['id'])});}return _0x6027f7;});}})[_0xa1eb('0x28')](respondWithResult(_0x389e44,null))[_0xa1eb('0x4a')](handleError(_0x389e44,null));};exports[_0xa1eb('0x78')]=function(_0x3863ce,_0x37d8c4,_0x3fd52a){return db[_0xa1eb('0x32')][_0xa1eb('0x50')]({'where':{'id':_0x3863ce[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](handleEntityNotFound(_0x37d8c4,null))['then'](function(_0x21d884){if(_0x21d884){return _0x21d884[_0xa1eb('0x78')](_0x3863ce[_0xa1eb('0x38')][_0xa1eb('0x74')])[_0xa1eb('0x28')](function(){if(_[_0xa1eb('0x79')](_0x3863ce['query'][_0xa1eb('0x74')])){for(var _0x36a94f=0x0;_0x36a94f<_0x3863ce[_0xa1eb('0x38')][_0xa1eb('0x74')]['length'];_0x36a94f+=0x1){socket['emit'](_0xa1eb('0x7a'),{'UserId':Number(_0x3863ce['query'][_0xa1eb('0x74')][_0x36a94f]),'VoicePrefixId':Number(_0x3863ce[_0xa1eb('0x4c')]['id'])});}}else{socket['emit'](_0xa1eb('0x7a'),{'UserId':Number(_0x3863ce[_0xa1eb('0x38')]['ids']),'VoicePrefixId':Number(_0x3863ce[_0xa1eb('0x4c')]['id'])});}});}})[_0xa1eb('0x28')](respondWithStatusCode(_0x37d8c4,null))[_0xa1eb('0x4a')](handleError(_0x37d8c4,null));};exports[_0xa1eb('0x7b')]=function(_0x3d9034,_0x20cf70,_0x824123){var _0x2ce2e1={};var _0x3d32da={};var _0x64943f;var _0x3b4851;return db['VoicePrefix'][_0xa1eb('0x7c')]({'where':{'id':_0x3d9034[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](handleEntityNotFound(_0x20cf70,null))[_0xa1eb('0x28')](function(_0x49e563){if(_0x49e563){_0x64943f=_0x49e563;_0x3d32da[_0xa1eb('0x36')]=_[_0xa1eb('0x37')](db[_0xa1eb('0x7d')]['rawAttributes']);_0x3d32da[_0xa1eb('0x38')]=_[_0xa1eb('0x37')](_0x3d9034[_0xa1eb('0x38')]);_0x3d32da['filters']=_[_0xa1eb('0x4e')](_0x3d32da['model'],_0x3d32da[_0xa1eb('0x38')]);_0x2ce2e1[_0xa1eb('0x39')]=_[_0xa1eb('0x4e')](_0x3d32da[_0xa1eb('0x36')],qs[_0xa1eb('0x3a')](_0x3d9034[_0xa1eb('0x38')][_0xa1eb('0x3a')]));_0x2ce2e1[_0xa1eb('0x39')]=_0x2ce2e1['attributes'][_0xa1eb('0x3b')]?_0x2ce2e1[_0xa1eb('0x39')]:_0x3d32da[_0xa1eb('0x36')];_0x2ce2e1[_0xa1eb('0x3e')]=qs[_0xa1eb('0x3f')](_0x3d9034['query'][_0xa1eb('0x3f')]);_0x2ce2e1[_0xa1eb('0x40')]=qs['filters'](_[_0xa1eb('0x42')](_0x3d9034['query'],_0x3d32da['filters']));if(_0x3d9034[_0xa1eb('0x38')][_0xa1eb('0x43')]){_0x2ce2e1['where']=_[_0xa1eb('0x45')](_0x2ce2e1[_0xa1eb('0x40')],{'$or':_['map'](_0x2ce2e1[_0xa1eb('0x39')],function(_0x2c49d1){var _0x4d2598={};_0x4d2598[_0x2c49d1]={'$like':'%'+_0x3d9034['query'][_0xa1eb('0x43')]+'%'};return _0x4d2598;})});}_0x2ce2e1=_['merge']({},_0x2ce2e1,_0x3d9034[_0xa1eb('0x4f')]);return _0x64943f[_0xa1eb('0x7b')](_0x2ce2e1);}})[_0xa1eb('0x28')](function(_0x316a75){if(_0x316a75){_0x3b4851=_0x316a75[_0xa1eb('0x3b')];if(!_0x3d9034[_0xa1eb('0x38')]['hasOwnProperty'](_0xa1eb('0x3d'))){_0x2ce2e1['limit']=qs[_0xa1eb('0x1f')](_0x3d9034[_0xa1eb('0x38')][_0xa1eb('0x1f')]);_0x2ce2e1[_0xa1eb('0x21')]=qs[_0xa1eb('0x21')](_0x3d9034[_0xa1eb('0x38')][_0xa1eb('0x21')]);}return _0x64943f['getAgents'](_0x2ce2e1);}})[_0xa1eb('0x28')](function(_0x4effc0){if(_0x4effc0){return _0x4effc0?{'count':_0x3b4851,'rows':_0x4effc0}:null;}})['then'](respondWithResult(_0x20cf70,null))[_0xa1eb('0x4a')](handleError(_0x20cf70,null));};exports[_0xa1eb('0x7e')]=function(_0x456ddb,_0x559d58,_0x14eff1){var _0x717fbf={};var _0x5ef8c1={};var _0x2dd909;var _0x58d694;return db[_0xa1eb('0x32')]['findOne']({'where':{'id':_0x456ddb[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](handleEntityNotFound(_0x559d58,null))['then'](function(_0x52c3d6){if(_0x52c3d6){_0x2dd909=_0x52c3d6;_0x5ef8c1[_0xa1eb('0x36')]=_[_0xa1eb('0x37')](db[_0xa1eb('0x7f')][_0xa1eb('0x4d')]);_0x5ef8c1[_0xa1eb('0x38')]=_[_0xa1eb('0x37')](_0x456ddb[_0xa1eb('0x38')]);_0x5ef8c1[_0xa1eb('0x41')]=_[_0xa1eb('0x4e')](_0x5ef8c1[_0xa1eb('0x36')],_0x5ef8c1[_0xa1eb('0x38')]);_0x717fbf[_0xa1eb('0x39')]=_[_0xa1eb('0x4e')](_0x5ef8c1[_0xa1eb('0x36')],qs[_0xa1eb('0x3a')](_0x456ddb['query'][_0xa1eb('0x3a')]));_0x717fbf[_0xa1eb('0x39')]=_0x717fbf['attributes'][_0xa1eb('0x3b')]?_0x717fbf['attributes']:_0x5ef8c1[_0xa1eb('0x36')];_0x717fbf[_0xa1eb('0x3e')]=qs[_0xa1eb('0x3f')](_0x456ddb['query'][_0xa1eb('0x3f')]);_0x717fbf[_0xa1eb('0x40')]=qs[_0xa1eb('0x41')](_[_0xa1eb('0x42')](_0x456ddb['query'],_0x5ef8c1[_0xa1eb('0x41')]));if(_0x456ddb['query'][_0xa1eb('0x43')]){_0x717fbf[_0xa1eb('0x40')]=_[_0xa1eb('0x45')](_0x717fbf[_0xa1eb('0x40')],{'$or':_[_0xa1eb('0x31')](_0x717fbf[_0xa1eb('0x39')],function(_0xc27d40){var _0x1e3d9c={};_0x1e3d9c[_0xc27d40]={'$like':'%'+_0x456ddb['query'][_0xa1eb('0x43')]+'%'};return _0x1e3d9c;})});}_0x717fbf=_[_0xa1eb('0x45')]({},_0x717fbf,_0x456ddb[_0xa1eb('0x4f')]);return _0x2dd909[_0xa1eb('0x7e')](_0x717fbf);}})[_0xa1eb('0x28')](function(_0x322728){if(_0x322728){_0x58d694=_0x322728[_0xa1eb('0x3b')];if(!_0x456ddb[_0xa1eb('0x38')][_0xa1eb('0x3c')](_0xa1eb('0x3d'))){_0x717fbf[_0xa1eb('0x1f')]=qs[_0xa1eb('0x1f')](_0x456ddb[_0xa1eb('0x38')][_0xa1eb('0x1f')]);_0x717fbf['offset']=qs[_0xa1eb('0x21')](_0x456ddb[_0xa1eb('0x38')]['offset']);}return _0x2dd909['getTeams'](_0x717fbf);}})[_0xa1eb('0x28')](function(_0x106dd9){if(_0x106dd9){return _0x106dd9?{'count':_0x58d694,'rows':_0x106dd9}:null;}})[_0xa1eb('0x28')](respondWithResult(_0x559d58,null))[_0xa1eb('0x4a')](handleError(_0x559d58,null));};exports['addTeams']=function(_0x402acb,_0x49441f,_0x3ad4ca){var _0x2151a8=_0x402acb[_0xa1eb('0x55')][_0xa1eb('0x74')];var _0x33a90e;return db[_0xa1eb('0x7f')][_0xa1eb('0x48')]({'where':{'id':_0x2151a8},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online',_0xa1eb('0x80'),'interface'],'raw':!![]}]})[_0xa1eb('0x28')](function(_0x2c97f8){if(_0x2c97f8){_0x33a90e=_0x2c97f8;var _0x1c1a59=_[_0xa1eb('0x81')](_0x2c97f8,function(_0x438746){var _0x16528e=_0x438746[_0xa1eb('0x2a')]({'plain':!![]});return _0x16528e[_0xa1eb('0x82')];});return db[_0xa1eb('0x32')][_0xa1eb('0x50')]({'where':{'id':_0x402acb[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](function(_0x3d9f66){return db[_0xa1eb('0x53')][_0xa1eb('0x54')](function(_0x562666){return _0x3d9f66[_0xa1eb('0x83')](_0x2151a8,{'transaction':_0x562666})['then'](function(){return BPromise[_0xa1eb('0x84')](_0x33a90e,function(_0x230a07){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x230a07['id'],'VoicePrefixId':_0x402acb[_0xa1eb('0x4c')]['id']},{'transaction':_0x562666});});})[_0xa1eb('0x28')](function(){return BPromise[_0xa1eb('0x84')](_0x1c1a59,function(_0x38451d){return db[_0xa1eb('0x85')][_0xa1eb('0x86')]({'where':{'UserId':_0x38451d['id'],'VoicePrefixId':_0x402acb['params']['id']},'transaction':_0x562666});});})[_0xa1eb('0x28')](function(){_0x1c1a59[_0xa1eb('0x87')](function(_0x11d0ab){socket[_0xa1eb('0x76')](_0xa1eb('0x77'),{'UserId':_0x11d0ab['id'],'VoicePrefixId':_0x3d9f66['id']});});});});});}})[_0xa1eb('0x28')](respondWithStatusCode(_0x49441f,null))[_0xa1eb('0x4a')](handleError(_0x49441f,null));};exports['removeTeams']=function(_0x37e2d5,_0x1cfec1,_0x4d9d0b){return db['Team'][_0xa1eb('0x48')]({'where':{'id':_0x37e2d5['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa1eb('0x7d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa1eb('0x28')](handleEntityNotFound(_0x1cfec1,null))[_0xa1eb('0x28')](function(_0x5b8b32){var _0xe47df5=_[_0xa1eb('0x31')](_0x5b8b32,'id');var _0x382643=[];var _0x89e33c=[];var _0x4f535b=squel[_0xa1eb('0x88')]();_0x4f535b[_0xa1eb('0x89')](_0xa1eb('0x8a'))[_0xa1eb('0x8b')](_0xa1eb('0x8c'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa1eb('0x40')](_0xa1eb('0x8d'),_0x37e2d5[_0xa1eb('0x4c')]['id']);for(var _0x3da094=0x0;_0x3da094<_0x5b8b32[_0xa1eb('0x3b')];_0x3da094+=0x1){let _0x41e608=_0x5b8b32[_0x3da094];for(var _0x934746=0x0;_0x934746<_0x41e608[_0xa1eb('0x82')][_0xa1eb('0x3b')];_0x934746+=0x1){let _0x34e1ae=_0x41e608[_0xa1eb('0x82')][_0x934746];var _0x368e4e=_0x4f535b[_0xa1eb('0x8e')]();_0x368e4e[_0xa1eb('0x40')](_0xa1eb('0x8f'),_0x34e1ae['id']);_0x89e33c[_0xa1eb('0x69')](db[_0xa1eb('0x53')]['query'](_0x368e4e[_0xa1eb('0x90')](),{'type':db[_0xa1eb('0x53')]['QueryTypes'][_0xa1eb('0x91')]})[_0xa1eb('0x28')](function(_0x155a90){if(_0x155a90[_0xa1eb('0x3b')]===0x1){return _0x34e1ae['id'];}else{var _0x1d018a=_['every'](_['map'](_0x155a90,_0xa1eb('0x92')),function(_0x4ab784){return _[_0xa1eb('0x93')](_0xe47df5,_0x4ab784);});if(_0x1d018a){return _0x34e1ae['id'];}}}));}}return BPromise[_0xa1eb('0x94')](_0x89e33c)['then'](function(_0x4e3121){_0x382643=_(_0x382643)['union'](_0x4e3121)[_0xa1eb('0x95')]()['value']();return db[_0xa1eb('0x32')][_0xa1eb('0x50')]({'where':{'id':_0x37e2d5[_0xa1eb('0x4c')]['id']}})[_0xa1eb('0x28')](function(_0x29ecae){return db[_0xa1eb('0x53')][_0xa1eb('0x54')](function(_0x5a0dd4){return _0x29ecae[_0xa1eb('0x96')](_0x37e2d5[_0xa1eb('0x38')][_0xa1eb('0x74')],{'transaction':_0x5a0dd4})['then'](function(){if(!_['isEmpty'](_0x382643)){return _0x29ecae[_0xa1eb('0x78')](_0x382643,{'transaction':_0x5a0dd4});}})[_0xa1eb('0x28')](function(){_0x382643[_0xa1eb('0x87')](function(_0x42720b){socket[_0xa1eb('0x76')]('userVoicePrefix:remove',{'UserId':_0x42720b,'VoicePrefixId':_0x29ecae['id']});});});});});});})[_0xa1eb('0x28')](respondWithStatusCode(_0x1cfec1,null))['catch'](handleError(_0x1cfec1,null));}; \ No newline at end of file +var _0x2032=['sequelize','body','VoiceExtension','user','VoicePrefixes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','goto','charAt','system-','transaction','findById','ids','omit','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','sort','nolimit','Team','getTeams','addTeams','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','findOrCreate','forEach','userVoicePrefix:save','removeTeams','User','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','QueryTypes','SELECT','TeamId','includes','all','union','compact','isEmpty','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','sendStatus','status','end','offset','limit','count','set','json','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','VoicePrefix','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','describe','create'];(function(_0x5075db,_0x102927){var _0x5aeae1=function(_0x22d94e){while(--_0x22d94e){_0x5075db['push'](_0x5075db['shift']());}};_0x5aeae1(++_0x102927);}(_0x2032,0xd9));var _0x2203=function(_0x73d52a,_0x407758){_0x73d52a=_0x73d52a-0x0;var _0x3c1f53=_0x2032[_0x73d52a];return _0x3c1f53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2203('0x18')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x21a3af,_0x472265){_0x472265=_0x472265||0xcc;return function(_0x1c1ead){if(_0x1c1ead){return _0x21a3af[_0x2203('0x19')](_0x472265);}return _0x21a3af[_0x2203('0x1a')](_0x472265)[_0x2203('0x1b')]();};}function respondWithResult(_0x2c36e6,_0x2c085c){_0x2c085c=_0x2c085c||0xc8;return function(_0xdf9d0b){if(_0xdf9d0b){return _0x2c36e6[_0x2203('0x1a')](_0x2c085c)['json'](_0xdf9d0b);}};}function respondWithFilteredResult(_0x280eda,_0x2ee127){return function(_0x4893ff){if(_0x4893ff){var _0x3f9ef6=typeof _0x2ee127[_0x2203('0x1c')]==='undefined'&&typeof _0x2ee127[_0x2203('0x1d')]==='undefined';var _0x2904ba=_0x4893ff[_0x2203('0x1e')];var _0x3c8c34=_0x3f9ef6?0x0:_0x2ee127[_0x2203('0x1c')];var _0x15cb1a=_0x3f9ef6?_0x4893ff[_0x2203('0x1e')]:_0x2ee127['offset']+_0x2ee127[_0x2203('0x1d')];var _0x50822b;if(_0x15cb1a>=_0x2904ba){_0x15cb1a=_0x2904ba;_0x50822b=0xc8;}else{_0x50822b=0xce;}_0x280eda['status'](_0x50822b);return _0x280eda[_0x2203('0x1f')]('Content-Range',_0x3c8c34+'-'+_0x15cb1a+'/'+_0x2904ba)[_0x2203('0x20')](_0x4893ff);}return null;};}function patchUpdates(_0x5bfe61){return function(_0x5d4c4e){try{jsonpatch[_0x2203('0x21')](_0x5d4c4e,_0x5bfe61,!![]);}catch(_0x5e29cd){return BPromise['reject'](_0x5e29cd);}return _0x5d4c4e[_0x2203('0x22')]();};}function saveUpdates(_0x2718f5,_0x21f930){return function(_0xfd0970){if(_0xfd0970){return _0xfd0970[_0x2203('0x23')](_0x2718f5)[_0x2203('0x24')](function(_0x49c12){return _0x49c12;});}return null;};}function removeEntity(_0x250349,_0x576378){return function(_0x143f41){if(_0x143f41){return _0x143f41[_0x2203('0x25')]()[_0x2203('0x24')](function(){var _0x5f11bf=_0x143f41[_0x2203('0x26')]({'plain':!![]});var _0x1cec17='VoicePrefixes';return db[_0x2203('0x27')][_0x2203('0x25')]({'where':{'type':_0x1cec17,'resourceId':_0x5f11bf['id']}})[_0x2203('0x24')](function(){return _0x143f41;});})[_0x2203('0x24')](function(){_0x250349[_0x2203('0x1a')](0xcc)[_0x2203('0x1b')]();});}};}function handleEntityNotFound(_0x9c53f,_0x5a95c1){return function(_0x34b8ba){if(!_0x34b8ba){_0x9c53f[_0x2203('0x19')](0x194);}return _0x34b8ba;};}function handleError(_0x406ce9,_0x74f035){_0x74f035=_0x74f035||0x1f4;return function(_0x52a426){logger[_0x2203('0x28')](_0x52a426[_0x2203('0x29')]);if(_0x52a426[_0x2203('0x2a')]){delete _0x52a426[_0x2203('0x2a')];}_0x406ce9['status'](_0x74f035)[_0x2203('0x2b')](_0x52a426);};}exports[_0x2203('0x2c')]=function(_0x5e6560,_0x5c0157){var _0x1d5f74={},_0x52fafc={},_0x58b44d={'count':0x0,'rows':[]};var _0x125dfc=_[_0x2203('0x2d')](db[_0x2203('0x2e')][_0x2203('0x2f')],function(_0xf2801d){return{'name':_0xf2801d['fieldName'],'type':_0xf2801d[_0x2203('0x30')][_0x2203('0x31')]};});_0x52fafc['model']=_[_0x2203('0x2d')](_0x125dfc,_0x2203('0x2a'));_0x52fafc[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5e6560[_0x2203('0x32')]);_0x52fafc[_0x2203('0x34')]=_[_0x2203('0x35')](_0x52fafc[_0x2203('0x36')],_0x52fafc[_0x2203('0x32')]);_0x1d5f74['attributes']=_[_0x2203('0x35')](_0x52fafc[_0x2203('0x36')],qs['fields'](_0x5e6560['query'][_0x2203('0x37')]));_0x1d5f74['attributes']=_0x1d5f74[_0x2203('0x38')][_0x2203('0x39')]?_0x1d5f74[_0x2203('0x38')]:_0x52fafc['model'];if(!_0x5e6560['query'][_0x2203('0x3a')]('nolimit')){_0x1d5f74[_0x2203('0x1d')]=qs['limit'](_0x5e6560[_0x2203('0x32')]['limit']);_0x1d5f74[_0x2203('0x1c')]=qs[_0x2203('0x1c')](_0x5e6560[_0x2203('0x32')][_0x2203('0x1c')]);}_0x1d5f74[_0x2203('0x3b')]=qs['sort'](_0x5e6560['query']['sort']);_0x1d5f74[_0x2203('0x3c')]=qs[_0x2203('0x34')](_[_0x2203('0x3d')](_0x5e6560[_0x2203('0x32')],_0x52fafc[_0x2203('0x34')]),_0x125dfc);if(_0x5e6560[_0x2203('0x32')][_0x2203('0x3e')]){_0x1d5f74['where']=_[_0x2203('0x3f')](_0x1d5f74[_0x2203('0x3c')],{'$or':_[_0x2203('0x2d')](_0x125dfc,function(_0x26be74){if(_0x26be74['type']!=='VIRTUAL'){var _0x3ddfe0={};_0x3ddfe0[_0x26be74['name']]={'$like':'%'+_0x5e6560[_0x2203('0x32')][_0x2203('0x3e')]+'%'};return _0x3ddfe0;}})});}_0x1d5f74=_[_0x2203('0x3f')]({},_0x1d5f74,_0x5e6560['options']);var _0x5bba52={'where':_0x1d5f74[_0x2203('0x3c')]};return db[_0x2203('0x2e')][_0x2203('0x1e')](_0x5bba52)[_0x2203('0x24')](function(_0x372709){_0x58b44d[_0x2203('0x1e')]=_0x372709;if(_0x5e6560['query'][_0x2203('0x40')]){_0x1d5f74[_0x2203('0x41')]=[{'all':!![]}];}return db[_0x2203('0x2e')][_0x2203('0x42')](_0x1d5f74);})[_0x2203('0x24')](function(_0x36b99f){_0x58b44d[_0x2203('0x43')]=_0x36b99f;return _0x58b44d;})[_0x2203('0x24')](respondWithFilteredResult(_0x5c0157,_0x1d5f74))[_0x2203('0x44')](handleError(_0x5c0157,null));};exports[_0x2203('0x45')]=function(_0x595281,_0x2e2ca5){var _0x24e773={'raw':![],'where':{'id':_0x595281[_0x2203('0x46')]['id']}},_0x4aab80={};_0x4aab80['model']=_['keys'](db[_0x2203('0x2e')]['rawAttributes']);_0x4aab80[_0x2203('0x32')]=_[_0x2203('0x33')](_0x595281[_0x2203('0x32')]);_0x4aab80[_0x2203('0x34')]=_['intersection'](_0x4aab80[_0x2203('0x36')],_0x4aab80[_0x2203('0x32')]);_0x24e773['attributes']=_[_0x2203('0x35')](_0x4aab80[_0x2203('0x36')],qs[_0x2203('0x37')](_0x595281[_0x2203('0x32')]['fields']));_0x24e773['attributes']=_0x24e773[_0x2203('0x38')]['length']?_0x24e773['attributes']:_0x4aab80[_0x2203('0x36')];if(_0x595281[_0x2203('0x32')][_0x2203('0x40')]){_0x24e773['include']=[{'all':!![]}];}_0x24e773=_['merge']({},_0x24e773,_0x595281[_0x2203('0x47')]);return db[_0x2203('0x2e')][_0x2203('0x48')](_0x24e773)[_0x2203('0x24')](handleEntityNotFound(_0x2e2ca5,null))[_0x2203('0x24')](respondWithResult(_0x2e2ca5,null))[_0x2203('0x44')](handleError(_0x2e2ca5,null));};exports['destroy']=function(_0x747dce,_0x557659){return db[_0x2203('0x2e')][_0x2203('0x48')]({'where':{'id':_0x747dce[_0x2203('0x46')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x557659,null))['then'](removeEntity(_0x557659,null))['catch'](handleError(_0x557659,null));};exports[_0x2203('0x49')]=function(_0x1f772d,_0x126aad){return db[_0x2203('0x2e')]['describe']()['then'](respondWithResult(_0x126aad,null))['catch'](handleError(_0x126aad,null));};exports[_0x2203('0x4a')]=function(_0x1c2734,_0x57b891){var _0x7f61df;return db[_0x2203('0x4b')]['transaction'](function(_0x32b1db){return db[_0x2203('0x2e')][_0x2203('0x4a')](_0x1c2734[_0x2203('0x4c')],{'transaction':_0x32b1db})['then'](function(_0x120db1){_0x7f61df=_0x120db1['get']({'plain':!![]});return db[_0x2203('0x4d')][_0x2203('0x48')]({'where':{'id':_0x7f61df['VoiceExtensionId']},'raw':!![]})[_0x2203('0x24')](function(_0x8d089e){return createVoicePrefixExtensions(_0x7f61df,_0x8d089e,_0x32b1db);});});})[_0x2203('0x24')](function(){var _0x378132=_0x1c2734[_0x2203('0x4e')][_0x2203('0x26')]({'plain':!![]});if(!_0x378132)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x378132['role']===_0x2203('0x4e')){var _0x524356=_0x7f61df;return db['UserProfileSection'][_0x2203('0x48')]({'where':{'name':_0x2203('0x4f'),'userProfileId':_0x378132[_0x2203('0x50')]},'raw':!![]})['then'](function(_0x213c24){if(_0x213c24&&_0x213c24['autoAssociation']===0x0){return db['UserProfileResource'][_0x2203('0x4a')]({'name':_0x524356['name'],'resourceId':_0x524356['id'],'type':_0x213c24['name'],'sectionId':_0x213c24['id']},{})['then'](function(){return _0x7f61df;});}else{return _0x7f61df;}})[_0x2203('0x44')](function(_0x31256b){logger[_0x2203('0x28')](_0x2203('0x51'),_0x31256b);throw _0x31256b;});}return _0x7f61df;})[_0x2203('0x24')](respondWithResult(_0x57b891,null))[_0x2203('0x44')](handleError(_0x57b891,null));};function Extension(_0x2baea2,_0x91f70c,_0x36b5fb,_0x216641){this[_0x2203('0x52')]=_0x2203('0x53');this['exten']=_0x2baea2;this['app']=_0x36b5fb;this[_0x2203('0x30')]=_0x2203('0x54');this[_0x2203('0x55')]=_0x2203('0x56');this[_0x2203('0x57')]=_0x91f70c;this[_0x2203('0x58')]=_0x216641;}function createVoicePrefixExtensions(_0x4f8b8e,_0x5486f9,_0xb49120){return new BPromise(function(_0x34358e,_0x21ee59){var _0x1e6d21=new Extension(formatPrefixName(_0x4f8b8e[_0x2203('0x59')]),0x1,_0x2203('0x5a'),_0x2203('0x5b'));_0x1e6d21[_0x2203('0x5c')]=_0x4f8b8e['id'];return db[_0x2203('0x4d')][_0x2203('0x4a')](_0x1e6d21,{'transaction':_0xb49120})[_0x2203('0x24')](function(_0x48bed1){var _0x1ea97a=_0x48bed1[_0x2203('0x26')]({'plain':!![]});var _0x3ce9f5=_[_0x2203('0x2d')](addVoicePrefixExtensions(_0x4f8b8e,_0x5486f9),function(_0x41a938){_0x41a938[_0x2203('0x5d')]=_0x1ea97a['id'];_0x41a938[_0x2203('0x5c')]=_0x4f8b8e['id'];return _0x41a938;});return db[_0x2203('0x4d')][_0x2203('0x5e')](_0x3ce9f5,{'transaction':_0xb49120})[_0x2203('0x24')](function(_0x49e795){if(!_0x49e795){return _0x21ee59(_0x2203('0x5f'));}else{return _0x34358e(_0x49e795);}})[_0x2203('0x44')](function(_0x24179a){return _0x21ee59(_0x24179a);});});;});};function addVoicePrefixExtensions(_0xc193b7,_0x34e820){var _0x1e44c=[];var _0x1068bc=formatPrefixName(_0xc193b7[_0x2203('0x59')]);_0x1e44c[_0x2203('0x60')](new Extension(_0x1068bc,0x2,'Set',_0x2203('0x61')+_0xc193b7[_0x2203('0x2a')]));if(_0xc193b7[_0x2203('0x62')]){_0x1e44c['push'](new Extension(_0x1068bc,0x3,_0x2203('0x63'),_0x2203('0x64')+_0xc193b7[_0x2203('0x62')]));}else{_0x1e44c[_0x2203('0x60')](new Extension(_0x1068bc,0x3,_0x2203('0x5a'),'No\x20callerid\x20available'));}_0x1e44c[_0x2203('0x60')](new Extension(_0x1068bc,0x4,_0x2203('0x65'),_0x34e820[_0x2203('0x52')]+','+'${EXTEN:'+(0x8+_0xc193b7['name']['length'])+'}'+','+0x1));return _0x1e44c;}function formatPrefixName(_0x485e5b){var _0x595814='_';for(var _0x418d48=0x0;_0x418d48<_0x485e5b[_0x2203('0x39')];_0x418d48++){if(_0x485e5b[_0x2203('0x66')](_0x418d48)=='-'){_0x595814+=_0x485e5b[_0x2203('0x66')](_0x418d48);}else{_0x595814+='['+_0x485e5b[_0x2203('0x66')](_0x418d48)+']';}}_0x595814+='.';return _0x595814;}exports[_0x2203('0x23')]=function(_0x3f7926,_0x44bea0,_0x56dcbe){var _0x500860=_0x3f7926[_0x2203('0x4c')];_0x500860[_0x2203('0x59')]=_0x2203('0x67')+_0x500860[_0x2203('0x2a')]+'-';return db[_0x2203('0x4b')][_0x2203('0x68')](function(_0x45cc3a){return db[_0x2203('0x2e')][_0x2203('0x23')](_0x500860,{'where':{'id':_0x500860['id']},'transaction':_0x45cc3a})[_0x2203('0x24')](function(){return db[_0x2203('0x4d')][_0x2203('0x25')]({'where':{'VoicePrefixId':_0x500860['id']},'transaction':_0x45cc3a})[_0x2203('0x24')](function(){return db[_0x2203('0x4d')][_0x2203('0x48')]({'where':{'id':_0x500860[_0x2203('0x5d')]},'raw':!![]})[_0x2203('0x24')](function(_0x173ac1){return createVoicePrefixExtensions(_0x500860,_0x173ac1,_0x45cc3a);});});});})[_0x2203('0x24')](function(){return db['VoicePrefix'][_0x2203('0x69')](_0x500860['id']);})['then'](respondWithResult(_0x44bea0,null))[_0x2203('0x44')](handleError(_0x44bea0,null));};exports['addAgents']=function(_0x5ba500,_0xf71e7e,_0x269649){return db[_0x2203('0x2e')][_0x2203('0x48')]({'where':{'id':_0x5ba500[_0x2203('0x46')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0xf71e7e,null))[_0x2203('0x24')](function(_0x4e9a01){if(_0x4e9a01){return _0x4e9a01['addAgents'](_0x5ba500[_0x2203('0x4c')][_0x2203('0x6a')],_[_0x2203('0x6b')](_0x5ba500['body'],['ids','id'])||{})['spread'](function(_0xdff006){for(var _0x2d26ba=0x0;_0x2d26ba<_0x5ba500[_0x2203('0x4c')][_0x2203('0x6a')]['length'];_0x2d26ba+=0x1){socket[_0x2203('0x6c')]('userVoicePrefix:save',{'UserId':Number(_0x5ba500[_0x2203('0x4c')][_0x2203('0x6a')][_0x2d26ba]),'VoicePrefixId':Number(_0x5ba500[_0x2203('0x46')]['id'])});}return _0xdff006;});}})[_0x2203('0x24')](respondWithResult(_0xf71e7e,null))[_0x2203('0x44')](handleError(_0xf71e7e,null));};exports['removeAgents']=function(_0x4592fa,_0x247f26,_0x18663f){return db['VoicePrefix'][_0x2203('0x48')]({'where':{'id':_0x4592fa[_0x2203('0x46')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x247f26,null))[_0x2203('0x24')](function(_0x1c65f9){if(_0x1c65f9){return _0x1c65f9[_0x2203('0x6d')](_0x4592fa[_0x2203('0x32')][_0x2203('0x6a')])[_0x2203('0x24')](function(){if(_[_0x2203('0x6e')](_0x4592fa[_0x2203('0x32')]['ids'])){for(var _0x1adfa6=0x0;_0x1adfa6<_0x4592fa[_0x2203('0x32')][_0x2203('0x6a')][_0x2203('0x39')];_0x1adfa6+=0x1){socket[_0x2203('0x6c')](_0x2203('0x6f'),{'UserId':Number(_0x4592fa[_0x2203('0x32')][_0x2203('0x6a')][_0x1adfa6]),'VoicePrefixId':Number(_0x4592fa[_0x2203('0x46')]['id'])});}}else{socket[_0x2203('0x6c')](_0x2203('0x6f'),{'UserId':Number(_0x4592fa[_0x2203('0x32')]['ids']),'VoicePrefixId':Number(_0x4592fa['params']['id'])});}});}})[_0x2203('0x24')](respondWithStatusCode(_0x247f26,null))[_0x2203('0x44')](handleError(_0x247f26,null));};exports[_0x2203('0x70')]=function(_0xb6863b,_0x42dce6,_0x4fd029){var _0x16e518={};var _0x3cb792={};var _0x4e539b;var _0x511689;return db['VoicePrefix']['findOne']({'where':{'id':_0xb6863b['params']['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x42dce6,null))[_0x2203('0x24')](function(_0x437095){if(_0x437095){_0x4e539b=_0x437095;_0x3cb792['model']=_['keys'](db['User'][_0x2203('0x2f')]);_0x3cb792[_0x2203('0x32')]=_[_0x2203('0x33')](_0xb6863b[_0x2203('0x32')]);_0x3cb792[_0x2203('0x34')]=_[_0x2203('0x35')](_0x3cb792[_0x2203('0x36')],_0x3cb792['query']);_0x16e518[_0x2203('0x38')]=_[_0x2203('0x35')](_0x3cb792[_0x2203('0x36')],qs[_0x2203('0x37')](_0xb6863b[_0x2203('0x32')][_0x2203('0x37')]));_0x16e518[_0x2203('0x38')]=_0x16e518['attributes'][_0x2203('0x39')]?_0x16e518['attributes']:_0x3cb792['model'];_0x16e518[_0x2203('0x3b')]=qs['sort'](_0xb6863b[_0x2203('0x32')][_0x2203('0x71')]);_0x16e518['where']=qs[_0x2203('0x34')](_[_0x2203('0x3d')](_0xb6863b[_0x2203('0x32')],_0x3cb792[_0x2203('0x34')]));if(_0xb6863b[_0x2203('0x32')][_0x2203('0x3e')]){_0x16e518['where']=_[_0x2203('0x3f')](_0x16e518[_0x2203('0x3c')],{'$or':_['map'](_0x16e518['attributes'],function(_0x377176){var _0x3fe71b={};_0x3fe71b[_0x377176]={'$like':'%'+_0xb6863b[_0x2203('0x32')][_0x2203('0x3e')]+'%'};return _0x3fe71b;})});}_0x16e518=_[_0x2203('0x3f')]({},_0x16e518,_0xb6863b[_0x2203('0x47')]);return _0x4e539b[_0x2203('0x70')](_0x16e518);}})[_0x2203('0x24')](function(_0x4749df){if(_0x4749df){_0x511689=_0x4749df[_0x2203('0x39')];if(!_0xb6863b[_0x2203('0x32')][_0x2203('0x3a')](_0x2203('0x72'))){_0x16e518[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0xb6863b[_0x2203('0x32')]['limit']);_0x16e518['offset']=qs[_0x2203('0x1c')](_0xb6863b[_0x2203('0x32')]['offset']);}return _0x4e539b[_0x2203('0x70')](_0x16e518);}})[_0x2203('0x24')](function(_0x5b5e95){if(_0x5b5e95){return _0x5b5e95?{'count':_0x511689,'rows':_0x5b5e95}:null;}})[_0x2203('0x24')](respondWithResult(_0x42dce6,null))[_0x2203('0x44')](handleError(_0x42dce6,null));};exports['getTeams']=function(_0x21f357,_0x10c65a,_0x541639){var _0x318f3f={};var _0x1c4b57={};var _0x3cfe3f;var _0x1596f7;return db['VoicePrefix']['findOne']({'where':{'id':_0x21f357[_0x2203('0x46')]['id']}})[_0x2203('0x24')](handleEntityNotFound(_0x10c65a,null))[_0x2203('0x24')](function(_0x4ff77f){if(_0x4ff77f){_0x3cfe3f=_0x4ff77f;_0x1c4b57['model']=_[_0x2203('0x33')](db[_0x2203('0x73')][_0x2203('0x2f')]);_0x1c4b57['query']=_['keys'](_0x21f357[_0x2203('0x32')]);_0x1c4b57[_0x2203('0x34')]=_['intersection'](_0x1c4b57[_0x2203('0x36')],_0x1c4b57[_0x2203('0x32')]);_0x318f3f['attributes']=_[_0x2203('0x35')](_0x1c4b57['model'],qs[_0x2203('0x37')](_0x21f357['query']['fields']));_0x318f3f['attributes']=_0x318f3f[_0x2203('0x38')][_0x2203('0x39')]?_0x318f3f['attributes']:_0x1c4b57[_0x2203('0x36')];_0x318f3f[_0x2203('0x3b')]=qs[_0x2203('0x71')](_0x21f357['query'][_0x2203('0x71')]);_0x318f3f['where']=qs[_0x2203('0x34')](_[_0x2203('0x3d')](_0x21f357['query'],_0x1c4b57[_0x2203('0x34')]));if(_0x21f357[_0x2203('0x32')]['filter']){_0x318f3f[_0x2203('0x3c')]=_[_0x2203('0x3f')](_0x318f3f[_0x2203('0x3c')],{'$or':_[_0x2203('0x2d')](_0x318f3f[_0x2203('0x38')],function(_0x5d73a7){var _0x2ba7d3={};_0x2ba7d3[_0x5d73a7]={'$like':'%'+_0x21f357[_0x2203('0x32')][_0x2203('0x3e')]+'%'};return _0x2ba7d3;})});}_0x318f3f=_[_0x2203('0x3f')]({},_0x318f3f,_0x21f357[_0x2203('0x47')]);return _0x3cfe3f[_0x2203('0x74')](_0x318f3f);}})['then'](function(_0x29b41b){if(_0x29b41b){_0x1596f7=_0x29b41b[_0x2203('0x39')];if(!_0x21f357['query'][_0x2203('0x3a')]('nolimit')){_0x318f3f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x21f357[_0x2203('0x32')]['limit']);_0x318f3f[_0x2203('0x1c')]=qs[_0x2203('0x1c')](_0x21f357[_0x2203('0x32')][_0x2203('0x1c')]);}return _0x3cfe3f[_0x2203('0x74')](_0x318f3f);}})[_0x2203('0x24')](function(_0x1ccf09){if(_0x1ccf09){return _0x1ccf09?{'count':_0x1596f7,'rows':_0x1ccf09}:null;}})['then'](respondWithResult(_0x10c65a,null))['catch'](handleError(_0x10c65a,null));};exports[_0x2203('0x75')]=function(_0x41eb4c,_0x25996c,_0x4e1f55){var _0x2188d4=_0x41eb4c[_0x2203('0x4c')][_0x2203('0x6a')];var _0x500604;return db[_0x2203('0x73')][_0x2203('0x42')]({'where':{'id':_0x2188d4},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2203('0x76'),'attributes':['id','name',_0x2203('0x77'),_0x2203('0x78'),'interface'],'raw':!![]}]})[_0x2203('0x24')](function(_0x9586e1){if(_0x9586e1){_0x500604=_0x9586e1;var _0x266d7e=_[_0x2203('0x79')](_0x9586e1,function(_0x34a160){var _0x36ab7f=_0x34a160[_0x2203('0x26')]({'plain':!![]});return _0x36ab7f[_0x2203('0x76')];});return db[_0x2203('0x2e')][_0x2203('0x48')]({'where':{'id':_0x41eb4c[_0x2203('0x46')]['id']}})[_0x2203('0x24')](function(_0x4e7ba1){return db[_0x2203('0x4b')]['transaction'](function(_0x114e07){return _0x4e7ba1[_0x2203('0x75')](_0x2188d4,{'transaction':_0x114e07})[_0x2203('0x24')](function(){return BPromise[_0x2203('0x7a')](_0x500604,function(_0x145a72){return db[_0x2203('0x7b')][_0x2203('0x7c')]({'TeamId':_0x145a72['id'],'VoicePrefixId':_0x41eb4c[_0x2203('0x46')]['id']},{'transaction':_0x114e07});});})[_0x2203('0x24')](function(){return BPromise[_0x2203('0x7a')](_0x266d7e,function(_0x62843c){return db['UserVoicePrefix'][_0x2203('0x7d')]({'where':{'UserId':_0x62843c['id'],'VoicePrefixId':_0x41eb4c['params']['id']},'transaction':_0x114e07});});})[_0x2203('0x24')](function(){_0x266d7e[_0x2203('0x7e')](function(_0x6b8ea4){socket['emit'](_0x2203('0x7f'),{'UserId':_0x6b8ea4['id'],'VoicePrefixId':_0x4e7ba1['id']});});});});});}})[_0x2203('0x24')](respondWithStatusCode(_0x25996c,null))[_0x2203('0x44')](handleError(_0x25996c,null));};exports[_0x2203('0x80')]=function(_0x4316ae,_0x5c1138,_0x389f7f){return db['Team'][_0x2203('0x42')]({'where':{'id':_0x4316ae[_0x2203('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2203('0x81')],'as':_0x2203('0x76'),'attributes':['id'],'raw':!![]}]})[_0x2203('0x24')](handleEntityNotFound(_0x5c1138,null))[_0x2203('0x24')](function(_0x56c2cb){var _0x12179d=_['map'](_0x56c2cb,'id');var _0x55e083=[];var _0x4055eb=[];var _0x95b45a=squel[_0x2203('0x82')]();_0x95b45a[_0x2203('0x83')](_0x2203('0x84'))[_0x2203('0x85')](_0x2203('0x86'),'tq')['join'](_0x2203('0x87'),'ut',_0x2203('0x88'))[_0x2203('0x3c')]('VoicePrefixId\x20=\x20?',_0x4316ae['params']['id']);for(var _0x4d6ece=0x0;_0x4d6ece<_0x56c2cb[_0x2203('0x39')];_0x4d6ece+=0x1){let _0x46b5e6=_0x56c2cb[_0x4d6ece];for(var _0x3dba31=0x0;_0x3dba31<_0x46b5e6[_0x2203('0x76')]['length'];_0x3dba31+=0x1){let _0x238e6f=_0x46b5e6[_0x2203('0x76')][_0x3dba31];var _0x46146e=_0x95b45a[_0x2203('0x89')]();_0x46146e['where']('ut.UserId\x20=\x20?',_0x238e6f['id']);_0x4055eb[_0x2203('0x60')](db[_0x2203('0x4b')][_0x2203('0x32')](_0x46146e['toString'](),{'type':db[_0x2203('0x4b')][_0x2203('0x8a')][_0x2203('0x8b')]})[_0x2203('0x24')](function(_0x263130){if(_0x263130[_0x2203('0x39')]===0x1){return _0x238e6f['id'];}else{var _0xbee79c=_['every'](_[_0x2203('0x2d')](_0x263130,_0x2203('0x8c')),function(_0x131332){return _[_0x2203('0x8d')](_0x12179d,_0x131332);});if(_0xbee79c){return _0x238e6f['id'];}}}));}}return BPromise[_0x2203('0x8e')](_0x4055eb)[_0x2203('0x24')](function(_0x2d9004){_0x55e083=_(_0x55e083)[_0x2203('0x8f')](_0x2d9004)[_0x2203('0x90')]()['value']();return db[_0x2203('0x2e')][_0x2203('0x48')]({'where':{'id':_0x4316ae[_0x2203('0x46')]['id']}})[_0x2203('0x24')](function(_0x547eb9){return db[_0x2203('0x4b')][_0x2203('0x68')](function(_0x1022ef){return _0x547eb9[_0x2203('0x80')](_0x4316ae[_0x2203('0x32')][_0x2203('0x6a')],{'transaction':_0x1022ef})[_0x2203('0x24')](function(){if(!_[_0x2203('0x91')](_0x55e083)){return _0x547eb9[_0x2203('0x6d')](_0x55e083,{'transaction':_0x1022ef});}})['then'](function(){_0x55e083['forEach'](function(_0x225ea1){socket[_0x2203('0x6c')](_0x2203('0x6f'),{'UserId':_0x225ea1,'VoicePrefixId':_0x547eb9['id']});});});});});});})[_0x2203('0x24')](respondWithStatusCode(_0x5c1138,null))['catch'](handleError(_0x5c1138,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index b74dcab..65cb41d 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 _0x9d23=['hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','remove','emit'];(function(_0x6b1561,_0x41fa80){var _0x59c759=function(_0x2a5d77){while(--_0x2a5d77){_0x6b1561['push'](_0x6b1561['shift']());}};_0x59c759(++_0x41fa80);}(_0x9d23,0x1d6));var _0x39d2=function(_0xdc4d59,_0x41bd70){_0xdc4d59=_0xdc4d59-0x0;var _0x2a6126=_0x9d23[_0xdc4d59];return _0x2a6126;};'use strict';var EventEmitter=require(_0x39d2('0x0'));var VoicePrefix=require(_0x39d2('0x1'))['db'][_0x39d2('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x39d2('0x3')](0x0);var events={'afterCreate':_0x39d2('0x4'),'afterUpdate':'update','afterDestroy':_0x39d2('0x5')};function emitEvent(_0x49e4eb){return function(_0x17a1af,_0x2441cc,_0x1bc868){VoicePrefixEvents[_0x39d2('0x6')](_0x49e4eb+':'+_0x17a1af['id'],_0x17a1af);VoicePrefixEvents[_0x39d2('0x6')](_0x49e4eb,_0x17a1af);_0x1bc868(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x39d2('0x7')](e,emitEvent(event));}}module[_0x39d2('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x5249=['emit','hook','exports','events','../../mysqldb','VoicePrefix','save','update','remove'];(function(_0x54fd29,_0x4b6f05){var _0x3b4928=function(_0x5a039e){while(--_0x5a039e){_0x54fd29['push'](_0x54fd29['shift']());}};_0x3b4928(++_0x4b6f05);}(_0x5249,0x12c));var _0x9524=function(_0x354346,_0x13776d){_0x354346=_0x354346-0x0;var _0x538283=_0x5249[_0x354346];return _0x538283;};'use strict';var EventEmitter=require(_0x9524('0x0'));var VoicePrefix=require(_0x9524('0x1'))['db'][_0x9524('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9524('0x3'),'afterUpdate':_0x9524('0x4'),'afterDestroy':_0x9524('0x5')};function emitEvent(_0x3e6bf0){return function(_0xe768c5,_0x8181b2,_0x19f553){VoicePrefixEvents['emit'](_0x3e6bf0+':'+_0xe768c5['id'],_0xe768c5);VoicePrefixEvents[_0x9524('0x6')](_0x3e6bf0,_0xe768c5);_0x19f553(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x9524('0x7')](e,emitEvent(event));}}module[_0x9524('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 12a9ee2..9ee57db 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 _0x3009=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0x3009,0xe4));var _0x9300=function(_0x4c91c6,_0x56f753){_0x4c91c6=_0x4c91c6-0x0;var _0x21ae00=_0x3009[_0x4c91c6];return _0x21ae00;};'use strict';var _=require(_0x9300('0x0'));var util=require('util');var logger=require(_0x9300('0x1'))(_0x9300('0x2'));var moment=require(_0x9300('0x3'));var BPromise=require(_0x9300('0x4'));var rp=require(_0x9300('0x5'));var fs=require('fs');var path=require(_0x9300('0x6'));var rimraf=require('rimraf');var config=require(_0x9300('0x7'));var attributes=require(_0x9300('0x8'));module[_0x9300('0x9')]=function(_0x36c524,_0x1caec2){return _0x36c524[_0x9300('0xa')](_0x9300('0xb'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d45=['request-promise','path','rimraf','../../config/environment','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment'];(function(_0x2058ee,_0x43c288){var _0x4bf31f=function(_0x38d2dd){while(--_0x38d2dd){_0x2058ee['push'](_0x2058ee['shift']());}};_0x4bf31f(++_0x43c288);}(_0x0d45,0x166));var _0x50d4=function(_0x10c6ef,_0x5534fe){_0x10c6ef=_0x10c6ef-0x0;var _0x160322=_0x0d45[_0x10c6ef];return _0x160322;};'use strict';var _=require(_0x50d4('0x0'));var util=require(_0x50d4('0x1'));var logger=require(_0x50d4('0x2'))(_0x50d4('0x3'));var moment=require(_0x50d4('0x4'));var BPromise=require('bluebird');var rp=require(_0x50d4('0x5'));var fs=require('fs');var path=require(_0x50d4('0x6'));var rimraf=require(_0x50d4('0x7'));var config=require(_0x50d4('0x8'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0xcddda0,_0xd8d07b){return _0xcddda0['define'](_0x50d4('0x9'),attributes,{'tableName':_0x50d4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index a1e460b..1ee26fd 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 _0x229c=['util','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x229c,0xcf));var _0xc229=function(_0x5cba3a,_0x209797){_0x5cba3a=_0x5cba3a-0x0;var _0x12fb42=_0x229c[_0x5cba3a];return _0x12fb42;};'use strict';var _=require('lodash');var util=require(_0xc229('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc229('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc229('0x2'));var logger=require('../../config/logger')(_0xc229('0x3'));var config=require(_0xc229('0x4'));var jayson=require(_0xc229('0x5'));var client=jayson['client'][_0xc229('0x6')]({'port':0x232a});config['redis']=_[_0xc229('0x7')](config[_0xc229('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xc229('0x9'))(new Redis(config[_0xc229('0x8')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x1dc38f,_0x5a5d9b,_0x4abe4c){return new BPromise(function(_0x36263a,_0x1434a3){return client[_0xc229('0xa')](_0x1dc38f,_0x4abe4c)[_0xc229('0xb')](function(_0x25fd05){logger[_0xc229('0xc')](_0xc229('0xd'),_0x5a5d9b,_0xc229('0xe'));logger[_0xc229('0xf')](_0xc229('0x10'),_0x5a5d9b,_0xc229('0xe'),JSON[_0xc229('0x11')](_0x25fd05));if(_0x25fd05[_0xc229('0x12')]){if(_0x25fd05['error'][_0xc229('0x13')]===0x1f4){logger['error'](_0xc229('0xd'),_0x5a5d9b,_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);return _0x1434a3(_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);}logger[_0xc229('0x12')](_0xc229('0xd'),_0x5a5d9b,_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);return _0x36263a(_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);}else{logger[_0xc229('0xc')](_0xc229('0xd'),_0x5a5d9b,'request\x20sent');_0x36263a(_0x25fd05[_0xc229('0x15')][_0xc229('0x14')]);}})[_0xc229('0x16')](function(_0x193c75){logger[_0xc229('0x12')](_0xc229('0xd'),_0x5a5d9b,_0x193c75);_0x1434a3(_0x193c75);});});} \ No newline at end of file +var _0x3646=['request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3646,0x15f));var _0x6364=function(_0x419197,_0x2052f3){_0x419197=_0x419197-0x0;var _0x23863c=_0x3646[_0x419197];return _0x23863c;};'use strict';var _=require(_0x6364('0x0'));var util=require(_0x6364('0x1'));var moment=require(_0x6364('0x2'));var BPromise=require(_0x6364('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6364('0x4'));var db=require(_0x6364('0x5'))['db'];var utils=require(_0x6364('0x6'));var logger=require(_0x6364('0x7'))(_0x6364('0x8'));var config=require(_0x6364('0x9'));var jayson=require(_0x6364('0xa'));var client=jayson[_0x6364('0xb')][_0x6364('0xc')]({'port':0x232a});config[_0x6364('0xd')]=_[_0x6364('0xe')](config['redis'],{'host':_0x6364('0xf'),'port':0x18eb});var socket=require(_0x6364('0x10'))(new Redis(config[_0x6364('0xd')]));require(_0x6364('0x11'))['register'](socket);function respondWithRpcPromise(_0x4bf364,_0x51998c,_0x2d4bbc){return new BPromise(function(_0xfc1996,_0x4646a5){return client[_0x6364('0x12')](_0x4bf364,_0x2d4bbc)[_0x6364('0x13')](function(_0x34de37){logger[_0x6364('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x51998c,_0x6364('0x15'));logger[_0x6364('0x16')](_0x6364('0x17'),_0x51998c,'request\x20sent',JSON[_0x6364('0x18')](_0x34de37));if(_0x34de37[_0x6364('0x19')]){if(_0x34de37[_0x6364('0x19')][_0x6364('0x1a')]===0x1f4){logger['error'](_0x6364('0x1b'),_0x51998c,_0x34de37['error'][_0x6364('0x1c')]);return _0x4646a5(_0x34de37[_0x6364('0x19')][_0x6364('0x1c')]);}logger['error'](_0x6364('0x1b'),_0x51998c,_0x34de37[_0x6364('0x19')][_0x6364('0x1c')]);return _0xfc1996(_0x34de37[_0x6364('0x19')][_0x6364('0x1c')]);}else{logger[_0x6364('0x14')](_0x6364('0x1b'),_0x51998c,'request\x20sent');_0xfc1996(_0x34de37[_0x6364('0x1d')]['message']);}})[_0x6364('0x1e')](function(_0x120401){logger[_0x6364('0x19')](_0x6364('0x1b'),_0x51998c,_0x120401);_0x4646a5(_0x120401);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index e6db10d..a7e9387 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 _0x18e0=['voicePrefix:','save','update','emit','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x18e0,0xa2));var _0x018e=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x18e0[_0x565ed7];return _0x183ad7;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x018e('0x0'),'remove',_0x018e('0x1')];function createListener(_0x110f22,_0x356418){return function(_0x4d12a5){_0x356418[_0x018e('0x2')](_0x110f22,_0x4d12a5);};}function removeListener(_0x4e570f,_0x504293){return function(){VoicePrefixEvents[_0x018e('0x3')](_0x4e570f,_0x504293);};}exports[_0x018e('0x4')]=function(_0x1b90dd){for(var _0x50450b=0x0,_0x5b6638=events[_0x018e('0x5')];_0x50450b<_0x5b6638;_0x50450b++){var _0x24e838=events[_0x50450b];var _0x5b2267=createListener(_0x018e('0x6')+_0x24e838,_0x1b90dd);VoicePrefixEvents['on'](_0x24e838,_0x5b2267);}}; \ No newline at end of file +var _0xb903=['update','emit','removeListener','register','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0xb903,0x185));var _0x3b90=function(_0x43ff9c,_0x5a769a){_0x43ff9c=_0x43ff9c-0x0;var _0x13aa44=_0xb903[_0x43ff9c];return _0x13aa44;};'use strict';var VoicePrefixEvents=require(_0x3b90('0x0'));var events=[_0x3b90('0x1'),_0x3b90('0x2'),_0x3b90('0x3')];function createListener(_0x5191d8,_0x3312ca){return function(_0xf414f4){_0x3312ca[_0x3b90('0x4')](_0x5191d8,_0xf414f4);};}function removeListener(_0x1cd5d8,_0x30d8db){return function(){VoicePrefixEvents[_0x3b90('0x5')](_0x1cd5d8,_0x30d8db);};}exports[_0x3b90('0x6')]=function(_0x5acd76){for(var _0x15b68f=0x0,_0x5e845a=events['length'];_0x15b68f<_0x5e845a;_0x15b68f++){var _0x153283=events[_0x15b68f];var _0x2e4c06=createListener(_0x3b90('0x7')+_0x153283,_0x5acd76);VoicePrefixEvents['on'](_0x153283,_0x2e4c06);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 96ad0e3..bb07f32 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(_0x4d2c26,_0x2701f9){var _0x5bf9b4=function(_0x52edc6){while(--_0x52edc6){_0x4d2c26['push'](_0x4d2c26['shift']());}};_0x5bf9b4(++_0x2701f9);}(_0xb10b,0x12a));var _0xbb10=function(_0x24cdd5,_0x4232a0){_0x24cdd5=_0x24cdd5-0x0;var _0x52a09e=_0xb10b[_0x24cdd5];return _0x52a09e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x2fc8db,_0x2f7b47){var _0x527ad9=function(_0x30d1d6){while(--_0x30d1d6){_0x2fc8db['push'](_0x2fc8db['shift']());}};_0x527ad9(++_0x2f7b47);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 523a193..b26ec40 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 _0x031e=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','inbound','outbound','default','STRING','ENUM','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','getDataValue','type','booked','roundrobin','progressive','predictive','INTEGER','yes','all','once','TEXT','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\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)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x259415,_0x1f413b){var _0x3dbb05=function(_0x5af256){while(--_0x5af256){_0x259415['push'](_0x259415['shift']());}};_0x3dbb05(++_0x1f413b);}(_0x031e,0xb4));var _0xe031=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x031e[_0x390733];return _0x33beb9;};'use strict';var Sequelize=require(_0xe031('0x0'));module[_0xe031('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe031('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xe031('0x3'),_0xe031('0x4')),'allowNull':![],'defaultValue':_0xe031('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xe031('0x5')},'announce':{'type':Sequelize[_0xe031('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0xe031('0x7')]('rr','ringall','leastrecent',_0xe031('0x8'),_0xe031('0x9'),_0xe031('0xa'),_0xe031('0xb'),_0xe031('0xc'),_0xe031('0xd')),'allowNull':![],'defaultValue':_0xe031('0xe'),'set':function(_0x478471){this[_0xe031('0xf')]('strategy',_0x478471?_0x478471:_0xe031('0xa'));},'get':function(){var _0x560d10=this[_0xe031('0x10')](_0xe031('0x11'));var _0x5670f2=this['getDataValue']('dialMethod');var _0xd48ad5=this['getDataValue']('strategy');if(_0x560d10===_0xe031('0x3')){return _0xd48ad5;}if(_0x5670f2===_0xe031('0x12')&&_0xd48ad5===_0xe031('0xa')||_0x5670f2===_0xe031('0x12')&&_0xd48ad5===_0xe031('0x13')){return _0xd48ad5;}if(_0x5670f2===_0xe031('0x14')||_0x5670f2===_0xe031('0x15')||_0x5670f2==='power'){return _0xd48ad5;}return null;}},'servicelevel':{'type':Sequelize[_0xe031('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe031('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xe031('0x6')]},'weight':{'type':Sequelize[_0xe031('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe031('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no'),'defaultValue':_0xe031('0x17')},'autopause':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no',_0xe031('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe031('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe031('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xe031('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xe031('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe031('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe031('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no',_0xe031('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xe031('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xe031('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xe031('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xe031('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe031('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe031('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe031('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe031('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe031('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe031('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xe031('0x6')]},'queue_quantity2':{'type':Sequelize[_0xe031('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0xe031('0x6')]},'queue_less_than':{'type':Sequelize[_0xe031('0x6')]},'periodic_announce':{'type':Sequelize[_0xe031('0x1a')],'set':function(_0x37f882){this[_0xe031('0xf')](_0xe031('0x1b'),_0x37f882?_0x37f882['join'](','):[]);},'get':function(){return this[_0xe031('0x10')](_0xe031('0x1b'))?this['getDataValue'](_0xe031('0x1b'))[_0xe031('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0xe031('0x6')],'defaultValue':_0xe031('0x17'),'set':function(_0x231234){this[_0xe031('0xf')](_0xe031('0x1d'),_0x231234?_0x231234['join'](','):undefined);},'get':function(){return this[_0xe031('0x10')](_0xe031('0x1d'))?this[_0xe031('0x10')](_0xe031('0x1d'))[_0xe031('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x234775){this['setDataValue'](_0xe031('0x1e'),_0x234775?_0x234775['join'](','):undefined);},'get':function(){return this[_0xe031('0x10')]('leavewhenempty')?this['getDataValue']('leavewhenempty')[_0xe031('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xe031('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe031('0x6')]},'description':{'type':Sequelize[_0xe031('0x6')]},'acw':{'type':Sequelize[_0xe031('0x1f')],'defaultValue':0x0,'set':function(_0xe1e6f4){this[_0xe031('0xf')]('acw',_0xe1e6f4);if(_0xe1e6f4){if(this[_0xe031('0x10')]('wrapuptime')<0x2){this[_0xe031('0xf')](_0xe031('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xe031('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe031('0x1f')],'defaultValue':0x0,'comment':_0xe031('0x21')},'dialMethod':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x22'),_0xe031('0x14'),_0xe031('0x23'),'predictive','booked'),'defaultValue':'progressive','comment':_0xe031('0x24')},'dialLimitChannel':{'type':Sequelize[_0xe031('0x16')](0x4)[_0xe031('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe031('0x26')},'dialLimitQueue':{'type':Sequelize[_0xe031('0x16')](0x4)[_0xe031('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe031('0x27')},'dialPowerLevel':{'type':Sequelize[_0xe031('0x28')](0x2)[_0xe031('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xe031('0x29'),'dropRate'),'defaultValue':_0xe031('0x2a'),'comment':_0xe031('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xe031('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xe031('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xe031('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe031('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe031('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xe031('0x16')](0x3)[_0xe031('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe031('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xe031('0x6')],'defaultValue':_0xe031('0x2f'),'comment':_0xe031('0x30')},'dialQueueTimeout':{'type':Sequelize[_0xe031('0x16')](0x3)[_0xe031('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe031('0x31')},'dialQueueProject':{'type':Sequelize[_0xe031('0x6')],'comment':_0xe031('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe031('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe031('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe031('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0xe031('0x16')](0x3)[_0xe031('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xe031('0x16')](0x5)[_0xe031('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe031('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe031('0x16')](0x3)[_0xe031('0x25')],'defaultValue':0x3,'comment':_0xe031('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe031('0x16')](0x5)[_0xe031('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe031('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe031('0x16')](0x3)[_0xe031('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe031('0x6')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xe031('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x37'),_0xe031('0x38'),'onlyIfOpen'),'defaultValue':_0xe031('0x37')},'dialAMDActive':{'type':Sequelize[_0xe031('0x1f')],'defaultValue':0x0,'comment':_0xe031('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0xe031('0x16')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe031('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0xe031('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe031('0x16')](0x9)[_0xe031('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe031('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe031('0x16')](0x9)[_0xe031('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe031('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0xe031('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe031('0x16')](0x9)[_0xe031('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe031('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe031('0x16')](0x9)[_0xe031('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe031('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xe031('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe031('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe031('0x16')](0x9)[_0xe031('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe031('0x40')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xe031('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xe031('0x41')},'dialRecallInQueue':{'type':Sequelize[_0xe031('0x1f')],'defaultValue':0x0,'comment':_0xe031('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe031('0x7')](_0xe031('0x43'),_0xe031('0x44')),'defaultValue':_0xe031('0x43')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xe031('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe031('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe031('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xe031('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe031('0x45')},'dialCutDigit':{'type':Sequelize[_0xe031('0x16')](0x3)[_0xe031('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe031('0x16')](0x3)[_0xe031('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe031('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xe031('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe031('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0xe031('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe031('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe031('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe031('0x16')](0x5)[_0xe031('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe031('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0xe031('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe031('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe031('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe031('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe031('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe031('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe031('0x16')](0x5)[_0xe031('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe031('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe031('0x16')],'allowNull':!![],'comment':_0xe031('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0xe031('0x1f')],'defaultValue':![],'comment':_0xe031('0x4e'),'set':function(_0x510438){if(!_0x510438)this[_0xe031('0xf')](_0xe031('0x4f'),null);this[_0xe031('0xf')](_0xe031('0x50'),_0x510438);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe031('0x16')](0x3)[_0xe031('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe031('0x16')](0x3)[_0xe031('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xe031('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xe031('0x16')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7278=['yes','all','once','TEXT','periodic_announce','joinempty','split','leavewhenempty','join','BOOLEAN','acw','wrapuptime','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','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\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','leastrecent','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7278,0x82));var _0x8727=function(_0x5159eb,_0x574797){_0x5159eb=_0x5159eb-0x0;var _0x2bca28=_0x7278[_0x5159eb];return _0x2bca28;};'use strict';var Sequelize=require(_0x8727('0x0'));module[_0x8727('0x1')]={'name':{'type':Sequelize[_0x8727('0x2')],'allowNull':![],'unique':_0x8727('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8727('0x4')](_0x8727('0x5'),_0x8727('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x8727('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x8727('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x8727('0x4')]('rr','ringall',_0x8727('0x7'),'fewestcalls',_0x8727('0x8'),_0x8727('0x9'),_0x8727('0xa'),_0x8727('0xb'),_0x8727('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0x1c8db2){this[_0x8727('0xd')](_0x8727('0xe'),_0x1c8db2?_0x1c8db2:_0x8727('0x9'));},'get':function(){var _0x374a74=this[_0x8727('0xf')](_0x8727('0x10'));var _0x532a04=this[_0x8727('0xf')](_0x8727('0x11'));var _0x2ae796=this['getDataValue'](_0x8727('0xe'));if(_0x374a74===_0x8727('0x5')){return _0x2ae796;}if(_0x532a04===_0x8727('0x12')&&_0x2ae796===_0x8727('0x9')||_0x532a04===_0x8727('0x12')&&_0x2ae796===_0x8727('0x13')){return _0x2ae796;}if(_0x532a04===_0x8727('0x14')||_0x532a04===_0x8727('0x15')||_0x532a04===_0x8727('0x16')){return _0x2ae796;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8727('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8727('0x17')](0xb)},'timeout':{'type':Sequelize[_0x8727('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8727('0x2')]},'weight':{'type':Sequelize[_0x8727('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8727('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x8727('0x4')](_0x8727('0x18'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x8727('0x18'),'no',_0x8727('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8727('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x8727('0x4')](_0x8727('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x8727('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8727('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8727('0x4')](_0x8727('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8727('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8727('0x4')](_0x8727('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8727('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8727('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x8727('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x8727('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8727('0x4')](_0x8727('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8727('0x4')](_0x8727('0x18'),'no'),'defaultValue':_0x8727('0x18')},'announce_holdtime':{'type':Sequelize[_0x8727('0x4')](_0x8727('0x18'),'no',_0x8727('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x8727('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8727('0x4')](_0x8727('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x8727('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x8727('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x8727('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8727('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8727('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x8727('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8727('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x8727('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8727('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x8727('0x2')]},'queue_quantity1':{'type':Sequelize[_0x8727('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x8727('0x1b')],'set':function(_0x769d02){this[_0x8727('0xd')](_0x8727('0x1c'),_0x769d02?_0x769d02['join'](','):[]);},'get':function(){return this['getDataValue'](_0x8727('0x1c'))?this[_0x8727('0xf')](_0x8727('0x1c'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x8727('0x2')],'defaultValue':_0x8727('0x18'),'set':function(_0x5d0d2c){this['setDataValue'](_0x8727('0x1d'),_0x5d0d2c?_0x5d0d2c['join'](','):undefined);},'get':function(){return this[_0x8727('0xf')]('joinempty')?this[_0x8727('0xf')]('joinempty')[_0x8727('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x685f85){this[_0x8727('0xd')](_0x8727('0x1f'),_0x685f85?_0x685f85[_0x8727('0x20')](','):undefined);},'get':function(){return this[_0x8727('0xf')](_0x8727('0x1f'))?this[_0x8727('0xf')](_0x8727('0x1f'))[_0x8727('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x8727('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8727('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8727('0x4')](_0x8727('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8727('0x2')]},'acw':{'type':Sequelize[_0x8727('0x21')],'defaultValue':0x0,'set':function(_0x2b25be){this['setDataValue'](_0x8727('0x22'),_0x2b25be);if(_0x2b25be){if(this[_0x8727('0xf')](_0x8727('0x23'))<0x2){this[_0x8727('0xd')](_0x8727('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8727('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x8727('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0x8727('0x24'),'progressive','power',_0x8727('0x15'),_0x8727('0x12')),'defaultValue':_0x8727('0x14'),'comment':_0x8727('0x25')},'dialLimitChannel':{'type':Sequelize[_0x8727('0x17')](0x4)[_0x8727('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x8727('0x17')](0x4)[_0x8727('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8727('0x27')},'dialPowerLevel':{'type':Sequelize[_0x8727('0x28')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x8727('0x4')]('agentBusyFactor','dropRate'),'defaultValue':'dropRate','comment':_0x8727('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x8727('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8727('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x8727('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x8727('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8727('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x8727('0x17')](0x3)[_0x8727('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8727('0x2b')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x8727('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x8727('0x17')](0x3)[_0x8727('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8727('0x2d')},'dialQueueProject':{'type':Sequelize[_0x8727('0x2')],'comment':_0x8727('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8727('0x17')](0x3)[_0x8727('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8727('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8727('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x8727('0x17')](0x3)[_0x8727('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8727('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8727('0x17')](0x5)[_0x8727('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8727('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8727('0x26')],'defaultValue':0x3,'comment':_0x8727('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8727('0x17')](0x5)[_0x8727('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8727('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8727('0x34')},'dialTimezone':{'type':Sequelize[_0x8727('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8727('0x2')],'defaultValue':_0x8727('0x35')},'dialPrefix':{'type':Sequelize[_0x8727('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x8727('0x4')](_0x8727('0x36'),'never','onlyIfOpen'),'defaultValue':_0x8727('0x36')},'dialAMDActive':{'type':Sequelize[_0x8727('0x21')],'defaultValue':0x0,'comment':_0x8727('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x8727('0x17')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8727('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x8727('0x17')](0x9)[_0x8727('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8727('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8727('0x17')](0x9)[_0x8727('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8727('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8727('0x17')](0x9)[_0x8727('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8727('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x8727('0x17')](0x9)[_0x8727('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8727('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8727('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8727('0x17')](0x9)[_0x8727('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8727('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x8727('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8727('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8727('0x17')](0x9)[_0x8727('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8727('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x8727('0x17')](0x5)[_0x8727('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x8727('0x21')],'defaultValue':0x0,'comment':_0x8727('0x40')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x8727('0x41')),'defaultValue':_0x8727('0x42')},'dialQueueProject2':{'type':Sequelize[_0x8727('0x2')],'comment':_0x8727('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8727('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8727('0x17')](0x3)[_0x8727('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8727('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x8727('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8727('0x17')](0x3)[_0x8727('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8727('0x17')](0x5)[_0x8727('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8727('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x8727('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8727('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x8727('0x17')](0x5)[_0x8727('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8727('0x17')](0x3)[_0x8727('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8727('0x17')](0x5)[_0x8727('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8727('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0x8727('0x17')](0x3)[_0x8727('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8727('0x17')](0x5)[_0x8727('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8727('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8727('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8727('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8727('0x17')](0x5)[_0x8727('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8727('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8727('0x17')],'allowNull':!![],'comment':_0x8727('0x4a')},'mandatoryDisposition':{'type':Sequelize[_0x8727('0x21')],'defaultValue':![],'comment':_0x8727('0x4b'),'set':function(_0x54dcd3){if(!_0x54dcd3)this[_0x8727('0xd')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x8727('0x4c'),_0x54dcd3);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x8727('0x17')](0x3)[_0x8727('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x8727('0x17')](0x3)[_0x8727('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x8727('0x21')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x8727('0x21')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 913eb97..9b96957 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 _0xd7c3=['removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','ids','spread','online','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','CmListId','ListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','into','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','OrderBy','h.id','ci.OrderBy+1','join','h.scheduledat=?','ci.ItemClass=?','push','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','VoiceQueues','QueueCampaigns','outbound','ignore','map','value','includes','find','name','UserProfileResource','stack','send','VoiceQueue','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','rawAttributes','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','inbound','userProfileId','autoAssociation','getHoppers','CmHopper','hasOwnProperty','nolimit','VoiceQueueId','findAll','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','voicePause','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','interface','format','SIP/%s','userVoiceQueue:save'];(function(_0x4f6a5c,_0x41f662){var _0x565c0b=function(_0x22cb46){while(--_0x22cb46){_0x4f6a5c['push'](_0x4f6a5c['shift']());}};_0x565c0b(++_0x41f662);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x28ee87,_0x21a176){_0x28ee87=_0x28ee87-0x0;var _0x53a2f2=_0xd7c3[_0x28ee87];return _0x53a2f2;};'use strict';var emlformat=require(_0x3d7c('0x0'));var rimraf=require(_0x3d7c('0x1'));var zipdir=require(_0x3d7c('0x2'));var jsonpatch=require(_0x3d7c('0x3'));var rp=require(_0x3d7c('0x4'));var moment=require(_0x3d7c('0x5'));var BPromise=require(_0x3d7c('0x6'));var Mustache=require(_0x3d7c('0x7'));var util=require(_0x3d7c('0x8'));var path=require('path');var sox=require(_0x3d7c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d7c('0xa'));var squel=require(_0x3d7c('0xb'));var crypto=require(_0x3d7c('0xc'));var jsforce=require(_0x3d7c('0xd'));var deskjs=require(_0x3d7c('0xe'));var toCsv=require(_0x3d7c('0xf'));var querystring=require(_0x3d7c('0x10'));var Papa=require(_0x3d7c('0x11'));var Redis=require(_0x3d7c('0x12'));var authService=require(_0x3d7c('0x13'));var qs=require(_0x3d7c('0x14'));var as=require(_0x3d7c('0x15'));var hardwareService=require(_0x3d7c('0x16'));var logger=require(_0x3d7c('0x17'))(_0x3d7c('0x18'));var utils=require(_0x3d7c('0x19'));var config=require(_0x3d7c('0x1a'));var licenseUtil=require(_0x3d7c('0x1b'));var db=require('../../mysqldb')['db'];config[_0x3d7c('0x1c')]=_[_0x3d7c('0x1d')](config[_0x3d7c('0x1c')],{'host':_0x3d7c('0x1e'),'port':0x18eb});var socket=require(_0x3d7c('0x1f'))(new Redis(config[_0x3d7c('0x1c')]));require(_0x3d7c('0x20'))[_0x3d7c('0x21')](socket);function respondWithStatusCode(_0x2717c5,_0x36e28d){_0x36e28d=_0x36e28d||0xcc;return function(_0x46f402){if(_0x46f402){return _0x2717c5[_0x3d7c('0x22')](_0x36e28d);}return _0x2717c5[_0x3d7c('0x23')](_0x36e28d)[_0x3d7c('0x24')]();};}function respondWithResult(_0x9d0305,_0x1e7872){_0x1e7872=_0x1e7872||0xc8;return function(_0x4cf556){if(_0x4cf556){return _0x9d0305[_0x3d7c('0x23')](_0x1e7872)[_0x3d7c('0x25')](_0x4cf556);}};}function respondWithFilteredResult(_0x49e25c,_0x4e17c7){return function(_0x447ea0){if(_0x447ea0){var _0x11b4d6=typeof _0x4e17c7[_0x3d7c('0x26')]===_0x3d7c('0x27')&&typeof _0x4e17c7['limit']===_0x3d7c('0x27');var _0x328851=_0x447ea0[_0x3d7c('0x28')];var _0x4f9ccb=_0x11b4d6?0x0:_0x4e17c7[_0x3d7c('0x26')];var _0x38207e=_0x11b4d6?_0x447ea0[_0x3d7c('0x28')]:_0x4e17c7[_0x3d7c('0x26')]+_0x4e17c7[_0x3d7c('0x29')];var _0x22f9f6;if(_0x38207e>=_0x328851){_0x38207e=_0x328851;_0x22f9f6=0xc8;}else{_0x22f9f6=0xce;}_0x49e25c[_0x3d7c('0x23')](_0x22f9f6);return _0x49e25c[_0x3d7c('0x2a')](_0x3d7c('0x2b'),_0x4f9ccb+'-'+_0x38207e+'/'+_0x328851)['json'](_0x447ea0);}return null;};}function patchUpdates(_0x126c5e){return function(_0x222f4e){try{jsonpatch[_0x3d7c('0x2c')](_0x222f4e,_0x126c5e,!![]);}catch(_0x81a5a3){return BPromise['reject'](_0x81a5a3);}return _0x222f4e['save']();};}function saveUpdates(_0x3518c9,_0x3f9d26){return function(_0x37d3a0){if(_0x37d3a0){return _0x37d3a0[_0x3d7c('0x2d')](_0x3518c9)[_0x3d7c('0x2e')](function(_0x2806a5){return _0x2806a5;});}return null;};}function removeEntity(_0x139fa2,_0x2ac594){return function(_0x3171bb){if(_0x3171bb){return _0x3171bb[_0x3d7c('0x2f')]()[_0x3d7c('0x2e')](function(){var _0x4d440b=_0x3171bb['get']({'plain':!![]});var _0x316c7c=[{'name':_0x3d7c('0x30'),'value':'inbound','ignore':![]},{'name':_0x3d7c('0x31'),'value':_0x3d7c('0x32'),'ignore':![]}];var _0x2ddef1=_(_0x316c7c)['filter'](_0x3d7c('0x33'))[_0x3d7c('0x34')](_0x3d7c('0x35'))[_0x3d7c('0x35')]();if(_[_0x3d7c('0x36')](_0x2ddef1,_0x4d440b['type'])){return;}var _0x3f7228=_[_0x3d7c('0x37')](_0x316c7c,[_0x3d7c('0x35'),_0x4d440b['type']])[_0x3d7c('0x38')];return db[_0x3d7c('0x39')][_0x3d7c('0x2f')]({'where':{'type':_0x3f7228,'resourceId':_0x4d440b['id']}})[_0x3d7c('0x2e')](function(){return _0x3171bb;});})[_0x3d7c('0x2e')](function(){_0x139fa2[_0x3d7c('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c3eb8,_0x26fc7f){return function(_0x2357cc){if(!_0x2357cc){_0x5c3eb8[_0x3d7c('0x22')](0x194);}return _0x2357cc;};}function handleError(_0xe02a40,_0x27a92a){_0x27a92a=_0x27a92a||0x1f4;return function(_0x1af7ba){logger['error'](_0x1af7ba[_0x3d7c('0x3a')]);if(_0x1af7ba[_0x3d7c('0x38')]){delete _0x1af7ba[_0x3d7c('0x38')];}_0xe02a40['status'](_0x27a92a)[_0x3d7c('0x3b')](_0x1af7ba);};}exports['index']=function(_0x5dc4f2,_0xc71190){var _0x182dda={},_0x7dde89={},_0x275376={'count':0x0,'rows':[]};var _0x4f1672=_[_0x3d7c('0x34')](db[_0x3d7c('0x3c')]['rawAttributes'],function(_0x1a63d9){return{'name':_0x1a63d9['fieldName'],'type':_0x1a63d9[_0x3d7c('0x3d')][_0x3d7c('0x3e')]};});_0x7dde89[_0x3d7c('0x3f')]=_[_0x3d7c('0x34')](_0x4f1672,_0x3d7c('0x38'));_0x7dde89[_0x3d7c('0x40')]=_[_0x3d7c('0x41')](_0x5dc4f2[_0x3d7c('0x40')]);_0x7dde89[_0x3d7c('0x42')]=_[_0x3d7c('0x43')](_0x7dde89[_0x3d7c('0x3f')],_0x7dde89[_0x3d7c('0x40')]);_0x182dda['attributes']=_[_0x3d7c('0x43')](_0x7dde89[_0x3d7c('0x3f')],qs[_0x3d7c('0x44')](_0x5dc4f2[_0x3d7c('0x40')][_0x3d7c('0x44')]));_0x182dda[_0x3d7c('0x45')]=_0x182dda[_0x3d7c('0x45')]['length']?_0x182dda[_0x3d7c('0x45')]:_0x7dde89[_0x3d7c('0x3f')];if(!_0x5dc4f2['query']['hasOwnProperty']('nolimit')){_0x182dda[_0x3d7c('0x29')]=qs[_0x3d7c('0x29')](_0x5dc4f2[_0x3d7c('0x40')][_0x3d7c('0x29')]);_0x182dda['offset']=qs[_0x3d7c('0x26')](_0x5dc4f2[_0x3d7c('0x40')][_0x3d7c('0x26')]);}_0x182dda[_0x3d7c('0x46')]=qs[_0x3d7c('0x47')](_0x5dc4f2[_0x3d7c('0x40')][_0x3d7c('0x47')]);_0x182dda[_0x3d7c('0x48')]=qs[_0x3d7c('0x42')](_[_0x3d7c('0x49')](_0x5dc4f2[_0x3d7c('0x40')],_0x7dde89[_0x3d7c('0x42')]),_0x4f1672);if(_0x5dc4f2[_0x3d7c('0x40')]['filter']){_0x182dda['where']=_[_0x3d7c('0x4a')](_0x182dda[_0x3d7c('0x48')],{'$or':_[_0x3d7c('0x34')](_0x4f1672,function(_0x58f2bd){if(_0x58f2bd[_0x3d7c('0x3d')]!==_0x3d7c('0x4b')){var _0x61416={};_0x61416[_0x58f2bd[_0x3d7c('0x38')]]={'$like':'%'+_0x5dc4f2[_0x3d7c('0x40')][_0x3d7c('0x4c')]+'%'};return _0x61416;}})});}_0x182dda=_[_0x3d7c('0x4a')]({},_0x182dda,_0x5dc4f2[_0x3d7c('0x4d')]);var _0x5e67d5={'where':_0x182dda[_0x3d7c('0x48')]};return db[_0x3d7c('0x3c')][_0x3d7c('0x28')](_0x5e67d5)[_0x3d7c('0x2e')](function(_0x5ccedc){_0x275376[_0x3d7c('0x28')]=_0x5ccedc;if(_0x5dc4f2[_0x3d7c('0x40')][_0x3d7c('0x4e')]){_0x182dda[_0x3d7c('0x4f')]=[{'all':!![]}];}return db[_0x3d7c('0x3c')]['findAll'](_0x182dda);})[_0x3d7c('0x2e')](function(_0x4a1880){_0x275376[_0x3d7c('0x50')]=_0x4a1880;return _0x275376;})[_0x3d7c('0x2e')](respondWithFilteredResult(_0xc71190,_0x182dda))[_0x3d7c('0x51')](handleError(_0xc71190,null));};exports['show']=function(_0x130b89,_0x6602cb){var _0x1f999f={'raw':![],'where':{'id':_0x130b89[_0x3d7c('0x52')]['id']}},_0x180280={};_0x180280['model']=_[_0x3d7c('0x41')](db[_0x3d7c('0x3c')][_0x3d7c('0x53')]);_0x180280[_0x3d7c('0x40')]=_[_0x3d7c('0x41')](_0x130b89[_0x3d7c('0x40')]);_0x180280[_0x3d7c('0x42')]=_[_0x3d7c('0x43')](_0x180280[_0x3d7c('0x3f')],_0x180280[_0x3d7c('0x40')]);_0x1f999f['attributes']=_[_0x3d7c('0x43')](_0x180280[_0x3d7c('0x3f')],qs[_0x3d7c('0x44')](_0x130b89[_0x3d7c('0x40')][_0x3d7c('0x44')]));_0x1f999f['attributes']=_0x1f999f[_0x3d7c('0x45')][_0x3d7c('0x54')]?_0x1f999f[_0x3d7c('0x45')]:_0x180280[_0x3d7c('0x3f')];if(_0x130b89[_0x3d7c('0x40')][_0x3d7c('0x4e')]){_0x1f999f[_0x3d7c('0x4f')]=[{'all':!![]}];}_0x1f999f=_[_0x3d7c('0x4a')]({},_0x1f999f,_0x130b89['options']);return db[_0x3d7c('0x3c')]['find'](_0x1f999f)['then'](handleEntityNotFound(_0x6602cb,null))['then'](respondWithResult(_0x6602cb,null))['catch'](handleError(_0x6602cb,null));};exports['create']=function(_0xde3565,_0x4f41ac){return db['VoiceQueue'][_0x3d7c('0x55')](_0xde3565[_0x3d7c('0x56')],{})[_0x3d7c('0x2e')](function(_0x1c599e){var _0x2d45c6=_0xde3565[_0x3d7c('0x57')][_0x3d7c('0x58')]({'plain':!![]});if(!_0x2d45c6)throw new Error(_0x3d7c('0x59'));if(_0x2d45c6['role']===_0x3d7c('0x57')){var _0x63654b=_0x1c599e['get']({'plain':!![]});var _0x548d38=[{'name':_0x3d7c('0x30'),'value':'inbound'},{'name':_0x3d7c('0x31'),'value':_0x3d7c('0x32')}];var _0x5df76e=_[_0x3d7c('0x37')](_0x548d38,[_0x3d7c('0x35'),_0x63654b['type']])[_0x3d7c('0x38')];return db['UserProfileSection']['find']({'where':{'name':_0x5df76e,'userProfileId':_0x2d45c6['userProfileId']},'raw':!![]})[_0x3d7c('0x2e')](function(_0x52d012){if(_0x52d012&&_0x52d012['autoAssociation']===0x0){return db[_0x3d7c('0x39')][_0x3d7c('0x55')]({'name':_0x63654b[_0x3d7c('0x38')],'resourceId':_0x63654b['id'],'type':_0x52d012[_0x3d7c('0x38')],'sectionId':_0x52d012['id']},{})[_0x3d7c('0x2e')](function(){return _0x1c599e;});}else{return _0x1c599e;}})['catch'](function(_0x36571d){logger[_0x3d7c('0x5a')](_0x3d7c('0x5b'),_0x36571d);throw _0x36571d;});}return _0x1c599e;})[_0x3d7c('0x2e')](respondWithResult(_0x4f41ac,0xc9))[_0x3d7c('0x51')](handleError(_0x4f41ac,null));};exports[_0x3d7c('0x5c')]=function(_0x289687,_0x518f42){var _0x8b2704={'where':{'id':_0x289687[_0x3d7c('0x52')]['id']}},_0x81ccc6={};_0x81ccc6[_0x3d7c('0x3f')]=_[_0x3d7c('0x41')](db[_0x3d7c('0x3c')][_0x3d7c('0x53')]);_0x8b2704[_0x3d7c('0x45')]=_[_0x3d7c('0x43')](_0x81ccc6[_0x3d7c('0x3f')],qs[_0x3d7c('0x44')](_0x289687[_0x3d7c('0x40')]['fields']));_0x8b2704[_0x3d7c('0x45')]=_0x8b2704[_0x3d7c('0x45')][_0x3d7c('0x54')]?_0x8b2704[_0x3d7c('0x45')]:_0x81ccc6[_0x3d7c('0x3f')];if(_0x289687[_0x3d7c('0x40')][_0x3d7c('0x4e')]){_0x8b2704[_0x3d7c('0x4f')]=[{'all':!![]}];}_0x8b2704=_[_0x3d7c('0x4a')]({},_0x8b2704,_0x289687['options']);return db[_0x3d7c('0x3c')][_0x3d7c('0x37')](_0x8b2704)[_0x3d7c('0x2e')](handleEntityNotFound(_0x518f42,null))[_0x3d7c('0x2e')](function(_0x171be1){if(_0x171be1){var _0x5ab95a=_0x171be1[_0x3d7c('0x58')]({'plain':!![]});_0x5ab95a=qs[_0x3d7c('0x5d')](_0x5ab95a,['id',_0x3d7c('0x5e'),_0x3d7c('0x5f')]);_0x289687[_0x3d7c('0x56')]=_[_0x3d7c('0x5d')](_0x289687[_0x3d7c('0x56')],['id',_0x3d7c('0x5e'),_0x3d7c('0x5f')]);return db[_0x3d7c('0x3c')][_0x3d7c('0x55')](_[_0x3d7c('0x4a')](_0x5ab95a,_0x289687[_0x3d7c('0x56')]),{'include':_0x289687[_0x3d7c('0x40')][_0x3d7c('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x408c75){var _0x4d5c5d=_0x289687['user']['get']({'plain':!![]});if(!_0x4d5c5d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d5c5d[_0x3d7c('0x60')]===_0x3d7c('0x57')){var _0x51040c=_0x408c75[_0x3d7c('0x58')]({'plain':!![]});var _0x5969f3=[{'name':_0x3d7c('0x30'),'value':_0x3d7c('0x61')},{'name':_0x3d7c('0x31'),'value':'outbound'}];var _0x55af5f=_[_0x3d7c('0x37')](_0x5969f3,[_0x3d7c('0x35'),_0x51040c[_0x3d7c('0x3d')]])[_0x3d7c('0x38')];return db['UserProfileSection']['find']({'where':{'name':_0x55af5f,'userProfileId':_0x4d5c5d[_0x3d7c('0x62')]},'raw':!![]})[_0x3d7c('0x2e')](function(_0x5b8102){if(_0x5b8102&&_0x5b8102[_0x3d7c('0x63')]===0x0){return db['UserProfileResource'][_0x3d7c('0x55')]({'name':_0x51040c['name'],'resourceId':_0x51040c['id'],'type':_0x5b8102['name'],'sectionId':_0x5b8102['id']},{})[_0x3d7c('0x2e')](function(){return _0x408c75;});}else{return _0x408c75;}})[_0x3d7c('0x51')](function(_0x2901ee){logger[_0x3d7c('0x5a')](_0x3d7c('0x5b'),_0x2901ee);throw _0x2901ee;});}return _0x408c75;});}})[_0x3d7c('0x2e')](respondWithResult(_0x518f42,0xc9))[_0x3d7c('0x51')](handleError(_0x518f42,null));};exports['update']=function(_0x33401d,_0x5988f5){if(_0x33401d['body']['id']){delete _0x33401d[_0x3d7c('0x56')]['id'];}return db[_0x3d7c('0x3c')][_0x3d7c('0x37')]({'where':{'id':_0x33401d[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x5988f5,null))[_0x3d7c('0x2e')](saveUpdates(_0x33401d['body'],null))[_0x3d7c('0x2e')](respondWithResult(_0x5988f5,null))['catch'](handleError(_0x5988f5,null));};exports['destroy']=function(_0x453237,_0x26eead){return db[_0x3d7c('0x3c')][_0x3d7c('0x37')]({'where':{'id':_0x453237[_0x3d7c('0x52')]['id']}})['then'](handleEntityNotFound(_0x26eead,null))[_0x3d7c('0x2e')](removeEntity(_0x26eead,null))[_0x3d7c('0x51')](handleError(_0x26eead,null));};exports[_0x3d7c('0x64')]=function(_0x132e5b,_0x1b25ed,_0x4973ed){var _0x21e2f5={'raw':![],'where':{}};var _0x57daf7={};var _0x84bc89={'count':0x0,'rows':[]};return db[_0x3d7c('0x3c')]['findOne']({'where':{'id':_0x132e5b[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x1b25ed,null))[_0x3d7c('0x2e')](function(_0x284695){if(_0x284695){_0x57daf7[_0x3d7c('0x3f')]=_[_0x3d7c('0x41')](db[_0x3d7c('0x65')][_0x3d7c('0x53')]);_0x57daf7[_0x3d7c('0x40')]=_[_0x3d7c('0x41')](_0x132e5b[_0x3d7c('0x40')]);_0x57daf7[_0x3d7c('0x42')]=_['intersection'](_0x57daf7[_0x3d7c('0x3f')],_0x57daf7[_0x3d7c('0x40')]);_0x21e2f5[_0x3d7c('0x45')]=_[_0x3d7c('0x43')](_0x57daf7[_0x3d7c('0x3f')],qs[_0x3d7c('0x44')](_0x132e5b['query']['fields']));_0x21e2f5[_0x3d7c('0x45')]=_0x21e2f5['attributes'][_0x3d7c('0x54')]?_0x21e2f5[_0x3d7c('0x45')]:_0x57daf7[_0x3d7c('0x3f')];if(!_0x132e5b[_0x3d7c('0x40')][_0x3d7c('0x66')](_0x3d7c('0x67'))){_0x21e2f5[_0x3d7c('0x29')]=qs[_0x3d7c('0x29')](_0x132e5b[_0x3d7c('0x40')][_0x3d7c('0x29')]);_0x21e2f5['offset']=qs[_0x3d7c('0x26')](_0x132e5b['query']['offset']);}_0x21e2f5[_0x3d7c('0x46')]=qs[_0x3d7c('0x47')](_0x132e5b['query'][_0x3d7c('0x47')]);_0x21e2f5[_0x3d7c('0x48')]=qs[_0x3d7c('0x42')](_[_0x3d7c('0x49')](_0x132e5b['query'],_0x57daf7['filters']));_0x21e2f5[_0x3d7c('0x48')][_0x3d7c('0x68')]=_0x284695['id'];if(_0x132e5b['query'][_0x3d7c('0x4c')]){_0x21e2f5['where']=_['merge'](_0x21e2f5[_0x3d7c('0x48')],{'$or':_['map'](_0x21e2f5[_0x3d7c('0x45')],function(_0x8b763c){var _0x13f1b4={};_0x13f1b4[_0x8b763c]={'$like':'%'+_0x132e5b[_0x3d7c('0x40')][_0x3d7c('0x4c')]+'%'};return _0x13f1b4;})});}_0x21e2f5=_[_0x3d7c('0x4a')]({},_0x21e2f5,_0x132e5b[_0x3d7c('0x4d')]);return db[_0x3d7c('0x65')][_0x3d7c('0x28')]({'where':_0x21e2f5[_0x3d7c('0x48')]})[_0x3d7c('0x2e')](function(_0x2751a3){_0x84bc89['count']=_0x2751a3;if(_0x132e5b['query'][_0x3d7c('0x4e')]){_0x21e2f5[_0x3d7c('0x4f')]=[{'all':!![]}];}return db[_0x3d7c('0x65')][_0x3d7c('0x69')](_0x21e2f5);})[_0x3d7c('0x2e')](function(_0x10860f){_0x84bc89[_0x3d7c('0x50')]=_0x10860f;return _0x84bc89;});}})[_0x3d7c('0x2e')](respondWithFilteredResult(_0x1b25ed,_0x21e2f5))['catch'](handleError(_0x1b25ed,null));};exports[_0x3d7c('0x6a')]=function(_0x507e5d,_0x1cf23b,_0x17e7cf){var _0x8c88c2={'raw':!![],'where':{}};var _0xcd63f5={};var _0x306ab6={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3d7c('0x6b')]({'where':{'id':_0x507e5d[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x1cf23b,null))[_0x3d7c('0x2e')](function(_0x5100c4){if(_0x5100c4){_0xcd63f5[_0x3d7c('0x3f')]=_[_0x3d7c('0x41')](db[_0x3d7c('0x6c')][_0x3d7c('0x53')]);_0xcd63f5[_0x3d7c('0x40')]=_['keys'](_0x507e5d['query']);_0xcd63f5[_0x3d7c('0x42')]=_[_0x3d7c('0x43')](_0xcd63f5[_0x3d7c('0x3f')],_0xcd63f5[_0x3d7c('0x40')]);_0x8c88c2[_0x3d7c('0x45')]=_[_0x3d7c('0x43')](_0xcd63f5[_0x3d7c('0x3f')],qs['fields'](_0x507e5d[_0x3d7c('0x40')][_0x3d7c('0x44')]));_0x8c88c2[_0x3d7c('0x45')]=_0x8c88c2[_0x3d7c('0x45')][_0x3d7c('0x54')]?_0x8c88c2[_0x3d7c('0x45')]:_0xcd63f5[_0x3d7c('0x3f')];if(!_0x507e5d[_0x3d7c('0x40')][_0x3d7c('0x66')](_0x3d7c('0x67'))){_0x8c88c2[_0x3d7c('0x29')]=qs[_0x3d7c('0x29')](_0x507e5d[_0x3d7c('0x40')][_0x3d7c('0x29')]);_0x8c88c2[_0x3d7c('0x26')]=qs['offset'](_0x507e5d[_0x3d7c('0x40')][_0x3d7c('0x26')]);}_0x8c88c2['order']=qs['sort'](_0x507e5d[_0x3d7c('0x40')]['sort']);_0x8c88c2[_0x3d7c('0x48')]=qs[_0x3d7c('0x42')](_[_0x3d7c('0x49')](_0x507e5d['query'],_0xcd63f5[_0x3d7c('0x42')]));_0x8c88c2[_0x3d7c('0x48')]['VoiceQueueId']=_0x5100c4['id'];if(_0x507e5d[_0x3d7c('0x40')][_0x3d7c('0x4c')]){_0x8c88c2['where']=_[_0x3d7c('0x4a')](_0x8c88c2[_0x3d7c('0x48')],{'$or':_[_0x3d7c('0x34')](_0x8c88c2[_0x3d7c('0x45')],function(_0x4dbb09){var _0x45e6e1={};_0x45e6e1[_0x4dbb09]={'$like':'%'+_0x507e5d[_0x3d7c('0x40')][_0x3d7c('0x4c')]+'%'};return _0x45e6e1;})});}_0x8c88c2=_['merge']({},_0x8c88c2,_0x507e5d['options']);return db['CmHopperHistory'][_0x3d7c('0x28')]({'where':_0x8c88c2['where']})[_0x3d7c('0x2e')](function(_0x59bf60){_0x306ab6[_0x3d7c('0x28')]=_0x59bf60;if(_0x507e5d[_0x3d7c('0x40')][_0x3d7c('0x4e')]){_0x8c88c2[_0x3d7c('0x4f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3d7c('0x69')](_0x8c88c2);})[_0x3d7c('0x2e')](function(_0x1f5699){_0x306ab6['rows']=_0x1f5699;return _0x306ab6;});}})[_0x3d7c('0x2e')](respondWithFilteredResult(_0x1cf23b,_0x8c88c2))[_0x3d7c('0x51')](handleError(_0x1cf23b,null));};exports['getHopperFinals']=function(_0x5751d3,_0x4edf66,_0x388bec){var _0x1d0296={'raw':!![],'where':{}};var _0x5ebbe1={};var _0x5e410c={'count':0x0,'rows':[]};return db[_0x3d7c('0x3c')][_0x3d7c('0x6b')]({'where':{'id':_0x5751d3[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x4edf66,null))[_0x3d7c('0x2e')](function(_0x4f2214){if(_0x4f2214){_0x5ebbe1[_0x3d7c('0x3f')]=_['keys'](db[_0x3d7c('0x6d')]['rawAttributes']);_0x5ebbe1[_0x3d7c('0x40')]=_[_0x3d7c('0x41')](_0x5751d3[_0x3d7c('0x40')]);_0x5ebbe1[_0x3d7c('0x42')]=_[_0x3d7c('0x43')](_0x5ebbe1[_0x3d7c('0x3f')],_0x5ebbe1[_0x3d7c('0x40')]);_0x1d0296[_0x3d7c('0x45')]=_[_0x3d7c('0x43')](_0x5ebbe1[_0x3d7c('0x3f')],qs[_0x3d7c('0x44')](_0x5751d3[_0x3d7c('0x40')][_0x3d7c('0x44')]));_0x1d0296[_0x3d7c('0x45')]=_0x1d0296[_0x3d7c('0x45')][_0x3d7c('0x54')]?_0x1d0296[_0x3d7c('0x45')]:_0x5ebbe1[_0x3d7c('0x3f')];if(!_0x5751d3[_0x3d7c('0x40')][_0x3d7c('0x66')](_0x3d7c('0x67'))){_0x1d0296[_0x3d7c('0x29')]=qs['limit'](_0x5751d3[_0x3d7c('0x40')][_0x3d7c('0x29')]);_0x1d0296[_0x3d7c('0x26')]=qs[_0x3d7c('0x26')](_0x5751d3[_0x3d7c('0x40')][_0x3d7c('0x26')]);}_0x1d0296[_0x3d7c('0x46')]=qs[_0x3d7c('0x47')](_0x5751d3[_0x3d7c('0x40')][_0x3d7c('0x47')]);_0x1d0296[_0x3d7c('0x48')]=qs[_0x3d7c('0x42')](_[_0x3d7c('0x49')](_0x5751d3[_0x3d7c('0x40')],_0x5ebbe1[_0x3d7c('0x42')]));_0x1d0296[_0x3d7c('0x48')]['VoiceQueueId']=_0x4f2214['id'];if(_0x5751d3[_0x3d7c('0x40')]['filter']){_0x1d0296[_0x3d7c('0x48')]=_[_0x3d7c('0x4a')](_0x1d0296[_0x3d7c('0x48')],{'$or':_[_0x3d7c('0x34')](_0x1d0296[_0x3d7c('0x45')],function(_0x31a83a){var _0x2f830d={};_0x2f830d[_0x31a83a]={'$like':'%'+_0x5751d3[_0x3d7c('0x40')]['filter']+'%'};return _0x2f830d;})});}_0x1d0296=_[_0x3d7c('0x4a')]({},_0x1d0296,_0x5751d3['options']);return db[_0x3d7c('0x6d')]['count']({'where':_0x1d0296[_0x3d7c('0x48')]})[_0x3d7c('0x2e')](function(_0x385d7b){_0x5e410c['count']=_0x385d7b;if(_0x5751d3['query'][_0x3d7c('0x4e')]){_0x1d0296[_0x3d7c('0x4f')]=[{'all':!![]}];}return db[_0x3d7c('0x6d')][_0x3d7c('0x69')](_0x1d0296);})[_0x3d7c('0x2e')](function(_0x24fd97){_0x5e410c[_0x3d7c('0x50')]=_0x24fd97;return _0x5e410c;});}})[_0x3d7c('0x2e')](respondWithFilteredResult(_0x4edf66,_0x1d0296))[_0x3d7c('0x51')](handleError(_0x4edf66,null));};exports[_0x3d7c('0x6e')]=function(_0x4243fd,_0x4d80ab,_0x26e2cd){var _0x2d6794={'raw':!![],'where':{}};var _0xc1dfe5={};var _0x23fb21={'count':0x0,'rows':[]};return db[_0x3d7c('0x3c')][_0x3d7c('0x6b')]({'where':{'id':_0x4243fd[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x4d80ab,null))[_0x3d7c('0x2e')](function(_0x517680){if(_0x517680){_0xc1dfe5['model']=_[_0x3d7c('0x41')](db[_0x3d7c('0x6f')][_0x3d7c('0x53')]);_0xc1dfe5[_0x3d7c('0x40')]=_[_0x3d7c('0x41')](_0x4243fd[_0x3d7c('0x40')]);_0xc1dfe5[_0x3d7c('0x42')]=_[_0x3d7c('0x43')](_0xc1dfe5[_0x3d7c('0x3f')],_0xc1dfe5[_0x3d7c('0x40')]);_0x2d6794[_0x3d7c('0x45')]=_[_0x3d7c('0x43')](_0xc1dfe5[_0x3d7c('0x3f')],qs['fields'](_0x4243fd[_0x3d7c('0x40')]['fields']));_0x2d6794[_0x3d7c('0x45')]=_0x2d6794[_0x3d7c('0x45')][_0x3d7c('0x54')]?_0x2d6794[_0x3d7c('0x45')]:_0xc1dfe5['model'];if(!_0x4243fd[_0x3d7c('0x40')][_0x3d7c('0x66')](_0x3d7c('0x67'))){_0x2d6794[_0x3d7c('0x29')]=qs[_0x3d7c('0x29')](_0x4243fd[_0x3d7c('0x40')][_0x3d7c('0x29')]);_0x2d6794[_0x3d7c('0x26')]=qs[_0x3d7c('0x26')](_0x4243fd[_0x3d7c('0x40')]['offset']);}_0x2d6794[_0x3d7c('0x46')]=qs[_0x3d7c('0x47')](_0x4243fd[_0x3d7c('0x40')][_0x3d7c('0x47')]);_0x2d6794[_0x3d7c('0x48')]=qs[_0x3d7c('0x42')](_[_0x3d7c('0x49')](_0x4243fd[_0x3d7c('0x40')],_0xc1dfe5[_0x3d7c('0x42')]));_0x2d6794[_0x3d7c('0x48')][_0x3d7c('0x68')]=_0x517680['id'];if(_0x4243fd[_0x3d7c('0x40')][_0x3d7c('0x4c')]){_0x2d6794[_0x3d7c('0x48')]=_[_0x3d7c('0x4a')](_0x2d6794[_0x3d7c('0x48')],{'$or':_[_0x3d7c('0x34')](_0x2d6794[_0x3d7c('0x45')],function(_0x1c176a){var _0x1b4e45={};_0x1b4e45[_0x1c176a]={'$like':'%'+_0x4243fd['query']['filter']+'%'};return _0x1b4e45;})});}_0x2d6794=_['merge']({},_0x2d6794,_0x4243fd[_0x3d7c('0x4d')]);return db[_0x3d7c('0x6f')]['count']({'where':_0x2d6794[_0x3d7c('0x48')]})[_0x3d7c('0x2e')](function(_0x5570be){_0x23fb21[_0x3d7c('0x28')]=_0x5570be;if(_0x4243fd[_0x3d7c('0x40')][_0x3d7c('0x4e')]){_0x2d6794[_0x3d7c('0x4f')]=[{'all':!![]}];}return db[_0x3d7c('0x6f')][_0x3d7c('0x69')](_0x2d6794);})[_0x3d7c('0x2e')](function(_0x2c6b39){_0x23fb21[_0x3d7c('0x50')]=_0x2c6b39;return _0x23fb21;});}})[_0x3d7c('0x2e')](respondWithFilteredResult(_0x4d80ab,_0x2d6794))[_0x3d7c('0x51')](handleError(_0x4d80ab,null));};exports[_0x3d7c('0x70')]=function(_0x584f24,_0x162ec0,_0x170d89){var _0x5376c6={};var _0xbed6bc={};var _0x4915d5;var _0x4888ab;return db[_0x3d7c('0x3c')][_0x3d7c('0x6b')]({'where':{'id':_0x584f24[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x162ec0,null))[_0x3d7c('0x2e')](function(_0x5ecc75){if(_0x5ecc75){_0x4915d5=_0x5ecc75;_0xbed6bc[_0x3d7c('0x3f')]=_[_0x3d7c('0x41')](db[_0x3d7c('0x71')][_0x3d7c('0x53')]);_0xbed6bc['query']=_['keys'](_0x584f24['query']);_0xbed6bc['filters']=_[_0x3d7c('0x43')](_0xbed6bc[_0x3d7c('0x3f')],_0xbed6bc[_0x3d7c('0x40')]);_0x5376c6[_0x3d7c('0x45')]=_[_0x3d7c('0x43')](_0xbed6bc[_0x3d7c('0x3f')],qs[_0x3d7c('0x44')](_0x584f24[_0x3d7c('0x40')][_0x3d7c('0x44')]));_0x5376c6[_0x3d7c('0x45')]=_0x5376c6[_0x3d7c('0x45')][_0x3d7c('0x54')]?_0x5376c6['attributes']:_0xbed6bc[_0x3d7c('0x3f')];_0x5376c6[_0x3d7c('0x46')]=qs[_0x3d7c('0x47')](_0x584f24[_0x3d7c('0x40')]['sort']);_0x5376c6['where']=qs[_0x3d7c('0x42')](_[_0x3d7c('0x49')](_0x584f24[_0x3d7c('0x40')],_0xbed6bc[_0x3d7c('0x42')]));if(_0x584f24[_0x3d7c('0x40')][_0x3d7c('0x4c')]){_0x5376c6[_0x3d7c('0x48')]=_['merge'](_0x5376c6[_0x3d7c('0x48')],{'$or':_[_0x3d7c('0x34')](_0x5376c6['attributes'],function(_0x2f0bd6){var _0x37aad7={};_0x37aad7[_0x2f0bd6]={'$like':'%'+_0x584f24[_0x3d7c('0x40')][_0x3d7c('0x4c')]+'%'};return _0x37aad7;})});}_0x5376c6=_[_0x3d7c('0x4a')]({},_0x5376c6,_0x584f24['options']);return _0x4915d5['getTeams'](_0x5376c6);}})[_0x3d7c('0x2e')](function(_0x4839dc){if(_0x4839dc){_0x4888ab=_0x4839dc[_0x3d7c('0x54')];if(!_0x584f24[_0x3d7c('0x40')][_0x3d7c('0x66')]('nolimit')){_0x5376c6[_0x3d7c('0x29')]=qs[_0x3d7c('0x29')](_0x584f24[_0x3d7c('0x40')]['limit']);_0x5376c6[_0x3d7c('0x26')]=qs[_0x3d7c('0x26')](_0x584f24[_0x3d7c('0x40')]['offset']);}return _0x4915d5[_0x3d7c('0x70')](_0x5376c6);}})['then'](function(_0x4277f4){if(_0x4277f4){return _0x4277f4?{'count':_0x4888ab,'rows':_0x4277f4}:null;}})[_0x3d7c('0x2e')](respondWithResult(_0x162ec0,null))[_0x3d7c('0x51')](handleError(_0x162ec0,null));};exports[_0x3d7c('0x72')]=function(_0x3e4817,_0x11787b,_0x17e25a){var _0x37742d=_0x3e4817[_0x3d7c('0x56')][_0x3d7c('0x73')];var _0x20968=_[_0x3d7c('0x34')](_0x37742d,'id');return db[_0x3d7c('0x71')]['findAll']({'where':{'id':_0x20968},'attributes':['id'],'include':[{'model':db[_0x3d7c('0x74')],'as':_0x3d7c('0x75'),'attributes':['id',_0x3d7c('0x38'),'online',_0x3d7c('0x76'),'interface'],'raw':!![]}]})['then'](function(_0x242ad0){if(_0x242ad0){var _0xedd17a=_[_0x3d7c('0x77')](_0x242ad0,function(_0x11f77e){var _0x11f603=_0x11f77e[_0x3d7c('0x58')]({'plain':!![]});_0x11f603[_0x3d7c('0x75')][_0x3d7c('0x78')](function(_0x64dc95){_0x64dc95[_0x3d7c('0x79')]=_[_0x3d7c('0x37')](_0x37742d,{'id':_0x11f603['id']})['penalty'];});return _0x11f603[_0x3d7c('0x75')];});return db[_0x3d7c('0x3c')][_0x3d7c('0x37')]({'where':{'id':_0x3e4817[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](function(_0x33db2c){return db[_0x3d7c('0x7a')][_0x3d7c('0x7b')](function(_0x46bc86){return _0x33db2c[_0x3d7c('0x72')](_0x20968,{'transaction':_0x46bc86})['then'](function(){return BPromise[_0x3d7c('0x7c')](_0x37742d,function(_0x1e0d0b){return db[_0x3d7c('0x7d')][_0x3d7c('0x7e')]({'TeamId':_0x1e0d0b['id'],'VoiceQueueId':_0x3e4817[_0x3d7c('0x52')]['id'],'penalty':_0x1e0d0b[_0x3d7c('0x79')]},{'transaction':_0x46bc86});});})['then'](function(){return BPromise['each'](_0xedd17a,function(_0x225272){return db[_0x3d7c('0x7f')][_0x3d7c('0x80')]({'where':{'UserId':_0x225272['id'],'VoiceQueueId':_0x3e4817[_0x3d7c('0x52')]['id']},'defaults':{'penalty':_0x225272['penalty']},'transaction':_0x46bc86});});})[_0x3d7c('0x2e')](function(){return BPromise[_0x3d7c('0x7c')](_[_0x3d7c('0x4c')](_0xedd17a,{'online':!![]}),function(_0x37ad41){return db[_0x3d7c('0x81')]['upsert']({'membername':_0x37ad41[_0x3d7c('0x38')],'UserId':_0x37ad41['id'],'queue_name':_0x33db2c[_0x3d7c('0x38')],'VoiceQueueId':_0x33db2c['id'],'interface':_[_0x3d7c('0x82')](_0x37ad41[_0x3d7c('0x83')])?util[_0x3d7c('0x84')](_0x3d7c('0x85'),_0x37ad41['name']):_0x37ad41['interface'],'paused':_0x37ad41[_0x3d7c('0x76')]||![],'penalty':_0x37ad41[_0x3d7c('0x79')]},{'transaction':_0x46bc86});});})[_0x3d7c('0x2e')](function(){_0xedd17a[_0x3d7c('0x78')](function(_0x44ddb8){socket['emit'](_0x3d7c('0x86'),{'UserId':_0x44ddb8['id'],'VoiceQueueId':_0x33db2c['id']});});});});});}})[_0x3d7c('0x2e')](respondWithStatusCode(_0x11787b,null))[_0x3d7c('0x51')](handleError(_0x11787b,null));};exports[_0x3d7c('0x87')]=function(_0x2fbd95,_0x5a6f90,_0x50fbd9){return db['Team'][_0x3d7c('0x69')]({'where':{'id':_0x2fbd95['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3d7c('0x74')],'as':_0x3d7c('0x75'),'attributes':['id'],'raw':!![]}]})[_0x3d7c('0x2e')](handleEntityNotFound(_0x5a6f90,null))[_0x3d7c('0x2e')](function(_0x17eab6){var _0x3ba3ff=_[_0x3d7c('0x34')](_0x17eab6,'id');var _0x100a28=[];var _0x3fb41=[];var _0x31a60f=squel[_0x3d7c('0x88')]();_0x31a60f[_0x3d7c('0x89')](_0x3d7c('0x8a'))[_0x3d7c('0x8b')]('team_has_voice_queues','tq')['join'](_0x3d7c('0x8c'),'ut',_0x3d7c('0x8d'))[_0x3d7c('0x48')]('VoiceQueueId\x20=\x20?',_0x2fbd95[_0x3d7c('0x52')]['id']);for(var _0x3c60d7=0x0;_0x3c60d7<_0x17eab6[_0x3d7c('0x54')];_0x3c60d7+=0x1){let _0x1f1e03=_0x17eab6[_0x3c60d7];for(var _0x2be935=0x0;_0x2be935<_0x1f1e03[_0x3d7c('0x75')][_0x3d7c('0x54')];_0x2be935+=0x1){let _0x202546=_0x1f1e03[_0x3d7c('0x75')][_0x2be935];var _0x6de625=_0x31a60f['clone']();_0x6de625[_0x3d7c('0x48')](_0x3d7c('0x8e'),_0x202546['id']);_0x3fb41['push'](db[_0x3d7c('0x7a')][_0x3d7c('0x40')](_0x6de625[_0x3d7c('0x8f')](),{'type':db[_0x3d7c('0x7a')][_0x3d7c('0x90')][_0x3d7c('0x91')]})[_0x3d7c('0x2e')](function(_0x3006d2){if(_0x3006d2[_0x3d7c('0x54')]===0x1){return _0x202546['id'];}else{var _0x43eed2=_[_0x3d7c('0x92')](_[_0x3d7c('0x34')](_0x3006d2,_0x3d7c('0x93')),function(_0xb2f4fd){return _[_0x3d7c('0x36')](_0x3ba3ff,_0xb2f4fd);});if(_0x43eed2){return _0x202546['id'];}}}));}}return BPromise[_0x3d7c('0x94')](_0x3fb41)[_0x3d7c('0x2e')](function(_0x185bfd){_0x100a28=_(_0x100a28)['union'](_0x185bfd)['compact']()[_0x3d7c('0x35')]();return db['VoiceQueue'][_0x3d7c('0x37')]({'where':{'id':_0x2fbd95[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](function(_0x49faf2){return db[_0x3d7c('0x7a')]['transaction'](function(_0x5e8a45){return _0x49faf2[_0x3d7c('0x87')](_0x2fbd95[_0x3d7c('0x40')]['ids'],{'transaction':_0x5e8a45})[_0x3d7c('0x2e')](function(){if(!_[_0x3d7c('0x95')](_0x100a28)){return _0x49faf2[_0x3d7c('0x96')](_0x100a28,{'transaction':_0x5e8a45})[_0x3d7c('0x2e')](function(){return db[_0x3d7c('0x81')][_0x3d7c('0x2f')]({'where':{'VoiceQueueId':_0x2fbd95[_0x3d7c('0x52')]['id'],'UserId':_0x100a28},'transaction':_0x5e8a45});});}})[_0x3d7c('0x2e')](function(){_0x100a28[_0x3d7c('0x78')](function(_0xd25f62){socket[_0x3d7c('0x97')](_0x3d7c('0x98'),{'UserId':_0xd25f62,'VoiceQueueId':_0x49faf2['id']});});});});});});})[_0x3d7c('0x2e')](respondWithStatusCode(_0x5a6f90,null))[_0x3d7c('0x51')](handleError(_0x5a6f90,null));};exports[_0x3d7c('0x99')]=function(_0x3e450d,_0x55ad92,_0x33fda1){var _0x2f390d,_0x1b3fa0;return db[_0x3d7c('0x3c')][_0x3d7c('0x37')]({'where':{'id':_0x3e450d[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x55ad92,null))['then'](function(_0x1d2e2c){if(_0x1d2e2c){_0x1b3fa0=_0x1d2e2c;return _0x1d2e2c[_0x3d7c('0x99')](_0x3e450d[_0x3d7c('0x56')][_0x3d7c('0x9a')],_[_0x3d7c('0x5d')](_0x3e450d[_0x3d7c('0x56')],['ids','id'])||{})[_0x3d7c('0x9b')](function(_0x3faa3e){for(var _0x38a07a=0x0;_0x38a07a<_0x3e450d['body']['ids']['length'];_0x38a07a+=0x1){socket[_0x3d7c('0x97')]('userVoiceQueue:save',{'UserId':Number(_0x3e450d['body']['ids'][_0x38a07a]),'VoiceQueueId':Number(_0x3e450d[_0x3d7c('0x52')]['id'])});}return _0x3faa3e;});}})[_0x3d7c('0x2e')](function(_0x3f2b34){_0x2f390d=_0x3f2b34||[];if(_0x1b3fa0){return db[_0x3d7c('0x74')][_0x3d7c('0x69')]({'where':{'id':_0x3e450d[_0x3d7c('0x56')][_0x3d7c('0x9a')]},'attributes':['id',_0x3d7c('0x38'),_0x3d7c('0x9c'),_0x3d7c('0x76'),'interface'],'raw':!![]});}})['then'](function(_0x1d3bf0){if(!_['isEmpty'](_0x1d3bf0)){var _0x209495=[];for(var _0x3c78a5=0x0;_0x3c78a5<_0x1d3bf0['length'];_0x3c78a5++){if(_0x1d3bf0[_0x3c78a5][_0x3d7c('0x9c')]){_0x209495['push'](db[_0x3d7c('0x81')]['upsert']({'membername':_0x1d3bf0[_0x3c78a5][_0x3d7c('0x38')],'UserId':_0x1d3bf0[_0x3c78a5]['id'],'queue_name':_0x1b3fa0[_0x3d7c('0x38')],'VoiceQueueId':_0x1b3fa0['id'],'interface':_[_0x3d7c('0x82')](_0x1d3bf0[_0x3c78a5][_0x3d7c('0x83')])?util[_0x3d7c('0x84')](_0x3d7c('0x85'),_0x1d3bf0[_0x3c78a5][_0x3d7c('0x38')]):_0x1d3bf0[_0x3c78a5][_0x3d7c('0x83')],'paused':_0x1d3bf0[_0x3c78a5]['voicePause']||![],'penalty':_0x3e450d[_0x3d7c('0x56')][_0x3d7c('0x79')]||0x0}));}}return BPromise[_0x3d7c('0x94')](_0x209495);}})['then'](function(){return _0x2f390d;})[_0x3d7c('0x2e')](respondWithResult(_0x55ad92,null))[_0x3d7c('0x51')](handleError(_0x55ad92,null));};exports[_0x3d7c('0x96')]=function(_0x3bc50d,_0x237851,_0x4a7680){return db['VoiceQueue'][_0x3d7c('0x37')]({'where':{'id':_0x3bc50d['params']['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x237851,null))[_0x3d7c('0x2e')](function(_0x2fdf9a){if(_0x2fdf9a){return _0x2fdf9a[_0x3d7c('0x96')](_0x3bc50d[_0x3d7c('0x40')]['ids'])['then'](function(){if(_[_0x3d7c('0x9d')](_0x3bc50d[_0x3d7c('0x40')][_0x3d7c('0x9a')])){for(var _0x3276c6=0x0;_0x3276c6<_0x3bc50d['query']['ids']['length'];_0x3276c6+=0x1){socket[_0x3d7c('0x97')](_0x3d7c('0x98'),{'UserId':Number(_0x3bc50d['query']['ids'][_0x3276c6]),'VoiceQueueId':Number(_0x3bc50d[_0x3d7c('0x52')]['id'])});}}else{socket[_0x3d7c('0x97')](_0x3d7c('0x98'),{'UserId':Number(_0x3bc50d[_0x3d7c('0x40')][_0x3d7c('0x9a')]),'VoiceQueueId':Number(_0x3bc50d[_0x3d7c('0x52')]['id'])});}});}})[_0x3d7c('0x2e')](function(_0x18bec2){return db[_0x3d7c('0x81')][_0x3d7c('0x2f')]({'where':{'VoiceQueueId':_0x3bc50d[_0x3d7c('0x52')]['id'],'UserId':_0x3bc50d[_0x3d7c('0x40')][_0x3d7c('0x9a')]}})[_0x3d7c('0x2e')](function(){return _0x18bec2;});})[_0x3d7c('0x2e')](respondWithStatusCode(_0x237851,null))[_0x3d7c('0x51')](handleError(_0x237851,null));};exports[_0x3d7c('0x9e')]=function(_0x4ceb75,_0x2e5705,_0x3e9601){var _0x2b1381={};var _0x55afad={};var _0x3b863d;var _0x5038e4;return db[_0x3d7c('0x3c')]['findOne']({'where':{'id':_0x4ceb75[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x2e5705,null))['then'](function(_0x173576){if(_0x173576){_0x3b863d=_0x173576;_0x55afad[_0x3d7c('0x3f')]=_[_0x3d7c('0x41')](db[_0x3d7c('0x74')]['rawAttributes']);_0x55afad[_0x3d7c('0x40')]=_[_0x3d7c('0x41')](_0x4ceb75[_0x3d7c('0x40')]);_0x55afad[_0x3d7c('0x42')]=_[_0x3d7c('0x43')](_0x55afad[_0x3d7c('0x3f')],_0x55afad['query']);_0x2b1381[_0x3d7c('0x45')]=_[_0x3d7c('0x43')](_0x55afad[_0x3d7c('0x3f')],qs[_0x3d7c('0x44')](_0x4ceb75[_0x3d7c('0x40')][_0x3d7c('0x44')]));_0x2b1381[_0x3d7c('0x45')]=_0x2b1381[_0x3d7c('0x45')]['length']?_0x2b1381[_0x3d7c('0x45')]:_0x55afad[_0x3d7c('0x3f')];_0x2b1381[_0x3d7c('0x46')]=qs['sort'](_0x4ceb75['query'][_0x3d7c('0x47')]);_0x2b1381['where']=qs[_0x3d7c('0x42')](_[_0x3d7c('0x49')](_0x4ceb75[_0x3d7c('0x40')],_0x55afad[_0x3d7c('0x42')]));if(_0x4ceb75[_0x3d7c('0x40')]['filter']){_0x2b1381[_0x3d7c('0x48')]=_['merge'](_0x2b1381[_0x3d7c('0x48')],{'$or':_[_0x3d7c('0x34')](_0x2b1381[_0x3d7c('0x45')],function(_0x240682){var _0x5e86cd={};_0x5e86cd[_0x240682]={'$like':'%'+_0x4ceb75[_0x3d7c('0x40')][_0x3d7c('0x4c')]+'%'};return _0x5e86cd;})});}_0x2b1381=_[_0x3d7c('0x4a')]({},_0x2b1381,_0x4ceb75[_0x3d7c('0x4d')]);return _0x3b863d[_0x3d7c('0x9e')](_0x2b1381);}})[_0x3d7c('0x2e')](function(_0x42b394){if(_0x42b394){_0x5038e4=_0x42b394['length'];if(!_0x4ceb75['query'][_0x3d7c('0x66')](_0x3d7c('0x67'))){_0x2b1381['limit']=qs[_0x3d7c('0x29')](_0x4ceb75[_0x3d7c('0x40')][_0x3d7c('0x29')]);_0x2b1381['offset']=qs['offset'](_0x4ceb75[_0x3d7c('0x40')][_0x3d7c('0x26')]);}return _0x3b863d['getAgents'](_0x2b1381);}})[_0x3d7c('0x2e')](function(_0xdfe735){if(_0xdfe735){return _0xdfe735?{'count':_0x5038e4,'rows':_0xdfe735}:null;}})['then'](respondWithResult(_0x2e5705,null))[_0x3d7c('0x51')](handleError(_0x2e5705,null));};exports[_0x3d7c('0x9f')]=function(_0x4bdc7a,_0x5120ff,_0x34bca0){var _0x359758={};var _0x234fd9={};var _0x1d7e3c;var _0x5d895f;return db[_0x3d7c('0x3c')]['findOne']({'where':{'id':_0x4bdc7a['params']['id']}})['then'](handleEntityNotFound(_0x5120ff,null))[_0x3d7c('0x2e')](function(_0xbe5a02){if(_0xbe5a02){_0x1d7e3c=_0xbe5a02;_0x234fd9['model']=_[_0x3d7c('0x41')](db['UserVoiceQueueRt'][_0x3d7c('0x53')]);_0x234fd9[_0x3d7c('0x40')]=_[_0x3d7c('0x41')](_0x4bdc7a['query']);_0x234fd9[_0x3d7c('0x42')]=_[_0x3d7c('0x43')](_0x234fd9[_0x3d7c('0x3f')],_0x234fd9[_0x3d7c('0x40')]);_0x359758['attributes']=_[_0x3d7c('0x43')](_0x234fd9['model'],qs[_0x3d7c('0x44')](_0x4bdc7a['query']['fields']));_0x359758[_0x3d7c('0x45')]=_0x359758[_0x3d7c('0x45')][_0x3d7c('0x54')]?_0x359758[_0x3d7c('0x45')]:_0x234fd9[_0x3d7c('0x3f')];_0x359758['order']=qs[_0x3d7c('0x47')](_0x4bdc7a['query']['sort']);_0x359758['where']=qs[_0x3d7c('0x42')](_[_0x3d7c('0x49')](_0x4bdc7a[_0x3d7c('0x40')],_0x234fd9[_0x3d7c('0x42')]));if(_0x4bdc7a[_0x3d7c('0x40')][_0x3d7c('0x4c')]){_0x359758['where']=_['merge'](_0x359758['where'],{'$or':_[_0x3d7c('0x34')](_0x359758[_0x3d7c('0x45')],function(_0x4e8997){var _0x23e384={};_0x23e384[_0x4e8997]={'$like':'%'+_0x4bdc7a[_0x3d7c('0x40')][_0x3d7c('0x4c')]+'%'};return _0x23e384;})});}_0x359758=_['merge']({},_0x359758,_0x4bdc7a['options']);return _0x1d7e3c[_0x3d7c('0x9f')](_0x359758);}})['then'](function(_0xd18839){if(_0xd18839){_0x5d895f=_0xd18839[_0x3d7c('0x54')];if(!_0x4bdc7a[_0x3d7c('0x40')][_0x3d7c('0x66')](_0x3d7c('0x67'))){_0x359758[_0x3d7c('0x29')]=qs['limit'](_0x4bdc7a[_0x3d7c('0x40')][_0x3d7c('0x29')]);_0x359758[_0x3d7c('0x26')]=qs[_0x3d7c('0x26')](_0x4bdc7a[_0x3d7c('0x40')]['offset']);}return _0x1d7e3c[_0x3d7c('0x9f')](_0x359758);}})[_0x3d7c('0x2e')](function(_0x406fc6){return _0x406fc6?{'count':_0x5d895f,'rows':_0x406fc6}:null;})[_0x3d7c('0x2e')](respondWithResult(_0x5120ff,null))[_0x3d7c('0x51')](handleError(_0x5120ff,null));};exports['getLists']=function(_0x34c626,_0xaa709a,_0x22061d){var _0x391fe5={};var _0xcaaa35={};var _0x4680fc;var _0x53c122;return db[_0x3d7c('0x3c')][_0x3d7c('0x6b')]({'where':{'id':_0x34c626['params']['id']}})['then'](handleEntityNotFound(_0xaa709a,null))[_0x3d7c('0x2e')](function(_0x198d0e){if(_0x198d0e){_0x4680fc=_0x198d0e;_0xcaaa35[_0x3d7c('0x3f')]=_[_0x3d7c('0x41')](db[_0x3d7c('0xa0')][_0x3d7c('0x53')]);_0xcaaa35[_0x3d7c('0x40')]=_['keys'](_0x34c626[_0x3d7c('0x40')]);_0xcaaa35[_0x3d7c('0x42')]=_[_0x3d7c('0x43')](_0xcaaa35[_0x3d7c('0x3f')],_0xcaaa35['query']);_0x391fe5['attributes']=_['intersection'](_0xcaaa35['model'],qs[_0x3d7c('0x44')](_0x34c626[_0x3d7c('0x40')][_0x3d7c('0x44')]));_0x391fe5[_0x3d7c('0x45')]=_0x391fe5[_0x3d7c('0x45')]['length']?_0x391fe5[_0x3d7c('0x45')]:_0xcaaa35[_0x3d7c('0x3f')];_0x391fe5['order']=qs[_0x3d7c('0x47')](_0x34c626[_0x3d7c('0x40')][_0x3d7c('0x47')]);_0x391fe5[_0x3d7c('0x48')]=qs['filters'](_['pick'](_0x34c626[_0x3d7c('0x40')],_0xcaaa35['filters']));if(_0x34c626[_0x3d7c('0x40')][_0x3d7c('0x4c')]){_0x391fe5['where']=_[_0x3d7c('0x4a')](_0x391fe5['where'],{'$or':_[_0x3d7c('0x34')](_0x391fe5['attributes'],function(_0x2829b1){var _0xc78298={};_0xc78298[_0x2829b1]={'$like':'%'+_0x34c626[_0x3d7c('0x40')][_0x3d7c('0x4c')]+'%'};return _0xc78298;})});}_0x391fe5=_['merge']({},_0x391fe5,_0x34c626['options']);return _0x4680fc[_0x3d7c('0xa1')](_0x391fe5);}})[_0x3d7c('0x2e')](function(_0x5dfcaa){if(_0x5dfcaa){_0x53c122=_0x5dfcaa[_0x3d7c('0x54')];if(!_0x34c626[_0x3d7c('0x40')][_0x3d7c('0x66')](_0x3d7c('0x67'))){_0x391fe5[_0x3d7c('0x29')]=qs[_0x3d7c('0x29')](_0x34c626[_0x3d7c('0x40')]['limit']);_0x391fe5['offset']=qs[_0x3d7c('0x26')](_0x34c626['query'][_0x3d7c('0x26')]);}return _0x4680fc[_0x3d7c('0xa1')](_0x391fe5);}})['then'](function(_0x5d352c){if(_0x5d352c){return _0x5d352c?{'count':_0x53c122,'rows':_0x5d352c}:null;}})[_0x3d7c('0x2e')](respondWithResult(_0xaa709a,null))['catch'](handleError(_0xaa709a,null));};exports[_0x3d7c('0xa2')]=function(_0x2b152b,_0x19e23b,_0x5d4bd3){var _0x16d0d1=moment()[_0x3d7c('0x84')](_0x3d7c('0xa3'));var _0x42ac15,_0x569662;return db[_0x3d7c('0x3c')][_0x3d7c('0x37')]({'where':{'id':_0x2b152b['params']['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x19e23b,null))[_0x3d7c('0x2e')](function(_0x21f0c8){if(_0x21f0c8){_0x569662=_0x21f0c8;return _0x21f0c8[_0x3d7c('0xa2')](_0x2b152b['body'][_0x3d7c('0x9a')],_[_0x3d7c('0x5d')](_0x2b152b[_0x3d7c('0x56')],[_0x3d7c('0x9a'),'id'])||{});}return null;})['spread'](function(_0x10eb93){var _0x312308;_0x42ac15=_0x10eb93||[];var _0x4b2139=[];if(_0x10eb93){for(var _0x367ce9=0x0;_0x367ce9<_0x10eb93['length'];_0x367ce9+=0x1){var _0x4ab28d=_0x10eb93[_0x367ce9][_0x3d7c('0x58')]({'plain':!![]});_0x569662[_0x3d7c('0xa4')]=_0x2b152b[_0x3d7c('0x56')][_0x3d7c('0xa4')]?_0x2b152b['body'][_0x3d7c('0xa4')]:_0x569662[_0x3d7c('0xa4')];switch(_0x569662[_0x3d7c('0xa4')]){case'always':_0x312308=squel[_0x3d7c('0xa5')]()['into'](_0x3d7c('0xa6'))[_0x3d7c('0xa7')]([_0x3d7c('0xa8'),_0x3d7c('0xa9'),_0x3d7c('0xaa'),'ListId',_0x3d7c('0x68'),_0x3d7c('0x5e'),'updatedAt'],squel[_0x3d7c('0x88')]()[_0x3d7c('0x89')](_0x3d7c('0xa8'),_0x3d7c('0xa8'))['field']('\x27'+_0x16d0d1+'\x27',_0x3d7c('0xa9'))[_0x3d7c('0x89')]('id',_0x3d7c('0xaa'))[_0x3d7c('0x89')](_0x4ab28d[_0x3d7c('0xab')]['toString'](),_0x3d7c('0xac'))['field'](_0x2b152b[_0x3d7c('0x52')]['id']['toString'](),_0x3d7c('0x68'))[_0x3d7c('0x89')]('\x27'+_0x16d0d1+'\x27',_0x3d7c('0x5e'))['field']('\x27'+_0x16d0d1+'\x27','updatedAt')['from'](_0x3d7c('0xad'))[_0x3d7c('0x48')]('deletedAt\x20IS\x20NULL')[_0x3d7c('0x48')](_0x3d7c('0xae'),_0x4ab28d[_0x3d7c('0xab')][_0x3d7c('0x8f')]())[_0x3d7c('0x48')](_0x3d7c('0xaf'))[_0x3d7c('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3d7c('0x88')]()['field'](_0x3d7c('0xb0'))[_0x3d7c('0x8b')](_0x3d7c('0xb1'))[_0x3d7c('0x48')](_0x3d7c('0xb2'),_0x2b152b[_0x3d7c('0x52')]['id'][_0x3d7c('0x8f')]()))['where'](_0x3d7c('0xb3'),squel[_0x3d7c('0x88')]()['field']('COALESCE(phone,\x27\x27)')[_0x3d7c('0x8b')]('cm_hopper')[_0x3d7c('0x48')]('VoiceQueueId\x20=\x20?',_0x2b152b['params']['id'][_0x3d7c('0x8f')]())))[_0x3d7c('0x8f')]();break;case'onlyIfOpen':_0x312308=squel[_0x3d7c('0xa5')]()[_0x3d7c('0xb4')](_0x3d7c('0xa6'))[_0x3d7c('0xa7')]([_0x3d7c('0xa8'),_0x3d7c('0xa9'),_0x3d7c('0xaa'),_0x3d7c('0xac'),'VoiceQueueId',_0x3d7c('0x5e'),_0x3d7c('0x5f')],squel['select']()[_0x3d7c('0x89')]('phone','phone')[_0x3d7c('0x89')]('\x27'+_0x16d0d1+'\x27','scheduledAt')[_0x3d7c('0x89')]('id',_0x3d7c('0xaa'))[_0x3d7c('0x89')](_0x4ab28d['CmListId'][_0x3d7c('0x8f')](),_0x3d7c('0xac'))['field'](_0x2b152b['params']['id']['toString'](),_0x3d7c('0x68'))[_0x3d7c('0x89')]('\x27'+_0x16d0d1+'\x27',_0x3d7c('0x5e'))[_0x3d7c('0x89')]('\x27'+_0x16d0d1+'\x27',_0x3d7c('0x5f'))[_0x3d7c('0x8b')](_0x3d7c('0xad'))[_0x3d7c('0x48')](_0x3d7c('0xb5'))[_0x3d7c('0x48')](_0x3d7c('0xae'),_0x4ab28d[_0x3d7c('0xab')][_0x3d7c('0x8f')]())[_0x3d7c('0x48')](_0x3d7c('0xaf'))[_0x3d7c('0x48')](_0x3d7c('0xb3'),squel[_0x3d7c('0x88')]()[_0x3d7c('0x89')](_0x3d7c('0xb6'))[_0x3d7c('0x8b')]('cm_hopper')[_0x3d7c('0x48')](_0x3d7c('0xb2'),_0x2b152b[_0x3d7c('0x52')]['id']['toString']())))[_0x3d7c('0x8f')]();break;default:_0x312308=squel[_0x3d7c('0xa5')]()[_0x3d7c('0xb4')](_0x3d7c('0xa6'))[_0x3d7c('0xa7')]([_0x3d7c('0xa8'),_0x3d7c('0xa9'),_0x3d7c('0xaa'),_0x3d7c('0xac'),_0x3d7c('0x68'),_0x3d7c('0x5e'),'updatedAt'],squel[_0x3d7c('0x88')]()['field'](_0x3d7c('0xa8'),_0x3d7c('0xa8'))[_0x3d7c('0x89')]('\x27'+_0x16d0d1+'\x27',_0x3d7c('0xa9'))['field']('id',_0x3d7c('0xaa'))['field'](_0x4ab28d[_0x3d7c('0xab')][_0x3d7c('0x8f')](),_0x3d7c('0xac'))[_0x3d7c('0x89')](_0x2b152b['params']['id'][_0x3d7c('0x8f')](),_0x3d7c('0x68'))[_0x3d7c('0x89')]('\x27'+_0x16d0d1+'\x27',_0x3d7c('0x5e'))[_0x3d7c('0x89')]('\x27'+_0x16d0d1+'\x27',_0x3d7c('0x5f'))[_0x3d7c('0x8b')](_0x3d7c('0xad'))[_0x3d7c('0x48')](_0x3d7c('0xb5'))['where'](_0x3d7c('0xae'),_0x4ab28d[_0x3d7c('0xab')][_0x3d7c('0x8f')]())['where'](_0x3d7c('0xaf')))['toString']();}_0x4b2139['push'](db[_0x3d7c('0x7a')][_0x3d7c('0x40')](_0x312308));}return BPromise['all'](_0x4b2139);}})[_0x3d7c('0x2e')](function(){var _0x245f81=[];var _0x2b4acd=squel[_0x3d7c('0xa5')]()[_0x3d7c('0xb4')](_0x3d7c('0xb7'))['fromQuery'](['CmHopperId',_0x3d7c('0xa8'),_0x3d7c('0xb8'),_0x3d7c('0x5e'),_0x3d7c('0x5f')],squel[_0x3d7c('0x88')]()[_0x3d7c('0x89')](_0x3d7c('0xb9'))['field']('ci.item')['field'](_0x3d7c('0xba'))['field']('\x27'+_0x16d0d1+'\x27','createdAt')['field']('\x27'+_0x16d0d1+'\x27','updatedAt')[_0x3d7c('0x8b')]('cm_contact_has_items','ci')[_0x3d7c('0xbb')](_0x3d7c('0xa6'),'h','h.ContactId=ci.CmContactId')[_0x3d7c('0x48')](_0x3d7c('0xbc'),_0x16d0d1)[_0x3d7c('0x48')](_0x3d7c('0xbd'),'PHONE'))[_0x3d7c('0x8f')]();_0x245f81[_0x3d7c('0xbe')](db[_0x3d7c('0x7a')]['query'](_0x2b4acd));return BPromise[_0x3d7c('0x94')](_0x245f81);})[_0x3d7c('0x2e')](function(){return _0x42ac15;})[_0x3d7c('0x2e')](respondWithResult(_0x19e23b,null))['catch'](handleError(_0x19e23b,null));};exports['removeLists']=function(_0x4eeb74,_0x293f81,_0x312925){return db[_0x3d7c('0x3c')]['find']({'where':{'id':_0x4eeb74[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x293f81,null))[_0x3d7c('0x2e')](function(_0x53fa03){if(_0x53fa03){return _0x53fa03['removeLists'](_0x4eeb74['query'][_0x3d7c('0x9a')]);}})[_0x3d7c('0x2e')](function(_0x40e8da){if(_0x40e8da){return db['CmHopper'][_0x3d7c('0x2f')]({'where':{'ListId':_0x4eeb74[_0x3d7c('0x40')]['ids'],'VoiceQueueId':_0x4eeb74[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](function(){return _0x40e8da;});}})[_0x3d7c('0x2e')](respondWithStatusCode(_0x293f81,null))[_0x3d7c('0x51')](handleError(_0x293f81,null));};exports[_0x3d7c('0xbf')]=function(_0x15aeb3,_0x1362d6,_0x51c10c){var _0x4d002f={};var _0x57d359={};var _0x1304cf;var _0xa2c471;return db[_0x3d7c('0x3c')]['findOne']({'where':{'id':_0x15aeb3[_0x3d7c('0x52')]['id']}})['then'](handleEntityNotFound(_0x1362d6,null))[_0x3d7c('0x2e')](function(_0x25f880){if(_0x25f880){_0x1304cf=_0x25f880;_0x57d359[_0x3d7c('0x3f')]=_[_0x3d7c('0x41')](db[_0x3d7c('0xa0')][_0x3d7c('0x53')]);_0x57d359[_0x3d7c('0x40')]=_[_0x3d7c('0x41')](_0x15aeb3[_0x3d7c('0x40')]);_0x57d359[_0x3d7c('0x42')]=_[_0x3d7c('0x43')](_0x57d359[_0x3d7c('0x3f')],_0x57d359[_0x3d7c('0x40')]);_0x4d002f['attributes']=_[_0x3d7c('0x43')](_0x57d359[_0x3d7c('0x3f')],qs[_0x3d7c('0x44')](_0x15aeb3[_0x3d7c('0x40')][_0x3d7c('0x44')]));_0x4d002f[_0x3d7c('0x45')]=_0x4d002f[_0x3d7c('0x45')][_0x3d7c('0x54')]?_0x4d002f[_0x3d7c('0x45')]:_0x57d359[_0x3d7c('0x3f')];_0x4d002f[_0x3d7c('0x46')]=qs[_0x3d7c('0x47')](_0x15aeb3[_0x3d7c('0x40')][_0x3d7c('0x47')]);_0x4d002f[_0x3d7c('0x48')]=qs[_0x3d7c('0x42')](_['pick'](_0x15aeb3['query'],_0x57d359[_0x3d7c('0x42')]));if(_0x15aeb3[_0x3d7c('0x40')][_0x3d7c('0x4c')]){_0x4d002f['where']=_['merge'](_0x4d002f[_0x3d7c('0x48')],{'$or':_['map'](_0x4d002f[_0x3d7c('0x45')],function(_0x2fc9c1){var _0x4c92c2={};_0x4c92c2[_0x2fc9c1]={'$like':'%'+_0x15aeb3[_0x3d7c('0x40')][_0x3d7c('0x4c')]+'%'};return _0x4c92c2;})});}_0x4d002f=_[_0x3d7c('0x4a')]({},_0x4d002f,_0x15aeb3[_0x3d7c('0x4d')]);return _0x1304cf[_0x3d7c('0xbf')](_0x4d002f);}})[_0x3d7c('0x2e')](function(_0x1d2bd2){if(_0x1d2bd2){_0xa2c471=_0x1d2bd2[_0x3d7c('0x54')];if(!_0x15aeb3[_0x3d7c('0x40')][_0x3d7c('0x66')]('nolimit')){_0x4d002f[_0x3d7c('0x29')]=qs[_0x3d7c('0x29')](_0x15aeb3[_0x3d7c('0x40')][_0x3d7c('0x29')]);_0x4d002f[_0x3d7c('0x26')]=qs[_0x3d7c('0x26')](_0x15aeb3[_0x3d7c('0x40')][_0x3d7c('0x26')]);}return _0x1304cf[_0x3d7c('0xbf')](_0x4d002f);}})[_0x3d7c('0x2e')](function(_0x2832d4){if(_0x2832d4){return _0x2832d4?{'count':_0xa2c471,'rows':_0x2832d4}:null;}})[_0x3d7c('0x2e')](respondWithResult(_0x1362d6,null))[_0x3d7c('0x51')](handleError(_0x1362d6,null));};exports[_0x3d7c('0xc0')]=function(_0x4e6dea,_0x100819,_0x7dfa8f){var _0xd6a154,_0x3037d6;return db[_0x3d7c('0x3c')]['find']({'where':{'id':_0x4e6dea[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x100819,null))[_0x3d7c('0x2e')](function(_0x396a4c){if(_0x396a4c){_0x3037d6=_0x396a4c;return _0x396a4c[_0x3d7c('0xc0')](_0x4e6dea[_0x3d7c('0x56')][_0x3d7c('0x9a')],_[_0x3d7c('0x5d')](_0x4e6dea[_0x3d7c('0x56')],[_0x3d7c('0x9a'),'id'])||{});}return null;})[_0x3d7c('0x9b')](function(_0x1f10f7){var _0x4c6b4f;_0xd6a154=_0x1f10f7||[];var _0x5abde7=[];if(_0x1f10f7){for(var _0xad37=0x0;_0xad37<_0x1f10f7[_0x3d7c('0x54')];_0xad37+=0x1){var _0x4a8476=_0x1f10f7[_0xad37][_0x3d7c('0x58')]({'plain':!![]});_0x4c6b4f=squel[_0x3d7c('0xa5')]()[_0x3d7c('0xb4')](_0x3d7c('0xc1'))[_0x3d7c('0xa7')]([_0x3d7c('0xa8'),_0x3d7c('0xaa'),_0x3d7c('0xac'),'VoiceQueueId',_0x3d7c('0x5e'),_0x3d7c('0x5f')],squel[_0x3d7c('0x88')]()[_0x3d7c('0x89')](_0x3d7c('0xa8'),_0x3d7c('0xa8'))[_0x3d7c('0x89')]('id',_0x3d7c('0xaa'))[_0x3d7c('0x89')](_0x4a8476['CmListId'][_0x3d7c('0x8f')](),_0x3d7c('0xac'))[_0x3d7c('0x89')](_0x4e6dea[_0x3d7c('0x52')]['id'][_0x3d7c('0x8f')](),'VoiceQueueId')['field'](_0x3d7c('0xc2'),_0x3d7c('0x5e'))[_0x3d7c('0x89')](_0x3d7c('0xc2'),_0x3d7c('0x5f'))[_0x3d7c('0x8b')](_0x3d7c('0xad'))[_0x3d7c('0x48')](_0x3d7c('0xb5'))[_0x3d7c('0x48')](_0x3d7c('0xae'),_0x4a8476[_0x3d7c('0xab')]['toString']())[_0x3d7c('0x48')](_0x3d7c('0xaf')))[_0x3d7c('0x8f')]();_0x5abde7[_0x3d7c('0xbe')](db[_0x3d7c('0x7a')][_0x3d7c('0x40')](_0x4c6b4f));}return BPromise['all'](_0x5abde7);}})[_0x3d7c('0x2e')](function(){return _0xd6a154;})[_0x3d7c('0x2e')](respondWithResult(_0x100819,null))[_0x3d7c('0x51')](handleError(_0x100819,null));};exports[_0x3d7c('0xc3')]=function(_0x542b24,_0x237432,_0x169331){return db[_0x3d7c('0x3c')][_0x3d7c('0x37')]({'where':{'id':_0x542b24[_0x3d7c('0x52')]['id']}})[_0x3d7c('0x2e')](handleEntityNotFound(_0x237432,null))['then'](function(_0x492dec){if(_0x492dec){return _0x492dec[_0x3d7c('0xc3')](_0x542b24[_0x3d7c('0x40')]['ids']);}})['then'](function(_0x141f45){if(_0x141f45){return db['CmHopperBlack'][_0x3d7c('0x2f')]({'where':{'ListId':_0x542b24['query'][_0x3d7c('0x9a')],'VoiceQueueId':_0x542b24[_0x3d7c('0x52')]['id']}})['then'](function(){return _0x141f45;});}})['then'](respondWithStatusCode(_0x237432,null))[_0x3d7c('0x51')](handleError(_0x237432,null));}; \ No newline at end of file +var _0x23f4=['UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','VoiceQueues','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','TeamVoiceQueue','UserVoiceQueue','findOrCreate','each','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','all','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','ids','spread','push','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','cm_hopper','phone','ContactId','ListId','CmListId','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','scheduledAt','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','QueueCampaigns','outbound','map','value','includes','type','find','name','UserProfileResource','stack','send','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound'];(function(_0x360ad8,_0x5aec7a){var _0x5d4681=function(_0x14b81f){while(--_0x14b81f){_0x360ad8['push'](_0x360ad8['shift']());}};_0x5d4681(++_0x5aec7a);}(_0x23f4,0x1ee));var _0x423f=function(_0x159a10,_0x41b318){_0x159a10=_0x159a10-0x0;var _0x108526=_0x23f4[_0x159a10];return _0x108526;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x423f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x423f('0x1'));var moment=require(_0x423f('0x2'));var BPromise=require(_0x423f('0x3'));var Mustache=require(_0x423f('0x4'));var util=require(_0x423f('0x5'));var path=require(_0x423f('0x6'));var sox=require(_0x423f('0x7'));var csv=require(_0x423f('0x8'));var ejs=require(_0x423f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x423f('0xa'));var squel=require(_0x423f('0xb'));var crypto=require('crypto');var jsforce=require(_0x423f('0xc'));var deskjs=require(_0x423f('0xd'));var toCsv=require(_0x423f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x423f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x423f('0xf'));var hardwareService=require(_0x423f('0x10'));var logger=require(_0x423f('0x11'))(_0x423f('0x12'));var utils=require('../../config/utils');var config=require(_0x423f('0x13'));var licenseUtil=require(_0x423f('0x14'));var db=require(_0x423f('0x15'))['db'];config[_0x423f('0x16')]=_[_0x423f('0x17')](config['redis'],{'host':_0x423f('0x18'),'port':0x18eb});var socket=require(_0x423f('0x19'))(new Redis(config[_0x423f('0x16')]));require(_0x423f('0x1a'))[_0x423f('0x1b')](socket);function respondWithStatusCode(_0x3b531d,_0x1f6423){_0x1f6423=_0x1f6423||0xcc;return function(_0x21d804){if(_0x21d804){return _0x3b531d[_0x423f('0x1c')](_0x1f6423);}return _0x3b531d[_0x423f('0x1d')](_0x1f6423)[_0x423f('0x1e')]();};}function respondWithResult(_0x276be1,_0x14cba9){_0x14cba9=_0x14cba9||0xc8;return function(_0x1fef4d){if(_0x1fef4d){return _0x276be1[_0x423f('0x1d')](_0x14cba9)[_0x423f('0x1f')](_0x1fef4d);}};}function respondWithFilteredResult(_0x3fd56d,_0x34e968){return function(_0x26b6d1){if(_0x26b6d1){var _0x5424e6=typeof _0x34e968[_0x423f('0x20')]==='undefined'&&typeof _0x34e968['limit']===_0x423f('0x21');var _0x4956e0=_0x26b6d1[_0x423f('0x22')];var _0xd7b80e=_0x5424e6?0x0:_0x34e968['offset'];var _0x45b46d=_0x5424e6?_0x26b6d1[_0x423f('0x22')]:_0x34e968['offset']+_0x34e968[_0x423f('0x23')];var _0x2ebe74;if(_0x45b46d>=_0x4956e0){_0x45b46d=_0x4956e0;_0x2ebe74=0xc8;}else{_0x2ebe74=0xce;}_0x3fd56d['status'](_0x2ebe74);return _0x3fd56d[_0x423f('0x24')](_0x423f('0x25'),_0xd7b80e+'-'+_0x45b46d+'/'+_0x4956e0)['json'](_0x26b6d1);}return null;};}function patchUpdates(_0x54f47){return function(_0x5ec3a8){try{jsonpatch[_0x423f('0x26')](_0x5ec3a8,_0x54f47,!![]);}catch(_0x3c942e){return BPromise[_0x423f('0x27')](_0x3c942e);}return _0x5ec3a8[_0x423f('0x28')]();};}function saveUpdates(_0xb82e8d,_0x39e72d){return function(_0x14ef6c){if(_0x14ef6c){return _0x14ef6c[_0x423f('0x29')](_0xb82e8d)[_0x423f('0x2a')](function(_0x36f57f){return _0x36f57f;});}return null;};}function removeEntity(_0x45889f,_0x199196){return function(_0xb91ed8){if(_0xb91ed8){return _0xb91ed8[_0x423f('0x2b')]()['then'](function(){var _0x3308dd=_0xb91ed8[_0x423f('0x2c')]({'plain':!![]});var _0x1b347a=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x423f('0x2d'),'value':_0x423f('0x2e'),'ignore':![]}];var _0x323c61=_(_0x1b347a)['filter']('ignore')[_0x423f('0x2f')](_0x423f('0x30'))['value']();if(_[_0x423f('0x31')](_0x323c61,_0x3308dd[_0x423f('0x32')])){return;}var _0x3022a5=_[_0x423f('0x33')](_0x1b347a,['value',_0x3308dd[_0x423f('0x32')]])[_0x423f('0x34')];return db[_0x423f('0x35')][_0x423f('0x2b')]({'where':{'type':_0x3022a5,'resourceId':_0x3308dd['id']}})['then'](function(){return _0xb91ed8;});})[_0x423f('0x2a')](function(){_0x45889f[_0x423f('0x1d')](0xcc)[_0x423f('0x1e')]();});}};}function handleEntityNotFound(_0x8e7bcb,_0x341728){return function(_0x29fe71){if(!_0x29fe71){_0x8e7bcb[_0x423f('0x1c')](0x194);}return _0x29fe71;};}function handleError(_0x40949b,_0x3d204a){_0x3d204a=_0x3d204a||0x1f4;return function(_0x9e562f){logger['error'](_0x9e562f[_0x423f('0x36')]);if(_0x9e562f[_0x423f('0x34')]){delete _0x9e562f[_0x423f('0x34')];}_0x40949b['status'](_0x3d204a)[_0x423f('0x37')](_0x9e562f);};}exports['index']=function(_0x228df0,_0x16fcad){var _0x2784c6={},_0x40ee34={},_0x145981={'count':0x0,'rows':[]};var _0x4a5134=_['map'](db[_0x423f('0x38')][_0x423f('0x39')],function(_0x239a49){return{'name':_0x239a49[_0x423f('0x3a')],'type':_0x239a49[_0x423f('0x32')][_0x423f('0x3b')]};});_0x40ee34[_0x423f('0x3c')]=_[_0x423f('0x2f')](_0x4a5134,_0x423f('0x34'));_0x40ee34[_0x423f('0x3d')]=_[_0x423f('0x3e')](_0x228df0[_0x423f('0x3d')]);_0x40ee34[_0x423f('0x3f')]=_['intersection'](_0x40ee34['model'],_0x40ee34[_0x423f('0x3d')]);_0x2784c6[_0x423f('0x40')]=_[_0x423f('0x41')](_0x40ee34[_0x423f('0x3c')],qs[_0x423f('0x42')](_0x228df0['query'][_0x423f('0x42')]));_0x2784c6[_0x423f('0x40')]=_0x2784c6[_0x423f('0x40')][_0x423f('0x43')]?_0x2784c6[_0x423f('0x40')]:_0x40ee34[_0x423f('0x3c')];if(!_0x228df0[_0x423f('0x3d')][_0x423f('0x44')](_0x423f('0x45'))){_0x2784c6[_0x423f('0x23')]=qs['limit'](_0x228df0['query'][_0x423f('0x23')]);_0x2784c6[_0x423f('0x20')]=qs[_0x423f('0x20')](_0x228df0[_0x423f('0x3d')][_0x423f('0x20')]);}_0x2784c6[_0x423f('0x46')]=qs['sort'](_0x228df0[_0x423f('0x3d')][_0x423f('0x47')]);_0x2784c6[_0x423f('0x48')]=qs[_0x423f('0x3f')](_[_0x423f('0x49')](_0x228df0[_0x423f('0x3d')],_0x40ee34[_0x423f('0x3f')]),_0x4a5134);if(_0x228df0[_0x423f('0x3d')]['filter']){_0x2784c6[_0x423f('0x48')]=_[_0x423f('0x4a')](_0x2784c6[_0x423f('0x48')],{'$or':_[_0x423f('0x2f')](_0x4a5134,function(_0x33d324){if(_0x33d324[_0x423f('0x32')]!==_0x423f('0x4b')){var _0xbd33af={};_0xbd33af[_0x33d324[_0x423f('0x34')]]={'$like':'%'+_0x228df0['query'][_0x423f('0x4c')]+'%'};return _0xbd33af;}})});}_0x2784c6=_['merge']({},_0x2784c6,_0x228df0[_0x423f('0x4d')]);var _0x2e0fc8={'where':_0x2784c6[_0x423f('0x48')]};return db[_0x423f('0x38')][_0x423f('0x22')](_0x2e0fc8)[_0x423f('0x2a')](function(_0x3087e4){_0x145981[_0x423f('0x22')]=_0x3087e4;if(_0x228df0[_0x423f('0x3d')][_0x423f('0x4e')]){_0x2784c6[_0x423f('0x4f')]=[{'all':!![]}];}return db[_0x423f('0x38')][_0x423f('0x50')](_0x2784c6);})[_0x423f('0x2a')](function(_0xa7708c){_0x145981[_0x423f('0x51')]=_0xa7708c;return _0x145981;})[_0x423f('0x2a')](respondWithFilteredResult(_0x16fcad,_0x2784c6))[_0x423f('0x52')](handleError(_0x16fcad,null));};exports[_0x423f('0x53')]=function(_0x2145a5,_0x580db1){var _0x2e824d={'raw':![],'where':{'id':_0x2145a5[_0x423f('0x54')]['id']}},_0x47fcda={};_0x47fcda[_0x423f('0x3c')]=_[_0x423f('0x3e')](db[_0x423f('0x38')][_0x423f('0x39')]);_0x47fcda[_0x423f('0x3d')]=_[_0x423f('0x3e')](_0x2145a5[_0x423f('0x3d')]);_0x47fcda[_0x423f('0x3f')]=_[_0x423f('0x41')](_0x47fcda[_0x423f('0x3c')],_0x47fcda[_0x423f('0x3d')]);_0x2e824d['attributes']=_[_0x423f('0x41')](_0x47fcda[_0x423f('0x3c')],qs['fields'](_0x2145a5[_0x423f('0x3d')]['fields']));_0x2e824d[_0x423f('0x40')]=_0x2e824d['attributes']['length']?_0x2e824d[_0x423f('0x40')]:_0x47fcda[_0x423f('0x3c')];if(_0x2145a5[_0x423f('0x3d')][_0x423f('0x4e')]){_0x2e824d['include']=[{'all':!![]}];}_0x2e824d=_[_0x423f('0x4a')]({},_0x2e824d,_0x2145a5['options']);return db[_0x423f('0x38')][_0x423f('0x33')](_0x2e824d)[_0x423f('0x2a')](handleEntityNotFound(_0x580db1,null))[_0x423f('0x2a')](respondWithResult(_0x580db1,null))[_0x423f('0x52')](handleError(_0x580db1,null));};exports[_0x423f('0x55')]=function(_0x106142,_0x248f22){return db[_0x423f('0x38')]['create'](_0x106142[_0x423f('0x56')],{})[_0x423f('0x2a')](function(_0x59a117){var _0x23a96a=_0x106142['user'][_0x423f('0x2c')]({'plain':!![]});if(!_0x23a96a)throw new Error(_0x423f('0x57'));if(_0x23a96a[_0x423f('0x58')]===_0x423f('0x59')){var _0x3b92bd=_0x59a117[_0x423f('0x2c')]({'plain':!![]});var _0x54f56a=[{'name':'VoiceQueues','value':_0x423f('0x5a')},{'name':_0x423f('0x2d'),'value':_0x423f('0x2e')}];var _0x3959ce=_[_0x423f('0x33')](_0x54f56a,[_0x423f('0x30'),_0x3b92bd[_0x423f('0x32')]])[_0x423f('0x34')];return db[_0x423f('0x5b')]['find']({'where':{'name':_0x3959ce,'userProfileId':_0x23a96a[_0x423f('0x5c')]},'raw':!![]})[_0x423f('0x2a')](function(_0x50686e){if(_0x50686e&&_0x50686e[_0x423f('0x5d')]===0x0){return db['UserProfileResource'][_0x423f('0x55')]({'name':_0x3b92bd[_0x423f('0x34')],'resourceId':_0x3b92bd['id'],'type':_0x50686e[_0x423f('0x34')],'sectionId':_0x50686e['id']},{})['then'](function(){return _0x59a117;});}else{return _0x59a117;}})['catch'](function(_0x208839){logger[_0x423f('0x5e')](_0x423f('0x5f'),_0x208839);throw _0x208839;});}return _0x59a117;})['then'](respondWithResult(_0x248f22,0xc9))[_0x423f('0x52')](handleError(_0x248f22,null));};exports[_0x423f('0x60')]=function(_0x270d28,_0x46ba2b){var _0xc5f895={'where':{'id':_0x270d28[_0x423f('0x54')]['id']}},_0x3ffe6f={};_0x3ffe6f['model']=_[_0x423f('0x3e')](db['VoiceQueue'][_0x423f('0x39')]);_0xc5f895[_0x423f('0x40')]=_[_0x423f('0x41')](_0x3ffe6f[_0x423f('0x3c')],qs['fields'](_0x270d28[_0x423f('0x3d')][_0x423f('0x42')]));_0xc5f895[_0x423f('0x40')]=_0xc5f895['attributes'][_0x423f('0x43')]?_0xc5f895[_0x423f('0x40')]:_0x3ffe6f['model'];if(_0x270d28[_0x423f('0x3d')][_0x423f('0x4e')]){_0xc5f895['include']=[{'all':!![]}];}_0xc5f895=_['merge']({},_0xc5f895,_0x270d28['options']);return db[_0x423f('0x38')][_0x423f('0x33')](_0xc5f895)[_0x423f('0x2a')](handleEntityNotFound(_0x46ba2b,null))[_0x423f('0x2a')](function(_0x587682){if(_0x587682){var _0x4fa0ef=_0x587682[_0x423f('0x2c')]({'plain':!![]});_0x4fa0ef=qs[_0x423f('0x61')](_0x4fa0ef,['id','createdAt',_0x423f('0x62')]);_0x270d28[_0x423f('0x56')]=_[_0x423f('0x61')](_0x270d28[_0x423f('0x56')],['id',_0x423f('0x63'),_0x423f('0x62')]);return db[_0x423f('0x38')]['create'](_[_0x423f('0x4a')](_0x4fa0ef,_0x270d28[_0x423f('0x56')]),{'include':_0x270d28['query'][_0x423f('0x4e')]?[{'all':!![]}]:undefined})[_0x423f('0x2a')](function(_0x3e5d47){var _0x5ce420=_0x270d28[_0x423f('0x59')][_0x423f('0x2c')]({'plain':!![]});if(!_0x5ce420)throw new Error(_0x423f('0x57'));if(_0x5ce420[_0x423f('0x58')]===_0x423f('0x59')){var _0x4a161d=_0x3e5d47[_0x423f('0x2c')]({'plain':!![]});var _0x106709=[{'name':_0x423f('0x64'),'value':'inbound'},{'name':_0x423f('0x2d'),'value':_0x423f('0x2e')}];var _0x25e123=_[_0x423f('0x33')](_0x106709,['value',_0x4a161d[_0x423f('0x32')]])[_0x423f('0x34')];return db[_0x423f('0x5b')][_0x423f('0x33')]({'where':{'name':_0x25e123,'userProfileId':_0x5ce420[_0x423f('0x5c')]},'raw':!![]})[_0x423f('0x2a')](function(_0x2a77fc){if(_0x2a77fc&&_0x2a77fc['autoAssociation']===0x0){return db[_0x423f('0x35')][_0x423f('0x55')]({'name':_0x4a161d[_0x423f('0x34')],'resourceId':_0x4a161d['id'],'type':_0x2a77fc[_0x423f('0x34')],'sectionId':_0x2a77fc['id']},{})['then'](function(){return _0x3e5d47;});}else{return _0x3e5d47;}})[_0x423f('0x52')](function(_0x405811){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x405811);throw _0x405811;});}return _0x3e5d47;});}})[_0x423f('0x2a')](respondWithResult(_0x46ba2b,0xc9))[_0x423f('0x52')](handleError(_0x46ba2b,null));};exports[_0x423f('0x29')]=function(_0x599a45,_0x2dadb6){if(_0x599a45[_0x423f('0x56')]['id']){delete _0x599a45[_0x423f('0x56')]['id'];}return db['VoiceQueue'][_0x423f('0x33')]({'where':{'id':_0x599a45[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x2dadb6,null))['then'](saveUpdates(_0x599a45[_0x423f('0x56')],null))['then'](respondWithResult(_0x2dadb6,null))['catch'](handleError(_0x2dadb6,null));};exports[_0x423f('0x2b')]=function(_0x1f6750,_0x4fd2e1){return db[_0x423f('0x38')][_0x423f('0x33')]({'where':{'id':_0x1f6750['params']['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x4fd2e1,null))[_0x423f('0x2a')](removeEntity(_0x4fd2e1,null))[_0x423f('0x52')](handleError(_0x4fd2e1,null));};exports[_0x423f('0x65')]=function(_0x233afe,_0x2519b5,_0x31fc04){var _0x5b9577={'raw':![],'where':{}};var _0x4e1e04={};var _0xd9409e={'count':0x0,'rows':[]};return db[_0x423f('0x38')][_0x423f('0x66')]({'where':{'id':_0x233afe[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x2519b5,null))['then'](function(_0x3583f8){if(_0x3583f8){_0x4e1e04[_0x423f('0x3c')]=_[_0x423f('0x3e')](db[_0x423f('0x67')][_0x423f('0x39')]);_0x4e1e04[_0x423f('0x3d')]=_[_0x423f('0x3e')](_0x233afe[_0x423f('0x3d')]);_0x4e1e04[_0x423f('0x3f')]=_[_0x423f('0x41')](_0x4e1e04[_0x423f('0x3c')],_0x4e1e04[_0x423f('0x3d')]);_0x5b9577[_0x423f('0x40')]=_['intersection'](_0x4e1e04[_0x423f('0x3c')],qs[_0x423f('0x42')](_0x233afe[_0x423f('0x3d')][_0x423f('0x42')]));_0x5b9577[_0x423f('0x40')]=_0x5b9577['attributes'][_0x423f('0x43')]?_0x5b9577[_0x423f('0x40')]:_0x4e1e04[_0x423f('0x3c')];if(!_0x233afe[_0x423f('0x3d')]['hasOwnProperty'](_0x423f('0x45'))){_0x5b9577[_0x423f('0x23')]=qs[_0x423f('0x23')](_0x233afe[_0x423f('0x3d')][_0x423f('0x23')]);_0x5b9577[_0x423f('0x20')]=qs[_0x423f('0x20')](_0x233afe[_0x423f('0x3d')][_0x423f('0x20')]);}_0x5b9577[_0x423f('0x46')]=qs[_0x423f('0x47')](_0x233afe[_0x423f('0x3d')][_0x423f('0x47')]);_0x5b9577[_0x423f('0x48')]=qs['filters'](_[_0x423f('0x49')](_0x233afe['query'],_0x4e1e04['filters']));_0x5b9577[_0x423f('0x48')][_0x423f('0x68')]=_0x3583f8['id'];if(_0x233afe[_0x423f('0x3d')][_0x423f('0x4c')]){_0x5b9577['where']=_[_0x423f('0x4a')](_0x5b9577['where'],{'$or':_[_0x423f('0x2f')](_0x5b9577[_0x423f('0x40')],function(_0x3dee3b){var _0x2da8ff={};_0x2da8ff[_0x3dee3b]={'$like':'%'+_0x233afe[_0x423f('0x3d')]['filter']+'%'};return _0x2da8ff;})});}_0x5b9577=_[_0x423f('0x4a')]({},_0x5b9577,_0x233afe['options']);return db[_0x423f('0x67')]['count']({'where':_0x5b9577[_0x423f('0x48')]})[_0x423f('0x2a')](function(_0x1990ec){_0xd9409e['count']=_0x1990ec;if(_0x233afe[_0x423f('0x3d')][_0x423f('0x4e')]){_0x5b9577[_0x423f('0x4f')]=[{'all':!![]}];}return db[_0x423f('0x67')]['findAll'](_0x5b9577);})[_0x423f('0x2a')](function(_0x376326){_0xd9409e['rows']=_0x376326;return _0xd9409e;});}})[_0x423f('0x2a')](respondWithFilteredResult(_0x2519b5,_0x5b9577))[_0x423f('0x52')](handleError(_0x2519b5,null));};exports[_0x423f('0x69')]=function(_0x3737b6,_0x36241e,_0x2bb2ba){var _0x140db1={'raw':!![],'where':{}};var _0x33d4e4={};var _0x2ede33={'count':0x0,'rows':[]};return db[_0x423f('0x38')]['findOne']({'where':{'id':_0x3737b6['params']['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x36241e,null))['then'](function(_0x25a4e1){if(_0x25a4e1){_0x33d4e4['model']=_['keys'](db[_0x423f('0x6a')][_0x423f('0x39')]);_0x33d4e4[_0x423f('0x3d')]=_[_0x423f('0x3e')](_0x3737b6[_0x423f('0x3d')]);_0x33d4e4[_0x423f('0x3f')]=_[_0x423f('0x41')](_0x33d4e4['model'],_0x33d4e4[_0x423f('0x3d')]);_0x140db1[_0x423f('0x40')]=_['intersection'](_0x33d4e4[_0x423f('0x3c')],qs[_0x423f('0x42')](_0x3737b6[_0x423f('0x3d')][_0x423f('0x42')]));_0x140db1['attributes']=_0x140db1['attributes'][_0x423f('0x43')]?_0x140db1[_0x423f('0x40')]:_0x33d4e4[_0x423f('0x3c')];if(!_0x3737b6[_0x423f('0x3d')]['hasOwnProperty'](_0x423f('0x45'))){_0x140db1[_0x423f('0x23')]=qs[_0x423f('0x23')](_0x3737b6['query'][_0x423f('0x23')]);_0x140db1['offset']=qs[_0x423f('0x20')](_0x3737b6[_0x423f('0x3d')][_0x423f('0x20')]);}_0x140db1[_0x423f('0x46')]=qs['sort'](_0x3737b6[_0x423f('0x3d')][_0x423f('0x47')]);_0x140db1['where']=qs[_0x423f('0x3f')](_[_0x423f('0x49')](_0x3737b6[_0x423f('0x3d')],_0x33d4e4[_0x423f('0x3f')]));_0x140db1[_0x423f('0x48')]['VoiceQueueId']=_0x25a4e1['id'];if(_0x3737b6[_0x423f('0x3d')][_0x423f('0x4c')]){_0x140db1[_0x423f('0x48')]=_[_0x423f('0x4a')](_0x140db1['where'],{'$or':_['map'](_0x140db1[_0x423f('0x40')],function(_0x3d3722){var _0x2ed8ed={};_0x2ed8ed[_0x3d3722]={'$like':'%'+_0x3737b6[_0x423f('0x3d')]['filter']+'%'};return _0x2ed8ed;})});}_0x140db1=_[_0x423f('0x4a')]({},_0x140db1,_0x3737b6['options']);return db[_0x423f('0x6a')][_0x423f('0x22')]({'where':_0x140db1[_0x423f('0x48')]})[_0x423f('0x2a')](function(_0x23e5a6){_0x2ede33[_0x423f('0x22')]=_0x23e5a6;if(_0x3737b6[_0x423f('0x3d')]['includeAll']){_0x140db1[_0x423f('0x4f')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x140db1);})[_0x423f('0x2a')](function(_0x34d1cd){_0x2ede33[_0x423f('0x51')]=_0x34d1cd;return _0x2ede33;});}})[_0x423f('0x2a')](respondWithFilteredResult(_0x36241e,_0x140db1))[_0x423f('0x52')](handleError(_0x36241e,null));};exports[_0x423f('0x6b')]=function(_0x1c30fb,_0x42e7ec,_0x20430d){var _0x2648e6={'raw':!![],'where':{}};var _0x28c8ba={};var _0x1671d6={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x1c30fb[_0x423f('0x54')]['id']}})['then'](handleEntityNotFound(_0x42e7ec,null))['then'](function(_0x63d36f){if(_0x63d36f){_0x28c8ba[_0x423f('0x3c')]=_[_0x423f('0x3e')](db['CmHopperFinal']['rawAttributes']);_0x28c8ba[_0x423f('0x3d')]=_[_0x423f('0x3e')](_0x1c30fb[_0x423f('0x3d')]);_0x28c8ba['filters']=_['intersection'](_0x28c8ba[_0x423f('0x3c')],_0x28c8ba[_0x423f('0x3d')]);_0x2648e6[_0x423f('0x40')]=_[_0x423f('0x41')](_0x28c8ba[_0x423f('0x3c')],qs[_0x423f('0x42')](_0x1c30fb[_0x423f('0x3d')]['fields']));_0x2648e6[_0x423f('0x40')]=_0x2648e6[_0x423f('0x40')][_0x423f('0x43')]?_0x2648e6['attributes']:_0x28c8ba[_0x423f('0x3c')];if(!_0x1c30fb['query']['hasOwnProperty'](_0x423f('0x45'))){_0x2648e6[_0x423f('0x23')]=qs[_0x423f('0x23')](_0x1c30fb[_0x423f('0x3d')][_0x423f('0x23')]);_0x2648e6[_0x423f('0x20')]=qs[_0x423f('0x20')](_0x1c30fb[_0x423f('0x3d')][_0x423f('0x20')]);}_0x2648e6['order']=qs[_0x423f('0x47')](_0x1c30fb['query'][_0x423f('0x47')]);_0x2648e6['where']=qs[_0x423f('0x3f')](_[_0x423f('0x49')](_0x1c30fb[_0x423f('0x3d')],_0x28c8ba['filters']));_0x2648e6[_0x423f('0x48')][_0x423f('0x68')]=_0x63d36f['id'];if(_0x1c30fb['query'][_0x423f('0x4c')]){_0x2648e6['where']=_[_0x423f('0x4a')](_0x2648e6[_0x423f('0x48')],{'$or':_[_0x423f('0x2f')](_0x2648e6[_0x423f('0x40')],function(_0x177730){var _0x2ff3fd={};_0x2ff3fd[_0x177730]={'$like':'%'+_0x1c30fb[_0x423f('0x3d')][_0x423f('0x4c')]+'%'};return _0x2ff3fd;})});}_0x2648e6=_['merge']({},_0x2648e6,_0x1c30fb['options']);return db[_0x423f('0x6c')][_0x423f('0x22')]({'where':_0x2648e6['where']})[_0x423f('0x2a')](function(_0xcbeb5f){_0x1671d6[_0x423f('0x22')]=_0xcbeb5f;if(_0x1c30fb[_0x423f('0x3d')][_0x423f('0x4e')]){_0x2648e6[_0x423f('0x4f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x423f('0x50')](_0x2648e6);})[_0x423f('0x2a')](function(_0x2165cd){_0x1671d6[_0x423f('0x51')]=_0x2165cd;return _0x1671d6;});}})['then'](respondWithFilteredResult(_0x42e7ec,_0x2648e6))['catch'](handleError(_0x42e7ec,null));};exports[_0x423f('0x6d')]=function(_0x585e5e,_0x5aebea,_0x59a8e7){var _0x3ae7f2={'raw':!![],'where':{}};var _0x151cae={};var _0x9baaf2={'count':0x0,'rows':[]};return db[_0x423f('0x38')]['findOne']({'where':{'id':_0x585e5e[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x5aebea,null))[_0x423f('0x2a')](function(_0x2e8fce){if(_0x2e8fce){_0x151cae[_0x423f('0x3c')]=_[_0x423f('0x3e')](db[_0x423f('0x6e')][_0x423f('0x39')]);_0x151cae[_0x423f('0x3d')]=_[_0x423f('0x3e')](_0x585e5e['query']);_0x151cae[_0x423f('0x3f')]=_[_0x423f('0x41')](_0x151cae[_0x423f('0x3c')],_0x151cae['query']);_0x3ae7f2[_0x423f('0x40')]=_[_0x423f('0x41')](_0x151cae[_0x423f('0x3c')],qs[_0x423f('0x42')](_0x585e5e[_0x423f('0x3d')][_0x423f('0x42')]));_0x3ae7f2[_0x423f('0x40')]=_0x3ae7f2['attributes']['length']?_0x3ae7f2[_0x423f('0x40')]:_0x151cae[_0x423f('0x3c')];if(!_0x585e5e[_0x423f('0x3d')][_0x423f('0x44')](_0x423f('0x45'))){_0x3ae7f2[_0x423f('0x23')]=qs[_0x423f('0x23')](_0x585e5e[_0x423f('0x3d')][_0x423f('0x23')]);_0x3ae7f2[_0x423f('0x20')]=qs[_0x423f('0x20')](_0x585e5e[_0x423f('0x3d')]['offset']);}_0x3ae7f2[_0x423f('0x46')]=qs['sort'](_0x585e5e[_0x423f('0x3d')][_0x423f('0x47')]);_0x3ae7f2['where']=qs[_0x423f('0x3f')](_[_0x423f('0x49')](_0x585e5e['query'],_0x151cae[_0x423f('0x3f')]));_0x3ae7f2[_0x423f('0x48')][_0x423f('0x68')]=_0x2e8fce['id'];if(_0x585e5e[_0x423f('0x3d')][_0x423f('0x4c')]){_0x3ae7f2[_0x423f('0x48')]=_[_0x423f('0x4a')](_0x3ae7f2[_0x423f('0x48')],{'$or':_[_0x423f('0x2f')](_0x3ae7f2[_0x423f('0x40')],function(_0x4019e8){var _0x6ef421={};_0x6ef421[_0x4019e8]={'$like':'%'+_0x585e5e[_0x423f('0x3d')][_0x423f('0x4c')]+'%'};return _0x6ef421;})});}_0x3ae7f2=_[_0x423f('0x4a')]({},_0x3ae7f2,_0x585e5e[_0x423f('0x4d')]);return db[_0x423f('0x6e')]['count']({'where':_0x3ae7f2[_0x423f('0x48')]})[_0x423f('0x2a')](function(_0x4c9f0d){_0x9baaf2[_0x423f('0x22')]=_0x4c9f0d;if(_0x585e5e[_0x423f('0x3d')][_0x423f('0x4e')]){_0x3ae7f2[_0x423f('0x4f')]=[{'all':!![]}];}return db[_0x423f('0x6e')][_0x423f('0x50')](_0x3ae7f2);})['then'](function(_0x2ecd02){_0x9baaf2[_0x423f('0x51')]=_0x2ecd02;return _0x9baaf2;});}})[_0x423f('0x2a')](respondWithFilteredResult(_0x5aebea,_0x3ae7f2))[_0x423f('0x52')](handleError(_0x5aebea,null));};exports[_0x423f('0x6f')]=function(_0x322e3b,_0x14e49a,_0x56103b){var _0x5add9d={};var _0x3eda5d={};var _0xca8f07;var _0x599f92;return db[_0x423f('0x38')]['findOne']({'where':{'id':_0x322e3b[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x14e49a,null))['then'](function(_0x1874c6){if(_0x1874c6){_0xca8f07=_0x1874c6;_0x3eda5d[_0x423f('0x3c')]=_[_0x423f('0x3e')](db[_0x423f('0x70')][_0x423f('0x39')]);_0x3eda5d[_0x423f('0x3d')]=_[_0x423f('0x3e')](_0x322e3b['query']);_0x3eda5d['filters']=_[_0x423f('0x41')](_0x3eda5d[_0x423f('0x3c')],_0x3eda5d[_0x423f('0x3d')]);_0x5add9d['attributes']=_[_0x423f('0x41')](_0x3eda5d[_0x423f('0x3c')],qs['fields'](_0x322e3b[_0x423f('0x3d')][_0x423f('0x42')]));_0x5add9d[_0x423f('0x40')]=_0x5add9d[_0x423f('0x40')][_0x423f('0x43')]?_0x5add9d[_0x423f('0x40')]:_0x3eda5d[_0x423f('0x3c')];_0x5add9d[_0x423f('0x46')]=qs['sort'](_0x322e3b[_0x423f('0x3d')]['sort']);_0x5add9d['where']=qs[_0x423f('0x3f')](_[_0x423f('0x49')](_0x322e3b['query'],_0x3eda5d['filters']));if(_0x322e3b[_0x423f('0x3d')][_0x423f('0x4c')]){_0x5add9d[_0x423f('0x48')]=_[_0x423f('0x4a')](_0x5add9d[_0x423f('0x48')],{'$or':_[_0x423f('0x2f')](_0x5add9d[_0x423f('0x40')],function(_0x54e3d6){var _0x6f9fb6={};_0x6f9fb6[_0x54e3d6]={'$like':'%'+_0x322e3b['query'][_0x423f('0x4c')]+'%'};return _0x6f9fb6;})});}_0x5add9d=_['merge']({},_0x5add9d,_0x322e3b[_0x423f('0x4d')]);return _0xca8f07[_0x423f('0x6f')](_0x5add9d);}})[_0x423f('0x2a')](function(_0x2e9259){if(_0x2e9259){_0x599f92=_0x2e9259[_0x423f('0x43')];if(!_0x322e3b['query']['hasOwnProperty']('nolimit')){_0x5add9d[_0x423f('0x23')]=qs[_0x423f('0x23')](_0x322e3b[_0x423f('0x3d')][_0x423f('0x23')]);_0x5add9d[_0x423f('0x20')]=qs[_0x423f('0x20')](_0x322e3b[_0x423f('0x3d')]['offset']);}return _0xca8f07[_0x423f('0x6f')](_0x5add9d);}})[_0x423f('0x2a')](function(_0x7a3b73){if(_0x7a3b73){return _0x7a3b73?{'count':_0x599f92,'rows':_0x7a3b73}:null;}})[_0x423f('0x2a')](respondWithResult(_0x14e49a,null))[_0x423f('0x52')](handleError(_0x14e49a,null));};exports[_0x423f('0x71')]=function(_0x7f345,_0x417943,_0x9ac571){var _0x475d10=_0x7f345['body'][_0x423f('0x72')];var _0x299fd7=_['map'](_0x475d10,'id');return db[_0x423f('0x70')]['findAll']({'where':{'id':_0x299fd7},'attributes':['id'],'include':[{'model':db[_0x423f('0x73')],'as':_0x423f('0x74'),'attributes':['id',_0x423f('0x34'),_0x423f('0x75'),_0x423f('0x76'),_0x423f('0x77')],'raw':!![]}]})['then'](function(_0x394f1b){if(_0x394f1b){var _0x15284e=_[_0x423f('0x78')](_0x394f1b,function(_0x339fd5){var _0x28996a=_0x339fd5[_0x423f('0x2c')]({'plain':!![]});_0x28996a[_0x423f('0x74')][_0x423f('0x79')](function(_0x1d95c9){_0x1d95c9[_0x423f('0x7a')]=_[_0x423f('0x33')](_0x475d10,{'id':_0x28996a['id']})['penalty'];});return _0x28996a['Agents'];});return db['VoiceQueue'][_0x423f('0x33')]({'where':{'id':_0x7f345[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](function(_0x4af753){return db[_0x423f('0x7b')][_0x423f('0x7c')](function(_0x3f8e4f){return _0x4af753[_0x423f('0x71')](_0x299fd7,{'transaction':_0x3f8e4f})[_0x423f('0x2a')](function(){return BPromise['each'](_0x475d10,function(_0x2709e5){return db[_0x423f('0x7d')]['upsert']({'TeamId':_0x2709e5['id'],'VoiceQueueId':_0x7f345['params']['id'],'penalty':_0x2709e5[_0x423f('0x7a')]},{'transaction':_0x3f8e4f});});})[_0x423f('0x2a')](function(){return BPromise['each'](_0x15284e,function(_0x2add3e){return db[_0x423f('0x7e')][_0x423f('0x7f')]({'where':{'UserId':_0x2add3e['id'],'VoiceQueueId':_0x7f345['params']['id']},'defaults':{'penalty':_0x2add3e[_0x423f('0x7a')]},'transaction':_0x3f8e4f});});})[_0x423f('0x2a')](function(){return BPromise[_0x423f('0x80')](_[_0x423f('0x4c')](_0x15284e,{'online':!![]}),function(_0x3ae984){return db[_0x423f('0x81')][_0x423f('0x82')]({'membername':_0x3ae984[_0x423f('0x34')],'UserId':_0x3ae984['id'],'queue_name':_0x4af753[_0x423f('0x34')],'VoiceQueueId':_0x4af753['id'],'interface':_[_0x423f('0x83')](_0x3ae984['interface'])?util[_0x423f('0x84')](_0x423f('0x85'),_0x3ae984[_0x423f('0x34')]):_0x3ae984[_0x423f('0x77')],'paused':_0x3ae984[_0x423f('0x76')]||![],'penalty':_0x3ae984[_0x423f('0x7a')]},{'transaction':_0x3f8e4f});});})[_0x423f('0x2a')](function(){_0x15284e[_0x423f('0x79')](function(_0xaf7c7){socket[_0x423f('0x86')](_0x423f('0x87'),{'UserId':_0xaf7c7['id'],'VoiceQueueId':_0x4af753['id']});});});});});}})[_0x423f('0x2a')](respondWithStatusCode(_0x417943,null))[_0x423f('0x52')](handleError(_0x417943,null));};exports[_0x423f('0x88')]=function(_0x1408ca,_0x523725,_0x860d89){return db[_0x423f('0x70')][_0x423f('0x50')]({'where':{'id':_0x1408ca[_0x423f('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x423f('0x73')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x523725,null))[_0x423f('0x2a')](function(_0x17e727){var _0x1ba6cc=_[_0x423f('0x2f')](_0x17e727,'id');var _0x500a93=[];var _0x84b50b=[];var _0x3f8e22=squel[_0x423f('0x89')]();_0x3f8e22[_0x423f('0x8a')](_0x423f('0x8b'))[_0x423f('0x8c')](_0x423f('0x8d'),'tq')[_0x423f('0x8e')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x423f('0x48')](_0x423f('0x8f'),_0x1408ca['params']['id']);for(var _0x522d00=0x0;_0x522d00<_0x17e727[_0x423f('0x43')];_0x522d00+=0x1){let _0x22b244=_0x17e727[_0x522d00];for(var _0x1f33e8=0x0;_0x1f33e8<_0x22b244[_0x423f('0x74')]['length'];_0x1f33e8+=0x1){let _0x251ebd=_0x22b244[_0x423f('0x74')][_0x1f33e8];var _0x5a7904=_0x3f8e22[_0x423f('0x60')]();_0x5a7904[_0x423f('0x48')](_0x423f('0x90'),_0x251ebd['id']);_0x84b50b['push'](db[_0x423f('0x7b')]['query'](_0x5a7904[_0x423f('0x91')](),{'type':db[_0x423f('0x7b')][_0x423f('0x92')][_0x423f('0x93')]})[_0x423f('0x2a')](function(_0x28bb80){if(_0x28bb80[_0x423f('0x43')]===0x1){return _0x251ebd['id'];}else{var _0x28e792=_['every'](_['map'](_0x28bb80,_0x423f('0x94')),function(_0x6c541d){return _[_0x423f('0x31')](_0x1ba6cc,_0x6c541d);});if(_0x28e792){return _0x251ebd['id'];}}}));}}return BPromise[_0x423f('0x95')](_0x84b50b)[_0x423f('0x2a')](function(_0x476f50){_0x500a93=_(_0x500a93)['union'](_0x476f50)['compact']()[_0x423f('0x30')]();return db['VoiceQueue'][_0x423f('0x33')]({'where':{'id':_0x1408ca[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](function(_0x4d1981){return db['sequelize'][_0x423f('0x7c')](function(_0x97c2cb){return _0x4d1981['removeTeams'](_0x1408ca[_0x423f('0x3d')]['ids'],{'transaction':_0x97c2cb})[_0x423f('0x2a')](function(){if(!_[_0x423f('0x96')](_0x500a93)){return _0x4d1981[_0x423f('0x97')](_0x500a93,{'transaction':_0x97c2cb})[_0x423f('0x2a')](function(){return db[_0x423f('0x81')][_0x423f('0x2b')]({'where':{'VoiceQueueId':_0x1408ca[_0x423f('0x54')]['id'],'UserId':_0x500a93},'transaction':_0x97c2cb});});}})[_0x423f('0x2a')](function(){_0x500a93[_0x423f('0x79')](function(_0xa78dfe){socket['emit'](_0x423f('0x98'),{'UserId':_0xa78dfe,'VoiceQueueId':_0x4d1981['id']});});});});});});})[_0x423f('0x2a')](respondWithStatusCode(_0x523725,null))[_0x423f('0x52')](handleError(_0x523725,null));};exports[_0x423f('0x99')]=function(_0x2af8cb,_0x4c3821,_0x3e3a79){var _0x5daf55,_0x451581;return db['VoiceQueue'][_0x423f('0x33')]({'where':{'id':_0x2af8cb[_0x423f('0x54')]['id']}})['then'](handleEntityNotFound(_0x4c3821,null))[_0x423f('0x2a')](function(_0x452602){if(_0x452602){_0x451581=_0x452602;return _0x452602[_0x423f('0x99')](_0x2af8cb[_0x423f('0x56')][_0x423f('0x9a')],_[_0x423f('0x61')](_0x2af8cb['body'],[_0x423f('0x9a'),'id'])||{})[_0x423f('0x9b')](function(_0xdbb7e1){for(var _0x2c5e39=0x0;_0x2c5e39<_0x2af8cb[_0x423f('0x56')][_0x423f('0x9a')][_0x423f('0x43')];_0x2c5e39+=0x1){socket[_0x423f('0x86')](_0x423f('0x87'),{'UserId':Number(_0x2af8cb['body']['ids'][_0x2c5e39]),'VoiceQueueId':Number(_0x2af8cb['params']['id'])});}return _0xdbb7e1;});}})[_0x423f('0x2a')](function(_0x13fe13){_0x5daf55=_0x13fe13||[];if(_0x451581){return db['User']['findAll']({'where':{'id':_0x2af8cb[_0x423f('0x56')]['ids']},'attributes':['id',_0x423f('0x34'),_0x423f('0x75'),_0x423f('0x76'),_0x423f('0x77')],'raw':!![]});}})[_0x423f('0x2a')](function(_0x4f4c53){if(!_['isEmpty'](_0x4f4c53)){var _0x5b57b0=[];for(var _0x492884=0x0;_0x492884<_0x4f4c53['length'];_0x492884++){if(_0x4f4c53[_0x492884][_0x423f('0x75')]){_0x5b57b0[_0x423f('0x9c')](db[_0x423f('0x81')][_0x423f('0x82')]({'membername':_0x4f4c53[_0x492884][_0x423f('0x34')],'UserId':_0x4f4c53[_0x492884]['id'],'queue_name':_0x451581['name'],'VoiceQueueId':_0x451581['id'],'interface':_['isNil'](_0x4f4c53[_0x492884][_0x423f('0x77')])?util[_0x423f('0x84')](_0x423f('0x85'),_0x4f4c53[_0x492884][_0x423f('0x34')]):_0x4f4c53[_0x492884][_0x423f('0x77')],'paused':_0x4f4c53[_0x492884][_0x423f('0x76')]||![],'penalty':_0x2af8cb[_0x423f('0x56')][_0x423f('0x7a')]||0x0}));}}return BPromise[_0x423f('0x95')](_0x5b57b0);}})[_0x423f('0x2a')](function(){return _0x5daf55;})[_0x423f('0x2a')](respondWithResult(_0x4c3821,null))[_0x423f('0x52')](handleError(_0x4c3821,null));};exports[_0x423f('0x97')]=function(_0x411c83,_0x2724e5,_0x519c75){return db['VoiceQueue'][_0x423f('0x33')]({'where':{'id':_0x411c83[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x2724e5,null))[_0x423f('0x2a')](function(_0x1e504e){if(_0x1e504e){return _0x1e504e[_0x423f('0x97')](_0x411c83[_0x423f('0x3d')]['ids'])[_0x423f('0x2a')](function(){if(_[_0x423f('0x9d')](_0x411c83[_0x423f('0x3d')][_0x423f('0x9a')])){for(var _0x427011=0x0;_0x427011<_0x411c83['query'][_0x423f('0x9a')][_0x423f('0x43')];_0x427011+=0x1){socket[_0x423f('0x86')]('userVoiceQueue:remove',{'UserId':Number(_0x411c83[_0x423f('0x3d')][_0x423f('0x9a')][_0x427011]),'VoiceQueueId':Number(_0x411c83[_0x423f('0x54')]['id'])});}}else{socket[_0x423f('0x86')](_0x423f('0x98'),{'UserId':Number(_0x411c83[_0x423f('0x3d')][_0x423f('0x9a')]),'VoiceQueueId':Number(_0x411c83[_0x423f('0x54')]['id'])});}});}})[_0x423f('0x2a')](function(_0x1a7c2d){return db[_0x423f('0x81')]['destroy']({'where':{'VoiceQueueId':_0x411c83[_0x423f('0x54')]['id'],'UserId':_0x411c83[_0x423f('0x3d')][_0x423f('0x9a')]}})['then'](function(){return _0x1a7c2d;});})[_0x423f('0x2a')](respondWithStatusCode(_0x2724e5,null))['catch'](handleError(_0x2724e5,null));};exports['getAgents']=function(_0x459f8a,_0x112217,_0xa175cd){var _0x191c9d={};var _0x1603b7={};var _0x5e8e5b;var _0x388313;return db[_0x423f('0x38')][_0x423f('0x66')]({'where':{'id':_0x459f8a['params']['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x112217,null))[_0x423f('0x2a')](function(_0x2cb659){if(_0x2cb659){_0x5e8e5b=_0x2cb659;_0x1603b7[_0x423f('0x3c')]=_[_0x423f('0x3e')](db[_0x423f('0x73')][_0x423f('0x39')]);_0x1603b7['query']=_['keys'](_0x459f8a['query']);_0x1603b7['filters']=_['intersection'](_0x1603b7[_0x423f('0x3c')],_0x1603b7[_0x423f('0x3d')]);_0x191c9d[_0x423f('0x40')]=_[_0x423f('0x41')](_0x1603b7['model'],qs[_0x423f('0x42')](_0x459f8a[_0x423f('0x3d')]['fields']));_0x191c9d[_0x423f('0x40')]=_0x191c9d[_0x423f('0x40')][_0x423f('0x43')]?_0x191c9d['attributes']:_0x1603b7['model'];_0x191c9d[_0x423f('0x46')]=qs[_0x423f('0x47')](_0x459f8a[_0x423f('0x3d')][_0x423f('0x47')]);_0x191c9d['where']=qs[_0x423f('0x3f')](_[_0x423f('0x49')](_0x459f8a['query'],_0x1603b7[_0x423f('0x3f')]));if(_0x459f8a[_0x423f('0x3d')]['filter']){_0x191c9d[_0x423f('0x48')]=_[_0x423f('0x4a')](_0x191c9d[_0x423f('0x48')],{'$or':_[_0x423f('0x2f')](_0x191c9d['attributes'],function(_0x218a51){var _0x38cb89={};_0x38cb89[_0x218a51]={'$like':'%'+_0x459f8a[_0x423f('0x3d')][_0x423f('0x4c')]+'%'};return _0x38cb89;})});}_0x191c9d=_[_0x423f('0x4a')]({},_0x191c9d,_0x459f8a[_0x423f('0x4d')]);return _0x5e8e5b[_0x423f('0x9e')](_0x191c9d);}})[_0x423f('0x2a')](function(_0x3e021b){if(_0x3e021b){_0x388313=_0x3e021b[_0x423f('0x43')];if(!_0x459f8a[_0x423f('0x3d')][_0x423f('0x44')](_0x423f('0x45'))){_0x191c9d[_0x423f('0x23')]=qs[_0x423f('0x23')](_0x459f8a['query']['limit']);_0x191c9d[_0x423f('0x20')]=qs['offset'](_0x459f8a['query']['offset']);}return _0x5e8e5b['getAgents'](_0x191c9d);}})[_0x423f('0x2a')](function(_0x5229ac){if(_0x5229ac){return _0x5229ac?{'count':_0x388313,'rows':_0x5229ac}:null;}})['then'](respondWithResult(_0x112217,null))[_0x423f('0x52')](handleError(_0x112217,null));};exports['getMembers']=function(_0x2102c2,_0x4c98ea,_0x12d224){var _0x5af64f={};var _0x23494f={};var _0x3f8501;var _0x144cd0;return db['VoiceQueue']['findOne']({'where':{'id':_0x2102c2[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x4c98ea,null))[_0x423f('0x2a')](function(_0x2b23f6){if(_0x2b23f6){_0x3f8501=_0x2b23f6;_0x23494f[_0x423f('0x3c')]=_[_0x423f('0x3e')](db[_0x423f('0x81')][_0x423f('0x39')]);_0x23494f['query']=_[_0x423f('0x3e')](_0x2102c2['query']);_0x23494f[_0x423f('0x3f')]=_['intersection'](_0x23494f[_0x423f('0x3c')],_0x23494f['query']);_0x5af64f['attributes']=_[_0x423f('0x41')](_0x23494f[_0x423f('0x3c')],qs[_0x423f('0x42')](_0x2102c2[_0x423f('0x3d')][_0x423f('0x42')]));_0x5af64f['attributes']=_0x5af64f[_0x423f('0x40')][_0x423f('0x43')]?_0x5af64f['attributes']:_0x23494f[_0x423f('0x3c')];_0x5af64f[_0x423f('0x46')]=qs['sort'](_0x2102c2['query']['sort']);_0x5af64f[_0x423f('0x48')]=qs[_0x423f('0x3f')](_['pick'](_0x2102c2[_0x423f('0x3d')],_0x23494f[_0x423f('0x3f')]));if(_0x2102c2[_0x423f('0x3d')][_0x423f('0x4c')]){_0x5af64f[_0x423f('0x48')]=_['merge'](_0x5af64f[_0x423f('0x48')],{'$or':_['map'](_0x5af64f[_0x423f('0x40')],function(_0x23a9d3){var _0x2cb250={};_0x2cb250[_0x23a9d3]={'$like':'%'+_0x2102c2[_0x423f('0x3d')][_0x423f('0x4c')]+'%'};return _0x2cb250;})});}_0x5af64f=_[_0x423f('0x4a')]({},_0x5af64f,_0x2102c2['options']);return _0x3f8501[_0x423f('0x9f')](_0x5af64f);}})['then'](function(_0x3782f5){if(_0x3782f5){_0x144cd0=_0x3782f5[_0x423f('0x43')];if(!_0x2102c2[_0x423f('0x3d')][_0x423f('0x44')](_0x423f('0x45'))){_0x5af64f['limit']=qs[_0x423f('0x23')](_0x2102c2['query']['limit']);_0x5af64f[_0x423f('0x20')]=qs[_0x423f('0x20')](_0x2102c2['query'][_0x423f('0x20')]);}return _0x3f8501[_0x423f('0x9f')](_0x5af64f);}})['then'](function(_0x492dc4){return _0x492dc4?{'count':_0x144cd0,'rows':_0x492dc4}:null;})['then'](respondWithResult(_0x4c98ea,null))[_0x423f('0x52')](handleError(_0x4c98ea,null));};exports[_0x423f('0xa0')]=function(_0x5ecdbe,_0x261690,_0xdd41d7){var _0x3b4beb={};var _0x41b6ac={};var _0x236ead;var _0x336f7c;return db[_0x423f('0x38')][_0x423f('0x66')]({'where':{'id':_0x5ecdbe[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x261690,null))[_0x423f('0x2a')](function(_0xa065b3){if(_0xa065b3){_0x236ead=_0xa065b3;_0x41b6ac[_0x423f('0x3c')]=_[_0x423f('0x3e')](db[_0x423f('0xa1')][_0x423f('0x39')]);_0x41b6ac[_0x423f('0x3d')]=_[_0x423f('0x3e')](_0x5ecdbe[_0x423f('0x3d')]);_0x41b6ac[_0x423f('0x3f')]=_[_0x423f('0x41')](_0x41b6ac[_0x423f('0x3c')],_0x41b6ac[_0x423f('0x3d')]);_0x3b4beb['attributes']=_[_0x423f('0x41')](_0x41b6ac['model'],qs[_0x423f('0x42')](_0x5ecdbe[_0x423f('0x3d')][_0x423f('0x42')]));_0x3b4beb['attributes']=_0x3b4beb['attributes'][_0x423f('0x43')]?_0x3b4beb[_0x423f('0x40')]:_0x41b6ac[_0x423f('0x3c')];_0x3b4beb[_0x423f('0x46')]=qs[_0x423f('0x47')](_0x5ecdbe[_0x423f('0x3d')][_0x423f('0x47')]);_0x3b4beb['where']=qs[_0x423f('0x3f')](_[_0x423f('0x49')](_0x5ecdbe['query'],_0x41b6ac[_0x423f('0x3f')]));if(_0x5ecdbe[_0x423f('0x3d')][_0x423f('0x4c')]){_0x3b4beb['where']=_[_0x423f('0x4a')](_0x3b4beb[_0x423f('0x48')],{'$or':_['map'](_0x3b4beb[_0x423f('0x40')],function(_0x29c8e6){var _0x2f49c6={};_0x2f49c6[_0x29c8e6]={'$like':'%'+_0x5ecdbe[_0x423f('0x3d')][_0x423f('0x4c')]+'%'};return _0x2f49c6;})});}_0x3b4beb=_[_0x423f('0x4a')]({},_0x3b4beb,_0x5ecdbe[_0x423f('0x4d')]);return _0x236ead[_0x423f('0xa0')](_0x3b4beb);}})[_0x423f('0x2a')](function(_0x21c99f){if(_0x21c99f){_0x336f7c=_0x21c99f['length'];if(!_0x5ecdbe[_0x423f('0x3d')]['hasOwnProperty']('nolimit')){_0x3b4beb[_0x423f('0x23')]=qs[_0x423f('0x23')](_0x5ecdbe[_0x423f('0x3d')][_0x423f('0x23')]);_0x3b4beb['offset']=qs[_0x423f('0x20')](_0x5ecdbe['query'][_0x423f('0x20')]);}return _0x236ead[_0x423f('0xa0')](_0x3b4beb);}})[_0x423f('0x2a')](function(_0x3edb25){if(_0x3edb25){return _0x3edb25?{'count':_0x336f7c,'rows':_0x3edb25}:null;}})[_0x423f('0x2a')](respondWithResult(_0x261690,null))['catch'](handleError(_0x261690,null));};exports[_0x423f('0xa2')]=function(_0x447809,_0x50acce,_0x385305){var _0x131de2=moment()[_0x423f('0x84')](_0x423f('0xa3'));var _0x4080e6,_0x1ffdae;return db[_0x423f('0x38')][_0x423f('0x33')]({'where':{'id':_0x447809[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x50acce,null))[_0x423f('0x2a')](function(_0x3bef9a){if(_0x3bef9a){_0x1ffdae=_0x3bef9a;return _0x3bef9a[_0x423f('0xa2')](_0x447809['body']['ids'],_[_0x423f('0x61')](_0x447809[_0x423f('0x56')],['ids','id'])||{});}return null;})[_0x423f('0x9b')](function(_0x41e33e){var _0x3d7903;_0x4080e6=_0x41e33e||[];var _0x36a02a=[];if(_0x41e33e){for(var _0x585f5a=0x0;_0x585f5a<_0x41e33e[_0x423f('0x43')];_0x585f5a+=0x1){var _0x319a0a=_0x41e33e[_0x585f5a][_0x423f('0x2c')]({'plain':!![]});_0x1ffdae[_0x423f('0xa4')]=_0x447809[_0x423f('0x56')][_0x423f('0xa4')]?_0x447809['body'][_0x423f('0xa4')]:_0x1ffdae['dialCheckDuplicateType'];switch(_0x1ffdae['dialCheckDuplicateType']){case'always':_0x3d7903=squel[_0x423f('0xa5')]()[_0x423f('0xa6')](_0x423f('0xa7'))['fromQuery']([_0x423f('0xa8'),'scheduledAt',_0x423f('0xa9'),_0x423f('0xaa'),_0x423f('0x68'),_0x423f('0x63'),_0x423f('0x62')],squel[_0x423f('0x89')]()[_0x423f('0x8a')](_0x423f('0xa8'),_0x423f('0xa8'))[_0x423f('0x8a')]('\x27'+_0x131de2+'\x27','scheduledAt')['field']('id',_0x423f('0xa9'))[_0x423f('0x8a')](_0x319a0a[_0x423f('0xab')]['toString'](),_0x423f('0xaa'))[_0x423f('0x8a')](_0x447809[_0x423f('0x54')]['id'][_0x423f('0x91')](),_0x423f('0x68'))[_0x423f('0x8a')]('\x27'+_0x131de2+'\x27',_0x423f('0x63'))[_0x423f('0x8a')]('\x27'+_0x131de2+'\x27',_0x423f('0x62'))[_0x423f('0x8c')](_0x423f('0xac'))[_0x423f('0x48')]('deletedAt\x20IS\x20NULL')[_0x423f('0x48')]('ListId\x20=\x20?',_0x319a0a[_0x423f('0xab')][_0x423f('0x91')]())[_0x423f('0x48')](_0x423f('0xad'))[_0x423f('0x48')](_0x423f('0xae'),squel[_0x423f('0x89')]()[_0x423f('0x8a')](_0x423f('0xaf'))[_0x423f('0x8c')](_0x423f('0xb0'))[_0x423f('0x48')]('VoiceQueueId\x20=\x20?',_0x447809['params']['id']['toString']()))['where'](_0x423f('0xae'),squel[_0x423f('0x89')]()[_0x423f('0x8a')](_0x423f('0xb1'))[_0x423f('0x8c')]('cm_hopper')[_0x423f('0x48')](_0x423f('0x8f'),_0x447809[_0x423f('0x54')]['id'][_0x423f('0x91')]())))[_0x423f('0x91')]();break;case _0x423f('0xb2'):_0x3d7903=squel['insert']()[_0x423f('0xa6')]('cm_hopper')[_0x423f('0xb3')]([_0x423f('0xa8'),_0x423f('0xb4'),_0x423f('0xa9'),'ListId',_0x423f('0x68'),_0x423f('0x63'),_0x423f('0x62')],squel[_0x423f('0x89')]()['field'](_0x423f('0xa8'),_0x423f('0xa8'))['field']('\x27'+_0x131de2+'\x27',_0x423f('0xb4'))[_0x423f('0x8a')]('id',_0x423f('0xa9'))[_0x423f('0x8a')](_0x319a0a[_0x423f('0xab')][_0x423f('0x91')](),_0x423f('0xaa'))['field'](_0x447809[_0x423f('0x54')]['id'][_0x423f('0x91')](),_0x423f('0x68'))['field']('\x27'+_0x131de2+'\x27',_0x423f('0x63'))['field']('\x27'+_0x131de2+'\x27',_0x423f('0x62'))[_0x423f('0x8c')](_0x423f('0xac'))[_0x423f('0x48')](_0x423f('0xb5'))[_0x423f('0x48')]('ListId\x20=\x20?',_0x319a0a[_0x423f('0xab')]['toString']())[_0x423f('0x48')](_0x423f('0xad'))[_0x423f('0x48')](_0x423f('0xae'),squel[_0x423f('0x89')]()[_0x423f('0x8a')](_0x423f('0xb1'))[_0x423f('0x8c')](_0x423f('0xa7'))['where'](_0x423f('0x8f'),_0x447809[_0x423f('0x54')]['id'][_0x423f('0x91')]())))[_0x423f('0x91')]();break;default:_0x3d7903=squel[_0x423f('0xa5')]()[_0x423f('0xa6')](_0x423f('0xa7'))[_0x423f('0xb3')](['phone',_0x423f('0xb4'),_0x423f('0xa9'),_0x423f('0xaa'),'VoiceQueueId',_0x423f('0x63'),_0x423f('0x62')],squel['select']()[_0x423f('0x8a')]('phone',_0x423f('0xa8'))[_0x423f('0x8a')]('\x27'+_0x131de2+'\x27',_0x423f('0xb4'))['field']('id',_0x423f('0xa9'))[_0x423f('0x8a')](_0x319a0a[_0x423f('0xab')][_0x423f('0x91')](),_0x423f('0xaa'))[_0x423f('0x8a')](_0x447809[_0x423f('0x54')]['id']['toString'](),_0x423f('0x68'))[_0x423f('0x8a')]('\x27'+_0x131de2+'\x27',_0x423f('0x63'))['field']('\x27'+_0x131de2+'\x27','updatedAt')[_0x423f('0x8c')](_0x423f('0xac'))[_0x423f('0x48')](_0x423f('0xb5'))['where'](_0x423f('0xb6'),_0x319a0a[_0x423f('0xab')]['toString']())['where'](_0x423f('0xad')))[_0x423f('0x91')]();}_0x36a02a['push'](db[_0x423f('0x7b')][_0x423f('0x3d')](_0x3d7903));}return BPromise[_0x423f('0x95')](_0x36a02a);}})[_0x423f('0x2a')](function(){var _0x25f119=[];var _0x24496a=squel['insert']()[_0x423f('0xa6')]('cm_hopper_additional_phones')[_0x423f('0xb3')](['CmHopperId','phone',_0x423f('0xb7'),_0x423f('0x63'),_0x423f('0x62')],squel[_0x423f('0x89')]()[_0x423f('0x8a')]('h.id')['field'](_0x423f('0xb8'))[_0x423f('0x8a')](_0x423f('0xb9'))[_0x423f('0x8a')]('\x27'+_0x131de2+'\x27',_0x423f('0x63'))[_0x423f('0x8a')]('\x27'+_0x131de2+'\x27','updatedAt')[_0x423f('0x8c')](_0x423f('0xba'),'ci')[_0x423f('0x8e')](_0x423f('0xa7'),'h',_0x423f('0xbb'))[_0x423f('0x48')]('h.scheduledat=?',_0x131de2)['where']('ci.ItemClass=?',_0x423f('0xbc')))[_0x423f('0x91')]();_0x25f119[_0x423f('0x9c')](db['sequelize'][_0x423f('0x3d')](_0x24496a));return BPromise[_0x423f('0x95')](_0x25f119);})[_0x423f('0x2a')](function(){return _0x4080e6;})[_0x423f('0x2a')](respondWithResult(_0x50acce,null))[_0x423f('0x52')](handleError(_0x50acce,null));};exports[_0x423f('0xbd')]=function(_0x576c94,_0xaea05b,_0x1d112a){return db['VoiceQueue'][_0x423f('0x33')]({'where':{'id':_0x576c94[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0xaea05b,null))[_0x423f('0x2a')](function(_0x45df44){if(_0x45df44){return _0x45df44['removeLists'](_0x576c94['query'][_0x423f('0x9a')]);}})['then'](function(_0x552d2b){if(_0x552d2b){return db[_0x423f('0x67')][_0x423f('0x2b')]({'where':{'ListId':_0x576c94[_0x423f('0x3d')][_0x423f('0x9a')],'VoiceQueueId':_0x576c94[_0x423f('0x54')]['id']}})['then'](function(){return _0x552d2b;});}})[_0x423f('0x2a')](respondWithStatusCode(_0xaea05b,null))[_0x423f('0x52')](handleError(_0xaea05b,null));};exports['getBlackLists']=function(_0x4ab25c,_0x4eb1e8,_0x1348f4){var _0x4b70dc={};var _0xb2b23={};var _0x17465a;var _0x8ceccd;return db['VoiceQueue'][_0x423f('0x66')]({'where':{'id':_0x4ab25c[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x4eb1e8,null))[_0x423f('0x2a')](function(_0x4e2a3b){if(_0x4e2a3b){_0x17465a=_0x4e2a3b;_0xb2b23[_0x423f('0x3c')]=_[_0x423f('0x3e')](db[_0x423f('0xa1')][_0x423f('0x39')]);_0xb2b23[_0x423f('0x3d')]=_[_0x423f('0x3e')](_0x4ab25c['query']);_0xb2b23[_0x423f('0x3f')]=_[_0x423f('0x41')](_0xb2b23[_0x423f('0x3c')],_0xb2b23[_0x423f('0x3d')]);_0x4b70dc[_0x423f('0x40')]=_[_0x423f('0x41')](_0xb2b23['model'],qs[_0x423f('0x42')](_0x4ab25c[_0x423f('0x3d')][_0x423f('0x42')]));_0x4b70dc['attributes']=_0x4b70dc[_0x423f('0x40')][_0x423f('0x43')]?_0x4b70dc[_0x423f('0x40')]:_0xb2b23[_0x423f('0x3c')];_0x4b70dc[_0x423f('0x46')]=qs[_0x423f('0x47')](_0x4ab25c['query'][_0x423f('0x47')]);_0x4b70dc['where']=qs[_0x423f('0x3f')](_['pick'](_0x4ab25c[_0x423f('0x3d')],_0xb2b23[_0x423f('0x3f')]));if(_0x4ab25c['query']['filter']){_0x4b70dc[_0x423f('0x48')]=_[_0x423f('0x4a')](_0x4b70dc['where'],{'$or':_[_0x423f('0x2f')](_0x4b70dc[_0x423f('0x40')],function(_0x4a3220){var _0x44d7d8={};_0x44d7d8[_0x4a3220]={'$like':'%'+_0x4ab25c[_0x423f('0x3d')][_0x423f('0x4c')]+'%'};return _0x44d7d8;})});}_0x4b70dc=_[_0x423f('0x4a')]({},_0x4b70dc,_0x4ab25c[_0x423f('0x4d')]);return _0x17465a[_0x423f('0xbe')](_0x4b70dc);}})[_0x423f('0x2a')](function(_0x41496a){if(_0x41496a){_0x8ceccd=_0x41496a['length'];if(!_0x4ab25c[_0x423f('0x3d')][_0x423f('0x44')](_0x423f('0x45'))){_0x4b70dc[_0x423f('0x23')]=qs[_0x423f('0x23')](_0x4ab25c[_0x423f('0x3d')][_0x423f('0x23')]);_0x4b70dc[_0x423f('0x20')]=qs[_0x423f('0x20')](_0x4ab25c[_0x423f('0x3d')][_0x423f('0x20')]);}return _0x17465a[_0x423f('0xbe')](_0x4b70dc);}})[_0x423f('0x2a')](function(_0x48779d){if(_0x48779d){return _0x48779d?{'count':_0x8ceccd,'rows':_0x48779d}:null;}})[_0x423f('0x2a')](respondWithResult(_0x4eb1e8,null))[_0x423f('0x52')](handleError(_0x4eb1e8,null));};exports[_0x423f('0xbf')]=function(_0x269708,_0x429631,_0x4e0a65){var _0x3faed5,_0x13932e;return db[_0x423f('0x38')]['find']({'where':{'id':_0x269708[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x429631,null))[_0x423f('0x2a')](function(_0x2d5639){if(_0x2d5639){_0x13932e=_0x2d5639;return _0x2d5639[_0x423f('0xbf')](_0x269708[_0x423f('0x56')][_0x423f('0x9a')],_[_0x423f('0x61')](_0x269708[_0x423f('0x56')],[_0x423f('0x9a'),'id'])||{});}return null;})[_0x423f('0x9b')](function(_0x55ab6c){var _0x3119b2;_0x3faed5=_0x55ab6c||[];var _0x182be3=[];if(_0x55ab6c){for(var _0x421731=0x0;_0x421731<_0x55ab6c[_0x423f('0x43')];_0x421731+=0x1){var _0x307c3b=_0x55ab6c[_0x421731][_0x423f('0x2c')]({'plain':!![]});_0x3119b2=squel[_0x423f('0xa5')]()[_0x423f('0xa6')](_0x423f('0xc0'))[_0x423f('0xb3')]([_0x423f('0xa8'),'ContactId',_0x423f('0xaa'),'VoiceQueueId',_0x423f('0x63'),_0x423f('0x62')],squel[_0x423f('0x89')]()[_0x423f('0x8a')]('phone',_0x423f('0xa8'))['field']('id',_0x423f('0xa9'))['field'](_0x307c3b[_0x423f('0xab')][_0x423f('0x91')](),_0x423f('0xaa'))[_0x423f('0x8a')](_0x269708[_0x423f('0x54')]['id']['toString'](),_0x423f('0x68'))[_0x423f('0x8a')](_0x423f('0xc1'),'createdAt')['field'](_0x423f('0xc1'),_0x423f('0x62'))[_0x423f('0x8c')](_0x423f('0xac'))[_0x423f('0x48')](_0x423f('0xb5'))[_0x423f('0x48')](_0x423f('0xb6'),_0x307c3b[_0x423f('0xab')][_0x423f('0x91')]())[_0x423f('0x48')](_0x423f('0xad')))['toString']();_0x182be3[_0x423f('0x9c')](db[_0x423f('0x7b')][_0x423f('0x3d')](_0x3119b2));}return BPromise[_0x423f('0x95')](_0x182be3);}})[_0x423f('0x2a')](function(){return _0x3faed5;})[_0x423f('0x2a')](respondWithResult(_0x429631,null))[_0x423f('0x52')](handleError(_0x429631,null));};exports['removeBlackLists']=function(_0x59452b,_0x2d29f9,_0x1b3602){return db[_0x423f('0x38')]['find']({'where':{'id':_0x59452b[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x2d29f9,null))[_0x423f('0x2a')](function(_0x4b0bfb){if(_0x4b0bfb){return _0x4b0bfb[_0x423f('0xc2')](_0x59452b[_0x423f('0x3d')][_0x423f('0x9a')]);}})[_0x423f('0x2a')](function(_0xd27f24){if(_0xd27f24){return db[_0x423f('0x6e')]['destroy']({'where':{'ListId':_0x59452b[_0x423f('0x3d')][_0x423f('0x9a')],'VoiceQueueId':_0x59452b[_0x423f('0x54')]['id']}})[_0x423f('0x2a')](function(){return _0xd27f24;});}})[_0x423f('0x2a')](respondWithStatusCode(_0x2d29f9,null))['catch'](handleError(_0x2d29f9,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 43f3c03..2bc79f9 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 _0x5507=['VoiceQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x7789ca,_0x402c38){var _0xa08845=function(_0x20373c){while(--_0x20373c){_0x7789ca['push'](_0x7789ca['shift']());}};_0xa08845(++_0x402c38);}(_0x5507,0x194));var _0x7550=function(_0x3909d8,_0x2d7165){_0x3909d8=_0x3909d8-0x0;var _0x3f1ae1=_0x5507[_0x3909d8];return _0x3f1ae1;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x7550('0x0'))['db'][_0x7550('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7550('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7550('0x3'),'afterDestroy':_0x7550('0x4')};function emitEvent(_0x41ed94){return function(_0x5c20f6,_0x1bb426,_0x1c7ad7){VoiceQueueEvents[_0x7550('0x5')](_0x41ed94+':'+_0x5c20f6['id'],_0x5c20f6);VoiceQueueEvents[_0x7550('0x5')](_0x41ed94,_0x5c20f6);_0x1c7ad7(null);};}for(var e in events){if(events[_0x7550('0x6')](e)){var event=events[e];VoiceQueue[_0x7550('0x7')](e,emitEvent(event));}}module[_0x7550('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xc134=['VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x558ba9,_0x43afbb){var _0x251305=function(_0x587264){while(--_0x587264){_0x558ba9['push'](_0x558ba9['shift']());}};_0x251305(++_0x43afbb);}(_0xc134,0x166));var _0x4c13=function(_0x52712a,_0x12f47b){_0x52712a=_0x52712a-0x0;var _0x3f4afc=_0xc134[_0x52712a];return _0x3f4afc;};'use strict';var EventEmitter=require(_0x4c13('0x0'));var VoiceQueue=require(_0x4c13('0x1'))['db'][_0x4c13('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x4c13('0x3')](0x0);var events={'afterCreate':_0x4c13('0x4'),'afterUpdate':_0x4c13('0x5'),'afterDestroy':'remove'};function emitEvent(_0xae37cc){return function(_0x447653,_0x4e096e,_0x491981){VoiceQueueEvents[_0x4c13('0x6')](_0xae37cc+':'+_0x447653['id'],_0x447653);VoiceQueueEvents[_0x4c13('0x6')](_0xae37cc,_0x447653);_0x491981(null);};}for(var e in events){if(events[_0x4c13('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x4c13('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 16a4c17..df85928 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(_0x5de237,_0x2058e8){var _0x3b3d4d=function(_0x3debe1){while(--_0x3debe1){_0x5de237['push'](_0x5de237['shift']());}};_0x3b3d4d(++_0x2058e8);}(_0x70e0,0x17b));var _0x070e=function(_0x1527a4,_0x2f253a){_0x1527a4=_0x1527a4-0x0;var _0x33cd4b=_0x70e0[_0x1527a4];return _0x33cd4b;};'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 _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x41cd8f,_0x33ce30){var _0x43457d=function(_0x2b4d54){while(--_0x2b4d54){_0x41cd8f['push'](_0x41cd8f['shift']());}};_0x43457d(++_0x33ce30);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 53b70b0..bd15f3f 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 _0xbd6e=['raw','where','attributes','limit','map','model','include','catch','ShowVoiceQueue','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceQueue','VoiceQueue','findAll','options'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xbd6e,0x184));var _0xebd6=function(_0x104a2a,_0x110471){_0x104a2a=_0x104a2a-0x0;var _0x50fd82=_0xbd6e[_0x104a2a];return _0x50fd82;};'use strict';var _=require('lodash');var util=require(_0xebd6('0x0'));var moment=require(_0xebd6('0x1'));var BPromise=require(_0xebd6('0x2'));var rs=require(_0xebd6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebd6('0x4'))['db'];var utils=require(_0xebd6('0x5'));var logger=require(_0xebd6('0x6'))(_0xebd6('0x7'));var config=require(_0xebd6('0x8'));var jayson=require(_0xebd6('0x9'));var client=jayson[_0xebd6('0xa')][_0xebd6('0xb')]({'port':0x232a});config[_0xebd6('0xc')]=_[_0xebd6('0xd')](config['redis'],{'host':_0xebd6('0xe'),'port':0x18eb});var socket=require(_0xebd6('0xf'))(new Redis(config[_0xebd6('0xc')]));require(_0xebd6('0x10'))[_0xebd6('0x11')](socket);function respondWithRpcPromise(_0x5f0dd4,_0x3f4817,_0x4746ca){return new BPromise(function(_0xdee50d,_0x3397a7){return client['request'](_0x5f0dd4,_0x4746ca)[_0xebd6('0x12')](function(_0xb713a5){logger[_0xebd6('0x13')](_0xebd6('0x14'),_0x3f4817,_0xebd6('0x15'));logger[_0xebd6('0x16')](_0xebd6('0x17'),_0x3f4817,'request\x20sent',JSON[_0xebd6('0x18')](_0xb713a5));if(_0xb713a5[_0xebd6('0x19')]){if(_0xb713a5[_0xebd6('0x19')][_0xebd6('0x1a')]===0x1f4){logger[_0xebd6('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x3f4817,_0xb713a5[_0xebd6('0x19')][_0xebd6('0x1b')]);return _0x3397a7(_0xb713a5[_0xebd6('0x19')][_0xebd6('0x1b')]);}logger[_0xebd6('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x3f4817,_0xb713a5[_0xebd6('0x19')][_0xebd6('0x1b')]);return _0xdee50d(_0xb713a5[_0xebd6('0x19')]['message']);}else{logger['info'](_0xebd6('0x14'),_0x3f4817,_0xebd6('0x15'));_0xdee50d(_0xb713a5['result'][_0xebd6('0x1b')]);}})['catch'](function(_0x3e719a){logger['error'](_0xebd6('0x14'),_0x3f4817,_0x3e719a);_0x3397a7(_0x3e719a);});});}exports[_0xebd6('0x1c')]=function(_0x4ee370){var _0x1ec856=this;return new Promise(function(_0x4b555a,_0x403460){return db[_0xebd6('0x1d')][_0xebd6('0x1e')]({'raw':_0x4ee370[_0xebd6('0x1f')]?_0x4ee370['options'][_0xebd6('0x20')]===undefined?!![]:![]:!![],'where':_0x4ee370['options']?_0x4ee370[_0xebd6('0x1f')][_0xebd6('0x21')]||null:null,'attributes':_0x4ee370[_0xebd6('0x1f')]?_0x4ee370[_0xebd6('0x1f')][_0xebd6('0x22')]||null:null,'limit':_0x4ee370[_0xebd6('0x1f')]?_0x4ee370[_0xebd6('0x1f')][_0xebd6('0x23')]||null:null,'include':_0x4ee370[_0xebd6('0x1f')]?_0x4ee370['options']['include']?_[_0xebd6('0x24')](_0x4ee370[_0xebd6('0x1f')]['include'],function(_0x468e6c){return{'model':db[_0x468e6c[_0xebd6('0x25')]],'as':_0x468e6c['as'],'attributes':_0x468e6c[_0xebd6('0x22')],'include':_0x468e6c[_0xebd6('0x26')]?_['map'](_0x468e6c[_0xebd6('0x26')],function(_0x4ec0c8){return{'model':db[_0x4ec0c8[_0xebd6('0x25')]],'as':_0x4ec0c8['as'],'attributes':_0x4ec0c8['attributes'],'include':_0x4ec0c8[_0xebd6('0x26')]?_['map'](_0x4ec0c8['include'],function(_0x1179a9){return{'model':db[_0x1179a9[_0xebd6('0x25')]],'as':_0x1179a9['as'],'attributes':_0x1179a9[_0xebd6('0x22')]};}):[]};}):[]};}):[]:[]})[_0xebd6('0x12')](function(_0x4350c6){logger[_0xebd6('0x13')](_0xebd6('0x1c'),_0x4ee370);logger['debug']('GetVoiceQueue',_0x4ee370,JSON[_0xebd6('0x18')](_0x4350c6));_0x4b555a(_0x4350c6);})[_0xebd6('0x27')](function(_0x4e8820){logger[_0xebd6('0x19')]('GetVoiceQueue',_0x4e8820['message'],_0x4ee370);_0x403460(_0x1ec856[_0xebd6('0x19')](0x1f4,_0x4e8820[_0xebd6('0x1b')]));});});};exports[_0xebd6('0x28')]=function(_0x301106){var _0x4c9d8=this;return new Promise(function(_0x5cfccc,_0x2d783f){return db[_0xebd6('0x1d')][_0xebd6('0x29')]({'raw':_0x301106[_0xebd6('0x1f')]?_0x301106['options'][_0xebd6('0x20')]===undefined?!![]:![]:!![],'where':_0x301106[_0xebd6('0x1f')]?_0x301106[_0xebd6('0x1f')][_0xebd6('0x21')]||null:null,'attributes':_0x301106[_0xebd6('0x1f')]?_0x301106[_0xebd6('0x1f')]['attributes']||null:null,'include':_0x301106['options']?_0x301106['options'][_0xebd6('0x26')]?_[_0xebd6('0x24')](_0x301106[_0xebd6('0x1f')][_0xebd6('0x26')],function(_0x786124){return{'model':db[_0x786124['model']],'as':_0x786124['as'],'attributes':_0x786124[_0xebd6('0x22')],'include':_0x786124[_0xebd6('0x26')]?_[_0xebd6('0x24')](_0x786124[_0xebd6('0x26')],function(_0x386617){return{'model':db[_0x386617[_0xebd6('0x25')]],'as':_0x386617['as'],'attributes':_0x386617['attributes'],'include':_0x386617[_0xebd6('0x26')]?_[_0xebd6('0x24')](_0x386617[_0xebd6('0x26')],function(_0x4ca3d4){return{'model':db[_0x4ca3d4[_0xebd6('0x25')]],'as':_0x4ca3d4['as'],'attributes':_0x4ca3d4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48ff5a){logger[_0xebd6('0x13')](_0xebd6('0x28'),_0x301106);logger[_0xebd6('0x16')](_0xebd6('0x28'),_0x301106,JSON[_0xebd6('0x18')](_0x48ff5a));_0x5cfccc(_0x48ff5a);})['catch'](function(_0x2a8f22){logger[_0xebd6('0x19')](_0xebd6('0x28'),_0x2a8f22[_0xebd6('0x1b')],_0x301106);_0x2d783f(_0x4c9d8[_0xebd6('0x19')](0x1f4,_0x2a8f22['message']));});});}; \ No newline at end of file +var _0x1a70=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','request','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceQueue','findAll','options','where','attributes','limit','include','model','map','info','GetVoiceQueue','ShowVoiceQueue','find','raw','then'];(function(_0x1ecba1,_0x57d775){var _0x3ce62e=function(_0x317107){while(--_0x317107){_0x1ecba1['push'](_0x1ecba1['shift']());}};_0x3ce62e(++_0x57d775);}(_0x1a70,0x1a2));var _0x01a7=function(_0x1416fc,_0x72e155){_0x1416fc=_0x1416fc-0x0;var _0x3a4b34=_0x1a70[_0x1416fc];return _0x3a4b34;};'use strict';var _=require('lodash');var util=require(_0x01a7('0x0'));var moment=require('moment');var BPromise=require(_0x01a7('0x1'));var rs=require(_0x01a7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01a7('0x3'))['db'];var utils=require(_0x01a7('0x4'));var logger=require(_0x01a7('0x5'))(_0x01a7('0x6'));var config=require('../../config/environment');var jayson=require(_0x01a7('0x7'));var client=jayson['client'][_0x01a7('0x8')]({'port':0x232a});config[_0x01a7('0x9')]=_[_0x01a7('0xa')](config[_0x01a7('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x01a7('0xb'))(new Redis(config['redis']));require(_0x01a7('0xc'))['register'](socket);function respondWithRpcPromise(_0x4a21ef,_0x24d287,_0x82fb85){return new BPromise(function(_0x319d96,_0x46302b){return client[_0x01a7('0xd')](_0x4a21ef,_0x82fb85)['then'](function(_0x372fb5){logger['info'](_0x01a7('0xe'),_0x24d287,_0x01a7('0xf'));logger[_0x01a7('0x10')](_0x01a7('0x11'),_0x24d287,_0x01a7('0xf'),JSON[_0x01a7('0x12')](_0x372fb5));if(_0x372fb5[_0x01a7('0x13')]){if(_0x372fb5[_0x01a7('0x13')]['code']===0x1f4){logger['error'](_0x01a7('0xe'),_0x24d287,_0x372fb5[_0x01a7('0x13')][_0x01a7('0x14')]);return _0x46302b(_0x372fb5[_0x01a7('0x13')][_0x01a7('0x14')]);}logger[_0x01a7('0x13')](_0x01a7('0xe'),_0x24d287,_0x372fb5[_0x01a7('0x13')][_0x01a7('0x14')]);return _0x319d96(_0x372fb5[_0x01a7('0x13')][_0x01a7('0x14')]);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x24d287,_0x01a7('0xf'));_0x319d96(_0x372fb5[_0x01a7('0x15')][_0x01a7('0x14')]);}})[_0x01a7('0x16')](function(_0x40a138){logger[_0x01a7('0x13')](_0x01a7('0xe'),_0x24d287,_0x40a138);_0x46302b(_0x40a138);});});}exports['GetVoiceQueue']=function(_0x3d0dd6){var _0x22e561=this;return new Promise(function(_0x3f7565,_0x2b0c42){return db[_0x01a7('0x17')][_0x01a7('0x18')]({'raw':_0x3d0dd6[_0x01a7('0x19')]?_0x3d0dd6['options']['raw']===undefined?!![]:![]:!![],'where':_0x3d0dd6[_0x01a7('0x19')]?_0x3d0dd6[_0x01a7('0x19')][_0x01a7('0x1a')]||null:null,'attributes':_0x3d0dd6['options']?_0x3d0dd6[_0x01a7('0x19')][_0x01a7('0x1b')]||null:null,'limit':_0x3d0dd6[_0x01a7('0x19')]?_0x3d0dd6[_0x01a7('0x19')][_0x01a7('0x1c')]||null:null,'include':_0x3d0dd6[_0x01a7('0x19')]?_0x3d0dd6[_0x01a7('0x19')]['include']?_['map'](_0x3d0dd6[_0x01a7('0x19')][_0x01a7('0x1d')],function(_0x1d1cf7){return{'model':db[_0x1d1cf7[_0x01a7('0x1e')]],'as':_0x1d1cf7['as'],'attributes':_0x1d1cf7[_0x01a7('0x1b')],'include':_0x1d1cf7[_0x01a7('0x1d')]?_[_0x01a7('0x1f')](_0x1d1cf7[_0x01a7('0x1d')],function(_0xcbe263){return{'model':db[_0xcbe263[_0x01a7('0x1e')]],'as':_0xcbe263['as'],'attributes':_0xcbe263[_0x01a7('0x1b')],'include':_0xcbe263[_0x01a7('0x1d')]?_['map'](_0xcbe263[_0x01a7('0x1d')],function(_0x490629){return{'model':db[_0x490629['model']],'as':_0x490629['as'],'attributes':_0x490629[_0x01a7('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f22fa){logger[_0x01a7('0x20')](_0x01a7('0x21'),_0x3d0dd6);logger['debug']('GetVoiceQueue',_0x3d0dd6,JSON['stringify'](_0x2f22fa));_0x3f7565(_0x2f22fa);})[_0x01a7('0x16')](function(_0x33b57d){logger[_0x01a7('0x13')](_0x01a7('0x21'),_0x33b57d[_0x01a7('0x14')],_0x3d0dd6);_0x2b0c42(_0x22e561[_0x01a7('0x13')](0x1f4,_0x33b57d[_0x01a7('0x14')]));});});};exports[_0x01a7('0x22')]=function(_0x5dee75){var _0x1ca4ff=this;return new Promise(function(_0x23cd34,_0x1c072e){return db[_0x01a7('0x17')][_0x01a7('0x23')]({'raw':_0x5dee75[_0x01a7('0x19')]?_0x5dee75[_0x01a7('0x19')][_0x01a7('0x24')]===undefined?!![]:![]:!![],'where':_0x5dee75['options']?_0x5dee75[_0x01a7('0x19')][_0x01a7('0x1a')]||null:null,'attributes':_0x5dee75[_0x01a7('0x19')]?_0x5dee75[_0x01a7('0x19')][_0x01a7('0x1b')]||null:null,'include':_0x5dee75['options']?_0x5dee75[_0x01a7('0x19')][_0x01a7('0x1d')]?_['map'](_0x5dee75[_0x01a7('0x19')][_0x01a7('0x1d')],function(_0xd6aeb5){return{'model':db[_0xd6aeb5[_0x01a7('0x1e')]],'as':_0xd6aeb5['as'],'attributes':_0xd6aeb5[_0x01a7('0x1b')],'include':_0xd6aeb5[_0x01a7('0x1d')]?_[_0x01a7('0x1f')](_0xd6aeb5[_0x01a7('0x1d')],function(_0x5d5d35){return{'model':db[_0x5d5d35['model']],'as':_0x5d5d35['as'],'attributes':_0x5d5d35[_0x01a7('0x1b')],'include':_0x5d5d35[_0x01a7('0x1d')]?_[_0x01a7('0x1f')](_0x5d5d35[_0x01a7('0x1d')],function(_0x2447b1){return{'model':db[_0x2447b1['model']],'as':_0x2447b1['as'],'attributes':_0x2447b1['attributes']};}):[]};}):[]};}):[]:[]})[_0x01a7('0x25')](function(_0x3e9b4f){logger[_0x01a7('0x20')](_0x01a7('0x22'),_0x5dee75);logger[_0x01a7('0x10')](_0x01a7('0x22'),_0x5dee75,JSON[_0x01a7('0x12')](_0x3e9b4f));_0x23cd34(_0x3e9b4f);})[_0x01a7('0x16')](function(_0x20bed4){logger['error'](_0x01a7('0x22'),_0x20bed4['message'],_0x5dee75);_0x1c072e(_0x1ca4ff['error'](0x1f4,_0x20bed4[_0x01a7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 84ea577..5472789 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 _0x3918=['length','./voiceQueue.events','save','update','emit','removeListener','register'];(function(_0x68b712,_0x513079){var _0x420e51=function(_0x49ba4f){while(--_0x49ba4f){_0x68b712['push'](_0x68b712['shift']());}};_0x420e51(++_0x513079);}(_0x3918,0x1c1));var _0x8391=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3918[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require(_0x8391('0x0'));var events=[_0x8391('0x1'),'remove',_0x8391('0x2')];function createListener(_0x3a56ac,_0x5af276){return function(_0x3825ec){_0x5af276[_0x8391('0x3')](_0x3a56ac,_0x3825ec);};}function removeListener(_0x1d98cc,_0x43bb76){return function(){VoiceQueueEvents[_0x8391('0x4')](_0x1d98cc,_0x43bb76);};}exports[_0x8391('0x5')]=function(_0x27a71c){for(var _0xa1609a=0x0,_0x3a6d65=events[_0x8391('0x6')];_0xa1609a<_0x3a6d65;_0xa1609a++){var _0x2b84fd=events[_0xa1609a];var _0x1d4cee=createListener('voiceQueue:'+_0x2b84fd,_0x27a71c);VoiceQueueEvents['on'](_0x2b84fd,_0x1d4cee);}}; \ No newline at end of file +var _0xe1c7=['remove','update','removeListener','register','voiceQueue:','./voiceQueue.events'];(function(_0x4db7c1,_0x40baeb){var _0x41fa35=function(_0x363797){while(--_0x363797){_0x4db7c1['push'](_0x4db7c1['shift']());}};_0x41fa35(++_0x40baeb);}(_0xe1c7,0xb3));var _0x7e1c=function(_0xb0fe92,_0x147e42){_0xb0fe92=_0xb0fe92-0x0;var _0x41787f=_0xe1c7[_0xb0fe92];return _0x41787f;};'use strict';var VoiceQueueEvents=require(_0x7e1c('0x0'));var events=['save',_0x7e1c('0x1'),_0x7e1c('0x2')];function createListener(_0x2093f6,_0x4401fb){return function(_0x21b953){_0x4401fb['emit'](_0x2093f6,_0x21b953);};}function removeListener(_0x50b960,_0x314970){return function(){VoiceQueueEvents[_0x7e1c('0x3')](_0x50b960,_0x314970);};}exports[_0x7e1c('0x4')]=function(_0x59cb67){for(var _0x4fefaa=0x0,_0x157a21=events['length'];_0x4fefaa<_0x157a21;_0x4fefaa++){var _0x341031=events[_0x4fefaa];var _0x670615=createListener(_0x7e1c('0x5')+_0x341031,_0x59cb67);VoiceQueueEvents['on'](_0x341031,_0x670615);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 6271d13..7f45a46 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 _0xd9fa=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','/:id','show','destroy','exports'];(function(_0x30eeb5,_0x15e2d3){var _0x543af8=function(_0x2fa057){while(--_0x2fa057){_0x30eeb5['push'](_0x30eeb5['shift']());}};_0x543af8(++_0x15e2d3);}(_0xd9fa,0xa0));var _0xad9f=function(_0x79340c,_0x323f65){_0x79340c=_0x79340c-0x0;var _0x1d6c60=_0xd9fa[_0x79340c];return _0x1d6c60;};'use strict';var multer=require(_0xad9f('0x0'));var util=require(_0xad9f('0x1'));var path=require(_0xad9f('0x2'));var timeout=require('connect-timeout');var express=require(_0xad9f('0x3'));var router=express[_0xad9f('0x4')]();var fs_extra=require(_0xad9f('0x5'));var auth=require(_0xad9f('0x6'));var interaction=require(_0xad9f('0x7'));var config=require(_0xad9f('0x8'));var controller=require(_0xad9f('0x9'));router[_0xad9f('0xa')]('/',auth[_0xad9f('0xb')](),controller[_0xad9f('0xc')]);router[_0xad9f('0xa')](_0xad9f('0xd'),auth[_0xad9f('0xb')](),controller[_0xad9f('0xe')]);router[_0xad9f('0xa')](_0xad9f('0xf'),auth[_0xad9f('0xb')](),controller['getVoiceQueuesReport']);router[_0xad9f('0xa')](_0xad9f('0x10'),auth['isAuthenticated'](),controller[_0xad9f('0x11')]);router['post']('/',auth[_0xad9f('0xb')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xad9f('0x10'),auth[_0xad9f('0xb')](),controller[_0xad9f('0x12')]);module[_0xad9f('0x13')]=router; \ No newline at end of file +var _0x5f4d=['path','connect-timeout','Router','../../config/environment','isAuthenticated','index','get','describe','/index','post','create','put','delete','/:id','exports','multer','util'];(function(_0x4c8e2d,_0x51a01d){var _0x54e299=function(_0x298acc){while(--_0x298acc){_0x4c8e2d['push'](_0x4c8e2d['shift']());}};_0x54e299(++_0x51a01d);}(_0x5f4d,0x86));var _0xd5f4=function(_0x3fe210,_0x3cdd84){_0x3fe210=_0x3fe210-0x0;var _0x293b52=_0x5f4d[_0x3fe210];return _0x293b52;};'use strict';var multer=require(_0xd5f4('0x0'));var util=require(_0xd5f4('0x1'));var path=require(_0xd5f4('0x2'));var timeout=require(_0xd5f4('0x3'));var express=require('express');var router=express[_0xd5f4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd5f4('0x5'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0xd5f4('0x6')](),controller[_0xd5f4('0x7')]);router[_0xd5f4('0x8')]('/describe',auth[_0xd5f4('0x6')](),controller[_0xd5f4('0x9')]);router[_0xd5f4('0x8')](_0xd5f4('0xa'),auth[_0xd5f4('0x6')](),controller['getVoiceQueuesReport']);router['get']('/:id',auth[_0xd5f4('0x6')](),controller['show']);router[_0xd5f4('0xb')]('/',auth[_0xd5f4('0x6')](),controller[_0xd5f4('0xc')]);router[_0xd5f4('0xd')]('/:id',auth[_0xd5f4('0x6')](),controller['update']);router[_0xd5f4('0xe')](_0xd5f4('0xf'),auth[_0xd5f4('0x6')](),controller['destroy']);module[_0xd5f4('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 6c08798..06d29d8 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 _0xc65a=['FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER'];(function(_0x4409a2,_0x38083f){var _0x441090=function(_0x544af4){while(--_0x544af4){_0x4409a2['push'](_0x4409a2['shift']());}};_0x441090(++_0x38083f);}(_0xc65a,0x191));var _0xac65=function(_0x2678bd,_0x2d93d4){_0x2678bd=_0x2678bd-0x0;var _0x5926d0=_0xc65a[_0x2678bd];return _0x5926d0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xac65('0x0'));module[_0xac65('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xac65('0x2')]},'calleridnum':{'type':Sequelize[_0xac65('0x2')]},'calleridname':{'type':Sequelize[_0xac65('0x2')]},'queue':{'type':Sequelize[_0xac65('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xac65('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xac65('0x3')],'set':function(_0x2da8d3){var _0x482c6e=moment(_0x2da8d3);var _0x2a6432=moment(this[_0xac65('0x4')](_0xac65('0x5')))['format'](_0xac65('0x6'));var _0xe8409a=_0x482c6e[_0xac65('0x7')](_0x2a6432,_0xac65('0x8'));this['setDataValue'](_0xac65('0x9'),_0x2da8d3);this[_0xac65('0xa')](_0xac65('0xb'),_0xe8409a||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xac65('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xac65('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xac65('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xac65('0x3')]},'queuecallerexit':{'type':Sequelize[_0xac65('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xac65('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xac65('0x2')],'comment':_0xac65('0xd')},'originalposition':{'type':Sequelize[_0xac65('0xe')]},'channel':{'type':Sequelize[_0xac65('0x2')]},'connectedlinenum':{'type':Sequelize[_0xac65('0x2')]},'connectedlinename':{'type':Sequelize[_0xac65('0x2')]},'accountcode':{'type':Sequelize[_0xac65('0x2')]},'context':{'type':Sequelize[_0xac65('0x2')]},'exten':{'type':Sequelize[_0xac65('0x2')]},'priority':{'type':Sequelize[_0xac65('0x2')]},'holdtime':{'type':Sequelize[_0xac65('0xe')]},'mohtime':{'type':Sequelize[_0xac65('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xac65('0x2')]},'transfer':{'type':Sequelize[_0xac65('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xac65('0x2')],'comment':_0xac65('0xf')},'transferexten':{'type':Sequelize[_0xac65('0x2')]},'transferuniqueid':{'type':Sequelize[_0xac65('0x2')]},'disposition':{'type':Sequelize[_0xac65('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xac65('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe57e=['setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','seconds'];(function(_0x1cce59,_0x1cef8f){var _0x16cb54=function(_0x4770b1){while(--_0x4770b1){_0x1cce59['push'](_0x1cce59['shift']());}};_0x16cb54(++_0x1cef8f);}(_0xe57e,0x156));var _0xee57=function(_0x5cd11d,_0xff32c2){_0x5cd11d=_0x5cd11d-0x0;var _0x586a29=_0xe57e[_0x5cd11d];return _0x586a29;};'use strict';var Sequelize=require(_0xee57('0x0'));var moment=require(_0xee57('0x1'));module['exports']={'type':{'type':Sequelize[_0xee57('0x2')]},'uniqueid':{'type':Sequelize[_0xee57('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xee57('0x2')]},'queue':{'type':Sequelize[_0xee57('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xee57('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xee57('0x3')],'set':function(_0x1ff232){var _0x506753=moment(_0x1ff232);var _0xbe835d=moment(this[_0xee57('0x4')](_0xee57('0x5')))['format'](_0xee57('0x6'));var _0x26602a=_0x506753['diff'](_0xbe835d,_0xee57('0x7'));this[_0xee57('0x8')](_0xee57('0x9'),_0x1ff232);this[_0xee57('0x8')]('holdtime',_0x26602a||null);}},'position':{'type':Sequelize[_0xee57('0xa')]},'count':{'type':Sequelize[_0xee57('0xa')]},'queuecallerabandon':{'type':Sequelize[_0xee57('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xee57('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xee57('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xee57('0x3')]},'queuecallerexit':{'type':Sequelize[_0xee57('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xee57('0x2')],'comment':_0xee57('0xc')},'originalposition':{'type':Sequelize[_0xee57('0xa')]},'channel':{'type':Sequelize[_0xee57('0x2')]},'connectedlinenum':{'type':Sequelize[_0xee57('0x2')]},'connectedlinename':{'type':Sequelize[_0xee57('0x2')]},'accountcode':{'type':Sequelize[_0xee57('0x2')]},'context':{'type':Sequelize[_0xee57('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xee57('0xa')]},'mohtime':{'type':Sequelize[_0xee57('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xee57('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xee57('0x2')]},'transfer':{'type':Sequelize[_0xee57('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xee57('0x2')],'comment':_0xee57('0xd')},'transferexten':{'type':Sequelize[_0xee57('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xee57('0x2')]},'secondDisposition':{'type':Sequelize[_0xee57('0x2')]},'thirdDisposition':{'type':Sequelize[_0xee57('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xee57('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 53ed0bd..cd7ae00 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 _0xe3bd=['VIRTUAL','where','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge'];(function(_0x1d8bc1,_0x32f319){var _0x50dfb0=function(_0x23dd10){while(--_0x23dd10){_0x1d8bc1['push'](_0x1d8bc1['shift']());}};_0x50dfb0(++_0x32f319);}(_0xe3bd,0x1e5));var _0xde3b=function(_0x57d740,_0x50be99){_0x57d740=_0x57d740-0x0;var _0x6607ef=_0xe3bd[_0x57d740];return _0x6607ef;};'use strict';var emlformat=require(_0xde3b('0x0'));var rimraf=require(_0xde3b('0x1'));var zipdir=require(_0xde3b('0x2'));var jsonpatch=require(_0xde3b('0x3'));var rp=require('request-promise');var moment=require(_0xde3b('0x4'));var BPromise=require(_0xde3b('0x5'));var Mustache=require('mustache');var util=require(_0xde3b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xde3b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xde3b('0x8'));var crypto=require(_0xde3b('0x9'));var jsforce=require(_0xde3b('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xde3b('0xb'));var Papa=require(_0xde3b('0xc'));var Redis=require(_0xde3b('0xd'));var authService=require(_0xde3b('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xde3b('0xf'))(_0xde3b('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xde3b('0x11'));var db=require(_0xde3b('0x12'))['db'];config['redis']=_['defaults'](config[_0xde3b('0x13')],{'host':_0xde3b('0x14'),'port':0x18eb});var socket=require(_0xde3b('0x15'))(new Redis(config[_0xde3b('0x13')]));require(_0xde3b('0x16'))[_0xde3b('0x17')](socket);function respondWithStatusCode(_0x4dd8d9,_0x2c13a1){_0x2c13a1=_0x2c13a1||0xcc;return function(_0x1f07dd){if(_0x1f07dd){return _0x4dd8d9[_0xde3b('0x18')](_0x2c13a1);}return _0x4dd8d9[_0xde3b('0x19')](_0x2c13a1)[_0xde3b('0x1a')]();};}function respondWithResult(_0x997546,_0x328e57){_0x328e57=_0x328e57||0xc8;return function(_0x134303){if(_0x134303){return _0x997546[_0xde3b('0x19')](_0x328e57)[_0xde3b('0x1b')](_0x134303);}};}function respondWithFilteredResult(_0x5f2b9c,_0x376e8d){return function(_0x217bfc){if(_0x217bfc){var _0x3487ea=typeof _0x376e8d[_0xde3b('0x1c')]===_0xde3b('0x1d')&&typeof _0x376e8d['limit']==='undefined';var _0x27af30=_0x217bfc[_0xde3b('0x1e')];var _0x15f676=_0x3487ea?0x0:_0x376e8d['offset'];var _0x13a15b=_0x3487ea?_0x217bfc[_0xde3b('0x1e')]:_0x376e8d['offset']+_0x376e8d[_0xde3b('0x1f')];var _0x3ef868;if(_0x13a15b>=_0x27af30){_0x13a15b=_0x27af30;_0x3ef868=0xc8;}else{_0x3ef868=0xce;}_0x5f2b9c['status'](_0x3ef868);return _0x5f2b9c['set'](_0xde3b('0x20'),_0x15f676+'-'+_0x13a15b+'/'+_0x27af30)[_0xde3b('0x1b')](_0x217bfc);}return null;};}function patchUpdates(_0x560865){return function(_0x518bd2){try{jsonpatch[_0xde3b('0x21')](_0x518bd2,_0x560865,!![]);}catch(_0x5ac49c){return BPromise[_0xde3b('0x22')](_0x5ac49c);}return _0x518bd2['save']();};}function saveUpdates(_0x18a4b7,_0x2e83c3){return function(_0x574910){if(_0x574910){return _0x574910['update'](_0x18a4b7)[_0xde3b('0x23')](function(_0x308102){return _0x308102;});}return null;};}function removeEntity(_0x509e2a,_0x5b5c53){return function(_0x36c090){if(_0x36c090){return _0x36c090[_0xde3b('0x24')]()['then'](function(){_0x509e2a[_0xde3b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cf934,_0x182cfd){return function(_0x391ca7){if(!_0x391ca7){_0x5cf934[_0xde3b('0x18')](0x194);}return _0x391ca7;};}function handleError(_0x4def5f,_0x2682ae){_0x2682ae=_0x2682ae||0x1f4;return function(_0x240564){logger[_0xde3b('0x25')](_0x240564['stack']);if(_0x240564[_0xde3b('0x26')]){delete _0x240564[_0xde3b('0x26')];}_0x4def5f[_0xde3b('0x19')](_0x2682ae)[_0xde3b('0x27')](_0x240564);};}exports[_0xde3b('0x28')]=function(_0x5f006d,_0x2ad313){var _0x38ad21={},_0x1f6002={},_0x22a8b4={'count':0x0,'rows':[]};var _0x329a1c=_['map'](db['VoiceQueueReport'][_0xde3b('0x29')],function(_0xff7822){return{'name':_0xff7822[_0xde3b('0x2a')],'type':_0xff7822[_0xde3b('0x2b')][_0xde3b('0x2c')]};});_0x1f6002[_0xde3b('0x2d')]=_[_0xde3b('0x2e')](_0x329a1c,_0xde3b('0x26'));_0x1f6002['query']=_[_0xde3b('0x2f')](_0x5f006d[_0xde3b('0x30')]);_0x1f6002[_0xde3b('0x31')]=_['intersection'](_0x1f6002['model'],_0x1f6002[_0xde3b('0x30')]);_0x38ad21['attributes']=_[_0xde3b('0x32')](_0x1f6002[_0xde3b('0x2d')],qs['fields'](_0x5f006d[_0xde3b('0x30')][_0xde3b('0x33')]));_0x38ad21[_0xde3b('0x34')]=_0x38ad21[_0xde3b('0x34')][_0xde3b('0x35')]?_0x38ad21[_0xde3b('0x34')]:_0x1f6002['model'];if(!_0x5f006d['query'][_0xde3b('0x36')](_0xde3b('0x37'))){_0x38ad21[_0xde3b('0x1f')]=qs[_0xde3b('0x1f')](_0x5f006d['query'][_0xde3b('0x1f')]);_0x38ad21[_0xde3b('0x1c')]=qs[_0xde3b('0x1c')](_0x5f006d[_0xde3b('0x30')]['offset']);}_0x38ad21[_0xde3b('0x38')]=qs[_0xde3b('0x39')](_0x5f006d[_0xde3b('0x30')][_0xde3b('0x39')]);_0x38ad21['where']=qs[_0xde3b('0x31')](_[_0xde3b('0x3a')](_0x5f006d['query'],_0x1f6002['filters']),_0x329a1c);if(_0x5f006d[_0xde3b('0x30')][_0xde3b('0x3b')]){_0x38ad21['where']=_[_0xde3b('0x3c')](_0x38ad21['where'],{'$or':_[_0xde3b('0x2e')](_0x329a1c,function(_0x5f0a8f){if(_0x5f0a8f[_0xde3b('0x2b')]!==_0xde3b('0x3d')){var _0x5b392d={};_0x5b392d[_0x5f0a8f['name']]={'$like':'%'+_0x5f006d[_0xde3b('0x30')][_0xde3b('0x3b')]+'%'};return _0x5b392d;}})});}_0x38ad21=_[_0xde3b('0x3c')]({},_0x38ad21,_0x5f006d['options']);var _0x175f3e={'where':_0x38ad21[_0xde3b('0x3e')]};return db[_0xde3b('0x3f')][_0xde3b('0x1e')](_0x175f3e)[_0xde3b('0x23')](function(_0x3f4e79){_0x22a8b4[_0xde3b('0x1e')]=_0x3f4e79;if(_0x5f006d[_0xde3b('0x30')][_0xde3b('0x40')]){_0x38ad21[_0xde3b('0x41')]=[{'all':!![]}];}return db[_0xde3b('0x3f')][_0xde3b('0x42')](_0x38ad21);})[_0xde3b('0x23')](function(_0x55e369){_0x22a8b4[_0xde3b('0x43')]=_0x55e369;return _0x22a8b4;})[_0xde3b('0x23')](respondWithFilteredResult(_0x2ad313,_0x38ad21))[_0xde3b('0x44')](handleError(_0x2ad313,null));};exports[_0xde3b('0x45')]=function(_0x2d5b58,_0x284251){var _0x342ea4={'raw':![],'where':{'id':_0x2d5b58[_0xde3b('0x46')]['id']}},_0x509b4e={};_0x509b4e[_0xde3b('0x2d')]=_[_0xde3b('0x2f')](db['VoiceQueueReport']['rawAttributes']);_0x509b4e[_0xde3b('0x30')]=_['keys'](_0x2d5b58['query']);_0x509b4e[_0xde3b('0x31')]=_[_0xde3b('0x32')](_0x509b4e[_0xde3b('0x2d')],_0x509b4e[_0xde3b('0x30')]);_0x342ea4[_0xde3b('0x34')]=_['intersection'](_0x509b4e['model'],qs['fields'](_0x2d5b58[_0xde3b('0x30')][_0xde3b('0x33')]));_0x342ea4['attributes']=_0x342ea4[_0xde3b('0x34')][_0xde3b('0x35')]?_0x342ea4[_0xde3b('0x34')]:_0x509b4e[_0xde3b('0x2d')];if(_0x2d5b58[_0xde3b('0x30')][_0xde3b('0x40')]){_0x342ea4[_0xde3b('0x41')]=[{'all':!![]}];}_0x342ea4=_[_0xde3b('0x3c')]({},_0x342ea4,_0x2d5b58[_0xde3b('0x47')]);return db[_0xde3b('0x3f')][_0xde3b('0x48')](_0x342ea4)[_0xde3b('0x23')](handleEntityNotFound(_0x284251,null))[_0xde3b('0x23')](respondWithResult(_0x284251,null))[_0xde3b('0x44')](handleError(_0x284251,null));};exports[_0xde3b('0x49')]=function(_0x38e127,_0x456f78){return db[_0xde3b('0x3f')][_0xde3b('0x49')](_0x38e127[_0xde3b('0x4a')],{})['then'](respondWithResult(_0x456f78,0xc9))[_0xde3b('0x44')](handleError(_0x456f78,null));};exports[_0xde3b('0x4b')]=function(_0x35dd28,_0x50d65f){if(_0x35dd28[_0xde3b('0x4a')]['id']){delete _0x35dd28[_0xde3b('0x4a')]['id'];}return db['VoiceQueueReport'][_0xde3b('0x48')]({'where':{'id':_0x35dd28[_0xde3b('0x46')]['id']}})[_0xde3b('0x23')](handleEntityNotFound(_0x50d65f,null))[_0xde3b('0x23')](saveUpdates(_0x35dd28[_0xde3b('0x4a')],null))[_0xde3b('0x23')](respondWithResult(_0x50d65f,null))[_0xde3b('0x44')](handleError(_0x50d65f,null));};exports['destroy']=function(_0x4b88d8,_0x29ec74){return db[_0xde3b('0x3f')][_0xde3b('0x48')]({'where':{'id':_0x4b88d8['params']['id']}})[_0xde3b('0x23')](handleEntityNotFound(_0x29ec74,null))[_0xde3b('0x23')](removeEntity(_0x29ec74,null))[_0xde3b('0x44')](handleError(_0x29ec74,null));};exports['describe']=function(_0x1d853d,_0x2b84be){return db[_0xde3b('0x3f')][_0xde3b('0x4c')]()[_0xde3b('0x23')](respondWithResult(_0x2b84be,null))[_0xde3b('0x44')](handleError(_0x2b84be,null));};exports[_0xde3b('0x4d')]=function(_0x2bf643,_0x236e54){var _0x5aec8d={},_0x314d6b={},_0x5dfb21={'count':0x0,'rows':[]};_0x314d6b[_0xde3b('0x2d')]=_[_0xde3b('0x2f')](db[_0xde3b('0x3f')][_0xde3b('0x29')]);_0x314d6b[_0xde3b('0x30')]=_[_0xde3b('0x2f')](_0x2bf643[_0xde3b('0x30')]);_0x314d6b[_0xde3b('0x31')]=_[_0xde3b('0x32')](_0x314d6b['model'],_0x314d6b[_0xde3b('0x30')]);_0x5aec8d[_0xde3b('0x34')]=_[_0xde3b('0x32')](_0x314d6b[_0xde3b('0x2d')],qs[_0xde3b('0x33')](_0x2bf643[_0xde3b('0x30')]['fields']));_0x5aec8d[_0xde3b('0x34')]=_0x5aec8d['attributes'][_0xde3b('0x35')]?_0x5aec8d[_0xde3b('0x34')]:_0x314d6b[_0xde3b('0x2d')];if(!_0x2bf643['query'][_0xde3b('0x36')](_0xde3b('0x37'))){_0x5aec8d['limit']=qs[_0xde3b('0x1f')](_0x2bf643[_0xde3b('0x30')][_0xde3b('0x1f')]);_0x5aec8d[_0xde3b('0x1c')]=qs[_0xde3b('0x1c')](_0x2bf643['query']['offset']);}_0x5aec8d[_0xde3b('0x38')]=qs['sort'](_0x2bf643[_0xde3b('0x30')][_0xde3b('0x39')]);_0x5aec8d[_0xde3b('0x3e')]=qs['filters'](_['pick'](_0x2bf643[_0xde3b('0x30')],_0x314d6b[_0xde3b('0x31')]));if(_0x2bf643[_0xde3b('0x30')][_0xde3b('0x3b')]){_0x5aec8d['where']=_[_0xde3b('0x3c')](_0x5aec8d[_0xde3b('0x3e')],{'$or':_['map'](_0x5aec8d['attributes'],function(_0x44aae9){var _0x4833bd={};_0x4833bd[_0x44aae9]={'$like':'%'+_0x2bf643[_0xde3b('0x30')][_0xde3b('0x3b')]+'%'};return _0x4833bd;})});}_0x5aec8d=_[_0xde3b('0x3c')]({},_0x5aec8d,_0x2bf643[_0xde3b('0x47')]);var _0x5d56bc={'where':_0x5aec8d[_0xde3b('0x3e')]};return db[_0xde3b('0x3f')][_0xde3b('0x1e')](_0x5d56bc)[_0xde3b('0x23')](function(_0xc30987){_0x5dfb21[_0xde3b('0x1e')]=_0xc30987;if(_0x2bf643[_0xde3b('0x30')][_0xde3b('0x40')]){_0x5aec8d['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x5aec8d);})[_0xde3b('0x23')](function(_0x4fb29d){_0x5dfb21['rows']=_0x4fb29d;return _0x5dfb21;})['then'](respondWithFilteredResult(_0x236e54,_0x5aec8d,_0xde3b('0x4d')))['catch'](handleError(_0x236e54,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x7871=['api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','index','map','VoiceQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','params','include','catch','create','body','destroy','describe','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','mustache','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x532b64,_0x19811f){var _0x27a875=function(_0x45998d){while(--_0x45998d){_0x532b64['push'](_0x532b64['shift']());}};_0x27a875(++_0x19811f);}(_0x7871,0x11e));var _0x1787=function(_0x1598b2,_0x1cebf3){_0x1598b2=_0x1598b2-0x0;var _0x2ad439=_0x7871[_0x1598b2];return _0x2ad439;};'use strict';var emlformat=require(_0x1787('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1787('0x1'));var jsonpatch=require(_0x1787('0x2'));var rp=require(_0x1787('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1787('0x4'));var util=require('util');var path=require('path');var sox=require(_0x1787('0x5'));var csv=require('to-csv');var ejs=require(_0x1787('0x6'));var fs=require('fs');var fs_extra=require(_0x1787('0x7'));var _=require(_0x1787('0x8'));var squel=require(_0x1787('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1787('0xa'));var toCsv=require(_0x1787('0xb'));var querystring=require('querystring');var Papa=require(_0x1787('0xc'));var Redis=require(_0x1787('0xd'));var authService=require(_0x1787('0xe'));var qs=require(_0x1787('0xf'));var as=require(_0x1787('0x10'));var hardwareService=require(_0x1787('0x11'));var logger=require('../../config/logger')(_0x1787('0x12'));var utils=require(_0x1787('0x13'));var config=require(_0x1787('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1787('0x15'))['db'];config[_0x1787('0x16')]=_[_0x1787('0x17')](config[_0x1787('0x16')],{'host':_0x1787('0x18'),'port':0x18eb});var socket=require(_0x1787('0x19'))(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x53379d,_0x410eb0){_0x410eb0=_0x410eb0||0xcc;return function(_0x3ec032){if(_0x3ec032){return _0x53379d['sendStatus'](_0x410eb0);}return _0x53379d[_0x1787('0x1a')](_0x410eb0)[_0x1787('0x1b')]();};}function respondWithResult(_0x35c91e,_0x262861){_0x262861=_0x262861||0xc8;return function(_0x2b47ec){if(_0x2b47ec){return _0x35c91e[_0x1787('0x1a')](_0x262861)[_0x1787('0x1c')](_0x2b47ec);}};}function respondWithFilteredResult(_0x886074,_0x2d77ef){return function(_0x2ed3f){if(_0x2ed3f){var _0x32b706=typeof _0x2d77ef[_0x1787('0x1d')]===_0x1787('0x1e')&&typeof _0x2d77ef['limit']===_0x1787('0x1e');var _0x554840=_0x2ed3f['count'];var _0x53d8f4=_0x32b706?0x0:_0x2d77ef[_0x1787('0x1d')];var _0x577f59=_0x32b706?_0x2ed3f['count']:_0x2d77ef[_0x1787('0x1d')]+_0x2d77ef[_0x1787('0x1f')];var _0x2c7053;if(_0x577f59>=_0x554840){_0x577f59=_0x554840;_0x2c7053=0xc8;}else{_0x2c7053=0xce;}_0x886074[_0x1787('0x1a')](_0x2c7053);return _0x886074[_0x1787('0x20')](_0x1787('0x21'),_0x53d8f4+'-'+_0x577f59+'/'+_0x554840)[_0x1787('0x1c')](_0x2ed3f);}return null;};}function patchUpdates(_0x2cbe29){return function(_0x315e2a){try{jsonpatch[_0x1787('0x22')](_0x315e2a,_0x2cbe29,!![]);}catch(_0x535227){return BPromise[_0x1787('0x23')](_0x535227);}return _0x315e2a[_0x1787('0x24')]();};}function saveUpdates(_0x90eadb,_0x1dffc6){return function(_0x2da4b7){if(_0x2da4b7){return _0x2da4b7[_0x1787('0x25')](_0x90eadb)[_0x1787('0x26')](function(_0x8d01b4){return _0x8d01b4;});}return null;};}function removeEntity(_0x592288,_0x33689f){return function(_0x1863de){if(_0x1863de){return _0x1863de['destroy']()[_0x1787('0x26')](function(){_0x592288['status'](0xcc)[_0x1787('0x1b')]();});}};}function handleEntityNotFound(_0x47f1cc,_0x126807){return function(_0x493651){if(!_0x493651){_0x47f1cc[_0x1787('0x27')](0x194);}return _0x493651;};}function handleError(_0x1d4cf3,_0x438b43){_0x438b43=_0x438b43||0x1f4;return function(_0x20601f){logger[_0x1787('0x28')](_0x20601f['stack']);if(_0x20601f['name']){delete _0x20601f['name'];}_0x1d4cf3[_0x1787('0x1a')](_0x438b43)['send'](_0x20601f);};}exports[_0x1787('0x29')]=function(_0x34ad19,_0x1ad16e){var _0x11d293={},_0x5ae1cd={},_0x519e1a={'count':0x0,'rows':[]};var _0x632624=_[_0x1787('0x2a')](db[_0x1787('0x2b')][_0x1787('0x2c')],function(_0x1fc72a){return{'name':_0x1fc72a[_0x1787('0x2d')],'type':_0x1fc72a[_0x1787('0x2e')]['key']};});_0x5ae1cd[_0x1787('0x2f')]=_['map'](_0x632624,'name');_0x5ae1cd[_0x1787('0x30')]=_[_0x1787('0x31')](_0x34ad19[_0x1787('0x30')]);_0x5ae1cd[_0x1787('0x32')]=_['intersection'](_0x5ae1cd[_0x1787('0x2f')],_0x5ae1cd[_0x1787('0x30')]);_0x11d293[_0x1787('0x33')]=_[_0x1787('0x34')](_0x5ae1cd[_0x1787('0x2f')],qs[_0x1787('0x35')](_0x34ad19['query'][_0x1787('0x35')]));_0x11d293['attributes']=_0x11d293[_0x1787('0x33')][_0x1787('0x36')]?_0x11d293[_0x1787('0x33')]:_0x5ae1cd[_0x1787('0x2f')];if(!_0x34ad19[_0x1787('0x30')][_0x1787('0x37')](_0x1787('0x38'))){_0x11d293[_0x1787('0x1f')]=qs['limit'](_0x34ad19[_0x1787('0x30')][_0x1787('0x1f')]);_0x11d293[_0x1787('0x1d')]=qs['offset'](_0x34ad19[_0x1787('0x30')]['offset']);}_0x11d293[_0x1787('0x39')]=qs[_0x1787('0x3a')](_0x34ad19[_0x1787('0x30')]['sort']);_0x11d293[_0x1787('0x3b')]=qs[_0x1787('0x32')](_['pick'](_0x34ad19[_0x1787('0x30')],_0x5ae1cd[_0x1787('0x32')]),_0x632624);if(_0x34ad19[_0x1787('0x30')][_0x1787('0x3c')]){_0x11d293[_0x1787('0x3b')]=_[_0x1787('0x3d')](_0x11d293['where'],{'$or':_['map'](_0x632624,function(_0x5c744e){if(_0x5c744e[_0x1787('0x2e')]!==_0x1787('0x3e')){var _0x5b1f75={};_0x5b1f75[_0x5c744e['name']]={'$like':'%'+_0x34ad19[_0x1787('0x30')][_0x1787('0x3c')]+'%'};return _0x5b1f75;}})});}_0x11d293=_[_0x1787('0x3d')]({},_0x11d293,_0x34ad19[_0x1787('0x3f')]);var _0x24c069={'where':_0x11d293['where']};return db[_0x1787('0x2b')]['count'](_0x24c069)[_0x1787('0x26')](function(_0x16d1e4){_0x519e1a[_0x1787('0x40')]=_0x16d1e4;if(_0x34ad19['query'][_0x1787('0x41')]){_0x11d293['include']=[{'all':!![]}];}return db[_0x1787('0x2b')][_0x1787('0x42')](_0x11d293);})[_0x1787('0x26')](function(_0x5852b1){_0x519e1a[_0x1787('0x43')]=_0x5852b1;return _0x519e1a;})[_0x1787('0x26')](respondWithFilteredResult(_0x1ad16e,_0x11d293))['catch'](handleError(_0x1ad16e,null));};exports['show']=function(_0x565284,_0x73f031){var _0x2b9aa1={'raw':![],'where':{'id':_0x565284[_0x1787('0x44')]['id']}},_0x3c9cb8={};_0x3c9cb8[_0x1787('0x2f')]=_[_0x1787('0x31')](db[_0x1787('0x2b')][_0x1787('0x2c')]);_0x3c9cb8[_0x1787('0x30')]=_['keys'](_0x565284[_0x1787('0x30')]);_0x3c9cb8['filters']=_[_0x1787('0x34')](_0x3c9cb8[_0x1787('0x2f')],_0x3c9cb8['query']);_0x2b9aa1[_0x1787('0x33')]=_[_0x1787('0x34')](_0x3c9cb8['model'],qs[_0x1787('0x35')](_0x565284['query'][_0x1787('0x35')]));_0x2b9aa1[_0x1787('0x33')]=_0x2b9aa1[_0x1787('0x33')][_0x1787('0x36')]?_0x2b9aa1[_0x1787('0x33')]:_0x3c9cb8[_0x1787('0x2f')];if(_0x565284['query'][_0x1787('0x41')]){_0x2b9aa1[_0x1787('0x45')]=[{'all':!![]}];}_0x2b9aa1=_[_0x1787('0x3d')]({},_0x2b9aa1,_0x565284[_0x1787('0x3f')]);return db[_0x1787('0x2b')]['find'](_0x2b9aa1)['then'](handleEntityNotFound(_0x73f031,null))[_0x1787('0x26')](respondWithResult(_0x73f031,null))[_0x1787('0x46')](handleError(_0x73f031,null));};exports[_0x1787('0x47')]=function(_0xef2762,_0x27cc3c){return db['VoiceQueueReport'][_0x1787('0x47')](_0xef2762[_0x1787('0x48')],{})['then'](respondWithResult(_0x27cc3c,0xc9))[_0x1787('0x46')](handleError(_0x27cc3c,null));};exports[_0x1787('0x25')]=function(_0x4a013f,_0x4b102f){if(_0x4a013f[_0x1787('0x48')]['id']){delete _0x4a013f[_0x1787('0x48')]['id'];}return db[_0x1787('0x2b')]['find']({'where':{'id':_0x4a013f['params']['id']}})['then'](handleEntityNotFound(_0x4b102f,null))[_0x1787('0x26')](saveUpdates(_0x4a013f['body'],null))[_0x1787('0x26')](respondWithResult(_0x4b102f,null))[_0x1787('0x46')](handleError(_0x4b102f,null));};exports[_0x1787('0x49')]=function(_0x398398,_0x4bb683){return db[_0x1787('0x2b')]['find']({'where':{'id':_0x398398[_0x1787('0x44')]['id']}})[_0x1787('0x26')](handleEntityNotFound(_0x4bb683,null))[_0x1787('0x26')](removeEntity(_0x4bb683,null))[_0x1787('0x46')](handleError(_0x4bb683,null));};exports[_0x1787('0x4a')]=function(_0x40323b,_0x137604){return db['VoiceQueueReport'][_0x1787('0x4a')]()[_0x1787('0x26')](respondWithResult(_0x137604,null))[_0x1787('0x46')](handleError(_0x137604,null));};exports[_0x1787('0x4b')]=function(_0x266cc0,_0x5eb1c6){var _0x3e0569={},_0x2a936d={},_0x20b4eb={'count':0x0,'rows':[]};_0x2a936d[_0x1787('0x2f')]=_[_0x1787('0x31')](db[_0x1787('0x2b')]['rawAttributes']);_0x2a936d[_0x1787('0x30')]=_[_0x1787('0x31')](_0x266cc0['query']);_0x2a936d['filters']=_[_0x1787('0x34')](_0x2a936d[_0x1787('0x2f')],_0x2a936d['query']);_0x3e0569[_0x1787('0x33')]=_[_0x1787('0x34')](_0x2a936d['model'],qs[_0x1787('0x35')](_0x266cc0[_0x1787('0x30')]['fields']));_0x3e0569[_0x1787('0x33')]=_0x3e0569[_0x1787('0x33')][_0x1787('0x36')]?_0x3e0569[_0x1787('0x33')]:_0x2a936d['model'];if(!_0x266cc0[_0x1787('0x30')][_0x1787('0x37')](_0x1787('0x38'))){_0x3e0569['limit']=qs[_0x1787('0x1f')](_0x266cc0[_0x1787('0x30')]['limit']);_0x3e0569[_0x1787('0x1d')]=qs[_0x1787('0x1d')](_0x266cc0[_0x1787('0x30')][_0x1787('0x1d')]);}_0x3e0569[_0x1787('0x39')]=qs[_0x1787('0x3a')](_0x266cc0[_0x1787('0x30')][_0x1787('0x3a')]);_0x3e0569[_0x1787('0x3b')]=qs[_0x1787('0x32')](_['pick'](_0x266cc0[_0x1787('0x30')],_0x2a936d[_0x1787('0x32')]));if(_0x266cc0[_0x1787('0x30')]['filter']){_0x3e0569[_0x1787('0x3b')]=_[_0x1787('0x3d')](_0x3e0569[_0x1787('0x3b')],{'$or':_['map'](_0x3e0569['attributes'],function(_0x3b2b70){var _0x2f6066={};_0x2f6066[_0x3b2b70]={'$like':'%'+_0x266cc0[_0x1787('0x30')][_0x1787('0x3c')]+'%'};return _0x2f6066;})});}_0x3e0569=_[_0x1787('0x3d')]({},_0x3e0569,_0x266cc0[_0x1787('0x3f')]);var _0x3ff924={'where':_0x3e0569['where']};return db[_0x1787('0x2b')]['count'](_0x3ff924)[_0x1787('0x26')](function(_0x365cdb){_0x20b4eb[_0x1787('0x40')]=_0x365cdb;if(_0x266cc0[_0x1787('0x30')][_0x1787('0x41')]){_0x3e0569[_0x1787('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x3e0569);})[_0x1787('0x26')](function(_0x2c92b7){_0x20b4eb['rows']=_0x2c92b7;return _0x20b4eb;})['then'](respondWithFilteredResult(_0x5eb1c6,_0x3e0569,'getVoiceQueuesReport'))[_0x1787('0x46')](handleError(_0x5eb1c6,null,_0x1787('0x4b')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 97898cf..1e30915 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 _0x905e=['../../mysqldb','VoiceQueueReport','setMaxListeners','remove','emit','hasOwnProperty','exports'];(function(_0x2b2245,_0x282aaa){var _0x1e5d5e=function(_0xb20254){while(--_0xb20254){_0x2b2245['push'](_0x2b2245['shift']());}};_0x1e5d5e(++_0x282aaa);}(_0x905e,0x188));var _0xe905=function(_0x50383f,_0x390c85){_0x50383f=_0x50383f-0x0;var _0x5f5c5b=_0x905e[_0x50383f];return _0x5f5c5b;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xe905('0x0'))['db'][_0xe905('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe905('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe905('0x3')};function emitEvent(_0x138d6e){return function(_0xb90e2b,_0x24df08,_0x32a0fa){VoiceQueueReportEvents[_0xe905('0x4')](_0x138d6e+':'+_0xb90e2b['id'],_0xb90e2b);VoiceQueueReportEvents[_0xe905('0x4')](_0x138d6e,_0xb90e2b);_0x32a0fa(null);};}for(var e in events){if(events[_0xe905('0x5')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xe905('0x6')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x09c4=['exports','events','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x265013,_0x346069){var _0x4b87ec=function(_0x55f0f7){while(--_0x55f0f7){_0x265013['push'](_0x265013['shift']());}};_0x4b87ec(++_0x346069);}(_0x09c4,0xbf));var _0x409c=function(_0x1c3370,_0xf617e8){_0x1c3370=_0x1c3370-0x0;var _0xa9b358=_0x09c4[_0x1c3370];return _0xa9b358;};'use strict';var EventEmitter=require(_0x409c('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x409c('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x409c('0x2')](0x0);var events={'afterCreate':_0x409c('0x3'),'afterUpdate':_0x409c('0x4'),'afterDestroy':_0x409c('0x5')};function emitEvent(_0x2bcc48){return function(_0x2f1bed,_0x809777,_0x4c23ff){VoiceQueueReportEvents[_0x409c('0x6')](_0x2bcc48+':'+_0x2f1bed['id'],_0x2f1bed);VoiceQueueReportEvents[_0x409c('0x6')](_0x2bcc48,_0x2f1bed);_0x4c23ff(null);};}for(var e in events){if(events[_0x409c('0x7')](e)){var event=events[e];VoiceQueueReport[_0x409c('0x8')](e,emitEvent(event));}}module[_0x409c('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 3faf93e..2c9e87d 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 _0xe311=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger'];(function(_0x59374d,_0x27db1e){var _0x7d2dc6=function(_0x452bab){while(--_0x452bab){_0x59374d['push'](_0x59374d['shift']());}};_0x7d2dc6(++_0x27db1e);}(_0xe311,0x1a2));var _0x1e31=function(_0x5cf134,_0x29a06e){_0x5cf134=_0x5cf134-0x0;var _0x2550fd=_0xe311[_0x5cf134];return _0x2550fd;};'use strict';var _=require('lodash');var util=require(_0x1e31('0x0'));var logger=require(_0x1e31('0x1'))('api');var moment=require(_0x1e31('0x2'));var BPromise=require(_0x1e31('0x3'));var rp=require(_0x1e31('0x4'));var fs=require('fs');var path=require(_0x1e31('0x5'));var rimraf=require(_0x1e31('0x6'));var config=require(_0x1e31('0x7'));var attributes=require(_0x1e31('0x8'));module[_0x1e31('0x9')]=function(_0x354b05,_0x435124){return _0x354b05[_0x1e31('0xa')](_0x1e31('0xb'),attributes,{'tableName':_0x1e31('0xc'),'paranoid':![],'indexes':[{'fields':[_0x1e31('0xd')]},{'fields':[_0x1e31('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ac3=['VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./voiceQueueReport.attributes','define'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x1ac3,0x17c));var _0x31ac=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x1ac3[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x31ac('0x0'));var util=require(_0x31ac('0x1'));var logger=require(_0x31ac('0x2'))(_0x31ac('0x3'));var moment=require(_0x31ac('0x4'));var BPromise=require('bluebird');var rp=require(_0x31ac('0x5'));var fs=require('fs');var path=require(_0x31ac('0x6'));var rimraf=require(_0x31ac('0x7'));var config=require('../../config/environment');var attributes=require(_0x31ac('0x8'));module['exports']=function(_0x2bf4d6,_0x372a8b){return _0x2bf4d6[_0x31ac('0x9')](_0x31ac('0xa'),attributes,{'tableName':_0x31ac('0xb'),'paranoid':![],'indexes':[{'fields':[_0x31ac('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index b239635..4a5a0f0 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 _0x8697=['model','then','stringify','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','VoiceQueueReport,\x20%s,\x20%s','message','request\x20sent','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x2ade70,_0x2e23a6){var _0x32945f=function(_0x2f556e){while(--_0x2f556e){_0x2ade70['push'](_0x2ade70['shift']());}};_0x32945f(++_0x2e23a6);}(_0x8697,0x156));var _0x7869=function(_0x4b80c2,_0x38aea1){_0x4b80c2=_0x4b80c2-0x0;var _0x239dd2=_0x8697[_0x4b80c2];return _0x239dd2;};'use strict';var _=require(_0x7869('0x0'));var util=require(_0x7869('0x1'));var moment=require(_0x7869('0x2'));var BPromise=require(_0x7869('0x3'));var rs=require(_0x7869('0x4'));var fs=require('fs');var Redis=require(_0x7869('0x5'));var db=require(_0x7869('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7869('0x7'))(_0x7869('0x8'));var config=require('../../config/environment');var jayson=require(_0x7869('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x7869('0xa')]=_[_0x7869('0xb')](config[_0x7869('0xa')],{'host':_0x7869('0xc'),'port':0x18eb});var socket=require(_0x7869('0xd'))(new Redis(config[_0x7869('0xa')]));require(_0x7869('0xe'))[_0x7869('0xf')](socket);function respondWithRpcPromise(_0x13d8e3,_0x455ed0,_0x2f40d4){return new BPromise(function(_0x27efb5,_0x2c3b4c){return client[_0x7869('0x10')](_0x13d8e3,_0x2f40d4)['then'](function(_0x169d49){logger[_0x7869('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x455ed0,'request\x20sent');logger[_0x7869('0x12')](_0x7869('0x13'),_0x455ed0,'request\x20sent',JSON['stringify'](_0x169d49));if(_0x169d49[_0x7869('0x14')]){if(_0x169d49['error'][_0x7869('0x15')]===0x1f4){logger[_0x7869('0x14')](_0x7869('0x16'),_0x455ed0,_0x169d49[_0x7869('0x14')]['message']);return _0x2c3b4c(_0x169d49['error'][_0x7869('0x17')]);}logger[_0x7869('0x14')](_0x7869('0x16'),_0x455ed0,_0x169d49[_0x7869('0x14')]['message']);return _0x27efb5(_0x169d49[_0x7869('0x14')][_0x7869('0x17')]);}else{logger['info'](_0x7869('0x16'),_0x455ed0,_0x7869('0x18'));_0x27efb5(_0x169d49['result'][_0x7869('0x17')]);}})[_0x7869('0x19')](function(_0xbcfefa){logger[_0x7869('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x455ed0,_0xbcfefa);_0x2c3b4c(_0xbcfefa);});});}exports[_0x7869('0x1a')]=function(_0xa35f05){var _0xb19ad7=this;return new Promise(function(_0xcc5046,_0x3fc894){return db[_0x7869('0x1b')][_0x7869('0x1c')]({'raw':_0xa35f05[_0x7869('0x1d')]?_0xa35f05[_0x7869('0x1d')][_0x7869('0x1e')]===undefined?!![]:![]:!![],'where':_0xa35f05[_0x7869('0x1d')]?_0xa35f05['options'][_0x7869('0x1f')]||null:null,'attributes':_0xa35f05['options']?_0xa35f05[_0x7869('0x1d')][_0x7869('0x20')]||null:null,'limit':_0xa35f05[_0x7869('0x1d')]?_0xa35f05[_0x7869('0x1d')][_0x7869('0x21')]||null:null,'include':_0xa35f05[_0x7869('0x1d')]?_0xa35f05[_0x7869('0x1d')]['include']?_[_0x7869('0x22')](_0xa35f05['options'][_0x7869('0x23')],function(_0x3e3d25){return{'model':db[_0x3e3d25[_0x7869('0x24')]],'as':_0x3e3d25['as'],'attributes':_0x3e3d25[_0x7869('0x20')],'include':_0x3e3d25['include']?_[_0x7869('0x22')](_0x3e3d25['include'],function(_0x124687){return{'model':db[_0x124687[_0x7869('0x24')]],'as':_0x124687['as'],'attributes':_0x124687[_0x7869('0x20')],'include':_0x124687[_0x7869('0x23')]?_[_0x7869('0x22')](_0x124687[_0x7869('0x23')],function(_0x327af5){return{'model':db[_0x327af5[_0x7869('0x24')]],'as':_0x327af5['as'],'attributes':_0x327af5[_0x7869('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7869('0x25')](function(_0x22f478){logger[_0x7869('0x11')](_0x7869('0x1a'),_0xa35f05);logger[_0x7869('0x12')]('GetVoiceQueueReport',_0xa35f05,JSON[_0x7869('0x26')](_0x22f478));_0xcc5046(_0x22f478);})[_0x7869('0x19')](function(_0x57f6f8){logger[_0x7869('0x14')](_0x7869('0x1a'),_0x57f6f8[_0x7869('0x17')],_0xa35f05);_0x3fc894(_0xb19ad7[_0x7869('0x14')](0x1f4,_0x57f6f8[_0x7869('0x17')]));});});};exports[_0x7869('0x27')]=function(_0x761ab9){var _0x5d6f9a=this;return new Promise(function(_0xf34b97,_0x38a479){return db[_0x7869('0x1b')]['create'](_0x761ab9['body'],{'raw':_0x761ab9[_0x7869('0x1d')]?_0x761ab9[_0x7869('0x1d')][_0x7869('0x1e')]===undefined?!![]:![]:!![]})[_0x7869('0x25')](function(_0x5a8820){logger[_0x7869('0x11')](_0x7869('0x27'),_0x761ab9);logger[_0x7869('0x12')](_0x7869('0x27'),_0x761ab9,JSON[_0x7869('0x26')](_0x5a8820));_0xf34b97(_0x5a8820);})[_0x7869('0x19')](function(_0x349bbd){logger[_0x7869('0x14')](_0x7869('0x27'),_0x349bbd[_0x7869('0x17')],_0x761ab9);_0x38a479(_0x5d6f9a[_0x7869('0x14')](0x1f4,_0x349bbd[_0x7869('0x17')]));});});};exports[_0x7869('0x28')]=function(_0x763509){var _0xb6f930=this;return new Promise(function(_0x2f6d00,_0x424448){return db[_0x7869('0x1b')][_0x7869('0x29')](_0x763509['body'],{'raw':_0x763509[_0x7869('0x1d')]?_0x763509[_0x7869('0x1d')][_0x7869('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x763509[_0x7869('0x1d')]?_0x763509[_0x7869('0x1d')]['where']||null:null,'attributes':_0x763509[_0x7869('0x1d')]?_0x763509[_0x7869('0x1d')][_0x7869('0x20')]||null:null,'limit':_0x763509['options']?_0x763509[_0x7869('0x1d')][_0x7869('0x21')]||null:null})[_0x7869('0x25')](function(_0x3ed387){logger['info']('UpdateVoiceQueueReport',_0x763509);logger[_0x7869('0x12')]('UpdateVoiceQueueReport',_0x763509,JSON[_0x7869('0x26')](_0x3ed387));_0x2f6d00(_0x3ed387);})[_0x7869('0x19')](function(_0x939329){logger['error'](_0x7869('0x28'),_0x939329[_0x7869('0x17')],_0x763509);_0x424448(_0xb6f930[_0x7869('0x14')](0x1f4,_0x939329['message']));});});}; \ No newline at end of file +var _0x9f4f=['defaults','socket.io-emitter','register','request','then','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','debug','update','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0x9f4f,0x188));var _0xf9f4=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x9f4f[_0x3aaf0a];return _0x33e6bc;};'use strict';var _=require(_0xf9f4('0x0'));var util=require(_0xf9f4('0x1'));var moment=require(_0xf9f4('0x2'));var BPromise=require(_0xf9f4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9f4('0x4'));var db=require(_0xf9f4('0x5'))['db'];var utils=require(_0xf9f4('0x6'));var logger=require(_0xf9f4('0x7'))(_0xf9f4('0x8'));var config=require(_0xf9f4('0x9'));var jayson=require(_0xf9f4('0xa'));var client=jayson['client'][_0xf9f4('0xb')]({'port':0x232a});config[_0xf9f4('0xc')]=_[_0xf9f4('0xd')](config[_0xf9f4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf9f4('0xe'))(new Redis(config[_0xf9f4('0xc')]));require('./voiceQueueReport.socket')[_0xf9f4('0xf')](socket);function respondWithRpcPromise(_0x48e627,_0x5f49e9,_0x572581){return new BPromise(function(_0x30a1ff,_0x399f96){return client[_0xf9f4('0x10')](_0x48e627,_0x572581)[_0xf9f4('0x11')](function(_0x1b255d){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x5f49e9,_0xf9f4('0x12'));logger['debug'](_0xf9f4('0x13'),_0x5f49e9,_0xf9f4('0x12'),JSON[_0xf9f4('0x14')](_0x1b255d));if(_0x1b255d[_0xf9f4('0x15')]){if(_0x1b255d[_0xf9f4('0x15')][_0xf9f4('0x16')]===0x1f4){logger[_0xf9f4('0x15')](_0xf9f4('0x17'),_0x5f49e9,_0x1b255d[_0xf9f4('0x15')][_0xf9f4('0x18')]);return _0x399f96(_0x1b255d['error'][_0xf9f4('0x18')]);}logger[_0xf9f4('0x15')](_0xf9f4('0x17'),_0x5f49e9,_0x1b255d[_0xf9f4('0x15')][_0xf9f4('0x18')]);return _0x30a1ff(_0x1b255d[_0xf9f4('0x15')]['message']);}else{logger[_0xf9f4('0x19')](_0xf9f4('0x17'),_0x5f49e9,'request\x20sent');_0x30a1ff(_0x1b255d[_0xf9f4('0x1a')][_0xf9f4('0x18')]);}})[_0xf9f4('0x1b')](function(_0x343542){logger['error'](_0xf9f4('0x17'),_0x5f49e9,_0x343542);_0x399f96(_0x343542);});});}exports[_0xf9f4('0x1c')]=function(_0xa54e03){var _0x505c09=this;return new Promise(function(_0xfd99f,_0x2e6545){return db[_0xf9f4('0x1d')][_0xf9f4('0x1e')]({'raw':_0xa54e03[_0xf9f4('0x1f')]?_0xa54e03[_0xf9f4('0x1f')][_0xf9f4('0x20')]===undefined?!![]:![]:!![],'where':_0xa54e03[_0xf9f4('0x1f')]?_0xa54e03[_0xf9f4('0x1f')][_0xf9f4('0x21')]||null:null,'attributes':_0xa54e03[_0xf9f4('0x1f')]?_0xa54e03[_0xf9f4('0x1f')][_0xf9f4('0x22')]||null:null,'limit':_0xa54e03[_0xf9f4('0x1f')]?_0xa54e03['options'][_0xf9f4('0x23')]||null:null,'include':_0xa54e03[_0xf9f4('0x1f')]?_0xa54e03[_0xf9f4('0x1f')][_0xf9f4('0x24')]?_[_0xf9f4('0x25')](_0xa54e03[_0xf9f4('0x1f')]['include'],function(_0x5e49c8){return{'model':db[_0x5e49c8[_0xf9f4('0x26')]],'as':_0x5e49c8['as'],'attributes':_0x5e49c8[_0xf9f4('0x22')],'include':_0x5e49c8['include']?_['map'](_0x5e49c8['include'],function(_0x32a150){return{'model':db[_0x32a150[_0xf9f4('0x26')]],'as':_0x32a150['as'],'attributes':_0x32a150[_0xf9f4('0x22')],'include':_0x32a150[_0xf9f4('0x24')]?_['map'](_0x32a150[_0xf9f4('0x24')],function(_0x38ed06){return{'model':db[_0x38ed06['model']],'as':_0x38ed06['as'],'attributes':_0x38ed06[_0xf9f4('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf9f4('0x11')](function(_0x330bdc){logger[_0xf9f4('0x19')](_0xf9f4('0x1c'),_0xa54e03);logger['debug'](_0xf9f4('0x1c'),_0xa54e03,JSON[_0xf9f4('0x14')](_0x330bdc));_0xfd99f(_0x330bdc);})[_0xf9f4('0x1b')](function(_0x2ded82){logger[_0xf9f4('0x15')](_0xf9f4('0x1c'),_0x2ded82['message'],_0xa54e03);_0x2e6545(_0x505c09[_0xf9f4('0x15')](0x1f4,_0x2ded82[_0xf9f4('0x18')]));});});};exports[_0xf9f4('0x27')]=function(_0x182f01){var _0xa54b90=this;return new Promise(function(_0x355332,_0x50abfc){return db[_0xf9f4('0x1d')][_0xf9f4('0x28')](_0x182f01['body'],{'raw':_0x182f01[_0xf9f4('0x1f')]?_0x182f01[_0xf9f4('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xf9f4('0x11')](function(_0x42ce8d){logger[_0xf9f4('0x19')](_0xf9f4('0x27'),_0x182f01);logger[_0xf9f4('0x29')](_0xf9f4('0x27'),_0x182f01,JSON[_0xf9f4('0x14')](_0x42ce8d));_0x355332(_0x42ce8d);})['catch'](function(_0x2050e7){logger[_0xf9f4('0x15')](_0xf9f4('0x27'),_0x2050e7[_0xf9f4('0x18')],_0x182f01);_0x50abfc(_0xa54b90[_0xf9f4('0x15')](0x1f4,_0x2050e7[_0xf9f4('0x18')]));});});};exports['UpdateVoiceQueueReport']=function(_0xd33153){var _0xcee2c9=this;return new Promise(function(_0x407457,_0x1e756e){return db[_0xf9f4('0x1d')][_0xf9f4('0x2a')](_0xd33153[_0xf9f4('0x2b')],{'raw':_0xd33153[_0xf9f4('0x1f')]?_0xd33153[_0xf9f4('0x1f')][_0xf9f4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd33153[_0xf9f4('0x1f')]?_0xd33153['options'][_0xf9f4('0x21')]||null:null,'attributes':_0xd33153[_0xf9f4('0x1f')]?_0xd33153[_0xf9f4('0x1f')][_0xf9f4('0x22')]||null:null,'limit':_0xd33153['options']?_0xd33153['options'][_0xf9f4('0x23')]||null:null})['then'](function(_0x5b3324){logger[_0xf9f4('0x19')](_0xf9f4('0x2c'),_0xd33153);logger[_0xf9f4('0x29')]('UpdateVoiceQueueReport',_0xd33153,JSON[_0xf9f4('0x14')](_0x5b3324));_0x407457(_0x5b3324);})[_0xf9f4('0x1b')](function(_0x1fea4c){logger[_0xf9f4('0x15')]('UpdateVoiceQueueReport',_0x1fea4c[_0xf9f4('0x18')],_0xd33153);_0x1e756e(_0xcee2c9['error'](0x1f4,_0x1fea4c[_0xf9f4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index f2eac43..fef59cd 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 _0x6726=['length','voiceQueueReport:','save','remove','emit','removeListener','register'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x6726,0xdb));var _0x6672=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x6726[_0x238671];return _0x474844;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x6672('0x0'),_0x6672('0x1'),'update'];function createListener(_0x3a0005,_0xaa1168){return function(_0x5cdb03){_0xaa1168[_0x6672('0x2')](_0x3a0005,_0x5cdb03);};}function removeListener(_0x5bf86c,_0x32e5c6){return function(){VoiceQueueReportEvents[_0x6672('0x3')](_0x5bf86c,_0x32e5c6);};}exports[_0x6672('0x4')]=function(_0x40ba7e){for(var _0x5701b9=0x0,_0xa1d3b7=events[_0x6672('0x5')];_0x5701b9<_0xa1d3b7;_0x5701b9++){var _0x263321=events[_0x5701b9];var _0x379b90=createListener(_0x6672('0x6')+_0x263321,_0x40ba7e);VoiceQueueReportEvents['on'](_0x263321,_0x379b90);}}; \ No newline at end of file +var _0x7c8e=['update','emit','removeListener','register','length','voiceQueueReport:','save','remove'];(function(_0x1e5aad,_0x106c1d){var _0x1165b0=function(_0x1f9076){while(--_0x1f9076){_0x1e5aad['push'](_0x1e5aad['shift']());}};_0x1165b0(++_0x106c1d);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x26546a,_0x809188){_0x26546a=_0x26546a-0x0;var _0x5689d8=_0x7c8e[_0x26546a];return _0x5689d8;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xe7c8('0x0'),_0xe7c8('0x1'),_0xe7c8('0x2')];function createListener(_0xf1177c,_0x162bac){return function(_0x2770a6){_0x162bac[_0xe7c8('0x3')](_0xf1177c,_0x2770a6);};}function removeListener(_0x2d314f,_0x192024){return function(){VoiceQueueReportEvents[_0xe7c8('0x4')](_0x2d314f,_0x192024);};}exports[_0xe7c8('0x5')]=function(_0x1f0a65){for(var _0x293383=0x0,_0x2d2940=events[_0xe7c8('0x6')];_0x293383<_0x2d2940;_0x293383++){var _0x3d3f66=events[_0x293383];var _0x5261da=createListener(_0xe7c8('0x7')+_0x3d3f66,_0x1f0a65);VoiceQueueReportEvents['on'](_0x3d3f66,_0x5261da);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 14c825a..3c59032 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 _0x929a=['fs-extra','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','destroy','multer','util','path','connect-timeout','Router'];(function(_0x16ce97,_0x8bce77){var _0x35f2f0=function(_0x552ce0){while(--_0x552ce0){_0x16ce97['push'](_0x16ce97['shift']());}};_0x35f2f0(++_0x8bce77);}(_0x929a,0xf2));var _0xa929=function(_0x5a9e8f,_0x446a2f){_0x5a9e8f=_0x5a9e8f-0x0;var _0xf17096=_0x929a[_0x5a9e8f];return _0xf17096;};'use strict';var multer=require(_0xa929('0x0'));var util=require(_0xa929('0x1'));var path=require(_0xa929('0x2'));var timeout=require(_0xa929('0x3'));var express=require('express');var router=express[_0xa929('0x4')]();var fs_extra=require(_0xa929('0x5'));var auth=require(_0xa929('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa929('0x7'));var controller=require(_0xa929('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xa929('0x9')]);router[_0xa929('0xa')](_0xa929('0xb'),auth[_0xa929('0xc')](),controller[_0xa929('0xd')]);router[_0xa929('0xe')]('/',auth[_0xa929('0xc')](),controller[_0xa929('0xf')]);router[_0xa929('0x10')]('/:id',auth[_0xa929('0xc')](),controller[_0xa929('0x11')]);router['delete']('/:id',auth[_0xa929('0xc')](),controller[_0xa929('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc999=['util','path','connect-timeout','../../components/interaction/service','./voiceQueuesLog.controller','isAuthenticated','index','get','show','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x5da0d9,_0x49ee54){var _0x4b6d2f=function(_0x9832cf){while(--_0x9832cf){_0x5da0d9['push'](_0x5da0d9['shift']());}};_0x4b6d2f(++_0x49ee54);}(_0xc999,0x176));var _0x9c99=function(_0x22663b,_0xc8c6e3){_0x22663b=_0x22663b-0x0;var _0x310d0a=_0xc999[_0x22663b];return _0x310d0a;};'use strict';var multer=require('multer');var util=require(_0x9c99('0x0'));var path=require(_0x9c99('0x1'));var timeout=require(_0x9c99('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9c99('0x3'));var config=require('../../config/environment');var controller=require(_0x9c99('0x4'));router['get']('/',auth[_0x9c99('0x5')](),controller[_0x9c99('0x6')]);router[_0x9c99('0x7')]('/:id',auth[_0x9c99('0x5')](),controller[_0x9c99('0x8')]);router[_0x9c99('0x9')]('/',auth[_0x9c99('0x5')](),controller[_0x9c99('0xa')]);router[_0x9c99('0xb')]('/:id',auth[_0x9c99('0x5')](),controller[_0x9c99('0xc')]);router[_0x9c99('0xd')](_0x9c99('0xe'),auth['isAuthenticated'](),controller[_0x9c99('0xf')]);module[_0x9c99('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index b98efd2..3822f6b 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 _0xc17b=['STRING','DATE','sequelize','moment','exports'];(function(_0x20dc91,_0x4e576b){var _0x1f5b8f=function(_0xed4326){while(--_0xed4326){_0x20dc91['push'](_0x20dc91['shift']());}};_0x1f5b8f(++_0x4e576b);}(_0xc17b,0xa2));var _0xbc17=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc17b[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0xbc17('0x0'));var moment=require(_0xbc17('0x1'));module[_0xbc17('0x2')]={'time':{'type':Sequelize[_0xbc17('0x3')]},'callid':{'type':Sequelize[_0xbc17('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xbc17('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xbc17('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xbc17('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xbc17('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xbc17('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xbc17('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xbc17('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xbc17('0x4')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0xfdb3=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment'];(function(_0x1b3cfc,_0x22a4ec){var _0x627e30=function(_0x17c539){while(--_0x17c539){_0x1b3cfc['push'](_0x1b3cfc['shift']());}};_0x627e30(++_0x22a4ec);}(_0xfdb3,0x10c));var _0x3fdb=function(_0x3e9597,_0x269c7e){_0x3e9597=_0x3e9597-0x0;var _0x508b1e=_0xfdb3[_0x3e9597];return _0x508b1e;};'use strict';var Sequelize=require(_0x3fdb('0x0'));var moment=require(_0x3fdb('0x1'));module['exports']={'time':{'type':Sequelize[_0x3fdb('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x3fdb('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x3fdb('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x3fdb('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x3fdb('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x3fdb('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x3fdb('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x3fdb('0x3')],'allowNull':![],'defaultValue':moment()[_0x3fdb('0x4')](_0x3fdb('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index c68a78a..a9ed1f8 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 _0xf4e8=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','VoiceQueuesLog','find','body','update','eml-format','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x18f629,_0x4f9f23){var _0x6c4d72=function(_0x334a95){while(--_0x334a95){_0x18f629['push'](_0x18f629['shift']());}};_0x6c4d72(++_0x4f9f23);}(_0xf4e8,0x79));var _0x8f4e=function(_0x452144,_0x170931){_0x452144=_0x452144-0x0;var _0x37f223=_0xf4e8[_0x452144];return _0x37f223;};'use strict';var emlformat=require(_0x8f4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8f4e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8f4e('0x2'));var Mustache=require(_0x8f4e('0x3'));var util=require(_0x8f4e('0x4'));var path=require('path');var sox=require(_0x8f4e('0x5'));var csv=require(_0x8f4e('0x6'));var ejs=require(_0x8f4e('0x7'));var fs=require('fs');var fs_extra=require(_0x8f4e('0x8'));var _=require(_0x8f4e('0x9'));var squel=require(_0x8f4e('0xa'));var crypto=require(_0x8f4e('0xb'));var jsforce=require(_0x8f4e('0xc'));var deskjs=require(_0x8f4e('0xd'));var toCsv=require(_0x8f4e('0x6'));var querystring=require('querystring');var Papa=require(_0x8f4e('0xe'));var Redis=require(_0x8f4e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8f4e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f4e('0x11'))(_0x8f4e('0x12'));var utils=require(_0x8f4e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8f4e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x342796,_0x445d5c){_0x445d5c=_0x445d5c||0xcc;return function(_0x26d9a7){if(_0x26d9a7){return _0x342796[_0x8f4e('0x15')](_0x445d5c);}return _0x342796[_0x8f4e('0x16')](_0x445d5c)[_0x8f4e('0x17')]();};}function respondWithResult(_0xd261b4,_0x4a3fa6){_0x4a3fa6=_0x4a3fa6||0xc8;return function(_0x5c6e60){if(_0x5c6e60){return _0xd261b4['status'](_0x4a3fa6)[_0x8f4e('0x18')](_0x5c6e60);}};}function respondWithFilteredResult(_0x42d30b,_0x49a5d4){return function(_0x1816b9){if(_0x1816b9){var _0x116b18=typeof _0x49a5d4['offset']===_0x8f4e('0x19')&&typeof _0x49a5d4[_0x8f4e('0x1a')]===_0x8f4e('0x19');var _0x16b1a8=_0x1816b9[_0x8f4e('0x1b')];var _0xde8e38=_0x116b18?0x0:_0x49a5d4[_0x8f4e('0x1c')];var _0x2c5441=_0x116b18?_0x1816b9[_0x8f4e('0x1b')]:_0x49a5d4['offset']+_0x49a5d4[_0x8f4e('0x1a')];var _0x2f2661;if(_0x2c5441>=_0x16b1a8){_0x2c5441=_0x16b1a8;_0x2f2661=0xc8;}else{_0x2f2661=0xce;}_0x42d30b[_0x8f4e('0x16')](_0x2f2661);return _0x42d30b[_0x8f4e('0x1d')](_0x8f4e('0x1e'),_0xde8e38+'-'+_0x2c5441+'/'+_0x16b1a8)['json'](_0x1816b9);}return null;};}function patchUpdates(_0x35b105){return function(_0x310c77){try{jsonpatch[_0x8f4e('0x1f')](_0x310c77,_0x35b105,!![]);}catch(_0x24c2f3){return BPromise[_0x8f4e('0x20')](_0x24c2f3);}return _0x310c77[_0x8f4e('0x21')]();};}function saveUpdates(_0x352504,_0x1c8af0){return function(_0x343abd){if(_0x343abd){return _0x343abd['update'](_0x352504)['then'](function(_0x47bb3d){return _0x47bb3d;});}return null;};}function removeEntity(_0x28283f,_0x437445){return function(_0x538654){if(_0x538654){return _0x538654['destroy']()[_0x8f4e('0x22')](function(){_0x28283f[_0x8f4e('0x16')](0xcc)[_0x8f4e('0x17')]();});}};}function handleEntityNotFound(_0xac2454,_0x18f79b){return function(_0x2b2e59){if(!_0x2b2e59){_0xac2454[_0x8f4e('0x15')](0x194);}return _0x2b2e59;};}function handleError(_0xde4e59,_0x4d343b){_0x4d343b=_0x4d343b||0x1f4;return function(_0x552d5d){logger[_0x8f4e('0x23')](_0x552d5d[_0x8f4e('0x24')]);if(_0x552d5d[_0x8f4e('0x25')]){delete _0x552d5d[_0x8f4e('0x25')];}_0xde4e59[_0x8f4e('0x16')](_0x4d343b)[_0x8f4e('0x26')](_0x552d5d);};}exports[_0x8f4e('0x27')]=function(_0x531416,_0xc831d7){var _0x41389f={},_0x382862={},_0x2c667f={'count':0x0,'rows':[]};var _0x4fdd01=_[_0x8f4e('0x28')](db['VoiceQueuesLog'][_0x8f4e('0x29')],function(_0x84ed8f){return{'name':_0x84ed8f[_0x8f4e('0x2a')],'type':_0x84ed8f[_0x8f4e('0x2b')]['key']};});_0x382862[_0x8f4e('0x2c')]=_[_0x8f4e('0x28')](_0x4fdd01,_0x8f4e('0x25'));_0x382862[_0x8f4e('0x2d')]=_['keys'](_0x531416[_0x8f4e('0x2d')]);_0x382862[_0x8f4e('0x2e')]=_['intersection'](_0x382862[_0x8f4e('0x2c')],_0x382862[_0x8f4e('0x2d')]);_0x41389f[_0x8f4e('0x2f')]=_[_0x8f4e('0x30')](_0x382862['model'],qs[_0x8f4e('0x31')](_0x531416[_0x8f4e('0x2d')][_0x8f4e('0x31')]));_0x41389f['attributes']=_0x41389f[_0x8f4e('0x2f')][_0x8f4e('0x32')]?_0x41389f[_0x8f4e('0x2f')]:_0x382862[_0x8f4e('0x2c')];if(!_0x531416[_0x8f4e('0x2d')][_0x8f4e('0x33')]('nolimit')){_0x41389f[_0x8f4e('0x1a')]=qs['limit'](_0x531416['query'][_0x8f4e('0x1a')]);_0x41389f['offset']=qs[_0x8f4e('0x1c')](_0x531416[_0x8f4e('0x2d')][_0x8f4e('0x1c')]);}_0x41389f[_0x8f4e('0x34')]=qs[_0x8f4e('0x35')](_0x531416['query'][_0x8f4e('0x35')]);_0x41389f[_0x8f4e('0x36')]=qs[_0x8f4e('0x2e')](_[_0x8f4e('0x37')](_0x531416[_0x8f4e('0x2d')],_0x382862[_0x8f4e('0x2e')]),_0x4fdd01);if(_0x531416['query']['filter']){_0x41389f[_0x8f4e('0x36')]=_[_0x8f4e('0x38')](_0x41389f['where'],{'$or':_[_0x8f4e('0x28')](_0x4fdd01,function(_0x436822){if(_0x436822[_0x8f4e('0x2b')]!=='VIRTUAL'){var _0x3c6397={};_0x3c6397[_0x436822['name']]={'$like':'%'+_0x531416['query'][_0x8f4e('0x39')]+'%'};return _0x3c6397;}})});}_0x41389f=_[_0x8f4e('0x38')]({},_0x41389f,_0x531416[_0x8f4e('0x3a')]);var _0x3ec00c={'where':_0x41389f[_0x8f4e('0x36')]};return db['VoiceQueuesLog']['count'](_0x3ec00c)[_0x8f4e('0x22')](function(_0x5686e1){_0x2c667f[_0x8f4e('0x1b')]=_0x5686e1;if(_0x531416[_0x8f4e('0x2d')][_0x8f4e('0x3b')]){_0x41389f[_0x8f4e('0x3c')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x8f4e('0x3d')](_0x41389f);})[_0x8f4e('0x22')](function(_0x5260df){_0x2c667f[_0x8f4e('0x3e')]=_0x5260df;return _0x2c667f;})['then'](respondWithFilteredResult(_0xc831d7,_0x41389f))[_0x8f4e('0x3f')](handleError(_0xc831d7,null));};exports[_0x8f4e('0x40')]=function(_0x297894,_0x4a4dd3){var _0x107f69={'raw':!![],'where':{'id':_0x297894[_0x8f4e('0x41')]['id']}},_0x52bae0={};_0x52bae0[_0x8f4e('0x2c')]=_[_0x8f4e('0x42')](db[_0x8f4e('0x43')][_0x8f4e('0x29')]);_0x52bae0['query']=_[_0x8f4e('0x42')](_0x297894[_0x8f4e('0x2d')]);_0x52bae0['filters']=_[_0x8f4e('0x30')](_0x52bae0['model'],_0x52bae0[_0x8f4e('0x2d')]);_0x107f69[_0x8f4e('0x2f')]=_['intersection'](_0x52bae0[_0x8f4e('0x2c')],qs[_0x8f4e('0x31')](_0x297894[_0x8f4e('0x2d')][_0x8f4e('0x31')]));_0x107f69[_0x8f4e('0x2f')]=_0x107f69['attributes'][_0x8f4e('0x32')]?_0x107f69[_0x8f4e('0x2f')]:_0x52bae0['model'];if(_0x297894[_0x8f4e('0x2d')][_0x8f4e('0x3b')]){_0x107f69[_0x8f4e('0x3c')]=[{'all':!![]}];}_0x107f69=_[_0x8f4e('0x38')]({},_0x107f69,_0x297894['options']);return db[_0x8f4e('0x43')][_0x8f4e('0x44')](_0x107f69)['then'](handleEntityNotFound(_0x4a4dd3,null))[_0x8f4e('0x22')](respondWithResult(_0x4a4dd3,null))[_0x8f4e('0x3f')](handleError(_0x4a4dd3,null));};exports['create']=function(_0x2d5844,_0xbe2de6){return db[_0x8f4e('0x43')]['create'](_0x2d5844[_0x8f4e('0x45')],{})[_0x8f4e('0x22')](respondWithResult(_0xbe2de6,0xc9))[_0x8f4e('0x3f')](handleError(_0xbe2de6,null));};exports[_0x8f4e('0x46')]=function(_0x253a8f,_0x13ee46){if(_0x253a8f[_0x8f4e('0x45')]['id']){delete _0x253a8f['body']['id'];}return db[_0x8f4e('0x43')][_0x8f4e('0x44')]({'where':{'id':_0x253a8f['params']['id']}})[_0x8f4e('0x22')](handleEntityNotFound(_0x13ee46,null))[_0x8f4e('0x22')](saveUpdates(_0x253a8f[_0x8f4e('0x45')],null))['then'](respondWithResult(_0x13ee46,null))[_0x8f4e('0x3f')](handleError(_0x13ee46,null));};exports['destroy']=function(_0x17ed2,_0x55cf68){return db[_0x8f4e('0x43')][_0x8f4e('0x44')]({'where':{'id':_0x17ed2[_0x8f4e('0x41')]['id']}})[_0x8f4e('0x22')](handleEntityNotFound(_0x55cf68,null))['then'](removeEntity(_0x55cf68,null))[_0x8f4e('0x3f')](handleError(_0x55cf68,null));}; \ No newline at end of file +var _0x1d75=['undefined','count','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset'];(function(_0x5e1d21,_0x59bb31){var _0x71afd7=function(_0x2d3aa2){while(--_0x2d3aa2){_0x5e1d21['push'](_0x5e1d21['shift']());}};_0x71afd7(++_0x59bb31);}(_0x1d75,0xbb));var _0x51d7=function(_0x2e7af0,_0x26eda0){_0x2e7af0=_0x2e7af0-0x0;var _0x3d59df=_0x1d75[_0x2e7af0];return _0x3d59df;};'use strict';var emlformat=require(_0x51d7('0x0'));var rimraf=require(_0x51d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51d7('0x2'));var rp=require(_0x51d7('0x3'));var moment=require(_0x51d7('0x4'));var BPromise=require(_0x51d7('0x5'));var Mustache=require(_0x51d7('0x6'));var util=require('util');var path=require(_0x51d7('0x7'));var sox=require(_0x51d7('0x8'));var csv=require(_0x51d7('0x9'));var ejs=require(_0x51d7('0xa'));var fs=require('fs');var fs_extra=require(_0x51d7('0xb'));var _=require(_0x51d7('0xc'));var squel=require(_0x51d7('0xd'));var crypto=require(_0x51d7('0xe'));var jsforce=require(_0x51d7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x51d7('0x9'));var querystring=require('querystring');var Papa=require(_0x51d7('0x10'));var Redis=require('ioredis');var authService=require(_0x51d7('0x11'));var qs=require(_0x51d7('0x12'));var as=require(_0x51d7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x51d7('0x14'))(_0x51d7('0x15'));var utils=require(_0x51d7('0x16'));var config=require(_0x51d7('0x17'));var licenseUtil=require(_0x51d7('0x18'));var db=require(_0x51d7('0x19'))['db'];function respondWithStatusCode(_0x13fbb9,_0x991ce6){_0x991ce6=_0x991ce6||0xcc;return function(_0x5508ba){if(_0x5508ba){return _0x13fbb9['sendStatus'](_0x991ce6);}return _0x13fbb9[_0x51d7('0x1a')](_0x991ce6)['end']();};}function respondWithResult(_0xc1f292,_0x44ccdd){_0x44ccdd=_0x44ccdd||0xc8;return function(_0x56c13a){if(_0x56c13a){return _0xc1f292['status'](_0x44ccdd)[_0x51d7('0x1b')](_0x56c13a);}};}function respondWithFilteredResult(_0x298d42,_0x7f77f1){return function(_0x5bbee9){if(_0x5bbee9){var _0x219007=typeof _0x7f77f1[_0x51d7('0x1c')]==='undefined'&&typeof _0x7f77f1['limit']===_0x51d7('0x1d');var _0x44df9a=_0x5bbee9['count'];var _0x15cf52=_0x219007?0x0:_0x7f77f1['offset'];var _0x3d22f0=_0x219007?_0x5bbee9[_0x51d7('0x1e')]:_0x7f77f1[_0x51d7('0x1c')]+_0x7f77f1['limit'];var _0x109ced;if(_0x3d22f0>=_0x44df9a){_0x3d22f0=_0x44df9a;_0x109ced=0xc8;}else{_0x109ced=0xce;}_0x298d42[_0x51d7('0x1a')](_0x109ced);return _0x298d42['set']('Content-Range',_0x15cf52+'-'+_0x3d22f0+'/'+_0x44df9a)['json'](_0x5bbee9);}return null;};}function patchUpdates(_0x3da160){return function(_0x47ea9b){try{jsonpatch[_0x51d7('0x1f')](_0x47ea9b,_0x3da160,!![]);}catch(_0x40dee0){return BPromise[_0x51d7('0x20')](_0x40dee0);}return _0x47ea9b[_0x51d7('0x21')]();};}function saveUpdates(_0x373520,_0x38e3b4){return function(_0x59d3ec){if(_0x59d3ec){return _0x59d3ec[_0x51d7('0x22')](_0x373520)[_0x51d7('0x23')](function(_0x2e6bdb){return _0x2e6bdb;});}return null;};}function removeEntity(_0x10f18e,_0x409497){return function(_0x596592){if(_0x596592){return _0x596592[_0x51d7('0x24')]()[_0x51d7('0x23')](function(){_0x10f18e[_0x51d7('0x1a')](0xcc)[_0x51d7('0x25')]();});}};}function handleEntityNotFound(_0x2885a1,_0x50d543){return function(_0x35dc07){if(!_0x35dc07){_0x2885a1[_0x51d7('0x26')](0x194);}return _0x35dc07;};}function handleError(_0x34d533,_0x1d0e0e){_0x1d0e0e=_0x1d0e0e||0x1f4;return function(_0xb71ed5){logger['error'](_0xb71ed5[_0x51d7('0x27')]);if(_0xb71ed5[_0x51d7('0x28')]){delete _0xb71ed5['name'];}_0x34d533[_0x51d7('0x1a')](_0x1d0e0e)['send'](_0xb71ed5);};}exports['index']=function(_0x1e717b,_0x26d294){var _0x19ba6c={},_0x497f1c={},_0xacfc6f={'count':0x0,'rows':[]};var _0x25b851=_[_0x51d7('0x29')](db[_0x51d7('0x2a')][_0x51d7('0x2b')],function(_0x5e7535){return{'name':_0x5e7535[_0x51d7('0x2c')],'type':_0x5e7535[_0x51d7('0x2d')]['key']};});_0x497f1c[_0x51d7('0x2e')]=_[_0x51d7('0x29')](_0x25b851,_0x51d7('0x28'));_0x497f1c[_0x51d7('0x2f')]=_[_0x51d7('0x30')](_0x1e717b['query']);_0x497f1c[_0x51d7('0x31')]=_[_0x51d7('0x32')](_0x497f1c[_0x51d7('0x2e')],_0x497f1c[_0x51d7('0x2f')]);_0x19ba6c[_0x51d7('0x33')]=_[_0x51d7('0x32')](_0x497f1c[_0x51d7('0x2e')],qs[_0x51d7('0x34')](_0x1e717b[_0x51d7('0x2f')]['fields']));_0x19ba6c[_0x51d7('0x33')]=_0x19ba6c[_0x51d7('0x33')][_0x51d7('0x35')]?_0x19ba6c[_0x51d7('0x33')]:_0x497f1c[_0x51d7('0x2e')];if(!_0x1e717b[_0x51d7('0x2f')]['hasOwnProperty'](_0x51d7('0x36'))){_0x19ba6c[_0x51d7('0x37')]=qs['limit'](_0x1e717b[_0x51d7('0x2f')][_0x51d7('0x37')]);_0x19ba6c[_0x51d7('0x1c')]=qs[_0x51d7('0x1c')](_0x1e717b[_0x51d7('0x2f')]['offset']);}_0x19ba6c[_0x51d7('0x38')]=qs[_0x51d7('0x39')](_0x1e717b[_0x51d7('0x2f')]['sort']);_0x19ba6c[_0x51d7('0x3a')]=qs[_0x51d7('0x31')](_[_0x51d7('0x3b')](_0x1e717b[_0x51d7('0x2f')],_0x497f1c[_0x51d7('0x31')]),_0x25b851);if(_0x1e717b[_0x51d7('0x2f')]['filter']){_0x19ba6c['where']=_['merge'](_0x19ba6c[_0x51d7('0x3a')],{'$or':_[_0x51d7('0x29')](_0x25b851,function(_0x396d8f){if(_0x396d8f[_0x51d7('0x2d')]!=='VIRTUAL'){var _0x43f81b={};_0x43f81b[_0x396d8f['name']]={'$like':'%'+_0x1e717b[_0x51d7('0x2f')][_0x51d7('0x3c')]+'%'};return _0x43f81b;}})});}_0x19ba6c=_[_0x51d7('0x3d')]({},_0x19ba6c,_0x1e717b[_0x51d7('0x3e')]);var _0x4d22da={'where':_0x19ba6c[_0x51d7('0x3a')]};return db[_0x51d7('0x2a')]['count'](_0x4d22da)['then'](function(_0x15dcb2){_0xacfc6f[_0x51d7('0x1e')]=_0x15dcb2;if(_0x1e717b[_0x51d7('0x2f')][_0x51d7('0x3f')]){_0x19ba6c[_0x51d7('0x40')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x51d7('0x41')](_0x19ba6c);})['then'](function(_0x83bd9){_0xacfc6f['rows']=_0x83bd9;return _0xacfc6f;})[_0x51d7('0x23')](respondWithFilteredResult(_0x26d294,_0x19ba6c))[_0x51d7('0x42')](handleError(_0x26d294,null));};exports[_0x51d7('0x43')]=function(_0x582018,_0x168263){var _0x1f166b={'raw':!![],'where':{'id':_0x582018['params']['id']}},_0x40a0ff={};_0x40a0ff['model']=_[_0x51d7('0x30')](db[_0x51d7('0x2a')][_0x51d7('0x2b')]);_0x40a0ff[_0x51d7('0x2f')]=_[_0x51d7('0x30')](_0x582018['query']);_0x40a0ff['filters']=_[_0x51d7('0x32')](_0x40a0ff[_0x51d7('0x2e')],_0x40a0ff['query']);_0x1f166b['attributes']=_[_0x51d7('0x32')](_0x40a0ff[_0x51d7('0x2e')],qs['fields'](_0x582018[_0x51d7('0x2f')][_0x51d7('0x34')]));_0x1f166b[_0x51d7('0x33')]=_0x1f166b['attributes'][_0x51d7('0x35')]?_0x1f166b[_0x51d7('0x33')]:_0x40a0ff[_0x51d7('0x2e')];if(_0x582018[_0x51d7('0x2f')][_0x51d7('0x3f')]){_0x1f166b[_0x51d7('0x40')]=[{'all':!![]}];}_0x1f166b=_[_0x51d7('0x3d')]({},_0x1f166b,_0x582018[_0x51d7('0x3e')]);return db[_0x51d7('0x2a')][_0x51d7('0x44')](_0x1f166b)['then'](handleEntityNotFound(_0x168263,null))[_0x51d7('0x23')](respondWithResult(_0x168263,null))[_0x51d7('0x42')](handleError(_0x168263,null));};exports[_0x51d7('0x45')]=function(_0x450228,_0x8d0420){return db[_0x51d7('0x2a')][_0x51d7('0x45')](_0x450228[_0x51d7('0x46')],{})[_0x51d7('0x23')](respondWithResult(_0x8d0420,0xc9))[_0x51d7('0x42')](handleError(_0x8d0420,null));};exports[_0x51d7('0x22')]=function(_0x269de9,_0x2d7d2c){if(_0x269de9[_0x51d7('0x46')]['id']){delete _0x269de9[_0x51d7('0x46')]['id'];}return db['VoiceQueuesLog'][_0x51d7('0x44')]({'where':{'id':_0x269de9[_0x51d7('0x47')]['id']}})[_0x51d7('0x23')](handleEntityNotFound(_0x2d7d2c,null))[_0x51d7('0x23')](saveUpdates(_0x269de9['body'],null))[_0x51d7('0x23')](respondWithResult(_0x2d7d2c,null))[_0x51d7('0x42')](handleError(_0x2d7d2c,null));};exports[_0x51d7('0x24')]=function(_0xf0cc33,_0x464be7){return db[_0x51d7('0x2a')][_0x51d7('0x44')]({'where':{'id':_0xf0cc33[_0x51d7('0x47')]['id']}})['then'](handleEntityNotFound(_0x464be7,null))[_0x51d7('0x23')](removeEntity(_0x464be7,null))['catch'](handleError(_0x464be7,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 610d7f3..b50112c 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 _0xf46d=['util','api','moment','path','rimraf','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event','dtm'];(function(_0x3f6c72,_0x2b5b87){var _0x48c206=function(_0x5f4372){while(--_0x5f4372){_0x3f6c72['push'](_0x3f6c72['shift']());}};_0x48c206(++_0x2b5b87);}(_0xf46d,0x1c3));var _0xdf46=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xf46d[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require(_0xdf46('0x0'));var logger=require('../../config/logger')(_0xdf46('0x1'));var moment=require(_0xdf46('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf46('0x3'));var rimraf=require(_0xdf46('0x4'));var config=require('../../config/environment');var attributes=require(_0xdf46('0x5'));module[_0xdf46('0x6')]=function(_0x24d243,_0x34a96a){return _0x24d243['define'](_0xdf46('0x7'),attributes,{'tableName':_0xdf46('0x8'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xdf46('0x9'),_0xdf46('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x0ef0=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','VoiceQueuesLog','voice_queues_log','event','dtm','util'];(function(_0x37f02e,_0x24e12d){var _0x546b92=function(_0x410325){while(--_0x410325){_0x37f02e['push'](_0x37f02e['shift']());}};_0x546b92(++_0x24e12d);}(_0x0ef0,0x12b));var _0x00ef=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0x0ef0[_0xc5a279];return _0xc755d3;};'use strict';var _=require('lodash');var util=require(_0x00ef('0x0'));var logger=require('../../config/logger')(_0x00ef('0x1'));var moment=require('moment');var BPromise=require(_0x00ef('0x2'));var rp=require(_0x00ef('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x00ef('0x4'));var config=require(_0x00ef('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0x00ef('0x6')]=function(_0x24936a,_0x4ad0ac){return _0x24936a[_0x00ef('0x7')](_0x00ef('0x8'),attributes,{'tableName':_0x00ef('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x00ef('0xa'),_0x00ef('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 3bc6ccf..66abf1a 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 _0x15ab=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15ab,0xda));var _0xb15a=function(_0x29a44e,_0x3a671a){_0x29a44e=_0x29a44e-0x0;var _0x4bb1fd=_0x15ab[_0x29a44e];return _0x4bb1fd;};'use strict';var _=require(_0xb15a('0x0'));var util=require(_0xb15a('0x1'));var moment=require(_0xb15a('0x2'));var BPromise=require(_0xb15a('0x3'));var rs=require(_0xb15a('0x4'));var fs=require('fs');var Redis=require(_0xb15a('0x5'));var db=require(_0xb15a('0x6'))['db'];var utils=require(_0xb15a('0x7'));var logger=require(_0xb15a('0x8'))('rpc');var config=require(_0xb15a('0x9'));var jayson=require(_0xb15a('0xa'));var client=jayson['client'][_0xb15a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5721b3,_0x36ffd3,_0x252810){return new BPromise(function(_0x49e01d,_0x13b313){return client[_0xb15a('0xc')](_0x5721b3,_0x252810)[_0xb15a('0xd')](function(_0x498bb3){logger[_0xb15a('0xe')](_0xb15a('0xf'),_0x36ffd3,_0xb15a('0x10'));logger['debug'](_0xb15a('0x11'),_0x36ffd3,_0xb15a('0x10'),JSON[_0xb15a('0x12')](_0x498bb3));if(_0x498bb3[_0xb15a('0x13')]){if(_0x498bb3[_0xb15a('0x13')][_0xb15a('0x14')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x36ffd3,_0x498bb3['error'][_0xb15a('0x15')]);return _0x13b313(_0x498bb3[_0xb15a('0x13')][_0xb15a('0x15')]);}logger[_0xb15a('0x13')](_0xb15a('0xf'),_0x36ffd3,_0x498bb3['error'][_0xb15a('0x15')]);return _0x49e01d(_0x498bb3[_0xb15a('0x13')][_0xb15a('0x15')]);}else{logger[_0xb15a('0xe')](_0xb15a('0xf'),_0x36ffd3,_0xb15a('0x10'));_0x49e01d(_0x498bb3[_0xb15a('0x16')][_0xb15a('0x15')]);}})[_0xb15a('0x17')](function(_0x115968){logger[_0xb15a('0x13')](_0xb15a('0xf'),_0x36ffd3,_0x115968);_0x13b313(_0x115968);});});} \ No newline at end of file +var _0x3ea0=['message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0x3ea0,0x1bb));var _0x03ea=function(_0x4c7d8b,_0x572388){_0x4c7d8b=_0x4c7d8b-0x0;var _0x187158=_0x3ea0[_0x4c7d8b];return _0x187158;};'use strict';var _=require(_0x03ea('0x0'));var util=require(_0x03ea('0x1'));var moment=require('moment');var BPromise=require(_0x03ea('0x2'));var rs=require(_0x03ea('0x3'));var fs=require('fs');var Redis=require(_0x03ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x03ea('0x5'));var logger=require(_0x03ea('0x6'))(_0x03ea('0x7'));var config=require('../../config/environment');var jayson=require(_0x03ea('0x8'));var client=jayson[_0x03ea('0x9')][_0x03ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ba302,_0x10f541,_0x4aa57c){return new BPromise(function(_0x3b38d3,_0x5d4d72){return client[_0x03ea('0xb')](_0x2ba302,_0x4aa57c)[_0x03ea('0xc')](function(_0x213a43){logger[_0x03ea('0xd')](_0x03ea('0xe'),_0x10f541,_0x03ea('0xf'));logger[_0x03ea('0x10')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x10f541,_0x03ea('0xf'),JSON['stringify'](_0x213a43));if(_0x213a43['error']){if(_0x213a43[_0x03ea('0x11')][_0x03ea('0x12')]===0x1f4){logger[_0x03ea('0x11')](_0x03ea('0xe'),_0x10f541,_0x213a43[_0x03ea('0x11')][_0x03ea('0x13')]);return _0x5d4d72(_0x213a43[_0x03ea('0x11')][_0x03ea('0x13')]);}logger[_0x03ea('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x10f541,_0x213a43[_0x03ea('0x11')][_0x03ea('0x13')]);return _0x3b38d3(_0x213a43['error']['message']);}else{logger[_0x03ea('0xd')](_0x03ea('0xe'),_0x10f541,_0x03ea('0xf'));_0x3b38d3(_0x213a43[_0x03ea('0x14')][_0x03ea('0x13')]);}})['catch'](function(_0x1aebed){logger[_0x03ea('0x11')](_0x03ea('0xe'),_0x10f541,_0x1aebed);_0x5d4d72(_0x1aebed);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index f09929d..35a284b 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 _0xb7dd=['index','describe','/:id','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated'];(function(_0x4826b8,_0x5de1f4){var _0x2c7974=function(_0x1ee2aa){while(--_0x1ee2aa){_0x4826b8['push'](_0x4826b8['shift']());}};_0x2c7974(++_0x5de1f4);}(_0xb7dd,0x139));var _0xdb7d=function(_0x4d4a77,_0x2e03fb){_0x4d4a77=_0x4d4a77-0x0;var _0x2eaf0f=_0xb7dd[_0x4d4a77];return _0x2eaf0f;};'use strict';var multer=require(_0xdb7d('0x0'));var util=require(_0xdb7d('0x1'));var path=require(_0xdb7d('0x2'));var timeout=require(_0xdb7d('0x3'));var express=require(_0xdb7d('0x4'));var router=express['Router']();var fs_extra=require(_0xdb7d('0x5'));var auth=require(_0xdb7d('0x6'));var interaction=require(_0xdb7d('0x7'));var config=require(_0xdb7d('0x8'));var controller=require(_0xdb7d('0x9'));router[_0xdb7d('0xa')]('/',auth[_0xdb7d('0xb')](),controller[_0xdb7d('0xc')]);router[_0xdb7d('0xa')]('/describe',auth[_0xdb7d('0xb')](),controller[_0xdb7d('0xd')]);router[_0xdb7d('0xa')](_0xdb7d('0xe'),auth[_0xdb7d('0xb')](),controller['show']);router['get'](_0xdb7d('0xf'),auth[_0xdb7d('0xb')](),controller[_0xdb7d('0x10')]);router[_0xdb7d('0xa')](_0xdb7d('0x11'),controller[_0xdb7d('0x12')]);router['get'](_0xdb7d('0x13'),auth['isAuthenticated'](),controller[_0xdb7d('0x14')]);router[_0xdb7d('0x15')]('/',auth[_0xdb7d('0xb')](),controller['create']);router[_0xdb7d('0x15')](_0xdb7d('0x13'),auth[_0xdb7d('0xb')](),controller['runTranscribe']);router['put'](_0xdb7d('0xe'),auth['isAuthenticated'](),controller[_0xdb7d('0x16')]);router[_0xdb7d('0x17')](_0xdb7d('0xe'),auth[_0xdb7d('0xb')](),controller[_0xdb7d('0x18')]);module['exports']=router; \ No newline at end of file +var _0xba18=['/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','/:id','delete','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','show','/:id/downloads','downloads'];(function(_0x1a4381,_0x51e7da){var _0x426efc=function(_0x563ffc){while(--_0x563ffc){_0x1a4381['push'](_0x1a4381['shift']());}};_0x426efc(++_0x51e7da);}(_0xba18,0x129));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x8ba1('0x0'));var path=require(_0x8ba1('0x1'));var timeout=require('connect-timeout');var express=require(_0x8ba1('0x2'));var router=express['Router']();var fs_extra=require(_0x8ba1('0x3'));var auth=require(_0x8ba1('0x4'));var interaction=require(_0x8ba1('0x5'));var config=require(_0x8ba1('0x6'));var controller=require(_0x8ba1('0x7'));router[_0x8ba1('0x8')]('/',auth[_0x8ba1('0x9')](),controller['index']);router['get'](_0x8ba1('0xa'),auth['isAuthenticated'](),controller[_0x8ba1('0xb')]);router[_0x8ba1('0x8')]('/:id',auth[_0x8ba1('0x9')](),controller[_0x8ba1('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router['get'](_0x8ba1('0xd'),controller[_0x8ba1('0xe')]);router[_0x8ba1('0x8')](_0x8ba1('0xf'),auth[_0x8ba1('0x9')](),controller[_0x8ba1('0x10')]);router['post']('/',auth[_0x8ba1('0x9')](),controller[_0x8ba1('0x11')]);router[_0x8ba1('0x12')](_0x8ba1('0xf'),auth['isAuthenticated'](),controller[_0x8ba1('0x13')]);router[_0x8ba1('0x14')](_0x8ba1('0x15'),auth[_0x8ba1('0x9')](),controller['update']);router[_0x8ba1('0x16')](_0x8ba1('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0x8ba1('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 87318fa..deb5b0f 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(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 8354851..47a0ebc 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 _0x36b0=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','download','../../components/encryptor','uniqueid','existsSync','decryptFile','secrets','recording','value','Sequelize','ValidationError','filename','unlink','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','col','token','push','$and','%s.cypher','extname','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','createBucket','upload','TranscribeService','startTranscriptionJob','[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','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','findOne','Setting','transcribe','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x295852,_0x900e6a){var _0xf21291=function(_0x1750e1){while(--_0x1750e1){_0x295852['push'](_0x295852['shift']());}};_0xf21291(++_0x900e6a);}(_0x36b0,0x11e));var _0x036b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x36b0[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x036b('0x0'));var rimraf=require(_0x036b('0x1'));var zipdir=require(_0x036b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x036b('0x3'));var moment=require(_0x036b('0x4'));var BPromise=require(_0x036b('0x5'));var Mustache=require(_0x036b('0x6'));var util=require(_0x036b('0x7'));var path=require('path');var sox=require(_0x036b('0x8'));var csv=require(_0x036b('0x9'));var ejs=require(_0x036b('0xa'));var fs=require('fs');var fs_extra=require(_0x036b('0xb'));var _=require(_0x036b('0xc'));var squel=require(_0x036b('0xd'));var crypto=require(_0x036b('0xe'));var jsforce=require(_0x036b('0xf'));var deskjs=require(_0x036b('0x10'));var toCsv=require(_0x036b('0x9'));var querystring=require(_0x036b('0x11'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x036b('0x12'));var authService=require(_0x036b('0x13'));var qs=require(_0x036b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x036b('0x15'))(_0x036b('0x16'));var utils=require(_0x036b('0x17'));var config=require(_0x036b('0x18'));var licenseUtil=require(_0x036b('0x19'));var db=require(_0x036b('0x1a'))['db'];function respondWithStatusCode(_0x5a35bf,_0x3db0c1){_0x3db0c1=_0x3db0c1||0xcc;return function(_0x2bc612){if(_0x2bc612){return _0x5a35bf[_0x036b('0x1b')](_0x3db0c1);}return _0x5a35bf['status'](_0x3db0c1)[_0x036b('0x1c')]();};}function respondWithResult(_0x1c3818,_0x6a061e){_0x6a061e=_0x6a061e||0xc8;return function(_0x305da7){if(_0x305da7){return _0x1c3818[_0x036b('0x1d')](_0x6a061e)[_0x036b('0x1e')](_0x305da7);}};}function respondWithFilteredResult(_0x5022ba,_0x21e9d5){return function(_0x313c6d){if(_0x313c6d){var _0x311d8d=typeof _0x21e9d5[_0x036b('0x1f')]===_0x036b('0x20')&&typeof _0x21e9d5[_0x036b('0x21')]===_0x036b('0x20');var _0x4a6e38=_0x313c6d[_0x036b('0x22')];var _0xb0b191=_0x311d8d?0x0:_0x21e9d5[_0x036b('0x1f')];var _0x4616a8=_0x311d8d?_0x313c6d['count']:_0x21e9d5[_0x036b('0x1f')]+_0x21e9d5[_0x036b('0x21')];var _0x5a936b;if(_0x4616a8>=_0x4a6e38){_0x4616a8=_0x4a6e38;_0x5a936b=0xc8;}else{_0x5a936b=0xce;}_0x5022ba[_0x036b('0x1d')](_0x5a936b);return _0x5022ba['set'](_0x036b('0x23'),_0xb0b191+'-'+_0x4616a8+'/'+_0x4a6e38)[_0x036b('0x1e')](_0x313c6d);}return null;};}function patchUpdates(_0x10111){return function(_0x51bc44){try{jsonpatch[_0x036b('0x24')](_0x51bc44,_0x10111,!![]);}catch(_0x38156b){return BPromise[_0x036b('0x25')](_0x38156b);}return _0x51bc44['save']();};}function saveUpdates(_0x3c22b8,_0x5e3120){return function(_0x591376){if(_0x591376){return _0x591376[_0x036b('0x26')](_0x3c22b8)[_0x036b('0x27')](function(_0xd69420){return _0xd69420;});}return null;};}function removeEntity(_0x2d12ee,_0x2549e6){return function(_0x3d5cb7){if(_0x3d5cb7){return _0x3d5cb7['destroy']()['then'](function(){_0x2d12ee[_0x036b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19f1e0,_0x4ab217){return function(_0x2b092b){if(!_0x2b092b){_0x19f1e0[_0x036b('0x1b')](0x194);}return _0x2b092b;};}function handleError(_0x32ed67,_0x2479bd){_0x2479bd=_0x2479bd||0x1f4;return function(_0x251a29){logger['error'](_0x251a29[_0x036b('0x28')]);if(_0x251a29[_0x036b('0x29')]){delete _0x251a29['name'];}_0x32ed67[_0x036b('0x1d')](_0x2479bd)[_0x036b('0x2a')](_0x251a29);};}exports[_0x036b('0x2b')]=function(_0x318b26,_0x50592c){var _0x103d38={},_0x3d4b48={},_0x100faf={'count':0x0,'rows':[]};var _0x1f7806=_[_0x036b('0x2c')](db[_0x036b('0x2d')][_0x036b('0x2e')],function(_0x4cd91f){return{'name':_0x4cd91f[_0x036b('0x2f')],'type':_0x4cd91f[_0x036b('0x30')][_0x036b('0x31')]};});_0x3d4b48[_0x036b('0x32')]=_[_0x036b('0x33')](_['map'](_0x1f7806,_0x036b('0x29')),[_0x036b('0x34')]);_0x3d4b48[_0x036b('0x35')]=_[_0x036b('0x36')](_0x318b26[_0x036b('0x35')]);_0x3d4b48[_0x036b('0x37')]=_[_0x036b('0x38')](_0x3d4b48['model'],_0x3d4b48[_0x036b('0x35')]);_0x103d38[_0x036b('0x39')]=_['intersection'](_0x3d4b48[_0x036b('0x32')],qs[_0x036b('0x3a')](_0x318b26[_0x036b('0x35')][_0x036b('0x3a')]));_0x103d38[_0x036b('0x39')]=_0x103d38[_0x036b('0x39')]['length']?_0x103d38[_0x036b('0x39')]:_0x3d4b48['model'];if(!_0x318b26[_0x036b('0x35')][_0x036b('0x3b')](_0x036b('0x3c'))){_0x103d38[_0x036b('0x21')]=qs[_0x036b('0x21')](_0x318b26[_0x036b('0x35')][_0x036b('0x21')]);_0x103d38[_0x036b('0x1f')]=qs['offset'](_0x318b26[_0x036b('0x35')][_0x036b('0x1f')]);}_0x103d38[_0x036b('0x3d')]=qs[_0x036b('0x3e')](_0x318b26[_0x036b('0x35')]['sort']);_0x103d38[_0x036b('0x3f')]=qs[_0x036b('0x37')](_[_0x036b('0x40')](_0x318b26[_0x036b('0x35')],_0x3d4b48[_0x036b('0x37')]),_0x1f7806);if(_0x318b26[_0x036b('0x35')][_0x036b('0x41')]){_0x103d38['where']=_[_0x036b('0x42')](_0x103d38[_0x036b('0x3f')],{'$or':_[_0x036b('0x2c')](_0x1f7806,function(_0xfcca35){if(_0xfcca35[_0x036b('0x30')]!==_0x036b('0x43')){var _0x55668f={};_0x55668f[_0xfcca35['name']]={'$like':'%'+_0x318b26[_0x036b('0x35')][_0x036b('0x41')]+'%'};return _0x55668f;}})});}_0x103d38=_[_0x036b('0x42')]({},_0x103d38,_0x318b26[_0x036b('0x44')]);var _0x584779={'where':_0x103d38[_0x036b('0x3f')]};return db[_0x036b('0x2d')][_0x036b('0x22')](_0x584779)['then'](function(_0x2eed50){_0x100faf['count']=_0x2eed50;if(_0x318b26[_0x036b('0x35')][_0x036b('0x45')]){_0x103d38[_0x036b('0x46')]=[{'all':!![]}];}return db[_0x036b('0x2d')][_0x036b('0x47')](_0x103d38);})[_0x036b('0x27')](function(_0x347f01){_0x100faf[_0x036b('0x48')]=_0x347f01;return _0x100faf;})[_0x036b('0x27')](respondWithFilteredResult(_0x50592c,_0x103d38))[_0x036b('0x49')](handleError(_0x50592c,null));};exports[_0x036b('0x4a')]=function(_0x3d02e9,_0x2b975c){var _0x439008={'raw':![],'where':{'id':_0x3d02e9[_0x036b('0x4b')]['id']}},_0x17e7bc={};_0x17e7bc['model']=_[_0x036b('0x36')](db[_0x036b('0x2d')][_0x036b('0x2e')]);_0x17e7bc['query']=_[_0x036b('0x36')](_0x3d02e9[_0x036b('0x35')]);_0x17e7bc['filters']=_[_0x036b('0x38')](_0x17e7bc[_0x036b('0x32')],_0x17e7bc[_0x036b('0x35')]);_0x439008[_0x036b('0x39')]=_[_0x036b('0x38')](_0x17e7bc[_0x036b('0x32')],qs['fields'](_0x3d02e9[_0x036b('0x35')][_0x036b('0x3a')]));_0x439008[_0x036b('0x39')]=_0x439008[_0x036b('0x39')]['length']?_0x439008[_0x036b('0x39')]:_0x17e7bc[_0x036b('0x32')];if(_0x3d02e9['query'][_0x036b('0x45')]){_0x439008[_0x036b('0x46')]=[{'all':!![]}];}_0x439008=_[_0x036b('0x42')]({},_0x439008,_0x3d02e9[_0x036b('0x44')]);return db[_0x036b('0x2d')][_0x036b('0x4c')](_0x439008)['then'](handleEntityNotFound(_0x2b975c,null))['then'](respondWithResult(_0x2b975c,null))['catch'](handleError(_0x2b975c,null));};exports[_0x036b('0x4d')]=function(_0x2d280e,_0x3d58f1){return db[_0x036b('0x2d')][_0x036b('0x4d')](_0x2d280e['body'],{})[_0x036b('0x27')](respondWithResult(_0x3d58f1,0xc9))[_0x036b('0x49')](handleError(_0x3d58f1,null));};exports[_0x036b('0x26')]=function(_0x2d75e5,_0x426627){if(_0x2d75e5[_0x036b('0x4e')]['id']){delete _0x2d75e5[_0x036b('0x4e')]['id'];}return db[_0x036b('0x2d')][_0x036b('0x4c')]({'where':{'id':_0x2d75e5[_0x036b('0x4b')]['id']}})[_0x036b('0x27')](handleEntityNotFound(_0x426627,null))['then'](saveUpdates(_0x2d75e5[_0x036b('0x4e')],null))[_0x036b('0x27')](respondWithResult(_0x426627,null))[_0x036b('0x49')](handleError(_0x426627,null));};exports[_0x036b('0x4f')]=function(_0x4b00c5,_0x163757){return db['VoiceRecording'][_0x036b('0x4f')]()[_0x036b('0x27')](respondWithResult(_0x163757,null))['catch'](handleError(_0x163757,null));};exports[_0x036b('0x50')]=function(_0x1a20d7,_0x31bc65,_0x120a71){var _0xb333c9=require(_0x036b('0x51'));var _0x203c6e=![];var _0x1367e1={};if(_0x1a20d7[_0x036b('0x35')][_0x036b('0x30')]&&_0x1a20d7['query']['type']==='uniqueid'){_0x1367e1[_0x036b('0x52')]=_0x1a20d7[_0x036b('0x4b')]['id'];}else{_0x1367e1['id']=_0x1a20d7[_0x036b('0x4b')]['id'];}return db[_0x036b('0x2d')][_0x036b('0x4c')]({'where':_0x1367e1,'attributes':['id','value'],'raw':!![]})[_0x036b('0x27')](handleEntityNotFound(_0x31bc65,null))[_0x036b('0x27')](function(_0x240fe3){if(_0x240fe3){var _0x574efc=_0x240fe3['value'];var _0x392f54=util[_0x036b('0x34')]('%s.cypher',_0x574efc);if(fs[_0x036b('0x53')](_0x392f54)){_0x203c6e=!![];return _0xb333c9[_0x036b('0x54')](_0x392f54,_0x574efc,config[_0x036b('0x55')][_0x036b('0x56')])[_0x036b('0x27')](function(){return _0x240fe3;});}return _0x240fe3;}})[_0x036b('0x27')](function(_0x312f0e){if(_0x312f0e){var _0x9dc4b5=_0x312f0e[_0x036b('0x57')];if(!fs[_0x036b('0x53')](_0x9dc4b5)){throw new db[(_0x036b('0x58'))][(_0x036b('0x59'))]('VoiceRecording\x20not\x20found');}if(_0x312f0e['filename']){return _0x31bc65[_0x036b('0x50')](_0x9dc4b5,_0x312f0e[_0x036b('0x5a')]+path['extname'](_0x9dc4b5),function(){if(_0x203c6e){fs[_0x036b('0x5b')](_0x9dc4b5);}});}else{return _0x31bc65[_0x036b('0x50')](_0x9dc4b5,function(_0x253471){if(_0x203c6e){fs[_0x036b('0x5b')](_0x9dc4b5);}});}}})[_0x036b('0x49')](function(_0x564016){if(_0x564016['message']===_0x036b('0x5c')){_0x31bc65[_0x036b('0x1d')](0x194)[_0x036b('0x2a')](_0x036b('0x5d'));}else{return handleError(_0x31bc65,null);}});};exports[_0x036b('0x5e')]=function(_0x19eac5,_0x123b93,_0x9cbd7c){var _0x335109=require('../../components/encryptor');var _0x55cf41=![];var _0x30fece={'$and':[db[_0x036b('0x5f')][_0x036b('0x3f')](db[_0x036b('0x5f')]['fn']('MD5',db[_0x036b('0x5f')][_0x036b('0x60')](_0x036b('0x52'))),_0x19eac5[_0x036b('0x35')][_0x036b('0x61')])]};if(_0x19eac5[_0x036b('0x35')][_0x036b('0x30')]&&_0x19eac5[_0x036b('0x35')][_0x036b('0x30')]===_0x036b('0x52')){_0x30fece['$and'][_0x036b('0x62')]({'uniqueid':_0x19eac5[_0x036b('0x4b')]['id']});}else{_0x30fece[_0x036b('0x63')][_0x036b('0x62')]({'id':_0x19eac5[_0x036b('0x4b')]['id']});}return db[_0x036b('0x2d')][_0x036b('0x4c')]({'where':_0x30fece,'attributes':['id',_0x036b('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x123b93,null))[_0x036b('0x27')](function(_0x187e5b){if(_0x187e5b){var _0x5c6b85=util[_0x036b('0x34')](_0x036b('0x64'),_0x187e5b['value']);if(fs[_0x036b('0x53')](_0x5c6b85)){_0x55cf41=!![];return _0x335109[_0x036b('0x54')](_0x5c6b85,_0x187e5b[_0x036b('0x57')],config[_0x036b('0x55')][_0x036b('0x56')])[_0x036b('0x27')](function(){return _0x187e5b;});}return _0x187e5b;}})[_0x036b('0x27')](function(_0x6bada1){if(_0x6bada1){if(!fs[_0x036b('0x53')](_0x6bada1[_0x036b('0x57')])){throw new db['Sequelize'][(_0x036b('0x59'))](_0x036b('0x5c'));}if(_0x6bada1[_0x036b('0x5a')]){return _0x123b93[_0x036b('0x50')](_0x6bada1[_0x036b('0x57')],_0x6bada1[_0x036b('0x5a')]+path[_0x036b('0x65')](_0x6bada1[_0x036b('0x57')]),function(){if(_0x55cf41){fs[_0x036b('0x5b')](_0x6bada1['value']);}});}else{return _0x123b93['download'](_0x6bada1[_0x036b('0x57')],function(_0x224ad7){if(_0x55cf41){fs[_0x036b('0x5b')](_0x6bada1['value']);}});}}})[_0x036b('0x49')](handleError(_0x123b93,null));};exports[_0x036b('0x66')]=function(_0x5d6219,_0x2e1124){return db['VoiceRecording'][_0x036b('0x4c')]({'where':{'id':_0x5d6219[_0x036b('0x4b')]['id']}})['then'](function(_0x4ab4a0){if(_[_0x036b('0x67')](_0x4ab4a0)){throw new ReferenceError(_0x036b('0x68'));}return _0x4ab4a0;})[_0x036b('0x27')](function(_0x1de8fb){var _0x1e2545=_0x1de8fb['value'];logger[_0x036b('0x69')](_0x036b('0x6a'),_0x1e2545);if(!_[_0x036b('0x67')](_0x1de8fb[_0x036b('0x57')])&&fs['existsSync'](_0x1e2545)){logger[_0x036b('0x69')](_0x036b('0x6b')+_0x1e2545+_0x036b('0x6c'));fs['unlinkSync'](_0x1e2545);}_0x1e2545=_0x1e2545+_0x036b('0x6d');if(!_[_0x036b('0x67')](_0x1de8fb[_0x036b('0x57')])&&fs[_0x036b('0x53')](_0x1e2545)){logger['info']('File:\x20\x22'+_0x1e2545+_0x036b('0x6c'));fs['unlinkSync'](_0x1e2545);}return _0x1de8fb;})['then'](function(_0x41a0ac){if(!_0x41a0ac)throw new InternalError();return _0x41a0ac[_0x036b('0x66')]();})[_0x036b('0x27')](function(){_0x2e1124[_0x036b('0x1d')](0xcc)[_0x036b('0x1c')]();})[_0x036b('0x49')](handleError(_0x2e1124,null));};function getBucketslist(_0x309d86,_0x20ce95,_0x4c7ce4){return new Promise(function(_0x44cfda,_0xf89d01){var _0x4b2c4c=new AWS['S3']({'accessKeyId':_0x20ce95,'secretAccessKey':_0x309d86,'region':_0x4c7ce4});_0x4b2c4c['listBuckets']({},function(_0x1f921c,_0x3e97a3){if(_0x1f921c){return _0xf89d01(_0x1f921c);}else{return _0x44cfda(_0x3e97a3);}});});}function createBucket(_0x5c5e0b,_0x387c44,_0x191dca,_0xf4999d){return new Promise(function(_0x1f862d,_0x1be691){var _0x137c91=new AWS['S3']({'accessKeyId':_0x387c44,'secretAccessKey':_0x5c5e0b,'region':_0x191dca});_0x137c91[_0x036b('0x6e')]({'Bucket':_0xf4999d},function(_0x4d481c,_0x3e4797){if(_0x4d481c){return _0x1be691(_0x4d481c);}else{return _0x1f862d(_0x3e4797);}});});}function uploadFile(_0x511bf1,_0x443658,_0x560363,_0x1ddf91,_0x11d13f,_0x4aad4c){return new Promise(function(_0x24de70,_0x5233de){var _0x2e78dd=new AWS['S3']({'accessKeyId':_0x443658,'secretAccessKey':_0x511bf1,'region':_0x560363});_0x2e78dd[_0x036b('0x6f')]({'Bucket':_0x1ddf91,'Key':_0x11d13f,'Body':_0x4aad4c},function(_0x1a6940,_0x1b5b4f){if(_0x1a6940){return _0x5233de(_0x1a6940);}else{return _0x24de70(_0x1b5b4f);}});});}function startTranscribe(_0x33c62d,_0x2d4a9a,_0x217494,_0x185551,_0x99a610,_0x54dea5){return new Promise(function(_0x415d7e,_0x196520){var _0x47c73e=new AWS[(_0x036b('0x70'))]({'accessKeyId':_0x2d4a9a,'secretAccessKey':_0x33c62d,'region':_0x217494});_0x47c73e[_0x036b('0x71')]({'TranscriptionJobName':_0x185551,'LanguageCode':_0x99a610,'Media':{'MediaFileUri':_0x54dea5}},function(_0x371c43,_0x5337d0){if(_0x371c43){return _0x196520(_0x371c43);}else{return _0x415d7e(_0x5337d0);}});});}function transcribe(_0x5dbc8b,_0x3b7ec9,_0x549b80,_0x363424,_0x26b486,_0x211a6f,_0x2acb3b){return new Promise(function(_0x158115,_0x2478dd){var _0x4fc601={};logger[_0x036b('0x69')](util['format'](_0x036b('0x72'),_0x5dbc8b,_0x26b486));return uploadFile(_0x3b7ec9,_0x549b80,_0x363424,_0x26b486,path[_0x036b('0x73')](_0x211a6f),fs['readFileSync'](_0x211a6f))['then'](function(_0x28f157){logger['info'](util[_0x036b('0x34')](_0x036b('0x74'),_0x5dbc8b,_0x26b486,_0x28f157[_0x036b('0x75')]));_0x4fc601['bucket']=_0x28f157['Bucket'];_0x4fc601[_0x036b('0x76')]=_0x28f157[_0x036b('0x75')];logger[_0x036b('0x69')](util[_0x036b('0x34')](_0x036b('0x77'),_0x5dbc8b));return startTranscribe(_0x3b7ec9,_0x549b80,_0x363424,uuidv4(),_0x2acb3b,_0x28f157['Location']);})[_0x036b('0x27')](function(_0x23ba0e){logger[_0x036b('0x69')](util[_0x036b('0x34')](_0x036b('0x78'),_0x5dbc8b,_0x23ba0e[_0x036b('0x79')][_0x036b('0x7a')]));_0x4fc601['transcribeName']=_0x23ba0e['TranscriptionJob'][_0x036b('0x7a')];_0x4fc601[_0x036b('0x7b')]=_0x23ba0e['TranscriptionJob']['TranscriptionJobStatus'];return _0x158115(_0x4fc601);})[_0x036b('0x49')](function(_0x2ed466){return _0x2478dd(_0x2ed466);});});}exports['runTranscribe']=function(_0x16cff3,_0x41b390,_0x330fda){var _0x3ebc37;var _0x560526;var _0x1bb76b;var _0x1c21bd=require(_0x036b('0x51'));return db[_0x036b('0x2d')][_0x036b('0x7c')]({'where':{'id':_0x16cff3['params']['id']}})[_0x036b('0x27')](function(_0x5bf185){if(_0x5bf185){var _0x199eaf=util[_0x036b('0x34')](_0x036b('0x64'),_0x5bf185[_0x036b('0x57')]);if(fs[_0x036b('0x53')](_0x199eaf)){cypher=!![];return _0x1c21bd[_0x036b('0x54')](_0x199eaf,_0x5bf185['value'],config['secrets']['recording'])[_0x036b('0x27')](function(){return _0x5bf185;});}return _0x5bf185;}})[_0x036b('0x27')](function(_0x386be2){if(!_0x386be2){throw new db[(_0x036b('0x58'))][(_0x036b('0x59'))]('Voice\x20Recording\x20not\x20found');}_0x560526=_0x386be2;return db[_0x036b('0x7d')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x41b390,null))['then'](function(_0x4d365a){if(_0x4d365a){_0x3ebc37=_0x4d365a;if(!_0x3ebc37[_0x036b('0x7e')]||!_0x3ebc37[_0x036b('0x7f')]||!_0x3ebc37[_0x036b('0x80')]||!_0x3ebc37[_0x036b('0x81')]||!_0x3ebc37[_0x036b('0x82')]){throw new db[(_0x036b('0x58'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0x16cff3[_0x036b('0x4e')][_0x036b('0x83')]&&(!_0x3ebc37[_0x036b('0x84')]||!_0x3ebc37[_0x036b('0x85')]||!_0x3ebc37['sentimentRegion']||!_0x3ebc37[_0x036b('0x81')]||!_0x3ebc37[_0x036b('0x82')])){throw new db[(_0x036b('0x58'))]['ValidationError'](_0x036b('0x86'));}return db[_0x036b('0x87')][_0x036b('0x7c')]({'where':{'id':_0x3ebc37[_0x036b('0x7f')]}});}})[_0x036b('0x27')](function(_0x55d6c9){if(!_0x55d6c9){throw new db[(_0x036b('0x58'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x55d6c9[_0x036b('0x88')]||!_0x55d6c9[_0x036b('0x89')]){throw new db[(_0x036b('0x58'))]['ValidationError'](_0x036b('0x8a'));}_0x1bb76b=_0x55d6c9;return getBucketslist(_0x1bb76b[_0x036b('0x88')],_0x1bb76b[_0x036b('0x89')],_0x3ebc37[_0x036b('0x80')]);})[_0x036b('0x27')](function(_0x5f13f1){if(_0x5f13f1&&_0x5f13f1['Buckets']){var _0x100ee5=_[_0x036b('0x4c')](_0x5f13f1['Buckets'],function(_0x26f37f){return _0x26f37f[_0x036b('0x8b')]===_0x3ebc37[_0x036b('0x82')];});if(!_0x100ee5){logger['info'](util[_0x036b('0x34')](_0x036b('0x8c'),_0x16cff3['params']['id'],_0x3ebc37['bucket']));return createBucket(_0x1bb76b[_0x036b('0x88')],_0x1bb76b[_0x036b('0x89')],_0x3ebc37[_0x036b('0x80')],_0x3ebc37[_0x036b('0x82')]);}logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x16cff3[_0x036b('0x4b')]['id'],_0x3ebc37[_0x036b('0x82')]));return;}})['then'](function(_0x2315ec){if(_0x560526[_0x036b('0x7b')]===_0x036b('0x8d')){return transcribe(_0x16cff3[_0x036b('0x4b')]['id'],_0x1bb76b[_0x036b('0x88')],_0x1bb76b[_0x036b('0x89')],_0x3ebc37[_0x036b('0x80')],_0x3ebc37[_0x036b('0x82')],_0x560526[_0x036b('0x57')],_0x3ebc37[_0x036b('0x81')]);}else{logger[_0x036b('0x69')](util[_0x036b('0x34')](_0x036b('0x8e'),_0x16cff3[_0x036b('0x4b')]['id']));return{'transcribeStatus':_0x036b('0x8f')};}})[_0x036b('0x27')](function(_0x37d1d1){if(_0x37d1d1){_0x37d1d1['tempSentiment']=_0x16cff3[_0x036b('0x4e')][_0x036b('0x83')];return _0x560526[_0x036b('0x90')](_0x37d1d1);}})[_0x036b('0x27')](respondWithResult(_0x41b390,null))['catch'](handleError(_0x41b390,null));};function writeFile(_0x2b23ff,_0x5021a6){return new Promise(function(_0x2769d9,_0x222983){fs[_0x036b('0x91')](_0x5021a6,_0x2b23ff,function(_0x23422f,_0x3e1aeb){if(_0x23422f){return _0x222983(_0x23422f);}else{return _0x2769d9(_0x3e1aeb);}});});}exports['downloadTranscribe']=function(_0xe441c2,_0x7d84ac,_0xd2dfcb){return db['VoiceRecording']['findOne']({'where':{'id':_0xe441c2['params']['id']}})[_0x036b('0x27')](handleEntityNotFound(_0x7d84ac))[_0x036b('0x27')](function(_0x1497c5){if(_0x1497c5&&_0x1497c5[_0x036b('0x92')]){var _0x59a53b=_0x1497c5[_0x036b('0x92')];var _0x348af3=config['root']+_0x036b('0x93')+_0x1497c5['id']+_0x036b('0x94');if(fs[_0x036b('0x53')](_0x348af3)){return _0x348af3;}return writeFile(_0x59a53b,_0x348af3)[_0x036b('0x27')](function(){return _0x348af3;});}else{throw new db[(_0x036b('0x58'))]['ValidationError'](_0x036b('0x95'));}})[_0x036b('0x27')](function(_0x33d682){return _0x7d84ac[_0x036b('0x50')](_0x33d682);})['catch'](handleError(_0x7d84ac));}; \ No newline at end of file +var _0xb2ea=['startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','findOne','decryptFile','Voice\x20Recording\x20not\x20found','transcribe','transcribeRegion','bucket','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','crypto','jsforce','querystring','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','update','then','error','stack','name','send','index','VoiceRecording','fieldName','type','key','model','differenceBy','map','format','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','params','rawAttributes','keys','find','create','body','describe','download','uniqueid','value','recording','existsSync','Sequelize','ValidationError','filename','unlink','message','VoiceRecording\x20not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','%s.cypher','secrets','extname','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','TranscribeService'];(function(_0x3711e2,_0x1468e1){var _0x18a556=function(_0x5e0923){while(--_0x5e0923){_0x3711e2['push'](_0x3711e2['shift']());}};_0x18a556(++_0x1468e1);}(_0xb2ea,0x1f1));var _0xab2e=function(_0x3c9bdf,_0x3b30cd){_0x3c9bdf=_0x3c9bdf-0x0;var _0x5664a6=_0xb2ea[_0x3c9bdf];return _0x5664a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab2e('0x0'));var zipdir=require(_0xab2e('0x1'));var jsonpatch=require(_0xab2e('0x2'));var rp=require('request-promise');var moment=require(_0xab2e('0x3'));var BPromise=require(_0xab2e('0x4'));var Mustache=require(_0xab2e('0x5'));var util=require('util');var path=require(_0xab2e('0x6'));var sox=require(_0xab2e('0x7'));var csv=require(_0xab2e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xab2e('0x9'));var jsforce=require(_0xab2e('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xab2e('0xb'));var Papa=require('papaparse');var AWS=require(_0xab2e('0xc'));var uuidv4=require(_0xab2e('0xd'));var Redis=require('ioredis');var authService=require(_0xab2e('0xe'));var qs=require(_0xab2e('0xf'));var as=require(_0xab2e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab2e('0x11'))(_0xab2e('0x12'));var utils=require(_0xab2e('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xab2e('0x14'))['db'];function respondWithStatusCode(_0x16609f,_0x112088){_0x112088=_0x112088||0xcc;return function(_0x4377a9){if(_0x4377a9){return _0x16609f[_0xab2e('0x15')](_0x112088);}return _0x16609f[_0xab2e('0x16')](_0x112088)[_0xab2e('0x17')]();};}function respondWithResult(_0x49cf70,_0x5c94c2){_0x5c94c2=_0x5c94c2||0xc8;return function(_0x1e79ae){if(_0x1e79ae){return _0x49cf70['status'](_0x5c94c2)['json'](_0x1e79ae);}};}function respondWithFilteredResult(_0x11b1d8,_0x175d71){return function(_0x3e7e85){if(_0x3e7e85){var _0x52676d=typeof _0x175d71['offset']===_0xab2e('0x18')&&typeof _0x175d71[_0xab2e('0x19')]==='undefined';var _0x341e18=_0x3e7e85[_0xab2e('0x1a')];var _0x206c46=_0x52676d?0x0:_0x175d71['offset'];var _0x541416=_0x52676d?_0x3e7e85[_0xab2e('0x1a')]:_0x175d71[_0xab2e('0x1b')]+_0x175d71['limit'];var _0xe3ea68;if(_0x541416>=_0x341e18){_0x541416=_0x341e18;_0xe3ea68=0xc8;}else{_0xe3ea68=0xce;}_0x11b1d8['status'](_0xe3ea68);return _0x11b1d8[_0xab2e('0x1c')]('Content-Range',_0x206c46+'-'+_0x541416+'/'+_0x341e18)[_0xab2e('0x1d')](_0x3e7e85);}return null;};}function patchUpdates(_0x562e47){return function(_0x112c0e){try{jsonpatch[_0xab2e('0x1e')](_0x112c0e,_0x562e47,!![]);}catch(_0x5af5fc){return BPromise[_0xab2e('0x1f')](_0x5af5fc);}return _0x112c0e['save']();};}function saveUpdates(_0x3401a,_0x49658a){return function(_0xc5b67f){if(_0xc5b67f){return _0xc5b67f[_0xab2e('0x20')](_0x3401a)[_0xab2e('0x21')](function(_0xb3dba6){return _0xb3dba6;});}return null;};}function removeEntity(_0x5b0b37,_0x4ad7f6){return function(_0x4b05ed){if(_0x4b05ed){return _0x4b05ed['destroy']()[_0xab2e('0x21')](function(){_0x5b0b37['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36028f,_0x5a5492){return function(_0x28b657){if(!_0x28b657){_0x36028f[_0xab2e('0x15')](0x194);}return _0x28b657;};}function handleError(_0x1899a4,_0x32f59f){_0x32f59f=_0x32f59f||0x1f4;return function(_0x51ff55){logger[_0xab2e('0x22')](_0x51ff55[_0xab2e('0x23')]);if(_0x51ff55[_0xab2e('0x24')]){delete _0x51ff55['name'];}_0x1899a4['status'](_0x32f59f)[_0xab2e('0x25')](_0x51ff55);};}exports[_0xab2e('0x26')]=function(_0x357824,_0xfdfe5d){var _0x3f7078={},_0x38c49e={},_0x693e1f={'count':0x0,'rows':[]};var _0x270133=_['map'](db[_0xab2e('0x27')]['rawAttributes'],function(_0x335496){return{'name':_0x335496[_0xab2e('0x28')],'type':_0x335496[_0xab2e('0x29')][_0xab2e('0x2a')]};});_0x38c49e[_0xab2e('0x2b')]=_[_0xab2e('0x2c')](_[_0xab2e('0x2d')](_0x270133,_0xab2e('0x24')),[_0xab2e('0x2e')]);_0x38c49e['query']=_['keys'](_0x357824[_0xab2e('0x2f')]);_0x38c49e['filters']=_[_0xab2e('0x30')](_0x38c49e[_0xab2e('0x2b')],_0x38c49e[_0xab2e('0x2f')]);_0x3f7078[_0xab2e('0x31')]=_[_0xab2e('0x30')](_0x38c49e['model'],qs[_0xab2e('0x32')](_0x357824[_0xab2e('0x2f')][_0xab2e('0x32')]));_0x3f7078[_0xab2e('0x31')]=_0x3f7078[_0xab2e('0x31')][_0xab2e('0x33')]?_0x3f7078[_0xab2e('0x31')]:_0x38c49e[_0xab2e('0x2b')];if(!_0x357824[_0xab2e('0x2f')][_0xab2e('0x34')](_0xab2e('0x35'))){_0x3f7078[_0xab2e('0x19')]=qs[_0xab2e('0x19')](_0x357824['query'][_0xab2e('0x19')]);_0x3f7078['offset']=qs[_0xab2e('0x1b')](_0x357824[_0xab2e('0x2f')][_0xab2e('0x1b')]);}_0x3f7078[_0xab2e('0x36')]=qs[_0xab2e('0x37')](_0x357824['query'][_0xab2e('0x37')]);_0x3f7078[_0xab2e('0x38')]=qs[_0xab2e('0x39')](_[_0xab2e('0x3a')](_0x357824['query'],_0x38c49e[_0xab2e('0x39')]),_0x270133);if(_0x357824[_0xab2e('0x2f')][_0xab2e('0x3b')]){_0x3f7078[_0xab2e('0x38')]=_[_0xab2e('0x3c')](_0x3f7078['where'],{'$or':_[_0xab2e('0x2d')](_0x270133,function(_0x4cc9d3){if(_0x4cc9d3[_0xab2e('0x29')]!=='VIRTUAL'){var _0xab5233={};_0xab5233[_0x4cc9d3[_0xab2e('0x24')]]={'$like':'%'+_0x357824[_0xab2e('0x2f')]['filter']+'%'};return _0xab5233;}})});}_0x3f7078=_[_0xab2e('0x3c')]({},_0x3f7078,_0x357824[_0xab2e('0x3d')]);var _0xdf077a={'where':_0x3f7078[_0xab2e('0x38')]};return db['VoiceRecording']['count'](_0xdf077a)['then'](function(_0x55eaeb){_0x693e1f[_0xab2e('0x1a')]=_0x55eaeb;if(_0x357824['query'][_0xab2e('0x3e')]){_0x3f7078[_0xab2e('0x3f')]=[{'all':!![]}];}return db[_0xab2e('0x27')]['findAll'](_0x3f7078);})[_0xab2e('0x21')](function(_0xca6d18){_0x693e1f[_0xab2e('0x40')]=_0xca6d18;return _0x693e1f;})[_0xab2e('0x21')](respondWithFilteredResult(_0xfdfe5d,_0x3f7078))[_0xab2e('0x41')](handleError(_0xfdfe5d,null));};exports['show']=function(_0xd71213,_0x5cbd59){var _0x4d25e8={'raw':![],'where':{'id':_0xd71213[_0xab2e('0x42')]['id']}},_0x32f56b={};_0x32f56b[_0xab2e('0x2b')]=_['keys'](db[_0xab2e('0x27')][_0xab2e('0x43')]);_0x32f56b[_0xab2e('0x2f')]=_[_0xab2e('0x44')](_0xd71213['query']);_0x32f56b[_0xab2e('0x39')]=_[_0xab2e('0x30')](_0x32f56b[_0xab2e('0x2b')],_0x32f56b[_0xab2e('0x2f')]);_0x4d25e8['attributes']=_['intersection'](_0x32f56b['model'],qs['fields'](_0xd71213[_0xab2e('0x2f')][_0xab2e('0x32')]));_0x4d25e8['attributes']=_0x4d25e8[_0xab2e('0x31')]['length']?_0x4d25e8[_0xab2e('0x31')]:_0x32f56b[_0xab2e('0x2b')];if(_0xd71213['query']['includeAll']){_0x4d25e8[_0xab2e('0x3f')]=[{'all':!![]}];}_0x4d25e8=_[_0xab2e('0x3c')]({},_0x4d25e8,_0xd71213[_0xab2e('0x3d')]);return db[_0xab2e('0x27')][_0xab2e('0x45')](_0x4d25e8)[_0xab2e('0x21')](handleEntityNotFound(_0x5cbd59,null))['then'](respondWithResult(_0x5cbd59,null))['catch'](handleError(_0x5cbd59,null));};exports[_0xab2e('0x46')]=function(_0x257d33,_0x2d4fee){return db[_0xab2e('0x27')][_0xab2e('0x46')](_0x257d33[_0xab2e('0x47')],{})[_0xab2e('0x21')](respondWithResult(_0x2d4fee,0xc9))[_0xab2e('0x41')](handleError(_0x2d4fee,null));};exports[_0xab2e('0x20')]=function(_0x4fba25,_0x317a9d){if(_0x4fba25[_0xab2e('0x47')]['id']){delete _0x4fba25['body']['id'];}return db[_0xab2e('0x27')]['find']({'where':{'id':_0x4fba25[_0xab2e('0x42')]['id']}})[_0xab2e('0x21')](handleEntityNotFound(_0x317a9d,null))[_0xab2e('0x21')](saveUpdates(_0x4fba25['body'],null))[_0xab2e('0x21')](respondWithResult(_0x317a9d,null))[_0xab2e('0x41')](handleError(_0x317a9d,null));};exports[_0xab2e('0x48')]=function(_0x174892,_0x2c2b2c){return db['VoiceRecording'][_0xab2e('0x48')]()['then'](respondWithResult(_0x2c2b2c,null))['catch'](handleError(_0x2c2b2c,null));};exports[_0xab2e('0x49')]=function(_0x25c3cf,_0x5c504b,_0x58c885){var _0xe2c731=require('../../components/encryptor');var _0x3619d0=![];var _0x3f53b2={};if(_0x25c3cf[_0xab2e('0x2f')]['type']&&_0x25c3cf[_0xab2e('0x2f')][_0xab2e('0x29')]==='uniqueid'){_0x3f53b2[_0xab2e('0x4a')]=_0x25c3cf[_0xab2e('0x42')]['id'];}else{_0x3f53b2['id']=_0x25c3cf['params']['id'];}return db[_0xab2e('0x27')][_0xab2e('0x45')]({'where':_0x3f53b2,'attributes':['id',_0xab2e('0x4b')],'raw':!![]})[_0xab2e('0x21')](handleEntityNotFound(_0x5c504b,null))['then'](function(_0x3969a8){if(_0x3969a8){var _0x120ad8=_0x3969a8[_0xab2e('0x4b')];var _0x5f29a6=util['format']('%s.cypher',_0x120ad8);if(fs['existsSync'](_0x5f29a6)){_0x3619d0=!![];return _0xe2c731['decryptFile'](_0x5f29a6,_0x120ad8,config['secrets'][_0xab2e('0x4c')])[_0xab2e('0x21')](function(){return _0x3969a8;});}return _0x3969a8;}})[_0xab2e('0x21')](function(_0x2639d2){if(_0x2639d2){var _0x47cead=_0x2639d2['value'];if(!fs[_0xab2e('0x4d')](_0x47cead)){throw new db[(_0xab2e('0x4e'))][(_0xab2e('0x4f'))]('VoiceRecording\x20not\x20found');}if(_0x2639d2[_0xab2e('0x50')]){return _0x5c504b['download'](_0x47cead,_0x2639d2[_0xab2e('0x50')]+path['extname'](_0x47cead),function(){if(_0x3619d0){fs[_0xab2e('0x51')](_0x47cead);}});}else{return _0x5c504b[_0xab2e('0x49')](_0x47cead,function(_0x54fbc6){if(_0x3619d0){fs[_0xab2e('0x51')](_0x47cead);}});}}})[_0xab2e('0x41')](function(_0x59828f){if(_0x59828f[_0xab2e('0x52')]===_0xab2e('0x53')){_0x5c504b[_0xab2e('0x16')](0x194)[_0xab2e('0x25')]('Not\x20found');}else{return handleError(_0x5c504b,null);}});};exports[_0xab2e('0x54')]=function(_0x309127,_0x246ce0,_0x259482){var _0x4485c5=require(_0xab2e('0x55'));var _0x467543=![];var _0x2e7abd={'$and':[db[_0xab2e('0x56')]['where'](db[_0xab2e('0x56')]['fn'](_0xab2e('0x57'),db[_0xab2e('0x56')][_0xab2e('0x58')](_0xab2e('0x4a'))),_0x309127[_0xab2e('0x2f')][_0xab2e('0x59')])]};if(_0x309127['query'][_0xab2e('0x29')]&&_0x309127[_0xab2e('0x2f')][_0xab2e('0x29')]===_0xab2e('0x4a')){_0x2e7abd[_0xab2e('0x5a')]['push']({'uniqueid':_0x309127[_0xab2e('0x42')]['id']});}else{_0x2e7abd[_0xab2e('0x5a')][_0xab2e('0x5b')]({'id':_0x309127[_0xab2e('0x42')]['id']});}return db[_0xab2e('0x27')][_0xab2e('0x45')]({'where':_0x2e7abd,'attributes':['id',_0xab2e('0x4b')],'raw':!![]})[_0xab2e('0x21')](handleEntityNotFound(_0x246ce0,null))[_0xab2e('0x21')](function(_0x2c72bb){if(_0x2c72bb){var _0x15df2e=util['format'](_0xab2e('0x5c'),_0x2c72bb[_0xab2e('0x4b')]);if(fs[_0xab2e('0x4d')](_0x15df2e)){_0x467543=!![];return _0x4485c5['decryptFile'](_0x15df2e,_0x2c72bb[_0xab2e('0x4b')],config[_0xab2e('0x5d')][_0xab2e('0x4c')])[_0xab2e('0x21')](function(){return _0x2c72bb;});}return _0x2c72bb;}})['then'](function(_0x359855){if(_0x359855){if(!fs[_0xab2e('0x4d')](_0x359855[_0xab2e('0x4b')])){throw new db[(_0xab2e('0x4e'))][(_0xab2e('0x4f'))]('VoiceRecording\x20not\x20found');}if(_0x359855[_0xab2e('0x50')]){return _0x246ce0[_0xab2e('0x49')](_0x359855[_0xab2e('0x4b')],_0x359855[_0xab2e('0x50')]+path[_0xab2e('0x5e')](_0x359855[_0xab2e('0x4b')]),function(){if(_0x467543){fs[_0xab2e('0x51')](_0x359855[_0xab2e('0x4b')]);}});}else{return _0x246ce0[_0xab2e('0x49')](_0x359855[_0xab2e('0x4b')],function(_0xb8435c){if(_0x467543){fs['unlink'](_0x359855[_0xab2e('0x4b')]);}});}}})['catch'](handleError(_0x246ce0,null));};exports[_0xab2e('0x5f')]=function(_0x11a220,_0x2153af){return db[_0xab2e('0x27')][_0xab2e('0x45')]({'where':{'id':_0x11a220[_0xab2e('0x42')]['id']}})['then'](function(_0x4a192a){if(_[_0xab2e('0x60')](_0x4a192a)){throw new ReferenceError(_0xab2e('0x61'));}return _0x4a192a;})[_0xab2e('0x21')](function(_0xa648c3){var _0x1051a0=_0xa648c3['value'];logger[_0xab2e('0x62')](_0xab2e('0x63'),_0x1051a0);if(!_[_0xab2e('0x60')](_0xa648c3[_0xab2e('0x4b')])&&fs[_0xab2e('0x4d')](_0x1051a0)){logger[_0xab2e('0x62')](_0xab2e('0x64')+_0x1051a0+_0xab2e('0x65'));fs[_0xab2e('0x66')](_0x1051a0);}_0x1051a0=_0x1051a0+'.cypher';if(!_[_0xab2e('0x60')](_0xa648c3['value'])&&fs[_0xab2e('0x4d')](_0x1051a0)){logger[_0xab2e('0x62')](_0xab2e('0x64')+_0x1051a0+_0xab2e('0x65'));fs[_0xab2e('0x66')](_0x1051a0);}return _0xa648c3;})[_0xab2e('0x21')](function(_0x22c2f9){if(!_0x22c2f9)throw new InternalError();return _0x22c2f9[_0xab2e('0x5f')]();})['then'](function(){_0x2153af[_0xab2e('0x16')](0xcc)['end']();})[_0xab2e('0x41')](handleError(_0x2153af,null));};function getBucketslist(_0x6106ff,_0x4366f7,_0x5ed856){return new Promise(function(_0x5f3a1d,_0x631e3e){var _0x543bbd=new AWS['S3']({'accessKeyId':_0x4366f7,'secretAccessKey':_0x6106ff,'region':_0x5ed856});_0x543bbd[_0xab2e('0x67')]({},function(_0x4eddb7,_0xf32bd6){if(_0x4eddb7){return _0x631e3e(_0x4eddb7);}else{return _0x5f3a1d(_0xf32bd6);}});});}function createBucket(_0x4c79cc,_0x5ed2c1,_0x414d1b,_0x1fafd5){return new Promise(function(_0xc48a00,_0x3ad356){var _0x57ab35=new AWS['S3']({'accessKeyId':_0x5ed2c1,'secretAccessKey':_0x4c79cc,'region':_0x414d1b});_0x57ab35[_0xab2e('0x68')]({'Bucket':_0x1fafd5},function(_0x54d38a,_0x1d3ccd){if(_0x54d38a){return _0x3ad356(_0x54d38a);}else{return _0xc48a00(_0x1d3ccd);}});});}function uploadFile(_0xb50590,_0x50ce9e,_0x370ee5,_0x55970e,_0xd5fa13,_0x57ed71){return new Promise(function(_0x332ce5,_0x5271cc){var _0x3ec1d1=new AWS['S3']({'accessKeyId':_0x50ce9e,'secretAccessKey':_0xb50590,'region':_0x370ee5});_0x3ec1d1[_0xab2e('0x69')]({'Bucket':_0x55970e,'Key':_0xd5fa13,'Body':_0x57ed71},function(_0x442258,_0x5aa27e){if(_0x442258){return _0x5271cc(_0x442258);}else{return _0x332ce5(_0x5aa27e);}});});}function startTranscribe(_0x2ee18f,_0x207a8b,_0x9fc502,_0x44feba,_0x6840f4,_0x2c4293){return new Promise(function(_0x58367b,_0x596b72){var _0x1aac9e=new AWS[(_0xab2e('0x6a'))]({'accessKeyId':_0x207a8b,'secretAccessKey':_0x2ee18f,'region':_0x9fc502});_0x1aac9e[_0xab2e('0x6b')]({'TranscriptionJobName':_0x44feba,'LanguageCode':_0x6840f4,'Media':{'MediaFileUri':_0x2c4293}},function(_0x5e405a,_0x5413c5){if(_0x5e405a){return _0x596b72(_0x5e405a);}else{return _0x58367b(_0x5413c5);}});});}function transcribe(_0x4f77ed,_0x21a646,_0x322bb7,_0x21fe14,_0xc9b2a8,_0x494f3c,_0x18bf69){return new Promise(function(_0x5af2bc,_0x249a96){var _0x1c7f6a={};logger[_0xab2e('0x62')](util[_0xab2e('0x2e')](_0xab2e('0x6c'),_0x4f77ed,_0xc9b2a8));return uploadFile(_0x21a646,_0x322bb7,_0x21fe14,_0xc9b2a8,path[_0xab2e('0x6d')](_0x494f3c),fs['readFileSync'](_0x494f3c))[_0xab2e('0x21')](function(_0x10bacb){logger[_0xab2e('0x62')](util[_0xab2e('0x2e')](_0xab2e('0x6e'),_0x4f77ed,_0xc9b2a8,_0x10bacb[_0xab2e('0x6f')]));_0x1c7f6a['bucket']=_0x10bacb[_0xab2e('0x70')];_0x1c7f6a[_0xab2e('0x71')]=_0x10bacb[_0xab2e('0x6f')];logger[_0xab2e('0x62')](util[_0xab2e('0x2e')](_0xab2e('0x72'),_0x4f77ed));return startTranscribe(_0x21a646,_0x322bb7,_0x21fe14,uuidv4(),_0x18bf69,_0x10bacb['Location']);})[_0xab2e('0x21')](function(_0x1587ff){logger[_0xab2e('0x62')](util[_0xab2e('0x2e')](_0xab2e('0x73'),_0x4f77ed,_0x1587ff[_0xab2e('0x74')]['TranscriptionJobName']));_0x1c7f6a[_0xab2e('0x75')]=_0x1587ff[_0xab2e('0x74')][_0xab2e('0x76')];_0x1c7f6a[_0xab2e('0x77')]=_0x1587ff[_0xab2e('0x74')][_0xab2e('0x78')];return _0x5af2bc(_0x1c7f6a);})[_0xab2e('0x41')](function(_0x27b11d){return _0x249a96(_0x27b11d);});});}exports['runTranscribe']=function(_0x51347a,_0x6511cf,_0x40847b){var _0x6b9e3e;var _0x28787f;var _0x46b486;var _0x3d5419=require(_0xab2e('0x55'));return db['VoiceRecording'][_0xab2e('0x79')]({'where':{'id':_0x51347a[_0xab2e('0x42')]['id']}})[_0xab2e('0x21')](function(_0x38f1e9){if(_0x38f1e9){var _0x4ca277=util['format'](_0xab2e('0x5c'),_0x38f1e9[_0xab2e('0x4b')]);if(fs[_0xab2e('0x4d')](_0x4ca277)){cypher=!![];return _0x3d5419[_0xab2e('0x7a')](_0x4ca277,_0x38f1e9[_0xab2e('0x4b')],config[_0xab2e('0x5d')][_0xab2e('0x4c')])[_0xab2e('0x21')](function(){return _0x38f1e9;});}return _0x38f1e9;}})['then'](function(_0x1a9950){if(!_0x1a9950){throw new db[(_0xab2e('0x4e'))][(_0xab2e('0x4f'))](_0xab2e('0x7b'));}_0x28787f=_0x1a9950;return db['Setting'][_0xab2e('0x79')]({'where':{'id':0x1}});})[_0xab2e('0x21')](handleEntityNotFound(_0x6511cf,null))[_0xab2e('0x21')](function(_0x352074){if(_0x352074){_0x6b9e3e=_0x352074;if(!_0x6b9e3e[_0xab2e('0x7c')]||!_0x6b9e3e['transcribeAccountId']||!_0x6b9e3e[_0xab2e('0x7d')]||!_0x6b9e3e['language']||!_0x6b9e3e[_0xab2e('0x7e')]){throw new db[(_0xab2e('0x4e'))][(_0xab2e('0x4f'))]('Transcribe\x20not\x20configured');}if(_0x51347a[_0xab2e('0x47')][_0xab2e('0x7f')]&&(!_0x6b9e3e[_0xab2e('0x80')]||!_0x6b9e3e[_0xab2e('0x81')]||!_0x6b9e3e[_0xab2e('0x82')]||!_0x6b9e3e[_0xab2e('0x83')]||!_0x6b9e3e['bucket'])){throw new db['Sequelize'][(_0xab2e('0x4f'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xab2e('0x84')][_0xab2e('0x79')]({'where':{'id':_0x6b9e3e[_0xab2e('0x85')]}});}})['then'](function(_0xdc5dde){if(!_0xdc5dde){throw new db[(_0xab2e('0x4e'))][(_0xab2e('0x4f'))](_0xab2e('0x86'));}if(!_0xdc5dde[_0xab2e('0x87')]||!_0xdc5dde[_0xab2e('0x88')]){throw new db[(_0xab2e('0x4e'))][(_0xab2e('0x4f'))](_0xab2e('0x89'));}_0x46b486=_0xdc5dde;return getBucketslist(_0x46b486[_0xab2e('0x87')],_0x46b486[_0xab2e('0x88')],_0x6b9e3e[_0xab2e('0x7d')]);})[_0xab2e('0x21')](function(_0x51b4f0){if(_0x51b4f0&&_0x51b4f0[_0xab2e('0x8a')]){var _0x179cad=_['find'](_0x51b4f0['Buckets'],function(_0x512a21){return _0x512a21['Name']===_0x6b9e3e['bucket'];});if(!_0x179cad){logger['info'](util[_0xab2e('0x2e')](_0xab2e('0x8b'),_0x51347a[_0xab2e('0x42')]['id'],_0x6b9e3e[_0xab2e('0x7e')]));return createBucket(_0x46b486[_0xab2e('0x87')],_0x46b486[_0xab2e('0x88')],_0x6b9e3e[_0xab2e('0x7d')],_0x6b9e3e[_0xab2e('0x7e')]);}logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x51347a[_0xab2e('0x42')]['id'],_0x6b9e3e[_0xab2e('0x7e')]));return;}})[_0xab2e('0x21')](function(_0x513f53){if(_0x28787f[_0xab2e('0x77')]===_0xab2e('0x8c')){return transcribe(_0x51347a['params']['id'],_0x46b486[_0xab2e('0x87')],_0x46b486['data2'],_0x6b9e3e[_0xab2e('0x7d')],_0x6b9e3e['bucket'],_0x28787f[_0xab2e('0x4b')],_0x6b9e3e['language']);}else{logger[_0xab2e('0x62')](util[_0xab2e('0x2e')](_0xab2e('0x8d'),_0x51347a[_0xab2e('0x42')]['id']));return{'transcribeStatus':_0xab2e('0x8e')};}})[_0xab2e('0x21')](function(_0x1c6fed){if(_0x1c6fed){_0x1c6fed[_0xab2e('0x8f')]=_0x51347a[_0xab2e('0x47')][_0xab2e('0x7f')];return _0x28787f[_0xab2e('0x90')](_0x1c6fed);}})[_0xab2e('0x21')](respondWithResult(_0x6511cf,null))[_0xab2e('0x41')](handleError(_0x6511cf,null));};function writeFile(_0x467267,_0x51f3cd){return new Promise(function(_0x419448,_0x485669){fs[_0xab2e('0x91')](_0x51f3cd,_0x467267,function(_0x276eb5,_0x278d8b){if(_0x276eb5){return _0x485669(_0x276eb5);}else{return _0x419448(_0x278d8b);}});});}exports[_0xab2e('0x92')]=function(_0x4d55be,_0xfdab81,_0xe76f8){return db[_0xab2e('0x27')]['findOne']({'where':{'id':_0x4d55be[_0xab2e('0x42')]['id']}})[_0xab2e('0x21')](handleEntityNotFound(_0xfdab81))[_0xab2e('0x21')](function(_0x3b6384){if(_0x3b6384&&_0x3b6384[_0xab2e('0x93')]){var _0x4e035c=_0x3b6384[_0xab2e('0x93')];var _0x4e77bc=config['root']+_0xab2e('0x94')+_0x3b6384['id']+_0xab2e('0x95');if(fs[_0xab2e('0x4d')](_0x4e77bc)){return _0x4e77bc;}return writeFile(_0x4e035c,_0x4e77bc)[_0xab2e('0x21')](function(){return _0x4e77bc;});}else{throw new db[(_0xab2e('0x4e'))]['ValidationError'](_0xab2e('0x96'));}})[_0xab2e('0x21')](function(_0x30075c){return _0xfdab81['download'](_0x30075c);})[_0xab2e('0x41')](handleError(_0xfdab81));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 18d45bb..5be87bb 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 _0x958a=['moment','bluebird','request-promise','path','../../config/environment','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','api'];(function(_0xc0638b,_0x2fccf4){var _0xd57dfa=function(_0x322fba){while(--_0x322fba){_0xc0638b['push'](_0xc0638b['shift']());}};_0xd57dfa(++_0x2fccf4);}(_0x958a,0x128));var _0xa958=function(_0x4b8ce4,_0x1dc4ef){_0x4b8ce4=_0x4b8ce4-0x0;var _0x2ad56b=_0x958a[_0x4b8ce4];return _0x2ad56b;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var logger=require('../../config/logger')(_0xa958('0x2'));var moment=require(_0xa958('0x3'));var BPromise=require(_0xa958('0x4'));var rp=require(_0xa958('0x5'));var fs=require('fs');var path=require(_0xa958('0x6'));var rimraf=require('rimraf');var config=require(_0xa958('0x7'));var attributes=require('./voiceRecording.attributes');module[_0xa958('0x8')]=function(_0x9b7d9e,_0x2692d6){return _0x9b7d9e[_0xa958('0x9')](_0xa958('0xa'),attributes,{'tableName':_0xa958('0xb'),'paranoid':![],'indexes':[{'name':_0xa958('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd770=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x3a8d33,_0x1e6952){var _0x18f251=function(_0x45ae60){while(--_0x45ae60){_0x3a8d33['push'](_0x3a8d33['shift']());}};_0x18f251(++_0x1e6952);}(_0xd770,0x145));var _0x0d77=function(_0x31ddd7,_0x312f4b){_0x31ddd7=_0x31ddd7-0x0;var _0x5d56b4=_0xd770[_0x31ddd7];return _0x5d56b4;};'use strict';var _=require(_0x0d77('0x0'));var util=require(_0x0d77('0x1'));var logger=require(_0x0d77('0x2'))('api');var moment=require(_0x0d77('0x3'));var BPromise=require(_0x0d77('0x4'));var rp=require(_0x0d77('0x5'));var fs=require('fs');var path=require(_0x0d77('0x6'));var rimraf=require('rimraf');var config=require(_0x0d77('0x7'));var attributes=require(_0x0d77('0x8'));module['exports']=function(_0x1eef14,_0x28fb34){return _0x1eef14[_0x0d77('0x9')](_0x0d77('0xa'),attributes,{'tableName':_0x0d77('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0d77('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index fc06089..d270ecd 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 _0x8ace=['VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','attributes','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','create','body','callRecordingEncryption','value','format','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','info'];(function(_0x8ce506,_0x517f30){var _0x23c8e5=function(_0x1d048e){while(--_0x1d048e){_0x8ce506['push'](_0x8ce506['shift']());}};_0x23c8e5(++_0x517f30);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x1a127a,_0x42f6e6){_0x1a127a=_0x1a127a-0x0;var _0x2a724b=_0x8ace[_0x1a127a];return _0x2a724b;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var moment=require(_0xe8ac('0x2'));var BPromise=require(_0xe8ac('0x3'));var rs=require(_0xe8ac('0x4'));var fs=require('fs');var Redis=require(_0xe8ac('0x5'));var db=require(_0xe8ac('0x6'))['db'];var utils=require(_0xe8ac('0x7'));var logger=require(_0xe8ac('0x8'))(_0xe8ac('0x9'));var config=require(_0xe8ac('0xa'));var jayson=require(_0xe8ac('0xb'));var client=jayson[_0xe8ac('0xc')][_0xe8ac('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4eb087,_0x2d56f0,_0x1357ed){return new BPromise(function(_0x4f9233,_0x5c83e1){return client[_0xe8ac('0xe')](_0x4eb087,_0x1357ed)['then'](function(_0x1b5467){logger[_0xe8ac('0xf')](_0xe8ac('0x10'),_0x2d56f0,_0xe8ac('0x11'));logger[_0xe8ac('0x12')](_0xe8ac('0x13'),_0x2d56f0,'request\x20sent',JSON[_0xe8ac('0x14')](_0x1b5467));if(_0x1b5467[_0xe8ac('0x15')]){if(_0x1b5467[_0xe8ac('0x15')]['code']===0x1f4){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467['error'][_0xe8ac('0x16')]);return _0x5c83e1(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);return _0x4f9233(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}else{logger[_0xe8ac('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x2d56f0,_0xe8ac('0x11'));_0x4f9233(_0x1b5467[_0xe8ac('0x17')]['message']);}})[_0xe8ac('0x18')](function(_0x3a7939){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x3a7939);_0x5c83e1(_0x3a7939);});});}exports[_0xe8ac('0x19')]=function(_0x36759c){var _0x4892d0=this;return new Promise(function(_0x59df3d,_0x5f3433){return db[_0xe8ac('0x1a')][_0xe8ac('0x1b')](_0x36759c['body'],{'raw':_0x36759c[_0xe8ac('0x1c')]?_0x36759c['options'][_0xe8ac('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36759c[_0xe8ac('0x1c')]?_0x36759c['options'][_0xe8ac('0x1e')]||null:null,'attributes':_0x36759c[_0xe8ac('0x1c')]?_0x36759c[_0xe8ac('0x1c')][_0xe8ac('0x1f')]||null:null,'limit':_0x36759c['options']?_0x36759c[_0xe8ac('0x1c')]['limit']||null:null})[_0xe8ac('0x20')](function(_0x3933d2){logger[_0xe8ac('0xf')](_0xe8ac('0x19'),_0x36759c);logger[_0xe8ac('0x12')](_0xe8ac('0x19'),_0x36759c,JSON[_0xe8ac('0x14')](_0x3933d2));_0x59df3d(_0x3933d2);})['catch'](function(_0x1c3ea4){logger[_0xe8ac('0x15')](_0xe8ac('0x19'),_0x1c3ea4[_0xe8ac('0x16')],_0x36759c);_0x5f3433(_0x4892d0[_0xe8ac('0x15')](0x1f4,_0x1c3ea4[_0xe8ac('0x16')]));});});};exports[_0xe8ac('0x21')]=function(_0x3e3fc2){var _0x44b07c=this;return new Promise(function(_0x562e44,_0x5a1b69){var _0x346dcb=require(_0xe8ac('0x22'));var _0x59512c;return db[_0xe8ac('0x23')][_0xe8ac('0x24')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x1f1e44){_0x59512c=_0x1f1e44;return db[_0xe8ac('0x1a')][_0xe8ac('0x25')](_0x3e3fc2[_0xe8ac('0x26')]);})[_0xe8ac('0x20')](function(_0x41ffe8){if(_0x59512c[_0xe8ac('0x27')]&&fs['existsSync'](_0x41ffe8[_0xe8ac('0x28')])){var _0x5459e5=util[_0xe8ac('0x29')]('%s.cypher',_0x41ffe8['value']);return _0x346dcb['encryptFile'](_0x41ffe8['value'],_0x5459e5,config[_0xe8ac('0x2a')][_0xe8ac('0x2b')])[_0xe8ac('0x20')](function(){fs[_0xe8ac('0x2c')](_0x41ffe8[_0xe8ac('0x28')]);logger[_0xe8ac('0xf')](_0xe8ac('0x2d'));return _0x41ffe8;});}return _0x41ffe8;})['then'](function(_0x1cacb0){logger['info']('CreateVoiceRecording',_0x3e3fc2);logger['debug'](_0xe8ac('0x21'),_0x3e3fc2,JSON[_0xe8ac('0x14')](_0x1cacb0));_0x562e44(_0x1cacb0);})[_0xe8ac('0x18')](function(_0x56feff){logger['error'](_0xe8ac('0x21'),_0x56feff[_0xe8ac('0x16')],_0x3e3fc2);_0x5a1b69(_0x44b07c[_0xe8ac('0x15')](0x1f4,_0x56feff[_0xe8ac('0x16')]));});});}; \ No newline at end of file +var _0x955f=['randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','body','options','raw','where','attributes','limit','debug','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird'];(function(_0x507ec1,_0x11028c){var _0xceb8e=function(_0x1390d7){while(--_0x1390d7){_0x507ec1['push'](_0x507ec1['shift']());}};_0xceb8e(++_0x11028c);}(_0x955f,0x1eb));var _0xf955=function(_0x5b35b1,_0x3d77f0){_0x5b35b1=_0x5b35b1-0x0;var _0xfa9735=_0x955f[_0x5b35b1];return _0xfa9735;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});}exports['UpdateVoiceRecording']=function(_0x5ac6cb){var _0x1e20d1=this;return new Promise(function(_0xe6de5c,_0x3c49c0){return db['VoiceRecording'][_0xf955('0x15')](_0x5ac6cb[_0xf955('0x16')],{'raw':_0x5ac6cb[_0xf955('0x17')]?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ac6cb['options']?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x19')]||null:null,'attributes':_0x5ac6cb[_0xf955('0x17')]?_0x5ac6cb['options'][_0xf955('0x1a')]||null:null,'limit':_0x5ac6cb['options']?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x1b')]||null:null})[_0xf955('0xb')](function(_0xa4ebb4){logger[_0xf955('0xc')]('UpdateVoiceRecording',_0x5ac6cb);logger[_0xf955('0x1c')](_0xf955('0x1d'),_0x5ac6cb,JSON[_0xf955('0x10')](_0xa4ebb4));_0xe6de5c(_0xa4ebb4);})[_0xf955('0x14')](function(_0x17dec2){logger[_0xf955('0x11')](_0xf955('0x1d'),_0x17dec2['message'],_0x5ac6cb);_0x3c49c0(_0x1e20d1[_0xf955('0x11')](0x1f4,_0x17dec2[_0xf955('0x12')]));});});};exports[_0xf955('0x1e')]=function(_0x406632){var _0x2dcd55=this;return new Promise(function(_0x13a86d,_0x3796f7){var _0x51f3ab=require(_0xf955('0x1f'));var _0x145098;return db[_0xf955('0x20')][_0xf955('0x21')]({'attributes':['id',_0xf955('0x22')],'where':{'id':0x1},'raw':!![]})[_0xf955('0xb')](function(_0x4d4af0){_0x145098=_0x4d4af0;return db[_0xf955('0x23')][_0xf955('0x24')](_0x406632['body']);})[_0xf955('0xb')](function(_0x2c8df1){if(_0x145098[_0xf955('0x22')]&&fs[_0xf955('0x25')](_0x2c8df1['value'])){var _0x3a951c=util['format'](_0xf955('0x26'),_0x2c8df1[_0xf955('0x27')]);return _0x51f3ab[_0xf955('0x28')](_0x2c8df1[_0xf955('0x27')],_0x3a951c,config[_0xf955('0x29')][_0xf955('0x2a')])[_0xf955('0xb')](function(){fs[_0xf955('0x2b')](_0x2c8df1['value']);logger[_0xf955('0xc')](_0xf955('0x2c'));return _0x2c8df1;});}return _0x2c8df1;})[_0xf955('0xb')](function(_0x2046c8){logger['info'](_0xf955('0x1e'),_0x406632);logger[_0xf955('0x1c')](_0xf955('0x1e'),_0x406632,JSON[_0xf955('0x10')](_0x2046c8));_0x13a86d(_0x2046c8);})[_0xf955('0x14')](function(_0x4eb2c3){logger['error']('CreateVoiceRecording',_0x4eb2c3[_0xf955('0x12')],_0x406632);_0x3796f7(_0x2dcd55[_0xf955('0x11')](0x1f4,_0x4eb2c3[_0xf955('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 3590b51..ab24b3b 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 _0xda40=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','update','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xda40,0x82));var _0x0da4=function(_0x8ba624,_0x42e30e){_0x8ba624=_0x8ba624-0x0;var _0x43940f=_0xda40[_0x8ba624];return _0x43940f;};'use strict';var multer=require(_0x0da4('0x0'));var util=require('util');var path=require(_0x0da4('0x1'));var timeout=require(_0x0da4('0x2'));var express=require(_0x0da4('0x3'));var router=express['Router']();var fs_extra=require(_0x0da4('0x4'));var auth=require(_0x0da4('0x5'));var interaction=require(_0x0da4('0x6'));var config=require(_0x0da4('0x7'));var controller=require(_0x0da4('0x8'));router[_0x0da4('0x9')]('/',auth[_0x0da4('0xa')](),controller['index']);router['get'](_0x0da4('0xb'),auth[_0x0da4('0xa')](),controller[_0x0da4('0xc')]);router[_0x0da4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0da4('0xd')]);router[_0x0da4('0xe')]('/',auth[_0x0da4('0xa')](),controller['create']);router['put']('/:id',auth[_0x0da4('0xa')](),controller[_0x0da4('0xf')]);router['delete'](_0x0da4('0x10'),auth[_0x0da4('0xa')](),controller[_0x0da4('0x11')]);module[_0x0da4('0x12')]=router; \ No newline at end of file +var _0x6037=['/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x32e688,_0x67ff0b){var _0x17fbe9=function(_0x4a4fb2){while(--_0x4a4fb2){_0x32e688['push'](_0x32e688['shift']());}};_0x17fbe9(++_0x67ff0b);}(_0x6037,0xa9));var _0x7603=function(_0x2e3eee,_0x16f103){_0x2e3eee=_0x2e3eee-0x0;var _0x2cc876=_0x6037[_0x2e3eee];return _0x2cc876;};'use strict';var multer=require(_0x7603('0x0'));var util=require(_0x7603('0x1'));var path=require(_0x7603('0x2'));var timeout=require(_0x7603('0x3'));var express=require(_0x7603('0x4'));var router=express[_0x7603('0x5')]();var fs_extra=require(_0x7603('0x6'));var auth=require(_0x7603('0x7'));var interaction=require(_0x7603('0x8'));var config=require(_0x7603('0x9'));var controller=require(_0x7603('0xa'));router[_0x7603('0xb')]('/',auth[_0x7603('0xc')](),controller[_0x7603('0xd')]);router[_0x7603('0xb')](_0x7603('0xe'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x7603('0xf'),auth[_0x7603('0xc')](),controller['show']);router[_0x7603('0x10')]('/',auth['isAuthenticated'](),controller[_0x7603('0x11')]);router[_0x7603('0x12')](_0x7603('0xf'),auth[_0x7603('0xc')](),controller[_0x7603('0x13')]);router[_0x7603('0x14')](_0x7603('0xf'),auth[_0x7603('0xc')](),controller[_0x7603('0x15')]);module[_0x7603('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index c5b8ed0..5a65cd8 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 _0x1ad6=['STRING','sequelize','moment','exports','ENUM','blind','attended'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1ad6,0x13c));var _0x61ad=function(_0x2ef589,_0x327d97){_0x2ef589=_0x2ef589-0x0;var _0x38d079=_0x1ad6[_0x2ef589];return _0x38d079;};'use strict';var Sequelize=require(_0x61ad('0x0'));var moment=require(_0x61ad('0x1'));module[_0x61ad('0x2')]={'type':{'type':Sequelize[_0x61ad('0x3')](_0x61ad('0x4'),_0x61ad('0x5'))},'result':{'type':Sequelize[_0x61ad('0x6')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x61ad('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x61ad('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x61ad('0x6')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x61ad('0x6')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x61ad('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x61ad('0x6')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x61ad('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x61ad('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x61ad('0x6')]},'transfereecontext':{'type':Sequelize[_0x61ad('0x6')]},'transfereeexten':{'type':Sequelize[_0x61ad('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x61ad('0x6')]},'isexternal':{'type':Sequelize[_0x61ad('0x3')]('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x61ad('0x6')]}}; \ No newline at end of file +var _0x5ee7=['STRING','ENUM','Yes','sequelize','moment','exports','blind'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x5ee7,0xdc));var _0x75ee=function(_0xb35ddf,_0x5af237){_0xb35ddf=_0xb35ddf-0x0;var _0x24db0f=_0x5ee7[_0xb35ddf];return _0x24db0f;};'use strict';var Sequelize=require(_0x75ee('0x0'));var moment=require(_0x75ee('0x1'));module[_0x75ee('0x2')]={'type':{'type':Sequelize['ENUM'](_0x75ee('0x3'),'attended')},'result':{'type':Sequelize[_0x75ee('0x4')]},'transfererchannel':{'type':Sequelize[_0x75ee('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x75ee('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x75ee('0x4')]},'transferercontext':{'type':Sequelize[_0x75ee('0x4')]},'transfererexten':{'type':Sequelize[_0x75ee('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x75ee('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x75ee('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x75ee('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x75ee('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x75ee('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x75ee('0x4')]},'transfereecontext':{'type':Sequelize[_0x75ee('0x4')]},'transfereeexten':{'type':Sequelize[_0x75ee('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x75ee('0x4')]},'isexternal':{'type':Sequelize[_0x75ee('0x5')](_0x75ee('0x6'),'No')},'context':{'type':Sequelize[_0x75ee('0x4')]},'extension':{'type':Sequelize[_0x75ee('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index b0398c9..4597810 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 _0xe041=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','destroy','then','stack','name','send','index','VoiceTransferReport','rawAttributes','type','map','query','keys','filters','intersection','model','attributes','fields','nolimit','sort','pick','filter','where','merge','VIRTUAL','include','rows','catch','show','params','length','includeAll','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe041,0x8f));var _0x1e04=function(_0x4fbbcd,_0x4b2818){_0x4fbbcd=_0x4fbbcd-0x0;var _0x4744a0=_0xe041[_0x4fbbcd];return _0x4744a0;};'use strict';var emlformat=require(_0x1e04('0x0'));var rimraf=require(_0x1e04('0x1'));var zipdir=require(_0x1e04('0x2'));var jsonpatch=require(_0x1e04('0x3'));var rp=require(_0x1e04('0x4'));var moment=require(_0x1e04('0x5'));var BPromise=require(_0x1e04('0x6'));var Mustache=require(_0x1e04('0x7'));var util=require(_0x1e04('0x8'));var path=require(_0x1e04('0x9'));var sox=require(_0x1e04('0xa'));var csv=require(_0x1e04('0xb'));var ejs=require(_0x1e04('0xc'));var fs=require('fs');var fs_extra=require(_0x1e04('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1e04('0xe'));var jsforce=require(_0x1e04('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1e04('0xb'));var querystring=require(_0x1e04('0x10'));var Papa=require('papaparse');var Redis=require(_0x1e04('0x11'));var authService=require(_0x1e04('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1e04('0x13'));var logger=require(_0x1e04('0x14'))(_0x1e04('0x15'));var utils=require(_0x1e04('0x16'));var config=require(_0x1e04('0x17'));var licenseUtil=require(_0x1e04('0x18'));var db=require(_0x1e04('0x19'))['db'];function respondWithStatusCode(_0x10f4fc,_0x436559){_0x436559=_0x436559||0xcc;return function(_0x19300c){if(_0x19300c){return _0x10f4fc[_0x1e04('0x1a')](_0x436559);}return _0x10f4fc[_0x1e04('0x1b')](_0x436559)[_0x1e04('0x1c')]();};}function respondWithResult(_0xc9c25,_0x47c093){_0x47c093=_0x47c093||0xc8;return function(_0x229503){if(_0x229503){return _0xc9c25[_0x1e04('0x1b')](_0x47c093)[_0x1e04('0x1d')](_0x229503);}};}function respondWithFilteredResult(_0x44a3b2,_0x563a20){return function(_0xd2e553){if(_0xd2e553){var _0x327da2=typeof _0x563a20[_0x1e04('0x1e')]==='undefined'&&typeof _0x563a20['limit']==='undefined';var _0x59543c=_0xd2e553[_0x1e04('0x1f')];var _0x2a58b7=_0x327da2?0x0:_0x563a20[_0x1e04('0x1e')];var _0x4d06e2=_0x327da2?_0xd2e553[_0x1e04('0x1f')]:_0x563a20['offset']+_0x563a20[_0x1e04('0x20')];var _0x5daed;if(_0x4d06e2>=_0x59543c){_0x4d06e2=_0x59543c;_0x5daed=0xc8;}else{_0x5daed=0xce;}_0x44a3b2[_0x1e04('0x1b')](_0x5daed);return _0x44a3b2[_0x1e04('0x21')](_0x1e04('0x22'),_0x2a58b7+'-'+_0x4d06e2+'/'+_0x59543c)[_0x1e04('0x1d')](_0xd2e553);}return null;};}function patchUpdates(_0x32bafd){return function(_0x2e6405){try{jsonpatch['apply'](_0x2e6405,_0x32bafd,!![]);}catch(_0x1f978b){return BPromise[_0x1e04('0x23')](_0x1f978b);}return _0x2e6405[_0x1e04('0x24')]();};}function saveUpdates(_0x5d4825,_0x5eba7d){return function(_0x41cb41){if(_0x41cb41){return _0x41cb41['update'](_0x5d4825)['then'](function(_0x516ed6){return _0x516ed6;});}return null;};}function removeEntity(_0xe2db65,_0x43d646){return function(_0x3168de){if(_0x3168de){return _0x3168de[_0x1e04('0x25')]()[_0x1e04('0x26')](function(){_0xe2db65['status'](0xcc)[_0x1e04('0x1c')]();});}};}function handleEntityNotFound(_0x36de2b,_0x4f234f){return function(_0x56e308){if(!_0x56e308){_0x36de2b[_0x1e04('0x1a')](0x194);}return _0x56e308;};}function handleError(_0x404b2d,_0x731f1d){_0x731f1d=_0x731f1d||0x1f4;return function(_0x45450c){logger['error'](_0x45450c[_0x1e04('0x27')]);if(_0x45450c[_0x1e04('0x28')]){delete _0x45450c[_0x1e04('0x28')];}_0x404b2d['status'](_0x731f1d)[_0x1e04('0x29')](_0x45450c);};}exports[_0x1e04('0x2a')]=function(_0xd68cb2,_0x51f2b5){var _0x83175e={},_0x2a2fbe={},_0x42d94e={'count':0x0,'rows':[]};var _0x163751=_['map'](db[_0x1e04('0x2b')][_0x1e04('0x2c')],function(_0x5df3c2){return{'name':_0x5df3c2['fieldName'],'type':_0x5df3c2[_0x1e04('0x2d')]['key']};});_0x2a2fbe['model']=_[_0x1e04('0x2e')](_0x163751,_0x1e04('0x28'));_0x2a2fbe[_0x1e04('0x2f')]=_[_0x1e04('0x30')](_0xd68cb2[_0x1e04('0x2f')]);_0x2a2fbe[_0x1e04('0x31')]=_[_0x1e04('0x32')](_0x2a2fbe[_0x1e04('0x33')],_0x2a2fbe[_0x1e04('0x2f')]);_0x83175e[_0x1e04('0x34')]=_[_0x1e04('0x32')](_0x2a2fbe[_0x1e04('0x33')],qs[_0x1e04('0x35')](_0xd68cb2[_0x1e04('0x2f')][_0x1e04('0x35')]));_0x83175e['attributes']=_0x83175e['attributes']['length']?_0x83175e[_0x1e04('0x34')]:_0x2a2fbe[_0x1e04('0x33')];if(!_0xd68cb2['query']['hasOwnProperty'](_0x1e04('0x36'))){_0x83175e['limit']=qs[_0x1e04('0x20')](_0xd68cb2[_0x1e04('0x2f')][_0x1e04('0x20')]);_0x83175e[_0x1e04('0x1e')]=qs['offset'](_0xd68cb2[_0x1e04('0x2f')][_0x1e04('0x1e')]);}_0x83175e['order']=qs[_0x1e04('0x37')](_0xd68cb2[_0x1e04('0x2f')][_0x1e04('0x37')]);_0x83175e['where']=qs['filters'](_[_0x1e04('0x38')](_0xd68cb2['query'],_0x2a2fbe[_0x1e04('0x31')]),_0x163751);if(_0xd68cb2[_0x1e04('0x2f')][_0x1e04('0x39')]){_0x83175e[_0x1e04('0x3a')]=_[_0x1e04('0x3b')](_0x83175e['where'],{'$or':_['map'](_0x163751,function(_0x4038d8){if(_0x4038d8[_0x1e04('0x2d')]!==_0x1e04('0x3c')){var _0x21ba28={};_0x21ba28[_0x4038d8[_0x1e04('0x28')]]={'$like':'%'+_0xd68cb2[_0x1e04('0x2f')][_0x1e04('0x39')]+'%'};return _0x21ba28;}})});}_0x83175e=_[_0x1e04('0x3b')]({},_0x83175e,_0xd68cb2['options']);var _0x33a9d1={'where':_0x83175e['where']};return db[_0x1e04('0x2b')][_0x1e04('0x1f')](_0x33a9d1)['then'](function(_0x4a2c9e){_0x42d94e['count']=_0x4a2c9e;if(_0xd68cb2['query']['includeAll']){_0x83175e[_0x1e04('0x3d')]=[{'all':!![]}];}return db[_0x1e04('0x2b')]['findAll'](_0x83175e);})['then'](function(_0xdad685){_0x42d94e[_0x1e04('0x3e')]=_0xdad685;return _0x42d94e;})[_0x1e04('0x26')](respondWithFilteredResult(_0x51f2b5,_0x83175e))[_0x1e04('0x3f')](handleError(_0x51f2b5,null));};exports[_0x1e04('0x40')]=function(_0x142f76,_0x1fe71e){var _0x497474={'raw':!![],'where':{'id':_0x142f76[_0x1e04('0x41')]['id']}},_0x35b73d={};_0x35b73d[_0x1e04('0x33')]=_[_0x1e04('0x30')](db[_0x1e04('0x2b')][_0x1e04('0x2c')]);_0x35b73d[_0x1e04('0x2f')]=_[_0x1e04('0x30')](_0x142f76[_0x1e04('0x2f')]);_0x35b73d[_0x1e04('0x31')]=_[_0x1e04('0x32')](_0x35b73d[_0x1e04('0x33')],_0x35b73d[_0x1e04('0x2f')]);_0x497474['attributes']=_[_0x1e04('0x32')](_0x35b73d[_0x1e04('0x33')],qs[_0x1e04('0x35')](_0x142f76[_0x1e04('0x2f')][_0x1e04('0x35')]));_0x497474[_0x1e04('0x34')]=_0x497474['attributes'][_0x1e04('0x42')]?_0x497474[_0x1e04('0x34')]:_0x35b73d[_0x1e04('0x33')];if(_0x142f76[_0x1e04('0x2f')][_0x1e04('0x43')]){_0x497474[_0x1e04('0x3d')]=[{'all':!![]}];}_0x497474=_['merge']({},_0x497474,_0x142f76[_0x1e04('0x44')]);return db[_0x1e04('0x2b')][_0x1e04('0x45')](_0x497474)[_0x1e04('0x26')](handleEntityNotFound(_0x1fe71e,null))[_0x1e04('0x26')](respondWithResult(_0x1fe71e,null))['catch'](handleError(_0x1fe71e,null));};exports[_0x1e04('0x46')]=function(_0x5bb1f6,_0x1bf66b){return db[_0x1e04('0x2b')][_0x1e04('0x46')](_0x5bb1f6[_0x1e04('0x47')],{})['then'](respondWithResult(_0x1bf66b,0xc9))[_0x1e04('0x3f')](handleError(_0x1bf66b,null));};exports[_0x1e04('0x48')]=function(_0x3d9c06,_0x50e604){if(_0x3d9c06[_0x1e04('0x47')]['id']){delete _0x3d9c06['body']['id'];}return db[_0x1e04('0x2b')][_0x1e04('0x45')]({'where':{'id':_0x3d9c06['params']['id']}})[_0x1e04('0x26')](handleEntityNotFound(_0x50e604,null))[_0x1e04('0x26')](saveUpdates(_0x3d9c06[_0x1e04('0x47')],null))[_0x1e04('0x26')](respondWithResult(_0x50e604,null))[_0x1e04('0x3f')](handleError(_0x50e604,null));};exports[_0x1e04('0x25')]=function(_0x334711,_0x803ed7){return db['VoiceTransferReport']['find']({'where':{'id':_0x334711[_0x1e04('0x41')]['id']}})['then'](handleEntityNotFound(_0x803ed7,null))[_0x1e04('0x26')](removeEntity(_0x803ed7,null))[_0x1e04('0x3f')](handleError(_0x803ed7,null));};exports[_0x1e04('0x49')]=function(_0x425e62,_0x27ffa9){return db[_0x1e04('0x2b')][_0x1e04('0x49')]()[_0x1e04('0x26')](respondWithResult(_0x27ffa9,null))[_0x1e04('0x3f')](handleError(_0x27ffa9,null));}; \ No newline at end of file +var _0x6b97=['json','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','destroy','describe','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range'];(function(_0x442974,_0x3fff39){var _0x292c9c=function(_0x33eda1){while(--_0x33eda1){_0x442974['push'](_0x442974['shift']());}};_0x292c9c(++_0x3fff39);}(_0x6b97,0x159));var _0x76b9=function(_0x281c3d,_0x39e39e){_0x281c3d=_0x281c3d-0x0;var _0x1e008d=_0x6b97[_0x281c3d];return _0x1e008d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x76b9('0x0'));var zipdir=require(_0x76b9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x76b9('0x2'));var BPromise=require(_0x76b9('0x3'));var Mustache=require(_0x76b9('0x4'));var util=require(_0x76b9('0x5'));var path=require(_0x76b9('0x6'));var sox=require(_0x76b9('0x7'));var csv=require(_0x76b9('0x8'));var ejs=require(_0x76b9('0x9'));var fs=require('fs');var fs_extra=require(_0x76b9('0xa'));var _=require(_0x76b9('0xb'));var squel=require('squel');var crypto=require(_0x76b9('0xc'));var jsforce=require(_0x76b9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x76b9('0xe'));var Papa=require('papaparse');var Redis=require(_0x76b9('0xf'));var authService=require(_0x76b9('0x10'));var qs=require(_0x76b9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76b9('0x12'));var logger=require(_0x76b9('0x13'))('api');var utils=require(_0x76b9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x76b9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x526731,_0x31f5cc){_0x31f5cc=_0x31f5cc||0xcc;return function(_0x1f61ed){if(_0x1f61ed){return _0x526731[_0x76b9('0x16')](_0x31f5cc);}return _0x526731[_0x76b9('0x17')](_0x31f5cc)[_0x76b9('0x18')]();};}function respondWithResult(_0x20d3e2,_0x32e1ac){_0x32e1ac=_0x32e1ac||0xc8;return function(_0x3587a7){if(_0x3587a7){return _0x20d3e2[_0x76b9('0x17')](_0x32e1ac)['json'](_0x3587a7);}};}function respondWithFilteredResult(_0x307db5,_0x3fa966){return function(_0xb05db3){if(_0xb05db3){var _0x4655d6=typeof _0x3fa966[_0x76b9('0x19')]===_0x76b9('0x1a')&&typeof _0x3fa966[_0x76b9('0x1b')]===_0x76b9('0x1a');var _0x191127=_0xb05db3[_0x76b9('0x1c')];var _0x39cd65=_0x4655d6?0x0:_0x3fa966[_0x76b9('0x19')];var _0x5c2774=_0x4655d6?_0xb05db3[_0x76b9('0x1c')]:_0x3fa966[_0x76b9('0x19')]+_0x3fa966[_0x76b9('0x1b')];var _0x4c57ee;if(_0x5c2774>=_0x191127){_0x5c2774=_0x191127;_0x4c57ee=0xc8;}else{_0x4c57ee=0xce;}_0x307db5[_0x76b9('0x17')](_0x4c57ee);return _0x307db5['set'](_0x76b9('0x1d'),_0x39cd65+'-'+_0x5c2774+'/'+_0x191127)[_0x76b9('0x1e')](_0xb05db3);}return null;};}function patchUpdates(_0xe4dd11){return function(_0x385889){try{jsonpatch[_0x76b9('0x1f')](_0x385889,_0xe4dd11,!![]);}catch(_0x422a36){return BPromise[_0x76b9('0x20')](_0x422a36);}return _0x385889[_0x76b9('0x21')]();};}function saveUpdates(_0x48b672,_0x367f63){return function(_0x579485){if(_0x579485){return _0x579485[_0x76b9('0x22')](_0x48b672)[_0x76b9('0x23')](function(_0x217784){return _0x217784;});}return null;};}function removeEntity(_0x28f8eb,_0x36b93c){return function(_0xa95017){if(_0xa95017){return _0xa95017['destroy']()['then'](function(){_0x28f8eb[_0x76b9('0x17')](0xcc)[_0x76b9('0x18')]();});}};}function handleEntityNotFound(_0x1f3660,_0x5e2d0e){return function(_0x595428){if(!_0x595428){_0x1f3660[_0x76b9('0x16')](0x194);}return _0x595428;};}function handleError(_0x215577,_0x13460b){_0x13460b=_0x13460b||0x1f4;return function(_0x1f0577){logger[_0x76b9('0x24')](_0x1f0577[_0x76b9('0x25')]);if(_0x1f0577[_0x76b9('0x26')]){delete _0x1f0577['name'];}_0x215577[_0x76b9('0x17')](_0x13460b)[_0x76b9('0x27')](_0x1f0577);};}exports[_0x76b9('0x28')]=function(_0x3ec23b,_0x2fbb54){var _0xc50619={},_0xfda5ec={},_0x1aee54={'count':0x0,'rows':[]};var _0x8f3282=_[_0x76b9('0x29')](db[_0x76b9('0x2a')]['rawAttributes'],function(_0x2b8899){return{'name':_0x2b8899[_0x76b9('0x2b')],'type':_0x2b8899[_0x76b9('0x2c')][_0x76b9('0x2d')]};});_0xfda5ec[_0x76b9('0x2e')]=_[_0x76b9('0x29')](_0x8f3282,_0x76b9('0x26'));_0xfda5ec[_0x76b9('0x2f')]=_[_0x76b9('0x30')](_0x3ec23b[_0x76b9('0x2f')]);_0xfda5ec[_0x76b9('0x31')]=_[_0x76b9('0x32')](_0xfda5ec[_0x76b9('0x2e')],_0xfda5ec['query']);_0xc50619[_0x76b9('0x33')]=_[_0x76b9('0x32')](_0xfda5ec[_0x76b9('0x2e')],qs[_0x76b9('0x34')](_0x3ec23b[_0x76b9('0x2f')][_0x76b9('0x34')]));_0xc50619['attributes']=_0xc50619[_0x76b9('0x33')]['length']?_0xc50619[_0x76b9('0x33')]:_0xfda5ec[_0x76b9('0x2e')];if(!_0x3ec23b[_0x76b9('0x2f')][_0x76b9('0x35')](_0x76b9('0x36'))){_0xc50619[_0x76b9('0x1b')]=qs['limit'](_0x3ec23b[_0x76b9('0x2f')][_0x76b9('0x1b')]);_0xc50619[_0x76b9('0x19')]=qs['offset'](_0x3ec23b[_0x76b9('0x2f')][_0x76b9('0x19')]);}_0xc50619['order']=qs[_0x76b9('0x37')](_0x3ec23b[_0x76b9('0x2f')][_0x76b9('0x37')]);_0xc50619[_0x76b9('0x38')]=qs[_0x76b9('0x31')](_['pick'](_0x3ec23b['query'],_0xfda5ec[_0x76b9('0x31')]),_0x8f3282);if(_0x3ec23b[_0x76b9('0x2f')]['filter']){_0xc50619['where']=_['merge'](_0xc50619[_0x76b9('0x38')],{'$or':_['map'](_0x8f3282,function(_0x39c9f8){if(_0x39c9f8['type']!==_0x76b9('0x39')){var _0x2f83ff={};_0x2f83ff[_0x39c9f8['name']]={'$like':'%'+_0x3ec23b[_0x76b9('0x2f')][_0x76b9('0x3a')]+'%'};return _0x2f83ff;}})});}_0xc50619=_[_0x76b9('0x3b')]({},_0xc50619,_0x3ec23b[_0x76b9('0x3c')]);var _0x1663aa={'where':_0xc50619['where']};return db['VoiceTransferReport'][_0x76b9('0x1c')](_0x1663aa)[_0x76b9('0x23')](function(_0xcc76dc){_0x1aee54[_0x76b9('0x1c')]=_0xcc76dc;if(_0x3ec23b['query'][_0x76b9('0x3d')]){_0xc50619['include']=[{'all':!![]}];}return db[_0x76b9('0x2a')][_0x76b9('0x3e')](_0xc50619);})['then'](function(_0x72df7a){_0x1aee54[_0x76b9('0x3f')]=_0x72df7a;return _0x1aee54;})[_0x76b9('0x23')](respondWithFilteredResult(_0x2fbb54,_0xc50619))[_0x76b9('0x40')](handleError(_0x2fbb54,null));};exports[_0x76b9('0x41')]=function(_0x124a1e,_0x2fef60){var _0x140e7a={'raw':!![],'where':{'id':_0x124a1e[_0x76b9('0x42')]['id']}},_0x1b835d={};_0x1b835d[_0x76b9('0x2e')]=_[_0x76b9('0x30')](db[_0x76b9('0x2a')][_0x76b9('0x43')]);_0x1b835d[_0x76b9('0x2f')]=_['keys'](_0x124a1e[_0x76b9('0x2f')]);_0x1b835d[_0x76b9('0x31')]=_[_0x76b9('0x32')](_0x1b835d['model'],_0x1b835d[_0x76b9('0x2f')]);_0x140e7a[_0x76b9('0x33')]=_[_0x76b9('0x32')](_0x1b835d['model'],qs[_0x76b9('0x34')](_0x124a1e[_0x76b9('0x2f')][_0x76b9('0x34')]));_0x140e7a[_0x76b9('0x33')]=_0x140e7a[_0x76b9('0x33')][_0x76b9('0x44')]?_0x140e7a[_0x76b9('0x33')]:_0x1b835d[_0x76b9('0x2e')];if(_0x124a1e[_0x76b9('0x2f')][_0x76b9('0x3d')]){_0x140e7a[_0x76b9('0x45')]=[{'all':!![]}];}_0x140e7a=_[_0x76b9('0x3b')]({},_0x140e7a,_0x124a1e[_0x76b9('0x3c')]);return db[_0x76b9('0x2a')][_0x76b9('0x46')](_0x140e7a)[_0x76b9('0x23')](handleEntityNotFound(_0x2fef60,null))[_0x76b9('0x23')](respondWithResult(_0x2fef60,null))['catch'](handleError(_0x2fef60,null));};exports[_0x76b9('0x47')]=function(_0x2f6183,_0x2aac25){return db['VoiceTransferReport']['create'](_0x2f6183['body'],{})[_0x76b9('0x23')](respondWithResult(_0x2aac25,0xc9))[_0x76b9('0x40')](handleError(_0x2aac25,null));};exports[_0x76b9('0x22')]=function(_0x1be93b,_0x41de40){if(_0x1be93b[_0x76b9('0x48')]['id']){delete _0x1be93b[_0x76b9('0x48')]['id'];}return db[_0x76b9('0x2a')][_0x76b9('0x46')]({'where':{'id':_0x1be93b[_0x76b9('0x42')]['id']}})[_0x76b9('0x23')](handleEntityNotFound(_0x41de40,null))['then'](saveUpdates(_0x1be93b[_0x76b9('0x48')],null))[_0x76b9('0x23')](respondWithResult(_0x41de40,null))[_0x76b9('0x40')](handleError(_0x41de40,null));};exports[_0x76b9('0x49')]=function(_0x4a44c9,_0x123115){return db[_0x76b9('0x2a')][_0x76b9('0x46')]({'where':{'id':_0x4a44c9[_0x76b9('0x42')]['id']}})[_0x76b9('0x23')](handleEntityNotFound(_0x123115,null))[_0x76b9('0x23')](removeEntity(_0x123115,null))[_0x76b9('0x40')](handleError(_0x123115,null));};exports[_0x76b9('0x4a')]=function(_0x564455,_0x6d23fc){return db[_0x76b9('0x2a')]['describe']()['then'](respondWithResult(_0x6d23fc,null))['catch'](handleError(_0x6d23fc,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index f0bf818..a220d0a 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 _0xa546=['rimraf','../../config/environment','exports','VoiceTransferReport','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa546,0x143));var _0x6a54=function(_0x345441,_0xb0d04c){_0x345441=_0x345441-0x0;var _0x23690c=_0xa546[_0x345441];return _0x23690c;};'use strict';var _=require(_0x6a54('0x0'));var util=require(_0x6a54('0x1'));var logger=require('../../config/logger')(_0x6a54('0x2'));var moment=require(_0x6a54('0x3'));var BPromise=require(_0x6a54('0x4'));var rp=require(_0x6a54('0x5'));var fs=require('fs');var path=require(_0x6a54('0x6'));var rimraf=require(_0x6a54('0x7'));var config=require(_0x6a54('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0x6a54('0x9')]=function(_0x5e3941,_0x6c5c16){return _0x5e3941['define'](_0x6a54('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf56=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','report_call_transfer'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0xbf56,0x13b));var _0x6bf5=function(_0x3bcabf,_0x92b1ac){_0x3bcabf=_0x3bcabf-0x0;var _0x24b95a=_0xbf56[_0x3bcabf];return _0x24b95a;};'use strict';var _=require(_0x6bf5('0x0'));var util=require('util');var logger=require(_0x6bf5('0x1'))('api');var moment=require(_0x6bf5('0x2'));var BPromise=require(_0x6bf5('0x3'));var rp=require(_0x6bf5('0x4'));var fs=require('fs');var path=require(_0x6bf5('0x5'));var rimraf=require(_0x6bf5('0x6'));var config=require('../../config/environment');var attributes=require('./voiceTransferReport.attributes');module[_0x6bf5('0x7')]=function(_0xc32416,_0x3f9e04){return _0xc32416['define']('VoiceTransferReport',attributes,{'tableName':_0x6bf5('0x8'),'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 b1f7590..fe04bb6 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 _0xfae5=['request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','catch','options','raw','CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xfae5,0x161));var _0x5fae=function(_0x169dc2,_0x1a2492){_0x169dc2=_0x169dc2-0x0;var _0x2956a6=_0xfae5[_0x169dc2];return _0x2956a6;};'use strict';var _=require(_0x5fae('0x0'));var util=require(_0x5fae('0x1'));var moment=require(_0x5fae('0x2'));var BPromise=require(_0x5fae('0x3'));var rs=require(_0x5fae('0x4'));var fs=require('fs');var Redis=require(_0x5fae('0x5'));var db=require(_0x5fae('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5fae('0x7'));var config=require(_0x5fae('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5fae('0x9')][_0x5fae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f1b55,_0x1afb43,_0x1345ac){return new BPromise(function(_0x29882d,_0x22a2a1){return client[_0x5fae('0xb')](_0x3f1b55,_0x1345ac)[_0x5fae('0xc')](function(_0xac3c47){logger[_0x5fae('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x1afb43,_0x5fae('0xe'));logger[_0x5fae('0xf')](_0x5fae('0x10'),_0x1afb43,_0x5fae('0xe'),JSON[_0x5fae('0x11')](_0xac3c47));if(_0xac3c47[_0x5fae('0x12')]){if(_0xac3c47['error'][_0x5fae('0x13')]===0x1f4){logger[_0x5fae('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x1afb43,_0xac3c47['error'][_0x5fae('0x14')]);return _0x22a2a1(_0xac3c47[_0x5fae('0x12')]['message']);}logger['error'](_0x5fae('0x15'),_0x1afb43,_0xac3c47[_0x5fae('0x12')]['message']);return _0x29882d(_0xac3c47[_0x5fae('0x12')][_0x5fae('0x14')]);}else{logger[_0x5fae('0xd')](_0x5fae('0x15'),_0x1afb43,_0x5fae('0xe'));_0x29882d(_0xac3c47['result'][_0x5fae('0x14')]);}})[_0x5fae('0x16')](function(_0x568ba6){logger[_0x5fae('0x12')](_0x5fae('0x15'),_0x1afb43,_0x568ba6);_0x22a2a1(_0x568ba6);});});}exports['CreateVoiceTransferReport']=function(_0x15f59d){var _0xb44fe1=this;return new Promise(function(_0x5a7f83,_0x27a2b0){return db['VoiceTransferReport']['create'](_0x15f59d['body'],{'raw':_0x15f59d['options']?_0x15f59d[_0x5fae('0x17')][_0x5fae('0x18')]===undefined?!![]:![]:!![]})[_0x5fae('0xc')](function(_0x5d7072){logger['info']('CreateVoiceTransferReport',_0x15f59d);logger[_0x5fae('0xf')](_0x5fae('0x19'),_0x15f59d,JSON[_0x5fae('0x11')](_0x5d7072));_0x5a7f83(_0x5d7072);})[_0x5fae('0x16')](function(_0x1a1148){logger['error']('CreateVoiceTransferReport',_0x1a1148[_0x5fae('0x14')],_0x15f59d);_0x27a2b0(_0xb44fe1['error'](0x1f4,_0x1a1148['message']));});});}; \ No newline at end of file +var _0x4fd3=['jayson/promise','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5a9796,_0x529d4e){var _0x1e0f0c=function(_0x1a1585){while(--_0x1a1585){_0x5a9796['push'](_0x5a9796['shift']());}};_0x1e0f0c(++_0x529d4e);}(_0x4fd3,0xfc));var _0x34fd=function(_0x7c69ad,_0x2a1083){_0x7c69ad=_0x7c69ad-0x0;var _0x111d8e=_0x4fd3[_0x7c69ad];return _0x111d8e;};'use strict';var _=require(_0x34fd('0x0'));var util=require('util');var moment=require(_0x34fd('0x1'));var BPromise=require(_0x34fd('0x2'));var rs=require(_0x34fd('0x3'));var fs=require('fs');var Redis=require(_0x34fd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34fd('0x5'));var logger=require(_0x34fd('0x6'))(_0x34fd('0x7'));var config=require(_0x34fd('0x8'));var jayson=require(_0x34fd('0x9'));var client=jayson['client'][_0x34fd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c1786,_0x28a65f,_0x29c0cb){return new BPromise(function(_0x1dcd75,_0x485203){return client[_0x34fd('0xb')](_0x5c1786,_0x29c0cb)['then'](function(_0x3df66b){logger[_0x34fd('0xc')](_0x34fd('0xd'),_0x28a65f,_0x34fd('0xe'));logger[_0x34fd('0xf')](_0x34fd('0x10'),_0x28a65f,_0x34fd('0xe'),JSON[_0x34fd('0x11')](_0x3df66b));if(_0x3df66b[_0x34fd('0x12')]){if(_0x3df66b['error'][_0x34fd('0x13')]===0x1f4){logger[_0x34fd('0x12')](_0x34fd('0xd'),_0x28a65f,_0x3df66b[_0x34fd('0x12')]['message']);return _0x485203(_0x3df66b[_0x34fd('0x12')][_0x34fd('0x14')]);}logger['error'](_0x34fd('0xd'),_0x28a65f,_0x3df66b[_0x34fd('0x12')][_0x34fd('0x14')]);return _0x1dcd75(_0x3df66b['error'][_0x34fd('0x14')]);}else{logger[_0x34fd('0xc')](_0x34fd('0xd'),_0x28a65f,'request\x20sent');_0x1dcd75(_0x3df66b[_0x34fd('0x15')][_0x34fd('0x14')]);}})[_0x34fd('0x16')](function(_0x2da2d1){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x28a65f,_0x2da2d1);_0x485203(_0x2da2d1);});});}exports['CreateVoiceTransferReport']=function(_0x276818){var _0x27677c=this;return new Promise(function(_0x5e8b45,_0xe196fa){return db[_0x34fd('0x17')][_0x34fd('0x18')](_0x276818[_0x34fd('0x19')],{'raw':_0x276818[_0x34fd('0x1a')]?_0x276818[_0x34fd('0x1a')][_0x34fd('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3d361d){logger[_0x34fd('0xc')](_0x34fd('0x1c'),_0x276818);logger[_0x34fd('0xf')]('CreateVoiceTransferReport',_0x276818,JSON[_0x34fd('0x11')](_0x3d361d));_0x5e8b45(_0x3d361d);})['catch'](function(_0x54cf9a){logger[_0x34fd('0x12')](_0x34fd('0x1c'),_0x54cf9a[_0x34fd('0x14')],_0x276818);_0xe196fa(_0x27677c[_0x34fd('0x12')](0x1f4,_0x54cf9a[_0x34fd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 53e7420..d0a6551 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 _0xe5b3=['transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer'];(function(_0x3c9131,_0x10250b){var _0x648b68=function(_0x48f0f2){while(--_0x48f0f2){_0x3c9131['push'](_0x3c9131['shift']());}};_0x648b68(++_0x10250b);}(_0xe5b3,0x133));var _0x3e5b=function(_0x37dc1d,_0xbf91ef){_0x37dc1d=_0x37dc1d-0x0;var _0x4ac931=_0xe5b3[_0x37dc1d];return _0x4ac931;};'use strict';var express=require('express');var router=express[_0x3e5b('0x0')]();var auth=require(_0x3e5b('0x1'));var controller=require(_0x3e5b('0x2'));router[_0x3e5b('0x3')](_0x3e5b('0x4'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0x7')]);router[_0x3e5b('0x3')](_0x3e5b('0x8'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x9')]);router[_0x3e5b('0x3')]('/answer',auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xa')]);router[_0x3e5b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0x3')](_0x3e5b('0xc'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0xd')]);router['post'](_0x3e5b('0xe'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xf')]);router[_0x3e5b('0x3')](_0x3e5b('0x10'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5b02=['Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','isWebrtcLicence','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0xd22e8c,_0x2b20b7){var _0x46f513=function(_0x5540ff){while(--_0x5540ff){_0xd22e8c['push'](_0xd22e8c['shift']());}};_0x46f513(++_0x2b20b7);}(_0x5b02,0xe9));var _0x25b0=function(_0x1d3988,_0x5d2b64){_0x1d3988=_0x1d3988-0x0;var _0x1133f4=_0x5b02[_0x1d3988];return _0x1133f4;};'use strict';var express=require(_0x25b0('0x0'));var router=express[_0x25b0('0x1')]();var auth=require(_0x25b0('0x2'));var controller=require(_0x25b0('0x3'));router['post']('/originate',auth[_0x25b0('0x4')](),auth['isWebrtcLicence'](),controller[_0x25b0('0x5')]);router[_0x25b0('0x6')](_0x25b0('0x7'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hangup']);router[_0x25b0('0x6')](_0x25b0('0x9'),auth['isAuthenticated'](),auth[_0x25b0('0x8')](),controller['answer']);router['post'](_0x25b0('0xa'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hold']);router[_0x25b0('0x6')](_0x25b0('0xb'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x6')](_0x25b0('0xd'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xe')]);router[_0x25b0('0x6')](_0x25b0('0xf'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0x10')]);module[_0x25b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 0c7dd51..3cdbf33 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 _0x867f=['lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','ioredis','redis','defaults','localhost','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','info','emit','error','name','status','send','NotFound','request','code','message','result','catch','User','findOne','agent','then','VoiceChannels','all','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','body','json','callNumber','callerId','callbackUrl','entityFound:','user:%s','webbar:originate','hangup\x20fired:','userId','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','rows','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transfer\x20executed!','path'];(function(_0x2825ca,_0x3a5a02){var _0x15f3b2=function(_0x3de5d5){while(--_0x3de5d5){_0x2825ca['push'](_0x2825ca['shift']());}};_0x15f3b2(++_0x3a5a02);}(_0x867f,0xe6));var _0xf867=function(_0xdf5fc5,_0x37255b){_0xdf5fc5=_0xdf5fc5-0x0;var _0x52f5a5=_0x867f[_0xdf5fc5];return _0x52f5a5;};'use strict';var path=require(_0xf867('0x0'));var fs=require('fs');var _=require(_0xf867('0x1'));var db=require(_0xf867('0x2'))['db'];var config=require(_0xf867('0x3'));var util=require(_0xf867('0x4'));var BPromise=require(_0xf867('0x5'));var jayson=require(_0xf867('0x6'));var amiClient=jayson[_0xf867('0x7')][_0xf867('0x8')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0xf867('0x9'));config[_0xf867('0xa')]=_[_0xf867('0xb')](config[_0xf867('0xa')],{'host':_0xf867('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0xf867('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf867('0xe')]},'callNumber':{'type':_0xf867('0xf'),'required':[!![],_0xf867('0x10')]},'callerId':{'type':_0xf867('0xf')},'callbackUrl':{'type':_0xf867('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xf867('0x11'),'required':[!![],_0xf867('0xe')]},'sessionId':{'type':_0xf867('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf867('0xe')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf867('0xe')]},'sessionId':{'type':_0xf867('0xf'),'required':[!![],_0xf867('0x12')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xf867('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf867('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf867('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf867('0x11'),'required':[!![],_0xf867('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xf867('0x11'),'required':[!![],_0xf867('0xe')]}});function emit(_0x1e5161,_0x1b02e5,_0x3e8442){logger[_0xf867('0x13')](_0x1e5161,_0x1b02e5,JSON['stringify'](_0x3e8442));io['to'](_0x1e5161)[_0xf867('0x14')](_0x1b02e5,_0x3e8442);}function handleError(_0x5c844e){return function(_0x39f9e8){console['log']('handleError:',_0x39f9e8,_0x39f9e8 instanceof RangeError);logger[_0xf867('0x15')](_0x39f9e8['stack']);if(_0x39f9e8 instanceof RangeError){if(_0x39f9e8['name']){delete _0x39f9e8[_0xf867('0x16')];}_0x5c844e[_0xf867('0x17')](0x194)['send'](_0x39f9e8);}else{if(_0x39f9e8['name']){delete _0x39f9e8[_0xf867('0x16')];}_0x5c844e[_0xf867('0x17')](0x1f4)[_0xf867('0x18')](_0x39f9e8);}};}function checkError(){return function(_0x44b097){if(!_0x44b097){throw new RangeError(_0xf867('0x19'));}return _0x44b097;};}function respondWithRpcPromise(_0xadcb1,_0x3430ad){return new BPromise(function(_0x34db74,_0x586a25){var _0x568aba=amiClient;return _0x568aba[_0xf867('0x1a')](_0xadcb1,_0x3430ad)['then'](function(_0x3072b7){if(_0x3072b7[_0xf867('0x15')]){if(_0x3072b7['error'][_0xf867('0x1b')]===0x1f4){return _0x586a25(_0x3072b7[_0xf867('0x15')]['message']);}return _0x34db74(_0x3072b7[_0xf867('0x15')][_0xf867('0x1c')]);}else{_0x34db74(_0x3072b7[_0xf867('0x1d')]);}})[_0xf867('0x1e')](function(_0x58bded){_0x586a25(_0x58bded);});});}function getAgent(_0x78e8c5){return db[_0xf867('0x1f')][_0xf867('0x20')]({'where':{'id':_0x78e8c5,'role':_0xf867('0x21')}})[_0xf867('0x22')](checkError());}function getAgentCheckSession(_0x28b44a,_0x1f8aa1){return new BPromise(function(_0xa40271,_0x234fa0){var _0x327a13=respondWithRpcPromise(_0xf867('0x23'));var _0x57bf28=getAgent(_0x28b44a);Promise[_0xf867('0x24')]([_0x327a13,_0x57bf28])[_0xf867('0x22')](function(_0x39218a){var _0xb0dcdd=_0x39218a[0x0];var _0x350d6d=_0x39218a[0x1];var _0x2678c9=_[_0xf867('0x25')](_0xb0dcdd['rows'],function(_0x44ddd4){return _0x44ddd4[_0xf867('0x26')]==_0x350d6d['id']&&_0x44ddd4[_0xf867('0x27')]==_0x1f8aa1;});if(_0x2678c9[_0xf867('0x28')]==0x1){_0xa40271(_0x350d6d);}else{_0x234fa0(new RangeError(_0xf867('0x29')+_0x1f8aa1+_0xf867('0x2a')));}});});}exports[_0xf867('0x2b')]=function(_0x450f09,_0x4ffce9){logger[_0xf867('0x13')]('originate\x20fired:',_0x450f09[_0xf867('0x2c')]);var _0x481c50=originateValidation[_0xf867('0xd')](_0x450f09[_0xf867('0x2c')]);if(_0x481c50[_0xf867('0x28')]>0x0){return _0x4ffce9['status'](0x190)[_0xf867('0x2d')](_0x481c50);}var _0x19aae4=_0x450f09['body']['userId'];var _0xc1f9ce=_0x450f09['body'][_0xf867('0x2e')];var _0x13e028=_0x450f09[_0xf867('0x2c')][_0xf867('0x2f')];var _0x5ba0af=_0x450f09['body'][_0xf867('0x30')];return getAgent(_0x19aae4)[_0xf867('0x22')](function(_0x2bad0e){logger['info'](_0xf867('0x31'),_0x2bad0e[_0xf867('0x16')]);emit(util['format'](_0xf867('0x32'),_0x2bad0e['name']),_0xf867('0x33'),{'callNumber':_0xc1f9ce,'callerId':_0x13e028,'callbackUrl':_0x5ba0af});return _0x4ffce9[_0xf867('0x17')](0xc8)[_0xf867('0x2d')]({'error':![],'message':'originate\x20executed!'});})[_0xf867('0x1e')](handleError(_0x4ffce9));};exports['hangup']=function(_0x2282ca,_0x2b4ac9){logger[_0xf867('0x13')](_0xf867('0x34'),_0x2282ca[_0xf867('0x2c')]);var _0x290619=hangupValidation[_0xf867('0xd')](_0x2282ca[_0xf867('0x2c')]);if(_0x290619['length']>0x0){return _0x2b4ac9['status'](0x190)[_0xf867('0x2d')](_0x290619);}var _0x1e1074=_0x2282ca[_0xf867('0x2c')][_0xf867('0x35')];var _0x12d7dd=_0x2282ca[_0xf867('0x2c')][_0xf867('0x27')];return getAgent(_0x1e1074)['then'](function(_0x4513e1){logger[_0xf867('0x13')](_0xf867('0x31'),_0x4513e1[_0xf867('0x16')]);emit(util[_0xf867('0x36')](_0xf867('0x32'),_0x4513e1[_0xf867('0x16')]),_0xf867('0x37'),{'sessionId':_0x12d7dd});return _0x2b4ac9[_0xf867('0x17')](0xc8)['json']({'error':![],'message':_0xf867('0x38')});})['catch'](handleError(_0x2b4ac9));};exports[_0xf867('0x39')]=function(_0x3f7394,_0x24f50){logger['info'](_0xf867('0x3a'),_0x3f7394[_0xf867('0x2c')]);var _0x27421a=answerValidation[_0xf867('0xd')](_0x3f7394[_0xf867('0x2c')]);if(_0x27421a[_0xf867('0x28')]>0x0){return _0x24f50['status'](0x190)[_0xf867('0x2d')](_0x27421a);}var _0x2d02f8=_0x3f7394[_0xf867('0x2c')][_0xf867('0x35')];var _0x3b8929=_0x3f7394['body'][_0xf867('0x27')];return getAgent(_0x2d02f8)['then'](function(_0x2507aa){logger[_0xf867('0x13')]('entityFound:',_0x2507aa[_0xf867('0x16')]);emit(util[_0xf867('0x36')](_0xf867('0x32'),_0x2507aa[_0xf867('0x16')]),_0xf867('0x3b'),{'sessionId':_0x3b8929});return _0x24f50[_0xf867('0x17')](0xc8)['json']({'error':![],'message':_0xf867('0x3c')});})['catch'](handleError(_0x24f50));};exports[_0xf867('0x3d')]=function(_0x22736a,_0x8651a8){logger[_0xf867('0x13')](_0xf867('0x3e'),_0x22736a[_0xf867('0x2c')]);var _0x221fb8=holdValidation['validate'](_0x22736a['body']);if(_0x221fb8[_0xf867('0x28')]>0x0){return _0x8651a8[_0xf867('0x17')](0x190)[_0xf867('0x2d')](_0x221fb8);}var _0x5ca8a7=_0x22736a[_0xf867('0x2c')][_0xf867('0x35')];var _0x8199d8=_0x22736a['body'][_0xf867('0x27')];return getAgent(_0x5ca8a7)['then'](function(_0xc01c03){logger[_0xf867('0x13')](_0xf867('0x31'),_0xc01c03[_0xf867('0x16')]);emit(util[_0xf867('0x36')](_0xf867('0x32'),_0xc01c03[_0xf867('0x16')]),_0xf867('0x3f'),{'sessionId':_0x8199d8});return _0x8651a8['status'](0xc8)['json']({'error':![],'message':_0xf867('0x40')});})[_0xf867('0x1e')](handleError(_0x8651a8));};exports[_0xf867('0x41')]=function(_0x199ce0,_0x2e9093){logger[_0xf867('0x13')](_0xf867('0x42'),_0x199ce0['body']);var _0xde9cd6=unholdValidation[_0xf867('0xd')](_0x199ce0[_0xf867('0x2c')]);if(_0xde9cd6[_0xf867('0x28')]>0x0){return _0x2e9093['status'](0x190)[_0xf867('0x2d')](_0xde9cd6);}var _0x1ced9b=_0x199ce0['body']['userId'];var _0x504ea8=_0x199ce0[_0xf867('0x2c')][_0xf867('0x27')];return getAgent(_0x1ced9b)['then'](function(_0x11ac96){logger[_0xf867('0x13')]('entityFound:',_0x11ac96[_0xf867('0x16')]);emit(util[_0xf867('0x36')]('user:%s',_0x11ac96[_0xf867('0x16')]),_0xf867('0x43'),{'sessionId':_0x504ea8});return _0x2e9093[_0xf867('0x17')](0xc8)[_0xf867('0x2d')]({'error':![],'message':_0xf867('0x44')});})['catch'](handleError(_0x2e9093));};exports['calls']=function(_0x2dfea0,_0x319779){logger[_0xf867('0x13')](_0xf867('0x45'),_0x319779[_0xf867('0x2c')]);var _0x44229e=callsValidation['validate'](_0x2dfea0[_0xf867('0x2c')]);if(_0x44229e[_0xf867('0x28')]>0x0){return _0x319779[_0xf867('0x17')](0x190)[_0xf867('0x2d')](_0x44229e);}var _0x3fe4a2=_0x2dfea0[_0xf867('0x2c')][_0xf867('0x35')];var _0x2e5e49=respondWithRpcPromise(_0xf867('0x23'));var _0x466582=getAgent(_0x3fe4a2);return Promise[_0xf867('0x24')]([_0x2e5e49,_0x466582])['then'](function(_0x2f27ca){var _0x1e79ce=_0x2f27ca[0x0];var _0x33ae40=_0x2f27ca[0x1];var _0x4a5f54=_[_0xf867('0x25')](_0x1e79ce[_0xf867('0x46')],function(_0x35065b){return _0x35065b[_0xf867('0x26')]==_0x33ae40['id'];});return _0x319779['status'](0xc8)['json']({'count':_0x4a5f54[_0xf867('0x28')],'rows':_0x4a5f54});})[_0xf867('0x1e')](handleError(_0x319779));};exports[_0xf867('0x47')]=function(_0x72fc06,_0x4c962d){logger[_0xf867('0x13')]('conference\x20fired:',_0x72fc06[_0xf867('0x2c')]);var _0x36160e=conferenceValidation[_0xf867('0xd')](_0x72fc06['body']);if(_0x36160e[_0xf867('0x28')]>0x0){return _0x4c962d[_0xf867('0x17')](0x190)['json'](_0x36160e);}var _0x5ef100=_0x72fc06[_0xf867('0x2c')][_0xf867('0x35')];return getAgent(_0x5ef100)[_0xf867('0x22')](function(_0x30fe40){logger[_0xf867('0x13')](_0xf867('0x31'),_0x30fe40[_0xf867('0x16')]);emit(util['format'](_0xf867('0x32'),_0x30fe40[_0xf867('0x16')]),_0xf867('0x48'));return _0x4c962d[_0xf867('0x17')](0xc8)[_0xf867('0x2d')]({'error':![],'message':_0xf867('0x49')});})[_0xf867('0x1e')](handleError(_0x4c962d));};exports[_0xf867('0x4a')]=function(_0x167611,_0xcff6a6){logger[_0xf867('0x13')](_0xf867('0x4b'),_0x167611[_0xf867('0x2c')]);var _0x485b20=transferValidation[_0xf867('0xd')](_0x167611[_0xf867('0x2c')]);if(_0x485b20['length']>0x0){return _0xcff6a6[_0xf867('0x17')](0x190)[_0xf867('0x2d')](_0x485b20);}var _0x3b696b=_0x167611['body'][_0xf867('0x35')];var _0x1c368a=_0x167611['body'][_0xf867('0x27')];var _0xc663ba=_0x167611[_0xf867('0x2c')]['transferNumber'];return getAgent(_0x3b696b)[_0xf867('0x22')](function(_0x34d729){logger[_0xf867('0x13')](_0xf867('0x31'),_0x34d729[_0xf867('0x16')]);emit(util['format'](_0xf867('0x32'),_0x34d729['name']),'webbar:transfer',{'sessionId':_0x1c368a,'transferNumber':_0xc663ba});return _0xcff6a6[_0xf867('0x17')](0xc8)[_0xf867('0x2d')]({'error':![],'message':_0xf867('0x4c')});})[_0xf867('0x1e')](handleError(_0xcff6a6));}; \ No newline at end of file +var _0x3685=['UserId','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','stack','send','name','NotFound','request','then','error','code','message','result','catch','findOne','agent','VoiceChannels','all','filter','rows','sessionId','length','sessionId\x20','originate','body','status','userId','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x3685,0xf8));var _0x5368=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3685[_0x321bb2];return _0x9c12ed;};'use strict';var path=require(_0x5368('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x5368('0x1'))['db'];var config=require(_0x5368('0x2'));var util=require(_0x5368('0x3'));var BPromise=require(_0x5368('0x4'));var jayson=require(_0x5368('0x5'));var amiClient=jayson[_0x5368('0x6')][_0x5368('0x7')]({'port':0x232a});var logger=require(_0x5368('0x8'))(_0x5368('0x9'));var Redis=require(_0x5368('0xa'));config['redis']=_[_0x5368('0xb')](config[_0x5368('0xc')],{'host':_0x5368('0xd'),'port':0x18eb});var io=require(_0x5368('0xe'))(new Redis(config['redis']));var Schema=require(_0x5368('0xf'));var originateValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],_0x5368('0x11')]},'callNumber':{'type':_0x5368('0x12'),'required':[!![],_0x5368('0x13')]},'callerId':{'type':_0x5368('0x12')},'callbackUrl':{'type':_0x5368('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5368('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],_0x5368('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],_0x5368('0x11')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0x5368('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],_0x5368('0x11')]},'sessionId':{'type':_0x5368('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],_0x5368('0x11')]},'sessionId':{'type':_0x5368('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],_0x5368('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5368('0x10'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x41ce0e,_0x183041,_0x59c422){logger[_0x5368('0x15')](_0x41ce0e,_0x183041,JSON[_0x5368('0x16')](_0x59c422));io['to'](_0x41ce0e)[_0x5368('0x17')](_0x183041,_0x59c422);}function handleError(_0x24a4b3){return function(_0x5b10e9){console[_0x5368('0x18')]('handleError:',_0x5b10e9,_0x5b10e9 instanceof RangeError);logger['error'](_0x5b10e9[_0x5368('0x19')]);if(_0x5b10e9 instanceof RangeError){if(_0x5b10e9['name']){delete _0x5b10e9['name'];}_0x24a4b3['status'](0x194)[_0x5368('0x1a')](_0x5b10e9);}else{if(_0x5b10e9[_0x5368('0x1b')]){delete _0x5b10e9[_0x5368('0x1b')];}_0x24a4b3['status'](0x1f4)['send'](_0x5b10e9);}};}function checkError(){return function(_0x2f21fc){if(!_0x2f21fc){throw new RangeError(_0x5368('0x1c'));}return _0x2f21fc;};}function respondWithRpcPromise(_0x14b6bd,_0x38f367){return new BPromise(function(_0x1c2fcd,_0x1093e2){var _0x4885d0=amiClient;return _0x4885d0[_0x5368('0x1d')](_0x14b6bd,_0x38f367)[_0x5368('0x1e')](function(_0x4705f2){if(_0x4705f2['error']){if(_0x4705f2[_0x5368('0x1f')][_0x5368('0x20')]===0x1f4){return _0x1093e2(_0x4705f2[_0x5368('0x1f')][_0x5368('0x21')]);}return _0x1c2fcd(_0x4705f2[_0x5368('0x1f')][_0x5368('0x21')]);}else{_0x1c2fcd(_0x4705f2[_0x5368('0x22')]);}})[_0x5368('0x23')](function(_0x47c30f){_0x1093e2(_0x47c30f);});});}function getAgent(_0x569d81){return db['User'][_0x5368('0x24')]({'where':{'id':_0x569d81,'role':_0x5368('0x25')}})[_0x5368('0x1e')](checkError());}function getAgentCheckSession(_0x452c81,_0x131722){return new BPromise(function(_0x4b94cd,_0x725f8e){var _0x200ad0=respondWithRpcPromise(_0x5368('0x26'));var _0x2bcf41=getAgent(_0x452c81);Promise[_0x5368('0x27')]([_0x200ad0,_0x2bcf41])[_0x5368('0x1e')](function(_0x3d40de){var _0x2963a6=_0x3d40de[0x0];var _0x3681e6=_0x3d40de[0x1];var _0x3c8ae1=_[_0x5368('0x28')](_0x2963a6[_0x5368('0x29')],function(_0x7449cd){return _0x7449cd['UserId']==_0x3681e6['id']&&_0x7449cd[_0x5368('0x2a')]==_0x131722;});if(_0x3c8ae1[_0x5368('0x2b')]==0x1){_0x4b94cd(_0x3681e6);}else{_0x725f8e(new RangeError(_0x5368('0x2c')+_0x131722+'\x20not\x20found!'));}});});}exports[_0x5368('0x2d')]=function(_0x50131a,_0x26fc48){logger[_0x5368('0x15')]('originate\x20fired:',_0x50131a[_0x5368('0x2e')]);var _0x1ce386=originateValidation['validate'](_0x50131a['body']);if(_0x1ce386[_0x5368('0x2b')]>0x0){return _0x26fc48[_0x5368('0x2f')](0x190)['json'](_0x1ce386);}var _0x46169e=_0x50131a[_0x5368('0x2e')][_0x5368('0x30')];var _0x4dc0ee=_0x50131a[_0x5368('0x2e')]['callNumber'];var _0x22b489=_0x50131a[_0x5368('0x2e')][_0x5368('0x31')];var _0x5f44d2=_0x50131a[_0x5368('0x2e')][_0x5368('0x32')];return getAgent(_0x46169e)[_0x5368('0x1e')](function(_0x2a3bed){logger['info'](_0x5368('0x33'),_0x2a3bed['name']);emit(util[_0x5368('0x34')](_0x5368('0x35'),_0x2a3bed['name']),_0x5368('0x36'),{'callNumber':_0x4dc0ee,'callerId':_0x22b489,'callbackUrl':_0x5f44d2});return _0x26fc48[_0x5368('0x2f')](0xc8)[_0x5368('0x37')]({'error':![],'message':_0x5368('0x38')});})['catch'](handleError(_0x26fc48));};exports[_0x5368('0x39')]=function(_0x19de44,_0x7b30ae){logger[_0x5368('0x15')](_0x5368('0x3a'),_0x19de44['body']);var _0x1183a1=hangupValidation[_0x5368('0xf')](_0x19de44['body']);if(_0x1183a1[_0x5368('0x2b')]>0x0){return _0x7b30ae[_0x5368('0x2f')](0x190)[_0x5368('0x37')](_0x1183a1);}var _0x5e796f=_0x19de44[_0x5368('0x2e')][_0x5368('0x30')];var _0x1f23cc=_0x19de44[_0x5368('0x2e')]['sessionId'];return getAgent(_0x5e796f)['then'](function(_0x1be46a){logger[_0x5368('0x15')](_0x5368('0x33'),_0x1be46a['name']);emit(util['format'](_0x5368('0x35'),_0x1be46a['name']),_0x5368('0x3b'),{'sessionId':_0x1f23cc});return _0x7b30ae[_0x5368('0x2f')](0xc8)['json']({'error':![],'message':_0x5368('0x3c')});})[_0x5368('0x23')](handleError(_0x7b30ae));};exports[_0x5368('0x3d')]=function(_0xed1792,_0x2e1acc){logger[_0x5368('0x15')](_0x5368('0x3e'),_0xed1792[_0x5368('0x2e')]);var _0x48c86=answerValidation[_0x5368('0xf')](_0xed1792[_0x5368('0x2e')]);if(_0x48c86[_0x5368('0x2b')]>0x0){return _0x2e1acc['status'](0x190)[_0x5368('0x37')](_0x48c86);}var _0x61b1a1=_0xed1792[_0x5368('0x2e')]['userId'];var _0x1b66a1=_0xed1792[_0x5368('0x2e')]['sessionId'];return getAgent(_0x61b1a1)[_0x5368('0x1e')](function(_0x6f6dc4){logger[_0x5368('0x15')](_0x5368('0x33'),_0x6f6dc4[_0x5368('0x1b')]);emit(util[_0x5368('0x34')](_0x5368('0x35'),_0x6f6dc4[_0x5368('0x1b')]),_0x5368('0x3f'),{'sessionId':_0x1b66a1});return _0x2e1acc[_0x5368('0x2f')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x5368('0x23')](handleError(_0x2e1acc));};exports[_0x5368('0x40')]=function(_0x3eb1d0,_0x20f041){logger['info']('hold\x20fired:',_0x3eb1d0[_0x5368('0x2e')]);var _0x5577b3=holdValidation[_0x5368('0xf')](_0x3eb1d0['body']);if(_0x5577b3[_0x5368('0x2b')]>0x0){return _0x20f041['status'](0x190)[_0x5368('0x37')](_0x5577b3);}var _0x244724=_0x3eb1d0['body']['userId'];var _0x3e9ac0=_0x3eb1d0['body'][_0x5368('0x2a')];return getAgent(_0x244724)[_0x5368('0x1e')](function(_0x2ee00b){logger[_0x5368('0x15')]('entityFound:',_0x2ee00b[_0x5368('0x1b')]);emit(util[_0x5368('0x34')](_0x5368('0x35'),_0x2ee00b[_0x5368('0x1b')]),_0x5368('0x41'),{'sessionId':_0x3e9ac0});return _0x20f041[_0x5368('0x2f')](0xc8)[_0x5368('0x37')]({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x20f041));};exports[_0x5368('0x42')]=function(_0x7d7a5,_0x367a7d){logger['info'](_0x5368('0x43'),_0x7d7a5[_0x5368('0x2e')]);var _0x1791d4=unholdValidation[_0x5368('0xf')](_0x7d7a5[_0x5368('0x2e')]);if(_0x1791d4[_0x5368('0x2b')]>0x0){return _0x367a7d[_0x5368('0x2f')](0x190)[_0x5368('0x37')](_0x1791d4);}var _0x539911=_0x7d7a5[_0x5368('0x2e')][_0x5368('0x30')];var _0x32aa43=_0x7d7a5[_0x5368('0x2e')]['sessionId'];return getAgent(_0x539911)[_0x5368('0x1e')](function(_0x9775f8){logger[_0x5368('0x15')](_0x5368('0x33'),_0x9775f8[_0x5368('0x1b')]);emit(util[_0x5368('0x34')](_0x5368('0x35'),_0x9775f8[_0x5368('0x1b')]),_0x5368('0x44'),{'sessionId':_0x32aa43});return _0x367a7d[_0x5368('0x2f')](0xc8)[_0x5368('0x37')]({'error':![],'message':_0x5368('0x45')});})[_0x5368('0x23')](handleError(_0x367a7d));};exports[_0x5368('0x46')]=function(_0x5adefd,_0x1ea85e){logger[_0x5368('0x15')](_0x5368('0x47'),_0x1ea85e[_0x5368('0x2e')]);var _0x2688a9=callsValidation[_0x5368('0xf')](_0x5adefd['body']);if(_0x2688a9[_0x5368('0x2b')]>0x0){return _0x1ea85e['status'](0x190)[_0x5368('0x37')](_0x2688a9);}var _0x139b0d=_0x5adefd[_0x5368('0x2e')][_0x5368('0x30')];var _0xe348e1=respondWithRpcPromise(_0x5368('0x26'));var _0x170ecd=getAgent(_0x139b0d);return Promise['all']([_0xe348e1,_0x170ecd])[_0x5368('0x1e')](function(_0xcec819){var _0x45bba1=_0xcec819[0x0];var _0x3822ff=_0xcec819[0x1];var _0xf127d0=_[_0x5368('0x28')](_0x45bba1[_0x5368('0x29')],function(_0x128812){return _0x128812[_0x5368('0x48')]==_0x3822ff['id'];});return _0x1ea85e[_0x5368('0x2f')](0xc8)[_0x5368('0x37')]({'count':_0xf127d0[_0x5368('0x2b')],'rows':_0xf127d0});})[_0x5368('0x23')](handleError(_0x1ea85e));};exports['conference']=function(_0x4fa56e,_0x5b741a){logger[_0x5368('0x15')](_0x5368('0x49'),_0x4fa56e[_0x5368('0x2e')]);var _0x2b7fa9=conferenceValidation['validate'](_0x4fa56e['body']);if(_0x2b7fa9[_0x5368('0x2b')]>0x0){return _0x5b741a[_0x5368('0x2f')](0x190)[_0x5368('0x37')](_0x2b7fa9);}var _0x4d1793=_0x4fa56e[_0x5368('0x2e')]['userId'];return getAgent(_0x4d1793)[_0x5368('0x1e')](function(_0x449972){logger[_0x5368('0x15')](_0x5368('0x33'),_0x449972[_0x5368('0x1b')]);emit(util['format'](_0x5368('0x35'),_0x449972[_0x5368('0x1b')]),_0x5368('0x4a'));return _0x5b741a['status'](0xc8)['json']({'error':![],'message':_0x5368('0x4b')});})[_0x5368('0x23')](handleError(_0x5b741a));};exports['transfer']=function(_0x591c07,_0x26d09c){logger[_0x5368('0x15')](_0x5368('0x4c'),_0x591c07[_0x5368('0x2e')]);var _0x2b5cb3=transferValidation[_0x5368('0xf')](_0x591c07[_0x5368('0x2e')]);if(_0x2b5cb3[_0x5368('0x2b')]>0x0){return _0x26d09c['status'](0x190)[_0x5368('0x37')](_0x2b5cb3);}var _0x5a70f4=_0x591c07[_0x5368('0x2e')][_0x5368('0x30')];var _0x1c2da8=_0x591c07['body'][_0x5368('0x2a')];var _0x242a9a=_0x591c07[_0x5368('0x2e')][_0x5368('0x4d')];return getAgent(_0x5a70f4)[_0x5368('0x1e')](function(_0x3f10b2){logger[_0x5368('0x15')](_0x5368('0x33'),_0x3f10b2[_0x5368('0x1b')]);emit(util[_0x5368('0x34')](_0x5368('0x35'),_0x3f10b2[_0x5368('0x1b')]),_0x5368('0x4e'),{'sessionId':_0x1c2da8,'transferNumber':_0x242a9a});return _0x26d09c[_0x5368('0x2f')](0xc8)[_0x5368('0x37')]({'error':![],'message':_0x5368('0x4f')});})[_0x5368('0x23')](handleError(_0x26d09c));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 6210124..3496432 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 _0xd4a2=['../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','addAgents','notify','/:id/send','send','put','update','delete','destroy','removeAnswers','removeAgents','multer','connect-timeout','Router'];(function(_0x49cf04,_0x516ff9){var _0x51a257=function(_0x3978c1){while(--_0x3978c1){_0x49cf04['push'](_0x49cf04['shift']());}};_0x51a257(++_0x516ff9);}(_0xd4a2,0x173));var _0x2d4a=function(_0x273dc9,_0x3f401c){_0x273dc9=_0x273dc9-0x0;var _0x43a95e=_0xd4a2[_0x273dc9];return _0x43a95e;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0x6')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0x6')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0x6')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x2d4a('0xf')]);router['get'](_0x2d4a('0x10'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x11')]);router[_0x2d4a('0x6')](_0x2d4a('0x12'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x13')]);router[_0x2d4a('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2d4a('0x14')]('/:id/dispositions',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x15')]);router[_0x2d4a('0x14')](_0x2d4a('0x16'),auth['isAuthenticated'](),controller[_0x2d4a('0x17')]);router['post'](_0x2d4a('0x10'),auth['isAuthenticated'](),controller[_0x2d4a('0x18')]);router[_0x2d4a('0x14')](_0x2d4a('0x12'),auth[_0x2d4a('0x7')](),controller['addApplications']);router['post']('/:id/notify',controller[_0x2d4a('0x19')]);router[_0x2d4a('0x14')](_0x2d4a('0x1a'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x1b')]);router[_0x2d4a('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x2d4a('0x1d')]);router[_0x2d4a('0x1e')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x1f')]);router[_0x2d4a('0x1e')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller['removeDispositions']);router[_0x2d4a('0x1e')](_0x2d4a('0x16'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x20')]);router[_0x2d4a('0x1e')](_0x2d4a('0x10'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x21')]);module['exports']=router; \ No newline at end of file +var _0xadb5=['notify','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addAnswer','addAgents'];(function(_0x47623f,_0x148f3a){var _0x282ce8=function(_0x35bca1){while(--_0x35bca1){_0x47623f['push'](_0x47623f['shift']());}};_0x282ce8(++_0x148f3a);}(_0xadb5,0xad));var _0x5adb=function(_0x2a285,_0x4cabbf){_0x2a285=_0x2a285-0x0;var _0x2fb68a=_0xadb5[_0x2a285];return _0x2fb68a;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./whatsappAccount.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getDispositions']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['get'](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x12')]);router['get'](_0x5adb('0x13'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);router['post']('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x15')]);router[_0x5adb('0x16')]('/:id/dispositions',auth[_0x5adb('0x8')](),controller['addDisposition']);router[_0x5adb('0x16')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x16')](_0x5adb('0x11'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x18')]);router[_0x5adb('0x16')]('/:id/applications',auth[_0x5adb('0x8')](),controller['addApplications']);router[_0x5adb('0x16')]('/:id/notify',controller[_0x5adb('0x19')]);router['post']('/:id/send',auth[_0x5adb('0x8')](),controller[_0x5adb('0x1a')]);router[_0x5adb('0x1b')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller['update']);router[_0x5adb('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x5adb('0x1d')]);router[_0x5adb('0x1c')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x1e')]);router[_0x5adb('0x1c')](_0x5adb('0xf'),auth['isAuthenticated'](),controller[_0x5adb('0x1f')]);router[_0x5adb('0x1c')](_0x5adb('0x11'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index f63e72b..c9c3e6f 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 _0xf2d9=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','ENUM','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x123623,_0x9694e2){var _0x3b00d1=function(_0x7e48e0){while(--_0x7e48e0){_0x123623['push'](_0x123623['shift']());}};_0x3b00d1(++_0x9694e2);}(_0xf2d9,0x199));var _0x9f2d=function(_0x5af221,_0x5b2255){_0x5af221=_0x5af221-0x0;var _0x4c110f=_0xf2d9[_0x5af221];return _0x4c110f;};'use strict';var Sequelize=require(_0x9f2d('0x0'));var rs=require(_0x9f2d('0x1'));module['exports']={'name':{'type':Sequelize[_0x9f2d('0x2')],'unique':_0x9f2d('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x9f2d('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x9f2d('0x2')],'defaultValue':function(){return rs[_0x9f2d('0x4')]();}},'phone':{'type':Sequelize[_0x9f2d('0x2')]},'type':{'type':Sequelize[_0x9f2d('0x5')]('twilio',_0x9f2d('0x6'))},'accountSid':{'type':Sequelize[_0x9f2d('0x2')]},'baseUrl':{'type':Sequelize[_0x9f2d('0x2')]},'authToken':{'type':Sequelize[_0x9f2d('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9f2d('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9f2d('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x9f2d('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9f2d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9f2d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9f2d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9f2d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9f2d('0x9')],'comment':_0x9f2d('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9f2d('0xb'),'set':function(_0x29f93b){if(!_0x29f93b){this[_0x9f2d('0xc')](_0x9f2d('0xd'),null);}this[_0x9f2d('0xc')](_0x9f2d('0xe'),_0x29f93b);}},'description':{'type':Sequelize[_0x9f2d('0x2')]}}; \ No newline at end of file +var _0x6338=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6338,0x189));var _0x8633=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6338[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x8633('0x0'));module[_0x8633('0x1')]={'name':{'type':Sequelize[_0x8633('0x2')],'unique':_0x8633('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x8633('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x8633('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x8633('0x2')],'defaultValue':function(){return rs[_0x8633('0x4')]();}},'phone':{'type':Sequelize[_0x8633('0x2')]},'type':{'type':Sequelize[_0x8633('0x5')]('twilio',_0x8633('0x6'))},'accountSid':{'type':Sequelize[_0x8633('0x2')]},'baseUrl':{'type':Sequelize[_0x8633('0x2')]},'authToken':{'type':Sequelize[_0x8633('0x2')]},'notificationTemplate':{'type':Sequelize[_0x8633('0x7')],'defaultValue':function(){return _0x8633('0x8');}},'notificationSound':{'type':Sequelize[_0x8633('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8633('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8633('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8633('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8633('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8633('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8633('0xb'),'set':function(_0x5bc059){if(!_0x5bc059){this[_0x8633('0xc')](_0x8633('0xd'),null);}this['setDataValue'](_0x8633('0xe'),_0x5bc059);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index d91d653..3bd01f2 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 _0x3e1a=['length','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','body','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','spread','userWhatsappAccount:save','removeAgents','isArray','emit','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','Applications','account','sinch','statuses','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','twilio','From','replace','whatsapp:','MessageSid','from','notifications','messageId','Sequelize','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','ListId','CmContact','DESC','list','omit','Contacts','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','List','user','out','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','includeAll','include','findAll','rows','show','Pause'];(function(_0x3a94e1,_0x22e4fd){var _0x6a09d5=function(_0x2d6d1c){while(--_0x2d6d1c){_0x3a94e1['push'](_0x3a94e1['shift']());}};_0x6a09d5(++_0x22e4fd);}(_0x3e1a,0x12e));var _0xa3e1=function(_0x36a795,_0x75c8e3){_0x36a795=_0x36a795-0x0;var _0x33417d=_0x3e1a[_0x36a795];return _0x33417d;};'use strict';var emlformat=require(_0xa3e1('0x0'));var rimraf=require(_0xa3e1('0x1'));var zipdir=require(_0xa3e1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa3e1('0x3'));var moment=require(_0xa3e1('0x4'));var BPromise=require(_0xa3e1('0x5'));var Mustache=require(_0xa3e1('0x6'));var util=require(_0xa3e1('0x7'));var path=require(_0xa3e1('0x8'));var sox=require(_0xa3e1('0x9'));var csv=require(_0xa3e1('0xa'));var ejs=require(_0xa3e1('0xb'));var fs=require('fs');var fs_extra=require(_0xa3e1('0xc'));var _=require(_0xa3e1('0xd'));var squel=require(_0xa3e1('0xe'));var crypto=require(_0xa3e1('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa3e1('0x10'));var toCsv=require(_0xa3e1('0xa'));var querystring=require(_0xa3e1('0x11'));var Papa=require(_0xa3e1('0x12'));var Redis=require(_0xa3e1('0x13'));var authService=require(_0xa3e1('0x14'));var qs=require(_0xa3e1('0x15'));var as=require(_0xa3e1('0x16'));var hardwareService=require(_0xa3e1('0x17'));var logger=require(_0xa3e1('0x18'))(_0xa3e1('0x19'));var utils=require(_0xa3e1('0x1a'));var config=require(_0xa3e1('0x1b'));var licenseUtil=require(_0xa3e1('0x1c'));var db=require(_0xa3e1('0x1d'))['db'];config[_0xa3e1('0x1e')]=_[_0xa3e1('0x1f')](config[_0xa3e1('0x1e')],{'host':_0xa3e1('0x20'),'port':0x18eb});var socket=require(_0xa3e1('0x21'))(new Redis(config[_0xa3e1('0x1e')]));require(_0xa3e1('0x22'))[_0xa3e1('0x23')](socket);var jayson=require(_0xa3e1('0x24'));var client=jayson[_0xa3e1('0x25')][_0xa3e1('0x26')]({'port':0x232c});function respondWithRpcPromise(_0x127d52,_0x47f264,_0x149966,_0x243ebb){return new BPromise(function(_0x2ba830,_0x5b617a){var _0x138099=_0x243ebb||client;return _0x138099[_0xa3e1('0x27')](_0x127d52,_0x149966)[_0xa3e1('0x28')](function(_0xd4383a){logger[_0xa3e1('0x29')](_0xa3e1('0x2a'),_0x47f264,_0xa3e1('0x2b'));logger[_0xa3e1('0x2c')](_0xa3e1('0x2d'),_0x47f264,_0xa3e1('0x2b'),JSON[_0xa3e1('0x2e')](_0xd4383a));if(_0xd4383a[_0xa3e1('0x2f')]){if(_0xd4383a[_0xa3e1('0x2f')]['code']===0x1f4){logger[_0xa3e1('0x2f')](_0xa3e1('0x2a'),_0x47f264,_0xd4383a[_0xa3e1('0x2f')][_0xa3e1('0x30')]);return _0x5b617a(_0xd4383a[_0xa3e1('0x2f')][_0xa3e1('0x30')]);}logger[_0xa3e1('0x2f')]('WhatsappAccount,\x20%s,\x20%s',_0x47f264,_0xd4383a[_0xa3e1('0x2f')]['message']);return _0x2ba830(_0xd4383a[_0xa3e1('0x2f')]['message']);}else{logger['info'](_0xa3e1('0x2a'),_0x47f264,_0xa3e1('0x2b'));_0x2ba830(_0xd4383a[_0xa3e1('0x31')]['message']);}})[_0xa3e1('0x32')](function(_0x1326d0){logger[_0xa3e1('0x2f')](_0xa3e1('0x2a'),_0x47f264,_0x1326d0);_0x5b617a(_0x1326d0);});});}function respondWithStatusCode(_0x29bdde,_0xfc8aba){_0xfc8aba=_0xfc8aba||0xcc;return function(_0xe62642){if(_0xe62642){return _0x29bdde[_0xa3e1('0x33')](_0xfc8aba);}return _0x29bdde[_0xa3e1('0x34')](_0xfc8aba)[_0xa3e1('0x35')]();};}function respondWithResult(_0xeb88db,_0xf2d412){_0xf2d412=_0xf2d412||0xc8;return function(_0x4d7674){if(_0x4d7674){return _0xeb88db['status'](_0xf2d412)[_0xa3e1('0x36')](_0x4d7674);}};}function respondWithFilteredResult(_0xc9eaef,_0x4d5225){return function(_0x48f75e){if(_0x48f75e){var _0x3fdf26=typeof _0x4d5225[_0xa3e1('0x37')]===_0xa3e1('0x38')&&typeof _0x4d5225[_0xa3e1('0x39')]===_0xa3e1('0x38');var _0x527ff6=_0x48f75e[_0xa3e1('0x3a')];var _0x440f25=_0x3fdf26?0x0:_0x4d5225['offset'];var _0x151888=_0x3fdf26?_0x48f75e['count']:_0x4d5225[_0xa3e1('0x37')]+_0x4d5225[_0xa3e1('0x39')];var _0x3b1c27;if(_0x151888>=_0x527ff6){_0x151888=_0x527ff6;_0x3b1c27=0xc8;}else{_0x3b1c27=0xce;}_0xc9eaef[_0xa3e1('0x34')](_0x3b1c27);return _0xc9eaef[_0xa3e1('0x3b')](_0xa3e1('0x3c'),_0x440f25+'-'+_0x151888+'/'+_0x527ff6)['json'](_0x48f75e);}return null;};}function patchUpdates(_0x1f8868){return function(_0x44ba7f){try{jsonpatch[_0xa3e1('0x3d')](_0x44ba7f,_0x1f8868,!![]);}catch(_0x561d85){return BPromise[_0xa3e1('0x3e')](_0x561d85);}return _0x44ba7f[_0xa3e1('0x3f')]();};}function saveUpdates(_0x4fe3fb,_0x61e782){return function(_0x2381d6){if(_0x2381d6){return _0x2381d6[_0xa3e1('0x40')](_0x4fe3fb)[_0xa3e1('0x28')](function(_0x1cb029){return _0x1cb029;});}return null;};}function removeEntity(_0x470be8,_0x2717c4){return function(_0x4600a2){if(_0x4600a2){return _0x4600a2[_0xa3e1('0x41')]()[_0xa3e1('0x28')](function(){var _0x122e15=_0x4600a2[_0xa3e1('0x42')]({'plain':!![]});var _0x489ad8=_0xa3e1('0x43');return db[_0xa3e1('0x44')][_0xa3e1('0x41')]({'where':{'type':_0x489ad8,'resourceId':_0x122e15['id']}})['then'](function(){return _0x4600a2;});})[_0xa3e1('0x28')](function(){_0x470be8[_0xa3e1('0x34')](0xcc)[_0xa3e1('0x35')]();});}};}function handleEntityNotFound(_0x5bd876,_0x4692d4){return function(_0xeea46b){if(!_0xeea46b){_0x5bd876['sendStatus'](0x194);}return _0xeea46b;};}function handleError(_0x3bb4ac,_0xa87e1c){_0xa87e1c=_0xa87e1c||0x1f4;return function(_0x210c72){logger[_0xa3e1('0x2f')](_0x210c72[_0xa3e1('0x45')]);if(_0x210c72[_0xa3e1('0x46')]){delete _0x210c72[_0xa3e1('0x46')];}_0x3bb4ac[_0xa3e1('0x34')](_0xa87e1c)[_0xa3e1('0x47')](_0x210c72);};}exports[_0xa3e1('0x48')]=function(_0xa4b26b,_0x29c9b6){var _0x2a29a0={'include':[{'model':db['Pause'],'as':_0xa3e1('0x49')}]},_0x39c4e0={},_0x264c2e={'count':0x0,'rows':[]};var _0xd6fb00=_[_0xa3e1('0x4a')](db[_0xa3e1('0x4b')][_0xa3e1('0x4c')],function(_0x33f1aa){return{'name':_0x33f1aa[_0xa3e1('0x4d')],'type':_0x33f1aa[_0xa3e1('0x4e')][_0xa3e1('0x4f')]};});_0x39c4e0[_0xa3e1('0x50')]=_[_0xa3e1('0x4a')](_0xd6fb00,_0xa3e1('0x46'));_0x39c4e0[_0xa3e1('0x51')]=_[_0xa3e1('0x52')](_0xa4b26b[_0xa3e1('0x51')]);_0x39c4e0[_0xa3e1('0x53')]=_['intersection'](_0x39c4e0[_0xa3e1('0x50')],_0x39c4e0[_0xa3e1('0x51')]);_0x2a29a0[_0xa3e1('0x54')]=_[_0xa3e1('0x55')](_0x39c4e0['model'],qs['fields'](_0xa4b26b[_0xa3e1('0x51')][_0xa3e1('0x56')]));_0x2a29a0[_0xa3e1('0x54')]=_0x2a29a0[_0xa3e1('0x54')]['length']?_0x2a29a0['attributes']:_0x39c4e0[_0xa3e1('0x50')];if(!_0xa4b26b[_0xa3e1('0x51')][_0xa3e1('0x57')](_0xa3e1('0x58'))){_0x2a29a0['limit']=qs['limit'](_0xa4b26b[_0xa3e1('0x51')][_0xa3e1('0x39')]);_0x2a29a0[_0xa3e1('0x37')]=qs[_0xa3e1('0x37')](_0xa4b26b[_0xa3e1('0x51')][_0xa3e1('0x37')]);}_0x2a29a0[_0xa3e1('0x59')]=qs[_0xa3e1('0x5a')](_0xa4b26b[_0xa3e1('0x51')][_0xa3e1('0x5a')]);_0x2a29a0['where']=qs[_0xa3e1('0x53')](_[_0xa3e1('0x5b')](_0xa4b26b['query'],_0x39c4e0[_0xa3e1('0x53')]),_0xd6fb00);if(_0xa4b26b[_0xa3e1('0x51')][_0xa3e1('0x5c')]){_0x2a29a0[_0xa3e1('0x5d')]=_['merge'](_0x2a29a0['where'],{'$or':_[_0xa3e1('0x4a')](_0xd6fb00,function(_0x5275e2){if(_0x5275e2[_0xa3e1('0x4e')]!=='VIRTUAL'){var _0x366452={};_0x366452[_0x5275e2['name']]={'$like':'%'+_0xa4b26b['query'][_0xa3e1('0x5c')]+'%'};return _0x366452;}})});}_0x2a29a0=_['merge']({},_0x2a29a0,_0xa4b26b['options']);var _0x39def8={'where':_0x2a29a0[_0xa3e1('0x5d')]};return db[_0xa3e1('0x4b')][_0xa3e1('0x3a')](_0x39def8)[_0xa3e1('0x28')](function(_0x46cd67){_0x264c2e[_0xa3e1('0x3a')]=_0x46cd67;if(_0xa4b26b[_0xa3e1('0x51')][_0xa3e1('0x5e')]){_0x2a29a0[_0xa3e1('0x5f')]=[{'all':!![]}];}return db[_0xa3e1('0x4b')][_0xa3e1('0x60')](_0x2a29a0);})[_0xa3e1('0x28')](function(_0xb7182b){_0x264c2e[_0xa3e1('0x61')]=_0xb7182b;return _0x264c2e;})[_0xa3e1('0x28')](respondWithFilteredResult(_0x29c9b6,_0x2a29a0))[_0xa3e1('0x32')](handleError(_0x29c9b6,null));};exports[_0xa3e1('0x62')]=function(_0x4f95f1,_0x4e849e){var _0x331295={'raw':![],'where':{'id':_0x4f95f1['params']['id']},'include':[{'model':db[_0xa3e1('0x63')],'as':_0xa3e1('0x49')}]},_0x238133={};_0x238133[_0xa3e1('0x50')]=_[_0xa3e1('0x52')](db[_0xa3e1('0x4b')][_0xa3e1('0x4c')]);_0x238133['query']=_[_0xa3e1('0x52')](_0x4f95f1[_0xa3e1('0x51')]);_0x238133[_0xa3e1('0x53')]=_[_0xa3e1('0x55')](_0x238133[_0xa3e1('0x50')],_0x238133[_0xa3e1('0x51')]);_0x331295[_0xa3e1('0x54')]=_[_0xa3e1('0x55')](_0x238133[_0xa3e1('0x50')],qs[_0xa3e1('0x56')](_0x4f95f1[_0xa3e1('0x51')][_0xa3e1('0x56')]));_0x331295['attributes']=_0x331295['attributes'][_0xa3e1('0x64')]?_0x331295[_0xa3e1('0x54')]:_0x238133[_0xa3e1('0x50')];if(_0x4f95f1[_0xa3e1('0x51')][_0xa3e1('0x5e')]){_0x331295[_0xa3e1('0x5f')]=[{'all':!![]}];}_0x331295=_[_0xa3e1('0x65')]({},_0x331295,_0x4f95f1[_0xa3e1('0x66')]);return db[_0xa3e1('0x4b')][_0xa3e1('0x67')](_0x331295)['then'](handleEntityNotFound(_0x4e849e,null))[_0xa3e1('0x28')](respondWithResult(_0x4e849e,null))[_0xa3e1('0x32')](handleError(_0x4e849e,null));};exports[_0xa3e1('0x68')]=function(_0x2d9bcf,_0x1eefdb){return db[_0xa3e1('0x4b')][_0xa3e1('0x68')](_0x2d9bcf['body'],{})[_0xa3e1('0x28')](function(_0x42480c){var _0x5a1275=_0x2d9bcf['user'][_0xa3e1('0x42')]({'plain':!![]});if(!_0x5a1275)throw new Error(_0xa3e1('0x69'));if(_0x5a1275['role']==='user'){var _0x4bdfaf=_0x42480c[_0xa3e1('0x42')]({'plain':!![]});var _0x2cf5f4=_0xa3e1('0x43');return db['UserProfileSection'][_0xa3e1('0x67')]({'where':{'name':_0x2cf5f4,'userProfileId':_0x5a1275['userProfileId']},'raw':!![]})[_0xa3e1('0x28')](function(_0x12d6bd){if(_0x12d6bd&&_0x12d6bd[_0xa3e1('0x6a')]===0x0){return db[_0xa3e1('0x44')][_0xa3e1('0x68')]({'name':_0x4bdfaf[_0xa3e1('0x46')],'resourceId':_0x4bdfaf['id'],'type':_0x12d6bd[_0xa3e1('0x46')],'sectionId':_0x12d6bd['id']},{})[_0xa3e1('0x28')](function(){return _0x42480c;});}else{return _0x42480c;}})[_0xa3e1('0x32')](function(_0x12bfb8){logger[_0xa3e1('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12bfb8);throw _0x12bfb8;});}return _0x42480c;})['then'](respondWithResult(_0x1eefdb,0xc9))['catch'](handleError(_0x1eefdb,null));};exports[_0xa3e1('0x40')]=function(_0x5f5c23,_0x2e7dee){if(_0x5f5c23[_0xa3e1('0x6b')]['id']){delete _0x5f5c23['body']['id'];}return db[_0xa3e1('0x4b')]['find']({'where':{'id':_0x5f5c23['params']['id']},'include':[{'model':db[_0xa3e1('0x63')],'as':_0xa3e1('0x49')}]})[_0xa3e1('0x28')](handleEntityNotFound(_0x2e7dee,null))[_0xa3e1('0x28')](saveUpdates(_0x5f5c23[_0xa3e1('0x6b')],null))[_0xa3e1('0x28')](respondWithResult(_0x2e7dee,null))[_0xa3e1('0x32')](handleError(_0x2e7dee,null));};exports[_0xa3e1('0x41')]=function(_0x403811,_0x43da47){return db[_0xa3e1('0x4b')][_0xa3e1('0x67')]({'where':{'id':_0x403811[_0xa3e1('0x6c')]['id']}})[_0xa3e1('0x28')](handleEntityNotFound(_0x43da47,null))['then'](removeEntity(_0x43da47,null))['catch'](handleError(_0x43da47,null));};exports['describe']=function(_0x4c9a41,_0x5d0177){return db['WhatsappAccount'][_0xa3e1('0x6d')]()[_0xa3e1('0x28')](respondWithResult(_0x5d0177,null))[_0xa3e1('0x32')](handleError(_0x5d0177,null));};exports[_0xa3e1('0x6e')]=function(_0x2c5128,_0x568a8c,_0x4c9f3e){if(_0x2c5128['body']['id']){delete _0x2c5128['body']['id'];}return db[_0xa3e1('0x4b')][_0xa3e1('0x67')]({'where':{'id':_0x2c5128['params']['id']}})['then'](handleEntityNotFound(_0x568a8c,null))['then'](function(_0x1efadd){if(_0x1efadd){_0x2c5128['body'][_0xa3e1('0x6f')]=_0x1efadd['id'];return db[_0xa3e1('0x70')]['create'](_0x2c5128[_0xa3e1('0x6b')]);}})[_0xa3e1('0x28')](respondWithResult(_0x568a8c,null))[_0xa3e1('0x32')](handleError(_0x568a8c,null));};exports[_0xa3e1('0x71')]=function(_0x255b9c,_0x3d82b9,_0x5cc85e){var _0x5709e2={'raw':![],'where':{}};var _0x1cfdbd={};var _0x52f099={'count':0x0,'rows':[]};return db[_0xa3e1('0x4b')]['findOne']({'where':{'id':_0x255b9c['params']['id']}})[_0xa3e1('0x28')](handleEntityNotFound(_0x3d82b9,null))[_0xa3e1('0x28')](function(_0x109196){if(_0x109196){_0x1cfdbd['model']=_[_0xa3e1('0x52')](db[_0xa3e1('0x70')]['rawAttributes']);_0x1cfdbd['query']=_[_0xa3e1('0x52')](_0x255b9c[_0xa3e1('0x51')]);_0x1cfdbd[_0xa3e1('0x53')]=_[_0xa3e1('0x55')](_0x1cfdbd[_0xa3e1('0x50')],_0x1cfdbd[_0xa3e1('0x51')]);_0x5709e2[_0xa3e1('0x54')]=_[_0xa3e1('0x55')](_0x1cfdbd[_0xa3e1('0x50')],qs['fields'](_0x255b9c[_0xa3e1('0x51')][_0xa3e1('0x56')]));_0x5709e2[_0xa3e1('0x54')]=_0x5709e2[_0xa3e1('0x54')]['length']?_0x5709e2[_0xa3e1('0x54')]:_0x1cfdbd['model'];if(!_0x255b9c[_0xa3e1('0x51')][_0xa3e1('0x57')](_0xa3e1('0x58'))){_0x5709e2[_0xa3e1('0x39')]=qs[_0xa3e1('0x39')](_0x255b9c[_0xa3e1('0x51')][_0xa3e1('0x39')]);_0x5709e2[_0xa3e1('0x37')]=qs[_0xa3e1('0x37')](_0x255b9c['query'][_0xa3e1('0x37')]);}_0x5709e2[_0xa3e1('0x59')]=qs['sort'](_0x255b9c['query'][_0xa3e1('0x5a')]);_0x5709e2['where']=qs[_0xa3e1('0x53')](_['pick'](_0x255b9c['query'],_0x1cfdbd[_0xa3e1('0x53')]));_0x5709e2[_0xa3e1('0x5d')][_0xa3e1('0x6f')]=_0x109196['id'];if(_0x255b9c[_0xa3e1('0x51')][_0xa3e1('0x5c')]){_0x5709e2[_0xa3e1('0x5d')]=_[_0xa3e1('0x65')](_0x5709e2['where'],{'$or':_[_0xa3e1('0x4a')](_0x5709e2['attributes'],function(_0x1ab09f){var _0x1c31c4={};_0x1c31c4[_0x1ab09f]={'$like':'%'+_0x255b9c[_0xa3e1('0x51')]['filter']+'%'};return _0x1c31c4;})});}_0x5709e2=_['merge']({},_0x5709e2,_0x255b9c[_0xa3e1('0x66')]);return db[_0xa3e1('0x70')][_0xa3e1('0x3a')]({'where':_0x5709e2[_0xa3e1('0x5d')]})['then'](function(_0x1977c2){_0x52f099['count']=_0x1977c2;if(_0x255b9c['query'][_0xa3e1('0x5e')]){_0x5709e2[_0xa3e1('0x5f')]=[{'all':!![]}];}return db[_0xa3e1('0x70')][_0xa3e1('0x60')](_0x5709e2);})['then'](function(_0x437302){_0x52f099['rows']=_0x437302;return _0x52f099;});}})[_0xa3e1('0x28')](respondWithFilteredResult(_0x3d82b9,_0x5709e2))['catch'](handleError(_0x3d82b9,null));};exports['removeDispositions']=function(_0x22c825,_0x52767c,_0x37f533){return db['WhatsappAccount'][_0xa3e1('0x67')]({'where':{'id':_0x22c825['params']['id']}})[_0xa3e1('0x28')](handleEntityNotFound(_0x52767c,null))[_0xa3e1('0x28')](function(_0x3fc579){if(_0x3fc579){return _0x3fc579[_0xa3e1('0x72')](_0x22c825['query'][_0xa3e1('0x73')]);}})[_0xa3e1('0x28')](respondWithStatusCode(_0x52767c,null))[_0xa3e1('0x32')](handleError(_0x52767c,null));};exports[_0xa3e1('0x74')]=function(_0x19d40d,_0x45def1,_0x51e5d6){if(_0x19d40d['body']['id']){delete _0x19d40d['body']['id'];}return db[_0xa3e1('0x4b')][_0xa3e1('0x67')]({'where':{'id':_0x19d40d[_0xa3e1('0x6c')]['id']}})[_0xa3e1('0x28')](handleEntityNotFound(_0x45def1,null))[_0xa3e1('0x28')](function(_0x4f58f7){if(_0x4f58f7){_0x19d40d[_0xa3e1('0x6b')][_0xa3e1('0x6f')]=_0x4f58f7['id'];return db[_0xa3e1('0x75')][_0xa3e1('0x68')](_0x19d40d[_0xa3e1('0x6b')]);}})[_0xa3e1('0x28')](respondWithResult(_0x45def1,null))[_0xa3e1('0x32')](handleError(_0x45def1,null));};exports[_0xa3e1('0x76')]=function(_0x271843,_0x50139e,_0x4a7d0b){var _0x448a79={'raw':![],'where':{}};var _0x47e083={};var _0x1ec034={'count':0x0,'rows':[]};return db[_0xa3e1('0x4b')][_0xa3e1('0x77')]({'where':{'id':_0x271843['params']['id']}})[_0xa3e1('0x28')](handleEntityNotFound(_0x50139e,null))['then'](function(_0x135a74){if(_0x135a74){_0x47e083[_0xa3e1('0x50')]=_[_0xa3e1('0x52')](db[_0xa3e1('0x75')][_0xa3e1('0x4c')]);_0x47e083[_0xa3e1('0x51')]=_[_0xa3e1('0x52')](_0x271843[_0xa3e1('0x51')]);_0x47e083[_0xa3e1('0x53')]=_[_0xa3e1('0x55')](_0x47e083[_0xa3e1('0x50')],_0x47e083[_0xa3e1('0x51')]);_0x448a79[_0xa3e1('0x54')]=_['intersection'](_0x47e083[_0xa3e1('0x50')],qs[_0xa3e1('0x56')](_0x271843['query'][_0xa3e1('0x56')]));_0x448a79[_0xa3e1('0x54')]=_0x448a79[_0xa3e1('0x54')][_0xa3e1('0x64')]?_0x448a79[_0xa3e1('0x54')]:_0x47e083['model'];if(!_0x271843[_0xa3e1('0x51')][_0xa3e1('0x57')]('nolimit')){_0x448a79[_0xa3e1('0x39')]=qs[_0xa3e1('0x39')](_0x271843[_0xa3e1('0x51')][_0xa3e1('0x39')]);_0x448a79[_0xa3e1('0x37')]=qs['offset'](_0x271843['query'][_0xa3e1('0x37')]);}_0x448a79[_0xa3e1('0x59')]=qs[_0xa3e1('0x5a')](_0x271843['query'][_0xa3e1('0x5a')]);_0x448a79['where']=qs[_0xa3e1('0x53')](_[_0xa3e1('0x5b')](_0x271843[_0xa3e1('0x51')],_0x47e083[_0xa3e1('0x53')]));_0x448a79[_0xa3e1('0x5d')]['WhatsappAccountId']=_0x135a74['id'];if(_0x271843[_0xa3e1('0x51')]['filter']){_0x448a79[_0xa3e1('0x5d')]=_[_0xa3e1('0x65')](_0x448a79[_0xa3e1('0x5d')],{'$or':_[_0xa3e1('0x4a')](_0x448a79['attributes'],function(_0x3d4a2){var _0x9351d7={};_0x9351d7[_0x3d4a2]={'$like':'%'+_0x271843[_0xa3e1('0x51')][_0xa3e1('0x5c')]+'%'};return _0x9351d7;})});}_0x448a79=_[_0xa3e1('0x65')]({},_0x448a79,_0x271843[_0xa3e1('0x66')]);return db[_0xa3e1('0x75')][_0xa3e1('0x3a')]({'where':_0x448a79[_0xa3e1('0x5d')]})[_0xa3e1('0x28')](function(_0x3a2f20){_0x1ec034[_0xa3e1('0x3a')]=_0x3a2f20;if(_0x271843[_0xa3e1('0x51')][_0xa3e1('0x5e')]){_0x448a79['include']=[{'all':!![]}];}return db[_0xa3e1('0x75')][_0xa3e1('0x60')](_0x448a79);})[_0xa3e1('0x28')](function(_0x5b8a8c){_0x1ec034[_0xa3e1('0x61')]=_0x5b8a8c;return _0x1ec034;});}})[_0xa3e1('0x28')](respondWithFilteredResult(_0x50139e,_0x448a79))[_0xa3e1('0x32')](handleError(_0x50139e,null));};exports['removeAnswers']=function(_0x4ddeea,_0x150ca5,_0x228d0e){return db[_0xa3e1('0x4b')]['find']({'where':{'id':_0x4ddeea[_0xa3e1('0x6c')]['id']}})[_0xa3e1('0x28')](handleEntityNotFound(_0x150ca5,null))[_0xa3e1('0x28')](function(_0x3cf229){if(_0x3cf229){return _0x3cf229['removeAnswers'](_0x4ddeea[_0xa3e1('0x51')][_0xa3e1('0x73')]);}})['then'](respondWithStatusCode(_0x150ca5,null))[_0xa3e1('0x32')](handleError(_0x150ca5,null));};exports['addAgents']=function(_0x386ab3,_0x4c956a,_0x338f38){return db[_0xa3e1('0x4b')]['find']({'where':{'id':_0x386ab3['params']['id']}})[_0xa3e1('0x28')](handleEntityNotFound(_0x4c956a,null))[_0xa3e1('0x28')](function(_0x1eae6d){if(_0x1eae6d){return _0x1eae6d['addAgents'](_0x386ab3[_0xa3e1('0x6b')][_0xa3e1('0x73')],_['omit'](_0x386ab3['body'],[_0xa3e1('0x73'),'id'])||{})[_0xa3e1('0x78')](function(_0xb5ad2b){for(var _0x41dc8f=0x0;_0x41dc8f<_0x386ab3[_0xa3e1('0x6b')][_0xa3e1('0x73')][_0xa3e1('0x64')];_0x41dc8f+=0x1){socket['emit'](_0xa3e1('0x79'),{'UserId':Number(_0x386ab3[_0xa3e1('0x6b')][_0xa3e1('0x73')][_0x41dc8f]),'WhatsappAccountId':Number(_0x386ab3['params']['id'])});}return _0xb5ad2b;});}})[_0xa3e1('0x28')](respondWithResult(_0x4c956a,null))[_0xa3e1('0x32')](handleError(_0x4c956a,null));};exports[_0xa3e1('0x7a')]=function(_0x5de975,_0xebffbc,_0x5b0f84){return db[_0xa3e1('0x4b')][_0xa3e1('0x67')]({'where':{'id':_0x5de975['params']['id']}})[_0xa3e1('0x28')](handleEntityNotFound(_0xebffbc,null))['then'](function(_0x2e5650){if(_0x2e5650){return _0x2e5650[_0xa3e1('0x7a')](_0x5de975[_0xa3e1('0x51')][_0xa3e1('0x73')])['then'](function(){if(_[_0xa3e1('0x7b')](_0x5de975[_0xa3e1('0x51')][_0xa3e1('0x73')])){for(var _0x5e68a2=0x0;_0x5e68a2<_0x5de975[_0xa3e1('0x51')][_0xa3e1('0x73')][_0xa3e1('0x64')];_0x5e68a2+=0x1){socket[_0xa3e1('0x7c')]('userWhatsappAccount:remove',{'UserId':Number(_0x5de975[_0xa3e1('0x51')][_0xa3e1('0x73')][_0x5e68a2]),'WhatsappAccountId':Number(_0x5de975[_0xa3e1('0x6c')]['id'])});}}else{socket[_0xa3e1('0x7c')]('userWhatsappAccount:remove',{'UserId':Number(_0x5de975[_0xa3e1('0x51')][_0xa3e1('0x73')]),'WhatsappAccountId':Number(_0x5de975[_0xa3e1('0x6c')]['id'])});}});}})[_0xa3e1('0x28')](respondWithStatusCode(_0xebffbc,null))[_0xa3e1('0x32')](handleError(_0xebffbc,null));};exports[_0xa3e1('0x7d')]=function(_0x42f1ce,_0x42b53f,_0x476cdf){var _0x5bd12e={};var _0x22cf0c={};var _0x1c90ee;var _0x20896a;return db[_0xa3e1('0x4b')][_0xa3e1('0x77')]({'where':{'id':_0x42f1ce[_0xa3e1('0x6c')]['id']}})[_0xa3e1('0x28')](handleEntityNotFound(_0x42b53f,null))[_0xa3e1('0x28')](function(_0x57ecd3){if(_0x57ecd3){_0x1c90ee=_0x57ecd3;_0x22cf0c[_0xa3e1('0x50')]=_[_0xa3e1('0x52')](db['User'][_0xa3e1('0x4c')]);_0x22cf0c[_0xa3e1('0x51')]=_[_0xa3e1('0x52')](_0x42f1ce[_0xa3e1('0x51')]);_0x22cf0c[_0xa3e1('0x53')]=_['intersection'](_0x22cf0c[_0xa3e1('0x50')],_0x22cf0c[_0xa3e1('0x51')]);_0x5bd12e[_0xa3e1('0x54')]=_[_0xa3e1('0x55')](_0x22cf0c[_0xa3e1('0x50')],qs[_0xa3e1('0x56')](_0x42f1ce[_0xa3e1('0x51')][_0xa3e1('0x56')]));_0x5bd12e[_0xa3e1('0x54')]=_0x5bd12e[_0xa3e1('0x54')][_0xa3e1('0x64')]?_0x5bd12e['attributes']:_0x22cf0c['model'];_0x5bd12e[_0xa3e1('0x59')]=qs[_0xa3e1('0x5a')](_0x42f1ce[_0xa3e1('0x51')][_0xa3e1('0x5a')]);_0x5bd12e[_0xa3e1('0x5d')]=qs[_0xa3e1('0x53')](_[_0xa3e1('0x5b')](_0x42f1ce[_0xa3e1('0x51')],_0x22cf0c['filters']));if(_0x42f1ce['query'][_0xa3e1('0x5c')]){_0x5bd12e[_0xa3e1('0x5d')]=_['merge'](_0x5bd12e[_0xa3e1('0x5d')],{'$or':_['map'](_0x5bd12e[_0xa3e1('0x54')],function(_0x4df7cb){var _0x212789={};_0x212789[_0x4df7cb]={'$like':'%'+_0x42f1ce[_0xa3e1('0x51')]['filter']+'%'};return _0x212789;})});}_0x5bd12e=_['merge']({},_0x5bd12e,_0x42f1ce[_0xa3e1('0x66')]);return _0x1c90ee['getAgents'](_0x5bd12e);}})['then'](function(_0x3ed4c1){if(_0x3ed4c1){_0x20896a=_0x3ed4c1[_0xa3e1('0x64')];if(!_0x42f1ce['query']['hasOwnProperty'](_0xa3e1('0x58'))){_0x5bd12e[_0xa3e1('0x39')]=qs[_0xa3e1('0x39')](_0x42f1ce[_0xa3e1('0x51')][_0xa3e1('0x39')]);_0x5bd12e[_0xa3e1('0x37')]=qs[_0xa3e1('0x37')](_0x42f1ce[_0xa3e1('0x51')][_0xa3e1('0x37')]);}return _0x1c90ee['getAgents'](_0x5bd12e);}})[_0xa3e1('0x28')](function(_0x40c2d3){if(_0x40c2d3){return _0x40c2d3?{'count':_0x20896a,'rows':_0x40c2d3}:null;}})[_0xa3e1('0x28')](respondWithResult(_0x42b53f,null))[_0xa3e1('0x32')](handleError(_0x42b53f,null));};exports[_0xa3e1('0x7e')]=function(_0x7eda44,_0x54d40f){var _0x373a76=_0x7eda44[_0xa3e1('0x6c')]['id'];var _0x29fe9b=_0x7eda44[_0xa3e1('0x6b')];var _0x144bdd=0xc8;var _0x3818fb=null;return db[_0xa3e1('0x7f')][_0xa3e1('0x80')]({'isolationLevel':db[_0xa3e1('0x7f')][_0xa3e1('0x81')][_0xa3e1('0x82')][_0xa3e1('0x83')]},function(_0x5e30d1){return db[_0xa3e1('0x4b')][_0xa3e1('0x77')]({'where':{'id':_0x373a76},'transaction':_0x5e30d1})[_0xa3e1('0x28')](function(_0x618968){if(_0x618968){return db[_0xa3e1('0x84')][_0xa3e1('0x41')]({'where':{'WhatsappAccountId':_0x373a76},'transaction':_0x5e30d1})[_0xa3e1('0x28')](function(){var _0x23cecb=_['map'](_0x29fe9b,function(_0x1ef210){_0x1ef210[_0xa3e1('0x6f')]=_0x373a76;return _0x1ef210;});return db[_0xa3e1('0x84')]['bulkCreate'](_0x23cecb,{'transaction':_0x5e30d1});});}else{_0x144bdd=0x194;_0x3818fb=[];}});})[_0xa3e1('0x28')](function(){if(_0x144bdd!==0x194){return db['WhatsappApplication'][_0xa3e1('0x85')]({'where':{'WhatsappAccountId':_0x373a76},'order':_0xa3e1('0x86')})[_0xa3e1('0x28')](function(_0x1f4463){_0x3818fb=_0x1f4463;});}})['catch'](function(_0x15300e){_0x144bdd=0x1f4;logger[_0xa3e1('0x2f')](_0x15300e[_0xa3e1('0x45')]);if(_0x15300e[_0xa3e1('0x46')]){delete _0x15300e['name'];}_0x3818fb=_0x15300e;})[_0xa3e1('0x87')](function(){if(_0x3818fb===null){_0x54d40f[_0xa3e1('0x33')](_0x144bdd);}else{if(_0x144bdd===0x1f4){_0x54d40f['status'](_0x144bdd)[_0xa3e1('0x47')](_0x3818fb);}else{_0x54d40f[_0xa3e1('0x34')](_0x144bdd)[_0xa3e1('0x36')](_0x3818fb);}}});};exports[_0xa3e1('0x88')]=function(_0x3c98f3,_0x186df2,_0x6e808a){var _0x44a4dc={};var _0x1b1b55={};var _0x46a00b;var _0x38fc4b;return db[_0xa3e1('0x4b')][_0xa3e1('0x77')]({'where':{'id':_0x3c98f3[_0xa3e1('0x6c')]['id']}})['then'](handleEntityNotFound(_0x186df2,null))[_0xa3e1('0x28')](function(_0x11f9d8){if(_0x11f9d8){_0x46a00b=_0x11f9d8;_0x1b1b55[_0xa3e1('0x50')]=_[_0xa3e1('0x52')](db[_0xa3e1('0x84')][_0xa3e1('0x4c')]);_0x1b1b55[_0xa3e1('0x51')]=_['keys'](_0x3c98f3[_0xa3e1('0x51')]);_0x1b1b55[_0xa3e1('0x53')]=_['intersection'](_0x1b1b55['model'],_0x1b1b55[_0xa3e1('0x51')]);_0x44a4dc[_0xa3e1('0x54')]=_[_0xa3e1('0x55')](_0x1b1b55[_0xa3e1('0x50')],qs[_0xa3e1('0x56')](_0x3c98f3[_0xa3e1('0x51')][_0xa3e1('0x56')]));_0x44a4dc[_0xa3e1('0x54')]=_0x44a4dc['attributes']['length']?_0x44a4dc[_0xa3e1('0x54')]:_0x1b1b55[_0xa3e1('0x50')];_0x44a4dc['order']=qs[_0xa3e1('0x5a')](_0x3c98f3[_0xa3e1('0x51')]['sort']);_0x44a4dc[_0xa3e1('0x5d')]=qs[_0xa3e1('0x53')](_[_0xa3e1('0x5b')](_0x3c98f3['query'],_0x1b1b55[_0xa3e1('0x53')]));if(_0x3c98f3[_0xa3e1('0x51')]['filter']){_0x44a4dc[_0xa3e1('0x5d')]=_['merge'](_0x44a4dc[_0xa3e1('0x5d')],{'$or':_[_0xa3e1('0x4a')](_0x44a4dc[_0xa3e1('0x54')],function(_0x83dff0){var _0x37d154={};_0x37d154[_0x83dff0]={'$like':'%'+_0x3c98f3[_0xa3e1('0x51')]['filter']+'%'};return _0x37d154;})});}_0x44a4dc=_[_0xa3e1('0x65')]({},_0x44a4dc,_0x3c98f3['options']);return _0x46a00b['getApplications'](_0x44a4dc);}})['then'](function(_0x51eff7){if(_0x51eff7){_0x38fc4b=_0x51eff7['length'];if(!_0x3c98f3[_0xa3e1('0x51')]['hasOwnProperty'](_0xa3e1('0x58'))){_0x44a4dc['limit']=qs[_0xa3e1('0x39')](_0x3c98f3[_0xa3e1('0x51')]['limit']);_0x44a4dc['offset']=qs[_0xa3e1('0x37')](_0x3c98f3[_0xa3e1('0x51')]['offset']);}return _0x46a00b[_0xa3e1('0x88')](_0x44a4dc);}})['then'](function(_0x4e91ba){if(_0x4e91ba){return _0x4e91ba?{'count':_0x38fc4b,'rows':_0x4e91ba}:null;}})[_0xa3e1('0x28')](respondWithResult(_0x186df2,null))[_0xa3e1('0x32')](handleError(_0x186df2,null));};exports[_0xa3e1('0x89')]=function(_0x38c490,_0x4ebd65,_0x465df2){var _0x342abe={'channel':'whatsapp'};var _0x558bbd=[];var _0x51bd58=[];var _0x5f4224={};return db['WhatsappAccount']['find']({'where':{'id':_0x38c490['params']['id']},'include':[{'model':db[_0xa3e1('0x84')],'as':_0xa3e1('0x8a')}]})[_0xa3e1('0x28')](handleEntityNotFound(_0x4ebd65,null))[_0xa3e1('0x28')](function(_0x18f183){_0x342abe[_0xa3e1('0x8b')]=_0x18f183;if(_0x342abe['account']&&_0x342abe[_0xa3e1('0x8b')]['type']===_0xa3e1('0x8c')&&_0x38c490[_0xa3e1('0x6b')][_0xa3e1('0x8d')]){if(_0x38c490[_0xa3e1('0x6b')]['statuses']['length']===0x0)return;if(_0x38c490[_0xa3e1('0x6b')]['statuses'][0x0]['state']!==_0xa3e1('0x8e'))return;return db[_0xa3e1('0x8f')][_0xa3e1('0x40')]({'read':!![],'readAt':_0x38c490[_0xa3e1('0x6b')]['statuses'][0x0][_0xa3e1('0x90')]},{'where':{'messageId':_0x38c490[_0xa3e1('0x6b')]['statuses'][0x0][_0xa3e1('0x91')]},'individualHooks':!![]})[_0xa3e1('0x28')](function(_0x448687){return _0x4ebd65[_0xa3e1('0x34')](0xc8)['json'](_0x448687);});}_0x342abe[_0xa3e1('0x92')]=_[_0xa3e1('0x93')](_0x18f183[_0xa3e1('0x8a')],[_0xa3e1('0x86')],[_0xa3e1('0x94')]);if(_0x342abe[_0xa3e1('0x8b')][_0xa3e1('0x8a')]){delete _0x342abe['account'][_0xa3e1('0x8a')];}return db['CmContact']['describe']()[_0xa3e1('0x28')](function(_0x22e70b){if(!_0x22e70b){throw new db['Sequelize'][(_0xa3e1('0x95'))](_0xa3e1('0x96'));}_0x558bbd=_[_0xa3e1('0x97')](_[_0xa3e1('0x52')](_0x22e70b),[_0xa3e1('0x98'),_0xa3e1('0x99')]);_0x51bd58=_[_0xa3e1('0x97')](_['keys'](_0x22e70b),[_0xa3e1('0x98'),_0xa3e1('0x99'),_0xa3e1('0x9a'),'ListId']);_0x342abe['body']={'mapKey':'mobile'};if(_0x342abe['account']&&_0x342abe[_0xa3e1('0x8b')]['type']===_0xa3e1('0x9b')){_0x342abe[_0xa3e1('0x6b')]['from']=_0x38c490[_0xa3e1('0x6b')][_0xa3e1('0x9c')][_0xa3e1('0x9d')](_0xa3e1('0x9e'),'');_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0x6b')]=_0x38c490[_0xa3e1('0x6b')]['Body'];_0x342abe[_0xa3e1('0x6b')]['messageId']=_0x38c490[_0xa3e1('0x6b')][_0xa3e1('0x9f')];}if(_0x342abe[_0xa3e1('0x8b')]&&_0x342abe[_0xa3e1('0x8b')][_0xa3e1('0x4e')]===_0xa3e1('0x8c')){_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0xa0')]=_0x38c490[_0xa3e1('0x6b')][_0xa3e1('0xa1')][0x0][_0xa3e1('0xa0')];_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0x6b')]=_0x38c490[_0xa3e1('0x6b')][_0xa3e1('0xa1')][0x0][_0xa3e1('0x30')][_0xa3e1('0x6b')];_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0xa2')]=_0x38c490[_0xa3e1('0x6b')]['notifications'][0x0]['message_id'];}if(_0x342abe['body']['id']){delete _0x342abe['body']['id'];}if(_['isNil'](_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0xa0')])){throw new db[(_0xa3e1('0xa3'))]['ValidationError'](_0xa3e1('0xa4'));}if(_['isNil'](_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0x6b')])||_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0x6b')]===''){throw new db[(_0xa3e1('0xa3'))][(_0xa3e1('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa3e1('0xa5')](_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0xa6')])){throw new db[(_0xa3e1('0xa3'))]['ValidationError'](_0xa3e1('0xa7')+_0x51bd58);}if(!_[_0xa3e1('0xa8')](_0x51bd58,_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0xa6')])){throw new db['Sequelize'][(_0xa3e1('0x95'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x51bd58);}_0x5f4224[_0x342abe[_0xa3e1('0x6b')]['mapKey']]=_0x342abe[_0xa3e1('0x6b')]['from'];return db[_0xa3e1('0xa9')][_0xa3e1('0x67')]({'where':{'id':_0x342abe[_0xa3e1('0x8b')][_0xa3e1('0xaa')]},'include':[{'model':db[_0xa3e1('0xab')],'as':'Contacts','where':_0x5f4224,'limit':0x1,'order':[['updatedAt',_0xa3e1('0xac')]]}]});})[_0xa3e1('0x28')](handleEntityNotFound(_0x4ebd65,null))['then'](function(_0x4baec0){if(_0x4baec0){_0x342abe[_0xa3e1('0xad')]=_[_0xa3e1('0xae')](_0x4baec0,[_0xa3e1('0xaf')]);if(_0x4baec0['Contacts'][_0xa3e1('0x64')]){return _0x4baec0[_0xa3e1('0xaf')][0x0];}var _0x464677=_[_0xa3e1('0x1f')](_0x342abe[_0xa3e1('0x6b')],{'firstName':_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0xa0')],'ListId':_0x4baec0['id']});_0x464677[_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0xa6')]]=_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0xa0')];return db[_0xa3e1('0xab')][_0xa3e1('0x68')](_0x464677,{'fields':_0x558bbd,'raw':!![]});}})['then'](handleEntityNotFound(_0x4ebd65,null))[_0xa3e1('0x28')](function(_0x2d531b){if(_0x2d531b){_0x342abe['contact']=_0x2d531b;var _0x3dcae9={'ContactId':_0x2d531b['id'],'phone':_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0xa0')],'WhatsappAccountId':_0x38c490[_0xa3e1('0x6c')]['id']};var _0x2830a5={'ContactId':_0x2d531b['id'],'WhatsappAccountId':_0x38c490[_0xa3e1('0x6c')]['id'],'closed':![]};return db[_0xa3e1('0xb0')][_0xa3e1('0x67')]({'where':_0x2830a5})['then'](function(_0x1763e1){if(_0x1763e1){return[_0x1763e1,![]];}return db[_0xa3e1('0xb0')][_0xa3e1('0x68')](_0x3dcae9)[_0xa3e1('0x28')](function(_0x182e9e){return[_0x182e9e,!![]];});});}})[_0xa3e1('0x78')](function(_0x59d184,_0x55207d){_0x342abe[_0xa3e1('0xb1')]=_0x59d184[_0xa3e1('0x42')]({'plain':!![]});_0x342abe[_0xa3e1('0xb1')][_0xa3e1('0xb2')]=![];if(_0x55207d){if(_0x342abe['account'][_0xa3e1('0xb3')]){_0x342abe[_0xa3e1('0x92')][_0xa3e1('0xb4')]({'id':0x0,'priority':_0x342abe[_0xa3e1('0x92')][_0xa3e1('0x64')]+0x1,'app':_0xa3e1('0xb5'),'appdata':_0xa3e1('0xb6'),'interval':_0xa3e1('0xb7')});}_0x342abe[_0xa3e1('0xb1')][_0xa3e1('0xb2')]=!![];}return db[_0xa3e1('0x8f')][_0xa3e1('0x68')]({'phone':_0x342abe['body'][_0xa3e1('0xa0')],'messageId':_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0xa2')],'body':_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0x6b')],'WhatsappAccountId':_0x38c490[_0xa3e1('0x6c')]['id'],'WhatsappInteractionId':_0x59d184['id'],'direction':'in','ContactId':_0x59d184[_0xa3e1('0xb8')],'AttachmentId':_0x342abe[_0xa3e1('0x6b')][_0xa3e1('0xb9')]});})[_0xa3e1('0x28')](function(_0x3aafa2){_0x342abe[_0xa3e1('0x30')]=_0x3aafa2;if(_0x342abe[_0xa3e1('0xb1')]['UserId']){return db['User']['find']({'attributes':['id',_0xa3e1('0x46')],'where':{'id':_0x342abe[_0xa3e1('0xb1')][_0xa3e1('0xba')]}})[_0xa3e1('0x28')](function(_0x597a97){if(_0x597a97){_0x342abe['applications'][_0xa3e1('0xbb')]({'id':0x0,'priority':0x0,'app':_0xa3e1('0xbc'),'appdata':_0x597a97['name']+','+(_0x342abe['account'][_0xa3e1('0xbd')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa3e1('0xbe'),_0xa3e1('0xbf'),_0x342abe);});}return respondWithRpcPromise(_0xa3e1('0xbe'),'startRouting',_0x342abe);})[_0xa3e1('0x28')](function(_0x4570e8){if(_0x4570e8){var _0x4404c5=0xc8;var _0x4c54e8='receiveMessage';logger['info'](_0xa3e1('0x2d'),_0x4c54e8,_0x4404c5,_0xa3e1('0xc0'));logger[_0xa3e1('0x2c')](_0xa3e1('0xc1'),_0x4c54e8,_0x4404c5,'entity\x20found',JSON[_0xa3e1('0x2e')](_0x4570e8));if(_0x342abe[_0xa3e1('0x8b')]['type']===_0xa3e1('0x9b')){return _0x4ebd65[_0xa3e1('0x34')](_0x4404c5)['set'](_0xa3e1('0xc2'),_0xa3e1('0xc3'))[_0xa3e1('0x47')]('\x0a');}else{return _0x4ebd65[_0xa3e1('0x34')](_0x4404c5)['json'](_0x4570e8);}}});})['catch'](handleError(_0x4ebd65,null));};exports['send']=function(_0x2b709d,_0x1a75d1,_0x2f47d4){var _0x4003d3,_0x447d6c,_0x453ff3;if(_[_0xa3e1('0xa5')](_0x2b709d[_0xa3e1('0x6b')]['body'])||_0x2b709d[_0xa3e1('0x6b')][_0xa3e1('0x6b')]===''){throw new db[(_0xa3e1('0xa3'))][(_0xa3e1('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa3e1('0xa5')](_0x2b709d[_0xa3e1('0x6b')]['to'])){throw new db['Sequelize'][(_0xa3e1('0x95'))]('to\x20is\x20mandatory');}_0x4003d3=_0x2b709d[_0xa3e1('0x6b')]['to'];return db[_0xa3e1('0x4b')]['find']({'where':{'id':_0x2b709d[_0xa3e1('0x6c')]['id']},'include':[{'model':db[_0xa3e1('0xa9')],'as':_0xa3e1('0xc4'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x4003d3},'limit':0x1,'order':[['updatedAt',_0xa3e1('0xac')]]}]}]})[_0xa3e1('0x28')](handleEntityNotFound(_0x1a75d1,null))['then'](function(_0x330467){if(_0x330467&&_0x330467[_0xa3e1('0xc4')]){_0x447d6c=_0x330467['get']({'plain':!![]});if(_0x447d6c[_0xa3e1('0xc4')]&&_0x447d6c[_0xa3e1('0xc4')][_0xa3e1('0xaf')][_0xa3e1('0x64')]){return _0x447d6c[_0xa3e1('0xc4')][_0xa3e1('0xaf')][0x0];}return db[_0xa3e1('0xab')][_0xa3e1('0x68')](_['defaults'](_0x2b709d['body'],{'firstName':_0x4003d3,'mobile':_0x4003d3,'phone':_0x4003d3,'ListId':_0x447d6c[_0xa3e1('0xaa')]}));}})[_0xa3e1('0x28')](handleEntityNotFound(_0x1a75d1,null))['then'](function(_0x59ed3a){if(_0x59ed3a){_0x453ff3=_0x59ed3a;return db[_0xa3e1('0xb0')][_0xa3e1('0x67')]({'where':{'ContactId':_0x453ff3['id'],'closed':![],'WhatsappAccountId':_0x447d6c['id']}})[_0xa3e1('0x28')](function(_0x243ce4){if(_0x243ce4){return[_0x243ce4,![]];}return db[_0xa3e1('0xb0')][_0xa3e1('0x68')]({'UserId':_0x2b709d[_0xa3e1('0xc5')]['id'],'ContactId':_0x453ff3['id'],'WhatsappAccountId':_0x447d6c['id'],'phone':_0x4003d3,'firstMsgDirection':_0xa3e1('0xc6'),'Messages':[_[_0xa3e1('0x65')](_0x2b709d[_0xa3e1('0x6b')],{'read':![],'body':_0x2b709d[_0xa3e1('0x6b')][_0xa3e1('0x6b')],'phone':_0x4003d3,'WhatsappAccountId':_0x447d6c['id'],'UserId':_0x2b709d[_0xa3e1('0xc5')]['id'],'ContactId':_0x453ff3['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xa3e1('0xc7')}]})['then'](function(_0x57007b){return[_0x57007b,!![]];});});}})['spread'](function(_0x2e40c9,_0x4bbed0){if(_0x4bbed0){return _0x2e40c9;}return db[_0xa3e1('0x8f')][_0xa3e1('0x68')](_[_0xa3e1('0x65')](_0x2b709d[_0xa3e1('0x6b')],{'read':![],'body':_0x2b709d[_0xa3e1('0x6b')][_0xa3e1('0x6b')],'phone':_0x4003d3,'WhatsappAccountId':_0x447d6c['id'],'WhatsappInteractionId':_0x2e40c9['id'],'UserId':_0x2b709d['user']['id'],'ContactId':_0x453ff3['id']}))[_0xa3e1('0x28')](function(_0x462f44){_0x2e40c9[_0xa3e1('0xc8')]['Messages']=[];_0x2e40c9['dataValues'][_0xa3e1('0xc7')]['push'](_0x462f44[_0xa3e1('0xc8')]);return _0x2e40c9;});})[_0xa3e1('0x28')](respondWithResult(_0x1a75d1,null))['catch'](handleError(_0x1a75d1,null));}; \ No newline at end of file +var _0x1205=['agent','Start','startRouting','info','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','text/xml','to\x20is\x20mandatory','List','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','WhatsappAccounts','UserProfileResource','destroy','end','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','WhatsappAccount','includeAll','findAll','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','pick','include','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','transaction','sequelize','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','account','sinch','statuses','state','read','WhatsappMessage','message_id','applications','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','twilio','from','replace','whatsapp:','messageId','MessageSid','notifications','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','WhatsappInteraction','push','close','unmanaged','*,*,*,*','interaction','created','AttachmentId','UserId','User','unshift'];(function(_0x17ba0c,_0x28ea77){var _0x5d148b=function(_0x19cf7b){while(--_0x19cf7b){_0x17ba0c['push'](_0x17ba0c['shift']());}};_0x5d148b(++_0x28ea77);}(_0x1205,0x193));var _0x5120=function(_0x2be0fc,_0x52c662){_0x2be0fc=_0x2be0fc-0x0;var _0x104b6c=_0x1205[_0x2be0fc];return _0x104b6c;};'use strict';var emlformat=require(_0x5120('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5120('0x1'));var jsonpatch=require(_0x5120('0x2'));var rp=require(_0x5120('0x3'));var moment=require(_0x5120('0x4'));var BPromise=require(_0x5120('0x5'));var Mustache=require(_0x5120('0x6'));var util=require(_0x5120('0x7'));var path=require(_0x5120('0x8'));var sox=require(_0x5120('0x9'));var csv=require(_0x5120('0xa'));var ejs=require(_0x5120('0xb'));var fs=require('fs');var fs_extra=require(_0x5120('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5120('0xd'));var jsforce=require(_0x5120('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5120('0xa'));var querystring=require('querystring');var Papa=require(_0x5120('0xf'));var Redis=require(_0x5120('0x10'));var authService=require(_0x5120('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5120('0x12'));var hardwareService=require(_0x5120('0x13'));var logger=require(_0x5120('0x14'))(_0x5120('0x15'));var utils=require(_0x5120('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5120('0x17'));var db=require('../../mysqldb')['db'];config[_0x5120('0x18')]=_[_0x5120('0x19')](config[_0x5120('0x18')],{'host':_0x5120('0x1a'),'port':0x18eb});var socket=require(_0x5120('0x1b'))(new Redis(config[_0x5120('0x18')]));require(_0x5120('0x1c'))[_0x5120('0x1d')](socket);var jayson=require(_0x5120('0x1e'));var client=jayson[_0x5120('0x1f')][_0x5120('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x2e2afd,_0x5122c3,_0x423ae7,_0x5789c5){return new BPromise(function(_0x59ad96,_0x10273e){var _0xe99d33=_0x5789c5||client;return _0xe99d33['request'](_0x2e2afd,_0x423ae7)[_0x5120('0x21')](function(_0x58113d){logger['info'](_0x5120('0x22'),_0x5122c3,_0x5120('0x23'));logger[_0x5120('0x24')](_0x5120('0x25'),_0x5122c3,_0x5120('0x23'),JSON[_0x5120('0x26')](_0x58113d));if(_0x58113d[_0x5120('0x27')]){if(_0x58113d[_0x5120('0x27')][_0x5120('0x28')]===0x1f4){logger['error'](_0x5120('0x22'),_0x5122c3,_0x58113d[_0x5120('0x27')]['message']);return _0x10273e(_0x58113d[_0x5120('0x27')]['message']);}logger[_0x5120('0x27')](_0x5120('0x22'),_0x5122c3,_0x58113d[_0x5120('0x27')]['message']);return _0x59ad96(_0x58113d['error'][_0x5120('0x29')]);}else{logger['info'](_0x5120('0x22'),_0x5122c3,_0x5120('0x23'));_0x59ad96(_0x58113d[_0x5120('0x2a')][_0x5120('0x29')]);}})['catch'](function(_0x15a1a7){logger[_0x5120('0x27')](_0x5120('0x22'),_0x5122c3,_0x15a1a7);_0x10273e(_0x15a1a7);});});}function respondWithStatusCode(_0x3d3707,_0x243609){_0x243609=_0x243609||0xcc;return function(_0xe36045){if(_0xe36045){return _0x3d3707[_0x5120('0x2b')](_0x243609);}return _0x3d3707[_0x5120('0x2c')](_0x243609)['end']();};}function respondWithResult(_0x2589fa,_0x297950){_0x297950=_0x297950||0xc8;return function(_0x403148){if(_0x403148){return _0x2589fa[_0x5120('0x2c')](_0x297950)[_0x5120('0x2d')](_0x403148);}};}function respondWithFilteredResult(_0x1ccc57,_0x15f73e){return function(_0x1de05c){if(_0x1de05c){var _0x1225b0=typeof _0x15f73e[_0x5120('0x2e')]===_0x5120('0x2f')&&typeof _0x15f73e[_0x5120('0x30')]===_0x5120('0x2f');var _0x193bdc=_0x1de05c[_0x5120('0x31')];var _0x2401c1=_0x1225b0?0x0:_0x15f73e[_0x5120('0x2e')];var _0x34a9e7=_0x1225b0?_0x1de05c[_0x5120('0x31')]:_0x15f73e[_0x5120('0x2e')]+_0x15f73e[_0x5120('0x30')];var _0x1fbeb2;if(_0x34a9e7>=_0x193bdc){_0x34a9e7=_0x193bdc;_0x1fbeb2=0xc8;}else{_0x1fbeb2=0xce;}_0x1ccc57['status'](_0x1fbeb2);return _0x1ccc57[_0x5120('0x32')](_0x5120('0x33'),_0x2401c1+'-'+_0x34a9e7+'/'+_0x193bdc)[_0x5120('0x2d')](_0x1de05c);}return null;};}function patchUpdates(_0x2a463d){return function(_0x23ea6b){try{jsonpatch[_0x5120('0x34')](_0x23ea6b,_0x2a463d,!![]);}catch(_0x8aef00){return BPromise[_0x5120('0x35')](_0x8aef00);}return _0x23ea6b[_0x5120('0x36')]();};}function saveUpdates(_0x19c26c,_0x558386){return function(_0x412d08){if(_0x412d08){return _0x412d08[_0x5120('0x37')](_0x19c26c)[_0x5120('0x21')](function(_0x3aa599){return _0x3aa599;});}return null;};}function removeEntity(_0x2a360b,_0x3c2cbf){return function(_0x265eea){if(_0x265eea){return _0x265eea['destroy']()['then'](function(){var _0x5f392d=_0x265eea[_0x5120('0x38')]({'plain':!![]});var _0x31a418=_0x5120('0x39');return db[_0x5120('0x3a')][_0x5120('0x3b')]({'where':{'type':_0x31a418,'resourceId':_0x5f392d['id']}})['then'](function(){return _0x265eea;});})['then'](function(){_0x2a360b[_0x5120('0x2c')](0xcc)[_0x5120('0x3c')]();});}};}function handleEntityNotFound(_0x279ccd,_0x442aeb){return function(_0x1bebaf){if(!_0x1bebaf){_0x279ccd[_0x5120('0x2b')](0x194);}return _0x1bebaf;};}function handleError(_0x1c3c03,_0x4cd079){_0x4cd079=_0x4cd079||0x1f4;return function(_0x491305){logger[_0x5120('0x27')](_0x491305[_0x5120('0x3d')]);if(_0x491305[_0x5120('0x3e')]){delete _0x491305[_0x5120('0x3e')];}_0x1c3c03[_0x5120('0x2c')](_0x4cd079)[_0x5120('0x3f')](_0x491305);};}exports['index']=function(_0x4763d0,_0x2fba7f){var _0x1ead95={'include':[{'model':db[_0x5120('0x40')],'as':_0x5120('0x41')}]},_0x5c6078={},_0x466f36={'count':0x0,'rows':[]};var _0x1b3c35=_[_0x5120('0x42')](db['WhatsappAccount'][_0x5120('0x43')],function(_0x234c8e){return{'name':_0x234c8e['fieldName'],'type':_0x234c8e[_0x5120('0x44')][_0x5120('0x45')]};});_0x5c6078[_0x5120('0x46')]=_['map'](_0x1b3c35,_0x5120('0x3e'));_0x5c6078[_0x5120('0x47')]=_['keys'](_0x4763d0['query']);_0x5c6078[_0x5120('0x48')]=_[_0x5120('0x49')](_0x5c6078[_0x5120('0x46')],_0x5c6078['query']);_0x1ead95[_0x5120('0x4a')]=_[_0x5120('0x49')](_0x5c6078['model'],qs[_0x5120('0x4b')](_0x4763d0[_0x5120('0x47')][_0x5120('0x4b')]));_0x1ead95[_0x5120('0x4a')]=_0x1ead95['attributes']['length']?_0x1ead95[_0x5120('0x4a')]:_0x5c6078[_0x5120('0x46')];if(!_0x4763d0[_0x5120('0x47')][_0x5120('0x4c')](_0x5120('0x4d'))){_0x1ead95['limit']=qs[_0x5120('0x30')](_0x4763d0['query'][_0x5120('0x30')]);_0x1ead95[_0x5120('0x2e')]=qs[_0x5120('0x2e')](_0x4763d0[_0x5120('0x47')][_0x5120('0x2e')]);}_0x1ead95[_0x5120('0x4e')]=qs[_0x5120('0x4f')](_0x4763d0[_0x5120('0x47')][_0x5120('0x4f')]);_0x1ead95[_0x5120('0x50')]=qs[_0x5120('0x48')](_['pick'](_0x4763d0[_0x5120('0x47')],_0x5c6078[_0x5120('0x48')]),_0x1b3c35);if(_0x4763d0[_0x5120('0x47')][_0x5120('0x51')]){_0x1ead95['where']=_[_0x5120('0x52')](_0x1ead95[_0x5120('0x50')],{'$or':_['map'](_0x1b3c35,function(_0x2c0e84){if(_0x2c0e84['type']!==_0x5120('0x53')){var _0x159954={};_0x159954[_0x2c0e84[_0x5120('0x3e')]]={'$like':'%'+_0x4763d0[_0x5120('0x47')][_0x5120('0x51')]+'%'};return _0x159954;}})});}_0x1ead95=_[_0x5120('0x52')]({},_0x1ead95,_0x4763d0[_0x5120('0x54')]);var _0x28b4da={'where':_0x1ead95[_0x5120('0x50')]};return db[_0x5120('0x55')]['count'](_0x28b4da)[_0x5120('0x21')](function(_0x53da3b){_0x466f36[_0x5120('0x31')]=_0x53da3b;if(_0x4763d0['query'][_0x5120('0x56')]){_0x1ead95['include']=[{'all':!![]}];}return db[_0x5120('0x55')][_0x5120('0x57')](_0x1ead95);})[_0x5120('0x21')](function(_0x3c04f2){_0x466f36['rows']=_0x3c04f2;return _0x466f36;})['then'](respondWithFilteredResult(_0x2fba7f,_0x1ead95))[_0x5120('0x58')](handleError(_0x2fba7f,null));};exports[_0x5120('0x59')]=function(_0x17d14b,_0x1c968f){var _0x1e81f3={'raw':![],'where':{'id':_0x17d14b[_0x5120('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x5120('0x41')}]},_0x1f55ed={};_0x1f55ed[_0x5120('0x46')]=_[_0x5120('0x5b')](db[_0x5120('0x55')]['rawAttributes']);_0x1f55ed[_0x5120('0x47')]=_['keys'](_0x17d14b['query']);_0x1f55ed[_0x5120('0x48')]=_[_0x5120('0x49')](_0x1f55ed[_0x5120('0x46')],_0x1f55ed['query']);_0x1e81f3[_0x5120('0x4a')]=_[_0x5120('0x49')](_0x1f55ed[_0x5120('0x46')],qs[_0x5120('0x4b')](_0x17d14b[_0x5120('0x47')][_0x5120('0x4b')]));_0x1e81f3[_0x5120('0x4a')]=_0x1e81f3[_0x5120('0x4a')][_0x5120('0x5c')]?_0x1e81f3['attributes']:_0x1f55ed[_0x5120('0x46')];if(_0x17d14b['query'][_0x5120('0x56')]){_0x1e81f3['include']=[{'all':!![]}];}_0x1e81f3=_[_0x5120('0x52')]({},_0x1e81f3,_0x17d14b[_0x5120('0x54')]);return db[_0x5120('0x55')][_0x5120('0x5d')](_0x1e81f3)[_0x5120('0x21')](handleEntityNotFound(_0x1c968f,null))[_0x5120('0x21')](respondWithResult(_0x1c968f,null))[_0x5120('0x58')](handleError(_0x1c968f,null));};exports[_0x5120('0x5e')]=function(_0x4b6056,_0x75acd){return db[_0x5120('0x55')]['create'](_0x4b6056[_0x5120('0x5f')],{})[_0x5120('0x21')](function(_0x42af93){var _0x2e674d=_0x4b6056[_0x5120('0x60')]['get']({'plain':!![]});if(!_0x2e674d)throw new Error(_0x5120('0x61'));if(_0x2e674d[_0x5120('0x62')]===_0x5120('0x60')){var _0x513878=_0x42af93[_0x5120('0x38')]({'plain':!![]});var _0x2a15a6='WhatsappAccounts';return db[_0x5120('0x63')][_0x5120('0x5d')]({'where':{'name':_0x2a15a6,'userProfileId':_0x2e674d[_0x5120('0x64')]},'raw':!![]})[_0x5120('0x21')](function(_0x27f380){if(_0x27f380&&_0x27f380[_0x5120('0x65')]===0x0){return db[_0x5120('0x3a')][_0x5120('0x5e')]({'name':_0x513878['name'],'resourceId':_0x513878['id'],'type':_0x27f380[_0x5120('0x3e')],'sectionId':_0x27f380['id']},{})[_0x5120('0x21')](function(){return _0x42af93;});}else{return _0x42af93;}})[_0x5120('0x58')](function(_0x67a37){logger[_0x5120('0x27')](_0x5120('0x66'),_0x67a37);throw _0x67a37;});}return _0x42af93;})[_0x5120('0x21')](respondWithResult(_0x75acd,0xc9))[_0x5120('0x58')](handleError(_0x75acd,null));};exports[_0x5120('0x37')]=function(_0x5d8a41,_0x5137f7){if(_0x5d8a41['body']['id']){delete _0x5d8a41[_0x5120('0x5f')]['id'];}return db[_0x5120('0x55')][_0x5120('0x5d')]({'where':{'id':_0x5d8a41['params']['id']},'include':[{'model':db['Pause'],'as':_0x5120('0x41')}]})[_0x5120('0x21')](handleEntityNotFound(_0x5137f7,null))['then'](saveUpdates(_0x5d8a41[_0x5120('0x5f')],null))[_0x5120('0x21')](respondWithResult(_0x5137f7,null))[_0x5120('0x58')](handleError(_0x5137f7,null));};exports[_0x5120('0x3b')]=function(_0x103adb,_0x4c1093){return db['WhatsappAccount'][_0x5120('0x5d')]({'where':{'id':_0x103adb[_0x5120('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4c1093,null))[_0x5120('0x21')](removeEntity(_0x4c1093,null))[_0x5120('0x58')](handleError(_0x4c1093,null));};exports[_0x5120('0x67')]=function(_0x2dc0a8,_0x49b1e7){return db[_0x5120('0x55')]['describe']()['then'](respondWithResult(_0x49b1e7,null))[_0x5120('0x58')](handleError(_0x49b1e7,null));};exports[_0x5120('0x68')]=function(_0x4ed3d6,_0x11ee1b,_0x8192e3){if(_0x4ed3d6[_0x5120('0x5f')]['id']){delete _0x4ed3d6[_0x5120('0x5f')]['id'];}return db['WhatsappAccount'][_0x5120('0x5d')]({'where':{'id':_0x4ed3d6[_0x5120('0x5a')]['id']}})[_0x5120('0x21')](handleEntityNotFound(_0x11ee1b,null))[_0x5120('0x21')](function(_0x486d5c){if(_0x486d5c){_0x4ed3d6[_0x5120('0x5f')][_0x5120('0x69')]=_0x486d5c['id'];return db[_0x5120('0x6a')][_0x5120('0x5e')](_0x4ed3d6[_0x5120('0x5f')]);}})[_0x5120('0x21')](respondWithResult(_0x11ee1b,null))[_0x5120('0x58')](handleError(_0x11ee1b,null));};exports[_0x5120('0x6b')]=function(_0x18d01d,_0x38daf5,_0x1c7176){var _0x23127b={'raw':![],'where':{}};var _0x8b5ecd={};var _0xdb308e={'count':0x0,'rows':[]};return db[_0x5120('0x55')][_0x5120('0x6c')]({'where':{'id':_0x18d01d[_0x5120('0x5a')]['id']}})[_0x5120('0x21')](handleEntityNotFound(_0x38daf5,null))[_0x5120('0x21')](function(_0x43f173){if(_0x43f173){_0x8b5ecd[_0x5120('0x46')]=_[_0x5120('0x5b')](db[_0x5120('0x6a')][_0x5120('0x43')]);_0x8b5ecd[_0x5120('0x47')]=_[_0x5120('0x5b')](_0x18d01d['query']);_0x8b5ecd[_0x5120('0x48')]=_['intersection'](_0x8b5ecd[_0x5120('0x46')],_0x8b5ecd['query']);_0x23127b[_0x5120('0x4a')]=_[_0x5120('0x49')](_0x8b5ecd[_0x5120('0x46')],qs[_0x5120('0x4b')](_0x18d01d[_0x5120('0x47')][_0x5120('0x4b')]));_0x23127b[_0x5120('0x4a')]=_0x23127b[_0x5120('0x4a')][_0x5120('0x5c')]?_0x23127b[_0x5120('0x4a')]:_0x8b5ecd[_0x5120('0x46')];if(!_0x18d01d[_0x5120('0x47')][_0x5120('0x4c')](_0x5120('0x4d'))){_0x23127b['limit']=qs['limit'](_0x18d01d['query'][_0x5120('0x30')]);_0x23127b['offset']=qs['offset'](_0x18d01d[_0x5120('0x47')][_0x5120('0x2e')]);}_0x23127b[_0x5120('0x4e')]=qs[_0x5120('0x4f')](_0x18d01d[_0x5120('0x47')][_0x5120('0x4f')]);_0x23127b[_0x5120('0x50')]=qs[_0x5120('0x48')](_[_0x5120('0x6d')](_0x18d01d[_0x5120('0x47')],_0x8b5ecd[_0x5120('0x48')]));_0x23127b[_0x5120('0x50')][_0x5120('0x69')]=_0x43f173['id'];if(_0x18d01d[_0x5120('0x47')][_0x5120('0x51')]){_0x23127b[_0x5120('0x50')]=_['merge'](_0x23127b[_0x5120('0x50')],{'$or':_['map'](_0x23127b[_0x5120('0x4a')],function(_0x44ed08){var _0x288ba7={};_0x288ba7[_0x44ed08]={'$like':'%'+_0x18d01d[_0x5120('0x47')][_0x5120('0x51')]+'%'};return _0x288ba7;})});}_0x23127b=_['merge']({},_0x23127b,_0x18d01d[_0x5120('0x54')]);return db[_0x5120('0x6a')]['count']({'where':_0x23127b[_0x5120('0x50')]})[_0x5120('0x21')](function(_0x130bbd){_0xdb308e['count']=_0x130bbd;if(_0x18d01d[_0x5120('0x47')][_0x5120('0x56')]){_0x23127b[_0x5120('0x6e')]=[{'all':!![]}];}return db[_0x5120('0x6a')]['findAll'](_0x23127b);})[_0x5120('0x21')](function(_0x2bdc87){_0xdb308e[_0x5120('0x6f')]=_0x2bdc87;return _0xdb308e;});}})[_0x5120('0x21')](respondWithFilteredResult(_0x38daf5,_0x23127b))[_0x5120('0x58')](handleError(_0x38daf5,null));};exports[_0x5120('0x70')]=function(_0x80d401,_0x529390,_0x54bdbb){return db[_0x5120('0x55')]['find']({'where':{'id':_0x80d401[_0x5120('0x5a')]['id']}})[_0x5120('0x21')](handleEntityNotFound(_0x529390,null))[_0x5120('0x21')](function(_0x3a9a78){if(_0x3a9a78){return _0x3a9a78[_0x5120('0x70')](_0x80d401[_0x5120('0x47')]['ids']);}})[_0x5120('0x21')](respondWithStatusCode(_0x529390,null))[_0x5120('0x58')](handleError(_0x529390,null));};exports[_0x5120('0x71')]=function(_0x3dede1,_0x1dc5ae,_0x4a685c){if(_0x3dede1['body']['id']){delete _0x3dede1[_0x5120('0x5f')]['id'];}return db[_0x5120('0x55')][_0x5120('0x5d')]({'where':{'id':_0x3dede1['params']['id']}})[_0x5120('0x21')](handleEntityNotFound(_0x1dc5ae,null))['then'](function(_0xba759d){if(_0xba759d){_0x3dede1[_0x5120('0x5f')][_0x5120('0x69')]=_0xba759d['id'];return db[_0x5120('0x72')][_0x5120('0x5e')](_0x3dede1[_0x5120('0x5f')]);}})[_0x5120('0x21')](respondWithResult(_0x1dc5ae,null))[_0x5120('0x58')](handleError(_0x1dc5ae,null));};exports[_0x5120('0x73')]=function(_0x342733,_0x2000cc,_0x5441e8){var _0x2fce39={'raw':![],'where':{}};var _0x4ef7f8={};var _0x13373c={'count':0x0,'rows':[]};return db[_0x5120('0x55')][_0x5120('0x6c')]({'where':{'id':_0x342733['params']['id']}})['then'](handleEntityNotFound(_0x2000cc,null))[_0x5120('0x21')](function(_0x43c8f7){if(_0x43c8f7){_0x4ef7f8[_0x5120('0x46')]=_[_0x5120('0x5b')](db['CannedAnswer']['rawAttributes']);_0x4ef7f8[_0x5120('0x47')]=_['keys'](_0x342733[_0x5120('0x47')]);_0x4ef7f8[_0x5120('0x48')]=_[_0x5120('0x49')](_0x4ef7f8['model'],_0x4ef7f8[_0x5120('0x47')]);_0x2fce39[_0x5120('0x4a')]=_['intersection'](_0x4ef7f8[_0x5120('0x46')],qs[_0x5120('0x4b')](_0x342733[_0x5120('0x47')]['fields']));_0x2fce39[_0x5120('0x4a')]=_0x2fce39[_0x5120('0x4a')]['length']?_0x2fce39[_0x5120('0x4a')]:_0x4ef7f8[_0x5120('0x46')];if(!_0x342733[_0x5120('0x47')][_0x5120('0x4c')](_0x5120('0x4d'))){_0x2fce39[_0x5120('0x30')]=qs[_0x5120('0x30')](_0x342733[_0x5120('0x47')][_0x5120('0x30')]);_0x2fce39[_0x5120('0x2e')]=qs['offset'](_0x342733['query'][_0x5120('0x2e')]);}_0x2fce39['order']=qs['sort'](_0x342733['query']['sort']);_0x2fce39[_0x5120('0x50')]=qs[_0x5120('0x48')](_[_0x5120('0x6d')](_0x342733[_0x5120('0x47')],_0x4ef7f8[_0x5120('0x48')]));_0x2fce39[_0x5120('0x50')]['WhatsappAccountId']=_0x43c8f7['id'];if(_0x342733[_0x5120('0x47')][_0x5120('0x51')]){_0x2fce39[_0x5120('0x50')]=_[_0x5120('0x52')](_0x2fce39[_0x5120('0x50')],{'$or':_[_0x5120('0x42')](_0x2fce39[_0x5120('0x4a')],function(_0x2336c2){var _0x54f150={};_0x54f150[_0x2336c2]={'$like':'%'+_0x342733['query'][_0x5120('0x51')]+'%'};return _0x54f150;})});}_0x2fce39=_[_0x5120('0x52')]({},_0x2fce39,_0x342733[_0x5120('0x54')]);return db['CannedAnswer'][_0x5120('0x31')]({'where':_0x2fce39[_0x5120('0x50')]})[_0x5120('0x21')](function(_0x181ecf){_0x13373c[_0x5120('0x31')]=_0x181ecf;if(_0x342733[_0x5120('0x47')]['includeAll']){_0x2fce39[_0x5120('0x6e')]=[{'all':!![]}];}return db[_0x5120('0x72')][_0x5120('0x57')](_0x2fce39);})[_0x5120('0x21')](function(_0x2ae7db){_0x13373c[_0x5120('0x6f')]=_0x2ae7db;return _0x13373c;});}})[_0x5120('0x21')](respondWithFilteredResult(_0x2000cc,_0x2fce39))['catch'](handleError(_0x2000cc,null));};exports[_0x5120('0x74')]=function(_0x3b6232,_0x21c448,_0x4a8729){return db[_0x5120('0x55')][_0x5120('0x5d')]({'where':{'id':_0x3b6232[_0x5120('0x5a')]['id']}})['then'](handleEntityNotFound(_0x21c448,null))['then'](function(_0x217f10){if(_0x217f10){return _0x217f10[_0x5120('0x74')](_0x3b6232['query'][_0x5120('0x75')]);}})['then'](respondWithStatusCode(_0x21c448,null))[_0x5120('0x58')](handleError(_0x21c448,null));};exports[_0x5120('0x76')]=function(_0x45a8e6,_0x44f5bd,_0x2a953c){return db['WhatsappAccount']['find']({'where':{'id':_0x45a8e6[_0x5120('0x5a')]['id']}})[_0x5120('0x21')](handleEntityNotFound(_0x44f5bd,null))[_0x5120('0x21')](function(_0x5961b3){if(_0x5961b3){return _0x5961b3[_0x5120('0x76')](_0x45a8e6['body'][_0x5120('0x75')],_[_0x5120('0x77')](_0x45a8e6[_0x5120('0x5f')],[_0x5120('0x75'),'id'])||{})[_0x5120('0x78')](function(_0x543427){for(var _0x46ec58=0x0;_0x46ec58<_0x45a8e6[_0x5120('0x5f')]['ids']['length'];_0x46ec58+=0x1){socket[_0x5120('0x79')](_0x5120('0x7a'),{'UserId':Number(_0x45a8e6['body'][_0x5120('0x75')][_0x46ec58]),'WhatsappAccountId':Number(_0x45a8e6[_0x5120('0x5a')]['id'])});}return _0x543427;});}})[_0x5120('0x21')](respondWithResult(_0x44f5bd,null))[_0x5120('0x58')](handleError(_0x44f5bd,null));};exports[_0x5120('0x7b')]=function(_0x40ac6a,_0x59555d,_0x260be3){return db['WhatsappAccount'][_0x5120('0x5d')]({'where':{'id':_0x40ac6a[_0x5120('0x5a')]['id']}})['then'](handleEntityNotFound(_0x59555d,null))[_0x5120('0x21')](function(_0x140d8d){if(_0x140d8d){return _0x140d8d['removeAgents'](_0x40ac6a[_0x5120('0x47')][_0x5120('0x75')])[_0x5120('0x21')](function(){if(_[_0x5120('0x7c')](_0x40ac6a[_0x5120('0x47')][_0x5120('0x75')])){for(var _0x2da00e=0x0;_0x2da00e<_0x40ac6a[_0x5120('0x47')][_0x5120('0x75')][_0x5120('0x5c')];_0x2da00e+=0x1){socket[_0x5120('0x79')](_0x5120('0x7d'),{'UserId':Number(_0x40ac6a[_0x5120('0x47')]['ids'][_0x2da00e]),'WhatsappAccountId':Number(_0x40ac6a['params']['id'])});}}else{socket[_0x5120('0x79')](_0x5120('0x7d'),{'UserId':Number(_0x40ac6a[_0x5120('0x47')]['ids']),'WhatsappAccountId':Number(_0x40ac6a[_0x5120('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x59555d,null))[_0x5120('0x58')](handleError(_0x59555d,null));};exports[_0x5120('0x7e')]=function(_0x32de7e,_0x28f174,_0x1c0e45){var _0x21e90e={};var _0x346581={};var _0x1d15e4;var _0x172cc8;return db[_0x5120('0x55')][_0x5120('0x6c')]({'where':{'id':_0x32de7e[_0x5120('0x5a')]['id']}})[_0x5120('0x21')](handleEntityNotFound(_0x28f174,null))['then'](function(_0x2b63bf){if(_0x2b63bf){_0x1d15e4=_0x2b63bf;_0x346581[_0x5120('0x46')]=_[_0x5120('0x5b')](db['User'][_0x5120('0x43')]);_0x346581[_0x5120('0x47')]=_['keys'](_0x32de7e[_0x5120('0x47')]);_0x346581[_0x5120('0x48')]=_[_0x5120('0x49')](_0x346581[_0x5120('0x46')],_0x346581['query']);_0x21e90e[_0x5120('0x4a')]=_[_0x5120('0x49')](_0x346581[_0x5120('0x46')],qs[_0x5120('0x4b')](_0x32de7e[_0x5120('0x47')][_0x5120('0x4b')]));_0x21e90e[_0x5120('0x4a')]=_0x21e90e[_0x5120('0x4a')][_0x5120('0x5c')]?_0x21e90e['attributes']:_0x346581['model'];_0x21e90e[_0x5120('0x4e')]=qs['sort'](_0x32de7e[_0x5120('0x47')][_0x5120('0x4f')]);_0x21e90e['where']=qs['filters'](_[_0x5120('0x6d')](_0x32de7e[_0x5120('0x47')],_0x346581[_0x5120('0x48')]));if(_0x32de7e['query']['filter']){_0x21e90e['where']=_['merge'](_0x21e90e[_0x5120('0x50')],{'$or':_['map'](_0x21e90e[_0x5120('0x4a')],function(_0x3f50ea){var _0x3f62bf={};_0x3f62bf[_0x3f50ea]={'$like':'%'+_0x32de7e['query'][_0x5120('0x51')]+'%'};return _0x3f62bf;})});}_0x21e90e=_[_0x5120('0x52')]({},_0x21e90e,_0x32de7e['options']);return _0x1d15e4[_0x5120('0x7e')](_0x21e90e);}})['then'](function(_0x4ef262){if(_0x4ef262){_0x172cc8=_0x4ef262[_0x5120('0x5c')];if(!_0x32de7e['query'][_0x5120('0x4c')]('nolimit')){_0x21e90e[_0x5120('0x30')]=qs[_0x5120('0x30')](_0x32de7e[_0x5120('0x47')][_0x5120('0x30')]);_0x21e90e[_0x5120('0x2e')]=qs[_0x5120('0x2e')](_0x32de7e[_0x5120('0x47')]['offset']);}return _0x1d15e4[_0x5120('0x7e')](_0x21e90e);}})[_0x5120('0x21')](function(_0x13cc95){if(_0x13cc95){return _0x13cc95?{'count':_0x172cc8,'rows':_0x13cc95}:null;}})['then'](respondWithResult(_0x28f174,null))[_0x5120('0x58')](handleError(_0x28f174,null));};exports['addApplications']=function(_0x23a25,_0x25d36e){var _0x118812=_0x23a25[_0x5120('0x5a')]['id'];var _0x3228c0=_0x23a25['body'];var _0x19a2f6=0xc8;var _0x4a0d23=null;return db['sequelize'][_0x5120('0x7f')]({'isolationLevel':db[_0x5120('0x80')]['Transaction'][_0x5120('0x81')]['READ_COMMITTED']},function(_0x11b4d9){return db[_0x5120('0x55')][_0x5120('0x6c')]({'where':{'id':_0x118812},'transaction':_0x11b4d9})['then'](function(_0x3b82aa){if(_0x3b82aa){return db[_0x5120('0x82')][_0x5120('0x3b')]({'where':{'WhatsappAccountId':_0x118812},'transaction':_0x11b4d9})[_0x5120('0x21')](function(){var _0x5f40b5=_[_0x5120('0x42')](_0x3228c0,function(_0x296265){_0x296265['WhatsappAccountId']=_0x118812;return _0x296265;});return db['WhatsappApplication'][_0x5120('0x83')](_0x5f40b5,{'transaction':_0x11b4d9});});}else{_0x19a2f6=0x194;_0x4a0d23=[];}});})['then'](function(){if(_0x19a2f6!==0x194){return db[_0x5120('0x82')][_0x5120('0x84')]({'where':{'WhatsappAccountId':_0x118812},'order':_0x5120('0x85')})[_0x5120('0x21')](function(_0x39f060){_0x4a0d23=_0x39f060;});}})[_0x5120('0x58')](function(_0xc3c8e0){_0x19a2f6=0x1f4;logger['error'](_0xc3c8e0[_0x5120('0x3d')]);if(_0xc3c8e0[_0x5120('0x3e')]){delete _0xc3c8e0['name'];}_0x4a0d23=_0xc3c8e0;})[_0x5120('0x86')](function(){if(_0x4a0d23===null){_0x25d36e[_0x5120('0x2b')](_0x19a2f6);}else{if(_0x19a2f6===0x1f4){_0x25d36e[_0x5120('0x2c')](_0x19a2f6)['send'](_0x4a0d23);}else{_0x25d36e[_0x5120('0x2c')](_0x19a2f6)[_0x5120('0x2d')](_0x4a0d23);}}});};exports['getApplications']=function(_0x185f6c,_0x2a5772,_0x28f019){var _0x5ec889={};var _0x2f9c13={};var _0xf0f411;var _0x3f7db7;return db[_0x5120('0x55')]['findOne']({'where':{'id':_0x185f6c[_0x5120('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2a5772,null))[_0x5120('0x21')](function(_0x520545){if(_0x520545){_0xf0f411=_0x520545;_0x2f9c13[_0x5120('0x46')]=_[_0x5120('0x5b')](db['WhatsappApplication']['rawAttributes']);_0x2f9c13['query']=_[_0x5120('0x5b')](_0x185f6c['query']);_0x2f9c13[_0x5120('0x48')]=_[_0x5120('0x49')](_0x2f9c13[_0x5120('0x46')],_0x2f9c13['query']);_0x5ec889[_0x5120('0x4a')]=_[_0x5120('0x49')](_0x2f9c13['model'],qs[_0x5120('0x4b')](_0x185f6c[_0x5120('0x47')][_0x5120('0x4b')]));_0x5ec889[_0x5120('0x4a')]=_0x5ec889['attributes']['length']?_0x5ec889[_0x5120('0x4a')]:_0x2f9c13['model'];_0x5ec889[_0x5120('0x4e')]=qs['sort'](_0x185f6c['query'][_0x5120('0x4f')]);_0x5ec889[_0x5120('0x50')]=qs[_0x5120('0x48')](_[_0x5120('0x6d')](_0x185f6c[_0x5120('0x47')],_0x2f9c13[_0x5120('0x48')]));if(_0x185f6c[_0x5120('0x47')][_0x5120('0x51')]){_0x5ec889[_0x5120('0x50')]=_[_0x5120('0x52')](_0x5ec889['where'],{'$or':_[_0x5120('0x42')](_0x5ec889[_0x5120('0x4a')],function(_0x531ce0){var _0x1c0f33={};_0x1c0f33[_0x531ce0]={'$like':'%'+_0x185f6c['query'][_0x5120('0x51')]+'%'};return _0x1c0f33;})});}_0x5ec889=_[_0x5120('0x52')]({},_0x5ec889,_0x185f6c['options']);return _0xf0f411[_0x5120('0x87')](_0x5ec889);}})[_0x5120('0x21')](function(_0x44f592){if(_0x44f592){_0x3f7db7=_0x44f592[_0x5120('0x5c')];if(!_0x185f6c[_0x5120('0x47')][_0x5120('0x4c')](_0x5120('0x4d'))){_0x5ec889[_0x5120('0x30')]=qs['limit'](_0x185f6c[_0x5120('0x47')][_0x5120('0x30')]);_0x5ec889['offset']=qs[_0x5120('0x2e')](_0x185f6c[_0x5120('0x47')][_0x5120('0x2e')]);}return _0xf0f411['getApplications'](_0x5ec889);}})[_0x5120('0x21')](function(_0x5a1fbc){if(_0x5a1fbc){return _0x5a1fbc?{'count':_0x3f7db7,'rows':_0x5a1fbc}:null;}})['then'](respondWithResult(_0x2a5772,null))[_0x5120('0x58')](handleError(_0x2a5772,null));};exports[_0x5120('0x88')]=function(_0x26bdda,_0x36ea77,_0x3a32a9){var _0x1c880f={'channel':_0x5120('0x89')};var _0x1dce8d=[];var _0x40bc55=[];var _0x3a711e={};return db[_0x5120('0x55')][_0x5120('0x5d')]({'where':{'id':_0x26bdda[_0x5120('0x5a')]['id']},'include':[{'model':db['WhatsappApplication'],'as':'Applications'}]})[_0x5120('0x21')](handleEntityNotFound(_0x36ea77,null))['then'](function(_0x49a6e0){_0x1c880f[_0x5120('0x8a')]=_0x49a6e0;if(_0x1c880f[_0x5120('0x8a')]&&_0x1c880f[_0x5120('0x8a')]['type']===_0x5120('0x8b')&&_0x26bdda[_0x5120('0x5f')]['statuses']){if(_0x26bdda[_0x5120('0x5f')]['statuses'][_0x5120('0x5c')]===0x0)return;if(_0x26bdda['body'][_0x5120('0x8c')][0x0][_0x5120('0x8d')]!==_0x5120('0x8e'))return;return db[_0x5120('0x8f')][_0x5120('0x37')]({'read':!![],'readAt':_0x26bdda[_0x5120('0x5f')][_0x5120('0x8c')][0x0]['timestamp']},{'where':{'messageId':_0x26bdda[_0x5120('0x5f')][_0x5120('0x8c')][0x0][_0x5120('0x90')]},'individualHooks':!![]})['then'](function(_0x45844e){return _0x36ea77['status'](0xc8)[_0x5120('0x2d')](_0x45844e);});}_0x1c880f[_0x5120('0x91')]=_[_0x5120('0x92')](_0x49a6e0[_0x5120('0x93')],['priority'],[_0x5120('0x94')]);if(_0x1c880f['account'][_0x5120('0x93')]){delete _0x1c880f[_0x5120('0x8a')][_0x5120('0x93')];}return db[_0x5120('0x95')]['describe']()[_0x5120('0x21')](function(_0x399522){if(!_0x399522){throw new db[(_0x5120('0x96'))][(_0x5120('0x97'))](_0x5120('0x98'));}_0x1dce8d=_['difference'](_[_0x5120('0x5b')](_0x399522),[_0x5120('0x99'),_0x5120('0x9a')]);_0x40bc55=_[_0x5120('0x9b')](_['keys'](_0x399522),[_0x5120('0x99'),_0x5120('0x9a'),_0x5120('0x9c'),_0x5120('0x9d')]);_0x1c880f['body']={'mapKey':'mobile'};if(_0x1c880f[_0x5120('0x8a')]&&_0x1c880f[_0x5120('0x8a')]['type']===_0x5120('0x9e')){_0x1c880f['body'][_0x5120('0x9f')]=_0x26bdda['body']['From'][_0x5120('0xa0')](_0x5120('0xa1'),'');_0x1c880f[_0x5120('0x5f')]['body']=_0x26bdda['body']['Body'];_0x1c880f['body'][_0x5120('0xa2')]=_0x26bdda[_0x5120('0x5f')][_0x5120('0xa3')];}if(_0x1c880f['account']&&_0x1c880f[_0x5120('0x8a')]['type']===_0x5120('0x8b')){_0x1c880f[_0x5120('0x5f')][_0x5120('0x9f')]=_0x26bdda['body'][_0x5120('0xa4')][0x0][_0x5120('0x9f')];_0x1c880f[_0x5120('0x5f')][_0x5120('0x5f')]=_0x26bdda['body'][_0x5120('0xa4')][0x0]['message']['body'];_0x1c880f['body'][_0x5120('0xa2')]=_0x26bdda[_0x5120('0x5f')]['notifications'][0x0][_0x5120('0x90')];}if(_0x1c880f[_0x5120('0x5f')]['id']){delete _0x1c880f[_0x5120('0x5f')]['id'];}if(_['isNil'](_0x1c880f[_0x5120('0x5f')][_0x5120('0x9f')])){throw new db[(_0x5120('0x96'))][(_0x5120('0x97'))](_0x5120('0xa5'));}if(_[_0x5120('0xa6')](_0x1c880f[_0x5120('0x5f')][_0x5120('0x5f')])||_0x1c880f['body']['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5120('0xa6')](_0x1c880f[_0x5120('0x5f')][_0x5120('0xa7')])){throw new db[(_0x5120('0x96'))][(_0x5120('0x97'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x40bc55);}if(!_[_0x5120('0xa8')](_0x40bc55,_0x1c880f[_0x5120('0x5f')][_0x5120('0xa7')])){throw new db[(_0x5120('0x96'))][(_0x5120('0x97'))](_0x5120('0xa9')+_0x40bc55);}_0x3a711e[_0x1c880f[_0x5120('0x5f')][_0x5120('0xa7')]]=_0x1c880f['body']['from'];return db[_0x5120('0xaa')]['find']({'where':{'id':_0x1c880f[_0x5120('0x8a')][_0x5120('0x9d')]},'include':[{'model':db[_0x5120('0x95')],'as':_0x5120('0xab'),'where':_0x3a711e,'limit':0x1,'order':[[_0x5120('0x9a'),_0x5120('0xac')]]}]});})[_0x5120('0x21')](handleEntityNotFound(_0x36ea77,null))[_0x5120('0x21')](function(_0x3790ed){if(_0x3790ed){_0x1c880f[_0x5120('0xad')]=_['omit'](_0x3790ed,['Contacts']);if(_0x3790ed[_0x5120('0xab')][_0x5120('0x5c')]){return _0x3790ed[_0x5120('0xab')][0x0];}var _0x106b2c=_[_0x5120('0x19')](_0x1c880f[_0x5120('0x5f')],{'firstName':_0x1c880f[_0x5120('0x5f')][_0x5120('0x9f')],'ListId':_0x3790ed['id']});_0x106b2c[_0x1c880f['body'][_0x5120('0xa7')]]=_0x1c880f['body'][_0x5120('0x9f')];return db[_0x5120('0x95')][_0x5120('0x5e')](_0x106b2c,{'fields':_0x1dce8d,'raw':!![]});}})['then'](handleEntityNotFound(_0x36ea77,null))[_0x5120('0x21')](function(_0x4b1760){if(_0x4b1760){_0x1c880f['contact']=_0x4b1760;var _0x37d4d9={'ContactId':_0x4b1760['id'],'phone':_0x1c880f[_0x5120('0x5f')][_0x5120('0x9f')],'WhatsappAccountId':_0x26bdda[_0x5120('0x5a')]['id']};var _0x23588d={'ContactId':_0x4b1760['id'],'WhatsappAccountId':_0x26bdda[_0x5120('0x5a')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x5120('0x5d')]({'where':_0x23588d})[_0x5120('0x21')](function(_0x3d0688){if(_0x3d0688){return[_0x3d0688,![]];}return db[_0x5120('0xae')]['create'](_0x37d4d9)[_0x5120('0x21')](function(_0x537cab){return[_0x537cab,!![]];});});}})[_0x5120('0x78')](function(_0x142378,_0x5298ca){_0x1c880f['interaction']=_0x142378['get']({'plain':!![]});_0x1c880f['interaction']['created']=![];if(_0x5298ca){if(_0x1c880f['account']['autoclose']){_0x1c880f[_0x5120('0x91')][_0x5120('0xaf')]({'id':0x0,'priority':_0x1c880f[_0x5120('0x91')]['length']+0x1,'app':_0x5120('0xb0'),'appdata':_0x5120('0xb1'),'interval':_0x5120('0xb2')});}_0x1c880f[_0x5120('0xb3')][_0x5120('0xb4')]=!![];}return db[_0x5120('0x8f')][_0x5120('0x5e')]({'phone':_0x1c880f['body'][_0x5120('0x9f')],'messageId':_0x1c880f[_0x5120('0x5f')][_0x5120('0xa2')],'body':_0x1c880f['body']['body'],'WhatsappAccountId':_0x26bdda['params']['id'],'WhatsappInteractionId':_0x142378['id'],'direction':'in','ContactId':_0x142378['ContactId'],'AttachmentId':_0x1c880f[_0x5120('0x5f')][_0x5120('0xb5')]});})[_0x5120('0x21')](function(_0x461060){_0x1c880f[_0x5120('0x29')]=_0x461060;if(_0x1c880f[_0x5120('0xb3')][_0x5120('0xb6')]){return db[_0x5120('0xb7')][_0x5120('0x5d')]({'attributes':['id',_0x5120('0x3e')],'where':{'id':_0x1c880f['interaction'][_0x5120('0xb6')]}})[_0x5120('0x21')](function(_0x59e53f){if(_0x59e53f){_0x1c880f['applications'][_0x5120('0xb8')]({'id':0x0,'priority':0x0,'app':_0x5120('0xb9'),'appdata':_0x59e53f[_0x5120('0x3e')]+','+(_0x1c880f['account']['waitForTheAssignedAgent']||0xa),'interval':_0x5120('0xb2')});}return respondWithRpcPromise(_0x5120('0xba'),_0x5120('0xbb'),_0x1c880f);});}return respondWithRpcPromise('Start',_0x5120('0xbb'),_0x1c880f);})['then'](function(_0x4c640d){if(_0x4c640d){var _0x152130=0xc8;var _0x5e635f='receiveMessage';logger[_0x5120('0xbc')](_0x5120('0x25'),_0x5e635f,_0x152130,'entity\x20found');logger[_0x5120('0x24')](_0x5120('0xbd'),_0x5e635f,_0x152130,_0x5120('0xbe'),JSON[_0x5120('0x26')](_0x4c640d));if(_0x1c880f['account'][_0x5120('0x44')]===_0x5120('0x9e')){return _0x36ea77['status'](_0x152130)[_0x5120('0x32')]('Content-Type',_0x5120('0xbf'))[_0x5120('0x3f')]('\x0a');}else{return _0x36ea77[_0x5120('0x2c')](_0x152130)['json'](_0x4c640d);}}});})[_0x5120('0x58')](handleError(_0x36ea77,null));};exports[_0x5120('0x3f')]=function(_0x36bd33,_0x1cdb4f,_0xe0ea6b){var _0x365e2a,_0x2641f3,_0x35a7dc;if(_['isNil'](_0x36bd33[_0x5120('0x5f')][_0x5120('0x5f')])||_0x36bd33[_0x5120('0x5f')]['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5120('0xa6')](_0x36bd33[_0x5120('0x5f')]['to'])){throw new db[(_0x5120('0x96'))]['ValidationError'](_0x5120('0xc0'));}_0x365e2a=_0x36bd33['body']['to'];return db[_0x5120('0x55')][_0x5120('0x5d')]({'where':{'id':_0x36bd33[_0x5120('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x5120('0xc1'),'include':[{'model':db[_0x5120('0x95')],'as':'Contacts','where':{'mobile':_0x365e2a},'limit':0x1,'order':[[_0x5120('0x9a'),_0x5120('0xac')]]}]}]})[_0x5120('0x21')](handleEntityNotFound(_0x1cdb4f,null))[_0x5120('0x21')](function(_0x109e0a){if(_0x109e0a&&_0x109e0a[_0x5120('0xc1')]){_0x2641f3=_0x109e0a[_0x5120('0x38')]({'plain':!![]});if(_0x2641f3[_0x5120('0xc1')]&&_0x2641f3[_0x5120('0xc1')][_0x5120('0xab')][_0x5120('0x5c')]){return _0x2641f3[_0x5120('0xc1')][_0x5120('0xab')][0x0];}return db[_0x5120('0x95')]['create'](_[_0x5120('0x19')](_0x36bd33[_0x5120('0x5f')],{'firstName':_0x365e2a,'mobile':_0x365e2a,'phone':_0x365e2a,'ListId':_0x2641f3[_0x5120('0x9d')]}));}})[_0x5120('0x21')](handleEntityNotFound(_0x1cdb4f,null))[_0x5120('0x21')](function(_0x1649f3){if(_0x1649f3){_0x35a7dc=_0x1649f3;return db[_0x5120('0xae')][_0x5120('0x5d')]({'where':{'ContactId':_0x35a7dc['id'],'closed':![],'WhatsappAccountId':_0x2641f3['id']}})[_0x5120('0x21')](function(_0x4ddff7){if(_0x4ddff7){return[_0x4ddff7,![]];}return db[_0x5120('0xae')][_0x5120('0x5e')]({'UserId':_0x36bd33[_0x5120('0x60')]['id'],'ContactId':_0x35a7dc['id'],'WhatsappAccountId':_0x2641f3['id'],'phone':_0x365e2a,'firstMsgDirection':'out','Messages':[_[_0x5120('0x52')](_0x36bd33[_0x5120('0x5f')],{'read':![],'body':_0x36bd33[_0x5120('0x5f')][_0x5120('0x5f')],'phone':_0x365e2a,'WhatsappAccountId':_0x2641f3['id'],'UserId':_0x36bd33[_0x5120('0x60')]['id'],'ContactId':_0x35a7dc['id']})]},{'include':[{'model':db[_0x5120('0x8f')],'as':_0x5120('0xc2')}]})[_0x5120('0x21')](function(_0x4e6a90){return[_0x4e6a90,!![]];});});}})[_0x5120('0x78')](function(_0x3837ba,_0x2f4b7d){if(_0x2f4b7d){return _0x3837ba;}return db[_0x5120('0x8f')][_0x5120('0x5e')](_[_0x5120('0x52')](_0x36bd33[_0x5120('0x5f')],{'read':![],'body':_0x36bd33[_0x5120('0x5f')][_0x5120('0x5f')],'phone':_0x365e2a,'WhatsappAccountId':_0x2641f3['id'],'WhatsappInteractionId':_0x3837ba['id'],'UserId':_0x36bd33[_0x5120('0x60')]['id'],'ContactId':_0x35a7dc['id']}))[_0x5120('0x21')](function(_0x315b03){_0x3837ba['dataValues'][_0x5120('0xc2')]=[];_0x3837ba[_0x5120('0xc3')]['Messages'][_0x5120('0xaf')](_0x315b03['dataValues']);return _0x3837ba;});})[_0x5120('0x21')](respondWithResult(_0x1cdb4f,null))['catch'](handleError(_0x1cdb4f,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 6661826..8411238 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 _0x8ffc=['update','remove','emit','hook','events','../../mysqldb','setMaxListeners'];(function(_0x3484aa,_0x1d7793){var _0x4920c0=function(_0x5a7f01){while(--_0x5a7f01){_0x3484aa['push'](_0x3484aa['shift']());}};_0x4920c0(++_0x1d7793);}(_0x8ffc,0xcf));var _0xc8ff=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x8ffc[_0x34843e];return _0x598f7f;};'use strict';var EventEmitter=require(_0xc8ff('0x0'));var WhatsappAccount=require(_0xc8ff('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc8ff('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc8ff('0x3'),'afterDestroy':_0xc8ff('0x4')};function emitEvent(_0x493bee){return function(_0x1002f9,_0x23dd8e,_0x4356e1){WhatsappAccountEvents['emit'](_0x493bee+':'+_0x1002f9['id'],_0x1002f9);WhatsappAccountEvents[_0xc8ff('0x5')](_0x493bee,_0x1002f9);_0x4356e1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xc8ff('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x11df=['WhatsappAccount','setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x5c398d,_0x46307f){var _0x3229a7=function(_0x5e21b8){while(--_0x5e21b8){_0x5c398d['push'](_0x5c398d['shift']());}};_0x3229a7(++_0x46307f);}(_0x11df,0xce));var _0xf11d=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x11df[_0x13e741];return _0x3f8bb3;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xf11d('0x0'))['db'][_0xf11d('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf11d('0x2')](0x0);var events={'afterCreate':_0xf11d('0x3'),'afterUpdate':_0xf11d('0x4'),'afterDestroy':_0xf11d('0x5')};function emitEvent(_0x1844a5){return function(_0x384c59,_0x2be997,_0x1c1d62){WhatsappAccountEvents[_0xf11d('0x6')](_0x1844a5+':'+_0x384c59['id'],_0x384c59);WhatsappAccountEvents[_0xf11d('0x6')](_0x1844a5,_0x384c59);_0x1c1d62(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xf11d('0x7')](e,emitEvent(event));}}module[_0xf11d('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 12d1980..0c2485a 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 _0xb1e6=['rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x33f1e2,_0x2111bb){var _0x581421=function(_0x3a2628){while(--_0x3a2628){_0x33f1e2['push'](_0x33f1e2['shift']());}};_0x581421(++_0x2111bb);}(_0xb1e6,0x1c9));var _0x6b1e=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0xb1e6[_0xb66df];return _0x42a702;};'use strict';var _=require(_0x6b1e('0x0'));var util=require(_0x6b1e('0x1'));var logger=require(_0x6b1e('0x2'))(_0x6b1e('0x3'));var moment=require(_0x6b1e('0x4'));var BPromise=require(_0x6b1e('0x5'));var rp=require(_0x6b1e('0x6'));var fs=require('fs');var path=require(_0x6b1e('0x7'));var rimraf=require(_0x6b1e('0x8'));var config=require(_0x6b1e('0x9'));var attributes=require(_0x6b1e('0xa'));module[_0x6b1e('0xb')]=function(_0x39bb9c,_0x2504a6){return _0x39bb9c[_0x6b1e('0xc')](_0x6b1e('0xd'),attributes,{'tableName':_0x6b1e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb48b=['moment','bluebird','path','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','util','../../config/logger'];(function(_0x4c8e52,_0x3ec27d){var _0x360c05=function(_0x2b5c63){while(--_0x2b5c63){_0x4c8e52['push'](_0x4c8e52['shift']());}};_0x360c05(++_0x3ec27d);}(_0xb48b,0x1cb));var _0xbb48=function(_0x452a15,_0x4e228a){_0x452a15=_0x452a15-0x0;var _0x5709c7=_0xb48b[_0x452a15];return _0x5709c7;};'use strict';var _=require(_0xbb48('0x0'));var util=require(_0xbb48('0x1'));var logger=require(_0xbb48('0x2'))('api');var moment=require(_0xbb48('0x3'));var BPromise=require(_0xbb48('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb48('0x5'));var rimraf=require('rimraf');var config=require(_0xbb48('0x6'));var attributes=require(_0xbb48('0x7'));module[_0xbb48('0x8')]=function(_0x1c9251,_0x506b97){return _0x1c9251[_0xbb48('0x9')](_0xbb48('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index b0b8b22..f9499c9 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 _0x11ad=['ShowWhatsappAccount','find','options','raw','attributes','include','map','model','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x11ad,0x13a));var _0xd11a=function(_0x404c90,_0x54a4a8){_0x404c90=_0x404c90-0x0;var _0x26a699=_0x11ad[_0x404c90];return _0x26a699;};'use strict';var _=require(_0xd11a('0x0'));var util=require(_0xd11a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd11a('0x2'));var fs=require('fs');var Redis=require(_0xd11a('0x3'));var db=require(_0xd11a('0x4'))['db'];var utils=require(_0xd11a('0x5'));var logger=require('../../config/logger')(_0xd11a('0x6'));var config=require(_0xd11a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd11a('0x8')]['http']({'port':0x232a});config[_0xd11a('0x9')]=_[_0xd11a('0xa')](config[_0xd11a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xd11a('0xb'))(new Redis(config[_0xd11a('0x9')]));require(_0xd11a('0xc'))['register'](socket);function respondWithRpcPromise(_0x174020,_0x274ae7,_0x4c68cd){return new BPromise(function(_0x125262,_0x15161a){return client[_0xd11a('0xd')](_0x174020,_0x4c68cd)[_0xd11a('0xe')](function(_0x1b26b6){logger[_0xd11a('0xf')](_0xd11a('0x10'),_0x274ae7,'request\x20sent');logger[_0xd11a('0x11')](_0xd11a('0x12'),_0x274ae7,_0xd11a('0x13'),JSON[_0xd11a('0x14')](_0x1b26b6));if(_0x1b26b6[_0xd11a('0x15')]){if(_0x1b26b6[_0xd11a('0x15')][_0xd11a('0x16')]===0x1f4){logger[_0xd11a('0x15')](_0xd11a('0x10'),_0x274ae7,_0x1b26b6[_0xd11a('0x15')][_0xd11a('0x17')]);return _0x15161a(_0x1b26b6[_0xd11a('0x15')][_0xd11a('0x17')]);}logger[_0xd11a('0x15')](_0xd11a('0x10'),_0x274ae7,_0x1b26b6[_0xd11a('0x15')][_0xd11a('0x17')]);return _0x125262(_0x1b26b6[_0xd11a('0x15')]['message']);}else{logger['info'](_0xd11a('0x10'),_0x274ae7,_0xd11a('0x13'));_0x125262(_0x1b26b6[_0xd11a('0x18')][_0xd11a('0x17')]);}})[_0xd11a('0x19')](function(_0x56e8fc){logger[_0xd11a('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x274ae7,_0x56e8fc);_0x15161a(_0x56e8fc);});});}exports[_0xd11a('0x1a')]=function(_0x213966){var _0x1d0ae3=this;return new Promise(function(_0x2bffef,_0xf6cdcf){return db['WhatsappAccount'][_0xd11a('0x1b')]({'raw':_0x213966[_0xd11a('0x1c')]?_0x213966[_0xd11a('0x1c')][_0xd11a('0x1d')]===undefined?!![]:![]:!![],'where':_0x213966['options']?_0x213966[_0xd11a('0x1c')]['where']||null:null,'attributes':_0x213966[_0xd11a('0x1c')]?_0x213966['options'][_0xd11a('0x1e')]||null:null,'include':_0x213966[_0xd11a('0x1c')]?_0x213966[_0xd11a('0x1c')][_0xd11a('0x1f')]?_[_0xd11a('0x20')](_0x213966[_0xd11a('0x1c')]['include'],function(_0x1cc231){return{'model':db[_0x1cc231['model']],'as':_0x1cc231['as'],'attributes':_0x1cc231[_0xd11a('0x1e')],'include':_0x1cc231[_0xd11a('0x1f')]?_[_0xd11a('0x20')](_0x1cc231[_0xd11a('0x1f')],function(_0x4fc01e){return{'model':db[_0x4fc01e[_0xd11a('0x21')]],'as':_0x4fc01e['as'],'attributes':_0x4fc01e[_0xd11a('0x1e')],'include':_0x4fc01e[_0xd11a('0x1f')]?_['map'](_0x4fc01e['include'],function(_0x442c47){return{'model':db[_0x442c47[_0xd11a('0x21')]],'as':_0x442c47['as'],'attributes':_0x442c47[_0xd11a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd11a('0xe')](function(_0x2ebbaa){logger[_0xd11a('0xf')]('ShowWhatsappAccount',_0x213966);logger[_0xd11a('0x11')](_0xd11a('0x1a'),_0x213966,JSON[_0xd11a('0x14')](_0x2ebbaa));_0x2bffef(_0x2ebbaa);})[_0xd11a('0x19')](function(_0x224f15){logger[_0xd11a('0x15')](_0xd11a('0x1a'),_0x224f15[_0xd11a('0x17')],_0x213966);_0xf6cdcf(_0x1d0ae3[_0xd11a('0x15')](0x1f4,_0x224f15['message']));});});}; \ No newline at end of file +var _0x44b3=['stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','include','map','model','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0x56b7e2,_0x50e402){var _0x40da8a=function(_0x155787){while(--_0x155787){_0x56b7e2['push'](_0x56b7e2['shift']());}};_0x40da8a(++_0x50e402);}(_0x44b3,0x9f));var _0x344b=function(_0x5d3f6e,_0x10f394){_0x5d3f6e=_0x5d3f6e-0x0;var _0x1a95ff=_0x44b3[_0x5d3f6e];return _0x1a95ff;};'use strict';var _=require('lodash');var util=require(_0x344b('0x0'));var moment=require('moment');var BPromise=require(_0x344b('0x1'));var rs=require(_0x344b('0x2'));var fs=require('fs');var Redis=require(_0x344b('0x3'));var db=require(_0x344b('0x4'))['db'];var utils=require(_0x344b('0x5'));var logger=require(_0x344b('0x6'))('rpc');var config=require(_0x344b('0x7'));var jayson=require(_0x344b('0x8'));var client=jayson['client'][_0x344b('0x9')]({'port':0x232a});config[_0x344b('0xa')]=_['defaults'](config[_0x344b('0xa')],{'host':_0x344b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x344b('0xa')]));require(_0x344b('0xc'))[_0x344b('0xd')](socket);function respondWithRpcPromise(_0x1f79b6,_0x57c371,_0x7b377d){return new BPromise(function(_0x3d5662,_0x523a56){return client[_0x344b('0xe')](_0x1f79b6,_0x7b377d)[_0x344b('0xf')](function(_0x12ce86){logger[_0x344b('0x10')](_0x344b('0x11'),_0x57c371,_0x344b('0x12'));logger[_0x344b('0x13')](_0x344b('0x14'),_0x57c371,_0x344b('0x12'),JSON[_0x344b('0x15')](_0x12ce86));if(_0x12ce86[_0x344b('0x16')]){if(_0x12ce86['error'][_0x344b('0x17')]===0x1f4){logger['error'](_0x344b('0x11'),_0x57c371,_0x12ce86[_0x344b('0x16')][_0x344b('0x18')]);return _0x523a56(_0x12ce86['error']['message']);}logger[_0x344b('0x16')](_0x344b('0x11'),_0x57c371,_0x12ce86[_0x344b('0x16')][_0x344b('0x18')]);return _0x3d5662(_0x12ce86[_0x344b('0x16')][_0x344b('0x18')]);}else{logger[_0x344b('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x57c371,_0x344b('0x12'));_0x3d5662(_0x12ce86[_0x344b('0x19')][_0x344b('0x18')]);}})[_0x344b('0x1a')](function(_0x471169){logger[_0x344b('0x16')](_0x344b('0x11'),_0x57c371,_0x471169);_0x523a56(_0x471169);});});}exports[_0x344b('0x1b')]=function(_0x322868){var _0x3768ab=this;return new Promise(function(_0x17e0a0,_0x23109f){return db[_0x344b('0x1c')]['find']({'raw':_0x322868[_0x344b('0x1d')]?_0x322868[_0x344b('0x1d')][_0x344b('0x1e')]===undefined?!![]:![]:!![],'where':_0x322868['options']?_0x322868[_0x344b('0x1d')][_0x344b('0x1f')]||null:null,'attributes':_0x322868['options']?_0x322868[_0x344b('0x1d')][_0x344b('0x20')]||null:null,'include':_0x322868[_0x344b('0x1d')]?_0x322868[_0x344b('0x1d')][_0x344b('0x21')]?_[_0x344b('0x22')](_0x322868[_0x344b('0x1d')]['include'],function(_0x2874dc){return{'model':db[_0x2874dc[_0x344b('0x23')]],'as':_0x2874dc['as'],'attributes':_0x2874dc[_0x344b('0x20')],'include':_0x2874dc[_0x344b('0x21')]?_[_0x344b('0x22')](_0x2874dc[_0x344b('0x21')],function(_0x120ddb){return{'model':db[_0x120ddb[_0x344b('0x23')]],'as':_0x120ddb['as'],'attributes':_0x120ddb[_0x344b('0x20')],'include':_0x120ddb['include']?_[_0x344b('0x22')](_0x120ddb[_0x344b('0x21')],function(_0x1d857f){return{'model':db[_0x1d857f[_0x344b('0x23')]],'as':_0x1d857f['as'],'attributes':_0x1d857f[_0x344b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x344b('0xf')](function(_0x45e5e3){logger['info'](_0x344b('0x1b'),_0x322868);logger[_0x344b('0x13')](_0x344b('0x1b'),_0x322868,JSON['stringify'](_0x45e5e3));_0x17e0a0(_0x45e5e3);})[_0x344b('0x1a')](function(_0x498881){logger['error'](_0x344b('0x1b'),_0x498881['message'],_0x322868);_0x23109f(_0x3768ab['error'](0x1f4,_0x498881['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 6ab37ff..cda26ab 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 _0x4068=['remove','update','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0x4068,0xa0));var _0x8406=function(_0x473297,_0x5beef0){_0x473297=_0x473297-0x0;var _0x4278c2=_0x4068[_0x473297];return _0x4278c2;};'use strict';var WhatsappAccountEvents=require(_0x8406('0x0'));var events=['save',_0x8406('0x1'),_0x8406('0x2')];function createListener(_0x26a730,_0x333189){return function(_0x2cd61d){_0x333189['emit'](_0x26a730,_0x2cd61d);};}function removeListener(_0x46d3b1,_0x10d19e){return function(){WhatsappAccountEvents[_0x8406('0x3')](_0x46d3b1,_0x10d19e);};}exports[_0x8406('0x4')]=function(_0x59f2a6){for(var _0x43c9a8=0x0,_0x2f67eb=events[_0x8406('0x5')];_0x43c9a8<_0x2f67eb;_0x43c9a8++){var _0x20dd07=events[_0x43c9a8];var _0x5b1bcb=createListener(_0x8406('0x6')+_0x20dd07,_0x59f2a6);WhatsappAccountEvents['on'](_0x20dd07,_0x5b1bcb);}}; \ No newline at end of file +var _0x0182=['emit','register','whatsappAccount:','save','remove','update'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0182,0x111));var _0x2018=function(_0x33e566,_0x3e90f4){_0x33e566=_0x33e566-0x0;var _0x828b80=_0x0182[_0x33e566];return _0x828b80;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x2018('0x0'),_0x2018('0x1'),_0x2018('0x2')];function createListener(_0x1c0b5e,_0x26cb1b){return function(_0x31a08d){_0x26cb1b[_0x2018('0x3')](_0x1c0b5e,_0x31a08d);};}function removeListener(_0x326b9c,_0x1873ec){return function(){WhatsappAccountEvents['removeListener'](_0x326b9c,_0x1873ec);};}exports[_0x2018('0x4')]=function(_0x59669d){for(var _0x17e6ed=0x0,_0x3f13a5=events['length'];_0x17e6ed<_0x3f13a5;_0x17e6ed++){var _0x1ede82=events[_0x17e6ed];var _0x25f4a5=createListener(_0x2018('0x5')+_0x1ede82,_0x59669d);WhatsappAccountEvents['on'](_0x1ede82,_0x25f4a5);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index e0bedf6..8dc5e8e 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 _0x7618=['post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x102baa,_0x1fcbb6){var _0x50a683=function(_0x5e1904){while(--_0x5e1904){_0x102baa['push'](_0x102baa['shift']());}};_0x50a683(++_0x1fcbb6);}(_0x7618,0x83));var _0x8761=function(_0x335154,_0x461d24){_0x335154=_0x335154-0x0;var _0x53582f=_0x7618[_0x335154];return _0x53582f;};'use strict';var multer=require(_0x8761('0x0'));var util=require('util');var path=require(_0x8761('0x1'));var timeout=require(_0x8761('0x2'));var express=require(_0x8761('0x3'));var router=express[_0x8761('0x4')]();var fs_extra=require(_0x8761('0x5'));var auth=require(_0x8761('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8761('0x7'));router[_0x8761('0x8')]('/',auth[_0x8761('0x9')](),controller[_0x8761('0xa')]);router[_0x8761('0x8')](_0x8761('0xb'),auth[_0x8761('0x9')](),controller[_0x8761('0xc')]);router[_0x8761('0xd')]('/',auth[_0x8761('0x9')](),controller['create']);router[_0x8761('0xe')]('/:id',auth[_0x8761('0x9')](),controller[_0x8761('0xf')]);router[_0x8761('0x10')](_0x8761('0xb'),auth[_0x8761('0x9')](),controller[_0x8761('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3ada=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','show','isAuthenticated','update','delete'];(function(_0x4a0a2e,_0x3897b1){var _0x20d54c=function(_0x383ac9){while(--_0x383ac9){_0x4a0a2e['push'](_0x4a0a2e['shift']());}};_0x20d54c(++_0x3897b1);}(_0x3ada,0x145));var _0xa3ad=function(_0xc6f29c,_0x469980){_0xc6f29c=_0xc6f29c-0x0;var _0x47191d=_0x3ada[_0xc6f29c];return _0x47191d;};'use strict';var multer=require(_0xa3ad('0x0'));var util=require(_0xa3ad('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa3ad('0x2')]();var fs_extra=require(_0xa3ad('0x3'));var auth=require(_0xa3ad('0x4'));var interaction=require(_0xa3ad('0x5'));var config=require(_0xa3ad('0x6'));var controller=require(_0xa3ad('0x7'));router[_0xa3ad('0x8')]('/',auth['isAuthenticated'](),controller[_0xa3ad('0x9')]);router[_0xa3ad('0x8')](_0xa3ad('0xa'),auth['isAuthenticated'](),controller[_0xa3ad('0xb')]);router['post']('/',auth[_0xa3ad('0xc')](),controller['create']);router['put']('/:id',auth[_0xa3ad('0xc')](),controller[_0xa3ad('0xd')]);router[_0xa3ad('0xe')](_0xa3ad('0xa'),auth[_0xa3ad('0xc')](),controller[_0xa3ad('0xf')]);module[_0xa3ad('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 2638564..af8aa4a 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 _0x280a=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x459697,_0x428429){var _0x56412e=function(_0x4a48f6){while(--_0x4a48f6){_0x459697['push'](_0x459697['shift']());}};_0x56412e(++_0x428429);}(_0x280a,0x13b));var _0xa280=function(_0x2c219c,_0x3ed4d8){_0x2c219c=_0x2c219c-0x0;var _0x1b7002=_0x280a[_0x2c219c];return _0x1b7002;};'use strict';var Sequelize=require(_0xa280('0x0'));module[_0xa280('0x1')]={'priority':{'type':Sequelize[_0xa280('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa280('0x3')],'allowNull':![],'defaultValue':_0xa280('0x4')},'appdata':{'type':Sequelize[_0xa280('0x5')]()},'description':{'type':Sequelize[_0xa280('0x3')]},'interval':{'type':Sequelize[_0xa280('0x3')],'defaultValue':_0xa280('0x6')}}; \ No newline at end of file +var _0x1911=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x5914a3,_0x22e240){var _0x25af13=function(_0x33c161){while(--_0x33c161){_0x5914a3['push'](_0x5914a3['shift']());}};_0x25af13(++_0x22e240);}(_0x1911,0x1cd));var _0x1191=function(_0x4a9804,_0x9c5a94){_0x4a9804=_0x4a9804-0x0;var _0x395b9c=_0x1911[_0x4a9804];return _0x395b9c;};'use strict';var Sequelize=require(_0x1191('0x0'));module[_0x1191('0x1')]={'priority':{'type':Sequelize[_0x1191('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1191('0x3')],'allowNull':![],'defaultValue':_0x1191('0x4')},'appdata':{'type':Sequelize[_0x1191('0x5')]()},'description':{'type':Sequelize[_0x1191('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 884ded6..7d97fb0 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 _0x5360=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../config/logger','api'];(function(_0x4babfe,_0x137f0c){var _0x16f283=function(_0x640b7){while(--_0x640b7){_0x4babfe['push'](_0x4babfe['shift']());}};_0x16f283(++_0x137f0c);}(_0x5360,0x157));var _0x0536=function(_0x35d69b,_0x22811e){_0x35d69b=_0x35d69b-0x0;var _0x22c5c7=_0x5360[_0x35d69b];return _0x22c5c7;};'use strict';var emlformat=require(_0x0536('0x0'));var rimraf=require(_0x0536('0x1'));var zipdir=require(_0x0536('0x2'));var jsonpatch=require(_0x0536('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0536('0x4'));var Mustache=require('mustache');var util=require(_0x0536('0x5'));var path=require(_0x0536('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0536('0x7'));var _=require(_0x0536('0x8'));var squel=require(_0x0536('0x9'));var crypto=require(_0x0536('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0536('0xb'));var toCsv=require(_0x0536('0xc'));var querystring=require(_0x0536('0xd'));var Papa=require('papaparse');var Redis=require(_0x0536('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(_0x0536('0xf'))(_0x0536('0x10'));var utils=require(_0x0536('0x11'));var config=require(_0x0536('0x12'));var licenseUtil=require(_0x0536('0x13'));var db=require(_0x0536('0x14'))['db'];function respondWithStatusCode(_0x69f430,_0x3bacec){_0x3bacec=_0x3bacec||0xcc;return function(_0x46da69){if(_0x46da69){return _0x69f430[_0x0536('0x15')](_0x3bacec);}return _0x69f430[_0x0536('0x16')](_0x3bacec)[_0x0536('0x17')]();};}function respondWithResult(_0x355189,_0x543134){_0x543134=_0x543134||0xc8;return function(_0x29123b){if(_0x29123b){return _0x355189[_0x0536('0x16')](_0x543134)[_0x0536('0x18')](_0x29123b);}};}function respondWithFilteredResult(_0x4720c2,_0x4723a3){return function(_0x58dddc){if(_0x58dddc){var _0x3d6b68=typeof _0x4723a3[_0x0536('0x19')]===_0x0536('0x1a')&&typeof _0x4723a3[_0x0536('0x1b')]==='undefined';var _0x4e4076=_0x58dddc[_0x0536('0x1c')];var _0x25fb28=_0x3d6b68?0x0:_0x4723a3[_0x0536('0x19')];var _0x5c676c=_0x3d6b68?_0x58dddc['count']:_0x4723a3[_0x0536('0x19')]+_0x4723a3[_0x0536('0x1b')];var _0x506de2;if(_0x5c676c>=_0x4e4076){_0x5c676c=_0x4e4076;_0x506de2=0xc8;}else{_0x506de2=0xce;}_0x4720c2[_0x0536('0x16')](_0x506de2);return _0x4720c2[_0x0536('0x1d')](_0x0536('0x1e'),_0x25fb28+'-'+_0x5c676c+'/'+_0x4e4076)[_0x0536('0x18')](_0x58dddc);}return null;};}function patchUpdates(_0x3e1d66){return function(_0x52bcd8){try{jsonpatch[_0x0536('0x1f')](_0x52bcd8,_0x3e1d66,!![]);}catch(_0x51ba52){return BPromise['reject'](_0x51ba52);}return _0x52bcd8[_0x0536('0x20')]();};}function saveUpdates(_0x15e3f2,_0x21c094){return function(_0x2f5ebd){if(_0x2f5ebd){return _0x2f5ebd[_0x0536('0x21')](_0x15e3f2)[_0x0536('0x22')](function(_0x272008){return _0x272008;});}return null;};}function removeEntity(_0x4bfec1,_0x475b87){return function(_0x3e3542){if(_0x3e3542){return _0x3e3542['destroy']()[_0x0536('0x22')](function(){_0x4bfec1[_0x0536('0x16')](0xcc)[_0x0536('0x17')]();});}};}function handleEntityNotFound(_0x4e3287,_0x32a0d6){return function(_0x290701){if(!_0x290701){_0x4e3287[_0x0536('0x15')](0x194);}return _0x290701;};}function handleError(_0x597693,_0x122cc5){_0x122cc5=_0x122cc5||0x1f4;return function(_0x334b46){logger[_0x0536('0x23')](_0x334b46[_0x0536('0x24')]);if(_0x334b46[_0x0536('0x25')]){delete _0x334b46[_0x0536('0x25')];}_0x597693[_0x0536('0x16')](_0x122cc5)[_0x0536('0x26')](_0x334b46);};}exports[_0x0536('0x27')]=function(_0x2e3ab1,_0x5f4b92){var _0x2ab6dd={},_0x36d4d7={},_0x4d8c31={'count':0x0,'rows':[]};var _0x3be6c1=_[_0x0536('0x28')](db[_0x0536('0x29')][_0x0536('0x2a')],function(_0x52f8d9){return{'name':_0x52f8d9[_0x0536('0x2b')],'type':_0x52f8d9['type']['key']};});_0x36d4d7[_0x0536('0x2c')]=_[_0x0536('0x28')](_0x3be6c1,_0x0536('0x25'));_0x36d4d7[_0x0536('0x2d')]=_[_0x0536('0x2e')](_0x2e3ab1[_0x0536('0x2d')]);_0x36d4d7['filters']=_[_0x0536('0x2f')](_0x36d4d7[_0x0536('0x2c')],_0x36d4d7['query']);_0x2ab6dd[_0x0536('0x30')]=_['intersection'](_0x36d4d7[_0x0536('0x2c')],qs[_0x0536('0x31')](_0x2e3ab1[_0x0536('0x2d')][_0x0536('0x31')]));_0x2ab6dd[_0x0536('0x30')]=_0x2ab6dd[_0x0536('0x30')]['length']?_0x2ab6dd[_0x0536('0x30')]:_0x36d4d7['model'];if(!_0x2e3ab1['query'][_0x0536('0x32')](_0x0536('0x33'))){_0x2ab6dd[_0x0536('0x1b')]=qs['limit'](_0x2e3ab1[_0x0536('0x2d')][_0x0536('0x1b')]);_0x2ab6dd[_0x0536('0x19')]=qs[_0x0536('0x19')](_0x2e3ab1[_0x0536('0x2d')]['offset']);}_0x2ab6dd[_0x0536('0x34')]=qs[_0x0536('0x35')](_0x2e3ab1[_0x0536('0x2d')][_0x0536('0x35')]);_0x2ab6dd[_0x0536('0x36')]=qs['filters'](_[_0x0536('0x37')](_0x2e3ab1['query'],_0x36d4d7[_0x0536('0x38')]),_0x3be6c1);if(_0x2e3ab1[_0x0536('0x2d')][_0x0536('0x39')]){_0x2ab6dd['where']=_[_0x0536('0x3a')](_0x2ab6dd[_0x0536('0x36')],{'$or':_[_0x0536('0x28')](_0x3be6c1,function(_0x2e2aee){if(_0x2e2aee['type']!==_0x0536('0x3b')){var _0x2d6b27={};_0x2d6b27[_0x2e2aee['name']]={'$like':'%'+_0x2e3ab1[_0x0536('0x2d')]['filter']+'%'};return _0x2d6b27;}})});}_0x2ab6dd=_['merge']({},_0x2ab6dd,_0x2e3ab1[_0x0536('0x3c')]);var _0x17fad0={'where':_0x2ab6dd[_0x0536('0x36')]};return db['WhatsappApplication']['count'](_0x17fad0)['then'](function(_0x46a1b5){_0x4d8c31[_0x0536('0x1c')]=_0x46a1b5;if(_0x2e3ab1['query'][_0x0536('0x3d')]){_0x2ab6dd[_0x0536('0x3e')]=[{'all':!![]}];}return db[_0x0536('0x29')][_0x0536('0x3f')](_0x2ab6dd);})['then'](function(_0x23aae3){_0x4d8c31[_0x0536('0x40')]=_0x23aae3;return _0x4d8c31;})[_0x0536('0x22')](respondWithFilteredResult(_0x5f4b92,_0x2ab6dd))[_0x0536('0x41')](handleError(_0x5f4b92,null));};exports[_0x0536('0x42')]=function(_0x267e82,_0x413e20){var _0x2560c0={'raw':!![],'where':{'id':_0x267e82[_0x0536('0x43')]['id']}},_0x5e4580={};_0x5e4580[_0x0536('0x2c')]=_[_0x0536('0x2e')](db['WhatsappApplication'][_0x0536('0x2a')]);_0x5e4580[_0x0536('0x2d')]=_[_0x0536('0x2e')](_0x267e82[_0x0536('0x2d')]);_0x5e4580[_0x0536('0x38')]=_['intersection'](_0x5e4580[_0x0536('0x2c')],_0x5e4580[_0x0536('0x2d')]);_0x2560c0['attributes']=_[_0x0536('0x2f')](_0x5e4580[_0x0536('0x2c')],qs[_0x0536('0x31')](_0x267e82[_0x0536('0x2d')][_0x0536('0x31')]));_0x2560c0[_0x0536('0x30')]=_0x2560c0[_0x0536('0x30')]['length']?_0x2560c0['attributes']:_0x5e4580[_0x0536('0x2c')];if(_0x267e82[_0x0536('0x2d')][_0x0536('0x3d')]){_0x2560c0[_0x0536('0x3e')]=[{'all':!![]}];}_0x2560c0=_[_0x0536('0x3a')]({},_0x2560c0,_0x267e82[_0x0536('0x3c')]);return db[_0x0536('0x29')][_0x0536('0x44')](_0x2560c0)['then'](handleEntityNotFound(_0x413e20,null))[_0x0536('0x22')](respondWithResult(_0x413e20,null))[_0x0536('0x41')](handleError(_0x413e20,null));};exports['create']=function(_0x1c455d,_0x5674ed){return db[_0x0536('0x29')][_0x0536('0x45')](_0x1c455d['body'],{})['then'](respondWithResult(_0x5674ed,0xc9))[_0x0536('0x41')](handleError(_0x5674ed,null));};exports[_0x0536('0x21')]=function(_0xebf186,_0x3e25ef){if(_0xebf186[_0x0536('0x46')]['id']){delete _0xebf186[_0x0536('0x46')]['id'];}return db[_0x0536('0x29')][_0x0536('0x44')]({'where':{'id':_0xebf186[_0x0536('0x43')]['id']}})[_0x0536('0x22')](handleEntityNotFound(_0x3e25ef,null))[_0x0536('0x22')](saveUpdates(_0xebf186[_0x0536('0x46')],null))[_0x0536('0x22')](respondWithResult(_0x3e25ef,null))['catch'](handleError(_0x3e25ef,null));};exports[_0x0536('0x47')]=function(_0x16ece5,_0x21cd8d){return db['WhatsappApplication'][_0x0536('0x44')]({'where':{'id':_0x16ece5[_0x0536('0x43')]['id']}})[_0x0536('0x22')](handleEntityNotFound(_0x21cd8d,null))[_0x0536('0x22')](removeEntity(_0x21cd8d,null))[_0x0536('0x41')](handleError(_0x21cd8d,null));}; \ No newline at end of file +var _0x2dd8=['findAll','rows','catch','show','keys','intersection','find','create','body','update','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','WhatsappApplication','rawAttributes','type','key','map','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x2dd8,0x143));var _0x82dd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2dd8[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x82dd('0x0'));var rimraf=require(_0x82dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x82dd('0x2'));var moment=require(_0x82dd('0x3'));var BPromise=require(_0x82dd('0x4'));var Mustache=require(_0x82dd('0x5'));var util=require(_0x82dd('0x6'));var path=require(_0x82dd('0x7'));var sox=require(_0x82dd('0x8'));var csv=require('to-csv');var ejs=require(_0x82dd('0x9'));var fs=require('fs');var fs_extra=require(_0x82dd('0xa'));var _=require(_0x82dd('0xb'));var squel=require(_0x82dd('0xc'));var crypto=require('crypto');var jsforce=require(_0x82dd('0xd'));var deskjs=require(_0x82dd('0xe'));var toCsv=require(_0x82dd('0xf'));var querystring=require(_0x82dd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82dd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x82dd('0x12'));var hardwareService=require(_0x82dd('0x13'));var logger=require(_0x82dd('0x14'))(_0x82dd('0x15'));var utils=require(_0x82dd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x82dd('0x17'));var db=require(_0x82dd('0x18'))['db'];function respondWithStatusCode(_0x348f79,_0x18b9f6){_0x18b9f6=_0x18b9f6||0xcc;return function(_0x24d045){if(_0x24d045){return _0x348f79['sendStatus'](_0x18b9f6);}return _0x348f79['status'](_0x18b9f6)[_0x82dd('0x19')]();};}function respondWithResult(_0x255abd,_0x6fcc1b){_0x6fcc1b=_0x6fcc1b||0xc8;return function(_0x46beb0){if(_0x46beb0){return _0x255abd[_0x82dd('0x1a')](_0x6fcc1b)[_0x82dd('0x1b')](_0x46beb0);}};}function respondWithFilteredResult(_0x31b9c1,_0x275802){return function(_0x101eb7){if(_0x101eb7){var _0x1b90e0=typeof _0x275802[_0x82dd('0x1c')]===_0x82dd('0x1d')&&typeof _0x275802[_0x82dd('0x1e')]==='undefined';var _0x352400=_0x101eb7[_0x82dd('0x1f')];var _0x34d991=_0x1b90e0?0x0:_0x275802[_0x82dd('0x1c')];var _0x445fa0=_0x1b90e0?_0x101eb7[_0x82dd('0x1f')]:_0x275802[_0x82dd('0x1c')]+_0x275802[_0x82dd('0x1e')];var _0x26373a;if(_0x445fa0>=_0x352400){_0x445fa0=_0x352400;_0x26373a=0xc8;}else{_0x26373a=0xce;}_0x31b9c1[_0x82dd('0x1a')](_0x26373a);return _0x31b9c1[_0x82dd('0x20')](_0x82dd('0x21'),_0x34d991+'-'+_0x445fa0+'/'+_0x352400)[_0x82dd('0x1b')](_0x101eb7);}return null;};}function patchUpdates(_0x5ebea8){return function(_0x45205d){try{jsonpatch[_0x82dd('0x22')](_0x45205d,_0x5ebea8,!![]);}catch(_0x28352e){return BPromise[_0x82dd('0x23')](_0x28352e);}return _0x45205d[_0x82dd('0x24')]();};}function saveUpdates(_0x251b5b,_0x15f5b8){return function(_0x45e92c){if(_0x45e92c){return _0x45e92c['update'](_0x251b5b)['then'](function(_0x1c095e){return _0x1c095e;});}return null;};}function removeEntity(_0x96dbc0,_0x4e1463){return function(_0x59a173){if(_0x59a173){return _0x59a173[_0x82dd('0x25')]()[_0x82dd('0x26')](function(){_0x96dbc0[_0x82dd('0x1a')](0xcc)[_0x82dd('0x19')]();});}};}function handleEntityNotFound(_0x4609c1,_0x1233e4){return function(_0x17eb32){if(!_0x17eb32){_0x4609c1[_0x82dd('0x27')](0x194);}return _0x17eb32;};}function handleError(_0x1ae382,_0x1d27f1){_0x1d27f1=_0x1d27f1||0x1f4;return function(_0xe6aacd){logger[_0x82dd('0x28')](_0xe6aacd[_0x82dd('0x29')]);if(_0xe6aacd[_0x82dd('0x2a')]){delete _0xe6aacd['name'];}_0x1ae382[_0x82dd('0x1a')](_0x1d27f1)[_0x82dd('0x2b')](_0xe6aacd);};}exports[_0x82dd('0x2c')]=function(_0x53965f,_0x15da13){var _0x5238a2={},_0x15f31f={},_0x93fd00={'count':0x0,'rows':[]};var _0x2b4a63=_['map'](db[_0x82dd('0x2d')][_0x82dd('0x2e')],function(_0x47c0ff){return{'name':_0x47c0ff['fieldName'],'type':_0x47c0ff[_0x82dd('0x2f')][_0x82dd('0x30')]};});_0x15f31f['model']=_[_0x82dd('0x31')](_0x2b4a63,_0x82dd('0x2a'));_0x15f31f[_0x82dd('0x32')]=_['keys'](_0x53965f[_0x82dd('0x32')]);_0x15f31f[_0x82dd('0x33')]=_['intersection'](_0x15f31f['model'],_0x15f31f[_0x82dd('0x32')]);_0x5238a2[_0x82dd('0x34')]=_['intersection'](_0x15f31f[_0x82dd('0x35')],qs[_0x82dd('0x36')](_0x53965f[_0x82dd('0x32')][_0x82dd('0x36')]));_0x5238a2[_0x82dd('0x34')]=_0x5238a2['attributes'][_0x82dd('0x37')]?_0x5238a2[_0x82dd('0x34')]:_0x15f31f['model'];if(!_0x53965f[_0x82dd('0x32')][_0x82dd('0x38')](_0x82dd('0x39'))){_0x5238a2[_0x82dd('0x1e')]=qs['limit'](_0x53965f[_0x82dd('0x32')][_0x82dd('0x1e')]);_0x5238a2[_0x82dd('0x1c')]=qs[_0x82dd('0x1c')](_0x53965f[_0x82dd('0x32')][_0x82dd('0x1c')]);}_0x5238a2[_0x82dd('0x3a')]=qs[_0x82dd('0x3b')](_0x53965f['query'][_0x82dd('0x3b')]);_0x5238a2['where']=qs[_0x82dd('0x33')](_[_0x82dd('0x3c')](_0x53965f[_0x82dd('0x32')],_0x15f31f['filters']),_0x2b4a63);if(_0x53965f[_0x82dd('0x32')][_0x82dd('0x3d')]){_0x5238a2[_0x82dd('0x3e')]=_[_0x82dd('0x3f')](_0x5238a2['where'],{'$or':_['map'](_0x2b4a63,function(_0xc3d6d9){if(_0xc3d6d9[_0x82dd('0x2f')]!==_0x82dd('0x40')){var _0x19c736={};_0x19c736[_0xc3d6d9['name']]={'$like':'%'+_0x53965f['query'][_0x82dd('0x3d')]+'%'};return _0x19c736;}})});}_0x5238a2=_[_0x82dd('0x3f')]({},_0x5238a2,_0x53965f['options']);var _0x3a905d={'where':_0x5238a2[_0x82dd('0x3e')]};return db[_0x82dd('0x2d')][_0x82dd('0x1f')](_0x3a905d)[_0x82dd('0x26')](function(_0x104568){_0x93fd00[_0x82dd('0x1f')]=_0x104568;if(_0x53965f[_0x82dd('0x32')][_0x82dd('0x41')]){_0x5238a2[_0x82dd('0x42')]=[{'all':!![]}];}return db[_0x82dd('0x2d')][_0x82dd('0x43')](_0x5238a2);})[_0x82dd('0x26')](function(_0x27cfd6){_0x93fd00[_0x82dd('0x44')]=_0x27cfd6;return _0x93fd00;})[_0x82dd('0x26')](respondWithFilteredResult(_0x15da13,_0x5238a2))[_0x82dd('0x45')](handleError(_0x15da13,null));};exports[_0x82dd('0x46')]=function(_0x41d36,_0x5bcc32){var _0x644d3a={'raw':!![],'where':{'id':_0x41d36['params']['id']}},_0x4cd127={};_0x4cd127[_0x82dd('0x35')]=_[_0x82dd('0x47')](db[_0x82dd('0x2d')]['rawAttributes']);_0x4cd127[_0x82dd('0x32')]=_[_0x82dd('0x47')](_0x41d36[_0x82dd('0x32')]);_0x4cd127[_0x82dd('0x33')]=_[_0x82dd('0x48')](_0x4cd127[_0x82dd('0x35')],_0x4cd127['query']);_0x644d3a[_0x82dd('0x34')]=_[_0x82dd('0x48')](_0x4cd127[_0x82dd('0x35')],qs[_0x82dd('0x36')](_0x41d36[_0x82dd('0x32')]['fields']));_0x644d3a[_0x82dd('0x34')]=_0x644d3a[_0x82dd('0x34')]['length']?_0x644d3a[_0x82dd('0x34')]:_0x4cd127[_0x82dd('0x35')];if(_0x41d36[_0x82dd('0x32')][_0x82dd('0x41')]){_0x644d3a[_0x82dd('0x42')]=[{'all':!![]}];}_0x644d3a=_[_0x82dd('0x3f')]({},_0x644d3a,_0x41d36['options']);return db[_0x82dd('0x2d')][_0x82dd('0x49')](_0x644d3a)[_0x82dd('0x26')](handleEntityNotFound(_0x5bcc32,null))[_0x82dd('0x26')](respondWithResult(_0x5bcc32,null))['catch'](handleError(_0x5bcc32,null));};exports[_0x82dd('0x4a')]=function(_0x418fd3,_0x3035b8){return db['WhatsappApplication']['create'](_0x418fd3[_0x82dd('0x4b')],{})[_0x82dd('0x26')](respondWithResult(_0x3035b8,0xc9))[_0x82dd('0x45')](handleError(_0x3035b8,null));};exports[_0x82dd('0x4c')]=function(_0x208e4f,_0x4ff539){if(_0x208e4f['body']['id']){delete _0x208e4f[_0x82dd('0x4b')]['id'];}return db[_0x82dd('0x2d')]['find']({'where':{'id':_0x208e4f['params']['id']}})['then'](handleEntityNotFound(_0x4ff539,null))[_0x82dd('0x26')](saveUpdates(_0x208e4f['body'],null))[_0x82dd('0x26')](respondWithResult(_0x4ff539,null))[_0x82dd('0x45')](handleError(_0x4ff539,null));};exports[_0x82dd('0x25')]=function(_0x96e9f1,_0x24fa02){return db[_0x82dd('0x2d')][_0x82dd('0x49')]({'where':{'id':_0x96e9f1[_0x82dd('0x4d')]['id']}})[_0x82dd('0x26')](handleEntityNotFound(_0x24fa02,null))['then'](removeEntity(_0x24fa02,null))[_0x82dd('0x45')](handleError(_0x24fa02,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index a0e40c9..cb13456 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 _0x08d9=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications'];(function(_0x13a8ba,_0x4231a9){var _0x97ddba=function(_0x3f09f3){while(--_0x3f09f3){_0x13a8ba['push'](_0x13a8ba['shift']());}};_0x97ddba(++_0x4231a9);}(_0x08d9,0xc2));var _0x908d=function(_0x26c51c,_0x545ee9){_0x26c51c=_0x26c51c-0x0;var _0x15b3ef=_0x08d9[_0x26c51c];return _0x15b3ef;};'use strict';var _=require(_0x908d('0x0'));var util=require('util');var logger=require(_0x908d('0x1'))('api');var moment=require(_0x908d('0x2'));var BPromise=require(_0x908d('0x3'));var rp=require(_0x908d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x908d('0x5'));var attributes=require(_0x908d('0x6'));module[_0x908d('0x7')]=function(_0xe780e0,_0xb63409){return _0xe780e0['define'](_0x908d('0x8'),attributes,{'tableName':_0x908d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x908d('0xa'),'collate':_0x908d('0xb')});}; \ No newline at end of file +var _0x6f7f=['api','moment','bluebird','path','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x435ed8,_0x4866be){var _0x34afaa=function(_0x257921){while(--_0x257921){_0x435ed8['push'](_0x435ed8['shift']());}};_0x34afaa(++_0x4866be);}(_0x6f7f,0x177));var _0xf6f7=function(_0x284382,_0x18fb38){_0x284382=_0x284382-0x0;var _0x2b3747=_0x6f7f[_0x284382];return _0x2b3747;};'use strict';var _=require('lodash');var util=require(_0xf6f7('0x0'));var logger=require(_0xf6f7('0x1'))(_0xf6f7('0x2'));var moment=require(_0xf6f7('0x3'));var BPromise=require(_0xf6f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6f7('0x5'));var rimraf=require('rimraf');var config=require(_0xf6f7('0x6'));var attributes=require(_0xf6f7('0x7'));module[_0xf6f7('0x8')]=function(_0x5495b9,_0x2f6df9){return _0x5495b9['define'](_0xf6f7('0x9'),attributes,{'tableName':_0xf6f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf6f7('0xb'),'collate':_0xf6f7('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 01e3c8e..b92464a 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 _0x9a19=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x44c37d,_0x19119f){var _0x29e087=function(_0x327fca){while(--_0x327fca){_0x44c37d['push'](_0x44c37d['shift']());}};_0x29e087(++_0x19119f);}(_0x9a19,0x114));var _0x99a1=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0x9a19[_0x3fe6df];return _0x372a0e;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var moment=require(_0x99a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x99a1('0x3'));var fs=require('fs');var Redis=require(_0x99a1('0x4'));var db=require(_0x99a1('0x5'))['db'];var utils=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var config=require(_0x99a1('0x9'));var jayson=require(_0x99a1('0xa'));var client=jayson[_0x99a1('0xb')][_0x99a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x65045d,_0x523b9e,_0x4d2a5c){return new BPromise(function(_0x5aa6c2,_0x56f50){return client[_0x99a1('0xd')](_0x65045d,_0x4d2a5c)['then'](function(_0x5874fc){logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));logger[_0x99a1('0x11')](_0x99a1('0x12'),_0x523b9e,'request\x20sent',JSON[_0x99a1('0x13')](_0x5874fc));if(_0x5874fc[_0x99a1('0x14')]){if(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x15')]===0x1f4){logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x56f50(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);}logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x5aa6c2(_0x5874fc[_0x99a1('0x14')]['message']);}else{logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));_0x5aa6c2(_0x5874fc[_0x99a1('0x17')][_0x99a1('0x16')]);}})[_0x99a1('0x18')](function(_0x1ca878){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x523b9e,_0x1ca878);_0x56f50(_0x1ca878);});});} \ No newline at end of file +var _0x5c12=['../../config/environment','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0x5c12,0x188));var _0x25c1=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x5c12[_0x411017];return _0x2adeea;};'use strict';var _=require('lodash');var util=require(_0x25c1('0x0'));var moment=require(_0x25c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25c1('0x2'));var fs=require('fs');var Redis=require(_0x25c1('0x3'));var db=require(_0x25c1('0x4'))['db'];var utils=require(_0x25c1('0x5'));var logger=require(_0x25c1('0x6'))(_0x25c1('0x7'));var config=require(_0x25c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x25c1('0x9')][_0x25c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x382922,_0x4ab674,_0x5c69b1){return new BPromise(function(_0x24981c,_0x3b69ba){return client[_0x25c1('0xb')](_0x382922,_0x5c69b1)[_0x25c1('0xc')](function(_0xf8363f){logger['info'](_0x25c1('0xd'),_0x4ab674,_0x25c1('0xe'));logger[_0x25c1('0xf')](_0x25c1('0x10'),_0x4ab674,_0x25c1('0xe'),JSON['stringify'](_0xf8363f));if(_0xf8363f[_0x25c1('0x11')]){if(_0xf8363f[_0x25c1('0x11')]['code']===0x1f4){logger[_0x25c1('0x11')](_0x25c1('0xd'),_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x3b69ba(_0xf8363f['error']['message']);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);return _0x24981c(_0xf8363f[_0x25c1('0x11')][_0x25c1('0x12')]);}else{logger[_0x25c1('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x25c1('0xe'));_0x24981c(_0xf8363f['result']['message']);}})['catch'](function(_0x284712){logger[_0x25c1('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4ab674,_0x284712);_0x3b69ba(_0x284712);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index fd16b9d..bbb2400 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 _0xee3c=['index','/describe','describe','/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','whatsapp','whatsappinteraction:addtags','tracked','whatsappinteraction:update','update','destroy','delete','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xee3c,0x14a));var _0xcee3=function(_0x46ccf9,_0x3c45a0){_0x46ccf9=_0x46ccf9-0x0;var _0x167fb4=_0xee3c[_0x46ccf9];return _0x167fb4;};'use strict';var multer=require(_0xcee3('0x0'));var util=require(_0xcee3('0x1'));var path=require(_0xcee3('0x2'));var timeout=require(_0xcee3('0x3'));var express=require(_0xcee3('0x4'));var router=express[_0xcee3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcee3('0x6'));var config=require(_0xcee3('0x7'));var controller=require(_0xcee3('0x8'));router[_0xcee3('0x9')]('/',auth[_0xcee3('0xa')](),controller[_0xcee3('0xb')]);router[_0xcee3('0x9')](_0xcee3('0xc'),auth[_0xcee3('0xa')](),controller[_0xcee3('0xd')]);router[_0xcee3('0x9')](_0xcee3('0xe'),auth[_0xcee3('0xa')](),controller[_0xcee3('0xf')]);router[_0xcee3('0x9')]('/:id/messages',auth[_0xcee3('0xa')](),controller[_0xcee3('0x10')]);router[_0xcee3('0x9')](_0xcee3('0x11'),auth[_0xcee3('0xa')](),controller[_0xcee3('0x12')]);router['post']('/',auth[_0xcee3('0xa')](),controller[_0xcee3('0x13')]);router[_0xcee3('0x14')](_0xcee3('0x15'),auth[_0xcee3('0xa')](),controller['addMessage']);router[_0xcee3('0x14')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0xcee3('0x16'),_0xcee3('0x17')),controller['addTags']);router['put'](_0xcee3('0xe'),auth['isAuthenticated'](),interaction[_0xcee3('0x18')]('whatsapp',_0xcee3('0x19')),controller[_0xcee3('0x1a')]);router['delete'](_0xcee3('0xe'),auth[_0xcee3('0xa')](),interaction[_0xcee3('0x18')](_0xcee3('0x16'),'whatsappinteraction:destroy'),controller[_0xcee3('0x1b')]);router[_0xcee3('0x1c')](_0xcee3('0x1d'),auth[_0xcee3('0xa')](),controller['removeTags']);module[_0xcee3('0x1e')]=router; \ No newline at end of file +var _0x1224=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path'];(function(_0x5c7828,_0x1533b2){var _0x46d97d=function(_0xa4a7fd){while(--_0xa4a7fd){_0x5c7828['push'](_0x5c7828['shift']());}};_0x46d97d(++_0x1533b2);}(_0x1224,0x10d));var _0x4122=function(_0x4df17c,_0x2d2b61){_0x4df17c=_0x4df17c-0x0;var _0x4e79b5=_0x1224[_0x4df17c];return _0x4e79b5;};'use strict';var multer=require(_0x4122('0x0'));var util=require(_0x4122('0x1'));var path=require(_0x4122('0x2'));var timeout=require(_0x4122('0x3'));var express=require(_0x4122('0x4'));var router=express[_0x4122('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4122('0x6'));var interaction=require(_0x4122('0x7'));var config=require(_0x4122('0x8'));var controller=require('./whatsappInteraction.controller');router[_0x4122('0x9')]('/',auth[_0x4122('0xa')](),controller[_0x4122('0xb')]);router[_0x4122('0x9')](_0x4122('0xc'),auth[_0x4122('0xa')](),controller[_0x4122('0xd')]);router[_0x4122('0x9')](_0x4122('0xe'),auth[_0x4122('0xa')](),controller[_0x4122('0xf')]);router[_0x4122('0x9')](_0x4122('0x10'),auth[_0x4122('0xa')](),controller[_0x4122('0x11')]);router[_0x4122('0x9')](_0x4122('0x12'),auth[_0x4122('0xa')](),controller[_0x4122('0x13')]);router[_0x4122('0x14')]('/',auth[_0x4122('0xa')](),controller[_0x4122('0x15')]);router[_0x4122('0x14')](_0x4122('0x10'),auth[_0x4122('0xa')](),controller[_0x4122('0x16')]);router[_0x4122('0x14')](_0x4122('0x17'),auth[_0x4122('0xa')](),interaction[_0x4122('0x18')](_0x4122('0x19'),'whatsappinteraction:addtags'),controller[_0x4122('0x1a')]);router[_0x4122('0x1b')](_0x4122('0xe'),auth[_0x4122('0xa')](),interaction['tracked'](_0x4122('0x19'),_0x4122('0x1c')),controller['update']);router[_0x4122('0x1d')](_0x4122('0xe'),auth[_0x4122('0xa')](),interaction[_0x4122('0x18')](_0x4122('0x19'),_0x4122('0x1e')),controller[_0x4122('0x1f')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x4122('0x20')]);module[_0x4122('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 978df88..88587c2 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 _0x5b5a=['STRING','ENUM','BOOLEAN','moment','exports','DATE'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x4a209a,_0x575ff9){_0x4a209a=_0x4a209a-0x0;var _0x4b3c20=_0x5b5a[_0x4a209a];return _0x4b3c20;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa5b5('0x0'));module[_0xa5b5('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa5b5('0x2')]},'disposition':{'type':Sequelize[_0xa5b5('0x3')]},'secondDisposition':{'type':Sequelize[_0xa5b5('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa5b5('0x3')]},'note':{'type':Sequelize[_0xa5b5('0x3')]},'phone':{'type':Sequelize[_0xa5b5('0x3')]},'read1stAt':{'type':Sequelize[_0xa5b5('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xa5b5('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa5b5('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xa5b5('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa5b5('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x5fc3=['sequelize','moment','BOOLEAN','DATE','STRING','ENUM'];(function(_0x2e93d2,_0x5df33a){var _0x59a589=function(_0x898c2e){while(--_0x898c2e){_0x2e93d2['push'](_0x2e93d2['shift']());}};_0x59a589(++_0x5df33a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0x5fc3[_0x18b344];return _0x5ef6bb;};'use strict';var Sequelize=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));module['exports']={'closed':{'type':Sequelize[_0x35fc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x35fc('0x3')]},'disposition':{'type':Sequelize[_0x35fc('0x4')]},'secondDisposition':{'type':Sequelize[_0x35fc('0x4')]},'thirdDisposition':{'type':Sequelize[_0x35fc('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x35fc('0x4')]},'read1stAt':{'type':Sequelize[_0x35fc('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x35fc('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x35fc('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x35fc('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 8e453a7..40da195 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 _0xc7da=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','Users','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','map','WhatsappInteraction','rawAttributes','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','from','u.id','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','whatsapp_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','merge','body','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','WhatsappInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','spread','Tag','findAll','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','secret','renderFile','transcript-','.pdf','createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox'];(function(_0x33582f,_0x160455){var _0x57047f=function(_0x2ca948){while(--_0x2ca948){_0x33582f['push'](_0x33582f['shift']());}};_0x57047f(++_0x160455);}(_0xc7da,0xf2));var _0xac7d=function(_0x5627c7,_0x51249a){_0x5627c7=_0x5627c7-0x0;var _0x53de98=_0xc7da[_0x5627c7];return _0x53de98;};'use strict';var emlformat=require(_0xac7d('0x0'));var rimraf=require(_0xac7d('0x1'));var zipdir=require(_0xac7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac7d('0x3'));var moment=require(_0xac7d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xac7d('0x5'));var util=require(_0xac7d('0x6'));var path=require('path');var sox=require(_0xac7d('0x7'));var csv=require(_0xac7d('0x8'));var ejs=require(_0xac7d('0x9'));var fs=require('fs');var fs_extra=require(_0xac7d('0xa'));var _=require(_0xac7d('0xb'));var squel=require(_0xac7d('0xc'));var crypto=require('crypto');var jsforce=require(_0xac7d('0xd'));var deskjs=require(_0xac7d('0xe'));var toCsv=require(_0xac7d('0x8'));var querystring=require(_0xac7d('0xf'));var Papa=require(_0xac7d('0x10'));var Redis=require(_0xac7d('0x11'));var authService=require(_0xac7d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xac7d('0x13'));var pdf=require(_0xac7d('0x14'));var hardwareService=require(_0xac7d('0x15'));var logger=require('../../config/logger')(_0xac7d('0x16'));var utils=require(_0xac7d('0x17'));var config=require(_0xac7d('0x18'));var licenseUtil=require(_0xac7d('0x19'));var db=require('../../mysqldb')['db'];config[_0xac7d('0x1a')]=_[_0xac7d('0x1b')](config[_0xac7d('0x1a')],{'host':_0xac7d('0x1c'),'port':0x18eb});var socket=require(_0xac7d('0x1d'))(new Redis(config['redis']));require(_0xac7d('0x1e'))['register'](socket);function respondWithStatusCode(_0x3e580d,_0x425235){_0x425235=_0x425235||0xcc;return function(_0x34980f){if(_0x34980f){return _0x3e580d[_0xac7d('0x1f')](_0x425235);}return _0x3e580d['status'](_0x425235)[_0xac7d('0x20')]();};}function respondWithResult(_0x4283dd,_0x27ed38){_0x27ed38=_0x27ed38||0xc8;return function(_0x12813a){if(_0x12813a){return _0x4283dd[_0xac7d('0x21')](_0x27ed38)['json'](_0x12813a);}};}function respondWithFilteredResult(_0x7df8e0,_0x3cb12d){return function(_0x563634){if(_0x563634){var _0x2e4790=typeof _0x3cb12d[_0xac7d('0x22')]===_0xac7d('0x23')&&typeof _0x3cb12d[_0xac7d('0x24')]==='undefined';var _0x46e2ed=_0x563634[_0xac7d('0x25')];var _0xed8eb9=_0x2e4790?0x0:_0x3cb12d['offset'];var _0xd42c40=_0x2e4790?_0x563634['count']:_0x3cb12d[_0xac7d('0x22')]+_0x3cb12d[_0xac7d('0x24')];var _0x3ffdac;if(_0xd42c40>=_0x46e2ed){_0xd42c40=_0x46e2ed;_0x3ffdac=0xc8;}else{_0x3ffdac=0xce;}_0x7df8e0[_0xac7d('0x21')](_0x3ffdac);return _0x7df8e0[_0xac7d('0x26')](_0xac7d('0x27'),_0xed8eb9+'-'+_0xd42c40+'/'+_0x46e2ed)['json'](_0x563634);}return null;};}function patchUpdates(_0x54c857){return function(_0x18ee8a){try{jsonpatch[_0xac7d('0x28')](_0x18ee8a,_0x54c857,!![]);}catch(_0x5098bb){return BPromise[_0xac7d('0x29')](_0x5098bb);}return _0x18ee8a[_0xac7d('0x2a')]();};}function saveUpdates(_0x2a5774,_0x1c1f88){return function(_0x43aa8e){if(_0x43aa8e){return _0x43aa8e[_0xac7d('0x2b')](_0x2a5774)[_0xac7d('0x2c')](function(_0x3bb7dd){return _0x3bb7dd;});}return null;};}function removeEntity(_0x42e313,_0x26a8c4){return function(_0x594d6e){if(_0x594d6e){return _0x594d6e[_0xac7d('0x2d')]()[_0xac7d('0x2c')](function(){_0x42e313[_0xac7d('0x21')](0xcc)[_0xac7d('0x20')]();});}};}function handleEntityNotFound(_0x4cc590,_0x579b99){return function(_0x4abb77){if(!_0x4abb77){_0x4cc590[_0xac7d('0x1f')](0x194);}return _0x4abb77;};}function handleError(_0x32b12c,_0xac3f87){_0xac3f87=_0xac3f87||0x1f4;return function(_0x5bd39b){logger[_0xac7d('0x2e')](_0x5bd39b['stack']);if(_0x5bd39b['name']){delete _0x5bd39b['name'];}_0x32b12c['status'](_0xac3f87)['send'](_0x5bd39b);};}function getInteractionUsers(_0x104186,_0x1109b1){return new BPromise(function(_0x35be2f,_0x31a082){try{if(_0x1109b1[_0x104186['id']]){_0x104186[_0xac7d('0x2f')]=_['map'](_0x1109b1[_0x104186['id']],function(_0x4ce2ed){return{'id':_0x4ce2ed['id'],'fullname':_0x4ce2ed[_0xac7d('0x30')]};});}}catch(_0xfbfbf7){_0x31a082(_0xfbfbf7);}_0x35be2f(_0x104186);});}function getInteractionTags(_0x20b54d,_0x2a71b3){return new BPromise(function(_0x39dc77,_0x500161){try{if(_0x20b54d[_0xac7d('0x31')]){_0x20b54d[_0xac7d('0x32')]=[];_0x20b54d[_0xac7d('0x31')][_0xac7d('0x33')](',')[_0xac7d('0x34')](function(_0x2e10f7){_0x20b54d[_0xac7d('0x32')][_0xac7d('0x35')](_0x2a71b3[_0x2e10f7]);});}delete _0x20b54d[_0xac7d('0x31')];}catch(_0x3ecf30){_0x500161(_0x3ecf30);}_0x39dc77(_0x20b54d);});}function updateWhatsappInteraction(_0x4ee968,_0x2237be,_0x1835d2){return new BPromise(function(_0x64724b,_0x117115){return getInteractionUsers(_0x4ee968,_0x1835d2)[_0xac7d('0x2c')](function(_0x5690e4){return getInteractionTags(_0x5690e4,_0x2237be);})[_0xac7d('0x2c')](function(_0x5c09a4){return getStateInteraction(_0x5c09a4);})['then'](function(_0x23a09d){_0x64724b(_0x23a09d);})[_0xac7d('0x36')](function(_0x2adca1){_0x117115(_0x2adca1);});});}function getStateInteraction(_0x245977){return new BPromise(function(_0xcecc9a){_0x245977[_0xac7d('0x37')]=0x0;_0x245977[_0xac7d('0x38')]=0x0;_0x245977[_0xac7d('0x39')]=0x0;_0x245977[_0xac7d('0x3a')]=0x0;_0x245977[_0xac7d('0x3b')]=0x0;if(!_0x245977[_0xac7d('0x3c')]&&!_0x245977['UserId']){_0x245977['waiting']+=0x1;}if(!_0x245977[_0xac7d('0x3c')]&&_0x245977['UserId']){_0x245977[_0xac7d('0x38')]+=0x1;if(_0x245977[_0xac7d('0x37')]){_0x245977[_0xac7d('0x37')]-=0x1;}}if(_0x245977[_0xac7d('0x3c')]&&_0x245977['UserId']){_0x245977['answered']+=0x1;if(_0x245977[_0xac7d('0x38')]){_0x245977[_0xac7d('0x38')]-=0x1;}}if(_0x245977[_0xac7d('0x3c')]&&!_0x245977[_0xac7d('0x3d')]){_0x245977[_0xac7d('0x3a')]+=0x1;if(_0x245977['waiting']){_0x245977['waiting']-=0x1;}}_0x245977[_0xac7d('0x3b')]+=0x1;_0xcecc9a(_0x245977);});}exports['index']=function(_0x117dc1,_0x461209){var _0x2f075e={},_0x4984bd={},_0xe7a38d={'count':0x0,'rows':[]};var _0x3d92de=_[_0xac7d('0x3e')](db[_0xac7d('0x3f')][_0xac7d('0x40')],function(_0x34f8c6){return{'name':_0x34f8c6['fieldName'],'type':_0x34f8c6['type'][_0xac7d('0x41')]};});_0x4984bd[_0xac7d('0x42')]=_['map'](_0x3d92de,_0xac7d('0x43'));_0x4984bd[_0xac7d('0x44')]=_[_0xac7d('0x45')](_0x117dc1['query']);_0x4984bd['filters']=_[_0xac7d('0x46')](_0x4984bd['model'],_0x4984bd[_0xac7d('0x44')]);_0x2f075e[_0xac7d('0x47')]=_[_0xac7d('0x46')](_0x4984bd[_0xac7d('0x42')],qs[_0xac7d('0x48')](_0x117dc1[_0xac7d('0x44')][_0xac7d('0x48')]));_0x2f075e[_0xac7d('0x47')]=_0x2f075e[_0xac7d('0x47')][_0xac7d('0x49')]?_0x2f075e['attributes']:_0x4984bd[_0xac7d('0x42')];if(!_0x117dc1[_0xac7d('0x44')][_0xac7d('0x4a')](_0xac7d('0x4b'))){_0x2f075e[_0xac7d('0x24')]=qs[_0xac7d('0x24')](_0x117dc1[_0xac7d('0x44')]['limit']);_0x2f075e[_0xac7d('0x22')]=qs[_0xac7d('0x22')](_0x117dc1['query'][_0xac7d('0x22')]);}_0x2f075e[_0xac7d('0x4c')]=qs[_0xac7d('0x4d')](_0x117dc1[_0xac7d('0x44')][_0xac7d('0x4d')]);_0x2f075e[_0xac7d('0x4e')]=qs[_0xac7d('0x4f')](_['pick'](_0x117dc1[_0xac7d('0x44')],_0x4984bd[_0xac7d('0x4f')]),_0x3d92de);var _0x59d07e=[];var _0x2231dd=squel[_0xac7d('0x50')]()[_0xac7d('0x51')]('id')['field'](_0xac7d('0x43'))[_0xac7d('0x51')](_0xac7d('0x52'))[_0xac7d('0x53')]('tools_tags');var _0x2cf14d=squel[_0xac7d('0x50')]()[_0xac7d('0x51')](_0xac7d('0x54'))[_0xac7d('0x51')]('u.fullname')['field'](_0xac7d('0x55'))[_0xac7d('0x53')](_0xac7d('0x56'),'ui')['left_join'](_0xac7d('0x57'),'u','u.id\x20=\x20ui.UserId');var _0x303764=squel[_0xac7d('0x50')]()[_0xac7d('0x53')](_0xac7d('0x58'),'i')[_0xac7d('0x59')](_0xac7d('0x5a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xac7d('0x59')](_0xac7d('0x57'),'o',_0xac7d('0x5b'))[_0xac7d('0x59')](_0xac7d('0x5c'),'a',_0xac7d('0x5d'))[_0xac7d('0x59')](_0xac7d('0x5e'),'me',_0xac7d('0x5f'))[_0xac7d('0x59')](_0xac7d('0x60'),'it',_0xac7d('0x61'))[_0xac7d('0x59')](_0xac7d('0x62'),'t',_0xac7d('0x63'));var _0x3a7347=squel[_0xac7d('0x64')]();var _0x4c5e10=[];var _0x1fcac2=squel[_0xac7d('0x64')]();var _0x3933ef;if(_0x117dc1[_0xac7d('0x44')][_0xac7d('0x65')]){_0x3933ef=as[_0xac7d('0x66')](_0x117dc1['query']['search']);var _0x4ee832=_0x3933ef[_0xac7d('0x67')];for(var _0x15046a=0x0;_0x15046a<_0x3933ef[_0xac7d('0x68')]['length'];_0x15046a++){var _0x3048b6=_0x3933ef[_0xac7d('0x68')][_0x15046a];var _0x368c90='i';var _0x389790=_[_0xac7d('0x69')](_0x3d92de,['name',_0x3048b6[_0xac7d('0x51')]]);if(!_0x389790){switch(_0x3048b6[_0xac7d('0x51')]){case _0xac7d('0x6a'):if(_0x3048b6[_0xac7d('0x6b')]==0x1){_0x303764['having']('`'+_0x3048b6['field']+_0xac7d('0x6c'));}else{_0x303764[_0xac7d('0x6d')]('`'+_0x3048b6[_0xac7d('0x51')]+_0xac7d('0x6e'));}break;case _0xac7d('0x6f'):if(_0x3048b6[_0xac7d('0x70')]===_0xac7d('0x71')){if(_0x3048b6[_0xac7d('0x6b')][_0xac7d('0x33')]('\x20')['length']>0x1){_0x3a7347[_0x4ee832](_0xac7d('0x72'),qs[_0xac7d('0x73')](_0x3048b6[_0xac7d('0x6b')]),null);}else{var _0x2ea5ea='%'+_0x3048b6['value']+'%';_0x3a7347[_0x4ee832](_0xac7d('0x74'),_0x2ea5ea,_0x2ea5ea,_0x2ea5ea);}}else{_0x389790=_[_0xac7d('0x69')](_0x3d92de,[_0xac7d('0x43'),_0xac7d('0x75')]);_0x3048b6[_0xac7d('0x51')]='ContactId';_0x33be18=as[_0xac7d('0x76')](_0x368c90,_0x389790[_0xac7d('0x77')],_0x3048b6);_0x3a7347[_0x4ee832](_0x33be18[_0xac7d('0x78')],_0x33be18[_0xac7d('0x6b')][_0xac7d('0x79')],_0x33be18[_0xac7d('0x6b')][_0xac7d('0x20')]);}break;case'Tag':var _0x1ed94c=_0x3048b6[_0xac7d('0x6b')][_0xac7d('0x33')](',')[_0xac7d('0x3e')](function(_0x145bfa){return Number(_0x145bfa);});_0x1ed94c[_0xac7d('0x34')](function(_0xf2b4bb){_0x1fcac2['or'](_0xac7d('0x7a'),'%,'+_0xf2b4bb+',%');});_0x4c5e10=_[_0xac7d('0x7b')](_0x4c5e10,_0x1ed94c);break;case _0xac7d('0x7c'):if(_0x3048b6[_0xac7d('0x70')]===_0xac7d('0x71')){_0x3a7347[_0x4ee832](_0xac7d('0x7d'),'%'+_0x3048b6['value']+'%',null);}else{_0x389790=_[_0xac7d('0x69')](_0x3d92de,[_0xac7d('0x43'),_0xac7d('0x3d')]);_0x3048b6['field']=_0xac7d('0x3d');_0x33be18=as['buildExpression'](_0x368c90,_0x389790['type'],_0x3048b6);_0x3a7347[_0x4ee832](_0x33be18[_0xac7d('0x78')],_0x33be18[_0xac7d('0x6b')][_0xac7d('0x79')],_0x33be18[_0xac7d('0x6b')][_0xac7d('0x20')]);}break;case'body':_0x33be18=as[_0xac7d('0x76')]('me',null,_0x3048b6);_0x3a7347[_0x4ee832](_0x33be18['text'],_0x33be18[_0xac7d('0x6b')]['start'],_0x33be18[_0xac7d('0x6b')][_0xac7d('0x20')]);break;}}else{var _0x33be18=as['buildExpression'](_0x368c90,_0x389790[_0xac7d('0x77')],_0x3048b6);_0x3a7347[_0x4ee832](_0x33be18[_0xac7d('0x78')],_0x33be18[_0xac7d('0x6b')][_0xac7d('0x79')],_0x33be18['value'][_0xac7d('0x20')]);}}}else{var _0x2779a4=_(_0x117dc1[_0xac7d('0x44')])['keys']()['map'](function(_0x4294d8){return _[_0xac7d('0x7e')](_0x3d92de,['name',_0x4294d8])?_0x4294d8:undefined;})['compact']()[_0xac7d('0x6b')]();if(!_['isEmpty'](_0x2779a4)){_0x2779a4[_0xac7d('0x34')](function(_0x1f5ba6){if(_0x1f5ba6===_0xac7d('0x7f')){_0x303764[_0xac7d('0x4e')](_0xac7d('0x80'),[]['concat'](_0x117dc1[_0xac7d('0x44')][_0x1f5ba6]));}else if(_0x1f5ba6===_0xac7d('0x81')){var _0x58960c=JSON[_0xac7d('0x82')](_0x117dc1[_0xac7d('0x44')][_0x1f5ba6])[_0xac7d('0x83')];var _0x5f5af2=JSON[_0xac7d('0x82')](_0x117dc1[_0xac7d('0x44')][_0x1f5ba6])[_0xac7d('0x84')];_0x303764[_0xac7d('0x4e')](_0xac7d('0x85'),_0x58960c,_0x5f5af2);}else{if(_0x117dc1[_0xac7d('0x44')][_0x1f5ba6]==='null'){_0x303764['where']('i.'+_0x1f5ba6+_0xac7d('0x86'));}else{_0x303764[_0xac7d('0x4e')]('i.'+_0x1f5ba6+_0xac7d('0x87'),_0x117dc1['query'][_0x1f5ba6]);}}});}if(_0x117dc1[_0xac7d('0x44')][_0xac7d('0x88')]){if(_0x117dc1[_0xac7d('0x44')][_0xac7d('0x88')]==0x1){_0x303764[_0xac7d('0x6d')](_0xac7d('0x89'));}else{_0x303764[_0xac7d('0x6d')](_0xac7d('0x8a'));}}if(_0x117dc1[_0xac7d('0x44')]['tag']){_0x4c5e10=_['isArray'](_0x117dc1['query'][_0xac7d('0x8b')])?_0x117dc1['query'][_0xac7d('0x8b')]:new Array(_0x117dc1[_0xac7d('0x44')][_0xac7d('0x8b')]);_0x4c5e10[_0xac7d('0x34')](function(_0x561429){_0x1fcac2['or'](_0xac7d('0x7a'),'%,'+_0x561429+',%');});}if(_0x117dc1[_0xac7d('0x44')][_0xac7d('0x8c')]){var _0x4ba62d=_0x117dc1[_0xac7d('0x44')][_0xac7d('0x8c')]['replace']('\x5c','\x5c\x5c')[_0xac7d('0x8d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4ba62d)){_0x3a7347['or'](_0xac7d('0x8e'),_0x4ba62d+'%')['or'](_0xac7d('0x8f'),_0x4ba62d+'%');}else{_0x3a7347['or'](_0xac7d('0x90'),qs[_0xac7d('0x73')](_0x4ba62d))['or'](_0xac7d('0x91'),_0x4ba62d+'%');}}}_0x303764[_0xac7d('0x4e')](_0x3a7347);_0x303764['group'](_0xac7d('0x92'));var _0x941aa6={'type':db[_0xac7d('0x93')][_0xac7d('0x94')]['SELECT'],'raw':!![]};var _0x54fa30=_0x303764['clone']();_0x54fa30[_0xac7d('0x51')]('i.id');_0x54fa30[_0xac7d('0x51')](_0xac7d('0x95'),'unreadMessages');if(_0x2f075e[_0xac7d('0x4c')]){_0x2f075e[_0xac7d('0x4c')][_0xac7d('0x34')](function(_0x22a3ab){var _0x2bc2c8=_0x22a3ab[0x0]===_0xac7d('0x96')?_0x22a3ab[0x0]:'i.'+_0x22a3ab[0x0];_0x303764[_0xac7d('0x4c')](_0x2bc2c8,_0x22a3ab[0x1]===_0xac7d('0x97')?![]:!![]);});}if(!_[_0xac7d('0x98')](_0x4c5e10)){_0x303764[_0xac7d('0x6d')](_0x1fcac2);_0x54fa30[_0xac7d('0x4e')](_0xac7d('0x99'),_0x4c5e10);}BPromise[_0xac7d('0x9a')]()[_0xac7d('0x2c')](function(){if(!_0x3933ef){if(_0x117dc1[_0xac7d('0x44')][_0xac7d('0x7f')])return;_0x54fa30[_0xac7d('0x4e')](_0xac7d('0x9b'));_0x303764[_0xac7d('0x4e')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x117dc1['user'][_0xac7d('0x9c')]!==_0xac7d('0x9d'))return;return _0x117dc1[_0xac7d('0x9e')][_0xac7d('0x9f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x7d535a){if(_[_0xac7d('0x98')](_0x7d535a)){_0x54fa30[_0xac7d('0x4e')]('i.WhatsappAccountId\x20IS\x20NULL');_0x303764[_0xac7d('0x4e')](_0xac7d('0xa0'));}else{_0x54fa30[_0xac7d('0x4e')](_0xac7d('0x80'),_['map'](_0x7d535a,'id'));_0x303764[_0xac7d('0x4e')](_0xac7d('0x80'),_[_0xac7d('0x3e')](_0x7d535a,'id'));}});})['then'](function(){if(_0x117dc1[_0xac7d('0x9e')]['role']===_0xac7d('0x9d')&&!_0x3933ef&&!_0x117dc1[_0xac7d('0x44')][_0xac7d('0x7f')])return[];return db[_0xac7d('0xa1')]['query'](_0x54fa30[_0xac7d('0xa2')](),_0x941aa6);})[_0xac7d('0x2c')](function(_0x4f53e7){_0xe7a38d[_0xac7d('0x25')]=_0x4f53e7[_0xac7d('0x49')];if(_0xe7a38d['count']===0x0)return[];return db[_0xac7d('0xa1')][_0xac7d('0x44')](_0x2231dd['toString'](),_0x941aa6)['then'](function(_0xc82384){_0x59d07e=_[_0xac7d('0xa3')](_0xc82384,'id');_0x941aa6=_['merge'](_0x941aa6,{'model':db[_0xac7d('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x117dc1[_0xac7d('0x44')][_0xac7d('0x48')]){_0x2f075e[_0xac7d('0x47')]['forEach'](function(_0x12c052){_0x303764['field']('i.'+_0x12c052);});}else{_0x303764['field'](_0xac7d('0x95'),_0xac7d('0x6a'));_0x303764['field'](_0xac7d('0xa4'),_0xac7d('0xa5'));_0x303764[_0xac7d('0x51')](_0xac7d('0xa6'),_0xac7d('0xa7'));_0x303764[_0xac7d('0x51')](_0xac7d('0xa8'),_0xac7d('0x96'));_0x303764[_0xac7d('0x51')](_0xac7d('0xa9'));_0x303764[_0xac7d('0x51')](_0xac7d('0xaa'),_0xac7d('0xab'));_0x303764[_0xac7d('0x51')](_0xac7d('0xac'),_0xac7d('0xad'));_0x303764[_0xac7d('0x51')](_0xac7d('0xae'),_0xac7d('0xaf'));_0x303764['field'](_0xac7d('0xb0'),_0xac7d('0xb1'));_0x303764[_0xac7d('0x51')](_0xac7d('0xb2'),'Contact.mobile');_0x303764[_0xac7d('0x51')](_0xac7d('0xb3'),_0xac7d('0xb4'));_0x303764[_0xac7d('0x51')](_0xac7d('0xb5'),_0xac7d('0xb6'));_0x303764[_0xac7d('0x51')](_0xac7d('0xb7'),_0xac7d('0xb8'));_0x303764[_0xac7d('0x51')](_0xac7d('0xb9'),'TagIds');}if(_0x2f075e[_0xac7d('0x24')])_0x303764['limit'](_0x2f075e['limit']);if(_0x2f075e[_0xac7d('0x22')])_0x303764[_0xac7d('0x22')](_0x2f075e[_0xac7d('0x22')]);return db[_0xac7d('0xa1')][_0xac7d('0x44')](_0x303764[_0xac7d('0xa2')](),_0x941aa6);})[_0xac7d('0x2c')](function(_0x2e78eb){if(_0x2e78eb[_0xac7d('0x49')]>0x0)_0x2cf14d['where'](_0xac7d('0xba'),_[_0xac7d('0x3e')](_0x2e78eb,'id'));return db[_0xac7d('0xa1')][_0xac7d('0x44')](_0x2cf14d[_0xac7d('0xa2')](),_0x941aa6)[_0xac7d('0x2c')](function(_0x1b736c){var _0x27eeae=_[_0xac7d('0xbb')](_0x1b736c,'WhatsappInteractionId');var _0x4d88d4=[];_0x2e78eb[_0xac7d('0x34')](function(_0x44e377){_0x4d88d4[_0xac7d('0x35')](updateWhatsappInteraction(_0x44e377,_0x59d07e,_0x27eeae));});return BPromise[_0xac7d('0xbc')](_0x4d88d4);});});})[_0xac7d('0x2c')](function(_0x1c39db){_0xe7a38d[_0xac7d('0xbd')]=_0x1c39db;return _0xe7a38d;})['then'](respondWithFilteredResult(_0x461209,_0x2f075e))[_0xac7d('0x36')](handleError(_0x461209,null));};exports[_0xac7d('0xbe')]=function(_0x2891e9,_0x18704b){var _0x458277={'raw':![],'where':{'id':_0x2891e9[_0xac7d('0xbf')]['id']}},_0x5c3f82={};_0x5c3f82[_0xac7d('0x42')]=_[_0xac7d('0x45')](db['WhatsappInteraction'][_0xac7d('0x40')]);_0x5c3f82[_0xac7d('0x44')]=_[_0xac7d('0x45')](_0x2891e9['query']);_0x5c3f82[_0xac7d('0x4f')]=_[_0xac7d('0x46')](_0x5c3f82['model'],_0x5c3f82['query']);_0x458277[_0xac7d('0x47')]=_[_0xac7d('0x46')](_0x5c3f82[_0xac7d('0x42')],qs[_0xac7d('0x48')](_0x2891e9[_0xac7d('0x44')]['fields']));_0x458277[_0xac7d('0x47')]=_0x458277['attributes']['length']?_0x458277[_0xac7d('0x47')]:_0x5c3f82[_0xac7d('0x42')];if(_0x2891e9[_0xac7d('0x44')][_0xac7d('0xc0')]){_0x458277['include']=[{'all':!![]}];}_0x458277=_[_0xac7d('0xc1')]({},_0x458277,_0x2891e9['options']);return db['WhatsappInteraction'][_0xac7d('0x69')](_0x458277)[_0xac7d('0x2c')](handleEntityNotFound(_0x18704b,null))[_0xac7d('0x2c')](respondWithResult(_0x18704b,null))['catch'](handleError(_0x18704b,null));};exports['create']=function(_0x34d224,_0x2c0edb){return db['WhatsappInteraction']['create'](_0x34d224[_0xac7d('0xc2')],{})[_0xac7d('0x2c')](respondWithResult(_0x2c0edb,0xc9))['catch'](handleError(_0x2c0edb,null));};exports[_0xac7d('0x2b')]=function(_0x5e9bd9,_0x50fa9e){if(_0x5e9bd9[_0xac7d('0xc2')]['id']){delete _0x5e9bd9[_0xac7d('0xc2')]['id'];}return db[_0xac7d('0x3f')][_0xac7d('0x69')]({'where':{'id':_0x5e9bd9[_0xac7d('0xbf')]['id']}})[_0xac7d('0x2c')](handleEntityNotFound(_0x50fa9e,null))[_0xac7d('0x2c')](saveUpdates(_0x5e9bd9[_0xac7d('0xc2')],null))[_0xac7d('0x2c')](respondWithResult(_0x50fa9e,null))[_0xac7d('0x36')](handleError(_0x50fa9e,null));};exports['destroy']=function(_0x12ff89,_0x1e8379){return db[_0xac7d('0x3f')][_0xac7d('0x69')]({'where':{'id':_0x12ff89['params']['id']}})[_0xac7d('0x2c')](handleEntityNotFound(_0x1e8379,null))['then'](removeEntity(_0x1e8379,null))['catch'](handleError(_0x1e8379,null));};exports[_0xac7d('0xc3')]=function(_0xe76e1,_0x1ce513){return db[_0xac7d('0x3f')][_0xac7d('0xc3')]()[_0xac7d('0x2c')](respondWithResult(_0x1ce513,null))[_0xac7d('0x36')](handleError(_0x1ce513,null));};exports[_0xac7d('0xc4')]=function(_0x1d46de,_0x54b679,_0x114c54){return db[_0xac7d('0xc5')][_0xac7d('0x69')]({'where':{'id':_0x1d46de[_0xac7d('0xbf')]['id']}})[_0xac7d('0x2c')](handleEntityNotFound(_0x54b679,null))[_0xac7d('0x2c')](function(_0x8ac5e6){if(_0x8ac5e6){return _0x8ac5e6[_0xac7d('0xc4')](_0x1d46de['body'][_0xac7d('0xc6')],_[_0xac7d('0xc7')](_0x1d46de['body'],['ids','id'])||{});}})[_0xac7d('0x2c')](respondWithResult(_0x54b679,null))[_0xac7d('0x36')](handleError(_0x54b679,null));};exports[_0xac7d('0xc8')]=function(_0x20602c,_0x31675b,_0x557034){var _0x17ff46={'raw':![],'where':{}};var _0x170e96={};var _0x5f036d={'count':0x0,'rows':[]};return db[_0xac7d('0x3f')][_0xac7d('0xc9')]({'where':{'id':_0x20602c['params']['id']}})[_0xac7d('0x2c')](handleEntityNotFound(_0x31675b,null))['then'](function(_0x5beef4){if(_0x5beef4){_0x170e96[_0xac7d('0x42')]=_['keys'](db['WhatsappMessage'][_0xac7d('0x40')]);_0x170e96[_0xac7d('0x44')]=_[_0xac7d('0x45')](_0x20602c[_0xac7d('0x44')]);_0x170e96[_0xac7d('0x4f')]=_[_0xac7d('0x46')](_0x170e96[_0xac7d('0x42')],_0x170e96['query']);_0x17ff46[_0xac7d('0x47')]=_['intersection'](_0x170e96[_0xac7d('0x42')],qs[_0xac7d('0x48')](_0x20602c[_0xac7d('0x44')][_0xac7d('0x48')]));_0x17ff46[_0xac7d('0x47')]=_0x17ff46[_0xac7d('0x47')][_0xac7d('0x49')]?_0x17ff46['attributes']:_0x170e96['model'];if(!_0x20602c['query'][_0xac7d('0x4a')]('nolimit')){_0x17ff46[_0xac7d('0x24')]=qs[_0xac7d('0x24')](_0x20602c[_0xac7d('0x44')][_0xac7d('0x24')]);_0x17ff46[_0xac7d('0x22')]=qs['offset'](_0x20602c[_0xac7d('0x44')]['offset']);}_0x17ff46['order']=qs[_0xac7d('0x4d')](_0x20602c['query'][_0xac7d('0x4d')]);_0x17ff46[_0xac7d('0x4e')]=qs['filters'](_['pick'](_0x20602c[_0xac7d('0x44')],_0x170e96['filters']));_0x17ff46[_0xac7d('0x4e')][_0xac7d('0xca')]=_0x5beef4['id'];if(_0x20602c['query'][_0xac7d('0x8c')]){_0x17ff46[_0xac7d('0x4e')]=_[_0xac7d('0xc1')](_0x17ff46[_0xac7d('0x4e')],{'$or':_[_0xac7d('0x3e')](_0x17ff46[_0xac7d('0x47')],function(_0x1ad751){var _0x1c2ad7={};_0x1c2ad7[_0x1ad751]={'$like':'%'+_0x20602c['query'][_0xac7d('0x8c')]+'%'};return _0x1c2ad7;})});}if(_0x20602c[_0xac7d('0x44')][_0xac7d('0x83')]){var _0x1c7b09=_0x20602c['query']['$gte'][_0xac7d('0x33')](',');var _0x554728={};_0x554728[_0x1c7b09[0x0]]={'$gte':moment(_0x1c7b09[0x1])[_0xac7d('0xcb')](_0xac7d('0xcc'))};_0x17ff46['where']=_[_0xac7d('0xc1')](_0x17ff46[_0xac7d('0x4e')],_0x554728);}_0x17ff46=_[_0xac7d('0xc1')]({},_0x17ff46,_0x20602c['options']);return db['WhatsappMessage']['count']({'where':_0x17ff46[_0xac7d('0x4e')]})['then'](function(_0x57e904){_0x5f036d[_0xac7d('0x25')]=_0x57e904;if(_0x20602c['query'][_0xac7d('0xc0')]){_0x17ff46[_0xac7d('0xcd')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x17ff46);})[_0xac7d('0x2c')](function(_0x15628f){_0x5f036d[_0xac7d('0xbd')]=_0x15628f;return _0x5f036d;});}})[_0xac7d('0x2c')](respondWithFilteredResult(_0x31675b,_0x17ff46))[_0xac7d('0x36')](handleError(_0x31675b,null));};exports[_0xac7d('0xce')]=function(_0x29fb1c,_0x35b5de,_0x5957cf){return db['WhatsappInteraction'][_0xac7d('0x69')]({'where':{'id':_0x29fb1c[_0xac7d('0xbf')]['id']}})[_0xac7d('0x2c')](handleEntityNotFound(_0x35b5de,null))[_0xac7d('0x2c')](function(_0xb7cfea){if(_0xb7cfea){return _0xb7cfea[_0xac7d('0xcf')](_0x29fb1c[_0xac7d('0xc2')]['ids'],_[_0xac7d('0xc7')](_0x29fb1c[_0xac7d('0xc2')],['ids','id'])||{})[_0xac7d('0xd0')](function(){return db[_0xac7d('0xd1')][_0xac7d('0xd2')]({'attributes':['id',_0xac7d('0x43'),_0xac7d('0x52')],'where':{'id':_0x29fb1c[_0xac7d('0xc2')][_0xac7d('0xc6')]}});})[_0xac7d('0x2c')](function(_0x36bba3){socket[_0xac7d('0xd3')](_0xac7d('0xd4'),{'id':Number(_0x29fb1c[_0xac7d('0xbf')]['id']),'tags':_0x36bba3||[]});return{'id':Number(_0x29fb1c[_0xac7d('0xbf')]['id']),'tags':_0x36bba3||[]};});}})[_0xac7d('0x2c')](respondWithResult(_0x35b5de,null))['catch'](handleError(_0x35b5de,null));};exports[_0xac7d('0xd5')]=function(_0x2eab64,_0x9c7a01,_0x59093c){return db[_0xac7d('0x3f')][_0xac7d('0x69')]({'where':{'id':_0x2eab64['params']['id']}})['then'](handleEntityNotFound(_0x9c7a01,null))[_0xac7d('0x2c')](function(_0x5773a4){if(_0x5773a4){return _0x5773a4[_0xac7d('0xd5')](_0x2eab64[_0xac7d('0x44')][_0xac7d('0xc6')]);}})['then'](respondWithStatusCode(_0x9c7a01,null))[_0xac7d('0x36')](handleError(_0x9c7a01,null));};exports[_0xac7d('0xd6')]=function(_0x1ee16b,_0x355860){var _0x1d31a8=moment()[_0xac7d('0xd7')]()['toString']();var _0x299be2=path[_0xac7d('0xd8')](config[_0xac7d('0xd9')],_0xac7d('0xda'),_0xac7d('0xdb'),_0xac7d('0xdc'));var _0x1d939f=path[_0xac7d('0xd8')](config[_0xac7d('0xd9')],_0xac7d('0xda'),_0xac7d('0xdb'),_0xac7d('0xdd'));var _0x1c4a43=path[_0xac7d('0xd8')](_0x299be2,_0x1d31a8);var _0x52297b=util['format'](_0xac7d('0xde'),_0x1ee16b[_0xac7d('0xbf')]['id'],_0x1d31a8);var _0x139a0d=path[_0xac7d('0xd8')](_0x299be2,_0x52297b);var _0x5f51b8=[];_0x5f51b8['push']({'model':db['User'],'as':_0xac7d('0x7c'),'attributes':['id','fullname'],'raw':!![]});_0x5f51b8[_0xac7d('0x35')]({'model':db[_0xac7d('0xdf')],'as':'Contact','attributes':['id',_0xac7d('0xe0'),_0xac7d('0xe1')],'raw':!![]});if(_0x1ee16b['query'][_0xac7d('0xdd')]){_0x5f51b8[_0xac7d('0x35')]({'model':db[_0xac7d('0xe2')],'as':_0xac7d('0xe2'),'raw':!![]});}var _0x589fd6=[{'model':db[_0xac7d('0xc5')],'as':_0xac7d('0xe3'),'attributes':['id',_0xac7d('0xc2'),_0xac7d('0x81'),_0xac7d('0xe4'),'secret','read'],'include':_0x5f51b8}];_0x589fd6[_0xac7d('0x35')]({'model':db[_0xac7d('0xe5')],'as':'Account','attributes':['id',_0xac7d('0x43')]});_0x589fd6[_0xac7d('0x35')]({'model':db[_0xac7d('0x7c')],'as':_0xac7d('0xe6'),'attributes':['id',_0xac7d('0x30')]});return db['WhatsappInteraction'][_0xac7d('0x69')]({'where':{'id':_0x1ee16b[_0xac7d('0xbf')]['id']},'include':_0x589fd6})[_0xac7d('0x2c')](handleEntityNotFound(_0x355860,null))['then'](function(_0x5c0a6a){if(_0x5c0a6a){var _0x407314=_0x5c0a6a[_0xac7d('0xe7')]({'plain':!![]});fs[_0xac7d('0xe8')](_0x1c4a43);var _0x26d279={'channel':_0xac7d('0xe9'),'account':_0x407314[_0xac7d('0xea')]['name'],'agent':_0x407314['Owner']?_0x407314[_0xac7d('0xe6')][_0xac7d('0x30')]:'N.A.','createdAt':moment(_0x407314[_0xac7d('0x81')])[_0xac7d('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xac7d('0xa2')](),'closedAt':_0x407314['closed']?moment(_0x407314[_0xac7d('0xeb')])[_0xac7d('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xac7d('0xa2')]():'','disposition':_0x407314[_0xac7d('0xec')],'messages':_(_0x407314[_0xac7d('0xe3')])[_0xac7d('0x8c')]({'secret':![]})[_0xac7d('0x3e')](function(_0x137c84){if(_0x137c84[_0xac7d('0xe2')]){var _0x306708=path['join'](_0x1d939f,_0x137c84['Attachment'][_0xac7d('0xed')]);if(fs[_0xac7d('0xee')](_0x306708)){fs[_0xac7d('0xef')](_0x306708)[_0xac7d('0xf0')](fs[_0xac7d('0xf1')](path[_0xac7d('0xd8')](_0x1c4a43,_0x137c84[_0xac7d('0xe2')][_0xac7d('0xed')])));}}return{'date':moment(_0x137c84[_0xac7d('0x81')])[_0xac7d('0xcb')](_0xac7d('0xcc'))[_0xac7d('0xa2')](),'sender':_0x137c84[_0xac7d('0xe4')]===_0xac7d('0xf2')?_0x137c84[_0xac7d('0x7c')]?_0x137c84[_0xac7d('0x7c')]['fullname']:'System':_0x137c84['Contact'][_0xac7d('0xe0')]+(_0x137c84[_0xac7d('0x6f')][_0xac7d('0xe1')]?'\x20'+_0x137c84['Contact']['lastName']:''),'body':_0x137c84[_0xac7d('0xe2')]?_0x137c84[_0xac7d('0xe2')][_0xac7d('0xed')]:_0x137c84[_0xac7d('0xc2')],'direction':_0x137c84['direction']===_0xac7d('0xf2')?'A':'C','secret':_0x137c84[_0xac7d('0xf3')],'read':_0x137c84[_0xac7d('0x88')],'attachment':_0x137c84['Attachment']};})[_0xac7d('0x6b')]()};return ejs[_0xac7d('0xf4')](path[_0xac7d('0xd8')](config[_0xac7d('0xd9')],_0xac7d('0xda'),'views','downloadInteraction.ejs'),{'interaction':_0x26d279})['then'](function(_0x32d188){var _0x32f419=path['join'](_0x1c4a43,_0xac7d('0xf5')+_0x407314['id']+'-'+_0x1d31a8+_0xac7d('0xf6'));var _0x5bf0a3={'path':_0x32f419,'channel':_0xac7d('0xe9'),'interactionId':_0x407314['id']};return pdf[_0xac7d('0xf7')](_0x32d188,_0x5bf0a3);})[_0xac7d('0x2c')](function(){return new BPromise(function(_0x2c0815,_0xca1519){zipdir(_0x1c4a43,{'saveTo':_0x139a0d},function(_0x18d076,_0x3411bc){if(_0x18d076)return _0xca1519(_0x18d076);return _0x2c0815(_0x3411bc);});})[_0xac7d('0x2c')](function(){return new BPromise(function(_0x9b18b5,_0x4f4eae){rimraf(_0x1c4a43,function(_0x4affc7){if(_0x4affc7)_0x4f4eae(_0x4affc7);return _0x9b18b5();});});})[_0xac7d('0x2c')](function(){return _0x355860[_0xac7d('0xd6')](_0x139a0d,_0x52297b,function(_0x2e90c5){if(_0x2e90c5){console[_0xac7d('0xf8')](_0xac7d('0xf9'),_0x2e90c5);}else{fs['unlinkSync'](_0x139a0d);}});});});}else{return _0x355860[_0xac7d('0x1f')](0xc8);}})[_0xac7d('0x36')](handleError(_0x355860,null));}; \ No newline at end of file +var _0x3a6d=['i.WhatsappAccountId\x20IS\x20NULL','agent','toString','sequelize','merge','WhatsappInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','rows','catch','includeAll','include','options','create','params','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','whatsappInteractionTags:save','removeTags','download','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closedAt','disposition','Messages','existsSync','createReadStream','pipe','createWriteStream','basename','out','secret','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','status','end','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','name','send','Users','fullname','TagIds','split','forEach','Tags','push','waiting','talking','answered','closed','UserId','unmanaged','total','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','$substring','getFullTextValue','value','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','buildExpression','body','keys','some','compact','isEmpty','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts'];(function(_0x4d9c3b,_0x3c4663){var _0x35c391=function(_0x22ac2e){while(--_0x22ac2e){_0x4d9c3b['push'](_0x4d9c3b['shift']());}};_0x35c391(++_0x3c4663);}(_0x3a6d,0x143));var _0xd3a6=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x3a6d[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xd3a6('0x0'));var rimraf=require(_0xd3a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3a6('0x2'));var rp=require(_0xd3a6('0x3'));var moment=require(_0xd3a6('0x4'));var BPromise=require(_0xd3a6('0x5'));var Mustache=require(_0xd3a6('0x6'));var util=require('util');var path=require(_0xd3a6('0x7'));var sox=require(_0xd3a6('0x8'));var csv=require(_0xd3a6('0x9'));var ejs=require(_0xd3a6('0xa'));var fs=require('fs');var fs_extra=require(_0xd3a6('0xb'));var _=require(_0xd3a6('0xc'));var squel=require('squel');var crypto=require(_0xd3a6('0xd'));var jsforce=require(_0xd3a6('0xe'));var deskjs=require(_0xd3a6('0xf'));var toCsv=require(_0xd3a6('0x9'));var querystring=require(_0xd3a6('0x10'));var Papa=require(_0xd3a6('0x11'));var Redis=require(_0xd3a6('0x12'));var authService=require(_0xd3a6('0x13'));var qs=require(_0xd3a6('0x14'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xd3a6('0x15'));var hardwareService=require(_0xd3a6('0x16'));var logger=require(_0xd3a6('0x17'))(_0xd3a6('0x18'));var utils=require(_0xd3a6('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xd3a6('0x1a')]=_[_0xd3a6('0x1b')](config[_0xd3a6('0x1a')],{'host':_0xd3a6('0x1c'),'port':0x18eb});var socket=require(_0xd3a6('0x1d'))(new Redis(config[_0xd3a6('0x1a')]));require(_0xd3a6('0x1e'))['register'](socket);function respondWithStatusCode(_0x473a97,_0xf5ace5){_0xf5ace5=_0xf5ace5||0xcc;return function(_0x171a8f){if(_0x171a8f){return _0x473a97['sendStatus'](_0xf5ace5);}return _0x473a97[_0xd3a6('0x1f')](_0xf5ace5)[_0xd3a6('0x20')]();};}function respondWithResult(_0x1781f6,_0x57d826){_0x57d826=_0x57d826||0xc8;return function(_0x3498d5){if(_0x3498d5){return _0x1781f6['status'](_0x57d826)['json'](_0x3498d5);}};}function respondWithFilteredResult(_0x28b63c,_0x8d1286){return function(_0x32683f){if(_0x32683f){var _0xbe58b4=typeof _0x8d1286[_0xd3a6('0x21')]===_0xd3a6('0x22')&&typeof _0x8d1286[_0xd3a6('0x23')]==='undefined';var _0x348ae9=_0x32683f['count'];var _0x6c6d21=_0xbe58b4?0x0:_0x8d1286[_0xd3a6('0x21')];var _0x12f2c1=_0xbe58b4?_0x32683f[_0xd3a6('0x24')]:_0x8d1286[_0xd3a6('0x21')]+_0x8d1286[_0xd3a6('0x23')];var _0x54c193;if(_0x12f2c1>=_0x348ae9){_0x12f2c1=_0x348ae9;_0x54c193=0xc8;}else{_0x54c193=0xce;}_0x28b63c[_0xd3a6('0x1f')](_0x54c193);return _0x28b63c[_0xd3a6('0x25')]('Content-Range',_0x6c6d21+'-'+_0x12f2c1+'/'+_0x348ae9)['json'](_0x32683f);}return null;};}function patchUpdates(_0x5846bc){return function(_0x573870){try{jsonpatch['apply'](_0x573870,_0x5846bc,!![]);}catch(_0x98a12a){return BPromise[_0xd3a6('0x26')](_0x98a12a);}return _0x573870[_0xd3a6('0x27')]();};}function saveUpdates(_0x5abd33,_0x456541){return function(_0x58e53a){if(_0x58e53a){return _0x58e53a[_0xd3a6('0x28')](_0x5abd33)[_0xd3a6('0x29')](function(_0x429079){return _0x429079;});}return null;};}function removeEntity(_0x4f6130,_0x14316b){return function(_0x3bc8d1){if(_0x3bc8d1){return _0x3bc8d1[_0xd3a6('0x2a')]()[_0xd3a6('0x29')](function(){_0x4f6130[_0xd3a6('0x1f')](0xcc)[_0xd3a6('0x20')]();});}};}function handleEntityNotFound(_0x5650d1,_0x30df90){return function(_0x2b5448){if(!_0x2b5448){_0x5650d1[_0xd3a6('0x2b')](0x194);}return _0x2b5448;};}function handleError(_0x3f6d35,_0x30abc2){_0x30abc2=_0x30abc2||0x1f4;return function(_0x45c628){logger['error'](_0x45c628['stack']);if(_0x45c628[_0xd3a6('0x2c')]){delete _0x45c628[_0xd3a6('0x2c')];}_0x3f6d35[_0xd3a6('0x1f')](_0x30abc2)[_0xd3a6('0x2d')](_0x45c628);};}function getInteractionUsers(_0x4c05a2,_0x3de3bb){return new BPromise(function(_0xa4efd,_0x4d322a){try{if(_0x3de3bb[_0x4c05a2['id']]){_0x4c05a2[_0xd3a6('0x2e')]=_['map'](_0x3de3bb[_0x4c05a2['id']],function(_0x134337){return{'id':_0x134337['id'],'fullname':_0x134337[_0xd3a6('0x2f')]};});}}catch(_0x1eb499){_0x4d322a(_0x1eb499);}_0xa4efd(_0x4c05a2);});}function getInteractionTags(_0x87b75a,_0x12cb03){return new BPromise(function(_0xe27818,_0x2dbc2b){try{if(_0x87b75a['TagIds']){_0x87b75a['Tags']=[];_0x87b75a[_0xd3a6('0x30')][_0xd3a6('0x31')](',')[_0xd3a6('0x32')](function(_0x59337c){_0x87b75a[_0xd3a6('0x33')][_0xd3a6('0x34')](_0x12cb03[_0x59337c]);});}delete _0x87b75a[_0xd3a6('0x30')];}catch(_0x1603d9){_0x2dbc2b(_0x1603d9);}_0xe27818(_0x87b75a);});}function updateWhatsappInteraction(_0x3ebd0d,_0x36b28a,_0x21c23f){return new BPromise(function(_0x10352a,_0x59428a){return getInteractionUsers(_0x3ebd0d,_0x21c23f)[_0xd3a6('0x29')](function(_0x41981c){return getInteractionTags(_0x41981c,_0x36b28a);})[_0xd3a6('0x29')](function(_0x1f3c48){return getStateInteraction(_0x1f3c48);})[_0xd3a6('0x29')](function(_0x1c161f){_0x10352a(_0x1c161f);})['catch'](function(_0x16a30a){_0x59428a(_0x16a30a);});});}function getStateInteraction(_0x5cc122){return new BPromise(function(_0x263615){_0x5cc122[_0xd3a6('0x35')]=0x0;_0x5cc122[_0xd3a6('0x36')]=0x0;_0x5cc122[_0xd3a6('0x37')]=0x0;_0x5cc122['unmanaged']=0x0;_0x5cc122['total']=0x0;if(!_0x5cc122[_0xd3a6('0x38')]&&!_0x5cc122[_0xd3a6('0x39')]){_0x5cc122[_0xd3a6('0x35')]+=0x1;}if(!_0x5cc122['closed']&&_0x5cc122[_0xd3a6('0x39')]){_0x5cc122[_0xd3a6('0x36')]+=0x1;if(_0x5cc122['waiting']){_0x5cc122[_0xd3a6('0x35')]-=0x1;}}if(_0x5cc122['closed']&&_0x5cc122[_0xd3a6('0x39')]){_0x5cc122[_0xd3a6('0x37')]+=0x1;if(_0x5cc122['talking']){_0x5cc122[_0xd3a6('0x36')]-=0x1;}}if(_0x5cc122['closed']&&!_0x5cc122[_0xd3a6('0x39')]){_0x5cc122[_0xd3a6('0x3a')]+=0x1;if(_0x5cc122['waiting']){_0x5cc122[_0xd3a6('0x35')]-=0x1;}}_0x5cc122[_0xd3a6('0x3b')]+=0x1;_0x263615(_0x5cc122);});}exports[_0xd3a6('0x3c')]=function(_0x1fc06e,_0x5e412f){var _0x17037c={},_0x324dbd={},_0x23537a={'count':0x0,'rows':[]};var _0xc8fe07=_[_0xd3a6('0x3d')](db['WhatsappInteraction'][_0xd3a6('0x3e')],function(_0x5bd74a){return{'name':_0x5bd74a[_0xd3a6('0x3f')],'type':_0x5bd74a[_0xd3a6('0x40')][_0xd3a6('0x41')]};});_0x324dbd['model']=_[_0xd3a6('0x3d')](_0xc8fe07,'name');_0x324dbd[_0xd3a6('0x42')]=_['keys'](_0x1fc06e[_0xd3a6('0x42')]);_0x324dbd[_0xd3a6('0x43')]=_[_0xd3a6('0x44')](_0x324dbd[_0xd3a6('0x45')],_0x324dbd[_0xd3a6('0x42')]);_0x17037c[_0xd3a6('0x46')]=_[_0xd3a6('0x44')](_0x324dbd['model'],qs[_0xd3a6('0x47')](_0x1fc06e[_0xd3a6('0x42')][_0xd3a6('0x47')]));_0x17037c[_0xd3a6('0x46')]=_0x17037c['attributes'][_0xd3a6('0x48')]?_0x17037c[_0xd3a6('0x46')]:_0x324dbd[_0xd3a6('0x45')];if(!_0x1fc06e[_0xd3a6('0x42')][_0xd3a6('0x49')](_0xd3a6('0x4a'))){_0x17037c[_0xd3a6('0x23')]=qs[_0xd3a6('0x23')](_0x1fc06e['query'][_0xd3a6('0x23')]);_0x17037c[_0xd3a6('0x21')]=qs[_0xd3a6('0x21')](_0x1fc06e[_0xd3a6('0x42')][_0xd3a6('0x21')]);}_0x17037c['order']=qs[_0xd3a6('0x4b')](_0x1fc06e[_0xd3a6('0x42')][_0xd3a6('0x4b')]);_0x17037c[_0xd3a6('0x4c')]=qs[_0xd3a6('0x43')](_[_0xd3a6('0x4d')](_0x1fc06e[_0xd3a6('0x42')],_0x324dbd[_0xd3a6('0x43')]),_0xc8fe07);var _0x4ac576=[];var _0x7828c2=squel['select']()[_0xd3a6('0x4e')]('id')[_0xd3a6('0x4e')]('name')[_0xd3a6('0x4e')](_0xd3a6('0x4f'))[_0xd3a6('0x50')](_0xd3a6('0x51'));var _0x1c48c3=squel[_0xd3a6('0x52')]()[_0xd3a6('0x4e')](_0xd3a6('0x53'))[_0xd3a6('0x4e')](_0xd3a6('0x54'))['field'](_0xd3a6('0x55'))[_0xd3a6('0x50')](_0xd3a6('0x56'),'ui')[_0xd3a6('0x57')](_0xd3a6('0x58'),'u',_0xd3a6('0x59'));var _0x44e26d=squel[_0xd3a6('0x52')]()[_0xd3a6('0x50')](_0xd3a6('0x5a'),'i')['left_join'](_0xd3a6('0x5b'),'c',_0xd3a6('0x5c'))[_0xd3a6('0x57')]('users','o',_0xd3a6('0x5d'))['left_join']('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')['left_join'](_0xd3a6('0x5e'),'me',_0xd3a6('0x5f'))[_0xd3a6('0x57')](_0xd3a6('0x60'),'it',_0xd3a6('0x61'))[_0xd3a6('0x57')](_0xd3a6('0x51'),'t',_0xd3a6('0x62'));var _0x347e71=squel[_0xd3a6('0x63')]();var _0x4c1c41=[];var _0x5e9f1d=squel[_0xd3a6('0x63')]();var _0x14f7b6;if(_0x1fc06e[_0xd3a6('0x42')][_0xd3a6('0x64')]){_0x14f7b6=as[_0xd3a6('0x65')](_0x1fc06e['query'][_0xd3a6('0x64')]);var _0x13e1e1=_0x14f7b6[_0xd3a6('0x66')];for(var _0x2950e8=0x0;_0x2950e8<_0x14f7b6['conditions']['length'];_0x2950e8++){var _0x3badf8=_0x14f7b6[_0xd3a6('0x67')][_0x2950e8];var _0x558689='i';var _0x381ebb=_[_0xd3a6('0x68')](_0xc8fe07,[_0xd3a6('0x2c'),_0x3badf8['field']]);if(!_0x381ebb){switch(_0x3badf8[_0xd3a6('0x4e')]){case _0xd3a6('0x69'):if(_0x3badf8['value']==0x1){_0x44e26d[_0xd3a6('0x6a')]('`'+_0x3badf8[_0xd3a6('0x4e')]+'`\x20=\x200');}else{_0x44e26d['having']('`'+_0x3badf8[_0xd3a6('0x4e')]+_0xd3a6('0x6b'));}break;case'Contact':if(_0x3badf8['operator']===_0xd3a6('0x6c')){if(_0x3badf8['value'][_0xd3a6('0x31')]('\x20')[_0xd3a6('0x48')]>0x1){_0x347e71[_0x13e1e1]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd3a6('0x6d')](_0x3badf8['value']),null);}else{var _0x59426d='%'+_0x3badf8[_0xd3a6('0x6e')]+'%';_0x347e71[_0x13e1e1]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x59426d,_0x59426d,_0x59426d);}}else{_0x381ebb=_[_0xd3a6('0x68')](_0xc8fe07,[_0xd3a6('0x2c'),_0xd3a6('0x6f')]);_0x3badf8[_0xd3a6('0x4e')]=_0xd3a6('0x6f');_0x37415f=as['buildExpression'](_0x558689,_0x381ebb[_0xd3a6('0x40')],_0x3badf8);_0x347e71[_0x13e1e1](_0x37415f[_0xd3a6('0x70')],_0x37415f[_0xd3a6('0x6e')][_0xd3a6('0x71')],_0x37415f['value'][_0xd3a6('0x20')]);}break;case _0xd3a6('0x72'):var _0x911ff0=_0x3badf8[_0xd3a6('0x6e')][_0xd3a6('0x31')](',')['map'](function(_0x49cc6e){return Number(_0x49cc6e);});_0x911ff0[_0xd3a6('0x32')](function(_0x49bec2){_0x5e9f1d['or'](_0xd3a6('0x73'),'%,'+_0x49bec2+',%');});_0x4c1c41=_[_0xd3a6('0x74')](_0x4c1c41,_0x911ff0);break;case _0xd3a6('0x75'):if(_0x3badf8[_0xd3a6('0x76')]===_0xd3a6('0x6c')){_0x347e71[_0x13e1e1]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3badf8['value']+'%',null);}else{_0x381ebb=_[_0xd3a6('0x68')](_0xc8fe07,['name','UserId']);_0x3badf8[_0xd3a6('0x4e')]=_0xd3a6('0x39');_0x37415f=as[_0xd3a6('0x77')](_0x558689,_0x381ebb[_0xd3a6('0x40')],_0x3badf8);_0x347e71[_0x13e1e1](_0x37415f[_0xd3a6('0x70')],_0x37415f[_0xd3a6('0x6e')]['start'],_0x37415f[_0xd3a6('0x6e')][_0xd3a6('0x20')]);}break;case _0xd3a6('0x78'):_0x37415f=as['buildExpression']('me',null,_0x3badf8);_0x347e71[_0x13e1e1](_0x37415f[_0xd3a6('0x70')],_0x37415f[_0xd3a6('0x6e')]['start'],_0x37415f[_0xd3a6('0x6e')]['end']);break;}}else{var _0x37415f=as[_0xd3a6('0x77')](_0x558689,_0x381ebb[_0xd3a6('0x40')],_0x3badf8);_0x347e71[_0x13e1e1](_0x37415f['text'],_0x37415f[_0xd3a6('0x6e')]['start'],_0x37415f[_0xd3a6('0x6e')][_0xd3a6('0x20')]);}}}else{var _0x3794cc=_(_0x1fc06e['query'])[_0xd3a6('0x79')]()[_0xd3a6('0x3d')](function(_0x532b07){return _[_0xd3a6('0x7a')](_0xc8fe07,[_0xd3a6('0x2c'),_0x532b07])?_0x532b07:undefined;})[_0xd3a6('0x7b')]()[_0xd3a6('0x6e')]();if(!_[_0xd3a6('0x7c')](_0x3794cc)){_0x3794cc[_0xd3a6('0x32')](function(_0x4a6449){if(_0x4a6449==='WhatsappAccountId'){_0x44e26d[_0xd3a6('0x4c')](_0xd3a6('0x7d'),[][_0xd3a6('0x7e')](_0x1fc06e[_0xd3a6('0x42')][_0x4a6449]));}else if(_0x4a6449==='createdAt'){var _0x20e775=JSON[_0xd3a6('0x7f')](_0x1fc06e[_0xd3a6('0x42')][_0x4a6449])[_0xd3a6('0x80')];var _0x5a04bf=JSON[_0xd3a6('0x7f')](_0x1fc06e['query'][_0x4a6449])[_0xd3a6('0x81')];_0x44e26d[_0xd3a6('0x4c')](_0xd3a6('0x82'),_0x20e775,_0x5a04bf);}else{if(_0x1fc06e[_0xd3a6('0x42')][_0x4a6449]===_0xd3a6('0x83')){_0x44e26d[_0xd3a6('0x4c')]('i.'+_0x4a6449+_0xd3a6('0x84'));}else{_0x44e26d[_0xd3a6('0x4c')]('i.'+_0x4a6449+_0xd3a6('0x85'),_0x1fc06e[_0xd3a6('0x42')][_0x4a6449]);}}});}if(_0x1fc06e[_0xd3a6('0x42')][_0xd3a6('0x86')]){if(_0x1fc06e['query'][_0xd3a6('0x86')]==0x1){_0x44e26d['having'](_0xd3a6('0x87'));}else{_0x44e26d[_0xd3a6('0x6a')](_0xd3a6('0x88'));}}if(_0x1fc06e['query'][_0xd3a6('0x89')]){_0x4c1c41=_[_0xd3a6('0x8a')](_0x1fc06e['query'][_0xd3a6('0x89')])?_0x1fc06e[_0xd3a6('0x42')][_0xd3a6('0x89')]:new Array(_0x1fc06e[_0xd3a6('0x42')][_0xd3a6('0x89')]);_0x4c1c41[_0xd3a6('0x32')](function(_0xb64ce4){_0x5e9f1d['or'](_0xd3a6('0x73'),'%,'+_0xb64ce4+',%');});}if(_0x1fc06e['query'][_0xd3a6('0x8b')]){var _0x38d297=_0x1fc06e[_0xd3a6('0x42')][_0xd3a6('0x8b')][_0xd3a6('0x8c')]('\x5c','\x5c\x5c')[_0xd3a6('0x8c')](/'/g,'\x27\x27');if(qs[_0xd3a6('0x8d')](_0x38d297)){_0x347e71['or'](_0xd3a6('0x8e'),_0x38d297+'%')['or'](_0xd3a6('0x8f'),_0x38d297+'%');}else{_0x347e71['or'](_0xd3a6('0x90'),qs[_0xd3a6('0x6d')](_0x38d297))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x38d297+'%');}}}_0x44e26d[_0xd3a6('0x4c')](_0x347e71);_0x44e26d['group'](_0xd3a6('0x91'));var _0x3d48e8={'type':db['Sequelize'][_0xd3a6('0x92')][_0xd3a6('0x93')],'raw':!![]};var _0x1d3d5e=_0x44e26d[_0xd3a6('0x94')]();_0x1d3d5e[_0xd3a6('0x4e')](_0xd3a6('0x91'));_0x1d3d5e[_0xd3a6('0x4e')](_0xd3a6('0x95'),_0xd3a6('0x69'));if(_0x17037c[_0xd3a6('0x96')]){_0x17037c[_0xd3a6('0x96')]['forEach'](function(_0x2b0706){var _0x263639=_0x2b0706[0x0]===_0xd3a6('0x97')?_0x2b0706[0x0]:'i.'+_0x2b0706[0x0];_0x44e26d[_0xd3a6('0x96')](_0x263639,_0x2b0706[0x1]===_0xd3a6('0x98')?![]:!![]);});}if(!_[_0xd3a6('0x7c')](_0x4c1c41)){_0x44e26d['having'](_0x5e9f1d);_0x1d3d5e[_0xd3a6('0x4c')](_0xd3a6('0x99'),_0x4c1c41);}BPromise['resolve']()[_0xd3a6('0x29')](function(){if(!_0x14f7b6){if(_0x1fc06e['query'][_0xd3a6('0x9a')])return;_0x1d3d5e[_0xd3a6('0x4c')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x44e26d[_0xd3a6('0x4c')](_0xd3a6('0x9b'));return;}if(_0x1fc06e[_0xd3a6('0x9c')][_0xd3a6('0x9d')]!=='agent')return;return _0x1fc06e['user'][_0xd3a6('0x9e')]({'attributes':['id'],'raw':!![]})[_0xd3a6('0x29')](function(_0x326894){if(_[_0xd3a6('0x7c')](_0x326894)){_0x1d3d5e[_0xd3a6('0x4c')]('i.WhatsappAccountId\x20IS\x20NULL');_0x44e26d[_0xd3a6('0x4c')](_0xd3a6('0x9f'));}else{_0x1d3d5e[_0xd3a6('0x4c')](_0xd3a6('0x7d'),_[_0xd3a6('0x3d')](_0x326894,'id'));_0x44e26d[_0xd3a6('0x4c')](_0xd3a6('0x7d'),_[_0xd3a6('0x3d')](_0x326894,'id'));}});})[_0xd3a6('0x29')](function(){if(_0x1fc06e[_0xd3a6('0x9c')][_0xd3a6('0x9d')]===_0xd3a6('0xa0')&&!_0x14f7b6&&!_0x1fc06e['query']['WhatsappAccountId'])return[];return db['sequelize'][_0xd3a6('0x42')](_0x1d3d5e[_0xd3a6('0xa1')](),_0x3d48e8);})['then'](function(_0x1f69f4){_0x23537a[_0xd3a6('0x24')]=_0x1f69f4[_0xd3a6('0x48')];if(_0x23537a['count']===0x0)return[];return db[_0xd3a6('0xa2')][_0xd3a6('0x42')](_0x7828c2[_0xd3a6('0xa1')](),_0x3d48e8)[_0xd3a6('0x29')](function(_0x580214){_0x4ac576=_['keyBy'](_0x580214,'id');_0x3d48e8=_[_0xd3a6('0xa3')](_0x3d48e8,{'model':db[_0xd3a6('0xa4')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1fc06e[_0xd3a6('0x42')]['fields']){_0x17037c['attributes'][_0xd3a6('0x32')](function(_0x3174f8){_0x44e26d[_0xd3a6('0x4e')]('i.'+_0x3174f8);});}else{_0x44e26d['field'](_0xd3a6('0x95'),_0xd3a6('0x69'));_0x44e26d['field'](_0xd3a6('0xa5'),'Account.key');_0x44e26d[_0xd3a6('0x4e')](_0xd3a6('0xa6'),_0xd3a6('0xa7'));_0x44e26d[_0xd3a6('0x4e')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x44e26d[_0xd3a6('0x4e')](_0xd3a6('0xa8'));_0x44e26d[_0xd3a6('0x4e')]('c.firstName','Contact.firstName');_0x44e26d[_0xd3a6('0x4e')]('c.lastName',_0xd3a6('0xa9'));_0x44e26d['field'](_0xd3a6('0xaa'),_0xd3a6('0xab'));_0x44e26d[_0xd3a6('0x4e')](_0xd3a6('0xac'),_0xd3a6('0xad'));_0x44e26d[_0xd3a6('0x4e')](_0xd3a6('0xae'),_0xd3a6('0xaf'));_0x44e26d[_0xd3a6('0x4e')]('c.fax','Contact.fax');_0x44e26d['field'](_0xd3a6('0xb0'),_0xd3a6('0xb1'));_0x44e26d[_0xd3a6('0x4e')](_0xd3a6('0xb2'),_0xd3a6('0xb3'));_0x44e26d[_0xd3a6('0x4e')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xd3a6('0x30'));}if(_0x17037c[_0xd3a6('0x23')])_0x44e26d['limit'](_0x17037c[_0xd3a6('0x23')]);if(_0x17037c[_0xd3a6('0x21')])_0x44e26d[_0xd3a6('0x21')](_0x17037c[_0xd3a6('0x21')]);return db[_0xd3a6('0xa2')][_0xd3a6('0x42')](_0x44e26d[_0xd3a6('0xa1')](),_0x3d48e8);})[_0xd3a6('0x29')](function(_0x1a820f){if(_0x1a820f[_0xd3a6('0x48')]>0x0)_0x1c48c3['where'](_0xd3a6('0xb4'),_['map'](_0x1a820f,'id'));return db[_0xd3a6('0xa2')]['query'](_0x1c48c3['toString'](),_0x3d48e8)[_0xd3a6('0x29')](function(_0x3bf97f){var _0x502076=_[_0xd3a6('0xb5')](_0x3bf97f,'WhatsappInteractionId');var _0x43ba24=[];_0x1a820f[_0xd3a6('0x32')](function(_0x379ff0){_0x43ba24[_0xd3a6('0x34')](updateWhatsappInteraction(_0x379ff0,_0x4ac576,_0x502076));});return BPromise['all'](_0x43ba24);});});})[_0xd3a6('0x29')](function(_0x459607){_0x23537a[_0xd3a6('0xb6')]=_0x459607;return _0x23537a;})[_0xd3a6('0x29')](respondWithFilteredResult(_0x5e412f,_0x17037c))[_0xd3a6('0xb7')](handleError(_0x5e412f,null));};exports['show']=function(_0x2981fd,_0x35fd6a){var _0x6478db={'raw':![],'where':{'id':_0x2981fd['params']['id']}},_0xaea243={};_0xaea243[_0xd3a6('0x45')]=_[_0xd3a6('0x79')](db[_0xd3a6('0xa4')][_0xd3a6('0x3e')]);_0xaea243[_0xd3a6('0x42')]=_[_0xd3a6('0x79')](_0x2981fd['query']);_0xaea243[_0xd3a6('0x43')]=_[_0xd3a6('0x44')](_0xaea243['model'],_0xaea243[_0xd3a6('0x42')]);_0x6478db['attributes']=_[_0xd3a6('0x44')](_0xaea243[_0xd3a6('0x45')],qs['fields'](_0x2981fd[_0xd3a6('0x42')][_0xd3a6('0x47')]));_0x6478db[_0xd3a6('0x46')]=_0x6478db[_0xd3a6('0x46')][_0xd3a6('0x48')]?_0x6478db[_0xd3a6('0x46')]:_0xaea243[_0xd3a6('0x45')];if(_0x2981fd['query'][_0xd3a6('0xb8')]){_0x6478db[_0xd3a6('0xb9')]=[{'all':!![]}];}_0x6478db=_[_0xd3a6('0xa3')]({},_0x6478db,_0x2981fd[_0xd3a6('0xba')]);return db[_0xd3a6('0xa4')][_0xd3a6('0x68')](_0x6478db)[_0xd3a6('0x29')](handleEntityNotFound(_0x35fd6a,null))['then'](respondWithResult(_0x35fd6a,null))[_0xd3a6('0xb7')](handleError(_0x35fd6a,null));};exports[_0xd3a6('0xbb')]=function(_0xb7dda3,_0x2433fc){return db[_0xd3a6('0xa4')]['create'](_0xb7dda3[_0xd3a6('0x78')],{})[_0xd3a6('0x29')](respondWithResult(_0x2433fc,0xc9))['catch'](handleError(_0x2433fc,null));};exports[_0xd3a6('0x28')]=function(_0x5cdea7,_0x630722){if(_0x5cdea7[_0xd3a6('0x78')]['id']){delete _0x5cdea7[_0xd3a6('0x78')]['id'];}return db[_0xd3a6('0xa4')][_0xd3a6('0x68')]({'where':{'id':_0x5cdea7[_0xd3a6('0xbc')]['id']}})['then'](handleEntityNotFound(_0x630722,null))[_0xd3a6('0x29')](saveUpdates(_0x5cdea7[_0xd3a6('0x78')],null))[_0xd3a6('0x29')](respondWithResult(_0x630722,null))[_0xd3a6('0xb7')](handleError(_0x630722,null));};exports[_0xd3a6('0x2a')]=function(_0x2f5718,_0x3e5678){return db[_0xd3a6('0xa4')][_0xd3a6('0x68')]({'where':{'id':_0x2f5718[_0xd3a6('0xbc')]['id']}})['then'](handleEntityNotFound(_0x3e5678,null))[_0xd3a6('0x29')](removeEntity(_0x3e5678,null))[_0xd3a6('0xb7')](handleError(_0x3e5678,null));};exports['describe']=function(_0x27f070,_0x24dfb8){return db['WhatsappInteraction'][_0xd3a6('0xbd')]()[_0xd3a6('0x29')](respondWithResult(_0x24dfb8,null))[_0xd3a6('0xb7')](handleError(_0x24dfb8,null));};exports[_0xd3a6('0xbe')]=function(_0x428820,_0x310199,_0x3cf371){return db['WhatsappMessage'][_0xd3a6('0x68')]({'where':{'id':_0x428820[_0xd3a6('0xbc')]['id']}})[_0xd3a6('0x29')](handleEntityNotFound(_0x310199,null))[_0xd3a6('0x29')](function(_0x3bd143){if(_0x3bd143){return _0x3bd143[_0xd3a6('0xbe')](_0x428820['body'][_0xd3a6('0xbf')],_[_0xd3a6('0xc0')](_0x428820[_0xd3a6('0x78')],['ids','id'])||{});}})[_0xd3a6('0x29')](respondWithResult(_0x310199,null))['catch'](handleError(_0x310199,null));};exports[_0xd3a6('0xc1')]=function(_0x17bbec,_0x4806b0,_0x26213b){var _0x3a12b8={'raw':![],'where':{}};var _0x19bdf3={};var _0x1ecb64={'count':0x0,'rows':[]};return db[_0xd3a6('0xa4')][_0xd3a6('0xc2')]({'where':{'id':_0x17bbec[_0xd3a6('0xbc')]['id']}})[_0xd3a6('0x29')](handleEntityNotFound(_0x4806b0,null))[_0xd3a6('0x29')](function(_0x1b2533){if(_0x1b2533){_0x19bdf3[_0xd3a6('0x45')]=_['keys'](db[_0xd3a6('0xc3')][_0xd3a6('0x3e')]);_0x19bdf3[_0xd3a6('0x42')]=_[_0xd3a6('0x79')](_0x17bbec['query']);_0x19bdf3[_0xd3a6('0x43')]=_[_0xd3a6('0x44')](_0x19bdf3[_0xd3a6('0x45')],_0x19bdf3[_0xd3a6('0x42')]);_0x3a12b8[_0xd3a6('0x46')]=_['intersection'](_0x19bdf3[_0xd3a6('0x45')],qs[_0xd3a6('0x47')](_0x17bbec[_0xd3a6('0x42')]['fields']));_0x3a12b8[_0xd3a6('0x46')]=_0x3a12b8[_0xd3a6('0x46')][_0xd3a6('0x48')]?_0x3a12b8[_0xd3a6('0x46')]:_0x19bdf3[_0xd3a6('0x45')];if(!_0x17bbec[_0xd3a6('0x42')][_0xd3a6('0x49')](_0xd3a6('0x4a'))){_0x3a12b8[_0xd3a6('0x23')]=qs[_0xd3a6('0x23')](_0x17bbec[_0xd3a6('0x42')][_0xd3a6('0x23')]);_0x3a12b8['offset']=qs['offset'](_0x17bbec[_0xd3a6('0x42')]['offset']);}_0x3a12b8[_0xd3a6('0x96')]=qs['sort'](_0x17bbec[_0xd3a6('0x42')][_0xd3a6('0x4b')]);_0x3a12b8[_0xd3a6('0x4c')]=qs[_0xd3a6('0x43')](_[_0xd3a6('0x4d')](_0x17bbec[_0xd3a6('0x42')],_0x19bdf3['filters']));_0x3a12b8['where']['WhatsappInteractionId']=_0x1b2533['id'];if(_0x17bbec[_0xd3a6('0x42')][_0xd3a6('0x8b')]){_0x3a12b8[_0xd3a6('0x4c')]=_[_0xd3a6('0xa3')](_0x3a12b8[_0xd3a6('0x4c')],{'$or':_[_0xd3a6('0x3d')](_0x3a12b8[_0xd3a6('0x46')],function(_0x1ce32c){var _0x2dc507={};_0x2dc507[_0x1ce32c]={'$like':'%'+_0x17bbec['query'][_0xd3a6('0x8b')]+'%'};return _0x2dc507;})});}if(_0x17bbec[_0xd3a6('0x42')][_0xd3a6('0x80')]){var _0x40d57a=_0x17bbec[_0xd3a6('0x42')][_0xd3a6('0x80')][_0xd3a6('0x31')](',');var _0x5693c5={};_0x5693c5[_0x40d57a[0x0]]={'$gte':moment(_0x40d57a[0x1])[_0xd3a6('0xc4')](_0xd3a6('0xc5'))};_0x3a12b8[_0xd3a6('0x4c')]=_[_0xd3a6('0xa3')](_0x3a12b8['where'],_0x5693c5);}_0x3a12b8=_['merge']({},_0x3a12b8,_0x17bbec[_0xd3a6('0xba')]);return db[_0xd3a6('0xc3')][_0xd3a6('0x24')]({'where':_0x3a12b8[_0xd3a6('0x4c')]})[_0xd3a6('0x29')](function(_0xf07683){_0x1ecb64[_0xd3a6('0x24')]=_0xf07683;if(_0x17bbec[_0xd3a6('0x42')][_0xd3a6('0xb8')]){_0x3a12b8['include']=[{'all':!![]}];}return db[_0xd3a6('0xc3')][_0xd3a6('0xc6')](_0x3a12b8);})['then'](function(_0x19473d){_0x1ecb64['rows']=_0x19473d;return _0x1ecb64;});}})['then'](respondWithFilteredResult(_0x4806b0,_0x3a12b8))['catch'](handleError(_0x4806b0,null));};exports[_0xd3a6('0xc7')]=function(_0xcf7765,_0x1051ef,_0x164ee1){return db[_0xd3a6('0xa4')]['find']({'where':{'id':_0xcf7765['params']['id']}})[_0xd3a6('0x29')](handleEntityNotFound(_0x1051ef,null))['then'](function(_0x7e4504){if(_0x7e4504){return _0x7e4504['setTags'](_0xcf7765[_0xd3a6('0x78')]['ids'],_[_0xd3a6('0xc0')](_0xcf7765[_0xd3a6('0x78')],[_0xd3a6('0xbf'),'id'])||{})[_0xd3a6('0xc8')](function(){return db['Tag'][_0xd3a6('0xc6')]({'attributes':['id',_0xd3a6('0x2c'),_0xd3a6('0x4f')],'where':{'id':_0xcf7765[_0xd3a6('0x78')][_0xd3a6('0xbf')]}});})[_0xd3a6('0x29')](function(_0x38468f){socket[_0xd3a6('0xc9')](_0xd3a6('0xca'),{'id':Number(_0xcf7765[_0xd3a6('0xbc')]['id']),'tags':_0x38468f||[]});return{'id':Number(_0xcf7765[_0xd3a6('0xbc')]['id']),'tags':_0x38468f||[]};});}})[_0xd3a6('0x29')](respondWithResult(_0x1051ef,null))['catch'](handleError(_0x1051ef,null));};exports['removeTags']=function(_0x504550,_0x4fbfb3,_0x57f437){return db[_0xd3a6('0xa4')][_0xd3a6('0x68')]({'where':{'id':_0x504550[_0xd3a6('0xbc')]['id']}})[_0xd3a6('0x29')](handleEntityNotFound(_0x4fbfb3,null))[_0xd3a6('0x29')](function(_0x44f1dd){if(_0x44f1dd){return _0x44f1dd[_0xd3a6('0xcb')](_0x504550[_0xd3a6('0x42')][_0xd3a6('0xbf')]);}})[_0xd3a6('0x29')](respondWithStatusCode(_0x4fbfb3,null))['catch'](handleError(_0x4fbfb3,null));};exports[_0xd3a6('0xcc')]=function(_0x1d4285,_0x56aef4){var _0xd1c5f4=moment()['unix']()['toString']();var _0xde2e9d=path[_0xd3a6('0xcd')](config[_0xd3a6('0xce')],'server',_0xd3a6('0xcf'),_0xd3a6('0xd0'));var _0x1d34da=path[_0xd3a6('0xcd')](config[_0xd3a6('0xce')],_0xd3a6('0xd1'),'files',_0xd3a6('0xd2'));var _0x489356=path['join'](_0xde2e9d,_0xd1c5f4);var _0x580573=util[_0xd3a6('0xc4')](_0xd3a6('0xd3'),_0x1d4285[_0xd3a6('0xbc')]['id'],_0xd1c5f4);var _0x58f867=path['join'](_0xde2e9d,_0x580573);var _0x2048bb=[];_0x2048bb[_0xd3a6('0x34')]({'model':db[_0xd3a6('0x75')],'as':'User','attributes':['id',_0xd3a6('0x2f')],'raw':!![]});_0x2048bb['push']({'model':db[_0xd3a6('0xd4')],'as':_0xd3a6('0xd5'),'attributes':['id',_0xd3a6('0xd6'),_0xd3a6('0xd7')],'raw':!![]});if(_0x1d4285[_0xd3a6('0x42')][_0xd3a6('0xd2')]){_0x2048bb['push']({'model':db['Attachment'],'as':_0xd3a6('0xd8'),'raw':!![]});}var _0x2d7f8b=[{'model':db[_0xd3a6('0xc3')],'as':'Messages','attributes':['id',_0xd3a6('0x78'),_0xd3a6('0xd9'),_0xd3a6('0xda'),'secret',_0xd3a6('0x86')],'include':_0x2048bb}];_0x2d7f8b['push']({'model':db[_0xd3a6('0xdb')],'as':'Account','attributes':['id',_0xd3a6('0x2c')]});_0x2d7f8b[_0xd3a6('0x34')]({'model':db[_0xd3a6('0x75')],'as':_0xd3a6('0xdc'),'attributes':['id','fullname']});return db[_0xd3a6('0xa4')][_0xd3a6('0x68')]({'where':{'id':_0x1d4285[_0xd3a6('0xbc')]['id']},'include':_0x2d7f8b})[_0xd3a6('0x29')](handleEntityNotFound(_0x56aef4,null))['then'](function(_0x51b7af){if(_0x51b7af){var _0x212d3c=_0x51b7af[_0xd3a6('0xdd')]({'plain':!![]});fs[_0xd3a6('0xde')](_0x489356);var _0x2b800e={'channel':_0xd3a6('0xdf'),'account':_0x212d3c[_0xd3a6('0xe0')][_0xd3a6('0x2c')],'agent':_0x212d3c[_0xd3a6('0xdc')]?_0x212d3c[_0xd3a6('0xdc')][_0xd3a6('0x2f')]:_0xd3a6('0xe1'),'createdAt':moment(_0x212d3c[_0xd3a6('0xd9')])[_0xd3a6('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x212d3c[_0xd3a6('0x38')]?moment(_0x212d3c[_0xd3a6('0xe2')])['format'](_0xd3a6('0xc5'))[_0xd3a6('0xa1')]():'','disposition':_0x212d3c[_0xd3a6('0xe3')],'messages':_(_0x212d3c[_0xd3a6('0xe4')])[_0xd3a6('0x8b')]({'secret':![]})['map'](function(_0x34529b){if(_0x34529b[_0xd3a6('0xd8')]){var _0x3ee82a=path['join'](_0x1d34da,_0x34529b[_0xd3a6('0xd8')]['basename']);if(fs[_0xd3a6('0xe5')](_0x3ee82a)){fs[_0xd3a6('0xe6')](_0x3ee82a)[_0xd3a6('0xe7')](fs[_0xd3a6('0xe8')](path['join'](_0x489356,_0x34529b[_0xd3a6('0xd8')][_0xd3a6('0xe9')])));}}return{'date':moment(_0x34529b['createdAt'])[_0xd3a6('0xc4')](_0xd3a6('0xc5'))[_0xd3a6('0xa1')](),'sender':_0x34529b[_0xd3a6('0xda')]==='out'?_0x34529b[_0xd3a6('0x75')]?_0x34529b[_0xd3a6('0x75')]['fullname']:'System':_0x34529b[_0xd3a6('0xd5')][_0xd3a6('0xd6')]+(_0x34529b[_0xd3a6('0xd5')]['lastName']?'\x20'+_0x34529b[_0xd3a6('0xd5')][_0xd3a6('0xd7')]:''),'body':_0x34529b[_0xd3a6('0xd8')]?_0x34529b[_0xd3a6('0xd8')]['basename']:_0x34529b[_0xd3a6('0x78')],'direction':_0x34529b[_0xd3a6('0xda')]===_0xd3a6('0xea')?'A':'C','secret':_0x34529b[_0xd3a6('0xeb')],'read':_0x34529b[_0xd3a6('0x86')],'attachment':_0x34529b['Attachment']};})[_0xd3a6('0x6e')]()};return ejs['renderFile'](path[_0xd3a6('0xcd')](config[_0xd3a6('0xce')],_0xd3a6('0xd1'),'views','downloadInteraction.ejs'),{'interaction':_0x2b800e})[_0xd3a6('0x29')](function(_0x4a0980){var _0x54cff9=path[_0xd3a6('0xcd')](_0x489356,'transcript-'+_0x212d3c['id']+'-'+_0xd1c5f4+_0xd3a6('0xec'));var _0x5051d={'path':_0x54cff9,'channel':_0xd3a6('0xdf'),'interactionId':_0x212d3c['id']};return pdf[_0xd3a6('0xed')](_0x4a0980,_0x5051d);})[_0xd3a6('0x29')](function(){return new BPromise(function(_0x5814fe,_0x33ffe0){zipdir(_0x489356,{'saveTo':_0x58f867},function(_0x16ba3f,_0x29bdae){if(_0x16ba3f)return _0x33ffe0(_0x16ba3f);return _0x5814fe(_0x29bdae);});})[_0xd3a6('0x29')](function(){return new BPromise(function(_0x73e834,_0x4ed4dc){rimraf(_0x489356,function(_0x4f4971){if(_0x4f4971)_0x4ed4dc(_0x4f4971);return _0x73e834();});});})[_0xd3a6('0x29')](function(){return _0x56aef4[_0xd3a6('0xcc')](_0x58f867,_0x580573,function(_0x9aa8cc){if(_0x9aa8cc){console[_0xd3a6('0xee')](_0xd3a6('0xef'),_0x9aa8cc);}else{fs[_0xd3a6('0xf0')](_0x58f867);}});});});}else{return _0x56aef4[_0xd3a6('0x2b')](0xc8);}})[_0xd3a6('0xb7')](handleError(_0x56aef4,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 3bb2c56..ece30ee 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 _0x93ed=['../../mysqldb','WhatsappInteraction','WhatsappMessage','save','remove','getUsers','then','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','events'];(function(_0x54f7c0,_0x27af83){var _0x245d03=function(_0x1ad6c4){while(--_0x1ad6c4){_0x54f7c0['push'](_0x54f7c0['shift']());}};_0x245d03(++_0x27af83);}(_0x93ed,0xfe));var _0xd93e=function(_0x46a3e8,_0x2e1b35){_0x46a3e8=_0x46a3e8-0x0;var _0xf1442e=_0x93ed[_0x46a3e8];return _0xf1442e;};'use strict';var EventEmitter=require(_0xd93e('0x0'));var WhatsappInteraction=require(_0xd93e('0x1'))['db'][_0xd93e('0x2')];var WhatsappMessage=require(_0xd93e('0x1'))['db'][_0xd93e('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd93e('0x4'),'afterUpdate':'update','afterDestroy':_0xd93e('0x5')};function emitEvent(_0x812267){return function(_0x5a4150,_0x462444,_0x3481fa){_0x5a4150[_0xd93e('0x6')]({'attributes':['id'],'raw':!![]})[_0xd93e('0x7')](function(_0xd74ab3){_0x5a4150['setDataValue']('Users',_0xd74ab3[_0xd93e('0x8')](function(_0x3b1527){return{'id':_0x3b1527['id']};}));return WhatsappMessage[_0xd93e('0x9')]({'where':{'WhatsappInteractionId':_0x5a4150['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd93e('0x7')](function(_0x561e6d){_0x5a4150['setDataValue'](_0xd93e('0xa'),_0x561e6d['length']);WhatsappInteractionEvents[_0xd93e('0xb')](_0x812267+':'+_0x5a4150['id'],_0x5a4150);WhatsappInteractionEvents[_0xd93e('0xb')](_0x812267,_0x5a4150);_0x3481fa(null);})[_0xd93e('0xc')](_0x3481fa(null));};}for(var e in events){if(events[_0xd93e('0xd')](e)){var event=events[e];WhatsappInteraction[_0xd93e('0xe')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x5088=['WhatsappInteraction','WhatsappMessage','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5088,0xa9));var _0x8508=function(_0x10dbab,_0x2e8174){_0x10dbab=_0x10dbab-0x0;var _0x408bfe=_0x5088[_0x10dbab];return _0x408bfe;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x8508('0x0'))['db'][_0x8508('0x1')];var WhatsappMessage=require(_0x8508('0x0'))['db'][_0x8508('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8508('0x3'),'afterUpdate':_0x8508('0x4'),'afterDestroy':_0x8508('0x5')};function emitEvent(_0x347c4c){return function(_0x4c54bb,_0x3e9abf,_0x52d892){_0x4c54bb[_0x8508('0x6')]({'attributes':['id'],'raw':!![]})[_0x8508('0x7')](function(_0x49dcdd){_0x4c54bb[_0x8508('0x8')](_0x8508('0x9'),_0x49dcdd['map'](function(_0x4f4e41){return{'id':_0x4f4e41['id']};}));return WhatsappMessage[_0x8508('0xa')]({'where':{'WhatsappInteractionId':_0x4c54bb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8508('0x7')](function(_0x1a48ae){_0x4c54bb[_0x8508('0x8')](_0x8508('0xb'),_0x1a48ae[_0x8508('0xc')]);WhatsappInteractionEvents[_0x8508('0xd')](_0x347c4c+':'+_0x4c54bb['id'],_0x4c54bb);WhatsappInteractionEvents[_0x8508('0xd')](_0x347c4c,_0x4c54bb);_0x52d892(null);})['catch'](_0x52d892(null));};}for(var e in events){if(events[_0x8508('0xe')](e)){var event=events[e];WhatsappInteraction[_0x8508('0xf')](e,emitEvent(event));}}module[_0x8508('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index b985dd6..d1bc7e5 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 _0xf960=['./whatsappInteraction.attributes','exports','define','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','path'];(function(_0x2726f3,_0x2dec60){var _0xc307d3=function(_0x5aeebd){while(--_0x5aeebd){_0x2726f3['push'](_0x2726f3['shift']());}};_0xc307d3(++_0x2dec60);}(_0xf960,0x193));var _0x0f96=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xf960[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x0f96('0x0'));var util=require('util');var logger=require(_0x0f96('0x1'))('api');var moment=require(_0x0f96('0x2'));var BPromise=require(_0x0f96('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f96('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0f96('0x5'));module[_0x0f96('0x6')]=function(_0x2811c3,_0x29ab2a){return _0x2811c3[_0x0f96('0x7')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c690a,_0x354642,_0x4408ed){if(_0x1c690a[_0x0f96('0x8')](_0x0f96('0x9'))){_0x1c690a[_0x0f96('0xa')]=moment()['format'](_0x0f96('0xb'));}_0x4408ed(null,_0x1c690a);}}});}; \ No newline at end of file +var _0x5483=['moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','closed','format','lodash','util','../../config/logger','api'];(function(_0x2efd1d,_0x44f696){var _0x1ef3f6=function(_0x25da5f){while(--_0x25da5f){_0x2efd1d['push'](_0x2efd1d['shift']());}};_0x1ef3f6(++_0x44f696);}(_0x5483,0x1d8));var _0x3548=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0x5483[_0x1044e5];return _0x5ad0dd;};'use strict';var _=require(_0x3548('0x0'));var util=require(_0x3548('0x1'));var logger=require(_0x3548('0x2'))(_0x3548('0x3'));var moment=require(_0x3548('0x4'));var BPromise=require(_0x3548('0x5'));var rp=require(_0x3548('0x6'));var fs=require('fs');var path=require(_0x3548('0x7'));var rimraf=require('rimraf');var config=require(_0x3548('0x8'));var attributes=require(_0x3548('0x9'));module[_0x3548('0xa')]=function(_0x1e63b6,_0x491d6c){return _0x1e63b6[_0x3548('0xb')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4879b3,_0x514590,_0x4bdf42){if(_0x4879b3['changed'](_0x3548('0xc'))){_0x4879b3['closedAt']=moment()[_0x3548('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4bdf42(null,_0x4879b3);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 6366755..1deaf4c 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 _0xc409=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','WhatsappInteraction','update','body','options','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x17d7df,_0x1fc4ec){var _0x16f32b=function(_0x27bf22){while(--_0x27bf22){_0x17d7df['push'](_0x17d7df['shift']());}};_0x16f32b(++_0x1fc4ec);}(_0xc409,0x1d1));var _0x9c40=function(_0x2d9e7b,_0x2dff95){_0x2d9e7b=_0x2d9e7b-0x0;var _0x4db7f0=_0xc409[_0x2d9e7b];return _0x4db7f0;};'use strict';var _=require(_0x9c40('0x0'));var util=require(_0x9c40('0x1'));var moment=require('moment');var BPromise=require(_0x9c40('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c40('0x3'));var db=require(_0x9c40('0x4'))['db'];var utils=require(_0x9c40('0x5'));var logger=require(_0x9c40('0x6'))(_0x9c40('0x7'));var config=require(_0x9c40('0x8'));var jayson=require(_0x9c40('0x9'));var client=jayson[_0x9c40('0xa')][_0x9c40('0xb')]({'port':0x232a});config[_0x9c40('0xc')]=_[_0x9c40('0xd')](config['redis'],{'host':_0x9c40('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c40('0xc')]));require(_0x9c40('0xf'))[_0x9c40('0x10')](socket);function respondWithRpcPromise(_0x29e6aa,_0x3b2183,_0x1f3cbb){return new BPromise(function(_0x55b447,_0x1247b3){return client[_0x9c40('0x11')](_0x29e6aa,_0x1f3cbb)[_0x9c40('0x12')](function(_0x29424f){logger[_0x9c40('0x13')](_0x9c40('0x14'),_0x3b2183,_0x9c40('0x15'));logger[_0x9c40('0x16')](_0x9c40('0x17'),_0x3b2183,_0x9c40('0x15'),JSON[_0x9c40('0x18')](_0x29424f));if(_0x29424f['error']){if(_0x29424f[_0x9c40('0x19')][_0x9c40('0x1a')]===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x3b2183,_0x29424f[_0x9c40('0x19')]['message']);return _0x1247b3(_0x29424f[_0x9c40('0x19')][_0x9c40('0x1b')]);}logger[_0x9c40('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0x3b2183,_0x29424f[_0x9c40('0x19')]['message']);return _0x55b447(_0x29424f['error'][_0x9c40('0x1b')]);}else{logger[_0x9c40('0x13')](_0x9c40('0x14'),_0x3b2183,_0x9c40('0x15'));_0x55b447(_0x29424f['result'][_0x9c40('0x1b')]);}})[_0x9c40('0x1c')](function(_0x462f40){logger[_0x9c40('0x19')](_0x9c40('0x14'),_0x3b2183,_0x462f40);_0x1247b3(_0x462f40);});});}exports['UpdateWhatsappInteraction']=function(_0x50948d){var _0x3e806d=this;return new Promise(function(_0x1f9b56,_0x21eb0b){return db[_0x9c40('0x1d')][_0x9c40('0x1e')](_0x50948d[_0x9c40('0x1f')],{'raw':_0x50948d[_0x9c40('0x20')]?_0x50948d[_0x9c40('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50948d[_0x9c40('0x20')]?_0x50948d[_0x9c40('0x20')][_0x9c40('0x21')]||null:null,'attributes':_0x50948d[_0x9c40('0x20')]?_0x50948d[_0x9c40('0x20')][_0x9c40('0x22')]||null:null,'limit':_0x50948d[_0x9c40('0x20')]?_0x50948d[_0x9c40('0x20')][_0x9c40('0x23')]||null:null})[_0x9c40('0x12')](function(_0x4f287a){logger['info'](_0x9c40('0x24'),_0x50948d);logger['debug'](_0x9c40('0x24'),_0x50948d,JSON[_0x9c40('0x18')](_0x4f287a));_0x1f9b56(_0x4f287a);})[_0x9c40('0x1c')](function(_0x3d2696){logger[_0x9c40('0x19')](_0x9c40('0x24'),_0x3d2696[_0x9c40('0x1b')],_0x50948d);_0x21eb0b(_0x3e806d[_0x9c40('0x19')](0x1f4,_0x3d2696[_0x9c40('0x1b')]));});});};exports[_0x9c40('0x25')]=function(_0x44a07a){return new Promise(function(_0x5de204,_0x5cc700){return db[_0x9c40('0x1d')]['find']({'where':_0x44a07a['options']?_0x44a07a['options']['where']||null:null})[_0x9c40('0x12')](function(_0x16cead){if(_0x16cead){return _0x16cead[_0x9c40('0x26')](_0x44a07a[_0x9c40('0x1f')][_0x9c40('0x27')],_[_0x9c40('0x28')](_0x44a07a[_0x9c40('0x1f')],[_0x9c40('0x27'),'id'])||{});}})[_0x9c40('0x29')](function(_0x516a83){logger[_0x9c40('0x13')](_0x9c40('0x2a'),_0x44a07a);logger[_0x9c40('0x16')]('AddTags',_0x44a07a,JSON[_0x9c40('0x18')](_0x516a83));_0x5de204(_0x516a83);})[_0x9c40('0x1c')](function(_0x448cdd){logger[_0x9c40('0x19')](_0x9c40('0x2a'),_0x448cdd[_0x9c40('0x1b')],_0x44a07a);_0x5cc700(_this[_0x9c40('0x19')](0x1f4,_0x448cdd[_0x9c40('0x1b')]));});});}; \ No newline at end of file +var _0xd980=['../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','request\x20sent','error','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','update','options','raw','where','debug','stringify','WhatsappInteraction','find','addTags','body','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x2e0eeb,_0x390445){var _0x51861f=function(_0x2cefef){while(--_0x2cefef){_0x2e0eeb['push'](_0x2e0eeb['shift']());}};_0x51861f(++_0x390445);}(_0xd980,0x13a));var _0x0d98=function(_0x5e01ee,_0x1622e5){_0x5e01ee=_0x5e01ee-0x0;var _0x5ba4c3=_0xd980[_0x5e01ee];return _0x5ba4c3;};'use strict';var _=require(_0x0d98('0x0'));var util=require(_0x0d98('0x1'));var moment=require(_0x0d98('0x2'));var BPromise=require(_0x0d98('0x3'));var rs=require(_0x0d98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0d98('0x5'));var logger=require(_0x0d98('0x6'))(_0x0d98('0x7'));var config=require('../../config/environment');var jayson=require(_0x0d98('0x8'));var client=jayson[_0x0d98('0x9')][_0x0d98('0xa')]({'port':0x232a});config[_0x0d98('0xb')]=_['defaults'](config['redis'],{'host':_0x0d98('0xc'),'port':0x18eb});var socket=require(_0x0d98('0xd'))(new Redis(config[_0x0d98('0xb')]));require(_0x0d98('0xe'))[_0x0d98('0xf')](socket);function respondWithRpcPromise(_0x55d6fe,_0x4c8b50,_0x27f99b){return new BPromise(function(_0x1dd8d2,_0xd184b3){return client[_0x0d98('0x10')](_0x55d6fe,_0x27f99b)[_0x0d98('0x11')](function(_0x44cacb){logger[_0x0d98('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x4c8b50,_0x0d98('0x13'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x4c8b50,'request\x20sent',JSON['stringify'](_0x44cacb));if(_0x44cacb[_0x0d98('0x14')]){if(_0x44cacb[_0x0d98('0x14')]['code']===0x1f4){logger['error'](_0x0d98('0x15'),_0x4c8b50,_0x44cacb['error'][_0x0d98('0x16')]);return _0xd184b3(_0x44cacb[_0x0d98('0x14')]['message']);}logger[_0x0d98('0x14')](_0x0d98('0x15'),_0x4c8b50,_0x44cacb['error'][_0x0d98('0x16')]);return _0x1dd8d2(_0x44cacb[_0x0d98('0x14')][_0x0d98('0x16')]);}else{logger['info'](_0x0d98('0x15'),_0x4c8b50,_0x0d98('0x13'));_0x1dd8d2(_0x44cacb[_0x0d98('0x17')]['message']);}})[_0x0d98('0x18')](function(_0x2ff1b3){logger[_0x0d98('0x14')](_0x0d98('0x15'),_0x4c8b50,_0x2ff1b3);_0xd184b3(_0x2ff1b3);});});}exports[_0x0d98('0x19')]=function(_0x2bc9f8){var _0x2bf4d0=this;return new Promise(function(_0x819eee,_0x4a7062){return db['WhatsappInteraction'][_0x0d98('0x1a')](_0x2bc9f8['body'],{'raw':_0x2bc9f8[_0x0d98('0x1b')]?_0x2bc9f8['options'][_0x0d98('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bc9f8[_0x0d98('0x1b')]?_0x2bc9f8[_0x0d98('0x1b')][_0x0d98('0x1d')]||null:null,'attributes':_0x2bc9f8[_0x0d98('0x1b')]?_0x2bc9f8[_0x0d98('0x1b')]['attributes']||null:null,'limit':_0x2bc9f8[_0x0d98('0x1b')]?_0x2bc9f8[_0x0d98('0x1b')]['limit']||null:null})[_0x0d98('0x11')](function(_0x1899a6){logger[_0x0d98('0x12')](_0x0d98('0x19'),_0x2bc9f8);logger[_0x0d98('0x1e')](_0x0d98('0x19'),_0x2bc9f8,JSON[_0x0d98('0x1f')](_0x1899a6));_0x819eee(_0x1899a6);})['catch'](function(_0x269d54){logger[_0x0d98('0x14')]('UpdateWhatsappInteraction',_0x269d54[_0x0d98('0x16')],_0x2bc9f8);_0x4a7062(_0x2bf4d0['error'](0x1f4,_0x269d54[_0x0d98('0x16')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x4db4ea){return new Promise(function(_0x13c12a,_0x399e69){return db[_0x0d98('0x20')][_0x0d98('0x21')]({'where':_0x4db4ea[_0x0d98('0x1b')]?_0x4db4ea['options'][_0x0d98('0x1d')]||null:null})[_0x0d98('0x11')](function(_0x5506a5){if(_0x5506a5){return _0x5506a5[_0x0d98('0x22')](_0x4db4ea[_0x0d98('0x23')]['ids'],_[_0x0d98('0x24')](_0x4db4ea[_0x0d98('0x23')],[_0x0d98('0x25'),'id'])||{});}})[_0x0d98('0x26')](function(_0x4ce30a){logger['info'](_0x0d98('0x27'),_0x4db4ea);logger['debug'](_0x0d98('0x27'),_0x4db4ea,JSON[_0x0d98('0x1f')](_0x4ce30a));_0x13c12a(_0x4ce30a);})[_0x0d98('0x18')](function(_0x40711d){logger[_0x0d98('0x14')](_0x0d98('0x27'),_0x40711d['message'],_0x4db4ea);_0x399e69(_this[_0x0d98('0x14')](0x1f4,_0x40711d[_0x0d98('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index ac4745b..ae00fee 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 _0xf49a=['update','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x8d695e,_0x394999){var _0x3d156e=function(_0x38cf6f){while(--_0x38cf6f){_0x8d695e['push'](_0x8d695e['shift']());}};_0x3d156e(++_0x394999);}(_0xf49a,0x66));var _0xaf49=function(_0x1a39f3,_0x4d06ce){_0x1a39f3=_0x1a39f3-0x0;var _0x4cf744=_0xf49a[_0x1a39f3];return _0x4cf744;};'use strict';var WhatsappInteractionEvents=require(_0xaf49('0x0'));var events=[_0xaf49('0x1'),'remove',_0xaf49('0x2')];function createListener(_0x29cb04,_0x37d104){return function(_0x2cfe88){_0x37d104[_0xaf49('0x3')](_0x29cb04,_0x2cfe88);};}function removeListener(_0x1e7fb0,_0x32b1e5){return function(){WhatsappInteractionEvents[_0xaf49('0x4')](_0x1e7fb0,_0x32b1e5);};}exports[_0xaf49('0x5')]=function(_0xe8f8bd){for(var _0x2b0d02=0x0,_0x26d358=events[_0xaf49('0x6')];_0x2b0d02<_0x26d358;_0x2b0d02++){var _0x58692b=events[_0x2b0d02];var _0x50da96=createListener(_0xaf49('0x7')+_0x58692b,_0xe8f8bd);WhatsappInteractionEvents['on'](_0x58692b,_0x50da96);}}; \ No newline at end of file +var _0x1c31=['length','whatsappInteraction:','./whatsappInteraction.events','save','update','emit','register'];(function(_0x442659,_0x15c724){var _0x1e5ef8=function(_0x31f93e){while(--_0x31f93e){_0x442659['push'](_0x442659['shift']());}};_0x1e5ef8(++_0x15c724);}(_0x1c31,0xf0));var _0x11c3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1c31[_0x17d9e3];return _0x14192d;};'use strict';var WhatsappInteractionEvents=require(_0x11c3('0x0'));var events=[_0x11c3('0x1'),'remove',_0x11c3('0x2')];function createListener(_0x5b9f8d,_0x334b91){return function(_0x1c5c1d){_0x334b91[_0x11c3('0x3')](_0x5b9f8d,_0x1c5c1d);};}function removeListener(_0x2bf2a5,_0x2f8f0c){return function(){WhatsappInteractionEvents['removeListener'](_0x2bf2a5,_0x2f8f0c);};}exports[_0x11c3('0x4')]=function(_0x4d4b57){for(var _0x3d6a60=0x0,_0x121a27=events[_0x11c3('0x5')];_0x3d6a60<_0x121a27;_0x3d6a60++){var _0x355107=events[_0x3d6a60];var _0x492bf8=createListener(_0x11c3('0x6')+_0x355107,_0x4d4b57);WhatsappInteractionEvents['on'](_0x355107,_0x492bf8);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 4dbaabd..8f4088e 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 _0x42e4=['Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp','create','status','put','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1b3af1,_0x2aec36){var _0x4a8217=function(_0x21da29){while(--_0x21da29){_0x1b3af1['push'](_0x1b3af1['shift']());}};_0x4a8217(++_0x2aec36);}(_0x42e4,0x97));var _0x442e=function(_0x52b5f2,_0x26cebe){_0x52b5f2=_0x52b5f2-0x0;var _0x66cd80=_0x42e4[_0x52b5f2];return _0x66cd80;};'use strict';var multer=require(_0x442e('0x0'));var util=require(_0x442e('0x1'));var path=require(_0x442e('0x2'));var timeout=require(_0x442e('0x3'));var express=require(_0x442e('0x4'));var router=express[_0x442e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x442e('0x6'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0x442e('0x7')]('/',auth[_0x442e('0x8')](),controller[_0x442e('0x9')]);router[_0x442e('0x7')](_0x442e('0xa'),auth[_0x442e('0x8')](),controller[_0x442e('0xb')]);router[_0x442e('0x7')](_0x442e('0xc'),auth[_0x442e('0x8')](),controller[_0x442e('0xd')]);router[_0x442e('0xe')]('/',auth[_0x442e('0x8')](),interaction[_0x442e('0xf')](_0x442e('0x10'),'whatsappmessage:create'),controller[_0x442e('0x11')]);router[_0x442e('0xe')]('/:id/status',controller[_0x442e('0x12')]);router[_0x442e('0x13')](_0x442e('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x442e('0x13')]('/:id/accept',auth[_0x442e('0x8')](),controller[_0x442e('0x14')]);router[_0x442e('0x13')](_0x442e('0x15'),auth['isAuthenticated'](),controller[_0x442e('0x16')]);router[_0x442e('0x17')](_0x442e('0xc'),auth['isAuthenticated'](),controller[_0x442e('0x18')]);module[_0x442e('0x19')]=router; \ No newline at end of file +var _0x1791=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','whatsappmessage:create','create','/:id/status','status','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x34faf8,_0x2102f8){var _0x39d88b=function(_0x2ec51d){while(--_0x2ec51d){_0x34faf8['push'](_0x34faf8['shift']());}};_0x39d88b(++_0x2102f8);}(_0x1791,0x111));var _0x1179=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x1791[_0x2c0be1];return _0x3d4bd2;};'use strict';var multer=require(_0x1179('0x0'));var util=require(_0x1179('0x1'));var path=require(_0x1179('0x2'));var timeout=require(_0x1179('0x3'));var express=require(_0x1179('0x4'));var router=express[_0x1179('0x5')]();var fs_extra=require(_0x1179('0x6'));var auth=require(_0x1179('0x7'));var interaction=require(_0x1179('0x8'));var config=require(_0x1179('0x9'));var controller=require(_0x1179('0xa'));router['get']('/',auth[_0x1179('0xb')](),controller[_0x1179('0xc')]);router[_0x1179('0xd')](_0x1179('0xe'),auth[_0x1179('0xb')](),controller[_0x1179('0xf')]);router[_0x1179('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x1179('0x10')]);router[_0x1179('0x11')]('/',auth[_0x1179('0xb')](),interaction['tracked']('whatsapp',_0x1179('0x12')),controller[_0x1179('0x13')]);router[_0x1179('0x11')](_0x1179('0x14'),controller[_0x1179('0x15')]);router[_0x1179('0x16')](_0x1179('0x17'),auth['isAuthenticated'](),controller['update']);router[_0x1179('0x16')](_0x1179('0x18'),auth[_0x1179('0xb')](),controller[_0x1179('0x19')]);router[_0x1179('0x16')](_0x1179('0x1a'),auth[_0x1179('0xb')](),controller[_0x1179('0x1b')]);router[_0x1179('0x1c')](_0x1179('0x17'),auth[_0x1179('0xb')](),controller[_0x1179('0x1d')]);module[_0x1179('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 2cab9b1..c6aa6d0 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 _0xb4fd=['TEXT','BOOLEAN','ENUM','STRING'];(function(_0x411af1,_0x68fc9e){var _0x37fdfe=function(_0x37afd2){while(--_0x37afd2){_0x411af1['push'](_0x411af1['shift']());}};_0x37fdfe(++_0x68fc9e);}(_0xb4fd,0x130));var _0xdb4f=function(_0x28d78d,_0x2893f7){_0x28d78d=_0x28d78d-0x0;var _0x1cb1a6=_0xb4fd[_0x28d78d];return _0x1cb1a6;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xdb4f('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xdb4f('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdb4f('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xdb4f('0x3')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xdb4f('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xdb4f('0x3')]},'providerResponse':{'type':Sequelize[_0xdb4f('0x0')]}}; \ No newline at end of file +var _0xcf70=['BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x14ae15,_0x41f6d7){var _0x475828=function(_0x34ec76){while(--_0x34ec76){_0x14ae15['push'](_0x14ae15['shift']());}};_0x475828(++_0x41f6d7);}(_0xcf70,0x94));var _0x0cf7=function(_0x480400,_0xe7c026){_0x480400=_0x480400-0x0;var _0x5b986e=_0xcf70[_0x480400];return _0x5b986e;};'use strict';var Sequelize=require(_0x0cf7('0x0'));module[_0x0cf7('0x1')]={'body':{'type':Sequelize[_0x0cf7('0x2')](_0x0cf7('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0cf7('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0cf7('0x5')]('in',_0x0cf7('0x6')),'defaultValue':_0x0cf7('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0cf7('0x7')](0xbe)},'phone':{'type':Sequelize[_0x0cf7('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x0cf7('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x0cf7('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index cb45d5c..188c842 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 _0x5a64=['info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','catch','create','body','find','whatsapp-interactions','accept','whatsapp','format','UserId','user','WhatsappInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','Sequelize','email','event','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageStatus','read','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','request','then'];(function(_0xf7e530,_0x5d21ad){var _0x347b84=function(_0x222392){while(--_0x222392){_0xf7e530['push'](_0xf7e530['shift']());}};_0x347b84(++_0x5d21ad);}(_0x5a64,0xee));var _0x45a6=function(_0x3a104a,_0x3fb3e7){_0x3a104a=_0x3a104a-0x0;var _0x35a6d1=_0x5a64[_0x3a104a];return _0x35a6d1;};'use strict';var emlformat=require(_0x45a6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x45a6('0x1'));var rp=require('request-promise');var moment=require(_0x45a6('0x2'));var BPromise=require(_0x45a6('0x3'));var Mustache=require(_0x45a6('0x4'));var util=require(_0x45a6('0x5'));var path=require(_0x45a6('0x6'));var sox=require(_0x45a6('0x7'));var csv=require(_0x45a6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x45a6('0x9'));var _=require('lodash');var squel=require(_0x45a6('0xa'));var crypto=require('crypto');var jsforce=require(_0x45a6('0xb'));var deskjs=require(_0x45a6('0xc'));var toCsv=require(_0x45a6('0x8'));var querystring=require(_0x45a6('0xd'));var Papa=require(_0x45a6('0xe'));var Redis=require(_0x45a6('0xf'));var authService=require(_0x45a6('0x10'));var qs=require(_0x45a6('0x11'));var as=require(_0x45a6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x45a6('0x13'))('api');var utils=require(_0x45a6('0x14'));var config=require(_0x45a6('0x15'));var licenseUtil=require(_0x45a6('0x16'));var db=require(_0x45a6('0x17'))['db'];config[_0x45a6('0x18')]=_['defaults'](config[_0x45a6('0x18')],{'host':_0x45a6('0x19'),'port':0x18eb});var socket=require(_0x45a6('0x1a'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x45a6('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x45a6('0x1c')][_0x45a6('0x1d')]({'port':0x232c});var client9002=jayson[_0x45a6('0x1c')][_0x45a6('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xf6195a,_0x3656b6,_0x5da15f,_0x4382f3){return new BPromise(function(_0x393596,_0x1b04b1){var _0x33907b=_0x4382f3||client;return _0x33907b[_0x45a6('0x1e')](_0xf6195a,_0x5da15f)[_0x45a6('0x1f')](function(_0x7de366){logger[_0x45a6('0x20')](_0x45a6('0x21'),_0x3656b6,_0x45a6('0x22'));logger['debug'](_0x45a6('0x23'),_0x3656b6,_0x45a6('0x22'),JSON[_0x45a6('0x24')](_0x7de366));if(_0x7de366[_0x45a6('0x25')]){if(_0x7de366[_0x45a6('0x25')][_0x45a6('0x26')]===0x1f4){logger[_0x45a6('0x25')](_0x45a6('0x21'),_0x3656b6,_0x7de366[_0x45a6('0x25')][_0x45a6('0x27')]);return _0x1b04b1(_0x7de366[_0x45a6('0x25')][_0x45a6('0x27')]);}logger[_0x45a6('0x25')](_0x45a6('0x21'),_0x3656b6,_0x7de366[_0x45a6('0x25')]['message']);return _0x393596(_0x7de366[_0x45a6('0x25')][_0x45a6('0x27')]);}else{logger[_0x45a6('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x3656b6,_0x45a6('0x22'));_0x393596(_0x7de366[_0x45a6('0x28')][_0x45a6('0x27')]);}})['catch'](function(_0x588a45){logger['error'](_0x45a6('0x21'),_0x3656b6,_0x588a45);_0x1b04b1(_0x588a45);});});}function respondWithStatusCode(_0x23f2ea,_0x944ce9){_0x944ce9=_0x944ce9||0xcc;return function(_0x1e99ca){if(_0x1e99ca){return _0x23f2ea[_0x45a6('0x29')](_0x944ce9);}return _0x23f2ea[_0x45a6('0x2a')](_0x944ce9)[_0x45a6('0x2b')]();};}function respondWithResult(_0x440149,_0x42a010){_0x42a010=_0x42a010||0xc8;return function(_0x1717f3){if(_0x1717f3){return _0x440149['status'](_0x42a010)[_0x45a6('0x2c')](_0x1717f3);}};}function respondWithFilteredResult(_0x10d55e,_0x43a18b){return function(_0x537fb9){if(_0x537fb9){var _0x5598f5=typeof _0x43a18b[_0x45a6('0x2d')]===_0x45a6('0x2e')&&typeof _0x43a18b[_0x45a6('0x2f')]==='undefined';var _0x192e1d=_0x537fb9['count'];var _0x2a0b0d=_0x5598f5?0x0:_0x43a18b[_0x45a6('0x2d')];var _0x234b1e=_0x5598f5?_0x537fb9[_0x45a6('0x30')]:_0x43a18b[_0x45a6('0x2d')]+_0x43a18b[_0x45a6('0x2f')];var _0x17ae28;if(_0x234b1e>=_0x192e1d){_0x234b1e=_0x192e1d;_0x17ae28=0xc8;}else{_0x17ae28=0xce;}_0x10d55e[_0x45a6('0x2a')](_0x17ae28);return _0x10d55e[_0x45a6('0x31')](_0x45a6('0x32'),_0x2a0b0d+'-'+_0x234b1e+'/'+_0x192e1d)[_0x45a6('0x2c')](_0x537fb9);}return null;};}function patchUpdates(_0x4c4325){return function(_0x43452a){try{jsonpatch[_0x45a6('0x33')](_0x43452a,_0x4c4325,!![]);}catch(_0x1f3171){return BPromise['reject'](_0x1f3171);}return _0x43452a[_0x45a6('0x34')]();};}function saveUpdates(_0x292a93,_0x2e8c2a){return function(_0x50db94){if(_0x50db94){return _0x50db94[_0x45a6('0x35')](_0x292a93)[_0x45a6('0x1f')](function(_0x4ccee1){return _0x4ccee1;});}return null;};}function removeEntity(_0x260d97,_0x2a74ec){return function(_0x1ac1a6){if(_0x1ac1a6){return _0x1ac1a6['destroy']()['then'](function(){_0x260d97[_0x45a6('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35c141,_0x1b7c4f){return function(_0x57bab2){if(!_0x57bab2){_0x35c141[_0x45a6('0x29')](0x194);}return _0x57bab2;};}function handleError(_0x45e54c,_0x246996){_0x246996=_0x246996||0x1f4;return function(_0x19dc87){logger[_0x45a6('0x25')](_0x19dc87[_0x45a6('0x36')]);if(_0x19dc87[_0x45a6('0x37')]){delete _0x19dc87[_0x45a6('0x37')];}_0x45e54c['status'](_0x246996)[_0x45a6('0x38')](_0x19dc87);};}exports['index']=function(_0x35fa9d,_0x4b7606){var _0x3d9efd={},_0x3b3883={},_0x24bafc={'count':0x0,'rows':[]};var _0x1f91a8=_[_0x45a6('0x39')](db[_0x45a6('0x3a')][_0x45a6('0x3b')],function(_0x336cda){return{'name':_0x336cda[_0x45a6('0x3c')],'type':_0x336cda[_0x45a6('0x3d')]['key']};});_0x3b3883[_0x45a6('0x3e')]=_[_0x45a6('0x39')](_0x1f91a8,'name');_0x3b3883[_0x45a6('0x3f')]=_[_0x45a6('0x40')](_0x35fa9d['query']);_0x3b3883[_0x45a6('0x41')]=_[_0x45a6('0x42')](_0x3b3883['model'],_0x3b3883[_0x45a6('0x3f')]);_0x3d9efd[_0x45a6('0x43')]=_[_0x45a6('0x42')](_0x3b3883[_0x45a6('0x3e')],qs[_0x45a6('0x44')](_0x35fa9d[_0x45a6('0x3f')][_0x45a6('0x44')]));_0x3d9efd['attributes']=_0x3d9efd[_0x45a6('0x43')]['length']?_0x3d9efd[_0x45a6('0x43')]:_0x3b3883['model'];if(!_0x35fa9d['query'][_0x45a6('0x45')](_0x45a6('0x46'))){_0x3d9efd['limit']=qs[_0x45a6('0x2f')](_0x35fa9d[_0x45a6('0x3f')]['limit']);_0x3d9efd[_0x45a6('0x2d')]=qs[_0x45a6('0x2d')](_0x35fa9d['query'][_0x45a6('0x2d')]);}_0x3d9efd[_0x45a6('0x47')]=qs[_0x45a6('0x48')](_0x35fa9d['query'][_0x45a6('0x48')]);_0x3d9efd[_0x45a6('0x49')]=qs[_0x45a6('0x41')](_['pick'](_0x35fa9d[_0x45a6('0x3f')],_0x3b3883['filters']),_0x1f91a8);if(_0x35fa9d[_0x45a6('0x3f')][_0x45a6('0x4a')]){_0x3d9efd[_0x45a6('0x49')]=_[_0x45a6('0x4b')](_0x3d9efd[_0x45a6('0x49')],{'$or':_['map'](_0x1f91a8,function(_0x56f43a){if(_0x56f43a['type']!==_0x45a6('0x4c')){var _0x2f4700={};_0x2f4700[_0x56f43a['name']]={'$like':'%'+_0x35fa9d['query']['filter']+'%'};return _0x2f4700;}})});}_0x3d9efd=_[_0x45a6('0x4b')]({},_0x3d9efd,_0x35fa9d[_0x45a6('0x4d')]);var _0x5ed378={'where':_0x3d9efd['where']};return db[_0x45a6('0x3a')]['count'](_0x5ed378)[_0x45a6('0x1f')](function(_0x3afedc){_0x24bafc[_0x45a6('0x30')]=_0x3afedc;if(_0x35fa9d[_0x45a6('0x3f')][_0x45a6('0x4e')]){_0x3d9efd[_0x45a6('0x4f')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x45a6('0x50')](_0x3d9efd);})[_0x45a6('0x1f')](function(_0x547568){_0x24bafc[_0x45a6('0x51')]=_0x547568;return _0x24bafc;})[_0x45a6('0x1f')](respondWithFilteredResult(_0x4b7606,_0x3d9efd))['catch'](handleError(_0x4b7606,null));};exports['show']=function(_0x40b825,_0x1ade33){var _0x1c25cf={'raw':!![],'where':{'id':_0x40b825[_0x45a6('0x52')]['id']}},_0x21ee48={};_0x21ee48[_0x45a6('0x3e')]=_[_0x45a6('0x40')](db[_0x45a6('0x3a')][_0x45a6('0x3b')]);_0x21ee48['query']=_[_0x45a6('0x40')](_0x40b825[_0x45a6('0x3f')]);_0x21ee48['filters']=_['intersection'](_0x21ee48['model'],_0x21ee48['query']);_0x1c25cf[_0x45a6('0x43')]=_[_0x45a6('0x42')](_0x21ee48[_0x45a6('0x3e')],qs['fields'](_0x40b825[_0x45a6('0x3f')][_0x45a6('0x44')]));_0x1c25cf[_0x45a6('0x43')]=_0x1c25cf['attributes'][_0x45a6('0x53')]?_0x1c25cf['attributes']:_0x21ee48['model'];if(_0x40b825[_0x45a6('0x3f')]['includeAll']){_0x1c25cf[_0x45a6('0x4f')]=[{'all':!![]}];}_0x1c25cf=_[_0x45a6('0x4b')]({},_0x1c25cf,_0x40b825[_0x45a6('0x4d')]);return db[_0x45a6('0x3a')]['find'](_0x1c25cf)[_0x45a6('0x1f')](handleEntityNotFound(_0x1ade33,null))[_0x45a6('0x1f')](respondWithResult(_0x1ade33,null))[_0x45a6('0x54')](handleError(_0x1ade33,null));};exports['create']=function(_0x3ca060,_0x363d07){return db[_0x45a6('0x3a')][_0x45a6('0x55')](_0x3ca060['body'],{})[_0x45a6('0x1f')](respondWithResult(_0x363d07,0xc9))['catch'](handleError(_0x363d07,null));};exports['update']=function(_0x328cef,_0x1fac85){if(_0x328cef[_0x45a6('0x56')]['id']){delete _0x328cef[_0x45a6('0x56')]['id'];}return db[_0x45a6('0x3a')][_0x45a6('0x57')]({'where':{'id':_0x328cef[_0x45a6('0x52')]['id']}})[_0x45a6('0x1f')](handleEntityNotFound(_0x1fac85,null))[_0x45a6('0x1f')](saveUpdates(_0x328cef[_0x45a6('0x56')],null))['then'](respondWithResult(_0x1fac85,null))[_0x45a6('0x54')](handleError(_0x1fac85,null));};exports['destroy']=function(_0x291cb2,_0x16ac38){return db['WhatsappMessage'][_0x45a6('0x57')]({'where':{'id':_0x291cb2[_0x45a6('0x52')]['id']}})['then'](handleEntityNotFound(_0x16ac38,null))[_0x45a6('0x1f')](removeEntity(_0x16ac38,null))[_0x45a6('0x54')](handleError(_0x16ac38,null));};exports['describe']=function(_0x4c1bb3,_0x44a03a){return db[_0x45a6('0x3a')]['describe']()[_0x45a6('0x1f')](respondWithResult(_0x44a03a,null))[_0x45a6('0x54')](handleError(_0x44a03a,null));};var interaction_log=require(_0x45a6('0x13'))(_0x45a6('0x58'));exports[_0x45a6('0x59')]=function(_0x34022a,_0x67a50b,_0xe0d714){var _0x498640={'agent':{},'channel':_0x45a6('0x5a')};if(_0x34022a[_0x45a6('0x56')]['id']){delete _0x34022a['body']['id'];}_0x34022a[_0x45a6('0x56')]['read']=!![];_0x34022a[_0x45a6('0x56')]['readAt']=moment()[_0x45a6('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x34022a[_0x45a6('0x56')]['UserId']=_0x34022a[_0x45a6('0x56')][_0x45a6('0x5c')]||_0x34022a[_0x45a6('0x5d')]['id'];_0x498640['agent']['id']=_0x34022a['body']['UserId'];return db[_0x45a6('0x3a')][_0x45a6('0x57')]({'where':{'id':_0x34022a['params']['id'],'UserId':null}})[_0x45a6('0x1f')](handleEntityNotFound(_0x67a50b,null))[_0x45a6('0x1f')](saveUpdates(_0x34022a[_0x45a6('0x56')],null))[_0x45a6('0x1f')](function(_0x55b7cf){if(_0x55b7cf){_0x498640[_0x45a6('0x27')]=_0x55b7cf['get']({'plain':!![]});return db[_0x45a6('0x5e')][_0x45a6('0x57')]({'where':{'id':_0x55b7cf['WhatsappInteractionId']}});}return null;})[_0x45a6('0x1f')](handleEntityNotFound(_0x67a50b,null))['then'](function(_0x11392e){if(_0x11392e){return _0x11392e['update']({'UserId':_0x34022a[_0x45a6('0x56')][_0x45a6('0x5c')],'read1stAt':_[_0x45a6('0x5f')](_0x11392e['read1stAt'])?moment()[_0x45a6('0x5b')](_0x45a6('0x60')):undefined});}return null;})[_0x45a6('0x1f')](function(_0x43d7e6){if(_0x43d7e6){_0x498640[_0x45a6('0x61')]=_0x43d7e6[_0x45a6('0x62')]({'plain':!![]});interaction_log[_0x45a6('0x20')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34022a[_0x45a6('0x5d')]['id'],_0x34022a['user'][_0x45a6('0x37')],_0x34022a['user']['role'],_0x498640[_0x45a6('0x61')]['id'],_0x34022a[_0x45a6('0x56')]?JSON[_0x45a6('0x24')](_0x34022a[_0x45a6('0x56')]):'null');return respondWithRpcPromise(_0x45a6('0x63'),'acceptMessage',_0x498640);}return null;})['then'](function(_0x64c5be){var _0x2b8ff1=_0x45a6('0x64')+_0x64c5be[_0x45a6('0x27')][_0x45a6('0x65')];return db[_0x45a6('0x66')]['query'](_0x2b8ff1,{'type':db['Sequelize'][_0x45a6('0x67')][_0x45a6('0x68')],'raw':!![]})[_0x45a6('0x1f')](function(_0x4faf2c){return _0x4faf2c;});})[_0x45a6('0x1f')](function(_0xbabdc3){if(_0xbabdc3){_0x498640[_0x45a6('0x27')][_0x45a6('0x69')]=_0xbabdc3[0x0];if(!_0x34022a[_0x45a6('0x56')][_0x45a6('0x5c')])return;return db[_0x45a6('0x6a')][_0x45a6('0x57')]({'where':{'id':_0x34022a['body'][_0x45a6('0x5c')],'role':_0x45a6('0x6b')},'attributes':['id',_0x45a6('0x37'),_0x45a6('0x6c'),'email',_0x45a6('0x6d')],'raw':!![]});}return null;})[_0x45a6('0x1f')](function(_0x1a94ff){if(!_0x1a94ff)return null;_0x498640[_0x45a6('0x27')]['agent']=_0x1a94ff;return _0x498640;})['then'](function(_0x3859db){if(_0x3859db){if(_0x34022a[_0x45a6('0x56')][_0x45a6('0x6e')]){_0x498640[_0x45a6('0x27')][_0x45a6('0x6f')]=util['format'](_0x45a6('0x70'),_0x34022a['user'][_0x45a6('0x37')]);_0x498640[_0x45a6('0x27')][_0x45a6('0x71')]=_0x498640['channel'];_0x498640[_0x45a6('0x27')][_0x45a6('0x72')]=_0x498640['channel'];_0x498640[_0x45a6('0x27')]['event']=_0x45a6('0x59');return respondWithRpcPromise(_0x45a6('0x73'),_0x45a6('0x73'),{'event':_0x45a6('0x74'),'message':_0x498640[_0x45a6('0x27')]},client9002)[_0x45a6('0x1f')](function(){return _0x498640;});}return _0x498640;}return null;})[_0x45a6('0x1f')](respondWithResult(_0x67a50b,null))['catch'](handleError(_0x67a50b,null));};var interaction_log=require(_0x45a6('0x13'))(_0x45a6('0x58'));exports[_0x45a6('0x75')]=function(_0xd00cc5,_0x1df6c0,_0x5e8826){var _0x868d64={'agent':{},'channel':'whatsapp'};if(_0xd00cc5['body']['id']){delete _0xd00cc5[_0x45a6('0x56')]['id'];}_0xd00cc5['body'][_0x45a6('0x5c')]=_0xd00cc5[_0x45a6('0x56')]['UserId']||_0xd00cc5[_0x45a6('0x5d')]['id'];_0x868d64[_0x45a6('0x6b')]['id']=_0xd00cc5[_0x45a6('0x56')][_0x45a6('0x5c')];return db[_0x45a6('0x3a')]['find']({'where':{'id':_0xd00cc5[_0x45a6('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1df6c0,null))[_0x45a6('0x1f')](function(_0x2a96b5){if(_0x2a96b5){_0x868d64['message']=_0x2a96b5[_0x45a6('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0x45a6('0x57')]({'where':{'id':_0x2a96b5['WhatsappInteractionId']}});}return null;})[_0x45a6('0x1f')](handleEntityNotFound(_0x1df6c0,null))['then'](function(_0x395d04){if(_0x395d04){_0x868d64[_0x45a6('0x61')]=_0x395d04[_0x45a6('0x62')]({'plain':!![]});interaction_log[_0x45a6('0x20')](_0x45a6('0x76'),_0xd00cc5[_0x45a6('0x5d')]['id'],_0xd00cc5['user'][_0x45a6('0x37')],_0xd00cc5[_0x45a6('0x5d')][_0x45a6('0x77')],_0x868d64['interaction']['id'],_0xd00cc5['body']?JSON['stringify'](_0xd00cc5[_0x45a6('0x56')]):_0x45a6('0x78'));return respondWithRpcPromise(_0x45a6('0x79'),_0x45a6('0x7a'),_0x868d64);}return null;})[_0x45a6('0x1f')](function(_0x4c332c){var _0x4a5937=_0x45a6('0x64')+_0x4c332c[_0x45a6('0x27')][_0x45a6('0x65')];return db[_0x45a6('0x66')][_0x45a6('0x3f')](_0x4a5937,{'type':db[_0x45a6('0x7b')][_0x45a6('0x67')][_0x45a6('0x68')],'raw':!![]})['then'](function(_0x203f96){return _0x203f96;});})[_0x45a6('0x1f')](function(_0x9f1317){if(_0x9f1317){_0x868d64['message'][_0x45a6('0x69')]=_0x9f1317[0x0];if(!_0xd00cc5[_0x45a6('0x56')]['UserId'])return;return db[_0x45a6('0x6a')][_0x45a6('0x57')]({'where':{'id':_0xd00cc5[_0x45a6('0x56')]['UserId'],'role':_0x45a6('0x6b')},'attributes':['id',_0x45a6('0x37'),_0x45a6('0x6c'),_0x45a6('0x7c'),'internal'],'raw':!![]});}return null;})[_0x45a6('0x1f')](function(_0x550ed6){if(!_0x550ed6)return null;_0x868d64[_0x45a6('0x27')][_0x45a6('0x6b')]=_0x550ed6;return _0x868d64;})['then'](function(_0x628486){if(_0x628486){_0x628486['message']['interface']=util[_0x45a6('0x5b')]('SIP/%s',_0xd00cc5[_0x45a6('0x5d')][_0x45a6('0x37')]);_0x628486['message']['channel']=_0x868d64[_0x45a6('0x71')];_0x628486['message'][_0x45a6('0x72')]=_0x868d64[_0x45a6('0x71')];_0x628486[_0x45a6('0x27')][_0x45a6('0x7d')]=_0x45a6('0x75');respondWithRpcPromise('EventManager',_0x45a6('0x73'),{'event':'rejectmessage','message':_0x628486[_0x45a6('0x27')]},client9002);return _0x868d64;}return null;})[_0x45a6('0x1f')](respondWithResult(_0x1df6c0,null))['catch'](handleError(_0x1df6c0,null));};exports[_0x45a6('0x2a')]=function(_0x34d94c,_0x2d1439,_0x6dcef0){if(_0x34d94c[_0x45a6('0x56')]['id']){delete _0x34d94c[_0x45a6('0x56')]['id'];}var _0x464d8a;return db[_0x45a6('0x3a')]['find']({'where':{'id':_0x34d94c[_0x45a6('0x52')]['id']}})[_0x45a6('0x1f')](handleEntityNotFound(_0x2d1439,null))['then'](function(_0x573058){if(_0x573058){_0x464d8a=_0x573058;return db[_0x45a6('0x7e')][_0x45a6('0x57')]({'where':{'id':_0x573058[_0x45a6('0x7f')]}});}})['then'](handleEntityNotFound(_0x2d1439,null))[_0x45a6('0x1f')](function(_0x528ba7){if(_0x528ba7){logger[_0x45a6('0x80')](_0x45a6('0x81'),'status',_0x45a6('0x82'),_0x528ba7[_0x45a6('0x3d')],util[_0x45a6('0x83')](_0x34d94c[_0x45a6('0x56')],{'showHidden':![],'depth':null}));switch(_0x528ba7[_0x45a6('0x3d')]){case _0x45a6('0x84'):if(_0x34d94c[_0x45a6('0x56')]['MessageSid']&&_0x34d94c[_0x45a6('0x56')]['MessageSid']===_0x464d8a['messageId']&&_0x34d94c[_0x45a6('0x56')][_0x45a6('0x85')]&&_0x34d94c[_0x45a6('0x56')][_0x45a6('0x85')]===_0x45a6('0x86')){return _0x464d8a['update']({'read':!![]});}else{logger[_0x45a6('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x45a6('0x2a'),_0x45a6('0x84'),util[_0x45a6('0x83')](_0x34d94c['body'],{'showHidden':![],'depth':null}));}break;}return _0x464d8a;}})['then'](respondWithResult(_0x2d1439,null))[_0x45a6('0x54')](handleError(_0x2d1439,null));}; \ No newline at end of file +var _0x1e54=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','show','keys','rawAttributes','find','create','body','params','describe','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','whatsapp-interactions','reject','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','internal','rejectmessage','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','undefined','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','name','send','index','map','WhatsappMessage','fieldName','type','key','model','query','filters','intersection'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x1e54,0x1e5));var _0x41e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e54[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x41e5('0x0'));var rimraf=require(_0x41e5('0x1'));var zipdir=require(_0x41e5('0x2'));var jsonpatch=require(_0x41e5('0x3'));var rp=require(_0x41e5('0x4'));var moment=require(_0x41e5('0x5'));var BPromise=require(_0x41e5('0x6'));var Mustache=require(_0x41e5('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x41e5('0x8'));var ejs=require(_0x41e5('0x9'));var fs=require('fs');var fs_extra=require(_0x41e5('0xa'));var _=require('lodash');var squel=require(_0x41e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x41e5('0xc'));var deskjs=require(_0x41e5('0xd'));var toCsv=require(_0x41e5('0x8'));var querystring=require(_0x41e5('0xe'));var Papa=require(_0x41e5('0xf'));var Redis=require(_0x41e5('0x10'));var authService=require(_0x41e5('0x11'));var qs=require(_0x41e5('0x12'));var as=require(_0x41e5('0x13'));var hardwareService=require(_0x41e5('0x14'));var logger=require(_0x41e5('0x15'))(_0x41e5('0x16'));var utils=require(_0x41e5('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x41e5('0x18'))['db'];config[_0x41e5('0x19')]=_[_0x41e5('0x1a')](config[_0x41e5('0x19')],{'host':_0x41e5('0x1b'),'port':0x18eb});var socket=require(_0x41e5('0x1c'))(new Redis(config['redis']));require(_0x41e5('0x1d'))[_0x41e5('0x1e')](socket);var jayson=require(_0x41e5('0x1f'));var client=jayson[_0x41e5('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x41e5('0x20')][_0x41e5('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xb9ffb4,_0x385709,_0x2ad3fd,_0x2a98e9){return new BPromise(function(_0x45a5d2,_0x58afad){var _0xd7055e=_0x2a98e9||client;return _0xd7055e[_0x41e5('0x22')](_0xb9ffb4,_0x2ad3fd)['then'](function(_0x4b4500){logger[_0x41e5('0x23')](_0x41e5('0x24'),_0x385709,'request\x20sent');logger[_0x41e5('0x25')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x385709,_0x41e5('0x26'),JSON[_0x41e5('0x27')](_0x4b4500));if(_0x4b4500[_0x41e5('0x28')]){if(_0x4b4500[_0x41e5('0x28')][_0x41e5('0x29')]===0x1f4){logger[_0x41e5('0x28')](_0x41e5('0x24'),_0x385709,_0x4b4500[_0x41e5('0x28')][_0x41e5('0x2a')]);return _0x58afad(_0x4b4500[_0x41e5('0x28')]['message']);}logger[_0x41e5('0x28')](_0x41e5('0x24'),_0x385709,_0x4b4500[_0x41e5('0x28')][_0x41e5('0x2a')]);return _0x45a5d2(_0x4b4500[_0x41e5('0x28')][_0x41e5('0x2a')]);}else{logger[_0x41e5('0x23')](_0x41e5('0x24'),_0x385709,_0x41e5('0x26'));_0x45a5d2(_0x4b4500[_0x41e5('0x2b')][_0x41e5('0x2a')]);}})[_0x41e5('0x2c')](function(_0x4518e2){logger['error'](_0x41e5('0x24'),_0x385709,_0x4518e2);_0x58afad(_0x4518e2);});});}function respondWithStatusCode(_0x5b9236,_0x3279f5){_0x3279f5=_0x3279f5||0xcc;return function(_0x46ec87){if(_0x46ec87){return _0x5b9236[_0x41e5('0x2d')](_0x3279f5);}return _0x5b9236['status'](_0x3279f5)[_0x41e5('0x2e')]();};}function respondWithResult(_0x3a928e,_0x1bc082){_0x1bc082=_0x1bc082||0xc8;return function(_0x306da5){if(_0x306da5){return _0x3a928e[_0x41e5('0x2f')](_0x1bc082)['json'](_0x306da5);}};}function respondWithFilteredResult(_0x544336,_0x549d7d){return function(_0x592ba8){if(_0x592ba8){var _0xcfab3b=typeof _0x549d7d['offset']===_0x41e5('0x30')&&typeof _0x549d7d['limit']===_0x41e5('0x30');var _0x23ff8d=_0x592ba8[_0x41e5('0x31')];var _0xb42056=_0xcfab3b?0x0:_0x549d7d[_0x41e5('0x32')];var _0x2b3347=_0xcfab3b?_0x592ba8['count']:_0x549d7d[_0x41e5('0x32')]+_0x549d7d[_0x41e5('0x33')];var _0x3e4488;if(_0x2b3347>=_0x23ff8d){_0x2b3347=_0x23ff8d;_0x3e4488=0xc8;}else{_0x3e4488=0xce;}_0x544336[_0x41e5('0x2f')](_0x3e4488);return _0x544336['set'](_0x41e5('0x34'),_0xb42056+'-'+_0x2b3347+'/'+_0x23ff8d)[_0x41e5('0x35')](_0x592ba8);}return null;};}function patchUpdates(_0x4147bf){return function(_0x3b7cb3){try{jsonpatch[_0x41e5('0x36')](_0x3b7cb3,_0x4147bf,!![]);}catch(_0x37cbcd){return BPromise['reject'](_0x37cbcd);}return _0x3b7cb3[_0x41e5('0x37')]();};}function saveUpdates(_0x7b4727,_0x3f320b){return function(_0x56e8a8){if(_0x56e8a8){return _0x56e8a8[_0x41e5('0x38')](_0x7b4727)[_0x41e5('0x39')](function(_0xc90092){return _0xc90092;});}return null;};}function removeEntity(_0x44b30f,_0x26b2b4){return function(_0x3a9766){if(_0x3a9766){return _0x3a9766[_0x41e5('0x3a')]()[_0x41e5('0x39')](function(){_0x44b30f[_0x41e5('0x2f')](0xcc)[_0x41e5('0x2e')]();});}};}function handleEntityNotFound(_0x81e1c8,_0x3d8137){return function(_0x12cd12){if(!_0x12cd12){_0x81e1c8[_0x41e5('0x2d')](0x194);}return _0x12cd12;};}function handleError(_0x3a9ac5,_0x2ff5d3){_0x2ff5d3=_0x2ff5d3||0x1f4;return function(_0x27bfe1){logger[_0x41e5('0x28')](_0x27bfe1['stack']);if(_0x27bfe1[_0x41e5('0x3b')]){delete _0x27bfe1['name'];}_0x3a9ac5[_0x41e5('0x2f')](_0x2ff5d3)[_0x41e5('0x3c')](_0x27bfe1);};}exports[_0x41e5('0x3d')]=function(_0x4115c4,_0xe9817d){var _0x285cf9={},_0x58c3ff={},_0x3145c6={'count':0x0,'rows':[]};var _0x48ac66=_[_0x41e5('0x3e')](db[_0x41e5('0x3f')]['rawAttributes'],function(_0x16b22e){return{'name':_0x16b22e[_0x41e5('0x40')],'type':_0x16b22e[_0x41e5('0x41')][_0x41e5('0x42')]};});_0x58c3ff[_0x41e5('0x43')]=_['map'](_0x48ac66,_0x41e5('0x3b'));_0x58c3ff[_0x41e5('0x44')]=_['keys'](_0x4115c4[_0x41e5('0x44')]);_0x58c3ff[_0x41e5('0x45')]=_[_0x41e5('0x46')](_0x58c3ff[_0x41e5('0x43')],_0x58c3ff[_0x41e5('0x44')]);_0x285cf9['attributes']=_[_0x41e5('0x46')](_0x58c3ff[_0x41e5('0x43')],qs[_0x41e5('0x47')](_0x4115c4[_0x41e5('0x44')]['fields']));_0x285cf9[_0x41e5('0x48')]=_0x285cf9[_0x41e5('0x48')][_0x41e5('0x49')]?_0x285cf9[_0x41e5('0x48')]:_0x58c3ff[_0x41e5('0x43')];if(!_0x4115c4[_0x41e5('0x44')][_0x41e5('0x4a')](_0x41e5('0x4b'))){_0x285cf9['limit']=qs[_0x41e5('0x33')](_0x4115c4[_0x41e5('0x44')][_0x41e5('0x33')]);_0x285cf9[_0x41e5('0x32')]=qs[_0x41e5('0x32')](_0x4115c4['query']['offset']);}_0x285cf9[_0x41e5('0x4c')]=qs[_0x41e5('0x4d')](_0x4115c4[_0x41e5('0x44')][_0x41e5('0x4d')]);_0x285cf9[_0x41e5('0x4e')]=qs['filters'](_['pick'](_0x4115c4['query'],_0x58c3ff[_0x41e5('0x45')]),_0x48ac66);if(_0x4115c4[_0x41e5('0x44')][_0x41e5('0x4f')]){_0x285cf9[_0x41e5('0x4e')]=_[_0x41e5('0x50')](_0x285cf9[_0x41e5('0x4e')],{'$or':_[_0x41e5('0x3e')](_0x48ac66,function(_0x3ad8e6){if(_0x3ad8e6['type']!==_0x41e5('0x51')){var _0x4731c0={};_0x4731c0[_0x3ad8e6[_0x41e5('0x3b')]]={'$like':'%'+_0x4115c4[_0x41e5('0x44')][_0x41e5('0x4f')]+'%'};return _0x4731c0;}})});}_0x285cf9=_[_0x41e5('0x50')]({},_0x285cf9,_0x4115c4[_0x41e5('0x52')]);var _0x407090={'where':_0x285cf9[_0x41e5('0x4e')]};return db[_0x41e5('0x3f')][_0x41e5('0x31')](_0x407090)[_0x41e5('0x39')](function(_0x5695be){_0x3145c6[_0x41e5('0x31')]=_0x5695be;if(_0x4115c4[_0x41e5('0x44')][_0x41e5('0x53')]){_0x285cf9[_0x41e5('0x54')]=[{'all':!![]}];}return db[_0x41e5('0x3f')]['findAll'](_0x285cf9);})[_0x41e5('0x39')](function(_0x2acdb0){_0x3145c6['rows']=_0x2acdb0;return _0x3145c6;})[_0x41e5('0x39')](respondWithFilteredResult(_0xe9817d,_0x285cf9))['catch'](handleError(_0xe9817d,null));};exports[_0x41e5('0x55')]=function(_0x405475,_0x3c1890){var _0x1514d1={'raw':!![],'where':{'id':_0x405475['params']['id']}},_0x21be84={};_0x21be84['model']=_[_0x41e5('0x56')](db[_0x41e5('0x3f')][_0x41e5('0x57')]);_0x21be84[_0x41e5('0x44')]=_['keys'](_0x405475[_0x41e5('0x44')]);_0x21be84[_0x41e5('0x45')]=_[_0x41e5('0x46')](_0x21be84[_0x41e5('0x43')],_0x21be84['query']);_0x1514d1[_0x41e5('0x48')]=_['intersection'](_0x21be84[_0x41e5('0x43')],qs['fields'](_0x405475[_0x41e5('0x44')][_0x41e5('0x47')]));_0x1514d1[_0x41e5('0x48')]=_0x1514d1['attributes'][_0x41e5('0x49')]?_0x1514d1['attributes']:_0x21be84[_0x41e5('0x43')];if(_0x405475[_0x41e5('0x44')]['includeAll']){_0x1514d1[_0x41e5('0x54')]=[{'all':!![]}];}_0x1514d1=_[_0x41e5('0x50')]({},_0x1514d1,_0x405475[_0x41e5('0x52')]);return db['WhatsappMessage'][_0x41e5('0x58')](_0x1514d1)[_0x41e5('0x39')](handleEntityNotFound(_0x3c1890,null))[_0x41e5('0x39')](respondWithResult(_0x3c1890,null))[_0x41e5('0x2c')](handleError(_0x3c1890,null));};exports[_0x41e5('0x59')]=function(_0x358252,_0x470a64){return db[_0x41e5('0x3f')][_0x41e5('0x59')](_0x358252[_0x41e5('0x5a')],{})[_0x41e5('0x39')](respondWithResult(_0x470a64,0xc9))[_0x41e5('0x2c')](handleError(_0x470a64,null));};exports[_0x41e5('0x38')]=function(_0x21408f,_0x281358){if(_0x21408f[_0x41e5('0x5a')]['id']){delete _0x21408f[_0x41e5('0x5a')]['id'];}return db[_0x41e5('0x3f')]['find']({'where':{'id':_0x21408f[_0x41e5('0x5b')]['id']}})[_0x41e5('0x39')](handleEntityNotFound(_0x281358,null))[_0x41e5('0x39')](saveUpdates(_0x21408f[_0x41e5('0x5a')],null))[_0x41e5('0x39')](respondWithResult(_0x281358,null))[_0x41e5('0x2c')](handleError(_0x281358,null));};exports[_0x41e5('0x3a')]=function(_0x50afc1,_0x39151f){return db[_0x41e5('0x3f')][_0x41e5('0x58')]({'where':{'id':_0x50afc1[_0x41e5('0x5b')]['id']}})[_0x41e5('0x39')](handleEntityNotFound(_0x39151f,null))[_0x41e5('0x39')](removeEntity(_0x39151f,null))[_0x41e5('0x2c')](handleError(_0x39151f,null));};exports[_0x41e5('0x5c')]=function(_0x22e202,_0x52e815){return db[_0x41e5('0x3f')][_0x41e5('0x5c')]()[_0x41e5('0x39')](respondWithResult(_0x52e815,null))[_0x41e5('0x2c')](handleError(_0x52e815,null));};var interaction_log=require(_0x41e5('0x15'))('whatsapp-interactions');exports['accept']=function(_0x247441,_0x3a072b,_0xeb28b6){var _0x305069={'agent':{},'channel':'whatsapp'};if(_0x247441[_0x41e5('0x5a')]['id']){delete _0x247441[_0x41e5('0x5a')]['id'];}_0x247441[_0x41e5('0x5a')][_0x41e5('0x5d')]=!![];_0x247441[_0x41e5('0x5a')]['readAt']=moment()[_0x41e5('0x5e')](_0x41e5('0x5f'));_0x247441['body']['UserId']=_0x247441[_0x41e5('0x5a')][_0x41e5('0x60')]||_0x247441[_0x41e5('0x61')]['id'];_0x305069[_0x41e5('0x62')]['id']=_0x247441[_0x41e5('0x5a')][_0x41e5('0x60')];return db[_0x41e5('0x3f')][_0x41e5('0x58')]({'where':{'id':_0x247441[_0x41e5('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a072b,null))[_0x41e5('0x39')](saveUpdates(_0x247441['body'],null))[_0x41e5('0x39')](function(_0x44bca3){if(_0x44bca3){_0x305069[_0x41e5('0x2a')]=_0x44bca3[_0x41e5('0x63')]({'plain':!![]});return db[_0x41e5('0x64')][_0x41e5('0x58')]({'where':{'id':_0x44bca3['WhatsappInteractionId']}});}return null;})[_0x41e5('0x39')](handleEntityNotFound(_0x3a072b,null))['then'](function(_0x24c38f){if(_0x24c38f){return _0x24c38f[_0x41e5('0x38')]({'UserId':_0x247441[_0x41e5('0x5a')][_0x41e5('0x60')],'read1stAt':_[_0x41e5('0x65')](_0x24c38f[_0x41e5('0x66')])?moment()[_0x41e5('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x41e5('0x39')](function(_0x4bdca7){if(_0x4bdca7){_0x305069[_0x41e5('0x67')]=_0x4bdca7['get']({'plain':!![]});interaction_log[_0x41e5('0x23')](_0x41e5('0x68'),_0x247441[_0x41e5('0x61')]['id'],_0x247441['user']['name'],_0x247441[_0x41e5('0x61')]['role'],_0x305069['interaction']['id'],_0x247441[_0x41e5('0x5a')]?JSON[_0x41e5('0x27')](_0x247441[_0x41e5('0x5a')]):'null');return respondWithRpcPromise(_0x41e5('0x69'),'acceptMessage',_0x305069);}return null;})[_0x41e5('0x39')](function(_0x4e031a){var _0x110132=_0x41e5('0x6a')+_0x4e031a['message']['ContactId'];return db[_0x41e5('0x6b')][_0x41e5('0x44')](_0x110132,{'type':db[_0x41e5('0x6c')][_0x41e5('0x6d')][_0x41e5('0x6e')],'raw':!![]})[_0x41e5('0x39')](function(_0x56d884){return _0x56d884;});})[_0x41e5('0x39')](function(_0x4d2550){if(_0x4d2550){_0x305069['message'][_0x41e5('0x6f')]=_0x4d2550[0x0];if(!_0x247441[_0x41e5('0x5a')][_0x41e5('0x60')])return;return db[_0x41e5('0x70')]['find']({'where':{'id':_0x247441['body'][_0x41e5('0x60')],'role':_0x41e5('0x62')},'attributes':['id',_0x41e5('0x3b'),_0x41e5('0x71'),_0x41e5('0x72'),'internal'],'raw':!![]});}return null;})[_0x41e5('0x39')](function(_0x4e73d5){if(!_0x4e73d5)return null;_0x305069[_0x41e5('0x2a')][_0x41e5('0x62')]=_0x4e73d5;return _0x305069;})['then'](function(_0x3553bd){if(_0x3553bd){if(_0x247441[_0x41e5('0x5a')][_0x41e5('0x73')]){_0x305069[_0x41e5('0x2a')][_0x41e5('0x74')]=util['format'](_0x41e5('0x75'),_0x247441[_0x41e5('0x61')][_0x41e5('0x3b')]);_0x305069[_0x41e5('0x2a')]['channel']=_0x305069[_0x41e5('0x76')];_0x305069[_0x41e5('0x2a')][_0x41e5('0x77')]=_0x305069[_0x41e5('0x76')];_0x305069['message'][_0x41e5('0x78')]=_0x41e5('0x79');return respondWithRpcPromise(_0x41e5('0x7a'),'EventManager',{'event':_0x41e5('0x7b'),'message':_0x305069[_0x41e5('0x2a')]},client9002)[_0x41e5('0x39')](function(){return _0x305069;});}return _0x305069;}return null;})[_0x41e5('0x39')](respondWithResult(_0x3a072b,null))[_0x41e5('0x2c')](handleError(_0x3a072b,null));};var interaction_log=require('../../config/logger')(_0x41e5('0x7c'));exports[_0x41e5('0x7d')]=function(_0x550d0d,_0x11ffdc,_0x25a595){var _0x11a1e5={'agent':{},'channel':'whatsapp'};if(_0x550d0d[_0x41e5('0x5a')]['id']){delete _0x550d0d[_0x41e5('0x5a')]['id'];}_0x550d0d[_0x41e5('0x5a')][_0x41e5('0x60')]=_0x550d0d[_0x41e5('0x5a')][_0x41e5('0x60')]||_0x550d0d['user']['id'];_0x11a1e5[_0x41e5('0x62')]['id']=_0x550d0d[_0x41e5('0x5a')][_0x41e5('0x60')];return db['WhatsappMessage'][_0x41e5('0x58')]({'where':{'id':_0x550d0d[_0x41e5('0x5b')]['id'],'UserId':null}})[_0x41e5('0x39')](handleEntityNotFound(_0x11ffdc,null))[_0x41e5('0x39')](function(_0x12c0d6){if(_0x12c0d6){_0x11a1e5[_0x41e5('0x2a')]=_0x12c0d6[_0x41e5('0x63')]({'plain':!![]});return db[_0x41e5('0x64')][_0x41e5('0x58')]({'where':{'id':_0x12c0d6[_0x41e5('0x7e')]}});}return null;})[_0x41e5('0x39')](handleEntityNotFound(_0x11ffdc,null))[_0x41e5('0x39')](function(_0x1c3b78){if(_0x1c3b78){_0x11a1e5[_0x41e5('0x67')]=_0x1c3b78[_0x41e5('0x63')]({'plain':!![]});interaction_log['info'](_0x41e5('0x7f'),_0x550d0d['user']['id'],_0x550d0d[_0x41e5('0x61')][_0x41e5('0x3b')],_0x550d0d[_0x41e5('0x61')]['role'],_0x11a1e5[_0x41e5('0x67')]['id'],_0x550d0d['body']?JSON[_0x41e5('0x27')](_0x550d0d[_0x41e5('0x5a')]):_0x41e5('0x80'));return respondWithRpcPromise(_0x41e5('0x81'),_0x41e5('0x82'),_0x11a1e5);}return null;})[_0x41e5('0x39')](function(_0x25a877){var _0x3068ea='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x25a877[_0x41e5('0x2a')]['ContactId'];return db[_0x41e5('0x6b')][_0x41e5('0x44')](_0x3068ea,{'type':db[_0x41e5('0x6c')]['QueryTypes'][_0x41e5('0x6e')],'raw':!![]})[_0x41e5('0x39')](function(_0xc1a95c){return _0xc1a95c;});})['then'](function(_0x1188a1){if(_0x1188a1){_0x11a1e5[_0x41e5('0x2a')][_0x41e5('0x6f')]=_0x1188a1[0x0];if(!_0x550d0d[_0x41e5('0x5a')]['UserId'])return;return db[_0x41e5('0x70')]['find']({'where':{'id':_0x550d0d['body'][_0x41e5('0x60')],'role':'agent'},'attributes':['id',_0x41e5('0x3b'),'fullname',_0x41e5('0x72'),_0x41e5('0x83')],'raw':!![]});}return null;})[_0x41e5('0x39')](function(_0x141e3e){if(!_0x141e3e)return null;_0x11a1e5[_0x41e5('0x2a')][_0x41e5('0x62')]=_0x141e3e;return _0x11a1e5;})['then'](function(_0x24522a){if(_0x24522a){_0x24522a[_0x41e5('0x2a')][_0x41e5('0x74')]=util[_0x41e5('0x5e')]('SIP/%s',_0x550d0d[_0x41e5('0x61')]['name']);_0x24522a[_0x41e5('0x2a')][_0x41e5('0x76')]=_0x11a1e5[_0x41e5('0x76')];_0x24522a[_0x41e5('0x2a')][_0x41e5('0x77')]=_0x11a1e5[_0x41e5('0x76')];_0x24522a[_0x41e5('0x2a')][_0x41e5('0x78')]=_0x41e5('0x7d');respondWithRpcPromise('EventManager','EventManager',{'event':_0x41e5('0x84'),'message':_0x24522a[_0x41e5('0x2a')]},client9002);return _0x11a1e5;}return null;})[_0x41e5('0x39')](respondWithResult(_0x11ffdc,null))[_0x41e5('0x2c')](handleError(_0x11ffdc,null));};exports['status']=function(_0x504c97,_0x3d763b,_0x335a99){if(_0x504c97['body']['id']){delete _0x504c97['body']['id'];}var _0x56500d;return db[_0x41e5('0x3f')]['find']({'where':{'id':_0x504c97[_0x41e5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3d763b,null))['then'](function(_0x23631e){if(_0x23631e){_0x56500d=_0x23631e;return db['WhatsappAccount'][_0x41e5('0x58')]({'where':{'id':_0x23631e[_0x41e5('0x85')]}});}})[_0x41e5('0x39')](handleEntityNotFound(_0x3d763b,null))[_0x41e5('0x39')](function(_0x460e2a){if(_0x460e2a){logger[_0x41e5('0x25')]('WhatsppMessage,\x20%s,\x20%s,\x20%s','status',_0x41e5('0x86'),_0x460e2a['type'],util[_0x41e5('0x87')](_0x504c97[_0x41e5('0x5a')],{'showHidden':![],'depth':null}));switch(_0x460e2a[_0x41e5('0x41')]){case _0x41e5('0x88'):if(_0x504c97[_0x41e5('0x5a')][_0x41e5('0x89')]&&_0x504c97[_0x41e5('0x5a')][_0x41e5('0x89')]===_0x56500d['messageId']&&_0x504c97[_0x41e5('0x5a')]['MessageStatus']&&_0x504c97[_0x41e5('0x5a')]['MessageStatus']==='read'){return _0x56500d[_0x41e5('0x38')]({'read':!![]});}else{logger[_0x41e5('0x28')](_0x41e5('0x8a'),_0x41e5('0x2f'),_0x41e5('0x88'),util[_0x41e5('0x87')](_0x504c97['body'],{'showHidden':![],'depth':null}));}break;}return _0x56500d;}})[_0x41e5('0x39')](respondWithResult(_0x3d763b,null))[_0x41e5('0x2c')](handleError(_0x3d763b,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 352c89b..bdfdff5 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 _0xdc9b=['events','../../mysqldb','WhatsappMessage','save','update','emit','hook'];(function(_0x1e920c,_0x2e73de){var _0x347799=function(_0x2a9db6){while(--_0x2a9db6){_0x1e920c['push'](_0x1e920c['shift']());}};_0x347799(++_0x2e73de);}(_0xdc9b,0x70));var _0xbdc9=function(_0x5e8303,_0x3b96a4){_0x5e8303=_0x5e8303-0x0;var _0x161452=_0xdc9b[_0x5e8303];return _0x161452;};'use strict';var EventEmitter=require(_0xbdc9('0x0'));var WhatsappMessage=require(_0xbdc9('0x1'))['db'][_0xbdc9('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbdc9('0x3'),'afterUpdate':_0xbdc9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5a7be7){return function(_0x30b8d2,_0x28fa82,_0x599fd5){WhatsappMessageEvents[_0xbdc9('0x5')](_0x5a7be7+':'+_0x30b8d2['id'],_0x30b8d2);WhatsappMessageEvents[_0xbdc9('0x5')](_0x5a7be7,_0x30b8d2);_0x599fd5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xbdc9('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x9434=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xfd9239,_0x2fea4f){var _0x48f447=function(_0x49af16){while(--_0x49af16){_0xfd9239['push'](_0xfd9239['shift']());}};_0x48f447(++_0x2fea4f);}(_0x9434,0x168));var _0x4943=function(_0x175942,_0x2d8b03){_0x175942=_0x175942-0x0;var _0x296c73=_0x9434[_0x175942];return _0x296c73;};'use strict';var EventEmitter=require(_0x4943('0x0'));var WhatsappMessage=require(_0x4943('0x1'))['db'][_0x4943('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4943('0x3')](0x0);var events={'afterCreate':_0x4943('0x4'),'afterUpdate':_0x4943('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1159f9){return function(_0xda4cba,_0x5117c7,_0x2ce3d9){WhatsappMessageEvents[_0x4943('0x6')](_0x1159f9+':'+_0xda4cba['id'],_0xda4cba);WhatsappMessageEvents['emit'](_0x1159f9,_0xda4cba);_0x2ce3d9(null);};}for(var e in events){if(events[_0x4943('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index c056080..780bf55 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 _0x1fba=['../../config/logger','api','moment','bluebird','request-promise','node-fetch','../../config/environment','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','WhatsappInteractionId','then','update','createdAt','error','secret','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','statuses','catch','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci'];(function(_0x59340e,_0x3c1fb8){var _0x50a119=function(_0x53be80){while(--_0x53be80){_0x59340e['push'](_0x59340e['shift']());}};_0x50a119(++_0x3c1fb8);}(_0x1fba,0x118));var _0xa1fb=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0x1fba[_0x3c6ae2];return _0x4edda;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa1fb('0x0'))(_0xa1fb('0x1'));var moment=require(_0xa1fb('0x2'));var BPromise=require(_0xa1fb('0x3'));var rp=require(_0xa1fb('0x4'));var fetch=require(_0xa1fb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa1fb('0x6'));var attributes=require(_0xa1fb('0x7'));module[_0xa1fb('0x8')]=function(_0x2af6d0,_0x11e2dc){return _0x2af6d0[_0xa1fb('0x9')]('WhatsappMessage',attributes,{'tableName':_0xa1fb('0xa'),'paranoid':![],'indexes':[{'name':_0xa1fb('0xb'),'fields':[_0xa1fb('0xb')]},{'name':_0xa1fb('0xc'),'fields':[_0xa1fb('0xd')],'type':_0xa1fb('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x13e866,_0x467707,_0x29313b){var _0x4b620b=_0x2af6d0[_0xa1fb('0xf')];var _0x28db7e=_0x13e866[_0xa1fb('0x10')]({'plain':!![]});if(_0x28db7e[_0xa1fb('0x11')][_0xa1fb('0x12')]()==='in'||_0x28db7e[_0xa1fb('0x11')]['toLowerCase']()===_0xa1fb('0x13')&&!_0x28db7e['secret']&&!_[_0xa1fb('0x14')](_0x28db7e['UserId'])){_0x4b620b['WhatsappInteraction']['findOne']({'where':{'id':_0x28db7e[_0xa1fb('0x15')]}})[_0xa1fb('0x16')](function(_0x49634c){if(_0x49634c){_0x49634c[_0xa1fb('0x17')]({'lastMsgAt':_0x28db7e[_0xa1fb('0x18')],'lastMsgDirection':_0x28db7e[_0xa1fb('0x11')]['toLowerCase']()});}})['catch'](function(_0x4449d7){console[_0xa1fb('0x19')](_0x4449d7);});}if(_0x28db7e[_0xa1fb('0x11')]===_0xa1fb('0x13')&&!_0x28db7e[_0xa1fb('0x1a')]){var _0x398a49;_0x4b620b['WhatsappAccount']['find']({'where':{'id':_0x28db7e[_0xa1fb('0x1b')]},'raw':!![]})[_0xa1fb('0x16')](function(_0x297d6d){_0x398a49=_0x297d6d;if(_0x398a49&&_0x398a49[_0xa1fb('0x1c')]){switch(_0x398a49[_0xa1fb('0x1c')]){case'twilio':var _0x53ce8f=require(_0xa1fb('0x1d'));if(_0x398a49[_0xa1fb('0x1e')]&&_0x398a49[_0xa1fb('0x1f')]&&_0x398a49[_0xa1fb('0x20')]){var _0x4d815b=new _0x53ce8f(_0x398a49[_0xa1fb('0x1e')],_0x398a49['authToken']);_0x4d815b[_0xa1fb('0x21')]['create']({'body':_0x28db7e[_0xa1fb('0xd')],'to':_0xa1fb('0x22')+_0x28db7e[_0xa1fb('0x20')],'from':_0xa1fb('0x22')+_0x398a49[_0xa1fb('0x20')],'statusCallback':_0x398a49[_0xa1fb('0x23')]+'/api/whatsapp/messages/'+_0x28db7e['id']+_0xa1fb('0x24')+_0x398a49[_0xa1fb('0x25')]})[_0xa1fb('0x16')](function(_0x22220e){if(_0x22220e[_0xa1fb('0x26')]){return _0x13e866['update']({'messageId':_0x22220e[_0xa1fb('0x26')]});}})['catch'](function(_0x3a98b1){logger['error'](_0xa1fb('0x27'),_0xa1fb('0x28'),_0xa1fb('0x1d'),util[_0xa1fb('0x29')](_0x3a98b1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa1fb('0x27'),_0xa1fb('0x28'),_0xa1fb('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xa1fb('0x2a'):var _0x2887f8=_0x398a49[_0xa1fb('0x1e')];var _0x3517b0=_0x398a49[_0xa1fb('0x1f')];var _0x628d5c=_0x398a49[_0xa1fb('0x2b')]+_0xa1fb('0x2c')+_0x2887f8+_0xa1fb('0x2d');var _0x41e487={'to':[_0x28db7e['phone']],'message':{'type':'text','text':_0x28db7e[_0xa1fb('0xd')]}};var _0x4cf91c={'method':_0xa1fb('0x2e'),'uri':_0x628d5c,'headers':{'Authorization':_0xa1fb('0x2f')+_0x3517b0,'Content-Type':_0xa1fb('0x30')},'body':_0x41e487,'json':!![]};rp(_0x4cf91c)[_0xa1fb('0x16')](function(_0x33136d){if(_0x33136d[_0xa1fb('0x31')][0x0]['message_id']){return _0x13e866[_0xa1fb('0x17')]({'messageId':_0x33136d['statuses'][0x0]['message_id']});}})[_0xa1fb('0x32')](function(_0x18bb91){logger[_0xa1fb('0x33')](_0xa1fb('0x34'),_0x18bb91);});break;}}})[_0xa1fb('0x35')](function(){_0x29313b();});}else{_0x29313b();}}},'charset':_0xa1fb('0x36'),'collate':_0xa1fb('0x37')});}; \ No newline at end of file +var _0x33f5=['finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','createdAt','catch','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','whatsapp:','remote','/status?token=','token','sid','update','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s'];(function(_0x12ae37,_0x226c49){var _0x1e227f=function(_0x289549){while(--_0x289549){_0x12ae37['push'](_0x12ae37['shift']());}};_0x1e227f(++_0x226c49);}(_0x33f5,0xff));var _0x533f=function(_0x690de5,_0xfa9a3c){_0x690de5=_0x690de5-0x0;var _0x51f683=_0x33f5[_0x690de5];return _0x51f683;};'use strict';var _=require(_0x533f('0x0'));var util=require(_0x533f('0x1'));var logger=require(_0x533f('0x2'))(_0x533f('0x3'));var moment=require(_0x533f('0x4'));var BPromise=require(_0x533f('0x5'));var rp=require(_0x533f('0x6'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x533f('0x7'));var rimraf=require(_0x533f('0x8'));var config=require(_0x533f('0x9'));var attributes=require(_0x533f('0xa'));module['exports']=function(_0x22eed8,_0xfe8574){return _0x22eed8['define'](_0x533f('0xb'),attributes,{'tableName':_0x533f('0xc'),'paranoid':![],'indexes':[{'name':_0x533f('0xd'),'fields':[_0x533f('0xd')]},{'name':_0x533f('0xe'),'fields':[_0x533f('0xf')],'type':_0x533f('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a20c5,_0x50f166,_0x255bca){var _0x350246=_0x22eed8['models'];var _0x592607=_0x5a20c5[_0x533f('0x11')]({'plain':!![]});if(_0x592607[_0x533f('0x12')]['toLowerCase']()==='in'||_0x592607['direction'][_0x533f('0x13')]()===_0x533f('0x14')&&!_0x592607['secret']&&!_[_0x533f('0x15')](_0x592607[_0x533f('0x16')])){_0x350246[_0x533f('0x17')][_0x533f('0x18')]({'where':{'id':_0x592607[_0x533f('0x19')]}})[_0x533f('0x1a')](function(_0x2cd48a){if(_0x2cd48a){_0x2cd48a['update']({'lastMsgAt':_0x592607[_0x533f('0x1b')],'lastMsgDirection':_0x592607['direction'][_0x533f('0x13')]()});}})[_0x533f('0x1c')](function(_0x5cd9e5){console['error'](_0x5cd9e5);});}if(_0x592607[_0x533f('0x12')]===_0x533f('0x14')&&!_0x592607[_0x533f('0x1d')]){var _0x4a5adf;_0x350246[_0x533f('0x1e')][_0x533f('0x1f')]({'where':{'id':_0x592607[_0x533f('0x20')]},'raw':!![]})['then'](function(_0x196b70){_0x4a5adf=_0x196b70;if(_0x4a5adf&&_0x4a5adf[_0x533f('0x21')]){switch(_0x4a5adf['type']){case'twilio':var _0x2817ac=require(_0x533f('0x22'));if(_0x4a5adf[_0x533f('0x23')]&&_0x4a5adf[_0x533f('0x24')]&&_0x4a5adf[_0x533f('0x25')]){var _0x18bfad=new _0x2817ac(_0x4a5adf[_0x533f('0x23')],_0x4a5adf['authToken']);_0x18bfad['messages'][_0x533f('0x26')]({'body':_0x592607[_0x533f('0xf')],'to':_0x533f('0x27')+_0x592607[_0x533f('0x25')],'from':_0x533f('0x27')+_0x4a5adf[_0x533f('0x25')],'statusCallback':_0x4a5adf[_0x533f('0x28')]+'/api/whatsapp/messages/'+_0x592607['id']+_0x533f('0x29')+_0x4a5adf[_0x533f('0x2a')]})['then'](function(_0x49784b){if(_0x49784b[_0x533f('0x2b')]){return _0x5a20c5[_0x533f('0x2c')]({'messageId':_0x49784b[_0x533f('0x2b')]});}})['catch'](function(_0xa9cd85){logger[_0x533f('0x2d')](_0x533f('0x2e'),_0x533f('0x2f'),_0x533f('0x22'),util[_0x533f('0x30')](_0xa9cd85,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x533f('0x2f'),_0x533f('0x22'),_0x533f('0x31'));}break;case _0x533f('0x32'):var _0x58419e=_0x4a5adf[_0x533f('0x23')];var _0x3a18a7=_0x4a5adf[_0x533f('0x24')];var _0x4e4163=_0x4a5adf[_0x533f('0x33')]+'/whatsapp/v1/'+_0x58419e+_0x533f('0x34');var _0x771ffe={'to':[_0x592607['phone']],'message':{'type':_0x533f('0x35'),'text':_0x592607[_0x533f('0xf')]}};var _0x3db340={'method':_0x533f('0x36'),'uri':_0x4e4163,'headers':{'Authorization':_0x533f('0x37')+_0x3a18a7,'Content-Type':_0x533f('0x38')},'body':_0x771ffe,'json':!![]};rp(_0x3db340)[_0x533f('0x1a')](function(_0x5704b0){if(_0x5704b0[_0x533f('0x39')][0x0][_0x533f('0x3a')]){return _0x5a20c5[_0x533f('0x2c')]({'messageId':_0x5704b0[_0x533f('0x39')][0x0][_0x533f('0x3a')]});}})['catch'](function(_0x2e14fe){logger['err'](_0x533f('0x3b'),_0x2e14fe);});break;}}})[_0x533f('0x3c')](function(){_0x255bca();});}else{_0x255bca();}}},'charset':_0x533f('0x3d'),'collate':_0x533f('0x3e')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 55e939f..fc778cd 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 _0xed1c=['socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost'];(function(_0x34596a,_0x4f5372){var _0x1695ec=function(_0x5d0080){while(--_0x5d0080){_0x34596a['push'](_0x34596a['shift']());}};_0x1695ec(++_0x4f5372);}(_0xed1c,0x7e));var _0xced1=function(_0x1c5be7,_0x458345){_0x1c5be7=_0x1c5be7-0x0;var _0xe391aa=_0xed1c[_0x1c5be7];return _0xe391aa;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var moment=require(_0xced1('0x2'));var BPromise=require(_0xced1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced1('0x4'));var db=require(_0xced1('0x5'))['db'];var utils=require(_0xced1('0x6'));var logger=require(_0xced1('0x7'))(_0xced1('0x8'));var config=require(_0xced1('0x9'));var jayson=require(_0xced1('0xa'));var client=jayson['client'][_0xced1('0xb')]({'port':0x232a});config[_0xced1('0xc')]=_['defaults'](config['redis'],{'host':_0xced1('0xd'),'port':0x18eb});var socket=require(_0xced1('0xe'))(new Redis(config[_0xced1('0xc')]));require(_0xced1('0xf'))[_0xced1('0x10')](socket);function respondWithRpcPromise(_0x4c4955,_0x2f536b,_0x3839c8){return new BPromise(function(_0x1cb0dd,_0x53d1b3){return client[_0xced1('0x11')](_0x4c4955,_0x3839c8)[_0xced1('0x12')](function(_0x20ed8c){logger[_0xced1('0x13')](_0xced1('0x14'),_0x2f536b,'request\x20sent');logger[_0xced1('0x15')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2f536b,_0xced1('0x16'),JSON[_0xced1('0x17')](_0x20ed8c));if(_0x20ed8c[_0xced1('0x18')]){if(_0x20ed8c[_0xced1('0x18')][_0xced1('0x19')]===0x1f4){logger[_0xced1('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x2f536b,_0x20ed8c[_0xced1('0x18')][_0xced1('0x1a')]);return _0x53d1b3(_0x20ed8c[_0xced1('0x18')]['message']);}logger[_0xced1('0x18')](_0xced1('0x14'),_0x2f536b,_0x20ed8c['error'][_0xced1('0x1a')]);return _0x1cb0dd(_0x20ed8c['error']['message']);}else{logger[_0xced1('0x13')](_0xced1('0x14'),_0x2f536b,_0xced1('0x16'));_0x1cb0dd(_0x20ed8c[_0xced1('0x1b')][_0xced1('0x1a')]);}})[_0xced1('0x1c')](function(_0x208f49){logger['error'](_0xced1('0x14'),_0x2f536b,_0x208f49);_0x53d1b3(_0x208f49);});});}exports[_0xced1('0x1d')]=function(_0x2da82c){var _0xa2616b=this;return new Promise(function(_0x382419,_0x1dd60c){return db[_0xced1('0x1e')][_0xced1('0x1f')](_0x2da82c[_0xced1('0x20')],{'raw':_0x2da82c['options']?_0x2da82c[_0xced1('0x21')][_0xced1('0x22')]===undefined?!![]:![]:!![]})[_0xced1('0x12')](function(_0x387620){logger['info']('CreateWhatsappMessage',_0x2da82c);logger[_0xced1('0x15')](_0xced1('0x1d'),_0x2da82c,JSON[_0xced1('0x17')](_0x387620));_0x382419(_0x387620);})[_0xced1('0x1c')](function(_0x4abeb4){logger[_0xced1('0x18')](_0xced1('0x1d'),_0x4abeb4['message'],_0x2da82c);_0x1dd60c(_0xa2616b[_0xced1('0x18')](0x1f4,_0x4abeb4['message']));});});}; \ No newline at end of file +var _0x6778=['raw','CreateWhatsappMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','create','body','options'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6778,0x1d0));var _0x8677=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0x6778[_0x307086];return _0x699043;};'use strict';var _=require(_0x8677('0x0'));var util=require(_0x8677('0x1'));var moment=require(_0x8677('0x2'));var BPromise=require(_0x8677('0x3'));var rs=require(_0x8677('0x4'));var fs=require('fs');var Redis=require(_0x8677('0x5'));var db=require(_0x8677('0x6'))['db'];var utils=require(_0x8677('0x7'));var logger=require(_0x8677('0x8'))(_0x8677('0x9'));var config=require(_0x8677('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8677('0xb')][_0x8677('0xc')]({'port':0x232a});config['redis']=_[_0x8677('0xd')](config[_0x8677('0xe')],{'host':_0x8677('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8677('0xe')]));require(_0x8677('0x10'))[_0x8677('0x11')](socket);function respondWithRpcPromise(_0x18309b,_0x25b1db,_0x51174a){return new BPromise(function(_0x1286cc,_0x76e5ce){return client['request'](_0x18309b,_0x51174a)[_0x8677('0x12')](function(_0x175001){logger[_0x8677('0x13')](_0x8677('0x14'),_0x25b1db,'request\x20sent');logger[_0x8677('0x15')](_0x8677('0x16'),_0x25b1db,_0x8677('0x17'),JSON[_0x8677('0x18')](_0x175001));if(_0x175001[_0x8677('0x19')]){if(_0x175001[_0x8677('0x19')][_0x8677('0x1a')]===0x1f4){logger['error'](_0x8677('0x14'),_0x25b1db,_0x175001['error']['message']);return _0x76e5ce(_0x175001['error'][_0x8677('0x1b')]);}logger[_0x8677('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x25b1db,_0x175001[_0x8677('0x19')]['message']);return _0x1286cc(_0x175001[_0x8677('0x19')]['message']);}else{logger['info'](_0x8677('0x14'),_0x25b1db,_0x8677('0x17'));_0x1286cc(_0x175001['result']['message']);}})['catch'](function(_0x5b2f7c){logger[_0x8677('0x19')](_0x8677('0x14'),_0x25b1db,_0x5b2f7c);_0x76e5ce(_0x5b2f7c);});});}exports['CreateWhatsappMessage']=function(_0x5e95a1){var _0x2dea77=this;return new Promise(function(_0x12a7b9,_0x55e62c){return db['WhatsappMessage'][_0x8677('0x1c')](_0x5e95a1[_0x8677('0x1d')],{'raw':_0x5e95a1[_0x8677('0x1e')]?_0x5e95a1['options'][_0x8677('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x28a4eb){logger[_0x8677('0x13')](_0x8677('0x20'),_0x5e95a1);logger[_0x8677('0x15')](_0x8677('0x20'),_0x5e95a1,JSON['stringify'](_0x28a4eb));_0x12a7b9(_0x28a4eb);})['catch'](function(_0x595831){logger[_0x8677('0x19')]('CreateWhatsappMessage',_0x595831['message'],_0x5e95a1);_0x55e62c(_0x2dea77[_0x8677('0x19')](0x1f4,_0x595831['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 0175db9..3a3f53e 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 _0x5180=['./whatsappMessage.events','save','update','emit','removeListener','register','length','whatsappMessage:'];(function(_0x4630fd,_0x227e92){var _0x21b5a8=function(_0x4470ba){while(--_0x4470ba){_0x4630fd['push'](_0x4630fd['shift']());}};_0x21b5a8(++_0x227e92);}(_0x5180,0x188));var _0x0518=function(_0xd60025,_0x1bb508){_0xd60025=_0xd60025-0x0;var _0x49d6b6=_0x5180[_0xd60025];return _0x49d6b6;};'use strict';var WhatsappMessageEvents=require(_0x0518('0x0'));var events=[_0x0518('0x1'),'remove',_0x0518('0x2')];function createListener(_0x649145,_0x5a2c84){return function(_0x62e3e0){_0x5a2c84[_0x0518('0x3')](_0x649145,_0x62e3e0);};}function removeListener(_0x5f5ea9,_0xb7b26f){return function(){WhatsappMessageEvents[_0x0518('0x4')](_0x5f5ea9,_0xb7b26f);};}exports[_0x0518('0x5')]=function(_0x4ea896){for(var _0x5786be=0x0,_0x54f0de=events[_0x0518('0x6')];_0x5786be<_0x54f0de;_0x5786be++){var _0x53bf53=events[_0x5786be];var _0x8b3ed9=createListener(_0x0518('0x7')+_0x53bf53,_0x4ea896);WhatsappMessageEvents['on'](_0x53bf53,_0x8b3ed9);}}; \ No newline at end of file +var _0x0c8b=['save','remove','emit','register','length'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x0c8b,0x91));var _0xb0c8=function(_0x13e9d4,_0x25483d){_0x13e9d4=_0x13e9d4-0x0;var _0x2c62b8=_0x0c8b[_0x13e9d4];return _0x2c62b8;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xb0c8('0x0'),_0xb0c8('0x1'),'update'];function createListener(_0x2f929e,_0xe24563){return function(_0x58319f){_0xe24563[_0xb0c8('0x2')](_0x2f929e,_0x58319f);};}function removeListener(_0x2b1286,_0x1cb789){return function(){WhatsappMessageEvents['removeListener'](_0x2b1286,_0x1cb789);};}exports[_0xb0c8('0x3')]=function(_0x2c41f1){for(var _0x54c2ff=0x0,_0x15b261=events[_0xb0c8('0x4')];_0x54c2ff<_0x15b261;_0x54c2ff++){var _0x4b1b28=events[_0x54c2ff];var _0x2df031=createListener('whatsappMessage:'+_0x4b1b28,_0x2c41f1);WhatsappMessageEvents['on'](_0x4b1b28,_0x2df031);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 357c4f5..58a2b31 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 _0xd43b=['index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','post','create','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x323f7e,_0x46e1d3){var _0x2b5fa4=function(_0xa9335a){while(--_0xa9335a){_0x323f7e['push'](_0x323f7e['shift']());}};_0x2b5fa4(++_0x46e1d3);}(_0xd43b,0x1c7));var _0xbd43=function(_0x56e4dd,_0xd02777){_0x56e4dd=_0x56e4dd-0x0;var _0x4cced5=_0xd43b[_0x56e4dd];return _0x4cced5;};'use strict';var multer=require(_0xbd43('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbd43('0x1'));var express=require('express');var router=express[_0xbd43('0x2')]();var fs_extra=require(_0xbd43('0x3'));var auth=require(_0xbd43('0x4'));var interaction=require(_0xbd43('0x5'));var config=require(_0xbd43('0x6'));var controller=require('./whatsappQueue.controller');router[_0xbd43('0x7')]('/',auth[_0xbd43('0x8')](),controller[_0xbd43('0x9')]);router['get'](_0xbd43('0xa'),auth[_0xbd43('0x8')](),controller[_0xbd43('0xb')]);router['get']('/:id',auth[_0xbd43('0x8')](),controller[_0xbd43('0xc')]);router[_0xbd43('0x7')](_0xbd43('0xd'),auth['isAuthenticated'](),controller[_0xbd43('0xe')]);router['get'](_0xbd43('0xf'),auth[_0xbd43('0x8')](),controller[_0xbd43('0x10')]);router[_0xbd43('0x7')]('/:id/users',auth[_0xbd43('0x8')](),controller['getAgents']);router[_0xbd43('0x11')]('/',auth[_0xbd43('0x8')](),controller[_0xbd43('0x12')]);router['post'](_0xbd43('0xf'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0xbd43('0x13'),auth[_0xbd43('0x8')](),controller[_0xbd43('0x14')]);router[_0xbd43('0x15')](_0xbd43('0x16'),auth[_0xbd43('0x8')](),controller[_0xbd43('0x17')]);router[_0xbd43('0x18')](_0xbd43('0x16'),auth[_0xbd43('0x8')](),controller[_0xbd43('0x19')]);router[_0xbd43('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0xbd43('0x1a')]);router['delete'](_0xbd43('0x13'),auth['isAuthenticated'](),controller[_0xbd43('0x1b')]);module[_0xbd43('0x1c')]=router; \ No newline at end of file +var _0x43ef=['update','delete','destroy','removeTeams','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','/:id'];(function(_0x4cf1e5,_0x4f6889){var _0x4c652b=function(_0x565517){while(--_0x565517){_0x4cf1e5['push'](_0x4cf1e5['shift']());}};_0x4c652b(++_0x4f6889);}(_0x43ef,0x19a));var _0xf43e=function(_0x3335b0,_0x1cf411){_0x3335b0=_0x3335b0-0x0;var _0x3c4ef0=_0x43ef[_0x3335b0];return _0x3c4ef0;};'use strict';var multer=require(_0xf43e('0x0'));var util=require(_0xf43e('0x1'));var path=require('path');var timeout=require(_0xf43e('0x2'));var express=require(_0xf43e('0x3'));var router=express[_0xf43e('0x4')]();var fs_extra=require(_0xf43e('0x5'));var auth=require(_0xf43e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf43e('0x7'));var controller=require('./whatsappQueue.controller');router[_0xf43e('0x8')]('/',auth[_0xf43e('0x9')](),controller[_0xf43e('0xa')]);router[_0xf43e('0x8')]('/describe',auth[_0xf43e('0x9')](),controller[_0xf43e('0xb')]);router[_0xf43e('0x8')]('/:id',auth[_0xf43e('0x9')](),controller[_0xf43e('0xc')]);router['get'](_0xf43e('0xd'),auth['isAuthenticated'](),controller[_0xf43e('0xe')]);router['get'](_0xf43e('0xf'),auth[_0xf43e('0x9')](),controller['getTeams']);router['get'](_0xf43e('0x10'),auth[_0xf43e('0x9')](),controller[_0xf43e('0x11')]);router[_0xf43e('0x12')]('/',auth[_0xf43e('0x9')](),controller[_0xf43e('0x13')]);router[_0xf43e('0x12')](_0xf43e('0xf'),auth['isAuthenticated'](),controller['addTeams']);router[_0xf43e('0x12')](_0xf43e('0x10'),auth[_0xf43e('0x9')](),controller[_0xf43e('0x14')]);router['put'](_0xf43e('0x15'),auth['isAuthenticated'](),controller[_0xf43e('0x16')]);router[_0xf43e('0x17')](_0xf43e('0x15'),auth['isAuthenticated'](),controller[_0xf43e('0x18')]);router[_0xf43e('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0xf43e('0x19')]);router[_0xf43e('0x17')](_0xf43e('0x10'),auth[_0xf43e('0x9')](),controller['removeAgents']);module[_0xf43e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 1e5f6b8..0a1d26a 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 _0x7d13=['beepall','roundrobin','STRING','exports','name','ENUM','rrmemory'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x7d13,0x6c));var _0x37d1=function(_0xf1dbd8,_0x1cb2e1){_0xf1dbd8=_0xf1dbd8-0x0;var _0x5ee4be=_0x7d13[_0xf1dbd8];return _0x5ee4be;};'use strict';var Sequelize=require('sequelize');module[_0x37d1('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x37d1('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x37d1('0x2')](_0x37d1('0x3'),_0x37d1('0x4'),_0x37d1('0x5'))},'description':{'type':Sequelize[_0x37d1('0x6')]}}; \ No newline at end of file +var _0xd957=['beepall','roundrobin','STRING','sequelize','exports','name','INTEGER','rrmemory'];(function(_0x1a3e23,_0xce45e){var _0x5ee0d8=function(_0x4b932f){while(--_0x4b932f){_0x1a3e23['push'](_0x1a3e23['shift']());}};_0x5ee0d8(++_0xce45e);}(_0xd957,0x153));var _0x7d95=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd957[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x7d95('0x0'));module[_0x7d95('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7d95('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x7d95('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7d95('0x4'),_0x7d95('0x5'),_0x7d95('0x6'))},'description':{'type':Sequelize[_0x7d95('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 11a91ed..cf5fc87 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 _0x9940=['compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','update','then','destroy','get','WhatsappQueues','UserProfileResource','end','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','catch','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','UserId','agent','whatsappPause','createdAt','format','%s/%s','updatedAt','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union'];(function(_0x46b7d8,_0x59b9d9){var _0x366f45=function(_0xdcde22){while(--_0xdcde22){_0x46b7d8['push'](_0x46b7d8['shift']());}};_0x366f45(++_0x59b9d9);}(_0x9940,0x127));var _0x0994=function(_0x307928,_0x3a8261){_0x307928=_0x307928-0x0;var _0x5515e8=_0x9940[_0x307928];return _0x5515e8;};'use strict';var emlformat=require(_0x0994('0x0'));var rimraf=require(_0x0994('0x1'));var zipdir=require(_0x0994('0x2'));var jsonpatch=require(_0x0994('0x3'));var rp=require(_0x0994('0x4'));var moment=require(_0x0994('0x5'));var BPromise=require(_0x0994('0x6'));var Mustache=require(_0x0994('0x7'));var util=require(_0x0994('0x8'));var path=require(_0x0994('0x9'));var sox=require(_0x0994('0xa'));var csv=require(_0x0994('0xb'));var ejs=require(_0x0994('0xc'));var fs=require('fs');var fs_extra=require(_0x0994('0xd'));var _=require('lodash');var squel=require(_0x0994('0xe'));var crypto=require(_0x0994('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x0994('0x10'));var toCsv=require(_0x0994('0xb'));var querystring=require(_0x0994('0x11'));var Papa=require(_0x0994('0x12'));var Redis=require(_0x0994('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0994('0x14'));var as=require(_0x0994('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0994('0x16'))(_0x0994('0x17'));var utils=require(_0x0994('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0994('0x19'));var db=require(_0x0994('0x1a'))['db'];config[_0x0994('0x1b')]=_[_0x0994('0x1c')](config[_0x0994('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x0994('0x1d'))(new Redis(config[_0x0994('0x1b')]));require(_0x0994('0x1e'))[_0x0994('0x1f')](socket);function respondWithStatusCode(_0x282429,_0x37a7f2){_0x37a7f2=_0x37a7f2||0xcc;return function(_0x40bbb7){if(_0x40bbb7){return _0x282429[_0x0994('0x20')](_0x37a7f2);}return _0x282429[_0x0994('0x21')](_0x37a7f2)['end']();};}function respondWithResult(_0x19987d,_0x4db394){_0x4db394=_0x4db394||0xc8;return function(_0x58159d){if(_0x58159d){return _0x19987d[_0x0994('0x21')](_0x4db394)[_0x0994('0x22')](_0x58159d);}};}function respondWithFilteredResult(_0x331de2,_0x3b0a6b){return function(_0x2acf95){if(_0x2acf95){var _0x440620=typeof _0x3b0a6b[_0x0994('0x23')]==='undefined'&&typeof _0x3b0a6b[_0x0994('0x24')]==='undefined';var _0x1a8960=_0x2acf95['count'];var _0x13a7aa=_0x440620?0x0:_0x3b0a6b['offset'];var _0x162ef8=_0x440620?_0x2acf95[_0x0994('0x25')]:_0x3b0a6b['offset']+_0x3b0a6b[_0x0994('0x24')];var _0x10eb15;if(_0x162ef8>=_0x1a8960){_0x162ef8=_0x1a8960;_0x10eb15=0xc8;}else{_0x10eb15=0xce;}_0x331de2[_0x0994('0x21')](_0x10eb15);return _0x331de2[_0x0994('0x26')](_0x0994('0x27'),_0x13a7aa+'-'+_0x162ef8+'/'+_0x1a8960)[_0x0994('0x22')](_0x2acf95);}return null;};}function patchUpdates(_0x174866){return function(_0x3c400c){try{jsonpatch['apply'](_0x3c400c,_0x174866,!![]);}catch(_0xbd7d16){return BPromise[_0x0994('0x28')](_0xbd7d16);}return _0x3c400c['save']();};}function saveUpdates(_0x4b9160,_0x5b44a0){return function(_0x5e2d85){if(_0x5e2d85){return _0x5e2d85[_0x0994('0x29')](_0x4b9160)[_0x0994('0x2a')](function(_0x52d879){return _0x52d879;});}return null;};}function removeEntity(_0x4b1eef,_0x2bd678){return function(_0x218bee){if(_0x218bee){return _0x218bee[_0x0994('0x2b')]()[_0x0994('0x2a')](function(){var _0x109080=_0x218bee[_0x0994('0x2c')]({'plain':!![]});var _0x31a2b0=_0x0994('0x2d');return db[_0x0994('0x2e')][_0x0994('0x2b')]({'where':{'type':_0x31a2b0,'resourceId':_0x109080['id']}})['then'](function(){return _0x218bee;});})[_0x0994('0x2a')](function(){_0x4b1eef[_0x0994('0x21')](0xcc)[_0x0994('0x2f')]();});}};}function handleEntityNotFound(_0x2729e3,_0x115c53){return function(_0x378fcf){if(!_0x378fcf){_0x2729e3['sendStatus'](0x194);}return _0x378fcf;};}function handleError(_0x9acaaa,_0xf9f468){_0xf9f468=_0xf9f468||0x1f4;return function(_0x75be1e){logger[_0x0994('0x30')](_0x75be1e[_0x0994('0x31')]);if(_0x75be1e[_0x0994('0x32')]){delete _0x75be1e['name'];}_0x9acaaa[_0x0994('0x21')](_0xf9f468)[_0x0994('0x33')](_0x75be1e);};}exports[_0x0994('0x34')]=function(_0x1a635f,_0xb637ff){var _0x42bb2d={},_0x221a65={},_0x198dae={'count':0x0,'rows':[]};var _0xe36152=_[_0x0994('0x35')](db[_0x0994('0x36')][_0x0994('0x37')],function(_0x31a393){return{'name':_0x31a393[_0x0994('0x38')],'type':_0x31a393['type']['key']};});_0x221a65[_0x0994('0x39')]=_[_0x0994('0x35')](_0xe36152,_0x0994('0x32'));_0x221a65['query']=_[_0x0994('0x3a')](_0x1a635f[_0x0994('0x3b')]);_0x221a65[_0x0994('0x3c')]=_[_0x0994('0x3d')](_0x221a65[_0x0994('0x39')],_0x221a65[_0x0994('0x3b')]);_0x42bb2d[_0x0994('0x3e')]=_['intersection'](_0x221a65[_0x0994('0x39')],qs[_0x0994('0x3f')](_0x1a635f[_0x0994('0x3b')]['fields']));_0x42bb2d[_0x0994('0x3e')]=_0x42bb2d[_0x0994('0x3e')]['length']?_0x42bb2d[_0x0994('0x3e')]:_0x221a65[_0x0994('0x39')];if(!_0x1a635f[_0x0994('0x3b')][_0x0994('0x40')](_0x0994('0x41'))){_0x42bb2d[_0x0994('0x24')]=qs['limit'](_0x1a635f[_0x0994('0x3b')][_0x0994('0x24')]);_0x42bb2d['offset']=qs[_0x0994('0x23')](_0x1a635f[_0x0994('0x3b')][_0x0994('0x23')]);}_0x42bb2d[_0x0994('0x42')]=qs[_0x0994('0x43')](_0x1a635f[_0x0994('0x3b')][_0x0994('0x43')]);_0x42bb2d[_0x0994('0x44')]=qs[_0x0994('0x3c')](_[_0x0994('0x45')](_0x1a635f[_0x0994('0x3b')],_0x221a65['filters']),_0xe36152);if(_0x1a635f['query'][_0x0994('0x46')]){_0x42bb2d['where']=_[_0x0994('0x47')](_0x42bb2d['where'],{'$or':_[_0x0994('0x35')](_0xe36152,function(_0x5cb542){if(_0x5cb542[_0x0994('0x48')]!=='VIRTUAL'){var _0x4c10f1={};_0x4c10f1[_0x5cb542[_0x0994('0x32')]]={'$like':'%'+_0x1a635f[_0x0994('0x3b')][_0x0994('0x46')]+'%'};return _0x4c10f1;}})});}_0x42bb2d=_[_0x0994('0x47')]({},_0x42bb2d,_0x1a635f[_0x0994('0x49')]);var _0x80bd19={'where':_0x42bb2d[_0x0994('0x44')]};return db['WhatsappQueue'][_0x0994('0x25')](_0x80bd19)['then'](function(_0xa274a7){_0x198dae[_0x0994('0x25')]=_0xa274a7;if(_0x1a635f[_0x0994('0x3b')][_0x0994('0x4a')]){_0x42bb2d[_0x0994('0x4b')]=[{'all':!![]}];}return db[_0x0994('0x36')][_0x0994('0x4c')](_0x42bb2d);})[_0x0994('0x2a')](function(_0x7cbb31){_0x198dae[_0x0994('0x4d')]=_0x7cbb31;return _0x198dae;})[_0x0994('0x2a')](respondWithFilteredResult(_0xb637ff,_0x42bb2d))['catch'](handleError(_0xb637ff,null));};exports[_0x0994('0x4e')]=function(_0xa615af,_0x190f8a){var _0x418383={'raw':!![],'where':{'id':_0xa615af[_0x0994('0x4f')]['id']}},_0x316bfe={};_0x316bfe['model']=_[_0x0994('0x3a')](db['WhatsappQueue']['rawAttributes']);_0x316bfe['query']=_['keys'](_0xa615af[_0x0994('0x3b')]);_0x316bfe[_0x0994('0x3c')]=_[_0x0994('0x3d')](_0x316bfe[_0x0994('0x39')],_0x316bfe[_0x0994('0x3b')]);_0x418383[_0x0994('0x3e')]=_[_0x0994('0x3d')](_0x316bfe[_0x0994('0x39')],qs[_0x0994('0x3f')](_0xa615af[_0x0994('0x3b')][_0x0994('0x3f')]));_0x418383['attributes']=_0x418383[_0x0994('0x3e')][_0x0994('0x50')]?_0x418383[_0x0994('0x3e')]:_0x316bfe[_0x0994('0x39')];if(_0xa615af[_0x0994('0x3b')]['includeAll']){_0x418383[_0x0994('0x4b')]=[{'all':!![]}];}_0x418383=_['merge']({},_0x418383,_0xa615af['options']);return db[_0x0994('0x36')]['find'](_0x418383)[_0x0994('0x2a')](handleEntityNotFound(_0x190f8a,null))['then'](respondWithResult(_0x190f8a,null))['catch'](handleError(_0x190f8a,null));};exports[_0x0994('0x51')]=function(_0x53ceb,_0x532f3e){return db[_0x0994('0x36')][_0x0994('0x51')](_0x53ceb[_0x0994('0x52')],{})[_0x0994('0x2a')](function(_0x125a80){var _0x12992d=_0x53ceb[_0x0994('0x53')][_0x0994('0x2c')]({'plain':!![]});if(!_0x12992d)throw new Error(_0x0994('0x54'));if(_0x12992d[_0x0994('0x55')]===_0x0994('0x53')){var _0x19217b=_0x125a80[_0x0994('0x2c')]({'plain':!![]});var _0xea02dd='WhatsappQueues';return db['UserProfileSection'][_0x0994('0x56')]({'where':{'name':_0xea02dd,'userProfileId':_0x12992d[_0x0994('0x57')]},'raw':!![]})[_0x0994('0x2a')](function(_0x15fa24){if(_0x15fa24&&_0x15fa24[_0x0994('0x58')]===0x0){return db[_0x0994('0x2e')][_0x0994('0x51')]({'name':_0x19217b[_0x0994('0x32')],'resourceId':_0x19217b['id'],'type':_0x15fa24[_0x0994('0x32')],'sectionId':_0x15fa24['id']},{})[_0x0994('0x2a')](function(){return _0x125a80;});}else{return _0x125a80;}})[_0x0994('0x59')](function(_0x5c9644){logger[_0x0994('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c9644);throw _0x5c9644;});}return _0x125a80;})[_0x0994('0x2a')](respondWithResult(_0x532f3e,0xc9))[_0x0994('0x59')](handleError(_0x532f3e,null));};exports['update']=function(_0x1eb6de,_0x4df5e0){if(_0x1eb6de['body']['id']){delete _0x1eb6de[_0x0994('0x52')]['id'];}return db['WhatsappQueue'][_0x0994('0x56')]({'where':{'id':_0x1eb6de[_0x0994('0x4f')]['id']}})[_0x0994('0x2a')](handleEntityNotFound(_0x4df5e0,null))[_0x0994('0x2a')](saveUpdates(_0x1eb6de['body'],null))[_0x0994('0x2a')](respondWithResult(_0x4df5e0,null))[_0x0994('0x59')](handleError(_0x4df5e0,null));};exports[_0x0994('0x2b')]=function(_0x5ed9ba,_0x52b98c){return db[_0x0994('0x36')][_0x0994('0x56')]({'where':{'id':_0x5ed9ba['params']['id']}})['then'](handleEntityNotFound(_0x52b98c,null))[_0x0994('0x2a')](removeEntity(_0x52b98c,null))[_0x0994('0x59')](handleError(_0x52b98c,null));};exports['describe']=function(_0xbd951,_0x50941b){return db[_0x0994('0x36')][_0x0994('0x5a')]()['then'](respondWithResult(_0x50941b,null))[_0x0994('0x59')](handleError(_0x50941b,null));};exports[_0x0994('0x5b')]=function(_0x32c665,_0x18d1e5,_0x5a78df){var _0x5e9d01={'raw':!![],'where':{}},_0x468055={},_0x5ed541;return db[_0x0994('0x36')][_0x0994('0x5c')]({'where':{'id':_0x32c665[_0x0994('0x4f')]['id']}})[_0x0994('0x2a')](handleEntityNotFound(_0x18d1e5,null))[_0x0994('0x2a')](function(_0x1109ba){if(_0x1109ba){_0x5ed541=_0x1109ba['get']({'plain':!![]});_0x468055[_0x0994('0x39')]=_[_0x0994('0x3a')](db[_0x0994('0x5d')]['rawAttributes']);_0x468055[_0x0994('0x3b')]=_[_0x0994('0x3a')](_0x32c665[_0x0994('0x3b')]);_0x468055['filters']=_[_0x0994('0x3d')](_0x468055['model'],_0x468055[_0x0994('0x3b')]);_0x5e9d01[_0x0994('0x3e')]=_[_0x0994('0x3d')](_0x468055[_0x0994('0x39')],qs[_0x0994('0x3f')](_0x32c665[_0x0994('0x3b')][_0x0994('0x3f')]));_0x5e9d01['attributes']=_0x5e9d01['attributes'][_0x0994('0x50')]?_0x5e9d01['attributes']:_0x468055[_0x0994('0x39')];if(!_0x32c665['query'][_0x0994('0x40')](_0x0994('0x41'))){_0x5e9d01[_0x0994('0x24')]=qs[_0x0994('0x24')](_0x32c665['query'][_0x0994('0x24')]);_0x5e9d01[_0x0994('0x23')]=qs[_0x0994('0x23')](_0x32c665[_0x0994('0x3b')][_0x0994('0x23')]);}_0x5e9d01[_0x0994('0x42')]=qs['sort'](_0x32c665[_0x0994('0x3b')][_0x0994('0x43')]);_0x5e9d01[_0x0994('0x44')]=qs['filters'](_[_0x0994('0x45')](_0x32c665['query'],_0x468055['filters']));_0x5e9d01[_0x0994('0x44')][_0x0994('0x5e')]=_0x1109ba['id'];if(_0x32c665[_0x0994('0x3b')]['filter']){_0x5e9d01['where']=_[_0x0994('0x47')](_0x5e9d01[_0x0994('0x44')],{'$or':_[_0x0994('0x35')](_0x5e9d01['attributes'],function(_0x5b873c){var _0x407a09={};_0x407a09[_0x5b873c]={'$like':'%'+_0x32c665[_0x0994('0x3b')][_0x0994('0x46')]+'%'};return _0x407a09;})});}_0x5e9d01=_[_0x0994('0x47')]({},_0x5e9d01,_0x32c665[_0x0994('0x49')]);return db[_0x0994('0x5d')][_0x0994('0x4c')](_0x5e9d01);}})[_0x0994('0x2a')](function(_0x17dc2a){if(_0x17dc2a){return db[_0x0994('0x5f')]['findAndCountAll']({'where':{'id':_[_0x0994('0x35')](_0x17dc2a,_0x0994('0x60')),'role':_0x0994('0x61')},'attributes':['id','name',_0x0994('0x62'),'updatedAt',_0x0994('0x63')]});}})['then'](function(_0x480c06){if(_0x480c06){return{'count':_0x480c06[_0x0994('0x25')],'rows':_[_0x0994('0x35')](_0x480c06[_0x0994('0x4d')],function(_0x116a12){return{'membername':_0x116a12[_0x0994('0x32')],'UserId':_0x116a12['id'],'queue_name':_0x5ed541[_0x0994('0x32')],'WhatsappQueueId':_0x5ed541['id'],'interface':util[_0x0994('0x64')](_0x0994('0x65'),'SIP',_0x116a12[_0x0994('0x32')]),'penalty':0x0,'paused':_0x116a12[_0x0994('0x62')],'createdAt':_0x116a12['createdAt'],'updatedAt':_0x116a12[_0x0994('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0994('0x2a')](respondWithFilteredResult(_0x18d1e5,_0x5e9d01))[_0x0994('0x59')](handleError(_0x18d1e5,null));};exports[_0x0994('0x67')]=function(_0x1c6d3f,_0x154ce6,_0x4f2323){var _0x4cdcab={};var _0x5da865={};var _0x8f0706;var _0x3667d4;return db[_0x0994('0x36')][_0x0994('0x5c')]({'where':{'id':_0x1c6d3f[_0x0994('0x4f')]['id']}})[_0x0994('0x2a')](handleEntityNotFound(_0x154ce6,null))[_0x0994('0x2a')](function(_0x19f1be){if(_0x19f1be){_0x8f0706=_0x19f1be;_0x5da865['model']=_[_0x0994('0x3a')](db['Team'][_0x0994('0x37')]);_0x5da865[_0x0994('0x3b')]=_['keys'](_0x1c6d3f[_0x0994('0x3b')]);_0x5da865[_0x0994('0x3c')]=_[_0x0994('0x3d')](_0x5da865[_0x0994('0x39')],_0x5da865[_0x0994('0x3b')]);_0x4cdcab[_0x0994('0x3e')]=_[_0x0994('0x3d')](_0x5da865[_0x0994('0x39')],qs[_0x0994('0x3f')](_0x1c6d3f[_0x0994('0x3b')][_0x0994('0x3f')]));_0x4cdcab[_0x0994('0x3e')]=_0x4cdcab[_0x0994('0x3e')][_0x0994('0x50')]?_0x4cdcab[_0x0994('0x3e')]:_0x5da865[_0x0994('0x39')];_0x4cdcab[_0x0994('0x42')]=qs[_0x0994('0x43')](_0x1c6d3f[_0x0994('0x3b')][_0x0994('0x43')]);_0x4cdcab['where']=qs['filters'](_[_0x0994('0x45')](_0x1c6d3f[_0x0994('0x3b')],_0x5da865['filters']));if(_0x1c6d3f[_0x0994('0x3b')]['filter']){_0x4cdcab['where']=_['merge'](_0x4cdcab[_0x0994('0x44')],{'$or':_[_0x0994('0x35')](_0x4cdcab['attributes'],function(_0x5167d2){var _0x348611={};_0x348611[_0x5167d2]={'$like':'%'+_0x1c6d3f[_0x0994('0x3b')][_0x0994('0x46')]+'%'};return _0x348611;})});}_0x4cdcab=_[_0x0994('0x47')]({},_0x4cdcab,_0x1c6d3f[_0x0994('0x49')]);return _0x8f0706[_0x0994('0x67')](_0x4cdcab);}})['then'](function(_0x23a155){if(_0x23a155){_0x3667d4=_0x23a155[_0x0994('0x50')];if(!_0x1c6d3f[_0x0994('0x3b')]['hasOwnProperty']('nolimit')){_0x4cdcab['limit']=qs[_0x0994('0x24')](_0x1c6d3f[_0x0994('0x3b')][_0x0994('0x24')]);_0x4cdcab[_0x0994('0x23')]=qs[_0x0994('0x23')](_0x1c6d3f[_0x0994('0x3b')]['offset']);}return _0x8f0706['getTeams'](_0x4cdcab);}})[_0x0994('0x2a')](function(_0x177ab9){if(_0x177ab9){return _0x177ab9?{'count':_0x3667d4,'rows':_0x177ab9}:null;}})[_0x0994('0x2a')](respondWithResult(_0x154ce6,null))[_0x0994('0x59')](handleError(_0x154ce6,null));};exports[_0x0994('0x68')]=function(_0x45f2de,_0x46a222,_0x3156e3){var _0x4aa955=_0x45f2de[_0x0994('0x52')][_0x0994('0x69')];return db[_0x0994('0x6a')][_0x0994('0x4c')]({'where':{'id':_0x4aa955},'attributes':['id'],'include':[{'model':db[_0x0994('0x5f')],'as':_0x0994('0x6b'),'attributes':['id',_0x0994('0x32'),'online',_0x0994('0x6c'),_0x0994('0x6d')],'raw':!![]}]})['then'](function(_0x1817ff){if(_0x1817ff){var _0x2f291e=_[_0x0994('0x6e')](_0x1817ff,function(_0x4aee53){var _0x2b8f80=_0x4aee53[_0x0994('0x2c')]({'plain':!![]});return _0x2b8f80['Agents'];});return db[_0x0994('0x36')]['find']({'where':{'id':_0x45f2de['params']['id']}})[_0x0994('0x2a')](function(_0x144bd8){return db[_0x0994('0x6f')][_0x0994('0x70')](function(_0x502d4a){return _0x144bd8['addTeams'](_0x4aa955,{'transaction':_0x502d4a})[_0x0994('0x2a')](function(){return BPromise[_0x0994('0x71')](_0x2f291e,function(_0x47913c){return db['UserWhatsappQueue'][_0x0994('0x72')]({'where':{'UserId':_0x47913c['id'],'WhatsappQueueId':_0x45f2de[_0x0994('0x4f')]['id']},'transaction':_0x502d4a});});})[_0x0994('0x2a')](function(){_0x2f291e[_0x0994('0x73')](function(_0x3171b8){socket[_0x0994('0x74')]('userWhatsappQueue:save',{'UserId':_0x3171b8['id'],'WhatsappQueueId':_0x144bd8['id']});});});});});}})['then'](respondWithStatusCode(_0x46a222,null))[_0x0994('0x59')](handleError(_0x46a222,null));};exports[_0x0994('0x75')]=function(_0x3b21b6,_0x2d0588,_0x1e94ea){return db[_0x0994('0x6a')][_0x0994('0x4c')]({'where':{'id':_0x3b21b6[_0x0994('0x3b')][_0x0994('0x69')]},'attributes':['id'],'include':[{'model':db[_0x0994('0x5f')],'as':_0x0994('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x0994('0x2a')](handleEntityNotFound(_0x2d0588,null))['then'](function(_0x2212fa){var _0x4f939d=_[_0x0994('0x35')](_0x2212fa,'id');var _0x4905a9=[];var _0x177c6f=[];var _0x3666c2=squel[_0x0994('0x76')]();_0x3666c2[_0x0994('0x77')](_0x0994('0x78'))['from'](_0x0994('0x79'),'tq')[_0x0994('0x7a')](_0x0994('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0994('0x44')](_0x0994('0x7c'),_0x3b21b6['params']['id']);for(var _0x58e100=0x0;_0x58e100<_0x2212fa['length'];_0x58e100+=0x1){let _0x4583a5=_0x2212fa[_0x58e100];for(var _0x374fb0=0x0;_0x374fb0<_0x4583a5[_0x0994('0x6b')][_0x0994('0x50')];_0x374fb0+=0x1){let _0x334581=_0x4583a5[_0x0994('0x6b')][_0x374fb0];var _0x5bbe99=_0x3666c2[_0x0994('0x7d')]();_0x5bbe99['where'](_0x0994('0x7e'),_0x334581['id']);_0x177c6f['push'](db[_0x0994('0x6f')][_0x0994('0x3b')](_0x5bbe99[_0x0994('0x7f')](),{'type':db[_0x0994('0x6f')][_0x0994('0x80')][_0x0994('0x81')]})['then'](function(_0x27cb48){if(_0x27cb48[_0x0994('0x50')]===0x1){return _0x334581['id'];}else{var _0x27644c=_[_0x0994('0x82')](_[_0x0994('0x35')](_0x27cb48,_0x0994('0x83')),function(_0x21544c){return _[_0x0994('0x84')](_0x4f939d,_0x21544c);});if(_0x27644c){return _0x334581['id'];}}}));}}return BPromise['all'](_0x177c6f)[_0x0994('0x2a')](function(_0x2b3102){_0x4905a9=_(_0x4905a9)[_0x0994('0x85')](_0x2b3102)[_0x0994('0x86')]()[_0x0994('0x87')]();return db[_0x0994('0x36')]['find']({'where':{'id':_0x3b21b6[_0x0994('0x4f')]['id']}})[_0x0994('0x2a')](function(_0x1d09bc){return db[_0x0994('0x6f')][_0x0994('0x70')](function(_0x5030a8){return _0x1d09bc[_0x0994('0x75')](_0x3b21b6[_0x0994('0x3b')]['ids'],{'transaction':_0x5030a8})[_0x0994('0x2a')](function(){if(!_[_0x0994('0x88')](_0x4905a9)){return _0x1d09bc[_0x0994('0x89')](_0x4905a9,{'transaction':_0x5030a8});}})[_0x0994('0x2a')](function(){_0x4905a9[_0x0994('0x73')](function(_0x3e2978){socket[_0x0994('0x74')](_0x0994('0x8a'),{'UserId':_0x3e2978,'WhatsappQueueId':_0x1d09bc['id']});});});});});});})[_0x0994('0x2a')](respondWithStatusCode(_0x2d0588,null))['catch'](handleError(_0x2d0588,null));};exports[_0x0994('0x8b')]=function(_0xdba983,_0x650415,_0x212a74){return db[_0x0994('0x36')][_0x0994('0x56')]({'where':{'id':_0xdba983[_0x0994('0x4f')]['id']}})[_0x0994('0x2a')](handleEntityNotFound(_0x650415,null))['then'](function(_0x273855){if(_0x273855){return _0x273855[_0x0994('0x8b')](_0xdba983[_0x0994('0x52')][_0x0994('0x69')],_[_0x0994('0x8c')](_0xdba983[_0x0994('0x52')],[_0x0994('0x69'),'id'])||{})[_0x0994('0x8d')](function(_0x259e3e){for(var _0x1856c9=0x0;_0x1856c9<_0xdba983[_0x0994('0x52')][_0x0994('0x69')][_0x0994('0x50')];_0x1856c9+=0x1){socket[_0x0994('0x74')]('userWhatsappQueue:save',{'UserId':Number(_0xdba983[_0x0994('0x52')]['ids'][_0x1856c9]),'WhatsappQueueId':Number(_0xdba983[_0x0994('0x4f')]['id'])});}return _0x259e3e;});}})['then'](respondWithResult(_0x650415,null))[_0x0994('0x59')](handleError(_0x650415,null));};exports[_0x0994('0x89')]=function(_0x6406f9,_0x74ac04,_0x12e73b){return db['WhatsappQueue'][_0x0994('0x56')]({'where':{'id':_0x6406f9[_0x0994('0x4f')]['id']}})[_0x0994('0x2a')](handleEntityNotFound(_0x74ac04,null))[_0x0994('0x2a')](function(_0x478271){if(_0x478271){return _0x478271[_0x0994('0x89')](_0x6406f9['query']['ids'])[_0x0994('0x2a')](function(){if(_['isArray'](_0x6406f9['query'][_0x0994('0x69')])){for(var _0x4aeae1=0x0;_0x4aeae1<_0x6406f9['query'][_0x0994('0x69')]['length'];_0x4aeae1+=0x1){socket[_0x0994('0x74')](_0x0994('0x8a'),{'UserId':Number(_0x6406f9['query'][_0x0994('0x69')][_0x4aeae1]),'WhatsappQueueId':Number(_0x6406f9[_0x0994('0x4f')]['id'])});}}else{socket[_0x0994('0x74')](_0x0994('0x8a'),{'UserId':Number(_0x6406f9[_0x0994('0x3b')][_0x0994('0x69')]),'WhatsappQueueId':Number(_0x6406f9[_0x0994('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x74ac04,null))['catch'](handleError(_0x74ac04,null));};exports[_0x0994('0x8e')]=function(_0x1f790b,_0x3c8cc7,_0x22d467){var _0x1c9d49={};var _0x3402a1={};var _0x2db0ae;var _0x3d71a8;return db['WhatsappQueue']['findOne']({'where':{'id':_0x1f790b[_0x0994('0x4f')]['id']}})[_0x0994('0x2a')](handleEntityNotFound(_0x3c8cc7,null))[_0x0994('0x2a')](function(_0x567cfe){if(_0x567cfe){_0x2db0ae=_0x567cfe;_0x3402a1[_0x0994('0x39')]=_[_0x0994('0x3a')](db['User'][_0x0994('0x37')]);_0x3402a1[_0x0994('0x3b')]=_[_0x0994('0x3a')](_0x1f790b['query']);_0x3402a1[_0x0994('0x3c')]=_[_0x0994('0x3d')](_0x3402a1[_0x0994('0x39')],_0x3402a1['query']);_0x1c9d49[_0x0994('0x3e')]=_[_0x0994('0x3d')](_0x3402a1[_0x0994('0x39')],qs[_0x0994('0x3f')](_0x1f790b[_0x0994('0x3b')][_0x0994('0x3f')]));_0x1c9d49[_0x0994('0x3e')]=_0x1c9d49[_0x0994('0x3e')][_0x0994('0x50')]?_0x1c9d49[_0x0994('0x3e')]:_0x3402a1['model'];_0x1c9d49[_0x0994('0x42')]=qs[_0x0994('0x43')](_0x1f790b[_0x0994('0x3b')]['sort']);_0x1c9d49['where']=qs[_0x0994('0x3c')](_[_0x0994('0x45')](_0x1f790b['query'],_0x3402a1[_0x0994('0x3c')]));if(_0x1f790b[_0x0994('0x3b')][_0x0994('0x46')]){_0x1c9d49['where']=_[_0x0994('0x47')](_0x1c9d49[_0x0994('0x44')],{'$or':_[_0x0994('0x35')](_0x1c9d49['attributes'],function(_0x20eb6f){var _0x2de37f={};_0x2de37f[_0x20eb6f]={'$like':'%'+_0x1f790b[_0x0994('0x3b')]['filter']+'%'};return _0x2de37f;})});}_0x1c9d49=_[_0x0994('0x47')]({},_0x1c9d49,_0x1f790b[_0x0994('0x49')]);return _0x2db0ae[_0x0994('0x8e')](_0x1c9d49);}})[_0x0994('0x2a')](function(_0x51a659){if(_0x51a659){_0x3d71a8=_0x51a659[_0x0994('0x50')];if(!_0x1f790b[_0x0994('0x3b')][_0x0994('0x40')](_0x0994('0x41'))){_0x1c9d49['limit']=qs[_0x0994('0x24')](_0x1f790b[_0x0994('0x3b')]['limit']);_0x1c9d49[_0x0994('0x23')]=qs[_0x0994('0x23')](_0x1f790b['query'][_0x0994('0x23')]);}return _0x2db0ae['getAgents'](_0x1c9d49);}})[_0x0994('0x2a')](function(_0x1c8dc0){if(_0x1c8dc0){return _0x1c8dc0?{'count':_0x3d71a8,'rows':_0x1c8dc0}:null;}})[_0x0994('0x2a')](respondWithResult(_0x3c8cc7,null))['catch'](handleError(_0x3c8cc7,null));}; \ No newline at end of file +var _0x70c7=['UserWhatsappQueue','rawAttributes','pick','WhatsappQueueId','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','Team','order','ids','Agents','voicePause','flatMap','addTeams','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','count','apply','reject','save','update','then','get','WhatsappQueues','UserProfileResource','end','error','name','index','map','WhatsappQueue','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','destroy','describe','getMembers','findOne'];(function(_0x217331,_0x35c4b1){var _0x21d657=function(_0x4eda2a){while(--_0x4eda2a){_0x217331['push'](_0x217331['shift']());}};_0x21d657(++_0x35c4b1);}(_0x70c7,0x14a));var _0x770c=function(_0x24f6f1,_0x2968f5){_0x24f6f1=_0x24f6f1-0x0;var _0x119467=_0x70c7[_0x24f6f1];return _0x119467;};'use strict';var emlformat=require(_0x770c('0x0'));var rimraf=require(_0x770c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x770c('0x2'));var rp=require(_0x770c('0x3'));var moment=require('moment');var BPromise=require(_0x770c('0x4'));var Mustache=require('mustache');var util=require(_0x770c('0x5'));var path=require(_0x770c('0x6'));var sox=require(_0x770c('0x7'));var csv=require(_0x770c('0x8'));var ejs=require(_0x770c('0x9'));var fs=require('fs');var fs_extra=require(_0x770c('0xa'));var _=require('lodash');var squel=require(_0x770c('0xb'));var crypto=require(_0x770c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x770c('0xd'));var toCsv=require(_0x770c('0x8'));var querystring=require(_0x770c('0xe'));var Papa=require('papaparse');var Redis=require(_0x770c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x770c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x770c('0x11'));var logger=require(_0x770c('0x12'))('api');var utils=require(_0x770c('0x13'));var config=require(_0x770c('0x14'));var licenseUtil=require(_0x770c('0x15'));var db=require('../../mysqldb')['db'];config[_0x770c('0x16')]=_[_0x770c('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x770c('0x18'))(new Redis(config[_0x770c('0x16')]));require(_0x770c('0x19'))[_0x770c('0x1a')](socket);function respondWithStatusCode(_0x47a3a3,_0x2f57f8){_0x2f57f8=_0x2f57f8||0xcc;return function(_0x4c2be5){if(_0x4c2be5){return _0x47a3a3[_0x770c('0x1b')](_0x2f57f8);}return _0x47a3a3['status'](_0x2f57f8)['end']();};}function respondWithResult(_0x2fa7c2,_0x2c217a){_0x2c217a=_0x2c217a||0xc8;return function(_0x37e0ec){if(_0x37e0ec){return _0x2fa7c2[_0x770c('0x1c')](_0x2c217a)[_0x770c('0x1d')](_0x37e0ec);}};}function respondWithFilteredResult(_0xd14c43,_0x10a22e){return function(_0x4373bd){if(_0x4373bd){var _0x26b7b9=typeof _0x10a22e[_0x770c('0x1e')]==='undefined'&&typeof _0x10a22e['limit']===_0x770c('0x1f');var _0x4a1285=_0x4373bd['count'];var _0x3586b2=_0x26b7b9?0x0:_0x10a22e['offset'];var _0x4bd0bd=_0x26b7b9?_0x4373bd[_0x770c('0x20')]:_0x10a22e[_0x770c('0x1e')]+_0x10a22e['limit'];var _0xb806db;if(_0x4bd0bd>=_0x4a1285){_0x4bd0bd=_0x4a1285;_0xb806db=0xc8;}else{_0xb806db=0xce;}_0xd14c43[_0x770c('0x1c')](_0xb806db);return _0xd14c43['set']('Content-Range',_0x3586b2+'-'+_0x4bd0bd+'/'+_0x4a1285)['json'](_0x4373bd);}return null;};}function patchUpdates(_0x433b98){return function(_0x166edd){try{jsonpatch[_0x770c('0x21')](_0x166edd,_0x433b98,!![]);}catch(_0x542fbb){return BPromise[_0x770c('0x22')](_0x542fbb);}return _0x166edd[_0x770c('0x23')]();};}function saveUpdates(_0x25d079,_0x347513){return function(_0x59a973){if(_0x59a973){return _0x59a973[_0x770c('0x24')](_0x25d079)[_0x770c('0x25')](function(_0x4b517b){return _0x4b517b;});}return null;};}function removeEntity(_0x1fd5a0,_0x384d62){return function(_0x57a86b){if(_0x57a86b){return _0x57a86b['destroy']()[_0x770c('0x25')](function(){var _0x5a4d39=_0x57a86b[_0x770c('0x26')]({'plain':!![]});var _0x27838d=_0x770c('0x27');return db[_0x770c('0x28')]['destroy']({'where':{'type':_0x27838d,'resourceId':_0x5a4d39['id']}})[_0x770c('0x25')](function(){return _0x57a86b;});})['then'](function(){_0x1fd5a0[_0x770c('0x1c')](0xcc)[_0x770c('0x29')]();});}};}function handleEntityNotFound(_0x13aa35,_0x5ef0c3){return function(_0x4fce58){if(!_0x4fce58){_0x13aa35[_0x770c('0x1b')](0x194);}return _0x4fce58;};}function handleError(_0x3d0cab,_0x4f21d4){_0x4f21d4=_0x4f21d4||0x1f4;return function(_0x37f057){logger[_0x770c('0x2a')](_0x37f057['stack']);if(_0x37f057[_0x770c('0x2b')]){delete _0x37f057['name'];}_0x3d0cab['status'](_0x4f21d4)['send'](_0x37f057);};}exports[_0x770c('0x2c')]=function(_0x299066,_0x3a1aa7){var _0x410832={},_0x39e445={},_0x23d7df={'count':0x0,'rows':[]};var _0x1e491d=_[_0x770c('0x2d')](db[_0x770c('0x2e')]['rawAttributes'],function(_0xd7533c){return{'name':_0xd7533c[_0x770c('0x2f')],'type':_0xd7533c[_0x770c('0x30')][_0x770c('0x31')]};});_0x39e445['model']=_['map'](_0x1e491d,_0x770c('0x2b'));_0x39e445[_0x770c('0x32')]=_['keys'](_0x299066[_0x770c('0x32')]);_0x39e445[_0x770c('0x33')]=_[_0x770c('0x34')](_0x39e445['model'],_0x39e445[_0x770c('0x32')]);_0x410832[_0x770c('0x35')]=_[_0x770c('0x34')](_0x39e445['model'],qs[_0x770c('0x36')](_0x299066[_0x770c('0x32')][_0x770c('0x36')]));_0x410832[_0x770c('0x35')]=_0x410832['attributes'][_0x770c('0x37')]?_0x410832[_0x770c('0x35')]:_0x39e445[_0x770c('0x38')];if(!_0x299066[_0x770c('0x32')][_0x770c('0x39')](_0x770c('0x3a'))){_0x410832[_0x770c('0x3b')]=qs[_0x770c('0x3b')](_0x299066[_0x770c('0x32')][_0x770c('0x3b')]);_0x410832[_0x770c('0x1e')]=qs[_0x770c('0x1e')](_0x299066[_0x770c('0x32')][_0x770c('0x1e')]);}_0x410832['order']=qs[_0x770c('0x3c')](_0x299066[_0x770c('0x32')][_0x770c('0x3c')]);_0x410832[_0x770c('0x3d')]=qs[_0x770c('0x33')](_['pick'](_0x299066[_0x770c('0x32')],_0x39e445[_0x770c('0x33')]),_0x1e491d);if(_0x299066[_0x770c('0x32')][_0x770c('0x3e')]){_0x410832[_0x770c('0x3d')]=_[_0x770c('0x3f')](_0x410832[_0x770c('0x3d')],{'$or':_[_0x770c('0x2d')](_0x1e491d,function(_0x4ca558){if(_0x4ca558[_0x770c('0x30')]!==_0x770c('0x40')){var _0x5217b9={};_0x5217b9[_0x4ca558[_0x770c('0x2b')]]={'$like':'%'+_0x299066[_0x770c('0x32')][_0x770c('0x3e')]+'%'};return _0x5217b9;}})});}_0x410832=_['merge']({},_0x410832,_0x299066[_0x770c('0x41')]);var _0x4821a9={'where':_0x410832[_0x770c('0x3d')]};return db[_0x770c('0x2e')][_0x770c('0x20')](_0x4821a9)[_0x770c('0x25')](function(_0x418d8b){_0x23d7df[_0x770c('0x20')]=_0x418d8b;if(_0x299066[_0x770c('0x32')][_0x770c('0x42')]){_0x410832[_0x770c('0x43')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x770c('0x44')](_0x410832);})['then'](function(_0x34e53f){_0x23d7df[_0x770c('0x45')]=_0x34e53f;return _0x23d7df;})[_0x770c('0x25')](respondWithFilteredResult(_0x3a1aa7,_0x410832))['catch'](handleError(_0x3a1aa7,null));};exports[_0x770c('0x46')]=function(_0x3b6518,_0x7cfc10){var _0x3d90bd={'raw':!![],'where':{'id':_0x3b6518[_0x770c('0x47')]['id']}},_0x19a36d={};_0x19a36d['model']=_['keys'](db[_0x770c('0x2e')]['rawAttributes']);_0x19a36d['query']=_[_0x770c('0x48')](_0x3b6518['query']);_0x19a36d[_0x770c('0x33')]=_[_0x770c('0x34')](_0x19a36d['model'],_0x19a36d[_0x770c('0x32')]);_0x3d90bd[_0x770c('0x35')]=_[_0x770c('0x34')](_0x19a36d[_0x770c('0x38')],qs[_0x770c('0x36')](_0x3b6518[_0x770c('0x32')][_0x770c('0x36')]));_0x3d90bd[_0x770c('0x35')]=_0x3d90bd[_0x770c('0x35')]['length']?_0x3d90bd['attributes']:_0x19a36d[_0x770c('0x38')];if(_0x3b6518[_0x770c('0x32')][_0x770c('0x42')]){_0x3d90bd[_0x770c('0x43')]=[{'all':!![]}];}_0x3d90bd=_['merge']({},_0x3d90bd,_0x3b6518[_0x770c('0x41')]);return db[_0x770c('0x2e')][_0x770c('0x49')](_0x3d90bd)[_0x770c('0x25')](handleEntityNotFound(_0x7cfc10,null))['then'](respondWithResult(_0x7cfc10,null))[_0x770c('0x4a')](handleError(_0x7cfc10,null));};exports[_0x770c('0x4b')]=function(_0xaaefb5,_0x5ceef5){return db[_0x770c('0x2e')][_0x770c('0x4b')](_0xaaefb5['body'],{})[_0x770c('0x25')](function(_0x2be642){var _0x332c24=_0xaaefb5[_0x770c('0x4c')]['get']({'plain':!![]});if(!_0x332c24)throw new Error(_0x770c('0x4d'));if(_0x332c24[_0x770c('0x4e')]===_0x770c('0x4c')){var _0x3a6155=_0x2be642[_0x770c('0x26')]({'plain':!![]});var _0x39bdda=_0x770c('0x27');return db[_0x770c('0x4f')][_0x770c('0x49')]({'where':{'name':_0x39bdda,'userProfileId':_0x332c24[_0x770c('0x50')]},'raw':!![]})[_0x770c('0x25')](function(_0x11e80d){if(_0x11e80d&&_0x11e80d[_0x770c('0x51')]===0x0){return db['UserProfileResource'][_0x770c('0x4b')]({'name':_0x3a6155[_0x770c('0x2b')],'resourceId':_0x3a6155['id'],'type':_0x11e80d[_0x770c('0x2b')],'sectionId':_0x11e80d['id']},{})[_0x770c('0x25')](function(){return _0x2be642;});}else{return _0x2be642;}})['catch'](function(_0x2be01f){logger[_0x770c('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2be01f);throw _0x2be01f;});}return _0x2be642;})[_0x770c('0x25')](respondWithResult(_0x5ceef5,0xc9))['catch'](handleError(_0x5ceef5,null));};exports['update']=function(_0x5080df,_0x2257b6){if(_0x5080df[_0x770c('0x52')]['id']){delete _0x5080df[_0x770c('0x52')]['id'];}return db['WhatsappQueue'][_0x770c('0x49')]({'where':{'id':_0x5080df[_0x770c('0x47')]['id']}})[_0x770c('0x25')](handleEntityNotFound(_0x2257b6,null))['then'](saveUpdates(_0x5080df[_0x770c('0x52')],null))[_0x770c('0x25')](respondWithResult(_0x2257b6,null))[_0x770c('0x4a')](handleError(_0x2257b6,null));};exports[_0x770c('0x53')]=function(_0x388663,_0x3a415b){return db[_0x770c('0x2e')]['find']({'where':{'id':_0x388663[_0x770c('0x47')]['id']}})[_0x770c('0x25')](handleEntityNotFound(_0x3a415b,null))[_0x770c('0x25')](removeEntity(_0x3a415b,null))[_0x770c('0x4a')](handleError(_0x3a415b,null));};exports[_0x770c('0x54')]=function(_0x40d956,_0x1933d4){return db[_0x770c('0x2e')][_0x770c('0x54')]()['then'](respondWithResult(_0x1933d4,null))['catch'](handleError(_0x1933d4,null));};exports[_0x770c('0x55')]=function(_0x51f259,_0x423f3e,_0x2a7577){var _0x43a72a={'raw':!![],'where':{}},_0x498288={},_0x286cf4;return db['WhatsappQueue'][_0x770c('0x56')]({'where':{'id':_0x51f259[_0x770c('0x47')]['id']}})['then'](handleEntityNotFound(_0x423f3e,null))[_0x770c('0x25')](function(_0x9e1fc6){if(_0x9e1fc6){_0x286cf4=_0x9e1fc6[_0x770c('0x26')]({'plain':!![]});_0x498288[_0x770c('0x38')]=_[_0x770c('0x48')](db[_0x770c('0x57')][_0x770c('0x58')]);_0x498288['query']=_[_0x770c('0x48')](_0x51f259[_0x770c('0x32')]);_0x498288['filters']=_['intersection'](_0x498288[_0x770c('0x38')],_0x498288['query']);_0x43a72a['attributes']=_[_0x770c('0x34')](_0x498288['model'],qs[_0x770c('0x36')](_0x51f259[_0x770c('0x32')][_0x770c('0x36')]));_0x43a72a['attributes']=_0x43a72a['attributes']['length']?_0x43a72a[_0x770c('0x35')]:_0x498288[_0x770c('0x38')];if(!_0x51f259[_0x770c('0x32')][_0x770c('0x39')]('nolimit')){_0x43a72a[_0x770c('0x3b')]=qs[_0x770c('0x3b')](_0x51f259[_0x770c('0x32')][_0x770c('0x3b')]);_0x43a72a['offset']=qs[_0x770c('0x1e')](_0x51f259[_0x770c('0x32')]['offset']);}_0x43a72a['order']=qs['sort'](_0x51f259[_0x770c('0x32')][_0x770c('0x3c')]);_0x43a72a[_0x770c('0x3d')]=qs[_0x770c('0x33')](_[_0x770c('0x59')](_0x51f259[_0x770c('0x32')],_0x498288[_0x770c('0x33')]));_0x43a72a[_0x770c('0x3d')][_0x770c('0x5a')]=_0x9e1fc6['id'];if(_0x51f259[_0x770c('0x32')][_0x770c('0x3e')]){_0x43a72a['where']=_[_0x770c('0x3f')](_0x43a72a[_0x770c('0x3d')],{'$or':_[_0x770c('0x2d')](_0x43a72a[_0x770c('0x35')],function(_0x36fdd7){var _0x29ef7b={};_0x29ef7b[_0x36fdd7]={'$like':'%'+_0x51f259[_0x770c('0x32')][_0x770c('0x3e')]+'%'};return _0x29ef7b;})});}_0x43a72a=_['merge']({},_0x43a72a,_0x51f259[_0x770c('0x41')]);return db[_0x770c('0x57')]['findAll'](_0x43a72a);}})[_0x770c('0x25')](function(_0x5079f6){if(_0x5079f6){return db[_0x770c('0x5b')][_0x770c('0x5c')]({'where':{'id':_['map'](_0x5079f6,_0x770c('0x5d')),'role':'agent'},'attributes':['id',_0x770c('0x2b'),_0x770c('0x5e'),_0x770c('0x5f'),_0x770c('0x60')]});}})[_0x770c('0x25')](function(_0x234965){if(_0x234965){return{'count':_0x234965[_0x770c('0x20')],'rows':_[_0x770c('0x2d')](_0x234965[_0x770c('0x45')],function(_0x4e7fd7){return{'membername':_0x4e7fd7[_0x770c('0x2b')],'UserId':_0x4e7fd7['id'],'queue_name':_0x286cf4[_0x770c('0x2b')],'WhatsappQueueId':_0x286cf4['id'],'interface':util[_0x770c('0x61')]('%s/%s',_0x770c('0x62'),_0x4e7fd7['name']),'penalty':0x0,'paused':_0x4e7fd7[_0x770c('0x5e')],'createdAt':_0x4e7fd7[_0x770c('0x60')],'updatedAt':_0x4e7fd7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x423f3e,_0x43a72a))[_0x770c('0x4a')](handleError(_0x423f3e,null));};exports[_0x770c('0x63')]=function(_0x3ccc24,_0x4a2e98,_0x21b9dc){var _0x5b9557={};var _0x1fa375={};var _0x1863d1;var _0x4767b6;return db[_0x770c('0x2e')][_0x770c('0x56')]({'where':{'id':_0x3ccc24[_0x770c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a2e98,null))['then'](function(_0x5ab344){if(_0x5ab344){_0x1863d1=_0x5ab344;_0x1fa375[_0x770c('0x38')]=_[_0x770c('0x48')](db[_0x770c('0x64')][_0x770c('0x58')]);_0x1fa375[_0x770c('0x32')]=_['keys'](_0x3ccc24[_0x770c('0x32')]);_0x1fa375['filters']=_[_0x770c('0x34')](_0x1fa375['model'],_0x1fa375[_0x770c('0x32')]);_0x5b9557[_0x770c('0x35')]=_[_0x770c('0x34')](_0x1fa375[_0x770c('0x38')],qs[_0x770c('0x36')](_0x3ccc24['query']['fields']));_0x5b9557[_0x770c('0x35')]=_0x5b9557[_0x770c('0x35')]['length']?_0x5b9557[_0x770c('0x35')]:_0x1fa375[_0x770c('0x38')];_0x5b9557[_0x770c('0x65')]=qs[_0x770c('0x3c')](_0x3ccc24[_0x770c('0x32')][_0x770c('0x3c')]);_0x5b9557[_0x770c('0x3d')]=qs['filters'](_[_0x770c('0x59')](_0x3ccc24[_0x770c('0x32')],_0x1fa375[_0x770c('0x33')]));if(_0x3ccc24[_0x770c('0x32')][_0x770c('0x3e')]){_0x5b9557[_0x770c('0x3d')]=_[_0x770c('0x3f')](_0x5b9557[_0x770c('0x3d')],{'$or':_['map'](_0x5b9557[_0x770c('0x35')],function(_0x52719c){var _0x11ceba={};_0x11ceba[_0x52719c]={'$like':'%'+_0x3ccc24[_0x770c('0x32')][_0x770c('0x3e')]+'%'};return _0x11ceba;})});}_0x5b9557=_[_0x770c('0x3f')]({},_0x5b9557,_0x3ccc24[_0x770c('0x41')]);return _0x1863d1[_0x770c('0x63')](_0x5b9557);}})[_0x770c('0x25')](function(_0x13c7a3){if(_0x13c7a3){_0x4767b6=_0x13c7a3['length'];if(!_0x3ccc24[_0x770c('0x32')][_0x770c('0x39')](_0x770c('0x3a'))){_0x5b9557['limit']=qs[_0x770c('0x3b')](_0x3ccc24['query'][_0x770c('0x3b')]);_0x5b9557['offset']=qs[_0x770c('0x1e')](_0x3ccc24[_0x770c('0x32')]['offset']);}return _0x1863d1[_0x770c('0x63')](_0x5b9557);}})[_0x770c('0x25')](function(_0x1acace){if(_0x1acace){return _0x1acace?{'count':_0x4767b6,'rows':_0x1acace}:null;}})[_0x770c('0x25')](respondWithResult(_0x4a2e98,null))[_0x770c('0x4a')](handleError(_0x4a2e98,null));};exports['addTeams']=function(_0x39bb80,_0x1843a0,_0x3bbfb6){var _0x224258=_0x39bb80[_0x770c('0x52')][_0x770c('0x66')];return db[_0x770c('0x64')]['findAll']({'where':{'id':_0x224258},'attributes':['id'],'include':[{'model':db[_0x770c('0x5b')],'as':_0x770c('0x67'),'attributes':['id',_0x770c('0x2b'),'online',_0x770c('0x68'),'interface'],'raw':!![]}]})[_0x770c('0x25')](function(_0x279522){if(_0x279522){var _0x408cff=_[_0x770c('0x69')](_0x279522,function(_0x5f5730){var _0x42d8da=_0x5f5730[_0x770c('0x26')]({'plain':!![]});return _0x42d8da[_0x770c('0x67')];});return db[_0x770c('0x2e')]['find']({'where':{'id':_0x39bb80[_0x770c('0x47')]['id']}})[_0x770c('0x25')](function(_0x580185){return db['sequelize']['transaction'](function(_0x1ecb0f){return _0x580185[_0x770c('0x6a')](_0x224258,{'transaction':_0x1ecb0f})['then'](function(){return BPromise['each'](_0x408cff,function(_0x33bb44){return db[_0x770c('0x57')][_0x770c('0x6b')]({'where':{'UserId':_0x33bb44['id'],'WhatsappQueueId':_0x39bb80['params']['id']},'transaction':_0x1ecb0f});});})[_0x770c('0x25')](function(){_0x408cff['forEach'](function(_0x436672){socket[_0x770c('0x6c')](_0x770c('0x6d'),{'UserId':_0x436672['id'],'WhatsappQueueId':_0x580185['id']});});});});});}})[_0x770c('0x25')](respondWithStatusCode(_0x1843a0,null))['catch'](handleError(_0x1843a0,null));};exports[_0x770c('0x6e')]=function(_0x3ab115,_0x15bb60,_0x14e16f){return db['Team'][_0x770c('0x44')]({'where':{'id':_0x3ab115['query'][_0x770c('0x66')]},'attributes':['id'],'include':[{'model':db[_0x770c('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x770c('0x25')](handleEntityNotFound(_0x15bb60,null))[_0x770c('0x25')](function(_0x2fa600){var _0x3c7ef9=_[_0x770c('0x2d')](_0x2fa600,'id');var _0x465f46=[];var _0x49bb52=[];var _0x5cb129=squel[_0x770c('0x6f')]();_0x5cb129[_0x770c('0x70')](_0x770c('0x71'))[_0x770c('0x72')](_0x770c('0x73'),'tq')['join'](_0x770c('0x74'),'ut',_0x770c('0x75'))['where'](_0x770c('0x76'),_0x3ab115[_0x770c('0x47')]['id']);for(var _0x270a6d=0x0;_0x270a6d<_0x2fa600['length'];_0x270a6d+=0x1){let _0x416bf2=_0x2fa600[_0x270a6d];for(var _0x3a64fb=0x0;_0x3a64fb<_0x416bf2[_0x770c('0x67')][_0x770c('0x37')];_0x3a64fb+=0x1){let _0x4c0acb=_0x416bf2[_0x770c('0x67')][_0x3a64fb];var _0x20c34d=_0x5cb129['clone']();_0x20c34d[_0x770c('0x3d')](_0x770c('0x77'),_0x4c0acb['id']);_0x49bb52[_0x770c('0x78')](db[_0x770c('0x79')][_0x770c('0x32')](_0x20c34d[_0x770c('0x7a')](),{'type':db['sequelize'][_0x770c('0x7b')][_0x770c('0x7c')]})[_0x770c('0x25')](function(_0x4c3376){if(_0x4c3376[_0x770c('0x37')]===0x1){return _0x4c0acb['id'];}else{var _0x331f21=_['every'](_[_0x770c('0x2d')](_0x4c3376,_0x770c('0x7d')),function(_0x1dc52f){return _[_0x770c('0x7e')](_0x3c7ef9,_0x1dc52f);});if(_0x331f21){return _0x4c0acb['id'];}}}));}}return BPromise[_0x770c('0x7f')](_0x49bb52)[_0x770c('0x25')](function(_0x9e96bd){_0x465f46=_(_0x465f46)[_0x770c('0x80')](_0x9e96bd)[_0x770c('0x81')]()[_0x770c('0x82')]();return db[_0x770c('0x2e')][_0x770c('0x49')]({'where':{'id':_0x3ab115[_0x770c('0x47')]['id']}})[_0x770c('0x25')](function(_0x100ec5){return db[_0x770c('0x79')]['transaction'](function(_0x531466){return _0x100ec5[_0x770c('0x6e')](_0x3ab115[_0x770c('0x32')]['ids'],{'transaction':_0x531466})[_0x770c('0x25')](function(){if(!_[_0x770c('0x83')](_0x465f46)){return _0x100ec5[_0x770c('0x84')](_0x465f46,{'transaction':_0x531466});}})[_0x770c('0x25')](function(){_0x465f46['forEach'](function(_0x131333){socket[_0x770c('0x6c')](_0x770c('0x85'),{'UserId':_0x131333,'WhatsappQueueId':_0x100ec5['id']});});});});});});})[_0x770c('0x25')](respondWithStatusCode(_0x15bb60,null))[_0x770c('0x4a')](handleError(_0x15bb60,null));};exports['addAgents']=function(_0x52c1ab,_0x4057b8,_0x2a1dc1){return db[_0x770c('0x2e')]['find']({'where':{'id':_0x52c1ab[_0x770c('0x47')]['id']}})[_0x770c('0x25')](handleEntityNotFound(_0x4057b8,null))[_0x770c('0x25')](function(_0x2a0829){if(_0x2a0829){return _0x2a0829[_0x770c('0x86')](_0x52c1ab[_0x770c('0x52')][_0x770c('0x66')],_[_0x770c('0x87')](_0x52c1ab[_0x770c('0x52')],[_0x770c('0x66'),'id'])||{})[_0x770c('0x88')](function(_0x1c6b92){for(var _0x92ccef=0x0;_0x92ccef<_0x52c1ab[_0x770c('0x52')][_0x770c('0x66')][_0x770c('0x37')];_0x92ccef+=0x1){socket['emit'](_0x770c('0x6d'),{'UserId':Number(_0x52c1ab[_0x770c('0x52')]['ids'][_0x92ccef]),'WhatsappQueueId':Number(_0x52c1ab[_0x770c('0x47')]['id'])});}return _0x1c6b92;});}})[_0x770c('0x25')](respondWithResult(_0x4057b8,null))[_0x770c('0x4a')](handleError(_0x4057b8,null));};exports[_0x770c('0x84')]=function(_0x441a47,_0x520279,_0x52ac21){return db[_0x770c('0x2e')][_0x770c('0x49')]({'where':{'id':_0x441a47[_0x770c('0x47')]['id']}})[_0x770c('0x25')](handleEntityNotFound(_0x520279,null))[_0x770c('0x25')](function(_0x5119c0){if(_0x5119c0){return _0x5119c0[_0x770c('0x84')](_0x441a47['query'][_0x770c('0x66')])[_0x770c('0x25')](function(){if(_[_0x770c('0x89')](_0x441a47[_0x770c('0x32')][_0x770c('0x66')])){for(var _0x2dc874=0x0;_0x2dc874<_0x441a47[_0x770c('0x32')][_0x770c('0x66')][_0x770c('0x37')];_0x2dc874+=0x1){socket[_0x770c('0x6c')](_0x770c('0x85'),{'UserId':Number(_0x441a47[_0x770c('0x32')]['ids'][_0x2dc874]),'WhatsappQueueId':Number(_0x441a47[_0x770c('0x47')]['id'])});}}else{socket[_0x770c('0x6c')](_0x770c('0x85'),{'UserId':Number(_0x441a47['query'][_0x770c('0x66')]),'WhatsappQueueId':Number(_0x441a47[_0x770c('0x47')]['id'])});}});}})[_0x770c('0x25')](respondWithStatusCode(_0x520279,null))['catch'](handleError(_0x520279,null));};exports[_0x770c('0x8a')]=function(_0x200b83,_0x4d2b36,_0x2dfca8){var _0x59ecb6={};var _0x5a9af5={};var _0x10ab8a;var _0x14ce30;return db['WhatsappQueue'][_0x770c('0x56')]({'where':{'id':_0x200b83[_0x770c('0x47')]['id']}})[_0x770c('0x25')](handleEntityNotFound(_0x4d2b36,null))[_0x770c('0x25')](function(_0x4179bd){if(_0x4179bd){_0x10ab8a=_0x4179bd;_0x5a9af5[_0x770c('0x38')]=_[_0x770c('0x48')](db[_0x770c('0x5b')][_0x770c('0x58')]);_0x5a9af5[_0x770c('0x32')]=_[_0x770c('0x48')](_0x200b83[_0x770c('0x32')]);_0x5a9af5[_0x770c('0x33')]=_[_0x770c('0x34')](_0x5a9af5[_0x770c('0x38')],_0x5a9af5[_0x770c('0x32')]);_0x59ecb6[_0x770c('0x35')]=_[_0x770c('0x34')](_0x5a9af5[_0x770c('0x38')],qs[_0x770c('0x36')](_0x200b83[_0x770c('0x32')][_0x770c('0x36')]));_0x59ecb6['attributes']=_0x59ecb6[_0x770c('0x35')][_0x770c('0x37')]?_0x59ecb6[_0x770c('0x35')]:_0x5a9af5[_0x770c('0x38')];_0x59ecb6[_0x770c('0x65')]=qs[_0x770c('0x3c')](_0x200b83[_0x770c('0x32')][_0x770c('0x3c')]);_0x59ecb6[_0x770c('0x3d')]=qs[_0x770c('0x33')](_[_0x770c('0x59')](_0x200b83[_0x770c('0x32')],_0x5a9af5[_0x770c('0x33')]));if(_0x200b83[_0x770c('0x32')][_0x770c('0x3e')]){_0x59ecb6[_0x770c('0x3d')]=_[_0x770c('0x3f')](_0x59ecb6['where'],{'$or':_[_0x770c('0x2d')](_0x59ecb6[_0x770c('0x35')],function(_0x137684){var _0x47920e={};_0x47920e[_0x137684]={'$like':'%'+_0x200b83['query'][_0x770c('0x3e')]+'%'};return _0x47920e;})});}_0x59ecb6=_[_0x770c('0x3f')]({},_0x59ecb6,_0x200b83['options']);return _0x10ab8a[_0x770c('0x8a')](_0x59ecb6);}})[_0x770c('0x25')](function(_0x426e49){if(_0x426e49){_0x14ce30=_0x426e49[_0x770c('0x37')];if(!_0x200b83['query'][_0x770c('0x39')]('nolimit')){_0x59ecb6[_0x770c('0x3b')]=qs[_0x770c('0x3b')](_0x200b83[_0x770c('0x32')][_0x770c('0x3b')]);_0x59ecb6[_0x770c('0x1e')]=qs[_0x770c('0x1e')](_0x200b83[_0x770c('0x32')]['offset']);}return _0x10ab8a['getAgents'](_0x59ecb6);}})[_0x770c('0x25')](function(_0xd050a3){if(_0xd050a3){return _0xd050a3?{'count':_0x14ce30,'rows':_0xd050a3}:null;}})[_0x770c('0x25')](respondWithResult(_0x4d2b36,null))[_0x770c('0x4a')](handleError(_0x4d2b36,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 53329c3..ddfabec 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 _0x7c68=['hook','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x447648,_0x3d565c){var _0x17e0f3=function(_0x4f8353){while(--_0x4f8353){_0x447648['push'](_0x447648['shift']());}};_0x17e0f3(++_0x3d565c);}(_0x7c68,0x14b));var _0x87c6=function(_0x61e1e9,_0x4345db){_0x61e1e9=_0x61e1e9-0x0;var _0x1f872b=_0x7c68[_0x61e1e9];return _0x1f872b;};'use strict';var EventEmitter=require(_0x87c6('0x0'));var WhatsappQueue=require(_0x87c6('0x1'))['db'][_0x87c6('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x87c6('0x3')](0x0);var events={'afterCreate':_0x87c6('0x4'),'afterUpdate':_0x87c6('0x5'),'afterDestroy':_0x87c6('0x6')};function emitEvent(_0x49664d){return function(_0x116d2c,_0x4096e6,_0x2459e5){WhatsappQueueEvents[_0x87c6('0x7')](_0x49664d+':'+_0x116d2c['id'],_0x116d2c);WhatsappQueueEvents[_0x87c6('0x7')](_0x49664d,_0x116d2c);_0x2459e5(null);};}for(var e in events){if(events[_0x87c6('0x8')](e)){var event=events[e];WhatsappQueue[_0x87c6('0x9')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x6821=['emit','hasOwnProperty','exports','events','WhatsappQueue','setMaxListeners','update','remove'];(function(_0x560867,_0x5b249c){var _0x480f67=function(_0xa7eb11){while(--_0xa7eb11){_0x560867['push'](_0x560867['shift']());}};_0x480f67(++_0x5b249c);}(_0x6821,0x113));var _0x1682=function(_0x4fb1b8,_0x32d98d){_0x4fb1b8=_0x4fb1b8-0x0;var _0x146c71=_0x6821[_0x4fb1b8];return _0x146c71;};'use strict';var EventEmitter=require(_0x1682('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x1682('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1682('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1682('0x3'),'afterDestroy':_0x1682('0x4')};function emitEvent(_0x5adea1){return function(_0x5568a6,_0x45d5f9,_0x498467){WhatsappQueueEvents['emit'](_0x5adea1+':'+_0x5568a6['id'],_0x5568a6);WhatsappQueueEvents[_0x1682('0x5')](_0x5adea1,_0x5568a6);_0x498467(null);};}for(var e in events){if(events[_0x1682('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x1682('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index e8d3c5e..a4421e8 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 _0x1d7b=['request-promise','path','rimraf','../../config/environment','define','WhatsappQueue','util','../../config/logger','moment','bluebird'];(function(_0x414273,_0x5ae588){var _0x341aba=function(_0x2e9965){while(--_0x2e9965){_0x414273['push'](_0x414273['shift']());}};_0x341aba(++_0x5ae588);}(_0x1d7b,0x10a));var _0xb1d7=function(_0x436cd8,_0x1a04bf){_0x436cd8=_0x436cd8-0x0;var _0x4d14c7=_0x1d7b[_0x436cd8];return _0x4d14c7;};'use strict';var _=require('lodash');var util=require(_0xb1d7('0x0'));var logger=require(_0xb1d7('0x1'))('api');var moment=require(_0xb1d7('0x2'));var BPromise=require(_0xb1d7('0x3'));var rp=require(_0xb1d7('0x4'));var fs=require('fs');var path=require(_0xb1d7('0x5'));var rimraf=require(_0xb1d7('0x6'));var config=require(_0xb1d7('0x7'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x503d6e,_0x25ea14){return _0x503d6e[_0xb1d7('0x8')](_0xb1d7('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd43c=['../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xd43c,0x195));var _0xcd43=function(_0x356cf9,_0x22e533){_0x356cf9=_0x356cf9-0x0;var _0x58ba1d=_0xd43c[_0x356cf9];return _0x58ba1d;};'use strict';var _=require(_0xcd43('0x0'));var util=require(_0xcd43('0x1'));var logger=require(_0xcd43('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcd43('0x3'));var rp=require(_0xcd43('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcd43('0x5'));var attributes=require(_0xcd43('0x6'));module['exports']=function(_0x14648b,_0x5139cb){return _0x14648b[_0xcd43('0x7')](_0xcd43('0x8'),attributes,{'tableName':_0xcd43('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 aa507fd..f36e4e5 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 _0xe6d6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./whatsappQueue.socket','register','WhatsappQueue,\x20%s,\x20%s','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','WhatsappQueue','findAll','options','raw','attributes','include','map','model','then','GetWhatsappQueue','debug','ShowWhatsappQueue','where','lodash','util','bluebird'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xe6d6,0x10e));var _0x6e6d=function(_0x1c6551,_0x3fbc2e){_0x1c6551=_0x1c6551-0x0;var _0x3f7434=_0xe6d6[_0x1c6551];return _0x3f7434;};'use strict';var _=require(_0x6e6d('0x0'));var util=require(_0x6e6d('0x1'));var moment=require('moment');var BPromise=require(_0x6e6d('0x2'));var rs=require(_0x6e6d('0x3'));var fs=require('fs');var Redis=require(_0x6e6d('0x4'));var db=require(_0x6e6d('0x5'))['db'];var utils=require(_0x6e6d('0x6'));var logger=require(_0x6e6d('0x7'))('rpc');var config=require(_0x6e6d('0x8'));var jayson=require(_0x6e6d('0x9'));var client=jayson[_0x6e6d('0xa')][_0x6e6d('0xb')]({'port':0x232a});config[_0x6e6d('0xc')]=_['defaults'](config[_0x6e6d('0xc')],{'host':_0x6e6d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6e6d('0xe'))[_0x6e6d('0xf')](socket);function respondWithRpcPromise(_0x405b3c,_0xa37ed8,_0x3c0367){return new BPromise(function(_0x515bac,_0x33f060){return client['request'](_0x405b3c,_0x3c0367)['then'](function(_0x48bab3){logger['info'](_0x6e6d('0x10'),_0xa37ed8,'request\x20sent');logger['debug'](_0x6e6d('0x11'),_0xa37ed8,'request\x20sent',JSON[_0x6e6d('0x12')](_0x48bab3));if(_0x48bab3[_0x6e6d('0x13')]){if(_0x48bab3[_0x6e6d('0x13')][_0x6e6d('0x14')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0xa37ed8,_0x48bab3[_0x6e6d('0x13')][_0x6e6d('0x15')]);return _0x33f060(_0x48bab3['error'][_0x6e6d('0x15')]);}logger['error'](_0x6e6d('0x10'),_0xa37ed8,_0x48bab3[_0x6e6d('0x13')][_0x6e6d('0x15')]);return _0x515bac(_0x48bab3['error'][_0x6e6d('0x15')]);}else{logger[_0x6e6d('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0xa37ed8,_0x6e6d('0x17'));_0x515bac(_0x48bab3[_0x6e6d('0x18')][_0x6e6d('0x15')]);}})[_0x6e6d('0x19')](function(_0x512fd6){logger[_0x6e6d('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0xa37ed8,_0x512fd6);_0x33f060(_0x512fd6);});});}exports['GetWhatsappQueue']=function(_0x2f236e){var _0x514cec=this;return new Promise(function(_0x36e247,_0x425617){return db[_0x6e6d('0x1a')][_0x6e6d('0x1b')]({'raw':_0x2f236e[_0x6e6d('0x1c')]?_0x2f236e[_0x6e6d('0x1c')][_0x6e6d('0x1d')]===undefined?!![]:![]:!![],'where':_0x2f236e[_0x6e6d('0x1c')]?_0x2f236e['options']['where']||null:null,'attributes':_0x2f236e['options']?_0x2f236e['options'][_0x6e6d('0x1e')]||null:null,'limit':_0x2f236e[_0x6e6d('0x1c')]?_0x2f236e[_0x6e6d('0x1c')]['limit']||null:null,'include':_0x2f236e[_0x6e6d('0x1c')]?_0x2f236e['options'][_0x6e6d('0x1f')]?_[_0x6e6d('0x20')](_0x2f236e[_0x6e6d('0x1c')]['include'],function(_0x4b69c8){return{'model':db[_0x4b69c8[_0x6e6d('0x21')]],'as':_0x4b69c8['as'],'attributes':_0x4b69c8[_0x6e6d('0x1e')],'include':_0x4b69c8[_0x6e6d('0x1f')]?_[_0x6e6d('0x20')](_0x4b69c8[_0x6e6d('0x1f')],function(_0x1f45f8){return{'model':db[_0x1f45f8['model']],'as':_0x1f45f8['as'],'attributes':_0x1f45f8['attributes'],'include':_0x1f45f8[_0x6e6d('0x1f')]?_[_0x6e6d('0x20')](_0x1f45f8[_0x6e6d('0x1f')],function(_0x465836){return{'model':db[_0x465836[_0x6e6d('0x21')]],'as':_0x465836['as'],'attributes':_0x465836[_0x6e6d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e6d('0x22')](function(_0x127591){logger[_0x6e6d('0x16')](_0x6e6d('0x23'),_0x2f236e);logger[_0x6e6d('0x24')](_0x6e6d('0x23'),_0x2f236e,JSON[_0x6e6d('0x12')](_0x127591));_0x36e247(_0x127591);})[_0x6e6d('0x19')](function(_0x3dfa5d){logger[_0x6e6d('0x13')](_0x6e6d('0x23'),_0x3dfa5d[_0x6e6d('0x15')],_0x2f236e);_0x425617(_0x514cec[_0x6e6d('0x13')](0x1f4,_0x3dfa5d['message']));});});};exports[_0x6e6d('0x25')]=function(_0x26a1d1){var _0x14ce68=this;return new Promise(function(_0x3df2b2,_0x4f79b2){return db[_0x6e6d('0x1a')]['find']({'raw':_0x26a1d1[_0x6e6d('0x1c')]?_0x26a1d1['options']['raw']===undefined?!![]:![]:!![],'where':_0x26a1d1[_0x6e6d('0x1c')]?_0x26a1d1[_0x6e6d('0x1c')][_0x6e6d('0x26')]||null:null,'attributes':_0x26a1d1[_0x6e6d('0x1c')]?_0x26a1d1[_0x6e6d('0x1c')][_0x6e6d('0x1e')]||null:null,'include':_0x26a1d1[_0x6e6d('0x1c')]?_0x26a1d1[_0x6e6d('0x1c')][_0x6e6d('0x1f')]?_[_0x6e6d('0x20')](_0x26a1d1['options'][_0x6e6d('0x1f')],function(_0x213b8d){return{'model':db[_0x213b8d['model']],'as':_0x213b8d['as'],'attributes':_0x213b8d[_0x6e6d('0x1e')],'include':_0x213b8d['include']?_[_0x6e6d('0x20')](_0x213b8d['include'],function(_0x6539ec){return{'model':db[_0x6539ec['model']],'as':_0x6539ec['as'],'attributes':_0x6539ec['attributes'],'include':_0x6539ec[_0x6e6d('0x1f')]?_['map'](_0x6539ec[_0x6e6d('0x1f')],function(_0x206722){return{'model':db[_0x206722[_0x6e6d('0x21')]],'as':_0x206722['as'],'attributes':_0x206722['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x31f12c){logger[_0x6e6d('0x16')](_0x6e6d('0x25'),_0x26a1d1);logger['debug'](_0x6e6d('0x25'),_0x26a1d1,JSON[_0x6e6d('0x12')](_0x31f12c));_0x3df2b2(_0x31f12c);})[_0x6e6d('0x19')](function(_0x21edd6){logger[_0x6e6d('0x13')]('ShowWhatsappQueue',_0x21edd6[_0x6e6d('0x15')],_0x26a1d1);_0x4f79b2(_0x14ce68[_0x6e6d('0x13')](0x1f4,_0x21edd6['message']));});});}; \ No newline at end of file +var _0x4d01=['where','limit','map','include','model','attributes','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','stringify','error','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options'];(function(_0x638f08,_0x275649){var _0x2a015c=function(_0x2fc50c){while(--_0x2fc50c){_0x638f08['push'](_0x638f08['shift']());}};_0x2a015c(++_0x275649);}(_0x4d01,0xf8));var _0x14d0=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x4d01[_0x349367];return _0x14179b;};'use strict';var _=require(_0x14d0('0x0'));var util=require(_0x14d0('0x1'));var moment=require(_0x14d0('0x2'));var BPromise=require(_0x14d0('0x3'));var rs=require(_0x14d0('0x4'));var fs=require('fs');var Redis=require(_0x14d0('0x5'));var db=require(_0x14d0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x14d0('0x7'))(_0x14d0('0x8'));var config=require(_0x14d0('0x9'));var jayson=require(_0x14d0('0xa'));var client=jayson[_0x14d0('0xb')][_0x14d0('0xc')]({'port':0x232a});config[_0x14d0('0xd')]=_[_0x14d0('0xe')](config[_0x14d0('0xd')],{'host':_0x14d0('0xf'),'port':0x18eb});var socket=require(_0x14d0('0x10'))(new Redis(config[_0x14d0('0xd')]));require('./whatsappQueue.socket')[_0x14d0('0x11')](socket);function respondWithRpcPromise(_0xddb54,_0x41c92d,_0x165327){return new BPromise(function(_0x44790a,_0x451b67){return client['request'](_0xddb54,_0x165327)[_0x14d0('0x12')](function(_0x196e0f){logger[_0x14d0('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x41c92d,_0x14d0('0x14'));logger[_0x14d0('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x41c92d,_0x14d0('0x14'),JSON[_0x14d0('0x16')](_0x196e0f));if(_0x196e0f[_0x14d0('0x17')]){if(_0x196e0f[_0x14d0('0x17')]['code']===0x1f4){logger[_0x14d0('0x17')](_0x14d0('0x18'),_0x41c92d,_0x196e0f['error']['message']);return _0x451b67(_0x196e0f[_0x14d0('0x17')]['message']);}logger['error'](_0x14d0('0x18'),_0x41c92d,_0x196e0f['error'][_0x14d0('0x19')]);return _0x44790a(_0x196e0f[_0x14d0('0x17')][_0x14d0('0x19')]);}else{logger[_0x14d0('0x13')](_0x14d0('0x18'),_0x41c92d,_0x14d0('0x14'));_0x44790a(_0x196e0f[_0x14d0('0x1a')][_0x14d0('0x19')]);}})[_0x14d0('0x1b')](function(_0x52219a){logger[_0x14d0('0x17')](_0x14d0('0x18'),_0x41c92d,_0x52219a);_0x451b67(_0x52219a);});});}exports[_0x14d0('0x1c')]=function(_0x2f99d2){var _0x1b3801=this;return new Promise(function(_0x183c49,_0x5bb852){return db[_0x14d0('0x1d')][_0x14d0('0x1e')]({'raw':_0x2f99d2[_0x14d0('0x1f')]?_0x2f99d2[_0x14d0('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2f99d2[_0x14d0('0x1f')]?_0x2f99d2[_0x14d0('0x1f')][_0x14d0('0x20')]||null:null,'attributes':_0x2f99d2[_0x14d0('0x1f')]?_0x2f99d2[_0x14d0('0x1f')]['attributes']||null:null,'limit':_0x2f99d2[_0x14d0('0x1f')]?_0x2f99d2['options'][_0x14d0('0x21')]||null:null,'include':_0x2f99d2[_0x14d0('0x1f')]?_0x2f99d2[_0x14d0('0x1f')]['include']?_[_0x14d0('0x22')](_0x2f99d2['options'][_0x14d0('0x23')],function(_0x3066c5){return{'model':db[_0x3066c5[_0x14d0('0x24')]],'as':_0x3066c5['as'],'attributes':_0x3066c5['attributes'],'include':_0x3066c5[_0x14d0('0x23')]?_['map'](_0x3066c5[_0x14d0('0x23')],function(_0xdeeea7){return{'model':db[_0xdeeea7[_0x14d0('0x24')]],'as':_0xdeeea7['as'],'attributes':_0xdeeea7[_0x14d0('0x25')],'include':_0xdeeea7['include']?_[_0x14d0('0x22')](_0xdeeea7['include'],function(_0x22af88){return{'model':db[_0x22af88[_0x14d0('0x24')]],'as':_0x22af88['as'],'attributes':_0x22af88['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x16d630){logger['info'](_0x14d0('0x1c'),_0x2f99d2);logger[_0x14d0('0x15')]('GetWhatsappQueue',_0x2f99d2,JSON[_0x14d0('0x16')](_0x16d630));_0x183c49(_0x16d630);})[_0x14d0('0x1b')](function(_0x462ad9){logger[_0x14d0('0x17')](_0x14d0('0x1c'),_0x462ad9[_0x14d0('0x19')],_0x2f99d2);_0x5bb852(_0x1b3801['error'](0x1f4,_0x462ad9[_0x14d0('0x19')]));});});};exports[_0x14d0('0x26')]=function(_0x4de36a){var _0x345e01=this;return new Promise(function(_0x314dfb,_0x21c180){return db['WhatsappQueue'][_0x14d0('0x27')]({'raw':_0x4de36a[_0x14d0('0x1f')]?_0x4de36a[_0x14d0('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4de36a[_0x14d0('0x1f')]?_0x4de36a[_0x14d0('0x1f')][_0x14d0('0x20')]||null:null,'attributes':_0x4de36a[_0x14d0('0x1f')]?_0x4de36a[_0x14d0('0x1f')][_0x14d0('0x25')]||null:null,'include':_0x4de36a[_0x14d0('0x1f')]?_0x4de36a[_0x14d0('0x1f')][_0x14d0('0x23')]?_[_0x14d0('0x22')](_0x4de36a[_0x14d0('0x1f')][_0x14d0('0x23')],function(_0x5ef3e6){return{'model':db[_0x5ef3e6[_0x14d0('0x24')]],'as':_0x5ef3e6['as'],'attributes':_0x5ef3e6['attributes'],'include':_0x5ef3e6['include']?_['map'](_0x5ef3e6[_0x14d0('0x23')],function(_0x3bde05){return{'model':db[_0x3bde05[_0x14d0('0x24')]],'as':_0x3bde05['as'],'attributes':_0x3bde05['attributes'],'include':_0x3bde05['include']?_[_0x14d0('0x22')](_0x3bde05[_0x14d0('0x23')],function(_0x44cf5f){return{'model':db[_0x44cf5f[_0x14d0('0x24')]],'as':_0x44cf5f['as'],'attributes':_0x44cf5f[_0x14d0('0x25')]};}):[]};}):[]};}):[]:[]})[_0x14d0('0x12')](function(_0x4dfdd2){logger[_0x14d0('0x13')]('ShowWhatsappQueue',_0x4de36a);logger[_0x14d0('0x15')]('ShowWhatsappQueue',_0x4de36a,JSON[_0x14d0('0x16')](_0x4dfdd2));_0x314dfb(_0x4dfdd2);})[_0x14d0('0x1b')](function(_0x4e6e9e){logger[_0x14d0('0x17')](_0x14d0('0x26'),_0x4e6e9e['message'],_0x4de36a);_0x21c180(_0x345e01['error'](0x1f4,_0x4e6e9e['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 73c5406..ae7952a 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 _0x9b2b=['save','remove','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9b2b,0xa7));var _0xb9b2=function(_0x19aa84,_0x549537){_0x19aa84=_0x19aa84-0x0;var _0x536146=_0x9b2b[_0x19aa84];return _0x536146;};'use strict';var WhatsappQueueEvents=require(_0xb9b2('0x0'));var events=[_0xb9b2('0x1'),_0xb9b2('0x2'),'update'];function createListener(_0x54abf0,_0x3e7f51){return function(_0xd5e7c7){_0x3e7f51[_0xb9b2('0x3')](_0x54abf0,_0xd5e7c7);};}function removeListener(_0xe0a328,_0x22569e){return function(){WhatsappQueueEvents[_0xb9b2('0x4')](_0xe0a328,_0x22569e);};}exports[_0xb9b2('0x5')]=function(_0x29b8e4){for(var _0x2d35f=0x0,_0x3a9976=events[_0xb9b2('0x6')];_0x2d35f<_0x3a9976;_0x2d35f++){var _0x5d593a=events[_0x2d35f];var _0x5e37dc=createListener(_0xb9b2('0x7')+_0x5d593a,_0x29b8e4);WhatsappQueueEvents['on'](_0x5d593a,_0x5e37dc);}}; \ No newline at end of file +var _0xdd04=['./whatsappQueue.events','save','update','emit','register','length','whatsappQueue:'];(function(_0x210ed6,_0x3dffa7){var _0x353e65=function(_0x4e5159){while(--_0x4e5159){_0x210ed6['push'](_0x210ed6['shift']());}};_0x353e65(++_0x3dffa7);}(_0xdd04,0x85));var _0x4dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd04[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappQueueEvents=require(_0x4dd0('0x0'));var events=[_0x4dd0('0x1'),'remove',_0x4dd0('0x2')];function createListener(_0x242b5c,_0x42581e){return function(_0x4e7d02){_0x42581e[_0x4dd0('0x3')](_0x242b5c,_0x4e7d02);};}function removeListener(_0x211ef1,_0x58c0ac){return function(){WhatsappQueueEvents['removeListener'](_0x211ef1,_0x58c0ac);};}exports[_0x4dd0('0x4')]=function(_0x396009){for(var _0xa699a4=0x0,_0xc3dcab=events[_0x4dd0('0x5')];_0xa699a4<_0xc3dcab;_0xa699a4++){var _0x1ac759=events[_0xa699a4];var _0x28e652=createListener(_0x4dd0('0x6')+_0x1ac759,_0x396009);WhatsappQueueEvents['on'](_0x1ac759,_0x28e652);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 5b4a5df..f53d05c 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 _0xb3fb=['delete','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x459f31,_0x1bc3a7){var _0x27c695=function(_0x4e651c){while(--_0x4e651c){_0x459f31['push'](_0x459f31['shift']());}};_0x27c695(++_0x1bc3a7);}(_0xb3fb,0x1a0));var _0xbb3f=function(_0x117fb1,_0x4b9774){_0x117fb1=_0x117fb1-0x0;var _0x53db22=_0xb3fb[_0x117fb1];return _0x53db22;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbb3f('0x0'));var timeout=require('connect-timeout');var express=require(_0xbb3f('0x1'));var router=express[_0xbb3f('0x2')]();var fs_extra=require(_0xbb3f('0x3'));var auth=require(_0xbb3f('0x4'));var interaction=require(_0xbb3f('0x5'));var config=require('../../config/environment');var controller=require(_0xbb3f('0x6'));router[_0xbb3f('0x7')]('/',auth[_0xbb3f('0x8')](),controller[_0xbb3f('0x9')]);router[_0xbb3f('0x7')](_0xbb3f('0xa'),auth[_0xbb3f('0x8')](),controller[_0xbb3f('0xb')]);router[_0xbb3f('0x7')](_0xbb3f('0xc'),auth[_0xbb3f('0x8')](),controller[_0xbb3f('0xd')]);router[_0xbb3f('0xe')]('/',auth[_0xbb3f('0x8')](),controller[_0xbb3f('0xf')]);router['put'](_0xbb3f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xbb3f('0x10')](_0xbb3f('0xc'),auth[_0xbb3f('0x8')](),controller[_0xbb3f('0x11')]);module['exports']=router; \ No newline at end of file +var _0x84fa=['../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x102af6,_0x14b85b){var _0x1930ac=function(_0x4ad262){while(--_0x4ad262){_0x102af6['push'](_0x102af6['shift']());}};_0x1930ac(++_0x14b85b);}(_0x84fa,0xdf));var _0xa84f=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x84fa[_0x55e08b];return _0xd1a7ff;};'use strict';var multer=require(_0xa84f('0x0'));var util=require(_0xa84f('0x1'));var path=require(_0xa84f('0x2'));var timeout=require(_0xa84f('0x3'));var express=require(_0xa84f('0x4'));var router=express[_0xa84f('0x5')]();var fs_extra=require(_0xa84f('0x6'));var auth=require(_0xa84f('0x7'));var interaction=require(_0xa84f('0x8'));var config=require(_0xa84f('0x9'));var controller=require(_0xa84f('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xa84f('0xb')]);router[_0xa84f('0xc')](_0xa84f('0xd'),auth[_0xa84f('0xe')](),controller[_0xa84f('0xf')]);router['get'](_0xa84f('0x10'),auth[_0xa84f('0xe')](),controller[_0xa84f('0x11')]);router[_0xa84f('0x12')]('/',auth['isAuthenticated'](),controller[_0xa84f('0x13')]);router[_0xa84f('0x14')]('/:id',auth[_0xa84f('0xe')](),controller['update']);router['delete'](_0xa84f('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 88c4633..3e3c912 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4b92e1,_0x664932){var _0xbae68b=function(_0x1e3e47){while(--_0x1e3e47){_0x4b92e1['push'](_0x4b92e1['shift']());}};_0xbae68b(++_0x664932);}(_0x7a54,0x106));var _0x47a5=function(_0x36c04b,_0x3ce232){_0x36c04b=_0x36c04b-0x0;var _0x564c71=_0x7a54[_0x36c04b];return _0x564c71;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x23e17c,_0x3dfeb0){var _0x5f3ef9=function(_0xd4818d){while(--_0xd4818d){_0x23e17c['push'](_0x23e17c['shift']());}};_0x5f3ef9(++_0x3dfeb0);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index fb3c574..76eba8c 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 _0xb688=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','update','then','destroy','end','error','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','key','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','show','includeAll','include','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4a6f32,_0x1922e5){var _0x28fcbd=function(_0x41fb55){while(--_0x41fb55){_0x4a6f32['push'](_0x4a6f32['shift']());}};_0x28fcbd(++_0x1922e5);}(_0xb688,0xcf));var _0x8b68=function(_0x309cfd,_0xc9502c){_0x309cfd=_0x309cfd-0x0;var _0x5f5c95=_0xb688[_0x309cfd];return _0x5f5c95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b68('0x0'));var zipdir=require(_0x8b68('0x1'));var jsonpatch=require(_0x8b68('0x2'));var rp=require(_0x8b68('0x3'));var moment=require(_0x8b68('0x4'));var BPromise=require(_0x8b68('0x5'));var Mustache=require('mustache');var util=require(_0x8b68('0x6'));var path=require(_0x8b68('0x7'));var sox=require(_0x8b68('0x8'));var csv=require(_0x8b68('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b68('0xa'));var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0x9'));var querystring=require(_0x8b68('0xf'));var Papa=require(_0x8b68('0x10'));var Redis=require(_0x8b68('0x11'));var authService=require(_0x8b68('0x12'));var qs=require(_0x8b68('0x13'));var as=require(_0x8b68('0x14'));var hardwareService=require(_0x8b68('0x15'));var logger=require(_0x8b68('0x16'))('api');var utils=require(_0x8b68('0x17'));var config=require(_0x8b68('0x18'));var licenseUtil=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];function respondWithStatusCode(_0x1965cf,_0x2f3af4){_0x2f3af4=_0x2f3af4||0xcc;return function(_0xaa8725){if(_0xaa8725){return _0x1965cf[_0x8b68('0x1b')](_0x2f3af4);}return _0x1965cf[_0x8b68('0x1c')](_0x2f3af4)['end']();};}function respondWithResult(_0xb2df35,_0x509033){_0x509033=_0x509033||0xc8;return function(_0x5e3c66){if(_0x5e3c66){return _0xb2df35[_0x8b68('0x1c')](_0x509033)[_0x8b68('0x1d')](_0x5e3c66);}};}function respondWithFilteredResult(_0x27d717,_0x5d3468){return function(_0x5c8d0e){if(_0x5c8d0e){var _0x23bd52=typeof _0x5d3468['offset']===_0x8b68('0x1e')&&typeof _0x5d3468[_0x8b68('0x1f')]===_0x8b68('0x1e');var _0x10c9c6=_0x5c8d0e['count'];var _0xd17693=_0x23bd52?0x0:_0x5d3468[_0x8b68('0x20')];var _0x4a68c7=_0x23bd52?_0x5c8d0e[_0x8b68('0x21')]:_0x5d3468[_0x8b68('0x20')]+_0x5d3468[_0x8b68('0x1f')];var _0x17f321;if(_0x4a68c7>=_0x10c9c6){_0x4a68c7=_0x10c9c6;_0x17f321=0xc8;}else{_0x17f321=0xce;}_0x27d717[_0x8b68('0x1c')](_0x17f321);return _0x27d717['set'](_0x8b68('0x22'),_0xd17693+'-'+_0x4a68c7+'/'+_0x10c9c6)[_0x8b68('0x1d')](_0x5c8d0e);}return null;};}function patchUpdates(_0x59e9b1){return function(_0x1a9788){try{jsonpatch[_0x8b68('0x23')](_0x1a9788,_0x59e9b1,!![]);}catch(_0x1dbc1d){return BPromise['reject'](_0x1dbc1d);}return _0x1a9788['save']();};}function saveUpdates(_0x23edc1,_0x59cb26){return function(_0x332202){if(_0x332202){return _0x332202[_0x8b68('0x24')](_0x23edc1)[_0x8b68('0x25')](function(_0x21ecca){return _0x21ecca;});}return null;};}function removeEntity(_0x32ddc5,_0x173524){return function(_0x59bb8a){if(_0x59bb8a){return _0x59bb8a[_0x8b68('0x26')]()[_0x8b68('0x25')](function(){_0x32ddc5['status'](0xcc)[_0x8b68('0x27')]();});}};}function handleEntityNotFound(_0x3cf8d2,_0x240b0b){return function(_0x5590ec){if(!_0x5590ec){_0x3cf8d2['sendStatus'](0x194);}return _0x5590ec;};}function handleError(_0x4fe8f6,_0x92d186){_0x92d186=_0x92d186||0x1f4;return function(_0x448e43){logger[_0x8b68('0x28')](_0x448e43['stack']);if(_0x448e43[_0x8b68('0x29')]){delete _0x448e43['name'];}_0x4fe8f6['status'](_0x92d186)[_0x8b68('0x2a')](_0x448e43);};}exports['index']=function(_0x26cad7,_0x3ac356){var _0x48e2c8={},_0x494ce4={},_0x357635={'count':0x0,'rows':[]};var _0x1cd230=_[_0x8b68('0x2b')](db[_0x8b68('0x2c')][_0x8b68('0x2d')],function(_0x2ad2df){return{'name':_0x2ad2df[_0x8b68('0x2e')],'type':_0x2ad2df['type'][_0x8b68('0x2f')]};});_0x494ce4['model']=_[_0x8b68('0x2b')](_0x1cd230,_0x8b68('0x29'));_0x494ce4['query']=_[_0x8b68('0x30')](_0x26cad7[_0x8b68('0x31')]);_0x494ce4[_0x8b68('0x32')]=_['intersection'](_0x494ce4['model'],_0x494ce4[_0x8b68('0x31')]);_0x48e2c8[_0x8b68('0x33')]=_[_0x8b68('0x34')](_0x494ce4[_0x8b68('0x35')],qs[_0x8b68('0x36')](_0x26cad7[_0x8b68('0x31')][_0x8b68('0x36')]));_0x48e2c8[_0x8b68('0x33')]=_0x48e2c8[_0x8b68('0x33')][_0x8b68('0x37')]?_0x48e2c8[_0x8b68('0x33')]:_0x494ce4[_0x8b68('0x35')];if(!_0x26cad7[_0x8b68('0x31')][_0x8b68('0x38')](_0x8b68('0x39'))){_0x48e2c8[_0x8b68('0x1f')]=qs[_0x8b68('0x1f')](_0x26cad7[_0x8b68('0x31')][_0x8b68('0x1f')]);_0x48e2c8[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x26cad7[_0x8b68('0x31')]['offset']);}_0x48e2c8['order']=qs[_0x8b68('0x3a')](_0x26cad7[_0x8b68('0x31')][_0x8b68('0x3a')]);_0x48e2c8[_0x8b68('0x3b')]=qs[_0x8b68('0x32')](_[_0x8b68('0x3c')](_0x26cad7[_0x8b68('0x31')],_0x494ce4[_0x8b68('0x32')]),_0x1cd230);if(_0x26cad7['query'][_0x8b68('0x3d')]){_0x48e2c8[_0x8b68('0x3b')]=_[_0x8b68('0x3e')](_0x48e2c8[_0x8b68('0x3b')],{'$or':_[_0x8b68('0x2b')](_0x1cd230,function(_0x3e0032){if(_0x3e0032[_0x8b68('0x3f')]!==_0x8b68('0x40')){var _0x517571={};_0x517571[_0x3e0032[_0x8b68('0x29')]]={'$like':'%'+_0x26cad7[_0x8b68('0x31')][_0x8b68('0x3d')]+'%'};return _0x517571;}})});}_0x48e2c8=_[_0x8b68('0x3e')]({},_0x48e2c8,_0x26cad7[_0x8b68('0x41')]);var _0x3b3394={'where':_0x48e2c8[_0x8b68('0x3b')]};return db['WhatsappQueueReport'][_0x8b68('0x21')](_0x3b3394)[_0x8b68('0x25')](function(_0x48f159){_0x357635[_0x8b68('0x21')]=_0x48f159;if(_0x26cad7[_0x8b68('0x31')]['includeAll']){_0x48e2c8['include']=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x48e2c8);})[_0x8b68('0x25')](function(_0x23d24a){_0x357635['rows']=_0x23d24a;return _0x357635;})[_0x8b68('0x25')](respondWithFilteredResult(_0x3ac356,_0x48e2c8))['catch'](handleError(_0x3ac356,null));};exports[_0x8b68('0x42')]=function(_0x3841d2,_0x5a3193){var _0x2f90d9={'raw':!![],'where':{'id':_0x3841d2['params']['id']}},_0x5ae345={};_0x5ae345['model']=_[_0x8b68('0x30')](db[_0x8b68('0x2c')][_0x8b68('0x2d')]);_0x5ae345[_0x8b68('0x31')]=_['keys'](_0x3841d2[_0x8b68('0x31')]);_0x5ae345['filters']=_[_0x8b68('0x34')](_0x5ae345[_0x8b68('0x35')],_0x5ae345['query']);_0x2f90d9[_0x8b68('0x33')]=_[_0x8b68('0x34')](_0x5ae345[_0x8b68('0x35')],qs[_0x8b68('0x36')](_0x3841d2['query'][_0x8b68('0x36')]));_0x2f90d9[_0x8b68('0x33')]=_0x2f90d9[_0x8b68('0x33')][_0x8b68('0x37')]?_0x2f90d9[_0x8b68('0x33')]:_0x5ae345[_0x8b68('0x35')];if(_0x3841d2[_0x8b68('0x31')][_0x8b68('0x43')]){_0x2f90d9[_0x8b68('0x44')]=[{'all':!![]}];}_0x2f90d9=_[_0x8b68('0x3e')]({},_0x2f90d9,_0x3841d2[_0x8b68('0x41')]);return db[_0x8b68('0x2c')][_0x8b68('0x45')](_0x2f90d9)[_0x8b68('0x25')](handleEntityNotFound(_0x5a3193,null))[_0x8b68('0x25')](respondWithResult(_0x5a3193,null))[_0x8b68('0x46')](handleError(_0x5a3193,null));};exports['create']=function(_0x3b7b06,_0x20681a){return db['WhatsappQueueReport'][_0x8b68('0x47')](_0x3b7b06['body'],{})['then'](respondWithResult(_0x20681a,0xc9))['catch'](handleError(_0x20681a,null));};exports[_0x8b68('0x24')]=function(_0x35874b,_0x34047c){if(_0x35874b[_0x8b68('0x48')]['id']){delete _0x35874b['body']['id'];}return db['WhatsappQueueReport'][_0x8b68('0x45')]({'where':{'id':_0x35874b[_0x8b68('0x49')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x34047c,null))['then'](saveUpdates(_0x35874b[_0x8b68('0x48')],null))[_0x8b68('0x25')](respondWithResult(_0x34047c,null))['catch'](handleError(_0x34047c,null));};exports[_0x8b68('0x26')]=function(_0xacac82,_0x595942){return db[_0x8b68('0x2c')][_0x8b68('0x45')]({'where':{'id':_0xacac82['params']['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x595942,null))[_0x8b68('0x25')](removeEntity(_0x595942,null))['catch'](handleError(_0x595942,null));};exports['describe']=function(_0x5e3e99,_0x28f82d){return db[_0x8b68('0x2c')][_0x8b68('0x4a')]()[_0x8b68('0x25')](respondWithResult(_0x28f82d,null))['catch'](handleError(_0x28f82d,null));}; \ No newline at end of file +var _0xdb94=['length','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','model','query','keys','intersection','attributes','fields'];(function(_0x246cd0,_0x36e3e8){var _0x1fd2de=function(_0x3472af){while(--_0x3472af){_0x246cd0['push'](_0x246cd0['shift']());}};_0x1fd2de(++_0x36e3e8);}(_0xdb94,0xab));var _0x4db9=function(_0x5d3d6d,_0x357af1){_0x5d3d6d=_0x5d3d6d-0x0;var _0x335229=_0xdb94[_0x5d3d6d];return _0x335229;};'use strict';var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require(_0x4db9('0x2'));var jsonpatch=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var moment=require('moment');var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4db9('0x8'));var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31222b,_0x5e644c){_0x5e644c=_0x5e644c||0xcc;return function(_0x571685){if(_0x571685){return _0x31222b[_0x4db9('0x17')](_0x5e644c);}return _0x31222b[_0x4db9('0x18')](_0x5e644c)['end']();};}function respondWithResult(_0xd37d63,_0x1f9638){_0x1f9638=_0x1f9638||0xc8;return function(_0x452896){if(_0x452896){return _0xd37d63[_0x4db9('0x18')](_0x1f9638)['json'](_0x452896);}};}function respondWithFilteredResult(_0x5e04ab,_0x102274){return function(_0x34de1a){if(_0x34de1a){var _0x4a037f=typeof _0x102274[_0x4db9('0x19')]===_0x4db9('0x1a')&&typeof _0x102274['limit']==='undefined';var _0x250a80=_0x34de1a[_0x4db9('0x1b')];var _0x462af3=_0x4a037f?0x0:_0x102274[_0x4db9('0x19')];var _0x1d3c33=_0x4a037f?_0x34de1a['count']:_0x102274[_0x4db9('0x19')]+_0x102274[_0x4db9('0x1c')];var _0x11012e;if(_0x1d3c33>=_0x250a80){_0x1d3c33=_0x250a80;_0x11012e=0xc8;}else{_0x11012e=0xce;}_0x5e04ab['status'](_0x11012e);return _0x5e04ab[_0x4db9('0x1d')](_0x4db9('0x1e'),_0x462af3+'-'+_0x1d3c33+'/'+_0x250a80)[_0x4db9('0x1f')](_0x34de1a);}return null;};}function patchUpdates(_0x4c92e8){return function(_0x46b522){try{jsonpatch[_0x4db9('0x20')](_0x46b522,_0x4c92e8,!![]);}catch(_0x4553c2){return BPromise[_0x4db9('0x21')](_0x4553c2);}return _0x46b522[_0x4db9('0x22')]();};}function saveUpdates(_0x159d9b,_0x3585d5){return function(_0x5aef3b){if(_0x5aef3b){return _0x5aef3b[_0x4db9('0x23')](_0x159d9b)[_0x4db9('0x24')](function(_0xcde40c){return _0xcde40c;});}return null;};}function removeEntity(_0x319475,_0x4aaa84){return function(_0x213daa){if(_0x213daa){return _0x213daa[_0x4db9('0x25')]()['then'](function(){_0x319475[_0x4db9('0x18')](0xcc)[_0x4db9('0x26')]();});}};}function handleEntityNotFound(_0x2987c6,_0x4dbb1b){return function(_0x3c8237){if(!_0x3c8237){_0x2987c6[_0x4db9('0x17')](0x194);}return _0x3c8237;};}function handleError(_0x43b95e,_0x2d330e){_0x2d330e=_0x2d330e||0x1f4;return function(_0x3f9f7e){logger[_0x4db9('0x27')](_0x3f9f7e[_0x4db9('0x28')]);if(_0x3f9f7e[_0x4db9('0x29')]){delete _0x3f9f7e[_0x4db9('0x29')];}_0x43b95e[_0x4db9('0x18')](_0x2d330e)[_0x4db9('0x2a')](_0x3f9f7e);};}exports[_0x4db9('0x2b')]=function(_0x2d646d,_0x20f133){var _0x583861={},_0x5031fe={},_0x3951b2={'count':0x0,'rows':[]};var _0x331279=_[_0x4db9('0x2c')](db[_0x4db9('0x2d')][_0x4db9('0x2e')],function(_0x459131){return{'name':_0x459131['fieldName'],'type':_0x459131[_0x4db9('0x2f')]['key']};});_0x5031fe[_0x4db9('0x30')]=_[_0x4db9('0x2c')](_0x331279,_0x4db9('0x29'));_0x5031fe[_0x4db9('0x31')]=_[_0x4db9('0x32')](_0x2d646d['query']);_0x5031fe['filters']=_[_0x4db9('0x33')](_0x5031fe['model'],_0x5031fe[_0x4db9('0x31')]);_0x583861[_0x4db9('0x34')]=_['intersection'](_0x5031fe[_0x4db9('0x30')],qs[_0x4db9('0x35')](_0x2d646d[_0x4db9('0x31')]['fields']));_0x583861[_0x4db9('0x34')]=_0x583861['attributes'][_0x4db9('0x36')]?_0x583861[_0x4db9('0x34')]:_0x5031fe[_0x4db9('0x30')];if(!_0x2d646d['query']['hasOwnProperty'](_0x4db9('0x37'))){_0x583861[_0x4db9('0x1c')]=qs[_0x4db9('0x1c')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x1c')]);_0x583861[_0x4db9('0x19')]=qs[_0x4db9('0x19')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x19')]);}_0x583861['order']=qs[_0x4db9('0x38')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x38')]);_0x583861[_0x4db9('0x39')]=qs['filters'](_[_0x4db9('0x3a')](_0x2d646d[_0x4db9('0x31')],_0x5031fe[_0x4db9('0x3b')]),_0x331279);if(_0x2d646d['query'][_0x4db9('0x3c')]){_0x583861[_0x4db9('0x39')]=_[_0x4db9('0x3d')](_0x583861[_0x4db9('0x39')],{'$or':_['map'](_0x331279,function(_0x5a78b4){if(_0x5a78b4[_0x4db9('0x2f')]!==_0x4db9('0x3e')){var _0x32e62b={};_0x32e62b[_0x5a78b4[_0x4db9('0x29')]]={'$like':'%'+_0x2d646d[_0x4db9('0x31')]['filter']+'%'};return _0x32e62b;}})});}_0x583861=_[_0x4db9('0x3d')]({},_0x583861,_0x2d646d[_0x4db9('0x3f')]);var _0x23affc={'where':_0x583861[_0x4db9('0x39')]};return db[_0x4db9('0x2d')]['count'](_0x23affc)[_0x4db9('0x24')](function(_0x324765){_0x3951b2[_0x4db9('0x1b')]=_0x324765;if(_0x2d646d['query'][_0x4db9('0x40')]){_0x583861[_0x4db9('0x41')]=[{'all':!![]}];}return db[_0x4db9('0x2d')][_0x4db9('0x42')](_0x583861);})[_0x4db9('0x24')](function(_0x24aa2a){_0x3951b2[_0x4db9('0x43')]=_0x24aa2a;return _0x3951b2;})[_0x4db9('0x24')](respondWithFilteredResult(_0x20f133,_0x583861))[_0x4db9('0x44')](handleError(_0x20f133,null));};exports[_0x4db9('0x45')]=function(_0x4bb740,_0x56bd68){var _0x48aaf5={'raw':!![],'where':{'id':_0x4bb740[_0x4db9('0x46')]['id']}},_0x22a021={};_0x22a021['model']=_[_0x4db9('0x32')](db[_0x4db9('0x2d')]['rawAttributes']);_0x22a021['query']=_[_0x4db9('0x32')](_0x4bb740['query']);_0x22a021[_0x4db9('0x3b')]=_[_0x4db9('0x33')](_0x22a021['model'],_0x22a021[_0x4db9('0x31')]);_0x48aaf5[_0x4db9('0x34')]=_['intersection'](_0x22a021[_0x4db9('0x30')],qs[_0x4db9('0x35')](_0x4bb740[_0x4db9('0x31')]['fields']));_0x48aaf5['attributes']=_0x48aaf5[_0x4db9('0x34')][_0x4db9('0x36')]?_0x48aaf5[_0x4db9('0x34')]:_0x22a021[_0x4db9('0x30')];if(_0x4bb740[_0x4db9('0x31')][_0x4db9('0x40')]){_0x48aaf5[_0x4db9('0x41')]=[{'all':!![]}];}_0x48aaf5=_[_0x4db9('0x3d')]({},_0x48aaf5,_0x4bb740[_0x4db9('0x3f')]);return db[_0x4db9('0x2d')][_0x4db9('0x47')](_0x48aaf5)[_0x4db9('0x24')](handleEntityNotFound(_0x56bd68,null))[_0x4db9('0x24')](respondWithResult(_0x56bd68,null))['catch'](handleError(_0x56bd68,null));};exports[_0x4db9('0x48')]=function(_0x2faacf,_0x3852f0){return db[_0x4db9('0x2d')][_0x4db9('0x48')](_0x2faacf[_0x4db9('0x49')],{})[_0x4db9('0x24')](respondWithResult(_0x3852f0,0xc9))[_0x4db9('0x44')](handleError(_0x3852f0,null));};exports[_0x4db9('0x23')]=function(_0x2d6094,_0x10dccb){if(_0x2d6094['body']['id']){delete _0x2d6094['body']['id'];}return db[_0x4db9('0x2d')][_0x4db9('0x47')]({'where':{'id':_0x2d6094[_0x4db9('0x46')]['id']}})[_0x4db9('0x24')](handleEntityNotFound(_0x10dccb,null))[_0x4db9('0x24')](saveUpdates(_0x2d6094[_0x4db9('0x49')],null))[_0x4db9('0x24')](respondWithResult(_0x10dccb,null))[_0x4db9('0x44')](handleError(_0x10dccb,null));};exports['destroy']=function(_0xd8eae3,_0xcb832e){return db[_0x4db9('0x2d')][_0x4db9('0x47')]({'where':{'id':_0xd8eae3[_0x4db9('0x46')]['id']}})[_0x4db9('0x24')](handleEntityNotFound(_0xcb832e,null))[_0x4db9('0x24')](removeEntity(_0xcb832e,null))[_0x4db9('0x44')](handleError(_0xcb832e,null));};exports['describe']=function(_0x45bc79,_0xd6701a){return db[_0x4db9('0x2d')][_0x4db9('0x4a')]()[_0x4db9('0x24')](respondWithResult(_0xd6701a,null))[_0x4db9('0x44')](handleError(_0xd6701a,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 5a64b14..3e6b249 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 _0x095e=['request-promise','rimraf','../../config/environment','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','../../config/logger','moment','bluebird'];(function(_0x28cbc0,_0x203516){var _0x4b3cf5=function(_0x2a15c6){while(--_0x2a15c6){_0x28cbc0['push'](_0x28cbc0['shift']());}};_0x4b3cf5(++_0x203516);}(_0x095e,0xa7));var _0xe095=function(_0x240313,_0x38f5a4){_0x240313=_0x240313-0x0;var _0x5c312f=_0x095e[_0x240313];return _0x5c312f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe095('0x0'))('api');var moment=require(_0xe095('0x1'));var BPromise=require(_0xe095('0x2'));var rp=require(_0xe095('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe095('0x4'));var config=require(_0xe095('0x5'));var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x6acb4b,_0x174160){return _0x6acb4b[_0xe095('0x6')](_0xe095('0x7'),attributes,{'tableName':_0xe095('0x8'),'paranoid':![],'indexes':[{'name':_0xe095('0x9'),'fields':[_0xe095('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa857=['bluebird','request-promise','path','../../config/environment','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','api'];(function(_0x4ecefd,_0x270199){var _0x5c5978=function(_0x1f0d0b){while(--_0x1f0d0b){_0x4ecefd['push'](_0x4ecefd['shift']());}};_0x5c5978(++_0x270199);}(_0xa857,0x18b));var _0x7a85=function(_0x428b0e,_0x359e12){_0x428b0e=_0x428b0e-0x0;var _0x245a6c=_0xa857[_0x428b0e];return _0x245a6c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7a85('0x0'));var moment=require('moment');var BPromise=require(_0x7a85('0x1'));var rp=require(_0x7a85('0x2'));var fs=require('fs');var path=require(_0x7a85('0x3'));var rimraf=require('rimraf');var config=require(_0x7a85('0x4'));var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x1d97ef,_0x20e889){return _0x1d97ef[_0x7a85('0x5')](_0x7a85('0x6'),attributes,{'tableName':_0x7a85('0x7'),'paranoid':![],'indexes':[{'name':_0x7a85('0x8'),'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 2c2da2d..480cb07 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 _0x2d1c=['info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','then','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request'];(function(_0x183fd8,_0x2eeb07){var _0x4c5b75=function(_0x9dc9fb){while(--_0x9dc9fb){_0x183fd8['push'](_0x183fd8['shift']());}};_0x4c5b75(++_0x2eeb07);}(_0x2d1c,0x134));var _0xc2d1=function(_0x3fa545,_0x3df2f9){_0x3fa545=_0x3fa545-0x0;var _0x198b71=_0x2d1c[_0x3fa545];return _0x198b71;};'use strict';var _=require(_0xc2d1('0x0'));var util=require(_0xc2d1('0x1'));var moment=require(_0xc2d1('0x2'));var BPromise=require(_0xc2d1('0x3'));var rs=require(_0xc2d1('0x4'));var fs=require('fs');var Redis=require(_0xc2d1('0x5'));var db=require(_0xc2d1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc2d1('0x7'));var jayson=require(_0xc2d1('0x8'));var client=jayson[_0xc2d1('0x9')][_0xc2d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b8e3e,_0x2567e1,_0x5c977e){return new BPromise(function(_0xa2d9e7,_0x1576e6){return client[_0xc2d1('0xb')](_0x1b8e3e,_0x5c977e)['then'](function(_0x2d4dbc){logger[_0xc2d1('0xc')](_0xc2d1('0xd'),_0x2567e1,_0xc2d1('0xe'));logger[_0xc2d1('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x2567e1,_0xc2d1('0xe'),JSON[_0xc2d1('0x10')](_0x2d4dbc));if(_0x2d4dbc[_0xc2d1('0x11')]){if(_0x2d4dbc[_0xc2d1('0x11')]['code']===0x1f4){logger[_0xc2d1('0x11')](_0xc2d1('0xd'),_0x2567e1,_0x2d4dbc[_0xc2d1('0x11')][_0xc2d1('0x12')]);return _0x1576e6(_0x2d4dbc['error'][_0xc2d1('0x12')]);}logger[_0xc2d1('0x11')](_0xc2d1('0xd'),_0x2567e1,_0x2d4dbc[_0xc2d1('0x11')]['message']);return _0xa2d9e7(_0x2d4dbc[_0xc2d1('0x11')][_0xc2d1('0x12')]);}else{logger[_0xc2d1('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2567e1,_0xc2d1('0xe'));_0xa2d9e7(_0x2d4dbc[_0xc2d1('0x13')]['message']);}})[_0xc2d1('0x14')](function(_0x1df31a){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x2567e1,_0x1df31a);_0x1576e6(_0x1df31a);});});}exports[_0xc2d1('0x15')]=function(_0x3bd295){var _0x53829c=this;return new Promise(function(_0x196c9e,_0x3d7ce1){return db[_0xc2d1('0x16')][_0xc2d1('0x17')](_0x3bd295[_0xc2d1('0x18')],{'raw':_0x3bd295[_0xc2d1('0x19')]?_0x3bd295[_0xc2d1('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xc2d1('0x1a')](function(_0xeff349){logger[_0xc2d1('0xc')](_0xc2d1('0x15'),_0x3bd295);logger[_0xc2d1('0xf')](_0xc2d1('0x15'),_0x3bd295,JSON[_0xc2d1('0x10')](_0xeff349));_0x196c9e(_0xeff349);})[_0xc2d1('0x14')](function(_0x27c068){logger['error']('CreateWhatsappQueueReport',_0x27c068['message'],_0x3bd295);_0x3d7ce1(_0x53829c[_0xc2d1('0x11')](0x1f4,_0x27c068[_0xc2d1('0x12')]));});});};exports[_0xc2d1('0x1b')]=function(_0x149dee){var _0x4dace2=this;return new Promise(function(_0xf73ee1,_0x148c17){return db[_0xc2d1('0x16')][_0xc2d1('0x1c')](_0x149dee[_0xc2d1('0x18')],{'raw':_0x149dee[_0xc2d1('0x19')]?_0x149dee[_0xc2d1('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x149dee['options']?_0x149dee[_0xc2d1('0x19')][_0xc2d1('0x1d')]||null:null,'attributes':_0x149dee[_0xc2d1('0x19')]?_0x149dee[_0xc2d1('0x19')][_0xc2d1('0x1e')]||null:null,'limit':_0x149dee[_0xc2d1('0x19')]?_0x149dee['options'][_0xc2d1('0x1f')]||null:null})['then'](function(_0x2277dd){logger[_0xc2d1('0xc')](_0xc2d1('0x1b'),_0x149dee);logger[_0xc2d1('0xf')]('UpdateWhatsappQueueReport',_0x149dee,JSON[_0xc2d1('0x10')](_0x2277dd));_0xf73ee1(_0x2277dd);})[_0xc2d1('0x14')](function(_0x5cec99){logger['error'](_0xc2d1('0x1b'),_0x5cec99[_0xc2d1('0x12')],_0x149dee);_0x148c17(_0x4dace2[_0xc2d1('0x11')](0x1f4,_0x5cec99[_0xc2d1('0x12')]));});});}; \ No newline at end of file +var _0x7397=['WhatsappQueueReport,\x20%s,\x20%s','message','result','CreateWhatsappQueueReport','create','body','options','raw','debug','catch','UpdateWhatsappQueueReport','WhatsappQueueReport','where','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x384498,_0x266402){var _0x343599=function(_0x39a24d){while(--_0x39a24d){_0x384498['push'](_0x384498['shift']());}};_0x343599(++_0x266402);}(_0x7397,0x12e));var _0x7739=function(_0x4f1738,_0x28f452){_0x4f1738=_0x4f1738-0x0;var _0x1b36c2=_0x7397[_0x4f1738];return _0x1b36c2;};'use strict';var _=require(_0x7739('0x0'));var util=require(_0x7739('0x1'));var moment=require(_0x7739('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7739('0x3'));var db=require(_0x7739('0x4'))['db'];var utils=require(_0x7739('0x5'));var logger=require(_0x7739('0x6'))(_0x7739('0x7'));var config=require(_0x7739('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7739('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49b396,_0x10a731,_0x50c71f){return new BPromise(function(_0x3b99c6,_0x3adf36){return client[_0x7739('0xa')](_0x49b396,_0x50c71f)[_0x7739('0xb')](function(_0x2e3ca6){logger[_0x7739('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x10a731,_0x7739('0xd'));logger['debug'](_0x7739('0xe'),_0x10a731,_0x7739('0xd'),JSON[_0x7739('0xf')](_0x2e3ca6));if(_0x2e3ca6[_0x7739('0x10')]){if(_0x2e3ca6[_0x7739('0x10')][_0x7739('0x11')]===0x1f4){logger[_0x7739('0x10')](_0x7739('0x12'),_0x10a731,_0x2e3ca6[_0x7739('0x10')][_0x7739('0x13')]);return _0x3adf36(_0x2e3ca6[_0x7739('0x10')][_0x7739('0x13')]);}logger[_0x7739('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x10a731,_0x2e3ca6[_0x7739('0x10')]['message']);return _0x3b99c6(_0x2e3ca6[_0x7739('0x10')]['message']);}else{logger[_0x7739('0xc')](_0x7739('0x12'),_0x10a731,_0x7739('0xd'));_0x3b99c6(_0x2e3ca6[_0x7739('0x14')][_0x7739('0x13')]);}})['catch'](function(_0x355e2a){logger[_0x7739('0x10')](_0x7739('0x12'),_0x10a731,_0x355e2a);_0x3adf36(_0x355e2a);});});}exports[_0x7739('0x15')]=function(_0x3df7f9){var _0x415135=this;return new Promise(function(_0x5015df,_0x35d8ac){return db['WhatsappQueueReport'][_0x7739('0x16')](_0x3df7f9[_0x7739('0x17')],{'raw':_0x3df7f9[_0x7739('0x18')]?_0x3df7f9[_0x7739('0x18')][_0x7739('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5b77b9){logger[_0x7739('0xc')](_0x7739('0x15'),_0x3df7f9);logger[_0x7739('0x1a')](_0x7739('0x15'),_0x3df7f9,JSON['stringify'](_0x5b77b9));_0x5015df(_0x5b77b9);})[_0x7739('0x1b')](function(_0x2272c0){logger[_0x7739('0x10')](_0x7739('0x15'),_0x2272c0[_0x7739('0x13')],_0x3df7f9);_0x35d8ac(_0x415135[_0x7739('0x10')](0x1f4,_0x2272c0[_0x7739('0x13')]));});});};exports[_0x7739('0x1c')]=function(_0x2ad569){var _0x2f0150=this;return new Promise(function(_0xdd12b1,_0x43090b){return db[_0x7739('0x1d')]['update'](_0x2ad569['body'],{'raw':_0x2ad569[_0x7739('0x18')]?_0x2ad569[_0x7739('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ad569['options']?_0x2ad569['options'][_0x7739('0x1e')]||null:null,'attributes':_0x2ad569[_0x7739('0x18')]?_0x2ad569[_0x7739('0x18')]['attributes']||null:null,'limit':_0x2ad569[_0x7739('0x18')]?_0x2ad569[_0x7739('0x18')][_0x7739('0x1f')]||null:null})[_0x7739('0xb')](function(_0x22e811){logger[_0x7739('0xc')](_0x7739('0x1c'),_0x2ad569);logger[_0x7739('0x1a')](_0x7739('0x1c'),_0x2ad569,JSON[_0x7739('0xf')](_0x22e811));_0xdd12b1(_0x22e811);})[_0x7739('0x1b')](function(_0x1ff486){logger[_0x7739('0x10')](_0x7739('0x1c'),_0x1ff486[_0x7739('0x13')],_0x2ad569);_0x43090b(_0x2f0150['error'](0x1f4,_0x1ff486[_0x7739('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 327c976..89b3f51 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 _0xaab7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','index','get','/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x3ad4bb,_0x35910e){var _0xf5518d=function(_0x2155b2){while(--_0x2155b2){_0x3ad4bb['push'](_0x3ad4bb['shift']());}};_0xf5518d(++_0x35910e);}(_0xaab7,0xc1));var _0x7aab=function(_0x17f305,_0xadf159){_0x17f305=_0x17f305-0x0;var _0x4a8570=_0xaab7[_0x17f305];return _0x4a8570;};'use strict';var multer=require(_0x7aab('0x0'));var util=require(_0x7aab('0x1'));var path=require(_0x7aab('0x2'));var timeout=require(_0x7aab('0x3'));var express=require('express');var router=express[_0x7aab('0x4')]();var fs_extra=require(_0x7aab('0x5'));var auth=require(_0x7aab('0x6'));var interaction=require(_0x7aab('0x7'));var config=require(_0x7aab('0x8'));var controller=require(_0x7aab('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7aab('0xa')]);router[_0x7aab('0xb')](_0x7aab('0xc'),auth[_0x7aab('0xd')](),controller['describe']);router['get'](_0x7aab('0xe'),auth[_0x7aab('0xd')](),controller['show']);router[_0x7aab('0xf')]('/',auth[_0x7aab('0xd')](),controller[_0x7aab('0x10')]);router[_0x7aab('0x11')](_0x7aab('0xe'),auth[_0x7aab('0xd')](),controller[_0x7aab('0x12')]);router[_0x7aab('0x13')](_0x7aab('0xe'),auth['isAuthenticated'](),controller[_0x7aab('0x14')]);module[_0x7aab('0x15')]=router; \ No newline at end of file +var _0xc845=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x76f220,_0x3e6f86){var _0x296467=function(_0x4cf17e){while(--_0x4cf17e){_0x76f220['push'](_0x76f220['shift']());}};_0x296467(++_0x3e6f86);}(_0xc845,0xae));var _0x5c84=function(_0x3011ba,_0xb182e3){_0x3011ba=_0x3011ba-0x0;var _0x3c6e2d=_0xc845[_0x3011ba];return _0x3c6e2d;};'use strict';var multer=require(_0x5c84('0x0'));var util=require(_0x5c84('0x1'));var path=require(_0x5c84('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c84('0x3'));var router=express[_0x5c84('0x4')]();var fs_extra=require(_0x5c84('0x5'));var auth=require(_0x5c84('0x6'));var interaction=require(_0x5c84('0x7'));var config=require('../../config/environment');var controller=require(_0x5c84('0x8'));router[_0x5c84('0x9')]('/',auth[_0x5c84('0xa')](),controller[_0x5c84('0xb')]);router['get'](_0x5c84('0xc'),auth[_0x5c84('0xa')](),controller[_0x5c84('0xd')]);router[_0x5c84('0x9')](_0x5c84('0xe'),auth['isAuthenticated'](),controller[_0x5c84('0xf')]);router[_0x5c84('0x10')]('/',auth[_0x5c84('0xa')](),controller[_0x5c84('0x11')]);router[_0x5c84('0x12')](_0x5c84('0xe'),auth[_0x5c84('0xa')](),controller[_0x5c84('0x13')]);router['delete'](_0x5c84('0xe'),auth['isAuthenticated'](),controller[_0x5c84('0x14')]);module[_0x5c84('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 60a37a2..5ec665d 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 _0xc2a2=['exports','STRING','ENUM','agent','queue','DATE','sequelize'];(function(_0x2c357d,_0x2e4e6d){var _0x1e7250=function(_0x12d11e){while(--_0x12d11e){_0x2c357d['push'](_0x2c357d['shift']());}};_0x1e7250(++_0x2e4e6d);}(_0xc2a2,0x84));var _0x2c2a=function(_0x8668a5,_0x54a68f){_0x8668a5=_0x8668a5-0x0;var _0x304f06=_0xc2a2[_0x8668a5];return _0x304f06;};'use strict';var Sequelize=require(_0x2c2a('0x0'));module[_0x2c2a('0x1')]={'uniqueid':{'type':Sequelize[_0x2c2a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2c2a('0x3')]('account',_0x2c2a('0x4'),_0x2c2a('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2c2a('0x6')]}}; \ No newline at end of file +var _0x0c8d=['agent','exports','STRING','ENUM','account'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x0c8d,0x79));var _0xd0c8=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x0c8d[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require('sequelize');module[_0xd0c8('0x0')]={'uniqueid':{'type':Sequelize[_0xd0c8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd0c8('0x2')](_0xd0c8('0x3'),_0xd0c8('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index ff0281c..6ca246f 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 _0x1c45=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0xa3ab5f,_0x26819c){var _0x57e9e1=function(_0x160a60){while(--_0x160a60){_0xa3ab5f['push'](_0xa3ab5f['shift']());}};_0x57e9e1(++_0x26819c);}(_0x1c45,0x1b0));var _0x51c4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1c45[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x51c4('0x0'));var rimraf=require(_0x51c4('0x1'));var zipdir=require(_0x51c4('0x2'));var jsonpatch=require(_0x51c4('0x3'));var rp=require(_0x51c4('0x4'));var moment=require(_0x51c4('0x5'));var BPromise=require(_0x51c4('0x6'));var Mustache=require(_0x51c4('0x7'));var util=require('util');var path=require('path');var sox=require(_0x51c4('0x8'));var csv=require(_0x51c4('0x9'));var ejs=require(_0x51c4('0xa'));var fs=require('fs');var fs_extra=require(_0x51c4('0xb'));var _=require(_0x51c4('0xc'));var squel=require(_0x51c4('0xd'));var crypto=require(_0x51c4('0xe'));var jsforce=require(_0x51c4('0xf'));var deskjs=require(_0x51c4('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51c4('0x11'));var Redis=require(_0x51c4('0x12'));var authService=require(_0x51c4('0x13'));var qs=require(_0x51c4('0x14'));var as=require(_0x51c4('0x15'));var hardwareService=require(_0x51c4('0x16'));var logger=require('../../config/logger')(_0x51c4('0x17'));var utils=require(_0x51c4('0x18'));var config=require(_0x51c4('0x19'));var licenseUtil=require(_0x51c4('0x1a'));var db=require(_0x51c4('0x1b'))['db'];function respondWithStatusCode(_0x1dca68,_0x434399){_0x434399=_0x434399||0xcc;return function(_0xffd39c){if(_0xffd39c){return _0x1dca68[_0x51c4('0x1c')](_0x434399);}return _0x1dca68[_0x51c4('0x1d')](_0x434399)[_0x51c4('0x1e')]();};}function respondWithResult(_0x45d015,_0x4454cc){_0x4454cc=_0x4454cc||0xc8;return function(_0x52245d){if(_0x52245d){return _0x45d015[_0x51c4('0x1d')](_0x4454cc)[_0x51c4('0x1f')](_0x52245d);}};}function respondWithFilteredResult(_0x5e9fce,_0x312169){return function(_0x42d96f){if(_0x42d96f){var _0x317b8d=typeof _0x312169[_0x51c4('0x20')]===_0x51c4('0x21')&&typeof _0x312169[_0x51c4('0x22')]===_0x51c4('0x21');var _0x4e3b7b=_0x42d96f[_0x51c4('0x23')];var _0x40ebc8=_0x317b8d?0x0:_0x312169['offset'];var _0x342b4d=_0x317b8d?_0x42d96f['count']:_0x312169[_0x51c4('0x20')]+_0x312169[_0x51c4('0x22')];var _0x2e7341;if(_0x342b4d>=_0x4e3b7b){_0x342b4d=_0x4e3b7b;_0x2e7341=0xc8;}else{_0x2e7341=0xce;}_0x5e9fce[_0x51c4('0x1d')](_0x2e7341);return _0x5e9fce['set'](_0x51c4('0x24'),_0x40ebc8+'-'+_0x342b4d+'/'+_0x4e3b7b)[_0x51c4('0x1f')](_0x42d96f);}return null;};}function patchUpdates(_0x47878a){return function(_0x4f991f){try{jsonpatch[_0x51c4('0x25')](_0x4f991f,_0x47878a,!![]);}catch(_0x1fb226){return BPromise[_0x51c4('0x26')](_0x1fb226);}return _0x4f991f[_0x51c4('0x27')]();};}function saveUpdates(_0x394822,_0x3a80db){return function(_0x590c9a){if(_0x590c9a){return _0x590c9a[_0x51c4('0x28')](_0x394822)[_0x51c4('0x29')](function(_0x3cc1c0){return _0x3cc1c0;});}return null;};}function removeEntity(_0x3b56d1,_0x2281a0){return function(_0x13128f){if(_0x13128f){return _0x13128f[_0x51c4('0x2a')]()[_0x51c4('0x29')](function(){_0x3b56d1[_0x51c4('0x1d')](0xcc)[_0x51c4('0x1e')]();});}};}function handleEntityNotFound(_0x63bfd2,_0x53206d){return function(_0x367065){if(!_0x367065){_0x63bfd2[_0x51c4('0x1c')](0x194);}return _0x367065;};}function handleError(_0x3915d2,_0x29a148){_0x29a148=_0x29a148||0x1f4;return function(_0x322095){logger[_0x51c4('0x2b')](_0x322095[_0x51c4('0x2c')]);if(_0x322095[_0x51c4('0x2d')]){delete _0x322095[_0x51c4('0x2d')];}_0x3915d2[_0x51c4('0x1d')](_0x29a148)[_0x51c4('0x2e')](_0x322095);};}exports[_0x51c4('0x2f')]=function(_0x32ef99,_0x1cf544){var _0x692db2={},_0x573f86={},_0x3cfff4={'count':0x0,'rows':[]};var _0x2ea454=_['map'](db[_0x51c4('0x30')][_0x51c4('0x31')],function(_0x132175){return{'name':_0x132175[_0x51c4('0x32')],'type':_0x132175[_0x51c4('0x33')]['key']};});_0x573f86[_0x51c4('0x34')]=_[_0x51c4('0x35')](_0x2ea454,_0x51c4('0x2d'));_0x573f86[_0x51c4('0x36')]=_['keys'](_0x32ef99['query']);_0x573f86[_0x51c4('0x37')]=_[_0x51c4('0x38')](_0x573f86['model'],_0x573f86[_0x51c4('0x36')]);_0x692db2[_0x51c4('0x39')]=_['intersection'](_0x573f86['model'],qs[_0x51c4('0x3a')](_0x32ef99[_0x51c4('0x36')][_0x51c4('0x3a')]));_0x692db2['attributes']=_0x692db2[_0x51c4('0x39')][_0x51c4('0x3b')]?_0x692db2[_0x51c4('0x39')]:_0x573f86[_0x51c4('0x34')];if(!_0x32ef99['query'][_0x51c4('0x3c')](_0x51c4('0x3d'))){_0x692db2['limit']=qs[_0x51c4('0x22')](_0x32ef99['query'][_0x51c4('0x22')]);_0x692db2[_0x51c4('0x20')]=qs[_0x51c4('0x20')](_0x32ef99[_0x51c4('0x36')][_0x51c4('0x20')]);}_0x692db2['order']=qs[_0x51c4('0x3e')](_0x32ef99['query'][_0x51c4('0x3e')]);_0x692db2[_0x51c4('0x3f')]=qs[_0x51c4('0x37')](_[_0x51c4('0x40')](_0x32ef99[_0x51c4('0x36')],_0x573f86[_0x51c4('0x37')]),_0x2ea454);if(_0x32ef99[_0x51c4('0x36')][_0x51c4('0x41')]){_0x692db2[_0x51c4('0x3f')]=_[_0x51c4('0x42')](_0x692db2[_0x51c4('0x3f')],{'$or':_[_0x51c4('0x35')](_0x2ea454,function(_0x1e32d3){if(_0x1e32d3[_0x51c4('0x33')]!=='VIRTUAL'){var _0x3fad33={};_0x3fad33[_0x1e32d3[_0x51c4('0x2d')]]={'$like':'%'+_0x32ef99[_0x51c4('0x36')][_0x51c4('0x41')]+'%'};return _0x3fad33;}})});}_0x692db2=_[_0x51c4('0x42')]({},_0x692db2,_0x32ef99[_0x51c4('0x43')]);var _0x20d0ee={'where':_0x692db2[_0x51c4('0x3f')]};return db[_0x51c4('0x30')][_0x51c4('0x23')](_0x20d0ee)['then'](function(_0x3fabad){_0x3cfff4[_0x51c4('0x23')]=_0x3fabad;if(_0x32ef99[_0x51c4('0x36')][_0x51c4('0x44')]){_0x692db2[_0x51c4('0x45')]=[{'all':!![]}];}return db[_0x51c4('0x30')]['findAll'](_0x692db2);})[_0x51c4('0x29')](function(_0x3e73ee){_0x3cfff4[_0x51c4('0x46')]=_0x3e73ee;return _0x3cfff4;})[_0x51c4('0x29')](respondWithFilteredResult(_0x1cf544,_0x692db2))[_0x51c4('0x47')](handleError(_0x1cf544,null));};exports[_0x51c4('0x48')]=function(_0x91929,_0xef2287){var _0x20b160={'raw':!![],'where':{'id':_0x91929['params']['id']}},_0x259b15={};_0x259b15[_0x51c4('0x34')]=_['keys'](db[_0x51c4('0x30')][_0x51c4('0x31')]);_0x259b15[_0x51c4('0x36')]=_['keys'](_0x91929[_0x51c4('0x36')]);_0x259b15['filters']=_[_0x51c4('0x38')](_0x259b15['model'],_0x259b15[_0x51c4('0x36')]);_0x20b160[_0x51c4('0x39')]=_[_0x51c4('0x38')](_0x259b15['model'],qs[_0x51c4('0x3a')](_0x91929['query'][_0x51c4('0x3a')]));_0x20b160[_0x51c4('0x39')]=_0x20b160[_0x51c4('0x39')]['length']?_0x20b160[_0x51c4('0x39')]:_0x259b15['model'];if(_0x91929['query']['includeAll']){_0x20b160['include']=[{'all':!![]}];}_0x20b160=_[_0x51c4('0x42')]({},_0x20b160,_0x91929[_0x51c4('0x43')]);return db[_0x51c4('0x30')][_0x51c4('0x49')](_0x20b160)[_0x51c4('0x29')](handleEntityNotFound(_0xef2287,null))[_0x51c4('0x29')](respondWithResult(_0xef2287,null))[_0x51c4('0x47')](handleError(_0xef2287,null));};exports[_0x51c4('0x4a')]=function(_0x174312,_0x2dba45){return db['WhatsappTransferReport'][_0x51c4('0x4a')](_0x174312[_0x51c4('0x4b')],{})[_0x51c4('0x29')](respondWithResult(_0x2dba45,0xc9))[_0x51c4('0x47')](handleError(_0x2dba45,null));};exports[_0x51c4('0x28')]=function(_0x2d78c3,_0x286004){if(_0x2d78c3[_0x51c4('0x4b')]['id']){delete _0x2d78c3['body']['id'];}return db[_0x51c4('0x30')][_0x51c4('0x49')]({'where':{'id':_0x2d78c3[_0x51c4('0x4c')]['id']}})[_0x51c4('0x29')](handleEntityNotFound(_0x286004,null))[_0x51c4('0x29')](saveUpdates(_0x2d78c3[_0x51c4('0x4b')],null))[_0x51c4('0x29')](respondWithResult(_0x286004,null))['catch'](handleError(_0x286004,null));};exports[_0x51c4('0x2a')]=function(_0x2314b7,_0x27ddd8){return db[_0x51c4('0x30')]['find']({'where':{'id':_0x2314b7[_0x51c4('0x4c')]['id']}})[_0x51c4('0x29')](handleEntityNotFound(_0x27ddd8,null))[_0x51c4('0x29')](removeEntity(_0x27ddd8,null))[_0x51c4('0x47')](handleError(_0x27ddd8,null));};exports[_0x51c4('0x4d')]=function(_0xc72c66,_0x4b3313){return db[_0x51c4('0x30')][_0x51c4('0x4d')]()['then'](respondWithResult(_0x4b3313,null))[_0x51c4('0x47')](handleError(_0x4b3313,null));}; \ No newline at end of file +var _0x5829=['catch','show','params','includeAll','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','fieldName','type','key','map','keys','filters','intersection','model','attributes','fields','length','query','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows'];(function(_0x1507da,_0x7a9fae){var _0x520074=function(_0x3a7f89){while(--_0x3a7f89){_0x1507da['push'](_0x1507da['shift']());}};_0x520074(++_0x7a9fae);}(_0x5829,0xf4));var _0x9582=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x5829[_0x4a7631];return _0x1a5a6f;};'use strict';var emlformat=require(_0x9582('0x0'));var rimraf=require(_0x9582('0x1'));var zipdir=require(_0x9582('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9582('0x3'));var moment=require('moment');var BPromise=require(_0x9582('0x4'));var Mustache=require('mustache');var util=require(_0x9582('0x5'));var path=require(_0x9582('0x6'));var sox=require(_0x9582('0x7'));var csv=require(_0x9582('0x8'));var ejs=require(_0x9582('0x9'));var fs=require('fs');var fs_extra=require(_0x9582('0xa'));var _=require(_0x9582('0xb'));var squel=require(_0x9582('0xc'));var crypto=require(_0x9582('0xd'));var jsforce=require(_0x9582('0xe'));var deskjs=require(_0x9582('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9582('0x10'));var Papa=require('papaparse');var Redis=require(_0x9582('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9582('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9582('0x13'))(_0x9582('0x14'));var utils=require(_0x9582('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9582('0x16'))['db'];function respondWithStatusCode(_0x373352,_0x1d3890){_0x1d3890=_0x1d3890||0xcc;return function(_0x4141f0){if(_0x4141f0){return _0x373352[_0x9582('0x17')](_0x1d3890);}return _0x373352[_0x9582('0x18')](_0x1d3890)[_0x9582('0x19')]();};}function respondWithResult(_0xec997c,_0x3b696a){_0x3b696a=_0x3b696a||0xc8;return function(_0x82e6b8){if(_0x82e6b8){return _0xec997c[_0x9582('0x18')](_0x3b696a)[_0x9582('0x1a')](_0x82e6b8);}};}function respondWithFilteredResult(_0x54b881,_0x1b568b){return function(_0x5ade93){if(_0x5ade93){var _0x2029eb=typeof _0x1b568b[_0x9582('0x1b')]===_0x9582('0x1c')&&typeof _0x1b568b[_0x9582('0x1d')]==='undefined';var _0x42f583=_0x5ade93[_0x9582('0x1e')];var _0x5bff08=_0x2029eb?0x0:_0x1b568b['offset'];var _0x3bb84d=_0x2029eb?_0x5ade93[_0x9582('0x1e')]:_0x1b568b[_0x9582('0x1b')]+_0x1b568b[_0x9582('0x1d')];var _0x53178b;if(_0x3bb84d>=_0x42f583){_0x3bb84d=_0x42f583;_0x53178b=0xc8;}else{_0x53178b=0xce;}_0x54b881[_0x9582('0x18')](_0x53178b);return _0x54b881[_0x9582('0x1f')](_0x9582('0x20'),_0x5bff08+'-'+_0x3bb84d+'/'+_0x42f583)[_0x9582('0x1a')](_0x5ade93);}return null;};}function patchUpdates(_0x7d50bc){return function(_0x521f7f){try{jsonpatch[_0x9582('0x21')](_0x521f7f,_0x7d50bc,!![]);}catch(_0x3587cc){return BPromise[_0x9582('0x22')](_0x3587cc);}return _0x521f7f[_0x9582('0x23')]();};}function saveUpdates(_0x3afe26,_0x4e249a){return function(_0x382908){if(_0x382908){return _0x382908[_0x9582('0x24')](_0x3afe26)[_0x9582('0x25')](function(_0x41af22){return _0x41af22;});}return null;};}function removeEntity(_0x33b3e5,_0x42f217){return function(_0x181d95){if(_0x181d95){return _0x181d95['destroy']()[_0x9582('0x25')](function(){_0x33b3e5[_0x9582('0x18')](0xcc)[_0x9582('0x19')]();});}};}function handleEntityNotFound(_0x3a3ada,_0x1ad277){return function(_0xe6484b){if(!_0xe6484b){_0x3a3ada[_0x9582('0x17')](0x194);}return _0xe6484b;};}function handleError(_0x2f2b8d,_0x271334){_0x271334=_0x271334||0x1f4;return function(_0x538e80){logger[_0x9582('0x26')](_0x538e80[_0x9582('0x27')]);if(_0x538e80[_0x9582('0x28')]){delete _0x538e80['name'];}_0x2f2b8d['status'](_0x271334)[_0x9582('0x29')](_0x538e80);};}exports[_0x9582('0x2a')]=function(_0x4d1710,_0x307325){var _0x588841={},_0x354eec={},_0x3d1c5a={'count':0x0,'rows':[]};var _0x8c5c40=_['map'](db[_0x9582('0x2b')][_0x9582('0x2c')],function(_0x4d2bc4){return{'name':_0x4d2bc4[_0x9582('0x2d')],'type':_0x4d2bc4[_0x9582('0x2e')][_0x9582('0x2f')]};});_0x354eec['model']=_[_0x9582('0x30')](_0x8c5c40,_0x9582('0x28'));_0x354eec['query']=_[_0x9582('0x31')](_0x4d1710['query']);_0x354eec[_0x9582('0x32')]=_[_0x9582('0x33')](_0x354eec[_0x9582('0x34')],_0x354eec['query']);_0x588841[_0x9582('0x35')]=_[_0x9582('0x33')](_0x354eec[_0x9582('0x34')],qs[_0x9582('0x36')](_0x4d1710['query'][_0x9582('0x36')]));_0x588841['attributes']=_0x588841[_0x9582('0x35')][_0x9582('0x37')]?_0x588841[_0x9582('0x35')]:_0x354eec[_0x9582('0x34')];if(!_0x4d1710[_0x9582('0x38')][_0x9582('0x39')](_0x9582('0x3a'))){_0x588841[_0x9582('0x1d')]=qs[_0x9582('0x1d')](_0x4d1710[_0x9582('0x38')][_0x9582('0x1d')]);_0x588841['offset']=qs[_0x9582('0x1b')](_0x4d1710[_0x9582('0x38')][_0x9582('0x1b')]);}_0x588841['order']=qs[_0x9582('0x3b')](_0x4d1710['query'][_0x9582('0x3b')]);_0x588841[_0x9582('0x3c')]=qs[_0x9582('0x32')](_[_0x9582('0x3d')](_0x4d1710[_0x9582('0x38')],_0x354eec[_0x9582('0x32')]),_0x8c5c40);if(_0x4d1710['query'][_0x9582('0x3e')]){_0x588841[_0x9582('0x3c')]=_[_0x9582('0x3f')](_0x588841[_0x9582('0x3c')],{'$or':_[_0x9582('0x30')](_0x8c5c40,function(_0x25aaaf){if(_0x25aaaf[_0x9582('0x2e')]!==_0x9582('0x40')){var _0x4d4260={};_0x4d4260[_0x25aaaf[_0x9582('0x28')]]={'$like':'%'+_0x4d1710[_0x9582('0x38')][_0x9582('0x3e')]+'%'};return _0x4d4260;}})});}_0x588841=_[_0x9582('0x3f')]({},_0x588841,_0x4d1710['options']);var _0x4deb62={'where':_0x588841[_0x9582('0x3c')]};return db[_0x9582('0x2b')][_0x9582('0x1e')](_0x4deb62)['then'](function(_0x6044ed){_0x3d1c5a[_0x9582('0x1e')]=_0x6044ed;if(_0x4d1710[_0x9582('0x38')]['includeAll']){_0x588841[_0x9582('0x41')]=[{'all':!![]}];}return db[_0x9582('0x2b')][_0x9582('0x42')](_0x588841);})[_0x9582('0x25')](function(_0x1bfc4b){_0x3d1c5a[_0x9582('0x43')]=_0x1bfc4b;return _0x3d1c5a;})['then'](respondWithFilteredResult(_0x307325,_0x588841))[_0x9582('0x44')](handleError(_0x307325,null));};exports[_0x9582('0x45')]=function(_0x2c3899,_0x46a6f4){var _0x4d8937={'raw':!![],'where':{'id':_0x2c3899[_0x9582('0x46')]['id']}},_0x33c8df={};_0x33c8df[_0x9582('0x34')]=_[_0x9582('0x31')](db[_0x9582('0x2b')][_0x9582('0x2c')]);_0x33c8df[_0x9582('0x38')]=_[_0x9582('0x31')](_0x2c3899['query']);_0x33c8df['filters']=_[_0x9582('0x33')](_0x33c8df[_0x9582('0x34')],_0x33c8df[_0x9582('0x38')]);_0x4d8937[_0x9582('0x35')]=_[_0x9582('0x33')](_0x33c8df[_0x9582('0x34')],qs[_0x9582('0x36')](_0x2c3899[_0x9582('0x38')]['fields']));_0x4d8937[_0x9582('0x35')]=_0x4d8937[_0x9582('0x35')][_0x9582('0x37')]?_0x4d8937['attributes']:_0x33c8df[_0x9582('0x34')];if(_0x2c3899[_0x9582('0x38')][_0x9582('0x47')]){_0x4d8937['include']=[{'all':!![]}];}_0x4d8937=_[_0x9582('0x3f')]({},_0x4d8937,_0x2c3899[_0x9582('0x48')]);return db[_0x9582('0x2b')][_0x9582('0x49')](_0x4d8937)[_0x9582('0x25')](handleEntityNotFound(_0x46a6f4,null))[_0x9582('0x25')](respondWithResult(_0x46a6f4,null))[_0x9582('0x44')](handleError(_0x46a6f4,null));};exports[_0x9582('0x4a')]=function(_0x4f5a10,_0xf78b34){return db[_0x9582('0x2b')]['create'](_0x4f5a10[_0x9582('0x4b')],{})[_0x9582('0x25')](respondWithResult(_0xf78b34,0xc9))[_0x9582('0x44')](handleError(_0xf78b34,null));};exports[_0x9582('0x24')]=function(_0x27de32,_0x363b6e){if(_0x27de32[_0x9582('0x4b')]['id']){delete _0x27de32[_0x9582('0x4b')]['id'];}return db[_0x9582('0x2b')][_0x9582('0x49')]({'where':{'id':_0x27de32[_0x9582('0x46')]['id']}})[_0x9582('0x25')](handleEntityNotFound(_0x363b6e,null))[_0x9582('0x25')](saveUpdates(_0x27de32['body'],null))[_0x9582('0x25')](respondWithResult(_0x363b6e,null))[_0x9582('0x44')](handleError(_0x363b6e,null));};exports[_0x9582('0x4c')]=function(_0x8a7a0f,_0x3d2653){return db[_0x9582('0x2b')][_0x9582('0x49')]({'where':{'id':_0x8a7a0f[_0x9582('0x46')]['id']}})[_0x9582('0x25')](handleEntityNotFound(_0x3d2653,null))[_0x9582('0x25')](removeEntity(_0x3d2653,null))['catch'](handleError(_0x3d2653,null));};exports['describe']=function(_0x1ed5c1,_0x31db11){return db[_0x9582('0x2b')][_0x9582('0x4d')]()[_0x9582('0x25')](respondWithResult(_0x31db11,null))[_0x9582('0x44')](handleError(_0x31db11,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 37ad69b..5d4ab2f 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 _0xba39=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','./whatsappTransferReport.attributes','exports','report_whatsapp_transfer'];(function(_0x795bee,_0x20179f){var _0x5d62cb=function(_0x5bd8fc){while(--_0x5bd8fc){_0x795bee['push'](_0x795bee['shift']());}};_0x5d62cb(++_0x20179f);}(_0xba39,0x65));var _0x9ba3=function(_0x383b11,_0x4b15cf){_0x383b11=_0x383b11-0x0;var _0x2317aa=_0xba39[_0x383b11];return _0x2317aa;};'use strict';var _=require('lodash');var util=require(_0x9ba3('0x0'));var logger=require(_0x9ba3('0x1'))(_0x9ba3('0x2'));var moment=require(_0x9ba3('0x3'));var BPromise=require(_0x9ba3('0x4'));var rp=require(_0x9ba3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9ba3('0x6'));module[_0x9ba3('0x7')]=function(_0x72ef0c,_0x36720d){return _0x72ef0c['define']('WhatsappTransferReport',attributes,{'tableName':_0x9ba3('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9ba3('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8139=['./whatsappTransferReport.attributes','WhatsappTransferReport','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x134299,_0x42bd37){var _0xfc4c8c=function(_0xf76372){while(--_0xf76372){_0x134299['push'](_0x134299['shift']());}};_0xfc4c8c(++_0x42bd37);}(_0x8139,0x1bb));var _0x9813=function(_0x4312cc,_0xc893b6){_0x4312cc=_0x4312cc-0x0;var _0x222282=_0x8139[_0x4312cc];return _0x222282;};'use strict';var _=require('lodash');var util=require(_0x9813('0x0'));var logger=require(_0x9813('0x1'))('api');var moment=require(_0x9813('0x2'));var BPromise=require(_0x9813('0x3'));var rp=require(_0x9813('0x4'));var fs=require('fs');var path=require(_0x9813('0x5'));var rimraf=require('rimraf');var config=require(_0x9813('0x6'));var attributes=require(_0x9813('0x7'));module['exports']=function(_0x491067,_0x12cd7f){return _0x491067['define'](_0x9813('0x8'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x9813('0x9'),'fields':[_0x9813('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index ab238f3..796db13 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 _0xd920=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x1ac9f7,_0x17b6d1){var _0x7a9c38=function(_0x1f67b8){while(--_0x1f67b8){_0x1ac9f7['push'](_0x1ac9f7['shift']());}};_0x7a9c38(++_0x17b6d1);}(_0xd920,0x165));var _0x0d92=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0xd920[_0xd02bb];return _0x1cdf23;};'use strict';var _=require('lodash');var util=require(_0x0d92('0x0'));var moment=require(_0x0d92('0x1'));var BPromise=require('bluebird');var rs=require(_0x0d92('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d92('0x3'))['db'];var utils=require(_0x0d92('0x4'));var logger=require(_0x0d92('0x5'))(_0x0d92('0x6'));var config=require(_0x0d92('0x7'));var jayson=require(_0x0d92('0x8'));var client=jayson[_0x0d92('0x9')][_0x0d92('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21e161,_0x33e2f4,_0x4885f6){return new BPromise(function(_0x2bb36d,_0x11c943){return client['request'](_0x21e161,_0x4885f6)[_0x0d92('0xb')](function(_0x3adf8c){logger[_0x0d92('0xc')](_0x0d92('0xd'),_0x33e2f4,_0x0d92('0xe'));logger['debug'](_0x0d92('0xf'),_0x33e2f4,'request\x20sent',JSON[_0x0d92('0x10')](_0x3adf8c));if(_0x3adf8c[_0x0d92('0x11')]){if(_0x3adf8c[_0x0d92('0x11')][_0x0d92('0x12')]===0x1f4){logger[_0x0d92('0x11')](_0x0d92('0xd'),_0x33e2f4,_0x3adf8c['error'][_0x0d92('0x13')]);return _0x11c943(_0x3adf8c[_0x0d92('0x11')][_0x0d92('0x13')]);}logger[_0x0d92('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x33e2f4,_0x3adf8c[_0x0d92('0x11')][_0x0d92('0x13')]);return _0x2bb36d(_0x3adf8c[_0x0d92('0x11')][_0x0d92('0x13')]);}else{logger[_0x0d92('0xc')](_0x0d92('0xd'),_0x33e2f4,_0x0d92('0xe'));_0x2bb36d(_0x3adf8c['result'][_0x0d92('0x13')]);}})[_0x0d92('0x14')](function(_0x376008){logger[_0x0d92('0x11')](_0x0d92('0xd'),_0x33e2f4,_0x376008);_0x11c943(_0x376008);});});} \ No newline at end of file +var _0x4ab6=['jayson/promise','client','http','request','then','info','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1ae661,_0x3a7e42){var _0x11edfb=function(_0xe8870f){while(--_0xe8870f){_0x1ae661['push'](_0x1ae661['shift']());}};_0x11edfb(++_0x3a7e42);}(_0x4ab6,0x19f));var _0x64ab=function(_0x584b3f,_0x3b21a5){_0x584b3f=_0x584b3f-0x0;var _0x359088=_0x4ab6[_0x584b3f];return _0x359088;};'use strict';var _=require('lodash');var util=require(_0x64ab('0x0'));var moment=require(_0x64ab('0x1'));var BPromise=require(_0x64ab('0x2'));var rs=require(_0x64ab('0x3'));var fs=require('fs');var Redis=require(_0x64ab('0x4'));var db=require(_0x64ab('0x5'))['db'];var utils=require(_0x64ab('0x6'));var logger=require(_0x64ab('0x7'))(_0x64ab('0x8'));var config=require(_0x64ab('0x9'));var jayson=require(_0x64ab('0xa'));var client=jayson[_0x64ab('0xb')][_0x64ab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18eb22,_0x27a53b,_0x41738c){return new BPromise(function(_0x5cb2e5,_0x44e8a8){return client[_0x64ab('0xd')](_0x18eb22,_0x41738c)[_0x64ab('0xe')](function(_0x2aabeb){logger[_0x64ab('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x27a53b,'request\x20sent');logger[_0x64ab('0x10')](_0x64ab('0x11'),_0x27a53b,_0x64ab('0x12'),JSON[_0x64ab('0x13')](_0x2aabeb));if(_0x2aabeb[_0x64ab('0x14')]){if(_0x2aabeb[_0x64ab('0x14')][_0x64ab('0x15')]===0x1f4){logger[_0x64ab('0x14')](_0x64ab('0x16'),_0x27a53b,_0x2aabeb[_0x64ab('0x14')][_0x64ab('0x17')]);return _0x44e8a8(_0x2aabeb['error'][_0x64ab('0x17')]);}logger['error'](_0x64ab('0x16'),_0x27a53b,_0x2aabeb['error']['message']);return _0x5cb2e5(_0x2aabeb['error'][_0x64ab('0x17')]);}else{logger['info'](_0x64ab('0x16'),_0x27a53b,_0x64ab('0x12'));_0x5cb2e5(_0x2aabeb[_0x64ab('0x18')][_0x64ab('0x17')]);}})['catch'](function(_0x12cb1e){logger[_0x64ab('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x27a53b,_0x12cb1e);_0x44e8a8(_0x12cb1e);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 088c636..3bd8676 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ac2=['./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','default','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','online','join','Offline\x20apps:','status','None','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1ac2,0xfd));var _0x21ac=function(_0x46de7b,_0x4e1eb4){_0x46de7b=_0x46de7b-0x0;var _0x8708e2=_0x1ac2[_0x46de7b];return _0x8708e2;};'use strict';var _=require(_0x21ac('0x0'));var db=require(_0x21ac('0x1'))['db'];var seedDb=require(_0x21ac('0x2'));var checkLicense=require(_0x21ac('0x3'));var rpc=require(_0x21ac('0x4'));var config=require(_0x21ac('0x5'));var logger=require(_0x21ac('0x6'))(_0x21ac('0x7'));var pm2=require(_0x21ac('0x8'));var pm2Config=require(_0x21ac('0x9'));var schedule=require(_0x21ac('0xa'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x21ac('0xb'));var transcribe=require(_0x21ac('0xc'));var provider=require(_0x21ac('0xd'));function main(){return db['sequelize'][_0x21ac('0xe')]()[_0x21ac('0xf')](function(){if(config[_0x21ac('0x10')]){return seedDb[_0x21ac('0x11')]();}})[_0x21ac('0xf')](function(){return checkLicense[_0x21ac('0x11')]();})[_0x21ac('0xf')](function(){return rpc['listen']();})[_0x21ac('0xf')](function(_0x35382a){logger[_0x21ac('0x12')](_0x35382a);return chat[_0x21ac('0x13')]();})[_0x21ac('0xf')](function(){return whatsapp[_0x21ac('0x13')]();})[_0x21ac('0xf')](function(){return schedule['start']();})[_0x21ac('0xf')](function(){return transcribe[_0x21ac('0x13')]();})[_0x21ac('0xf')](function(){return provider[_0x21ac('0x13')]();})[_0x21ac('0xf')](function(_0x3deb4c){logger[_0x21ac('0x12')](_0x3deb4c);return pm2[_0x21ac('0x13')](pm2Config);})[_0x21ac('0xf')](function(_0x47a999){var _0x3498e3=_0x47a999[_0x21ac('0x14')](function(_0xc92caa){return typeof _0xc92caa[_0x21ac('0x15')]==='number'&&_0xc92caa[_0x21ac('0x15')]>=0x0;});if(_0x3498e3[_0x21ac('0x16')]>0x0){throw new Error(_0x3498e3['length']+_0x21ac('0x17')+_[_0x21ac('0x18')](_0x3498e3,function(_0x52b873){return'\x22'+_0x52b873['pm2_env'][_0x21ac('0x19')]+'\x22';}));}logger[_0x21ac('0x12')](_0x21ac('0x1a'),_[_0x21ac('0x18')](_[_0x21ac('0x14')](_0x47a999,{'status':_0x21ac('0x1b')}),_0x21ac('0x19'))[_0x21ac('0x1c')]());logger[_0x21ac('0x12')](_0x21ac('0x1d'),_[_0x21ac('0x18')](_[_0x21ac('0x14')](_0x47a999,function(_0x12159c){return _0x12159c[_0x21ac('0x1e')]!==_0x21ac('0x1b');}),_0x21ac('0x19'))[_0x21ac('0x1c')]()||_0x21ac('0x1f'));console['log']('App\x20Ready!');})['catch'](function(_0x2af413){console[_0x21ac('0x20')](_0x21ac('0x21'),_0x2af413);logger[_0x21ac('0x22')](_0x21ac('0x23'),_0x2af413);process[_0x21ac('0x24')](0x1);});}main(); \ No newline at end of file +var _0x1af3=['log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','default','listen','info','start','filter','exitCode','number','length','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status','None'];(function(_0x4cc9c8,_0x26276f){var _0x3d3439=function(_0x100d5b){while(--_0x100d5b){_0x4cc9c8['push'](_0x4cc9c8['shift']());}};_0x3d3439(++_0x26276f);}(_0x1af3,0x1ca));var _0x31af=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x1af3[_0x1eda20];return _0x31b953;};'use strict';var _=require(_0x31af('0x0'));var db=require(_0x31af('0x1'))['db'];var seedDb=require(_0x31af('0x2'));var checkLicense=require(_0x31af('0x3'));var rpc=require(_0x31af('0x4'));var config=require(_0x31af('0x5'));var logger=require(_0x31af('0x6'))(_0x31af('0x7'));var pm2=require(_0x31af('0x8'));var pm2Config=require(_0x31af('0x9'));var schedule=require('./config/schedule');var chat=require(_0x31af('0xa'));var whatsapp=require(_0x31af('0xb'));var transcribe=require(_0x31af('0xc'));var provider=require(_0x31af('0xd'));function main(){return db['sequelize'][_0x31af('0xe')]()[_0x31af('0xf')](function(){if(config[_0x31af('0x10')]){return seedDb['default']();}})[_0x31af('0xf')](function(){return checkLicense[_0x31af('0x11')]();})[_0x31af('0xf')](function(){return rpc[_0x31af('0x12')]();})[_0x31af('0xf')](function(_0x26c99f){logger[_0x31af('0x13')](_0x26c99f);return chat[_0x31af('0x14')]();})['then'](function(){return whatsapp[_0x31af('0x14')]();})[_0x31af('0xf')](function(){return schedule[_0x31af('0x14')]();})[_0x31af('0xf')](function(){return transcribe[_0x31af('0x14')]();})['then'](function(){return provider[_0x31af('0x14')]();})[_0x31af('0xf')](function(_0x5c18b4){logger['info'](_0x5c18b4);return pm2[_0x31af('0x14')](pm2Config);})[_0x31af('0xf')](function(_0x14c57e){var _0x10b9c6=_0x14c57e[_0x31af('0x15')](function(_0x1d35fa){return typeof _0x1d35fa[_0x31af('0x16')]===_0x31af('0x17')&&_0x1d35fa[_0x31af('0x16')]>=0x0;});if(_0x10b9c6[_0x31af('0x18')]>0x0){throw new Error(_0x10b9c6[_0x31af('0x18')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x31af('0x19')](_0x10b9c6,function(_0xd33b3f){return'\x22'+_0xd33b3f[_0x31af('0x1a')][_0x31af('0x1b')]+'\x22';}));}logger[_0x31af('0x13')](_0x31af('0x1c'),_[_0x31af('0x19')](_[_0x31af('0x15')](_0x14c57e,{'status':_0x31af('0x1d')}),'name')[_0x31af('0x1e')]());logger[_0x31af('0x13')](_0x31af('0x1f'),_[_0x31af('0x19')](_[_0x31af('0x15')](_0x14c57e,function(_0x5d96ca){return _0x5d96ca[_0x31af('0x20')]!==_0x31af('0x1d');}),_0x31af('0x1b'))[_0x31af('0x1e')]()||_0x31af('0x21'));console[_0x31af('0x22')](_0x31af('0x23'));})[_0x31af('0x24')](function(_0x3f673f){console[_0x31af('0x22')](_0x31af('0x25'),_0x3f673f);logger[_0x31af('0x26')](_0x31af('0x27'),_0x3f673f);process[_0x31af('0x28')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 7ce0c1d..8ea274c 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 _0x2239=['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','length','splice','encryptString','join','promisify','sign','secret','options','verify','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','util','moment','secrets','session','fullname','name','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','use','ChatInteraction','params','closed','then','status','disposition','json','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','startsWith','headers','authorization','find','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','getUuid','User','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','regenerateApiKey','apikey','Sequelize'];(function(_0x44f974,_0x4db616){var _0x805dbd=function(_0x1a56b7){while(--_0x1a56b7){_0x44f974['push'](_0x44f974['shift']());}};_0x805dbd(++_0x4db616);}(_0x2239,0x18b));var _0x9223=function(_0x497e1e,_0x2c69e9){_0x497e1e=_0x497e1e-0x0;var _0x109c48=_0x2239[_0x497e1e];return _0x109c48;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x9223('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x9223('0x1'));var encryptor=require(_0x9223('0x2'));var _=require(_0x9223('0x3'));var jwt=require(_0x9223('0x4'));var expressJwt=require(_0x9223('0x5'));var compose=require(_0x9223('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x9223('0x7'));var BPromise=require(_0x9223('0x8'));var util=require(_0x9223('0x9'));var moment=require(_0x9223('0xa'));var validateJwt=expressJwt({'secret':config[_0x9223('0xb')][_0x9223('0xc')]});var userAttributes=['id','role',_0x9223('0xd'),_0x9223('0xe'),'internal',_0x9223('0xf'),'userpic','permissions',_0x9223('0x10'),_0x9223('0x11'),_0x9223('0x12'),_0x9223('0x13'),_0x9223('0x14'),_0x9223('0x15'),'openchannelPause',_0x9223('0x16'),'showWebBar',_0x9223('0x17'),_0x9223('0x18'),_0x9223('0x19'),_0x9223('0x1a'),_0x9223('0x1b'),'alias',_0x9223('0x1c'),_0x9223('0x1d'),_0x9223('0x1e'),_0x9223('0x1f'),'phoneBarEnableDtmfTone','phoneBarEnableSettings',_0x9223('0x20'),_0x9223('0x21'),_0x9223('0x22'),_0x9223('0x23'),'hotdesk',_0x9223('0x24'),'userProfileId','privacyEnabled','settingsEnabled',_0x9223('0x25'),_0x9223('0x26'),_0x9223('0x27'),_0x9223('0x28'),_0x9223('0x29'),_0x9223('0x2a')];exports[_0x9223('0x2b')]=function(){return this['isAuthenticated'](!![])[_0x9223('0x2c')](function(_0x2fcb67,_0x4a9f38,_0x182dab){if(_0x2fcb67['user']){_0x182dab();}else{return db[_0x9223('0x2d')]['findOne']({'where':{'id':_0x2fcb67[_0x9223('0x2e')]['id']},'attributes':['id',_0x9223('0x2f'),'disposition'],'raw':!![]})[_0x9223('0x30')](function(_0x401e3e){if(_0x401e3e&&_0x401e3e[_0x9223('0x2f')]){return _0x4a9f38[_0x9223('0x31')](_0x401e3e[_0x9223('0x32')]==='unmanaged'?0x195:0x193)[_0x9223('0x33')]({'message':_0x401e3e[_0x9223('0x32')]===_0x9223('0x34')?_0x9223('0x35'):_0x9223('0x36')});}else{_0x182dab();}})[_0x9223('0x37')](function(_0x1d4684){_0x182dab(_0x1d4684);});}});};exports[_0x9223('0x38')]=function isAuthenticated(_0x4287c9){return compose()['use'](function(_0x8b1634,_0x509e96,_0x5026b0){var _0x5e662f;if(_0x8b1634['headers']['authorization']){if(_[_0x9223('0x39')](_0x8b1634[_0x9223('0x3a')][_0x9223('0x3b')],'Basic')){var _0x3a5a1b=basicAuth(_0x8b1634);db['User'][_0x9223('0x3c')]({'where':{'name':_0x3a5a1b[_0x9223('0xe')]}})[_0x9223('0x30')](function(_0x35c9e3){if(!_0x35c9e3||!_0x35c9e3['authenticate'](_0x3a5a1b['pass'])){return _0x509e96[_0x9223('0x31')](0x191)['json']({'message':_0x9223('0x3d')});}_0x8b1634[_0x9223('0x3e')]={'id':_0x35c9e3['id']};_0x5026b0();})[_0x9223('0x37')](function(_0x3503c5){_0x5026b0(_0x3503c5);});}else if(_[_0x9223('0x39')](_0x8b1634[_0x9223('0x3a')][_0x9223('0x3b')],_0x9223('0x3f'))){validateJwt(_0x8b1634,_0x509e96,_0x5026b0);}else{if(_0x4287c9){_0x5026b0();}else{return _0x509e96[_0x9223('0x31')](0x193)['json']({'message':_0x9223('0x40')});}}}else if(_0x8b1634[_0x9223('0x41')]['apikey']){try{var _0x49059f={'audience':hardwareConf[_0x9223('0x42')](),'issuer':hardwareConf[_0x9223('0x42')]()};verifyJwt(_0x8b1634[_0x9223('0x41')]['apikey'],_0x49059f)[_0x9223('0x30')](function(_0x59bd75){return db[_0x9223('0x43')]['find']({'where':{'id':_0x59bd75[_0x9223('0x44')]}})[_0x9223('0x30')](function(_0x2fc344){_0x5e662f=_0x2fc344;return db[_0x9223('0x45')]['findOne']({'where':{'id':0x1},'attributes':[_0x9223('0x46'),_0x9223('0x47')],'raw':!![]});})['then'](function(_0x304856){if(!_0x5e662f||!_['isEqual'](_0x5e662f[_0x9223('0x48')],_0x59bd75[_0x9223('0x49')])){return _0x509e96[_0x9223('0x31')](0x191)['json']({'message':_0x9223('0x4a')});}if(_0x5e662f[_0x9223('0x4b')]){return _0x509e96[_0x9223('0x31')](0x191)[_0x9223('0x33')]({'message':_0x9223('0x4c')});}if(_0x5e662f[_0x9223('0x4d')]){if(_0x304856[_0x9223('0x47')]>0x0){if(moment(_0x5e662f[_0x9223('0x4e')])[_0x9223('0x4f')](_0x304856[_0x9223('0x47')],_0x9223('0x50'))>moment()){return _0x509e96[_0x9223('0x31')](0x191)[_0x9223('0x33')]({'message':_0x9223('0x4c')});}}else{return _0x509e96[_0x9223('0x31')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0x8b1634[_0x9223('0x3e')]={'id':_0x5e662f['id']};_0x5026b0();});})[_0x9223('0x37')](function(){return _0x509e96[_0x9223('0x31')](0x191)[_0x9223('0x33')]({'message':_0x9223('0x4c')});});}catch(_0x346734){_0x5026b0(_0x346734);}}else if(_0x4287c9){_0x5026b0();}else{return _0x509e96[_0x9223('0x31')](0x193)['json']({'message':_0x9223('0x40')});}})[_0x9223('0x2c')](function(_0x53407b,_0x15a9ac,_0xc284a9){if(_0x53407b[_0x9223('0x3e')]){db[_0x9223('0x43')][_0x9223('0x3c')]({'where':{'id':_0x53407b[_0x9223('0x3e')]['id']},'attributes':userAttributes})['then'](function(_0xe8997c){if(!_0xe8997c){return _0x15a9ac[_0x9223('0x31')](0x194)[_0x9223('0x33')]({'message':_0x9223('0x51')});}_0x53407b[_0x9223('0x3e')]=_0xe8997c;_0xc284a9();})[_0x9223('0x37')](function(_0x1de3a5){_0xc284a9(_0x1de3a5);});}else if(_0x4287c9){_0xc284a9();}else{return _0x15a9ac['status'](0x194)[_0x9223('0x33')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x9223('0x52')]=function canUpdate(){return compose()[_0x9223('0x2c')](function(_0x2820de,_0x4f8029,_0x396b59){return licenseUtil[_0x9223('0x53')]()[_0x9223('0x30')](function(_0x3c7144){if(_0x3c7144['update']){_0x396b59();}else{return _0x4f8029[_0x9223('0x31')](0x193)[_0x9223('0x33')]({'message':_0x9223('0x54')});}})[_0x9223('0x37')](function(_0x3a14a4){_0x396b59(_0x3a14a4);});});};exports[_0x9223('0x55')]=function isWebrtcLicence(){return compose()[_0x9223('0x2c')](function(_0x1b6fe0,_0x1e9324,_0x5bc28f){return licenseUtil['getLicense']()[_0x9223('0x30')](function(_0x3b974b){if(_0x3b974b[_0x9223('0x56')]){_0x5bc28f();}else{return _0x1e9324[_0x9223('0x31')](0x193)['json']({'message':_0x9223('0x54')});}})[_0x9223('0x37')](function(_0x1c1999){_0x5bc28f(_0x1c1999);});});};exports[_0x9223('0x57')]=function(_0x54ce0a,_0x4d060d,_0x55cd6c){_0x54ce0a[_0x9223('0x57')]=!![];return _0x55cd6c();};exports[_0x9223('0x58')]=function signToken(_0x303fb5){return signJwt(_0x303fb5);};exports['setTokenCookie']=function(_0x4c8724,_0x5b6be7){if(!_0x4c8724[_0x9223('0x3e')]){return _0x5b6be7[_0x9223('0x31')](0x194)[_0x9223('0x33')]({'message':_0x9223('0x59')});}var _0x1fbdea={'payload':{'id':_0x4c8724[_0x9223('0x3e')]['id'],'role':_0x4c8724[_0x9223('0x3e')][_0x9223('0x5a')]},'options':{'expiresIn':0x15180}};return signJwt(_0x1fbdea)['then'](function(_0x29f934){_0x5b6be7[_0x9223('0x5b')](_0x9223('0x5c'),_0x29f934);_0x5b6be7[_0x9223('0x5d')](_0x9223('0x5e'));})['catch'](function(_0x34bf64){return _0x5b6be7[_0x9223('0x31')](0x1f4)[_0x9223('0x5f')](_0x34bf64);});};exports['retrieveApiKey']=function(_0x1b275b){if(_[_0x9223('0x60')](_0x1b275b['apiKeyNonce'])||_[_0x9223('0x60')](_0x1b275b['apiKeyIat'])){return null;}else{return createJwt(_0x1b275b);}};exports['generateApiKey']=function(_0x4e868e){_0x4e868e['apiKeyNonce']=generateNonce();_0x4e868e[_0x9223('0x61')]=generateIssuedAt();return createJwt(_0x4e868e);};exports[_0x9223('0x62')]=function(_0x21dadb,_0x1ffa7f){var _0x392807=_0x21dadb[_0x9223('0x41')][_0x9223('0x63')];if(_0x392807){var _0x2deeed={'nonce':_0x1ffa7f[_0x9223('0x48')],'iat':_0x1ffa7f[_0x9223('0x61')],'audience':hardwareConf[_0x9223('0x42')](),'issuer':hardwareConf[_0x9223('0x42')]()};return verifyJwt(_0x392807,_0x2deeed)[_0x9223('0x30')](function(){return generateApiKey(_0x1ffa7f);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x477171){var _0x1b6564=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1b6564['test'](_0x477171))throw new db[(_0x9223('0x64'))]['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~!@#$%^&-_=+[{]}.');return;};exports[_0x9223('0x65')]=function(_0x42346b,_0x59df2a,_0x31be02){var _0x53caa8=encryptor[_0x9223('0x66')](_0x59df2a)[_0x9223('0x67')](',');for(var _0x131bcb=0x0;_0x131bcb<_0x31be02;_0x131bcb++){if(!_0x53caa8[_0x131bcb])break;if(_0x42346b[_0x9223('0x68')]()===_0x53caa8[_0x131bcb]['toLowerCase']()){var _0x58d6b1=util[_0x9223('0x69')](_0x9223('0x6a'),_0x31be02);if(_0x31be02===0x1){_0x58d6b1=_0x9223('0x6b');}throw new db[(_0x9223('0x64'))]['ValidationError'](_0x58d6b1);}}return;};exports[_0x9223('0x6c')]=function(_0x3a7d34,_0x2a9ff2){var _0x1ab823=_0x2a9ff2?encryptor['decryptString'](_0x2a9ff2)[_0x9223('0x67')](','):[];if(_0x1ab823[_0x9223('0x6d')]===0x5){_0x1ab823[_0x9223('0x6e')](-0x1,0x1);}_0x1ab823['unshift'](_0x3a7d34);return encryptor[_0x9223('0x6f')](_0x1ab823[_0x9223('0x70')](','));};function signJwt(_0x36eed7){var _0x5ce23d=BPromise[_0x9223('0x71')](jwt[_0x9223('0x72')],{'context':jwt});var _0x3402fe=_0x36eed7[_0x9223('0x73')]||config[_0x9223('0xb')][_0x9223('0xc')];return new BPromise(function(_0x659fd,_0x4a014){_0x5ce23d(_0x36eed7['payload'],_0x3402fe,_0x36eed7[_0x9223('0x74')])[_0x9223('0x30')](function(_0x5e53b1){_0x659fd(_0x5e53b1);})['catch'](function(_0x52b153){_0x4a014(_0x52b153);});});}function verifyJwt(_0xe3a93b,_0x1f8015,_0x234931){var _0x5b0a62=BPromise[_0x9223('0x71')](jwt[_0x9223('0x75')],{'context':jwt});var _0x440139=_0x234931||config['secrets'][_0x9223('0xc')];return new BPromise(function(_0x34a17e,_0x16bd21){_0x5b0a62(_0xe3a93b,_0x440139,_0x1f8015)[_0x9223('0x30')](function(_0x329c06){_0x34a17e(_0x329c06);})[_0x9223('0x37')](function(_0x2df4fb){_0x16bd21(_0x2df4fb);});});}function generateNonce(){return crypto[_0x9223('0x76')](0x10)[_0x9223('0x77')](_0x9223('0x78'));}function generateIssuedAt(){return Math[_0x9223('0x79')](Date[_0x9223('0x7a')]()/0x3e8)[_0x9223('0x77')]();}function createJwt(_0x3c8535){var _0x168313={'payload':{'iat':_0x3c8535[_0x9223('0x61')],'nonce':_0x3c8535['apiKeyNonce']},'options':{'algorithm':_0x9223('0x7b'),'subject':_0x3c8535['id'][_0x9223('0x77')](),'issuer':hardwareConf[_0x9223('0x42')](),'audience':hardwareConf[_0x9223('0x42')]()}};return signJwt(_0x168313)[_0x9223('0x30')](function(_0x51c3bb){return{'iat':_0x3c8535[_0x9223('0x61')],'nonce':_0x3c8535['apiKeyNonce'],'token':_0x51c3bb};});} \ No newline at end of file +var _0xe9ad=['disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','blockDuration','minutes','user','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','basic-auth','crypto','bluebird','util','secrets','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','isChatInteractionAuthorized','isAuthenticated','use','findOne','params','closed','disposition','then','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','pass','status','json','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0xe9ad,0x1be));var _0xde9a=function(_0x1df5cd,_0x3dc641){_0x1df5cd=_0x1df5cd-0x0;var _0xf6df9b=_0xe9ad[_0x1df5cd];return _0xf6df9b;};'use strict';var db=require(_0xde9a('0x0'))['db'];var config=require(_0xde9a('0x1'));var hardwareConf=require(_0xde9a('0x2'));var licenseUtil=require(_0xde9a('0x3'));var encryptor=require('../encryptor');var _=require(_0xde9a('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0xde9a('0x5'));var crypto=require(_0xde9a('0x6'));var BPromise=require(_0xde9a('0x7'));var util=require(_0xde9a('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xde9a('0x9')][_0xde9a('0xa')]});var userAttributes=['id',_0xde9a('0xb'),_0xde9a('0xc'),_0xde9a('0xd'),_0xde9a('0xe'),_0xde9a('0xf'),_0xde9a('0x10'),_0xde9a('0x11'),_0xde9a('0x12'),_0xde9a('0x13'),_0xde9a('0x14'),_0xde9a('0x15'),_0xde9a('0x16'),_0xde9a('0x17'),'openchannelPause',_0xde9a('0x18'),_0xde9a('0x19'),_0xde9a('0x1a'),'lastPauseAt',_0xde9a('0x1b'),_0xde9a('0x1c'),_0xde9a('0x1d'),_0xde9a('0x1e'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0xde9a('0x1f'),_0xde9a('0x20'),_0xde9a('0x21'),_0xde9a('0x22'),_0xde9a('0x23'),_0xde9a('0x24'),_0xde9a('0x25'),'phoneBarRemoteControlPort',_0xde9a('0x26'),'interface',_0xde9a('0x27'),_0xde9a('0x28'),_0xde9a('0x29'),_0xde9a('0x2a'),'downloadVoiceRecordings',_0xde9a('0x2b'),_0xde9a('0x2c'),_0xde9a('0x2d'),'selectRecallMeCampaign'];exports[_0xde9a('0x2e')]=function(){return this[_0xde9a('0x2f')](!![])[_0xde9a('0x30')](function(_0x29bad0,_0x5d1ee8,_0x17cde6){if(_0x29bad0['user']){_0x17cde6();}else{return db['ChatInteraction'][_0xde9a('0x31')]({'where':{'id':_0x29bad0[_0xde9a('0x32')]['id']},'attributes':['id',_0xde9a('0x33'),_0xde9a('0x34')],'raw':!![]})[_0xde9a('0x35')](function(_0x4b52c1){if(_0x4b52c1&&_0x4b52c1[_0xde9a('0x33')]){return _0x5d1ee8['status'](_0x4b52c1['disposition']==='unmanaged'?0x195:0x193)['json']({'message':_0x4b52c1[_0xde9a('0x34')]===_0xde9a('0x36')?_0xde9a('0x37'):_0xde9a('0x38')});}else{_0x17cde6();}})[_0xde9a('0x39')](function(_0x1f7395){_0x17cde6(_0x1f7395);});}});};exports['isAuthenticated']=function isAuthenticated(_0xa3d106){return compose()[_0xde9a('0x30')](function(_0x320caf,_0x97bdbe,_0x1360a6){var _0x2c795a;if(_0x320caf[_0xde9a('0x3a')][_0xde9a('0x3b')]){if(_[_0xde9a('0x3c')](_0x320caf['headers'][_0xde9a('0x3b')],_0xde9a('0x3d'))){var _0x405c8b=basicAuth(_0x320caf);db[_0xde9a('0x3e')]['find']({'where':{'name':_0x405c8b[_0xde9a('0xd')]}})[_0xde9a('0x35')](function(_0x57d540){if(!_0x57d540||!_0x57d540['authenticate'](_0x405c8b[_0xde9a('0x3f')])){return _0x97bdbe[_0xde9a('0x40')](0x191)[_0xde9a('0x41')]({'message':_0xde9a('0x42')});}_0x320caf['user']={'id':_0x57d540['id']};_0x1360a6();})['catch'](function(_0x1da701){_0x1360a6(_0x1da701);});}else if(_[_0xde9a('0x3c')](_0x320caf['headers'][_0xde9a('0x3b')],_0xde9a('0x43'))){validateJwt(_0x320caf,_0x97bdbe,_0x1360a6);}else{if(_0xa3d106){_0x1360a6();}else{return _0x97bdbe[_0xde9a('0x40')](0x193)[_0xde9a('0x41')]({'message':_0xde9a('0x44')});}}}else if(_0x320caf[_0xde9a('0x45')][_0xde9a('0x46')]){try{var _0x3ea769={'audience':hardwareConf[_0xde9a('0x47')](),'issuer':hardwareConf[_0xde9a('0x47')]()};verifyJwt(_0x320caf[_0xde9a('0x45')][_0xde9a('0x46')],_0x3ea769)['then'](function(_0x5ed0d0){return db['User'][_0xde9a('0x48')]({'where':{'id':_0x5ed0d0[_0xde9a('0x49')]}})[_0xde9a('0x35')](function(_0x524f79){_0x2c795a=_0x524f79;return db['Setting'][_0xde9a('0x31')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})[_0xde9a('0x35')](function(_0x1975fe){if(!_0x2c795a||!_[_0xde9a('0x4a')](_0x2c795a[_0xde9a('0x4b')],_0x5ed0d0[_0xde9a('0x4c')])){return _0x97bdbe[_0xde9a('0x40')](0x191)[_0xde9a('0x41')]({'message':_0xde9a('0x4d')});}if(_0x2c795a[_0xde9a('0x4e')]){return _0x97bdbe['status'](0x191)[_0xde9a('0x41')]({'message':_0xde9a('0x4f')});}if(_0x2c795a[_0xde9a('0x50')]){if(_0x1975fe['blockDuration']>0x0){if(moment(_0x2c795a[_0xde9a('0x51')])[_0xde9a('0x52')](_0x1975fe[_0xde9a('0x53')],_0xde9a('0x54'))>moment()){return _0x97bdbe['status'](0x191)['json']({'message':_0xde9a('0x4f')});}}else{return _0x97bdbe[_0xde9a('0x40')](0x191)[_0xde9a('0x41')]({'message':_0xde9a('0x4f')});}}_0x320caf['user']={'id':_0x2c795a['id']};_0x1360a6();});})[_0xde9a('0x39')](function(){return _0x97bdbe[_0xde9a('0x40')](0x191)[_0xde9a('0x41')]({'message':_0xde9a('0x4f')});});}catch(_0x81b114){_0x1360a6(_0x81b114);}}else if(_0xa3d106){_0x1360a6();}else{return _0x97bdbe['status'](0x193)[_0xde9a('0x41')]({'message':'Unknown\x20authorization\x20format'});}})[_0xde9a('0x30')](function(_0x3bf0b3,_0x3e9c35,_0x1dfc51){if(_0x3bf0b3[_0xde9a('0x55')]){db[_0xde9a('0x3e')][_0xde9a('0x48')]({'where':{'id':_0x3bf0b3[_0xde9a('0x55')]['id']},'attributes':userAttributes})[_0xde9a('0x35')](function(_0x2e210b){if(!_0x2e210b){return _0x3e9c35['status'](0x194)[_0xde9a('0x41')]({'message':_0xde9a('0x56')});}_0x3bf0b3[_0xde9a('0x55')]=_0x2e210b;_0x1dfc51();})[_0xde9a('0x39')](function(_0xa4ee58){_0x1dfc51(_0xa4ee58);});}else if(_0xa3d106){_0x1dfc51();}else{return _0x3e9c35[_0xde9a('0x40')](0x194)[_0xde9a('0x41')]({'message':_0xde9a('0x57')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xde9a('0x30')](function(_0x129580,_0x21db00,_0x217595){return licenseUtil[_0xde9a('0x58')]()['then'](function(_0x32131c){if(_0x32131c[_0xde9a('0x59')]){_0x217595();}else{return _0x21db00[_0xde9a('0x40')](0x193)[_0xde9a('0x41')]({'message':_0xde9a('0x5a')});}})[_0xde9a('0x39')](function(_0x45b748){_0x217595(_0x45b748);});});};exports[_0xde9a('0x5b')]=function isWebrtcLicence(){return compose()[_0xde9a('0x30')](function(_0x334bd3,_0x262094,_0x5e3464){return licenseUtil[_0xde9a('0x58')]()[_0xde9a('0x35')](function(_0x3accf6){if(_0x3accf6[_0xde9a('0x5c')]){_0x5e3464();}else{return _0x262094[_0xde9a('0x40')](0x193)[_0xde9a('0x41')]({'message':'Forbidden'});}})[_0xde9a('0x39')](function(_0x5a1381){_0x5e3464(_0x5a1381);});});};exports[_0xde9a('0x5d')]=function(_0x507474,_0x3f6c47,_0x43b192){_0x507474[_0xde9a('0x5d')]=!![];return _0x43b192();};exports['signToken']=function signToken(_0x2d9fd0){return signJwt(_0x2d9fd0);};exports[_0xde9a('0x5e')]=function(_0x536389,_0x10cb25){if(!_0x536389[_0xde9a('0x55')]){return _0x10cb25[_0xde9a('0x40')](0x194)[_0xde9a('0x41')]({'message':_0xde9a('0x5f')});}var _0x4a05ab={'payload':{'id':_0x536389[_0xde9a('0x55')]['id'],'role':_0x536389['user'][_0xde9a('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4a05ab)[_0xde9a('0x35')](function(_0x5c86e1){_0x10cb25[_0xde9a('0x60')]('motion.token',_0x5c86e1);_0x10cb25[_0xde9a('0x61')](_0xde9a('0x62'));})['catch'](function(_0x65e7fb){return _0x10cb25[_0xde9a('0x40')](0x1f4)[_0xde9a('0x63')](_0x65e7fb);});};exports[_0xde9a('0x64')]=function(_0x382ac7){if(_[_0xde9a('0x65')](_0x382ac7[_0xde9a('0x4b')])||_[_0xde9a('0x65')](_0x382ac7[_0xde9a('0x66')])){return null;}else{return createJwt(_0x382ac7);}};exports[_0xde9a('0x67')]=function(_0x3fd14f){_0x3fd14f[_0xde9a('0x4b')]=generateNonce();_0x3fd14f['apiKeyIat']=generateIssuedAt();return createJwt(_0x3fd14f);};exports[_0xde9a('0x68')]=function(_0x5b6ff1,_0x5e7961){var _0x108d23=_0x5b6ff1[_0xde9a('0x45')][_0xde9a('0x46')];if(_0x108d23){var _0x1800e6={'nonce':_0x5e7961[_0xde9a('0x4b')],'iat':_0x5e7961[_0xde9a('0x66')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xde9a('0x47')]()};return verifyJwt(_0x108d23,_0x1800e6)[_0xde9a('0x35')](function(){return generateApiKey(_0x5e7961);});}else{throw{'message':_0xde9a('0x69')};}};exports['validatePasswordPattern']=function(_0x1217fb){var _0x5b8de0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5b8de0['test'](_0x1217fb))throw new db[(_0xde9a('0x6a'))][(_0xde9a('0x6b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xde9a('0x6c')]=function(_0x75572b,_0x38132a,_0x2966d2){var _0x56ea83=encryptor[_0xde9a('0x6d')](_0x38132a)[_0xde9a('0x6e')](',');for(var _0x261774=0x0;_0x261774<_0x2966d2;_0x261774++){if(!_0x56ea83[_0x261774])break;if(_0x75572b[_0xde9a('0x6f')]()===_0x56ea83[_0x261774][_0xde9a('0x6f')]()){var _0x58a07e=util[_0xde9a('0x70')](_0xde9a('0x71'),_0x2966d2);if(_0x2966d2===0x1){_0x58a07e='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize']['ValidationError'](_0x58a07e);}}return;};exports[_0xde9a('0x72')]=function(_0x2d9b05,_0x2e38b9){var _0xb5038=_0x2e38b9?encryptor[_0xde9a('0x6d')](_0x2e38b9)[_0xde9a('0x6e')](','):[];if(_0xb5038[_0xde9a('0x73')]===0x5){_0xb5038[_0xde9a('0x74')](-0x1,0x1);}_0xb5038[_0xde9a('0x75')](_0x2d9b05);return encryptor[_0xde9a('0x76')](_0xb5038[_0xde9a('0x77')](','));};function signJwt(_0x17e22e){var _0x2a01e7=BPromise[_0xde9a('0x78')](jwt[_0xde9a('0x79')],{'context':jwt});var _0x56b233=_0x17e22e[_0xde9a('0x7a')]||config[_0xde9a('0x9')][_0xde9a('0xa')];return new BPromise(function(_0x271f78,_0x2b3226){_0x2a01e7(_0x17e22e[_0xde9a('0x7b')],_0x56b233,_0x17e22e[_0xde9a('0x7c')])[_0xde9a('0x35')](function(_0xc37c89){_0x271f78(_0xc37c89);})[_0xde9a('0x39')](function(_0x4d7f0e){_0x2b3226(_0x4d7f0e);});});}function verifyJwt(_0x30eacb,_0x2c9c81,_0x50607e){var _0x271e36=BPromise[_0xde9a('0x78')](jwt[_0xde9a('0x7d')],{'context':jwt});var _0x58f00=_0x50607e||config[_0xde9a('0x9')][_0xde9a('0xa')];return new BPromise(function(_0x3917d8,_0x3fb297){_0x271e36(_0x30eacb,_0x58f00,_0x2c9c81)['then'](function(_0x1de252){_0x3917d8(_0x1de252);})[_0xde9a('0x39')](function(_0x4b6e21){_0x3fb297(_0x4b6e21);});});}function generateNonce(){return crypto[_0xde9a('0x7e')](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0xde9a('0x7f')](Date[_0xde9a('0x80')]()/0x3e8)[_0xde9a('0x81')]();}function createJwt(_0x2252e6){var _0x1e07c6={'payload':{'iat':_0x2252e6[_0xde9a('0x66')],'nonce':_0x2252e6[_0xde9a('0x4b')]},'options':{'algorithm':_0xde9a('0x82'),'subject':_0x2252e6['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xde9a('0x47')]()}};return signJwt(_0x1e07c6)[_0xde9a('0x35')](function(_0xafca3){return{'iat':_0x2252e6['apiKeyIat'],'nonce':_0x2252e6[_0xde9a('0x4b')],'token':_0xafca3};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 00dafc6..8f84784 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 _0xe7a8=['filter','indexOf','hasOwnProperty','createWriteStream','createCipher','data','update','write','end','final','binary','close','unlink','createReadStream','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test'];(function(_0x1426c8,_0x14c959){var _0x1862b6=function(_0x366de6){while(--_0x366de6){_0x1426c8['push'](_0x1426c8['shift']());}};_0x1862b6(++_0x14c959);}(_0xe7a8,0x168));var _0x8e7a=function(_0x4cbce7,_0x139ba2){_0x4cbce7=_0x4cbce7-0x0;var _0x127bf5=_0xe7a8[_0x4cbce7];return _0x127bf5;};'use strict';var crypto=require(_0x8e7a('0x0'));var fs=require('fs');var BPromise=require(_0x8e7a('0x1'));var _=require(_0x8e7a('0x2'));var config=require(_0x8e7a('0x3'));var logger=require(_0x8e7a('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x8e7a('0x5')][_0x8e7a('0x6')],'algorithm':_0x8e7a('0x7')};const fileOptions={'algorithm':_0x8e7a('0x8')};if(config['encrypt']&&config[_0x8e7a('0x9')][_0x8e7a('0xa')]){var isSupported=isAlgorithmSupported(config[_0x8e7a('0x9')][_0x8e7a('0xa')]);if(isSupported){fileOptions[_0x8e7a('0xa')]=config[_0x8e7a('0x9')][_0x8e7a('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x8e7a('0xb')](',\x20');logger['error'](config[_0x8e7a('0x9')][_0x8e7a('0xa')],_0x8e7a('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2c910f){return AES_SUPPORTED_RX[_0x8e7a('0xd')](_0x2c910f);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x8e7a('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x68aa96){return getSupportedCiphers()[_0x8e7a('0xf')](_0x68aa96)>-0x1;}function combineOptions(_0x1d99d4){var _0x561567={};for(var _0x286a0d in fileOptions){if(fileOptions['hasOwnProperty'](_0x286a0d)){_0x561567[_0x286a0d]=fileOptions[_0x286a0d];}}if(_0x1d99d4){for(var _0x2e8b38 in _0x1d99d4){if(_0x1d99d4[_0x8e7a('0x10')](_0x2e8b38)){_0x561567[_0x2e8b38]=_0x1d99d4[_0x2e8b38];}}}return _0x561567;}exports['encryptFile']=function(_0x520fc0,_0x577e15,_0x4fd424,_0x418f43){return new BPromise(function(_0x463246,_0x53021b){_0x418f43=combineOptions(_0x418f43);var _0x2fa815=new Buffer(_0x4fd424);var _0x2500e3=fs['createReadStream'](_0x520fc0);var _0x31f012=fs[_0x8e7a('0x11')](_0x577e15);var _0x46eccf=crypto[_0x8e7a('0x12')](_0x418f43[_0x8e7a('0xa')],_0x2fa815);_0x2500e3['on'](_0x8e7a('0x13'),function(_0x4aebf5){var _0x1a7c4d=new Buffer(_0x46eccf[_0x8e7a('0x14')](_0x4aebf5),'binary');_0x31f012[_0x8e7a('0x15')](_0x1a7c4d);});_0x2500e3['on'](_0x8e7a('0x16'),function(){try{var _0x2e69b1=new Buffer(_0x46eccf[_0x8e7a('0x17')](_0x8e7a('0x18')),_0x8e7a('0x18'));_0x31f012[_0x8e7a('0x15')](_0x2e69b1);_0x31f012[_0x8e7a('0x16')]();_0x31f012['on'](_0x8e7a('0x19'),function(){return _0x463246(_0x577e15);});}catch(_0x566c24){fs[_0x8e7a('0x1a')](_0x577e15);return _0x53021b(_0x566c24);}});});};exports['decryptFile']=function(_0x9302c1,_0x3a0f0d,_0x3dd141,_0x8ca6ff){return new BPromise(function(_0x574fcd,_0x97b2b){_0x8ca6ff=combineOptions(_0x8ca6ff);var _0x3260a3=new Buffer(_0x3dd141);var _0x329e7a=fs[_0x8e7a('0x1b')](_0x9302c1);var _0x1fc794=fs[_0x8e7a('0x11')](_0x3a0f0d);var _0x6105ef=crypto[_0x8e7a('0x1c')](_0x8ca6ff['algorithm'],_0x3260a3);_0x329e7a['on'](_0x8e7a('0x13'),function(_0x30463d){var _0x3c2b4c=new Buffer(_0x6105ef[_0x8e7a('0x14')](_0x30463d),'binary');_0x1fc794['write'](_0x3c2b4c);});_0x329e7a['on'](_0x8e7a('0x16'),function(){try{var _0x5d35b1=new Buffer(_0x6105ef[_0x8e7a('0x17')]('binary'),_0x8e7a('0x18'));_0x1fc794['write'](_0x5d35b1);_0x1fc794[_0x8e7a('0x16')]();_0x1fc794['on'](_0x8e7a('0x19'),function(){return _0x574fcd(_0x3a0f0d);});}catch(_0xad4723){fs['unlink'](_0x3a0f0d);return _0x97b2b(_0xad4723);}});});};exports[_0x8e7a('0x1d')]=function(_0x216ca0,_0x53cd4a,_0x28963b){var _0x4dc814=_0x28963b||stringOptions['algorithm'];var _0x2920a0=_0x53cd4a||stringOptions[_0x8e7a('0x1e')];var _0x709191=crypto['createCipher'](_0x4dc814,_0x2920a0);var _0x3a6e68=_0x709191[_0x8e7a('0x14')](_0x216ca0,_0x8e7a('0x1f'),_0x8e7a('0x20'));_0x3a6e68+=_0x709191[_0x8e7a('0x17')]('base64');return _0x3a6e68;};exports[_0x8e7a('0x21')]=function(_0x4a8a49,_0x2e45ec,_0x11b21d){var _0x20b2cc=_0x11b21d||stringOptions['algorithm'];var _0x1ff7f1=_0x2e45ec||stringOptions[_0x8e7a('0x1e')];var _0x4596bc=crypto[_0x8e7a('0x1c')](_0x20b2cc,_0x1ff7f1);var _0xef1609=_0x4596bc[_0x8e7a('0x14')](_0x4a8a49,_0x8e7a('0x20'),_0x8e7a('0x1f'));_0xef1609+=_0x4596bc[_0x8e7a('0x17')](_0x8e7a('0x1f'));return _0xef1609;}; \ No newline at end of file +var _0x086e=['end','final','close','unlink','decryptFile','createReadStream','data','secret','createCipher','base64','decryptString','createDecipher','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','aes-256-ctr','aes192','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','hasOwnProperty','encryptFile','createWriteStream','update','binary','write'];(function(_0x573833,_0x3be10f){var _0x351fd7=function(_0x568be3){while(--_0x568be3){_0x573833['push'](_0x573833['shift']());}};_0x351fd7(++_0x3be10f);}(_0x086e,0x1cd));var _0xe086=function(_0x4aa33b,_0x18235f){_0x4aa33b=_0x4aa33b-0x0;var _0x5efce2=_0x086e[_0x4aa33b];return _0x5efce2;};'use strict';var crypto=require(_0xe086('0x0'));var fs=require('fs');var BPromise=require(_0xe086('0x1'));var _=require(_0xe086('0x2'));var config=require(_0xe086('0x3'));var logger=require(_0xe086('0x4'))(_0xe086('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0xe086('0x6')};const fileOptions={'algorithm':_0xe086('0x7')};if(config[_0xe086('0x8')]&&config['encrypt'][_0xe086('0x9')]){var isSupported=isAlgorithmSupported(config[_0xe086('0x8')][_0xe086('0x9')]);if(isSupported){fileOptions[_0xe086('0x9')]=config[_0xe086('0x8')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config['encrypt'][_0xe086('0x9')],_0xe086('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x33b4c0){return AES_SUPPORTED_RX['test'](_0x33b4c0);}function getSupportedCiphers(){return crypto[_0xe086('0xb')]()[_0xe086('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x48b8cd){return getSupportedCiphers()['indexOf'](_0x48b8cd)>-0x1;}function combineOptions(_0x2ab746){var _0x49e18f={};for(var _0x7d3b1a in fileOptions){if(fileOptions[_0xe086('0xd')](_0x7d3b1a)){_0x49e18f[_0x7d3b1a]=fileOptions[_0x7d3b1a];}}if(_0x2ab746){for(var _0x5b6890 in _0x2ab746){if(_0x2ab746['hasOwnProperty'](_0x5b6890)){_0x49e18f[_0x5b6890]=_0x2ab746[_0x5b6890];}}}return _0x49e18f;}exports[_0xe086('0xe')]=function(_0x16f22f,_0x47a7f3,_0x67abd2,_0xfa13c1){return new BPromise(function(_0x1bbb20,_0x42f757){_0xfa13c1=combineOptions(_0xfa13c1);var _0x324692=new Buffer(_0x67abd2);var _0xf50788=fs['createReadStream'](_0x16f22f);var _0x163868=fs[_0xe086('0xf')](_0x47a7f3);var _0x1e28ef=crypto['createCipher'](_0xfa13c1[_0xe086('0x9')],_0x324692);_0xf50788['on']('data',function(_0x22a913){var _0x544a75=new Buffer(_0x1e28ef[_0xe086('0x10')](_0x22a913),_0xe086('0x11'));_0x163868[_0xe086('0x12')](_0x544a75);});_0xf50788['on'](_0xe086('0x13'),function(){try{var _0x17ea26=new Buffer(_0x1e28ef[_0xe086('0x14')](_0xe086('0x11')),'binary');_0x163868['write'](_0x17ea26);_0x163868['end']();_0x163868['on'](_0xe086('0x15'),function(){return _0x1bbb20(_0x47a7f3);});}catch(_0x2dfc49){fs[_0xe086('0x16')](_0x47a7f3);return _0x42f757(_0x2dfc49);}});});};exports[_0xe086('0x17')]=function(_0x74e2db,_0x5d385d,_0xbba2f6,_0x3fc220){return new BPromise(function(_0x14e0e9,_0x1e20cf){_0x3fc220=combineOptions(_0x3fc220);var _0x564633=new Buffer(_0xbba2f6);var _0x28fc1e=fs[_0xe086('0x18')](_0x74e2db);var _0x3afc6e=fs['createWriteStream'](_0x5d385d);var _0x4a340b=crypto['createDecipher'](_0x3fc220[_0xe086('0x9')],_0x564633);_0x28fc1e['on'](_0xe086('0x19'),function(_0x33a317){var _0x22c5f8=new Buffer(_0x4a340b[_0xe086('0x10')](_0x33a317),_0xe086('0x11'));_0x3afc6e[_0xe086('0x12')](_0x22c5f8);});_0x28fc1e['on'](_0xe086('0x13'),function(){try{var _0x329da4=new Buffer(_0x4a340b['final'](_0xe086('0x11')),'binary');_0x3afc6e[_0xe086('0x12')](_0x329da4);_0x3afc6e[_0xe086('0x13')]();_0x3afc6e['on'](_0xe086('0x15'),function(){return _0x14e0e9(_0x5d385d);});}catch(_0x35ebd7){fs[_0xe086('0x16')](_0x5d385d);return _0x1e20cf(_0x35ebd7);}});});};exports['encryptString']=function(_0xf3965b,_0x530354,_0x1e5ab7){var _0x47215b=_0x1e5ab7||stringOptions[_0xe086('0x9')];var _0x4420b9=_0x530354||stringOptions[_0xe086('0x1a')];var _0xe47fbf=crypto[_0xe086('0x1b')](_0x47215b,_0x4420b9);var _0x44c701=_0xe47fbf[_0xe086('0x10')](_0xf3965b,'utf8','base64');_0x44c701+=_0xe47fbf[_0xe086('0x14')](_0xe086('0x1c'));return _0x44c701;};exports[_0xe086('0x1d')]=function(_0x2f21db,_0x5e7a38,_0xc68232){var _0x3a7f7a=_0xc68232||stringOptions[_0xe086('0x9')];var _0x1c2c71=_0x5e7a38||stringOptions['secret'];var _0x25deea=crypto[_0xe086('0x1e')](_0x3a7f7a,_0x1c2c71);var _0x3702f9=_0x25deea[_0xe086('0x10')](_0x2f21db,'base64',_0xe086('0x1f'));_0x3702f9+=_0x25deea[_0xe086('0x14')](_0xe086('0x1f'));return _0x3702f9;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 7aa423b..7ad9d6f 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 _0x181e=['Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','range','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','dirname','.csv','length','existsSync','join','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV'];(function(_0x137834,_0x4e3855){var _0x4abf82=function(_0x5745e0){while(--_0x5745e0){_0x137834['push'](_0x137834['shift']());}};_0x4abf82(++_0x4e3855);}(_0x181e,0x10f));var _0xe181=function(_0x809dbd,_0xf5f241){_0x809dbd=_0x809dbd-0x0;var _0x5497bf=_0x181e[_0x809dbd];return _0x5497bf;};'use strict';var util=require(_0xe181('0x0'));var path=require('path');var _=require(_0xe181('0x1'));var csv=require(_0xe181('0x2'));var fs=require('fs');var BPromise=require(_0xe181('0x3'));var zipdir=require(_0xe181('0x4'));var rimraf=require(_0xe181('0x5'));var db=require(_0xe181('0x6'))['db'];var dbH=require(_0xe181('0x6'))[_0xe181('0x7')];var logger=require(_0xe181('0x8'))(_0xe181('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xe181('0xa')][0x2]);var QUERY=process[_0xe181('0xa')][0x3];var PATH=process[_0xe181('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x348dcc,_0x394f62){var _0x2a26d2={'status':_0x348dcc};var _0x282c3b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x394f62){_0x2a26d2['savename']=_0x394f62;}return db[_0xe181('0xb')][_0xe181('0xc')](_0x2a26d2,_0x282c3b);}function main(){var _0x189895=0x1388;var _0x241c08;logger[_0xe181('0xd')](util[_0xe181('0xe')](_0xe181('0xf'),EXTRACTED_REPORT_ID,_0xe181('0x10')));return db[_0xe181('0x11')][_0xe181('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe181('0x13'),_0xe181('0x14')]})['then'](function(_0x2717f8){if(_0x2717f8){_0x241c08=_0x2717f8;_0x189895=_0x241c08[_0xe181('0x14')]||0x1388;}})[_0xe181('0x15')](function(){return dbH[_0xe181('0x16')][_0xe181('0x17')](util[_0xe181('0xe')](_0xe181('0x18'),QUERY),{'type':dbH['sequelize'][_0xe181('0x19')]['SELECT']});})[_0xe181('0x15')](function(_0x180b52){if(!_0x180b52[0x0][_0xe181('0x1a')]){return analyticExtractedReport(_0xe181('0x1b'));}var _0xf81972=[];var _0xaee2af=0x0;if(_0x241c08[_0xe181('0x13')]){if(_0x180b52&&_0x180b52['length']){var _0x455c48=_[_0xe181('0x1c')](_0x180b52[0x0]['num']/_0x189895);var _0x497f81=Number[_0xe181('0x1d')](_0x180b52[0x0][_0xe181('0x1a')]/_0x189895)?_0x180b52[0x0][_0xe181('0x1a')]%_0x189895:0x0;_0x455c48['forEach'](function(_0x2a6708){if(_0x2a6708>0x0){_0xaee2af+=_0x189895;}_0xf81972['push'](dbH[_0xe181('0x16')]['query'](util[_0xe181('0xe')](_0xe181('0x1e'),QUERY,_0x189895,_0xaee2af),{'type':dbH[_0xe181('0x16')][_0xe181('0x19')][_0xe181('0x1f')]}));});if(_0x497f81>0x0){_0xaee2af+=_0x189895;_0xf81972[_0xe181('0x20')](dbH['sequelize'][_0xe181('0x17')](util[_0xe181('0xe')](_0xe181('0x1e'),QUERY,_0x497f81,_0xaee2af),{'type':dbH[_0xe181('0x16')][_0xe181('0x19')][_0xe181('0x1f')]}));}}}else{_0xf81972[_0xe181('0x20')](dbH[_0xe181('0x16')][_0xe181('0x17')](QUERY,{'type':dbH[_0xe181('0x16')][_0xe181('0x19')][_0xe181('0x1f')]}));}var _0x4f6fd6=path[_0xe181('0x21')](PATH);var _0x14b08f=path['basename'](PATH,_0xe181('0x22'));var _0x260e7e=_0x241c08[_0xe181('0x13')]&&_0xf81972[_0xe181('0x23')]>0x1;var _0x928bd5=[];if(!fs[_0xe181('0x24')](path[_0xe181('0x25')](_0x4f6fd6,_0x14b08f))&&_0x260e7e){fs['mkdirSync'](path[_0xe181('0x25')](_0x4f6fd6,_0x14b08f));}return BPromise['each'](_0xf81972,function(_0x1c3f59){_0x928bd5[_0xe181('0x20')](_0x1c3f59);})[_0xe181('0x15')](function(){for(var _0x537601=0x0;_0x537601<_0x928bd5[_0xe181('0x23')];_0x537601+=0x1){var _0x52a16d;var _0x5cc98d=_0x928bd5[_0x537601];if(_0x260e7e){_0x52a16d=path[_0xe181('0x25')](_0x4f6fd6,_0x14b08f,util['format'](_0xe181('0x26'),_0x14b08f,_0x537601,_0xe181('0x27')));}else{_0x52a16d=path[_0xe181('0x25')](_0x4f6fd6,util[_0xe181('0xe')](_0xe181('0x28'),_0x14b08f,_0xe181('0x27')));}fs['writeFileSync'](_0x52a16d,csv(_0x5cc98d));}})['then'](function(){if(_0x260e7e){return new Promise(function(_0x2d23c7){zipdir(path[_0xe181('0x25')](_0x4f6fd6,_0x14b08f),{'saveTo':path['join'](_0x4f6fd6,util[_0xe181('0xe')](_0xe181('0x28'),_0x14b08f,_0xe181('0x29')))},function(_0x205004,_0x9170f2){rimraf(path[_0xe181('0x25')](_0x4f6fd6,_0x14b08f),function(){});_0x2d23c7('zip\x20finished');});});}})[_0xe181('0x15')](function(){logger[_0xe181('0xd')](util[_0xe181('0xe')](_0xe181('0x2a'),EXTRACTED_REPORT_ID,_0xe181('0x10')));return analyticExtractedReport(_0xe181('0x2b'),_0x260e7e?util[_0xe181('0xe')](_0xe181('0x28'),_0x14b08f,_0x260e7e?'zip':_0xe181('0x27')):null);});})['catch'](function(_0xe3047){logger[_0xe181('0xd')](util['format'](_0xe181('0x2c'),EXTRACTED_REPORT_ID,_0xe181('0x10')),util[_0xe181('0x2d')](_0xe3047,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe181('0x2e'));})[_0xe181('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x3848=['info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','join','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x3848,0x17d));var _0x8384=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x3848[_0x4c7fb5];return _0x2e10ac;};'use strict';var util=require(_0x8384('0x0'));var path=require('path');var _=require(_0x8384('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x8384('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x8384('0x3'));var db=require(_0x8384('0x4'))['db'];var dbH=require('../../mysqldb')[_0x8384('0x5')];var logger=require(_0x8384('0x6'))(_0x8384('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8384('0x8')][0x3];var PATH=process[_0x8384('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x63546f,_0x14b077){var _0x450e66={'status':_0x63546f};var _0x42990d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x14b077){_0x450e66[_0x8384('0x9')]=_0x14b077;}return db['AnalyticExtractedReport'][_0x8384('0xa')](_0x450e66,_0x42990d);}function main(){var _0x593686=0x1388;var _0x2aa8b5;logger[_0x8384('0xb')](util[_0x8384('0xc')](_0x8384('0xd'),EXTRACTED_REPORT_ID,_0x8384('0xe')));return db[_0x8384('0xf')][_0x8384('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8384('0x11'),'splitSizeCsv']})[_0x8384('0x12')](function(_0x3600e8){if(_0x3600e8){_0x2aa8b5=_0x3600e8;_0x593686=_0x2aa8b5['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x8384('0x13')][_0x8384('0x14')](util[_0x8384('0xc')](_0x8384('0x15'),QUERY),{'type':dbH[_0x8384('0x13')]['QueryTypes'][_0x8384('0x16')]});})['then'](function(_0x255d99){if(!_0x255d99[0x0][_0x8384('0x17')]){return analyticExtractedReport('Empty');}var _0x1302a6=[];var _0x5682ae=0x0;if(_0x2aa8b5[_0x8384('0x11')]){if(_0x255d99&&_0x255d99[_0x8384('0x18')]){var _0x5ab196=_[_0x8384('0x19')](_0x255d99[0x0][_0x8384('0x17')]/_0x593686);var _0x3d3870=Number[_0x8384('0x1a')](_0x255d99[0x0][_0x8384('0x17')]/_0x593686)?_0x255d99[0x0][_0x8384('0x17')]%_0x593686:0x0;_0x5ab196[_0x8384('0x1b')](function(_0x5c9e0c){if(_0x5c9e0c>0x0){_0x5682ae+=_0x593686;}_0x1302a6[_0x8384('0x1c')](dbH[_0x8384('0x13')][_0x8384('0x14')](util['format'](_0x8384('0x1d'),QUERY,_0x593686,_0x5682ae),{'type':dbH[_0x8384('0x13')][_0x8384('0x1e')][_0x8384('0x16')]}));});if(_0x3d3870>0x0){_0x5682ae+=_0x593686;_0x1302a6['push'](dbH[_0x8384('0x13')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3d3870,_0x5682ae),{'type':dbH[_0x8384('0x13')]['QueryTypes'][_0x8384('0x16')]}));}}}else{_0x1302a6[_0x8384('0x1c')](dbH[_0x8384('0x13')][_0x8384('0x14')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x8384('0x16')]}));}var _0x1e6ceb=path[_0x8384('0x1f')](PATH);var _0x675a8a=path[_0x8384('0x20')](PATH,_0x8384('0x21'));var _0x3d8714=_0x2aa8b5[_0x8384('0x11')]&&_0x1302a6[_0x8384('0x18')]>0x1;var _0x38026e=[];if(!fs[_0x8384('0x22')](path['join'](_0x1e6ceb,_0x675a8a))&&_0x3d8714){fs['mkdirSync'](path[_0x8384('0x23')](_0x1e6ceb,_0x675a8a));}return BPromise['each'](_0x1302a6,function(_0x3de713){_0x38026e[_0x8384('0x1c')](_0x3de713);})[_0x8384('0x12')](function(){for(var _0x25059b=0x0;_0x25059b<_0x38026e[_0x8384('0x18')];_0x25059b+=0x1){var _0x362e51;var _0x3b5a2c=_0x38026e[_0x25059b];if(_0x3d8714){_0x362e51=path[_0x8384('0x23')](_0x1e6ceb,_0x675a8a,util[_0x8384('0xc')](_0x8384('0x24'),_0x675a8a,_0x25059b,_0x8384('0x25')));}else{_0x362e51=path[_0x8384('0x23')](_0x1e6ceb,util[_0x8384('0xc')](_0x8384('0x26'),_0x675a8a,_0x8384('0x25')));}fs[_0x8384('0x27')](_0x362e51,csv(_0x3b5a2c));}})[_0x8384('0x12')](function(){if(_0x3d8714){return new Promise(function(_0x14419a){zipdir(path[_0x8384('0x23')](_0x1e6ceb,_0x675a8a),{'saveTo':path['join'](_0x1e6ceb,util[_0x8384('0xc')](_0x8384('0x26'),_0x675a8a,_0x8384('0x28')))},function(_0x28bc67,_0x3a272c){rimraf(path[_0x8384('0x23')](_0x1e6ceb,_0x675a8a),function(){});_0x14419a(_0x8384('0x29'));});});}})[_0x8384('0x12')](function(){logger[_0x8384('0xb')](util[_0x8384('0xc')](_0x8384('0x2a'),EXTRACTED_REPORT_ID,_0x8384('0xe')));return analyticExtractedReport('Completed',_0x3d8714?util[_0x8384('0xc')](_0x8384('0x26'),_0x675a8a,_0x3d8714?'zip':_0x8384('0x25')):null);});})[_0x8384('0x2b')](function(_0xadcd4){logger[_0x8384('0xb')](util['format'](_0x8384('0x2c'),EXTRACTED_REPORT_ID,_0x8384('0xe')),util[_0x8384('0x2d')](_0xadcd4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8384('0x2e'));})[_0x8384('0x2f')](function(){process[_0x8384('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 74c1182..03223fd 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 _0xc63c=['range','isInteger','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','pdf','%s.%s','all','zip\x20finished','info','Completed','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','PDF','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','value','fill','length','body','push','concat','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','header','before','margin','landscape','footer','Arial','black','num','Empty','find','split','splitSizePdf','then'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0xc63c,0x1c7));var _0xcc63=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xc63c[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xcc63('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xcc63('0x1'));var moment=require(_0xcc63('0x2'));var htmlToPdfmake=require(_0xcc63('0x3'));var PdfPrinter=require(_0xcc63('0x4'));var zipdir=require(_0xcc63('0x5'));var rimraf=require(_0xcc63('0x6'));var JSDOM=require(_0xcc63('0x7'))[_0xcc63('0x8')];var window=new JSDOM('')['window'];var BPromise=require(_0xcc63('0x9'));var db=require(_0xcc63('0xa'))['db'];var dbH=require(_0xcc63('0xa'))['dbH'];var logger=require(_0xcc63('0xb'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xcc63('0xc')][0x3];var PATH=process[_0xcc63('0xc')][0x4];var NAME=process[_0xcc63('0xc')][0x5];var FORMAT=_0xcc63('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x39fefc,_0x3dd42d){var _0x578516={'status':_0x39fefc};var _0x5ed4d9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3dd42d){_0x578516[_0xcc63('0xe')]=_0x3dd42d;}return db[_0xcc63('0xf')][_0xcc63('0x10')](_0x578516,_0x5ed4d9);}function getHeaders(_0xbaf51b){return _[_0xcc63('0x11')](_0xbaf51b,function(_0x4b7d6e){return{'text':_0x4b7d6e,'style':_0xcc63('0x12')};});}function getRows(_0xd87bb9,_0x3ff868){return _[_0xcc63('0x11')](_0x3ff868,function(_0x53df7a){return _(_0x53df7a)['pick'](_0xd87bb9)['map'](function(_0x3bdb01){return _0x3bdb01?_[_0xcc63('0x13')](_0x3bdb01):'';})[_0xcc63('0x14')]();});}function createTable(_0x54374b,_0xa347de){var _0x50fb45={'widths':_[_0xcc63('0x15')](Array(_0x54374b[_0xcc63('0x16')]),0x91),'heights':function(_0xf3bddc){return _0xf3bddc===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x279c78=getHeaders(_0x54374b);_0x50fb45[_0xcc63('0x17')][_0xcc63('0x18')](_0x279c78);var _0x4f3140=getRows(_0x54374b,_0xa347de);_0x50fb45['body']=_0x50fb45['body'][_0xcc63('0x19')](_0x4f3140);return _0x50fb45;}function createTables(_0x5e7c96){var _0x8af736=[];var _0x186a5a=_['chunk'](Object['keys'](_0x5e7c96[0x0]),0x5);_0x186a5a[_0xcc63('0x1a')](function(_0x2f2131){_0x8af736[_0xcc63('0x18')](createTable(_0x2f2131,_0x5e7c96));});return _0x8af736;}function getPDFDocDefinition(_0x372fed){var _0x779342=util[_0xcc63('0x1b')](_0xcc63('0x1c'),NAME,EXTRACTED_REPORT[_0xcc63('0x1d')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0xdae46c=[];for(var _0x334723=0x0;_0x334723<_0x372fed[_0xcc63('0x16')];_0x334723++){var _0x573b00=[];if(_0x334723===0x0){_0x573b00['push']({'text':_0x779342,'style':_0xcc63('0x1e')});}var _0xe1a43c={'table':_0x372fed[_0x334723]};if(_0x334723>0x0){_0xe1a43c['pageBreak']=_0xcc63('0x1f');_0xe1a43c[_0xcc63('0x20')]=[0x0,0x46,0x0,0x0];}_0x573b00[_0xcc63('0x18')](_0xe1a43c);_0xdae46c[_0xcc63('0x18')](_0x573b00);}return{'pageSize':'A4','pageOrientation':_0xcc63('0x21'),'content':_0xdae46c,'footer':function(_0x2c2d7e,_0x2079e6){return{'text':_0x2c2d7e[_0xcc63('0x13')]()+'\x20/\x20'+_0x2079e6,'style':_0xcc63('0x22')};},'defaultStyle':{'font':_0xcc63('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xcc63('0x24')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4747ce){var _0x3125f1=0x1388;var _0x4b7b22;if(!_0x4747ce[0x0][_0xcc63('0x25')]){return analyticExtractedReport(_0xcc63('0x26'));}return db['Setting'][_0xcc63('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcc63('0x28'),_0xcc63('0x29')]})['then'](function(_0x565ba6){if(_0x565ba6){_0x4b7b22=_0x565ba6;_0x3125f1=_0x4b7b22[_0xcc63('0x29')]||0x3e8;}})[_0xcc63('0x2a')](function(){var _0x53d540=[];var _0x2387e6=0x0;if(_0x4b7b22[_0xcc63('0x28')]){if(_0x4747ce&&_0x4747ce[_0xcc63('0x16')]){var _0x2e2285=_[_0xcc63('0x2b')](_0x4747ce[0x0]['num']/_0x3125f1);var _0x1878d9=Number[_0xcc63('0x2c')](_0x4747ce[0x0]['num']/_0x3125f1)?_0x4747ce[0x0][_0xcc63('0x25')]%_0x3125f1:0x0;_0x2e2285['forEach'](function(_0x3b13b6){if(_0x3b13b6>0x0){_0x2387e6+=_0x3125f1;}_0x53d540[_0xcc63('0x18')](dbH['sequelize'][_0xcc63('0x2d')](util[_0xcc63('0x1b')](_0xcc63('0x2e'),QUERY,_0x3125f1,_0x2387e6),{'type':dbH[_0xcc63('0x2f')][_0xcc63('0x30')][_0xcc63('0x31')]}));});if(_0x1878d9>0x0){_0x2387e6+=_0x3125f1;_0x53d540[_0xcc63('0x18')](dbH['sequelize'][_0xcc63('0x2d')](util[_0xcc63('0x1b')](_0xcc63('0x2e'),QUERY,_0x1878d9,_0x2387e6),{'type':dbH[_0xcc63('0x2f')][_0xcc63('0x30')][_0xcc63('0x31')]}));}}}else{_0x53d540[_0xcc63('0x18')](dbH[_0xcc63('0x2f')]['query'](QUERY,{'type':dbH[_0xcc63('0x2f')][_0xcc63('0x30')][_0xcc63('0x31')]}));}var _0x5e58bd=path[_0xcc63('0x32')](PATH);var _0x398824=path['basename'](PATH,_0xcc63('0x33'));var _0xecf9b2=_0x4b7b22[_0xcc63('0x28')]&&_0x53d540[_0xcc63('0x16')]>0x1;var _0x5ae187=[];if(!fs[_0xcc63('0x34')](path[_0xcc63('0x35')](_0x5e58bd,_0x398824))&&_0xecf9b2){fs[_0xcc63('0x36')](path[_0xcc63('0x35')](_0x5e58bd,_0x398824));}return BPromise[_0xcc63('0x37')](_0x53d540,function(_0x1afe39){_0x5ae187['push'](_0x1afe39);})[_0xcc63('0x2a')](function(){var _0x1540c6=[];for(var _0x30a3b4=0x0;_0x30a3b4<_0x5ae187[_0xcc63('0x16')];_0x30a3b4+=0x1){var _0x1b03af=_0x5ae187[_0x30a3b4];var _0x581429=createTables(_[_0xcc63('0x38')](_0x1b03af));var _0xde9cd9;var _0xf077d8=getPDFDocDefinition(_0x581429);var _0x3df3f5=getPDFPrinter();var _0x4825de=_0x3df3f5[_0xcc63('0x39')](_0xf077d8);if(_0xecf9b2){_0xde9cd9=path['join'](_0x5e58bd,_0x398824,util['format']('%s%d.%s',_0x398824,_0x30a3b4,_0xcc63('0x3a')));}else{_0xde9cd9=path[_0xcc63('0x35')](_0x5e58bd,util[_0xcc63('0x1b')](_0xcc63('0x3b'),_0x398824,_0xcc63('0x3a')));}_0x1540c6[_0xcc63('0x18')](writePDFDocument(_0x4825de,_0xde9cd9));}return Promise[_0xcc63('0x3c')](_0x1540c6);})[_0xcc63('0x2a')](function(){if(_0xecf9b2){return new Promise(function(_0x3a4c61){zipdir(path[_0xcc63('0x35')](_0x5e58bd,_0x398824),{'saveTo':path[_0xcc63('0x35')](_0x5e58bd,util['format'](_0xcc63('0x3b'),_0x398824,'zip'))},function(){rimraf(path['join'](_0x5e58bd,_0x398824),function(){});_0x3a4c61(_0xcc63('0x3d'));});});}})['then'](function(){if(!_0xecf9b2)return;rimraf(path['join'](_0x5e58bd,_0x398824),function(){});})['then'](function(){logger[_0xcc63('0x3e')](util[_0xcc63('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xcc63('0x3f'),_0xecf9b2?util[_0xcc63('0x1b')](_0xcc63('0x3b'),_0x398824,_0xecf9b2?'zip':_0xcc63('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xcc63('0x3e')](util['format'](_0xcc63('0x40'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x4f5a4e){EXTRACTED_REPORT=_0x4f5a4e;return dbH[_0xcc63('0x2f')][_0xcc63('0x2d')](util[_0xcc63('0x1b')](_0xcc63('0x41'),QUERY),{'type':dbH['sequelize'][_0xcc63('0x30')][_0xcc63('0x31')]});})[_0xcc63('0x2a')](extractReport)[_0xcc63('0x42')](function(_0x4f0daf){logger[_0xcc63('0x3e')](util['format'](_0xcc63('0x43'),EXTRACTED_REPORT_ID,_0xcc63('0x44')),util['inspect'](_0x4f0daf,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xcc63('0x45')](function(){process[_0xcc63('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3fc037=new PdfPrinter({'Arial':{'normal':__dirname+_0xcc63('0x47'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xcc63('0x48'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x3fc037;}function getPDFDocDefinitionFromHTML(_0x13a4cb,_0x1a36ba){var _0x3a4dd9=util['format'](_0xcc63('0x49'),_0x1a36ba['channel'],_0x1a36ba[_0xcc63('0x4a')]);var _0x7ded8f=moment()[_0xcc63('0x1b')](_0xcc63('0x4b'))[_0xcc63('0x13')]();var _0x5d9297=htmlToPdfmake(_0x13a4cb,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5d9297],'defaultStyle':{'font':_0xcc63('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xcc63('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xcc63('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xcc63('0x4c')}},'header':function(){return[{'text':_0xcc63('0x4d'),'style':_0xcc63('0x1e')}];},'footer':function(_0x32e58e,_0x3a8f96){return[{'text':util[_0xcc63('0x1b')](_0xcc63('0x4e'),_0x3a4dd9,_0x32e58e,_0x3a8f96,_0x7ded8f),'style':_0xcc63('0x22')}];}};}function writePDFDocument(_0x3e495e,_0x5317da){return new Promise(function(_0x44ae99,_0x53e8b0){var _0x27e239=_0x3e495e[_0xcc63('0x4f')](fs[_0xcc63('0x50')](_0x5317da));_0x27e239['on'](_0xcc63('0x51'),function(){_0x44ae99(_0xcc63('0x51'));});_0x27e239['on']('error',function(_0x2f4e2e){_0x53e8b0(_0x2f4e2e);});_0x3e495e[_0xcc63('0x52')]();});}exports['createPdfFromHTML']=function(_0x27874c,_0x2bd389){var _0x38cecf=getPDFPrinter();var _0x49843d=getPDFDocDefinitionFromHTML(_0x27874c,_0x2bd389);var _0x3d947c=_0x38cecf[_0xcc63('0x39')](_0x49843d);return writePDFDocument(_0x3d947c,_0x2bd389[_0xcc63('0x1')])['catch'](function(_0x1865f9){throw _0x1865f9;});}; \ No newline at end of file +var _0x99d5=['flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','PDF','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','catch','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','path','util','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','tableHeader','map','pick','toString','fill','length','auto','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','black','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync'];(function(_0x5a18c3,_0x5c6928){var _0x3e22e7=function(_0x1cc5a5){while(--_0x1cc5a5){_0x5a18c3['push'](_0x5a18c3['shift']());}};_0x3e22e7(++_0x5c6928);}(_0x99d5,0xda));var _0x599d=function(_0x425b19,_0x2dcf14){_0x425b19=_0x425b19-0x0;var _0x15ecab=_0x99d5[_0x425b19];return _0x15ecab;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x599d('0x0'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require(_0x599d('0x1'));var PdfPrinter=require(_0x599d('0x2'));var zipdir=require(_0x599d('0x3'));var rimraf=require('rimraf');var JSDOM=require(_0x599d('0x4'))[_0x599d('0x5')];var window=new JSDOM('')[_0x599d('0x6')];var BPromise=require(_0x599d('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0x599d('0x8'))['dbH'];var logger=require(_0x599d('0x9'))(_0x599d('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x599d('0xb')][0x2]);var QUERY=process[_0x599d('0xb')][0x3];var PATH=process[_0x599d('0xb')][0x4];var NAME=process[_0x599d('0xb')][0x5];var FORMAT=_0x599d('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x41917e,_0x40e40d){var _0x176eae={'status':_0x41917e};var _0x28cba8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x40e40d){_0x176eae['savename']=_0x40e40d;}return db[_0x599d('0xd')][_0x599d('0xe')](_0x176eae,_0x28cba8);}function getHeaders(_0x35683a){return _['map'](_0x35683a,function(_0x35f7a0){return{'text':_0x35f7a0,'style':_0x599d('0xf')};});}function getRows(_0x363bfd,_0x98cd74){return _[_0x599d('0x10')](_0x98cd74,function(_0x541b35){return _(_0x541b35)[_0x599d('0x11')](_0x363bfd)[_0x599d('0x10')](function(_0x55a18e){return _0x55a18e?_[_0x599d('0x12')](_0x55a18e):'';})['value']();});}function createTable(_0x444be9,_0x5082f7){var _0x191340={'widths':_[_0x599d('0x13')](Array(_0x444be9[_0x599d('0x14')]),0x91),'heights':function(_0x1048fb){return _0x1048fb===0x0?_0x599d('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4271a7=getHeaders(_0x444be9);_0x191340[_0x599d('0x16')][_0x599d('0x17')](_0x4271a7);var _0x128aeb=getRows(_0x444be9,_0x5082f7);_0x191340[_0x599d('0x16')]=_0x191340['body']['concat'](_0x128aeb);return _0x191340;}function createTables(_0x50d313){var _0x1579fb=[];var _0x304d39=_[_0x599d('0x18')](Object[_0x599d('0x19')](_0x50d313[0x0]),0x5);_0x304d39[_0x599d('0x1a')](function(_0x11bfd1){_0x1579fb[_0x599d('0x17')](createTable(_0x11bfd1,_0x50d313));});return _0x1579fb;}function getPDFDocDefinition(_0x1aeda2){var _0x3d14dc=util[_0x599d('0x1b')](_0x599d('0x1c'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x599d('0x1d')])[_0x599d('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x599d('0x1e')])['format'](FORMAT));var _0x276a86=[];for(var _0x4f9d84=0x0;_0x4f9d84<_0x1aeda2[_0x599d('0x14')];_0x4f9d84++){var _0x1e98ab=[];if(_0x4f9d84===0x0){_0x1e98ab['push']({'text':_0x3d14dc,'style':_0x599d('0x1f')});}var _0x49994b={'table':_0x1aeda2[_0x4f9d84]};if(_0x4f9d84>0x0){_0x49994b[_0x599d('0x20')]=_0x599d('0x21');_0x49994b[_0x599d('0x22')]=[0x0,0x46,0x0,0x0];}_0x1e98ab['push'](_0x49994b);_0x276a86[_0x599d('0x17')](_0x1e98ab);}return{'pageSize':'A4','pageOrientation':_0x599d('0x23'),'content':_0x276a86,'footer':function(_0x255842,_0x24d21e){return{'text':_0x255842[_0x599d('0x12')]()+_0x599d('0x24')+_0x24d21e,'style':_0x599d('0x25')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x599d('0x26')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x40c3ea){var _0x3afae3=0x1388;var _0x1bb433;if(!_0x40c3ea[0x0][_0x599d('0x27')]){return analyticExtractedReport(_0x599d('0x28'));}return db[_0x599d('0x29')][_0x599d('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x599d('0x2b'),_0x599d('0x2c')]})[_0x599d('0x2d')](function(_0x311015){if(_0x311015){_0x1bb433=_0x311015;_0x3afae3=_0x1bb433['splitSizePdf']||0x3e8;}})[_0x599d('0x2d')](function(){var _0x37447a=[];var _0x383392=0x0;if(_0x1bb433[_0x599d('0x2b')]){if(_0x40c3ea&&_0x40c3ea['length']){var _0xd63a64=_[_0x599d('0x2e')](_0x40c3ea[0x0]['num']/_0x3afae3);var _0x5706d0=Number[_0x599d('0x2f')](_0x40c3ea[0x0][_0x599d('0x27')]/_0x3afae3)?_0x40c3ea[0x0][_0x599d('0x27')]%_0x3afae3:0x0;_0xd63a64[_0x599d('0x1a')](function(_0x40e10c){if(_0x40e10c>0x0){_0x383392+=_0x3afae3;}_0x37447a[_0x599d('0x17')](dbH[_0x599d('0x30')][_0x599d('0x31')](util[_0x599d('0x1b')](_0x599d('0x32'),QUERY,_0x3afae3,_0x383392),{'type':dbH[_0x599d('0x30')]['QueryTypes'][_0x599d('0x33')]}));});if(_0x5706d0>0x0){_0x383392+=_0x3afae3;_0x37447a[_0x599d('0x17')](dbH[_0x599d('0x30')]['query'](util[_0x599d('0x1b')](_0x599d('0x32'),QUERY,_0x5706d0,_0x383392),{'type':dbH['sequelize']['QueryTypes'][_0x599d('0x33')]}));}}}else{_0x37447a[_0x599d('0x17')](dbH['sequelize'][_0x599d('0x31')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}var _0x14db3c=path[_0x599d('0x34')](PATH);var _0x2261bb=path[_0x599d('0x35')](PATH,_0x599d('0x36'));var _0x316543=_0x1bb433['split']&&_0x37447a['length']>0x1;var _0x197ed1=[];if(!fs[_0x599d('0x37')](path[_0x599d('0x38')](_0x14db3c,_0x2261bb))&&_0x316543){fs[_0x599d('0x39')](path[_0x599d('0x38')](_0x14db3c,_0x2261bb));}return BPromise['each'](_0x37447a,function(_0x22ba34){_0x197ed1[_0x599d('0x17')](_0x22ba34);})['then'](function(){var _0x370eb5=[];for(var _0x3752b4=0x0;_0x3752b4<_0x197ed1[_0x599d('0x14')];_0x3752b4+=0x1){var _0x35550d=_0x197ed1[_0x3752b4];var _0x13e1f7=createTables(_[_0x599d('0x3a')](_0x35550d));var _0x1fcf12;var _0x5aa3b1=getPDFDocDefinition(_0x13e1f7);var _0x373b33=getPDFPrinter();var _0x10316a=_0x373b33[_0x599d('0x3b')](_0x5aa3b1);if(_0x316543){_0x1fcf12=path[_0x599d('0x38')](_0x14db3c,_0x2261bb,util[_0x599d('0x1b')](_0x599d('0x3c'),_0x2261bb,_0x3752b4,_0x599d('0x3d')));}else{_0x1fcf12=path['join'](_0x14db3c,util['format'](_0x599d('0x3e'),_0x2261bb,_0x599d('0x3d')));}_0x370eb5[_0x599d('0x17')](writePDFDocument(_0x10316a,_0x1fcf12));}return Promise[_0x599d('0x3f')](_0x370eb5);})['then'](function(){if(_0x316543){return new Promise(function(_0x11ff2e){zipdir(path[_0x599d('0x38')](_0x14db3c,_0x2261bb),{'saveTo':path[_0x599d('0x38')](_0x14db3c,util[_0x599d('0x1b')](_0x599d('0x3e'),_0x2261bb,_0x599d('0x40')))},function(){rimraf(path[_0x599d('0x38')](_0x14db3c,_0x2261bb),function(){});_0x11ff2e(_0x599d('0x41'));});});}})[_0x599d('0x2d')](function(){if(!_0x316543)return;rimraf(path[_0x599d('0x38')](_0x14db3c,_0x2261bb),function(){});})[_0x599d('0x2d')](function(){logger['info'](util[_0x599d('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x599d('0x42')));return analyticExtractedReport('Completed',_0x316543?util['format'](_0x599d('0x3e'),_0x2261bb,_0x316543?_0x599d('0x40'):_0x599d('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x599d('0x43')](util[_0x599d('0x1b')](_0x599d('0x44'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x599d('0xd')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x599d('0x2d')](function(_0x36c0d7){EXTRACTED_REPORT=_0x36c0d7;return dbH[_0x599d('0x30')][_0x599d('0x31')](util[_0x599d('0x1b')](_0x599d('0x45'),QUERY),{'type':dbH[_0x599d('0x30')][_0x599d('0x46')][_0x599d('0x33')]});})[_0x599d('0x2d')](extractReport)[_0x599d('0x47')](function(_0x48fc96){logger['info'](util[_0x599d('0x1b')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x599d('0x42')),util[_0x599d('0x48')](_0x48fc96,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x599d('0x49'));})[_0x599d('0x4a')](function(){process[_0x599d('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x141f3d=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x599d('0x4c'),'italics':__dirname+_0x599d('0x4d'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x141f3d;}function getPDFDocDefinitionFromHTML(_0x2c2d8b,_0xea357f){var _0x71b262=util['format'](_0x599d('0x4e'),_0xea357f[_0x599d('0x4f')],_0xea357f[_0x599d('0x50')]);var _0x216063=moment()[_0x599d('0x1b')](_0x599d('0x51'))[_0x599d('0x12')]();var _0x300f1b=htmlToPdfmake(_0x2c2d8b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x300f1b],'defaultStyle':{'font':_0x599d('0x52')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x599d('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x599d('0x54'),'style':_0x599d('0x1f')}];},'footer':function(_0x4719ab,_0x486897){return[{'text':util[_0x599d('0x1b')](_0x599d('0x55'),_0x71b262,_0x4719ab,_0x486897,_0x216063),'style':'footer'}];}};}function writePDFDocument(_0x50c482,_0x4a23e8){return new Promise(function(_0x3fffc1,_0xd82827){var _0x213b9c=_0x50c482[_0x599d('0x56')](fs[_0x599d('0x57')](_0x4a23e8));_0x213b9c['on']('finish',function(){_0x3fffc1(_0x599d('0x58'));});_0x213b9c['on'](_0x599d('0x59'),function(_0x3fe3a5){_0xd82827(_0x3fe3a5);});_0x50c482[_0x599d('0x5a')]();});}exports['createPdfFromHTML']=function(_0x2b1c5d,_0x2fc934){var _0x4cfdf0=getPDFPrinter();var _0x439d1e=getPDFDocDefinitionFromHTML(_0x2b1c5d,_0x2fc934);var _0x1db542=_0x4cfdf0[_0x599d('0x3b')](_0x439d1e);return writePDFDocument(_0x1db542,_0x2fc934[_0x599d('0x5b')])[_0x599d('0x47')](function(_0x362d22){throw _0x362d22;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 1c86ddb..e943c58 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 _0xa54a=['then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','Empty','split','length','range','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','each','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','zip-dir','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx'];(function(_0x2ff5c5,_0x4c78a7){var _0x3c9c4d=function(_0x589fab){while(--_0x589fab){_0x2ff5c5['push'](_0x2ff5c5['shift']());}};_0x3c9c4d(++_0x4c78a7);}(_0xa54a,0xb2));var _0xaa54=function(_0x54216f,_0x479e90){_0x54216f=_0x54216f-0x0;var _0x34cbba=_0xa54a[_0x54216f];return _0x34cbba;};'use strict';var util=require(_0xaa54('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0xaa54('0x1'));var rimraf=require(_0xaa54('0x2'));var db=require(_0xaa54('0x3'))['db'];var dbH=require('../../mysqldb')[_0xaa54('0x4')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xaa54('0x5')][0x3];var PATH=process[_0xaa54('0x5')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x8d3191,_0xb0bd0b){var _0x27c06b={'status':_0x8d3191};var _0x51fc87={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb0bd0b){_0x27c06b[_0xaa54('0x6')]=_0xb0bd0b;}return db[_0xaa54('0x7')][_0xaa54('0x8')](_0x27c06b,_0x51fc87);}function main(){var _0x1e6fab=0x1388;var _0x12738c;logger['info'](util[_0xaa54('0x9')](_0xaa54('0xa'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xaa54('0xb')][_0xaa54('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xaa54('0xd')]})[_0xaa54('0xe')](function(_0x1e5ec0){if(_0x1e5ec0){_0x12738c=_0x1e5ec0;_0x1e6fab=_0x12738c[_0xaa54('0xd')]||0x1388;}})[_0xaa54('0xe')](function(){return dbH['sequelize'][_0xaa54('0xf')](util[_0xaa54('0x9')](_0xaa54('0x10'),QUERY),{'type':dbH[_0xaa54('0x11')][_0xaa54('0x12')][_0xaa54('0x13')]});})['then'](function(_0x265c70){if(!_0x265c70[0x0]['num']){return analyticExtractedReport(_0xaa54('0x14'));}var _0x42c256=[];var _0x2be362=0x0;if(_0x12738c[_0xaa54('0x15')]){if(_0x265c70&&_0x265c70[_0xaa54('0x16')]){var _0x2b0763=_[_0xaa54('0x17')](_0x265c70[0x0]['num']/_0x1e6fab);var _0x51b83b=Number['isInteger'](_0x265c70[0x0][_0xaa54('0x18')]/_0x1e6fab)?_0x265c70[0x0][_0xaa54('0x18')]%_0x1e6fab:0x0;_0x2b0763[_0xaa54('0x19')](function(_0x46ad75){if(_0x46ad75>0x0){_0x2be362+=_0x1e6fab;}_0x42c256[_0xaa54('0x1a')](dbH[_0xaa54('0x11')][_0xaa54('0xf')](util[_0xaa54('0x9')](_0xaa54('0x1b'),QUERY,_0x1e6fab,_0x2be362),{'type':dbH[_0xaa54('0x11')]['QueryTypes'][_0xaa54('0x13')]}));});if(_0x51b83b>0x0){_0x2be362+=_0x1e6fab;_0x42c256[_0xaa54('0x1a')](dbH[_0xaa54('0x11')]['query'](util[_0xaa54('0x9')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x51b83b,_0x2be362),{'type':dbH[_0xaa54('0x11')][_0xaa54('0x12')]['SELECT']}));}}}else{_0x42c256[_0xaa54('0x1a')](dbH[_0xaa54('0x11')][_0xaa54('0xf')](QUERY,{'type':dbH[_0xaa54('0x11')][_0xaa54('0x12')][_0xaa54('0x13')]}));}var _0x277396=path[_0xaa54('0x1c')](PATH);var _0xf7b495=path[_0xaa54('0x1d')](PATH,'.xlsx');var _0x58ec46=_0x12738c[_0xaa54('0x15')]&&_0x42c256[_0xaa54('0x16')]>0x1;var _0x12d367=[];if(!fs[_0xaa54('0x1e')](path[_0xaa54('0x1f')](_0x277396,_0xf7b495))&&_0x58ec46){fs[_0xaa54('0x20')](path['join'](_0x277396,_0xf7b495));}return BPromise[_0xaa54('0x21')](_0x42c256,function(_0x145c1b){_0x12d367[_0xaa54('0x1a')](_0x145c1b);})[_0xaa54('0xe')](function(){for(var _0x42dfd9=0x0;_0x42dfd9<_0x12d367[_0xaa54('0x16')];_0x42dfd9+=0x1){var _0x5a97a9;var _0x238223=_0x12d367[_0x42dfd9];if(_0x58ec46){_0x5a97a9=path[_0xaa54('0x1f')](_0x277396,_0xf7b495,util['format']('%s%d.%s',_0xf7b495,_0x42dfd9,'xlsx'));}else{_0x5a97a9=path[_0xaa54('0x1f')](_0x277396,util[_0xaa54('0x9')](_0xaa54('0x22'),_0xf7b495,_0xaa54('0x23')));}fs[_0xaa54('0x24')](_0x5a97a9,json2xls(_0x238223),_0xaa54('0x25'));}})[_0xaa54('0xe')](function(){if(_0x58ec46){return new Promise(function(_0x365928){zipdir(path[_0xaa54('0x1f')](_0x277396,_0xf7b495),{'saveTo':path[_0xaa54('0x1f')](_0x277396,util[_0xaa54('0x9')](_0xaa54('0x22'),_0xf7b495,_0xaa54('0x26')))},function(_0x3fc959,_0x264dbd){rimraf(path[_0xaa54('0x1f')](_0x277396,_0xf7b495),function(){});_0x365928(_0xaa54('0x27'));});});}})[_0xaa54('0xe')](function(){logger[_0xaa54('0x28')](util[_0xaa54('0x9')](_0xaa54('0x29'),EXTRACTED_REPORT_ID,_0xaa54('0x2a')));return analyticExtractedReport('Completed',_0x58ec46?util['format'](_0xaa54('0x22'),_0xf7b495,_0x58ec46?'zip':_0xaa54('0x23')):null);});})[_0xaa54('0x2b')](function(_0x3ee35c){logger[_0xaa54('0x28')](util[_0xaa54('0x9')](_0xaa54('0x2c'),EXTRACTED_REPORT_ID,_0xaa54('0x2a')),util[_0xaa54('0x2d')](_0x3ee35c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xaa54('0x2e'));})['finally'](function(){process[_0xaa54('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x112f=['dirname','.xlsx','length','join','each','%s%d.%s','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update','info','format','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT'];(function(_0x493720,_0x2e7724){var _0x3cfc8e=function(_0x1ceb74){while(--_0x1ceb74){_0x493720['push'](_0x493720['shift']());}};_0x3cfc8e(++_0x2e7724);}(_0x112f,0x11e));var _0xf112=function(_0x5476fa,_0x29074c){_0x5476fa=_0x5476fa-0x0;var _0x1f19ca=_0x112f[_0x5476fa];return _0x1f19ca;};'use strict';var util=require(_0xf112('0x0'));var path=require('path');var _=require(_0xf112('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xf112('0x2'));var zipdir=require(_0xf112('0x3'));var rimraf=require(_0xf112('0x4'));var db=require(_0xf112('0x5'))['db'];var dbH=require('../../mysqldb')[_0xf112('0x6')];var logger=require('../../config/logger')(_0xf112('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xf112('0x8')][0x2]);var QUERY=process[_0xf112('0x8')][0x3];var PATH=process[_0xf112('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2fcbcb,_0x3f0411){var _0x48aaf0={'status':_0x2fcbcb};var _0x420e3c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f0411){_0x48aaf0['savename']=_0x3f0411;}return db[_0xf112('0x9')][_0xf112('0xa')](_0x48aaf0,_0x420e3c);}function main(){var _0x1301b5=0x1388;var _0x4310a7;logger[_0xf112('0xb')](util[_0xf112('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0xf112('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf112('0xe'),_0xf112('0xf')]})[_0xf112('0x10')](function(_0x350f60){if(_0x350f60){_0x4310a7=_0x350f60;_0x1301b5=_0x4310a7[_0xf112('0xf')]||0x1388;}})[_0xf112('0x10')](function(){return dbH[_0xf112('0x11')][_0xf112('0x12')](util['format'](_0xf112('0x13'),QUERY),{'type':dbH['sequelize'][_0xf112('0x14')]['SELECT']});})[_0xf112('0x10')](function(_0x5111e9){if(!_0x5111e9[0x0][_0xf112('0x15')]){return analyticExtractedReport(_0xf112('0x16'));}var _0x3e5780=[];var _0x3df24b=0x0;if(_0x4310a7[_0xf112('0xe')]){if(_0x5111e9&&_0x5111e9['length']){var _0x443f47=_[_0xf112('0x17')](_0x5111e9[0x0]['num']/_0x1301b5);var _0x16d575=Number[_0xf112('0x18')](_0x5111e9[0x0][_0xf112('0x15')]/_0x1301b5)?_0x5111e9[0x0]['num']%_0x1301b5:0x0;_0x443f47[_0xf112('0x19')](function(_0x456c8b){if(_0x456c8b>0x0){_0x3df24b+=_0x1301b5;}_0x3e5780[_0xf112('0x1a')](dbH[_0xf112('0x11')][_0xf112('0x12')](util[_0xf112('0xc')](_0xf112('0x1b'),QUERY,_0x1301b5,_0x3df24b),{'type':dbH[_0xf112('0x11')][_0xf112('0x14')][_0xf112('0x1c')]}));});if(_0x16d575>0x0){_0x3df24b+=_0x1301b5;_0x3e5780[_0xf112('0x1a')](dbH['sequelize'][_0xf112('0x12')](util['format'](_0xf112('0x1b'),QUERY,_0x16d575,_0x3df24b),{'type':dbH[_0xf112('0x11')][_0xf112('0x14')][_0xf112('0x1c')]}));}}}else{_0x3e5780[_0xf112('0x1a')](dbH[_0xf112('0x11')][_0xf112('0x12')](QUERY,{'type':dbH[_0xf112('0x11')][_0xf112('0x14')][_0xf112('0x1c')]}));}var _0x27a894=path[_0xf112('0x1d')](PATH);var _0x48a5c9=path['basename'](PATH,_0xf112('0x1e'));var _0x938bb0=_0x4310a7['split']&&_0x3e5780[_0xf112('0x1f')]>0x1;var _0x16a491=[];if(!fs['existsSync'](path[_0xf112('0x20')](_0x27a894,_0x48a5c9))&&_0x938bb0){fs['mkdirSync'](path['join'](_0x27a894,_0x48a5c9));}return BPromise[_0xf112('0x21')](_0x3e5780,function(_0x1967df){_0x16a491['push'](_0x1967df);})['then'](function(){for(var _0x167c07=0x0;_0x167c07<_0x16a491[_0xf112('0x1f')];_0x167c07+=0x1){var _0x85dc43;var _0x17f157=_0x16a491[_0x167c07];if(_0x938bb0){_0x85dc43=path[_0xf112('0x20')](_0x27a894,_0x48a5c9,util[_0xf112('0xc')](_0xf112('0x22'),_0x48a5c9,_0x167c07,'xlsx'));}else{_0x85dc43=path['join'](_0x27a894,util[_0xf112('0xc')](_0xf112('0x23'),_0x48a5c9,'xlsx'));}fs[_0xf112('0x24')](_0x85dc43,json2xls(_0x17f157),'binary');}})[_0xf112('0x10')](function(){if(_0x938bb0){return new Promise(function(_0x427e5e){zipdir(path['join'](_0x27a894,_0x48a5c9),{'saveTo':path[_0xf112('0x20')](_0x27a894,util[_0xf112('0xc')](_0xf112('0x23'),_0x48a5c9,'zip'))},function(_0x290c6a,_0x2e5d15){rimraf(path[_0xf112('0x20')](_0x27a894,_0x48a5c9),function(){});_0x427e5e('zip\x20finished');});});}})[_0xf112('0x10')](function(){logger['info'](util[_0xf112('0xc')](_0xf112('0x25'),EXTRACTED_REPORT_ID,_0xf112('0x26')));return analyticExtractedReport('Completed',_0x938bb0?util[_0xf112('0xc')](_0xf112('0x23'),_0x48a5c9,_0x938bb0?'zip':'xlsx'):null);});})[_0xf112('0x27')](function(_0x3c11e2){logger[_0xf112('0xb')](util[_0xf112('0xc')](_0xf112('0x28'),EXTRACTED_REPORT_ID,_0xf112('0x26')),util[_0xf112('0x29')](_0x3c11e2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf112('0x2a'));})[_0xf112('0x2b')](function(){process[_0xf112('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 417cfd1..3b133ef 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 _0x23ad=['$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','then','intervals','VoiceExtension','findAll','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','playback','hasOwnProperty','priority','extension','find','extensions','push','type','Set','format','VoiceExtensionId','inbound','context','outbound','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','map','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1'];(function(_0x3fd7ab,_0x3dd0bc){var _0x56cb4b=function(_0x2cd862){while(--_0x2cd862){_0x3fd7ab['push'](_0x3fd7ab['shift']());}};_0x56cb4b(++_0x3dd0bc);}(_0x23ad,0xe6));var _0xd23a=function(_0x155d90,_0x430aea){_0x155d90=_0x155d90-0x0;var _0x3c8d2b=_0x23ad[_0x155d90];return _0x3c8d2b;};'use strict';var _=require(_0xd23a('0x0'));var util=require(_0xd23a('0x1'));function rewrite(_0x2bf216,_0xdbec55){var _0x3d43e4=this;return _0x2bf216[_0xd23a('0x2')][_0xd23a('0x3')]['findAll']({'raw':!![]})[_0xd23a('0x4')](function(_0x56a348){_0x3d43e4[_0xd23a('0x5')]=_0x56a348;return _0x2bf216['models'][_0xd23a('0x6')][_0xd23a('0x7')]({'where':{'IntervalId':_0xdbec55[_0xd23a('0x8')]},'raw':!![]});})[_0xd23a('0x4')](function(_0x5ae9ba){return _0x2bf216[_0xd23a('0x2')][_0xd23a('0x6')][_0xd23a('0x7')]({'where':{'exten':{'$in':_[_0xd23a('0x9')](_['map'](_0x5ae9ba,_0xd23a('0xa')))}},'order':[{'raw':_0xd23a('0xb')}],'raw':!![]});})[_0xd23a('0x4')](function(_0x50f900){var _0x4548d8=_['filter'](_0x50f900,{'priority':'1'});var _0x5cb456=_[_0xd23a('0xc')](_0x50f900,{'isApp':0x1});var _0x21b546=_['groupBy'](_0x5cb456,_0xd23a('0xa'));var _0x1d7ceb=['queue',_0xd23a('0xd')];var _0x3cea9e=[];var _0x22c67e=[];for(var _0x4e4d74 in _0x21b546){if(_0x21b546[_0xd23a('0xe')](_0x4e4d74)){_0x3d43e4[_0xd23a('0xf')]=0x2;_0x3d43e4['extensions']=[];_0x3d43e4[_0xd23a('0x10')]=_[_0xd23a('0x11')](_0x4548d8,{'exten':_0x21b546[_0x4e4d74][0x0][_0xd23a('0xa')]});_0x3d43e4[_0xd23a('0x12')][_0xd23a('0x13')]({'type':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')],'app':_0xd23a('0x15'),'appdata':util[_0xd23a('0x16')]('CDR(type)=%s',_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')]),'context':_0x21b546[_0x4e4d74][0x0]['context'],'exten':_0x21b546[_0x4e4d74][0x0][_0xd23a('0xa')],'priority':_0x3d43e4['priority']++,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')]});if(_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')]===_0xd23a('0x18')){_0x3d43e4[_0xd23a('0x12')][_0xd23a('0x13')]({'type':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')],'app':_0xd23a('0x15'),'appdata':'CDR(routeid)='+_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')],'context':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x19')],'exten':_0x21b546[_0x4e4d74][0x0][_0xd23a('0xa')],'priority':_0x3d43e4[_0xd23a('0xf')]++,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')]});}else if(_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')]===_0xd23a('0x1a')){if(_0x3d43e4['extension']){_0x3d43e4[_0xd23a('0x12')][_0xd23a('0x13')]({'type':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')],'app':_0xd23a('0x15'),'appdata':'CDR(destination)='+(_0x3d43e4[_0xd23a('0x10')][_0xd23a('0x1b')]?_0xd23a('0x1c')+_0x3d43e4[_0xd23a('0x10')][_0xd23a('0x1b')]+'}':_0xd23a('0x1d')),'context':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x19')],'exten':_0x21b546[_0x4e4d74][0x0]['exten'],'priority':_0x3d43e4[_0xd23a('0xf')]++,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')]});}_0x3d43e4['extensions']['push']({'type':_0x21b546[_0x4e4d74][0x0]['type'],'app':_0xd23a('0x15'),'appdata':_0xd23a('0x1e')+_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')],'context':_0x21b546[_0x4e4d74][0x0]['context'],'exten':_0x21b546[_0x4e4d74][0x0][_0xd23a('0xa')],'priority':_0x3d43e4['priority']++,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')]});var _0x52a132=_0x3d43e4[_0xd23a('0xf')]++;_0x3d43e4[_0xd23a('0x12')][_0xd23a('0x13')]({'type':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')],'app':_0xd23a('0x1f'),'appdata':_0xd23a('0x20')+(_0x52a132+0x2)+_0xd23a('0x21')+(_0x52a132+0x1)+')','context':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x19')],'exten':_0x21b546[_0x4e4d74][0x0][_0xd23a('0xa')],'priority':_0x52a132,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')]});if(_0x3d43e4['extension']){_0x3d43e4[_0xd23a('0x12')][_0xd23a('0x13')]({'type':_0x21b546[_0x4e4d74][0x0]['type'],'app':_0xd23a('0x15'),'appdata':_0x3d43e4[_0xd23a('0x10')][_0xd23a('0x1b')]?_0xd23a('0x22')+_0x3d43e4['extension'][_0xd23a('0x1b')]+'}':_0xd23a('0x23'),'context':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x19')],'exten':_0x21b546[_0x4e4d74][0x0][_0xd23a('0xa')],'priority':_0x3d43e4[_0xd23a('0xf')]++,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0]['VoiceExtensionId']});}_0x3d43e4[_0xd23a('0x12')][_0xd23a('0x13')]({'type':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')],'app':_0xd23a('0x15'),'appdata':_0xd23a('0x24')+_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')],'context':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x19')],'exten':_0x21b546[_0x4e4d74][0x0][_0xd23a('0xa')],'priority':_0x3d43e4[_0xd23a('0xf')]++,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0]['VoiceExtensionId']});if(_0x3d43e4[_0xd23a('0x10')]&&_0x3d43e4['extension'][_0xd23a('0xe')](_0xd23a('0x25'))&&_0x3d43e4[_0xd23a('0x10')][_0xd23a('0x25')]!=='none'){_0x3d43e4['extensions'][_0xd23a('0x13')]({'type':_0x21b546[_0x4e4d74][0x0]['type'],'app':_0xd23a('0x15'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x21b546[_0x4e4d74][0x0]['context'],'exten':_0x21b546[_0x4e4d74][0x0]['exten'],'priority':_0x3d43e4['priority']++,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')]});_0x3d43e4[_0xd23a('0x12')][_0xd23a('0x13')]({'type':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')],'app':_0xd23a('0x15'),'appdata':_0xd23a('0x26')+_0x3d43e4['extension'][_0xd23a('0x25')]||_0xd23a('0x27'),'context':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x19')],'exten':_0x21b546[_0x4e4d74][0x0][_0xd23a('0xa')],'priority':_0x3d43e4[_0xd23a('0xf')]++,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')]});}}_0x3d43e4[_0xd23a('0x12')][_0xd23a('0x13')]({'type':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')],'app':_0xd23a('0x15'),'appdata':_0xd23a('0x28'),'context':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x19')],'exten':_0x21b546[_0x4e4d74][0x0][_0xd23a('0xa')],'priority':_0x3d43e4['priority']++,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')]});_0x3d43e4[_0xd23a('0x12')][_0xd23a('0x13')]({'type':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')],'app':_0xd23a('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x19')],'exten':_0x21b546[_0x4e4d74][0x0]['exten'],'priority':_0x3d43e4[_0xd23a('0xf')]++,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')]});_0x3d43e4[_0xd23a('0x12')][_0xd23a('0x13')]({'type':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')],'app':_0xd23a('0x15'),'appdata':_0xd23a('0x29'),'context':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x19')],'exten':_0x21b546[_0x4e4d74][0x0][_0xd23a('0xa')],'priority':_0x3d43e4[_0xd23a('0xf')]++,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')]});for(var _0x17f9ba=0x0,_0x63dd89=0x0;_0x17f9ba<_0x21b546[_0x4e4d74][_0xd23a('0x2a')];_0x17f9ba+=0x1,_0x63dd89=0x0){var _0x5c37c8=_0x21b546[_0x4e4d74][_0x17f9ba];if(_0x5c37c8[_0xd23a('0x14')]){_0x5c37c8[_0xd23a('0x14')]=_0x5c37c8[_0xd23a('0x14')][_0xd23a('0x2b')]();}var _0x31d720=[];var _0x1278df=[];delete _0x5c37c8['id'];delete _0x5c37c8['createdAt'];delete _0x5c37c8[_0xd23a('0x2c')];var _0x461c27=_0x5c37c8[_0xd23a('0x2d')]!==_0xd23a('0x2e')?[_0x5c37c8[_0xd23a('0x2d')]]:_0x5c37c8['IntervalId']?_[_0xd23a('0x2f')](_[_0xd23a('0xc')](_0x3d43e4[_0xd23a('0x5')],{'IntervalId':_0x5c37c8[_0xd23a('0x8')]}),'interval'):[];if(_0x5c37c8[_0xd23a('0xe')](_0xd23a('0x30'))){if(_0x5c37c8[_0xd23a('0x30')]&&_0x5c37c8[_0xd23a('0x30')]!=='--'){_0x31d720[_0xd23a('0x13')]({'type':_0x5c37c8[_0xd23a('0x14')],'app':_0xd23a('0x15'),'appdata':_0xd23a('0x31')+_0x5c37c8[_0xd23a('0x30')],'context':_0x5c37c8[_0xd23a('0x19')],'exten':_0x5c37c8['exten'],'priority':_0x461c27[_0xd23a('0x2a')]+_0x3d43e4[_0xd23a('0xf')]+_0x63dd89++,'VoiceExtensionId':_0x5c37c8[_0xd23a('0x17')]});}}if(_0x5c37c8[_0xd23a('0x14')]===_0xd23a('0x1a')&&_0x5c37c8[_0xd23a('0xe')]('callerID')){if(_0x5c37c8[_0xd23a('0x32')]){_0x31d720[_0xd23a('0x13')]({'type':_0x5c37c8[_0xd23a('0x14')],'app':_0xd23a('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x5c37c8['callerID']+')','context':_0x5c37c8['context'],'exten':_0x5c37c8[_0xd23a('0xa')],'priority':_0x461c27[_0xd23a('0x2a')]+_0x3d43e4[_0xd23a('0xf')]+_0x63dd89++,'VoiceExtensionId':_0x5c37c8[_0xd23a('0x17')]});}else{_0x31d720[_0xd23a('0x13')]({'type':_0x5c37c8[_0xd23a('0x14')],'app':_0xd23a('0x1f'),'appdata':_0xd23a('0x33'),'context':_0x5c37c8['context'],'exten':_0x5c37c8[_0xd23a('0xa')],'priority':_0x461c27['length']+_0x3d43e4[_0xd23a('0xf')]+_0x63dd89++,'VoiceExtensionId':_0x5c37c8[_0xd23a('0x17')]});}}if(_0x5c37c8['hasOwnProperty'](_0xd23a('0x34'))){if(_0x1d7ceb[_0xd23a('0x35')](_0x5c37c8[_0xd23a('0x36')]['toLowerCase']())>=0x0&&_0x5c37c8['appType']!==_0xd23a('0x37')){if(_0x5c37c8[_0xd23a('0x34')]){_0x31d720[_0xd23a('0x13')]({'type':_0x5c37c8[_0xd23a('0x14')],'app':_0xd23a('0x1f'),'appdata':_0xd23a('0x38'),'context':_0x5c37c8[_0xd23a('0x19')],'exten':_0x5c37c8['exten'],'priority':_0x461c27[_0xd23a('0x2a')]+_0x3d43e4[_0xd23a('0xf')]+_0x63dd89++,'VoiceExtensionId':_0x5c37c8[_0xd23a('0x17')]});_0x31d720[_0xd23a('0x13')]({'type':_0x5c37c8['type'],'app':'Set','appdata':_0xd23a('0x39'),'context':_0x5c37c8['context'],'exten':_0x5c37c8[_0xd23a('0xa')],'priority':_0x461c27['length']+_0x3d43e4[_0xd23a('0xf')]+_0x63dd89++,'VoiceExtensionId':_0x5c37c8[_0xd23a('0x17')]});}else{_0x31d720[_0xd23a('0x13')]({'type':_0x5c37c8[_0xd23a('0x14')],'app':_0xd23a('0x1f'),'appdata':_0xd23a('0x3a'),'context':_0x5c37c8[_0xd23a('0x19')],'exten':_0x5c37c8[_0xd23a('0xa')],'priority':_0x461c27[_0xd23a('0x2a')]+_0x3d43e4[_0xd23a('0xf')]+_0x63dd89++,'VoiceExtensionId':_0x5c37c8[_0xd23a('0x17')]});_0x31d720[_0xd23a('0x13')]({'type':_0x5c37c8['type'],'app':_0xd23a('0x15'),'appdata':_0xd23a('0x3b'),'context':_0x5c37c8[_0xd23a('0x19')],'exten':_0x5c37c8[_0xd23a('0xa')],'priority':_0x461c27[_0xd23a('0x2a')]+_0x3d43e4[_0xd23a('0xf')]+_0x63dd89++,'VoiceExtensionId':_0x5c37c8[_0xd23a('0x17')]});}}}for(var _0xf82b73=0x0;_0xf82b73<_0x461c27[_0xd23a('0x2a')];_0xf82b73+=0x1){var _0x50ab5c=_0x3d43e4['priority']+_0x461c27['length'];var _0x54ae44=_0xf82b73===_0x461c27[_0xd23a('0x2a')]-0x1?_0x3d43e4[_0xd23a('0xf')]+_0x31d720[_0xd23a('0x2a')]+_0x1278df[_0xd23a('0x2a')]+0x2:_0x3d43e4[_0xd23a('0xf')]+_0xf82b73+0x1;_0x31d720[_0xd23a('0x3c')](_0xf82b73,0x0,{'type':_0x5c37c8[_0xd23a('0x14')],'app':'GotoIfTime','appdata':_0x461c27[_0xf82b73]+'?'+_0x5c37c8[_0xd23a('0x19')]+_0xd23a('0x3d')+_0x50ab5c+':'+_0x5c37c8[_0xd23a('0x19')]+_0xd23a('0x3d')+_0x54ae44,'exten':_0x5c37c8[_0xd23a('0xa')],'context':_0x5c37c8[_0xd23a('0x19')],'priority':_0x3d43e4['priority']+_0xf82b73,'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')]});}_0x5c37c8[_0xd23a('0xf')]=_0x31d720[_0xd23a('0x2a')]?_[_0xd23a('0x3e')](_0x31d720)['priority']+0x1:_0x3d43e4['priority'];_0x3d43e4[_0xd23a('0xf')]=(_0x1278df[_0xd23a('0x2a')]?_[_0xd23a('0x3e')](_0x1278df)[_0xd23a('0xf')]:_0x5c37c8[_0xd23a('0xf')])+0x1;_0x3d43e4['extensions']=_[_0xd23a('0x3f')](_0x3d43e4['extensions'],_0x31d720,[_0x5c37c8],_0x1278df);}_0x3d43e4[_0xd23a('0x12')][_0xd23a('0x13')]({'type':_0x21b546[_0x4e4d74][0x0][_0xd23a('0x14')],'app':_0xd23a('0x40'),'exten':_0x21b546[_0x4e4d74][0x0][_0xd23a('0xa')],'context':_0x21b546[_0x4e4d74][0x0]['context'],'priority':_0x3d43e4[_0xd23a('0xf')],'VoiceExtensionId':_0x21b546[_0x4e4d74][0x0]['VoiceExtensionId']});_0x3cea9e[_0xd23a('0x13')](_0x21b546[_0x4e4d74][0x0][_0xd23a('0x17')]);_0x22c67e=_[_0xd23a('0x3f')](_0x22c67e,_0x3d43e4[_0xd23a('0x12')]);}}return _0x2bf216[_0xd23a('0x41')](function(_0x459370){return _0x2bf216[_0xd23a('0x2')][_0xd23a('0x6')][_0xd23a('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x3cea9e}},'transaction':_0x459370})[_0xd23a('0x4')](function(_0x9541de){return _0x2bf216['models']['VoiceExtension'][_0xd23a('0x43')](_[_0xd23a('0x44')](_0x22c67e,_0xd23a('0xf')),{'transaction':_0x459370});});});})[_0xd23a('0x45')](function(_0x2de684){console[_0xd23a('0x46')](_0x2de684);});}exports[_0xd23a('0x47')]=rewrite; \ No newline at end of file +var _0xb598=['type','CDR(type)=%s','context','VoiceExtensionId','Set','extension','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','toLowerCase','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','sortBy','error','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty','priority','extensions','find','push'];(function(_0x16c49a,_0x1f0aa1){var _0x1be004=function(_0x26a1ca){while(--_0x26a1ca){_0x16c49a['push'](_0x16c49a['shift']());}};_0x1be004(++_0x1f0aa1);}(_0xb598,0x178));var _0x8b59=function(_0x25b41a,_0x34ea6a){_0x25b41a=_0x25b41a-0x0;var _0x58a856=_0xb598[_0x25b41a];return _0x58a856;};'use strict';var _=require(_0x8b59('0x0'));var util=require(_0x8b59('0x1'));function rewrite(_0x583cd2,_0x3e388e){var _0x4cea61=this;return _0x583cd2[_0x8b59('0x2')][_0x8b59('0x3')][_0x8b59('0x4')]({'raw':!![]})[_0x8b59('0x5')](function(_0x218718){_0x4cea61[_0x8b59('0x6')]=_0x218718;return _0x583cd2[_0x8b59('0x2')][_0x8b59('0x7')]['findAll']({'where':{'IntervalId':_0x3e388e[_0x8b59('0x8')]},'raw':!![]});})[_0x8b59('0x5')](function(_0x3c640b){return _0x583cd2[_0x8b59('0x2')][_0x8b59('0x7')][_0x8b59('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x8b59('0x9')](_0x3c640b,_0x8b59('0xa')))}},'order':[{'raw':_0x8b59('0xb')}],'raw':!![]});})[_0x8b59('0x5')](function(_0x42616a){var _0x10d676=_[_0x8b59('0xc')](_0x42616a,{'priority':'1'});var _0x430e1f=_[_0x8b59('0xc')](_0x42616a,{'isApp':0x1});var _0x3211ff=_[_0x8b59('0xd')](_0x430e1f,'exten');var _0xaec4fa=[_0x8b59('0xe'),'playback'];var _0x5590a4=[];var _0x2db259=[];for(var _0x2547a2 in _0x3211ff){if(_0x3211ff[_0x8b59('0xf')](_0x2547a2)){_0x4cea61[_0x8b59('0x10')]=0x2;_0x4cea61[_0x8b59('0x11')]=[];_0x4cea61['extension']=_[_0x8b59('0x12')](_0x10d676,{'exten':_0x3211ff[_0x2547a2][0x0][_0x8b59('0xa')]});_0x4cea61[_0x8b59('0x11')][_0x8b59('0x13')]({'type':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')],'app':'Set','appdata':util['format'](_0x8b59('0x15'),_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')]),'context':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x16')],'exten':_0x3211ff[_0x2547a2][0x0][_0x8b59('0xa')],'priority':_0x4cea61[_0x8b59('0x10')]++,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')]});if(_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')]==='inbound'){_0x4cea61['extensions'][_0x8b59('0x13')]({'type':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')],'app':_0x8b59('0x18'),'appdata':'CDR(routeid)='+_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')],'context':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x16')],'exten':_0x3211ff[_0x2547a2][0x0]['exten'],'priority':_0x4cea61[_0x8b59('0x10')]++,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')]});}else if(_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')]==='outbound'){if(_0x4cea61[_0x8b59('0x19')]){_0x4cea61['extensions'][_0x8b59('0x13')]({'type':_0x3211ff[_0x2547a2][0x0]['type'],'app':_0x8b59('0x18'),'appdata':_0x8b59('0x1a')+(_0x4cea61[_0x8b59('0x19')]['cutdigits']?_0x8b59('0x1b')+_0x4cea61[_0x8b59('0x19')][_0x8b59('0x1c')]+'}':_0x8b59('0x1d')),'context':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x16')],'exten':_0x3211ff[_0x2547a2][0x0][_0x8b59('0xa')],'priority':_0x4cea61[_0x8b59('0x10')]++,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')]});}_0x4cea61['extensions'][_0x8b59('0x13')]({'type':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')],'app':_0x8b59('0x18'),'appdata':'CDR(routeid)='+_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')],'context':_0x3211ff[_0x2547a2][0x0]['context'],'exten':_0x3211ff[_0x2547a2][0x0]['exten'],'priority':_0x4cea61[_0x8b59('0x10')]++,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0]['VoiceExtensionId']});var _0x54eefe=_0x4cea61['priority']++;_0x4cea61[_0x8b59('0x11')][_0x8b59('0x13')]({'type':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')],'app':_0x8b59('0x1e'),'appdata':_0x8b59('0x1f')+(_0x54eefe+0x2)+_0x8b59('0x20')+(_0x54eefe+0x1)+')','context':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x16')],'exten':_0x3211ff[_0x2547a2][0x0][_0x8b59('0xa')],'priority':_0x54eefe,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')]});if(_0x4cea61[_0x8b59('0x19')]){_0x4cea61[_0x8b59('0x11')][_0x8b59('0x13')]({'type':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')],'app':_0x8b59('0x18'),'appdata':_0x4cea61[_0x8b59('0x19')][_0x8b59('0x1c')]?_0x8b59('0x21')+_0x4cea61['extension']['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x3211ff[_0x2547a2][0x0]['context'],'exten':_0x3211ff[_0x2547a2][0x0][_0x8b59('0xa')],'priority':_0x4cea61[_0x8b59('0x10')]++,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')]});}_0x4cea61['extensions'][_0x8b59('0x13')]({'type':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')],'app':_0x8b59('0x18'),'appdata':'outboundrouteid='+_0x3211ff[_0x2547a2][0x0]['VoiceExtensionId'],'context':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x16')],'exten':_0x3211ff[_0x2547a2][0x0][_0x8b59('0xa')],'priority':_0x4cea61[_0x8b59('0x10')]++,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0]['VoiceExtensionId']});if(_0x4cea61[_0x8b59('0x19')]&&_0x4cea61[_0x8b59('0x19')][_0x8b59('0xf')]('recordingFormat')&&_0x4cea61[_0x8b59('0x19')][_0x8b59('0x22')]!==_0x8b59('0x23')){_0x4cea61['extensions'][_0x8b59('0x13')]({'type':_0x3211ff[_0x2547a2][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x16')],'exten':_0x3211ff[_0x2547a2][0x0][_0x8b59('0xa')],'priority':_0x4cea61['priority']++,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')]});_0x4cea61[_0x8b59('0x11')][_0x8b59('0x13')]({'type':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')],'app':_0x8b59('0x18'),'appdata':_0x8b59('0x24')+_0x4cea61[_0x8b59('0x19')][_0x8b59('0x22')]||_0x8b59('0x25'),'context':_0x3211ff[_0x2547a2][0x0]['context'],'exten':_0x3211ff[_0x2547a2][0x0][_0x8b59('0xa')],'priority':_0x4cea61[_0x8b59('0x10')]++,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')]});}}_0x4cea61[_0x8b59('0x11')]['push']({'type':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')],'app':'Set','appdata':_0x8b59('0x26'),'context':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x16')],'exten':_0x3211ff[_0x2547a2][0x0][_0x8b59('0xa')],'priority':_0x4cea61['priority']++,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')]});_0x4cea61[_0x8b59('0x11')][_0x8b59('0x13')]({'type':_0x3211ff[_0x2547a2][0x0]['type'],'app':_0x8b59('0x18'),'appdata':_0x8b59('0x27'),'context':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x16')],'exten':_0x3211ff[_0x2547a2][0x0]['exten'],'priority':_0x4cea61[_0x8b59('0x10')]++,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')]});_0x4cea61[_0x8b59('0x11')][_0x8b59('0x13')]({'type':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')],'app':_0x8b59('0x18'),'appdata':_0x8b59('0x28'),'context':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x16')],'exten':_0x3211ff[_0x2547a2][0x0][_0x8b59('0xa')],'priority':_0x4cea61['priority']++,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')]});for(var _0x67a9b6=0x0,_0x80ddf9=0x0;_0x67a9b6<_0x3211ff[_0x2547a2][_0x8b59('0x29')];_0x67a9b6+=0x1,_0x80ddf9=0x0){var _0x32043e=_0x3211ff[_0x2547a2][_0x67a9b6];if(_0x32043e[_0x8b59('0x14')]){_0x32043e[_0x8b59('0x14')]=_0x32043e[_0x8b59('0x14')]['toLowerCase']();}var _0x39bf97=[];var _0x4e6fec=[];delete _0x32043e['id'];delete _0x32043e[_0x8b59('0x2a')];delete _0x32043e[_0x8b59('0x2b')];var _0x435441=_0x32043e[_0x8b59('0x2c')]!==_0x8b59('0x2d')?[_0x32043e[_0x8b59('0x2c')]]:_0x32043e[_0x8b59('0x8')]?_['map'](_[_0x8b59('0xc')](_0x4cea61[_0x8b59('0x6')],{'IntervalId':_0x32043e[_0x8b59('0x8')]}),_0x8b59('0x2c')):[];if(_0x32043e[_0x8b59('0xf')](_0x8b59('0x2e'))){if(_0x32043e[_0x8b59('0x2e')]&&_0x32043e[_0x8b59('0x2e')]!=='--'){_0x39bf97['push']({'type':_0x32043e[_0x8b59('0x14')],'app':_0x8b59('0x18'),'appdata':_0x8b59('0x2f')+_0x32043e[_0x8b59('0x2e')],'context':_0x32043e[_0x8b59('0x16')],'exten':_0x32043e[_0x8b59('0xa')],'priority':_0x435441[_0x8b59('0x29')]+_0x4cea61[_0x8b59('0x10')]+_0x80ddf9++,'VoiceExtensionId':_0x32043e['VoiceExtensionId']});}}if(_0x32043e['type']===_0x8b59('0x30')&&_0x32043e['hasOwnProperty']('callerID')){if(_0x32043e[_0x8b59('0x31')]){_0x39bf97[_0x8b59('0x13')]({'type':_0x32043e[_0x8b59('0x14')],'app':_0x8b59('0x1e'),'appdata':_0x8b59('0x32')+_0x32043e[_0x8b59('0x31')]+')','context':_0x32043e[_0x8b59('0x16')],'exten':_0x32043e[_0x8b59('0xa')],'priority':_0x435441['length']+_0x4cea61['priority']+_0x80ddf9++,'VoiceExtensionId':_0x32043e[_0x8b59('0x17')]});}else{_0x39bf97[_0x8b59('0x13')]({'type':_0x32043e['type'],'app':_0x8b59('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x32043e[_0x8b59('0x16')],'exten':_0x32043e[_0x8b59('0xa')],'priority':_0x435441[_0x8b59('0x29')]+_0x4cea61[_0x8b59('0x10')]+_0x80ddf9++,'VoiceExtensionId':_0x32043e[_0x8b59('0x17')]});}}if(_0x32043e[_0x8b59('0xf')]('answer')){if(_0xaec4fa['indexOf'](_0x32043e['app'][_0x8b59('0x33')]())>=0x0&&_0x32043e[_0x8b59('0x34')]!=='custom'){if(_0x32043e[_0x8b59('0x35')]){_0x39bf97[_0x8b59('0x13')]({'type':_0x32043e[_0x8b59('0x14')],'app':_0x8b59('0x1e'),'appdata':_0x8b59('0x36'),'context':_0x32043e[_0x8b59('0x16')],'exten':_0x32043e[_0x8b59('0xa')],'priority':_0x435441[_0x8b59('0x29')]+_0x4cea61[_0x8b59('0x10')]+_0x80ddf9++,'VoiceExtensionId':_0x32043e[_0x8b59('0x17')]});_0x39bf97[_0x8b59('0x13')]({'type':_0x32043e['type'],'app':'Set','appdata':_0x8b59('0x37'),'context':_0x32043e[_0x8b59('0x16')],'exten':_0x32043e[_0x8b59('0xa')],'priority':_0x435441[_0x8b59('0x29')]+_0x4cea61[_0x8b59('0x10')]+_0x80ddf9++,'VoiceExtensionId':_0x32043e[_0x8b59('0x17')]});}else{_0x39bf97['push']({'type':_0x32043e[_0x8b59('0x14')],'app':'ExecIf','appdata':_0x8b59('0x38'),'context':_0x32043e['context'],'exten':_0x32043e[_0x8b59('0xa')],'priority':_0x435441[_0x8b59('0x29')]+_0x4cea61[_0x8b59('0x10')]+_0x80ddf9++,'VoiceExtensionId':_0x32043e[_0x8b59('0x17')]});_0x39bf97[_0x8b59('0x13')]({'type':_0x32043e[_0x8b59('0x14')],'app':_0x8b59('0x18'),'appdata':_0x8b59('0x39'),'context':_0x32043e[_0x8b59('0x16')],'exten':_0x32043e[_0x8b59('0xa')],'priority':_0x435441[_0x8b59('0x29')]+_0x4cea61['priority']+_0x80ddf9++,'VoiceExtensionId':_0x32043e[_0x8b59('0x17')]});}}}for(var _0x4af834=0x0;_0x4af834<_0x435441['length'];_0x4af834+=0x1){var _0x551f57=_0x4cea61[_0x8b59('0x10')]+_0x435441[_0x8b59('0x29')];var _0x9120c5=_0x4af834===_0x435441[_0x8b59('0x29')]-0x1?_0x4cea61['priority']+_0x39bf97[_0x8b59('0x29')]+_0x4e6fec[_0x8b59('0x29')]+0x2:_0x4cea61[_0x8b59('0x10')]+_0x4af834+0x1;_0x39bf97[_0x8b59('0x3a')](_0x4af834,0x0,{'type':_0x32043e[_0x8b59('0x14')],'app':'GotoIfTime','appdata':_0x435441[_0x4af834]+'?'+_0x32043e[_0x8b59('0x16')]+_0x8b59('0x3b')+_0x551f57+':'+_0x32043e[_0x8b59('0x16')]+_0x8b59('0x3b')+_0x9120c5,'exten':_0x32043e['exten'],'context':_0x32043e[_0x8b59('0x16')],'priority':_0x4cea61['priority']+_0x4af834,'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0]['VoiceExtensionId']});}_0x32043e['priority']=_0x39bf97[_0x8b59('0x29')]?_['last'](_0x39bf97)['priority']+0x1:_0x4cea61[_0x8b59('0x10')];_0x4cea61[_0x8b59('0x10')]=(_0x4e6fec[_0x8b59('0x29')]?_[_0x8b59('0x3c')](_0x4e6fec)[_0x8b59('0x10')]:_0x32043e[_0x8b59('0x10')])+0x1;_0x4cea61[_0x8b59('0x11')]=_[_0x8b59('0x3d')](_0x4cea61['extensions'],_0x39bf97,[_0x32043e],_0x4e6fec);}_0x4cea61[_0x8b59('0x11')][_0x8b59('0x13')]({'type':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x14')],'app':_0x8b59('0x3e'),'exten':_0x3211ff[_0x2547a2][0x0][_0x8b59('0xa')],'context':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x16')],'priority':_0x4cea61['priority'],'VoiceExtensionId':_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')]});_0x5590a4[_0x8b59('0x13')](_0x3211ff[_0x2547a2][0x0][_0x8b59('0x17')]);_0x2db259=_['concat'](_0x2db259,_0x4cea61[_0x8b59('0x11')]);}}return _0x583cd2[_0x8b59('0x3f')](function(_0xa8e2b8){return _0x583cd2[_0x8b59('0x2')][_0x8b59('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x5590a4}},'transaction':_0xa8e2b8})['then'](function(_0x5ebb98){return _0x583cd2[_0x8b59('0x2')][_0x8b59('0x7')]['bulkCreate'](_[_0x8b59('0x40')](_0x2db259,_0x8b59('0x10')),{'transaction':_0xa8e2b8});});});})['catch'](function(_0x6aaece){console[_0x8b59('0x41')](_0x6aaece);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index ed7ac19..64d29f4 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 _0x9c3f=['deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','fromQuery','cm_contacts','ListId\x20=\x20?','str','calleridnum','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','get','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','stringify','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','find','duplicate','Duplicate\x20Contact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','phone','ListId','createdAt','updatedAt','select','field','NOW()','scheduledAt','ContactId','toString','from','where'];(function(_0x250b4a,_0x202028){var _0x23612f=function(_0x123a55){while(--_0x123a55){_0x250b4a['push'](_0x250b4a['shift']());}};_0x23612f(++_0x202028);}(_0x9c3f,0x111));var _0xf9c3=function(_0x206cc2,_0x2612f3){_0x206cc2=_0x206cc2-0x0;var _0x2f5fc9=_0x9c3f[_0x206cc2];return _0x2f5fc9;};'use strict';var BPromise=require(_0xf9c3('0x0'));var util=require(_0xf9c3('0x1'));var _=require(_0xf9c3('0x2'));var fs=require('fs');var squel=require(_0xf9c3('0x3'));var Papa=require(_0xf9c3('0x4'));var Redis=require(_0xf9c3('0x5'));var db=require(_0xf9c3('0x6'))['db'];var config=require(_0xf9c3('0x7'));var logger=require('../../../config/logger')(_0xf9c3('0x8'));config[_0xf9c3('0x9')]=_[_0xf9c3('0xa')](config['redis'],{'host':_0xf9c3('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf9c3('0x9')]));require(_0xf9c3('0xc'))[_0xf9c3('0xd')](socket);try{if(!process[_0xf9c3('0xe')][0x2]||process['argv'][0x2]===_0xf9c3('0xf')||process[_0xf9c3('0xe')][0x2]===_0xf9c3('0x10')){throw new Error(_0xf9c3('0x11'));}var FILEPATH=process[_0xf9c3('0xe')][0x2];if(!process[_0xf9c3('0xe')][0x3]||process[_0xf9c3('0xe')][0x3]===_0xf9c3('0xf')||process['argv'][0x3]===_0xf9c3('0x10')||!process['argv'][0x4]||process[_0xf9c3('0xe')][0x4]===_0xf9c3('0xf')||process[_0xf9c3('0xe')][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xf9c3('0x12')](process['argv'][0x3][_0xf9c3('0x13')](','),process[_0xf9c3('0xe')][0x4][_0xf9c3('0x13')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0xf9c3('0xf')||process[_0xf9c3('0xe')][0x5]==='null'){throw new Error(_0xf9c3('0x14'));}var LISTID=process[_0xf9c3('0xe')][0x5];var COMPANYID=process[_0xf9c3('0xe')][0x6]&&process['argv'][0x6]!==_0xf9c3('0xf')&&process[_0xf9c3('0xe')][0x6]!==_0xf9c3('0x10')?process['argv'][0x6]:null;var DUPLICATES=process[_0xf9c3('0xe')][0x7]&&process[_0xf9c3('0xe')][0x7]!=='undefined'&&process['argv'][0x7]!==_0xf9c3('0x10')?process[_0xf9c3('0xe')][0x7]:null;if(!process['argv'][0x8]||process[_0xf9c3('0xe')][0x8]==='undefined'||process[_0xf9c3('0xe')][0x8]===_0xf9c3('0x10')){throw new Error(_0xf9c3('0x15'));}var SOCKET_TIMESTAMP=process[_0xf9c3('0xe')][0x8];}catch(_0x131e3b){logger[_0xf9c3('0x16')](_0x131e3b);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(_0x1d8e04,_0x264d61,_0x3753cd,_0x57d50f){var _0x402287={'message':_0x264d61};_0x402287[_0x1d8e04]=!![];if(_0x3753cd){_0x402287[_0xf9c3('0x17')]=_0x3753cd;}if(_0x57d50f){_0x402287['index']=_0x57d50f;}return _0x402287;}function isEmail(_0x22d145){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))*$/[_0xf9c3('0x18')](_0x22d145);}function checkRow(_0x36c19c,_0x3aac56,_0x12b624){return new BPromise(function(_0x2fa84f,_0x523e1b){if(_['isNil'](_0x36c19c)){return _0x523e1b(handleCheckRowError(_0xf9c3('0x16'),_0xf9c3('0x19'),null,_0x12b624));}if(_0x36c19c[_0xf9c3('0x1a')]&&_0x36c19c[_0xf9c3('0x1a')][_0xf9c3('0x1b')]){var _0x200196=_['map'](_0x36c19c[_0xf9c3('0x1a')],_0xf9c3('0x1c'))[_0xf9c3('0x1d')](';');return _0x523e1b(handleCheckRowError(_0xf9c3('0x16'),_0x200196,null,_0x12b624));}var _0x1eeec5={};for(var _0x131e0e in FIELDS){if(FIELDS[_0xf9c3('0x1e')](_0x131e0e)&&FIELDS[_0x131e0e]){_0x1eeec5[_0x131e0e]=_0x36c19c[_0xf9c3('0x1f')][0x0][FIELDS[_0x131e0e]]||_0x36c19c[_0xf9c3('0x1f')][0x0]['\ufeff'+FIELDS[_0x131e0e]];}}if(!_0x1eeec5[_0xf9c3('0x20')]){return _0x523e1b(handleCheckRowError(_0xf9c3('0x16'),_0xf9c3('0x21'),null,_0x12b624));}if(!_0x1eeec5['phone']){return _0x523e1b(handleCheckRowError(_0xf9c3('0x16'),'phone\x20not\x20specified!',null,_0x12b624));}if(_0x1eeec5[_0xf9c3('0x22')]){var _0x4fe565=moment(_0x1eeec5[_0xf9c3('0x22')],_0xf9c3('0x23'));if(!_0x4fe565[_0xf9c3('0x24')]()){return _0x523e1b(handleCheckRowError(_0xf9c3('0x16'),_0xf9c3('0x25'),null,_0x12b624));}}if(_0x1eeec5[_0xf9c3('0x26')]){if(!isEmail(_0x1eeec5[_0xf9c3('0x26')])){return _0x523e1b(handleCheckRowError('error',_0xf9c3('0x27'),null,_0x12b624));}}_0x1eeec5['ListId']=LISTID;_0x1eeec5['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x3aac56){var _0x326bf2={};for(var _0x447d36=0x0,_0x3dac04=DUPLICATES[_0xf9c3('0x1b')];_0x447d36<_0x3dac04;_0x447d36+=0x1){_0x326bf2[DUPLICATES[_0x447d36]]=_0x1eeec5[DUPLICATES[_0x447d36]];}var _0x10944c=_[_0xf9c3('0x28')](_0x3aac56,_0x326bf2);if(_0x10944c){return _0x523e1b(handleCheckRowError(_0xf9c3('0x29'),_0xf9c3('0x2a'),_0x10944c,_0x12b624));}}return db['CmContact']['create'](_0x1eeec5,{'raw':!![],'hooks':![],'fields':_[_0xf9c3('0x2b')](_0x1eeec5)})[_0xf9c3('0x2c')](function(_0x59118f){if(DUPLICATES&&DUPLICATES[_0xf9c3('0x1b')]&&_0x3aac56){_0x3aac56[_0xf9c3('0x2d')](_[_0xf9c3('0x2e')](_0x1eeec5,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x59118f['id'];return _0x2fa84f();})[_0xf9c3('0x2f')](function(_0x4d35f6){return _0x523e1b(handleCheckRowError(_0xf9c3('0x16'),_0xf9c3('0x30')+(_0x4d35f6[_0xf9c3('0x1c')]||JSON['stringify'](_0x4d35f6)),null,_0x12b624));});});}function checkHopper(){function _0x17bdd8(){return function(_0x47f23b){logger[_0xf9c3('0x16')](_0xf9c3('0x31'),_0xf9c3('0x32'),util[_0xf9c3('0x33')](_0x47f23b,{'showHidden':![],'depth':null}));};}var _0x45549=function(_0x35f6cb,_0x55cf32){var _0x28a266=squel[_0xf9c3('0x34')]()[_0xf9c3('0x35')]('cm_hopper')['fromQuery']([_0xf9c3('0x36'),'scheduledAt','ContactId',_0xf9c3('0x37'),_0x55cf32,_0xf9c3('0x38'),_0xf9c3('0x39')],squel[_0xf9c3('0x3a')]()['field'](_0xf9c3('0x36'),_0xf9c3('0x36'))[_0xf9c3('0x3b')](_0xf9c3('0x3c'),_0xf9c3('0x3d'))[_0xf9c3('0x3b')]('id',_0xf9c3('0x3e'))[_0xf9c3('0x3b')](LISTID[_0xf9c3('0x3f')](),_0xf9c3('0x37'))[_0xf9c3('0x3b')](_0x35f6cb['id'][_0xf9c3('0x3f')](),_0x55cf32)[_0xf9c3('0x3b')](_0xf9c3('0x3c'),_0xf9c3('0x38'))[_0xf9c3('0x3b')](_0xf9c3('0x3c'),_0xf9c3('0x39'))[_0xf9c3('0x40')]('cm_contacts')[_0xf9c3('0x41')](_0xf9c3('0x42'))[_0xf9c3('0x41')]('ListId\x20=\x20?',LISTID[_0xf9c3('0x3f')]())[_0xf9c3('0x41')](_0xf9c3('0x43'))[_0xf9c3('0x41')](_0xf9c3('0x44'),squel[_0xf9c3('0x3a')]()[_0xf9c3('0x3b')](_0xf9c3('0x36'))[_0xf9c3('0x40')](_0xf9c3('0x45'))[_0xf9c3('0x41')](_0x55cf32+_0xf9c3('0x46'),_0x35f6cb['id'][_0xf9c3('0x3f')]())))[_0xf9c3('0x3f')]();return _0x28a266;};var _0x5aa57b=function(_0x3667ea,_0x210813){var _0x310ac7=squel[_0xf9c3('0x34')]()[_0xf9c3('0x35')](_0xf9c3('0x45'))[_0xf9c3('0x47')]([_0xf9c3('0x36'),_0xf9c3('0x3d'),_0xf9c3('0x3e'),_0xf9c3('0x37'),_0x210813,_0xf9c3('0x38'),_0xf9c3('0x39')],squel['select']()[_0xf9c3('0x3b')]('phone','phone')[_0xf9c3('0x3b')](_0xf9c3('0x3c'),_0xf9c3('0x3d'))[_0xf9c3('0x3b')]('id',_0xf9c3('0x3e'))[_0xf9c3('0x3b')](LISTID[_0xf9c3('0x3f')](),_0xf9c3('0x37'))[_0xf9c3('0x3b')](_0x3667ea['id'][_0xf9c3('0x3f')](),_0x210813)[_0xf9c3('0x3b')](_0xf9c3('0x3c'),_0xf9c3('0x38'))[_0xf9c3('0x3b')](_0xf9c3('0x3c'),_0xf9c3('0x39'))[_0xf9c3('0x40')](_0xf9c3('0x48'))[_0xf9c3('0x41')](_0xf9c3('0x42'))['where'](_0xf9c3('0x49'),LISTID[_0xf9c3('0x3f')]())[_0xf9c3('0x41')]('id\x20IN\x20?',squel[_0xf9c3('0x4a')](hopperContacts))['where'](_0xf9c3('0x43'))[_0xf9c3('0x41')](_0xf9c3('0x44'),squel['select']()[_0xf9c3('0x3b')](_0xf9c3('0x4b'))[_0xf9c3('0x40')]('cm_hopper_final')['where'](_0x210813+_0xf9c3('0x46'),_0x3667ea['id']['toString']()))[_0xf9c3('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xf9c3('0x36'))['from'](_0xf9c3('0x45'))['where'](_0x210813+_0xf9c3('0x46'),_0x3667ea['id'][_0xf9c3('0x3f')]())))[_0xf9c3('0x3f')]();return _0x310ac7;};function _0x173fb3(_0x2bc668,_0x9dd520){var _0x4f5894=squel['insert']()[_0xf9c3('0x35')](_0xf9c3('0x45'))[_0xf9c3('0x47')]([_0xf9c3('0x36'),_0xf9c3('0x3d'),'ContactId',_0xf9c3('0x37'),_0x9dd520,_0xf9c3('0x38'),'updatedAt'],squel[_0xf9c3('0x3a')]()['field']('phone',_0xf9c3('0x36'))[_0xf9c3('0x3b')](_0xf9c3('0x3c'),_0xf9c3('0x3d'))['field']('id','ContactId')[_0xf9c3('0x3b')](LISTID['toString'](),_0xf9c3('0x37'))[_0xf9c3('0x3b')](_0x2bc668['id'][_0xf9c3('0x3f')](),_0x9dd520)[_0xf9c3('0x3b')]('NOW()',_0xf9c3('0x38'))[_0xf9c3('0x3b')](_0xf9c3('0x3c'),_0xf9c3('0x39'))[_0xf9c3('0x40')](_0xf9c3('0x48'))['where'](_0xf9c3('0x42'))[_0xf9c3('0x41')](_0xf9c3('0x49'),LISTID['toString']())[_0xf9c3('0x41')](_0xf9c3('0x4c'),squel[_0xf9c3('0x4a')](hopperContacts))[_0xf9c3('0x41')](_0xf9c3('0x43')))[_0xf9c3('0x3f')]();return _0x4f5894;}function _0x5dcdd7(_0x3a03b9,_0x4e2d67){var _0x5c2ac7=squel['insert']()[_0xf9c3('0x35')](_0xf9c3('0x4d'))[_0xf9c3('0x47')]([_0xf9c3('0x36'),'ContactId',_0xf9c3('0x37'),_0x4e2d67,_0xf9c3('0x38'),_0xf9c3('0x39')],squel['select']()[_0xf9c3('0x3b')](_0xf9c3('0x36'),_0xf9c3('0x36'))[_0xf9c3('0x3b')]('id',_0xf9c3('0x3e'))[_0xf9c3('0x3b')](LISTID['toString'](),'ListId')['field'](_0x3a03b9['id'][_0xf9c3('0x3f')](),_0x4e2d67)[_0xf9c3('0x3b')](_0xf9c3('0x3c'),_0xf9c3('0x38'))[_0xf9c3('0x3b')](_0xf9c3('0x3c'),_0xf9c3('0x39'))[_0xf9c3('0x40')]('cm_contacts')[_0xf9c3('0x41')](_0xf9c3('0x42'))[_0xf9c3('0x41')](_0xf9c3('0x49'),LISTID['toString']())[_0xf9c3('0x41')](_0xf9c3('0x4c'),squel[_0xf9c3('0x4a')](hopperContacts))['where'](_0xf9c3('0x43')))['toString']();return _0x5c2ac7;}return db[_0xf9c3('0x4e')][_0xf9c3('0x4f')]({'where':{'type':_0xf9c3('0x50')},'attributes':['id',_0xf9c3('0x51')],'include':[{'model':db[_0xf9c3('0x52')],'as':_0xf9c3('0x53'),'where':{'id':LISTID}}]})[_0xf9c3('0x2c')](function(_0x24a0e2){var _0x5cab5d=[];if(_0x24a0e2){var _0x209c08;for(var _0x551816=0x0,_0x3197e0;_0x551816<_0x24a0e2[_0xf9c3('0x1b')];_0x551816+=0x1){_0x3197e0=_0x24a0e2[_0x551816]['get']({'plain':!![]});switch(_0x3197e0['dialCheckDuplicateType']){case _0xf9c3('0x54'):_0x5cab5d['push'](db[_0xf9c3('0x55')][_0xf9c3('0x56')](_0x5aa57b(_0x3197e0,_0xf9c3('0x57')))[_0xf9c3('0x2c')](function(){})['catch'](_0x17bdd8()));break;case _0xf9c3('0x58'):_0x5cab5d[_0xf9c3('0x2d')](db[_0xf9c3('0x55')][_0xf9c3('0x56')](_0x45549(_0x3197e0,_0xf9c3('0x57')))[_0xf9c3('0x2c')](function(){})[_0xf9c3('0x2f')](_0x17bdd8()));break;default:_0x5cab5d['push'](db['sequelize']['query'](_0x173fb3(_0x3197e0,'VoiceQueueId'))[_0xf9c3('0x2c')](function(){})[_0xf9c3('0x2f')](_0x17bdd8()));}}}return _0x5cab5d;})[_0xf9c3('0x59')]()['then'](function(){return db[_0xf9c3('0x4e')][_0xf9c3('0x4f')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0xf9c3('0x2c')](function(_0x50aad5){var _0x5e6321=[];if(_0x50aad5){var _0x2e006d;for(var _0x30f938=0x0,_0x21372a;_0x30f938<_0x50aad5[_0xf9c3('0x1b')];_0x30f938+=0x1){_0x21372a=_0x50aad5[_0x30f938][_0xf9c3('0x5a')]({'plain':!![]});_0x5e6321[_0xf9c3('0x2d')](db[_0xf9c3('0x55')][_0xf9c3('0x56')](_0x5dcdd7(_0x21372a,_0xf9c3('0x57')))[_0xf9c3('0x2c')](function(){})['catch'](_0x17bdd8()));}}return _0x5e6321;})[_0xf9c3('0x59')]();})[_0xf9c3('0x2c')](function(){return db[_0xf9c3('0x5b')][_0xf9c3('0x4f')]({'attributes':['id',_0xf9c3('0x51')],'include':[{'model':db[_0xf9c3('0x52')],'as':_0xf9c3('0x53'),'where':{'id':LISTID}}]})[_0xf9c3('0x2c')](function(_0xb46708){var _0x480c92=[];if(_0xb46708){for(var _0x26036c=0x0,_0x31f303;_0x26036c<_0xb46708['length'];_0x26036c+=0x1){_0x31f303=_0xb46708[_0x26036c]['get']({'plain':!![]});switch(_0x31f303[_0xf9c3('0x51')]){case _0xf9c3('0x54'):_0x480c92[_0xf9c3('0x2d')](db['sequelize'][_0xf9c3('0x56')](_0x5aa57b(_0x31f303,'CampaignId'))[_0xf9c3('0x2c')](function(){})[_0xf9c3('0x2f')](_0x17bdd8()));break;case _0xf9c3('0x58'):_0x480c92[_0xf9c3('0x2d')](db[_0xf9c3('0x55')]['query'](_0x45549(_0x31f303,_0xf9c3('0x5c')))[_0xf9c3('0x2c')](function(){})[_0xf9c3('0x2f')](_0x17bdd8()));break;default:_0x480c92[_0xf9c3('0x2d')](db[_0xf9c3('0x55')][_0xf9c3('0x56')](_0x173fb3(_0x31f303,_0xf9c3('0x5c')))[_0xf9c3('0x2c')](function(){})[_0xf9c3('0x2f')](_0x17bdd8()));}}}return _0x480c92;})[_0xf9c3('0x59')]();})[_0xf9c3('0x2c')](function(){return db['Campaign'][_0xf9c3('0x4f')]({'attributes':['id'],'include':[{'model':db[_0xf9c3('0x52')],'as':_0xf9c3('0x5d'),'where':{'id':LISTID}}]})[_0xf9c3('0x2c')](function(_0x58d12d){var _0x3a873c=[];if(_0x58d12d){for(var _0xe54fae=0x0,_0x3cca83;_0xe54fae<_0x58d12d[_0xf9c3('0x1b')];_0xe54fae+=0x1){_0x3cca83=_0x58d12d[_0xe54fae]['get']({'plain':!![]});_0x3a873c[_0xf9c3('0x2d')](db['sequelize'][_0xf9c3('0x56')](_0x5dcdd7(_0x3cca83,_0xf9c3('0x5c')))['then'](function(){})[_0xf9c3('0x2f')](_0x17bdd8()));}}return _0x3a873c;})[_0xf9c3('0x59')]();})[_0xf9c3('0x2f')](function(_0x562405){logger[_0xf9c3('0x16')](_0xf9c3('0x5e'),_0xf9c3('0x5f'),_0x562405[_0xf9c3('0x1c')]);});}var processPromises=function(_0x4b0e25){return BPromise[_0xf9c3('0x59')](promises)[_0xf9c3('0x2c')](function(_0x4f32d7){})[_0xf9c3('0x2f')](function(_0x3d7d18){logger['error'](_0xf9c3('0x60'),JSON['stringify'](_0x3d7d18));})['finally'](function(){socket[_0xf9c3('0x61')](_0xf9c3('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4b0e25){return _0x4b0e25[_0xf9c3('0x63')]();}});};var endCsv=function(){return BPromise[_0xf9c3('0x64')]()[_0xf9c3('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0xf9c3('0x2c')](function(){socket[_0xf9c3('0x61')](_0xf9c3('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xf9c3('0x65')](FILEPATH);}catch(_0x16c940){logger[_0xf9c3('0x16')](_0xf9c3('0x66'),JSON[_0xf9c3('0x67')](_0x16c940));}finally{process[_0xf9c3('0x68')](0x0);}});};process['on'](_0xf9c3('0x69'),function(){logger[_0xf9c3('0x6a')](_0xf9c3('0x6b'));endCsv();});function main(){return BPromise[_0xf9c3('0x64')]()[_0xf9c3('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xf9c3('0x13')](',');return db[_0xf9c3('0x6c')][_0xf9c3('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xf9c3('0x2c')](function(_0x295fce){var _0x32e2f2=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x32e2f2,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2bfbe7,_0x16f724){total+=0x1;var _0x129bf5=total;promises[_0xf9c3('0x2d')](checkRow(_0x2bfbe7,_0x295fce,_0x129bf5)[_0xf9c3('0x2c')](function(){success+=0x1;})[_0xf9c3('0x2f')](function(_0xd26d54){if(_0xd26d54[_0xf9c3('0x16')]){errors+=0x1;delete _0xd26d54[_0xf9c3('0x16')];}else if(_0xd26d54[_0xf9c3('0x29')]){duplicates+=0x1;delete _0xd26d54[_0xf9c3('0x29')];}rows[_0xf9c3('0x2d')](_0xd26d54);}));if(total%0xc8===0x0){_0x16f724[_0xf9c3('0x6d')]();return processPromises(_0x16f724);}},'complete':function(){return processPromises()[_0xf9c3('0x2c')](function(){logger[_0xf9c3('0x6a')](_0xf9c3('0x6e'));endCsv();});},'error':function(_0x400e19,_0x638fe7){logger[_0xf9c3('0x6a')](_0xf9c3('0x6f'),JSON['stringify'](_0x400e19));endCsv();}});})[_0xf9c3('0x2f')](function(_0x566ed3){logger[_0xf9c3('0x16')](_0xf9c3('0x70'),JSON['stringify'](_0x566ed3));});}main(); \ No newline at end of file +var _0x9d0b=['duplicate','pause','CSV\x20parse\x20error','bluebird','util','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','Duplicate\x20Contact','CmContact','create','then','push','pick','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','cm_hopper','scheduledAt','ListId','createdAt','select','field','ContactId','toString','NOW()','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','calleridnum','cm_hopper_final','insert','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','stringify','finally','emit','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0x9d0b,0x14a));var _0xb9d0=function(_0x54b5b6,_0x5a27bc){_0x54b5b6=_0x54b5b6-0x0;var _0x58ecd9=_0x9d0b[_0x54b5b6];return _0x58ecd9;};'use strict';var BPromise=require(_0xb9d0('0x0'));var util=require(_0xb9d0('0x1'));var _=require(_0xb9d0('0x2'));var fs=require('fs');var squel=require(_0xb9d0('0x3'));var Papa=require('papaparse');var Redis=require(_0xb9d0('0x4'));var db=require(_0xb9d0('0x5'))['db'];var config=require(_0xb9d0('0x6'));var logger=require(_0xb9d0('0x7'))(_0xb9d0('0x8'));config[_0xb9d0('0x9')]=_['defaults'](config['redis'],{'host':_0xb9d0('0xa'),'port':0x18eb});var socket=require(_0xb9d0('0xb'))(new Redis(config[_0xb9d0('0x9')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process['argv'][0x2]||process[_0xb9d0('0xc')][0x2]===_0xb9d0('0xd')||process['argv'][0x2]===_0xb9d0('0xe')){throw new Error(_0xb9d0('0xf'));}var FILEPATH=process[_0xb9d0('0xc')][0x2];if(!process[_0xb9d0('0xc')][0x3]||process[_0xb9d0('0xc')][0x3]===_0xb9d0('0xd')||process[_0xb9d0('0xc')][0x3]===_0xb9d0('0xe')||!process[_0xb9d0('0xc')][0x4]||process[_0xb9d0('0xc')][0x4]==='undefined'||process[_0xb9d0('0xc')][0x4]==='null'){throw new Error(_0xb9d0('0x10'));}var FIELDS=_[_0xb9d0('0x11')](process[_0xb9d0('0xc')][0x3][_0xb9d0('0x12')](','),process[_0xb9d0('0xc')][0x4][_0xb9d0('0x12')](','));if(!process[_0xb9d0('0xc')][0x5]||process['argv'][0x5]===_0xb9d0('0xd')||process[_0xb9d0('0xc')][0x5]===_0xb9d0('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xb9d0('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xb9d0('0xc')][0x6]!==_0xb9d0('0xd')&&process['argv'][0x6]!==_0xb9d0('0xe')?process[_0xb9d0('0xc')][0x6]:null;var DUPLICATES=process[_0xb9d0('0xc')][0x7]&&process[_0xb9d0('0xc')][0x7]!==_0xb9d0('0xd')&&process[_0xb9d0('0xc')][0x7]!==_0xb9d0('0xe')?process[_0xb9d0('0xc')][0x7]:null;if(!process[_0xb9d0('0xc')][0x8]||process[_0xb9d0('0xc')][0x8]===_0xb9d0('0xd')||process[_0xb9d0('0xc')][0x8]===_0xb9d0('0xe')){throw new Error(_0xb9d0('0x13'));}var SOCKET_TIMESTAMP=process[_0xb9d0('0xc')][0x8];}catch(_0x37fae5){logger[_0xb9d0('0x14')](_0x37fae5);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(_0x263dbf,_0x3ca00f,_0x267290,_0x2253ee){var _0x50dee6={'message':_0x3ca00f};_0x50dee6[_0x263dbf]=!![];if(_0x267290){_0x50dee6[_0xb9d0('0x15')]=_0x267290;}if(_0x2253ee){_0x50dee6[_0xb9d0('0x16')]=_0x2253ee;}return _0x50dee6;}function isEmail(_0x27421c){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))*$/[_0xb9d0('0x17')](_0x27421c);}function checkRow(_0x34cdfd,_0x36ed82,_0x1aee2f){return new BPromise(function(_0x2cf1be,_0x37df94){if(_['isNil'](_0x34cdfd)){return _0x37df94(handleCheckRowError(_0xb9d0('0x14'),_0xb9d0('0x18'),null,_0x1aee2f));}if(_0x34cdfd[_0xb9d0('0x19')]&&_0x34cdfd[_0xb9d0('0x19')][_0xb9d0('0x1a')]){var _0xb653ec=_[_0xb9d0('0x1b')](_0x34cdfd[_0xb9d0('0x19')],'message')['join'](';');return _0x37df94(handleCheckRowError(_0xb9d0('0x14'),_0xb653ec,null,_0x1aee2f));}var _0xced023={};for(var _0x3b3854 in FIELDS){if(FIELDS[_0xb9d0('0x1c')](_0x3b3854)&&FIELDS[_0x3b3854]){_0xced023[_0x3b3854]=_0x34cdfd[_0xb9d0('0x1d')][0x0][FIELDS[_0x3b3854]]||_0x34cdfd[_0xb9d0('0x1d')][0x0]['\ufeff'+FIELDS[_0x3b3854]];}}if(!_0xced023[_0xb9d0('0x1e')]){return _0x37df94(handleCheckRowError(_0xb9d0('0x14'),'firstName\x20not\x20specified!',null,_0x1aee2f));}if(!_0xced023[_0xb9d0('0x1f')]){return _0x37df94(handleCheckRowError('error',_0xb9d0('0x20'),null,_0x1aee2f));}if(_0xced023[_0xb9d0('0x21')]){var _0x300863=moment(_0xced023['birthDate'],_0xb9d0('0x22'));if(!_0x300863[_0xb9d0('0x23')]()){return _0x37df94(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x1aee2f));}}if(_0xced023[_0xb9d0('0x24')]){if(!isEmail(_0xced023[_0xb9d0('0x24')])){return _0x37df94(handleCheckRowError(_0xb9d0('0x14'),_0xb9d0('0x25'),null,_0x1aee2f));}}_0xced023['ListId']=LISTID;_0xced023[_0xb9d0('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb9d0('0x1a')]&&_0x36ed82){var _0xcc805b={};for(var _0x2a3507=0x0,_0x1236da=DUPLICATES['length'];_0x2a3507<_0x1236da;_0x2a3507+=0x1){_0xcc805b[DUPLICATES[_0x2a3507]]=_0xced023[DUPLICATES[_0x2a3507]];}var _0x5c4398=_['find'](_0x36ed82,_0xcc805b);if(_0x5c4398){return _0x37df94(handleCheckRowError('duplicate',_0xb9d0('0x27'),_0x5c4398,_0x1aee2f));}}return db[_0xb9d0('0x28')][_0xb9d0('0x29')](_0xced023,{'raw':!![],'hooks':![],'fields':_['keys'](_0xced023)})[_0xb9d0('0x2a')](function(_0x31cb7b){if(DUPLICATES&&DUPLICATES[_0xb9d0('0x1a')]&&_0x36ed82){_0x36ed82[_0xb9d0('0x2b')](_[_0xb9d0('0x2c')](_0xced023,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x31cb7b['id'];return _0x2cf1be();})['catch'](function(_0x320a0b){return _0x37df94(handleCheckRowError(_0xb9d0('0x14'),_0xb9d0('0x2d')+(_0x320a0b['message']||JSON['stringify'](_0x320a0b)),null,_0x1aee2f));});});}function checkHopper(){function _0x899da8(){return function(_0x2b2c1c){logger[_0xb9d0('0x14')](_0xb9d0('0x2e'),_0xb9d0('0x2f'),util[_0xb9d0('0x30')](_0x2b2c1c,{'showHidden':![],'depth':null}));};}var _0x2c1ace=function(_0x22a0cb,_0x31d2a7){var _0x42e7a0=squel['insert']()['into'](_0xb9d0('0x31'))['fromQuery']([_0xb9d0('0x1f'),_0xb9d0('0x32'),'ContactId',_0xb9d0('0x33'),_0x31d2a7,_0xb9d0('0x34'),'updatedAt'],squel[_0xb9d0('0x35')]()['field'](_0xb9d0('0x1f'),_0xb9d0('0x1f'))[_0xb9d0('0x36')]('NOW()',_0xb9d0('0x32'))['field']('id',_0xb9d0('0x37'))[_0xb9d0('0x36')](LISTID[_0xb9d0('0x38')](),_0xb9d0('0x33'))[_0xb9d0('0x36')](_0x22a0cb['id'][_0xb9d0('0x38')](),_0x31d2a7)['field'](_0xb9d0('0x39'),_0xb9d0('0x34'))[_0xb9d0('0x36')](_0xb9d0('0x39'),_0xb9d0('0x3a'))[_0xb9d0('0x3b')](_0xb9d0('0x3c'))[_0xb9d0('0x3d')](_0xb9d0('0x3e'))[_0xb9d0('0x3d')](_0xb9d0('0x3f'),LISTID[_0xb9d0('0x38')]())[_0xb9d0('0x3d')](_0xb9d0('0x40'))[_0xb9d0('0x3d')](_0xb9d0('0x41'),squel['select']()[_0xb9d0('0x36')](_0xb9d0('0x1f'))[_0xb9d0('0x3b')](_0xb9d0('0x31'))[_0xb9d0('0x3d')](_0x31d2a7+_0xb9d0('0x42'),_0x22a0cb['id'][_0xb9d0('0x38')]())))[_0xb9d0('0x38')]();return _0x42e7a0;};var _0x2f0e0e=function(_0x588c09,_0x569305){var _0x1adeb8=squel['insert']()[_0xb9d0('0x43')]('cm_hopper')[_0xb9d0('0x44')](['phone',_0xb9d0('0x32'),'ContactId','ListId',_0x569305,_0xb9d0('0x34'),'updatedAt'],squel[_0xb9d0('0x35')]()[_0xb9d0('0x36')](_0xb9d0('0x1f'),'phone')[_0xb9d0('0x36')](_0xb9d0('0x39'),_0xb9d0('0x32'))['field']('id','ContactId')[_0xb9d0('0x36')](LISTID[_0xb9d0('0x38')](),_0xb9d0('0x33'))['field'](_0x588c09['id'][_0xb9d0('0x38')](),_0x569305)[_0xb9d0('0x36')](_0xb9d0('0x39'),_0xb9d0('0x34'))[_0xb9d0('0x36')](_0xb9d0('0x39'),_0xb9d0('0x3a'))[_0xb9d0('0x3b')]('cm_contacts')[_0xb9d0('0x3d')](_0xb9d0('0x3e'))[_0xb9d0('0x3d')](_0xb9d0('0x3f'),LISTID['toString']())[_0xb9d0('0x3d')](_0xb9d0('0x45'),squel[_0xb9d0('0x46')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xb9d0('0x36')](_0xb9d0('0x47'))['from'](_0xb9d0('0x48'))['where'](_0x569305+_0xb9d0('0x42'),_0x588c09['id'][_0xb9d0('0x38')]()))[_0xb9d0('0x3d')](_0xb9d0('0x41'),squel[_0xb9d0('0x35')]()[_0xb9d0('0x36')](_0xb9d0('0x1f'))['from']('cm_hopper')['where'](_0x569305+_0xb9d0('0x42'),_0x588c09['id'][_0xb9d0('0x38')]())))[_0xb9d0('0x38')]();return _0x1adeb8;};function _0x117b31(_0x5ac584,_0x4bb9e7){var _0x2de299=squel[_0xb9d0('0x49')]()[_0xb9d0('0x43')]('cm_hopper')[_0xb9d0('0x44')]([_0xb9d0('0x1f'),_0xb9d0('0x32'),_0xb9d0('0x37'),_0xb9d0('0x33'),_0x4bb9e7,'createdAt',_0xb9d0('0x3a')],squel[_0xb9d0('0x35')]()['field']('phone',_0xb9d0('0x1f'))[_0xb9d0('0x36')](_0xb9d0('0x39'),_0xb9d0('0x32'))[_0xb9d0('0x36')]('id',_0xb9d0('0x37'))[_0xb9d0('0x36')](LISTID[_0xb9d0('0x38')](),_0xb9d0('0x33'))[_0xb9d0('0x36')](_0x5ac584['id']['toString'](),_0x4bb9e7)[_0xb9d0('0x36')](_0xb9d0('0x39'),'createdAt')['field'](_0xb9d0('0x39'),_0xb9d0('0x3a'))[_0xb9d0('0x3b')](_0xb9d0('0x3c'))[_0xb9d0('0x3d')](_0xb9d0('0x3e'))[_0xb9d0('0x3d')](_0xb9d0('0x3f'),LISTID['toString']())[_0xb9d0('0x3d')](_0xb9d0('0x45'),squel['str'](hopperContacts))[_0xb9d0('0x3d')](_0xb9d0('0x40')))[_0xb9d0('0x38')]();return _0x2de299;}function _0x242d21(_0x431851,_0x4c539d){var _0x3c5e4c=squel[_0xb9d0('0x49')]()[_0xb9d0('0x43')](_0xb9d0('0x4a'))[_0xb9d0('0x44')]([_0xb9d0('0x1f'),_0xb9d0('0x37'),'ListId',_0x4c539d,'createdAt',_0xb9d0('0x3a')],squel[_0xb9d0('0x35')]()['field'](_0xb9d0('0x1f'),_0xb9d0('0x1f'))[_0xb9d0('0x36')]('id',_0xb9d0('0x37'))[_0xb9d0('0x36')](LISTID[_0xb9d0('0x38')](),'ListId')[_0xb9d0('0x36')](_0x431851['id']['toString'](),_0x4c539d)['field'](_0xb9d0('0x39'),_0xb9d0('0x34'))[_0xb9d0('0x36')](_0xb9d0('0x39'),_0xb9d0('0x3a'))[_0xb9d0('0x3b')](_0xb9d0('0x3c'))[_0xb9d0('0x3d')]('deletedAt\x20IS\x20NULL')[_0xb9d0('0x3d')]('ListId\x20=\x20?',LISTID['toString']())[_0xb9d0('0x3d')](_0xb9d0('0x45'),squel[_0xb9d0('0x46')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xb9d0('0x38')]();return _0x3c5e4c;}return db[_0xb9d0('0x4b')][_0xb9d0('0x4c')]({'where':{'type':_0xb9d0('0x4d')},'attributes':['id',_0xb9d0('0x4e')],'include':[{'model':db[_0xb9d0('0x4f')],'as':_0xb9d0('0x50'),'where':{'id':LISTID}}]})['then'](function(_0x2c89cd){var _0x173dc7=[];if(_0x2c89cd){var _0x37f9fa;for(var _0x5662c7=0x0,_0x54b414;_0x5662c7<_0x2c89cd[_0xb9d0('0x1a')];_0x5662c7+=0x1){_0x54b414=_0x2c89cd[_0x5662c7][_0xb9d0('0x51')]({'plain':!![]});switch(_0x54b414['dialCheckDuplicateType']){case _0xb9d0('0x52'):_0x173dc7['push'](db[_0xb9d0('0x53')][_0xb9d0('0x54')](_0x2f0e0e(_0x54b414,_0xb9d0('0x55')))['then'](function(){})['catch'](_0x899da8()));break;case _0xb9d0('0x56'):_0x173dc7[_0xb9d0('0x2b')](db[_0xb9d0('0x53')][_0xb9d0('0x54')](_0x2c1ace(_0x54b414,_0xb9d0('0x55')))[_0xb9d0('0x2a')](function(){})[_0xb9d0('0x57')](_0x899da8()));break;default:_0x173dc7['push'](db[_0xb9d0('0x53')][_0xb9d0('0x54')](_0x117b31(_0x54b414,_0xb9d0('0x55')))[_0xb9d0('0x2a')](function(){})['catch'](_0x899da8()));}}}return _0x173dc7;})[_0xb9d0('0x58')]()[_0xb9d0('0x2a')](function(){return db['VoiceQueue'][_0xb9d0('0x4c')]({'where':{'type':_0xb9d0('0x4d')},'attributes':['id'],'include':[{'model':db[_0xb9d0('0x4f')],'as':_0xb9d0('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x3ae237){var _0x3c32bb=[];if(_0x3ae237){var _0x29d48e;for(var _0x1ecf70=0x0,_0x4cae84;_0x1ecf70<_0x3ae237[_0xb9d0('0x1a')];_0x1ecf70+=0x1){_0x4cae84=_0x3ae237[_0x1ecf70][_0xb9d0('0x51')]({'plain':!![]});_0x3c32bb[_0xb9d0('0x2b')](db[_0xb9d0('0x53')][_0xb9d0('0x54')](_0x242d21(_0x4cae84,_0xb9d0('0x55')))[_0xb9d0('0x2a')](function(){})[_0xb9d0('0x57')](_0x899da8()));}}return _0x3c32bb;})[_0xb9d0('0x58')]();})[_0xb9d0('0x2a')](function(){return db[_0xb9d0('0x5a')]['findAll']({'attributes':['id',_0xb9d0('0x4e')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xb9d0('0x2a')](function(_0x3219e5){var _0xa988a5=[];if(_0x3219e5){for(var _0x34c409=0x0,_0x40296c;_0x34c409<_0x3219e5['length'];_0x34c409+=0x1){_0x40296c=_0x3219e5[_0x34c409][_0xb9d0('0x51')]({'plain':!![]});switch(_0x40296c[_0xb9d0('0x4e')]){case'always':_0xa988a5[_0xb9d0('0x2b')](db[_0xb9d0('0x53')][_0xb9d0('0x54')](_0x2f0e0e(_0x40296c,'CampaignId'))[_0xb9d0('0x2a')](function(){})[_0xb9d0('0x57')](_0x899da8()));break;case'onlyIfOpen':_0xa988a5[_0xb9d0('0x2b')](db[_0xb9d0('0x53')][_0xb9d0('0x54')](_0x2c1ace(_0x40296c,_0xb9d0('0x5b')))[_0xb9d0('0x2a')](function(){})[_0xb9d0('0x57')](_0x899da8()));break;default:_0xa988a5[_0xb9d0('0x2b')](db['sequelize'][_0xb9d0('0x54')](_0x117b31(_0x40296c,_0xb9d0('0x5b')))[_0xb9d0('0x2a')](function(){})[_0xb9d0('0x57')](_0x899da8()));}}}return _0xa988a5;})['all']();})['then'](function(){return db[_0xb9d0('0x5a')][_0xb9d0('0x4c')]({'attributes':['id'],'include':[{'model':db[_0xb9d0('0x4f')],'as':_0xb9d0('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x4de868){var _0x55b666=[];if(_0x4de868){for(var _0x543696=0x0,_0x2a42d1;_0x543696<_0x4de868[_0xb9d0('0x1a')];_0x543696+=0x1){_0x2a42d1=_0x4de868[_0x543696][_0xb9d0('0x51')]({'plain':!![]});_0x55b666[_0xb9d0('0x2b')](db[_0xb9d0('0x53')][_0xb9d0('0x54')](_0x242d21(_0x2a42d1,_0xb9d0('0x5b')))['then'](function(){})[_0xb9d0('0x57')](_0x899da8()));}}return _0x55b666;})['all']();})[_0xb9d0('0x57')](function(_0x5e598c){logger[_0xb9d0('0x14')](_0xb9d0('0x5c'),_0xb9d0('0x5d'),_0x5e598c['message']);});}var processPromises=function(_0x426fbf){return BPromise['all'](promises)['then'](function(_0x59664c){})['catch'](function(_0x2a1e10){logger[_0xb9d0('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0xb9d0('0x5e')](_0x2a1e10));})[_0xb9d0('0x5f')](function(){socket[_0xb9d0('0x60')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x426fbf){return _0x426fbf['resume']();}});};var endCsv=function(){return BPromise[_0xb9d0('0x61')]()[_0xb9d0('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0xb9d0('0x2a')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb9d0('0x62')](FILEPATH);}catch(_0xe5fd86){logger['error'](_0xb9d0('0x63'),JSON[_0xb9d0('0x5e')](_0xe5fd86));}finally{process[_0xb9d0('0x64')](0x0);}});};process['on'](_0xb9d0('0x65'),function(){logger[_0xb9d0('0x66')](_0xb9d0('0x67'));endCsv();});function main(){return BPromise['resolve']()[_0xb9d0('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact'][_0xb9d0('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb9d0('0x2a')](function(_0x278c51){var _0x1203dd=fs[_0xb9d0('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb9d0('0x69')](_0x1203dd,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4fbdff,_0x1273f9){total+=0x1;var _0x508e44=total;promises[_0xb9d0('0x2b')](checkRow(_0x4fbdff,_0x278c51,_0x508e44)[_0xb9d0('0x2a')](function(){success+=0x1;})['catch'](function(_0x44fcfb){if(_0x44fcfb[_0xb9d0('0x14')]){errors+=0x1;delete _0x44fcfb[_0xb9d0('0x14')];}else if(_0x44fcfb[_0xb9d0('0x6a')]){duplicates+=0x1;delete _0x44fcfb[_0xb9d0('0x6a')];}rows['push'](_0x44fcfb);}));if(total%0xc8===0x0){_0x1273f9[_0xb9d0('0x6b')]();return processPromises(_0x1273f9);}},'complete':function(){return processPromises()[_0xb9d0('0x2a')](function(){logger[_0xb9d0('0x66')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x51cb14,_0x1f7bc9){logger[_0xb9d0('0x66')](_0xb9d0('0x6c'),JSON['stringify'](_0x51cb14));endCsv();}});})[_0xb9d0('0x57')](function(_0xab8fc3){logger[_0xb9d0('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xb9d0('0x5e')](_0xab8fc3));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d1636c6..99f0fc0 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 _0xf491=['each','dialTimezone,utcOffset','duplicates','DROP\x20TABLE\x20','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_lists','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','moment','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','defaults','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','then','push','all','AdditionalPhones','length','split','filter','CmContactHasItem','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.ListId','cm_contacts.createdAt','cm_hopper_black','fromQuery','fields','field','toString','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','priority','UserId','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','.CmListId','ListId\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','sequelize','query','spread','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists.CmListId=','catch','message','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','timezones','dialTimezone','utcOffset','set','offset','stringify','send','start','binding','clone','server/files/tmp','.csv','includes','header','ContactItemType','findAll','name','_description','parse','createReadStream','rows','data','find','isNil','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','itemTypeId','description','SystemRow','emit','contact:import:','Abort\x20parser','SystemError','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);'];(function(_0x16938f,_0x35e57f){var _0x5c66e9=function(_0x5167d7){while(--_0x5167d7){_0x16938f['push'](_0x16938f['shift']());}};_0x5c66e9(++_0x35e57f);}(_0xf491,0x178));var _0x1f49=function(_0x300876,_0x12540c){_0x300876=_0x300876-0x0;var _0x4685fe=_0xf491[_0x300876];return _0x4685fe;};'use strict';var fs=require('fs');var path=require(_0x1f49('0x0'));var _=require(_0x1f49('0x1'));var Papa=require(_0x1f49('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x1f49('0x3'));var squel=require('squel');var Redis=require(_0x1f49('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x1f49('0x5'));var shared=require(_0x1f49('0x6'));var logger=require(_0x1f49('0x7'))('import');config['redis']=_[_0x1f49('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f49('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x1f49('0xa')](_0x1f49('0xb'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x1f49('0xb'));function isEmail(_0xe7a9c8){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))*$/[_0x1f49('0xc')](_0xe7a9c8);}function selectNotIn(_0x1d2f05,_0x535035,_0x298e09,_0x466274,_0x2cf01a){return squel[_0x1f49('0xd')]()['field']('phone')[_0x1f49('0xe')](_0x466274)[_0x1f49('0xf')](_0x535035,null,_0x535035+_0x1f49('0x10')+_0x466274+'.'+_0x298e09)[_0x1f49('0x11')](_0x466274+'.'+_0x298e09+_0x1f49('0x12')+_0x1d2f05+'.'+_0x298e09)[_0x1f49('0x11')](_0x535035+_0x1f49('0x13')+_0x2cf01a[_0x1f49('0xf')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1121a2,_0x403bfd){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x1f49('0x14')](function(_0x37948a){if(_0x37948a!==null){var _0x118397=[];for(var _0x1bc49b=0x0;_0x1bc49b<_0x37948a['length'];_0x1bc49b++){var _0x4f0aa8=_0x37948a[_0x1bc49b];_0x118397[_0x1f49('0x15')](insertAdditionalPhones(_0x4f0aa8));}}Promise[_0x1f49('0x16')](_0x118397)['then'](function(){_0x1121a2({'val':0x1});});});});}function insertAdditionalPhones(_0x5cac84){return new Promise(function(_0x3e21a7,_0x3f909a){var _0x2bf3ca=_0x5cac84[_0x1f49('0x17')];var _0x2c95b6=_0x2bf3ca['split'](';');var _0x216411=[];orderBy=0x0;for(var _0x5b5db4=0x0;_0x5b5db4<_0x2c95b6[_0x1f49('0x18')];_0x5b5db4++){_0x216411['push'](splitAdditionalPhone(_0x5cac84['id'],_0x2c95b6[_0x5b5db4]));}Promise[_0x1f49('0x16')](_0x216411)[_0x1f49('0x14')](function(){_0x3e21a7({'val':_0x2c95b6['length']});});});}function splitAdditionalPhone(_0x1c8590,_0x245844){return new Promise(function(_0xc27a85,_0x5eca89){var _0x286785=_0x245844[_0x1f49('0x19')](':');var _0x506383=_0x286785[0x0];var _0xa29936=_0x286785[0x1];if(!_['isNil'](_0xa29936)){var _0x3a05b3=_0xa29936[_0x1f49('0x19')]('|');var _0x372421=[];for(var _0x47e9e4=0x0;_0x47e9e4<_0x3a05b3[_0x1f49('0x18')];_0x47e9e4++){if(_0x3a05b3[_0x47e9e4]!==''){var _0x500074=_[_0x1f49('0x1a')](promisesAdditionalPhones,{'contactId':_0x1c8590,'phone':_0x3a05b3[_0x47e9e4]});if(_0x500074[_0x1f49('0x18')]==0x0){orderBy++;promisesAdditionalPhones[_0x1f49('0x15')]({'contactId':_0x1c8590,'contactTypeId':_0x506383,'phone':_0x3a05b3[_0x47e9e4],'orderBy':orderBy});}}}_0xc27a85({'ok':0x1});}else _0xc27a85({'res':0x0});});}function createAdditionalPhone(_0x2b8f27,_0x374142,_0x4f0355,_0x20c586){var _0x316b20='';var _0x54d574='';var _0x450c32=_0x4f0355[_0x1f49('0x19')]('§');_0x316b20=_0x450c32[0x0];if(_0x450c32['length']==0x2)_0x54d574=_0x450c32[0x1];return new Promise(function(_0x1df935,_0x2a401f){return db[_0x1f49('0x1b')]['findOne']({'where':{'CmContactId':_0x2b8f27,'item':_0x316b20}})[_0x1f49('0x14')](function(_0x5e5134){if(_0x5e5134){return db[_0x1f49('0x1b')][_0x1f49('0x1c')]({'ItemTypeId':_0x374142,'description':_0x54d574,'OrderBy':_0x20c586},{'where':{'CmContactId':_0x2b8f27,'item':_0x316b20}})[_0x1f49('0x14')](function(_0x5bd85a){_0x1df935({'res':'updated'});});}else{return db[_0x1f49('0x1b')][_0x1f49('0x1d')]({'CmContactId':_0x2b8f27,'item':_0x316b20,'description':_0x54d574,'ItemTypeId':_0x374142,'OrderBy':_0x20c586,'ItemClass':_0x1f49('0x1e')})[_0x1f49('0x14')](function(_0x4ff31d){_0x1df935({'res':_0x1f49('0x1f')});});}});});}function insertCmHopper(_0x2a2233,_0x12a15b,_0x461a00,_0x1f1a8f,_0x37ebb7){var _0x2da172=[_0x1f49('0x20'),_0x1f49('0x21'),_0x1f49('0x22'),'cm_contacts.ListId',_0x12a15b+'.'+_0x1f1a8f,'cm_contacts.createdAt',_0x1f49('0x23'),_0x1f49('0x24'),_0x1f49('0x25'),'\x22'+_0x37ebb7+'\x22'];return squel[_0x1f49('0x26')]()[_0x1f49('0x27')](_0x1f49('0x28'))['fromQuery']([_0x1f49('0x29'),_0x1f49('0x2a'),_0x1f49('0x2b'),_0x1f49('0x2c'),_0x1f1a8f,_0x1f49('0x2d'),_0x1f49('0x2e'),'priority','UserId',_0x1f49('0x2f')],squel[_0x1f49('0xd')]()['fields'](_0x2da172)[_0x1f49('0xe')](_0x12a15b)['join'](_0x1f49('0x30'),null,_0x1f49('0x31')+_0x12a15b+'.CmListId')['join'](_0x461a00,null,_0x461a00+_0x1f49('0x10')+_0x12a15b+'.'+_0x1f1a8f)['where'](_0x12a15b+_0x1f49('0x32'),_0x2a2233)[_0x1f49('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x1f49('0x11')](_0x1f49('0x33'),selectNotIn(_0x12a15b,_0x461a00,_0x1f1a8f,_0x1f49('0x28'),[_0x1f49('0x34'),'\x22onlyIfOpen\x22']))[_0x1f49('0x11')](_0x1f49('0x33'),selectNotIn(_0x12a15b,_0x461a00,_0x1f1a8f,_0x1f49('0x28'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x3e039c,_0x3c7f0a,_0x541e19,_0x2f7b31){var _0xf3220c=[_0x1f49('0x20'),_0x1f49('0x22'),_0x1f49('0x35'),_0x3c7f0a+'.'+_0x2f7b31,_0x1f49('0x36'),_0x1f49('0x23')];return squel[_0x1f49('0x26')]()[_0x1f49('0x27')](_0x1f49('0x37'))[_0x1f49('0x38')]([_0x1f49('0x29'),_0x1f49('0x2b'),_0x1f49('0x2c'),_0x2f7b31,_0x1f49('0x2d'),_0x1f49('0x2e')],squel[_0x1f49('0xd')]()[_0x1f49('0x39')](_0xf3220c)['from'](_0x3c7f0a)[_0x1f49('0xf')]('cm_contacts',null,_0x1f49('0x31')+_0x3c7f0a+'.CmListId')['join'](_0x541e19,null,_0x541e19+_0x1f49('0x10')+_0x3c7f0a+'.'+_0x2f7b31)['where'](_0x3c7f0a+_0x1f49('0x32'),_0x3e039c)[_0x1f49('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x1f49('0x33'),squel[_0x1f49('0xd')]()[_0x1f49('0x3a')](_0x1f49('0x29'))[_0x1f49('0xe')](_0x1f49('0x37'))['where']('ListId\x20=\x20?',_0x3e039c)['where'](_0x2f7b31+_0x1f49('0x12')+_0x3c7f0a+'.'+_0x2f7b31)))[_0x1f49('0x3b')]();}function insertTzCmHopper(_0xb3089e,_0x560cfd,_0x183f67,_0x2f146c,_0xfe83e3,_0x220394){var _0x4e1bb3=[_0x1f49('0x20'),_0x1f49('0x3c')+_0x220394+_0x1f49('0x3d'),_0x1f49('0x22'),_0x1f49('0x35'),_0x560cfd+'.'+_0x2f146c,_0x1f49('0x36'),_0x1f49('0x23'),'cm_contacts.priority',_0x1f49('0x25'),'\x22'+_0xfe83e3+'\x22'];var _0x3ee921=squel[_0x1f49('0x26')]()[_0x1f49('0x27')](_0x1f49('0x28'))[_0x1f49('0x38')]([_0x1f49('0x29'),_0x1f49('0x2a'),_0x1f49('0x2b'),_0x1f49('0x2c'),_0x2f146c,_0x1f49('0x2d'),_0x1f49('0x2e'),_0x1f49('0x3e'),_0x1f49('0x3f'),'recallme'],squel[_0x1f49('0xd')]()[_0x1f49('0x39')](_0x4e1bb3)[_0x1f49('0xe')](_0x560cfd)[_0x1f49('0xf')]('cm_contacts',null,_0x1f49('0x31')+_0x560cfd+'.CmListId')[_0x1f49('0xf')](_0x183f67,null,_0x183f67+'.id\x20=\x20'+_0x560cfd+'.'+_0x2f146c)['join'](_0x220394,null,_0x220394+_0x1f49('0x10')+_0x560cfd+'.'+_0x2f146c)[_0x1f49('0x11')](_0x560cfd+_0x1f49('0x32'),_0xb3089e)[_0x1f49('0x11')](_0x1f49('0x40'),NOW)['where'](_0x1f49('0x33'),selectNotIn(_0x560cfd,_0x183f67,_0x2f146c,_0x1f49('0x28'),[_0x1f49('0x34'),_0x1f49('0x41')]))['where'](_0x1f49('0x33'),selectNotIn(_0x560cfd,_0x183f67,_0x2f146c,_0x1f49('0x28'),[_0x1f49('0x34')])))[_0x1f49('0x3b')]();return _0x3ee921;}function insertTzCmHopperBlack(_0x32b4bf,_0x3aefd0,_0x1b0092,_0x2b683c){var _0x4c2215=[_0x1f49('0x20'),_0x1f49('0x22'),_0x1f49('0x35'),_0x3aefd0+'.'+_0x2b683c,_0x1f49('0x36'),_0x1f49('0x23')];return squel['insert']()['into']('cm_hopper_black')[_0x1f49('0x38')]([_0x1f49('0x29'),_0x1f49('0x2b'),_0x1f49('0x2c'),_0x2b683c,_0x1f49('0x2d'),_0x1f49('0x2e')],squel['select']()[_0x1f49('0x39')](_0x4c2215)[_0x1f49('0xe')](_0x3aefd0)[_0x1f49('0xf')](_0x1f49('0x30'),null,_0x1f49('0x31')+_0x3aefd0+_0x1f49('0x42'))[_0x1f49('0xf')](_0x1b0092,null,_0x1b0092+_0x1f49('0x10')+_0x3aefd0+'.'+_0x2b683c)[_0x1f49('0x11')](_0x3aefd0+_0x1f49('0x32'),_0x32b4bf)[_0x1f49('0x11')](_0x1f49('0x40'),NOW)[_0x1f49('0x11')](_0x1f49('0x33'),squel[_0x1f49('0xd')]()[_0x1f49('0x3a')](_0x1f49('0x29'))[_0x1f49('0xe')](_0x1f49('0x37'))['where'](_0x1f49('0x43'),_0x32b4bf)[_0x1f49('0x11')](_0x2b683c+_0x1f49('0x12')+_0x3aefd0+'.'+_0x2b683c)))[_0x1f49('0x3b')]();}function insertCmHopperAdditionalPhones(_0x472633){var _0x38d509=['cm_hopper.id',_0x1f49('0x44'),_0x1f49('0x45'),_0x1f49('0x46'),_0x1f49('0x47')];return squel[_0x1f49('0x26')]()[_0x1f49('0x27')](_0x1f49('0x48'))[_0x1f49('0x38')]([_0x1f49('0x49'),_0x1f49('0x29'),_0x1f49('0x4a'),'createdAt','updatedAt'],squel[_0x1f49('0xd')]()[_0x1f49('0x39')](_0x38d509)[_0x1f49('0xe')](_0x1f49('0x28'))['join'](_0x1f49('0x30'),null,_0x1f49('0x4b'))['join']('cm_contact_has_items',null,_0x1f49('0x4c'))[_0x1f49('0x11')](_0x1f49('0x4d'),_0x472633)['where'](_0x1f49('0x40'),NOW))[_0x1f49('0x3b')]();}function insertCmContact(_0x69f9db,_0xdecb74,_0x40e10d,_0x46eecd){var _0x2145b0=_['concat'](_[_0x1f49('0x4e')](_0x46eecd),[_0x1f49('0x2c'),_0x1f49('0x4f'),'createdAt',_0x1f49('0x2e')]);return squel[_0x1f49('0x26')]()[_0x1f49('0x27')]('cm_contacts')[_0x1f49('0x38')](_0x2145b0,squel[_0x1f49('0xd')]()[_0x1f49('0x39')](_0x2145b0)[_0x1f49('0xe')](_0xdecb74)[_0x1f49('0x11')]('('+_0x40e10d[_0x1f49('0xf')](',')+_0x1f49('0x50'),squel[_0x1f49('0xd')]()[_0x1f49('0x39')](_0x40e10d)[_0x1f49('0xe')](_0x1f49('0x30'))[_0x1f49('0x11')](_0x1f49('0x43'),_0x69f9db)[_0x1f49('0x11')](_0x1f49('0x51')))[_0x1f49('0x11')]('id\x20IN\x20?',squel[_0x1f49('0xd')]()[_0x1f49('0x3a')]('MIN(id)',_0x1f49('0x52'))[_0x1f49('0xe')](_0xdecb74)[_0x1f49('0x53')](_0x40e10d['join'](','))))[_0x1f49('0x3b')]();}function handleStop(){logger[_0x1f49('0x54')](_0x1f49('0x55'));stopped=!![];}function handleUncaughtException(_0x11fed1){logger[_0x1f49('0x56')](_0x11fed1['message']);process[_0x1f49('0x57')](0x1);}function handleError(_0x425526,_0x57ee02){stats[_0x1f49('0x58')]['push']({'name':_0x57ee02[_0x1f49('0x59')],'message':_0x57ee02['message'],'row':_0x425526});}function handleQuery(_0x216c7a){logger[_0x1f49('0x54')](_0x216c7a);return db[_0x1f49('0x5a')][_0x1f49('0x5b')](_0x216c7a)[_0x1f49('0x5c')](function(_0x29b0bf){results[_0x1f49('0x15')](_0x29b0bf);})['catch'](function(_0x3f7691){logger[_0x1f49('0x56')](_0x3f7691['message']);});}function updateTzCampaigns(_0x30c828){return new Promise(function(_0x33e991,_0x3e773b){var _0x8be58=squel[_0x1f49('0xd')]()[_0x1f49('0x39')]([_0x1f49('0x5d'),_0x1f49('0x5e')])[_0x1f49('0xe')]('campaigns')['join']('campaigns_has_cm_lists',null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x1f49('0x11')](_0x1f49('0x5f')+_0x30c828);db['sequelize'][_0x1f49('0x5b')](_0x8be58['toString']())[_0x1f49('0x5c')](function(_0x1adbb6){var _0x538522=[];for(var _0x4585e9=0x0;_0x4585e9<_0x1adbb6[_0x1f49('0x18')];_0x4585e9++){_0x538522['push'](getTimezoneData(_0x1adbb6[_0x4585e9],tmp_campaigns));}BPromise[_0x1f49('0x16')](_0x538522)[_0x1f49('0x14')](function(){_0x33e991({'val':0x1});});})[_0x1f49('0x60')](function(_0x21f8bf){logger[_0x1f49('0x56')](_0x21f8bf[_0x1f49('0x61')]);_0x33e991({'val':0x0});});});}function updateTzVoiceQueues(_0x168d08){return new Promise(function(_0x5efbaa,_0x5cb803){var _0x29fa5b=squel[_0x1f49('0xd')]()[_0x1f49('0x39')]([_0x1f49('0x62'),_0x1f49('0x63')])['from'](_0x1f49('0x64'))[_0x1f49('0xf')]('voice_queues_has_cm_lists',null,_0x1f49('0x65'))[_0x1f49('0x11')]('voice_queues_has_cm_lists.CmListId='+_0x168d08);db[_0x1f49('0x5a')]['query'](_0x29fa5b[_0x1f49('0x3b')]())[_0x1f49('0x5c')](function(_0x3cdedc){var _0x3a6e9e=[];for(var _0x300550=0x0;_0x300550<_0x3cdedc[_0x1f49('0x18')];_0x300550++){_0x3a6e9e['push'](getTimezoneData(_0x3cdedc[_0x300550],tmp_voice_queues));}BPromise[_0x1f49('0x16')](_0x3a6e9e)[_0x1f49('0x14')](function(){_0x5efbaa({'val':0x1});});})[_0x1f49('0x60')](function(_0x58316f){logger[_0x1f49('0x56')](_0x58316f[_0x1f49('0x61')]);_0x5efbaa({'val':0x0});});});}function getTimezoneData(_0x49c4d2,_0x55cacf){return new Promise(function(_0x3634b8,_0x591b81){var _0x2ec196=shared[_0x1f49('0x66')];var _0x4fe73e=_0x2ec196[_0x49c4d2[_0x1f49('0x67')]];if(_['isNil'](_0x4fe73e)){_0x3634b8({'ret':0x1});}else{var _0x44f539=_0x4fe73e[_0x1f49('0x68')];var _0x435078=squel[_0x1f49('0x26')]()['into'](_0x55cacf)[_0x1f49('0x69')]('id',_0x49c4d2['id'])['set'](_0x1f49('0x6a'),_0x44f539)[_0x1f49('0x69')](_0x1f49('0x67'),_0x49c4d2[_0x1f49('0x67')])['toString']();return db[_0x1f49('0x5a')]['query'](_0x435078)['spread'](function(_0x376de2){_0x3634b8({'ret':0x1});})['catch'](function(_0x396bf0){logger[_0x1f49('0x56')](_0x396bf0['message']);_0x591b81({'ret':0x1});});}});}function handleTZQuery(_0x251aba){logger[_0x1f49('0x54')](_0x251aba);return db['sequelize'][_0x1f49('0x5b')](_0x251aba)[_0x1f49('0x5c')](function(_0x507964){})[_0x1f49('0x60')](function(_0x5909fd){logger[_0x1f49('0x56')](_0x5909fd['message']);});}function main(_0x3d06b0,_0x1ce0b5,_0x3ba575,_0x19969d){logger['info']('main',_0x3d06b0,JSON[_0x1f49('0x6b')](_0x1ce0b5));process[_0x1f49('0x6c')](_0x1f49('0x6d'));var _0x5c3923=_0x1ce0b5[_0x1f49('0x6e')];var _0x4acc7a=_[_0x1f49('0x6f')](_0x5c3923);var _0x2e3a44=_0x1ce0b5['socket_timestamp'];var _0x66b225=path[_0x1f49('0xf')](config['root'],_0x1f49('0x70'),_0x2e3a44+_0x1f49('0x71'));hasTZ=_[_0x1f49('0x4e')](_0x5c3923)[_0x1f49('0x72')](_0x1f49('0x67'));var _0x174874=_[_0x1f49('0x4e')](_0x5c3923)[_0x1f49('0xf')]();logger[_0x1f49('0x54')](_0x1f49('0x73'),_0x174874);db[_0x1f49('0x74')][_0x1f49('0x75')]({'raw':!![],'attributes':['id',_0x1f49('0x76')]})[_0x1f49('0x14')](function(_0x11fd88){for(var _0x48533b=0x0;_0x48533b<_0x11fd88[_0x1f49('0x18')];_0x48533b++){if(_0x11fd88[_0x48533b][_0x1f49('0x76')]in _0x5c3923){contactItemTypes['push'](_0x11fd88[_0x48533b]);delete _0x4acc7a[_0x11fd88[_0x48533b][_0x1f49('0x76')]];hasAdditionalPhones=!![];}for(var _0x30b19d in _0x5c3923){if(_0x11fd88[_0x48533b][_0x1f49('0x76')]+_0x1f49('0x77')===_0x30b19d){phoneDescriptions['push']({'itemTypeId':_0x11fd88[_0x48533b]['id'],'description':_0x30b19d});delete _0x4acc7a[_0x30b19d];}}}if(hasAdditionalPhones)_0x4acc7a['AdditionalPhones']='';var _0xfccca3=_['keys'](_0x4acc7a)[_0x1f49('0xf')]();logger[_0x1f49('0x54')](_0x1f49('0x73'),_0xfccca3);fs['writeFileSync'](_0x66b225,_0xfccca3+'\x0a');Papa[_0x1f49('0x78')](fs[_0x1f49('0x79')](_0x3d06b0),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2a8f18,_0x3e0ac4){try{for(var _0x4c650d=0x0,_0x14f3e4=[];_0x4c650d<_0x2a8f18['data'][_0x1f49('0x18')];_0x4c650d++){stats[_0x1f49('0x7a')]+=0x1;if(_0x2a8f18[_0x1f49('0x58')][_0x4c650d]){handleError(_0x2a8f18[_0x1f49('0x7b')][_0x4c650d],_0x2a8f18[_0x1f49('0x58')][_0x4c650d]);}else{var _0x392e49=[];var _0x1f6601=[];var _0x82b7c7={};for(var _0x1d8bbb in _0x5c3923){let _0x3e623b=contactItemTypes['find'](_0x4b1536=>_0x4b1536['name']===_0x1d8bbb);let _0x44ca27=contactItemTypes[_0x1f49('0x7c')](_0x4e9e07=>_0x4e9e07[_0x1f49('0x76')]+_0x1f49('0x77')===_0x1d8bbb);if(_[_0x1f49('0x7d')](_0x3e623b)&&_['isNil'](_0x44ca27)){if(_0x5c3923['hasOwnProperty'](_0x1d8bbb)){if(_0x2a8f18['data'][_0x4c650d][_0x5c3923[_0x1d8bbb]]){var _0x1e238b=_[_0x1f49('0x7e')](_0x2a8f18['data'][_0x4c650d][_0x5c3923[_0x1d8bbb]][_0x1f49('0x7f')](/"/g,'\x27'));switch(_0x1d8bbb){case'scheduledat':var _0x22b498=moment(_0x1e238b,_0x1f49('0xb'),!![]);if(_0x22b498[_0x1f49('0x80')]()){_0x14f3e4[_0x1f49('0x15')]('\x22'+_0x1e238b+'\x22');}else{_0x392e49[_0x1f49('0x15')](_0x1f49('0x81'));}break;case _0x1f49('0x3e'):var _0x558209=parseInt(_0x1e238b);_0x1e238b=_[_0x1f49('0x82')](_0x558209)||_0x558209<0x0||_0x558209>0x4?_0x19969d?0x3:0x2:_0x558209;_0x14f3e4[_0x1f49('0x15')]('\x22'+_0x1e238b+'\x22');break;case'UserId':var _0x24f9f7=parseInt(_0x1e238b);if(_[_0x1f49('0x83')](_0x24f9f7)&&_['includes'](_0x3ba575,_0x24f9f7)){_0x14f3e4[_0x1f49('0x15')]('\x22'+_0x24f9f7+'\x22');}else{_0x392e49[_0x1f49('0x15')](_0x1f49('0x84'));}break;case _0x1f49('0x85'):if(isEmail(_0x1e238b)){_0x14f3e4[_0x1f49('0x15')]('\x22'+_0x1e238b+'\x22');}else{_0x392e49[_0x1f49('0x15')](_0x1f49('0x86'));}break;case _0x1f49('0x87'):var _0xf43d7a=moment(_0x1e238b,'YYYY-MM-DD',!![]);if(_0xf43d7a[_0x1f49('0x80')]()){_0x14f3e4['push']('\x22'+_0x1e238b+'\x22');}else{_0x392e49[_0x1f49('0x15')](_0x1f49('0x88'));}break;case _0x1f49('0x67'):var _0x10ee80=shared[_0x1f49('0x66')];var _0x1382a7=_0x10ee80[_0x1e238b];if(!_[_0x1f49('0x7d')](_0x1382a7)){var _0x4aa688=_0x1382a7[_0x1f49('0x68')];_0x14f3e4['push']('\x22'+_0x1e238b+'\x22');_0x14f3e4['push']('\x22'+_0x4aa688+'\x22');}break;default:_0x14f3e4[_0x1f49('0x15')]('\x22'+_0x1e238b+'\x22');}}else{switch(_0x1d8bbb){case _0x1f49('0x89'):case _0x1f49('0x29'):_0x392e49['push'](_0x1d8bbb+_0x1f49('0x8a'));break;default:_0x14f3e4['push']('\x22\x22');}}}}else{var _0x1b698b='';if(!_[_0x1f49('0x7d')](_0x3e623b)){if(!_0x82b7c7[_0x1f49('0x8b')](_0x3e623b['id'])){if(!_[_0x1f49('0x7d')](_0x2a8f18[_0x1f49('0x7b')][_0x4c650d][_0x5c3923[_0x1d8bbb]])){var _0x1e238b=_[_0x1f49('0x7e')](_0x2a8f18[_0x1f49('0x7b')][_0x4c650d][_0x5c3923[_0x1d8bbb]][_0x1f49('0x7f')](/"/g,'\x27'));var _0xbea148=phoneDescriptions['find'](_0x10ea1e=>_0x10ea1e[_0x1f49('0x8c')]===_0x3e623b['id']);if(!_[_0x1f49('0x7d')](_0xbea148)){var _0x5b174f=_[_0x1f49('0x7e')](_0x2a8f18[_0x1f49('0x7b')][_0x4c650d][_0x5c3923[_0xbea148[_0x1f49('0x8d')]]][_0x1f49('0x7f')](/"/g,'\x27'));if(!_[_0x1f49('0x7d')](_0x5b174f))_0x1e238b=_0x1e238b+'§'+_0x5b174f;}if(_0x1b698b=='')_0x1b698b=_0x1e238b;else _0x1b698b+='|'+_0x1e238b;}_0x1f6601[_0x1f49('0x15')](_0x3e623b['id']+':'+_0x1b698b);_0x82b7c7[_0x3e623b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x14f3e4[_0x1f49('0x15')]('\x22'+_0x1f6601[_0x1f49('0xf')](';')+'\x22');}if(_0x392e49[_0x1f49('0x18')]){handleError(_0x2a8f18[_0x1f49('0x7b')][_0x4c650d],{'code':_0x1f49('0x8e'),'message':_0x392e49['join']()});}else{fs['appendFileSync'](_0x66b225,_0x14f3e4[_0x1f49('0xf')]()+'\x0a');}_0x14f3e4=[];}if(!(stats['rows']%0xc8)){socket[_0x1f49('0x8f')](_0x1f49('0x90')+_0x2e3a44,stats);stats[_0x1f49('0x58')]=[];}}if(stopped){logger[_0x1f49('0x54')](_0x1f49('0x91'));_0x3e0ac4['abort']();}}catch(_0x41c26d){handleError(_0x2a8f18[_0x1f49('0x7b')][_0x4c650d],{'code':_0x1f49('0x92'),'message':_0x41c26d['message']});logger[_0x1f49('0x56')]('step',_0x41c26d['message']);}},'complete':function(){try{var _0x162450=[];var _0x2acfa8=[];var _0x289c4a=_0x1f49('0x30');if(_0x1ce0b5['duplicates']&&_0x1ce0b5['duplicates'][_0x1f49('0x18')]){_0x289c4a=_0x1f49('0x93')+_0x2e3a44;_0x162450[_0x1f49('0x15')](_0x1f49('0x94')+_0x289c4a+_0x1f49('0x95'));}tmp_campaigns=_0x1f49('0x96')+_0x2e3a44;tmp_voice_queues='voice_queues_'+_0x2e3a44;_0x2acfa8[_0x1f49('0x15')](_0x1f49('0x94')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x2acfa8[_0x1f49('0x15')](_0x1f49('0x94')+tmp_voice_queues+_0x1f49('0x97'));BPromise[_0x1f49('0x98')](_0x2acfa8,handleTZQuery)[_0x1f49('0x14')](function(_0x21d58b){updateTzCampaigns(_0x1ce0b5[_0x1f49('0x2c')])['then'](function(_0x536112){updateTzVoiceQueues(_0x1ce0b5[_0x1f49('0x2c')])[_0x1f49('0x14')](function(_0xd9fa14){if(hasTZ)_0xfccca3=_0xfccca3[_0x1f49('0x7f')](_0x1f49('0x67'),_0x1f49('0x99'));var _0x5b9438=util[_0x1f49('0xa')]('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',_0x66b225,_0x289c4a,_0xfccca3,_0x1ce0b5['ListId'],_0x1ce0b5[_0x1f49('0x4f')]||null,NOW,NOW);if(_[_0x1f49('0x7d')](_0x5c3923[_0x1f49('0x2a')])){_0x5b9438+=',\x20scheduledAt\x20=\x20NOW()';}_0x162450['push'](_0x5b9438);if(_0x1ce0b5[_0x1f49('0x9a')]&&_0x1ce0b5['duplicates'][_0x1f49('0x18')]){_0x162450[_0x1f49('0x15')](insertCmContact(_0x1ce0b5['ListId'],_0x289c4a,_0x1ce0b5['duplicates'],_0x5c3923));_0x162450[_0x1f49('0x15')](_0x1f49('0x9b')+_0x289c4a+';');}BPromise['each'](_0x162450,handleQuery)[_0x1f49('0x14')](function(_0xd9a5ab){BPromise[_0x1f49('0x16')]([handleAdditionalPhones()])[_0x1f49('0x14')](function(){_0x162450=[];for(var _0x1477e6=0x0;_0x1477e6\x20\x20','root','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists'];(function(_0x3cddaf,_0x38319d){var _0x2c0b77=function(_0x5e74a7){while(--_0x5e74a7){_0x3cddaf['push'](_0x3cddaf['shift']());}};_0x2c0b77(++_0x38319d);}(_0x58a4,0xbf));var _0x458a=function(_0x4e7b46,_0x1e5718){_0x4e7b46=_0x4e7b46-0x0;var _0x309599=_0x58a4[_0x4e7b46];return _0x309599;};'use strict';var fs=require('fs');var path=require(_0x458a('0x0'));var _=require(_0x458a('0x1'));var Papa=require(_0x458a('0x2'));var util=require(_0x458a('0x3'));var BPromise=require(_0x458a('0x4'));var moment=require(_0x458a('0x5'));var squel=require(_0x458a('0x6'));var Redis=require(_0x458a('0x7'));var db=require(_0x458a('0x8'))['db'];var config=require(_0x458a('0x9'));var shared=require(_0x458a('0xa'));var logger=require(_0x458a('0xb'))(_0x458a('0xc'));config['redis']=_['defaults'](config[_0x458a('0xd')],{'host':_0x458a('0xe'),'port':0x18eb});var socket=require(_0x458a('0xf'))(new Redis(config[_0x458a('0xd')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x458a('0x10')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x458a('0x11'));function isEmail(_0x45b79b){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))*$/[_0x458a('0x12')](_0x45b79b);}function selectNotIn(_0x2e1d67,_0x1ff87d,_0x50055c,_0xc1b9b4,_0x804e01){return squel['select']()[_0x458a('0x13')](_0x458a('0x14'))[_0x458a('0x15')](_0xc1b9b4)[_0x458a('0x16')](_0x1ff87d,null,_0x1ff87d+_0x458a('0x17')+_0xc1b9b4+'.'+_0x50055c)['where'](_0xc1b9b4+'.'+_0x50055c+'\x20=\x20'+_0x2e1d67+'.'+_0x50055c)[_0x458a('0x18')](_0x1ff87d+'.dialCheckDuplicateType\x20IN\x20('+_0x804e01[_0x458a('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x44f683,_0x10133b){promisesAdditionalPhones=[];return db[_0x458a('0x19')][_0x458a('0x1a')]({'raw':!![],'attributes':['id',_0x458a('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x4b26be){if(_0x4b26be!==null){var _0x5c7993=[];for(var _0x2faf6a=0x0;_0x2faf6a<_0x4b26be[_0x458a('0x1c')];_0x2faf6a++){var _0x3558b9=_0x4b26be[_0x2faf6a];_0x5c7993['push'](insertAdditionalPhones(_0x3558b9));}}Promise[_0x458a('0x1d')](_0x5c7993)[_0x458a('0x1e')](function(){_0x44f683({'val':0x1});});});});}function insertAdditionalPhones(_0x18504d){return new Promise(function(_0x392986,_0xa91473){var _0x4df9ef=_0x18504d['AdditionalPhones'];var _0x178db9=_0x4df9ef['split'](';');var _0x3302b7=[];orderBy=0x0;for(var _0x398ff2=0x0;_0x398ff2<_0x178db9['length'];_0x398ff2++){_0x3302b7[_0x458a('0x1f')](splitAdditionalPhone(_0x18504d['id'],_0x178db9[_0x398ff2]));}Promise['all'](_0x3302b7)[_0x458a('0x1e')](function(){_0x392986({'val':_0x178db9[_0x458a('0x1c')]});});});}function splitAdditionalPhone(_0x59f44c,_0x641a0b){return new Promise(function(_0xead884,_0x5a2bcb){var _0xa6b8ff=_0x641a0b['split'](':');var _0x370959=_0xa6b8ff[0x0];var _0x5bca42=_0xa6b8ff[0x1];if(!_[_0x458a('0x20')](_0x5bca42)){var _0x5dfc6c=_0x5bca42[_0x458a('0x21')]('|');var _0x911eaf=[];for(var _0xcb0756=0x0;_0xcb0756<_0x5dfc6c[_0x458a('0x1c')];_0xcb0756++){if(_0x5dfc6c[_0xcb0756]!==''){var _0x339b95=_[_0x458a('0x22')](promisesAdditionalPhones,{'contactId':_0x59f44c,'phone':_0x5dfc6c[_0xcb0756]});if(_0x339b95[_0x458a('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x458a('0x1f')]({'contactId':_0x59f44c,'contactTypeId':_0x370959,'phone':_0x5dfc6c[_0xcb0756],'orderBy':orderBy});}}}_0xead884({'ok':0x1});}else _0xead884({'res':0x0});});}function createAdditionalPhone(_0x1f2d0,_0xfc6b24,_0x52efed,_0x327fcb){var _0x21ec38='';var _0x5a55b7='';var _0xb94bd9=_0x52efed[_0x458a('0x21')]('§');_0x21ec38=_0xb94bd9[0x0];if(_0xb94bd9['length']==0x2)_0x5a55b7=_0xb94bd9[0x1];return new Promise(function(_0x5df150,_0x41b23d){return db['CmContactHasItem'][_0x458a('0x23')]({'where':{'CmContactId':_0x1f2d0,'item':_0x21ec38}})[_0x458a('0x1e')](function(_0x223f73){if(_0x223f73){return db['CmContactHasItem'][_0x458a('0x24')]({'ItemTypeId':_0xfc6b24,'description':_0x5a55b7,'OrderBy':_0x327fcb},{'where':{'CmContactId':_0x1f2d0,'item':_0x21ec38}})[_0x458a('0x1e')](function(_0x1426a8){_0x5df150({'res':'updated'});});}else{return db['CmContactHasItem'][_0x458a('0x25')]({'CmContactId':_0x1f2d0,'item':_0x21ec38,'description':_0x5a55b7,'ItemTypeId':_0xfc6b24,'OrderBy':_0x327fcb,'ItemClass':'PHONE'})[_0x458a('0x1e')](function(_0x56e0b9){_0x5df150({'res':_0x458a('0x26')});});}});});}function insertCmHopper(_0xb39224,_0x492843,_0x309a6a,_0x269f53,_0x625ae3){var _0x525caf=[_0x458a('0x27'),_0x458a('0x28'),_0x458a('0x29'),_0x458a('0x2a'),_0x492843+'.'+_0x269f53,_0x458a('0x2b'),'cm_contacts.updatedAt',_0x458a('0x2c'),_0x458a('0x2d'),'\x22'+_0x625ae3+'\x22'];return squel[_0x458a('0x2e')]()[_0x458a('0x2f')](_0x458a('0x30'))[_0x458a('0x31')](['phone',_0x458a('0x32'),_0x458a('0x33'),_0x458a('0x34'),_0x269f53,_0x458a('0x35'),_0x458a('0x36'),_0x458a('0x37'),_0x458a('0x38'),_0x458a('0x39')],squel[_0x458a('0x3a')]()['fields'](_0x525caf)[_0x458a('0x15')](_0x492843)[_0x458a('0x16')](_0x458a('0x3b'),null,_0x458a('0x3c')+_0x492843+_0x458a('0x3d'))[_0x458a('0x16')](_0x309a6a,null,_0x309a6a+_0x458a('0x17')+_0x492843+'.'+_0x269f53)[_0x458a('0x18')](_0x492843+_0x458a('0x3e'),_0xb39224)[_0x458a('0x18')](_0x458a('0x3f'),NOW)[_0x458a('0x18')](_0x458a('0x40'),selectNotIn(_0x492843,_0x309a6a,_0x269f53,_0x458a('0x30'),[_0x458a('0x41'),'\x22onlyIfOpen\x22']))[_0x458a('0x18')](_0x458a('0x40'),selectNotIn(_0x492843,_0x309a6a,_0x269f53,_0x458a('0x30'),[_0x458a('0x41')])))[_0x458a('0x42')]();}function insertCmHopperBlack(_0x46c1de,_0x2ce59a,_0x1224ba,_0x41d125){var _0x44c5ba=[_0x458a('0x27'),'cm_contacts.id',_0x458a('0x2a'),_0x2ce59a+'.'+_0x41d125,_0x458a('0x2b'),'cm_contacts.updatedAt'];return squel[_0x458a('0x2e')]()[_0x458a('0x2f')](_0x458a('0x43'))['fromQuery']([_0x458a('0x14'),_0x458a('0x33'),_0x458a('0x34'),_0x41d125,_0x458a('0x35'),_0x458a('0x36')],squel[_0x458a('0x3a')]()[_0x458a('0x44')](_0x44c5ba)[_0x458a('0x15')](_0x2ce59a)['join'](_0x458a('0x3b'),null,_0x458a('0x3c')+_0x2ce59a+_0x458a('0x3d'))['join'](_0x1224ba,null,_0x1224ba+_0x458a('0x17')+_0x2ce59a+'.'+_0x41d125)[_0x458a('0x18')](_0x2ce59a+'.CmListId\x20=\x20?',_0x46c1de)[_0x458a('0x18')](_0x458a('0x3f'),NOW)[_0x458a('0x18')](_0x458a('0x40'),squel[_0x458a('0x3a')]()['field']('phone')[_0x458a('0x15')](_0x458a('0x43'))[_0x458a('0x18')](_0x458a('0x45'),_0x46c1de)['where'](_0x41d125+_0x458a('0x46')+_0x2ce59a+'.'+_0x41d125)))[_0x458a('0x42')]();}function insertTzCmHopper(_0x5237b9,_0xac25b2,_0x56ec56,_0x40c97d,_0x357851,_0x30d9d9){var _0x595a32=[_0x458a('0x27'),_0x458a('0x47')+_0x30d9d9+_0x458a('0x48'),'cm_contacts.id','cm_contacts.ListId',_0xac25b2+'.'+_0x40c97d,_0x458a('0x2b'),_0x458a('0x49'),_0x458a('0x2c'),'cm_contacts.UserId','\x22'+_0x357851+'\x22'];var _0x5e7a64=squel[_0x458a('0x2e')]()[_0x458a('0x2f')](_0x458a('0x30'))[_0x458a('0x31')]([_0x458a('0x14'),_0x458a('0x32'),_0x458a('0x33'),_0x458a('0x34'),_0x40c97d,_0x458a('0x35'),_0x458a('0x36'),_0x458a('0x37'),_0x458a('0x38'),_0x458a('0x39')],squel[_0x458a('0x3a')]()[_0x458a('0x44')](_0x595a32)[_0x458a('0x15')](_0xac25b2)['join'](_0x458a('0x3b'),null,_0x458a('0x3c')+_0xac25b2+_0x458a('0x3d'))[_0x458a('0x16')](_0x56ec56,null,_0x56ec56+_0x458a('0x17')+_0xac25b2+'.'+_0x40c97d)['join'](_0x30d9d9,null,_0x30d9d9+'.id\x20=\x20'+_0xac25b2+'.'+_0x40c97d)['where'](_0xac25b2+_0x458a('0x3e'),_0x5237b9)['where'](_0x458a('0x3f'),NOW)[_0x458a('0x18')](_0x458a('0x40'),selectNotIn(_0xac25b2,_0x56ec56,_0x40c97d,_0x458a('0x30'),[_0x458a('0x41'),'\x22onlyIfOpen\x22']))['where'](_0x458a('0x40'),selectNotIn(_0xac25b2,_0x56ec56,_0x40c97d,_0x458a('0x30'),[_0x458a('0x41')])))[_0x458a('0x42')]();return _0x5e7a64;}function insertTzCmHopperBlack(_0x2d67b1,_0x5a6650,_0x21c01a,_0x4eed01){var _0xa51e28=['cm_contacts.phone',_0x458a('0x29'),'cm_contacts.ListId',_0x5a6650+'.'+_0x4eed01,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x458a('0x2e')]()[_0x458a('0x2f')]('cm_hopper_black')[_0x458a('0x31')]([_0x458a('0x14'),_0x458a('0x33'),'ListId',_0x4eed01,_0x458a('0x35'),_0x458a('0x36')],squel[_0x458a('0x3a')]()[_0x458a('0x44')](_0xa51e28)[_0x458a('0x15')](_0x5a6650)[_0x458a('0x16')]('cm_contacts',null,_0x458a('0x3c')+_0x5a6650+_0x458a('0x3d'))[_0x458a('0x16')](_0x21c01a,null,_0x21c01a+_0x458a('0x17')+_0x5a6650+'.'+_0x4eed01)[_0x458a('0x18')](_0x5a6650+_0x458a('0x3e'),_0x2d67b1)[_0x458a('0x18')](_0x458a('0x3f'),NOW)['where'](_0x458a('0x40'),squel['select']()[_0x458a('0x13')](_0x458a('0x14'))[_0x458a('0x15')](_0x458a('0x43'))['where']('ListId\x20=\x20?',_0x2d67b1)[_0x458a('0x18')](_0x4eed01+_0x458a('0x46')+_0x5a6650+'.'+_0x4eed01)))[_0x458a('0x42')]();}function insertCmHopperAdditionalPhones(_0x156a22){var _0x1beef7=[_0x458a('0x4a'),'cm_contact_has_items.item',_0x458a('0x4b'),_0x458a('0x4c'),'cm_contact_has_items.updatedAt'];return squel[_0x458a('0x2e')]()['into'](_0x458a('0x4d'))[_0x458a('0x31')]([_0x458a('0x4e'),_0x458a('0x14'),_0x458a('0x4f'),_0x458a('0x35'),_0x458a('0x36')],squel[_0x458a('0x3a')]()['fields'](_0x1beef7)[_0x458a('0x15')](_0x458a('0x30'))['join'](_0x458a('0x3b'),null,_0x458a('0x50'))['join'](_0x458a('0x51'),null,_0x458a('0x52'))['where'](_0x458a('0x53'),_0x156a22)[_0x458a('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x458a('0x42')]();}function insertCmContact(_0x1f95d4,_0xce9756,_0x404d93,_0x541375){var _0x27d1f2=_[_0x458a('0x54')](_[_0x458a('0x55')](_0x541375),['ListId',_0x458a('0x56'),_0x458a('0x35'),_0x458a('0x36')]);return squel[_0x458a('0x2e')]()[_0x458a('0x2f')](_0x458a('0x3b'))[_0x458a('0x31')](_0x27d1f2,squel[_0x458a('0x3a')]()[_0x458a('0x44')](_0x27d1f2)[_0x458a('0x15')](_0xce9756)['where']('('+_0x404d93[_0x458a('0x16')](',')+')\x20NOT\x20IN\x20?',squel[_0x458a('0x3a')]()[_0x458a('0x44')](_0x404d93)[_0x458a('0x15')](_0x458a('0x3b'))[_0x458a('0x18')](_0x458a('0x45'),_0x1f95d4)[_0x458a('0x18')](_0x458a('0x57')))[_0x458a('0x18')](_0x458a('0x58'),squel[_0x458a('0x3a')]()[_0x458a('0x13')](_0x458a('0x59'),_0x458a('0x5a'))[_0x458a('0x15')](_0xce9756)[_0x458a('0x5b')](_0x404d93['join'](','))))[_0x458a('0x42')]();}function handleStop(){logger['info'](_0x458a('0x5c'));stopped=!![];}function handleUncaughtException(_0x2ea9ce){logger['error'](_0x2ea9ce[_0x458a('0x5d')]);process[_0x458a('0x5e')](0x1);}function handleError(_0x350b73,_0x494710){stats[_0x458a('0x5f')][_0x458a('0x1f')]({'name':_0x494710[_0x458a('0x60')],'message':_0x494710[_0x458a('0x5d')],'row':_0x350b73});}function handleQuery(_0x2892e3){logger[_0x458a('0x61')](_0x2892e3);return db['sequelize'][_0x458a('0x62')](_0x2892e3)['spread'](function(_0x567b68){results[_0x458a('0x1f')](_0x567b68);})[_0x458a('0x63')](function(_0xc0538f){logger[_0x458a('0x64')](_0xc0538f[_0x458a('0x5d')]);});}function updateTzCampaigns(_0x434d04){return new Promise(function(_0x42eae7,_0x5aee0d){var _0x3d30e2=squel[_0x458a('0x3a')]()[_0x458a('0x44')]([_0x458a('0x65'),_0x458a('0x66')])[_0x458a('0x15')]('campaigns')['join']('campaigns_has_cm_lists',null,_0x458a('0x67'))['where'](_0x458a('0x68')+_0x434d04);db[_0x458a('0x69')][_0x458a('0x62')](_0x3d30e2[_0x458a('0x42')]())[_0x458a('0x6a')](function(_0x2246e9){var _0x46df7c=[];for(var _0x49f3ee=0x0;_0x49f3ee<_0x2246e9[_0x458a('0x1c')];_0x49f3ee++){_0x46df7c[_0x458a('0x1f')](getTimezoneData(_0x2246e9[_0x49f3ee],tmp_campaigns));}BPromise['all'](_0x46df7c)[_0x458a('0x1e')](function(){_0x42eae7({'val':0x1});});})['catch'](function(_0xd11ebe){logger['error'](_0xd11ebe[_0x458a('0x5d')]);_0x42eae7({'val':0x0});});});}function updateTzVoiceQueues(_0x177457){return new Promise(function(_0xce45b5,_0x1fe8a1){var _0x5ab84f=squel[_0x458a('0x3a')]()[_0x458a('0x44')]([_0x458a('0x6b'),_0x458a('0x6c')])[_0x458a('0x15')](_0x458a('0x6d'))[_0x458a('0x16')](_0x458a('0x6e'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x458a('0x18')](_0x458a('0x6f')+_0x177457);db[_0x458a('0x69')][_0x458a('0x62')](_0x5ab84f['toString']())[_0x458a('0x6a')](function(_0x45569b){var _0x579352=[];for(var _0x32bc59=0x0;_0x32bc59<_0x45569b[_0x458a('0x1c')];_0x32bc59++){_0x579352[_0x458a('0x1f')](getTimezoneData(_0x45569b[_0x32bc59],tmp_voice_queues));}BPromise[_0x458a('0x1d')](_0x579352)[_0x458a('0x1e')](function(){_0xce45b5({'val':0x1});});})['catch'](function(_0x34d7a6){logger[_0x458a('0x64')](_0x34d7a6[_0x458a('0x5d')]);_0xce45b5({'val':0x0});});});}function getTimezoneData(_0x1dbaa7,_0x2006d7){return new Promise(function(_0x46ac5c,_0x2eecf0){var _0x573f46=shared[_0x458a('0x70')];var _0x4d3790=_0x573f46[_0x1dbaa7[_0x458a('0x71')]];if(_[_0x458a('0x20')](_0x4d3790)){_0x46ac5c({'ret':0x1});}else{var _0x1fa730=_0x4d3790['utcOffset'];var _0x3471bb=squel['insert']()['into'](_0x2006d7)[_0x458a('0x72')]('id',_0x1dbaa7['id'])[_0x458a('0x72')]('offset',_0x1fa730)['set'](_0x458a('0x71'),_0x1dbaa7[_0x458a('0x71')])[_0x458a('0x42')]();return db[_0x458a('0x69')][_0x458a('0x62')](_0x3471bb)['spread'](function(_0x102331){_0x46ac5c({'ret':0x1});})['catch'](function(_0x4389fb){logger[_0x458a('0x64')](_0x4389fb[_0x458a('0x5d')]);_0x2eecf0({'ret':0x1});});}});}function handleTZQuery(_0x54adb7){logger[_0x458a('0x61')](_0x54adb7);return db[_0x458a('0x69')]['query'](_0x54adb7)[_0x458a('0x6a')](function(_0x5bf72f){})[_0x458a('0x63')](function(_0x3fc263){logger[_0x458a('0x64')](_0x3fc263[_0x458a('0x5d')]);});}function main(_0x55a431,_0x5efcd7,_0x4caa30,_0x4a97c4){logger[_0x458a('0x61')](_0x458a('0x73'),_0x55a431,JSON[_0x458a('0x74')](_0x5efcd7));process[_0x458a('0x75')](_0x458a('0x76'));var _0x2eb92e=_0x5efcd7['binding'];var _0x3244a4=_[_0x458a('0x77')](_0x2eb92e);var _0xe744f5=_0x5efcd7[_0x458a('0x78')];var _0x17099e=path[_0x458a('0x16')](config['root'],_0x458a('0x79'),_0xe744f5+_0x458a('0x7a'));hasTZ=_[_0x458a('0x55')](_0x2eb92e)['includes'](_0x458a('0x71'));var _0x42d2a2=_[_0x458a('0x55')](_0x2eb92e)['join']();logger['info'](_0x458a('0x7b'),_0x42d2a2);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id','name']})['then'](function(_0x548699){for(var _0x3f14bf=0x0;_0x3f14bf<_0x548699['length'];_0x3f14bf++){if(_0x548699[_0x3f14bf][_0x458a('0x7c')]in _0x2eb92e){contactItemTypes[_0x458a('0x1f')](_0x548699[_0x3f14bf]);delete _0x3244a4[_0x548699[_0x3f14bf][_0x458a('0x7c')]];hasAdditionalPhones=!![];}for(var _0xfcb712 in _0x2eb92e){if(_0x548699[_0x3f14bf][_0x458a('0x7c')]+_0x458a('0x7d')===_0xfcb712){phoneDescriptions['push']({'itemTypeId':_0x548699[_0x3f14bf]['id'],'description':_0xfcb712});delete _0x3244a4[_0xfcb712];}}}if(hasAdditionalPhones)_0x3244a4[_0x458a('0x1b')]='';var _0x59ad9c=_[_0x458a('0x55')](_0x3244a4)['join']();logger[_0x458a('0x61')](_0x458a('0x7b'),_0x59ad9c);fs['writeFileSync'](_0x17099e,_0x59ad9c+'\x0a');Papa['parse'](fs['createReadStream'](_0x55a431),{'header':!![],'skipEmptyLines':!![],'step':function(_0x84906,_0x384c46){try{for(var _0x21d8a9=0x0,_0xb4224d=[];_0x21d8a9<_0x84906[_0x458a('0x7e')]['length'];_0x21d8a9++){stats[_0x458a('0x7f')]+=0x1;if(_0x84906[_0x458a('0x5f')][_0x21d8a9]){handleError(_0x84906[_0x458a('0x7e')][_0x21d8a9],_0x84906[_0x458a('0x5f')][_0x21d8a9]);}else{var _0x34e76e=[];var _0x2fa49e=[];var _0x2646ae={};for(var _0x3f1232 in _0x2eb92e){let _0x52429f=contactItemTypes[_0x458a('0x80')](_0x3ec574=>_0x3ec574[_0x458a('0x7c')]===_0x3f1232);let _0x45a134=contactItemTypes[_0x458a('0x80')](_0x514db0=>_0x514db0[_0x458a('0x7c')]+'_description'===_0x3f1232);if(_['isNil'](_0x52429f)&&_['isNil'](_0x45a134)){if(_0x2eb92e['hasOwnProperty'](_0x3f1232)){if(_0x84906[_0x458a('0x7e')][_0x21d8a9][_0x2eb92e[_0x3f1232]]){var _0x3f187b=_[_0x458a('0x81')](_0x84906[_0x458a('0x7e')][_0x21d8a9][_0x2eb92e[_0x3f1232]]['replace'](/"/g,'\x27'));switch(_0x3f1232){case _0x458a('0x32'):var _0x4514df=moment(_0x3f187b,_0x458a('0x11'),!![]);if(_0x4514df[_0x458a('0x82')]()){_0xb4224d['push']('\x22'+_0x3f187b+'\x22');}else{_0x34e76e['push'](_0x458a('0x83'));}break;case _0x458a('0x37'):var _0x26026d=parseInt(_0x3f187b);_0x3f187b=_[_0x458a('0x84')](_0x26026d)||_0x26026d<0x0||_0x26026d>0x4?_0x4a97c4?0x3:0x2:_0x26026d;_0xb4224d['push']('\x22'+_0x3f187b+'\x22');break;case _0x458a('0x38'):var _0xe19173=parseInt(_0x3f187b);if(_[_0x458a('0x85')](_0xe19173)&&_[_0x458a('0x86')](_0x4caa30,_0xe19173)){_0xb4224d[_0x458a('0x1f')]('\x22'+_0xe19173+'\x22');}else{_0x34e76e[_0x458a('0x1f')](_0x458a('0x87'));}break;case _0x458a('0x88'):if(isEmail(_0x3f187b)){_0xb4224d[_0x458a('0x1f')]('\x22'+_0x3f187b+'\x22');}else{_0x34e76e[_0x458a('0x1f')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x3d58a4=moment(_0x3f187b,_0x458a('0x89'),!![]);if(_0x3d58a4[_0x458a('0x82')]()){_0xb4224d[_0x458a('0x1f')]('\x22'+_0x3f187b+'\x22');}else{_0x34e76e[_0x458a('0x1f')](_0x458a('0x8a'));}break;case _0x458a('0x71'):var _0x583d8a=shared[_0x458a('0x70')];var _0x5aa440=_0x583d8a[_0x3f187b];if(!_[_0x458a('0x20')](_0x5aa440)){var _0x1d7ecc=_0x5aa440[_0x458a('0x8b')];_0xb4224d['push']('\x22'+_0x3f187b+'\x22');_0xb4224d['push']('\x22'+_0x1d7ecc+'\x22');}break;default:_0xb4224d[_0x458a('0x1f')]('\x22'+_0x3f187b+'\x22');}}else{switch(_0x3f1232){case _0x458a('0x8c'):case _0x458a('0x14'):_0x34e76e[_0x458a('0x1f')](_0x3f1232+_0x458a('0x8d'));break;default:_0xb4224d['push']('\x22\x22');}}}}else{var _0x391854='';if(!_[_0x458a('0x20')](_0x52429f)){if(!_0x2646ae[_0x458a('0x8e')](_0x52429f['id'])){if(!_[_0x458a('0x20')](_0x84906[_0x458a('0x7e')][_0x21d8a9][_0x2eb92e[_0x3f1232]])){var _0x3f187b=_[_0x458a('0x81')](_0x84906[_0x458a('0x7e')][_0x21d8a9][_0x2eb92e[_0x3f1232]][_0x458a('0x8f')](/"/g,'\x27'));var _0x52b844=phoneDescriptions[_0x458a('0x80')](_0x543b46=>_0x543b46[_0x458a('0x90')]===_0x52429f['id']);if(!_[_0x458a('0x20')](_0x52b844)){var _0x125337=_['trim'](_0x84906['data'][_0x21d8a9][_0x2eb92e[_0x52b844[_0x458a('0x91')]]]['replace'](/"/g,'\x27'));if(!_[_0x458a('0x20')](_0x125337))_0x3f187b=_0x3f187b+'§'+_0x125337;}if(_0x391854=='')_0x391854=_0x3f187b;else _0x391854+='|'+_0x3f187b;}_0x2fa49e['push'](_0x52429f['id']+':'+_0x391854);_0x2646ae[_0x52429f['id']]=0x1;}}}}if(hasAdditionalPhones){_0xb4224d[_0x458a('0x1f')]('\x22'+_0x2fa49e[_0x458a('0x16')](';')+'\x22');}if(_0x34e76e[_0x458a('0x1c')]){handleError(_0x84906['data'][_0x21d8a9],{'code':_0x458a('0x92'),'message':_0x34e76e[_0x458a('0x16')]()});}else{fs['appendFileSync'](_0x17099e,_0xb4224d[_0x458a('0x16')]()+'\x0a');}_0xb4224d=[];}if(!(stats['rows']%0xc8)){socket[_0x458a('0x93')](_0x458a('0x94')+_0xe744f5,stats);stats[_0x458a('0x5f')]=[];}}if(stopped){logger['info'](_0x458a('0x95'));_0x384c46[_0x458a('0x96')]();}}catch(_0x9f7d4){handleError(_0x84906[_0x458a('0x7e')][_0x21d8a9],{'code':_0x458a('0x97'),'message':_0x9f7d4[_0x458a('0x5d')]});logger['error'](_0x458a('0x98'),_0x9f7d4[_0x458a('0x5d')]);}},'complete':function(){try{var _0x57cd4b=[];var _0x13db18=[];var _0x187bc8=_0x458a('0x3b');if(_0x5efcd7['duplicates']&&_0x5efcd7[_0x458a('0x99')][_0x458a('0x1c')]){_0x187bc8=_0x458a('0x9a')+_0xe744f5;_0x57cd4b['push'](_0x458a('0x9b')+_0x187bc8+_0x458a('0x9c'));}tmp_campaigns=_0x458a('0x9d')+_0xe744f5;tmp_voice_queues=_0x458a('0x9e')+_0xe744f5;_0x13db18[_0x458a('0x1f')](_0x458a('0x9b')+tmp_campaigns+_0x458a('0x9f'));_0x13db18[_0x458a('0x1f')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x458a('0x9f'));BPromise['each'](_0x13db18,handleTZQuery)['then'](function(_0x57c3c6){updateTzCampaigns(_0x5efcd7[_0x458a('0x34')])['then'](function(_0x1e4ba3){updateTzVoiceQueues(_0x5efcd7['ListId'])[_0x458a('0x1e')](function(_0x58fa9b){if(hasTZ)_0x59ad9c=_0x59ad9c[_0x458a('0x8f')](_0x458a('0x71'),_0x458a('0xa0'));var _0x3a3882=util['format'](_0x458a('0xa1'),_0x17099e,_0x187bc8,_0x59ad9c,_0x5efcd7[_0x458a('0x34')],_0x5efcd7[_0x458a('0x56')]||null,NOW,NOW);if(_['isNil'](_0x2eb92e[_0x458a('0x32')])){_0x3a3882+=_0x458a('0xa2');}_0x57cd4b[_0x458a('0x1f')](_0x3a3882);if(_0x5efcd7[_0x458a('0x99')]&&_0x5efcd7['duplicates'][_0x458a('0x1c')]){_0x57cd4b['push'](insertCmContact(_0x5efcd7['ListId'],_0x187bc8,_0x5efcd7['duplicates'],_0x2eb92e));_0x57cd4b[_0x458a('0x1f')](_0x458a('0xa3')+_0x187bc8+';');}BPromise['each'](_0x57cd4b,handleQuery)[_0x458a('0x1e')](function(_0x49297c){BPromise[_0x458a('0x1d')]([handleAdditionalPhones()])['then'](function(){_0x57cd4b=[];for(var _0x310a09=0x0;_0x310a09\x20\x20','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','path','util','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','sequelize'];(function(_0x322bef,_0x4890d4){var _0x229e60=function(_0x45f89b){while(--_0x45f89b){_0x322bef['push'](_0x322bef['shift']());}};_0x229e60(++_0x4890d4);}(_0x60a5,0x83));var _0x560a=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x60a5[_0x55f8b4];return _0x2475f9;};'use strict';var fs=require('fs');var path=require(_0x560a('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0x560a('0x1'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x560a('0x2'));var Redis=require(_0x560a('0x3'));var db=require(_0x560a('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x560a('0x5'))(_0x560a('0x6'));config[_0x560a('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x560a('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x560a('0x8')](_0x560a('0x9'));var tempTableName=_0x560a('0xa')+moment()['format']('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x359da4){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'](_0x359da4);}function selectNotIn(_0x2e3b88,_0x13c6a3,_0x4f7df3,_0x12e51e,_0x36e345){return squel[_0x560a('0xb')]()[_0x560a('0xc')](_0x560a('0xd'))[_0x560a('0xe')](_0x12e51e)[_0x560a('0xf')](_0x13c6a3,null,_0x13c6a3+_0x560a('0x10')+_0x12e51e+'.'+_0x4f7df3)[_0x560a('0x11')](_0x12e51e+'.'+_0x4f7df3+'\x20=\x20'+_0x2e3b88+'.'+_0x4f7df3)[_0x560a('0x11')](_0x13c6a3+_0x560a('0x12')+_0x36e345[_0x560a('0xf')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5c7c29,_0x3d1795){promisesAdditionalPhones=[];promisesContact=[];return db[_0x560a('0x13')][_0x560a('0x14')](_0x560a('0x15')+tempTableName)['spread'](function(_0x28c09d){if(_0x28c09d!==null){var _0xe757e3=[];for(var _0x14f430=0x0;_0x14f430<_0x28c09d[_0x560a('0x16')];_0x14f430++){var _0x594793=_0x28c09d[_0x14f430];if(!_['isNil'](_0x594793[_0x560a('0xd')])){if(!_[_0x560a('0x17')](_0x594793[_0x560a('0x18')]))_0xe757e3[_0x560a('0x19')](insertAdditionalPhones(_0x594793));promisesContact['push']({'contact':_0x594793});}}}Promise[_0x560a('0x1a')](_0xe757e3)[_0x560a('0x1b')](function(){_0x5c7c29({'val':0x1});});})[_0x560a('0x1c')](function(_0x2b484f){logger[_0x560a('0x1d')](_0x2b484f['message']);});});}function insertAdditionalPhones(_0x32ff83){return new Promise(function(_0x155c2b,_0x1d2e4c){var _0xbda620=_0x32ff83[_0x560a('0x18')];if(_[_0x560a('0x17')](_0xbda620))_0x1d2e4c({'val':0x0});else{var _0x214153=_0xbda620['split'](';');var _0x292a5a=[];orderBy=0x0;for(var _0x1c1048=0x0;_0x1c1048<_0x214153[_0x560a('0x16')];_0x1c1048++){_0x292a5a[_0x560a('0x19')](splitAdditionalPhone(_0x32ff83['id'],_0x214153[_0x1c1048]));}Promise[_0x560a('0x1a')](_0x292a5a)[_0x560a('0x1b')](function(){_0x155c2b({'val':_0x214153[_0x560a('0x16')]});});}});}function splitAdditionalPhone(_0x423822,_0x4c2d8a){return new Promise(function(_0x4ea5a2,_0x535737){var _0x306510=_0x4c2d8a[_0x560a('0x1e')](':');var _0x4c53c5=_0x306510[0x0];var _0x47b251=_0x306510[0x1];if(_0x47b251!==''){var _0x3ff302=_0x47b251['split']('|');var _0x405eeb=[];for(var _0xc94611=0x0;_0xc94611<_0x3ff302['length'];_0xc94611++){if(_0x3ff302[_0xc94611]!==''){var _0x6ad203=_[_0x560a('0x1f')](promisesAdditionalPhones,{'contactId':_0x423822,'phone':_0x3ff302[_0xc94611]});if(_0x6ad203['length']==0x0){orderBy++;promisesAdditionalPhones[_0x560a('0x19')]({'contactId':_0x423822,'contactTypeId':_0x4c53c5,'phone':_0x3ff302[_0xc94611],'orderBy':orderBy});}}}_0x4ea5a2({'ok':0x1});}else _0x4ea5a2({'res':0x0});});}function createAdditionalPhone(_0x266717,_0x36efee,_0x305bd9,_0x40a668){var _0x4a21cf='';var _0x46ee1f='';var _0x3c4af2=_0x305bd9['split']('§');_0x4a21cf=_0x3c4af2[0x0];if(_0x3c4af2[_0x560a('0x16')]==0x2)_0x46ee1f=_0x3c4af2[0x1];return new Promise(function(_0x1fe911,_0xf4a166){return db[_0x560a('0x20')][_0x560a('0x21')]({'where':{'CmContactId':_0x266717,'item':_0x4a21cf}})[_0x560a('0x1b')](function(_0xbebcf8){if(_0xbebcf8){return db['CmContactHasItem'][_0x560a('0x22')]({'ItemTypeId':_0x36efee,'description':_0x46ee1f,'OrderBy':_0x40a668},{'where':{'CmContactId':_0x266717,'item':_0x4a21cf}})[_0x560a('0x1b')](function(_0x5dc239){_0x1fe911({'res':'updated'});});}else{return db[_0x560a('0x20')][_0x560a('0x23')]({'CmContactId':_0x266717,'item':_0x4a21cf,'ItemTypeId':_0x36efee,'description':_0x46ee1f,'OrderBy':_0x40a668,'ItemClass':_0x560a('0x24')})[_0x560a('0x1b')](function(_0x5c42c9){_0x1fe911({'res':'inserted'});});}});});}function updateContact(_0x50cae2){return new Promise(function(_0x8dbc4a,_0xb1d417){var _0xd78b35=_0x50cae2['id'];delete _0x50cae2['id'];return db[_0x560a('0x25')][_0x560a('0x22')](_0x50cae2,{'where':{'id':_0xd78b35}})[_0x560a('0x1b')](function(_0x25aff8){updatedRows+=0x1;return db[_0x560a('0x26')][_0x560a('0x22')]({'phone':_0x50cae2[_0x560a('0xd')]},{'where':{'ContactId':_0xd78b35}})['then'](function(_0x3b7615){_0x8dbc4a({'ret':'OK'});});});});}function insertCmHopper(_0x17403f,_0x1b9f48,_0x2b3c21,_0x155428,_0x5b4023){var _0x52fab0=[_0x560a('0x27'),_0x560a('0x28'),_0x560a('0x29'),_0x560a('0x2a'),_0x1b9f48+'.'+_0x155428,_0x560a('0x2b'),'cm_contacts.updatedAt',_0x560a('0x2c'),_0x560a('0x2d'),'\x22'+_0x5b4023+'\x22'];return squel['insert']()[_0x560a('0x2e')](_0x560a('0x2f'))[_0x560a('0x30')]([_0x560a('0xd'),_0x560a('0x31'),_0x560a('0x32'),'ListId',_0x155428,_0x560a('0x33'),_0x560a('0x34'),_0x560a('0x35'),_0x560a('0x36'),'recallme'],squel[_0x560a('0xb')]()['fields'](_0x52fab0)[_0x560a('0xe')](_0x1b9f48)[_0x560a('0xf')](_0x560a('0x37'),null,_0x560a('0x38')+_0x1b9f48+_0x560a('0x39'))[_0x560a('0xf')](_0x2b3c21,null,_0x2b3c21+_0x560a('0x10')+_0x1b9f48+'.'+_0x155428)[_0x560a('0x11')](_0x1b9f48+_0x560a('0x3a'),_0x17403f)[_0x560a('0x11')](_0x560a('0x3b'),NOW)[_0x560a('0x11')](_0x560a('0x3c'),selectNotIn(_0x1b9f48,_0x2b3c21,_0x155428,'cm_hopper',[_0x560a('0x3d'),_0x560a('0x3e')]))[_0x560a('0x11')](_0x560a('0x3c'),selectNotIn(_0x1b9f48,_0x2b3c21,_0x155428,'cm_hopper',[_0x560a('0x3d')])))['toString']();}function insertCmHopperBlack(_0x52623f,_0x21e123,_0x335244,_0x11c8bd){var _0x462d62=[_0x560a('0x27'),_0x560a('0x29'),'cm_contacts.ListId',_0x21e123+'.'+_0x11c8bd,_0x560a('0x2b'),_0x560a('0x3f')];return squel['insert']()['into']('cm_hopper_black')[_0x560a('0x30')]([_0x560a('0xd'),_0x560a('0x32'),'ListId',_0x11c8bd,'createdAt',_0x560a('0x34')],squel['select']()[_0x560a('0x40')](_0x462d62)[_0x560a('0xe')](_0x21e123)[_0x560a('0xf')]('cm_contacts',null,_0x560a('0x38')+_0x21e123+_0x560a('0x39'))[_0x560a('0xf')](_0x335244,null,_0x335244+'.id\x20=\x20'+_0x21e123+'.'+_0x11c8bd)[_0x560a('0x11')](_0x21e123+_0x560a('0x3a'),_0x52623f)[_0x560a('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x560a('0x3c'),squel['select']()[_0x560a('0xc')]('phone')[_0x560a('0xe')](_0x560a('0x41'))[_0x560a('0x11')](_0x560a('0x42'),_0x52623f)[_0x560a('0x11')](_0x11c8bd+_0x560a('0x43'),_0x21e123+'.'+_0x11c8bd)))[_0x560a('0x44')]();}function insertCmHopperAdditionalPhones(_0x23caa2){var _0x5b1c1d=[_0x560a('0x45'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0x560a('0x46'),_0x560a('0x47')];return squel[_0x560a('0x48')]()[_0x560a('0x2e')]('cm_hopper_additional_phones')[_0x560a('0x30')]([_0x560a('0x49'),'phone',_0x560a('0x4a'),_0x560a('0x33'),'updatedAt'],squel[_0x560a('0xb')]()[_0x560a('0x40')](_0x5b1c1d)[_0x560a('0xe')](_0x560a('0x2f'))['join'](_0x560a('0x37'),null,_0x560a('0x4b'))[_0x560a('0xf')](_0x560a('0x4c'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x560a('0x11')](_0x560a('0x4d'),_0x23caa2)[_0x560a('0x11')](_0x560a('0x3b'),NOW))[_0x560a('0x44')]();}function insertCmContact(_0x1281c5,_0x283af8,_0x3b958a,_0x500dd2){var _0xa7036c=_[_0x560a('0x4e')](_[_0x560a('0x4f')](_0x500dd2),[_0x560a('0x50'),'CompanyId',_0x560a('0x33'),'updatedAt']);return squel[_0x560a('0x48')]()['into'](_0x560a('0x37'))['fromQuery'](_0xa7036c,squel[_0x560a('0xb')]()[_0x560a('0x40')](_0xa7036c)[_0x560a('0xe')](_0x283af8)[_0x560a('0x11')]('('+_0x3b958a[_0x560a('0xf')](',')+_0x560a('0x51'),squel['select']()['fields'](_0x3b958a)[_0x560a('0xe')](_0x560a('0x37'))[_0x560a('0x11')](_0x560a('0x42'),_0x1281c5))[_0x560a('0x11')](_0x560a('0x52'),squel[_0x560a('0xb')]()[_0x560a('0xc')](_0x560a('0x53'),'min_id')[_0x560a('0xe')](_0x283af8)[_0x560a('0x54')](_0x3b958a['join'](','))))[_0x560a('0x44')]();}function handleStop(){logger[_0x560a('0x55')](_0x560a('0x56'));stopped=!![];}function handleUncaughtException(_0x564c8a){logger[_0x560a('0x1d')](_0x564c8a['message']);process[_0x560a('0x57')](0x1);}function handleError(_0x299bb8,_0x127c5e){stats['errors'][_0x560a('0x19')]({'name':_0x127c5e[_0x560a('0x58')],'message':_0x127c5e[_0x560a('0x59')],'row':_0x299bb8});}function handleQuery(_0x442a40){logger['info'](_0x442a40);return db[_0x560a('0x13')][_0x560a('0x14')](_0x442a40)[_0x560a('0x5a')](function(_0x5b4f15){results[_0x560a('0x19')](_0x5b4f15);})['catch'](function(_0x56df20){logger['error'](_0x56df20[_0x560a('0x59')]);});}function main(_0x200474,_0x470b29,_0x25a7a3,_0x7da643){logger[_0x560a('0x55')](_0x560a('0x5b'),_0x200474,JSON['stringify'](_0x470b29));process[_0x560a('0x5c')](_0x560a('0x5d'));var _0x11f8ab=_0x470b29[_0x560a('0x5e')];var _0x50c05c=_[_0x560a('0x5f')](_0x11f8ab);var _0x3e8800=_0x470b29[_0x560a('0x60')];var _0x2ea8b8=path[_0x560a('0xf')](config[_0x560a('0x61')],_0x560a('0x62'),_0x3e8800+'.csv');logger[_0x560a('0x55')]('body',_0x470b29);db[_0x560a('0x63')]['findAll']({'raw':!![],'attributes':['id',_0x560a('0x64')]})[_0x560a('0x1b')](function(_0x3cc787){for(var _0x590cd5=0x0;_0x590cd5<_0x3cc787[_0x560a('0x16')];_0x590cd5++){if(_0x3cc787[_0x590cd5][_0x560a('0x64')]in _0x11f8ab){contactItemTypes[_0x560a('0x19')](_0x3cc787[_0x590cd5]);delete _0x50c05c[_0x3cc787[_0x590cd5][_0x560a('0x64')]];hasAdditionalPhones=!![];}for(var _0x48a7ce in _0x11f8ab){if(_0x3cc787[_0x590cd5][_0x560a('0x64')]+_0x560a('0x65')===_0x48a7ce){phoneDescriptions[_0x560a('0x19')]({'itemTypeId':_0x3cc787[_0x590cd5]['id'],'description':_0x48a7ce});delete _0x50c05c[_0x48a7ce];}}}if(hasAdditionalPhones)_0x50c05c[_0x560a('0x18')]='';var _0xea6982=_['keys'](_0x50c05c)[_0x560a('0xf')]();logger['info'](_0x560a('0x66'),_0xea6982);fs[_0x560a('0x67')](_0x2ea8b8,_0xea6982+'\x0a');Papa[_0x560a('0x68')](fs['createReadStream'](_0x200474),{'header':!![],'skipEmptyLines':!![],'step':function(_0x177f33,_0x15a58d){try{for(var _0x1b326c=0x0,_0x1f2aeb=[];_0x1b326c<_0x177f33['data']['length'];_0x1b326c++){stats['rows']+=0x1;if(_0x177f33['errors'][_0x1b326c]){handleError(_0x177f33[_0x560a('0x69')][_0x1b326c],_0x177f33[_0x560a('0x6a')][_0x1b326c]);}else{var _0x8c479f=[];var _0x5075b0=[];var _0xb992b3={};for(var _0x457266 in _0x11f8ab){let _0x34f8c5=contactItemTypes[_0x560a('0x6b')](_0x2b4027=>_0x2b4027[_0x560a('0x64')]===_0x457266);let _0x14809e=contactItemTypes[_0x560a('0x6b')](_0x1aa4b7=>_0x1aa4b7[_0x560a('0x64')]+'_description'===_0x457266);if(_[_0x560a('0x17')](_0x34f8c5)&&_[_0x560a('0x17')](_0x14809e)){if(_0x11f8ab[_0x560a('0x6c')](_0x457266)){if(_0x177f33[_0x560a('0x69')][_0x1b326c][_0x11f8ab[_0x457266]]){var _0x245cb5=_[_0x560a('0x6d')](_0x177f33['data'][_0x1b326c][_0x11f8ab[_0x457266]]['replace'](/"/g,'\x27'));switch(_0x457266){case _0x560a('0x31'):var _0x45340a=moment(_0x245cb5,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x45340a[_0x560a('0x6e')]()){_0x1f2aeb[_0x560a('0x19')]('\x22'+_0x245cb5+'\x22');}else{_0x8c479f[_0x560a('0x19')](_0x560a('0x6f'));}break;case'priority':var _0x361fac=parseInt(_0x245cb5);_0x245cb5=_[_0x560a('0x70')](_0x361fac)||_0x361fac<0x0||_0x361fac>0x4?_0x7da643?0x3:0x2:_0x361fac;_0x1f2aeb[_0x560a('0x19')]('\x22'+_0x245cb5+'\x22');break;case _0x560a('0x36'):var _0x9ef7a2=parseInt(_0x245cb5);if(_['isNumber'](_0x9ef7a2)&&_[_0x560a('0x71')](_0x25a7a3,_0x9ef7a2)){_0x1f2aeb[_0x560a('0x19')]('\x22'+_0x9ef7a2+'\x22');}else{_0x8c479f[_0x560a('0x19')](_0x560a('0x72'));}break;case _0x560a('0x73'):if(isEmail(_0x245cb5)){_0x1f2aeb['push']('\x22'+_0x245cb5+'\x22');}else{_0x8c479f[_0x560a('0x19')](_0x560a('0x74'));}break;case _0x560a('0x75'):var _0x3850e3=moment(_0x245cb5,_0x560a('0x76'),!![]);if(_0x3850e3[_0x560a('0x6e')]()){_0x1f2aeb['push']('\x22'+_0x245cb5+'\x22');}else{_0x8c479f['push'](_0x560a('0x77'));}break;default:_0x1f2aeb[_0x560a('0x19')]('\x22'+_0x245cb5+'\x22');}}else{switch(_0x457266){case _0x560a('0x78'):case _0x560a('0xd'):_0x8c479f[_0x560a('0x19')](_0x457266+_0x560a('0x79'));break;default:_0x1f2aeb[_0x560a('0x19')]('\x22\x22');}}}}else{var _0x40abf5='';if(!_[_0x560a('0x17')](_0x34f8c5)){if(!_0xb992b3['hasOwnProperty'](_0x34f8c5['id'])){for(var _0x538850=0x0;_0x538850<_0x11f8ab[_0x457266][_0x560a('0x16')];_0x538850++){var _0x245cb5=_[_0x560a('0x6d')](_0x177f33['data'][_0x1b326c][_0x11f8ab[_0x457266][_0x538850]][_0x560a('0x7a')](/"/g,'\x27'));var _0x506ba7=phoneDescriptions[_0x560a('0x6b')](_0x1b4693=>_0x1b4693[_0x560a('0x7b')]===_0x34f8c5['id']);if(!_[_0x560a('0x17')](_0x506ba7)){var _0x36af8b=_[_0x560a('0x6d')](_0x177f33[_0x560a('0x69')][_0x1b326c][_0x11f8ab[_0x506ba7[_0x560a('0x7c')]][0x0]][_0x560a('0x7a')](/"/g,'\x27'));if(!_[_0x560a('0x17')](_0x36af8b))_0x245cb5=_0x245cb5+'§'+_0x36af8b;}if(_0x40abf5=='')_0x40abf5=_0x245cb5;else _0x40abf5+='|'+_0x245cb5;}_0x5075b0['push'](_0x34f8c5['id']+':'+_0x40abf5);_0xb992b3[_0x34f8c5['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1f2aeb['push']('\x22'+_0x5075b0['join'](';')+'\x22');}if(_0x8c479f[_0x560a('0x16')]){handleError(_0x177f33['data'][_0x1b326c],{'code':'SystemRow','message':_0x8c479f[_0x560a('0xf')]()});}else{fs[_0x560a('0x7d')](_0x2ea8b8,_0x1f2aeb[_0x560a('0xf')]()+'\x0a');}_0x1f2aeb=[];}if(!(stats[_0x560a('0x7e')]%0xc8)){socket['emit'](_0x560a('0x7f')+_0x3e8800,stats);stats[_0x560a('0x6a')]=[];}}if(stopped){logger[_0x560a('0x55')](_0x560a('0x80'));_0x15a58d[_0x560a('0x81')]();}}catch(_0x498616){handleError(_0x177f33['data'][_0x1b326c],{'code':_0x560a('0x82'),'message':_0x498616[_0x560a('0x59')]});logger['error'](_0x560a('0x83'),_0x498616['message']);}},'complete':function(){try{var _0x173564=[];var _0x1094ff=tempTableName;_0x173564[_0x560a('0x19')](_0x560a('0x84')+_0x1094ff+_0x560a('0x85'));logger[_0x560a('0x55')](_0x560a('0x86'),contactItemTypes[_0x560a('0x16')]);var _0x4b8c6d=util[_0x560a('0x8')](_0x560a('0x87'),_0x2ea8b8,_0x1094ff,_0xea6982,_0x470b29[_0x560a('0x50')],_0x470b29['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x11f8ab[_0x560a('0x31')])){_0x4b8c6d+=_0x560a('0x88');}_0x173564['push'](_0x4b8c6d);BPromise['each'](_0x173564,handleQuery)['then'](function(_0x1009da){BPromise[_0x560a('0x1a')]([handleAdditionalPhones()])[_0x560a('0x1b')](function(){_0x173564=[];for(var _0x4360cd=0x0;_0x4360cd\x20\x20'];(function(_0x4b6cc8,_0x355e5b){var _0x5c4743=function(_0x68d0f6){while(--_0x68d0f6){_0x4b6cc8['push'](_0x4b6cc8['shift']());}};_0x5c4743(++_0x355e5b);}(_0xb5bf,0x1d7));var _0xfb5b=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xb5bf[_0x307d86];return _0x361745;};'use strict';var fs=require('fs');var path=require(_0xfb5b('0x0'));var _=require(_0xfb5b('0x1'));var Papa=require(_0xfb5b('0x2'));var util=require('util');var BPromise=require(_0xfb5b('0x3'));var moment=require('moment');var squel=require(_0xfb5b('0x4'));var Redis=require(_0xfb5b('0x5'));var db=require(_0xfb5b('0x6'))['db'];var config=require(_0xfb5b('0x7'));var logger=require(_0xfb5b('0x8'))(_0xfb5b('0x9'));config['redis']=_[_0xfb5b('0xa')](config[_0xfb5b('0xb')],{'host':_0xfb5b('0xc'),'port':0x18eb});var socket=require(_0xfb5b('0xd'))(new Redis(config[_0xfb5b('0xb')]));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()[_0xfb5b('0xe')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName='cm_contacts_temp_'+moment()['format'](_0xfb5b('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4e0c73){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))*$/[_0xfb5b('0x10')](_0x4e0c73);}function selectNotIn(_0x5a881c,_0x5af168,_0x9989e8,_0x2c6416,_0x3392f9){return squel['select']()[_0xfb5b('0x11')](_0xfb5b('0x12'))[_0xfb5b('0x13')](_0x2c6416)[_0xfb5b('0x14')](_0x5af168,null,_0x5af168+_0xfb5b('0x15')+_0x2c6416+'.'+_0x9989e8)[_0xfb5b('0x16')](_0x2c6416+'.'+_0x9989e8+_0xfb5b('0x17')+_0x5a881c+'.'+_0x9989e8)[_0xfb5b('0x16')](_0x5af168+'.dialCheckDuplicateType\x20IN\x20('+_0x3392f9[_0xfb5b('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1d96d8,_0x74e06f){promisesAdditionalPhones=[];promisesContact=[];return db[_0xfb5b('0x18')]['query'](_0xfb5b('0x19')+tempTableName)[_0xfb5b('0x1a')](function(_0x1b2908){if(_0x1b2908!==null){var _0x5e7898=[];for(var _0x350661=0x0;_0x350661<_0x1b2908[_0xfb5b('0x1b')];_0x350661++){var _0x1da7c9=_0x1b2908[_0x350661];if(!_[_0xfb5b('0x1c')](_0x1da7c9[_0xfb5b('0x12')])){if(!_[_0xfb5b('0x1c')](_0x1da7c9['AdditionalPhones']))_0x5e7898[_0xfb5b('0x1d')](insertAdditionalPhones(_0x1da7c9));promisesContact['push']({'contact':_0x1da7c9});}}}Promise['all'](_0x5e7898)[_0xfb5b('0x1e')](function(){_0x1d96d8({'val':0x1});});})['catch'](function(_0x2a3fbc){logger[_0xfb5b('0x1f')](_0x2a3fbc[_0xfb5b('0x20')]);});});}function insertAdditionalPhones(_0x17d942){return new Promise(function(_0x1bb368,_0x2d2be1){var _0x3612a1=_0x17d942[_0xfb5b('0x21')];if(_[_0xfb5b('0x1c')](_0x3612a1))_0x2d2be1({'val':0x0});else{var _0x255e47=_0x3612a1['split'](';');var _0x3a6ade=[];orderBy=0x0;for(var _0x48137d=0x0;_0x48137d<_0x255e47[_0xfb5b('0x1b')];_0x48137d++){_0x3a6ade[_0xfb5b('0x1d')](splitAdditionalPhone(_0x17d942['id'],_0x255e47[_0x48137d]));}Promise['all'](_0x3a6ade)[_0xfb5b('0x1e')](function(){_0x1bb368({'val':_0x255e47[_0xfb5b('0x1b')]});});}});}function splitAdditionalPhone(_0x4ea97f,_0x2cd4b9){return new Promise(function(_0x40f702,_0x357377){var _0x4e8d99=_0x2cd4b9[_0xfb5b('0x22')](':');var _0xdd4c5e=_0x4e8d99[0x0];var _0x58c4a7=_0x4e8d99[0x1];if(_0x58c4a7!==''){var _0x311bff=_0x58c4a7['split']('|');var _0x2345ec=[];for(var _0x261d95=0x0;_0x261d95<_0x311bff[_0xfb5b('0x1b')];_0x261d95++){if(_0x311bff[_0x261d95]!==''){var _0x4d19eb=_['filter'](promisesAdditionalPhones,{'contactId':_0x4ea97f,'phone':_0x311bff[_0x261d95]});if(_0x4d19eb[_0xfb5b('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0xfb5b('0x1d')]({'contactId':_0x4ea97f,'contactTypeId':_0xdd4c5e,'phone':_0x311bff[_0x261d95],'orderBy':orderBy});}}}_0x40f702({'ok':0x1});}else _0x40f702({'res':0x0});});}function createAdditionalPhone(_0x3ac1f8,_0x248ac7,_0x4348da,_0x3281b5){var _0x1bd64b='';var _0x57b3c1='';var _0x36e376=_0x4348da['split']('§');_0x1bd64b=_0x36e376[0x0];if(_0x36e376[_0xfb5b('0x1b')]==0x2)_0x57b3c1=_0x36e376[0x1];return new Promise(function(_0x193898,_0x3c0fd1){return db[_0xfb5b('0x23')][_0xfb5b('0x24')]({'where':{'CmContactId':_0x3ac1f8,'item':_0x1bd64b}})[_0xfb5b('0x1e')](function(_0x254179){if(_0x254179){return db['CmContactHasItem'][_0xfb5b('0x25')]({'ItemTypeId':_0x248ac7,'description':_0x57b3c1,'OrderBy':_0x3281b5},{'where':{'CmContactId':_0x3ac1f8,'item':_0x1bd64b}})['then'](function(_0x48077c){_0x193898({'res':_0xfb5b('0x26')});});}else{return db['CmContactHasItem'][_0xfb5b('0x27')]({'CmContactId':_0x3ac1f8,'item':_0x1bd64b,'ItemTypeId':_0x248ac7,'description':_0x57b3c1,'OrderBy':_0x3281b5,'ItemClass':_0xfb5b('0x28')})[_0xfb5b('0x1e')](function(_0x43dc70){_0x193898({'res':_0xfb5b('0x29')});});}});});}function updateContact(_0x1e4bfe){return new Promise(function(_0x233936,_0x3da698){var _0x1457e7=_0x1e4bfe['id'];delete _0x1e4bfe['id'];return db['CmContact'][_0xfb5b('0x25')](_0x1e4bfe,{'where':{'id':_0x1457e7}})[_0xfb5b('0x1e')](function(_0x5e687d){updatedRows+=0x1;return db[_0xfb5b('0x2a')][_0xfb5b('0x25')]({'phone':_0x1e4bfe[_0xfb5b('0x12')]},{'where':{'ContactId':_0x1457e7}})[_0xfb5b('0x1e')](function(_0x3b9435){_0x233936({'ret':'OK'});});});});}function insertCmHopper(_0x30ec4d,_0xd832c2,_0x514ce1,_0x2fbcbc,_0x4f6e40){var _0x223b21=[_0xfb5b('0x2b'),'cm_contacts.scheduledat',_0xfb5b('0x2c'),_0xfb5b('0x2d'),_0xd832c2+'.'+_0x2fbcbc,_0xfb5b('0x2e'),_0xfb5b('0x2f'),_0xfb5b('0x30'),_0xfb5b('0x31'),'\x22'+_0x4f6e40+'\x22'];return squel[_0xfb5b('0x32')]()[_0xfb5b('0x33')](_0xfb5b('0x34'))[_0xfb5b('0x35')]([_0xfb5b('0x12'),_0xfb5b('0x36'),_0xfb5b('0x37'),_0xfb5b('0x38'),_0x2fbcbc,_0xfb5b('0x39'),_0xfb5b('0x3a'),_0xfb5b('0x3b'),_0xfb5b('0x3c'),_0xfb5b('0x3d')],squel[_0xfb5b('0x3e')]()[_0xfb5b('0x3f')](_0x223b21)[_0xfb5b('0x13')](_0xd832c2)['join'](_0xfb5b('0x40'),null,_0xfb5b('0x41')+_0xd832c2+_0xfb5b('0x42'))[_0xfb5b('0x14')](_0x514ce1,null,_0x514ce1+_0xfb5b('0x15')+_0xd832c2+'.'+_0x2fbcbc)[_0xfb5b('0x16')](_0xd832c2+_0xfb5b('0x43'),_0x30ec4d)[_0xfb5b('0x16')](_0xfb5b('0x44'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xd832c2,_0x514ce1,_0x2fbcbc,_0xfb5b('0x34'),[_0xfb5b('0x45'),'\x22onlyIfOpen\x22']))[_0xfb5b('0x16')](_0xfb5b('0x46'),selectNotIn(_0xd832c2,_0x514ce1,_0x2fbcbc,_0xfb5b('0x34'),[_0xfb5b('0x45')])))[_0xfb5b('0x47')]();}function insertCmHopperBlack(_0x5ba944,_0xef08ad,_0x3e1b0b,_0x5d5d0c){var _0x2e83aa=[_0xfb5b('0x2b'),_0xfb5b('0x2c'),'cm_contacts.ListId',_0xef08ad+'.'+_0x5d5d0c,_0xfb5b('0x2e'),_0xfb5b('0x2f')];return squel[_0xfb5b('0x32')]()['into'](_0xfb5b('0x48'))[_0xfb5b('0x35')]([_0xfb5b('0x12'),_0xfb5b('0x37'),_0xfb5b('0x38'),_0x5d5d0c,_0xfb5b('0x39'),'updatedAt'],squel[_0xfb5b('0x3e')]()[_0xfb5b('0x3f')](_0x2e83aa)[_0xfb5b('0x13')](_0xef08ad)[_0xfb5b('0x14')](_0xfb5b('0x40'),null,'cm_contacts.ListId\x20=\x20'+_0xef08ad+_0xfb5b('0x42'))[_0xfb5b('0x14')](_0x3e1b0b,null,_0x3e1b0b+_0xfb5b('0x15')+_0xef08ad+'.'+_0x5d5d0c)[_0xfb5b('0x16')](_0xef08ad+_0xfb5b('0x43'),_0x5ba944)[_0xfb5b('0x16')](_0xfb5b('0x44'),NOW)[_0xfb5b('0x16')](_0xfb5b('0x46'),squel[_0xfb5b('0x3e')]()[_0xfb5b('0x11')](_0xfb5b('0x12'))[_0xfb5b('0x13')](_0xfb5b('0x48'))[_0xfb5b('0x16')](_0xfb5b('0x49'),_0x5ba944)[_0xfb5b('0x16')](_0x5d5d0c+_0xfb5b('0x4a'),_0xef08ad+'.'+_0x5d5d0c)))[_0xfb5b('0x47')]();}function insertCmHopperAdditionalPhones(_0x18cf14){var _0x43faa4=[_0xfb5b('0x4b'),_0xfb5b('0x4c'),_0xfb5b('0x4d'),_0xfb5b('0x4e'),'cm_contact_has_items.updatedAt'];return squel[_0xfb5b('0x32')]()['into'](_0xfb5b('0x4f'))[_0xfb5b('0x35')]([_0xfb5b('0x50'),'phone',_0xfb5b('0x51'),_0xfb5b('0x39'),'updatedAt'],squel[_0xfb5b('0x3e')]()[_0xfb5b('0x3f')](_0x43faa4)['from'](_0xfb5b('0x34'))[_0xfb5b('0x14')]('cm_contacts',null,_0xfb5b('0x52'))['join'](_0xfb5b('0x53'),null,_0xfb5b('0x54'))[_0xfb5b('0x16')]('cm_hopper.ListId\x20=\x20?',_0x18cf14)[_0xfb5b('0x16')](_0xfb5b('0x44'),NOW))[_0xfb5b('0x47')]();}function insertCmContact(_0x502699,_0x3181da,_0x3bc3b2,_0x3e39ce){var _0x2995fd=_[_0xfb5b('0x55')](_[_0xfb5b('0x56')](_0x3e39ce),[_0xfb5b('0x38'),_0xfb5b('0x57'),_0xfb5b('0x39'),_0xfb5b('0x3a')]);return squel[_0xfb5b('0x32')]()[_0xfb5b('0x33')](_0xfb5b('0x40'))[_0xfb5b('0x35')](_0x2995fd,squel[_0xfb5b('0x3e')]()[_0xfb5b('0x3f')](_0x2995fd)[_0xfb5b('0x13')](_0x3181da)['where']('('+_0x3bc3b2[_0xfb5b('0x14')](',')+_0xfb5b('0x58'),squel[_0xfb5b('0x3e')]()[_0xfb5b('0x3f')](_0x3bc3b2)[_0xfb5b('0x13')](_0xfb5b('0x40'))[_0xfb5b('0x16')](_0xfb5b('0x49'),_0x502699))[_0xfb5b('0x16')](_0xfb5b('0x59'),squel[_0xfb5b('0x3e')]()[_0xfb5b('0x11')](_0xfb5b('0x5a'),'min_id')['from'](_0x3181da)[_0xfb5b('0x5b')](_0x3bc3b2[_0xfb5b('0x14')](','))))[_0xfb5b('0x47')]();}function handleStop(){logger[_0xfb5b('0x5c')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xad840a){logger[_0xfb5b('0x1f')](_0xad840a[_0xfb5b('0x20')]);process[_0xfb5b('0x5d')](0x1);}function handleError(_0x1da4e3,_0x23959e){stats['errors']['push']({'name':_0x23959e[_0xfb5b('0x5e')],'message':_0x23959e['message'],'row':_0x1da4e3});}function handleQuery(_0x198143){logger[_0xfb5b('0x5c')](_0x198143);return db[_0xfb5b('0x18')][_0xfb5b('0x5f')](_0x198143)[_0xfb5b('0x1a')](function(_0x1bd162){results[_0xfb5b('0x1d')](_0x1bd162);})[_0xfb5b('0x60')](function(_0xfdecb){logger[_0xfb5b('0x1f')](_0xfdecb[_0xfb5b('0x20')]);});}function main(_0x14e77d,_0x433db6,_0x413350,_0x480f7c){logger[_0xfb5b('0x5c')](_0xfb5b('0x61'),_0x14e77d,JSON['stringify'](_0x433db6));process[_0xfb5b('0x62')](_0xfb5b('0x63'));var _0x3e589d=_0x433db6[_0xfb5b('0x64')];var _0x18eb89=_['clone'](_0x3e589d);var _0x5c1e15=_0x433db6[_0xfb5b('0x65')];var _0x195403=path[_0xfb5b('0x14')](config[_0xfb5b('0x66')],_0xfb5b('0x67'),_0x5c1e15+_0xfb5b('0x68'));logger[_0xfb5b('0x5c')](_0xfb5b('0x69'),_0x433db6);db[_0xfb5b('0x6a')][_0xfb5b('0x6b')]({'raw':!![],'attributes':['id','name']})[_0xfb5b('0x1e')](function(_0x25a0dd){for(var _0x8b26b1=0x0;_0x8b26b1<_0x25a0dd[_0xfb5b('0x1b')];_0x8b26b1++){if(_0x25a0dd[_0x8b26b1][_0xfb5b('0x6c')]in _0x3e589d){contactItemTypes[_0xfb5b('0x1d')](_0x25a0dd[_0x8b26b1]);delete _0x18eb89[_0x25a0dd[_0x8b26b1][_0xfb5b('0x6c')]];hasAdditionalPhones=!![];}for(var _0x2ff7bf in _0x3e589d){if(_0x25a0dd[_0x8b26b1][_0xfb5b('0x6c')]+_0xfb5b('0x6d')===_0x2ff7bf){phoneDescriptions['push']({'itemTypeId':_0x25a0dd[_0x8b26b1]['id'],'description':_0x2ff7bf});delete _0x18eb89[_0x2ff7bf];}}}if(hasAdditionalPhones)_0x18eb89[_0xfb5b('0x21')]='';var _0x58611c=_[_0xfb5b('0x56')](_0x18eb89)[_0xfb5b('0x14')]();logger[_0xfb5b('0x5c')](_0xfb5b('0x6e'),_0x58611c);fs['writeFileSync'](_0x195403,_0x58611c+'\x0a');Papa['parse'](fs[_0xfb5b('0x6f')](_0x14e77d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x10fece,_0xc1c22){try{for(var _0x53d5a1=0x0,_0x5326c5=[];_0x53d5a1<_0x10fece[_0xfb5b('0x70')]['length'];_0x53d5a1++){stats[_0xfb5b('0x71')]+=0x1;if(_0x10fece[_0xfb5b('0x72')][_0x53d5a1]){handleError(_0x10fece[_0xfb5b('0x70')][_0x53d5a1],_0x10fece[_0xfb5b('0x72')][_0x53d5a1]);}else{var _0x3e2b36=[];var _0x1fc4d5=[];var _0xc61cfe={};for(var _0xc09d52 in _0x3e589d){let _0x3207b9=contactItemTypes[_0xfb5b('0x73')](_0x2dc0e6=>_0x2dc0e6[_0xfb5b('0x6c')]===_0xc09d52);let _0x3b78a4=contactItemTypes[_0xfb5b('0x73')](_0x3b8de1=>_0x3b8de1['name']+'_description'===_0xc09d52);if(_['isNil'](_0x3207b9)&&_[_0xfb5b('0x1c')](_0x3b78a4)){if(_0x3e589d[_0xfb5b('0x74')](_0xc09d52)){if(_0x10fece['data'][_0x53d5a1][_0x3e589d[_0xc09d52]]){var _0x13ab57=_[_0xfb5b('0x75')](_0x10fece[_0xfb5b('0x70')][_0x53d5a1][_0x3e589d[_0xc09d52]]['replace'](/"/g,'\x27'));switch(_0xc09d52){case'scheduledat':var _0x314ce0=moment(_0x13ab57,_0xfb5b('0x76'),!![]);if(_0x314ce0[_0xfb5b('0x77')]()){_0x5326c5['push']('\x22'+_0x13ab57+'\x22');}else{_0x3e2b36[_0xfb5b('0x1d')](_0xfb5b('0x78'));}break;case _0xfb5b('0x3b'):var _0x53db4f=parseInt(_0x13ab57);_0x13ab57=_[_0xfb5b('0x79')](_0x53db4f)||_0x53db4f<0x0||_0x53db4f>0x4?_0x480f7c?0x3:0x2:_0x53db4f;_0x5326c5['push']('\x22'+_0x13ab57+'\x22');break;case _0xfb5b('0x3c'):var _0x3b0dec=parseInt(_0x13ab57);if(_['isNumber'](_0x3b0dec)&&_[_0xfb5b('0x7a')](_0x413350,_0x3b0dec)){_0x5326c5[_0xfb5b('0x1d')]('\x22'+_0x3b0dec+'\x22');}else{_0x3e2b36[_0xfb5b('0x1d')](_0xfb5b('0x7b'));}break;case _0xfb5b('0x7c'):if(isEmail(_0x13ab57)){_0x5326c5[_0xfb5b('0x1d')]('\x22'+_0x13ab57+'\x22');}else{_0x3e2b36[_0xfb5b('0x1d')](_0xfb5b('0x7d'));}break;case _0xfb5b('0x7e'):var _0x5a64fe=moment(_0x13ab57,_0xfb5b('0x7f'),!![]);if(_0x5a64fe[_0xfb5b('0x77')]()){_0x5326c5[_0xfb5b('0x1d')]('\x22'+_0x13ab57+'\x22');}else{_0x3e2b36[_0xfb5b('0x1d')](_0xfb5b('0x80'));}break;default:_0x5326c5[_0xfb5b('0x1d')]('\x22'+_0x13ab57+'\x22');}}else{switch(_0xc09d52){case'firstName':case _0xfb5b('0x12'):_0x3e2b36[_0xfb5b('0x1d')](_0xc09d52+_0xfb5b('0x81'));break;default:_0x5326c5['push']('\x22\x22');}}}}else{var _0x520bfb='';if(!_[_0xfb5b('0x1c')](_0x3207b9)){if(!_0xc61cfe['hasOwnProperty'](_0x3207b9['id'])){for(var _0x5d07d7=0x0;_0x5d07d7<_0x3e589d[_0xc09d52][_0xfb5b('0x1b')];_0x5d07d7++){var _0x13ab57=_[_0xfb5b('0x75')](_0x10fece['data'][_0x53d5a1][_0x3e589d[_0xc09d52][_0x5d07d7]][_0xfb5b('0x82')](/"/g,'\x27'));var _0x3c5900=phoneDescriptions[_0xfb5b('0x73')](_0x17a8b3=>_0x17a8b3['itemTypeId']===_0x3207b9['id']);if(!_[_0xfb5b('0x1c')](_0x3c5900)){var _0x384b3b=_['trim'](_0x10fece[_0xfb5b('0x70')][_0x53d5a1][_0x3e589d[_0x3c5900[_0xfb5b('0x83')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xfb5b('0x1c')](_0x384b3b))_0x13ab57=_0x13ab57+'§'+_0x384b3b;}if(_0x520bfb=='')_0x520bfb=_0x13ab57;else _0x520bfb+='|'+_0x13ab57;}_0x1fc4d5[_0xfb5b('0x1d')](_0x3207b9['id']+':'+_0x520bfb);_0xc61cfe[_0x3207b9['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5326c5[_0xfb5b('0x1d')]('\x22'+_0x1fc4d5[_0xfb5b('0x14')](';')+'\x22');}if(_0x3e2b36[_0xfb5b('0x1b')]){handleError(_0x10fece[_0xfb5b('0x70')][_0x53d5a1],{'code':_0xfb5b('0x84'),'message':_0x3e2b36[_0xfb5b('0x14')]()});}else{fs[_0xfb5b('0x85')](_0x195403,_0x5326c5[_0xfb5b('0x14')]()+'\x0a');}_0x5326c5=[];}if(!(stats[_0xfb5b('0x71')]%0xc8)){socket[_0xfb5b('0x86')](_0xfb5b('0x87')+_0x5c1e15,stats);stats[_0xfb5b('0x72')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0xc1c22['abort']();}}catch(_0x51632e){handleError(_0x10fece[_0xfb5b('0x70')][_0x53d5a1],{'code':_0xfb5b('0x88'),'message':_0x51632e[_0xfb5b('0x20')]});logger[_0xfb5b('0x1f')](_0xfb5b('0x89'),_0x51632e[_0xfb5b('0x20')]);}},'complete':function(){try{var _0x598839=[];var _0x2a396e=tempTableName;_0x598839[_0xfb5b('0x1d')](_0xfb5b('0x8a')+_0x2a396e+_0xfb5b('0x8b'));logger[_0xfb5b('0x5c')](_0xfb5b('0x8c'),contactItemTypes[_0xfb5b('0x1b')]);var _0x31060d=util['format'](_0xfb5b('0x8d'),_0x195403,_0x2a396e,_0x58611c,_0x433db6[_0xfb5b('0x38')],_0x433db6[_0xfb5b('0x57')]||null,NOW,NOW);if(_[_0xfb5b('0x1c')](_0x3e589d[_0xfb5b('0x36')])){_0x31060d+=_0xfb5b('0x8e');}_0x598839[_0xfb5b('0x1d')](_0x31060d);BPromise[_0xfb5b('0x8f')](_0x598839,handleQuery)['then'](function(_0x411ab7){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x598839=[];for(var _0x400929=0x0;_0x400929=_0x32e0c4){return _0x3de1bd[_0x3bb2('0x15')](0x193)[_0x3bb2('0x16')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4ab981)});}_0x555710();})[_0x3bb2('0x17')](function(_0x567052){_0x555710(_0x567052);});});}function isUserLimit(){return isLimit(_0x3bb2('0x18'),0x1,db['User'],{'where':{'$or':[{'role':_0x3bb2('0x19')},{'role':'user'}]}});}exports[_0x3bb2('0x1a')]=isUserLimit; \ No newline at end of file +var _0x3397=['parse','hasOwnProperty','then','count','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final'];(function(_0x25e25d,_0x2341f2){var _0x3a26bb=function(_0x417fc0){while(--_0x417fc0){_0x25e25d['push'](_0x25e25d['shift']());}};_0x3a26bb(++_0x2341f2);}(_0x3397,0xe3));var _0x7339=function(_0x59cda9,_0x47d4c4){_0x59cda9=_0x59cda9-0x0;var _0x26c18f=_0x3397[_0x59cda9];return _0x26c18f;};'use strict';var crypto=require(_0x7339('0x0'));var util=require(_0x7339('0x1'));var compose=require('composable-middleware');var db=require(_0x7339('0x2'))['db'];var config=require(_0x7339('0x3'));function getValueFromLicense(_0x19c4b7,_0x3950f2){if(_0x19c4b7&&_0x3950f2){if(_0x3950f2[_0x7339('0x4')]&&_0x3950f2[_0x7339('0x5')]){var _0x3e1aa9=_0x3950f2[_0x7339('0x4')];var _0x1954ba=_0x3950f2[_0x7339('0x5')];var _0x969904=_0x3e1aa9['split']('-')[0x4];var _0x399f07=_0x3e1aa9['split']('-')[0x0];var _0x536914=crypto['createDecipher'](_0x7339('0x6'),util[_0x7339('0x7')](_0x7339('0x8'),_0x969904,_0x3e1aa9,_0x399f07));var _0x50c26c=_0x536914[_0x7339('0x9')](_0x1954ba,_0x7339('0xa'),_0x7339('0xb'));_0x50c26c+=_0x536914[_0x7339('0xc')](_0x7339('0xb'));var _0x3222a4=JSON[_0x7339('0xd')](_0x50c26c);return _0x3222a4[_0x7339('0xe')](_0x19c4b7)?_0x3222a4[_0x19c4b7]:null;}}return null;}function isLimit(_0x5a0c6f,_0x364f20,_0x574343,_0x236de0){var _0x42b479=_0x364f20;return compose()['use'](function(_0x323ad2,_0x5bf1be,_0x1f4510){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0x7339('0xf')](function(_0x5dea95){var _0x43e089=getValueFromLicense(_0x5a0c6f,_0x5dea95);return _0x43e089?_0x43e089:_0x42b479;})[_0x7339('0xf')](function(_0x561529){_0x42b479=_0x561529;return _0x574343[_0x7339('0x10')](_0x236de0);})[_0x7339('0xf')](function(_0x47ddc0){if(_0x47ddc0>=_0x42b479){return _0x5bf1be['status'](0x193)['json']({'message':util[_0x7339('0x7')](_0x7339('0x11'),_0x5a0c6f)});}_0x1f4510();})[_0x7339('0x12')](function(_0x5cf388){_0x1f4510(_0x5cf388);});});}function isUserLimit(){return isLimit(_0x7339('0x13'),0x1,db[_0x7339('0x14')],{'where':{'$or':[{'role':_0x7339('0x15')},{'role':_0x7339('0x16')}]}});}exports[_0x7339('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index fe6a367..ac1c584 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 _0x007c=['$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','$gt','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','length','split','slice','forEach','shift','filter','indexOf','conditions','push','DATE','operator','$eq','$between','value'];(function(_0x58b14b,_0x5ab912){var _0x5aec73=function(_0x43cdc1){while(--_0x43cdc1){_0x58b14b['push'](_0x58b14b['shift']());}};_0x5aec73(++_0x5ab912);}(_0x007c,0x1b1));var _0xc007=function(_0x40c0b7,_0x284a92){_0x40c0b7=_0x40c0b7-0x0;var _0x5369b8=_0x007c[_0x40c0b7];return _0x5369b8;};'use strict';var _=require(_0xc007('0x0'));var moment=require(_0xc007('0x1'));exports[_0xc007('0x2')]=function(_0x3eb90c){var _0x2c4cda={'conditions':[]};_0x2c4cda[_0xc007('0x3')]=_[_0xc007('0x4')](_0x3eb90c,_0xc007('0x5'))?'or':_0xc007('0x6');var _0x5242a4=_0x3eb90c[_0xc007('0x7')](_0xc007('0x8'),'')['replace'](_0xc007('0x5'),'')['split']('||');for(var _0x2cd724=0x0;_0x2cd724<_0x5242a4[_0xc007('0x9')];_0x2cd724++){var _0x8896cb=_0x5242a4[_0x2cd724][_0xc007('0xa')](':=');var _0x28eba0=_0x8896cb[0x0];var _0x534604=_0x8896cb[_0xc007('0xb')](0x1);_0x534604[_0xc007('0xc')](function(_0x435687){var _0xd3d8b6=_0x435687[_0xc007('0xa')]('[')[_0xc007('0xd')]();var _0x22bc08=_0x435687['match'](/\[(.*?)\]/g);_0x22bc08[_0xc007('0xc')](function(_0x28d83f){var _0x30959d=_0x28d83f[_0xc007('0xa')]('[')[_0xc007('0xe')](function(_0x1337f2){return _0x1337f2[_0xc007('0xf')](']')>-0x1;})['map'](function(_0x2c1b43){return _0x2c1b43[_0xc007('0xa')](']')[0x0];})[0x0];_0x2c4cda[_0xc007('0x10')][_0xc007('0x11')]({'field':_0x28eba0,'operator':_0xd3d8b6,'value':_0x30959d});});});}return _0x2c4cda;};exports['buildExpression']=function(_0x4c2a43,_0x5254e7,_0x1aa661){var _0xfb49bc={};if(_0x5254e7===_0xc007('0x12')){if(_0x1aa661[_0xc007('0x13')]===_0xc007('0x14')){_0x1aa661[_0xc007('0x13')]=_0xc007('0x15');_0x1aa661[_0xc007('0x16')]+=','+_0x1aa661[_0xc007('0x16')];}else if(_['includes'](['$gt',_0xc007('0x17')],_0x1aa661[_0xc007('0x13')])){_0x1aa661['value']=moment(_0x1aa661[_0xc007('0x16')])[_0xc007('0x18')](0x1,_0xc007('0x19'))[_0xc007('0x1a')](_0xc007('0x1b'));}}if(_0x1aa661[_0xc007('0x1c')]){_0x5254e7=_0x1aa661['castTo'];_0xfb49bc[_0xc007('0x1d')]=_0xc007('0x1e')+_0x4c2a43+'.'+_0x1aa661[_0xc007('0x1f')]+_0xc007('0x20')+_0x1aa661[_0xc007('0x1c')]+')\x20'+parseOperator(_0x1aa661['operator']);}else{_0xfb49bc['text']=_0x4c2a43+'.'+_0x1aa661[_0xc007('0x1f')]+'\x20'+parseOperator(_0x1aa661['operator']);}if(_[_0xc007('0x21')]([_0xc007('0x22'),_0xc007('0x23')],_0x1aa661[_0xc007('0x13')]))_0xfb49bc[_0xc007('0x1d')]='('+_0xfb49bc['text']+_0xc007('0x24')+_0x4c2a43+'.'+_0x1aa661[_0xc007('0x1f')]+_0xc007('0x25');_0xfb49bc[_0xc007('0x16')]=parseValue(_0x5254e7,_0x1aa661['operator'],_0x1aa661['value']);return _0xfb49bc;};function parseOperator(_0x4c2bdb){var _0x38ce43;switch(_0x4c2bdb){case _0xc007('0x26'):_0x38ce43='IN\x20?';break;case _0xc007('0x23'):_0x38ce43=_0xc007('0x27');break;case _0xc007('0x14'):_0x38ce43=_0xc007('0x28');break;case _0xc007('0x22'):_0x38ce43='<>\x20?';break;case _0xc007('0x29'):case _0xc007('0x2a'):case _0xc007('0x2b'):_0x38ce43='LIKE\x20?';break;case _0xc007('0x2c'):_0x38ce43=_0xc007('0x2d');break;case _0xc007('0x2e'):_0x38ce43='>\x20?';break;case'$lte':_0x38ce43=_0xc007('0x2f');break;case _0xc007('0x30'):_0x38ce43=_0xc007('0x31');break;case'$between':_0x38ce43=_0xc007('0x32');break;}return _0x38ce43;}function parseValue(_0x280b17,_0x51a7cd,_0x60a77d){var _0x1a50d3={'start':undefined,'end':undefined};switch(_0x51a7cd){case _0xc007('0x26'):case'$notIn':_0x1a50d3[_0xc007('0x33')]=_0x60a77d[_0xc007('0xa')](',');break;case _0xc007('0x29'):_0x1a50d3[_0xc007('0x33')]='%'+_0x60a77d+'%';break;case _0xc007('0x2a'):_0x1a50d3[_0xc007('0x33')]=_0x60a77d+'%';break;case _0xc007('0x2b'):_0x1a50d3[_0xc007('0x33')]='%'+_0x60a77d;break;case _0xc007('0x15'):var _0xe1238d=_0x60a77d[_0xc007('0xa')](',');var _0x60a77d=_0xe1238d[_0xc007('0xd')]();var _0x1b1886=_0xe1238d[_0xc007('0x34')]();if(_0x280b17===_0xc007('0x12')){_0x60a77d=moment(_0x60a77d)[_0xc007('0x35')](0x0,!![])[_0xc007('0x1a')]();_0x1b1886=moment(_0x1b1886)[_0xc007('0x35')](0x0,!![])[_0xc007('0x18')](0x17,_0xc007('0x36'))[_0xc007('0x18')](0x3b,_0xc007('0x37'))['add'](0x3b,_0xc007('0x38'))['format']();}_0x1a50d3={'start':_0x60a77d,'end':_0x1b1886};break;default:_0x1a50d3[_0xc007('0x33')]=_0x60a77d;break;}return _0x1a50d3;} \ No newline at end of file +var _0x023e=['[$or]','and','replace','split','length','forEach','match','indexOf','map','conditions','push','buildExpression','DATE','$eq','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','field','$notIn','operator','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','start','shift','utcOffset','minutes','lodash','sqlOperator'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x023e,0x1c0));var _0xe023=function(_0x40d431,_0x2e733d){_0x40d431=_0x40d431-0x0;var _0x108354=_0x023e[_0x40d431];return _0x108354;};'use strict';var _=require(_0xe023('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x787920){var _0x21ac39={'conditions':[]};_0x21ac39[_0xe023('0x1')]=_['startsWith'](_0x787920,_0xe023('0x2'))?'or':_0xe023('0x3');var _0xcc6c6f=_0x787920['replace']('[$and]','')[_0xe023('0x4')](_0xe023('0x2'),'')[_0xe023('0x5')]('||');for(var _0x4ab000=0x0;_0x4ab000<_0xcc6c6f[_0xe023('0x6')];_0x4ab000++){var _0x3c5cb4=_0xcc6c6f[_0x4ab000][_0xe023('0x5')](':=');var _0x4ac98d=_0x3c5cb4[0x0];var _0x408f3a=_0x3c5cb4['slice'](0x1);_0x408f3a[_0xe023('0x7')](function(_0x7fbaae){var _0x1317c0=_0x7fbaae[_0xe023('0x5')]('[')['shift']();var _0x211797=_0x7fbaae[_0xe023('0x8')](/\[(.*?)\]/g);_0x211797[_0xe023('0x7')](function(_0x20d905){var _0x1def94=_0x20d905[_0xe023('0x5')]('[')['filter'](function(_0xed607d){return _0xed607d[_0xe023('0x9')](']')>-0x1;})[_0xe023('0xa')](function(_0x145056){return _0x145056[_0xe023('0x5')](']')[0x0];})[0x0];_0x21ac39[_0xe023('0xb')][_0xe023('0xc')]({'field':_0x4ac98d,'operator':_0x1317c0,'value':_0x1def94});});});}return _0x21ac39;};exports[_0xe023('0xd')]=function(_0x1e2fdc,_0xfe6f55,_0x36feca){var _0x784e0e={};if(_0xfe6f55===_0xe023('0xe')){if(_0x36feca['operator']===_0xe023('0xf')){_0x36feca['operator']='$between';_0x36feca[_0xe023('0x10')]+=','+_0x36feca['value'];}else if(_[_0xe023('0x11')]([_0xe023('0x12'),_0xe023('0x13')],_0x36feca['operator'])){_0x36feca['value']=moment(_0x36feca[_0xe023('0x10')])[_0xe023('0x14')](0x1,_0xe023('0x15'))[_0xe023('0x16')](_0xe023('0x17'));}}if(_0x36feca['castTo']){_0xfe6f55=_0x36feca[_0xe023('0x18')];_0x784e0e[_0xe023('0x19')]='CAST('+_0x1e2fdc+'.'+_0x36feca[_0xe023('0x1a')]+'\x20AS\x20'+_0x36feca['castTo']+')\x20'+parseOperator(_0x36feca['operator']);}else{_0x784e0e[_0xe023('0x19')]=_0x1e2fdc+'.'+_0x36feca[_0xe023('0x1a')]+'\x20'+parseOperator(_0x36feca['operator']);}if(_[_0xe023('0x11')](['$ne',_0xe023('0x1b')],_0x36feca[_0xe023('0x1c')]))_0x784e0e[_0xe023('0x19')]='('+_0x784e0e['text']+_0xe023('0x1d')+_0x1e2fdc+'.'+_0x36feca['field']+_0xe023('0x1e');_0x784e0e[_0xe023('0x10')]=parseValue(_0xfe6f55,_0x36feca[_0xe023('0x1c')],_0x36feca['value']);return _0x784e0e;};function parseOperator(_0x208759){var _0x276108;switch(_0x208759){case _0xe023('0x1f'):_0x276108=_0xe023('0x20');break;case'$notIn':_0x276108=_0xe023('0x21');break;case _0xe023('0xf'):_0x276108=_0xe023('0x22');break;case'$ne':_0x276108=_0xe023('0x23');break;case _0xe023('0x24'):case _0xe023('0x25'):case _0xe023('0x26'):_0x276108=_0xe023('0x27');break;case _0xe023('0x28'):_0x276108=_0xe023('0x29');break;case _0xe023('0x12'):_0x276108=_0xe023('0x2a');break;case'$lte':_0x276108='<=\x20?';break;case _0xe023('0x2b'):_0x276108='>=\x20?';break;case _0xe023('0x2c'):_0x276108=_0xe023('0x2d');break;}return _0x276108;}function parseValue(_0xfca17b,_0x9e3bd5,_0xcd1cc7){var _0x2a2361={'start':undefined,'end':undefined};switch(_0x9e3bd5){case _0xe023('0x1f'):case _0xe023('0x1b'):_0x2a2361['start']=_0xcd1cc7[_0xe023('0x5')](',');break;case _0xe023('0x24'):_0x2a2361[_0xe023('0x2e')]='%'+_0xcd1cc7+'%';break;case _0xe023('0x25'):_0x2a2361[_0xe023('0x2e')]=_0xcd1cc7+'%';break;case _0xe023('0x26'):_0x2a2361[_0xe023('0x2e')]='%'+_0xcd1cc7;break;case'$between':var _0x125ce1=_0xcd1cc7[_0xe023('0x5')](',');var _0xcd1cc7=_0x125ce1[_0xe023('0x2f')]();var _0x26d77f=_0x125ce1['pop']();if(_0xfca17b===_0xe023('0xe')){_0xcd1cc7=moment(_0xcd1cc7)[_0xe023('0x30')](0x0,!![])[_0xe023('0x16')]();_0x26d77f=moment(_0x26d77f)[_0xe023('0x30')](0x0,!![])[_0xe023('0x14')](0x17,'hours')[_0xe023('0x14')](0x3b,_0xe023('0x31'))[_0xe023('0x14')](0x3b,'seconds')[_0xe023('0x16')]();}_0x2a2361={'start':_0xcd1cc7,'end':_0x26d77f};break;default:_0x2a2361[_0xe023('0x2e')]=_0xcd1cc7;break;}return _0x2a2361;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 3f67856..9a1709f 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 _0x3baf=['filter','columns','value','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','includes','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','format','$lte','utc','name','uniqueid','isArray','limit','sort','map','indexOf','priority','cast','col','DESC','omit','isObject','length','isNumeric','^[+]?[0-9]*$','isEmail','forEach','match','push','join','getOptions','query','$id','model','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','where','pick'];(function(_0x14f820,_0x37876f){var _0x2bf03d=function(_0x2323a0){while(--_0x2323a0){_0x14f820['push'](_0x14f820['shift']());}};_0x2bf03d(++_0x37876f);}(_0x3baf,0xf7));var _0xf3ba=function(_0x19085d,_0x5d8bc0){_0x19085d=_0x19085d-0x0;var _0xdb3f69=_0x3baf[_0x19085d];return _0xdb3f69;};'use strict';var _=require(_0xf3ba('0x0'));var sequelize=require(_0xf3ba('0x1'));var moment=require(_0xf3ba('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3979b3){var _0x29bbc2=['ne'];try{var _0x22f9c0=JSON[_0xf3ba('0x3')](_0x3979b3);var _0x306bdd=Object[_0xf3ba('0x4')](_0x22f9c0)[0x0];return _0x29bbc2[_0xf3ba('0x5')](_0x306bdd);}catch(_0x57e17d){return![];}}function getOperatorValue(_0x1c7a62){var _0x475268=JSON[_0xf3ba('0x3')](_0x1c7a62);var _0x1284b7=Object['keys'](_0x475268)[0x0];var _0x579135=_0x475268[_0x1284b7];return{['$'+_0x1284b7]:_0x579135};}exports['fields']=function(_0x32f810){var _0x5affaf=null;if(_0x32f810){_0x5affaf=_0x32f810[_0xf3ba('0x6')](',');}return _0x5affaf;};exports[_0xf3ba('0x7')]=function(_0x3ae5fb,_0x40cff2){var _0x3a5714={};if(!_[_0xf3ba('0x8')](_0x3ae5fb)){_[_0xf3ba('0x9')](_0x3ae5fb,function(_0x318b41,_0x32ecd1){try{if(_0x40cff2){var _0x301ca1=_[_0xf3ba('0xa')](_0x40cff2,{'name':_0x32ecd1})||{};if(hasSequelizeOperator(_0x318b41)){_0x3a5714[_0x32ecd1]=getOperatorValue(_0x318b41);}else if(_0x301ca1[_0xf3ba('0xb')]===_0xf3ba('0xc')&&_[_0xf3ba('0xd')](_0x318b41)){var _0x26cefe=JSON[_0xf3ba('0x3')](_0x318b41);var _0x347cf4={'$gte':moment(moment(_0x26cefe[_0xf3ba('0xe')])['format'](_0xf3ba('0xf')))['utc']()[_0xf3ba('0x10')](),'$lte':moment(moment(_0x26cefe[_0xf3ba('0x11')])[_0xf3ba('0x10')](_0xf3ba('0xf')))[_0xf3ba('0x12')]()['subtract'](0x1,'s')[_0xf3ba('0x10')]()};_0x3a5714[_0x32ecd1]=_0x347cf4;}else if(_0x301ca1[_0xf3ba('0x13')]===_0xf3ba('0x14')){_0x3a5714[_0x32ecd1]=_0x318b41;}else{_0x3a5714[_0x32ecd1]=_['isArray'](_0x318b41)?_0x318b41:JSON[_0xf3ba('0x3')](_0x318b41);}}else{_0x3a5714[_0x32ecd1]=_[_0xf3ba('0x15')](_0x318b41)?_0x318b41:JSON[_0xf3ba('0x3')](_0x318b41);}}catch(_0x44de40){_0x3a5714[_0x32ecd1]=_0x318b41['split'](',');}});}return _0x3a5714;};exports[_0xf3ba('0x16')]=function(_0x3b0d9e){_0x3b0d9e=parseInt(_0x3b0d9e,0xa);if(!_0x3b0d9e||_0x3b0d9e<0x0){_0x3b0d9e=LIMIT_VALUE;}return _0x3b0d9e;};exports['offset']=function(_0x479d65){_0x479d65=parseInt(_0x479d65,0xa);if(!_0x479d65||_0x479d65<0x0){_0x479d65=0x0;}return _0x479d65;};exports[_0xf3ba('0x17')]=function(_0x2bd5b8){var _0x854fc4,_0x5d351f=null;if(_0x2bd5b8){_0x854fc4=_0x2bd5b8[_0xf3ba('0x6')](',');_0x5d351f=_[_0xf3ba('0x18')](_0x854fc4,function(_0x35d6d4){if(_0x35d6d4[_0xf3ba('0x19')]('-')===0x0){return[_0x35d6d4===_0xf3ba('0x1a')?sequelize[_0xf3ba('0x1b')](sequelize[_0xf3ba('0x1c')]('priority'),'unsigned'):_0x35d6d4['substr'](0x1),_0xf3ba('0x1d')];}else{return[_0x35d6d4===_0xf3ba('0x1a')?sequelize[_0xf3ba('0x1b')](sequelize[_0xf3ba('0x1c')](_0xf3ba('0x1a')),'unsigned'):_0x35d6d4,'ASC'];}});}return _0x5d351f;};exports[_0xf3ba('0x1e')]=function(_0xd6c2da,_0x5410a2){if(_[_0xf3ba('0x8')](_0xd6c2da)){return _0xd6c2da;}if(_[_0xf3ba('0x15')](_0xd6c2da)){for(var _0x59ce48=0x0;_0x59ce48<_0xd6c2da['length'];_0x59ce48+=0x1){_0xd6c2da[_0x59ce48]=this[_0xf3ba('0x1e')](_0xd6c2da[_0x59ce48],_0x5410a2);}return _0xd6c2da;}if(!_[_0xf3ba('0x1f')](_0xd6c2da)){return _0xd6c2da;}if(_['isString'](_0x5410a2)){_0x5410a2=[_0x5410a2];}if(!_[_0xf3ba('0x15')](_0x5410a2)){return _0xd6c2da;}for(var _0x318817=0x0;_0x318817<_0x5410a2[_0xf3ba('0x20')];_0x318817+=0x1){_['unset'](_0xd6c2da,_0x5410a2[_0x318817]);}for(var _0x29ed57 in _0xd6c2da){if(_0xd6c2da['hasOwnProperty'](_0x29ed57)){_0xd6c2da[_0x29ed57]=this['omit'](_0xd6c2da[_0x29ed57],_0x5410a2);}}return _0xd6c2da;};exports[_0xf3ba('0x21')]=function(_0x19ef2c){return _0x19ef2c['match'](RegExp(_0xf3ba('0x22')))?!![]:![];};exports[_0xf3ba('0x23')]=function(_0x5081aa){return _0x5081aa['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x1c6062){var _0x6423f=[];_0x1c6062['split'](/[ ,]+/)[_0xf3ba('0x24')](function(_0x5b2f0d){_0x5b2f0d=_0x5b2f0d['replace'](/([^:]")"+/g,'$1');_0x5b2f0d='+'+_0x5b2f0d+'*';var _0x28dee0=/[ `!@#$%^&*()_\-?~]/;if(_0x5b2f0d[_0xf3ba('0x25')](_0x28dee0))_0x5b2f0d='\x22'+_0x5b2f0d+'\x22';_0x6423f[_0xf3ba('0x26')](_0x5b2f0d);});return _0x6423f[_0xf3ba('0x27')]('\x20');};exports[_0xf3ba('0x28')]=function(_0xf1b77a,_0x508d52,_0x21c300){var _0x487ed6={},_0x1b10b9={};if(_0x508d52[_0xf3ba('0x29')]['$id']){_0x508d52[_0xf3ba('0x29')]['id']=_0x508d52[_0xf3ba('0x29')][_0xf3ba('0x2a')];delete _0x508d52[_0xf3ba('0x29')]['$id'];}_0x487ed6[_0xf3ba('0x2b')]=_['map'](_0xf1b77a,'name');_0x487ed6['query']=_[_0xf3ba('0x4')](_0x508d52[_0xf3ba('0x29')]);_0x487ed6[_0xf3ba('0x7')]=_[_0xf3ba('0x2c')](_0x487ed6[_0xf3ba('0x2b')],_0x487ed6['query']);_0x1b10b9[_0xf3ba('0x2d')]=_['intersection'](_0x487ed6[_0xf3ba('0x2b')],this['fields'](_0x508d52[_0xf3ba('0x29')][_0xf3ba('0x2e')]));_0x1b10b9[_0xf3ba('0x2d')]=_0x1b10b9[_0xf3ba('0x2d')]['length']?_0x1b10b9[_0xf3ba('0x2d')]:_0x487ed6[_0xf3ba('0x2b')];if(!_0x508d52['query'][_0xf3ba('0x2f')](_0xf3ba('0x30'))){_0x1b10b9[_0xf3ba('0x16')]=this[_0xf3ba('0x16')](_0x508d52[_0xf3ba('0x29')][_0xf3ba('0x16')]);_0x1b10b9[_0xf3ba('0x31')]=this['offset'](_0x508d52[_0xf3ba('0x29')]['offset']);}_0x1b10b9[_0xf3ba('0x32')]=this['sort'](_0x508d52[_0xf3ba('0x29')][_0xf3ba('0x17')]);_0x1b10b9[_0xf3ba('0x33')]=this[_0xf3ba('0x7')](_[_0xf3ba('0x34')](_0x508d52['query'],_0x487ed6['filters']),_0xf1b77a);if(_0x508d52[_0xf3ba('0x29')][_0xf3ba('0x35')]){var _0x417911=_0xf1b77a;var _0x433752=_0x508d52[_0xf3ba('0x29')][_0xf3ba('0x35')];if(typeof _0x433752==='object'){_0x417911=_[_0xf3ba('0x35')](_0xf1b77a,function(_0x4b9c9e){return _[_0xf3ba('0x5')](_0x433752[_0xf3ba('0x36')],_0x4b9c9e[_0xf3ba('0x13')]);});_0x433752=_0x433752[_0xf3ba('0x37')];}_0x1b10b9[_0xf3ba('0x33')]=_[_0xf3ba('0x38')](_0x1b10b9[_0xf3ba('0x33')],{'$or':_[_0xf3ba('0x18')](_0x417911,function(_0x5b9a0c){if(_0x5b9a0c[_0xf3ba('0xb')]!==_0xf3ba('0x39')){if(_0x21c300){return sequelize[_0xf3ba('0x33')](sequelize['fn'](_0xf3ba('0x3a'),sequelize[_0xf3ba('0x1c')](_0x5b9a0c[_0xf3ba('0x13')])),{'$like':sequelize['fn'](_0xf3ba('0x3a'),'%'+_0x508d52['query'][_0xf3ba('0x35')]+'%')});}else{var _0x35481b={};_0x35481b[_0x5b9a0c['name']]={'$like':'%'+_0x508d52[_0xf3ba('0x29')][_0xf3ba('0x35')]+'%'};return _0x35481b;}}})});}_0x1b10b9=_[_0xf3ba('0x38')]({},_0x1b10b9,_0x508d52[_0xf3ba('0x3b')]);return _0x1b10b9;}; \ No newline at end of file +var _0x0fda=['name','intersection','attributes','length','nolimit','limit','order','pick','filter','object','includes','columns','where','VIRTUAL','lower','merge','options','lodash','moment','parse','keys','fields','split','filters','isEmpty','forOwn','find','type','DATE','format','YYYY-MM-DD','utc','$lte','subtract','isArray','offset','sort','map','priority','cast','col','unsigned','substr','DESC','ASC','isObject','isString','omit','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','query','$id','model'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0x0fda,0x1a0));var _0xa0fd=function(_0xa049f8,_0x3c7188){_0xa049f8=_0xa049f8-0x0;var _0x313685=_0x0fda[_0xa049f8];return _0x313685;};'use strict';var _=require(_0xa0fd('0x0'));var sequelize=require('sequelize');var moment=require(_0xa0fd('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x28e34c){var _0x314a1a=['ne'];try{var _0x2f71f3=JSON[_0xa0fd('0x2')](_0x28e34c);var _0xd8e73a=Object[_0xa0fd('0x3')](_0x2f71f3)[0x0];return _0x314a1a['includes'](_0xd8e73a);}catch(_0x4978fa){return![];}}function getOperatorValue(_0x65fa5d){var _0x4aec58=JSON['parse'](_0x65fa5d);var _0x868183=Object[_0xa0fd('0x3')](_0x4aec58)[0x0];var _0x1aab41=_0x4aec58[_0x868183];return{['$'+_0x868183]:_0x1aab41};}exports[_0xa0fd('0x4')]=function(_0x5d996b){var _0x29da4c=null;if(_0x5d996b){_0x29da4c=_0x5d996b[_0xa0fd('0x5')](',');}return _0x29da4c;};exports[_0xa0fd('0x6')]=function(_0x322a1a,_0x4e1873){var _0x31088d={};if(!_[_0xa0fd('0x7')](_0x322a1a)){_[_0xa0fd('0x8')](_0x322a1a,function(_0x5c1786,_0x4409e4){try{if(_0x4e1873){var _0x332e66=_[_0xa0fd('0x9')](_0x4e1873,{'name':_0x4409e4})||{};if(hasSequelizeOperator(_0x5c1786)){_0x31088d[_0x4409e4]=getOperatorValue(_0x5c1786);}else if(_0x332e66[_0xa0fd('0xa')]===_0xa0fd('0xb')&&_['isPlainObject'](_0x5c1786)){var _0x490112=JSON[_0xa0fd('0x2')](_0x5c1786);var _0x16fe85={'$gte':moment(moment(_0x490112['$gte'])[_0xa0fd('0xc')](_0xa0fd('0xd')))[_0xa0fd('0xe')]()[_0xa0fd('0xc')](),'$lte':moment(moment(_0x490112[_0xa0fd('0xf')])[_0xa0fd('0xc')](_0xa0fd('0xd')))['utc']()[_0xa0fd('0x10')](0x1,'s')[_0xa0fd('0xc')]()};_0x31088d[_0x4409e4]=_0x16fe85;}else if(_0x332e66['name']==='uniqueid'){_0x31088d[_0x4409e4]=_0x5c1786;}else{_0x31088d[_0x4409e4]=_[_0xa0fd('0x11')](_0x5c1786)?_0x5c1786:JSON[_0xa0fd('0x2')](_0x5c1786);}}else{_0x31088d[_0x4409e4]=_['isArray'](_0x5c1786)?_0x5c1786:JSON[_0xa0fd('0x2')](_0x5c1786);}}catch(_0x22a876){_0x31088d[_0x4409e4]=_0x5c1786[_0xa0fd('0x5')](',');}});}return _0x31088d;};exports['limit']=function(_0x50cde2){_0x50cde2=parseInt(_0x50cde2,0xa);if(!_0x50cde2||_0x50cde2<0x0){_0x50cde2=LIMIT_VALUE;}return _0x50cde2;};exports[_0xa0fd('0x12')]=function(_0x558109){_0x558109=parseInt(_0x558109,0xa);if(!_0x558109||_0x558109<0x0){_0x558109=0x0;}return _0x558109;};exports[_0xa0fd('0x13')]=function(_0x2de471){var _0x10f64b,_0x2cf99d=null;if(_0x2de471){_0x10f64b=_0x2de471[_0xa0fd('0x5')](',');_0x2cf99d=_[_0xa0fd('0x14')](_0x10f64b,function(_0x113059){if(_0x113059['indexOf']('-')===0x0){return[_0x113059===_0xa0fd('0x15')?sequelize[_0xa0fd('0x16')](sequelize[_0xa0fd('0x17')](_0xa0fd('0x15')),_0xa0fd('0x18')):_0x113059[_0xa0fd('0x19')](0x1),_0xa0fd('0x1a')];}else{return[_0x113059===_0xa0fd('0x15')?sequelize[_0xa0fd('0x16')](sequelize[_0xa0fd('0x17')](_0xa0fd('0x15')),_0xa0fd('0x18')):_0x113059,_0xa0fd('0x1b')];}});}return _0x2cf99d;};exports['omit']=function(_0x37177b,_0x39d8e5){if(_['isEmpty'](_0x37177b)){return _0x37177b;}if(_[_0xa0fd('0x11')](_0x37177b)){for(var _0x3cd5b0=0x0;_0x3cd5b0<_0x37177b['length'];_0x3cd5b0+=0x1){_0x37177b[_0x3cd5b0]=this['omit'](_0x37177b[_0x3cd5b0],_0x39d8e5);}return _0x37177b;}if(!_[_0xa0fd('0x1c')](_0x37177b)){return _0x37177b;}if(_[_0xa0fd('0x1d')](_0x39d8e5)){_0x39d8e5=[_0x39d8e5];}if(!_['isArray'](_0x39d8e5)){return _0x37177b;}for(var _0x5c70fb=0x0;_0x5c70fb<_0x39d8e5['length'];_0x5c70fb+=0x1){_['unset'](_0x37177b,_0x39d8e5[_0x5c70fb]);}for(var _0x11d7f1 in _0x37177b){if(_0x37177b['hasOwnProperty'](_0x11d7f1)){_0x37177b[_0x11d7f1]=this[_0xa0fd('0x1e')](_0x37177b[_0x11d7f1],_0x39d8e5);}}return _0x37177b;};exports[_0xa0fd('0x1f')]=function(_0x2f5b0d){return _0x2f5b0d['match'](RegExp(_0xa0fd('0x20')))?!![]:![];};exports[_0xa0fd('0x21')]=function(_0x4feb93){return _0x4feb93[_0xa0fd('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0xa0fd('0x23')]=function(_0x58ddb3){var _0x366921=[];_0x58ddb3[_0xa0fd('0x5')](/[ ,]+/)[_0xa0fd('0x24')](function(_0x2993aa){_0x2993aa=_0x2993aa['replace'](/([^:]")"+/g,'$1');_0x2993aa='+'+_0x2993aa+'*';var _0x33785f=/[ `!@#$%^&*()_\-?~]/;if(_0x2993aa[_0xa0fd('0x22')](_0x33785f))_0x2993aa='\x22'+_0x2993aa+'\x22';_0x366921['push'](_0x2993aa);});return _0x366921['join']('\x20');};exports['getOptions']=function(_0x1fc249,_0x481271,_0x4bf462){var _0x2c3110={},_0x56f911={};if(_0x481271[_0xa0fd('0x25')][_0xa0fd('0x26')]){_0x481271[_0xa0fd('0x25')]['id']=_0x481271[_0xa0fd('0x25')][_0xa0fd('0x26')];delete _0x481271[_0xa0fd('0x25')][_0xa0fd('0x26')];}_0x2c3110[_0xa0fd('0x27')]=_['map'](_0x1fc249,_0xa0fd('0x28'));_0x2c3110['query']=_[_0xa0fd('0x3')](_0x481271['query']);_0x2c3110['filters']=_[_0xa0fd('0x29')](_0x2c3110['model'],_0x2c3110[_0xa0fd('0x25')]);_0x56f911[_0xa0fd('0x2a')]=_[_0xa0fd('0x29')](_0x2c3110[_0xa0fd('0x27')],this['fields'](_0x481271[_0xa0fd('0x25')][_0xa0fd('0x4')]));_0x56f911[_0xa0fd('0x2a')]=_0x56f911[_0xa0fd('0x2a')][_0xa0fd('0x2b')]?_0x56f911[_0xa0fd('0x2a')]:_0x2c3110[_0xa0fd('0x27')];if(!_0x481271['query']['hasOwnProperty'](_0xa0fd('0x2c'))){_0x56f911[_0xa0fd('0x2d')]=this[_0xa0fd('0x2d')](_0x481271[_0xa0fd('0x25')]['limit']);_0x56f911[_0xa0fd('0x12')]=this[_0xa0fd('0x12')](_0x481271[_0xa0fd('0x25')][_0xa0fd('0x12')]);}_0x56f911[_0xa0fd('0x2e')]=this['sort'](_0x481271[_0xa0fd('0x25')][_0xa0fd('0x13')]);_0x56f911['where']=this['filters'](_[_0xa0fd('0x2f')](_0x481271[_0xa0fd('0x25')],_0x2c3110[_0xa0fd('0x6')]),_0x1fc249);if(_0x481271[_0xa0fd('0x25')][_0xa0fd('0x30')]){var _0xbeca16=_0x1fc249;var _0x41b390=_0x481271[_0xa0fd('0x25')][_0xa0fd('0x30')];if(typeof _0x41b390===_0xa0fd('0x31')){_0xbeca16=_[_0xa0fd('0x30')](_0x1fc249,function(_0x1c9bba){return _[_0xa0fd('0x32')](_0x41b390[_0xa0fd('0x33')],_0x1c9bba[_0xa0fd('0x28')]);});_0x41b390=_0x41b390['value'];}_0x56f911['where']=_['merge'](_0x56f911[_0xa0fd('0x34')],{'$or':_[_0xa0fd('0x14')](_0xbeca16,function(_0x399eb1){if(_0x399eb1['type']!==_0xa0fd('0x35')){if(_0x4bf462){return sequelize[_0xa0fd('0x34')](sequelize['fn'](_0xa0fd('0x36'),sequelize['col'](_0x399eb1[_0xa0fd('0x28')])),{'$like':sequelize['fn'](_0xa0fd('0x36'),'%'+_0x481271[_0xa0fd('0x25')][_0xa0fd('0x30')]+'%')});}else{var _0x2a35fa={};_0x2a35fa[_0x399eb1[_0xa0fd('0x28')]]={'$like':'%'+_0x481271['query'][_0xa0fd('0x30')]+'%'};return _0x2a35fa;}}})});}_0x56f911=_[_0xa0fd('0x37')]({},_0x56f911,_0x481271[_0xa0fd('0x38')]);return _0x56f911;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 8773867..45c94ac 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x29b35c,_0x2001c5){var _0x5ab131=function(_0x4afc0a){while(--_0x4afc0a){_0x29b35c['push'](_0x29b35c['shift']());}};_0x5ab131(++_0x2001c5);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +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(_0x7cf8eb,_0x5a470e){var _0x24e417=function(_0x10caea){while(--_0x10caea){_0x7cf8eb['push'](_0x7cf8eb['shift']());}};_0x24e417(++_0x5a470e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 eec3f38..c4b67cd 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 _0x6f3c=['substring','lodash','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','length','filter','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','digest'];(function(_0x5ad83e,_0xb3a929){var _0x1850a9=function(_0x3cb205){while(--_0x3cb205){_0x5ad83e['push'](_0x5ad83e['shift']());}};_0x1850a9(++_0xb3a929);}(_0x6f3c,0x199));var _0xc6f3=function(_0xf373f5,_0x264773){_0xf373f5=_0xf373f5-0x0;var _0xca4a12=_0x6f3c[_0xf373f5];return _0xca4a12;};'use strict';var _=require(_0xc6f3('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0xc6f3('0x1'));var exec=require(_0xc6f3('0x2'))[_0xc6f3('0x3')];var config=require(_0xc6f3('0x4'));function getInterfaces(){var _0xf6af24=[];var _0x55750e=os[_0xc6f3('0x5')]();var _0x3f1cba=_[_0xc6f3('0x6')](_['keys'](_0x55750e));for(var _0x247d97=0x0;_0x247d97<_0x3f1cba[_0xc6f3('0x7')];_0x247d97++){var _0x5bcf2c=_0x55750e[_0x3f1cba[_0x247d97]][_0xc6f3('0x8')](function(_0x34d5ce){return _0x34d5ce['family']===_0xc6f3('0x9')&&_0x34d5ce[_0xc6f3('0xa')]===![];});_0xf6af24=_0xf6af24[_0xc6f3('0xb')](_0x5bcf2c);}return _0xf6af24;}function getFirstInterface(){var _0x597768=_['head'](getInterfaces());return{'macAddress':_0x597768&&_0x597768[_0xc6f3('0xc')]?_0x597768['mac']:_0xc6f3('0xd'),'ipAddress':_0x597768&&_0x597768[_0xc6f3('0xe')]?_0x597768[_0xc6f3('0xe')]:_0xc6f3('0xf')};}exports[_0xc6f3('0x10')]=getFirstInterface;function getCPUhash(){var _0x52f912=_[_0xc6f3('0x6')](os[_0xc6f3('0x11')]()['map'](function(_0x1cbf66){return _0x1cbf66[_0xc6f3('0x12')];}))[_0xc6f3('0x13')](':');return crypto[_0xc6f3('0x14')](_0xc6f3('0x15'))[_0xc6f3('0x16')](_0x52f912)['digest'](_0xc6f3('0x17'));}exports[_0xc6f3('0x18')]=function(){var _0x43e77a=os[_0xc6f3('0x19')]();var _0x4be2f8=/[0-9a-f-]{36}/;if(config[_0xc6f3('0x1a')]&&_0x4be2f8['test'](config['licenseToken'])){return config['licenseToken'];}else if(_0x43e77a===_0xc6f3('0x1b')){return exec(_0xc6f3('0x1c'),{'encoding':_0xc6f3('0x1d')})['replace']('\x0d\x0a','');}else{var _0x5c4e69=getFirstInterface();var _0xb86e=getCPUhash();var _0x22a0fb=_0xb86e+'|'+os[_0xc6f3('0x1e')]()+'|'+_0x5c4e69[_0xc6f3('0x1f')]+'|'+_0x5c4e69['ipAddress'];var _0x16c64f=crypto['createHash']('md5')[_0xc6f3('0x16')](_0x22a0fb)[_0xc6f3('0x20')](_0xc6f3('0x17'));return _0x16c64f[_0xc6f3('0x21')](0x0,0x8)+'-'+_0x16c64f['substring'](0x8,0xc)+'-'+_0x16c64f[_0xc6f3('0x21')](0xc,0x10)+'-'+_0x16c64f[_0xc6f3('0x21')](0x10,0x14)+'-'+_0x16c64f[_0xc6f3('0x21')](0x14);}}; \ No newline at end of file +var _0x5851=['execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','model','join','md5','update','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','macAddress','ipAddress','createHash','digest','substring','crypto','bimedia-machine-uuid','child_process'];(function(_0x195076,_0x675423){var _0x4f2772=function(_0x4e8c1c){while(--_0x4e8c1c){_0x195076['push'](_0x195076['shift']());}};_0x4f2772(++_0x675423);}(_0x5851,0x151));var _0x1585=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5851[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x1585('0x0'));var machine=require(_0x1585('0x1'));var exec=require(_0x1585('0x2'))[_0x1585('0x3')];var config=require(_0x1585('0x4'));function getInterfaces(){var _0x3c2b59=[];var _0x371282=os[_0x1585('0x5')]();var _0x967300=_[_0x1585('0x6')](_[_0x1585('0x7')](_0x371282));for(var _0x35c317=0x0;_0x35c317<_0x967300[_0x1585('0x8')];_0x35c317++){var _0xd6abc0=_0x371282[_0x967300[_0x35c317]][_0x1585('0x9')](function(_0x54fc48){return _0x54fc48[_0x1585('0xa')]===_0x1585('0xb')&&_0x54fc48[_0x1585('0xc')]===![];});_0x3c2b59=_0x3c2b59[_0x1585('0xd')](_0xd6abc0);}return _0x3c2b59;}function getFirstInterface(){var _0x46f635=_['head'](getInterfaces());return{'macAddress':_0x46f635&&_0x46f635[_0x1585('0xe')]?_0x46f635['mac']:_0x1585('0xf'),'ipAddress':_0x46f635&&_0x46f635[_0x1585('0x10')]?_0x46f635[_0x1585('0x10')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x2e5c71=_['orderBy'](os['cpus']()['map'](function(_0x4d8c3b){return _0x4d8c3b[_0x1585('0x11')];}))[_0x1585('0x12')](':');return crypto['createHash'](_0x1585('0x13'))[_0x1585('0x14')](_0x2e5c71)['digest'](_0x1585('0x15'));}exports[_0x1585('0x16')]=function(){var _0x536b20=os[_0x1585('0x17')]();var _0x490a6c=/[0-9a-f-]{36}/;if(config[_0x1585('0x18')]&&_0x490a6c[_0x1585('0x19')](config[_0x1585('0x18')])){return config['licenseToken'];}else if(_0x536b20===_0x1585('0x1a')){return exec(_0x1585('0x1b'),{'encoding':_0x1585('0x1c')})['replace']('\x0d\x0a','');}else{var _0x654f59=getFirstInterface();var _0x488002=getCPUhash();var _0x2337c8=_0x488002+'|'+os['hostname']()+'|'+_0x654f59[_0x1585('0x1d')]+'|'+_0x654f59[_0x1585('0x1e')];var _0x5dada4=crypto[_0x1585('0x1f')](_0x1585('0x13'))[_0x1585('0x14')](_0x2337c8)[_0x1585('0x20')](_0x1585('0x15'));return _0x5dada4[_0x1585('0x21')](0x0,0x8)+'-'+_0x5dada4[_0x1585('0x21')](0x8,0xc)+'-'+_0x5dada4[_0x1585('0x21')](0xc,0x10)+'-'+_0x5dada4[_0x1585('0x21')](0x10,0x14)+'-'+_0x5dada4[_0x1585('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index f6b811a..3905f6a 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 _0xd912=['Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','catch','error','message','getUuid','License','findOrCreate','spread','default','util','moment','request-promise','version','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','get','data2','data1','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED'];(function(_0x40649d,_0x5a620d){var _0x50f50a=function(_0x33283f){while(--_0x33283f){_0x40649d['push'](_0x40649d['shift']());}};_0x50f50a(++_0x5a620d);}(_0xd912,0x18a));var _0x2d91=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd912[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0x2d91('0x0'));var moment=require(_0x2d91('0x1'));var rp=require(_0x2d91('0x2'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0x2d91('0x3'));var db=require(_0x2d91('0x4'))['db'];var encryptor=require(_0x2d91('0x5'));var hardware=require('./hardware');var logger=require(_0x2d91('0x6'))(_0x2d91('0x7'));var HOST=_0x2d91('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x24b84a){return new BPromise(function(_0x5a8e95,_0x5a0fc1){var _0x3d3a30=util[_0x2d91('0x9')](_0x2d91('0xa'),HOST,_0x24b84a,module[_0x2d91('0xb')][_0x2d91('0x3')]);if(oldToken){_0x3d3a30=util[_0x2d91('0x9')](_0x2d91('0xc'),HOST,_0x24b84a,module[_0x2d91('0xb')][_0x2d91('0x3')],oldToken);}var _0x39ef11={'uri':_0x3d3a30,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x39ef11)[_0x2d91('0xd')](function(_0x5a04fd){_0x5a8e95(_0x5a04fd);})['catch'](function(_0x250def){_0x5a0fc1(_0x250def);});});}function manageLicense(_0x11b7e7,_0x25f1c8){var _0x5a8a19=_0x25f1c8[_0x2d91('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x5a8a19['data1']!==_0x11b7e7&&!_0x5a8a19[_0x2d91('0xf')]){oldToken=_0x5a8a19[_0x2d91('0x10')];}httpRequest(_0x11b7e7)[_0x2d91('0xd')](function(_0x147a3d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x147a3d[_0x2d91('0x11')]){isOldTokenSent=![];if(!_0x5a8a19['license']&&_0x5a8a19['license']!=_0x147a3d[_0x2d91('0x7')]||_0x5a8a19[_0x2d91('0x7')]&&_0x5a8a19[_0x2d91('0xf')]){logger['info'](_0x2d91('0x12'));}if(_0x5a8a19[_0x2d91('0x7')]&&!_0x5a8a19[_0x2d91('0xf')]&&_0x5a8a19['license']!=_0x147a3d[_0x2d91('0x7')]){logger[_0x2d91('0x13')](_0x2d91('0x14'));}if(_0x5a8a19[_0x2d91('0x7')]&&!_0x5a8a19[_0x2d91('0xf')]&&_0x5a8a19['license']==_0x147a3d[_0x2d91('0x7')]){return _0x25f1c8;}return _0x25f1c8[_0x2d91('0x15')]({'data1':_0x11b7e7,'data2':null,'license':_0x147a3d['license']});}else{if(_0x147a3d[_0x2d91('0x7')]||_0x5a8a19[_0x2d91('0x7')]){if(!_0x5a8a19[_0x2d91('0xf')]){if(_0x5a8a19['data1']==_0x11b7e7){GRAY_PERIOD_REASON=_0x2d91('0x16');logger[_0x2d91('0x13')](_0x2d91('0x17'));}else{GRAY_PERIOD_REASON=_0x2d91('0x18');logger['info'](_0x2d91('0x19'),_0x5a8a19[_0x2d91('0x10')],_0x11b7e7);}logger[_0x2d91('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x25f1c8[_0x2d91('0x15')]({'data2':encryptor[_0x2d91('0x1a')](moment()[_0x2d91('0x9')](_0x2d91('0x1b')))});}else{if(moment()[_0x2d91('0x1c')](encryptor[_0x2d91('0x1d')](_0x5a8a19['data2']),'days')>DAYS){logger[_0x2d91('0x13')]('DEMO\x20START\x20AT\x20%s',moment()[_0x2d91('0x9')](_0x2d91('0x1b')));isOldTokenSent=![];return _0x25f1c8[_0x2d91('0x15')]({'data1':_0x11b7e7,'data2':null,'license':null});}}}else{if(_0x5a8a19['data1']!=_0x11b7e7){logger[_0x2d91('0x13')](_0x2d91('0x19'),_0x5a8a19['data1'],_0x11b7e7);return _0x25f1c8[_0x2d91('0x15')]({'data1':_0x11b7e7,'data2':null,'license':null});}}}return _0x25f1c8;})[_0x2d91('0xd')](function(_0x5b2685){_0x25f1c8=_0x5b2685;})[_0x2d91('0x1e')](function(_0x1910df){logger[_0x2d91('0x1f')](_0x1910df[_0x2d91('0x20')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x2d91('0x21')](),_0x25f1c8);},TIME);});}function defaultLicense(){var _0x52641d=hardware[_0x2d91('0x21')]();if(_0x52641d){return db[_0x2d91('0x22')][_0x2d91('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x52641d}})[_0x2d91('0x24')](function(_0x5c8ec4,_0x3aeeaa){logger[_0x2d91('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x52641d);manageLicense(_0x52641d,_0x5c8ec4);})['catch'](function(_0x35c5bf){logger[_0x2d91('0x1f')](_0x35c5bf[_0x2d91('0x20')]);});}}exports[_0x2d91('0x25')]=defaultLicense; \ No newline at end of file +var _0xc769=['DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','catch','get','data1','then','active','data2','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff'];(function(_0x158b0b,_0x200e74){var _0x6e961c=function(_0x35bc1a){while(--_0x35bc1a){_0x158b0b['push'](_0x158b0b['shift']());}};_0x6e961c(++_0x200e74);}(_0xc769,0x166));var _0x9c76=function(_0x1d6a29,_0xb90891){_0x1d6a29=_0x1d6a29-0x0;var _0x1d2f72=_0xc769[_0x1d6a29];return _0x1d2f72;};'use strict';var util=require(_0x9c76('0x0'));var moment=require(_0x9c76('0x1'));var rp=require(_0x9c76('0x2'));var BPromise=require(_0x9c76('0x3'));var pkginfo=require('pkginfo')(module,_0x9c76('0x4'));var db=require(_0x9c76('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x9c76('0x6'));var logger=require(_0x9c76('0x7'))(_0x9c76('0x8'));var HOST=_0x9c76('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2b787e){return new BPromise(function(_0x401fbf,_0x5a0c33){var _0x3029cd=util[_0x9c76('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x2b787e,module['exports']['version']);if(oldToken){_0x3029cd=util[_0x9c76('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x2b787e,module[_0x9c76('0xb')]['version'],oldToken);}var _0x37bdee={'uri':_0x3029cd,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x37bdee)['then'](function(_0x1f859a){_0x401fbf(_0x1f859a);})[_0x9c76('0xc')](function(_0x25c735){_0x5a0c33(_0x25c735);});});}function manageLicense(_0x123858,_0x203bbd){var _0x41feac=_0x203bbd[_0x9c76('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x41feac[_0x9c76('0xe')]!==_0x123858&&!_0x41feac['data2']){oldToken=_0x41feac[_0x9c76('0xe')];}httpRequest(_0x123858)[_0x9c76('0xf')](function(_0x32eb5f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x32eb5f[_0x9c76('0x10')]){isOldTokenSent=![];if(!_0x41feac[_0x9c76('0x8')]&&_0x41feac[_0x9c76('0x8')]!=_0x32eb5f[_0x9c76('0x8')]||_0x41feac['license']&&_0x41feac[_0x9c76('0x11')]){logger[_0x9c76('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x41feac[_0x9c76('0x8')]&&!_0x41feac[_0x9c76('0x11')]&&_0x41feac['license']!=_0x32eb5f[_0x9c76('0x8')]){logger[_0x9c76('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x41feac['license']&&!_0x41feac['data2']&&_0x41feac[_0x9c76('0x8')]==_0x32eb5f[_0x9c76('0x8')]){return _0x203bbd;}return _0x203bbd[_0x9c76('0x13')]({'data1':_0x123858,'data2':null,'license':_0x32eb5f[_0x9c76('0x8')]});}else{if(_0x32eb5f['license']||_0x41feac[_0x9c76('0x8')]){if(!_0x41feac[_0x9c76('0x11')]){if(_0x41feac[_0x9c76('0xe')]==_0x123858){GRAY_PERIOD_REASON=_0x9c76('0x14');logger[_0x9c76('0x12')](_0x9c76('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0x9c76('0x16'),_0x41feac['data1'],_0x123858);}logger['info'](_0x9c76('0x17'),GRAY_PERIOD_REASON[_0x9c76('0x18')](),moment()['format'](_0x9c76('0x19')));return _0x203bbd[_0x9c76('0x13')]({'data2':encryptor['encryptString'](moment()[_0x9c76('0xa')](_0x9c76('0x19')))});}else{if(moment()[_0x9c76('0x1a')](encryptor['decryptString'](_0x41feac['data2']),'days')>DAYS){logger[_0x9c76('0x12')](_0x9c76('0x1b'),moment()[_0x9c76('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x203bbd[_0x9c76('0x13')]({'data1':_0x123858,'data2':null,'license':null});}}}else{if(_0x41feac[_0x9c76('0xe')]!=_0x123858){logger[_0x9c76('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x41feac['data1'],_0x123858);return _0x203bbd['update']({'data1':_0x123858,'data2':null,'license':null});}}}return _0x203bbd;})['then'](function(_0x1e1d92){_0x203bbd=_0x1e1d92;})[_0x9c76('0xc')](function(_0x641de4){logger[_0x9c76('0x1c')](_0x641de4[_0x9c76('0x1d')]);})[_0x9c76('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0x9c76('0x1f')](),_0x203bbd);},TIME);});}function defaultLicense(){var _0x54be0d=hardware['getUuid']();if(_0x54be0d){return db[_0x9c76('0x20')][_0x9c76('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x54be0d}})['spread'](function(_0x2f5862,_0x30ed7b){logger['info'](_0x9c76('0x22'),_0x54be0d);manageLicense(_0x54be0d,_0x2f5862);})['catch'](function(_0x47bbd0){logger[_0x9c76('0x1c')](_0x47bbd0[_0x9c76('0x1d')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 5faeb8d..2fcb84b 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 _0x1c72=['role','sequelize','col','count','admin','user','telephone','users','telephones','forEach','countBy','exports','util','lodash','moment','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','demo','gray','deadline','add','days','disabled','message','User'];(function(_0x25ec55,_0x1714a8){var _0x100034=function(_0x481c3f){while(--_0x481c3f){_0x25ec55['push'](_0x25ec55['shift']());}};_0x100034(++_0x1714a8);}(_0x1c72,0x139));var _0x21c7=function(_0x3adc83,_0x4c58d0){_0x3adc83=_0x3adc83-0x0;var _0x44312d=_0x1c72[_0x3adc83];return _0x44312d;};'use strict';var util=require(_0x21c7('0x0'));var _=require(_0x21c7('0x1'));var moment=require(_0x21c7('0x2'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require(_0x21c7('0x3'));var db=require(_0x21c7('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x21c7('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x21c7('0x6'),'machineUuid':hardware[_0x21c7('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x21c7('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x21c7('0x8'),'machineUuid':hardware[_0x21c7('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1909ba){return new BPromise(function(_0x3ceca6,_0x2dbe92){return db[_0x21c7('0x9')][_0x21c7('0xa')](_[_0x21c7('0xb')](_0x1909ba,{'raw':!![],'where':{'id':0x1}}))[_0x21c7('0xc')](function(_0x2fb723){return checkLicense(_0x2fb723,null);})[_0x21c7('0xc')](function(_0x4972d5){_0x3ceca6(_0x4972d5);return;})[_0x21c7('0xd')](function(_0x55d9dd){_0x2dbe92(_0x55d9dd);});});}function checkLicense(_0x227ad1,_0x52b83a){if(!_0x227ad1){demoLicense[_0x21c7('0xe')]=_0x227ad1[_0x21c7('0xf')];return demoLicense;}try{var _0x3c3cd3=_0x52b83a||_0x227ad1[_0x21c7('0x10')];if(_[_0x21c7('0x11')](_0x3c3cd3)){throw new Error(_0x21c7('0x12'));}var _0x2eb62b=_0x227ad1[_0x21c7('0xf')];var _0x50c6c8=_0x227ad1['data2'];var _0x578219=_0x2eb62b['split']('-')[0x4];var _0x1498d0=_0x2eb62b[_0x21c7('0x13')]('-')[0x0];var _0x2500c4=encryptor[_0x21c7('0x14')](_0x3c3cd3,util[_0x21c7('0x15')](_0x21c7('0x16'),_0x578219,_0x2eb62b,_0x1498d0));var _0x45833f=JSON['parse'](_0x2500c4);_0x45833f[_0x21c7('0x17')]=![];_0x45833f['uuid']=_0x2eb62b;_0x45833f['machineUuid']=hardware[_0x21c7('0x7')]();if(_0x50c6c8){var _0x34c21f=encryptor[_0x21c7('0x14')](_0x50c6c8);_0x45833f[_0x21c7('0x18')]=_0x34c21f;_0x45833f[_0x21c7('0x19')]=moment(_0x34c21f)[_0x21c7('0x1a')](0x7,_0x21c7('0x1b'))['format']();_0x45833f['grayReason']=_0x45833f[_0x21c7('0xe')]!=_0x45833f['machineUuid']?'changed':_0x21c7('0x1c');}return _0x45833f;}catch(_0x48327c){breakingLicense[_0x21c7('0xe')]=_0x227ad1[_0x21c7('0xf')];breakingLicense['message']=_0x48327c[_0x21c7('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x18d4c8,_0x4929dd){getLicense()['then'](function(_0x48ba67){return db[_0x21c7('0x1e')]['findAll']({'attributes':[_0x21c7('0x1f'),[db[_0x21c7('0x20')]['fn']('COUNT',db['sequelize'][_0x21c7('0x21')](_0x21c7('0x1f'))),_0x21c7('0x22')]],'group':_0x21c7('0x1f'),'where':{'role':{'$or':[_0x21c7('0x23'),_0x21c7('0x24'),_0x21c7('0x25')]}},'raw':!![]})[_0x21c7('0xc')](function(_0x228be9){var _0x2c3ccd={'user':_0x48ba67[_0x21c7('0x26')]||0x0,'telephone':_0x48ba67[_0x21c7('0x27')]||0x0};_0x228be9[_0x21c7('0x28')](function(_0x57a015){var _0x57eff2=_0x57a015[_0x21c7('0x1f')]===_0x21c7('0x23')?_0x21c7('0x24'):_0x57a015[_0x21c7('0x1f')];_0x2c3ccd[_0x57eff2]-=_0x57a015[_0x21c7('0x22')];if(_0x2c3ccd[_0x57eff2]<0x0)_0x2c3ccd[_0x57eff2]=0x0;});_0x18d4c8(_0x2c3ccd);return;});})['catch'](function(_0x358857){_0x4929dd(_0x358857);});});}function checkUserLimits(_0x4d03b6){return new BPromise(function(_0x2c3fb2,_0x4e54ec){getLimits()[_0x21c7('0xc')](function(_0xbfeecb){var _0x383db0=_['pick'](_[_0x21c7('0x29')](_0x4d03b6,_0x21c7('0x1f')),[_0x21c7('0x23'),_0x21c7('0x24'),_0x21c7('0x25')]);var _0x1dce62=(_0x383db0[_0x21c7('0x23')]||0x0)+(_0x383db0[_0x21c7('0x24')]||0x0);var _0x392134=_0x383db0[_0x21c7('0x25')]||0x0;if(_0x1dce62>_0xbfeecb['user'])return _0x4e54ec('License\x20limit\x20reached\x20for\x20users');if(_0x392134>_0xbfeecb[_0x21c7('0x25')])return _0x4e54ec('License\x20limit\x20reached\x20for\x20telephones');return _0x2c3fb2();})['catch'](function(_0xb171e7){_0x4e54ec(_0xb171e7);});});}module[_0x21c7('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x1f41=['License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','%s:%s:%s','parse','demo','gray','deadline','add','days','format','grayReason','machineUuid','disabled','message','User','role','sequelize','col','count','admin','user','telephone','users','telephones','forEach','pick','countBy'];(function(_0x2c5a9d,_0x42a3c1){var _0x4675c2=function(_0x1c56d1){while(--_0x1c56d1){_0x2c5a9d['push'](_0x2c5a9d['shift']());}};_0x4675c2(++_0x42a3c1);}(_0x1f41,0x65));var _0x11f4=function(_0xcec3cc,_0x1c7c7d){_0xcec3cc=_0xcec3cc-0x0;var _0xe189b1=_0x1f41[_0xcec3cc];return _0xe189b1;};'use strict';var util=require(_0x11f4('0x0'));var _=require(_0x11f4('0x1'));var moment=require(_0x11f4('0x2'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require(_0x11f4('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x11f4('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x11f4('0x5'),'machineUuid':hardware[_0x11f4('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x11f4('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x140e8f){return new BPromise(function(_0x801e3b,_0x6e2f48){return db[_0x11f4('0x8')][_0x11f4('0x9')](_[_0x11f4('0xa')](_0x140e8f,{'raw':!![],'where':{'id':0x1}}))[_0x11f4('0xb')](function(_0x3e6fac){return checkLicense(_0x3e6fac,null);})['then'](function(_0x1c471f){_0x801e3b(_0x1c471f);return;})[_0x11f4('0xc')](function(_0x3dc8f1){_0x6e2f48(_0x3dc8f1);});});}function checkLicense(_0x398caf,_0x11f0e4){if(!_0x398caf){demoLicense[_0x11f4('0xd')]=_0x398caf[_0x11f4('0xe')];return demoLicense;}try{var _0x3a49e6=_0x11f0e4||_0x398caf[_0x11f4('0xf')];if(_[_0x11f4('0x10')](_0x3a49e6)){throw new Error(_0x11f4('0x11'));}var _0x6ae094=_0x398caf[_0x11f4('0xe')];var _0x431a8b=_0x398caf[_0x11f4('0x12')];var _0x42dc06=_0x6ae094[_0x11f4('0x13')]('-')[0x4];var _0x353f41=_0x6ae094['split']('-')[0x0];var _0x441602=encryptor[_0x11f4('0x14')](_0x3a49e6,util['format'](_0x11f4('0x15'),_0x42dc06,_0x6ae094,_0x353f41));var _0xff9bf5=JSON[_0x11f4('0x16')](_0x441602);_0xff9bf5[_0x11f4('0x17')]=![];_0xff9bf5[_0x11f4('0xd')]=_0x6ae094;_0xff9bf5['machineUuid']=hardware[_0x11f4('0x6')]();if(_0x431a8b){var _0x31bddd=encryptor[_0x11f4('0x14')](_0x431a8b);_0xff9bf5[_0x11f4('0x18')]=_0x31bddd;_0xff9bf5[_0x11f4('0x19')]=moment(_0x31bddd)[_0x11f4('0x1a')](0x7,_0x11f4('0x1b'))[_0x11f4('0x1c')]();_0xff9bf5[_0x11f4('0x1d')]=_0xff9bf5[_0x11f4('0xd')]!=_0xff9bf5[_0x11f4('0x1e')]?'changed':_0x11f4('0x1f');}return _0xff9bf5;}catch(_0x13c79c){breakingLicense['uuid']=_0x398caf[_0x11f4('0xe')];breakingLicense[_0x11f4('0x20')]=_0x13c79c['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x43ddca,_0x3b73e3){getLicense()[_0x11f4('0xb')](function(_0x5e9437){return db[_0x11f4('0x21')]['findAll']({'attributes':[_0x11f4('0x22'),[db['sequelize']['fn']('COUNT',db[_0x11f4('0x23')][_0x11f4('0x24')](_0x11f4('0x22'))),_0x11f4('0x25')]],'group':_0x11f4('0x22'),'where':{'role':{'$or':[_0x11f4('0x26'),_0x11f4('0x27'),_0x11f4('0x28')]}},'raw':!![]})[_0x11f4('0xb')](function(_0x5d0f46){var _0x4a4e9a={'user':_0x5e9437[_0x11f4('0x29')]||0x0,'telephone':_0x5e9437[_0x11f4('0x2a')]||0x0};_0x5d0f46[_0x11f4('0x2b')](function(_0x1bb4b8){var _0x6217da=_0x1bb4b8[_0x11f4('0x22')]===_0x11f4('0x26')?_0x11f4('0x27'):_0x1bb4b8[_0x11f4('0x22')];_0x4a4e9a[_0x6217da]-=_0x1bb4b8['count'];if(_0x4a4e9a[_0x6217da]<0x0)_0x4a4e9a[_0x6217da]=0x0;});_0x43ddca(_0x4a4e9a);return;});})[_0x11f4('0xc')](function(_0x2a0aed){_0x3b73e3(_0x2a0aed);});});}function checkUserLimits(_0x1721f9){return new BPromise(function(_0x4cdf36,_0x440cf8){getLimits()[_0x11f4('0xb')](function(_0x5d65e8){var _0x4e3633=_[_0x11f4('0x2c')](_[_0x11f4('0x2d')](_0x1721f9,_0x11f4('0x22')),['admin',_0x11f4('0x27'),'telephone']);var _0xcced54=(_0x4e3633[_0x11f4('0x26')]||0x0)+(_0x4e3633[_0x11f4('0x27')]||0x0);var _0x152e1a=_0x4e3633[_0x11f4('0x28')]||0x0;if(_0xcced54>_0x5d65e8['user'])return _0x440cf8(_0x11f4('0x2e'));if(_0x152e1a>_0x5d65e8['telephone'])return _0x440cf8(_0x11f4('0x2f'));return _0x4cdf36();})[_0x11f4('0xc')](function(_0x1cfe98){_0x440cf8(_0x1cfe98);});});}module[_0x11f4('0x30')]={'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 35c3889..548c220 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 _0x351d=['exports','myappanuglar-secret','app-id','secret'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x351d,0x90));var _0xd351=function(_0x11149a,_0x4b47f0){_0x11149a=_0x11149a-0x0;var _0x2d7424=_0x351d[_0x11149a];return _0x2d7424;};'use strict';module[_0xd351('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xd351('0x1'),'GOOGLE_ID':_0xd351('0x2'),'GOOGLE_SECRET':_0xd351('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x5f2f=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x53156f,_0x3ac2f2){var _0xa6ec1f=function(_0x2c6b68){while(--_0x2c6b68){_0x53156f['push'](_0x53156f['shift']());}};_0xa6ec1f(++_0x3ac2f2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2e7dcb,_0x5f0fe9){_0x2e7dcb=_0x2e7dcb-0x0;var _0xc28044=_0x5f2f[_0x2e7dcb];return _0xc28044;};'use strict';module[_0xf5f2('0x0')]={'DOMAIN':_0xf5f2('0x1'),'SESSION_SECRET':_0xf5f2('0x2'),'GOOGLE_ID':_0xf5f2('0x3'),'GOOGLE_SECRET':_0xf5f2('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 6868103..a6a523e 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9dc4=['exports','../utils/loggers','fileLogger'];(function(_0x304643,_0x238c3f){var _0x3ab463=function(_0x10f66c){while(--_0x10f66c){_0x304643['push'](_0x304643['shift']());}};_0x3ab463(++_0x238c3f);}(_0x9dc4,0x9a));var _0x49dc=function(_0x1156fc,_0x9a387e){_0x1156fc=_0x1156fc-0x0;var _0x578e3a=_0x9dc4[_0x1156fc];return _0x578e3a;};'use strict';var fileLogger=require(_0x49dc('0x0'))[_0x49dc('0x1')];module[_0x49dc('0x2')]=fileLogger; \ No newline at end of file +var _0xa1fa=['../utils/loggers','fileLogger','exports'];(function(_0x4d5e3d,_0x530dca){var _0x11414b=function(_0x26f41a){while(--_0x26f41a){_0x4d5e3d['push'](_0x4d5e3d['shift']());}};_0x11414b(++_0x530dca);}(_0xa1fa,0x108));var _0xaa1f=function(_0x1d25ef,_0x326e0c){_0x1d25ef=_0x1d25ef-0x0;var _0x307a11=_0xa1fa[_0x1d25ef];return _0x307a11;};'use strict';var fileLogger=require(_0xaa1f('0x0'))[_0xaa1f('0x1')];module[_0xaa1f('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 32de333..9e5411b 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 _0x0686=['exports','path','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x51bd82,_0x2eee7a){var _0x1e8e02=function(_0x3a4a52){while(--_0x3a4a52){_0x51bd82['push'](_0x51bd82['shift']());}};_0x1e8e02(++_0x2eee7a);}(_0x0686,0x1bb));var _0x6068=function(_0x1d175c,_0xc636be){_0x1d175c=_0x1d175c-0x0;var _0x1e45d6=_0x0686[_0x1d175c];return _0x1e45d6;};'use strict';var path=require(_0x6068('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x6068('0x1')](__dirname,_0x6068('0x2'))},{'name':_0x6068('0x3'),'script':path[_0x6068('0x1')](__dirname,_0x6068('0x4'))},{'name':_0x6068('0x5'),'script':path[_0x6068('0x1')](__dirname,_0x6068('0x6'))},{'name':'email','script':path['join'](__dirname,_0x6068('0x7'))},{'name':_0x6068('0x8'),'script':path[_0x6068('0x1')](__dirname,_0x6068('0x9'))},{'name':_0x6068('0xa'),'script':path[_0x6068('0x1')](__dirname,_0x6068('0xb'))}]};module[_0x6068('0xc')]=config; \ No newline at end of file +var _0x8ec4=['email','../../services/email/index.js','routing','../../services/routing/index.js','exports','path','express','../../services/express/index.js','ami','join','../../services/ami/index.js','agi'];(function(_0x16f20e,_0x321898){var _0x32d8c0=function(_0x5094da){while(--_0x5094da){_0x16f20e['push'](_0x16f20e['shift']());}};_0x32d8c0(++_0x321898);}(_0x8ec4,0x131));var _0x48ec=function(_0x412e42,_0x2ae8aa){_0x412e42=_0x412e42-0x0;var _0x4a212c=_0x8ec4[_0x412e42];return _0x4a212c;};'use strict';var path=require(_0x48ec('0x0'));var os=require('os');var config={'apps':[{'name':_0x48ec('0x1'),'script':path['join'](__dirname,_0x48ec('0x2'))},{'name':_0x48ec('0x3'),'script':path[_0x48ec('0x4')](__dirname,_0x48ec('0x5'))},{'name':_0x48ec('0x6'),'script':path[_0x48ec('0x4')](__dirname,'../../services/agi/index.js')},{'name':_0x48ec('0x7'),'script':path[_0x48ec('0x4')](__dirname,_0x48ec('0x8'))},{'name':_0x48ec('0x9'),'script':path['join'](__dirname,_0x48ec('0xa'))},{'name':'xdr','script':path[_0x48ec('0x4')](__dirname,'../../services/xdr/index.js')}]};module[_0x48ec('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 7b427d5..191962a 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 _0xa626=['connect','start','then','disconnect','stop','restart','describe','delete','dump','bluebird','./config'];(function(_0x42ffd4,_0x1f40a4){var _0x4fe3ef=function(_0x107fa5){while(--_0x107fa5){_0x42ffd4['push'](_0x42ffd4['shift']());}};_0x4fe3ef(++_0x1f40a4);}(_0xa626,0x1ed));var _0x6a62=function(_0x9956d3,_0x2b3260){_0x9956d3=_0x9956d3-0x0;var _0x401719=_0xa626[_0x9956d3];return _0x401719;};'use strict';var pm2=require('pm2');var BPromise=require(_0x6a62('0x0'));var config=require(_0x6a62('0x1'));function connect(){return new BPromise(function(_0x49d569,_0x45a828){return pm2[_0x6a62('0x2')](function(_0x3f9712){if(_0x3f9712){return _0x45a828(_0x3f9712);}return _0x49d569('connected');});});};exports[_0x6a62('0x3')]=function(_0x2c47ce){return connect()[_0x6a62('0x4')](function(){return new BPromise(function(_0x434400,_0x1f58b2){return pm2['start'](_0x2c47ce,function(_0x526c16,_0x5e643f){if(_0x526c16){return _0x1f58b2(_0x526c16);}pm2[_0x6a62('0x5')]();return _0x434400(_0x5e643f);});});});};exports[_0x6a62('0x6')]=function(_0x1b9100){return connect()[_0x6a62('0x4')](function(){return new BPromise(function(_0x29381c,_0x474d26){return pm2[_0x6a62('0x6')](_0x1b9100,function(_0xfee090,_0x537847){if(_0xfee090){return _0x474d26(_0xfee090);}pm2[_0x6a62('0x5')]();return _0x29381c(_0x537847);});});});};exports[_0x6a62('0x7')]=function(_0x5e1dea){return connect()['then'](function(){return new BPromise(function(_0xf19091,_0x375ffd){return pm2[_0x6a62('0x7')](_0x5e1dea,function(_0x3d25a9,_0x3d0c95){if(_0x3d25a9){return _0x375ffd(_0x3d25a9);}pm2[_0x6a62('0x5')]();return _0xf19091(_0x3d0c95);});});});};exports['list']=function(){return connect()[_0x6a62('0x4')](function(){return new BPromise(function(_0x52d6bb,_0x2ae5c7){return pm2['list'](function(_0x384ff5,_0x500e49){if(_0x384ff5){return _0x2ae5c7(_0x384ff5);}pm2['disconnect']();return _0x52d6bb(_0x500e49);});});});};exports[_0x6a62('0x8')]=function(_0x1bf68e){return connect()[_0x6a62('0x4')](function(){return new BPromise(function(_0x5a5524,_0xf6e57f){return pm2[_0x6a62('0x8')](_0x1bf68e,function(_0x1220e7,_0x37ac99){if(_0x1220e7){return _0xf6e57f(_0x1220e7);}pm2[_0x6a62('0x5')]();return _0x5a5524(_0x37ac99);});});});};exports[_0x6a62('0x9')]=function(_0x28869d){return connect()[_0x6a62('0x4')](function(){return new BPromise(function(_0x40c86e,_0x27c0be){return pm2[_0x6a62('0x9')](_0x28869d,function(_0x47af80,_0xf02b53){if(_0x47af80){return _0x27c0be(_0x47af80);}pm2[_0x6a62('0x5')]();return _0x40c86e(_0xf02b53);});});});};exports[_0x6a62('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0xf93904,_0x2d0c72){return pm2[_0x6a62('0xa')](function(_0x24742b){if(_0x24742b){return _0x2d0c72(_0x24742b);}return _0xf93904('saved');});});});}; \ No newline at end of file +var _0x791a=['stop','disconnect','restart','list','describe','delete','dump','saved','pm2','connect','connected','start','then'];(function(_0x50e701,_0x23cfc6){var _0x311157=function(_0x129779){while(--_0x129779){_0x50e701['push'](_0x50e701['shift']());}};_0x311157(++_0x23cfc6);}(_0x791a,0x18e));var _0xa791=function(_0x4e7ed7,_0x2ca714){_0x4e7ed7=_0x4e7ed7-0x0;var _0x217b53=_0x791a[_0x4e7ed7];return _0x217b53;};'use strict';var pm2=require(_0xa791('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x1d8503,_0x48a50b){return pm2[_0xa791('0x1')](function(_0x575f27){if(_0x575f27){return _0x48a50b(_0x575f27);}return _0x1d8503(_0xa791('0x2'));});});};exports[_0xa791('0x3')]=function(_0x4ffb7a){return connect()[_0xa791('0x4')](function(){return new BPromise(function(_0x1c317a,_0x20e78c){return pm2[_0xa791('0x3')](_0x4ffb7a,function(_0x5aac78,_0x13047f){if(_0x5aac78){return _0x20e78c(_0x5aac78);}pm2['disconnect']();return _0x1c317a(_0x13047f);});});});};exports['stop']=function(_0x37947f){return connect()[_0xa791('0x4')](function(){return new BPromise(function(_0x4243ce,_0x2ff47c){return pm2[_0xa791('0x5')](_0x37947f,function(_0x376fe7,_0x3d88c7){if(_0x376fe7){return _0x2ff47c(_0x376fe7);}pm2[_0xa791('0x6')]();return _0x4243ce(_0x3d88c7);});});});};exports[_0xa791('0x7')]=function(_0x4f1bf8){return connect()[_0xa791('0x4')](function(){return new BPromise(function(_0x5b1bba,_0x530e2a){return pm2[_0xa791('0x7')](_0x4f1bf8,function(_0x912613,_0x5b74c7){if(_0x912613){return _0x530e2a(_0x912613);}pm2[_0xa791('0x6')]();return _0x5b1bba(_0x5b74c7);});});});};exports[_0xa791('0x8')]=function(){return connect()[_0xa791('0x4')](function(){return new BPromise(function(_0x4a1672,_0x39564d){return pm2[_0xa791('0x8')](function(_0x5abcff,_0x5bd292){if(_0x5abcff){return _0x39564d(_0x5abcff);}pm2[_0xa791('0x6')]();return _0x4a1672(_0x5bd292);});});});};exports[_0xa791('0x9')]=function(_0x31654e){return connect()[_0xa791('0x4')](function(){return new BPromise(function(_0x5afba2,_0x5cf188){return pm2[_0xa791('0x9')](_0x31654e,function(_0xb3d8ae,_0x10e5a1){if(_0xb3d8ae){return _0x5cf188(_0xb3d8ae);}pm2[_0xa791('0x6')]();return _0x5afba2(_0x10e5a1);});});});};exports[_0xa791('0xa')]=function(_0x477768){return connect()['then'](function(){return new BPromise(function(_0x1bb6ed,_0x42d9d5){return pm2[_0xa791('0xa')](_0x477768,function(_0x81e090,_0x4f8499){if(_0x81e090){return _0x42d9d5(_0x81e090);}pm2['disconnect']();return _0x1bb6ed(_0x4f8499);});});});};exports[_0xa791('0xb')]=function(){return connect()[_0xa791('0x4')](function(){return new BPromise(function(_0x48ffe9,_0x1018a8){return pm2[_0xa791('0xb')](function(_0x34f725){if(_0x34f725){return _0x1018a8(_0x34f725);}return _0x48ffe9(_0xa791('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 0a6e857..b95ae61 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 _0x2f8a=['join','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','length','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../logger','schedule','redis','defaults','localhost','Setting','chatTimeout','then','ChatInteraction','findAll','minutes','info','[CHAT]\x20Interactions\x20to\x20close:'];(function(_0x2932ea,_0x19c8b4){var _0x8cb75a=function(_0x53c1bb){while(--_0x53c1bb){_0x2932ea['push'](_0x2932ea['shift']());}};_0x8cb75a(++_0x19c8b4);}(_0x2f8a,0x1d5));var _0xa2f8=function(_0x466c69,_0x2416f5){_0x466c69=_0x466c69-0x0;var _0x19660b=_0x2f8a[_0x466c69];return _0x19660b;};'use strict';var _=require(_0xa2f8('0x0'));var moment=require(_0xa2f8('0x1'));var Redis=require(_0xa2f8('0x2'));var util=require(_0xa2f8('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0xa2f8('0x4'))(_0xa2f8('0x5'));config[_0xa2f8('0x6')]=_[_0xa2f8('0x7')](config['redis'],{'host':_0xa2f8('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa2f8('0x6')]));function closeInteractions(){var _0xc523a9=0x0;var _0x498460=[];return db[_0xa2f8('0x9')]['find']({'raw':!![],'attributes':['id',_0xa2f8('0xa')],'where':{'id':0x1}})[_0xa2f8('0xb')](function(_0xd341aa){_0xc523a9=_0xd341aa[_0xa2f8('0xa')];if(_0xc523a9){return db[_0xa2f8('0xc')][_0xa2f8('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0xd341aa[_0xa2f8('0xa')],_0xa2f8('0xe'))}}});}else{return[];}})['then'](function(_0x439a32){if(_0x439a32&&_0x439a32['length']){_0x498460=_['map'](_0x439a32||[],'id');logger[_0xa2f8('0xf')](_0xa2f8('0x10'),_0x498460[_0xa2f8('0x11')]());return db[_0xa2f8('0xc')]['update']({'closeReason':'system','disposition':_0xa2f8('0x12'),'closed':!![],'closedAt':moment()[_0xa2f8('0x13')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x498460}});}})[_0xa2f8('0xb')](function(){if(_0x498460&&_0x498460['length']){logger['info'](_0xa2f8('0x14'),_0x498460[_0xa2f8('0x11')]());for(var _0x1fda29=0x0;_0x1fda29<_0x498460[_0xa2f8('0x15')];_0x1fda29++){io[_0xa2f8('0x16')](_0xa2f8('0x17'),{'id':_0x498460[_0x1fda29],'closed':!![]});}}})[_0xa2f8('0x18')](function(_0x3cd85d){logger['error'](_0xa2f8('0x19'),_0x3cd85d?util[_0xa2f8('0x1a')](_0x3cd85d,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe39c=['subtract','length','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','defaults','redis','localhost','Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0xe39c,0x6b));var _0xce39=function(_0x254639,_0x52d8b2){_0x254639=_0x254639-0x0;var _0x582063=_0xe39c[_0x254639];return _0x582063;};'use strict';var _=require(_0xce39('0x0'));var moment=require(_0xce39('0x1'));var Redis=require(_0xce39('0x2'));var util=require(_0xce39('0x3'));var config=require(_0xce39('0x4'));var db=require(_0xce39('0x5'))['db'];var logger=require(_0xce39('0x6'))('schedule');config['redis']=_[_0xce39('0x7')](config[_0xce39('0x8')],{'host':_0xce39('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0xb38448=0x0;var _0x2814d5=[];return db[_0xce39('0xa')][_0xce39('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xce39('0xc')](function(_0x14a54b){_0xb38448=_0x14a54b[_0xce39('0xd')];if(_0xb38448){return db[_0xce39('0xe')][_0xce39('0xf')]({'raw':!![],'attributes':['id',_0xce39('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xce39('0x11')](_0x14a54b[_0xce39('0xd')],'minutes')}}});}else{return[];}})[_0xce39('0xc')](function(_0x439612){if(_0x439612&&_0x439612[_0xce39('0x12')]){_0x2814d5=_['map'](_0x439612||[],'id');logger[_0xce39('0x13')]('[CHAT]\x20Interactions\x20to\x20close:',_0x2814d5[_0xce39('0x14')]());return db[_0xce39('0xe')][_0xce39('0x15')]({'closeReason':_0xce39('0x16'),'disposition':_0xce39('0x17'),'closed':!![],'closedAt':moment()[_0xce39('0x18')](_0xce39('0x19'))},{'where':{'id':_0x2814d5}});}})[_0xce39('0xc')](function(){if(_0x2814d5&&_0x2814d5[_0xce39('0x12')]){logger['info'](_0xce39('0x1a'),_0x2814d5[_0xce39('0x14')]());for(var _0x579d05=0x0;_0x579d05<_0x2814d5[_0xce39('0x12')];_0x579d05++){io['emit']('chatInteraction:update',{'id':_0x2814d5[_0x579d05],'closed':!![]});}}})[_0xce39('0x1b')](function(_0x66206d){logger[_0xce39('0x1c')](_0xce39('0x1d'),_0x66206d?util[_0xce39('0x1e')](_0x66206d,{'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/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index dcf4691..d5dd6fa 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 _0x29e7=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x1c8aa5,_0x51cc97){var _0x484ba2=function(_0x17f5f1){while(--_0x17f5f1){_0x1c8aa5['push'](_0x1c8aa5['shift']());}};_0x484ba2(++_0x51cc97);}(_0x29e7,0x1ee));var _0x729e=function(_0x1f2f86,_0x57341c){_0x1f2f86=_0x1f2f86-0x0;var _0x43a6b3=_0x29e7[_0x1f2f86];return _0x43a6b3;};'use strict';function start(){var _0x44a494=require(_0x729e('0x0'));return _0x44a494[_0x729e('0x1')]();}module[_0x729e('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x5c61=['startAllRefreshIntervals','exports'];(function(_0x5ea2c7,_0x5be5ca){var _0x1f9eba=function(_0x562963){while(--_0x562963){_0x5ea2c7['push'](_0x5ea2c7['shift']());}};_0x1f9eba(++_0x5be5ca);}(_0x5c61,0xcc));var _0x15c6=function(_0x380ca1,_0x1f1a1b){_0x380ca1=_0x380ca1-0x0;var _0x1defa7=_0x5c61[_0x380ca1];return _0x1defa7;};'use strict';function start(){var _0x5d551c=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x5d551c[_0x15c6('0x0')]();}module[_0x15c6('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 7a4d87b..b79d012 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 _0x3816=['zip','join','existsSync','status','Sent','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','attachments','text','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','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','catch','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','map','toString','difference','length','exists','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','stop','deleteJob','stop\x20cron','endAt','update','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','basename','savename','extname'];(function(_0x3ce225,_0x48bc00){var _0x32aaa3=function(_0xceb0af){while(--_0xceb0af){_0x3ce225['push'](_0x3ce225['shift']());}};_0x32aaa3(++_0x48bc00);}(_0x3816,0xe6));var _0x6381=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0x3816[_0x4bcf38];return _0x4a89be;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x6381('0x0'));var _=require(_0x6381('0x1'));var moment=require(_0x6381('0x2'));var CronJobManager=require(_0x6381('0x3'));var jayson=require(_0x6381('0x4'));var BPromise=require(_0x6381('0x5'));var logger=require('../logger')('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x6381('0x6'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x6381('0x7')][_0x6381('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x276d2f,_0x3dd72f){return function(){logger[_0x6381('0x9')](_0x6381('0xa'),_0x276d2f['email']);var _0x1e9908=!![];var _0x3083fb={'tls':{'rejectUnauthorized':![]}};if(_0x276d2f[_0x6381('0xb')][_0x6381('0xc')][_0x6381('0xd')]){_0x3083fb[_0x6381('0xd')]=_0x276d2f[_0x6381('0xb')]['Smtp'][_0x6381('0xd')];}else{_0x3083fb[_0x6381('0xe')]=_0x276d2f[_0x6381('0xb')]['Smtp'][_0x6381('0xe')];_0x3083fb[_0x6381('0xf')]=_0x276d2f[_0x6381('0xb')][_0x6381('0xc')]['port'];_0x3083fb[_0x6381('0x10')]=_0x276d2f[_0x6381('0xb')][_0x6381('0xc')][_0x6381('0x10')];}if(_0x276d2f['MailAccount'][_0x6381('0xc')][_0x6381('0x11')]){_0x3083fb[_0x6381('0x12')]={'user':_0x276d2f['MailAccount'][_0x6381('0xc')]['user'],'pass':_0x276d2f[_0x6381('0xb')]['Smtp'][_0x6381('0x13')]};}var _0x55867e={'account':_0x3083fb,'message':{'from':util[_0x6381('0x14')](_0x6381('0x15'),_0x276d2f[_0x6381('0xb')][_0x6381('0x16')],_0x276d2f[_0x6381('0xb')]['email']||_0x276d2f[_0x6381('0xb')][_0x6381('0xc')]['user']),'to':_0x276d2f[_0x6381('0x17')],'cc':_0x276d2f['cc'],'bcc':_0x276d2f[_0x6381('0x18')],'subject':util['format'](_0x6381('0x19'),_0x3dd72f[_0x6381('0x16')],_0x276d2f[_0x6381('0x1a')],_0x276d2f[_0x6381('0x1b')])}};var _0xd97d75=path['join'](__dirname,'../../files/reports');var _0x15d07a=_0x3dd72f['savename'];var _0x413a59=util[_0x6381('0x14')]('%s.%s',path[_0x6381('0x1c')](_0x3dd72f[_0x6381('0x1d')],path[_0x6381('0x1e')](_0x3dd72f['savename'])),_0x6381('0x1f'));var _0x458f34=path[_0x6381('0x20')](_0xd97d75,_0x15d07a);var _0x1fbe6f=path['join'](_0xd97d75,_0x413a59);if(fs[_0x6381('0x21')](_0x458f34)){_0x3dd72f[_0x6381('0x22')]=_0x6381('0x23');_0x55867e[_0x6381('0x24')]['attachments']=[{'filename':_0x15d07a,'path':_0x458f34}];_0x55867e[_0x6381('0x24')]['text']=util[_0x6381('0x14')](_0x6381('0x25'),JSON['stringify'](_0x3dd72f,null,0x2));}else if(fs[_0x6381('0x21')](_0x1fbe6f)){_0x3dd72f[_0x6381('0x22')]='Sent';_0x55867e[_0x6381('0x24')][_0x6381('0x26')]=[{'filename':_0x413a59,'path':_0x1fbe6f}];}else{_0x55867e[_0x6381('0x24')][_0x6381('0x27')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x276d2f['sendIfEmpty']){_0x1e9908=![];logger[_0x6381('0x9')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x1e9908){return client[_0x6381('0x28')](_0x6381('0x29'),_0x55867e)[_0x6381('0x2a')](function(_0x48bce0){if(_0x48bce0[_0x6381('0x2b')]){return logger[_0x6381('0x2b')](_0x6381('0x2c'),JSON[_0x6381('0x2d')](_0x48bce0));}return logger['info'](_0x6381('0x2e'));})['catch'](function(_0x113cd1){return logger[_0x6381('0x2b')]('error\x20mail',JSON['stringify'](_0x113cd1));});}};}function handleError(){return function(_0x53a816){return logger[_0x6381('0x2b')](JSON[_0x6381('0x2d')](_0x53a816));};}function handleResult(_0x14f79c){return function(_0x124261){logger[_0x6381('0x9')](_0x6381('0x2f'),JSON['stringify'](_0x124261));if(_0x14f79c['MailAccount']&&_0x14f79c[_0x6381('0xb')]['Smtp']&&!_['isNil'](_0x14f79c['email'])){setTimeout(handleSendEmail(_0x14f79c,_0x124261),0x3c*0x3e8);}};}function handleJob(_0x837f88){return function(){try{if(_[_0x6381('0x30')](_0x837f88[_0x6381('0x1a')])){return logger['info'](_0x6381('0x31'));}if(_[_0x6381('0x30')](_0x837f88['subtractUnit'])){return logger[_0x6381('0x9')](_0x6381('0x32'));}var _0x18ec00={'startDate':moment()['subtract'](_0x837f88[_0x6381('0x1a')],_0x837f88[_0x6381('0x1b')])[_0x6381('0x14')](_0x6381('0x33')),'endDate':moment()['format'](_0x6381('0x33')),'type':_0x6381('0x34'),'output':_0x837f88['output'],'name':_0x837f88[_0x6381('0x16')]};if(!_[_0x6381('0x30')](_0x837f88[_0x6381('0x35')])){logger[_0x6381('0x9')](_0x6381('0x36'),_0x837f88[_0x6381('0x35')]);return analyticDefaultReportController[_0x6381('0x37')]({'id':_0x837f88[_0x6381('0x35')]},_0x18ec00)[_0x6381('0x2a')](handleResult(_0x837f88))['catch'](handleError());}if(!_[_0x6381('0x30')](_0x837f88[_0x6381('0x38')])){logger[_0x6381('0x9')](_0x6381('0x39'),_0x837f88[_0x6381('0x38')]);return analyticCustomReportController[_0x6381('0x37')]({'id':_0x837f88[_0x6381('0x38')]},_0x18ec00)[_0x6381('0x2a')](handleResult(_0x837f88))[_0x6381('0x3a')](handleError());}}catch(_0x87e0b3){logger[_0x6381('0x2b')](JSON[_0x6381('0x2d')](_0x87e0b3));}return logger[_0x6381('0x9')](_0x6381('0x3b'));};}function getJobs(_0x2af8c1){var _0xe1d5f4={};if(_0x2af8c1){_0xe1d5f4['id']=_0x2af8c1;}return db[_0x6381('0x3c')]['findAll']({'where':_0xe1d5f4,'include':[{'model':db[_0x6381('0xb')],'attributes':['id',_0x6381('0x16'),'email'],'include':[{'model':db[_0x6381('0x3d')],'as':_0x6381('0xc')}]}]})[_0x6381('0x2a')](function(_0x140424){var _0x2f3a14=_[_0x6381('0x3e')](manager[_0x6381('0x3f')]);var _0xce97b8=_[_0x6381('0x40')](_0x140424,function(_0x587cd7){return _0x587cd7['id'][_0x6381('0x41')]();});var _0x4e5bc5=_['keyBy'](_0x140424,function(_0x127506){return _0x127506['id'][_0x6381('0x41')]();});var _0x32b318=_0x2af8c1?_0xce97b8:_['difference'](_0xce97b8,_0x2f3a14);var _0xbe4866=_['intersection'](_0xce97b8,_0x2f3a14);var _0x3bda69=_[_0x6381('0x42')](_0x2f3a14,_0xce97b8);var _0x7d5394;var _0x1a65b5;for(_0x7d5394=0x0;_0x7d5394<_0x3bda69[_0x6381('0x43')]&&!_0x2af8c1;_0x7d5394+=0x1){_0x1a65b5=_0x3bda69[_0x7d5394]['toString']();if(manager[_0x6381('0x44')](_0x1a65b5)){manager['stop'](_0x1a65b5);manager['deleteJob'](_0x1a65b5);logger[_0x6381('0x9')](_0x6381('0x45'),_0x1a65b5);}}logger[_0x6381('0x9')](_0x6381('0x46'),JSON[_0x6381('0x2d')](_0x32b318));for(_0x7d5394=0x0;_0x7d5394<_0x32b318['length'];_0x7d5394+=0x1){_0x1a65b5=_0x32b318[_0x7d5394]['toString']();logger[_0x6381('0x9')](_0x6381('0x47'),_0x1a65b5);if(_0x2af8c1){logger[_0x6381('0x9')](_0x6381('0x48'),_0x2af8c1);logger[_0x6381('0x9')](JSON[_0x6381('0x2d')](_0x4e5bc5[_0x1a65b5]));BPromise[_0x6381('0x49')]()[_0x6381('0x2a')](handleJob(_0x4e5bc5[_0x1a65b5]));logger[_0x6381('0x9')](_0x6381('0x4a'),_0x4e5bc5[_0x1a65b5][_0x6381('0x16')],_0x4e5bc5[_0x1a65b5][_0x6381('0x4b')]);}else if(_0x4e5bc5[_0x1a65b5][_0x6381('0x4b')]&&_0x4e5bc5[_0x1a65b5][_0x6381('0x4c')]&&moment()[_0x6381('0x4d')](_0x4e5bc5[_0x1a65b5][_0x6381('0x4e')],_0x4e5bc5[_0x1a65b5]['endAt'])){manager[_0x6381('0x4f')](_0x1a65b5,_0x4e5bc5[_0x1a65b5][_0x6381('0x4b')],handleJob(_0x4e5bc5[_0x1a65b5]));manager[_0x6381('0x50')](_0x1a65b5);logger['info']('add\x20cron',_0x4e5bc5[_0x1a65b5][_0x6381('0x16')],_0x4e5bc5[_0x1a65b5]['cron']);}else if(manager[_0x6381('0x44')](_0x1a65b5)){manager[_0x6381('0x51')](_0x1a65b5);manager[_0x6381('0x52')](_0x1a65b5);logger[_0x6381('0x9')](_0x6381('0x53'),_0x4e5bc5[_0x1a65b5][_0x6381('0x16')],_0x4e5bc5[_0x1a65b5][_0x6381('0x4b')]);}}for(_0x7d5394=0x0,_0x1a65b5;_0x7d5394<_0xbe4866['length']&&!_0x2af8c1;_0x7d5394+=0x1){_0x1a65b5=_0xbe4866[_0x7d5394][_0x6381('0x41')]();if(manager[_0x6381('0x44')](_0x1a65b5)){if(_0x4e5bc5[_0x1a65b5][_0x6381('0x4b')]&&_0x4e5bc5[_0x1a65b5][_0x6381('0x4c')]&&moment()[_0x6381('0x4d')](_0x4e5bc5[_0x1a65b5][_0x6381('0x4e')],_0x4e5bc5[_0x1a65b5][_0x6381('0x54')])){manager[_0x6381('0x55')](_0x1a65b5,_0x4e5bc5[_0x1a65b5][_0x6381('0x4b')],handleJob(_0x4e5bc5[_0x1a65b5]));logger['info']('update\x20cron',_0x4e5bc5[_0x1a65b5][_0x6381('0x16')],_0x4e5bc5[_0x1a65b5]['cron']);}else{manager[_0x6381('0x51')](_0x1a65b5);manager[_0x6381('0x52')](_0x1a65b5);logger[_0x6381('0x9')](_0x6381('0x53'),_0x4e5bc5[_0x1a65b5][_0x6381('0x16')],_0x4e5bc5[_0x1a65b5][_0x6381('0x4b')]);}}}})[_0x6381('0x3a')](function(_0x3ce7d1){logger['error'](JSON[_0x6381('0x2d')](_0x3ce7d1));});}exports[_0x6381('0x56')]=function(_0xaf844f){return getJobs(_0xaf844f);};exports[_0x6381('0x50')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x15d7=['subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','then','keys','jobs','map','toString','difference','intersection','length','stop','toRun','my\x20id','resolve','run\x20job','cron','isBetween','startAt','add','start','add\x20cron','exists','deleteJob','stop\x20cron','active','endAt','update\x20cron','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','service','MailAccount','port','Smtp','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','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','stringify','Sent','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','error','email\x20sent','catch','error\x20mail','info','data','isNil'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x15d7,0x19f));var _0x715d=function(_0x13e56c,_0x315322){_0x13e56c=_0x13e56c-0x0;var _0x2f6321=_0x15d7[_0x13e56c];return _0x2f6321;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x715d('0x0'));var _=require(_0x715d('0x1'));var moment=require(_0x715d('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x715d('0x3'));var BPromise=require(_0x715d('0x4'));var logger=require(_0x715d('0x5'))(_0x715d('0x6'));var db=require(_0x715d('0x7'))['db'];var analyticCustomReportController=require(_0x715d('0x8'));var analyticDefaultReportController=require(_0x715d('0x9'));var client=jayson[_0x715d('0xa')][_0x715d('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5787a8,_0x560c25){return function(){logger['info'](_0x715d('0xc'),_0x5787a8[_0x715d('0xd')]);var _0x203ec8=!![];var _0x43e4f6={'tls':{'rejectUnauthorized':![]}};if(_0x5787a8['MailAccount']['Smtp'][_0x715d('0xe')]){_0x43e4f6['service']=_0x5787a8['MailAccount']['Smtp'][_0x715d('0xe')];}else{_0x43e4f6['host']=_0x5787a8[_0x715d('0xf')]['Smtp']['host'];_0x43e4f6[_0x715d('0x10')]=_0x5787a8[_0x715d('0xf')][_0x715d('0x11')][_0x715d('0x10')];_0x43e4f6[_0x715d('0x12')]=_0x5787a8[_0x715d('0xf')][_0x715d('0x11')][_0x715d('0x12')];}if(_0x5787a8['MailAccount'][_0x715d('0x11')][_0x715d('0x13')]){_0x43e4f6[_0x715d('0x14')]={'user':_0x5787a8[_0x715d('0xf')]['Smtp'][_0x715d('0x15')],'pass':_0x5787a8[_0x715d('0xf')][_0x715d('0x11')][_0x715d('0x16')]};}var _0x54cd2a={'account':_0x43e4f6,'message':{'from':util[_0x715d('0x17')](_0x715d('0x18'),_0x5787a8[_0x715d('0xf')][_0x715d('0x19')],_0x5787a8['MailAccount']['email']||_0x5787a8['MailAccount'][_0x715d('0x11')][_0x715d('0x15')]),'to':_0x5787a8[_0x715d('0xd')],'cc':_0x5787a8['cc'],'bcc':_0x5787a8[_0x715d('0x1a')],'subject':util[_0x715d('0x17')]('Report\x20%s\x20last\x20%s\x20%s',_0x560c25[_0x715d('0x19')],_0x5787a8[_0x715d('0x1b')],_0x5787a8[_0x715d('0x1c')])}};var _0x3273ae=path[_0x715d('0x1d')](__dirname,_0x715d('0x1e'));var _0x2793b9=_0x560c25[_0x715d('0x1f')];var _0x18b47c=util[_0x715d('0x17')](_0x715d('0x20'),path[_0x715d('0x21')](_0x560c25['savename'],path[_0x715d('0x22')](_0x560c25[_0x715d('0x1f')])),_0x715d('0x23'));var _0x34c8d9=path[_0x715d('0x1d')](_0x3273ae,_0x2793b9);var _0x261b42=path[_0x715d('0x1d')](_0x3273ae,_0x18b47c);if(fs[_0x715d('0x24')](_0x34c8d9)){_0x560c25[_0x715d('0x25')]='Sent';_0x54cd2a[_0x715d('0x26')]['attachments']=[{'filename':_0x2793b9,'path':_0x34c8d9}];_0x54cd2a[_0x715d('0x26')][_0x715d('0x27')]=util[_0x715d('0x17')](_0x715d('0x28'),JSON[_0x715d('0x29')](_0x560c25,null,0x2));}else if(fs['existsSync'](_0x261b42)){_0x560c25[_0x715d('0x25')]=_0x715d('0x2a');_0x54cd2a[_0x715d('0x26')][_0x715d('0x2b')]=[{'filename':_0x18b47c,'path':_0x261b42}];}else{_0x54cd2a['message'][_0x715d('0x27')]=_0x715d('0x2c');if(!_0x5787a8[_0x715d('0x2d')]){_0x203ec8=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x203ec8){return client[_0x715d('0x2e')](_0x715d('0x2f'),_0x54cd2a)['then'](function(_0x48a2aa){if(_0x48a2aa[_0x715d('0x30')]){return logger[_0x715d('0x30')]('error\x20mail',JSON[_0x715d('0x29')](_0x48a2aa));}return logger['info'](_0x715d('0x31'));})[_0x715d('0x32')](function(_0x1d93b6){return logger[_0x715d('0x30')](_0x715d('0x33'),JSON[_0x715d('0x29')](_0x1d93b6));});}};}function handleError(){return function(_0x380098){return logger[_0x715d('0x30')](JSON['stringify'](_0x380098));};}function handleResult(_0x26251c){return function(_0x173ae7){logger[_0x715d('0x34')](_0x715d('0x35'),JSON[_0x715d('0x29')](_0x173ae7));if(_0x26251c['MailAccount']&&_0x26251c[_0x715d('0xf')][_0x715d('0x11')]&&!_[_0x715d('0x36')](_0x26251c[_0x715d('0xd')])){setTimeout(handleSendEmail(_0x26251c,_0x173ae7),0x3c*0x3e8);}};}function handleJob(_0x31ef9b){return function(){try{if(_[_0x715d('0x36')](_0x31ef9b[_0x715d('0x1b')])){return logger[_0x715d('0x34')](_0x715d('0x37'));}if(_['isNil'](_0x31ef9b[_0x715d('0x1c')])){return logger[_0x715d('0x34')](_0x715d('0x38'));}var _0x4e86f4={'startDate':moment()[_0x715d('0x39')](_0x31ef9b[_0x715d('0x1b')],_0x31ef9b['subtractUnit'])[_0x715d('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x715d('0x17')](_0x715d('0x3a')),'type':_0x715d('0x3b'),'output':_0x31ef9b[_0x715d('0x3c')],'name':_0x31ef9b['name']};if(!_[_0x715d('0x36')](_0x31ef9b['DefaultReportId'])){logger[_0x715d('0x34')](_0x715d('0x3d'),_0x31ef9b['DefaultReportId']);return analyticDefaultReportController[_0x715d('0x3e')]({'id':_0x31ef9b[_0x715d('0x3f')]},_0x4e86f4)['then'](handleResult(_0x31ef9b))[_0x715d('0x32')](handleError());}if(!_[_0x715d('0x36')](_0x31ef9b['CustomReportId'])){logger[_0x715d('0x34')](_0x715d('0x40'),_0x31ef9b[_0x715d('0x41')]);return analyticCustomReportController['runReport']({'id':_0x31ef9b[_0x715d('0x41')]},_0x4e86f4)['then'](handleResult(_0x31ef9b))[_0x715d('0x32')](handleError());}}catch(_0x38d0b5){logger[_0x715d('0x30')](JSON['stringify'](_0x38d0b5));}return logger[_0x715d('0x34')](_0x715d('0x42'));};}function getJobs(_0x36967f){var _0x2fc98a={};if(_0x36967f){_0x2fc98a['id']=_0x36967f;}return db[_0x715d('0x43')][_0x715d('0x44')]({'where':_0x2fc98a,'include':[{'model':db['MailAccount'],'attributes':['id',_0x715d('0x19'),_0x715d('0xd')],'include':[{'model':db['MailServerOut'],'as':_0x715d('0x11')}]}]})[_0x715d('0x45')](function(_0x4ae475){var _0x52e60f=_[_0x715d('0x46')](manager[_0x715d('0x47')]);var _0x36ce27=_[_0x715d('0x48')](_0x4ae475,function(_0x3e89d6){return _0x3e89d6['id'][_0x715d('0x49')]();});var _0x20f4cf=_['keyBy'](_0x4ae475,function(_0x161363){return _0x161363['id'][_0x715d('0x49')]();});var _0x240606=_0x36967f?_0x36ce27:_[_0x715d('0x4a')](_0x36ce27,_0x52e60f);var _0x176ec5=_[_0x715d('0x4b')](_0x36ce27,_0x52e60f);var _0x3e2a2b=_[_0x715d('0x4a')](_0x52e60f,_0x36ce27);var _0xcfae6b;var _0x544610;for(_0xcfae6b=0x0;_0xcfae6b<_0x3e2a2b[_0x715d('0x4c')]&&!_0x36967f;_0xcfae6b+=0x1){_0x544610=_0x3e2a2b[_0xcfae6b][_0x715d('0x49')]();if(manager['exists'](_0x544610)){manager[_0x715d('0x4d')](_0x544610);manager['deleteJob'](_0x544610);logger[_0x715d('0x34')]('delete\x20cron',_0x544610);}}logger['info'](_0x715d('0x4e'),JSON[_0x715d('0x29')](_0x240606));for(_0xcfae6b=0x0;_0xcfae6b<_0x240606[_0x715d('0x4c')];_0xcfae6b+=0x1){_0x544610=_0x240606[_0xcfae6b][_0x715d('0x49')]();logger[_0x715d('0x34')]('index',_0x544610);if(_0x36967f){logger[_0x715d('0x34')](_0x715d('0x4f'),_0x36967f);logger[_0x715d('0x34')](JSON[_0x715d('0x29')](_0x20f4cf[_0x544610]));BPromise[_0x715d('0x50')]()['then'](handleJob(_0x20f4cf[_0x544610]));logger[_0x715d('0x34')](_0x715d('0x51'),_0x20f4cf[_0x544610]['name'],_0x20f4cf[_0x544610][_0x715d('0x52')]);}else if(_0x20f4cf[_0x544610][_0x715d('0x52')]&&_0x20f4cf[_0x544610]['active']&&moment()[_0x715d('0x53')](_0x20f4cf[_0x544610][_0x715d('0x54')],_0x20f4cf[_0x544610]['endAt'])){manager[_0x715d('0x55')](_0x544610,_0x20f4cf[_0x544610][_0x715d('0x52')],handleJob(_0x20f4cf[_0x544610]));manager[_0x715d('0x56')](_0x544610);logger[_0x715d('0x34')](_0x715d('0x57'),_0x20f4cf[_0x544610][_0x715d('0x19')],_0x20f4cf[_0x544610]['cron']);}else if(manager[_0x715d('0x58')](_0x544610)){manager[_0x715d('0x4d')](_0x544610);manager[_0x715d('0x59')](_0x544610);logger[_0x715d('0x34')](_0x715d('0x5a'),_0x20f4cf[_0x544610][_0x715d('0x19')],_0x20f4cf[_0x544610][_0x715d('0x52')]);}}for(_0xcfae6b=0x0,_0x544610;_0xcfae6b<_0x176ec5[_0x715d('0x4c')]&&!_0x36967f;_0xcfae6b+=0x1){_0x544610=_0x176ec5[_0xcfae6b][_0x715d('0x49')]();if(manager[_0x715d('0x58')](_0x544610)){if(_0x20f4cf[_0x544610][_0x715d('0x52')]&&_0x20f4cf[_0x544610][_0x715d('0x5b')]&&moment()[_0x715d('0x53')](_0x20f4cf[_0x544610][_0x715d('0x54')],_0x20f4cf[_0x544610][_0x715d('0x5c')])){manager['update'](_0x544610,_0x20f4cf[_0x544610][_0x715d('0x52')],handleJob(_0x20f4cf[_0x544610]));logger[_0x715d('0x34')](_0x715d('0x5d'),_0x20f4cf[_0x544610][_0x715d('0x19')],_0x20f4cf[_0x544610]['cron']);}else{manager[_0x715d('0x4d')](_0x544610);manager[_0x715d('0x59')](_0x544610);logger['info'](_0x715d('0x5a'),_0x20f4cf[_0x544610]['name'],_0x20f4cf[_0x544610]['cron']);}}}})['catch'](function(_0x2d110f){logger[_0x715d('0x30')](JSON[_0x715d('0x29')](_0x2d110f));});}exports['run']=function(_0x1af3f5){return getJobs(_0x1af3f5);};exports[_0x715d('0x56')]=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 5fa787c..dc01973 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 _0x7c59=['data2','transcribeRegion','then','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','info','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','sentimentAccountId','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Negative','Mixed','Neutral','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','findOne','Cloud\x20Provider\x20not\x20configured','Positive','catch','name','inspect','VoiceRecording','findAll','IN_PROGRESS','length','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','SequelizeValidationError','start','aws-sdk','request-promise','util','bluebird','../../config/logger','transcribe','getTranscriptionJob','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x7c59,0x147));var _0x97c5=function(_0x3e293a,_0xf44425){_0x3e293a=_0x3e293a-0x0;var _0x45e7cf=_0x7c59[_0x3e293a];return _0x45e7cf;};var _=require('lodash');var AWS=require(_0x97c5('0x0'));var rp=require(_0x97c5('0x1'));var util=require(_0x97c5('0x2'));var BPromise=require(_0x97c5('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x97c5('0x4'))(_0x97c5('0x5'));function getTranscriptionJob(_0x4982de,_0x574b06,_0x42b9bc,_0x434211){return new Promise(function(_0x29832f,_0xb7c5e1){var _0x13663d=new AWS['TranscribeService']({'accessKeyId':_0x574b06,'secretAccessKey':_0x4982de,'region':_0x42b9bc});_0x13663d[_0x97c5('0x6')]({'TranscriptionJobName':_0x434211},function(_0x58d9b0,_0x5b514c){if(_0x58d9b0){return _0xb7c5e1(_0x58d9b0);}else{return _0x29832f(_0x5b514c);}});});}function sentiment(_0x25ece8,_0x26b509,_0x46c58a,_0x51c5ce,_0x349acf){return new Promise(function(_0x37786b,_0x438d6e){var _0x948b39=new AWS['Comprehend']({'accessKeyId':_0x26b509,'secretAccessKey':_0x25ece8,'region':_0x46c58a});_0x948b39[_0x97c5('0x7')]({'Text':_0x51c5ce,'LanguageCode':_0x349acf[_0x97c5('0x8')](0x0,0x2)},function(_0x2ae5af,_0x597e49){if(_0x2ae5af){return _0x438d6e(_0x2ae5af);}else{return _0x37786b(_0x597e49);}});});}function checkTranscribeJob(_0x14e017,_0xf44acf,_0x3704de){var _0x2e27a3;return new BPromise(function(_0x3b6a57,_0x485e86){logger['info'](util[_0x97c5('0x9')](_0x97c5('0xa'),_0x14e017['id'],_0x14e017[_0x97c5('0xb')]));return getTranscriptionJob(_0x3704de[_0x97c5('0xc')],_0x3704de[_0x97c5('0xd')],_0xf44acf[_0x97c5('0xe')],_0x14e017[_0x97c5('0xb')])[_0x97c5('0xf')](function(_0x2ac994){logger['info'](util[_0x97c5('0x9')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x14e017['id'],_0x14e017[_0x97c5('0xb')],_0x2ac994[_0x97c5('0x10')][_0x97c5('0x11')]));if(!_0x14e017[_0x97c5('0x12')]){switch(_0x2ac994[_0x97c5('0x10')]['TranscriptionJobStatus']){case _0x97c5('0x13'):var _0x588389={'transcribeStatus':_0x2ac994[_0x97c5('0x10')]['TranscriptionJobStatus'],'fileUri':_0x2ac994[_0x97c5('0x10')][_0x97c5('0x14')]['TranscriptFileUri']};logger[_0x97c5('0x15')](util['format'](_0x97c5('0x16'),_0x14e017['id']));return rp({'uri':_0x2ac994[_0x97c5('0x10')][_0x97c5('0x14')][_0x97c5('0x17')],'json':!![]})[_0x97c5('0xf')](function(_0x4bf3d6){logger[_0x97c5('0x15')](util['format'](_0x97c5('0x18'),_0x14e017['id']));if(_0x4bf3d6&&_0x4bf3d6[_0x97c5('0x19')]&&_0x4bf3d6['results'][_0x97c5('0x1a')]&&_0x4bf3d6['results'][_0x97c5('0x1a')]['length']){_0x588389[_0x97c5('0x12')]='';for(var _0x144fd0=0x0;_0x144fd0<_0x4bf3d6[_0x97c5('0x19')][_0x97c5('0x1a')]['length'];_0x144fd0++){_0x588389[_0x97c5('0x12')]+=_0x4bf3d6['results'][_0x97c5('0x1a')][_0x144fd0]['transcript']+'';}}return _0x14e017[_0x97c5('0x1b')](_0x588389);})[_0x97c5('0xf')](function(){logger[_0x97c5('0x15')](util[_0x97c5('0x9')](_0x97c5('0x1c'),_0x14e017['id']));if(!_0x14e017[_0x97c5('0x1d')]){throw new db[(_0x97c5('0x1e'))]['ValidationError'](_0x97c5('0x1f'));}if(!_0xf44acf[_0x97c5('0x20')]||!_0xf44acf['sentimentAccountId']||!_0xf44acf[_0x97c5('0x21')]||!_0xf44acf[_0x97c5('0x22')]||!_0xf44acf[_0x97c5('0x23')]){throw new db[(_0x97c5('0x1e'))][(_0x97c5('0x24'))](_0x97c5('0x25'));}if(!_0x588389['fileText']){throw new Error(_0x97c5('0x26'));}if(_0xf44acf['sentimentAccountId']===_0x3704de['id']){return _0x3704de;}else{return db[_0x97c5('0x27')]['findOne']({'where':{'id':_settings[_0x97c5('0x28')]}});}})[_0x97c5('0xf')](function(_0x423561){if(!_0x423561){throw new db[(_0x97c5('0x1e'))][(_0x97c5('0x24'))](_0x97c5('0x29'));}if(!_0x423561[_0x97c5('0xc')]||!_0x423561['data2']){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x2e27a3=_0x423561;logger['info'](util[_0x97c5('0x9')](_0x97c5('0x2a'),_0x14e017['id']));return sentiment(_0x2e27a3['data1'],_0x2e27a3[_0x97c5('0xd')],_0xf44acf[_0x97c5('0x21')],_0x588389[_0x97c5('0x12')],_0xf44acf['language']);})['then'](function(_0x2a7083){logger['info'](util[_0x97c5('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x14e017['id']));return _0x14e017[_0x97c5('0x1b')]({'sentiment':_0x2a7083[_0x97c5('0x2b')],'sPositive':_0x2a7083[_0x97c5('0x2c')]['Positive'],'sNegative':_0x2a7083[_0x97c5('0x2c')][_0x97c5('0x2d')],'sMixed':_0x2a7083['SentimentScore'][_0x97c5('0x2e')],'sNeutral':_0x2a7083[_0x97c5('0x2c')][_0x97c5('0x2f')]});})['then'](function(){logger[_0x97c5('0x15')](util[_0x97c5('0x9')](_0x97c5('0x1c'),_0x14e017['id']));_0x3b6a57();});case'FAILED':return _0x14e017[_0x97c5('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x2ac994[_0x97c5('0x10')][_0x97c5('0x30')]})[_0x97c5('0xf')](function(){logger[_0x97c5('0x15')](util[_0x97c5('0x9')](_0x97c5('0x1c'),_0x14e017['id']));_0x3b6a57();});default:logger[_0x97c5('0x15')](util[_0x97c5('0x9')](_0x97c5('0x31'),_0x14e017['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x14e017[_0x97c5('0x1d')]){throw new db[(_0x97c5('0x1e'))][(_0x97c5('0x24'))](_0x97c5('0x1f'));}if(!_0xf44acf[_0x97c5('0x20')]||!_0xf44acf['sentimentAccountId']||!_0xf44acf[_0x97c5('0x21')]||!_0xf44acf['language']||!_0xf44acf[_0x97c5('0x23')]){throw new db[(_0x97c5('0x1e'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x14e017[_0x97c5('0x12')]){throw new Error(_0x97c5('0x26'));}if(_0xf44acf[_0x97c5('0x28')]===_0x3704de['id']){return _0x3704de;}else{return db['CloudProvider'][_0x97c5('0x32')]({'where':{'id':_settings[_0x97c5('0x28')]}});}})['then'](function(_0x3e2f5d){if(!_0x3e2f5d){throw new db[(_0x97c5('0x1e'))][(_0x97c5('0x24'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3e2f5d[_0x97c5('0xc')]||!_0x3e2f5d[_0x97c5('0xd')]){throw new db['Sequelize'][(_0x97c5('0x24'))](_0x97c5('0x33'));}_0x2e27a3=_0x3e2f5d;logger[_0x97c5('0x15')](util[_0x97c5('0x9')](_0x97c5('0x2a'),_0x14e017['id']));return sentiment(_0x2e27a3[_0x97c5('0xc')],_0x2e27a3[_0x97c5('0xd')],_0xf44acf[_0x97c5('0x21')],_0x14e017[_0x97c5('0x12')],_0xf44acf[_0x97c5('0x22')]);})[_0x97c5('0xf')](function(_0x22f63e){logger[_0x97c5('0x15')](util[_0x97c5('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x14e017['id']));return _0x14e017['update']({'sentiment':_0x22f63e[_0x97c5('0x2b')],'sPositive':_0x22f63e[_0x97c5('0x2c')][_0x97c5('0x34')],'sNegative':_0x22f63e[_0x97c5('0x2c')][_0x97c5('0x2d')],'sMixed':_0x22f63e['SentimentScore'][_0x97c5('0x2e')],'sNeutral':_0x22f63e[_0x97c5('0x2c')]['Neutral'],'transcribeStatus':_0x97c5('0x13')});})[_0x97c5('0xf')](function(){logger[_0x97c5('0x15')](util['format'](_0x97c5('0x1c'),_0x14e017['id']));_0x3b6a57();});}})[_0x97c5('0x35')](function(_0x4ee644){if(_0x4ee644){if(!_0x4ee644['name']||_0x4ee644[_0x97c5('0x36')]!=='SequelizeValidationError'){logger['error'](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x14e017['id']),util[_0x97c5('0x37')](_0x4ee644,{'showHidden':![],'depth':null}));}}_0x3b6a57();});});}function checkTranscribe(){var _0x85ae40;var _0x3524d4;var _0x583b33;return db[_0x97c5('0x38')][_0x97c5('0x39')]({'where':{'transcribeStatus':_0x97c5('0x3a')}})[_0x97c5('0xf')](function(_0x5db0a0){if(!_0x5db0a0||!_0x5db0a0[_0x97c5('0x3b')]){throw new db['Sequelize'][(_0x97c5('0x24'))](_0x97c5('0x3c'));}_0x85ae40=_0x5db0a0;return db['Setting'][_0x97c5('0x32')]({'where':{'id':0x1}});})['then'](function(_0x25d1a3){if(!_0x25d1a3){throw new db[(_0x97c5('0x1e'))]['ValidationError'](_0x97c5('0x3d'));}_0x3524d4=_0x25d1a3;if(!_0x3524d4[_0x97c5('0x5')]||!_0x3524d4[_0x97c5('0x3e')]||!_0x3524d4['transcribeRegion']||!_0x3524d4['language']||!_0x3524d4['bucket']){throw new db[(_0x97c5('0x1e'))][(_0x97c5('0x24'))](_0x97c5('0x3f'));}return db[_0x97c5('0x27')][_0x97c5('0x32')]({'where':{'id':_0x3524d4['transcribeAccountId']}});})[_0x97c5('0xf')](function(_0x3851eb){if(!_0x3851eb){throw new db[(_0x97c5('0x1e'))]['ValidationError'](_0x97c5('0x29'));}if(!_0x3851eb['data1']||!_0x3851eb[_0x97c5('0xd')]){throw new db[(_0x97c5('0x1e'))][(_0x97c5('0x24'))](_0x97c5('0x33'));}_0x583b33=_0x3851eb;var _0xa921d5=[];_0x85ae40['forEach'](function(_0x10df0c){_0xa921d5[_0x97c5('0x40')](checkTranscribeJob(_0x10df0c,_0x3524d4,_0x583b33));});return BPromise[_0x97c5('0x41')](_0xa921d5);})[_0x97c5('0x35')](function(_0x2f9909){if(_0x2f9909){if(!_0x2f9909['name']||_0x2f9909[_0x97c5('0x36')]!==_0x97c5('0x42')){logger['error'](util[_0x97c5('0x37')](_0x2f9909,{'showHidden':![],'depth':null}));}}});}exports[_0x97c5('0x43')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xb264=['transcribe','TranscribeService','Comprehend','substring','format','transcribeName','data1','data2','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Negative','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Sentiment\x20Analysis\x20not\x20requested','sentiment','Positive','Mixed','catch','name','SequelizeValidationError','error','inspect','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','aws-sdk','util','../../config/logger'];(function(_0x31c9dc,_0x24c945){var _0x326c0f=function(_0xf3cecc){while(--_0xf3cecc){_0x31c9dc['push'](_0x31c9dc['shift']());}};_0x326c0f(++_0x24c945);}(_0xb264,0x108));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};var _=require(_0x4b26('0x0'));var AWS=require(_0x4b26('0x1'));var rp=require('request-promise');var util=require(_0x4b26('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x4b26('0x3'))(_0x4b26('0x4'));function getTranscriptionJob(_0x2c7976,_0x2acd7f,_0xb9dc41,_0x5fbad0){return new Promise(function(_0x1e3af6,_0x4e039d){var _0x165096=new AWS[(_0x4b26('0x5'))]({'accessKeyId':_0x2acd7f,'secretAccessKey':_0x2c7976,'region':_0xb9dc41});_0x165096['getTranscriptionJob']({'TranscriptionJobName':_0x5fbad0},function(_0x1edb7c,_0xec9f8a){if(_0x1edb7c){return _0x4e039d(_0x1edb7c);}else{return _0x1e3af6(_0xec9f8a);}});});}function sentiment(_0x2fa7da,_0x4f6c54,_0x2ab5e2,_0x408822,_0x1418fe){return new Promise(function(_0x2d1be3,_0x467589){var _0x59fd0f=new AWS[(_0x4b26('0x6'))]({'accessKeyId':_0x4f6c54,'secretAccessKey':_0x2fa7da,'region':_0x2ab5e2});_0x59fd0f['detectSentiment']({'Text':_0x408822,'LanguageCode':_0x1418fe[_0x4b26('0x7')](0x0,0x2)},function(_0x1b1c14,_0x28a96b){if(_0x1b1c14){return _0x467589(_0x1b1c14);}else{return _0x2d1be3(_0x28a96b);}});});}function checkTranscribeJob(_0x3fd639,_0x46f945,_0x56f690){var _0x25eaa9;return new BPromise(function(_0x3e47f0,_0x484608){logger['info'](util[_0x4b26('0x8')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3fd639['id'],_0x3fd639[_0x4b26('0x9')]));return getTranscriptionJob(_0x56f690[_0x4b26('0xa')],_0x56f690[_0x4b26('0xb')],_0x46f945['transcribeRegion'],_0x3fd639[_0x4b26('0x9')])[_0x4b26('0xc')](function(_0x278a8d){logger[_0x4b26('0xd')](util[_0x4b26('0x8')](_0x4b26('0xe'),_0x3fd639['id'],_0x3fd639[_0x4b26('0x9')],_0x278a8d[_0x4b26('0xf')][_0x4b26('0x10')]));if(!_0x3fd639[_0x4b26('0x11')]){switch(_0x278a8d[_0x4b26('0xf')]['TranscriptionJobStatus']){case _0x4b26('0x12'):var _0x592ddb={'transcribeStatus':_0x278a8d['TranscriptionJob'][_0x4b26('0x10')],'fileUri':_0x278a8d[_0x4b26('0xf')][_0x4b26('0x13')][_0x4b26('0x14')]};logger['info'](util[_0x4b26('0x8')](_0x4b26('0x15'),_0x3fd639['id']));return rp({'uri':_0x278a8d[_0x4b26('0xf')][_0x4b26('0x13')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x2b77d9){logger[_0x4b26('0xd')](util['format'](_0x4b26('0x16'),_0x3fd639['id']));if(_0x2b77d9&&_0x2b77d9[_0x4b26('0x17')]&&_0x2b77d9[_0x4b26('0x17')][_0x4b26('0x18')]&&_0x2b77d9[_0x4b26('0x17')][_0x4b26('0x18')][_0x4b26('0x19')]){_0x592ddb[_0x4b26('0x11')]='';for(var _0x468183=0x0;_0x468183<_0x2b77d9[_0x4b26('0x17')][_0x4b26('0x18')][_0x4b26('0x19')];_0x468183++){_0x592ddb[_0x4b26('0x11')]+=_0x2b77d9[_0x4b26('0x17')]['transcripts'][_0x468183]['transcript']+'';}}return _0x3fd639['update'](_0x592ddb);})[_0x4b26('0xc')](function(){logger[_0x4b26('0xd')](util['format'](_0x4b26('0x1a'),_0x3fd639['id']));if(!_0x3fd639['tempSentiment']){throw new db[(_0x4b26('0x1b'))][(_0x4b26('0x1c'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x46f945['sentiment']||!_0x46f945[_0x4b26('0x1d')]||!_0x46f945[_0x4b26('0x1e')]||!_0x46f945['language']||!_0x46f945[_0x4b26('0x1f')]){throw new db[(_0x4b26('0x1b'))][(_0x4b26('0x1c'))](_0x4b26('0x20'));}if(!_0x592ddb[_0x4b26('0x11')]){throw new Error(_0x4b26('0x21'));}if(_0x46f945['sentimentAccountId']===_0x56f690['id']){return _0x56f690;}else{return db[_0x4b26('0x22')][_0x4b26('0x23')]({'where':{'id':_settings[_0x4b26('0x1d')]}});}})['then'](function(_0x576fdf){if(!_0x576fdf){throw new db['Sequelize'][(_0x4b26('0x1c'))](_0x4b26('0x24'));}if(!_0x576fdf[_0x4b26('0xa')]||!_0x576fdf[_0x4b26('0xb')]){throw new db[(_0x4b26('0x1b'))]['ValidationError'](_0x4b26('0x25'));}_0x25eaa9=_0x576fdf;logger[_0x4b26('0xd')](util[_0x4b26('0x8')](_0x4b26('0x26'),_0x3fd639['id']));return sentiment(_0x25eaa9[_0x4b26('0xa')],_0x25eaa9['data2'],_0x46f945[_0x4b26('0x1e')],_0x592ddb['fileText'],_0x46f945[_0x4b26('0x27')]);})['then'](function(_0x223f33){logger[_0x4b26('0xd')](util[_0x4b26('0x8')](_0x4b26('0x28'),_0x3fd639['id']));return _0x3fd639[_0x4b26('0x29')]({'sentiment':_0x223f33[_0x4b26('0x2a')],'sPositive':_0x223f33[_0x4b26('0x2b')]['Positive'],'sNegative':_0x223f33[_0x4b26('0x2b')][_0x4b26('0x2c')],'sMixed':_0x223f33['SentimentScore']['Mixed'],'sNeutral':_0x223f33[_0x4b26('0x2b')]['Neutral']});})[_0x4b26('0xc')](function(){logger[_0x4b26('0xd')](util[_0x4b26('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3fd639['id']));_0x3e47f0();});case _0x4b26('0x2d'):return _0x3fd639[_0x4b26('0x29')]({'transcribeStatus':'FAILED','failureReason':_0x278a8d[_0x4b26('0xf')][_0x4b26('0x2e')]})['then'](function(){logger['info'](util['format'](_0x4b26('0x1a'),_0x3fd639['id']));_0x3e47f0();});default:logger[_0x4b26('0xd')](util[_0x4b26('0x8')](_0x4b26('0x2f'),_0x3fd639['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x3fd639['tempSentiment']){throw new db['Sequelize'][(_0x4b26('0x1c'))](_0x4b26('0x30'));}if(!_0x46f945[_0x4b26('0x31')]||!_0x46f945[_0x4b26('0x1d')]||!_0x46f945[_0x4b26('0x1e')]||!_0x46f945['language']||!_0x46f945['bucket']){throw new db[(_0x4b26('0x1b'))][(_0x4b26('0x1c'))](_0x4b26('0x20'));}if(!_0x3fd639[_0x4b26('0x11')]){throw new Error(_0x4b26('0x21'));}if(_0x46f945['sentimentAccountId']===_0x56f690['id']){return _0x56f690;}else{return db[_0x4b26('0x22')][_0x4b26('0x23')]({'where':{'id':_settings[_0x4b26('0x1d')]}});}})[_0x4b26('0xc')](function(_0x15d486){if(!_0x15d486){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x15d486[_0x4b26('0xa')]||!_0x15d486[_0x4b26('0xb')]){throw new db[(_0x4b26('0x1b'))][(_0x4b26('0x1c'))](_0x4b26('0x25'));}_0x25eaa9=_0x15d486;logger['info'](util['format'](_0x4b26('0x26'),_0x3fd639['id']));return sentiment(_0x25eaa9[_0x4b26('0xa')],_0x25eaa9[_0x4b26('0xb')],_0x46f945['sentimentRegion'],_0x3fd639['fileText'],_0x46f945[_0x4b26('0x27')]);})[_0x4b26('0xc')](function(_0x4a9a04){logger['info'](util['format'](_0x4b26('0x28'),_0x3fd639['id']));return _0x3fd639[_0x4b26('0x29')]({'sentiment':_0x4a9a04[_0x4b26('0x2a')],'sPositive':_0x4a9a04[_0x4b26('0x2b')][_0x4b26('0x32')],'sNegative':_0x4a9a04[_0x4b26('0x2b')]['Negative'],'sMixed':_0x4a9a04[_0x4b26('0x2b')][_0x4b26('0x33')],'sNeutral':_0x4a9a04[_0x4b26('0x2b')]['Neutral'],'transcribeStatus':_0x4b26('0x12')});})[_0x4b26('0xc')](function(){logger[_0x4b26('0xd')](util[_0x4b26('0x8')](_0x4b26('0x1a'),_0x3fd639['id']));_0x3e47f0();});}})[_0x4b26('0x34')](function(_0x1d1f50){if(_0x1d1f50){if(!_0x1d1f50['name']||_0x1d1f50[_0x4b26('0x35')]!==_0x4b26('0x36')){logger[_0x4b26('0x37')](util[_0x4b26('0x8')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x3fd639['id']),util[_0x4b26('0x38')](_0x1d1f50,{'showHidden':![],'depth':null}));}}_0x3e47f0();});});}function checkTranscribe(){var _0x10fcbf;var _0x1bd00f;var _0x503574;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':_0x4b26('0x39')}})['then'](function(_0x519724){if(!_0x519724||!_0x519724[_0x4b26('0x19')]){throw new db[(_0x4b26('0x1b'))][(_0x4b26('0x1c'))]('No\x20transcribe\x20job\x20to\x20check');}_0x10fcbf=_0x519724;return db[_0x4b26('0x3a')][_0x4b26('0x23')]({'where':{'id':0x1}});})[_0x4b26('0xc')](function(_0x4231eb){if(!_0x4231eb){throw new db[(_0x4b26('0x1b'))][(_0x4b26('0x1c'))](_0x4b26('0x3b'));}_0x1bd00f=_0x4231eb;if(!_0x1bd00f[_0x4b26('0x4')]||!_0x1bd00f[_0x4b26('0x3c')]||!_0x1bd00f[_0x4b26('0x3d')]||!_0x1bd00f[_0x4b26('0x27')]||!_0x1bd00f['bucket']){throw new db['Sequelize'][(_0x4b26('0x1c'))](_0x4b26('0x3e'));}return db['CloudProvider']['findOne']({'where':{'id':_0x1bd00f[_0x4b26('0x3c')]}});})[_0x4b26('0xc')](function(_0x1f1b4c){if(!_0x1f1b4c){throw new db[(_0x4b26('0x1b'))][(_0x4b26('0x1c'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1f1b4c['data1']||!_0x1f1b4c[_0x4b26('0xb')]){throw new db[(_0x4b26('0x1b'))][(_0x4b26('0x1c'))](_0x4b26('0x25'));}_0x503574=_0x1f1b4c;var _0x23e73d=[];_0x10fcbf[_0x4b26('0x3f')](function(_0x1c5ae1){_0x23e73d[_0x4b26('0x40')](checkTranscribeJob(_0x1c5ae1,_0x1bd00f,_0x503574));});return BPromise[_0x4b26('0x41')](_0x23e73d);})[_0x4b26('0x34')](function(_0x483de3){if(_0x483de3){if(!_0x483de3['name']||_0x483de3['name']!==_0x4b26('0x36')){logger[_0x4b26('0x37')](util['inspect'](_0x483de3,{'showHidden':![],'depth':null}));}}});}exports[_0x4b26('0x42')]=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 08288ac..9fef590 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 _0x5a43=['ioredis','util','../../config/environment','../../mysqldb','../logger','localhost','socket.io-emitter','redis','WhatsappInteraction','findAll','subtract','hours','then','length','map','system','timeout','format','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5a43,0xf1));var _0x35a4=function(_0xd023ed,_0x5722bd){_0xd023ed=_0xd023ed-0x0;var _0x15dfc5=_0x5a43[_0xd023ed];return _0x15dfc5;};'use strict';var _=require(_0x35a4('0x0'));var moment=require(_0x35a4('0x1'));var Redis=require(_0x35a4('0x2'));var util=require(_0x35a4('0x3'));var config=require(_0x35a4('0x4'));var db=require(_0x35a4('0x5'))['db'];var logger=require(_0x35a4('0x6'))('schedule');config['redis']=_['defaults'](config['redis'],{'host':_0x35a4('0x7'),'port':0x18eb});var io=require(_0x35a4('0x8'))(new Redis(config[_0x35a4('0x9')]));function closeInteractions(){var _0x1b2bf2=[];return db[_0x35a4('0xa')][_0x35a4('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x35a4('0xc')](0x18,_0x35a4('0xd'))}}})[_0x35a4('0xe')](function(_0x3e23d6){if(_0x3e23d6&&_0x3e23d6[_0x35a4('0xf')]){_0x1b2bf2=_[_0x35a4('0x10')](_0x3e23d6||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x1b2bf2['join']());return db[_0x35a4('0xa')]['update']({'closeReason':_0x35a4('0x11'),'disposition':_0x35a4('0x12'),'closed':!![],'closedAt':moment()[_0x35a4('0x13')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1b2bf2}});}})[_0x35a4('0xe')](function(){if(_0x1b2bf2&&_0x1b2bf2[_0x35a4('0xf')]){logger[_0x35a4('0x14')](_0x35a4('0x15'),_0x1b2bf2['join']());for(var _0x10d1de=0x0;_0x10d1de<_0x1b2bf2[_0x35a4('0xf')];_0x10d1de++){io['emit'](_0x35a4('0x16'),{'id':_0x1b2bf2[_0x10d1de],'closed':!![]});}}})['catch'](function(_0x376cb0){logger[_0x35a4('0x17')](_0x35a4('0x18'),_0x376cb0?util[_0x35a4('0x19')](_0x376cb0,{'showHidden':![],'depth':null}):'');});}exports[_0x35a4('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xc102=['lastMsgAt','hours','then','join','system','timeout','YYYY-MM-DD\x20HH:mm:ss','length','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','localhost','socket.io-emitter','WhatsappInteraction'];(function(_0x51ac01,_0x55d78d){var _0x32ea60=function(_0x2a7345){while(--_0x2a7345){_0x51ac01['push'](_0x51ac01['shift']());}};_0x32ea60(++_0x55d78d);}(_0xc102,0x77));var _0x2c10=function(_0x407822,_0xcf252a){_0x407822=_0x407822-0x0;var _0xf17ef7=_0xc102[_0x407822];return _0xf17ef7;};'use strict';var _=require(_0x2c10('0x0'));var moment=require(_0x2c10('0x1'));var Redis=require(_0x2c10('0x2'));var util=require(_0x2c10('0x3'));var config=require(_0x2c10('0x4'));var db=require(_0x2c10('0x5'))['db'];var logger=require(_0x2c10('0x6'))('schedule');config[_0x2c10('0x7')]=_['defaults'](config[_0x2c10('0x7')],{'host':_0x2c10('0x8'),'port':0x18eb});var io=require(_0x2c10('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x1930f3=[];return db[_0x2c10('0xa')]['findAll']({'raw':!![],'attributes':['id',_0x2c10('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x2c10('0xc'))}}})[_0x2c10('0xd')](function(_0x765433){if(_0x765433&&_0x765433['length']){_0x1930f3=_['map'](_0x765433||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x1930f3[_0x2c10('0xe')]());return db[_0x2c10('0xa')]['update']({'closeReason':_0x2c10('0xf'),'disposition':_0x2c10('0x10'),'closed':!![],'closedAt':moment()['format'](_0x2c10('0x11'))},{'where':{'id':_0x1930f3}});}})[_0x2c10('0xd')](function(){if(_0x1930f3&&_0x1930f3[_0x2c10('0x12')]){logger[_0x2c10('0x13')](_0x2c10('0x14'),_0x1930f3[_0x2c10('0xe')]());for(var _0x37bcfa=0x0;_0x37bcfa<_0x1930f3[_0x2c10('0x12')];_0x37bcfa++){io[_0x2c10('0x15')](_0x2c10('0x16'),{'id':_0x1930f3[_0x37bcfa],'closed':!![]});}}})[_0x2c10('0x17')](function(_0x2e45bb){logger['error'](_0x2c10('0x18'),_0x2e45bb?util[_0x2c10('0x19')](_0x2e45bb,{'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 1283f1f..8ad157f 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bab=['push','Biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','contacts2','hopper2','catch','util','../mysqldb'];(function(_0x4d1098,_0x13d312){var _0x131e8b=function(_0x54b470){while(--_0x54b470){_0x4d1098['push'](_0x4d1098['shift']());}};_0x131e8b(++_0x13d312);}(_0x0bab,0xa0));var _0xb0ba=function(_0x56cbb4,_0x4adb66){_0x56cbb4=_0x56cbb4-0x0;var _0x13ae49=_0x0bab[_0x56cbb4];return _0x13ae49;};'use strict';var util=require(_0xb0ba('0x0'));var db=require(_0xb0ba('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb0ba('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xb0ba('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xb0ba('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb0ba('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xb0ba('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb0ba('0x5')](),'updatedAt':Date[_0xb0ba('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xb0ba('0x2')]({'id':i,'firstName':_0xb0ba('0x6')+i,'lastName':_0xb0ba('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xb0ba('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xb0ba('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb0ba('0x5')](),'updatedAt':Date[_0xb0ba('0x5')]()});}db[_0xb0ba('0x7')][_0xb0ba('0x8')]({'where':{}})[_0xb0ba('0x9')](function(){return db[_0xb0ba('0x7')][_0xb0ba('0xa')](contacts);})[_0xb0ba('0x9')](function(){console[_0xb0ba('0xb')](_0xb0ba('0xc'),_0xb0ba('0xd'));return db[_0xb0ba('0xe')][_0xb0ba('0x8')]({'where':{}});})['then'](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0xb0ba('0x9')](function(){console[_0xb0ba('0xb')](_0xb0ba('0xc'),'hopper1');return db[_0xb0ba('0x7')]['bulkCreate'](contacts2);})['then'](function(){console[_0xb0ba('0xb')](_0xb0ba('0xc'),_0xb0ba('0xf'));return db['CmHopper'][_0xb0ba('0xa')](hopper2);})['then'](function(){console['log'](_0xb0ba('0xc'),_0xb0ba('0x10'));})[_0xb0ba('0x11')](function(_0x1937fc){console[_0xb0ba('0xb')](_0x1937fc);}); \ No newline at end of file +var _0xf0e2=['push','Biondo','Innocenzo','@xcally.com','now','CmContact','destroy','then','bulkCreate','finished\x20populating','contacts1','CmHopper','log','contacts2','hopper2','util','../mysqldb'];(function(_0x37f730,_0x129034){var _0x2b3253=function(_0x1b370a){while(--_0x1b370a){_0x37f730['push'](_0x37f730['shift']());}};_0x2b3253(++_0x129034);}(_0xf0e2,0x75));var _0x2f0e=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xf0e2[_0x2080a3];return _0x8d7d17;};'use strict';var util=require(_0x2f0e('0x0'));var db=require(_0x2f0e('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x2f0e('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x2f0e('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x2f0e('0x4')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x2f0e('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x2f0e('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2f0e('0x6')](),'updatedAt':Date[_0x2f0e('0x6')]()});}db[_0x2f0e('0x7')][_0x2f0e('0x8')]({'where':{}})[_0x2f0e('0x9')](function(){return db[_0x2f0e('0x7')][_0x2f0e('0xa')](contacts);})[_0x2f0e('0x9')](function(){console['log'](_0x2f0e('0xb'),_0x2f0e('0xc'));return db[_0x2f0e('0xd')][_0x2f0e('0x8')]({'where':{}});})[_0x2f0e('0x9')](function(){return db[_0x2f0e('0xd')]['bulkCreate'](hopper);})[_0x2f0e('0x9')](function(){console['log']('finished\x20populating','hopper1');return db[_0x2f0e('0x7')][_0x2f0e('0xa')](contacts2);})[_0x2f0e('0x9')](function(){console[_0x2f0e('0xe')](_0x2f0e('0xb'),_0x2f0e('0xf'));return db[_0x2f0e('0xd')][_0x2f0e('0xa')](hopper2);})['then'](function(){console[_0x2f0e('0xe')]('finished\x20populating',_0x2f0e('0x10'));})['catch'](function(_0x4639f7){console['log'](_0x4639f7);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 1f15394..232da90 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4f9=['agent','%s%s@xcally.com','password','friend','udp','wss','all','yes','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','log','add\x20user','catch','../mysqldb','format','%s%s'];(function(_0x3d2fdd,_0xbbd721){var _0x4ce36a=function(_0x472c13){while(--_0x472c13){_0x3d2fdd['push'](_0x3d2fdd['shift']());}};_0x4ce36a(++_0xbbd721);}(_0xa4f9,0x165));var _0x9a4f=function(_0x3919bc,_0x4c2c0b){_0x3919bc=_0x3919bc-0x0;var _0x4acb0f=_0xa4f9[_0x3919bc];return _0x4acb0f;};'use strict';var util=require('util');var db=require(_0x9a4f('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x9a4f('0x1')](_0x9a4f('0x2'),_0x9a4f('0x3'),i),'fullname':util[_0x9a4f('0x1')](_0x9a4f('0x2'),_0x9a4f('0x3'),i),'email':util[_0x9a4f('0x1')](_0x9a4f('0x4'),_0x9a4f('0x3'),i),'role':_0x9a4f('0x3'),'password':_0x9a4f('0x5'),'internal':0xfa0+i,'type':_0x9a4f('0x6'),'transport':[_0x9a4f('0x7'),'ws',_0x9a4f('0x8')],'disallow':[_0x9a4f('0x9')],'allow':['ulaw'],'defaultuser':util[_0x9a4f('0x1')](_0x9a4f('0x2'),_0x9a4f('0x3'),i),'encryption':'yes','avpf':'yes','force_avp':_0x9a4f('0xa'),'icesupport':_0x9a4f('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x9a4f('0xb'),'dtlssetup':_0x9a4f('0xc'),'callerid':util[_0x9a4f('0x1')]('\x22%s\x22\x20<%s>',util[_0x9a4f('0x1')](_0x9a4f('0x2'),_0x9a4f('0x3'),i),0xfa0+i)});}db[_0x9a4f('0xd')][_0x9a4f('0xe')](users)['then'](function(){console[_0x9a4f('0xf')](_0x9a4f('0x10'));})[_0x9a4f('0x11')](function(_0x191f8e){console[_0x9a4f('0xf')](_0x191f8e);}); \ No newline at end of file +var _0x993c=['agent','password','friend','udp','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','util','%s%s','format'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x993c,0xc9));var _0xc993=function(_0x4082a8,_0x9b5705){_0x4082a8=_0x4082a8-0x0;var _0x41dc1e=_0x993c[_0x4082a8];return _0x41dc1e;};'use strict';var util=require(_0xc993('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0xc993('0x1'),'agent',i),'fullname':util[_0xc993('0x2')]('%s%s','agent',i),'email':util[_0xc993('0x2')]('%s%s@xcally.com',_0xc993('0x3'),i),'role':_0xc993('0x3'),'password':_0xc993('0x4'),'internal':0xfa0+i,'type':_0xc993('0x5'),'transport':[_0xc993('0x6'),'ws','wss'],'disallow':[_0xc993('0x7')],'allow':['ulaw'],'defaultuser':util[_0xc993('0x2')](_0xc993('0x1'),_0xc993('0x3'),i),'encryption':_0xc993('0x8'),'avpf':_0xc993('0x8'),'force_avp':_0xc993('0x8'),'icesupport':_0xc993('0x8'),'dtlsenable':_0xc993('0x8'),'dtlsverify':'no','dtlscertfile':_0xc993('0x9'),'dtlsprivatekey':_0xc993('0xa'),'dtlssetup':_0xc993('0xb'),'callerid':util[_0xc993('0x2')](_0xc993('0xc'),util['format'](_0xc993('0x1'),_0xc993('0x3'),i),0xfa0+i)});}db[_0xc993('0xd')][_0xc993('0xe')](users)[_0xc993('0xf')](function(){console[_0xc993('0x10')]('add\x20user');})['catch'](function(_0x5c2517){console['log'](_0x5c2517);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 18ca9f1..c643b79 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf62=['IvrCampaigns','resourceId','map','role','Campaign','ivr','format','%s:queue:%s','Agents','length','user:%s','handshake','find','userProfileId','ChatInteraction','MailInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','SmsQueues','WhatsappQueue','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','fax','sms','mail','whatsapp','telephone:%s','campaign:%s:%s','ChatInteractions','emit','user_has_chat_interactions:remove','leave','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','address','request','connection','remotePort','disconnect','lodash','util','./environment','name','User','telephone','agent','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks'];(function(_0x33ab57,_0x449de8){var _0x3af8ce=function(_0x4e8220){while(--_0x4e8220){_0x33ab57['push'](_0x33ab57['shift']());}};_0x3af8ce(++_0x449de8);}(_0xcf62,0x102));var _0x2cf6=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xcf62[_0x2aea9e];return _0x430b92;};'use strict';var _=require(_0x2cf6('0x0'));var util=require(_0x2cf6('0x1'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require(_0x2cf6('0x2'));var queryQueues={'attributes':['id',_0x2cf6('0x3')],'include':[{'as':'Agents','model':db[_0x2cf6('0x4')],'attributes':['id',_0x2cf6('0x3'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2cf6('0x3')],'where':{'role':_0x2cf6('0x5')}};var queryTrunks={'raw':!![],'attributes':['id',_0x2cf6('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x2cf6('0x3')],'where':{'role':_0x2cf6('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2cf6('0x3'),_0x2cf6('0x7')],'where':{'type':'ivr'}};function getAssociatedResources(_0xac1721,_0x149038,_0x22ed32){return db[_0x2cf6('0x8')][_0x2cf6('0x9')]({'where':{'name':_0xac1721,'userProfileId':_0x149038},'raw':!![]})[_0x2cf6('0xa')](function(_0x16c75d){if(_0x16c75d){if(_0x16c75d[_0x2cf6('0xb')]){switch(_0xac1721){case _0x2cf6('0xc'):case _0x2cf6('0xd'):case _0x2cf6('0xe'):case'SmsQueues':case _0x2cf6('0xf'):case _0x2cf6('0x10'):case _0x2cf6('0x11'):return db[_0x22ed32][_0x2cf6('0x12')](queryQueues);case _0x2cf6('0x13'):return db[_0x22ed32][_0x2cf6('0x12')](queryTelephones);case _0x2cf6('0x14'):return db[_0x22ed32][_0x2cf6('0x12')](queryTrunks);case _0x2cf6('0x15'):return db[_0x22ed32][_0x2cf6('0x12')](queryCampaigns);}}else{return db['UserProfileResource'][_0x2cf6('0x12')]({'attributes':[_0x2cf6('0x16')],'where':{'sectionId':_0x16c75d['id']},'raw':!![]})[_0x2cf6('0xa')](function(_0x332c09){if(_0x332c09){var _0x2c22e1={'where':{'id':_[_0x2cf6('0x17')](_0x332c09,_0x2cf6('0x16'))},'raw':!![]};switch(_0x22ed32){case _0x2cf6('0x4'):_0x2c22e1['where'][_0x2cf6('0x18')]=_0x2cf6('0x5');break;case _0x2cf6('0x19'):_0x2c22e1['where']['type']=_0x2cf6('0x1a');break;}return db[_0x22ed32][_0x2cf6('0x12')](_0x2c22e1);}else{return[];}});}}else{return[];}})['then'](function(_0x340901){return _0x340901;});}function joinOrLeaveQueues(_0x3d1bb9,_0xdf5144,_0x2ca7fd,_0x57fa80){_0x3d1bb9[_0xdf5144](util[_0x2cf6('0x1b')](_0x2cf6('0x1c'),_0x2ca7fd,_0x57fa80[_0x2cf6('0x3')]));if(_0x57fa80[_0x2cf6('0x1d')]){for(var _0x3565ad=0x0;_0x3565ad<_0x57fa80[_0x2cf6('0x1d')][_0x2cf6('0x1e')];_0x3565ad+=0x1){_0x3d1bb9[_0xdf5144](util[_0x2cf6('0x1b')](_0x2cf6('0x1f'),_0x57fa80['Agents'][_0x3565ad][_0x2cf6('0x3')]));}}}function joinOrLeave(_0x37de96,_0x4dc342,_0x3e265e){var _0x520dc9;if(_0x37de96[_0x2cf6('0x20')]['query']['id']){db[_0x2cf6('0x4')][_0x2cf6('0x21')]({'attributes':['id',_0x2cf6('0x3'),_0x2cf6('0x18'),_0x2cf6('0x22')],'where':{'id':_0x37de96[_0x2cf6('0x20')]['query']['id']},'include':[{'model':db[_0x2cf6('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2cf6('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2cf6('0x25')],'as':_0x2cf6('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x2cf6('0x27')],'as':_0x2cf6('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x2cf6('0x29')],'as':_0x2cf6('0x2a'),'attributes':['id'],'raw':!![]}]})[_0x2cf6('0xa')](function(_0x12d79b){if(_0x12d79b){_0x520dc9=_0x12d79b;_0x37de96[_0x4dc342](util[_0x2cf6('0x1b')](_0x2cf6('0x1f'),_0x12d79b['name']));var _0x582742=[];switch(_0x12d79b[_0x2cf6('0x18')]){case _0x2cf6('0x2b'):_0x37de96[_0x4dc342](_0x2cf6('0x2c'));_0x37de96[_0x4dc342](_0x2cf6('0x2d'));if(queryQueues[_0x2cf6('0x2e')]('include')){delete queryQueues['include'];}_0x582742[_0x2cf6('0x2f')](db[_0x2cf6('0x30')][_0x2cf6('0x12')](queryQueues));_0x582742[_0x2cf6('0x2f')](db[_0x2cf6('0x31')][_0x2cf6('0x12')](queryQueues));_0x582742[_0x2cf6('0x2f')](db[_0x2cf6('0x32')][_0x2cf6('0x12')](queryQueues));_0x582742[_0x2cf6('0x2f')](db[_0x2cf6('0x33')][_0x2cf6('0x12')](queryQueues));_0x582742[_0x2cf6('0x2f')](db[_0x2cf6('0x34')]['findAll'](queryQueues));_0x582742[_0x2cf6('0x2f')](db[_0x2cf6('0x35')][_0x2cf6('0x12')](queryQueues));_0x582742[_0x2cf6('0x2f')](db['WhatsappQueue'][_0x2cf6('0x12')](queryQueues));_0x582742[_0x2cf6('0x2f')](db[_0x2cf6('0x4')]['findAll'](queryTelephones));_0x582742[_0x2cf6('0x2f')](db[_0x2cf6('0x36')][_0x2cf6('0x12')](queryTrunks));_0x582742[_0x2cf6('0x2f')](db[_0x2cf6('0x19')][_0x2cf6('0x12')](queryCampaigns));_0x582742[_0x2cf6('0x2f')](db['User']['findAll'](queryAgents));break;case'user':_0x37de96[_0x4dc342](_0x2cf6('0x2c'));_0x37de96[_0x4dc342](_0x2cf6('0x2d'));_0x582742[_0x2cf6('0x2f')](getAssociatedResources(_0x2cf6('0xc'),_0x12d79b[_0x2cf6('0x22')],_0x2cf6('0x30')));_0x582742[_0x2cf6('0x2f')](getAssociatedResources(_0x2cf6('0xd'),_0x12d79b[_0x2cf6('0x22')],_0x2cf6('0x31')));_0x582742[_0x2cf6('0x2f')](getAssociatedResources(_0x2cf6('0xe'),_0x12d79b[_0x2cf6('0x22')],_0x2cf6('0x32')));_0x582742[_0x2cf6('0x2f')](getAssociatedResources(_0x2cf6('0x37'),_0x12d79b[_0x2cf6('0x22')],_0x2cf6('0x33')));_0x582742[_0x2cf6('0x2f')](getAssociatedResources(_0x2cf6('0xf'),_0x12d79b['userProfileId'],_0x2cf6('0x34')));_0x582742[_0x2cf6('0x2f')](getAssociatedResources(_0x2cf6('0x10'),_0x12d79b['userProfileId'],_0x2cf6('0x35')));_0x582742[_0x2cf6('0x2f')](getAssociatedResources(_0x2cf6('0x11'),_0x12d79b[_0x2cf6('0x22')],_0x2cf6('0x38')));_0x582742[_0x2cf6('0x2f')](getAssociatedResources('Telephones',_0x12d79b[_0x2cf6('0x22')],_0x2cf6('0x4')));_0x582742[_0x2cf6('0x2f')](getAssociatedResources(_0x2cf6('0x14'),_0x12d79b[_0x2cf6('0x22')],_0x2cf6('0x36')));_0x582742[_0x2cf6('0x2f')](getAssociatedResources(_0x2cf6('0x15'),_0x12d79b[_0x2cf6('0x22')],_0x2cf6('0x19')));_0x582742[_0x2cf6('0x2f')](db[_0x2cf6('0x4')]['findAll'](queryAgents));break;case _0x2cf6('0x6'):_0x37de96[_0x4dc342](_0x2cf6('0x2c'));_0x37de96[_0x4dc342]('voice:outbound');_0x582742[_0x2cf6('0x2f')](_0x12d79b[_0x2cf6('0x39')]({'attributes':['id',_0x2cf6('0x3')]}));_0x582742[_0x2cf6('0x2f')](_0x12d79b[_0x2cf6('0x3a')]({'attributes':['id','name']}));_0x582742[_0x2cf6('0x2f')](_0x12d79b['getFaxQueues']({'attributes':['id','name']}));_0x582742[_0x2cf6('0x2f')](_0x12d79b[_0x2cf6('0x3b')]({'attributes':['id',_0x2cf6('0x3')]}));_0x582742[_0x2cf6('0x2f')](_0x12d79b[_0x2cf6('0x3c')]({'attributes':['id','name']}));_0x582742[_0x2cf6('0x2f')](_0x12d79b[_0x2cf6('0x3d')]({'attributes':['id',_0x2cf6('0x3')]}));_0x582742['push'](_0x12d79b['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0x2cf6('0x3e')](_0x582742);}})[_0x2cf6('0xa')](function(_0x4237b5){if(_0x4237b5&&_0x4237b5[_0x2cf6('0x1e')]){for(var _0x2aa873=0x0;_0x2aa873<_0x4237b5[_0x2cf6('0x1e')];_0x2aa873+=0x1){for(var _0x806682=0x0;_0x806682<_0x4237b5[_0x2aa873][_0x2cf6('0x1e')];_0x806682+=0x1){switch(_0x2aa873){case 0x0:joinOrLeaveQueues(_0x37de96,_0x4dc342,_0x2cf6('0x3f'),_0x4237b5[_0x2aa873][_0x806682]);break;case 0x1:joinOrLeaveQueues(_0x37de96,_0x4dc342,'chat',_0x4237b5[_0x2aa873][_0x806682]);break;case 0x2:joinOrLeaveQueues(_0x37de96,_0x4dc342,_0x2cf6('0x40'),_0x4237b5[_0x2aa873][_0x806682]);break;case 0x3:joinOrLeaveQueues(_0x37de96,_0x4dc342,_0x2cf6('0x41'),_0x4237b5[_0x2aa873][_0x806682]);break;case 0x4:joinOrLeaveQueues(_0x37de96,_0x4dc342,_0x2cf6('0x42'),_0x4237b5[_0x2aa873][_0x806682]);break;case 0x5:joinOrLeaveQueues(_0x37de96,_0x4dc342,'openchannel',_0x4237b5[_0x2aa873][_0x806682]);break;case 0x6:joinOrLeaveQueues(_0x37de96,_0x4dc342,_0x2cf6('0x43'),_0x4237b5[_0x2aa873][_0x806682]);break;case 0x7:if(_0x520dc9[_0x2cf6('0x18')]!==_0x2cf6('0x6'))_0x37de96[_0x4dc342](util[_0x2cf6('0x1b')](_0x2cf6('0x44'),_0x4237b5[_0x2aa873][_0x806682]['name']));break;case 0x8:if(_0x520dc9[_0x2cf6('0x18')]!=='agent')_0x37de96[_0x4dc342](util[_0x2cf6('0x1b')]('trunk:%s',_0x4237b5[_0x2aa873][_0x806682][_0x2cf6('0x3')]));break;case 0x9:if(_0x520dc9[_0x2cf6('0x18')]!=='agent')_0x37de96[_0x4dc342](util['format'](_0x2cf6('0x45'),_0x4237b5[_0x2aa873][_0x806682]['type'],_0x4237b5[_0x2aa873][_0x806682]['name']));break;case 0xa:_0x37de96[_0x4dc342](util[_0x2cf6('0x1b')](_0x2cf6('0x1f'),_0x4237b5[_0x2aa873][_0x806682]['name']));break;}}}}})[_0x2cf6('0xa')](function(){if(_0x4dc342==='leave'){var _0x115323=_[_0x2cf6('0x17')](_0x520dc9[_0x2cf6('0x46')],'id');return _0x520dc9['removeChatInteractions'](_0x115323)[_0x2cf6('0xa')](function(){for(var _0x5d6e36=0x0;_0x5d6e36<_0x115323[_0x2cf6('0x1e')];_0x5d6e36+=0x1){_0x3e265e[_0x2cf6('0x47')](_0x2cf6('0x48'),{'ChatInteractionId':Number(_0x115323[_0x5d6e36]),'UserId':Number(_0x520dc9['id'])});}});}})[_0x2cf6('0xa')](function(){if(_0x4dc342===_0x2cf6('0x49')){var _0x4bc108=_[_0x2cf6('0x17')](_0x520dc9[_0x2cf6('0x4a')],'id');return _0x520dc9[_0x2cf6('0x4b')](_0x4bc108)[_0x2cf6('0xa')](function(){for(var _0x11d0f4=0x0;_0x11d0f4<_0x4bc108['length'];_0x11d0f4+=0x1){_0x3e265e[_0x2cf6('0x47')](_0x2cf6('0x4c'),{'MailInteractionId':Number(_0x4bc108[_0x11d0f4]),'UserId':Number(_0x520dc9['id'])});}});}})[_0x2cf6('0xa')](function(){if(_0x4dc342==='leave'){var _0x53dabf=_['map'](_0x520dc9[_0x2cf6('0x4d')],'id');return _0x520dc9['removeFaxInteractions'](_0x53dabf)[_0x2cf6('0xa')](function(){for(var _0x2f51b9=0x0;_0x2f51b9<_0x53dabf[_0x2cf6('0x1e')];_0x2f51b9+=0x1){_0x3e265e[_0x2cf6('0x47')](_0x2cf6('0x4e'),{'FaxInteractionId':Number(_0x53dabf[_0x2f51b9]),'UserId':Number(_0x520dc9['id'])});}});}})[_0x2cf6('0xa')](function(){if(_0x4dc342==='leave'){var _0x115e27=_[_0x2cf6('0x17')](_0x520dc9[_0x2cf6('0x26')],'id');return _0x520dc9[_0x2cf6('0x4f')](_0x115e27)[_0x2cf6('0xa')](function(){for(var _0x116c6d=0x0;_0x116c6d<_0x115e27[_0x2cf6('0x1e')];_0x116c6d+=0x1){_0x3e265e[_0x2cf6('0x47')](_0x2cf6('0x50'),{'SmsInteractionId':Number(_0x115e27[_0x116c6d]),'UserId':Number(_0x520dc9['id'])});}});}})['then'](function(){if(_0x4dc342===_0x2cf6('0x49')){var _0x4eab0a=_[_0x2cf6('0x17')](_0x520dc9['OpenchannelInteractions'],'id');return _0x520dc9[_0x2cf6('0x51')](_0x4eab0a)[_0x2cf6('0xa')](function(){for(var _0x529a0c=0x0;_0x529a0c<_0x4eab0a['length'];_0x529a0c+=0x1){_0x3e265e['emit'](_0x2cf6('0x52'),{'OpenchannelInteractionId':Number(_0x4eab0a[_0x529a0c]),'UserId':Number(_0x520dc9['id'])});}});}})[_0x2cf6('0xa')](function(){if(_0x4dc342===_0x2cf6('0x49')){var _0x1c00da=_[_0x2cf6('0x17')](_0x520dc9['WhatsappInteractions'],'id');return _0x520dc9[_0x2cf6('0x53')](_0x1c00da)[_0x2cf6('0xa')](function(){for(var _0x367dc1=0x0;_0x367dc1<_0x1c00da[_0x2cf6('0x1e')];_0x367dc1+=0x1){_0x3e265e[_0x2cf6('0x47')](_0x2cf6('0x54'),{'WhatsappInteractionId':Number(_0x1c00da[_0x367dc1]),'UserId':Number(_0x520dc9['id'])});}});}})[_0x2cf6('0x55')](function(_0x571db0){_0x37de96[_0x2cf6('0x56')](_0x571db0);});}}function onDisconnect(_0x3fe727,_0x372c25){joinOrLeave(_0x3fe727,'leave',_0x372c25);}function onConnect(_0x568027){joinOrLeave(_0x568027,'join');}exports[_0x2cf6('0x57')]=function(_0x35639f){_0x35639f['on']('connection',function(_0x16431c){_0x16431c['setMaxListeners'](0x0);_0x16431c[_0x2cf6('0x58')]=_0x16431c[_0x2cf6('0x59')][_0x2cf6('0x5a')]['remoteAddress']+':'+_0x16431c[_0x2cf6('0x59')]['connection'][_0x2cf6('0x5b')];_0x16431c['connectedAt']=new Date();_0x16431c['log']=function(_0x1c5d4f){console[_0x2cf6('0x56')]('SocketIO\x20'+_0x16431c['nsp'][_0x2cf6('0x3')]+'['+_0x16431c['address']+']',_0x1c5d4f);};_0x16431c['on'](_0x2cf6('0x5c'),function(){onDisconnect(_0x16431c,_0x35639f);_0x16431c[_0x2cf6('0x56')]('DISCONNECTED');});onConnect(_0x16431c);_0x16431c['log']('CONNECTED');});}; \ No newline at end of file +var _0x6eec=['lodash','util','bluebird','../mysqldb','name','Agents','role','agent','telephone','UserProfileSection','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where','Campaign','type','ivr','format','%s:queue:%s','length','user:%s','handshake','query','find','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','userProfileId','FaxQueue','OpenchannelQueues','OpenchannelQueue','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','all','voice','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','SocketIO\x20','nsp','CONNECTED'];(function(_0x30771b,_0x2803fc){var _0x407fc2=function(_0x58d63c){while(--_0x58d63c){_0x30771b['push'](_0x30771b['shift']());}};_0x407fc2(++_0x2803fc);}(_0x6eec,0x1e0));var _0xc6ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6eec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc6ee('0x0'));var util=require(_0xc6ee('0x1'));var BPromise=require(_0xc6ee('0x2'));var db=require(_0xc6ee('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xc6ee('0x4')],'include':[{'as':_0xc6ee('0x5'),'model':db['User'],'attributes':['id',_0xc6ee('0x4'),_0xc6ee('0x6')],'raw':!![],'where':{'role':_0xc6ee('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc6ee('0x4')],'where':{'role':_0xc6ee('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xc6ee('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xc6ee('0x4')],'where':{'role':_0xc6ee('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xc6ee('0x4'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0xfcd175,_0x2a4706,_0x4d6c8b){return db[_0xc6ee('0x9')]['findOne']({'where':{'name':_0xfcd175,'userProfileId':_0x2a4706},'raw':!![]})[_0xc6ee('0xa')](function(_0x2e999c){if(_0x2e999c){if(_0x2e999c[_0xc6ee('0xb')]){switch(_0xfcd175){case _0xc6ee('0xc'):case'ChatQueues':case _0xc6ee('0xd'):case _0xc6ee('0xe'):case _0xc6ee('0xf'):case'OpenchannelQueues':case _0xc6ee('0x10'):return db[_0x4d6c8b][_0xc6ee('0x11')](queryQueues);case _0xc6ee('0x12'):return db[_0x4d6c8b]['findAll'](queryTelephones);case _0xc6ee('0x13'):return db[_0x4d6c8b][_0xc6ee('0x11')](queryTrunks);case _0xc6ee('0x14'):return db[_0x4d6c8b]['findAll'](queryCampaigns);}}else{return db[_0xc6ee('0x15')][_0xc6ee('0x11')]({'attributes':[_0xc6ee('0x16')],'where':{'sectionId':_0x2e999c['id']},'raw':!![]})['then'](function(_0x43ef07){if(_0x43ef07){var _0x1db0ff={'where':{'id':_[_0xc6ee('0x17')](_0x43ef07,_0xc6ee('0x16'))},'raw':!![]};switch(_0x4d6c8b){case _0xc6ee('0x18'):_0x1db0ff[_0xc6ee('0x19')][_0xc6ee('0x6')]=_0xc6ee('0x8');break;case _0xc6ee('0x1a'):_0x1db0ff[_0xc6ee('0x19')][_0xc6ee('0x1b')]=_0xc6ee('0x1c');break;}return db[_0x4d6c8b][_0xc6ee('0x11')](_0x1db0ff);}else{return[];}});}}else{return[];}})[_0xc6ee('0xa')](function(_0x14d899){return _0x14d899;});}function joinOrLeaveQueues(_0x229013,_0x1997cd,_0x41e260,_0x31701c){_0x229013[_0x1997cd](util[_0xc6ee('0x1d')](_0xc6ee('0x1e'),_0x41e260,_0x31701c['name']));if(_0x31701c[_0xc6ee('0x5')]){for(var _0x48b15f=0x0;_0x48b15f<_0x31701c['Agents'][_0xc6ee('0x1f')];_0x48b15f+=0x1){_0x229013[_0x1997cd](util[_0xc6ee('0x1d')](_0xc6ee('0x20'),_0x31701c['Agents'][_0x48b15f][_0xc6ee('0x4')]));}}}function joinOrLeave(_0x5143dd,_0x37a3a7,_0x567cc2){var _0x41abd8;if(_0x5143dd[_0xc6ee('0x21')][_0xc6ee('0x22')]['id']){db[_0xc6ee('0x18')][_0xc6ee('0x23')]({'attributes':['id',_0xc6ee('0x4'),'role','userProfileId'],'where':{'id':_0x5143dd[_0xc6ee('0x21')][_0xc6ee('0x22')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xc6ee('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xc6ee('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xc6ee('0x26')],'as':_0xc6ee('0x27'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xc6ee('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xc6ee('0x29')],'as':_0xc6ee('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xc6ee('0x2b')],'as':_0xc6ee('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xc6ee('0xa')](function(_0xd53630){if(_0xd53630){_0x41abd8=_0xd53630;_0x5143dd[_0x37a3a7](util['format'](_0xc6ee('0x20'),_0xd53630['name']));var _0x20efe3=[];switch(_0xd53630[_0xc6ee('0x6')]){case _0xc6ee('0x2d'):_0x5143dd[_0x37a3a7](_0xc6ee('0x2e'));_0x5143dd[_0x37a3a7](_0xc6ee('0x2f'));if(queryQueues['hasOwnProperty'](_0xc6ee('0x30'))){delete queryQueues['include'];}_0x20efe3[_0xc6ee('0x31')](db[_0xc6ee('0x32')][_0xc6ee('0x11')](queryQueues));_0x20efe3[_0xc6ee('0x31')](db['ChatQueue'][_0xc6ee('0x11')](queryQueues));_0x20efe3[_0xc6ee('0x31')](db['FaxQueue'][_0xc6ee('0x11')](queryQueues));_0x20efe3['push'](db[_0xc6ee('0x33')][_0xc6ee('0x11')](queryQueues));_0x20efe3[_0xc6ee('0x31')](db[_0xc6ee('0x34')][_0xc6ee('0x11')](queryQueues));_0x20efe3['push'](db['OpenchannelQueue'][_0xc6ee('0x11')](queryQueues));_0x20efe3['push'](db[_0xc6ee('0x35')][_0xc6ee('0x11')](queryQueues));_0x20efe3[_0xc6ee('0x31')](db[_0xc6ee('0x18')][_0xc6ee('0x11')](queryTelephones));_0x20efe3[_0xc6ee('0x31')](db[_0xc6ee('0x36')][_0xc6ee('0x11')](queryTrunks));_0x20efe3['push'](db['Campaign'][_0xc6ee('0x11')](queryCampaigns));_0x20efe3[_0xc6ee('0x31')](db[_0xc6ee('0x18')][_0xc6ee('0x11')](queryAgents));break;case'user':_0x5143dd[_0x37a3a7](_0xc6ee('0x2e'));_0x5143dd[_0x37a3a7](_0xc6ee('0x2f'));_0x20efe3[_0xc6ee('0x31')](getAssociatedResources(_0xc6ee('0xc'),_0xd53630[_0xc6ee('0x37')],_0xc6ee('0x32')));_0x20efe3['push'](getAssociatedResources('ChatQueues',_0xd53630[_0xc6ee('0x37')],'ChatQueue'));_0x20efe3['push'](getAssociatedResources(_0xc6ee('0xd'),_0xd53630[_0xc6ee('0x37')],_0xc6ee('0x38')));_0x20efe3[_0xc6ee('0x31')](getAssociatedResources('SmsQueues',_0xd53630[_0xc6ee('0x37')],_0xc6ee('0x33')));_0x20efe3[_0xc6ee('0x31')](getAssociatedResources(_0xc6ee('0xf'),_0xd53630[_0xc6ee('0x37')],_0xc6ee('0x34')));_0x20efe3['push'](getAssociatedResources(_0xc6ee('0x39'),_0xd53630[_0xc6ee('0x37')],_0xc6ee('0x3a')));_0x20efe3[_0xc6ee('0x31')](getAssociatedResources('WhatsappQueues',_0xd53630[_0xc6ee('0x37')],'WhatsappQueue'));_0x20efe3[_0xc6ee('0x31')](getAssociatedResources(_0xc6ee('0x12'),_0xd53630['userProfileId'],'User'));_0x20efe3['push'](getAssociatedResources(_0xc6ee('0x13'),_0xd53630[_0xc6ee('0x37')],'Trunk'));_0x20efe3['push'](getAssociatedResources('IvrCampaigns',_0xd53630['userProfileId'],'Campaign'));_0x20efe3[_0xc6ee('0x31')](db[_0xc6ee('0x18')][_0xc6ee('0x11')](queryAgents));break;case'agent':_0x5143dd[_0x37a3a7]('voice:inbound');_0x5143dd[_0x37a3a7]('voice:outbound');_0x20efe3['push'](_0xd53630['getVoiceQueues']({'attributes':['id','name']}));_0x20efe3['push'](_0xd53630[_0xc6ee('0x3b')]({'attributes':['id',_0xc6ee('0x4')]}));_0x20efe3['push'](_0xd53630[_0xc6ee('0x3c')]({'attributes':['id',_0xc6ee('0x4')]}));_0x20efe3[_0xc6ee('0x31')](_0xd53630[_0xc6ee('0x3d')]({'attributes':['id',_0xc6ee('0x4')]}));_0x20efe3[_0xc6ee('0x31')](_0xd53630['getMailQueues']({'attributes':['id',_0xc6ee('0x4')]}));_0x20efe3[_0xc6ee('0x31')](_0xd53630['getOpenchannelQueues']({'attributes':['id','name']}));_0x20efe3[_0xc6ee('0x31')](_0xd53630[_0xc6ee('0x3e')]({'attributes':['id',_0xc6ee('0x4')]}));break;}return BPromise[_0xc6ee('0x3f')](_0x20efe3);}})[_0xc6ee('0xa')](function(_0x38cb59){if(_0x38cb59&&_0x38cb59['length']){for(var _0x1f0da1=0x0;_0x1f0da1<_0x38cb59[_0xc6ee('0x1f')];_0x1f0da1+=0x1){for(var _0x27b961=0x0;_0x27b961<_0x38cb59[_0x1f0da1]['length'];_0x27b961+=0x1){switch(_0x1f0da1){case 0x0:joinOrLeaveQueues(_0x5143dd,_0x37a3a7,_0xc6ee('0x40'),_0x38cb59[_0x1f0da1][_0x27b961]);break;case 0x1:joinOrLeaveQueues(_0x5143dd,_0x37a3a7,'chat',_0x38cb59[_0x1f0da1][_0x27b961]);break;case 0x2:joinOrLeaveQueues(_0x5143dd,_0x37a3a7,_0xc6ee('0x41'),_0x38cb59[_0x1f0da1][_0x27b961]);break;case 0x3:joinOrLeaveQueues(_0x5143dd,_0x37a3a7,_0xc6ee('0x42'),_0x38cb59[_0x1f0da1][_0x27b961]);break;case 0x4:joinOrLeaveQueues(_0x5143dd,_0x37a3a7,_0xc6ee('0x43'),_0x38cb59[_0x1f0da1][_0x27b961]);break;case 0x5:joinOrLeaveQueues(_0x5143dd,_0x37a3a7,_0xc6ee('0x44'),_0x38cb59[_0x1f0da1][_0x27b961]);break;case 0x6:joinOrLeaveQueues(_0x5143dd,_0x37a3a7,_0xc6ee('0x45'),_0x38cb59[_0x1f0da1][_0x27b961]);break;case 0x7:if(_0x41abd8[_0xc6ee('0x6')]!==_0xc6ee('0x7'))_0x5143dd[_0x37a3a7](util[_0xc6ee('0x1d')]('telephone:%s',_0x38cb59[_0x1f0da1][_0x27b961]['name']));break;case 0x8:if(_0x41abd8[_0xc6ee('0x6')]!==_0xc6ee('0x7'))_0x5143dd[_0x37a3a7](util[_0xc6ee('0x1d')](_0xc6ee('0x46'),_0x38cb59[_0x1f0da1][_0x27b961]['name']));break;case 0x9:if(_0x41abd8['role']!=='agent')_0x5143dd[_0x37a3a7](util[_0xc6ee('0x1d')](_0xc6ee('0x47'),_0x38cb59[_0x1f0da1][_0x27b961]['type'],_0x38cb59[_0x1f0da1][_0x27b961]['name']));break;case 0xa:_0x5143dd[_0x37a3a7](util['format'](_0xc6ee('0x20'),_0x38cb59[_0x1f0da1][_0x27b961]['name']));break;}}}}})[_0xc6ee('0xa')](function(){if(_0x37a3a7===_0xc6ee('0x48')){var _0x544c33=_['map'](_0x41abd8['ChatInteractions'],'id');return _0x41abd8[_0xc6ee('0x49')](_0x544c33)[_0xc6ee('0xa')](function(){for(var _0x57ac9c=0x0;_0x57ac9c<_0x544c33['length'];_0x57ac9c+=0x1){_0x567cc2[_0xc6ee('0x4a')](_0xc6ee('0x4b'),{'ChatInteractionId':Number(_0x544c33[_0x57ac9c]),'UserId':Number(_0x41abd8['id'])});}});}})[_0xc6ee('0xa')](function(){if(_0x37a3a7==='leave'){var _0x3051c2=_['map'](_0x41abd8[_0xc6ee('0x25')],'id');return _0x41abd8[_0xc6ee('0x4c')](_0x3051c2)[_0xc6ee('0xa')](function(){for(var _0x26feb2=0x0;_0x26feb2<_0x3051c2['length'];_0x26feb2+=0x1){_0x567cc2[_0xc6ee('0x4a')](_0xc6ee('0x4d'),{'MailInteractionId':Number(_0x3051c2[_0x26feb2]),'UserId':Number(_0x41abd8['id'])});}});}})[_0xc6ee('0xa')](function(){if(_0x37a3a7===_0xc6ee('0x48')){var _0x41a2c5=_['map'](_0x41abd8['FaxInteractions'],'id');return _0x41abd8[_0xc6ee('0x4e')](_0x41a2c5)[_0xc6ee('0xa')](function(){for(var _0x1a2dd5=0x0;_0x1a2dd5<_0x41a2c5[_0xc6ee('0x1f')];_0x1a2dd5+=0x1){_0x567cc2[_0xc6ee('0x4a')](_0xc6ee('0x4f'),{'FaxInteractionId':Number(_0x41a2c5[_0x1a2dd5]),'UserId':Number(_0x41abd8['id'])});}});}})[_0xc6ee('0xa')](function(){if(_0x37a3a7===_0xc6ee('0x48')){var _0x1c82da=_[_0xc6ee('0x17')](_0x41abd8['SmsInteractions'],'id');return _0x41abd8[_0xc6ee('0x50')](_0x1c82da)[_0xc6ee('0xa')](function(){for(var _0x544dfb=0x0;_0x544dfb<_0x1c82da['length'];_0x544dfb+=0x1){_0x567cc2[_0xc6ee('0x4a')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x1c82da[_0x544dfb]),'UserId':Number(_0x41abd8['id'])});}});}})['then'](function(){if(_0x37a3a7===_0xc6ee('0x48')){var _0x3af45a=_[_0xc6ee('0x17')](_0x41abd8['OpenchannelInteractions'],'id');return _0x41abd8[_0xc6ee('0x51')](_0x3af45a)[_0xc6ee('0xa')](function(){for(var _0x5853e5=0x0;_0x5853e5<_0x3af45a[_0xc6ee('0x1f')];_0x5853e5+=0x1){_0x567cc2['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x3af45a[_0x5853e5]),'UserId':Number(_0x41abd8['id'])});}});}})['then'](function(){if(_0x37a3a7===_0xc6ee('0x48')){var _0x3e4a60=_[_0xc6ee('0x17')](_0x41abd8[_0xc6ee('0x2c')],'id');return _0x41abd8[_0xc6ee('0x52')](_0x3e4a60)[_0xc6ee('0xa')](function(){for(var _0x290f33=0x0;_0x290f33<_0x3e4a60['length'];_0x290f33+=0x1){_0x567cc2[_0xc6ee('0x4a')](_0xc6ee('0x53'),{'WhatsappInteractionId':Number(_0x3e4a60[_0x290f33]),'UserId':Number(_0x41abd8['id'])});}});}})['catch'](function(_0x2cd6c6){_0x5143dd[_0xc6ee('0x54')](_0x2cd6c6);});}}function onDisconnect(_0x306a02,_0x192ee5){joinOrLeave(_0x306a02,_0xc6ee('0x48'),_0x192ee5);}function onConnect(_0x33b4b7){joinOrLeave(_0x33b4b7,_0xc6ee('0x55'));}exports[_0xc6ee('0x56')]=function(_0x5afa7e){_0x5afa7e['on'](_0xc6ee('0x57'),function(_0x226738){_0x226738[_0xc6ee('0x58')](0x0);_0x226738[_0xc6ee('0x59')]=_0x226738[_0xc6ee('0x5a')][_0xc6ee('0x57')][_0xc6ee('0x5b')]+':'+_0x226738[_0xc6ee('0x5a')][_0xc6ee('0x57')][_0xc6ee('0x5c')];_0x226738['connectedAt']=new Date();_0x226738[_0xc6ee('0x54')]=function(_0x12f258){console[_0xc6ee('0x54')](_0xc6ee('0x5d')+_0x226738[_0xc6ee('0x5e')]['name']+'['+_0x226738[_0xc6ee('0x59')]+']',_0x12f258);};_0x226738['on']('disconnect',function(){onDisconnect(_0x226738,_0x5afa7e);_0x226738['log']('DISCONNECTED');});onConnect(_0x226738);_0x226738[_0xc6ee('0x54')](_0xc6ee('0x5f'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 0a554d5..68ea539 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 _0x7cb7=['util','../../mysqldb','../logger','triggers','Chat','afterCreate','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','newinteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','get','motionChannel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name','agent','outgoingmessage','AfterCreateMessage','channel','offlineMessage','opened','ContactId','undefined','catch','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','fullname','default','length','hasOwnProperty','model','callback','condition'];(function(_0x18218c,_0x57aefb){var _0xc0149a=function(_0x11e645){while(--_0x11e645){_0x18218c['push'](_0x18218c['shift']());}};_0xc0149a(++_0x57aefb);}(_0x7cb7,0x90));var _0x77cb=function(_0x247484,_0x4ba3e8){_0x247484=_0x247484-0x0;var _0x162857=_0x7cb7[_0x247484];return _0x162857;};'use strict';var util=require(_0x77cb('0x0'));var db=require(_0x77cb('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x77cb('0x2'))(_0x77cb('0x3'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':_0x77cb('0x4'),'model':'ChatInteraction','event':_0x77cb('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':'ChatInteraction','event':_0x77cb('0x6'),'condition':_0x77cb('0x7'),'callback':afterUpdate},{'channel':_0x77cb('0x4'),'model':_0x77cb('0x8'),'event':_0x77cb('0x5'),'condition':_0x77cb('0x9'),'callback':afterCreateMessage},{'channel':_0x77cb('0x4'),'model':_0x77cb('0xa'),'event':_0x77cb('0x5'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0x77cb('0xb'),'model':_0x77cb('0xc'),'event':_0x77cb('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x77cb('0xb'),'model':_0x77cb('0xc'),'event':_0x77cb('0x6'),'condition':_0x77cb('0x7'),'callback':afterUpdate},{'channel':_0x77cb('0xb'),'model':_0x77cb('0xd'),'event':_0x77cb('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x77cb('0xe'),'model':_0x77cb('0xf'),'event':'afterCreate','condition':_0x77cb('0x10'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x77cb('0xf'),'event':'afterUpdate','condition':_0x77cb('0x7'),'callback':afterUpdate},{'channel':_0x77cb('0xe'),'model':_0x77cb('0x11'),'event':_0x77cb('0x5'),'condition':_0x77cb('0x9'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x77cb('0x12'),'event':_0x77cb('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x77cb('0x13'),'model':_0x77cb('0x12'),'event':_0x77cb('0x6'),'condition':_0x77cb('0x7'),'callback':afterUpdate},{'channel':'Fax','model':_0x77cb('0x14'),'event':_0x77cb('0x5'),'condition':_0x77cb('0x9'),'callback':afterCreateMessage},{'channel':_0x77cb('0x15'),'model':'MailInteraction','event':_0x77cb('0x5'),'condition':_0x77cb('0x10'),'callback':afterCreate},{'channel':_0x77cb('0x15'),'model':_0x77cb('0x16'),'event':_0x77cb('0x6'),'condition':_0x77cb('0x7'),'callback':afterUpdate},{'channel':_0x77cb('0x15'),'model':_0x77cb('0x17'),'event':_0x77cb('0x5'),'condition':_0x77cb('0x9'),'callback':afterCreateMessage},{'channel':_0x77cb('0x18'),'model':_0x77cb('0x19'),'event':'afterCreate','condition':_0x77cb('0x10'),'callback':afterCreate},{'channel':'Openchannel','model':'OpenchannelInteraction','event':_0x77cb('0x6'),'condition':_0x77cb('0x7'),'callback':afterUpdate},{'channel':_0x77cb('0x18'),'model':_0x77cb('0x1a'),'event':_0x77cb('0x5'),'condition':_0x77cb('0x9'),'callback':afterCreateMessage}];function request(_0x4b38cb){return client[_0x77cb('0x1b')](_0x77cb('0x1c'),_0x4b38cb)[_0x77cb('0x1d')](function(_0x13c874){logger[_0x77cb('0x1e')](_0x77cb('0x1f'),_0x77cb('0x1c'),_0x13c874);if(_0x13c874['error']){if(_0x13c874[_0x77cb('0x20')]['code']===0x1f4){logger[_0x77cb('0x20')](_0x77cb('0x1f'),_0x77cb('0x1c'),_0x13c874[_0x77cb('0x20')]);}}})['catch'](function(_0x9d092c){logger[_0x77cb('0x20')](_0x77cb('0x1f'),_0x77cb('0x1c'),_0x9d092c);});}function afterCreateMessage(_0x5179b6){return function(_0x11aba6){_0x11aba6=_0x11aba6[_0x77cb('0x21')]({'plain':!![]});_0x11aba6['channel']=_0x5179b6;_0x11aba6[_0x77cb('0x22')]=_0x5179b6;_0x11aba6[_0x77cb('0x23')]=_0x11aba6[_0x77cb('0x24')];Promise['resolve']()[_0x77cb('0x1d')](function(){if(typeof _0x11aba6['ContactId']==='undefined')return null;var _0x469f16=_0x77cb('0x25')+_0x11aba6['ContactId'];return db[_0x77cb('0x26')][_0x77cb('0x27')](_0x469f16,{'type':db[_0x77cb('0x28')][_0x77cb('0x29')][_0x77cb('0x2a')],'raw':!![]});})[_0x77cb('0x1d')](function(_0x355dcc){if(_0x355dcc){_0x11aba6[_0x77cb('0x2b')]=_0x355dcc[0x0];}if(typeof _0x11aba6[_0x77cb('0x2c')]==='undefined')return;return getAgent(_0x11aba6[_0x77cb('0x2c')]);})[_0x77cb('0x1d')](function(_0x14df15){if(_0x14df15){_0x11aba6[_0x77cb('0x2d')]=util[_0x77cb('0x2e')](_0x77cb('0x2f'),_0x14df15[_0x77cb('0x30')]);_0x11aba6[_0x77cb('0x31')]=_0x14df15;_0x11aba6['channel']=_0x5179b6;return request({'event':'incomingmessage','message':_0x11aba6});}else{return request({'event':_0x77cb('0x32'),'message':_0x11aba6});}})['catch'](function(_0x57c2c9){logger['error']('Trigger,\x20%s',_0x77cb('0x33'),_0x57c2c9);});};}function afterCreateOfflineMessage(_0x423e40){return function(_0x2e645e){_0x2e645e=_0x2e645e[_0x77cb('0x21')]({'plain':!![]});_0x2e645e[_0x77cb('0x34')]=_0x423e40;_0x2e645e['motionChannel']=_0x423e40;_0x2e645e['event']=_0x77cb('0x35');return request({'event':_0x2e645e[_0x77cb('0x23')],'message':_0x2e645e});};}function afterCreate(_0x4e8406,_0x296c23){return function(_0x346da2){_0x346da2=_0x346da2[_0x77cb('0x21')]({'plain':!![]});_0x346da2[_0x77cb('0x34')]=_0x4e8406;_0x346da2[_0x77cb('0x22')]=_0x4e8406;_0x346da2[_0x77cb('0x23')]=_0x77cb('0x36');Promise['resolve']()[_0x77cb('0x1d')](function(){var _0x263fab=_0x77cb('0x25')+_0x346da2[_0x77cb('0x37')];return db[_0x77cb('0x26')][_0x77cb('0x27')](_0x263fab,{'type':db['Sequelize']['QueryTypes'][_0x77cb('0x2a')],'raw':!![]});})[_0x77cb('0x1d')](function(_0x4ae4d4){if(_0x4ae4d4){_0x346da2[_0x77cb('0x2b')]=_0x4ae4d4[0x0];}if(typeof _0x346da2[_0x77cb('0x2c')]===_0x77cb('0x38'))return;return getAgent(_0x346da2[_0x77cb('0x2c')]);})[_0x77cb('0x1d')](function(_0x549e96){if(_0x549e96){_0x346da2['interface']=util[_0x77cb('0x2e')](_0x77cb('0x2f'),_0x549e96[_0x77cb('0x30')]);_0x346da2[_0x77cb('0x31')]=_0x549e96;}return request({'event':_0x296c23,'message':_0x346da2});})[_0x77cb('0x39')](function(_0x3de628){logger['error'](_0x77cb('0x1f'),_0x77cb('0x3a'),_0x3de628);});};}function afterUpdate(_0x32753a){return function(_0x2e66db){var _0x2f5cc5=_0x2e66db[_0x77cb('0x3b')](_0x77cb('0x3c'))&&_0x2e66db['closed'];var _0x169202=_0x2e66db[_0x77cb('0x3b')](_0x77cb('0x3d'));if(_0x2f5cc5||_0x169202){var _0x512fe6=_0x2f5cc5?_0x77cb('0x7'):_0x77cb('0x3d');var _0x25ad0c=_0x2e66db[_0x77cb('0x21')]({'plain':!![]});_0x25ad0c['channel']=_0x32753a;_0x25ad0c['motionChannel']=_0x32753a;_0x25ad0c[_0x77cb('0x23')]=_0x2f5cc5?_0x77cb('0x3c'):'substatus';var _0x120cc7=_0x77cb('0x25')+_0x25ad0c[_0x77cb('0x37')];return db[_0x77cb('0x26')][_0x77cb('0x27')](_0x120cc7,{'type':db['Sequelize']['QueryTypes'][_0x77cb('0x2a')],'raw':!![]})[_0x77cb('0x1d')](function(_0x35e8dc){if(_0x35e8dc){_0x25ad0c[_0x77cb('0x2b')]=_0x35e8dc[0x0];}if(typeof _0x25ad0c['UserId']===_0x77cb('0x38'))return;return getAgent(_0x25ad0c[_0x77cb('0x2c')]);})[_0x77cb('0x1d')](function(_0x5b9ba8){if(_0x5b9ba8){_0x25ad0c[_0x77cb('0x2d')]=util[_0x77cb('0x2e')]('SIP/%s',_0x5b9ba8[_0x77cb('0x30')]);_0x25ad0c[_0x77cb('0x31')]=_0x5b9ba8;}return request({'event':_0x512fe6,'message':_0x25ad0c});})['catch'](function(_0x1c58f4){logger[_0x77cb('0x20')](_0x77cb('0x1f'),_0x77cb('0x3e'),_0x1c58f4);});}};}function getAgent(_0x14b17a){return db[_0x77cb('0x3f')][_0x77cb('0x40')]({'where':{'id':_0x14b17a},'attributes':['id',_0x77cb('0x30'),_0x77cb('0x41'),'email','internal'],'raw':!![]})[_0x77cb('0x1d')](function(_0x3f3101){return _0x3f3101;});}exports[_0x77cb('0x42')]=function(){for(var _0x2163b9=0x0;_0x2163b9=_0x2b7914[_0xcda7('0x12')]){throw Error(_0xcda7('0x13'));}_0x46b3c0(_0x1a5e38);})[_0xcda7('0x14')](function(_0x5d9a54){_0x5d860e(_0x5d9a54);});});}; \ No newline at end of file +var _0x6dd3=['blockedAt','updateAttributes','agent','User','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','./license/util','voice','mail','chat','fax','sms','whatsapp','openchannel','getChannels','toLowerCase','includes','clearBlockUser'];(function(_0x5001a1,_0x573494){var _0x4cacbe=function(_0x205124){while(--_0x205124){_0x5001a1['push'](_0x5001a1['shift']());}};_0x4cacbe(++_0x573494);}(_0x6dd3,0xc1));var _0x36dd=function(_0x2c7d37,_0x1b995c){_0x2c7d37=_0x2c7d37-0x0;var _0x4c6830=_0x6dd3[_0x2c7d37];return _0x4c6830;};'use strict';var _=require(_0x36dd('0x0'));var BPromise=require(_0x36dd('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x36dd('0x2'));var channels=[_0x36dd('0x3'),_0x36dd('0x4'),_0x36dd('0x5'),_0x36dd('0x6'),_0x36dd('0x7'),_0x36dd('0x8'),_0x36dd('0x9')];exports[_0x36dd('0xa')]=function(){return channels;};exports['isValidChannel']=function(_0x5ef19b){_0x5ef19b=_0x5ef19b[_0x36dd('0xb')]();return _[_0x36dd('0xc')](channels,_0x5ef19b);};exports[_0x36dd('0xd')]=function(_0x194d02,_0x1e1edf,_0x58d5dc,_0x464b02){var _0x355e1f={'loginAttempts':_0x1e1edf,'blocked':_0x58d5dc};if(!_['isUndefined'](_0x464b02)){_0x355e1f[_0x36dd('0xe')]=_0x464b02;}return _0x194d02[_0x36dd('0xf')](_0x355e1f);};exports['getLicense']=function(_0x40910d){return new BPromise(function(_0x814c76,_0x38ef47){var _0x212991=0x0;if(_0x40910d['role']!==_0x36dd('0x10')){_0x814c76(_0x40910d);}db[_0x36dd('0x11')][_0x36dd('0x12')]({'where':{'role':_0x36dd('0x10'),'online':!![],'id':{'$ne':_0x40910d['id']}}})[_0x36dd('0x13')](function(_0xf220b2){_0x212991=_0xf220b2;return util[_0x36dd('0x14')]();})[_0x36dd('0x13')](function(_0x5b16fe){if(_0x5b16fe&&_0x5b16fe[_0x36dd('0x15')]&&_0x212991>=_0x5b16fe[_0x36dd('0x15')]){throw Error(_0x36dd('0x16'));}_0x814c76(_0x40910d);})['catch'](function(_0x1695a9){_0x38ef47(_0x1695a9);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index e93e365..87b75b5 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb1e=['exports','404','status','json'];(function(_0x3a6223,_0x56818a){var _0x5f1899=function(_0x437b6e){while(--_0x437b6e){_0x3a6223['push'](_0x3a6223['shift']());}};_0x5f1899(++_0x56818a);}(_0xcb1e,0x1b8));var _0xecb1=function(_0x356e8d,_0x24c719){_0x356e8d=_0x356e8d-0x0;var _0x39e65a=_0xcb1e[_0x356e8d];return _0x39e65a;};'use strict';module[_0xecb1('0x0')][0x194]=function pageNotFound(_0x4f0e3e,_0x4d86c9){var _0x4c50ea=_0xecb1('0x1');var _0x970c10=0x194;var _0x1c0d8a={'status':_0x970c10};_0x4d86c9[_0xecb1('0x2')](_0x1c0d8a[_0xecb1('0x2')]);_0x4d86c9['render'](_0x4c50ea,{},function(_0x59f7b4,_0x4b1d16){if(_0x59f7b4){return _0x4d86c9[_0xecb1('0x2')](_0x1c0d8a['status'])[_0xecb1('0x3')](_0x1c0d8a);}_0x4d86c9['send'](_0x4b1d16);});}; \ No newline at end of file +var _0xa6e2=['status','json','exports','404'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0xa6e2,0x132));var _0x2a6e=function(_0x47c864,_0x3b5dc8){_0x47c864=_0x47c864-0x0;var _0x154631=_0xa6e2[_0x47c864];return _0x154631;};'use strict';module[_0x2a6e('0x0')][0x194]=function pageNotFound(_0x3b0758,_0x5a5a48){var _0x144192=_0x2a6e('0x1');var _0x314611=0x194;var _0x4e74b6={'status':_0x314611};_0x5a5a48['status'](_0x4e74b6[_0x2a6e('0x2')]);_0x5a5a48['render'](_0x144192,{},function(_0x5cd74d,_0x2bb3fa){if(_0x5cd74d){return _0x5a5a48[_0x2a6e('0x2')](_0x4e74b6[_0x2a6e('0x2')])[_0x2a6e('0x3')](_0x4e74b6);}_0x5a5a48['send'](_0x2bb3fa);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index d913b91..a8ac1fe 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fde=['../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../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','User','cascade','UserId','hasOne','userSetting','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotification','UserNotifications','SenderId','UserProfile','userProfileId','belongsToMany','ChatGroup','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','SmsInteractions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Messages','mailboxuser','mailbox','uniqueid','AgentReports','Contact','ContactId','MailServerIn','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Answers','ListId','Template','TemplateId','Agents','Teams','MailInteractionId','Account','Owner','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Attachments','MailApplication','TagId','MailQueueReport','List','Items','Dispositions','FaxAccountId','Interactions','Exntensions','FaxInteractionId','fax_interaction_has_tags','Interaction','AttachmentId','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueue','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','ProactiveActions','ChatMessage','ChatApplication','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Tags','user_has_chat_interactions','ChatOfflineMessageId','ChatQueue','team_has_chat_queues','ChatGroupId','Phones','CmContactId','HopperFinals','Company','CompanyId','cm_contact_has_tags','CmHopperAdditionalPhone','CmHopperId','Agent','Campaign','CampaignId','CmHopperBlack','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','MetricId','Configurations','AccountId','SalesforceField','Subjects','SubjectId','FieldId','Subject','Description','Field','VariableId','Descriptions','DescriptionId','int_desk_configuration_has_tags','ZohoAccount','ZendeskField','int_zendesk_configuration_has_tags','ServicenowConfiguration','ServicenowField','Dynamics365Account','Dynamics365Configuration','FreshsalesConfiguration','FreshsalesField','ChatQueueReport','FromId','ToId','JscriptyQuestionReport','SessionId','JscriptyProject','ProjectId','team_has_mail_queues','MailQueues','ChatQueues','team_has_whatsapp_queues','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','BlackLists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToChatQueueId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Smtp','sequelize','lodash','defaultsDeep','motion2','xC@LL1234','127.0.0.1','name','utf8','utf8_general_ci','sequelizeHistory','xcall','utf8mb4','username','password','options','database','import','../api/user/user.model','../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','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount'];(function(_0x1e8862,_0x3c7847){var _0x5862e5=function(_0x3dfd17){while(--_0x3dfd17){_0x1e8862['push'](_0x1e8862['shift']());}};_0x5862e5(++_0x3c7847);}(_0x8fde,0x1c2));var _0xe8fd=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x8fde[_0x2235bf];return _0x4c3a64;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xe8fd('0x0'));var _=require(_0xe8fd('0x1'));var jstz=require('jstz');var timezone=jstz['determine']();config['sequelize']=_[_0xe8fd('0x2')](config['sequelize'],{'database':_0xe8fd('0x3'),'username':'xcall','password':_0xe8fd('0x4'),'options':{'host':_0xe8fd('0x5'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xe8fd('0x6')](),'define':{'charset':_0xe8fd('0x7'),'collate':_0xe8fd('0x8')}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0xe8fd('0x9')],{'database':_0xe8fd('0x3'),'username':_0xe8fd('0xa'),'password':_0xe8fd('0x4'),'options':{'host':_0xe8fd('0x5'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xe8fd('0xb')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xe8fd('0x7'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config['sequelize'][_0xe8fd('0xc')],config[_0xe8fd('0x0')][_0xe8fd('0xd')],config[_0xe8fd('0x0')][_0xe8fd('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe8fd('0x9')][_0xe8fd('0xf')],config[_0xe8fd('0x9')][_0xe8fd('0xc')],config['sequelizeHistory']['password'],config[_0xe8fd('0x9')]['options'])};db['User']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x11'));db['VoiceChanSpy']=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x12'));db[_0xe8fd('0x13')]=db[_0xe8fd('0x0')]['import']('../api/voiceContext/voiceContext.model');db[_0xe8fd('0x14')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x15'));db['VoiceMusicOnHold']=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x16'));db[_0xe8fd('0x17')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x18'));db[_0xe8fd('0x19')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x1a'));db[_0xe8fd('0x1b')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x1c'));db[_0xe8fd('0x1d')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/voiceMail/voiceMail.model');db[_0xe8fd('0x1e')]=db['sequelize']['import'](_0xe8fd('0x1f'));db[_0xe8fd('0x20')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/voiceCallReport/voiceCallReport.model');db[_0xe8fd('0x21')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x22'));db[_0xe8fd('0x23')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x24'));db[_0xe8fd('0x25')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xe8fd('0x26')]=db[_0xe8fd('0x0')]['import']('../api/memberReport/memberReport.model');db[_0xe8fd('0x27')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x28'));db[_0xe8fd('0x29')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x2a'));db[_0xe8fd('0x2b')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x2c'));db[_0xe8fd('0x2d')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x2e'));db[_0xe8fd('0x2f')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x30'));db[_0xe8fd('0x31')]=db[_0xe8fd('0x0')]['import']('../api/userMailQueue/userMailQueue.model');db[_0xe8fd('0x32')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x33'));db[_0xe8fd('0x34')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x35'));db[_0xe8fd('0x36')]=db['sequelize'][_0xe8fd('0x10')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xe8fd('0x37')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x38'));db['MailServerIn']=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x39'));db[_0xe8fd('0x3a')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x3b'));db[_0xe8fd('0x3c')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x3d'));db['MailQueue']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x3e'));db['MailSubstatus']=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x3f'));db[_0xe8fd('0x40')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/mailInteraction/mailInteraction.model');db[_0xe8fd('0x41')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x42'));db['MailApplication']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x43'));db['MailQueueReport']=db['sequelize'][_0xe8fd('0x10')]('../api/mailQueueReport/mailQueueReport.model');db[_0xe8fd('0x44')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/dashboard/dashboard.model');db[_0xe8fd('0x45')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x46'));db[_0xe8fd('0x47')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x48'));db[_0xe8fd('0x49')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x4a'));db['FaxInteraction']=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x4b'));db[_0xe8fd('0x4c')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x4d'));db[_0xe8fd('0x4e')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/faxQueue/faxQueue.model');db[_0xe8fd('0x4f')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x50'));db[_0xe8fd('0x51')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x52'));db[_0xe8fd('0x53')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/smsInteraction/smsInteraction.model');db[_0xe8fd('0x54')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x55'));db[_0xe8fd('0x56')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/smsQueue/smsQueue.model');db[_0xe8fd('0x57')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x58'));db[_0xe8fd('0x59')]=db['sequelize']['import'](_0xe8fd('0x5a'));db[_0xe8fd('0x5b')]=db[_0xe8fd('0x0')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0xe8fd('0x5c')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x5d'));db['OpenchannelQueue']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x5e'));db[_0xe8fd('0x5f')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x60'));db[_0xe8fd('0x61')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x62'));db['ChatApplication']=db['sequelize'][_0xe8fd('0x10')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x63'));db['ChatMessage']=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/chatMessage/chatMessage.model');db[_0xe8fd('0x64')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x65'));db['ChatQueue']=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x66'));db['ChatGroup']=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x67'));db[_0xe8fd('0x68')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x69'));db['CmContact']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x6a'));db[_0xe8fd('0x6b')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x6c'));db['CmHopperBlack']=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xe8fd('0x6d')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x6e'));db[_0xe8fd('0x6f')]=db['sequelize']['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0xe8fd('0x70')]=db[_0xe8fd('0x0')]['import']('../api/reportAgentPreview/reportAgentPreview.model');db[_0xe8fd('0x71')]=db[_0xe8fd('0x0')]['import']('../api/cmCustomField/cmCustomField.model');db[_0xe8fd('0x72')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x73'));db[_0xe8fd('0x74')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x75'));db[_0xe8fd('0x76')]=db[_0xe8fd('0x0')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0xe8fd('0x77')]=db['sequelize']['import']('../api/disposition/disposition.model');db[_0xe8fd('0x78')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x79'));db['Interval']=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x7a'));db[_0xe8fd('0x7b')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/pause/pause.model');db[_0xe8fd('0x7c')]=db['sequelize']['import'](_0xe8fd('0x7d'));db[_0xe8fd('0x7e')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xe8fd('0x7f')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x80'));db[_0xe8fd('0x81')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/sound/sound.model');db[_0xe8fd('0x82')]=db['sequelize']['import'](_0xe8fd('0x83'));db[_0xe8fd('0x84')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x85'));db[_0xe8fd('0x86')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x87'));db['CmHopperAdditionalPhone']=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0x88'));db['Template']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x89'));db[_0xe8fd('0x8a')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x8b'));db[_0xe8fd('0x8c')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x8d'));db[_0xe8fd('0x8e')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x8f'));db[_0xe8fd('0x90')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x91'));db[_0xe8fd('0x92')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xe8fd('0x93')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x94'));db['AnalyticExtractedReport']=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x95'));db[_0xe8fd('0x96')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x97'));db[_0xe8fd('0x98')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x99'));db[_0xe8fd('0x9a')]=db['sequelize']['import'](_0xe8fd('0x9b'));db[_0xe8fd('0x9c')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x9d'));db[_0xe8fd('0x9e')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x9f'));db[_0xe8fd('0xa0')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xa1'));db[_0xe8fd('0xa2')]=db['sequelize']['import'](_0xe8fd('0xa3'));db[_0xe8fd('0xa4')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0xa5'));db[_0xe8fd('0xa6')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xa7'));db[_0xe8fd('0xa8')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xa9'));db[_0xe8fd('0xaa')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0xab'));db['ZohoAccount']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xac'));db[_0xe8fd('0xad')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xe8fd('0xae')]=db['sequelize']['import'](_0xe8fd('0xaf'));db[_0xe8fd('0xb0')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xe8fd('0xb1')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0xb2'));db['ZendeskField']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xb3'));db[_0xe8fd('0xb4')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xb5'));db[_0xe8fd('0xb6')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xb7'));db[_0xe8fd('0xb8')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xb9'));db[_0xe8fd('0xba')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xbb'));db[_0xe8fd('0xbc')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xbd'));db[_0xe8fd('0xbe')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xbf'));db[_0xe8fd('0xc0')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xc1'));db['ServicenowConfiguration']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xc2'));db['ServicenowField']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xc3'));db['Dynamics365Account']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xc4'));db['Dynamics365Configuration']=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xc5'));db[_0xe8fd('0xc6')]=db['sequelize'][_0xe8fd('0x10')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xe8fd('0xc7')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xc8'));db['FreshsalesConfiguration']=db['sequelize']['import'](_0xe8fd('0xc9'));db['FreshsalesField']=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xca'));db['Integration']=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/integration/integration.model');db[_0xe8fd('0xcb')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xcc'));db['ChatQueueReport']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xcd'));db[_0xe8fd('0xce')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0xcf'));db[_0xe8fd('0xd0')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xd1'));db['JscriptyQuestionReport']=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xd2'));db[_0xe8fd('0xd3')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0xd4'));db[_0xe8fd('0xd5')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/smsQueueReport/smsQueueReport.model');db[_0xe8fd('0xd6')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xd7'));db[_0xe8fd('0xd8')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xd9'));db['JscriptyProject']=db[_0xe8fd('0x0')]['import'](_0xe8fd('0xda'));db[_0xe8fd('0xdb')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xdc'));db[_0xe8fd('0xdd')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xde'));db[_0xe8fd('0xdf')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xe0'));db[_0xe8fd('0xe1')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xe2'));db[_0xe8fd('0xe3')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xe4'));db[_0xe8fd('0xe5')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xe6'));db[_0xe8fd('0xe7')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xe8'));db['Campaign']=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xe9'));db[_0xe8fd('0xea')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xeb'));db[_0xe8fd('0xec')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xed'));db[_0xe8fd('0xee')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xef'));db[_0xe8fd('0xf0')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xf1'));db[_0xe8fd('0xf2')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xf3'));db[_0xe8fd('0xf4')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xf5'));db['OpenchannelTransferReport']=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xe8fd('0xf6')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0xf7'));db[_0xe8fd('0xf8')]=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xf9'));db['VoicePrefix']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xfa'));db['UserProfile']=db[_0xe8fd('0x0')]['import']('../api/userProfile/userProfile.model');db[_0xe8fd('0xfb')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0xfc'));db[_0xe8fd('0xfd')]=db['sequelize'][_0xe8fd('0x10')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db['sequelize'][_0xe8fd('0x10')](_0xe8fd('0xfe'));db[_0xe8fd('0xff')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x100'));db[_0xe8fd('0x101')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')]('../api/whatsappApplication/whatsappApplication.model');db[_0xe8fd('0x102')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x103'));db[_0xe8fd('0x104')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x105'));db[_0xe8fd('0x106')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x107'));db[_0xe8fd('0x108')]=db['sequelize'][_0xe8fd('0x10')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xe8fd('0x109')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x10a'));db['CloudProvider']=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x10b'));db[_0xe8fd('0x10c')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x10d'));db[_0xe8fd('0x10e')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x10f'));db[_0xe8fd('0x110')]=db[_0xe8fd('0x0')][_0xe8fd('0x10')](_0xe8fd('0x111'));db[_0xe8fd('0x112')]=db[_0xe8fd('0x0')]['import'](_0xe8fd('0x113'));db[_0xe8fd('0x114')]['hasOne'](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x116')});db[_0xe8fd('0x114')][_0xe8fd('0x117')](db[_0xe8fd('0x112')],{'as':_0xe8fd('0x118'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x116')});db[_0xe8fd('0x114')][_0xe8fd('0x119')](db['VoiceRecording'],{'as':_0xe8fd('0x11a'),'foreignKey':_0xe8fd('0x116')});db[_0xe8fd('0x114')][_0xe8fd('0x119')](db[_0xe8fd('0x2b')],{'as':_0xe8fd('0x11b'),'foreignKey':'UserId'});db[_0xe8fd('0x114')][_0xe8fd('0x119')](db['VoiceExtension'],{'as':_0xe8fd('0x11c'),'onDelete':_0xe8fd('0x115'),'hooks':!![]});db[_0xe8fd('0x114')][_0xe8fd('0x119')](db[_0xe8fd('0x6d')],{'as':'HopperFinals','foreignKey':_0xe8fd('0x116')});db['User'][_0xe8fd('0x119')](db[_0xe8fd('0x6f')],{'as':_0xe8fd('0x11d'),'foreignKey':_0xe8fd('0x116')});db[_0xe8fd('0x114')][_0xe8fd('0x119')](db[_0xe8fd('0x70')],{'as':'ReportAgentPreview','foreignKey':_0xe8fd('0x116')});db['User'][_0xe8fd('0x119')](db[_0xe8fd('0x5b')],{'as':_0xe8fd('0x11e'),'foreignKey':_0xe8fd('0x116')});db['User'][_0xe8fd('0x119')](db[_0xe8fd('0x11f')],{'as':_0xe8fd('0x120'),'foreignKey':'UserId'});db[_0xe8fd('0x114')][_0xe8fd('0x119')](db[_0xe8fd('0x53')],{'as':'SmsInteractions','foreignKey':_0xe8fd('0x116')});db[_0xe8fd('0x114')][_0xe8fd('0x119')](db[_0xe8fd('0x121')],{'as':_0xe8fd('0x122'),'foreignKey':'UserId'});db[_0xe8fd('0x114')][_0xe8fd('0x119')](db[_0xe8fd('0x40')],{'as':_0xe8fd('0x123'),'foreignKey':_0xe8fd('0x116')});db['User'][_0xe8fd('0x119')](db[_0xe8fd('0x102')],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0xe8fd('0x114')][_0xe8fd('0x119')](db[_0xe8fd('0x124')],{'as':_0xe8fd('0x125'),'foreignKey':_0xe8fd('0x126')});db[_0xe8fd('0x114')]['belongsTo'](db[_0xe8fd('0x127')],{'as':'UserProfile','foreignKey':_0xe8fd('0x128')});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db[_0xe8fd('0x12a')],{'as':'Groups','through':_0xe8fd('0x12b')});db['User']['belongsToMany'](db[_0xe8fd('0x12c')],{'as':_0xe8fd('0x12d'),'through':_0xe8fd('0x12e')});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db[_0xe8fd('0xf8')],{'as':_0xe8fd('0x12f'),'through':_0xe8fd('0x130')});db['User'][_0xe8fd('0x129')](db['Team'],{'through':_0xe8fd('0x131')});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db[_0xe8fd('0x40')],{'as':_0xe8fd('0x123'),'through':'user_has_mail_interactions'});db['User'][_0xe8fd('0x129')](db[_0xe8fd('0x11f')],{'as':_0xe8fd('0x120'),'through':'user_has_chat_interactions'});db['User'][_0xe8fd('0x129')](db['FaxInteraction'],{'as':_0xe8fd('0x122'),'through':'user_has_fax_interactions'});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db[_0xe8fd('0x53')],{'as':_0xe8fd('0x132'),'through':_0xe8fd('0x133')});db['User'][_0xe8fd('0x129')](db[_0xe8fd('0x5b')],{'as':_0xe8fd('0x11e'),'through':'user_has_openchannel_interactions'});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0xe8fd('0x134')});db[_0xe8fd('0x114')]['belongsToMany'](db[_0xe8fd('0x17')],{'as':_0xe8fd('0x135'),'through':_0xe8fd('0x2d'),'required':![]});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db[_0xe8fd('0x136')],{'as':_0xe8fd('0x137'),'through':'UserVoicePrefix','required':![]});db['User'][_0xe8fd('0x129')](db[_0xe8fd('0x138')],{'as':'MailQueues','through':_0xe8fd('0x31'),'required':![]});db['User'][_0xe8fd('0x129')](db['ChatQueue'],{'as':'ChatQueues','through':_0xe8fd('0x2f'),'required':![],'hooks':!![]});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db['FaxQueue'],{'as':_0xe8fd('0x139'),'through':'UserFaxQueue','required':![]});db[_0xe8fd('0x114')]['belongsToMany'](db[_0xe8fd('0x56')],{'as':_0xe8fd('0x13a'),'through':_0xe8fd('0x34'),'required':![]});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db['OpenchannelQueue'],{'as':_0xe8fd('0x13b'),'through':_0xe8fd('0x36'),'required':![]});db['User'][_0xe8fd('0x129')](db[_0xe8fd('0x109')],{'as':_0xe8fd('0x13c'),'through':_0xe8fd('0x37'),'required':![]});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db[_0xe8fd('0xf8')],{'through':'cm_user_has_lists'});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db[_0xe8fd('0x5f')],{'as':_0xe8fd('0x13d'),'through':_0xe8fd('0x13e')});db['User'][_0xe8fd('0x129')](db[_0xe8fd('0x47')],{'as':_0xe8fd('0x13f'),'through':_0xe8fd('0x140')});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db[_0xe8fd('0x3c')],{'as':_0xe8fd('0x141'),'through':_0xe8fd('0x142')});db[_0xe8fd('0x114')]['belongsToMany'](db[_0xe8fd('0x57')],{'as':_0xe8fd('0x143'),'through':'user_has_openchannel_accounts'});db['User'][_0xe8fd('0x129')](db[_0xe8fd('0x51')],{'as':'SmsAccounts','through':_0xe8fd('0x144')});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db[_0xe8fd('0xff')],{'as':_0xe8fd('0x145'),'through':_0xe8fd('0x146')});db[_0xe8fd('0x114')][_0xe8fd('0x129')](db[_0xe8fd('0xdf')],{'as':_0xe8fd('0x147'),'through':_0xe8fd('0x148')});db[_0xe8fd('0x149')][_0xe8fd('0x119')](db['VoiceExtension'],{'as':_0xe8fd('0x14a'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x14b')});db[_0xe8fd('0x13')]['hasMany'](db[_0xe8fd('0x14')],{'onDelete':'cascade'});db[_0xe8fd('0x14')][_0xe8fd('0x119')](db[_0xe8fd('0x14')],{'as':_0xe8fd('0x14c'),'onDelete':'cascade'});db[_0xe8fd('0x14d')][_0xe8fd('0x129')](db[_0xe8fd('0x81')],{'as':'Sounds','through':_0xe8fd('0x14e')});db[_0xe8fd('0x17')][_0xe8fd('0x119')](db[_0xe8fd('0x2b')],{'as':_0xe8fd('0x14f'),'foreignKey':_0xe8fd('0x150')});db['VoiceQueue'][_0xe8fd('0x119')](db[_0xe8fd('0x6b')],{'as':_0xe8fd('0x151'),'foreignKey':'VoiceQueueId'});db[_0xe8fd('0x17')][_0xe8fd('0x119')](db[_0xe8fd('0x6d')],{'as':'HopperFinals','foreignKey':_0xe8fd('0x150')});db[_0xe8fd('0x17')]['hasMany'](db[_0xe8fd('0x6f')],{'as':_0xe8fd('0x152'),'foreignKey':_0xe8fd('0x150')});db[_0xe8fd('0x17')][_0xe8fd('0x119')](db[_0xe8fd('0x70')],{'as':_0xe8fd('0x70'),'foreignKey':_0xe8fd('0x150')});db[_0xe8fd('0x17')][_0xe8fd('0x119')](db['CmHopperBlack'],{'as':_0xe8fd('0x153'),'foreignKey':_0xe8fd('0x150')});db[_0xe8fd('0x17')][_0xe8fd('0x119')](db[_0xe8fd('0xd3')],{'as':_0xe8fd('0x154'),'foreignKey':_0xe8fd('0x150')});db[_0xe8fd('0x17')][_0xe8fd('0x155')](db[_0xe8fd('0x27')],{'as':_0xe8fd('0x27'),'foreignKey':_0xe8fd('0x156')});db['VoiceQueue'][_0xe8fd('0x155')](db[_0xe8fd('0x27')],{'as':_0xe8fd('0x157'),'foreignKey':'TrunkBackupId'});db[_0xe8fd('0x17')][_0xe8fd('0x155')](db[_0xe8fd('0x158')],{'as':_0xe8fd('0x158'),'foreignKey':_0xe8fd('0x159')});db['VoiceQueue'][_0xe8fd('0x155')](db[_0xe8fd('0x7b')],{'as':_0xe8fd('0x15a'),'foreignKey':_0xe8fd('0x15b')});db[_0xe8fd('0x17')][_0xe8fd('0x129')](db[_0xe8fd('0xf8')],{'as':_0xe8fd('0x12f'),'through':_0xe8fd('0x15c')});db[_0xe8fd('0x17')]['belongsToMany'](db[_0xe8fd('0x114')],{'as':'Agents','through':_0xe8fd('0x2d')});db['VoiceQueue'][_0xe8fd('0x129')](db[_0xe8fd('0xe5')],{'as':'Teams','through':_0xe8fd('0x10c')});db[_0xe8fd('0x17')][_0xe8fd('0x129')](db[_0xe8fd('0xf8')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db[_0xe8fd('0x19')]['belongsTo'](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x114'),'foreignKey':_0xe8fd('0x116')});db[_0xe8fd('0x1b')]['belongsTo'](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x114'),'foreignKey':_0xe8fd('0x116')});db[_0xe8fd('0x1d')]['hasMany'](db['VoiceMailMessage'],{'as':_0xe8fd('0x15d'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x15e'),'sourceKey':_0xe8fd('0x15f')});db[_0xe8fd('0x1e')][_0xe8fd('0x155')](db[_0xe8fd('0x1d')],{'foreignKey':_0xe8fd('0x15e'),'targetKey':'mailbox'});db[_0xe8fd('0x20')][_0xe8fd('0x119')](db[_0xe8fd('0x25')],{'as':'QueueCalls','foreignKey':_0xe8fd('0x160'),'constraints':![]});db[_0xe8fd('0x20')]['hasMany'](db['VoiceAgentReport'],{'as':_0xe8fd('0x161'),'foreignKey':_0xe8fd('0x160'),'constraints':![]});db[_0xe8fd('0x20')]['belongsTo'](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x114'),'foreignKey':_0xe8fd('0x116')});db[_0xe8fd('0x20')][_0xe8fd('0x155')](db[_0xe8fd('0x12c')],{'as':_0xe8fd('0x162'),'foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0x164')][_0xe8fd('0x155')](db['MailAccount'],{'as':_0xe8fd('0x3c'),'foreignKey':_0xe8fd('0x165')});db[_0xe8fd('0x164')]['belongsTo'](db[_0xe8fd('0x166')],{'as':'CloudProvider','foreignKey':_0xe8fd('0x167'),'onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x3a')][_0xe8fd('0x155')](db['MailAccount'],{'as':_0xe8fd('0x3c'),'foreignKey':'MailAccountId'});db[_0xe8fd('0x3a')][_0xe8fd('0x155')](db[_0xe8fd('0x166')],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0xe8fd('0x168')});db['MailAccount'][_0xe8fd('0x117')](db[_0xe8fd('0x164')],{'as':_0xe8fd('0x169'),'onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x3c')][_0xe8fd('0x117')](db[_0xe8fd('0x3a')],{'as':'Smtp','onDelete':'cascade'});db['MailAccount'][_0xe8fd('0x119')](db[_0xe8fd('0x77')],{'as':'Dispositions','foreignKey':_0xe8fd('0x165'),'onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x3c')][_0xe8fd('0x119')](db['CannedAnswer'],{'as':_0xe8fd('0x16a'),'foreignKey':_0xe8fd('0x165')});db[_0xe8fd('0x3c')][_0xe8fd('0x119')](db[_0xe8fd('0x41')],{'as':_0xe8fd('0x15d'),'foreignKey':_0xe8fd('0x165')});db['MailAccount'][_0xe8fd('0x119')](db[_0xe8fd('0x40')],{'as':'Interactions'});db[_0xe8fd('0x3c')][_0xe8fd('0x119')](db['MailApplication'],{'as':_0xe8fd('0x14c')});db[_0xe8fd('0x3c')][_0xe8fd('0x155')](db[_0xe8fd('0xf8')],{'as':'List','foreignKey':_0xe8fd('0x16b')});db['MailAccount'][_0xe8fd('0x155')](db[_0xe8fd('0x16c')],{'as':_0xe8fd('0x16c'),'foreignKey':_0xe8fd('0x16d')});db['MailAccount'][_0xe8fd('0x155')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xe8fd('0x15b')});db['MailAccount'][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x16e'),'through':_0xe8fd('0x142')});db[_0xe8fd('0x138')][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':'Agents','through':_0xe8fd('0x31')});db[_0xe8fd('0x138')][_0xe8fd('0x129')](db[_0xe8fd('0xe5')],{'through':'team_has_mail_queues','as':_0xe8fd('0x16f')});db[_0xe8fd('0x40')][_0xe8fd('0x119')](db[_0xe8fd('0x41')],{'as':_0xe8fd('0x15d'),'onDelete':'cascade','foreignKey':_0xe8fd('0x170')});db[_0xe8fd('0x40')][_0xe8fd('0x155')](db[_0xe8fd('0x3c')],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x165')});db[_0xe8fd('0x40')][_0xe8fd('0x155')](db['CmContact'],{'as':_0xe8fd('0x162'),'foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0x40')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x172'),'foreignKey':'UserId'});db[_0xe8fd('0x40')]['belongsToMany'](db['Tag'],{'through':_0xe8fd('0x173'),'as':'Tags'});db['MailInteraction'][_0xe8fd('0x129')](db[_0xe8fd('0x82')],{'through':_0xe8fd('0x173'),'as':_0xe8fd('0x174')});db['MailInteraction'][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x175'),'through':_0xe8fd('0x176'),'foreignKey':_0xe8fd('0x170')});db[_0xe8fd('0x41')][_0xe8fd('0x119')](db['Attachment'],{'as':_0xe8fd('0x177'),'onDelete':_0xe8fd('0x115')});db['MailMessage']['belongsTo'](db['User'],{'as':_0xe8fd('0x114')});db[_0xe8fd('0x41')][_0xe8fd('0x155')](db[_0xe8fd('0x12c')],{'onDelete':_0xe8fd('0x115'),'as':_0xe8fd('0x162')});db[_0xe8fd('0x41')][_0xe8fd('0x155')](db[_0xe8fd('0x40')],{'as':'Interaction','foreignKey':_0xe8fd('0x170')});db[_0xe8fd('0x41')]['belongsTo'](db[_0xe8fd('0x3c')],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x165')});db[_0xe8fd('0x41')]['belongsTo'](db[_0xe8fd('0x5f')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db[_0xe8fd('0x41')][_0xe8fd('0x155')](db[_0xe8fd('0x64')],{'as':_0xe8fd('0x64'),'foreignKey':'ChatOfflineMessageId'});db[_0xe8fd('0x178')]['belongsTo'](db[_0xe8fd('0x114')],{'onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x178')]['belongsTo'](db[_0xe8fd('0x138')],{'onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x178')][_0xe8fd('0x155')](db[_0xe8fd('0x3c')],{'onDelete':'restrict'});db[_0xe8fd('0x178')]['belongsTo'](db['Interval'],{'onDelete':_0xe8fd('0x168'),'foreignKey':_0xe8fd('0x159')});db[_0xe8fd('0x178')][_0xe8fd('0x155')](db['Tag'],{'onDelete':_0xe8fd('0x168'),'foreignKey':_0xe8fd('0x179')});db[_0xe8fd('0x17a')][_0xe8fd('0x155')](db[_0xe8fd('0x3c')],{});db[_0xe8fd('0x17a')][_0xe8fd('0x155')](db[_0xe8fd('0xf8')],{'as':_0xe8fd('0x17b'),'foreignKey':'ListId'});db[_0xe8fd('0x17a')]['belongsTo'](db['CmContact'],{'as':_0xe8fd('0x162'),'foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0x17a')]['belongsTo'](db[_0xe8fd('0x40')],{});db['MailQueueReport']['belongsTo'](db[_0xe8fd('0x41')],{});db[_0xe8fd('0x17a')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{});db[_0xe8fd('0x17a')][_0xe8fd('0x155')](db['MailQueue'],{});db['Dashboard']['hasMany'](db[_0xe8fd('0x45')],{'as':_0xe8fd('0x17c'),'onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x47')][_0xe8fd('0x119')](db[_0xe8fd('0x77')],{'as':_0xe8fd('0x17d'),'foreignKey':_0xe8fd('0x17e'),'onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x47')]['hasMany'](db[_0xe8fd('0x76')],{'as':_0xe8fd('0x16a'),'foreignKey':_0xe8fd('0x17e')});db[_0xe8fd('0x47')][_0xe8fd('0x119')](db['FaxInteraction'],{'as':_0xe8fd('0x17f')});db[_0xe8fd('0x47')][_0xe8fd('0x119')](db['FaxApplication'],{'as':_0xe8fd('0x14c')});db[_0xe8fd('0x47')][_0xe8fd('0x119')](db['VoiceExtension'],{'as':_0xe8fd('0x180'),'onDelete':'cascade'});db['FaxAccount']['hasMany'](db['FaxMessage'],{'as':_0xe8fd('0x15d')});db[_0xe8fd('0x47')][_0xe8fd('0x155')](db['Trunk'],{'as':'Trunk'});db[_0xe8fd('0x47')][_0xe8fd('0x155')](db[_0xe8fd('0xf8')],{'as':'List','foreignKey':_0xe8fd('0x16b')});db[_0xe8fd('0x47')][_0xe8fd('0x155')](db[_0xe8fd('0x7b')],{'as':_0xe8fd('0x15a'),'foreignKey':_0xe8fd('0x15b')});db[_0xe8fd('0x47')][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x16e'),'through':_0xe8fd('0x140')});db[_0xe8fd('0x49')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x49')][_0xe8fd('0x155')](db[_0xe8fd('0x4e')],{'onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x49')][_0xe8fd('0x155')](db[_0xe8fd('0x47')],{'onDelete':_0xe8fd('0x168')});db['FaxApplication']['belongsTo'](db[_0xe8fd('0x82')],{'onDelete':_0xe8fd('0x168'),'foreignKey':'TagId'});db[_0xe8fd('0x121')]['hasMany'](db[_0xe8fd('0x4c')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xe8fd('0x181')});db['FaxInteraction']['belongsTo'](db[_0xe8fd('0x47')],{'as':'Account','foreignKey':_0xe8fd('0x17e')});db[_0xe8fd('0x121')][_0xe8fd('0x155')](db['CmContact'],{'as':_0xe8fd('0x162'),'foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0x121')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x172'),'foreignKey':'UserId'});db[_0xe8fd('0x121')][_0xe8fd('0x129')](db[_0xe8fd('0x82')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0xe8fd('0x121')][_0xe8fd('0x129')](db['Tag'],{'through':_0xe8fd('0x182'),'as':_0xe8fd('0x174')});db[_0xe8fd('0x121')]['belongsToMany'](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x175'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0xe8fd('0x4c')]['belongsTo'](db['User'],{'onDelete':_0xe8fd('0x115'),'as':_0xe8fd('0x114')});db['FaxMessage'][_0xe8fd('0x155')](db[_0xe8fd('0x121')],{'as':_0xe8fd('0x183'),'foreignKey':_0xe8fd('0x181')});db[_0xe8fd('0x4c')][_0xe8fd('0x155')](db[_0xe8fd('0x12c')],{'onDelete':_0xe8fd('0x115'),'as':'Contact'});db[_0xe8fd('0x4c')][_0xe8fd('0x155')](db[_0xe8fd('0xec')],{'as':_0xe8fd('0xec'),'foreignKey':_0xe8fd('0x184')});db[_0xe8fd('0x4c')][_0xe8fd('0x155')](db[_0xe8fd('0x47')],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x17e')});db[_0xe8fd('0x4e')][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x16e'),'through':_0xe8fd('0x32')});db[_0xe8fd('0x4e')][_0xe8fd('0x129')](db[_0xe8fd('0xe5')],{'through':'team_has_fax_queues','as':_0xe8fd('0x16f')});db[_0xe8fd('0x4f')][_0xe8fd('0x155')](db['FaxAccount'],{});db[_0xe8fd('0x4f')][_0xe8fd('0x155')](db['CmList'],{'as':_0xe8fd('0x17b'),'foreignKey':_0xe8fd('0x16b')});db['FaxQueueReport'][_0xe8fd('0x155')](db[_0xe8fd('0x12c')],{'as':'Contact','foreignKey':_0xe8fd('0x163')});db['FaxQueueReport'][_0xe8fd('0x155')](db['FaxInteraction'],{});db[_0xe8fd('0x4f')][_0xe8fd('0x155')](db[_0xe8fd('0x4c')],{});db[_0xe8fd('0x4f')]['belongsTo'](db[_0xe8fd('0x114')],{});db[_0xe8fd('0x4f')][_0xe8fd('0x155')](db['FaxQueue'],{});db['SmsAccount'][_0xe8fd('0x119')](db['Disposition'],{'as':_0xe8fd('0x17d'),'foreignKey':_0xe8fd('0x185'),'onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x51')][_0xe8fd('0x119')](db[_0xe8fd('0x76')],{'as':_0xe8fd('0x16a'),'foreignKey':_0xe8fd('0x185')});db[_0xe8fd('0x51')][_0xe8fd('0x119')](db[_0xe8fd('0x54')],{'as':_0xe8fd('0x15d'),'foreignKey':_0xe8fd('0x185')});db[_0xe8fd('0x51')][_0xe8fd('0x119')](db[_0xe8fd('0x53')],{'as':'Interactions'});db[_0xe8fd('0x51')][_0xe8fd('0x119')](db[_0xe8fd('0x186')],{'as':_0xe8fd('0x14c')});db[_0xe8fd('0x51')][_0xe8fd('0x155')](db['CmList'],{'as':'List','foreignKey':_0xe8fd('0x16b')});db[_0xe8fd('0x51')][_0xe8fd('0x155')](db[_0xe8fd('0x7b')],{'as':_0xe8fd('0x15a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe8fd('0x51')]['belongsToMany'](db['User'],{'as':_0xe8fd('0x16e'),'through':_0xe8fd('0x144')});db[_0xe8fd('0x186')][_0xe8fd('0x155')](db['User'],{'onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x186')][_0xe8fd('0x155')](db['SmsQueue'],{'onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x186')]['belongsTo'](db[_0xe8fd('0x51')],{'onDelete':_0xe8fd('0x168')});db['SmsApplication'][_0xe8fd('0x155')](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db['SmsApplication']['belongsTo'](db[_0xe8fd('0x82')],{'onDelete':_0xe8fd('0x168'),'foreignKey':_0xe8fd('0x179')});db[_0xe8fd('0x53')][_0xe8fd('0x119')](db[_0xe8fd('0x54')],{'as':_0xe8fd('0x15d'),'onDelete':'cascade','foreignKey':_0xe8fd('0x187')});db[_0xe8fd('0x53')]['belongsTo'](db[_0xe8fd('0x51')],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x185')});db[_0xe8fd('0x53')][_0xe8fd('0x155')](db[_0xe8fd('0x12c')],{'as':_0xe8fd('0x162'),'foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0x53')]['belongsTo'](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x172'),'foreignKey':_0xe8fd('0x116')});db[_0xe8fd('0x53')]['belongsToMany'](db['Tag'],{'through':'sms_interaction_has_tags','as':'Tags'});db['SmsInteraction']['belongsToMany'](db[_0xe8fd('0x82')],{'through':_0xe8fd('0x188'),'as':_0xe8fd('0x174')});db['SmsInteraction'][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':'Users','through':_0xe8fd('0x133'),'foreignKey':_0xe8fd('0x187')});db[_0xe8fd('0x54')]['belongsTo'](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x114')});db['SmsMessage'][_0xe8fd('0x155')](db['CmContact'],{'onDelete':_0xe8fd('0x115'),'as':_0xe8fd('0x162')});db[_0xe8fd('0x54')][_0xe8fd('0x155')](db[_0xe8fd('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xe8fd('0x187')});db['SmsMessage'][_0xe8fd('0x155')](db[_0xe8fd('0x51')],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x185')});db[_0xe8fd('0x56')]['belongsToMany'](db[_0xe8fd('0x114')],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0xe8fd('0x189')});db[_0xe8fd('0x56')]['belongsToMany'](db[_0xe8fd('0xe5')],{'through':'team_has_sms_queues','as':'Teams'});db[_0xe8fd('0x57')][_0xe8fd('0x119')](db[_0xe8fd('0x77')],{'as':_0xe8fd('0x17d'),'foreignKey':_0xe8fd('0x18a'),'onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x57')][_0xe8fd('0x119')](db['CannedAnswer'],{'as':_0xe8fd('0x16a'),'foreignKey':_0xe8fd('0x18a')});db[_0xe8fd('0x57')][_0xe8fd('0x119')](db['OpenchannelInteraction'],{'as':_0xe8fd('0x17f'),'foreignKey':_0xe8fd('0x18a')});db['OpenchannelAccount']['hasMany'](db['OpenchannelMessage'],{'as':_0xe8fd('0x15d'),'foreignKey':_0xe8fd('0x18a')});db[_0xe8fd('0x57')][_0xe8fd('0x119')](db[_0xe8fd('0x59')],{'as':_0xe8fd('0x14c'),'foreignKey':_0xe8fd('0x18a')});db[_0xe8fd('0x57')][_0xe8fd('0x155')](db[_0xe8fd('0xf8')],{'as':'List','foreignKey':_0xe8fd('0x16b')});db[_0xe8fd('0x57')][_0xe8fd('0x155')](db[_0xe8fd('0x7b')],{'as':_0xe8fd('0x15a'),'foreignKey':_0xe8fd('0x15b')});db[_0xe8fd('0x57')][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x16e'),'through':_0xe8fd('0x18b')});db[_0xe8fd('0x59')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'onDelete':'restrict'});db[_0xe8fd('0x59')][_0xe8fd('0x155')](db[_0xe8fd('0x18c')],{'onDelete':_0xe8fd('0x168'),'foreignKey':_0xe8fd('0x18d')});db[_0xe8fd('0x59')][_0xe8fd('0x155')](db[_0xe8fd('0x57')],{'onDelete':_0xe8fd('0x168'),'foreignKey':_0xe8fd('0x18a')});db[_0xe8fd('0x59')][_0xe8fd('0x155')](db[_0xe8fd('0x158')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['OpenchannelApplication'][_0xe8fd('0x155')](db['Tag'],{'onDelete':_0xe8fd('0x168'),'foreignKey':_0xe8fd('0x179')});db['OpenchannelInteraction'][_0xe8fd('0x119')](db[_0xe8fd('0x5c')],{'as':_0xe8fd('0x15d'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x18e')});db[_0xe8fd('0x5b')][_0xe8fd('0x155')](db[_0xe8fd('0x57')],{'as':'Account','foreignKey':_0xe8fd('0x18a')});db['OpenchannelInteraction'][_0xe8fd('0x155')](db[_0xe8fd('0x12c')],{'as':_0xe8fd('0x162'),'foreignKey':'ContactId'});db[_0xe8fd('0x5b')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x172'),'foreignKey':_0xe8fd('0x116')});db[_0xe8fd('0x5b')][_0xe8fd('0x129')](db[_0xe8fd('0x82')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0xe8fd('0x5b')]['belongsToMany'](db[_0xe8fd('0x82')],{'through':_0xe8fd('0x18f'),'as':_0xe8fd('0x174')});db[_0xe8fd('0x5b')][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':'Users','through':_0xe8fd('0x190'),'foreignKey':_0xe8fd('0x18e')});db[_0xe8fd('0x5c')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'onDelete':_0xe8fd('0x115'),'as':_0xe8fd('0x114')});db[_0xe8fd('0x5c')][_0xe8fd('0x155')](db[_0xe8fd('0x12c')],{'onDelete':_0xe8fd('0x115'),'as':_0xe8fd('0x162')});db[_0xe8fd('0x5c')][_0xe8fd('0x155')](db[_0xe8fd('0x5b')],{'onDelete':_0xe8fd('0x115'),'as':_0xe8fd('0x183'),'foreignKey':_0xe8fd('0x18e')});db['OpenchannelMessage'][_0xe8fd('0x155')](db[_0xe8fd('0xec')],{'as':_0xe8fd('0xec'),'foreignKey':_0xe8fd('0x184')});db[_0xe8fd('0x5c')][_0xe8fd('0x155')](db[_0xe8fd('0x57')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xe8fd('0x18c')][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x16e'),'through':_0xe8fd('0x36'),'foreignKey':_0xe8fd('0x18d')});db[_0xe8fd('0x18c')][_0xe8fd('0x129')](db[_0xe8fd('0xe5')],{'through':_0xe8fd('0x191'),'as':_0xe8fd('0x16f')});db[_0xe8fd('0x5f')][_0xe8fd('0x119')](db[_0xe8fd('0x77')],{'as':_0xe8fd('0x17d'),'foreignKey':'ChatWebsiteId','onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x5f')][_0xe8fd('0x119')](db[_0xe8fd('0x76')],{'as':_0xe8fd('0x16a'),'foreignKey':_0xe8fd('0x192')});db['ChatWebsite'][_0xe8fd('0x119')](db[_0xe8fd('0x193')],{'as':_0xe8fd('0x194')});db[_0xe8fd('0x5f')][_0xe8fd('0x119')](db[_0xe8fd('0x11f')],{'as':'Interactions'});db[_0xe8fd('0x5f')]['hasMany'](db['ChatApplication'],{'as':_0xe8fd('0x14c')});db[_0xe8fd('0x5f')]['hasMany'](db[_0xe8fd('0x195')],{'as':_0xe8fd('0x15d')});db['ChatWebsite'][_0xe8fd('0x155')](db[_0xe8fd('0xf8')],{'as':_0xe8fd('0x17b'),'foreignKey':'ListId'});db[_0xe8fd('0x5f')][_0xe8fd('0x155')](db[_0xe8fd('0x158')],{'as':_0xe8fd('0x158'),'foreignKey':_0xe8fd('0x159')});db[_0xe8fd('0x5f')]['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xe8fd('0x165')});db[_0xe8fd('0x5f')][_0xe8fd('0x155')](db[_0xe8fd('0x7b')],{'as':_0xe8fd('0x15a'),'foreignKey':_0xe8fd('0x15b')});db['ChatWebsite']['belongsToMany'](db['User'],{'as':_0xe8fd('0x16e'),'through':_0xe8fd('0x13e')});db['OpenchannelQueueReport'][_0xe8fd('0x155')](db[_0xe8fd('0x57')],{});db[_0xe8fd('0x61')][_0xe8fd('0x155')](db[_0xe8fd('0xf8')],{'as':_0xe8fd('0x17b'),'foreignKey':_0xe8fd('0x16b')});db[_0xe8fd('0x61')][_0xe8fd('0x155')](db[_0xe8fd('0x12c')],{'as':_0xe8fd('0x162'),'foreignKey':'ContactId'});db[_0xe8fd('0x61')][_0xe8fd('0x155')](db[_0xe8fd('0x5b')],{});db[_0xe8fd('0x61')][_0xe8fd('0x155')](db[_0xe8fd('0x5c')],{});db[_0xe8fd('0x61')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{});db['OpenchannelQueueReport'][_0xe8fd('0x155')](db['OpenchannelQueue'],{});db[_0xe8fd('0x196')]['belongsTo'](db[_0xe8fd('0x114')],{'as':'Agent','foreignKey':'UserId','onDelete':'restrict'});db['ChatApplication'][_0xe8fd('0x155')](db['ChatQueue'],{'as':_0xe8fd('0x197'),'foreignKey':_0xe8fd('0x198'),'onDelete':_0xe8fd('0x168')});db['ChatApplication'][_0xe8fd('0x155')](db[_0xe8fd('0x5f')],{'as':_0xe8fd('0x199'),'foreignKey':_0xe8fd('0x192'),'onDelete':'restrict'});db[_0xe8fd('0x196')][_0xe8fd('0x155')](db[_0xe8fd('0x82')],{'onDelete':'restrict','foreignKey':'TagId'});db['ChatInteraction'][_0xe8fd('0x119')](db[_0xe8fd('0x195')],{'as':_0xe8fd('0x15d'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x19a')});db['ChatInteraction']['belongsTo'](db[_0xe8fd('0x5f')],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x192')});db[_0xe8fd('0x11f')][_0xe8fd('0x155')](db[_0xe8fd('0x12c')],{'as':_0xe8fd('0x162'),'foreignKey':'ContactId'});db['ChatInteraction'][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'as':'Owner','foreignKey':_0xe8fd('0x116')});db['ChatInteraction'][_0xe8fd('0x129')](db[_0xe8fd('0x82')],{'through':_0xe8fd('0x19b'),'as':_0xe8fd('0x19c')});db[_0xe8fd('0x11f')][_0xe8fd('0x129')](db['Tag'],{'through':_0xe8fd('0x19b'),'as':_0xe8fd('0x174')});db[_0xe8fd('0x11f')][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x175'),'through':_0xe8fd('0x19d'),'foreignKey':_0xe8fd('0x19a')});db[_0xe8fd('0x195')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'onDelete':_0xe8fd('0x115'),'as':'User'});db[_0xe8fd('0x195')][_0xe8fd('0x155')](db[_0xe8fd('0x12c')],{'onDelete':_0xe8fd('0x115'),'as':_0xe8fd('0x162'),'foreignKey':_0xe8fd('0x163')});db['ChatMessage'][_0xe8fd('0x155')](db['ChatInteraction'],{'onDelete':_0xe8fd('0x115'),'as':'Interaction','foreignKey':_0xe8fd('0x19a')});db['ChatMessage'][_0xe8fd('0x155')](db[_0xe8fd('0xec')],{'as':_0xe8fd('0xec'),'foreignKey':_0xe8fd('0x184')});db['ChatMessage'][_0xe8fd('0x155')](db[_0xe8fd('0x5f')],{'as':'Account','foreignKey':_0xe8fd('0x192')});db[_0xe8fd('0x64')]['hasMany'](db['Attachment'],{'as':_0xe8fd('0x177'),'foreignKey':_0xe8fd('0x19e'),'onDelete':_0xe8fd('0x115'),'hooks':!![]});db['ChatOfflineMessage'][_0xe8fd('0x155')](db[_0xe8fd('0x12c')],{'onDelete':_0xe8fd('0x115'),'as':'Contact','foreignKey':_0xe8fd('0x163')});db['ChatOfflineMessage'][_0xe8fd('0x155')](db['ChatWebsite'],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x192')});db['ChatQueue']['belongsToMany'](db['User'],{'as':_0xe8fd('0x16e'),'through':_0xe8fd('0x2f'),'hooks':!![]});db[_0xe8fd('0x19f')][_0xe8fd('0x129')](db[_0xe8fd('0xe5')],{'through':_0xe8fd('0x1a0'),'as':_0xe8fd('0x16f')});db[_0xe8fd('0x12a')][_0xe8fd('0x119')](db[_0xe8fd('0xce')],{'as':_0xe8fd('0x15d'),'foreignKey':_0xe8fd('0x1a1'),'onDelete':_0xe8fd('0x115')});db['ChatGroup'][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x14f'),'through':'chat_group_has_users'});db[_0xe8fd('0x193')][_0xe8fd('0x155')](db[_0xe8fd('0x5f')],{'as':'Website','foreignKey':'ChatWebsiteId'});db[_0xe8fd('0x68')][_0xe8fd('0x119')](db[_0xe8fd('0x12c')],{'as':_0xe8fd('0x12d'),'foreignKey':'CompanyId'});db[_0xe8fd('0x12c')][_0xe8fd('0x119')](db[_0xe8fd('0x86')],{'as':_0xe8fd('0x1a2'),'foreignKey':_0xe8fd('0x1a3')});db['CmContact']['hasMany'](db[_0xe8fd('0x6b')],{'as':_0xe8fd('0x151'),'foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0x12c')][_0xe8fd('0x119')](db[_0xe8fd('0x6d')],{'as':_0xe8fd('0x1a4'),'foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0x12c')][_0xe8fd('0x119')](db[_0xe8fd('0x6f')],{'as':'HopperHistories','foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0x12c')][_0xe8fd('0x119')](db[_0xe8fd('0x70')],{'as':_0xe8fd('0x70'),'foreignKey':_0xe8fd('0x163')});db['CmContact'][_0xe8fd('0x119')](db['JscriptySessionReport'],{'as':_0xe8fd('0x154'),'foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0x12c')][_0xe8fd('0x119')](db['OpenchannelInteraction'],{'as':_0xe8fd('0x11e'),'foreignKey':_0xe8fd('0x163'),'onDelete':_0xe8fd('0x168')});db['CmContact'][_0xe8fd('0x119')](db[_0xe8fd('0x11f')],{'as':_0xe8fd('0x120'),'foreignKey':_0xe8fd('0x163'),'onDelete':'restrict'});db[_0xe8fd('0x12c')]['hasMany'](db['SmsInteraction'],{'as':_0xe8fd('0x132'),'foreignKey':_0xe8fd('0x163'),'onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x12c')][_0xe8fd('0x119')](db[_0xe8fd('0x121')],{'as':_0xe8fd('0x122'),'foreignKey':'ContactId','onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x12c')]['hasMany'](db[_0xe8fd('0x40')],{'as':_0xe8fd('0x123'),'foreignKey':'ContactId','onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x12c')][_0xe8fd('0x155')](db[_0xe8fd('0x68')],{'as':_0xe8fd('0x1a5'),'foreignKey':_0xe8fd('0x1a6')});db[_0xe8fd('0x12c')][_0xe8fd('0x155')](db['CmList'],{'as':_0xe8fd('0x17b'),'foreignKey':_0xe8fd('0x16b'),'onDelete':_0xe8fd('0x115')});db['CmContact'][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':'Users','through':_0xe8fd('0x12e')});db[_0xe8fd('0x12c')][_0xe8fd('0x129')](db[_0xe8fd('0x82')],{'as':_0xe8fd('0x19c'),'through':_0xe8fd('0x1a7')});db[_0xe8fd('0x12c')]['belongsToMany'](db[_0xe8fd('0x82')],{'through':_0xe8fd('0x1a7'),'as':'ThroughTags'});db[_0xe8fd('0x6b')][_0xe8fd('0x119')](db[_0xe8fd('0x1a8')],{'as':'AdditionalPhones','foreignKey':_0xe8fd('0x1a9')});db[_0xe8fd('0x6b')]['belongsTo'](db[_0xe8fd('0x12c')],{'as':'Contact','foreignKey':_0xe8fd('0x163'),'onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x6b')][_0xe8fd('0x155')](db[_0xe8fd('0xf8')],{'as':_0xe8fd('0x17b'),'foreignKey':_0xe8fd('0x16b'),'onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x6b')][_0xe8fd('0x155')](db['User'],{'as':_0xe8fd('0x1aa'),'foreignKey':_0xe8fd('0x116')});db[_0xe8fd('0x6b')][_0xe8fd('0x155')](db['VoiceQueue'],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0xe8fd('0x115')});db['CmHopper']['belongsTo'](db[_0xe8fd('0x1ab')],{'as':'Campaign','foreignKey':_0xe8fd('0x1ac'),'onDelete':'cascade'});db['CmHopper'][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x172'),'foreignKey':'OwnerId'});db[_0xe8fd('0x1ad')][_0xe8fd('0x155')](db[_0xe8fd('0x12c')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x1ad')]['belongsTo'](db[_0xe8fd('0xf8')],{'as':'List','foreignKey':_0xe8fd('0x16b'),'onDelete':'cascade'});db[_0xe8fd('0x1ad')]['belongsTo'](db[_0xe8fd('0x17')],{'as':_0xe8fd('0x197'),'foreignKey':_0xe8fd('0x150'),'onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x1ad')][_0xe8fd('0x155')](db['Campaign'],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x74')]['hasMany'](db[_0xe8fd('0x78')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0xe8fd('0x1ae'),'onDelete':_0xe8fd('0x115'),'hooks':!![]});db[_0xe8fd('0x74')][_0xe8fd('0x119')](db[_0xe8fd('0x78')],{'as':{'plural':'Any','singular':_0xe8fd('0x1af')},'foreignKey':_0xe8fd('0x1b0'),'onDelete':_0xe8fd('0x115'),'hooks':!![]});db[_0xe8fd('0x74')][_0xe8fd('0x119')](db[_0xe8fd('0x72')],{'as':_0xe8fd('0x1b1'),'foreignKey':_0xe8fd('0x1b2'),'onDelete':_0xe8fd('0x115'),'hooks':!![]});db[_0xe8fd('0x77')][_0xe8fd('0x119')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xe8fd('0x1b3'),'onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x158')][_0xe8fd('0x119')](db[_0xe8fd('0x158')],{'as':_0xe8fd('0x1b4'),'foreignKey':_0xe8fd('0x159'),'onDelete':_0xe8fd('0x115'),'hooks':!![],'required':![]});db[_0xe8fd('0x158')][_0xe8fd('0x119')](db['VoiceExtension'],{'as':_0xe8fd('0x11c'),'foreignKey':_0xe8fd('0x159'),'onDelete':'restrict'});db['Interval'][_0xe8fd('0x119')](db[_0xe8fd('0x178')],{'as':'MailApplications','foreignKey':_0xe8fd('0x159')});db[_0xe8fd('0x158')][_0xe8fd('0x119')](db['ChatApplication'],{'as':_0xe8fd('0x1b5'),'foreignKey':_0xe8fd('0x159')});db[_0xe8fd('0x158')]['hasMany'](db[_0xe8fd('0x49')],{'as':_0xe8fd('0x1b6'),'foreignKey':_0xe8fd('0x159')});db[_0xe8fd('0x158')][_0xe8fd('0x119')](db[_0xe8fd('0x186')],{'as':_0xe8fd('0x1b7'),'foreignKey':_0xe8fd('0x159')});db[_0xe8fd('0x7f')][_0xe8fd('0x155')](db[_0xe8fd('0x3c')],{});db[_0xe8fd('0x7f')][_0xe8fd('0x155')](db[_0xe8fd('0x93')],{'foreignKey':_0xe8fd('0x1b8')});db['Schedule'][_0xe8fd('0x155')](db['AnalyticCustomReport'],{'foreignKey':_0xe8fd('0x1b9')});db[_0xe8fd('0x81')]['belongsToMany'](db[_0xe8fd('0x14d')],{'as':_0xe8fd('0x1ba'),'through':_0xe8fd('0x14e'),'onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x82')]['belongsToMany'](db[_0xe8fd('0x12c')],{'through':_0xe8fd('0x1a7')});db[_0xe8fd('0x82')][_0xe8fd('0x129')](db[_0xe8fd('0x11f')],{'through':'chat_interaction_has_tags'});db[_0xe8fd('0x82')][_0xe8fd('0x129')](db[_0xe8fd('0x40')],{'through':_0xe8fd('0x173')});db[_0xe8fd('0x82')][_0xe8fd('0x129')](db['SmsInteraction'],{'through':_0xe8fd('0x188')});db['Tag'][_0xe8fd('0x129')](db[_0xe8fd('0x121')],{'through':_0xe8fd('0x182')});db['Tag'][_0xe8fd('0x129')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0xe8fd('0x82')][_0xe8fd('0x129')](db[_0xe8fd('0x102')],{'through':_0xe8fd('0x1bb')});db[_0xe8fd('0x86')][_0xe8fd('0x155')](db[_0xe8fd('0x84')],{'as':_0xe8fd('0x1bc'),'foreignKey':'ItemTypeId'});db[_0xe8fd('0x1a8')][_0xe8fd('0x155')](db[_0xe8fd('0x6b')],{'as':_0xe8fd('0x1bd'),'foreignKey':_0xe8fd('0x1a9')});db[_0xe8fd('0x86')]['belongsTo'](db[_0xe8fd('0x12c')],{'as':_0xe8fd('0x162'),'foreignKey':'CmContactId'});db[_0xe8fd('0x8a')][_0xe8fd('0x119')](db[_0xe8fd('0x78')],{'as':{'plural':_0xe8fd('0x1be'),'singular':_0xe8fd('0x1bf')},'foreignKey':_0xe8fd('0x1c0'),'onDelete':'cascade','hooks':!![]});db[_0xe8fd('0x8a')][_0xe8fd('0x119')](db[_0xe8fd('0x78')],{'as':{'plural':_0xe8fd('0x1c1'),'singular':_0xe8fd('0x1c2')},'foreignKey':_0xe8fd('0x1c3'),'onDelete':_0xe8fd('0x115'),'hooks':!![]});db[_0xe8fd('0x8a')][_0xe8fd('0x119')](db[_0xe8fd('0x72')],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xe8fd('0x115'),'hooks':!![]});db[_0xe8fd('0x92')][_0xe8fd('0x119')](db[_0xe8fd('0x98')],{'as':_0xe8fd('0x1c4'),'onDelete':'cascade','foreignKey':_0xe8fd('0x1b9'),'hooks':!![]});db[_0xe8fd('0x93')][_0xe8fd('0x119')](db['AnalyticFieldReport'],{'as':_0xe8fd('0x1c4'),'onDelete':'cascade','foreignKey':_0xe8fd('0x1b8')});db[_0xe8fd('0x96')][_0xe8fd('0x119')](db[_0xe8fd('0x98')],{'as':_0xe8fd('0x1c4'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1c5')});db[_0xe8fd('0x98')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0xe8fd('0x9c')][_0xe8fd('0x119')](db['SalesforceConfiguration'],{'as':_0xe8fd('0x1c6'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0x9e')][_0xe8fd('0x119')](db[_0xe8fd('0x1c8')],{'as':_0xe8fd('0x1c9'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1ca')});db[_0xe8fd('0x9e')][_0xe8fd('0x119')](db[_0xe8fd('0x1c8')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xe8fd('0x119')](db[_0xe8fd('0x1c8')],{'as':_0xe8fd('0x1c4'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1cb')});db[_0xe8fd('0x9e')][_0xe8fd('0x155')](db[_0xe8fd('0x9c')],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0x1c8')][_0xe8fd('0x119')](db[_0xe8fd('0x1c8')],{'as':_0xe8fd('0x1cc'),'foreignKey':_0xe8fd('0x1ca')});db[_0xe8fd('0x1c8')][_0xe8fd('0x119')](db[_0xe8fd('0x1c8')],{'as':_0xe8fd('0x1cd'),'foreignKey':'DescriptionId'});db[_0xe8fd('0x1c8')][_0xe8fd('0x119')](db[_0xe8fd('0x1c8')],{'as':_0xe8fd('0x1ce'),'foreignKey':_0xe8fd('0x1cb')});db[_0xe8fd('0x1c8')]['belongsTo'](db[_0xe8fd('0x8c')],{'as':_0xe8fd('0x8c'),'foreignKey':_0xe8fd('0x1cf')});db[_0xe8fd('0xa0')][_0xe8fd('0x119')](db['SugarcrmConfiguration'],{'as':_0xe8fd('0x1c6'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xe8fd('0xa2')][_0xe8fd('0x119')](db[_0xe8fd('0xa4')],{'as':_0xe8fd('0x1c9'),'onDelete':_0xe8fd('0x115'),'foreignKey':'SubjectId'});db[_0xe8fd('0xa2')][_0xe8fd('0x119')](db[_0xe8fd('0xa4')],{'as':_0xe8fd('0x1d0'),'onDelete':'cascade','foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0xa2')][_0xe8fd('0x119')](db[_0xe8fd('0xa4')],{'as':'Fields','onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1cb')});db[_0xe8fd('0xa2')][_0xe8fd('0x155')](db[_0xe8fd('0xa0')],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0xa4')]['hasMany'](db[_0xe8fd('0xa4')],{'as':_0xe8fd('0x1cc'),'foreignKey':_0xe8fd('0x1ca')});db[_0xe8fd('0xa4')][_0xe8fd('0x119')](db[_0xe8fd('0xa4')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xe8fd('0xa4')][_0xe8fd('0x119')](db['SugarcrmField'],{'as':_0xe8fd('0x1ce'),'foreignKey':_0xe8fd('0x1cb')});db[_0xe8fd('0xa4')]['belongsTo'](db['Variable'],{'as':_0xe8fd('0x8c'),'foreignKey':'VariableId'});db[_0xe8fd('0xa6')]['hasMany'](db[_0xe8fd('0xa8')],{'as':_0xe8fd('0x1c6'),'onDelete':'cascade','foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0xa8')][_0xe8fd('0x119')](db[_0xe8fd('0xaa')],{'as':_0xe8fd('0x1c9'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1ca')});db[_0xe8fd('0xa8')][_0xe8fd('0x119')](db['DeskField'],{'as':'Descriptions','onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0xa8')][_0xe8fd('0x119')](db[_0xe8fd('0xaa')],{'as':'Fields','onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1cb')});db['DeskConfiguration'][_0xe8fd('0x155')](db[_0xe8fd('0xa6')],{'as':'Account','foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0xa8')][_0xe8fd('0x129')](db[_0xe8fd('0x82')],{'through':_0xe8fd('0x1d2')});db[_0xe8fd('0xaa')]['hasMany'](db[_0xe8fd('0xaa')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xe8fd('0xaa')][_0xe8fd('0x119')](db[_0xe8fd('0xaa')],{'as':_0xe8fd('0x1cd'),'foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0xaa')][_0xe8fd('0x119')](db['DeskField'],{'as':'Field','foreignKey':_0xe8fd('0x1cb')});db[_0xe8fd('0xaa')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xe8fd('0x1cf')});db[_0xe8fd('0x1d3')][_0xe8fd('0x119')](db[_0xe8fd('0xad')],{'as':_0xe8fd('0x1c6'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1c7')});db['ZohoConfiguration'][_0xe8fd('0x119')](db[_0xe8fd('0xae')],{'as':_0xe8fd('0x1c9'),'onDelete':'cascade','foreignKey':_0xe8fd('0x1ca')});db[_0xe8fd('0xad')][_0xe8fd('0x119')](db[_0xe8fd('0xae')],{'as':_0xe8fd('0x1d0'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0xad')][_0xe8fd('0x119')](db[_0xe8fd('0xae')],{'as':_0xe8fd('0x1c4'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1cb')});db['ZohoConfiguration'][_0xe8fd('0x155')](db[_0xe8fd('0x1d3')],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0xae')][_0xe8fd('0x119')](db[_0xe8fd('0xae')],{'as':_0xe8fd('0x1cc'),'foreignKey':_0xe8fd('0x1ca')});db[_0xe8fd('0xae')][_0xe8fd('0x119')](db[_0xe8fd('0xae')],{'as':'Description','foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0xae')][_0xe8fd('0x119')](db['ZohoField'],{'as':_0xe8fd('0x1ce'),'foreignKey':_0xe8fd('0x1cb')});db[_0xe8fd('0xae')][_0xe8fd('0x155')](db[_0xe8fd('0x8c')],{'as':_0xe8fd('0x8c'),'foreignKey':_0xe8fd('0x1cf')});db[_0xe8fd('0xb0')][_0xe8fd('0x119')](db[_0xe8fd('0xb1')],{'as':_0xe8fd('0x1c6'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1c7')});db['ZendeskConfiguration'][_0xe8fd('0x119')](db[_0xe8fd('0x1d4')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xe8fd('0xb1')][_0xe8fd('0x119')](db[_0xe8fd('0x1d4')],{'as':_0xe8fd('0x1d0'),'foreignKey':'DescriptionId'});db[_0xe8fd('0xb1')][_0xe8fd('0x119')](db[_0xe8fd('0x1d4')],{'as':_0xe8fd('0x1c4'),'foreignKey':_0xe8fd('0x1cb')});db['ZendeskConfiguration'][_0xe8fd('0x155')](db[_0xe8fd('0xb0')],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0xb1')][_0xe8fd('0x129')](db[_0xe8fd('0x82')],{'through':_0xe8fd('0x1d5')});db[_0xe8fd('0x1d4')][_0xe8fd('0x119')](db[_0xe8fd('0x1d4')],{'as':_0xe8fd('0x1cc'),'foreignKey':_0xe8fd('0x1ca')});db['ZendeskField'][_0xe8fd('0x119')](db[_0xe8fd('0x1d4')],{'as':_0xe8fd('0x1cd'),'foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0x1d4')]['hasMany'](db[_0xe8fd('0x1d4')],{'as':_0xe8fd('0x1ce'),'foreignKey':'FieldId'});db[_0xe8fd('0x1d4')][_0xe8fd('0x155')](db[_0xe8fd('0x8c')],{'as':'Variable','foreignKey':_0xe8fd('0x1cf')});db['FreshdeskAccount'][_0xe8fd('0x119')](db[_0xe8fd('0xb6')],{'as':'Configurations','onDelete':_0xe8fd('0x115'),'foreignKey':'AccountId'});db[_0xe8fd('0xb6')]['hasMany'](db[_0xe8fd('0xb8')],{'as':_0xe8fd('0x1c9'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1ca')});db[_0xe8fd('0xb6')][_0xe8fd('0x119')](db[_0xe8fd('0xb8')],{'as':_0xe8fd('0x1d0'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0xb6')][_0xe8fd('0x119')](db[_0xe8fd('0xb8')],{'as':'Fields','onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1cb')});db[_0xe8fd('0xb6')][_0xe8fd('0x155')](db[_0xe8fd('0xb4')],{'as':'Account','foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0xb6')][_0xe8fd('0x129')](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db[_0xe8fd('0xb8')][_0xe8fd('0x119')](db['FreshdeskField'],{'as':_0xe8fd('0x1cc'),'foreignKey':'SubjectId'});db[_0xe8fd('0xb8')]['hasMany'](db[_0xe8fd('0xb8')],{'as':_0xe8fd('0x1cd'),'foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0xb8')][_0xe8fd('0x119')](db[_0xe8fd('0xb8')],{'as':_0xe8fd('0x1ce'),'foreignKey':_0xe8fd('0x1cb')});db['FreshdeskField'][_0xe8fd('0x155')](db[_0xe8fd('0x8c')],{'as':_0xe8fd('0x8c'),'foreignKey':_0xe8fd('0x1cf')});db['VtigerAccount'][_0xe8fd('0x119')](db[_0xe8fd('0xbc')],{'as':_0xe8fd('0x1c6'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0xbc')][_0xe8fd('0x119')](db[_0xe8fd('0xbe')],{'as':_0xe8fd('0x1c9'),'foreignKey':_0xe8fd('0x1ca')});db[_0xe8fd('0xbc')]['hasMany'](db[_0xe8fd('0xbe')],{'as':'Descriptions','foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0xbc')]['hasMany'](db[_0xe8fd('0xbe')],{'as':_0xe8fd('0x1c4'),'foreignKey':_0xe8fd('0x1cb')});db[_0xe8fd('0xbc')][_0xe8fd('0x155')](db[_0xe8fd('0xba')],{'as':'Account','foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0xbe')]['hasMany'](db['VtigerField'],{'as':_0xe8fd('0x1cc'),'foreignKey':_0xe8fd('0x1ca')});db['VtigerField'][_0xe8fd('0x119')](db[_0xe8fd('0xbe')],{'as':_0xe8fd('0x1cd'),'foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0xbe')][_0xe8fd('0x119')](db[_0xe8fd('0xbe')],{'as':'Field','foreignKey':'FieldId'});db[_0xe8fd('0xbe')][_0xe8fd('0x155')](db['Variable'],{'as':_0xe8fd('0x8c'),'foreignKey':_0xe8fd('0x1cf')});db[_0xe8fd('0xc0')][_0xe8fd('0x119')](db[_0xe8fd('0x1d6')],{'as':'Configurations','onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1c7')});db['ServicenowConfiguration'][_0xe8fd('0x119')](db[_0xe8fd('0x1d7')],{'as':'Subjects','foreignKey':'SubjectId'});db['ServicenowConfiguration']['hasMany'](db[_0xe8fd('0x1d7')],{'as':'Descriptions','foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0x1d6')][_0xe8fd('0x119')](db[_0xe8fd('0x1d7')],{'as':_0xe8fd('0x1c4'),'foreignKey':_0xe8fd('0x1cb')});db[_0xe8fd('0x1d6')][_0xe8fd('0x155')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0x1d7')][_0xe8fd('0x119')](db[_0xe8fd('0x1d7')],{'as':_0xe8fd('0x1cc'),'foreignKey':_0xe8fd('0x1ca')});db[_0xe8fd('0x1d7')][_0xe8fd('0x119')](db['ServicenowField'],{'as':'Description','foreignKey':_0xe8fd('0x1d1')});db['ServicenowField'][_0xe8fd('0x119')](db[_0xe8fd('0x1d7')],{'as':_0xe8fd('0x1ce'),'foreignKey':_0xe8fd('0x1cb')});db[_0xe8fd('0x1d7')][_0xe8fd('0x155')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0xe8fd('0x1d8')][_0xe8fd('0x119')](db[_0xe8fd('0x1d9')],{'as':_0xe8fd('0x1c6'),'onDelete':'cascade','foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0x1d8')][_0xe8fd('0x155')](db[_0xe8fd('0x166')],{'as':_0xe8fd('0x166'),'foreignKey':'CloudProviderId'});db[_0xe8fd('0x1d9')][_0xe8fd('0x119')](db[_0xe8fd('0xc6')],{'as':_0xe8fd('0x1c9'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1ca')});db['Dynamics365Configuration'][_0xe8fd('0x119')](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0x1d9')][_0xe8fd('0x119')](db[_0xe8fd('0xc6')],{'as':_0xe8fd('0x1c4'),'onDelete':_0xe8fd('0x115'),'foreignKey':'FieldId'});db[_0xe8fd('0x1d9')][_0xe8fd('0x155')](db[_0xe8fd('0x1d8')],{'as':'Account','foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0xc6')][_0xe8fd('0x119')](db[_0xe8fd('0xc6')],{'as':_0xe8fd('0x1cc'),'foreignKey':_0xe8fd('0x1ca')});db[_0xe8fd('0xc6')][_0xe8fd('0x119')](db[_0xe8fd('0xc6')],{'as':_0xe8fd('0x1cd'),'foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0xc6')]['hasMany'](db['Dynamics365Field'],{'as':_0xe8fd('0x1ce'),'foreignKey':_0xe8fd('0x1cb')});db[_0xe8fd('0xc6')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xe8fd('0x1cf')});db[_0xe8fd('0xc7')][_0xe8fd('0x119')](db['FreshsalesConfiguration'],{'as':_0xe8fd('0x1c6'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xe8fd('0x1da')][_0xe8fd('0x119')](db[_0xe8fd('0x1db')],{'as':_0xe8fd('0x1c9'),'foreignKey':_0xe8fd('0x1ca')});db['FreshsalesConfiguration'][_0xe8fd('0x119')](db[_0xe8fd('0x1db')],{'as':_0xe8fd('0x1d0'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0xe8fd('0x119')](db['FreshsalesField'],{'as':'Fields','foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0xe8fd('0x155')](db[_0xe8fd('0xc7')],{'as':'Account','foreignKey':_0xe8fd('0x1c7')});db[_0xe8fd('0x1db')]['hasMany'](db['FreshsalesField'],{'as':_0xe8fd('0x1cc'),'foreignKey':'SubjectId'});db[_0xe8fd('0x1db')][_0xe8fd('0x119')](db['FreshsalesField'],{'as':_0xe8fd('0x1cd'),'foreignKey':_0xe8fd('0x1d1')});db[_0xe8fd('0x1db')]['hasMany'](db[_0xe8fd('0x1db')],{'as':_0xe8fd('0x1ce'),'foreignKey':'FieldId'});db['FreshsalesField'][_0xe8fd('0x155')](db[_0xe8fd('0x8c')],{'as':_0xe8fd('0x8c'),'foreignKey':'VariableId'});db[_0xe8fd('0x1dc')]['belongsTo'](db[_0xe8fd('0x5f')],{});db[_0xe8fd('0x1dc')][_0xe8fd('0x155')](db[_0xe8fd('0xf8')],{'as':_0xe8fd('0x17b'),'foreignKey':'ListId'});db[_0xe8fd('0x1dc')][_0xe8fd('0x155')](db['CmContact'],{'as':_0xe8fd('0x162'),'foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0x1dc')][_0xe8fd('0x155')](db['ChatInteraction'],{});db[_0xe8fd('0x1dc')][_0xe8fd('0x155')](db['ChatMessage'],{});db['ChatQueueReport'][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{});db[_0xe8fd('0x1dc')][_0xe8fd('0x155')](db[_0xe8fd('0x19f')],{});db[_0xe8fd('0xce')]['belongsTo'](db[_0xe8fd('0x114')],{'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x1dd')});db[_0xe8fd('0xce')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'onDelete':'cascade','foreignKey':_0xe8fd('0x1de')});db[_0xe8fd('0xd3')][_0xe8fd('0x119')](db[_0xe8fd('0x1df')],{'foreignKey':_0xe8fd('0x1e0'),'onDelete':'cascade'});db[_0xe8fd('0xd3')]['hasMany'](db[_0xe8fd('0xd0')],{'foreignKey':_0xe8fd('0x1e0'),'onDelete':_0xe8fd('0x115')});db['SmsQueueReport'][_0xe8fd('0x155')](db['SmsAccount'],{});db['SmsQueueReport'][_0xe8fd('0x155')](db[_0xe8fd('0xf8')],{'as':_0xe8fd('0x17b'),'foreignKey':_0xe8fd('0x16b')});db[_0xe8fd('0xd5')]['belongsTo'](db['CmContact'],{'as':_0xe8fd('0x162'),'foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0xd5')][_0xe8fd('0x155')](db[_0xe8fd('0x53')],{});db[_0xe8fd('0xd5')]['belongsTo'](db[_0xe8fd('0x54')],{});db['SmsQueueReport'][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{});db[_0xe8fd('0xd5')][_0xe8fd('0x155')](db[_0xe8fd('0x56')],{});db[_0xe8fd('0x1e1')][_0xe8fd('0x119')](db[_0xe8fd('0xd3')],{'foreignKey':_0xe8fd('0x1e2')});db['JscriptyProject'][_0xe8fd('0x119')](db['JscriptyQuestionReport'],{'foreignKey':_0xe8fd('0x1e2')});db['JscriptyProject'][_0xe8fd('0x119')](db[_0xe8fd('0xd0')],{'foreignKey':_0xe8fd('0x1e2')});db['SquareProject']['belongsToMany'](db['User'],{'as':_0xe8fd('0x175'),'through':_0xe8fd('0x148')});db[_0xe8fd('0xe5')][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x16e'),'through':_0xe8fd('0x131')});db['Team'][_0xe8fd('0x129')](db[_0xe8fd('0x17')],{'through':_0xe8fd('0x10c'),'as':'VoiceQueues'});db[_0xe8fd('0xe5')][_0xe8fd('0x129')](db['MailQueue'],{'through':_0xe8fd('0x1e3'),'as':_0xe8fd('0x1e4')});db['Team'][_0xe8fd('0x129')](db[_0xe8fd('0x19f')],{'through':'team_has_chat_queues','as':_0xe8fd('0x1e5')});db[_0xe8fd('0xe5')][_0xe8fd('0x129')](db[_0xe8fd('0x4e')],{'through':'team_has_fax_queues','as':_0xe8fd('0x139')});db['Team'][_0xe8fd('0x129')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0xe8fd('0x13a')});db[_0xe8fd('0xe5')]['belongsToMany'](db[_0xe8fd('0x18c')],{'through':_0xe8fd('0x191'),'as':'OpenchannelQueues'});db[_0xe8fd('0xe5')][_0xe8fd('0x129')](db[_0xe8fd('0x109')],{'through':_0xe8fd('0x1e6'),'as':_0xe8fd('0x13c')});db[_0xe8fd('0xe5')][_0xe8fd('0x129')](db[_0xe8fd('0x136')],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db[_0xe8fd('0x1ab')][_0xe8fd('0x119')](db[_0xe8fd('0x6b')],{'as':_0xe8fd('0x151'),'foreignKey':_0xe8fd('0x1ac')});db[_0xe8fd('0x1ab')]['hasMany'](db[_0xe8fd('0x6d')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0xe8fd('0x1ab')][_0xe8fd('0x119')](db['CmHopperHistory'],{'as':_0xe8fd('0x152'),'foreignKey':'CampaignId'});db[_0xe8fd('0x1ab')][_0xe8fd('0x119')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0xe8fd('0x1ac')});db[_0xe8fd('0x1ab')][_0xe8fd('0x155')](db['Trunk'],{'as':_0xe8fd('0x27'),'foreignKey':_0xe8fd('0x156')});db[_0xe8fd('0x1ab')]['belongsTo'](db[_0xe8fd('0x27')],{'as':'TrunkBackup','foreignKey':_0xe8fd('0x1e7')});db[_0xe8fd('0x1ab')]['belongsTo'](db[_0xe8fd('0x158')],{'as':_0xe8fd('0x158'),'foreignKey':_0xe8fd('0x159')});db['Campaign'][_0xe8fd('0x155')](db['SquareProject'],{'as':'SquareProject','foreignKey':_0xe8fd('0x1e8')});db[_0xe8fd('0x1ab')]['belongsToMany'](db['CmList'],{'as':_0xe8fd('0x12f'),'through':_0xe8fd('0x1e9')});db[_0xe8fd('0x1ab')]['belongsToMany'](db[_0xe8fd('0xf8')],{'as':_0xe8fd('0x1ea'),'through':'campaigns_has_cm_blacklists'});db['Attachment'][_0xe8fd('0x155')](db[_0xe8fd('0x64')],{'as':_0xe8fd('0x64'),'foreignKey':_0xe8fd('0x19e')});db[_0xe8fd('0xf0')][_0xe8fd('0x155')](db['MailMessage'],{});db[_0xe8fd('0xf0')][_0xe8fd('0x155')](db[_0xe8fd('0x40')],{});db[_0xe8fd('0xf0')][_0xe8fd('0x155')](db['MailAccount'],{'foreignKey':_0xe8fd('0x1eb'),'as':_0xe8fd('0x1ec')});db[_0xe8fd('0xf0')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'foreignKey':_0xe8fd('0x1ed'),'as':'FromAgent'});db[_0xe8fd('0xf0')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'foreignKey':_0xe8fd('0x1ee'),'as':_0xe8fd('0x1ef')});db[_0xe8fd('0xf0')][_0xe8fd('0x155')](db[_0xe8fd('0x138')],{'foreignKey':_0xe8fd('0x1f0'),'as':_0xe8fd('0x1f1')});db['MailTransferReport']['belongsTo'](db['MailAccount'],{'foreignKey':_0xe8fd('0x1f2'),'as':_0xe8fd('0x1f3')});db[_0xe8fd('0xf2')][_0xe8fd('0x155')](db['ChatMessage'],{});db[_0xe8fd('0xf2')]['belongsTo'](db[_0xe8fd('0x11f')],{});db[_0xe8fd('0xf2')][_0xe8fd('0x155')](db[_0xe8fd('0x5f')],{'foreignKey':_0xe8fd('0x1f4'),'as':_0xe8fd('0x1ec')});db[_0xe8fd('0xf2')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'foreignKey':_0xe8fd('0x1ed'),'as':_0xe8fd('0x1f5')});db[_0xe8fd('0xf2')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'foreignKey':_0xe8fd('0x1ee'),'as':_0xe8fd('0x1ef')});db['ChatTransferReport'][_0xe8fd('0x155')](db[_0xe8fd('0x19f')],{'foreignKey':_0xe8fd('0x1f6'),'as':_0xe8fd('0x1f1')});db[_0xe8fd('0xf2')][_0xe8fd('0x155')](db[_0xe8fd('0x5f')],{'foreignKey':'ToChatWebsiteId','as':_0xe8fd('0x1f3')});db[_0xe8fd('0xf4')][_0xe8fd('0x155')](db[_0xe8fd('0x4c')],{});db['FaxTransferReport'][_0xe8fd('0x155')](db[_0xe8fd('0x121')],{});db['FaxTransferReport'][_0xe8fd('0x155')](db[_0xe8fd('0x47')],{'foreignKey':'FromFaxAccountId','as':_0xe8fd('0x1ec')});db[_0xe8fd('0xf4')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'foreignKey':_0xe8fd('0x1ed'),'as':_0xe8fd('0x1f5')});db[_0xe8fd('0xf4')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'foreignKey':_0xe8fd('0x1ee'),'as':_0xe8fd('0x1ef')});db[_0xe8fd('0xf4')][_0xe8fd('0x155')](db[_0xe8fd('0x4e')],{'foreignKey':'ToFaxQueueId','as':_0xe8fd('0x1f1')});db['FaxTransferReport'][_0xe8fd('0x155')](db[_0xe8fd('0x47')],{'foreignKey':'ToFaxAccountId','as':_0xe8fd('0x1f3')});db[_0xe8fd('0x1f7')][_0xe8fd('0x155')](db[_0xe8fd('0x5c')],{});db[_0xe8fd('0x1f7')][_0xe8fd('0x155')](db[_0xe8fd('0x5b')],{});db[_0xe8fd('0x1f7')][_0xe8fd('0x155')](db[_0xe8fd('0x57')],{'foreignKey':_0xe8fd('0x1f8'),'as':'FromAccount'});db[_0xe8fd('0x1f7')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'foreignKey':'FromUserId','as':_0xe8fd('0x1f5')});db[_0xe8fd('0x1f7')]['belongsTo'](db[_0xe8fd('0x114')],{'foreignKey':'ToUserId','as':_0xe8fd('0x1ef')});db[_0xe8fd('0x1f7')][_0xe8fd('0x155')](db[_0xe8fd('0x18c')],{'foreignKey':_0xe8fd('0x1f9'),'as':_0xe8fd('0x1f1')});db['OpenchannelTransferReport'][_0xe8fd('0x155')](db[_0xe8fd('0x57')],{'foreignKey':_0xe8fd('0x1fa'),'as':_0xe8fd('0x1f3')});db[_0xe8fd('0xf6')][_0xe8fd('0x155')](db[_0xe8fd('0x54')],{});db[_0xe8fd('0xf6')][_0xe8fd('0x155')](db[_0xe8fd('0x53')],{});db[_0xe8fd('0xf6')][_0xe8fd('0x155')](db[_0xe8fd('0x51')],{'foreignKey':_0xe8fd('0x1fb'),'as':_0xe8fd('0x1ec')});db[_0xe8fd('0xf6')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'foreignKey':'FromUserId','as':_0xe8fd('0x1f5')});db[_0xe8fd('0xf6')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xe8fd('0xf6')][_0xe8fd('0x155')](db[_0xe8fd('0x56')],{'foreignKey':_0xe8fd('0x1fc'),'as':_0xe8fd('0x1f1')});db[_0xe8fd('0xf6')][_0xe8fd('0x155')](db[_0xe8fd('0x51')],{'foreignKey':_0xe8fd('0x1fd'),'as':_0xe8fd('0x1f3')});db[_0xe8fd('0xf8')][_0xe8fd('0x119')](db[_0xe8fd('0x77')],{'as':_0xe8fd('0x17d'),'foreignKey':_0xe8fd('0x16b'),'onDelete':_0xe8fd('0x115')});db[_0xe8fd('0xf8')][_0xe8fd('0x119')](db['CmCustomField'],{'as':_0xe8fd('0x1fe'),'foreignKey':_0xe8fd('0x16b')});db[_0xe8fd('0xf8')]['hasMany'](db[_0xe8fd('0x12c')],{'as':_0xe8fd('0x12d'),'onDelete':_0xe8fd('0x115'),'foreignKey':'ListId'});db[_0xe8fd('0xf8')][_0xe8fd('0x119')](db[_0xe8fd('0x6d')],{'as':_0xe8fd('0x1a4'),'foreignKey':'ListId'});db[_0xe8fd('0xf8')][_0xe8fd('0x119')](db[_0xe8fd('0x6f')],{'as':_0xe8fd('0x11d'),'foreignKey':_0xe8fd('0x16b')});db['CmList']['hasMany'](db[_0xe8fd('0x70')],{'as':_0xe8fd('0x70'),'foreignKey':'ListId'});db[_0xe8fd('0xf8')][_0xe8fd('0x129')](db[_0xe8fd('0x17')],{'as':_0xe8fd('0x1ff'),'through':_0xe8fd('0x15c')});db[_0xe8fd('0xf8')][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x16e'),'through':'cm_user_has_lists'});db[_0xe8fd('0x136')][_0xe8fd('0x119')](db[_0xe8fd('0x14')],{'as':'Extensions','onDelete':_0xe8fd('0x115')});db[_0xe8fd('0x136')][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':'Agents','through':_0xe8fd('0x110')});db[_0xe8fd('0x136')][_0xe8fd('0x129')](db[_0xe8fd('0xe5')],{'through':'TeamVoicePrefix','as':'Teams'});db[_0xe8fd('0x127')][_0xe8fd('0x119')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x175'),'foreignKey':'userProfileId'});db[_0xe8fd('0x127')][_0xe8fd('0x119')](db[_0xe8fd('0xfb')],{'as':_0xe8fd('0x200'),'foreignKey':_0xe8fd('0x128'),'onDelete':'cascade'});db[_0xe8fd('0xfb')][_0xe8fd('0x119')](db[_0xe8fd('0xfd')],{'as':_0xe8fd('0x201'),'foreignKey':'sectionId','onDelete':_0xe8fd('0x115')});db[_0xe8fd('0xff')][_0xe8fd('0x119')](db[_0xe8fd('0x77')],{'as':_0xe8fd('0x17d'),'foreignKey':_0xe8fd('0x202'),'onDelete':_0xe8fd('0x115')});db[_0xe8fd('0xff')]['hasMany'](db['CannedAnswer'],{'as':_0xe8fd('0x16a'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0xe8fd('0x119')](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0xe8fd('0x202')});db[_0xe8fd('0xff')][_0xe8fd('0x119')](db[_0xe8fd('0x102')],{'as':'Interactions'});db[_0xe8fd('0xff')]['hasMany'](db[_0xe8fd('0x101')],{'as':_0xe8fd('0x14c')});db[_0xe8fd('0xff')][_0xe8fd('0x155')](db[_0xe8fd('0xf8')],{'as':_0xe8fd('0x17b'),'foreignKey':_0xe8fd('0x16b')});db[_0xe8fd('0xff')][_0xe8fd('0x155')](db[_0xe8fd('0x7b')],{'as':_0xe8fd('0x15a'),'foreignKey':_0xe8fd('0x15b')});db[_0xe8fd('0xff')][_0xe8fd('0x129')](db['User'],{'as':_0xe8fd('0x16e'),'through':_0xe8fd('0x146')});db[_0xe8fd('0x101')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{'onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x101')]['belongsTo'](db[_0xe8fd('0x109')],{'onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x101')][_0xe8fd('0x155')](db[_0xe8fd('0xff')],{'onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x101')][_0xe8fd('0x155')](db[_0xe8fd('0x158')],{'onDelete':_0xe8fd('0x168'),'foreignKey':_0xe8fd('0x159')});db[_0xe8fd('0x101')][_0xe8fd('0x155')](db[_0xe8fd('0x82')],{'onDelete':_0xe8fd('0x168'),'foreignKey':_0xe8fd('0x179')});db[_0xe8fd('0x102')][_0xe8fd('0x119')](db[_0xe8fd('0x104')],{'as':_0xe8fd('0x15d'),'onDelete':_0xe8fd('0x115'),'foreignKey':_0xe8fd('0x203')});db['WhatsappInteraction'][_0xe8fd('0x155')](db[_0xe8fd('0xff')],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x202')});db[_0xe8fd('0x102')][_0xe8fd('0x155')](db['CmContact'],{'as':_0xe8fd('0x162'),'foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0x102')][_0xe8fd('0x155')](db['User'],{'as':_0xe8fd('0x172'),'foreignKey':_0xe8fd('0x116')});db[_0xe8fd('0x102')][_0xe8fd('0x129')](db[_0xe8fd('0x82')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0xe8fd('0x102')][_0xe8fd('0x129')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0xe8fd('0x174')});db[_0xe8fd('0x102')]['belongsToMany'](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x175'),'through':_0xe8fd('0x134'),'foreignKey':_0xe8fd('0x203')});db['WhatsappMessage'][_0xe8fd('0x155')](db['User'],{'as':_0xe8fd('0x114')});db[_0xe8fd('0x104')]['belongsTo'](db[_0xe8fd('0x12c')],{'onDelete':_0xe8fd('0x115'),'as':_0xe8fd('0x162')});db[_0xe8fd('0x104')]['belongsTo'](db[_0xe8fd('0x102')],{'onDelete':_0xe8fd('0x115'),'as':_0xe8fd('0x183'),'foreignKey':_0xe8fd('0x203')});db['WhatsappMessage']['belongsTo'](db[_0xe8fd('0xff')],{'as':_0xe8fd('0x171'),'foreignKey':_0xe8fd('0x202')});db[_0xe8fd('0x106')][_0xe8fd('0x155')](db[_0xe8fd('0xff')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xe8fd('0xf8')],{'as':'List','foreignKey':_0xe8fd('0x16b')});db[_0xe8fd('0x106')]['belongsTo'](db['CmContact'],{'as':_0xe8fd('0x162'),'foreignKey':_0xe8fd('0x163')});db[_0xe8fd('0x106')]['belongsTo'](db['WhatsappInteraction'],{});db[_0xe8fd('0x106')][_0xe8fd('0x155')](db[_0xe8fd('0x109')],{});db[_0xe8fd('0x106')][_0xe8fd('0x155')](db[_0xe8fd('0x104')],{});db[_0xe8fd('0x106')][_0xe8fd('0x155')](db[_0xe8fd('0x114')],{});db['WhatsappTransferReport'][_0xe8fd('0x155')](db[_0xe8fd('0x104')],{});db[_0xe8fd('0x108')]['belongsTo'](db['WhatsappInteraction'],{});db[_0xe8fd('0x108')][_0xe8fd('0x155')](db[_0xe8fd('0xff')],{'foreignKey':_0xe8fd('0x204'),'as':_0xe8fd('0x1ec')});db['WhatsappTransferReport']['belongsTo'](db[_0xe8fd('0xff')],{'foreignKey':_0xe8fd('0x205'),'as':_0xe8fd('0x1f3')});db[_0xe8fd('0x108')][_0xe8fd('0x155')](db['WhatsappQueue'],{'foreignKey':_0xe8fd('0x206'),'as':_0xe8fd('0x1f1')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0xe8fd('0x1f5')});db[_0xe8fd('0x108')][_0xe8fd('0x155')](db['User'],{'foreignKey':_0xe8fd('0x1ee'),'as':_0xe8fd('0x1ef')});db[_0xe8fd('0x109')][_0xe8fd('0x129')](db[_0xe8fd('0x114')],{'as':_0xe8fd('0x16e'),'through':_0xe8fd('0x37'),'foreignKey':_0xe8fd('0x207')});db[_0xe8fd('0x109')]['belongsToMany'](db[_0xe8fd('0xe5')],{'through':'team_has_whatsapp_queues','as':'Teams'});db['UserSetting'][_0xe8fd('0x155')](db['User'],{'as':_0xe8fd('0x208'),'foreignKey':_0xe8fd('0x116'),'onDelete':_0xe8fd('0x115'),'hooks':!![]});db[_0xe8fd('0x166')][_0xe8fd('0x117')](db['Dynamics365Account'],{'as':_0xe8fd('0x1d8'),'onDelete':'restrict'});db[_0xe8fd('0x166')][_0xe8fd('0x117')](db[_0xe8fd('0x164')],{'as':'Imap','onDelete':_0xe8fd('0x168')});db[_0xe8fd('0x166')][_0xe8fd('0x117')](db['MailServerOut'],{'as':_0xe8fd('0x209'),'onDelete':'restrict'});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x66d6=['SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','ChatApplication','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','ChatOfflineMessageId','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Members','CmCompany','CompanyId','Phones','HopperFinals','OpenchannelInteractions','Company','cm_contact_has_tags','ThroughTags','CmHopperId','Queue','CampaignId','OwnerId','Automation','All','AutomationAllId','Any','Actions','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','AnalyticCustomReport','CustomReportId','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceAccount','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','Configurations','Subjects','ZohoConfiguration','ZendeskField','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ServicenowAccount','Dynamics365Field','FreshsalesConfiguration','ChatQueueReport','FromId','ToId','SessionId','SmsQueueReport','ProjectId','JscriptyProject','MailQueues','TeamVoicePrefix','HopperHistories','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsAccountId','HopperHistory','Queues','UserProfileResource','sectionId','WhatsappAccountId','WhatsappInteractionId','user_has_whatsapp_interactions','WhatsappMessage','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','team_has_whatsapp_queues','Imap','Smtp','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xcall','xC@LL1234','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','OpenchannelInteraction','../api/openchannelMessage/openchannelMessage.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Variable','../api/integration/integration.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/migration/migration.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','belongsTo','userProfileId','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','belongsToMany','CmList','Lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','VoicePrefixes','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Hoppers','VoiceQueueId','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Dispositions','Answers','Interactions','List','ListId','Template','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Users','Interaction','ChatWebsiteId','ChatOfflineMessage','IntervalId','FaxAccountId','FaxApplication','Exntensions','TagId','FaxInteractionId','fax_interaction_has_tags','Attachment','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x66d6,0x81));var _0x666d=function(_0x3f8556,_0x35c394){_0x3f8556=_0x3f8556-0x0;var _0x391def=_0x66d6[_0x3f8556];return _0x391def;};'use strict';var config=require(_0x666d('0x0'));var Sequelize=require(_0x666d('0x1'));var _=require(_0x666d('0x2'));var jstz=require(_0x666d('0x3'));var timezone=jstz[_0x666d('0x4')]();config[_0x666d('0x1')]=_[_0x666d('0x5')](config[_0x666d('0x1')],{'database':_0x666d('0x6'),'username':'xcall','password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x666d('0x7'),'dialectOptions':{'charset':_0x666d('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x666d('0x9'),'collate':_0x666d('0xa')}}});config['sequelizeHistory']=_[_0x666d('0x5')](config[_0x666d('0xb')],{'database':_0x666d('0x6'),'username':_0x666d('0xc'),'password':_0x666d('0xd'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x666d('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x666d('0x1')][_0x666d('0xe')],config[_0x666d('0x1')][_0x666d('0xf')],config[_0x666d('0x1')][_0x666d('0x10')],config[_0x666d('0x1')][_0x666d('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x666d('0xe')],config[_0x666d('0xb')][_0x666d('0xf')],config[_0x666d('0xb')]['password'],config['sequelizeHistory'][_0x666d('0x11')])};db[_0x666d('0x12')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x14'));db[_0x666d('0x15')]=db['sequelize'][_0x666d('0x13')](_0x666d('0x16'));db[_0x666d('0x17')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x18'));db[_0x666d('0x19')]=db['sequelize'][_0x666d('0x13')](_0x666d('0x1a'));db['VoiceMusicOnHold']=db['sequelize'][_0x666d('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x666d('0x1b')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/voiceQueue/voiceQueue.model');db[_0x666d('0x1c')]=db[_0x666d('0x1')]['import'](_0x666d('0x1d'));db[_0x666d('0x1e')]=db['sequelize']['import'](_0x666d('0x1f'));db[_0x666d('0x20')]=db[_0x666d('0x1')]['import'](_0x666d('0x21'));db[_0x666d('0x22')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x666d('0x23')]=db['sequelize'][_0x666d('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0x666d('0x24')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x25'));db[_0x666d('0x26')]=db[_0x666d('0x1')]['import'](_0x666d('0x27'));db[_0x666d('0x28')]=db['sequelize'][_0x666d('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x666d('0x29')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x2a'));db[_0x666d('0x2b')]=db[_0x666d('0x1')]['import'](_0x666d('0x2c'));db[_0x666d('0x2d')]=db[_0x666d('0x1')]['import'](_0x666d('0x2e'));db['UserVoiceQueueRt']=db[_0x666d('0x1')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x666d('0x2f')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x30'));db[_0x666d('0x31')]=db['sequelize'][_0x666d('0x13')](_0x666d('0x32'));db[_0x666d('0x33')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0x666d('0x34')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x35'));db[_0x666d('0x36')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x37'));db[_0x666d('0x38')]=db['sequelize'][_0x666d('0x13')](_0x666d('0x39'));db[_0x666d('0x3a')]=db[_0x666d('0x1')]['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x666d('0x3b')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x3c'));db[_0x666d('0x3d')]=db['sequelize'][_0x666d('0x13')](_0x666d('0x3e'));db[_0x666d('0x3f')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/mailAccount/mailAccount.model');db[_0x666d('0x40')]=db[_0x666d('0x1')]['import']('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db['sequelize'][_0x666d('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0x666d('0x41')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x42'));db[_0x666d('0x43')]=db['sequelize'][_0x666d('0x13')](_0x666d('0x44'));db[_0x666d('0x45')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x46'));db[_0x666d('0x47')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/mailQueueReport/mailQueueReport.model');db[_0x666d('0x48')]=db[_0x666d('0x1')]['import'](_0x666d('0x49'));db[_0x666d('0x4a')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x4b'));db[_0x666d('0x4c')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x4d'));db['FaxApplication']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x4e'));db['FaxInteraction']=db[_0x666d('0x1')][_0x666d('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x666d('0x4f')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/faxMessage/faxMessage.model');db[_0x666d('0x50')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x51'));db['FaxQueueReport']=db[_0x666d('0x1')]['import'](_0x666d('0x52'));db[_0x666d('0x53')]=db[_0x666d('0x1')]['import'](_0x666d('0x54'));db[_0x666d('0x55')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x56'));db[_0x666d('0x57')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x58'));db[_0x666d('0x59')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x5a'));db[_0x666d('0x5b')]=db['sequelize'][_0x666d('0x13')](_0x666d('0x5c'));db[_0x666d('0x5d')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/openchannelAccount/openchannelAccount.model');db[_0x666d('0x5e')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/openchannelApplication/openchannelApplication.model');db[_0x666d('0x5f')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x60'));db['OpenchannelQueue']=db['sequelize'][_0x666d('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x666d('0x61')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x62'));db[_0x666d('0x63')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x64'));db['ChatInteraction']=db['sequelize'][_0x666d('0x13')](_0x666d('0x65'));db[_0x666d('0x66')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x67'));db['ChatOfflineMessage']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x68'));db[_0x666d('0x69')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x6a'));db[_0x666d('0x6b')]=db[_0x666d('0x1')]['import'](_0x666d('0x6c'));db[_0x666d('0x6d')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x6e'));db['CmCompany']=db['sequelize'][_0x666d('0x13')]('../api/cmCompany/cmCompany.model');db['CmContact']=db['sequelize'][_0x666d('0x13')]('../api/cmContact/cmContact.model');db[_0x666d('0x6f')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x70'));db[_0x666d('0x71')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x666d('0x72')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x666d('0x73')]=db['sequelize'][_0x666d('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x666d('0x74')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x75'));db[_0x666d('0x76')]=db[_0x666d('0x1')]['import'](_0x666d('0x77'));db[_0x666d('0x78')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/action/action.model');db['Automation']=db[_0x666d('0x1')][_0x666d('0x13')]('../api/automation/automation.model');db[_0x666d('0x79')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x7a'));db[_0x666d('0x7b')]=db['sequelize'][_0x666d('0x13')](_0x666d('0x7c'));db[_0x666d('0x7d')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x7e'));db[_0x666d('0x7f')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x80'));db[_0x666d('0x81')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x82'));db['Cdr']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x83'));db['VoiceQueuesLog']=db[_0x666d('0x1')][_0x666d('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x666d('0x1')][_0x666d('0x13')]('../api/schedule/schedule.model');db[_0x666d('0x84')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x85'));db[_0x666d('0x86')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x87'));db[_0x666d('0x88')]=db[_0x666d('0x1')]['import']('../api/contactItemType/contactItemType.model');db[_0x666d('0x89')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x8a'));db[_0x666d('0x8b')]=db['sequelize'][_0x666d('0x13')](_0x666d('0x8c'));db['Template']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x8d'));db['Trigger']=db[_0x666d('0x1')][_0x666d('0x13')]('../api/trigger/trigger.model');db[_0x666d('0x8e')]=db[_0x666d('0x1')]['import']('../api/variable/variable.model');db['Integration']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x8f'));db['IntegrationReport']=db[_0x666d('0x1')][_0x666d('0x13')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x90'));db[_0x666d('0x91')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x666d('0x92')]=db['sequelize'][_0x666d('0x13')](_0x666d('0x93'));db[_0x666d('0x94')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/analyticMetric/analyticMetric.model');db[_0x666d('0x95')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x666d('0x96')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x97'));db['SalesforceAccount']=db['sequelize'][_0x666d('0x13')](_0x666d('0x98'));db[_0x666d('0x99')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x9a'));db[_0x666d('0x9b')]=db['sequelize'][_0x666d('0x13')]('../api/intSalesforceField/intSalesforceField.model');db[_0x666d('0x9c')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x9d'));db[_0x666d('0x9e')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x666d('0x9f')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x666d('0xa0')]=db['sequelize'][_0x666d('0x13')]('../api/intDeskAccount/intDeskAccount.model');db[_0x666d('0xa1')]=db['sequelize'][_0x666d('0x13')](_0x666d('0xa2'));db[_0x666d('0xa3')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xa4'));db[_0x666d('0xa5')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xa6'));db['ZohoConfiguration']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xa7'));db[_0x666d('0xa8')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xa9'));db[_0x666d('0xaa')]=db['sequelize'][_0x666d('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x666d('0xab')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xac'));db['ZendeskField']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xad'));db[_0x666d('0xae')]=db['sequelize'][_0x666d('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0x666d('0x1')]['import'](_0x666d('0xaf'));db[_0x666d('0xb0')]=db[_0x666d('0x1')]['import'](_0x666d('0xb1'));db[_0x666d('0xb2')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xb3'));db[_0x666d('0xb4')]=db[_0x666d('0x1')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x666d('0xb5')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xb6'));db['ServicenowAccount']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xb7'));db[_0x666d('0xb8')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xb9'));db[_0x666d('0xba')]=db['sequelize']['import'](_0x666d('0xbb'));db[_0x666d('0xbc')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xbd'));db[_0x666d('0xbe')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xbf'));db['Dynamics365Field']=db[_0x666d('0x1')][_0x666d('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x666d('0xc0')]=db['sequelize'][_0x666d('0x13')](_0x666d('0xc1'));db['FreshsalesConfiguration']=db['sequelize'][_0x666d('0x13')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x666d('0xc2')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xc3'));db[_0x666d('0xc4')]=db[_0x666d('0x1')]['import'](_0x666d('0x8f'));db['Network']=db[_0x666d('0x1')]['import']('../api/network/network.model');db['ChatQueueReport']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xc5'));db['ChatInternalMessage']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xc6'));db[_0x666d('0xc7')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x666d('0xc8')]=db[_0x666d('0x1')]['import'](_0x666d('0xc9'));db[_0x666d('0xca')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xcb'));db['SmsQueueReport']=db[_0x666d('0x1')][_0x666d('0x13')]('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xcc'));db[_0x666d('0xcd')]=db[_0x666d('0x1')]['import']('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xce'));db[_0x666d('0xcf')]=db[_0x666d('0x1')]['import'](_0x666d('0xd0'));db[_0x666d('0xd1')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xd2'));db[_0x666d('0xd3')]=db[_0x666d('0x1')]['import'](_0x666d('0xd4'));db[_0x666d('0xd5')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xd6'));db[_0x666d('0xd7')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/squareMessage/squareMessage.model');db[_0x666d('0xd8')]=db[_0x666d('0x1')]['import'](_0x666d('0xd9'));db[_0x666d('0xda')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xdb'));db[_0x666d('0xdc')]=db[_0x666d('0x1')][_0x666d('0x13')]('../api/campaign/campaign.model');db['Migration']=db['sequelize'][_0x666d('0x13')](_0x666d('0xdd'));db['Attachment']=db[_0x666d('0x1')]['import']('../api/attachment/attachment.model');db['Plugin']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xde'));db[_0x666d('0xdf')]=db['sequelize'][_0x666d('0x13')](_0x666d('0xe0'));db['ChatTransferReport']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xe1'));db[_0x666d('0xe2')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xe3'));db[_0x666d('0xe4')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xe5'));db[_0x666d('0xe6')]=db['sequelize'][_0x666d('0x13')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0x666d('0x1')]['import'](_0x666d('0xe7'));db[_0x666d('0xe8')]=db['sequelize'][_0x666d('0x13')](_0x666d('0xe9'));db[_0x666d('0xea')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xeb'));db[_0x666d('0xec')]=db['sequelize'][_0x666d('0x13')](_0x666d('0xed'));db['UserProfileResource']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xee'));db[_0x666d('0xef')]=db[_0x666d('0x1')]['import']('../api/userNotification/userNotification.model');db[_0x666d('0xf0')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xf1'));db[_0x666d('0xf2')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xf3'));db[_0x666d('0xf4')]=db[_0x666d('0x1')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db['sequelize']['import'](_0x666d('0xf5'));db['WhatsappQueueReport']=db['sequelize']['import'](_0x666d('0xf6'));db[_0x666d('0xf7')]=db['sequelize'][_0x666d('0x13')](_0x666d('0xf8'));db[_0x666d('0xf9')]=db['sequelize'][_0x666d('0x13')](_0x666d('0xfa'));db[_0x666d('0xfb')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xfc'));db[_0x666d('0xfd')]=db[_0x666d('0x1')]['import'](_0x666d('0xfe'));db['TeamVoicePrefix']=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0xff'));db[_0x666d('0x100')]=db['sequelize'][_0x666d('0x13')](_0x666d('0x101'));db[_0x666d('0x102')]=db[_0x666d('0x1')][_0x666d('0x13')](_0x666d('0x103'));db[_0x666d('0x12')][_0x666d('0x104')](db[_0x666d('0x20')],{'as':'VoiceMail','onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x106')});db[_0x666d('0x12')]['hasOne'](db[_0x666d('0x102')],{'as':_0x666d('0x107'),'onDelete':_0x666d('0x105'),'foreignKey':'UserId'});db['User'][_0x666d('0x108')](db[_0x666d('0x1c')],{'as':_0x666d('0x109'),'foreignKey':_0x666d('0x106')});db['User'][_0x666d('0x108')](db[_0x666d('0x10a')],{'as':_0x666d('0x10b'),'foreignKey':_0x666d('0x106')});db['User'][_0x666d('0x108')](db['VoiceExtension'],{'as':_0x666d('0x10c'),'onDelete':_0x666d('0x105'),'hooks':!![]});db[_0x666d('0x12')]['hasMany'](db[_0x666d('0x72')],{'as':'HopperFinals','foreignKey':_0x666d('0x106')});db[_0x666d('0x12')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x666d('0x106')});db['User'][_0x666d('0x108')](db['ReportAgentPreview'],{'as':_0x666d('0x74'),'foreignKey':_0x666d('0x106')});db['User'][_0x666d('0x108')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0x666d('0x106')});db[_0x666d('0x12')]['hasMany'](db[_0x666d('0x10d')],{'as':_0x666d('0x10e'),'foreignKey':_0x666d('0x106')});db[_0x666d('0x12')][_0x666d('0x108')](db[_0x666d('0x57')],{'as':_0x666d('0x10f'),'foreignKey':_0x666d('0x106')});db[_0x666d('0x12')][_0x666d('0x108')](db[_0x666d('0x110')],{'as':_0x666d('0x111'),'foreignKey':'UserId'});db[_0x666d('0x12')]['hasMany'](db[_0x666d('0x41')],{'as':_0x666d('0x112'),'foreignKey':_0x666d('0x106')});db[_0x666d('0x12')][_0x666d('0x108')](db[_0x666d('0xf4')],{'as':_0x666d('0x113'),'foreignKey':_0x666d('0x106')});db[_0x666d('0x12')][_0x666d('0x108')](db[_0x666d('0xef')],{'as':_0x666d('0x114'),'foreignKey':'SenderId'});db[_0x666d('0x12')][_0x666d('0x115')](db[_0x666d('0xea')],{'as':_0x666d('0xea'),'foreignKey':_0x666d('0x116')});db[_0x666d('0x12')]['belongsToMany'](db[_0x666d('0x6b')],{'as':_0x666d('0x117'),'through':_0x666d('0x118')});db['User']['belongsToMany'](db[_0x666d('0x119')],{'as':_0x666d('0x11a'),'through':_0x666d('0x11b')});db[_0x666d('0x12')][_0x666d('0x11c')](db[_0x666d('0x11d')],{'as':_0x666d('0x11e'),'through':'cm_user_has_lists'});db[_0x666d('0x12')][_0x666d('0x11c')](db['Team'],{'through':_0x666d('0x11f')});db[_0x666d('0x12')]['belongsToMany'](db[_0x666d('0x41')],{'as':_0x666d('0x112'),'through':_0x666d('0x120')});db['User'][_0x666d('0x11c')](db[_0x666d('0x10d')],{'as':'ChatInteractions','through':_0x666d('0x121')});db['User'][_0x666d('0x11c')](db[_0x666d('0x110')],{'as':_0x666d('0x111'),'through':_0x666d('0x122')});db['User'][_0x666d('0x11c')](db[_0x666d('0x57')],{'as':'SmsInteractions','through':_0x666d('0x123')});db['User'][_0x666d('0x11c')](db[_0x666d('0x5f')],{'as':'OpenchannelInteractions','through':_0x666d('0x124')});db[_0x666d('0x12')][_0x666d('0x11c')](db[_0x666d('0xf4')],{'as':_0x666d('0x113'),'through':'user_has_whatsapp_interactions'});db[_0x666d('0x12')][_0x666d('0x11c')](db['VoiceQueue'],{'as':_0x666d('0x125'),'through':_0x666d('0x2f'),'required':![]});db['User'][_0x666d('0x11c')](db[_0x666d('0xe8')],{'as':_0x666d('0x126'),'through':_0x666d('0x100'),'required':![]});db[_0x666d('0x12')][_0x666d('0x11c')](db[_0x666d('0x40')],{'as':'MailQueues','through':_0x666d('0x33'),'required':![]});db['User'][_0x666d('0x11c')](db[_0x666d('0x69')],{'as':_0x666d('0x127'),'through':_0x666d('0x31'),'required':![],'hooks':!![]});db[_0x666d('0x12')][_0x666d('0x11c')](db[_0x666d('0x50')],{'as':_0x666d('0x128'),'through':'UserFaxQueue','required':![]});db[_0x666d('0x12')][_0x666d('0x11c')](db[_0x666d('0x5b')],{'as':_0x666d('0x129'),'through':_0x666d('0x36'),'required':![]});db['User']['belongsToMany'](db[_0x666d('0x12a')],{'as':_0x666d('0x12b'),'through':_0x666d('0x38'),'required':![]});db[_0x666d('0x12')]['belongsToMany'](db[_0x666d('0xf9')],{'as':'WhatsappQueues','through':_0x666d('0x3a'),'required':![]});db[_0x666d('0x12')][_0x666d('0x11c')](db['CmList'],{'through':_0x666d('0x12c')});db['User'][_0x666d('0x11c')](db[_0x666d('0x61')],{'as':_0x666d('0x12d'),'through':_0x666d('0x12e')});db['User'][_0x666d('0x11c')](db[_0x666d('0x4c')],{'as':_0x666d('0x12f'),'through':_0x666d('0x130')});db[_0x666d('0x12')][_0x666d('0x11c')](db[_0x666d('0x3f')],{'as':_0x666d('0x131'),'through':_0x666d('0x132')});db[_0x666d('0x12')][_0x666d('0x11c')](db[_0x666d('0x5d')],{'as':_0x666d('0x133'),'through':_0x666d('0x134')});db[_0x666d('0x12')][_0x666d('0x11c')](db['SmsAccount'],{'as':_0x666d('0x135'),'through':_0x666d('0x136')});db[_0x666d('0x12')][_0x666d('0x11c')](db['WhatsappAccount'],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db['User'][_0x666d('0x11c')](db['SquareProject'],{'as':_0x666d('0x137'),'through':_0x666d('0x138')});db[_0x666d('0x15')]['hasMany'](db[_0x666d('0x19')],{'as':_0x666d('0x139'),'onDelete':_0x666d('0x105'),'foreignKey':'ChanSpyId'});db[_0x666d('0x17')]['hasMany'](db[_0x666d('0x19')],{'onDelete':_0x666d('0x105')});db[_0x666d('0x19')][_0x666d('0x108')](db['VoiceExtension'],{'as':_0x666d('0x13a'),'onDelete':_0x666d('0x105')});db[_0x666d('0x13b')][_0x666d('0x11c')](db[_0x666d('0x84')],{'as':_0x666d('0x13c'),'through':_0x666d('0x13d')});db['VoiceQueue'][_0x666d('0x108')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0x666d('0x1b')][_0x666d('0x108')](db[_0x666d('0x6f')],{'as':_0x666d('0x13e'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x666d('0x108')](db[_0x666d('0x72')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x666d('0x1b')][_0x666d('0x108')](db[_0x666d('0x73')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db[_0x666d('0x1b')][_0x666d('0x108')](db['ReportAgentPreview'],{'as':_0x666d('0x74'),'foreignKey':_0x666d('0x13f')});db[_0x666d('0x1b')][_0x666d('0x108')](db[_0x666d('0x71')],{'as':_0x666d('0x140'),'foreignKey':_0x666d('0x13f')});db[_0x666d('0x1b')][_0x666d('0x108')](db[_0x666d('0xca')],{'as':_0x666d('0x141'),'foreignKey':'VoiceQueueId'});db[_0x666d('0x1b')]['belongsTo'](db[_0x666d('0x2b')],{'as':_0x666d('0x2b'),'foreignKey':_0x666d('0x142')});db[_0x666d('0x1b')][_0x666d('0x115')](db[_0x666d('0x2b')],{'as':_0x666d('0x143'),'foreignKey':'TrunkBackupId'});db[_0x666d('0x1b')][_0x666d('0x115')](db[_0x666d('0x7f')],{'as':_0x666d('0x7f'),'foreignKey':'IntervalId'});db[_0x666d('0x1b')][_0x666d('0x115')](db['Pause'],{'as':_0x666d('0x144'),'foreignKey':_0x666d('0x145')});db[_0x666d('0x1b')][_0x666d('0x11c')](db[_0x666d('0x11d')],{'as':'Lists','through':_0x666d('0x146')});db[_0x666d('0x1b')][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':_0x666d('0x147'),'through':_0x666d('0x2f')});db[_0x666d('0x1b')][_0x666d('0x11c')](db['Team'],{'as':_0x666d('0x148'),'through':_0x666d('0xfd')});db['VoiceQueue'][_0x666d('0x11c')](db[_0x666d('0x11d')],{'as':_0x666d('0x149'),'through':_0x666d('0x14a')});db[_0x666d('0x1c')][_0x666d('0x115')](db[_0x666d('0x12')],{'as':_0x666d('0x12'),'foreignKey':_0x666d('0x106')});db[_0x666d('0x1e')][_0x666d('0x115')](db[_0x666d('0x12')],{'as':_0x666d('0x12'),'foreignKey':_0x666d('0x106')});db[_0x666d('0x20')][_0x666d('0x108')](db['VoiceMailMessage'],{'as':_0x666d('0x14b'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x14c'),'sourceKey':'mailbox'});db[_0x666d('0x22')][_0x666d('0x115')](db['VoiceMail'],{'foreignKey':_0x666d('0x14c'),'targetKey':_0x666d('0x14d')});db[_0x666d('0x23')][_0x666d('0x108')](db[_0x666d('0x28')],{'as':_0x666d('0x14e'),'foreignKey':_0x666d('0x14f'),'constraints':![]});db['VoiceCallReport'][_0x666d('0x108')](db[_0x666d('0x26')],{'as':_0x666d('0x150'),'foreignKey':_0x666d('0x14f'),'constraints':![]});db[_0x666d('0x23')][_0x666d('0x115')](db[_0x666d('0x12')],{'as':_0x666d('0x12'),'foreignKey':_0x666d('0x106')});db[_0x666d('0x23')][_0x666d('0x115')](db[_0x666d('0x119')],{'as':_0x666d('0x151'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x3b')]['belongsTo'](db[_0x666d('0x3f')],{'as':'MailAccount','foreignKey':_0x666d('0x153')});db[_0x666d('0x3b')]['belongsTo'](db[_0x666d('0xfb')],{'as':'CloudProvider','foreignKey':_0x666d('0x154'),'onDelete':_0x666d('0x155')});db[_0x666d('0x3d')][_0x666d('0x115')](db['MailAccount'],{'as':_0x666d('0x3f'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x666d('0x115')](db['CloudProvider'],{'as':_0x666d('0xfb'),'foreignKey':_0x666d('0x154'),'onDelete':_0x666d('0x155')});db[_0x666d('0x3f')][_0x666d('0x104')](db['MailServerIn'],{'as':'Imap','onDelete':_0x666d('0x105')});db['MailAccount'][_0x666d('0x104')](db[_0x666d('0x3d')],{'as':'Smtp','onDelete':_0x666d('0x105')});db[_0x666d('0x3f')][_0x666d('0x108')](db[_0x666d('0x7b')],{'as':_0x666d('0x156'),'foreignKey':_0x666d('0x153'),'onDelete':_0x666d('0x105')});db[_0x666d('0x3f')][_0x666d('0x108')](db['CannedAnswer'],{'as':_0x666d('0x157'),'foreignKey':_0x666d('0x153')});db[_0x666d('0x3f')][_0x666d('0x108')](db[_0x666d('0x43')],{'as':_0x666d('0x14b'),'foreignKey':_0x666d('0x153')});db[_0x666d('0x3f')][_0x666d('0x108')](db['MailInteraction'],{'as':_0x666d('0x158')});db[_0x666d('0x3f')][_0x666d('0x108')](db['MailApplication'],{'as':_0x666d('0x13a')});db['MailAccount']['belongsTo'](db[_0x666d('0x11d')],{'as':_0x666d('0x159'),'foreignKey':_0x666d('0x15a')});db[_0x666d('0x3f')][_0x666d('0x115')](db[_0x666d('0x15b')],{'as':_0x666d('0x15b'),'foreignKey':_0x666d('0x15c')});db[_0x666d('0x3f')][_0x666d('0x115')](db[_0x666d('0x81')],{'as':_0x666d('0x144'),'foreignKey':_0x666d('0x145')});db['MailAccount'][_0x666d('0x11c')](db['User'],{'as':_0x666d('0x147'),'through':_0x666d('0x132')});db['MailQueue']['belongsToMany'](db['User'],{'as':_0x666d('0x147'),'through':_0x666d('0x33')});db['MailQueue']['belongsToMany'](db[_0x666d('0xd8')],{'through':_0x666d('0x15d'),'as':_0x666d('0x148')});db[_0x666d('0x41')][_0x666d('0x108')](db[_0x666d('0x43')],{'as':_0x666d('0x14b'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x15e')});db[_0x666d('0x41')][_0x666d('0x115')](db[_0x666d('0x3f')],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x153')});db[_0x666d('0x41')][_0x666d('0x115')](db[_0x666d('0x119')],{'as':_0x666d('0x151'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x41')][_0x666d('0x115')](db[_0x666d('0x12')],{'as':_0x666d('0x160'),'foreignKey':_0x666d('0x106')});db[_0x666d('0x41')][_0x666d('0x11c')](db[_0x666d('0x86')],{'through':_0x666d('0x161'),'as':_0x666d('0x162')});db[_0x666d('0x41')][_0x666d('0x11c')](db[_0x666d('0x86')],{'through':_0x666d('0x161'),'as':'ThroughTags'});db[_0x666d('0x41')][_0x666d('0x11c')](db['User'],{'as':_0x666d('0x163'),'through':_0x666d('0x120'),'foreignKey':_0x666d('0x15e')});db['MailMessage']['hasMany'](db['Attachment'],{'as':'Attachments','onDelete':_0x666d('0x105')});db[_0x666d('0x43')][_0x666d('0x115')](db['User'],{'as':_0x666d('0x12')});db[_0x666d('0x43')]['belongsTo'](db[_0x666d('0x119')],{'onDelete':_0x666d('0x105'),'as':_0x666d('0x151')});db['MailMessage']['belongsTo'](db[_0x666d('0x41')],{'as':_0x666d('0x164'),'foreignKey':'MailInteractionId'});db[_0x666d('0x43')]['belongsTo'](db['MailAccount'],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x153')});db[_0x666d('0x43')][_0x666d('0x115')](db[_0x666d('0x61')],{'as':_0x666d('0x61'),'foreignKey':_0x666d('0x165')});db[_0x666d('0x43')]['belongsTo'](db[_0x666d('0x166')],{'as':_0x666d('0x166'),'foreignKey':'ChatOfflineMessageId'});db[_0x666d('0x45')][_0x666d('0x115')](db[_0x666d('0x12')],{'onDelete':_0x666d('0x155')});db['MailApplication'][_0x666d('0x115')](db[_0x666d('0x40')],{'onDelete':_0x666d('0x155')});db[_0x666d('0x45')][_0x666d('0x115')](db[_0x666d('0x3f')],{'onDelete':'restrict'});db[_0x666d('0x45')][_0x666d('0x115')](db[_0x666d('0x7f')],{'onDelete':'restrict','foreignKey':_0x666d('0x167')});db[_0x666d('0x45')]['belongsTo'](db[_0x666d('0x86')],{'onDelete':_0x666d('0x155'),'foreignKey':'TagId'});db[_0x666d('0x47')]['belongsTo'](db[_0x666d('0x3f')],{});db['MailQueueReport']['belongsTo'](db['CmList'],{'as':_0x666d('0x159'),'foreignKey':_0x666d('0x15a')});db[_0x666d('0x47')][_0x666d('0x115')](db['CmContact'],{'as':'Contact','foreignKey':_0x666d('0x152')});db['MailQueueReport'][_0x666d('0x115')](db[_0x666d('0x41')],{});db['MailQueueReport'][_0x666d('0x115')](db['MailMessage'],{});db[_0x666d('0x47')][_0x666d('0x115')](db[_0x666d('0x12')],{});db['MailQueueReport'][_0x666d('0x115')](db[_0x666d('0x40')],{});db[_0x666d('0x48')]['hasMany'](db['DashboardItem'],{'as':'Items','onDelete':_0x666d('0x105')});db['FaxAccount'][_0x666d('0x108')](db[_0x666d('0x7b')],{'as':_0x666d('0x156'),'foreignKey':'FaxAccountId','onDelete':_0x666d('0x105')});db[_0x666d('0x4c')][_0x666d('0x108')](db[_0x666d('0x79')],{'as':_0x666d('0x157'),'foreignKey':_0x666d('0x168')});db[_0x666d('0x4c')][_0x666d('0x108')](db[_0x666d('0x110')],{'as':_0x666d('0x158')});db[_0x666d('0x4c')]['hasMany'](db[_0x666d('0x169')],{'as':'Applications'});db[_0x666d('0x4c')][_0x666d('0x108')](db[_0x666d('0x19')],{'as':_0x666d('0x16a'),'onDelete':'cascade'});db['FaxAccount']['hasMany'](db[_0x666d('0x4f')],{'as':_0x666d('0x14b')});db[_0x666d('0x4c')]['belongsTo'](db[_0x666d('0x2b')],{'as':_0x666d('0x2b')});db[_0x666d('0x4c')][_0x666d('0x115')](db[_0x666d('0x11d')],{'as':_0x666d('0x159'),'foreignKey':'ListId'});db[_0x666d('0x4c')][_0x666d('0x115')](db[_0x666d('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x666d('0x145')});db[_0x666d('0x4c')][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':_0x666d('0x147'),'through':_0x666d('0x130')});db[_0x666d('0x169')]['belongsTo'](db[_0x666d('0x12')],{'onDelete':_0x666d('0x155')});db['FaxApplication'][_0x666d('0x115')](db[_0x666d('0x50')],{'onDelete':'restrict'});db[_0x666d('0x169')][_0x666d('0x115')](db[_0x666d('0x4c')],{'onDelete':'restrict'});db[_0x666d('0x169')]['belongsTo'](db[_0x666d('0x86')],{'onDelete':_0x666d('0x155'),'foreignKey':_0x666d('0x16b')});db[_0x666d('0x110')][_0x666d('0x108')](db['FaxMessage'],{'as':_0x666d('0x14b'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x16c')});db[_0x666d('0x110')][_0x666d('0x115')](db[_0x666d('0x4c')],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x168')});db[_0x666d('0x110')]['belongsTo'](db[_0x666d('0x119')],{'as':_0x666d('0x151'),'foreignKey':_0x666d('0x152')});db['FaxInteraction']['belongsTo'](db[_0x666d('0x12')],{'as':'Owner','foreignKey':_0x666d('0x106')});db[_0x666d('0x110')][_0x666d('0x11c')](db[_0x666d('0x86')],{'through':_0x666d('0x16d'),'as':_0x666d('0x162')});db[_0x666d('0x110')][_0x666d('0x11c')](db['Tag'],{'through':_0x666d('0x16d'),'as':'ThroughTags'});db[_0x666d('0x110')][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':'Users','through':_0x666d('0x122'),'foreignKey':_0x666d('0x16c')});db['FaxMessage'][_0x666d('0x115')](db[_0x666d('0x12')],{'onDelete':_0x666d('0x105'),'as':_0x666d('0x12')});db[_0x666d('0x4f')][_0x666d('0x115')](db['FaxInteraction'],{'as':_0x666d('0x164'),'foreignKey':'FaxInteractionId'});db[_0x666d('0x4f')][_0x666d('0x115')](db['CmContact'],{'onDelete':_0x666d('0x105'),'as':_0x666d('0x151')});db['FaxMessage']['belongsTo'](db[_0x666d('0x16e')],{'as':_0x666d('0x16e'),'foreignKey':_0x666d('0x16f')});db[_0x666d('0x4f')]['belongsTo'](db[_0x666d('0x4c')],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x168')});db[_0x666d('0x50')][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':_0x666d('0x147'),'through':_0x666d('0x34')});db[_0x666d('0x50')][_0x666d('0x11c')](db[_0x666d('0xd8')],{'through':_0x666d('0x170'),'as':_0x666d('0x148')});db[_0x666d('0x171')][_0x666d('0x115')](db[_0x666d('0x4c')],{});db['FaxQueueReport']['belongsTo'](db['CmList'],{'as':_0x666d('0x159'),'foreignKey':_0x666d('0x15a')});db[_0x666d('0x171')][_0x666d('0x115')](db[_0x666d('0x119')],{'as':_0x666d('0x151'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x171')]['belongsTo'](db['FaxInteraction'],{});db[_0x666d('0x171')][_0x666d('0x115')](db[_0x666d('0x4f')],{});db[_0x666d('0x171')]['belongsTo'](db['User'],{});db[_0x666d('0x171')][_0x666d('0x115')](db[_0x666d('0x50')],{});db[_0x666d('0x53')][_0x666d('0x108')](db[_0x666d('0x7b')],{'as':_0x666d('0x156'),'foreignKey':_0x666d('0x172'),'onDelete':_0x666d('0x105')});db[_0x666d('0x53')][_0x666d('0x108')](db[_0x666d('0x79')],{'as':_0x666d('0x157'),'foreignKey':'SmsAccountId'});db[_0x666d('0x53')][_0x666d('0x108')](db[_0x666d('0x59')],{'as':'Messages','foreignKey':_0x666d('0x172')});db[_0x666d('0x53')][_0x666d('0x108')](db['SmsInteraction'],{'as':'Interactions'});db[_0x666d('0x53')][_0x666d('0x108')](db['SmsApplication'],{'as':'Applications'});db['SmsAccount'][_0x666d('0x115')](db[_0x666d('0x11d')],{'as':_0x666d('0x159'),'foreignKey':'ListId'});db[_0x666d('0x53')][_0x666d('0x115')](db[_0x666d('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x666d('0x145')});db[_0x666d('0x53')][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':'Agents','through':_0x666d('0x136')});db[_0x666d('0x55')][_0x666d('0x115')](db[_0x666d('0x12')],{'onDelete':_0x666d('0x155')});db[_0x666d('0x55')][_0x666d('0x115')](db[_0x666d('0x5b')],{'onDelete':_0x666d('0x155')});db[_0x666d('0x55')][_0x666d('0x115')](db[_0x666d('0x53')],{'onDelete':_0x666d('0x155')});db[_0x666d('0x55')]['belongsTo'](db[_0x666d('0x7f')],{'onDelete':'restrict','foreignKey':_0x666d('0x167')});db[_0x666d('0x55')][_0x666d('0x115')](db[_0x666d('0x86')],{'onDelete':_0x666d('0x155'),'foreignKey':_0x666d('0x16b')});db[_0x666d('0x57')][_0x666d('0x108')](db[_0x666d('0x59')],{'as':_0x666d('0x14b'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x173')});db[_0x666d('0x57')][_0x666d('0x115')](db['SmsAccount'],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x172')});db[_0x666d('0x57')]['belongsTo'](db[_0x666d('0x119')],{'as':_0x666d('0x151'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x57')][_0x666d('0x115')](db[_0x666d('0x12')],{'as':_0x666d('0x160'),'foreignKey':_0x666d('0x106')});db['SmsInteraction']['belongsToMany'](db[_0x666d('0x86')],{'through':_0x666d('0x174'),'as':_0x666d('0x162')});db[_0x666d('0x57')][_0x666d('0x11c')](db['Tag'],{'through':_0x666d('0x174'),'as':'ThroughTags'});db['SmsInteraction'][_0x666d('0x11c')](db['User'],{'as':'Users','through':_0x666d('0x123'),'foreignKey':_0x666d('0x173')});db[_0x666d('0x59')][_0x666d('0x115')](db[_0x666d('0x12')],{'as':_0x666d('0x12')});db[_0x666d('0x59')][_0x666d('0x115')](db[_0x666d('0x119')],{'onDelete':'cascade','as':'Contact'});db[_0x666d('0x59')][_0x666d('0x115')](db[_0x666d('0x57')],{'onDelete':_0x666d('0x105'),'as':_0x666d('0x164'),'foreignKey':_0x666d('0x173')});db['SmsMessage'][_0x666d('0x115')](db[_0x666d('0x53')],{'as':'Account','foreignKey':_0x666d('0x172')});db['SmsQueue'][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':_0x666d('0x147'),'through':_0x666d('0x36'),'foreignKey':_0x666d('0x175')});db[_0x666d('0x5b')][_0x666d('0x11c')](db[_0x666d('0xd8')],{'through':_0x666d('0x176'),'as':_0x666d('0x148')});db['OpenchannelAccount'][_0x666d('0x108')](db[_0x666d('0x7b')],{'as':'Dispositions','foreignKey':_0x666d('0x177'),'onDelete':_0x666d('0x105')});db[_0x666d('0x5d')][_0x666d('0x108')](db[_0x666d('0x79')],{'as':_0x666d('0x157'),'foreignKey':'OpenchannelAccountId'});db[_0x666d('0x5d')][_0x666d('0x108')](db[_0x666d('0x5f')],{'as':_0x666d('0x158'),'foreignKey':'OpenchannelAccountId'});db[_0x666d('0x5d')]['hasMany'](db[_0x666d('0x178')],{'as':_0x666d('0x14b'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0x666d('0x5e')],{'as':_0x666d('0x13a'),'foreignKey':_0x666d('0x177')});db[_0x666d('0x5d')][_0x666d('0x115')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['OpenchannelAccount'][_0x666d('0x115')](db[_0x666d('0x81')],{'as':_0x666d('0x144'),'foreignKey':_0x666d('0x145')});db[_0x666d('0x5d')][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':_0x666d('0x147'),'through':_0x666d('0x134')});db[_0x666d('0x5e')][_0x666d('0x115')](db[_0x666d('0x12')],{'onDelete':_0x666d('0x155')});db['OpenchannelApplication'][_0x666d('0x115')](db['OpenchannelQueue'],{'onDelete':_0x666d('0x155'),'foreignKey':_0x666d('0x179')});db['OpenchannelApplication'][_0x666d('0x115')](db[_0x666d('0x5d')],{'onDelete':'restrict','foreignKey':_0x666d('0x177')});db[_0x666d('0x5e')]['belongsTo'](db[_0x666d('0x7f')],{'onDelete':_0x666d('0x155'),'foreignKey':_0x666d('0x167')});db[_0x666d('0x5e')]['belongsTo'](db[_0x666d('0x86')],{'onDelete':_0x666d('0x155'),'foreignKey':'TagId'});db['OpenchannelInteraction'][_0x666d('0x108')](db[_0x666d('0x178')],{'as':_0x666d('0x14b'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x17a')});db['OpenchannelInteraction'][_0x666d('0x115')](db[_0x666d('0x5d')],{'as':_0x666d('0x15f'),'foreignKey':'OpenchannelAccountId'});db[_0x666d('0x5f')][_0x666d('0x115')](db[_0x666d('0x119')],{'as':_0x666d('0x151'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x5f')][_0x666d('0x115')](db[_0x666d('0x12')],{'as':_0x666d('0x160'),'foreignKey':'UserId'});db['OpenchannelInteraction'][_0x666d('0x11c')](db[_0x666d('0x86')],{'through':_0x666d('0x17b'),'as':_0x666d('0x162')});db[_0x666d('0x5f')][_0x666d('0x11c')](db[_0x666d('0x86')],{'through':_0x666d('0x17b'),'as':'ThroughTags'});db[_0x666d('0x5f')]['belongsToMany'](db[_0x666d('0x12')],{'as':'Users','through':_0x666d('0x124'),'foreignKey':_0x666d('0x17a')});db[_0x666d('0x178')][_0x666d('0x115')](db[_0x666d('0x12')],{'onDelete':_0x666d('0x105'),'as':_0x666d('0x12')});db[_0x666d('0x178')]['belongsTo'](db['CmContact'],{'onDelete':_0x666d('0x105'),'as':_0x666d('0x151')});db[_0x666d('0x178')][_0x666d('0x115')](db[_0x666d('0x5f')],{'onDelete':'cascade','as':_0x666d('0x164'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x666d('0x115')](db['Attachment'],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x666d('0x178')][_0x666d('0x115')](db[_0x666d('0x5d')],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x177')});db[_0x666d('0x12a')][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':_0x666d('0x147'),'through':_0x666d('0x38'),'foreignKey':_0x666d('0x179')});db[_0x666d('0x12a')][_0x666d('0x11c')](db[_0x666d('0xd8')],{'through':_0x666d('0x17c'),'as':_0x666d('0x148')});db[_0x666d('0x61')]['hasMany'](db['Disposition'],{'as':_0x666d('0x156'),'foreignKey':_0x666d('0x165'),'onDelete':'cascade'});db[_0x666d('0x61')][_0x666d('0x108')](db[_0x666d('0x79')],{'as':_0x666d('0x157'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0x666d('0x108')](db['ChatProactiveAction'],{'as':_0x666d('0x17d')});db['ChatWebsite'][_0x666d('0x108')](db[_0x666d('0x10d')],{'as':_0x666d('0x158')});db[_0x666d('0x61')][_0x666d('0x108')](db[_0x666d('0x17e')],{'as':'Applications'});db[_0x666d('0x61')]['hasMany'](db['ChatMessage'],{'as':_0x666d('0x14b')});db['ChatWebsite']['belongsTo'](db[_0x666d('0x11d')],{'as':_0x666d('0x159'),'foreignKey':_0x666d('0x15a')});db[_0x666d('0x61')]['belongsTo'](db[_0x666d('0x7f')],{'as':_0x666d('0x7f'),'foreignKey':_0x666d('0x167')});db[_0x666d('0x61')][_0x666d('0x115')](db[_0x666d('0x3f')],{'as':_0x666d('0x3f'),'foreignKey':'MailAccountId'});db[_0x666d('0x61')]['belongsTo'](db['Pause'],{'as':_0x666d('0x144'),'foreignKey':_0x666d('0x145')});db[_0x666d('0x61')][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':_0x666d('0x147'),'through':_0x666d('0x12e')});db[_0x666d('0x63')]['belongsTo'](db[_0x666d('0x5d')],{});db[_0x666d('0x63')][_0x666d('0x115')](db[_0x666d('0x11d')],{'as':_0x666d('0x159'),'foreignKey':_0x666d('0x15a')});db[_0x666d('0x63')]['belongsTo'](db['CmContact'],{'as':_0x666d('0x151'),'foreignKey':'ContactId'});db[_0x666d('0x63')]['belongsTo'](db[_0x666d('0x5f')],{});db[_0x666d('0x63')][_0x666d('0x115')](db[_0x666d('0x178')],{});db[_0x666d('0x63')][_0x666d('0x115')](db[_0x666d('0x12')],{});db[_0x666d('0x63')][_0x666d('0x115')](db[_0x666d('0x12a')],{});db[_0x666d('0x17e')][_0x666d('0x115')](db[_0x666d('0x12')],{'as':_0x666d('0x17f'),'foreignKey':_0x666d('0x106'),'onDelete':_0x666d('0x155')});db[_0x666d('0x17e')][_0x666d('0x115')](db[_0x666d('0x69')],{'as':'Queue','foreignKey':_0x666d('0x180'),'onDelete':_0x666d('0x155')});db[_0x666d('0x17e')][_0x666d('0x115')](db['ChatWebsite'],{'as':_0x666d('0x181'),'foreignKey':_0x666d('0x165'),'onDelete':_0x666d('0x155')});db[_0x666d('0x17e')][_0x666d('0x115')](db[_0x666d('0x86')],{'onDelete':_0x666d('0x155'),'foreignKey':'TagId'});db[_0x666d('0x10d')]['hasMany'](db['ChatMessage'],{'as':_0x666d('0x14b'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x182')});db[_0x666d('0x10d')][_0x666d('0x115')](db[_0x666d('0x61')],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x165')});db[_0x666d('0x10d')][_0x666d('0x115')](db['CmContact'],{'as':_0x666d('0x151'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x10d')][_0x666d('0x115')](db[_0x666d('0x12')],{'as':_0x666d('0x160'),'foreignKey':'UserId'});db[_0x666d('0x10d')][_0x666d('0x11c')](db[_0x666d('0x86')],{'through':_0x666d('0x183'),'as':'Tags'});db[_0x666d('0x10d')][_0x666d('0x11c')](db[_0x666d('0x86')],{'through':_0x666d('0x183'),'as':'ThroughTags'});db[_0x666d('0x10d')]['belongsToMany'](db[_0x666d('0x12')],{'as':_0x666d('0x163'),'through':'user_has_chat_interactions','foreignKey':_0x666d('0x182')});db[_0x666d('0x66')][_0x666d('0x115')](db['User'],{'onDelete':_0x666d('0x105'),'as':_0x666d('0x12')});db[_0x666d('0x66')][_0x666d('0x115')](db[_0x666d('0x119')],{'onDelete':_0x666d('0x105'),'as':_0x666d('0x151'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x66')][_0x666d('0x115')](db['ChatInteraction'],{'onDelete':'cascade','as':_0x666d('0x164'),'foreignKey':'ChatInteractionId'});db[_0x666d('0x66')][_0x666d('0x115')](db[_0x666d('0x16e')],{'as':_0x666d('0x16e'),'foreignKey':_0x666d('0x16f')});db[_0x666d('0x66')][_0x666d('0x115')](db[_0x666d('0x61')],{'as':'Account','foreignKey':_0x666d('0x165')});db[_0x666d('0x166')]['hasMany'](db[_0x666d('0x16e')],{'as':_0x666d('0x184'),'foreignKey':_0x666d('0x185'),'onDelete':'cascade','hooks':!![]});db[_0x666d('0x166')][_0x666d('0x115')](db[_0x666d('0x119')],{'onDelete':_0x666d('0x105'),'as':_0x666d('0x151'),'foreignKey':'ContactId'});db[_0x666d('0x166')][_0x666d('0x115')](db[_0x666d('0x61')],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x165')});db[_0x666d('0x69')][_0x666d('0x11c')](db['User'],{'as':_0x666d('0x147'),'through':_0x666d('0x31'),'hooks':!![]});db[_0x666d('0x69')]['belongsToMany'](db[_0x666d('0xd8')],{'through':_0x666d('0x186'),'as':_0x666d('0x148')});db[_0x666d('0x6b')][_0x666d('0x108')](db[_0x666d('0x187')],{'as':_0x666d('0x14b'),'foreignKey':_0x666d('0x188'),'onDelete':_0x666d('0x105')});db['ChatGroup'][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':_0x666d('0x189'),'through':'chat_group_has_users'});db[_0x666d('0x6d')][_0x666d('0x115')](db['ChatWebsite'],{'as':_0x666d('0x181'),'foreignKey':_0x666d('0x165')});db[_0x666d('0x18a')]['hasMany'](db[_0x666d('0x119')],{'as':_0x666d('0x11a'),'foreignKey':_0x666d('0x18b')});db[_0x666d('0x119')][_0x666d('0x108')](db[_0x666d('0x89')],{'as':_0x666d('0x18c'),'foreignKey':'CmContactId'});db[_0x666d('0x119')][_0x666d('0x108')](db['CmHopper'],{'as':_0x666d('0x13e'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x119')][_0x666d('0x108')](db[_0x666d('0x72')],{'as':_0x666d('0x18d'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x119')][_0x666d('0x108')](db[_0x666d('0x73')],{'as':'HopperHistories','foreignKey':_0x666d('0x152')});db[_0x666d('0x119')][_0x666d('0x108')](db[_0x666d('0x74')],{'as':_0x666d('0x74'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x119')][_0x666d('0x108')](db[_0x666d('0xca')],{'as':_0x666d('0x141'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x119')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x666d('0x18e'),'foreignKey':_0x666d('0x152'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x666d('0x10d')],{'as':_0x666d('0x10e'),'foreignKey':'ContactId','onDelete':_0x666d('0x155')});db[_0x666d('0x119')]['hasMany'](db['SmsInteraction'],{'as':_0x666d('0x10f'),'foreignKey':'ContactId','onDelete':_0x666d('0x155')});db[_0x666d('0x119')]['hasMany'](db[_0x666d('0x110')],{'as':_0x666d('0x111'),'foreignKey':_0x666d('0x152'),'onDelete':_0x666d('0x155')});db[_0x666d('0x119')][_0x666d('0x108')](db[_0x666d('0x41')],{'as':_0x666d('0x112'),'foreignKey':_0x666d('0x152'),'onDelete':_0x666d('0x155')});db['CmContact']['belongsTo'](db['CmCompany'],{'as':_0x666d('0x18f'),'foreignKey':_0x666d('0x18b')});db[_0x666d('0x119')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x666d('0x15a'),'onDelete':_0x666d('0x105')});db['CmContact'][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':_0x666d('0x163'),'through':_0x666d('0x11b')});db[_0x666d('0x119')]['belongsToMany'](db[_0x666d('0x86')],{'as':'Tags','through':_0x666d('0x190')});db['CmContact'][_0x666d('0x11c')](db[_0x666d('0x86')],{'through':'cm_contact_has_tags','as':_0x666d('0x191')});db['CmHopper'][_0x666d('0x108')](db['CmHopperAdditionalPhone'],{'as':'AdditionalPhones','foreignKey':_0x666d('0x192')});db['CmHopper'][_0x666d('0x115')](db[_0x666d('0x119')],{'as':_0x666d('0x151'),'foreignKey':_0x666d('0x152'),'onDelete':'cascade'});db[_0x666d('0x6f')]['belongsTo'](db[_0x666d('0x11d')],{'as':_0x666d('0x159'),'foreignKey':_0x666d('0x15a'),'onDelete':_0x666d('0x105')});db[_0x666d('0x6f')][_0x666d('0x115')](db[_0x666d('0x12')],{'as':_0x666d('0x17f'),'foreignKey':_0x666d('0x106')});db[_0x666d('0x6f')][_0x666d('0x115')](db[_0x666d('0x1b')],{'as':_0x666d('0x193'),'foreignKey':_0x666d('0x13f'),'onDelete':_0x666d('0x105')});db[_0x666d('0x6f')]['belongsTo'](db[_0x666d('0xdc')],{'as':_0x666d('0xdc'),'foreignKey':_0x666d('0x194'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0x666d('0x12')],{'as':_0x666d('0x160'),'foreignKey':_0x666d('0x195')});db[_0x666d('0x71')][_0x666d('0x115')](db['CmContact'],{'as':_0x666d('0x151'),'foreignKey':'ContactId','onDelete':_0x666d('0x105')});db[_0x666d('0x71')][_0x666d('0x115')](db[_0x666d('0x11d')],{'as':_0x666d('0x159'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x666d('0x71')]['belongsTo'](db['VoiceQueue'],{'as':_0x666d('0x193'),'foreignKey':'VoiceQueueId','onDelete':_0x666d('0x105')});db[_0x666d('0x71')][_0x666d('0x115')](db['Campaign'],{'as':_0x666d('0xdc'),'foreignKey':_0x666d('0x194'),'onDelete':_0x666d('0x105')});db[_0x666d('0x196')]['hasMany'](db[_0x666d('0x7d')],{'as':{'plural':_0x666d('0x197'),'singular':'OneAll'},'foreignKey':_0x666d('0x198'),'onDelete':_0x666d('0x105'),'hooks':!![]});db[_0x666d('0x196')][_0x666d('0x108')](db[_0x666d('0x7d')],{'as':{'plural':_0x666d('0x199'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0x666d('0x105'),'hooks':!![]});db[_0x666d('0x196')][_0x666d('0x108')](db[_0x666d('0x78')],{'as':_0x666d('0x19a'),'foreignKey':_0x666d('0x19b'),'onDelete':_0x666d('0x105'),'hooks':!![]});db[_0x666d('0x7b')]['hasMany'](db[_0x666d('0x7b')],{'as':_0x666d('0x156'),'foreignKey':_0x666d('0x19c'),'onDelete':_0x666d('0x105')});db[_0x666d('0x7f')][_0x666d('0x108')](db[_0x666d('0x7f')],{'as':'Intervals','foreignKey':_0x666d('0x167'),'onDelete':_0x666d('0x105'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db['VoiceExtension'],{'as':_0x666d('0x10c'),'foreignKey':_0x666d('0x167'),'onDelete':_0x666d('0x155')});db['Interval'][_0x666d('0x108')](db['MailApplication'],{'as':_0x666d('0x19d'),'foreignKey':_0x666d('0x167')});db[_0x666d('0x7f')]['hasMany'](db[_0x666d('0x17e')],{'as':_0x666d('0x19e'),'foreignKey':_0x666d('0x167')});db[_0x666d('0x7f')][_0x666d('0x108')](db[_0x666d('0x169')],{'as':_0x666d('0x19f'),'foreignKey':_0x666d('0x167')});db['Interval'][_0x666d('0x108')](db[_0x666d('0x55')],{'as':_0x666d('0x1a0'),'foreignKey':_0x666d('0x167')});db[_0x666d('0x1a1')][_0x666d('0x115')](db[_0x666d('0x3f')],{});db['Schedule'][_0x666d('0x115')](db[_0x666d('0x91')],{'foreignKey':_0x666d('0x1a2')});db[_0x666d('0x1a1')][_0x666d('0x115')](db[_0x666d('0x1a3')],{'foreignKey':_0x666d('0x1a4')});db[_0x666d('0x84')]['belongsToMany'](db[_0x666d('0x13b')],{'as':'Mohs','through':_0x666d('0x13d'),'onDelete':_0x666d('0x155')});db[_0x666d('0x86')]['belongsToMany'](db[_0x666d('0x119')],{'through':_0x666d('0x190')});db[_0x666d('0x86')]['belongsToMany'](db['ChatInteraction'],{'through':_0x666d('0x183')});db[_0x666d('0x86')][_0x666d('0x11c')](db[_0x666d('0x41')],{'through':_0x666d('0x161')});db['Tag'][_0x666d('0x11c')](db[_0x666d('0x57')],{'through':_0x666d('0x174')});db['Tag'][_0x666d('0x11c')](db[_0x666d('0x110')],{'through':_0x666d('0x16d')});db['Tag'][_0x666d('0x11c')](db[_0x666d('0x5f')],{'through':'openchannel_interaction_has_tags'});db[_0x666d('0x86')]['belongsToMany'](db[_0x666d('0xf4')],{'through':_0x666d('0x1a5')});db[_0x666d('0x89')][_0x666d('0x115')](db[_0x666d('0x88')],{'as':_0x666d('0x1a6'),'foreignKey':_0x666d('0x1a7')});db['CmHopperAdditionalPhone'][_0x666d('0x115')](db[_0x666d('0x6f')],{'as':_0x666d('0x1a8'),'foreignKey':_0x666d('0x192')});db[_0x666d('0x89')]['belongsTo'](db[_0x666d('0x119')],{'as':_0x666d('0x151'),'foreignKey':'CmContactId'});db[_0x666d('0x1a9')]['hasMany'](db[_0x666d('0x7d')],{'as':{'plural':_0x666d('0x1aa'),'singular':_0x666d('0x1ab')},'foreignKey':_0x666d('0x1ac'),'onDelete':_0x666d('0x105'),'hooks':!![]});db[_0x666d('0x1a9')]['hasMany'](db[_0x666d('0x7d')],{'as':{'plural':_0x666d('0x1ad'),'singular':'AnyCondition'},'foreignKey':_0x666d('0x1ae'),'onDelete':'cascade','hooks':!![]});db[_0x666d('0x1a9')]['hasMany'](db['Action'],{'as':'Actions','foreignKey':_0x666d('0x1af'),'onDelete':_0x666d('0x105'),'hooks':!![]});db[_0x666d('0x1a3')][_0x666d('0x108')](db[_0x666d('0x95')],{'as':'Fields','onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1a4'),'hooks':!![]});db[_0x666d('0x91')][_0x666d('0x108')](db['AnalyticFieldReport'],{'as':_0x666d('0x1b0'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1a2')});db[_0x666d('0x94')][_0x666d('0x108')](db['AnalyticFieldReport'],{'as':_0x666d('0x1b0'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b1')});db[_0x666d('0x95')]['belongsTo'](db[_0x666d('0x94')],{'foreignKey':_0x666d('0x1b1')});db[_0x666d('0x1b2')][_0x666d('0x108')](db[_0x666d('0x99')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x666d('0x1b3')});db[_0x666d('0x99')][_0x666d('0x108')](db['SalesforceField'],{'as':'Subjects','onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b4')});db[_0x666d('0x99')][_0x666d('0x108')](db[_0x666d('0x9b')],{'as':_0x666d('0x1b5'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b6')});db[_0x666d('0x99')]['hasMany'](db[_0x666d('0x9b')],{'as':'Fields','onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b7')});db['SalesforceConfiguration'][_0x666d('0x115')](db[_0x666d('0x1b2')],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x1b3')});db[_0x666d('0x9b')][_0x666d('0x108')](db['SalesforceField'],{'as':_0x666d('0x1b8'),'foreignKey':_0x666d('0x1b4')});db[_0x666d('0x9b')]['hasMany'](db[_0x666d('0x9b')],{'as':_0x666d('0x1b9'),'foreignKey':_0x666d('0x1b6')});db[_0x666d('0x9b')][_0x666d('0x108')](db['SalesforceField'],{'as':_0x666d('0x1ba'),'foreignKey':_0x666d('0x1b7')});db[_0x666d('0x9b')][_0x666d('0x115')](db[_0x666d('0x8e')],{'as':_0x666d('0x8e'),'foreignKey':_0x666d('0x1bb')});db['SugarcrmAccount'][_0x666d('0x108')](db[_0x666d('0x9e')],{'as':_0x666d('0x1bc'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b3')});db['SugarcrmConfiguration'][_0x666d('0x108')](db[_0x666d('0x9f')],{'as':'Subjects','onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b4')});db[_0x666d('0x9e')][_0x666d('0x108')](db[_0x666d('0x9f')],{'as':_0x666d('0x1b5'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b6')});db[_0x666d('0x9e')][_0x666d('0x108')](db[_0x666d('0x9f')],{'as':_0x666d('0x1b0'),'onDelete':_0x666d('0x105'),'foreignKey':'FieldId'});db[_0x666d('0x9e')][_0x666d('0x115')](db['SugarcrmAccount'],{'as':_0x666d('0x15f'),'foreignKey':'AccountId'});db[_0x666d('0x9f')][_0x666d('0x108')](db[_0x666d('0x9f')],{'as':_0x666d('0x1b8'),'foreignKey':_0x666d('0x1b4')});db[_0x666d('0x9f')][_0x666d('0x108')](db[_0x666d('0x9f')],{'as':_0x666d('0x1b9'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0x666d('0x108')](db[_0x666d('0x9f')],{'as':_0x666d('0x1ba'),'foreignKey':_0x666d('0x1b7')});db[_0x666d('0x9f')][_0x666d('0x115')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['DeskAccount'][_0x666d('0x108')](db['DeskConfiguration'],{'as':_0x666d('0x1bc'),'onDelete':'cascade','foreignKey':_0x666d('0x1b3')});db[_0x666d('0xa1')][_0x666d('0x108')](db[_0x666d('0xa3')],{'as':_0x666d('0x1bd'),'onDelete':'cascade','foreignKey':_0x666d('0x1b4')});db[_0x666d('0xa1')]['hasMany'](db[_0x666d('0xa3')],{'as':_0x666d('0x1b5'),'onDelete':_0x666d('0x105'),'foreignKey':'DescriptionId'});db[_0x666d('0xa1')]['hasMany'](db['DeskField'],{'as':_0x666d('0x1b0'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b7')});db['DeskConfiguration'][_0x666d('0x115')](db[_0x666d('0xa0')],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x1b3')});db[_0x666d('0xa1')][_0x666d('0x11c')](db[_0x666d('0x86')],{'through':'int_desk_configuration_has_tags'});db[_0x666d('0xa3')][_0x666d('0x108')](db[_0x666d('0xa3')],{'as':_0x666d('0x1b8'),'foreignKey':_0x666d('0x1b4')});db[_0x666d('0xa3')]['hasMany'](db['DeskField'],{'as':_0x666d('0x1b9'),'foreignKey':_0x666d('0x1b6')});db['DeskField'][_0x666d('0x108')](db[_0x666d('0xa3')],{'as':_0x666d('0x1ba'),'foreignKey':_0x666d('0x1b7')});db[_0x666d('0xa3')][_0x666d('0x115')](db[_0x666d('0x8e')],{'as':'Variable','foreignKey':_0x666d('0x1bb')});db[_0x666d('0xa5')][_0x666d('0x108')](db[_0x666d('0x1be')],{'as':_0x666d('0x1bc'),'onDelete':'cascade','foreignKey':'AccountId'});db['ZohoConfiguration'][_0x666d('0x108')](db[_0x666d('0xa8')],{'as':_0x666d('0x1bd'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b4')});db[_0x666d('0x1be')][_0x666d('0x108')](db[_0x666d('0xa8')],{'as':'Descriptions','onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b6')});db[_0x666d('0x1be')][_0x666d('0x108')](db[_0x666d('0xa8')],{'as':'Fields','onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b7')});db[_0x666d('0x1be')][_0x666d('0x115')](db['ZohoAccount'],{'as':_0x666d('0x15f'),'foreignKey':'AccountId'});db[_0x666d('0xa8')]['hasMany'](db[_0x666d('0xa8')],{'as':'Subject','foreignKey':_0x666d('0x1b4')});db[_0x666d('0xa8')]['hasMany'](db[_0x666d('0xa8')],{'as':_0x666d('0x1b9'),'foreignKey':'DescriptionId'});db[_0x666d('0xa8')][_0x666d('0x108')](db[_0x666d('0xa8')],{'as':_0x666d('0x1ba'),'foreignKey':_0x666d('0x1b7')});db[_0x666d('0xa8')]['belongsTo'](db[_0x666d('0x8e')],{'as':'Variable','foreignKey':_0x666d('0x1bb')});db[_0x666d('0xaa')]['hasMany'](db[_0x666d('0xab')],{'as':_0x666d('0x1bc'),'onDelete':_0x666d('0x105'),'foreignKey':'AccountId'});db[_0x666d('0xab')][_0x666d('0x108')](db[_0x666d('0x1bf')],{'as':'Subjects','foreignKey':_0x666d('0x1b4')});db[_0x666d('0xab')]['hasMany'](db['ZendeskField'],{'as':_0x666d('0x1b5'),'foreignKey':'DescriptionId'});db[_0x666d('0xab')][_0x666d('0x108')](db[_0x666d('0x1bf')],{'as':_0x666d('0x1b0'),'foreignKey':_0x666d('0x1b7')});db[_0x666d('0xab')][_0x666d('0x115')](db[_0x666d('0xaa')],{'as':'Account','foreignKey':'AccountId'});db[_0x666d('0xab')][_0x666d('0x11c')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0x666d('0x1bf')]['hasMany'](db[_0x666d('0x1bf')],{'as':'Subject','foreignKey':'SubjectId'});db['ZendeskField'][_0x666d('0x108')](db[_0x666d('0x1bf')],{'as':_0x666d('0x1b9'),'foreignKey':_0x666d('0x1b6')});db[_0x666d('0x1bf')]['hasMany'](db[_0x666d('0x1bf')],{'as':_0x666d('0x1ba'),'foreignKey':_0x666d('0x1b7')});db['ZendeskField'][_0x666d('0x115')](db['Variable'],{'as':'Variable','foreignKey':_0x666d('0x1bb')});db[_0x666d('0xae')][_0x666d('0x108')](db[_0x666d('0x1c0')],{'as':_0x666d('0x1bc'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x666d('0x1c0')][_0x666d('0x108')](db[_0x666d('0xb0')],{'as':_0x666d('0x1bd'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x666d('0x1c0')]['hasMany'](db[_0x666d('0xb0')],{'as':_0x666d('0x1b5'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b6')});db[_0x666d('0x1c0')][_0x666d('0x108')](db[_0x666d('0xb0')],{'as':_0x666d('0x1b0'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b7')});db[_0x666d('0x1c0')]['belongsTo'](db['FreshdeskAccount'],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x1b3')});db[_0x666d('0x1c0')]['belongsToMany'](db[_0x666d('0x86')],{'through':_0x666d('0x1c1')});db['FreshdeskField'][_0x666d('0x108')](db[_0x666d('0xb0')],{'as':'Subject','foreignKey':_0x666d('0x1b4')});db[_0x666d('0xb0')][_0x666d('0x108')](db['FreshdeskField'],{'as':_0x666d('0x1b9'),'foreignKey':_0x666d('0x1b6')});db[_0x666d('0xb0')][_0x666d('0x108')](db[_0x666d('0xb0')],{'as':_0x666d('0x1ba'),'foreignKey':_0x666d('0x1b7')});db['FreshdeskField'][_0x666d('0x115')](db[_0x666d('0x8e')],{'as':'Variable','foreignKey':_0x666d('0x1bb')});db['VtigerAccount'][_0x666d('0x108')](db[_0x666d('0xb4')],{'as':_0x666d('0x1bc'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b3')});db[_0x666d('0xb4')][_0x666d('0x108')](db[_0x666d('0xb5')],{'as':_0x666d('0x1bd'),'foreignKey':_0x666d('0x1b4')});db[_0x666d('0xb4')][_0x666d('0x108')](db['VtigerField'],{'as':'Descriptions','foreignKey':_0x666d('0x1b6')});db[_0x666d('0xb4')][_0x666d('0x108')](db[_0x666d('0xb5')],{'as':'Fields','foreignKey':'FieldId'});db['VtigerConfiguration'][_0x666d('0x115')](db[_0x666d('0xb2')],{'as':_0x666d('0x15f'),'foreignKey':'AccountId'});db[_0x666d('0xb5')][_0x666d('0x108')](db[_0x666d('0xb5')],{'as':_0x666d('0x1b8'),'foreignKey':'SubjectId'});db[_0x666d('0xb5')]['hasMany'](db[_0x666d('0xb5')],{'as':_0x666d('0x1b9'),'foreignKey':_0x666d('0x1b6')});db[_0x666d('0xb5')]['hasMany'](db['VtigerField'],{'as':_0x666d('0x1ba'),'foreignKey':'FieldId'});db[_0x666d('0xb5')][_0x666d('0x115')](db['Variable'],{'as':_0x666d('0x8e'),'foreignKey':_0x666d('0x1bb')});db[_0x666d('0x1c2')]['hasMany'](db[_0x666d('0xb8')],{'as':'Configurations','onDelete':_0x666d('0x105'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x666d('0x108')](db['ServicenowField'],{'as':'Subjects','foreignKey':_0x666d('0x1b4')});db[_0x666d('0xb8')]['hasMany'](db[_0x666d('0xba')],{'as':_0x666d('0x1b5'),'foreignKey':_0x666d('0x1b6')});db[_0x666d('0xb8')][_0x666d('0x108')](db['ServicenowField'],{'as':_0x666d('0x1b0'),'foreignKey':_0x666d('0x1b7')});db[_0x666d('0xb8')][_0x666d('0x115')](db[_0x666d('0x1c2')],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x1b3')});db[_0x666d('0xba')][_0x666d('0x108')](db[_0x666d('0xba')],{'as':_0x666d('0x1b8'),'foreignKey':_0x666d('0x1b4')});db[_0x666d('0xba')]['hasMany'](db[_0x666d('0xba')],{'as':_0x666d('0x1b9'),'foreignKey':_0x666d('0x1b6')});db[_0x666d('0xba')]['hasMany'](db[_0x666d('0xba')],{'as':'Field','foreignKey':_0x666d('0x1b7')});db['ServicenowField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['Dynamics365Account'][_0x666d('0x108')](db[_0x666d('0xbe')],{'as':_0x666d('0x1bc'),'onDelete':_0x666d('0x105'),'foreignKey':'AccountId'});db[_0x666d('0xbc')][_0x666d('0x115')](db[_0x666d('0xfb')],{'as':_0x666d('0xfb'),'foreignKey':_0x666d('0x154')});db['Dynamics365Configuration']['hasMany'](db[_0x666d('0x1c3')],{'as':_0x666d('0x1bd'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b4')});db[_0x666d('0xbe')][_0x666d('0x108')](db[_0x666d('0x1c3')],{'as':_0x666d('0x1b5'),'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b6')});db['Dynamics365Configuration'][_0x666d('0x108')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1b7')});db[_0x666d('0xbe')][_0x666d('0x115')](db['Dynamics365Account'],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x1b3')});db[_0x666d('0x1c3')][_0x666d('0x108')](db[_0x666d('0x1c3')],{'as':_0x666d('0x1b8'),'foreignKey':_0x666d('0x1b4')});db[_0x666d('0x1c3')][_0x666d('0x108')](db[_0x666d('0x1c3')],{'as':'Description','foreignKey':_0x666d('0x1b6')});db[_0x666d('0x1c3')][_0x666d('0x108')](db['Dynamics365Field'],{'as':_0x666d('0x1ba'),'foreignKey':_0x666d('0x1b7')});db['Dynamics365Field'][_0x666d('0x115')](db[_0x666d('0x8e')],{'as':'Variable','foreignKey':_0x666d('0x1bb')});db[_0x666d('0xc0')][_0x666d('0x108')](db['FreshsalesConfiguration'],{'as':_0x666d('0x1bc'),'onDelete':'cascade','foreignKey':'AccountId'});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x666d('0x1bd'),'foreignKey':_0x666d('0x1b4')});db['FreshsalesConfiguration']['hasMany'](db[_0x666d('0xc2')],{'as':_0x666d('0x1b5'),'foreignKey':_0x666d('0x1b6')});db[_0x666d('0x1c4')][_0x666d('0x108')](db[_0x666d('0xc2')],{'as':'Fields','foreignKey':_0x666d('0x1b7')});db[_0x666d('0x1c4')][_0x666d('0x115')](db[_0x666d('0xc0')],{'as':'Account','foreignKey':_0x666d('0x1b3')});db['FreshsalesField'][_0x666d('0x108')](db[_0x666d('0xc2')],{'as':_0x666d('0x1b8'),'foreignKey':_0x666d('0x1b4')});db['FreshsalesField'][_0x666d('0x108')](db[_0x666d('0xc2')],{'as':_0x666d('0x1b9'),'foreignKey':_0x666d('0x1b6')});db[_0x666d('0xc2')][_0x666d('0x108')](db[_0x666d('0xc2')],{'as':'Field','foreignKey':'FieldId'});db[_0x666d('0xc2')]['belongsTo'](db[_0x666d('0x8e')],{'as':_0x666d('0x8e'),'foreignKey':_0x666d('0x1bb')});db['ChatQueueReport'][_0x666d('0x115')](db[_0x666d('0x61')],{});db['ChatQueueReport'][_0x666d('0x115')](db[_0x666d('0x11d')],{'as':_0x666d('0x159'),'foreignKey':'ListId'});db['ChatQueueReport'][_0x666d('0x115')](db[_0x666d('0x119')],{'as':_0x666d('0x151'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x1c5')][_0x666d('0x115')](db[_0x666d('0x10d')],{});db[_0x666d('0x1c5')][_0x666d('0x115')](db[_0x666d('0x66')],{});db[_0x666d('0x1c5')][_0x666d('0x115')](db[_0x666d('0x12')],{});db[_0x666d('0x1c5')][_0x666d('0x115')](db[_0x666d('0x69')],{});db['ChatInternalMessage'][_0x666d('0x115')](db[_0x666d('0x12')],{'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1c6')});db['ChatInternalMessage']['belongsTo'](db['User'],{'onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1c7')});db[_0x666d('0xca')][_0x666d('0x108')](db[_0x666d('0xc8')],{'foreignKey':_0x666d('0x1c8'),'onDelete':_0x666d('0x105')});db[_0x666d('0xca')][_0x666d('0x108')](db[_0x666d('0xc7')],{'foreignKey':_0x666d('0x1c8'),'onDelete':_0x666d('0x105')});db[_0x666d('0x1c9')][_0x666d('0x115')](db['SmsAccount'],{});db[_0x666d('0x1c9')][_0x666d('0x115')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x666d('0x1c9')]['belongsTo'](db[_0x666d('0x119')],{'as':'Contact','foreignKey':_0x666d('0x152')});db[_0x666d('0x1c9')][_0x666d('0x115')](db[_0x666d('0x57')],{});db[_0x666d('0x1c9')][_0x666d('0x115')](db[_0x666d('0x59')],{});db['SmsQueueReport']['belongsTo'](db[_0x666d('0x12')],{});db[_0x666d('0x1c9')][_0x666d('0x115')](db[_0x666d('0x5b')],{});db['JscriptyProject'][_0x666d('0x108')](db[_0x666d('0xca')],{'foreignKey':_0x666d('0x1ca')});db[_0x666d('0x1cb')][_0x666d('0x108')](db['JscriptyQuestionReport'],{'foreignKey':_0x666d('0x1ca')});db[_0x666d('0x1cb')][_0x666d('0x108')](db['JscriptyAnswerReport'],{'foreignKey':_0x666d('0x1ca')});db[_0x666d('0xd3')][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':'Users','through':'user_has_square_projects'});db[_0x666d('0xd8')][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':'Agents','through':_0x666d('0x11f')});db[_0x666d('0xd8')]['belongsToMany'](db[_0x666d('0x1b')],{'through':_0x666d('0xfd'),'as':_0x666d('0x125')});db[_0x666d('0xd8')][_0x666d('0x11c')](db[_0x666d('0x40')],{'through':_0x666d('0x15d'),'as':_0x666d('0x1cc')});db[_0x666d('0xd8')][_0x666d('0x11c')](db[_0x666d('0x69')],{'through':_0x666d('0x186'),'as':_0x666d('0x127')});db[_0x666d('0xd8')][_0x666d('0x11c')](db[_0x666d('0x50')],{'through':_0x666d('0x170'),'as':_0x666d('0x128')});db[_0x666d('0xd8')]['belongsToMany'](db[_0x666d('0x5b')],{'through':_0x666d('0x176'),'as':'SmsQueues'});db[_0x666d('0xd8')][_0x666d('0x11c')](db['OpenchannelQueue'],{'through':_0x666d('0x17c'),'as':_0x666d('0x12b')});db['Team']['belongsToMany'](db[_0x666d('0xf9')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db['Team'][_0x666d('0x11c')](db['VoicePrefix'],{'through':_0x666d('0x1cd'),'as':_0x666d('0x126')});db[_0x666d('0xdc')][_0x666d('0x108')](db[_0x666d('0x6f')],{'as':_0x666d('0x13e'),'foreignKey':_0x666d('0x194')});db[_0x666d('0xdc')][_0x666d('0x108')](db[_0x666d('0x72')],{'as':'HopperFinals','foreignKey':_0x666d('0x194')});db[_0x666d('0xdc')][_0x666d('0x108')](db[_0x666d('0x73')],{'as':_0x666d('0x1ce'),'foreignKey':_0x666d('0x194')});db[_0x666d('0xdc')][_0x666d('0x108')](db[_0x666d('0x71')],{'as':_0x666d('0x140'),'foreignKey':'CampaignId'});db[_0x666d('0xdc')][_0x666d('0x115')](db['Trunk'],{'as':_0x666d('0x2b'),'foreignKey':_0x666d('0x142')});db[_0x666d('0xdc')][_0x666d('0x115')](db['Trunk'],{'as':_0x666d('0x143'),'foreignKey':_0x666d('0x1cf')});db['Campaign'][_0x666d('0x115')](db['Interval'],{'as':'Interval','foreignKey':_0x666d('0x167')});db[_0x666d('0xdc')][_0x666d('0x115')](db[_0x666d('0xd3')],{'as':_0x666d('0xd3'),'foreignKey':_0x666d('0x1d0')});db[_0x666d('0xdc')][_0x666d('0x11c')](db['CmList'],{'as':_0x666d('0x11e'),'through':_0x666d('0x1d1')});db['Campaign']['belongsToMany'](db[_0x666d('0x11d')],{'as':_0x666d('0x149'),'through':_0x666d('0x1d2')});db[_0x666d('0x16e')][_0x666d('0x115')](db[_0x666d('0x166')],{'as':_0x666d('0x166'),'foreignKey':'ChatOfflineMessageId'});db[_0x666d('0xdf')]['belongsTo'](db['MailMessage'],{});db['MailTransferReport']['belongsTo'](db[_0x666d('0x41')],{});db[_0x666d('0xdf')][_0x666d('0x115')](db['MailAccount'],{'foreignKey':_0x666d('0x1d3'),'as':_0x666d('0x1d4')});db[_0x666d('0xdf')]['belongsTo'](db[_0x666d('0x12')],{'foreignKey':_0x666d('0x1d5'),'as':_0x666d('0x1d6')});db[_0x666d('0xdf')][_0x666d('0x115')](db[_0x666d('0x12')],{'foreignKey':_0x666d('0x1d7'),'as':_0x666d('0x1d8')});db['MailTransferReport']['belongsTo'](db[_0x666d('0x40')],{'foreignKey':'ToMailQueueId','as':_0x666d('0x1d9')});db[_0x666d('0xdf')][_0x666d('0x115')](db[_0x666d('0x3f')],{'foreignKey':_0x666d('0x1da'),'as':_0x666d('0x1db')});db[_0x666d('0x1dc')][_0x666d('0x115')](db[_0x666d('0x66')],{});db[_0x666d('0x1dc')]['belongsTo'](db[_0x666d('0x10d')],{});db[_0x666d('0x1dc')][_0x666d('0x115')](db[_0x666d('0x61')],{'foreignKey':_0x666d('0x1dd'),'as':'FromAccount'});db[_0x666d('0x1dc')][_0x666d('0x115')](db[_0x666d('0x12')],{'foreignKey':_0x666d('0x1d5'),'as':_0x666d('0x1d6')});db[_0x666d('0x1dc')][_0x666d('0x115')](db[_0x666d('0x12')],{'foreignKey':'ToUserId','as':_0x666d('0x1d8')});db[_0x666d('0x1dc')][_0x666d('0x115')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x666d('0x1d9')});db[_0x666d('0x1dc')][_0x666d('0x115')](db[_0x666d('0x61')],{'foreignKey':_0x666d('0x1de'),'as':_0x666d('0x1db')});db['FaxTransferReport'][_0x666d('0x115')](db[_0x666d('0x4f')],{});db[_0x666d('0xe2')][_0x666d('0x115')](db[_0x666d('0x110')],{});db[_0x666d('0xe2')][_0x666d('0x115')](db[_0x666d('0x4c')],{'foreignKey':_0x666d('0x1df'),'as':_0x666d('0x1d4')});db['FaxTransferReport']['belongsTo'](db[_0x666d('0x12')],{'foreignKey':_0x666d('0x1d5'),'as':_0x666d('0x1d6')});db[_0x666d('0xe2')][_0x666d('0x115')](db['User'],{'foreignKey':_0x666d('0x1d7'),'as':_0x666d('0x1d8')});db[_0x666d('0xe2')][_0x666d('0x115')](db[_0x666d('0x50')],{'foreignKey':_0x666d('0x1e0'),'as':_0x666d('0x1d9')});db[_0x666d('0xe2')][_0x666d('0x115')](db[_0x666d('0x4c')],{'foreignKey':_0x666d('0x1e1'),'as':_0x666d('0x1db')});db['OpenchannelTransferReport'][_0x666d('0x115')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x666d('0x5f')],{});db[_0x666d('0xe4')][_0x666d('0x115')](db[_0x666d('0x5d')],{'foreignKey':'FromOpenchannelAccountId','as':_0x666d('0x1d4')});db[_0x666d('0xe4')][_0x666d('0x115')](db[_0x666d('0x12')],{'foreignKey':_0x666d('0x1d5'),'as':_0x666d('0x1d6')});db[_0x666d('0xe4')]['belongsTo'](db[_0x666d('0x12')],{'foreignKey':_0x666d('0x1d7'),'as':_0x666d('0x1d8')});db[_0x666d('0xe4')]['belongsTo'](db[_0x666d('0x12a')],{'foreignKey':_0x666d('0x1e2'),'as':_0x666d('0x1d9')});db[_0x666d('0xe4')][_0x666d('0x115')](db[_0x666d('0x5d')],{'foreignKey':_0x666d('0x1e3'),'as':_0x666d('0x1db')});db['SmsTransferReport'][_0x666d('0x115')](db[_0x666d('0x59')],{});db[_0x666d('0xe6')][_0x666d('0x115')](db[_0x666d('0x57')],{});db[_0x666d('0xe6')][_0x666d('0x115')](db[_0x666d('0x53')],{'foreignKey':'FromSmsAccountId','as':_0x666d('0x1d4')});db[_0x666d('0xe6')]['belongsTo'](db[_0x666d('0x12')],{'foreignKey':_0x666d('0x1d5'),'as':_0x666d('0x1d6')});db[_0x666d('0xe6')][_0x666d('0x115')](db[_0x666d('0x12')],{'foreignKey':_0x666d('0x1d7'),'as':_0x666d('0x1d8')});db['SmsTransferReport'][_0x666d('0x115')](db[_0x666d('0x5b')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db['SmsTransferReport'][_0x666d('0x115')](db[_0x666d('0x53')],{'foreignKey':_0x666d('0x1e4'),'as':'ToAccount'});db['CmList']['hasMany'](db['Disposition'],{'as':_0x666d('0x156'),'foreignKey':_0x666d('0x15a'),'onDelete':_0x666d('0x105')});db[_0x666d('0x11d')][_0x666d('0x108')](db[_0x666d('0x76')],{'as':'CustomFields','foreignKey':_0x666d('0x15a')});db[_0x666d('0x11d')]['hasMany'](db[_0x666d('0x119')],{'as':'Contacts','onDelete':_0x666d('0x105'),'foreignKey':'ListId'});db['CmList'][_0x666d('0x108')](db[_0x666d('0x72')],{'as':_0x666d('0x18d'),'foreignKey':_0x666d('0x15a')});db[_0x666d('0x11d')]['hasMany'](db[_0x666d('0x73')],{'as':_0x666d('0x1e5'),'foreignKey':_0x666d('0x15a')});db['CmList']['hasMany'](db[_0x666d('0x74')],{'as':_0x666d('0x74'),'foreignKey':_0x666d('0x15a')});db[_0x666d('0x11d')]['belongsToMany'](db[_0x666d('0x1b')],{'as':_0x666d('0x1e6'),'through':'voice_queues_has_cm_lists'});db[_0x666d('0x11d')][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':'Agents','through':_0x666d('0x12c')});db[_0x666d('0xe8')][_0x666d('0x108')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0x666d('0x105')});db[_0x666d('0xe8')][_0x666d('0x11c')](db['User'],{'as':_0x666d('0x147'),'through':_0x666d('0x100')});db[_0x666d('0xe8')][_0x666d('0x11c')](db['Team'],{'through':'TeamVoicePrefix','as':_0x666d('0x148')});db[_0x666d('0xea')][_0x666d('0x108')](db[_0x666d('0x12')],{'as':_0x666d('0x163'),'foreignKey':_0x666d('0x116')});db[_0x666d('0xea')]['hasMany'](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0x666d('0x116'),'onDelete':_0x666d('0x105')});db[_0x666d('0xec')][_0x666d('0x108')](db[_0x666d('0x1e7')],{'as':'Resources','foreignKey':_0x666d('0x1e8'),'onDelete':_0x666d('0x105')});db['WhatsappAccount'][_0x666d('0x108')](db['Disposition'],{'as':'Dispositions','foreignKey':'WhatsappAccountId','onDelete':_0x666d('0x105')});db['WhatsappAccount']['hasMany'](db['CannedAnswer'],{'as':_0x666d('0x157'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x666d('0x108')](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0x666d('0x1e9')});db[_0x666d('0xf0')]['hasMany'](db['WhatsappInteraction'],{'as':_0x666d('0x158')});db[_0x666d('0xf0')]['hasMany'](db['WhatsappApplication'],{'as':'Applications'});db[_0x666d('0xf0')]['belongsTo'](db[_0x666d('0x11d')],{'as':_0x666d('0x159'),'foreignKey':_0x666d('0x15a')});db[_0x666d('0xf0')][_0x666d('0x115')](db['Pause'],{'as':_0x666d('0x144'),'foreignKey':_0x666d('0x145')});db[_0x666d('0xf0')][_0x666d('0x11c')](db['User'],{'as':_0x666d('0x147'),'through':'user_has_whatsapp_accounts'});db[_0x666d('0xf2')][_0x666d('0x115')](db[_0x666d('0x12')],{'onDelete':'restrict'});db[_0x666d('0xf2')]['belongsTo'](db[_0x666d('0xf9')],{'onDelete':_0x666d('0x155')});db[_0x666d('0xf2')][_0x666d('0x115')](db[_0x666d('0xf0')],{'onDelete':_0x666d('0x155')});db[_0x666d('0xf2')][_0x666d('0x115')](db[_0x666d('0x7f')],{'onDelete':_0x666d('0x155'),'foreignKey':'IntervalId'});db[_0x666d('0xf2')][_0x666d('0x115')](db[_0x666d('0x86')],{'onDelete':_0x666d('0x155'),'foreignKey':_0x666d('0x16b')});db[_0x666d('0xf4')]['hasMany'](db['WhatsappMessage'],{'as':'Messages','onDelete':_0x666d('0x105'),'foreignKey':_0x666d('0x1ea')});db['WhatsappInteraction'][_0x666d('0x115')](db[_0x666d('0xf0')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x666d('0xf4')][_0x666d('0x115')](db[_0x666d('0x119')],{'as':'Contact','foreignKey':_0x666d('0x152')});db['WhatsappInteraction'][_0x666d('0x115')](db[_0x666d('0x12')],{'as':_0x666d('0x160'),'foreignKey':_0x666d('0x106')});db[_0x666d('0xf4')]['belongsToMany'](db['Tag'],{'through':_0x666d('0x1a5'),'as':_0x666d('0x162')});db[_0x666d('0xf4')][_0x666d('0x11c')](db[_0x666d('0x86')],{'through':_0x666d('0x1a5'),'as':_0x666d('0x191')});db[_0x666d('0xf4')][_0x666d('0x11c')](db[_0x666d('0x12')],{'as':'Users','through':_0x666d('0x1eb'),'foreignKey':_0x666d('0x1ea')});db[_0x666d('0x1ec')][_0x666d('0x115')](db[_0x666d('0x12')],{'as':'User'});db[_0x666d('0x1ec')][_0x666d('0x115')](db[_0x666d('0x119')],{'onDelete':_0x666d('0x105'),'as':_0x666d('0x151')});db[_0x666d('0x1ec')][_0x666d('0x115')](db[_0x666d('0xf4')],{'onDelete':'cascade','as':_0x666d('0x164'),'foreignKey':_0x666d('0x1ea')});db[_0x666d('0x1ec')][_0x666d('0x115')](db['WhatsappAccount'],{'as':_0x666d('0x15f'),'foreignKey':_0x666d('0x1e9')});db[_0x666d('0x1ed')][_0x666d('0x115')](db[_0x666d('0xf0')],{});db[_0x666d('0x1ed')]['belongsTo'](db[_0x666d('0x11d')],{'as':'List','foreignKey':_0x666d('0x15a')});db[_0x666d('0x1ed')][_0x666d('0x115')](db[_0x666d('0x119')],{'as':_0x666d('0x151'),'foreignKey':_0x666d('0x152')});db[_0x666d('0x1ed')][_0x666d('0x115')](db[_0x666d('0xf4')],{});db[_0x666d('0x1ed')][_0x666d('0x115')](db[_0x666d('0xf9')],{});db[_0x666d('0x1ed')][_0x666d('0x115')](db[_0x666d('0x1ec')],{});db[_0x666d('0x1ed')]['belongsTo'](db[_0x666d('0x12')],{});db[_0x666d('0xf7')]['belongsTo'](db[_0x666d('0x1ec')],{});db[_0x666d('0xf7')][_0x666d('0x115')](db[_0x666d('0xf4')],{});db[_0x666d('0xf7')][_0x666d('0x115')](db[_0x666d('0xf0')],{'foreignKey':_0x666d('0x1ee'),'as':_0x666d('0x1d4')});db[_0x666d('0xf7')][_0x666d('0x115')](db[_0x666d('0xf0')],{'foreignKey':_0x666d('0x1ef'),'as':_0x666d('0x1db')});db['WhatsappTransferReport'][_0x666d('0x115')](db['WhatsappQueue'],{'foreignKey':_0x666d('0x1f0'),'as':'ToQueue'});db['WhatsappTransferReport'][_0x666d('0x115')](db[_0x666d('0x12')],{'foreignKey':'FromUserId','as':_0x666d('0x1d6')});db[_0x666d('0xf7')][_0x666d('0x115')](db[_0x666d('0x12')],{'foreignKey':_0x666d('0x1d7'),'as':_0x666d('0x1d8')});db[_0x666d('0xf9')]['belongsToMany'](db[_0x666d('0x12')],{'as':'Agents','through':_0x666d('0x3a'),'foreignKey':'WhatsappQueueId'});db[_0x666d('0xf9')]['belongsToMany'](db[_0x666d('0xd8')],{'through':_0x666d('0x1f1'),'as':_0x666d('0x148')});db[_0x666d('0x102')][_0x666d('0x115')](db[_0x666d('0x12')],{'as':'user','foreignKey':_0x666d('0x106'),'onDelete':'cascade','hooks':!![]});db[_0x666d('0xfb')][_0x666d('0x104')](db[_0x666d('0xbc')],{'as':_0x666d('0xbc'),'onDelete':_0x666d('0x155')});db[_0x666d('0xfb')][_0x666d('0x104')](db[_0x666d('0x3b')],{'as':_0x666d('0x1f2'),'onDelete':'restrict'});db['CloudProvider']['hasOne'](db[_0x666d('0x3d')],{'as':_0x666d('0x1f3'),'onDelete':'restrict'});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 9f10a18..8a863ea 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a6b=['/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','./api/team','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authActiveDirectory','/api/jira','/api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','get','sendFile','resolve','/index.html','path','express','./errors','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./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/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','./api/faxQueueReport','/api/sms/accounts','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/applications','/api/chat/interactions','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/template','/api/triggers','./api/trigger','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./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/chatInternalMessage'];(function(_0x28c648,_0x2fe756){var _0x11e77e=function(_0x5b54e7){while(--_0x5b54e7){_0x28c648['push'](_0x28c648['shift']());}};_0x11e77e(++_0x2fe756);}(_0x5a6b,0x160));var _0xb5a6=function(_0x5e7093,_0x4f4ed7){_0x5e7093=_0x5e7093-0x0;var _0x41cf2e=_0x5a6b[_0x5e7093];return _0x41cf2e;};'use strict';var path=require(_0xb5a6('0x0'));var express=require(_0xb5a6('0x1'));var errors=require(_0xb5a6('0x2'));var config=require('./config/environment');var setupLoggers=require(_0xb5a6('0x3'))[_0xb5a6('0x4')];var clientSideLogs=require(_0xb5a6('0x5'));exports[_0xb5a6('0x6')]=function(_0x18ea58){return setupLoggers(_0x18ea58)[_0xb5a6('0x7')](function(){_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x9'),require(_0xb5a6('0xa')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xb'),require(_0xb5a6('0xc')));_0x18ea58['use']('/api/voice/contexts',require(_0xb5a6('0xd')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xe'),require(_0xb5a6('0xf')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x10'),require(_0xb5a6('0x11')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x12'),require(_0xb5a6('0x13')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x14'),require('./api/voiceRecording'));_0x18ea58[_0xb5a6('0x8')]('/api/screen/recordings',require('./api/screenRecording'));_0x18ea58[_0xb5a6('0x8')]('/api/voice/mails',require('./api/voiceMail'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x15'),require(_0xb5a6('0x16')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x17'),require('./api/voiceCallReport'));_0x18ea58[_0xb5a6('0x8')]('/api/voice/dials/reports',require(_0xb5a6('0x18')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x19'),require('./api/voiceAgentReport'));_0x18ea58['use'](_0xb5a6('0x1a'),require(_0xb5a6('0x1b')));_0x18ea58[_0xb5a6('0x8')]('/api/members/reports',require(_0xb5a6('0x1c')));_0x18ea58[_0xb5a6('0x8')]('/api/trunks',require(_0xb5a6('0x1d')));_0x18ea58[_0xb5a6('0x8')]('/api/voice/transfers/reports',require(_0xb5a6('0x1e')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x1f'),require(_0xb5a6('0x20')));_0x18ea58['use'](_0xb5a6('0x21'),require(_0xb5a6('0x22')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x23'),require(_0xb5a6('0x24')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x25'),require(_0xb5a6('0x26')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x27'),require(_0xb5a6('0x28')));_0x18ea58['use'](_0xb5a6('0x29'),require('./api/mailMessage'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x2a'),require(_0xb5a6('0x2b')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x2c'),require(_0xb5a6('0x2d')));_0x18ea58['use']('/api/dashboards',require(_0xb5a6('0x2e')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x2f'),require(_0xb5a6('0x30')));_0x18ea58[_0xb5a6('0x8')]('/api/fax/accounts',require(_0xb5a6('0x31')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x32'),require(_0xb5a6('0x33')));_0x18ea58['use']('/api/fax/interactions',require(_0xb5a6('0x34')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x35'),require(_0xb5a6('0x36')));_0x18ea58[_0xb5a6('0x8')]('/api/fax/queues',require('./api/faxQueue'));_0x18ea58[_0xb5a6('0x8')]('/api/fax/reports/queue',require(_0xb5a6('0x37')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x38'),require('./api/smsAccount'));_0x18ea58[_0xb5a6('0x8')]('/api/sms/applications',require(_0xb5a6('0x39')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x3a'),require(_0xb5a6('0x3b')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x3c'),require(_0xb5a6('0x3d')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x3e'),require(_0xb5a6('0x3f')));_0x18ea58[_0xb5a6('0x8')]('/api/openchannel/accounts',require(_0xb5a6('0x40')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x41'),require(_0xb5a6('0x42')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x43'),require(_0xb5a6('0x44')));_0x18ea58[_0xb5a6('0x8')]('/api/openchannel/messages',require(_0xb5a6('0x45')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x46'),require(_0xb5a6('0x47')));_0x18ea58[_0xb5a6('0x8')]('/api/chat/websites',require('./api/chatWebsite'));_0x18ea58[_0xb5a6('0x8')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x48'),require('./api/chatApplication'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x49'),require('./api/chatInteraction'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x4a'),require('./api/chatMessage'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x4b'),require(_0xb5a6('0x4c')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x4d'),require('./api/chatQueue'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x4e'),require(_0xb5a6('0x4f')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x50'),require(_0xb5a6('0x51')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x52'),require(_0xb5a6('0x53')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x54'),require(_0xb5a6('0x55')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x56'),require(_0xb5a6('0x57')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x58'),require(_0xb5a6('0x59')));_0x18ea58['use']('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x5a'),require('./api/cmHopperHistory'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x5b'),require('./api/cmCustomField'));_0x18ea58['use'](_0xb5a6('0x5c'),require(_0xb5a6('0x5d')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x5e'),require('./api/automation'));_0x18ea58['use'](_0xb5a6('0x5f'),require(_0xb5a6('0x60')));_0x18ea58[_0xb5a6('0x8')]('/api/dispositions',require(_0xb5a6('0x61')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x62'),require(_0xb5a6('0x63')));_0x18ea58[_0xb5a6('0x8')]('/api/intervals',require(_0xb5a6('0x64')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x65'),require('./api/pause'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x66'),require(_0xb5a6('0x67')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x68'),require(_0xb5a6('0x69')));_0x18ea58['use']('/api/schedules',require('./api/schedule'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x6a'),require(_0xb5a6('0x6b')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x6c'),require(_0xb5a6('0x6d')));_0x18ea58['use'](_0xb5a6('0x6e'),require(_0xb5a6('0x6f')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x70'),require('./api/cmContactHasItem'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x71'),require('./api/cmHopperAdditionalPhone'));_0x18ea58[_0xb5a6('0x8')]('/api/templates',require(_0xb5a6('0x72')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x73'),require(_0xb5a6('0x74')));_0x18ea58[_0xb5a6('0x8')]('/api/variables',require('./api/variable'));_0x18ea58['use'](_0xb5a6('0x75'),require(_0xb5a6('0x76')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x77'),require('./api/integrationReport'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x78'),require(_0xb5a6('0x79')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x7a'),require(_0xb5a6('0x7b')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x7c'),require('./api/analyticExtractedReport'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x7d'),require(_0xb5a6('0x7e')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x7f'),require('./api/analyticFieldReport'));_0x18ea58[_0xb5a6('0x8')]('/api/analytics/tree_reports',require(_0xb5a6('0x80')));_0x18ea58['use'](_0xb5a6('0x81'),require(_0xb5a6('0x82')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x83'),require(_0xb5a6('0x84')));_0x18ea58['use'](_0xb5a6('0x85'),require('./api/intSalesforceField'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x86'),require(_0xb5a6('0x87')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x88'),require('./api/intSugarcrmConfiguration'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x89'),require(_0xb5a6('0x8a')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x8b'),require('./api/intDeskAccount'));_0x18ea58[_0xb5a6('0x8')]('/api/integrations/desk/configurations',require(_0xb5a6('0x8c')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x8d'),require(_0xb5a6('0x8e')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x8f'),require(_0xb5a6('0x90')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x91'),require(_0xb5a6('0x92')));_0x18ea58['use'](_0xb5a6('0x93'),require(_0xb5a6('0x94')));_0x18ea58['use'](_0xb5a6('0x95'),require(_0xb5a6('0x96')));_0x18ea58[_0xb5a6('0x8')]('/api/integrations/zendesk/configurations',require(_0xb5a6('0x97')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x98'),require(_0xb5a6('0x99')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x9a'),require(_0xb5a6('0x9b')));_0x18ea58[_0xb5a6('0x8')]('/api/integrations/freshdesk/configurations',require(_0xb5a6('0x9c')));_0x18ea58[_0xb5a6('0x8')]('/api/integrations/freshdesk/fields',require(_0xb5a6('0x9d')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x9e'),require(_0xb5a6('0x9f')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xa0'),require(_0xb5a6('0xa1')));_0x18ea58['use']('/api/integrations/vtiger/fields',require(_0xb5a6('0xa2')));_0x18ea58[_0xb5a6('0x8')]('/api/integrations/servicenow/accounts',require(_0xb5a6('0xa3')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xa4'),require(_0xb5a6('0xa5')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xa6'),require(_0xb5a6('0xa7')));_0x18ea58[_0xb5a6('0x8')]('/api/integrations/dynamics365/accounts',require(_0xb5a6('0xa8')));_0x18ea58['use'](_0xb5a6('0xa9'),require(_0xb5a6('0xaa')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xab'),require(_0xb5a6('0xac')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xad'),require(_0xb5a6('0xae')));_0x18ea58['use'](_0xb5a6('0xaf'),require(_0xb5a6('0xb0')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xb1'),require(_0xb5a6('0xb2')));_0x18ea58[_0xb5a6('0x8')]('/api/networks',require('./api/network'));_0x18ea58[_0xb5a6('0x8')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x18ea58[_0xb5a6('0x8')]('/api/chat/internal/messages',require(_0xb5a6('0xb3')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xb4'),require(_0xb5a6('0xb5')));_0x18ea58['use'](_0xb5a6('0xb6'),require('./api/jscriptyQuestionReport'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xb7'),require(_0xb5a6('0xb8')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xb9'),require(_0xb5a6('0xba')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xbb'),require(_0xb5a6('0xbc')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xbd'),require(_0xb5a6('0xbe')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xbf'),require(_0xb5a6('0xc0')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xc1'),require(_0xb5a6('0xc2')));_0x18ea58[_0xb5a6('0x8')]('/api/square/odbc',require(_0xb5a6('0xc3')));_0x18ea58[_0xb5a6('0x8')]('/api/square/projects',require(_0xb5a6('0xc4')));_0x18ea58['use'](_0xb5a6('0xc5'),require('./api/squareRecording'));_0x18ea58['use'](_0xb5a6('0xc6'),require(_0xb5a6('0xc7')));_0x18ea58[_0xb5a6('0x8')]('/api/teams',require(_0xb5a6('0xc8')));_0x18ea58[_0xb5a6('0x8')]('/api/license',require(_0xb5a6('0xc9')));_0x18ea58[_0xb5a6('0x8')]('/api/campaigns',require(_0xb5a6('0xca')));_0x18ea58['use'](_0xb5a6('0xcb'),require(_0xb5a6('0xcc')));_0x18ea58['use'](_0xb5a6('0xcd'),require('./api/attachment'));_0x18ea58[_0xb5a6('0x8')]('/api/plugins',require(_0xb5a6('0xce')));_0x18ea58['use'](_0xb5a6('0xcf'),require(_0xb5a6('0xd0')));_0x18ea58[_0xb5a6('0x8')]('/api/chat/reports/transfer',require(_0xb5a6('0xd1')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xd2'),require(_0xb5a6('0xd3')));_0x18ea58[_0xb5a6('0x8')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xd4'),require(_0xb5a6('0xd5')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xd6'),require(_0xb5a6('0xd7')));_0x18ea58['use']('/api/voice/prefixes',require(_0xb5a6('0xd8')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xd9'),require(_0xb5a6('0xda')));_0x18ea58[_0xb5a6('0x8')]('/api/userProfile/sections',require(_0xb5a6('0xdb')));_0x18ea58['use'](_0xb5a6('0xdc'),require(_0xb5a6('0xdd')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xde'),require(_0xb5a6('0xdf')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xe0'),require(_0xb5a6('0xe1')));_0x18ea58['use'](_0xb5a6('0xe2'),require(_0xb5a6('0xe3')));_0x18ea58[_0xb5a6('0x8')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x18ea58[_0xb5a6('0x8')]('/api/whatsapp/messages',require(_0xb5a6('0xe4')));_0x18ea58['use']('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xe5'),require(_0xb5a6('0xe6')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xe7'),require(_0xb5a6('0xe8')));_0x18ea58['use'](_0xb5a6('0xe9'),require(_0xb5a6('0xea')));_0x18ea58['use'](_0xb5a6('0xeb'),require('./api/realtime'));_0x18ea58['use'](_0xb5a6('0xec'),require(_0xb5a6('0xed')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xee'),require(_0xb5a6('0xef')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xf0'),require('./api/authGoogle'));_0x18ea58[_0xb5a6('0x8')]('/api/auth/activedirectory',require(_0xb5a6('0xf1')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xf2'),require('./api/jira'));_0x18ea58['use'](_0xb5a6('0xf3'),require('./api/rpc'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xf4'),require(_0xb5a6('0xf5')));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xf6'),require('./api/system'));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0xf7'),require(_0xb5a6('0xf8')));_0x18ea58['use'](_0xb5a6('0xf9'),require(_0xb5a6('0xfa')));_0x18ea58['use']('/api/logs',clientSideLogs);_0x18ea58['use'](_0xb5a6('0xfb'),express[_0xb5a6('0xfc')](path[_0xb5a6('0xfd')](config[_0xb5a6('0xfe')],_0xb5a6('0xfb'))));_0x18ea58['use']('/www',express[_0xb5a6('0xfc')](path['join'](config[_0xb5a6('0xfe')],_0xb5a6('0xff'))));_0x18ea58[_0xb5a6('0x8')]('/demo',express[_0xb5a6('0xfc')](path['join'](config[_0xb5a6('0xfe')],_0xb5a6('0x100'))));_0x18ea58['use']('/snippet',express[_0xb5a6('0xfc')](path[_0xb5a6('0xfd')](config['root'],_0xb5a6('0x101'),_0xb5a6('0x102'))));_0x18ea58[_0xb5a6('0x8')](_0xb5a6('0x103'),express['static'](path[_0xb5a6('0xfd')](config[_0xb5a6('0xfe')],_0xb5a6('0x104'))));_0x18ea58['route']('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x18ea58[_0xb5a6('0x105')]('/*')[_0xb5a6('0x106')](function(_0x4cc5c6,_0x5f34c2){_0x5f34c2[_0xb5a6('0x107')](path[_0xb5a6('0x108')](_0x18ea58[_0xb5a6('0x106')]('appPath')+_0xb5a6('0x109')));});return _0x18ea58;});}; \ No newline at end of file +var _0xf749=['./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/reports/queue','/api/sms/accounts','./api/smsApplication','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/groups','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/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/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareMessage','./api/team','/api/license','./api/license','./api/campaign','/api/attachments','./api/attachment','/api/plugins','/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/cm/lists','./api/cmList','/api/voice/prefixes','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','path','express','./errors','./utils/client-side-logger','./api/client-side-logs','default','/api/users','./api/user','use','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions'];(function(_0x256b67,_0x14e47b){var _0x3e2d99=function(_0x4a4c5f){while(--_0x4a4c5f){_0x256b67['push'](_0x256b67['shift']());}};_0x3e2d99(++_0x14e47b);}(_0xf749,0x1dc));var _0x9f74=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf749[_0x122ef9];return _0x42fba0;};'use strict';var path=require(_0x9f74('0x0'));var express=require(_0x9f74('0x1'));var errors=require(_0x9f74('0x2'));var config=require('./config/environment');var setupLoggers=require(_0x9f74('0x3'))['setupLoggers'];var clientSideLogs=require(_0x9f74('0x4'));exports[_0x9f74('0x5')]=function(_0x5b8c50){return setupLoggers(_0x5b8c50)['then'](function(){_0x5b8c50['use'](_0x9f74('0x6'),require(_0x9f74('0x7')));_0x5b8c50[_0x9f74('0x8')]('/api/voice/chanspy',require(_0x9f74('0x9')));_0x5b8c50['use'](_0x9f74('0xa'),require(_0x9f74('0xb')));_0x5b8c50[_0x9f74('0x8')]('/api/voice/extensions',require('./api/voiceExtension'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xc'),require(_0x9f74('0xd')));_0x5b8c50['use'](_0x9f74('0xe'),require(_0x9f74('0xf')));_0x5b8c50[_0x9f74('0x8')]('/api/voice/recordings',require(_0x9f74('0x10')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x11'),require('./api/screenRecording'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x12'),require(_0x9f74('0x13')));_0x5b8c50['use']('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x14'),require(_0x9f74('0x15')));_0x5b8c50['use'](_0x9f74('0x16'),require(_0x9f74('0x17')));_0x5b8c50[_0x9f74('0x8')]('/api/voice/agents/reports',require(_0x9f74('0x18')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x19'),require('./api/voiceQueueReport'));_0x5b8c50['use']('/api/members/reports',require(_0x9f74('0x1a')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x1b'),require(_0x9f74('0x1c')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x1d'),require('./api/voiceTransferReport'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x1e'),require(_0x9f74('0x1f')));_0x5b8c50[_0x9f74('0x8')]('/api/mail/accounts',require(_0x9f74('0x20')));_0x5b8c50['use'](_0x9f74('0x21'),require(_0x9f74('0x22')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x23'),require(_0x9f74('0x24')));_0x5b8c50['use'](_0x9f74('0x25'),require(_0x9f74('0x26')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x27'),require(_0x9f74('0x28')));_0x5b8c50['use'](_0x9f74('0x29'),require(_0x9f74('0x2a')));_0x5b8c50[_0x9f74('0x8')]('/api/mail/reports/queue',require(_0x9f74('0x2b')));_0x5b8c50[_0x9f74('0x8')]('/api/dashboards',require(_0x9f74('0x2c')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x2d'),require('./api/dashboardItem'));_0x5b8c50[_0x9f74('0x8')]('/api/fax/accounts',require(_0x9f74('0x2e')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x2f'),require('./api/faxApplication'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x30'),require(_0x9f74('0x31')));_0x5b8c50[_0x9f74('0x8')]('/api/fax/messages',require(_0x9f74('0x32')));_0x5b8c50[_0x9f74('0x8')]('/api/fax/queues',require('./api/faxQueue'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x33'),require('./api/faxQueueReport'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x34'),require('./api/smsAccount'));_0x5b8c50[_0x9f74('0x8')]('/api/sms/applications',require(_0x9f74('0x35')));_0x5b8c50[_0x9f74('0x8')]('/api/sms/interactions',require('./api/smsInteraction'));_0x5b8c50[_0x9f74('0x8')]('/api/sms/messages',require('./api/smsMessage'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x36'),require(_0x9f74('0x37')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x38'),require(_0x9f74('0x39')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x3a'),require('./api/openchannelApplication'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x3b'),require(_0x9f74('0x3c')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x3d'),require(_0x9f74('0x3e')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x3f'),require(_0x9f74('0x40')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x41'),require(_0x9f74('0x42')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x43'),require('./api/openchannelQueueReport'));_0x5b8c50[_0x9f74('0x8')]('/api/chat/applications',require(_0x9f74('0x44')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x45'),require(_0x9f74('0x46')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x47'),require(_0x9f74('0x48')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x49'),require(_0x9f74('0x4a')));_0x5b8c50[_0x9f74('0x8')]('/api/chat/queues',require('./api/chatQueue'));_0x5b8c50['use'](_0x9f74('0x4b'),require('./api/chatGroup'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x4c'),require('./api/chatProactiveAction'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x4d'),require(_0x9f74('0x4e')));_0x5b8c50['use'](_0x9f74('0x4f'),require(_0x9f74('0x50')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x51'),require(_0x9f74('0x52')));_0x5b8c50['use'](_0x9f74('0x53'),require('./api/cmHopperBlack'));_0x5b8c50['use'](_0x9f74('0x54'),require('./api/cmHopperFinal'));_0x5b8c50['use'](_0x9f74('0x55'),require('./api/cmHopperHistory'));_0x5b8c50['use'](_0x9f74('0x56'),require(_0x9f74('0x57')));_0x5b8c50['use'](_0x9f74('0x58'),require(_0x9f74('0x59')));_0x5b8c50[_0x9f74('0x8')]('/api/automations',require(_0x9f74('0x5a')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x5b'),require('./api/cannedAnswer'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x5c'),require(_0x9f74('0x5d')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x5e'),require(_0x9f74('0x5f')));_0x5b8c50['use'](_0x9f74('0x60'),require(_0x9f74('0x61')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x62'),require(_0x9f74('0x63')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x64'),require(_0x9f74('0x65')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x66'),require(_0x9f74('0x67')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x68'),require('./api/schedule'));_0x5b8c50[_0x9f74('0x8')]('/api/sounds',require('./api/sound'));_0x5b8c50[_0x9f74('0x8')]('/api/tags',require('./api/tag'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x69'),require(_0x9f74('0x6a')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x6b'),require(_0x9f74('0x6c')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x6d'),require('./api/cmHopperAdditionalPhone'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x6e'),require('./api/template'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x6f'),require('./api/trigger'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x70'),require(_0x9f74('0x71')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x72'),require(_0x9f74('0x73')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x74'),require(_0x9f74('0x75')));_0x5b8c50['use'](_0x9f74('0x76'),require(_0x9f74('0x77')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x78'),require(_0x9f74('0x79')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x7a'),require(_0x9f74('0x7b')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x7c'),require(_0x9f74('0x7d')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x7e'),require(_0x9f74('0x7f')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x80'),require(_0x9f74('0x81')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x82'),require(_0x9f74('0x83')));_0x5b8c50['use'](_0x9f74('0x84'),require(_0x9f74('0x85')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x86'),require(_0x9f74('0x87')));_0x5b8c50[_0x9f74('0x8')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x5b8c50['use']('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x5b8c50[_0x9f74('0x8')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x88'),require(_0x9f74('0x89')));_0x5b8c50[_0x9f74('0x8')]('/api/integrations/desk/configurations',require(_0x9f74('0x8a')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x8b'),require(_0x9f74('0x8c')));_0x5b8c50['use'](_0x9f74('0x8d'),require('./api/intZohoAccount'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x8e'),require(_0x9f74('0x8f')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x90'),require(_0x9f74('0x91')));_0x5b8c50['use'](_0x9f74('0x92'),require(_0x9f74('0x93')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x94'),require('./api/intZendeskConfiguration'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x95'),require('./api/intZendeskField'));_0x5b8c50[_0x9f74('0x8')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x96'),require('./api/intFreshdeskConfiguration'));_0x5b8c50[_0x9f74('0x8')]('/api/integrations/freshdesk/fields',require(_0x9f74('0x97')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x98'),require(_0x9f74('0x99')));_0x5b8c50[_0x9f74('0x8')]('/api/integrations/vtiger/configurations',require(_0x9f74('0x9a')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x9b'),require('./api/intVtigerField'));_0x5b8c50['use'](_0x9f74('0x9c'),require(_0x9f74('0x9d')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x9e'),require('./api/intServicenowConfiguration'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0x9f'),require(_0x9f74('0xa0')));_0x5b8c50['use'](_0x9f74('0xa1'),require(_0x9f74('0xa2')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xa3'),require(_0x9f74('0xa4')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xa5'),require(_0x9f74('0xa6')));_0x5b8c50[_0x9f74('0x8')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x5b8c50[_0x9f74('0x8')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xa7'),require(_0x9f74('0xa8')));_0x5b8c50['use'](_0x9f74('0xa9'),require(_0x9f74('0xaa')));_0x5b8c50['use']('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x5b8c50[_0x9f74('0x8')]('/api/chat/internal/messages',require(_0x9f74('0xab')));_0x5b8c50['use'](_0x9f74('0xac'),require(_0x9f74('0xad')));_0x5b8c50[_0x9f74('0x8')]('/api/jscripty/questions/reports',require(_0x9f74('0xae')));_0x5b8c50['use']('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xaf'),require('./api/smsQueueReport'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xb0'),require(_0x9f74('0xb1')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xb2'),require(_0x9f74('0xb3')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xb4'),require('./api/jscriptyProject'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xb5'),require(_0x9f74('0xb6')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xb7'),require(_0x9f74('0xb8')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xb9'),require(_0x9f74('0xba')));_0x5b8c50['use'](_0x9f74('0xbb'),require('./api/squareRecording'));_0x5b8c50[_0x9f74('0x8')]('/api/square/messages',require(_0x9f74('0xbc')));_0x5b8c50[_0x9f74('0x8')]('/api/teams',require(_0x9f74('0xbd')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xbe'),require(_0x9f74('0xbf')));_0x5b8c50[_0x9f74('0x8')]('/api/campaigns',require(_0x9f74('0xc0')));_0x5b8c50[_0x9f74('0x8')]('/api/migrations',require('./api/migration'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xc1'),require(_0x9f74('0xc2')));_0x5b8c50['use'](_0x9f74('0xc3'),require('./api/plugin'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xc4'),require('./api/mailTransferReport'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xc5'),require(_0x9f74('0xc6')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xc7'),require(_0x9f74('0xc8')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xc9'),require(_0x9f74('0xca')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xcb'),require('./api/smsTransferReport'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xcc'),require(_0x9f74('0xcd')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xce'),require('./api/voicePrefix'));_0x5b8c50[_0x9f74('0x8')]('/api/userProfiles',require(_0x9f74('0xcf')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xd0'),require(_0x9f74('0xd1')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xd2'),require(_0x9f74('0xd3')));_0x5b8c50[_0x9f74('0x8')]('/api/userNotifications',require('./api/userNotification'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xd4'),require(_0x9f74('0xd5')));_0x5b8c50['use'](_0x9f74('0xd6'),require(_0x9f74('0xd7')));_0x5b8c50[_0x9f74('0x8')]('/api/whatsapp/interactions',require(_0x9f74('0xd8')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xd9'),require(_0x9f74('0xda')));_0x5b8c50['use'](_0x9f74('0xdb'),require(_0x9f74('0xdc')));_0x5b8c50['use'](_0x9f74('0xdd'),require(_0x9f74('0xde')));_0x5b8c50[_0x9f74('0x8')]('/api/whatsapp/queues',require(_0x9f74('0xdf')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xe0'),require('./api/cloudProvider'));_0x5b8c50['use']('/api/realtime',require('./api/realtime'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xe1'),require(_0x9f74('0xe2')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xe3'),require('./api/authLocal'));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xe4'),require(_0x9f74('0xe5')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xe6'),require('./api/authActiveDirectory'));_0x5b8c50['use'](_0x9f74('0xe7'),require(_0x9f74('0xe8')));_0x5b8c50[_0x9f74('0x8')]('/api/rpc',require(_0x9f74('0xe9')));_0x5b8c50[_0x9f74('0x8')]('/api/version',require(_0x9f74('0xea')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xeb'),require(_0x9f74('0xec')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xed'),require(_0x9f74('0xee')));_0x5b8c50['use'](_0x9f74('0xef'),require(_0x9f74('0xf0')));_0x5b8c50['use'](_0x9f74('0xf1'),clientSideLogs);_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xf2'),express[_0x9f74('0xf3')](path['join'](config[_0x9f74('0xf4')],_0x9f74('0xf2'))));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xf5'),express[_0x9f74('0xf3')](path[_0x9f74('0xf6')](config['root'],_0x9f74('0xf5'))));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xf7'),express[_0x9f74('0xf3')](path['join'](config[_0x9f74('0xf4')],'/demo')));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xf8'),express[_0x9f74('0xf3')](path[_0x9f74('0xf6')](config[_0x9f74('0xf4')],_0x9f74('0xf9'),_0x9f74('0xfa'))));_0x5b8c50[_0x9f74('0x8')](_0x9f74('0xfb'),express[_0x9f74('0xf3')](path['join'](config['root'],_0x9f74('0xfc'))));_0x5b8c50[_0x9f74('0xfd')](_0x9f74('0xfe'))[_0x9f74('0xff')](errors[0x194]);_0x5b8c50[_0x9f74('0xfd')]('/*')[_0x9f74('0xff')](function(_0x10a503,_0x1bc550){_0x1bc550[_0x9f74('0x100')](path['resolve'](_0x5b8c50[_0x9f74('0xff')]('appPath')+'/index.html'));});return _0x5b8c50;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index ed0aca5..c43d39e 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36c3=['../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.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/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/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/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc'];(function(_0x4679ef,_0x197d08){var _0x2a4852=function(_0x2b2e28){while(--_0x2b2e28){_0x4679ef['push'](_0x4679ef['shift']());}};_0x2a4852(++_0x197d08);}(_0x36c3,0x1a6));var _0x336c=function(_0x52711f,_0x4cf48b){_0x52711f=_0x52711f-0x0;var _0x736442=_0x36c3[_0x52711f];return _0x736442;};'use strict';var jayson=require(_0x336c('0x0'));var _=require(_0x336c('0x1'));var config=require('../config/environment');exports[_0x336c('0x2')]=function(){return new Promise(function(_0x34b4b2,_0x3368c2){var _0x194993={};_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x4')));_0x194993=_[_0x336c('0x3')](_0x194993,require('../api/voiceExtension/voiceExtension.rpc'));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x5')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x6')));_0x194993=_[_0x336c('0x3')](_0x194993,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x7')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x8')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x9')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0xa')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0xb')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0xc')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0xd')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0xe')));_0x194993=_[_0x336c('0x3')](_0x194993,require('../api/mailAccount/mailAccount.rpc'));_0x194993=_['merge'](_0x194993,require(_0x336c('0xf')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x10')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x11')));_0x194993=_[_0x336c('0x3')](_0x194993,require('../api/mailApplication/mailApplication.rpc'));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x12')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x13')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x14')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x15')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x16')));_0x194993=_[_0x336c('0x3')](_0x194993,require('../api/faxQueue/faxQueue.rpc'));_0x194993=_['merge'](_0x194993,require(_0x336c('0x17')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x18')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x19')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x1a')));_0x194993=_['merge'](_0x194993,require('../api/smsQueue/smsQueue.rpc'));_0x194993=_['merge'](_0x194993,require(_0x336c('0x1b')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x1c')));_0x194993=_['merge'](_0x194993,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x1d')));_0x194993=_[_0x336c('0x3')](_0x194993,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x1e')));_0x194993=_[_0x336c('0x3')](_0x194993,require('../api/chatMessage/chatMessage.rpc'));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x1f')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x20')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x21')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x22')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x23')));_0x194993=_[_0x336c('0x3')](_0x194993,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x24')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x25')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x26')));_0x194993=_[_0x336c('0x3')](_0x194993,require('../api/sound/sound.rpc'));_0x194993=_['merge'](_0x194993,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x27')));_0x194993=_['merge'](_0x194993,require('../api/trigger/trigger.rpc'));_0x194993=_['merge'](_0x194993,require(_0x336c('0x28')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x29')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x2a')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x2b')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x2c')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x2d')));_0x194993=_[_0x336c('0x3')](_0x194993,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x2e')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x2f')));_0x194993=_[_0x336c('0x3')](_0x194993,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x30')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x31')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x32')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x33')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x34')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x35')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x36')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x37')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x38')));_0x194993=_[_0x336c('0x3')](_0x194993,require('../api/squareMessage/squareMessage.rpc'));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x39')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x3a')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x3b')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x3c')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x3d')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x3e')));_0x194993=_[_0x336c('0x3')](_0x194993,require(_0x336c('0x3f')));_0x194993=_['merge'](_0x194993,require(_0x336c('0x40')));var _0x154bc0=jayson[_0x336c('0x41')](_0x194993)[_0x336c('0x42')]();var _0x5e351d=config[_0x336c('0x43')][_0x336c('0x44')]||config['port']+0x1;var _0xb9cbf9=config[_0x336c('0x43')]['ip']||_0x336c('0x45');_0x154bc0['on']('error',function(_0x16c6c6){return _0x3368c2(_0x16c6c6);});_0x154bc0[_0x336c('0x2')](_0x5e351d,_0xb9cbf9,function(){console[_0x336c('0x46')](_0x336c('0x47'),_0xb9cbf9,_0x5e351d);require(_0x336c('0x48'))[_0x336c('0x49')]();return _0x34b4b2(_0x336c('0x4a')+_0xb9cbf9+':'+_0x5e351d);});});}; \ No newline at end of file +var _0x1a2a=['server','http','rpc','error','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.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','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc'];(function(_0x4140a6,_0x493bb2){var _0x202fee=function(_0x14a1e7){while(--_0x14a1e7){_0x4140a6['push'](_0x4140a6['shift']());}};_0x202fee(++_0x493bb2);}(_0x1a2a,0xd3));var _0xa1a2=function(_0x2e47c1,_0x1bed12){_0x2e47c1=_0x2e47c1-0x0;var _0x1a0364=_0x1a2a[_0x2e47c1];return _0x1a0364;};'use strict';var jayson=require(_0xa1a2('0x0'));var _=require(_0xa1a2('0x1'));var config=require(_0xa1a2('0x2'));exports[_0xa1a2('0x3')]=function(){return new Promise(function(_0x54edf3,_0x6842fe){var _0x2ef467={};_0x2ef467=_['merge'](_0x2ef467,require(_0xa1a2('0x4')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x6')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/voiceQueue/voiceQueue.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/voiceRecording/voiceRecording.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x7')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x8')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x9')));_0x2ef467=_['merge'](_0x2ef467,require(_0xa1a2('0xa')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0xb')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0xc')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0xd')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0xe')));_0x2ef467=_['merge'](_0x2ef467,require(_0xa1a2('0xf')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x10')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x11')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x12')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x13')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x14')));_0x2ef467=_['merge'](_0x2ef467,require('../api/faxApplication/faxApplication.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x15')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/faxMessage/faxMessage.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x16')));_0x2ef467=_['merge'](_0x2ef467,require(_0xa1a2('0x17')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x18')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x19')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x1a')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x1b')));_0x2ef467=_['merge'](_0x2ef467,require(_0xa1a2('0x1c')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x1d')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x1e')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x1f')));_0x2ef467=_['merge'](_0x2ef467,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/chatInteraction/chatInteraction.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x20')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/chatQueue/chatQueue.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x21')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/cmHopper/cmHopper.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x22')));_0x2ef467=_['merge'](_0x2ef467,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x23')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x24')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x25')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x26')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x27')));_0x2ef467=_['merge'](_0x2ef467,require(_0xa1a2('0x28')));_0x2ef467=_['merge'](_0x2ef467,require('../api/template/template.rpc'));_0x2ef467=_['merge'](_0x2ef467,require(_0xa1a2('0x29')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x2a')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x2ef467=_['merge'](_0x2ef467,require(_0xa1a2('0x2b')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x2c')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x2ef467=_['merge'](_0x2ef467,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x2d')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x2e')));_0x2ef467=_['merge'](_0x2ef467,require(_0xa1a2('0x2f')));_0x2ef467=_['merge'](_0x2ef467,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x30')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x31')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x32')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x33')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x34')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/squareRecording/squareRecording.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x35')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x36')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require('../api/attachment/attachment.rpc'));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x37')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x38')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x39')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x3a')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x3b')));_0x2ef467=_[_0xa1a2('0x5')](_0x2ef467,require(_0xa1a2('0x3c')));var _0x3b9f2d=jayson[_0xa1a2('0x3d')](_0x2ef467)[_0xa1a2('0x3e')]();var _0x46f9b2=config[_0xa1a2('0x3f')]['port']||config['port']+0x1;var _0x100abe=config[_0xa1a2('0x3f')]['ip']||'localhost';_0x3b9f2d['on'](_0xa1a2('0x40'),function(_0x1e84f2){return _0x6842fe(_0x1e84f2);});_0x3b9f2d['listen'](_0x46f9b2,_0x100abe,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x100abe,_0x46f9b2);require(_0xa1a2('0x41'))[_0xa1a2('0x42')]();return _0x54edf3(_0xa1a2('0x43')+_0x100abe+':'+_0x46f9b2);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index b418504..b14c454 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 _0xdd0c=['prototype','sendRequest','sync','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','setVariable','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','exec','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','call','setEncoding','setTimeout','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write'];(function(_0x2e997e,_0x4edf31){var _0x5a6cb1=function(_0x3904da){while(--_0x3904da){_0x2e997e['push'](_0x2e997e['shift']());}};_0x5a6cb1(++_0x4edf31);}(_0xdd0c,0x1ad));var _0xcdd0=function(_0x4cf1cb,_0x491c40){_0x4cf1cb=_0x4cf1cb-0x0;var _0x132982=_0xdd0c[_0x4cf1cb];return _0x132982;};'use strict';var util=require(_0xcdd0('0x0'));var _=require(_0xcdd0('0x1'));var EventEmitter=require(_0xcdd0('0x2'))[_0xcdd0('0x3')];var AGIReply=require('./reply');var AGIError=require(_0xcdd0('0x4'));function AGIChannel(_0xadcf73){var _0x284276=this,_0x221bc5=new AGIReply(),_0x8cb3e2=![],_0x5e5702={};EventEmitter[_0xcdd0('0x5')](_0x284276);_0xadcf73[_0xcdd0('0x6')]('utf8');_0xadcf73[_0xcdd0('0x7')](0x8*0x3c*0x3c*0x3e8);_0x221bc5[_0xcdd0('0x6')](_0xcdd0('0x8'));_0x221bc5['on'](_0xcdd0('0x9'),function(_0x1e0482){for(var _0x1f7ae0 in _0x1e0482){_0x284276[_0x1f7ae0]=_0x1e0482[_0x1f7ae0];}_0x284276[_0xcdd0('0xa')](_0xcdd0('0xb'));});_0x221bc5['on'](_0xcdd0('0xc'),function(_0x2de69f){if(_0x2de69f[_0xcdd0('0xd')]()==_0xcdd0('0xe')){_0x284276[_0xcdd0('0xa')](_0xcdd0('0xe'));return;}if(_0x2de69f[_0xcdd0('0xf')](0x0,0xb)==_0xcdd0('0x10')){_0x8cb3e2=!![];}if(_0x8cb3e2){_0x5e5702['rx']+=_0x2de69f+'\x0a';if(_0x2de69f[_0xcdd0('0x11')](_0xcdd0('0x12'))!=-0x1){_0x8cb3e2=![];}}else{_0x5e5702['rx']=_0x2de69f;}if(_0x8cb3e2){return;}if(typeof _0x5e5702['cb']==_0xcdd0('0x13')){var _0x5d123a=_0x5e5702['rx']['substring'](0x0,0x3),_0x24f51a=null,_0xccaf24=null;_0x5d123a=parseInt(_0x5d123a);if(isNaN(_0x5d123a)){_0x5e5702['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xcdd0('0x14')});return;}if(_0x5d123a!=0xc8){_0x5e5702['cb'](null,{'code':_0x5d123a,'result':-0x1,'extra':'KO'});return;}_0x24f51a=_0x5e5702['rx'][_0xcdd0('0xf')](0x4)[_0xcdd0('0x15')](_0xcdd0('0x16'),'');if(_0x24f51a['indexOf']('\x20')!=-0x1){_0x24f51a=_0x24f51a[_0xcdd0('0x17')](0x0,_0x24f51a[_0xcdd0('0x18')]('\x20'));}if(_[_0xcdd0('0x19')](_0x24f51a,'-1')){_0x24f51a=parseInt(_0x24f51a);}_0xccaf24=_0x5e5702['rx'][_0xcdd0('0x1a')]('\x20');if(_0xccaf24[_0xcdd0('0x1b')]==0x3){_0xccaf24=_0xccaf24[0x2][_0xcdd0('0xf')](0x1,_0xccaf24[0x2][_0xcdd0('0x1b')]-0x1);}else if(_0xccaf24[_0xcdd0('0x1b')]>0x3){var _0x2bf86e=/\((.+)\)/;var _0x1999d0=_0x5e5702['rx'][_0xcdd0('0x1c')](_0x2bf86e);if(_0x1999d0){_0xccaf24=_0x1999d0[0x1];}else{_0xccaf24=null;}}else{_0xccaf24=null;}_0x5e5702['cb'](null,{'code':_0x5d123a,'result':_0x24f51a,'extra':_0xccaf24});}});_0xadcf73['on'](_0xcdd0('0x1d'),function(_0x1376a8){_0x284276[_0xcdd0('0xa')](_0xcdd0('0x1d'),new AGIError(_0xcdd0('0x1e'),_0x1376a8['code']));});_0xadcf73['on']('close',function(){_0x284276[_0xcdd0('0xa')](_0xcdd0('0x1f'),new AGIError(_0xcdd0('0x20')));});_0xadcf73['on'](_0xcdd0('0x21'),function(){_0x284276[_0xcdd0('0xa')]('timeout',new AGIError(_0xcdd0('0x22')));_0xadcf73[_0xcdd0('0x23')]();});_0xadcf73[_0xcdd0('0x24')](_0x221bc5);this[_0xcdd0('0x25')]=function(_0x16c5c4,_0x52241b){var _0x16c5c4=_0x16c5c4||'',_0x52241b=typeof _0x52241b==_0xcdd0('0x13')?_0x52241b:new Function();_0x5e5702={'tx':_0x16c5c4,'rx':'','cb':_0x52241b};_0xadcf73[_0xcdd0('0x26')](_0x16c5c4+'\x0a');},this['close']=function(){_0xadcf73['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xcdd0('0x27')][_0xcdd0('0x28')]=function(_0x506866){return this['command'][_0xcdd0('0x29')](this,_0x506866);};AGIChannel['prototype']['answer']=function(){return this[_0xcdd0('0x28')](_0xcdd0('0x2a'));};AGIChannel[_0xcdd0('0x27')][_0xcdd0('0x2b')]=function(_0x4c5c1d,_0x3db560,_0x4f68d0){_0x4c5c1d=_0x4c5c1d===undefined?_0xcdd0('0x2c'):_0x4c5c1d;_0x3db560=_0x3db560===undefined?'5':_0x3db560;_0x4f68d0=_0x4f68d0===undefined?'1':_0x4f68d0;return this['sendRequest'](util[_0xcdd0('0x2d')](_0xcdd0('0x2e'),_0x4c5c1d,_0x3db560*0x3e8,_0x4f68d0));};AGIChannel[_0xcdd0('0x27')][_0xcdd0('0x2f')]=function(_0x3eee3a){_0x3eee3a=_0x3eee3a||_0xcdd0('0x30');return this[_0xcdd0('0x28')](util[_0xcdd0('0x2d')](_0xcdd0('0x31'),_0x3eee3a));};AGIChannel['prototype']['exec']=function(_0x5617a2,_0x4bc6c4){if(_[_0xcdd0('0x32')](_0x4bc6c4)){return this[_0xcdd0('0x28')](util['format'](_0xcdd0('0x33'),_0x5617a2,_0x4bc6c4['join'](',')));}return this[_0xcdd0('0x28')](util[_0xcdd0('0x2d')](_0xcdd0('0x33'),_0x5617a2,_0x4bc6c4));};AGIChannel[_0xcdd0('0x27')][_0xcdd0('0x34')]=function(_0x52ff5b){return this[_0xcdd0('0x28')](util[_0xcdd0('0x2d')](_0xcdd0('0x35'),_0x52ff5b));};AGIChannel[_0xcdd0('0x27')][_0xcdd0('0x36')]=function(_0x52fff5){return this[_0xcdd0('0x28')](util[_0xcdd0('0x2d')]('SET\x20EXTENSION\x20%s',_0x52fff5));};AGIChannel[_0xcdd0('0x27')][_0xcdd0('0x37')]=function(_0x550906){return this['sendRequest'](util[_0xcdd0('0x2d')](_0xcdd0('0x38'),_0x550906));};AGIChannel[_0xcdd0('0x27')][_0xcdd0('0xe')]=function(){return this[_0xcdd0('0x28')]('HANGUP');};AGIChannel[_0xcdd0('0x27')][_0xcdd0('0x39')]=function(_0xdd11b8,_0x1dc411){var _0x3c3c2c=_['isBoolean'](_0x1dc411)||_[_0xcdd0('0x3a')](_0x1dc411)?_0x1dc411['toString']():_0x1dc411;return this[_0xcdd0('0x28')](util['format'](_0xcdd0('0x3b'),_0xdd11b8,_0x3c3c2c?_0x3c3c2c['toString']()[_0xcdd0('0x15')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xcdd0('0x27')][_0xcdd0('0x3c')]=function(_0x2c543f,_0x53425a){return this[_0xcdd0('0x28')](util['format'](_0xcdd0('0x3d'),_0x2c543f,_0x53425a));};AGIChannel['prototype'][_0xcdd0('0x3e')]=function(_0x185b66,_0x11269f){return this[_0xcdd0('0x28')](util[_0xcdd0('0x2d')](_0xcdd0('0x3f'),_0x185b66,_0x11269f));};AGIChannel[_0xcdd0('0x27')]['sayPhonetic']=function(_0x2042b2,_0x6628a1){return this['sendRequest'](util[_0xcdd0('0x2d')](_0xcdd0('0x40'),_0x2042b2,_0x6628a1));};AGIChannel[_0xcdd0('0x27')][_0xcdd0('0x41')]=function(_0x5aa877,_0x5995c3,_0x40f974){_0x5995c3=_0x5995c3||this['extension'];_0x40f974=_0x40f974||0x1;this['setContext'](_0x5aa877);this[_0xcdd0('0x36')](_0x5995c3);this[_0xcdd0('0x37')](_0x40f974);return this[_0xcdd0('0x2f')](util[_0xcdd0('0x2d')](_0xcdd0('0x42'),_0x5aa877,_0x5995c3,_0x40f974));};AGIChannel['prototype']['getVariable']=function(_0xeadf6e){return this['sendRequest'](util[_0xcdd0('0x2d')](_0xcdd0('0x43'),_0xeadf6e));};AGIChannel[_0xcdd0('0x27')][_0xcdd0('0x44')]=function(_0x4b343c,_0x1b7dd7,_0x398f10,_0x2202a8,_0x39e763,_0x5b5e40){_0x1b7dd7=_0x1b7dd7||'wav';_0x398f10=_0x398f10||'';_0x2202a8=_0x2202a8===undefined?-0x1:_0x2202a8==='-1'?-0x1:_0x2202a8*0x3e8;_0x39e763=_0x39e763===undefined?'':'s='+_0x39e763;_0x5b5e40=_0x5b5e40?'BEEP':'';return this[_0xcdd0('0x28')](util[_0xcdd0('0x2d')](_0xcdd0('0x45'),_0x4b343c,_0x1b7dd7,_0x398f10,_0x2202a8,_0x5b5e40,_0x39e763));};AGIChannel[_0xcdd0('0x27')][_0xcdd0('0x46')]=function(_0x19da1c,_0x5c44c9){_0x5c44c9=_0x5c44c9||'';return this[_0xcdd0('0x28')](util[_0xcdd0('0x2d')](_0xcdd0('0x47'),_0x19da1c,_0x5c44c9));};AGIChannel[_0xcdd0('0x27')]['agi']=function(_0x1ba86e){return this[_0xcdd0('0x48')](_0xcdd0('0x49'),_0x1ba86e);};AGIChannel[_0xcdd0('0x27')]['wait']=function(_0x167ac1){return this[_0xcdd0('0x48')](_0xcdd0('0x4a'),_0x167ac1);};AGIChannel[_0xcdd0('0x27')][_0xcdd0('0x1d')]=function(_0x5a83cc,_0xd78767){this[_0xcdd0('0x2f')](util[_0xcdd0('0x2d')](_0xcdd0('0x4b'),_0x5a83cc['id'],_0x5a83cc[_0xcdd0('0x4c')],_0xd78767));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xcdd0('0x4d')]=AGIChannel; \ No newline at end of file +var _0xf0b0=['prototype','sendRequest','answer','ANSWER','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','AGI','wait','WAIT','label','util','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','520-Invalid','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','pipe','write','destroy','inherits'];(function(_0x5c3303,_0x308e03){var _0x5a6f46=function(_0x193bc9){while(--_0x193bc9){_0x5c3303['push'](_0x5c3303['shift']());}};_0x5a6f46(++_0x308e03);}(_0xf0b0,0xc8));var _0x0f0b=function(_0x13b514,_0x1a9a66){_0x13b514=_0x13b514-0x0;var _0x4b4fee=_0xf0b0[_0x13b514];return _0x4b4fee;};'use strict';var util=require(_0x0f0b('0x0'));var _=require(_0x0f0b('0x1'));var EventEmitter=require(_0x0f0b('0x2'))[_0x0f0b('0x3')];var AGIReply=require(_0x0f0b('0x4'));var AGIError=require(_0x0f0b('0x5'));function AGIChannel(_0x15cacf){var _0xccade2=this,_0x32b620=new AGIReply(),_0x49ee0d=![],_0x5daf4a={};EventEmitter['call'](_0xccade2);_0x15cacf[_0x0f0b('0x6')](_0x0f0b('0x7'));_0x15cacf[_0x0f0b('0x8')](0x8*0x3c*0x3c*0x3e8);_0x32b620[_0x0f0b('0x6')](_0x0f0b('0x7'));_0x32b620['on'](_0x0f0b('0x9'),function(_0x57d855){for(var _0x38061a in _0x57d855){_0xccade2[_0x38061a]=_0x57d855[_0x38061a];}_0xccade2[_0x0f0b('0xa')](_0x0f0b('0xb'));});_0x32b620['on'](_0x0f0b('0xc'),function(_0x5afd74){if(_0x5afd74[_0x0f0b('0xd')]()==_0x0f0b('0xe')){_0xccade2['emit']('hangup');return;}if(_0x5afd74['substring'](0x0,0xb)==_0x0f0b('0xf')){_0x49ee0d=!![];}if(_0x49ee0d){_0x5daf4a['rx']+=_0x5afd74+'\x0a';if(_0x5afd74['search'](_0x0f0b('0x10'))!=-0x1){_0x49ee0d=![];}}else{_0x5daf4a['rx']=_0x5afd74;}if(_0x49ee0d){return;}if(typeof _0x5daf4a['cb']==_0x0f0b('0x11')){var _0x521096=_0x5daf4a['rx'][_0x0f0b('0x12')](0x0,0x3),_0x3871ea=null,_0x204dce=null;_0x521096=parseInt(_0x521096);if(isNaN(_0x521096)){_0x5daf4a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0f0b('0x13')});return;}if(_0x521096!=0xc8){_0x5daf4a['cb'](null,{'code':_0x521096,'result':-0x1,'extra':'KO'});return;}_0x3871ea=_0x5daf4a['rx'][_0x0f0b('0x12')](0x4)[_0x0f0b('0x14')](_0x0f0b('0x15'),'');if(_0x3871ea[_0x0f0b('0x16')]('\x20')!=-0x1){_0x3871ea=_0x3871ea[_0x0f0b('0x17')](0x0,_0x3871ea[_0x0f0b('0x16')]('\x20'));}if(_[_0x0f0b('0x18')](_0x3871ea,'-1')){_0x3871ea=parseInt(_0x3871ea);}_0x204dce=_0x5daf4a['rx'][_0x0f0b('0x19')]('\x20');if(_0x204dce[_0x0f0b('0x1a')]==0x3){_0x204dce=_0x204dce[0x2][_0x0f0b('0x12')](0x1,_0x204dce[0x2][_0x0f0b('0x1a')]-0x1);}else if(_0x204dce[_0x0f0b('0x1a')]>0x3){var _0x2c406d=/\((.+)\)/;var _0x98d74=_0x5daf4a['rx'][_0x0f0b('0x1b')](_0x2c406d);if(_0x98d74){_0x204dce=_0x98d74[0x1];}else{_0x204dce=null;}}else{_0x204dce=null;}_0x5daf4a['cb'](null,{'code':_0x521096,'result':_0x3871ea,'extra':_0x204dce});}});_0x15cacf['on'](_0x0f0b('0x1c'),function(_0xe8bb7e){_0xccade2[_0x0f0b('0xa')](_0x0f0b('0x1c'),new AGIError(_0x0f0b('0x1d'),_0xe8bb7e['code']));});_0x15cacf['on'](_0x0f0b('0x1e'),function(){_0xccade2['emit'](_0x0f0b('0x1e'),new AGIError(_0x0f0b('0x1f')));});_0x15cacf['on'](_0x0f0b('0x20'),function(){_0xccade2[_0x0f0b('0xa')](_0x0f0b('0x20'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x15cacf['destroy']();});_0x15cacf[_0x0f0b('0x21')](_0x32b620);this['command']=function(_0x4da9fc,_0x497c67){var _0x4da9fc=_0x4da9fc||'',_0x497c67=typeof _0x497c67==_0x0f0b('0x11')?_0x497c67:new Function();_0x5daf4a={'tx':_0x4da9fc,'rx':'','cb':_0x497c67};_0x15cacf[_0x0f0b('0x22')](_0x4da9fc+'\x0a');},this[_0x0f0b('0x1e')]=function(){_0x15cacf[_0x0f0b('0x23')]();};}util[_0x0f0b('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x0f0b('0x25')][_0x0f0b('0x26')]=function(_0x4f5c3e){return this['command']['sync'](this,_0x4f5c3e);};AGIChannel[_0x0f0b('0x25')][_0x0f0b('0x27')]=function(){return this[_0x0f0b('0x26')](_0x0f0b('0x28'));};AGIChannel[_0x0f0b('0x25')]['getData']=function(_0x5094f7,_0x294c70,_0x1ad777){_0x5094f7=_0x5094f7===undefined?_0x0f0b('0x29'):_0x5094f7;_0x294c70=_0x294c70===undefined?'5':_0x294c70;_0x1ad777=_0x1ad777===undefined?'1':_0x1ad777;return this[_0x0f0b('0x26')](util['format'](_0x0f0b('0x2a'),_0x5094f7,_0x294c70*0x3e8,_0x1ad777));};AGIChannel[_0x0f0b('0x25')][_0x0f0b('0x2b')]=function(_0x280f69){_0x280f69=_0x280f69||_0x0f0b('0x2c');return this[_0x0f0b('0x26')](util[_0x0f0b('0x2d')](_0x0f0b('0x2e'),_0x280f69));};AGIChannel[_0x0f0b('0x25')][_0x0f0b('0x2f')]=function(_0x51203e,_0x56869d){if(_[_0x0f0b('0x30')](_0x56869d)){return this[_0x0f0b('0x26')](util[_0x0f0b('0x2d')](_0x0f0b('0x31'),_0x51203e,_0x56869d[_0x0f0b('0x32')](',')));}return this['sendRequest'](util[_0x0f0b('0x2d')]('EXEC\x20%s\x20%s',_0x51203e,_0x56869d));};AGIChannel[_0x0f0b('0x25')][_0x0f0b('0x33')]=function(_0x1ced97){return this[_0x0f0b('0x26')](util[_0x0f0b('0x2d')]('SET\x20CONTEXT\x20%s',_0x1ced97));};AGIChannel[_0x0f0b('0x25')][_0x0f0b('0x34')]=function(_0x1f8307){return this[_0x0f0b('0x26')](util['format'](_0x0f0b('0x35'),_0x1f8307));};AGIChannel['prototype'][_0x0f0b('0x36')]=function(_0x4545d4){return this[_0x0f0b('0x26')](util[_0x0f0b('0x2d')](_0x0f0b('0x37'),_0x4545d4));};AGIChannel['prototype'][_0x0f0b('0xe')]=function(){return this['sendRequest'](_0x0f0b('0x38'));};AGIChannel[_0x0f0b('0x25')]['setVariable']=function(_0x11ee71,_0x2446f8){var _0x233b44=_[_0x0f0b('0x39')](_0x2446f8)||_[_0x0f0b('0x3a')](_0x2446f8)?_0x2446f8[_0x0f0b('0x3b')]():_0x2446f8;return this[_0x0f0b('0x26')](util[_0x0f0b('0x2d')](_0x0f0b('0x3c'),_0x11ee71,_0x233b44?_0x233b44['toString']()[_0x0f0b('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x0f0b('0x25')][_0x0f0b('0x3d')]=function(_0xa62e7e,_0x497824){return this[_0x0f0b('0x26')](util[_0x0f0b('0x2d')](_0x0f0b('0x3e'),_0xa62e7e,_0x497824));};AGIChannel['prototype'][_0x0f0b('0x3f')]=function(_0x4fed7f,_0x118d5e){return this[_0x0f0b('0x26')](util['format'](_0x0f0b('0x40'),_0x4fed7f,_0x118d5e));};AGIChannel[_0x0f0b('0x25')]['sayPhonetic']=function(_0x3c591a,_0x3fb454){return this['sendRequest'](util['format'](_0x0f0b('0x41'),_0x3c591a,_0x3fb454));};AGIChannel[_0x0f0b('0x25')][_0x0f0b('0x42')]=function(_0x4501a0,_0x117972,_0x432f92){_0x117972=_0x117972||this[_0x0f0b('0x43')];_0x432f92=_0x432f92||0x1;this[_0x0f0b('0x33')](_0x4501a0);this['setExtension'](_0x117972);this['setPriority'](_0x432f92);return this[_0x0f0b('0x2b')](util[_0x0f0b('0x2d')](_0x0f0b('0x44'),_0x4501a0,_0x117972,_0x432f92));};AGIChannel[_0x0f0b('0x25')][_0x0f0b('0x45')]=function(_0x5a1091){return this[_0x0f0b('0x26')](util[_0x0f0b('0x2d')](_0x0f0b('0x46'),_0x5a1091));};AGIChannel[_0x0f0b('0x25')][_0x0f0b('0x47')]=function(_0x541dd0,_0x1663ab,_0x1017cc,_0x263ea5,_0x2a56fa,_0x330445){_0x1663ab=_0x1663ab||_0x0f0b('0x48');_0x1017cc=_0x1017cc||'';_0x263ea5=_0x263ea5===undefined?-0x1:_0x263ea5==='-1'?-0x1:_0x263ea5*0x3e8;_0x2a56fa=_0x2a56fa===undefined?'':'s='+_0x2a56fa;_0x330445=_0x330445?'BEEP':'';return this[_0x0f0b('0x26')](util[_0x0f0b('0x2d')](_0x0f0b('0x49'),_0x541dd0,_0x1663ab,_0x1017cc,_0x263ea5,_0x330445,_0x2a56fa));};AGIChannel['prototype'][_0x0f0b('0x4a')]=function(_0x1b0f52,_0x590000){_0x590000=_0x590000||'';return this[_0x0f0b('0x26')](util[_0x0f0b('0x2d')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x1b0f52,_0x590000));};AGIChannel[_0x0f0b('0x25')]['agi']=function(_0x410cbc){return this[_0x0f0b('0x2f')](_0x0f0b('0x4b'),_0x410cbc);};AGIChannel[_0x0f0b('0x25')][_0x0f0b('0x4c')]=function(_0x5ccac7){return this[_0x0f0b('0x2f')](_0x0f0b('0x4d'),_0x5ccac7);};AGIChannel[_0x0f0b('0x25')][_0x0f0b('0x1c')]=function(_0x1c18c2,_0x4becf2){this[_0x0f0b('0x2b')](util[_0x0f0b('0x2d')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x1c18c2['id'],_0x1c18c2[_0x0f0b('0x4e')],_0x4becf2));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index ee54356..d616cef 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 _0x1165=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x2838e7,_0x58d4fb){var _0x53b163=function(_0x55861b){while(--_0x55861b){_0x2838e7['push'](_0x2838e7['shift']());}};_0x53b163(++_0x58d4fb);}(_0x1165,0x127));var _0x5116=function(_0x4ffc1d,_0x42acaf){_0x4ffc1d=_0x4ffc1d-0x0;var _0x105fab=_0x1165[_0x4ffc1d];return _0x105fab;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x5116('0x0'),'E_AGI_ARGUMENT_PORT':_0x5116('0x1'),'E_AGI_SERVER_ERROR':_0x5116('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x5116('0x3'),'E_AGI_SOCKET_ERROR':_0x5116('0x4'),'E_AGI_SOCKET_CLOSE':_0x5116('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x5116('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x5116('0x7')};function AGIError(_0x3c7bc2){var _0x3c7bc2=_0x3c7bc2||null,_0x3aed18=_0x3aed18||[],_0x40b0d7=0x1,_0x33f1ea='';if(!error[_0x3c7bc2]){_0x3c7bc2=_0x5116('0x8');}_0x3aed18[_0x5116('0x9')](error[_0x3c7bc2]);while(arguments[_0x40b0d7]){_0x3aed18[_0x5116('0x9')](arguments[_0x40b0d7]);_0x40b0d7++;}_0x33f1ea=util[_0x5116('0xa')]['apply'](util,_0x3aed18);this['message']=_0x33f1ea;this[_0x5116('0xb')]=_0x3c7bc2;}module[_0x5116('0xc')]=AGIError; \ No newline at end of file +var _0xe595=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','name','exports','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x8ff66e,_0x118183){var _0xb592f2=function(_0x2f9ee9){while(--_0x2f9ee9){_0x8ff66e['push'](_0x8ff66e['shift']());}};_0xb592f2(++_0x118183);}(_0xe595,0x16f));var _0x5e59=function(_0x2752ef,_0x53efe8){_0x2752ef=_0x2752ef-0x0;var _0x5f14fb=_0xe595[_0x2752ef];return _0x5f14fb;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x5e59('0x0'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x5e59('0x1'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x5e59('0x2'),'E_AGI_SOCKET_ERROR':_0x5e59('0x3'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5e59('0x4'),'E_AGI_IVR_ENTRY':_0x5e59('0x5')};function AGIError(_0x18d0ab){var _0x18d0ab=_0x18d0ab||null,_0x5cdd2c=_0x5cdd2c||[],_0x9a319a=0x1,_0x2d7f66='';if(!error[_0x18d0ab]){_0x18d0ab=_0x5e59('0x6');}_0x5cdd2c[_0x5e59('0x7')](error[_0x18d0ab]);while(arguments[_0x9a319a]){_0x5cdd2c['push'](arguments[_0x9a319a]);_0x9a319a++;}_0x2d7f66=util[_0x5e59('0x8')][_0x5e59('0x9')](util,_0x5cdd2c);this['message']=_0x2d7f66;this[_0x5e59('0xa')]=_0x18d0ab;}module[_0x5e59('0xb')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 7a6d45c..7c00127 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 _0x5af1=['target','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','stop\x20traverse','length','info','condition','split','agicommand','vswitch'];(function(_0x5c7179,_0x1542ad){var _0x49e470=function(_0x543032){while(--_0x543032){_0x5c7179['push'](_0x5c7179['shift']());}};_0x49e470(++_0x1542ad);}(_0x5af1,0x1c4));var _0x15af=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x5af1[_0x4bc65f];return _0x44f85f;};'use strict';var _=require('lodash');var logger=require(_0x15af('0x0'))(_0x15af('0x1'));var verticesWithRetry=[_0x15af('0x2'),_0x15af('0x3'),_0x15af('0x4')];var Graph=function(){this[_0x15af('0x5')]={};this[_0x15af('0x6')]={};this[_0x15af('0x7')]=0x0;};Graph[_0x15af('0x8')][_0x15af('0x9')]=function(_0x1cb2b4){this[_0x15af('0x5')][_0x1cb2b4['id']]=_0x1cb2b4;this[_0x15af('0x6')][_0x1cb2b4['id']]=[];};Graph[_0x15af('0x8')][_0x15af('0xa')]=function(_0x2b6697,_0x563860,_0x8cfed4){this[_0x15af('0x6')][_0x2b6697][_0x15af('0xb')]({'target':_0x563860,'condition':_0x8cfed4});this[_0x15af('0x7')]+=0x1;};Graph[_0x15af('0x8')]['size']=function(){return _[_0x15af('0xc')](this[_0x15af('0x5')]);};Graph[_0x15af('0x8')][_0x15af('0xd')]=function(){return this[_0x15af('0x7')];};Graph[_0x15af('0x8')][_0x15af('0xe')]=function(_0x31bc3c){return this[_0x15af('0x5')][_0x31bc3c];};Graph[_0x15af('0x8')][_0x15af('0xf')]=function(_0x4b6fee,_0x5e844b){if(!this[_0x15af('0x5')][_0x4b6fee]){return logger['info'](_0x15af('0x10'));}var _0x2cd60d=_0x5e844b(this[_0x15af('0x5')][_0x4b6fee]);if(!_0x2cd60d){return logger['info'](_0x15af('0x11'));}if(this[_0x15af('0x6')][_0x4b6fee][_0x15af('0x12')]===0x0){return logger[_0x15af('0x13')]('no\x20edge/s\x20available');}for(var _0x423b59=0x0,_0x16206b=[],_0x1d9147=![];_0x423b59\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','agicommand','hasOwnProperty','maxRetry','addVertex','omit','length','source','target','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','variables','stringify','hangup','sync','production','start','debug','root','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','result','response','isUndefined','toString','agicommand\x20not\x20found','finally','[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\x20published','Project\x20%s\x20not\x20found','close','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','[%s]\x20%s','message'];(function(_0x9ae685,_0x2c6652){var _0x4c492e=function(_0xde76ce){while(--_0xde76ce){_0x9ae685['push'](_0x9ae685['shift']());}};_0x4c492e(++_0x2c6652);}(_0x4170,0x1b0));var _0x0417=function(_0x541a6c,_0x2e4bf9){_0x541a6c=_0x541a6c-0x0;var _0x3d559d=_0x4170[_0x541a6c];return _0x3d559d;};'use strict';var parser=require(_0x0417('0x0'));var _=require('lodash');var syncho=require(_0x0417('0x1'));var util=require('util');var moment=require(_0x0417('0x2'));var config=require(_0x0417('0x3'));var logger=require(_0x0417('0x4'))(_0x0417('0x5'));var utilLicense=require(_0x0417('0x6'));var rpc=require(_0x0417('0x7'));var mailRpc=require(_0x0417('0x8'));var Graph=require(_0x0417('0x9'));var Vertices=require(_0x0417('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x0417('0x5')]=_[_0x0417('0xb')](config[_0x0417('0x5')],{'ip':_0x0417('0xc'),'port':0x11dd});function connectionHandler(_0x4b80fc){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4b80fc);agiHandler(_0x4b80fc);}catch(_0x17a0a2){logger[_0x0417('0xd')](_0x17a0a2['stack']);}});});}function listeningHandler(){console[_0x0417('0xe')](_0x0417('0xf'),config[_0x0417('0x5')]['port']);logger[_0x0417('0x10')](util[_0x0417('0x11')](_0x0417('0x12'),config[_0x0417('0x5')]['ip'],config[_0x0417('0x5')][_0x0417('0x13')]));}function errorHandler(_0x1d667f){if(_0x1d667f&&_0x1d667f[_0x0417('0x14')]&&_0x1d667f['message']){logger[_0x0417('0xd')](util['format'](_0x0417('0x15'),_0x1d667f[_0x0417('0x14')],_0x1d667f[_0x0417('0x16')]));}else{logger[_0x0417('0xd')](util[_0x0417('0x11')](_0x0417('0x17'),_0x1d667f[_0x0417('0x18')]));}}function closeHandler(){logger[_0x0417('0x10')](util[_0x0417('0x11')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x0417('0x19')],this[_0x0417('0x1a')],this[_0x0417('0x1b')],this[_0x0417('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x402994){logger[_0x0417('0xd')](_0x402994[_0x0417('0x18')]);}}function timeoutHandler(){logger[_0x0417('0x10')](util[_0x0417('0x11')](_0x0417('0x1d'),this[_0x0417('0x19')],this[_0x0417('0x1a')],this[_0x0417('0x1b')],this['dnid'],this[_0x0417('0x1e')]));}function hangupHandler(){logger[_0x0417('0x10')](util[_0x0417('0x11')](_0x0417('0x1f'),this[_0x0417('0x19')],this[_0x0417('0x1a')],this[_0x0417('0x1b')],this[_0x0417('0x1c')],this[_0x0417('0x1e')]));this[_0x0417('0x20')]=!![];}function getRoot(_0x2f4f95){return parser[_0x0417('0x21')](_0x2f4f95,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x3fec04,_0x3e1d65,_0x49bd84){_0x3e1d65[_0x0417('0x22')]=_0x49bd84;if(_0x3e1d65[_0x0417('0x23')]('retry')){_0x3e1d65[_0x0417('0x24')]=parseInt(_0x3e1d65['retry'],0xa);}_0x3fec04[_0x0417('0x25')](_[_0x0417('0x26')](_0x3e1d65,'mxCell'));}function initGraph(_0x688c57,_0x1a789b){var _0x25e640=new Graph();for(var _0x5071c3 in _0x688c57){if(_0x688c57[_0x0417('0x23')](_0x5071c3)){if(_['isArray'](_0x688c57[_0x5071c3])){for(var _0x4f27f5=0x0;_0x4f27f5<_0x688c57[_0x5071c3]['length'];_0x4f27f5+=0x1){addVertex(_0x25e640,_0x688c57[_0x5071c3][_0x4f27f5],_0x5071c3);}}else{addVertex(_0x25e640,_0x688c57[_0x5071c3],_0x5071c3);}}}for(var _0x233acd=0x0;_0x233acd<_0x1a789b[_0x0417('0x27')];_0x233acd+=0x1){if(_0x1a789b[_0x233acd][_0x0417('0x28')]&&_0x1a789b[_0x233acd][_0x0417('0x29')]){_0x25e640['addEdge'](_0x1a789b[_0x233acd][_0x0417('0x28')],_0x1a789b[_0x233acd][_0x0417('0x29')],_0x1a789b[_0x233acd]['value']);}}return _0x25e640;}function getSquareProject(_0x58f867,_0x405de8){rpc[_0x0417('0x2a')](_0x58f867)[_0x0417('0x2b')](function(_0x2e119b){_0x405de8(null,_0x2e119b);})[_0x0417('0x2c')](function(_0x24c489){_0x405de8(null,_0x24c489);});}function createSquareReport(_0xb013c6,_0x1f2219){rpc[_0x0417('0x2d')](_0xb013c6)['then'](function(_0x5e74ca){if(_0x1f2219){_0x1f2219(null,_0x5e74ca);}})[_0x0417('0x2c')](function(_0x51cb53){if(_0x1f2219){_0x1f2219(null,_0x51cb53);}});}function setChannelVariables(_0x2d1219){for(var _0xbd4315 in _0x2d1219){if(_0x2d1219[_0x0417('0x23')](_0xbd4315)){if(_0xbd4315[_0x0417('0x2e')](_0x0417('0x2f'))===0x0){_0x2d1219[_0xbd4315[_0x0417('0x30')](0x4)]=_0x2d1219[_0xbd4315];delete _0x2d1219[_0xbd4315];}}}}function getLogFromObject(_0x125391){return util[_0x0417('0x31')](_0x125391,{'showHidden':![],'depth':null});}function agiHandler(_0x38509e){var _0x5cd46f,_0x54f86a,_0x5872af,_0x2b60cf,_0x15b00b;logger['debug'](_0x0417('0x32'),JSON[_0x0417('0x33')](_0x38509e,null,0x2));logger['info'](util[_0x0417('0x11')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x38509e['arg_1'],_0x38509e['calleridname'],_0x38509e[_0x0417('0x1b')],_0x38509e[_0x0417('0x1c')],_0x38509e['uniqueid']));_0x38509e['on'](_0x0417('0xd'),errorHandler);_0x38509e['on']('close',closeHandler);_0x38509e['on']('timeout',timeoutHandler);_0x38509e[_0x0417('0x20')]=![];_0x38509e['on'](_0x0417('0x34'),hangupHandler);var _0xd2df3f=getSquareProject[_0x0417('0x35')](null,_0x38509e['arg_1']);if(_0xd2df3f){if(_0xd2df3f['production']){_0x5cd46f=getRoot(_0xd2df3f[_0x0417('0x36')]);if(_0x5cd46f&&_0x5cd46f[_0x0417('0x37')]){logger[_0x0417('0x38')](_0x0417('0x39'),JSON[_0x0417('0x33')](_0x5cd46f,null,0x2));_0x38509e['joinAt']=moment()[_0x0417('0x11')](_0x0417('0x3a'));_0x54f86a=initGraph(_[_0x0417('0x26')](_0x5cd46f,_0x0417('0x3b')),_0x5cd46f['mxCell']);_0x5872af=new Vertices(_0x38509e,rpc,mailRpc);logger['info'](util[_0x0417('0x11')](_0x0417('0x3c'),_0x38509e[_0x0417('0x19')],_0x38509e['calleridname'],_0x38509e[_0x0417('0x1b')],_0x38509e[_0x0417('0x1c')],_0x38509e['uniqueid']));_0x54f86a[_0x0417('0x3d')](_0x5cd46f['start']['id'],function(_0x1ae5a8){try{_0x1ae5a8=_0x5872af[_0x0417('0x3e')](_0x1ae5a8);logger[_0x0417('0x38')](_0x0417('0x3f'),JSON[_0x0417('0x33')](_0x1ae5a8,null,0x2));if(_0x1ae5a8[_0x0417('0x22')]===_0x0417('0x40')){logger[_0x0417('0x10')](_0x0417('0x41'));_0x38509e['context']=_0x1ae5a8[_0x0417('0x42')]||_0x38509e[_0x0417('0x42')];_0x38509e['extension']=_0x1ae5a8[_0x0417('0x43')];_0x38509e[_0x0417('0x44')]=_0x1ae5a8['priority']?_0x1ae5a8[_0x0417('0x44')]-0x1:0x1;return null;}else if(_0x1ae5a8&&_0x5872af[_0x1ae5a8[_0x0417('0x22')]]){_0x15b00b=_0x5872af[_0x1ae5a8[_0x0417('0x22')]](_0x1ae5a8);logger[_0x0417('0x10')]('response',JSON[_0x0417('0x33')](_0x15b00b,null,0x2));if(_0x15b00b&&_0x15b00b['code']===AGI_CODE_SUCCESS&&_0x15b00b[_0x0417('0x45')]!==AGI_RESULT_ERROR&&!_0x38509e[_0x0417('0x20')]){logger[_0x0417('0x38')](_0x0417('0x46'),getLogFromObject(_0x15b00b));return _[_0x0417('0x47')](_0x15b00b[_0x0417('0x45')])?null:_0x15b00b[_0x0417('0x45')][_0x0417('0x48')]();}else{logger[_0x0417('0xd')](_0x0417('0x46'),getLogFromObject(_0x15b00b));return null;}}else{logger[_0x0417('0xd')](_0x0417('0x49'));return null;}}catch(_0x2992de){logger[_0x0417('0xd')](_0x2992de['stack']);return null;}});if(_0x5cd46f[_0x0417('0x4a')]){logger[_0x0417('0x10')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x38509e[_0x0417('0x19')],_0x38509e[_0x0417('0x1a')],_0x38509e[_0x0417('0x1b')],_0x38509e[_0x0417('0x1c')],_0x38509e[_0x0417('0x1e')]));_0x54f86a[_0x0417('0x3d')](_0x5cd46f[_0x0417('0x4a')]['id'],function(_0x2eb745){try{_0x2eb745=_0x5872af['clear'](_0x2eb745);logger['debug']('vertex',JSON[_0x0417('0x33')](_0x2eb745,null,0x2));if(_0x2eb745&&_0x5872af[_0x2eb745['agicommand']]){_0x15b00b=_0x5872af[_0x2eb745['agicommand']](_0x2eb745);if(_0x15b00b){logger['debug'](_0x0417('0x46'),getLogFromObject(_0x15b00b));return _['isUndefined'](_0x15b00b[_0x0417('0x45')])?null:_0x15b00b[_0x0417('0x45')]['toString']();}else{logger[_0x0417('0xd')](_0x0417('0x46'),getLogFromObject(_0x15b00b));return null;}}else{logger[_0x0417('0xd')](_0x0417('0x49'));return null;}}catch(_0x1f96b4){logger['error'](_0x1f96b4[_0x0417('0x18')]);return null;}});}logger['info'](util[_0x0417('0x11')](_0x0417('0x4b'),_0x38509e[_0x0417('0x19')],_0x38509e[_0x0417('0x1a')],_0x38509e[_0x0417('0x1b')],_0x38509e[_0x0417('0x1c')],_0x38509e[_0x0417('0x1e')]));logger[_0x0417('0x10')](util[_0x0417('0x11')](_0x0417('0x4c'),_0x38509e['context'],_0x38509e[_0x0417('0x43')],parseInt(_0x38509e[_0x0417('0x44')],0xa)+0x1));_0x38509e[_0x0417('0x4d')](_0x38509e[_0x0417('0x42')],_0x38509e[_0x0417('0x43')],parseInt(_0x38509e[_0x0417('0x44')],0xa)+0x1);_0x38509e['close']();}}else{logger[_0x0417('0xd')](util[_0x0417('0x11')](_0x0417('0x4e'),_0x38509e[_0x0417('0x19')]));_0x38509e[_0x0417('0x4d')](_0x38509e['context'],_0x38509e[_0x0417('0x43')],parseInt(_0x38509e[_0x0417('0x44')],0xa)+0x1);_0x38509e['close']();}}else{logger[_0x0417('0xd')](util[_0x0417('0x11')](_0x0417('0x4f'),_0x38509e['arg_1']));_0x38509e[_0x0417('0x4d')](_0x38509e[_0x0417('0x42')],_0x38509e[_0x0417('0x43')],parseInt(_0x38509e[_0x0417('0x44')],0xa)+0x1);_0x38509e[_0x0417('0x50')]();}}function main(){var _0x2035fd;return utilLicense[_0x0417('0x51')]()[_0x0417('0x2b')](function(_0x37590b){if(_0x37590b){if(_0x37590b[_0x0417('0x52')]){if(_0x37590b[_0x0417('0x53')]&&_0x37590b[_0x0417('0x53')]>0x0){logger[_0x0417('0x10')](util['format'](_0x0417('0x54'),_0x37590b[_0x0417('0x53')]));_0x2035fd=_0x37590b[_0x0417('0x53')];}else{logger['info'](_0x0417('0x55'));}}else{logger[_0x0417('0x10')](_0x0417('0x56'));_0x2035fd=-0x1;}}})['catch'](function(_0x453579){logger[_0x0417('0xd')](_0x0417('0x57'),_0x453579[_0x0417('0x18')]);})[_0x0417('0x4a')](function(){var _0x31c23f=require(_0x0417('0x58'))(config[_0x0417('0x5')][_0x0417('0x13')],config[_0x0417('0x5')]['ip'],_0x2035fd);_0x31c23f['on'](_0x0417('0xd'),errorHandler);_0x31c23f['on'](_0x0417('0x59'),listeningHandler);_0x31c23f['on'](_0x0417('0x5a'),connectionHandler);_0x31c23f['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xa11f=['./rpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','addEdge','target','value','getSquareProject','then','catch','createSquareReport','agi_','substring','debug','close','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','stringify','code','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','toString','[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','getLicense','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','xml2json','lodash','syncho','moment','../../config/environment','agi','../../config/license/util'];(function(_0x413970,_0x11edf5){var _0x1f8282=function(_0x505234){while(--_0x505234){_0x413970['push'](_0x413970['shift']());}};_0x1f8282(++_0x11edf5);}(_0xa11f,0x107));var _0xfa11=function(_0x2a0350,_0x249319){_0x2a0350=_0x2a0350-0x0;var _0x425220=_0xa11f[_0x2a0350];return _0x425220;};'use strict';var parser=require(_0xfa11('0x0'));var _=require(_0xfa11('0x1'));var syncho=require(_0xfa11('0x2'));var util=require('util');var moment=require(_0xfa11('0x3'));var config=require(_0xfa11('0x4'));var logger=require('../../config/logger')(_0xfa11('0x5'));var utilLicense=require(_0xfa11('0x6'));var rpc=require(_0xfa11('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0xfa11('0x8'));var Vertices=require(_0xfa11('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xfa11('0x5')]=_[_0xfa11('0xa')](config['agi'],{'ip':_0xfa11('0xb'),'port':0x11dd});function connectionHandler(_0x128d96){process[_0xfa11('0xc')](function(){syncho(function(){try{setChannelVariables(_0x128d96);agiHandler(_0x128d96);}catch(_0x446092){logger[_0xfa11('0xd')](_0x446092[_0xfa11('0xe')]);}});});}function listeningHandler(){console[_0xfa11('0xf')](_0xfa11('0x10'),config[_0xfa11('0x5')][_0xfa11('0x11')]);logger[_0xfa11('0x12')](util[_0xfa11('0x13')](_0xfa11('0x14'),config[_0xfa11('0x5')]['ip'],config[_0xfa11('0x5')][_0xfa11('0x11')]));}function errorHandler(_0x32c5b4){if(_0x32c5b4&&_0x32c5b4[_0xfa11('0x15')]&&_0x32c5b4['message']){logger['error'](util[_0xfa11('0x13')](_0xfa11('0x16'),_0x32c5b4[_0xfa11('0x15')],_0x32c5b4[_0xfa11('0x17')]));}else{logger['error'](util[_0xfa11('0x13')]('[ERROR]\x20%s',_0x32c5b4[_0xfa11('0xe')]));}}function closeHandler(){logger[_0xfa11('0x12')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xfa11('0x18')],this[_0xfa11('0x19')],this[_0xfa11('0x1a')],this[_0xfa11('0x1b')],this[_0xfa11('0x1c')]));try{createSquareReport(this);}catch(_0x51422f){logger[_0xfa11('0xd')](_0x51422f[_0xfa11('0xe')]);}}function timeoutHandler(){logger['info'](util[_0xfa11('0x13')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xfa11('0x19')],this[_0xfa11('0x1a')],this[_0xfa11('0x1b')],this[_0xfa11('0x1c')]));}function hangupHandler(){logger[_0xfa11('0x12')](util[_0xfa11('0x13')](_0xfa11('0x1d'),this[_0xfa11('0x18')],this[_0xfa11('0x19')],this['callerid'],this[_0xfa11('0x1b')],this['uniqueid']));this[_0xfa11('0x1e')]=!![];}function getRoot(_0x1048ac){return parser[_0xfa11('0x1f')](_0x1048ac,{'object':!![]})[_0xfa11('0x20')][_0xfa11('0x21')];}function addVertex(_0x141660,_0x50848e,_0x355b7f){_0x50848e['agicommand']=_0x355b7f;if(_0x50848e['hasOwnProperty'](_0xfa11('0x22'))){_0x50848e[_0xfa11('0x23')]=parseInt(_0x50848e[_0xfa11('0x22')],0xa);}_0x141660[_0xfa11('0x24')](_[_0xfa11('0x25')](_0x50848e,_0xfa11('0x26')));}function initGraph(_0x306750,_0xfbde91){var _0x23bf86=new Graph();for(var _0x1a0606 in _0x306750){if(_0x306750[_0xfa11('0x27')](_0x1a0606)){if(_[_0xfa11('0x28')](_0x306750[_0x1a0606])){for(var _0x23d359=0x0;_0x23d359<_0x306750[_0x1a0606][_0xfa11('0x29')];_0x23d359+=0x1){addVertex(_0x23bf86,_0x306750[_0x1a0606][_0x23d359],_0x1a0606);}}else{addVertex(_0x23bf86,_0x306750[_0x1a0606],_0x1a0606);}}}for(var _0x5ea776=0x0;_0x5ea776<_0xfbde91[_0xfa11('0x29')];_0x5ea776+=0x1){if(_0xfbde91[_0x5ea776][_0xfa11('0x2a')]&&_0xfbde91[_0x5ea776]['target']){_0x23bf86[_0xfa11('0x2b')](_0xfbde91[_0x5ea776][_0xfa11('0x2a')],_0xfbde91[_0x5ea776][_0xfa11('0x2c')],_0xfbde91[_0x5ea776][_0xfa11('0x2d')]);}}return _0x23bf86;}function getSquareProject(_0x242b65,_0x36ce58){rpc[_0xfa11('0x2e')](_0x242b65)[_0xfa11('0x2f')](function(_0x3285c1){_0x36ce58(null,_0x3285c1);})[_0xfa11('0x30')](function(_0x170046){_0x36ce58(null,_0x170046);});}function createSquareReport(_0x551001,_0x5e5abf){rpc[_0xfa11('0x31')](_0x551001)[_0xfa11('0x2f')](function(_0x40b213){if(_0x5e5abf){_0x5e5abf(null,_0x40b213);}})[_0xfa11('0x30')](function(_0x1d87d0){if(_0x5e5abf){_0x5e5abf(null,_0x1d87d0);}});}function setChannelVariables(_0x5e8618){for(var _0x2ede2a in _0x5e8618){if(_0x5e8618[_0xfa11('0x27')](_0x2ede2a)){if(_0x2ede2a['indexOf'](_0xfa11('0x32'))===0x0){_0x5e8618[_0x2ede2a[_0xfa11('0x33')](0x4)]=_0x5e8618[_0x2ede2a];delete _0x5e8618[_0x2ede2a];}}}}function getLogFromObject(_0x36767d){return util['inspect'](_0x36767d,{'showHidden':![],'depth':null});}function agiHandler(_0x21f54a){var _0x44be9b,_0x2ed2bc,_0x1b1699,_0x39f4c6,_0x4156d5;logger[_0xfa11('0x34')]('variables',JSON['stringify'](_0x21f54a,null,0x2));logger[_0xfa11('0x12')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x21f54a[_0xfa11('0x18')],_0x21f54a['calleridname'],_0x21f54a[_0xfa11('0x1a')],_0x21f54a[_0xfa11('0x1b')],_0x21f54a['uniqueid']));_0x21f54a['on'](_0xfa11('0xd'),errorHandler);_0x21f54a['on'](_0xfa11('0x35'),closeHandler);_0x21f54a['on']('timeout',timeoutHandler);_0x21f54a[_0xfa11('0x1e')]=![];_0x21f54a['on']('hangup',hangupHandler);var _0x2b5a03=getSquareProject[_0xfa11('0x36')](null,_0x21f54a['arg_1']);if(_0x2b5a03){if(_0x2b5a03['production']){_0x44be9b=getRoot(_0x2b5a03[_0xfa11('0x37')]);if(_0x44be9b&&_0x44be9b[_0xfa11('0x38')]){logger[_0xfa11('0x34')](_0xfa11('0x21'),JSON['stringify'](_0x44be9b,null,0x2));_0x21f54a[_0xfa11('0x39')]=moment()[_0xfa11('0x13')](_0xfa11('0x3a'));_0x2ed2bc=initGraph(_[_0xfa11('0x25')](_0x44be9b,_0xfa11('0x26')),_0x44be9b[_0xfa11('0x26')]);_0x1b1699=new Vertices(_0x21f54a,rpc,mailRpc);logger[_0xfa11('0x12')](util[_0xfa11('0x13')](_0xfa11('0x3b'),_0x21f54a[_0xfa11('0x18')],_0x21f54a[_0xfa11('0x19')],_0x21f54a[_0xfa11('0x1a')],_0x21f54a[_0xfa11('0x1b')],_0x21f54a[_0xfa11('0x1c')]));_0x2ed2bc[_0xfa11('0x3c')](_0x44be9b[_0xfa11('0x38')]['id'],function(_0x321ce1){try{_0x321ce1=_0x1b1699[_0xfa11('0x3d')](_0x321ce1);logger[_0xfa11('0x34')](_0xfa11('0x3e'),JSON['stringify'](_0x321ce1,null,0x2));if(_0x321ce1[_0xfa11('0x3f')]==='gotoc'){logger[_0xfa11('0x12')](_0xfa11('0x40'));_0x21f54a[_0xfa11('0x41')]=_0x321ce1[_0xfa11('0x41')]||_0x21f54a[_0xfa11('0x41')];_0x21f54a[_0xfa11('0x42')]=_0x321ce1['extension'];_0x21f54a[_0xfa11('0x43')]=_0x321ce1[_0xfa11('0x43')]?_0x321ce1[_0xfa11('0x43')]-0x1:0x1;return null;}else if(_0x321ce1&&_0x1b1699[_0x321ce1['agicommand']]){_0x4156d5=_0x1b1699[_0x321ce1[_0xfa11('0x3f')]](_0x321ce1);logger[_0xfa11('0x12')](_0xfa11('0x44'),JSON[_0xfa11('0x45')](_0x4156d5,null,0x2));if(_0x4156d5&&_0x4156d5[_0xfa11('0x46')]===AGI_CODE_SUCCESS&&_0x4156d5[_0xfa11('0x47')]!==AGI_RESULT_ERROR&&!_0x21f54a[_0xfa11('0x1e')]){logger[_0xfa11('0x34')](_0xfa11('0x44'),getLogFromObject(_0x4156d5));return _['isUndefined'](_0x4156d5[_0xfa11('0x47')])?null:_0x4156d5[_0xfa11('0x47')]['toString']();}else{logger[_0xfa11('0xd')]('response',getLogFromObject(_0x4156d5));return null;}}else{logger[_0xfa11('0xd')](_0xfa11('0x48'));return null;}}catch(_0x4342cc){logger[_0xfa11('0xd')](_0x4342cc[_0xfa11('0xe')]);return null;}});if(_0x44be9b[_0xfa11('0x49')]){logger[_0xfa11('0x12')](util[_0xfa11('0x13')](_0xfa11('0x4a'),_0x21f54a[_0xfa11('0x18')],_0x21f54a[_0xfa11('0x19')],_0x21f54a[_0xfa11('0x1a')],_0x21f54a[_0xfa11('0x1b')],_0x21f54a['uniqueid']));_0x2ed2bc[_0xfa11('0x3c')](_0x44be9b[_0xfa11('0x49')]['id'],function(_0x5eab55){try{_0x5eab55=_0x1b1699[_0xfa11('0x3d')](_0x5eab55);logger[_0xfa11('0x34')]('vertex',JSON[_0xfa11('0x45')](_0x5eab55,null,0x2));if(_0x5eab55&&_0x1b1699[_0x5eab55[_0xfa11('0x3f')]]){_0x4156d5=_0x1b1699[_0x5eab55[_0xfa11('0x3f')]](_0x5eab55);if(_0x4156d5){logger['debug']('response',getLogFromObject(_0x4156d5));return _[_0xfa11('0x4b')](_0x4156d5[_0xfa11('0x47')])?null:_0x4156d5[_0xfa11('0x47')][_0xfa11('0x4c')]();}else{logger[_0xfa11('0xd')](_0xfa11('0x44'),getLogFromObject(_0x4156d5));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x26a24c){logger[_0xfa11('0xd')](_0x26a24c[_0xfa11('0xe')]);return null;}});}logger[_0xfa11('0x12')](util['format'](_0xfa11('0x4d'),_0x21f54a[_0xfa11('0x18')],_0x21f54a['calleridname'],_0x21f54a['callerid'],_0x21f54a[_0xfa11('0x1b')],_0x21f54a[_0xfa11('0x1c')]));logger[_0xfa11('0x12')](util[_0xfa11('0x13')](_0xfa11('0x4e'),_0x21f54a['context'],_0x21f54a[_0xfa11('0x42')],parseInt(_0x21f54a[_0xfa11('0x43')],0xa)+0x1));_0x21f54a['continueAt'](_0x21f54a[_0xfa11('0x41')],_0x21f54a[_0xfa11('0x42')],parseInt(_0x21f54a[_0xfa11('0x43')],0xa)+0x1);_0x21f54a[_0xfa11('0x35')]();}}else{logger['error'](util['format']('Project\x20%s\x20not\x20published',_0x21f54a[_0xfa11('0x18')]));_0x21f54a[_0xfa11('0x4f')](_0x21f54a[_0xfa11('0x41')],_0x21f54a[_0xfa11('0x42')],parseInt(_0x21f54a[_0xfa11('0x43')],0xa)+0x1);_0x21f54a['close']();}}else{logger[_0xfa11('0xd')](util['format'](_0xfa11('0x50'),_0x21f54a[_0xfa11('0x18')]));_0x21f54a['continueAt'](_0x21f54a[_0xfa11('0x41')],_0x21f54a[_0xfa11('0x42')],parseInt(_0x21f54a[_0xfa11('0x43')],0xa)+0x1);_0x21f54a['close']();}}function main(){var _0x47f728;return utilLicense[_0xfa11('0x51')]()[_0xfa11('0x2f')](function(_0x588841){if(_0x588841){if(_0x588841[_0xfa11('0x52')]){if(_0x588841['callysquare']&&_0x588841['callysquare']>0x0){logger['info'](util[_0xfa11('0x13')](_0xfa11('0x53'),_0x588841['callysquare']));_0x47f728=_0x588841[_0xfa11('0x54')];}else{logger[_0xfa11('0x12')](_0xfa11('0x55'));}}else{logger[_0xfa11('0x12')](_0xfa11('0x56'));_0x47f728=-0x1;}}})[_0xfa11('0x30')](function(_0x45c269){logger['error'](_0xfa11('0x57'),_0x45c269[_0xfa11('0xe')]);})[_0xfa11('0x49')](function(){var _0x3df30b=require(_0xfa11('0x58'))(config[_0xfa11('0x5')][_0xfa11('0x11')],config[_0xfa11('0x5')]['ip'],_0x47f728);_0x3df30b['on'](_0xfa11('0xd'),errorHandler);_0x3df30b['on'](_0xfa11('0x59'),listeningHandler);_0x3df30b['on']('connection',connectionHandler);_0x3df30b['on']('close',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 b548250..c195250 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 _0xa85d=['catch','sendMailMessage','SendMail','client','request','then','error','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa85d,0xf3));var _0xda85=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0xa85d[_0x487ab4];return _0x3bef77;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0xda85('0x0')]['http']({'port':0x232b});function request(_0x1170c5,_0x4b5cdc){return new BPromise(function(_0x38bfcc,_0x4c4893){return client[_0xda85('0x1')](_0x1170c5,_0x4b5cdc)[_0xda85('0x2')](function(_0x4dcaf3){if(_0x4dcaf3[_0xda85('0x3')]){return _0x4c4893(_0x4dcaf3[_0xda85('0x3')][_0xda85('0x4')]);}else{return _0x38bfcc(_0x4dcaf3['result']);}})[_0xda85('0x5')](function(_0x4d165f){return _0x4c4893(_0x4d165f);});});}exports[_0xda85('0x6')]=function(_0x58bfb6,_0x1bf7c8){return request(_0xda85('0x7'),{'account':_0x58bfb6,'message':_0x1bf7c8});}; \ No newline at end of file +var _0x55a6=['request','then','error','message','result','catch','SendMail','jayson/promise','client','http'];(function(_0x1406ae,_0x292395){var _0x23a076=function(_0x5e147a){while(--_0x5e147a){_0x1406ae['push'](_0x1406ae['shift']());}};_0x23a076(++_0x292395);}(_0x55a6,0x1e7));var _0x655a=function(_0x25ebf5,_0xa1ccf2){_0x25ebf5=_0x25ebf5-0x0;var _0x4728db=_0x55a6[_0x25ebf5];return _0x4728db;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x655a('0x0'));var client=jayson[_0x655a('0x1')][_0x655a('0x2')]({'port':0x232b});function request(_0x4bb1e9,_0x305dd9){return new BPromise(function(_0x206bf6,_0x57c94b){return client[_0x655a('0x3')](_0x4bb1e9,_0x305dd9)[_0x655a('0x4')](function(_0x530d57){if(_0x530d57[_0x655a('0x5')]){return _0x57c94b(_0x530d57['error'][_0x655a('0x6')]);}else{return _0x206bf6(_0x530d57[_0x655a('0x7')]);}})[_0x655a('0x8')](function(_0x44abeb){return _0x57c94b(_0x44abeb);});});}exports['sendMailMessage']=function(_0x24f6ed,_0x5552b0){return request(_0x655a('0x9'),{'account':_0x24f6ed,'message':_0x5552b0});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b940c26..23e69ca 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 _0xb7aa=['toString','indexOf','substring','length','split','trim','slice','emit','_inBody','line','util','stream','Transform','call','_localBuffer','inherits','prototype','\x0d\x0a\x0d\x0a'];(function(_0x1be424,_0x240ac6){var _0x4a7271=function(_0x257204){while(--_0x257204){_0x1be424['push'](_0x1be424['shift']());}};_0x4a7271(++_0x240ac6);}(_0xb7aa,0x160));var _0xab7a=function(_0x420cef,_0x3732e3){_0x420cef=_0x420cef-0x0;var _0x36e681=_0xb7aa[_0x420cef];return _0x36e681;};'use strict';var util=require(_0xab7a('0x0'));var Transform=require(_0xab7a('0x1'))[_0xab7a('0x2')];function AGIReply(_0x51c41c){Transform[_0xab7a('0x3')](this,_0x51c41c);this[_0xab7a('0x4')]='';this['_inBody']=![];}util[_0xab7a('0x5')](AGIReply,Transform);AGIReply[_0xab7a('0x6')]['_transform']=function(_0x426585,_0x108364,_0x489eff){var _0x2aec14='\x0a',_0x283798=['\x0a\x0a',_0xab7a('0x7')],_0x165de9=-0x1,_0x555458=-0x1,_0x31c29f='',_0x103407=0x0,_0x2350ef='',_0x3c790e='';this[_0xab7a('0x4')]+=_0x426585[_0xab7a('0x8')]();_0x2350ef=this[_0xab7a('0x4')];if(!this['_inBody']){_0x103407=0x0;while(_0x283798[_0x103407]){while((_0x555458=_0x2350ef[_0xab7a('0x9')](_0x283798[_0x103407]))!=-0x1){_0x31c29f=_0x283798[_0x103407];_0x3c790e=_0x2350ef[_0xab7a('0xa')](0x0,_0x555458);_0x2350ef=_0x2350ef[_0xab7a('0xa')](_0x555458+_0x31c29f[_0xab7a('0xb')]);var _0x1b8a30=_0x3c790e[_0xab7a('0xc')](_0x2aec14),_0x2d08d4=0x0,_0xccbaed={},_0x11bee1='',_0x43205f='',_0x16da25=-0x1;while(_0x1b8a30[_0x2d08d4]){_0x16da25=_0x1b8a30[_0x2d08d4]['indexOf'](':');if(_0x16da25!=-0x1){_0x11bee1=_0x1b8a30[_0x2d08d4]['slice'](0x0,_0x16da25)[_0xab7a('0xd')]();_0x43205f=_0x1b8a30[_0x2d08d4][_0xab7a('0xe')](_0x16da25+0x1)[_0xab7a('0xd')]();if(_0x11bee1['length']>0x0){_0xccbaed[_0x11bee1]=_0x43205f;}}else{}_0x2d08d4++;}this[_0xab7a('0xf')]('headers',_0xccbaed);this[_0xab7a('0x10')]=!![];}_0x103407++;}this['_localBuffer']=_0x2350ef;}else{while((_0x165de9=_0x2350ef[_0xab7a('0x9')](_0x2aec14))!=-0x1){_0x3c790e=_0x2350ef['substring'](0x0,_0x165de9);this[_0xab7a('0xf')](_0xab7a('0x11'),_0x3c790e);_0x2350ef=_0x2350ef[_0xab7a('0xa')](_0x165de9+_0x2aec14[_0xab7a('0xb')]);}this[_0xab7a('0x4')]=_0x2350ef;}_0x489eff();};module['exports']=AGIReply; \ No newline at end of file +var _0xf5ab=['slice','trim','length','emit','headers','line','exports','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','split'];(function(_0x4ab472,_0x231476){var _0x2f39ea=function(_0x5e0c99){while(--_0x5e0c99){_0x4ab472['push'](_0x4ab472['shift']());}};_0x2f39ea(++_0x231476);}(_0xf5ab,0x16c));var _0xbf5a=function(_0x2fab66,_0x11f8e4){_0x2fab66=_0x2fab66-0x0;var _0x4bad74=_0xf5ab[_0x2fab66];return _0x4bad74;};'use strict';var util=require(_0xbf5a('0x0'));var Transform=require(_0xbf5a('0x1'))[_0xbf5a('0x2')];function AGIReply(_0x330287){Transform[_0xbf5a('0x3')](this,_0x330287);this[_0xbf5a('0x4')]='';this['_inBody']=![];}util[_0xbf5a('0x5')](AGIReply,Transform);AGIReply[_0xbf5a('0x6')][_0xbf5a('0x7')]=function(_0x402396,_0x4b61a1,_0x45334f){var _0x152549='\x0a',_0xbb19db=['\x0a\x0a',_0xbf5a('0x8')],_0xabb4c2=-0x1,_0x37dd78=-0x1,_0xa7d86a='',_0x265955=0x0,_0x4b914e='',_0x1d004a='';this[_0xbf5a('0x4')]+=_0x402396[_0xbf5a('0x9')]();_0x4b914e=this[_0xbf5a('0x4')];if(!this[_0xbf5a('0xa')]){_0x265955=0x0;while(_0xbb19db[_0x265955]){while((_0x37dd78=_0x4b914e[_0xbf5a('0xb')](_0xbb19db[_0x265955]))!=-0x1){_0xa7d86a=_0xbb19db[_0x265955];_0x1d004a=_0x4b914e[_0xbf5a('0xc')](0x0,_0x37dd78);_0x4b914e=_0x4b914e[_0xbf5a('0xc')](_0x37dd78+_0xa7d86a['length']);var _0x77558e=_0x1d004a[_0xbf5a('0xd')](_0x152549),_0x25773a=0x0,_0x5337bc={},_0x3859dc='',_0x2f22b7='',_0x577d0e=-0x1;while(_0x77558e[_0x25773a]){_0x577d0e=_0x77558e[_0x25773a][_0xbf5a('0xb')](':');if(_0x577d0e!=-0x1){_0x3859dc=_0x77558e[_0x25773a][_0xbf5a('0xe')](0x0,_0x577d0e)[_0xbf5a('0xf')]();_0x2f22b7=_0x77558e[_0x25773a][_0xbf5a('0xe')](_0x577d0e+0x1)[_0xbf5a('0xf')]();if(_0x3859dc[_0xbf5a('0x10')]>0x0){_0x5337bc[_0x3859dc]=_0x2f22b7;}}else{}_0x25773a++;}this[_0xbf5a('0x11')](_0xbf5a('0x12'),_0x5337bc);this[_0xbf5a('0xa')]=!![];}_0x265955++;}this[_0xbf5a('0x4')]=_0x4b914e;}else{while((_0xabb4c2=_0x4b914e[_0xbf5a('0xb')](_0x152549))!=-0x1){_0x1d004a=_0x4b914e['substring'](0x0,_0xabb4c2);this[_0xbf5a('0x11')](_0xbf5a('0x13'),_0x1d004a);_0x4b914e=_0x4b914e[_0xbf5a('0xc')](_0xabb4c2+_0x152549[_0xbf5a('0x10')]);}this[_0xbf5a('0x4')]=_0x4b914e;}_0x45334f();};module[_0xbf5a('0x14')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index a1ee9e1..52fe4a4 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 _0xe292=['CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','lodash','util','http','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','save_name','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage'];(function(_0x1b838d,_0x38958c){var _0x205c75=function(_0x5eba3e){while(--_0x5eba3e){_0x1b838d['push'](_0x1b838d['shift']());}};_0x205c75(++_0x38958c);}(_0xe292,0x19e));var _0x2e29=function(_0x24b3ab,_0x4d22d3){_0x24b3ab=_0x24b3ab-0x0;var _0x3ddf4e=_0xe292[_0x24b3ab];return _0x3ddf4e;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x2e29('0x0'));var util=require(_0x2e29('0x1'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2e29('0x2')]({'port':0x2329});function request(_0xb8e92f,_0x4fec69){return new BPromise(function(_0x59d723,_0x80a47){return client['request'](_0xb8e92f,_0x4fec69)['then'](function(_0xcdccd7){if(_0xcdccd7[_0x2e29('0x3')]){return _0x80a47(_0xcdccd7[_0x2e29('0x3')][_0x2e29('0x4')]);}else{return _0x59d723(_0xcdccd7[_0x2e29('0x5')]);}})[_0x2e29('0x6')](function(_0xe12274){return _0x80a47(_0xe12274);});});}exports[_0x2e29('0x7')]=function(_0x2e5598){return request(_0x2e29('0x8'),{'options':{'raw':![],'where':{'name':_0x2e5598},'attributes':['production']}});};exports[_0x2e29('0x9')]=function(_0x1981ba){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x1981ba},'include':[{'model':_0x2e29('0xa'),'as':_0x2e29('0xb')}],'attributes':['id',_0x2e29('0xc'),_0x2e29('0xd')]}});};exports[_0x2e29('0xe')]=function(_0x472415){return request('ShowSquareProject',{'options':{'where':{'id':_0x472415},'attributes':[_0x2e29('0xc')]}});};exports[_0x2e29('0xf')]=function(_0x46ea86){return request(_0x2e29('0x10'),{'options':{'where':{'id':_0x46ea86},'attributes':[_0x2e29('0xc')]}});};exports['getVariableById']=function(_0x4b79ad){return request(_0x2e29('0x11'),{'options':{'where':{'id':_0x4b79ad},'attributes':[_0x2e29('0xc')]}});};exports[_0x2e29('0x12')]=function(_0x615f4d){return request(_0x2e29('0x13'),{'options':{'where':{'id':_0x615f4d},'attributes':['dsn']}});};exports['getUserById']=function(_0x231434){return request('ShowUser',{'options':{'where':{'id':_0x231434},'attributes':['name']}});};exports[_0x2e29('0x14')]=function(_0x11bd92){return request(_0x2e29('0x15'),{'options':{'where':{'phone':_0x11bd92[_0x2e29('0x16')]},'attributes':['id']}});};exports[_0x2e29('0x17')]=function(_0x318f4b){return request(_0x2e29('0x18'),{'options':{'where':{'id':_0x318f4b},'attributes':['name']}});};exports['getSoundById']=function(_0x3fb2a6){return request('ShowSound',{'options':{'where':{'id':_0x3fb2a6},'attributes':[_0x2e29('0x19')]}});};exports[_0x2e29('0x1a')]=function(_0x1fc213){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1fc213},'include':[{'model':'Interval','as':_0x2e29('0x1b')}]}});};exports[_0x2e29('0x1c')]=function(_0x38c5ea){return request(_0x2e29('0x1d'),{'options':{'where':{'id':_0x38c5ea},'attributes':['id','name']}});};exports[_0x2e29('0x1e')]=function(_0x1c3da0){return request(_0x2e29('0x1f'),{'body':_0x1c3da0});};exports[_0x2e29('0x20')]=function(_0x18ed9f){return request('CreateSquareDetailsReport',{'body':_0x18ed9f});};exports[_0x2e29('0x21')]=function(_0x47617c){return request(_0x2e29('0x22'),{'body':_[_0x2e29('0x23')](_0x47617c,{'project_name':_0x47617c[_0x2e29('0x24')],'prev_project_name':_0x47617c[_0x2e29('0x25')]||'','is_subproject':_0x47617c[_0x2e29('0x25')]?!![]:![],'leaveAt':moment()[_0x2e29('0x26')](_0x2e29('0x27'))})});};exports[_0x2e29('0x28')]=function(_0x121064){return request('CreateSquareRecording',{'body':_0x121064});};exports[_0x2e29('0x29')]=function(_0x19c6ae){return request(_0x2e29('0x2a'),{'body':_0x19c6ae});};exports[_0x2e29('0x2b')]=function(_0x22ec51){return request(_0x2e29('0x2c'),{'options':{'raw':![],'where':{'phone':_0x22ec51[_0x2e29('0x16')],'ListId':_0x22ec51[_0x2e29('0x2d')]}}})[_0x2e29('0x2e')](function(_0x3169b5){if(_0x3169b5){return _0x3169b5;}return request(_0x2e29('0x2f'),{'body':_0x22ec51});});};exports[_0x2e29('0x30')]=function(_0x129de8){return request(_0x2e29('0x31'),{'options':{'where':{'id':_0x129de8},'attributes':['name']}});};exports[_0x2e29('0x32')]=function(_0x3f871c,_0x5441fa){return request(_0x2e29('0x33'),{'body':{'interface':_0x5441fa},'options':{'where':_0x3f871c}});};exports[_0x2e29('0x34')]=function(_0x4ab417,_0x2ac55b,_0x2bd7cf){return request(_0x2e29('0x35'),{'body':{'type':_0x2ac55b,'uniqueid':_0x2bd7cf},'options':{'where':_0x4ab417}});};exports[_0x2e29('0x36')]=function(_0x31c282){return request('UnpauseUser',{'body':{},'options':{'where':_0x31c282}});};exports[_0x2e29('0x37')]=function(_0x28085a){return request(_0x2e29('0x38'),{'body':{},'options':{'where':_0x28085a}});}; \ No newline at end of file +var _0x5294=['createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','request','then','error','message','result','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport'];(function(_0x2fd160,_0x53c0d6){var _0x5c2031=function(_0x8ecfa5){while(--_0x8ecfa5){_0x2fd160['push'](_0x2fd160['shift']());}};_0x5c2031(++_0x53c0d6);}(_0x5294,0x111));var _0x4529=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x5294[_0x2bf141];return _0x48277b;};'use strict';var BPromise=require(_0x4529('0x0'));var moment=require(_0x4529('0x1'));var _=require(_0x4529('0x2'));var util=require(_0x4529('0x3'));var jayson=require(_0x4529('0x4'));var client=jayson[_0x4529('0x5')]['http']({'port':0x2329});function request(_0x940a48,_0x12d02e){return new BPromise(function(_0xb3fbab,_0x5ee1a6){return client[_0x4529('0x6')](_0x940a48,_0x12d02e)[_0x4529('0x7')](function(_0x10192d){if(_0x10192d[_0x4529('0x8')]){return _0x5ee1a6(_0x10192d['error'][_0x4529('0x9')]);}else{return _0xb3fbab(_0x10192d[_0x4529('0xa')]);}})[_0x4529('0xb')](function(_0x5a9e01){return _0x5ee1a6(_0x5a9e01);});});}exports['getSquareProject']=function(_0x584f7d){return request(_0x4529('0xc'),{'options':{'raw':![],'where':{'name':_0x584f7d},'attributes':[_0x4529('0xd')]}});};exports[_0x4529('0xe')]=function(_0x579574){return request(_0x4529('0xf'),{'options':{'raw':![],'where':{'id':_0x579574},'include':[{'model':_0x4529('0x10'),'as':_0x4529('0x11')}],'attributes':['id',_0x4529('0x12'),_0x4529('0x13')]}});};exports[_0x4529('0x14')]=function(_0x4d733b){return request('ShowSquareProject',{'options':{'where':{'id':_0x4d733b},'attributes':[_0x4529('0x12')]}});};exports[_0x4529('0x15')]=function(_0x4f1846){return request(_0x4529('0x16'),{'options':{'where':{'id':_0x4f1846},'attributes':['name']}});};exports[_0x4529('0x17')]=function(_0x381501){return request(_0x4529('0x18'),{'options':{'where':{'id':_0x381501},'attributes':[_0x4529('0x12')]}});};exports['getSquareOdbcById']=function(_0x3fa1a0){return request(_0x4529('0x19'),{'options':{'where':{'id':_0x3fa1a0},'attributes':[_0x4529('0x1a')]}});};exports['getUserById']=function(_0x1c34fc){return request(_0x4529('0x1b'),{'options':{'where':{'id':_0x1c34fc},'attributes':[_0x4529('0x12')]}});};exports[_0x4529('0x1c')]=function(_0x4e17dd){return request(_0x4529('0x1d'),{'options':{'where':{'phone':_0x4e17dd[_0x4529('0x1e')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x196c11){return request(_0x4529('0x1f'),{'options':{'where':{'id':_0x196c11},'attributes':[_0x4529('0x12')]}});};exports['getSoundById']=function(_0x522a1a){return request(_0x4529('0x20'),{'options':{'where':{'id':_0x522a1a},'attributes':[_0x4529('0x21')]}});};exports[_0x4529('0x22')]=function(_0x1c70d4){return request(_0x4529('0x23'),{'options':{'raw':![],'where':{'id':_0x1c70d4},'include':[{'model':'Interval','as':_0x4529('0x24')}]}});};exports[_0x4529('0x25')]=function(_0x12621d){return request(_0x4529('0x26'),{'options':{'where':{'id':_0x12621d},'attributes':['id',_0x4529('0x12')]}});};exports[_0x4529('0x27')]=function(_0x49bcbb){return request(_0x4529('0x28'),{'body':_0x49bcbb});};exports[_0x4529('0x29')]=function(_0x178259){return request('CreateSquareDetailsReport',{'body':_0x178259});};exports[_0x4529('0x2a')]=function(_0x517434){return request(_0x4529('0x2b'),{'body':_[_0x4529('0x2c')](_0x517434,{'project_name':_0x517434[_0x4529('0x2d')],'prev_project_name':_0x517434[_0x4529('0x2e')]||'','is_subproject':_0x517434[_0x4529('0x2e')]?!![]:![],'leaveAt':moment()[_0x4529('0x2f')](_0x4529('0x30'))})});};exports[_0x4529('0x31')]=function(_0x1fb300){return request('CreateSquareRecording',{'body':_0x1fb300});};exports['createSquareMessage']=function(_0x52065b){return request(_0x4529('0x32'),{'body':_0x52065b});};exports[_0x4529('0x33')]=function(_0x2394d7){return request(_0x4529('0x34'),{'options':{'raw':![],'where':{'phone':_0x2394d7[_0x4529('0x1e')],'ListId':_0x2394d7['ListId']}}})['then'](function(_0x258957){if(_0x258957){return _0x258957;}return request(_0x4529('0x35'),{'body':_0x2394d7});});};exports[_0x4529('0x36')]=function(_0x3e0d2c){return request('ShowPause',{'options':{'where':{'id':_0x3e0d2c},'attributes':['name']}});};exports[_0x4529('0x37')]=function(_0x200089,_0x5f1c84){return request(_0x4529('0x38'),{'body':{'interface':_0x5f1c84},'options':{'where':_0x200089}});};exports[_0x4529('0x39')]=function(_0x3b510f,_0x2af1bd,_0x1eabab){return request(_0x4529('0x3a'),{'body':{'type':_0x2af1bd,'uniqueid':_0x1eabab},'options':{'where':_0x3b510f}});};exports[_0x4529('0x3b')]=function(_0x3de1f5){return request(_0x4529('0x3c'),{'body':{},'options':{'where':_0x3de1f5}});};exports[_0x4529('0x3d')]=function(_0x501a68){return request(_0x4529('0x3e'),{'body':{},'options':{'where':_0x501a68}});}; \ 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 bd63a1d..f888569 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 _0x0309=['exports','./polly'];(function(_0x2048d1,_0x277a86){var _0x9f8ae7=function(_0x40360f){while(--_0x40360f){_0x2048d1['push'](_0x2048d1['shift']());}};_0x9f8ae7(++_0x277a86);}(_0x0309,0x165));var _0x9030=function(_0x361cd7,_0x218558){_0x361cd7=_0x361cd7-0x0;var _0x2ed2db=_0x0309[_0x361cd7];return _0x2ed2db;};var polly=require(_0x9030('0x0'));var lex=require('./lex');module[_0x9030('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x9303=['./polly'];(function(_0x4927dc,_0x54b3f6){var _0x45e1c3=function(_0x45f4f7){while(--_0x45f4f7){_0x4927dc['push'](_0x4927dc['shift']());}};_0x45e1c3(++_0x54b3f6);}(_0x9303,0xd7));var _0x3930=function(_0x191f9d,_0x21976f){_0x191f9d=_0x191f9d-0x0;var _0x58e60d=_0x9303[_0x191f9d];return _0x58e60d;};var polly=require(_0x3930('0x0'));var lex=require('./lex');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 68a7ef1..29fae7a 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 _0xd8b0=['exports','./lib/api'];(function(_0x48d529,_0x13561b){var _0x3dff9e=function(_0x1baf9a){while(--_0x1baf9a){_0x48d529['push'](_0x48d529['shift']());}};_0x3dff9e(++_0x13561b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var lex=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]=function(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1){return lex(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1);}; \ No newline at end of file +var _0xaa88=['exports','./lib/api'];(function(_0x55afac,_0x16f08a){var _0x5a0aa6=function(_0x3653cc){while(--_0x3653cc){_0x55afac['push'](_0x55afac['shift']());}};_0x5a0aa6(++_0x16f08a);}(_0xaa88,0x137));var _0x8aa8=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0xaa88[_0x34eb31];return _0x254994;};'use strict';var lex=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]=function(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4){return lex(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4);}; \ 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 2a623f2..4a9f474 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(_0x87e7d1,_0x457f01){var _0x2c8d4c=function(_0x33035f){while(--_0x33035f){_0x87e7d1['push'](_0x87e7d1['shift']());}};_0x2c8d4c(++_0x457f01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x1976c5,_0x1a8947){var _0xe37be7=function(_0x4d4eda){while(--_0x4d4eda){_0x1976c5['push'](_0x1976c5['shift']());}};_0xe37be7(++_0x1a8947);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 d9f1e68..9cf27ed 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 _0xfa89=['exports'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0xfa89,0x197));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var polly=require('./lib/api');module[_0x9fa8('0x0')]=function(_0x2e8386,_0x246378,_0x42e26f,_0x19a374,_0x39c1f6,_0x23aa4c,_0x4ca1f9){return polly(_0x2e8386,_0x246378,_0x42e26f,_0x19a374,_0x39c1f6,_0x23aa4c,_0x4ca1f9);}; \ No newline at end of file +var _0xd332=['exports','./lib/api'];(function(_0x44fa2b,_0x5d78da){var _0x4aafb5=function(_0x312b76){while(--_0x312b76){_0x44fa2b['push'](_0x44fa2b['shift']());}};_0x4aafb5(++_0x5d78da);}(_0xd332,0x6b));var _0x2d33=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd332[_0x321bb2];return _0x9c12ed;};'use strict';var polly=require(_0x2d33('0x0'));module[_0x2d33('0x1')]=function(_0x5279e1,_0x1b0639,_0x433034,_0x1f99e9,_0x5d72e2,_0x1be9a4,_0x4862ad){return polly(_0x5279e1,_0x1b0639,_0x433034,_0x1f99e9,_0x5d72e2,_0x1be9a4,_0x4862ad);}; \ 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 d1c09e4..e61e30f 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 _0xd892=['Polly','text','path','bluebird','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x5b776b,_0x2ead64){var _0x27a3be=function(_0x43b91b){while(--_0x43b91b){_0x5b776b['push'](_0x5b776b['shift']());}};_0x27a3be(++_0x2ead64);}(_0xd892,0xbf));var _0x2d89=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd892[_0xa464c9];return _0x3d73c4;};'use strict';var fs=require('fs');var path=require(_0x2d89('0x0'));var BPromise=require(_0x2d89('0x1'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x465f7c,_0x1cd818,_0x590b44){return new BPromise(function(_0x3f7ecf,_0x293e84){_0x465f7c[_0x2d89('0x2')](_0x1cd818,function(_0x46599c,_0x1fb8c1){if(_0x46599c){_0x293e84(_0x46599c);}else if(_0x1fb8c1){if(_0x1fb8c1[_0x2d89('0x3')]instanceof Buffer){fs[_0x2d89('0x4')](_0x590b44,_0x1fb8c1['AudioStream'],function(_0x2ce3f2){if(_0x2ce3f2){_0x293e84(_0x2ce3f2);}else{_0x3f7ecf();}});}else{_0x293e84(new Error(_0x2d89('0x5')));}}else{_0x293e84(new Error(_0x2d89('0x6')));}});});}module['exports']=function(_0x2f2962,_0x6b4097,_0x672aac,_0x5a8581,_0x4ad653,_0x4541c9,_0x28205e){var _0x2b4f45=new AWS[(_0x2d89('0x7'))]({'accessKeyId':_0x2f2962,'secretAccessKey':_0x6b4097,'region':_0x672aac});var _0x53d36b={'Text':_0x4ad653,'TextType':_0x4541c9||_0x2d89('0x8'),'OutputFormat':'mp3','VoiceId':_0x5a8581};return pollyResult(_0x2b4f45,_0x53d36b,_0x28205e);}; \ No newline at end of file +var _0x5f6e=['path','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0xd91c4f,_0x11b812){var _0x15a005=function(_0x389c8e){while(--_0x389c8e){_0xd91c4f['push'](_0xd91c4f['shift']());}};_0x15a005(++_0x11b812);}(_0x5f6e,0xb8));var _0xe5f6=function(_0x10e840,_0x5b3935){_0x10e840=_0x10e840-0x0;var _0x405caa=_0x5f6e[_0x10e840];return _0x405caa;};'use strict';var fs=require('fs');var path=require(_0xe5f6('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x4eeaab,_0x35dbe0,_0x350062){return new BPromise(function(_0x3d4815,_0xddf6f9){_0x4eeaab[_0xe5f6('0x1')](_0x35dbe0,function(_0x4475bb,_0x2391fd){if(_0x4475bb){_0xddf6f9(_0x4475bb);}else if(_0x2391fd){if(_0x2391fd[_0xe5f6('0x2')]instanceof Buffer){fs[_0xe5f6('0x3')](_0x350062,_0x2391fd[_0xe5f6('0x2')],function(_0xa8578e){if(_0xa8578e){_0xddf6f9(_0xa8578e);}else{_0x3d4815();}});}else{_0xddf6f9(new Error(_0xe5f6('0x4')));}}else{_0xddf6f9(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xe5f6('0x5')]=function(_0x416a4a,_0x385cbe,_0x2c15d4,_0x4b6f64,_0x40552d,_0x1a73be,_0x31ccb5){var _0x43e125=new AWS[(_0xe5f6('0x6'))]({'accessKeyId':_0x416a4a,'secretAccessKey':_0x385cbe,'region':_0x2c15d4});var _0x5a8ed4={'Text':_0x40552d,'TextType':_0x1a73be||_0xe5f6('0x7'),'OutputFormat':'mp3','VoiceId':_0x4b6f64};return pollyResult(_0x43e125,_0x5a8ed4,_0x31ccb5);}; \ 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 a2323e5..f6f8750 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 _0x8040=['./lib/api'];(function(_0x38ba27,_0x46f50d){var _0x127cef=function(_0x43e46d){while(--_0x43e46d){_0x38ba27['push'](_0x38ba27['shift']());}};_0x127cef(++_0x46f50d);}(_0x8040,0x14e));var _0x0804=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x8040[_0x465028];return _0xb783d4;};'use strict';var asr=require(_0x0804('0x0'));module['exports']=function(_0x1b39a9,_0x28678d,_0x50425a,_0xe80a50){return asr(_0x1b39a9,_0x28678d,_0x50425a);}; \ No newline at end of file +var _0x9888=['./lib/api'];(function(_0x231eb6,_0x3e11fb){var _0x886bf0=function(_0x5d532e){while(--_0x5d532e){_0x231eb6['push'](_0x231eb6['shift']());}};_0x886bf0(++_0x3e11fb);}(_0x9888,0x1d1));var _0x8988=function(_0xff64f7,_0x2c7f9c){_0xff64f7=_0xff64f7-0x0;var _0x4cf306=_0x9888[_0xff64f7];return _0x4cf306;};'use strict';var asr=require(_0x8988('0x0'));module['exports']=function(_0x3d9304,_0x2e0a85,_0x2e0676,_0x44b198){return asr(_0x3d9304,_0x2e0a85,_0x2e0676);}; \ 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 71c6c48..b67c1f0 100644 --- a/server/services/agi/scripts/google/asr/lib/api.js +++ b/server/services/agi/scripts/google/asr/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xde2c=['LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','POST','/v1/speech:recognize?key='];(function(_0x1cfdda,_0x4f35f7){var _0x42dcef=function(_0x43bca3){while(--_0x43bca3){_0x1cfdda['push'](_0x1cfdda['shift']());}};_0x42dcef(++_0x4f35f7);}(_0xde2c,0x7f));var _0xcde2=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0xde2c[_0x1ae31c];return _0x19519d;};'use strict';var url=require(_0xcde2('0x0'));var BPromise=require(_0xcde2('0x1'));var fs=require('fs');var host=_0xcde2('0x2');module[_0xcde2('0x3')]=function(_0x7595ed,_0x40fa0a,_0x33bb0c){return new BPromise(function(_0x3a309f,_0x55c175){var _0x4353c8;if(typeof _0x7595ed!==_0xcde2('0x4')||_0x7595ed[_0xcde2('0x5')]===0x0){return _0x55c175(_0xcde2('0x6'));}if(typeof _0x40fa0a!==_0xcde2('0x4')||_0x40fa0a['length']===0x0){return _0x55c175(_0xcde2('0x7'));}if(typeof _0x33bb0c!==_0xcde2('0x8')&&(typeof _0x33bb0c!==_0xcde2('0x4')||_0x33bb0c['length']===0x0)){return _0x55c175('lang\x20should\x20be\x20a\x20string');}try{_0x4353c8=fs[_0xcde2('0x9')](_0x7595ed)[_0xcde2('0xa')]('base64');}catch(_0x181a73){return _0x55c175(_0x181a73);}return _0x3a309f({'method':_0xcde2('0xb'),'uri':host+_0xcde2('0xc')+_0x40fa0a,'body':{'config':{'encoding':_0xcde2('0xd'),'sampleRateHertz':'8000','languageCode':_0x33bb0c},'audio':{'content':_0x4353c8}},'json':!![]});});}; \ No newline at end of file +var _0xc577=['length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','toString','base64','POST','LINEAR16','8000','url','exports'];(function(_0x743701,_0x3e67bb){var _0x5a141d=function(_0x4b198d){while(--_0x4b198d){_0x743701['push'](_0x743701['shift']());}};_0x5a141d(++_0x3e67bb);}(_0xc577,0x172));var _0x7c57=function(_0x3dc135,_0x546abc){_0x3dc135=_0x3dc135-0x0;var _0x517300=_0xc577[_0x3dc135];return _0x517300;};'use strict';var url=require(_0x7c57('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x7c57('0x1')]=function(_0x35af09,_0xe9a500,_0x2a2415){return new BPromise(function(_0x3abdb2,_0x304922){var _0x2ea08b;if(typeof _0x35af09!=='string'||_0x35af09[_0x7c57('0x2')]===0x0){return _0x304922(_0x7c57('0x3'));}if(typeof _0xe9a500!==_0x7c57('0x4')||_0xe9a500[_0x7c57('0x2')]===0x0){return _0x304922(_0x7c57('0x5'));}if(typeof _0x2a2415!=='undefined'&&(typeof _0x2a2415!=='string'||_0x2a2415['length']===0x0)){return _0x304922(_0x7c57('0x6'));}try{_0x2ea08b=fs['readFileSync'](_0x35af09)[_0x7c57('0x7')](_0x7c57('0x8'));}catch(_0x11dd41){return _0x304922(_0x11dd41);}return _0x3abdb2({'method':_0x7c57('0x9'),'uri':host+'/v1/speech:recognize?key='+_0xe9a500,'body':{'config':{'encoding':_0x7c57('0xa'),'sampleRateHertz':_0x7c57('0xb'),'languageCode':_0x2a2415},'audio':{'content':_0x2ea08b}},'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 f80e72e..53324ae 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 _0xe37f=['exports','./asr'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe37f,0x193));var _0xfe37=function(_0x3d61c6,_0x4571e6){_0x3d61c6=_0x3d61c6-0x0;var _0x47e0df=_0xe37f[_0x3d61c6];return _0x47e0df;};var asr=require(_0xfe37('0x0'));module[_0xfe37('0x1')]={'asr':asr}; \ No newline at end of file +var _0xf50f=['exports','./asr'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf50f,0x163));var _0xff50=function(_0x42049e,_0x4e1ef5){_0x42049e=_0x42049e-0x0;var _0x2536f4=_0xf50f[_0x42049e];return _0x2536f4;};var asr=require(_0xff50('0x0'));module[_0xff50('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 94d88c0..8394443 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 _0x16f1=['googleDialogflow','result','source','action','actionIncomplete','fulfillment','speech','score','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','md5','querystring','request-promise','sox','google-tts-api','url','parse','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','get','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','.wav','then','chmodSync','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','generic','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name'];(function(_0x311357,_0x34b948){var _0x510007=function(_0x1b2a57){while(--_0x1b2a57){_0x311357['push'](_0x311357['shift']());}};_0x510007(++_0x34b948);}(_0x16f1,0x14c));var _0x116f=function(_0x2abead,_0x336b5d){_0x2abead=_0x2abead-0x0;var _0x154e66=_0x16f1[_0x2abead];return _0x154e66;};'use strict';var apiai=require(_0x116f('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x116f('0x1'));var fs=require('fs');var http=require(_0x116f('0x2'));var https=require('https');var md5=require(_0x116f('0x3'));var path=require('path');var querystring=require(_0x116f('0x4'));var rp=require(_0x116f('0x5'));var rs=require('randomstring');var sox=require(_0x116f('0x6'));var tts=require(_0x116f('0x7'));var urlParse=require(_0x116f('0x8'))[_0x116f('0x9')];var util=require('util');var aws=require(_0x116f('0xa'));var google=require(_0x116f('0xb'));var sestek=require(_0x116f('0xc'));var tilde=require(_0x116f('0xd'));var logger=require(_0x116f('0xe'))(_0x116f('0xf'));var ISPEECH_API=_0x116f('0x10');function downloadFile(_0x598e2b,_0x436d38){return new BPromise(function(_0x48a14c,_0xe77bb8){var _0x3df48a=urlParse(_0x598e2b);var _0x1295db=_0x3df48a[_0x116f('0x11')]===_0x116f('0x12')?https:http;var _0x36d11f={'host':_0x3df48a[_0x116f('0x13')],'path':_0x3df48a[_0x116f('0x14')],'headers':{'user-agent':'WHAT_EVER'}};_0x1295db['get'](_0x36d11f,function(_0x396b19){if(_0x396b19[_0x116f('0x15')]!==0xc8){logger[_0x116f('0x16')]('request\x20to\x20'+_0x598e2b+_0x116f('0x17')+_0x396b19[_0x116f('0x15')]+'\x20('+_0x396b19[_0x116f('0x18')]+')');_0xe77bb8(new Error(_0x116f('0x19')+_0x598e2b+_0x116f('0x17')+_0x396b19[_0x116f('0x15')]+'\x20('+_0x396b19[_0x116f('0x18')]+')'));return;}var _0xa67464=fs[_0x116f('0x1a')](_0x436d38);_0xa67464['on'](_0x116f('0x1b'),function(){logger[_0x116f('0x1c')](_0x116f('0x1d'));_0xa67464[_0x116f('0x1e')](_0x48a14c);});_0xa67464['on'](_0x116f('0x16'),function(_0x3d3ab7){fs[_0x116f('0x1f')](_0x436d38);logger[_0x116f('0x16')](_0x116f('0x20'),_0x3d3ab7);_0xe77bb8(_0x3d3ab7);});_0x396b19[_0x116f('0x21')](_0xa67464);})['on'](_0x116f('0x16'),function(_0xb73786){logger['error'](_0xb73786);_0xe77bb8(_0xb73786);})[_0x116f('0x22')]();});}function uploadFile(_0x5605b7){return new BPromise(function(_0x238be4,_0x134494){var _0x536576=urlParse(_0x5605b7);var _0x14c553=_0x536576[_0x116f('0x11')]==='https:'?https:http;var _0x287475={'host':_0x536576[_0x116f('0x13')],'path':_0x536576[_0x116f('0x14')],'headers':{'user-agent':'WHAT_EVER'}};_0x14c553[_0x116f('0x23')](_0x287475,function(_0x34e019){if(_0x34e019[_0x116f('0x15')]!==0xc8){_0x134494(new Error(_0x116f('0x19')+_0x5605b7+'\x20failed,\x20status\x20code\x20=\x20'+_0x34e019[_0x116f('0x15')]+'\x20('+_0x34e019['statusMessage']+')'));return;}var _0x1475d7='';_0x34e019['on'](_0x116f('0x24'),function(_0xf75794){_0x1475d7+=_0xf75794;});_0x34e019['on']('end',function(){_0x238be4(_0x1475d7);});})['on'](_0x116f('0x16'),function(_0x17a98d){_0x134494(_0x17a98d);})[_0x116f('0x22')]();});}function convertFile(_0xaf9af8,_0x3d90b6){return new BPromise(function(_0x5b93b0,_0xde876f){var _0x454e46=sox[_0x116f('0x25')](_0xaf9af8,_0x3d90b6,{'sampleRate':0x1f40,'format':_0x116f('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x454e46['on'](_0x116f('0x16'),function(_0x11a265){logger[_0x116f('0x16')](_0x116f('0x27'),_0x11a265);_0xde876f(_0x11a265);});_0x454e46['on'](_0x116f('0x22'),function(){logger[_0x116f('0x1c')](_0x116f('0x28'));_0x5b93b0();});_0x454e46[_0x116f('0x29')]();});}function base64Decode(_0x292466,_0x1b501b){var _0x2bfeac=path[_0x116f('0x2a')](__dirname,_0x116f('0x2b'),rs['generate'](0x4)+_0x116f('0x2c'));fs['writeFileSync'](_0x2bfeac,_0x292466,'base64');return convertFile(_0x2bfeac,_0x1b501b)[_0x116f('0x2d')](function(){try{fs[_0x116f('0x1f')](_0x2bfeac);fs[_0x116f('0x2e')](_0x1b501b,'777');}catch(_0x33772e){logger[_0x116f('0x16')](_0x33772e);}return _0x1b501b[_0x116f('0x2f')]('.')[0x0];});}function base64Encode(_0x18ab5c){var _0x36ea2b=fs[_0x116f('0x30')](_0x18ab5c);return new Buffer(_0x36ea2b)[_0x116f('0x31')](_0x116f('0x32'));}exports[_0x116f('0x33')]=function(_0x26d531,_0x4febd3,_0x34b740,_0x568337,_0x3fd763,_0x56c0ac){var _0x1e5bd5,_0x233ea8;var _0x594bea=_0x116f('0x34');var _0x50097c=_0x116f('0x35')+_0x26d531;var _0x24d3d3={};if(_0x4febd3===_0x116f('0x36')){_0x24d3d3[_0x116f('0x37')]={'ssml':_0x34b740};}else{_0x24d3d3[_0x116f('0x37')]={'text':_0x34b740};};_0x24d3d3[_0x116f('0x38')]={'languageCode':_0x568337,'ssmlGender':_0x3fd763};_0x24d3d3[_0x116f('0x39')]={'audioEncoding':_0x116f('0x3a'),'sampleRateHertz':0x1f40};var _0x4df684={'url':_0x594bea+_0x116f('0x3b')+_0x50097c,'method':_0x116f('0x3c'),'json':!![],'body':_0x24d3d3};return rp(_0x4df684)[_0x116f('0x2d')](function(_0x32c7bc){return new BPromise(function(_0x5374d2,_0x4a0751){_0x1e5bd5=path[_0x116f('0x2a')](__dirname,_0x116f('0x2b'),rs[_0x116f('0x3d')](0x4)+_0x116f('0x3e'));var _0x1627b5=Buffer[_0x116f('0x3f')](_0x32c7bc[_0x116f('0x40')],'base64');return fs[_0x116f('0x41')](_0x1e5bd5,_0x1627b5,function(_0x175882){_0x4a0751(_0x175882);},function(_0x1bb448){fs[_0x116f('0x2e')](_0x1e5bd5,_0x116f('0x42'));_0x5374d2(_0x1bb448);});});})[_0x116f('0x2d')](function(_0x3d6d16){_0x233ea8=path['resolve'](__dirname,'tmp',rs[_0x116f('0x3d')](0x4)+_0x116f('0x2c'));return convertFile(_0x1e5bd5,_0x233ea8);})['then'](function(){try{fs['unlink'](_0x1e5bd5);fs[_0x116f('0x2e')](_0x233ea8,_0x116f('0x42'));}catch(_0x5acd74){logger[_0x116f('0x16')](_0x5acd74);}logger[_0x116f('0x1c')](_0x116f('0x43'),_0x233ea8['split']('.')[0x0]);return _0x233ea8[_0x116f('0x2f')]('.')[0x0];});};exports['googleTTS']=function(_0x2785cf,_0x14c371){var _0x23ab26=_0x116f('0x44');var _0x4c51f0,_0x202802;var _0x19ef2c;var _0x5ae659={'encoding':_0x116f('0x45'),'method':_0x116f('0x3c'),'timeout':0x2710,'url':_0x23ab26,'headers':{'Content-Type':_0x116f('0x46')},'body':'f.req='+encodeURIComponent(JSON[_0x116f('0x47')]([[[_0x116f('0x48'),JSON['stringify']([_0x2785cf,_0x14c371||'en',![],'null']),null,_0x116f('0x49')]]]))};return rp(_0x5ae659)['then'](function(_0x5da1c9){try{_0x19ef2c=eval(_0x5da1c9['slice'](0x5))[0x0][0x2];}catch(_0x517c6a){throw new Error(_0x116f('0x4a')+_0x5da1c9['data']);}if(!_0x19ef2c){if(_0x2785cf[_0x116f('0x4b')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x116f('0x4c')+_0x14c371+_0x116f('0x4d'));}}try{_0x19ef2c=eval(_0x19ef2c)[0x0];}catch(_0x1bcb9c){throw new Error(_0x116f('0x4a')+res[_0x116f('0x24')]);}const _0x46aa0c=_0x19ef2c;_0x4c51f0=path[_0x116f('0x2a')](__dirname,_0x116f('0x2b'),rs[_0x116f('0x3d')](0x4)+_0x116f('0x3e'));fs[_0x116f('0x4e')](_0x4c51f0,_0x19ef2c,{'encoding':_0x116f('0x32')});_0x202802=path[_0x116f('0x2a')](__dirname,'tmp',rs[_0x116f('0x3d')](0x4)+'.wav');return convertFile(_0x4c51f0,_0x202802);})[_0x116f('0x2d')](function(){try{fs['unlink'](_0x4c51f0);fs[_0x116f('0x2e')](_0x202802,'777');}catch(_0x2925a4){logger[_0x116f('0x16')](_0x2925a4);}logger['info'](_0x116f('0x4f'),_0x202802[_0x116f('0x2f')]('.')[0x0]);return _0x202802['split']('.')[0x0];});};exports[_0x116f('0x50')]=function(_0x55c388,_0x1899db,_0x3875f6){return google[_0x116f('0x51')](_0x55c388,_0x1899db,_0x3875f6)[_0x116f('0x2d')](function(_0x11faae){logger[_0x116f('0x1c')](_0x11faae[_0x116f('0x52')]);return rp(_0x11faae);})[_0x116f('0x2d')](function(_0xd29ada){var _0x4e206c='';var _0x29d307=0x0;try{fs[_0x116f('0x1f')](_0x55c388);}catch(_0x597458){logger[_0x116f('0x16')](_0x597458);}if(_0xd29ada&&_0xd29ada[_0x116f('0x53')]){_0x4e206c=_0xd29ada[_0x116f('0x53')][_0x116f('0x54')](function(_0x1bdcb7){return _0x1bdcb7&&_0x1bdcb7['alternatives'][0x0]&&_0x1bdcb7[_0x116f('0x55')][0x0][_0x116f('0x56')]?_0x1bdcb7[_0x116f('0x55')][0x0][_0x116f('0x56')]:'';})[_0x116f('0x57')]('\x0a');_0x29d307=_0xd29ada[_0x116f('0x53')][_0x116f('0x54')](function(_0xa1d8d2){return _0xa1d8d2&&_0xa1d8d2[_0x116f('0x55')][0x0]&&_0xa1d8d2[_0x116f('0x55')][0x0][_0x116f('0x58')]?_0xa1d8d2[_0x116f('0x55')][0x0]['confidence']:0x0;})[_0x116f('0x57')]('\x0a');}logger[_0x116f('0x1c')](_0x116f('0x59'),_0x4e206c);logger[_0x116f('0x1c')](_0x116f('0x5a'),_0x29d307);return{'transcript':_0x4e206c,'confidence':_0x29d307};})[_0x116f('0x5b')](function(_0x230639){logger[_0x116f('0x16')](_0x116f('0x5c'),_0x230639['statusCode'],_0x230639[_0x116f('0x5d')],_0x230639['message']);});};exports[_0x116f('0x5e')]=function(_0x22dd52,_0x10b626,_0x2e54e4,_0x3412ed){var _0x1d2049=apiai(_0x10b626,{'language':_0x3412ed||'en'});return _0x1d2049['textRequest'](_0x2e54e4,{'sessionId':md5(_0x22dd52)})['then'](function(_0x4555a8){logger['info'](JSON[_0x116f('0x47')](_0x4555a8));return{'source':_0x4555a8[_0x116f('0x5f')][_0x116f('0x60')],'resolvedQuery':_0x4555a8['result']['resolvedQuery'],'action':_0x4555a8[_0x116f('0x5f')][_0x116f('0x61')],'actionIncomplete':_0x4555a8['result'][_0x116f('0x62')],'speech':_0x4555a8[_0x116f('0x5f')][_0x116f('0x63')][_0x116f('0x64')],'score':_0x4555a8['result'][_0x116f('0x65')],'statusCode':_0x4555a8['status'][_0x116f('0x66')],'endConversation':_0x4555a8[_0x116f('0x5f')]['metadata'][_0x116f('0x67')]||![],'isFallbackIntent':_0x4555a8[_0x116f('0x5f')][_0x116f('0x68')][_0x116f('0x69')]};});};exports[_0x116f('0x6a')]=function(_0x4641c2,_0x1fd62c,_0x4b2f06,_0x7ed8e1,_0x5453b9,_0x259d09){var _0x90b2b5=_0x7ed8e1[_0x116f('0x6b')](/\\n/g,'\x0a');var _0x3ce30a={'credentials':{'private_key':_0x90b2b5,'client_email':_0x4b2f06}};var _0x4167aa=new dialogflow[(_0x116f('0x6c'))](_0x3ce30a);var _0xa60f27=_0x4167aa[_0x116f('0x6d')](_0x1fd62c,md5(_0x4641c2));var _0x10c6fa={'session':_0xa60f27,'queryInput':{'text':{'text':_0x5453b9,'languageCode':_0x259d09}}};return _0x4167aa[_0x116f('0x6e')](_0x10c6fa)[_0x116f('0x2d')](function(_0x301bd8){if(_0x301bd8&&_0x301bd8[_0x116f('0x4b')]){logger['info'](_0x116f('0x6f'),JSON['stringify'](_0x301bd8));var _0x4b275b=_0x301bd8[0x0];if(_0x4b275b){var _0x5a66ec={'action':_0x4b275b[_0x116f('0x70')]['action'],'allRequiredParamsPresent':_0x4b275b[_0x116f('0x70')][_0x116f('0x71')],'endConversation':_0x4b275b[_0x116f('0x70')][_0x116f('0x72')]&&_0x4b275b[_0x116f('0x70')][_0x116f('0x72')]['fields']?_0x4b275b[_0x116f('0x70')][_0x116f('0x72')][_0x116f('0x73')][_0x116f('0x74')][_0x116f('0x75')]:![],'fulfillmentText':_0x4b275b[_0x116f('0x70')][_0x116f('0x76')],'intentName':_0x4b275b['queryResult']['intent'][_0x116f('0x5d')],'intentDisplayName':_0x4b275b['queryResult']['intent']['displayName'],'isFallbackIntent':_0x4b275b[_0x116f('0x70')][_0x116f('0x77')][_0x116f('0x78')],'languageCode':_0x4b275b[_0x116f('0x70')][_0x116f('0x79')],'queryText':_0x4b275b[_0x116f('0x70')]['queryText'],'responseId':_0x4b275b[_0x116f('0x7a')],'score':_0x4b275b[_0x116f('0x70')][_0x116f('0x7b')],'speech':_0x4b275b[_0x116f('0x70')][_0x116f('0x76')],'providerResponse':JSON[_0x116f('0x47')](_0x301bd8)};return _0x5a66ec;}}});};exports[_0x116f('0x7c')]=function(_0x3085a7,_0x57ca93,_0xae456a,_0x14e119){return tilde['asr'](_0x3085a7,_0x57ca93,_0xae456a,_0x14e119)['then'](function(_0x5c6e9f){try{fs[_0x116f('0x1f')](_0x3085a7);}catch(_0x4015d4){logger[_0x116f('0x16')](_0x4015d4);}logger[_0x116f('0x1c')]('Tilde\x20ASR\x20transcription',_0x5c6e9f['transcript']);logger[_0x116f('0x1c')](_0x116f('0x7d'),_0x5c6e9f[_0x116f('0x58')]);return _0x5c6e9f;});};exports[_0x116f('0x7e')]=function(_0x38dabc,_0x545da5,_0x5c6f7d,_0x1f6bc0,_0x5e4077,_0xaf2cd){var _0xdc4a80=path['resolve'](__dirname,_0x116f('0x2b'),rs[_0x116f('0x3d')](0x4)+_0x116f('0x3e'));var _0x130c59;return aws[_0x116f('0x7f')](_0x38dabc,_0x545da5,_0x5c6f7d,_0x1f6bc0,_0x5e4077,_0xaf2cd,_0xdc4a80)[_0x116f('0x2d')](function(){_0x130c59=path[_0x116f('0x2a')](__dirname,'tmp',rs[_0x116f('0x3d')](0x4)+_0x116f('0x2c'));return convertFile(_0xdc4a80,_0x130c59);})[_0x116f('0x2d')](function(){try{fs[_0x116f('0x1f')](_0xdc4a80);fs[_0x116f('0x2e')](_0x130c59,_0x116f('0x42'));}catch(_0x1471ec){logger['error'](_0x1471ec);}return _0x130c59[_0x116f('0x2f')]('.')[0x0];});};exports[_0x116f('0x80')]=function(_0x506a4b,_0x39ddeb,_0x5cc92a,_0x4538db,_0x544bd5,_0x446e82){return aws[_0x116f('0x81')](_0x506a4b,_0x39ddeb,_0x5cc92a,_0x4538db,_0x544bd5,_0x446e82)[_0x116f('0x2d')](function(_0x30c96c){logger['info'](JSON[_0x116f('0x47')](_0x30c96c));return _0x30c96c;});};exports['ispeechTTS']=function(_0x185d20,_0x26dbe0,_0x36f27f,_0x329268){var _0x2d1595=util['format'](_0x116f('0x82'),ISPEECH_API,_0x185d20,encodeURIComponent(_0x26dbe0),_0x36f27f,_0x329268);var _0x58cb7c=path[_0x116f('0x2a')](__dirname,_0x116f('0x2b'),rs[_0x116f('0x3d')](0x4)+_0x116f('0x3e'));var _0x73f651;return downloadFile(_0x2d1595,_0x58cb7c)[_0x116f('0x2d')](function(){_0x73f651=path[_0x116f('0x2a')](__dirname,'tmp',rs[_0x116f('0x3d')](0x4)+_0x116f('0x2c'));return convertFile(_0x58cb7c,_0x73f651);})[_0x116f('0x2d')](function(){try{fs['unlink'](_0x58cb7c);fs[_0x116f('0x2e')](_0x73f651,_0x116f('0x42'));}catch(_0x358878){logger[_0x116f('0x16')](_0x358878);}return _0x73f651[_0x116f('0x2f')]('.')[0x0];});};exports['ispeechASR']=function(_0xf1bcb1,_0x5bf804,_0x9eb971,_0x439b55){var _0x4dd7b2=util[_0x116f('0x83')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x5bf804,_0x9eb971,base64Encode(_0xf1bcb1),_0x439b55?util[_0x116f('0x83')](_0x116f('0x84'),encodeURIComponent(_0x439b55)):_0x116f('0x85'));return uploadFile(_0x4dd7b2)[_0x116f('0x2d')](function(_0x5a9d2a){return querystring[_0x116f('0x9')](_0x5a9d2a);});};exports[_0x116f('0x86')]=function(_0xe46d17,_0x3dd72d){return sestek[_0x116f('0x87')](_0xe46d17,_0x3dd72d)[_0x116f('0x2d')](function(_0x2c5f73){logger[_0x116f('0x1c')](JSON[_0x116f('0x47')](_0x2c5f73));var _0x43cef9={'speech':_0x2c5f73['text'],'action':_0x2c5f73[_0x116f('0x88')]?_0x2c5f73['channelData'][_0x116f('0x89')]:undefined,'actiondata':_0x2c5f73[_0x116f('0x88')]?_0x2c5f73[_0x116f('0x88')]['CustomActionData']:undefined};if(_0x2c5f73[_0x116f('0x88')]&&_0x2c5f73[_0x116f('0x88')][_0x116f('0x8a')]){return base64Decode(_0x2c5f73[_0x116f('0x88')]['AudioFromTts'][_0x116f('0x8b')],path[_0x116f('0x2a')](__dirname,_0x116f('0x2b'),rs['generate'](0x4)+_0x116f('0x2c')))[_0x116f('0x2d')](function(_0x2779c6){_0x43cef9[_0x116f('0x8c')]=_0x2779c6;return _0x43cef9;});}return _0x43cef9;});};exports[_0x116f('0x8d')]=function(){return __dirname;}; \ No newline at end of file +var _0xe84d=['\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','score','status','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','name','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','model=%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','bluebird','dialogflow','http','https','md5','path','request-promise','randomstring','sox','google-tts-api','parse','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','unlink','end','protocol','data','transcode','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','then','chmodSync','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','resolve','.mp3','from','audioContent','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','null','generic','parse\x20response\x20failed:\x0a','text\x20length\x20limit\x20reached','lang\x20\x22'];(function(_0x3c0902,_0x30a2ce){var _0x22bc47=function(_0x4cbf6e){while(--_0x4cbf6e){_0x3c0902['push'](_0x3c0902['shift']());}};_0x22bc47(++_0x30a2ce);}(_0xe84d,0xc8));var _0xde84=function(_0x1b3d0e,_0x1fba2f){_0x1b3d0e=_0x1b3d0e-0x0;var _0x2dac24=_0xe84d[_0x1b3d0e];return _0x2dac24;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xde84('0x0'));var dialogflow=require(_0xde84('0x1'));var fs=require('fs');var http=require(_0xde84('0x2'));var https=require(_0xde84('0x3'));var md5=require(_0xde84('0x4'));var path=require(_0xde84('0x5'));var querystring=require('querystring');var rp=require(_0xde84('0x6'));var rs=require(_0xde84('0x7'));var sox=require(_0xde84('0x8'));var tts=require(_0xde84('0x9'));var urlParse=require('url')[_0xde84('0xa')];var util=require('util');var aws=require('./aws');var google=require(_0xde84('0xb'));var sestek=require(_0xde84('0xc'));var tilde=require(_0xde84('0xd'));var logger=require(_0xde84('0xe'))(_0xde84('0xf'));var ISPEECH_API=_0xde84('0x10');function downloadFile(_0x28b6f9,_0x748c9e){return new BPromise(function(_0x2e9441,_0x431632){var _0x4443d1=urlParse(_0x28b6f9);var _0x4feee7=_0x4443d1['protocol']===_0xde84('0x11')?https:http;var _0x498e93={'host':_0x4443d1['host'],'path':_0x4443d1[_0xde84('0x5')],'headers':{'user-agent':_0xde84('0x12')}};_0x4feee7[_0xde84('0x13')](_0x498e93,function(_0xa8dd43){if(_0xa8dd43['statusCode']!==0xc8){logger[_0xde84('0x14')](_0xde84('0x15')+_0x28b6f9+_0xde84('0x16')+_0xa8dd43[_0xde84('0x17')]+'\x20('+_0xa8dd43[_0xde84('0x18')]+')');_0x431632(new Error(_0xde84('0x15')+_0x28b6f9+_0xde84('0x16')+_0xa8dd43[_0xde84('0x17')]+'\x20('+_0xa8dd43['statusMessage']+')'));return;}var _0x52fa93=fs[_0xde84('0x19')](_0x748c9e);_0x52fa93['on'](_0xde84('0x1a'),function(){logger[_0xde84('0x1b')](_0xde84('0x1c'));_0x52fa93['close'](_0x2e9441);});_0x52fa93['on'](_0xde84('0x14'),function(_0x316859){fs[_0xde84('0x1d')](_0x748c9e);logger['error']('download\x20error',_0x316859);_0x431632(_0x316859);});_0xa8dd43['pipe'](_0x52fa93);})['on'](_0xde84('0x14'),function(_0x4f502d){logger[_0xde84('0x14')](_0x4f502d);_0x431632(_0x4f502d);})[_0xde84('0x1e')]();});}function uploadFile(_0x56da68){return new BPromise(function(_0x223d5d,_0x11ac77){var _0x121ab8=urlParse(_0x56da68);var _0x77d875=_0x121ab8[_0xde84('0x1f')]===_0xde84('0x11')?https:http;var _0x3a4944={'host':_0x121ab8['host'],'path':_0x121ab8[_0xde84('0x5')],'headers':{'user-agent':_0xde84('0x12')}};_0x77d875[_0xde84('0x13')](_0x3a4944,function(_0x1f26a3){if(_0x1f26a3[_0xde84('0x17')]!==0xc8){_0x11ac77(new Error('request\x20to\x20'+_0x56da68+_0xde84('0x16')+_0x1f26a3['statusCode']+'\x20('+_0x1f26a3['statusMessage']+')'));return;}var _0x56c251='';_0x1f26a3['on'](_0xde84('0x20'),function(_0x168c4c){_0x56c251+=_0x168c4c;});_0x1f26a3['on']('end',function(){_0x223d5d(_0x56c251);});})['on'](_0xde84('0x14'),function(_0x431db2){_0x11ac77(_0x431db2);})[_0xde84('0x1e')]();});}function convertFile(_0x48023e,_0x106ee4){return new BPromise(function(_0x103ee3,_0x1cb49d){var _0x29d7fe=sox[_0xde84('0x21')](_0x48023e,_0x106ee4,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x29d7fe['on'](_0xde84('0x14'),function(_0x19761c){logger['error']('error\x20convert',_0x19761c);_0x1cb49d(_0x19761c);});_0x29d7fe['on'](_0xde84('0x1e'),function(){logger['info'](_0xde84('0x22'));_0x103ee3();});_0x29d7fe[_0xde84('0x23')]();});}function base64Decode(_0x3059c6,_0x58fd2a){var _0x3a2096=path['resolve'](__dirname,_0xde84('0x24'),rs[_0xde84('0x25')](0x4)+_0xde84('0x26'));fs[_0xde84('0x27')](_0x3a2096,_0x3059c6,'base64');return convertFile(_0x3a2096,_0x58fd2a)[_0xde84('0x28')](function(){try{fs['unlink'](_0x3a2096);fs[_0xde84('0x29')](_0x58fd2a,_0xde84('0x2a'));}catch(_0x43c9ec){logger[_0xde84('0x14')](_0x43c9ec);}return _0x58fd2a[_0xde84('0x2b')]('.')[0x0];});}function base64Encode(_0x52b427){var _0x2fd988=fs[_0xde84('0x2c')](_0x52b427);return new Buffer(_0x2fd988)['toString']('base64');}exports[_0xde84('0x2d')]=function(_0x5d5201,_0x400b88,_0x48cf12,_0x51326e,_0x7bac91,_0x37d139){var _0x33792b,_0x12a745;var _0x459f22=_0xde84('0x2e');var _0x25b4c3=_0xde84('0x2f')+_0x5d5201;var _0x40ed7d={};if(_0x400b88===_0xde84('0x30')){_0x40ed7d[_0xde84('0x31')]={'ssml':_0x48cf12};}else{_0x40ed7d[_0xde84('0x31')]={'text':_0x48cf12};};_0x40ed7d[_0xde84('0x32')]={'languageCode':_0x51326e,'ssmlGender':_0x7bac91};_0x40ed7d[_0xde84('0x33')]={'audioEncoding':_0xde84('0x34'),'sampleRateHertz':0x1f40};var _0x1ef4e7={'url':_0x459f22+_0xde84('0x35')+_0x25b4c3,'method':_0xde84('0x36'),'json':!![],'body':_0x40ed7d};return rp(_0x1ef4e7)[_0xde84('0x28')](function(_0xcb1390){return new BPromise(function(_0x131982,_0x4c0b78){_0x33792b=path[_0xde84('0x37')](__dirname,_0xde84('0x24'),rs[_0xde84('0x25')](0x4)+_0xde84('0x38'));var _0x461148=Buffer[_0xde84('0x39')](_0xcb1390[_0xde84('0x3a')],'base64');return fs['writeFile'](_0x33792b,_0x461148,function(_0x19bb65){_0x4c0b78(_0x19bb65);},function(_0x5b6357){fs[_0xde84('0x29')](_0x33792b,_0xde84('0x2a'));_0x131982(_0x5b6357);});});})[_0xde84('0x28')](function(_0x46f6cb){_0x12a745=path[_0xde84('0x37')](__dirname,_0xde84('0x24'),rs[_0xde84('0x25')](0x4)+_0xde84('0x26'));return convertFile(_0x33792b,_0x12a745);})[_0xde84('0x28')](function(){try{fs[_0xde84('0x1d')](_0x33792b);fs[_0xde84('0x29')](_0x12a745,_0xde84('0x2a'));}catch(_0x50b710){logger['error'](_0x50b710);}logger['info'](_0xde84('0x3b'),_0x12a745[_0xde84('0x2b')]('.')[0x0]);return _0x12a745[_0xde84('0x2b')]('.')[0x0];});};exports[_0xde84('0x3c')]=function(_0x22b4fd,_0x456380){var _0x2bceaa=_0xde84('0x3d');var _0x1c3617,_0x36aa36;var _0x2b5471;var _0x176094={'encoding':'utf8','method':_0xde84('0x36'),'timeout':0x2710,'url':_0x2bceaa,'headers':{'Content-Type':_0xde84('0x3e')},'body':_0xde84('0x3f')+encodeURIComponent(JSON[_0xde84('0x40')]([[['jQ1olc',JSON[_0xde84('0x40')]([_0x22b4fd,_0x456380||'en',![],_0xde84('0x41')]),null,_0xde84('0x42')]]]))};return rp(_0x176094)[_0xde84('0x28')](function(_0x36e53c){try{_0x2b5471=eval(_0x36e53c['slice'](0x5))[0x0][0x2];}catch(_0x5cedd3){throw new Error(_0xde84('0x43')+_0x36e53c[_0xde84('0x20')]);}if(!_0x2b5471){if(_0x22b4fd['length']>0xc8){throw new Error(_0xde84('0x44'));}else{throw new Error(_0xde84('0x45')+_0x456380+_0xde84('0x46'));}}try{_0x2b5471=eval(_0x2b5471)[0x0];}catch(_0x8e8a70){throw new Error(_0xde84('0x43')+res[_0xde84('0x20')]);}const _0x2a100c=_0x2b5471;_0x1c3617=path[_0xde84('0x37')](__dirname,_0xde84('0x24'),rs[_0xde84('0x25')](0x4)+_0xde84('0x38'));fs['writeFileSync'](_0x1c3617,_0x2b5471,{'encoding':'base64'});_0x36aa36=path[_0xde84('0x37')](__dirname,_0xde84('0x24'),rs['generate'](0x4)+'.wav');return convertFile(_0x1c3617,_0x36aa36);})['then'](function(){try{fs[_0xde84('0x1d')](_0x1c3617);fs[_0xde84('0x29')](_0x36aa36,_0xde84('0x2a'));}catch(_0x26d9a0){logger['error'](_0x26d9a0);}logger['info'](_0xde84('0x47'),_0x36aa36['split']('.')[0x0]);return _0x36aa36['split']('.')[0x0];});};exports[_0xde84('0x48')]=function(_0x240faf,_0x7550a6,_0x3f60dc){return google['asr'](_0x240faf,_0x7550a6,_0x3f60dc)['then'](function(_0x262fb1){logger[_0xde84('0x1b')](_0x262fb1[_0xde84('0x49')]);return rp(_0x262fb1);})[_0xde84('0x28')](function(_0x105649){var _0x5aac21='';var _0x52310c=0x0;try{fs['unlink'](_0x240faf);}catch(_0x2873ed){logger[_0xde84('0x14')](_0x2873ed);}if(_0x105649&&_0x105649[_0xde84('0x4a')]){_0x5aac21=_0x105649[_0xde84('0x4a')][_0xde84('0x4b')](function(_0x424d15){return _0x424d15&&_0x424d15[_0xde84('0x4c')][0x0]&&_0x424d15[_0xde84('0x4c')][0x0][_0xde84('0x4d')]?_0x424d15[_0xde84('0x4c')][0x0][_0xde84('0x4d')]:'';})[_0xde84('0x4e')]('\x0a');_0x52310c=_0x105649['results'][_0xde84('0x4b')](function(_0x56c0d0){return _0x56c0d0&&_0x56c0d0[_0xde84('0x4c')][0x0]&&_0x56c0d0[_0xde84('0x4c')][0x0][_0xde84('0x4f')]?_0x56c0d0[_0xde84('0x4c')][0x0][_0xde84('0x4f')]:0x0;})[_0xde84('0x4e')]('\x0a');}logger[_0xde84('0x1b')](_0xde84('0x50'),_0x5aac21);logger[_0xde84('0x1b')](_0xde84('0x51'),_0x52310c);return{'transcript':_0x5aac21,'confidence':_0x52310c};})['catch'](function(_0x460a29){logger[_0xde84('0x14')](_0xde84('0x52'),_0x460a29[_0xde84('0x17')],_0x460a29['name'],_0x460a29['message']);});};exports[_0xde84('0x53')]=function(_0x3d0e10,_0x532166,_0x5ea394,_0xaf91a){var _0x1cb047=apiai(_0x532166,{'language':_0xaf91a||'en'});return _0x1cb047[_0xde84('0x54')](_0x5ea394,{'sessionId':md5(_0x3d0e10)})[_0xde84('0x28')](function(_0x1a8ad9){logger[_0xde84('0x1b')](JSON[_0xde84('0x40')](_0x1a8ad9));return{'source':_0x1a8ad9[_0xde84('0x55')][_0xde84('0x56')],'resolvedQuery':_0x1a8ad9[_0xde84('0x55')][_0xde84('0x57')],'action':_0x1a8ad9[_0xde84('0x55')][_0xde84('0x58')],'actionIncomplete':_0x1a8ad9['result'][_0xde84('0x59')],'speech':_0x1a8ad9['result']['fulfillment']['speech'],'score':_0x1a8ad9['result'][_0xde84('0x5a')],'statusCode':_0x1a8ad9[_0xde84('0x5b')][_0xde84('0x5c')],'endConversation':_0x1a8ad9[_0xde84('0x55')][_0xde84('0x5d')][_0xde84('0x5e')]||![],'isFallbackIntent':_0x1a8ad9[_0xde84('0x55')]['metadata']['isFallbackIntent']};});};exports[_0xde84('0x5f')]=function(_0x131d7a,_0x54b056,_0x1abce0,_0x3065b6,_0x3a2a2e,_0x47b2a7){var _0x46f088=_0x3065b6[_0xde84('0x60')](/\\n/g,'\x0a');var _0x44b794={'credentials':{'private_key':_0x46f088,'client_email':_0x1abce0}};var _0x26223a=new dialogflow[(_0xde84('0x61'))](_0x44b794);var _0x34b90d=_0x26223a[_0xde84('0x62')](_0x54b056,md5(_0x131d7a));var _0x288bee={'session':_0x34b90d,'queryInput':{'text':{'text':_0x3a2a2e,'languageCode':_0x47b2a7}}};return _0x26223a[_0xde84('0x63')](_0x288bee)[_0xde84('0x28')](function(_0x5ca3ad){if(_0x5ca3ad&&_0x5ca3ad['length']){logger[_0xde84('0x1b')](_0xde84('0x64'),JSON['stringify'](_0x5ca3ad));var _0x513934=_0x5ca3ad[0x0];if(_0x513934){var _0x2afe49={'action':_0x513934[_0xde84('0x65')]['action'],'allRequiredParamsPresent':_0x513934['queryResult'][_0xde84('0x66')],'endConversation':_0x513934['queryResult'][_0xde84('0x67')]&&_0x513934['queryResult'][_0xde84('0x67')][_0xde84('0x68')]?_0x513934[_0xde84('0x65')][_0xde84('0x67')]['fields']['end_conversation'][_0xde84('0x69')]:![],'fulfillmentText':_0x513934[_0xde84('0x65')][_0xde84('0x6a')],'intentName':_0x513934['queryResult']['intent'][_0xde84('0x6b')],'intentDisplayName':_0x513934[_0xde84('0x65')][_0xde84('0x6c')][_0xde84('0x6d')],'isFallbackIntent':_0x513934[_0xde84('0x65')][_0xde84('0x6c')][_0xde84('0x6e')],'languageCode':_0x513934['queryResult'][_0xde84('0x6f')],'queryText':_0x513934[_0xde84('0x65')][_0xde84('0x70')],'responseId':_0x513934['responseId'],'score':_0x513934[_0xde84('0x65')][_0xde84('0x71')],'speech':_0x513934[_0xde84('0x65')][_0xde84('0x6a')],'providerResponse':JSON[_0xde84('0x40')](_0x5ca3ad)};return _0x2afe49;}}});};exports[_0xde84('0x72')]=function(_0x3f60e5,_0x193601,_0x58d2eb,_0x2dcacb){return tilde[_0xde84('0x73')](_0x3f60e5,_0x193601,_0x58d2eb,_0x2dcacb)['then'](function(_0x3a9e08){try{fs[_0xde84('0x1d')](_0x3f60e5);}catch(_0x5bb1e5){logger[_0xde84('0x14')](_0x5bb1e5);}logger[_0xde84('0x1b')]('Tilde\x20ASR\x20transcription',_0x3a9e08[_0xde84('0x4d')]);logger[_0xde84('0x1b')](_0xde84('0x74'),_0x3a9e08[_0xde84('0x4f')]);return _0x3a9e08;});};exports[_0xde84('0x75')]=function(_0xcd4a90,_0x805811,_0xa796f5,_0x138c42,_0x39e959,_0x2153b4){var _0x27d1b9=path[_0xde84('0x37')](__dirname,_0xde84('0x24'),rs[_0xde84('0x25')](0x4)+_0xde84('0x38'));var _0x3500c6;return aws[_0xde84('0x76')](_0xcd4a90,_0x805811,_0xa796f5,_0x138c42,_0x39e959,_0x2153b4,_0x27d1b9)['then'](function(){_0x3500c6=path[_0xde84('0x37')](__dirname,_0xde84('0x24'),rs['generate'](0x4)+'.wav');return convertFile(_0x27d1b9,_0x3500c6);})[_0xde84('0x28')](function(){try{fs[_0xde84('0x1d')](_0x27d1b9);fs[_0xde84('0x29')](_0x3500c6,_0xde84('0x2a'));}catch(_0x3c833f){logger[_0xde84('0x14')](_0x3c833f);}return _0x3500c6[_0xde84('0x2b')]('.')[0x0];});};exports[_0xde84('0x77')]=function(_0x4ec6c2,_0x45a0d0,_0x157b9c,_0x14e558,_0x4c45d6,_0x38dda1){return aws[_0xde84('0x78')](_0x4ec6c2,_0x45a0d0,_0x157b9c,_0x14e558,_0x4c45d6,_0x38dda1)[_0xde84('0x28')](function(_0x503a7b){logger['info'](JSON[_0xde84('0x40')](_0x503a7b));return _0x503a7b;});};exports[_0xde84('0x79')]=function(_0x5de57b,_0x524ce3,_0x49fd74,_0x3d05bf){var _0x3745e1=util['format'](_0xde84('0x7a'),ISPEECH_API,_0x5de57b,encodeURIComponent(_0x524ce3),_0x49fd74,_0x3d05bf);var _0x5cc6e0=path[_0xde84('0x37')](__dirname,_0xde84('0x24'),rs[_0xde84('0x25')](0x4)+_0xde84('0x38'));var _0x21ce78;return downloadFile(_0x3745e1,_0x5cc6e0)[_0xde84('0x28')](function(){_0x21ce78=path[_0xde84('0x37')](__dirname,'tmp',rs['generate'](0x4)+_0xde84('0x26'));return convertFile(_0x5cc6e0,_0x21ce78);})[_0xde84('0x28')](function(){try{fs[_0xde84('0x1d')](_0x5cc6e0);fs[_0xde84('0x29')](_0x21ce78,_0xde84('0x2a'));}catch(_0x365c94){logger[_0xde84('0x14')](_0x365c94);}return _0x21ce78['split']('.')[0x0];});};exports[_0xde84('0x7b')]=function(_0x36656e,_0x1319eb,_0x103995,_0x33c939){var _0x17ceec=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x1319eb,_0x103995,base64Encode(_0x36656e),_0x33c939?util[_0xde84('0x7c')](_0xde84('0x7d'),encodeURIComponent(_0x33c939)):'freeform=3');return uploadFile(_0x17ceec)[_0xde84('0x28')](function(_0x36d6f5){return querystring[_0xde84('0xa')](_0x36d6f5);});};exports[_0xde84('0x7e')]=function(_0x2e1390,_0x352581){return sestek[_0xde84('0x7f')](_0x2e1390,_0x352581)[_0xde84('0x28')](function(_0x378f15){logger[_0xde84('0x1b')](JSON['stringify'](_0x378f15));var _0x7bc88a={'speech':_0x378f15[_0xde84('0x80')],'action':_0x378f15['channelData']?_0x378f15[_0xde84('0x81')][_0xde84('0x82')]:undefined,'actiondata':_0x378f15['channelData']?_0x378f15[_0xde84('0x81')][_0xde84('0x83')]:undefined};if(_0x378f15['channelData']&&_0x378f15['channelData'][_0xde84('0x84')]){return base64Decode(_0x378f15[_0xde84('0x81')][_0xde84('0x84')][_0xde84('0x85')],path[_0xde84('0x37')](__dirname,_0xde84('0x24'),rs[_0xde84('0x25')](0x4)+_0xde84('0x26')))[_0xde84('0x28')](function(_0x3bd902){_0x7bc88a[_0xde84('0x86')]=_0x3bd902;return _0x7bc88a;});}return _0x7bc88a;});};exports['dirName']=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 b831485..247b076 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 _0xd6b6=['./nda','exports'];(function(_0x1323ce,_0x2b246e){var _0x5e3e2b=function(_0x2a5ff9){while(--_0x2a5ff9){_0x1323ce['push'](_0x1323ce['shift']());}};_0x5e3e2b(++_0x2b246e);}(_0xd6b6,0x15e));var _0x6d6b=function(_0x327b21,_0x4ec694){_0x327b21=_0x327b21-0x0;var _0x17fc7c=_0xd6b6[_0x327b21];return _0x17fc7c;};var nda=require(_0x6d6b('0x0'));module[_0x6d6b('0x1')]={'nda':nda}; \ No newline at end of file +var _0x8df7=['exports'];(function(_0x78c82b,_0x3309fa){var _0x54273e=function(_0x2529c3){while(--_0x2529c3){_0x78c82b['push'](_0x78c82b['shift']());}};_0x54273e(++_0x3309fa);}(_0x8df7,0x1d5));var _0x78df=function(_0x36a41d,_0x799b99){_0x36a41d=_0x36a41d-0x0;var _0x3bc6fa=_0x8df7[_0x36a41d];return _0x3bc6fa;};var nda=require('./nda');module[_0x78df('0x0')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 0741896..cd58d15 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 _0x86fd=['Bearer\x20','access_token','project','ProjectName','ndagenerate_audio','body','channelData','CustomAction','custom_action','custom_action_data','CustomActionData','request-promise','url','../../../../../config/logger','agi','POST','ndauth_url','/token','password','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','text'];(function(_0x5829a5,_0x5d834c){var _0x321b38=function(_0x194a34){while(--_0x194a34){_0x5829a5['push'](_0x5829a5['shift']());}};_0x321b38(++_0x5d834c);}(_0x86fd,0xa7));var _0xd86f=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x86fd[_0x138f59];return _0x3d114d;};'use strict';var rp=require(_0xd86f('0x0'));var url=require(_0xd86f('0x1'));var logger=require(_0xd86f('0x2'))(_0xd86f('0x3'));module['exports']=function(_0x41246e,_0x4f2329){var _0x3f1949={'method':_0xd86f('0x4'),'uri':url['resolve'](_0x4f2329[_0xd86f('0x5')],_0xd86f('0x6')),'form':{'grant_type':'password','username':_0x4f2329['username'],'password':_0x4f2329[_0xd86f('0x7')]},'json':!![]};return rp(_0x3f1949)['then'](function(_0x3f1920){var _0x4cd46e={'method':_0xd86f('0x4'),'uri':url[_0xd86f('0x8')](_0x4f2329[_0xd86f('0x9')],_0xd86f('0xa')),'body':{'type':_0x4f2329['ndaactivity_type']||_0xd86f('0xb'),'channelId':_0xd86f('0xc'),'conversation':{'id':_0x41246e[_0xd86f('0xd')]},'from':{'id':_0x41246e['callerid'],'name':_0x41246e['calleridname']},'recipient':{'id':_0x41246e['dnid'],'name':_0x41246e['extension']},'text':_0x4f2329[_0xd86f('0xe')],'channelData':{}},'headers':{'Authorization':_0xd86f('0xf')+_0x3f1920[_0xd86f('0x10')]},'json':!![]};if(_0x4f2329[_0xd86f('0x11')]){_0x4cd46e['body']['channelData'][_0xd86f('0x12')]=_0x4f2329[_0xd86f('0x11')];}if(_0x4f2329[_0xd86f('0x13')]=='1'){_0x4cd46e[_0xd86f('0x14')][_0xd86f('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x4f2329['custom_action']){_0x4cd46e[_0xd86f('0x14')][_0xd86f('0x15')][_0xd86f('0x16')]=_0x4f2329[_0xd86f('0x17')];if(_0x4f2329[_0xd86f('0x18')]){_0x4cd46e[_0xd86f('0x14')]['channelData'][_0xd86f('0x19')]=_0x4f2329['custom_action_data'];}}logger['info'](JSON['stringify'](_0x4cd46e));return rp(_0x4cd46e);});}; \ No newline at end of file +var _0x8e44=['body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','POST','ndauth_url','/token','password','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','text','Bearer\x20','access_token','project','channelData','ndagenerate_audio'];(function(_0xdc8eac,_0x2ce7e4){var _0x47d9e5=function(_0x3abcdf){while(--_0x3abcdf){_0xdc8eac['push'](_0xdc8eac['shift']());}};_0x47d9e5(++_0x2ce7e4);}(_0x8e44,0x1ac));var _0x48e4=function(_0x4da61c,_0x4f3c93){_0x4da61c=_0x4da61c-0x0;var _0x3403e9=_0x8e44[_0x4da61c];return _0x3403e9;};'use strict';var rp=require(_0x48e4('0x0'));var url=require(_0x48e4('0x1'));var logger=require(_0x48e4('0x2'))('agi');module['exports']=function(_0x3e0b0d,_0x30d851){var _0x41cb6b={'method':_0x48e4('0x3'),'uri':url['resolve'](_0x30d851[_0x48e4('0x4')],_0x48e4('0x5')),'form':{'grant_type':_0x48e4('0x6'),'username':_0x30d851['username'],'password':_0x30d851['password']},'json':!![]};return rp(_0x41cb6b)[_0x48e4('0x7')](function(_0xfd30df){var _0x552cb1={'method':_0x48e4('0x3'),'uri':url[_0x48e4('0x8')](_0x30d851[_0x48e4('0x9')],_0x48e4('0xa')),'body':{'type':_0x30d851[_0x48e4('0xb')]||_0x48e4('0xc'),'channelId':'Nda','conversation':{'id':_0x3e0b0d[_0x48e4('0xd')]},'from':{'id':_0x3e0b0d[_0x48e4('0xe')],'name':_0x3e0b0d[_0x48e4('0xf')]},'recipient':{'id':_0x3e0b0d['dnid'],'name':_0x3e0b0d['extension']},'text':_0x30d851[_0x48e4('0x10')],'channelData':{}},'headers':{'Authorization':_0x48e4('0x11')+_0xfd30df[_0x48e4('0x12')]},'json':!![]};if(_0x30d851[_0x48e4('0x13')]){_0x552cb1['body'][_0x48e4('0x14')]['ProjectName']=_0x30d851[_0x48e4('0x13')];}if(_0x30d851[_0x48e4('0x15')]=='1'){_0x552cb1[_0x48e4('0x16')][_0x48e4('0x14')][_0x48e4('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x48e4('0x18')};}if(_0x30d851[_0x48e4('0x19')]){_0x552cb1['body'][_0x48e4('0x14')][_0x48e4('0x1a')]=_0x30d851['custom_action'];if(_0x30d851[_0x48e4('0x1b')]){_0x552cb1[_0x48e4('0x16')]['channelData'][_0x48e4('0x1c')]=_0x30d851[_0x48e4('0x1b')];}}logger[_0x48e4('0x1d')](JSON['stringify'](_0x552cb1));return rp(_0x552cb1);});}; \ 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 cc114bf..65db7a8 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 _0xcad3=['exports'];(function(_0x13ed2b,_0x35d641){var _0x23d8e4=function(_0x487093){while(--_0x487093){_0x13ed2b['push'](_0x13ed2b['shift']());}};_0x23d8e4(++_0x35d641);}(_0xcad3,0x153));var _0x3cad=function(_0x1d2e5e,_0x145ae6){_0x1d2e5e=_0x1d2e5e-0x0;var _0x4a1d68=_0xcad3[_0x1d2e5e];return _0x4a1d68;};'use strict';var asr=require('./lib/api');module[_0x3cad('0x0')]=function(_0x10ca82,_0xeb741e,_0xccd98,_0x70e09d){return asr(_0x10ca82,_0xeb741e,_0xccd98,_0x70e09d);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x41b036,_0x516b9a,_0x47b313,_0x796361){return asr(_0x41b036,_0x516b9a,_0x47b313,_0x796361);}; \ 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 1b9524e..b08553b 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 _0xd00a=['Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','moment','crypto','../../../../../../config/logger','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','send','stringify','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xd00a,0x151));var _0xad00=function(_0x219e41,_0x5e0ac6){_0x219e41=_0x219e41-0x0;var _0x275c89=_0xd00a[_0x219e41];return _0x275c89;};'use strict';var BPromise=require(_0xad00('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xad00('0x1'));var crypto=require(_0xad00('0x2'));var logger=require(_0xad00('0x3'))('agi');module['exports']=function(_0x44d0d8,_0x362744,_0x136f8c,_0x1ecd8f){return new BPromise(function(_0x279049,_0x294acf){logger['info'](_0xad00('0x4'),_0x1ecd8f||_0xad00('0x5'));var _0x8cba8c=new WebSocket(_0x1ecd8f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x270745='';var _0x42d020='0';var _0x2e65b4='1';var _0x51fbfd=_0xad00('0x6');function _0x2bc679(_0x5268d7){var _0x44615f=crypto[_0xad00('0x7')](_0xad00('0x8'));_0x44615f[_0xad00('0x9')](_0x5268d7);return _0x44615f[_0xad00('0xa')](_0xad00('0xb'));}function _0x94840b(){try{logger[_0xad00('0xc')](_0xad00('0xd'));var _0x479b05=moment()['unix']();var _0x2d4ef6=_0x2bc679(_0x479b05+_0x362744+_0x136f8c);_0x8cba8c[_0xad00('0xe')](JSON[_0xad00('0xf')]({'appID':_0x362744,'timestamp':_0x479b05,'appKey':_0x2d4ef6}));var _0x552e3c=fs['createReadStream'](_0x44d0d8);_0x552e3c['on'](_0xad00('0x10'),function(_0x7e1006){_0x8cba8c[_0xad00('0xe')](_0x7e1006);});_0x552e3c['on'](_0xad00('0x11'),function(){_0x8cba8c[_0xad00('0xe')]('EOS');});}catch(_0x445ab1){logger[_0xad00('0x12')](_0xad00('0x13'),JSON[_0xad00('0xf')](_0x445ab1));_0x8cba8c[_0xad00('0x14')]();}}function _0x39a769(_0x303fcd){try{if(_0x303fcd){var _0x1dff9c=JSON[_0xad00('0x15')](_0x303fcd);switch(_0x1dff9c[_0xad00('0x16')]){case 0x0:if(_0x1dff9c['result']){if(_0x1dff9c[_0xad00('0x17')][_0xad00('0x18')]){logger['info'](_0xad00('0x19'),JSON['stringify'](_0x1dff9c['result'][_0xad00('0x1a')]));_0x270745=_0x1dff9c[_0xad00('0x17')][_0xad00('0x1a')][0x0][_0xad00('0x1b')];_0x42d020=_0x1dff9c[_0xad00('0x17')]['hypotheses'][0x0]['likelihood'];_0x2e65b4='0';_0x51fbfd='Success.';_0x8cba8c[_0xad00('0x14')]();}}break;case 0x1:logger[_0xad00('0xc')](_0xad00('0x6'));_0x2e65b4='1';_0x51fbfd='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xad00('0xc')](_0xad00('0x1c'));_0x2e65b4='2';_0x51fbfd=_0xad00('0x1c');break;case 0x9:logger[_0xad00('0xc')](_0xad00('0x1d'));_0x2e65b4='9';_0x51fbfd=_0xad00('0x1d');break;case 0xa:logger['info'](_0xad00('0x1e'));_0x2e65b4='10';_0x51fbfd='Authentication\x20failed.';break;case 0xb:logger[_0xad00('0xc')](_0xad00('0x1f'));_0x2e65b4='11';_0x51fbfd=_0xad00('0x1f');}}}catch(_0x3b8196){logger[_0xad00('0x12')](_0xad00('0x20'),JSON[_0xad00('0xf')](_0x3b8196));_0x8cba8c['terminate']();}}function _0x176e9d(){logger[_0xad00('0xc')](_0xad00('0x21'));_0x279049({'transcript':_0x270745,'confidence':_0x42d020,'status':_0x2e65b4,'status_message':_0x51fbfd});}function _0x2f605e(_0x3cfee4){logger[_0xad00('0x12')](_0xad00('0x22'));if(!_[_0xad00('0x23')](_0x3cfee4)){logger[_0xad00('0x12')](_['isObject'](_0x3cfee4)?JSON[_0xad00('0xf')](_0x3cfee4):_0x3cfee4);}}_0x8cba8c['on'](_0xad00('0x24'),_0x94840b);_0x8cba8c['on']('message',_0x39a769);_0x8cba8c['on'](_0xad00('0x11'),_0x176e9d);_0x8cba8c['on'](_0xad00('0x12'),_0x2f605e);});}; \ No newline at end of file +var _0xd176=['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','terminate','Close\x20Tilde\x20ASR\x20socket','isObject','message','close','bluebird','moment','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS','error','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses'];(function(_0x2e2148,_0xa0edbb){var _0x126751=function(_0x2e88fd){while(--_0x2e88fd){_0x2e2148['push'](_0x2e2148['shift']());}};_0x126751(++_0xa0edbb);}(_0xd176,0x15b));var _0x6d17=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0xd176[_0x2a2166];return _0x3bcf50;};'use strict';var BPromise=require(_0x6d17('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x6d17('0x1'));var crypto=require('crypto');var logger=require(_0x6d17('0x2'))(_0x6d17('0x3'));module[_0x6d17('0x4')]=function(_0x3dffd9,_0x2199dc,_0x43afa7,_0x487474){return new BPromise(function(_0x3ae8eb,_0x1f472b){logger[_0x6d17('0x5')]('Tilde\x20URI',_0x487474||_0x6d17('0x6'));var _0x40b319=new WebSocket(_0x487474||_0x6d17('0x6'),{'perMessageDeflate':![]});var _0x5891cd='';var _0x465df2='0';var _0x4ef3cc='1';var _0x1b45a2='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x19dbb6(_0x523e4e){var _0x12ff45=crypto[_0x6d17('0x7')]('sha1');_0x12ff45['update'](_0x523e4e);return _0x12ff45[_0x6d17('0x8')](_0x6d17('0x9'));}function _0xf2ff60(){try{logger['info'](_0x6d17('0xa'));var _0x33491b=moment()[_0x6d17('0xb')]();var _0x562c8=_0x19dbb6(_0x33491b+_0x2199dc+_0x43afa7);_0x40b319[_0x6d17('0xc')](JSON[_0x6d17('0xd')]({'appID':_0x2199dc,'timestamp':_0x33491b,'appKey':_0x562c8}));var _0x21429f=fs[_0x6d17('0xe')](_0x3dffd9);_0x21429f['on'](_0x6d17('0xf'),function(_0x20b836){_0x40b319[_0x6d17('0xc')](_0x20b836);});_0x21429f['on']('close',function(){_0x40b319['send'](_0x6d17('0x10'));});}catch(_0x5d69a0){logger[_0x6d17('0x11')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x5d69a0));_0x40b319['terminate']();}}function _0x324243(_0x2959c0){try{if(_0x2959c0){var _0x39b38f=JSON['parse'](_0x2959c0);switch(_0x39b38f[_0x6d17('0x12')]){case 0x0:if(_0x39b38f[_0x6d17('0x13')]){if(_0x39b38f[_0x6d17('0x13')][_0x6d17('0x14')]){logger['info'](_0x6d17('0x15'),JSON[_0x6d17('0xd')](_0x39b38f['result'][_0x6d17('0x16')]));_0x5891cd=_0x39b38f[_0x6d17('0x13')][_0x6d17('0x16')][0x0][_0x6d17('0x17')];_0x465df2=_0x39b38f[_0x6d17('0x13')][_0x6d17('0x16')][0x0][_0x6d17('0x18')];_0x4ef3cc='0';_0x1b45a2=_0x6d17('0x19');_0x40b319['terminate']();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x4ef3cc='1';_0x1b45a2=_0x6d17('0x1a');break;case 0x2:logger[_0x6d17('0x5')](_0x6d17('0x1b'));_0x4ef3cc='2';_0x1b45a2=_0x6d17('0x1b');break;case 0x9:logger['info'](_0x6d17('0x1c'));_0x4ef3cc='9';_0x1b45a2=_0x6d17('0x1c');break;case 0xa:logger['info'](_0x6d17('0x1d'));_0x4ef3cc='10';_0x1b45a2='Authentication\x20failed.';break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x4ef3cc='11';_0x1b45a2=_0x6d17('0x1e');}}}catch(_0x169c62){logger[_0x6d17('0x11')](_0x6d17('0x1f'),JSON[_0x6d17('0xd')](_0x169c62));_0x40b319[_0x6d17('0x20')]();}}function _0x5de3a8(){logger[_0x6d17('0x5')](_0x6d17('0x21'));_0x3ae8eb({'transcript':_0x5891cd,'confidence':_0x465df2,'status':_0x4ef3cc,'status_message':_0x1b45a2});}function _0x26c615(_0x42f43e){logger[_0x6d17('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x42f43e)){logger[_0x6d17('0x11')](_[_0x6d17('0x22')](_0x42f43e)?JSON[_0x6d17('0xd')](_0x42f43e):_0x42f43e);}}_0x40b319['on']('open',_0xf2ff60);_0x40b319['on'](_0x6d17('0x23'),_0x324243);_0x40b319['on'](_0x6d17('0x24'),_0x5de3a8);_0x40b319['on'](_0x6d17('0x11'),_0x26c615);});}; \ 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 c726727..0bca61e 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 _0x05bf=['./asr','exports'];(function(_0x4ce5b1,_0x542232){var _0x4f7660=function(_0x2798df){while(--_0x2798df){_0x4ce5b1['push'](_0x4ce5b1['shift']());}};_0x4f7660(++_0x542232);}(_0x05bf,0x80));var _0xf05b=function(_0x59267b,_0x32c0b9){_0x59267b=_0x59267b-0x0;var _0x4eef95=_0x05bf[_0x59267b];return _0x4eef95;};var asr=require(_0xf05b('0x0'));module[_0xf05b('0x1')]={'asr':asr}; \ No newline at end of file +var _0x48af=['exports','./asr'];(function(_0x136002,_0x370daf){var _0x18d244=function(_0x517862){while(--_0x517862){_0x136002['push'](_0x136002['shift']());}};_0x18d244(++_0x370daf);}(_0x48af,0xd7));var _0xf48a=function(_0xed9dd,_0x184eb5){_0xed9dd=_0xed9dd-0x0;var _0x2b0faf=_0x48af[_0xed9dd];return _0x2b0faf;};var asr=require(_0xf48a('0x0'));module[_0xf48a('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 17f9c99..5e5c8af 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 _0x96b7=['error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','close','nextTick','exports','util','net','events','EventEmitter','./channel','127.0.0.1','call','emit'];(function(_0x3f1b36,_0x205b14){var _0x56a704=function(_0x3fc084){while(--_0x3fc084){_0x3f1b36['push'](_0x3f1b36['shift']());}};_0x56a704(++_0x205b14);}(_0x96b7,0x84));var _0x796b=function(_0xa8d7ef,_0x4b8b3d){_0xa8d7ef=_0xa8d7ef-0x0;var _0x239d5e=_0x96b7[_0xa8d7ef];return _0x239d5e;};'use strict';var util=require(_0x796b('0x0'));var net=require(_0x796b('0x1'));var EventEmitter=require(_0x796b('0x2'))[_0x796b('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x796b('0x4'));var AGIServer=function(_0xf0ac6d,_0x28f767,_0x500c3d){var _0x3a3443=this,_0xf0ac6d=_0xf0ac6d||0x11dd,_0x28f767=_0x28f767||_0x796b('0x5'),_0x669ede=null,_0x395fdb=0x0;EventEmitter[_0x796b('0x6')](_0x3a3443);function _0x5ccf51(){if(!_0xf0ac6d){_0x3a3443[_0x796b('0x7')](_0x796b('0x8'),new AGIError(_0x796b('0x9')));return![];}_0x669ede=net[_0x796b('0xa')]();_0x669ede[_0x796b('0xb')](_0xf0ac6d,_0x28f767);_0x669ede['on'](_0x796b('0xc'),function(){_0x3a3443['emit']('listening');});_0x669ede['on'](_0x796b('0xd'),function(_0x5dddb8){_0x669ede['getConnections'](function(_0xa5063f,_0x2456ff){if(_0xa5063f){_0x3a3443[_0x796b('0x7')](_0x796b('0x8'),new AGIError(_0x796b('0xe'),_0xa5063f));}else if(_0x500c3d&&_0x500c3d<0x0){_0x3a3443[_0x796b('0x7')](_0x796b('0x8'),new AGIError(_0x796b('0xf')));_0x5dddb8[_0x796b('0x10')]();}else if(_0x500c3d&&_0x500c3d>0x0&&_0x500c3d<_0x2456ff){_0x395fdb+=0x1;_0x3a3443['emit'](_0x796b('0x8'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x395fdb));_0x5dddb8[_0x796b('0x10')]();}else{var _0x1c3736=new AGIChannel(_0x5dddb8);_0x1c3736['on']('ready',function(){_0x3a3443[_0x796b('0x7')](_0x796b('0xd'),_0x1c3736);});}});});_0x669ede['on'](_0x796b('0x8'),function(_0x59682b){_0x3a3443[_0x796b('0x7')](_0x796b('0x8'),new AGIError(_0x796b('0xe'),_0x59682b['code']));});_0x669ede['on'](_0x796b('0x11'),function(){_0x3a3443[_0x796b('0x7')](_0x796b('0x11'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x796b('0x12')](function(){_0x5ccf51();});};util['inherits'](AGIServer,EventEmitter);module[_0x796b('0x13')]=function(_0x338781,_0x582080,_0x4eada3){return new AGIServer(_0x338781,_0x582080,_0x4eada3);}; \ No newline at end of file +var _0x1f8a=['nextTick','exports','util','events','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','close','E_AGI_SERVER_CLOSE'];(function(_0x40f4ca,_0x1f6e83){var _0x1a3c32=function(_0x3a546e){while(--_0x3a546e){_0x40f4ca['push'](_0x40f4ca['shift']());}};_0x1a3c32(++_0x1f6e83);}(_0x1f8a,0x1e2));var _0xa1f8=function(_0xefa85b,_0xecb7b7){_0xefa85b=_0xefa85b-0x0;var _0x289def=_0x1f8a[_0xefa85b];return _0x289def;};'use strict';var util=require(_0xa1f8('0x0'));var net=require('net');var EventEmitter=require(_0xa1f8('0x1'))['EventEmitter'];var AGIError=require(_0xa1f8('0x2'));var AGIChannel=require('./channel');var AGIServer=function(_0x4a0e6d,_0x1b78a2,_0xb768c3){var _0x327832=this,_0x4a0e6d=_0x4a0e6d||0x11dd,_0x1b78a2=_0x1b78a2||_0xa1f8('0x3'),_0x35bb85=null,_0x4cab1f=0x0;EventEmitter[_0xa1f8('0x4')](_0x327832);function _0x4554ad(){if(!_0x4a0e6d){_0x327832[_0xa1f8('0x5')](_0xa1f8('0x6'),new AGIError(_0xa1f8('0x7')));return![];}_0x35bb85=net[_0xa1f8('0x8')]();_0x35bb85[_0xa1f8('0x9')](_0x4a0e6d,_0x1b78a2);_0x35bb85['on'](_0xa1f8('0xa'),function(){_0x327832[_0xa1f8('0x5')](_0xa1f8('0xa'));});_0x35bb85['on']('connection',function(_0x20acdf){_0x35bb85['getConnections'](function(_0x215828,_0x1014dd){if(_0x215828){_0x327832['emit'](_0xa1f8('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x215828));}else if(_0xb768c3&&_0xb768c3<0x0){_0x327832['emit'](_0xa1f8('0x6'),new AGIError(_0xa1f8('0xb')));_0x20acdf[_0xa1f8('0xc')]();}else if(_0xb768c3&&_0xb768c3>0x0&&_0xb768c3<_0x1014dd){_0x4cab1f+=0x1;_0x327832[_0xa1f8('0x5')](_0xa1f8('0x6'),new AGIError(_0xa1f8('0xd'),_0x4cab1f));_0x20acdf[_0xa1f8('0xc')]();}else{var _0x2084fa=new AGIChannel(_0x20acdf);_0x2084fa['on'](_0xa1f8('0xe'),function(){_0x327832[_0xa1f8('0x5')](_0xa1f8('0xf'),_0x2084fa);});}});});_0x35bb85['on']('error',function(_0x98bc4b){_0x327832[_0xa1f8('0x5')](_0xa1f8('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x98bc4b['code']));});_0x35bb85['on'](_0xa1f8('0x10'),function(){_0x327832[_0xa1f8('0x5')](_0xa1f8('0x10'),new AGIError(_0xa1f8('0x11')));});}process[_0xa1f8('0x12')](function(){_0x4554ad();});};util['inherits'](AGIServer,EventEmitter);module[_0xa1f8('0x13')]=function(_0x4598a4,_0x4e507a,_0x3ec4c5){return new AGIServer(_0x4598a4,_0x4e507a,_0x3ec4c5);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 0a401ca..b9575cc 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 _0x885a=['phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','has','dialTimezone','CALLERID(dialTimezone)','getContactByPhone','timezones','utcOffset','scheduledat','add','minutes','insertContact','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','replace','googleCloudTTS','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','url','method','timeout','includes','POST','PUT','toUpperCase','body','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','uri','render','parse','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','saveRestApiResult','%s.%s','length','setVariable','split','replaceAll','toString','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','result','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','command','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Executed\x20command\x20%s\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','.wav','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','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','Trying\x20aws\x20Polly\x20%s','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','IFTIME(%s?true:false)','extra','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','unlink','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','no\x20file\x20audio\x20found','queue','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','sayDigits','digits','saynumber','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','no\x20mail\x20account\x20configured','getMailAccount','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','host','port','secure','authentication','auth','user','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendMailMessage','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','util','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getSquareProject','getSquareOdbc','getSquareOdbcById','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','context','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x885a,0x180));var _0xa885=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x885a[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xa885('0x0'));var _=require(_0xa885('0x1'));var sh=require(_0xa885('0x2'));var odbc=require(_0xa885('0x3'))();var rs=require('randomstring');var moment=require(_0xa885('0x4'));var Mustache=require(_0xa885('0x5'));var rp=require(_0xa885('0x6'));var logger=require(_0xa885('0x7'))(_0xa885('0x8'));var config=require(_0xa885('0x9'));var shared=require('../../config/environment/shared');var scripts=require(_0xa885('0xa'));var FILES_PATH=_0xa885('0xb');var recursiveMapAttributes=[_0xa885('0xc'),'rawBody'];var verticesWithRetry=[_0xa885('0xd'),_0xa885('0xe'),_0xa885('0xf')];var AGIVertices=function(_0x5e49d0,_0x2305b1,_0x299f57){this[_0xa885('0x10')]=_0x5e49d0;this[_0xa885('0x11')]=_0x2305b1;this[_0xa885('0x12')]=_0x299f57;};AGIVertices[_0xa885('0x13')][_0xa885('0x14')]=function(_0x571c0d,_0x8a82f5){this[_0xa885('0x11')][_0xa885('0x15')](_0x571c0d)[_0xa885('0x16')](function(_0x412b2a){_0x8a82f5(null,_0x412b2a?_0x412b2a[_0xa885('0x17')]:![]);})[_0xa885('0x18')](function(_0x574eb8){_0x8a82f5(_0x574eb8);});};AGIVertices[_0xa885('0x13')][_0xa885('0x19')]=function(_0x27b24a,_0x12d81c){this[_0xa885('0x11')]['getVoiceQueueById'](_0x27b24a)[_0xa885('0x16')](function(_0x2ca5c5){_0x12d81c(null,_0x2ca5c5?_0x2ca5c5['name']:![]);})[_0xa885('0x18')](function(_0x32fc86){_0x12d81c(_0x32fc86);});};AGIVertices['prototype'][_0xa885('0x1a')]=function(_0x41b3de,_0x5eec42){this[_0xa885('0x11')]['getSquareProjectById'](_0x41b3de)[_0xa885('0x16')](function(_0x3960ea){_0x5eec42(null,_0x3960ea?_0x3960ea[_0xa885('0x17')]:![]);})['catch'](function(_0x289b76){_0x5eec42(_0x289b76);});};AGIVertices['prototype'][_0xa885('0x1b')]=function(_0x1d5d0b,_0x113043){this['rpc'][_0xa885('0x1c')](_0x1d5d0b)[_0xa885('0x16')](function(_0x1530b6){_0x113043(null,_0x1530b6?_0x1530b6['dsn']:![]);})[_0xa885('0x18')](function(_0x465611){_0x113043(_0x465611);});};AGIVertices[_0xa885('0x13')]['getUser']=function(_0x303830,_0x582b59){this[_0xa885('0x11')][_0xa885('0x1d')](_0x303830)['then'](function(_0x1d94c1){_0x582b59(null,_0x1d94c1?_0x1d94c1[_0xa885('0x17')]:![]);})[_0xa885('0x18')](function(_0x554f01){_0x582b59(_0x554f01);});};AGIVertices[_0xa885('0x13')][_0xa885('0x1e')]=function(_0x558098,_0x39ae58){this['rpc'][_0xa885('0x1f')](_0x558098)['then'](function(_0x1a28d6){_0x39ae58(null,_0x1a28d6?_0x1a28d6[_0xa885('0x17')]:![]);})[_0xa885('0x18')](function(_0x1ea10c){_0x39ae58(_0x1ea10c);});};AGIVertices[_0xa885('0x13')][_0xa885('0x20')]=function(_0x1e13d5,_0x3f219d){var _0x55efb1=this;this['rpc']['getSoundById'](_0x1e13d5)['then'](function(_0x1c94ab){_0x3f219d(null,_0x1c94ab?_0x55efb1[_0xa885('0x21')](_0x1c94ab[_0xa885('0x22')]):![]);})[_0xa885('0x18')](function(_0x3ad88e){_0x3f219d(_0x3ad88e);});};AGIVertices[_0xa885('0x13')]['getMailAccount']=function(_0x40d982,_0x47d01c){this[_0xa885('0x11')]['getMailAccountById'](_0x40d982)[_0xa885('0x16')](function(_0x528a71){_0x47d01c(null,_0x528a71?_0x528a71:![]);})[_0xa885('0x18')](function(_0x9c6b86){_0x47d01c(_0x9c6b86);});};AGIVertices[_0xa885('0x13')]['sendMailMessage']=function(_0x15f3a,_0x23dea1,_0x5ed672){this[_0xa885('0x12')]['sendMailMessage'](_0x15f3a,_0x23dea1)[_0xa885('0x16')](function(){_0x5ed672(null);})[_0xa885('0x18')](function(_0xacdecf){_0x5ed672(_0xacdecf);});};AGIVertices['prototype'][_0xa885('0x23')]=function(_0x25ee20,_0x79626c){this['rpc'][_0xa885('0x24')](_0x25ee20)[_0xa885('0x16')](function(_0xa1310e){if(_0xa1310e){if(_0xa1310e[_0xa885('0x25')]){_0x79626c(null,[_0xa1310e[_0xa885('0x26')]]);}else{_0x79626c(null,_[_0xa885('0x27')](_0xa1310e[_0xa885('0x28')],_0xa885('0x26')));}}else{_0x79626c(null,![]);}})['catch'](function(_0x550000){_0x79626c(_0x550000);});};AGIVertices[_0xa885('0x13')][_0xa885('0x21')]=function(_0x2e40b6){return util[_0xa885('0x29')](_0xa885('0x2a'),FILES_PATH,_0x2e40b6);};AGIVertices[_0xa885('0x13')][_0xa885('0x2b')]=function(_0x337e55,_0x1035b1,_0x5a2a27){odbc['open'](_0x337e55,function(_0x17cad1){if(_0x17cad1){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x17cad1);_0x5a2a27(_0x17cad1);}else{logger[_0xa885('0x2c')]('ODBC\x20connection\x20successfully');odbc[_0xa885('0x2d')](_0x1035b1,function(_0x289f40,_0x39503d){if(_0x289f40){logger[_0xa885('0x2c')](_0xa885('0x2e'),_0x1035b1);_0x5a2a27(_0x289f40);}else{logger[_0xa885('0x2c')](_0xa885('0x2f'),_0x1035b1);odbc[_0xa885('0x30')](function(_0x426256){if(_0x426256){logger[_0xa885('0x31')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x426256);}_0x5a2a27(null,_0x39503d);});}});}});};AGIVertices[_0xa885('0x13')][_0xa885('0x32')]=function(_0x3f0257,_0x97fdde){this[_0xa885('0x11')]['getSmsAccountById'](_0x3f0257)['then'](function(_0x3afe38){_0x97fdde(null,_0x3afe38?_0x3afe38:![]);})[_0xa885('0x18')](function(_0x561444){_0x97fdde(_0x561444);});};AGIVertices[_0xa885('0x13')][_0xa885('0x33')]=function(_0x4e7aa1,_0x1f2a71){this[_0xa885('0x11')]['createSmsMessage'](_0x4e7aa1)['then'](function(_0x113679){_0x1f2a71(null,_0x113679);})[_0xa885('0x18')](function(_0x4da64c){_0x1f2a71(_0x4da64c);});};AGIVertices['prototype'][_0xa885('0x34')]=function(_0x12c35f,_0x2a3a3f,_0x5a40d){this[_0xa885('0x11')][_0xa885('0x34')]({'uniqueid':this[_0xa885('0x10')][_0xa885('0x35')],'node':_0x12c35f[_0xa885('0x36')],'application':_0x12c35f[_0xa885('0x37')],'data':_0x2a3a3f||null,'project_name':this[_0xa885('0x10')]['arg_1'],'callerid':this[_0xa885('0x10')][_0xa885('0x38')]})[_0xa885('0x16')](function(_0x49c6a7){if(_0x5a40d){_0x5a40d(null,_0x49c6a7);}})[_0xa885('0x18')](function(_0x187bc5){if(_0x5a40d){_0x5a40d(_0x187bc5);}});};AGIVertices[_0xa885('0x13')][_0xa885('0x39')]=function(_0x5e33be,_0xdb7929,_0x55635b,_0x2d4bb5){this[_0xa885('0x11')]['createSquareRecording']({'uniqueid':this[_0xa885('0x10')][_0xa885('0x35')],'callerid':this[_0xa885('0x10')][_0xa885('0x38')],'calleridname':this[_0xa885('0x10')]['calleridname'],'context':this[_0xa885('0x10')][_0xa885('0x3a')],'extension':this[_0xa885('0x10')]['extension'],'priority':this['channel']['priority'],'accountcode':this[_0xa885('0x10')][_0xa885('0x3b')],'dnid':this[_0xa885('0x10')][_0xa885('0x3c')],'projectName':this[_0xa885('0x10')][_0xa885('0x3d')],'saveName':_0xdb7929,'filename':_0x5e33be[_0xa885('0x3e')]||_0xdb7929,'savePath':_0x55635b})[_0xa885('0x16')](function(_0x4397d6){_0x2d4bb5(null,_0x4397d6);})[_0xa885('0x18')](function(_0x3245d5){_0x2d4bb5(_0x3245d5);});};AGIVertices['prototype']['createSquareMessage']=function(_0x5c6840,_0x11a272,_0x289716,_0x3913a6,_0x791cc8){this[_0xa885('0x11')][_0xa885('0x3f')]({'uniqueid':this[_0xa885('0x10')]['uniqueid'],'body':_0x5c6840,'direction':_0x11a272,'providerName':_0x289716,'providerResponse':_0x3913a6})[_0xa885('0x16')](function(_0x40923e){if(_0x791cc8){_0x791cc8(null,_0x40923e);}})[_0xa885('0x18')](function(_0x45a7f5){if(_0x791cc8){_0x791cc8(_0x45a7f5);}});};AGIVertices[_0xa885('0x13')][_0xa885('0x40')]=function(_0x159d12,_0x49dc6e){var _0x3704e4=this;var _0x5d6f4b=0x0;var _0x1fde66={'firstName':_['isEmpty'](_0x159d12[_0xa885('0x17')])||_[_0xa885('0x41')](_0x159d12[_0xa885('0x17')])?_0xa885('0x42')+Math[_0xa885('0x43')]():_0x159d12[_0xa885('0x17')],'lastName':_[_0xa885('0x44')](_0x159d12[_0xa885('0x45')])||_['isNil'](_0x159d12[_0xa885('0x45')])?null:_0x159d12[_0xa885('0x45')],'phone':_0x159d12[_0xa885('0x46')],'ListId':_0x159d12['list_id'],'scheduledat':_0x159d12[_0xa885('0x47')],'callbackUniqueid':this[_0xa885('0x10')][_0xa885('0x35')],'tags':_0xa885('0x48'),'description':_0xa885('0x49')+_0x159d12[_0xa885('0x47')]['toString'](),'priority':_0x159d12[_0xa885('0x4a')]};if(_[_0xa885('0x4b')](_0x159d12,_0xa885('0x4c'))){if(!_['isNil'](_0x159d12[_0xa885('0x4c')])){var _0x251323=_0x159d12[_0xa885('0x4c')];if(_0x159d12[_0xa885('0x4c')]==_0xa885('0x4d')){this[_0xa885('0x11')][_0xa885('0x4e')]({'phone':_0x159d12[_0xa885('0x46')]})[_0xa885('0x16')](function(_0x4b02cf){if(!_[_0xa885('0x41')](_0x4b02cf)){var _0x333502=_0x4b02cf['dialTimezone'];if(!_['isNil'](_0x333502)){var _0x1bfacb=shared[_0xa885('0x4f')][_0x333502];if(!_['isNil'](_0x1bfacb)){var _0x8aba4=-0x1*_0x1bfacb[_0xa885('0x50')];_0x1fde66[_0xa885('0x51')]=moment(_0x159d12[_0xa885('0x51')])[_0xa885('0x52')](_0x8aba4,_0xa885('0x53'));_0x3704e4[_0xa885('0x54')](_0x1fde66,_0x159d12,_0x49dc6e);}else{_0x3704e4['insertContact'](_0x1fde66,_0x159d12,_0x49dc6e);}}else{_0x3704e4[_0xa885('0x54')](_0x1fde66,_0x159d12,_0x49dc6e);}}else{_0x3704e4[_0xa885('0x54')](_0x1fde66,_0x159d12,_0x49dc6e);}});}else{var _0x5d6f4b=shared[_0xa885('0x4f')][_0x251323];if(!_['isNil'](_0x5d6f4b)){var _0x117cfe=-0x1*_0x5d6f4b['utcOffset'];_0x1fde66[_0xa885('0x51')]=moment(_0x159d12[_0xa885('0x51')])[_0xa885('0x52')](_0x117cfe,_0xa885('0x53'));_0x3704e4['insertContact'](_0x1fde66,_0x159d12,_0x49dc6e);}else{_0x3704e4[_0xa885('0x54')](_0x1fde66,_0x159d12,_0x49dc6e);}}}else{_0x3704e4[_0xa885('0x54')](_0x1fde66,_0x159d12,_0x49dc6e);}}else{_0x3704e4[_0xa885('0x54')](_0x1fde66,_0x159d12,_0x49dc6e);}};AGIVertices['prototype'][_0xa885('0x55')]=function(_0x564029,_0x45c3e1){this[_0xa885('0x11')]['getPauseById'](_0x564029)[_0xa885('0x16')](function(_0x5e4335){_0x45c3e1(null,_0x5e4335?_0x5e4335[_0xa885('0x17')]:![]);})[_0xa885('0x18')](function(_0x514001){_0x45c3e1(_0x514001);});};AGIVertices[_0xa885('0x13')][_0xa885('0x56')]=function(_0x1ef168,_0x3bc750,_0x4d428a){var _0x5ee56a={'role':_0xa885('0x57')};_0x5ee56a[_0x1ef168]=this[_0xa885('0x10')]['callerid'];this['rpc'][_0xa885('0x56')](_0x5ee56a,_0x3bc750,this[_0xa885('0x10')][_0xa885('0x35')])[_0xa885('0x16')](function(_0x34c6de){_0x4d428a(null,_[_0xa885('0x41')](_0x34c6de)?![]:!![]);})[_0xa885('0x18')](function(_0x257632){logger[_0xa885('0x31')](_0x257632);_0x4d428a(null,![]);});};AGIVertices[_0xa885('0x13')][_0xa885('0x58')]=function(_0x5e6185,_0x35d3f2){var _0x32e7ff={'role':_0xa885('0x57')};_0x32e7ff[_0x5e6185]=this[_0xa885('0x10')][_0xa885('0x38')];this['rpc'][_0xa885('0x58')](_0x32e7ff)['then'](function(_0x5d5fba){_0x35d3f2(null,_[_0xa885('0x41')](_0x5d5fba)?![]:!![]);})[_0xa885('0x18')](function(_0x47c329){logger['error'](_0x47c329);_0x35d3f2(null,![]);});};AGIVertices[_0xa885('0x13')][_0xa885('0x59')]=function(_0x41a969,_0x5b5684){var _0x56f0ef={'role':_0xa885('0x57')};_0x56f0ef[_0x41a969]=this[_0xa885('0x10')][_0xa885('0x38')];this[_0xa885('0x11')]['agentLogout'](_0x56f0ef)[_0xa885('0x16')](function(_0x220192){_0x5b5684(null,_[_0xa885('0x41')](_0x220192)?![]:!![]);})['catch'](function(_0x5c589f){logger[_0xa885('0x31')](_0x5c589f);_0x5b5684(null,![]);});};AGIVertices[_0xa885('0x13')][_0xa885('0x5a')]=function(_0x54d599,_0x2e8f24){var _0x6473ca={'role':_0xa885('0x57')};_0x6473ca[_0x54d599]=this[_0xa885('0x10')]['callerid'];var _0x328161=_0x54d599!=_0xa885('0x5b')?util['format'](_0xa885('0x5c'),_0xa885('0x5d'),this['channel'][_0xa885('0x38')]):undefined;this['rpc'][_0xa885('0x5a')](_0x6473ca,_0x328161)[_0xa885('0x16')](function(_0x1cb988){_0x2e8f24(null,_[_0xa885('0x41')](_0x1cb988)?![]:!![]);})[_0xa885('0x18')](function(_0x29ed6e){logger[_0xa885('0x31')](_0x29ed6e);_0x2e8f24(null,![]);});};AGIVertices[_0xa885('0x13')]['shellCommand']=function(_0x55413d,_0x272b18){sh[_0xa885('0x5e')](_['trim'](_0x55413d),function(_0x444639,_0x3ebb01){var _0x5a8392=_0x3ebb01[_0xa885('0x5f')](/(\r\n|\n|\r)/gm,'');_0x272b18(null,_0x5a8392);});};AGIVertices['prototype'][_0xa885('0x60')]=function(_0x190715,_0x37ef1b){scripts[_0xa885('0x60')](_0x190715['apiKey'],_0x190715['google_cloud_tts_text_type']||_0xa885('0x61'),_0x190715[_0xa885('0x61')],_0x190715[_0xa885('0x62')]||_0xa885('0x63'),_0x190715[_0xa885('0x64')]||_0xa885('0x65'),_0x190715[_0xa885('0x66')]||_0xa885('0x67'))['then'](function(_0x31bb56){_0x37ef1b(null,_0x31bb56);})['catch'](function(_0x3696bd){_0x37ef1b(_0x3696bd);});};AGIVertices[_0xa885('0x13')][_0xa885('0x68')]=function(_0x5937a1,_0xc20b5){scripts[_0xa885('0x68')](_0x5937a1['text'],_0x5937a1['google_tts_language']||'en',0x1)[_0xa885('0x16')](function(_0x34fccf){_0xc20b5(null,_0x34fccf);})[_0xa885('0x18')](function(_0x2bfeb9){_0xc20b5(_0x2bfeb9);});};AGIVertices[_0xa885('0x13')]['restAPI']=function(_0x573e3d,_0x322e8c){var _0xf26f66={'uri':_0x573e3d[_0xa885('0x69')],'method':_0x573e3d[_0xa885('0x6a')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x573e3d['timeout'])==='number'&&parseInt(_0x573e3d['timeout'])>=0x1?parseInt(_0x573e3d[_0xa885('0x6b')])*0x3e8:0x5*0x3e8};if(_[_0xa885('0x6c')]([_0xa885('0x6d'),_0xa885('0x6e')],_0xf26f66[_0xa885('0x6a')][_0xa885('0x6f')]())){try{_0xf26f66[_0xa885('0x70')]=_0x573e3d['rawBody']?JSON['parse'](_0x573e3d[_0xa885('0x71')]):{};}catch(_0x4cbf2f){logger[_0xa885('0x31')](_0xa885('0x72'),_0x4cbf2f);}}try{_0xf26f66[_0xa885('0x73')]=_0x573e3d[_0xa885('0xc')]?JSON['parse'](_0x573e3d[_0xa885('0xc')]):{};}catch(_0xd95575){logger[_0xa885('0x31')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0xd95575);}if(_0x573e3d[_0xa885('0x74')]){try{var _0x43e74b=require(_0x573e3d[_0xa885('0x74')])['sync'](this,_0xf26f66);_0xf26f66[_0xa885('0x75')]=Mustache[_0xa885('0x76')](_0x573e3d[_0xa885('0x69')],_0x43e74b,{},['$$','$$']);if(_0xf26f66[_0xa885('0x73')]){_0xf26f66[_0xa885('0x73')]=JSON[_0xa885('0x77')](Mustache['render'](JSON[_0xa885('0x78')](_0xf26f66[_0xa885('0x73')]),_0x43e74b,{},['$$','$$']));}if(_0xf26f66[_0xa885('0x70')]){_0xf26f66[_0xa885('0x70')]=JSON['parse'](Mustache[_0xa885('0x76')](JSON[_0xa885('0x78')](_0xf26f66[_0xa885('0x70')]),_0x43e74b,{},['$$','$$']));}}catch(_0x136ff1){logger[_0xa885('0x31')](_0xa885('0x79'),_0x136ff1);}}rp(_0xf26f66)[_0xa885('0x16')](function(_0x2388b4){var _0x4902e6={'statusCode':_0x2388b4[_0xa885('0x7a')]||0xc8,'statusMessage':_0x2388b4[_0xa885('0x7b')]||'OK','headers':_0x2388b4['headers']||{},'body':_0x2388b4[_0xa885('0x70')]||{}};_0x322e8c(null,_0x4902e6);})['catch'](function(_0x454841){var _0x40fece={'statusCode':_0x454841['statusCode']||0x1f4,'statusMessage':_0x454841[_0xa885('0x7c')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x454841[_0xa885('0x7d')]['headers']||{},'body':_0x454841[_0xa885('0x7d')]['body']||{}};_0x322e8c(null,_0x40fece);});};AGIVertices[_0xa885('0x13')][_0xa885('0x7e')]=function(_0x183168,_0x3e63ba){scripts['googleDialogflow'](this[_0xa885('0x10')][_0xa885('0x35')],_0x183168[_0xa885('0x7f')],_0x183168['text'],_0x183168[_0xa885('0x80')]||'en')[_0xa885('0x16')](function(_0x7eca56){_0x3e63ba(null,_0x7eca56);})['catch'](function(_0x228502){_0x3e63ba(_0x228502);});};AGIVertices[_0xa885('0x13')]['googleDialogflowV2']=function(_0x59eecb,_0xf9e00f){scripts[_0xa885('0x81')](this[_0xa885('0x10')]['uniqueid'],_0x59eecb[_0xa885('0x82')],_0x59eecb[_0xa885('0x83')],_0x59eecb[_0xa885('0x84')],_0x59eecb[_0xa885('0x61')],_0x59eecb[_0xa885('0x85')]||'en')[_0xa885('0x16')](function(_0x11b660){_0xf9e00f(null,_0x11b660);})[_0xa885('0x18')](function(_0x123f27){_0xf9e00f(_0x123f27);});};AGIVertices[_0xa885('0x13')]['sestekNDA']=function(_0x5d75dc,_0x3e9f5b){scripts['sestekNDA'](this[_0xa885('0x10')],_0x5d75dc)[_0xa885('0x16')](function(_0x1d2de5){_0x3e9f5b(null,_0x1d2de5);})['catch'](function(_0x43b75d){_0x3e9f5b(_0x43b75d);});};AGIVertices[_0xa885('0x13')][_0xa885('0x86')]=function(_0x203cf4,_0x3f0989){scripts[_0xa885('0x86')](_0x203cf4[_0xa885('0x7f')],_0x203cf4['text'],_0x203cf4[_0xa885('0x87')]||_0xa885('0x63'),_0x203cf4[_0xa885('0x88')])[_0xa885('0x16')](function(_0x5a2395){_0x3f0989(null,_0x5a2395);})[_0xa885('0x18')](function(_0x44b2d5){_0x3f0989(_0x44b2d5);});};AGIVertices['prototype']['ispeechASR']=function(_0x454c76,_0x1fe9d3,_0x2197be){scripts[_0xa885('0x89')](_0x1fe9d3,_0x454c76[_0xa885('0x7f')],_0x454c76[_0xa885('0x8a')]||_0xa885('0x63'),this[_0xa885('0x8b')](_0x454c76['model'])?_0x454c76[_0xa885('0x8c')]:undefined)['then'](function(_0x4763c0){_0x2197be(null,_0x4763c0);})[_0xa885('0x18')](function(_0x2b4916){_0x2197be(_0x2b4916);});};AGIVertices[_0xa885('0x13')]['awsPolly']=function(_0x12c2b2,_0x14668d){scripts[_0xa885('0x8d')](_0x12c2b2[_0xa885('0x8e')],_0x12c2b2['aws_secret_access_key'],_0x12c2b2[_0xa885('0x8f')],_0x12c2b2['aws_polly_voice']||_0xa885('0x90'),_0x12c2b2['text'],_0x12c2b2[_0xa885('0x91')]||_0xa885('0x61'))[_0xa885('0x16')](function(_0x52bb2c){_0x14668d(null,_0x52bb2c);})[_0xa885('0x18')](function(_0x223a94){_0x14668d(_0x223a94);});};AGIVertices[_0xa885('0x13')][_0xa885('0x92')]=function(_0x9adf59,_0x19ffd5){scripts[_0xa885('0x92')](this[_0xa885('0x10')][_0xa885('0x35')],_0x9adf59[_0xa885('0x8e')],_0x9adf59[_0xa885('0x93')],_0x9adf59[_0xa885('0x94')],_0x9adf59[_0xa885('0x61')],_0x9adf59[_0xa885('0x95')])['then'](function(_0x1f116a){_0x19ffd5(null,_0x1f116a);})[_0xa885('0x18')](function(_0x2fcca4){_0x19ffd5(_0x2fcca4);});};AGIVertices[_0xa885('0x13')]['googleASR']=function(_0x3f1720,_0xb8a96d,_0x8f385f){scripts[_0xa885('0x96')](_0xb8a96d,_0x3f1720[_0xa885('0x7f')],_0x3f1720[_0xa885('0x97')]||_0xa885('0x63'))[_0xa885('0x16')](function(_0x3cad84){_0x8f385f(null,_0x3cad84);})['catch'](function(_0x59f79f){_0x8f385f(_0x59f79f);});};AGIVertices[_0xa885('0x13')][_0xa885('0x98')]=function(_0xb6f4b2,_0x30f231,_0x29d8e9){scripts[_0xa885('0x98')](_0x30f231,_0xb6f4b2[_0xa885('0x99')],_0xb6f4b2[_0xa885('0x9a')],_0xb6f4b2[_0xa885('0x75')])[_0xa885('0x16')](function(_0x2c4b5d){_0x29d8e9(null,_0x2c4b5d);})['catch'](function(_0xad91fd){_0x29d8e9(_0xad91fd);});};AGIVertices[_0xa885('0x13')][_0xa885('0x9b')]=function(_0x3bb4a5){var _0x2ec9fe=_['includes'](verticesWithRetry,_0x3bb4a5[_0xa885('0x37')])?_0x3bb4a5:_[_0xa885('0x9c')](_0x3bb4a5);for(var _0xdded2a in _0x2ec9fe){if(_0x2ec9fe['hasOwnProperty'](_0xdded2a)){if(_0x2ec9fe[_0xdded2a]&&_[_0xa885('0x9d')](_0x2ec9fe[_0xdded2a])){if(_[_0xa885('0x6c')](recursiveMapAttributes,_0xdded2a)){_0x2ec9fe[_0xdded2a]=this[_0xa885('0x9e')](_0x2ec9fe[_0xdded2a]);}else{_0x2ec9fe[_0xdded2a]=this[_0xa885('0x9f')](_0x2ec9fe[_0xdded2a]);}}}}return _0x2ec9fe;};AGIVertices[_0xa885('0x13')][_0xa885('0xa0')]=function(_0xeed086){for(var _0x4faed4 in _0xeed086){if(_0xeed086[_0xa885('0xa1')](_0x4faed4)){if(_[_0xa885('0xa2')](_0xeed086[_0x4faed4])){this[_0xa885('0xa0')](_0xeed086[_0x4faed4]);}else if(_[_0xa885('0xa3')](_0xeed086[_0x4faed4])){for(var _0x4cd913=0x0;_0x4cd913<_0xeed086[_0x4faed4]['length'];_0x4cd913++){this[_0xa885('0xa0')](_0xeed086[_0x4faed4][_0x4cd913]);}}else if(_[_0xa885('0x9d')](_0xeed086[_0x4faed4])){_0xeed086[_0x4faed4]=this[_0xa885('0x9f')](_0xeed086[_0x4faed4]);}}}};AGIVertices[_0xa885('0x13')][_0xa885('0xa4')]=function(_0x54515e,_0x16aaa6){for(var _0x3885e5 in _0x54515e){if(_0x54515e[_0xa885('0xa1')](_0x3885e5)){if(_[_0xa885('0xa2')](_0x54515e[_0x3885e5])){if(!_[_0xa885('0x44')](_0x54515e[_0x3885e5])){this[_0xa885('0xa4')](_0x54515e[_0x3885e5],util['format'](_0xa885('0xa5'),_0x16aaa6,_0x3885e5));}}else if(_['isArray'](_0x54515e[_0x3885e5])){for(var _0x5102f8=0x0;_0x5102f8<_0x54515e[_0x3885e5][_0xa885('0xa6')];_0x5102f8++){this['saveRestApiResult'](_0x54515e[_0x3885e5][_0x5102f8],util[_0xa885('0x29')]('%s.%s',_0x16aaa6,_0x3885e5+'['+_0x5102f8+']'));}}else{if(!_[_0xa885('0x41')](_0x54515e[_0x3885e5])){this[_0xa885('0x10')][_0xa885('0xa7')](util[_0xa885('0x29')](_0xa885('0xa5'),_0x16aaa6,_0x3885e5),_0x54515e[_0x3885e5]);}}}}};AGIVertices[_0xa885('0x13')][_0xa885('0x9e')]=function(_0x1fe05d){try{var _0x2747cd=JSON[_0xa885('0x77')](_0x1fe05d);this[_0xa885('0xa0')](_0x2747cd);return JSON['stringify'](_0x2747cd);}catch(_0x2c9435){return this[_0xa885('0x9f')](_0x1fe05d);}};AGIVertices[_0xa885('0x13')]['replaceAllVariables']=function(_0x464787){var _0x3921bc=_0x464787[_0xa885('0xa8')]('{');for(var _0x33946d=0x1;_0x33946d<_0x3921bc[_0xa885('0xa6')];_0x33946d+=0x1){var _0x35f701=_0x3921bc[_0x33946d]['split']('}');if(_0x35f701[_0xa885('0xa6')]>0x1){_0x464787=_0x464787[_0xa885('0xa9')]('{'+_0x35f701[0x0]+'}',this[_0xa885('0x10')][_0xa885('0x14')](_0x35f701[0x0])['extra']||_0x35f701[0x0]);}}if(_0x3921bc['length']===0x1){return _0x464787[_0xa885('0xaa')]();}return this[_0xa885('0x9f')](_0x464787);};AGIVertices[_0xa885('0x13')]['getAndSetVariable']=function(_0x5c3c2a,_0x390de9){var _0x3eec15=this[_0xa885('0x10')][_0xa885('0x14')](_0x5c3c2a);if(_0x3eec15['result']===-0x1){return _0x3eec15;}logger[_0xa885('0x2c')](util[_0xa885('0x29')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x390de9,_0x3eec15['extra']));return this[_0xa885('0x10')][_0xa885('0xa7')](_0x390de9,_0x3eec15['extra']);};AGIVertices[_0xa885('0x13')][_0xa885('0x8b')]=function(_0x232f89){return _0x232f89&&_0x232f89!=='0'&&_0x232f89!=='-1'&&_0x232f89!=='';};AGIVertices[_0xa885('0x13')][_0xa885('0xab')]=function(_0x489469){this['createSquareDetailsReport'][_0xa885('0xac')](this,_0x489469,'-');_0x489469[_0xa885('0xad')]=_0x489469['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa885('0x13')][_0xa885('0xae')]=function(_0x49f02a){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0xaf'),_0x49f02a['label']));if(!this[_0xa885('0x8b')](_0x49f02a[_0xa885('0x61')])){return this[_0xa885('0x10')]['noop'](_0xa885('0xb0'));}var _0x487b2b='\x22'+_0x49f02a[_0xa885('0x61')]+'\x22';if(this['isConfigured'](_0x49f02a[_0xa885('0x7d')])){_0x487b2b+=','+_0x49f02a[_0xa885('0x7d')];}var _0x20700d=this[_0xa885('0x10')]['exec']('MRCPSynth',_0x487b2b);if(_0x20700d[_0xa885('0xb1')]===-0x1){return _0x20700d;}return this[_0xa885('0x10')][_0xa885('0xb2')](util['format'](_0xa885('0xb3'),_0x487b2b));};AGIVertices[_0xa885('0x13')]['mrcprecog']=function(_0x215a01){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0xb4'),_0x215a01[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x215a01[_0xa885('0xb5')])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0xb6'));}var _0x5664d0=_0x215a01[_0xa885('0xb5')];if(this[_0xa885('0x8b')](_0x215a01['options'])){_0x5664d0+=','+_0x215a01['options'];}var _0x4a0a68=this[_0xa885('0x10')][_0xa885('0x5e')](_0xa885('0xb7'),_0x5664d0);if(_0x4a0a68[_0xa885('0xb1')]===-0x1){return _0x4a0a68;}var _0x2d74d1=this['getAndSetVariable'](_0xa885('0xb8'),_0xa885('0xb9'));if(_0x2d74d1[_0xa885('0xb1')]===-0x1){return _0x2d74d1;}var _0x23faab=this[_0xa885('0xba')](_0xa885('0xbb'),'MRCP_RECOG_TRANSCRIPT');if(_0x23faab[_0xa885('0xb1')]===-0x1){return _0x23faab;}var _0x81dbb7=this[_0xa885('0xba')](_0xa885('0xbc'),'MRCP_RECOG_INSTANCE');if(_0x81dbb7[_0xa885('0xb1')]===-0x1){return _0x81dbb7;}return this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0xbd'),_0x5664d0));};AGIVertices['prototype']['agi']=function(_0x42d772){logger[_0xa885('0x2c')](util[_0xa885('0x29')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x42d772[_0xa885('0x36')]));return this[_0xa885('0x10')]['agi']([_0x42d772[_0xa885('0xbe')],_0x42d772['args']]);};AGIVertices[_0xa885('0x13')][_0xa885('0xbf')]=function(_0x36f001){logger['info'](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x36f001[_0xa885('0x36')]));if(this[_0xa885('0x8b')](_0x36f001[_0xa885('0x6b')])){logger['info'](util['format'](_0xa885('0xc0'),_0x36f001[_0xa885('0x6b')]));var _0x508cac=this['channel'][_0xa885('0xc1')](_0x36f001[_0xa885('0x6b')]);if(_0x508cac[_0xa885('0xb1')]===-0x1){return _0x508cac;}}return this[_0xa885('0x10')][_0xa885('0xbf')]();};AGIVertices['prototype'][_0xa885('0x48')]=function(_0x593a05){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0xc2'),_0x593a05[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x593a05[_0xa885('0xc3')])){return this[_0xa885('0x10')][_0xa885('0x31')](_0x593a05,_0xa885('0xc4'));}_0x593a05[_0xa885('0x47')]=moment();if(this['isConfigured'](_0x593a05[_0xa885('0xc5')])){_0x593a05[_0xa885('0x47')]=moment()[_0xa885('0x52')](_0x593a05[_0xa885('0xc5')],_0xa885('0x53'));}if(!this['isConfigured'](_0x593a05[_0xa885('0x4a')])){_0x593a05[_0xa885('0x4a')]=0x2;}this['createCmContact']['sync'](this,_0x593a05);return this[_0xa885('0x10')]['noop'](util[_0xa885('0x29')](_0xa885('0xc6'),_0x593a05[_0xa885('0x46')],_0x593a05['list_id'],_0x593a05[_0xa885('0x47')]));};AGIVertices[_0xa885('0x13')][_0xa885('0xc7')]=function(_0x4e2c73){logger[_0xa885('0x2c')](util[_0xa885('0x29')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x4e2c73['label']));var _0x273575=this[_0xa885('0x10')][_0xa885('0x5e')](_0x4e2c73['application'],_0x4e2c73[_0xa885('0x7d')]);if(_0x273575['result']===-0x1){return _0x273575;}return this['channel'][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0xc8'),_0x4e2c73[_0xa885('0xc9')],_0x4e2c73[_0xa885('0x7d')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0x3d7d07){logger['info'](util[_0xa885('0x29')](_0xa885('0xca'),_0x3d7d07[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x3d7d07[_0xa885('0x61')])){return this['channel'][_0xa885('0xb2')](_0xa885('0xb0'));}var _0x4d8913='\x22'+_0x3d7d07[_0xa885('0x61')]+'\x22';if(this[_0xa885('0x8b')](_0x3d7d07[_0xa885('0x7d')])){_0x4d8913+=','+_0x3d7d07['options'];}var _0x33f34b=this[_0xa885('0x10')][_0xa885('0x5e')](_0xa885('0xcb'),_0x4d8913);if(_0x33f34b[_0xa885('0xb1')]===-0x1){return _0x33f34b;}return this[_0xa885('0x10')][_0xa885('0xb2')](util['format'](_0xa885('0xb3'),_0x4d8913));};AGIVertices[_0xa885('0x13')][_0xa885('0xcc')]=function(_0x2668ba){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0xcd'),_0x2668ba['label']));if(!this[_0xa885('0x8b')](_0x2668ba[_0xa885('0x61')])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0xb0'));}var _0x29911d='\x22'+_0x2668ba[_0xa885('0x61')]+'\x22';if(this[_0xa885('0x8b')](_0x2668ba[_0xa885('0x7d')])){_0x29911d+=','+_0x2668ba[_0xa885('0x7d')];}var _0x4adab9=this[_0xa885('0x10')]['exec'](_0xa885('0xcb'),_0x29911d);if(_0x4adab9[_0xa885('0xb1')]===-0x1){return _0x4adab9;}return this[_0xa885('0x10')]['noop'](util['format'](_0xa885('0xb3'),_0x29911d));};AGIVertices[_0xa885('0x13')][_0xa885('0xce')]=function(_0x59f6d8){logger[_0xa885('0x2c')](util[_0xa885('0x29')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x59f6d8[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x59f6d8[_0xa885('0xb5')])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0xb6'));}var _0x401b8f=_0x59f6d8[_0xa885('0xb5')];if(this[_0xa885('0x8b')](_0x59f6d8[_0xa885('0x7d')])){_0x401b8f+=','+_0x59f6d8[_0xa885('0x7d')];}var _0x4e86eb=this[_0xa885('0x10')][_0xa885('0x5e')]('MRCPRecog',_0x401b8f);if(_0x4e86eb[_0xa885('0xb1')]===-0x1){return _0x4e86eb;}var _0x136d5c=this[_0xa885('0xba')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x136d5c[_0xa885('0xb1')]===-0x1){return _0x136d5c;}var _0x43ff99=this[_0xa885('0xba')](_0xa885('0xbb'),_0xa885('0xcf'));if(_0x43ff99['result']===-0x1){return _0x43ff99;}var _0x568b73=this[_0xa885('0xba')](_0xa885('0xbc'),_0xa885('0xd0'));if(_0x568b73['result']===-0x1){return _0x568b73;}return this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x401b8f));};AGIVertices[_0xa885('0x13')][_0xa885('0xd1')]=function(_0x1315c0){logger['info'](util[_0xa885('0x29')](_0xa885('0xd2'),_0x1315c0[_0xa885('0x36')]));if(!this['isConfigured'](_0x1315c0[_0xa885('0xb5')])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0xb6'));}var _0x368fd1=_0x1315c0[_0xa885('0xb5')];if(this[_0xa885('0x8b')](_0x1315c0[_0xa885('0x7d')])){_0x368fd1+=','+_0x1315c0['options'];}var _0x4431fc=this[_0xa885('0x10')][_0xa885('0x5e')](_0xa885('0xb7'),_0x368fd1);if(_0x4431fc['result']===-0x1){return _0x4431fc;}var _0x198ef6=this[_0xa885('0xba')](_0xa885('0xb8'),_0xa885('0xd3'));if(_0x198ef6['result']===-0x1){return _0x198ef6;}var _0x2831d0=this[_0xa885('0xba')](_0xa885('0xbb'),'SESTEK_ASR_TRANSCRIPT');if(_0x2831d0['result']===-0x1){return _0x2831d0;}var _0x32262b=this[_0xa885('0xba')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x32262b[_0xa885('0xb1')]===-0x1){return _0x32262b;}return this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0xbd'),_0x368fd1));};AGIVertices[_0xa885('0x13')][_0xa885('0xd4')]=function(_0x58f9e5){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0xd5'),_0x58f9e5[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x58f9e5[_0xa885('0xd6')])){return this[_0xa885('0x10')][_0xa885('0x31')](_0x58f9e5,_0xa885('0xd7'));}var _0x53d7cd=this['getSquareOdbc'][_0xa885('0xac')](this,_0x58f9e5[_0xa885('0xd6')]);if(!_0x53d7cd){return this[_0xa885('0x10')]['error'](_0x58f9e5,_0xa885('0xd8'));}if(!this['isConfigured'](_0x58f9e5[_0xa885('0x2d')])){return this['channel'][_0xa885('0x31')](_0x58f9e5,'no\x20query\x20configured');}var _0x16a0d2=_0x58f9e5[_0xa885('0x2d')][_0xa885('0x5f')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0xd9'),_0x16a0d2));var _0x53deba=this[_0xa885('0x2b')][_0xa885('0xac')](this,_0x53d7cd,_0x16a0d2);this['createSquareDetailsReport']['sync'](this,_0x58f9e5,_0x16a0d2);if(!this[_0xa885('0x8b')](_0x58f9e5[_0xa885('0xda')])){return this['channel']['noop'](_0xa885('0xdb'));}var _0x11dc92=this['getVariable'][_0xa885('0xac')](this,_0x58f9e5[_0xa885('0xda')]);if(!_0x11dc92){return this[_0xa885('0x10')]['error'](_0x58f9e5,'no\x20variable\x20found');}var _0x54c31f=this;_0x53deba[_0xa885('0xdc')](function(_0x2abf9a,_0x144d06){Object[_0xa885('0xdd')](_0x2abf9a)['forEach'](function(_0x2c56fc){_0x54c31f[_0xa885('0x10')][_0xa885('0xa7')](util[_0xa885('0x29')](_0xa885('0xde'),_0x11dc92,_0x144d06,_0x2c56fc),_0x2abf9a[_0x2c56fc]);});});this['channel'][_0xa885('0xa7')](util[_0xa885('0x29')](_0xa885('0xdf'),_0x11dc92),_0x53deba['length']);return this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0xe0'),_0x11dc92));};AGIVertices['prototype']['dial']=function(_0x44dbbf){logger[_0xa885('0xe1')](util[_0xa885('0x29')](_0xa885('0xe2'),_0x44dbbf[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x44dbbf[_0xa885('0xe3')])){return this[_0xa885('0x10')]['error'](_0x44dbbf,_0xa885('0xe4'));}var _0x34da56=this['getUser'][_0xa885('0xac')](this,_0x44dbbf[_0xa885('0xe3')]);if(!_0x34da56){return this[_0xa885('0x10')]['error'](_0x44dbbf,_0xa885('0xe5'));}var _0x41a9d9=this[_0xa885('0x10')]['exec'](_0xa885('0xe6'),[util['format']('SIP/%s',_0x34da56),_0x44dbbf[_0xa885('0x6b')],_0x44dbbf[_0xa885('0xe7')],_0x44dbbf[_0xa885('0x69')]]);if(_0x41a9d9[_0xa885('0xb1')]===-0x1){return _0x41a9d9;}return this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0xe8'),_0xa885('0xe6')));};AGIVertices['prototype'][_0xa885('0xe9')]=function(_0x1584cd){logger['info'](util[_0xa885('0x29')](_0xa885('0xea'),_0x1584cd[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x1584cd[_0xa885('0x7f')])){return this[_0xa885('0x10')]['noop'](_0xa885('0xeb'));}if(!this[_0xa885('0x8b')](_0x1584cd['text'])){return this['channel'][_0xa885('0xb2')](_0xa885('0xb0'));}this['channel']['bot']=!![];this[_0xa885('0x34')](_0x1584cd);this['createSquareMessage'](_0x1584cd[_0xa885('0x61')],'in','','');this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0xec'),_0x1584cd[_0xa885('0x61')]));var _0x250675=this[_0xa885('0x7e')][_0xa885('0xac')](this,_0x1584cd);if(_0x250675){for(var _0x484f29 in _0x250675){if(_0x250675[_0xa885('0xa1')](_0x484f29)){this[_0xa885('0x10')][_0xa885('0xa7')](util[_0xa885('0x29')](_0xa885('0xed'),_0x484f29[_0xa885('0x6f')]()),_0x250675[_0x484f29]);}}this[_0xa885('0x3f')](_0x250675[_0xa885('0xee')],_0xa885('0xef'),_0xa885('0xe9'),'');return this[_0xa885('0x10')]['noop'](util[_0xa885('0x29')]('Dialogflow\x20Result\x20%s',_0x250675[_0xa885('0xee')]));}return this[_0xa885('0x10')][_0xa885('0x31')](_0x1584cd,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xa885('0x13')][_0xa885('0xf0')]=function(_0x37bc57){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0xf1'),_0x37bc57[_0xa885('0x36')]));if(!this['isConfigured'](_0x37bc57[_0xa885('0x82')])){return this[_0xa885('0x10')][_0xa885('0xb2')]('no\x20project_id\x20configured');}if(!this[_0xa885('0x8b')](_0x37bc57[_0xa885('0x83')])){return this['channel'][_0xa885('0xb2')]('no\x20client_email\x20configured');}if(!this[_0xa885('0x8b')](_0x37bc57[_0xa885('0x84')])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0xf2'));}if(!this[_0xa885('0x8b')](_0x37bc57[_0xa885('0x85')])){return this[_0xa885('0x10')]['noop'](_0xa885('0xf3'));}if(!this[_0xa885('0x8b')](_0x37bc57['text'])){return this[_0xa885('0x10')][_0xa885('0xb2')]('no\x20text\x20configured');}this[_0xa885('0x10')][_0xa885('0xf4')]=!![];this['createSquareDetailsReport'](_0x37bc57);this[_0xa885('0x3f')](_0x37bc57[_0xa885('0x61')],'in','','');this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')]('Trying\x20DialogflowV2:\x20%s',_0x37bc57[_0xa885('0x61')]));var _0x480c99=this[_0xa885('0x81')][_0xa885('0xac')](this,_0x37bc57);if(_0x480c99){for(var _0x3c07d2 in _0x480c99){if(_0x480c99[_0xa885('0xa1')](_0x3c07d2)){if(_0x3c07d2!==_0xa885('0xf5')){this['channel'][_0xa885('0xa7')](util[_0xa885('0x29')](_0xa885('0xed'),_0x3c07d2[_0xa885('0x6f')]()),_0x480c99[_0x3c07d2]);}}}this[_0xa885('0x3f')](_0x480c99[_0xa885('0xee')],_0xa885('0xef'),_0xa885('0xf0'),_0x480c99[_0xa885('0xf5')]);return this['channel'][_0xa885('0xb2')](util['format'](_0xa885('0xf6'),_0x480c99[_0xa885('0xee')]));}return this[_0xa885('0x10')][_0xa885('0x31')](_0x37bc57,_0xa885('0xf7'));};AGIVertices[_0xa885('0x13')]['sesteknda']=function(_0x59ef99){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0xf8'),_0x59ef99[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x59ef99[_0xa885('0xf9')])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0xfa'));}if(!this[_0xa885('0x8b')](_0x59ef99['username'])){return this[_0xa885('0x10')][_0xa885('0xb2')]('no\x20username\x20configured');}if(!this[_0xa885('0x8b')](_0x59ef99['password'])){return this[_0xa885('0x10')][_0xa885('0xb2')]('no\x20password\x20configured');}if(!this[_0xa885('0x8b')](_0x59ef99[_0xa885('0xfb')])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0xb0'));}this[_0xa885('0x10')][_0xa885('0xf4')]=!![];this[_0xa885('0x34')](_0x59ef99);this[_0xa885('0x3f')](_0x59ef99[_0xa885('0x61')],'in','','');this[_0xa885('0x10')]['noop'](util[_0xa885('0x29')](_0xa885('0xfc'),_0x59ef99[_0xa885('0x61')]));var _0x766a36=this[_0xa885('0xfd')]['sync'](this,_0x59ef99);if(_0x766a36){for(var _0x3a5e21 in _0x766a36){if(_0x766a36['hasOwnProperty'](_0x3a5e21)){this[_0xa885('0x10')]['setVariable'](util['format'](_0xa885('0xfe'),_0x3a5e21[_0xa885('0x6f')]()),_0x766a36[_0x3a5e21]);}}this[_0xa885('0x3f')](_0x766a36[_0xa885('0xee')],_0xa885('0xef'),_0xa885('0xff'),'');if(_0x766a36[_0xa885('0x100')]){this['channel']['noop'](util[_0xa885('0x29')](_0xa885('0x101'),_0x766a36['audiofile']));var _0x32de02=this[_0xa885('0x10')]['streamFile'](_0x766a36[_0xa885('0x100')]);try{fs['unlink'](_0x766a36[_0xa885('0x100')]+_0xa885('0x102'));}catch(_0x498ced){logger[_0xa885('0x31')](_0x498ced);}return _0x32de02;}else{return this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')]('SestekNDA\x20Result\x20%s',_0x766a36['speech']));}}return this[_0xa885('0x10')][_0xa885('0x31')](_0x59ef99,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xa885('0x13')]['end']=function(_0x5320cd){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x103'),_0x5320cd['label']));return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0x104'));};AGIVertices[_0xa885('0x13')][_0xa885('0x105')]=function(_0x4f48f1){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x106'),_0x4f48f1['label']));var _0x476856='';if(_0x4f48f1[_0xa885('0x107')]){if(!this['isConfigured'](_0x4f48f1[_0xa885('0x107')])){return this['channel'][_0xa885('0x31')](_0x4f48f1,_0xa885('0x108'));}else{var _0x9c2cba=parseInt(_0x4f48f1['trunk_id'],0xa);if(isNaN(_0x9c2cba)){_0x476856=_0x4f48f1[_0xa885('0x107')];}else{_0x476856=this['getTrunk'][_0xa885('0xac')](this,_0x4f48f1[_0xa885('0x107')]);if(!_0x476856){return this[_0xa885('0x10')][_0xa885('0x31')](_0x4f48f1,_0xa885('0x109'));}}}}else if(_0x4f48f1['trunk_name']){_0x476856=_0x4f48f1[_0xa885('0x10a')];}else{return this[_0xa885('0x10')][_0xa885('0x31')](_0x4f48f1,_0xa885('0x108'));}var _0x13b9b3=this[_0xa885('0x10')][_0xa885('0x5e')]('DIAL',[util['format'](_0xa885('0x10b'),_0x476856,_0x4f48f1[_0xa885('0x46')]),_0x4f48f1['timeout'],_0x4f48f1[_0xa885('0xe7')],_0x4f48f1[_0xa885('0x69')]]);if(_0x13b9b3[_0xa885('0xb1')]===-0x1){return _0x13b9b3;}return this[_0xa885('0x10')]['noop'](util[_0xa885('0x29')]('Executed\x20command\x20%s',_0xa885('0xe6')));};AGIVertices[_0xa885('0x13')][_0xa885('0x10c')]=function(_0x515262){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x10d'),_0x515262['label']));return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0x10c'));};AGIVertices['prototype'][_0xa885('0xe')]=function(_0x43844b){logger[_0xa885('0x2c')](util['format'](_0xa885('0x10e'),_0x43844b[_0xa885('0x36')]));if(_0x43844b['retry']===0x0){return this[_0xa885('0xab')](_0x43844b);}_0x43844b[_0xa885('0xad')]-=0x1;if(!this[_0xa885('0x8b')](_0x43844b[_0xa885('0x10f')])){return this[_0xa885('0x10')][_0xa885('0x31')](_0x43844b,_0xa885('0x110'));}var _0x2d9367=this['getSound'][_0xa885('0xac')](this,_0x43844b['file_id']);if(!_0x2d9367){return this[_0xa885('0x10')][_0xa885('0x31')](_0x43844b,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x43844b[_0xa885('0xda')])){return this[_0xa885('0x10')][_0xa885('0x31')](_0xa885('0xdb'));}var _0x3d8ea0=this['channel'][_0xa885('0x111')](_0x2d9367,_0x43844b['response'],_0x43844b[_0xa885('0x112')]);var _0x3ca5bb=_0x3d8ea0[_0xa885('0xb1')]?_0x3d8ea0[_0xa885('0xb1')][_0xa885('0xaa')]():'';logger[_0xa885('0x2c')](_0xa885('0x113'),JSON['stringify'](_0x3d8ea0));if(_0x3d8ea0[_0xa885('0xb1')]===-0x1){this[_0xa885('0x34')][_0xa885('0xac')](this,_0x43844b,_0x3ca5bb);return _0x3d8ea0;}else if(_0x3d8ea0['extra']===_0xa885('0x6b')){_0x3d8ea0[_0xa885('0xb1')]=_0x3ca5bb[_0xa885('0xa6')]>=parseInt(_0x43844b[_0xa885('0x114')])?'x':'i';}else{_0x3d8ea0[_0xa885('0xb1')]=_0x3ca5bb[_0xa885('0xa6')]>=parseInt(_0x43844b[_0xa885('0x114')])&&_0x3ca5bb[_0xa885('0xa6')]<=parseInt(_0x43844b['maxdigit'])?'x':'i';}var _0xd44c46=this[_0xa885('0x14')][_0xa885('0xac')](this,_0x43844b[_0xa885('0xda')]);if(!_0xd44c46){return this[_0xa885('0x10')]['error'](_0x43844b,_0xa885('0x115'));}this[_0xa885('0x10')]['setVariable'](_0xd44c46,_0x3ca5bb);if(this[_0xa885('0x8b')](_0x43844b[_0xa885('0x116')])){var _0x46f20b=parseInt(_0x43844b[_0xa885('0x116')],0xa);var _0x326213=rs[_0xa885('0x117')]({'charset':'*','length':_0x46f20b});var _0x24ffc3=_0x3ca5bb[_0xa885('0xa6')];if(_0x24ffc3>0x0){if(_0x24ffc3>_0x46f20b){this['createSquareDetailsReport'][_0xa885('0xac')](this,_0x43844b,_0x43844b[_0xa885('0x118')]===_0xa885('0x119')?_0x326213+_0x3ca5bb[_0xa885('0x11a')](_0x46f20b):_0x3ca5bb[_0xa885('0x11a')](0x0,_0x24ffc3-_0x46f20b)+_0x326213);}else{this[_0xa885('0x34')][_0xa885('0xac')](this,_0x43844b,rs['generate']({'charset':'*','length':_0x24ffc3}));}}else{this['createSquareDetailsReport']['sync'](this,_0x43844b,'');}}else{this[_0xa885('0x34')]['sync'](this,_0x43844b,_0x3ca5bb);}return _0x3d8ea0;};AGIVertices[_0xa885('0x13')][_0xa885('0xf')]=function(_0x4b0968){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x11b'),_0x4b0968['label']));return this['getdigits'](_0x4b0968);};AGIVertices[_0xa885('0x13')][_0xa885('0x11c')]=function(_0xa1e37c){logger['info'](util[_0xa885('0x29')](_0xa885('0x11d'),_0xa1e37c[_0xa885('0x36')]));this['createSquareDetailsReport'][_0xa885('0xac')](this,_0xa1e37c,_0xa1e37c[_0xa885('0x11e')]);return this['channel'][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x11f'),_0xa1e37c[_0xa885('0x11e')]));};AGIVertices['prototype'][_0xa885('0x120')]=function(_0x4d85b4){logger[_0xa885('0x2c')](util['format'](_0xa885('0x121'),_0x4d85b4['label']));if(!this[_0xa885('0x8b')](_0x4d85b4[_0xa885('0x8e')])||!this[_0xa885('0x8b')](_0x4d85b4[_0xa885('0x93')])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0xa885('0x8b')](_0x4d85b4[_0xa885('0x61')])){return this['channel'][_0xa885('0xb2')](_0xa885('0xb0'));}this[_0xa885('0x10')][_0xa885('0xb2')](util['format'](_0xa885('0x122'),_0x4d85b4[_0xa885('0x61')]));var _0x2c679e=this[_0xa885('0x8d')][_0xa885('0xac')](this,_0x4d85b4);if(_0x2c679e){this[_0xa885('0x10')][_0xa885('0xb2')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x2c679e));var _0x219c97=this[_0xa885('0x10')][_0xa885('0x123')](_0x2c679e);try{fs['unlink'](_0x2c679e+_0xa885('0x102'));}catch(_0x2db613){logger[_0xa885('0x31')](_0x2db613);}return _0x219c97;}return this[_0xa885('0x10')]['error'](_0x4d85b4,_0xa885('0x124'));};AGIVertices[_0xa885('0x13')][_0xa885('0x125')]=function(_0x3cb3c6){logger['info'](util[_0xa885('0x29')](_0xa885('0x126'),_0x3cb3c6[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x3cb3c6[_0xa885('0x8e')])||!this[_0xa885('0x8b')](_0x3cb3c6['aws_secret_access_key'])){return this[_0xa885('0x10')]['noop'](_0xa885('0x127'));}if(!this[_0xa885('0x8b')](_0x3cb3c6[_0xa885('0x95')])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0x128'));}if(!this[_0xa885('0x8b')](_0x3cb3c6[_0xa885('0x61')])){return this[_0xa885('0x10')]['noop'](_0xa885('0xb0'));}this['channel'][_0xa885('0xf4')]=!![];this[_0xa885('0x34')](_0x3cb3c6);this[_0xa885('0x3f')](_0x3cb3c6[_0xa885('0x61')],'in','','');this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x129'),_0x3cb3c6[_0xa885('0x61')]));var _0xb45a59=this[_0xa885('0x92')][_0xa885('0xac')](this,_0x3cb3c6);if(_0xb45a59){for(var _0x4d6b5f in _0xb45a59){if(_0xb45a59[_0xa885('0xa1')](_0x4d6b5f)&&_[_0xa885('0x9d')](_0xb45a59[_0x4d6b5f])){this[_0xa885('0x10')][_0xa885('0xa7')](util[_0xa885('0x29')](_0xa885('0x12a'),_0x4d6b5f[_0xa885('0x6f')]()),_0xb45a59[_0x4d6b5f]);}}if(_[_0xa885('0x41')](_0xb45a59[_0xa885('0x7c')])){return this['channel']['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xa885('0x3f')](_0xb45a59[_0xa885('0x7c')],'out',_0xa885('0x12b'),'');return this[_0xa885('0x10')][_0xa885('0xb2')](util['format'](_0xa885('0x12c'),_0xb45a59['message']));}}return this[_0xa885('0x10')]['error'](_0x3cb3c6,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xa885('0x13')][_0xa885('0x12d')]=function(_0x57b981){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x12e'),_0x57b981[_0xa885('0x36')],_0x57b981[_0xa885('0x6b')]));if(!this[_0xa885('0x8b')](_0x57b981[_0xa885('0x7f')])){return this[_0xa885('0x10')]['noop'](_0xa885('0xeb'));}var _0x49c198='wav';var _0x16fe5e=util[_0xa885('0x29')](_0xa885('0x12f'),FILES_PATH,rs[_0xa885('0x117')](0x4));var _0x3c6c01=util[_0xa885('0x29')](_0xa885('0xa5'),_0x16fe5e,_0x49c198);var _0x535956=!![];if(_0x57b981['beep']===_0xa885('0x130')){_0x535956=![];}var _0x2014ae=this[_0xa885('0x10')][_0xa885('0x131')](_0x16fe5e,_0x49c198,_0x57b981[_0xa885('0x132')],_0x57b981[_0xa885('0x6b')],undefined,_0x535956);if(_0x2014ae['result']!==-0x1){this['channel'][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x133'),_0x3c6c01));var _0x2bb465=this[_0xa885('0x96')][_0xa885('0xac')](this,_0x57b981,_0x3c6c01);if(_0x2bb465){for(var _0xa7597e in _0x2bb465){if(_0x2bb465[_0xa885('0xa1')](_0xa7597e)){this[_0xa885('0x10')]['setVariable'](util[_0xa885('0x29')]('GOOGLE_ASR_%s',_0xa7597e['toUpperCase']()),_0x2bb465[_0xa7597e]);}}return this['channel'][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x134'),JSON[_0xa885('0x78')](_0x2bb465)));}}return _0x2014ae;};AGIVertices[_0xa885('0x13')][_0xa885('0x135')]=function(_0x374001){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x136'),_0x374001[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x374001[_0xa885('0x99')])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0x137'));}if(!this[_0xa885('0x8b')](_0x374001[_0xa885('0x9a')])){return this[_0xa885('0x10')][_0xa885('0xb2')]('no\x20appsecret\x20configured');}var _0x5ee09b='wav';var _0x5a8d22=util[_0xa885('0x29')](_0xa885('0x12f'),FILES_PATH,rs['generate'](0x4));var _0xbd859e=util[_0xa885('0x29')](_0xa885('0xa5'),_0x5a8d22,_0x5ee09b);var _0x433aea=!![];if(_0x374001[_0xa885('0x138')]===_0xa885('0x130')){_0x433aea=![];}var _0x1cd858=this[_0xa885('0x10')][_0xa885('0x131')](_0x5a8d22,_0x5ee09b,_0x374001['intKey'],_0x374001[_0xa885('0x6b')],undefined,_0x433aea);if(_0x1cd858[_0xa885('0xb1')]!==-0x1){this[_0xa885('0x10')][_0xa885('0xb2')](util['format'](_0xa885('0x139'),_0xbd859e));var _0x10c645=this['tildeASR'][_0xa885('0xac')](this,_0x374001,_0xbd859e);if(_0x10c645){for(var _0x5aee7d in _0x10c645){if(_0x10c645[_0xa885('0xa1')](_0x5aee7d)){this[_0xa885('0x10')]['setVariable'](util[_0xa885('0x29')](_0xa885('0x13a'),_0x5aee7d[_0xa885('0x6f')]()),_0x10c645[_0x5aee7d]);}}return this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x13b'),JSON['stringify'](_0x10c645)));}}return _0x1cd858;};AGIVertices[_0xa885('0x13')]['gotoc']=function(_0x5a40ce){logger['info'](util[_0xa885('0x29')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x5a40ce[_0xa885('0x36')]));return this[_0xa885('0x10')]['continueAt'](_0x5a40ce[_0xa885('0x3a')],_0x5a40ce['extension'],_0x5a40ce['priority']);};AGIVertices['prototype'][_0xa885('0x13c')]=function(_0x1869b1){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x13d'),_0x1869b1[_0xa885('0x36')]));if(!this['isConfigured'](_0x1869b1['condition'])){return this['channel'][_0xa885('0x31')](_0x1869b1,'no\x20condition\x20configured');}try{var _0x2e1ce4=eval(_0x1869b1[_0xa885('0x13e')])?_0xa885('0x13f'):'false';this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x140'),_0x1869b1[_0xa885('0x13e')],_0x2e1ce4));return{'code':0xc8,'result':_0x2e1ce4};}catch(_0x52aee7){return{'code':0xc8,'result':_0xa885('0x141')};}};AGIVertices[_0xa885('0x13')][_0xa885('0x142')]=function(_0x87aef){logger[_0xa885('0x2c')](util['format'](_0xa885('0x143'),_0x87aef['label']));if(!this[_0xa885('0x8b')](_0x87aef['interval_id'])){return this[_0xa885('0x10')][_0xa885('0x31')](_0x87aef,_0xa885('0x144'));}var _0x5deb4f=this[_0xa885('0x23')][_0xa885('0xac')](this,_0x87aef[_0xa885('0x145')]);if(!_0x5deb4f){return this['channel'][_0xa885('0x31')](_0x87aef,'no\x20intervals\x20found');}for(var _0x56632d=0x0;_0x56632d<_0x5deb4f['length'];_0x56632d+=0x1){var _0x4f7b90=this[_0xa885('0x10')][_0xa885('0x14')](util[_0xa885('0x29')](_0xa885('0x146'),_0x5deb4f[_0x56632d]));if(_0x4f7b90[_0xa885('0xb1')]===-0x1){return _0x4f7b90;}logger[_0xa885('0x2c')](util[_0xa885('0x29')]('IFTIME\x20%s\x20%s',_0x5deb4f[_0x56632d],_0x4f7b90['extra']));if(_0x4f7b90[_0xa885('0x147')]==='true'){logger[_0xa885('0x2c')](util[_0xa885('0x29')]('IFTIME\x20%s\x20%s',_0x5deb4f[_0x56632d],_0xa885('0x13f')));this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x148'),_0x5deb4f[_0x56632d],'true'));return{'code':0xc8,'result':_0xa885('0x13f')};}else{logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x148'),_0x5deb4f[_0x56632d],'false'));this[_0xa885('0x10')][_0xa885('0xb2')](util['format'](_0xa885('0x148'),_0x5deb4f[_0x56632d],_0xa885('0x141')));}}return{'code':0xc8,'result':_0xa885('0x141')};};AGIVertices[_0xa885('0x13')][_0xa885('0x149')]=function(_0x269140){logger['info'](util[_0xa885('0x29')](_0xa885('0x14a'),_0x269140['label']));return this[_0xa885('0x10')][_0xa885('0x149')]();};AGIVertices[_0xa885('0x13')][_0xa885('0x14b')]=function(_0x5a9c87){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x14c'),_0x5a9c87[_0xa885('0x36')]));if(!this['isConfigured'](_0x5a9c87['key'])){return this[_0xa885('0x10')]['noop'](_0xa885('0xeb'));}var _0x1c9672=_0xa885('0x14d');var _0x29262e=util['format'](_0xa885('0x12f'),FILES_PATH,rs[_0xa885('0x117')](0x4));var _0x4acd32=util[_0xa885('0x29')]('%s.%s',_0x29262e,_0x1c9672);var _0x2553aa=!![];if(_0x5a9c87['beep']===_0xa885('0x130')){_0x2553aa=![];}var _0x32fb6c=this['channel']['recordFile'](_0x29262e,_0x1c9672,_0x5a9c87[_0xa885('0x132')],_0x5a9c87[_0xa885('0x6b')],undefined,_0x2553aa);if(_0x32fb6c[_0xa885('0xb1')]!==-0x1){this[_0xa885('0x10')][_0xa885('0xb2')](util['format'](_0xa885('0x14e'),_0x4acd32));var _0x21e7bf=this[_0xa885('0x89')]['sync'](this,_0x5a9c87,_0x4acd32);if(_0x21e7bf){for(var _0x49633a in _0x21e7bf){if(_0x21e7bf[_0xa885('0xa1')](_0x49633a)){this['channel']['setVariable'](util[_0xa885('0x29')](_0xa885('0x14f'),_0x49633a[_0xa885('0x6f')]()),_0x21e7bf[_0x49633a]);}}return this[_0xa885('0x10')][_0xa885('0xb2')](util['format'](_0xa885('0x150'),JSON['stringify'](_0x21e7bf)));}}return _0x32fb6c;};AGIVertices[_0xa885('0x13')]['ispeechtts']=function(_0x338aeb){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x151'),_0x338aeb[_0xa885('0x36')]));if(!this['isConfigured'](_0x338aeb[_0xa885('0x7f')])){return this['channel'][_0xa885('0xb2')](_0xa885('0xeb'));}if(!this[_0xa885('0x8b')](_0x338aeb[_0xa885('0x61')])){return this[_0xa885('0x10')]['noop']('no\x20text\x20configured');}this[_0xa885('0x10')]['noop'](util[_0xa885('0x29')](_0xa885('0x152'),_0x338aeb[_0xa885('0x61')]));var _0x47acab=this[_0xa885('0x86')][_0xa885('0xac')](this,_0x338aeb);if(_0x47acab){this['channel'][_0xa885('0xb2')](util[_0xa885('0x29')]('ispeech\x20%s\x20file\x20created',_0x47acab));var _0xd524d5=this['channel'][_0xa885('0x123')](_0x47acab,_0x338aeb[_0xa885('0x132')]);try{fs[_0xa885('0x153')](_0x47acab+'.wav');}catch(_0x33dd65){logger['error'](_0x33dd65);}return _0xd524d5;}return this[_0xa885('0x10')][_0xa885('0x31')](_0x338aeb,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xa885('0x13')][_0xa885('0x154')]=function(_0xad7c1d){logger[_0xa885('0x2c')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0xad7c1d[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0xad7c1d[_0xa885('0x155')])){return this[_0xa885('0x10')][_0xa885('0x31')](_0xad7c1d,_0xa885('0x156'));}logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x157'),this[_0xa885('0x10')][_0xa885('0x38')],_0xad7c1d['findBy']));var _0x5d525c=this[_0xa885('0x5a')]['sync'](this,_0xad7c1d[_0xa885('0x155')]);if(_0x5d525c){logger['info'](util[_0xa885('0x29')](_0xa885('0x158'),this[_0xa885('0x10')]['callerid'],_0xad7c1d[_0xa885('0x155')]));this['channel'][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x158'),this[_0xa885('0x10')]['callerid'],_0xad7c1d[_0xa885('0x155')]));return{'code':0xc8,'result':_0xa885('0x159')};}else{logger[_0xa885('0x2c')](util['format'](_0xa885('0x15a'),this[_0xa885('0x10')][_0xa885('0x38')],_0xad7c1d[_0xa885('0x155')]));this[_0xa885('0x10')]['noop'](util[_0xa885('0x29')](_0xa885('0x15a'),this['channel'][_0xa885('0x38')],_0xad7c1d[_0xa885('0x155')]));return{'code':0xc8,'result':_0xa885('0x15b')};}};AGIVertices[_0xa885('0x13')][_0xa885('0x15c')]=function(_0x97188a){logger[_0xa885('0x2c')](util[_0xa885('0x29')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x97188a[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x97188a[_0xa885('0x155')])){return this[_0xa885('0x10')]['error'](_0x97188a,'no\x20find\x20by\x20configured');}logger[_0xa885('0x2c')](util[_0xa885('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xa885('0x38')],_0x97188a['findBy']));var _0x35f730=this[_0xa885('0x59')][_0xa885('0xac')](this,_0x97188a[_0xa885('0x155')]);if(_0x35f730){logger[_0xa885('0x2c')](util[_0xa885('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa885('0x10')][_0xa885('0x38')],_0x97188a[_0xa885('0x155')]));this[_0xa885('0x10')]['noop'](util[_0xa885('0x29')](_0xa885('0x158'),this[_0xa885('0x10')][_0xa885('0x38')],_0x97188a[_0xa885('0x155')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xa885('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa885('0x10')][_0xa885('0x38')],_0x97188a[_0xa885('0x155')]));this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa885('0x10')][_0xa885('0x38')],_0x97188a[_0xa885('0x155')]));return{'code':0xc8,'result':_0xa885('0x15b')};}};AGIVertices[_0xa885('0x13')][_0xa885('0x15d')]=function(_0x569015){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x15e'),_0x569015[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x569015[_0xa885('0x15f')])){return this[_0xa885('0x10')]['error'](_0x569015,_0xa885('0x160'));}this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x161'),_0x569015[_0xa885('0x15f')]));var _0x2ab78c=eval(_0x569015[_0xa885('0x15f')]);if(!this[_0xa885('0x8b')](_0x569015['variable_id'])){return this['channel'][_0xa885('0xb2')](_0xa885('0xdb'));}var _0x21e28a=this[_0xa885('0x14')][_0xa885('0xac')](this,_0x569015[_0xa885('0xda')]);if(!_0x21e28a){return this[_0xa885('0x10')][_0xa885('0x31')](_0x569015,_0xa885('0x115'));}if(_[_0xa885('0xa3')](_0x2ab78c)){var _0x2de033=this;_0x2ab78c['forEach'](function(_0x44e8a4,_0x386503){_0x2de033[_0xa885('0x10')][_0xa885('0xa7')](util['format'](_0xa885('0x162'),_0x21e28a,_0x386503),_0x44e8a4);});return this[_0xa885('0x10')][_0xa885('0xb2')](util['format'](_0xa885('0x163'),_0x21e28a));}else{return this[_0xa885('0x10')][_0xa885('0xa7')](_0x21e28a,_0x2ab78c);}};AGIVertices[_0xa885('0x13')]['menu']=function(_0x2e91b1){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x164'),_0x2e91b1[_0xa885('0x36')]));if(_0x2e91b1[_0xa885('0xad')]===0x0){return this[_0xa885('0xab')](_0x2e91b1);}_0x2e91b1[_0xa885('0xad')]-=0x1;if(!this['isConfigured'](_0x2e91b1[_0xa885('0x10f')])){return this[_0xa885('0x10')][_0xa885('0x31')](_0x2e91b1,_0xa885('0x110'));}var _0x4ca096=this[_0xa885('0x20')][_0xa885('0xac')](this,_0x2e91b1[_0xa885('0x10f')]);if(!_0x4ca096){return this[_0xa885('0x10')]['error'](_0x2e91b1,'no\x20file\x20audio\x20found');}var _0x393b3a=this[_0xa885('0x10')][_0xa885('0x111')](_0x4ca096,_0x2e91b1[_0xa885('0x165')],_0x2e91b1[_0xa885('0x166')]);var _0x251dd6=_0x393b3a[_0xa885('0xb1')];if(_0x393b3a[_0xa885('0xb1')]===-0x1){this[_0xa885('0x34')][_0xa885('0xac')](this,_0x2e91b1,'-1');return _0x393b3a;}else if(_0x393b3a[_0xa885('0x147')]===_0xa885('0x6b')){_0x393b3a[_0xa885('0xb1')]=_0x393b3a[_0xa885('0xb1')]['length']>0x0?_0x393b3a[_0xa885('0xb1')]:'t';}else if(_[_0xa885('0x44')](_0x393b3a['result'])){_0x393b3a[_0xa885('0xb1')]='#';_0x251dd6='#';}if(!this[_0xa885('0x8b')](_0x2e91b1[_0xa885('0xda')])){this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x3cb7a2=this[_0xa885('0x14')][_0xa885('0xac')](this,_0x2e91b1[_0xa885('0xda')]);if(!_0x3cb7a2){return this['channel'][_0xa885('0x31')](_0x2e91b1,_0xa885('0x115'));}this[_0xa885('0x10')][_0xa885('0xa7')](_0x3cb7a2,_0x251dd6);}this[_0xa885('0x34')][_0xa885('0xac')](this,_0x2e91b1,_0x251dd6);return _0x393b3a;};AGIVertices[_0xa885('0x13')][_0xa885('0xb2')]=function(_0x326a52){logger[_0xa885('0x2c')](util[_0xa885('0x29')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x326a52['label']));return this[_0xa885('0x10')][_0xa885('0xb2')](_0x326a52['output']||_0x326a52[_0xa885('0x36')]);};AGIVertices[_0xa885('0x13')][_0xa885('0x167')]=function(_0x3f9e24){logger[_0xa885('0x2c')](util['format'](_0xa885('0x168'),_0x3f9e24[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x3f9e24[_0xa885('0x155')])){return this[_0xa885('0x10')][_0xa885('0x31')](_0x3f9e24,_0xa885('0x156'));}logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x157'),this[_0xa885('0x10')][_0xa885('0x38')],_0x3f9e24[_0xa885('0x155')]));var _0x18050b=this['getPause'][_0xa885('0xac')](this,_0x3f9e24['pause_id']);var _0x165c97=this['agentPause'][_0xa885('0xac')](this,_0x3f9e24[_0xa885('0x155')],_0x18050b);if(_0x165c97){logger[_0xa885('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xa885('0x38')],_0x3f9e24[_0xa885('0x155')]));this[_0xa885('0x10')]['noop'](util['format'](_0xa885('0x158'),this[_0xa885('0x10')]['callerid'],_0x3f9e24[_0xa885('0x155')]));return{'code':0xc8,'result':_0xa885('0x159')};}else{logger['info'](util['format'](_0xa885('0x15a'),this[_0xa885('0x10')]['callerid'],_0x3f9e24[_0xa885('0x155')]));this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa885('0x10')][_0xa885('0x38')],_0x3f9e24[_0xa885('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xa885('0x169')]=function(_0x54f4f4){logger['info'](util[_0xa885('0x29')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x54f4f4[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x54f4f4[_0xa885('0x10f')])){return this['channel']['error'](_0x54f4f4,_0xa885('0x110'));}var _0x1d9988=this[_0xa885('0x20')][_0xa885('0xac')](this,_0x54f4f4[_0xa885('0x10f')]);if(!_0x1d9988){return this[_0xa885('0x10')][_0xa885('0x31')](_0x54f4f4,_0xa885('0x16a'));}var _0x3cd06b=this[_0xa885('0x10')][_0xa885('0x5e')]('PLAYBACK',[_0x1d9988,_0x54f4f4['opts']]);if(_0x3cd06b['result']===-0x1){return _0x3cd06b;}return this[_0xa885('0x10')]['noop'](util['format'](_0xa885('0xc8'),'PLAYBACK',_0x1d9988));};AGIVertices[_0xa885('0x13')][_0xa885('0x16b')]=function(_0x571144){logger[_0xa885('0x2c')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x571144['label']));if(!this[_0xa885('0x8b')](_0x571144[_0xa885('0x16c')])){return this[_0xa885('0x10')][_0xa885('0x31')](_0x571144,'no\x20queue\x20selected');}var _0x2ad555='';var _0x421599=parseInt(_0x571144[_0xa885('0x16c')],0xa);if(isNaN(_0x421599)){_0x2ad555=_0x571144[_0xa885('0x16c')];}else{_0x2ad555=this[_0xa885('0x19')]['sync'](this,_0x571144[_0xa885('0x16c')]);if(!_0x2ad555){return this[_0xa885('0x10')]['error'](_0x571144,_0xa885('0x16d'));}}var _0x4731b9='';if(this['isConfigured'](_0x571144[_0xa885('0x10f')])){var _0x30942f=this[_0xa885('0x20')][_0xa885('0xac')](this,_0x571144['file_id']);if(_0x30942f){_0x4731b9=_0x30942f;}}this[_0xa885('0x34')][_0xa885('0xac')](this,_0x571144,_0x2ad555);if(_0x571144[_0xa885('0xe7')][_0xa885('0x16e')]('x')<0x0){_0x571144[_0xa885('0xe7')]+='x';}if(_0x571144[_0xa885('0xe7')][_0xa885('0x16e')]('X')<0x0){_0x571144[_0xa885('0xe7')]+='X';}this[_0xa885('0x10')][_0xa885('0xa7')]('XMCS-QUEUE',_0x2ad555?_0x2ad555[_0xa885('0x16f')]():'');var _0x428b04=this[_0xa885('0x10')]['exec'](_0xa885('0x170'),[_0x2ad555,_0x571144[_0xa885('0xe7')],_0x571144[_0xa885('0x69')],_0x4731b9,_0x571144[_0xa885('0x6b')],_0x571144[_0xa885('0x8')],_0x571144[_0xa885('0x171')],_0x571144[_0xa885('0x172')],'',_0x571144[_0xa885('0x173')]]);if(_0x428b04[_0xa885('0xb1')]===-0x1){return _0x428b04;}return this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0xc8'),_0xa885('0x170'),_0x2ad555));};AGIVertices['prototype'][_0xa885('0x174')]=function(_0x1d3901){logger['info'](util[_0xa885('0x29')](_0xa885('0x175'),_0x1d3901[_0xa885('0x36')]));var _0x11a464=_0x1d3901[_0xa885('0x176')]||_0xa885('0x14d');var _0x554ae3=util[_0xa885('0x29')](_0xa885('0x177'),this[_0xa885('0x10')][_0xa885('0x35')],rs['generate'](0x5));var _0x55eba3=util[_0xa885('0x29')](_0xa885('0x178'),FILES_PATH,_0x554ae3,_0x11a464);var _0x120172=util[_0xa885('0x29')](_0xa885('0x12f'),FILES_PATH,_0x554ae3);this[_0xa885('0x39')][_0xa885('0xac')](this,_0x1d3901,_0x554ae3,_0x55eba3);this[_0xa885('0x10')]['setVariable'](_0xa885('0x179'),_0x554ae3);logger[_0xa885('0x2c')](_0xa885('0x17a'),_0x120172,_0x11a464,_0x1d3901['escape_digits'],_0x1d3901[_0xa885('0x6b')]);return this[_0xa885('0x10')][_0xa885('0x131')](_0x120172,_0x11a464,_0x1d3901[_0xa885('0x17b')],_0x1d3901[_0xa885('0x6b')],undefined,!![]);};AGIVertices[_0xa885('0x13')][_0xa885('0x17c')]=function(_0x29bb57){logger[_0xa885('0x2c')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x29bb57[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x29bb57[_0xa885('0x69')])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0x17d'));}var _0x5e3a67=this['restAPI']['sync'](this,_0x29bb57);logger[_0xa885('0x2c')](util['format']('Response:',util['inspect'](_0x5e3a67,{'showHidden':![],'depth':null})));if(!this[_0xa885('0x8b')](_0x29bb57[_0xa885('0xda')])){return this[_0xa885('0x10')]['noop'](_0xa885('0x17e'));}var _0x34eb06=this[_0xa885('0x14')]['sync'](this,_0x29bb57[_0xa885('0xda')]);if(!_0x34eb06){return this[_0xa885('0x10')]['error'](_0x29bb57,_0xa885('0x115'));}this['channel']['setVariable'](util[_0xa885('0x29')](_0xa885('0x17f'),_0x34eb06),_0x5e3a67['statusCode']?_0x5e3a67[_0xa885('0x7a')]:'200');this[_0xa885('0x10')][_0xa885('0xa7')](util['format'](_0xa885('0x180'),_0x34eb06),_0x5e3a67['statusMessage']?_0x5e3a67[_0xa885('0x7b')]:'OK');if(_0x5e3a67[_0xa885('0x70')]){try{this[_0xa885('0xa4')](_0x5e3a67[_0xa885('0x70')],_0x34eb06);}catch(_0x3e3aca){logger[_0xa885('0x31')](util['format'](_0xa885('0x181'),_0x34eb06));}}return this[_0xa885('0x10')][_0xa885('0xb2')](util['format'](_0xa885('0xe0'),_0x34eb06));};AGIVertices[_0xa885('0x13')]['saydigits']=function(_0x274b87){logger['info'](util[_0xa885('0x29')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x274b87[_0xa885('0x36')]));return this[_0xa885('0x10')][_0xa885('0x182')](_0x274b87[_0xa885('0x183')][_0xa885('0x5f')](/\s+/g,''),_0x274b87[_0xa885('0x17b')]);};AGIVertices[_0xa885('0x13')][_0xa885('0x184')]=function(_0x16afe9){logger['info'](util[_0xa885('0x29')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x16afe9[_0xa885('0x36')]));return this[_0xa885('0x10')][_0xa885('0x185')](_0x16afe9[_0xa885('0x186')][_0xa885('0x5f')](/\s+/g,''),_0x16afe9[_0xa885('0x17b')]);};AGIVertices[_0xa885('0x13')]['sayphonetic']=function(_0x5eb4cf){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x187'),_0x5eb4cf[_0xa885('0x36')]));return this['channel'][_0xa885('0x188')](_0x5eb4cf['text'],_0x5eb4cf['escape_digits']);};AGIVertices[_0xa885('0x13')]['sendMail']=function(_0xfc23d3){logger[_0xa885('0x2c')](util[_0xa885('0x29')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0xfc23d3[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0xfc23d3['account_id'])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0x189'));}var _0x29392=this[_0xa885('0x18a')][_0xa885('0xac')](this,_0xfc23d3[_0xa885('0x18b')]);if(!_0x29392||!_0x29392[_0xa885('0x18c')]){return this[_0xa885('0x10')][_0xa885('0x31')](_0xfc23d3,_0xa885('0x18d'));}var _0x25e0a6={'from':util['format'](_0xa885('0x18e'),_0x29392[_0xa885('0x17')],_0x29392[_0xa885('0x18f')]||_0x29392[_0xa885('0x18c')]['user']),'to':_0xfc23d3['to']||'','cc':_0xfc23d3['cc']||'','bcc':_0xfc23d3[_0xa885('0x190')]||'','subject':_0xfc23d3[_0xa885('0x191')],'html':_0xfc23d3[_0xa885('0x61')],'text':_0xfc23d3[_0xa885('0x61')]};var _0x2c9dda={'tls':{'rejectUnauthorized':![]}};if(_0x29392[_0xa885('0x18c')][_0xa885('0x192')]){_0x2c9dda['service']=_0x29392[_0xa885('0x18c')][_0xa885('0x192')];}else{_0x2c9dda['host']=_0x29392[_0xa885('0x18c')][_0xa885('0x193')];_0x2c9dda['port']=_0x29392['Smtp'][_0xa885('0x194')];_0x2c9dda['secure']=_0x29392['Smtp'][_0xa885('0x195')];}if(_0x29392[_0xa885('0x18c')][_0xa885('0x196')]){_0x2c9dda[_0xa885('0x197')]={'user':_0x29392[_0xa885('0x18c')][_0xa885('0x198')],'pass':_0x29392[_0xa885('0x18c')][_0xa885('0x199')]};}if(this['isConfigured'](_0xfc23d3[_0xa885('0x19a')])){}logger['debug'](_0xa885('0x19b'),JSON[_0xa885('0x78')](_0x25e0a6));this[_0xa885('0x34')][_0xa885('0xac')](this,_0xfc23d3,_0xfc23d3[_0xa885('0x18b')]);this['channel'][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x19c'),_0x29392[_0xa885('0x17')]));this[_0xa885('0x19d')][_0xa885('0xac')](this,_0x2c9dda,_0x25e0a6);return this[_0xa885('0x10')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['sendFax']=function(_0x12f2eb){logger[_0xa885('0x2c')](util[_0xa885('0x29')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x12f2eb[_0xa885('0x36')]));return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0x19e'));};AGIVertices[_0xa885('0x13')]['sendSMS']=function(_0x4a16c4){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x19f'),_0x4a16c4['label']));if(!this[_0xa885('0x8b')](_0x4a16c4[_0xa885('0x1a0')])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0x1a1'));}var _0x476f0c=this[_0xa885('0x32')]['sync'](this,_0x4a16c4[_0xa885('0x1a0')]);if(!_0x476f0c){return this[_0xa885('0x10')][_0xa885('0x31')](_0x4a16c4,_0xa885('0x1a2'));}var _0x5c95fc={'body':_0x4a16c4[_0xa885('0x1a3')],'phone':_0x4a16c4['to']||'','SmsAccountId':_0x476f0c['id']};logger['debug'](_0xa885('0x1a4'),JSON[_0xa885('0x78')](_0x5c95fc));this['createSquareDetailsReport'][_0xa885('0xac')](this,_0x4a16c4,_0x4a16c4['sms_account_id']);this[_0xa885('0x10')]['noop'](util[_0xa885('0x29')](_0xa885('0x1a5'),_0x476f0c[_0xa885('0x17')]));this[_0xa885('0x33')][_0xa885('0xac')](this,_0x5c95fc);return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0x1a6'));};AGIVertices[_0xa885('0x13')]['set']=function(_0x24d6ee){logger['info'](util[_0xa885('0x29')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x24d6ee[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x24d6ee[_0xa885('0xda')])){return this[_0xa885('0x10')]['error'](_0x24d6ee,_0xa885('0x1a7'));}var _0x4bdd9b=this[_0xa885('0x14')][_0xa885('0xac')](this,_0x24d6ee['variable_id']);if(!_0x4bdd9b){return this[_0xa885('0x10')][_0xa885('0x31')](_0x24d6ee,'no\x20variable\x20found');}return this[_0xa885('0x10')][_0xa885('0xa7')](_0x4bdd9b,_0x24d6ee[_0xa885('0x1a8')]);};AGIVertices['prototype'][_0xa885('0x1a9')]=function(_0x36f853){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x1aa'),_0x36f853[_0xa885('0x36')]));this[_0xa885('0x10')]['noop']('START\x20CALLY\x20SQUARE');if(_0x36f853[_0xa885('0xbf')]===_0xa885('0x1ab')){this['channel'][_0xa885('0xb2')](_0xa885('0x1ac'));return this['channel'][_0xa885('0xbf')]();}return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0x1ad'));};AGIVertices[_0xa885('0x13')][_0xa885('0x1ae')]=function(_0x48ec4b){logger['info'](util[_0xa885('0x29')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x48ec4b[_0xa885('0x36')]));if(!this[_0xa885('0x8b')](_0x48ec4b[_0xa885('0x1af')])){return this[_0xa885('0x10')]['error'](_0x48ec4b,_0xa885('0x1b0'));}var _0x50c50b=this[_0xa885('0x1a')][_0xa885('0xac')](this,_0x48ec4b[_0xa885('0x1af')]);if(!this['isConfigured'](_0x50c50b)){return this[_0xa885('0x10')][_0xa885('0x31')](_0x48ec4b,util[_0xa885('0x29')](_0xa885('0x1b1'),_0x48ec4b[_0xa885('0x1af')]));}if(_0x50c50b===this[_0xa885('0x10')]['arg_1']){return this[_0xa885('0x10')]['error'](_0x48ec4b,_0xa885('0x1b2'));}this[_0xa885('0x34')]['sync'](this,_0x48ec4b,_0x50c50b);var _0x64f3f8=this[_0xa885('0x10')]['exec'](_0xa885('0x1b3'),util[_0xa885('0x29')](_0xa885('0x1b4'),config['agi'][_0xa885('0x193')]||'127.0.0.1',_0x50c50b,this[_0xa885('0x10')][_0xa885('0x3d')]));if(_0x64f3f8[_0xa885('0xb1')]===-0x1){return _0x64f3f8;}return this[_0xa885('0x10')]['noop'](util[_0xa885('0x29')](_0xa885('0xc8'),'AGI',_0x50c50b));};AGIVertices[_0xa885('0x13')][_0xa885('0x1b5')]=function(_0x2f479a){logger[_0xa885('0x2c')](util['format'](_0xa885('0x1b6'),_0x2f479a[_0xa885('0x36')]));var _0x4715d3=this['shellCommand'][_0xa885('0xac')](this,_0x2f479a[_0xa885('0xbe')]);this['createSquareDetailsReport']['sync'](this,_0x2f479a,_0x2f479a[_0xa885('0xbe')]);if(this['isConfigured'](_0x2f479a['variable_id'])){var _0x15fb64=this[_0xa885('0x14')]['sync'](this,_0x2f479a[_0xa885('0xda')]);if(_0x15fb64){this[_0xa885('0x10')][_0xa885('0xa7')](_0x15fb64,_0x4715d3);return this['channel']['noop'](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x2f479a['command'],_0x15fb64));}}return this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x1b7'),_0x2f479a[_0xa885('0xbe')]));};AGIVertices['prototype'][_0xa885('0x1b8')]=function(_0x332dbb){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x1b9'),_0x332dbb[_0xa885('0x36')]));_0x332dbb[_0xa885('0x61')]=_0x332dbb[_0xa885('0x61')][_0xa885('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa885('0x8b')](_0x332dbb[_0xa885('0x1ba')])){return this[_0xa885('0x10')][_0xa885('0xb2')]('no\x20apiKey\x20configured');}if(!this[_0xa885('0x8b')](_0x332dbb['text'])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0xb0'));}this[_0xa885('0x10')]['noop'](util[_0xa885('0x29')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x332dbb[_0xa885('0x61')]));var _0x37db01=this['googleCloudTTS']['sync'](this,_0x332dbb);if(_0x37db01){this['channel'][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x1bb'),_0x37db01));var _0x13abc5=this[_0xa885('0x10')][_0xa885('0x123')](_0x37db01);try{fs[_0xa885('0x153')](_0x37db01+_0xa885('0x102'));}catch(_0x543c3b){logger[_0xa885('0x31')](_0x543c3b);}return _0x13abc5;}return this[_0xa885('0x10')]['error'](_0x332dbb,_0xa885('0x1bc'));};AGIVertices[_0xa885('0x13')]['tts']=function(_0x40d4d4){logger[_0xa885('0x2c')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x40d4d4[_0xa885('0x36')]));_0x40d4d4[_0xa885('0x61')]=_0x40d4d4[_0xa885('0x61')][_0xa885('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa885('0x8b')](_0x40d4d4[_0xa885('0x61')])){return this[_0xa885('0x10')][_0xa885('0xb2')](_0xa885('0xb0'));}this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')]('Trying\x20Google\x20TTS\x20%s',_0x40d4d4[_0xa885('0x61')]));var _0x941805=this[_0xa885('0x68')][_0xa885('0xac')](this,_0x40d4d4);if(_0x941805){this['channel'][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x1bd'),_0x941805));var _0x119f55=this['channel'][_0xa885('0x123')](_0x941805);try{fs[_0xa885('0x153')](_0x941805+'.wav');}catch(_0x25dc8e){logger[_0xa885('0x31')](_0x25dc8e);}return _0x119f55;}return this[_0xa885('0x10')][_0xa885('0x31')](_0x40d4d4,_0xa885('0x1be'));};AGIVertices[_0xa885('0x13')][_0xa885('0x1bf')]=function(_0x456d11){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x1c0'),_0x456d11['label']));if(!this[_0xa885('0x8b')](_0x456d11[_0xa885('0x155')])){return this[_0xa885('0x10')][_0xa885('0x31')](_0x456d11,_0xa885('0x156'));}logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x157'),this[_0xa885('0x10')][_0xa885('0x38')],_0x456d11['findBy']));var _0x39852c=this[_0xa885('0x58')][_0xa885('0xac')](this,_0x456d11[_0xa885('0x155')]);if(_0x39852c){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x158'),this[_0xa885('0x10')]['callerid'],_0x456d11[_0xa885('0x155')]));this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x158'),this[_0xa885('0x10')][_0xa885('0x38')],_0x456d11[_0xa885('0x155')]));return{'code':0xc8,'result':'success'};}else{logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x15a'),this[_0xa885('0x10')][_0xa885('0x38')],_0x456d11[_0xa885('0x155')]));this[_0xa885('0x10')][_0xa885('0xb2')](util[_0xa885('0x29')](_0xa885('0x15a'),this['channel']['callerid'],_0x456d11[_0xa885('0x155')]));return{'code':0xc8,'result':_0xa885('0x15b')};}};AGIVertices[_0xa885('0x13')]['voicemail']=function(_0x4e3906){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x1c1'),_0x4e3906[_0xa885('0x36')]));var _0x1dcb0b=this[_0xa885('0x10')][_0xa885('0x5e')]('VOICEMAIL',[_0x4e3906[_0xa885('0x1c2')],_0x4e3906['options']]);if(_0x1dcb0b['result']===-0x1){return _0x1dcb0b;}return this[_0xa885('0x10')][_0xa885('0xb2')](util['format'](_0xa885('0xc8'),_0xa885('0x1c3'),_0x4e3906['mailbox']));};AGIVertices['prototype'][_0xa885('0x1c4')]=function(_0x2418d6){logger[_0xa885('0x2c')](util[_0xa885('0x29')](_0xa885('0x1c5'),_0x2418d6['label']));if(!this[_0xa885('0x8b')](_0x2418d6[_0xa885('0xda')])){return this[_0xa885('0x10')][_0xa885('0x31')](_0x2418d6,'no\x20variable\x20selected');}var _0x111f09=this[_0xa885('0x14')][_0xa885('0xac')](this,_0x2418d6[_0xa885('0xda')]);if(!_0x111f09){return this[_0xa885('0x10')]['error'](_0x2418d6,'no\x20variable\x20found');}var _0x42ce8c=this['channel']['getVariable'](_0x111f09);return{'code':0xc8,'result':_0x42ce8c[_0xa885('0x147')]?_0x42ce8c['extra']:'-'};};String[_0xa885('0x13')][_0xa885('0xa9')]=function(_0x557ff8,_0x58339b){return this[_0xa885('0xa8')](_0x557ff8)['join'](_0x58339b);};module['exports']=AGIVertices; \ No newline at end of file +var _0x4d9e=['agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','scheduledAt','toString','callback_priority','dialTimezone','getContactByPhone','timezones','scheduledat','add','minutes','insertContact','utcOffset','getPauseById','agentPause','agent','agentUnpause','agentLogout','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','aws_bot_name','googleASR','tildeASR','appsecret','clear','hasOwnProperty','isString','includes','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','result','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','odbc_id','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','createSquareMessage','Trying\x20Dialogflow:\x20%s','speech','Dialogflow\x20Result\x20%s','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','awsPolly','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20Result\x20%s','googleasr','wav','%s/recordings/%s','beep','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','NOBEEP','recordFile','tilde\x20%s\x20file\x20created','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','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','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','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','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','operation','no\x20operation\x20configured','math\x20%s','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','failure','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusCode','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','\x22%s\x22\x20<%s>','email','bcc','subject','service','port','secure','authentication','auth','user','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','shelljs','randomstring','mustache','request-promise','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','then','name','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x4550cd,_0x52334c){_0x4550cd=_0x4550cd-0x0;var _0x15a9d0=_0x4d9e[_0x4550cd];return _0x15a9d0;};'use strict';var fs=require('fs');var path=require(_0xe4d9('0x0'));var util=require('util');var _=require('lodash');var sh=require(_0xe4d9('0x1'));var odbc=require('odbc')();var rs=require(_0xe4d9('0x2'));var moment=require('moment');var Mustache=require(_0xe4d9('0x3'));var rp=require(_0xe4d9('0x4'));var logger=require('../../config/logger')(_0xe4d9('0x5'));var config=require(_0xe4d9('0x6'));var shared=require(_0xe4d9('0x7'));var scripts=require(_0xe4d9('0x8'));var FILES_PATH=_0xe4d9('0x9');var recursiveMapAttributes=[_0xe4d9('0xa'),'rawBody'];var verticesWithRetry=[_0xe4d9('0xb'),_0xe4d9('0xc'),_0xe4d9('0xd')];var AGIVertices=function(_0x18ab9d,_0x3f8937,_0x21ebb8){this['channel']=_0x18ab9d;this[_0xe4d9('0xe')]=_0x3f8937;this[_0xe4d9('0xf')]=_0x21ebb8;};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x11')]=function(_0xddd1fb,_0x3d1e0e){this[_0xe4d9('0xe')]['getVariableById'](_0xddd1fb)['then'](function(_0x580c50){_0x3d1e0e(null,_0x580c50?_0x580c50['name']:![]);})['catch'](function(_0x4b5b09){_0x3d1e0e(_0x4b5b09);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x15c0eb,_0x3238d4){this[_0xe4d9('0xe')]['getVoiceQueueById'](_0x15c0eb)[_0xe4d9('0x12')](function(_0x3f6ce4){_0x3238d4(null,_0x3f6ce4?_0x3f6ce4[_0xe4d9('0x13')]:![]);})[_0xe4d9('0x14')](function(_0x58d0cf){_0x3238d4(_0x58d0cf);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x15')]=function(_0x4687f8,_0x4b354d){this['rpc'][_0xe4d9('0x16')](_0x4687f8)[_0xe4d9('0x12')](function(_0x5ab3d1){_0x4b354d(null,_0x5ab3d1?_0x5ab3d1[_0xe4d9('0x13')]:![]);})['catch'](function(_0x469931){_0x4b354d(_0x469931);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x17')]=function(_0x2522f3,_0x503570){this[_0xe4d9('0xe')][_0xe4d9('0x18')](_0x2522f3)[_0xe4d9('0x12')](function(_0x171224){_0x503570(null,_0x171224?_0x171224[_0xe4d9('0x19')]:![]);})[_0xe4d9('0x14')](function(_0x30d923){_0x503570(_0x30d923);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x1a')]=function(_0x4fed7f,_0x44f1aa){this[_0xe4d9('0xe')]['getUserById'](_0x4fed7f)[_0xe4d9('0x12')](function(_0x50d377){_0x44f1aa(null,_0x50d377?_0x50d377[_0xe4d9('0x13')]:![]);})[_0xe4d9('0x14')](function(_0x5b494d){_0x44f1aa(_0x5b494d);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x1b')]=function(_0x5b88e9,_0xc5be1b){this[_0xe4d9('0xe')][_0xe4d9('0x1c')](_0x5b88e9)['then'](function(_0x4ee33d){_0xc5be1b(null,_0x4ee33d?_0x4ee33d[_0xe4d9('0x13')]:![]);})[_0xe4d9('0x14')](function(_0x52ef56){_0xc5be1b(_0x52ef56);});};AGIVertices['prototype']['getSound']=function(_0x529e2b,_0x221a61){var _0x48d481=this;this[_0xe4d9('0xe')][_0xe4d9('0x1d')](_0x529e2b)[_0xe4d9('0x12')](function(_0x535200){_0x221a61(null,_0x535200?_0x48d481[_0xe4d9('0x1e')](_0x535200[_0xe4d9('0x1f')]):![]);})[_0xe4d9('0x14')](function(_0x45e8a3){_0x221a61(_0x45e8a3);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x20')]=function(_0x21b7a9,_0x449cb8){this[_0xe4d9('0xe')][_0xe4d9('0x21')](_0x21b7a9)[_0xe4d9('0x12')](function(_0x29a121){_0x449cb8(null,_0x29a121?_0x29a121:![]);})['catch'](function(_0x22efd2){_0x449cb8(_0x22efd2);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x22')]=function(_0x3721a0,_0xa444d0,_0x12e0ae){this['mailRpc']['sendMailMessage'](_0x3721a0,_0xa444d0)['then'](function(){_0x12e0ae(null);})[_0xe4d9('0x14')](function(_0x100e57){_0x12e0ae(_0x100e57);});};AGIVertices[_0xe4d9('0x10')]['getIntervals']=function(_0x5a7422,_0x5ad794){this['rpc'][_0xe4d9('0x23')](_0x5a7422)[_0xe4d9('0x12')](function(_0x4f059b){if(_0x4f059b){if(_0x4f059b[_0xe4d9('0x24')]){_0x5ad794(null,[_0x4f059b[_0xe4d9('0x25')]]);}else{_0x5ad794(null,_['map'](_0x4f059b[_0xe4d9('0x26')],_0xe4d9('0x25')));}}else{_0x5ad794(null,![]);}})[_0xe4d9('0x14')](function(_0x4f7a6c){_0x5ad794(_0x4f7a6c);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x1e')]=function(_0x7073ca){return util[_0xe4d9('0x27')](_0xe4d9('0x28'),FILES_PATH,_0x7073ca);};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x29')]=function(_0x517f24,_0x234b62,_0x34f72f){odbc['open'](_0x517f24,function(_0x35b5f5){if(_0x35b5f5){logger[_0xe4d9('0x2a')](_0xe4d9('0x2b'),_0x35b5f5);_0x34f72f(_0x35b5f5);}else{logger[_0xe4d9('0x2c')](_0xe4d9('0x2d'));odbc[_0xe4d9('0x2e')](_0x234b62,function(_0x2e8243,_0x4423a7){if(_0x2e8243){logger[_0xe4d9('0x2c')]('Error\x20executing\x20query\x20%s',_0x234b62);_0x34f72f(_0x2e8243);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x234b62);odbc[_0xe4d9('0x2f')](function(_0x3fe6a9){if(_0x3fe6a9){logger[_0xe4d9('0x2a')](_0xe4d9('0x30'),_0x3fe6a9);}_0x34f72f(null,_0x4423a7);});}});}});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x31')]=function(_0x392cdd,_0x5980a2){this['rpc']['getSmsAccountById'](_0x392cdd)[_0xe4d9('0x12')](function(_0x19fdb0){_0x5980a2(null,_0x19fdb0?_0x19fdb0:![]);})['catch'](function(_0x48210e){_0x5980a2(_0x48210e);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x32')]=function(_0x453833,_0x5d0476){this[_0xe4d9('0xe')][_0xe4d9('0x32')](_0x453833)[_0xe4d9('0x12')](function(_0x17de1e){_0x5d0476(null,_0x17de1e);})[_0xe4d9('0x14')](function(_0x1b9d00){_0x5d0476(_0x1b9d00);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x33')]=function(_0x86bc71,_0x288c86,_0x467f58){this['rpc'][_0xe4d9('0x33')]({'uniqueid':this[_0xe4d9('0x34')][_0xe4d9('0x35')],'node':_0x86bc71[_0xe4d9('0x36')],'application':_0x86bc71[_0xe4d9('0x37')],'data':_0x288c86||null,'project_name':this['channel'][_0xe4d9('0x38')],'callerid':this[_0xe4d9('0x34')][_0xe4d9('0x39')]})[_0xe4d9('0x12')](function(_0xc107fc){if(_0x467f58){_0x467f58(null,_0xc107fc);}})[_0xe4d9('0x14')](function(_0x1e5f54){if(_0x467f58){_0x467f58(_0x1e5f54);}});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x3a')]=function(_0x5a09fa,_0x5510e7,_0x246550,_0x179117){this[_0xe4d9('0xe')]['createSquareRecording']({'uniqueid':this[_0xe4d9('0x34')][_0xe4d9('0x35')],'callerid':this[_0xe4d9('0x34')][_0xe4d9('0x39')],'calleridname':this[_0xe4d9('0x34')][_0xe4d9('0x3b')],'context':this[_0xe4d9('0x34')]['context'],'extension':this[_0xe4d9('0x34')][_0xe4d9('0x3c')],'priority':this[_0xe4d9('0x34')][_0xe4d9('0x3d')],'accountcode':this[_0xe4d9('0x34')][_0xe4d9('0x3e')],'dnid':this['channel'][_0xe4d9('0x3f')],'projectName':this[_0xe4d9('0x34')][_0xe4d9('0x38')],'saveName':_0x5510e7,'filename':_0x5a09fa[_0xe4d9('0x40')]||_0x5510e7,'savePath':_0x246550})[_0xe4d9('0x12')](function(_0x19ae72){_0x179117(null,_0x19ae72);})['catch'](function(_0xc0c2fd){_0x179117(_0xc0c2fd);});};AGIVertices[_0xe4d9('0x10')]['createSquareMessage']=function(_0x3eccd4,_0x4c913d,_0x17b46b,_0xbeb7c7,_0x4ebafb){this[_0xe4d9('0xe')]['createSquareMessage']({'uniqueid':this[_0xe4d9('0x34')][_0xe4d9('0x35')],'body':_0x3eccd4,'direction':_0x4c913d,'providerName':_0x17b46b,'providerResponse':_0xbeb7c7})[_0xe4d9('0x12')](function(_0x48b9fa){if(_0x4ebafb){_0x4ebafb(null,_0x48b9fa);}})[_0xe4d9('0x14')](function(_0x725bb4){if(_0x4ebafb){_0x4ebafb(_0x725bb4);}});};AGIVertices['prototype'][_0xe4d9('0x41')]=function(_0x1af63a,_0x37af58){var _0x42d15b=this;var _0x59b548=0x0;var _0x50f513={'firstName':_[_0xe4d9('0x42')](_0x1af63a[_0xe4d9('0x13')])||_[_0xe4d9('0x43')](_0x1af63a[_0xe4d9('0x13')])?_0xe4d9('0x44')+Math[_0xe4d9('0x45')]():_0x1af63a['name'],'lastName':_['isEmpty'](_0x1af63a[_0xe4d9('0x46')])||_[_0xe4d9('0x43')](_0x1af63a[_0xe4d9('0x46')])?null:_0x1af63a[_0xe4d9('0x46')],'phone':_0x1af63a[_0xe4d9('0x47')],'ListId':_0x1af63a[_0xe4d9('0x48')],'scheduledat':_0x1af63a['scheduledAt'],'callbackUniqueid':this[_0xe4d9('0x34')][_0xe4d9('0x35')],'tags':_0xe4d9('0x49'),'description':'Callback\x20scheduled\x20at\x20'+_0x1af63a[_0xe4d9('0x4a')][_0xe4d9('0x4b')](),'priority':_0x1af63a[_0xe4d9('0x4c')]};if(_['has'](_0x1af63a,_0xe4d9('0x4d'))){if(!_['isNil'](_0x1af63a[_0xe4d9('0x4d')])){var _0x13b008=_0x1af63a[_0xe4d9('0x4d')];if(_0x1af63a['dialTimezone']=='CALLERID(dialTimezone)'){this['rpc'][_0xe4d9('0x4e')]({'phone':_0x1af63a['phone']})[_0xe4d9('0x12')](function(_0x4c37a6){if(!_['isNil'](_0x4c37a6)){var _0x3c2196=_0x4c37a6[_0xe4d9('0x4d')];if(!_[_0xe4d9('0x43')](_0x3c2196)){var _0x1469b8=shared[_0xe4d9('0x4f')][_0x3c2196];if(!_['isNil'](_0x1469b8)){var _0x49a622=-0x1*_0x1469b8['utcOffset'];_0x50f513['scheduledat']=moment(_0x1af63a[_0xe4d9('0x50')])[_0xe4d9('0x51')](_0x49a622,_0xe4d9('0x52'));_0x42d15b[_0xe4d9('0x53')](_0x50f513,_0x1af63a,_0x37af58);}else{_0x42d15b[_0xe4d9('0x53')](_0x50f513,_0x1af63a,_0x37af58);}}else{_0x42d15b[_0xe4d9('0x53')](_0x50f513,_0x1af63a,_0x37af58);}}else{_0x42d15b[_0xe4d9('0x53')](_0x50f513,_0x1af63a,_0x37af58);}});}else{var _0x59b548=shared['timezones'][_0x13b008];if(!_[_0xe4d9('0x43')](_0x59b548)){var _0xf4d401=-0x1*_0x59b548[_0xe4d9('0x54')];_0x50f513[_0xe4d9('0x50')]=moment(_0x1af63a[_0xe4d9('0x50')])[_0xe4d9('0x51')](_0xf4d401,_0xe4d9('0x52'));_0x42d15b[_0xe4d9('0x53')](_0x50f513,_0x1af63a,_0x37af58);}else{_0x42d15b[_0xe4d9('0x53')](_0x50f513,_0x1af63a,_0x37af58);}}}else{_0x42d15b[_0xe4d9('0x53')](_0x50f513,_0x1af63a,_0x37af58);}}else{_0x42d15b[_0xe4d9('0x53')](_0x50f513,_0x1af63a,_0x37af58);}};AGIVertices[_0xe4d9('0x10')]['getPause']=function(_0x2f3396,_0x46d60b){this[_0xe4d9('0xe')][_0xe4d9('0x55')](_0x2f3396)['then'](function(_0x50a00b){_0x46d60b(null,_0x50a00b?_0x50a00b['name']:![]);})[_0xe4d9('0x14')](function(_0x1166c9){_0x46d60b(_0x1166c9);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x56')]=function(_0x547792,_0x53975f,_0x383cd4){var _0xf41d89={'role':_0xe4d9('0x57')};_0xf41d89[_0x547792]=this[_0xe4d9('0x34')][_0xe4d9('0x39')];this[_0xe4d9('0xe')]['agentPause'](_0xf41d89,_0x53975f,this[_0xe4d9('0x34')]['uniqueid'])[_0xe4d9('0x12')](function(_0x3be5a4){_0x383cd4(null,_['isNil'](_0x3be5a4)?![]:!![]);})[_0xe4d9('0x14')](function(_0xc31086){logger['error'](_0xc31086);_0x383cd4(null,![]);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x58')]=function(_0x46d795,_0x175b14){var _0x3a7ff2={'role':_0xe4d9('0x57')};_0x3a7ff2[_0x46d795]=this['channel']['callerid'];this[_0xe4d9('0xe')]['agentUnpause'](_0x3a7ff2)[_0xe4d9('0x12')](function(_0x59f0c7){_0x175b14(null,_['isNil'](_0x59f0c7)?![]:!![]);})[_0xe4d9('0x14')](function(_0x17e6dd){logger[_0xe4d9('0x2a')](_0x17e6dd);_0x175b14(null,![]);});};AGIVertices['prototype'][_0xe4d9('0x59')]=function(_0x564269,_0xfa28c5){var _0x1b658b={'role':_0xe4d9('0x57')};_0x1b658b[_0x564269]=this[_0xe4d9('0x34')]['callerid'];this[_0xe4d9('0xe')][_0xe4d9('0x59')](_0x1b658b)[_0xe4d9('0x12')](function(_0x2d6a65){_0xfa28c5(null,_[_0xe4d9('0x43')](_0x2d6a65)?![]:!![]);})[_0xe4d9('0x14')](function(_0x1fa518){logger[_0xe4d9('0x2a')](_0x1fa518);_0xfa28c5(null,![]);});};AGIVertices[_0xe4d9('0x10')]['agentLogin']=function(_0x948f7e,_0x5c9eb0){var _0x8a066b={'role':_0xe4d9('0x57')};_0x8a066b[_0x948f7e]=this[_0xe4d9('0x34')][_0xe4d9('0x39')];var _0x48cc76=_0x948f7e!='internal'?util[_0xe4d9('0x27')](_0xe4d9('0x5a'),_0xe4d9('0x5b'),this[_0xe4d9('0x34')][_0xe4d9('0x39')]):undefined;this[_0xe4d9('0xe')][_0xe4d9('0x5c')](_0x8a066b,_0x48cc76)[_0xe4d9('0x12')](function(_0x2f0bc1){_0x5c9eb0(null,_['isNil'](_0x2f0bc1)?![]:!![]);})[_0xe4d9('0x14')](function(_0x11215a){logger['error'](_0x11215a);_0x5c9eb0(null,![]);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x5d')]=function(_0x1b5c79,_0x41630d){sh[_0xe4d9('0x5e')](_['trim'](_0x1b5c79),function(_0x276bf8,_0x46a498){var _0x498cb1=_0x46a498[_0xe4d9('0x5f')](/(\r\n|\n|\r)/gm,'');_0x41630d(null,_0x498cb1);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x60')]=function(_0xf3e107,_0xb647f1){scripts[_0xe4d9('0x60')](_0xf3e107['apiKey'],_0xf3e107[_0xe4d9('0x61')]||'text',_0xf3e107[_0xe4d9('0x62')],_0xf3e107[_0xe4d9('0x63')]||_0xe4d9('0x64'),_0xf3e107[_0xe4d9('0x65')]||'MALE',_0xf3e107[_0xe4d9('0x66')]||_0xe4d9('0x67'))['then'](function(_0x23bcfe){_0xb647f1(null,_0x23bcfe);})[_0xe4d9('0x14')](function(_0x4acc49){_0xb647f1(_0x4acc49);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x68')]=function(_0xd2a197,_0x332aa0){scripts[_0xe4d9('0x68')](_0xd2a197[_0xe4d9('0x62')],_0xd2a197[_0xe4d9('0x69')]||'en',0x1)[_0xe4d9('0x12')](function(_0x3e1fd4){_0x332aa0(null,_0x3e1fd4);})['catch'](function(_0xdfe0af){_0x332aa0(_0xdfe0af);});};AGIVertices['prototype'][_0xe4d9('0x6a')]=function(_0x5e8213,_0x183cef){var _0x1e8a81={'uri':_0x5e8213[_0xe4d9('0x6b')],'method':_0x5e8213[_0xe4d9('0x6c')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5e8213[_0xe4d9('0x6d')])===_0xe4d9('0x6e')&&parseInt(_0x5e8213[_0xe4d9('0x6d')])>=0x1?parseInt(_0x5e8213[_0xe4d9('0x6d')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xe4d9('0x6f'),_0xe4d9('0x70')],_0x1e8a81[_0xe4d9('0x6c')][_0xe4d9('0x71')]())){try{_0x1e8a81[_0xe4d9('0x72')]=_0x5e8213[_0xe4d9('0x73')]?JSON[_0xe4d9('0x74')](_0x5e8213[_0xe4d9('0x73')]):{};}catch(_0x208887){logger[_0xe4d9('0x2a')](_0xe4d9('0x75'),_0x208887);}}try{_0x1e8a81[_0xe4d9('0x76')]=_0x5e8213[_0xe4d9('0xa')]?JSON['parse'](_0x5e8213[_0xe4d9('0xa')]):{};}catch(_0x236477){logger['error'](_0xe4d9('0x77'),_0x236477);}if(_0x5e8213[_0xe4d9('0x78')]){try{var _0x56e180=require(_0x5e8213[_0xe4d9('0x78')])[_0xe4d9('0x79')](this,_0x1e8a81);_0x1e8a81[_0xe4d9('0x7a')]=Mustache[_0xe4d9('0x7b')](_0x5e8213[_0xe4d9('0x6b')],_0x56e180,{},['$$','$$']);if(_0x1e8a81[_0xe4d9('0x76')]){_0x1e8a81[_0xe4d9('0x76')]=JSON[_0xe4d9('0x74')](Mustache[_0xe4d9('0x7b')](JSON[_0xe4d9('0x7c')](_0x1e8a81[_0xe4d9('0x76')]),_0x56e180,{},['$$','$$']));}if(_0x1e8a81[_0xe4d9('0x72')]){_0x1e8a81[_0xe4d9('0x72')]=JSON['parse'](Mustache['render'](JSON['stringify'](_0x1e8a81[_0xe4d9('0x72')]),_0x56e180,{},['$$','$$']));}}catch(_0x259d75){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x259d75);}}rp(_0x1e8a81)[_0xe4d9('0x12')](function(_0x5346c4){var _0x456401={'statusCode':_0x5346c4['statusCode']||0xc8,'statusMessage':_0x5346c4[_0xe4d9('0x7d')]||'OK','headers':_0x5346c4[_0xe4d9('0x76')]||{},'body':_0x5346c4['body']||{}};_0x183cef(null,_0x456401);})[_0xe4d9('0x14')](function(_0x29ae02){var _0x46bd17={'statusCode':_0x29ae02['statusCode']||0x1f4,'statusMessage':_0x29ae02[_0xe4d9('0x7e')]||_0xe4d9('0x7f'),'headers':_0x29ae02[_0xe4d9('0x80')][_0xe4d9('0x76')]||{},'body':_0x29ae02[_0xe4d9('0x80')][_0xe4d9('0x72')]||{}};_0x183cef(null,_0x46bd17);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x81')]=function(_0x64ea28,_0x319c67){scripts[_0xe4d9('0x81')](this[_0xe4d9('0x34')][_0xe4d9('0x35')],_0x64ea28[_0xe4d9('0x82')],_0x64ea28[_0xe4d9('0x62')],_0x64ea28[_0xe4d9('0x83')]||'en')[_0xe4d9('0x12')](function(_0x35af23){_0x319c67(null,_0x35af23);})[_0xe4d9('0x14')](function(_0x2774fc){_0x319c67(_0x2774fc);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x84')]=function(_0x2a1a74,_0x2c2736){scripts['googleDialogflowV2'](this[_0xe4d9('0x34')][_0xe4d9('0x35')],_0x2a1a74[_0xe4d9('0x85')],_0x2a1a74[_0xe4d9('0x86')],_0x2a1a74[_0xe4d9('0x87')],_0x2a1a74['text'],_0x2a1a74[_0xe4d9('0x88')]||'en')['then'](function(_0x14e4f5){_0x2c2736(null,_0x14e4f5);})[_0xe4d9('0x14')](function(_0x3645f0){_0x2c2736(_0x3645f0);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x89')]=function(_0x5cf029,_0x140b92){scripts[_0xe4d9('0x89')](this[_0xe4d9('0x34')],_0x5cf029)[_0xe4d9('0x12')](function(_0x5a72ba){_0x140b92(null,_0x5a72ba);})['catch'](function(_0x5b59c2){_0x140b92(_0x5b59c2);});};AGIVertices[_0xe4d9('0x10')]['ispeechTTS']=function(_0xb5cc78,_0x35a316){scripts[_0xe4d9('0x8a')](_0xb5cc78[_0xe4d9('0x82')],_0xb5cc78[_0xe4d9('0x62')],_0xb5cc78[_0xe4d9('0x8b')]||_0xe4d9('0x64'),_0xb5cc78[_0xe4d9('0x8c')])[_0xe4d9('0x12')](function(_0x7ff4b7){_0x35a316(null,_0x7ff4b7);})[_0xe4d9('0x14')](function(_0x52a87d){_0x35a316(_0x52a87d);});};AGIVertices[_0xe4d9('0x10')]['ispeechASR']=function(_0x54b611,_0x5227b8,_0x217dac){scripts[_0xe4d9('0x8d')](_0x5227b8,_0x54b611[_0xe4d9('0x82')],_0x54b611[_0xe4d9('0x8e')]||_0xe4d9('0x64'),this[_0xe4d9('0x8f')](_0x54b611[_0xe4d9('0x90')])?_0x54b611['model']:undefined)[_0xe4d9('0x12')](function(_0x4436cf){_0x217dac(null,_0x4436cf);})[_0xe4d9('0x14')](function(_0x2f450e){_0x217dac(_0x2f450e);});};AGIVertices[_0xe4d9('0x10')]['awsPolly']=function(_0x3edaf5,_0x8c4f35){scripts['awsPolly'](_0x3edaf5[_0xe4d9('0x91')],_0x3edaf5[_0xe4d9('0x92')],_0x3edaf5[_0xe4d9('0x93')],_0x3edaf5[_0xe4d9('0x94')]||'Amy',_0x3edaf5[_0xe4d9('0x62')],_0x3edaf5['aws_text_type']||_0xe4d9('0x62'))[_0xe4d9('0x12')](function(_0x26f81e){_0x8c4f35(null,_0x26f81e);})[_0xe4d9('0x14')](function(_0x1f2123){_0x8c4f35(_0x1f2123);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x95')]=function(_0x5398ee,_0x5a3944){scripts[_0xe4d9('0x95')](this[_0xe4d9('0x34')][_0xe4d9('0x35')],_0x5398ee[_0xe4d9('0x91')],_0x5398ee['aws_secret_access_key'],_0x5398ee['aws_lex_region'],_0x5398ee['text'],_0x5398ee[_0xe4d9('0x96')])[_0xe4d9('0x12')](function(_0x2bba50){_0x5a3944(null,_0x2bba50);})[_0xe4d9('0x14')](function(_0x3b5bbc){_0x5a3944(_0x3b5bbc);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x97')]=function(_0x3d0dca,_0x57a98f,_0x1bb725){scripts[_0xe4d9('0x97')](_0x57a98f,_0x3d0dca['key'],_0x3d0dca['google_asr_language']||_0xe4d9('0x64'))[_0xe4d9('0x12')](function(_0x9642e6){_0x1bb725(null,_0x9642e6);})[_0xe4d9('0x14')](function(_0x5bf730){_0x1bb725(_0x5bf730);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x98')]=function(_0x544117,_0x2cf508,_0x504b29){scripts[_0xe4d9('0x98')](_0x2cf508,_0x544117['appid'],_0x544117[_0xe4d9('0x99')],_0x544117['uri'])[_0xe4d9('0x12')](function(_0x1b2036){_0x504b29(null,_0x1b2036);})[_0xe4d9('0x14')](function(_0x393384){_0x504b29(_0x393384);});};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x9a')]=function(_0x437b7b){var _0x19671a=_['includes'](verticesWithRetry,_0x437b7b[_0xe4d9('0x37')])?_0x437b7b:_['clone'](_0x437b7b);for(var _0x463c6b in _0x19671a){if(_0x19671a[_0xe4d9('0x9b')](_0x463c6b)){if(_0x19671a[_0x463c6b]&&_[_0xe4d9('0x9c')](_0x19671a[_0x463c6b])){if(_[_0xe4d9('0x9d')](recursiveMapAttributes,_0x463c6b)){_0x19671a[_0x463c6b]=this[_0xe4d9('0x9e')](_0x19671a[_0x463c6b]);}else{_0x19671a[_0x463c6b]=this[_0xe4d9('0x9f')](_0x19671a[_0x463c6b]);}}}}return _0x19671a;};AGIVertices['prototype'][_0xe4d9('0xa0')]=function(_0x2db5b1){for(var _0x11d7b9 in _0x2db5b1){if(_0x2db5b1[_0xe4d9('0x9b')](_0x11d7b9)){if(_[_0xe4d9('0xa1')](_0x2db5b1[_0x11d7b9])){this[_0xe4d9('0xa0')](_0x2db5b1[_0x11d7b9]);}else if(_[_0xe4d9('0xa2')](_0x2db5b1[_0x11d7b9])){for(var _0xdefef5=0x0;_0xdefef5<_0x2db5b1[_0x11d7b9][_0xe4d9('0xa3')];_0xdefef5++){this['recursiveNodeIndex'](_0x2db5b1[_0x11d7b9][_0xdefef5]);}}else if(_['isString'](_0x2db5b1[_0x11d7b9])){_0x2db5b1[_0x11d7b9]=this[_0xe4d9('0x9f')](_0x2db5b1[_0x11d7b9]);}}}};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0xa4')]=function(_0x280160,_0x5a5446){for(var _0x21c2e9 in _0x280160){if(_0x280160['hasOwnProperty'](_0x21c2e9)){if(_[_0xe4d9('0xa1')](_0x280160[_0x21c2e9])){if(!_[_0xe4d9('0x42')](_0x280160[_0x21c2e9])){this['saveRestApiResult'](_0x280160[_0x21c2e9],util['format'](_0xe4d9('0xa5'),_0x5a5446,_0x21c2e9));}}else if(_[_0xe4d9('0xa2')](_0x280160[_0x21c2e9])){for(var _0x34d518=0x0;_0x34d518<_0x280160[_0x21c2e9][_0xe4d9('0xa3')];_0x34d518++){this[_0xe4d9('0xa4')](_0x280160[_0x21c2e9][_0x34d518],util[_0xe4d9('0x27')](_0xe4d9('0xa5'),_0x5a5446,_0x21c2e9+'['+_0x34d518+']'));}}else{if(!_[_0xe4d9('0x43')](_0x280160[_0x21c2e9])){this['channel'][_0xe4d9('0xa6')](util[_0xe4d9('0x27')](_0xe4d9('0xa5'),_0x5a5446,_0x21c2e9),_0x280160[_0x21c2e9]);}}}}};AGIVertices['prototype'][_0xe4d9('0x9e')]=function(_0x343371){try{var _0x5b8866=JSON[_0xe4d9('0x74')](_0x343371);this[_0xe4d9('0xa0')](_0x5b8866);return JSON[_0xe4d9('0x7c')](_0x5b8866);}catch(_0x43fe02){return this[_0xe4d9('0x9f')](_0x343371);}};AGIVertices['prototype'][_0xe4d9('0x9f')]=function(_0x53aa65){var _0x5b032b=_0x53aa65[_0xe4d9('0xa7')]('{');for(var _0x15bba8=0x1;_0x15bba8<_0x5b032b['length'];_0x15bba8+=0x1){var _0x4d902d=_0x5b032b[_0x15bba8][_0xe4d9('0xa7')]('}');if(_0x4d902d[_0xe4d9('0xa3')]>0x1){_0x53aa65=_0x53aa65[_0xe4d9('0xa8')]('{'+_0x4d902d[0x0]+'}',this[_0xe4d9('0x34')][_0xe4d9('0x11')](_0x4d902d[0x0])[_0xe4d9('0xa9')]||_0x4d902d[0x0]);}}if(_0x5b032b[_0xe4d9('0xa3')]===0x1){return _0x53aa65[_0xe4d9('0x4b')]();}return this[_0xe4d9('0x9f')](_0x53aa65);};AGIVertices['prototype'][_0xe4d9('0xaa')]=function(_0x4ca41d,_0x5439b6){var _0x3ab17e=this[_0xe4d9('0x34')]['getVariable'](_0x4ca41d);if(_0x3ab17e['result']===-0x1){return _0x3ab17e;}logger['info'](util[_0xe4d9('0x27')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5439b6,_0x3ab17e[_0xe4d9('0xa9')]));return this['channel'][_0xe4d9('0xa6')](_0x5439b6,_0x3ab17e[_0xe4d9('0xa9')]);};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x8f')]=function(_0x486daa){return _0x486daa&&_0x486daa!=='0'&&_0x486daa!=='-1'&&_0x486daa!=='';};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0xab')]=function(_0x1be6e7){this[_0xe4d9('0x33')][_0xe4d9('0x79')](this,_0x1be6e7,'-');_0x1be6e7['retry']=_0x1be6e7['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0xac')]=function(_0xefcf63){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0xad'),_0xefcf63['label']));if(!this[_0xe4d9('0x8f')](_0xefcf63['text'])){return this['channel'][_0xe4d9('0xae')](_0xe4d9('0xaf'));}var _0x13d929='\x22'+_0xefcf63[_0xe4d9('0x62')]+'\x22';if(this[_0xe4d9('0x8f')](_0xefcf63['options'])){_0x13d929+=','+_0xefcf63[_0xe4d9('0x80')];}var _0x5e6efc=this[_0xe4d9('0x34')][_0xe4d9('0x5e')](_0xe4d9('0xb0'),_0x13d929);if(_0x5e6efc['result']===-0x1){return _0x5e6efc;}return this[_0xe4d9('0x34')]['noop'](util['format'](_0xe4d9('0xb1'),_0x13d929));};AGIVertices[_0xe4d9('0x10')]['mrcprecog']=function(_0x54aa80){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0xb2'),_0x54aa80[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x54aa80[_0xe4d9('0xb3')])){return this[_0xe4d9('0x34')]['noop']('no\x20grammar\x20configured');}var _0x704678=_0x54aa80[_0xe4d9('0xb3')];if(this[_0xe4d9('0x8f')](_0x54aa80[_0xe4d9('0x80')])){_0x704678+=','+_0x54aa80['options'];}var _0x15ad99=this[_0xe4d9('0x34')][_0xe4d9('0x5e')](_0xe4d9('0xb4'),_0x704678);if(_0x15ad99[_0xe4d9('0xb5')]===-0x1){return _0x15ad99;}var _0x686a23=this[_0xe4d9('0xaa')](_0xe4d9('0xb6'),_0xe4d9('0xb7'));if(_0x686a23[_0xe4d9('0xb5')]===-0x1){return _0x686a23;}var _0x4f44f0=this[_0xe4d9('0xaa')](_0xe4d9('0xb8'),_0xe4d9('0xb9'));if(_0x4f44f0[_0xe4d9('0xb5')]===-0x1){return _0x4f44f0;}var _0x3f72f5=this[_0xe4d9('0xaa')](_0xe4d9('0xba'),_0xe4d9('0xbb'));if(_0x3f72f5[_0xe4d9('0xb5')]===-0x1){return _0x3f72f5;}return this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0xbc'),_0x704678));};AGIVertices['prototype'][_0xe4d9('0x5')]=function(_0x538db5){logger[_0xe4d9('0x2c')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x538db5['label']));return this[_0xe4d9('0x34')]['agi']([_0x538db5['command'],_0x538db5[_0xe4d9('0xbd')]]);};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0xbe')]=function(_0x4e0e73){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0xbf'),_0x4e0e73['label']));if(this[_0xe4d9('0x8f')](_0x4e0e73[_0xe4d9('0x6d')])){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x4e0e73[_0xe4d9('0x6d')]));var _0xa4f123=this['channel'][_0xe4d9('0xc0')](_0x4e0e73[_0xe4d9('0x6d')]);if(_0xa4f123[_0xe4d9('0xb5')]===-0x1){return _0xa4f123;}}return this[_0xe4d9('0x34')][_0xe4d9('0xbe')]();};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x49')]=function(_0xaed44f){logger['info'](util[_0xe4d9('0x27')](_0xe4d9('0xc1'),_0xaed44f[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0xaed44f[_0xe4d9('0x48')])){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0xaed44f,_0xe4d9('0xc2'));}_0xaed44f[_0xe4d9('0x4a')]=moment();if(this[_0xe4d9('0x8f')](_0xaed44f['delay'])){_0xaed44f[_0xe4d9('0x4a')]=moment()[_0xe4d9('0x51')](_0xaed44f['delay'],'minutes');}if(!this[_0xe4d9('0x8f')](_0xaed44f[_0xe4d9('0x4c')])){_0xaed44f[_0xe4d9('0x4c')]=0x2;}this['createCmContact'][_0xe4d9('0x79')](this,_0xaed44f);return this[_0xe4d9('0x34')]['noop'](util[_0xe4d9('0x27')](_0xe4d9('0xc3'),_0xaed44f[_0xe4d9('0x47')],_0xaed44f[_0xe4d9('0x48')],_0xaed44f['scheduledAt']));};AGIVertices[_0xe4d9('0x10')]['custom_app']=function(_0x561d51){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x561d51[_0xe4d9('0x36')]));var _0x5a1ead=this[_0xe4d9('0x34')]['exec'](_0x561d51[_0xe4d9('0xc4')],_0x561d51[_0xe4d9('0x80')]);if(_0x5a1ead[_0xe4d9('0xb5')]===-0x1){return _0x5a1ead;}return this['channel'][_0xe4d9('0xae')](util['format'](_0xe4d9('0xc5'),_0x561d51[_0xe4d9('0xc4')],_0x561d51['options']));};AGIVertices[_0xe4d9('0x10')]['lumenvoxtts']=function(_0x3f5aec){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0xc6'),_0x3f5aec[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x3f5aec[_0xe4d9('0x62')])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0xaf'));}var _0x339fe8='\x22'+_0x3f5aec[_0xe4d9('0x62')]+'\x22';if(this[_0xe4d9('0x8f')](_0x3f5aec[_0xe4d9('0x80')])){_0x339fe8+=','+_0x3f5aec['options'];}var _0x73cc58=this[_0xe4d9('0x34')][_0xe4d9('0x5e')](_0xe4d9('0xb0'),_0x339fe8);if(_0x73cc58[_0xe4d9('0xb5')]===-0x1){return _0x73cc58;}return this[_0xe4d9('0x34')][_0xe4d9('0xae')](util['format'](_0xe4d9('0xb1'),_0x339fe8));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0xc7')]=function(_0x4b9f8e){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0xc8'),_0x4b9f8e[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x4b9f8e[_0xe4d9('0x62')])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0xaf'));}var _0x442980='\x22'+_0x4b9f8e[_0xe4d9('0x62')]+'\x22';if(this[_0xe4d9('0x8f')](_0x4b9f8e[_0xe4d9('0x80')])){_0x442980+=','+_0x4b9f8e[_0xe4d9('0x80')];}var _0x3fee53=this[_0xe4d9('0x34')][_0xe4d9('0x5e')]('MRCPSynth',_0x442980);if(_0x3fee53[_0xe4d9('0xb5')]===-0x1){return _0x3fee53;}return this['channel'][_0xe4d9('0xae')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x442980));};AGIVertices[_0xe4d9('0x10')]['lumenvoxasr']=function(_0x25d43f){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0xc9'),_0x25d43f[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x25d43f[_0xe4d9('0xb3')])){return this['channel'][_0xe4d9('0xae')](_0xe4d9('0xca'));}var _0x5d8c9c=_0x25d43f['grammar'];if(this['isConfigured'](_0x25d43f[_0xe4d9('0x80')])){_0x5d8c9c+=','+_0x25d43f[_0xe4d9('0x80')];}var _0x57e3b8=this[_0xe4d9('0x34')][_0xe4d9('0x5e')](_0xe4d9('0xb4'),_0x5d8c9c);if(_0x57e3b8[_0xe4d9('0xb5')]===-0x1){return _0x57e3b8;}var _0x398aad=this[_0xe4d9('0xaa')](_0xe4d9('0xb6'),_0xe4d9('0xcb'));if(_0x398aad['result']===-0x1){return _0x398aad;}var _0x42abee=this[_0xe4d9('0xaa')](_0xe4d9('0xb8'),_0xe4d9('0xcc'));if(_0x42abee[_0xe4d9('0xb5')]===-0x1){return _0x42abee;}var _0x520aa0=this[_0xe4d9('0xaa')](_0xe4d9('0xba'),'LUMENVOX_ASR_INSTANCE');if(_0x520aa0[_0xe4d9('0xb5')]===-0x1){return _0x520aa0;}return this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0xbc'),_0x5d8c9c));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0xcd')]=function(_0x2a919b){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0xce'),_0x2a919b[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x2a919b[_0xe4d9('0xb3')])){return this['channel'][_0xe4d9('0xae')](_0xe4d9('0xca'));}var _0x251486=_0x2a919b[_0xe4d9('0xb3')];if(this[_0xe4d9('0x8f')](_0x2a919b[_0xe4d9('0x80')])){_0x251486+=','+_0x2a919b[_0xe4d9('0x80')];}var _0x290d7d=this[_0xe4d9('0x34')][_0xe4d9('0x5e')](_0xe4d9('0xb4'),_0x251486);if(_0x290d7d[_0xe4d9('0xb5')]===-0x1){return _0x290d7d;}var _0x40d149=this[_0xe4d9('0xaa')]('RECOG_CONFIDENCE()',_0xe4d9('0xcf'));if(_0x40d149[_0xe4d9('0xb5')]===-0x1){return _0x40d149;}var _0x13cd79=this[_0xe4d9('0xaa')](_0xe4d9('0xb8'),_0xe4d9('0xd0'));if(_0x13cd79[_0xe4d9('0xb5')]===-0x1){return _0x13cd79;}var _0x3da039=this['getAndSetVariable']('RECOG_INSTANCE()',_0xe4d9('0xd1'));if(_0x3da039['result']===-0x1){return _0x3da039;}return this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0xbc'),_0x251486));};AGIVertices['prototype']['database']=function(_0x341530){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x341530[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x341530[_0xe4d9('0xd2')])){return this['channel'][_0xe4d9('0x2a')](_0x341530,'no\x20database\x20selected');}var _0x277f57=this[_0xe4d9('0x17')][_0xe4d9('0x79')](this,_0x341530[_0xe4d9('0xd2')]);if(!_0x277f57){return this[_0xe4d9('0x34')]['error'](_0x341530,_0xe4d9('0xd3'));}if(!this['isConfigured'](_0x341530[_0xe4d9('0x2e')])){return this[_0xe4d9('0x34')]['error'](_0x341530,'no\x20query\x20configured');}var _0x3fee21=_0x341530['query'][_0xe4d9('0x5f')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0xd4'),_0x3fee21));var _0x32d306=this['getQueryOdbc'][_0xe4d9('0x79')](this,_0x277f57,_0x3fee21);this['createSquareDetailsReport'][_0xe4d9('0x79')](this,_0x341530,_0x3fee21);if(!this[_0xe4d9('0x8f')](_0x341530[_0xe4d9('0xd5')])){return this['channel'][_0xe4d9('0xae')](_0xe4d9('0xd6'));}var _0x1ff355=this['getVariable'][_0xe4d9('0x79')](this,_0x341530[_0xe4d9('0xd5')]);if(!_0x1ff355){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x341530,_0xe4d9('0xd7'));}var _0x288786=this;_0x32d306[_0xe4d9('0xd8')](function(_0xeac6f8,_0x48d57d){Object[_0xe4d9('0xd9')](_0xeac6f8)[_0xe4d9('0xd8')](function(_0x217c98){_0x288786[_0xe4d9('0x34')][_0xe4d9('0xa6')](util[_0xe4d9('0x27')](_0xe4d9('0xda'),_0x1ff355,_0x48d57d,_0x217c98),_0xeac6f8[_0x217c98]);});});this[_0xe4d9('0x34')][_0xe4d9('0xa6')](util['format'](_0xe4d9('0xdb'),_0x1ff355),_0x32d306['length']);return this['channel']['noop'](util[_0xe4d9('0x27')](_0xe4d9('0xdc'),_0x1ff355));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0xdd')]=function(_0x2515ab){logger[_0xe4d9('0xde')](util[_0xe4d9('0x27')](_0xe4d9('0xdf'),_0x2515ab[_0xe4d9('0x36')]));if(!this['isConfigured'](_0x2515ab['sip_id'])){return this['channel'][_0xe4d9('0x2a')](_0x2515ab,'no\x20user\x20selected');}var _0x3494df=this['getUser'][_0xe4d9('0x79')](this,_0x2515ab[_0xe4d9('0xe0')]);if(!_0x3494df){return this['channel']['error'](_0x2515ab,'no\x20user\x20found');}var _0x5b8385=this[_0xe4d9('0x34')]['exec'](_0xe4d9('0xe1'),[util[_0xe4d9('0x27')]('SIP/%s',_0x3494df),_0x2515ab[_0xe4d9('0x6d')],_0x2515ab[_0xe4d9('0xe2')],_0x2515ab['url']]);if(_0x5b8385['result']===-0x1){return _0x5b8385;}return this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0xe3'),_0xe4d9('0xe1')));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0xe4')]=function(_0x36ab9e){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0xe5'),_0x36ab9e['label']));if(!this[_0xe4d9('0x8f')](_0x36ab9e['key'])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0xe6'));}if(!this[_0xe4d9('0x8f')](_0x36ab9e[_0xe4d9('0x62')])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0xaf'));}this[_0xe4d9('0x34')][_0xe4d9('0xe7')]=!![];this['createSquareDetailsReport'](_0x36ab9e);this[_0xe4d9('0xe8')](_0x36ab9e[_0xe4d9('0x62')],'in','','');this['channel']['noop'](util['format'](_0xe4d9('0xe9'),_0x36ab9e[_0xe4d9('0x62')]));var _0x53c337=this[_0xe4d9('0x81')][_0xe4d9('0x79')](this,_0x36ab9e);if(_0x53c337){for(var _0x9e75fd in _0x53c337){if(_0x53c337[_0xe4d9('0x9b')](_0x9e75fd)){this[_0xe4d9('0x34')][_0xe4d9('0xa6')](util[_0xe4d9('0x27')]('DIALOGFLOW_%s',_0x9e75fd[_0xe4d9('0x71')]()),_0x53c337[_0x9e75fd]);}}this[_0xe4d9('0xe8')](_0x53c337[_0xe4d9('0xea')],'out','dialogflow','');return this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0xeb'),_0x53c337[_0xe4d9('0xea')]));}return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x36ab9e,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0xe4d9('0x10')]['dialogflowV2']=function(_0x2c7c2a){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x2c7c2a[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x2c7c2a[_0xe4d9('0x85')])){return this['channel'][_0xe4d9('0xae')](_0xe4d9('0xec'));}if(!this['isConfigured'](_0x2c7c2a['client_email'])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0xed'));}if(!this[_0xe4d9('0x8f')](_0x2c7c2a[_0xe4d9('0x87')])){return this[_0xe4d9('0x34')]['noop'](_0xe4d9('0xee'));}if(!this[_0xe4d9('0x8f')](_0x2c7c2a[_0xe4d9('0x88')])){return this['channel']['noop']('no\x20anguage\x20configured');}if(!this[_0xe4d9('0x8f')](_0x2c7c2a['text'])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0xaf'));}this[_0xe4d9('0x34')]['bot']=!![];this['createSquareDetailsReport'](_0x2c7c2a);this[_0xe4d9('0xe8')](_0x2c7c2a[_0xe4d9('0x62')],'in','','');this[_0xe4d9('0x34')][_0xe4d9('0xae')](util['format'](_0xe4d9('0xef'),_0x2c7c2a[_0xe4d9('0x62')]));var _0x2271f7=this[_0xe4d9('0x84')][_0xe4d9('0x79')](this,_0x2c7c2a);if(_0x2271f7){for(var _0xbc8304 in _0x2271f7){if(_0x2271f7[_0xe4d9('0x9b')](_0xbc8304)){if(_0xbc8304!==_0xe4d9('0xf0')){this[_0xe4d9('0x34')][_0xe4d9('0xa6')](util[_0xe4d9('0x27')](_0xe4d9('0xf1'),_0xbc8304[_0xe4d9('0x71')]()),_0x2271f7[_0xbc8304]);}}}this[_0xe4d9('0xe8')](_0x2271f7['speech'],_0xe4d9('0xf2'),'dialogflowV2',_0x2271f7[_0xe4d9('0xf0')]);return this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0xf3'),_0x2271f7[_0xe4d9('0xea')]));}return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x2c7c2a,_0xe4d9('0xf4'));};AGIVertices['prototype'][_0xe4d9('0xf5')]=function(_0x582aba){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0xf6'),_0x582aba[_0xe4d9('0x36')]));if(!this['isConfigured'](_0x582aba[_0xe4d9('0xf7')])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0xf8'));}if(!this[_0xe4d9('0x8f')](_0x582aba[_0xe4d9('0xf9')])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0xfa'));}if(!this[_0xe4d9('0x8f')](_0x582aba[_0xe4d9('0xfb')])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')]('no\x20password\x20configured');}if(!this[_0xe4d9('0x8f')](_0x582aba['ndassistant_url'])){return this[_0xe4d9('0x34')]['noop']('no\x20text\x20configured');}this[_0xe4d9('0x34')]['bot']=!![];this[_0xe4d9('0x33')](_0x582aba);this[_0xe4d9('0xe8')](_0x582aba[_0xe4d9('0x62')],'in','','');this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0xfc'),_0x582aba[_0xe4d9('0x62')]));var _0x58e7d9=this[_0xe4d9('0x89')]['sync'](this,_0x582aba);if(_0x58e7d9){for(var _0x3ba744 in _0x58e7d9){if(_0x58e7d9[_0xe4d9('0x9b')](_0x3ba744)){this[_0xe4d9('0x34')][_0xe4d9('0xa6')](util[_0xe4d9('0x27')](_0xe4d9('0xfd'),_0x3ba744[_0xe4d9('0x71')]()),_0x58e7d9[_0x3ba744]);}}this[_0xe4d9('0xe8')](_0x58e7d9[_0xe4d9('0xea')],_0xe4d9('0xf2'),_0xe4d9('0xf5'),'');if(_0x58e7d9[_0xe4d9('0xfe')]){this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0xff'),_0x58e7d9[_0xe4d9('0xfe')]));var _0x23f862=this[_0xe4d9('0x34')]['streamFile'](_0x58e7d9[_0xe4d9('0xfe')]);try{fs[_0xe4d9('0x100')](_0x58e7d9['audiofile']+'.wav');}catch(_0x3d9447){logger[_0xe4d9('0x2a')](_0x3d9447);}return _0x23f862;}else{return this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x101'),_0x58e7d9[_0xe4d9('0xea')]));}}return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x582aba,_0xe4d9('0x102'));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x103')]=function(_0x1a2411){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x104'),_0x1a2411[_0xe4d9('0x36')]));return this[_0xe4d9('0x34')]['noop']('end');};AGIVertices['prototype'][_0xe4d9('0x105')]=function(_0x3c35b2){logger['info'](util[_0xe4d9('0x27')](_0xe4d9('0x106'),_0x3c35b2['label']));var _0x101553='';if(_0x3c35b2['trunk_id']){if(!this[_0xe4d9('0x8f')](_0x3c35b2[_0xe4d9('0x107')])){return this['channel'][_0xe4d9('0x2a')](_0x3c35b2,_0xe4d9('0x108'));}else{var _0x371ce4=parseInt(_0x3c35b2[_0xe4d9('0x107')],0xa);if(isNaN(_0x371ce4)){_0x101553=_0x3c35b2[_0xe4d9('0x107')];}else{_0x101553=this['getTrunk'][_0xe4d9('0x79')](this,_0x3c35b2['trunk_id']);if(!_0x101553){return this['channel'][_0xe4d9('0x2a')](_0x3c35b2,_0xe4d9('0x109'));}}}}else if(_0x3c35b2[_0xe4d9('0x10a')]){_0x101553=_0x3c35b2[_0xe4d9('0x10a')];}else{return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x3c35b2,_0xe4d9('0x108'));}var _0x4e5c77=this['channel']['exec']('DIAL',[util[_0xe4d9('0x27')]('SIP/%s/%s',_0x101553,_0x3c35b2['phone']),_0x3c35b2[_0xe4d9('0x6d')],_0x3c35b2[_0xe4d9('0xe2')],_0x3c35b2[_0xe4d9('0x6b')]]);if(_0x4e5c77['result']===-0x1){return _0x4e5c77;}return this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0xe3'),_0xe4d9('0xe1')));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x10b')]=function(_0x1d5771){logger['info'](util[_0xe4d9('0x27')](_0xe4d9('0x10c'),_0x1d5771[_0xe4d9('0x36')]));return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0x10b'));};AGIVertices['prototype'][_0xe4d9('0xc')]=function(_0x3aa889){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x10d'),_0x3aa889[_0xe4d9('0x36')]));if(_0x3aa889[_0xe4d9('0x10e')]===0x0){return this['maxRetry'](_0x3aa889);}_0x3aa889[_0xe4d9('0x10e')]-=0x1;if(!this[_0xe4d9('0x8f')](_0x3aa889[_0xe4d9('0x10f')])){return this[_0xe4d9('0x34')]['error'](_0x3aa889,_0xe4d9('0x110'));}var _0x491e98=this['getSound'][_0xe4d9('0x79')](this,_0x3aa889[_0xe4d9('0x10f')]);if(!_0x491e98){return this['channel'][_0xe4d9('0x2a')](_0x3aa889,_0xe4d9('0x111'));}if(!this['isConfigured'](_0x3aa889[_0xe4d9('0xd5')])){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x418bc2=this[_0xe4d9('0x34')][_0xe4d9('0x112')](_0x491e98,_0x3aa889[_0xe4d9('0x113')],_0x3aa889[_0xe4d9('0x114')]);var _0x5e0830=_0x418bc2[_0xe4d9('0xb5')]?_0x418bc2['result'][_0xe4d9('0x4b')]():'';logger[_0xe4d9('0x2c')](_0xe4d9('0x115'),JSON['stringify'](_0x418bc2));if(_0x418bc2[_0xe4d9('0xb5')]===-0x1){this[_0xe4d9('0x33')][_0xe4d9('0x79')](this,_0x3aa889,_0x5e0830);return _0x418bc2;}else if(_0x418bc2['extra']===_0xe4d9('0x6d')){_0x418bc2[_0xe4d9('0xb5')]=_0x5e0830[_0xe4d9('0xa3')]>=parseInt(_0x3aa889[_0xe4d9('0x116')])?'x':'i';}else{_0x418bc2[_0xe4d9('0xb5')]=_0x5e0830[_0xe4d9('0xa3')]>=parseInt(_0x3aa889[_0xe4d9('0x116')])&&_0x5e0830[_0xe4d9('0xa3')]<=parseInt(_0x3aa889[_0xe4d9('0x114')])?'x':'i';}var _0x679bac=this['getVariable'][_0xe4d9('0x79')](this,_0x3aa889[_0xe4d9('0xd5')]);if(!_0x679bac){return this['channel'][_0xe4d9('0x2a')](_0x3aa889,'no\x20variable\x20found');}this[_0xe4d9('0x34')][_0xe4d9('0xa6')](_0x679bac,_0x5e0830);if(this['isConfigured'](_0x3aa889[_0xe4d9('0x117')])){var _0x37d24f=parseInt(_0x3aa889['hiddendigitsnum'],0xa);var _0x226d54=rs[_0xe4d9('0x118')]({'charset':'*','length':_0x37d24f});var _0x362d86=_0x5e0830[_0xe4d9('0xa3')];if(_0x362d86>0x0){if(_0x362d86>_0x37d24f){this['createSquareDetailsReport'][_0xe4d9('0x79')](this,_0x3aa889,_0x3aa889['hiddendigitspos']===_0xe4d9('0x119')?_0x226d54+_0x5e0830['substr'](_0x37d24f):_0x5e0830[_0xe4d9('0x11a')](0x0,_0x362d86-_0x37d24f)+_0x226d54);}else{this['createSquareDetailsReport']['sync'](this,_0x3aa889,rs['generate']({'charset':'*','length':_0x362d86}));}}else{this['createSquareDetailsReport'][_0xe4d9('0x79')](this,_0x3aa889,'');}}else{this[_0xe4d9('0x33')][_0xe4d9('0x79')](this,_0x3aa889,_0x5e0830);}return _0x418bc2;};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0xd')]=function(_0x3c2ad3){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x3c2ad3[_0xe4d9('0x36')]));return this['getdigits'](_0x3c2ad3);};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x11b')]=function(_0x28b6c9){logger['info'](util[_0xe4d9('0x27')](_0xe4d9('0x11c'),_0x28b6c9[_0xe4d9('0x36')]));this[_0xe4d9('0x33')][_0xe4d9('0x79')](this,_0x28b6c9,_0x28b6c9[_0xe4d9('0x11d')]);return this['channel'][_0xe4d9('0xae')](util['format']('GOAL\x20%s',_0x28b6c9[_0xe4d9('0x11d')]));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x11e')]=function(_0x7b240e){logger['info'](util[_0xe4d9('0x27')](_0xe4d9('0x11f'),_0x7b240e[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x7b240e['aws_access_key_id'])||!this[_0xe4d9('0x8f')](_0x7b240e[_0xe4d9('0x92')])){return this['channel'][_0xe4d9('0xae')](_0xe4d9('0x120'));}if(!this[_0xe4d9('0x8f')](_0x7b240e[_0xe4d9('0x62')])){return this[_0xe4d9('0x34')]['noop']('no\x20text\x20configured');}this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x121'),_0x7b240e[_0xe4d9('0x62')]));var _0x4d3cd8=this[_0xe4d9('0x122')][_0xe4d9('0x79')](this,_0x7b240e);if(_0x4d3cd8){this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x123'),_0x4d3cd8));var _0x3c1184=this[_0xe4d9('0x34')]['streamFile'](_0x4d3cd8);try{fs[_0xe4d9('0x100')](_0x4d3cd8+_0xe4d9('0x124'));}catch(_0x182b98){logger['error'](_0x182b98);}return _0x3c1184;}return this[_0xe4d9('0x34')]['error'](_0x7b240e,_0xe4d9('0x125'));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x126')]=function(_0x2fc262){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x2fc262['label']));if(!this[_0xe4d9('0x8f')](_0x2fc262[_0xe4d9('0x91')])||!this[_0xe4d9('0x8f')](_0x2fc262[_0xe4d9('0x92')])){return this['channel'][_0xe4d9('0xae')](_0xe4d9('0x120'));}if(!this[_0xe4d9('0x8f')](_0x2fc262['aws_bot_name'])){return this[_0xe4d9('0x34')]['noop']('no\x20bot\x20name\x20configured');}if(!this[_0xe4d9('0x8f')](_0x2fc262[_0xe4d9('0x62')])){return this[_0xe4d9('0x34')]['noop'](_0xe4d9('0xaf'));}this[_0xe4d9('0x34')][_0xe4d9('0xe7')]=!![];this[_0xe4d9('0x33')](_0x2fc262);this[_0xe4d9('0xe8')](_0x2fc262[_0xe4d9('0x62')],'in','','');this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x127'),_0x2fc262[_0xe4d9('0x62')]));var _0x45d3ae=this['awsLex'][_0xe4d9('0x79')](this,_0x2fc262);if(_0x45d3ae){for(var _0x3cc4b9 in _0x45d3ae){if(_0x45d3ae[_0xe4d9('0x9b')](_0x3cc4b9)&&_['isString'](_0x45d3ae[_0x3cc4b9])){this[_0xe4d9('0x34')]['setVariable'](util[_0xe4d9('0x27')]('AWS_LEX_%s',_0x3cc4b9['toUpperCase']()),_0x45d3ae[_0x3cc4b9]);}}if(_[_0xe4d9('0x43')](_0x45d3ae[_0xe4d9('0x7e')])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xe4d9('0xe8')](_0x45d3ae[_0xe4d9('0x7e')],'out','amazonlex','');return this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x128'),_0x45d3ae[_0xe4d9('0x7e')]));}}return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x2fc262,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x129')]=function(_0x1f8a9b){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x1f8a9b[_0xe4d9('0x36')],_0x1f8a9b['timeout']));if(!this[_0xe4d9('0x8f')](_0x1f8a9b['key'])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0xe6'));}var _0x859e28=_0xe4d9('0x12a');var _0x3459b7=util['format'](_0xe4d9('0x12b'),FILES_PATH,rs[_0xe4d9('0x118')](0x4));var _0x57004e=util[_0xe4d9('0x27')](_0xe4d9('0xa5'),_0x3459b7,_0x859e28);var _0x44aaa4=!![];if(_0x1f8a9b[_0xe4d9('0x12c')]==='NOBEEP'){_0x44aaa4=![];}var _0x12e1c6=this[_0xe4d9('0x34')]['recordFile'](_0x3459b7,_0x859e28,_0x1f8a9b[_0xe4d9('0x12d')],_0x1f8a9b['timeout'],undefined,_0x44aaa4);if(_0x12e1c6['result']!==-0x1){this['channel']['noop'](util[_0xe4d9('0x27')](_0xe4d9('0x12e'),_0x57004e));var _0x4ff023=this[_0xe4d9('0x97')]['sync'](this,_0x1f8a9b,_0x57004e);if(_0x4ff023){for(var _0x499b36 in _0x4ff023){if(_0x4ff023[_0xe4d9('0x9b')](_0x499b36)){this[_0xe4d9('0x34')]['setVariable'](util[_0xe4d9('0x27')](_0xe4d9('0x12f'),_0x499b36[_0xe4d9('0x71')]()),_0x4ff023[_0x499b36]);}}return this[_0xe4d9('0x34')][_0xe4d9('0xae')](util['format'](_0xe4d9('0x130'),JSON[_0xe4d9('0x7c')](_0x4ff023)));}}return _0x12e1c6;};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x131')]=function(_0x9a265a){logger[_0xe4d9('0x2c')](util['format'](_0xe4d9('0x132'),_0x9a265a[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x9a265a['appid'])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0x133'));}if(!this[_0xe4d9('0x8f')](_0x9a265a[_0xe4d9('0x99')])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')]('no\x20appsecret\x20configured');}var _0x2c5a77=_0xe4d9('0x12a');var _0x23cf8d=util[_0xe4d9('0x27')](_0xe4d9('0x12b'),FILES_PATH,rs[_0xe4d9('0x118')](0x4));var _0x6481ae=util[_0xe4d9('0x27')](_0xe4d9('0xa5'),_0x23cf8d,_0x2c5a77);var _0x1c4f06=!![];if(_0x9a265a[_0xe4d9('0x12c')]===_0xe4d9('0x134')){_0x1c4f06=![];}var _0x10224b=this[_0xe4d9('0x34')][_0xe4d9('0x135')](_0x23cf8d,_0x2c5a77,_0x9a265a[_0xe4d9('0x12d')],_0x9a265a[_0xe4d9('0x6d')],undefined,_0x1c4f06);if(_0x10224b[_0xe4d9('0xb5')]!==-0x1){this['channel'][_0xe4d9('0xae')](util['format'](_0xe4d9('0x136'),_0x6481ae));var _0x501e36=this[_0xe4d9('0x98')]['sync'](this,_0x9a265a,_0x6481ae);if(_0x501e36){for(var _0x336afc in _0x501e36){if(_0x501e36['hasOwnProperty'](_0x336afc)){this[_0xe4d9('0x34')][_0xe4d9('0xa6')](util[_0xe4d9('0x27')]('TILDE_ASR_%s',_0x336afc[_0xe4d9('0x71')]()),_0x501e36[_0x336afc]);}}return this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')]('TildeASR\x20Result\x20%s',JSON[_0xe4d9('0x7c')](_0x501e36)));}}return _0x10224b;};AGIVertices[_0xe4d9('0x10')]['gotoc']=function(_0x52909b){logger['info'](util[_0xe4d9('0x27')](_0xe4d9('0x137'),_0x52909b[_0xe4d9('0x36')]));return this[_0xe4d9('0x34')]['continueAt'](_0x52909b[_0xe4d9('0x138')],_0x52909b[_0xe4d9('0x3c')],_0x52909b[_0xe4d9('0x3d')]);};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x139')]=function(_0x2a649f){logger[_0xe4d9('0x2c')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x2a649f['label']));if(!this[_0xe4d9('0x8f')](_0x2a649f[_0xe4d9('0x13a')])){return this[_0xe4d9('0x34')]['error'](_0x2a649f,_0xe4d9('0x13b'));}try{var _0x28aad8=eval(_0x2a649f['condition'])?_0xe4d9('0x13c'):'false';this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x13d'),_0x2a649f['condition'],_0x28aad8));return{'code':0xc8,'result':_0x28aad8};}catch(_0x5b18c7){return{'code':0xc8,'result':_0xe4d9('0x13e')};}};AGIVertices[_0xe4d9('0x10')]['gotoiftime']=function(_0x59f48e){logger[_0xe4d9('0x2c')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x59f48e[_0xe4d9('0x36')]));if(!this['isConfigured'](_0x59f48e[_0xe4d9('0x13f')])){return this['channel'][_0xe4d9('0x2a')](_0x59f48e,_0xe4d9('0x140'));}var _0x269125=this['getIntervals']['sync'](this,_0x59f48e['interval_id']);if(!_0x269125){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x59f48e,_0xe4d9('0x141'));}for(var _0x17ed69=0x0;_0x17ed69<_0x269125['length'];_0x17ed69+=0x1){var _0x3dd6ec=this[_0xe4d9('0x34')][_0xe4d9('0x11')](util['format'](_0xe4d9('0x142'),_0x269125[_0x17ed69]));if(_0x3dd6ec[_0xe4d9('0xb5')]===-0x1){return _0x3dd6ec;}logger['info'](util[_0xe4d9('0x27')](_0xe4d9('0x143'),_0x269125[_0x17ed69],_0x3dd6ec[_0xe4d9('0xa9')]));if(_0x3dd6ec['extra']===_0xe4d9('0x13c')){logger[_0xe4d9('0x2c')](util['format']('IFTIME\x20%s\x20%s',_0x269125[_0x17ed69],_0xe4d9('0x13c')));this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')]('IFTIME\x20%s\x20%s',_0x269125[_0x17ed69],'true'));return{'code':0xc8,'result':_0xe4d9('0x13c')};}else{logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('IFTIME\x20%s\x20%s',_0x269125[_0x17ed69],'false'));this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x143'),_0x269125[_0x17ed69],_0xe4d9('0x13e')));}}return{'code':0xc8,'result':_0xe4d9('0x13e')};};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x144')]=function(_0x1f7152){logger[_0xe4d9('0x2c')](util['format'](_0xe4d9('0x145'),_0x1f7152[_0xe4d9('0x36')]));return this['channel'][_0xe4d9('0x144')]();};AGIVertices['prototype'][_0xe4d9('0x146')]=function(_0x724616){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x147'),_0x724616[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x724616[_0xe4d9('0x82')])){return this[_0xe4d9('0x34')]['noop'](_0xe4d9('0xe6'));}var _0x2602d8=_0xe4d9('0x12a');var _0x17d4c1=util[_0xe4d9('0x27')](_0xe4d9('0x12b'),FILES_PATH,rs['generate'](0x4));var _0x587c3a=util[_0xe4d9('0x27')]('%s.%s',_0x17d4c1,_0x2602d8);var _0x295183=!![];if(_0x724616['beep']===_0xe4d9('0x134')){_0x295183=![];}var _0x436481=this['channel'][_0xe4d9('0x135')](_0x17d4c1,_0x2602d8,_0x724616[_0xe4d9('0x12d')],_0x724616[_0xe4d9('0x6d')],undefined,_0x295183);if(_0x436481['result']!==-0x1){this['channel'][_0xe4d9('0xae')](util['format'](_0xe4d9('0x148'),_0x587c3a));var _0x57fec8=this[_0xe4d9('0x8d')][_0xe4d9('0x79')](this,_0x724616,_0x587c3a);if(_0x57fec8){for(var _0x9ec5a in _0x57fec8){if(_0x57fec8['hasOwnProperty'](_0x9ec5a)){this['channel'][_0xe4d9('0xa6')](util['format'](_0xe4d9('0x149'),_0x9ec5a[_0xe4d9('0x71')]()),_0x57fec8[_0x9ec5a]);}}return this[_0xe4d9('0x34')]['noop'](util[_0xe4d9('0x27')](_0xe4d9('0x14a'),JSON[_0xe4d9('0x7c')](_0x57fec8)));}}return _0x436481;};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x14b')]=function(_0x475397){logger[_0xe4d9('0x2c')](util['format'](_0xe4d9('0x14c'),_0x475397[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x475397['key'])){return this[_0xe4d9('0x34')]['noop'](_0xe4d9('0xe6'));}if(!this['isConfigured'](_0x475397[_0xe4d9('0x62')])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0xaf'));}this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x14d'),_0x475397[_0xe4d9('0x62')]));var _0x1b5e4a=this['ispeechTTS'][_0xe4d9('0x79')](this,_0x475397);if(_0x1b5e4a){this[_0xe4d9('0x34')]['noop'](util[_0xe4d9('0x27')](_0xe4d9('0x148'),_0x1b5e4a));var _0x31ff6d=this[_0xe4d9('0x34')][_0xe4d9('0x14e')](_0x1b5e4a,_0x475397['intKey']);try{fs[_0xe4d9('0x100')](_0x1b5e4a+_0xe4d9('0x124'));}catch(_0x141a18){logger['error'](_0x141a18);}return _0x31ff6d;}return this['channel'][_0xe4d9('0x2a')](_0x475397,_0xe4d9('0x14f'));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x150')]=function(_0x532e1c){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x151'),_0x532e1c[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x532e1c[_0xe4d9('0x152')])){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x532e1c,_0xe4d9('0x153'));}logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xe4d9('0x34')]['callerid'],_0x532e1c['findBy']));var _0x3aa482=this[_0xe4d9('0x5c')]['sync'](this,_0x532e1c[_0xe4d9('0x152')]);if(_0x3aa482){logger['info'](util[_0xe4d9('0x27')](_0xe4d9('0x154'),this[_0xe4d9('0x34')][_0xe4d9('0x39')],_0x532e1c[_0xe4d9('0x152')]));this[_0xe4d9('0x34')]['noop'](util[_0xe4d9('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe4d9('0x34')][_0xe4d9('0x39')],_0x532e1c[_0xe4d9('0x152')]));return{'code':0xc8,'result':_0xe4d9('0x155')};}else{logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe4d9('0x34')]['callerid'],_0x532e1c['findBy']));this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x156'),this[_0xe4d9('0x34')][_0xe4d9('0x39')],_0x532e1c[_0xe4d9('0x152')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x157')]=function(_0x4544b5){logger[_0xe4d9('0x2c')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x4544b5[_0xe4d9('0x36')]));if(!this['isConfigured'](_0x4544b5[_0xe4d9('0x152')])){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x4544b5,'no\x20find\x20by\x20configured');}logger[_0xe4d9('0x2c')](util['format'](_0xe4d9('0x158'),this['channel'][_0xe4d9('0x39')],_0x4544b5[_0xe4d9('0x152')]));var _0x543b8c=this[_0xe4d9('0x59')][_0xe4d9('0x79')](this,_0x4544b5['findBy']);if(_0x543b8c){logger['info'](util['format'](_0xe4d9('0x154'),this['channel'][_0xe4d9('0x39')],_0x4544b5[_0xe4d9('0x152')]));this[_0xe4d9('0x34')][_0xe4d9('0xae')](util['format'](_0xe4d9('0x154'),this['channel'][_0xe4d9('0x39')],_0x4544b5[_0xe4d9('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0xe4d9('0x2c')](util['format'](_0xe4d9('0x156'),this[_0xe4d9('0x34')][_0xe4d9('0x39')],_0x4544b5[_0xe4d9('0x152')]));this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x156'),this[_0xe4d9('0x34')][_0xe4d9('0x39')],_0x4544b5[_0xe4d9('0x152')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe4d9('0x10')]['math']=function(_0x37a9c5){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x37a9c5[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x37a9c5[_0xe4d9('0x159')])){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x37a9c5,_0xe4d9('0x15a'));}this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x15b'),_0x37a9c5[_0xe4d9('0x159')]));var _0x251632=eval(_0x37a9c5[_0xe4d9('0x159')]);if(!this['isConfigured'](_0x37a9c5[_0xe4d9('0xd5')])){return this['channel'][_0xe4d9('0xae')](_0xe4d9('0xd6'));}var _0x241fb4=this[_0xe4d9('0x11')][_0xe4d9('0x79')](this,_0x37a9c5[_0xe4d9('0xd5')]);if(!_0x241fb4){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x37a9c5,_0xe4d9('0xd7'));}if(_[_0xe4d9('0xa2')](_0x251632)){var _0x44b52b=this;_0x251632[_0xe4d9('0xd8')](function(_0x148fd4,_0x3dacea){_0x44b52b[_0xe4d9('0x34')]['setVariable'](util['format']('%s[%s]',_0x241fb4,_0x3dacea),_0x148fd4);});return this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')]('variable\x20%s[key]\x20set',_0x241fb4));}else{return this[_0xe4d9('0x34')][_0xe4d9('0xa6')](_0x241fb4,_0x251632);}};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0xb')]=function(_0x261e60){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x15c'),_0x261e60[_0xe4d9('0x36')]));if(_0x261e60[_0xe4d9('0x10e')]===0x0){return this['maxRetry'](_0x261e60);}_0x261e60[_0xe4d9('0x10e')]-=0x1;if(!this[_0xe4d9('0x8f')](_0x261e60[_0xe4d9('0x10f')])){return this[_0xe4d9('0x34')]['error'](_0x261e60,'no\x20file\x20audio\x20selected');}var _0x5dd5c0=this[_0xe4d9('0x15d')][_0xe4d9('0x79')](this,_0x261e60['file_id']);if(!_0x5dd5c0){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x261e60,'no\x20file\x20audio\x20found');}var _0x1e01d8=this[_0xe4d9('0x34')][_0xe4d9('0x112')](_0x5dd5c0,_0x261e60['response'],_0x261e60[_0xe4d9('0x15e')]);var _0x2bca23=_0x1e01d8[_0xe4d9('0xb5')];if(_0x1e01d8[_0xe4d9('0xb5')]===-0x1){this[_0xe4d9('0x33')][_0xe4d9('0x79')](this,_0x261e60,'-1');return _0x1e01d8;}else if(_0x1e01d8[_0xe4d9('0xa9')]===_0xe4d9('0x6d')){_0x1e01d8[_0xe4d9('0xb5')]=_0x1e01d8[_0xe4d9('0xb5')][_0xe4d9('0xa3')]>0x0?_0x1e01d8[_0xe4d9('0xb5')]:'t';}else if(_[_0xe4d9('0x42')](_0x1e01d8[_0xe4d9('0xb5')])){_0x1e01d8[_0xe4d9('0xb5')]='#';_0x2bca23='#';}if(!this[_0xe4d9('0x8f')](_0x261e60[_0xe4d9('0xd5')])){this[_0xe4d9('0x34')][_0xe4d9('0xae')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x5cd0a6=this[_0xe4d9('0x11')][_0xe4d9('0x79')](this,_0x261e60[_0xe4d9('0xd5')]);if(!_0x5cd0a6){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x261e60,_0xe4d9('0xd7'));}this[_0xe4d9('0x34')][_0xe4d9('0xa6')](_0x5cd0a6,_0x2bca23);}this[_0xe4d9('0x33')][_0xe4d9('0x79')](this,_0x261e60,_0x2bca23);return _0x1e01d8;};AGIVertices[_0xe4d9('0x10')]['noop']=function(_0x4cd9c0){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x15f'),_0x4cd9c0[_0xe4d9('0x36')]));return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0x4cd9c0[_0xe4d9('0x160')]||_0x4cd9c0[_0xe4d9('0x36')]);};AGIVertices['prototype'][_0xe4d9('0x161')]=function(_0x55f27d){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x162'),_0x55f27d[_0xe4d9('0x36')]));if(!this['isConfigured'](_0x55f27d[_0xe4d9('0x152')])){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x55f27d,_0xe4d9('0x153'));}logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x158'),this['channel']['callerid'],_0x55f27d[_0xe4d9('0x152')]));var _0x5f1ed5=this[_0xe4d9('0x163')]['sync'](this,_0x55f27d['pause_id']);var _0x59b0cb=this[_0xe4d9('0x56')][_0xe4d9('0x79')](this,_0x55f27d[_0xe4d9('0x152')],_0x5f1ed5);if(_0x59b0cb){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x154'),this['channel'][_0xe4d9('0x39')],_0x55f27d['findBy']));this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x154'),this[_0xe4d9('0x34')]['callerid'],_0x55f27d['findBy']));return{'code':0xc8,'result':_0xe4d9('0x155')};}else{logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x156'),this[_0xe4d9('0x34')][_0xe4d9('0x39')],_0x55f27d[_0xe4d9('0x152')]));this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x154'),this[_0xe4d9('0x34')]['callerid'],_0x55f27d[_0xe4d9('0x152')]));return{'code':0xc8,'result':_0xe4d9('0x164')};}};AGIVertices[_0xe4d9('0x10')]['playback']=function(_0x3ce4fa){logger[_0xe4d9('0x2c')](util['format'](_0xe4d9('0x165'),_0x3ce4fa[_0xe4d9('0x36')]));if(!this['isConfigured'](_0x3ce4fa[_0xe4d9('0x10f')])){return this[_0xe4d9('0x34')]['error'](_0x3ce4fa,_0xe4d9('0x110'));}var _0x1e3cef=this[_0xe4d9('0x15d')][_0xe4d9('0x79')](this,_0x3ce4fa[_0xe4d9('0x10f')]);if(!_0x1e3cef){return this[_0xe4d9('0x34')]['error'](_0x3ce4fa,_0xe4d9('0x111'));}var _0x5e638a=this[_0xe4d9('0x34')]['exec'](_0xe4d9('0x166'),[_0x1e3cef,_0x3ce4fa[_0xe4d9('0xe2')]]);if(_0x5e638a[_0xe4d9('0xb5')]===-0x1){return _0x5e638a;}return this['channel']['noop'](util[_0xe4d9('0x27')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x1e3cef));};AGIVertices['prototype']['queue']=function(_0x10029d){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x167'),_0x10029d[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x10029d['queue_id'])){return this[_0xe4d9('0x34')]['error'](_0x10029d,_0xe4d9('0x168'));}var _0x5ac903='';var _0x36d4fe=parseInt(_0x10029d[_0xe4d9('0x169')],0xa);if(isNaN(_0x36d4fe)){_0x5ac903=_0x10029d['queue_id'];}else{_0x5ac903=this[_0xe4d9('0x16a')][_0xe4d9('0x79')](this,_0x10029d[_0xe4d9('0x169')]);if(!_0x5ac903){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x10029d,_0xe4d9('0x16b'));}}var _0x2fad42='';if(this[_0xe4d9('0x8f')](_0x10029d[_0xe4d9('0x10f')])){var _0x52bb22=this['getSound'][_0xe4d9('0x79')](this,_0x10029d[_0xe4d9('0x10f')]);if(_0x52bb22){_0x2fad42=_0x52bb22;}}this[_0xe4d9('0x33')]['sync'](this,_0x10029d,_0x5ac903);if(_0x10029d[_0xe4d9('0xe2')][_0xe4d9('0x16c')]('x')<0x0){_0x10029d['opts']+='x';}if(_0x10029d[_0xe4d9('0xe2')][_0xe4d9('0x16c')]('X')<0x0){_0x10029d['opts']+='X';}this[_0xe4d9('0x34')]['setVariable'](_0xe4d9('0x16d'),_0x5ac903?_0x5ac903['toLowerCase']():'');var _0x27189a=this[_0xe4d9('0x34')][_0xe4d9('0x5e')](_0xe4d9('0x16e'),[_0x5ac903,_0x10029d[_0xe4d9('0xe2')],_0x10029d[_0xe4d9('0x6b')],_0x2fad42,_0x10029d['timeout'],_0x10029d[_0xe4d9('0x5')],_0x10029d[_0xe4d9('0x16f')],_0x10029d[_0xe4d9('0x170')],'',_0x10029d[_0xe4d9('0x171')]]);if(_0x27189a[_0xe4d9('0xb5')]===-0x1){return _0x27189a;}return this['channel']['noop'](util['format'](_0xe4d9('0xc5'),_0xe4d9('0x16e'),_0x5ac903));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x172')]=function(_0x380f61){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x173'),_0x380f61[_0xe4d9('0x36')]));var _0x36b4a1=_0x380f61['recordingFormat']||_0xe4d9('0x12a');var _0x2d536c=util[_0xe4d9('0x27')](_0xe4d9('0x174'),this[_0xe4d9('0x34')][_0xe4d9('0x35')],rs[_0xe4d9('0x118')](0x5));var _0x4e30f7=util[_0xe4d9('0x27')]('%s/recordings/%s.%s',FILES_PATH,_0x2d536c,_0x36b4a1);var _0x585d1e=util[_0xe4d9('0x27')](_0xe4d9('0x12b'),FILES_PATH,_0x2d536c);this[_0xe4d9('0x3a')][_0xe4d9('0x79')](this,_0x380f61,_0x2d536c,_0x4e30f7);this[_0xe4d9('0x34')][_0xe4d9('0xa6')]('RECORDING_SAVENAME',_0x2d536c);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x585d1e,_0x36b4a1,_0x380f61[_0xe4d9('0x175')],_0x380f61[_0xe4d9('0x6d')]);return this[_0xe4d9('0x34')][_0xe4d9('0x135')](_0x585d1e,_0x36b4a1,_0x380f61['escape_digits'],_0x380f61[_0xe4d9('0x6d')],undefined,!![]);};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x176')]=function(_0x1aefeb){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x177'),_0x1aefeb[_0xe4d9('0x36')]));if(!this['isConfigured'](_0x1aefeb['url'])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')]('no\x20url\x20configured');}var _0x19189a=this[_0xe4d9('0x6a')][_0xe4d9('0x79')](this,_0x1aefeb);logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x178'),util[_0xe4d9('0x179')](_0x19189a,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x1aefeb[_0xe4d9('0xd5')])){return this['channel'][_0xe4d9('0xae')](_0xe4d9('0x17a'));}var _0x169ee9=this[_0xe4d9('0x11')][_0xe4d9('0x79')](this,_0x1aefeb['variable_id']);if(!_0x169ee9){return this[_0xe4d9('0x34')]['error'](_0x1aefeb,_0xe4d9('0xd7'));}this['channel'][_0xe4d9('0xa6')](util[_0xe4d9('0x27')](_0xe4d9('0x17b'),_0x169ee9),_0x19189a[_0xe4d9('0x17c')]?_0x19189a[_0xe4d9('0x17c')]:_0xe4d9('0x17d'));this['channel'][_0xe4d9('0xa6')](util[_0xe4d9('0x27')](_0xe4d9('0x17e'),_0x169ee9),_0x19189a['statusMessage']?_0x19189a[_0xe4d9('0x7d')]:'OK');if(_0x19189a[_0xe4d9('0x72')]){try{this[_0xe4d9('0xa4')](_0x19189a['body'],_0x169ee9);}catch(_0x127ca8){logger[_0xe4d9('0x2a')](util[_0xe4d9('0x27')](_0xe4d9('0x17f'),_0x169ee9));}}return this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0xdc'),_0x169ee9));};AGIVertices[_0xe4d9('0x10')]['saydigits']=function(_0x3f3a3f){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x3f3a3f[_0xe4d9('0x36')]));return this[_0xe4d9('0x34')]['sayDigits'](_0x3f3a3f[_0xe4d9('0x180')][_0xe4d9('0x5f')](/\s+/g,''),_0x3f3a3f['escape_digits']);};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x181')]=function(_0x191956){logger[_0xe4d9('0x2c')](util['format'](_0xe4d9('0x182'),_0x191956[_0xe4d9('0x36')]));return this['channel'][_0xe4d9('0x183')](_0x191956[_0xe4d9('0x6e')]['replace'](/\s+/g,''),_0x191956[_0xe4d9('0x175')]);};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x184')]=function(_0xc947c9){logger[_0xe4d9('0x2c')](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0xc947c9[_0xe4d9('0x36')]));return this[_0xe4d9('0x34')][_0xe4d9('0x185')](_0xc947c9[_0xe4d9('0x62')],_0xc947c9['escape_digits']);};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x186')]=function(_0x28c2b3){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x187'),_0x28c2b3[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x28c2b3['account_id'])){return this[_0xe4d9('0x34')]['noop'](_0xe4d9('0x188'));}var _0x4d40b4=this[_0xe4d9('0x20')][_0xe4d9('0x79')](this,_0x28c2b3[_0xe4d9('0x189')]);if(!_0x4d40b4||!_0x4d40b4[_0xe4d9('0x18a')]){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x28c2b3,'no\x20mail\x20account\x20found');}var _0x7dd42c={'from':util[_0xe4d9('0x27')](_0xe4d9('0x18b'),_0x4d40b4[_0xe4d9('0x13')],_0x4d40b4[_0xe4d9('0x18c')]||_0x4d40b4[_0xe4d9('0x18a')]['user']),'to':_0x28c2b3['to']||'','cc':_0x28c2b3['cc']||'','bcc':_0x28c2b3[_0xe4d9('0x18d')]||'','subject':_0x28c2b3[_0xe4d9('0x18e')],'html':_0x28c2b3[_0xe4d9('0x62')],'text':_0x28c2b3[_0xe4d9('0x62')]};var _0x54edbf={'tls':{'rejectUnauthorized':![]}};if(_0x4d40b4[_0xe4d9('0x18a')][_0xe4d9('0x18f')]){_0x54edbf[_0xe4d9('0x18f')]=_0x4d40b4[_0xe4d9('0x18a')][_0xe4d9('0x18f')];}else{_0x54edbf['host']=_0x4d40b4[_0xe4d9('0x18a')]['host'];_0x54edbf[_0xe4d9('0x190')]=_0x4d40b4[_0xe4d9('0x18a')][_0xe4d9('0x190')];_0x54edbf[_0xe4d9('0x191')]=_0x4d40b4[_0xe4d9('0x18a')][_0xe4d9('0x191')];}if(_0x4d40b4[_0xe4d9('0x18a')][_0xe4d9('0x192')]){_0x54edbf[_0xe4d9('0x193')]={'user':_0x4d40b4[_0xe4d9('0x18a')][_0xe4d9('0x194')],'pass':_0x4d40b4['Smtp']['pass']};}if(this[_0xe4d9('0x8f')](_0x28c2b3[_0xe4d9('0x195')])){}logger[_0xe4d9('0xde')]('sendMail\x20message',JSON[_0xe4d9('0x7c')](_0x7dd42c));this[_0xe4d9('0x33')][_0xe4d9('0x79')](this,_0x28c2b3,_0x28c2b3[_0xe4d9('0x189')]);this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x196'),_0x4d40b4[_0xe4d9('0x13')]));this['sendMailMessage']['sync'](this,_0x54edbf,_0x7dd42c);return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0x197'));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x198')]=function(_0x51b7f0){logger[_0xe4d9('0x2c')](util['format'](_0xe4d9('0x199'),_0x51b7f0[_0xe4d9('0x36')]));return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0x19a'));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x19b')]=function(_0x2a9f9b){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x19c'),_0x2a9f9b[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x2a9f9b[_0xe4d9('0x19d')])){return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0x19e'));}var _0xf40f18=this[_0xe4d9('0x31')][_0xe4d9('0x79')](this,_0x2a9f9b[_0xe4d9('0x19d')]);if(!_0xf40f18){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x2a9f9b,_0xe4d9('0x19f'));}var _0x8c4651={'body':_0x2a9f9b[_0xe4d9('0x1a0')],'phone':_0x2a9f9b['to']||'','SmsAccountId':_0xf40f18['id']};logger[_0xe4d9('0xde')](_0xe4d9('0x1a1'),JSON[_0xe4d9('0x7c')](_0x8c4651));this['createSquareDetailsReport'][_0xe4d9('0x79')](this,_0x2a9f9b,_0x2a9f9b[_0xe4d9('0x19d')]);this['channel']['noop'](util['format'](_0xe4d9('0x1a2'),_0xf40f18['name']));this[_0xe4d9('0x32')]['sync'](this,_0x8c4651);return this[_0xe4d9('0x34')][_0xe4d9('0xae')](_0xe4d9('0x1a3'));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x1a4')]=function(_0xee2d20){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x1a5'),_0xee2d20[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0xee2d20[_0xe4d9('0xd5')])){return this['channel']['error'](_0xee2d20,_0xe4d9('0x1a6'));}var _0x259c73=this[_0xe4d9('0x11')][_0xe4d9('0x79')](this,_0xee2d20[_0xe4d9('0xd5')]);if(!_0x259c73){return this[_0xe4d9('0x34')]['error'](_0xee2d20,_0xe4d9('0xd7'));}return this[_0xe4d9('0x34')][_0xe4d9('0xa6')](_0x259c73,_0xee2d20['variable_value']);};AGIVertices['prototype']['start']=function(_0x360659){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x1a7'),_0x360659[_0xe4d9('0x36')]));this['channel'][_0xe4d9('0xae')](_0xe4d9('0x1a8'));if(_0x360659[_0xe4d9('0xbe')]===_0xe4d9('0x1a9')){this['channel'][_0xe4d9('0xae')]('Answer');return this[_0xe4d9('0x34')][_0xe4d9('0xbe')]();}return this['channel']['noop']('Skipped\x20Answer');};AGIVertices[_0xe4d9('0x10')]['subproject']=function(_0x191bff){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x1aa'),_0x191bff[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x191bff[_0xe4d9('0x1ab')])){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x191bff,'no\x20subproject\x20selected');}var _0x24efc8=this[_0xe4d9('0x15')][_0xe4d9('0x79')](this,_0x191bff[_0xe4d9('0x1ab')]);if(!this[_0xe4d9('0x8f')](_0x24efc8)){return this['channel']['error'](_0x191bff,util[_0xe4d9('0x27')](_0xe4d9('0x1ac'),_0x191bff['project_id']));}if(_0x24efc8===this[_0xe4d9('0x34')]['arg_1']){return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0x191bff,_0xe4d9('0x1ad'));}this[_0xe4d9('0x33')][_0xe4d9('0x79')](this,_0x191bff,_0x24efc8);var _0x3b69d5=this[_0xe4d9('0x34')][_0xe4d9('0x5e')]('AGI',util[_0xe4d9('0x27')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi']['host']||'127.0.0.1',_0x24efc8,this[_0xe4d9('0x34')][_0xe4d9('0x38')]));if(_0x3b69d5[_0xe4d9('0xb5')]===-0x1){return _0x3b69d5;}return this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0xc5'),_0xe4d9('0x1ae'),_0x24efc8));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x1af')]=function(_0x43ba76){logger['info'](util['format'](_0xe4d9('0x1b0'),_0x43ba76['label']));var _0x10bb19=this[_0xe4d9('0x5d')][_0xe4d9('0x79')](this,_0x43ba76[_0xe4d9('0x1b1')]);this['createSquareDetailsReport']['sync'](this,_0x43ba76,_0x43ba76[_0xe4d9('0x1b1')]);if(this['isConfigured'](_0x43ba76[_0xe4d9('0xd5')])){var _0x146688=this[_0xe4d9('0x11')]['sync'](this,_0x43ba76[_0xe4d9('0xd5')]);if(_0x146688){this['channel'][_0xe4d9('0xa6')](_0x146688,_0x10bb19);return this[_0xe4d9('0x34')][_0xe4d9('0xae')](util['format'](_0xe4d9('0x1b2'),_0x43ba76[_0xe4d9('0x1b1')],_0x146688));}}return this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x43ba76[_0xe4d9('0x1b1')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0xde514a){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x1b3'),_0xde514a['label']));_0xde514a[_0xe4d9('0x62')]=_0xde514a[_0xe4d9('0x62')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xe4d9('0x8f')](_0xde514a['apiKey'])){return this[_0xe4d9('0x34')]['noop'](_0xe4d9('0x1b4'));}if(!this[_0xe4d9('0x8f')](_0xde514a[_0xe4d9('0x62')])){return this[_0xe4d9('0x34')]['noop'](_0xe4d9('0xaf'));}this[_0xe4d9('0x34')][_0xe4d9('0xae')](util['format'](_0xe4d9('0x1b5'),_0xde514a[_0xe4d9('0x62')]));var _0x317162=this['googleCloudTTS']['sync'](this,_0xde514a);if(_0x317162){this[_0xe4d9('0x34')]['noop'](util[_0xe4d9('0x27')](_0xe4d9('0x1b6'),_0x317162));var _0x3b03b2=this[_0xe4d9('0x34')][_0xe4d9('0x14e')](_0x317162);try{fs['unlink'](_0x317162+'.wav');}catch(_0x20ec9c){logger['error'](_0x20ec9c);}return _0x3b03b2;}return this[_0xe4d9('0x34')][_0xe4d9('0x2a')](_0xde514a,_0xe4d9('0x1b7'));};AGIVertices['prototype']['tts']=function(_0x251353){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x251353[_0xe4d9('0x36')]));_0x251353['text']=_0x251353['text'][_0xe4d9('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x251353['text'])){return this[_0xe4d9('0x34')]['noop'](_0xe4d9('0xaf'));}this[_0xe4d9('0x34')]['noop'](util[_0xe4d9('0x27')](_0xe4d9('0x1b8'),_0x251353[_0xe4d9('0x62')]));var _0x1f61b8=this[_0xe4d9('0x68')][_0xe4d9('0x79')](this,_0x251353);if(_0x1f61b8){this[_0xe4d9('0x34')]['noop'](util[_0xe4d9('0x27')](_0xe4d9('0x1b9'),_0x1f61b8));var _0x161125=this[_0xe4d9('0x34')][_0xe4d9('0x14e')](_0x1f61b8);try{fs[_0xe4d9('0x100')](_0x1f61b8+_0xe4d9('0x124'));}catch(_0x583888){logger['error'](_0x583888);}return _0x161125;}return this['channel'][_0xe4d9('0x2a')](_0x251353,_0xe4d9('0x1ba'));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x1bb')]=function(_0x96f9b2){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x1bc'),_0x96f9b2[_0xe4d9('0x36')]));if(!this[_0xe4d9('0x8f')](_0x96f9b2['findBy'])){return this[_0xe4d9('0x34')]['error'](_0x96f9b2,_0xe4d9('0x153'));}logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')](_0xe4d9('0x158'),this['channel'][_0xe4d9('0x39')],_0x96f9b2[_0xe4d9('0x152')]));var _0x318e97=this[_0xe4d9('0x58')][_0xe4d9('0x79')](this,_0x96f9b2[_0xe4d9('0x152')]);if(_0x318e97){logger[_0xe4d9('0x2c')](util['format'](_0xe4d9('0x154'),this[_0xe4d9('0x34')]['callerid'],_0x96f9b2['findBy']));this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xe4d9('0x39')],_0x96f9b2['findBy']));return{'code':0xc8,'result':_0xe4d9('0x155')};}else{logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe4d9('0x34')]['callerid'],_0x96f9b2[_0xe4d9('0x152')]));this['channel'][_0xe4d9('0xae')](util[_0xe4d9('0x27')](_0xe4d9('0x156'),this[_0xe4d9('0x34')][_0xe4d9('0x39')],_0x96f9b2[_0xe4d9('0x152')]));return{'code':0xc8,'result':_0xe4d9('0x164')};}};AGIVertices['prototype'][_0xe4d9('0x1bd')]=function(_0x3de4c9){logger[_0xe4d9('0x2c')](util[_0xe4d9('0x27')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x3de4c9['label']));var _0x55de0e=this['channel'][_0xe4d9('0x5e')](_0xe4d9('0x1be'),[_0x3de4c9[_0xe4d9('0x1bf')],_0x3de4c9[_0xe4d9('0x80')]]);if(_0x55de0e[_0xe4d9('0xb5')]===-0x1){return _0x55de0e;}return this[_0xe4d9('0x34')][_0xe4d9('0xae')](util[_0xe4d9('0x27')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x3de4c9['mailbox']));};AGIVertices[_0xe4d9('0x10')][_0xe4d9('0x1c0')]=function(_0x441425){logger['info'](util['format'](_0xe4d9('0x1c1'),_0x441425[_0xe4d9('0x36')]));if(!this['isConfigured'](_0x441425[_0xe4d9('0xd5')])){return this[_0xe4d9('0x34')]['error'](_0x441425,_0xe4d9('0x1a6'));}var _0x422514=this[_0xe4d9('0x11')]['sync'](this,_0x441425[_0xe4d9('0xd5')]);if(!_0x422514){return this['channel']['error'](_0x441425,_0xe4d9('0xd7'));}var _0x41ff93=this[_0xe4d9('0x34')]['getVariable'](_0x422514);return{'code':0xc8,'result':_0x41ff93[_0xe4d9('0xa9')]?_0x41ff93[_0xe4d9('0xa9')]:'-'};};String['prototype'][_0xe4d9('0xa8')]=function(_0x547246,_0x219105){return this[_0xe4d9('0xa7')](_0x547246)[_0xe4d9('0x1c2')](_0x219105);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index a72d184..e393877 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 _0x9857=['prototype','interface','queue','ACW','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timers','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','channels','syncAgentConnect','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','diff','seconds'];(function(_0x260cd8,_0x472cd6){var _0x3a6c71=function(_0x232e0f){while(--_0x232e0f){_0x260cd8['push'](_0x260cd8['shift']());}};_0x3a6c71(++_0x472cd6);}(_0x9857,0x147));var _0x7985=function(_0x3e4af4,_0xe63612){_0x3e4af4=_0x3e4af4-0x0;var _0x21fdcf=_0x9857[_0x3e4af4];return _0x21fdcf;};'use strict';var util=require('util');var _=require(_0x7985('0x0'));var moment=require(_0x7985('0x1'));var ami=require('../ami');var logger=require('../../../config/logger')(_0x7985('0x2'));var RpcUser=require(_0x7985('0x3'));var RpcVoiceAgentReport=require(_0x7985('0x4'));function Acw(_0x4ff8eb){this[_0x7985('0x5')]=_0x4ff8eb[_0x7985('0x5')];this[_0x7985('0x6')]=_0x4ff8eb['agents'];this['timers']=_0x4ff8eb['timers'];this[_0x7985('0x7')]={};ami['on']('agentconnect',this[_0x7985('0x8')]['bind'](this));ami['on']('hanguprequest',this[_0x7985('0x9')][_0x7985('0xa')](this));ami['on'](_0x7985('0xb'),this[_0x7985('0xc')][_0x7985('0xa')](this));ami['on'](_0x7985('0xd'),this['syncAgentRingNoAnswer'][_0x7985('0xa')](this));ami['on'](_0x7985('0xe'),this[_0x7985('0xf')][_0x7985('0xa')](this));ami['on'](_0x7985('0x10'),this['syncBlindTransfer']['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x7985('0x11')][_0x7985('0xa')](this));}function getDiff(_0x1a48d9){var _0x470c3f=moment()[_0x7985('0x12')](0x0);var _0x508a0f=moment(_0x1a48d9)[_0x7985('0x12')](0x0);return _0x470c3f[_0x7985('0x13')](_0x508a0f,_0x7985('0x14'));}Acw[_0x7985('0x15')]['startAcw']=function(_0x3b85c5){try{var _0x560697=this;var _0x55b066=this[_0x7985('0x7')][_0x3b85c5][_0x7985('0x16')];var _0x8623dd=this[_0x7985('0x7')][_0x3b85c5][_0x7985('0x17')];var _0x5dfa29=this[_0x7985('0x5')][_0x8623dd];var _0x308081=![];var _0x3bfe46=_0x7985('0x18');if(_0x5dfa29['mandatoryDisposition']){if(_0x5dfa29[_0x7985('0x19')][_0x7985('0x1a')]){_0x308081=!![];_0x3bfe46=_0x5dfa29[_0x7985('0x19')][_0x7985('0x1a')];}}ami[_0x7985('0x1b')]({'action':'QueuePause','interface':_0x55b066,'paused':!![],'reason':_0x3bfe46})[_0x7985('0x1c')](function(_0x2f4ed1){if(_0x560697[_0x7985('0x6')][_0x55b066]){return RpcUser[_0x7985('0x1d')](_0x560697[_0x7985('0x6')][_0x55b066]['id'])[_0x7985('0x1c')](function(_0x5d11ef){if(_0x5d11ef&&!_0x5d11ef[_0x7985('0x1e')]){logger[_0x7985('0x1f')](_0x7985('0x20'),_0x3b85c5,_0x55b066,_0x8623dd);var _0x38d2d0=_0x560697['channels'][_0x3b85c5][_0x7985('0x21')]&&_0x560697[_0x7985('0x7')][_0x3b85c5][_0x7985('0x22')]?_0x560697[_0x7985('0x7')][_0x3b85c5][_0x7985('0x22')]:_0x3b85c5;return RpcUser[_0x7985('0x23')](_0x560697[_0x7985('0x6')][_0x55b066],_0x3bfe46,_0x38d2d0)[_0x7985('0x1c')](function(_0x11eb91){if(!_0x308081){_0x560697['timers'][_0x55b066]={};logger[_0x7985('0x1f')](_0x7985('0x24'),_0x3b85c5,_0x560697['voiceQueues'][_0x8623dd][_0x7985('0x25')],_0x55b066,_0x8623dd);_0x560697[_0x7985('0x26')][_0x55b066]['timer']=setTimeout(_0x560697[_0x7985('0x27')][_0x7985('0xa')](_0x560697,_0x55b066),_0x560697['voiceQueues'][_0x8623dd]['acwTimeout']*0x3e8);_0x560697['timers'][_0x55b066]['lastPauseAt']=moment()[_0x7985('0x28')](_0x7985('0x29'));_0x560697['timers'][_0x55b066][_0x7985('0x2a')]=_0x3b85c5;_0x560697[_0x7985('0x26')][_0x55b066][_0x7985('0x17')]=_0x8623dd;_0x560697['timers'][_0x55b066][_0x7985('0x2b')]=function(){var _0x461107=getDiff(_0x560697[_0x7985('0x26')][_0x55b066][_0x7985('0x2c')]);clearTimeout(_0x560697[_0x7985('0x26')][_0x55b066]['timer']);_0x560697[_0x7985('0x26')][_0x55b066][_0x7985('0x2d')]=![];RpcVoiceAgentReport[_0x7985('0x2e')]({'acwtime':_0x461107},_0x560697[_0x7985('0x26')][_0x55b066][_0x7985('0x2a')],_0x55b066)[_0x7985('0x1c')](function(_0x298263){logger[_0x7985('0x1f')](_0x7985('0x2f'),_0x3b85c5,_0x461107,_0x298263);})[_0x7985('0x30')](function(_0x366263){logger[_0x7985('0x31')](_0x7985('0x32'),_0x3b85c5,_0x366263);});delete _0x560697['timers'][_0x55b066];};}});}else{logger['info'](_0x7985('0x33'),_0x3b85c5,_0x55b066,_0x8623dd);}});}})['catch'](function(_0x32d2be){logger[_0x7985('0x31')](_0x7985('0x24'),_0x3b85c5,_0x560697[_0x7985('0x5')][_0x8623dd][_0x7985('0x25')],_0x55b066,_0x8623dd);})[_0x7985('0x34')](function(){delete _0x560697[_0x7985('0x7')][_0x3b85c5];});}catch(_0x32eee6){logger[_0x7985('0x31')](_0x7985('0x35'),_0x32eee6[_0x7985('0x36')]);}};Acw[_0x7985('0x15')][_0x7985('0x27')]=function(_0x86d6ed){try{var _0x6e43a6=this;if(_0x6e43a6[_0x7985('0x26')][_0x86d6ed]){_0x6e43a6[_0x7985('0x26')][_0x86d6ed][_0x7985('0x2d')]=![];var _0x379a7d=_0x6e43a6[_0x7985('0x26')][_0x86d6ed][_0x7985('0x2a')];var _0x16578d=_0x6e43a6[_0x7985('0x26')][_0x86d6ed][_0x7985('0x17')];var _0x3c42bf=_0x6e43a6[_0x7985('0x5')][_0x16578d][_0x7985('0x25')];logger[_0x7985('0x1f')](_0x7985('0x37'),_0x379a7d,_0x86d6ed);RpcUser[_0x7985('0x38')](this['agents'][_0x86d6ed]);RpcVoiceAgentReport['update']({'acwtime':_0x3c42bf,'agentacw':!![]},_0x379a7d,_0x86d6ed)['then'](function(_0x1f9dac){logger[_0x7985('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x379a7d,_0x3c42bf,_0x1f9dac);})['catch'](function(_0x1aa23a){logger['error'](_0x7985('0x32'),_0x379a7d,_0x1aa23a);});}else{logger[_0x7985('0x31')](_0x7985('0x39'),_0x86d6ed);if(_0x6e43a6['timers']){logger[_0x7985('0x1f')](_0x7985('0x3a'),JSON[_0x7985('0x3b')](_0x6e43a6['timers']));}}}catch(_0x466c08){logger['error'](_0x7985('0x3c'),_0x466c08[_0x7985('0x36')]);}};Acw[_0x7985('0x15')][_0x7985('0x8')]=function(_0x434bba){try{if(this[_0x7985('0x5')][_0x434bba[_0x7985('0x17')]]&&(this[_0x7985('0x5')][_0x434bba['queue']][_0x7985('0x2')]||this['voiceQueues'][_0x434bba[_0x7985('0x17')]][_0x7985('0x3d')])){if(this[_0x7985('0x6')][_0x434bba['interface']]){this['channels'][_0x434bba[_0x7985('0x2a')]]={'queue':_0x434bba[_0x7985('0x17')],'interface':_0x434bba[_0x7985('0x16')],'destlinkedid':_0x434bba[_0x7985('0x22')]};}}}catch(_0x535ecb){logger[_0x7985('0x31')](_0x7985('0x3e'),_0x535ecb[_0x7985('0x36')]);}};Acw[_0x7985('0x15')][_0x7985('0x11')]=function(_0x4dd1b0){try{if(this[_0x7985('0x5')][_0x4dd1b0[_0x7985('0x17')]]&&(this[_0x7985('0x5')][_0x4dd1b0[_0x7985('0x17')]]['acw']||this[_0x7985('0x5')][_0x4dd1b0[_0x7985('0x17')]]['mandatoryDisposition'])){if(this[_0x7985('0x6')][_0x4dd1b0[_0x7985('0x16')]]){this[_0x7985('0x7')][_0x4dd1b0[_0x7985('0x2a')]]={'queue':_0x4dd1b0[_0x7985('0x17')],'interface':_0x4dd1b0['interface']};}}}catch(_0x1e167a){logger[_0x7985('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0x1e167a[_0x7985('0x36')]);}};Acw[_0x7985('0x15')][_0x7985('0x9')]=function(_0x26cacb){try{if(this[_0x7985('0x7')][_0x26cacb[_0x7985('0x2a')]]&&_[_0x7985('0x3f')](this[_0x7985('0x7')][_0x26cacb[_0x7985('0x2a')]][_0x7985('0x21')])){logger['info'](_0x7985('0x40'),_0x26cacb[_0x7985('0x2a')]);this[_0x7985('0x41')](_0x26cacb[_0x7985('0x2a')]);}else if(this[_0x7985('0x7')][_0x26cacb[_0x7985('0x42')]]&&_['isUndefined'](this[_0x7985('0x7')][_0x26cacb[_0x7985('0x42')]][_0x7985('0x21')])){logger[_0x7985('0x1f')](_0x7985('0x43'),_0x26cacb[_0x7985('0x42')]);this[_0x7985('0x41')](_0x26cacb[_0x7985('0x42')]);}}catch(_0x58a93d){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x58a93d['message']);}};Acw[_0x7985('0x15')][_0x7985('0xc')]=function(_0x1c9576){try{if(this[_0x7985('0x7')][_0x1c9576[_0x7985('0x2a')]]&&this[_0x7985('0x7')][_0x1c9576[_0x7985('0x2a')]][_0x7985('0x21')]){logger[_0x7985('0x1f')](_0x7985('0x44'),_0x1c9576['uniqueid']);this['startAcw'](_0x1c9576[_0x7985('0x2a')]);}else if(this[_0x7985('0x7')][_0x1c9576['linkedid']]&&this[_0x7985('0x7')][_0x1c9576[_0x7985('0x42')]]['attended']){logger[_0x7985('0x1f')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1c9576[_0x7985('0x42')]);this[_0x7985('0x41')](_0x1c9576[_0x7985('0x42')]);}}catch(_0x1650b6){logger[_0x7985('0x31')](_0x7985('0x45'),_0x1650b6[_0x7985('0x36')]);}};Acw[_0x7985('0x15')][_0x7985('0xf')]=function(_0x1a7228){try{if(!_['isNil'](this[_0x7985('0x7')][_0x1a7228[_0x7985('0x46')]])){this['startAcw'](_0x1a7228['transfereeuniqueid']);if(this[_0x7985('0x7')][_0x1a7228[_0x7985('0x47')]]){this[_0x7985('0x7')][_0x1a7228[_0x7985('0x47')]][_0x7985('0x21')]=!![];this[_0x7985('0x7')][_0x1a7228[_0x7985('0x48')]]=this['channels'][_0x1a7228['secondtransfereruniqueid']];delete this['channels'][_0x1a7228[_0x7985('0x47')]];}}else if(!_[_0x7985('0x49')](this['channels'][_0x1a7228['transfertargetuniqueid']])){this[_0x7985('0x41')](_0x1a7228[_0x7985('0x48')]);if(this[_0x7985('0x7')][_0x1a7228[_0x7985('0x4a')]]){this[_0x7985('0x7')][_0x1a7228[_0x7985('0x4a')]]['attended']=!![];this[_0x7985('0x7')][_0x1a7228[_0x7985('0x46')]]=this[_0x7985('0x7')][_0x1a7228['origtransfereruniqueid']];delete this['channels'][_0x1a7228[_0x7985('0x4a')]];}}}catch(_0x2ad3d6){logger['error'](_0x7985('0x4b'),_0x2ad3d6['message']);}};Acw[_0x7985('0x15')][_0x7985('0x4c')]=function(_0x3d2c8b){try{if(this['channels'][_0x3d2c8b['transfereruniqueid']]){logger[_0x7985('0x1f')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x7985('0x3b')](_0x3d2c8b[_0x7985('0x4d')]));this[_0x7985('0x41')](_0x3d2c8b[_0x7985('0x4d')]);}else if(this[_0x7985('0x7')][_0x3d2c8b[_0x7985('0x4e')]]){logger['info'](_0x7985('0x4f'),JSON[_0x7985('0x3b')](_0x3d2c8b[_0x7985('0x4e')]));this[_0x7985('0x41')](_0x3d2c8b[_0x7985('0x4e')]);}}catch(_0x28baa9){logger[_0x7985('0x31')](_0x7985('0x50'),_0x28baa9[_0x7985('0x36')]);}};Acw[_0x7985('0x15')][_0x7985('0x51')]=function(_0x59c39b){try{if(this[_0x7985('0x5')][_0x59c39b['queue']]&&this[_0x7985('0x5')][_0x59c39b['queue']][_0x7985('0x52')]===_0x7985('0x53')){if(this['agents'][_0x59c39b[_0x7985('0x16')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x59c39b[_0x7985('0x2a')],_0x59c39b[_0x7985('0x16')],_0x59c39b[_0x7985('0x17')]);return RpcUser[_0x7985('0x23')](this[_0x7985('0x6')][_0x59c39b[_0x7985('0x16')]],_0x7985('0x54'),_0x59c39b['uniqueid']);}}}catch(_0x2ebac0){logger[_0x7985('0x31')](_0x7985('0x55'),_0x2ebac0[_0x7985('0x36')]);}};module[_0x7985('0x56')]=Acw; \ No newline at end of file +var _0x0059=['[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','attended','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[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','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','seconds','prototype','startAcw','interface','channels','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]'];(function(_0x23bf99,_0x1380d1){var _0x564811=function(_0x3766e8){while(--_0x3766e8){_0x23bf99['push'](_0x23bf99['shift']());}};_0x564811(++_0x1380d1);}(_0x0059,0x1be));var _0x9005=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0x0059[_0x4c9380];return _0x49a523;};'use strict';var util=require('util');var _=require(_0x9005('0x0'));var moment=require(_0x9005('0x1'));var ami=require(_0x9005('0x2'));var logger=require(_0x9005('0x3'))(_0x9005('0x4'));var RpcUser=require(_0x9005('0x5'));var RpcVoiceAgentReport=require(_0x9005('0x6'));function Acw(_0x2df9de){this[_0x9005('0x7')]=_0x2df9de[_0x9005('0x7')];this[_0x9005('0x8')]=_0x2df9de[_0x9005('0x8')];this[_0x9005('0x9')]=_0x2df9de[_0x9005('0x9')];this['channels']={};ami['on'](_0x9005('0xa'),this['syncAgentConnect'][_0x9005('0xb')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x9005('0xb')](this));ami['on']('hangup',this[_0x9005('0xc')][_0x9005('0xb')](this));ami['on'](_0x9005('0xd'),this[_0x9005('0xe')]['bind'](this));ami['on'](_0x9005('0xf'),this[_0x9005('0x10')][_0x9005('0xb')](this));ami['on'](_0x9005('0x11'),this['syncBlindTransfer'][_0x9005('0xb')](this));ami['on'](_0x9005('0x12'),this[_0x9005('0x13')][_0x9005('0xb')](this));}function getDiff(_0x34a935){var _0x4fdd52=moment()['milliseconds'](0x0);var _0x52eb7e=moment(_0x34a935)['milliseconds'](0x0);return _0x4fdd52[_0x9005('0x14')](_0x52eb7e,_0x9005('0x15'));}Acw[_0x9005('0x16')][_0x9005('0x17')]=function(_0x3ef0ab){try{var _0x4ff24b=this;var _0x198121=this['channels'][_0x3ef0ab][_0x9005('0x18')];var _0x3e653a=this[_0x9005('0x19')][_0x3ef0ab][_0x9005('0x1a')];var _0x34bad8=this[_0x9005('0x7')][_0x3e653a];var _0xea2599=![];var _0x10ab95=_0x9005('0x1b');if(_0x34bad8[_0x9005('0x1c')]){if(_0x34bad8[_0x9005('0x1d')][_0x9005('0x1e')]){_0xea2599=!![];_0x10ab95=_0x34bad8[_0x9005('0x1d')][_0x9005('0x1e')];}}ami[_0x9005('0x1f')]({'action':_0x9005('0x20'),'interface':_0x198121,'paused':!![],'reason':_0x10ab95})[_0x9005('0x21')](function(_0x5f0b45){if(_0x4ff24b[_0x9005('0x8')][_0x198121]){return RpcUser[_0x9005('0x22')](_0x4ff24b['agents'][_0x198121]['id'])[_0x9005('0x21')](function(_0x366bdd){if(_0x366bdd&&!_0x366bdd[_0x9005('0x23')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x3ef0ab,_0x198121,_0x3e653a);var _0x246957=_0x4ff24b[_0x9005('0x19')][_0x3ef0ab]['attended']&&_0x4ff24b[_0x9005('0x19')][_0x3ef0ab][_0x9005('0x24')]?_0x4ff24b[_0x9005('0x19')][_0x3ef0ab][_0x9005('0x24')]:_0x3ef0ab;return RpcUser[_0x9005('0x25')](_0x4ff24b['agents'][_0x198121],_0x10ab95,_0x246957)[_0x9005('0x21')](function(_0x4c1d60){if(!_0xea2599){_0x4ff24b[_0x9005('0x9')][_0x198121]={};logger[_0x9005('0x26')](_0x9005('0x27'),_0x3ef0ab,_0x4ff24b['voiceQueues'][_0x3e653a][_0x9005('0x28')],_0x198121,_0x3e653a);_0x4ff24b[_0x9005('0x9')][_0x198121][_0x9005('0x29')]=setTimeout(_0x4ff24b['stopAcw'][_0x9005('0xb')](_0x4ff24b,_0x198121),_0x4ff24b[_0x9005('0x7')][_0x3e653a][_0x9005('0x28')]*0x3e8);_0x4ff24b[_0x9005('0x9')][_0x198121][_0x9005('0x2a')]=moment()[_0x9005('0x2b')](_0x9005('0x2c'));_0x4ff24b[_0x9005('0x9')][_0x198121][_0x9005('0x2d')]=_0x3ef0ab;_0x4ff24b[_0x9005('0x9')][_0x198121][_0x9005('0x1a')]=_0x3e653a;_0x4ff24b[_0x9005('0x9')][_0x198121]['updateAcw']=function(){var _0x4dcc79=getDiff(_0x4ff24b[_0x9005('0x9')][_0x198121][_0x9005('0x2a')]);clearTimeout(_0x4ff24b[_0x9005('0x9')][_0x198121][_0x9005('0x29')]);_0x4ff24b['timers'][_0x198121][_0x9005('0x29')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x4dcc79},_0x4ff24b[_0x9005('0x9')][_0x198121]['uniqueid'],_0x198121)['then'](function(_0x14f604){logger[_0x9005('0x26')](_0x9005('0x2e'),_0x3ef0ab,_0x4dcc79,_0x14f604);})[_0x9005('0x2f')](function(_0x1069dd){logger[_0x9005('0x30')](_0x9005('0x31'),_0x3ef0ab,_0x1069dd);});delete _0x4ff24b['timers'][_0x198121];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x3ef0ab,_0x198121,_0x3e653a);}});}})[_0x9005('0x2f')](function(_0x3a2827){logger[_0x9005('0x30')](_0x9005('0x27'),_0x3ef0ab,_0x4ff24b[_0x9005('0x7')][_0x3e653a][_0x9005('0x28')],_0x198121,_0x3e653a);})[_0x9005('0x32')](function(){delete _0x4ff24b[_0x9005('0x19')][_0x3ef0ab];});}catch(_0xcf185b){logger[_0x9005('0x30')]('[ACW][START]\x20%s',_0xcf185b[_0x9005('0x33')]);}};Acw[_0x9005('0x16')][_0x9005('0x34')]=function(_0xbcc073){try{var _0x281561=this;if(_0x281561[_0x9005('0x9')][_0xbcc073]){_0x281561['timers'][_0xbcc073][_0x9005('0x29')]=![];var _0x5eb0a0=_0x281561[_0x9005('0x9')][_0xbcc073][_0x9005('0x2d')];var _0x5e74fd=_0x281561['timers'][_0xbcc073][_0x9005('0x1a')];var _0x368295=_0x281561[_0x9005('0x7')][_0x5e74fd][_0x9005('0x28')];logger[_0x9005('0x26')](_0x9005('0x35'),_0x5eb0a0,_0xbcc073);RpcUser['saveUnpause'](this[_0x9005('0x8')][_0xbcc073]);RpcVoiceAgentReport['update']({'acwtime':_0x368295,'agentacw':!![]},_0x5eb0a0,_0xbcc073)[_0x9005('0x21')](function(_0x2237ab){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x5eb0a0,_0x368295,_0x2237ab);})[_0x9005('0x2f')](function(_0x3de7c3){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x5eb0a0,_0x3de7c3);});}else{logger[_0x9005('0x30')](_0x9005('0x36'),_0xbcc073);if(_0x281561[_0x9005('0x9')]){logger[_0x9005('0x26')](_0x9005('0x37'),JSON[_0x9005('0x38')](_0x281561['timers']));}}}catch(_0xe76b0e){logger[_0x9005('0x30')]('[ACW][STOP]\x20%s',_0xe76b0e[_0x9005('0x33')]);}};Acw[_0x9005('0x16')][_0x9005('0x39')]=function(_0x2f3ff3){try{if(this[_0x9005('0x7')][_0x2f3ff3[_0x9005('0x1a')]]&&(this['voiceQueues'][_0x2f3ff3[_0x9005('0x1a')]][_0x9005('0x4')]||this[_0x9005('0x7')][_0x2f3ff3[_0x9005('0x1a')]][_0x9005('0x1c')])){if(this[_0x9005('0x8')][_0x2f3ff3[_0x9005('0x18')]]){this[_0x9005('0x19')][_0x2f3ff3[_0x9005('0x2d')]]={'queue':_0x2f3ff3[_0x9005('0x1a')],'interface':_0x2f3ff3['interface'],'destlinkedid':_0x2f3ff3[_0x9005('0x24')]};}}}catch(_0x481c94){logger[_0x9005('0x30')](_0x9005('0x3a'),_0x481c94[_0x9005('0x33')]);}};Acw['prototype'][_0x9005('0x13')]=function(_0x3f1ec5){try{if(this[_0x9005('0x7')][_0x3f1ec5[_0x9005('0x1a')]]&&(this[_0x9005('0x7')][_0x3f1ec5[_0x9005('0x1a')]][_0x9005('0x4')]||this['voiceQueues'][_0x3f1ec5[_0x9005('0x1a')]][_0x9005('0x1c')])){if(this[_0x9005('0x8')][_0x3f1ec5[_0x9005('0x18')]]){this[_0x9005('0x19')][_0x3f1ec5['uniqueid']]={'queue':_0x3f1ec5[_0x9005('0x1a')],'interface':_0x3f1ec5[_0x9005('0x18')]};}}}catch(_0x12c38e){logger['error'](_0x9005('0x3b'),_0x12c38e['message']);}};Acw[_0x9005('0x16')][_0x9005('0x3c')]=function(_0x4faaa2){try{if(this[_0x9005('0x19')][_0x4faaa2['uniqueid']]&&_['isUndefined'](this[_0x9005('0x19')][_0x4faaa2[_0x9005('0x2d')]]['attended'])){logger[_0x9005('0x26')](_0x9005('0x3d'),_0x4faaa2[_0x9005('0x2d')]);this[_0x9005('0x17')](_0x4faaa2[_0x9005('0x2d')]);}else if(this[_0x9005('0x19')][_0x4faaa2[_0x9005('0x3e')]]&&_['isUndefined'](this[_0x9005('0x19')][_0x4faaa2[_0x9005('0x3e')]]['attended'])){logger['info'](_0x9005('0x3f'),_0x4faaa2['linkedid']);this[_0x9005('0x17')](_0x4faaa2['linkedid']);}}catch(_0x5d136f){logger['error'](_0x9005('0x40'),_0x5d136f[_0x9005('0x33')]);}};Acw[_0x9005('0x16')][_0x9005('0xc')]=function(_0x5597c4){try{if(this[_0x9005('0x19')][_0x5597c4['uniqueid']]&&this['channels'][_0x5597c4[_0x9005('0x2d')]]['attended']){logger['info'](_0x9005('0x41'),_0x5597c4[_0x9005('0x2d')]);this[_0x9005('0x17')](_0x5597c4[_0x9005('0x2d')]);}else if(this[_0x9005('0x19')][_0x5597c4[_0x9005('0x3e')]]&&this[_0x9005('0x19')][_0x5597c4[_0x9005('0x3e')]][_0x9005('0x42')]){logger['info'](_0x9005('0x43'),_0x5597c4['linkedid']);this[_0x9005('0x17')](_0x5597c4[_0x9005('0x3e')]);}}catch(_0x51b308){logger[_0x9005('0x30')](_0x9005('0x44'),_0x51b308[_0x9005('0x33')]);}};Acw[_0x9005('0x16')][_0x9005('0x10')]=function(_0x31c3c4){try{if(!_[_0x9005('0x45')](this[_0x9005('0x19')][_0x31c3c4[_0x9005('0x46')]])){this[_0x9005('0x17')](_0x31c3c4[_0x9005('0x46')]);if(this['channels'][_0x31c3c4[_0x9005('0x47')]]){this[_0x9005('0x19')][_0x31c3c4['secondtransfereruniqueid']][_0x9005('0x42')]=!![];this[_0x9005('0x19')][_0x31c3c4[_0x9005('0x48')]]=this[_0x9005('0x19')][_0x31c3c4['secondtransfereruniqueid']];delete this['channels'][_0x31c3c4['secondtransfereruniqueid']];}}else if(!_[_0x9005('0x45')](this['channels'][_0x31c3c4[_0x9005('0x48')]])){this[_0x9005('0x17')](_0x31c3c4['transfertargetuniqueid']);if(this['channels'][_0x31c3c4[_0x9005('0x49')]]){this[_0x9005('0x19')][_0x31c3c4['origtransfereruniqueid']][_0x9005('0x42')]=!![];this[_0x9005('0x19')][_0x31c3c4['transfereeuniqueid']]=this[_0x9005('0x19')][_0x31c3c4[_0x9005('0x49')]];delete this[_0x9005('0x19')][_0x31c3c4[_0x9005('0x49')]];}}}catch(_0x258d7a){logger[_0x9005('0x30')](_0x9005('0x4a'),_0x258d7a[_0x9005('0x33')]);}};Acw[_0x9005('0x16')][_0x9005('0x4b')]=function(_0x5a1960){try{if(this['channels'][_0x5a1960[_0x9005('0x4c')]]){logger[_0x9005('0x26')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x5a1960[_0x9005('0x4c')]));this[_0x9005('0x17')](_0x5a1960[_0x9005('0x4c')]);}else if(this['channels'][_0x5a1960[_0x9005('0x4d')]]){logger['info'](_0x9005('0x4e'),JSON[_0x9005('0x38')](_0x5a1960[_0x9005('0x4d')]));this[_0x9005('0x17')](_0x5a1960[_0x9005('0x4d')]);}}catch(_0x22b63d){logger[_0x9005('0x30')](_0x9005('0x4f'),_0x22b63d[_0x9005('0x33')]);}};Acw[_0x9005('0x16')]['syncAgentRingNoAnswer']=function(_0x3f74f5){try{if(this['voiceQueues'][_0x3f74f5[_0x9005('0x1a')]]&&this[_0x9005('0x7')][_0x3f74f5[_0x9005('0x1a')]]['autopause']===_0x9005('0x50')){if(this[_0x9005('0x8')][_0x3f74f5[_0x9005('0x18')]]){logger['info'](_0x9005('0x51'),_0x3f74f5[_0x9005('0x2d')],_0x3f74f5[_0x9005('0x18')],_0x3f74f5[_0x9005('0x1a')]);return RpcUser[_0x9005('0x25')](this[_0x9005('0x8')][_0x3f74f5[_0x9005('0x18')]],_0x9005('0x52'),_0x3f74f5[_0x9005('0x2d')]);}}}catch(_0x29a59e){logger[_0x9005('0x30')](_0x9005('0x53'),_0x29a59e[_0x9005('0x33')]);}};module[_0x9005('0x54')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 7cb64ca..10d6f84 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 _0x0b0e=['../../config/environment','asterisk','port','username','password','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','once','asterisk-manager','moment','lodash','../../config/logger','ami'];(function(_0x336a46,_0x32bb11){var _0x28fe0b=function(_0x150d4f){while(--_0x150d4f){_0x336a46['push'](_0x336a46['shift']());}};_0x28fe0b(++_0x32bb11);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3311ae,_0x362cee){_0x3311ae=_0x3311ae-0x0;var _0x107949=_0x0b0e[_0x3311ae];return _0x107949;};'use strict';var Manager=require(_0xe0b0('0x0'));var BPromise=require('bluebird');var moment=require(_0xe0b0('0x1'));var util=require('util');var _=require(_0xe0b0('0x2'));var logger=require(_0xe0b0('0x3'))(_0xe0b0('0x4'));var config=require(_0xe0b0('0x5'));var ami=new Manager(config[_0xe0b0('0x6')][_0xe0b0('0x7')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')][_0xe0b0('0x9')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xe0b0('0xa')](ami[_0xe0b0('0xb')]);function error(_0xc4a085){logger[_0xe0b0('0xc')](util['format'](_0xe0b0('0xd'),config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')]['port'],util[_0xe0b0('0xe')](_0xc4a085,![],null)));}function close(){logger[_0xe0b0('0xc')](util[_0xe0b0('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe0b0('0x6')][_0xe0b0('0x8')],config[_0xe0b0('0x6')]['ip'],config[_0xe0b0('0x6')][_0xe0b0('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x11')});};};ami[_0xe0b0('0x12')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':_0xe0b0('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'sippeerstatus'});};};ami[_0xe0b0('0x14')]=function(){return function(){return ami[_0xe0b0('0x10')]({'action':'queuesummary'});};};ami[_0xe0b0('0x15')]=function(){return function(){return ami['Action']({'action':_0xe0b0('0x16')});};};function connect(_0x100204){logger['info'](util['format'](_0xe0b0('0x17'),config['asterisk']['username'],config['asterisk']['ip'],config[_0xe0b0('0x6')]['port']));ami['once'](_0xe0b0('0xc'),error);ami['once'](_0xe0b0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0xe0b0('0x19'),function(_0x1cd7c4){logger[_0xe0b0('0x1a')](util[_0xe0b0('0xf')](_0xe0b0('0x1b'),config['asterisk']['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')],util[_0xe0b0('0xe')](_0x1cd7c4,![],null)));});ami['on']('fullybooted',function(_0x170ad8){logger['info'](util[_0xe0b0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe0b0('0x6')]['username'],config[_0xe0b0('0x6')]['ip'],config['asterisk'][_0xe0b0('0x7')]));return BPromise['resolve']()[_0xe0b0('0x1c')](ami['actionSipShowRegistry']())[_0xe0b0('0x1c')](ami[_0xe0b0('0x12')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x1d')]())[_0xe0b0('0x1c')](ami[_0xe0b0('0x14')]())['then'](ami[_0xe0b0('0x15')]())[_0xe0b0('0x1e')](function(_0x5b7a64){logger[_0xe0b0('0xc')](_0xe0b0('0x1f'),util[_0xe0b0('0xe')](_0x5b7a64,{'showHidden':![],'depth':null}));});});ami[_0xe0b0('0x20')](_0xe0b0('0xc'),error);ami[_0xe0b0('0x20')](_0xe0b0('0x18'),close);module['exports']=ami; \ No newline at end of file +var _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2032,0xd9));var _0x2203=function(_0x15eaa4,_0x4c1f83){_0x15eaa4=_0x15eaa4-0x0;var _0x36dfe8=_0x2032[_0x15eaa4];return _0x36dfe8;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 76aade3..3ea1890 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x3a0aa4,_0x1f6caa){var _0x2f4ffb=function(_0x544cb4){while(--_0x544cb4){_0x3a0aa4['push'](_0x3a0aa4['shift']());}};_0x2f4ffb(++_0x1f6caa);}(_0xaa88,0x137));var _0x8aa8=function(_0x1e8b1e,_0x407bbd){_0x1e8b1e=_0x1e8b1e-0x0;var _0x4a0fde=_0xaa88[_0x1e8b1e];return _0x4a0fde;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file +var _0xf4eb=['rpc','error','message','result','exports','jayson/promise','http','request','then','debug','memberReport'];(function(_0x27897f,_0x14bcc2){var _0x3f79d6=function(_0x580e2c){while(--_0x580e2c){_0x27897f['push'](_0x27897f['shift']());}};_0x3f79d6(++_0x14bcc2);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5169d5,_0x54fe3d){_0x5169d5=_0x5169d5-0x0;var _0x130d16=_0xf4eb[_0x5169d5];return _0x130d16;};'use strict';var jayson=require(_0xbf4e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson['client'][_0xbf4e('0x1')]({'port':0x2329});client['Request']=function(_0x4e7fa7,_0x2e3070){return new BPromise(function(_0x1c7606,_0x32d1d7){return client[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070)[_0xbf4e('0x3')](function(_0x2fcfed){logger[_0xbf4e('0x4')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x2e3070,_0x2fcfed);if(_0x2fcfed['error']){logger['error'](_0xbf4e('0x6'),_0xbf4e('0x5'),_0x4e7fa7,_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')],_0x2e3070);return _0x32d1d7(_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')]);}else{return _0x1c7606(_0x2fcfed[_0xbf4e('0x9')]);}})['catch'](function(_0x4d9a07){logger[_0xbf4e('0x7')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x4d9a07,_0x2e3070);return _0x32d1d7(_0x4d9a07);});});};module[_0xbf4e('0xa')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 78b1b6a..db2be74 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf1e9=['lodash','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','exports','util'];(function(_0x1a5f91,_0x5b7900){var _0x23369a=function(_0x2913db){while(--_0x2913db){_0x1a5f91['push'](_0x1a5f91['shift']());}};_0x23369a(++_0x5b7900);}(_0xf1e9,0x1cd));var _0x9f1e=function(_0x1fdf60,_0x17a432){_0x1fdf60=_0x1fdf60-0x0;var _0x5d0cf5=_0xf1e9[_0x1fdf60];return _0x5d0cf5;};'use strict';var util=require(_0x9f1e('0x0'));var _=require(_0x9f1e('0x1'));var moment=require('moment');function checkNameSurname(_0x178b1c,_0x2078d8,_0x5ae199){var _0x4a5ae0='';if(!_[_0x9f1e('0x2')](_0x2078d8)&&_0x9f1e('0x3')===typeof _0x2078d8){_0x4a5ae0+=_0x2078d8;}if(!_[_0x9f1e('0x2')](_0x5ae199)&&_0x9f1e('0x3')===typeof _0x5ae199){_0x4a5ae0+='\x20'+_0x5ae199;}if(_0x4a5ae0!==''){return _0x4a5ae0;}return _0x178b1c;}function Action(_0x113869,_0x3bb133,_0x2d43e0){this[_0x9f1e('0x4')]=_0x113869;this[_0x9f1e('0x5')]=_0x2d43e0||undefined;this[_0x9f1e('0x6')]=checkNameSurname(_0x3bb133[_0x9f1e('0x7')][_0x9f1e('0x8')],_0x3bb133['Contact'][_0x9f1e('0x9')],_0x3bb133[_0x9f1e('0x7')][_0x9f1e('0xa')]);this[_0x9f1e('0xb')]=_0x3bb133[_0x9f1e('0x8')];this[_0x9f1e('0xc')]=_0x113869[_0x9f1e('0x6')];this['active']=_0x3bb133[_0x9f1e('0xd')]||![];this[_0x9f1e('0xe')]=_0x113869[_0x9f1e('0xe')];this['dialQueueTimeout']=_0x113869[_0x9f1e('0xf')]||0x3;this[_0x9f1e('0x10')]=_0x3bb133[_0x9f1e('0x10')];this[_0x9f1e('0x11')]=_0x3bb133[_0x9f1e('0x11')];this[_0x9f1e('0x12')]=_0x3bb133[_0x9f1e('0x12')];this['countnoanswerretry']=_0x3bb133[_0x9f1e('0x13')];this[_0x9f1e('0x14')]=_0x3bb133['countnosuchnumberretry'];this[_0x9f1e('0x15')]=_0x3bb133[_0x9f1e('0x15')];this[_0x9f1e('0x16')]=_0x3bb133[_0x9f1e('0x16')];this[_0x9f1e('0x17')]=_0x3bb133[_0x9f1e('0x17')];this['countagentrejectretry']=_0x3bb133[_0x9f1e('0x18')];this[_0x9f1e('0x19')]=_0x3bb133[_0x9f1e('0x19')];this[_0x9f1e('0x1a')]=_0x3bb133[_0x9f1e('0x1a')];this['UserId']=_0x3bb133[_0x9f1e('0x1b')];this[_0x9f1e('0x1c')]=_0x3bb133['VoiceQueueId'];this[_0x9f1e('0x1d')]=_0x3bb133[_0x9f1e('0x1d')];this['idHopper']=_0x3bb133['id'];this['ContactFirstName']=_0x3bb133[_0x9f1e('0x7')][_0x9f1e('0x9')]||'';this['starttime']=moment()[_0x9f1e('0x1e')](_0x9f1e('0x1f'));this[_0x9f1e('0x20')]=_0x3bb133['callback'];this[_0x9f1e('0x21')]=_0x3bb133[_0x9f1e('0x21')];this['callbackat']=_0x3bb133['callbackat'];this[_0x9f1e('0x22')]=_0x3bb133[_0x9f1e('0x22')];this[_0x9f1e('0x23')]='';this[_0x9f1e('0x24')]='';}Action[_0x9f1e('0x25')][_0x9f1e('0x26')]=function(){return util[_0x9f1e('0x1e')](_0x9f1e('0x27'),this[_0x9f1e('0x6')],this[_0x9f1e('0x4')]['dialCutDigit']>0x0?this[_0x9f1e('0xb')][_0x9f1e('0x28')](this['voiceQueue']['dialCutDigit']):this[_0x9f1e('0xb')]);};Action[_0x9f1e('0x25')]['getQueue']=function(){return this[_0x9f1e('0xc')];};module[_0x9f1e('0x29')]=Action; \ No newline at end of file +var _0x8489=['number','substring','voiceQueue','prototype','getQueue','queue','exports','util','lodash','moment','string','uniqueid','phone','Contact','firstName','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','\x22%s\x22\x20<%s>','dialCutDigit'];(function(_0x230afe,_0x1d25ff){var _0x2308fe=function(_0x357178){while(--_0x357178){_0x230afe['push'](_0x230afe['shift']());}};_0x2308fe(++_0x1d25ff);}(_0x8489,0x8b));var _0x9848=function(_0x4ddac3,_0x5143db){_0x4ddac3=_0x4ddac3-0x0;var _0x25a1a8=_0x8489[_0x4ddac3];return _0x25a1a8;};'use strict';var util=require(_0x9848('0x0'));var _=require(_0x9848('0x1'));var moment=require(_0x9848('0x2'));function checkNameSurname(_0x5a20b3,_0x460e4f,_0x30ad6d){var _0x449518='';if(!_['isNil'](_0x460e4f)&&_0x9848('0x3')===typeof _0x460e4f){_0x449518+=_0x460e4f;}if(!_['isNil'](_0x30ad6d)&&_0x9848('0x3')===typeof _0x30ad6d){_0x449518+='\x20'+_0x30ad6d;}if(_0x449518!==''){return _0x449518;}return _0x5a20b3;}function Action(_0x116f8e,_0x1c1795,_0x36a689){this['voiceQueue']=_0x116f8e;this[_0x9848('0x4')]=_0x36a689||undefined;this['name']=checkNameSurname(_0x1c1795['Contact'][_0x9848('0x5')],_0x1c1795[_0x9848('0x6')][_0x9848('0x7')],_0x1c1795[_0x9848('0x6')][_0x9848('0x8')]);this['number']=_0x1c1795[_0x9848('0x5')];this['queue']=_0x116f8e['name'];this['active']=_0x1c1795[_0x9848('0x9')]||![];this[_0x9848('0xa')]=_0x116f8e[_0x9848('0xa')];this[_0x9848('0xb')]=_0x116f8e[_0x9848('0xb')]||0x3;this['scheduledat']=_0x1c1795[_0x9848('0xc')];this[_0x9848('0xd')]=_0x1c1795[_0x9848('0xd')];this[_0x9848('0xe')]=_0x1c1795['countcongestionretry'];this['countnoanswerretry']=_0x1c1795[_0x9848('0xf')];this[_0x9848('0x10')]=_0x1c1795[_0x9848('0x10')];this[_0x9848('0x11')]=_0x1c1795['countdropretry'];this['countabandonedretry']=_0x1c1795[_0x9848('0x12')];this[_0x9848('0x13')]=_0x1c1795['countmachineretry'];this['countagentrejectretry']=_0x1c1795[_0x9848('0x14')];this[_0x9848('0x15')]=_0x1c1795[_0x9848('0x15')];this['ListId']=_0x1c1795[_0x9848('0x16')];this[_0x9848('0x17')]=_0x1c1795['UserId'];this[_0x9848('0x18')]=_0x1c1795[_0x9848('0x18')];this[_0x9848('0x19')]=_0x1c1795[_0x9848('0x19')];this['idHopper']=_0x1c1795['id'];this[_0x9848('0x1a')]=_0x1c1795[_0x9848('0x6')]['firstName']||'';this[_0x9848('0x1b')]=moment()[_0x9848('0x1c')](_0x9848('0x1d'));this[_0x9848('0x1e')]=_0x1c1795[_0x9848('0x1e')];this[_0x9848('0x1f')]=_0x1c1795['callbackuniqueid'];this[_0x9848('0x20')]=_0x1c1795[_0x9848('0x20')];this['recallme']=_0x1c1795[_0x9848('0x21')];this[_0x9848('0x22')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0x9848('0x1c')](_0x9848('0x23'),this['name'],this['voiceQueue'][_0x9848('0x24')]>0x0?this[_0x9848('0x25')][_0x9848('0x26')](this[_0x9848('0x27')]['dialCutDigit']):this[_0x9848('0x25')]);};Action[_0x9848('0x28')][_0x9848('0x29')]=function(){return this[_0x9848('0x2a')];};module[_0x9848('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/additionalPhone.js b/server/services/ami/dialer/additionalPhone.js index a287a0e..d884556 100644 --- a/server/services/ami/dialer/additionalPhone.js +++ b/server/services/ami/dialer/additionalPhone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x494c=['seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','milliseconds'];(function(_0x419aa4,_0x5926a7){var _0x557d9b=function(_0x43c9ac){while(--_0x43c9ac){_0x419aa4['push'](_0x419aa4['shift']());}};_0x557d9b(++_0x5926a7);}(_0x494c,0xe2));var _0xc494=function(_0x45b747,_0x47c9a3){_0x45b747=_0x45b747-0x0;var _0x31afea=_0x494c[_0x45b747];return _0x31afea;};'use strict';var util=require('util');var _=require(_0xc494('0x0'));var moment=require('moment');function getSeconds(_0x40b9ef,_0xd1b85c){var _0x4d749e=moment(_0x40b9ef)[_0xc494('0x1')](0x0);var _0x58e755=moment(_0xd1b85c)['milliseconds'](0x0);return _0x4d749e['diff'](_0x58e755,_0xc494('0x2'));}function AdditionalPhone(_0x5edb70){this[_0xc494('0x3')]=_0x5edb70[_0xc494('0x3')];this[_0xc494('0x4')]=_0x5edb70[_0xc494('0x4')]||undefined;this['type']=_0x5edb70[_0xc494('0x5')];this[_0xc494('0x6')]=_0x5edb70[_0xc494('0x5')]===_0xc494('0x7')?_0xc494('0x8'):_0x5edb70['type'];this[_0xc494('0x9')]=_0x5edb70[_0xc494('0x9')];this[_0xc494('0xa')]=_0x5edb70['countcongestionretry'];this['countnoanswerretry']=_0x5edb70[_0xc494('0xb')];this[_0xc494('0xc')]=_0x5edb70[_0xc494('0x9')]+_0x5edb70[_0xc494('0xa')]+_0x5edb70[_0xc494('0xb')]+_0x5edb70[_0xc494('0xd')]+_0x5edb70[_0xc494('0xe')]+_0x5edb70[_0xc494('0xf')]+_0x5edb70[_0xc494('0x10')]+_0x5edb70['countagentrejectretry'];this['countnosuchnumberretry']=_0x5edb70[_0xc494('0xd')];this['countdropretry']=_0x5edb70['countdropretry'];this[_0xc494('0xf')]=_0x5edb70[_0xc494('0xf')];this[_0xc494('0x10')]=_0x5edb70['countmachineretry'];this[_0xc494('0x11')]=_0x5edb70[_0xc494('0x11')];this[_0xc494('0x8')]=_0x5edb70[_0xc494('0x8')];this[_0xc494('0x12')]=_0x5edb70[_0xc494('0x13')];this['calleridnum']=_0x5edb70[_0xc494('0x14')];this[_0xc494('0x15')]=_0x5edb70[_0xc494('0x15')];this['responsetime']=_0x5edb70[_0xc494('0x16')];this[_0xc494('0x17')]=_0x5edb70['responsetime'];this[_0xc494('0x18')]=getSeconds(_0x5edb70[_0xc494('0x16')],_0x5edb70[_0xc494('0x15')]);this[_0xc494('0x19')]=0x0;this[_0xc494('0x1a')]=0x0;this['callback']=_0x5edb70[_0xc494('0x1b')];this[_0xc494('0x1c')]=_0x5edb70[_0xc494('0x1c')];this[_0xc494('0x1d')]=_0x5edb70[_0xc494('0x1d')];this[_0xc494('0x1e')]=_0x5edb70[_0xc494('0x1e')];this[_0xc494('0x1f')]=_0x5edb70[_0xc494('0x1f')];this[_0xc494('0x20')]=_0x5edb70[_0xc494('0x20')];this[_0xc494('0x21')]=_0x5edb70[_0xc494('0x21')];this[_0xc494('0x22')]=_0x5edb70[_0xc494('0x22')];this[_0xc494('0x23')]=_0x5edb70[_0xc494('0x23')];this[_0xc494('0x24')]=_0x5edb70[_0xc494('0x24')]||'';this[_0xc494('0x25')]=_0x5edb70[_0xc494('0x25')]||'';}module['exports']=History; \ No newline at end of file +var _0x86b5=['countagentrejectretry','calleridnum','number','starttime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x2e5eb6,_0x47a7ca){var _0x1c2bbc=function(_0x44fb93){while(--_0x44fb93){_0x2e5eb6['push'](_0x2e5eb6['shift']());}};_0x1c2bbc(++_0x47a7ca);}(_0x86b5,0x88));var _0x586b=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0x86b5[_0x2b55b5];return _0x103d28;};'use strict';var util=require(_0x586b('0x0'));var _=require(_0x586b('0x1'));var moment=require(_0x586b('0x2'));function getSeconds(_0x5c009b,_0x219758){var _0x1427af=moment(_0x5c009b)['milliseconds'](0x0);var _0x583176=moment(_0x219758)[_0x586b('0x3')](0x0);return _0x1427af[_0x586b('0x4')](_0x583176,_0x586b('0x5'));}function AdditionalPhone(_0x3ac844){this[_0x586b('0x6')]=_0x3ac844[_0x586b('0x6')];this[_0x586b('0x7')]=_0x3ac844[_0x586b('0x7')]||undefined;this[_0x586b('0x8')]=_0x3ac844[_0x586b('0x8')];this[_0x586b('0x9')]=_0x3ac844[_0x586b('0x8')]===_0x586b('0xa')?_0x586b('0xb'):_0x3ac844[_0x586b('0x8')];this[_0x586b('0xc')]=_0x3ac844[_0x586b('0xc')];this['countcongestionretry']=_0x3ac844[_0x586b('0xd')];this['countnoanswerretry']=_0x3ac844['countnoanswerretry'];this[_0x586b('0xe')]=_0x3ac844[_0x586b('0xc')]+_0x3ac844[_0x586b('0xd')]+_0x3ac844[_0x586b('0xf')]+_0x3ac844[_0x586b('0x10')]+_0x3ac844[_0x586b('0x11')]+_0x3ac844[_0x586b('0x12')]+_0x3ac844[_0x586b('0x13')]+_0x3ac844[_0x586b('0x14')];this[_0x586b('0x10')]=_0x3ac844[_0x586b('0x10')];this[_0x586b('0x11')]=_0x3ac844[_0x586b('0x11')];this[_0x586b('0x12')]=_0x3ac844['countabandonedretry'];this[_0x586b('0x13')]=_0x3ac844[_0x586b('0x13')];this[_0x586b('0x14')]=_0x3ac844['countagentrejectretry'];this[_0x586b('0xb')]=_0x3ac844[_0x586b('0xb')];this['calleridname']=_0x3ac844['name'];this[_0x586b('0x15')]=_0x3ac844[_0x586b('0x16')];this[_0x586b('0x17')]=_0x3ac844['starttime'];this['responsetime']=_0x3ac844[_0x586b('0x18')];this['endtime']=_0x3ac844[_0x586b('0x18')];this[_0x586b('0x19')]=getSeconds(_0x3ac844['responsetime'],_0x3ac844['starttime']);this['holdtime']=0x0;this[_0x586b('0x1a')]=0x0;this['callback']=_0x3ac844[_0x586b('0x1b')];this[_0x586b('0x1c')]=_0x3ac844[_0x586b('0x1c')];this[_0x586b('0x1d')]=_0x3ac844[_0x586b('0x1d')];this[_0x586b('0x1e')]=_0x3ac844[_0x586b('0x1e')];this[_0x586b('0x1f')]=_0x3ac844[_0x586b('0x1f')];this[_0x586b('0x20')]=_0x3ac844[_0x586b('0x20')];this[_0x586b('0x21')]=_0x3ac844[_0x586b('0x21')];this[_0x586b('0x22')]=_0x3ac844['VoiceQueueId'];this[_0x586b('0x23')]=_0x3ac844[_0x586b('0x23')];this[_0x586b('0x24')]=_0x3ac844[_0x586b('0x24')]||'';this[_0x586b('0x25')]=_0x3ac844[_0x586b('0x25')]||'';}module[_0x586b('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 0bac2fb..7f09b32 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb78=['reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','endtime'];(function(_0x27fb89,_0x1c9753){var _0x1df79b=function(_0xe0d296){while(--_0xe0d296){_0x27fb89['push'](_0x27fb89['shift']());}};_0x1df79b(++_0x1c9753);}(_0xdb78,0x87));var _0x8db7=function(_0x4a38f3,_0x46363e){_0x4a38f3=_0x4a38f3-0x0;var _0x34120e=_0xdb78[_0x4a38f3];return _0x34120e;};'use strict';var util=require(_0x8db7('0x0'));var _=require(_0x8db7('0x1'));var moment=require(_0x8db7('0x2'));function getSeconds(_0x170329,_0x130472){var _0x1dad36=moment(_0x170329)[_0x8db7('0x3')](0x0);var _0xfff8a0=moment(_0x130472)[_0x8db7('0x3')](0x0);return _0x1dad36[_0x8db7('0x4')](_0xfff8a0,_0x8db7('0x5'));}function AgentComplete(_0x3ed7a1,_0x584d1f){this[_0x8db7('0x6')]=0x4;this[_0x8db7('0x7')]='Answer';this['scheduledat']=_0x3ed7a1[_0x8db7('0x8')];this[_0x8db7('0x9')]=_0x3ed7a1[_0x8db7('0x9')];this[_0x8db7('0xa')]=_0x3ed7a1[_0x8db7('0x9')]===_0x8db7('0xb')?_0x8db7('0xc'):_0x3ed7a1[_0x8db7('0x9')];this[_0x8db7('0xd')]=_0x3ed7a1['countbusyretry'];this['countcongestionretry']=_0x3ed7a1[_0x8db7('0xe')];this[_0x8db7('0xf')]=_0x3ed7a1[_0x8db7('0xf')];this[_0x8db7('0x10')]=_0x3ed7a1['countbusyretry']+_0x3ed7a1['countcongestionretry']+_0x3ed7a1[_0x8db7('0xf')]+_0x3ed7a1[_0x8db7('0x11')]+_0x3ed7a1[_0x8db7('0x12')]+_0x3ed7a1[_0x8db7('0x13')]+_0x3ed7a1[_0x8db7('0x14')]+_0x3ed7a1[_0x8db7('0x15')];this[_0x8db7('0x11')]=_0x3ed7a1[_0x8db7('0x11')];this[_0x8db7('0x12')]=_0x3ed7a1[_0x8db7('0x12')];this['countabandonedretry']=_0x3ed7a1[_0x8db7('0x13')];this['countmachineretry']=_0x3ed7a1[_0x8db7('0x14')];this[_0x8db7('0x15')]=_0x3ed7a1[_0x8db7('0x15')];this[_0x8db7('0x16')]=_0x584d1f[_0x8db7('0x16')];this['calleridname']=_0x3ed7a1['name'];this['calleridnum']=_0x3ed7a1[_0x8db7('0x17')];this[_0x8db7('0x18')]=_0x3ed7a1[_0x8db7('0x18')];this[_0x8db7('0x19')]=_0x3ed7a1[_0x8db7('0x19')];this[_0x8db7('0x1a')]=_0x3ed7a1[_0x8db7('0x1a')];this['endtime']=moment()['format'](_0x8db7('0x1b'));this['ringtime']=getSeconds(_0x3ed7a1[_0x8db7('0x19')],_0x3ed7a1['starttime']);this['holdtime']=getSeconds(_0x3ed7a1[_0x8db7('0x1a')],_0x3ed7a1[_0x8db7('0x19')]);this['talktime']=getSeconds(this[_0x8db7('0x1c')],_0x3ed7a1[_0x8db7('0x1a')]);this['queue']=_0x584d1f[_0x8db7('0xc')];this['membername']=_0x584d1f['membername'];this[_0x8db7('0x1d')]=_0x584d1f[_0x8db7('0x1d')];this[_0x8db7('0x1e')]=_0x3ed7a1['callback'];this[_0x8db7('0x1f')]=_0x3ed7a1[_0x8db7('0x1f')];this[_0x8db7('0x20')]=_0x3ed7a1[_0x8db7('0x20')];this[_0x8db7('0x21')]=_0x3ed7a1[_0x8db7('0x21')];this[_0x8db7('0x22')]=_0x3ed7a1[_0x8db7('0x22')];this[_0x8db7('0x23')]=_0x3ed7a1[_0x8db7('0x23')];this[_0x8db7('0x24')]=_0x3ed7a1[_0x8db7('0x24')];this['VoiceQueueId']=_0x3ed7a1[_0x8db7('0x25')];this['CampaignId']=_0x3ed7a1['CampaignId'];this['originatecalleridnum']=_0x3ed7a1[_0x8db7('0x26')]||'';this['originatecalleridname']=_0x3ed7a1[_0x8db7('0x27')]||'';}module[_0x8db7('0x28')]=AgentComplete; \ No newline at end of file +var _0x09dd=['answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','holdtime','talktime','queue','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x09dd,0x1aa));var _0xd09d=function(_0x12e075,_0x2f6b9c){_0x12e075=_0x12e075-0x0;var _0xacd6dd=_0x09dd[_0x12e075];return _0xacd6dd;};'use strict';var util=require(_0xd09d('0x0'));var _=require(_0xd09d('0x1'));var moment=require(_0xd09d('0x2'));function getSeconds(_0x42ce41,_0xed4293){var _0x5f3063=moment(_0x42ce41)[_0xd09d('0x3')](0x0);var _0xb3d0cc=moment(_0xed4293)[_0xd09d('0x3')](0x0);return _0x5f3063['diff'](_0xb3d0cc,_0xd09d('0x4'));}function AgentComplete(_0x59d956,_0x1bd771){this[_0xd09d('0x5')]=0x4;this[_0xd09d('0x6')]=_0xd09d('0x7');this[_0xd09d('0x8')]=_0x59d956[_0xd09d('0x8')];this[_0xd09d('0x9')]=_0x59d956[_0xd09d('0x9')];this[_0xd09d('0xa')]=_0x59d956[_0xd09d('0x9')]==='outbound'?'queue':_0x59d956[_0xd09d('0x9')];this[_0xd09d('0xb')]=_0x59d956[_0xd09d('0xb')];this[_0xd09d('0xc')]=_0x59d956[_0xd09d('0xc')];this[_0xd09d('0xd')]=_0x59d956[_0xd09d('0xd')];this['countglobal']=_0x59d956[_0xd09d('0xb')]+_0x59d956[_0xd09d('0xc')]+_0x59d956[_0xd09d('0xd')]+_0x59d956['countnosuchnumberretry']+_0x59d956[_0xd09d('0xe')]+_0x59d956[_0xd09d('0xf')]+_0x59d956[_0xd09d('0x10')]+_0x59d956[_0xd09d('0x11')];this[_0xd09d('0x12')]=_0x59d956['countnosuchnumberretry'];this[_0xd09d('0xe')]=_0x59d956[_0xd09d('0xe')];this[_0xd09d('0xf')]=_0x59d956['countabandonedretry'];this[_0xd09d('0x10')]=_0x59d956[_0xd09d('0x10')];this[_0xd09d('0x11')]=_0x59d956[_0xd09d('0x11')];this[_0xd09d('0x13')]=_0x1bd771[_0xd09d('0x13')];this[_0xd09d('0x14')]=_0x59d956[_0xd09d('0x15')];this[_0xd09d('0x16')]=_0x59d956['number'];this[_0xd09d('0x17')]=_0x59d956[_0xd09d('0x17')];this['responsetime']=_0x59d956['responsetime'];this[_0xd09d('0x18')]=_0x59d956[_0xd09d('0x18')];this[_0xd09d('0x19')]=moment()['format'](_0xd09d('0x1a'));this[_0xd09d('0x1b')]=getSeconds(_0x59d956[_0xd09d('0x1c')],_0x59d956[_0xd09d('0x17')]);this[_0xd09d('0x1d')]=getSeconds(_0x59d956['answertime'],_0x59d956[_0xd09d('0x1c')]);this[_0xd09d('0x1e')]=getSeconds(this[_0xd09d('0x19')],_0x59d956[_0xd09d('0x18')]);this['queue']=_0x1bd771[_0xd09d('0x1f')];this[_0xd09d('0x20')]=_0x1bd771[_0xd09d('0x20')];this['reason']=_0x1bd771['reason'];this['callback']=_0x59d956[_0xd09d('0x21')];this[_0xd09d('0x22')]=_0x59d956[_0xd09d('0x22')];this[_0xd09d('0x23')]=_0x59d956[_0xd09d('0x23')];this[_0xd09d('0x24')]=_0x59d956[_0xd09d('0x24')];this[_0xd09d('0x25')]=_0x59d956[_0xd09d('0x25')];this[_0xd09d('0x26')]=_0x59d956[_0xd09d('0x26')];this[_0xd09d('0x27')]=_0x59d956['UserId'];this['VoiceQueueId']=_0x59d956[_0xd09d('0x28')];this['CampaignId']=_0x59d956[_0xd09d('0x29')];this[_0xd09d('0x2a')]=_0x59d956[_0xd09d('0x2a')]||'';this[_0xd09d('0x2b')]=_0x59d956[_0xd09d('0x2b')]||'';}module[_0xd09d('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index e6f90f7..18e2279 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c94=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId'];(function(_0x6622a2,_0x401a17){var _0x52252e=function(_0x339759){while(--_0x339759){_0x6622a2['push'](_0x6622a2['shift']());}};_0x52252e(++_0x401a17);}(_0x3c94,0xcd));var _0x43c9=function(_0x2aaa60,_0x22258f){_0x2aaa60=_0x2aaa60-0x0;var _0x2e3fa5=_0x3c94[_0x2aaa60];return _0x2e3fa5;};'use strict';var util=require(_0x43c9('0x0'));var _=require(_0x43c9('0x1'));var moment=require(_0x43c9('0x2'));function getSeconds(_0x20116b,_0x188507){var _0x2da73f=moment(_0x20116b)[_0x43c9('0x3')](0x0);var _0x18159f=moment(_0x188507)[_0x43c9('0x3')](0x0);return _0x2da73f[_0x43c9('0x4')](_0x18159f,_0x43c9('0x5'));}function Final(_0x3da043){this['uniqueid']=_0x3da043[_0x43c9('0x6')];this[_0x43c9('0x7')]=_0x3da043[_0x43c9('0x7')];this[_0x43c9('0x8')]=_0x3da043[_0x43c9('0x8')];this[_0x43c9('0x9')]=_0x3da043[_0x43c9('0x8')]===_0x43c9('0xa')?_0x43c9('0xb'):_0x3da043['type'];this[_0x43c9('0xc')]=_0x3da043[_0x43c9('0xc')];this[_0x43c9('0xd')]=_0x3da043[_0x43c9('0xd')];this[_0x43c9('0xe')]=_0x3da043[_0x43c9('0xe')];this[_0x43c9('0xf')]=_0x3da043[_0x43c9('0xc')]+_0x3da043[_0x43c9('0xd')]+_0x3da043[_0x43c9('0xe')]+_0x3da043[_0x43c9('0x10')]+_0x3da043[_0x43c9('0x11')]+_0x3da043[_0x43c9('0x12')]+_0x3da043[_0x43c9('0x13')]+_0x3da043[_0x43c9('0x14')];this[_0x43c9('0x10')]=_0x3da043[_0x43c9('0x10')];this['countdropretry']=_0x3da043[_0x43c9('0x11')];this[_0x43c9('0x12')]=_0x3da043[_0x43c9('0x12')];this[_0x43c9('0x13')]=_0x3da043[_0x43c9('0x13')];this['countagentrejectretry']=_0x3da043['countagentrejectretry'];this[_0x43c9('0xb')]=_0x3da043[_0x43c9('0xb')];this[_0x43c9('0x15')]=_0x3da043[_0x43c9('0x15')];this['calleridnum']=_0x3da043[_0x43c9('0x16')];this[_0x43c9('0x17')]=_0x3da043[_0x43c9('0x17')];this[_0x43c9('0x18')]=_0x3da043[_0x43c9('0x18')];this[_0x43c9('0x19')]=_0x3da043[_0x43c9('0x18')];this[_0x43c9('0x1a')]=_0x3da043[_0x43c9('0x1a')]||0x0;this[_0x43c9('0x1b')]=_0x3da043[_0x43c9('0x1b')]||0x0;this['talktime']=_0x3da043[_0x43c9('0x1c')]||0x0;this[_0x43c9('0x1d')]=_0x3da043[_0x43c9('0x1d')];this['callbackuniqueid']=_0x3da043[_0x43c9('0x1e')];this[_0x43c9('0x1f')]=_0x3da043[_0x43c9('0x1f')];this['recallme']=_0x3da043[_0x43c9('0x20')];this[_0x43c9('0x21')]=_0x3da043[_0x43c9('0x21')];this['ListId']=_0x3da043['ListId'];this[_0x43c9('0x22')]=_0x3da043[_0x43c9('0x22')];this[_0x43c9('0x23')]=_0x3da043['VoiceQueueId'];this[_0x43c9('0x24')]=_0x3da043[_0x43c9('0x24')];this[_0x43c9('0x25')]=_0x3da043[_0x43c9('0x25')]||'';this[_0x43c9('0x26')]=_0x3da043['originatecalleridname']||'';}module[_0x43c9('0x27')]=Final; \ No newline at end of file +var _0xca9e=['holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','calleridname','calleridnum','responsetime','endtime','ringtime'];(function(_0x69f3c1,_0x2e4abe){var _0x481a11=function(_0x31ee11){while(--_0x31ee11){_0x69f3c1['push'](_0x69f3c1['shift']());}};_0x481a11(++_0x2e4abe);}(_0xca9e,0x136));var _0xeca9=function(_0x52a85c,_0x4abeaa){_0x52a85c=_0x52a85c-0x0;var _0x7829fe=_0xca9e[_0x52a85c];return _0x7829fe;};'use strict';var util=require(_0xeca9('0x0'));var _=require(_0xeca9('0x1'));var moment=require(_0xeca9('0x2'));function getSeconds(_0x1c579d,_0x2df937){var _0x1443e3=moment(_0x1c579d)[_0xeca9('0x3')](0x0);var _0x2c6185=moment(_0x2df937)[_0xeca9('0x3')](0x0);return _0x1443e3[_0xeca9('0x4')](_0x2c6185,_0xeca9('0x5'));}function Final(_0x1c4ce6){this[_0xeca9('0x6')]=_0x1c4ce6[_0xeca9('0x6')];this['scheduledat']=_0x1c4ce6[_0xeca9('0x7')];this[_0xeca9('0x8')]=_0x1c4ce6['type'];this['campaigntype']=_0x1c4ce6[_0xeca9('0x8')]===_0xeca9('0x9')?_0xeca9('0xa'):_0x1c4ce6['type'];this[_0xeca9('0xb')]=_0x1c4ce6[_0xeca9('0xb')];this[_0xeca9('0xc')]=_0x1c4ce6[_0xeca9('0xc')];this[_0xeca9('0xd')]=_0x1c4ce6[_0xeca9('0xd')];this['countglobal']=_0x1c4ce6[_0xeca9('0xb')]+_0x1c4ce6[_0xeca9('0xc')]+_0x1c4ce6['countnoanswerretry']+_0x1c4ce6[_0xeca9('0xe')]+_0x1c4ce6['countdropretry']+_0x1c4ce6[_0xeca9('0xf')]+_0x1c4ce6[_0xeca9('0x10')]+_0x1c4ce6['countagentrejectretry'];this[_0xeca9('0xe')]=_0x1c4ce6[_0xeca9('0xe')];this[_0xeca9('0x11')]=_0x1c4ce6['countdropretry'];this[_0xeca9('0xf')]=_0x1c4ce6[_0xeca9('0xf')];this[_0xeca9('0x10')]=_0x1c4ce6[_0xeca9('0x10')];this['countagentrejectretry']=_0x1c4ce6['countagentrejectretry'];this[_0xeca9('0xa')]=_0x1c4ce6[_0xeca9('0xa')];this['calleridname']=_0x1c4ce6[_0xeca9('0x12')];this[_0xeca9('0x13')]=_0x1c4ce6['calleridnum'];this['starttime']=_0x1c4ce6['starttime'];this[_0xeca9('0x14')]=_0x1c4ce6[_0xeca9('0x14')];this[_0xeca9('0x15')]=_0x1c4ce6['responsetime'];this[_0xeca9('0x16')]=_0x1c4ce6['ringtime']||0x0;this['holdtime']=_0x1c4ce6[_0xeca9('0x17')]||0x0;this['talktime']=_0x1c4ce6[_0xeca9('0x18')]||0x0;this[_0xeca9('0x19')]=_0x1c4ce6['callback'];this[_0xeca9('0x1a')]=_0x1c4ce6[_0xeca9('0x1a')];this['callbackat']=_0x1c4ce6[_0xeca9('0x1b')];this['recallme']=_0x1c4ce6[_0xeca9('0x1c')];this[_0xeca9('0x1d')]=_0x1c4ce6[_0xeca9('0x1d')];this['ListId']=_0x1c4ce6[_0xeca9('0x1e')];this[_0xeca9('0x1f')]=_0x1c4ce6['UserId'];this[_0xeca9('0x20')]=_0x1c4ce6[_0xeca9('0x20')];this[_0xeca9('0x21')]=_0x1c4ce6[_0xeca9('0x21')];this['originatecalleridnum']=_0x1c4ce6[_0xeca9('0x22')]||'';this['originatecalleridname']=_0x1c4ce6[_0xeca9('0x23')]||'';}module[_0xeca9('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index d88885f..90e62e0 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x242f=['endtime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','format','ringtime','holdtime'];(function(_0x46927d,_0x5dec05){var _0x4a8c41=function(_0xefd96d){while(--_0xefd96d){_0x46927d['push'](_0x46927d['shift']());}};_0x4a8c41(++_0x5dec05);}(_0x242f,0x8c));var _0xf242=function(_0x1c00f0,_0x37f2ae){_0x1c00f0=_0x1c00f0-0x0;var _0x1b3bbd=_0x242f[_0x1c00f0];return _0x1b3bbd;};'use strict';var util=require(_0xf242('0x0'));var _=require('lodash');var moment=require(_0xf242('0x1'));function getSeconds(_0x44fafb,_0xf28944){var _0x19a240=moment(_0x44fafb)[_0xf242('0x2')](0x0);var _0x59578b=moment(_0xf28944)[_0xf242('0x2')](0x0);return _0x19a240[_0xf242('0x3')](_0x59578b,_0xf242('0x4'));}function Hangup(_0x108327,_0x2cab45){this['state']=0x4;this['statedesc']=_0xf242('0x5');this[_0xf242('0x6')]=_0x108327[_0xf242('0x6')];this[_0xf242('0x7')]=_0x108327[_0xf242('0x7')];this[_0xf242('0x8')]=_0x108327[_0xf242('0x7')]===_0xf242('0x9')?_0xf242('0xa'):_0x108327[_0xf242('0x7')];this[_0xf242('0xb')]=_0x108327['countbusyretry'];this['countcongestionretry']=_0x108327['countcongestionretry'];this[_0xf242('0xc')]=_0x108327[_0xf242('0xc')];this[_0xf242('0xd')]=_0x108327['countbusyretry']+_0x108327[_0xf242('0xe')]+_0x108327[_0xf242('0xc')]+_0x108327[_0xf242('0xf')]+_0x108327['countdropretry']+_0x108327['countabandonedretry']+_0x108327['countmachineretry']+_0x108327['countagentrejectretry'];this[_0xf242('0xf')]=_0x108327[_0xf242('0xf')];this[_0xf242('0x10')]=_0x108327['countdropretry'];this[_0xf242('0x11')]=_0x108327[_0xf242('0x11')];this[_0xf242('0x12')]=_0x108327['countmachineretry'];this['countagentrejectretry']=_0x108327[_0xf242('0x13')];this[_0xf242('0x14')]=_0x2cab45[_0xf242('0x14')];this['calleridname']=_0x108327[_0xf242('0x15')];this[_0xf242('0x16')]=_0x108327['number'];this[_0xf242('0x17')]=_0x108327[_0xf242('0x17')];this[_0xf242('0x18')]=_0x108327[_0xf242('0x18')];this['endtime']=moment()[_0xf242('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf242('0x1a')]=getSeconds(_0x108327[_0xf242('0x18')],_0x108327[_0xf242('0x17')]);this[_0xf242('0x1b')]=0x0;this['talktime']=getSeconds(this[_0xf242('0x1c')],_0x108327[_0xf242('0x18')]);this[_0xf242('0xa')]=_0x108327[_0xf242('0xa')];this[_0xf242('0x1d')]=_0xf242('0x1e');this['reason']=_0x2cab45[_0xf242('0x1f')];this[_0xf242('0x20')]=_0x108327[_0xf242('0x20')];this[_0xf242('0x21')]=_0x108327[_0xf242('0x21')];this[_0xf242('0x22')]=_0x108327['callbackat'];this[_0xf242('0x23')]=_0x108327[_0xf242('0x23')];this[_0xf242('0x24')]=_0x108327[_0xf242('0x24')];this[_0xf242('0x25')]=_0x108327[_0xf242('0x25')];this[_0xf242('0x26')]=_0x108327['UserId'];this[_0xf242('0x27')]=_0x108327[_0xf242('0x27')];this[_0xf242('0x28')]=_0x108327[_0xf242('0x28')];}module[_0xf242('0x29')]=Hangup; \ No newline at end of file +var _0xef38=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','milliseconds','diff','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0xeeb92,_0x2a08cb){var _0x3f6bab=function(_0xf84e61){while(--_0xf84e61){_0xeeb92['push'](_0xeeb92['shift']());}};_0x3f6bab(++_0x2a08cb);}(_0xef38,0x1e1));var _0x8ef3=function(_0x52c9e5,_0x4862b2){_0x52c9e5=_0x52c9e5-0x0;var _0x101ba7=_0xef38[_0x52c9e5];return _0x101ba7;};'use strict';var util=require(_0x8ef3('0x0'));var _=require(_0x8ef3('0x1'));var moment=require('moment');function getSeconds(_0xd0a72e,_0x4eb920){var _0x1e29b7=moment(_0xd0a72e)[_0x8ef3('0x2')](0x0);var _0x461993=moment(_0x4eb920)[_0x8ef3('0x2')](0x0);return _0x1e29b7[_0x8ef3('0x3')](_0x461993,'seconds');}function Hangup(_0x58bead,_0x22ba66){this[_0x8ef3('0x4')]=0x4;this['statedesc']=_0x8ef3('0x5');this['scheduledat']=_0x58bead[_0x8ef3('0x6')];this['type']=_0x58bead[_0x8ef3('0x7')];this[_0x8ef3('0x8')]=_0x58bead['type']===_0x8ef3('0x9')?_0x8ef3('0xa'):_0x58bead[_0x8ef3('0x7')];this[_0x8ef3('0xb')]=_0x58bead[_0x8ef3('0xb')];this[_0x8ef3('0xc')]=_0x58bead[_0x8ef3('0xc')];this[_0x8ef3('0xd')]=_0x58bead[_0x8ef3('0xd')];this[_0x8ef3('0xe')]=_0x58bead[_0x8ef3('0xb')]+_0x58bead[_0x8ef3('0xc')]+_0x58bead[_0x8ef3('0xd')]+_0x58bead[_0x8ef3('0xf')]+_0x58bead[_0x8ef3('0x10')]+_0x58bead[_0x8ef3('0x11')]+_0x58bead['countmachineretry']+_0x58bead['countagentrejectretry'];this[_0x8ef3('0xf')]=_0x58bead[_0x8ef3('0xf')];this['countdropretry']=_0x58bead[_0x8ef3('0x10')];this[_0x8ef3('0x11')]=_0x58bead[_0x8ef3('0x11')];this[_0x8ef3('0x12')]=_0x58bead['countmachineretry'];this[_0x8ef3('0x13')]=_0x58bead[_0x8ef3('0x13')];this['uniqueid']=_0x22ba66[_0x8ef3('0x14')];this[_0x8ef3('0x15')]=_0x58bead[_0x8ef3('0x16')];this[_0x8ef3('0x17')]=_0x58bead[_0x8ef3('0x18')];this[_0x8ef3('0x19')]=_0x58bead[_0x8ef3('0x19')];this['responsetime']=_0x58bead[_0x8ef3('0x1a')];this[_0x8ef3('0x1b')]=moment()[_0x8ef3('0x1c')](_0x8ef3('0x1d'));this[_0x8ef3('0x1e')]=getSeconds(_0x58bead['responsetime'],_0x58bead[_0x8ef3('0x19')]);this[_0x8ef3('0x1f')]=0x0;this[_0x8ef3('0x20')]=getSeconds(this[_0x8ef3('0x1b')],_0x58bead[_0x8ef3('0x1a')]);this['queue']=_0x58bead[_0x8ef3('0xa')];this[_0x8ef3('0x21')]='IVR';this[_0x8ef3('0x22')]=_0x22ba66[_0x8ef3('0x23')];this[_0x8ef3('0x24')]=_0x58bead[_0x8ef3('0x24')];this[_0x8ef3('0x25')]=_0x58bead[_0x8ef3('0x25')];this[_0x8ef3('0x26')]=_0x58bead['callbackat'];this[_0x8ef3('0x27')]=_0x58bead[_0x8ef3('0x27')];this[_0x8ef3('0x28')]=_0x58bead[_0x8ef3('0x28')];this['ListId']=_0x58bead[_0x8ef3('0x29')];this[_0x8ef3('0x2a')]=_0x58bead[_0x8ef3('0x2a')];this['VoiceQueueId']=_0x58bead[_0x8ef3('0x2b')];this[_0x8ef3('0x2c')]=_0x58bead[_0x8ef3('0x2c')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index be9abd2..55bf17b 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc26e=['starttime','responsetime','endtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','seconds','uniqueid','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','calleridname','name','calleridnum','number'];(function(_0x1c7e86,_0x24906b){var _0x238734=function(_0x4940dd){while(--_0x4940dd){_0x1c7e86['push'](_0x1c7e86['shift']());}};_0x238734(++_0x24906b);}(_0xc26e,0x1e4));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xec26('0x0'));function getSeconds(_0x51708f,_0x383396){var _0x56d355=moment(_0x51708f)[_0xec26('0x1')](0x0);var _0x1d3f63=moment(_0x383396)[_0xec26('0x1')](0x0);return _0x56d355['diff'](_0x1d3f63,_0xec26('0x2'));}function History(_0x4227a6){this[_0xec26('0x3')]=_0x4227a6['uniqueid'];this['scheduledat']=_0x4227a6['scheduledat']||undefined;this[_0xec26('0x4')]=_0x4227a6[_0xec26('0x4')];this['campaigntype']=_0x4227a6[_0xec26('0x4')]===_0xec26('0x5')?_0xec26('0x6'):_0x4227a6[_0xec26('0x4')];this[_0xec26('0x7')]=_0x4227a6[_0xec26('0x7')];this[_0xec26('0x8')]=_0x4227a6[_0xec26('0x8')];this[_0xec26('0x9')]=_0x4227a6[_0xec26('0x9')];this[_0xec26('0xa')]=_0x4227a6[_0xec26('0x7')]+_0x4227a6[_0xec26('0x8')]+_0x4227a6[_0xec26('0x9')]+_0x4227a6['countnosuchnumberretry']+_0x4227a6[_0xec26('0xb')]+_0x4227a6[_0xec26('0xc')]+_0x4227a6['countmachineretry']+_0x4227a6[_0xec26('0xd')];this[_0xec26('0xe')]=_0x4227a6['countnosuchnumberretry'];this[_0xec26('0xb')]=_0x4227a6['countdropretry'];this[_0xec26('0xc')]=_0x4227a6['countabandonedretry'];this[_0xec26('0xf')]=_0x4227a6[_0xec26('0xf')];this[_0xec26('0xd')]=_0x4227a6[_0xec26('0xd')];this[_0xec26('0x6')]=_0x4227a6[_0xec26('0x6')];this[_0xec26('0x10')]=_0x4227a6[_0xec26('0x11')];this[_0xec26('0x12')]=_0x4227a6[_0xec26('0x13')];this[_0xec26('0x14')]=_0x4227a6['starttime'];this[_0xec26('0x15')]=_0x4227a6[_0xec26('0x15')];this[_0xec26('0x16')]=_0x4227a6[_0xec26('0x15')];this['ringtime']=getSeconds(_0x4227a6[_0xec26('0x15')],_0x4227a6['starttime']);this[_0xec26('0x17')]=0x0;this['talktime']=0x0;this[_0xec26('0x18')]=_0x4227a6[_0xec26('0x18')];this[_0xec26('0x19')]=_0x4227a6['callbackuniqueid'];this['callbackat']=_0x4227a6[_0xec26('0x1a')];this[_0xec26('0x1b')]=_0x4227a6[_0xec26('0x1b')];this['ContactId']=_0x4227a6[_0xec26('0x1c')];this[_0xec26('0x1d')]=_0x4227a6[_0xec26('0x1d')];this[_0xec26('0x1e')]=_0x4227a6[_0xec26('0x1e')];this[_0xec26('0x1f')]=_0x4227a6['VoiceQueueId'];this[_0xec26('0x20')]=_0x4227a6[_0xec26('0x20')];this[_0xec26('0x21')]=_0x4227a6[_0xec26('0x21')]||'';this[_0xec26('0x22')]=_0x4227a6[_0xec26('0x22')]||'';}module[_0xec26('0x23')]=History; \ No newline at end of file +var _0xfd17=['seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridname','name','starttime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0xfd17,0x1ad));var _0x7fd1=function(_0x15fc07,_0x41cc0c){_0x15fc07=_0x15fc07-0x0;var _0x3d2c0f=_0xfd17[_0x15fc07];return _0x3d2c0f;};'use strict';var util=require('util');var _=require(_0x7fd1('0x0'));var moment=require('moment');function getSeconds(_0x199800,_0x490879){var _0x1d59df=moment(_0x199800)[_0x7fd1('0x1')](0x0);var _0x2c079=moment(_0x490879)[_0x7fd1('0x1')](0x0);return _0x1d59df[_0x7fd1('0x2')](_0x2c079,_0x7fd1('0x3'));}function History(_0xa2c246){this[_0x7fd1('0x4')]=_0xa2c246[_0x7fd1('0x4')];this[_0x7fd1('0x5')]=_0xa2c246[_0x7fd1('0x5')]||undefined;this[_0x7fd1('0x6')]=_0xa2c246[_0x7fd1('0x6')];this[_0x7fd1('0x7')]=_0xa2c246[_0x7fd1('0x6')]===_0x7fd1('0x8')?_0x7fd1('0x9'):_0xa2c246[_0x7fd1('0x6')];this['countbusyretry']=_0xa2c246['countbusyretry'];this[_0x7fd1('0xa')]=_0xa2c246['countcongestionretry'];this[_0x7fd1('0xb')]=_0xa2c246['countnoanswerretry'];this['countglobal']=_0xa2c246[_0x7fd1('0xc')]+_0xa2c246['countcongestionretry']+_0xa2c246[_0x7fd1('0xb')]+_0xa2c246['countnosuchnumberretry']+_0xa2c246[_0x7fd1('0xd')]+_0xa2c246['countabandonedretry']+_0xa2c246[_0x7fd1('0xe')]+_0xa2c246[_0x7fd1('0xf')];this['countnosuchnumberretry']=_0xa2c246[_0x7fd1('0x10')];this[_0x7fd1('0xd')]=_0xa2c246[_0x7fd1('0xd')];this[_0x7fd1('0x11')]=_0xa2c246[_0x7fd1('0x11')];this[_0x7fd1('0xe')]=_0xa2c246[_0x7fd1('0xe')];this['countagentrejectretry']=_0xa2c246[_0x7fd1('0xf')];this[_0x7fd1('0x9')]=_0xa2c246[_0x7fd1('0x9')];this[_0x7fd1('0x12')]=_0xa2c246[_0x7fd1('0x13')];this['calleridnum']=_0xa2c246['number'];this[_0x7fd1('0x14')]=_0xa2c246[_0x7fd1('0x14')];this[_0x7fd1('0x15')]=_0xa2c246[_0x7fd1('0x15')];this['endtime']=_0xa2c246[_0x7fd1('0x15')];this[_0x7fd1('0x16')]=getSeconds(_0xa2c246[_0x7fd1('0x15')],_0xa2c246[_0x7fd1('0x14')]);this['holdtime']=0x0;this[_0x7fd1('0x17')]=0x0;this[_0x7fd1('0x18')]=_0xa2c246[_0x7fd1('0x18')];this[_0x7fd1('0x19')]=_0xa2c246['callbackuniqueid'];this[_0x7fd1('0x1a')]=_0xa2c246[_0x7fd1('0x1a')];this['recallme']=_0xa2c246[_0x7fd1('0x1b')];this[_0x7fd1('0x1c')]=_0xa2c246[_0x7fd1('0x1c')];this[_0x7fd1('0x1d')]=_0xa2c246[_0x7fd1('0x1d')];this[_0x7fd1('0x1e')]=_0xa2c246['UserId'];this[_0x7fd1('0x1f')]=_0xa2c246[_0x7fd1('0x1f')];this[_0x7fd1('0x20')]=_0xa2c246[_0x7fd1('0x20')];this[_0x7fd1('0x21')]=_0xa2c246[_0x7fd1('0x21')]||'';this[_0x7fd1('0x22')]=_0xa2c246[_0x7fd1('0x22')]||'';}module[_0x7fd1('0x23')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 94327e7..7a028a6 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 _0x8b5f=['queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','dialDropRetryFrequency','additional','dialDropMaxRetry','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','voiceQueue','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','strategy','locked','paused','stateinterface','rrmemory','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','roundrobin','run','queueBookedRR','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','interval','indexOf','true','iftime\x20%s,%s','content','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','SIP/%s/%s%s','trim','dialCutDigit','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','noanswer','dialNoAnswerRetryFrequency','callAdditionalPhoneAfterMin','reason\x203\x20ringing\x20no\x20answer','Busy','busy','dialBusyRetryFrequency','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','ACTIVE','[handlePredictive][limitChannel]','RUNNING','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\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','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','bluebird','uuid','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','stringify','milliseconds','seconds','type','outbound','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','Trunk','callerid','voice:queue:%s','ivr','format','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','prototype','[uniqueid]','clearZombieChannels','[actions]','isNil','Action','channel','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','countReScheduled','resolve','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact]','Success','active','SIP/%s','status','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','HANGUP','uniqueid','statedesc','HangupInAMD','AMD','emit','custom:amd','[syncHangupInAMD]','value','MACHINE','Machine','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','ListId','[rescheduleContact][Machine]','dialAMDActive','membername','buildObj','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','add','YYYY-MM-DD\x20HH:mm:ss','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime'];(function(_0x4b0139,_0x180cd5){var _0x56e64e=function(_0x23ad0d){while(--_0x23ad0d){_0x4b0139['push'](_0x4b0139['shift']());}};_0x56e64e(++_0x180cd5);}(_0x8b5f,0x106));var _0xf8b5=function(_0x1c7562,_0x182856){_0x1c7562=_0x1c7562-0x0;var _0xe07a72=_0x8b5f[_0x1c7562];return _0xe07a72;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xf8b5('0x0'));var uuid=require(_0xf8b5('0x1'));var moment=require('moment');var rr=require('rr');var md5=require(_0xf8b5('0x2'));var Redis=require('ioredis');var ut=require(_0xf8b5('0x3'));var config=require(_0xf8b5('0x4'));var logger=require(_0xf8b5('0x5'))(_0xf8b5('0x6'));var loggerBooked=require(_0xf8b5('0x5'))(_0xf8b5('0x7'));var loggerPredictive=require(_0xf8b5('0x5'))(_0xf8b5('0x8'));var loggerPredictiveCalls=require(_0xf8b5('0x5'))(_0xf8b5('0x9'));var loggerSyncQueueSummary=require(_0xf8b5('0x5'))(_0xf8b5('0xa'));var ami=require(_0xf8b5('0xb'));config[_0xf8b5('0xc')]=_['defaults'](config[_0xf8b5('0xc')],{'host':_0xf8b5('0xd'),'port':0x18eb});var io=require(_0xf8b5('0xe'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xf8b5('0xf'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0xf8b5('0x10'));var voiceQueueRt=require(_0xf8b5('0x11'));var RpcSetting=require(_0xf8b5('0x12'));var Action=require(_0xf8b5('0x13'));var History=require(_0xf8b5('0x14'));var Final=require(_0xf8b5('0x15'));var AgentComplete=require(_0xf8b5('0x16'));var QueueCallerAbandon=require(_0xf8b5('0x17'));var Hangup=require(_0xf8b5('0x18'));var ipAgi=process[_0xf8b5('0x19')]['XCALLY_IP_AGI']||_0xf8b5('0x1a');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xf8b5('0x1b')]=function(_0x6d4e2e){this[_0xf8b5('0x1c')]=this['tail']?this[_0xf8b5('0x1c')][_0xf8b5('0x1d')](_0x6d4e2e):_0x6d4e2e();};function Dialer(_0xf2f562,_0x18b56e){this[_0xf8b5('0x1e')]=new Sequence();this[_0xf8b5('0x1f')]=_0x18b56e;this[_0xf8b5('0x20')]=_0xf2f562[_0xf8b5('0x20')];this[_0xf8b5('0x21')]=_0xf2f562[_0xf8b5('0x21')];this[_0xf8b5('0x22')]=_0xf2f562['agents'];this[_0xf8b5('0x23')]=_0xf2f562[_0xf8b5('0x23')];this[_0xf8b5('0x24')]=config[_0xf8b5('0x24')]||0x2;this[_0xf8b5('0x25')]={};this[_0xf8b5('0x26')]={};this[_0xf8b5('0x27')]={};this[_0xf8b5('0x28')]={};this['optionPredictive']={};this[_0xf8b5('0x29')]={};this[_0xf8b5('0x2a')]={};this[_0xf8b5('0x2b')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0xf8b5('0x2c'),this[_0xf8b5('0x2d')][_0xf8b5('0x2e')](this));ami['on'](_0xf8b5('0x2f'),this[_0xf8b5('0x30')][_0xf8b5('0x2e')](this));ami['on'](_0xf8b5('0x31'),this[_0xf8b5('0x32')]['bind'](this));ami['on']('agentcomplete',this[_0xf8b5('0x33')][_0xf8b5('0x2e')](this));ami['on'](_0xf8b5('0x34'),this['syncQueueSummary'][_0xf8b5('0x2e')](this));ami['on']('hangup',this[_0xf8b5('0x35')][_0xf8b5('0x2e')](this));ami['on'](_0xf8b5('0x36'),this[_0xf8b5('0x37')]['bind'](this));ami['on']('varset',this[_0xf8b5('0x38')][_0xf8b5('0x2e')](this));ami['on'](_0xf8b5('0x39'),this[_0xf8b5('0x3a')][_0xf8b5('0x2e')](this));ami['on'](_0xf8b5('0x3b'),this[_0xf8b5('0x3c')][_0xf8b5('0x2e')](this));this[_0xf8b5('0x3d')]();this[_0xf8b5('0x3e')]();RpcSetting[_0xf8b5('0x3f')]()[_0xf8b5('0x40')](function(_0xd38377){previewRecallmeReminderInterval=_0xd38377[_0xf8b5('0x41')];});}function isNotNull(_0x766e86){return _0x766e86!==null&&!_['isUndefined'](_0x766e86);}function checkIsLoggedIn(_0x41f4f2,_0x40f3d2){return function(){if(_0x40f3d2<=0x0){_0x41f4f2['message']=_0xf8b5('0x42');throw _0x41f4f2[_0xf8b5('0x43')]+_0xf8b5('0x44');}};}function isActive(_0x584369){return _0x584369;}function checkIsActive(_0x30465d,_0x1e9172){return function(){if(!isActive(_0x1e9172)){_0x30465d[_0xf8b5('0x45')]=_0xf8b5('0x46');throw _0x30465d[_0xf8b5('0x43')]+_0xf8b5('0x47');}};}function checkInterval(_0x3924d5){return function(){if(!isNotNull(_0x3924d5[_0xf8b5('0x48')])){_0x3924d5[_0xf8b5('0x45')]=_0xf8b5('0x49');throw _0x3924d5['name']+_0xf8b5('0x4a');}if(!isNotNull(_0x3924d5[_0xf8b5('0x48')][_0xf8b5('0x4b')])){_0x3924d5[_0xf8b5('0x45')]=_0xf8b5('0x49');throw _0x3924d5[_0xf8b5('0x43')]+_0xf8b5('0x4a');}if(!isNotNull(_[_0xf8b5('0x4c')](_0x3924d5[_0xf8b5('0x48')][_0xf8b5('0x4b')]))){_0x3924d5[_0xf8b5('0x45')]=_0xf8b5('0x49');throw _0x3924d5[_0xf8b5('0x43')]+_0xf8b5('0x4a');}};}function msgResponse(_0x5e1ea4,_0x4eaf75,_0x320666){return{'action':_0x5e1ea4,'response':_0x4eaf75,'message':_0x320666,'stack':_0x320666};}function myreject(_0x32fbb3){return function(_0x3264aa){return _0x32fbb3(msgResponse('[ifTime][Action]',_0xf8b5('0x4d'),JSON[_0xf8b5('0x4e')](_0x3264aa)));};}function getSeconds(_0x167ca3,_0x302f9c){var _0x151107=moment(_0x167ca3)[_0xf8b5('0x4f')](0x0);var _0x4b2e78=moment(_0x302f9c)[_0xf8b5('0x4f')](0x0);return _0x151107['diff'](_0x4b2e78,_0xf8b5('0x50'));}function emit(_0x39d8e4,_0x47d866,_0x2d5eb7){io['to'](_0x39d8e4)['emit'](_0x47d866,_0x2d5eb7);}function emitVoiceQueueSummary(_0x38bdb9){if(_0x38bdb9[_0xf8b5('0x51')]===_0xf8b5('0x52')){var _0x3fb63b={'id':_0x38bdb9['id'],'name':_0x38bdb9[_0xf8b5('0x43')],'strategy':_0x38bdb9['strategy'],'answered':_0x38bdb9['answered'],'available':_0x38bdb9[_0xf8b5('0x53')],'loggedIn':_0x38bdb9[_0xf8b5('0x54')],'pTalking':_0x38bdb9[_0xf8b5('0x55')],'sumBillable':_0x38bdb9[_0xf8b5('0x56')],'sumDuration':_0x38bdb9[_0xf8b5('0x57')],'sumHoldTime':_0x38bdb9[_0xf8b5('0x58')]||0x0,'talking':_0x38bdb9[_0xf8b5('0x59')],'total':_0x38bdb9[_0xf8b5('0x5a')],'type':_0x38bdb9['type'],'unmanaged':_0x38bdb9[_0xf8b5('0x5b')],'abandoned':_0x38bdb9[_0xf8b5('0x5c')],'waiting':_0x38bdb9['waiting'],'loggedInDb':_0x38bdb9[_0xf8b5('0x5d')],'dialActive':_0x38bdb9[_0xf8b5('0x5e')],'dialMethod':_0x38bdb9[_0xf8b5('0x5f')],'dialOriginateCallerIdName':_0x38bdb9[_0xf8b5('0x60')],'dialOriginateCallerIdNumber':_0x38bdb9[_0xf8b5('0x61')],'dialOriginateTimeout':_0x38bdb9[_0xf8b5('0x62')],'dialPrefix':_0x38bdb9[_0xf8b5('0x63')],'outboundAnswerAgiCallsDay':_0x38bdb9[_0xf8b5('0x64')],'outboundAnswerCallsDay':_0x38bdb9[_0xf8b5('0x65')],'outboundBlacklistCallsDay':_0x38bdb9[_0xf8b5('0x66')],'outboundBusyCallsDay':_0x38bdb9[_0xf8b5('0x67')],'outboundCongestionCallsDay':_0x38bdb9['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x38bdb9[_0xf8b5('0x68')],'outboundDropCallsDayCallersExit':_0x38bdb9[_0xf8b5('0x69')],'outboundDropCallsDayTimeout':_0x38bdb9['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x38bdb9[_0xf8b5('0x6a')],'outboundNoSuchCallsDay':_0x38bdb9[_0xf8b5('0x6b')],'outboundOriginateFailureCallsDay':_0x38bdb9[_0xf8b5('0x6c')],'outboundReCallsDay':_0x38bdb9[_0xf8b5('0x6d')],'outboundRejectCallsDay':_0x38bdb9[_0xf8b5('0x6e')],'outboundUnknownCallsDay':_0x38bdb9[_0xf8b5('0x6f')],'predictiveIntervalAnsweredCalls':_0x38bdb9[_0xf8b5('0x70')],'predictiveIntervalAvgHoldtime':_0x38bdb9[_0xf8b5('0x71')],'predictiveIntervalAvgTalktime':_0x38bdb9[_0xf8b5('0x72')],'predictiveIntervalDroppedCallsCallersExit':_0x38bdb9['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x38bdb9[_0xf8b5('0x73')],'predictiveIntervalErlangCalls':_0x38bdb9['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x38bdb9['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x38bdb9[_0xf8b5('0x74')],'predictiveIntervalMultiplicativeFactor':_0x38bdb9[_0xf8b5('0x75')],'predictiveIntervalPauses':_0x38bdb9[_0xf8b5('0x76')],'predictiveIntervalAvailable':_0x38bdb9[_0xf8b5('0x77')],'predictiveIntervalTotalCalls':_0x38bdb9[_0xf8b5('0x78')],'message':_0x38bdb9[_0xf8b5('0x45')],'originated':_0x38bdb9[_0xf8b5('0x79')],'erlangCalls':_0x38bdb9[_0xf8b5('0x7a')],'erlangCallToSecond':_0x38bdb9['erlangCallToSecond'],'erlangAbandonmentRate':_0x38bdb9[_0xf8b5('0x7b')],'erlangBusyFactor':_0x38bdb9['erlangBusyFactor'],'startPredictive':_0x38bdb9['startPredictive'],'startProgressive':_0x38bdb9[_0xf8b5('0x2a')]};if(_0x38bdb9[_0xf8b5('0x7c')]){_0x3fb63b[_0xf8b5('0x7c')]={'id':_0x38bdb9[_0xf8b5('0x7c')]['id'],'name':_0x38bdb9[_0xf8b5('0x7c')][_0xf8b5('0x43')],'active':_0x38bdb9[_0xf8b5('0x7c')]['active'],'callerid':_0x38bdb9['Trunk'][_0xf8b5('0x7d')]};}if(_0x38bdb9[_0xf8b5('0x48')]){_0x3fb63b[_0xf8b5('0x48')]={'id':_0x38bdb9[_0xf8b5('0x48')]['id'],'name':_0x38bdb9[_0xf8b5('0x48')]['name']};}var _0x2ad90b=md5(JSON[_0xf8b5('0x4e')](_0x3fb63b));if(_0x38bdb9['md5']!==_0x2ad90b){_0x38bdb9[_0xf8b5('0x2')]=_0x2ad90b;emit(util['format'](_0xf8b5('0x7e'),_0x3fb63b[_0xf8b5('0x43')]),'voice_queue:save',_0x3fb63b);}}}function emitCampaignSummary(_0x1cea77){if(_0x1cea77[_0xf8b5('0x51')]===_0xf8b5('0x7f')){emit(util[_0xf8b5('0x80')]('campaign:ivr:%s',_0x1cea77[_0xf8b5('0x43')]),_0xf8b5('0x81'),_0x1cea77);}}function checkGetDataPredictive(_0x2d94aa){if(isNotNull(_0x2d94aa)&&!_['isEmpty'](_0x2d94aa)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x83'),_0x2d94aa[_0xf8b5('0x78')]);loggerPredictive['info'](_0xf8b5('0x84'),_0x2d94aa[_0xf8b5('0x70')]);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x85'),_0x2d94aa['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x86'),_0x2d94aa[_0xf8b5('0x87')]);loggerPredictive[_0xf8b5('0x82')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d94aa[_0xf8b5('0x71')]);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x88'),_0x2d94aa[_0xf8b5('0x72')]);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x89'));if(_0x2d94aa['predictiveIntervalTotalCalls']>0x0){if(!_[_0xf8b5('0x8a')](_0x2d94aa[_0xf8b5('0x72')])&&_0x2d94aa[_0xf8b5('0x72')]>0x0){return!![];}loggerPredictive[_0xf8b5('0x82')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x2d94aa[_0xf8b5('0x71')])&&_0x2d94aa[_0xf8b5('0x71')]>0x0){return!![];}loggerPredictive[_0xf8b5('0x82')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x8b'));}}else{loggerPredictive[_0xf8b5('0x82')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x25bc5d){return function(_0x3da597){loggerPredictive[_0xf8b5('0x82')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x8c'),_0x3da597[_0xf8b5('0x7a')]);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x8d'),_0x3da597[_0xf8b5('0x8e')]);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x8f'),_0x3da597[_0xf8b5('0x7b')]);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x90'),_0x3da597[_0xf8b5('0x91')]);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x8f'),_0x3da597[_0xf8b5('0x7b')]);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x89'));_[_0xf8b5('0x92')](_0x25bc5d,_0x3da597);};}function getDiff(_0x33832f){var _0x1b2893=moment()['milliseconds'](0x0);var _0x3117f3=moment(_0x33832f)[_0xf8b5('0x4f')](0x0);return _0x1b2893[_0xf8b5('0x93')](_0x3117f3,_0xf8b5('0x50'));}function ifInterval(_0x2ce45a,_0x56c0b1){if(_[_0xf8b5('0x8a')](_0x56c0b1)){return![];}return getDiff(_0x56c0b1)<_0x2ce45a*0x3c;}function freeVariablesPredictive(_0x34db8f){if(isNotNull(_0x34db8f)){if(!_['isUndefined'](_0x34db8f[_0xf8b5('0x2a')])){_0x34db8f['startProgressive']=undefined;loggerPredictive[_0xf8b5('0x82')](_0x34db8f[_0xf8b5('0x43')],_0xf8b5('0x94'));}if(!_[_0xf8b5('0x8a')](_0x34db8f['startPredictive'])){_0x34db8f['startPredictive']=undefined;loggerPredictive[_0xf8b5('0x82')](_0x34db8f[_0xf8b5('0x43')],_0xf8b5('0x95'));}if(!_[_0xf8b5('0x8a')](_0x34db8f[_0xf8b5('0x96')])){clearInterval(_0x34db8f[_0xf8b5('0x96')]);_0x34db8f['handlePredictive']=undefined;loggerPredictive['info'](_0x34db8f[_0xf8b5('0x43')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x3441b0,_0x5cab8d){if(_0x5cab8d===0x0){return 0x0;}var _0x4076cc=0x1;for(var _0x442d7d=0x1;_0x442d7d<=_0x5cab8d;_0x442d7d+=0x1){_0x4076cc=0x1+_0x4076cc*_0x442d7d/_0x3441b0;}return 0x1/_0x4076cc;}function isVoiceQueueOutbound(_0x4564f2){return _0x4564f2===_0xf8b5('0x52');}function isNotPreview(_0x2aebce){return _0x2aebce!==_0xf8b5('0x1f');}function isCampaignIvr(_0x3afb42){return _0x3afb42===_0xf8b5('0x7f');}function getCallerId(_0x48640b,_0x1b1793,_0x470a7e){if(!_[_0xf8b5('0x8a')](_0x470a7e)&&typeof _0x470a7e==='string'&&!_[_0xf8b5('0x4c')](_0x470a7e)){if(!_[_0xf8b5('0x8a')](_0x1b1793)&&typeof _0x1b1793===_0xf8b5('0x97')&&!_[_0xf8b5('0x4c')](_0x1b1793)){return util[_0xf8b5('0x80')](_0xf8b5('0x98'),_0x1b1793,_0x470a7e);}return util['format'](_0xf8b5('0x98'),_0x470a7e,_0x470a7e);}if(!_[_0xf8b5('0x8a')](_0x48640b)&&typeof _0x48640b==='string'&&!_[_0xf8b5('0x4c')](_0x48640b)){return _0x48640b;}return _0xf8b5('0x99');}function loggerCatchQueueSummary(_0x377446,_0x314cb3){return function(_0x30f701){freeVariablesPredictive(_0x314cb3);emitVoiceQueueSummary(_0x314cb3);emitCampaignSummary(_0x314cb3);loggerSyncQueueSummary[_0xf8b5('0x9a')](_0x377446,util[_0xf8b5('0x9b')](_0x30f701,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4c44ef,_0x43239a){return function(_0x431ace){loggerPredictive[_0xf8b5('0x9a')](_0x43239a[_0xf8b5('0x43')],_0x4c44ef);loggerPredictive[_0xf8b5('0x9a')](_0x431ace[_0xf8b5('0x9c')]);freeVariablesPredictive(_0x43239a);};}function loggerCatch(_0x5b7ff6){return function(_0x4b4825){logger[_0xf8b5('0x9a')](_0x5b7ff6,util[_0xf8b5('0x9b')](_0x4b4825,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3eea98){return _0x3eea98&&!_[_0xf8b5('0x8a')](_0x3eea98)&&_0x3eea98[_0xf8b5('0x9d')]>0x0;}function decremetOriginate(_0x1e7cc9){if(!_[_0xf8b5('0x8a')](_0x1e7cc9)&&_0x1e7cc9!==null){if(typeof _0x1e7cc9['originated']!==_0xf8b5('0x9e')){if(_0x1e7cc9[_0xf8b5('0x79')]>0x0){_0x1e7cc9[_0xf8b5('0x79')]-=0x1;}else{logger[_0xf8b5('0x9a')](_0xf8b5('0x9f'));}}}else{logger[_0xf8b5('0x9a')](_0xf8b5('0xa0'));}}function checkContactLowerLimitOriginate(_0x2b9ef9,_0x5b2bcd,_0x616415){if(_0x5b2bcd>_0x616415){for(var _0x2b08f7=0x0;_0x2b08f7<_0x5b2bcd-_0x616415;_0x2b08f7+=0x1){decremetOriginate(_0x2b9ef9);}}}function loggerGetContactDialer(_0x4774eb,_0x1f6ed9,_0x25ec32){return function(_0x4f32f6){checkContactLowerLimitOriginate(_0x1f6ed9,_0x25ec32,0x0);logger['error'](_0x4774eb,util[_0xf8b5('0x9b')](_0x4f32f6,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x343796){return function(_0x42e551){if(isNotNull(_0x42e551)&&isNotNull(_0x42e551[0x0])){if(_0x42e551[0x0]['contactsRescheduled']>0x0){_0x343796[_0xf8b5('0x45')]=_0xf8b5('0xa1');logger[_0xf8b5('0x82')](_0xf8b5('0xa2')+_0x343796[_0xf8b5('0x43')],_0x42e551[0x0][_0xf8b5('0xa3')],_0xf8b5('0xa4'));}else{_0x343796[_0xf8b5('0x45')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xf8b5('0xa5')+_0x343796[_0xf8b5('0x43')]);}}};}function notSendMessagesQueue(_0x30851a){if(_0x30851a[_0xf8b5('0xa6')]){freeVariablesPredictive(_0x30851a);if(_0x30851a['originated']===0x0&&_0x30851a[_0xf8b5('0x59')]===0x0&&_0x30851a[_0xf8b5('0xa7')]===0x0&&(_0x30851a[_0xf8b5('0x55')]||0x0)===0x0){_0x30851a[_0xf8b5('0xa6')]=![];_0x30851a[_0xf8b5('0x53')]=0x0;_0x30851a[_0xf8b5('0x45')]=_0xf8b5('0x46');loggerSyncQueueSummary['error'](_0xf8b5('0xa8'),_0x30851a[_0xf8b5('0x43')],_0xf8b5('0xa9'));}else{_0x30851a[_0xf8b5('0x45')]=_0xf8b5('0xaa');loggerSyncQueueSummary[_0xf8b5('0x9a')](_0xf8b5('0xa8'),_0x30851a[_0xf8b5('0x43')],_0xf8b5('0xab'));}emitVoiceQueueSummary(_0x30851a);}}function notSendMessagesCampaign(_0x38d963){if(_0x38d963[_0xf8b5('0xa6')]){if(_0x38d963['originated']===0x0){_0x38d963[_0xf8b5('0xa6')]=![];_0x38d963[_0xf8b5('0x45')]=_0xf8b5('0x46');loggerSyncQueueSummary[_0xf8b5('0x9a')](_0xf8b5('0xac'),_0x38d963[_0xf8b5('0x43')],'is\x20not\x20active');}else{_0x38d963[_0xf8b5('0x45')]=_0xf8b5('0xaa');loggerSyncQueueSummary[_0xf8b5('0x9a')](_0xf8b5('0xac'),_0x38d963[_0xf8b5('0x43')],_0xf8b5('0xab'));}emitCampaignSummary(_0x38d963);}}function createObjHistory(_0x2aef0c,_0x13c1ea,_0x554b39,_0x16b670,_0xf35e1d){_0x2aef0c[_0xf8b5('0x45')]=_0x554b39;var _0x2c70ea=new Action(_0x2aef0c,_0x13c1ea);var _0x4c1766=new History(_0x2c70ea);_0x4c1766[_0xf8b5('0xad')]=_0x16b670;_0x4c1766['statedesc']=_0xf35e1d;_0x4c1766[_0xf8b5('0xae')]=_0x2c70ea[_0xf8b5('0xaf')];return _0x4c1766;}Dialer[_0xf8b5('0xb0')][_0xf8b5('0x3e')]=function(){var _0xebf761=this;setInterval(function(){_0xebf761['clearZombieChannels'](_0xebf761['uniqueId'],_0xf8b5('0xb1'));_0xebf761[_0xf8b5('0xb2')](_0xebf761[_0xf8b5('0x26')],_0xf8b5('0xb3'));},0x32c8);};Dialer[_0xf8b5('0xb0')]['clearZombieChannels']=function(_0x373548,_0x136338){var _0x10f948=this;for(var _0x37639d in _0x373548){if(typeof _0x373548[_0x37639d]!=='undefined'){this[_0xf8b5('0x1e')][_0xf8b5('0x1b')](function(){if(!_[_0xf8b5('0xb4')](_0x373548[_0x37639d])){return ami[_0xf8b5('0xb5')]({'action':'status','channel':_0x373548[_0x37639d][_0xf8b5('0xb6')]})['catch'](function(_0x551be9){if(_0x551be9[_0xf8b5('0x45')]===_0xf8b5('0xb7')){setTimeout(function(){if(_0x373548[_0x37639d]&&_0x373548[_0x37639d]['type']!==_0xf8b5('0x7f')){_0x10f948['updateOriginated'](_0x10f948[_0xf8b5('0x20')][_0x373548[_0x37639d][_0xf8b5('0xb8')]]);logger[_0xf8b5('0x9a')](_0xf8b5('0xb9'),_0x136338,_0x37639d,_0x373548[_0x37639d][_0xf8b5('0xb8')]);delete _0x373548[_0x37639d];}if(_0x373548[_0x37639d]&&_0x373548[_0x37639d][_0xf8b5('0x51')]===_0xf8b5('0x7f')){_0x10f948[_0xf8b5('0xba')](_0x10f948[_0xf8b5('0x21')][_0x373548[_0x37639d][_0xf8b5('0xb8')]]);logger[_0xf8b5('0x9a')]('[Dialer][checkChannel][ivr]',_0x136338,_0x37639d,_0x373548[_0x37639d][_0xf8b5('0xb8')]);delete _0x373548[_0x37639d];}},0x2328);}});}});}}};Dialer[_0xf8b5('0xb0')][_0xf8b5('0xbb')]=function(_0x58d2c4){return BPromise[_0xf8b5('0xbc')]()[_0xf8b5('0x40')](cmHopper[_0xf8b5('0xbb')](_0x58d2c4))[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0xbe')));};Dialer[_0xf8b5('0xb0')][_0xf8b5('0xbf')]=function(_0xfaa202){return BPromise[_0xf8b5('0xbc')]()[_0xf8b5('0x40')](cmHopperBlack[_0xf8b5('0xbf')](_0xfaa202))['catch'](loggerCatch(_0xf8b5('0xc0')));};Dialer[_0xf8b5('0xb0')][_0xf8b5('0xc1')]=function(_0x2fea28,_0x442793,_0x1564d3){return BPromise[_0xf8b5('0xbc')]()[_0xf8b5('0x40')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x2fea28,_0x442793,_0x1564d3))[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0xc2')));};Dialer[_0xf8b5('0xb0')][_0xf8b5('0xc3')]=function(_0x1a44cc,_0x28c7a2,_0x122c20){return BPromise[_0xf8b5('0xbc')]()[_0xf8b5('0x40')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x1a44cc,_0x28c7a2,_0x122c20))['catch'](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0xf8b5('0xb0')][_0xf8b5('0xc4')]=function(_0x27612d){return BPromise[_0xf8b5('0xbc')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x27612d))[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0xc5')));};Dialer[_0xf8b5('0xb0')][_0xf8b5('0xc6')]=function(_0x528fe9){return BPromise['resolve']()['then'](cmHopperHistory['avgHandleTime'](_0x528fe9))[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0xc7')));};Dialer[_0xf8b5('0xb0')]['rescheduleContact']=function(_0x2b17b3){return BPromise['resolve']()['then'](cmHopper[_0xf8b5('0xc8')](_0x2b17b3))['catch'](loggerCatch(_0xf8b5('0xc9')));};Dialer['prototype']['unlockContact']=function(_0x2518a8,_0x26ce7b,_0xe3dae3){return BPromise[_0xf8b5('0xbc')]()[_0xf8b5('0x40')](cmHopper[_0xf8b5('0xca')](_0x2518a8,_0x26ce7b,_0xe3dae3))[_0xf8b5('0xbd')](loggerCatch('[unlockContact]\x20'));};Dialer[_0xf8b5('0xb0')]['getContactDialer']=function(_0x501399,_0x4ef457,_0x9e0484,_0x16bc1b,_0xbb3eeb){return BPromise[_0xf8b5('0xbc')]()[_0xf8b5('0x40')](cmHopper['getContactDialer'](_0x501399,_0x4ef457,_0x9e0484,_0x16bc1b))['catch'](function(_0x31d7ff){_0xbb3eeb['temp']-=_0x9e0484;_0xbb3eeb['temp']=_0xbb3eeb[_0xf8b5('0xcb')]>0x0?_0xbb3eeb[_0xf8b5('0xcb')]:0x0;loggerCatch(_0xf8b5('0xcc'))(_0x31d7ff);});};Dialer['prototype'][_0xf8b5('0xcd')]=function(_0x4f471b,_0x50b7cb,_0x2132a3,_0x258568){return BPromise[_0xf8b5('0xbc')]()[_0xf8b5('0x40')](cmHopper[_0xf8b5('0xcd')](_0x4f471b,_0x50b7cb,_0x2132a3))[_0xf8b5('0xbd')](function(_0x3373e9){_0x258568[_0xf8b5('0xcb')]-=_0x50b7cb;_0x258568[_0xf8b5('0xcb')]=_0x258568[_0xf8b5('0xcb')]>0x0?_0x258568[_0xf8b5('0xcb')]:0x0;loggerCatch(_0xf8b5('0xce'))(_0x3373e9);});};Dialer['prototype'][_0xf8b5('0xcf')]=function(_0x329946){return BPromise[_0xf8b5('0xbc')]()[_0xf8b5('0x40')](voiceQueueRt[_0xf8b5('0xcf')](_0x329946))['catch'](loggerCatch(_0xf8b5('0xd0')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x14bec6){return BPromise[_0xf8b5('0xbc')]()[_0xf8b5('0x40')](cmHopper[_0xf8b5('0xd1')](_0x14bec6))[_0xf8b5('0xbd')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xf8b5('0xb0')]['createHistory']=function(_0x22b2ee){return BPromise[_0xf8b5('0xbc')]()['then'](cmHopperHistory[_0xf8b5('0xd2')](_0x22b2ee))[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0xd3')));};Dialer[_0xf8b5('0xb0')][_0xf8b5('0xba')]=function(_0x33c08f){if(!_['isUndefined'](_0x33c08f)&&_0x33c08f!==null){if(typeof _0x33c08f[_0xf8b5('0x79')]!=='undefined'){if(_0x33c08f['originated']>0x0){_0x33c08f[_0xf8b5('0x79')]-=0x1;}else{logger[_0xf8b5('0x9a')](_0xf8b5('0xd4'));}}}else{logger[_0xf8b5('0x9a')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0xf8b5('0xd5')]=function(_0x5492bb,_0x2aedd6){var _0x4bae94=this;return function(_0x52b596){_0x4bae94[_0xf8b5('0xba')](_0x2aedd6);logger[_0xf8b5('0x9a')](_0x5492bb,util[_0xf8b5('0x9b')](_0x52b596,{'showHidden':![],'depth':null}));};};Dialer[_0xf8b5('0xb0')][_0xf8b5('0xd6')]=function(_0x27b58d,_0x26d2ec,_0x56a210){var _0x50dc91={'state':0x19,'statedesc':_0xf8b5('0xd7')};this[_0xf8b5('0xba')](_0x26d2ec);this[_0xf8b5('0xd8')](_[_0xf8b5('0x92')](_0x50dc91,_[_0xf8b5('0xd9')](_0x56a210,[_0xf8b5('0xda'),'ListId',_0xf8b5('0xdb'),_0xf8b5('0xdc'),_0xf8b5('0xdd')])),'[emptyContact][createHistory]',_0xf8b5('0xde'));logger[_0xf8b5('0x9a')](_0x27b58d);};Dialer[_0xf8b5('0xb0')]['isSuccess']=function(_0x42ba44){return _0x42ba44===_0xf8b5('0xdf');};Dialer['prototype']['isTrunkReachable']=function(_0x5010d8){return!_[_0xf8b5('0x8a')](_0x5010d8)&&_0x5010d8&&!_[_0xf8b5('0x8a')](_0x5010d8[_0xf8b5('0x43')])&&!_['isUndefined'](_0x5010d8[_0xf8b5('0xe0')])&&_0x5010d8['active']&&(this[_0xf8b5('0x23')][util[_0xf8b5('0x80')](_0xf8b5('0xe1'),_0x5010d8[_0xf8b5('0x43')])][_0xf8b5('0xe2')]==='reachable'||this[_0xf8b5('0x23')][util['format']('SIP/%s',_0x5010d8[_0xf8b5('0x43')])][_0xf8b5('0xe2')]===_0xf8b5('0xe3'));};Dialer[_0xf8b5('0xb0')]['saveInDb']=function(_0x561f78,_0x329376,_0x508480){this[_0xf8b5('0xd2')](_0x561f78)[_0xf8b5('0xbd')](loggerCatch(_0x329376));this[_0xf8b5('0xd1')](_0x561f78)[_0xf8b5('0xbd')](loggerCatch(_0x508480));};Dialer[_0xf8b5('0xb0')]['syncVarSet']=function(_0x15c7b0){var _0x2d6fde=this['uniqueId'][_0x15c7b0['uniqueid']];var _0x39776b;if(!_[_0xf8b5('0xb4')](_0x15c7b0)&&!_[_0xf8b5('0xb4')](_0x15c7b0['variable'])&&!_[_0xf8b5('0xb4')](_0x15c7b0[_0xf8b5('0xe4')][_0xf8b5('0xe5')])&&_0x15c7b0[_0xf8b5('0xe6')]===_0xf8b5('0xe7')&&_0x2d6fde){if(_0x2d6fde[_0xf8b5('0x51')]!==_0xf8b5('0x7f')&&this[_0xf8b5('0x20')][_0x2d6fde[_0xf8b5('0xb8')]]['dialAMDActive']&&_0x15c7b0['value']===_0xf8b5('0xe8')){delete this['uniqueId'][_0x15c7b0[_0xf8b5('0xe9')]];this[_0xf8b5('0xba')](this[_0xf8b5('0x20')][_0x2d6fde[_0xf8b5('0xb8')]]);this[_0xf8b5('0x20')][_0x2d6fde[_0xf8b5('0xb8')]][_0xf8b5('0x65')]+=0x1;this[_0xf8b5('0x20')][_0x2d6fde[_0xf8b5('0xb8')]][_0xf8b5('0x64')]+=0x1;_0x39776b=new Hangup(_0x2d6fde,_0x15c7b0);_0x39776b[_0xf8b5('0xad')]=0x12;_0x39776b[_0xf8b5('0xea')]=_0xf8b5('0xeb');_0x39776b['membername']=_0xf8b5('0xec');ami[_0xf8b5('0xed')](_0xf8b5('0xee'),ut['buildObj'](_0x39776b,'amd'));this[_0xf8b5('0xd8')](_0x39776b,'[syncHangupInAMD][createHistory]',_0xf8b5('0xef'));}if(_0x2d6fde[_0xf8b5('0x51')]!=='ivr'&&this['voiceQueues'][_0x2d6fde[_0xf8b5('0xb8')]]['dialAMDActive']&&_0x15c7b0[_0xf8b5('0xf0')]===_0xf8b5('0xf1')){var _0x466a18=this;return new BPromise(function(_0x322f73,_0x4e5008){delete _0x466a18[_0xf8b5('0x28')][_0x15c7b0['uniqueid']];_0x466a18[_0xf8b5('0xba')](_0x466a18[_0xf8b5('0x20')][_0x2d6fde[_0xf8b5('0xb8')]]);_0x466a18[_0xf8b5('0x20')][_0x2d6fde[_0xf8b5('0xb8')]]['outboundAnswerCallsDay']+=0x1;_0x466a18[_0xf8b5('0x20')][_0x2d6fde[_0xf8b5('0xb8')]][_0xf8b5('0x64')]+=0x1;var _0x2aefde=_0x466a18[_0xf8b5('0x20')][_0x2d6fde[_0xf8b5('0xb8')]];var _0x1d3c93=new Hangup(_0x2d6fde,_0x15c7b0);_0x1d3c93['state']=0x13;_0x1d3c93[_0xf8b5('0xea')]=_0xf8b5('0xf2');_0x1d3c93['membername']=_0xf8b5('0xec');_0x1d3c93[_0xf8b5('0xf3')]+=0x1;_0x1d3c93[_0xf8b5('0xf4')]+=0x1;_0x1d3c93['amd']=!![];ami[_0xf8b5('0xed')](_0xf8b5('0xee'),ut['buildObj'](_0x1d3c93,_0xf8b5('0xf5')));_0x466a18[_0xf8b5('0xd2')](_0x1d3c93)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0xf6')));if(_0x1d3c93[_0xf8b5('0xf7')]+_0x1d3c93[_0xf8b5('0xf8')]+_0x1d3c93[_0xf8b5('0xf9')]+_0x1d3c93[_0xf8b5('0xfa')]+_0x1d3c93[_0xf8b5('0xfb')]+_0x1d3c93[_0xf8b5('0xfc')]+_0x1d3c93['countmachineretry']+_0x1d3c93[_0xf8b5('0xfd')]>=_0x2aefde[_0xf8b5('0xfe')]){_0x466a18[_0xf8b5('0xff')](_0x1d3c93,_0x322f73,_0x4e5008,_0xf8b5('0x100'));}else{if(_0x1d3c93[_0xf8b5('0xf3')]>=_0x2aefde[_0xf8b5('0x101')]){_0x466a18[_0xf8b5('0x102')](_0x1d3c93,_0x322f73,_0x4e5008,_0xf8b5('0x103'));}else{_0x466a18[_0xf8b5('0xc8')]({'active':![],'countmachineretry':_0x1d3c93[_0xf8b5('0xf3')],'scheduledat':moment()['add'](_0x2aefde[_0xf8b5('0x104')],_0xf8b5('0x105'))[_0xf8b5('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1d3c93[_0xf8b5('0xda')],'ListId':_0x1d3c93[_0xf8b5('0x106')],'VoiceQueueId':_0x1d3c93['VoiceQueueId']||undefined,'CampaignId':_0x1d3c93[_0xf8b5('0xdd')]||undefined})[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x107')));_0x322f73({'reschedule':0x1});}}});}if(_0x2d6fde[_0xf8b5('0x51')]===_0xf8b5('0x7f')&&this[_0xf8b5('0x21')][_0x2d6fde[_0xf8b5('0xb8')]][_0xf8b5('0x108')]&&_0x15c7b0['value']==='HANGUP'){delete this[_0xf8b5('0x28')][_0x15c7b0['uniqueid']];this[_0xf8b5('0xba')](this['campaigns'][_0x2d6fde[_0xf8b5('0xb8')]]);_0x39776b=new Hangup(_0x2d6fde,_0x15c7b0);_0x39776b[_0xf8b5('0xad')]=0x12;_0x39776b['statedesc']='HangupInAMD';_0x39776b[_0xf8b5('0x109')]=_0xf8b5('0xec');ami[_0xf8b5('0xed')]('custom:amd',ut[_0xf8b5('0x10a')](_0x39776b,_0xf8b5('0xf5')));this[_0xf8b5('0xd8')](_0x39776b,_0xf8b5('0x10b'),_0xf8b5('0x10c'));}if(_0x2d6fde[_0xf8b5('0x51')]===_0xf8b5('0x7f')&&this[_0xf8b5('0x21')][_0x2d6fde[_0xf8b5('0xb8')]][_0xf8b5('0x108')]&&_0x15c7b0['value']==='MACHINE'){var _0x466a18=this;return new BPromise(function(_0x49f8e2,_0x497c68){delete _0x466a18[_0xf8b5('0x28')][_0x15c7b0[_0xf8b5('0xe9')]];_0x466a18[_0xf8b5('0xba')](_0x466a18[_0xf8b5('0x21')][_0x2d6fde[_0xf8b5('0xb8')]]);_0x466a18[_0xf8b5('0x21')][_0x2d6fde['queue']][_0xf8b5('0x65')]+=0x1;_0x466a18['campaigns'][_0x2d6fde[_0xf8b5('0xb8')]][_0xf8b5('0x64')]+=0x1;var _0x4c0f22=_0x466a18[_0xf8b5('0x21')][_0x2d6fde[_0xf8b5('0xb8')]];var _0x2bbebe=new Hangup(_0x2d6fde,_0x15c7b0);_0x2bbebe[_0xf8b5('0xad')]=0x13;_0x2bbebe['statedesc']=_0xf8b5('0xf2');_0x2bbebe[_0xf8b5('0x109')]=_0xf8b5('0xec');_0x2bbebe[_0xf8b5('0xf3')]+=0x1;_0x2bbebe[_0xf8b5('0xf4')]+=0x1;_0x2bbebe[_0xf8b5('0xf5')]=!![];ami[_0xf8b5('0xed')](_0xf8b5('0xee'),ut[_0xf8b5('0x10a')](_0x2bbebe,'amd'));_0x466a18[_0xf8b5('0xd2')](_0x2bbebe)[_0xf8b5('0xbd')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2bbebe[_0xf8b5('0xf7')]+_0x2bbebe[_0xf8b5('0xf8')]+_0x2bbebe[_0xf8b5('0xf9')]+_0x2bbebe[_0xf8b5('0xfa')]+_0x2bbebe[_0xf8b5('0xfb')]+_0x2bbebe[_0xf8b5('0xfc')]+_0x2bbebe['countmachineretry']+_0x2bbebe['countagentrejectretry']>=_0x4c0f22[_0xf8b5('0xfe')]){_0x466a18['stateGlobal'](_0x2bbebe,_0x49f8e2,_0x497c68,_0xf8b5('0x100'));}else{if(_0x2bbebe['countmachineretry']>=_0x4c0f22['dialMachineMaxRetry']){_0x466a18[_0xf8b5('0x102')](_0x2bbebe,_0x49f8e2,_0x497c68,_0xf8b5('0x103'));}else{_0x466a18['rescheduleContact']({'active':![],'countmachineretry':_0x2bbebe[_0xf8b5('0xf3')],'scheduledat':moment()[_0xf8b5('0x10d')](_0x4c0f22['dialMachineRetryFrequency'],_0xf8b5('0x105'))['format'](_0xf8b5('0x10e')),'ContactId':_0x2bbebe[_0xf8b5('0xda')],'ListId':_0x2bbebe[_0xf8b5('0x106')],'VoiceQueueId':_0x2bbebe[_0xf8b5('0xdc')]||undefined,'CampaignId':_0x2bbebe['CampaignId']||undefined})[_0xf8b5('0xbd')](loggerCatch('[rescheduleContact][Machine]'));_0x49f8e2({'reschedule':0x1});}}});}}};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x35')]=function(_0x5a7184){var _0x580f7b=this[_0xf8b5('0x28')][_0x5a7184[_0xf8b5('0xe9')]];var _0x4a3830=this;var _0x3d49c5;if(_0x580f7b&&_0x580f7b[_0xf8b5('0x51')]==='ivr'){delete this['uniqueId'][_0x5a7184[_0xf8b5('0xe9')]];this[_0xf8b5('0xba')](this[_0xf8b5('0x21')][_0x580f7b[_0xf8b5('0xb8')]]);this['campaigns'][_0x580f7b['queue']]['ivrAnswerCallsDay']+=0x1;_0x3d49c5=new Hangup(_0x580f7b,_0x5a7184);this[_0xf8b5('0xd2')](_0x3d49c5)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x10f')));this[_0xf8b5('0xd1')](_0x3d49c5)[_0xf8b5('0xbd')](loggerCatch('[syncHangupIvr]'));}if(_0x580f7b&&_0x580f7b['type']!==_0xf8b5('0x7f')&&isNotNull(this[_0xf8b5('0x20')][_0x580f7b[_0xf8b5('0xb8')]][_0xf8b5('0x110')])){delete this['uniqueId'][_0x5a7184[_0xf8b5('0xe9')]];this[_0xf8b5('0xba')](this[_0xf8b5('0x20')][_0x580f7b['queue']]);this[_0xf8b5('0x20')][_0x580f7b['queue']][_0xf8b5('0x65')]+=0x1;this[_0xf8b5('0x20')][_0x580f7b[_0xf8b5('0xb8')]]['outboundAnswerAgiCallsDay']+=0x1;_0x3d49c5=new Hangup(_0x580f7b,_0x5a7184);_0x3d49c5[_0xf8b5('0xad')]=0x10;_0x3d49c5[_0xf8b5('0xea')]=_0xf8b5('0x111');_0x3d49c5[_0xf8b5('0x109')]=_0xf8b5('0x112');this[_0xf8b5('0xd2')](_0x3d49c5)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x10f')));this['moveContactManagedDialer'](_0x3d49c5)['catch'](loggerCatch(_0xf8b5('0x113')));}if(_0x580f7b&&_0x580f7b[_0xf8b5('0x51')]!==_0xf8b5('0x7f')&&!isNotNull(this[_0xf8b5('0x20')][_0x580f7b[_0xf8b5('0xb8')]][_0xf8b5('0x110')])){delete this[_0xf8b5('0x28')][_0x5a7184[_0xf8b5('0xe9')]];this[_0xf8b5('0xba')](this[_0xf8b5('0x20')][_0x580f7b[_0xf8b5('0xb8')]]);this[_0xf8b5('0x20')][_0x580f7b[_0xf8b5('0xb8')]]['outboundUnknownCallsDay']+=0x1;_0x3d49c5=new Hangup(_0x580f7b,_0x5a7184);_0x3d49c5[_0xf8b5('0xad')]=0xc;_0x3d49c5['statedesc']=_0x5a7184[_0xf8b5('0x114')];_0x3d49c5[_0xf8b5('0x109')]=_0xf8b5('0x115');this[_0xf8b5('0xd2')](_0x3d49c5)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x10f')));this[_0xf8b5('0xd1')](_0x3d49c5)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x113')));}};Dialer['prototype'][_0xf8b5('0x33')]=function(_0x2ad16f){var _0xab1777=this['uniqueId'][_0x2ad16f[_0xf8b5('0xe9')]];var _0x4718e8=this;if(this[_0xf8b5('0x20')][_0x2ad16f['queue']]){if(_0xab1777&&_0xab1777['type']!==_0xf8b5('0x7f')){delete this[_0xf8b5('0x28')][_0x2ad16f['uniqueid']];this[_0xf8b5('0x20')][_0x2ad16f['queue']][_0xf8b5('0x65')]+=0x1;var _0x1a0da7=new AgentComplete(_0xab1777,_0x2ad16f);if(_0x2ad16f[_0xf8b5('0x116')]===_0xf8b5('0x117')){_0x1a0da7[_0xf8b5('0x118')]=this[_0xf8b5('0x20')][_0x2ad16f[_0xf8b5('0xb8')]][_0xf8b5('0x119')]&&this['voiceQueues'][_0x2ad16f[_0xf8b5('0xb8')]][_0xf8b5('0x11a')]?moment()[_0xf8b5('0x80')](_0xf8b5('0x10e')):undefined;}this[_0xf8b5('0xd2')](_0x1a0da7)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x11b')));this[_0xf8b5('0xd1')](_0x1a0da7)[_0xf8b5('0xbd')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x2d')]=function(_0x1df438){if(this['voiceQueues'][_0x1df438[_0xf8b5('0xb8')]]){if(this[_0xf8b5('0x28')][_0x1df438[_0xf8b5('0xe9')]]&&this[_0xf8b5('0x28')][_0x1df438[_0xf8b5('0xe9')]][_0xf8b5('0x51')]!==_0xf8b5('0x7f')){this[_0xf8b5('0xba')](this[_0xf8b5('0x20')][_0x1df438['queue']]);this['uniqueId'][_0x1df438[_0xf8b5('0xe9')]][_0xf8b5('0x11c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xf8b5('0x11d')]=function(_0x5d1e58,_0x423d19){this[_0xf8b5('0xd2')](_0x5d1e58)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x11b')));if(_0x423d19==0x0){this[_0xf8b5('0xd1')](_0x5d1e58)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x11e')));}};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x30')]=function(_0x47131d){var _0x2f5b36=this['uniqueId'][_0x47131d['uniqueid']];var _0x53b198=this;var _0x55e81d=![];var _0x39c676;var _0x1d42ee;if(this[_0xf8b5('0x20')][_0x47131d[_0xf8b5('0xb8')]]){if(_0x2f5b36&&_0x2f5b36[_0xf8b5('0x51')]!==_0xf8b5('0x7f')){delete this['uniqueId'][_0x47131d[_0xf8b5('0xe9')]];this[_0xf8b5('0xba')](this[_0xf8b5('0x20')][_0x47131d[_0xf8b5('0xb8')]]);_0x2f5b36[_0xf8b5('0x11f')]=moment()[_0xf8b5('0x80')](_0xf8b5('0x10e'));var _0x347c2a=new QueueCallerAbandon(_0x2f5b36,_0x47131d);if(getSeconds(_0x2f5b36[_0xf8b5('0x11f')],_0x2f5b36[_0xf8b5('0x120')])>=_0x2f5b36[_0xf8b5('0x121')]){this[_0xf8b5('0x20')][_0x47131d[_0xf8b5('0xb8')]][_0xf8b5('0x73')]+=0x1;this[_0xf8b5('0x20')][_0x47131d[_0xf8b5('0xb8')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xf8b5('0x20')][_0x47131d['queue']][_0xf8b5('0x122')]+=0x1;_0x347c2a[_0xf8b5('0xad')]=0xa;_0x347c2a[_0xf8b5('0xea')]='Drop';_0x347c2a[_0xf8b5('0x123')]=_0xf8b5('0x124');_0x347c2a[_0xf8b5('0x118')]=this[_0xf8b5('0x20')][_0x47131d['queue']][_0xf8b5('0x119')]?moment()[_0xf8b5('0x80')](_0xf8b5('0x10e')):undefined;_0x347c2a[_0xf8b5('0xfb')]+=0x1;_0x347c2a[_0xf8b5('0xf4')]+=0x1;_0x39c676=this[_0xf8b5('0x20')][_0x47131d['queue']][_0xf8b5('0x125')];_0x1d42ee=this[_0xf8b5('0x20')][_0x47131d[_0xf8b5('0xb8')]]['callAdditionalPhoneAfterMin'];_0x53b198[_0xf8b5('0xc1')](_0x347c2a,_0x347c2a[_0xf8b5('0xad')],_0x2f5b36['voiceQueue'])['then'](function(_0x32b388){_0x55e81d=_0x32b388[_0xf8b5('0x126')]==0x1;if(_0x347c2a[_0xf8b5('0xfb')]>=_0x53b198[_0xf8b5('0x20')][_0x47131d['queue']][_0xf8b5('0x127')]){_0x53b198[_0xf8b5('0x11d')](_0x347c2a,_0x32b388[_0xf8b5('0x126')]);}else{_0x53b198[_0xf8b5('0xc8')]({'active':![],'countdropretry':_0x347c2a[_0xf8b5('0xfb')],'scheduledat':moment()[_0xf8b5('0x10d')](_0x53b198[_0xf8b5('0x20')][_0x47131d[_0xf8b5('0xb8')]]['dialDropRetryFrequency'],_0xf8b5('0x105'))[_0xf8b5('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2f5b36[_0xf8b5('0xda')],'ListId':_0x2f5b36[_0xf8b5('0x106')],'VoiceQueueId':_0x2f5b36['VoiceQueueId']||undefined,'CampaignId':_0x2f5b36['CampaignId']||undefined})[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x128')));var _0x4cf8d4=new History(_0x347c2a);_0x4cf8d4[_0xf8b5('0xad')]=0xa;_0x4cf8d4['statedesc']=_0xf8b5('0x129');_0x4cf8d4[_0xf8b5('0xaf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4cf8d4[_0xf8b5('0xae')]=_0x4cf8d4[_0xf8b5('0xaf')];_0x4cf8d4[_0xf8b5('0x12a')]=_0x347c2a[_0xf8b5('0x12a')];_0x4cf8d4['calleridnum']=_0x347c2a[_0xf8b5('0x12b')];_0x53b198[_0xf8b5('0xd2')](_0x4cf8d4)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x12c')));}})[_0xf8b5('0x40')](function(_0x760de3){if(_0x55e81d)_0x53b198[_0xf8b5('0xc3')](_0x347c2a,_0x39c676,_0x1d42ee)['then'](function(_0x36a37a){return 0x1;});});}else{this[_0xf8b5('0x20')][_0x47131d[_0xf8b5('0xb8')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xf8b5('0x20')][_0x47131d['queue']][_0xf8b5('0x69')]+=0x1;_0x347c2a[_0xf8b5('0xad')]=0xb;_0x347c2a[_0xf8b5('0xea')]=_0xf8b5('0x12d');_0x347c2a[_0xf8b5('0x123')]=_0xf8b5('0x12e');_0x347c2a[_0xf8b5('0xfc')]+=0x1;_0x347c2a[_0xf8b5('0xf4')]+=0x1;_0x39c676=this[_0xf8b5('0x20')][_0x47131d[_0xf8b5('0xb8')]][_0xf8b5('0x12f')];_0x1d42ee=this[_0xf8b5('0x20')][_0x47131d[_0xf8b5('0xb8')]]['callAdditionalPhoneAfterMin'];_0x53b198[_0xf8b5('0xc1')](_0x347c2a,_0x347c2a[_0xf8b5('0xad')],_0x2f5b36[_0xf8b5('0x130')])[_0xf8b5('0x40')](function(_0x5c916e){if(_0x347c2a['countabandonedretry']>=_0x53b198[_0xf8b5('0x20')][_0x47131d[_0xf8b5('0xb8')]][_0xf8b5('0x131')]){_0x53b198[_0xf8b5('0x11d')](_0x347c2a,_0x5c916e[_0xf8b5('0x126')]);}else{_0x53b198[_0xf8b5('0xc8')]({'active':![],'countabandonedretry':_0x347c2a[_0xf8b5('0xfc')],'scheduledat':moment()[_0xf8b5('0x10d')](_0x53b198[_0xf8b5('0x20')][_0x47131d[_0xf8b5('0xb8')]]['dialAbandonedRetryFrequency'],_0xf8b5('0x105'))[_0xf8b5('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2f5b36[_0xf8b5('0xda')],'ListId':_0x2f5b36[_0xf8b5('0x106')],'VoiceQueueId':_0x2f5b36[_0xf8b5('0xdc')]||undefined,'CampaignId':_0x2f5b36[_0xf8b5('0xdd')]||undefined})[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x132')));var _0xadfb34=new History(_0x347c2a);_0xadfb34[_0xf8b5('0xad')]=0xb;_0xadfb34[_0xf8b5('0xea')]=_0xf8b5('0x12d');_0xadfb34[_0xf8b5('0xaf')]=moment()['format'](_0xf8b5('0x10e'));_0xadfb34[_0xf8b5('0xae')]=_0xadfb34[_0xf8b5('0xaf')];_0xadfb34[_0xf8b5('0x12a')]=_0x347c2a['calleridname'];_0xadfb34[_0xf8b5('0x12b')]=_0x347c2a['calleridnum'];_0x53b198[_0xf8b5('0xd2')](_0xadfb34)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x133')));}})[_0xf8b5('0x40')](function(_0x1891eb){if(_0x55e81d)_0x53b198[_0xf8b5('0xc3')](_0x347c2a,_0x39c676,_0x1d42ee)['then'](function(_0x5c28fc){return 0x1;});});}}}};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x37')]=function(_0x2014cd){if(this[_0xf8b5('0x26')][_0x2014cd[_0xf8b5('0xe9')]]){this['actions'][_0x2014cd[_0xf8b5('0xe9')]]['channel']=_0x2014cd[_0xf8b5('0xb6')];}if(this[_0xf8b5('0x28')][_0x2014cd[_0xf8b5('0xe9')]]){this[_0xf8b5('0x28')][_0x2014cd['uniqueid']][_0xf8b5('0xb6')]=_0x2014cd['channel'];}};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x3a')]=function(_0x2afdde){if(strategy[this['voiceQueues'][this['actions'][_0x2afdde[_0xf8b5('0x134')]][_0xf8b5('0xb8')]][_0xf8b5('0x135')]]==='roundrobin'){if(this[_0xf8b5('0x26')][_0x2afdde[_0xf8b5('0x134')]]&&_[_0xf8b5('0xb4')](this['actions'][_0x2afdde[_0xf8b5('0x134')]][_0xf8b5('0x136')])&&_0x2afdde['status']==='1'&&_0x2afdde[_0xf8b5('0x137')]==='0'){if(this[_0xf8b5('0x22')][_0x2afdde[_0xf8b5('0x138')]]){if(!this['agents'][_0x2afdde[_0xf8b5('0x138')]][_0xf8b5('0x136')]){this['agents'][_0x2afdde[_0xf8b5('0x138')]][_0xf8b5('0x136')]=!![];this[_0xf8b5('0x26')][_0x2afdde[_0xf8b5('0x134')]][_0xf8b5('0x136')]=!![];this[_0xf8b5('0x26')][_0x2afdde[_0xf8b5('0x134')]][_0xf8b5('0x138')]=_0x2afdde[_0xf8b5('0x138')];}}}}else if((strategy[this[_0xf8b5('0x20')][this['actions'][_0x2afdde[_0xf8b5('0x134')]]['queue']][_0xf8b5('0x135')]]||_0xf8b5('0x139'))===_0xf8b5('0x139')){if(this[_0xf8b5('0x26')][_0x2afdde[_0xf8b5('0x134')]]){if(this[_0xf8b5('0x22')][_0x2afdde['stateinterface']]){this['actions'][_0x2afdde[_0xf8b5('0x134')]][_0xf8b5('0x138')]=_0x2afdde[_0xf8b5('0x138')];if(_[_0xf8b5('0xb4')](this[_0xf8b5('0x13a')][this[_0xf8b5('0x26')][_0x2afdde[_0xf8b5('0x134')]]['queue']])){this[_0xf8b5('0x13a')][this[_0xf8b5('0x26')][_0x2afdde[_0xf8b5('0x134')]][_0xf8b5('0xb8')]]=[];}this['queueBooked'][this[_0xf8b5('0x26')][_0x2afdde['actionid']][_0xf8b5('0xb8')]][_0xf8b5('0x13b')](_[_0xf8b5('0x92')](_[_0xf8b5('0xd9')](this['actions'][_0x2afdde[_0xf8b5('0x134')]],[_0xf8b5('0x13c'),'stateinterface']),{'status':_0x2afdde[_0xf8b5('0xe2')],'paused':_0x2afdde[_0xf8b5('0x137')]}));}}}};function unlockQueueStatus(_0x157983,_0xacf0b3){setTimeout(function(){if(_['isUndefined'](_0x157983[_0xf8b5('0x13d')])){loggerBooked[_0xf8b5('0x9a')](_0xf8b5('0x13e'),_0xacf0b3);}_0x157983[_0xf8b5('0x13d')]=!![];loggerBooked[_0xf8b5('0x82')](_0xf8b5('0x13f'),_0xacf0b3,JSON[_0xf8b5('0x4e')](_['pick'](_0x157983,[_0xf8b5('0x43'),_0xf8b5('0x13d')])));},0x1f3);}Dialer[_0xf8b5('0xb0')]['syncQueueStatusComplete']=function(_0x215c55){var _0x499d95=this;var _0xb3a8aa=_0x499d95[_0xf8b5('0x20')][_0x499d95[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]][_0xf8b5('0xb8')]];if(strategy[this[_0xf8b5('0x20')][this[_0xf8b5('0x26')][_0x215c55['actionid']][_0xf8b5('0xb8')]][_0xf8b5('0x135')]]===_0xf8b5('0x140')){if(this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]]&&this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]][_0xf8b5('0x138')]){this[_0xf8b5('0x1f')][_0xf8b5('0x141')](this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]]['idHopper'],this['actions'][_0x215c55[_0xf8b5('0x134')]][_0xf8b5('0x138')])[_0xf8b5('0xbd')](function(_0x1e8c58){logger[_0xf8b5('0x9a')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xf8b5('0x9b')](_0x1e8c58,{'showHidden':![],'depth':null}));})[_0xf8b5('0x1d')](function(){_0x499d95[_0xf8b5('0xba')](_0x499d95[_0xf8b5('0x20')][_0x499d95[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]][_0xf8b5('0xb8')]]);_0x499d95[_0xf8b5('0x22')][_0x499d95[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]][_0xf8b5('0x138')]][_0xf8b5('0x136')]=![];delete _0x499d95['actions'][_0x215c55[_0xf8b5('0x134')]];unlockQueueStatus(_0xb3a8aa);});}else{this[_0xf8b5('0xba')](this[_0xf8b5('0x20')][this[_0xf8b5('0x26')][_0x215c55['actionid']]['queue']]);this[_0xf8b5('0xc8')]({'active':![],'ContactId':this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]]['ContactId'],'ListId':this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]][_0xf8b5('0x106')],'VoiceQueueId':this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]][_0xf8b5('0xdd')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]];unlockQueueStatus(_0xb3a8aa);}}else if((strategy[this[_0xf8b5('0x20')][this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]][_0xf8b5('0xb8')]][_0xf8b5('0x135')]]||_0xf8b5('0x139'))===_0xf8b5('0x139')){var _0x3b652e;if(this['actions'][_0x215c55['actionid']]&&!_[_0xf8b5('0x4c')](this[_0xf8b5('0x13a')][this['actions'][_0x215c55['actionid']][_0xf8b5('0xb8')]])){if(this['queueBookedRR'][_0x499d95[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]][_0xf8b5('0xb8')]]){this['queueBookedRR'][_0x499d95[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]]['queue']]=this[_0xf8b5('0x142')][this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]][_0xf8b5('0xb8')]]?this[_0xf8b5('0x142')][this['actions'][_0x215c55[_0xf8b5('0x134')]]['queue']]:this[_0xf8b5('0x13a')][this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]][_0xf8b5('0xb8')]]?this['queueBooked'][this['actions'][_0x215c55[_0xf8b5('0x134')]]['queue']][_0xf8b5('0x143')]||0x0:0x0;}this[_0xf8b5('0x13a')][this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]][_0xf8b5('0xb8')]][_0xf8b5('0x143')]=this['queueBookedRR'][this[_0xf8b5('0x26')][_0x215c55[_0xf8b5('0x134')]]['queue']];for(var _0x3166bb=0x0;_0x3166bb=0x0;})[_0xf8b5('0xbd')](myreject(_0x5ccfee)));}}else{_0x445331[_0xf8b5('0x13b')](ami['Action']({'action':_0xf8b5('0x15a'),'command':util[_0xf8b5('0x80')](_0xf8b5('0x15e'),_0x5f264c,!_[_0xf8b5('0x8a')](config[_0xf8b5('0x156')][_0x5f1d20])?_0x5f1d20:'')})[_0xf8b5('0x40')](function(_0x582752){return _0x582752[_0xf8b5('0x15f')]['indexOf']('true')>=0x0;})[_0xf8b5('0xbd')](myreject(_0x5ccfee)));}BPromise['all'](_0x445331)['then'](function(_0x3c4a73){var _0x3e63a1=_[_0xf8b5('0x160')](_0x3c4a73);if(_0x3e63a1){return _0x1ca0c2(_0x3e63a1);}else{_0x599c86[_0xf8b5('0x45')]=_0x3b2eed?_0xf8b5('0x161'):_0xf8b5('0x162');return _0x5ccfee(msgResponse(_0xf8b5('0x163'),_0xf8b5('0x153'),_0xf8b5('0x164')+_0x3b2eed+'\x20'+_0x2ea68e+_0xf8b5('0x165')+util[_0xf8b5('0x9b')](_0x5f264c,{'showHidden':![],'depth':null})+_0xf8b5('0x166')+_0x5f1d20));}})[_0xf8b5('0xbd')](function(_0x1f9b6e){return _0x5ccfee(msgResponse(_0xf8b5('0x151'),_0xf8b5('0x153'),JSON[_0xf8b5('0x4e')](_0x1f9b6e)));});});};Dialer['prototype'][_0xf8b5('0x167')]=function(_0x2145e0){var _0x2eda56=this;return function(){switch(_0x2145e0[_0xf8b5('0x5f')]){case _0xf8b5('0x168'):freeVariablesPredictive(_0x2145e0);_0x2eda56[_0xf8b5('0x169')](_0x2145e0,0x1);break;case _0xf8b5('0x16a'):freeVariablesPredictive(_0x2145e0);_0x2eda56[_0xf8b5('0x169')](_0x2145e0,_0x2145e0['dialPowerLevel']);break;case _0xf8b5('0x8'):_0x2eda56[_0xf8b5('0x8')](_0x2145e0);break;case _0xf8b5('0x7'):freeVariablesPredictive(_0x2145e0);_0x2eda56['handlePower'](_0x2145e0,0x1);break;default:freeVariablesPredictive(_0x2145e0);logger[_0xf8b5('0x9a')](_0xf8b5('0x16b'),_0x2145e0[_0xf8b5('0x43')],_0xf8b5('0x16c'));}};};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x16d')]=function(_0x1243a3){return BPromise[_0xf8b5('0xbc')]()[_0xf8b5('0x40')](cmHopper[_0xf8b5('0x16e')](_0x1243a3['id'],previewRecallmeReminderInterval))['then'](function(_0x4891d9){for(var _0x210e44=0x0;_0x210e44<_0x4891d9[_0xf8b5('0x9d')];_0x210e44++){var _0x3bc978=_0x4891d9[_0x210e44][_0xf8b5('0x16f')][_0xf8b5('0x43')];if(_0x3bc978)io['to'](util[_0xf8b5('0x80')](_0xf8b5('0x170'),_0x3bc978))[_0xf8b5('0xed')]('user:dialPreviewRecallReminder',{'hopper':_0x4891d9[_0x210e44]});}})['catch'](function(_0x51a196){});};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x171')]=function(_0x27b8e4){var _0x63e4f5=this;return function(){_0x63e4f5[_0xf8b5('0x172')](_0x27b8e4);};};Dialer['prototype']['syncQueueSummary']=function(_0x1e7576){var _0x3cb66a=this;if(isNotPreview(_0x1e7576[_0xf8b5('0x5f')])){if(isVoiceQueueOutbound(_0x1e7576['type'])&&isActive(_0x1e7576['dialActive'])){_0x1e7576[_0xf8b5('0xa6')]=!![];BPromise[_0xf8b5('0xbc')]()['then'](checkIsLoggedIn(_0x1e7576,_0x1e7576['loggedIn']))['then'](checkIsActive(_0x1e7576,_0x1e7576[_0xf8b5('0x5e')]))['then'](checkInterval(_0x1e7576))[_0xf8b5('0x40')](_0x3cb66a[_0xf8b5('0x173')](_0x1e7576))[_0xf8b5('0x40')](_0x3cb66a[_0xf8b5('0x150')](_0x1e7576[_0xf8b5('0x174')],_0x1e7576[_0xf8b5('0x175')],_0x1e7576[_0xf8b5('0x43')],_0x1e7576))['then'](_0x3cb66a['checkIfTimeIntervals'](_0x1e7576[_0xf8b5('0x48')],_0x1e7576['dialTimezone'],_0x1e7576[_0xf8b5('0x43')],_0x1e7576))[_0xf8b5('0x40')](_0x3cb66a[_0xf8b5('0x167')](_0x1e7576))[_0xf8b5('0xbd')](loggerCatchQueueSummary(_0xf8b5('0x176'),_0x1e7576));}else{notSendMessagesQueue(_0x1e7576);}}else{freeVariablesPredictive(_0x1e7576);if(_0x1e7576['dialPreviewRecallmeReminder']){_0x3cb66a['checkPreviewRecallReminder'](_0x1e7576);}}};Dialer['prototype'][_0xf8b5('0x14d')]=function(){var _0x23a45a=this;var _0x28a7d7;for(var _0x4a9748 in this['campaigns']){if(typeof this['campaigns'][_0x4a9748]!==_0xf8b5('0x9e')){_0x28a7d7=this[_0xf8b5('0x21')][_0x4a9748];if(isCampaignIvr(_0x28a7d7[_0xf8b5('0x51')])&&isActive(_0x28a7d7['active'])){_0x28a7d7[_0xf8b5('0xa6')]=!![];BPromise[_0xf8b5('0xbc')]()[_0xf8b5('0x40')](checkIsActive(_0x28a7d7,_0x28a7d7[_0xf8b5('0xe0')]))[_0xf8b5('0x40')](checkInterval(_0x28a7d7))[_0xf8b5('0x40')](_0x23a45a[_0xf8b5('0x173')](_0x28a7d7))['then'](_0x23a45a['checkIfTime'](_0x28a7d7['dialGlobalInterval'],_0x28a7d7[_0xf8b5('0x175')],_0x28a7d7[_0xf8b5('0x43')],_0x28a7d7))['then'](_0x23a45a[_0xf8b5('0x152')](_0x28a7d7[_0xf8b5('0x48')],_0x28a7d7['dialTimezone'],_0x28a7d7[_0xf8b5('0x43')],_0x28a7d7))[_0xf8b5('0x40')](_0x23a45a[_0xf8b5('0x171')](_0x28a7d7))[_0xf8b5('0xbd')](loggerCatchQueueSummary(_0xf8b5('0x177'),_0x28a7d7));}else{notSendMessagesCampaign(_0x28a7d7);}}}};function getCallerIdRandom(_0x16a650,_0x130a1d){var _0x4daee9;var _0xb8ba2;var _0xe8c48;if(_0x130a1d<=0x0){_0x130a1d=0x1;}_0x4daee9=new RegExp(_0xf8b5('0x178')+_0x130a1d+'}$');_0xb8ba2=Math[_0xf8b5('0x179')](0xa,_0x130a1d-0x1);_0xe8c48=Math[_0xf8b5('0x179')](0xa,_0x130a1d)-0x1;return util[_0xf8b5('0x80')]('%s',_['replace'](_0x16a650,_0x4daee9,_['random'](_0xb8ba2,_0xe8c48)));}function extractCalleridName(_0x589940){var _0x2f6a5b=_0x589940[_0xf8b5('0x17a')](/"(.*?)"/);return _0x2f6a5b?_0x2f6a5b[0x1]:_0x589940;}function extractCalleridNumber(_0x1f565e){var _0x341c34=_0x1f565e['match'](/<(.*?)>/);return _0x341c34?_0x341c34[0x1]:_0x1f565e;}Dialer[_0xf8b5('0xb0')][_0xf8b5('0x17b')]=function(_0x47da6e,_0x9348c3){var _0xa073f5=this;var _0x4281c3=uuid['v4']();this[_0xf8b5('0x26')][_0x4281c3]=new Action(_0x47da6e,_0x9348c3,_0x4281c3);return new BPromise(function(_0x56cd39,_0xfe9c8b){if(_[_0xf8b5('0x8a')](_0x47da6e)&&typeof _0x47da6e!=='object'){return _0xfe9c8b(msgResponse(_0xf8b5('0x17c'),_0xf8b5('0x153'),_0xf8b5('0x17d')));}if(_[_0xf8b5('0x8a')](_0x9348c3[_0xf8b5('0x17e')])||_0x9348c3[_0xf8b5('0x17e')]===null){return _0xfe9c8b(msgResponse(_0xf8b5('0x17c'),'Failure',_0xf8b5('0x17f')));}var _0xe8d9e4={'XMD-CALLERID':_0xa073f5['actions'][_0x4281c3][_0xf8b5('0x180')](),'XMD-AGI':_0x47da6e[_0xf8b5('0x110')]?util[_0xf8b5('0x80')](_0xf8b5('0x181'),ipAgi,_0x47da6e[_0xf8b5('0x110')]):_0xf8b5('0x182'),'XMD-AGIAFTER':_0x47da6e[_0xf8b5('0x119')]?util[_0xf8b5('0x80')](_0xf8b5('0x181'),ipAgi,_0x47da6e[_0xf8b5('0x119')]):'NONE','XMD-QUEUE':_0x47da6e['type']==='outbound'?util[_0xf8b5('0x80')](_0xf8b5('0x183'),_0x47da6e[_0xf8b5('0x43')],_0x47da6e[_0xf8b5('0x184')]||'',_0x47da6e['dialAgiAfterHangupAgent']?'c':'',_0x47da6e[_0xf8b5('0x121')]||0x3):_0xf8b5('0x182'),'XMD-CONTACTID':_0x9348c3[_0xf8b5('0xda')],'XMD-CDRTYPE':_0xf8b5('0x6'),'CALLERID(all)':_0xa073f5['actions'][_0x4281c3][_0xf8b5('0x180')](),'XMD-AMD':_0x47da6e[_0xf8b5('0x108')]?'ACTIVE':_0xf8b5('0x182'),'XMD-DESTINATION':_0xf8b5('0xe7')};if(_0x47da6e[_0xf8b5('0x108')]){_0xe8d9e4['XMD-AMDINITIALSILENCE']=_0x47da6e[_0xf8b5('0x185')]||0x9c4;_0xe8d9e4[_0xf8b5('0x186')]=_0x47da6e[_0xf8b5('0x187')]||0x5dc;_0xe8d9e4['XMD-AMDAFTERGREETINGSILENCE']=_0x47da6e[_0xf8b5('0x188')]||0x320;_0xe8d9e4[_0xf8b5('0x189')]=_0x47da6e[_0xf8b5('0x18a')]||0x1388;_0xe8d9e4[_0xf8b5('0x18b')]=_0x47da6e[_0xf8b5('0x18c')]||0x64;_0xe8d9e4['XMD-AMDBETWEENWORDSSILENCE']=_0x47da6e['dialAMDBetweenWordsSilence']||0x32;_0xe8d9e4[_0xf8b5('0x18d')]=_0x47da6e[_0xf8b5('0x18e')]||0x3;_0xe8d9e4[_0xf8b5('0x18f')]=_0x47da6e['dialAMDSilenceThreshold']||0x100;_0xe8d9e4[_0xf8b5('0x190')]=_0x47da6e[_0xf8b5('0x191')]||0x1388;}if(_0x47da6e[_0xf8b5('0x51')]===_0xf8b5('0x52')){_0xe8d9e4['XMD-VOICEQUEUEID']=_0x9348c3['VoiceQueueId'];}else{_0xe8d9e4[_0xf8b5('0x192')]=_0x9348c3[_0xf8b5('0xdd')];}for(var _0x28236b in _0x9348c3['Contact']){if(typeof _0x9348c3[_0xf8b5('0x193')][_0x28236b]!=='undefined'){if(isNotNull(_0x9348c3[_0xf8b5('0x193')][_0x28236b])&&_0x28236b!=='id'&&_0x28236b!==_0xf8b5('0x194')&&_0x28236b!=='createdAt'&&_0x28236b!==_0xf8b5('0x195')){_0xe8d9e4[util[_0xf8b5('0x80')](_0xf8b5('0x196'),_0xf8b5('0x197'),_['toUpper'](_0x28236b))]=_0x9348c3[_0xf8b5('0x193')][_0x28236b];}}}var _0x5d245f=_0xa073f5[_0xf8b5('0x14e')](_0x47da6e[_0xf8b5('0x7c')])?getCallerId(_0x47da6e['Trunk'][_0xf8b5('0x7d')],_0x47da6e[_0xf8b5('0x60')],_0x47da6e[_0xf8b5('0x198')]>0x0?getCallerIdRandom(_0x47da6e[_0xf8b5('0x61')],_0x47da6e['dialRandomLastDigitCallerIdNumber']):_0x47da6e[_0xf8b5('0x61')]):getCallerId(_[_0xf8b5('0xb4')](_0x47da6e[_0xf8b5('0x199')])?_0x47da6e[_0xf8b5('0x7c')][_0xf8b5('0x7d')]:_0x47da6e[_0xf8b5('0x199')][_0xf8b5('0x7d')],_0x47da6e[_0xf8b5('0x60')],_0x47da6e[_0xf8b5('0x198')]>0x0?getCallerIdRandom(_0x47da6e[_0xf8b5('0x61')],_0x47da6e[_0xf8b5('0x198')]):_0x47da6e[_0xf8b5('0x61')]);if(_0x5d245f){_0xe8d9e4[_0xf8b5('0x19a')]=_0xa073f5[_0xf8b5('0x26')][_0x4281c3]['originatecalleridname']=extractCalleridName(_0x5d245f);_0xe8d9e4['XMD-ORIGINATECALLERIDNUM']=_0x9348c3[_0xf8b5('0x17e')];}return ami['Action']({'actionid':_0x4281c3,'action':_0xf8b5('0x17c'),'channel':_0xa073f5[_0xf8b5('0x14e')](_0x47da6e[_0xf8b5('0x7c')])?util['format'](_0xf8b5('0x19b'),_0x47da6e[_0xf8b5('0x7c')][_0xf8b5('0x43')],isNotNull(_0x47da6e[_0xf8b5('0x63')])?_0x47da6e[_0xf8b5('0x63')][_0xf8b5('0x19c')]()||'':'',_0x47da6e[_0xf8b5('0x19d')]>0x0?_0x9348c3[_0xf8b5('0x17e')]['substring'](_0x47da6e[_0xf8b5('0x19d')]):_0x9348c3[_0xf8b5('0x17e')]):util[_0xf8b5('0x80')](_0xf8b5('0x19b'),_[_0xf8b5('0xb4')](_0x47da6e['TrunkBackup'])?_0x47da6e[_0xf8b5('0x7c')][_0xf8b5('0x43')]:_0x47da6e[_0xf8b5('0x199')][_0xf8b5('0x43')],isNotNull(_0x47da6e[_0xf8b5('0x63')])?_0x47da6e[_0xf8b5('0x63')][_0xf8b5('0x19c')]()||'':'',_0x47da6e[_0xf8b5('0x19d')]>0x0?_0x9348c3[_0xf8b5('0x17e')]['substring'](_0x47da6e[_0xf8b5('0x19d')]):_0x9348c3[_0xf8b5('0x17e')]),'callerid':_0x5d245f,'Exten':_0xf8b5('0xe7'),'Context':'from-sip','Priority':'1','variable':_0xe8d9e4,'timeout':(_0x47da6e[_0xf8b5('0x62')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4281c3})[_0xf8b5('0x40')](function(_0xa7ae2e){return _0x56cd39(_0xa7ae2e);})[_0xf8b5('0xbd')](function(_0x41fdd6){_0x47da6e[_0xf8b5('0x6c')]+=0x1;var _0x173021=new History(_0xa073f5[_0xf8b5('0x26')][_0x4281c3]);logger['error'](util[_0xf8b5('0x80')](_0xf8b5('0x19e'),JSON['stringify'](_0x41fdd6)));_0x173021[_0xf8b5('0xad')]=0xe;_0x173021[_0xf8b5('0xea')]=_0xf8b5('0x19f');_0x173021[_0xf8b5('0xaf')]=moment()[_0xf8b5('0x80')]('YYYY-MM-DD\x20HH:mm:ss');_0x173021[_0xf8b5('0xae')]=_0x173021[_0xf8b5('0xaf')];_0xa073f5[_0xf8b5('0xd2')](_0x173021)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x1a0')));_0xa073f5[_0xf8b5('0xd1')](_0x173021)[_0xf8b5('0xbd')](loggerCatch('[originate][error]'))[_0xf8b5('0x1d')](function(){delete _0xa073f5['actions'][_0x4281c3];return _0xfe9c8b(msgResponse(_0xf8b5('0x17c'),_0xf8b5('0x4d'),_0xf8b5('0x1a1')));});});});};Dialer['prototype'][_0xf8b5('0x32')]=function(_0x45dfe3){var _0x2b9ee0=this['actions'][_0x45dfe3[_0xf8b5('0x134')]];if(_0x2b9ee0){delete this[_0xf8b5('0x26')][_0x45dfe3[_0xf8b5('0x134')]];_0x2b9ee0['responsetime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x30fd69=_0x2b9ee0[_0xf8b5('0x51')]===_0xf8b5('0x7f')?this[_0xf8b5('0x21')][_0x2b9ee0[_0xf8b5('0xb8')]]:this[_0xf8b5('0x20')][_0x2b9ee0[_0xf8b5('0x1a2')]()];if(!this[_0xf8b5('0x1a3')](_0x45dfe3[_0xf8b5('0x1a4')])){this[_0xf8b5('0xba')](_0x30fd69);return this[_0xf8b5('0x1a5')](_0x2b9ee0,_0x30fd69,_0x45dfe3)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this[_0xf8b5('0x28')][_0x45dfe3['uniqueid']]=_0x2b9ee0;}};Dialer['prototype'][_0xf8b5('0x1a6')]=function(_0x5cc4f8,_0x3e0fd8,_0xf370a4){var _0x46c87f=new History(_0x3e0fd8);if(_0x46c87f[_0xf8b5('0xf7')]+_0x46c87f[_0xf8b5('0xf8')]+_0x46c87f[_0xf8b5('0xf9')]+_0x46c87f[_0xf8b5('0xfa')]+_0x46c87f[_0xf8b5('0xfb')]+_0x46c87f[_0xf8b5('0xfc')]+_0x46c87f[_0xf8b5('0xf3')]+_0x46c87f[_0xf8b5('0xfd')]>=_0xf370a4[_0xf8b5('0xfe')]-0x1){return!![];}switch(_0x5cc4f8){case 0x3:if(_0x46c87f[_0xf8b5('0xf9')]>=_0xf370a4[_0xf8b5('0x1a7')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x46c87f[_0xf8b5('0xf9')]+=0x1,'scheduledat':moment()['add'](_0xf370a4['dialNoAnswerRetryFrequency'],_0xf8b5('0x105'))[_0xf8b5('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x46c87f['ContactId'],'ListId':_0x46c87f[_0xf8b5('0x106')],'VoiceQueueId':_0x46c87f[_0xf8b5('0xdc')]||undefined,'CampaignId':_0x46c87f[_0xf8b5('0xdd')]||undefined})['catch'](loggerCatch(_0xf8b5('0x1a8')));break;case 0x5:if(_0x46c87f['countbusyretry']>=_0xf370a4[_0xf8b5('0x1a9')]-0x1){return!![];}this[_0xf8b5('0xc8')]({'active':![],'countbusyretry':_0x46c87f['countbusyretry']+=0x1,'scheduledat':moment()[_0xf8b5('0x10d')](_0xf370a4['dialBusyRetryFrequency'],_0xf8b5('0x105'))['format'](_0xf8b5('0x10e')),'ContactId':_0x46c87f['ContactId'],'ListId':_0x46c87f[_0xf8b5('0x106')],'VoiceQueueId':_0x46c87f[_0xf8b5('0xdc')]||undefined,'CampaignId':_0x46c87f[_0xf8b5('0xdd')]||undefined})[_0xf8b5('0xbd')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x46c87f[_0xf8b5('0xf8')]>=_0xf370a4['dialCongestionMaxRetry']-0x1){return!![];}this[_0xf8b5('0xc8')]({'active':![],'countcongestionretry':_0x46c87f[_0xf8b5('0xf8')]+=0x1,'scheduledat':moment()[_0xf8b5('0x10d')](_0xf370a4[_0xf8b5('0x1aa')],'minutes')[_0xf8b5('0x80')](_0xf8b5('0x10e')),'ContactId':_0x46c87f[_0xf8b5('0xda')],'ListId':_0x46c87f[_0xf8b5('0x106')],'VoiceQueueId':_0x46c87f[_0xf8b5('0xdc')]||undefined,'CampaignId':_0x46c87f['CampaignId']||undefined})[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x1ab')));break;case 0x0:if(_0x46c87f[_0xf8b5('0xfa')]>=_0xf370a4[_0xf8b5('0x1ac')]-0x1){return!![];}else{this[_0xf8b5('0xc8')]({'active':![],'countnosuchnumberretry':_0x46c87f[_0xf8b5('0xfa')]+=0x1,'scheduledat':moment()[_0xf8b5('0x10d')](_0xf370a4[_0xf8b5('0x1ad')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x46c87f[_0xf8b5('0xda')],'ListId':_0x46c87f['ListId'],'VoiceQueueId':_0x46c87f[_0xf8b5('0xdc')]||undefined,'CampaignId':_0x46c87f[_0xf8b5('0xdd')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x46c87f[_0xf8b5('0xfb')]>=_0xf370a4[_0xf8b5('0x127')]-0x1){return!![];}this[_0xf8b5('0xc8')]({'active':![],'countdropretry':_0x46c87f[_0xf8b5('0xfb')]+=0x1,'scheduledat':moment()['add'](_0xf370a4[_0xf8b5('0x125')],_0xf8b5('0x105'))['format'](_0xf8b5('0x10e')),'ContactId':_0x46c87f[_0xf8b5('0xda')],'ListId':_0x46c87f[_0xf8b5('0x106')],'VoiceQueueId':_0x46c87f[_0xf8b5('0xdc')]||undefined,'CampaignId':_0x46c87f[_0xf8b5('0xdd')]||undefined})[_0xf8b5('0xbd')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x46c87f[_0xf8b5('0xfc')]>=_0xf370a4[_0xf8b5('0x131')]-0x1){return!![];}this[_0xf8b5('0xc8')]({'active':![],'countabandonedretry':_0x46c87f[_0xf8b5('0xfc')]+=0x1,'scheduledat':moment()[_0xf8b5('0x10d')](_0xf370a4[_0xf8b5('0x12f')],_0xf8b5('0x105'))[_0xf8b5('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x46c87f['ContactId'],'ListId':_0x46c87f[_0xf8b5('0x106')],'VoiceQueueId':_0x46c87f[_0xf8b5('0xdc')]||undefined,'CampaignId':_0x46c87f[_0xf8b5('0xdd')]||undefined})[_0xf8b5('0xbd')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x46c87f[_0xf8b5('0xf3')]>=_0xf370a4['dialMachineMaxRetry']-0x1){return!![];}this[_0xf8b5('0xc8')]({'active':![],'countmachineretry':_0x46c87f[_0xf8b5('0xf3')]+=0x1,'scheduledat':moment()[_0xf8b5('0x10d')](_0xf370a4[_0xf8b5('0x104')],'minutes')[_0xf8b5('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x46c87f[_0xf8b5('0xda')],'ListId':_0x46c87f[_0xf8b5('0x106')],'VoiceQueueId':_0x46c87f['VoiceQueueId']||undefined,'CampaignId':_0x46c87f['CampaignId']||undefined})[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x107')));break;case 0x14:if(_0x46c87f[_0xf8b5('0xfd')]>=_0xf370a4[_0xf8b5('0x1ae')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x46c87f['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xf8b5('0x10d')](_0xf370a4[_0xf8b5('0x1af')],_0xf8b5('0x105'))[_0xf8b5('0x80')](_0xf8b5('0x10e')),'ContactId':_0x46c87f[_0xf8b5('0xda')],'ListId':_0x46c87f[_0xf8b5('0x106')],'VoiceQueueId':_0x46c87f[_0xf8b5('0xdc')]||undefined,'CampaignId':_0x46c87f[_0xf8b5('0xdd')]||undefined})[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x1b0')));break;default:return!![];}};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x1a5')]=function(_0x676e53,_0x2fb2df,_0x10d535){var _0x6a7ec5=this;var _0x4c1114=new History(_0x676e53);var _0x22216d=![];var _0x50ca6b;var _0x2f33c2;return new BPromise(function(_0x3230b4,_0x387927){if(_[_0xf8b5('0x8a')](_0x2fb2df)&&typeof _0x2fb2df!==_0xf8b5('0x1b1')){return _0x387927(msgResponse(_0xf8b5('0x1b2'),_0xf8b5('0x153'),_0xf8b5('0x1b3')));}if(_[_0xf8b5('0x8a')](_0x10d535)&&typeof _0x10d535!=='object'){return _0x387927(msgResponse('[callProgressDetecting]','Failure',_0xf8b5('0x1b4')));}_0x6a7ec5[_0xf8b5('0xc1')](_0x4c1114,_0x10d535[_0xf8b5('0x116')],_0x2fb2df)[_0xf8b5('0x40')](function(_0x49b42c){if(_0x49b42c['additional']==0x1)_0x22216d=!![];switch(_0x10d535[_0xf8b5('0x116')]){case'0':_0x2fb2df['outboundNoSuchCallsDay']+=0x1;_0x4c1114[_0xf8b5('0xad')]=0x0;_0x4c1114[_0xf8b5('0xea')]=_0xf8b5('0x1b5');_0x4c1114[_0xf8b5('0xfa')]+=0x1;_0x4c1114[_0xf8b5('0xf4')]+=0x1;ami[_0xf8b5('0xed')](_0xf8b5('0x1b6'),ut['buildObj'](_0x676e53,_0xf8b5('0x1b7')));_0x50ca6b=_0x2fb2df[_0xf8b5('0x1ad')];_0x2f33c2=_0x2fb2df['callAdditionalPhoneAfterMin'];_0x6a7ec5[_0xf8b5('0xd2')](_0x4c1114)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0xf6')));if(_0x6a7ec5[_0xf8b5('0x1a6')](0x0,_0x676e53,_0x2fb2df)&&!_0x22216d){if(_0x4c1114[_0xf8b5('0xfa')]>=_0x2fb2df[_0xf8b5('0x1ac')]){_0x6a7ec5[_0xf8b5('0x102')](_0x4c1114,_0x3230b4,_0x387927,'reason\x200\x20no\x20such\x20number....');}else{_0x6a7ec5[_0xf8b5('0xff')](_0x4c1114,_0x3230b4,_0x387927,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x2fb2df[_0xf8b5('0x6a')]+=0x1;_0x4c1114[_0xf8b5('0xad')]=0x3;_0x4c1114['statedesc']='NoAnswer';_0x4c1114[_0xf8b5('0xf9')]+=0x1;_0x4c1114[_0xf8b5('0xf4')]+=0x1;ami['emit']('custom:agentnoanswer',ut[_0xf8b5('0x10a')](_0x676e53,_0xf8b5('0x1b8')));_0x50ca6b=_0x2fb2df[_0xf8b5('0x1b9')];_0x2f33c2=_0x2fb2df[_0xf8b5('0x1ba')];_0x6a7ec5[_0xf8b5('0xd2')](_0x4c1114)[_0xf8b5('0xbd')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x6a7ec5[_0xf8b5('0x1a6')](0x3,_0x676e53,_0x2fb2df)&&!_0x22216d){if(_0x4c1114[_0xf8b5('0xf9')]>=_0x2fb2df['dialNoAnswerMaxRetry']){_0x6a7ec5[_0xf8b5('0x102')](_0x4c1114,_0x3230b4,_0x387927,'reason\x203\x20ringing\x20no\x20answer');}else{_0x6a7ec5['stateGlobal'](_0x4c1114,_0x3230b4,_0x387927,_0xf8b5('0x1bb'));}}break;case'5':_0x2fb2df['outboundBusyCallsDay']+=0x1;_0x4c1114[_0xf8b5('0xad')]=0x5;_0x4c1114[_0xf8b5('0xea')]=_0xf8b5('0x1bc');_0x4c1114['countbusyretry']+=0x1;_0x4c1114[_0xf8b5('0xf4')]+=0x1;ami[_0xf8b5('0xed')]('custom:agentbusy',ut[_0xf8b5('0x10a')](_0x676e53,_0xf8b5('0x1bd')));_0x50ca6b=_0x2fb2df[_0xf8b5('0x1be')];_0x2f33c2=_0x2fb2df[_0xf8b5('0x1ba')];_0x6a7ec5['createHistory'](_0x4c1114)[_0xf8b5('0xbd')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x6a7ec5[_0xf8b5('0x1a6')](0x5,_0x676e53,_0x2fb2df)&&!_0x22216d){if(_0x4c1114[_0xf8b5('0xf7')]>=_0x2fb2df[_0xf8b5('0x1a9')]){_0x6a7ec5[_0xf8b5('0x102')](_0x4c1114,_0x3230b4,_0x387927,_0xf8b5('0x1bf'));}else{_0x6a7ec5[_0xf8b5('0xff')](_0x4c1114,_0x3230b4,_0x387927,_0xf8b5('0x1bf'));}}break;case'8':_0x2fb2df[_0xf8b5('0x1c0')]+=0x1;_0x4c1114['state']=0x8;_0x4c1114[_0xf8b5('0xea')]='Congestion';_0x4c1114['countcongestionretry']+=0x1;_0x4c1114[_0xf8b5('0xf4')]+=0x1;_0x50ca6b=_0x2fb2df[_0xf8b5('0x1aa')];_0x2f33c2=_0x2fb2df[_0xf8b5('0x1ba')];ami[_0xf8b5('0xed')](_0xf8b5('0x1c1'),ut[_0xf8b5('0x10a')](_0x676e53,_0xf8b5('0x1c2')));_0x6a7ec5[_0xf8b5('0xd2')](_0x4c1114)[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x1c3')));if(_0x6a7ec5['checkRetriveMax'](0x8,_0x676e53,_0x2fb2df)&&!_0x22216d){if(_0x4c1114[_0xf8b5('0xf8')]>=_0x2fb2df[_0xf8b5('0x1c4')]){_0x6a7ec5[_0xf8b5('0x102')](_0x4c1114,_0x3230b4,_0x387927,_0xf8b5('0x1c5'));}else{_0x6a7ec5[_0xf8b5('0xff')](_0x4c1114,_0x3230b4,_0x387927,_0xf8b5('0x1c5'));}}break;case'11':_0x2fb2df['outboundAbandonedCallsDay']+=0x1;_0x4c1114[_0xf8b5('0xad')]=0xb;_0x4c1114[_0xf8b5('0xea')]=_0xf8b5('0x12d');_0x4c1114[_0xf8b5('0xfc')]+=0x1;_0x4c1114[_0xf8b5('0xf4')]+=0x1;_0x50ca6b=_0x2fb2df[_0xf8b5('0x12f')];_0x2f33c2=_0x2fb2df[_0xf8b5('0x1ba')];_0x6a7ec5[_0xf8b5('0xd2')](_0x4c1114)[_0xf8b5('0xbd')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x6a7ec5[_0xf8b5('0x1a6')](0xb,_0x676e53,_0x2fb2df)&&!_0x22216d){if(_0x4c1114[_0xf8b5('0xfc')]>=_0x2fb2df[_0xf8b5('0x131')]){_0x6a7ec5[_0xf8b5('0x102')](_0x4c1114,_0x3230b4,_0x387927,_0xf8b5('0x1c6'));}else{_0x6a7ec5['stateGlobal'](_0x4c1114,_0x3230b4,_0x387927,_0xf8b5('0x1c6'));}}break;case'20':_0x2fb2df[_0xf8b5('0x6e')]+=0x1;_0x4c1114[_0xf8b5('0xad')]=0x14;_0x4c1114[_0xf8b5('0xea')]='AgentReject';_0x4c1114['countagentrejectretry']+=0x1;_0x4c1114[_0xf8b5('0xf4')]+=0x1;_0x50ca6b=_0x2fb2df['dialAgentRejectRetryFrequency'];_0x2f33c2=_0x2fb2df['callAdditionalPhoneAfterMin'];ami['emit'](_0xf8b5('0x1c7'),ut[_0xf8b5('0x10a')](_0x676e53,_0xf8b5('0x1c8')));_0x6a7ec5[_0xf8b5('0xd2')](_0x4c1114)['catch'](loggerCatch(_0xf8b5('0x1c9')));if(_0x6a7ec5[_0xf8b5('0x1a6')](0x14,_0x676e53,_0x2fb2df)&&!_0x22216d){if(_0x4c1114[_0xf8b5('0xfd')]>=_0x2fb2df[_0xf8b5('0x1ae')]){_0x6a7ec5[_0xf8b5('0x102')](_0x4c1114,_0x3230b4,_0x387927,_0xf8b5('0x1ca'));}else{_0x6a7ec5[_0xf8b5('0xff')](_0x4c1114,_0x3230b4,_0x387927,'reason\x2020\x20agentreject');}}break;default:_0x2fb2df[_0xf8b5('0x6f')]+=0x1;_0x4c1114['state']=0xc;_0x4c1114[_0xf8b5('0xea')]=_0x10d535[_0xf8b5('0x116')];_0x50ca6b=_0x2fb2df['dialAgentRejectRetryFrequency'];_0x2f33c2=_0x2fb2df[_0xf8b5('0x1ba')];_0x6a7ec5[_0xf8b5('0xd2')](_0x4c1114)['catch'](loggerCatch(_0xf8b5('0x1cb')));if(_0x6a7ec5[_0xf8b5('0x1a6')](_0x10d535[_0xf8b5('0x116')],_0x676e53,_0x2fb2df)&&!_0x22216d){if(_0x4c1114[_0xf8b5('0xf7')]+_0x4c1114[_0xf8b5('0xf8')]+_0x4c1114[_0xf8b5('0xf9')]+_0x4c1114[_0xf8b5('0xfa')]+_0x4c1114['countdropretry']+_0x4c1114['countabandonedretry']+_0x4c1114[_0xf8b5('0xf3')]+_0x4c1114[_0xf8b5('0xfd')]>=_0x2fb2df['dialGlobalMaxRetry']){_0x6a7ec5[_0xf8b5('0xff')](_0x4c1114,_0x3230b4,_0x387927,_0x10d535['reason']);}else{_0x6a7ec5[_0xf8b5('0x102')](_0x4c1114,_0x3230b4,_0x387927,_0x10d535['reason']);}}}})[_0xf8b5('0x40')](function(_0x1d690d){if(_0x22216d){_0x6a7ec5[_0xf8b5('0xc3')](_0x4c1114,_0x50ca6b,_0x2f33c2)[_0xf8b5('0x40')](function(_0x8a5517){return _0x3230b4(0x1);});}});});};Dialer[_0xf8b5('0xb0')][_0xf8b5('0xff')]=function(_0x54eadc,_0x123133,_0x22bead,_0x259b20){var _0x251807=new Final(_0x54eadc);_0x251807[_0xf8b5('0xad')]=0xf;_0x251807[_0xf8b5('0xea')]=_0xf8b5('0x1cc');this['createStateFinal'](_0x251807,_0x123133,_0x22bead,_0x259b20);};Dialer['prototype'][_0xf8b5('0x102')]=function(_0x537cdf,_0x5e9396,_0x10fb2b,_0x240720){this['moveContactManagedDialer'](_0x537cdf)[_0xf8b5('0x40')](function(){return _0x5e9396(msgResponse(_0xf8b5('0x1b2'),_0xf8b5('0xdf'),_0x240720));})[_0xf8b5('0xbd')](function(){return _0x10fb2b(msgResponse('[moveContactManagedDialer][0]','Failure','contact\x20not\x20moved'));});};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x8')]=function(_0x550fe1){var _0x2b808c=_0x550fe1[_0xf8b5('0x1cd')]/0x64;var _0x35eb6d=_0x550fe1[_0xf8b5('0x1ce')]/(_0x550fe1[_0xf8b5('0x1ce')]+_0x550fe1['outboundAnswerCallsDay']);var _0x4fbbf6=Math[_0xf8b5('0x1cf')](_0x550fe1['predictiveIntervalAvailable']*(_0x550fe1['predictiveIntervalMaxThreshold']/0x64));var _0x13458d=Math[_0xf8b5('0x1cf')](_0x550fe1[_0xf8b5('0x77')]*(_0x550fe1[_0xf8b5('0x1d0')]/0x64));var _0x477c74=_0x550fe1['available']+_0x550fe1[_0xf8b5('0x59')];var _0x3ed7d6=Math[_0xf8b5('0x1d1')](_0x550fe1[_0xf8b5('0x7a')]*_0x550fe1[_0xf8b5('0x7b')]*_0x550fe1[_0xf8b5('0x74')]*_0x550fe1[_0xf8b5('0x75')]);if(_[_0xf8b5('0x8a')](_0x550fe1[_0xf8b5('0x2a')])){if(!_[_0xf8b5('0x8a')](_0x550fe1[_0xf8b5('0x29')])){_0x550fe1[_0xf8b5('0x29')]=undefined;loggerPredictive[_0xf8b5('0x9a')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x550fe1['handlePredictive'])){loggerPredictive['error'](_0xf8b5('0x1d2'),_0xf8b5('0x1d3'));clearInterval(_0x550fe1[_0xf8b5('0x96')]);_0x550fe1[_0xf8b5('0x96')]=undefined;}_0x550fe1[_0xf8b5('0x2a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xf8b5('0x82')](_0x550fe1['name'],_0xf8b5('0x1d4'),_0x550fe1['startProgressive']);this[_0xf8b5('0x169')](_0x550fe1,0x1);}else if(ifInterval(_0x550fe1[_0xf8b5('0x1d5')],_0x550fe1[_0xf8b5('0x2a')])){this['handlePower'](_0x550fe1,0x1);loggerPredictiveCalls[_0xf8b5('0x82')](_0xf8b5('0x1d6'),_0x550fe1[_0xf8b5('0x2a')],_0x550fe1[_0xf8b5('0x43')]);_0x550fe1[_0xf8b5('0x7a')]=0x0;_0x550fe1[_0xf8b5('0x122')]=0x0;}else if(_0x2b808c<_0x35eb6d&&_0x550fe1[_0xf8b5('0x1d7')]===_0xf8b5('0x1d8')){freeVariablesPredictive(_0x550fe1);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xf8b5('0x1d9'),_0x35eb6d,_0xf8b5('0x2a'),_0x550fe1[_0xf8b5('0x43')]);}else if(_0x3ed7d6<_0x550fe1[_0xf8b5('0x122')]&&_0x550fe1['dialPredictiveOptimization']===_0xf8b5('0x1d8')){freeVariablesPredictive(_0x550fe1);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x1da'),_0xf8b5('0x1db'),_0x3ed7d6,'Drop\x20in\x20this\x20interval',_0x550fe1[_0xf8b5('0x122')],_0xf8b5('0x2a'),_0x550fe1[_0xf8b5('0x43')]);}else if(!ifInterval(_0x550fe1[_0xf8b5('0x1d5')],_0x550fe1[_0xf8b5('0x2a')])&&_['isUndefined'](_0x550fe1[_0xf8b5('0x29')])&&!_[_0xf8b5('0x8a')](_0x550fe1[_0xf8b5('0x2a')])){_0x550fe1[_0xf8b5('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xf8b5('0x82')](_0x550fe1[_0xf8b5('0x43')],_0xf8b5('0x1dc'),_0x550fe1[_0xf8b5('0x29')]);this['averageHandleTime'](_0x550fe1[_0xf8b5('0x1d5')])[_0xf8b5('0x40')](this['getDataPredictive'](_0x550fe1))[_0xf8b5('0x40')](mergeDataErlangB(_0x550fe1))[_0xf8b5('0x40')](this[_0xf8b5('0x1dd')](_0x550fe1))[_0xf8b5('0xbd')](loggerCatchPredictive(_0xf8b5('0x1de'),_0x550fe1));}else if(!ifInterval(_0x550fe1['dialPredictiveInterval'],_0x550fe1[_0xf8b5('0x29')])){_0x550fe1[_0xf8b5('0x122')]=0x0;_0x550fe1[_0xf8b5('0x29')]=moment()[_0xf8b5('0x80')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xf8b5('0x82')](_0x550fe1[_0xf8b5('0x43')],_0xf8b5('0x1df'),_0x550fe1[_0xf8b5('0x29')]);clearInterval(_0x550fe1[_0xf8b5('0x96')]);_0x550fe1[_0xf8b5('0x96')]=undefined;this[_0xf8b5('0xc6')](_0x550fe1[_0xf8b5('0x1d5')])[_0xf8b5('0x40')](this[_0xf8b5('0x1e0')](_0x550fe1))['then'](mergeDataErlangB(_0x550fe1))[_0xf8b5('0x40')](this[_0xf8b5('0x1dd')](_0x550fe1))[_0xf8b5('0xbd')](loggerCatchPredictive(_0xf8b5('0x1e1'),_0x550fe1));}else if(_0x550fe1['predictiveIntervalAvailable']&&_0x477c74<_0x550fe1['predictiveIntervalAvailable']-_0x13458d){freeVariablesPredictive(_0x550fe1);loggerPredictive[_0xf8b5('0x82')](_0x550fe1[_0xf8b5('0x43')],_0xf8b5('0x1e2'),_0x477c74,')\x20are\x20less\x20than\x20threshold\x20(',_0x550fe1[_0xf8b5('0x77')],'-',_0x13458d,'=',_0x550fe1[_0xf8b5('0x77')]-_0x13458d,')');}else if(_0x550fe1['predictiveIntervalAvailable']&&_0x477c74>_0x550fe1[_0xf8b5('0x77')]+_0x4fbbf6){freeVariablesPredictive(_0x550fe1);loggerPredictive[_0xf8b5('0x82')](_0x550fe1[_0xf8b5('0x43')],_0xf8b5('0x1e2'),_0x477c74,_0xf8b5('0x1e3'),_0x550fe1[_0xf8b5('0x77')],'+',_0x4fbbf6,'=',_0x550fe1[_0xf8b5('0x77')]+_0x4fbbf6,')');}};Dialer['prototype']['getDataPredictive']=function(_0x434d1f){var _0x2283f0=this;return function(_0x11511b){return new BPromise(function(_0x41f7fd,_0x11c4f3){_['merge'](_0x434d1f,_0x11511b[0x0]);if(checkGetDataPredictive(_0x11511b[0x0])){var _0x4aa906=_0x434d1f[_0xf8b5('0x77')]=_0x434d1f[_0xf8b5('0x59')]+_0x434d1f[_0xf8b5('0x53')];var _0x1608cd=_0x434d1f['dialPredictiveInterval']*0x3c;var _0x2616e8=_0x11511b[0x0][_0xf8b5('0x72')]+_0x11511b[0x0][_0xf8b5('0x71')];var _0x20bbef=(_0x11511b[0x0][_0xf8b5('0x70')]+_0x11511b[0x0][_0xf8b5('0x73')]+_0x11511b[0x0][_0xf8b5('0x87')])/_0x11511b[0x0][_0xf8b5('0x78')];_0x434d1f[_0xf8b5('0x74')]=_0x20bbef>0x0?_0x20bbef:0x1;switch(_0x434d1f[_0xf8b5('0x1d7')]){case _0xf8b5('0x1d8'):var _0x46b8e4=_0x434d1f[_0xf8b5('0x1cd')]/0x64;return _0x2283f0[_0xf8b5('0x1e4')](_0x4aa906,_0x1608cd,_0x2616e8,_0x20bbef,_0x46b8e4)[_0xf8b5('0x40')](function(_0x461a5d){return _0x41f7fd(_0x461a5d);});case'agentBusyFactor':var _0x14c67f=_0x434d1f[_0xf8b5('0x1cd')]/0x64;return _0x2283f0[_0xf8b5('0x1e5')](_0x4aa906,_0x1608cd,_0x2616e8,_0x20bbef,_0x14c67f)[_0xf8b5('0x40')](function(_0x1db3bc){return _0x41f7fd(_0x1db3bc);});default:return _0x11c4f3(msgResponse('[getDataPredictive]',_0xf8b5('0x153'),_0xf8b5('0x1e6')));}}else{return _0x11c4f3(msgResponse(_0xf8b5('0x1e7'),'Failure',_0xf8b5('0x1e8')));}});};};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x1e9')]=function(_0x27b456){var _0x347166=this;return function(_0x3d29c3){return new BPromise(function(_0x503c0e,_0x2e5479){_[_0xf8b5('0x92')](_0x27b456,_0x3d29c3[0x0]);if(checkGetDataPredictive(_0x3d29c3[0x0])){loggerPredictive[_0xf8b5('0x82')](JSON[_0xf8b5('0x4e')](_0x3d29c3[0x0]));if(_0x27b456[_0xf8b5('0x1d7')]===_0xf8b5('0x1d8')){return _0x347166[_0xf8b5('0xcf')](_0x27b456['id'])[_0xf8b5('0x40')](function(_0x371d3f){var _0x321dbe=_0x27b456[_0xf8b5('0x54')]-_0x371d3f[0x0]['outboundQueuePauses'];var _0x44a81e=_0x27b456[_0xf8b5('0x1d5')]*0x3c;var _0x566705=_0x3d29c3[0x0][_0xf8b5('0x72')]+_0x3d29c3[0x0][_0xf8b5('0x71')];var _0x25c9bc=(_0x3d29c3[0x0]['predictiveIntervalAnsweredCalls']+_0x3d29c3[0x0][_0xf8b5('0x73')]+_0x3d29c3[0x0][_0xf8b5('0x87')])/_0x3d29c3[0x0][_0xf8b5('0x78')];var _0x524a80=_0x27b456['dialPredictiveOptimizationPercentage']/0x64;_0x27b456[_0xf8b5('0x76')]=_0x371d3f[0x0][_0xf8b5('0x1ea')]||0x0;_0x27b456['predictiveIntervalHitRate']=_0x25c9bc>0x0?_0x25c9bc:0x1;return _0x347166['abandonmentRate'](_0x321dbe,_0x44a81e,_0x566705,_0x25c9bc,_0x524a80);})[_0xf8b5('0x40')](function(_0x57829b){return _0x503c0e(_0x57829b);})[_0xf8b5('0xbd')](function(_0x113422){return _0x2e5479(msgResponse(_0xf8b5('0x1eb'),_0xf8b5('0x153'),JSON['stringify'](_0x113422)));});}if(_0x27b456[_0xf8b5('0x1d7')]===_0xf8b5('0x1ec')){return _0x347166[_0xf8b5('0xcf')](_0x27b456['id'])[_0xf8b5('0x40')](function(_0x1d7d89){var _0x64f234=_0x27b456[_0xf8b5('0x54')]-_0x1d7d89[0x0][_0xf8b5('0x1ea')];var _0x3fcd6c=_0x27b456['dialPredictiveInterval']*0x3c;var _0x25f65b=_0x3d29c3[0x0][_0xf8b5('0x72')]+_0x3d29c3[0x0][_0xf8b5('0x71')];var _0xced6b5=(_0x3d29c3[0x0]['predictiveIntervalAnsweredCalls']+_0x3d29c3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3d29c3[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3d29c3[0x0][_0xf8b5('0x78')];var _0x48e490=_0x27b456[_0xf8b5('0x1cd')]/0x64;_0x27b456[_0xf8b5('0x76')]=_0x1d7d89[0x0]['outboundQueuePauses']||0x0;_0x27b456['predictiveIntervalHitRate']=_0xced6b5>0x0?_0xced6b5:0x1;return _0x347166[_0xf8b5('0x1e5')](_0x64f234,_0x3fcd6c,_0x25f65b,_0xced6b5,_0x48e490);})[_0xf8b5('0x40')](function(_0x5aa232){return _0x503c0e(_0x5aa232);})[_0xf8b5('0xbd')](function(_0x42185c){return _0x2e5479(msgResponse(_0xf8b5('0x1eb'),_0xf8b5('0x153'),JSON[_0xf8b5('0x4e')](_0x42185c)));});}}else{return _0x2e5479(msgResponse(_0xf8b5('0x1e7'),_0xf8b5('0x153'),_0xf8b5('0x1e8')));}});};};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x1dd')]=function(_0x39f5a5){var _0x46f18d=this;return function(){var _0x1461b8=0x0;var _0x4f3bcd=Math[_0xf8b5('0x1d1')](_0x39f5a5[_0xf8b5('0x8e')]*0x3e8);if(_0x4f3bcd>0x0){_0x4f3bcd=_0x4f3bcd<0x64?0x64:_0x4f3bcd;loggerPredictive[_0xf8b5('0x82')](_0x39f5a5['name'],_0xf8b5('0x1ed'),_0x4f3bcd,_0xf8b5('0x4f'));_0x39f5a5['handlePredictive']=setInterval(function(){_0x46f18d[_0xf8b5('0x96')](_0x39f5a5);loggerPredictiveCalls[_0xf8b5('0x82')](_0xf8b5('0x1ee'),_0x1461b8+=0x1);},_0x4f3bcd);}else{loggerPredictive[_0xf8b5('0x82')](_0x39f5a5[_0xf8b5('0x43')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x1ef')]=function(_0xd34e46,_0x761e99){var _0x1462ce=this;return function(_0x45a64d){if(_[_0xf8b5('0x4c')](_0x45a64d)){if(_[_0xf8b5('0xb4')](_0x761e99[_0xf8b5('0xdb')])||!_0x761e99[_0xf8b5('0x1f0')]){if(_0xd34e46['dialMethod']===_0xf8b5('0x7')){_0xd34e46[_0xf8b5('0x13d')]=_['isUndefined'](_0xd34e46[_0xf8b5('0x13d')])?!![]:_0xd34e46[_0xf8b5('0x13d')];var _0x37517f=uuid['v4']();_0x1462ce['actions'][_0x37517f]=new Action(_0xd34e46,_0x761e99,_0x37517f);loggerBooked['info'](_0xf8b5('0x1f1'),_0x37517f,_0xf8b5('0x1f2'),JSON[_0xf8b5('0x4e')](_0xd34e46[_0xf8b5('0x13d')]),_0xf8b5('0x1f3'),_0xd34e46[_0xf8b5('0x43')]);if(_0xd34e46[_0xf8b5('0x13d')]){_0xd34e46['queueStatusComplete']=![];_0x1462ce[_0xf8b5('0x13a')][_0x1462ce['actions'][_0x37517f]['queue']]=[];ami[_0xf8b5('0xb5')]({'actionid':_0x37517f,'action':_0xf8b5('0x1f4'),'queue':_0xd34e46[_0xf8b5('0x43')]})['catch'](function(){_0x1462ce[_0xf8b5('0xba')](_0xd34e46);_0x1462ce[_0xf8b5('0xc8')]({'active':![],'ContactId':_0x1462ce[_0xf8b5('0x26')][_0x37517f]['ContactId'],'ListId':_0x1462ce['actions'][_0x37517f]['ListId'],'VoiceQueueId':_0x1462ce[_0xf8b5('0x26')][_0x37517f][_0xf8b5('0xdc')]||undefined,'CampaignId':_0x1462ce[_0xf8b5('0x26')][_0x37517f][_0xf8b5('0xdd')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1462ce[_0xf8b5('0x26')][_0x37517f];});}else{loggerBooked['info'](_0xf8b5('0x1f5'),JSON['stringify'](_0xd34e46[_0xf8b5('0x13d')]),_0xf8b5('0x1f3'),_0xd34e46[_0xf8b5('0x43')]);_0x1462ce[_0xf8b5('0xba')](_0xd34e46);_0x1462ce['rescheduleContact']({'active':![],'ContactId':_0x1462ce['actions'][_0x37517f]['ContactId'],'ListId':_0x1462ce['actions'][_0x37517f][_0xf8b5('0x106')],'VoiceQueueId':_0x1462ce[_0xf8b5('0x26')][_0x37517f][_0xf8b5('0xdc')]||undefined,'CampaignId':_0x1462ce[_0xf8b5('0x26')][_0x37517f][_0xf8b5('0xdd')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1462ce[_0xf8b5('0x26')][_0x37517f];}}else{return _0x1462ce[_0xf8b5('0x17b')](_0xd34e46,_0x761e99);}}else{if(getDiff(_0x761e99['scheduledat'])<_0xd34e46[_0xf8b5('0x1f6')]*0x3c){if(_0x761e99[_0xf8b5('0x16f')]&&!_0x761e99[_0xf8b5('0x16f')][_0xf8b5('0x1f7')]){_0x1462ce[_0xf8b5('0x1f')][_0xf8b5('0x141')](_0x761e99['id'])['finally'](function(){_0x1462ce[_0xf8b5('0xba')](_0xd34e46);});}else{_0x1462ce[_0xf8b5('0xca')]({'active':![]},_0x761e99['id'],0x1)['finally'](function(){_0x1462ce[_0xf8b5('0xba')](_0xd34e46);});}}else{_0xd34e46[_0xf8b5('0x6d')]+=0x1;_0x1462ce[_0xf8b5('0xba')](_0xd34e46);if(_0xd34e46[_0xf8b5('0x1f8')]){_0x1462ce[_0xf8b5('0xc8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x761e99[_0xf8b5('0xda')],'ListId':_0x761e99[_0xf8b5('0x106')],'VoiceQueueId':_0x761e99[_0xf8b5('0xdc')]||undefined,'CampaignId':_0x761e99[_0xf8b5('0xdd')]||undefined})[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x1f9')));_0x1462ce[_0xf8b5('0xd2')](createObjHistory(_0xd34e46,_0x761e99,_0xf8b5('0x1fa'),0x17,_0xf8b5('0x1fb')))[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0x1fc')));}else{_0x1462ce[_0xf8b5('0xd8')](createObjHistory(_0xd34e46,_0x761e99,_0xf8b5('0x1fd'),0x16,_0xf8b5('0x1fe')),_0xf8b5('0x1ff'),_0xf8b5('0x200'));}}}}else{_0xd34e46['outboundBlacklistCallsDay']+=0x1;_0x1462ce[_0xf8b5('0xd8')](createObjHistory(_0xd34e46,_0x761e99,_0xf8b5('0x201'),0xd,_0xf8b5('0x202')),'[Originate][historyBlacklist]',_0xf8b5('0x203'));throw _0xf8b5('0x204');}};};Dialer['prototype']['handleIvr']=function(_0x473e12){var _0xd3b384=this;var _0x480823=_0x473e12[_0xf8b5('0x205')]-_0x473e12['originated']-_0x473e12[_0xf8b5('0xcb')];emitCampaignSummary(_0x473e12);if(_0x480823>0x0){if(_0x480823>this[_0xf8b5('0x24')]){_0x480823=this[_0xf8b5('0x24')];}_0x473e12[_0xf8b5('0xcb')]+=_0x480823;this[_0xf8b5('0xcd')](_0x473e12['id'],_0x480823,_0x473e12[_0xf8b5('0x206')],_0x473e12)[_0xf8b5('0x40')](function(_0x54ae6b){_0x473e12['temp']-=_0x480823;_0x473e12['temp']=_0x473e12['temp']>0x0?_0x473e12[_0xf8b5('0xcb')]:0x0;if(!checkContactEmpty(_0x54ae6b)){_0x473e12[_0xf8b5('0x45')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xf8b5('0x82')]('[getContactCampaign2][Empty]'+_0x473e12[_0xf8b5('0x43')]);}else{_0x473e12[_0xf8b5('0x79')]+=_0x54ae6b[_0xf8b5('0x9d')];_0x473e12[_0xf8b5('0x45')]='RUNNING';for(var _0xc6140a=0x0;_0xc6140a<_0x54ae6b[_0xf8b5('0x9d')];_0xc6140a+=0x1){_0x473e12[_0xf8b5('0x207')]+=0x1;if(_[_0xf8b5('0xb4')](_0x54ae6b[_0xc6140a])||_[_0xf8b5('0xb4')](_0x54ae6b[_0xc6140a][_0xf8b5('0x193')])||_[_0xf8b5('0xb4')](_0x54ae6b[_0xc6140a][_0xf8b5('0x17e')])){_0xd3b384[_0xf8b5('0xd6')](_0xf8b5('0x208'),_0x473e12,_0x54ae6b[_0xc6140a]);}else{_0xd3b384['checkIsBlackListIvr'](_[_0xf8b5('0xd9')](_0x54ae6b[_0xc6140a],['CampaignId',_0xf8b5('0x209')]))[_0xf8b5('0x40')](_0xd3b384[_0xf8b5('0x1ef')](_0x473e12,_0x54ae6b[_0xc6140a]))[_0xf8b5('0xbd')](_0xd3b384[_0xf8b5('0xd5')]('[actionOriginateIvr]\x20',_0x473e12));}}}})[_0xf8b5('0xbd')](loggerGetContactDialer(_0xf8b5('0x20a'),_0x473e12,_0x480823));}};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x169')]=function(_0x534a45,_0x454349){var _0x2a5b7e=this;var _0x1cdb84=[];var _0x55afc6=_0x454349>=0x1?_0x454349:0x1;if(_0x534a45[_0xf8b5('0x5f')]===_0xf8b5('0x7')){_0x55afc6=0x1;}var _0x5bc570=Math['floor'](_0x534a45[_0xf8b5('0x53')]*_0x55afc6)-_0x534a45[_0xf8b5('0x79')]-_0x534a45[_0xf8b5('0xcb')];emitVoiceQueueSummary(_0x534a45);if(_0x534a45[_0xf8b5('0x20b')]>0x0){var _0x38e667=_0x534a45['dialLimitQueue']-_0x534a45[_0xf8b5('0x79')]-_0x534a45['talking']-_0x534a45[_0xf8b5('0xcb')]-_0x534a45['pTalking'];if(_0x5bc570>_0x38e667){_0x5bc570=_0x38e667;}}if(_0x5bc570>0x0){if(_0x534a45['dialMethod']===_0xf8b5('0x7')){_0x5bc570=0x1;}if(_0x5bc570>this[_0xf8b5('0x24')]){_0x5bc570=this[_0xf8b5('0x24')];}_0x534a45[_0xf8b5('0xcb')]+=_0x5bc570;for(var _0x460ea8 in this[_0xf8b5('0x22')]){if(typeof this[_0xf8b5('0x22')][_0x460ea8]!=='undefined'){if(this[_0xf8b5('0x22')][_0x460ea8][_0xf8b5('0xad')]===_0xf8b5('0x20c')&&this[_0xf8b5('0x22')][_0x460ea8][_0xf8b5('0xe2')]==='reachable'){_0x1cdb84[_0xf8b5('0x13b')](this[_0xf8b5('0x22')][_0x460ea8]['id']);}}}this[_0xf8b5('0x20d')](_0x534a45['id'],_0x1cdb84,_0x5bc570,_0x534a45['dialOrderByScheduledAt'],_0x534a45)[_0xf8b5('0x40')](function(_0x11ae68){_0x534a45['temp']-=_0x5bc570;_0x534a45[_0xf8b5('0xcb')]=_0x534a45[_0xf8b5('0xcb')]>0x0?_0x534a45['temp']:0x0;if(!checkContactEmpty(_0x11ae68)){_0x2a5b7e[_0xf8b5('0xbb')](_0x534a45)[_0xf8b5('0x40')](sendMessageReschedule(_0x534a45))[_0xf8b5('0xbd')](loggerCatch('[countReScheduled]\x20'));}else{_0x534a45[_0xf8b5('0x79')]+=_0x11ae68[_0xf8b5('0x9d')];_0x534a45['message']=_0x534a45[_0xf8b5('0x5f')]===_0xf8b5('0x7')?_0xf8b5('0x20e'):'RUNNING';for(var _0x13772b=0x0;_0x13772b<_0x11ae68[_0xf8b5('0x9d')];_0x13772b+=0x1){if(_[_0xf8b5('0xb4')](_0x11ae68[_0x13772b])||_[_0xf8b5('0xb4')](_0x11ae68[_0x13772b][_0xf8b5('0x193')])||_[_0xf8b5('0xb4')](_0x11ae68[_0x13772b][_0xf8b5('0x17e')])){_0x2a5b7e['emptyContact'](_0xf8b5('0x208'),_0x534a45,_0x11ae68[_0x13772b]);}else{_0x2a5b7e[_0xf8b5('0xbf')](_['pick'](_0x11ae68[_0x13772b],[_0xf8b5('0xdc'),_0xf8b5('0x209')]))[_0xf8b5('0x40')](_0x2a5b7e[_0xf8b5('0x1ef')](_0x534a45,_0x11ae68[_0x13772b]))['catch'](_0x2a5b7e[_0xf8b5('0xd5')](_0xf8b5('0x208'),_0x534a45));}}}})[_0xf8b5('0xbd')](loggerGetContactDialer('[getContactDialer2]',_0x534a45,_0x5bc570));}};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x96')]=function(_0x266f2a){if(_0x266f2a[_0xf8b5('0x20b')]>0x0){var _0x379764=_0x266f2a[_0xf8b5('0x20b')]-_0x266f2a[_0xf8b5('0x79')]-_0x266f2a[_0xf8b5('0x59')];if(_0x379764>0x0){this['tryOriginatePredictive'](_0x266f2a);}else{loggerPredictiveCalls['info'](_0xf8b5('0x20f'));}}else{this['tryOriginatePredictive'](_0x266f2a);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x6b8fb7){var _0x36a4a6=this;var _0xf1a341=[];_0x6b8fb7[_0xf8b5('0x79')]+=0x1;for(var _0xe949b0 in this[_0xf8b5('0x22')]){if(typeof this[_0xf8b5('0x22')][_0xe949b0]!==_0xf8b5('0x9e')){if(this[_0xf8b5('0x22')][_0xe949b0][_0xf8b5('0xad')]===_0xf8b5('0x20c')&&this[_0xf8b5('0x22')][_0xe949b0][_0xf8b5('0xe2')]==='reachable'){_0xf1a341['push'](this[_0xf8b5('0x22')][_0xe949b0]['id']);}}}this[_0xf8b5('0x20d')](_0x6b8fb7['id'],_0xf1a341,0x1,_0x6b8fb7[_0xf8b5('0x206')],_0x6b8fb7)[_0xf8b5('0x40')](function(_0x2ff584){if(!checkContactEmpty(_0x2ff584)){checkContactLowerLimitOriginate(_0x6b8fb7,0x1,0x0);_0x36a4a6[_0xf8b5('0xbb')](_0x6b8fb7)['then'](sendMessageReschedule(_0x6b8fb7))[_0xf8b5('0xbd')](loggerCatch(_0xf8b5('0xbe')));}else{_0x6b8fb7['message']=_0xf8b5('0x210');if(_[_0xf8b5('0xb4')](_0x2ff584[0x0])||_[_0xf8b5('0xb4')](_0x2ff584[0x0][_0xf8b5('0x193')])||_[_0xf8b5('0xb4')](_0x2ff584[0x0]['phone'])){_0x36a4a6['emptyContact'](_0xf8b5('0x208'),_0x6b8fb7,_0x2ff584[0x0]);}else{_0x36a4a6[_0xf8b5('0xbf')](_[_0xf8b5('0xd9')](_0x2ff584[0x0],[_0xf8b5('0xdc'),_0xf8b5('0x209')]))[_0xf8b5('0x40')](_0x36a4a6[_0xf8b5('0x1ef')](_0x6b8fb7,_0x2ff584[0x0]))[_0xf8b5('0xbd')](_0x36a4a6[_0xf8b5('0xd5')]('[actionOriginatePredictive]\x20',_0x6b8fb7));}}})[_0xf8b5('0xbd')](loggerGetContactDialer(_0xf8b5('0x211'),_0x6b8fb7,0x1));emitVoiceQueueSummary(_0x6b8fb7);};Dialer['prototype'][_0xf8b5('0x1e4')]=function(_0x23fdeb,_0x416ea5,_0x1bb58e,_0xac39b5,_0x240097,_0x23f0ad){loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x212'));loggerPredictive[_0xf8b5('0x82')]('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',_0x23fdeb);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x416ea5);loggerPredictive[_0xf8b5('0x82')]('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',_0x1bb58e);loggerPredictive['info'](_0xf8b5('0x213'),_0xac39b5);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x214'),_0x240097);loggerPredictive[_0xf8b5('0x82')]('---------------------------');return new BPromise(function(_0x1aa096,_0x2b9afa){if(_0x23fdeb<=0x0||isNaN(_0x23fdeb)){return _0x2b9afa(msgResponse(_0xf8b5('0x215'),_0xf8b5('0x4d'),_0xf8b5('0x216')+_0x23fdeb));}if(_0x1bb58e<=0x0||isNaN(_0x1bb58e)){return _0x2b9afa(msgResponse(_0xf8b5('0x215'),'Error',_0xf8b5('0x217')+_0x1bb58e));}if(_0xac39b5<=0x0||isNaN(_0xac39b5)){return _0x2b9afa(msgResponse(_0xf8b5('0x215'),'Error',_0xf8b5('0x218')+_0xac39b5));}if(_0x416ea5<=0x0||isNaN(_0x416ea5)){return _0x2b9afa(msgResponse(_0xf8b5('0x215'),_0xf8b5('0x4d'),_0xf8b5('0x219')+_0x416ea5));}if(_0x240097<=0x0||isNaN(_0x240097)){return _0x2b9afa(msgResponse('[abandonmentRate]',_0xf8b5('0x4d'),_0xf8b5('0x21a')+_0x240097));}_0x23f0ad=_0x23f0ad||0x0;var _0x447d88=0x1/_0x1bb58e;var _0xe788e9=0x0;var _0x316238=0x0;var _0x4ecd16=0x0;var _0x17391d=0x0;for(var _0x50fbc6=0x0;_0x4ecd16<_0x240097;_0x50fbc6+=0x1){_0x316238=_0x50fbc6/_0x416ea5;_0xe788e9=(_0xac39b5*_0x316238+_0x23f0ad)/_0x447d88;_0x4ecd16=erlangb(_0xe788e9,_0x23fdeb);_0x17391d=_0xe788e9/_0x23fdeb*(0x1-erlangb(_0xe788e9,_0x23fdeb));}return _0x1aa096({'erlangCalls':_0x50fbc6,'erlangCallToSecond':_0x416ea5/_0x50fbc6,'erlangAbandonmentRate':_0x4ecd16,'erlangBusyFactor':_0x17391d});});};Dialer[_0xf8b5('0xb0')][_0xf8b5('0x1e5')]=function(_0x36e1d9,_0x1a233a,_0x37080e,_0x237d50,_0x53ce50,_0x267649){loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x21b'));loggerPredictive['info'](_0xf8b5('0x21c'),_0x36e1d9);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x21d'),_0x1a233a);loggerPredictive['info'](_0xf8b5('0x21e'),_0x37080e);loggerPredictive[_0xf8b5('0x82')](_0xf8b5('0x213'),_0x237d50);loggerPredictive['info'](_0xf8b5('0x21f'),_0x53ce50);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x12558c,_0x3abf12){if(_0x36e1d9<=0x0||isNaN(_0x36e1d9)){return _0x3abf12(msgResponse('[busyFactor]',_0xf8b5('0x4d'),'m\x20=\x20'+_0x36e1d9));}if(_0x37080e<=0x0||isNaN(_0x37080e)){return _0x3abf12(msgResponse(_0xf8b5('0x220'),_0xf8b5('0x4d'),'Ts\x20=\x20'+_0x37080e));}if(_0x237d50<=0x0||isNaN(_0x237d50)){return _0x3abf12(msgResponse(_0xf8b5('0x220'),'Error',_0xf8b5('0x218')+_0x237d50));}if(_0x1a233a<=0x0||isNaN(_0x1a233a)){return _0x3abf12(msgResponse(_0xf8b5('0x220'),_0xf8b5('0x4d'),_0xf8b5('0x219')+_0x1a233a));}if(_0x53ce50<=0x0||isNaN(_0x53ce50)){return _0x3abf12(msgResponse(_0xf8b5('0x220'),'Error',_0xf8b5('0x221')+_0x53ce50));}_0x267649=_0x267649||0x0;var _0x58f642=0x1/_0x37080e;var _0x49ec81=0x0;var _0x595d35=0x0;var _0x381000=0x0;var _0x1b75b5=0x0;for(var _0x551782=0x0;_0x1b75b5<_0x53ce50;_0x551782+=0x1){_0x595d35=_0x551782/_0x1a233a;_0x49ec81=(_0x237d50*_0x595d35+_0x267649)/_0x58f642;_0x381000=erlangb(_0x49ec81,_0x36e1d9);_0x1b75b5=_0x49ec81/_0x36e1d9*(0x1-erlangb(_0x49ec81,_0x36e1d9));}return _0x12558c({'erlangCalls':_0x551782,'erlangCallToSecond':_0x1a233a/_0x551782,'erlangAbandonmentRate':_0x381000,'erlangBusyFactor':_0x1b75b5});});};module[_0xf8b5('0x222')]=Dialer; \ No newline at end of file +var _0x1f60=['loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','error','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','inspect','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','is\x20disactive','state','statedesc','[uniqueid]','clearZombieChannels','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','loggerHandler','notFound','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','SIP/%s','reachable','unmonitored','isNil','variable','xcally-motion-dialer','dialAMDActive','value','uniqueid','HangupInAMD','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerAgiCallsDay','Machine','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countagentrejectretry','stateGlobal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','voiceQueue','dialDropMaxRetry','additional','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','starttime','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','push','queueStatusComplete','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','isArray','Action','command','iftime\x20%s,%s','timezones','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','checkPreviewRecallReminder','length','Agent','user:dialPreviewRecallReminder','launchHandleIvr','checkIfTime','dialGlobalInterval','dialTimezone','dialPreviewRecallmeReminder','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','XMD-','callerid','dialRandomLastDigitCallerIdNumber','originatecalleridname','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','dialNoAnswerRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','callAdditionalPhoneAfterMin','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','busy','dialBusyRetryFrequency','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','queueStatusComplete:\x20','queuestatus','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RecallFailedTimeout','saveInDb','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','RUNNING','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','[countReScheduled]\x20','ACTIVE','emptyContact','[actionOriginate]\x20','checkContactBlack','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\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','m\x20=\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','util','lodash','uuid','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting'];(function(_0x3425f9,_0x2358ca){var _0x814f39=function(_0x4cb267){while(--_0x4cb267){_0x3425f9['push'](_0x3425f9['shift']());}};_0x814f39(++_0x2358ca);}(_0x1f60,0x1bf));var _0x01f6=function(_0x152a8c,_0x260c63){_0x152a8c=_0x152a8c-0x0;var _0x514342=_0x1f60[_0x152a8c];return _0x514342;};'use strict';var util=require(_0x01f6('0x0'));var _=require(_0x01f6('0x1'));var BPromise=require('bluebird');var uuid=require(_0x01f6('0x2'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0x01f6('0x3'));var ut=require(_0x01f6('0x4'));var config=require(_0x01f6('0x5'));var logger=require(_0x01f6('0x6'))(_0x01f6('0x7'));var loggerBooked=require('../../../config/logger')(_0x01f6('0x8'));var loggerPredictive=require(_0x01f6('0x6'))(_0x01f6('0x9'));var loggerPredictiveCalls=require(_0x01f6('0x6'))(_0x01f6('0xa'));var loggerSyncQueueSummary=require(_0x01f6('0x6'))(_0x01f6('0xb'));var ami=require(_0x01f6('0xc'));config[_0x01f6('0xd')]=_[_0x01f6('0xe')](config[_0x01f6('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x01f6('0xf'))(new Redis(config[_0x01f6('0xd')]));var cmHopper=require(_0x01f6('0x10'));var cmHopperHistory=require(_0x01f6('0x11'));var cmHopperFinal=require(_0x01f6('0x12'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x01f6('0x13'));var voiceQueueRt=require(_0x01f6('0x14'));var RpcSetting=require(_0x01f6('0x15'));var Action=require(_0x01f6('0x16'));var History=require(_0x01f6('0x17'));var Final=require(_0x01f6('0x18'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x01f6('0x19'));var Hangup=require(_0x01f6('0x1a'));var ipAgi=process[_0x01f6('0x1b')][_0x01f6('0x1c')]||_0x01f6('0x1d');var strategy={'rrmemory':_0x01f6('0x1e'),'roundrobin':_0x01f6('0x1f')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x01f6('0x20')][_0x01f6('0x21')]=function(_0x33de1f){this['tail']=this['tail']?this[_0x01f6('0x22')]['finally'](_0x33de1f):_0x33de1f();};function Dialer(_0x49ae84,_0x2693a2){this[_0x01f6('0x23')]=new Sequence();this[_0x01f6('0x24')]=_0x2693a2;this[_0x01f6('0x25')]=_0x49ae84['voiceQueues'];this[_0x01f6('0x26')]=_0x49ae84[_0x01f6('0x26')];this[_0x01f6('0x27')]=_0x49ae84[_0x01f6('0x27')];this[_0x01f6('0x28')]=_0x49ae84['trunks'];this[_0x01f6('0x29')]=config['maxNumberOriginate']||0x2;this[_0x01f6('0x2a')]={};this[_0x01f6('0x2b')]={};this[_0x01f6('0x2c')]={};this[_0x01f6('0x2d')]={};this['optionPredictive']={};this[_0x01f6('0x2e')]={};this['startProgressive']={};this[_0x01f6('0x2f')]={};this[_0x01f6('0x30')]={};this[_0x01f6('0x31')]={};ami['on']('agentconnect',this[_0x01f6('0x32')][_0x01f6('0x33')](this));ami['on'](_0x01f6('0x34'),this[_0x01f6('0x35')]['bind'](this));ami['on']('originateresponse',this[_0x01f6('0x36')][_0x01f6('0x33')](this));ami['on']('agentcomplete',this[_0x01f6('0x37')][_0x01f6('0x33')](this));ami['on'](_0x01f6('0x38'),this['syncQueueSummary']['bind'](this));ami['on'](_0x01f6('0x39'),this[_0x01f6('0x3a')][_0x01f6('0x33')](this));ami['on']('newexten',this[_0x01f6('0x3b')][_0x01f6('0x33')](this));ami['on']('varset',this['syncVarSet'][_0x01f6('0x33')](this));ami['on'](_0x01f6('0x3c'),this[_0x01f6('0x3d')][_0x01f6('0x33')](this));ami['on']('queuestatuscomplete',this[_0x01f6('0x3e')][_0x01f6('0x33')](this));this[_0x01f6('0x3f')]();this[_0x01f6('0x40')]();RpcSetting[_0x01f6('0x41')]()[_0x01f6('0x42')](function(_0x26b9ba){previewRecallmeReminderInterval=_0x26b9ba[_0x01f6('0x43')];});}function isNotNull(_0x32cd68){return _0x32cd68!==null&&!_['isUndefined'](_0x32cd68);}function checkIsLoggedIn(_0x29df4e,_0x52e197){return function(){if(_0x52e197<=0x0){_0x29df4e[_0x01f6('0x44')]=_0x01f6('0x45');throw _0x29df4e['name']+_0x01f6('0x46');}};}function isActive(_0x27b773){return _0x27b773;}function checkIsActive(_0xcf55c7,_0x2a387e){return function(){if(!isActive(_0x2a387e)){_0xcf55c7[_0x01f6('0x44')]=_0x01f6('0x47');throw _0xcf55c7[_0x01f6('0x48')]+_0x01f6('0x49');}};}function checkInterval(_0x316100){return function(){if(!isNotNull(_0x316100['Interval'])){_0x316100[_0x01f6('0x44')]=_0x01f6('0x4a');throw _0x316100[_0x01f6('0x48')]+_0x01f6('0x4b');}if(!isNotNull(_0x316100[_0x01f6('0x4c')][_0x01f6('0x4d')])){_0x316100[_0x01f6('0x44')]='INTERVAL_IS_NULL';throw _0x316100[_0x01f6('0x48')]+_0x01f6('0x4b');}if(!isNotNull(_[_0x01f6('0x4e')](_0x316100['Interval'][_0x01f6('0x4d')]))){_0x316100[_0x01f6('0x44')]='INTERVAL_IS_NULL';throw _0x316100[_0x01f6('0x48')]+_0x01f6('0x4b');}};}function msgResponse(_0x5bb4b2,_0x27c38c,_0x145739){return{'action':_0x5bb4b2,'response':_0x27c38c,'message':_0x145739,'stack':_0x145739};}function myreject(_0x4c15c4){return function(_0x19f509){return _0x4c15c4(msgResponse(_0x01f6('0x4f'),_0x01f6('0x50'),JSON[_0x01f6('0x51')](_0x19f509)));};}function getSeconds(_0x2bc278,_0x36bab8){var _0x562ddd=moment(_0x2bc278)[_0x01f6('0x52')](0x0);var _0x53e9a7=moment(_0x36bab8)[_0x01f6('0x52')](0x0);return _0x562ddd[_0x01f6('0x53')](_0x53e9a7,_0x01f6('0x54'));}function emit(_0x36a8e3,_0x2869ab,_0x5ced7d){io['to'](_0x36a8e3)[_0x01f6('0x55')](_0x2869ab,_0x5ced7d);}function emitVoiceQueueSummary(_0x374f46){if(_0x374f46[_0x01f6('0x56')]===_0x01f6('0x57')){var _0x4f163c={'id':_0x374f46['id'],'name':_0x374f46[_0x01f6('0x48')],'strategy':_0x374f46[_0x01f6('0x58')],'answered':_0x374f46['answered'],'available':_0x374f46[_0x01f6('0x59')],'loggedIn':_0x374f46[_0x01f6('0x5a')],'pTalking':_0x374f46[_0x01f6('0x5b')],'sumBillable':_0x374f46['sumBillable'],'sumDuration':_0x374f46[_0x01f6('0x5c')],'sumHoldTime':_0x374f46[_0x01f6('0x5d')]||0x0,'talking':_0x374f46[_0x01f6('0x5e')],'total':_0x374f46[_0x01f6('0x5f')],'type':_0x374f46[_0x01f6('0x56')],'unmanaged':_0x374f46[_0x01f6('0x60')],'abandoned':_0x374f46[_0x01f6('0x61')],'waiting':_0x374f46[_0x01f6('0x62')],'loggedInDb':_0x374f46[_0x01f6('0x63')],'dialActive':_0x374f46[_0x01f6('0x64')],'dialMethod':_0x374f46[_0x01f6('0x65')],'dialOriginateCallerIdName':_0x374f46[_0x01f6('0x66')],'dialOriginateCallerIdNumber':_0x374f46[_0x01f6('0x67')],'dialOriginateTimeout':_0x374f46[_0x01f6('0x68')],'dialPrefix':_0x374f46[_0x01f6('0x69')],'outboundAnswerAgiCallsDay':_0x374f46['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x374f46[_0x01f6('0x6a')],'outboundBlacklistCallsDay':_0x374f46[_0x01f6('0x6b')],'outboundBusyCallsDay':_0x374f46[_0x01f6('0x6c')],'outboundCongestionCallsDay':_0x374f46[_0x01f6('0x6d')],'outboundDropCallsDayACS':_0x374f46[_0x01f6('0x6e')],'outboundDropCallsDayCallersExit':_0x374f46[_0x01f6('0x6f')],'outboundDropCallsDayTimeout':_0x374f46[_0x01f6('0x70')],'outboundNoAnswerCallsDay':_0x374f46[_0x01f6('0x71')],'outboundNoSuchCallsDay':_0x374f46[_0x01f6('0x72')],'outboundOriginateFailureCallsDay':_0x374f46[_0x01f6('0x73')],'outboundReCallsDay':_0x374f46[_0x01f6('0x74')],'outboundRejectCallsDay':_0x374f46[_0x01f6('0x75')],'outboundUnknownCallsDay':_0x374f46[_0x01f6('0x76')],'predictiveIntervalAnsweredCalls':_0x374f46[_0x01f6('0x77')],'predictiveIntervalAvgHoldtime':_0x374f46[_0x01f6('0x78')],'predictiveIntervalAvgTalktime':_0x374f46['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x374f46[_0x01f6('0x79')],'predictiveIntervalDroppedCallsTimeout':_0x374f46['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x374f46[_0x01f6('0x7a')],'predictiveIntervalErlangCallsDroppedCalls':_0x374f46['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x374f46[_0x01f6('0x7b')],'predictiveIntervalMultiplicativeFactor':_0x374f46[_0x01f6('0x7c')],'predictiveIntervalPauses':_0x374f46[_0x01f6('0x7d')],'predictiveIntervalAvailable':_0x374f46['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x374f46[_0x01f6('0x7e')],'message':_0x374f46[_0x01f6('0x44')],'originated':_0x374f46[_0x01f6('0x7f')],'erlangCalls':_0x374f46[_0x01f6('0x80')],'erlangCallToSecond':_0x374f46[_0x01f6('0x81')],'erlangAbandonmentRate':_0x374f46[_0x01f6('0x82')],'erlangBusyFactor':_0x374f46[_0x01f6('0x83')],'startPredictive':_0x374f46['startPredictive'],'startProgressive':_0x374f46[_0x01f6('0x84')]};if(_0x374f46[_0x01f6('0x85')]){_0x4f163c['Trunk']={'id':_0x374f46[_0x01f6('0x85')]['id'],'name':_0x374f46['Trunk']['name'],'active':_0x374f46[_0x01f6('0x85')][_0x01f6('0x86')],'callerid':_0x374f46[_0x01f6('0x85')]['callerid']};}if(_0x374f46[_0x01f6('0x4c')]){_0x4f163c[_0x01f6('0x4c')]={'id':_0x374f46[_0x01f6('0x4c')]['id'],'name':_0x374f46[_0x01f6('0x4c')][_0x01f6('0x48')]};}var _0x303149=md5(JSON['stringify'](_0x4f163c));if(_0x374f46[_0x01f6('0x87')]!==_0x303149){_0x374f46['md5']=_0x303149;emit(util[_0x01f6('0x88')](_0x01f6('0x89'),_0x4f163c[_0x01f6('0x48')]),_0x01f6('0x8a'),_0x4f163c);}}}function emitCampaignSummary(_0x45cbf4){if(_0x45cbf4[_0x01f6('0x56')]===_0x01f6('0x8b')){emit(util[_0x01f6('0x88')](_0x01f6('0x8c'),_0x45cbf4[_0x01f6('0x48')]),'campaign:save',_0x45cbf4);}}function checkGetDataPredictive(_0x1a61b8){if(isNotNull(_0x1a61b8)&&!_[_0x01f6('0x4e')](_0x1a61b8)){loggerPredictive['info'](_0x01f6('0x8d'));loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x8f'),_0x1a61b8[_0x01f6('0x7e')]);loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x90'),_0x1a61b8[_0x01f6('0x77')]);loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x91'),_0x1a61b8[_0x01f6('0x92')]);loggerPredictive['info'](_0x01f6('0x93'),_0x1a61b8[_0x01f6('0x79')]);loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x94'),_0x1a61b8[_0x01f6('0x78')]);loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x95'),_0x1a61b8[_0x01f6('0x96')]);loggerPredictive[_0x01f6('0x8e')]('---------------------------');if(_0x1a61b8[_0x01f6('0x7e')]>0x0){if(!_[_0x01f6('0x97')](_0x1a61b8['predictiveIntervalAvgTalktime'])&&_0x1a61b8['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x98'));if(!_[_0x01f6('0x97')](_0x1a61b8[_0x01f6('0x78')])&&_0x1a61b8[_0x01f6('0x78')]>0x0){return!![];}loggerPredictive['info'](_0x01f6('0x99'));}else{loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x9a'));}}else{loggerPredictive['info'](_0x01f6('0x9b'));}return![];}function mergeDataErlangB(_0x1362ef){return function(_0x322ab0){loggerPredictive['info'](_0x01f6('0x9c'));loggerPredictive[_0x01f6('0x8e')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x322ab0[_0x01f6('0x80')]);loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x9d'),_0x322ab0['erlangCallToSecond']);loggerPredictive[_0x01f6('0x8e')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x322ab0[_0x01f6('0x82')]);loggerPredictive[_0x01f6('0x8e')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x322ab0[_0x01f6('0x83')]);loggerPredictive[_0x01f6('0x8e')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x322ab0[_0x01f6('0x82')]);loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x9e'));_[_0x01f6('0x9f')](_0x1362ef,_0x322ab0);};}function getDiff(_0x2e46ea){var _0x487509=moment()[_0x01f6('0x52')](0x0);var _0x4e4703=moment(_0x2e46ea)['milliseconds'](0x0);return _0x487509[_0x01f6('0x53')](_0x4e4703,_0x01f6('0x54'));}function ifInterval(_0x588148,_0x11beae){if(_[_0x01f6('0x97')](_0x11beae)){return![];}return getDiff(_0x11beae)<_0x588148*0x3c;}function freeVariablesPredictive(_0x5e08cb){if(isNotNull(_0x5e08cb)){if(!_[_0x01f6('0x97')](_0x5e08cb[_0x01f6('0x84')])){_0x5e08cb[_0x01f6('0x84')]=undefined;loggerPredictive['info'](_0x5e08cb[_0x01f6('0x48')],_0x01f6('0xa0'));}if(!_[_0x01f6('0x97')](_0x5e08cb['startPredictive'])){_0x5e08cb[_0x01f6('0x2e')]=undefined;loggerPredictive[_0x01f6('0x8e')](_0x5e08cb[_0x01f6('0x48')],_0x01f6('0xa1'));}if(!_[_0x01f6('0x97')](_0x5e08cb[_0x01f6('0xa2')])){clearInterval(_0x5e08cb[_0x01f6('0xa2')]);_0x5e08cb[_0x01f6('0xa2')]=undefined;loggerPredictive[_0x01f6('0x8e')](_0x5e08cb[_0x01f6('0x48')],_0x01f6('0xa3'));}}}function erlangb(_0x31d05f,_0x3b2567){if(_0x3b2567===0x0){return 0x0;}var _0x39f6de=0x1;for(var _0x17349c=0x1;_0x17349c<=_0x3b2567;_0x17349c+=0x1){_0x39f6de=0x1+_0x39f6de*_0x17349c/_0x31d05f;}return 0x1/_0x39f6de;}function isVoiceQueueOutbound(_0x28d7c8){return _0x28d7c8==='outbound';}function isNotPreview(_0xc1ee6c){return _0xc1ee6c!==_0x01f6('0x24');}function isCampaignIvr(_0x1137a4){return _0x1137a4===_0x01f6('0x8b');}function getCallerId(_0x56786a,_0x3e741a,_0x469f8f){if(!_['isUndefined'](_0x469f8f)&&typeof _0x469f8f==='string'&&!_[_0x01f6('0x4e')](_0x469f8f)){if(!_[_0x01f6('0x97')](_0x3e741a)&&typeof _0x3e741a===_0x01f6('0xa4')&&!_[_0x01f6('0x4e')](_0x3e741a)){return util['format'](_0x01f6('0xa5'),_0x3e741a,_0x469f8f);}return util[_0x01f6('0x88')](_0x01f6('0xa5'),_0x469f8f,_0x469f8f);}if(!_[_0x01f6('0x97')](_0x56786a)&&typeof _0x56786a==='string'&&!_[_0x01f6('0x4e')](_0x56786a)){return _0x56786a;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x4bd42a,_0x11e6b2){return function(_0x561e82){freeVariablesPredictive(_0x11e6b2);emitVoiceQueueSummary(_0x11e6b2);emitCampaignSummary(_0x11e6b2);loggerSyncQueueSummary[_0x01f6('0xa6')](_0x4bd42a,util['inspect'](_0x561e82,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x36d615,_0x2823c5){return function(_0x407333){loggerPredictive[_0x01f6('0xa6')](_0x2823c5['name'],_0x36d615);loggerPredictive[_0x01f6('0xa6')](_0x407333['stack']);freeVariablesPredictive(_0x2823c5);};}function loggerCatch(_0x17762e){return function(_0x117248){logger[_0x01f6('0xa6')](_0x17762e,util['inspect'](_0x117248,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x362df3){return _0x362df3&&!_[_0x01f6('0x97')](_0x362df3)&&_0x362df3['length']>0x0;}function decremetOriginate(_0x5c84d4){if(!_[_0x01f6('0x97')](_0x5c84d4)&&_0x5c84d4!==null){if(typeof _0x5c84d4['originated']!==_0x01f6('0xa7')){if(_0x5c84d4['originated']>0x0){_0x5c84d4['originated']-=0x1;}else{logger[_0x01f6('0xa6')](_0x01f6('0xa8'));}}}else{logger[_0x01f6('0xa6')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x42ca30,_0x13f19f,_0xfce580){if(_0x13f19f>_0xfce580){for(var _0x118cdb=0x0;_0x118cdb<_0x13f19f-_0xfce580;_0x118cdb+=0x1){decremetOriginate(_0x42ca30);}}}function loggerGetContactDialer(_0xddb058,_0x4fc5db,_0x59b4d6){return function(_0x360580){checkContactLowerLimitOriginate(_0x4fc5db,_0x59b4d6,0x0);logger[_0x01f6('0xa6')](_0xddb058,util[_0x01f6('0xa9')](_0x360580,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5bfc0c){return function(_0x394711){if(isNotNull(_0x394711)&&isNotNull(_0x394711[0x0])){if(_0x394711[0x0][_0x01f6('0xaa')]>0x0){_0x5bfc0c[_0x01f6('0x44')]=_0x01f6('0xab');logger[_0x01f6('0x8e')](_0x01f6('0xac')+_0x5bfc0c[_0x01f6('0x48')],_0x394711[0x0][_0x01f6('0xaa')],_0x01f6('0xad'));}else{_0x5bfc0c[_0x01f6('0x44')]=_0x01f6('0xae');logger[_0x01f6('0x8e')](_0x01f6('0xaf')+_0x5bfc0c['name']);}}};}function notSendMessagesQueue(_0x3dcd70){if(_0x3dcd70[_0x01f6('0xb0')]){freeVariablesPredictive(_0x3dcd70);if(_0x3dcd70['originated']===0x0&&_0x3dcd70[_0x01f6('0x5e')]===0x0&&_0x3dcd70[_0x01f6('0x62')]===0x0&&(_0x3dcd70[_0x01f6('0x5b')]||0x0)===0x0){_0x3dcd70['sendMessageOneNotActive']=![];_0x3dcd70[_0x01f6('0x59')]=0x0;_0x3dcd70[_0x01f6('0x44')]=_0x01f6('0x47');loggerSyncQueueSummary['error'](_0x01f6('0xb1'),_0x3dcd70[_0x01f6('0x48')],_0x01f6('0xb2'));}else{_0x3dcd70[_0x01f6('0x44')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x01f6('0xa6')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x3dcd70[_0x01f6('0x48')],'is\x20disactive');}emitVoiceQueueSummary(_0x3dcd70);}}function notSendMessagesCampaign(_0x55090c){if(_0x55090c[_0x01f6('0xb0')]){if(_0x55090c[_0x01f6('0x7f')]===0x0){_0x55090c[_0x01f6('0xb0')]=![];_0x55090c[_0x01f6('0x44')]=_0x01f6('0x47');loggerSyncQueueSummary[_0x01f6('0xa6')](_0x01f6('0xb3'),_0x55090c[_0x01f6('0x48')],_0x01f6('0xb2'));}else{_0x55090c[_0x01f6('0x44')]=_0x01f6('0xb4');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x55090c[_0x01f6('0x48')],_0x01f6('0xb5'));}emitCampaignSummary(_0x55090c);}}function createObjHistory(_0x33a8e3,_0x40dbb8,_0x3c80b5,_0x39302d,_0x324f26){_0x33a8e3[_0x01f6('0x44')]=_0x3c80b5;var _0x546e68=new Action(_0x33a8e3,_0x40dbb8);var _0xb1fb26=new History(_0x546e68);_0xb1fb26[_0x01f6('0xb6')]=_0x39302d;_0xb1fb26[_0x01f6('0xb7')]=_0x324f26;_0xb1fb26['endtime']=_0x546e68['starttime'];return _0xb1fb26;}Dialer['prototype'][_0x01f6('0x40')]=function(){var _0x3bea4d=this;setInterval(function(){_0x3bea4d['clearZombieChannels'](_0x3bea4d[_0x01f6('0x2d')],_0x01f6('0xb8'));_0x3bea4d['clearZombieChannels'](_0x3bea4d[_0x01f6('0x2b')],'[actions]');},0x32c8);};Dialer[_0x01f6('0x20')][_0x01f6('0xb9')]=function(_0x2b598f,_0x31f051){var _0x4494e4=this;for(var _0x124d69 in _0x2b598f){if(typeof _0x2b598f[_0x124d69]!==_0x01f6('0xa7')){this[_0x01f6('0x23')][_0x01f6('0x21')](function(){if(!_['isNil'](_0x2b598f[_0x124d69])){return ami['Action']({'action':_0x01f6('0xba'),'channel':_0x2b598f[_0x124d69][_0x01f6('0xbb')]})[_0x01f6('0xbc')](function(_0x3b1f13){if(_0x3b1f13[_0x01f6('0x44')]===_0x01f6('0xbd')){setTimeout(function(){if(_0x2b598f[_0x124d69]&&_0x2b598f[_0x124d69][_0x01f6('0x56')]!=='ivr'){_0x4494e4[_0x01f6('0xbe')](_0x4494e4[_0x01f6('0x25')][_0x2b598f[_0x124d69][_0x01f6('0xbf')]]);logger[_0x01f6('0xa6')](_0x01f6('0xc0'),_0x31f051,_0x124d69,_0x2b598f[_0x124d69][_0x01f6('0xbf')]);delete _0x2b598f[_0x124d69];}if(_0x2b598f[_0x124d69]&&_0x2b598f[_0x124d69][_0x01f6('0x56')]===_0x01f6('0x8b')){_0x4494e4[_0x01f6('0xbe')](_0x4494e4[_0x01f6('0x26')][_0x2b598f[_0x124d69][_0x01f6('0xbf')]]);logger[_0x01f6('0xa6')]('[Dialer][checkChannel][ivr]',_0x31f051,_0x124d69,_0x2b598f[_0x124d69][_0x01f6('0xbf')]);delete _0x2b598f[_0x124d69];}},0x2328);}});}});}}};Dialer['prototype'][_0x01f6('0xc1')]=function(_0x531388){return BPromise[_0x01f6('0xc2')]()[_0x01f6('0x42')](cmHopper[_0x01f6('0xc1')](_0x531388))[_0x01f6('0xbc')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0x01f6('0xc3')]=function(_0x276b39){return BPromise[_0x01f6('0xc2')]()['then'](cmHopperBlack[_0x01f6('0xc3')](_0x276b39))[_0x01f6('0xbc')](loggerCatch(_0x01f6('0xc4')));};Dialer[_0x01f6('0x20')]['verifyAdditionalPhones']=function(_0x1b97b0,_0x47e5ae,_0x237d3d){return BPromise[_0x01f6('0xc2')]()['then'](cmHopperAdditionalPhone[_0x01f6('0xc5')](_0x1b97b0,_0x47e5ae,_0x237d3d))['catch'](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer['prototype'][_0x01f6('0xc6')]=function(_0x1067e0,_0x1098df,_0x5e3a01){return BPromise['resolve']()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x1067e0,_0x1098df,_0x5e3a01))[_0x01f6('0xbc')](loggerCatch(_0x01f6('0xc7')));};Dialer[_0x01f6('0x20')][_0x01f6('0xc8')]=function(_0x1daa4e){return BPromise['resolve']()[_0x01f6('0x42')](cmHopperBlack[_0x01f6('0xc8')](_0x1daa4e))[_0x01f6('0xbc')](loggerCatch(_0x01f6('0xc9')));};Dialer[_0x01f6('0x20')][_0x01f6('0xca')]=function(_0x46d7fd){return BPromise[_0x01f6('0xc2')]()['then'](cmHopperHistory[_0x01f6('0xcb')](_0x46d7fd))[_0x01f6('0xbc')](loggerCatch(_0x01f6('0xcc')));};Dialer[_0x01f6('0x20')][_0x01f6('0xcd')]=function(_0xe2e41c){return BPromise[_0x01f6('0xc2')]()[_0x01f6('0x42')](cmHopper[_0x01f6('0xcd')](_0xe2e41c))[_0x01f6('0xbc')](loggerCatch(_0x01f6('0xce')));};Dialer[_0x01f6('0x20')][_0x01f6('0xcf')]=function(_0x3bad83,_0x27034a,_0x5ba625){return BPromise[_0x01f6('0xc2')]()[_0x01f6('0x42')](cmHopper['unlockContact'](_0x3bad83,_0x27034a,_0x5ba625))['catch'](loggerCatch(_0x01f6('0xd0')));};Dialer[_0x01f6('0x20')]['getContactDialer']=function(_0x2bf444,_0xc72d1d,_0x218981,_0x46ac49,_0xe86ff5){return BPromise[_0x01f6('0xc2')]()[_0x01f6('0x42')](cmHopper[_0x01f6('0xd1')](_0x2bf444,_0xc72d1d,_0x218981,_0x46ac49))[_0x01f6('0xbc')](function(_0x2adfc2){_0xe86ff5[_0x01f6('0xd2')]-=_0x218981;_0xe86ff5[_0x01f6('0xd2')]=_0xe86ff5[_0x01f6('0xd2')]>0x0?_0xe86ff5[_0x01f6('0xd2')]:0x0;loggerCatch(_0x01f6('0xd3'))(_0x2adfc2);});};Dialer[_0x01f6('0x20')][_0x01f6('0xd4')]=function(_0x31e5c5,_0x37115d,_0x11df0c,_0x111da7){return BPromise[_0x01f6('0xc2')]()[_0x01f6('0x42')](cmHopper[_0x01f6('0xd4')](_0x31e5c5,_0x37115d,_0x11df0c))[_0x01f6('0xbc')](function(_0x1186e0){_0x111da7['temp']-=_0x37115d;_0x111da7[_0x01f6('0xd2')]=_0x111da7['temp']>0x0?_0x111da7[_0x01f6('0xd2')]:0x0;loggerCatch(_0x01f6('0xd5'))(_0x1186e0);});};Dialer['prototype'][_0x01f6('0xd6')]=function(_0x704771){return BPromise['resolve']()[_0x01f6('0x42')](voiceQueueRt[_0x01f6('0xd6')](_0x704771))[_0x01f6('0xbc')](loggerCatch(_0x01f6('0xd7')));};Dialer[_0x01f6('0x20')][_0x01f6('0xd8')]=function(_0x3ba6eb){return BPromise['resolve']()[_0x01f6('0x42')](cmHopper[_0x01f6('0xd8')](_0x3ba6eb))['catch'](loggerCatch(_0x01f6('0xd9')));};Dialer['prototype'][_0x01f6('0xda')]=function(_0x4660ee){return BPromise[_0x01f6('0xc2')]()['then'](cmHopperHistory[_0x01f6('0xda')](_0x4660ee))[_0x01f6('0xbc')](loggerCatch(_0x01f6('0xdb')));};Dialer[_0x01f6('0x20')][_0x01f6('0xbe')]=function(_0x395ef0){if(!_['isUndefined'](_0x395ef0)&&_0x395ef0!==null){if(typeof _0x395ef0[_0x01f6('0x7f')]!==_0x01f6('0xa7')){if(_0x395ef0['originated']>0x0){_0x395ef0['originated']-=0x1;}else{logger[_0x01f6('0xa6')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x01f6('0x20')][_0x01f6('0xdc')]=function(_0x3ca212,_0x30a203){var _0x3aa3cb=this;return function(_0x577054){_0x3aa3cb[_0x01f6('0xbe')](_0x30a203);logger['error'](_0x3ca212,util[_0x01f6('0xa9')](_0x577054,{'showHidden':![],'depth':null}));};};Dialer[_0x01f6('0x20')]['emptyContact']=function(_0x27f15f,_0x2bf541,_0x54ff6c){var _0x3b243b={'state':0x19,'statedesc':_0x01f6('0xdd')};this[_0x01f6('0xbe')](_0x2bf541);this['saveInDb'](_['merge'](_0x3b243b,_[_0x01f6('0xde')](_0x54ff6c,[_0x01f6('0xdf'),_0x01f6('0xe0'),_0x01f6('0xe1'),_0x01f6('0xe2'),'CampaignId'])),_0x01f6('0xe3'),_0x01f6('0xe4'));logger[_0x01f6('0xa6')](_0x27f15f);};Dialer[_0x01f6('0x20')][_0x01f6('0xe5')]=function(_0x469826){return _0x469826===_0x01f6('0xe6');};Dialer[_0x01f6('0x20')]['isTrunkReachable']=function(_0x190b08){return!_[_0x01f6('0x97')](_0x190b08)&&_0x190b08&&!_['isUndefined'](_0x190b08[_0x01f6('0x48')])&&!_['isUndefined'](_0x190b08[_0x01f6('0x86')])&&_0x190b08[_0x01f6('0x86')]&&(this[_0x01f6('0x28')][util[_0x01f6('0x88')](_0x01f6('0xe7'),_0x190b08[_0x01f6('0x48')])][_0x01f6('0xba')]===_0x01f6('0xe8')||this[_0x01f6('0x28')][util[_0x01f6('0x88')]('SIP/%s',_0x190b08[_0x01f6('0x48')])][_0x01f6('0xba')]===_0x01f6('0xe9'));};Dialer[_0x01f6('0x20')]['saveInDb']=function(_0x4af747,_0x56826e,_0x1ea9d1){this[_0x01f6('0xda')](_0x4af747)[_0x01f6('0xbc')](loggerCatch(_0x56826e));this[_0x01f6('0xd8')](_0x4af747)[_0x01f6('0xbc')](loggerCatch(_0x1ea9d1));};Dialer[_0x01f6('0x20')]['syncVarSet']=function(_0x5cbabf){var _0x5a46f2=this[_0x01f6('0x2d')][_0x5cbabf['uniqueid']];var _0x394cd9;if(!_[_0x01f6('0xea')](_0x5cbabf)&&!_[_0x01f6('0xea')](_0x5cbabf[_0x01f6('0xeb')])&&!_[_0x01f6('0xea')](_0x5cbabf[_0x01f6('0xeb')]['amdstatus'])&&_0x5cbabf['exten']===_0x01f6('0xec')&&_0x5a46f2){if(_0x5a46f2[_0x01f6('0x56')]!==_0x01f6('0x8b')&&this[_0x01f6('0x25')][_0x5a46f2[_0x01f6('0xbf')]][_0x01f6('0xed')]&&_0x5cbabf[_0x01f6('0xee')]==='HANGUP'){delete this[_0x01f6('0x2d')][_0x5cbabf[_0x01f6('0xef')]];this[_0x01f6('0xbe')](this[_0x01f6('0x25')][_0x5a46f2[_0x01f6('0xbf')]]);this[_0x01f6('0x25')][_0x5a46f2[_0x01f6('0xbf')]][_0x01f6('0x6a')]+=0x1;this['voiceQueues'][_0x5a46f2[_0x01f6('0xbf')]]['outboundAnswerAgiCallsDay']+=0x1;_0x394cd9=new Hangup(_0x5a46f2,_0x5cbabf);_0x394cd9[_0x01f6('0xb6')]=0x12;_0x394cd9[_0x01f6('0xb7')]=_0x01f6('0xf0');_0x394cd9[_0x01f6('0xf1')]=_0x01f6('0xf2');ami[_0x01f6('0x55')](_0x01f6('0xf3'),ut[_0x01f6('0xf4')](_0x394cd9,'amd'));this['saveInDb'](_0x394cd9,_0x01f6('0xf5'),_0x01f6('0xf6'));}if(_0x5a46f2[_0x01f6('0x56')]!==_0x01f6('0x8b')&&this[_0x01f6('0x25')][_0x5a46f2[_0x01f6('0xbf')]][_0x01f6('0xed')]&&_0x5cbabf[_0x01f6('0xee')]===_0x01f6('0xf7')){var _0x436056=this;return new BPromise(function(_0xcd6517,_0x5cd7bf){delete _0x436056[_0x01f6('0x2d')][_0x5cbabf[_0x01f6('0xef')]];_0x436056[_0x01f6('0xbe')](_0x436056['voiceQueues'][_0x5a46f2[_0x01f6('0xbf')]]);_0x436056[_0x01f6('0x25')][_0x5a46f2[_0x01f6('0xbf')]][_0x01f6('0x6a')]+=0x1;_0x436056[_0x01f6('0x25')][_0x5a46f2[_0x01f6('0xbf')]][_0x01f6('0xf8')]+=0x1;var _0xe8ed3c=_0x436056['voiceQueues'][_0x5a46f2[_0x01f6('0xbf')]];var _0x1087a5=new Hangup(_0x5a46f2,_0x5cbabf);_0x1087a5[_0x01f6('0xb6')]=0x13;_0x1087a5[_0x01f6('0xb7')]=_0x01f6('0xf9');_0x1087a5[_0x01f6('0xf1')]='AMD';_0x1087a5[_0x01f6('0xfa')]+=0x1;_0x1087a5[_0x01f6('0xfb')]+=0x1;_0x1087a5['amd']=!![];ami[_0x01f6('0x55')](_0x01f6('0xf3'),ut[_0x01f6('0xf4')](_0x1087a5,_0x01f6('0xfc')));_0x436056[_0x01f6('0xda')](_0x1087a5)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0xfd')));if(_0x1087a5[_0x01f6('0xfe')]+_0x1087a5['countcongestionretry']+_0x1087a5[_0x01f6('0xff')]+_0x1087a5[_0x01f6('0x100')]+_0x1087a5[_0x01f6('0x101')]+_0x1087a5[_0x01f6('0x102')]+_0x1087a5[_0x01f6('0xfa')]+_0x1087a5['countagentrejectretry']>=_0xe8ed3c[_0x01f6('0x103')]){_0x436056['stateGlobal'](_0x1087a5,_0xcd6517,_0x5cd7bf,'reason19\x20machine....');}else{if(_0x1087a5[_0x01f6('0xfa')]>=_0xe8ed3c[_0x01f6('0x104')]){_0x436056[_0x01f6('0x105')](_0x1087a5,_0xcd6517,_0x5cd7bf,_0x01f6('0x106'));}else{_0x436056[_0x01f6('0xcd')]({'active':![],'countmachineretry':_0x1087a5[_0x01f6('0xfa')],'scheduledat':moment()[_0x01f6('0x107')](_0xe8ed3c[_0x01f6('0x108')],_0x01f6('0x109'))[_0x01f6('0x88')](_0x01f6('0x10a')),'ContactId':_0x1087a5[_0x01f6('0xdf')],'ListId':_0x1087a5[_0x01f6('0xe0')],'VoiceQueueId':_0x1087a5[_0x01f6('0xe2')]||undefined,'CampaignId':_0x1087a5[_0x01f6('0x10b')]||undefined})[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x10c')));_0xcd6517({'reschedule':0x1});}}});}if(_0x5a46f2[_0x01f6('0x56')]===_0x01f6('0x8b')&&this[_0x01f6('0x26')][_0x5a46f2[_0x01f6('0xbf')]]['dialAMDActive']&&_0x5cbabf[_0x01f6('0xee')]==='HANGUP'){delete this[_0x01f6('0x2d')][_0x5cbabf[_0x01f6('0xef')]];this[_0x01f6('0xbe')](this[_0x01f6('0x26')][_0x5a46f2['queue']]);_0x394cd9=new Hangup(_0x5a46f2,_0x5cbabf);_0x394cd9[_0x01f6('0xb6')]=0x12;_0x394cd9[_0x01f6('0xb7')]=_0x01f6('0xf0');_0x394cd9['membername']=_0x01f6('0xf2');ami[_0x01f6('0x55')](_0x01f6('0xf3'),ut[_0x01f6('0xf4')](_0x394cd9,_0x01f6('0xfc')));this['saveInDb'](_0x394cd9,_0x01f6('0x10d'),_0x01f6('0x10e'));}if(_0x5a46f2[_0x01f6('0x56')]===_0x01f6('0x8b')&&this['campaigns'][_0x5a46f2[_0x01f6('0xbf')]][_0x01f6('0xed')]&&_0x5cbabf[_0x01f6('0xee')]==='MACHINE'){var _0x436056=this;return new BPromise(function(_0x1da52c,_0x5d431f){delete _0x436056[_0x01f6('0x2d')][_0x5cbabf['uniqueid']];_0x436056[_0x01f6('0xbe')](_0x436056[_0x01f6('0x26')][_0x5a46f2['queue']]);_0x436056[_0x01f6('0x26')][_0x5a46f2['queue']][_0x01f6('0x6a')]+=0x1;_0x436056[_0x01f6('0x26')][_0x5a46f2[_0x01f6('0xbf')]][_0x01f6('0xf8')]+=0x1;var _0x2bf8a2=_0x436056[_0x01f6('0x26')][_0x5a46f2[_0x01f6('0xbf')]];var _0x578a4f=new Hangup(_0x5a46f2,_0x5cbabf);_0x578a4f[_0x01f6('0xb6')]=0x13;_0x578a4f[_0x01f6('0xb7')]=_0x01f6('0xf9');_0x578a4f['membername']='AMD';_0x578a4f[_0x01f6('0xfa')]+=0x1;_0x578a4f['countglobal']+=0x1;_0x578a4f[_0x01f6('0xfc')]=!![];ami['emit'](_0x01f6('0xf3'),ut[_0x01f6('0xf4')](_0x578a4f,'amd'));_0x436056['createHistory'](_0x578a4f)['catch'](loggerCatch(_0x01f6('0xfd')));if(_0x578a4f[_0x01f6('0xfe')]+_0x578a4f['countcongestionretry']+_0x578a4f[_0x01f6('0xff')]+_0x578a4f[_0x01f6('0x100')]+_0x578a4f[_0x01f6('0x101')]+_0x578a4f[_0x01f6('0x102')]+_0x578a4f['countmachineretry']+_0x578a4f[_0x01f6('0x10f')]>=_0x2bf8a2[_0x01f6('0x103')]){_0x436056[_0x01f6('0x110')](_0x578a4f,_0x1da52c,_0x5d431f,'reason19\x20machine....');}else{if(_0x578a4f[_0x01f6('0xfa')]>=_0x2bf8a2['dialMachineMaxRetry']){_0x436056[_0x01f6('0x105')](_0x578a4f,_0x1da52c,_0x5d431f,_0x01f6('0x106'));}else{_0x436056[_0x01f6('0xcd')]({'active':![],'countmachineretry':_0x578a4f['countmachineretry'],'scheduledat':moment()['add'](_0x2bf8a2[_0x01f6('0x108')],'minutes')[_0x01f6('0x88')](_0x01f6('0x10a')),'ContactId':_0x578a4f[_0x01f6('0xdf')],'ListId':_0x578a4f['ListId'],'VoiceQueueId':_0x578a4f['VoiceQueueId']||undefined,'CampaignId':_0x578a4f[_0x01f6('0x10b')]||undefined})[_0x01f6('0xbc')](loggerCatch('[rescheduleContact][Machine]'));_0x1da52c({'reschedule':0x1});}}});}}};Dialer[_0x01f6('0x20')][_0x01f6('0x3a')]=function(_0x54816a){var _0x475de9=this[_0x01f6('0x2d')][_0x54816a[_0x01f6('0xef')]];var _0x2eab82=this;var _0x25a913;if(_0x475de9&&_0x475de9[_0x01f6('0x56')]==='ivr'){delete this[_0x01f6('0x2d')][_0x54816a['uniqueid']];this[_0x01f6('0xbe')](this[_0x01f6('0x26')][_0x475de9[_0x01f6('0xbf')]]);this[_0x01f6('0x26')][_0x475de9[_0x01f6('0xbf')]][_0x01f6('0x111')]+=0x1;_0x25a913=new Hangup(_0x475de9,_0x54816a);this[_0x01f6('0xda')](_0x25a913)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x112')));this['moveContactManagedDialer'](_0x25a913)['catch'](loggerCatch(_0x01f6('0x113')));}if(_0x475de9&&_0x475de9['type']!==_0x01f6('0x8b')&&isNotNull(this[_0x01f6('0x25')][_0x475de9[_0x01f6('0xbf')]][_0x01f6('0x114')])){delete this[_0x01f6('0x2d')][_0x54816a[_0x01f6('0xef')]];this[_0x01f6('0xbe')](this[_0x01f6('0x25')][_0x475de9[_0x01f6('0xbf')]]);this[_0x01f6('0x25')][_0x475de9[_0x01f6('0xbf')]]['outboundAnswerCallsDay']+=0x1;this[_0x01f6('0x25')][_0x475de9[_0x01f6('0xbf')]][_0x01f6('0xf8')]+=0x1;_0x25a913=new Hangup(_0x475de9,_0x54816a);_0x25a913[_0x01f6('0xb6')]=0x10;_0x25a913[_0x01f6('0xb7')]=_0x01f6('0x115');_0x25a913['membername']=_0x01f6('0x116');this[_0x01f6('0xda')](_0x25a913)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x112')));this[_0x01f6('0xd8')](_0x25a913)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x113')));}if(_0x475de9&&_0x475de9[_0x01f6('0x56')]!==_0x01f6('0x8b')&&!isNotNull(this[_0x01f6('0x25')][_0x475de9[_0x01f6('0xbf')]][_0x01f6('0x114')])){delete this[_0x01f6('0x2d')][_0x54816a[_0x01f6('0xef')]];this['updateOriginated'](this[_0x01f6('0x25')][_0x475de9[_0x01f6('0xbf')]]);this[_0x01f6('0x25')][_0x475de9[_0x01f6('0xbf')]]['outboundUnknownCallsDay']+=0x1;_0x25a913=new Hangup(_0x475de9,_0x54816a);_0x25a913[_0x01f6('0xb6')]=0xc;_0x25a913[_0x01f6('0xb7')]=_0x54816a['cause-txt'];_0x25a913['membername']=_0x01f6('0x117');this[_0x01f6('0xda')](_0x25a913)[_0x01f6('0xbc')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x01f6('0xd8')](_0x25a913)['catch'](loggerCatch(_0x01f6('0x113')));}};Dialer['prototype'][_0x01f6('0x37')]=function(_0x26aca3){var _0xc79041=this['uniqueId'][_0x26aca3[_0x01f6('0xef')]];var _0x2dce97=this;if(this[_0x01f6('0x25')][_0x26aca3[_0x01f6('0xbf')]]){if(_0xc79041&&_0xc79041['type']!=='ivr'){delete this[_0x01f6('0x2d')][_0x26aca3[_0x01f6('0xef')]];this[_0x01f6('0x25')][_0x26aca3['queue']]['outboundAnswerCallsDay']+=0x1;var _0x55cc5e=new AgentComplete(_0xc79041,_0x26aca3);if(_0x26aca3[_0x01f6('0x118')]===_0x01f6('0x119')){_0x55cc5e[_0x01f6('0x11a')]=this[_0x01f6('0x25')][_0x26aca3[_0x01f6('0xbf')]][_0x01f6('0x11b')]&&this[_0x01f6('0x25')][_0x26aca3[_0x01f6('0xbf')]][_0x01f6('0x11c')]?moment()[_0x01f6('0x88')](_0x01f6('0x10a')):undefined;}this['createHistory'](_0x55cc5e)['catch'](loggerCatch(_0x01f6('0x11d')));this[_0x01f6('0xd8')](_0x55cc5e)[_0x01f6('0xbc')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype']['syncAgentConnect']=function(_0x20023e){if(this[_0x01f6('0x25')][_0x20023e[_0x01f6('0xbf')]]){if(this['uniqueId'][_0x20023e[_0x01f6('0xef')]]&&this[_0x01f6('0x2d')][_0x20023e['uniqueid']]['type']!=='ivr'){this[_0x01f6('0xbe')](this[_0x01f6('0x25')][_0x20023e[_0x01f6('0xbf')]]);this[_0x01f6('0x2d')][_0x20023e[_0x01f6('0xef')]]['answertime']=moment()['format'](_0x01f6('0x10a'));}}};Dialer[_0x01f6('0x20')][_0x01f6('0x11e')]=function(_0x62046a,_0x57c058){this[_0x01f6('0xda')](_0x62046a)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x11d')));if(_0x57c058==0x0){this['moveContactManagedDialer'](_0x62046a)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x11f')));}};Dialer[_0x01f6('0x20')]['syncQueueCallerAbandon']=function(_0x5b6c80){var _0x4133fb=this[_0x01f6('0x2d')][_0x5b6c80[_0x01f6('0xef')]];var _0x14bbbe=this;var _0x12eb14=![];var _0x23f7ed;var _0x57d747;if(this[_0x01f6('0x25')][_0x5b6c80[_0x01f6('0xbf')]]){if(_0x4133fb&&_0x4133fb[_0x01f6('0x56')]!=='ivr'){delete this[_0x01f6('0x2d')][_0x5b6c80[_0x01f6('0xef')]];this[_0x01f6('0xbe')](this[_0x01f6('0x25')][_0x5b6c80[_0x01f6('0xbf')]]);_0x4133fb[_0x01f6('0x120')]=moment()[_0x01f6('0x88')]('YYYY-MM-DD\x20HH:mm:ss');var _0x56fff1=new QueueCallerAbandon(_0x4133fb,_0x5b6c80);if(getSeconds(_0x4133fb['droptime'],_0x4133fb[_0x01f6('0x121')])>=_0x4133fb[_0x01f6('0x122')]){this[_0x01f6('0x25')][_0x5b6c80[_0x01f6('0xbf')]][_0x01f6('0x92')]+=0x1;this['voiceQueues'][_0x5b6c80[_0x01f6('0xbf')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x01f6('0x25')][_0x5b6c80[_0x01f6('0xbf')]][_0x01f6('0x123')]+=0x1;_0x56fff1[_0x01f6('0xb6')]=0xa;_0x56fff1[_0x01f6('0xb7')]=_0x01f6('0x124');_0x56fff1[_0x01f6('0x125')]=_0x01f6('0x126');_0x56fff1[_0x01f6('0x11a')]=this[_0x01f6('0x25')][_0x5b6c80[_0x01f6('0xbf')]][_0x01f6('0x11b')]?moment()[_0x01f6('0x88')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x56fff1['countdropretry']+=0x1;_0x56fff1[_0x01f6('0xfb')]+=0x1;_0x23f7ed=this[_0x01f6('0x25')][_0x5b6c80[_0x01f6('0xbf')]][_0x01f6('0x127')];_0x57d747=this[_0x01f6('0x25')][_0x5b6c80['queue']]['callAdditionalPhoneAfterMin'];_0x14bbbe['verifyAdditionalPhones'](_0x56fff1,_0x56fff1['state'],_0x4133fb[_0x01f6('0x128')])['then'](function(_0x41dd83){_0x12eb14=_0x41dd83['additional']==0x1;if(_0x56fff1[_0x01f6('0x101')]>=_0x14bbbe[_0x01f6('0x25')][_0x5b6c80['queue']][_0x01f6('0x129')]){_0x14bbbe[_0x01f6('0x11e')](_0x56fff1,_0x41dd83[_0x01f6('0x12a')]);}else{_0x14bbbe['rescheduleContact']({'active':![],'countdropretry':_0x56fff1[_0x01f6('0x101')],'scheduledat':moment()[_0x01f6('0x107')](_0x14bbbe[_0x01f6('0x25')][_0x5b6c80[_0x01f6('0xbf')]][_0x01f6('0x127')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4133fb[_0x01f6('0xdf')],'ListId':_0x4133fb[_0x01f6('0xe0')],'VoiceQueueId':_0x4133fb[_0x01f6('0xe2')]||undefined,'CampaignId':_0x4133fb[_0x01f6('0x10b')]||undefined})[_0x01f6('0xbc')](loggerCatch('[rescheduleContact][Drop]'));var _0xcff3d4=new History(_0x56fff1);_0xcff3d4[_0x01f6('0xb6')]=0xa;_0xcff3d4[_0x01f6('0xb7')]=_0x01f6('0x124');_0xcff3d4['starttime']=moment()[_0x01f6('0x88')](_0x01f6('0x10a'));_0xcff3d4[_0x01f6('0x12b')]=_0xcff3d4['starttime'];_0xcff3d4['calleridname']=_0x56fff1[_0x01f6('0x12c')];_0xcff3d4[_0x01f6('0x12d')]=_0x56fff1[_0x01f6('0x12d')];_0x14bbbe[_0x01f6('0xda')](_0xcff3d4)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x12e')));}})[_0x01f6('0x42')](function(_0x387310){if(_0x12eb14)_0x14bbbe['swapAdditionalPhones'](_0x56fff1,_0x23f7ed,_0x57d747)[_0x01f6('0x42')](function(_0x1441e3){return 0x1;});});}else{this[_0x01f6('0x25')][_0x5b6c80[_0x01f6('0xbf')]][_0x01f6('0x79')]+=0x1;this['voiceQueues'][_0x5b6c80[_0x01f6('0xbf')]][_0x01f6('0x6f')]+=0x1;_0x56fff1[_0x01f6('0xb6')]=0xb;_0x56fff1['statedesc']='Abandoned';_0x56fff1[_0x01f6('0x125')]=_0x01f6('0x12f');_0x56fff1['countabandonedretry']+=0x1;_0x56fff1['countglobal']+=0x1;_0x23f7ed=this[_0x01f6('0x25')][_0x5b6c80['queue']][_0x01f6('0x130')];_0x57d747=this[_0x01f6('0x25')][_0x5b6c80['queue']]['callAdditionalPhoneAfterMin'];_0x14bbbe[_0x01f6('0xc5')](_0x56fff1,_0x56fff1['state'],_0x4133fb[_0x01f6('0x128')])[_0x01f6('0x42')](function(_0x4f6212){if(_0x56fff1[_0x01f6('0x102')]>=_0x14bbbe[_0x01f6('0x25')][_0x5b6c80[_0x01f6('0xbf')]][_0x01f6('0x131')]){_0x14bbbe['queueCallerAbandonCreateState'](_0x56fff1,_0x4f6212[_0x01f6('0x12a')]);}else{_0x14bbbe[_0x01f6('0xcd')]({'active':![],'countabandonedretry':_0x56fff1[_0x01f6('0x102')],'scheduledat':moment()[_0x01f6('0x107')](_0x14bbbe[_0x01f6('0x25')][_0x5b6c80['queue']]['dialAbandonedRetryFrequency'],'minutes')[_0x01f6('0x88')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4133fb[_0x01f6('0xdf')],'ListId':_0x4133fb['ListId'],'VoiceQueueId':_0x4133fb['VoiceQueueId']||undefined,'CampaignId':_0x4133fb[_0x01f6('0x10b')]||undefined})['catch'](loggerCatch(_0x01f6('0x132')));var _0x222b0f=new History(_0x56fff1);_0x222b0f[_0x01f6('0xb6')]=0xb;_0x222b0f[_0x01f6('0xb7')]=_0x01f6('0x133');_0x222b0f['starttime']=moment()[_0x01f6('0x88')](_0x01f6('0x10a'));_0x222b0f[_0x01f6('0x12b')]=_0x222b0f[_0x01f6('0x134')];_0x222b0f[_0x01f6('0x12c')]=_0x56fff1[_0x01f6('0x12c')];_0x222b0f[_0x01f6('0x12d')]=_0x56fff1[_0x01f6('0x12d')];_0x14bbbe['createHistory'](_0x222b0f)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x135')));}})[_0x01f6('0x42')](function(_0x5e6cfb){if(_0x12eb14)_0x14bbbe['swapAdditionalPhones'](_0x56fff1,_0x23f7ed,_0x57d747)[_0x01f6('0x42')](function(_0x3269de){return 0x1;});});}}}};Dialer['prototype'][_0x01f6('0x3b')]=function(_0x583aac){if(this[_0x01f6('0x2b')][_0x583aac[_0x01f6('0xef')]]){this[_0x01f6('0x2b')][_0x583aac[_0x01f6('0xef')]][_0x01f6('0xbb')]=_0x583aac[_0x01f6('0xbb')];}if(this[_0x01f6('0x2d')][_0x583aac[_0x01f6('0xef')]]){this[_0x01f6('0x2d')][_0x583aac[_0x01f6('0xef')]]['channel']=_0x583aac[_0x01f6('0xbb')];}};Dialer['prototype'][_0x01f6('0x3d')]=function(_0x209dc0){if(strategy[this[_0x01f6('0x25')][this['actions'][_0x209dc0['actionid']][_0x01f6('0xbf')]][_0x01f6('0x58')]]===_0x01f6('0x1f')){if(this[_0x01f6('0x2b')][_0x209dc0[_0x01f6('0x136')]]&&_[_0x01f6('0xea')](this[_0x01f6('0x2b')][_0x209dc0[_0x01f6('0x136')]][_0x01f6('0x137')])&&_0x209dc0['status']==='1'&&_0x209dc0[_0x01f6('0x138')]==='0'){if(this[_0x01f6('0x27')][_0x209dc0['stateinterface']]){if(!this[_0x01f6('0x27')][_0x209dc0[_0x01f6('0x139')]]['locked']){this['agents'][_0x209dc0[_0x01f6('0x139')]][_0x01f6('0x137')]=!![];this['actions'][_0x209dc0[_0x01f6('0x136')]][_0x01f6('0x137')]=!![];this[_0x01f6('0x2b')][_0x209dc0[_0x01f6('0x136')]][_0x01f6('0x139')]=_0x209dc0[_0x01f6('0x139')];}}}}else if((strategy[this[_0x01f6('0x25')][this[_0x01f6('0x2b')][_0x209dc0[_0x01f6('0x136')]][_0x01f6('0xbf')]][_0x01f6('0x58')]]||'rrmemory')===_0x01f6('0x1e')){if(this[_0x01f6('0x2b')][_0x209dc0[_0x01f6('0x136')]]){if(this[_0x01f6('0x27')][_0x209dc0[_0x01f6('0x139')]]){this[_0x01f6('0x2b')][_0x209dc0[_0x01f6('0x136')]]['stateinterface']=_0x209dc0[_0x01f6('0x139')];if(_[_0x01f6('0xea')](this[_0x01f6('0x30')][this[_0x01f6('0x2b')][_0x209dc0[_0x01f6('0x136')]][_0x01f6('0xbf')]])){this[_0x01f6('0x30')][this[_0x01f6('0x2b')][_0x209dc0['actionid']][_0x01f6('0xbf')]]=[];}this[_0x01f6('0x30')][this[_0x01f6('0x2b')][_0x209dc0[_0x01f6('0x136')]][_0x01f6('0xbf')]][_0x01f6('0x13a')](_[_0x01f6('0x9f')](_[_0x01f6('0xde')](this['actions'][_0x209dc0[_0x01f6('0x136')]],['idHopper',_0x01f6('0x139')]),{'status':_0x209dc0[_0x01f6('0xba')],'paused':_0x209dc0[_0x01f6('0x138')]}));}}}};function unlockQueueStatus(_0x189a05,_0x303eeb){setTimeout(function(){if(_[_0x01f6('0x97')](_0x189a05['queueStatusComplete'])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x303eeb);}_0x189a05[_0x01f6('0x13b')]=!![];loggerBooked[_0x01f6('0x8e')](_0x01f6('0x13c'),_0x303eeb,JSON[_0x01f6('0x51')](_[_0x01f6('0xde')](_0x189a05,[_0x01f6('0x48'),_0x01f6('0x13b')])));},0x1f3);}Dialer[_0x01f6('0x20')][_0x01f6('0x3e')]=function(_0x26d67b){var _0x207b31=this;var _0x455558=_0x207b31[_0x01f6('0x25')][_0x207b31[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]]['queue']];if(strategy[this[_0x01f6('0x25')][this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0xbf')]][_0x01f6('0x58')]]===_0x01f6('0x1f')){if(this['actions'][_0x26d67b[_0x01f6('0x136')]]&&this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]]['stateinterface']){this[_0x01f6('0x24')][_0x01f6('0x13d')](this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0x13e')],this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]]['stateinterface'])['catch'](function(_0x30e64f){logger[_0x01f6('0xa6')](_0x01f6('0x13f'),util[_0x01f6('0xa9')](_0x30e64f,{'showHidden':![],'depth':null}));})[_0x01f6('0x140')](function(){_0x207b31['updateOriginated'](_0x207b31[_0x01f6('0x25')][_0x207b31[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0xbf')]]);_0x207b31[_0x01f6('0x27')][_0x207b31[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0x139')]]['locked']=![];delete _0x207b31[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]];unlockQueueStatus(_0x455558);});}else{this[_0x01f6('0xbe')](this[_0x01f6('0x25')][this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0xbf')]]);this[_0x01f6('0xcd')]({'active':![],'ContactId':this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0xdf')],'ListId':this[_0x01f6('0x2b')][_0x26d67b['actionid']][_0x01f6('0xe0')],'VoiceQueueId':this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0x10b')]||undefined})[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x141')));delete this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]];unlockQueueStatus(_0x455558);}}else if((strategy[this['voiceQueues'][this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0xbf')]][_0x01f6('0x58')]]||_0x01f6('0x1e'))===_0x01f6('0x1e')){var _0x19bc9b;if(this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]]&&!_['isEmpty'](this['queueBooked'][this['actions'][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0xbf')]])){if(this['queueBookedRR'][_0x207b31[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0xbf')]]){this[_0x01f6('0x31')][_0x207b31[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]]['queue']]=this[_0x01f6('0x31')][this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0xbf')]]?this[_0x01f6('0x31')][this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0xbf')]]:this[_0x01f6('0x30')][this['actions'][_0x26d67b['actionid']][_0x01f6('0xbf')]]?this['queueBooked'][this[_0x01f6('0x2b')][_0x26d67b['actionid']][_0x01f6('0xbf')]][_0x01f6('0x142')]||0x0:0x0;}this[_0x01f6('0x30')][this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0xbf')]][_0x01f6('0x142')]=this['queueBookedRR'][this[_0x01f6('0x2b')][_0x26d67b[_0x01f6('0x136')]][_0x01f6('0xbf')]];for(var _0x44320d=0x0;_0x44320d=0x0;})[_0x01f6('0xbc')](myreject(_0x5ae402)));}}else{_0x223fbc[_0x01f6('0x13a')](ami[_0x01f6('0x15a')]({'action':_0x01f6('0x15b'),'command':util['format']('iftime\x20%s,%s',_0xb1e2a3,!_[_0x01f6('0x97')](config[_0x01f6('0x15d')][_0x4755ee])?_0x4755ee:'')})[_0x01f6('0x42')](function(_0x45117c){return _0x45117c[_0x01f6('0x15e')]['indexOf'](_0x01f6('0x160'))>=0x0;})['catch'](myreject(_0x5ae402)));}BPromise['all'](_0x223fbc)[_0x01f6('0x42')](function(_0x5981af){var _0x37220e=_[_0x01f6('0x161')](_0x5981af);if(_0x37220e){return _0x163113(_0x37220e);}else{_0x12a16e[_0x01f6('0x44')]=_0x548247?_0x01f6('0x162'):'INTERVAL_IS_OVERTIME';return _0x5ae402(msgResponse(_0x01f6('0x163'),_0x01f6('0x156'),_0x01f6('0x164')+_0x548247+'\x20'+_0x5197dd+'\x20Interval\x20is\x20overtime:\x20'+util[_0x01f6('0xa9')](_0xb1e2a3,{'showHidden':![],'depth':null})+_0x01f6('0x165')+_0x4755ee));}})[_0x01f6('0xbc')](function(_0x579b49){return _0x5ae402(msgResponse(_0x01f6('0x152'),_0x01f6('0x156'),JSON['stringify'](_0x579b49)));});});};Dialer['prototype'][_0x01f6('0x166')]=function(_0x53e62d){var _0x1477c8=this;return function(){switch(_0x53e62d['dialMethod']){case _0x01f6('0x167'):freeVariablesPredictive(_0x53e62d);_0x1477c8['handlePower'](_0x53e62d,0x1);break;case _0x01f6('0x168'):freeVariablesPredictive(_0x53e62d);_0x1477c8[_0x01f6('0x169')](_0x53e62d,_0x53e62d[_0x01f6('0x16a')]);break;case _0x01f6('0x9'):_0x1477c8[_0x01f6('0x9')](_0x53e62d);break;case _0x01f6('0x8'):freeVariablesPredictive(_0x53e62d);_0x1477c8[_0x01f6('0x169')](_0x53e62d,0x1);break;default:freeVariablesPredictive(_0x53e62d);logger[_0x01f6('0xa6')]('Queue',_0x53e62d[_0x01f6('0x48')],'method\x20not\x20recognized');}};};Dialer[_0x01f6('0x20')][_0x01f6('0x16b')]=function(_0x4855c3){return BPromise[_0x01f6('0xc2')]()[_0x01f6('0x42')](cmHopper['handlePreviewRecallNotifications'](_0x4855c3['id'],previewRecallmeReminderInterval))['then'](function(_0x256014){for(var _0x4a24d7=0x0;_0x4a24d7<_0x256014[_0x01f6('0x16c')];_0x4a24d7++){var _0x3bd03e=_0x256014[_0x4a24d7][_0x01f6('0x16d')][_0x01f6('0x48')];if(_0x3bd03e)io['to'](util['format']('user:%s',_0x3bd03e))[_0x01f6('0x55')](_0x01f6('0x16e'),{'hopper':_0x256014[_0x4a24d7]});}})['catch'](function(_0x449421){});};Dialer['prototype'][_0x01f6('0x16f')]=function(_0x5d96e9){var _0x157f17=this;return function(){_0x157f17['handleIvr'](_0x5d96e9);};};Dialer[_0x01f6('0x20')][_0x01f6('0xb')]=function(_0x4e9e7e){var _0x3723bb=this;if(isNotPreview(_0x4e9e7e[_0x01f6('0x65')])){if(isVoiceQueueOutbound(_0x4e9e7e[_0x01f6('0x56')])&&isActive(_0x4e9e7e[_0x01f6('0x64')])){_0x4e9e7e['sendMessageOneNotActive']=!![];BPromise[_0x01f6('0xc2')]()[_0x01f6('0x42')](checkIsLoggedIn(_0x4e9e7e,_0x4e9e7e[_0x01f6('0x5a')]))[_0x01f6('0x42')](checkIsActive(_0x4e9e7e,_0x4e9e7e[_0x01f6('0x64')]))[_0x01f6('0x42')](checkInterval(_0x4e9e7e))[_0x01f6('0x42')](_0x3723bb[_0x01f6('0x14d')](_0x4e9e7e))[_0x01f6('0x42')](_0x3723bb[_0x01f6('0x170')](_0x4e9e7e[_0x01f6('0x171')],_0x4e9e7e['dialTimezone'],_0x4e9e7e[_0x01f6('0x48')],_0x4e9e7e))[_0x01f6('0x42')](_0x3723bb[_0x01f6('0x153')](_0x4e9e7e[_0x01f6('0x4c')],_0x4e9e7e[_0x01f6('0x172')],_0x4e9e7e[_0x01f6('0x48')],_0x4e9e7e))[_0x01f6('0x42')](_0x3723bb['checkDialMethod'](_0x4e9e7e))[_0x01f6('0xbc')](loggerCatchQueueSummary('[syncQueueSummary]',_0x4e9e7e));}else{notSendMessagesQueue(_0x4e9e7e);}}else{freeVariablesPredictive(_0x4e9e7e);if(_0x4e9e7e[_0x01f6('0x173')]){_0x3723bb[_0x01f6('0x16b')](_0x4e9e7e);}}};Dialer['prototype']['syncCampaigns']=function(){var _0xcc66b5=this;var _0x259ee1;for(var _0x34805f in this['campaigns']){if(typeof this[_0x01f6('0x26')][_0x34805f]!=='undefined'){_0x259ee1=this[_0x01f6('0x26')][_0x34805f];if(isCampaignIvr(_0x259ee1[_0x01f6('0x56')])&&isActive(_0x259ee1[_0x01f6('0x86')])){_0x259ee1[_0x01f6('0xb0')]=!![];BPromise['resolve']()[_0x01f6('0x42')](checkIsActive(_0x259ee1,_0x259ee1[_0x01f6('0x86')]))['then'](checkInterval(_0x259ee1))[_0x01f6('0x42')](_0xcc66b5[_0x01f6('0x14d')](_0x259ee1))[_0x01f6('0x42')](_0xcc66b5[_0x01f6('0x170')](_0x259ee1[_0x01f6('0x171')],_0x259ee1['dialTimezone'],_0x259ee1[_0x01f6('0x48')],_0x259ee1))[_0x01f6('0x42')](_0xcc66b5[_0x01f6('0x153')](_0x259ee1[_0x01f6('0x4c')],_0x259ee1[_0x01f6('0x172')],_0x259ee1['name'],_0x259ee1))[_0x01f6('0x42')](_0xcc66b5[_0x01f6('0x16f')](_0x259ee1))[_0x01f6('0xbc')](loggerCatchQueueSummary('[syncCampaigns]',_0x259ee1));}else{notSendMessagesCampaign(_0x259ee1);}}}};function getCallerIdRandom(_0x3a520f,_0x4a2f2b){var _0x3caf95;var _0x4cefee;var _0x197cd7;if(_0x4a2f2b<=0x0){_0x4a2f2b=0x1;}_0x3caf95=new RegExp('\x5cw{0,'+_0x4a2f2b+'}$');_0x4cefee=Math[_0x01f6('0x174')](0xa,_0x4a2f2b-0x1);_0x197cd7=Math['pow'](0xa,_0x4a2f2b)-0x1;return util[_0x01f6('0x88')]('%s',_[_0x01f6('0x175')](_0x3a520f,_0x3caf95,_[_0x01f6('0x176')](_0x4cefee,_0x197cd7)));}function extractCalleridName(_0x5234b1){var _0x1b07fb=_0x5234b1[_0x01f6('0x177')](/"(.*?)"/);return _0x1b07fb?_0x1b07fb[0x1]:_0x5234b1;}function extractCalleridNumber(_0x442e36){var _0x5ae301=_0x442e36[_0x01f6('0x177')](/<(.*?)>/);return _0x5ae301?_0x5ae301[0x1]:_0x442e36;}Dialer[_0x01f6('0x20')][_0x01f6('0x178')]=function(_0x155a61,_0x1bdb2c){var _0x5c3b65=this;var _0x3bf4ef=uuid['v4']();this['actions'][_0x3bf4ef]=new Action(_0x155a61,_0x1bdb2c,_0x3bf4ef);return new BPromise(function(_0x31a747,_0x18b479){if(_['isUndefined'](_0x155a61)&&typeof _0x155a61!==_0x01f6('0x179')){return _0x18b479(msgResponse(_0x01f6('0x17a'),_0x01f6('0x156'),_0x01f6('0x17b')));}if(_[_0x01f6('0x97')](_0x1bdb2c[_0x01f6('0x17c')])||_0x1bdb2c[_0x01f6('0x17c')]===null){return _0x18b479(msgResponse(_0x01f6('0x17a'),_0x01f6('0x156'),_0x01f6('0x17d')));}var _0x3d52ae={'XMD-CALLERID':_0x5c3b65['actions'][_0x3bf4ef][_0x01f6('0x17e')](),'XMD-AGI':_0x155a61['dialQueueProject']?util[_0x01f6('0x88')](_0x01f6('0x17f'),ipAgi,_0x155a61[_0x01f6('0x114')]):_0x01f6('0x180'),'XMD-AGIAFTER':_0x155a61[_0x01f6('0x11b')]?util[_0x01f6('0x88')](_0x01f6('0x17f'),ipAgi,_0x155a61[_0x01f6('0x11b')]):_0x01f6('0x180'),'XMD-QUEUE':_0x155a61['type']==='outbound'?util[_0x01f6('0x88')](_0x01f6('0x181'),_0x155a61[_0x01f6('0x48')],_0x155a61[_0x01f6('0x182')]||'',_0x155a61[_0x01f6('0x11c')]?'c':'',_0x155a61[_0x01f6('0x122')]||0x3):'NONE','XMD-CONTACTID':_0x1bdb2c[_0x01f6('0xdf')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5c3b65[_0x01f6('0x2b')][_0x3bf4ef][_0x01f6('0x17e')](),'XMD-AMD':_0x155a61[_0x01f6('0xed')]?'ACTIVE':_0x01f6('0x180'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x155a61['dialAMDActive']){_0x3d52ae[_0x01f6('0x183')]=_0x155a61[_0x01f6('0x184')]||0x9c4;_0x3d52ae[_0x01f6('0x185')]=_0x155a61[_0x01f6('0x186')]||0x5dc;_0x3d52ae[_0x01f6('0x187')]=_0x155a61['dialAMDAfterGreetingSilence']||0x320;_0x3d52ae[_0x01f6('0x188')]=_0x155a61[_0x01f6('0x189')]||0x1388;_0x3d52ae['XMD-AMDMINWORDLENGTH']=_0x155a61[_0x01f6('0x18a')]||0x64;_0x3d52ae[_0x01f6('0x18b')]=_0x155a61[_0x01f6('0x18c')]||0x32;_0x3d52ae[_0x01f6('0x18d')]=_0x155a61[_0x01f6('0x18e')]||0x3;_0x3d52ae['XMD-AMDSILENCETHRESHOLD']=_0x155a61['dialAMDSilenceThreshold']||0x100;_0x3d52ae[_0x01f6('0x18f')]=_0x155a61[_0x01f6('0x190')]||0x1388;}if(_0x155a61[_0x01f6('0x56')]===_0x01f6('0x57')){_0x3d52ae[_0x01f6('0x191')]=_0x1bdb2c[_0x01f6('0xe2')];}else{_0x3d52ae[_0x01f6('0x192')]=_0x1bdb2c[_0x01f6('0x10b')];}for(var _0x2041ea in _0x1bdb2c['Contact']){if(typeof _0x1bdb2c[_0x01f6('0x193')][_0x2041ea]!=='undefined'){if(isNotNull(_0x1bdb2c[_0x01f6('0x193')][_0x2041ea])&&_0x2041ea!=='id'&&_0x2041ea!==_0x01f6('0x194')&&_0x2041ea!==_0x01f6('0x195')&&_0x2041ea!=='updatedAt'){_0x3d52ae[util[_0x01f6('0x88')]('%s%s',_0x01f6('0x196'),_['toUpper'](_0x2041ea))]=_0x1bdb2c[_0x01f6('0x193')][_0x2041ea];}}}var _0x447532=_0x5c3b65[_0x01f6('0x14e')](_0x155a61[_0x01f6('0x85')])?getCallerId(_0x155a61[_0x01f6('0x85')][_0x01f6('0x197')],_0x155a61['dialOriginateCallerIdName'],_0x155a61[_0x01f6('0x198')]>0x0?getCallerIdRandom(_0x155a61[_0x01f6('0x67')],_0x155a61[_0x01f6('0x198')]):_0x155a61['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x155a61['TrunkBackup'])?_0x155a61[_0x01f6('0x85')]['callerid']:_0x155a61[_0x01f6('0x14f')]['callerid'],_0x155a61[_0x01f6('0x66')],_0x155a61['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x155a61[_0x01f6('0x67')],_0x155a61[_0x01f6('0x198')]):_0x155a61['dialOriginateCallerIdNumber']);if(_0x447532){_0x3d52ae['XMD-ORIGINATECALLERIDNAME']=_0x5c3b65['actions'][_0x3bf4ef][_0x01f6('0x199')]=extractCalleridName(_0x447532);_0x3d52ae['XMD-ORIGINATECALLERIDNUM']=_0x1bdb2c[_0x01f6('0x17c')];}return ami[_0x01f6('0x15a')]({'actionid':_0x3bf4ef,'action':'originate','channel':_0x5c3b65['isTrunkReachable'](_0x155a61[_0x01f6('0x85')])?util[_0x01f6('0x88')](_0x01f6('0x19a'),_0x155a61[_0x01f6('0x85')][_0x01f6('0x48')],isNotNull(_0x155a61[_0x01f6('0x69')])?_0x155a61[_0x01f6('0x69')][_0x01f6('0x19b')]()||'':'',_0x155a61[_0x01f6('0x19c')]>0x0?_0x1bdb2c[_0x01f6('0x17c')]['substring'](_0x155a61[_0x01f6('0x19c')]):_0x1bdb2c[_0x01f6('0x17c')]):util[_0x01f6('0x88')](_0x01f6('0x19a'),_[_0x01f6('0xea')](_0x155a61['TrunkBackup'])?_0x155a61['Trunk']['name']:_0x155a61[_0x01f6('0x14f')][_0x01f6('0x48')],isNotNull(_0x155a61[_0x01f6('0x69')])?_0x155a61['dialPrefix'][_0x01f6('0x19b')]()||'':'',_0x155a61[_0x01f6('0x19c')]>0x0?_0x1bdb2c[_0x01f6('0x17c')][_0x01f6('0x19d')](_0x155a61[_0x01f6('0x19c')]):_0x1bdb2c[_0x01f6('0x17c')]),'callerid':_0x447532,'Exten':_0x01f6('0xec'),'Context':_0x01f6('0x19e'),'Priority':'1','variable':_0x3d52ae,'timeout':(_0x155a61[_0x01f6('0x68')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3bf4ef})[_0x01f6('0x42')](function(_0x53e71c){return _0x31a747(_0x53e71c);})[_0x01f6('0xbc')](function(_0x35c62f){_0x155a61[_0x01f6('0x73')]+=0x1;var _0x290120=new History(_0x5c3b65[_0x01f6('0x2b')][_0x3bf4ef]);logger[_0x01f6('0xa6')](util[_0x01f6('0x88')](_0x01f6('0x19f'),JSON['stringify'](_0x35c62f)));_0x290120['state']=0xe;_0x290120[_0x01f6('0xb7')]='OriginateError';_0x290120[_0x01f6('0x134')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x290120[_0x01f6('0x12b')]=_0x290120[_0x01f6('0x134')];_0x5c3b65[_0x01f6('0xda')](_0x290120)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x1a0')));_0x5c3b65[_0x01f6('0xd8')](_0x290120)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x1a0')))[_0x01f6('0x140')](function(){delete _0x5c3b65['actions'][_0x3bf4ef];return _0x18b479(msgResponse(_0x01f6('0x17a'),_0x01f6('0x50'),_0x01f6('0x1a1')));});});});};Dialer['prototype'][_0x01f6('0x36')]=function(_0x5ce5e0){var _0x12f6a6=this['actions'][_0x5ce5e0[_0x01f6('0x136')]];if(_0x12f6a6){delete this[_0x01f6('0x2b')][_0x5ce5e0['actionid']];_0x12f6a6[_0x01f6('0x121')]=moment()[_0x01f6('0x88')](_0x01f6('0x10a'));var _0xa030f5=_0x12f6a6[_0x01f6('0x56')]===_0x01f6('0x8b')?this[_0x01f6('0x26')][_0x12f6a6[_0x01f6('0xbf')]]:this[_0x01f6('0x25')][_0x12f6a6[_0x01f6('0x1a2')]()];if(!this[_0x01f6('0xe5')](_0x5ce5e0[_0x01f6('0x1a3')])){this[_0x01f6('0xbe')](_0xa030f5);return this['callProgressDetecting'](_0x12f6a6,_0xa030f5,_0x5ce5e0)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x1a4')));}this['uniqueId'][_0x5ce5e0[_0x01f6('0xef')]]=_0x12f6a6;}};Dialer[_0x01f6('0x20')][_0x01f6('0x1a5')]=function(_0xc7dcb8,_0x24f261,_0x26425e){var _0x5350ce=new History(_0x24f261);if(_0x5350ce[_0x01f6('0xfe')]+_0x5350ce[_0x01f6('0x1a6')]+_0x5350ce['countnoanswerretry']+_0x5350ce[_0x01f6('0x100')]+_0x5350ce[_0x01f6('0x101')]+_0x5350ce['countabandonedretry']+_0x5350ce[_0x01f6('0xfa')]+_0x5350ce[_0x01f6('0x10f')]>=_0x26425e[_0x01f6('0x103')]-0x1){return!![];}switch(_0xc7dcb8){case 0x3:if(_0x5350ce[_0x01f6('0xff')]>=_0x26425e['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x01f6('0xcd')]({'active':![],'countnoanswerretry':_0x5350ce[_0x01f6('0xff')]+=0x1,'scheduledat':moment()[_0x01f6('0x107')](_0x26425e[_0x01f6('0x1a7')],_0x01f6('0x109'))[_0x01f6('0x88')](_0x01f6('0x10a')),'ContactId':_0x5350ce[_0x01f6('0xdf')],'ListId':_0x5350ce[_0x01f6('0xe0')],'VoiceQueueId':_0x5350ce[_0x01f6('0xe2')]||undefined,'CampaignId':_0x5350ce[_0x01f6('0x10b')]||undefined})[_0x01f6('0xbc')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x5350ce['countbusyretry']>=_0x26425e['dialBusyMaxRetry']-0x1){return!![];}this[_0x01f6('0xcd')]({'active':![],'countbusyretry':_0x5350ce[_0x01f6('0xfe')]+=0x1,'scheduledat':moment()[_0x01f6('0x107')](_0x26425e['dialBusyRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5350ce['ContactId'],'ListId':_0x5350ce[_0x01f6('0xe0')],'VoiceQueueId':_0x5350ce[_0x01f6('0xe2')]||undefined,'CampaignId':_0x5350ce['CampaignId']||undefined})[_0x01f6('0xbc')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x5350ce[_0x01f6('0x1a6')]>=_0x26425e['dialCongestionMaxRetry']-0x1){return!![];}this[_0x01f6('0xcd')]({'active':![],'countcongestionretry':_0x5350ce[_0x01f6('0x1a6')]+=0x1,'scheduledat':moment()[_0x01f6('0x107')](_0x26425e[_0x01f6('0x1a8')],_0x01f6('0x109'))[_0x01f6('0x88')](_0x01f6('0x10a')),'ContactId':_0x5350ce['ContactId'],'ListId':_0x5350ce[_0x01f6('0xe0')],'VoiceQueueId':_0x5350ce[_0x01f6('0xe2')]||undefined,'CampaignId':_0x5350ce[_0x01f6('0x10b')]||undefined})[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x1a9')));break;case 0x0:if(_0x5350ce[_0x01f6('0x100')]>=_0x26425e['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x01f6('0xcd')]({'active':![],'countnosuchnumberretry':_0x5350ce['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x01f6('0x107')](_0x26425e[_0x01f6('0x1aa')],'minutes')[_0x01f6('0x88')](_0x01f6('0x10a')),'ContactId':_0x5350ce[_0x01f6('0xdf')],'ListId':_0x5350ce[_0x01f6('0xe0')],'VoiceQueueId':_0x5350ce['VoiceQueueId']||undefined,'CampaignId':_0x5350ce[_0x01f6('0x10b')]||undefined})[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x1ab')));}break;case 0xa:if(_0x5350ce[_0x01f6('0x101')]>=_0x26425e[_0x01f6('0x129')]-0x1){return!![];}this[_0x01f6('0xcd')]({'active':![],'countdropretry':_0x5350ce[_0x01f6('0x101')]+=0x1,'scheduledat':moment()['add'](_0x26425e[_0x01f6('0x127')],'minutes')[_0x01f6('0x88')](_0x01f6('0x10a')),'ContactId':_0x5350ce[_0x01f6('0xdf')],'ListId':_0x5350ce[_0x01f6('0xe0')],'VoiceQueueId':_0x5350ce['VoiceQueueId']||undefined,'CampaignId':_0x5350ce[_0x01f6('0x10b')]||undefined})[_0x01f6('0xbc')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x5350ce[_0x01f6('0x102')]>=_0x26425e[_0x01f6('0x131')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x5350ce[_0x01f6('0x102')]+=0x1,'scheduledat':moment()[_0x01f6('0x107')](_0x26425e[_0x01f6('0x130')],'minutes')[_0x01f6('0x88')](_0x01f6('0x10a')),'ContactId':_0x5350ce[_0x01f6('0xdf')],'ListId':_0x5350ce['ListId'],'VoiceQueueId':_0x5350ce[_0x01f6('0xe2')]||undefined,'CampaignId':_0x5350ce['CampaignId']||undefined})[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x132')));break;case 0x13:if(_0x5350ce[_0x01f6('0xfa')]>=_0x26425e[_0x01f6('0x104')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x5350ce[_0x01f6('0xfa')]+=0x1,'scheduledat':moment()[_0x01f6('0x107')](_0x26425e[_0x01f6('0x108')],_0x01f6('0x109'))[_0x01f6('0x88')](_0x01f6('0x10a')),'ContactId':_0x5350ce[_0x01f6('0xdf')],'ListId':_0x5350ce[_0x01f6('0xe0')],'VoiceQueueId':_0x5350ce['VoiceQueueId']||undefined,'CampaignId':_0x5350ce['CampaignId']||undefined})[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x10c')));break;case 0x14:if(_0x5350ce[_0x01f6('0x10f')]>=_0x26425e['dialAgentRejectMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x5350ce[_0x01f6('0x10f')]+=0x1,'scheduledat':moment()['add'](_0x26425e[_0x01f6('0x1ac')],_0x01f6('0x109'))[_0x01f6('0x88')](_0x01f6('0x10a')),'ContactId':_0x5350ce['ContactId'],'ListId':_0x5350ce[_0x01f6('0xe0')],'VoiceQueueId':_0x5350ce['VoiceQueueId']||undefined,'CampaignId':_0x5350ce['CampaignId']||undefined})[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x1ad')));break;default:return!![];}};Dialer[_0x01f6('0x20')][_0x01f6('0x1ae')]=function(_0x202d8c,_0x49d45c,_0x526180){var _0x1e253f=this;var _0x598ae7=new History(_0x202d8c);var _0x5e5daa=![];var _0x3f48b0;var _0x2a9db1;return new BPromise(function(_0x8096f5,_0x21de9e){if(_[_0x01f6('0x97')](_0x49d45c)&&typeof _0x49d45c!==_0x01f6('0x179')){return _0x21de9e(msgResponse(_0x01f6('0x1af'),_0x01f6('0x156'),_0x01f6('0x1b0')));}if(_['isUndefined'](_0x526180)&&typeof _0x526180!==_0x01f6('0x179')){return _0x21de9e(msgResponse(_0x01f6('0x1af'),_0x01f6('0x156'),_0x01f6('0x1b1')));}_0x1e253f[_0x01f6('0xc5')](_0x598ae7,_0x526180[_0x01f6('0x118')],_0x49d45c)[_0x01f6('0x42')](function(_0x3e6d4b){if(_0x3e6d4b['additional']==0x1)_0x5e5daa=!![];switch(_0x526180['reason']){case'0':_0x49d45c[_0x01f6('0x72')]+=0x1;_0x598ae7[_0x01f6('0xb6')]=0x0;_0x598ae7[_0x01f6('0xb7')]=_0x01f6('0x1b2');_0x598ae7['countnosuchnumberretry']+=0x1;_0x598ae7['countglobal']+=0x1;ami[_0x01f6('0x55')](_0x01f6('0x1b3'),ut[_0x01f6('0xf4')](_0x202d8c,_0x01f6('0x1b4')));_0x3f48b0=_0x49d45c[_0x01f6('0x1aa')];_0x2a9db1=_0x49d45c[_0x01f6('0x1b5')];_0x1e253f['createHistory'](_0x598ae7)['catch'](loggerCatch(_0x01f6('0xfd')));if(_0x1e253f[_0x01f6('0x1a5')](0x0,_0x202d8c,_0x49d45c)&&!_0x5e5daa){if(_0x598ae7[_0x01f6('0x100')]>=_0x49d45c['dialNoSuchNumberMaxRetry']){_0x1e253f[_0x01f6('0x105')](_0x598ae7,_0x8096f5,_0x21de9e,'reason\x200\x20no\x20such\x20number....');}else{_0x1e253f['stateGlobal'](_0x598ae7,_0x8096f5,_0x21de9e,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x49d45c[_0x01f6('0x71')]+=0x1;_0x598ae7[_0x01f6('0xb6')]=0x3;_0x598ae7[_0x01f6('0xb7')]=_0x01f6('0x1b6');_0x598ae7[_0x01f6('0xff')]+=0x1;_0x598ae7[_0x01f6('0xfb')]+=0x1;ami['emit'](_0x01f6('0x1b7'),ut[_0x01f6('0xf4')](_0x202d8c,_0x01f6('0x1b8')));_0x3f48b0=_0x49d45c['dialNoAnswerRetryFrequency'];_0x2a9db1=_0x49d45c[_0x01f6('0x1b5')];_0x1e253f[_0x01f6('0xda')](_0x598ae7)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x1b9')));if(_0x1e253f[_0x01f6('0x1a5')](0x3,_0x202d8c,_0x49d45c)&&!_0x5e5daa){if(_0x598ae7[_0x01f6('0xff')]>=_0x49d45c[_0x01f6('0x1ba')]){_0x1e253f['createStateFinal'](_0x598ae7,_0x8096f5,_0x21de9e,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1e253f[_0x01f6('0x110')](_0x598ae7,_0x8096f5,_0x21de9e,_0x01f6('0x1bb'));}}break;case'5':_0x49d45c[_0x01f6('0x6c')]+=0x1;_0x598ae7[_0x01f6('0xb6')]=0x5;_0x598ae7[_0x01f6('0xb7')]=_0x01f6('0x1bc');_0x598ae7['countbusyretry']+=0x1;_0x598ae7[_0x01f6('0xfb')]+=0x1;ami[_0x01f6('0x55')]('custom:agentbusy',ut[_0x01f6('0xf4')](_0x202d8c,_0x01f6('0x1bd')));_0x3f48b0=_0x49d45c[_0x01f6('0x1be')];_0x2a9db1=_0x49d45c['callAdditionalPhoneAfterMin'];_0x1e253f['createHistory'](_0x598ae7)[_0x01f6('0xbc')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1e253f[_0x01f6('0x1a5')](0x5,_0x202d8c,_0x49d45c)&&!_0x5e5daa){if(_0x598ae7[_0x01f6('0xfe')]>=_0x49d45c[_0x01f6('0x1bf')]){_0x1e253f[_0x01f6('0x105')](_0x598ae7,_0x8096f5,_0x21de9e,_0x01f6('0x1c0'));}else{_0x1e253f['stateGlobal'](_0x598ae7,_0x8096f5,_0x21de9e,'reason\x205\x20busy');}}break;case'8':_0x49d45c[_0x01f6('0x6d')]+=0x1;_0x598ae7['state']=0x8;_0x598ae7[_0x01f6('0xb7')]=_0x01f6('0x1c1');_0x598ae7[_0x01f6('0x1a6')]+=0x1;_0x598ae7[_0x01f6('0xfb')]+=0x1;_0x3f48b0=_0x49d45c[_0x01f6('0x1a8')];_0x2a9db1=_0x49d45c[_0x01f6('0x1b5')];ami[_0x01f6('0x55')](_0x01f6('0x1c2'),ut['buildObj'](_0x202d8c,_0x01f6('0x1c3')));_0x1e253f[_0x01f6('0xda')](_0x598ae7)[_0x01f6('0xbc')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x1e253f[_0x01f6('0x1a5')](0x8,_0x202d8c,_0x49d45c)&&!_0x5e5daa){if(_0x598ae7[_0x01f6('0x1a6')]>=_0x49d45c[_0x01f6('0x1c4')]){_0x1e253f['createStateFinal'](_0x598ae7,_0x8096f5,_0x21de9e,_0x01f6('0x1c5'));}else{_0x1e253f[_0x01f6('0x110')](_0x598ae7,_0x8096f5,_0x21de9e,_0x01f6('0x1c5'));}}break;case'11':_0x49d45c[_0x01f6('0x1c6')]+=0x1;_0x598ae7[_0x01f6('0xb6')]=0xb;_0x598ae7[_0x01f6('0xb7')]='Abandoned';_0x598ae7['countabandonedretry']+=0x1;_0x598ae7[_0x01f6('0xfb')]+=0x1;_0x3f48b0=_0x49d45c[_0x01f6('0x130')];_0x2a9db1=_0x49d45c[_0x01f6('0x1b5')];_0x1e253f[_0x01f6('0xda')](_0x598ae7)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x135')));if(_0x1e253f[_0x01f6('0x1a5')](0xb,_0x202d8c,_0x49d45c)&&!_0x5e5daa){if(_0x598ae7[_0x01f6('0x102')]>=_0x49d45c[_0x01f6('0x131')]){_0x1e253f['createStateFinal'](_0x598ae7,_0x8096f5,_0x21de9e,_0x01f6('0x1c7'));}else{_0x1e253f['stateGlobal'](_0x598ae7,_0x8096f5,_0x21de9e,_0x01f6('0x1c7'));}}break;case'20':_0x49d45c[_0x01f6('0x75')]+=0x1;_0x598ae7[_0x01f6('0xb6')]=0x14;_0x598ae7[_0x01f6('0xb7')]=_0x01f6('0x1c8');_0x598ae7[_0x01f6('0x10f')]+=0x1;_0x598ae7[_0x01f6('0xfb')]+=0x1;_0x3f48b0=_0x49d45c[_0x01f6('0x1ac')];_0x2a9db1=_0x49d45c[_0x01f6('0x1b5')];ami[_0x01f6('0x55')](_0x01f6('0x1c9'),ut['buildObj'](_0x202d8c,'agentreject'));_0x1e253f[_0x01f6('0xda')](_0x598ae7)[_0x01f6('0xbc')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x1e253f[_0x01f6('0x1a5')](0x14,_0x202d8c,_0x49d45c)&&!_0x5e5daa){if(_0x598ae7['countagentrejectretry']>=_0x49d45c['dialAgentRejectMaxRetry']){_0x1e253f[_0x01f6('0x105')](_0x598ae7,_0x8096f5,_0x21de9e,_0x01f6('0x1ca'));}else{_0x1e253f[_0x01f6('0x110')](_0x598ae7,_0x8096f5,_0x21de9e,'reason\x2020\x20agentreject');}}break;default:_0x49d45c[_0x01f6('0x76')]+=0x1;_0x598ae7[_0x01f6('0xb6')]=0xc;_0x598ae7[_0x01f6('0xb7')]=_0x526180[_0x01f6('0x118')];_0x3f48b0=_0x49d45c[_0x01f6('0x1ac')];_0x2a9db1=_0x49d45c[_0x01f6('0x1b5')];_0x1e253f[_0x01f6('0xda')](_0x598ae7)[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x1cb')));if(_0x1e253f['checkRetriveMax'](_0x526180[_0x01f6('0x118')],_0x202d8c,_0x49d45c)&&!_0x5e5daa){if(_0x598ae7[_0x01f6('0xfe')]+_0x598ae7[_0x01f6('0x1a6')]+_0x598ae7[_0x01f6('0xff')]+_0x598ae7[_0x01f6('0x100')]+_0x598ae7[_0x01f6('0x101')]+_0x598ae7[_0x01f6('0x102')]+_0x598ae7[_0x01f6('0xfa')]+_0x598ae7[_0x01f6('0x10f')]>=_0x49d45c[_0x01f6('0x103')]){_0x1e253f['stateGlobal'](_0x598ae7,_0x8096f5,_0x21de9e,_0x526180['reason']);}else{_0x1e253f['createStateFinal'](_0x598ae7,_0x8096f5,_0x21de9e,_0x526180[_0x01f6('0x118')]);}}}})[_0x01f6('0x42')](function(_0x23ac3c){if(_0x5e5daa){_0x1e253f['swapAdditionalPhones'](_0x598ae7,_0x3f48b0,_0x2a9db1)[_0x01f6('0x42')](function(_0x44b687){return _0x8096f5(0x1);});}});});};Dialer[_0x01f6('0x20')]['stateGlobal']=function(_0x2a0577,_0x3b06b5,_0x45f39a,_0x306a8f){var _0x32ef76=new Final(_0x2a0577);_0x32ef76[_0x01f6('0xb6')]=0xf;_0x32ef76['statedesc']=_0x01f6('0x1cc');this[_0x01f6('0x105')](_0x32ef76,_0x3b06b5,_0x45f39a,_0x306a8f);};Dialer[_0x01f6('0x20')][_0x01f6('0x105')]=function(_0x412ef3,_0x456041,_0x38897b,_0x117093){this['moveContactManagedDialer'](_0x412ef3)[_0x01f6('0x42')](function(){return _0x456041(msgResponse(_0x01f6('0x1af'),_0x01f6('0xe6'),_0x117093));})['catch'](function(){return _0x38897b(msgResponse(_0x01f6('0x1cd'),_0x01f6('0x156'),_0x01f6('0x1ce')));});};Dialer[_0x01f6('0x20')][_0x01f6('0x9')]=function(_0x15e3af){var _0x2587e4=_0x15e3af[_0x01f6('0x1cf')]/0x64;var _0x5873bc=_0x15e3af[_0x01f6('0x70')]/(_0x15e3af[_0x01f6('0x70')]+_0x15e3af[_0x01f6('0x6a')]);var _0x4079ee=Math[_0x01f6('0x1d0')](_0x15e3af[_0x01f6('0x1d1')]*(_0x15e3af[_0x01f6('0x1d2')]/0x64));var _0x145b5a=Math[_0x01f6('0x1d0')](_0x15e3af[_0x01f6('0x1d1')]*(_0x15e3af[_0x01f6('0x1d3')]/0x64));var _0x3f6895=_0x15e3af[_0x01f6('0x59')]+_0x15e3af[_0x01f6('0x5e')];var _0x38072b=Math[_0x01f6('0x1d4')](_0x15e3af['erlangCalls']*_0x15e3af[_0x01f6('0x82')]*_0x15e3af['predictiveIntervalHitRate']*_0x15e3af[_0x01f6('0x7c')]);if(_[_0x01f6('0x97')](_0x15e3af[_0x01f6('0x84')])){if(!_['isUndefined'](_0x15e3af[_0x01f6('0x2e')])){_0x15e3af[_0x01f6('0x2e')]=undefined;loggerPredictive['error'](_0x01f6('0x1d5'),_0x01f6('0x1d6'));}if(!_['isUndefined'](_0x15e3af['handlePredictive'])){loggerPredictive[_0x01f6('0xa6')](_0x01f6('0x1d5'),_0x01f6('0x1d7'));clearInterval(_0x15e3af['handlePredictive']);_0x15e3af['handlePredictive']=undefined;}_0x15e3af[_0x01f6('0x84')]=moment()[_0x01f6('0x88')](_0x01f6('0x10a'));loggerPredictive[_0x01f6('0x8e')](_0x15e3af[_0x01f6('0x48')],_0x01f6('0x1d8'),_0x15e3af[_0x01f6('0x84')]);this['handlePower'](_0x15e3af,0x1);}else if(ifInterval(_0x15e3af[_0x01f6('0x1d9')],_0x15e3af[_0x01f6('0x84')])){this[_0x01f6('0x169')](_0x15e3af,0x1);loggerPredictiveCalls['info'](_0x01f6('0x1da'),_0x15e3af['startProgressive'],_0x15e3af[_0x01f6('0x48')]);_0x15e3af[_0x01f6('0x80')]=0x0;_0x15e3af[_0x01f6('0x123')]=0x0;}else if(_0x2587e4<_0x5873bc&&_0x15e3af[_0x01f6('0x1db')]===_0x01f6('0x1dc')){freeVariablesPredictive(_0x15e3af);loggerPredictive[_0x01f6('0x8e')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x01f6('0x1dd'),_0x5873bc,'startProgressive',_0x15e3af[_0x01f6('0x48')]);}else if(_0x38072b<_0x15e3af[_0x01f6('0x123')]&&_0x15e3af[_0x01f6('0x1db')]===_0x01f6('0x1dc')){freeVariablesPredictive(_0x15e3af);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x01f6('0x1de'),_0x38072b,_0x01f6('0x1df'),_0x15e3af['predictiveIntervalErlangCallsDroppedCalls'],_0x01f6('0x84'),_0x15e3af[_0x01f6('0x48')]);}else if(!ifInterval(_0x15e3af[_0x01f6('0x1d9')],_0x15e3af[_0x01f6('0x84')])&&_[_0x01f6('0x97')](_0x15e3af[_0x01f6('0x2e')])&&!_['isUndefined'](_0x15e3af['startProgressive'])){_0x15e3af['startPredictive']=moment()[_0x01f6('0x88')](_0x01f6('0x10a'));loggerPredictive[_0x01f6('0x8e')](_0x15e3af[_0x01f6('0x48')],'started\x20in\x20predictive\x20at',_0x15e3af[_0x01f6('0x2e')]);this[_0x01f6('0xca')](_0x15e3af[_0x01f6('0x1d9')])[_0x01f6('0x42')](this[_0x01f6('0x1e0')](_0x15e3af))[_0x01f6('0x42')](mergeDataErlangB(_0x15e3af))['then'](this[_0x01f6('0x1e1')](_0x15e3af))[_0x01f6('0xbc')](loggerCatchPredictive(_0x01f6('0x1e2'),_0x15e3af));}else if(!ifInterval(_0x15e3af[_0x01f6('0x1d9')],_0x15e3af[_0x01f6('0x2e')])){_0x15e3af[_0x01f6('0x123')]=0x0;_0x15e3af[_0x01f6('0x2e')]=moment()[_0x01f6('0x88')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x01f6('0x8e')](_0x15e3af[_0x01f6('0x48')],_0x01f6('0x1e3'),_0x15e3af['startPredictive']);clearInterval(_0x15e3af[_0x01f6('0xa2')]);_0x15e3af['handlePredictive']=undefined;this[_0x01f6('0xca')](_0x15e3af[_0x01f6('0x1d9')])[_0x01f6('0x42')](this[_0x01f6('0x1e0')](_0x15e3af))[_0x01f6('0x42')](mergeDataErlangB(_0x15e3af))[_0x01f6('0x42')](this[_0x01f6('0x1e1')](_0x15e3af))[_0x01f6('0xbc')](loggerCatchPredictive(_0x01f6('0x1e4'),_0x15e3af));}else if(_0x15e3af[_0x01f6('0x1d1')]&&_0x3f6895<_0x15e3af[_0x01f6('0x1d1')]-_0x145b5a){freeVariablesPredictive(_0x15e3af);loggerPredictive['info'](_0x15e3af[_0x01f6('0x48')],_0x01f6('0x1e5'),_0x3f6895,_0x01f6('0x1e6'),_0x15e3af['predictiveIntervalAvailable'],'-',_0x145b5a,'=',_0x15e3af['predictiveIntervalAvailable']-_0x145b5a,')');}else if(_0x15e3af['predictiveIntervalAvailable']&&_0x3f6895>_0x15e3af[_0x01f6('0x1d1')]+_0x4079ee){freeVariablesPredictive(_0x15e3af);loggerPredictive[_0x01f6('0x8e')](_0x15e3af['name'],_0x01f6('0x1e5'),_0x3f6895,_0x01f6('0x1e7'),_0x15e3af['predictiveIntervalAvailable'],'+',_0x4079ee,'=',_0x15e3af[_0x01f6('0x1d1')]+_0x4079ee,')');}};Dialer[_0x01f6('0x20')]['getDataPredictive']=function(_0x39412){var _0x3ccb09=this;return function(_0x18d7de){return new BPromise(function(_0x5acfe7,_0x4dabc1){_['merge'](_0x39412,_0x18d7de[0x0]);if(checkGetDataPredictive(_0x18d7de[0x0])){var _0x5a20b3=_0x39412[_0x01f6('0x1d1')]=_0x39412['talking']+_0x39412['available'];var _0xa47a9f=_0x39412['dialPredictiveInterval']*0x3c;var _0x21bb9c=_0x18d7de[0x0][_0x01f6('0x96')]+_0x18d7de[0x0]['predictiveIntervalAvgHoldtime'];var _0x462886=(_0x18d7de[0x0][_0x01f6('0x77')]+_0x18d7de[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x18d7de[0x0][_0x01f6('0x79')])/_0x18d7de[0x0][_0x01f6('0x7e')];_0x39412[_0x01f6('0x7b')]=_0x462886>0x0?_0x462886:0x1;switch(_0x39412[_0x01f6('0x1db')]){case _0x01f6('0x1dc'):var _0x2451aa=_0x39412[_0x01f6('0x1cf')]/0x64;return _0x3ccb09[_0x01f6('0x1e8')](_0x5a20b3,_0xa47a9f,_0x21bb9c,_0x462886,_0x2451aa)[_0x01f6('0x42')](function(_0x58aa39){return _0x5acfe7(_0x58aa39);});case _0x01f6('0x1e9'):var _0x4bb21a=_0x39412[_0x01f6('0x1cf')]/0x64;return _0x3ccb09[_0x01f6('0x1ea')](_0x5a20b3,_0xa47a9f,_0x21bb9c,_0x462886,_0x4bb21a)[_0x01f6('0x42')](function(_0x73e6ac){return _0x5acfe7(_0x73e6ac);});default:return _0x4dabc1(msgResponse('[getDataPredictive]',_0x01f6('0x156'),_0x01f6('0x1eb')));}}else{return _0x4dabc1(msgResponse(_0x01f6('0x1ec'),_0x01f6('0x156'),_0x01f6('0x1ed')));}});};};Dialer['prototype'][_0x01f6('0x1ee')]=function(_0x32e32e){var _0x4c4d7a=this;return function(_0x495698){return new BPromise(function(_0x272b48,_0x15e6ff){_[_0x01f6('0x9f')](_0x32e32e,_0x495698[0x0]);if(checkGetDataPredictive(_0x495698[0x0])){loggerPredictive[_0x01f6('0x8e')](JSON[_0x01f6('0x51')](_0x495698[0x0]));if(_0x32e32e['dialPredictiveOptimization']==='dropRate'){return _0x4c4d7a[_0x01f6('0xd6')](_0x32e32e['id'])[_0x01f6('0x42')](function(_0x2b6351){var _0x365838=_0x32e32e[_0x01f6('0x5a')]-_0x2b6351[0x0][_0x01f6('0x1ef')];var _0x46e1b6=_0x32e32e[_0x01f6('0x1d9')]*0x3c;var _0x791755=_0x495698[0x0]['predictiveIntervalAvgTalktime']+_0x495698[0x0][_0x01f6('0x78')];var _0xe82283=(_0x495698[0x0][_0x01f6('0x77')]+_0x495698[0x0][_0x01f6('0x92')]+_0x495698[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x495698[0x0]['predictiveIntervalTotalCalls'];var _0x2671f1=_0x32e32e[_0x01f6('0x1cf')]/0x64;_0x32e32e[_0x01f6('0x7d')]=_0x2b6351[0x0]['outboundQueuePauses']||0x0;_0x32e32e[_0x01f6('0x7b')]=_0xe82283>0x0?_0xe82283:0x1;return _0x4c4d7a[_0x01f6('0x1e8')](_0x365838,_0x46e1b6,_0x791755,_0xe82283,_0x2671f1);})[_0x01f6('0x42')](function(_0x281ec7){return _0x272b48(_0x281ec7);})[_0x01f6('0xbc')](function(_0x567443){return _0x15e6ff(msgResponse(_0x01f6('0x1f0'),_0x01f6('0x156'),JSON['stringify'](_0x567443)));});}if(_0x32e32e[_0x01f6('0x1db')]===_0x01f6('0x1e9')){return _0x4c4d7a[_0x01f6('0xd6')](_0x32e32e['id'])[_0x01f6('0x42')](function(_0x25f2ed){var _0x26cfd3=_0x32e32e[_0x01f6('0x5a')]-_0x25f2ed[0x0][_0x01f6('0x1ef')];var _0x3c7ad2=_0x32e32e['dialPredictiveInterval']*0x3c;var _0x170afd=_0x495698[0x0][_0x01f6('0x96')]+_0x495698[0x0][_0x01f6('0x78')];var _0x2b587b=(_0x495698[0x0]['predictiveIntervalAnsweredCalls']+_0x495698[0x0][_0x01f6('0x92')]+_0x495698[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x495698[0x0][_0x01f6('0x7e')];var _0xd3d04a=_0x32e32e[_0x01f6('0x1cf')]/0x64;_0x32e32e[_0x01f6('0x7d')]=_0x25f2ed[0x0]['outboundQueuePauses']||0x0;_0x32e32e[_0x01f6('0x7b')]=_0x2b587b>0x0?_0x2b587b:0x1;return _0x4c4d7a[_0x01f6('0x1ea')](_0x26cfd3,_0x3c7ad2,_0x170afd,_0x2b587b,_0xd3d04a);})[_0x01f6('0x42')](function(_0x412491){return _0x272b48(_0x412491);})[_0x01f6('0xbc')](function(_0x1156a2){return _0x15e6ff(msgResponse(_0x01f6('0x1f0'),_0x01f6('0x156'),JSON[_0x01f6('0x51')](_0x1156a2)));});}}else{return _0x15e6ff(msgResponse('[getDataPredictive]',_0x01f6('0x156'),_0x01f6('0x1ed')));}});};};Dialer[_0x01f6('0x20')][_0x01f6('0x1e1')]=function(_0x48507d){var _0x58389c=this;return function(){var _0x25599c=0x0;var _0xbe47=Math[_0x01f6('0x1d4')](_0x48507d[_0x01f6('0x81')]*0x3e8);if(_0xbe47>0x0){_0xbe47=_0xbe47<0x64?0x64:_0xbe47;loggerPredictive['info'](_0x48507d['name'],_0x01f6('0x1f1'),_0xbe47,_0x01f6('0x52'));_0x48507d['handlePredictive']=setInterval(function(){_0x58389c['handlePredictive'](_0x48507d);loggerPredictiveCalls[_0x01f6('0x8e')](_0x01f6('0x1f2'),_0x25599c+=0x1);},_0xbe47);}else{loggerPredictive[_0x01f6('0x8e')](_0x48507d['name'],_0x01f6('0x1f3'));}};};Dialer[_0x01f6('0x20')]['checkContactBlack']=function(_0x452541,_0x590b0c){var _0x509931=this;return function(_0x2be0f0){if(_[_0x01f6('0x4e')](_0x2be0f0)){if(_[_0x01f6('0xea')](_0x590b0c[_0x01f6('0xe1')])||!_0x590b0c['recallme']){if(_0x452541[_0x01f6('0x65')]===_0x01f6('0x8')){_0x452541['queueStatusComplete']=_[_0x01f6('0x97')](_0x452541['queueStatusComplete'])?!![]:_0x452541['queueStatusComplete'];var _0x52b555=uuid['v4']();_0x509931[_0x01f6('0x2b')][_0x52b555]=new Action(_0x452541,_0x590b0c,_0x52b555);loggerBooked['info']('[booked][checkContactBlack]',_0x52b555,_0x01f6('0x1f4'),JSON[_0x01f6('0x51')](_0x452541['queueStatusComplete']),'Queue:\x20',_0x452541['name']);if(_0x452541[_0x01f6('0x13b')]){_0x452541[_0x01f6('0x13b')]=![];_0x509931['queueBooked'][_0x509931[_0x01f6('0x2b')][_0x52b555]['queue']]=[];ami[_0x01f6('0x15a')]({'actionid':_0x52b555,'action':_0x01f6('0x1f5'),'queue':_0x452541[_0x01f6('0x48')]})[_0x01f6('0xbc')](function(){_0x509931[_0x01f6('0xbe')](_0x452541);_0x509931[_0x01f6('0xcd')]({'active':![],'ContactId':_0x509931[_0x01f6('0x2b')][_0x52b555][_0x01f6('0xdf')],'ListId':_0x509931[_0x01f6('0x2b')][_0x52b555][_0x01f6('0xe0')],'VoiceQueueId':_0x509931[_0x01f6('0x2b')][_0x52b555][_0x01f6('0xe2')]||undefined,'CampaignId':_0x509931[_0x01f6('0x2b')][_0x52b555][_0x01f6('0x10b')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x509931[_0x01f6('0x2b')][_0x52b555];});}else{loggerBooked[_0x01f6('0x8e')](_0x01f6('0x1f6'),JSON[_0x01f6('0x51')](_0x452541[_0x01f6('0x13b')]),_0x01f6('0x1f7'),_0x452541[_0x01f6('0x48')]);_0x509931[_0x01f6('0xbe')](_0x452541);_0x509931[_0x01f6('0xcd')]({'active':![],'ContactId':_0x509931[_0x01f6('0x2b')][_0x52b555][_0x01f6('0xdf')],'ListId':_0x509931[_0x01f6('0x2b')][_0x52b555][_0x01f6('0xe0')],'VoiceQueueId':_0x509931['actions'][_0x52b555][_0x01f6('0xe2')]||undefined,'CampaignId':_0x509931['actions'][_0x52b555][_0x01f6('0x10b')]||undefined})[_0x01f6('0xbc')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x509931[_0x01f6('0x2b')][_0x52b555];}}else{return _0x509931['actionOriginate'](_0x452541,_0x590b0c);}}else{if(getDiff(_0x590b0c[_0x01f6('0x1f8')])<_0x452541['dialRecallMeTimeout']*0x3c){if(_0x590b0c['Agent']&&!_0x590b0c[_0x01f6('0x16d')][_0x01f6('0x1f9')]){_0x509931['preview']['run'](_0x590b0c['id'])[_0x01f6('0x140')](function(){_0x509931[_0x01f6('0xbe')](_0x452541);});}else{_0x509931['unlockContact']({'active':![]},_0x590b0c['id'],0x1)[_0x01f6('0x140')](function(){_0x509931[_0x01f6('0xbe')](_0x452541);});}}else{_0x452541[_0x01f6('0x74')]+=0x1;_0x509931[_0x01f6('0xbe')](_0x452541);if(_0x452541['dialRecallInQueue']){_0x509931[_0x01f6('0xcd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x590b0c[_0x01f6('0xdf')],'ListId':_0x590b0c[_0x01f6('0xe0')],'VoiceQueueId':_0x590b0c['VoiceQueueId']||undefined,'CampaignId':_0x590b0c[_0x01f6('0x10b')]||undefined})[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x1fa')));_0x509931['createHistory'](createObjHistory(_0x452541,_0x590b0c,_0x01f6('0x1fb'),0x17,'RecallInQueue'))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x509931['saveInDb'](createObjHistory(_0x452541,_0x590b0c,_0x01f6('0x1fc'),0x16,_0x01f6('0x1fd')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x452541[_0x01f6('0x6b')]+=0x1;_0x509931[_0x01f6('0x1fe')](createObjHistory(_0x452541,_0x590b0c,'BLACKLIST',0xd,_0x01f6('0x1ff')),_0x01f6('0x200'),_0x01f6('0x201'));throw _0x01f6('0x202');}};};Dialer[_0x01f6('0x20')]['handleIvr']=function(_0x46e6ac){var _0x587a48=this;var _0x2b56c0=_0x46e6ac[_0x01f6('0x203')]-_0x46e6ac[_0x01f6('0x7f')]-_0x46e6ac['temp'];emitCampaignSummary(_0x46e6ac);if(_0x2b56c0>0x0){if(_0x2b56c0>this[_0x01f6('0x29')]){_0x2b56c0=this['maxNumberOriginate'];}_0x46e6ac[_0x01f6('0xd2')]+=_0x2b56c0;this[_0x01f6('0xd4')](_0x46e6ac['id'],_0x2b56c0,_0x46e6ac['dialOrderByScheduledAt'],_0x46e6ac)[_0x01f6('0x42')](function(_0x518e97){_0x46e6ac[_0x01f6('0xd2')]-=_0x2b56c0;_0x46e6ac[_0x01f6('0xd2')]=_0x46e6ac[_0x01f6('0xd2')]>0x0?_0x46e6ac['temp']:0x0;if(!checkContactEmpty(_0x518e97)){_0x46e6ac[_0x01f6('0x44')]=_0x01f6('0xae');logger[_0x01f6('0x8e')](_0x01f6('0x204')+_0x46e6ac[_0x01f6('0x48')]);}else{_0x46e6ac[_0x01f6('0x7f')]+=_0x518e97['length'];_0x46e6ac[_0x01f6('0x44')]=_0x01f6('0x205');for(var _0x46e46e=0x0;_0x46e46e<_0x518e97['length'];_0x46e46e+=0x1){_0x46e6ac['ivrTotalCallsDays']+=0x1;if(_[_0x01f6('0xea')](_0x518e97[_0x46e46e])||_[_0x01f6('0xea')](_0x518e97[_0x46e46e]['Contact'])||_['isNil'](_0x518e97[_0x46e46e][_0x01f6('0x17c')])){_0x587a48['emptyContact']('[actionOriginate]\x20',_0x46e6ac,_0x518e97[_0x46e46e]);}else{_0x587a48[_0x01f6('0xc8')](_[_0x01f6('0xde')](_0x518e97[_0x46e46e],['CampaignId',_0x01f6('0x206')]))['then'](_0x587a48['checkContactBlack'](_0x46e6ac,_0x518e97[_0x46e46e]))[_0x01f6('0xbc')](_0x587a48['loggerHandler']('[actionOriginateIvr]\x20',_0x46e6ac));}}}})['catch'](loggerGetContactDialer(_0x01f6('0x207'),_0x46e6ac,_0x2b56c0));}};Dialer[_0x01f6('0x20')][_0x01f6('0x169')]=function(_0x56e40a,_0x30085f){var _0x293496=this;var _0x104811=[];var _0x22b64f=_0x30085f>=0x1?_0x30085f:0x1;if(_0x56e40a[_0x01f6('0x65')]===_0x01f6('0x8')){_0x22b64f=0x1;}var _0x526bc8=Math[_0x01f6('0x1d4')](_0x56e40a['available']*_0x22b64f)-_0x56e40a['originated']-_0x56e40a[_0x01f6('0xd2')];emitVoiceQueueSummary(_0x56e40a);if(_0x56e40a[_0x01f6('0x208')]>0x0){var _0x5a89cd=_0x56e40a['dialLimitQueue']-_0x56e40a[_0x01f6('0x7f')]-_0x56e40a['talking']-_0x56e40a[_0x01f6('0xd2')]-_0x56e40a[_0x01f6('0x5b')];if(_0x526bc8>_0x5a89cd){_0x526bc8=_0x5a89cd;}}if(_0x526bc8>0x0){if(_0x56e40a['dialMethod']===_0x01f6('0x8')){_0x526bc8=0x1;}if(_0x526bc8>this[_0x01f6('0x29')]){_0x526bc8=this[_0x01f6('0x29')];}_0x56e40a[_0x01f6('0xd2')]+=_0x526bc8;for(var _0x2be063 in this[_0x01f6('0x27')]){if(typeof this[_0x01f6('0x27')][_0x2be063]!==_0x01f6('0xa7')){if(this[_0x01f6('0x27')][_0x2be063]['state']===_0x01f6('0x209')&&this[_0x01f6('0x27')][_0x2be063]['status']==='reachable'){_0x104811['push'](this[_0x01f6('0x27')][_0x2be063]['id']);}}}this[_0x01f6('0xd1')](_0x56e40a['id'],_0x104811,_0x526bc8,_0x56e40a[_0x01f6('0x20a')],_0x56e40a)[_0x01f6('0x42')](function(_0x111e00){_0x56e40a[_0x01f6('0xd2')]-=_0x526bc8;_0x56e40a[_0x01f6('0xd2')]=_0x56e40a['temp']>0x0?_0x56e40a[_0x01f6('0xd2')]:0x0;if(!checkContactEmpty(_0x111e00)){_0x293496[_0x01f6('0xc1')](_0x56e40a)['then'](sendMessageReschedule(_0x56e40a))[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x20b')));}else{_0x56e40a['originated']+=_0x111e00[_0x01f6('0x16c')];_0x56e40a['message']=_0x56e40a[_0x01f6('0x65')]===_0x01f6('0x8')?_0x01f6('0x20c'):_0x01f6('0x205');for(var _0x1793e4=0x0;_0x1793e4<_0x111e00[_0x01f6('0x16c')];_0x1793e4+=0x1){if(_[_0x01f6('0xea')](_0x111e00[_0x1793e4])||_[_0x01f6('0xea')](_0x111e00[_0x1793e4][_0x01f6('0x193')])||_['isNil'](_0x111e00[_0x1793e4][_0x01f6('0x17c')])){_0x293496[_0x01f6('0x20d')](_0x01f6('0x20e'),_0x56e40a,_0x111e00[_0x1793e4]);}else{_0x293496[_0x01f6('0xc3')](_[_0x01f6('0xde')](_0x111e00[_0x1793e4],[_0x01f6('0xe2'),_0x01f6('0x206')]))[_0x01f6('0x42')](_0x293496[_0x01f6('0x20f')](_0x56e40a,_0x111e00[_0x1793e4]))[_0x01f6('0xbc')](_0x293496[_0x01f6('0xdc')](_0x01f6('0x20e'),_0x56e40a));}}}})[_0x01f6('0xbc')](loggerGetContactDialer(_0x01f6('0x210'),_0x56e40a,_0x526bc8));}};Dialer['prototype']['handlePredictive']=function(_0x4796ce){if(_0x4796ce['dialLimitQueue']>0x0){var _0x76b664=_0x4796ce['dialLimitQueue']-_0x4796ce['originated']-_0x4796ce[_0x01f6('0x5e')];if(_0x76b664>0x0){this[_0x01f6('0x211')](_0x4796ce);}else{loggerPredictiveCalls[_0x01f6('0x8e')](_0x01f6('0x212'));}}else{this[_0x01f6('0x211')](_0x4796ce);}};Dialer[_0x01f6('0x20')][_0x01f6('0x211')]=function(_0x3cf9a2){var _0x27eb54=this;var _0xdca1=[];_0x3cf9a2[_0x01f6('0x7f')]+=0x1;for(var _0x48e7ad in this[_0x01f6('0x27')]){if(typeof this[_0x01f6('0x27')][_0x48e7ad]!=='undefined'){if(this[_0x01f6('0x27')][_0x48e7ad]['state']===_0x01f6('0x209')&&this[_0x01f6('0x27')][_0x48e7ad]['status']===_0x01f6('0xe8')){_0xdca1[_0x01f6('0x13a')](this[_0x01f6('0x27')][_0x48e7ad]['id']);}}}this[_0x01f6('0xd1')](_0x3cf9a2['id'],_0xdca1,0x1,_0x3cf9a2[_0x01f6('0x20a')],_0x3cf9a2)['then'](function(_0x440f9d){if(!checkContactEmpty(_0x440f9d)){checkContactLowerLimitOriginate(_0x3cf9a2,0x1,0x0);_0x27eb54['countReScheduled'](_0x3cf9a2)[_0x01f6('0x42')](sendMessageReschedule(_0x3cf9a2))[_0x01f6('0xbc')](loggerCatch(_0x01f6('0x20b')));}else{_0x3cf9a2[_0x01f6('0x44')]='RUNNING';if(_[_0x01f6('0xea')](_0x440f9d[0x0])||_[_0x01f6('0xea')](_0x440f9d[0x0][_0x01f6('0x193')])||_['isNil'](_0x440f9d[0x0][_0x01f6('0x17c')])){_0x27eb54[_0x01f6('0x20d')]('[actionOriginate]\x20',_0x3cf9a2,_0x440f9d[0x0]);}else{_0x27eb54[_0x01f6('0xc3')](_[_0x01f6('0xde')](_0x440f9d[0x0],['VoiceQueueId',_0x01f6('0x206')]))[_0x01f6('0x42')](_0x27eb54[_0x01f6('0x20f')](_0x3cf9a2,_0x440f9d[0x0]))['catch'](_0x27eb54[_0x01f6('0xdc')](_0x01f6('0x213'),_0x3cf9a2));}}})[_0x01f6('0xbc')](loggerGetContactDialer('[getContactDialerPredictive]',_0x3cf9a2,0x1));emitVoiceQueueSummary(_0x3cf9a2);};Dialer[_0x01f6('0x20')][_0x01f6('0x1e8')]=function(_0xccf0dd,_0x399619,_0x2ea9e6,_0x418606,_0x267832,_0x3915e3){loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x214'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xccf0dd);loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x215'),_0x399619);loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x216'),_0x2ea9e6);loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x217'),_0x418606);loggerPredictive[_0x01f6('0x8e')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x267832);loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x9e'));return new BPromise(function(_0x8f16b9,_0x1753da){if(_0xccf0dd<=0x0||isNaN(_0xccf0dd)){return _0x1753da(msgResponse(_0x01f6('0x218'),'Error','m\x20=\x20'+_0xccf0dd));}if(_0x2ea9e6<=0x0||isNaN(_0x2ea9e6)){return _0x1753da(msgResponse(_0x01f6('0x218'),'Error',_0x01f6('0x219')+_0x2ea9e6));}if(_0x418606<=0x0||isNaN(_0x418606)){return _0x1753da(msgResponse(_0x01f6('0x218'),'Error','p\x20=\x20'+_0x418606));}if(_0x399619<=0x0||isNaN(_0x399619)){return _0x1753da(msgResponse('[abandonmentRate]','Error',_0x01f6('0x21a')+_0x399619));}if(_0x267832<=0x0||isNaN(_0x267832)){return _0x1753da(msgResponse(_0x01f6('0x218'),_0x01f6('0x50'),_0x01f6('0x21b')+_0x267832));}_0x3915e3=_0x3915e3||0x0;var _0x1b4960=0x1/_0x2ea9e6;var _0x1cdd9e=0x0;var _0xf24fa6=0x0;var _0x58ed53=0x0;var _0x3f3214=0x0;for(var _0x5c8c8a=0x0;_0x58ed53<_0x267832;_0x5c8c8a+=0x1){_0xf24fa6=_0x5c8c8a/_0x399619;_0x1cdd9e=(_0x418606*_0xf24fa6+_0x3915e3)/_0x1b4960;_0x58ed53=erlangb(_0x1cdd9e,_0xccf0dd);_0x3f3214=_0x1cdd9e/_0xccf0dd*(0x1-erlangb(_0x1cdd9e,_0xccf0dd));}return _0x8f16b9({'erlangCalls':_0x5c8c8a,'erlangCallToSecond':_0x399619/_0x5c8c8a,'erlangAbandonmentRate':_0x58ed53,'erlangBusyFactor':_0x3f3214});});};Dialer[_0x01f6('0x20')][_0x01f6('0x1ea')]=function(_0x307b51,_0x20a047,_0x3849bf,_0x59b966,_0x584ea0,_0x36a021){loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x21c'));loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x21d'),_0x307b51);loggerPredictive[_0x01f6('0x8e')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x20a047);loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x216'),_0x3849bf);loggerPredictive[_0x01f6('0x8e')](_0x01f6('0x217'),_0x59b966);loggerPredictive[_0x01f6('0x8e')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x584ea0);loggerPredictive[_0x01f6('0x8e')]('---------------------------');return new BPromise(function(_0x22be2b,_0x777b70){if(_0x307b51<=0x0||isNaN(_0x307b51)){return _0x777b70(msgResponse('[busyFactor]',_0x01f6('0x50'),_0x01f6('0x21e')+_0x307b51));}if(_0x3849bf<=0x0||isNaN(_0x3849bf)){return _0x777b70(msgResponse(_0x01f6('0x21f'),_0x01f6('0x50'),'Ts\x20=\x20'+_0x3849bf));}if(_0x59b966<=0x0||isNaN(_0x59b966)){return _0x777b70(msgResponse('[busyFactor]',_0x01f6('0x50'),_0x01f6('0x220')+_0x59b966));}if(_0x20a047<=0x0||isNaN(_0x20a047)){return _0x777b70(msgResponse(_0x01f6('0x21f'),_0x01f6('0x50'),'interval\x20=\x20'+_0x20a047));}if(_0x584ea0<=0x0||isNaN(_0x584ea0)){return _0x777b70(msgResponse(_0x01f6('0x21f'),'Error',_0x01f6('0x221')+_0x584ea0));}_0x36a021=_0x36a021||0x0;var _0x3873f9=0x1/_0x3849bf;var _0x1eb01b=0x0;var _0x1b28d4=0x0;var _0x4c4687=0x0;var _0x3b8d1a=0x0;for(var _0x371533=0x0;_0x3b8d1a<_0x584ea0;_0x371533+=0x1){_0x1b28d4=_0x371533/_0x20a047;_0x1eb01b=(_0x59b966*_0x1b28d4+_0x36a021)/_0x3873f9;_0x4c4687=erlangb(_0x1eb01b,_0x307b51);_0x3b8d1a=_0x1eb01b/_0x307b51*(0x1-erlangb(_0x1eb01b,_0x307b51));}return _0x22be2b({'erlangCalls':_0x371533,'erlangCallToSecond':_0x20a047/_0x371533,'erlangAbandonmentRate':_0x4c4687,'erlangBusyFactor':_0x3b8d1a});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 5a2105c..3edb9fc 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe53c=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','ringtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x5d319c,_0x4d5181){var _0x20873f=function(_0x40176c){while(--_0x40176c){_0x5d319c['push'](_0x5d319c['shift']());}};_0x20873f(++_0x4d5181);}(_0xe53c,0xbc));var _0xce53=function(_0xd83f3e,_0x3c909e){_0xd83f3e=_0xd83f3e-0x0;var _0x3afffc=_0xe53c[_0xd83f3e];return _0x3afffc;};'use strict';var util=require(_0xce53('0x0'));var _=require(_0xce53('0x1'));var moment=require('moment');function getSeconds(_0x1493bd,_0x58f131){var _0x557d06=moment(_0x1493bd)[_0xce53('0x2')](0x0);var _0x107289=moment(_0x58f131)[_0xce53('0x2')](0x0);return _0x557d06[_0xce53('0x3')](_0x107289,'seconds');}function QueueCallerAbandon(_0x558851,_0x4ceaea){this[_0xce53('0x4')]=_0x558851[_0xce53('0x4')];this[_0xce53('0x5')]=_0x558851[_0xce53('0x5')];this[_0xce53('0x6')]=_0x558851[_0xce53('0x5')]===_0xce53('0x7')?_0xce53('0x8'):_0x558851[_0xce53('0x5')];this[_0xce53('0x9')]=_0x558851[_0xce53('0x9')];this[_0xce53('0xa')]=_0x558851['countcongestionretry'];this[_0xce53('0xb')]=_0x558851[_0xce53('0xb')];this['countglobal']=_0x558851['countbusyretry']+_0x558851[_0xce53('0xa')]+_0x558851[_0xce53('0xb')]+_0x558851[_0xce53('0xc')]+_0x558851[_0xce53('0xd')]+_0x558851[_0xce53('0xe')]+_0x558851[_0xce53('0xf')]+_0x558851[_0xce53('0x10')];this[_0xce53('0xc')]=_0x558851[_0xce53('0xc')];this[_0xce53('0xd')]=_0x558851[_0xce53('0xd')];this[_0xce53('0xe')]=_0x558851[_0xce53('0xe')];this['countmachineretry']=_0x558851[_0xce53('0xf')];this[_0xce53('0x10')]=_0x558851['countagentrejectretry'];this[_0xce53('0x11')]=_0x4ceaea[_0xce53('0x11')];this[_0xce53('0x12')]=_0x558851[_0xce53('0x13')];this['calleridnum']=_0x558851[_0xce53('0x14')];this[_0xce53('0x15')]=_0x558851[_0xce53('0x15')];this[_0xce53('0x16')]=_0x558851[_0xce53('0x16')];this[_0xce53('0x17')]=_0x558851[_0xce53('0x17')];this['endtime']=this[_0xce53('0x17')];this[_0xce53('0x18')]=getSeconds(_0x558851[_0xce53('0x16')],_0x558851[_0xce53('0x15')]);this['holdtime']=getSeconds(this[_0xce53('0x17')],_0x558851[_0xce53('0x16')]);this[_0xce53('0x19')]=0x0;this[_0xce53('0x8')]=_0x4ceaea['queue'];this[_0xce53('0x1a')]=_0x4ceaea[_0xce53('0x1b')];this[_0xce53('0x1c')]=_0x4ceaea[_0xce53('0x1c')];this['callback']=_0x558851[_0xce53('0x1d')];this[_0xce53('0x1e')]=_0x558851[_0xce53('0x1e')];this[_0xce53('0x1f')]=_0x558851[_0xce53('0x1f')];this[_0xce53('0x20')]=_0x558851[_0xce53('0x20')];this['ContactId']=_0x558851['ContactId'];this[_0xce53('0x21')]=_0x558851[_0xce53('0x21')];this[_0xce53('0x22')]=_0x558851[_0xce53('0x22')];this[_0xce53('0x23')]=_0x558851[_0xce53('0x23')];this[_0xce53('0x24')]=_0x558851[_0xce53('0x24')];this[_0xce53('0x25')]=_0x558851['originatecalleridnum']||'';this[_0xce53('0x26')]=_0x558851[_0xce53('0x26')]||'';}module[_0xce53('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0xe0ae=['membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','seconds','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','holdtime','talktime','queue'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0xe0ae,0xa1));var _0xee0a=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0xe0ae[_0x10d670];return _0x20d6f8;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xee0a('0x0'));function getSeconds(_0x401526,_0x49a5e2){var _0x42f3f6=moment(_0x401526)['milliseconds'](0x0);var _0x32cc3e=moment(_0x49a5e2)[_0xee0a('0x1')](0x0);return _0x42f3f6['diff'](_0x32cc3e,_0xee0a('0x2'));}function QueueCallerAbandon(_0x4d393b,_0x5bef07){this[_0xee0a('0x3')]=_0x4d393b[_0xee0a('0x3')];this[_0xee0a('0x4')]=_0x4d393b[_0xee0a('0x4')];this['campaigntype']=_0x4d393b[_0xee0a('0x4')]==='outbound'?'queue':_0x4d393b[_0xee0a('0x4')];this[_0xee0a('0x5')]=_0x4d393b[_0xee0a('0x5')];this['countcongestionretry']=_0x4d393b[_0xee0a('0x6')];this[_0xee0a('0x7')]=_0x4d393b['countnoanswerretry'];this[_0xee0a('0x8')]=_0x4d393b['countbusyretry']+_0x4d393b[_0xee0a('0x6')]+_0x4d393b[_0xee0a('0x7')]+_0x4d393b['countnosuchnumberretry']+_0x4d393b[_0xee0a('0x9')]+_0x4d393b['countabandonedretry']+_0x4d393b[_0xee0a('0xa')]+_0x4d393b[_0xee0a('0xb')];this['countnosuchnumberretry']=_0x4d393b['countnosuchnumberretry'];this[_0xee0a('0x9')]=_0x4d393b[_0xee0a('0x9')];this[_0xee0a('0xc')]=_0x4d393b[_0xee0a('0xc')];this[_0xee0a('0xa')]=_0x4d393b['countmachineretry'];this[_0xee0a('0xb')]=_0x4d393b[_0xee0a('0xb')];this['uniqueid']=_0x5bef07[_0xee0a('0xd')];this[_0xee0a('0xe')]=_0x4d393b[_0xee0a('0xf')];this[_0xee0a('0x10')]=_0x4d393b['number'];this[_0xee0a('0x11')]=_0x4d393b[_0xee0a('0x11')];this[_0xee0a('0x12')]=_0x4d393b['responsetime'];this[_0xee0a('0x13')]=_0x4d393b[_0xee0a('0x13')];this[_0xee0a('0x14')]=this[_0xee0a('0x13')];this['ringtime']=getSeconds(_0x4d393b[_0xee0a('0x12')],_0x4d393b[_0xee0a('0x11')]);this[_0xee0a('0x15')]=getSeconds(this[_0xee0a('0x13')],_0x4d393b['responsetime']);this[_0xee0a('0x16')]=0x0;this[_0xee0a('0x17')]=_0x5bef07[_0xee0a('0x17')];this[_0xee0a('0x18')]=_0x5bef07[_0xee0a('0x19')];this[_0xee0a('0x1a')]=_0x5bef07[_0xee0a('0x1a')];this['callback']=_0x4d393b[_0xee0a('0x1b')];this[_0xee0a('0x1c')]=_0x4d393b[_0xee0a('0x1c')];this[_0xee0a('0x1d')]=_0x4d393b['callbackat'];this[_0xee0a('0x1e')]=_0x4d393b[_0xee0a('0x1e')];this[_0xee0a('0x1f')]=_0x4d393b[_0xee0a('0x1f')];this['ListId']=_0x4d393b['ListId'];this['UserId']=_0x4d393b[_0xee0a('0x20')];this['VoiceQueueId']=_0x4d393b['VoiceQueueId'];this[_0xee0a('0x21')]=_0x4d393b[_0xee0a('0x21')];this[_0xee0a('0x22')]=_0x4d393b['originatecalleridnum']||'';this[_0xee0a('0x23')]=_0x4d393b[_0xee0a('0x23')]||'';}module[_0xee0a('0x24')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index bc03886..e937a67 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(_0x54d865,_0x56f142){var _0xc914cc=function(_0xc4f2b){while(--_0xc4f2b){_0x54d865['push'](_0x54d865['shift']());}};_0xc914cc(++_0x56f142);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x2e7c24,_0x404874){var _0x3a5f86=function(_0xfed114){while(--_0xfed114){_0x2e7c24['push'](_0x2e7c24['shift']());}};_0x3a5f86(++_0x404874);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 e25d7b6..d85b1a1 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 _0x4213=['Is\x20Valid','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','name','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','fax','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','pick','response','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','trunks','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]'];(function(_0x16431e,_0x5269ef){var _0x9922eb=function(_0x3301f4){while(--_0x3301f4){_0x16431e['push'](_0x16431e['shift']());}};_0x9922eb(++_0x5269ef);}(_0x4213,0x77));var _0x3421=function(_0x158771,_0x3b2086){_0x158771=_0x158771-0x0;var _0x50aa04=_0x4213[_0x158771];return _0x50aa04;};'use strict';var util=require(_0x3421('0x0'));var _=require(_0x3421('0x1'));var BPromise=require(_0x3421('0x2'));var uuid=require(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var path=require(_0x3421('0x5'));var tiff2pdf=require(_0x3421('0x6'));var gs=require('./util/gs');var logger=require(_0x3421('0x7'))('fax');var ami=require(_0x3421('0x8'));var rpcDb=require(_0x3421('0x9'));var Channel=require(_0x3421('0xa'));var ut=require(_0x3421('0xb'));var Action=require('./action');var faxAccount=require(_0x3421('0xc'));var attachment=require(_0x3421('0xd'));var faxMessage=require(_0x3421('0xe'));function Fax(_0x1cf6a0){this[_0x3421('0xf')]={};this['faxAccounts']=_0x1cf6a0[_0x3421('0x10')];this['trunks']=_0x1cf6a0['trunks'];this[_0x3421('0x11')]={};ami['on']('newchannel',this[_0x3421('0x12')][_0x3421('0x13')](this));ami['on'](_0x3421('0x14'),this[_0x3421('0x15')][_0x3421('0x13')](this));ami['on'](_0x3421('0x16'),this[_0x3421('0x17')]['bind'](this));ami['on'](_0x3421('0x18'),this[_0x3421('0x19')][_0x3421('0x13')](this));ami['on'](_0x3421('0x1a'),this[_0x3421('0x1b')][_0x3421('0x13')](this));ami['on'](_0x3421('0x1c'),this['syncReceiveFax'][_0x3421('0x13')](this));ami['on']('hangup',this[_0x3421('0x1d')][_0x3421('0x13')](this));ami['on']('originateresponse',this[_0x3421('0x1e')]['bind'](this));}Fax[_0x3421('0x1f')][_0x3421('0x12')]=function(_0x52af2d){if(_0x52af2d[_0x3421('0x20')]===_0x3421('0x21')){for(var _0x130d3c in this[_0x3421('0x10')]){if(this[_0x3421('0x10')][_0x3421('0x22')](_0x130d3c)){if(_0x52af2d[_0x3421('0x23')]===this[_0x3421('0x10')][_0x130d3c][_0x3421('0x24')]){this[_0x3421('0xf')][_0x52af2d[_0x3421('0x25')]]={};this['channels'][_0x52af2d[_0x3421('0x25')]]['channel']=_0x52af2d['channel'];this['channels'][_0x52af2d[_0x3421('0x25')]]['id']=this[_0x3421('0x10')][_0x130d3c]['id'];this[_0x3421('0xf')][_0x52af2d[_0x3421('0x25')]][_0x3421('0x26')]=this[_0x3421('0x10')][_0x130d3c][_0x3421('0x26')];logger[_0x3421('0x27')](_0x52af2d[_0x3421('0x25')],_0x3421('0x28'));}}}}if(this['actions'][_0x52af2d['uniqueid']]){this['channels'][_0x52af2d[_0x3421('0x25')]]={};this[_0x3421('0xf')][_0x52af2d[_0x3421('0x25')]]['channel']=_0x52af2d['channel'];logger[_0x3421('0x27')](_0x52af2d['uniqueid'],_0x3421('0x28'));}};Fax['prototype'][_0x3421('0x15')]=function(_0x224796){if(this[_0x3421('0xf')][_0x224796[_0x3421('0x25')]]){for(var _0x186885 in _0x224796['variable']){if(_0x224796[_0x3421('0x29')]['hasOwnProperty'](_0x186885)){this['channels'][_0x224796[_0x3421('0x25')]][_0x186885]=_0x224796['value'];}}}};Fax['prototype'][_0x3421('0x17')]=function(_0x4ee4aa){if(this[_0x3421('0xf')][_0x4ee4aa['uniqueid']]){this[_0x3421('0xf')][_0x4ee4aa[_0x3421('0x25')]]['channelstate']=_0x4ee4aa[_0x3421('0x2a')];this[_0x3421('0xf')][_0x4ee4aa[_0x3421('0x25')]]['channelstatedesc']=_0x4ee4aa[_0x3421('0x2b')];}};Fax['prototype'][_0x3421('0x19')]=function(_0xf0039){if(this[_0x3421('0xf')][_0xf0039[_0x3421('0x25')]]){for(var _0x3875c6 in _0xf0039[_0x3421('0x29')]){if(_0xf0039[_0x3421('0x29')][_0x3421('0x22')](_0x3875c6)){this[_0x3421('0xf')][_0xf0039[_0x3421('0x25')]][_0x3875c6]=_0xf0039['value'];}}}};Fax['prototype'][_0x3421('0x1b')]=function(_0x1c21a8){if(this['channels'][_0x1c21a8[_0x3421('0x25')]]){this[_0x3421('0xf')][_0x1c21a8[_0x3421('0x25')]][_0x3421('0x2c')]=_0x1c21a8[_0x3421('0x2c')];this['channels'][_0x1c21a8[_0x3421('0x25')]][_0x3421('0x2d')]=_0x1c21a8[_0x3421('0x2d')];this['channels'][_0x1c21a8[_0x3421('0x25')]]['localstationid']=_0x1c21a8[_0x3421('0x24')];this[_0x3421('0xf')][_0x1c21a8[_0x3421('0x25')]][_0x3421('0x2e')]=_0x1c21a8[_0x3421('0x2e')];logger[_0x3421('0x27')](_0x1c21a8[_0x3421('0x25')],'\x20syncFaxStatus\x20');}};Fax['prototype']['syncReceiveFax']=function(_0x4696f3){var _0x4edf62=this;if(this['channels'][_0x4696f3[_0x3421('0x25')]]){var _0x4e76e0=this[_0x3421('0xf')][_0x4696f3[_0x3421('0x25')]]['id'];this['channels'][_0x4696f3[_0x3421('0x25')]][_0x3421('0x2f')]=_0x4696f3[_0x3421('0x2f')];this[_0x3421('0xf')][_0x4696f3['uniqueid']][_0x3421('0x30')]=_0x4696f3[_0x3421('0x30')];this[_0x3421('0xf')][_0x4696f3[_0x3421('0x25')]][_0x3421('0x24')]=_0x4696f3['localstationid'];this[_0x3421('0xf')][_0x4696f3[_0x3421('0x25')]]['resolution']=_0x4696f3[_0x3421('0x31')];this['channels'][_0x4696f3['uniqueid']]['transferrate']=_0x4696f3[_0x3421('0x32')];this[_0x3421('0xf')][_0x4696f3[_0x3421('0x25')]][_0x3421('0x2e')]=_0x4696f3[_0x3421('0x2e')];this[_0x3421('0xf')][_0x4696f3[_0x3421('0x25')]][_0x3421('0x33')]=_0x4696f3[_0x3421('0x33')];if(this[_0x3421('0xf')][_0x4696f3[_0x3421('0x25')]][_0x3421('0x30')]>0x0){tiff2pdf(_0x4696f3[_0x3421('0x2e')],_0x3421('0x34'),function(_0x50407f){logger[_0x3421('0x27')](_0x4696f3[_0x3421('0x25')],_0x3421('0x35'),_0x50407f[_0x3421('0x36')]);attachment['create']({'name':path[_0x3421('0x37')](_0x4696f3['filename'])[_0x3421('0x26')],'basename':path[_0x3421('0x37')](_0x4696f3[_0x3421('0x2e')])[_0x3421('0x26')]+_0x3421('0x38'),'type':_0x3421('0x39')})[_0x3421('0x3a')](function(_0x305951){faxAccount[_0x3421('0x3b')](_0x4e76e0,{'from':_0x4696f3[_0x3421('0x33')],'mapKey':_0x3421('0x3c'),'body':path[_0x3421('0x37')](_0x4696f3[_0x3421('0x2e')])['name']+_0x3421('0x38'),'AttachmentId':_0x305951['id']})['catch'](function(_0x1a029b){logger[_0x3421('0x3d')](_0x4696f3[_0x3421('0x25')],_0x3421('0x3e'),JSON[_0x3421('0x3f')](_0x1a029b));});})[_0x3421('0x40')](function(_0x2a11a3){logger[_0x3421('0x3d')](_0x4696f3[_0x3421('0x25')],_0x3421('0x41'),JSON['stringify'](_0x2a11a3));});});}logger[_0x3421('0x27')](_0x4696f3[_0x3421('0x25')],_0x3421('0x41'));}};Fax['prototype']['syncOriginateResponse']=function(_0x43a94f){if(this[_0x3421('0x11')][_0x43a94f[_0x3421('0x25')]]){_['merge'](this[_0x3421('0xf')][_0x43a94f[_0x3421('0x25')]],_[_0x3421('0x42')](_0x43a94f,[_0x3421('0x43'),'reason']));}};function updateStatus(_0x99523d){if(_0x99523d[_0x3421('0x44')]){faxMessage[_0x3421('0x45')](_0x99523d['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x37eb44){ut[_0x3421('0x46')]('[Fax][Message][Error][Updated]',_0x37eb44);})['catch'](function(_0x2a3bf5){ut[_0x3421('0x46')](_0x3421('0x47'),_0x2a3bf5);});}else{ut[_0x3421('0x46')](_0x3421('0x48'));}}Fax['prototype'][_0x3421('0x49')]=function(_0x2a81fa,_0x3e6e36,_0x2f9ce1){var _0x535934=this;var _0x1d243f={};if(_0x3e6e36){_0x1d243f={'read':_0x3e6e36};}else{_0x1d243f={'failMessage':_0x2f9ce1};}if(this[_0x3421('0x11')][_0x2a81fa][_0x3421('0x44')]){faxMessage['update'](this[_0x3421('0x11')][_0x2a81fa]['AttachmentId'],_0x1d243f)['then'](function(_0x11d30f){ut['logger'](_0x3421('0x4a'),_0x11d30f);})[_0x3421('0x40')](function(_0x12bd9a){ut['logger'](_0x3421('0x4b'),_0x12bd9a);})[_0x3421('0x4c')](function(){delete _0x535934[_0x3421('0xf')][_0x2a81fa];delete _0x535934[_0x3421('0x11')][_0x2a81fa];});}else{ut[_0x3421('0x46')](_0x3421('0x4d'));delete this[_0x3421('0xf')][_0x2a81fa];delete this[_0x3421('0x11')][_0x2a81fa];}};Fax[_0x3421('0x1f')]['syncHangup']=function(_0x1e4add){var _0x23ddd5=this;if(this['channels'][_0x1e4add[_0x3421('0x25')]]){if(this[_0x3421('0x11')][_0x1e4add[_0x3421('0x25')]]){this['channels'][_0x1e4add[_0x3421('0x25')]]['id']=this[_0x3421('0x11')][_0x1e4add[_0x3421('0x25')]]['id'];this[_0x3421('0xf')][_0x1e4add[_0x3421('0x25')]][_0x3421('0x26')]=this[_0x3421('0x11')][_0x1e4add[_0x3421('0x25')]][_0x3421('0x26')];}logger[_0x3421('0x27')](_0x1e4add[_0x3421('0x25')],this[_0x3421('0x11')][_0x1e4add[_0x3421('0x25')]]?_0x3421('0x4e'):_0x3421('0x4f'),JSON['stringify'](this[_0x3421('0xf')][_0x1e4add[_0x3421('0x25')]]));if(this[_0x3421('0x11')][_0x1e4add[_0x3421('0x25')]]){if(this[_0x3421('0xf')][_0x1e4add[_0x3421('0x25')]][_0x3421('0x50')]>0x0&&this[_0x3421('0xf')][_0x1e4add['uniqueid']][_0x3421('0x1a')]==='SUCCESS'){this[_0x3421('0x49')](_0x1e4add[_0x3421('0x25')],!![]);}else{this[_0x3421('0x49')](_0x1e4add[_0x3421('0x25')],![],this['channels'][_0x1e4add[_0x3421('0x25')]][_0x3421('0x51')]?_0x3421('0x52')+this[_0x3421('0xf')][_0x1e4add[_0x3421('0x25')]][_0x3421('0x51')]:'SENDING\x20FAILED');}}}};Fax[_0x3421('0x1f')][_0x3421('0x53')]=function(_0x1e9971){var _0x278bbf=this;return new BPromise(function(_0x443b0a,_0x1ba5e1){_0x278bbf[_0x3421('0x54')](_0x1e9971,_0x278bbf[_0x3421('0x10')][_0x1e9971['FaxAccountId']])[_0x3421('0x3a')](function(_0x46717b){ut[_0x3421('0x46')](_0x3421('0x55'),_0x46717b);_0x443b0a(ut[_0x3421('0x36')]('Fax\x20received'));})['catch'](function(_0x44fde6){ut[_0x3421('0x46')](_0x3421('0x56'),_0x44fde6);updateStatus(_0x1e9971);_0x1ba5e1(ut['message'](_0x3421('0x57')));});});};Fax['prototype'][_0x3421('0x58')]=function(_0x4d2747){var _0x4f23c5=this;return new BPromise(function(_0x520325,_0x5c1a53){var _0x4fd786=_0x4f23c5[_0x3421('0x59')](_0x4f23c5[_0x3421('0x10')][_0x4d2747[_0x3421('0x5a')]][_0x3421('0x5b')],_0x4d2747);if(_0x4fd786[_0x3421('0x5c')]){_0x520325(ut[_0x3421('0x36')](_0x3421('0x5d')));}else{_0x5c1a53(ut[_0x3421('0x36')](_0x4fd786[_0x3421('0x36')]));}});};function originate(_0x464226,_0x5c7a78,_0x297184){return new BPromise(function(_0x4dce60,_0x252b28){if(_0x297184){var _0x41e5f8=util[_0x3421('0x5e')](_0x3421('0x5f'),path[_0x3421('0x37')](_0x464226[_0x3421('0x5')])[_0x3421('0x26')],_0x464226[_0x3421('0x5')]);gs[_0x3421('0x60')](_0x41e5f8)['then'](function(){_0x464226[_0x3421('0x5')]=util[_0x3421('0x5e')](_0x3421('0x61'),path['parse'](_0x464226['path'])['dir'],path['parse'](_0x464226[_0x3421('0x5')])['name']);_0x5c7a78[_0x3421('0x62')]=_0x464226[_0x3421('0x5')];ut[_0x3421('0x46')](_0x3421('0x63'),'');ami['Action'](ut[_0x3421('0x64')](_0x464226,_0x5c7a78))[_0x3421('0x3a')](function(_0x120c99){_0x4dce60(_0x120c99);})[_0x3421('0x40')](function(_0x151eaf){_0x252b28(_0x151eaf);});})[_0x3421('0x40')](function(_0x5011ec){_0x252b28(_0x5011ec);});}else{ami[_0x3421('0x65')](ut[_0x3421('0x64')](_0x464226,_0x5c7a78))[_0x3421('0x3a')](function(_0x2af027){_0x4dce60(_0x2af027);})[_0x3421('0x40')](function(_0x180727){_0x252b28(_0x180727);});}});}Fax[_0x3421('0x1f')]['execOriginate']=function(_0x51f0ae,_0x45a6fb){var _0x1f6439=this;return new BPromise(function(_0x45d1ba,_0x5d04c6){var _0x2dac40=uuid['v4']();var _0x539c75=ut[_0x3421('0x66')](_0x51f0ae,_0x45a6fb);_0x1f6439['actions'][_0x2dac40]=new Action(_0x2dac40,_0x45a6fb,_0x51f0ae);var _0x402195=_0x1f6439[_0x3421('0x11')][_0x2dac40];if(path[_0x3421('0x37')](_0x51f0ae[_0x3421('0x5')])[_0x3421('0x67')]===_0x3421('0x38')){originate(_0x402195,_0x539c75,!![])[_0x3421('0x3a')](function(_0x17609c){_0x45d1ba(_0x17609c);})[_0x3421('0x40')](function(_0x37ca80){_0x5d04c6(_0x37ca80);});}else{originate(_0x402195,_0x539c75,![])[_0x3421('0x3a')](function(_0x257cc7){_0x45d1ba(_0x257cc7);})['catch'](function(_0x321335){_0x5d04c6(_0x321335);});}});};Fax[_0x3421('0x1f')][_0x3421('0x68')]=function(_0x387d09){return!_[_0x3421('0x69')](_0x387d09)&&!_[_0x3421('0x69')](_0x387d09[_0x3421('0x26')])&&!_[_0x3421('0x69')](_0x387d09['active'])&&_0x387d09[_0x3421('0x6a')]&&!_['isNil'](this['trunks'][util['format'](_0x3421('0x6b'),_0x387d09[_0x3421('0x26')])])&&!_[_0x3421('0x69')](this[_0x3421('0x6c')][util['format'](_0x3421('0x6b'),_0x387d09[_0x3421('0x26')])][_0x3421('0x2d')])&&(this[_0x3421('0x6c')][util[_0x3421('0x5e')](_0x3421('0x6b'),_0x387d09[_0x3421('0x26')])][_0x3421('0x2d')]===_0x3421('0x6d')||this[_0x3421('0x6c')][util[_0x3421('0x5e')](_0x3421('0x6b'),_0x387d09[_0x3421('0x26')])][_0x3421('0x2d')]===_0x3421('0x6e'));};Fax[_0x3421('0x1f')][_0x3421('0x59')]=function(_0x498f6e,_0x5afe2f){if(!this[_0x3421('0x68')](_0x498f6e)){ut['logger'](_0x3421('0x6f'),_[_0x3421('0x69')](_0x498f6e)?'':_0x498f6e['name']+_0x3421('0x70'));return{'isValid':![],'message':_0x3421('0x71')};}if(_[_0x3421('0x69')](_0x5afe2f[_0x3421('0x3c')])){ut[_0x3421('0x46')](_0x3421('0x72'),JSON[_0x3421('0x3f')](_0x5afe2f));return{'isValid':![],'message':_0x3421('0x73')};}if(_[_0x3421('0x69')](_0x5afe2f[_0x3421('0x5')])){ut[_0x3421('0x46')](_0x3421('0x74'),JSON[_0x3421('0x3f')](_0x5afe2f));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x3421('0x75')};};module['exports']=Fax; \ No newline at end of file +var _0x3266=['uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','faxstatus','syncReceiveFax','hangup','syncHangup','originateresponse','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','fax','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','then','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','format','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isNil','active','status','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird'];(function(_0x493043,_0x118b7d){var _0x25ab64=function(_0x404c16){while(--_0x404c16){_0x493043['push'](_0x493043['shift']());}};_0x25ab64(++_0x118b7d);}(_0x3266,0x6a));var _0x6326=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x3266[_0x5cb1af];return _0x8d7940;};'use strict';var util=require(_0x6326('0x0'));var _=require(_0x6326('0x1'));var BPromise=require(_0x6326('0x2'));var uuid=require(_0x6326('0x3'));var moment=require(_0x6326('0x4'));var path=require(_0x6326('0x5'));var tiff2pdf=require(_0x6326('0x6'));var gs=require(_0x6326('0x7'));var logger=require(_0x6326('0x8'))('fax');var ami=require(_0x6326('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0x6326('0xa'));var ut=require(_0x6326('0xb'));var Action=require(_0x6326('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x6326('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x2af571){this[_0x6326('0xe')]={};this[_0x6326('0xf')]=_0x2af571[_0x6326('0xf')];this[_0x6326('0x10')]=_0x2af571['trunks'];this[_0x6326('0x11')]={};ami['on'](_0x6326('0x12'),this[_0x6326('0x13')][_0x6326('0x14')](this));ami['on'](_0x6326('0x15'),this[_0x6326('0x16')][_0x6326('0x14')](this));ami['on'](_0x6326('0x17'),this[_0x6326('0x18')][_0x6326('0x14')](this));ami['on']('newexten',this['syncNewExten'][_0x6326('0x14')](this));ami['on'](_0x6326('0x19'),this['syncFaxStatus'][_0x6326('0x14')](this));ami['on']('receivefax',this[_0x6326('0x1a')][_0x6326('0x14')](this));ami['on'](_0x6326('0x1b'),this[_0x6326('0x1c')][_0x6326('0x14')](this));ami['on'](_0x6326('0x1d'),this['syncOriginateResponse'][_0x6326('0x14')](this));}Fax['prototype']['syncNewchannel']=function(_0x55dd9f){if(_0x55dd9f['context']==='from-voip-provider'){for(var _0x58e960 in this[_0x6326('0xf')]){if(this[_0x6326('0xf')][_0x6326('0x1e')](_0x58e960)){if(_0x55dd9f['exten']===this['faxAccounts'][_0x58e960][_0x6326('0x1f')]){this[_0x6326('0xe')][_0x55dd9f[_0x6326('0x20')]]={};this[_0x6326('0xe')][_0x55dd9f[_0x6326('0x20')]][_0x6326('0x21')]=_0x55dd9f[_0x6326('0x21')];this['channels'][_0x55dd9f[_0x6326('0x20')]]['id']=this['faxAccounts'][_0x58e960]['id'];this[_0x6326('0xe')][_0x55dd9f[_0x6326('0x20')]][_0x6326('0x22')]=this[_0x6326('0xf')][_0x58e960][_0x6326('0x22')];logger[_0x6326('0x23')](_0x55dd9f[_0x6326('0x20')],_0x6326('0x24'));}}}}if(this[_0x6326('0x11')][_0x55dd9f[_0x6326('0x20')]]){this[_0x6326('0xe')][_0x55dd9f['uniqueid']]={};this[_0x6326('0xe')][_0x55dd9f[_0x6326('0x20')]]['channel']=_0x55dd9f['channel'];logger['info'](_0x55dd9f[_0x6326('0x20')],'\x20syncNewchannel\x20');}};Fax[_0x6326('0x25')][_0x6326('0x16')]=function(_0x5a907f){if(this[_0x6326('0xe')][_0x5a907f[_0x6326('0x20')]]){for(var _0xb68fec in _0x5a907f[_0x6326('0x26')]){if(_0x5a907f[_0x6326('0x26')][_0x6326('0x1e')](_0xb68fec)){this[_0x6326('0xe')][_0x5a907f[_0x6326('0x20')]][_0xb68fec]=_0x5a907f[_0x6326('0x27')];}}}};Fax[_0x6326('0x25')][_0x6326('0x18')]=function(_0x2a8873){if(this[_0x6326('0xe')][_0x2a8873[_0x6326('0x20')]]){this[_0x6326('0xe')][_0x2a8873[_0x6326('0x20')]]['channelstate']=_0x2a8873[_0x6326('0x28')];this[_0x6326('0xe')][_0x2a8873[_0x6326('0x20')]]['channelstatedesc']=_0x2a8873[_0x6326('0x29')];}};Fax['prototype']['syncNewExten']=function(_0xfb6b62){if(this[_0x6326('0xe')][_0xfb6b62[_0x6326('0x20')]]){for(var _0x103b1c in _0xfb6b62[_0x6326('0x26')]){if(_0xfb6b62[_0x6326('0x26')][_0x6326('0x1e')](_0x103b1c)){this[_0x6326('0xe')][_0xfb6b62[_0x6326('0x20')]][_0x103b1c]=_0xfb6b62[_0x6326('0x27')];}}}};Fax[_0x6326('0x25')][_0x6326('0x2a')]=function(_0x55aa3b){if(this[_0x6326('0xe')][_0x55aa3b[_0x6326('0x20')]]){this['channels'][_0x55aa3b[_0x6326('0x20')]][_0x6326('0x2b')]=_0x55aa3b[_0x6326('0x2b')];this['channels'][_0x55aa3b[_0x6326('0x20')]]['status']=_0x55aa3b['status'];this[_0x6326('0xe')][_0x55aa3b[_0x6326('0x20')]][_0x6326('0x1f')]=_0x55aa3b['localstationid'];this[_0x6326('0xe')][_0x55aa3b['uniqueid']][_0x6326('0x2c')]=_0x55aa3b['filename'];logger[_0x6326('0x23')](_0x55aa3b[_0x6326('0x20')],_0x6326('0x2d'));}};Fax[_0x6326('0x25')][_0x6326('0x1a')]=function(_0x207fb1){var _0x4f6c8a=this;if(this[_0x6326('0xe')][_0x207fb1[_0x6326('0x20')]]){var _0x489f05=this[_0x6326('0xe')][_0x207fb1['uniqueid']]['id'];this['channels'][_0x207fb1[_0x6326('0x20')]][_0x6326('0x2e')]=_0x207fb1[_0x6326('0x2e')];this[_0x6326('0xe')][_0x207fb1[_0x6326('0x20')]][_0x6326('0x2f')]=_0x207fb1['pagestransferred'];this['channels'][_0x207fb1[_0x6326('0x20')]]['localstationid']=_0x207fb1[_0x6326('0x1f')];this['channels'][_0x207fb1[_0x6326('0x20')]][_0x6326('0x30')]=_0x207fb1[_0x6326('0x30')];this[_0x6326('0xe')][_0x207fb1[_0x6326('0x20')]][_0x6326('0x31')]=_0x207fb1[_0x6326('0x31')];this[_0x6326('0xe')][_0x207fb1[_0x6326('0x20')]][_0x6326('0x2c')]=_0x207fb1[_0x6326('0x2c')];this['channels'][_0x207fb1[_0x6326('0x20')]]['calleridnum']=_0x207fb1[_0x6326('0x32')];if(this[_0x6326('0xe')][_0x207fb1[_0x6326('0x20')]][_0x6326('0x2f')]>0x0){tiff2pdf(_0x207fb1['filename'],_0x6326('0x33'),function(_0x255a70){logger['info'](_0x207fb1[_0x6326('0x20')],_0x6326('0x34'),_0x255a70[_0x6326('0x35')]);attachment[_0x6326('0x36')]({'name':path['parse'](_0x207fb1[_0x6326('0x2c')])[_0x6326('0x22')],'basename':path[_0x6326('0x37')](_0x207fb1[_0x6326('0x2c')])[_0x6326('0x22')]+_0x6326('0x38'),'type':_0x6326('0x39')})['then'](function(_0x2f6a90){faxAccount[_0x6326('0x3a')](_0x489f05,{'from':_0x207fb1[_0x6326('0x32')],'mapKey':_0x6326('0x3b'),'body':path['parse'](_0x207fb1[_0x6326('0x2c')])['name']+_0x6326('0x38'),'AttachmentId':_0x2f6a90['id']})[_0x6326('0x3c')](function(_0x119559){logger[_0x6326('0x3d')](_0x207fb1[_0x6326('0x20')],'\x20notify\x20',JSON[_0x6326('0x3e')](_0x119559));});})['catch'](function(_0x5e0e2f){logger[_0x6326('0x3d')](_0x207fb1[_0x6326('0x20')],'\x20receiveFax\x20',JSON[_0x6326('0x3e')](_0x5e0e2f));});});}logger[_0x6326('0x23')](_0x207fb1[_0x6326('0x20')],_0x6326('0x3f'));}};Fax[_0x6326('0x25')]['syncOriginateResponse']=function(_0x4af0ee){if(this[_0x6326('0x11')][_0x4af0ee[_0x6326('0x20')]]){_[_0x6326('0x40')](this[_0x6326('0xe')][_0x4af0ee[_0x6326('0x20')]],_[_0x6326('0x41')](_0x4af0ee,[_0x6326('0x42'),'reason']));}};function updateStatus(_0x1b5f5b){if(_0x1b5f5b[_0x6326('0x43')]){faxMessage[_0x6326('0x44')](_0x1b5f5b[_0x6326('0x43')],{'failMessage':_0x6326('0x45')})['then'](function(_0x189bef){ut['logger'](_0x6326('0x46'),_0x189bef);})[_0x6326('0x3c')](function(_0x585dec){ut[_0x6326('0x47')]('[Fax][Message][Error][NoUpdate1]',_0x585dec);});}else{ut[_0x6326('0x47')](_0x6326('0x48'));}}Fax[_0x6326('0x25')][_0x6326('0x49')]=function(_0x58731d,_0x42c8bc,_0xbe6b3e){var _0x5c3641=this;var _0x39f3b1={};if(_0x42c8bc){_0x39f3b1={'read':_0x42c8bc};}else{_0x39f3b1={'failMessage':_0xbe6b3e};}if(this[_0x6326('0x11')][_0x58731d][_0x6326('0x43')]){faxMessage['update'](this[_0x6326('0x11')][_0x58731d][_0x6326('0x43')],_0x39f3b1)['then'](function(_0x16e606){ut['logger'](_0x6326('0x4a'),_0x16e606);})[_0x6326('0x3c')](function(_0x3e9825){ut[_0x6326('0x47')](_0x6326('0x4b'),_0x3e9825);})[_0x6326('0x4c')](function(){delete _0x5c3641[_0x6326('0xe')][_0x58731d];delete _0x5c3641['actions'][_0x58731d];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0x6326('0xe')][_0x58731d];delete this['actions'][_0x58731d];}};Fax[_0x6326('0x25')][_0x6326('0x1c')]=function(_0xcae454){var _0x35c648=this;if(this[_0x6326('0xe')][_0xcae454['uniqueid']]){if(this[_0x6326('0x11')][_0xcae454[_0x6326('0x20')]]){this['channels'][_0xcae454[_0x6326('0x20')]]['id']=this[_0x6326('0x11')][_0xcae454[_0x6326('0x20')]]['id'];this[_0x6326('0xe')][_0xcae454[_0x6326('0x20')]][_0x6326('0x22')]=this[_0x6326('0x11')][_0xcae454[_0x6326('0x20')]][_0x6326('0x22')];}logger[_0x6326('0x23')](_0xcae454['uniqueid'],this[_0x6326('0x11')][_0xcae454[_0x6326('0x20')]]?_0x6326('0x4d'):_0x6326('0x4e'),JSON['stringify'](this['channels'][_0xcae454[_0x6326('0x20')]]));if(this[_0x6326('0x11')][_0xcae454[_0x6326('0x20')]]){if(this[_0x6326('0xe')][_0xcae454[_0x6326('0x20')]]['faxpages']>0x0&&this['channels'][_0xcae454[_0x6326('0x20')]][_0x6326('0x19')]===_0x6326('0x4f')){this[_0x6326('0x49')](_0xcae454['uniqueid'],!![]);}else{this[_0x6326('0x49')](_0xcae454[_0x6326('0x20')],![],this[_0x6326('0xe')][_0xcae454[_0x6326('0x20')]][_0x6326('0x50')]?_0x6326('0x51')+this['channels'][_0xcae454[_0x6326('0x20')]]['faxstatusstring']:_0x6326('0x52'));}}}};Fax[_0x6326('0x25')]['send']=function(_0x14d66c){var _0x56fb58=this;return new BPromise(function(_0x222e39,_0x3b6de7){_0x56fb58[_0x6326('0x53')](_0x14d66c,_0x56fb58[_0x6326('0xf')][_0x14d66c[_0x6326('0x54')]])[_0x6326('0x55')](function(_0xa2928e){ut[_0x6326('0x47')]('[Fax][execOriginate][success]',_0xa2928e);_0x222e39(ut[_0x6326('0x35')](_0x6326('0x56')));})[_0x6326('0x3c')](function(_0x5ade98){ut[_0x6326('0x47')]('[Fax][execOriginate][failure]',_0x5ade98);updateStatus(_0x14d66c);_0x3b6de7(ut[_0x6326('0x35')](_0x6326('0x57')));});});};Fax[_0x6326('0x25')][_0x6326('0x58')]=function(_0x3894cf){var _0x4f0305=this;return new BPromise(function(_0x468e7d,_0x564332){var _0x4ae3a9=_0x4f0305[_0x6326('0x59')](_0x4f0305[_0x6326('0xf')][_0x3894cf[_0x6326('0x54')]][_0x6326('0x5a')],_0x3894cf);if(_0x4ae3a9['isValid']){_0x468e7d(ut['message']('Trunk\x20Reachable'));}else{_0x564332(ut['message'](_0x4ae3a9[_0x6326('0x35')]));}});};function originate(_0x5044ab,_0x303fef,_0x5f6273){return new BPromise(function(_0x54730e,_0x4c1d7e){if(_0x5f6273){var _0x5401cf=util[_0x6326('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[_0x6326('0x37')](_0x5044ab['path'])['name'],_0x5044ab['path']);gs['execute'](_0x5401cf)[_0x6326('0x55')](function(){_0x5044ab['path']=util[_0x6326('0x5b')](_0x6326('0x5c'),path['parse'](_0x5044ab[_0x6326('0x5')])['dir'],path[_0x6326('0x37')](_0x5044ab[_0x6326('0x5')])[_0x6326('0x22')]);_0x303fef[_0x6326('0x5d')]=_0x5044ab[_0x6326('0x5')];ut[_0x6326('0x47')](_0x6326('0x5e'),'');ami[_0x6326('0x5f')](ut[_0x6326('0x60')](_0x5044ab,_0x303fef))[_0x6326('0x55')](function(_0x22d139){_0x54730e(_0x22d139);})[_0x6326('0x3c')](function(_0x3bc5f3){_0x4c1d7e(_0x3bc5f3);});})[_0x6326('0x3c')](function(_0x34e30f){_0x4c1d7e(_0x34e30f);});}else{ami[_0x6326('0x5f')](ut[_0x6326('0x60')](_0x5044ab,_0x303fef))['then'](function(_0x5a7e91){_0x54730e(_0x5a7e91);})['catch'](function(_0x4839bf){_0x4c1d7e(_0x4839bf);});}});}Fax[_0x6326('0x25')]['execOriginate']=function(_0x5d9796,_0x571e38){var _0x5a6b0c=this;return new BPromise(function(_0x565706,_0x5a1a9f){var _0xe845d6=uuid['v4']();var _0x5d664c=ut['addVariables'](_0x5d9796,_0x571e38);_0x5a6b0c[_0x6326('0x11')][_0xe845d6]=new Action(_0xe845d6,_0x571e38,_0x5d9796);var _0x2bfc43=_0x5a6b0c[_0x6326('0x11')][_0xe845d6];if(path['parse'](_0x5d9796[_0x6326('0x5')])[_0x6326('0x61')]===_0x6326('0x38')){originate(_0x2bfc43,_0x5d664c,!![])[_0x6326('0x55')](function(_0x3e9477){_0x565706(_0x3e9477);})['catch'](function(_0x3bff09){_0x5a1a9f(_0x3bff09);});}else{originate(_0x2bfc43,_0x5d664c,![])['then'](function(_0x5c2e68){_0x565706(_0x5c2e68);})[_0x6326('0x3c')](function(_0x4fa150){_0x5a1a9f(_0x4fa150);});}});};Fax['prototype']['isTrunkReachable']=function(_0x491f2e){return!_['isNil'](_0x491f2e)&&!_['isNil'](_0x491f2e['name'])&&!_[_0x6326('0x62')](_0x491f2e[_0x6326('0x63')])&&_0x491f2e[_0x6326('0x63')]&&!_[_0x6326('0x62')](this['trunks'][util['format']('SIP/%s',_0x491f2e[_0x6326('0x22')])])&&!_[_0x6326('0x62')](this['trunks'][util[_0x6326('0x5b')]('SIP/%s',_0x491f2e['name'])][_0x6326('0x64')])&&(this[_0x6326('0x10')][util[_0x6326('0x5b')](_0x6326('0x65'),_0x491f2e[_0x6326('0x22')])][_0x6326('0x64')]===_0x6326('0x66')||this['trunks'][util['format']('SIP/%s',_0x491f2e[_0x6326('0x22')])]['status']==='unmonitored');};Fax[_0x6326('0x25')][_0x6326('0x59')]=function(_0x53bbc3,_0x1fa91d){if(!this['isTrunkReachable'](_0x53bbc3)){ut['logger'](_0x6326('0x67'),_[_0x6326('0x62')](_0x53bbc3)?'':_0x53bbc3['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x6326('0x68')};}if(_[_0x6326('0x62')](_0x1fa91d[_0x6326('0x3b')])){ut[_0x6326('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x1fa91d));return{'isValid':![],'message':_0x6326('0x69')};}if(_[_0x6326('0x62')](_0x1fa91d[_0x6326('0x5')])){ut[_0x6326('0x47')](_0x6326('0x6a'),JSON[_0x6326('0x3e')](_0x1fa91d));return{'isValid':![],'message':_0x6326('0x6b')};}return{'isValid':!![],'message':_0x6326('0x6c')};};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 85de86f..a885331 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 _0xc039=['util','../../../config/logger','../rpc/faxAccount','error','inspect','notify','then','catch'];(function(_0x550fff,_0x5af529){var _0x515e23=function(_0x3e3d85){while(--_0x3e3d85){_0x550fff['push'](_0x550fff['shift']());}};_0x515e23(++_0x5af529);}(_0xc039,0xb0));var _0x9c03=function(_0xd5d027,_0x253537){_0xd5d027=_0xd5d027-0x0;var _0x3a73d1=_0xc039[_0xd5d027];return _0x3a73d1;};'use strict';var util=require(_0x9c03('0x0'));var BPromise=require('bluebird');var logger=require(_0x9c03('0x1'))('preview');var _=require('lodash');var faxAccount=require(_0x9c03('0x2'));function loggerCatch(_0x1c195d){return function(_0x5e8a78){logger[_0x9c03('0x3')](_0x1c195d,util[_0x9c03('0x4')](_0x5e8a78,{'showHidden':![],'depth':null}));};}exports[_0x9c03('0x5')]=function(_0x33cf55,_0x1937c8){return BPromise['resolve']()[_0x9c03('0x6')](faxAccount[_0x9c03('0x5')](_0x33cf55,_0x1937c8))[_0x9c03('0x7')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0x528f=['inspect','notify','then','catch','[Notify]\x20','bluebird','../../../config/logger','preview','../rpc/faxAccount','error'];(function(_0x348d8d,_0x1998f1){var _0x4b4bdc=function(_0x1fd177){while(--_0x1fd177){_0x348d8d['push'](_0x348d8d['shift']());}};_0x4b4bdc(++_0x1998f1);}(_0x528f,0xff));var _0xf528=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x528f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var BPromise=require(_0xf528('0x0'));var logger=require(_0xf528('0x1'))(_0xf528('0x2'));var _=require('lodash');var faxAccount=require(_0xf528('0x3'));function loggerCatch(_0x3dec43){return function(_0x4c9499){logger[_0xf528('0x4')](_0x3dec43,util[_0xf528('0x5')](_0x4c9499,{'showHidden':![],'depth':null}));};}exports[_0xf528('0x6')]=function(_0x423dae,_0x1f9507){return BPromise['resolve']()[_0xf528('0x7')](faxAccount[_0xf528('0x6')](_0x423dae,_0x1f9507))[_0xf528('0x8')](loggerCatch(_0xf528('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 65a3b18..1c69d4b 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 _0x2e66=['inspect','../../../../config/logger','fax','bluebird','child_process','exec','execute','Exec\x20gs','info','\x20Error\x20:'];(function(_0x2aaaf3,_0x136e41){var _0x4afb4b=function(_0x55de42){while(--_0x55de42){_0x2aaaf3['push'](_0x2aaaf3['shift']());}};_0x4afb4b(++_0x136e41);}(_0x2e66,0x79));var _0x62e6=function(_0x113566,_0x78c52a){_0x113566=_0x113566-0x0;var _0x359407=_0x2e66[_0x113566];return _0x359407;};'use strict';var util=require('util');var logger=require(_0x62e6('0x0'))(_0x62e6('0x1'));var BPromise=require(_0x62e6('0x2'));var exec=require(_0x62e6('0x3'))[_0x62e6('0x4')];exports[_0x62e6('0x5')]=function(_0x510ab4){return new BPromise(function(_0xff45f6,_0x46e9a1){exec(_0x510ab4,function(_0xb577cf,_0xb0cb02,_0x224f19){logger['info'](_0x62e6('0x6'),_0xb0cb02);if(_0xb577cf){logger[_0x62e6('0x7')](_0x62e6('0x6'),_0x62e6('0x8'),util[_0x62e6('0x9')](_0xb577cf,{'showHidden':![],'depth':null}),_0xb0cb02,_0x224f19);_0x46e9a1(_0xb577cf);}_0xff45f6(_0xb0cb02);});});}; \ No newline at end of file +var _0x5329=['../../../../config/logger','child_process','exec','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0x479978,_0x46ab1e){var _0x567a9f=function(_0x45a59e){while(--_0x45a59e){_0x479978['push'](_0x479978['shift']());}};_0x567a9f(++_0x46ab1e);}(_0x5329,0x14f));var _0x9532=function(_0x153b19,_0xd74123){_0x153b19=_0x153b19-0x0;var _0xa6f18e=_0x5329[_0x153b19];return _0xa6f18e;};'use strict';var util=require(_0x9532('0x0'));var logger=require(_0x9532('0x1'))('fax');var BPromise=require('bluebird');var exec=require(_0x9532('0x2'))[_0x9532('0x3')];exports['execute']=function(_0x5c521e){return new BPromise(function(_0x17f146,_0xbc21c8){exec(_0x5c521e,function(_0xbb352,_0x2fcf78,_0x4b3bc6){logger[_0x9532('0x4')](_0x9532('0x5'),_0x2fcf78);if(_0xbb352){logger['info'](_0x9532('0x5'),_0x9532('0x6'),util[_0x9532('0x7')](_0xbb352,{'showHidden':![],'depth':null}),_0x2fcf78,_0x4b3bc6);_0xbc21c8(_0xbb352);}_0x17f146(_0x2fcf78);});});}; \ 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 70bb016..12749e8 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 _0x6f92=['info','inspect','addVariables','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','originate','channel','xcally-motion-fax','uniqueid','util','../../../../config/logger','logger'];(function(_0xaa8195,_0x4aa742){var _0x22fe12=function(_0x1549d2){while(--_0x1549d2){_0xaa8195['push'](_0xaa8195['shift']());}};_0x22fe12(++_0x4aa742);}(_0x6f92,0xa8));var _0x26f9=function(_0x55993a,_0x9e2304){_0x55993a=_0x55993a-0x0;var _0x334287=_0x6f92[_0x55993a];return _0x334287;};'use strict';var util=require(_0x26f9('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x26f9('0x1'))('fax');exports['message']=function(_0x5241f2){return{'message':_0x5241f2};};exports[_0x26f9('0x2')]=function(_0x2936e5,_0x20dd67){logger[_0x26f9('0x3')](_0x2936e5,util[_0x26f9('0x4')](_0x20dd67,{'showHidden':![],'depth':null}));};exports[_0x26f9('0x5')]=function(_0x55579e,_0x74b6b0){var _0x400b11={'XMF-ECM':_0x74b6b0['ecm'],'XMF-HEADERINFO':_0x74b6b0[_0x26f9('0x6')],'XMF-MINRATE':_0x74b6b0[_0x26f9('0x7')],'XMF-MAXRATE':_0x74b6b0[_0x26f9('0x8')],'XMF-MODEM':util[_0x26f9('0x9')](_0x26f9('0xa'),_0x74b6b0[_0x26f9('0xb')]),'XMF-GATEWAY':_0x74b6b0['gateway'],'XMF-FAXDETECT':_0x74b6b0[_0x26f9('0xc')],'XMF-T38TIMEOUT':_0x74b6b0[_0x26f9('0xd')],'XMF-LOCALSTATIONID':_0x74b6b0[_0x26f9('0xe')],'XMF-PATH':_0x55579e['path']};return _0x400b11;};exports['variablesAction']=function(_0x3b9672,_0x4154ef){return{'actionid':_0x3b9672['uniqueid'],'action':_0x26f9('0xf'),'channel':_0x3b9672[_0x26f9('0x10')],'Exten':_0x26f9('0x11'),'Context':'from-sip','Priority':'1','callerid':util[_0x26f9('0x9')]('\x22%s\x22\x20<%s>',_0x3b9672['headerinfo']?_0x3b9672[_0x26f9('0x6')]:'',_0x3b9672[_0x26f9('0xe')]),'variable':_0x4154ef,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3b9672[_0x26f9('0x12')]};}; \ No newline at end of file +var _0xe62b=['util','moment','../../../../config/logger','fax','message','logger','inspect','addVariables','ecm','minrate','format','\x22%s\x22','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','headerinfo','localstationid'];(function(_0x4e76ed,_0x4585cc){var _0x206c09=function(_0x506dfa){while(--_0x506dfa){_0x4e76ed['push'](_0x4e76ed['shift']());}};_0x206c09(++_0x4585cc);}(_0xe62b,0x180));var _0xbe62=function(_0x475bf1,_0x5235b6){_0x475bf1=_0x475bf1-0x0;var _0x4095d1=_0xe62b[_0x475bf1];return _0x4095d1;};'use strict';var util=require(_0xbe62('0x0'));var _=require('lodash');var moment=require(_0xbe62('0x1'));var logger=require(_0xbe62('0x2'))(_0xbe62('0x3'));exports[_0xbe62('0x4')]=function(_0x4f12c5){return{'message':_0x4f12c5};};exports[_0xbe62('0x5')]=function(_0x201b6f,_0x370bc6){logger['info'](_0x201b6f,util[_0xbe62('0x6')](_0x370bc6,{'showHidden':![],'depth':null}));};exports[_0xbe62('0x7')]=function(_0x4afc7a,_0x10645c){var _0x5cb052={'XMF-ECM':_0x10645c[_0xbe62('0x8')],'XMF-HEADERINFO':_0x10645c['headerinfo'],'XMF-MINRATE':_0x10645c[_0xbe62('0x9')],'XMF-MAXRATE':_0x10645c['maxrate'],'XMF-MODEM':util[_0xbe62('0xa')](_0xbe62('0xb'),_0x10645c['modem']),'XMF-GATEWAY':_0x10645c['gateway'],'XMF-FAXDETECT':_0x10645c[_0xbe62('0xc')],'XMF-T38TIMEOUT':_0x10645c[_0xbe62('0xd')],'XMF-LOCALSTATIONID':_0x10645c['localstationid'],'XMF-PATH':_0x4afc7a[_0xbe62('0xe')]};return _0x5cb052;};exports[_0xbe62('0xf')]=function(_0x42d03c,_0x24d289){return{'actionid':_0x42d03c[_0xbe62('0x10')],'action':_0xbe62('0x11'),'channel':_0x42d03c[_0xbe62('0x12')],'Exten':_0xbe62('0x13'),'Context':_0xbe62('0x14'),'Priority':'1','callerid':util[_0xbe62('0xa')](_0xbe62('0x15'),_0x42d03c[_0xbe62('0x16')]?_0x42d03c[_0xbe62('0x16')]:'',_0x42d03c[_0xbe62('0x17')]),'variable':_0x24d289,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x42d03c['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 83caf55..88aea88 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 _0x937c=['initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/freshsales','get','hour','resolve','then','getAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initCampaigns','getVoiceExtensions','getFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports'];(function(_0x3d0a2e,_0x40c875){var _0x461fe1=function(_0x4a8a59){while(--_0x4a8a59){_0x3d0a2e['push'](_0x3d0a2e['shift']());}};_0x461fe1(++_0x40c875);}(_0x937c,0x114));var _0xc937=function(_0xdc2c8b,_0x2fe46c){_0xdc2c8b=_0xdc2c8b-0x0;var _0x51c24f=_0x937c[_0xdc2c8b];return _0x51c24f;};'use strict';var BPromise=require('bluebird');var util=require(_0xc937('0x0'));var moment=require(_0xc937('0x1'));var server=require(_0xc937('0x2'));var Realtime=require(_0xc937('0x3'));var Report=require(_0xc937('0x4'));var Acw=require(_0xc937('0x5'));var Trigger=require(_0xc937('0x6'));var Dialer=require('./dialer');var Preview=require(_0xc937('0x7'));var Fax=require(_0xc937('0x8'));var user=require(_0xc937('0x9'));var voiceQueue=require(_0xc937('0xa'));var voiceQueueReport=require(_0xc937('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0xc937('0xc'));var template=require(_0xc937('0xd'));var cmHopperHistory=require(_0xc937('0xe'));var campaign=require(_0xc937('0xf'));var voiceExtension=require(_0xc937('0x10'));var faxAccount=require(_0xc937('0x11'));var zendesk=require(_0xc937('0x12'));var salesforce=require(_0xc937('0x13'));var sugarcrm=require(_0xc937('0x14'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xc937('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xc937('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xc937('0x17')](_0xc937('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc937('0x17')](_0xc937('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xc937('0x19')]()[_0xc937('0x1a')](user[_0xc937('0x1b')]())['then'](realtime['initAgents']())[_0xc937('0x1a')](user[_0xc937('0x1c')]())[_0xc937('0x1a')](realtime[_0xc937('0x1d')]())[_0xc937('0x1a')](trunk['getTrunks']())[_0xc937('0x1a')](realtime[_0xc937('0x1e')]())[_0xc937('0x1a')](voiceQueue[_0xc937('0x1f')]())[_0xc937('0x1a')](realtime[_0xc937('0x20')]())[_0xc937('0x1a')](trigger[_0xc937('0x21')]())[_0xc937('0x1a')](realtime[_0xc937('0x22')]())['then'](template['getTemplates']())[_0xc937('0x1a')](realtime[_0xc937('0x23')]())[_0xc937('0x1a')](zendesk[_0xc937('0x24')]())[_0xc937('0x1a')](realtime[_0xc937('0x25')]())[_0xc937('0x1a')](salesforce[_0xc937('0x26')]())[_0xc937('0x1a')](realtime[_0xc937('0x27')]())[_0xc937('0x1a')](sugarcrm[_0xc937('0x28')]())[_0xc937('0x1a')](realtime[_0xc937('0x29')]())['then'](freshdesk[_0xc937('0x2a')]())[_0xc937('0x1a')](realtime['initFreshdeskAccounts']())[_0xc937('0x1a')](desk['getDeskAccounts']())[_0xc937('0x1a')](realtime[_0xc937('0x2b')]())['then'](zoho[_0xc937('0x2c')]())[_0xc937('0x1a')](realtime[_0xc937('0x2d')]())['then'](vtiger['getVtigerAccounts']())['then'](realtime['initVtigerAccounts']())[_0xc937('0x1a')](freshsales[_0xc937('0x2e')]())['then'](realtime[_0xc937('0x2f')]())[_0xc937('0x1a')](servicenow[_0xc937('0x30')]())[_0xc937('0x1a')](realtime[_0xc937('0x31')]())['then'](dynamics365['getDynamics365Accounts']())[_0xc937('0x1a')](realtime['initDynamics365Accounts']())[_0xc937('0x1a')](campaign['getCampaigns']())[_0xc937('0x1a')](realtime[_0xc937('0x32')]())[_0xc937('0x1a')](voiceExtension[_0xc937('0x33')]())[_0xc937('0x1a')](realtime['initVoiceExtensions']())['then'](faxAccount[_0xc937('0x34')]())[_0xc937('0x1a')](realtime['initFaxAccounts']())[_0xc937('0x1a')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xc937('0x1a')](voiceQueueReport['getVoiceQueueReports']())[_0xc937('0x1a')](realtime[_0xc937('0x35')]())[_0xc937('0x1a')](cmHopperHistory[_0xc937('0x36')]())[_0xc937('0x1a')](realtime[_0xc937('0x37')]())[_0xc937('0x1a')](cmHopperHistory[_0xc937('0x38')]())['then'](realtime[_0xc937('0x39')]())[_0xc937('0x1a')](voiceCallReport[_0xc937('0x3a')]())[_0xc937('0x1a')](realtime[_0xc937('0x3b')]())[_0xc937('0x3c')](function(_0x488427){logger[_0xc937('0x3d')](_0xc937('0x3e'),util[_0xc937('0x3f')](_0x488427,{'showHidden':![],'depth':null}));});}function main(){return server[_0xc937('0x40')](realtime,preview,fax)[_0xc937('0x1a')](function(_0x3daee6){return initRealtime();})[_0xc937('0x1a')](function(){return initParams();})[_0xc937('0x1a')](function(){report[_0xc937('0x41')]();setInterval(initRealtime,0x1388);})[_0xc937('0x3c')](function(_0x2bac54){logger[_0xc937('0x3d')](_0xc937('0x42'),util['inspect'](_0x2bac54,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xf163=['./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','getAgents','initAgents','getTelephones','then','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./fax'];(function(_0x4f08dd,_0x3784ec){var _0x3017ee=function(_0x7d95be){while(--_0x7d95be){_0x4f08dd['push'](_0x4f08dd['shift']());}};_0x3017ee(++_0x3784ec);}(_0xf163,0x163));var _0x3f16=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0xf163[_0x1c6089];return _0x4d97c1;};'use strict';var BPromise=require(_0x3f16('0x0'));var util=require(_0x3f16('0x1'));var moment=require(_0x3f16('0x2'));var server=require(_0x3f16('0x3'));var Realtime=require(_0x3f16('0x4'));var Report=require(_0x3f16('0x5'));var Acw=require(_0x3f16('0x6'));var Trigger=require(_0x3f16('0x7'));var Dialer=require('./dialer');var Preview=require(_0x3f16('0x8'));var Fax=require(_0x3f16('0x9'));var user=require(_0x3f16('0xa'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x3f16('0xb'));var voiceCallReport=require(_0x3f16('0xc'));var trunk=require(_0x3f16('0xd'));var trigger=require(_0x3f16('0xe'));var template=require('./rpc/template');var cmHopperHistory=require(_0x3f16('0xf'));var campaign=require(_0x3f16('0x10'));var voiceExtension=require(_0x3f16('0x11'));var faxAccount=require(_0x3f16('0x12'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x3f16('0x13'));var sugarcrm=require(_0x3f16('0x14'));var freshdesk=require(_0x3f16('0x15'));var desk=require(_0x3f16('0x16'));var zoho=require(_0x3f16('0x17'));var vtiger=require(_0x3f16('0x18'));var freshsales=require(_0x3f16('0x19'));var servicenow=require(_0x3f16('0x1a'));var dynamics365=require(_0x3f16('0x1b'));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(_0x3f16('0x1c'))(_0x3f16('0x1d'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3f16('0x1e')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3f16('0x1e')](_0x3f16('0x1f'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user[_0x3f16('0x20')]())['then'](realtime[_0x3f16('0x21')]())['then'](user[_0x3f16('0x22')]())[_0x3f16('0x23')](realtime[_0x3f16('0x24')]())[_0x3f16('0x23')](trunk[_0x3f16('0x25')]())[_0x3f16('0x23')](realtime[_0x3f16('0x26')]())['then'](voiceQueue[_0x3f16('0x27')]())['then'](realtime['initVoiceQueues']())[_0x3f16('0x23')](trigger[_0x3f16('0x28')]())[_0x3f16('0x23')](realtime['initTriggers']())[_0x3f16('0x23')](template[_0x3f16('0x29')]())[_0x3f16('0x23')](realtime[_0x3f16('0x2a')]())[_0x3f16('0x23')](zendesk[_0x3f16('0x2b')]())[_0x3f16('0x23')](realtime[_0x3f16('0x2c')]())[_0x3f16('0x23')](salesforce[_0x3f16('0x2d')]())['then'](realtime['initSalesforceAccounts']())[_0x3f16('0x23')](sugarcrm[_0x3f16('0x2e')]())[_0x3f16('0x23')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x3f16('0x2f')]())['then'](realtime[_0x3f16('0x30')]())[_0x3f16('0x23')](desk[_0x3f16('0x31')]())[_0x3f16('0x23')](realtime['initDeskAccounts']())[_0x3f16('0x23')](zoho[_0x3f16('0x32')]())['then'](realtime[_0x3f16('0x33')]())[_0x3f16('0x23')](vtiger[_0x3f16('0x34')]())[_0x3f16('0x23')](realtime['initVtigerAccounts']())[_0x3f16('0x23')](freshsales['getFreshsalesAccounts']())[_0x3f16('0x23')](realtime[_0x3f16('0x35')]())[_0x3f16('0x23')](servicenow[_0x3f16('0x36')]())[_0x3f16('0x23')](realtime[_0x3f16('0x37')]())[_0x3f16('0x23')](dynamics365[_0x3f16('0x38')]())[_0x3f16('0x23')](realtime[_0x3f16('0x39')]())[_0x3f16('0x23')](campaign[_0x3f16('0x3a')]())['then'](realtime[_0x3f16('0x3b')]())[_0x3f16('0x23')](voiceExtension[_0x3f16('0x3c')]())['then'](realtime[_0x3f16('0x3d')]())[_0x3f16('0x23')](faxAccount[_0x3f16('0x3e')]())[_0x3f16('0x23')](realtime[_0x3f16('0x3f')]())[_0x3f16('0x23')](function(){return realtime;});}function initParams(){return BPromise[_0x3f16('0x40')]()[_0x3f16('0x23')](voiceQueueReport[_0x3f16('0x41')]())[_0x3f16('0x23')](realtime['initVoiceQueueReports']())[_0x3f16('0x23')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x3f16('0x23')](realtime['initVoiceQueueHopperHistory']())[_0x3f16('0x23')](cmHopperHistory['getCampaignHopperHistory']())[_0x3f16('0x23')](realtime[_0x3f16('0x42')]())['then'](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x3f16('0x43')]())[_0x3f16('0x44')](function(_0x16d677){logger[_0x3f16('0x45')](_0x3f16('0x46'),util[_0x3f16('0x47')](_0x16d677,{'showHidden':![],'depth':null}));});}function main(){return server[_0x3f16('0x48')](realtime,preview,fax)[_0x3f16('0x23')](function(_0xbf9128){return initRealtime();})['then'](function(){return initParams();})[_0x3f16('0x23')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x3f16('0x44')](function(_0x585fe8){logger[_0x3f16('0x45')]('[index.js][main]',util[_0x3f16('0x47')](_0x585fe8,{'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 0a46586..8cd523a 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 _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xedd9,0xfc));var _0x9edd=function(_0x2d3476,_0x4c3d88){_0x2d3476=_0x2d3476-0x0;var _0x1a6fcb=_0xedd9[_0x2d3476];return _0x1a6fcb;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file +var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x8b157e,_0x3d9e27){var _0x2b10b2=function(_0xe9799c){while(--_0xe9799c){_0x8b157e['push'](_0x8b157e['shift']());}};_0x2b10b2(++_0x3d9e27);}(_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 moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 00c6e72..1ef7b72 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 _0x76b2=['dialAgentRejectMaxRetry','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x40d206,_0x2404ac){var _0x5c8e7a=function(_0x473ae6){while(--_0x473ae6){_0x40d206['push'](_0x40d206['shift']());}};_0x5c8e7a(++_0x2404ac);}(_0x76b2,0x1ce));var _0x276b=function(_0x556ac9,_0x37c7a1){_0x556ac9=_0x556ac9-0x0;var _0x2eb433=_0x76b2[_0x556ac9];return _0x2eb433;};'use strict';function Campaign(_0x47b26b){this['id']=_0x47b26b['id']||0x0;this[_0x276b('0x0')]=_0x47b26b[_0x276b('0x0')]||'';this[_0x276b('0x1')]=_0x47b26b[_0x276b('0x1')]||_0x276b('0x2');this[_0x276b('0x3')]=0x0;this[_0x276b('0x4')]=0x0;this[_0x276b('0x5')]=0x0;this[_0x276b('0x6')]=0x0;this['message']='';this[_0x276b('0x7')]=!![];this['active']=_0x47b26b[_0x276b('0x8')];this['limitCalls']=_0x47b26b[_0x276b('0x9')];this[_0x276b('0xa')]=_0x47b26b[_0x276b('0xa')]||null;this[_0x276b('0xb')]=_0x47b26b['dialGlobalInterval']?_0x47b26b['dialGlobalInterval']:null;this[_0x276b('0xc')]=_0x47b26b[_0x276b('0xc')];this[_0x276b('0xd')]=_0x47b26b['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x47b26b['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x47b26b[_0x276b('0xe')];this['dialCongestionRetryFrequency']=_0x47b26b['dialCongestionRetryFrequency'];this[_0x276b('0xf')]=_0x47b26b[_0x276b('0xf')];this[_0x276b('0x10')]=_0x47b26b[_0x276b('0x10')];this[_0x276b('0x11')]=_0x47b26b[_0x276b('0x11')];this['dialNoAnswerRetryFrequency']=_0x47b26b[_0x276b('0x12')];this[_0x276b('0x13')]=_0x47b26b[_0x276b('0x13')];this[_0x276b('0x14')]=_0x47b26b['dialNoSuchNumberMaxRetry']||0x3;this[_0x276b('0x15')]=_0x47b26b['dialNoSuchNumberRetryFrequency']||0x96;this[_0x276b('0x16')]=_0x47b26b[_0x276b('0x16')]||0x3;this[_0x276b('0x17')]=_0x47b26b[_0x276b('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x47b26b[_0x276b('0x18')]||0x3;this[_0x276b('0x19')]=_0x47b26b[_0x276b('0x19')]||0x96;this['dialMachineMaxRetry']=_0x47b26b[_0x276b('0x1a')]||0x3;this[_0x276b('0x1b')]=_0x47b26b[_0x276b('0x1b')]||0x96;this[_0x276b('0x1c')]=_0x47b26b[_0x276b('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x47b26b['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x47b26b['dialOrderByScheduledAt']||_0x276b('0x1d');this['dialPrefix']=_0x47b26b[_0x276b('0x1e')]||undefined;this[_0x276b('0x1f')]=_0x47b26b[_0x276b('0x1f')]||undefined;this[_0x276b('0x20')]=_0x47b26b[_0x276b('0x20')]||undefined;this[_0x276b('0x21')]=_0x47b26b[_0x276b('0x21')]?_0x47b26b[_0x276b('0x21')]:undefined;this[_0x276b('0x22')]=_0x47b26b[_0x276b('0x22')]?_0x47b26b['Trunk']:undefined;this[_0x276b('0x23')]=_0x47b26b[_0x276b('0x23')]?_0x47b26b[_0x276b('0x23')]:undefined;this['SquareProject']=_0x47b26b[_0x276b('0x24')]?_0x47b26b[_0x276b('0x24')]:undefined;this[_0x276b('0x25')]=_0x47b26b['SquareProject']?_0x47b26b[_0x276b('0x24')][_0x276b('0x0')]:undefined;this['dialAMDActive']=_0x47b26b[_0x276b('0x26')]||![];this[_0x276b('0x27')]=_0x47b26b[_0x276b('0x27')];this[_0x276b('0x28')]=_0x47b26b[_0x276b('0x28')];this[_0x276b('0x29')]=_0x47b26b[_0x276b('0x29')];this[_0x276b('0x2a')]=_0x47b26b[_0x276b('0x2a')];this[_0x276b('0x2b')]=_0x47b26b[_0x276b('0x2b')];this[_0x276b('0x2c')]=_0x47b26b[_0x276b('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x47b26b[_0x276b('0x2d')];this[_0x276b('0x2e')]=_0x47b26b[_0x276b('0x2e')];this[_0x276b('0x2f')]=_0x47b26b[_0x276b('0x2f')];}module[_0x276b('0x30')]=Campaign; \ No newline at end of file +var _0x3ab5=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','exports','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x2a9890,_0x5afe52){var _0x502693=function(_0x10ae31){while(--_0x10ae31){_0x2a9890['push'](_0x2a9890['shift']());}};_0x502693(++_0x5afe52);}(_0x3ab5,0xec));var _0x53ab=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3ab5[_0xa464c9];return _0x3d73c4;};'use strict';function Campaign(_0x4edc16){this['id']=_0x4edc16['id']||0x0;this['name']=_0x4edc16[_0x53ab('0x0')]||'';this[_0x53ab('0x1')]=_0x4edc16[_0x53ab('0x1')]||'campaign';this[_0x53ab('0x2')]=0x0;this[_0x53ab('0x3')]=0x0;this[_0x53ab('0x4')]=0x0;this[_0x53ab('0x5')]=0x0;this[_0x53ab('0x6')]='';this[_0x53ab('0x7')]=!![];this[_0x53ab('0x8')]=_0x4edc16['active'];this['limitCalls']=_0x4edc16['limitCalls'];this[_0x53ab('0x9')]=_0x4edc16[_0x53ab('0x9')]||null;this[_0x53ab('0xa')]=_0x4edc16[_0x53ab('0xa')]?_0x4edc16[_0x53ab('0xa')]:null;this[_0x53ab('0xb')]=_0x4edc16['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x4edc16[_0x53ab('0xc')];this[_0x53ab('0xd')]=_0x4edc16[_0x53ab('0xd')]||0x1e;this[_0x53ab('0xe')]=_0x4edc16[_0x53ab('0xe')];this[_0x53ab('0xf')]=_0x4edc16[_0x53ab('0xf')];this[_0x53ab('0x10')]=_0x4edc16[_0x53ab('0x10')];this[_0x53ab('0x11')]=_0x4edc16[_0x53ab('0x11')];this[_0x53ab('0x12')]=_0x4edc16[_0x53ab('0x12')];this[_0x53ab('0x13')]=_0x4edc16[_0x53ab('0x13')];this[_0x53ab('0x14')]=_0x4edc16[_0x53ab('0x14')];this[_0x53ab('0x15')]=_0x4edc16[_0x53ab('0x15')]||0x3;this[_0x53ab('0x16')]=_0x4edc16[_0x53ab('0x16')]||0x96;this[_0x53ab('0x17')]=_0x4edc16[_0x53ab('0x17')]||0x3;this[_0x53ab('0x18')]=_0x4edc16[_0x53ab('0x18')]||0x96;this[_0x53ab('0x19')]=_0x4edc16[_0x53ab('0x19')]||0x3;this[_0x53ab('0x1a')]=_0x4edc16['dialAbandonedRetryFrequency']||0x96;this[_0x53ab('0x1b')]=_0x4edc16[_0x53ab('0x1b')]||0x3;this[_0x53ab('0x1c')]=_0x4edc16[_0x53ab('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x4edc16[_0x53ab('0x1d')]||0x3;this[_0x53ab('0x1e')]=_0x4edc16[_0x53ab('0x1e')]||0x96;this[_0x53ab('0x1f')]=_0x4edc16[_0x53ab('0x1f')]||_0x53ab('0x20');this[_0x53ab('0x21')]=_0x4edc16[_0x53ab('0x21')]||undefined;this[_0x53ab('0x22')]=_0x4edc16['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x53ab('0x23')]=_0x4edc16['dialCutDigit']||undefined;this['TrunkBackup']=_0x4edc16['TrunkBackup']?_0x4edc16[_0x53ab('0x24')]:undefined;this[_0x53ab('0x25')]=_0x4edc16[_0x53ab('0x25')]?_0x4edc16[_0x53ab('0x25')]:undefined;this[_0x53ab('0x26')]=_0x4edc16[_0x53ab('0x26')]?_0x4edc16[_0x53ab('0x26')]:undefined;this['SquareProject']=_0x4edc16[_0x53ab('0x27')]?_0x4edc16[_0x53ab('0x27')]:undefined;this[_0x53ab('0x28')]=_0x4edc16['SquareProject']?_0x4edc16[_0x53ab('0x27')][_0x53ab('0x0')]:undefined;this[_0x53ab('0x29')]=_0x4edc16[_0x53ab('0x29')]||![];this['dialAMDInitialSilence']=_0x4edc16[_0x53ab('0x2a')];this[_0x53ab('0x2b')]=_0x4edc16[_0x53ab('0x2b')];this[_0x53ab('0x2c')]=_0x4edc16[_0x53ab('0x2c')];this['dialAMDTotalAnalysisTime']=_0x4edc16['dialAMDTotalAnalysisTime'];this[_0x53ab('0x2d')]=_0x4edc16[_0x53ab('0x2d')];this[_0x53ab('0x2e')]=_0x4edc16[_0x53ab('0x2e')];this[_0x53ab('0x2f')]=_0x4edc16['dialAMDMaximumNumberOfWords'];this[_0x53ab('0x30')]=_0x4edc16[_0x53ab('0x30')];this['dialAMDMaximumWordLength']=_0x4edc16['dialAMDMaximumWordLength'];}module[_0x53ab('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 5d47c3d..d016f4e 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 _0xd786=['holdtime','type','tag','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answertime','endtime','abandoned','lastapplication','lastdata','duration'];(function(_0x30b0a5,_0x1f5574){var _0x3a302b=function(_0x1213a5){while(--_0x1213a5){_0x30b0a5['push'](_0x30b0a5['shift']());}};_0x3a302b(++_0x1f5574);}(_0xd786,0x1dc));var _0x6d78=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xd786[_0x31e29a];return _0x32d892;};'use strict';function Channel(){this[_0x6d78('0x0')]=null;this[_0x6d78('0x1')]='';this[_0x6d78('0x2')]='';this[_0x6d78('0x3')]=0x0;this['calleridname']='';this[_0x6d78('0x4')]=undefined;this[_0x6d78('0x5')]=undefined;this[_0x6d78('0x6')]=0x0;this[_0x6d78('0x7')]='';this[_0x6d78('0x8')]=0x0;this[_0x6d78('0x9')]=0x0;this[_0x6d78('0xa')]=0x0;this['answered']=![];this[_0x6d78('0xb')]=null;this[_0x6d78('0xc')]=null;this['unmanaged']=![];this[_0x6d78('0xd')]=![];this[_0x6d78('0xe')]='';this[_0x6d78('0xf')]='';this[_0x6d78('0x10')]=0x0;this['billableseconds']=0x0;this[_0x6d78('0x11')]=0x0;this[_0x6d78('0x12')]=null;this[_0x6d78('0x13')]=null;this['disposition']=null;this[_0x6d78('0x14')]=![];this[_0x6d78('0x15')]=null;this[_0x6d78('0x16')]=null;this[_0x6d78('0x17')]=[];this[_0x6d78('0x18')]=undefined;this[_0x6d78('0x19')]=undefined;this[_0x6d78('0x1a')]=undefined;this[_0x6d78('0x1b')]=0x0;}module[_0x6d78('0x1c')]=Channel; \ No newline at end of file +var _0xe8e8=['calleridname','connectedlinenum','context','linkedid','exten','answered','answertime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel'];(function(_0x4dc8fa,_0x408c90){var _0x11ee03=function(_0x128826){while(--_0x128826){_0x4dc8fa['push'](_0x4dc8fa['shift']());}};_0x11ee03(++_0x408c90);}(_0xe8e8,0xc6));var _0x8e8e=function(_0x587fa8,_0x54392e){_0x587fa8=_0x587fa8-0x0;var _0x1f3843=_0xe8e8[_0x587fa8];return _0x1f3843;};'use strict';function Channel(){this[_0x8e8e('0x0')]=null;this[_0x8e8e('0x1')]='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0x8e8e('0x2')]='';this[_0x8e8e('0x3')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x8e8e('0x4')]='';this['uniqueid']=0x0;this[_0x8e8e('0x5')]=0x0;this[_0x8e8e('0x6')]=0x0;this[_0x8e8e('0x7')]=![];this[_0x8e8e('0x8')]=null;this['endtime']=null;this[_0x8e8e('0x9')]=![];this['abandoned']=![];this[_0x8e8e('0xa')]='';this[_0x8e8e('0xb')]='';this[_0x8e8e('0xc')]=0x0;this[_0x8e8e('0xd')]=0x0;this[_0x8e8e('0xe')]=0x0;this[_0x8e8e('0xf')]=null;this[_0x8e8e('0x10')]=null;this['disposition']=null;this[_0x8e8e('0x11')]=![];this[_0x8e8e('0x12')]=null;this[_0x8e8e('0x13')]=null;this[_0x8e8e('0x14')]=[];this['transfercalleridnum']=undefined;this[_0x8e8e('0x15')]=undefined;this[_0x8e8e('0x16')]=undefined;this[_0x8e8e('0x17')]=0x0;}module[_0x8e8e('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 1f4da71..b6baed5 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 _0x8f69=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x36a1ee,_0x3c7eb5){var _0x1a07b4=function(_0x559893){while(--_0x559893){_0x36a1ee['push'](_0x36a1ee['shift']());}};_0x1a07b4(++_0x3c7eb5);}(_0x8f69,0x102));var _0x98f6=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0x8f69[_0x1347f8];return _0x218368;};'use strict';function DeskAccount(_0x2bdc34){this['id']=_0x2bdc34['id']||0x0;this[_0x98f6('0x0')]=_0x2bdc34[_0x98f6('0x0')]||'';this[_0x98f6('0x1')]=_0x2bdc34[_0x98f6('0x1')]||'';this['remoteUri']=_0x2bdc34[_0x98f6('0x2')]||'';this['authType']=_0x2bdc34[_0x98f6('0x3')]||'';this[_0x98f6('0x4')]=_0x2bdc34[_0x98f6('0x4')]||'';this[_0x98f6('0x5')]=_0x2bdc34[_0x98f6('0x5')]||'';this[_0x98f6('0x6')]=_0x2bdc34[_0x98f6('0x6')]||'';this['token']=_0x2bdc34[_0x98f6('0x7')]||'';this[_0x98f6('0x8')]=_0x2bdc34[_0x98f6('0x8')]||'';this[_0x98f6('0x9')]=_0x2bdc34[_0x98f6('0x9')]||'';this[_0x98f6('0xa')]=_0x2bdc34[_0x98f6('0xa')]||'';this[_0x98f6('0xb')]=_0x2bdc34[_0x98f6('0xb')]||{};}module[_0x98f6('0xc')]=DeskAccount; \ No newline at end of file +var _0x25ff=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x2d398b,_0x5e98f8){var _0x5d8b9d=function(_0x121a78){while(--_0x121a78){_0x2d398b['push'](_0x2d398b['shift']());}};_0x5d8b9d(++_0x5e98f8);}(_0x25ff,0x1c2));var _0xf25f=function(_0x43b1c3,_0x264040){_0x43b1c3=_0x43b1c3-0x0;var _0x18d06b=_0x25ff[_0x43b1c3];return _0x18d06b;};'use strict';function DeskAccount(_0x3f66c7){this['id']=_0x3f66c7['id']||0x0;this[_0xf25f('0x0')]=_0x3f66c7[_0xf25f('0x0')]||'';this['username']=_0x3f66c7[_0xf25f('0x1')]||'';this['remoteUri']=_0x3f66c7[_0xf25f('0x2')]||'';this[_0xf25f('0x3')]=_0x3f66c7[_0xf25f('0x3')]||'';this[_0xf25f('0x4')]=_0x3f66c7[_0xf25f('0x4')]||'';this[_0xf25f('0x5')]=_0x3f66c7[_0xf25f('0x5')]||'';this[_0xf25f('0x6')]=_0x3f66c7['consumerSecret']||'';this[_0xf25f('0x7')]=_0x3f66c7['token']||'';this[_0xf25f('0x8')]=_0x3f66c7[_0xf25f('0x8')]||'';this[_0xf25f('0x9')]=_0x3f66c7['type']||'';this[_0xf25f('0xa')]=_0x3f66c7['serverUrl']||'';this['Configurations']=_0x3f66c7[_0xf25f('0xb')]||{};}module[_0xf25f('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 0609026..712fe0b 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 _0x657a=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations'];(function(_0x1c1c64,_0x54e70f){var _0x5cf5f5=function(_0x446893){while(--_0x446893){_0x1c1c64['push'](_0x1c1c64['shift']());}};_0x5cf5f5(++_0x54e70f);}(_0x657a,0x1ea));var _0xa657=function(_0xc28c76,_0x1d2e26){_0xc28c76=_0xc28c76-0x0;var _0x2f0b2a=_0x657a[_0xc28c76];return _0x2f0b2a;};'use strict';function Dynamics365Account(_0x1a45a6){this['id']=_0x1a45a6['id']||0x0;this[_0xa657('0x0')]=_0x1a45a6[_0xa657('0x0')]||'';this[_0xa657('0x1')]=_0x1a45a6[_0xa657('0x1')]||'';this[_0xa657('0x2')]=_0x1a45a6[_0xa657('0x2')]||'';this[_0xa657('0x3')]=_0x1a45a6[_0xa657('0x3')]||'';this[_0xa657('0x4')]=_0x1a45a6['tenantId']||'';this['clientId']=_0x1a45a6[_0xa657('0x5')]||'';this[_0xa657('0x6')]=_0x1a45a6[_0xa657('0x6')]||{};this[_0xa657('0x7')]=_0x1a45a6[_0xa657('0x7')]||'';this[_0xa657('0x8')]=_0x1a45a6[_0xa657('0x8')]||![];this[_0xa657('0x9')]=_0x1a45a6[_0xa657('0x9')]||{};this['CloudProvider']=_0x1a45a6['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x9b6a=['serverUrl','modernAuthentication','CloudProvider','name','username','password','tenantId','clientId','clientSecret'];(function(_0x226694,_0x5f0141){var _0x58fffc=function(_0x59f450){while(--_0x59f450){_0x226694['push'](_0x226694['shift']());}};_0x58fffc(++_0x5f0141);}(_0x9b6a,0x1b3));var _0xa9b6=function(_0x15599c,_0x1ebd6a){_0x15599c=_0x15599c-0x0;var _0x5f1b30=_0x9b6a[_0x15599c];return _0x5f1b30;};'use strict';function Dynamics365Account(_0x24ac0d){this['id']=_0x24ac0d['id']||0x0;this['name']=_0x24ac0d[_0xa9b6('0x0')]||'';this[_0xa9b6('0x1')]=_0x24ac0d['username']||'';this['password']=_0x24ac0d[_0xa9b6('0x2')]||'';this['remoteUri']=_0x24ac0d['remoteUri']||'';this[_0xa9b6('0x3')]=_0x24ac0d[_0xa9b6('0x3')]||'';this[_0xa9b6('0x4')]=_0x24ac0d['clientId']||'';this[_0xa9b6('0x5')]=_0x24ac0d[_0xa9b6('0x5')]||{};this[_0xa9b6('0x6')]=_0x24ac0d[_0xa9b6('0x6')]||'';this[_0xa9b6('0x7')]=_0x24ac0d[_0xa9b6('0x7')]||![];this['Configurations']=_0x24ac0d['Configurations']||{};this[_0xa9b6('0x8')]=_0x24ac0d[_0xa9b6('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index f1ad473..383bd26 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 _0x4eb6=['headerinfo','localstationid','minrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x4eb6,0x1bf));var _0x64eb=function(_0x4d9eb5,_0x29c4be){_0x4d9eb5=_0x4d9eb5-0x0;var _0x3622e8=_0x4eb6[_0x4d9eb5];return _0x3622e8;};'use strict';function FaxAccount(_0x57c76e){this['id']=_0x57c76e['id']||0x0;this[_0x64eb('0x0')]=_0x57c76e[_0x64eb('0x0')]||'';this[_0x64eb('0x1')]=_0x57c76e[_0x64eb('0x1')];this[_0x64eb('0x2')]=_0x57c76e[_0x64eb('0x2')];this['headerinfo']=_0x57c76e[_0x64eb('0x3')];this[_0x64eb('0x4')]=_0x57c76e['localstationid'];this['minrate']=_0x57c76e[_0x64eb('0x5')]||0x960;this['maxrate']=_0x57c76e['maxrate']||0x3840;this[_0x64eb('0x6')]=_0x57c76e[_0x64eb('0x6')]||'v17,v27,v29';this['gateway']=_0x57c76e[_0x64eb('0x7')]||'no';this[_0x64eb('0x8')]=_0x57c76e[_0x64eb('0x8')]||'no';this[_0x64eb('0x9')]=_0x57c76e[_0x64eb('0x9')]||0x1388;this[_0x64eb('0xa')]=_0x57c76e['tech']||'SIP';this[_0x64eb('0xb')]=_0x57c76e[_0x64eb('0xb')]?_0x57c76e[_0x64eb('0xb')]:undefined;this[_0x64eb('0xc')]=_0x57c76e[_0x64eb('0xc')];this[_0x64eb('0xd')]=_0x57c76e[_0x64eb('0xd')];}module[_0x64eb('0xe')]=FaxAccount; \ No newline at end of file +var _0x5c8f=['ListId','key','exports','name','headerinfo','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x3e00f8,_0x2cd02b){var _0xb9dc49=function(_0xc7dfc2){while(--_0xc7dfc2){_0x3e00f8['push'](_0x3e00f8['shift']());}};_0xb9dc49(++_0x2cd02b);}(_0x5c8f,0xab));var _0xf5c8=function(_0x45a6e9,_0x4acb29){_0x45a6e9=_0x45a6e9-0x0;var _0x100ad8=_0x5c8f[_0x45a6e9];return _0x100ad8;};'use strict';function FaxAccount(_0x435781){this['id']=_0x435781['id']||0x0;this['name']=_0x435781[_0xf5c8('0x0')]||'';this['description']=_0x435781['description'];this['ecm']=_0x435781['ecm'];this['headerinfo']=_0x435781[_0xf5c8('0x1')];this['localstationid']=_0x435781['localstationid'];this[_0xf5c8('0x2')]=_0x435781['minrate']||0x960;this['maxrate']=_0x435781[_0xf5c8('0x3')]||0x3840;this[_0xf5c8('0x4')]=_0x435781[_0xf5c8('0x4')]||'v17,v27,v29';this[_0xf5c8('0x5')]=_0x435781[_0xf5c8('0x5')]||'no';this[_0xf5c8('0x6')]=_0x435781['faxdetect']||'no';this[_0xf5c8('0x7')]=_0x435781['t38timeout']||0x1388;this['tech']=_0x435781[_0xf5c8('0x8')]||_0xf5c8('0x9');this['Trunk']=_0x435781[_0xf5c8('0xa')]?_0x435781[_0xf5c8('0xa')]:undefined;this['ListId']=_0x435781[_0xf5c8('0xb')];this['key']=_0x435781[_0xf5c8('0xc')];}module[_0xf5c8('0xd')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 9d01fa8..bb0e970 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 _0x9421=['Configurations','name','username','apiKey','remoteUri','serverUrl'];(function(_0x5cbfdc,_0x415c90){var _0x3464bb=function(_0x42297d){while(--_0x42297d){_0x5cbfdc['push'](_0x5cbfdc['shift']());}};_0x3464bb(++_0x415c90);}(_0x9421,0x121));var _0x1942=function(_0x5dde26,_0x43a96b){_0x5dde26=_0x5dde26-0x0;var _0x4a5016=_0x9421[_0x5dde26];return _0x4a5016;};'use strict';function FreshdeskAccount(_0x13961e){this['id']=_0x13961e['id']||0x0;this[_0x1942('0x0')]=_0x13961e[_0x1942('0x0')]||'';this[_0x1942('0x1')]=_0x13961e[_0x1942('0x1')]||'';this[_0x1942('0x2')]=_0x13961e['token']||'';this[_0x1942('0x3')]=_0x13961e[_0x1942('0x3')]||'';this[_0x1942('0x4')]=_0x13961e[_0x1942('0x4')]||'';this['Configurations']=_0x13961e[_0x1942('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x99a4=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x152cab,_0x30291c){var _0x53f755=function(_0x5eb137){while(--_0x5eb137){_0x152cab['push'](_0x152cab['shift']());}};_0x53f755(++_0x30291c);}(_0x99a4,0x160));var _0x499a=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x99a4[_0x3e112d];return _0x531c31;};'use strict';function FreshdeskAccount(_0x1db3f2){this['id']=_0x1db3f2['id']||0x0;this[_0x499a('0x0')]=_0x1db3f2[_0x499a('0x0')]||'';this['username']=_0x1db3f2[_0x499a('0x1')]||'';this[_0x499a('0x2')]=_0x1db3f2[_0x499a('0x3')]||'';this[_0x499a('0x4')]=_0x1db3f2[_0x499a('0x4')]||'';this['serverUrl']=_0x1db3f2[_0x499a('0x5')]||'';this['Configurations']=_0x1db3f2[_0x499a('0x6')]||{};}module[_0x499a('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index bbf20ed..b0ec5dc 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 _0x1f75=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x1be5a3,_0x1f80f2){var _0x53b728=function(_0x2fc869){while(--_0x2fc869){_0x1be5a3['push'](_0x1be5a3['shift']());}};_0x53b728(++_0x1f80f2);}(_0x1f75,0x12c));var _0x51f7=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x1f75[_0x40bffc];return _0x3007e9;};'use strict';function FreshsalesAccount(_0x212fbd){this['id']=_0x212fbd['id']||0x0;this[_0x51f7('0x0')]=_0x212fbd[_0x51f7('0x0')]||'';this['username']=_0x212fbd[_0x51f7('0x1')]||'';this[_0x51f7('0x2')]=_0x212fbd[_0x51f7('0x3')]||'';this[_0x51f7('0x4')]=_0x212fbd[_0x51f7('0x4')]||'';this[_0x51f7('0x5')]=_0x212fbd[_0x51f7('0x5')]||'';this[_0x51f7('0x6')]=_0x212fbd[_0x51f7('0x6')]||{};}module[_0x51f7('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x2e8a=['exports','name','username','apiKey','remoteUri','Configurations'];(function(_0x17ccf6,_0x47fcdd){var _0x37a893=function(_0x254d52){while(--_0x254d52){_0x17ccf6['push'](_0x17ccf6['shift']());}};_0x37a893(++_0x47fcdd);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x50a1f6,_0x238fd8){_0x50a1f6=_0x50a1f6-0x0;var _0x84f8d4=_0x2e8a[_0x50a1f6];return _0x84f8d4;};'use strict';function FreshsalesAccount(_0x34856e){this['id']=_0x34856e['id']||0x0;this[_0xa2e8('0x0')]=_0x34856e[_0xa2e8('0x0')]||'';this['username']=_0x34856e[_0xa2e8('0x1')]||'';this[_0xa2e8('0x2')]=_0x34856e['token']||'';this[_0xa2e8('0x3')]=_0x34856e['remoteUri']||'';this['serverUrl']=_0x34856e['serverUrl']||'';this['Configurations']=_0x34856e[_0xa2e8('0x4')]||{};}module[_0xa2e8('0x5')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 36d7e5e..770e74e 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 _0x74d9=['motionChannel','voice','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo'];(function(_0x49830c,_0x5ef2a3){var _0x55097e=function(_0x1d641d){while(--_0x1d641d){_0x49830c['push'](_0x49830c['shift']());}};_0x55097e(++_0x5ef2a3);}(_0x74d9,0x69));var _0x974d=function(_0x412767,_0x2be49e){_0x412767=_0x412767-0x0;var _0x428500=_0x74d9[_0x412767];return _0x428500;};'use strict';function QueueReport(){this[_0x974d('0x0')]=_0x974d('0x1');this['uniqueid']='';this[_0x974d('0x2')]='';this[_0x974d('0x3')]='';this['queue']='';this[_0x974d('0x4')]=null;this[_0x974d('0x5')]=null;this['position']=0x1;this[_0x974d('0x6')]=0x1;this[_0x974d('0x7')]=![];this[_0x974d('0x8')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x974d('0x9')]=![];this[_0x974d('0xa')]=null;this['originalposition']=0x1;this['channel']='';this[_0x974d('0xb')]='';this[_0x974d('0xc')]='';this[_0x974d('0xd')]='';this[_0x974d('0xe')]='';this[_0x974d('0xf')]='';this[_0x974d('0x10')]='';this[_0x974d('0x11')]=0x0;this[_0x974d('0x12')]=![];this[_0x974d('0x13')]='';this[_0x974d('0x14')]=_0x974d('0x15');this[_0x974d('0x16')]=0x0;this[_0x974d('0x17')]={};}module[_0x974d('0x18')]=QueueReport; \ No newline at end of file +var _0x35ec=['queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count'];(function(_0x264eeb,_0xc05998){var _0xa45c83=function(_0x2a82d9){while(--_0x2a82d9){_0x264eeb['push'](_0x264eeb['shift']());}};_0xa45c83(++_0xc05998);}(_0x35ec,0x6a));var _0xc35e=function(_0x101dfc,_0x5af0d6){_0x101dfc=_0x101dfc-0x0;var _0xc840e=_0x35ec[_0x101dfc];return _0xc840e;};'use strict';function QueueReport(){this[_0xc35e('0x0')]=_0xc35e('0x1');this[_0xc35e('0x2')]='';this[_0xc35e('0x3')]='';this[_0xc35e('0x4')]='';this[_0xc35e('0x5')]='';this[_0xc35e('0x6')]=null;this[_0xc35e('0x7')]=null;this[_0xc35e('0x8')]=0x1;this[_0xc35e('0x9')]=0x1;this['queuecallerabandon']=![];this[_0xc35e('0xa')]=null;this[_0xc35e('0xb')]=![];this[_0xc35e('0xc')]=null;this[_0xc35e('0xd')]=![];this[_0xc35e('0xe')]=null;this['originalposition']=0x1;this[_0xc35e('0xf')]='';this[_0xc35e('0x10')]='';this[_0xc35e('0x11')]='';this['accountcode']='';this[_0xc35e('0x12')]='';this[_0xc35e('0x13')]='';this[_0xc35e('0x14')]='';this[_0xc35e('0x15')]=0x0;this[_0xc35e('0x16')]=![];this[_0xc35e('0x17')]='';this[_0xc35e('0x18')]=_0xc35e('0x19');this[_0xc35e('0x1a')]=0x0;this[_0xc35e('0x1b')]={};}module[_0xc35e('0x1c')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index fad81cd..38c6308 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 _0xc125=['type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc125,0x1e8));var _0x5c12=function(_0x28e961,_0x35536c){_0x28e961=_0x28e961-0x0;var _0x4b4c3d=_0xc125[_0x28e961];return _0x4b4c3d;};'use strict';function SalesforceAccount(_0x38a9a7){this['id']=_0x38a9a7['id']||0x0;this[_0x5c12('0x0')]=_0x38a9a7[_0x5c12('0x0')]||'';this[_0x5c12('0x1')]=_0x38a9a7[_0x5c12('0x1')]||'';this[_0x5c12('0x2')]=_0x38a9a7['remoteUri']||'';this[_0x5c12('0x3')]=_0x38a9a7['password']||'';this['clientId']=_0x38a9a7[_0x5c12('0x4')]||'';this['clientSecret']=_0x38a9a7[_0x5c12('0x5')]||'';this[_0x5c12('0x6')]=_0x38a9a7[_0x5c12('0x6')]||'';this['type']=_0x38a9a7[_0x5c12('0x7')]||_0x5c12('0x8');this[_0x5c12('0x9')]=_0x38a9a7[_0x5c12('0x9')]||'';this[_0x5c12('0xa')]=_0x38a9a7['Configurations']||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0xcbf4=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x580a2b,_0x191648){var _0x2533d5=function(_0x44a53d){while(--_0x44a53d){_0x580a2b['push'](_0x580a2b['shift']());}};_0x2533d5(++_0x191648);}(_0xcbf4,0x7c));var _0x4cbf=function(_0x2828ff,_0x45c267){_0x2828ff=_0x2828ff-0x0;var _0x368714=_0xcbf4[_0x2828ff];return _0x368714;};'use strict';function SalesforceAccount(_0x1105eb){this['id']=_0x1105eb['id']||0x0;this['name']=_0x1105eb[_0x4cbf('0x0')]||'';this[_0x4cbf('0x1')]=_0x1105eb[_0x4cbf('0x1')]||'';this[_0x4cbf('0x2')]=_0x1105eb[_0x4cbf('0x2')]||'';this[_0x4cbf('0x3')]=_0x1105eb[_0x4cbf('0x3')]||'';this['clientId']=_0x1105eb[_0x4cbf('0x4')]||'';this[_0x4cbf('0x5')]=_0x1105eb[_0x4cbf('0x5')]||'';this[_0x4cbf('0x6')]=_0x1105eb[_0x4cbf('0x6')]||'';this[_0x4cbf('0x7')]=_0x1105eb[_0x4cbf('0x7')]||_0x4cbf('0x8');this['serverUrl']=_0x1105eb[_0x4cbf('0x9')]||'';this[_0x4cbf('0xa')]=_0x1105eb['Configurations']||{};}module[_0x4cbf('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 a803c65..0686df7 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 _0xa166=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x590c56,_0x298d56){var _0x67d887=function(_0x95cb56){while(--_0x95cb56){_0x590c56['push'](_0x590c56['shift']());}};_0x67d887(++_0x298d56);}(_0xa166,0x186));var _0x6a16=function(_0x10b4d4,_0x5981f5){_0x10b4d4=_0x10b4d4-0x0;var _0x297bd2=_0xa166[_0x10b4d4];return _0x297bd2;};'use strict';function ServicenowAccount(_0x43c5eb){this['id']=_0x43c5eb['id']||0x0;this[_0x6a16('0x0')]=_0x43c5eb[_0x6a16('0x0')]||'';this[_0x6a16('0x1')]=_0x43c5eb[_0x6a16('0x1')]||'';this[_0x6a16('0x2')]=_0x43c5eb[_0x6a16('0x2')]||'';this['remoteUri']=_0x43c5eb[_0x6a16('0x3')]||'';this[_0x6a16('0x4')]=_0x43c5eb[_0x6a16('0x4')]||'';this[_0x6a16('0x5')]=_0x43c5eb[_0x6a16('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xd4b2=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0xd4b2,0x1ec));var _0x2d4b=function(_0x38231c,_0x1a5931){_0x38231c=_0x38231c-0x0;var _0x5be4e8=_0xd4b2[_0x38231c];return _0x5be4e8;};'use strict';function ServicenowAccount(_0x118f2c){this['id']=_0x118f2c['id']||0x0;this[_0x2d4b('0x0')]=_0x118f2c[_0x2d4b('0x0')]||'';this[_0x2d4b('0x1')]=_0x118f2c[_0x2d4b('0x1')]||'';this[_0x2d4b('0x2')]=_0x118f2c[_0x2d4b('0x2')]||'';this[_0x2d4b('0x3')]=_0x118f2c[_0x2d4b('0x3')]||'';this[_0x2d4b('0x4')]=_0x118f2c['serverUrl']||'';this[_0x2d4b('0x5')]=_0x118f2c[_0x2d4b('0x5')]||{};}module[_0x2d4b('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 1aec7c0..9da5215 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 _0x33d1=['name','username','password','remoteUri','Configurations','exports'];(function(_0x23c179,_0x360da5){var _0x539756=function(_0x999ddc){while(--_0x999ddc){_0x23c179['push'](_0x23c179['shift']());}};_0x539756(++_0x360da5);}(_0x33d1,0x144));var _0x133d=function(_0x36a33b,_0x45afed){_0x36a33b=_0x36a33b-0x0;var _0x33c6ed=_0x33d1[_0x36a33b];return _0x33c6ed;};'use strict';function SugarcrmAccount(_0x4395d9){this['id']=_0x4395d9['id']||0x0;this['name']=_0x4395d9[_0x133d('0x0')]||'';this[_0x133d('0x1')]=_0x4395d9[_0x133d('0x1')]||'';this[_0x133d('0x2')]=_0x4395d9[_0x133d('0x2')]||'';this[_0x133d('0x3')]=_0x4395d9[_0x133d('0x3')]||'';this['serverUrl']=_0x4395d9['serverUrl']||'';this[_0x133d('0x4')]=_0x4395d9[_0x133d('0x4')]||{};}module[_0x133d('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xa081=['Configurations','username','password','remoteUri','serverUrl'];(function(_0x35a140,_0x3aeac6){var _0x30ab82=function(_0x15a7c3){while(--_0x15a7c3){_0x35a140['push'](_0x35a140['shift']());}};_0x30ab82(++_0x3aeac6);}(_0xa081,0x146));var _0x1a08=function(_0x399889,_0x2c3f11){_0x399889=_0x399889-0x0;var _0x56abe4=_0xa081[_0x399889];return _0x56abe4;};'use strict';function SugarcrmAccount(_0xc40d8){this['id']=_0xc40d8['id']||0x0;this['name']=_0xc40d8['name']||'';this['username']=_0xc40d8[_0x1a08('0x0')]||'';this[_0x1a08('0x1')]=_0xc40d8[_0x1a08('0x1')]||'';this[_0x1a08('0x2')]=_0xc40d8[_0x1a08('0x2')]||'';this[_0x1a08('0x3')]=_0xc40d8['serverUrl']||'';this[_0x1a08('0x4')]=_0xc40d8['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 78c31b2..4d1986d 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 _0x7453=['address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x4e25fe,_0x24b0c2){var _0x17fc4d=function(_0x57a3c2){while(--_0x57a3c2){_0x4e25fe['push'](_0x4e25fe['shift']());}};_0x17fc4d(++_0x24b0c2);}(_0x7453,0xc6));var _0x3745=function(_0xe102c7,_0x47fefd){_0xe102c7=_0xe102c7-0x0;var _0x1d8a6c=_0x7453[_0xe102c7];return _0x1d8a6c;};'use strict';function Telephone(_0x4509d6){this['id']=_0x4509d6['id']||0x0;this['name']=_0x4509d6[_0x3745('0x0')]||'';this[_0x3745('0x1')]=_0x4509d6[_0x3745('0x1')]||'';this[_0x3745('0x2')]=_0x3745('0x3');this[_0x3745('0x4')]=0x0;this['status']='unknown';this[_0x3745('0x5')]='';}module[_0x3745('0x6')]=Telephone; \ No newline at end of file +var _0x7e7b=['status','address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x11886d,_0x56ad0b){var _0x59f423=function(_0x3e09fa){while(--_0x3e09fa){_0x11886d['push'](_0x11886d['shift']());}};_0x59f423(++_0x56ad0b);}(_0x7e7b,0x133));var _0xb7e7=function(_0x107fb8,_0x1503dc){_0x107fb8=_0x107fb8-0x0;var _0x193322=_0x7e7b[_0x107fb8];return _0x193322;};'use strict';function Telephone(_0x3741bf){this['id']=_0x3741bf['id']||0x0;this[_0xb7e7('0x0')]=_0x3741bf['name']||'';this[_0xb7e7('0x1')]=_0x3741bf[_0xb7e7('0x1')]||'';this[_0xb7e7('0x2')]=_0xb7e7('0x3');this[_0xb7e7('0x4')]=0x0;this[_0xb7e7('0x5')]=_0xb7e7('0x3');this[_0xb7e7('0x6')]='';}module[_0xb7e7('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 95540ae..1081ea3 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(_0x2171fe,_0x352166){var _0x3df3f7=function(_0x363640){while(--_0x363640){_0x2171fe['push'](_0x2171fe['shift']());}};_0x3df3f7(++_0x352166);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x5295bd,_0x56517a){var _0x2ae369=function(_0x1b4138){while(--_0x1b4138){_0x5295bd['push'](_0x5295bd['shift']());}};_0x2ae369(++_0x56517a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 76bff8b..eb6f390 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 _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x3f9142,_0x3fc1af){var _0x42ae75=function(_0xde89b1){while(--_0xde89b1){_0x3f9142['push'](_0x3f9142['shift']());}};_0x42ae75(++_0x3fc1af);}(_0x757a,0xde));var _0xa757=function(_0xffc8cb,_0x40de4d){_0xffc8cb=_0xffc8cb-0x0;var _0xf6e01a=_0x757a[_0xffc8cb];return _0xf6e01a;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger; \ No newline at end of file +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x193d80,_0x110fd9){var _0x4dc86c=function(_0x2cd05b){while(--_0x2cd05b){_0x193d80['push'](_0x193d80['shift']());}};_0x4dc86c(++_0x110fd9);}(_0x4fc2,0x111));var _0x24fc=function(_0x7eee7,_0x3779a1){_0x7eee7=_0x7eee7-0x0;var _0x469f62=_0x4fc2[_0x7eee7];return _0x469f62;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index e5dc496..4360895 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 _0xc940=['defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','address'];(function(_0xfa34aa,_0x1aa9b2){var _0x469987=function(_0x4115ba){while(--_0x4115ba){_0xfa34aa['push'](_0xfa34aa['shift']());}};_0x469987(++_0x1aa9b2);}(_0xc940,0xac));var _0x0c94=function(_0x28deef,_0x12e710){_0x28deef=_0x28deef-0x0;var _0x11dfc8=_0xc940[_0x28deef];return _0x11dfc8;};'use strict';function Trunk(_0x472cd3){this['id']=_0x472cd3['id']||0x0;this['active']=_0x472cd3[_0x0c94('0x0')]||![];this[_0x0c94('0x1')]=_0x472cd3[_0x0c94('0x1')]||'';this[_0x0c94('0x2')]=_0x0c94('0x3');this[_0x0c94('0x4')]=0x0;this[_0x0c94('0x5')]=_0x0c94('0x3');this['registry']=_0x472cd3[_0x0c94('0x6')]&&_0x472cd3[_0x0c94('0x6')][_0x0c94('0x7')](':')?_0x472cd3[_0x0c94('0x6')][_0x0c94('0x8')](':')[0x0]:'';this[_0x0c94('0x9')]='';this[_0x0c94('0xa')]='';this[_0x0c94('0xb')]='';this[_0x0c94('0xc')]='';this[_0x0c94('0xd')]='';this['stateRegistry']=_0x0c94('0x3');this['registrationtime']='';this[_0x0c94('0xe')]='';this[_0x0c94('0xf')]=_0x472cd3['defaultuser']||'';}module[_0x0c94('0x10')]=Trunk; \ No newline at end of file +var _0x328e=['port','domain','domainport','address','defaultuser','active','name','state','unknown','status','registry','indexOf','split','host'];(function(_0x30aea8,_0x5ebed8){var _0x135b21=function(_0x198145){while(--_0x198145){_0x30aea8['push'](_0x30aea8['shift']());}};_0x135b21(++_0x5ebed8);}(_0x328e,0x147));var _0xe328=function(_0x52ab84,_0x384d32){_0x52ab84=_0x52ab84-0x0;var _0x481d6a=_0x328e[_0x52ab84];return _0x481d6a;};'use strict';function Trunk(_0x3c5d08){this['id']=_0x3c5d08['id']||0x0;this[_0xe328('0x0')]=_0x3c5d08['active']||![];this['name']=_0x3c5d08[_0xe328('0x1')]||'';this[_0xe328('0x2')]=_0xe328('0x3');this['stateTime']=0x0;this[_0xe328('0x4')]=_0xe328('0x3');this[_0xe328('0x5')]=_0x3c5d08['registry']&&_0x3c5d08['registry'][_0xe328('0x6')](':')?_0x3c5d08[_0xe328('0x5')][_0xe328('0x7')](':')[0x0]:'';this[_0xe328('0x8')]='';this[_0xe328('0x9')]='';this[_0xe328('0xa')]='';this[_0xe328('0xb')]='';this['refresh']='';this['stateRegistry']=_0xe328('0x3');this['registrationtime']='';this[_0xe328('0xc')]='';this[_0xe328('0xd')]=_0x3c5d08[_0xe328('0xd')]||'';}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 bb4d632..c05af66 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 _0x30bb=['mandatoryDisposition','exports','exten','none'];(function(_0xacbac8,_0x1da415){var _0x5a4184=function(_0x226267){while(--_0x226267){_0xacbac8['push'](_0xacbac8['shift']());}};_0x5a4184(++_0x1da415);}(_0x30bb,0xb2));var _0xb30b=function(_0x24c7eb,_0x31a9a2){_0x24c7eb=_0x24c7eb-0x0;var _0x5b8138=_0x30bb[_0x24c7eb];return _0x5b8138;};'use strict';function voiceExtension(_0x500ef4){this['id']=_0x500ef4['id']||0x0;this[_0xb30b('0x0')]=_0x500ef4[_0xb30b('0x0')]||'';this['recordingFormat']=_0x500ef4['recordingFormat']||_0xb30b('0x1');this['mandatoryDisposition']=_0x500ef4[_0xb30b('0x2')]||![];}module[_0xb30b('0x3')]=voiceExtension; \ No newline at end of file +var _0xbcd9=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x5afeee,_0x89ba93){var _0x3f52c2=function(_0x4f9b2){while(--_0x4f9b2){_0x5afeee['push'](_0x5afeee['shift']());}};_0x3f52c2(++_0x89ba93);}(_0xbcd9,0x114));var _0x9bcd=function(_0x18102b,_0x4d8a49){_0x18102b=_0x18102b-0x0;var _0x5d0c46=_0xbcd9[_0x18102b];return _0x5d0c46;};'use strict';function voiceExtension(_0x537375){this['id']=_0x537375['id']||0x0;this[_0x9bcd('0x0')]=_0x537375[_0x9bcd('0x0')]||'';this[_0x9bcd('0x1')]=_0x537375[_0x9bcd('0x1')]||_0x9bcd('0x2');this[_0x9bcd('0x3')]=_0x537375[_0x9bcd('0x3')]||![];}module[_0x9bcd('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 9497ec2..dfaec09 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 _0xc4d5=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','gsm','name','monitor_format','type','inbound','waiting','talking','total','answered','sumBillable','unmanaged','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject'];(function(_0x3b442a,_0x697d67){var _0x1ec05f=function(_0xd18365){while(--_0xd18365){_0x3b442a['push'](_0x3b442a['shift']());}};_0x1ec05f(++_0x697d67);}(_0xc4d5,0xc3));var _0x5c4d=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0xc4d5[_0xbb14db];return _0x36bed7;};'use strict';var statusDesc=[_0x5c4d('0x0'),_0x5c4d('0x1'),_0x5c4d('0x2'),_0x5c4d('0x3'),_0x5c4d('0x4'),_0x5c4d('0x5'),_0x5c4d('0x6'),_0x5c4d('0x7'),_0x5c4d('0x8')];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':_0x5c4d('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x6a38c8){this['id']=_0x6a38c8['id']||0x0;this[_0x5c4d('0xa')]=_0x6a38c8[_0x5c4d('0xa')]||'';this['monitor_format']=_0x6a38c8[_0x5c4d('0xb')]||'';this[_0x5c4d('0xc')]=_0x6a38c8['type']||_0x5c4d('0xd');this[_0x5c4d('0xe')]=0x0;this[_0x5c4d('0xf')]=0x0;this[_0x5c4d('0x10')]=0x0;this[_0x5c4d('0x11')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x5c4d('0x12')]=0x0;this[_0x5c4d('0x13')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this[_0x5c4d('0x14')]=0x0;this[_0x5c4d('0x15')]=_0x6a38c8['acw']||![];this[_0x5c4d('0x16')]=_0x6a38c8['acwTimeout']||0xa;this[_0x5c4d('0x17')]=_0x6a38c8[_0x5c4d('0x17')]||'no';this[_0x5c4d('0x18')]=!![];this[_0x5c4d('0x19')]='';this[_0x5c4d('0x1a')]=0x0;this['temp']=0x0;this[_0x5c4d('0x1b')]=_0x6a38c8[_0x5c4d('0x1b')]||null;this[_0x5c4d('0x1c')]=_0x6a38c8[_0x5c4d('0x1c')]?_0x6a38c8[_0x5c4d('0x1c')]:null;this[_0x5c4d('0x1d')]=_0x6a38c8[_0x5c4d('0x1d')];this[_0x5c4d('0x1e')]=_0x6a38c8['dialMethod']||_0x5c4d('0x1f');this[_0x5c4d('0x20')]=_0x6a38c8['dialLimitChannel']||0x0;this[_0x5c4d('0x21')]=_0x6a38c8[_0x5c4d('0x21')]||0x0;this['dialPowerLevel']=_0x6a38c8[_0x5c4d('0x22')]||0x1;this[_0x5c4d('0x23')]=_0x6a38c8[_0x5c4d('0x23')]||_0x5c4d('0x24');this[_0x5c4d('0x25')]=_0x6a38c8['dialPredictiveOptimizationPercentage']||0.03;this[_0x5c4d('0x26')]=_0x6a38c8[_0x5c4d('0x26')]||0x258;this[_0x5c4d('0x27')]=_0x6a38c8[_0x5c4d('0x27')]||_0x5c4d('0x28');this['dialOriginateCallerIdNumber']=_0x6a38c8[_0x5c4d('0x29')]||_0x5c4d('0x28');this[_0x5c4d('0x2a')]=_0x6a38c8[_0x5c4d('0x2a')]||0x1e;this[_0x5c4d('0x2b')]=_0x6a38c8[_0x5c4d('0x2b')]||_0x5c4d('0x2c');this[_0x5c4d('0x2d')]=_0x6a38c8[_0x5c4d('0x2d')]||0x3;this[_0x5c4d('0x2e')]=_0x6a38c8[_0x5c4d('0x2e')]||undefined;this[_0x5c4d('0x2f')]=_0x6a38c8[_0x5c4d('0x2f')]||0x3;this['dialCongestionRetryFrequency']=_0x6a38c8[_0x5c4d('0x30')]||0x96;this[_0x5c4d('0x31')]=_0x6a38c8[_0x5c4d('0x31')]||0x3;this[_0x5c4d('0x32')]=_0x6a38c8['dialBusyRetryFrequency']||0x96;this[_0x5c4d('0x33')]=_0x6a38c8[_0x5c4d('0x33')]||0x3;this[_0x5c4d('0x34')]=_0x6a38c8[_0x5c4d('0x34')]||0x96;this[_0x5c4d('0x35')]=_0x6a38c8['dialNoSuchNumberMaxRetry']||0x3;this[_0x5c4d('0x36')]=_0x6a38c8[_0x5c4d('0x36')]||0x96;this[_0x5c4d('0x37')]=_0x6a38c8[_0x5c4d('0x37')]||0x3;this[_0x5c4d('0x38')]=_0x6a38c8[_0x5c4d('0x38')]||0x96;this[_0x5c4d('0x39')]=_0x6a38c8[_0x5c4d('0x39')]||0x3;this['dialAbandonedRetryFrequency']=_0x6a38c8[_0x5c4d('0x3a')]||0x96;this[_0x5c4d('0x3b')]=_0x6a38c8[_0x5c4d('0x3b')]||0x3;this[_0x5c4d('0x3c')]=_0x6a38c8['dialMachineRetryFrequency']||0x96;this[_0x5c4d('0x3d')]=_0x6a38c8[_0x5c4d('0x3d')]||0x3;this[_0x5c4d('0x3e')]=_0x6a38c8[_0x5c4d('0x3e')]||0x96;this[_0x5c4d('0x3f')]=_0x6a38c8[_0x5c4d('0x3f')]||0x3;this[_0x5c4d('0x40')]=_0x6a38c8['dialGlobalMaxRetry']||0x4;this[_0x5c4d('0x41')]=_0x6a38c8[_0x5c4d('0x41')]?_0x6a38c8[_0x5c4d('0x41')]:undefined;this[_0x5c4d('0x42')]=_0x6a38c8[_0x5c4d('0x42')]?_0x6a38c8[_0x5c4d('0x42')]:undefined;this['dialPrefix']=_0x6a38c8[_0x5c4d('0x43')]||undefined;this[_0x5c4d('0x44')]=_0x6a38c8[_0x5c4d('0x44')]?_0x6a38c8['Interval']:undefined;this[_0x5c4d('0x45')]=_0x6a38c8[_0x5c4d('0x45')]||_0x5c4d('0x46');this[_0x5c4d('0x47')]=_0x6a38c8['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x5c4d('0x48')]=_0x6a38c8[_0x5c4d('0x48')]||undefined;this[_0x5c4d('0x49')]=strategy[_0x6a38c8[_0x5c4d('0x49')]]||_0x5c4d('0x4a');this[_0x5c4d('0x4b')]=!![];this[_0x5c4d('0x4c')]=_0x6a38c8[_0x5c4d('0x4c')]||![];this[_0x5c4d('0x4d')]=_0x6a38c8[_0x5c4d('0x4d')];this[_0x5c4d('0x4e')]=_0x6a38c8[_0x5c4d('0x4e')];this['dialAMDAfterGreetingSilence']=_0x6a38c8['dialAMDAfterGreetingSilence'];this[_0x5c4d('0x4f')]=_0x6a38c8[_0x5c4d('0x4f')];this[_0x5c4d('0x50')]=_0x6a38c8[_0x5c4d('0x50')];this[_0x5c4d('0x51')]=_0x6a38c8['dialAMDBetweenWordsSilence'];this[_0x5c4d('0x52')]=_0x6a38c8[_0x5c4d('0x52')];this[_0x5c4d('0x53')]=_0x6a38c8[_0x5c4d('0x53')];this[_0x5c4d('0x54')]=_0x6a38c8[_0x5c4d('0x54')];this[_0x5c4d('0x55')]=0x0;this['pTalking']=0x0;this[_0x5c4d('0x56')]=_0x6a38c8['timeout'];this[_0x5c4d('0x57')]=0x0;this[_0x5c4d('0x58')]=0x0;this[_0x5c4d('0x59')]=0x0;this[_0x5c4d('0x5a')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x5c4d('0x5b')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x5c4d('0x5c')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x5c4d('0x5d')]=0x0;this[_0x5c4d('0x5e')]=0x0;this[_0x5c4d('0x5f')]=0x0;this['outboundReCallsDay']=0x0;this[_0x5c4d('0x60')]=0x0;this[_0x5c4d('0x61')]=undefined;this[_0x5c4d('0x62')]=undefined;this['handlePredictive']=undefined;this[_0x5c4d('0x63')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x5c4d('0x64')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x5c4d('0x65')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x5c4d('0x66')]=_0x6a38c8['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x5c4d('0x67')]=_0x6a38c8[_0x5c4d('0x68')]||0xa;this[_0x5c4d('0x69')]=0x0;this[_0x5c4d('0x6a')]=0x0;this[_0x5c4d('0x6b')]=0x1;this[_0x5c4d('0x6c')]=0x0;this[_0x5c4d('0x6d')]=0x0;this[_0x5c4d('0x6e')]=0x0;this[_0x5c4d('0x6f')]=0x0;this[_0x5c4d('0x70')]=_0x6a38c8['dialRecallMeTimeout']||0x1e;this[_0x5c4d('0x71')]=_0x6a38c8[_0x5c4d('0x71')]||![];this[_0x5c4d('0x72')]=!!_0x6a38c8[_0x5c4d('0x72')]||![];this['dialPreviewRecallmeReminder']=!!_0x6a38c8[_0x5c4d('0x73')]||![];this['dialQueueProject2']=_0x6a38c8['dialQueueProject2']||undefined;this[_0x5c4d('0x74')]=_0x6a38c8['dialAgiAfterHangupClient']||![];this[_0x5c4d('0x75')]=_0x6a38c8[_0x5c4d('0x75')]||![];this['monitor_format']=monitorFormat[_0x6a38c8[_0x5c4d('0xb')]]?monitorFormat[_0x6a38c8[_0x5c4d('0xb')]]:undefined;this['mandatoryDisposition']=_0x6a38c8[_0x5c4d('0x76')]||![];this[_0x5c4d('0x77')]=_0x6a38c8[_0x5c4d('0x77')]?_0x6a38c8['mandatoryDispositionPause']:undefined;}module[_0x5c4d('0x78')]=VoiceQueue; \ No newline at end of file +var _0xb697=['mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','unmanaged','abandoned','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent'];(function(_0x48b88d,_0x4304dc){var _0x39088b=function(_0xde5075){while(--_0xde5075){_0x48b88d['push'](_0x48b88d['shift']());}};_0x39088b(++_0x4304dc);}(_0xb697,0x1ef));var _0x7b69=function(_0x33b360,_0x1a33ae){_0x33b360=_0x33b360-0x0;var _0x31e9e7=_0xb697[_0x33b360];return _0x31e9e7;};'use strict';var statusDesc=[_0x7b69('0x0'),_0x7b69('0x1'),_0x7b69('0x2'),_0x7b69('0x3'),_0x7b69('0x4'),_0x7b69('0x5'),'ringing',_0x7b69('0x6'),_0x7b69('0x7')];var monitorFormat={'wav':_0x7b69('0x8'),'wav49':_0x7b69('0x9'),'gsm':_0x7b69('0xa')};var strategy={'rrmemory':_0x7b69('0xb'),'roundrobin':_0x7b69('0xc')};function VoiceQueue(_0x3f827a){this['id']=_0x3f827a['id']||0x0;this[_0x7b69('0xd')]=_0x3f827a[_0x7b69('0xd')]||'';this[_0x7b69('0xe')]=_0x3f827a[_0x7b69('0xe')]||'';this[_0x7b69('0xf')]=_0x3f827a[_0x7b69('0xf')]||_0x7b69('0x10');this[_0x7b69('0x11')]=0x0;this[_0x7b69('0x12')]=0x0;this[_0x7b69('0x13')]=0x0;this[_0x7b69('0x14')]=0x0;this['sumDuration']=0x0;this[_0x7b69('0x15')]=0x0;this['sumBillable']=0x0;this[_0x7b69('0x16')]=0x0;this[_0x7b69('0x17')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0x7b69('0x18')]=_0x3f827a['acw']||![];this[_0x7b69('0x19')]=_0x3f827a[_0x7b69('0x19')]||0xa;this['autopause']=_0x3f827a[_0x7b69('0x1a')]||'no';this[_0x7b69('0x1b')]=!![];this['message']='';this[_0x7b69('0x1c')]=0x0;this['temp']=0x0;this[_0x7b69('0x1d')]=_0x3f827a['dialTimezone']||null;this[_0x7b69('0x1e')]=_0x3f827a[_0x7b69('0x1e')]?_0x3f827a[_0x7b69('0x1e')]:null;this[_0x7b69('0x1f')]=_0x3f827a[_0x7b69('0x1f')];this[_0x7b69('0x20')]=_0x3f827a[_0x7b69('0x20')]||_0x7b69('0x21');this[_0x7b69('0x22')]=_0x3f827a['dialLimitChannel']||0x0;this[_0x7b69('0x23')]=_0x3f827a[_0x7b69('0x23')]||0x0;this[_0x7b69('0x24')]=_0x3f827a[_0x7b69('0x24')]||0x1;this[_0x7b69('0x25')]=_0x3f827a[_0x7b69('0x25')]||'dropRate';this[_0x7b69('0x26')]=_0x3f827a[_0x7b69('0x26')]||0.03;this['dialPredictiveInterval']=_0x3f827a[_0x7b69('0x27')]||0x258;this[_0x7b69('0x28')]=_0x3f827a[_0x7b69('0x28')]||_0x7b69('0x29');this['dialOriginateCallerIdNumber']=_0x3f827a['dialOriginateCallerIdNumber']||_0x7b69('0x29');this[_0x7b69('0x2a')]=_0x3f827a[_0x7b69('0x2a')]||0x1e;this[_0x7b69('0x2b')]=_0x3f827a[_0x7b69('0x2b')]||_0x7b69('0x2c');this[_0x7b69('0x2d')]=_0x3f827a[_0x7b69('0x2d')]||0x3;this[_0x7b69('0x2e')]=_0x3f827a[_0x7b69('0x2e')]||undefined;this['dialCongestionMaxRetry']=_0x3f827a[_0x7b69('0x2f')]||0x3;this['dialCongestionRetryFrequency']=_0x3f827a[_0x7b69('0x30')]||0x96;this[_0x7b69('0x31')]=_0x3f827a[_0x7b69('0x31')]||0x3;this[_0x7b69('0x32')]=_0x3f827a['dialBusyRetryFrequency']||0x96;this[_0x7b69('0x33')]=_0x3f827a[_0x7b69('0x33')]||0x3;this['dialNoAnswerRetryFrequency']=_0x3f827a['dialNoAnswerRetryFrequency']||0x96;this[_0x7b69('0x34')]=_0x3f827a['dialNoSuchNumberMaxRetry']||0x3;this[_0x7b69('0x35')]=_0x3f827a[_0x7b69('0x35')]||0x96;this[_0x7b69('0x36')]=_0x3f827a[_0x7b69('0x36')]||0x3;this[_0x7b69('0x37')]=_0x3f827a[_0x7b69('0x37')]||0x96;this['dialAbandonedMaxRetry']=_0x3f827a[_0x7b69('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0x3f827a[_0x7b69('0x39')]||0x96;this[_0x7b69('0x3a')]=_0x3f827a['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x3f827a[_0x7b69('0x3b')]||0x96;this[_0x7b69('0x3c')]=_0x3f827a[_0x7b69('0x3c')]||0x3;this[_0x7b69('0x3d')]=_0x3f827a[_0x7b69('0x3d')]||0x96;this[_0x7b69('0x3e')]=_0x3f827a[_0x7b69('0x3e')]||0x3;this[_0x7b69('0x3f')]=_0x3f827a[_0x7b69('0x3f')]||0x4;this[_0x7b69('0x40')]=_0x3f827a[_0x7b69('0x40')]?_0x3f827a[_0x7b69('0x40')]:undefined;this['TrunkBackup']=_0x3f827a[_0x7b69('0x41')]?_0x3f827a[_0x7b69('0x41')]:undefined;this['dialPrefix']=_0x3f827a[_0x7b69('0x42')]||undefined;this[_0x7b69('0x43')]=_0x3f827a[_0x7b69('0x43')]?_0x3f827a[_0x7b69('0x43')]:undefined;this['dialOrderByScheduledAt']=_0x3f827a[_0x7b69('0x44')]||'DESC';this[_0x7b69('0x45')]=_0x3f827a[_0x7b69('0x45')]||undefined;this[_0x7b69('0x46')]=_0x3f827a['dialCutDigit']||undefined;this[_0x7b69('0x47')]=strategy[_0x3f827a[_0x7b69('0x47')]]||_0x7b69('0xb');this[_0x7b69('0x48')]=!![];this[_0x7b69('0x49')]=_0x3f827a[_0x7b69('0x49')]||![];this[_0x7b69('0x4a')]=_0x3f827a[_0x7b69('0x4a')];this[_0x7b69('0x4b')]=_0x3f827a[_0x7b69('0x4b')];this[_0x7b69('0x4c')]=_0x3f827a[_0x7b69('0x4c')];this['dialAMDTotalAnalysisTime']=_0x3f827a[_0x7b69('0x4d')];this[_0x7b69('0x4e')]=_0x3f827a[_0x7b69('0x4e')];this[_0x7b69('0x4f')]=_0x3f827a[_0x7b69('0x4f')];this[_0x7b69('0x50')]=_0x3f827a['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x3f827a[_0x7b69('0x51')];this[_0x7b69('0x52')]=_0x3f827a[_0x7b69('0x52')];this[_0x7b69('0x53')]=0x0;this[_0x7b69('0x54')]=0x0;this[_0x7b69('0x55')]=_0x3f827a[_0x7b69('0x55')];this['outboundAnswerCallsDay']=0x0;this[_0x7b69('0x56')]=0x0;this[_0x7b69('0x57')]=0x0;this[_0x7b69('0x58')]=0x0;this[_0x7b69('0x59')]=0x0;this[_0x7b69('0x5a')]=0x0;this[_0x7b69('0x5b')]=0x0;this[_0x7b69('0x5c')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x7b69('0x5d')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x7b69('0x5e')]=0x0;this[_0x7b69('0x5f')]=0x0;this[_0x7b69('0x60')]=0x0;this[_0x7b69('0x61')]=undefined;this[_0x7b69('0x62')]=undefined;this['handlePredictive']=undefined;this[_0x7b69('0x63')]=1.05;this[_0x7b69('0x64')]=0x0;this[_0x7b69('0x65')]=0x0;this[_0x7b69('0x66')]=0x0;this[_0x7b69('0x67')]=0x0;this[_0x7b69('0x68')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x7b69('0x69')]=0x0;this[_0x7b69('0x6a')]=0x0;this['predictiveIntervalMaxThreshold']=_0x3f827a[_0x7b69('0x6b')]||0x14;this[_0x7b69('0x6c')]=_0x3f827a[_0x7b69('0x6b')]||0xa;this[_0x7b69('0x6d')]=0x0;this[_0x7b69('0x6e')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x7b69('0x6f')]=0x0;this['erlangCallToSecond']=0x0;this[_0x7b69('0x70')]=0x0;this[_0x7b69('0x71')]=0x0;this['dialRecallMeTimeout']=_0x3f827a['dialRecallMeTimeout']||0x1e;this[_0x7b69('0x72')]=_0x3f827a['dialRecallInQueue']||![];this[_0x7b69('0x73')]=!!_0x3f827a['dialPreviewAutoRecallMe']||![];this[_0x7b69('0x74')]=!!_0x3f827a[_0x7b69('0x74')]||![];this[_0x7b69('0x75')]=_0x3f827a[_0x7b69('0x75')]||undefined;this[_0x7b69('0x76')]=_0x3f827a[_0x7b69('0x76')]||![];this[_0x7b69('0x77')]=_0x3f827a[_0x7b69('0x77')]||![];this[_0x7b69('0xe')]=monitorFormat[_0x3f827a[_0x7b69('0xe')]]?monitorFormat[_0x3f827a[_0x7b69('0xe')]]:undefined;this[_0x7b69('0x78')]=_0x3f827a['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x3f827a['mandatoryDispositionPause']?_0x3f827a[_0x7b69('0x79')]:undefined;}module[_0x7b69('0x7a')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 8a92743..2c22039 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 _0x20fa=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0x20fa,0xea));var _0xa20f=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x20fa[_0x220f3f];return _0x1f170e;};'use strict';function VtigerAccount(_0x3369b3){this['id']=_0x3369b3['id']||0x0;this[_0xa20f('0x0')]=_0x3369b3['name']||'';this[_0xa20f('0x1')]=_0x3369b3[_0xa20f('0x1')]||'';this[_0xa20f('0x2')]=_0x3369b3[_0xa20f('0x2')]||'';this[_0xa20f('0x3')]=_0x3369b3[_0xa20f('0x3')]||'';this[_0xa20f('0x4')]=_0x3369b3['serverUrl']||'';this[_0xa20f('0x5')]=_0x3369b3[_0xa20f('0x5')]||{};}module[_0xa20f('0x6')]=VtigerAccount; \ No newline at end of file +var _0x52a0=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x4d09ab,_0x269112){var _0x4ba5e8=function(_0x31807a){while(--_0x31807a){_0x4d09ab['push'](_0x4d09ab['shift']());}};_0x4ba5e8(++_0x269112);}(_0x52a0,0x149));var _0x052a=function(_0x279e6f,_0x566574){_0x279e6f=_0x279e6f-0x0;var _0x489a5f=_0x52a0[_0x279e6f];return _0x489a5f;};'use strict';function VtigerAccount(_0x1db034){this['id']=_0x1db034['id']||0x0;this[_0x052a('0x0')]=_0x1db034[_0x052a('0x0')]||'';this[_0x052a('0x1')]=_0x1db034[_0x052a('0x1')]||'';this[_0x052a('0x2')]=_0x1db034[_0x052a('0x2')]||'';this['remoteUri']=_0x1db034[_0x052a('0x3')]||'';this[_0x052a('0x4')]=_0x1db034['serverUrl']||'';this[_0x052a('0x5')]=_0x1db034[_0x052a('0x5')]||{};}module[_0x052a('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index cf7dc73..be0426a 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 _0x4088=['Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x4088,0x1e6));var _0x8408=function(_0x4d502e,_0x950daa){_0x4d502e=_0x4d502e-0x0;var _0x45eac8=_0x4088[_0x4d502e];return _0x45eac8;};'use strict';function ZendeskAccount(_0x5e226c){this['id']=_0x5e226c['id']||0x0;this['name']=_0x5e226c[_0x8408('0x0')]||'';this[_0x8408('0x1')]=_0x5e226c['username']||'';this[_0x8408('0x2')]=_0x5e226c['password']||'';this[_0x8408('0x3')]=_0x5e226c['token']||'';this[_0x8408('0x4')]=_0x5e226c[_0x8408('0x4')]||'';this[_0x8408('0x5')]=_0x5e226c[_0x8408('0x5')]||'';this[_0x8408('0x6')]=_0x5e226c[_0x8408('0x6')]||_0x8408('0x7');this[_0x8408('0x8')]=_0x5e226c[_0x8408('0x8')]||'';this['Configurations']=_0x5e226c[_0x8408('0x9')]||{};}module[_0x8408('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x88a0=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x69a451,_0x49fd37){var _0x3d6ef5=function(_0x27ebf4){while(--_0x27ebf4){_0x69a451['push'](_0x69a451['shift']());}};_0x3d6ef5(++_0x49fd37);}(_0x88a0,0x6a));var _0x088a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x88a0[_0x501510];return _0x1e6ee5;};'use strict';function ZendeskAccount(_0x4f6351){this['id']=_0x4f6351['id']||0x0;this[_0x088a('0x0')]=_0x4f6351[_0x088a('0x0')]||'';this['username']=_0x4f6351[_0x088a('0x1')]||'';this[_0x088a('0x2')]=_0x4f6351[_0x088a('0x2')]||'';this[_0x088a('0x3')]=_0x4f6351[_0x088a('0x3')]||'';this[_0x088a('0x4')]=_0x4f6351[_0x088a('0x4')]||'';this[_0x088a('0x5')]=_0x4f6351[_0x088a('0x5')]||'';this[_0x088a('0x6')]=_0x4f6351['type']||_0x088a('0x7');this[_0x088a('0x8')]=_0x4f6351[_0x088a('0x8')]||'';this[_0x088a('0x9')]=_0x4f6351[_0x088a('0x9')]||{};}module[_0x088a('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 b113cc5..318b3ea 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 _0x7603=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x4f3008,_0x2ea90e){var _0x3b1cc1=function(_0x8838bb){while(--_0x8838bb){_0x4f3008['push'](_0x4f3008['shift']());}};_0x3b1cc1(++_0x2ea90e);}(_0x7603,0x1d4));var _0x3760=function(_0x2f14a2,_0x4ecd8a){_0x2f14a2=_0x2f14a2-0x0;var _0xdc8117=_0x7603[_0x2f14a2];return _0xdc8117;};'use strict';function ZohoAccount(_0x25ce23){this['id']=_0x25ce23['id']||0x0;this[_0x3760('0x0')]=_0x25ce23['name']||'';this[_0x3760('0x1')]=_0x25ce23['description']||'';this['host']=_0x25ce23['host']||'';this['zone']=_0x25ce23[_0x3760('0x2')]||'';this[_0x3760('0x3')]=_0x25ce23['clientId']||'';this[_0x3760('0x4')]=_0x25ce23[_0x3760('0x4')]||'';this[_0x3760('0x5')]=_0x25ce23[_0x3760('0x5')]||'';this[_0x3760('0x6')]=_0x25ce23[_0x3760('0x6')]||'';this[_0x3760('0x7')]=_0x25ce23[_0x3760('0x7')]||'';this[_0x3760('0x8')]=_0x25ce23[_0x3760('0x8')]||{};}module[_0x3760('0x9')]=ZohoAccount; \ No newline at end of file +var _0xff5e=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x1211ab,_0x4577e1){var _0x47573d=function(_0x459cb0){while(--_0x459cb0){_0x1211ab['push'](_0x1211ab['shift']());}};_0x47573d(++_0x4577e1);}(_0xff5e,0x12c));var _0xeff5=function(_0x4db19d,_0x539f1d){_0x4db19d=_0x4db19d-0x0;var _0x3b62b4=_0xff5e[_0x4db19d];return _0x3b62b4;};'use strict';function ZohoAccount(_0x36bfe8){this['id']=_0x36bfe8['id']||0x0;this[_0xeff5('0x0')]=_0x36bfe8['name']||'';this['description']=_0x36bfe8[_0xeff5('0x1')]||'';this[_0xeff5('0x2')]=_0x36bfe8['host']||'';this[_0xeff5('0x3')]=_0x36bfe8[_0xeff5('0x3')]||'';this[_0xeff5('0x4')]=_0x36bfe8['clientId']||'';this[_0xeff5('0x5')]=_0x36bfe8[_0xeff5('0x5')]||'';this[_0xeff5('0x6')]=_0x36bfe8[_0xeff5('0x6')]||'';this[_0xeff5('0x7')]=_0x36bfe8['code']||'';this[_0xeff5('0x8')]=_0x36bfe8[_0xeff5('0x8')]||'';this[_0xeff5('0x9')]=_0x36bfe8[_0xeff5('0x9')]||{};}module[_0xeff5('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index b2f8cea..9b73a41 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 _0xe511=['name','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','number','util','lodash','string','isNil','idContact','queue','type','campaigntype','dialAnswer','membername','Agent'];(function(_0x36d401,_0x242fb0){var _0x348d94=function(_0xf410d7){while(--_0xf410d7){_0x36d401['push'](_0x36d401['shift']());}};_0x348d94(++_0x242fb0);}(_0xe511,0x16f));var _0x1e51=function(_0x5936ad,_0x199c60){_0x5936ad=_0x5936ad-0x0;var _0x26bed2=_0xe511[_0x5936ad];return _0x26bed2;};'use strict';var util=require(_0x1e51('0x0'));var _=require(_0x1e51('0x1'));var moment=require('moment');function checkNameSurname(_0x2a5905,_0x5b9e45,_0x253e96){var _0xb75a96='';if(!_['isNil'](_0x5b9e45)&&_0x1e51('0x2')===typeof _0x5b9e45){_0xb75a96+=_0x5b9e45;}if(!_[_0x1e51('0x3')](_0x253e96)&&_0x1e51('0x2')===typeof _0x253e96){_0xb75a96+='\x20'+_0x253e96;}if(_0xb75a96!==''){return _0xb75a96;}return _0x2a5905;}function Action(_0x16ec99,_0x480cca,_0x26b22c,_0x21ed6b,_0x5c4590){this['uniqueid']=_0x26b22c||undefined;this[_0x1e51('0x4')]=_0x16ec99['id'];this[_0x1e51('0x5')]=_0x480cca['name'];this['type']=_0x480cca[_0x1e51('0x6')];this[_0x1e51('0x7')]=_0x1e51('0x5');this[_0x1e51('0x8')]=![];this[_0x1e51('0x9')]=_[_0x1e51('0x3')](_0x16ec99['Agent'])?undefined:_0x16ec99[_0x1e51('0xa')][_0x1e51('0xb')];this[_0x1e51('0xc')]=this[_0x1e51('0x9')]?util[_0x1e51('0xd')](_0x1e51('0xe'),this['membername']):_0x21ed6b||undefined;this[_0x1e51('0xf')]=checkNameSurname(_0x16ec99[_0x1e51('0x10')][_0x1e51('0x11')],_0x16ec99[_0x1e51('0x10')][_0x1e51('0x12')],_0x16ec99[_0x1e51('0x10')][_0x1e51('0x13')]);this[_0x1e51('0x14')]=_0x16ec99[_0x1e51('0x14')]||![];this[_0x1e51('0x15')]=_0x16ec99['phone'];this[_0x1e51('0x16')]=_0x16ec99[_0x1e51('0x16')];this[_0x1e51('0x17')]=_0x16ec99['countbusyretry']||0x0;this[_0x1e51('0x18')]=_0x16ec99['countcongestionretry']||0x0;this['countnoanswerretry']=_0x16ec99[_0x1e51('0x19')]||0x0;this[_0x1e51('0x1a')]=(_0x16ec99[_0x1e51('0x17')]||0x0)+(_0x16ec99[_0x1e51('0x18')]||0x0)+(_0x16ec99[_0x1e51('0x19')]||0x0)+(_0x16ec99[_0x1e51('0x1b')]||0x0)+(_0x16ec99['countdropretry']||0x0)+(_0x16ec99[_0x1e51('0x1c')]||0x0)+(_0x16ec99['countmachineretry']||0x0)+(_0x16ec99[_0x1e51('0x1d')]||0x0);this[_0x1e51('0x1b')]=_0x16ec99[_0x1e51('0x1b')]||0x0;this[_0x1e51('0x1e')]=_0x16ec99['countdropretry']||0x0;this['countabandonedretry']=_0x16ec99['countabandonedretry']||0x0;this['countmachineretry']=_0x16ec99[_0x1e51('0x1f')]||0x0;this['countagentrejectretry']=_0x16ec99[_0x1e51('0x1d')]||0x0;this[_0x1e51('0x20')]=_0x16ec99[_0x1e51('0x20')];this[_0x1e51('0x21')]=_0x16ec99[_0x1e51('0x21')];this[_0x1e51('0x22')]=_0x16ec99[_0x1e51('0x22')];this[_0x1e51('0x23')]=_0x16ec99['recallme'];this['ContactId']=_0x16ec99[_0x1e51('0x24')];this[_0x1e51('0x25')]=_0x16ec99[_0x1e51('0x25')];this[_0x1e51('0x26')]=_['isNil'](_0x16ec99['Agent'])?_0x16ec99['UserId']:_0x16ec99[_0x1e51('0xa')]['id'];this[_0x1e51('0x27')]=_0x16ec99[_0x1e51('0x27')];this['originatecalleridnum']='';this[_0x1e51('0x28')]='';}Action['prototype']['getCaller']=function(){return util[_0x1e51('0xd')]('\x22%s\x22\x20<%s>',this[_0x1e51('0xf')],this[_0x1e51('0x29')]);};module['exports']=Action; \ No newline at end of file +var _0x32f4=['isNil','uniqueid','queue','type','campaigntype','dialAnswer','Agent','channelAgent','membername','SIP/%s','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','format','calleridname','exports','util','lodash','moment','string'];(function(_0xde9879,_0x22f5b5){var _0x393fa2=function(_0x23b6ff){while(--_0x23b6ff){_0xde9879['push'](_0xde9879['shift']());}};_0x393fa2(++_0x22f5b5);}(_0x32f4,0x154));var _0x432f=function(_0x3b60d7,_0x5ea279){_0x3b60d7=_0x3b60d7-0x0;var _0x163a86=_0x32f4[_0x3b60d7];return _0x163a86;};'use strict';var util=require(_0x432f('0x0'));var _=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));function checkNameSurname(_0x2b22ad,_0x5ee65a,_0x2a4628){var _0x6f0e8a='';if(!_['isNil'](_0x5ee65a)&&_0x432f('0x3')===typeof _0x5ee65a){_0x6f0e8a+=_0x5ee65a;}if(!_[_0x432f('0x4')](_0x2a4628)&&_0x432f('0x3')===typeof _0x2a4628){_0x6f0e8a+='\x20'+_0x2a4628;}if(_0x6f0e8a!==''){return _0x6f0e8a;}return _0x2b22ad;}function Action(_0x355b02,_0x2f5f03,_0x5d8cc0,_0x5b5f08,_0x2f66fd){this[_0x432f('0x5')]=_0x5d8cc0||undefined;this['idContact']=_0x355b02['id'];this[_0x432f('0x6')]=_0x2f5f03['name'];this[_0x432f('0x7')]=_0x2f5f03[_0x432f('0x7')];this[_0x432f('0x8')]=_0x432f('0x6');this[_0x432f('0x9')]=![];this['membername']=_[_0x432f('0x4')](_0x355b02['Agent'])?undefined:_0x355b02[_0x432f('0xa')]['name'];this[_0x432f('0xb')]=this[_0x432f('0xc')]?util['format'](_0x432f('0xd'),this[_0x432f('0xc')]):_0x5b5f08||undefined;this['calleridname']=checkNameSurname(_0x355b02[_0x432f('0xe')][_0x432f('0xf')],_0x355b02['Contact']['firstName'],_0x355b02[_0x432f('0xe')][_0x432f('0x10')]);this[_0x432f('0x11')]=_0x355b02[_0x432f('0x11')]||![];this[_0x432f('0x12')]=_0x355b02['phone'];this[_0x432f('0x13')]=_0x355b02[_0x432f('0x13')];this[_0x432f('0x14')]=_0x355b02[_0x432f('0x14')]||0x0;this['countcongestionretry']=_0x355b02[_0x432f('0x15')]||0x0;this[_0x432f('0x16')]=_0x355b02[_0x432f('0x16')]||0x0;this[_0x432f('0x17')]=(_0x355b02[_0x432f('0x14')]||0x0)+(_0x355b02[_0x432f('0x15')]||0x0)+(_0x355b02['countnoanswerretry']||0x0)+(_0x355b02[_0x432f('0x18')]||0x0)+(_0x355b02['countdropretry']||0x0)+(_0x355b02[_0x432f('0x19')]||0x0)+(_0x355b02[_0x432f('0x1a')]||0x0)+(_0x355b02[_0x432f('0x1b')]||0x0);this[_0x432f('0x18')]=_0x355b02[_0x432f('0x18')]||0x0;this[_0x432f('0x1c')]=_0x355b02[_0x432f('0x1c')]||0x0;this[_0x432f('0x19')]=_0x355b02[_0x432f('0x19')]||0x0;this[_0x432f('0x1a')]=_0x355b02[_0x432f('0x1a')]||0x0;this[_0x432f('0x1b')]=_0x355b02['countagentrejectretry']||0x0;this['callback']=_0x355b02[_0x432f('0x1d')];this['callbackuniqueid']=_0x355b02[_0x432f('0x1e')];this['callbackat']=_0x355b02[_0x432f('0x1f')];this[_0x432f('0x20')]=_0x355b02[_0x432f('0x20')];this[_0x432f('0x21')]=_0x355b02[_0x432f('0x21')];this[_0x432f('0x22')]=_0x355b02['ListId'];this[_0x432f('0x23')]=_[_0x432f('0x4')](_0x355b02['Agent'])?_0x355b02[_0x432f('0x23')]:_0x355b02[_0x432f('0xa')]['id'];this[_0x432f('0x24')]=_0x355b02[_0x432f('0x24')];this[_0x432f('0x25')]='';this[_0x432f('0x26')]='';}Action[_0x432f('0x27')]['getCaller']=function(){return util[_0x432f('0x28')]('\x22%s\x22\x20<%s>',this[_0x432f('0x29')],this['number']);};module[_0x432f('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 24f046b..6302025 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','type','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','disableContact','starttime','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','additional','countbusyretry','dialBusyMaxRetry','scheduledAt','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','dialAgentRejectRetryFrequency','agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','status','SIP/%s','execRun','recallme','validateContact','isValid','phone','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','filterKey','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','defaults','socket.io-emitter','redis','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x0a9e('0x3'));var Redis=require('ioredis');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x7'));var ami=require('../ami');var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require(_0x0a9e('0x9'));var Action=require(_0x0a9e('0xa'));var ut=require('./util/util');config['redis']=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0xc'))(new Redis(config[_0x0a9e('0xd')]));var Sequence=function(){};Sequence[_0x0a9e('0xe')][_0x0a9e('0xf')]=function(_0xfeb75b){this[_0x0a9e('0x10')]=this['tail']?this['tail']['finally'](_0xfeb75b):_0xfeb75b();};function Preview(_0x4cfe67){this[_0x0a9e('0x11')]=new Sequence();this[_0x0a9e('0x12')]=_0x4cfe67[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x4cfe67[_0x0a9e('0x14')];this[_0x0a9e('0x15')]={};this['agents']=_0x4cfe67[_0x0a9e('0x16')];this[_0x0a9e('0x17')]=0x0;ami['on'](_0x0a9e('0x18'),this[_0x0a9e('0x19')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x1b'),this['syncHangup'][_0x0a9e('0x1a')](this));ami['on']('hanguprequest',this[_0x0a9e('0x1c')]['bind'](this));ami['on'](_0x0a9e('0x1d'),this[_0x0a9e('0x1e')]['bind'](this));ami['on'](_0x0a9e('0x1f'),this['syncNewExten'][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x24'),this[_0x0a9e('0x25')][_0x0a9e('0x1a')](this));this[_0x0a9e('0x26')](this[_0x0a9e('0x12')]);}function emit(_0x4bb1e3,_0x2c3407,_0x155cce){io['to'](_0x4bb1e3)['emit'](_0x2c3407,_0x155cce);}function emitCampaignPreview(_0x20f109){if(_0x20f109['type']==='outbound'){var _0x3a02e1={'id':_0x20f109['id'],'name':_0x20f109[_0x0a9e('0x27')],'strategy':_0x20f109[_0x0a9e('0x28')],'answered':_0x20f109[_0x0a9e('0x29')],'available':_0x20f109['available'],'loggedIn':_0x20f109[_0x0a9e('0x2a')],'pTalking':_0x20f109[_0x0a9e('0x2b')],'sumBillable':_0x20f109[_0x0a9e('0x2c')],'sumDuration':_0x20f109[_0x0a9e('0x2d')],'sumHoldTime':_0x20f109[_0x0a9e('0x2e')]||0x0,'talking':_0x20f109[_0x0a9e('0x2f')],'total':_0x20f109[_0x0a9e('0x30')],'type':_0x20f109['type'],'unmanaged':_0x20f109['unmanaged'],'abandoned':_0x20f109[_0x0a9e('0x31')],'waiting':_0x20f109[_0x0a9e('0x32')],'loggedInDb':_0x20f109[_0x0a9e('0x33')],'dialActive':_0x20f109[_0x0a9e('0x34')],'dialMethod':_0x20f109['dialMethod'],'dialOriginateCallerIdName':_0x20f109[_0x0a9e('0x35')],'dialOriginateCallerIdNumber':_0x20f109['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x20f109[_0x0a9e('0x36')],'dialPrefix':_0x20f109['dialPrefix'],'outboundAnswerAgiCallsDay':_0x20f109[_0x0a9e('0x37')],'outboundAnswerCallsDay':_0x20f109[_0x0a9e('0x38')],'outboundBlacklistCallsDay':_0x20f109[_0x0a9e('0x39')],'outboundBusyCallsDay':_0x20f109[_0x0a9e('0x3a')],'outboundCongestionCallsDay':_0x20f109[_0x0a9e('0x3b')],'outboundDropCallsDayACS':_0x20f109[_0x0a9e('0x3c')],'outboundDropCallsDayCallersExit':_0x20f109[_0x0a9e('0x3d')],'outboundDropCallsDayTimeout':_0x20f109[_0x0a9e('0x3e')],'outboundNoAnswerCallsDay':_0x20f109['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x20f109[_0x0a9e('0x3f')],'outboundOriginateFailureCallsDay':_0x20f109[_0x0a9e('0x40')],'outboundReCallsDay':_0x20f109[_0x0a9e('0x41')],'outboundRejectCallsDay':_0x20f109[_0x0a9e('0x42')],'outboundUnknownCallsDay':_0x20f109['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x20f109[_0x0a9e('0x43')],'predictiveIntervalAnsweredCalls':_0x20f109[_0x0a9e('0x44')],'predictiveIntervalAvgHoldtime':_0x20f109[_0x0a9e('0x45')],'predictiveIntervalAvgTalktime':_0x20f109[_0x0a9e('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x20f109[_0x0a9e('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x20f109[_0x0a9e('0x48')],'predictiveIntervalErlangCalls':_0x20f109[_0x0a9e('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x20f109[_0x0a9e('0x4a')],'predictiveIntervalHitRate':_0x20f109[_0x0a9e('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x20f109['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x20f109[_0x0a9e('0x4c')],'predictiveIntervalAvailable':_0x20f109['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x20f109[_0x0a9e('0x4d')],'message':_0x20f109[_0x0a9e('0x4e')],'originated':_0x20f109[_0x0a9e('0x4f')],'erlangCalls':_0x20f109[_0x0a9e('0x50')],'erlangCallToSecond':_0x20f109[_0x0a9e('0x51')],'erlangAbandonmentRate':_0x20f109['erlangAbandonmentRate'],'erlangBusyFactor':_0x20f109[_0x0a9e('0x52')],'startPredictive':_0x20f109[_0x0a9e('0x53')],'startProgressive':_0x20f109[_0x0a9e('0x54')]};if(_0x20f109[_0x0a9e('0x55')]){_0x3a02e1[_0x0a9e('0x55')]={'id':_0x20f109[_0x0a9e('0x55')]['id'],'name':_0x20f109[_0x0a9e('0x55')][_0x0a9e('0x27')],'active':_0x20f109['Trunk'][_0x0a9e('0x56')],'callerid':_0x20f109['Trunk'][_0x0a9e('0x57')]};}if(_0x20f109[_0x0a9e('0x58')]){_0x3a02e1[_0x0a9e('0x58')]={'id':_0x20f109[_0x0a9e('0x58')]['id'],'name':_0x20f109['Interval'][_0x0a9e('0x27')]};}var _0xd1836d=md5(JSON[_0x0a9e('0x59')](_0x3a02e1));if(_0x20f109[_0x0a9e('0x3')]!==_0xd1836d){_0x20f109['md5']=_0xd1836d;emit(util['format'](_0x0a9e('0x5a'),_0x3a02e1['name']),_0x0a9e('0x5b'),_0x3a02e1);}}}function emitVoiceQueueChannelRemove(_0x3d9717){logger[_0x0a9e('0x5c')](_0x0a9e('0x5d'),JSON['stringify'](_0x3d9717));emit(util[_0x0a9e('0x5e')](_0x0a9e('0x5a'),_0x3d9717[_0x0a9e('0x27')]),'voice_queue_channel:remove',_0x3d9717);io[_0x0a9e('0x5f')](_0x0a9e('0x60'),_0x3d9717);}function notSendMessagesQueue(_0x289467){if(_0x289467['sendMessageOneNotActive']){if(_0x289467['originated']===0x0&&_0x289467[_0x0a9e('0x2b')]===0x0){_0x289467[_0x0a9e('0x61')]=![];_0x289467['available']=0x0;_0x289467[_0x0a9e('0x62')]=0x0;_0x289467[_0x0a9e('0x4e')]=_0x0a9e('0x63');ut[_0x0a9e('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x289467['name']+_0x0a9e('0x65'));}else{_0x289467[_0x0a9e('0x4e')]='IS_DISACTIVED';ut[_0x0a9e('0x64')](_0x0a9e('0x66'),_0x289467[_0x0a9e('0x27')]+'\x20is\x20disactive');}emitCampaignPreview(_0x289467);}}Preview[_0x0a9e('0xe')][_0x0a9e('0x26')]=function(){var _0x274e8e=this;setInterval(function(){_0x274e8e[_0x0a9e('0x67')]();},0x7cf);};Preview[_0x0a9e('0xe')][_0x0a9e('0x67')]=function(){var _0x2881b3=this[_0x0a9e('0x12')];this[_0x0a9e('0x17')]+=0x1;for(var _0x3da2cd in _0x2881b3){if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&(_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')||_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6a'))&&_0x2881b3[_0x3da2cd]['type']==='outbound'){if(this[_0x0a9e('0x17')]>0x7){this[_0x0a9e('0x17')]=0x0;this[_0x0a9e('0x6b')]();}}if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')&&_0x2881b3[_0x3da2cd][_0x0a9e('0x6c')]===_0x0a9e('0x6d')){if(_0x2881b3[_0x3da2cd][_0x0a9e('0x34')]){this[_0x0a9e('0x6e')](_0x2881b3[_0x3da2cd]);if(_0x2881b3[_0x3da2cd][_0x0a9e('0x6f')])this[_0x0a9e('0x70')](_0x2881b3[_0x3da2cd]);}else{notSendMessagesQueue(_0x2881b3[_0x3da2cd]);}}}};Preview['prototype'][_0x0a9e('0x71')]=function(_0x138b8b){var _0xdd268f=this;this[_0x0a9e('0x11')][_0x0a9e('0xf')](function(){if(!_[_0x0a9e('0x72')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b])){loggerAction[_0x0a9e('0x5c')]('[clearZombieChannels][talking]',_0x138b8b,_0x0a9e('0x73'),_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')],_0x0a9e('0x75'),JSON[_0x0a9e('0x59')](_0xdd268f['campaignsPreview'][_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]][_0x0a9e('0x4f')]),_0x0a9e('0x76'),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']][_0x0a9e('0x2b')]),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x77')]),JSON[_0x0a9e('0x59')](_[_0x0a9e('0x78')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b],[_0x0a9e('0x79'),_0x0a9e('0x7a'),'VoiceQueueId',_0x0a9e('0x7b')])));return ami[_0x0a9e('0x7c')]({'action':'status','channel':_0xdd268f['actions'][_0x138b8b]['channel']})[_0x0a9e('0x7d')](function(_0x4317e3){if(_0x4317e3[_0x0a9e('0x4e')]===_0x0a9e('0x7e')){setTimeout(function(){if(_0xdd268f[_0x0a9e('0x15')][_0x138b8b]){ut[_0x0a9e('0x7f')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']],'[clearZombieChannel]');if(_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x77')]===!![]){ut[_0x0a9e('0x80')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')]],_0x0a9e('0x81'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']);}ut[_0x0a9e('0x82')]('[Dialer][checkChannel][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]);delete _0xdd268f[_0x0a9e('0x15')][_0x138b8b];}},0x2328);}});}});};Preview['prototype'][_0x0a9e('0x6b')]=function(){var _0x1bf38a=this;loggerAction['info']('[action]',_[_0x0a9e('0x83')](this[_0x0a9e('0x15')]));for(var _0x49c095 in this[_0x0a9e('0x15')]){if(_0x1bf38a['actions'][_0x0a9e('0x68')](_0x49c095)){_0x1bf38a['clearZombieChannel'](_0x49c095);}}};Preview[_0x0a9e('0xe')]['recallMe']=function(_0x5da27d){var _0x5df0ad=this;rpcDb[_0x0a9e('0x84')](_0x5da27d['id'],ut['agentReadyId'](this[_0x0a9e('0x16')]))[_0x0a9e('0x85')](function(_0x3cfd00){if(!_[_0x0a9e('0x72')](_0x3cfd00)){for(var _0x232830=0x0;_0x232830<_0x3cfd00[_0x0a9e('0x86')];_0x232830+=0x1){if(ut[_0x0a9e('0x87')](_0x3cfd00[_0x232830][_0x0a9e('0x88')])<_0x5da27d['dialRecallMeTimeout']*0x3c){if(_0x3cfd00[_0x232830][_0x0a9e('0x89')]&&!_0x3cfd00[_0x232830][_0x0a9e('0x89')][_0x0a9e('0x8a')]){_0x5df0ad[_0x0a9e('0x8b')](_0x3cfd00[_0x232830]['id'])[_0x0a9e('0x85')](ut[_0x0a9e('0x8c')]('[RecallMe]'))[_0x0a9e('0x7d')](ut[_0x0a9e('0x8c')]('[RecallMe]'));}else{rpcDb[_0x0a9e('0x8d')](_0x3cfd00[_0x232830]['id']);}}else{var _0x5cc8fb=new Action(_0x3cfd00[_0x232830],_0x5da27d);_0x5cc8fb[_0x0a9e('0x8e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5da27d['outboundReCallsDay']+=0x1;ut[_0x0a9e('0x8f')](_0x5cc8fb,0x17,'RecallInQueue');if(_0x5da27d[_0x0a9e('0x90')]){rpcDb[_0x0a9e('0x91')](ut[_0x0a9e('0x92')](_0x3cfd00[_0x232830]));rpcDb[_0x0a9e('0x93')](_0x5cc8fb,_0x0a9e('0x94'));}else{ut[_0x0a9e('0x8f')](_0x5cc8fb,0x16,'RecallFailedTimeout');rpcDb[_0x0a9e('0x93')](_0x5cc8fb,'[HistoryRecallClose]');rpcDb[_0x0a9e('0x95')](_0x5cc8fb,_0x0a9e('0x96'));}}}}})[_0x0a9e('0x7d')](ut['logger2'](_0x0a9e('0x97')));};Preview[_0x0a9e('0xe')][_0x0a9e('0x6e')]=function(_0x32e134){_0x32e134['sendMessageOneNotActive']=!![];if(ut[_0x0a9e('0x98')](_0x32e134[_0x0a9e('0x2a')])){_0x32e134['message']=_0x0a9e('0x99');}else if(!ut[_0x0a9e('0x9a')](_0x32e134[_0x0a9e('0x34')])){_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x63');}else if(!this['isTrunkReachable'](_0x32e134[_0x0a9e('0x55')])){if(!this[_0x0a9e('0x9b')](_0x32e134[_0x0a9e('0x9c')])){_0x32e134['message']=_0x0a9e('0x9d');}else{_0x32e134['message']='ACTIVE';}}else{_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x9e');}emitCampaignPreview(_0x32e134);};Preview[_0x0a9e('0xe')][_0x0a9e('0x9f')]=function(_0x186f39,_0xc8c264,_0x387489){var _0x54a37d=this;var _0x2d7205=this[_0x0a9e('0x15')][_0xc8c264];var _0x2e89b7=this[_0x0a9e('0x12')][_0x2d7205[_0x0a9e('0x74')]];var _0x2b8192;var _0x320898=![];var _0x412a72=0x2;var _0x2a28c0=0x3;if(_0x2e89b7){switch(_0x387489){case'1':_0x2e89b7[_0x0a9e('0x3f')]+=0x1;_0x2d7205['countnosuchnumberretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x0,'NoSuchNumber');ami[_0x0a9e('0x5f')](_0x0a9e('0xa2'),ut['buildObj'](_0x2d7205,_0x0a9e('0xa3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xa4'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'0',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a43a8){_0x320898=_0x4a43a8['additional']==0x1;_0x412a72=_0x2e89b7['dialNoSuchNumberRetryFrequency'];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xaa'));}else{if(_0x2d7205[_0x0a9e('0xab')]>=_0x2e89b7['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xaa'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xab'),_0x2e89b7['dialNoSuchNumberRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];}else{_0x2d7205[_0x0a9e('0xab')]++;logger[_0x0a9e('0x5c')](_0x0a9e('0xb0'),_0x2d7205['countnosuchnumberretry']);logger[_0x0a9e('0x5c')]('id',_0x2d7205[_0x0a9e('0xb1')]);_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnosuchnumberretry':_0x2d7205['countnosuchnumberretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xb4'):var _0x4abc8f=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));_0x2d7205[_0x0a9e('0xb6')]=_0x4abc8f;_0x2d7205[_0x0a9e('0xb7')]=_0x4abc8f;_0x2d7205[_0x0a9e('0x77')]=!![];_0x2e89b7[_0x0a9e('0x2b')]+=0x1;logger[_0x0a9e('0x5c')](_0x0a9e('0xb8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7[_0x0a9e('0x2b')]);ami[_0x0a9e('0x5f')]('custom:agentconnect',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xbc'),this[_0x0a9e('0x12')][_0x2d7205['queue']]));if(_0x2e89b7[_0x0a9e('0xbd')]){ami[_0x0a9e('0x5f')](_0x0a9e('0xbe'),ut[_0x0a9e('0xbf')](_0x2d7205));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc0'),this['campaignsPreview'][_0x2d7205[_0x0a9e('0x74')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2d7205,_0x0a9e('0xc0')));_0x2e89b7[_0x0a9e('0x38')]+=0x1;_0x2e89b7['total']+=0x1;_0x2e89b7[_0x0a9e('0x29')]+=0x1;ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xc1'));_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x4,_0x0a9e('0xc2'));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xc3'));rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xc4'));rpcDb[_0x0a9e('0xc5')](_0x2d7205);_0x2e89b7['sumDuration']+=_0x2d7205[_0x0a9e('0xc6')];_0x2e89b7[_0x0a9e('0x2c')]+=_0x2d7205['talktime'];logger[_0x0a9e('0x5c')]('[syncHangup][talking][decrement]',_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7['pTalking']);delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;case _0x0a9e('0xc7'):_0x2e89b7[_0x0a9e('0x3a')]+=0x1;_0x2d7205['countbusyretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x5,'Busy');_0x412a72=_0x2e89b7[_0x0a9e('0xc8')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentbusy',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc9')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xca'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'5',_0x2e89b7)[_0x0a9e('0x85')](function(_0x5a8854){_0x320898=_0x5a8854[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut['totalGlobal'](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2d7205[_0x0a9e('0xcc')]>=_0x2e89b7[_0x0a9e('0xcd')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xcc'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xcc')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countbusyretry':_0x2d7205[_0x0a9e('0xcc')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xcf'):_0x2e89b7[_0x0a9e('0xd0')]+=0x1;_0x2d7205['countnoanswerretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x3,_0x0a9e('0xd1'));_0x412a72=_0x2e89b7[_0x0a9e('0xd2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')](_0x0a9e('0xd3'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xd4')));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xd5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'3',_0x2e89b7)[_0x0a9e('0x85')](function(_0x30ef6e){_0x320898=_0x30ef6e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xd6'));}else{if(_0x2d7205[_0x0a9e('0xd7')]>=_0x2e89b7[_0x0a9e('0xd8')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xd5'));}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xd7'),_0x2e89b7[_0x0a9e('0xd2')]),_0x2d7205['unlockAgent'],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205['countnoanswerretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xd9'):_0x2e89b7['outboundCongestionCallsDay']+=0x1;_0x2d7205[_0x0a9e('0xda')]+=0x1;_0x2d7205['countglobal']=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x8,'Congestion');_0x412a72=_0x2e89b7[_0x0a9e('0xdb')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')]('custom:agentcongestion',ut['buildObj'](_0x2d7205,_0x0a9e('0xdc')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xdd'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'8',_0x2e89b7)[_0x0a9e('0x85')](function(_0x2450a8){_0x320898=_0x2450a8[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut['cloneAction'](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb['createCustomerFinal'](_0x2b8192,_0x0a9e('0xde'));}else{if(_0x2d7205[_0x0a9e('0xda')]>=_0x2e89b7[_0x0a9e('0xdf')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xdd'));}else{rpcDb['rescheduleContact'](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xda'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205['countcongestionretry']++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countcongestionretry':_0x2d7205['countcongestionretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xe0'):_0x2e89b7[_0x0a9e('0x42')]+=0x1;_0x2d7205[_0x0a9e('0xe1')]+=0x1;_0x2d7205['countglobal']=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x14,'AgentReject');_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami[_0x0a9e('0x5f')]('custom:agentreject',ut['buildObj'](_0x2d7205,_0x0a9e('0xe3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,'[syncHangupRequest][logAgentReject]');_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x15c6b9){_0x320898=_0x15c6b9[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut['cloneAction'](_0x2d7205,0x14,_0x0a9e('0xe4'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xe5'));}else{if(_0x2d7205[_0x0a9e('0xe1')]>=_0x2e89b7[_0x0a9e('0xe6')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xe5'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe1'),_0x2e89b7[_0x0a9e('0xe2')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});break;case _0x0a9e('0xe7'):_0x2e89b7[_0x0a9e('0x43')]+=0x1;_0x2d7205[_0x0a9e('0xe8')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0xb,'Abandoned');rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xe9'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'11',_0x2e89b7)[_0x0a9e('0x85')](function(_0x34f7b5){_0x320898=_0x34f7b5['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2d7205[_0x0a9e('0xea')]>=_0x2e89b7['dialAbandonedMaxRety']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xe9'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe8'),_0x2e89b7['dialAbandonedRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case'18':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xec')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x12,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit']('custom:amd',ut[_0x0a9e('0xbb')](_0x2d7205,'amd'));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xef'));_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0xe2b083){_0x320898=_0xe2b083[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0x12,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xef'));}else{rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xef'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];break;case'19':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x13,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit'](_0x0a9e('0xf0'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xf1')));rpcDb['createCustomerHistory'](_0x2d7205,'[callProgressDetectingCustomer][machine]');_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a70ce){_0x320898=_0x4a70ce['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf2'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf2'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;default:if(_0x2d7205[_0x0a9e('0x77')]){ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xf3'));ut[_0x0a9e('0x82')](_0x0a9e('0xf4')+_0x2e89b7['name'],_0x186f39);}_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0xc,_0x186f39['cause-txt']||_0x186f39[_0x0a9e('0xee')]);_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xf5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x25931e){_0x320898=_0x25931e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf6'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf6'));}delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];}else{_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(_0xd2391){});}});}if(!(_0x2d7205[_0x0a9e('0x77')]&&_0x387489==='16')){ut['updateOriginated'](_0x2e89b7,_0x0a9e('0xf7'));logger[_0x0a9e('0x5c')](_0x0a9e('0xf8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x2e89b7[_0x0a9e('0x4f')]);}if(_0x387489!==_0x0a9e('0xb4')){delete this[_0x0a9e('0x15')][_0x186f39['linkedid']];delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xf9')]];}}};Preview[_0x0a9e('0xe')][_0x0a9e('0xfa')]=function(_0x2b624e,_0x3942fd,_0x5cb48d){if(_[_0x0a9e('0xfb')](_0x3942fd)&&'object'!==typeof _0x3942fd){return;}if(_['isUndefined'](_0x5cb48d)&&'object'!==typeof _0x5cb48d){return;}switch(_0x5cb48d[_0x0a9e('0xfc')]){case'0':ut[_0x0a9e('0xfd')](_0x2b624e,0x0,_0x0a9e('0xfe'));rpcDb[_0x0a9e('0xff')](_0x2b624e,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0a9e('0xfd')](_0x2b624e,0x3,_0x0a9e('0xd1'));rpcDb[_0x0a9e('0xff')](_0x2b624e,_0x0a9e('0x100'));break;case'5':ut[_0x0a9e('0xfd')](_0x2b624e,0x5,'Busy');rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x101'));break;case'8':ut[_0x0a9e('0xfd')](_0x2b624e,0x8,_0x0a9e('0x102'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));break;case'22':ut[_0x0a9e('0xfd')](_0x2b624e,0x16,_0x0a9e('0x104'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x105'));break;default:ut[_0x0a9e('0xfd')](_0x2b624e,0xc,_0x5cb48d[_0x0a9e('0xfc')]);rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));}ut[_0x0a9e('0x7f')](_0x3942fd,_0x0a9e('0x106'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x2b624e['uniqueid'],_0x0a9e('0xba'),_0x3942fd[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x3942fd[_0x0a9e('0x4f')]);delete this['actions'][_0x2b624e[_0x0a9e('0xb9')]];};Preview['prototype'][_0x0a9e('0xa5')]=function(_0x2ff2ab,_0x242f23,_0x57f673){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xa5')](_0x2ff2ab,_0x242f23,_0x57f673))['catch'](logger[_0x0a9e('0x5c')]('[verifyAdditionalPhone]\x20'));};Preview[_0x0a9e('0xe')]['swapAdditionalPhones']=function(_0x41b90a,_0x57b7d4,_0xb14971){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb3')](_0x41b90a,_0x57b7d4,_0xb14971))[_0x0a9e('0x7d')](logger[_0x0a9e('0x5c')](_0x0a9e('0x108')));};Preview['prototype'][_0x0a9e('0xb2')]=function(_0x1c9ea2){return BPromise['resolve']()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb2')](_0x1c9ea2))['catch'](logger[_0x0a9e('0x5c')](_0x0a9e('0x109')));};Preview[_0x0a9e('0xe')]['checkInBlack']=function(_0x3766d7,_0xf49ed4,_0xdeb5e4,_0x3f0d64,_0x2003bc){var _0x29fdfe=this;return new BPromise(function(_0x3ba897,_0x74d9b8){if(_[_0x0a9e('0x72')](_0xf49ed4)||_[_0x0a9e('0x72')](_0xf49ed4['Contact'])||_[_0x0a9e('0x72')](_0xf49ed4['phone'])||_[_0x0a9e('0x72')](_0xf49ed4[_0x0a9e('0x10a')])){_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x10b'),_0x3f0d64,_0x2003bc));return;}var _0x5d577b=uuid['v4']();var _0x2d45db=_0x29fdfe['campaignsPreview'][_0xf49ed4[_0x0a9e('0x73')][_0x0a9e('0x27')]];var _0x2977a7=_0xdeb5e4?_0x29fdfe['agents'][_0xdeb5e4]['id']:undefined;_0x29fdfe[_0x0a9e('0x15')][_0x5d577b]=new Action(_0xf49ed4,_0x2d45db,_0x5d577b,_0xdeb5e4,_0x2977a7);var _0x402544=_0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x402544[_0x0a9e('0xad')]=_0x3f0d64;_0x402544[_0x0a9e('0xae')]=_0x2003bc;_0x402544[_0x0a9e('0x10c')]=_0xdeb5e4;if(_[_0x0a9e('0x10d')](_0x3766d7)){_0x29fdfe['execCall'](_0x402544,_0x2d45db,_0xf49ed4,_0xdeb5e4)[_0x0a9e('0x85')](function(_0x228c10){logger[_0x0a9e('0x5c')](_0x0a9e('0x10e'),_0x0a9e('0x10f')+_0x402544[_0x0a9e('0x74')]+_0x0a9e('0x110')+_0x402544['idContact'],JSON['stringify'](_0x228c10));ami[_0x0a9e('0x5f')](_0x0a9e('0x111'),ut[_0x0a9e('0xbb')](_0x402544,_0x0a9e('0x112'),_0x29fdfe[_0x0a9e('0x12')][_0x402544[_0x0a9e('0x74')]]));_0x3ba897(ut[_0x0a9e('0x4e')]('Calling'));})[_0x0a9e('0x7d')](function(_0x1d7fc4){ut[_0x0a9e('0x64')](_0x0a9e('0x113'),_0x1d7fc4);_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x114'),_0x3f0d64,_0x2003bc));});}else{_0x2d45db[_0x0a9e('0x39')]+=0x1;ut['logBlacklist'](_0x402544);rpcDb[_0x0a9e('0x115')](_0x402544,_0x0a9e('0x116'));delete _0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x74d9b8(ut['message'](_0x0a9e('0x117'),_0x3f0d64,_0x2003bc));}});};Preview[_0x0a9e('0xe')][_0x0a9e('0x9b')]=function(_0x292f02){return!_['isNil'](_0x292f02)&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x27')])&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x56')])&&_0x292f02[_0x0a9e('0x56')]&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])])&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02['name'])][_0x0a9e('0x118')])&&(this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])][_0x0a9e('0x118')]==='reachable'||this[_0x0a9e('0x14')][util['format'](_0x0a9e('0x119'),_0x292f02['name'])]['status']==='unmonitored');};Preview[_0x0a9e('0xe')][_0x0a9e('0x8b')]=function(_0x19f800,_0x20007e){var _0x7d59a9=this;return new BPromise(function(_0xe17af8,_0x48fbef){_0x7d59a9[_0x0a9e('0x11a')](_0x19f800,_0x20007e)[_0x0a9e('0x85')](function(_0x1713a7){_0xe17af8(_[_0x0a9e('0x78')](_0x1713a7,[_0x0a9e('0x4e')]));})[_0x0a9e('0x7d')](function(_0x31c937){if(_0x31c937['unlock']){rpcDb['unlockContact'](_0x19f800);}if(_0x31c937[_0x0a9e('0x56')]){rpcDb['disableContact'](_0x19f800);}_0x48fbef(_[_0x0a9e('0x78')](_0x31c937,[_0x0a9e('0x4e')]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11a')]=function(_0x37a448,_0x383dd8){var _0x594f25=this;return new BPromise(function(_0x4716d1,_0x59b872){var _0x50e32a,_0x504403;rpcDb['getContactPreview'](_0x37a448)[_0x0a9e('0x85')](function(_0x5dc978){if(!_['isNil'](_0x5dc978[0x0])){_0x504403=_0x5dc978[0x0][_0x0a9e('0x11b')]?![]:!![];_0x50e32a=_0x5dc978[0x0]['recallme']?!![]:![];_0x50e32a=_0x383dd8?!![]:_0x50e32a;}var _0x24470a=_0x594f25[_0x0a9e('0x11c')](_0x5dc978);if(_0x24470a[_0x0a9e('0x11d')]){rpcDb['checkIsBlackList'](_[_0x0a9e('0x78')](_0x5dc978[0x0],[_0x0a9e('0x10a'),_0x0a9e('0x11e')]))['then'](function(_0x5236c9){_0x594f25[_0x0a9e('0x11f')](_0x5236c9,_0x5dc978[0x0],_0x383dd8,_0x504403,_0x50e32a)[_0x0a9e('0x85')](function(_0x89d2cb){_0x4716d1(_0x89d2cb);})[_0x0a9e('0x7d')](function(_0x3b0db2){_0x59b872(_0x3b0db2);});})[_0x0a9e('0x7d')](function(_0x247a6c){ut[_0x0a9e('0x64')](_0x0a9e('0x120'),_0x247a6c);_0x59b872(ut[_0x0a9e('0x4e')]('Call\x20unsuccessful',_0x504403,_0x50e32a));});}else{_0x59b872(ut['message'](_0x24470a['message'],_0x504403,_0x50e32a));}})[_0x0a9e('0x7d')](function(_0x19dcc2){ut[_0x0a9e('0x64')](_0x0a9e('0x121'),_0x19dcc2);_0x59b872(ut[_0x0a9e('0x4e')](_0x0a9e('0x122'),![],!![]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11c')]=function(_0x5d74e9){if(_['isNil'](_0x5d74e9)||_[_0x0a9e('0x10d')](_0x5d74e9)||!_[_0x0a9e('0x72')](_0x5d74e9[0x0]['Agent'])&&_[_0x0a9e('0x72')](_0x5d74e9[0x0][_0x0a9e('0x89')][_0x0a9e('0x27')])){ut[_0x0a9e('0x64')](_0x0a9e('0x123'),_0x5d74e9);return{'isValid':![],'message':_0x0a9e('0x124')};}var _0x167196=this[_0x0a9e('0x12')][_0x5d74e9[0x0][_0x0a9e('0x73')][_0x0a9e('0x27')]];_0x167196[_0x0a9e('0x4e')]=_0x0a9e('0x9e');if(_['isNil'](_0x167196)){ut[_0x0a9e('0x64')](_0x0a9e('0x125'),_0x167196);return{'isValid':![],'message':_0x0a9e('0x126')};}if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x55')])){ut[_0x0a9e('0x64')](_0x0a9e('0x127'),_0x0a9e('0x128')+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x129'));if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x9c')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12a'));return{'isValid':![],'message':_0x0a9e('0x12b')};}}if(!ut[_0x0a9e('0x9a')](_0x167196[_0x0a9e('0x34')])){ut[_0x0a9e('0x64')](_0x0a9e('0x12c'),_0x167196['name']+_0x0a9e('0x12d'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12d')};}return{'isValid':!![],'message':_0x0a9e('0x12e')};};Preview[_0x0a9e('0xe')][_0x0a9e('0x12f')]=function(_0x358f74,_0x465003,_0x261eca,_0xa7a754){var _0x32a199=this;return new BPromise(function(_0x39d367,_0x8231e5){var _0x43111e=_0x358f74[_0x0a9e('0xb9')];var _0x3c8a9a=_0x32a199[_0x0a9e('0x9b')](_0x465003['Trunk'])?util['format'](_0x0a9e('0x130'),_0x465003[_0x0a9e('0x55')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003['dialCutDigit']>0x0?_0x261eca[_0x0a9e('0x11e')]['substring'](_0x465003[_0x0a9e('0x133')]):_0x261eca['phone']):util[_0x0a9e('0x5e')]('SIP/%s/%s%s',_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['name']:_0x465003[_0x0a9e('0x9c')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003[_0x0a9e('0x133')]>0x0?_0x261eca[_0x0a9e('0x11e')][_0x0a9e('0x134')](_0x465003[_0x0a9e('0x133')]):_0x261eca[_0x0a9e('0x11e')]);var _0x1a3143=_0x32a199[_0x0a9e('0x9b')](_0x465003[_0x0a9e('0x55')])?ut[_0x0a9e('0x135')](_0x465003[_0x0a9e('0x55')][_0x0a9e('0x57')],_0x465003[_0x0a9e('0x35')],_0x465003[_0x0a9e('0x136')]>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003['dialOriginateCallerIdNumber']):ut[_0x0a9e('0x135')](_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['callerid']:_0x465003['TrunkBackup']['callerid'],_0x465003[_0x0a9e('0x35')],_0x465003['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003[_0x0a9e('0x138')]);if(_0x1a3143){_0x358f74[_0x0a9e('0x139')]=ut[_0x0a9e('0x13a')](_0x1a3143);_0x358f74[_0x0a9e('0x13b')]=ut[_0x0a9e('0x13c')](_0x1a3143);}var _0x2154d8=ut[_0x0a9e('0x13d')](_0x465003,_0x261eca,_0x3c8a9a,_0x1a3143,_0x43111e,_0x358f74);_['merge'](_0x358f74,ut[_0x0a9e('0x13e')](_0x2154d8));_0x358f74['starttime']=moment()[_0x0a9e('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x0a9e('0x7c')](ut[_0x0a9e('0x13f')](_0x358f74,_0x465003,_0x2154d8,_0x358f74[_0x0a9e('0xae')],_0xa7a754))['then'](function(_0x920ad8){_0x465003[_0x0a9e('0x4f')]+=0x1;logger['info']('[originated][increment]',_0x43111e,_0x0a9e('0xba'),_0x465003[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x465003['originated']);_0x39d367(_0x920ad8);})['catch'](function(_0x4869c1){ut[_0x0a9e('0xfd')](_0x358f74,0xe,_0x0a9e('0x140'));rpcDb[_0x0a9e('0xff')](_0x358f74,_0x0a9e('0x141'));_0x8231e5(_0x4869c1);});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x142')]=function(_0x183b9b){if(this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]]){this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]][_0x0a9e('0x143')]=_0x183b9b[_0x0a9e('0x143')];}};Preview[_0x0a9e('0xe')][_0x0a9e('0x19')]=function(_0x1a74c4){var _0x94e69b=this;var _0x320367=this['actions'][_0x1a74c4[_0x0a9e('0x144')]];if(_0x320367){if(_0x320367[_0x0a9e('0x10c')]&&this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]){ut[_0x0a9e('0x145')](_0x320367,this[_0x0a9e('0x16')][_0x320367['lookAgent']][_0x0a9e('0x27')],this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]['id']);}var _0x1109de=_[_0x0a9e('0x146')](_0x320367);_0x1109de[_0x0a9e('0xb6')]=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));var _0x4175a6=_0x94e69b['campaignsPreview'][_0x320367['queue']];if(ut[_0x0a9e('0x147')](_0x1a74c4[_0x0a9e('0x148')])){if(_0x320367['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x320367[_0x0a9e('0xb1')]);}if(_0x320367['activeContact']){rpcDb[_0x0a9e('0x8d')](_0x320367['idContact']);}ami[_0x0a9e('0x5f')](_0x0a9e('0x14a'),ut['buildObj'](_0x320367,_0x0a9e('0x14b'),this[_0x0a9e('0x12')][_0x320367['queue']]));this[_0x0a9e('0xfa')](_0x1109de,_0x4175a6,_0x1a74c4);}else{_0x320367[_0x0a9e('0x8e')]=moment()['format'](_0x0a9e('0xb5'));ut[_0x0a9e('0xfd')](_0x1109de,0x4,_0x0a9e('0xc2'));rpcDb[_0x0a9e('0xff')](_0x1109de,_0x0a9e('0x14c'));}}};Preview[_0x0a9e('0xe')]['syncHangup']=function(_0x1e5b09){var _0x36dc4f=this;var _0x51e697=this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]];var _0x22c390;if(_0x51e697){_0x22c390=this[_0x0a9e('0x12')][_0x51e697[_0x0a9e('0x74')]];logger[_0x0a9e('0x5c')](_0x0a9e('0x14d'),_0x1e5b09['linkedid'],'\x20Queue',_0x22c390['name'],'pTalking:\x20',_0x22c390['pTalking']);}if(this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]]&&_0x1e5b09['linkedid']!==_0x1e5b09['uniqueid']){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this[_0x0a9e('0x15')][_0x1e5b09['linkedid']][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')]('[syncHangup][talking][cause]',_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390[_0x0a9e('0x2b')]);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09['linkedid'],_0x1e5b09[_0x0a9e('0x14e')]);}}else if(_0x51e697&&_['isNil'](_0x51e697[_0x0a9e('0x14f')])&&_0x22c390[_0x0a9e('0x150')]&&_0x1e5b09['linkedid']===_0x1e5b09[_0x0a9e('0xb9')]&&_[_0x0a9e('0x72')](_0x1e5b09['reason'])&&_0x1e5b09[_0x0a9e('0x14e')]==='16'&&_0x1e5b09['channelstate']==='6'&&_[_0x0a9e('0xfb')](_0x51e697[_0x0a9e('0x151')])){if(_0x51e697['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x51e697['idContact']);}if(_0x51e697[_0x0a9e('0xae')]){rpcDb[_0x0a9e('0x8d')](_0x51e697[_0x0a9e('0xb1')]);}_0x1e5b09[_0x0a9e('0xfc')]='22';this[_0x0a9e('0xfa')](_0x51e697,_0x22c390,_0x1e5b09);}else if(_0x51e697&&_0x51e697[_0x0a9e('0x151')]){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x152'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09['cause'],_0x0a9e('0xba'),_0x22c390['name'],'pTalking:\x20',_0x22c390[_0x0a9e('0x2b')]);this['callProgressDetectingCustomer'](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x153'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390['pTalking']);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')]['syncDialEnd']=function(_0x38d95a){if(this[_0x0a9e('0x15')][_0x38d95a[_0x0a9e('0xf9')]]&&_0x38d95a['destlinkedid']!==_0x38d95a[_0x0a9e('0x154')]){this[_0x0a9e('0x9f')](_0x38d95a,_0x38d95a[_0x0a9e('0xf9')],_0x38d95a['dialstatus']);}};Preview[_0x0a9e('0xe')]['syncHangupRequest']=function(_0x2394f2){if(this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]&&_0x2394f2[_0x0a9e('0xaf')]!==_0x2394f2[_0x0a9e('0xb9')]&&!this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]['dialAnswer']){if(_0x2394f2[_0x0a9e('0x14e')]==='1'){this[_0x0a9e('0x9f')](_0x2394f2,_0x2394f2[_0x0a9e('0xaf')],_0x2394f2[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')][_0x0a9e('0x155')]=function(_0x3a4def,_0x2670f5,_0x2310ca){if(this[_0x0a9e('0x15')][_0x3a4def]){if(_[_0x0a9e('0x72')](this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')])){this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')]={};}this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')][_0x2670f5]=_0x2310ca;}};Preview[_0x0a9e('0xe')][_0x0a9e('0x21')]=function(_0x611e46){try{if(!_[_0x0a9e('0x72')](_0x611e46)){if(ut[_0x0a9e('0x157')](_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0])){this[_0x0a9e('0x155')](_0x611e46[_0x0a9e('0xb9')],_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0],_0x611e46[_0x0a9e('0x159')]);}}}catch(_0x4c925e){logger[_0x0a9e('0x15a')](_0x0a9e('0x15b'),util[_0x0a9e('0x15c')](_0x4c925e,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xe')][_0x0a9e('0x23')]=function(_0xb09ef6){if(_0xb09ef6){if(this[_0x0a9e('0x15')][_0xb09ef6[_0x0a9e('0x15d')]]){this['actions'][_0xb09ef6[_0x0a9e('0x15d')]][_0x0a9e('0x151')]=!![];}}};Preview['prototype'][_0x0a9e('0x25')]=function(_0x2db8fe){if(_0x2db8fe){if(this[_0x0a9e('0x15')][_0x2db8fe['transfererlinkedid']]){this[_0x0a9e('0x15')][_0x2db8fe[_0x0a9e('0x15e')]][_0x0a9e('0x151')]=!![];}}};module[_0x0a9e('0x15f')]=Preview; \ No newline at end of file +var _0xa9e0=['outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','hasOwnProperty','dialMethod','booked','clearZombieChannels','type','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','Action','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','disableContact','starttime','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusy]','additional','countbusyretry','dialBusyMaxRetry','scheduledAt','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','dialCongestionRetryFrequency','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','dialAgentRejectRetryFrequency','agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','resolve','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','status','SIP/%s','execRun','recallme','validateContact','isValid','phone','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','filterKey','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','defaults','socket.io-emitter','redis','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS'];(function(_0x234ae1,_0x42bdd6){var _0x227ba0=function(_0x1f6531){while(--_0x1f6531){_0x234ae1['push'](_0x234ae1['shift']());}};_0x227ba0(++_0x42bdd6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x0a9e('0x3'));var Redis=require('ioredis');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x7'));var ami=require('../ami');var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require(_0x0a9e('0x9'));var Action=require(_0x0a9e('0xa'));var ut=require('./util/util');config['redis']=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0xc'))(new Redis(config[_0x0a9e('0xd')]));var Sequence=function(){};Sequence[_0x0a9e('0xe')][_0x0a9e('0xf')]=function(_0xfeb75b){this[_0x0a9e('0x10')]=this['tail']?this['tail']['finally'](_0xfeb75b):_0xfeb75b();};function Preview(_0x4cfe67){this[_0x0a9e('0x11')]=new Sequence();this[_0x0a9e('0x12')]=_0x4cfe67[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x4cfe67[_0x0a9e('0x14')];this[_0x0a9e('0x15')]={};this['agents']=_0x4cfe67[_0x0a9e('0x16')];this[_0x0a9e('0x17')]=0x0;ami['on'](_0x0a9e('0x18'),this[_0x0a9e('0x19')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x1b'),this['syncHangup'][_0x0a9e('0x1a')](this));ami['on']('hanguprequest',this[_0x0a9e('0x1c')]['bind'](this));ami['on'](_0x0a9e('0x1d'),this[_0x0a9e('0x1e')]['bind'](this));ami['on'](_0x0a9e('0x1f'),this['syncNewExten'][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x1a')](this));ami['on'](_0x0a9e('0x24'),this[_0x0a9e('0x25')][_0x0a9e('0x1a')](this));this[_0x0a9e('0x26')](this[_0x0a9e('0x12')]);}function emit(_0x4bb1e3,_0x2c3407,_0x155cce){io['to'](_0x4bb1e3)['emit'](_0x2c3407,_0x155cce);}function emitCampaignPreview(_0x20f109){if(_0x20f109['type']==='outbound'){var _0x3a02e1={'id':_0x20f109['id'],'name':_0x20f109[_0x0a9e('0x27')],'strategy':_0x20f109[_0x0a9e('0x28')],'answered':_0x20f109[_0x0a9e('0x29')],'available':_0x20f109['available'],'loggedIn':_0x20f109[_0x0a9e('0x2a')],'pTalking':_0x20f109[_0x0a9e('0x2b')],'sumBillable':_0x20f109[_0x0a9e('0x2c')],'sumDuration':_0x20f109[_0x0a9e('0x2d')],'sumHoldTime':_0x20f109[_0x0a9e('0x2e')]||0x0,'talking':_0x20f109[_0x0a9e('0x2f')],'total':_0x20f109[_0x0a9e('0x30')],'type':_0x20f109['type'],'unmanaged':_0x20f109['unmanaged'],'abandoned':_0x20f109[_0x0a9e('0x31')],'waiting':_0x20f109[_0x0a9e('0x32')],'loggedInDb':_0x20f109[_0x0a9e('0x33')],'dialActive':_0x20f109[_0x0a9e('0x34')],'dialMethod':_0x20f109['dialMethod'],'dialOriginateCallerIdName':_0x20f109[_0x0a9e('0x35')],'dialOriginateCallerIdNumber':_0x20f109['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x20f109[_0x0a9e('0x36')],'dialPrefix':_0x20f109['dialPrefix'],'outboundAnswerAgiCallsDay':_0x20f109[_0x0a9e('0x37')],'outboundAnswerCallsDay':_0x20f109[_0x0a9e('0x38')],'outboundBlacklistCallsDay':_0x20f109[_0x0a9e('0x39')],'outboundBusyCallsDay':_0x20f109[_0x0a9e('0x3a')],'outboundCongestionCallsDay':_0x20f109[_0x0a9e('0x3b')],'outboundDropCallsDayACS':_0x20f109[_0x0a9e('0x3c')],'outboundDropCallsDayCallersExit':_0x20f109[_0x0a9e('0x3d')],'outboundDropCallsDayTimeout':_0x20f109[_0x0a9e('0x3e')],'outboundNoAnswerCallsDay':_0x20f109['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x20f109[_0x0a9e('0x3f')],'outboundOriginateFailureCallsDay':_0x20f109[_0x0a9e('0x40')],'outboundReCallsDay':_0x20f109[_0x0a9e('0x41')],'outboundRejectCallsDay':_0x20f109[_0x0a9e('0x42')],'outboundUnknownCallsDay':_0x20f109['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x20f109[_0x0a9e('0x43')],'predictiveIntervalAnsweredCalls':_0x20f109[_0x0a9e('0x44')],'predictiveIntervalAvgHoldtime':_0x20f109[_0x0a9e('0x45')],'predictiveIntervalAvgTalktime':_0x20f109[_0x0a9e('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x20f109[_0x0a9e('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x20f109[_0x0a9e('0x48')],'predictiveIntervalErlangCalls':_0x20f109[_0x0a9e('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x20f109[_0x0a9e('0x4a')],'predictiveIntervalHitRate':_0x20f109[_0x0a9e('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x20f109['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x20f109[_0x0a9e('0x4c')],'predictiveIntervalAvailable':_0x20f109['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x20f109[_0x0a9e('0x4d')],'message':_0x20f109[_0x0a9e('0x4e')],'originated':_0x20f109[_0x0a9e('0x4f')],'erlangCalls':_0x20f109[_0x0a9e('0x50')],'erlangCallToSecond':_0x20f109[_0x0a9e('0x51')],'erlangAbandonmentRate':_0x20f109['erlangAbandonmentRate'],'erlangBusyFactor':_0x20f109[_0x0a9e('0x52')],'startPredictive':_0x20f109[_0x0a9e('0x53')],'startProgressive':_0x20f109[_0x0a9e('0x54')]};if(_0x20f109[_0x0a9e('0x55')]){_0x3a02e1[_0x0a9e('0x55')]={'id':_0x20f109[_0x0a9e('0x55')]['id'],'name':_0x20f109[_0x0a9e('0x55')][_0x0a9e('0x27')],'active':_0x20f109['Trunk'][_0x0a9e('0x56')],'callerid':_0x20f109['Trunk'][_0x0a9e('0x57')]};}if(_0x20f109[_0x0a9e('0x58')]){_0x3a02e1[_0x0a9e('0x58')]={'id':_0x20f109[_0x0a9e('0x58')]['id'],'name':_0x20f109['Interval'][_0x0a9e('0x27')]};}var _0xd1836d=md5(JSON[_0x0a9e('0x59')](_0x3a02e1));if(_0x20f109[_0x0a9e('0x3')]!==_0xd1836d){_0x20f109['md5']=_0xd1836d;emit(util['format'](_0x0a9e('0x5a'),_0x3a02e1['name']),_0x0a9e('0x5b'),_0x3a02e1);}}}function emitVoiceQueueChannelRemove(_0x3d9717){logger[_0x0a9e('0x5c')](_0x0a9e('0x5d'),JSON['stringify'](_0x3d9717));emit(util[_0x0a9e('0x5e')](_0x0a9e('0x5a'),_0x3d9717[_0x0a9e('0x27')]),'voice_queue_channel:remove',_0x3d9717);io[_0x0a9e('0x5f')](_0x0a9e('0x60'),_0x3d9717);}function notSendMessagesQueue(_0x289467){if(_0x289467['sendMessageOneNotActive']){if(_0x289467['originated']===0x0&&_0x289467[_0x0a9e('0x2b')]===0x0){_0x289467[_0x0a9e('0x61')]=![];_0x289467['available']=0x0;_0x289467[_0x0a9e('0x62')]=0x0;_0x289467[_0x0a9e('0x4e')]=_0x0a9e('0x63');ut[_0x0a9e('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x289467['name']+_0x0a9e('0x65'));}else{_0x289467[_0x0a9e('0x4e')]='IS_DISACTIVED';ut[_0x0a9e('0x64')](_0x0a9e('0x66'),_0x289467[_0x0a9e('0x27')]+'\x20is\x20disactive');}emitCampaignPreview(_0x289467);}}Preview[_0x0a9e('0xe')][_0x0a9e('0x26')]=function(){var _0x274e8e=this;setInterval(function(){_0x274e8e[_0x0a9e('0x67')]();},0x7cf);};Preview[_0x0a9e('0xe')][_0x0a9e('0x67')]=function(){var _0x2881b3=this[_0x0a9e('0x12')];this[_0x0a9e('0x17')]+=0x1;for(var _0x3da2cd in _0x2881b3){if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&(_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')||_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6a'))&&_0x2881b3[_0x3da2cd]['type']==='outbound'){if(this[_0x0a9e('0x17')]>0x7){this[_0x0a9e('0x17')]=0x0;this[_0x0a9e('0x6b')]();}}if(_0x2881b3[_0x0a9e('0x68')](_0x3da2cd)&&_0x2881b3[_0x3da2cd][_0x0a9e('0x69')]===_0x0a9e('0x6')&&_0x2881b3[_0x3da2cd][_0x0a9e('0x6c')]===_0x0a9e('0x6d')){if(_0x2881b3[_0x3da2cd][_0x0a9e('0x34')]){this[_0x0a9e('0x6e')](_0x2881b3[_0x3da2cd]);if(_0x2881b3[_0x3da2cd][_0x0a9e('0x6f')])this[_0x0a9e('0x70')](_0x2881b3[_0x3da2cd]);}else{notSendMessagesQueue(_0x2881b3[_0x3da2cd]);}}}};Preview['prototype'][_0x0a9e('0x71')]=function(_0x138b8b){var _0xdd268f=this;this[_0x0a9e('0x11')][_0x0a9e('0xf')](function(){if(!_[_0x0a9e('0x72')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b])){loggerAction[_0x0a9e('0x5c')]('[clearZombieChannels][talking]',_0x138b8b,_0x0a9e('0x73'),_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')],_0x0a9e('0x75'),JSON[_0x0a9e('0x59')](_0xdd268f['campaignsPreview'][_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]][_0x0a9e('0x4f')]),_0x0a9e('0x76'),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']][_0x0a9e('0x2b')]),JSON[_0x0a9e('0x59')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x77')]),JSON[_0x0a9e('0x59')](_[_0x0a9e('0x78')](_0xdd268f[_0x0a9e('0x15')][_0x138b8b],[_0x0a9e('0x79'),_0x0a9e('0x7a'),'VoiceQueueId',_0x0a9e('0x7b')])));return ami[_0x0a9e('0x7c')]({'action':'status','channel':_0xdd268f['actions'][_0x138b8b]['channel']})[_0x0a9e('0x7d')](function(_0x4317e3){if(_0x4317e3[_0x0a9e('0x4e')]===_0x0a9e('0x7e')){setTimeout(function(){if(_0xdd268f[_0x0a9e('0x15')][_0x138b8b]){ut[_0x0a9e('0x7f')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']],'[clearZombieChannel]');if(_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x77')]===!![]){ut[_0x0a9e('0x80')](_0xdd268f[_0x0a9e('0x12')][_0xdd268f['actions'][_0x138b8b][_0x0a9e('0x74')]],_0x0a9e('0x81'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b]['queue']);}ut[_0x0a9e('0x82')]('[Dialer][checkChannel][Preview]'+_0x138b8b,_0xdd268f[_0x0a9e('0x15')][_0x138b8b][_0x0a9e('0x74')]);delete _0xdd268f[_0x0a9e('0x15')][_0x138b8b];}},0x2328);}});}});};Preview['prototype'][_0x0a9e('0x6b')]=function(){var _0x1bf38a=this;loggerAction['info']('[action]',_[_0x0a9e('0x83')](this[_0x0a9e('0x15')]));for(var _0x49c095 in this[_0x0a9e('0x15')]){if(_0x1bf38a['actions'][_0x0a9e('0x68')](_0x49c095)){_0x1bf38a['clearZombieChannel'](_0x49c095);}}};Preview[_0x0a9e('0xe')]['recallMe']=function(_0x5da27d){var _0x5df0ad=this;rpcDb[_0x0a9e('0x84')](_0x5da27d['id'],ut['agentReadyId'](this[_0x0a9e('0x16')]))[_0x0a9e('0x85')](function(_0x3cfd00){if(!_[_0x0a9e('0x72')](_0x3cfd00)){for(var _0x232830=0x0;_0x232830<_0x3cfd00[_0x0a9e('0x86')];_0x232830+=0x1){if(ut[_0x0a9e('0x87')](_0x3cfd00[_0x232830][_0x0a9e('0x88')])<_0x5da27d['dialRecallMeTimeout']*0x3c){if(_0x3cfd00[_0x232830][_0x0a9e('0x89')]&&!_0x3cfd00[_0x232830][_0x0a9e('0x89')][_0x0a9e('0x8a')]){_0x5df0ad[_0x0a9e('0x8b')](_0x3cfd00[_0x232830]['id'])[_0x0a9e('0x85')](ut[_0x0a9e('0x8c')]('[RecallMe]'))[_0x0a9e('0x7d')](ut[_0x0a9e('0x8c')]('[RecallMe]'));}else{rpcDb[_0x0a9e('0x8d')](_0x3cfd00[_0x232830]['id']);}}else{var _0x5cc8fb=new Action(_0x3cfd00[_0x232830],_0x5da27d);_0x5cc8fb[_0x0a9e('0x8e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5da27d['outboundReCallsDay']+=0x1;ut[_0x0a9e('0x8f')](_0x5cc8fb,0x17,'RecallInQueue');if(_0x5da27d[_0x0a9e('0x90')]){rpcDb[_0x0a9e('0x91')](ut[_0x0a9e('0x92')](_0x3cfd00[_0x232830]));rpcDb[_0x0a9e('0x93')](_0x5cc8fb,_0x0a9e('0x94'));}else{ut[_0x0a9e('0x8f')](_0x5cc8fb,0x16,'RecallFailedTimeout');rpcDb[_0x0a9e('0x93')](_0x5cc8fb,'[HistoryRecallClose]');rpcDb[_0x0a9e('0x95')](_0x5cc8fb,_0x0a9e('0x96'));}}}}})[_0x0a9e('0x7d')](ut['logger2'](_0x0a9e('0x97')));};Preview[_0x0a9e('0xe')][_0x0a9e('0x6e')]=function(_0x32e134){_0x32e134['sendMessageOneNotActive']=!![];if(ut[_0x0a9e('0x98')](_0x32e134[_0x0a9e('0x2a')])){_0x32e134['message']=_0x0a9e('0x99');}else if(!ut[_0x0a9e('0x9a')](_0x32e134[_0x0a9e('0x34')])){_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x63');}else if(!this['isTrunkReachable'](_0x32e134[_0x0a9e('0x55')])){if(!this[_0x0a9e('0x9b')](_0x32e134[_0x0a9e('0x9c')])){_0x32e134['message']=_0x0a9e('0x9d');}else{_0x32e134['message']='ACTIVE';}}else{_0x32e134[_0x0a9e('0x4e')]=_0x0a9e('0x9e');}emitCampaignPreview(_0x32e134);};Preview[_0x0a9e('0xe')][_0x0a9e('0x9f')]=function(_0x186f39,_0xc8c264,_0x387489){var _0x54a37d=this;var _0x2d7205=this[_0x0a9e('0x15')][_0xc8c264];var _0x2e89b7=this[_0x0a9e('0x12')][_0x2d7205[_0x0a9e('0x74')]];var _0x2b8192;var _0x320898=![];var _0x412a72=0x2;var _0x2a28c0=0x3;if(_0x2e89b7){switch(_0x387489){case'1':_0x2e89b7[_0x0a9e('0x3f')]+=0x1;_0x2d7205['countnosuchnumberretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x0,'NoSuchNumber');ami[_0x0a9e('0x5f')](_0x0a9e('0xa2'),ut['buildObj'](_0x2d7205,_0x0a9e('0xa3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xa4'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'0',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a43a8){_0x320898=_0x4a43a8['additional']==0x1;_0x412a72=_0x2e89b7['dialNoSuchNumberRetryFrequency'];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xaa'));}else{if(_0x2d7205[_0x0a9e('0xab')]>=_0x2e89b7['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xaa'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xab'),_0x2e89b7['dialNoSuchNumberRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];}else{_0x2d7205[_0x0a9e('0xab')]++;logger[_0x0a9e('0x5c')](_0x0a9e('0xb0'),_0x2d7205['countnosuchnumberretry']);logger[_0x0a9e('0x5c')]('id',_0x2d7205[_0x0a9e('0xb1')]);_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnosuchnumberretry':_0x2d7205['countnosuchnumberretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xb4'):var _0x4abc8f=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));_0x2d7205[_0x0a9e('0xb6')]=_0x4abc8f;_0x2d7205[_0x0a9e('0xb7')]=_0x4abc8f;_0x2d7205[_0x0a9e('0x77')]=!![];_0x2e89b7[_0x0a9e('0x2b')]+=0x1;logger[_0x0a9e('0x5c')](_0x0a9e('0xb8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7[_0x0a9e('0x2b')]);ami[_0x0a9e('0x5f')]('custom:agentconnect',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xbc'),this[_0x0a9e('0x12')][_0x2d7205['queue']]));if(_0x2e89b7[_0x0a9e('0xbd')]){ami[_0x0a9e('0x5f')](_0x0a9e('0xbe'),ut[_0x0a9e('0xbf')](_0x2d7205));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc0'),this['campaignsPreview'][_0x2d7205[_0x0a9e('0x74')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2d7205,_0x0a9e('0xc0')));_0x2e89b7[_0x0a9e('0x38')]+=0x1;_0x2e89b7['total']+=0x1;_0x2e89b7[_0x0a9e('0x29')]+=0x1;ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xc1'));_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x4,_0x0a9e('0xc2'));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xc3'));rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xc4'));rpcDb[_0x0a9e('0xc5')](_0x2d7205);_0x2e89b7['sumDuration']+=_0x2d7205[_0x0a9e('0xc6')];_0x2e89b7[_0x0a9e('0x2c')]+=_0x2d7205['talktime'];logger[_0x0a9e('0x5c')]('[syncHangup][talking][decrement]',_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x2e89b7['pTalking']);delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;case _0x0a9e('0xc7'):_0x2e89b7[_0x0a9e('0x3a')]+=0x1;_0x2d7205['countbusyretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x5,'Busy');_0x412a72=_0x2e89b7[_0x0a9e('0xc8')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami['emit']('custom:agentbusy',ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xc9')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xca'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'5',_0x2e89b7)[_0x0a9e('0x85')](function(_0x5a8854){_0x320898=_0x5a8854[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut['totalGlobal'](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2d7205[_0x0a9e('0xcc')]>=_0x2e89b7[_0x0a9e('0xcd')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xcc'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xcc')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countbusyretry':_0x2d7205[_0x0a9e('0xcc')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xcf'):_0x2e89b7[_0x0a9e('0xd0')]+=0x1;_0x2d7205['countnoanswerretry']+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x3,_0x0a9e('0xd1'));_0x412a72=_0x2e89b7[_0x0a9e('0xd2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')](_0x0a9e('0xd3'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xd4')));rpcDb['createCustomerHistory'](_0x2d7205,_0x0a9e('0xd5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'3',_0x2e89b7)[_0x0a9e('0x85')](function(_0x30ef6e){_0x320898=_0x30ef6e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xd6'));}else{if(_0x2d7205[_0x0a9e('0xd7')]>=_0x2e89b7[_0x0a9e('0xd8')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xd5'));}else{rpcDb[_0x0a9e('0xac')](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xd7'),_0x2e89b7[_0x0a9e('0xd2')]),_0x2d7205['unlockAgent'],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205['countnoanswerretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xd9'):_0x2e89b7['outboundCongestionCallsDay']+=0x1;_0x2d7205[_0x0a9e('0xda')]+=0x1;_0x2d7205['countglobal']=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x8,'Congestion');_0x412a72=_0x2e89b7[_0x0a9e('0xdb')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];ami[_0x0a9e('0x5f')]('custom:agentcongestion',ut['buildObj'](_0x2d7205,_0x0a9e('0xdc')));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xdd'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'8',_0x2e89b7)[_0x0a9e('0x85')](function(_0x2450a8){_0x320898=_0x2450a8[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut['cloneAction'](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb['createCustomerFinal'](_0x2b8192,_0x0a9e('0xde'));}else{if(_0x2d7205[_0x0a9e('0xda')]>=_0x2e89b7[_0x0a9e('0xdf')]){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xdd'));}else{rpcDb['rescheduleContact'](ut[_0x0a9e('0xce')](_0x2d7205,_0x0a9e('0xda'),_0x2e89b7[_0x0a9e('0xc8')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205['countcongestionretry']++;_0x54a37d['incrementPreviewCounters']({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countcongestionretry':_0x2d7205['countcongestionretry']}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case _0x0a9e('0xe0'):_0x2e89b7[_0x0a9e('0x42')]+=0x1;_0x2d7205[_0x0a9e('0xe1')]+=0x1;_0x2d7205['countglobal']=ut['totalGlobal'](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x14,'AgentReject');_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7['callAdditionalPhoneAfterMin'];ami[_0x0a9e('0x5f')]('custom:agentreject',ut['buildObj'](_0x2d7205,_0x0a9e('0xe3')));rpcDb[_0x0a9e('0x93')](_0x2d7205,'[syncHangupRequest][logAgentReject]');_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x15c6b9){_0x320898=_0x15c6b9[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut['cloneAction'](_0x2d7205,0x14,_0x0a9e('0xe4'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xe5'));}else{if(_0x2d7205[_0x0a9e('0xe1')]>=_0x2e89b7[_0x0a9e('0xe6')]){rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xe5'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe1'),_0x2e89b7[_0x0a9e('0xe2')]),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});break;case _0x0a9e('0xe7'):_0x2e89b7[_0x0a9e('0x43')]+=0x1;_0x2d7205[_0x0a9e('0xe8')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0xb,'Abandoned');rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xe9'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'11',_0x2e89b7)[_0x0a9e('0x85')](function(_0x34f7b5){_0x320898=_0x34f7b5['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2d7205[_0x0a9e('0xea')]>=_0x2e89b7['dialAbandonedMaxRety']){rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xe9'));}else{rpcDb[_0x0a9e('0xac')](ut['scheduledAt'](_0x2d7205,_0x0a9e('0xe8'),_0x2e89b7['dialAbandonedRetryFrequency']),_0x2d7205[_0x0a9e('0xad')],_0x2d7205[_0x0a9e('0xae')]);}}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});break;case'18':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xec')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0x12,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit']('custom:amd',ut[_0x0a9e('0xbb')](_0x2d7205,'amd'));rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xef'));_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0xe2b083){_0x320898=_0xe2b083[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0x12,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xef'));}else{rpcDb['createCustomerFinal'](_0x2d7205,_0x0a9e('0xef'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205['idContact'],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d[_0x0a9e('0xb3')](_0x2d7205,_0x412a72,_0x2a28c0)['then'](function(){});});}});delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];break;case'19':_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut['logCustomer'](_0x2d7205,0x13,_0x186f39[_0x0a9e('0xed')]||_0x186f39[_0x0a9e('0xee')]);ami['emit'](_0x0a9e('0xf0'),ut[_0x0a9e('0xbb')](_0x2d7205,_0x0a9e('0xf1')));rpcDb['createCustomerHistory'](_0x2d7205,'[callProgressDetectingCustomer][machine]');_0x54a37d['verifyAdditionalPhones'](_0x2d7205,'18',_0x2e89b7)[_0x0a9e('0x85')](function(_0x4a70ce){_0x320898=_0x4a70ce['additional']==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7[_0x0a9e('0xa7')]){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,'Global');rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf2'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf2'));}}else{_0x2d7205[_0x0a9e('0xd7')]++;_0x54a37d[_0x0a9e('0xb2')]({'id':_0x2d7205[_0x0a9e('0xb1')],'field':{'countnoanswerretry':_0x2d7205[_0x0a9e('0xd7')]}})[_0x0a9e('0x85')](function(){_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(){});});}});delete this['actions'][_0x186f39[_0x0a9e('0xaf')]];break;default:if(_0x2d7205[_0x0a9e('0x77')]){ut[_0x0a9e('0x80')](_0x2e89b7,_0x0a9e('0xf3'));ut[_0x0a9e('0x82')](_0x0a9e('0xf4')+_0x2e89b7['name'],_0x186f39);}_0x2e89b7[_0x0a9e('0xeb')]+=0x1;_0x2d7205[_0x0a9e('0xa0')]=ut[_0x0a9e('0xa1')](_0x2d7205);ut[_0x0a9e('0x8f')](_0x2d7205,0xc,_0x186f39['cause-txt']||_0x186f39[_0x0a9e('0xee')]);_0x412a72=_0x2e89b7[_0x0a9e('0xe2')];_0x2a28c0=_0x2e89b7[_0x0a9e('0xa6')];rpcDb[_0x0a9e('0x93')](_0x2d7205,_0x0a9e('0xf5'));_0x54a37d[_0x0a9e('0xa5')](_0x2d7205,'20',_0x2e89b7)[_0x0a9e('0x85')](function(_0x25931e){_0x320898=_0x25931e[_0x0a9e('0xcb')]==0x1;if(!_0x320898){if(ut[_0x0a9e('0xa1')](_0x2d7205)>=_0x2e89b7['dialGlobalMaxRetry']){_0x2b8192=ut[_0x0a9e('0xa8')](_0x2d7205,0xf,_0x0a9e('0xa9'));rpcDb[_0x0a9e('0x95')](_0x2b8192,_0x0a9e('0xf6'));}else{rpcDb[_0x0a9e('0x95')](_0x2d7205,_0x0a9e('0xf6'));}delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xaf')]];}else{_0x54a37d['swapAdditionalPhones'](_0x2d7205,_0x412a72,_0x2a28c0)[_0x0a9e('0x85')](function(_0xd2391){});}});}if(!(_0x2d7205[_0x0a9e('0x77')]&&_0x387489==='16')){ut['updateOriginated'](_0x2e89b7,_0x0a9e('0xf7'));logger[_0x0a9e('0x5c')](_0x0a9e('0xf8'),_0x2d7205[_0x0a9e('0xb9')],_0x0a9e('0xba'),_0x2e89b7[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x2e89b7[_0x0a9e('0x4f')]);}if(_0x387489!==_0x0a9e('0xb4')){delete this[_0x0a9e('0x15')][_0x186f39['linkedid']];delete this[_0x0a9e('0x15')][_0x186f39[_0x0a9e('0xf9')]];}}};Preview[_0x0a9e('0xe')][_0x0a9e('0xfa')]=function(_0x2b624e,_0x3942fd,_0x5cb48d){if(_[_0x0a9e('0xfb')](_0x3942fd)&&'object'!==typeof _0x3942fd){return;}if(_['isUndefined'](_0x5cb48d)&&'object'!==typeof _0x5cb48d){return;}switch(_0x5cb48d[_0x0a9e('0xfc')]){case'0':ut[_0x0a9e('0xfd')](_0x2b624e,0x0,_0x0a9e('0xfe'));rpcDb[_0x0a9e('0xff')](_0x2b624e,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x0a9e('0xfd')](_0x2b624e,0x3,_0x0a9e('0xd1'));rpcDb[_0x0a9e('0xff')](_0x2b624e,_0x0a9e('0x100'));break;case'5':ut[_0x0a9e('0xfd')](_0x2b624e,0x5,'Busy');rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x101'));break;case'8':ut[_0x0a9e('0xfd')](_0x2b624e,0x8,_0x0a9e('0x102'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));break;case'22':ut[_0x0a9e('0xfd')](_0x2b624e,0x16,_0x0a9e('0x104'));rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x105'));break;default:ut[_0x0a9e('0xfd')](_0x2b624e,0xc,_0x5cb48d[_0x0a9e('0xfc')]);rpcDb['createAgentHistory'](_0x2b624e,_0x0a9e('0x103'));}ut[_0x0a9e('0x7f')](_0x3942fd,_0x0a9e('0x106'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x2b624e['uniqueid'],_0x0a9e('0xba'),_0x3942fd[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x3942fd[_0x0a9e('0x4f')]);delete this['actions'][_0x2b624e[_0x0a9e('0xb9')]];};Preview['prototype'][_0x0a9e('0xa5')]=function(_0x2ff2ab,_0x242f23,_0x57f673){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xa5')](_0x2ff2ab,_0x242f23,_0x57f673))['catch'](logger[_0x0a9e('0x5c')]('[verifyAdditionalPhone]\x20'));};Preview[_0x0a9e('0xe')]['swapAdditionalPhones']=function(_0x41b90a,_0x57b7d4,_0xb14971){return BPromise[_0x0a9e('0x107')]()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb3')](_0x41b90a,_0x57b7d4,_0xb14971))[_0x0a9e('0x7d')](logger[_0x0a9e('0x5c')](_0x0a9e('0x108')));};Preview['prototype'][_0x0a9e('0xb2')]=function(_0x1c9ea2){return BPromise['resolve']()[_0x0a9e('0x85')](cmHopperAdditionalPhone[_0x0a9e('0xb2')](_0x1c9ea2))['catch'](logger[_0x0a9e('0x5c')](_0x0a9e('0x109')));};Preview[_0x0a9e('0xe')]['checkInBlack']=function(_0x3766d7,_0xf49ed4,_0xdeb5e4,_0x3f0d64,_0x2003bc){var _0x29fdfe=this;return new BPromise(function(_0x3ba897,_0x74d9b8){if(_[_0x0a9e('0x72')](_0xf49ed4)||_[_0x0a9e('0x72')](_0xf49ed4['Contact'])||_[_0x0a9e('0x72')](_0xf49ed4['phone'])||_[_0x0a9e('0x72')](_0xf49ed4[_0x0a9e('0x10a')])){_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x10b'),_0x3f0d64,_0x2003bc));return;}var _0x5d577b=uuid['v4']();var _0x2d45db=_0x29fdfe['campaignsPreview'][_0xf49ed4[_0x0a9e('0x73')][_0x0a9e('0x27')]];var _0x2977a7=_0xdeb5e4?_0x29fdfe['agents'][_0xdeb5e4]['id']:undefined;_0x29fdfe[_0x0a9e('0x15')][_0x5d577b]=new Action(_0xf49ed4,_0x2d45db,_0x5d577b,_0xdeb5e4,_0x2977a7);var _0x402544=_0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x402544[_0x0a9e('0xad')]=_0x3f0d64;_0x402544[_0x0a9e('0xae')]=_0x2003bc;_0x402544[_0x0a9e('0x10c')]=_0xdeb5e4;if(_[_0x0a9e('0x10d')](_0x3766d7)){_0x29fdfe['execCall'](_0x402544,_0x2d45db,_0xf49ed4,_0xdeb5e4)[_0x0a9e('0x85')](function(_0x228c10){logger[_0x0a9e('0x5c')](_0x0a9e('0x10e'),_0x0a9e('0x10f')+_0x402544[_0x0a9e('0x74')]+_0x0a9e('0x110')+_0x402544['idContact'],JSON['stringify'](_0x228c10));ami[_0x0a9e('0x5f')](_0x0a9e('0x111'),ut[_0x0a9e('0xbb')](_0x402544,_0x0a9e('0x112'),_0x29fdfe[_0x0a9e('0x12')][_0x402544[_0x0a9e('0x74')]]));_0x3ba897(ut[_0x0a9e('0x4e')]('Calling'));})[_0x0a9e('0x7d')](function(_0x1d7fc4){ut[_0x0a9e('0x64')](_0x0a9e('0x113'),_0x1d7fc4);_0x74d9b8(ut[_0x0a9e('0x4e')](_0x0a9e('0x114'),_0x3f0d64,_0x2003bc));});}else{_0x2d45db[_0x0a9e('0x39')]+=0x1;ut['logBlacklist'](_0x402544);rpcDb[_0x0a9e('0x115')](_0x402544,_0x0a9e('0x116'));delete _0x29fdfe[_0x0a9e('0x15')][_0x5d577b];_0x74d9b8(ut['message'](_0x0a9e('0x117'),_0x3f0d64,_0x2003bc));}});};Preview[_0x0a9e('0xe')][_0x0a9e('0x9b')]=function(_0x292f02){return!_['isNil'](_0x292f02)&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x27')])&&!_[_0x0a9e('0x72')](_0x292f02[_0x0a9e('0x56')])&&_0x292f02[_0x0a9e('0x56')]&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])])&&!_[_0x0a9e('0x72')](this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02['name'])][_0x0a9e('0x118')])&&(this[_0x0a9e('0x14')][util[_0x0a9e('0x5e')]('SIP/%s',_0x292f02[_0x0a9e('0x27')])][_0x0a9e('0x118')]==='reachable'||this[_0x0a9e('0x14')][util['format'](_0x0a9e('0x119'),_0x292f02['name'])]['status']==='unmonitored');};Preview[_0x0a9e('0xe')][_0x0a9e('0x8b')]=function(_0x19f800,_0x20007e){var _0x7d59a9=this;return new BPromise(function(_0xe17af8,_0x48fbef){_0x7d59a9[_0x0a9e('0x11a')](_0x19f800,_0x20007e)[_0x0a9e('0x85')](function(_0x1713a7){_0xe17af8(_[_0x0a9e('0x78')](_0x1713a7,[_0x0a9e('0x4e')]));})[_0x0a9e('0x7d')](function(_0x31c937){if(_0x31c937['unlock']){rpcDb['unlockContact'](_0x19f800);}if(_0x31c937[_0x0a9e('0x56')]){rpcDb['disableContact'](_0x19f800);}_0x48fbef(_[_0x0a9e('0x78')](_0x31c937,[_0x0a9e('0x4e')]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11a')]=function(_0x37a448,_0x383dd8){var _0x594f25=this;return new BPromise(function(_0x4716d1,_0x59b872){var _0x50e32a,_0x504403;rpcDb['getContactPreview'](_0x37a448)[_0x0a9e('0x85')](function(_0x5dc978){if(!_['isNil'](_0x5dc978[0x0])){_0x504403=_0x5dc978[0x0][_0x0a9e('0x11b')]?![]:!![];_0x50e32a=_0x5dc978[0x0]['recallme']?!![]:![];_0x50e32a=_0x383dd8?!![]:_0x50e32a;}var _0x24470a=_0x594f25[_0x0a9e('0x11c')](_0x5dc978);if(_0x24470a[_0x0a9e('0x11d')]){rpcDb['checkIsBlackList'](_[_0x0a9e('0x78')](_0x5dc978[0x0],[_0x0a9e('0x10a'),_0x0a9e('0x11e')]))['then'](function(_0x5236c9){_0x594f25[_0x0a9e('0x11f')](_0x5236c9,_0x5dc978[0x0],_0x383dd8,_0x504403,_0x50e32a)[_0x0a9e('0x85')](function(_0x89d2cb){_0x4716d1(_0x89d2cb);})[_0x0a9e('0x7d')](function(_0x3b0db2){_0x59b872(_0x3b0db2);});})[_0x0a9e('0x7d')](function(_0x247a6c){ut[_0x0a9e('0x64')](_0x0a9e('0x120'),_0x247a6c);_0x59b872(ut[_0x0a9e('0x4e')]('Call\x20unsuccessful',_0x504403,_0x50e32a));});}else{_0x59b872(ut['message'](_0x24470a['message'],_0x504403,_0x50e32a));}})[_0x0a9e('0x7d')](function(_0x19dcc2){ut[_0x0a9e('0x64')](_0x0a9e('0x121'),_0x19dcc2);_0x59b872(ut[_0x0a9e('0x4e')](_0x0a9e('0x122'),![],!![]));});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x11c')]=function(_0x5d74e9){if(_['isNil'](_0x5d74e9)||_[_0x0a9e('0x10d')](_0x5d74e9)||!_[_0x0a9e('0x72')](_0x5d74e9[0x0]['Agent'])&&_[_0x0a9e('0x72')](_0x5d74e9[0x0][_0x0a9e('0x89')][_0x0a9e('0x27')])){ut[_0x0a9e('0x64')](_0x0a9e('0x123'),_0x5d74e9);return{'isValid':![],'message':_0x0a9e('0x124')};}var _0x167196=this[_0x0a9e('0x12')][_0x5d74e9[0x0][_0x0a9e('0x73')][_0x0a9e('0x27')]];_0x167196[_0x0a9e('0x4e')]=_0x0a9e('0x9e');if(_['isNil'](_0x167196)){ut[_0x0a9e('0x64')](_0x0a9e('0x125'),_0x167196);return{'isValid':![],'message':_0x0a9e('0x126')};}if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x55')])){ut[_0x0a9e('0x64')](_0x0a9e('0x127'),_0x0a9e('0x128')+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x129'));if(!this[_0x0a9e('0x9b')](_0x167196[_0x0a9e('0x9c')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12a'));return{'isValid':![],'message':_0x0a9e('0x12b')};}}if(!ut[_0x0a9e('0x9a')](_0x167196[_0x0a9e('0x34')])){ut[_0x0a9e('0x64')](_0x0a9e('0x12c'),_0x167196['name']+_0x0a9e('0x12d'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x167196[_0x0a9e('0x27')]+_0x0a9e('0x12d')};}return{'isValid':!![],'message':_0x0a9e('0x12e')};};Preview[_0x0a9e('0xe')][_0x0a9e('0x12f')]=function(_0x358f74,_0x465003,_0x261eca,_0xa7a754){var _0x32a199=this;return new BPromise(function(_0x39d367,_0x8231e5){var _0x43111e=_0x358f74[_0x0a9e('0xb9')];var _0x3c8a9a=_0x32a199[_0x0a9e('0x9b')](_0x465003['Trunk'])?util['format'](_0x0a9e('0x130'),_0x465003[_0x0a9e('0x55')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003['dialCutDigit']>0x0?_0x261eca[_0x0a9e('0x11e')]['substring'](_0x465003[_0x0a9e('0x133')]):_0x261eca['phone']):util[_0x0a9e('0x5e')]('SIP/%s/%s%s',_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['name']:_0x465003[_0x0a9e('0x9c')]['name'],_['isNil'](_0x465003[_0x0a9e('0x131')])?'':_0x465003[_0x0a9e('0x131')][_0x0a9e('0x132')]()||'',_0x465003[_0x0a9e('0x133')]>0x0?_0x261eca[_0x0a9e('0x11e')][_0x0a9e('0x134')](_0x465003[_0x0a9e('0x133')]):_0x261eca[_0x0a9e('0x11e')]);var _0x1a3143=_0x32a199[_0x0a9e('0x9b')](_0x465003[_0x0a9e('0x55')])?ut[_0x0a9e('0x135')](_0x465003[_0x0a9e('0x55')][_0x0a9e('0x57')],_0x465003[_0x0a9e('0x35')],_0x465003[_0x0a9e('0x136')]>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003['dialOriginateCallerIdNumber']):ut[_0x0a9e('0x135')](_[_0x0a9e('0x72')](_0x465003[_0x0a9e('0x9c')])?_0x465003[_0x0a9e('0x55')]['callerid']:_0x465003['TrunkBackup']['callerid'],_0x465003[_0x0a9e('0x35')],_0x465003['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0a9e('0x137')](_0x465003[_0x0a9e('0x138')],_0x465003[_0x0a9e('0x136')]):_0x465003[_0x0a9e('0x138')]);if(_0x1a3143){_0x358f74[_0x0a9e('0x139')]=ut[_0x0a9e('0x13a')](_0x1a3143);_0x358f74[_0x0a9e('0x13b')]=ut[_0x0a9e('0x13c')](_0x1a3143);}var _0x2154d8=ut[_0x0a9e('0x13d')](_0x465003,_0x261eca,_0x3c8a9a,_0x1a3143,_0x43111e,_0x358f74);_['merge'](_0x358f74,ut[_0x0a9e('0x13e')](_0x2154d8));_0x358f74['starttime']=moment()[_0x0a9e('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x0a9e('0x7c')](ut[_0x0a9e('0x13f')](_0x358f74,_0x465003,_0x2154d8,_0x358f74[_0x0a9e('0xae')],_0xa7a754))['then'](function(_0x920ad8){_0x465003[_0x0a9e('0x4f')]+=0x1;logger['info']('[originated][increment]',_0x43111e,_0x0a9e('0xba'),_0x465003[_0x0a9e('0x27')],_0x0a9e('0x75'),_0x465003['originated']);_0x39d367(_0x920ad8);})['catch'](function(_0x4869c1){ut[_0x0a9e('0xfd')](_0x358f74,0xe,_0x0a9e('0x140'));rpcDb[_0x0a9e('0xff')](_0x358f74,_0x0a9e('0x141'));_0x8231e5(_0x4869c1);});});};Preview[_0x0a9e('0xe')][_0x0a9e('0x142')]=function(_0x183b9b){if(this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]]){this[_0x0a9e('0x15')][_0x183b9b[_0x0a9e('0xaf')]][_0x0a9e('0x143')]=_0x183b9b[_0x0a9e('0x143')];}};Preview[_0x0a9e('0xe')][_0x0a9e('0x19')]=function(_0x1a74c4){var _0x94e69b=this;var _0x320367=this['actions'][_0x1a74c4[_0x0a9e('0x144')]];if(_0x320367){if(_0x320367[_0x0a9e('0x10c')]&&this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]){ut[_0x0a9e('0x145')](_0x320367,this[_0x0a9e('0x16')][_0x320367['lookAgent']][_0x0a9e('0x27')],this[_0x0a9e('0x16')][_0x320367[_0x0a9e('0x10c')]]['id']);}var _0x1109de=_[_0x0a9e('0x146')](_0x320367);_0x1109de[_0x0a9e('0xb6')]=moment()[_0x0a9e('0x5e')](_0x0a9e('0xb5'));var _0x4175a6=_0x94e69b['campaignsPreview'][_0x320367['queue']];if(ut[_0x0a9e('0x147')](_0x1a74c4[_0x0a9e('0x148')])){if(_0x320367['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x320367[_0x0a9e('0xb1')]);}if(_0x320367['activeContact']){rpcDb[_0x0a9e('0x8d')](_0x320367['idContact']);}ami[_0x0a9e('0x5f')](_0x0a9e('0x14a'),ut['buildObj'](_0x320367,_0x0a9e('0x14b'),this[_0x0a9e('0x12')][_0x320367['queue']]));this[_0x0a9e('0xfa')](_0x1109de,_0x4175a6,_0x1a74c4);}else{_0x320367[_0x0a9e('0x8e')]=moment()['format'](_0x0a9e('0xb5'));ut[_0x0a9e('0xfd')](_0x1109de,0x4,_0x0a9e('0xc2'));rpcDb[_0x0a9e('0xff')](_0x1109de,_0x0a9e('0x14c'));}}};Preview[_0x0a9e('0xe')]['syncHangup']=function(_0x1e5b09){var _0x36dc4f=this;var _0x51e697=this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]];var _0x22c390;if(_0x51e697){_0x22c390=this[_0x0a9e('0x12')][_0x51e697[_0x0a9e('0x74')]];logger[_0x0a9e('0x5c')](_0x0a9e('0x14d'),_0x1e5b09['linkedid'],'\x20Queue',_0x22c390['name'],'pTalking:\x20',_0x22c390['pTalking']);}if(this[_0x0a9e('0x15')][_0x1e5b09[_0x0a9e('0xaf')]]&&_0x1e5b09['linkedid']!==_0x1e5b09['uniqueid']){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this[_0x0a9e('0x15')][_0x1e5b09['linkedid']][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')]('[syncHangup][talking][cause]',_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390[_0x0a9e('0x2b')]);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09['linkedid'],_0x1e5b09[_0x0a9e('0x14e')]);}}else if(_0x51e697&&_['isNil'](_0x51e697[_0x0a9e('0x14f')])&&_0x22c390[_0x0a9e('0x150')]&&_0x1e5b09['linkedid']===_0x1e5b09[_0x0a9e('0xb9')]&&_[_0x0a9e('0x72')](_0x1e5b09['reason'])&&_0x1e5b09[_0x0a9e('0x14e')]==='16'&&_0x1e5b09['channelstate']==='6'&&_[_0x0a9e('0xfb')](_0x51e697[_0x0a9e('0x151')])){if(_0x51e697['unlockAgent']){rpcDb[_0x0a9e('0x149')](_0x51e697['idContact']);}if(_0x51e697[_0x0a9e('0xae')]){rpcDb[_0x0a9e('0x8d')](_0x51e697[_0x0a9e('0xb1')]);}_0x1e5b09[_0x0a9e('0xfc')]='22';this[_0x0a9e('0xfa')](_0x51e697,_0x22c390,_0x1e5b09);}else if(_0x51e697&&_0x51e697[_0x0a9e('0x151')]){if(_0x1e5b09[_0x0a9e('0x14e')]==='16'&&this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x152'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09['cause'],_0x0a9e('0xba'),_0x22c390['name'],'pTalking:\x20',_0x22c390[_0x0a9e('0x2b')]);this['callProgressDetectingCustomer'](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}else if(this['actions'][_0x1e5b09[_0x0a9e('0xaf')]][_0x0a9e('0x77')]){logger[_0x0a9e('0x5c')](_0x0a9e('0x153'),_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')],_0x0a9e('0xba'),_0x22c390[_0x0a9e('0x27')],_0x0a9e('0x76'),_0x22c390['pTalking']);this[_0x0a9e('0x9f')](_0x1e5b09,_0x1e5b09[_0x0a9e('0xaf')],_0x1e5b09[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')]['syncDialEnd']=function(_0x38d95a){if(this[_0x0a9e('0x15')][_0x38d95a[_0x0a9e('0xf9')]]&&_0x38d95a['destlinkedid']!==_0x38d95a[_0x0a9e('0x154')]){this[_0x0a9e('0x9f')](_0x38d95a,_0x38d95a[_0x0a9e('0xf9')],_0x38d95a['dialstatus']);}};Preview[_0x0a9e('0xe')]['syncHangupRequest']=function(_0x2394f2){if(this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]&&_0x2394f2[_0x0a9e('0xaf')]!==_0x2394f2[_0x0a9e('0xb9')]&&!this[_0x0a9e('0x15')][_0x2394f2[_0x0a9e('0xaf')]]['dialAnswer']){if(_0x2394f2[_0x0a9e('0x14e')]==='1'){this[_0x0a9e('0x9f')](_0x2394f2,_0x2394f2[_0x0a9e('0xaf')],_0x2394f2[_0x0a9e('0x14e')]);}}};Preview[_0x0a9e('0xe')][_0x0a9e('0x155')]=function(_0x3a4def,_0x2670f5,_0x2310ca){if(this[_0x0a9e('0x15')][_0x3a4def]){if(_[_0x0a9e('0x72')](this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')])){this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')]={};}this[_0x0a9e('0x15')][_0x3a4def][_0x0a9e('0x156')][_0x2670f5]=_0x2310ca;}};Preview[_0x0a9e('0xe')][_0x0a9e('0x21')]=function(_0x611e46){try{if(!_[_0x0a9e('0x72')](_0x611e46)){if(ut[_0x0a9e('0x157')](_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0])){this[_0x0a9e('0x155')](_0x611e46[_0x0a9e('0xb9')],_[_0x0a9e('0x158')](_0x611e46['variable'])[0x0],_0x611e46[_0x0a9e('0x159')]);}}}catch(_0x4c925e){logger[_0x0a9e('0x15a')](_0x0a9e('0x15b'),util[_0x0a9e('0x15c')](_0x4c925e,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xe')][_0x0a9e('0x23')]=function(_0xb09ef6){if(_0xb09ef6){if(this[_0x0a9e('0x15')][_0xb09ef6[_0x0a9e('0x15d')]]){this['actions'][_0xb09ef6[_0x0a9e('0x15d')]][_0x0a9e('0x151')]=!![];}}};Preview['prototype'][_0x0a9e('0x25')]=function(_0x2db8fe){if(_0x2db8fe){if(this[_0x0a9e('0x15')][_0x2db8fe['transfererlinkedid']]){this[_0x0a9e('0x15')][_0x2db8fe[_0x0a9e('0x15e')]][_0x0a9e('0x151')]=!![];}}};module[_0x0a9e('0x15f')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 7c031b8..403db8e 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 _0x4582=['getContactPreview','[getContactPreview]\x20','createAgentHistory','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList'];(function(_0xf62853,_0xd90721){var _0x4494e0=function(_0x2da73e){while(--_0x2da73e){_0xf62853['push'](_0xf62853['shift']());}};_0x4494e0(++_0xd90721);}(_0x4582,0x95));var _0x2458=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4582[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x2458('0x0'));var BPromise=require(_0x2458('0x1'));var logger=require(_0x2458('0x2'))(_0x2458('0x3'));var _=require(_0x2458('0x4'));var cmHopper=require(_0x2458('0x5'));var cmHopperFinal=require(_0x2458('0x6'));var cmHopperHistory=require(_0x2458('0x7'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x2458('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x2458('0x9'));function loggerCatch(_0x269fbc){return function(_0x71174a){logger[_0x2458('0xa')](_0x269fbc,util[_0x2458('0xb')](_0x71174a,{'showHidden':![],'depth':null}));};}function create(_0x1acbae){return BPromise[_0x2458('0xc')]()[_0x2458('0xd')](cmHopperHistory[_0x2458('0xe')](_0x1acbae))[_0x2458('0xf')](loggerCatch(_0x2458('0x10')));}function createAgent(_0x5c71f4){return BPromise[_0x2458('0xc')]()[_0x2458('0xd')](agentReportPreview['createHistory'](_0x5c71f4))[_0x2458('0xf')](loggerCatch(_0x2458('0x10')));}function moveContact(_0x41f97a){return BPromise[_0x2458('0xc')]()[_0x2458('0xd')](cmHopper[_0x2458('0x11')](_0x41f97a,!![]))[_0x2458('0xf')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x2458('0x12')]=function(_0x5ca86b){return BPromise[_0x2458('0xc')]()[_0x2458('0xd')](cmHopperBlack[_0x2458('0x12')](_0x5ca86b))[_0x2458('0xf')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x2458('0x13')]=function(_0x272059){return BPromise['resolve']()[_0x2458('0xd')](cmHopper[_0x2458('0x13')](_0x272059))[_0x2458('0xf')](loggerCatch(_0x2458('0x14')));};exports[_0x2458('0xe')]=function(_0x2a7426,_0x458718){create(_0x2a7426)[_0x2458('0xf')](loggerCatch(_0x458718));moveContact(_0x2a7426)[_0x2458('0xf')](loggerCatch(_0x458718));};exports[_0x2458('0x15')]=function(_0x452b08,_0x2fa127){createAgent(_0x452b08)[_0x2458('0xf')](loggerCatch(_0x2fa127));};exports['createCustomerHistory']=function(_0x110dc4,_0x2e7642){create(_0x110dc4)[_0x2458('0xf')](loggerCatch(_0x2e7642));};exports['createCustomerFinal']=function(_0x488150,_0x5ae7c5){moveContact(_0x488150)[_0x2458('0xf')](loggerCatch(_0x5ae7c5));};exports['rescheduleContact']=function(_0x336d2c,_0x27df1c,_0x15ee84){if(_0x27df1c){_0x336d2c[_0x2458('0x16')]=null;}if(_0x15ee84){_0x336d2c[_0x2458('0x17')]=![];}return BPromise[_0x2458('0xc')]()[_0x2458('0xd')](cmHopper[_0x2458('0x18')](_0x336d2c))[_0x2458('0xf')](loggerCatch(_0x2458('0x19')));};exports[_0x2458('0x1a')]=function(_0x4981e3){return BPromise[_0x2458('0xc')]()[_0x2458('0xd')](cmHopper[_0x2458('0x1a')](_0x4981e3))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x2458('0x1b')]=function(_0x2d4a68){return BPromise['resolve']()['then'](cmHopper[_0x2458('0x1b')]({'UserId':null},_0x2d4a68,0x1))[_0x2458('0xf')](loggerCatch(_0x2458('0x1c')));};exports[_0x2458('0x1d')]=function(_0x39d3c2){return BPromise[_0x2458('0xc')]()[_0x2458('0xd')](cmHopper[_0x2458('0x1b')]({'active':![]},_0x39d3c2,0x1))['catch'](loggerCatch(_0x2458('0x1e')));};exports['crateCustomerReportQueue']=function(_0x529157){var _0x1af3b7={};_0x1af3b7['type']=_0x529157[_0x2458('0x1f')];_0x1af3b7[_0x2458('0x20')]=_0x529157[_0x2458('0x20')];_0x1af3b7[_0x2458('0x21')]=_0x529157[_0x2458('0x21')];_0x1af3b7[_0x2458('0x22')]=_0x529157[_0x2458('0x22')];_0x1af3b7[_0x2458('0x23')]=_0x529157[_0x2458('0x23')];_0x1af3b7['queuecallerjoinAt']=_0x529157[_0x2458('0x24')];_0x1af3b7[_0x2458('0x25')]=_0x529157[_0x2458('0x24')];_0x1af3b7[_0x2458('0x26')]=0x1;_0x1af3b7[_0x2458('0x27')]=_0x529157[_0x2458('0x28')];_0x1af3b7[_0x2458('0x29')]=_0x529157['membername'];_0x1af3b7[_0x2458('0x2a')]=_0x2458('0x2b');_0x1af3b7[_0x2458('0x2c')]=_0x2458('0x2d');_0x1af3b7[_0x2458('0x2e')]=0x0;_0x1af3b7[_0x2458('0x2f')]=0x1;_0x1af3b7[_0x2458('0x30')]=_0x529157[_0x2458('0x31')];_0x1af3b7['queuecallerexitreason']=_0x2458('0x32');return BPromise['resolve']()[_0x2458('0xd')](voiceQueueReport[_0x2458('0x33')](_0x1af3b7))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x2458('0x34')]=function(_0x5864a4,_0x523825){return BPromise[_0x2458('0xc')]()[_0x2458('0xd')](cmHopper[_0x2458('0x34')](_0x5864a4,_0x523825))[_0x2458('0xf')](loggerCatch(_0x2458('0x35')));};exports[_0x2458('0x36')]=function(_0x1e50aa){return BPromise[_0x2458('0xc')]()['then'](cmHopper['rescheduleContact'](_0x1e50aa,!![],!![]))['catch'](loggerCatch(_0x2458('0x37')));}; \ No newline at end of file +var _0xc3c7=['queuecallerleaveAt','queuecallercompleteAt','connectedlinename','membername','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime'];(function(_0x351b3a,_0x5d8d77){var _0x1e4def=function(_0x530fd6){while(--_0x530fd6){_0x351b3a['push'](_0x351b3a['shift']());}};_0x1e4def(++_0x5d8d77);}(_0xc3c7,0x148));var _0x7c3c=function(_0x20a573,_0x3328b4){_0x20a573=_0x20a573-0x0;var _0x399adf=_0xc3c7[_0x20a573];return _0x399adf;};'use strict';var util=require('util');var BPromise=require(_0x7c3c('0x0'));var logger=require(_0x7c3c('0x1'))('preview');var _=require(_0x7c3c('0x2'));var cmHopper=require(_0x7c3c('0x3'));var cmHopperFinal=require(_0x7c3c('0x4'));var cmHopperHistory=require(_0x7c3c('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x7c3c('0x6'));var agentReportPreview=require(_0x7c3c('0x7'));var voiceQueueReport=require(_0x7c3c('0x8'));function loggerCatch(_0x54ce99){return function(_0x256f13){logger[_0x7c3c('0x9')](_0x54ce99,util['inspect'](_0x256f13,{'showHidden':![],'depth':null}));};}function create(_0x49b927){return BPromise[_0x7c3c('0xa')]()[_0x7c3c('0xb')](cmHopperHistory[_0x7c3c('0xc')](_0x49b927))[_0x7c3c('0xd')](loggerCatch(_0x7c3c('0xe')));}function createAgent(_0x598566){return BPromise[_0x7c3c('0xa')]()[_0x7c3c('0xb')](agentReportPreview[_0x7c3c('0xc')](_0x598566))['catch'](loggerCatch(_0x7c3c('0xe')));}function moveContact(_0x2c6f29){return BPromise[_0x7c3c('0xa')]()[_0x7c3c('0xb')](cmHopper[_0x7c3c('0xf')](_0x2c6f29,!![]))[_0x7c3c('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x3c61aa){return BPromise[_0x7c3c('0xa')]()[_0x7c3c('0xb')](cmHopperBlack['checkIsBlackList'](_0x3c61aa))[_0x7c3c('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x7c3c('0x10')]=function(_0x3b75eb){return BPromise['resolve']()[_0x7c3c('0xb')](cmHopper[_0x7c3c('0x10')](_0x3b75eb))[_0x7c3c('0xd')](loggerCatch(_0x7c3c('0x11')));};exports[_0x7c3c('0xc')]=function(_0x469b79,_0x501032){create(_0x469b79)[_0x7c3c('0xd')](loggerCatch(_0x501032));moveContact(_0x469b79)[_0x7c3c('0xd')](loggerCatch(_0x501032));};exports[_0x7c3c('0x12')]=function(_0x3217ee,_0x39d874){createAgent(_0x3217ee)[_0x7c3c('0xd')](loggerCatch(_0x39d874));};exports['createCustomerHistory']=function(_0x3d53be,_0x45fd7e){create(_0x3d53be)['catch'](loggerCatch(_0x45fd7e));};exports[_0x7c3c('0x13')]=function(_0x48f984,_0x42875e){moveContact(_0x48f984)[_0x7c3c('0xd')](loggerCatch(_0x42875e));};exports[_0x7c3c('0x14')]=function(_0x5420a3,_0x2099ec,_0x44e31f){if(_0x2099ec){_0x5420a3[_0x7c3c('0x15')]=null;}if(_0x44e31f){_0x5420a3['active']=![];}return BPromise['resolve']()[_0x7c3c('0xb')](cmHopper[_0x7c3c('0x14')](_0x5420a3))[_0x7c3c('0xd')](loggerCatch(_0x7c3c('0x16')));};exports[_0x7c3c('0x17')]=function(_0x5b6526){return BPromise[_0x7c3c('0xa')]()[_0x7c3c('0xb')](cmHopper[_0x7c3c('0x17')](_0x5b6526))[_0x7c3c('0xd')](loggerCatch(_0x7c3c('0x18')));};exports[_0x7c3c('0x19')]=function(_0x21a94f){return BPromise[_0x7c3c('0xa')]()[_0x7c3c('0xb')](cmHopper['unlockContact']({'UserId':null},_0x21a94f,0x1))[_0x7c3c('0xd')](loggerCatch(_0x7c3c('0x1a')));};exports[_0x7c3c('0x1b')]=function(_0x2ea44b){return BPromise[_0x7c3c('0xa')]()[_0x7c3c('0xb')](cmHopper[_0x7c3c('0x19')]({'active':![]},_0x2ea44b,0x1))[_0x7c3c('0xd')](loggerCatch('[activeContact]\x20'));};exports[_0x7c3c('0x1c')]=function(_0x2b1f61){var _0x1447ec={};_0x1447ec[_0x7c3c('0x1d')]=_0x2b1f61[_0x7c3c('0x1d')];_0x1447ec['uniqueid']=_0x2b1f61[_0x7c3c('0x1e')];_0x1447ec[_0x7c3c('0x1f')]=_0x2b1f61[_0x7c3c('0x1f')];_0x1447ec[_0x7c3c('0x20')]=_0x2b1f61[_0x7c3c('0x20')];_0x1447ec['queue']=_0x2b1f61[_0x7c3c('0x21')];_0x1447ec[_0x7c3c('0x22')]=_0x2b1f61[_0x7c3c('0x23')];_0x1447ec[_0x7c3c('0x24')]=_0x2b1f61[_0x7c3c('0x23')];_0x1447ec['queuecallercomplete']=0x1;_0x1447ec[_0x7c3c('0x25')]=_0x2b1f61['endtime'];_0x1447ec[_0x7c3c('0x26')]=_0x2b1f61[_0x7c3c('0x27')];_0x1447ec['context']=_0x7c3c('0x28');_0x1447ec[_0x7c3c('0x29')]=_0x7c3c('0x2a');_0x1447ec[_0x7c3c('0x2b')]=0x0;_0x1447ec['assigned']=0x1;_0x1447ec[_0x7c3c('0x2c')]=_0x2b1f61['membername'];_0x1447ec[_0x7c3c('0x2d')]=_0x7c3c('0x2e');return BPromise[_0x7c3c('0xa')]()[_0x7c3c('0xb')](voiceQueueReport[_0x7c3c('0x2f')](_0x1447ec))[_0x7c3c('0xd')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x7c3c('0x30')]=function(_0x1b0ac0,_0x383057){return BPromise[_0x7c3c('0xa')]()['then'](cmHopper[_0x7c3c('0x30')](_0x1b0ac0,_0x383057))[_0x7c3c('0xd')](loggerCatch(_0x7c3c('0x31')));};exports[_0x7c3c('0x32')]=function(_0x1917d0){return BPromise[_0x7c3c('0xa')]()[_0x7c3c('0xb')](cmHopper[_0x7c3c('0x14')](_0x1917d0,!![],!![]))[_0x7c3c('0xd')](loggerCatch(_0x7c3c('0x33')));}; \ 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 49211a1..d9c6dc9 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 _0x8c7d=['Blacklist','starttime','endtime','logAgent','responsetime','logLookAgent','talktime','answertime','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','createBody','filterKey','type','dialAnswer','membername','active','scheduledat','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqos','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridNumber','match','lodash','preview','env','XCALLY_IP_AGI','seconds','inspect','loggerError','error','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','addVariables','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc'];(function(_0x21206e,_0xfc9c9d){var _0x24d329=function(_0x42ed68){while(--_0x42ed68){_0x21206e['push'](_0x21206e['shift']());}};_0x24d329(++_0xfc9c9d);}(_0x8c7d,0x172));var _0xd8c7=function(_0x271e08,_0x1ba43e){_0x271e08=_0x271e08-0x0;var _0x1b82fc=_0x8c7d[_0x271e08];return _0x1b82fc;};'use strict';var util=require('util');var _=require(_0xd8c7('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0xd8c7('0x1'));var ipAgi=process[_0xd8c7('0x2')][_0xd8c7('0x3')]||'127.0.0.1';function getSeconds(_0x30859d,_0x3b85f3){var _0x1e70f5=moment(_0x30859d)['milliseconds'](0x0);var _0x27fc8c=moment(_0x3b85f3)['milliseconds'](0x0);return _0x1e70f5['diff'](_0x27fc8c,_0xd8c7('0x4'));}exports['loggerCatch']=function(_0x411c14){return function(_0x3cfa15){logger['error'](_0x411c14,util[_0xd8c7('0x5')](_0x3cfa15,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x4acb16,_0x14e7a4){logger['info'](_0x4acb16,util[_0xd8c7('0x5')](_0x14e7a4,{'showHidden':![],'depth':null}));};exports[_0xd8c7('0x6')]=function(_0xaf58d1,_0xf18519){logger[_0xd8c7('0x7')](_0xaf58d1,util[_0xd8c7('0x5')](_0xf18519,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x356193){return function(_0x17d77c){logger['info'](_0x356193,util[_0xd8c7('0x5')](_0x17d77c,{'showHidden':![],'depth':null}));};};exports[_0xd8c7('0x8')]=function(_0x51a07c,_0x16dfdf,_0x588d62){return{'message':_0x51a07c,'unlock':_0x16dfdf,'active':_0x588d62};};exports['getCallerId']=function(_0x178595,_0x21af06,_0x43c7ec){if(!_[_0xd8c7('0x9')](_0x43c7ec)&&_0xd8c7('0xa')===typeof _0x43c7ec&&!_[_0xd8c7('0xb')](_0x43c7ec)){if(!_[_0xd8c7('0x9')](_0x21af06)&&_0xd8c7('0xa')===typeof _0x21af06&&!_[_0xd8c7('0xb')](_0x21af06)){return util[_0xd8c7('0xc')](_0xd8c7('0xd'),_0x21af06,_0x43c7ec);}return util['format'](_0xd8c7('0xd'),_0x43c7ec,_0x43c7ec);}if(!_[_0xd8c7('0x9')](_0x178595)&&_0xd8c7('0xa')===typeof _0x178595&&!_[_0xd8c7('0xb')](_0x178595)){return _0x178595;}return _0xd8c7('0xe');};exports['isActive']=function(_0x4c4064){if(_['isNil'](_0x4c4064)){return![];}return _0x4c4064;};exports[_0xd8c7('0xf')]=function(_0x3b5ae4,_0x9b6ba6,_0x112a5e,_0x10f04e,_0x164cdc,_0x52b9a7){var _0xd867db={'XMD-QUEUE':_0x9b6ba6[_0xd8c7('0x10')]?_0x9b6ba6[_0xd8c7('0x10')][_0xd8c7('0x11')]:'','XMD-CALLERID':_0x10f04e,'XMD-CALLERID-PREVIEW':_0x52b9a7?util[_0xd8c7('0xc')](_0xd8c7('0xd'),_0x52b9a7['calleridname'],_0x52b9a7[_0xd8c7('0x12')]):_0x10f04e,'XMD-DIALID':_0x164cdc,'XMD-CONTACTID':_0x9b6ba6[_0xd8c7('0x13')],'XMD-CDRTYPE':_0xd8c7('0x14'),'CALLERID(all)':_0x10f04e,'XMD-VOICEQUEUEID':_0x9b6ba6[_0xd8c7('0x15')],'XMD-DIALCHANNEL':_0x112a5e,'XMD-DIALTIMEOUT':_0x3b5ae4[_0xd8c7('0x16')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x3b5ae4['dialQueueProject2']?'g':'',_[_0xd8c7('0xb')](_0x3b5ae4[_0xd8c7('0x17')])?'':_0xd8c7('0x18')),'XMD-DIALURL':_0x3b5ae4['dialPreviewUrl']||'','XMD-AGI':_0x3b5ae4['dialQueueProject']?util['format'](_0xd8c7('0x19'),ipAgi,_0x3b5ae4[_0xd8c7('0x1a')]):_0xd8c7('0x1b'),'XMD-AGIAFTER':_0x3b5ae4['dialQueueProject2']?util[_0xd8c7('0xc')](_0xd8c7('0x19'),ipAgi,_0x3b5ae4[_0xd8c7('0x1c')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x52b9a7?_0x52b9a7[_0xd8c7('0x1d')]:'','XMD-ORIGINATECALLERIDNAME':_0x52b9a7?_0x52b9a7[_0xd8c7('0x1e')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xd8c7('0xb')](_0x3b5ae4['monitor_format'])){_0xd867db[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x3b5ae4['monitor_format'];_0xd867db[util['format']('%s',_0xd8c7('0x1f'))]=_0x164cdc;}if(_0x9b6ba6&&_0x9b6ba6[_0xd8c7('0x20')]){for(var _0x11b49b in _0x9b6ba6[_0xd8c7('0x20')]){if(_0x9b6ba6['Contact'][_0xd8c7('0x21')](_0x11b49b)){if(!_[_0xd8c7('0x22')](_0x9b6ba6['Contact'][_0x11b49b])&&_0x11b49b!=='id'&&_0x11b49b!==_0xd8c7('0x23')&&_0x11b49b!==_0xd8c7('0x24')&&_0x11b49b!=='updatedAt'){_0xd867db[util[_0xd8c7('0xc')](_0xd8c7('0x25'),_0xd8c7('0x26'),_[_0xd8c7('0x27')](_0x11b49b))]=_0x9b6ba6[_0xd8c7('0x20')][_0x11b49b];}}}}return _0xd867db;};exports[_0xd8c7('0x28')]=function(_0x9f0067){var _0x2f8925={};for(var _0x172840 in _0x9f0067){if(_0x9f0067[_0xd8c7('0x21')](_0x172840)){_0x2f8925[util[_0xd8c7('0xc')]('%s',_[_0xd8c7('0x29')](_0x172840))]=_0x9f0067[_0x172840];}}return{'variables':_0x2f8925};};exports[_0xd8c7('0x2a')]=function(_0x1bdbf2,_0x317b72){if(!_[_0xd8c7('0x22')](_0x1bdbf2)){if(_0x1bdbf2[_0xd8c7('0x21')](_0xd8c7('0x2b'))){if(_0x1bdbf2[_0xd8c7('0x2b')]>0x0){_0x1bdbf2[_0xd8c7('0x2b')]-=0x1;}else{logger[_0xd8c7('0x7')](_0xd8c7('0x2c'),_0x317b72);}}}else{logger[_0xd8c7('0x7')](_0xd8c7('0x2d'),_0x317b72);}};exports[_0xd8c7('0x2e')]=function(_0x30a8c5){var _0xb259c5=moment()[_0xd8c7('0xc')](_0xd8c7('0x2f'));_0x30a8c5[_0xd8c7('0x30')]=0xd;_0x30a8c5[_0xd8c7('0x31')]=_0xd8c7('0x32');_0x30a8c5[_0xd8c7('0x33')]=_0xb259c5;_0x30a8c5['responsetime']=_0xb259c5;_0x30a8c5[_0xd8c7('0x34')]=_0xb259c5;};exports[_0xd8c7('0x35')]=function(_0x2263bf,_0x28523c,_0x52c3f0){var _0x2434b4=moment()[_0xd8c7('0xc')](_0xd8c7('0x2f'));_0x2263bf[_0xd8c7('0x30')]=_0x28523c;_0x2263bf[_0xd8c7('0x31')]=_0x52c3f0;_0x2263bf['responsetime']=_0x2434b4;_0x2263bf['ringtime']=getSeconds(_0x2263bf[_0xd8c7('0x36')],_0x2263bf[_0xd8c7('0x33')]);};exports[_0xd8c7('0x37')]=function(_0x104bd4,_0x528070,_0x2373d1){_0x104bd4['membername']=_0x528070;_0x104bd4['UserId']=_0x2373d1;};exports['logCustomer']=function(_0x47a49e,_0x50a5ac,_0x2d82de){var _0x430710=moment()[_0xd8c7('0xc')](_0xd8c7('0x2f'));_0x47a49e[_0xd8c7('0x30')]=_0x50a5ac;_0x47a49e[_0xd8c7('0x31')]=_0x2d82de;_0x47a49e['responsetime']=_0x47a49e[_0xd8c7('0x36')]?_0x47a49e['responsetime']:_0x430710;_0x47a49e['endtime']=_0x47a49e[_0xd8c7('0x34')]?_0x47a49e[_0xd8c7('0x34')]:_0x430710;_0x47a49e['ringtime']=getSeconds(_0x47a49e[_0xd8c7('0x36')]||0x0,_0x47a49e[_0xd8c7('0x33')]||0x0);_0x47a49e[_0xd8c7('0x38')]=_0x47a49e[_0xd8c7('0x39')]?getSeconds(_0x47a49e[_0xd8c7('0x34')],_0x47a49e['answertime']):0x0;};exports['isFailure']=function(_0xfa75c3){return _0xfa75c3==='Failure';};exports[_0xd8c7('0x3a')]=function(_0x5e4f0b,_0x1d881b,_0x2f9846,_0x1fe71d,_0x50c345){var _0x3adb11=_0x1fe71d?_0xd8c7('0x3b'):_0x5e4f0b[_0xd8c7('0x3c')];_0x3adb11=_0x50c345?_0xd8c7('0x3d'):_0x3adb11;return{'actionid':_0x5e4f0b[_0xd8c7('0x3e')],'action':_0xd8c7('0x3f'),'channel':_0x5e4f0b[_0xd8c7('0x40')],'callerid':util[_0xd8c7('0xc')](_0xd8c7('0xd'),_0x3adb11,_0x5e4f0b['calleridnum']),'Exten':_0xd8c7('0x41'),'Context':_0xd8c7('0x42'),'Priority':'1','variable':_0x2f9846,'timeout':(_0x1d881b[_0xd8c7('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5e4f0b[_0xd8c7('0x3e')]};};exports[_0xd8c7('0x44')]=function(_0x2ee1ca){return _0x2ee1ca[_0xd8c7('0x45')]+_0x2ee1ca['countcongestionretry']+_0x2ee1ca['countnoanswerretry']+_0x2ee1ca[_0xd8c7('0x46')]+_0x2ee1ca[_0xd8c7('0x47')];};exports[_0xd8c7('0x48')]=function(_0x37fd78){var _0x18edf9=_[_0xd8c7('0x49')](_0x37fd78);_0x18edf9[_0xd8c7('0x30')]=0xf;_0x18edf9['statedesc']=_0xd8c7('0x4a');return _0x18edf9;};exports[_0xd8c7('0x4b')]=function(_0x4d5bd1,_0x26aad4,_0x3375f0){var _0x39d0bc={};_0x39d0bc[_0x26aad4]=_0x4d5bd1[_0x26aad4];_0x39d0bc['active']=![];_0x39d0bc['scheduledat']=moment()['add'](_0x3375f0,_0xd8c7('0x4c'))[_0xd8c7('0xc')](_0xd8c7('0x2f'));_0x39d0bc[_0xd8c7('0x13')]=_0x4d5bd1[_0xd8c7('0x13')];_0x39d0bc[_0xd8c7('0x4d')]=_0x4d5bd1[_0xd8c7('0x4d')];_0x39d0bc[_0xd8c7('0x15')]=_0x4d5bd1[_0xd8c7('0x15')]||undefined;return _0x39d0bc;};exports[_0xd8c7('0x4e')]=function(_0x1c5bb1,_0x5de652){if(!_[_0xd8c7('0x22')](_0x1c5bb1)){if(_0x1c5bb1[_0xd8c7('0x4f')]>0x0){_0x1c5bb1[_0xd8c7('0x4f')]-=0x1;}else{logger['error'](_0x5de652,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x5de652,_0xd8c7('0x50'));}};exports[_0xd8c7('0x51')]=function(_0x3d4b55){if(_0x3d4b55<=0x0){return!![];}return![];};exports['buildObj']=function(_0xd5301c,_0x35b19a,_0x5bcfd4){_0xd5301c['lastevent']=_0x35b19a;_0xd5301c[_0xd8c7('0x11')]=_0xd5301c[_0xd8c7('0x52')];_0xd5301c['interface']=_0xd5301c['channelAgent'];_0xd5301c[_0xd8c7('0x53')]=_0xd8c7('0x54');if(_0x5bcfd4){_0xd5301c[_0xd8c7('0x55')]=_0x5bcfd4[_0xd8c7('0x55')];}return _0xd5301c;};exports[_0xd8c7('0x56')]=function(_0x4b08d5){var _0x13c7a2={};_0x13c7a2['queue']=_0x4b08d5[_0xd8c7('0x52')];_0x13c7a2['interface']=_0x4b08d5[_0xd8c7('0x40')];_0x13c7a2[_0xd8c7('0x3e')]=_0x4b08d5[_0xd8c7('0x3e')];return _0x13c7a2;};exports[_0xd8c7('0x57')]=function(_0x2d6fb4){var _0x1b8f0b=[];for(var _0x5db491 in _0x2d6fb4){if(_0x2d6fb4[_0xd8c7('0x21')](_0x5db491)){if(!_[_0xd8c7('0x22')](_0x2d6fb4[_0x5db491])&&_0x2d6fb4[_0x5db491][_0xd8c7('0x30')]===_0xd8c7('0x58')&&_0x2d6fb4[_0x5db491][_0xd8c7('0x59')]===_0xd8c7('0x5a')){_0x1b8f0b[_0xd8c7('0x5b')](_0x2d6fb4[_0x5db491]['id']);}}}return _0x1b8f0b;};exports[_0xd8c7('0x5c')]=function(_0x333ffe){var _0x378a7d=moment()[_0xd8c7('0x5d')](0x0);var _0x4bcdfc=moment(_0x333ffe)[_0xd8c7('0x5d')](0x0);return _0x378a7d[_0xd8c7('0x5e')](_0x4bcdfc,'seconds');};exports[_0xd8c7('0x5f')]=function(_0x528245){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x528245[_0xd8c7('0x13')],'ListId':_0x528245[_0xd8c7('0x4d')],'VoiceQueueId':_0x528245[_0xd8c7('0x15')]||undefined,'CampaignId':_0x528245['CampaignId']||undefined};};exports[_0xd8c7('0x60')]=function(_0x41e180){if(_0x41e180===_0xd8c7('0x3e')||_0x41e180==='idContact'||_0x41e180===_0xd8c7('0x52')||_0x41e180===_0xd8c7('0x61')||_0x41e180==='campaigntype'||_0x41e180===_0xd8c7('0x62')||_0x41e180===_0xd8c7('0x63')||_0x41e180===_0xd8c7('0x40')||_0x41e180===_0xd8c7('0x3c')||_0x41e180===_0xd8c7('0x64')||_0x41e180==='calleridnum'||_0x41e180===_0xd8c7('0x65')||_0x41e180==='countbusyretry'||_0x41e180===_0xd8c7('0x66')||_0x41e180===_0xd8c7('0x67')||_0x41e180===_0xd8c7('0x68')||_0x41e180===_0xd8c7('0x69')||_0x41e180===_0xd8c7('0x6a')||_0x41e180===_0xd8c7('0x6b')||_0x41e180===_0xd8c7('0x6c')||_0x41e180==='ContactId'||_0x41e180===_0xd8c7('0x4d')||_0x41e180===_0xd8c7('0x6d')||_0x41e180===_0xd8c7('0x15')||_0x41e180===_0xd8c7('0x6e')||_0x41e180===_0xd8c7('0x6f')||_0x41e180==='xmd-queue'||_0x41e180===_0xd8c7('0x70')||_0x41e180===_0xd8c7('0x71')||_0x41e180===_0xd8c7('0x72')||_0x41e180===_0xd8c7('0x73')||_0x41e180===_0xd8c7('0x74')||_0x41e180===_0xd8c7('0x75')||_0x41e180===_0xd8c7('0x76')||_0x41e180===_0xd8c7('0x77')||_0x41e180===_0xd8c7('0x78')||_0x41e180===_0xd8c7('0x79')||_0x41e180===_0xd8c7('0x7a')||_0x41e180==='xmd-agi'||_0x41e180==='rtpaudioqos'||_0x41e180===_0xd8c7('0x7b')||_0x41e180===_0xd8c7('0x7c')||_0x41e180===_0xd8c7('0x7d')||_0x41e180===_0xd8c7('0x7e')||_0x41e180===_0xd8c7('0x7f')||_0x41e180===_0xd8c7('0x80')||_0x41e180==='rtpaudioqosrttbridged'||_0x41e180===_0xd8c7('0x81')||_0x41e180===_0xd8c7('0x7b')||_0x41e180==='rtpaudioqosjitter'||_0x41e180===_0xd8c7('0x7d')||_0x41e180===_0xd8c7('0x7e')||_0x41e180===_0xd8c7('0x7f')||_0x41e180===_0xd8c7('0x80')||_0x41e180===_0xd8c7('0x82')||_0x41e180===_0xd8c7('0x83')||_0x41e180===_0xd8c7('0x84')||_0x41e180===_0xd8c7('0x30')||_0x41e180===_0xd8c7('0x31')){return![];}return!![];};exports[_0xd8c7('0x85')]=function(_0x322bcd,_0x2362bc){var _0x4b0808,_0xcaf18e,_0x4d135e;if(_0x2362bc<=0x0){_0x2362bc=0x1;}_0x4b0808=new RegExp(_0xd8c7('0x86')+_0x2362bc+'}$');_0xcaf18e=Math['pow'](0xa,_0x2362bc-0x1);_0x4d135e=Math[_0xd8c7('0x87')](0xa,_0x2362bc)-0x1;return util[_0xd8c7('0xc')]('%s',_[_0xd8c7('0x88')](_0x322bcd,_0x4b0808,_[_0xd8c7('0x89')](_0xcaf18e,_0x4d135e)));};exports['extractCalleridName']=function(_0x565ccf){var _0x3d3e69=_0x565ccf['match'](/"(.*?)"/);return _0x3d3e69?_0x3d3e69[0x1]:_0x565ccf;};exports[_0xd8c7('0x8a')]=function(_0x58564f){var _0x3e7498=_0x58564f[_0xd8c7('0x8b')](/<(.*?)>/);return _0x3e7498?_0x3e7498[0x1]:_0x58564f;}; \ No newline at end of file +var _0xbd05=['originate','channelAgent','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildAcw','status','reachable','push','getDiff','diff','seconds','CampaignId','filterKey','type','active','scheduledat','countbusyretry','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialoptions','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','loggerCatch','error','logger','info','inspect','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','RECALL','BOOKED','uniqueid'];(function(_0x385e51,_0x6ea9fb){var _0x12d21f=function(_0x18e553){while(--_0x18e553){_0x385e51['push'](_0x385e51['shift']());}};_0x12d21f(++_0x6ea9fb);}(_0xbd05,0x15f));var _0x5bd0=function(_0x3f8282,_0x11b607){_0x3f8282=_0x3f8282-0x0;var _0x50f918=_0xbd05[_0x3f8282];return _0x50f918;};'use strict';var util=require('util');var _=require(_0x5bd0('0x0'));var moment=require(_0x5bd0('0x1'));var logger=require('../../../../config/logger')(_0x5bd0('0x2'));var ipAgi=process[_0x5bd0('0x3')][_0x5bd0('0x4')]||_0x5bd0('0x5');function getSeconds(_0x439945,_0x2fa2f3){var _0x43d782=moment(_0x439945)[_0x5bd0('0x6')](0x0);var _0xd55daa=moment(_0x2fa2f3)[_0x5bd0('0x6')](0x0);return _0x43d782['diff'](_0xd55daa,'seconds');}exports[_0x5bd0('0x7')]=function(_0x2643e8){return function(_0x409ab1){logger[_0x5bd0('0x8')](_0x2643e8,util['inspect'](_0x409ab1,{'showHidden':![],'depth':null}));};};exports[_0x5bd0('0x9')]=function(_0x5008aa,_0x5a9acc){logger[_0x5bd0('0xa')](_0x5008aa,util[_0x5bd0('0xb')](_0x5a9acc,{'showHidden':![],'depth':null}));};exports[_0x5bd0('0xc')]=function(_0x227c14,_0x3cb4a8){logger[_0x5bd0('0x8')](_0x227c14,util[_0x5bd0('0xb')](_0x3cb4a8,{'showHidden':![],'depth':null}));};exports[_0x5bd0('0xd')]=function(_0xc39de5){return function(_0x1de333){logger[_0x5bd0('0xa')](_0xc39de5,util[_0x5bd0('0xb')](_0x1de333,{'showHidden':![],'depth':null}));};};exports[_0x5bd0('0xe')]=function(_0x23a605,_0x7b564,_0x5b530a){return{'message':_0x23a605,'unlock':_0x7b564,'active':_0x5b530a};};exports[_0x5bd0('0xf')]=function(_0x40b5d2,_0x323f24,_0x3b1dac){if(!_['isUndefined'](_0x3b1dac)&&_0x5bd0('0x10')===typeof _0x3b1dac&&!_[_0x5bd0('0x11')](_0x3b1dac)){if(!_[_0x5bd0('0x12')](_0x323f24)&&_0x5bd0('0x10')===typeof _0x323f24&&!_[_0x5bd0('0x11')](_0x323f24)){return util['format'](_0x5bd0('0x13'),_0x323f24,_0x3b1dac);}return util[_0x5bd0('0x14')](_0x5bd0('0x13'),_0x3b1dac,_0x3b1dac);}if(!_[_0x5bd0('0x12')](_0x40b5d2)&&_0x5bd0('0x10')===typeof _0x40b5d2&&!_[_0x5bd0('0x11')](_0x40b5d2)){return _0x40b5d2;}return _0x5bd0('0x15');};exports[_0x5bd0('0x16')]=function(_0x50bccb){if(_[_0x5bd0('0x17')](_0x50bccb)){return![];}return _0x50bccb;};exports['addVariables']=function(_0x17344a,_0x5a965f,_0x134895,_0x2df451,_0x4d3d71,_0x23b58b){var _0x525c1e={'XMD-QUEUE':_0x5a965f[_0x5bd0('0x18')]?_0x5a965f[_0x5bd0('0x18')][_0x5bd0('0x19')]:'','XMD-CALLERID':_0x2df451,'XMD-CALLERID-PREVIEW':_0x23b58b?util['format'](_0x5bd0('0x13'),_0x23b58b[_0x5bd0('0x1a')],_0x23b58b[_0x5bd0('0x1b')]):_0x2df451,'XMD-DIALID':_0x4d3d71,'XMD-CONTACTID':_0x5a965f[_0x5bd0('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2df451,'XMD-VOICEQUEUEID':_0x5a965f['VoiceQueueId'],'XMD-DIALCHANNEL':_0x134895,'XMD-DIALTIMEOUT':_0x17344a['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x5bd0('0x14')](_0x5bd0('0x1d'),_0x17344a[_0x5bd0('0x1e')]?'g':'',_[_0x5bd0('0x11')](_0x17344a['monitor_format'])?'':_0x5bd0('0x1f')),'XMD-DIALURL':_0x17344a['dialPreviewUrl']||'','XMD-AGI':_0x17344a[_0x5bd0('0x20')]?util['format'](_0x5bd0('0x21'),ipAgi,_0x17344a[_0x5bd0('0x20')]):_0x5bd0('0x22'),'XMD-AGIAFTER':_0x17344a['dialQueueProject2']?util[_0x5bd0('0x14')](_0x5bd0('0x21'),ipAgi,_0x17344a['dialQueueProject2']):_0x5bd0('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x23b58b?_0x23b58b['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x23b58b?_0x23b58b['originatecalleridname']:'','XMD-DESTINATION':_0x5bd0('0x23'),'SIPADDHEADER':_0x5bd0('0x24')};if(!_['isEmpty'](_0x17344a[_0x5bd0('0x25')])){_0x525c1e[util[_0x5bd0('0x14')]('%s',_0x5bd0('0x26'))]=_0x17344a[_0x5bd0('0x25')];_0x525c1e[util['format']('%s',_0x5bd0('0x27'))]=_0x4d3d71;}if(_0x5a965f&&_0x5a965f[_0x5bd0('0x28')]){for(var _0x395638 in _0x5a965f[_0x5bd0('0x28')]){if(_0x5a965f[_0x5bd0('0x28')][_0x5bd0('0x29')](_0x395638)){if(!_[_0x5bd0('0x17')](_0x5a965f[_0x5bd0('0x28')][_0x395638])&&_0x395638!=='id'&&_0x395638!==_0x5bd0('0x2a')&&_0x395638!==_0x5bd0('0x2b')&&_0x395638!==_0x5bd0('0x2c')){_0x525c1e[util[_0x5bd0('0x14')]('%s%s',_0x5bd0('0x2d'),_[_0x5bd0('0x2e')](_0x395638))]=_0x5a965f[_0x5bd0('0x28')][_0x395638];}}}}return _0x525c1e;};exports[_0x5bd0('0x2f')]=function(_0x5b6b42){var _0x3a402a={};for(var _0x4b7a3f in _0x5b6b42){if(_0x5b6b42[_0x5bd0('0x29')](_0x4b7a3f)){_0x3a402a[util[_0x5bd0('0x14')]('%s',_[_0x5bd0('0x30')](_0x4b7a3f))]=_0x5b6b42[_0x4b7a3f];}}return{'variables':_0x3a402a};};exports['updateOriginated']=function(_0x576f8d,_0x316286){if(!_['isNil'](_0x576f8d)){if(_0x576f8d[_0x5bd0('0x29')](_0x5bd0('0x31'))){if(_0x576f8d['originated']>0x0){_0x576f8d[_0x5bd0('0x31')]-=0x1;}else{logger[_0x5bd0('0x8')](_0x5bd0('0x32'),_0x316286);}}}else{logger['error'](_0x5bd0('0x33'),_0x316286);}};exports[_0x5bd0('0x34')]=function(_0x45dd37){var _0x4757f4=moment()[_0x5bd0('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x45dd37[_0x5bd0('0x35')]=0xd;_0x45dd37[_0x5bd0('0x36')]=_0x5bd0('0x37');_0x45dd37[_0x5bd0('0x38')]=_0x4757f4;_0x45dd37[_0x5bd0('0x39')]=_0x4757f4;_0x45dd37['endtime']=_0x4757f4;};exports[_0x5bd0('0x3a')]=function(_0x517337,_0x1327bd,_0x36e421){var _0x24bb7b=moment()[_0x5bd0('0x14')](_0x5bd0('0x3b'));_0x517337[_0x5bd0('0x35')]=_0x1327bd;_0x517337[_0x5bd0('0x36')]=_0x36e421;_0x517337[_0x5bd0('0x39')]=_0x24bb7b;_0x517337[_0x5bd0('0x3c')]=getSeconds(_0x517337[_0x5bd0('0x39')],_0x517337[_0x5bd0('0x38')]);};exports[_0x5bd0('0x3d')]=function(_0x476ed5,_0x5f0810,_0x4af1d3){_0x476ed5[_0x5bd0('0x3e')]=_0x5f0810;_0x476ed5[_0x5bd0('0x3f')]=_0x4af1d3;};exports[_0x5bd0('0x40')]=function(_0x41753b,_0x945a45,_0x41bb42){var _0x24ab0e=moment()[_0x5bd0('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x41753b[_0x5bd0('0x35')]=_0x945a45;_0x41753b[_0x5bd0('0x36')]=_0x41bb42;_0x41753b['responsetime']=_0x41753b[_0x5bd0('0x39')]?_0x41753b[_0x5bd0('0x39')]:_0x24ab0e;_0x41753b[_0x5bd0('0x41')]=_0x41753b[_0x5bd0('0x41')]?_0x41753b['endtime']:_0x24ab0e;_0x41753b[_0x5bd0('0x3c')]=getSeconds(_0x41753b[_0x5bd0('0x39')]||0x0,_0x41753b['starttime']||0x0);_0x41753b[_0x5bd0('0x42')]=_0x41753b[_0x5bd0('0x43')]?getSeconds(_0x41753b[_0x5bd0('0x41')],_0x41753b[_0x5bd0('0x43')]):0x0;};exports[_0x5bd0('0x44')]=function(_0x5a6893){return _0x5a6893==='Failure';};exports['variablesAction']=function(_0x43f183,_0x318321,_0x19177a,_0x5c2261,_0xfdb6c1){var _0x1f860d=_0x5c2261?_0x5bd0('0x45'):_0x43f183['calleridname'];_0x1f860d=_0xfdb6c1?_0x5bd0('0x46'):_0x1f860d;return{'actionid':_0x43f183[_0x5bd0('0x47')],'action':_0x5bd0('0x48'),'channel':_0x43f183[_0x5bd0('0x49')],'callerid':util['format'](_0x5bd0('0x13'),_0x1f860d,_0x43f183['calleridnum']),'Exten':_0x5bd0('0x23'),'Context':'from-sip','Priority':'1','variable':_0x19177a,'timeout':(_0x318321[_0x5bd0('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x43f183['uniqueid']};};exports[_0x5bd0('0x4b')]=function(_0x3cb5aa){return _0x3cb5aa['countbusyretry']+_0x3cb5aa[_0x5bd0('0x4c')]+_0x3cb5aa[_0x5bd0('0x4d')]+_0x3cb5aa[_0x5bd0('0x4e')]+_0x3cb5aa['countnosuchnumberretry'];};exports[_0x5bd0('0x4f')]=function(_0x444c52){var _0x59e7cb=_[_0x5bd0('0x50')](_0x444c52);_0x59e7cb[_0x5bd0('0x35')]=0xf;_0x59e7cb['statedesc']=_0x5bd0('0x51');return _0x59e7cb;};exports[_0x5bd0('0x52')]=function(_0x3aca5b,_0x5b40e0,_0x2854a7){var _0xc368a2={};_0xc368a2[_0x5b40e0]=_0x3aca5b[_0x5b40e0];_0xc368a2['active']=![];_0xc368a2['scheduledat']=moment()[_0x5bd0('0x53')](_0x2854a7,_0x5bd0('0x54'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0xc368a2[_0x5bd0('0x1c')]=_0x3aca5b[_0x5bd0('0x1c')];_0xc368a2[_0x5bd0('0x55')]=_0x3aca5b[_0x5bd0('0x55')];_0xc368a2[_0x5bd0('0x56')]=_0x3aca5b[_0x5bd0('0x56')]||undefined;return _0xc368a2;};exports[_0x5bd0('0x57')]=function(_0x459eaa,_0x12b600){if(!_[_0x5bd0('0x17')](_0x459eaa)){if(_0x459eaa[_0x5bd0('0x58')]>0x0){_0x459eaa[_0x5bd0('0x58')]-=0x1;}else{logger[_0x5bd0('0x8')](_0x12b600,_0x5bd0('0x59'));}}else{logger[_0x5bd0('0x8')](_0x12b600,_0x5bd0('0x5a'));}};exports[_0x5bd0('0x5b')]=function(_0x4e053f){if(_0x4e053f<=0x0){return!![];}return![];};exports[_0x5bd0('0x5c')]=function(_0x194d22,_0xc40545,_0xbc20a4){_0x194d22[_0x5bd0('0x5d')]=_0xc40545;_0x194d22[_0x5bd0('0x19')]=_0x194d22[_0x5bd0('0x5e')];_0x194d22[_0x5bd0('0x5f')]=_0x194d22[_0x5bd0('0x49')];_0x194d22[_0x5bd0('0x60')]='voice';if(_0xbc20a4){_0x194d22[_0x5bd0('0x61')]=_0xbc20a4['mandatoryDisposition'];}return _0x194d22;};exports[_0x5bd0('0x62')]=function(_0x5b85d5){var _0x31e2b8={};_0x31e2b8[_0x5bd0('0x5e')]=_0x5b85d5[_0x5bd0('0x5e')];_0x31e2b8[_0x5bd0('0x5f')]=_0x5b85d5[_0x5bd0('0x49')];_0x31e2b8[_0x5bd0('0x47')]=_0x5b85d5[_0x5bd0('0x47')];return _0x31e2b8;};exports['agentReadyId']=function(_0x287543){var _0xdd40e5=[];for(var _0x215143 in _0x287543){if(_0x287543[_0x5bd0('0x29')](_0x215143)){if(!_[_0x5bd0('0x17')](_0x287543[_0x215143])&&_0x287543[_0x215143]['state']==='not_inuse'&&_0x287543[_0x215143][_0x5bd0('0x63')]===_0x5bd0('0x64')){_0xdd40e5[_0x5bd0('0x65')](_0x287543[_0x215143]['id']);}}}return _0xdd40e5;};exports[_0x5bd0('0x66')]=function(_0x1937fe){var _0x43cb54=moment()[_0x5bd0('0x6')](0x0);var _0x179f74=moment(_0x1937fe)['milliseconds'](0x0);return _0x43cb54[_0x5bd0('0x67')](_0x179f74,_0x5bd0('0x68'));};exports['createBody']=function(_0x4332e4){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4332e4[_0x5bd0('0x1c')],'ListId':_0x4332e4[_0x5bd0('0x55')],'VoiceQueueId':_0x4332e4[_0x5bd0('0x56')]||undefined,'CampaignId':_0x4332e4[_0x5bd0('0x69')]||undefined};};exports[_0x5bd0('0x6a')]=function(_0x11dc59){if(_0x11dc59===_0x5bd0('0x47')||_0x11dc59==='idContact'||_0x11dc59===_0x5bd0('0x5e')||_0x11dc59===_0x5bd0('0x6b')||_0x11dc59==='campaigntype'||_0x11dc59==='dialAnswer'||_0x11dc59===_0x5bd0('0x3e')||_0x11dc59===_0x5bd0('0x49')||_0x11dc59===_0x5bd0('0x1a')||_0x11dc59===_0x5bd0('0x6c')||_0x11dc59===_0x5bd0('0x1b')||_0x11dc59===_0x5bd0('0x6d')||_0x11dc59===_0x5bd0('0x6e')||_0x11dc59===_0x5bd0('0x4c')||_0x11dc59===_0x5bd0('0x4d')||_0x11dc59==='countglobal'||_0x11dc59===_0x5bd0('0x6f')||_0x11dc59===_0x5bd0('0x70')||_0x11dc59===_0x5bd0('0x71')||_0x11dc59===_0x5bd0('0x72')||_0x11dc59===_0x5bd0('0x1c')||_0x11dc59===_0x5bd0('0x55')||_0x11dc59===_0x5bd0('0x3f')||_0x11dc59==='VoiceQueueId'||_0x11dc59==='sipcallid'||_0x11dc59===_0x5bd0('0x73')||_0x11dc59===_0x5bd0('0x74')||_0x11dc59===_0x5bd0('0x75')||_0x11dc59==='xmd-listid'||_0x11dc59==='xmd-dialurl'||_0x11dc59==='xmd-dialtimeout'||_0x11dc59===_0x5bd0('0x76')||_0x11dc59==='xmd-dialid'||_0x11dc59==='xmd-dialchannel'||_0x11dc59==='xmd-contactid'||_0x11dc59===_0x5bd0('0x77')||_0x11dc59===_0x5bd0('0x78')||_0x11dc59===_0x5bd0('0x79')||_0x11dc59===_0x5bd0('0x7a')||_0x11dc59===_0x5bd0('0x7b')||_0x11dc59===_0x5bd0('0x7c')||_0x11dc59==='rtpaudioqosjitter'||_0x11dc59===_0x5bd0('0x7d')||_0x11dc59===_0x5bd0('0x7e')||_0x11dc59===_0x5bd0('0x7f')||_0x11dc59===_0x5bd0('0x80')||_0x11dc59===_0x5bd0('0x81')||_0x11dc59===_0x5bd0('0x7b')||_0x11dc59===_0x5bd0('0x7c')||_0x11dc59===_0x5bd0('0x82')||_0x11dc59===_0x5bd0('0x7d')||_0x11dc59===_0x5bd0('0x7e')||_0x11dc59===_0x5bd0('0x7f')||_0x11dc59===_0x5bd0('0x80')||_0x11dc59===_0x5bd0('0x81')||_0x11dc59===_0x5bd0('0x83')||_0x11dc59===_0x5bd0('0x84')||_0x11dc59===_0x5bd0('0x35')||_0x11dc59==='statedesc'){return![];}return!![];};exports[_0x5bd0('0x85')]=function(_0x33f238,_0x54af11){var _0x2887fe,_0x2d09c1,_0x2e0ae0;if(_0x54af11<=0x0){_0x54af11=0x1;}_0x2887fe=new RegExp(_0x5bd0('0x86')+_0x54af11+'}$');_0x2d09c1=Math[_0x5bd0('0x87')](0xa,_0x54af11-0x1);_0x2e0ae0=Math[_0x5bd0('0x87')](0xa,_0x54af11)-0x1;return util['format']('%s',_[_0x5bd0('0x88')](_0x33f238,_0x2887fe,_[_0x5bd0('0x89')](_0x2d09c1,_0x2e0ae0)));};exports[_0x5bd0('0x8a')]=function(_0x31457c){var _0x148910=_0x31457c[_0x5bd0('0x8b')](/"(.*?)"/);return _0x148910?_0x148910[0x1]:_0x31457c;};exports[_0x5bd0('0x8c')]=function(_0x410c08){var _0x2feee9=_0x410c08[_0x5bd0('0x8b')](/<(.*?)>/);return _0x2feee9?_0x2feee9[0x1]:_0x410c08;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index f4603e7..2566352 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 _0xeca2=['queueremove','boolean','reload','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xeca2,0x1a5));var _0x2eca=function(_0x577dce,_0x47f8b3){_0x577dce=_0x577dce-0x0;var _0x2fbe85=_0xeca2[_0x577dce];return _0x2fbe85;};'use strict';exports[_0x2eca('0x0')]={'queue':{'type':_0x2eca('0x1'),'required':!![]},'interface':{'type':_0x2eca('0x1'),'required':!![]},'membername':{'type':_0x2eca('0x1'),'required':!![]},'penalty':{'type':_0x2eca('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x2eca('0x3')]={'queue':{'type':_0x2eca('0x1'),'required':!![]},'interface':{'type':_0x2eca('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x2eca('0x1'),'required':!![]},'paused':{'type':_0x2eca('0x4')},'reason':{'type':'string','required':![]}};exports[_0x2eca('0x5')]={'module':{'type':_0x2eca('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x2eca('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x2eca('0x1'),'required':!![]},'filename':{'type':_0x2eca('0x1')},'format':{'type':_0x2eca('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x2eca('0x6')]={'uniqueid':{'type':_0x2eca('0x1'),'required':!![]}};exports[_0x2eca('0x7')]={'uniqueid':{'type':_0x2eca('0x1'),'required':!![]},'exten':{'type':_0x2eca('0x1'),'required':!![]},'context':{'type':_0x2eca('0x1')}}; \ No newline at end of file +var _0xc5ae=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','queuepause','boolean'];(function(_0x24cd72,_0x53ba5c){var _0x2989ea=function(_0x315473){while(--_0x315473){_0x24cd72['push'](_0x24cd72['shift']());}};_0x2989ea(++_0x53ba5c);}(_0xc5ae,0x113));var _0xec5a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc5ae[_0x14add3];return _0x4a174f;};'use strict';exports[_0xec5a('0x0')]={'queue':{'type':_0xec5a('0x1'),'required':!![]},'interface':{'type':_0xec5a('0x1'),'required':!![]},'membername':{'type':_0xec5a('0x1'),'required':!![]},'penalty':{'type':_0xec5a('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0xec5a('0x1'),'required':!![]},'interface':{'type':_0xec5a('0x1'),'required':!![]}};exports[_0xec5a('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xec5a('0x4')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xec5a('0x1'),'required':!![]}};exports[_0xec5a('0x5')]={'uniqueid':{'type':_0xec5a('0x1'),'required':!![]},'filename':{'type':_0xec5a('0x1')},'format':{'type':_0xec5a('0x1')},'mixmonitorid':{'type':_0xec5a('0x1')}};exports[_0xec5a('0x6')]={'uniqueid':{'type':_0xec5a('0x1'),'required':!![]}};exports[_0xec5a('0x7')]={'uniqueid':{'type':_0xec5a('0x1'),'required':!![]},'exten':{'type':_0xec5a('0x1'),'required':!![]},'context':{'type':_0xec5a('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 166e5e2..43f0860 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 _0x3601=['outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','initTelephones','isUndefined','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','diff','queuecallercomplete','duration','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3601,0x9d));var _0x1360=function(_0x1786a8,_0x4ab136){_0x1786a8=_0x1786a8-0x0;var _0x295420=_0x3601[_0x1786a8];return _0x295420;};'use strict';var BPromise=require(_0x1360('0x0'));var util=require(_0x1360('0x1'));var _=require(_0x1360('0x2'));var moment=require('moment');var Agent=require(_0x1360('0x3'));var Telephone=require(_0x1360('0x4'));var Trunk=require(_0x1360('0x5'));var VoiceQueue=require(_0x1360('0x6'));var Trigger=require(_0x1360('0x7'));var Template=require(_0x1360('0x8'));var Campaign=require(_0x1360('0x9'));var VoiceExtension=require(_0x1360('0xa'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x1360('0xb'));var FreshdeskAccount=require(_0x1360('0xc'));var SugarcrmAccount=require(_0x1360('0xd'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x1360('0xe'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x1360('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x1360('0x10'));var FaxAccount=require(_0x1360('0x11'));var Realtime=function(){this[_0x1360('0x12')]={};this[_0x1360('0x13')]={};this[_0x1360('0x14')]={};this[_0x1360('0x15')]={};this[_0x1360('0x16')]={};this[_0x1360('0x17')]={};this[_0x1360('0x18')]={};this[_0x1360('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x1360('0x1a')]={};this[_0x1360('0x1b')]={};this[_0x1360('0x1c')]={};this[_0x1360('0x1d')]={};this['timers']={};this[_0x1360('0x1e')]={};this[_0x1360('0x1f')]={};this[_0x1360('0x20')]={};this[_0x1360('0x21')]={};this[_0x1360('0x22')]={};this[_0x1360('0x23')]={};this[_0x1360('0x24')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0x1360('0x25')]={};this[_0x1360('0x26')]={};this[_0x1360('0x27')]={};};function freeIsNotKey(_0x1b4a98,_0x18d3d7,_0xc166c0){var _0x3e01db=_[_0x1360('0x28')](_0x1b4a98,function(_0x28c429,_0x5ef92a){return _0x28c429[_0xc166c0];});for(var _0xdc0d44 in _0x18d3d7){if(_0x18d3d7[_0x1360('0x29')](_0xdc0d44)){if(!_0x3e01db[_0xdc0d44]){delete _0x18d3d7[_0xdc0d44];}}}}function freeIsNotKeySip(_0x5a12fc,_0x3b1fa2){var _0x31333f=_['mapKeys'](_0x5a12fc,function(_0x29bc88,_0x2c2b1b){return util[_0x1360('0x2a')](_0x1360('0x2b'),_0x29bc88[_0x1360('0x2c')]);});for(var _0x443369 in _0x3b1fa2){if(_0x3b1fa2[_0x1360('0x29')](_0x443369)){if(!_0x31333f[_0x443369]){delete _0x3b1fa2[_0x443369];}}}}function freeIsNotKeyAgent(_0x2b6af6,_0x4ca9e9){var _0x238665=_['mapKeys'](_0x2b6af6,function(_0x272e2b,_0x22dcc4){var _0x2f39f3=_['isNil'](_0x272e2b[_0x1360('0x2d')])?util[_0x1360('0x2a')](_0x1360('0x2b'),_0x272e2b[_0x1360('0x2c')]):_0x272e2b[_0x1360('0x2d')];return _0x2f39f3;});for(var _0x4f614c in _0x4ca9e9){if(_0x4ca9e9[_0x1360('0x29')](_0x4f614c)){if(!_0x238665[_0x4f614c]){delete _0x4ca9e9[_0x4f614c];}}}}function clearVoiceCallReports(_0x4ba550){_0x4ba550[_0x1360('0x2e')]=0x0;_0x4ba550[_0x1360('0x2f')]=0x0;_0x4ba550['sumHoldTime']=0x0;_0x4ba550[_0x1360('0x30')]=0x0;_0x4ba550['sumBillable']=0x0;}function clearCampaigns(_0x1069c0){if(!_[_0x1360('0x31')](_0x1069c0)){for(var _0x453b54 in _0x1069c0){if(_0x1069c0['hasOwnProperty'](_0x453b54)){_0x1069c0[_0x453b54][_0x1360('0x32')]=0x0;_0x1069c0[_0x453b54][_0x1360('0x33')]=0x0;}}}}function clearVoiceQueues(_0x11dc18){if(!_[_0x1360('0x31')](_0x11dc18)){for(var _0x630b30 in _0x11dc18){if(_0x11dc18['hasOwnProperty'](_0x630b30)){_0x11dc18[_0x630b30][_0x1360('0x2e')]=0x0;_0x11dc18[_0x630b30][_0x1360('0x2f')]=0x0;_0x11dc18[_0x630b30][_0x1360('0x34')]=0x0;_0x11dc18[_0x630b30][_0x1360('0x35')]=0x0;_0x11dc18[_0x630b30][_0x1360('0x36')]=0x0;_0x11dc18[_0x630b30][_0x1360('0x30')]=0x0;_0x11dc18[_0x630b30][_0x1360('0x37')]=0x0;_0x11dc18[_0x630b30][_0x1360('0x38')]=0x0;_0x11dc18[_0x630b30]['outboundNoAnswerCallsDay']=0x0;_0x11dc18[_0x630b30][_0x1360('0x39')]=0x0;_0x11dc18[_0x630b30][_0x1360('0x3a')]=0x0;_0x11dc18[_0x630b30]['outboundNoSuchCallsDay']=0x0;_0x11dc18[_0x630b30][_0x1360('0x3b')]=0x0;_0x11dc18[_0x630b30]['outboundDropCallsDayTimeout']=0x0;_0x11dc18[_0x630b30]['outboundDropCallsDayCallersExit']=0x0;_0x11dc18[_0x630b30][_0x1360('0x3c')]=0x0;_0x11dc18[_0x630b30][_0x1360('0x3d')]=0x0;_0x11dc18[_0x630b30][_0x1360('0x3e')]=0x0;_0x11dc18[_0x630b30][_0x1360('0x3f')]=0x0;_0x11dc18[_0x630b30]['outboundAnswerAgiCallsDay']=0x0;_0x11dc18[_0x630b30][_0x1360('0x40')]=0x0;_0x11dc18[_0x630b30][_0x1360('0x41')]=!![];}}}}Realtime['prototype'][_0x1360('0x42')]=function(_0x1484ea,_0x2b2008){for(var _0x5136c9 in _0x2b2008){if(_0x1484ea[_0x1360('0x29')](_0x5136c9)){_0x1484ea[_0x5136c9]=_0x2b2008[_0x5136c9];}}};Realtime[_0x1360('0x43')][_0x1360('0x44')]=function(){var _0x203865=this;return function(_0x3a0321){if(_0x3a0321){freeIsNotKeyAgent(_0x3a0321,_0x203865[_0x1360('0x12')]);for(var _0x494151=0x0,_0x440bd8={},_0x47584e={};_0x494151<_0x3a0321[_0x1360('0x45')];_0x494151+=0x1){_0x440bd8=_0x3a0321[_0x494151];var _0x47c485=_[_0x1360('0x46')](_0x440bd8['interface'])?util['format'](_0x1360('0x2b'),_0x440bd8[_0x1360('0x2c')]):_0x440bd8[_0x1360('0x2d')];if(_['isUndefined'](_0x203865['agents'][_0x47c485])){_0x203865[_0x1360('0x12')][_0x47c485]=new Agent(_0x440bd8);}else{_0x203865[_0x1360('0x42')](_0x203865[_0x1360('0x12')][_0x47c485],_0x440bd8);}}}return _0x203865[_0x1360('0x12')];};};Realtime[_0x1360('0x43')][_0x1360('0x47')]=function(){var _0x5bd4af=this;return function(_0x77e18c){if(_0x77e18c){freeIsNotKeySip(_0x77e18c,_0x5bd4af[_0x1360('0x13')]);for(var _0x1f6483=0x0,_0x509769={},_0x326891={};_0x1f6483<_0x77e18c[_0x1360('0x45')];_0x1f6483+=0x1){_0x509769=_0x77e18c[_0x1f6483];if(_[_0x1360('0x48')](_0x5bd4af['telephones'][util['format']('SIP/%s',_0x509769[_0x1360('0x2c')])])){_0x5bd4af[_0x1360('0x13')][util[_0x1360('0x2a')](_0x1360('0x2b'),_0x509769[_0x1360('0x2c')])]=new Telephone(_0x509769);}else{_0x5bd4af[_0x1360('0x42')](_0x5bd4af[_0x1360('0x13')][util[_0x1360('0x2a')](_0x1360('0x2b'),_0x509769[_0x1360('0x2c')])],_0x509769);}}}return _0x5bd4af[_0x1360('0x13')];};};Realtime['prototype'][_0x1360('0x49')]=function(){var _0x51861a=this;return function(_0x1d6c9a){if(_0x1d6c9a){freeIsNotKeySip(_0x1d6c9a,_0x51861a[_0x1360('0x14')]);for(var _0x23f364=0x0,_0x3890ef={},_0x529f1c={};_0x23f364<_0x1d6c9a[_0x1360('0x45')];_0x23f364+=0x1){_0x3890ef=_0x1d6c9a[_0x23f364];if(_['isUndefined'](_0x51861a[_0x1360('0x14')][util[_0x1360('0x2a')](_0x1360('0x2b'),_0x3890ef[_0x1360('0x2c')])])){_0x51861a[_0x1360('0x14')][util[_0x1360('0x2a')](_0x1360('0x2b'),_0x3890ef[_0x1360('0x2c')])]=new Trunk(_0x3890ef);}else{_0x51861a[_0x1360('0x42')](_0x51861a[_0x1360('0x14')][util[_0x1360('0x2a')](_0x1360('0x2b'),_0x3890ef[_0x1360('0x2c')])],_0x3890ef);}}}return _0x51861a[_0x1360('0x14')];};};Realtime[_0x1360('0x43')][_0x1360('0x4a')]=function(){var _0x1c7332=this;return function(_0x57edaf){if(_0x57edaf){freeIsNotKey(_0x57edaf,_0x1c7332[_0x1360('0x15')],'name');for(var _0x1b61c5=0x0,_0x41c189={},_0x38dfcd={};_0x1b61c5<_0x57edaf[_0x1360('0x45')];_0x1b61c5+=0x1){_0x41c189=_0x57edaf[_0x1b61c5];if(_['isUndefined'](_0x1c7332[_0x1360('0x15')][_0x41c189[_0x1360('0x2c')]])){_0x1c7332[_0x1360('0x15')][_0x41c189[_0x1360('0x2c')]]=new VoiceQueue(_0x41c189);}else{_0x1c7332['mergeFromDatabase'](_0x1c7332[_0x1360('0x15')][_0x41c189[_0x1360('0x2c')]],_0x41c189);}}}return _0x1c7332[_0x1360('0x15')];};};Realtime[_0x1360('0x43')][_0x1360('0x4b')]=function(){var _0x34c28c=this;return function(_0xe9bd4d){if(_0xe9bd4d){freeIsNotKey(_0xe9bd4d,_0x34c28c[_0x1360('0x16')],'id');for(var _0x5caa20=0x0,_0x6074ea={},_0x368824={};_0x5caa20<_0xe9bd4d[_0x1360('0x45')];_0x5caa20+=0x1){_0x6074ea=_0xe9bd4d[_0x5caa20];if(_[_0x1360('0x48')](_0x34c28c[_0x1360('0x16')][_0x6074ea['id']])){_0x34c28c[_0x1360('0x16')][_0x6074ea['id']]=new Trigger(_0x6074ea);}else{_0x34c28c['mergeFromDatabase'](_0x34c28c['triggers'][_0x6074ea['id']],_0x6074ea);}}}return _0x34c28c[_0x1360('0x16')];};};Realtime['prototype'][_0x1360('0x4c')]=function(){var _0x57a19b=this;return function(_0x24ed5d){if(_0x24ed5d){freeIsNotKey(_0x24ed5d,_0x57a19b[_0x1360('0x18')],'id');for(var _0x59c6cd=0x0,_0x366ebd={},_0x1a289f={};_0x59c6cd<_0x24ed5d[_0x1360('0x45')];_0x59c6cd+=0x1){_0x366ebd=_0x24ed5d[_0x59c6cd];if(_[_0x1360('0x48')](_0x57a19b['templates'][_0x366ebd['id']])){_0x57a19b[_0x1360('0x18')][_0x366ebd['id']]=new Template(_0x366ebd);}else{_0x57a19b[_0x1360('0x42')](_0x57a19b[_0x1360('0x18')][_0x366ebd['id']],_0x366ebd);}}}return _0x57a19b[_0x1360('0x18')];};};Realtime[_0x1360('0x43')][_0x1360('0x4d')]=function(){var _0x155cf1=this;return function(_0x2d796a){if(_0x2d796a){freeIsNotKey(_0x2d796a,_0x155cf1[_0x1360('0x1f')],'id');for(var _0x2bb4ec=0x0,_0x38a690={},_0x1d859d={};_0x2bb4ec<_0x2d796a[_0x1360('0x45')];_0x2bb4ec+=0x1){_0x38a690=_0x2d796a[_0x2bb4ec];if(_[_0x1360('0x48')](_0x155cf1[_0x1360('0x1f')][_0x38a690['id']])){_0x155cf1[_0x1360('0x1f')][_0x38a690['id']]=new ZendeskAccount(_0x38a690);}else{_0x155cf1[_0x1360('0x42')](_0x155cf1[_0x1360('0x1f')][_0x38a690['id']],_0x38a690);}}}return _0x155cf1[_0x1360('0x1f')];};};Realtime[_0x1360('0x43')][_0x1360('0x4e')]=function(){var _0x3bb399=this;return function(_0x2c517c){if(_0x2c517c){freeIsNotKey(_0x2c517c,_0x3bb399['salesforceAccounts'],'id');for(var _0x4fcb1f=0x0,_0x1da5a7={},_0xe323f6={};_0x4fcb1f<_0x2c517c[_0x1360('0x45')];_0x4fcb1f+=0x1){_0x1da5a7=_0x2c517c[_0x4fcb1f];if(_['isUndefined'](_0x3bb399[_0x1360('0x20')][_0x1da5a7['id']])){_0x3bb399[_0x1360('0x20')][_0x1da5a7['id']]=new SalesforceAccount(_0x1da5a7);}else{_0x3bb399[_0x1360('0x42')](_0x3bb399[_0x1360('0x20')][_0x1da5a7['id']],_0x1da5a7);}}}return _0x3bb399['salesforceAccounts'];};};Realtime[_0x1360('0x43')][_0x1360('0x4f')]=function(){var _0x4703d1=this;return function(_0x359a17){if(_0x359a17){freeIsNotKey(_0x359a17,_0x4703d1['freshdeskAccounts'],'id');for(var _0xafc527=0x0,_0x13210c={},_0x237c43={};_0xafc527<_0x359a17[_0x1360('0x45')];_0xafc527+=0x1){_0x13210c=_0x359a17[_0xafc527];if(_['isUndefined'](_0x4703d1[_0x1360('0x22')][_0x13210c['id']])){_0x4703d1[_0x1360('0x22')][_0x13210c['id']]=new FreshdeskAccount(_0x13210c);}else{_0x4703d1[_0x1360('0x42')](_0x4703d1[_0x1360('0x22')][_0x13210c['id']],_0x13210c);}}}return _0x4703d1[_0x1360('0x22')];};};Realtime[_0x1360('0x43')]['initZohoAccounts']=function(){var _0x679bb6=this;return function(_0x342299){if(_0x342299){freeIsNotKey(_0x342299,_0x679bb6[_0x1360('0x23')],'id');for(var _0x204eed=0x0,_0x3940bc={},_0x2a18cd={};_0x204eed<_0x342299[_0x1360('0x45')];_0x204eed+=0x1){_0x3940bc=_0x342299[_0x204eed];if(_['isUndefined'](_0x679bb6[_0x1360('0x23')][_0x3940bc['id']])){_0x679bb6[_0x1360('0x23')][_0x3940bc['id']]=new ZohoAccount(_0x3940bc);}else{_0x679bb6[_0x1360('0x42')](_0x679bb6[_0x1360('0x23')][_0x3940bc['id']],_0x3940bc);}}}return _0x679bb6['zohoAccounts'];};};Realtime[_0x1360('0x43')][_0x1360('0x50')]=function(){var _0x7b51ec=this;return function(_0x594fd5){if(_0x594fd5){freeIsNotKey(_0x594fd5,_0x7b51ec[_0x1360('0x24')],'id');for(var _0x2ebb34=0x0,_0x17e010={},_0x423bc4={};_0x2ebb34<_0x594fd5['length'];_0x2ebb34+=0x1){_0x17e010=_0x594fd5[_0x2ebb34];if(_['isUndefined'](_0x7b51ec['deskAccounts'][_0x17e010['id']])){_0x7b51ec[_0x1360('0x24')][_0x17e010['id']]=new DeskAccount(_0x17e010);}else{_0x7b51ec['mergeFromDatabase'](_0x7b51ec[_0x1360('0x24')][_0x17e010['id']],_0x17e010);}}}return _0x7b51ec[_0x1360('0x24')];};};Realtime['prototype'][_0x1360('0x51')]=function(){var _0x1189f4=this;return function(_0x1b4a08){if(_0x1b4a08){freeIsNotKey(_0x1b4a08,_0x1189f4[_0x1360('0x21')],'id');for(var _0x1cf56e=0x0,_0x587bfc={},_0x1165a0={};_0x1cf56e<_0x1b4a08[_0x1360('0x45')];_0x1cf56e+=0x1){_0x587bfc=_0x1b4a08[_0x1cf56e];if(_[_0x1360('0x48')](_0x1189f4[_0x1360('0x21')][_0x587bfc['id']])){_0x1189f4[_0x1360('0x21')][_0x587bfc['id']]=new SugarcrmAccount(_0x587bfc);}else{_0x1189f4['mergeFromDatabase'](_0x1189f4[_0x1360('0x21')][_0x587bfc['id']],_0x587bfc);}}}return _0x1189f4[_0x1360('0x21')];};};Realtime['prototype'][_0x1360('0x52')]=function(){var _0x4d2422=this;return function(_0x196acb){if(_0x196acb){freeIsNotKey(_0x196acb,_0x4d2422[_0x1360('0x53')],'id');for(var _0x1392e4=0x0,_0x1e5bc1={},_0x4d17d7={};_0x1392e4<_0x196acb[_0x1360('0x45')];_0x1392e4+=0x1){_0x1e5bc1=_0x196acb[_0x1392e4];if(_[_0x1360('0x48')](_0x4d2422[_0x1360('0x53')][_0x1e5bc1['id']])){_0x4d2422[_0x1360('0x53')][_0x1e5bc1['id']]=new VtigerAccount(_0x1e5bc1);}else{_0x4d2422[_0x1360('0x42')](_0x4d2422[_0x1360('0x53')][_0x1e5bc1['id']],_0x1e5bc1);}}}return _0x4d2422[_0x1360('0x53')];};};Realtime[_0x1360('0x43')][_0x1360('0x54')]=function(){var _0x15a1dd=this;return function(_0x1bee50){if(_0x1bee50){freeIsNotKey(_0x1bee50,_0x15a1dd[_0x1360('0x55')],'id');for(var _0x16a56d=0x0,_0x2319dd={},_0x3ebcde={};_0x16a56d<_0x1bee50[_0x1360('0x45')];_0x16a56d+=0x1){_0x2319dd=_0x1bee50[_0x16a56d];if(_[_0x1360('0x48')](_0x15a1dd[_0x1360('0x55')][_0x2319dd['id']])){_0x15a1dd[_0x1360('0x55')][_0x2319dd['id']]=new ServicenowAccount(_0x2319dd);}else{_0x15a1dd[_0x1360('0x42')](_0x15a1dd[_0x1360('0x55')][_0x2319dd['id']],_0x2319dd);}}}return _0x15a1dd[_0x1360('0x55')];};};Realtime[_0x1360('0x43')][_0x1360('0x56')]=function(){var _0x1a8c58=this;return function(_0x5ee02c){if(_0x5ee02c){freeIsNotKey(_0x5ee02c,_0x1a8c58[_0x1360('0x25')],'id');for(var _0xc4d0f=0x0,_0x130886={},_0x265783={};_0xc4d0f<_0x5ee02c[_0x1360('0x45')];_0xc4d0f+=0x1){_0x130886=_0x5ee02c[_0xc4d0f];if(_[_0x1360('0x48')](_0x1a8c58[_0x1360('0x25')][_0x130886['id']])){_0x1a8c58[_0x1360('0x25')][_0x130886['id']]=new Dynamics365Account(_0x130886);}else{_0x1a8c58[_0x1360('0x42')](_0x1a8c58['dynamics365Accounts'][_0x130886['id']],_0x130886);}}}return _0x1a8c58['dynamics365Accounts'];};};Realtime['prototype'][_0x1360('0x57')]=function(){var _0x41fb88=this;return function(_0x3003c6){if(_0x3003c6){freeIsNotKey(_0x3003c6,_0x41fb88['freshsalesAccounts'],'id');for(var _0x526d27=0x0,_0x17ada1={},_0x42c5bb={};_0x526d27<_0x3003c6[_0x1360('0x45')];_0x526d27+=0x1){_0x17ada1=_0x3003c6[_0x526d27];if(_['isUndefined'](_0x41fb88['freshsalesAccounts'][_0x17ada1['id']])){_0x41fb88['freshsalesAccounts'][_0x17ada1['id']]=new FreshsalesAccount(_0x17ada1);}else{_0x41fb88['mergeFromDatabase'](_0x41fb88['freshsalesAccounts'][_0x17ada1['id']],_0x17ada1);}}}return _0x41fb88[_0x1360('0x26')];};};Realtime[_0x1360('0x43')][_0x1360('0x58')]=function(){var _0x54323f=this;return function(_0x53698d){for(var _0x590104=0x0;_0x590104<_0x53698d[_0x1360('0x45')];_0x590104+=0x1){_[_0x1360('0x59')](_0x54323f[_0x1360('0x15')][_0x53698d[_0x590104]['name']],_0x53698d[_0x590104]);}return _0x54323f[_0x1360('0x15')];};};Realtime[_0x1360('0x43')]['initVoiceQueueReports']=function(){var _0x458493=this;return function(_0xcadc22){clearVoiceQueues(_0x458493[_0x1360('0x15')]);if(_0xcadc22){_0xcadc22=_[_0x1360('0x5a')](_0xcadc22,'uniqueid');for(var _0x102713 in _0xcadc22){if(_0xcadc22['hasOwnProperty'](_0x102713)){var _0x1d7606={};for(var _0x412f53=0x0;_0x412f53<_0xcadc22[_0x102713]['length'];_0x412f53+=0x1){var _0x549285=_0xcadc22[_0x102713][_0x412f53][_0x1360('0x5b')];if(_0x458493[_0x1360('0x15')][_0x549285]){if(_0xcadc22[_0x102713][_0x412f53][_0x1360('0x5c')]){_0x458493[_0x1360('0x15')][_0x549285][_0x1360('0x34')]+=0x1;}if(_0xcadc22[_0x102713][_0x412f53][_0x1360('0x5d')]){_0x458493[_0x1360('0x15')][_0x549285][_0x1360('0x35')]+=0x1;}_0x458493['voiceQueues'][_0x549285]['sumHoldTime']+=moment(_0xcadc22[_0x102713][_0x412f53][_0x1360('0x5e')])['diff'](moment(_0xcadc22[_0x102713][_0x412f53][_0x1360('0x5f')]),_0x1360('0x60'))||0x0;if(_0x412f53===_0xcadc22[_0x102713]['length']-0x1){_0x458493[_0x1360('0x15')][_0x549285][_0x1360('0x30')]+=moment(_0xcadc22[_0x102713][_0x412f53][_0x1360('0x61')]||_0xcadc22[_0x102713][_0x412f53]['queuecallerabandonAt']||_0xcadc22[_0x102713][_0x412f53][_0x1360('0x62')])[_0x1360('0x63')](moment(_0xcadc22[_0x102713][_0x412f53]['queuecallerjoinAt']),_0x1360('0x60'))||0x0;_0x458493[_0x1360('0x15')][_0x549285][_0x1360('0x2e')]+=0x1;if(_0xcadc22[_0x102713][_0x412f53][_0x1360('0x64')]){_0x458493[_0x1360('0x15')][_0x549285][_0x1360('0x2f')]+=0x1;_0x458493[_0x1360('0x15')][_0x549285]['sumBillable']+=moment(_0xcadc22[_0x102713][_0x412f53][_0x1360('0x61')])[_0x1360('0x63')](moment(_0xcadc22[_0x102713][_0x412f53][_0x1360('0x5e')]),_0x1360('0x60'))||0x0;}}else{_0x458493['voiceQueues'][_0x549285]['sumDuration']+=_0x458493[_0x1360('0x15')][_0x549285][_0x1360('0x36')]||0x0;}}}}}}return _0x458493[_0x1360('0x15')];};};Realtime[_0x1360('0x43')]['initVoiceCallReports']=function(){var _0x441238=this;return function(_0x5669eb){clearVoiceCallReports(_0x441238[_0x1360('0x19')]);if(_0x5669eb){for(var _0x3dbbef=0x0;_0x3dbbef<_0x5669eb[_0x1360('0x45')];_0x3dbbef+=0x1){_0x441238[_0x1360('0x19')][_0x1360('0x2e')]+=0x1;_0x441238[_0x1360('0x19')][_0x1360('0x30')]+=_0x5669eb[_0x3dbbef][_0x1360('0x65')];if(_0x5669eb[_0x3dbbef][_0x1360('0x66')]===_0x1360('0x67')){_0x441238['outbound'][_0x1360('0x2f')]+=0x1;_0x441238[_0x1360('0x19')][_0x1360('0x36')]+=_0x5669eb[_0x3dbbef][_0x1360('0x65')]-_0x5669eb[_0x3dbbef][_0x1360('0x68')]||0x0;_0x441238[_0x1360('0x19')]['sumBillable']+=_0x5669eb[_0x3dbbef][_0x1360('0x68')];}}}return _0x441238[_0x1360('0x19')];};};Realtime[_0x1360('0x43')][_0x1360('0x69')]=function(){var _0x427474=this;return function(_0x1d6d7a){if(_0x1d6d7a){freeIsNotKey(_0x1d6d7a,_0x427474['campaigns'],_0x1360('0x2c'));for(var _0x5aa14f=0x0,_0x3674f6={};_0x5aa14f<_0x1d6d7a[_0x1360('0x45')];_0x5aa14f+=0x1){_0x3674f6=_0x1d6d7a[_0x5aa14f];if(_[_0x1360('0x48')](_0x427474['campaigns'][_0x3674f6['name']])){_0x427474[_0x1360('0x17')][_0x3674f6[_0x1360('0x2c')]]=new Campaign(_0x3674f6);}else{_0x427474[_0x1360('0x42')](_0x427474[_0x1360('0x17')][_0x3674f6['name']],_0x3674f6);_0x427474[_0x1360('0x17')][_0x3674f6[_0x1360('0x2c')]]['dialQueueProject']=_0x3674f6['SquareProject']?_0x3674f6[_0x1360('0x6a')]['name']:undefined;}}}return _0x427474[_0x1360('0x17')];};};Realtime[_0x1360('0x43')]['initVoiceExtensions']=function(){var _0x11ce65=this;return function(_0xb8c92e){if(_0xb8c92e){freeIsNotKey(_0xb8c92e,_0x11ce65[_0x1360('0x1a')],'id');for(var _0xc0708=0x0,_0x5d9074={};_0xc0708<_0xb8c92e['length'];_0xc0708+=0x1){_0x5d9074=_0xb8c92e[_0xc0708];if(_['isUndefined'](_0x11ce65[_0x1360('0x1a')][_0x5d9074['id']])){_0x11ce65[_0x1360('0x1a')][_0x5d9074['id']]=new VoiceExtension(_0x5d9074);}else{_0x11ce65[_0x1360('0x42')](_0x11ce65['voiceExtensions'][_0x5d9074['id']],_0x5d9074);}}}return _0x11ce65['voiceExtensions'];};};Realtime['prototype'][_0x1360('0x6b')]=function(){var _0x2951af=this;return function(_0x1d1f5a){clearCampaigns(_0x2951af[_0x1360('0x17')]);for(var _0x25bbd7=0x0;_0x25bbd7<_0x1d1f5a[_0x1360('0x45')];_0x25bbd7+=0x1){_['merge'](_0x2951af[_0x1360('0x17')][_0x1d1f5a[_0x25bbd7][_0x1360('0x2c')]],_0x1d1f5a[_0x25bbd7]);}return _0x2951af[_0x1360('0x17')];};};Realtime[_0x1360('0x43')][_0x1360('0x6c')]=function(){var _0x1dbf01=this;return function(_0x5d4ac7){if(_0x5d4ac7){freeIsNotKey(_0x5d4ac7,_0x1dbf01[_0x1360('0x27')],'id');for(var _0x50641b=0x0,_0x580a86={},_0x321666={};_0x50641b<_0x5d4ac7[_0x1360('0x45')];_0x50641b+=0x1){_0x580a86=_0x5d4ac7[_0x50641b];if(_[_0x1360('0x48')](_0x1dbf01[_0x1360('0x27')][_0x580a86['id']])){_0x1dbf01[_0x1360('0x27')][_0x580a86['id']]=new FaxAccount(_0x580a86);}else{_0x1dbf01['mergeFromDatabase'](_0x1dbf01[_0x1360('0x27')][_0x580a86['id']],_0x580a86);}}}return _0x1dbf01[_0x1360('0x27')];};};module[_0x1360('0x6d')]=Realtime; \ No newline at end of file +var _0xe6a6=['initTelephones','mergeFromDatabase','initTrunks','initTriggers','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','zohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','sumHoldTime','queuecallerleaveAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','diff','initVoiceCallReports','outbound','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','faxAccounts','exports','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','total','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','length','isUndefined'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0xe6a6,0x1d9));var _0x6e6a=function(_0x1cd310,_0x28be66){_0x1cd310=_0x1cd310-0x0;var _0x4bf4b0=_0xe6a6[_0x1cd310];return _0x4bf4b0;};'use strict';var BPromise=require('bluebird');var util=require(_0x6e6a('0x0'));var _=require('lodash');var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0x6e6a('0x1'));var Trunk=require(_0x6e6a('0x2'));var VoiceQueue=require(_0x6e6a('0x3'));var Trigger=require(_0x6e6a('0x4'));var Template=require(_0x6e6a('0x5'));var Campaign=require(_0x6e6a('0x6'));var VoiceExtension=require(_0x6e6a('0x7'));var ZendeskAccount=require(_0x6e6a('0x8'));var SalesforceAccount=require(_0x6e6a('0x9'));var FreshdeskAccount=require(_0x6e6a('0xa'));var SugarcrmAccount=require(_0x6e6a('0xb'));var ZohoAccount=require(_0x6e6a('0xc'));var DeskAccount=require(_0x6e6a('0xd'));var VtigerAccount=require(_0x6e6a('0xe'));var ServicenowAccount=require(_0x6e6a('0xf'));var Dynamics365Account=require(_0x6e6a('0x10'));var FreshsalesAccount=require(_0x6e6a('0x11'));var FaxAccount=require(_0x6e6a('0x12'));var Realtime=function(){this[_0x6e6a('0x13')]={};this[_0x6e6a('0x14')]={};this[_0x6e6a('0x15')]={};this[_0x6e6a('0x16')]={};this[_0x6e6a('0x17')]={};this[_0x6e6a('0x18')]={};this[_0x6e6a('0x19')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x6e6a('0x1a')]={};this[_0x6e6a('0x1b')]={};this[_0x6e6a('0x1c')]={};this[_0x6e6a('0x1d')]={};this['timers']={};this[_0x6e6a('0x1e')]={};this[_0x6e6a('0x1f')]={};this[_0x6e6a('0x20')]={};this[_0x6e6a('0x21')]={};this[_0x6e6a('0x22')]={};this['zohoAccounts']={};this[_0x6e6a('0x23')]={};this[_0x6e6a('0x24')]={};this[_0x6e6a('0x25')]={};this[_0x6e6a('0x26')]={};this[_0x6e6a('0x27')]={};this['faxAccounts']={};};function freeIsNotKey(_0x261554,_0x2a4f23,_0x14747b){var _0x42a8eb=_[_0x6e6a('0x28')](_0x261554,function(_0x75d668,_0x58ca4d){return _0x75d668[_0x14747b];});for(var _0x22f376 in _0x2a4f23){if(_0x2a4f23[_0x6e6a('0x29')](_0x22f376)){if(!_0x42a8eb[_0x22f376]){delete _0x2a4f23[_0x22f376];}}}}function freeIsNotKeySip(_0x5d7d9a,_0x218420){var _0x41931d=_[_0x6e6a('0x28')](_0x5d7d9a,function(_0x17e9a7,_0x5a57eb){return util['format'](_0x6e6a('0x2a'),_0x17e9a7[_0x6e6a('0x2b')]);});for(var _0x358355 in _0x218420){if(_0x218420[_0x6e6a('0x29')](_0x358355)){if(!_0x41931d[_0x358355]){delete _0x218420[_0x358355];}}}}function freeIsNotKeyAgent(_0x2ff5b4,_0xd1df44){var _0x54aef0=_['mapKeys'](_0x2ff5b4,function(_0x1c3431,_0x4929d4){var _0x23d7d2=_[_0x6e6a('0x2c')](_0x1c3431[_0x6e6a('0x2d')])?util[_0x6e6a('0x2e')](_0x6e6a('0x2a'),_0x1c3431['name']):_0x1c3431[_0x6e6a('0x2d')];return _0x23d7d2;});for(var _0x1bc9a5 in _0xd1df44){if(_0xd1df44[_0x6e6a('0x29')](_0x1bc9a5)){if(!_0x54aef0[_0x1bc9a5]){delete _0xd1df44[_0x1bc9a5];}}}}function clearVoiceCallReports(_0x2810eb){_0x2810eb[_0x6e6a('0x2f')]=0x0;_0x2810eb['answered']=0x0;_0x2810eb['sumHoldTime']=0x0;_0x2810eb[_0x6e6a('0x30')]=0x0;_0x2810eb[_0x6e6a('0x31')]=0x0;}function clearCampaigns(_0x97ec20){if(!_[_0x6e6a('0x32')](_0x97ec20)){for(var _0x3c79c5 in _0x97ec20){if(_0x97ec20[_0x6e6a('0x29')](_0x3c79c5)){_0x97ec20[_0x3c79c5][_0x6e6a('0x33')]=0x0;_0x97ec20[_0x3c79c5][_0x6e6a('0x34')]=0x0;}}}}function clearVoiceQueues(_0x1faf7c){if(!_[_0x6e6a('0x32')](_0x1faf7c)){for(var _0x6b3646 in _0x1faf7c){if(_0x1faf7c[_0x6e6a('0x29')](_0x6b3646)){_0x1faf7c[_0x6b3646][_0x6e6a('0x2f')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x35')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x36')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x37')]=0x0;_0x1faf7c[_0x6b3646]['sumHoldTime']=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x30')]=0x0;_0x1faf7c[_0x6b3646]['sumBillable']=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x38')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x39')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x3a')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x3b')]=0x0;_0x1faf7c[_0x6b3646]['outboundNoSuchCallsDay']=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x3c')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x3d')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x3e')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x3f')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x40')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x41')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x42')]=0x0;_0x1faf7c[_0x6b3646]['outboundAnswerAgiCallsDay']=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x43')]=0x0;_0x1faf7c[_0x6b3646][_0x6e6a('0x44')]=!![];}}}}Realtime[_0x6e6a('0x45')]['mergeFromDatabase']=function(_0x66b4e2,_0x355f6d){for(var _0xc3b803 in _0x355f6d){if(_0x66b4e2[_0x6e6a('0x29')](_0xc3b803)){_0x66b4e2[_0xc3b803]=_0x355f6d[_0xc3b803];}}};Realtime[_0x6e6a('0x45')]['initAgents']=function(){var _0x21626f=this;return function(_0x31eb3b){if(_0x31eb3b){freeIsNotKeyAgent(_0x31eb3b,_0x21626f[_0x6e6a('0x13')]);for(var _0x29aced=0x0,_0x9c0487={},_0x587824={};_0x29aced<_0x31eb3b[_0x6e6a('0x46')];_0x29aced+=0x1){_0x9c0487=_0x31eb3b[_0x29aced];var _0x2d21a4=_['isNil'](_0x9c0487[_0x6e6a('0x2d')])?util['format'](_0x6e6a('0x2a'),_0x9c0487[_0x6e6a('0x2b')]):_0x9c0487[_0x6e6a('0x2d')];if(_[_0x6e6a('0x47')](_0x21626f[_0x6e6a('0x13')][_0x2d21a4])){_0x21626f[_0x6e6a('0x13')][_0x2d21a4]=new Agent(_0x9c0487);}else{_0x21626f['mergeFromDatabase'](_0x21626f[_0x6e6a('0x13')][_0x2d21a4],_0x9c0487);}}}return _0x21626f[_0x6e6a('0x13')];};};Realtime[_0x6e6a('0x45')][_0x6e6a('0x48')]=function(){var _0x23a370=this;return function(_0x3a21d6){if(_0x3a21d6){freeIsNotKeySip(_0x3a21d6,_0x23a370[_0x6e6a('0x14')]);for(var _0xd2c38f=0x0,_0x1541dc={},_0x5bd06b={};_0xd2c38f<_0x3a21d6['length'];_0xd2c38f+=0x1){_0x1541dc=_0x3a21d6[_0xd2c38f];if(_[_0x6e6a('0x47')](_0x23a370['telephones'][util[_0x6e6a('0x2e')](_0x6e6a('0x2a'),_0x1541dc[_0x6e6a('0x2b')])])){_0x23a370[_0x6e6a('0x14')][util[_0x6e6a('0x2e')](_0x6e6a('0x2a'),_0x1541dc[_0x6e6a('0x2b')])]=new Telephone(_0x1541dc);}else{_0x23a370[_0x6e6a('0x49')](_0x23a370[_0x6e6a('0x14')][util[_0x6e6a('0x2e')](_0x6e6a('0x2a'),_0x1541dc['name'])],_0x1541dc);}}}return _0x23a370[_0x6e6a('0x14')];};};Realtime['prototype'][_0x6e6a('0x4a')]=function(){var _0x398697=this;return function(_0x2cfac8){if(_0x2cfac8){freeIsNotKeySip(_0x2cfac8,_0x398697[_0x6e6a('0x15')]);for(var _0x3488f2=0x0,_0x273a4c={},_0x56ded2={};_0x3488f2<_0x2cfac8[_0x6e6a('0x46')];_0x3488f2+=0x1){_0x273a4c=_0x2cfac8[_0x3488f2];if(_['isUndefined'](_0x398697[_0x6e6a('0x15')][util[_0x6e6a('0x2e')](_0x6e6a('0x2a'),_0x273a4c[_0x6e6a('0x2b')])])){_0x398697[_0x6e6a('0x15')][util[_0x6e6a('0x2e')]('SIP/%s',_0x273a4c[_0x6e6a('0x2b')])]=new Trunk(_0x273a4c);}else{_0x398697['mergeFromDatabase'](_0x398697[_0x6e6a('0x15')][util['format'](_0x6e6a('0x2a'),_0x273a4c[_0x6e6a('0x2b')])],_0x273a4c);}}}return _0x398697[_0x6e6a('0x15')];};};Realtime[_0x6e6a('0x45')]['initVoiceQueues']=function(){var _0x11df39=this;return function(_0x1b5959){if(_0x1b5959){freeIsNotKey(_0x1b5959,_0x11df39['voiceQueues'],_0x6e6a('0x2b'));for(var _0x44b91b=0x0,_0x166a1f={},_0x25c813={};_0x44b91b<_0x1b5959[_0x6e6a('0x46')];_0x44b91b+=0x1){_0x166a1f=_0x1b5959[_0x44b91b];if(_['isUndefined'](_0x11df39[_0x6e6a('0x16')][_0x166a1f['name']])){_0x11df39['voiceQueues'][_0x166a1f[_0x6e6a('0x2b')]]=new VoiceQueue(_0x166a1f);}else{_0x11df39[_0x6e6a('0x49')](_0x11df39[_0x6e6a('0x16')][_0x166a1f[_0x6e6a('0x2b')]],_0x166a1f);}}}return _0x11df39[_0x6e6a('0x16')];};};Realtime['prototype'][_0x6e6a('0x4b')]=function(){var _0x46fc88=this;return function(_0xb2b124){if(_0xb2b124){freeIsNotKey(_0xb2b124,_0x46fc88[_0x6e6a('0x17')],'id');for(var _0x1aad93=0x0,_0x196d16={},_0x3931e9={};_0x1aad93<_0xb2b124[_0x6e6a('0x46')];_0x1aad93+=0x1){_0x196d16=_0xb2b124[_0x1aad93];if(_[_0x6e6a('0x47')](_0x46fc88[_0x6e6a('0x17')][_0x196d16['id']])){_0x46fc88[_0x6e6a('0x17')][_0x196d16['id']]=new Trigger(_0x196d16);}else{_0x46fc88[_0x6e6a('0x49')](_0x46fc88[_0x6e6a('0x17')][_0x196d16['id']],_0x196d16);}}}return _0x46fc88[_0x6e6a('0x17')];};};Realtime[_0x6e6a('0x45')]['initTemplates']=function(){var _0x5c608c=this;return function(_0x3ed143){if(_0x3ed143){freeIsNotKey(_0x3ed143,_0x5c608c['templates'],'id');for(var _0x1f0fbc=0x0,_0x5df107={},_0x218e08={};_0x1f0fbc<_0x3ed143[_0x6e6a('0x46')];_0x1f0fbc+=0x1){_0x5df107=_0x3ed143[_0x1f0fbc];if(_[_0x6e6a('0x47')](_0x5c608c[_0x6e6a('0x19')][_0x5df107['id']])){_0x5c608c[_0x6e6a('0x19')][_0x5df107['id']]=new Template(_0x5df107);}else{_0x5c608c['mergeFromDatabase'](_0x5c608c[_0x6e6a('0x19')][_0x5df107['id']],_0x5df107);}}}return _0x5c608c[_0x6e6a('0x19')];};};Realtime[_0x6e6a('0x45')][_0x6e6a('0x4c')]=function(){var _0x434d51=this;return function(_0x4c9127){if(_0x4c9127){freeIsNotKey(_0x4c9127,_0x434d51['zendeskAccounts'],'id');for(var _0x1ffdda=0x0,_0x1089da={},_0x2e39df={};_0x1ffdda<_0x4c9127[_0x6e6a('0x46')];_0x1ffdda+=0x1){_0x1089da=_0x4c9127[_0x1ffdda];if(_['isUndefined'](_0x434d51[_0x6e6a('0x1f')][_0x1089da['id']])){_0x434d51[_0x6e6a('0x1f')][_0x1089da['id']]=new ZendeskAccount(_0x1089da);}else{_0x434d51[_0x6e6a('0x49')](_0x434d51[_0x6e6a('0x1f')][_0x1089da['id']],_0x1089da);}}}return _0x434d51[_0x6e6a('0x1f')];};};Realtime[_0x6e6a('0x45')][_0x6e6a('0x4d')]=function(){var _0x435618=this;return function(_0x1284fa){if(_0x1284fa){freeIsNotKey(_0x1284fa,_0x435618['salesforceAccounts'],'id');for(var _0x2cbfdc=0x0,_0x448103={},_0x441ad6={};_0x2cbfdc<_0x1284fa[_0x6e6a('0x46')];_0x2cbfdc+=0x1){_0x448103=_0x1284fa[_0x2cbfdc];if(_['isUndefined'](_0x435618[_0x6e6a('0x20')][_0x448103['id']])){_0x435618[_0x6e6a('0x20')][_0x448103['id']]=new SalesforceAccount(_0x448103);}else{_0x435618['mergeFromDatabase'](_0x435618[_0x6e6a('0x20')][_0x448103['id']],_0x448103);}}}return _0x435618['salesforceAccounts'];};};Realtime['prototype'][_0x6e6a('0x4e')]=function(){var _0x599428=this;return function(_0x436452){if(_0x436452){freeIsNotKey(_0x436452,_0x599428[_0x6e6a('0x22')],'id');for(var _0xac471=0x0,_0x8e58ef={},_0x22d857={};_0xac471<_0x436452[_0x6e6a('0x46')];_0xac471+=0x1){_0x8e58ef=_0x436452[_0xac471];if(_[_0x6e6a('0x47')](_0x599428[_0x6e6a('0x22')][_0x8e58ef['id']])){_0x599428[_0x6e6a('0x22')][_0x8e58ef['id']]=new FreshdeskAccount(_0x8e58ef);}else{_0x599428[_0x6e6a('0x49')](_0x599428[_0x6e6a('0x22')][_0x8e58ef['id']],_0x8e58ef);}}}return _0x599428['freshdeskAccounts'];};};Realtime[_0x6e6a('0x45')]['initZohoAccounts']=function(){var _0x2e1a72=this;return function(_0x52d71c){if(_0x52d71c){freeIsNotKey(_0x52d71c,_0x2e1a72[_0x6e6a('0x4f')],'id');for(var _0x5abcf2=0x0,_0x5cde0d={},_0x27d1c2={};_0x5abcf2<_0x52d71c[_0x6e6a('0x46')];_0x5abcf2+=0x1){_0x5cde0d=_0x52d71c[_0x5abcf2];if(_[_0x6e6a('0x47')](_0x2e1a72[_0x6e6a('0x4f')][_0x5cde0d['id']])){_0x2e1a72[_0x6e6a('0x4f')][_0x5cde0d['id']]=new ZohoAccount(_0x5cde0d);}else{_0x2e1a72[_0x6e6a('0x49')](_0x2e1a72['zohoAccounts'][_0x5cde0d['id']],_0x5cde0d);}}}return _0x2e1a72[_0x6e6a('0x4f')];};};Realtime[_0x6e6a('0x45')]['initDeskAccounts']=function(){var _0x8d083c=this;return function(_0x230738){if(_0x230738){freeIsNotKey(_0x230738,_0x8d083c[_0x6e6a('0x23')],'id');for(var _0x28bcc4=0x0,_0x2ce85f={},_0x331aaf={};_0x28bcc4<_0x230738['length'];_0x28bcc4+=0x1){_0x2ce85f=_0x230738[_0x28bcc4];if(_[_0x6e6a('0x47')](_0x8d083c[_0x6e6a('0x23')][_0x2ce85f['id']])){_0x8d083c['deskAccounts'][_0x2ce85f['id']]=new DeskAccount(_0x2ce85f);}else{_0x8d083c[_0x6e6a('0x49')](_0x8d083c[_0x6e6a('0x23')][_0x2ce85f['id']],_0x2ce85f);}}}return _0x8d083c[_0x6e6a('0x23')];};};Realtime[_0x6e6a('0x45')][_0x6e6a('0x50')]=function(){var _0x3fcf18=this;return function(_0xccaeb4){if(_0xccaeb4){freeIsNotKey(_0xccaeb4,_0x3fcf18[_0x6e6a('0x21')],'id');for(var _0x596227=0x0,_0x198070={},_0x2e0cc3={};_0x596227<_0xccaeb4['length'];_0x596227+=0x1){_0x198070=_0xccaeb4[_0x596227];if(_[_0x6e6a('0x47')](_0x3fcf18[_0x6e6a('0x21')][_0x198070['id']])){_0x3fcf18[_0x6e6a('0x21')][_0x198070['id']]=new SugarcrmAccount(_0x198070);}else{_0x3fcf18[_0x6e6a('0x49')](_0x3fcf18[_0x6e6a('0x21')][_0x198070['id']],_0x198070);}}}return _0x3fcf18['sugarcrmAccounts'];};};Realtime[_0x6e6a('0x45')][_0x6e6a('0x51')]=function(){var _0x467cbd=this;return function(_0x131df6){if(_0x131df6){freeIsNotKey(_0x131df6,_0x467cbd[_0x6e6a('0x24')],'id');for(var _0x1bd4f5=0x0,_0x2904ec={},_0x4e11c5={};_0x1bd4f5<_0x131df6[_0x6e6a('0x46')];_0x1bd4f5+=0x1){_0x2904ec=_0x131df6[_0x1bd4f5];if(_[_0x6e6a('0x47')](_0x467cbd[_0x6e6a('0x24')][_0x2904ec['id']])){_0x467cbd['vtigerAccounts'][_0x2904ec['id']]=new VtigerAccount(_0x2904ec);}else{_0x467cbd['mergeFromDatabase'](_0x467cbd[_0x6e6a('0x24')][_0x2904ec['id']],_0x2904ec);}}}return _0x467cbd[_0x6e6a('0x24')];};};Realtime[_0x6e6a('0x45')][_0x6e6a('0x52')]=function(){var _0x4a7704=this;return function(_0x268b78){if(_0x268b78){freeIsNotKey(_0x268b78,_0x4a7704[_0x6e6a('0x25')],'id');for(var _0x4ebafc=0x0,_0x3333e3={},_0x492008={};_0x4ebafc<_0x268b78[_0x6e6a('0x46')];_0x4ebafc+=0x1){_0x3333e3=_0x268b78[_0x4ebafc];if(_[_0x6e6a('0x47')](_0x4a7704[_0x6e6a('0x25')][_0x3333e3['id']])){_0x4a7704[_0x6e6a('0x25')][_0x3333e3['id']]=new ServicenowAccount(_0x3333e3);}else{_0x4a7704[_0x6e6a('0x49')](_0x4a7704[_0x6e6a('0x25')][_0x3333e3['id']],_0x3333e3);}}}return _0x4a7704['servicenowAccounts'];};};Realtime[_0x6e6a('0x45')][_0x6e6a('0x53')]=function(){var _0x33527e=this;return function(_0x4c3fcc){if(_0x4c3fcc){freeIsNotKey(_0x4c3fcc,_0x33527e[_0x6e6a('0x26')],'id');for(var _0x4c12ff=0x0,_0x1559d8={},_0x2809cb={};_0x4c12ff<_0x4c3fcc['length'];_0x4c12ff+=0x1){_0x1559d8=_0x4c3fcc[_0x4c12ff];if(_[_0x6e6a('0x47')](_0x33527e[_0x6e6a('0x26')][_0x1559d8['id']])){_0x33527e[_0x6e6a('0x26')][_0x1559d8['id']]=new Dynamics365Account(_0x1559d8);}else{_0x33527e[_0x6e6a('0x49')](_0x33527e['dynamics365Accounts'][_0x1559d8['id']],_0x1559d8);}}}return _0x33527e['dynamics365Accounts'];};};Realtime[_0x6e6a('0x45')]['initFreshsalesAccounts']=function(){var _0x24bb25=this;return function(_0x4bc2a1){if(_0x4bc2a1){freeIsNotKey(_0x4bc2a1,_0x24bb25['freshsalesAccounts'],'id');for(var _0x4de1b0=0x0,_0x5d5b1e={},_0xe076f2={};_0x4de1b0<_0x4bc2a1['length'];_0x4de1b0+=0x1){_0x5d5b1e=_0x4bc2a1[_0x4de1b0];if(_['isUndefined'](_0x24bb25[_0x6e6a('0x27')][_0x5d5b1e['id']])){_0x24bb25[_0x6e6a('0x27')][_0x5d5b1e['id']]=new FreshsalesAccount(_0x5d5b1e);}else{_0x24bb25[_0x6e6a('0x49')](_0x24bb25[_0x6e6a('0x27')][_0x5d5b1e['id']],_0x5d5b1e);}}}return _0x24bb25['freshsalesAccounts'];};};Realtime[_0x6e6a('0x45')]['initVoiceQueueHopperHistory']=function(){var _0x3e451f=this;return function(_0x41d74e){for(var _0x4d1078=0x0;_0x4d1078<_0x41d74e[_0x6e6a('0x46')];_0x4d1078+=0x1){_[_0x6e6a('0x54')](_0x3e451f[_0x6e6a('0x16')][_0x41d74e[_0x4d1078]['name']],_0x41d74e[_0x4d1078]);}return _0x3e451f[_0x6e6a('0x16')];};};Realtime[_0x6e6a('0x45')][_0x6e6a('0x55')]=function(){var _0x1e55be=this;return function(_0x20c895){clearVoiceQueues(_0x1e55be[_0x6e6a('0x16')]);if(_0x20c895){_0x20c895=_[_0x6e6a('0x56')](_0x20c895,_0x6e6a('0x57'));for(var _0x2dd6d5 in _0x20c895){if(_0x20c895[_0x6e6a('0x29')](_0x2dd6d5)){var _0x4d3c9d={};for(var _0x1e44fb=0x0;_0x1e44fb<_0x20c895[_0x2dd6d5]['length'];_0x1e44fb+=0x1){var _0x2af329=_0x20c895[_0x2dd6d5][_0x1e44fb][_0x6e6a('0x58')];if(_0x1e55be[_0x6e6a('0x16')][_0x2af329]){if(_0x20c895[_0x2dd6d5][_0x1e44fb][_0x6e6a('0x59')]){_0x1e55be[_0x6e6a('0x16')][_0x2af329][_0x6e6a('0x36')]+=0x1;}if(_0x20c895[_0x2dd6d5][_0x1e44fb]['queuecallerabandon']){_0x1e55be[_0x6e6a('0x16')][_0x2af329][_0x6e6a('0x37')]+=0x1;}_0x1e55be[_0x6e6a('0x16')][_0x2af329][_0x6e6a('0x5a')]+=moment(_0x20c895[_0x2dd6d5][_0x1e44fb][_0x6e6a('0x5b')])['diff'](moment(_0x20c895[_0x2dd6d5][_0x1e44fb]['queuecallerjoinAt']),_0x6e6a('0x5c'))||0x0;if(_0x1e44fb===_0x20c895[_0x2dd6d5]['length']-0x1){_0x1e55be[_0x6e6a('0x16')][_0x2af329][_0x6e6a('0x30')]+=moment(_0x20c895[_0x2dd6d5][_0x1e44fb][_0x6e6a('0x5d')]||_0x20c895[_0x2dd6d5][_0x1e44fb]['queuecallerabandonAt']||_0x20c895[_0x2dd6d5][_0x1e44fb][_0x6e6a('0x5e')])['diff'](moment(_0x20c895[_0x2dd6d5][_0x1e44fb][_0x6e6a('0x5f')]),_0x6e6a('0x5c'))||0x0;_0x1e55be[_0x6e6a('0x16')][_0x2af329][_0x6e6a('0x2f')]+=0x1;if(_0x20c895[_0x2dd6d5][_0x1e44fb][_0x6e6a('0x60')]){_0x1e55be[_0x6e6a('0x16')][_0x2af329][_0x6e6a('0x35')]+=0x1;_0x1e55be['voiceQueues'][_0x2af329][_0x6e6a('0x31')]+=moment(_0x20c895[_0x2dd6d5][_0x1e44fb]['queuecallercompleteAt'])[_0x6e6a('0x61')](moment(_0x20c895[_0x2dd6d5][_0x1e44fb][_0x6e6a('0x5b')]),_0x6e6a('0x5c'))||0x0;}}else{_0x1e55be[_0x6e6a('0x16')][_0x2af329][_0x6e6a('0x30')]+=_0x1e55be[_0x6e6a('0x16')][_0x2af329][_0x6e6a('0x5a')]||0x0;}}}}}}return _0x1e55be[_0x6e6a('0x16')];};};Realtime['prototype'][_0x6e6a('0x62')]=function(){var _0x54112a=this;return function(_0x34032d){clearVoiceCallReports(_0x54112a[_0x6e6a('0x63')]);if(_0x34032d){for(var _0xce59e5=0x0;_0xce59e5<_0x34032d[_0x6e6a('0x46')];_0xce59e5+=0x1){_0x54112a['outbound']['total']+=0x1;_0x54112a['outbound'][_0x6e6a('0x30')]+=_0x34032d[_0xce59e5][_0x6e6a('0x64')];if(_0x34032d[_0xce59e5]['disposition']===_0x6e6a('0x65')){_0x54112a[_0x6e6a('0x63')][_0x6e6a('0x35')]+=0x1;_0x54112a[_0x6e6a('0x63')][_0x6e6a('0x5a')]+=_0x34032d[_0xce59e5][_0x6e6a('0x64')]-_0x34032d[_0xce59e5][_0x6e6a('0x66')]||0x0;_0x54112a[_0x6e6a('0x63')][_0x6e6a('0x31')]+=_0x34032d[_0xce59e5]['billableseconds'];}}}return _0x54112a[_0x6e6a('0x63')];};};Realtime[_0x6e6a('0x45')][_0x6e6a('0x67')]=function(){var _0x4493b6=this;return function(_0x5deac9){if(_0x5deac9){freeIsNotKey(_0x5deac9,_0x4493b6[_0x6e6a('0x18')],_0x6e6a('0x2b'));for(var _0x19d57b=0x0,_0xfc374a={};_0x19d57b<_0x5deac9[_0x6e6a('0x46')];_0x19d57b+=0x1){_0xfc374a=_0x5deac9[_0x19d57b];if(_['isUndefined'](_0x4493b6[_0x6e6a('0x18')][_0xfc374a['name']])){_0x4493b6[_0x6e6a('0x18')][_0xfc374a[_0x6e6a('0x2b')]]=new Campaign(_0xfc374a);}else{_0x4493b6[_0x6e6a('0x49')](_0x4493b6[_0x6e6a('0x18')][_0xfc374a[_0x6e6a('0x2b')]],_0xfc374a);_0x4493b6['campaigns'][_0xfc374a[_0x6e6a('0x2b')]][_0x6e6a('0x68')]=_0xfc374a[_0x6e6a('0x69')]?_0xfc374a[_0x6e6a('0x69')]['name']:undefined;}}}return _0x4493b6[_0x6e6a('0x18')];};};Realtime[_0x6e6a('0x45')][_0x6e6a('0x6a')]=function(){var _0x1bccc7=this;return function(_0x28450f){if(_0x28450f){freeIsNotKey(_0x28450f,_0x1bccc7['voiceExtensions'],'id');for(var _0x375709=0x0,_0x1313a9={};_0x375709<_0x28450f['length'];_0x375709+=0x1){_0x1313a9=_0x28450f[_0x375709];if(_['isUndefined'](_0x1bccc7[_0x6e6a('0x1a')][_0x1313a9['id']])){_0x1bccc7[_0x6e6a('0x1a')][_0x1313a9['id']]=new VoiceExtension(_0x1313a9);}else{_0x1bccc7[_0x6e6a('0x49')](_0x1bccc7[_0x6e6a('0x1a')][_0x1313a9['id']],_0x1313a9);}}}return _0x1bccc7[_0x6e6a('0x1a')];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0xd8d2ea=this;return function(_0x4205b9){clearCampaigns(_0xd8d2ea[_0x6e6a('0x18')]);for(var _0x47b12e=0x0;_0x47b12e<_0x4205b9[_0x6e6a('0x46')];_0x47b12e+=0x1){_['merge'](_0xd8d2ea[_0x6e6a('0x18')][_0x4205b9[_0x47b12e][_0x6e6a('0x2b')]],_0x4205b9[_0x47b12e]);}return _0xd8d2ea[_0x6e6a('0x18')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x3188a4=this;return function(_0x1b295e){if(_0x1b295e){freeIsNotKey(_0x1b295e,_0x3188a4[_0x6e6a('0x6b')],'id');for(var _0x5b0fb7=0x0,_0x3a5585={},_0x48b6b4={};_0x5b0fb7<_0x1b295e[_0x6e6a('0x46')];_0x5b0fb7+=0x1){_0x3a5585=_0x1b295e[_0x5b0fb7];if(_['isUndefined'](_0x3188a4[_0x6e6a('0x6b')][_0x3a5585['id']])){_0x3188a4['faxAccounts'][_0x3a5585['id']]=new FaxAccount(_0x3a5585);}else{_0x3188a4[_0x6e6a('0x49')](_0x3188a4[_0x6e6a('0x6b')][_0x3a5585['id']],_0x3a5585);}}}return _0x3188a4[_0x6e6a('0x6b')];};};module[_0x6e6a('0x6c')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 0143b4d..9d0fc34 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 _0xe939=['length','connectedlinenum','lastAssignedTo','format','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','getAgentByInternal','keys','getCallType','calleridnum','outbound','internal','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','transfereelinkedid','uniqueid','blindTransfer','linkedid','channel','split','membername','create','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','forEach','substring','indexOf','mobile','phone','lastIndexOf','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','isNil','interface','SIP/%s'];(function(_0x23f0ba,_0x4a7be4){var _0x41bd76=function(_0x464c81){while(--_0x464c81){_0x23f0ba['push'](_0x23f0ba['shift']());}};_0x41bd76(++_0x4a7be4);}(_0xe939,0x1a6));var _0x9e93=function(_0xe05ea8,_0x5936e9){_0xe05ea8=_0xe05ea8-0x0;var _0x19574a=_0xe939[_0xe05ea8];return _0x19574a;};'use strict';var _=require(_0x9e93('0x0'));var moment=require(_0x9e93('0x1'));var util=require(_0x9e93('0x2'));var config=require('../../../config/environment');var ami=require(_0x9e93('0x3'));var RpcVoiceAgentReport=require(_0x9e93('0x4'));var RpcVoiceCallReport=require(_0x9e93('0x5'));var RpcVoiceDialReport=require(_0x9e93('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x9e93('0x7'));var RpcVoiceRecording=require(_0x9e93('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x9e93('0x9'));var VoiceAgentReport=require(_0x9e93('0xa'));var VoiceDialReport=require(_0x9e93('0xb'));var UserReport=require(_0x9e93('0xc'));function Report(_0x5b733b){this[_0x9e93('0xd')]=_0x5b733b;this[_0x9e93('0xe')]=_0x5b733b[_0x9e93('0xe')];this[_0x9e93('0xf')]=_0x5b733b[_0x9e93('0xf')];}Report['prototype'][_0x9e93('0x10')]=function(_0x5d7386){var _0x22bf14=new VoiceQueueReport(this[_0x9e93('0xd')]);var _0x6b44cb=new VoiceAgentReport(this[_0x9e93('0xd')]);var _0x3929ae=new VoiceDialReport(this['realtime']);var _0x220886=new VoiceCallReport(this['realtime']);var _0x3a6abc=new UserReport(this['realtime']);if(config['xdr']&&config[_0x9e93('0x11')][_0x9e93('0x12')]){ami['on'](_0x9e93('0x13'),this[_0x9e93('0x14')][_0x9e93('0x15')](this));ami['on'](_0x9e93('0x16'),this['voiceCallReport'][_0x9e93('0x15')](this));ami['on'](_0x9e93('0x17'),this[_0x9e93('0x18')]['bind'](this));ami['on'](_0x9e93('0x19'),this[_0x9e93('0x1a')][_0x9e93('0x15')](this));ami['on'](_0x9e93('0x1b'),this['blindTransfer'][_0x9e93('0x15')](this));ami['on'](_0x9e93('0x1c'),this[_0x9e93('0x1d')]['bind'](this));}};Report[_0x9e93('0x1e')][_0x9e93('0x1f')]=function(_0x42c833){var _0x4a2c12;_0x4a2c12=_[_0x9e93('0x20')](this['agents'],function(_0x3142fa){return _0x3142fa[_0x9e93('0x21')]==_0x42c833||_0x3142fa[_0x9e93('0x22')]==_0x42c833;});if(_[_0x9e93('0x23')](_0x4a2c12)){var _0x5a71d2=_[_0x9e93('0x20')](this[_0x9e93('0xf')],function(_0x12d997){return _0x12d997[_0x9e93('0x21')]==_0x42c833||_0x12d997[_0x9e93('0x22')]==_0x42c833;});if(_0x5a71d2){_0x4a2c12=_[_0x9e93('0x20')](this[_0x9e93('0xe')],function(_0x5716e9){return _0x5716e9[_0x9e93('0x24')]==util['format'](_0x9e93('0x25'),_0x5a71d2[_0x9e93('0x22')]);});}}return _0x4a2c12;};Report[_0x9e93('0x1e')]['voiceQueueReport']=function(_0x4543f9){for(var _0x3700d5=0x0;_0x3700d5<_0x4543f9[_0x9e93('0x26')];_0x3700d5+=0x1){var _0x10aef1=this['findAgent'](_0x4543f9[_0x3700d5][_0x9e93('0x27')]);if(_0x10aef1){_0x4543f9[_0x3700d5][_0x9e93('0x21')]=_0x10aef1['accountcode'];_0x4543f9[_0x3700d5]['assigned']=!![];_0x4543f9[_0x3700d5][_0x9e93('0x28')]=_0x10aef1[_0x9e93('0x22')];_0x4543f9[_0x3700d5][_0x9e93('0x24')]=_[_0x9e93('0x23')](_0x10aef1[_0x9e93('0x24')])?util[_0x9e93('0x29')](_0x9e93('0x25'),_0x10aef1[_0x9e93('0x22')]):_0x10aef1[_0x9e93('0x24')];if(_0x4543f9[_0x3700d5][_0x9e93('0x2a')]){_0x4543f9[_0x3700d5]['queuecallercompleteAt']=moment()[_0x9e93('0x29')](_0x9e93('0x2b'));}if(_0x4543f9[_0x3700d5][_0x9e93('0x2c')]){_0x4543f9[_0x3700d5][_0x9e93('0x2d')]=moment()[_0x9e93('0x29')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x9e93('0x14')](_0x4543f9[_0x3700d5]);}RpcVoiceQueueReport['create'](_0x4543f9[_0x3700d5]);}};function extractCalleridNumber(_0x85eef9){var _0x479695=_0x85eef9[_0x9e93('0x2e')](/<(.*?)>/);return _0x479695?_0x479695[0x1]:_0x85eef9;}Report['prototype'][_0x9e93('0x2f')]=function(_0x3a4f8c){for(var _0x242ee1=0x0;_0x242ee1/);return _0x19027a?_0x19027a[0x1]:_0x355a65;}Report[_0xea44('0x1f')]['getAgentByInternal']=function(_0x3c1966){for(var _0x1dd1a3=0x0;_0x1dd1a3',_0x3ea466[_0xea44('0x48')],_0x3ea466[_0xea44('0x36')]);}if(RpcVoiceTransferReport[_0xea44('0x49')][_0x3ea466['linkedid']]){var _0x4a3fb4=RpcVoiceTransferReport['transfers'][_0x3ea466[_0xea44('0x4a')]];_0x4a3fb4[_0xea44('0x4b')]=_0x3ea466[_0xea44('0x4c')];RpcVoiceTransferReport[_0xea44('0x1c')](_0x4a3fb4);delete RpcVoiceTransferReport[_0xea44('0x49')][_0x3ea466[_0xea44('0x4a')]];}if(_[_0xea44('0x23')](_0x3ea466[_0xea44('0x3b')])){_0x3ea466['type']=this[_0xea44('0x32')](_0x3ea466);}if(_[_0xea44('0x23')](_0x3ea466[_0xea44('0x4d')])){var _0x16c54b=_0x3ea466[_0xea44('0x33')][_0xea44('0x34')]('-')[0x0];var _0x5b7b86=this[_0xea44('0xf')][_0x16c54b];if(!_0x5b7b86)_0x5b7b86=this[_0xea44('0x35')](_0x3ea466[_0xea44('0x21')]);if(_0x5b7b86){_0x3ea466[_0xea44('0x4d')]=_0x5b7b86['id'];_0x3ea466[_0xea44('0x4e')]=_0x5b7b86[_0xea44('0x22')];}}RpcVoiceCallReport[_0xea44('0x2f')](_0x3ea466);if(_0x3ea466[_0xea44('0x4f')]){for(var _0xfbf614=0x0;_0xfbf614<_0x3ea466[_0xea44('0x50')][_0xea44('0x51')];_0xfbf614+=0x1){_0x3ea466['monitorFilename']=_0x3ea466['monitors'][_0xfbf614][_0xea44('0x52')];_0x3ea466[_0xea44('0x53')]=_0x3ea466[_0xea44('0x50')][_0xfbf614][_0xea44('0x53')];if(_0x3ea466[_0xea44('0x3a')]==_0xea44('0x42')){_0x3ea466[_0xea44('0x36')]=_0x3ea466[_0xea44('0x47')];_0x3ea466['calleridname']=_0x3ea466[_0xea44('0x54')];_0x3ea466[_0xea44('0x47')]=_0x3ea466[_0xea44('0x21')];_0x3ea466['connectedlinename']=_0x3ea466[_0xea44('0x4e')];_0x3ea466[_0xea44('0x3a')]=_0x3ea466['originatecalleridnum'];}else if(_0x3ea466['exten']=='xcally-motion-dialer'){_0x3ea466[_0xea44('0x36')]=_0x3ea466['destination'];_0x3ea466['exten']=_0x3ea466[_0xea44('0x43')];}RpcVoiceRecording[_0xea44('0x2f')](_0x3ea466);}}};Report['prototype'][_0xea44('0x19')]=function(_0x306400){if(_[_0xea44('0x55')](_0x306400)){_0x306400['forEach'](function(_0x39e022){RpcVoiceAgentReport[_0xea44('0x2f')](_0x39e022);});}else{RpcVoiceAgentReport[_0xea44('0x2f')](_0x306400);}};Report['prototype']['voiceDialReport']=function(_0x44c833){RpcVoiceDialReport[_0xea44('0x2f')](_0x44c833);var _0x186adc;var _0x5030b4;var _0x260e99=_0x44c833['channel'];if(_['startsWith'](_0x260e99,_0xea44('0x56'))){_0x5030b4=_0x260e99[_0xea44('0x57')](_0x260e99[_0xea44('0x58')]('/')+0x1,_0x260e99['indexOf']('@'));_0x186adc=_[_0xea44('0x24')](this[_0xea44('0xf')],function(_0x47bd25){return _0x47bd25[_0xea44('0x59')]==_0x5030b4||_0x47bd25[_0xea44('0x5a')]==_0x5030b4||_0x47bd25['accountcode']==_0x5030b4;});}else{_0x5030b4=_0x260e99[_0xea44('0x57')](_0x260e99['indexOf']('/')+0x1,_0x260e99['lastIndexOf']('-'));_0x186adc=this[_0xea44('0x20')](_0x5030b4);}if(_0x186adc){_0x44c833[_0xea44('0x25')]=_['isNil'](_0x186adc[_0xea44('0x25')])?util['format']('SIP/%s',_0x186adc[_0xea44('0x22')]):_0x186adc[_0xea44('0x25')];_0x44c833[_0xea44('0x4e')]=_0x186adc[_0xea44('0x22')];_0x44c833[_0xea44('0x21')]=_0x186adc[_0xea44('0x21')];RpcMemberReport[_0xea44('0x1b')](_0x44c833);}};Report[_0xea44('0x1f')]['blindTransfer']=function(_0x311d59){RpcVoiceTransferReport[_0xea44('0x49')][_0x311d59[_0xea44('0x5b')]]=_0x311d59;};Report[_0xea44('0x1f')][_0xea44('0x1e')]=function(_0x547357){RpcVoiceTransferReport['attendedTransfer'](_0x547357);};module[_0xea44('0x5c')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 19e157c..a1afb56 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed35=['[userReport][peerstatus]','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','catch','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','emit','info','debug','[userReport][registry]','stateRegistry','state','merge','omit','event','username','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','updateStatusRealtime','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','trunks','Local','substring','indexOf','find','phone','accountcode','address','peer','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:'];(function(_0x592770,_0x3c3f83){var _0x2680f8=function(_0x5a9ba9){while(--_0x5a9ba9){_0x592770['push'](_0x592770['shift']());}};_0x2680f8(++_0x3c3f83);}(_0xed35,0x1b2));var _0x5ed3=function(_0x54ee24,_0x14cb6b){_0x54ee24=_0x54ee24-0x0;var _0x37f62f=_0xed35[_0x54ee24];return _0x37f62f;};'use strict';var _=require(_0x5ed3('0x0'));var moment=require(_0x5ed3('0x1'));var util=require(_0x5ed3('0x2'));var Redis=require(_0x5ed3('0x3'));var BPromise=require(_0x5ed3('0x4'));var config=require(_0x5ed3('0x5'));var logger=require(_0x5ed3('0x6'))('ami');var ami=require('../ami');config[_0x5ed3('0x7')]=_[_0x5ed3('0x8')](config[_0x5ed3('0x7')],{'host':_0x5ed3('0x9'),'port':0x18eb});var io=require(_0x5ed3('0xa'))(new Redis(config[_0x5ed3('0x7')]));function UserReport(_0x11a1fb){this['trunks']=_0x11a1fb['trunks'];this[_0x5ed3('0xb')]=_0x11a1fb['agents'];this[_0x5ed3('0xc')]=_0x11a1fb[_0x5ed3('0xc')];ami['on'](_0x5ed3('0xd'),this[_0x5ed3('0xe')][_0x5ed3('0xf')](this));ami['on'](_0x5ed3('0x10'),this[_0x5ed3('0xe')][_0x5ed3('0xf')](this));ami['on'](_0x5ed3('0x11'),this[_0x5ed3('0x12')][_0x5ed3('0xf')](this));ami['on'](_0x5ed3('0x13'),this[_0x5ed3('0x14')]['bind'](this));return this[_0x5ed3('0x15')]();}function showSipRegistrations(){Promise[_0x5ed3('0x16')]()[_0x5ed3('0x17')](ami[_0x5ed3('0x18')]())['catch'](function(_0x306dff){logger[_0x5ed3('0x19')](_0x5ed3('0x1a'),util[_0x5ed3('0x1b')](_0x306dff,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x5ed3('0x17')](ami[_0x5ed3('0x1c')]())[_0x5ed3('0x1d')](function(_0x1ca3dc){logger[_0x5ed3('0x19')](_0x5ed3('0x1e'),util['inspect'](_0x1ca3dc,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x5ed3('0x17')](ami[_0x5ed3('0x1f')]())[_0x5ed3('0x1d')](function(_0x4e08d8){logger['error'](_0x5ed3('0x20'),util[_0x5ed3('0x1b')](_0x4e08d8,{'showHidden':![],'depth':null}));});}UserReport[_0x5ed3('0x21')][_0x5ed3('0x15')]=function(){setInterval(function(){BPromise[_0x5ed3('0x16')]()['then'](showSipRegistrations())[_0x5ed3('0x17')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x5ed3('0x21')][_0x5ed3('0x22')]=function(_0x24c171){return _0x24c171!==null&&!_['isUndefined'](_0x24c171);};UserReport[_0x5ed3('0x21')][_0x5ed3('0x23')]=function(_0x383ed6,_0x5e7aa8,_0x474fb3){io['to'](_0x383ed6)[_0x5ed3('0x23')](_0x5e7aa8,_0x474fb3);};UserReport['prototype']['syncRegistry']=function(_0x583973){try{if(this[_0x5ed3('0x22')](_0x583973)){logger[_0x5ed3('0x24')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x583973['username'],_0x583973['state']);logger[_0x5ed3('0x25')](_0x5ed3('0x26'),util['inspect'](_0x583973,{'showHidden':![],'depth':null}));var _0x1b22d6=_['find'](this['trunks'],{'defaultuser':_0x583973['username']});if(_0x1b22d6){_0x583973[_0x5ed3('0x27')]=_0x583973[_0x5ed3('0x28')];_[_0x5ed3('0x29')](_0x1b22d6,_[_0x5ed3('0x2a')](_0x583973,[_0x5ed3('0x2b'),'actionid',_0x5ed3('0x2c'),_0x5ed3('0x28')]));logger[_0x5ed3('0x25')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x5ed3('0x1b')](_0x1b22d6,{'showHidden':![],'depth':null}));this[_0x5ed3('0x23')](util[_0x5ed3('0x2d')](_0x5ed3('0x2e'),_0x1b22d6[_0x5ed3('0x2f')]),_0x5ed3('0x30'),_0x1b22d6);}}}catch(_0x4344f4){logger['error'](_0x5ed3('0x26'),util['inspect'](_0x4344f4,{'showHidden':![],'depth':null}));}};UserReport[_0x5ed3('0x21')][_0x5ed3('0x12')]=function(_0x2b2e07){try{if(this[_0x5ed3('0x22')](_0x2b2e07)){logger[_0x5ed3('0x24')](_0x5ed3('0x31'),_0x2b2e07[_0x5ed3('0x32')],_0x2b2e07[_0x5ed3('0x28')]);logger[_0x5ed3('0x25')](_0x5ed3('0x33'),util[_0x5ed3('0x1b')](_0x2b2e07,{'showHidden':![],'depth':null}));if(this[_0x5ed3('0xb')][_0x2b2e07['device']]){if(!this[_0x5ed3('0xb')][_0x2b2e07[_0x5ed3('0x32')]][_0x5ed3('0x34')]||_0x2b2e07[_0x5ed3('0x28')][_0x5ed3('0x35')]()=='inuse'){this[_0x5ed3('0xb')][_0x2b2e07[_0x5ed3('0x32')]][_0x5ed3('0x34')]=![];if(this['agents'][_0x2b2e07[_0x5ed3('0x32')]]['state']!==_0x2b2e07[_0x5ed3('0x28')]['toLowerCase']()){this[_0x5ed3('0xb')][_0x2b2e07[_0x5ed3('0x32')]]['stateTime']=_['toNumber'](moment()[_0x5ed3('0x2d')]('x'));}this[_0x5ed3('0xb')][_0x2b2e07['device']][_0x5ed3('0x28')]=_0x2b2e07[_0x5ed3('0x28')]['toLowerCase']();this['agents'][_0x2b2e07['device']][_0x5ed3('0x36')](_0x2b2e07);}}else if(this[_0x5ed3('0xc')][_0x2b2e07[_0x5ed3('0x32')]]){if(this['telephones'][_0x2b2e07[_0x5ed3('0x32')]]['state']!==_0x2b2e07[_0x5ed3('0x28')][_0x5ed3('0x35')]()){this[_0x5ed3('0xc')][_0x2b2e07[_0x5ed3('0x32')]][_0x5ed3('0x37')]=_[_0x5ed3('0x38')](moment()['format']('x'));}this[_0x5ed3('0xc')][_0x2b2e07[_0x5ed3('0x32')]][_0x5ed3('0x28')]=_0x2b2e07['state']['toLowerCase']();logger['debug'](_0x5ed3('0x39'),util[_0x5ed3('0x1b')](this['telephones'][_0x2b2e07['device']],{'showHidden':![],'depth':null}));this[_0x5ed3('0x23')](util[_0x5ed3('0x2d')](_0x5ed3('0x3a'),this[_0x5ed3('0xc')][_0x2b2e07[_0x5ed3('0x32')]][_0x5ed3('0x2f')]),'telephone:save',this[_0x5ed3('0xc')][_0x2b2e07[_0x5ed3('0x32')]]);}else if(this[_0x5ed3('0x3b')][_0x2b2e07[_0x5ed3('0x32')]]){if(this['trunks'][_0x2b2e07[_0x5ed3('0x32')]][_0x5ed3('0x28')]!==_0x2b2e07[_0x5ed3('0x28')]['toLowerCase']()){this['trunks'][_0x2b2e07[_0x5ed3('0x32')]]['stateTime']=_[_0x5ed3('0x38')](moment()[_0x5ed3('0x2d')]('x'));}this[_0x5ed3('0x3b')][_0x2b2e07[_0x5ed3('0x32')]]['state']=_0x2b2e07['state'][_0x5ed3('0x35')]();logger[_0x5ed3('0x25')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x5ed3('0x1b')](this[_0x5ed3('0x3b')][_0x2b2e07[_0x5ed3('0x32')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x5ed3('0x2d')](_0x5ed3('0x2e'),this['trunks'][_0x2b2e07[_0x5ed3('0x32')]]['name']),_0x5ed3('0x30'),this[_0x5ed3('0x3b')][_0x2b2e07['device']]);}else if(_['startsWith'](_0x2b2e07[_0x5ed3('0x32')],_0x5ed3('0x3c'))){var _0x5bfe3a=_0x2b2e07[_0x5ed3('0x32')];var _0x236653=_0x5bfe3a[_0x5ed3('0x3d')](_0x5bfe3a[_0x5ed3('0x3e')]('/')+0x1,_0x5bfe3a[_0x5ed3('0x3e')]('@'));var _0x4abcbc=_[_0x5ed3('0x3f')](this[_0x5ed3('0xb')],function(_0x439b8c){return _0x439b8c['mobile']==_0x236653||_0x439b8c[_0x5ed3('0x40')]==_0x236653||_0x439b8c[_0x5ed3('0x41')]==_0x236653;});if(_0x4abcbc){if(_0x4abcbc[_0x5ed3('0x28')]!==_0x2b2e07[_0x5ed3('0x28')][_0x5ed3('0x35')]()){_0x4abcbc[_0x5ed3('0x37')]=_[_0x5ed3('0x38')](moment()[_0x5ed3('0x2d')]('x'));}_0x4abcbc['state']=_0x2b2e07['state'][_0x5ed3('0x35')]();_0x4abcbc[_0x5ed3('0x34')]=!![];_0x4abcbc['updateStatusRealtime'](_0x2b2e07);}}}}catch(_0x263077){logger['error'](_0x5ed3('0x33'),util['inspect'](_0x263077,{'showHidden':![],'depth':null}));}};UserReport[_0x5ed3('0x21')][_0x5ed3('0x14')]=function(_0x2ee67d){try{if(this['isNotNull'](_0x2ee67d)&&this[_0x5ed3('0x22')](_0x2ee67d[_0x5ed3('0x13')])){logger[_0x5ed3('0x24')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x2ee67d['peer'],_0x2ee67d[_0x5ed3('0x42')],_0x2ee67d[_0x5ed3('0x13')]);logger[_0x5ed3('0x25')]('[userReport][peerstatus]',util['inspect'](_0x2ee67d,{'showHidden':![],'depth':null}));if(this[_0x5ed3('0xb')][_0x2ee67d[_0x5ed3('0x43')]]){if(!this['agents'][_0x2ee67d[_0x5ed3('0x43')]][_0x5ed3('0x34')]||_0x2ee67d['peerstatus'][_0x5ed3('0x35')]()=='registered'){this['agents'][_0x2ee67d['peer']][_0x5ed3('0x34')]=![];this['agents'][_0x2ee67d[_0x5ed3('0x43')]][_0x5ed3('0x44')]=_0x2ee67d['peerstatus'][_0x5ed3('0x35')]();this[_0x5ed3('0xb')][_0x2ee67d[_0x5ed3('0x43')]][_0x5ed3('0x42')]=_0x2ee67d['address'];this[_0x5ed3('0xb')][_0x2ee67d['peer']]['updateStatusRealtime'](_0x2ee67d);}}else if(this['telephones'][_0x2ee67d[_0x5ed3('0x43')]]){this[_0x5ed3('0xc')][_0x2ee67d[_0x5ed3('0x43')]]['status']=_0x2ee67d[_0x5ed3('0x13')][_0x5ed3('0x35')]();this[_0x5ed3('0xc')][_0x2ee67d['peer']][_0x5ed3('0x42')]=_0x2ee67d[_0x5ed3('0x42')];logger[_0x5ed3('0x25')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x5ed3('0xc')][_0x2ee67d[_0x5ed3('0x43')]],{'showHidden':![],'depth':null}));this[_0x5ed3('0x23')](util[_0x5ed3('0x2d')](_0x5ed3('0x3a'),this[_0x5ed3('0xc')][_0x2ee67d[_0x5ed3('0x43')]][_0x5ed3('0x2f')]),'telephone:save',this['telephones'][_0x2ee67d[_0x5ed3('0x43')]]);}else if(this[_0x5ed3('0x3b')][_0x2ee67d[_0x5ed3('0x43')]]){this[_0x5ed3('0x3b')][_0x2ee67d['peer']][_0x5ed3('0x44')]=_0x2ee67d[_0x5ed3('0x13')]['toLowerCase']();this['trunks'][_0x2ee67d[_0x5ed3('0x43')]][_0x5ed3('0x42')]=_0x2ee67d[_0x5ed3('0x42')];logger[_0x5ed3('0x25')](_0x5ed3('0x45'),util[_0x5ed3('0x1b')](this[_0x5ed3('0x3b')][_0x2ee67d[_0x5ed3('0x43')]],{'showHidden':![],'depth':null}));this[_0x5ed3('0x23')](util[_0x5ed3('0x2d')]('trunk:%s',this[_0x5ed3('0x3b')][_0x2ee67d[_0x5ed3('0x43')]][_0x5ed3('0x2f')]),_0x5ed3('0x30'),this['trunks'][_0x2ee67d[_0x5ed3('0x43')]]);}}}catch(_0x3a4cc3){logger['error'](_0x5ed3('0x46'),util[_0x5ed3('0x1b')](_0x3a4cc3,{'showHidden':![],'depth':null}));}};module[_0x5ed3('0x47')]=UserReport; \ No newline at end of file +var _0xe590=['syncRegistry','bind','registry','devicestatechange','peerstatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','Local','indexOf','mobile','phone','accountcode','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones'];(function(_0x2afdce,_0x2b21ab){var _0x45065f=function(_0x1f76cf){while(--_0x1f76cf){_0x2afdce['push'](_0x2afdce['shift']());}};_0x45065f(++_0x2b21ab);}(_0xe590,0x179));var _0x0e59=function(_0x537fc5,_0x1986f0){_0x537fc5=_0x537fc5-0x0;var _0x2a2fdd=_0xe590[_0x537fc5];return _0x2a2fdd;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x0e59('0x0'));var Redis=require(_0x0e59('0x1'));var BPromise=require(_0x0e59('0x2'));var config=require(_0x0e59('0x3'));var logger=require(_0x0e59('0x4'))(_0x0e59('0x5'));var ami=require('../ami');config[_0x0e59('0x6')]=_[_0x0e59('0x7')](config[_0x0e59('0x6')],{'host':_0x0e59('0x8'),'port':0x18eb});var io=require(_0x0e59('0x9'))(new Redis(config[_0x0e59('0x6')]));function UserReport(_0x3b8684){this[_0x0e59('0xa')]=_0x3b8684[_0x0e59('0xa')];this[_0x0e59('0xb')]=_0x3b8684['agents'];this[_0x0e59('0xc')]=_0x3b8684[_0x0e59('0xc')];ami['on']('registryentry',this[_0x0e59('0xd')][_0x0e59('0xe')](this));ami['on'](_0x0e59('0xf'),this[_0x0e59('0xd')][_0x0e59('0xe')](this));ami['on'](_0x0e59('0x10'),this['syncDeviceState']['bind'](this));ami['on'](_0x0e59('0x11'),this['syncPeerStatus']['bind'](this));return this[_0x0e59('0x12')]();}function showSipRegistrations(){Promise[_0x0e59('0x13')]()['then'](ami[_0x0e59('0x14')]())[_0x0e59('0x15')](function(_0x4cbe36){logger[_0x0e59('0x16')](_0x0e59('0x17'),util[_0x0e59('0x18')](_0x4cbe36,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x0e59('0x13')]()[_0x0e59('0x19')](ami[_0x0e59('0x1a')]())[_0x0e59('0x15')](function(_0x4a99dc){logger['error'](_0x0e59('0x1b'),util[_0x0e59('0x18')](_0x4a99dc,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x0e59('0x13')]()[_0x0e59('0x19')](ami['actionSipPeerStatus']())[_0x0e59('0x15')](function(_0x3b9891){logger[_0x0e59('0x16')](_0x0e59('0x1c'),util[_0x0e59('0x18')](_0x3b9891,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x0e59('0x12')]=function(){setInterval(function(){BPromise[_0x0e59('0x13')]()[_0x0e59('0x19')](showSipRegistrations())[_0x0e59('0x19')](listDeviceStates())[_0x0e59('0x19')](showPeersStatus());},0x32c8);};UserReport[_0x0e59('0x1d')]['isNotNull']=function(_0x564484){return _0x564484!==null&&!_[_0x0e59('0x1e')](_0x564484);};UserReport[_0x0e59('0x1d')][_0x0e59('0x1f')]=function(_0x911281,_0x59d856,_0x11b138){io['to'](_0x911281)[_0x0e59('0x1f')](_0x59d856,_0x11b138);};UserReport['prototype'][_0x0e59('0xd')]=function(_0x332abe){try{if(this[_0x0e59('0x20')](_0x332abe)){logger[_0x0e59('0x21')](_0x0e59('0x22'),_0x332abe[_0x0e59('0x23')],_0x332abe[_0x0e59('0x24')]);logger[_0x0e59('0x25')](_0x0e59('0x26'),util[_0x0e59('0x18')](_0x332abe,{'showHidden':![],'depth':null}));var _0x380096=_[_0x0e59('0x27')](this[_0x0e59('0xa')],{'defaultuser':_0x332abe[_0x0e59('0x23')]});if(_0x380096){_0x332abe[_0x0e59('0x28')]=_0x332abe[_0x0e59('0x24')];_[_0x0e59('0x29')](_0x380096,_[_0x0e59('0x2a')](_0x332abe,[_0x0e59('0x2b'),_0x0e59('0x2c'),_0x0e59('0x23'),_0x0e59('0x24')]));logger[_0x0e59('0x25')](_0x0e59('0x2d'),util[_0x0e59('0x18')](_0x380096,{'showHidden':![],'depth':null}));this[_0x0e59('0x1f')](util[_0x0e59('0x2e')]('trunk:%s',_0x380096['name']),_0x0e59('0x2f'),_0x380096);}}}catch(_0x513c44){logger[_0x0e59('0x16')]('[userReport][registry]',util[_0x0e59('0x18')](_0x513c44,{'showHidden':![],'depth':null}));}};UserReport[_0x0e59('0x1d')]['syncDeviceState']=function(_0x82cdfb){try{if(this[_0x0e59('0x20')](_0x82cdfb)){logger[_0x0e59('0x21')](_0x0e59('0x30'),_0x82cdfb['device'],_0x82cdfb[_0x0e59('0x24')]);logger['debug'](_0x0e59('0x31'),util[_0x0e59('0x18')](_0x82cdfb,{'showHidden':![],'depth':null}));if(this[_0x0e59('0xb')][_0x82cdfb[_0x0e59('0x32')]]){if(!this[_0x0e59('0xb')][_0x82cdfb[_0x0e59('0x32')]][_0x0e59('0x33')]||_0x82cdfb[_0x0e59('0x24')][_0x0e59('0x34')]()==_0x0e59('0x35')){this[_0x0e59('0xb')][_0x82cdfb[_0x0e59('0x32')]][_0x0e59('0x33')]=![];if(this[_0x0e59('0xb')][_0x82cdfb['device']][_0x0e59('0x24')]!==_0x82cdfb[_0x0e59('0x24')]['toLowerCase']()){this['agents'][_0x82cdfb[_0x0e59('0x32')]][_0x0e59('0x36')]=_[_0x0e59('0x37')](moment()[_0x0e59('0x2e')]('x'));}this[_0x0e59('0xb')][_0x82cdfb[_0x0e59('0x32')]][_0x0e59('0x24')]=_0x82cdfb[_0x0e59('0x24')][_0x0e59('0x34')]();this[_0x0e59('0xb')][_0x82cdfb[_0x0e59('0x32')]][_0x0e59('0x38')](_0x82cdfb);}}else if(this[_0x0e59('0xc')][_0x82cdfb['device']]){if(this[_0x0e59('0xc')][_0x82cdfb['device']][_0x0e59('0x24')]!==_0x82cdfb['state'][_0x0e59('0x34')]()){this[_0x0e59('0xc')][_0x82cdfb['device']][_0x0e59('0x36')]=_[_0x0e59('0x37')](moment()['format']('x'));}this['telephones'][_0x82cdfb['device']]['state']=_0x82cdfb[_0x0e59('0x24')][_0x0e59('0x34')]();logger[_0x0e59('0x25')](_0x0e59('0x39'),util[_0x0e59('0x18')](this[_0x0e59('0xc')][_0x82cdfb[_0x0e59('0x32')]],{'showHidden':![],'depth':null}));this[_0x0e59('0x1f')](util['format'](_0x0e59('0x3a'),this[_0x0e59('0xc')][_0x82cdfb[_0x0e59('0x32')]][_0x0e59('0x3b')]),_0x0e59('0x3c'),this[_0x0e59('0xc')][_0x82cdfb[_0x0e59('0x32')]]);}else if(this[_0x0e59('0xa')][_0x82cdfb[_0x0e59('0x32')]]){if(this[_0x0e59('0xa')][_0x82cdfb[_0x0e59('0x32')]][_0x0e59('0x24')]!==_0x82cdfb[_0x0e59('0x24')][_0x0e59('0x34')]()){this[_0x0e59('0xa')][_0x82cdfb[_0x0e59('0x32')]][_0x0e59('0x36')]=_[_0x0e59('0x37')](moment()['format']('x'));}this[_0x0e59('0xa')][_0x82cdfb['device']][_0x0e59('0x24')]=_0x82cdfb['state'][_0x0e59('0x34')]();logger[_0x0e59('0x25')](_0x0e59('0x3d'),util[_0x0e59('0x18')](this['trunks'][_0x82cdfb[_0x0e59('0x32')]],{'showHidden':![],'depth':null}));this[_0x0e59('0x1f')](util[_0x0e59('0x2e')](_0x0e59('0x3e'),this['trunks'][_0x82cdfb[_0x0e59('0x32')]][_0x0e59('0x3b')]),_0x0e59('0x2f'),this[_0x0e59('0xa')][_0x82cdfb[_0x0e59('0x32')]]);}else if(_[_0x0e59('0x3f')](_0x82cdfb[_0x0e59('0x32')],_0x0e59('0x40'))){var _0x4006c2=_0x82cdfb[_0x0e59('0x32')];var _0x204f57=_0x4006c2['substring'](_0x4006c2[_0x0e59('0x41')]('/')+0x1,_0x4006c2[_0x0e59('0x41')]('@'));var _0xdd5b52=_[_0x0e59('0x27')](this['agents'],function(_0x125316){return _0x125316[_0x0e59('0x42')]==_0x204f57||_0x125316[_0x0e59('0x43')]==_0x204f57||_0x125316[_0x0e59('0x44')]==_0x204f57;});if(_0xdd5b52){if(_0xdd5b52[_0x0e59('0x24')]!==_0x82cdfb[_0x0e59('0x24')][_0x0e59('0x34')]()){_0xdd5b52[_0x0e59('0x36')]=_[_0x0e59('0x37')](moment()[_0x0e59('0x2e')]('x'));}_0xdd5b52[_0x0e59('0x24')]=_0x82cdfb[_0x0e59('0x24')][_0x0e59('0x34')]();_0xdd5b52[_0x0e59('0x33')]=!![];_0xdd5b52[_0x0e59('0x38')](_0x82cdfb);}}}}catch(_0x1f0e19){logger[_0x0e59('0x16')]('[userReport][devicestatechange]',util[_0x0e59('0x18')](_0x1f0e19,{'showHidden':![],'depth':null}));}};UserReport[_0x0e59('0x1d')][_0x0e59('0x45')]=function(_0x49617e){try{if(this[_0x0e59('0x20')](_0x49617e)&&this['isNotNull'](_0x49617e[_0x0e59('0x11')])){logger[_0x0e59('0x21')](_0x0e59('0x46'),_0x49617e[_0x0e59('0x47')],_0x49617e[_0x0e59('0x48')],_0x49617e[_0x0e59('0x11')]);logger[_0x0e59('0x25')]('[userReport][peerstatus]',util[_0x0e59('0x18')](_0x49617e,{'showHidden':![],'depth':null}));if(this[_0x0e59('0xb')][_0x49617e[_0x0e59('0x47')]]){if(!this[_0x0e59('0xb')][_0x49617e['peer']][_0x0e59('0x33')]||_0x49617e['peerstatus'][_0x0e59('0x34')]()==_0x0e59('0x49')){this[_0x0e59('0xb')][_0x49617e[_0x0e59('0x47')]][_0x0e59('0x33')]=![];this[_0x0e59('0xb')][_0x49617e['peer']]['status']=_0x49617e['peerstatus'][_0x0e59('0x34')]();this[_0x0e59('0xb')][_0x49617e['peer']][_0x0e59('0x48')]=_0x49617e[_0x0e59('0x48')];this[_0x0e59('0xb')][_0x49617e['peer']][_0x0e59('0x38')](_0x49617e);}}else if(this[_0x0e59('0xc')][_0x49617e[_0x0e59('0x47')]]){this[_0x0e59('0xc')][_0x49617e[_0x0e59('0x47')]][_0x0e59('0x4a')]=_0x49617e[_0x0e59('0x11')][_0x0e59('0x34')]();this['telephones'][_0x49617e[_0x0e59('0x47')]][_0x0e59('0x48')]=_0x49617e[_0x0e59('0x48')];logger[_0x0e59('0x25')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x0e59('0x18')](this[_0x0e59('0xc')][_0x49617e[_0x0e59('0x47')]],{'showHidden':![],'depth':null}));this[_0x0e59('0x1f')](util[_0x0e59('0x2e')](_0x0e59('0x3a'),this[_0x0e59('0xc')][_0x49617e[_0x0e59('0x47')]][_0x0e59('0x3b')]),_0x0e59('0x3c'),this['telephones'][_0x49617e['peer']]);}else if(this[_0x0e59('0xa')][_0x49617e['peer']]){this[_0x0e59('0xa')][_0x49617e['peer']][_0x0e59('0x4a')]=_0x49617e[_0x0e59('0x11')][_0x0e59('0x34')]();this[_0x0e59('0xa')][_0x49617e['peer']][_0x0e59('0x48')]=_0x49617e[_0x0e59('0x48')];logger[_0x0e59('0x25')](_0x0e59('0x4b'),util[_0x0e59('0x18')](this['trunks'][_0x49617e[_0x0e59('0x47')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x0e59('0x2e')](_0x0e59('0x3e'),this[_0x0e59('0xa')][_0x49617e[_0x0e59('0x47')]][_0x0e59('0x3b')]),_0x0e59('0x2f'),this['trunks'][_0x49617e[_0x0e59('0x47')]]);}}}catch(_0x30b3dd){logger[_0x0e59('0x16')](_0x0e59('0x4c'),util[_0x0e59('0x18')](_0x30b3dd,{'showHidden':![],'depth':null}));}};module[_0x0e59('0x4d')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 0f331b4..33cc244 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x57515b,_0x76980e){var _0xb15872=function(_0x1ef9df){while(--_0x1ef9df){_0x57515b['push'](_0x57515b['shift']());}};_0xb15872(++_0x76980e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file +var _0xa9e0=['musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','extravar','format','user:%s','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','agentringnoanswerAt','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','agent','talktime','acw','acwtime','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart'];(function(_0x338e0d,_0x4d61a5){var _0x16540c=function(_0x1b5042){while(--_0x1b5042){_0x338e0d['push'](_0x338e0d['shift']());}};_0x16540c(++_0x4d61a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]],'motionChannel':_0x0a9e('0x2c')};}_['merge'](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']]);var _0x66c1d2={'id':this[_0x0a9e('0xa')][_0x155cce[_0x0a9e('0x32')]]['id'],'calleridnum':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0x33')],'queue':this[_0x0a9e('0x8')][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]]['queue'],'extravar':this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')]?this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]][_0x0a9e('0xb')][_0x0a9e('0x34')]:undefined};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x155cce[_0x0a9e('0x26')],util['inspect'](_0x66c1d2,{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x155cce[_0x0a9e('0x21')]),'user:called',_0x66c1d2);}}catch(_0x31916f){logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x31916f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x39')]=function(_0x4c1c0e){try{if(this['isNotNull'](_0x4c1c0e)){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]){logger['debug'](_0x0a9e('0x3a'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c1c0e,{'showHidden':![],'depth':null}));for(var _0x148f55 in this['channels'][_0x4c1c0e['uniqueid']]){if(this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]]['hasOwnProperty'](_0x148f55)){if(_0x4c1c0e[_0x0a9e('0x22')]===_0x148f55){logger[_0x0a9e('0x20')](_0x0a9e('0x3b'),_0x4c1c0e['uniqueid'],_0x4c1c0e[_0x0a9e('0x21')],_0x4c1c0e[_0x0a9e('0x22')]);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3c')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3d')]=_0x4c1c0e[_0x0a9e('0x3d')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x3e')]=_0x4c1c0e[_0x0a9e('0x3e')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x3f')]=_0x4c1c0e[_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x40')]=_0x4c1c0e[_0x0a9e('0x40')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x41')]=_0x4c1c0e[_0x0a9e('0x41')];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['lastevent']=_0x0a9e('0x42');if(this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x26')]]){var _0xbe9d19=this[_0x0a9e('0x43')][this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55][_0x0a9e('0x26')]]['routealias'];this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x44')]=_0xbe9d19;_0x4c1c0e['routealias']=_0xbe9d19;}_[_0x0a9e('0x45')](this[_0x0a9e('0xa')][_0x4c1c0e[_0x0a9e('0x32')]],_[_0x0a9e('0x46')](_0x4c1c0e,[_0x0a9e('0x28'),_0x0a9e('0x47'),_0x0a9e('0x44')]));logger['debug'](_0x0a9e('0x48'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x49'),this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x4c1c0e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x4c1c0e['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x4c1c0e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')](_0x0a9e('0x36'),_0x4c1c0e[_0x0a9e('0x21')]),_0x0a9e('0x4a'),this['channels'][_0x4c1c0e['uniqueid']][_0x4c1c0e['destuniqueid']]);}else if(!this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]&&!this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x4c1c0e[_0x0a9e('0x26')],this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['membername'],_0x148f55);this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4b')]=!![];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheredestinationuniqueid']=_0x4c1c0e[_0x0a9e('0x22')];this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]['answeredelsewheremembername']=_0x4c1c0e[_0x0a9e('0x21')];this['channels'][_0x4c1c0e['uniqueid']][_0x148f55]['lastevent']=_0x0a9e('0x4d');this['channels'][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55][_0x0a9e('0x4e')]=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4f'),_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x4c1c0e['uniqueid']][_0x148f55],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x50'),this[_0x0a9e('0x8')][_0x4c1c0e[_0x0a9e('0x26')]][_0x148f55]);}}}}}}catch(_0xb83dfd){logger[_0x0a9e('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x4c1c0e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xb83dfd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x51')]=function(_0x5cc8fb){try{if(this[_0x0a9e('0x1e')](_0x5cc8fb)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x5cc8fb['uniqueid'],util[_0x0a9e('0x25')](_0x5cc8fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x5cc8fb[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]){logger[_0x0a9e('0x20')](_0x0a9e('0x52'),_0x5cc8fb['uniqueid'],_0x5cc8fb[_0x0a9e('0x21')],_0x5cc8fb['destuniqueid']);this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x5cc8fb['uniqueid']][_0x5cc8fb[_0x0a9e('0x22')]][_0x0a9e('0x53')]=_0x0a9e('0x54');this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb['destuniqueid']][_0x0a9e('0x4e')]=_0x0a9e('0x54');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x5cc8fb[_0x0a9e('0x26')],util['inspect'](this['channels'][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x55'),this[_0x0a9e('0x8')][_0x5cc8fb[_0x0a9e('0x26')]][_0x5cc8fb[_0x0a9e('0x22')]]);}}}catch(_0x54a37d){logger[_0x0a9e('0x37')](_0x0a9e('0x56'),_0x5cc8fb[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x54a37d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x11')]=function(_0x320898){try{if(this[_0x0a9e('0x1e')](_0x320898)){logger[_0x0a9e('0x23')](_0x0a9e('0x57'),_0x320898['uniqueid'],util[_0x0a9e('0x25')](_0x320898,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){for(var _0x4edbb0 in this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]]){if(this['channels'][_0x320898[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x4edbb0)&&!this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4b')]&&!this['channels'][_0x320898['uniqueid']][_0x4edbb0]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x59'),_0x320898[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x21')],_0x4edbb0);this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4c')]=moment()['format'](_0x0a9e('0x27'));this['channels'][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x53')]='abandoned';this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0][_0x0a9e('0x4e')]=_0x0a9e('0x5a');logger['debug'](_0x0a9e('0x5b'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x320898['uniqueid']][_0x4edbb0],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x5c'),this[_0x0a9e('0x8')][_0x320898[_0x0a9e('0x26')]][_0x4edbb0]);}}}}}catch(_0x4abc8f){logger[_0x0a9e('0x37')](_0x0a9e('0x5d'),_0x320898[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4abc8f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x13')]=function(_0x40fc56){try{if(this[_0x0a9e('0x1e')](_0x40fc56)){logger[_0x0a9e('0x23')](_0x0a9e('0x5e'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x40fc56,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){for(var _0x5b35db in this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x0a9e('0x58')](_0x5b35db)){if(this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x3c')]&&!this['channels'][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x40fc56[_0x0a9e('0x26')],this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x21')],_0x5b35db);this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x40fc56['uniqueid']][_0x5b35db][_0x0a9e('0x4e')]=_0x40fc56[_0x0a9e('0x4e')]=='transfer'?_0x0a9e('0x61'):_0x40fc56['reason'];this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x62')]=_0x40fc56[_0x0a9e('0x62')];if(this['voiceQueues'][_0x40fc56['queue']]&&this[_0x0a9e('0x9')][_0x40fc56[_0x0a9e('0x28')]][_0x0a9e('0x63')]){this['channels'][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db][_0x0a9e('0x64')]=this['voiceQueues'][_0x40fc56['queue']][_0x0a9e('0x65')];this['channels'][_0x40fc56['uniqueid']][_0x5b35db]['agentacw']=!![];}this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]=_[_0x0a9e('0x2d')](this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x66'),this[_0x0a9e('0x8')][_0x40fc56[_0x0a9e('0x26')]][_0x5b35db]);logger['debug'](_0x0a9e('0x67'),_0x40fc56[_0x0a9e('0x26')],util[_0x0a9e('0x25')]({'id':this[_0x0a9e('0xa')][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]},{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x35')]('user:%s',_0x40fc56[_0x0a9e('0x21')]),_0x0a9e('0x69'),{'id':this['agents'][_0x40fc56[_0x0a9e('0x32')]]['id'],'destaccountcode':_0x40fc56[_0x0a9e('0x68')]});}}}}}}catch(_0x3a1974){logger['error'](_0x0a9e('0x6a'),_0x40fc56['uniqueid'],util[_0x0a9e('0x25')](_0x3a1974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x1f29bd){try{if(this[_0x0a9e('0x1e')](_0x1f29bd)){logger[_0x0a9e('0x23')](_0x0a9e('0x6b'),_0x1f29bd[_0x0a9e('0x26')],util['inspect'](_0x1f29bd,{'showHidden':![],'depth':null}));this[_0x0a9e('0x6c')](_0x1f29bd[_0x0a9e('0x26')],_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){for(var _0x33f0c9 in this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x0a9e('0x58')](_0x33f0c9)){logger['info'](_0x0a9e('0x70'),_0x1f29bd[_0x0a9e('0x26')],_0x33f0c9,_[_0x0a9e('0x6d')](_0x1f29bd[_0x0a9e('0x6e')])[0x0],_0x1f29bd[_0x0a9e('0x6f')]);if(_['isUndefined'](this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9]['variables'])){this[_0x0a9e('0x8')][_0x1f29bd['uniqueid']][_0x33f0c9][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x1f29bd[_0x0a9e('0x26')]][_0x33f0c9][_0x0a9e('0xb')]=this['variables'][_0x1f29bd[_0x0a9e('0x26')]];}}}}}catch(_0x4cf72d){logger[_0x0a9e('0x37')](_0x0a9e('0x71'),_0x1f29bd['uniqueid'],util[_0x0a9e('0x25')](_0x4cf72d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x6c')]=function(_0x4ab276,_0x4c788f,_0x1b82b7){var _0x6ba2be=[_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),_0x0a9e('0x75'),_0x0a9e('0x76'),_0x0a9e('0x77'),_0x0a9e('0x78'),'rtpaudioqosrttbridged',_0x0a9e('0x79'),'sipuri',_0x0a9e('0x7a'),_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x0a9e('0x7d'),_0x0a9e('0x7e'),'memberlastcall',_0x0a9e('0x21'),_0x0a9e('0x7f'),_0x0a9e('0x80')];if(!_[_0x0a9e('0x81')](_0x4c788f)&&!_[_0x0a9e('0x82')](_0x6ba2be,_0x4c788f)){if(_['isUndefined'](this['variables'][_0x4ab276])){this[_0x0a9e('0xb')][_0x4ab276]={};}this['variables'][_0x4ab276][_0x4c788f]=_0x1b82b7;}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x17')]=function(_0x4672e1){try{if(this[_0x0a9e('0x1e')](_0x4672e1)){logger[_0x0a9e('0x23')](_0x0a9e('0x83'),_0x4672e1['uniqueid'],util['inspect'](_0x4672e1,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']]){for(var _0x2469d1 in this['channels'][_0x4672e1[_0x0a9e('0x26')]]){if(this['channels'][_0x4672e1['uniqueid']][_0x0a9e('0x58')](_0x2469d1)){if(this[_0x0a9e('0x8')][_0x4672e1['uniqueid']][_0x2469d1][_0x0a9e('0x4e')]==_0x0a9e('0x84')&&this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4672e1[_0x0a9e('0x26')],_0x2469d1);this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]][_0x2469d1][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x0a9e('0x23')](_0x0a9e('0x85'),_0x4672e1['uniqueid'],util[_0x0a9e('0x25')](_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x87'),_[_0x0a9e('0x86')](this[_0x0a9e('0x8')][_0x4672e1[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x4672e1['uniqueid']];}if(this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]]){delete this[_0x0a9e('0xb')][_0x4672e1[_0x0a9e('0x26')]];}}}catch(_0x1d0b02){logger['error']('[%s][voiceAgentReport][hangup]',_0x4672e1[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1d0b02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x88')]=function(_0x34f7b5){try{if(this['isNotNull'](_0x34f7b5)){logger[_0x0a9e('0x23')](_0x0a9e('0x89'),_0x34f7b5[_0x0a9e('0x26')],util['inspect'](_0x34f7b5,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]){for(var _0x2144ca in this['channels'][_0x34f7b5[_0x0a9e('0x8a')]]){if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]]['hasOwnProperty'](_0x2144ca)){if(_0x34f7b5[_0x0a9e('0x8b')]===_0x2144ca){logger['info'](_0x0a9e('0x8c'),_0x34f7b5[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x21')],_0x2144ca);var _0x1bee04=moment();this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x5f')]=moment()[_0x0a9e('0x35')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca]['lastevent']='complete';this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x4e')]=_0x0a9e('0x84');this['channels'][_0x34f7b5[_0x0a9e('0x8a')]][_0x2144ca][_0x0a9e('0x62')]=_0x1bee04[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']][_0x2144ca][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}if(this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]]){var _0x5d0e1f=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8f')]];this[_0x0a9e('0x8')][_0x34f7b5['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x34f7b5[_0x0a9e('0x8a')]];this[_0x0a9e('0x8')][_0x34f7b5['transfereeuniqueid']]=_0x5d0e1f;}}}catch(_0x303f75){logger[_0x0a9e('0x37')](_0x0a9e('0x90'),_0x34f7b5[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x303f75,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x1b')]=function(_0x289e65){try{if(this['isNotNull'](_0x289e65)){logger[_0x0a9e('0x23')](_0x0a9e('0x91'),_0x289e65[_0x0a9e('0x26')],util['inspect'](_0x289e65,{'showHidden':![],'depth':null}));if(this['channels'][_0x289e65['transfereeuniqueid']]){for(var _0x1015aa in this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']]){if(this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x0a9e('0x58')](_0x1015aa)){if(_0x289e65['transfereruniqueid']===_0x1015aa){logger[_0x0a9e('0x20')](_0x0a9e('0x92'),_0x289e65[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x21')],_0x1015aa);var _0x40e6e7=moment();this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x5f')]=_0x40e6e7;this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x53')]=_0x0a9e('0x60');this[_0x0a9e('0x8')][_0x289e65['transfereeuniqueid']][_0x1015aa][_0x0a9e('0x4e')]=_0x0a9e('0x84');this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa]['talktime']=_0x40e6e7[_0x0a9e('0x8d')](this[_0x0a9e('0x8')][_0x289e65[_0x0a9e('0x8a')]][_0x1015aa][_0x0a9e('0x3c')],_0x0a9e('0x8e'));}}}}}}catch(_0x2be526){logger[_0x0a9e('0x37')](_0x0a9e('0x93'),_0x289e65[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2be526,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x18')]=function(_0x88b25f){var _0x2ff265='';try{if(this[_0x0a9e('0x1e')](_0x88b25f)){logger[_0x0a9e('0x23')](_0x0a9e('0x94'),_0x88b25f[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x88b25f,{'showHidden':![],'depth':null}));if(_0x88b25f['channel']){_0x2ff265=_0x88b25f[_0x0a9e('0x95')][_0x0a9e('0x96')](0x0,_0x88b25f[_0x0a9e('0x95')]['lastIndexOf']('-'));if(this[_0x0a9e('0xa')][_0x2ff265]){logger[_0x0a9e('0x20')](_0x0a9e('0x97'),_0x88b25f[_0x0a9e('0x26')],_0x2ff265);this[_0x0a9e('0xa')][_0x2ff265][_0x0a9e('0x98')]=!![];}}}}catch(_0x424f1b){logger[_0x0a9e('0x37')](_0x0a9e('0x99'),_0x88b25f[_0x0a9e('0x26')],util['inspect'](_0x424f1b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x9a')]=function(_0x15a9ed){var _0x3db98f='';try{if(this[_0x0a9e('0x1e')](_0x15a9ed)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x15a9ed[_0x0a9e('0x26')],util['inspect'](_0x15a9ed,{'showHidden':![],'depth':null}));if(_0x15a9ed['channel']){_0x3db98f=_0x15a9ed['channel'][_0x0a9e('0x96')](0x0,_0x15a9ed[_0x0a9e('0x95')][_0x0a9e('0x9b')]('-'));if(this[_0x0a9e('0xa')][_0x3db98f]){logger['info'](_0x0a9e('0x9c'),_0x15a9ed[_0x0a9e('0x26')],_0x3db98f);this[_0x0a9e('0xa')][_0x3db98f][_0x0a9e('0x98')]=![];}}}}catch(_0x2c8d1d){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x15a9ed[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2c8d1d,{'showHidden':![],'depth':null}));}};module[_0x0a9e('0x9d')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index eed75f6..6394d37 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ee=['billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','undefined','isEmpty','getSettings','then','StopMixMonitor','catch','Action','finally','webbar:stopmonitors','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfertargetcalleridnum','origtransfereruniqueid','ATTENDED','some','origtransfererlinkedid','routeid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfereruniqueid','transfererchannel','BLIND','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','ioredis','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','agi','playback','NO\x20ANSWER','FAILED','defaults','redis','localhost','channels','agents','blindTransfers','newexten','syncNewExten','bind','newchannel','syncNewChannel','newstate','syncNewState','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','emit','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','inspect','linkedid','merge','pick','keys','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','user:%s','accountcode','connectedlinenum','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','context','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','duration','seconds','includes','lastapplication','lastdata','cdr(','type','isNil','queue','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','connectedlinename','destinationchannel','UserId','membername','name','holdtime','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','.wav49','replace','.WAV','monitorFilename','find','monitors','push','rec','syncVarSet','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt'];(function(_0x7441ae,_0x1dfd07){var _0x125077=function(_0x2f015d){while(--_0x2f015d){_0x7441ae['push'](_0x7441ae['shift']());}};_0x125077(++_0x1dfd07);}(_0x24ee,0x1af));var _0xe24e=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x24ee[_0x47e549];return _0x251374;};'use strict';var _=require(_0xe24e('0x0'));var moment=require(_0xe24e('0x1'));var util=require('util');var path=require('path');var Redis=require(_0xe24e('0x2'));var config=require('../../../config/environment');var logger=require(_0xe24e('0x3'))(_0xe24e('0x4'));var ami=require(_0xe24e('0x5'));var Channel=require(_0xe24e('0x6'));var RpcSetting=require(_0xe24e('0x7'));var applications=[_0xe24e('0x8'),'queue',_0xe24e('0x9'),'dial',_0xe24e('0xa'),'voicemail'];var dispositions=[_0xe24e('0xb'),_0xe24e('0xc'),'FAILED','NO\x20ANSWER',_0xe24e('0xb'),_0xe24e('0xb'),'ANSWERED','BUSY','FAILED',_0xe24e('0xc'),_0xe24e('0xc')];config['redis']=_[_0xe24e('0xd')](config[_0xe24e('0xe')],{'host':_0xe24e('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x4605ad){this[_0xe24e('0x10')]=_0x4605ad['channels'];this[_0xe24e('0x11')]=_0x4605ad[_0xe24e('0x11')];this[_0xe24e('0x12')]={};ami['on']('coreshowchannel',this['syncNewExten']['bind'](this));ami['on'](_0xe24e('0x13'),this[_0xe24e('0x14')][_0xe24e('0x15')](this));ami['on'](_0xe24e('0x16'),this[_0xe24e('0x17')][_0xe24e('0x15')](this));ami['on'](_0xe24e('0x18'),this[_0xe24e('0x19')]['bind'](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0xe24e('0x1a'),this[_0xe24e('0x1b')]['bind'](this));ami['on'](_0xe24e('0x1c'),this[_0xe24e('0x1d')][_0xe24e('0x15')](this));ami['on'](_0xe24e('0x1e'),this[_0xe24e('0x1f')][_0xe24e('0x15')](this));ami['on']('blindtransfer',this[_0xe24e('0x20')][_0xe24e('0x15')](this));ami['on'](_0xe24e('0x21'),this[_0xe24e('0x22')][_0xe24e('0x15')](this));ami['on'](_0xe24e('0x23'),this[_0xe24e('0x24')][_0xe24e('0x15')](this));try{logger[_0xe24e('0x25')](_0xe24e('0x26'));ami['actionCoreShowChannels']();}catch(_0x49c058){logger[_0xe24e('0x27')](_0xe24e('0x28'),util['inspect'](_0x49c058,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xe24e('0x29')][_0xe24e('0x2a')]=function(_0x471e95){return _0x471e95!==null&&!_[_0xe24e('0x2b')](_0x471e95);};VoiceCallReport[_0xe24e('0x29')][_0xe24e('0x2c')]=function(_0x2fc1b9,_0x100406,_0x3be7bd){io['to'](_0x2fc1b9)[_0xe24e('0x2c')](_0x100406,_0x3be7bd);};VoiceCallReport[_0xe24e('0x29')]['syncNewCallerId']=function(_0x1d771c){try{if(this[_0xe24e('0x2a')](_0x1d771c)){logger[_0xe24e('0x25')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x1d771c[_0xe24e('0x2d')],_0x1d771c[_0xe24e('0x2e')],_0x1d771c[_0xe24e('0x2f')]);logger[_0xe24e('0x30')](_0xe24e('0x31'),_0x1d771c[_0xe24e('0x2d')],util[_0xe24e('0x32')](_0x1d771c,{'showHidden':![],'depth':null}));if(_0x1d771c[_0xe24e('0x2d')]===_0x1d771c[_0xe24e('0x33')]){if(!_[_0xe24e('0x2b')](this['channels'][_0x1d771c['uniqueid']])){_[_0xe24e('0x34')](this[_0xe24e('0x10')][_0x1d771c[_0xe24e('0x2d')]],_[_0xe24e('0x35')](_0x1d771c,_[_0xe24e('0x36')](this[_0xe24e('0x10')][_0x1d771c[_0xe24e('0x2d')]])));}}if(_0x1d771c['context']===_0xe24e('0x37')){if(this[_0xe24e('0x11')][_0x1d771c[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]]){if(_0x1d771c[_0xe24e('0x3a')]==_0xe24e('0x3b')){this['agents'][_0x1d771c[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]][_0xe24e('0x3c')]=_0x1d771c['connectedlinenum'];this['emit'](util['format'](_0xe24e('0x3d'),this[_0xe24e('0x11')][_0x1d771c[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this['agents'][_0x1d771c[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]][_0xe24e('0x3e')],'destconnectedlinenum':_0x1d771c[_0xe24e('0x3f')]});}}}}}catch(_0x27cc9b){logger['error']('[%s][voiceCallReport][newcallerid]',_0x1d771c[_0xe24e('0x2d')],util[_0xe24e('0x32')](_0x27cc9b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe24e('0x29')][_0xe24e('0x17')]=function(_0x10047f){try{if(this[_0xe24e('0x2a')](_0x10047f)){logger[_0xe24e('0x30')]('[%s][voiceCallReport][newchannel]\x20event:',_0x10047f[_0xe24e('0x2d')],util[_0xe24e('0x32')](_0x10047f,{'showHidden':![],'depth':null}));if(this[_0xe24e('0x10')][_0x10047f['uniqueid']])return;if(_0x10047f[_0xe24e('0x38')]===_0xe24e('0x40'))return;if(_0x10047f['uniqueid']!==_0x10047f['linkedid']&&!this[_0xe24e('0x12')][_0x10047f[_0xe24e('0x33')]])return;logger[_0xe24e('0x25')](_0xe24e('0x41'),_0x10047f[_0xe24e('0x2d')],_0x10047f['context'],_0x10047f[_0xe24e('0x3a')]);this[_0xe24e('0x10')][_0x10047f[_0xe24e('0x2d')]]=new Channel();this[_0xe24e('0x10')][_0x10047f[_0xe24e('0x2d')]][_0xe24e('0x42')]=moment()[_0xe24e('0x43')](_0xe24e('0x44'));this['channels'][_0x10047f['uniqueid']][_0xe24e('0x45')]=dispositions[_[_0xe24e('0x46')](_0x10047f[_0xe24e('0x47')])];_[_0xe24e('0x34')](this[_0xe24e('0x10')][_0x10047f[_0xe24e('0x2d')]],_['pick'](_0x10047f,_[_0xe24e('0x36')](this['channels'][_0x10047f[_0xe24e('0x2d')]])));if(_0x10047f[_0xe24e('0x48')]===_0xe24e('0x37')){if(this[_0xe24e('0x11')][_0x10047f['channel']['split']('-')[0x0]]){if(_['isUndefined'](this[_0xe24e('0x11')][_0x10047f[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]][_0xe24e('0x3c')])){this[_0xe24e('0x11')][_0x10047f[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]][_0xe24e('0x3c')]=_0x10047f[_0xe24e('0x3a')];logger[_0xe24e('0x30')](_0xe24e('0x49'),_0x10047f[_0xe24e('0x2d')],util[_0xe24e('0x32')]({'id':this[_0xe24e('0x11')][_0x10047f['channel'][_0xe24e('0x39')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x10047f[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]][_0xe24e('0x3e')],'destconnectedlinenum':_0x10047f['exten']},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xe24e('0x3d'),this['agents'][_0x10047f[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]]['name']),_0xe24e('0x4a'),{'id':this[_0xe24e('0x11')][_0x10047f[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0xe24e('0x11')][_0x10047f[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]][_0xe24e('0x3e')],'destconnectedlinenum':_0x10047f[_0xe24e('0x3a')]});}}}}}catch(_0x371651){logger['error']('[%s][voiceCallReport][newchannel]',_0x10047f[_0xe24e('0x2d')],util['inspect'](_0x371651,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe24e('0x29')][_0xe24e('0x14')]=function(_0x417560){try{if(this[_0xe24e('0x2a')](_0x417560)){logger[_0xe24e('0x30')](_0xe24e('0x4b'),_0x417560[_0xe24e('0x2d')],util[_0xe24e('0x32')](_0x417560,{'showHidden':![],'depth':null}));if(_0x417560['channel']==='OutgoingSpoolFailed'||_0x417560['exten']==='h')return;if(_0x417560[_0xe24e('0x2d')]===_0x417560['linkedid']||this[_0xe24e('0x12')][_0x417560[_0xe24e('0x33')]]){_0x417560['application']=_0x417560[_0xe24e('0x4c')][_0xe24e('0x4d')]();_0x417560[_0xe24e('0x4e')]=_0x417560[_0xe24e('0x4f')]&&_0x417560[_0xe24e('0x4f')][_0xe24e('0x50')](_0xe24e('0x51'))?_0x417560[_0xe24e('0x4f')]:(_0x417560['appdata']||_0x417560[_0xe24e('0x4e')])['toLowerCase']();logger[_0xe24e('0x25')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x417560[_0xe24e('0x2d')],_0x417560[_0xe24e('0x4c')],_0x417560[_0xe24e('0x4e')]);if(_[_0xe24e('0x2b')](this[_0xe24e('0x10')][_0x417560[_0xe24e('0x2d')]])){this[_0xe24e('0x10')][_0x417560['uniqueid']]=new Channel();this[_0xe24e('0x10')][_0x417560[_0xe24e('0x2d')]][_0xe24e('0x42')]=_0x417560[_0xe24e('0x52')]?moment()['subtract'](moment[_0xe24e('0x52')](_0x417560[_0xe24e('0x52')])[_0xe24e('0x53')](),_0xe24e('0x53'))[_0xe24e('0x43')](_0xe24e('0x44')):moment()[_0xe24e('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe24e('0x10')][_0x417560[_0xe24e('0x2d')]][_0xe24e('0x45')]=_0xe24e('0xb');}_['merge'](this[_0xe24e('0x10')][_0x417560[_0xe24e('0x2d')]],_[_0xe24e('0x35')](_0x417560,_[_0xe24e('0x36')](this[_0xe24e('0x10')][_0x417560[_0xe24e('0x2d')]])));if(_[_0xe24e('0x54')](applications,_0x417560[_0xe24e('0x4c')])){this[_0xe24e('0x10')][_0x417560['uniqueid']][_0xe24e('0x55')]=_0x417560['application'];this[_0xe24e('0x10')][_0x417560[_0xe24e('0x2d')]][_0xe24e('0x56')]=_0x417560[_0xe24e('0x4e')];if(_0x417560[_0xe24e('0x4c')]==='set'&&_[_0xe24e('0x50')](_0x417560['applicationdata']['toLowerCase'](),_0xe24e('0x57'))){var _0x146e6d=_0x417560[_0xe24e('0x4e')][_0xe24e('0x39')]('=');var _0x5c7298=_0x146e6d[0x0][_0xe24e('0x4d')]()['match'](/cdr\((.*)\)/);if(_0x5c7298){if(_0x5c7298[0x1]===_0xe24e('0x58')&&!_[_0xe24e('0x59')](this[_0xe24e('0x10')][_0x417560['uniqueid']][_0x5c7298[0x1]]))return;this[_0xe24e('0x10')][_0x417560[_0xe24e('0x2d')]][_0x5c7298[0x1]]=_0x146e6d[0x1];}}else if(_0x417560[_0xe24e('0x4c')]===_0xe24e('0x5a')){this[_0xe24e('0x10')][_0x417560[_0xe24e('0x2d')]][_0xe24e('0x5a')]=_0x417560['applicationdata'][_0xe24e('0x39')](',')[0x0];}}}}}catch(_0x2a76ac){logger[_0xe24e('0x27')](_0xe24e('0x5b'),_0x417560[_0xe24e('0x2d')],util[_0xe24e('0x32')](_0x2a76ac,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xe24e('0x19')]=function(_0x1b6b96){try{if(this[_0xe24e('0x2a')](_0x1b6b96)){logger[_0xe24e('0x25')](_0xe24e('0x5c'),_0x1b6b96[_0xe24e('0x2d')],_0x1b6b96['linkedid'],_0x1b6b96['calleridname'],_0x1b6b96['calleridnum']);logger['debug'](_0xe24e('0x5d'),_0x1b6b96[_0xe24e('0x2d')],util['inspect'](_0x1b6b96,{'showHidden':![],'depth':null}));if(_0x1b6b96[_0xe24e('0x47')]!=='6')return;if(_0x1b6b96[_0xe24e('0x2d')]!==_0x1b6b96['linkedid']){var _0x14b40a=moment();if(this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x33')]]){if(!this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x33')]][_0xe24e('0x5e')]){this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x33')]][_0xe24e('0x5e')]=!![];this[_0xe24e('0x10')][_0x1b6b96['linkedid']][_0xe24e('0x5f')]=_0x14b40a[_0xe24e('0x43')](_0xe24e('0x44'));if(this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x33')]][_0xe24e('0x42')]){this[_0xe24e('0x10')][_0x1b6b96['linkedid']]['holdtime']=_0x14b40a[_0xe24e('0x60')](this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x33')]]['starttime'],'seconds');}}this['channels'][_0x1b6b96[_0xe24e('0x33')]]['linkedid']=_0x1b6b96[_0xe24e('0x2d')];if(_0x1b6b96[_0xe24e('0x2f')]!==_0xe24e('0x3b')){this['channels'][_0x1b6b96[_0xe24e('0x33')]][_0xe24e('0x3f')]=_0x1b6b96[_0xe24e('0x2f')];}this['channels'][_0x1b6b96[_0xe24e('0x33')]][_0xe24e('0x61')]=_0x1b6b96[_0xe24e('0x2e')];this['channels'][_0x1b6b96[_0xe24e('0x33')]][_0xe24e('0x62')]=_0x1b6b96[_0xe24e('0x38')];this['channels'][_0x1b6b96[_0xe24e('0x33')]]['disposition']=dispositions[_[_0xe24e('0x46')](_0x1b6b96['channelstate'])];if(this[_0xe24e('0x11')][_0x1b6b96['channel']['split']('-')[0x0]]){this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x33')]][_0xe24e('0x63')]=this['agents'][_0x1b6b96[_0xe24e('0x38')]['split']('-')[0x0]]['id'];this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x33')]][_0xe24e('0x64')]=this[_0xe24e('0x11')][_0x1b6b96[_0xe24e('0x38')]['split']('-')[0x0]][_0xe24e('0x65')];}}if(this['channels'][_0x1b6b96['uniqueid']]){if(!this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x2d')]][_0xe24e('0x5e')]){this['channels'][_0x1b6b96['uniqueid']]['answered']=!![];this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x2d')]]['answertime']=_0x14b40a[_0xe24e('0x43')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x2d')]][_0xe24e('0x42')]){this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x2d')]][_0xe24e('0x66')]=_0x14b40a['diff'](this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x2d')]][_0xe24e('0x42')],'seconds');}}if(_0x1b6b96[_0xe24e('0x2f')]!==_0xe24e('0x3b')){this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x2d')]][_0xe24e('0x3f')]=_0x1b6b96[_0xe24e('0x2f')];}this['channels'][_0x1b6b96[_0xe24e('0x2d')]][_0xe24e('0x61')]=_0x1b6b96[_0xe24e('0x2e')];this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x2d')]][_0xe24e('0x62')]=_0x1b6b96[_0xe24e('0x38')];this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x2d')]][_0xe24e('0x45')]=dispositions[_[_0xe24e('0x46')](_0x1b6b96['channelstate'])];}}else{if(this['channels'][_0x1b6b96[_0xe24e('0x2d')]]){if(this[_0xe24e('0x11')][_0x1b6b96[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]]){this[_0xe24e('0x10')][_0x1b6b96['uniqueid']][_0xe24e('0x63')]=this[_0xe24e('0x11')][_0x1b6b96[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]]['id'];this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x2d')]]['membername']=this['agents'][_0x1b6b96['channel']['split']('-')[0x0]][_0xe24e('0x65')];}}}if(_0x1b6b96[_0xe24e('0x48')]===_0xe24e('0x37')){if(this['agents'][_0x1b6b96[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]]){this['agents'][_0x1b6b96[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]][_0xe24e('0x3c')]=_0x1b6b96[_0xe24e('0x3a')];var _0x56eeb0,_0x1cefe0;if(this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x2d')]]){_0x56eeb0=this['channels'][_0x1b6b96[_0xe24e('0x2d')]]['routealias'];_0x1cefe0=this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x2d')]][_0xe24e('0x5a')];}else if(this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x33')]]){_0x56eeb0=this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x33')]][_0xe24e('0x67')];_0x1cefe0=this[_0xe24e('0x10')][_0x1b6b96[_0xe24e('0x33')]][_0xe24e('0x5a')];}logger[_0xe24e('0x30')](_0xe24e('0x68'),_0x1b6b96[_0xe24e('0x2d')],util[_0xe24e('0x32')]({'id':this['agents'][_0x1b6b96[_0xe24e('0x38')]['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x1b6b96['channel']['split']('-')[0x0]][_0xe24e('0x3e')],'destconnectedlinenum':_0x1b6b96['exten'],'routealias':_0x56eeb0,'queue':_0x1cefe0||undefined},{'showHidden':![],'depth':null}));this[_0xe24e('0x2c')](util[_0xe24e('0x43')]('user:%s',this[_0xe24e('0x11')][_0x1b6b96['channel'][_0xe24e('0x39')]('-')[0x0]][_0xe24e('0x65')]),_0xe24e('0x4a'),{'id':this[_0xe24e('0x11')][_0x1b6b96[_0xe24e('0x38')]['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xe24e('0x11')][_0x1b6b96[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]][_0xe24e('0x3e')],'destconnectedlinenum':_0x1b6b96[_0xe24e('0x3a')],'routealias':_0x56eeb0,'queue':_0x1cefe0||undefined});}}}}catch(_0x32db46){logger[_0xe24e('0x27')](_0xe24e('0x69'),_0x1b6b96[_0xe24e('0x2d')],util['inspect'](_0x32db46,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xe24e('0x6a')]=function(_0x1a8753,_0x30b697){try{if(this[_0xe24e('0x10')][_0x1a8753]){logger[_0xe24e('0x25')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x1a8753,_0x30b697);this[_0xe24e('0x10')][_0x1a8753][_0xe24e('0x6b')]=!![];if(_['endsWith'](_0x30b697,_0xe24e('0x6c'))){_0x30b697=_0x30b697[_0xe24e('0x6d')](_0xe24e('0x6c'),_0xe24e('0x6e'));}this['channels'][_0x1a8753][_0xe24e('0x6f')]=_0x30b697;var _0x16894f=_[_0xe24e('0x70')](this[_0xe24e('0x10')][_0x1a8753][_0xe24e('0x71')],{'filename':_0x30b697});if(_[_0xe24e('0x59')](_0x16894f)){this['channels'][_0x1a8753]['monitors'][_0xe24e('0x72')]({'filename':_0x30b697,'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xe24e('0x73')});}}}catch(_0x4d3d69){logger[_0xe24e('0x27')]('[%s][voiceCallReport][mixMonitorFilename]',_0x1a8753,util[_0xe24e('0x32')](_0x4d3d69,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe24e('0x29')][_0xe24e('0x74')]=function(_0x257a19){try{if(this[_0xe24e('0x2a')](_0x257a19)){logger[_0xe24e('0x30')]('[%s][voiceCallReport][varset]\x20event:',_0x257a19[_0xe24e('0x2d')],util['inspect'](_0x257a19,{'showHidden':![],'depth':null}));if(this[_0xe24e('0x10')][_0x257a19[_0xe24e('0x2d')]]&&_0x257a19[_0xe24e('0x38')]!=_0xe24e('0x40')){if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')])){if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')][_0xe24e('0x76')])){logger['info'](_0xe24e('0x77'),_0x257a19[_0xe24e('0x2d')],_0x257a19[_0xe24e('0x78')]);this[_0xe24e('0x6a')](_0x257a19[_0xe24e('0x2d')],_0x257a19[_0xe24e('0x78')]);}else if(this['isNotNull'](_0x257a19[_0xe24e('0x75')][_0xe24e('0x79')])){logger[_0xe24e('0x25')](_0xe24e('0x7a'),_0x257a19[_0xe24e('0x2d')],_0x257a19[_0xe24e('0x78')]);this[_0xe24e('0x10')][_0x257a19[_0xe24e('0x2d')]]['calleridnum']=_0x257a19[_0xe24e('0x78')];}else if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')]['xmd-callerid'])){logger[_0xe24e('0x25')](_0xe24e('0x7b'),_0x257a19['uniqueid'],_0x257a19['value']);this[_0xe24e('0x10')][_0x257a19[_0xe24e('0x2d')]]['callerid']=_0x257a19[_0xe24e('0x78')];}else if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')][_0xe24e('0x7c')])){logger[_0xe24e('0x25')](_0xe24e('0x7d'),_0x257a19['uniqueid'],_0x257a19[_0xe24e('0x78')]);this[_0xe24e('0x10')][_0x257a19[_0xe24e('0x2d')]][_0xe24e('0x58')]=_0x257a19[_0xe24e('0x78')];}else if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')][_0xe24e('0x7e')])){logger[_0xe24e('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x257a19[_0xe24e('0x2d')],_0x257a19['value'][_0xe24e('0x39')](',')[0x0]);this[_0xe24e('0x10')][_0x257a19['uniqueid']]['queue']=_0x257a19['value'][_0xe24e('0x39')](',')[0x0];}else if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')][_0xe24e('0x7f')])){logger['info'](_0xe24e('0x80'),_0x257a19[_0xe24e('0x2d')],_0x257a19['value']);this[_0xe24e('0x10')][_0x257a19[_0xe24e('0x2d')]][_0xe24e('0x81')]=_0x257a19[_0xe24e('0x78')];}else if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')][_0xe24e('0x82')])){logger['info'](_0xe24e('0x83'),_0x257a19['uniqueid'],_0x257a19[_0xe24e('0x78')]);this[_0xe24e('0x10')][_0x257a19[_0xe24e('0x2d')]][_0xe24e('0x84')]=_0x257a19[_0xe24e('0x78')];}else if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')][_0xe24e('0x85')])){logger[_0xe24e('0x25')](_0xe24e('0x86'),_0x257a19[_0xe24e('0x2d')],_0x257a19['value']);this['channels'][_0x257a19[_0xe24e('0x2d')]]['calleridpreview']=_0x257a19[_0xe24e('0x78')];}else if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')][_0xe24e('0x87')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x257a19[_0xe24e('0x2d')],_0x257a19[_0xe24e('0x78')]);this[_0xe24e('0x10')][_0x257a19[_0xe24e('0x2d')]]['queue']=_0x257a19[_0xe24e('0x78')];}else if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')][_0xe24e('0x88')])){logger['info'](_0xe24e('0x89'),_0x257a19['uniqueid'],_0x257a19[_0xe24e('0x78')]);this[_0xe24e('0x10')][_0x257a19[_0xe24e('0x2d')]][_0xe24e('0x8a')]=_0x257a19[_0xe24e('0x78')];}}}else if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')]['mixmonitor_filename'])){if(_0x257a19[_0xe24e('0x78')]){var _0x2eb35d=path[_0xe24e('0x8b')](_0x257a19[_0xe24e('0x78')])[_0xe24e('0x65')];logger['info'](_0xe24e('0x77'),_0x2eb35d,_0x257a19[_0xe24e('0x78')]);this[_0xe24e('0x6a')](_0x2eb35d,_0x257a19[_0xe24e('0x78')]);}}else if(this[_0xe24e('0x10')][_0x257a19[_0xe24e('0x33')]]){if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')])){if(this[_0xe24e('0x2a')](_0x257a19[_0xe24e('0x75')][_0xe24e('0x88')])){logger[_0xe24e('0x25')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x257a19[_0xe24e('0x33')],_0x257a19[_0xe24e('0x78')]);this[_0xe24e('0x10')][_0x257a19[_0xe24e('0x33')]][_0xe24e('0x8c')]=_0x257a19[_0xe24e('0x78')];}}}}}catch(_0x15db69){logger[_0xe24e('0x27')](_0xe24e('0x8d'),_0x257a19[_0xe24e('0x2d')],util[_0xe24e('0x32')](_0x15db69,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe24e('0x29')][_0xe24e('0x1b')]=function(_0x34253e){try{if(this['isNotNull'](_0x34253e)){logger[_0xe24e('0x30')](_0xe24e('0x8e'),_0x34253e['uniqueid'],util['inspect'](_0x34253e,{'showHidden':![],'depth':null}));if(this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]]){if(this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e['linkedid']][_0xe24e('0x33')]]){this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e['linkedid']]['linkedid']][_0xe24e('0x2d')]=_0x34253e[_0xe24e('0x2d')];this['channels'][this['blindTransfers'][_0x34253e[_0xe24e('0x33')]]['linkedid']][_0xe24e('0x5e')]=this[_0xe24e('0x10')][_0x34253e[_0xe24e('0x2d')]][_0xe24e('0x5e')];this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]][_0xe24e('0x33')]][_0xe24e('0x5f')]=this['channels'][_0x34253e[_0xe24e('0x2d')]][_0xe24e('0x5f')];this['channels'][this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]][_0xe24e('0x33')]]['destinationchannel']=this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e['linkedid']][_0xe24e('0x33')]][_0xe24e('0x38')];this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]]['linkedid']][_0xe24e('0x45')]=this['channels'][_0x34253e['uniqueid']][_0xe24e('0x45')];this[_0xe24e('0x10')][_0x34253e['uniqueid']]=this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]][_0xe24e('0x33')]];delete this['channels'][this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]][_0xe24e('0x33')]];}else if(this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]][_0xe24e('0x2d')]]){this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]][_0xe24e('0x2d')]]['uniqueid']=[this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e['linkedid']][_0xe24e('0x2d')]][_0xe24e('0x33')],this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]][_0xe24e('0x2d')]][_0xe24e('0x33')]=this['channels'][this['blindTransfers'][_0x34253e['linkedid']][_0xe24e('0x2d')]]['uniqueid']][0x0];this['channels'][this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]][_0xe24e('0x2d')]][_0xe24e('0x5e')]=this[_0xe24e('0x10')][_0x34253e[_0xe24e('0x2d')]][_0xe24e('0x5e')];this['channels'][this['blindTransfers'][_0x34253e[_0xe24e('0x33')]]['uniqueid']][_0xe24e('0x5f')]=this[_0xe24e('0x10')][_0x34253e[_0xe24e('0x2d')]][_0xe24e('0x5f')];this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]]['uniqueid']]['destinationchannel']=this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]]['uniqueid']][_0xe24e('0x38')];this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e['linkedid']][_0xe24e('0x2d')]][_0xe24e('0x45')]=this['channels'][_0x34253e[_0xe24e('0x2d')]][_0xe24e('0x45')];this['channels'][_0x34253e[_0xe24e('0x2d')]]=this[_0xe24e('0x10')][this['blindTransfers'][_0x34253e[_0xe24e('0x33')]][_0xe24e('0x2d')]];delete this[_0xe24e('0x10')][this[_0xe24e('0x12')][_0x34253e[_0xe24e('0x33')]]['uniqueid']];}}if(this[_0xe24e('0x10')][_0x34253e[_0xe24e('0x2d')]]){logger['info'](_0xe24e('0x8f'),_0x34253e[_0xe24e('0x2d')],_0x34253e[_0xe24e('0x90')]);var _0x56a1d4=moment();this[_0xe24e('0x10')][_0x34253e[_0xe24e('0x2d')]]['endtime']=_0x56a1d4[_0xe24e('0x43')](_0xe24e('0x44'));this[_0xe24e('0x10')][_0x34253e[_0xe24e('0x2d')]]['duration']=_0x56a1d4[_0xe24e('0x60')](this['channels'][_0x34253e[_0xe24e('0x2d')]][_0xe24e('0x42')],_0xe24e('0x53'));if(this[_0xe24e('0x10')][_0x34253e[_0xe24e('0x2d')]]['answered']){this[_0xe24e('0x10')][_0x34253e[_0xe24e('0x2d')]][_0xe24e('0x91')]=_0x56a1d4[_0xe24e('0x60')](this[_0xe24e('0x10')][_0x34253e[_0xe24e('0x2d')]][_0xe24e('0x5f')],_0xe24e('0x53'));this[_0xe24e('0x10')][_0x34253e[_0xe24e('0x2d')]][_0xe24e('0x66')]=this[_0xe24e('0x10')][_0x34253e[_0xe24e('0x2d')]][_0xe24e('0x52')]-this['channels'][_0x34253e[_0xe24e('0x2d')]][_0xe24e('0x91')];}if(_0x34253e[_0xe24e('0x48')]===_0xe24e('0x37')){if(this[_0xe24e('0x11')][_0x34253e[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]]){this[_0xe24e('0x11')][_0x34253e[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]]=_[_0xe24e('0x92')](this[_0xe24e('0x11')][_0x34253e[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]],[_0xe24e('0x3c')]);logger['debug'](_0xe24e('0x93'),_0x34253e[_0xe24e('0x2d')],util[_0xe24e('0x32')]({'id':this['agents'][_0x34253e[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x34253e['channel'][_0xe24e('0x39')]('-')[0x0]][_0xe24e('0x3e')]},{'showHidden':![],'depth':null}));this[_0xe24e('0x2c')](util[_0xe24e('0x43')](_0xe24e('0x3d'),this[_0xe24e('0x11')][_0x34253e[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]][_0xe24e('0x65')]),_0xe24e('0x94'),{'id':this[_0xe24e('0x11')][_0x34253e[_0xe24e('0x38')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xe24e('0x11')][_0x34253e[_0xe24e('0x38')][_0xe24e('0x39')]('-')[0x0]][_0xe24e('0x3e')]});for(var _0x3cebf3=0x0;_0x3cebf30x0?_0x66f9bf:0x0;this[_0x830e('0xe')][_0x47c4f7[_0x830e('0x65')]][_0x830e('0x29')]=this[_0x830e('0xe')][_0x47c4f7[_0x830e('0x65')]][_0x830e('0x29')]>_[_0x830e('0x6a')](_0x47c4f7[_0x830e('0x6b')])?_[_0x830e('0x6a')](_0x47c4f7[_0x830e('0x6b')]):this[_0x830e('0xe')][_0x47c4f7[_0x830e('0x65')]][_0x830e('0x29')];this[_0x830e('0x50')](this[_0x830e('0xe')][_0x47c4f7['queue']],_0x830e('0x11'));}logger['debug'](_0x830e('0x6c'),util['inspect'](this[_0x830e('0xe')][_0x47c4f7[_0x830e('0x65')]],{'showHidden':![],'depth':null}));ami[_0x830e('0x40')](_0x830e('0x6d'),this['voiceQueues'][_0x47c4f7['queue']]);}}}catch(_0x3914d6){logger['error'](_0x830e('0x63'),util[_0x830e('0x39')](_0x3914d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x830e('0x2e')][_0x830e('0x14')]=function(_0x802ac7){logger['debug'](_0x830e('0x6e'),util[_0x830e('0x39')](_0x802ac7,{'showHidden':![],'depth':null}));this[_0x830e('0xf')]=!![];};VoiceQueueReport[_0x830e('0x2e')][_0x830e('0x16')]=function(_0x37f000){try{if(this[_0x830e('0x64')](_0x37f000)){logger[_0x830e('0x42')](_0x830e('0x6f'),_0x37f000[_0x830e('0x45')],util['inspect'](_0x37f000,{'showHidden':![],'depth':null}));if(_[_0x830e('0x60')](this['queueReports'][_0x37f000[_0x830e('0x45')]]))this['queueReports'][_0x37f000[_0x830e('0x45')]]=[];if(_[_0x830e('0x60')](this['channels'][_0x37f000[_0x830e('0x45')]]))this[_0x830e('0xd')][_0x37f000['uniqueid']]={};var _0x1b674f=new QueueReport();_0x1b674f[_0x830e('0x47')]=_0x37f000[_0x830e('0x65')];_0x1b674f['type']=this[_0x830e('0xe')][_0x1b674f[_0x830e('0x47')]]&&this['voiceQueues'][_0x1b674f[_0x830e('0x47')]][_0x830e('0x51')]?this[_0x830e('0xe')][_0x1b674f[_0x830e('0x47')]][_0x830e('0x51')]||_0x830e('0x70'):'inbound';_0x1b674f[_0x830e('0x65')]=_0x37f000['queue'];_0x1b674f[_0x830e('0x71')]=moment()[_0x830e('0x46')](_0x830e('0x72'));_0x1b674f[_0x830e('0x73')]=_0x37f000[_0x830e('0x73')];_0x1b674f[_0x830e('0x74')]=_0x37f000[_0x830e('0x74')];_0x1b674f[_0x830e('0x45')]=_0x37f000['uniqueid'];_0x1b674f['routealias']=this[_0x830e('0xd')][_0x37f000[_0x830e('0x45')]][_0x830e('0x75')];logger[_0x830e('0x67')](_0x830e('0x76'),_0x1b674f[_0x830e('0x47')],_0x1b674f[_0x830e('0x51')]);_[_0x830e('0x77')](_0x1b674f,_[_0x830e('0x78')](_0x37f000,_['keys'](_0x1b674f)));this['queueReports'][_0x37f000['uniqueid']][_0x830e('0x79')](_0x1b674f);this[_0x830e('0xd')][_0x37f000[_0x830e('0x45')]]=_0x1b674f;this['emitVoiceQueueChannelSave'](_0x1b674f,'queuecallerjoin');}}catch(_0x293df4){logger[_0x830e('0x3a')]('[%s][voiceQueueReport][queuecallerjoin]',_0x37f000['uniqueid'],util['inspect'](_0x293df4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x830e('0x2e')][_0x830e('0x18')]=function(_0x280751){try{if(this[_0x830e('0x64')](_0x280751)){logger[_0x830e('0x42')](_0x830e('0x7a'),_0x280751[_0x830e('0x45')],util[_0x830e('0x39')](_0x280751,{'showHidden':![],'depth':null}));if(this[_0x830e('0xb')][_0x280751[_0x830e('0x45')]]){var _0x15ca48=_['last'](this[_0x830e('0xb')][_0x280751[_0x830e('0x45')]]);_0x15ca48[_0x830e('0x7b')]=![];_0x15ca48[_0x830e('0x7c')]=null;_0x15ca48[_0x830e('0x7d')]=_0x280751['holdtime'];_0x15ca48['originalposition']=_0x280751[_0x830e('0x7e')];_0x15ca48[_0x830e('0x17')]=!![];_0x15ca48[_0x830e('0x7f')]=moment()['format'](_0x830e('0x72'));_0x15ca48['queuecallerexitreason']=_0x830e('0x80');_0x15ca48[_0x830e('0x81')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x15ca48[_0x830e('0x47')],_0x15ca48[_0x830e('0x51')]);this[_0x830e('0xd')][_0x280751[_0x830e('0x45')]]=_0x15ca48;this[_0x830e('0x3e')](_0x15ca48,_0x830e('0x17'));}}}catch(_0x4f81e2){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x280751[_0x830e('0x45')],util[_0x830e('0x39')](_0x4f81e2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x830e('0x2e')]['syncQueueCallerLeave']=function(_0x2f16b5){try{if(this['isNotNull'](_0x2f16b5)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x2f16b5['uniqueid'],util[_0x830e('0x39')](_0x2f16b5,{'showHidden':![],'depth':null}));if(this[_0x830e('0xb')][_0x2f16b5[_0x830e('0x45')]]){var _0x38a6e4=_['last'](this[_0x830e('0xb')][_0x2f16b5['uniqueid']]);_0x38a6e4[_0x830e('0x82')]=moment()[_0x830e('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x38a6e4['connectedlinenum']=_0x2f16b5[_0x830e('0x83')];_0x38a6e4['connectedlinename']=_0x2f16b5[_0x830e('0x84')];logger[_0x830e('0x67')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x38a6e4[_0x830e('0x47')],_0x38a6e4[_0x830e('0x51')],_0x2f16b5['connectedlinenum'],_0x2f16b5[_0x830e('0x84')]);this[_0x830e('0xd')][_0x2f16b5['uniqueid']]=_0x38a6e4;this[_0x830e('0x41')](_0x38a6e4,_0x830e('0x85'));}}}catch(_0x2d34ad){logger[_0x830e('0x3a')](_0x830e('0x86'),_0x2f16b5[_0x830e('0x45')],util[_0x830e('0x39')](_0x2d34ad,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x830e('0x2e')][_0x830e('0x1b')]=function(_0x243fe0){try{if(this[_0x830e('0x64')](_0x243fe0)){logger[_0x830e('0x42')](_0x830e('0x87'),_0x243fe0[_0x830e('0x45')],util[_0x830e('0x39')](_0x243fe0,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x243fe0[_0x830e('0x45')]]){var _0x585e0f=_['last'](this[_0x830e('0xb')][_0x243fe0[_0x830e('0x45')]]);_0x585e0f[_0x830e('0x7b')]=!![];_0x585e0f[_0x830e('0x4b')]=_0x830e('0x88');logger[_0x830e('0x67')](_0x830e('0x89'),_0x585e0f[_0x830e('0x47')],_0x585e0f['type']);}}}catch(_0x41329a){logger[_0x830e('0x3a')](_0x830e('0x87'),_0x243fe0[_0x830e('0x45')],util[_0x830e('0x39')](_0x41329a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x830e('0x2e')][_0x830e('0x8a')]=function(_0x5e3eab){try{if(this['isNotNull'](_0x5e3eab)){logger['debug'](_0x830e('0x8b'),_0x5e3eab[_0x830e('0x45')],util[_0x830e('0x39')](_0x5e3eab,{'showHidden':![],'depth':null}));if(this[_0x830e('0xb')][_0x5e3eab[_0x830e('0x45')]]){var _0x249983=_[_0x830e('0x8c')](this[_0x830e('0xb')][_0x5e3eab['uniqueid']]);_0x249983['queuecallerabandon']=![];_0x249983['queuecallerabandonAt']=null;_0x249983[_0x830e('0x8d')]=!![];_0x249983[_0x830e('0x81')]=_0x5e3eab[_0x830e('0x8e')];_0x249983[_0x830e('0x7d')]=_0x5e3eab[_0x830e('0x7d')];_0x249983['queuecallercomplete']=!![];_0x249983[_0x830e('0x8f')]=![];_0x249983['queuecallerexitAt']=null;if(!_0x249983['transfer']){if(_0x5e3eab[_0x830e('0x90')]==_0x830e('0x91')){_0x249983[_0x830e('0x4b')]=_0x830e('0x92');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x249983[_0x830e('0x47')],_0x249983[_0x830e('0x51')]);}else{if(_[_0x830e('0x93')](_0x5e3eab[_0x830e('0x34')]['toLowerCase'](),_0x830e('0x94'))){if(this[_0x830e('0xb')][_0x5e3eab['linkedid']]){var _0x2b9c55=_['last'](this[_0x830e('0xb')][_0x5e3eab['linkedid']]);_0x2b9c55[_0x830e('0x7b')]=![];_0x2b9c55[_0x830e('0x8f')]=!![];_0x2b9c55[_0x830e('0x95')]=moment(_0x249983[_0x830e('0x71')])[_0x830e('0x96')](_0x5e3eab[_0x830e('0x7d')],_0x830e('0x97'))[_0x830e('0x46')](_0x830e('0x72'));_0x2b9c55[_0x830e('0x4b')]=_0x830e('0x98');_0x2b9c55[_0x830e('0x91')]=!![];_0x2b9c55[_0x830e('0x99')]='FORWARD';_0x2b9c55['transferexten']=_0x5e3eab['destexten'];_0x2b9c55[_0x830e('0x9a')]=_0x5e3eab[_0x830e('0x45')];logger[_0x830e('0x67')](_0x830e('0x9b'),_0x2b9c55[_0x830e('0x47')],_0x2b9c55[_0x830e('0x51')]);var _0x3b7287=this['queueReports'][_0x5e3eab['linkedid']];this[_0x830e('0xb')][_0x5e3eab[_0x830e('0x9c')]]=this[_0x830e('0xb')][_0x5e3eab[_0x830e('0x45')]];this['queueReports'][_0x5e3eab[_0x830e('0x45')]]=_0x3b7287;}}else{_0x249983[_0x830e('0x4b')]=_0x830e('0x9d')+_0x5e3eab['reason'][_0x830e('0x9e')]();logger[_0x830e('0x67')](_0x830e('0x9f'),_0x249983[_0x830e('0x47')],_0x249983[_0x830e('0x51')],_0x249983['queuecallerexitreason']);}}}this[_0x830e('0xd')][_0x5e3eab[_0x830e('0x45')]]=_0x249983;this[_0x830e('0x3e')](_0x249983,_0x830e('0xa0'));}}}catch(_0x5d8da0){logger[_0x830e('0x3a')]('[%s][voiceQueueReport][agentcomplete]',_0x5e3eab[_0x830e('0x45')],util[_0x830e('0x39')](_0x5d8da0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x830e('0x2e')][_0x830e('0xa1')]=function(_0x5dd048){try{if(this[_0x830e('0x64')](_0x5dd048)){logger[_0x830e('0x42')](_0x830e('0xa2'),_0x5dd048[_0x830e('0x45')],util[_0x830e('0x39')](_0x5dd048,{'showHidden':![],'depth':null}));this['addVariable'](_0x5dd048[_0x830e('0x45')],_[_0x830e('0xa3')](_0x5dd048[_0x830e('0xa4')])[0x0],_0x5dd048[_0x830e('0xa5')]);if(this[_0x830e('0xb')][_0x5dd048[_0x830e('0x45')]]){var _0x5be8e9=_[_0x830e('0x8c')](this[_0x830e('0xb')][_0x5dd048['uniqueid']]);if(_0x5be8e9){if(this[_0x830e('0x64')](_0x5dd048[_0x830e('0xa4')])&&this['isNotNull'](_0x5dd048[_0x830e('0xa4')][_0x830e('0xa6')])){switch(_0x5dd048['value']){case _0x830e('0xa7'):_0x5be8e9[_0x830e('0x8f')]=![];_0x5be8e9[_0x830e('0x95')]=null;break;case _0x830e('0xa8'):_0x5be8e9['lastevent']='timeout';_0x5be8e9['queuecallerexit']=!![];_0x5be8e9[_0x830e('0x95')]=moment()['format'](_0x830e('0x72'));_0x5be8e9['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x830e('0x42')](_0x830e('0xa9'),_0x5dd048[_0x830e('0x45')],util[_0x830e('0x39')](_0x5be8e9,{'showHidden':![],'depth':null}));ami[_0x830e('0x40')](_0x830e('0xaa'),_0x5be8e9);break;default:_0x5be8e9['queuecallerexit']=!![];_0x5be8e9[_0x830e('0x95')]=moment()[_0x830e('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x5be8e9['queuecallerleaveAt']=moment()['format'](_0x830e('0x72'));}_0x5be8e9['queuecallerabandon']=![];_0x5be8e9[_0x830e('0x7f')]=null;_0x5be8e9['queuecallerexitreason']=_0x5dd048[_0x830e('0xa5')];this[_0x830e('0xd')][_0x5dd048[_0x830e('0x45')]]=_0x5be8e9;this[_0x830e('0x3e')](_0x5be8e9,_0x830e('0xab'));}else if(this['isNotNull'](_0x5dd048['variable'])&&this[_0x830e('0x64')](_0x5dd048[_0x830e('0xa4')]['queueposition'])){if(!_0x5be8e9[_0x830e('0x17')]){_0x5be8e9[_0x830e('0x8f')]=!![];_0x5be8e9['queuecallerexitAt']=moment()[_0x830e('0x46')](_0x830e('0x72'));_0x5be8e9[_0x830e('0x4b')]=_0x830e('0xac');_0x5be8e9['queuecallerleaveAt']=moment()[_0x830e('0x46')](_0x830e('0x72'));this[_0x830e('0xd')][_0x5dd048[_0x830e('0x45')]]=_0x5be8e9;}}logger[_0x830e('0x67')](_0x830e('0xad'),_0x5dd048[_0x830e('0x45')],_0x5be8e9[_0x830e('0x47')],_0x5be8e9[_0x830e('0x51')],_[_0x830e('0xa3')](_0x5dd048[_0x830e('0xa4')])[0x0],_0x5dd048['value']);_0x5be8e9['variables']=this[_0x830e('0xae')][_0x5dd048['uniqueid']];}}}}catch(_0x4ee159){logger[_0x830e('0x3a')](_0x830e('0xa2'),_0x5dd048[_0x830e('0x45')],util[_0x830e('0x39')](_0x4ee159,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x830e('0x2e')][_0x830e('0xaf')]=function(_0x1684d8,_0x560944,_0x1992d3){var _0x3adbea=[_0x830e('0xb0'),_0x830e('0xb1'),_0x830e('0xb2'),_0x830e('0xb3'),_0x830e('0xb4'),_0x830e('0xb5'),'rtpaudioqosrtt',_0x830e('0xb6'),_0x830e('0xb7'),_0x830e('0xb8'),_0x830e('0xb9'),_0x830e('0xba'),_0x830e('0xbb'),_0x830e('0xbc'),_0x830e('0xbd'),_0x830e('0xbe'),_0x830e('0x8e'),'memberpenalty','memberrealtime'];if(!_[_0x830e('0x32')](_0x560944)&&!_['includes'](_0x3adbea,_0x560944)){if(_[_0x830e('0x60')](this[_0x830e('0xae')][_0x1684d8])){this[_0x830e('0xae')][_0x1684d8]={};}this['variables'][_0x1684d8][_0x560944]=_0x1992d3;}};VoiceQueueReport[_0x830e('0x2e')][_0x830e('0xbf')]=function(_0x415e01){try{if(this[_0x830e('0x64')](_0x415e01)){logger[_0x830e('0x42')](_0x830e('0xc0'),_0x415e01[_0x830e('0x45')],util[_0x830e('0x39')](_0x415e01,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x415e01[_0x830e('0x45')]]){for(var _0x52d36c=0x0,_0x95c42f={};_0x52d36c0x0?_0x54e8f4:0x0;this[_0x70da('0x3f')][_0x54809e[_0x70da('0x6a')]][_0x70da('0x56')]=this[_0x70da('0x3f')][_0x54809e['queue']][_0x70da('0x56')]>_[_0x70da('0x6f')](_0x54809e[_0x70da('0x70')])?_[_0x70da('0x6f')](_0x54809e[_0x70da('0x70')]):this[_0x70da('0x3f')][_0x54809e[_0x70da('0x6a')]]['talking'];this['emitVoiceQueueSummary'](this[_0x70da('0x3f')][_0x54809e[_0x70da('0x6a')]],_0x70da('0x67'));}logger[_0x70da('0x42')](_0x70da('0x71'),util['inspect'](this[_0x70da('0x3f')][_0x54809e[_0x70da('0x6a')]],{'showHidden':![],'depth':null}));ami['emit'](_0x70da('0x72'),this[_0x70da('0x3f')][_0x54809e[_0x70da('0x6a')]]);}}}catch(_0xd165a5){logger[_0x70da('0x3a')]('[voiceQueueReport][queuesummary]',util['inspect'](_0xd165a5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x70da('0xa')][_0x70da('0x17')]=function(_0x3dc299){logger['debug'](_0x70da('0x73'),util[_0x70da('0x3c')](_0x3dc299,{'showHidden':![],'depth':null}));this[_0x70da('0x11')]=!![];};VoiceQueueReport[_0x70da('0xa')][_0x70da('0x74')]=function(_0x28ea9a){try{if(this[_0x70da('0x64')](_0x28ea9a)){logger[_0x70da('0x42')](_0x70da('0x75'),_0x28ea9a[_0x70da('0x45')],util[_0x70da('0x3c')](_0x28ea9a,{'showHidden':![],'depth':null}));if(_[_0x70da('0x65')](this[_0x70da('0xe')][_0x28ea9a['uniqueid']]))this['queueReports'][_0x28ea9a['uniqueid']]=[];if(_[_0x70da('0x65')](this[_0x70da('0x10')][_0x28ea9a['uniqueid']]))this[_0x70da('0x10')][_0x28ea9a[_0x70da('0x45')]]={};var _0x4634e5=new QueueReport();_0x4634e5[_0x70da('0x47')]=_0x28ea9a[_0x70da('0x6a')];_0x4634e5[_0x70da('0x4f')]=this[_0x70da('0x3f')][_0x4634e5['name']]&&this[_0x70da('0x3f')][_0x4634e5[_0x70da('0x47')]][_0x70da('0x4f')]?this[_0x70da('0x3f')][_0x4634e5[_0x70da('0x47')]]['type']||_0x70da('0x50'):_0x70da('0x50');_0x4634e5['queue']=_0x28ea9a['queue'];_0x4634e5[_0x70da('0x76')]=moment()[_0x70da('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x4634e5['position']=_0x28ea9a['position'];_0x4634e5[_0x70da('0x77')]=_0x28ea9a[_0x70da('0x77')];_0x4634e5['uniqueid']=_0x28ea9a['uniqueid'];_0x4634e5['routealias']=this[_0x70da('0x10')][_0x28ea9a[_0x70da('0x45')]][_0x70da('0x78')];logger[_0x70da('0x6b')](_0x70da('0x79'),_0x4634e5[_0x70da('0x47')],_0x4634e5[_0x70da('0x4f')]);_[_0x70da('0x7a')](_0x4634e5,_[_0x70da('0x7b')](_0x28ea9a,_[_0x70da('0x7c')](_0x4634e5)));this['queueReports'][_0x28ea9a[_0x70da('0x45')]]['push'](_0x4634e5);this['channels'][_0x28ea9a[_0x70da('0x45')]]=_0x4634e5;this[_0x70da('0x41')](_0x4634e5,_0x70da('0x18'));}}catch(_0x32c01c){logger[_0x70da('0x3a')](_0x70da('0x75'),_0x28ea9a['uniqueid'],util['inspect'](_0x32c01c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x70da('0xa')][_0x70da('0x1a')]=function(_0x1f9b6f){try{if(this[_0x70da('0x64')](_0x1f9b6f)){logger['debug'](_0x70da('0x7d'),_0x1f9b6f[_0x70da('0x45')],util[_0x70da('0x3c')](_0x1f9b6f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1f9b6f['uniqueid']]){var _0x41b429=_[_0x70da('0x7e')](this[_0x70da('0xe')][_0x1f9b6f[_0x70da('0x45')]]);_0x41b429[_0x70da('0x7f')]=![];_0x41b429[_0x70da('0x80')]=null;_0x41b429[_0x70da('0x81')]=_0x1f9b6f[_0x70da('0x81')];_0x41b429[_0x70da('0x82')]=_0x1f9b6f['originalposition'];_0x41b429[_0x70da('0x19')]=!![];_0x41b429['queuecallerabandonAt']=moment()[_0x70da('0x4d')](_0x70da('0x83'));_0x41b429['queuecallerexitreason']=_0x70da('0x84');_0x41b429[_0x70da('0x85')]=null;logger[_0x70da('0x6b')](_0x70da('0x86'),_0x41b429[_0x70da('0x47')],_0x41b429['type']);this[_0x70da('0x10')][_0x1f9b6f[_0x70da('0x45')]]=_0x41b429;this[_0x70da('0x49')](_0x41b429,'queuecallerabandon');}}}catch(_0x54cb23){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x1f9b6f[_0x70da('0x45')],util[_0x70da('0x3c')](_0x54cb23,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x70da('0xa')][_0x70da('0x1c')]=function(_0x2dc94d){try{if(this[_0x70da('0x64')](_0x2dc94d)){logger[_0x70da('0x42')](_0x70da('0x87'),_0x2dc94d[_0x70da('0x45')],util['inspect'](_0x2dc94d,{'showHidden':![],'depth':null}));if(this[_0x70da('0xe')][_0x2dc94d['uniqueid']]){var _0x165bfe=_[_0x70da('0x7e')](this[_0x70da('0xe')][_0x2dc94d['uniqueid']]);_0x165bfe[_0x70da('0x88')]=moment()['format'](_0x70da('0x83'));_0x165bfe[_0x70da('0x89')]=_0x2dc94d[_0x70da('0x89')];_0x165bfe[_0x70da('0x8a')]=_0x2dc94d[_0x70da('0x8a')];logger['info'](_0x70da('0x8b'),_0x165bfe[_0x70da('0x47')],_0x165bfe[_0x70da('0x4f')],_0x2dc94d[_0x70da('0x89')],_0x2dc94d[_0x70da('0x8a')]);this[_0x70da('0x10')][_0x2dc94d[_0x70da('0x45')]]=_0x165bfe;this['emitVoiceQueueChannelSave'](_0x165bfe,_0x70da('0x1b'));}}}catch(_0x4ab481){logger[_0x70da('0x3a')](_0x70da('0x87'),_0x2dc94d[_0x70da('0x45')],util[_0x70da('0x3c')](_0x4ab481,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x70da('0xa')][_0x70da('0x8c')]=function(_0x2749cd){try{if(this['isNotNull'](_0x2749cd)){logger[_0x70da('0x42')](_0x70da('0x8d'),_0x2749cd[_0x70da('0x45')],util[_0x70da('0x3c')](_0x2749cd,{'showHidden':![],'depth':null}));if(this[_0x70da('0xe')][_0x2749cd[_0x70da('0x45')]]){var _0xd9b91d=_[_0x70da('0x7e')](this[_0x70da('0xe')][_0x2749cd[_0x70da('0x45')]]);_0xd9b91d[_0x70da('0x7f')]=!![];_0xd9b91d['queuecallerexitreason']=_0x70da('0x8e');logger['info'](_0x70da('0x8f'),_0xd9b91d[_0x70da('0x47')],_0xd9b91d[_0x70da('0x4f')]);}}}catch(_0x1133f9){logger[_0x70da('0x3a')]('[%s][voiceQueueReport][agentconnect]',_0x2749cd[_0x70da('0x45')],util[_0x70da('0x3c')](_0x1133f9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x70da('0xa')][_0x70da('0x1d')]=function(_0x467473){try{if(this[_0x70da('0x64')](_0x467473)){logger[_0x70da('0x42')](_0x70da('0x90'),_0x467473[_0x70da('0x45')],util[_0x70da('0x3c')](_0x467473,{'showHidden':![],'depth':null}));if(this[_0x70da('0xe')][_0x467473[_0x70da('0x45')]]){var _0x2324fb=_[_0x70da('0x7e')](this[_0x70da('0xe')][_0x467473[_0x70da('0x45')]]);_0x2324fb['queuecallerabandon']=![];_0x2324fb[_0x70da('0x91')]=null;_0x2324fb['assigned']=!![];_0x2324fb[_0x70da('0x85')]=_0x467473[_0x70da('0x92')];_0x2324fb[_0x70da('0x81')]=_0x467473[_0x70da('0x81')];_0x2324fb[_0x70da('0x7f')]=!![];_0x2324fb[_0x70da('0x93')]=![];_0x2324fb[_0x70da('0x94')]=null;if(!_0x2324fb[_0x70da('0x95')]){if(_0x467473[_0x70da('0x96')]=='transfer'){_0x2324fb[_0x70da('0x4b')]='COMPLETED';logger[_0x70da('0x6b')](_0x70da('0x97'),_0x2324fb['name'],_0x2324fb[_0x70da('0x4f')]);}else{if(_[_0x70da('0x98')](_0x467473[_0x70da('0x37')]['toLowerCase'](),_0x70da('0x99'))){if(this[_0x70da('0xe')][_0x467473[_0x70da('0x9a')]]){var _0x3540e1=_[_0x70da('0x7e')](this[_0x70da('0xe')][_0x467473[_0x70da('0x9a')]]);_0x3540e1['queuecallercomplete']=![];_0x3540e1[_0x70da('0x93')]=!![];_0x3540e1[_0x70da('0x94')]=moment(_0x2324fb[_0x70da('0x76')])[_0x70da('0x9b')](_0x467473[_0x70da('0x81')],_0x70da('0x9c'))[_0x70da('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x3540e1[_0x70da('0x4b')]='FORWARDTRANSFER';_0x3540e1[_0x70da('0x95')]=!![];_0x3540e1[_0x70da('0x9d')]='FORWARD';_0x3540e1[_0x70da('0x9e')]=_0x467473[_0x70da('0x9f')];_0x3540e1[_0x70da('0xa0')]=_0x467473[_0x70da('0x45')];logger[_0x70da('0x6b')](_0x70da('0xa1'),_0x3540e1[_0x70da('0x47')],_0x3540e1[_0x70da('0x4f')]);var _0x21b6f6=this[_0x70da('0xe')][_0x467473[_0x70da('0x9a')]];this[_0x70da('0xe')][_0x467473[_0x70da('0x9a')]]=this[_0x70da('0xe')][_0x467473['uniqueid']];this[_0x70da('0xe')][_0x467473[_0x70da('0x45')]]=_0x21b6f6;}}else{_0x2324fb['queuecallerexitreason']='COMPLETEDBY'+_0x467473['reason']['toUpperCase']();logger[_0x70da('0x6b')](_0x70da('0xa2'),_0x2324fb[_0x70da('0x47')],_0x2324fb[_0x70da('0x4f')],_0x2324fb[_0x70da('0x4b')]);}}}this['channels'][_0x467473[_0x70da('0x45')]]=_0x2324fb;this[_0x70da('0x49')](_0x2324fb,_0x70da('0xa3'));}}}catch(_0x21a88f){logger['error'](_0x70da('0x90'),_0x467473[_0x70da('0x45')],util[_0x70da('0x3c')](_0x21a88f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x70da('0xa')]['syncVarSet']=function(_0x454959){try{if(this[_0x70da('0x64')](_0x454959)){logger['debug']('[%s][voiceQueueReport][varset]',_0x454959[_0x70da('0x45')],util[_0x70da('0x3c')](_0x454959,{'showHidden':![],'depth':null}));this[_0x70da('0xa4')](_0x454959[_0x70da('0x45')],_[_0x70da('0x7c')](_0x454959[_0x70da('0xa5')])[0x0],_0x454959[_0x70da('0xa6')]);if(this[_0x70da('0xe')][_0x454959['uniqueid']]){var _0x6fb692=_['last'](this['queueReports'][_0x454959['uniqueid']]);if(_0x6fb692){if(this[_0x70da('0x64')](_0x454959[_0x70da('0xa5')])&&this['isNotNull'](_0x454959[_0x70da('0xa5')]['queuestatus'])){switch(_0x454959[_0x70da('0xa6')]){case'CONTINUE':_0x6fb692[_0x70da('0x93')]=![];_0x6fb692[_0x70da('0x94')]=null;break;case'TIMEOUT':_0x6fb692[_0x70da('0xa7')]=_0x70da('0xa8');_0x6fb692[_0x70da('0x93')]=!![];_0x6fb692[_0x70da('0x94')]=moment()[_0x70da('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x6fb692[_0x70da('0x88')]=moment()['format'](_0x70da('0x83'));logger[_0x70da('0x42')](_0x70da('0xa9'),_0x454959[_0x70da('0x45')],util[_0x70da('0x3c')](_0x6fb692,{'showHidden':![],'depth':null}));ami[_0x70da('0x40')](_0x70da('0xaa'),_0x6fb692);break;default:_0x6fb692['queuecallerexit']=!![];_0x6fb692[_0x70da('0x94')]=moment()[_0x70da('0x4d')](_0x70da('0x83'));_0x6fb692['queuecallerleaveAt']=moment()['format'](_0x70da('0x83'));}_0x6fb692[_0x70da('0x19')]=![];_0x6fb692[_0x70da('0x91')]=null;_0x6fb692[_0x70da('0x4b')]=_0x454959[_0x70da('0xa6')];this['channels'][_0x454959[_0x70da('0x45')]]=_0x6fb692;this[_0x70da('0x49')](_0x6fb692,_0x70da('0xab'));}else if(this['isNotNull'](_0x454959[_0x70da('0xa5')])&&this[_0x70da('0x64')](_0x454959['variable'][_0x70da('0xac')])){if(!_0x6fb692[_0x70da('0x19')]){_0x6fb692['queuecallerexit']=!![];_0x6fb692[_0x70da('0x94')]=moment()[_0x70da('0x4d')](_0x70da('0x83'));_0x6fb692['queuecallerexitreason']='EXITWITHKEY';_0x6fb692[_0x70da('0x88')]=moment()[_0x70da('0x4d')](_0x70da('0x83'));this[_0x70da('0x10')][_0x454959[_0x70da('0x45')]]=_0x6fb692;}}logger[_0x70da('0x6b')](_0x70da('0xad'),_0x454959[_0x70da('0x45')],_0x6fb692[_0x70da('0x47')],_0x6fb692[_0x70da('0x4f')],_[_0x70da('0x7c')](_0x454959['variable'])[0x0],_0x454959['value']);_0x6fb692[_0x70da('0x13')]=this[_0x70da('0x13')][_0x454959[_0x70da('0x45')]];}}}}catch(_0x168a3c){logger[_0x70da('0x3a')](_0x70da('0xae'),_0x454959['uniqueid'],util[_0x70da('0x3c')](_0x168a3c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x70da('0xa4')]=function(_0x390e6f,_0x6fd45b,_0x50e9e2){var _0x893cf7=[_0x70da('0xaf'),_0x70da('0xb0'),_0x70da('0xb1'),_0x70da('0xb2'),_0x70da('0xb3'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x70da('0xb4'),'sipcallid','sipuri',_0x70da('0xb5'),_0x70da('0xb6'),_0x70da('0xb7'),_0x70da('0xb8'),'memberinterface',_0x70da('0xb9'),_0x70da('0x92'),_0x70da('0xba'),_0x70da('0xbb')];if(!_[_0x70da('0x34')](_0x6fd45b)&&!_[_0x70da('0xbc')](_0x893cf7,_0x6fd45b)){if(_[_0x70da('0x65')](this[_0x70da('0x13')][_0x390e6f])){this[_0x70da('0x13')][_0x390e6f]={};}this[_0x70da('0x13')][_0x390e6f][_0x6fd45b]=_0x50e9e2;}};VoiceQueueReport[_0x70da('0xa')][_0x70da('0x21')]=function(_0x4c08b7){try{if(this[_0x70da('0x64')](_0x4c08b7)){logger['debug'](_0x70da('0xbd'),_0x4c08b7[_0x70da('0x45')],util[_0x70da('0x3c')](_0x4c08b7,{'showHidden':![],'depth':null}));if(this[_0x70da('0xe')][_0x4c08b7[_0x70da('0x45')]]){for(var _0x358517=0x0,_0x1d5569={};_0x358517=0x0?moment(_0x52fe11[_0xa26f('0x1a')])[_0xa26f('0x1b')](_0x52fe11[_0xa26f('0x19')],_0xa26f('0xe')):null,'data1':_0xa26f('0x1c'),'data2':_0x52fe11[_0xa26f('0x13')],'data3':_0x52fe11[_0xa26f('0x1d')],'data4':_0x52fe11[_0xa26f('0x1e')]||null,'role':_0xa26f('0x12'),'internal':_0x52fe11[_0xa26f('0x13')]?_['toNumber'](_0x52fe11[_0xa26f('0x13')]):undefined,'uniqueid':_0x52fe11[_0xa26f('0x15')]},'log':_0xa26f('0x7')});}; \ No newline at end of file +var _0x8be8=['lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','inbound','queue','agent','accountcode','uniqueid','membername','starttime','seconds','endtime','exten','dialstring','toNumber','lodash','util','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice'];(function(_0x7a5c5,_0x277aa7){var _0x121a7b=function(_0x36b336){while(--_0x36b336){_0x7a5c5['push'](_0x7a5c5['shift']());}};_0x121a7b(++_0x277aa7);}(_0x8be8,0x68));var _0x88be=function(_0x27125a,_0x252d0d){_0x27125a=_0x27125a-0x0;var _0x391f7a=_0x8be8[_0x27125a];return _0x391f7a;};'use strict';var moment=require('moment');var _=require(_0x88be('0x0'));var util=require(_0x88be('0x1'));var client=require(_0x88be('0x2'));exports[_0x88be('0x3')]=function(_0x4c5922){var _0x4381a4=_0x4c5922['queuecallercompleteAt']||_0x4c5922[_0x88be('0x4')];return client[_0x88be('0x5')](_0x88be('0x6'),{'body':{'channel':_0x88be('0x7'),'membername':_0x4c5922[_0x88be('0x8')],'interface':_[_0x88be('0x9')](_0x4c5922[_0x88be('0xa')])?util[_0x88be('0xb')](_0x88be('0xc'),_0x4c5922[_0x88be('0x8')]):_0x4c5922[_0x88be('0xa')],'type':_0x88be('0xd'),'enterAt':_0x4c5922[_0x88be('0xe')],'exitAt':_0x4381a4,'duration':moment(_0x4381a4)[_0x88be('0xf')](_0x4c5922[_0x88be('0xe')],'seconds'),'data1':_0x88be('0x10'),'data2':_0x4c5922['calleridnum'],'data3':_0x4c5922['exten'],'data4':null,'data5':_0x4c5922[_0x88be('0x11')],'role':_0x88be('0x12'),'internal':_0x4c5922[_0x88be('0x13')]?_['toNumber'](_0x4c5922[_0x88be('0x13')]):undefined,'uniqueid':_0x4c5922[_0x88be('0x14')]},'log':_0x88be('0x6')});};exports['voiceDialReport']=function(_0x24aac5){return client['Request'](_0x88be('0x6'),{'body':{'channel':_0x88be('0x7'),'membername':_0x24aac5[_0x88be('0x15')],'interface':_0x24aac5[_0x88be('0xa')],'type':_0x88be('0xd'),'enterAt':_0x24aac5[_0x88be('0x16')],'exitAt':_0x24aac5['endtime'],'duration':moment(_0x24aac5['endtime'])[_0x88be('0xf')](_0x24aac5[_0x88be('0x16')],_0x88be('0x17'))>=0x0?moment(_0x24aac5[_0x88be('0x18')])[_0x88be('0xf')](_0x24aac5['starttime'],_0x88be('0x17')):null,'data1':'outbound','data2':_0x24aac5['accountcode'],'data3':_0x24aac5[_0x88be('0x19')],'data4':_0x24aac5[_0x88be('0x1a')]||null,'role':_0x88be('0x12'),'internal':_0x24aac5['accountcode']?_[_0x88be('0x1b')](_0x24aac5[_0x88be('0x13')]):undefined,'uniqueid':_0x24aac5[_0x88be('0x14')]},'log':_0x88be('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 96525c7..706e025 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 _0xb396=['previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x47bf02,_0x1db47a){var _0x571f0c=function(_0x2cdbc8){while(--_0x2cdbc8){_0x47bf02['push'](_0x47bf02['shift']());}};_0x571f0c(++_0x1db47a);}(_0xb396,0x1e8));var _0x6b39=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb396[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x6b39('0x0'));exports[_0x6b39('0x1')]=function(){return client[_0x6b39('0x2')](_0x6b39('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x6b39('0x4')]},'log':_0x6b39('0x5')});}; \ No newline at end of file +var _0x88c8=['getSettings','stopRecordingOnTransfer','../client'];(function(_0x57a430,_0x281e18){var _0x533e30=function(_0x30f094){while(--_0x30f094){_0x57a430['push'](_0x57a430['shift']());}};_0x533e30(++_0x281e18);}(_0x88c8,0x7a));var _0x888c=function(_0x24dff2,_0x308bb4){_0x24dff2=_0x24dff2-0x0;var _0x5e4797=_0x88c8[_0x24dff2];return _0x5e4797;};'use strict';var client=require(_0x888c('0x0'));exports[_0x888c('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x888c('0x2'),'previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index b68f824..312e2ac 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 _0x6a95=['name','html','GetTemplate','../client','getTemplates','Request'];(function(_0x22487b,_0x3a9021){var _0x2949ef=function(_0x2f846d){while(--_0x2f846d){_0x22487b['push'](_0x22487b['shift']());}};_0x2949ef(++_0x3a9021);}(_0x6a95,0xdb));var _0x56a9=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x6a95[_0x5e36d1];return _0x950b9e;};'use strict';var client=require(_0x56a9('0x0'));exports[_0x56a9('0x1')]=function(_0x5393db){return function(_0x4853e7){return client[_0x56a9('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x56a9('0x3'),_0x56a9('0x4')]},'log':_0x56a9('0x5')});};}; \ No newline at end of file +var _0xb8f0=['getTemplates','GetTemplate','name','html','../client'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0xb8f0,0x112));var _0x0b8f=function(_0x117723,_0xfac4a1){_0x117723=_0x117723-0x0;var _0xdf892d=_0xb8f0[_0x117723];return _0xdf892d;};'use strict';var client=require(_0x0b8f('0x0'));exports[_0x0b8f('0x1')]=function(_0x153c0f){return function(_0x11162b){return client['Request'](_0x0b8f('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0b8f('0x3'),_0x0b8f('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index d2de44d..fd4fc01 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 _0x7972=['Condition','AllConditions','field','operator','Action','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','channel','status'];(function(_0x442da0,_0x227906){var _0x38a96e=function(_0xd64fbc){while(--_0xd64fbc){_0x442da0['push'](_0x442da0['shift']());}};_0x38a96e(++_0x227906);}(_0x7972,0x1ce));var _0x2797=function(_0x4caf8d,_0x579253){_0x4caf8d=_0x4caf8d-0x0;var _0x26ccf8=_0x7972[_0x4caf8d];return _0x26ccf8;};'use strict';var client=require(_0x2797('0x0'));exports[_0x2797('0x1')]=function(_0x586147){return function(_0x54b3eb){return client[_0x2797('0x2')](_0x2797('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2797('0x4'),_0x2797('0x5')],'include':[{'model':_0x2797('0x6'),'as':_0x2797('0x7'),'attributes':['id',_0x2797('0x8'),_0x2797('0x9'),'value']},{'model':_0x2797('0x6'),'as':'AnyConditions','attributes':['id',_0x2797('0x8'),_0x2797('0x9'),'value']},{'model':_0x2797('0xa'),'as':'Actions','attributes':['id','action',_0x2797('0xb'),_0x2797('0xc'),_0x2797('0xd'),_0x2797('0xe'),_0x2797('0xf'),_0x2797('0x10'),_0x2797('0x11')]}]},'log':_0x2797('0x3')});};}; \ No newline at end of file +var _0xac7d=['data1','data2','data3','data4','data5','data6','GetTrigger','../client','getTriggers','Request','channel','status','AllConditions','field','value','AnyConditions','Actions','action'];(function(_0x2423be,_0x4d39ba){var _0x3783d3=function(_0x56b1fb){while(--_0x56b1fb){_0x2423be['push'](_0x2423be['shift']());}};_0x3783d3(++_0x4d39ba);}(_0xac7d,0x1c9));var _0xdac7=function(_0x285d05,_0x1e4f2f){_0x285d05=_0x285d05-0x0;var _0x6aaafe=_0xac7d[_0x285d05];return _0x6aaafe;};'use strict';var client=require(_0xdac7('0x0'));exports[_0xdac7('0x1')]=function(_0x5179ea){return function(_0x47a988){return client[_0xdac7('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0xdac7('0x3'),_0xdac7('0x4')],'include':[{'model':'Condition','as':_0xdac7('0x5'),'attributes':['id',_0xdac7('0x6'),'operator',_0xdac7('0x7')]},{'model':'Condition','as':_0xdac7('0x8'),'attributes':['id',_0xdac7('0x6'),'operator',_0xdac7('0x7')]},{'model':'Action','as':_0xdac7('0x9'),'attributes':['id',_0xdac7('0xa'),_0xdac7('0xb'),_0xdac7('0xc'),_0xdac7('0xd'),_0xdac7('0xe'),_0xdac7('0xf'),_0xdac7('0x10'),'data7']}]},'log':_0xdac7('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 4e7fd16..22d8b9f 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 _0xd9f1=['name','registry','defaultuser','../client','getTrunks','Request','GetTrunk'];(function(_0x3f56cf,_0x3882f7){var _0x3cd779=function(_0x455fc){while(--_0x455fc){_0x3f56cf['push'](_0x3f56cf['shift']());}};_0x3cd779(++_0x3882f7);}(_0xd9f1,0x1df));var _0x1d9f=function(_0x222895,_0x4dc3e6){_0x222895=_0x222895-0x0;var _0x29adaf=_0xd9f1[_0x222895];return _0x29adaf;};'use strict';var client=require(_0x1d9f('0x0'));exports[_0x1d9f('0x1')]=function(_0x5140c5){return function(_0x43e1f0){return client[_0x1d9f('0x2')](_0x1d9f('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x1d9f('0x4'),_0x1d9f('0x5'),_0x1d9f('0x6')]},'log':_0x1d9f('0x3')});};}; \ No newline at end of file +var _0xb024=['registry','getTrunks','Request','GetTrunk'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xb024,0x1ad));var _0x4b02=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xb024[_0x413feb];return _0x40ee88;};'use strict';var client=require('../client');exports[_0x4b02('0x0')]=function(_0x8f00d0){return function(_0x3c2440){return client[_0x4b02('0x1')](_0x4b02('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x4b02('0x3'),'defaultuser']},'log':_0x4b02('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 4803f26..17c6eed 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 _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x3cb094,_0x57faaf){var _0x2306aa=function(_0x1650bf){while(--_0x1650bf){_0x3cb094['push'](_0x3cb094['shift']());}};_0x2306aa(++_0x57faaf);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 6671c24..8fb2f38 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 _0x786c=['update','Request','UpdateVoiceAgentReport','CreateVoiceAgentReport'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x786c,0x133));var _0xc786=function(_0x12a722,_0x23ca61){_0x12a722=_0x12a722-0x0;var _0x201319=_0x786c[_0x12a722];return _0x201319;};'use strict';var client=require('../client');exports['create']=function(_0x1feaeb){return client['Request'](_0xc786('0x0'),{'body':_0x1feaeb,'log':_0xc786('0x0')});};exports[_0xc786('0x1')]=function(_0x3fa6d0,_0x37e8af,_0x1b2898){return client[_0xc786('0x2')](_0xc786('0x3'),{'body':_0x3fa6d0,'options':{'where':{'uniqueid':_0x37e8af,'interface':_0x1b2898,'agentcomplete':!![]}},'log':_0xc786('0x3')});}; \ No newline at end of file +var _0xf111=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','Request'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xf111,0x117));var _0x1f11=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0xf111[_0x2f87cd];return _0x5d7eda;};'use strict';var client=require('../client');exports['create']=function(_0x3b4ff4){return client[_0x1f11('0x0')](_0x1f11('0x1'),{'body':_0x3b4ff4,'log':_0x1f11('0x1')});};exports[_0x1f11('0x2')]=function(_0x3350b7,_0x38aff5,_0x210988){return client[_0x1f11('0x0')](_0x1f11('0x3'),{'body':_0x3350b7,'options':{'where':{'uniqueid':_0x38aff5,'interface':_0x210988,'agentcomplete':!![]}},'log':_0x1f11('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index bc33fc3..6300a00 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 _0xc57f=['GetVoiceCallReports','moment','util','lodash','../client','create','Request','merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','duration'];(function(_0x10d618,_0x1f1c82){var _0x57d044=function(_0x52c55b){while(--_0x52c55b){_0x10d618['push'](_0x10d618['shift']());}};_0x57d044(++_0x1f1c82);}(_0xc57f,0x1a3));var _0xfc57=function(_0x44e97a,_0x4a01d2){_0x44e97a=_0x44e97a-0x0;var _0x15a999=_0xc57f[_0x44e97a];return _0x15a999;};'use strict';var moment=require(_0xfc57('0x0'));var util=require(_0xfc57('0x1'));var _=require(_0xfc57('0x2'));var client=require(_0xfc57('0x3'));exports[_0xfc57('0x4')]=function(_0x48454f){return client[_0xfc57('0x5')]('CreateVoiceCallReport',{'body':_[_0xfc57('0x6')](_0x48454f,{'source':_0x48454f[_0xfc57('0x7')],'destinationcontext':_0x48454f[_0xfc57('0x8')],'callerid':_0x48454f[_0xfc57('0x9')],'amaflags':_0xfc57('0xa')}),'log':_0xfc57('0xb')});};exports[_0xfc57('0xc')]=function(){return function(){return client[_0xfc57('0x5')](_0xfc57('0xd'),{'options':{'where':{'type':[_0xfc57('0xe')],'createdAt':{'$between':[moment()['startOf']('day')[_0xfc57('0xf')](_0xfc57('0x10')),moment()[_0xfc57('0x11')](_0xfc57('0x12'))[_0xfc57('0xf')](_0xfc57('0x10'))]}},'attributes':[_0xfc57('0x13'),'disposition',_0xfc57('0x14'),'billableseconds']},'log':_0xfc57('0x15')});};}; \ No newline at end of file +var _0x0386=['util','lodash','../client','create','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','type','billableseconds'];(function(_0x2ce6ab,_0x4ef47d){var _0x197a53=function(_0x482ea1){while(--_0x482ea1){_0x2ce6ab['push'](_0x2ce6ab['shift']());}};_0x197a53(++_0x4ef47d);}(_0x0386,0x154));var _0x6038=function(_0x58f41c,_0x2bac65){_0x58f41c=_0x58f41c-0x0;var _0x5d50fa=_0x0386[_0x58f41c];return _0x5d50fa;};'use strict';var moment=require('moment');var util=require(_0x6038('0x0'));var _=require(_0x6038('0x1'));var client=require(_0x6038('0x2'));exports[_0x6038('0x3')]=function(_0x2e4a0e){return client['Request'](_0x6038('0x4'),{'body':_[_0x6038('0x5')](_0x2e4a0e,{'source':_0x2e4a0e['calleridnum'],'destinationcontext':_0x2e4a0e[_0x6038('0x6')],'callerid':_0x2e4a0e[_0x6038('0x7')],'amaflags':_0x6038('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0x6038('0x9')]=function(){return function(){return client[_0x6038('0xa')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x6038('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x6038('0xc'))[_0x6038('0xd')](_0x6038('0xe')),moment()['endOf']('day')[_0x6038('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x6038('0xf'),'disposition','duration',_0x6038('0x10')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 108f883..ef41a14 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 _0x2d75=['../client','create','Request','CreateVoiceDialReport'];(function(_0xe99e61,_0x51a2df){var _0x5c48ee=function(_0x3f2ec8){while(--_0x3f2ec8){_0xe99e61['push'](_0xe99e61['shift']());}};_0x5c48ee(++_0x51a2df);}(_0x2d75,0xa0));var _0x52d7=function(_0x64b210,_0x301877){_0x64b210=_0x64b210-0x0;var _0x232a2b=_0x2d75[_0x64b210];return _0x232a2b;};'use strict';var client=require(_0x52d7('0x0'));exports[_0x52d7('0x1')]=function(_0x160608){return client[_0x52d7('0x2')]('CreateVoiceDialReport',{'body':_0x160608,'log':_0x52d7('0x3')});}; \ No newline at end of file +var _0xb57f=['create','Request','CreateVoiceDialReport','../client'];(function(_0x1e8398,_0x58480e){var _0xc67b1a=function(_0x45bf4b){while(--_0x45bf4b){_0x1e8398['push'](_0x1e8398['shift']());}};_0xc67b1a(++_0x58480e);}(_0xb57f,0xdf));var _0xfb57=function(_0x3e5ba6,_0x22369b){_0x3e5ba6=_0x3e5ba6-0x0;var _0x4d0767=_0xb57f[_0x3e5ba6];return _0x4d0767;};'use strict';var client=require(_0xfb57('0x0'));exports[_0xfb57('0x1')]=function(_0x59e4cf){return client[_0xfb57('0x2')]('CreateVoiceDialReport',{'body':_0x59e4cf,'log':_0xfb57('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 5953a8d..bd417e5 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 _0x263f=['exten','recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x263f,0x182));var _0xf263=function(_0x48850b,_0x1d530d){_0x48850b=_0x48850b-0x0;var _0x159ede=_0x263f[_0x48850b];return _0x159ede;};'use strict';var client=require(_0xf263('0x0'));exports[_0xf263('0x1')]=function(){return function(){return client[_0xf263('0x2')](_0xf263('0x3'),{'options':{'raw':!![],'attributes':['id',_0xf263('0x4'),_0xf263('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xc6fe=['GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x52ec51,_0x2f1bb7){var _0x386802=function(_0x45c53c){while(--_0x45c53c){_0x52ec51['push'](_0x52ec51['shift']());}};_0x386802(++_0x2f1bb7);}(_0xc6fe,0xbc));var _0xec6f=function(_0x4c41c3,_0x668eb3){_0x4c41c3=_0x4c41c3-0x0;var _0x50b018=_0xc6fe[_0x4c41c3];return _0x50b018;};'use strict';var client=require(_0xec6f('0x0'));exports[_0xec6f('0x1')]=function(){return function(){return client['Request'](_0xec6f('0x2'),{'options':{'raw':!![],'attributes':['id',_0xec6f('0x3'),_0xec6f('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 6d7ca24..a8c4e20 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 _0x3f9f=['Interval','Intervals','interval','getVoiceQueues','../client','Request','name','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','monitor_format','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','callerid','Pause','mandatoryDispositionPause','active'];(function(_0x22fe5c,_0x28645c){var _0x17a217=function(_0x1306f0){while(--_0x1306f0){_0x22fe5c['push'](_0x22fe5c['shift']());}};_0x17a217(++_0x28645c);}(_0x3f9f,0x17e));var _0xf3f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f9f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xf3f9('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xf3f9('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xf3f9('0x2'),'acw',_0xf3f9('0x3'),_0xf3f9('0x4'),'monitor_format',_0xf3f9('0x5'),_0xf3f9('0x6'),_0xf3f9('0x7'),_0xf3f9('0x8'),_0xf3f9('0x9'),_0xf3f9('0xa'),_0xf3f9('0xb'),'dialPredictiveOptimizationPercentage',_0xf3f9('0xc'),_0xf3f9('0xd'),_0xf3f9('0xe'),_0xf3f9('0xf'),'dialQueueOptions',_0xf3f9('0x10'),_0xf3f9('0x11'),_0xf3f9('0x12'),'dialCongestionRetryFrequency',_0xf3f9('0x13'),'dialBusyRetryFrequency',_0xf3f9('0x14'),'dialNoAnswerRetryFrequency',_0xf3f9('0x15'),_0xf3f9('0x16'),_0xf3f9('0x17'),'dialPrefix',_0xf3f9('0x18'),_0xf3f9('0x19'),_0xf3f9('0x1a'),_0xf3f9('0x1b'),'dialAMDAfterGreetingSilence',_0xf3f9('0x1c'),_0xf3f9('0x1d'),_0xf3f9('0x1e'),_0xf3f9('0x1f'),_0xf3f9('0x20'),_0xf3f9('0x21'),_0xf3f9('0x22'),_0xf3f9('0x23'),_0xf3f9('0x24'),'dialOrderByScheduledAt',_0xf3f9('0x25'),_0xf3f9('0x26'),'dialQueueProject2',_0xf3f9('0x27'),'strategy',_0xf3f9('0x28'),_0xf3f9('0x29'),_0xf3f9('0x2a'),_0xf3f9('0x2b'),_0xf3f9('0x2c'),_0xf3f9('0x2d'),_0xf3f9('0x2e'),'dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency',_0xf3f9('0x2f'),_0xf3f9('0x30'),_0xf3f9('0x31'),'dialPredictiveIntervalMaxThreshold',_0xf3f9('0x32'),_0xf3f9('0x33'),_0xf3f9('0x34'),_0xf3f9('0x35')],'include':[{'model':_0xf3f9('0x36'),'as':'Trunk','attributes':['id',_0xf3f9('0x2'),_0xf3f9('0x37'),'active']},{'model':_0xf3f9('0x38'),'as':_0xf3f9('0x39'),'attributes':['id',_0xf3f9('0x2')]},{'model':_0xf3f9('0x36'),'as':'TrunkBackup','attributes':['id',_0xf3f9('0x2'),'callerid',_0xf3f9('0x3a')]},{'model':_0xf3f9('0x3b'),'as':_0xf3f9('0x3b'),'attributes':['id',_0xf3f9('0x2')],'include':[{'model':'Interval','as':_0xf3f9('0x3c'),'attributes':['id',_0xf3f9('0x2'),_0xf3f9('0x3d')]}]}]},'log':_0xf3f9('0x3e')});};}; \ No newline at end of file +var _0x9b7c=['autopause','monitor_format','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','callAdditionalPhoneAfterMin','Trunk','active','Pause','mandatoryDispositionPause','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout'];(function(_0x4c055e,_0xa39030){var _0x360d6a=function(_0x4d8617){while(--_0x4d8617){_0x4c055e['push'](_0x4c055e['shift']());}};_0x360d6a(++_0xa39030);}(_0x9b7c,0x73));var _0xc9b7=function(_0x2afb08,_0x324211){_0x2afb08=_0x2afb08-0x0;var _0x38cc5a=_0x9b7c[_0x2afb08];return _0x38cc5a;};'use strict';var client=require(_0xc9b7('0x0'));exports[_0xc9b7('0x1')]=function(){return function(){return client[_0xc9b7('0x2')](_0xc9b7('0x3'),{'options':{'raw':![],'attributes':['id',_0xc9b7('0x4'),_0xc9b7('0x5'),_0xc9b7('0x6'),_0xc9b7('0x7'),_0xc9b7('0x8'),'type','dialActive',_0xc9b7('0x9'),_0xc9b7('0xa'),_0xc9b7('0xb'),'dialPowerLevel',_0xc9b7('0xc'),_0xc9b7('0xd'),_0xc9b7('0xe'),_0xc9b7('0xf'),_0xc9b7('0x10'),_0xc9b7('0x11'),'dialQueueOptions',_0xc9b7('0x12'),_0xc9b7('0x13'),_0xc9b7('0x14'),_0xc9b7('0x15'),_0xc9b7('0x16'),'dialBusyRetryFrequency',_0xc9b7('0x17'),'dialNoAnswerRetryFrequency',_0xc9b7('0x18'),_0xc9b7('0x19'),'dialGlobalInterval',_0xc9b7('0x1a'),'dialCheckDuplicateType',_0xc9b7('0x1b'),_0xc9b7('0x1c'),_0xc9b7('0x1d'),_0xc9b7('0x1e'),_0xc9b7('0x1f'),_0xc9b7('0x20'),_0xc9b7('0x21'),_0xc9b7('0x22'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout',_0xc9b7('0x23'),_0xc9b7('0x24'),_0xc9b7('0x25'),_0xc9b7('0x26'),_0xc9b7('0x27'),'dialQueueProject2',_0xc9b7('0x8'),_0xc9b7('0x28'),_0xc9b7('0x29'),_0xc9b7('0x2a'),_0xc9b7('0x2b'),_0xc9b7('0x2c'),_0xc9b7('0x2d'),'dialDropRetryFrequency',_0xc9b7('0x2e'),_0xc9b7('0x2f'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0xc9b7('0x30'),'dialAgentRejectRetryFrequency',_0xc9b7('0x31'),'dialPredictiveIntervalMaxThreshold',_0xc9b7('0x32'),_0xc9b7('0x33'),'dialPreviewRecallmeReminder',_0xc9b7('0x34')],'include':[{'model':_0xc9b7('0x35'),'as':_0xc9b7('0x35'),'attributes':['id','name','callerid',_0xc9b7('0x36')]},{'model':_0xc9b7('0x37'),'as':_0xc9b7('0x38'),'attributes':['id',_0xc9b7('0x4')]},{'model':_0xc9b7('0x35'),'as':'TrunkBackup','attributes':['id',_0xc9b7('0x4'),_0xc9b7('0x39'),'active']},{'model':'Interval','as':_0xc9b7('0x3a'),'attributes':['id',_0xc9b7('0x4')],'include':[{'model':_0xc9b7('0x3a'),'as':_0xc9b7('0x3b'),'attributes':['id',_0xc9b7('0x4'),_0xc9b7('0x3c')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index fc55b10..ad6f423 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(_0x3e3944,_0x789cda){var _0x42aa47=function(_0x362468){while(--_0x362468){_0x3e3944['push'](_0x3e3944['shift']());}};_0x42aa47(++_0x789cda);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0xf24848,_0x3d69fe){var _0x2e9a97=function(_0x41b9b4){while(--_0x41b9b4){_0xf24848['push'](_0xf24848['shift']());}};_0x2e9a97(++_0x3d69fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 da8a078..2bf8a0d 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 _0x18ad=['../client','getVoiceQueueRtPauses','Request'];(function(_0x4bb244,_0x4fe34f){var _0x5a4904=function(_0x21f640){while(--_0x21f640){_0x4bb244['push'](_0x4bb244['shift']());}};_0x5a4904(++_0x4fe34f);}(_0x18ad,0x1e6));var _0xd18a=function(_0xd8a8af,_0x1e93f0){_0xd8a8af=_0xd8a8af-0x0;var _0x5b7278=_0x18ad[_0xd8a8af];return _0x5b7278;};'use strict';var client=require(_0xd18a('0x0'));exports[_0xd18a('0x1')]=function(_0x3fdb67){return function(){return client[_0xd18a('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x3fdb67,'paused':!![]},'raw':!![]},'log':_0xd18a('0x1')});};}; \ No newline at end of file +var _0x268b=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0xa5415f,_0x365a28){var _0x1afb2f=function(_0x1c5010){while(--_0x1c5010){_0xa5415f['push'](_0xa5415f['shift']());}};_0x1afb2f(++_0x365a28);}(_0x268b,0x16d));var _0xb268=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0x268b[_0x2bc1fe];return _0x1a47a5;};'use strict';var client=require(_0xb268('0x0'));exports[_0xb268('0x1')]=function(_0x4cf90f){return function(){return client['Request'](_0xb268('0x2'),{'options':{'where':{'VoiceQueueId':_0x4cf90f,'paused':!![]},'raw':!![]},'log':_0xb268('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index ba8af2a..fadabee 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x62f51e,_0x1de9d8){var _0x51e512=function(_0x55984c){while(--_0x55984c){_0x62f51e['push'](_0x62f51e['shift']());}};_0x51e512(++_0x1de9d8);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x573fc4,_0x1c34db){var _0x5f5dc6=function(_0x3235ea){while(--_0x3235ea){_0x573fc4['push'](_0x573fc4['shift']());}};_0x5f5dc6(++_0x1c34db);}(_0x7a54,0x106));var _0x47a5=function(_0x418f88,_0x455a62){_0x418f88=_0x418f88-0x0;var _0xa0682a=_0x7a54[_0x418f88];return _0xa0682a;};'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 7c59da7..cb7a469 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 _0x6ee0=['origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetcontext','transfertargetlinkedid'];(function(_0x144e3d,_0x49c078){var _0x18d8ab=function(_0x1361f6){while(--_0x1361f6){_0x144e3d['push'](_0x144e3d['shift']());}};_0x18d8ab(++_0x49c078);}(_0x6ee0,0x97));var _0x06ee=function(_0x1b4b15,_0x23a2a4){_0x1b4b15=_0x1b4b15-0x0;var _0x596ead=_0x6ee0[_0x1b4b15];return _0x596ead;};'use strict';var client=require(_0x06ee('0x0'));exports[_0x06ee('0x1')]={};exports[_0x06ee('0x2')]=function(_0x4e96d4){return client[_0x06ee('0x3')](_0x06ee('0x4'),{'body':{'result':_0x4e96d4[_0x06ee('0x5')],'transfererchannel':_0x4e96d4[_0x06ee('0x6')],'transferercalleridnum':_0x4e96d4[_0x06ee('0x7')],'transferercalleridname':_0x4e96d4[_0x06ee('0x8')],'transfererconnectedlinenum':_0x4e96d4[_0x06ee('0x9')],'transfererconnectedlinename':_0x4e96d4[_0x06ee('0xa')],'transfereraccountcode':_0x4e96d4['transfereraccountcode'],'transferercontext':_0x4e96d4[_0x06ee('0xb')],'transfererexten':_0x4e96d4[_0x06ee('0xc')],'transfererlinkedid':_0x4e96d4['transfererlinkedid'],'transfereechannel':_0x4e96d4[_0x06ee('0xd')],'transfereecalleridnum':_0x4e96d4[_0x06ee('0xe')],'transfereecalleridname':_0x4e96d4[_0x06ee('0xf')],'transfereeconnectedlinenum':_0x4e96d4['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x4e96d4[_0x06ee('0x10')],'transfereeaccountcode':_0x4e96d4[_0x06ee('0x11')],'transfereecontext':_0x4e96d4[_0x06ee('0x12')],'transfereeexten':_0x4e96d4[_0x06ee('0x13')],'transfereelinkedid':_0x4e96d4['transfereelinkedid'],'isexternal':_0x4e96d4[_0x06ee('0x14')],'context':_0x4e96d4[_0x06ee('0x15')],'extension':_0x4e96d4[_0x06ee('0x16')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x24fcde){return client[_0x06ee('0x3')](_0x06ee('0x4'),{'body':{'result':_0x24fcde[_0x06ee('0x5')],'transfererchannel':_0x24fcde[_0x06ee('0x17')],'transferercalleridnum':_0x24fcde[_0x06ee('0x18')],'transferercalleridname':_0x24fcde['origtransferercalleridname'],'transfererconnectedlinenum':_0x24fcde[_0x06ee('0x19')],'transfererconnectedlinename':_0x24fcde[_0x06ee('0x1a')],'transfereraccountcode':_0x24fcde['origtransfereraccountcode'],'transferercontext':_0x24fcde[_0x06ee('0x1b')],'transfererexten':_0x24fcde['secondtransfererexten'],'transfererlinkedid':_0x24fcde[_0x06ee('0x1c')],'transfereechannel':_0x24fcde[_0x06ee('0x1d')],'transfereecalleridnum':_0x24fcde[_0x06ee('0x1e')],'transfereecalleridname':_0x24fcde['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x24fcde[_0x06ee('0x1f')],'transfereeconnectedlinename':_0x24fcde['transfertargetconnectedlinename'],'transfereeaccountcode':_0x24fcde['transfertargetaccountcode'],'transfereecontext':_0x24fcde[_0x06ee('0x20')],'transfereeexten':_0x24fcde['transfertargetexten'],'transfereelinkedid':_0x24fcde[_0x06ee('0x21')],'isexternal':_0x24fcde[_0x06ee('0x14')],'context':_0x24fcde[_0x06ee('0x22')],'extension':_0x24fcde[_0x06ee('0x23')],'type':_0x06ee('0x24')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xc4cb=['transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','blind','attendedTransfer','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','isexternal','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname'];(function(_0x13f96d,_0x22405e){var _0x36855d=function(_0x559687){while(--_0x559687){_0x13f96d['push'](_0x13f96d['shift']());}};_0x36855d(++_0x22405e);}(_0xc4cb,0x1b0));var _0xbc4c=function(_0x5f3cab,_0x1b523d){_0x5f3cab=_0x5f3cab-0x0;var _0x2db243=_0xc4cb[_0x5f3cab];return _0x2db243;};'use strict';var client=require('../client');exports[_0xbc4c('0x0')]={};exports[_0xbc4c('0x1')]=function(_0x2b6515){return client[_0xbc4c('0x2')](_0xbc4c('0x3'),{'body':{'result':_0x2b6515[_0xbc4c('0x4')],'transfererchannel':_0x2b6515[_0xbc4c('0x5')],'transferercalleridnum':_0x2b6515[_0xbc4c('0x6')],'transferercalleridname':_0x2b6515[_0xbc4c('0x7')],'transfererconnectedlinenum':_0x2b6515['transfererconnectedlinenum'],'transfererconnectedlinename':_0x2b6515['transfererconnectedlinename'],'transfereraccountcode':_0x2b6515[_0xbc4c('0x8')],'transferercontext':_0x2b6515['transferercontext'],'transfererexten':_0x2b6515[_0xbc4c('0x9')],'transfererlinkedid':_0x2b6515[_0xbc4c('0xa')],'transfereechannel':_0x2b6515[_0xbc4c('0xb')],'transfereecalleridnum':_0x2b6515[_0xbc4c('0xc')],'transfereecalleridname':_0x2b6515[_0xbc4c('0xd')],'transfereeconnectedlinenum':_0x2b6515[_0xbc4c('0xe')],'transfereeconnectedlinename':_0x2b6515[_0xbc4c('0xf')],'transfereeaccountcode':_0x2b6515[_0xbc4c('0x10')],'transfereecontext':_0x2b6515[_0xbc4c('0x11')],'transfereeexten':_0x2b6515[_0xbc4c('0x12')],'transfereelinkedid':_0x2b6515[_0xbc4c('0x13')],'isexternal':_0x2b6515['isexternal'],'context':_0x2b6515['context'],'extension':_0x2b6515['extension'],'type':_0xbc4c('0x14')},'log':'CreateVoiceTransferReport'});};exports[_0xbc4c('0x15')]=function(_0xa718df){return client['Request'](_0xbc4c('0x3'),{'body':{'result':_0xa718df[_0xbc4c('0x4')],'transfererchannel':_0xa718df['origtransfererchannel'],'transferercalleridnum':_0xa718df[_0xbc4c('0x16')],'transferercalleridname':_0xa718df['origtransferercalleridname'],'transfererconnectedlinenum':_0xa718df[_0xbc4c('0x17')],'transfererconnectedlinename':_0xa718df[_0xbc4c('0x18')],'transfereraccountcode':_0xa718df[_0xbc4c('0x19')],'transferercontext':_0xa718df[_0xbc4c('0x1a')],'transfererexten':_0xa718df[_0xbc4c('0x1b')],'transfererlinkedid':_0xa718df[_0xbc4c('0x1c')],'transfereechannel':_0xa718df[_0xbc4c('0x1d')],'transfereecalleridnum':_0xa718df[_0xbc4c('0x1e')],'transfereecalleridname':_0xa718df['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xa718df[_0xbc4c('0x1f')],'transfereeconnectedlinename':_0xa718df[_0xbc4c('0x20')],'transfereeaccountcode':_0xa718df[_0xbc4c('0x21')],'transfereecontext':_0xa718df[_0xbc4c('0x22')],'transfereeexten':_0xa718df[_0xbc4c('0x23')],'transfereelinkedid':_0xa718df['transfertargetlinkedid'],'isexternal':_0xa718df[_0xbc4c('0x24')],'context':_0xa718df[_0xbc4c('0x25')],'extension':_0xa718df[_0xbc4c('0x26')],'type':_0xbc4c('0x27')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 9feaf70..31764ca 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 _0x6ec2=['error','asterisk','username','ami\x20disconnected','join','module','action','Reload','Action','message','pick','command','Command','content','catch','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','channel','%s.%s','filename','uniqueid','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','map','resolve','then','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','emit','custom:','event','faxAccounts','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../properties','../ami','listen','format','SIP','name','timers','timer','updateAcw','agents','QueuePause','isConnected'];(function(_0xf95b3d,_0x21bb40){var _0x324cf5=function(_0x1e8d34){while(--_0x1e8d34){_0xf95b3d['push'](_0xf95b3d['shift']());}};_0x324cf5(++_0x21bb40);}(_0x6ec2,0x78));var _0x26ec=function(_0x312d9f,_0x4ce869){_0x312d9f=_0x312d9f-0x0;var _0x27589a=_0x6ec2[_0x312d9f];return _0x27589a;};'use strict';var _=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var jayson=require(_0x26ec('0x2'));var schema=require(_0x26ec('0x3'));var BPromise=require(_0x26ec('0x4'));var moment=require(_0x26ec('0x5'));var config=require('../../../config/environment');var properties=require(_0x26ec('0x6'));var ami=require(_0x26ec('0x7'));exports[_0x26ec('0x8')]=function(_0x13f29c,_0x375e01,_0x4ce209){return new BPromise(function(_0x3b5955,_0x4e8781){var _0x4cadb0={'QueuePause':function(_0xf2cd1d){return new Promise(function(_0x2802e7,_0x14c6ae){var _0x4a70c4=util[_0x26ec('0x9')]('%s/%s',_0x26ec('0xa'),_0xf2cd1d[_0x26ec('0xb')]);if(_0x13f29c[_0x26ec('0xc')]&&_0x13f29c[_0x26ec('0xc')][_0x4a70c4]&&_0x13f29c[_0x26ec('0xc')][_0x4a70c4][_0x26ec('0xd')]){_0x13f29c[_0x26ec('0xc')][_0x4a70c4][_0x26ec('0xe')]();}if(_0x13f29c[_0x26ec('0xf')][_0x4a70c4]){_0x13f29c[_0x26ec('0xf')][_0x4a70c4]['updateStatusRealtime']({'statePause':_0xf2cd1d['pause']?!![]:![]});}_0x2802e7({'code':0xc8,'message':_0x26ec('0x10')});});},'Reload':function(_0x1bec27){var _0x1149fb=this;return new Promise(function(_0x25ba7c,_0x4142fe){if(ami[_0x26ec('0x11')]()==![]){return _0x4142fe(_0x1149fb[_0x26ec('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x26ec('0x13')][_0x26ec('0x14')],_0x26ec('0x15')][_0x26ec('0x16')]('\x20')));}_0x1bec27=_['pick'](_0x1bec27,_['keys'](properties[_0x26ec('0x17')]));_0x1bec27[_0x26ec('0x18')]=_0x26ec('0x19');return ami[_0x26ec('0x1a')](_0x1bec27)['then'](function(_0x17282d){_0x25ba7c({'code':0xc8,'message':_0x17282d[_0x26ec('0x1b')]});})['catch'](function(_0x5ef1e5){_0x4142fe(_0x1149fb['error'](0x1f5,_0x5ef1e5[_0x26ec('0x1b')]));});});},'Command':function(_0x38516d){var _0x60511e=this;return new Promise(function(_0x4f6eb5,_0x4ad50c){if(ami[_0x26ec('0x11')]()==![]){return _0x4ad50c(_0x60511e[_0x26ec('0x12')](0x1f4,[config[_0x26ec('0x13')]['ip'],config[_0x26ec('0x13')][_0x26ec('0x14')],_0x26ec('0x15')]['join']('\x20')));}_0x38516d=_[_0x26ec('0x1c')](_0x38516d,_0x26ec('0x1d'));_0x38516d[_0x26ec('0x18')]=_0x26ec('0x1e');return ami[_0x26ec('0x1a')](_0x38516d)['then'](function(_0x5202e6){_0x4f6eb5({'code':0xc8,'message':_0x5202e6[_0x26ec('0x1f')]});})[_0x26ec('0x20')](function(_0x65aea3){_0x4ad50c(_0x60511e['error'](0x1f5,_0x65aea3['message']));});});},'VoiceQueues':function(_0x19cadf){return new Promise(function(_0xaf6c39,_0x16aba4){var _0x365fac=[];for(var _0x4030ea in _0x13f29c[_0x26ec('0x21')]){if(_0x13f29c[_0x26ec('0x21')]['hasOwnProperty'](_0x4030ea)){var _0x50fedc=_0x13f29c['voiceQueues'][_0x4030ea];var _0x45509f={'id':_0x50fedc['id'],'name':_0x50fedc[_0x26ec('0xb')],'strategy':_0x50fedc[_0x26ec('0x22')],'answered':_0x50fedc[_0x26ec('0x23')],'available':_0x50fedc[_0x26ec('0x24')],'loggedIn':_0x50fedc[_0x26ec('0x25')],'pTalking':_0x50fedc[_0x26ec('0x26')],'sumBillable':_0x50fedc['sumBillable'],'sumDuration':_0x50fedc[_0x26ec('0x27')],'sumHoldTime':_0x50fedc['sumHoldTime']||0x0,'talking':_0x50fedc[_0x26ec('0x28')],'total':_0x50fedc[_0x26ec('0x29')],'type':_0x50fedc['type'],'unmanaged':_0x50fedc[_0x26ec('0x2a')],'abandoned':_0x50fedc[_0x26ec('0x2b')],'waiting':_0x50fedc[_0x26ec('0x2c')],'loggedInDb':_0x50fedc[_0x26ec('0x2d')]};if(_0x50fedc[_0x26ec('0x2e')]===_0x26ec('0x2f')){_0x45509f['dialActive']=_0x50fedc[_0x26ec('0x30')];_0x45509f['dialMethod']=_0x50fedc[_0x26ec('0x31')];_0x45509f['dialOriginateCallerIdName']=_0x50fedc[_0x26ec('0x32')];_0x45509f[_0x26ec('0x33')]=_0x50fedc['dialOriginateCallerIdNumber'];_0x45509f[_0x26ec('0x34')]=_0x50fedc[_0x26ec('0x34')];_0x45509f[_0x26ec('0x35')]=_0x50fedc[_0x26ec('0x35')];_0x45509f[_0x26ec('0x36')]=_0x50fedc[_0x26ec('0x36')];_0x45509f['outboundAnswerAgiCallsDay']=_0x50fedc['outboundAnswerAgiCallsDay'];_0x45509f['outboundAnswerCallsDay']=_0x50fedc['outboundAnswerCallsDay'];_0x45509f['outboundBlacklistCallsDay']=_0x50fedc[_0x26ec('0x37')];_0x45509f[_0x26ec('0x38')]=_0x50fedc[_0x26ec('0x38')];_0x45509f[_0x26ec('0x39')]=_0x50fedc[_0x26ec('0x39')];_0x45509f['outboundDropCallsDayACS']=_0x50fedc[_0x26ec('0x3a')];_0x45509f[_0x26ec('0x3b')]=_0x50fedc[_0x26ec('0x3b')];_0x45509f[_0x26ec('0x3c')]=_0x50fedc[_0x26ec('0x3c')];_0x45509f['outboundNoAnswerCallsDay']=_0x50fedc[_0x26ec('0x3d')];_0x45509f[_0x26ec('0x3e')]=_0x50fedc[_0x26ec('0x3e')];_0x45509f[_0x26ec('0x3f')]=_0x50fedc[_0x26ec('0x3f')];_0x45509f[_0x26ec('0x40')]=_0x50fedc[_0x26ec('0x40')];_0x45509f[_0x26ec('0x41')]=_0x50fedc[_0x26ec('0x41')];_0x45509f[_0x26ec('0x42')]=_0x50fedc['outboundUnknownCallsDay'];_0x45509f['predictiveIntervalAnsweredCalls']=_0x50fedc[_0x26ec('0x43')];_0x45509f[_0x26ec('0x44')]=_0x50fedc['predictiveIntervalAvgHoldtime'];_0x45509f[_0x26ec('0x45')]=_0x50fedc['predictiveIntervalAvgTalktime'];_0x45509f[_0x26ec('0x46')]=_0x50fedc[_0x26ec('0x46')];_0x45509f[_0x26ec('0x47')]=_0x50fedc[_0x26ec('0x47')];_0x45509f[_0x26ec('0x48')]=_0x50fedc[_0x26ec('0x48')];_0x45509f['predictiveIntervalErlangCallsDroppedCalls']=_0x50fedc[_0x26ec('0x49')];_0x45509f[_0x26ec('0x4a')]=_0x50fedc[_0x26ec('0x4a')];_0x45509f[_0x26ec('0x4b')]=_0x50fedc[_0x26ec('0x4b')];_0x45509f[_0x26ec('0x4c')]=_0x50fedc[_0x26ec('0x4c')];_0x45509f[_0x26ec('0x4d')]=_0x50fedc[_0x26ec('0x4d')];_0x45509f[_0x26ec('0x4e')]=_0x50fedc[_0x26ec('0x4e')];_0x45509f[_0x26ec('0x1b')]=_0x50fedc[_0x26ec('0x1b')];_0x45509f[_0x26ec('0x4f')]=_0x50fedc[_0x26ec('0x4f')];_0x45509f['erlangCalls']=_0x50fedc[_0x26ec('0x50')];_0x45509f[_0x26ec('0x51')]=_0x50fedc[_0x26ec('0x51')];_0x45509f[_0x26ec('0x52')]=_0x50fedc[_0x26ec('0x52')];_0x45509f[_0x26ec('0x53')]=_0x50fedc['erlangBusyFactor'];_0x45509f['startPredictive']=_0x50fedc[_0x26ec('0x54')];_0x45509f['startProgressive']=_0x50fedc[_0x26ec('0x55')];}if(_0x50fedc[_0x26ec('0x56')]){_0x45509f[_0x26ec('0x56')]={'id':_0x50fedc[_0x26ec('0x56')]['id'],'name':_0x50fedc[_0x26ec('0x56')][_0x26ec('0xb')],'active':_0x50fedc[_0x26ec('0x56')][_0x26ec('0x57')],'callerid':_0x50fedc['Trunk'][_0x26ec('0x58')]};}if(_0x50fedc[_0x26ec('0x59')]){_0x45509f[_0x26ec('0x59')]={'id':_0x50fedc['Interval']['id'],'name':_0x50fedc[_0x26ec('0x59')][_0x26ec('0xb')]};}_0x365fac[_0x26ec('0x5a')](_0x45509f);}}_0xaf6c39({'count':_0x365fac[_0x26ec('0x5b')],'rows':_0x365fac});});},'UpdateVoiceQueue':function(_0xe89d5f){return new Promise(function(_0x1d698b,_0x42724f){var _0xbfc5a2=_[_0x26ec('0x5c')](_0x13f29c[_0x26ec('0x21')],{'id':parseInt(_0xe89d5f['id'])});var _0x211947=_[_0x26ec('0x5d')](_0xe89d5f,['id']);if(_0xbfc5a2){for(var _0x2950bd in _0x211947){if(typeof _0x211947[_0x2950bd]!==_0x26ec('0x5e')&&typeof _0xbfc5a2[_0x2950bd]!=='undefined'){_0xbfc5a2[_0x2950bd]=_0x211947[_0x2950bd];}}_0x1d698b(_0xbfc5a2);}else{_0x42724f();}});},'VoiceChannels':function(_0x59cda3){return new Promise(function(_0x121e2f,_0x5be55c){var _0x4f873e=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0x60')]);_0x121e2f({'count':_0x4f873e[_0x26ec('0x5b')],'rows':_0x4f873e});});},'VoiceChannelMixMonitor':function(_0x551045){var _0x4a5ce1=this;return new Promise(function(_0x5edd85,_0x534a11){if(ami[_0x26ec('0x11')]()==![]){return _0x534a11(_0x4a5ce1['error'](0x1f4,[config[_0x26ec('0x13')]['ip'],config[_0x26ec('0x13')]['username'],'ami\x20disconnected'][_0x26ec('0x16')]('\x20')));}var _0x2d5866=schema(properties['voicechannel'])[_0x26ec('0x3')](_0x551045);if(_0x2d5866[_0x26ec('0x5b')]>0x0){return _0x534a11(_0x4a5ce1['error'](0x1f4,_['map'](_0x2d5866,_0x26ec('0x1b'))[_0x26ec('0x16')](',\x20')));}var _0x10a4f3=_['find'](_0x13f29c[_0x26ec('0x60')],{'uniqueid':_0x551045['uniqueid']});if(_0x10a4f3&&_0x10a4f3[_0x26ec('0x61')]){var _0x179f9f=util[_0x26ec('0x9')](_0x26ec('0x62'),_0x551045[_0x26ec('0x63')]||_0x551045[_0x26ec('0x64')],_0x551045['format']||_0x26ec('0x65'));return ami[_0x26ec('0x1a')]({'action':'MixMonitor','channel':_0x10a4f3[_0x26ec('0x61')],'file':_0x179f9f,'options':_0x26ec('0x66')})['then'](function(_0x316416){var _0x47b2e9=_['find'](_0x10a4f3[_0x26ec('0x67')],{'filename':_0x26ec('0x68')+_0x179f9f[_0x26ec('0x69')]()});if(_['isNil'](_0x47b2e9)){_0x10a4f3['monitors'][_0x26ec('0x5a')]({'filename':_0x26ec('0x68')+_0x179f9f[_0x26ec('0x69')](),'createdAt':moment()['format'](_0x26ec('0x6a')),'mixmonitorid':_0x316416[_0x26ec('0x6b')],'status':'rec'});}else{_0x47b2e9['mixmonitorid']=_0x316416[_0x26ec('0x6b')];_0x47b2e9['status']=_0x26ec('0x6c');}_0x5edd85({'code':0xc8,'message':[_0x551045[_0x26ec('0x64')],_0x26ec('0x6d'),_0x316416[_0x26ec('0x6b')]]['join']('\x20'),'mixmonitorid':_0x316416['mixmonitorid']});})[_0x26ec('0x20')](function(_0xad1ee7){_0x534a11(_0x4a5ce1[_0x26ec('0x12')](0x1f5,[_0x551045[_0x26ec('0x64')],_0xad1ee7[_0x26ec('0x1b')][_0x26ec('0x69')]()][_0x26ec('0x16')]('\x20')));});}else{return _0x534a11(_0x4a5ce1['error'](0x1f5,_0x26ec('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x4a67e4){var _0x41d0fa=this;return new Promise(function(_0x2e77a9,_0x2e0c77){if(ami[_0x26ec('0x11')]()==![]){return _0x2e0c77(_0x41d0fa[_0x26ec('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x26ec('0x13')][_0x26ec('0x14')],_0x26ec('0x15')][_0x26ec('0x16')]('\x20')));}var _0x53ffa5=schema(properties[_0x26ec('0x6f')])[_0x26ec('0x3')](_0x4a67e4);if(_0x53ffa5['length']>0x0){return _0x2e0c77(_0x41d0fa[_0x26ec('0x12')](0x1f4,_[_0x26ec('0x70')](_0x53ffa5,_0x26ec('0x1b'))[_0x26ec('0x16')](',\x20')));}var _0x2a9c55=_[_0x26ec('0x5c')](_0x13f29c[_0x26ec('0x60')],{'uniqueid':_0x4a67e4['uniqueid']});if(_0x2a9c55){return BPromise[_0x26ec('0x71')]()[_0x26ec('0x72')](function(){if(_0x2a9c55['channel']){return ami[_0x26ec('0x1a')]({'action':_0x26ec('0x73'),'channel':_0x2a9c55[_0x26ec('0x61')],'mixmonitorid':_0x4a67e4[_0x26ec('0x6b')]})[_0x26ec('0x20')](function(_0x3ba1c8){});}})[_0x26ec('0x72')](function(){if(_0x2a9c55[_0x26ec('0x74')]){return ami[_0x26ec('0x1a')]({'action':_0x26ec('0x73'),'channel':_0x2a9c55[_0x26ec('0x74')],'mixmonitorid':_0x4a67e4[_0x26ec('0x6b')]})[_0x26ec('0x20')](function(_0x35bac1){});}})[_0x26ec('0x72')](function(_0x4a8769){var _0x504aa6=_['find'](_0x2a9c55['monitors'],{'mixmonitorid':_0x4a67e4[_0x26ec('0x6b')]});if(_0x504aa6){_0x504aa6[_0x26ec('0x75')]=_0x26ec('0x76');}})['then'](function(){var _0x1ae4a5=util['format'](_0x26ec('0x62'),_0x4a67e4[_0x26ec('0x63')]||_0x4a67e4[_0x26ec('0x64')],_0x4a67e4['format']||_0x26ec('0x65'));var _0x2579c2=_[_0x26ec('0x5c')](_0x2a9c55[_0x26ec('0x67')],{'filename':_0x26ec('0x68')+_0x1ae4a5['toLowerCase']()});if(_0x2579c2){_0x2579c2[_0x26ec('0x75')]=_0x26ec('0x76');}})['then'](function(){_0x2e77a9({'code':0xc8,'message':[_0x4a67e4[_0x26ec('0x64')],_0x26ec('0x77')][_0x26ec('0x16')]('\x20')});})['catch'](function(_0x29aac1){_0x2e0c77(_0x41d0fa[_0x26ec('0x12')](0x1f5,[_0x4a67e4[_0x26ec('0x64')],_0x29aac1[_0x26ec('0x1b')][_0x26ec('0x69')]()][_0x26ec('0x16')]('\x20')));});}else{return _0x2e0c77(_0x41d0fa[_0x26ec('0x12')](0x1f5,_0x26ec('0x6e')));}});},'VoiceQueuesChannels':function(_0x1bb8ea){return new Promise(function(_0x2e283e,_0x1ab092){var _0x6ab7d4=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0x78')]);_0x2e283e({'count':_0x6ab7d4[_0x26ec('0x5b')],'rows':_0x6ab7d4});});},'VoiceQueuesChannel':function(_0x463cba){var _0x5d4514=this;return new Promise(function(_0x483cec,_0x1abe14){var _0x3596d3=schema(properties[_0x26ec('0x79')])[_0x26ec('0x3')](_0x463cba);if(_0x3596d3[_0x26ec('0x5b')]>0x0){return _0x1abe14(_0x5d4514[_0x26ec('0x12')](0x1f4,_['map'](_0x3596d3,_0x26ec('0x1b'))[_0x26ec('0x16')](',\x20')));}var _0x474cf3=_[_0x26ec('0x5c')](_0x13f29c[_0x26ec('0x78')],{'uniqueid':_0x463cba[_0x26ec('0x64')]});if(_0x474cf3){_0x483cec(_0x474cf3);}else{return _0x1abe14(_0x5d4514[_0x26ec('0x12')](0x1f5,_0x26ec('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x8f92bf){var _0x19245c=this;return new Promise(function(_0x3e777c,_0x5db03e){if(ami[_0x26ec('0x11')]()==![]){return _0x5db03e(_0x19245c[_0x26ec('0x12')](0x1f4,[config[_0x26ec('0x13')]['ip'],config['asterisk'][_0x26ec('0x14')],_0x26ec('0x15')]['join']('\x20')));}var _0x1c2155=schema(properties['voicequeuechannelhangup'])[_0x26ec('0x3')](_0x8f92bf);if(_0x1c2155[_0x26ec('0x5b')]>0x0){return _0x5db03e(_0x19245c[_0x26ec('0x12')](0x1f4,_[_0x26ec('0x70')](_0x1c2155,_0x26ec('0x1b'))[_0x26ec('0x16')](',\x20')));}var _0x504b25=_[_0x26ec('0x5c')](_0x13f29c[_0x26ec('0x78')],{'uniqueid':_0x8f92bf['uniqueid']});if(_0x504b25&&_0x504b25[_0x26ec('0x61')]){return ami[_0x26ec('0x1a')]({'action':'Hangup','channel':_0x504b25[_0x26ec('0x61')]})['then'](function(_0x461820){_0x3e777c({'code':0xc8,'message':[_0x8f92bf[_0x26ec('0x64')],_0x461820['message'][_0x26ec('0x69')]()][_0x26ec('0x16')]('\x20')});})['catch'](function(_0x12fd59){_0x5db03e(_0x19245c[_0x26ec('0x12')](0x1f5,[_0x8f92bf[_0x26ec('0x64')],_0x12fd59[_0x26ec('0x1b')][_0x26ec('0x69')]()][_0x26ec('0x16')]('\x20')));});}else{return _0x5db03e(_0x19245c[_0x26ec('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x423015){var _0x367f19=this;return new Promise(function(_0x5781bb,_0x511bc7){if(ami['isConnected']()==![]){return _0x511bc7(_0x367f19[_0x26ec('0x12')](0x1f4,[config[_0x26ec('0x13')]['ip'],config[_0x26ec('0x13')]['username'],_0x26ec('0x15')][_0x26ec('0x16')]('\x20')));}var _0x32a7f1=schema(properties[_0x26ec('0x7a')])[_0x26ec('0x3')](_0x423015);if(_0x32a7f1[_0x26ec('0x5b')]>0x0){return _0x511bc7(_0x367f19[_0x26ec('0x12')](0x1f4,_['map'](_0x32a7f1,_0x26ec('0x1b'))[_0x26ec('0x16')](',\x20')));}var _0x1385e4=_[_0x26ec('0x5c')](_0x13f29c[_0x26ec('0x78')],{'uniqueid':_0x423015[_0x26ec('0x64')]});if(_0x1385e4&&_0x1385e4[_0x26ec('0x61')]){return ami[_0x26ec('0x1a')]({'action':_0x26ec('0x7b'),'channel':_0x1385e4[_0x26ec('0x61')],'exten':_0x423015[_0x26ec('0x7c')],'context':_0x423015[_0x26ec('0x7d')]||_0x1385e4[_0x26ec('0x7d')],'priority':0x1})[_0x26ec('0x72')](function(_0x3ed214){_0x5781bb({'code':0xc8,'message':[_0x423015[_0x26ec('0x64')],_0x3ed214[_0x26ec('0x1b')][_0x26ec('0x69')]()][_0x26ec('0x16')]('\x20')});})[_0x26ec('0x20')](function(_0x3d197f){_0x511bc7(_0x367f19[_0x26ec('0x12')](0x1f5,[_0x423015[_0x26ec('0x64')],_0x3d197f[_0x26ec('0x1b')][_0x26ec('0x69')]()][_0x26ec('0x16')]('\x20')));});}else{return _0x511bc7(_0x367f19['error'](0x1f5,_0x26ec('0x6e')));}});},'Agents':function(_0x6bb743){return new Promise(function(_0x42ae13,_0x2fd410){var _0xe558f4=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0xf')]);_0x42ae13({'count':_0xe558f4[_0x26ec('0x5b')],'rows':_0xe558f4});});},'Telephones':function(_0x3c1f1c){return new Promise(function(_0x54d0f3,_0x2309b3){var _0x3ce8eb=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0x7e')]);_0x54d0f3({'count':_0x3ce8eb[_0x26ec('0x5b')],'rows':_0x3ce8eb});});},'Trunks':function(_0x9eaa77){return new Promise(function(_0x13ca0b,_0x44f706){var _0x55b0fb=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0x7f')]);_0x13ca0b({'count':_0x55b0fb['length'],'rows':_0x55b0fb});});},'OutboundChannels':function(_0x2b14c8){return new Promise(function(_0xa3ca2,_0x5d3e6b){var _0x57c1ea=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0x80')]);_0xa3ca2({'count':_0x57c1ea[_0x26ec('0x5b')],'rows':_0x57c1ea});});},'Outbound':function(_0x45c2d9){return new Promise(function(_0x1ee360,_0x63d051){_0x1ee360(_0x13f29c[_0x26ec('0x2f')]);});},'Campaigns':function(_0x100554){return new Promise(function(_0xbac8ed,_0x33b422){var _0x5c604c=_[_0x26ec('0x5f')](_0x13f29c['campaigns']);_0xbac8ed({'count':_0x5c604c[_0x26ec('0x5b')],'rows':_0x5c604c});});},'VoiceQueuesPreview':function(_0x4dd8f6){var _0x5945a9=this;return new Promise(function(_0x5637f6,_0x49e271){_0x375e01[_0x26ec('0x81')](_0x4dd8f6['id'])[_0x26ec('0x72')](function(_0xb6c857){_0x5637f6({'code':0xc8,'message':_0xb6c857[_0x26ec('0x1b')]});})[_0x26ec('0x20')](function(_0x4a394e){_0x49e271(_0x5945a9['error'](0x1f4,_0x4a394e['message']));});});},'EventManager':function(_0xab5773){var _0x39a003=this;return new Promise(function(_0x20b9ae,_0x3b832a){if(!_0xab5773['event']){return _0x3b832a(_0x39a003[_0x26ec('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x26ec('0x82')](_0x26ec('0x83')+_0xab5773[_0x26ec('0x84')],_0xab5773[_0x26ec('0x1b')]);_0x20b9ae({'code':0xc8,'message':_0xab5773});});},'FaxAccounts':function(_0x88de21){return new Promise(function(_0x5e5870,_0x408d88){var _0x5aadb0=_[_0x26ec('0x5f')](_0x13f29c[_0x26ec('0x85')]);_0x5e5870({'count':_0x5aadb0[_0x26ec('0x5b')],'rows':_0x5aadb0});});},'SendFax':function(_0x554a01){var _0x3df968=this;return new Promise(function(_0x49a672,_0x3440c3){_0x4ce209['send'](_0x554a01)[_0x26ec('0x72')](function(_0x357f2f){_0x49a672({'code':0xc8,'message':_0x357f2f[_0x26ec('0x1b')]});})[_0x26ec('0x20')](function(_0x481ed7){_0x3440c3(_0x3df968[_0x26ec('0x12')](0x1f4,_0x481ed7['message']));});});},'CheckAfterSend':function(_0x2cefa0){var _0x39b8df=this;return new Promise(function(_0x1f3972,_0x4bf4ac){_0x4ce209['checkAfterSend'](_0x2cefa0)[_0x26ec('0x72')](function(_0x1497b8){_0x1f3972({'code':0xc8,'message':_0x1497b8[_0x26ec('0x1b')]});})[_0x26ec('0x20')](function(_0x4f3bbb){_0x4bf4ac(_0x39b8df['error'](0x1f4,_0x4f3bbb[_0x26ec('0x1b')]));});});}};var _0x4aa432=jayson[_0x26ec('0x86')](_0x4cadb0)['http']();_0x4aa432['on'](_0x26ec('0x12'),function(_0x4da032){return _0x4e8781(_0x4da032);});_0x4aa432[_0x26ec('0x8')](0x232a,_0x26ec('0x87'),function(){console[_0x26ec('0x88')](_0x26ec('0x89'),0x232a);return _0x3b5955('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x4873=['erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','channel','%s.%s','filename','uniqueid','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','ami\x20disconnected','validate','resolve','StopMixMonitor','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','../properties','../ami','listen','format','SIP','timers','updateAcw','agents','QueuePause','isConnected','asterisk','username','join','pick','keys','module','action','Reload','Action','then','message','catch','error','command','Command','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','type','outbound','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond'];(function(_0x650e11,_0x284f86){var _0x1a9b47=function(_0x6e15e3){while(--_0x6e15e3){_0x650e11['push'](_0x650e11['shift']());}};_0x1a9b47(++_0x284f86);}(_0x4873,0x1df));var _0x3487=function(_0x534d2f,_0x598e1e){_0x534d2f=_0x534d2f-0x0;var _0x48cf8c=_0x4873[_0x534d2f];return _0x48cf8c;};'use strict';var _=require(_0x3487('0x0'));var util=require(_0x3487('0x1'));var jayson=require(_0x3487('0x2'));var schema=require('validate');var BPromise=require(_0x3487('0x3'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x3487('0x4'));var ami=require(_0x3487('0x5'));exports[_0x3487('0x6')]=function(_0x1d6d6c,_0x2fc292,_0xbe12a4){return new BPromise(function(_0x2611dc,_0x193589){var _0x4a2407={'QueuePause':function(_0x1d4cae){return new Promise(function(_0x3df081,_0x1d0487){var _0x3be031=util[_0x3487('0x7')]('%s/%s',_0x3487('0x8'),_0x1d4cae['name']);if(_0x1d6d6c[_0x3487('0x9')]&&_0x1d6d6c[_0x3487('0x9')][_0x3be031]&&_0x1d6d6c['timers'][_0x3be031]['timer']){_0x1d6d6c[_0x3487('0x9')][_0x3be031][_0x3487('0xa')]();}if(_0x1d6d6c['agents'][_0x3be031]){_0x1d6d6c[_0x3487('0xb')][_0x3be031]['updateStatusRealtime']({'statePause':_0x1d4cae['pause']?!![]:![]});}_0x3df081({'code':0xc8,'message':_0x3487('0xc')});});},'Reload':function(_0x1be2e0){var _0x3883c7=this;return new Promise(function(_0x3033b3,_0x8d7a3c){if(ami[_0x3487('0xd')]()==![]){return _0x8d7a3c(_0x3883c7['error'](0x1f4,[config[_0x3487('0xe')]['ip'],config[_0x3487('0xe')][_0x3487('0xf')],'ami\x20disconnected'][_0x3487('0x10')]('\x20')));}_0x1be2e0=_[_0x3487('0x11')](_0x1be2e0,_[_0x3487('0x12')](properties[_0x3487('0x13')]));_0x1be2e0[_0x3487('0x14')]=_0x3487('0x15');return ami[_0x3487('0x16')](_0x1be2e0)[_0x3487('0x17')](function(_0x320894){_0x3033b3({'code':0xc8,'message':_0x320894[_0x3487('0x18')]});})[_0x3487('0x19')](function(_0x41795b){_0x8d7a3c(_0x3883c7[_0x3487('0x1a')](0x1f5,_0x41795b[_0x3487('0x18')]));});});},'Command':function(_0x56f282){var _0x320349=this;return new Promise(function(_0x594ff6,_0x2fd2e8){if(ami[_0x3487('0xd')]()==![]){return _0x2fd2e8(_0x320349[_0x3487('0x1a')](0x1f4,[config[_0x3487('0xe')]['ip'],config[_0x3487('0xe')][_0x3487('0xf')],'ami\x20disconnected'][_0x3487('0x10')]('\x20')));}_0x56f282=_[_0x3487('0x11')](_0x56f282,_0x3487('0x1b'));_0x56f282[_0x3487('0x14')]=_0x3487('0x1c');return ami[_0x3487('0x16')](_0x56f282)['then'](function(_0x384792){_0x594ff6({'code':0xc8,'message':_0x384792[_0x3487('0x1d')]});})[_0x3487('0x19')](function(_0x482551){_0x2fd2e8(_0x320349['error'](0x1f5,_0x482551[_0x3487('0x18')]));});});},'VoiceQueues':function(_0x20be9a){return new Promise(function(_0x2a0b57,_0x3a9d76){var _0x4c6882=[];for(var _0x79a183 in _0x1d6d6c[_0x3487('0x1e')]){if(_0x1d6d6c['voiceQueues'][_0x3487('0x1f')](_0x79a183)){var _0x3fb245=_0x1d6d6c['voiceQueues'][_0x79a183];var _0x59968f={'id':_0x3fb245['id'],'name':_0x3fb245[_0x3487('0x20')],'strategy':_0x3fb245[_0x3487('0x21')],'answered':_0x3fb245[_0x3487('0x22')],'available':_0x3fb245[_0x3487('0x23')],'loggedIn':_0x3fb245[_0x3487('0x24')],'pTalking':_0x3fb245[_0x3487('0x25')],'sumBillable':_0x3fb245[_0x3487('0x26')],'sumDuration':_0x3fb245[_0x3487('0x27')],'sumHoldTime':_0x3fb245[_0x3487('0x28')]||0x0,'talking':_0x3fb245[_0x3487('0x29')],'total':_0x3fb245[_0x3487('0x2a')],'type':_0x3fb245['type'],'unmanaged':_0x3fb245['unmanaged'],'abandoned':_0x3fb245[_0x3487('0x2b')],'waiting':_0x3fb245[_0x3487('0x2c')],'loggedInDb':_0x3fb245['loggedInDb']};if(_0x3fb245[_0x3487('0x2d')]===_0x3487('0x2e')){_0x59968f['dialActive']=_0x3fb245['dialActive'];_0x59968f[_0x3487('0x2f')]=_0x3fb245[_0x3487('0x2f')];_0x59968f[_0x3487('0x30')]=_0x3fb245['dialOriginateCallerIdName'];_0x59968f[_0x3487('0x31')]=_0x3fb245['dialOriginateCallerIdNumber'];_0x59968f['dialOriginateTimeout']=_0x3fb245['dialOriginateTimeout'];_0x59968f[_0x3487('0x32')]=_0x3fb245[_0x3487('0x32')];_0x59968f['temp']=_0x3fb245['temp'];_0x59968f[_0x3487('0x33')]=_0x3fb245['outboundAnswerAgiCallsDay'];_0x59968f['outboundAnswerCallsDay']=_0x3fb245[_0x3487('0x34')];_0x59968f[_0x3487('0x35')]=_0x3fb245[_0x3487('0x35')];_0x59968f['outboundBusyCallsDay']=_0x3fb245[_0x3487('0x36')];_0x59968f[_0x3487('0x37')]=_0x3fb245[_0x3487('0x37')];_0x59968f[_0x3487('0x38')]=_0x3fb245['outboundDropCallsDayACS'];_0x59968f[_0x3487('0x39')]=_0x3fb245[_0x3487('0x39')];_0x59968f['outboundDropCallsDayTimeout']=_0x3fb245[_0x3487('0x3a')];_0x59968f[_0x3487('0x3b')]=_0x3fb245[_0x3487('0x3b')];_0x59968f[_0x3487('0x3c')]=_0x3fb245[_0x3487('0x3c')];_0x59968f[_0x3487('0x3d')]=_0x3fb245[_0x3487('0x3d')];_0x59968f[_0x3487('0x3e')]=_0x3fb245[_0x3487('0x3e')];_0x59968f['outboundRejectCallsDay']=_0x3fb245[_0x3487('0x3f')];_0x59968f[_0x3487('0x40')]=_0x3fb245['outboundUnknownCallsDay'];_0x59968f['predictiveIntervalAnsweredCalls']=_0x3fb245[_0x3487('0x41')];_0x59968f[_0x3487('0x42')]=_0x3fb245[_0x3487('0x42')];_0x59968f['predictiveIntervalAvgTalktime']=_0x3fb245['predictiveIntervalAvgTalktime'];_0x59968f['predictiveIntervalDroppedCallsCallersExit']=_0x3fb245[_0x3487('0x43')];_0x59968f[_0x3487('0x44')]=_0x3fb245['predictiveIntervalDroppedCallsTimeout'];_0x59968f[_0x3487('0x45')]=_0x3fb245[_0x3487('0x45')];_0x59968f[_0x3487('0x46')]=_0x3fb245[_0x3487('0x46')];_0x59968f[_0x3487('0x47')]=_0x3fb245[_0x3487('0x47')];_0x59968f[_0x3487('0x48')]=_0x3fb245[_0x3487('0x48')];_0x59968f[_0x3487('0x49')]=_0x3fb245['predictiveIntervalPauses'];_0x59968f[_0x3487('0x4a')]=_0x3fb245[_0x3487('0x4a')];_0x59968f['predictiveIntervalTotalCalls']=_0x3fb245['predictiveIntervalTotalCalls'];_0x59968f[_0x3487('0x18')]=_0x3fb245['message'];_0x59968f['originated']=_0x3fb245[_0x3487('0x4b')];_0x59968f['erlangCalls']=_0x3fb245['erlangCalls'];_0x59968f[_0x3487('0x4c')]=_0x3fb245[_0x3487('0x4c')];_0x59968f['erlangAbandonmentRate']=_0x3fb245['erlangAbandonmentRate'];_0x59968f[_0x3487('0x4d')]=_0x3fb245[_0x3487('0x4d')];_0x59968f['startPredictive']=_0x3fb245[_0x3487('0x4e')];_0x59968f[_0x3487('0x4f')]=_0x3fb245['startProgressive'];}if(_0x3fb245[_0x3487('0x50')]){_0x59968f[_0x3487('0x50')]={'id':_0x3fb245[_0x3487('0x50')]['id'],'name':_0x3fb245['Trunk'][_0x3487('0x20')],'active':_0x3fb245[_0x3487('0x50')][_0x3487('0x51')],'callerid':_0x3fb245[_0x3487('0x50')][_0x3487('0x52')]};}if(_0x3fb245[_0x3487('0x53')]){_0x59968f[_0x3487('0x53')]={'id':_0x3fb245[_0x3487('0x53')]['id'],'name':_0x3fb245['Interval'][_0x3487('0x20')]};}_0x4c6882[_0x3487('0x54')](_0x59968f);}}_0x2a0b57({'count':_0x4c6882[_0x3487('0x55')],'rows':_0x4c6882});});},'UpdateVoiceQueue':function(_0x2795f3){return new Promise(function(_0x3315da,_0x31e766){var _0x324ebb=_[_0x3487('0x56')](_0x1d6d6c['voiceQueues'],{'id':parseInt(_0x2795f3['id'])});var _0x59f0fa=_[_0x3487('0x57')](_0x2795f3,['id']);if(_0x324ebb){for(var _0x32ddbb in _0x59f0fa){if(typeof _0x59f0fa[_0x32ddbb]!==_0x3487('0x58')&&typeof _0x324ebb[_0x32ddbb]!==_0x3487('0x58')){_0x324ebb[_0x32ddbb]=_0x59f0fa[_0x32ddbb];}}_0x3315da(_0x324ebb);}else{_0x31e766();}});},'VoiceChannels':function(_0x5bff36){return new Promise(function(_0x50b81c,_0x1f373b){var _0x122456=_[_0x3487('0x59')](_0x1d6d6c[_0x3487('0x5a')]);_0x50b81c({'count':_0x122456[_0x3487('0x55')],'rows':_0x122456});});},'VoiceChannelMixMonitor':function(_0x3f46af){var _0x357670=this;return new Promise(function(_0x1cac2c,_0x515e68){if(ami['isConnected']()==![]){return _0x515e68(_0x357670[_0x3487('0x1a')](0x1f4,[config[_0x3487('0xe')]['ip'],config['asterisk'][_0x3487('0xf')],'ami\x20disconnected']['join']('\x20')));}var _0x12ebfc=schema(properties[_0x3487('0x5b')])['validate'](_0x3f46af);if(_0x12ebfc[_0x3487('0x55')]>0x0){return _0x515e68(_0x357670[_0x3487('0x1a')](0x1f4,_[_0x3487('0x5c')](_0x12ebfc,'message')[_0x3487('0x10')](',\x20')));}var _0x56b3fa=_[_0x3487('0x56')](_0x1d6d6c[_0x3487('0x5a')],{'uniqueid':_0x3f46af['uniqueid']});if(_0x56b3fa&&_0x56b3fa[_0x3487('0x5d')]){var _0xb6be79=util[_0x3487('0x7')](_0x3487('0x5e'),_0x3f46af[_0x3487('0x5f')]||_0x3f46af[_0x3487('0x60')],_0x3f46af[_0x3487('0x7')]||'wav');return ami[_0x3487('0x16')]({'action':_0x3487('0x61'),'channel':_0x56b3fa['channel'],'file':_0xb6be79,'options':_0x3487('0x62')})[_0x3487('0x17')](function(_0x3e03e4){var _0x36bae6=_[_0x3487('0x56')](_0x56b3fa[_0x3487('0x63')],{'filename':_0x3487('0x64')+_0xb6be79[_0x3487('0x65')]()});if(_[_0x3487('0x66')](_0x36bae6)){_0x56b3fa[_0x3487('0x63')]['push']({'filename':_0x3487('0x64')+_0xb6be79[_0x3487('0x65')](),'createdAt':moment()[_0x3487('0x7')](_0x3487('0x67')),'mixmonitorid':_0x3e03e4[_0x3487('0x68')],'status':_0x3487('0x69')});}else{_0x36bae6['mixmonitorid']=_0x3e03e4[_0x3487('0x68')];_0x36bae6[_0x3487('0x6a')]='rec';}_0x1cac2c({'code':0xc8,'message':[_0x3f46af['uniqueid'],_0x3487('0x6b'),_0x3e03e4[_0x3487('0x68')]][_0x3487('0x10')]('\x20'),'mixmonitorid':_0x3e03e4[_0x3487('0x68')]});})[_0x3487('0x19')](function(_0x24ce5b){_0x515e68(_0x357670['error'](0x1f5,[_0x3f46af['uniqueid'],_0x24ce5b[_0x3487('0x18')][_0x3487('0x65')]()]['join']('\x20')));});}else{return _0x515e68(_0x357670[_0x3487('0x1a')](0x1f5,_0x3487('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x143d42){var _0x48c4ea=this;return new Promise(function(_0x43a4c5,_0xa278c6){if(ami['isConnected']()==![]){return _0xa278c6(_0x48c4ea['error'](0x1f4,[config[_0x3487('0xe')]['ip'],config[_0x3487('0xe')][_0x3487('0xf')],_0x3487('0x6d')]['join']('\x20')));}var _0x463d65=schema(properties[_0x3487('0x5b')])[_0x3487('0x6e')](_0x143d42);if(_0x463d65[_0x3487('0x55')]>0x0){return _0xa278c6(_0x48c4ea['error'](0x1f4,_['map'](_0x463d65,_0x3487('0x18'))['join'](',\x20')));}var _0x347a8c=_[_0x3487('0x56')](_0x1d6d6c[_0x3487('0x5a')],{'uniqueid':_0x143d42[_0x3487('0x60')]});if(_0x347a8c){return BPromise[_0x3487('0x6f')]()[_0x3487('0x17')](function(){if(_0x347a8c[_0x3487('0x5d')]){return ami[_0x3487('0x16')]({'action':_0x3487('0x70'),'channel':_0x347a8c[_0x3487('0x5d')],'mixmonitorid':_0x143d42[_0x3487('0x68')]})['catch'](function(_0x468064){});}})[_0x3487('0x17')](function(){if(_0x347a8c['destinationchannel']){return ami[_0x3487('0x16')]({'action':'StopMixMonitor','channel':_0x347a8c['destinationchannel'],'mixmonitorid':_0x143d42[_0x3487('0x68')]})[_0x3487('0x19')](function(_0x23a38a){});}})[_0x3487('0x17')](function(_0x3d47c3){var _0x2dcfd2=_[_0x3487('0x56')](_0x347a8c['monitors'],{'mixmonitorid':_0x143d42[_0x3487('0x68')]});if(_0x2dcfd2){_0x2dcfd2[_0x3487('0x6a')]=_0x3487('0x71');}})[_0x3487('0x17')](function(){var _0x1612e5=util[_0x3487('0x7')](_0x3487('0x5e'),_0x143d42[_0x3487('0x5f')]||_0x143d42[_0x3487('0x60')],_0x143d42[_0x3487('0x7')]||'wav');var _0x548e3e=_[_0x3487('0x56')](_0x347a8c['monitors'],{'filename':_0x3487('0x64')+_0x1612e5[_0x3487('0x65')]()});if(_0x548e3e){_0x548e3e[_0x3487('0x6a')]=_0x3487('0x71');}})['then'](function(){_0x43a4c5({'code':0xc8,'message':[_0x143d42[_0x3487('0x60')],_0x3487('0x72')][_0x3487('0x10')]('\x20')});})[_0x3487('0x19')](function(_0x11c4bf){_0xa278c6(_0x48c4ea[_0x3487('0x1a')](0x1f5,[_0x143d42['uniqueid'],_0x11c4bf[_0x3487('0x18')][_0x3487('0x65')]()]['join']('\x20')));});}else{return _0xa278c6(_0x48c4ea[_0x3487('0x1a')](0x1f5,_0x3487('0x6c')));}});},'VoiceQueuesChannels':function(_0xad8256){return new Promise(function(_0x459138,_0x379b7f){var _0x2daca0=_[_0x3487('0x59')](_0x1d6d6c[_0x3487('0x73')]);_0x459138({'count':_0x2daca0[_0x3487('0x55')],'rows':_0x2daca0});});},'VoiceQueuesChannel':function(_0x4180eb){var _0x5469ba=this;return new Promise(function(_0x14c921,_0x5d7d62){var _0x4b2992=schema(properties[_0x3487('0x74')])['validate'](_0x4180eb);if(_0x4b2992[_0x3487('0x55')]>0x0){return _0x5d7d62(_0x5469ba[_0x3487('0x1a')](0x1f4,_[_0x3487('0x5c')](_0x4b2992,'message')[_0x3487('0x10')](',\x20')));}var _0x2e3da3=_[_0x3487('0x56')](_0x1d6d6c['queueChannels'],{'uniqueid':_0x4180eb[_0x3487('0x60')]});if(_0x2e3da3){_0x14c921(_0x2e3da3);}else{return _0x5d7d62(_0x5469ba[_0x3487('0x1a')](0x1f5,_0x3487('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x5b7787){var _0x4bdd41=this;return new Promise(function(_0x168786,_0xd2e056){if(ami[_0x3487('0xd')]()==![]){return _0xd2e056(_0x4bdd41[_0x3487('0x1a')](0x1f4,[config[_0x3487('0xe')]['ip'],config[_0x3487('0xe')][_0x3487('0xf')],_0x3487('0x6d')][_0x3487('0x10')]('\x20')));}var _0xd482a=schema(properties[_0x3487('0x75')])[_0x3487('0x6e')](_0x5b7787);if(_0xd482a[_0x3487('0x55')]>0x0){return _0xd2e056(_0x4bdd41[_0x3487('0x1a')](0x1f4,_[_0x3487('0x5c')](_0xd482a,_0x3487('0x18'))[_0x3487('0x10')](',\x20')));}var _0x33ffb6=_[_0x3487('0x56')](_0x1d6d6c['queueChannels'],{'uniqueid':_0x5b7787[_0x3487('0x60')]});if(_0x33ffb6&&_0x33ffb6[_0x3487('0x5d')]){return ami[_0x3487('0x16')]({'action':_0x3487('0x76'),'channel':_0x33ffb6[_0x3487('0x5d')]})['then'](function(_0x4d97c9){_0x168786({'code':0xc8,'message':[_0x5b7787[_0x3487('0x60')],_0x4d97c9[_0x3487('0x18')][_0x3487('0x65')]()][_0x3487('0x10')]('\x20')});})[_0x3487('0x19')](function(_0x39b3d7){_0xd2e056(_0x4bdd41[_0x3487('0x1a')](0x1f5,[_0x5b7787['uniqueid'],_0x39b3d7[_0x3487('0x18')]['toLowerCase']()]['join']('\x20')));});}else{return _0xd2e056(_0x4bdd41[_0x3487('0x1a')](0x1f5,_0x3487('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x457a78){var _0x44dc2f=this;return new Promise(function(_0x3adaa2,_0x19a455){if(ami[_0x3487('0xd')]()==![]){return _0x19a455(_0x44dc2f[_0x3487('0x1a')](0x1f4,[config[_0x3487('0xe')]['ip'],config[_0x3487('0xe')][_0x3487('0xf')],_0x3487('0x6d')][_0x3487('0x10')]('\x20')));}var _0x11d40c=schema(properties[_0x3487('0x77')])['validate'](_0x457a78);if(_0x11d40c[_0x3487('0x55')]>0x0){return _0x19a455(_0x44dc2f[_0x3487('0x1a')](0x1f4,_[_0x3487('0x5c')](_0x11d40c,_0x3487('0x18'))['join'](',\x20')));}var _0x530c6e=_['find'](_0x1d6d6c[_0x3487('0x73')],{'uniqueid':_0x457a78[_0x3487('0x60')]});if(_0x530c6e&&_0x530c6e[_0x3487('0x5d')]){return ami[_0x3487('0x16')]({'action':_0x3487('0x78'),'channel':_0x530c6e['channel'],'exten':_0x457a78[_0x3487('0x79')],'context':_0x457a78['context']||_0x530c6e[_0x3487('0x7a')],'priority':0x1})[_0x3487('0x17')](function(_0x188aec){_0x3adaa2({'code':0xc8,'message':[_0x457a78[_0x3487('0x60')],_0x188aec[_0x3487('0x18')][_0x3487('0x65')]()][_0x3487('0x10')]('\x20')});})['catch'](function(_0x136789){_0x19a455(_0x44dc2f[_0x3487('0x1a')](0x1f5,[_0x457a78[_0x3487('0x60')],_0x136789[_0x3487('0x18')][_0x3487('0x65')]()][_0x3487('0x10')]('\x20')));});}else{return _0x19a455(_0x44dc2f[_0x3487('0x1a')](0x1f5,_0x3487('0x6c')));}});},'Agents':function(_0x2dce91){return new Promise(function(_0x8d3164,_0x2f5012){var _0x3b0540=_['values'](_0x1d6d6c['agents']);_0x8d3164({'count':_0x3b0540[_0x3487('0x55')],'rows':_0x3b0540});});},'Telephones':function(_0x3188e9){return new Promise(function(_0xcfb667,_0x3abde2){var _0x311560=_['values'](_0x1d6d6c['telephones']);_0xcfb667({'count':_0x311560[_0x3487('0x55')],'rows':_0x311560});});},'Trunks':function(_0x47c8a7){return new Promise(function(_0x43c120,_0x3c7469){var _0x1c3a61=_[_0x3487('0x59')](_0x1d6d6c[_0x3487('0x7b')]);_0x43c120({'count':_0x1c3a61[_0x3487('0x55')],'rows':_0x1c3a61});});},'OutboundChannels':function(_0xd12729){return new Promise(function(_0x1cb7e9,_0x57b4e1){var _0x409dde=_[_0x3487('0x59')](_0x1d6d6c[_0x3487('0x7c')]);_0x1cb7e9({'count':_0x409dde['length'],'rows':_0x409dde});});},'Outbound':function(_0x252eec){return new Promise(function(_0x2ffab6,_0x8608ac){_0x2ffab6(_0x1d6d6c[_0x3487('0x2e')]);});},'Campaigns':function(_0x492292){return new Promise(function(_0x50571e,_0x34eda4){var _0x32ed8c=_[_0x3487('0x59')](_0x1d6d6c[_0x3487('0x7d')]);_0x50571e({'count':_0x32ed8c[_0x3487('0x55')],'rows':_0x32ed8c});});},'VoiceQueuesPreview':function(_0x6beb62){var _0x3b9992=this;return new Promise(function(_0x80288a,_0x258bf4){_0x2fc292['run'](_0x6beb62['id'])[_0x3487('0x17')](function(_0xc9382d){_0x80288a({'code':0xc8,'message':_0xc9382d[_0x3487('0x18')]});})[_0x3487('0x19')](function(_0x59c0fb){_0x258bf4(_0x3b9992['error'](0x1f4,_0x59c0fb[_0x3487('0x18')]));});});},'EventManager':function(_0x4b528b){var _0x5ef864=this;return new Promise(function(_0x2e32cc,_0x64d58e){if(!_0x4b528b[_0x3487('0x7e')]){return _0x64d58e(_0x5ef864[_0x3487('0x1a')](0x1f4,_0x3487('0x7f')));}ami[_0x3487('0x80')](_0x3487('0x81')+_0x4b528b[_0x3487('0x7e')],_0x4b528b['message']);_0x2e32cc({'code':0xc8,'message':_0x4b528b});});},'FaxAccounts':function(_0x3d3b7e){return new Promise(function(_0x215a57,_0x574449){var _0xddf26e=_['values'](_0x1d6d6c[_0x3487('0x82')]);_0x215a57({'count':_0xddf26e['length'],'rows':_0xddf26e});});},'SendFax':function(_0x2cf63e){var _0x3e70eb=this;return new Promise(function(_0xfc35d,_0xbcb012){_0xbe12a4[_0x3487('0x83')](_0x2cf63e)[_0x3487('0x17')](function(_0x50413f){_0xfc35d({'code':0xc8,'message':_0x50413f[_0x3487('0x18')]});})['catch'](function(_0x5bc11b){_0xbcb012(_0x3e70eb[_0x3487('0x1a')](0x1f4,_0x5bc11b[_0x3487('0x18')]));});});},'CheckAfterSend':function(_0xc7fd3f){var _0x2e7509=this;return new Promise(function(_0x609d8e,_0x2f943d){_0xbe12a4[_0x3487('0x84')](_0xc7fd3f)['then'](function(_0x44d7ee){_0x609d8e({'code':0xc8,'message':_0x44d7ee[_0x3487('0x18')]});})[_0x3487('0x19')](function(_0x1803ae){_0x2f943d(_0x2e7509['error'](0x1f4,_0x1803ae['message']));});});}};var _0x4340fb=jayson[_0x3487('0x85')](_0x4a2407)[_0x3487('0x86')]();_0x4340fb['on']('error',function(_0x54652c){return _0x193589(_0x54652c);});_0x4340fb['listen'](0x232a,_0x3487('0x87'),function(){console[_0x3487('0x88')](_0x3487('0x89'),0x232a);return _0x2611dc(_0x3487('0x8a')+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 c647fe6..2e4354a 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 _0x6dc7=['uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','calleridnum','user:%s','name','format','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','map','routeId','destcalleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','union','resolve','then','getContacts','isEmpty','length'];(function(_0x2f5a52,_0x4be193){var _0x5a1873=function(_0x2a585f){while(--_0x2a585f){_0x2f5a52['push'](_0x2f5a52['shift']());}};_0x5a1873(++_0x4be193);}(_0x6dc7,0x80));var _0x76dc=function(_0x3fb37a,_0x4fa12b){_0x3fb37a=_0x3fb37a-0x0;var _0x3e8cf0=_0x6dc7[_0x3fb37a];return _0x3e8cf0;};'use strict';var _=require(_0x76dc('0x0'));var BPromise=require(_0x76dc('0x1'));var Redis=require(_0x76dc('0x2'));var util=require('util');var config=require(_0x76dc('0x3'));var logger=require(_0x76dc('0x4'))(_0x76dc('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0x76dc('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x76dc('0x7'))(new Redis(config['redis']));function emit(_0x38dc5f,_0x40c26e,_0x2840c6,_0x3960ac,_0x232634){logger[_0x76dc('0x8')](_0x76dc('0x9'),_0x38dc5f,_0x40c26e['id'],_0x2840c6,_0x3960ac,JSON[_0x76dc('0xa')](_0x232634));io['to'](_0x2840c6)[_0x76dc('0xb')](_0x3960ac,_0x232634);}exports['exec']=function(_0x2a6c7a,_0x2185ae,_0x30f8ba,_0x4c34ab){var _0x5c545a,_0x22a256;var _0x5ea11e={};var _0x1dd35d;var _0xd06b26=Number(_0x30f8ba[_0x76dc('0xc')]);var _0xab8183=_0x30f8ba[_0x76dc('0xd')]?Boolean(Number(_0x30f8ba[_0x76dc('0xd')])):![];var _0x38a594;var _0x2b195e=![];if(!_[_0x76dc('0xe')](_0x30f8ba[_0x76dc('0xf')])){if(_0x30f8ba[_0x76dc('0xf')]=='1')_0x2b195e=!![];}if(!_0x2b195e){if(_0x4c34ab[_0x76dc('0x10')]){_0x5ea11e['id']=_0x4c34ab[_0x76dc('0x10')];}}if(!_0x5ea11e['id']){_0x5ea11e[_0x76dc('0x11')]=_0xd06b26;_0x38a594=_0x30f8ba[_0x76dc('0x12')]&&_0x30f8ba[_0x76dc('0x12')]!=='0'?_0x30f8ba[_0x76dc('0x12')]['split'](','):['phone'];_0x5ea11e['$or']=_[_0x76dc('0x13')](_0x38a594,function(_0x3db2c0){var _0x405166={};_0x405166[_0x3db2c0]=_0x4c34ab[_0x76dc('0x14')]?_0x4c34ab['destcalleridnum']:_0x4c34ab['calleridnum'];return _0x405166;});_0x1dd35d=_0x4c34ab[_0x76dc('0x14')]?_0x4c34ab[_0x76dc('0x15')]:_0x4c34ab['calleridnum'];}var _0x2dad6f=['id',_0x76dc('0x16'),_0x76dc('0x17'),'phone',_0x76dc('0x18'),_0x76dc('0x19'),'ListId',_0x76dc('0x1a'),_0x76dc('0x1b'),'updatedAt'];var _0x1f6bb5=_[_0x76dc('0x1c')](_0x2dad6f,_0x38a594);BPromise[_0x76dc('0x1d')]()[_0x76dc('0x1e')](cmContactRpc[_0x76dc('0x1f')]({'attributes':_0x1f6bb5,'where':_0x5ea11e,'phone':_0x1dd35d}))[_0x76dc('0x1e')](function(_0x467033){_0x22a256=_0x467033;if(!_[_0x76dc('0x20')](_0x22a256)){if(_0x22a256[_0x76dc('0x21')]===0x1){_0x5c545a=_0x22a256[0x0];logger['info']('[CM][%s][%s]\x20Contact\x20found:%s',_0x4c34ab[_0x76dc('0x22')],_0x2185ae['id'],_0x5c545a['id']);}else{logger[_0x76dc('0x8')](_0x76dc('0x23'),_0x4c34ab[_0x76dc('0x22')],_0x2185ae['id'],_[_0x76dc('0x13')](_0x22a256,'id')[_0x76dc('0x24')](','));}return;}else{logger[_0x76dc('0x8')](_0x76dc('0x25'),_0x4c34ab['uniqueid'],_0x2185ae['id']);var _0x507ceb={'ListId':_0xd06b26};var _0xeb4d9d=_0x30f8ba['data4']&&_0x30f8ba[_0x76dc('0x26')]!=='0'?_0x30f8ba[_0x76dc('0x26')]:'phone';if(_0xab8183){logger[_0x76dc('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x4c34ab[_0x76dc('0x22')],_0x2185ae['id']);_0x507ceb[_0xeb4d9d]=_['isNil'](_0x4c34ab[_0x76dc('0x14')])?_0x4c34ab['calleridnum']:_0x4c34ab[_0x76dc('0x15')];if(_[_0x76dc('0xe')](_0x4c34ab[_0x76dc('0x14')])){_0x507ceb['firstName']=_0x4c34ab[_0x76dc('0x27')]&&_0x4c34ab[_0x76dc('0x27')]!==_0x76dc('0x28')?_0x4c34ab['calleridname']:_0x76dc('0x29');}else{_0x507ceb[_0x76dc('0x16')]=_0x4c34ab[_0x76dc('0x2a')]&&_0x4c34ab['destcalleridname']!==_0x76dc('0x28')?_0x4c34ab[_0x76dc('0x2a')]:'Unknown';}return BPromise['resolve']()[_0x76dc('0x1e')](cmContactRpc[_0x76dc('0x2b')](_0x507ceb))['then'](function(_0x36b2c6){_0x5c545a=_0x36b2c6;_0x22a256[_0x76dc('0x2c')](_0x36b2c6);if(_0x5c545a){logger[_0x76dc('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x4c34ab[_0x76dc('0x22')],_0x2185ae['id'],_0x5c545a['id']);}return;});}else{logger[_0x76dc('0x8')](_0x76dc('0x2d'),_0x4c34ab[_0x76dc('0x22')],_0x2185ae['id']);_0x507ceb[_0xeb4d9d]=_['isNil'](_0x4c34ab[_0x76dc('0x14')])?_0x4c34ab[_0x76dc('0x2e')]:_0x4c34ab[_0x76dc('0x15')];if(_['isNil'](_0x4c34ab[_0x76dc('0x14')])){_0x507ceb['firstName']=_0x4c34ab[_0x76dc('0x27')]&&_0x4c34ab[_0x76dc('0x27')]!==_0x76dc('0x28')?_0x4c34ab['calleridname']:'Unknown';}else{_0x507ceb[_0x76dc('0x16')]=_0x4c34ab[_0x76dc('0x2a')]&&_0x4c34ab[_0x76dc('0x2a')]!==_0x76dc('0x28')?_0x4c34ab[_0x76dc('0x2a')]:_0x76dc('0x29');}_0x5c545a=_0x507ceb;_0x22a256[_0x76dc('0x2c')](_0x507ceb);return;}}})[_0x76dc('0x1e')](function(){if(_0x2a6c7a){emit(_0x4c34ab['uniqueid'],_0x2185ae,util['format'](_0x76dc('0x2f'),_0x2a6c7a[_0x76dc('0x30')]),util[_0x76dc('0x31')](_0x76dc('0x32'),_0x30f8ba[_0x76dc('0x33')][_0x76dc('0x34')]()),{'evt':_[_0x76dc('0x35')](_0x4c34ab,{'autoCreate':_0xab8183}),'contact':_0x5c545a===undefined?{}:_0x5c545a,'contacts':_0x22a256['length']===0x0?undefined:_0x22a256});}});}; \ No newline at end of file +var _0x75dc=['name','toLowerCase','merge','lodash','bluebird','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','stringify','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','calleridnum','format','user:%s'];(function(_0x101bb8,_0x29c087){var _0x302b9a=function(_0x4251e6){while(--_0x4251e6){_0x101bb8['push'](_0x101bb8['shift']());}};_0x302b9a(++_0x29c087);}(_0x75dc,0x1d7));var _0xc75d=function(_0x3918a3,_0x3e3db8){_0x3918a3=_0x3918a3-0x0;var _0x4f252f=_0x75dc[_0x3918a3];return _0x4f252f;};'use strict';var _=require(_0xc75d('0x0'));var BPromise=require(_0xc75d('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0xc75d('0x2'))(_0xc75d('0x3'));var cmContactRpc=require(_0xc75d('0x4'));config[_0xc75d('0x5')]=_[_0xc75d('0x6')](config[_0xc75d('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xc75d('0x7'))(new Redis(config[_0xc75d('0x5')]));function emit(_0x928edc,_0x5d75a9,_0x1ed94f,_0x182591,_0x645b48){logger[_0xc75d('0x8')]('[CM][%s][%s]',_0x928edc,_0x5d75a9['id'],_0x1ed94f,_0x182591,JSON[_0xc75d('0x9')](_0x645b48));io['to'](_0x1ed94f)['emit'](_0x182591,_0x645b48);}exports['exec']=function(_0x3d0ac4,_0x2deb8b,_0x2b6fee,_0x431843){var _0x496a6f,_0x1cadf6;var _0x10cac9={};var _0x34aeb4;var _0x1b0911=Number(_0x2b6fee[_0xc75d('0xa')]);var _0x2521fd=_0x2b6fee[_0xc75d('0xb')]?Boolean(Number(_0x2b6fee['data2'])):![];var _0x46228e;var _0x2313be=![];if(!_[_0xc75d('0xc')](_0x2b6fee[_0xc75d('0xd')])){if(_0x2b6fee['data5']=='1')_0x2313be=!![];}if(!_0x2313be){if(_0x431843['xmd-contactid']){_0x10cac9['id']=_0x431843[_0xc75d('0xe')];}}if(!_0x10cac9['id']){_0x10cac9[_0xc75d('0xf')]=_0x1b0911;_0x46228e=_0x2b6fee[_0xc75d('0x10')]&&_0x2b6fee[_0xc75d('0x10')]!=='0'?_0x2b6fee[_0xc75d('0x10')][_0xc75d('0x11')](','):[_0xc75d('0x12')];_0x10cac9['$or']=_[_0xc75d('0x13')](_0x46228e,function(_0x1fe446){var _0x2d8aeb={};_0x2d8aeb[_0x1fe446]=_0x431843[_0xc75d('0x14')]?_0x431843[_0xc75d('0x15')]:_0x431843['calleridnum'];return _0x2d8aeb;});_0x34aeb4=_0x431843[_0xc75d('0x14')]?_0x431843['destcalleridnum']:_0x431843['calleridnum'];}var _0x3933c5=['id',_0xc75d('0x16'),_0xc75d('0x17'),_0xc75d('0x12'),_0xc75d('0x18'),'fax',_0xc75d('0xf'),_0xc75d('0x19'),_0xc75d('0x1a'),_0xc75d('0x1b')];var _0x1ae4e9=_[_0xc75d('0x1c')](_0x3933c5,_0x46228e);BPromise[_0xc75d('0x1d')]()[_0xc75d('0x1e')](cmContactRpc['getContacts']({'attributes':_0x1ae4e9,'where':_0x10cac9,'phone':_0x34aeb4}))[_0xc75d('0x1e')](function(_0x296456){_0x1cadf6=_0x296456;if(!_[_0xc75d('0x1f')](_0x1cadf6)){if(_0x1cadf6[_0xc75d('0x20')]===0x1){_0x496a6f=_0x1cadf6[0x0];logger['info'](_0xc75d('0x21'),_0x431843[_0xc75d('0x22')],_0x2deb8b['id'],_0x496a6f['id']);}else{logger[_0xc75d('0x8')](_0xc75d('0x23'),_0x431843[_0xc75d('0x22')],_0x2deb8b['id'],_[_0xc75d('0x13')](_0x1cadf6,'id')['join'](','));}return;}else{logger[_0xc75d('0x8')](_0xc75d('0x24'),_0x431843['uniqueid'],_0x2deb8b['id']);var _0x4dcda0={'ListId':_0x1b0911};var _0x4b5c88=_0x2b6fee[_0xc75d('0x25')]&&_0x2b6fee[_0xc75d('0x25')]!=='0'?_0x2b6fee[_0xc75d('0x25')]:_0xc75d('0x12');if(_0x2521fd){logger[_0xc75d('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x431843['uniqueid'],_0x2deb8b['id']);_0x4dcda0[_0x4b5c88]=_[_0xc75d('0xc')](_0x431843[_0xc75d('0x14')])?_0x431843['calleridnum']:_0x431843[_0xc75d('0x15')];if(_[_0xc75d('0xc')](_0x431843[_0xc75d('0x14')])){_0x4dcda0[_0xc75d('0x16')]=_0x431843['calleridname']&&_0x431843[_0xc75d('0x26')]!==_0xc75d('0x27')?_0x431843[_0xc75d('0x26')]:'Unknown';}else{_0x4dcda0['firstName']=_0x431843[_0xc75d('0x28')]&&_0x431843[_0xc75d('0x28')]!==''?_0x431843[_0xc75d('0x28')]:_0xc75d('0x29');}return BPromise[_0xc75d('0x1d')]()[_0xc75d('0x1e')](cmContactRpc[_0xc75d('0x2a')](_0x4dcda0))[_0xc75d('0x1e')](function(_0x38e86a){_0x496a6f=_0x38e86a;_0x1cadf6[_0xc75d('0x2b')](_0x38e86a);if(_0x496a6f){logger[_0xc75d('0x8')](_0xc75d('0x2c'),_0x431843[_0xc75d('0x22')],_0x2deb8b['id'],_0x496a6f['id']);}return;});}else{logger[_0xc75d('0x8')](_0xc75d('0x2d'),_0x431843['uniqueid'],_0x2deb8b['id']);_0x4dcda0[_0x4b5c88]=_[_0xc75d('0xc')](_0x431843[_0xc75d('0x14')])?_0x431843[_0xc75d('0x2e')]:_0x431843[_0xc75d('0x15')];if(_['isNil'](_0x431843[_0xc75d('0x14')])){_0x4dcda0[_0xc75d('0x16')]=_0x431843[_0xc75d('0x26')]&&_0x431843['calleridname']!==''?_0x431843['calleridname']:'Unknown';}else{_0x4dcda0[_0xc75d('0x16')]=_0x431843[_0xc75d('0x28')]&&_0x431843['destcalleridname']!==_0xc75d('0x27')?_0x431843[_0xc75d('0x28')]:_0xc75d('0x29');}_0x496a6f=_0x4dcda0;_0x1cadf6[_0xc75d('0x2b')](_0x4dcda0);return;}}})[_0xc75d('0x1e')](function(){if(_0x3d0ac4){emit(_0x431843[_0xc75d('0x22')],_0x2deb8b,util[_0xc75d('0x2f')](_0xc75d('0x30'),_0x3d0ac4[_0xc75d('0x31')]),util[_0xc75d('0x2f')]('trigger:%s',_0x2b6fee['action'][_0xc75d('0x32')]()),{'evt':_[_0xc75d('0x33')](_0x431843,{'autoCreate':_0x2521fd}),'contact':_0x496a6f===undefined?{}:_0x496a6f,'contacts':_0x1cadf6[_0xc75d('0x20')]===0x0?undefined:_0x1cadf6});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 4db5f85..a6092ae 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 _0x9de8=['query','replace','channel','every','AllConditions','some','AnyConditions','checkConditions','field','chat','ChatWebsiteId','value','upperFirst','operator','event','membername','lastevent','routeId','mailSubstatus','substatus','offlineMessage','equals','exports','util','url','mustache','./urlforward','./integration','./cmContact','./script','trigger','redis','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:offlineMessage','prototype','emit','clone','motionChannel','undefined','interface','checkTriggers','hasOwnProperty','checkTrigger','merge','variables','length','action','contactmanager','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','800','data5','windowHeight','data6','600','winArguments','format','name','trigger:%s:%s','toLowerCase','trigger:%s','user:%s','exec','integration','accounts','queue','urlforward','script','parse'];(function(_0x3b7da8,_0x21067d){var _0xf86eae=function(_0x219dff){while(--_0x219dff){_0x3b7da8['push'](_0x3b7da8['shift']());}};_0xf86eae(++_0x21067d);}(_0x9de8,0x88));var _0x89de=function(_0x3406bf,_0x8e64e3){_0x3406bf=_0x3406bf-0x0;var _0x1c4f2e=_0x9de8[_0x3406bf];return _0x1c4f2e;};'use strict';var util=require(_0x89de('0x0'));var _=require('lodash');var url=require(_0x89de('0x1'));var Mustache=require(_0x89de('0x2'));var Redis=require('ioredis');var urlforward=require(_0x89de('0x3'));var integration=require(_0x89de('0x4'));var cmContact=require(_0x89de('0x5'));var script=require(_0x89de('0x6'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x89de('0x7'));var ami=require('../ami');config['redis']=_['defaults'](config[_0x89de('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x89de('0x9'))(new Redis(config[_0x89de('0x8')]));var operators={'equals':function(_0x349a56,_0x4d31b3){return _0x349a56==_0x4d31b3;},'not_equals':function(_0x5c2f41,_0x3023e3){return _0x5c2f41!=_0x3023e3;}};var barAndWebActions=[_0x89de('0xa'),_0x89de('0x1'),_0x89de('0xb')];function Trigger(_0x3831ff){this[_0x89de('0xc')]=_0x3831ff[_0x89de('0xc')];this[_0x89de('0xd')]=_0x3831ff[_0x89de('0xd')];this[_0x89de('0xe')]=_0x3831ff[_0x89de('0xe')];this[_0x89de('0xf')]=_0x3831ff[_0x89de('0xf')];this[_0x89de('0x10')]=_0x3831ff['voiceExtensions'];this[_0x89de('0x11')]=_0x3831ff['zendeskAccounts'];this[_0x89de('0x12')]=_0x3831ff['freshdeskAccounts'];this[_0x89de('0x13')]=_0x3831ff[_0x89de('0x13')];this[_0x89de('0x14')]=_0x3831ff[_0x89de('0x14')];this[_0x89de('0x15')]=_0x3831ff[_0x89de('0x15')];this[_0x89de('0x16')]=_0x3831ff[_0x89de('0x16')];this['vtigerAccounts']=_0x3831ff[_0x89de('0x17')];this['servicenowAccounts']=_0x3831ff[_0x89de('0x18')];this[_0x89de('0x19')]=_0x3831ff['dynamics365Accounts'];this['freshsalesAccounts']=_0x3831ff['freshsalesAccounts'];this['accounts']={'zendesk':this[_0x89de('0x11')],'salesforce':this[_0x89de('0x13')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x89de('0x14')],'zoho':this[_0x89de('0x15')],'desk':this[_0x89de('0x16')],'vtiger':this[_0x89de('0x17')],'dynamics365':this[_0x89de('0x19')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x89de('0x18')]};ami['on']('custom:agentcalled',this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on'](_0x89de('0x1c'),this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on'](_0x89de('0x1d'),this['syncCustomEvent'][_0x89de('0x1b')](this));ami['on'](_0x89de('0x1e'),this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on'](_0x89de('0x1f'),this['syncCustomEvent'][_0x89de('0x1b')](this));ami['on'](_0x89de('0x20'),this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on'](_0x89de('0x21'),this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on'](_0x89de('0x22'),this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on'](_0x89de('0x23'),this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on'](_0x89de('0x24'),this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on'](_0x89de('0x25'),this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on']('custom:timeout',this[_0x89de('0x1a')]['bind'](this));ami['on'](_0x89de('0x26'),this[_0x89de('0x27')][_0x89de('0x1b')](this));ami['on']('custom:dialconnect',this[_0x89de('0x27')][_0x89de('0x1b')](this));ami['on']('custom:dialend',this[_0x89de('0x27')]['bind'](this));ami['on'](_0x89de('0x28'),this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on']('custom:closedinteraction',this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on'](_0x89de('0x29'),this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on'](_0x89de('0x2a'),this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on']('custom:outgoingmessage',this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on']('custom:acceptmessage',this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on']('custom:rejectmessage',this[_0x89de('0x1a')][_0x89de('0x1b')](this));ami['on'](_0x89de('0x2b'),this[_0x89de('0x1a')][_0x89de('0x1b')](this));}Trigger[_0x89de('0x2c')][_0x89de('0x2d')]=function(_0x132d5e,_0x1b18f8,_0x57909f){logger['info'](_0x132d5e,_0x1b18f8,JSON['stringify'](_0x57909f));io['to'](_0x132d5e)[_0x89de('0x2d')](_0x1b18f8,_0x57909f);};Trigger[_0x89de('0x2c')][_0x89de('0x1a')]=function(_0x3b6a50){var _0x295fc3=_[_0x89de('0x2e')](_0x3b6a50);if(typeof _0x295fc3[_0x89de('0x2f')]===_0x89de('0x30')){_0x295fc3['motionChannel']='voice';}this['checkTriggers'](_0x295fc3);};Trigger['prototype'][_0x89de('0x27')]=function(_0x481c51){if(this['agents'][_0x481c51[_0x89de('0x31')]]){this[_0x89de('0x1a')](_0x481c51);}};Trigger[_0x89de('0x2c')][_0x89de('0x32')]=function(_0x529188){var _0x4bda31;for(var _0x50190b in this[_0x89de('0xc')]){if(this[_0x89de('0xc')][_0x89de('0x33')](_0x50190b)){if(this[_0x89de('0xc')][_0x50190b]['status']){_0x4bda31=this[_0x89de('0x34')](this[_0x89de('0xc')][_0x50190b],_0x529188);if(_0x4bda31){_[_0x89de('0x35')](_0x529188,_0x529188[_0x89de('0x36')]);for(var _0x40cc2f=0x0,_0x599028,_0x236ff0,_0x34d802;_0x40cc2f0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});}; \ No newline at end of file +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x5fc3[_0x1e1965];return _0x1a2e96;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ 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 f7ff9d7..5c06d8b 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 _0xd59a=['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','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','clientSecret','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','internalemailaddress','toLowerCase','destcalleridnum','calleridnum','contacts','headers','odata-entityid','substring','lastIndexOf','enduserId','outbound','replace','%2b','telephone1','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','idField','indexOf','content','incident','incidents','assign','Subjects','getString','Descriptions','/contacts(','/systemusers(','ticketType','phonecall','callDirection','queue','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xd59a,0x7c));var _0xad59=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd59a[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xad59('0x0'));var rp=require('request-promise');var util=require('util');var intUtil=require(_0xad59('0x1'));var md5=require(_0xad59('0x2'));var Redis=require(_0xad59('0x3'));var logger=require(_0xad59('0x4'))(_0xad59('0x5'));var config=require(_0xad59('0x6'));config['redis']=_['defaults'](config[_0xad59('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xad59('0x8'))(new Redis(config[_0xad59('0x7')]));function getAuthToken(_0x310d66,_0x5df5d7,_0x14dbf0){if(_0x310d66[_0xad59('0x9')]){_0x310d66[_0xad59('0xa')]=_0x310d66[_0xad59('0xb')][_0xad59('0xc')];_0x310d66[_0xad59('0xd')]=_0x310d66['CloudProvider'][_0xad59('0xe')];return Promise[_0xad59('0xf')](_0x310d66[_0xad59('0xb')][_0xad59('0x10')]);}var _0x34cc51={'method':_0xad59('0x11'),'uri':_0x5df5d7,'form':{'client_id':_0x310d66[_0xad59('0x12')],'resource':_0x310d66[_0xad59('0xa')],'username':_0x310d66[_0xad59('0x13')],'password':_0x310d66['password'],'grant_type':_0xad59('0x14'),'client_secret':_0x310d66[_0xad59('0x15')]},'json':!![]};return rp(_0x34cc51)['then'](function(_0x3dc6cf){return _0x3dc6cf['access_token'];})[_0xad59('0x16')](function(_0x264717){logger[_0xad59('0x17')]('['+[_0x14dbf0[_0xad59('0x18')]()]+_0xad59('0x19'));return _0x264717[_0xad59('0x1a')];});}function getUser(_0x3db773,_0xdd65ab,_0x3b2431,_0x41dae7,_0x131fe4,_0x210f01){return new Promise(function(_0x17f26d,_0x36481b){return getAuthToken(_0xdd65ab,_0x41dae7,_0x210f01)[_0xad59('0x1b')](function(_0x242184){var _0x2ea5b4={'method':_0xad59('0x1c'),'uri':_0x131fe4+_0xad59('0x1d'),'headers':{'Authorization':_0xad59('0x1e')+_0x242184,'OData-Version':_0xad59('0x1f')},'json':!![]};return rp(_0x2ea5b4);})[_0xad59('0x1b')](function(_0x51f950){var _0xb3175b=_0x51f950[_0xad59('0x20')];var _0x200f9e=![];var _0xe2c0cc=null;if(!_[_0xad59('0x21')](_0x3b2431)){if(intUtil['validateEmail'](_0x3b2431['email'])){_0x3db773['userEmail']=_0x3b2431[_0xad59('0x22')];for(_0xe2c0cc=0x0;_0xe2c0cc<_0xb3175b[_0xad59('0x23')];_0xe2c0cc++){if(_0xb3175b[_0xe2c0cc]['internalemailaddress']===_0x3b2431['email']&&!_0xb3175b[_0xe2c0cc][_0xad59('0x24')]){_0x200f9e=!![];logger[_0xad59('0x25')]('['+[_0x210f01[_0xad59('0x18')]()]+_0xad59('0x26')+_0xb3175b[_0xe2c0cc][_0xad59('0x27')]+'!');_0x3db773[_0xad59('0x28')]=_0xb3175b[_0xe2c0cc][_0xad59('0x27')];}}}}if(!_0x200f9e){logger['info']('['+[_0x210f01[_0xad59('0x18')]()]+_0xad59('0x29'));_0x3db773[_0xad59('0x2a')]=_0xdd65ab[_0xad59('0x13')];for(_0xe2c0cc=0x0;_0xe2c0cc<_0xb3175b[_0xad59('0x23')];_0xe2c0cc++){if(_0xb3175b[_0xe2c0cc][_0xad59('0x2b')]===_0xdd65ab[_0xad59('0x13')]){_0x3db773[_0xad59('0x28')]=_0xb3175b[_0xe2c0cc][_0xad59('0x27')];}}}_0x17f26d(_0x3db773);})[_0xad59('0x16')](function(_0xe1c5b9){_0x36481b(_0xe1c5b9[_0xad59('0x1a')]);});});}function createEndUser(_0x36d05c,_0x9d64d1,_0x9924df,_0x2a78d3,_0x56fc9d,_0x2c739d){return new Promise(function(_0x37c878,_0x47a329){return getAuthToken(_0x9d64d1,_0x9924df,_0x2c739d)[_0xad59('0x1b')](function(_0xe4bad0){var _0x36b0c0=_0x2c739d[_0xad59('0x2c')]()==='outbound'?_0x56fc9d[_0xad59('0x2d')]:_0x56fc9d[_0xad59('0x2e')];var _0x2d9e6a={'method':_0xad59('0x11'),'uri':_0x2a78d3+_0xad59('0x2f'),'body':{'telephone1':_0x36b0c0,'fullname':_0x36b0c0,'firstname':_0x36b0c0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x36d05c['userId']+')'},'headers':{'Authorization':_0xad59('0x1e')+_0xe4bad0,'OData-Version':_0xad59('0x1f')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2d9e6a);})['then'](function(_0x53b0a5){var _0x3307d9=_0x53b0a5[_0xad59('0x30')][_0xad59('0x31')];var _0x1a78a9=_0x3307d9[_0xad59('0x32')](_0x3307d9[_0xad59('0x33')]('(')+0x1,_0x3307d9[_0xad59('0x33')](')'));_0x36d05c[_0xad59('0x34')]=_0x1a78a9;_0x37c878(_0x36d05c);})['catch'](function(_0x5e6032){_0x47a329(_0x5e6032['message']);});});}function getEndUser(_0x43781e,_0x4dc2fa,_0x826acb,_0x5b017e,_0x261e89,_0x554f25,_0xe55eb1){var _0x17858f=_0x554f25[_0xad59('0x2c')]()===_0xad59('0x35')?_0x261e89[_0xad59('0x2d')]:_0x261e89['calleridnum'];return getAuthToken(_0x4dc2fa,_0x826acb,_0x554f25)[_0xad59('0x1b')](function(_0x1917f3){var _0x371441={'method':_0xad59('0x1c'),'uri':_0x5b017e+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x17858f[_0xad59('0x36')]('+',_0xad59('0x37'))+'\x27','headers':{'Authorization':_0xad59('0x1e')+_0x1917f3,'If-None-Match':null,'OData-Version':_0xad59('0x1f')},'json':!![]};return rp(_0x371441);})[_0xad59('0x1b')](function(_0x23fe5d){var _0x1f82ae=![];if(!_0x23fe5d)return _0x1f82ae;var _0x488ae5=_0x23fe5d[_0xad59('0x20')];for(var _0x19b8b4=0x0;_0x19b8b4<_0x488ae5['length'];_0x19b8b4++){if(_0x488ae5[_0x19b8b4][_0xad59('0x38')]===_0x17858f){_0x1f82ae=!![];_0x43781e[_0xad59('0x34')]=_0x488ae5[_0x19b8b4][_0xad59('0x39')];}}return _0x1f82ae;})[_0xad59('0x1b')](function(_0x1991b3){if(_0x1991b3)return _0x43781e;if(_0xe55eb1==='nothing'){logger[_0xad59('0x25')]('['+[_0x554f25['toUpperCase']()]+_0xad59('0x3a'));return _0x43781e;}return createEndUser(_0x43781e,_0x4dc2fa,_0x826acb,_0x5b017e,_0x261e89,_0x554f25)[_0xad59('0x1b')](function(_0x36437c){logger[_0xad59('0x25')]('['+[_0x554f25['toUpperCase']()]+_0xad59('0x3b'),_0x36437c[_0xad59('0x34')]);return _0x36437c;});});}function getCustomFields(_0x3e8ebf,_0x32e8d2,_0x35b21b){var _0x3b8aa7={};if(_0x3e8ebf['length']>0x0){_[_0xad59('0x3c')](_0x3e8ebf,function(_0x5707fc){if(_[_0xad59('0x3d')]([_0xad59('0x3e'),_0xad59('0x3f')],_0x5707fc[_0xad59('0x40')])&&_0x5707fc['nameField']&&!_0x5707fc['customField']){var _0x252b4c=_0x5707fc[_0xad59('0x41')][_0xad59('0x2c')]();var _0x42a3bf=_0x252b4c[_0xad59('0x32')](0x0,_0x252b4c[_0xad59('0x42')]('_'));var _0x48a677=_0x252b4c[_0xad59('0x32')](_0x252b4c[_0xad59('0x42')]('_')+0x1);if(_0x42a3bf===_0x35b21b){_0x3b8aa7[_0x48a677]=_0x5707fc[_0xad59('0x43')];}}});}return _0x3b8aa7;}function getTicket(_0x3ba03e,_0x5be2c3,_0x170c9e,_0x39f30b,_0x5cdcf4,_0x39cab7,_0x165bc8){return new Promise(function(_0x252d24,_0x5330ba){var _0x563e9a;return getAuthToken(_0x5be2c3,_0x170c9e,_0x165bc8)['then'](function(_0x4056b0){if(_0x39cab7['ticketType']===_0xad59('0x44')){_0x563e9a={'method':_0xad59('0x11'),'uri':_0x39f30b+_0xad59('0x45'),'body':Object[_0xad59('0x46')]({},{'title':intUtil['getString'](_0x39cab7[_0xad59('0x47')],_0x5cdcf4,'\x20'),'description':intUtil[_0xad59('0x48')](_0x39cab7[_0xad59('0x49')],_0x5cdcf4,'\x0a'),'customerid_contact@odata.bind':_0x3ba03e[_0xad59('0x34')]?_0xad59('0x4a')+_0x3ba03e[_0xad59('0x34')]+')':undefined,'ownerid@odata.bind':_0xad59('0x4b')+_0x3ba03e[_0xad59('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x39cab7['Fields'],_0x5cdcf4,_0x39cab7[_0xad59('0x4c')])),'headers':{'Authorization':'Bearer\x20'+_0x4056b0,'OData-Version':_0xad59('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x39cab7['ticketType']===_0xad59('0x4d')){var _0x1bead3=_0x3ba03e[_0xad59('0x34')]?[{'partyid_systemuser@odata.bind':_0xad59('0x4b')+_0x3ba03e[_0xad59('0x28')]+')','participationtypemask':_0x3ba03e[_0xad59('0x4e')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xad59('0x4a')+_0x3ba03e[_0xad59('0x34')]+')','participationtypemask':_0x3ba03e[_0xad59('0x4e')]===_0xad59('0x4f')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xad59('0x4b')+_0x3ba03e[_0xad59('0x28')]+')','participationtypemask':_0x3ba03e[_0xad59('0x4e')]==='queue'?0x2:0x1}];_0x563e9a={'method':_0xad59('0x11'),'uri':_0x39f30b+'phonecalls','body':Object[_0xad59('0x46')]({},{'subject':intUtil[_0xad59('0x48')](_0x39cab7[_0xad59('0x47')],_0x5cdcf4,'\x20'),'phonenumber':String(_0x5cdcf4[_0xad59('0x2e')]),'description':intUtil[_0xad59('0x48')](_0x39cab7[_0xad59('0x49')],_0x5cdcf4,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3ba03e[_0xad59('0x34')]?'/contacts('+_0x3ba03e[_0xad59('0x34')]+')':undefined,'ownerid@odata.bind':_0xad59('0x4b')+_0x3ba03e[_0xad59('0x28')]+')','directioncode':_0x3ba03e['callDirection']===_0xad59('0x4f')?![]:!![],'phonecall_activity_parties':_0x1bead3},getCustomFields(_0x39cab7[_0xad59('0x50')],_0x5cdcf4,_0x39cab7['ticketType'])),'headers':{'Authorization':_0xad59('0x1e')+_0x4056b0,'OData-Version':_0xad59('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x563e9a);})['then'](function(_0x57491c){var _0xf09bc9=_0x57491c[_0xad59('0x30')][_0xad59('0x31')];var _0x14c55b=_0xf09bc9[_0xad59('0x32')](_0xf09bc9[_0xad59('0x33')]('(')+0x1,_0xf09bc9[_0xad59('0x33')](')'));_0x3ba03e[_0xad59('0x51')]=_0x14c55b;_0x252d24(_0x3ba03e);})[_0xad59('0x16')](function(_0x1744c7){_0x5330ba(_0x1744c7[_0xad59('0x1a')]);});});}function emit(_0x5c79cd,_0x4c20d6,_0x4e8726,_0x32e26d){var _0x33d8e8={'uri':util[_0xad59('0x52')](_0xad59('0x53'),_0x5c79cd,_0x4e8726,_0x32e26d)};io['to'](util[_0xad59('0x52')](_0xad59('0x54'),_0x4c20d6))['emit'](_0xad59('0x55'),_0x33d8e8);}exports['cs']=function(_0x52cc52,_0x298677,_0x2531da,_0x28d57c,_0x245c97,_0x2fdd32,_0xabaaf6,_0x2c5c4b){var _0x3b133c={};_0x2fdd32[_0xad59('0xa')]=_0x2fdd32[_0xad59('0x9')]?intUtil['stripTrailingSlash'](_0x2fdd32[_0xad59('0xb')][_0xad59('0xc')]):intUtil[_0xad59('0x56')](_0x2fdd32[_0xad59('0xa')]);_0x2fdd32[_0xad59('0x57')]=intUtil[_0xad59('0x56')](_0x2fdd32['serverUrl']);_0x3b133c[_0xad59('0x4e')]=_0x2c5c4b===_0xad59('0x4f')||_0x2c5c4b===_0xad59('0x58')?_0xad59('0x4f'):_0xad59('0x35');var _0x2c7194=_0x2fdd32[_0xad59('0x9')]?util[_0xad59('0x52')](_0xad59('0x59'),_0x2fdd32['CloudProvider']['data7']):util[_0xad59('0x52')](_0xad59('0x59'),_0x2fdd32[_0xad59('0xa')]);var _0x56ae52=util[_0xad59('0x52')](_0xad59('0x5a'),_0x2fdd32['tenantId']);var _0x461974=util[_0xad59('0x52')](_0xad59('0x5b'),_0x2fdd32[_0xad59('0x57')],_0x298677[_0xad59('0x5c')],md5(_0x298677[_0xad59('0x5c')]));if(_0x245c97&&_0x245c97[_0xad59('0x5d')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x298677[_0xad59('0x5e')]=_0x461974;}else if(_0xabaaf6&&_0xabaaf6[_0xad59('0x5f')]&&_0xabaaf6[_0xad59('0x5f')]!==_0xad59('0x60')){logger['info'](_0xad59('0x61'),'Recording\x20is\x20enabled!');_0x298677[_0xad59('0x5e')]=_0x461974;}else{_0x298677[_0xad59('0x5e')]='';}return getUser(_0x3b133c,_0x2fdd32,_0x28d57c,_0x56ae52,_0x2c7194,_0x2c5c4b)[_0xad59('0x1b')](function(_0x4d7664){logger[_0xad59('0x25')]('['+_0x2c5c4b[_0xad59('0x18')]()+_0xad59('0x62'),_0x4d7664[_0xad59('0x28')]);logger[_0xad59('0x25')]('['+_0x2c5c4b[_0xad59('0x18')]()+_0xad59('0x63'),_0x4d7664[_0xad59('0x2a')]);return getEndUser(_0x4d7664,_0x2fdd32,_0x56ae52,_0x2c7194,_0x298677,_0x2c5c4b,_0x2531da[_0xad59('0x64')]);})[_0xad59('0x1b')](function(_0x2bc1e9){logger[_0xad59('0x25')]('['+_0x2c5c4b[_0xad59('0x18')]()+_0xad59('0x65'),_0x2bc1e9['enduserId']);logger[_0xad59('0x25')]('['+_0x2c5c4b[_0xad59('0x18')]()+_0xad59('0x66'),_0x298677['calleridnum']);return getTicket(_0x2bc1e9,_0x2fdd32,_0x56ae52,_0x2c7194,_0x298677,_0x2531da,_0x2c5c4b);})['then'](function(_0x218a41){logger['info'](util['format']('['+_0x2c5c4b[_0xad59('0x18')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x2531da['ticketType'],_0x218a41[_0xad59('0x51')]));logger['info'](util['format']('['+_0x2c5c4b['toUpperCase']()+_0xad59('0x67'),_0x2c5c4b));if(_0x2c5c4b!==_0xad59('0x58')){logger[_0xad59('0x25')]('['+_0x2c5c4b[_0xad59('0x18')]()+']',_0xad59('0x68'));emit(_0x2fdd32[_0xad59('0xa')],_0x28d57c['name'],_0x2531da[_0xad59('0x4c')],_0x218a41['ticketId']);}})[_0xad59('0x16')](function(_0x5c26bc){logger[_0xad59('0x17')]('['+_0x2c5c4b['toUpperCase']()+_0xad59('0x69'),_0x5c26bc[_0xad59('0x1a')]);});}; \ No newline at end of file +var _0xbfe6=['access_token','catch','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','systemuserid','toLowerCase','outbound','destcalleridnum','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','value','telephone1','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','Subjects','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20email\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error','lodash','request-promise','util','md5','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','data2','resolve','POST','clientId','username','password','clientSecret','then'];(function(_0x12fc36,_0x6530d3){var _0x55c667=function(_0x39ed70){while(--_0x39ed70){_0x12fc36['push'](_0x12fc36['shift']());}};_0x55c667(++_0x6530d3);}(_0xbfe6,0x112));var _0x6bfe=function(_0x42f6b1,_0x560c04){_0x42f6b1=_0x42f6b1-0x0;var _0x39b69f=_0xbfe6[_0x42f6b1];return _0x39b69f;};'use strict';var _=require(_0x6bfe('0x0'));var rp=require(_0x6bfe('0x1'));var util=require(_0x6bfe('0x2'));var intUtil=require('./util');var md5=require(_0x6bfe('0x3'));var Redis=require('ioredis');var logger=require(_0x6bfe('0x4'))('dynamics365');var config=require('../../../../config/environment');config[_0x6bfe('0x5')]=_[_0x6bfe('0x6')](config[_0x6bfe('0x5')],{'host':_0x6bfe('0x7'),'port':0x18eb});var io=require(_0x6bfe('0x8'))(new Redis(config[_0x6bfe('0x5')]));function getAuthToken(_0x19b9b3,_0x2d08b5,_0x4b6d28){if(_0x19b9b3[_0x6bfe('0x9')]){_0x19b9b3['remoteUri']=_0x19b9b3[_0x6bfe('0xa')][_0x6bfe('0xb')];_0x19b9b3['tenantId']=_0x19b9b3[_0x6bfe('0xa')][_0x6bfe('0xc')];return Promise[_0x6bfe('0xd')](_0x19b9b3[_0x6bfe('0xa')]['data5']);}var _0x11e21b={'method':_0x6bfe('0xe'),'uri':_0x2d08b5,'form':{'client_id':_0x19b9b3[_0x6bfe('0xf')],'resource':_0x19b9b3['remoteUri'],'username':_0x19b9b3[_0x6bfe('0x10')],'password':_0x19b9b3['password'],'grant_type':_0x6bfe('0x11'),'client_secret':_0x19b9b3[_0x6bfe('0x12')]},'json':!![]};return rp(_0x11e21b)[_0x6bfe('0x13')](function(_0x36a627){return _0x36a627[_0x6bfe('0x14')];})[_0x6bfe('0x15')](function(_0x2c586a){logger['error']('['+[_0x4b6d28[_0x6bfe('0x16')]()]+']\x20Wrong\x20credentials!');return _0x2c586a[_0x6bfe('0x17')];});}function getUser(_0xa9e1ef,_0x3ca416,_0x32ad2b,_0x92f993,_0x4aa9f6,_0x27c878){return new Promise(function(_0x1380a4,_0x1ad6f3){return getAuthToken(_0x3ca416,_0x92f993,_0x27c878)[_0x6bfe('0x13')](function(_0x5a0087){var _0x1c2070={'method':_0x6bfe('0x18'),'uri':_0x4aa9f6+_0x6bfe('0x19'),'headers':{'Authorization':_0x6bfe('0x1a')+_0x5a0087,'OData-Version':_0x6bfe('0x1b')},'json':!![]};return rp(_0x1c2070);})[_0x6bfe('0x13')](function(_0x2aaa41){var _0x45a4bb=_0x2aaa41['value'];var _0x386430=![];var _0x40730e=null;if(!_[_0x6bfe('0x1c')](_0x32ad2b)){if(intUtil[_0x6bfe('0x1d')](_0x32ad2b[_0x6bfe('0x1e')])){_0xa9e1ef[_0x6bfe('0x1f')]=_0x32ad2b['email'];for(_0x40730e=0x0;_0x40730e<_0x45a4bb[_0x6bfe('0x20')];_0x40730e++){if(_0x45a4bb[_0x40730e][_0x6bfe('0x21')]===_0x32ad2b[_0x6bfe('0x1e')]&&!_0x45a4bb[_0x40730e][_0x6bfe('0x22')]){_0x386430=!![];logger[_0x6bfe('0x23')]('['+[_0x27c878['toUpperCase']()]+_0x6bfe('0x24')+_0x45a4bb[_0x40730e]['systemuserid']+'!');_0xa9e1ef[_0x6bfe('0x25')]=_0x45a4bb[_0x40730e]['systemuserid'];}}}}if(!_0x386430){logger[_0x6bfe('0x23')]('['+[_0x27c878[_0x6bfe('0x16')]()]+_0x6bfe('0x26'));_0xa9e1ef[_0x6bfe('0x1f')]=_0x3ca416[_0x6bfe('0x10')];for(_0x40730e=0x0;_0x40730e<_0x45a4bb['length'];_0x40730e++){if(_0x45a4bb[_0x40730e][_0x6bfe('0x21')]===_0x3ca416[_0x6bfe('0x10')]){_0xa9e1ef[_0x6bfe('0x25')]=_0x45a4bb[_0x40730e][_0x6bfe('0x27')];}}}_0x1380a4(_0xa9e1ef);})[_0x6bfe('0x15')](function(_0x684e5){_0x1ad6f3(_0x684e5['message']);});});}function createEndUser(_0x5c56f3,_0x4f7ee9,_0x4dac06,_0x8de068,_0x5cb0c7,_0x5b0f79){return new Promise(function(_0xfc3bf0,_0x43f220){return getAuthToken(_0x4f7ee9,_0x4dac06,_0x5b0f79)[_0x6bfe('0x13')](function(_0x5714c6){var _0x418db5=_0x5b0f79[_0x6bfe('0x28')]()===_0x6bfe('0x29')?_0x5cb0c7[_0x6bfe('0x2a')]:_0x5cb0c7['calleridnum'];var _0x243d45={'method':'POST','uri':_0x8de068+'contacts','body':{'telephone1':_0x418db5,'fullname':_0x418db5,'firstname':_0x418db5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6bfe('0x2b')+_0x5c56f3[_0x6bfe('0x25')]+')'},'headers':{'Authorization':_0x6bfe('0x1a')+_0x5714c6,'OData-Version':_0x6bfe('0x1b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x243d45);})[_0x6bfe('0x13')](function(_0x16217a){var _0x32e146=_0x16217a['headers'][_0x6bfe('0x2c')];var _0x11bdb8=_0x32e146[_0x6bfe('0x2d')](_0x32e146[_0x6bfe('0x2e')]('(')+0x1,_0x32e146['lastIndexOf'](')'));_0x5c56f3[_0x6bfe('0x2f')]=_0x11bdb8;_0xfc3bf0(_0x5c56f3);})['catch'](function(_0x7b4794){_0x43f220(_0x7b4794['message']);});});}function getEndUser(_0x266bc0,_0x248c3a,_0x1e3115,_0x115773,_0x162e8b,_0x499d2b,_0x30450e){var _0x5ea105=_0x499d2b[_0x6bfe('0x28')]()===_0x6bfe('0x29')?_0x162e8b[_0x6bfe('0x2a')]:_0x162e8b[_0x6bfe('0x30')];return getAuthToken(_0x248c3a,_0x1e3115,_0x499d2b)['then'](function(_0x2ac9c0){var _0x56fc5={'method':'GET','uri':_0x115773+_0x6bfe('0x31')+_0x5ea105['replace']('+','%2b')+'\x27','headers':{'Authorization':_0x6bfe('0x1a')+_0x2ac9c0,'If-None-Match':null,'OData-Version':_0x6bfe('0x1b')},'json':!![]};return rp(_0x56fc5);})['then'](function(_0x504e3b){var _0x32d5aa=![];if(!_0x504e3b)return _0x32d5aa;var _0x5ced22=_0x504e3b[_0x6bfe('0x32')];for(var _0xbd7edc=0x0;_0xbd7edc<_0x5ced22[_0x6bfe('0x20')];_0xbd7edc++){if(_0x5ced22[_0xbd7edc][_0x6bfe('0x33')]===_0x5ea105){_0x32d5aa=!![];_0x266bc0[_0x6bfe('0x2f')]=_0x5ced22[_0xbd7edc][_0x6bfe('0x34')];}}return _0x32d5aa;})[_0x6bfe('0x13')](function(_0x441429){if(_0x441429)return _0x266bc0;if(_0x30450e==='nothing'){logger[_0x6bfe('0x23')]('['+[_0x499d2b['toUpperCase']()]+_0x6bfe('0x35'));return _0x266bc0;}return createEndUser(_0x266bc0,_0x248c3a,_0x1e3115,_0x115773,_0x162e8b,_0x499d2b)['then'](function(_0x1053eb){logger['info']('['+[_0x499d2b[_0x6bfe('0x16')]()]+_0x6bfe('0x36'),_0x1053eb[_0x6bfe('0x2f')]);return _0x1053eb;});});}function getCustomFields(_0x27c9f2,_0x3ef499,_0x297032){var _0x45ef6a={};if(_0x27c9f2[_0x6bfe('0x20')]>0x0){_[_0x6bfe('0x37')](_0x27c9f2,function(_0x487f99){if(_[_0x6bfe('0x38')]([_0x6bfe('0x39'),_0x6bfe('0x3a')],_0x487f99['type'])&&_0x487f99['nameField']&&!_0x487f99['customField']){var _0x19b8bd=_0x487f99[_0x6bfe('0x3b')][_0x6bfe('0x28')]();var _0x55dc82=_0x19b8bd[_0x6bfe('0x2d')](0x0,_0x19b8bd[_0x6bfe('0x3c')]('_'));var _0x410d5b=_0x19b8bd['substring'](_0x19b8bd[_0x6bfe('0x3c')]('_')+0x1);if(_0x55dc82===_0x297032){_0x45ef6a[_0x410d5b]=_0x487f99[_0x6bfe('0x3d')];}}});}return _0x45ef6a;}function getTicket(_0x7a70f8,_0x33dacb,_0x5c8fca,_0x50eb1e,_0x352678,_0x2858ef,_0x34049d){return new Promise(function(_0x157503,_0x4f5942){var _0x57f6d8;return getAuthToken(_0x33dacb,_0x5c8fca,_0x34049d)[_0x6bfe('0x13')](function(_0x511752){if(_0x2858ef[_0x6bfe('0x3e')]===_0x6bfe('0x3f')){_0x57f6d8={'method':_0x6bfe('0xe'),'uri':_0x50eb1e+_0x6bfe('0x40'),'body':Object[_0x6bfe('0x41')]({},{'title':intUtil['getString'](_0x2858ef['Subjects'],_0x352678,'\x20'),'description':intUtil[_0x6bfe('0x42')](_0x2858ef[_0x6bfe('0x43')],_0x352678,'\x0a'),'customerid_contact@odata.bind':_0x7a70f8[_0x6bfe('0x2f')]?_0x6bfe('0x44')+_0x7a70f8[_0x6bfe('0x2f')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x7a70f8['userId']+')','caseorigincode':'1'},getCustomFields(_0x2858ef[_0x6bfe('0x45')],_0x352678,_0x2858ef['ticketType'])),'headers':{'Authorization':_0x6bfe('0x1a')+_0x511752,'OData-Version':_0x6bfe('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2858ef['ticketType']===_0x6bfe('0x46')){var _0x5bb467=_0x7a70f8[_0x6bfe('0x2f')]?[{'partyid_systemuser@odata.bind':_0x6bfe('0x2b')+_0x7a70f8[_0x6bfe('0x25')]+')','participationtypemask':_0x7a70f8[_0x6bfe('0x47')]===_0x6bfe('0x48')?0x2:0x1},{'partyid_contact@odata.bind':_0x6bfe('0x44')+_0x7a70f8[_0x6bfe('0x2f')]+')','participationtypemask':_0x7a70f8['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x6bfe('0x2b')+_0x7a70f8[_0x6bfe('0x25')]+')','participationtypemask':_0x7a70f8[_0x6bfe('0x47')]===_0x6bfe('0x48')?0x2:0x1}];_0x57f6d8={'method':_0x6bfe('0xe'),'uri':_0x50eb1e+_0x6bfe('0x49'),'body':Object[_0x6bfe('0x41')]({},{'subject':intUtil[_0x6bfe('0x42')](_0x2858ef[_0x6bfe('0x4a')],_0x352678,'\x20'),'phonenumber':String(_0x352678[_0x6bfe('0x30')]),'description':intUtil[_0x6bfe('0x42')](_0x2858ef['Descriptions'],_0x352678,'\x0a'),'regardingobjectid_contact@odata.bind':_0x7a70f8[_0x6bfe('0x2f')]?_0x6bfe('0x44')+_0x7a70f8['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x7a70f8['userId']+')','directioncode':_0x7a70f8['callDirection']===_0x6bfe('0x48')?![]:!![],'phonecall_activity_parties':_0x5bb467},getCustomFields(_0x2858ef[_0x6bfe('0x45')],_0x352678,_0x2858ef[_0x6bfe('0x3e')])),'headers':{'Authorization':_0x6bfe('0x1a')+_0x511752,'OData-Version':_0x6bfe('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x57f6d8);})['then'](function(_0x5e641e){var _0x163207=_0x5e641e[_0x6bfe('0x4b')][_0x6bfe('0x2c')];var _0x44ea64=_0x163207['substring'](_0x163207[_0x6bfe('0x2e')]('(')+0x1,_0x163207[_0x6bfe('0x2e')](')'));_0x7a70f8[_0x6bfe('0x4c')]=_0x44ea64;_0x157503(_0x7a70f8);})['catch'](function(_0x24c35b){_0x4f5942(_0x24c35b[_0x6bfe('0x17')]);});});}function emit(_0x2c0096,_0x467a3d,_0x5dc733,_0x1a5d35){var _0x235230={'uri':util[_0x6bfe('0x4d')](_0x6bfe('0x4e'),_0x2c0096,_0x5dc733,_0x1a5d35)};io['to'](util[_0x6bfe('0x4d')](_0x6bfe('0x4f'),_0x467a3d))['emit'](_0x6bfe('0x50'),_0x235230);}exports['cs']=function(_0x56f4a9,_0x19091e,_0x24e06f,_0xc58ca6,_0x3b7cd0,_0x1aa923,_0x6d59d8,_0x34eb17){var _0x3d6965={};_0x1aa923[_0x6bfe('0x51')]=_0x1aa923[_0x6bfe('0x9')]?intUtil[_0x6bfe('0x52')](_0x1aa923[_0x6bfe('0xa')][_0x6bfe('0xb')]):intUtil[_0x6bfe('0x52')](_0x1aa923[_0x6bfe('0x51')]);_0x1aa923[_0x6bfe('0x53')]=intUtil[_0x6bfe('0x52')](_0x1aa923[_0x6bfe('0x53')]);_0x3d6965[_0x6bfe('0x47')]=_0x34eb17===_0x6bfe('0x48')||_0x34eb17===_0x6bfe('0x54')?_0x6bfe('0x48'):_0x6bfe('0x29');var _0x5918cf=_0x1aa923[_0x6bfe('0x9')]?util[_0x6bfe('0x4d')](_0x6bfe('0x55'),_0x1aa923[_0x6bfe('0xa')][_0x6bfe('0xb')]):util[_0x6bfe('0x4d')](_0x6bfe('0x55'),_0x1aa923[_0x6bfe('0x51')]);var _0x403200=util[_0x6bfe('0x4d')](_0x6bfe('0x56'),_0x1aa923['tenantId']);var _0x30eb8f=util[_0x6bfe('0x4d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1aa923['serverUrl'],_0x19091e[_0x6bfe('0x57')],md5(_0x19091e['uniqueid']));if(_0x3b7cd0&&_0x3b7cd0['monitor_format']){logger[_0x6bfe('0x23')]('[QUEUE]','Recording\x20is\x20enabled!');_0x19091e['recordingURL']=_0x30eb8f;}else if(_0x6d59d8&&_0x6d59d8['recordingFormat']&&_0x6d59d8['recordingFormat']!==_0x6bfe('0x58')){logger[_0x6bfe('0x23')](_0x6bfe('0x59'),_0x6bfe('0x5a'));_0x19091e[_0x6bfe('0x5b')]=_0x30eb8f;}else{_0x19091e[_0x6bfe('0x5b')]='';}return getUser(_0x3d6965,_0x1aa923,_0xc58ca6,_0x403200,_0x5918cf,_0x34eb17)[_0x6bfe('0x13')](function(_0x27c739){logger[_0x6bfe('0x23')]('['+_0x34eb17[_0x6bfe('0x16')]()+']\x20The\x20User\x20ID\x20is:',_0x27c739[_0x6bfe('0x25')]);logger['info']('['+_0x34eb17[_0x6bfe('0x16')]()+_0x6bfe('0x5c'),_0x27c739[_0x6bfe('0x1f')]);return getEndUser(_0x27c739,_0x1aa923,_0x403200,_0x5918cf,_0x19091e,_0x34eb17,_0x24e06f['moduleCreate']);})[_0x6bfe('0x13')](function(_0x51015a){logger[_0x6bfe('0x23')]('['+_0x34eb17['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x51015a[_0x6bfe('0x2f')]);logger[_0x6bfe('0x23')]('['+_0x34eb17['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x19091e[_0x6bfe('0x30')]);return getTicket(_0x51015a,_0x1aa923,_0x403200,_0x5918cf,_0x19091e,_0x24e06f,_0x34eb17);})[_0x6bfe('0x13')](function(_0x39f472){logger['info'](util[_0x6bfe('0x4d')]('['+_0x34eb17[_0x6bfe('0x16')]()+_0x6bfe('0x5d'),_0x24e06f['ticketType'],_0x39f472[_0x6bfe('0x4c')]));logger[_0x6bfe('0x23')](util[_0x6bfe('0x4d')]('['+_0x34eb17[_0x6bfe('0x16')]()+_0x6bfe('0x5e'),_0x34eb17));if(_0x34eb17!=='unmanaged'){logger[_0x6bfe('0x23')]('['+_0x34eb17[_0x6bfe('0x16')]()+']',_0x6bfe('0x5f'));emit(_0x1aa923[_0x6bfe('0x51')],_0xc58ca6[_0x6bfe('0x60')],_0x24e06f[_0x6bfe('0x3e')],_0x39f472['ticketId']);}})['catch'](function(_0x402540){logger[_0x6bfe('0x61')]('['+_0x34eb17['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x402540['message']);});}; \ 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 d7d3910..6b5b5c4 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 _0x9d6f=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','[OUTBOUND]','recordingURL','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','%s/api/v2/agents','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','map','includes','string','picklist','type','nameField','toLowerCase','toString','idField','variable','variableName','customField','push','customVariable','Variable','stripTrailingSlash','serverUrl'];(function(_0x3a9fe5,_0x9d534f){var _0x31e8c6=function(_0x5f0a5b){while(--_0x5f0a5b){_0x3a9fe5['push'](_0x3a9fe5['shift']());}};_0x31e8c6(++_0x9d534f);}(_0x9d6f,0x18d));var _0xf9d6=function(_0x313666,_0x17bdf0){_0x313666=_0x313666-0x0;var _0x3bea3c=_0x9d6f[_0x313666];return _0x3bea3c;};'use strict';var _=require(_0xf9d6('0x0'));var rp=require(_0xf9d6('0x1'));var md5=require('md5');var util=require(_0xf9d6('0x2'));var Redis=require(_0xf9d6('0x3'));var intUtil=require(_0xf9d6('0x4'));var config=require(_0xf9d6('0x5'));var logger=require('../../../../config/logger')(_0xf9d6('0x6'));config[_0xf9d6('0x7')]=_[_0xf9d6('0x8')](config['redis'],{'host':_0xf9d6('0x9'),'port':0x18eb});var io=require(_0xf9d6('0xa'))(new Redis(config[_0xf9d6('0x7')]));var headers={'Content-Type':_0xf9d6('0xb'),'Accept':'application/json'};function emit(_0x589a3b,_0x20bc0c,_0x53404e){io['to'](_0x589a3b)[_0xf9d6('0xc')](_0x20bc0c,_0x53404e);}function getTicket(_0x3af13c,_0x5e62df,_0x517039,_0x27a84b,_0x4624bf){logger[_0xf9d6('0xd')](_0xf9d6('0xe'));var _0x2923bb=_['merge']({'responder_id':_0x5e62df['id'],'requester_id':_0x517039['id'],'name':util[_0xf9d6('0xf')](_0xf9d6('0x10'),_0x4624bf['calleridname']),'phone':_0x4624bf[_0xf9d6('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf9d6('0x12')](_0x27a84b[_0xf9d6('0x13')],_0x4624bf,'\x20'),'description':intUtil[_0xf9d6('0x12')](_0x27a84b[_0xf9d6('0x14')],_0x4624bf,_0xf9d6('0x15')),'tags':getTags(_0x27a84b[_0xf9d6('0x16')],_0xf9d6('0x17'))},getCustomFields(_0x27a84b[_0xf9d6('0x18')],_0x4624bf));_0x2923bb[_0xf9d6('0x19')]=_[_0xf9d6('0x1a')](_[_0xf9d6('0x1b')](_0x2923bb[_0xf9d6('0x19')],'id'),_0xf9d6('0x1c'));return request({'uri':util[_0xf9d6('0xf')](_0xf9d6('0x1d'),_0x3af13c[_0xf9d6('0x1e')]),'method':'POST','body':_0x2923bb})[_0xf9d6('0x1f')](function(_0x1700f9){logger[_0xf9d6('0xd')]('Ticket\x20created!');return _0x1700f9;});}function getUser(_0x42b84b,_0x2f1f2f){if(intUtil['validateEmail'](_0x2f1f2f)){return request({'uri':util[_0xf9d6('0xf')](_0xf9d6('0x20'),_0x42b84b[_0xf9d6('0x1e')]),'qs':{'email':_0x2f1f2f}})[_0xf9d6('0x1f')](function(_0x2f6b79){if(_0x2f6b79[_0xf9d6('0x21')]){logger[_0xf9d6('0xd')](_0xf9d6('0x22'));return _[_0xf9d6('0x23')](_0x2f6b79,function(_0x367805){return _0x367805['contact'][_0xf9d6('0x24')]===_0x2f1f2f;});}else{logger['info'](_0xf9d6('0x25'));return request({'uri':util['format'](_0xf9d6('0x26'),_0x42b84b[_0xf9d6('0x1e')])})[_0xf9d6('0x1f')](function(_0x1c44d4){logger[_0xf9d6('0xd')]('Admin\x20account\x20selected.');return _0x1c44d4;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf9d6('0xf')]('%s/api/v2/agents/me',_0x42b84b[_0xf9d6('0x1e')])})[_0xf9d6('0x1f')](function(_0x3bd5a5){logger[_0xf9d6('0xd')](_0xf9d6('0x27'));return _0x3bd5a5;});}}function getEndUser(_0x1a1ad9,_0x14a07d,_0x453a11){logger[_0xf9d6('0xd')](_0xf9d6('0x28'),_0x453a11);return request({'uri':util[_0xf9d6('0xf')](_0xf9d6('0x29'),_0x1a1ad9[_0xf9d6('0x1e')]),'qs':{'phone':_0x453a11}})[_0xf9d6('0x1f')](function(_0x4f899d){if(_0x4f899d['length']){logger[_0xf9d6('0xd')](_0xf9d6('0x2a'));return _[_0xf9d6('0x23')](_0x4f899d,{'phone':_0x453a11});}else{logger['info'](_0xf9d6('0x2b'));return request({'uri':util[_0xf9d6('0xf')](_0xf9d6('0x29'),_0x1a1ad9['remoteUri']),'method':'POST','body':{'name':_0x14a07d,'phone':_0x453a11}})[_0xf9d6('0x1f')](function(_0x50c55d){logger[_0xf9d6('0xd')]('Enduser\x20created.');return _0x50c55d;});}});}function getAuth(_0x4818c9){return util[_0xf9d6('0xf')](_0xf9d6('0x2c'),new Buffer(_0x4818c9[_0xf9d6('0x2d')]+':X')['toString'](_0xf9d6('0x2e')));}function request(_0x3e59e1){logger[_0xf9d6('0x2f')](_0xf9d6('0x30'),JSON[_0xf9d6('0x31')](_0x3e59e1));return rp(_[_0xf9d6('0x8')](_0x3e59e1,{'method':_0xf9d6('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x325776,_0x308a73){var _0x62cbdc=[];if(_0x325776&&_0x325776[_0xf9d6('0x21')]>0x0){_0x62cbdc=_[_0xf9d6('0x33')](_0x325776,_0x308a73);}return _0x62cbdc;}function getCustomFields(_0x36b16a,_0x46db6c){var _0x5be10e=[];var _0x468972={'custom_fields':[]};if(_0x36b16a[_0xf9d6('0x21')]>0x0){_['forEach'](_0x36b16a,function(_0x4de5f8){if(_[_0xf9d6('0x34')]([_0xf9d6('0x35'),_0xf9d6('0x36')],_0x4de5f8[_0xf9d6('0x37')])&&_0x4de5f8['nameField']&&!_0x4de5f8['customField']){_0x468972[_0x4de5f8[_0xf9d6('0x38')][_0xf9d6('0x39')]()]=_0x4de5f8['content'][_0xf9d6('0x3a')]();}else if(_['includes']([_0xf9d6('0x35'),_0xf9d6('0x36')],_0x4de5f8[_0xf9d6('0x37')])&&_0x4de5f8['idField']&&_0x4de5f8['customField']){_0x468972['custom_fields']['push']({'id':_0x4de5f8[_0xf9d6('0x3b')],'value':_0x4de5f8['content'][_0xf9d6('0x3a')]()});}else if(_0x4de5f8[_0xf9d6('0x37')]===_0xf9d6('0x3c')&&_0x4de5f8[_0xf9d6('0x3d')]&&_0x4de5f8[_0xf9d6('0x3b')]&&_0x4de5f8[_0xf9d6('0x3e')]){_0x46db6c[_0x4de5f8[_0xf9d6('0x3d')]]&&_0x468972[_0xf9d6('0x19')][_0xf9d6('0x3f')]({'id':_0x4de5f8['idField'],'value':_0x46db6c[_0x4de5f8['variableName']][_0xf9d6('0x3a')]()});}else if(_0x4de5f8[_0xf9d6('0x37')]===_0xf9d6('0x40')&&_0x4de5f8[_0xf9d6('0x41')]&&_0x4de5f8[_0xf9d6('0x41')][_0xf9d6('0x17')]&&_0x4de5f8['idField']&&_0x4de5f8['customField']){_0x46db6c[_0x4de5f8[_0xf9d6('0x41')][_0xf9d6('0x17')][_0xf9d6('0x39')]()]&&_0x468972[_0xf9d6('0x19')][_0xf9d6('0x3f')]({'id':_0x4de5f8['idField'],'value':_0x46db6c[_0x4de5f8[_0xf9d6('0x41')][_0xf9d6('0x17')][_0xf9d6('0x39')]()]['toString']()});}});}return _0x468972;}exports['queue']=function(_0x5a69e7,_0x3ba451,_0x2b514f,_0x8e04e8,_0x19d91a,_0x12d5a6){var _0x591e1a,_0x1b1c91;_0x12d5a6[_0xf9d6('0x1e')]=intUtil[_0xf9d6('0x42')](_0x12d5a6[_0xf9d6('0x1e')]);_0x12d5a6[_0xf9d6('0x43')]=intUtil[_0xf9d6('0x42')](_0x12d5a6[_0xf9d6('0x43')]);if(_0x19d91a&&_0x19d91a[_0xf9d6('0x44')]){logger['info'](_0xf9d6('0x45'),_0xf9d6('0x46'));_0x3ba451['recordingURL']=util['format'](_0xf9d6('0x47'),_0x12d5a6[_0xf9d6('0x43')],_0x3ba451[_0xf9d6('0x48')],md5(_0x3ba451[_0xf9d6('0x48')]));}else{_0x3ba451['recordingURL']='';}headers[_0xf9d6('0x49')]=getAuth(_0x12d5a6);return getUser(_0x12d5a6,_0x8e04e8['email'])[_0xf9d6('0x1f')](function(_0x261e04){_0x591e1a=_0x261e04;logger[_0xf9d6('0xd')]('The\x20User\x20ID\x20is:',_0x591e1a['id']);return getEndUser(_0x12d5a6,_0x3ba451[_0xf9d6('0x4a')],_0x3ba451[_0xf9d6('0x11')]);})[_0xf9d6('0x1f')](function(_0x4682a5){_0x1b1c91=_0x4682a5;logger[_0xf9d6('0xd')](_0xf9d6('0x4b'),_0x1b1c91['id']);return getTicket(_0x12d5a6,_0x591e1a,_0x1b1c91,_0x2b514f,_0x3ba451);})[_0xf9d6('0x1f')](function(_0xf88896){if(_0xf88896&&_0xf88896['id']){logger[_0xf9d6('0xd')](_0xf9d6('0x4c'));logger[_0xf9d6('0xd')]('The\x20Ticket\x20ID\x20is:',_0xf88896['id']);logger[_0xf9d6('0xd')]('[QUEUE]',_0xf9d6('0x4d'));emit(util[_0xf9d6('0xf')](_0xf9d6('0x4e'),_0x8e04e8['name']),_0xf9d6('0x4f'),{'uri':util[_0xf9d6('0xf')]('%s/helpdesk/tickets/%d',_0x12d5a6[_0xf9d6('0x1e')],_0xf88896['id'])});}})[_0xf9d6('0x50')](function(_0x33cb9c){logger[_0xf9d6('0x51')](_0xf9d6('0x45'),JSON[_0xf9d6('0x31')](_0x33cb9c));});};exports[_0xf9d6('0x52')]=function(_0x2efcbf,_0xfee4d3,_0x1f5681,_0xc0a92b,_0x45d96b,_0x47f05a,_0x1a04fb){var _0x3d7aaa,_0x4b5af1;_0x47f05a[_0xf9d6('0x1e')]=intUtil[_0xf9d6('0x42')](_0x47f05a[_0xf9d6('0x1e')]);_0x47f05a[_0xf9d6('0x43')]=intUtil['stripTrailingSlash'](_0x47f05a[_0xf9d6('0x43')]);if(_0x1a04fb&&_0x1a04fb[_0xf9d6('0x53')]&&_0x1a04fb[_0xf9d6('0x53')]!=='none'){logger[_0xf9d6('0xd')](_0xf9d6('0x54'),_0xf9d6('0x46'));_0xfee4d3[_0xf9d6('0x55')]=util[_0xf9d6('0xf')](_0xf9d6('0x47'),_0x47f05a[_0xf9d6('0x43')],_0xfee4d3[_0xf9d6('0x48')],md5(_0xfee4d3[_0xf9d6('0x48')]));}headers[_0xf9d6('0x49')]=getAuth(_0x47f05a);return getUser(_0x47f05a,_0xc0a92b['email'])[_0xf9d6('0x1f')](function(_0x2e3f87){_0x3d7aaa=_0x2e3f87;logger[_0xf9d6('0xd')](_0xf9d6('0x56'),_0x3d7aaa['id']);return getEndUser(_0x47f05a,_0xfee4d3[_0xf9d6('0x57')],_0xfee4d3[_0xf9d6('0x58')]);})[_0xf9d6('0x1f')](function(_0x439ada){_0x4b5af1=_0x439ada;logger[_0xf9d6('0xd')](_0xf9d6('0x4b'),_0x4b5af1['id']);return getTicket(_0x47f05a,_0x3d7aaa,_0x4b5af1,_0x1f5681,_0xfee4d3);})['then'](function(_0x5a78d9){if(_0x5a78d9&&_0x5a78d9['id']){logger['info'](_0xf9d6('0x4c'));logger[_0xf9d6('0xd')](_0xf9d6('0x59'),_0x5a78d9['id']);logger['info']('[OUTBOUND]',_0xf9d6('0x4d'));emit(util[_0xf9d6('0xf')](_0xf9d6('0x4e'),_0xc0a92b[_0xf9d6('0x17')]),_0xf9d6('0x4f'),{'uri':util[_0xf9d6('0xf')]('%s/helpdesk/tickets/%d',_0x47f05a['remoteUri'],_0x5a78d9['id'])});}})[_0xf9d6('0x50')](function(_0x4b1cf5){logger[_0xf9d6('0x51')](_0xf9d6('0x54'),JSON[_0xf9d6('0x31')](_0x4b1cf5));});};exports[_0xf9d6('0x5a')]=function(_0xfe46a5,_0x7e024d,_0x1a51d9,_0x471106,_0x2040ae,_0x485ce2){var _0xbac766,_0x566a93;_0x485ce2['remoteUri']=intUtil['stripTrailingSlash'](_0x485ce2[_0xf9d6('0x1e')]);_0x485ce2[_0xf9d6('0x43')]=intUtil['stripTrailingSlash'](_0x485ce2[_0xf9d6('0x43')]);if(_0x2040ae&&_0x2040ae[_0xf9d6('0x44')]){logger[_0xf9d6('0xd')]('['+_0x7e024d[_0xf9d6('0x5b')][_0xf9d6('0x5c')]()+']',_0xf9d6('0x46'));_0x7e024d['recordingURL']=util[_0xf9d6('0xf')](_0xf9d6('0x47'),_0x485ce2['serverUrl'],_0x7e024d['uniqueid'],md5(_0x7e024d[_0xf9d6('0x48')]));}else{_0x7e024d[_0xf9d6('0x55')]='';}headers[_0xf9d6('0x49')]=getAuth(_0x485ce2);return getUser(_0x485ce2,'')['then'](function(_0x33157e){_0xbac766=_0x33157e;logger[_0xf9d6('0xd')]('The\x20User\x20ID\x20is:',_0xbac766['id']);return getEndUser(_0x485ce2,_0x7e024d['calleridname'],_0x7e024d['calleridnum']);})[_0xf9d6('0x1f')](function(_0x2c72b3){_0x566a93=_0x2c72b3;logger[_0xf9d6('0xd')](_0xf9d6('0x4b'),_0x566a93['id']);return getTicket(_0x485ce2,_0xbac766,_0x566a93,_0x1a51d9,_0x7e024d);})[_0xf9d6('0x1f')](function(_0x25082f){if(_0x25082f){logger[_0xf9d6('0xd')]('Ticket\x20created!');logger[_0xf9d6('0xd')](_0xf9d6('0x59'),_0x25082f['id']);}})[_0xf9d6('0x50')](function(_0x4194e3){logger['error']('['+_0x7e024d[_0xf9d6('0x5b')][_0xf9d6('0x5c')]()+']',JSON['stringify'](_0x4194e3));});}; \ No newline at end of file +var _0x5f14=['toLowerCase','queue','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','unmanaged','monitor_format','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','getString','Subjects','Descriptions','
','name','Fields','custom_fields','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','POST','Enduser\x20created.','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','forEach','includes','picklist','type','nameField','customField','content','string','push','idField','variable','variableName','customVariable','Variable'];(function(_0x58016b,_0x4b37cb){var _0xde1c8c=function(_0x3ab67e){while(--_0x3ab67e){_0x58016b['push'](_0x58016b['shift']());}};_0xde1c8c(++_0x4b37cb);}(_0x5f14,0x72));var _0x45f1=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0x5f14[_0x427d3a];return _0xe5c521;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x45f1('0x0'));var Redis=require(_0x45f1('0x1'));var intUtil=require('./util');var config=require(_0x45f1('0x2'));var logger=require(_0x45f1('0x3'))(_0x45f1('0x4'));config[_0x45f1('0x5')]=_[_0x45f1('0x6')](config[_0x45f1('0x5')],{'host':_0x45f1('0x7'),'port':0x18eb});var io=require(_0x45f1('0x8'))(new Redis(config[_0x45f1('0x5')]));var headers={'Content-Type':_0x45f1('0x9'),'Accept':'application/json'};function emit(_0x4acc84,_0xbaffc7,_0xd764a0){io['to'](_0x4acc84)[_0x45f1('0xa')](_0xbaffc7,_0xd764a0);}function getTicket(_0x430f82,_0x5d9e40,_0x1b89d1,_0xc2f755,_0x12e6ab){logger[_0x45f1('0xb')](_0x45f1('0xc'));var _0x49d901=_[_0x45f1('0xd')]({'responder_id':_0x5d9e40['id'],'requester_id':_0x1b89d1['id'],'name':util[_0x45f1('0xe')](_0x45f1('0xf'),_0x12e6ab[_0x45f1('0x10')]),'phone':_0x12e6ab['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x45f1('0x11')](_0xc2f755[_0x45f1('0x12')],_0x12e6ab,'\x20'),'description':intUtil[_0x45f1('0x11')](_0xc2f755[_0x45f1('0x13')],_0x12e6ab,_0x45f1('0x14')),'tags':getTags(_0xc2f755['Tags'],_0x45f1('0x15'))},getCustomFields(_0xc2f755[_0x45f1('0x16')],_0x12e6ab));_0x49d901[_0x45f1('0x17')]=_['mapValues'](_['keyBy'](_0x49d901[_0x45f1('0x17')],'id'),_0x45f1('0x18'));return request({'uri':util[_0x45f1('0xe')](_0x45f1('0x19'),_0x430f82[_0x45f1('0x1a')]),'method':'POST','body':_0x49d901})[_0x45f1('0x1b')](function(_0x405d08){logger['info'](_0x45f1('0x1c'));return _0x405d08;});}function getUser(_0xaeac75,_0x3c9dea){if(intUtil[_0x45f1('0x1d')](_0x3c9dea)){return request({'uri':util[_0x45f1('0xe')](_0x45f1('0x1e'),_0xaeac75['remoteUri']),'qs':{'email':_0x3c9dea}})['then'](function(_0x36479e){if(_0x36479e[_0x45f1('0x1f')]){logger[_0x45f1('0xb')](_0x45f1('0x20'));return _[_0x45f1('0x21')](_0x36479e,function(_0x3f5eea){return _0x3f5eea[_0x45f1('0x22')][_0x45f1('0x23')]===_0x3c9dea;});}else{logger[_0x45f1('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x45f1('0xe')](_0x45f1('0x24'),_0xaeac75[_0x45f1('0x1a')])})[_0x45f1('0x1b')](function(_0x32dd11){logger[_0x45f1('0xb')]('Admin\x20account\x20selected.');return _0x32dd11;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x45f1('0xe')]('%s/api/v2/agents/me',_0xaeac75[_0x45f1('0x1a')])})[_0x45f1('0x1b')](function(_0x488f98){logger[_0x45f1('0xb')](_0x45f1('0x25'));return _0x488f98;});}}function getEndUser(_0x13a3b2,_0x199207,_0xa77bf4){logger[_0x45f1('0xb')](_0x45f1('0x26'),_0xa77bf4);return request({'uri':util[_0x45f1('0xe')](_0x45f1('0x27'),_0x13a3b2[_0x45f1('0x1a')]),'qs':{'phone':_0xa77bf4}})['then'](function(_0x17ca57){if(_0x17ca57[_0x45f1('0x1f')]){logger['info']('Enduser\x20found!');return _[_0x45f1('0x21')](_0x17ca57,{'phone':_0xa77bf4});}else{logger[_0x45f1('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x45f1('0x27'),_0x13a3b2[_0x45f1('0x1a')]),'method':_0x45f1('0x28'),'body':{'name':_0x199207,'phone':_0xa77bf4}})[_0x45f1('0x1b')](function(_0x440ab3){logger[_0x45f1('0xb')](_0x45f1('0x29'));return _0x440ab3;});}});}function getAuth(_0x3d97ed){return util[_0x45f1('0xe')](_0x45f1('0x2a'),new Buffer(_0x3d97ed['apiKey']+':X')[_0x45f1('0x2b')](_0x45f1('0x2c')));}function request(_0x375f95){logger['debug'](_0x45f1('0x2d'),JSON[_0x45f1('0x2e')](_0x375f95));return rp(_[_0x45f1('0x6')](_0x375f95,{'method':_0x45f1('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x25b109,_0x1bf697){var _0x14bd2b=[];if(_0x25b109&&_0x25b109['length']>0x0){_0x14bd2b=_['map'](_0x25b109,_0x1bf697);}return _0x14bd2b;}function getCustomFields(_0x455227,_0x53e032){var _0x4dd7d8=[];var _0x39ca9e={'custom_fields':[]};if(_0x455227['length']>0x0){_[_0x45f1('0x30')](_0x455227,function(_0x2d6aec){if(_[_0x45f1('0x31')](['string',_0x45f1('0x32')],_0x2d6aec[_0x45f1('0x33')])&&_0x2d6aec[_0x45f1('0x34')]&&!_0x2d6aec[_0x45f1('0x35')]){_0x39ca9e[_0x2d6aec[_0x45f1('0x34')]['toLowerCase']()]=_0x2d6aec[_0x45f1('0x36')][_0x45f1('0x2b')]();}else if(_['includes']([_0x45f1('0x37'),'picklist'],_0x2d6aec[_0x45f1('0x33')])&&_0x2d6aec['idField']&&_0x2d6aec[_0x45f1('0x35')]){_0x39ca9e[_0x45f1('0x17')][_0x45f1('0x38')]({'id':_0x2d6aec[_0x45f1('0x39')],'value':_0x2d6aec['content'][_0x45f1('0x2b')]()});}else if(_0x2d6aec[_0x45f1('0x33')]===_0x45f1('0x3a')&&_0x2d6aec[_0x45f1('0x3b')]&&_0x2d6aec[_0x45f1('0x39')]&&_0x2d6aec['customField']){_0x53e032[_0x2d6aec[_0x45f1('0x3b')]]&&_0x39ca9e[_0x45f1('0x17')][_0x45f1('0x38')]({'id':_0x2d6aec[_0x45f1('0x39')],'value':_0x53e032[_0x2d6aec[_0x45f1('0x3b')]][_0x45f1('0x2b')]()});}else if(_0x2d6aec[_0x45f1('0x33')]===_0x45f1('0x3c')&&_0x2d6aec['Variable']&&_0x2d6aec[_0x45f1('0x3d')]['name']&&_0x2d6aec['idField']&&_0x2d6aec[_0x45f1('0x35')]){_0x53e032[_0x2d6aec['Variable'][_0x45f1('0x15')][_0x45f1('0x3e')]()]&&_0x39ca9e[_0x45f1('0x17')]['push']({'id':_0x2d6aec[_0x45f1('0x39')],'value':_0x53e032[_0x2d6aec[_0x45f1('0x3d')][_0x45f1('0x15')]['toLowerCase']()][_0x45f1('0x2b')]()});}});}return _0x39ca9e;}exports[_0x45f1('0x3f')]=function(_0x2df5f6,_0x3d4815,_0x27da03,_0x21724b,_0x25ec3c,_0x1a920c){var _0xfdfeba,_0x303c23;_0x1a920c[_0x45f1('0x1a')]=intUtil[_0x45f1('0x40')](_0x1a920c['remoteUri']);_0x1a920c[_0x45f1('0x41')]=intUtil[_0x45f1('0x40')](_0x1a920c[_0x45f1('0x41')]);if(_0x25ec3c&&_0x25ec3c['monitor_format']){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x3d4815[_0x45f1('0x42')]=util[_0x45f1('0xe')](_0x45f1('0x43'),_0x1a920c['serverUrl'],_0x3d4815[_0x45f1('0x44')],md5(_0x3d4815[_0x45f1('0x44')]));}else{_0x3d4815[_0x45f1('0x42')]='';}headers[_0x45f1('0x45')]=getAuth(_0x1a920c);return getUser(_0x1a920c,_0x21724b[_0x45f1('0x23')])[_0x45f1('0x1b')](function(_0x5e8093){_0xfdfeba=_0x5e8093;logger['info']('The\x20User\x20ID\x20is:',_0xfdfeba['id']);return getEndUser(_0x1a920c,_0x3d4815['calleridname'],_0x3d4815[_0x45f1('0x46')]);})[_0x45f1('0x1b')](function(_0x20b859){_0x303c23=_0x20b859;logger[_0x45f1('0xb')](_0x45f1('0x47'),_0x303c23['id']);return getTicket(_0x1a920c,_0xfdfeba,_0x303c23,_0x27da03,_0x3d4815);})['then'](function(_0x23c1fa){if(_0x23c1fa&&_0x23c1fa['id']){logger[_0x45f1('0xb')](_0x45f1('0x1c'));logger[_0x45f1('0xb')](_0x45f1('0x48'),_0x23c1fa['id']);logger[_0x45f1('0xb')](_0x45f1('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x45f1('0x4a'),_0x21724b[_0x45f1('0x15')]),_0x45f1('0x4b'),{'uri':util[_0x45f1('0xe')]('%s/helpdesk/tickets/%d',_0x1a920c[_0x45f1('0x1a')],_0x23c1fa['id'])});}})['catch'](function(_0x217aee){logger[_0x45f1('0x4c')](_0x45f1('0x49'),JSON[_0x45f1('0x2e')](_0x217aee));});};exports[_0x45f1('0x4d')]=function(_0x36afbb,_0x4c9a14,_0x17362d,_0x484a49,_0x5bdc48,_0x45697d,_0x13f2db){var _0x404325,_0x2e4eae;_0x45697d[_0x45f1('0x1a')]=intUtil['stripTrailingSlash'](_0x45697d['remoteUri']);_0x45697d[_0x45f1('0x41')]=intUtil['stripTrailingSlash'](_0x45697d[_0x45f1('0x41')]);if(_0x13f2db&&_0x13f2db[_0x45f1('0x4e')]&&_0x13f2db['recordingFormat']!==_0x45f1('0x4f')){logger['info'](_0x45f1('0x50'),_0x45f1('0x51'));_0x4c9a14['recordingURL']=util[_0x45f1('0xe')](_0x45f1('0x43'),_0x45697d['serverUrl'],_0x4c9a14[_0x45f1('0x44')],md5(_0x4c9a14[_0x45f1('0x44')]));}headers[_0x45f1('0x45')]=getAuth(_0x45697d);return getUser(_0x45697d,_0x484a49[_0x45f1('0x23')])[_0x45f1('0x1b')](function(_0x3e7f1b){_0x404325=_0x3e7f1b;logger[_0x45f1('0xb')](_0x45f1('0x52'),_0x404325['id']);return getEndUser(_0x45697d,_0x4c9a14['destcalleridname'],_0x4c9a14['destcalleridnum']);})[_0x45f1('0x1b')](function(_0x3584b7){_0x2e4eae=_0x3584b7;logger[_0x45f1('0xb')]('The\x20Enduser\x20ID\x20is:',_0x2e4eae['id']);return getTicket(_0x45697d,_0x404325,_0x2e4eae,_0x17362d,_0x4c9a14);})['then'](function(_0x267fe1){if(_0x267fe1&&_0x267fe1['id']){logger['info'](_0x45f1('0x1c'));logger[_0x45f1('0xb')](_0x45f1('0x48'),_0x267fe1['id']);logger[_0x45f1('0xb')](_0x45f1('0x50'),_0x45f1('0x53'));emit(util[_0x45f1('0xe')]('user:%s',_0x484a49[_0x45f1('0x15')]),_0x45f1('0x4b'),{'uri':util[_0x45f1('0xe')](_0x45f1('0x54'),_0x45697d[_0x45f1('0x1a')],_0x267fe1['id'])});}})[_0x45f1('0x55')](function(_0x4b7b4a){logger[_0x45f1('0x4c')](_0x45f1('0x50'),JSON[_0x45f1('0x2e')](_0x4b7b4a));});};exports[_0x45f1('0x56')]=function(_0x4a1af6,_0x3dd57e,_0x287431,_0x442c54,_0x3ca09a,_0x212b25){var _0xd0ccf6,_0x5c3918;_0x212b25[_0x45f1('0x1a')]=intUtil[_0x45f1('0x40')](_0x212b25['remoteUri']);_0x212b25[_0x45f1('0x41')]=intUtil[_0x45f1('0x40')](_0x212b25[_0x45f1('0x41')]);if(_0x3ca09a&&_0x3ca09a[_0x45f1('0x57')]){logger[_0x45f1('0xb')]('['+_0x3dd57e['lastevent']['toUpperCase']()+']',_0x45f1('0x51'));_0x3dd57e[_0x45f1('0x42')]=util[_0x45f1('0xe')](_0x45f1('0x43'),_0x212b25[_0x45f1('0x41')],_0x3dd57e['uniqueid'],md5(_0x3dd57e[_0x45f1('0x44')]));}else{_0x3dd57e['recordingURL']='';}headers[_0x45f1('0x45')]=getAuth(_0x212b25);return getUser(_0x212b25,'')[_0x45f1('0x1b')](function(_0x2d8f34){_0xd0ccf6=_0x2d8f34;logger['info'](_0x45f1('0x52'),_0xd0ccf6['id']);return getEndUser(_0x212b25,_0x3dd57e[_0x45f1('0x10')],_0x3dd57e[_0x45f1('0x46')]);})[_0x45f1('0x1b')](function(_0xe3f71f){_0x5c3918=_0xe3f71f;logger[_0x45f1('0xb')]('The\x20Enduser\x20ID\x20is:',_0x5c3918['id']);return getTicket(_0x212b25,_0xd0ccf6,_0x5c3918,_0x287431,_0x3dd57e);})['then'](function(_0x531b62){if(_0x531b62){logger[_0x45f1('0xb')](_0x45f1('0x1c'));logger[_0x45f1('0xb')](_0x45f1('0x48'),_0x531b62['id']);}})[_0x45f1('0x55')](function(_0x54c378){logger[_0x45f1('0x4c')]('['+_0x3dd57e['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x54c378));});}; \ 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 a37b237..707283e 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 _0x632a=['format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','Contact\x20created:','POST','Creating\x20new\x20task','getString','Subjects','Descriptions','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','/contacts/','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20with\x20email','userEmail','agentEmail','userId','User\x20found:','Admin\x20selected','adminEmail','toUpperCase','/api/lookup?q=','&f=','&entities=contact','contacts'];(function(_0x254d43,_0x50d0b8){var _0x477c5d=function(_0x3e7eb7){while(--_0x3e7eb7){_0x254d43['push'](_0x254d43['shift']());}};_0x477c5d(++_0x50d0b8);}(_0x632a,0x110));var _0xa632=function(_0x145ac8,_0x511278){_0x145ac8=_0x145ac8-0x0;var _0x4ef5ba=_0x632a[_0x145ac8];return _0x4ef5ba;};'use strict';var _=require(_0xa632('0x0'));var rp=require(_0xa632('0x1'));var md5=require('md5');var util=require('util');var moment=require('moment');var Promise=require(_0xa632('0x2'));var Redis=require(_0xa632('0x3'));var intUtil=require('./util');var config=require(_0xa632('0x4'));var logger=require(_0xa632('0x5'))(_0xa632('0x6'));config[_0xa632('0x7')]=_[_0xa632('0x8')](config[_0xa632('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xa632('0x9'))(new Redis(config[_0xa632('0x7')]));function getAdminId(_0x590240,_0x5a8d54,_0x57568f,_0x1f11fa){return new Promise(function(_0x2d6b48,_0x4e8e1c){var _0x26bd8a=![];var _0x3c1c95={'method':_0xa632('0xa'),'uri':_0x1f11fa+_0xa632('0xb'),'json':!![]};_0x3c1c95[_0xa632('0xc')]=_0x57568f;logger[_0xa632('0xd')](_0xa632('0xe'));return rp(_0x3c1c95)[_0xa632('0xf')](function(_0x2f5b9b){if(_0x2f5b9b){var _0x31434d=_0x2f5b9b['users'];var _0x2f1a09=null;for(_0x2f1a09=0x0;_0x2f1a09<_0x31434d[_0xa632('0x10')];_0x2f1a09++){if(_0x31434d[_0x2f1a09][_0xa632('0x11')]===_0x590240['adminEmail']){_0x590240[_0xa632('0x12')]=_0x31434d[_0x2f1a09]['id'];_0x26bd8a=!![];}}if(_0x26bd8a){logger['info'](_0xa632('0x13'),_0x590240[_0xa632('0x12')]);_0x2d6b48(_0x590240);}else{_0x4e8e1c({'statusCode':0x194,'message':_0xa632('0x14')});}}else{_0x4e8e1c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xa632('0x15')](function(_0x2ce96e){logger[_0xa632('0x16')]('['+[_0x5a8d54['toUpperCase']()]+']',_0x2ce96e[_0xa632('0x17')]);_0x4e8e1c(_0x2ce96e);});});}function getUser(_0x3190ad,_0x4eb373,_0x5e4c80){return function(_0x175d56){return new Promise(function(_0x488a11,_0x3273a4){var _0x2cbf5b={'method':_0xa632('0xa'),'uri':_0x5e4c80+_0xa632('0xb'),'json':!![]};_0x2cbf5b[_0xa632('0xc')]=_0x4eb373;logger[_0xa632('0xd')]('Getting\x20user\x20list');return rp(_0x2cbf5b)['then'](function(_0x21ac88){if(_0x21ac88){var _0x4b0c68=_0x21ac88['users'];var _0x2ad82d=![];var _0x4b1607=null;if(_0x175d56['agentEmail']!==null){logger[_0xa632('0xd')](_0xa632('0x18'),_0x175d56['agentEmail']);_0x175d56[_0xa632('0x19')]=_0x175d56[_0xa632('0x1a')];for(_0x4b1607=0x0;_0x4b1607<_0x4b0c68[_0xa632('0x10')];_0x4b1607++){if(_0x4b0c68[_0x4b1607][_0xa632('0x11')]===_0x175d56['agentEmail']){_0x2ad82d=!![];_0x175d56[_0xa632('0x1b')]=_0x4b0c68[_0x4b1607]['id'];logger[_0xa632('0xd')](_0xa632('0x1c'),_0x175d56[_0xa632('0x1b')]);}}}if(!_0x2ad82d){logger[_0xa632('0xd')](_0xa632('0x1d'));_0x175d56['userEmail']=_0x175d56[_0xa632('0x1e')];_0x175d56['userId']=_0x175d56[_0xa632('0x12')];_0x2ad82d=!![];}if(_0x2ad82d){_0x488a11(_0x175d56);}else{_0x3273a4({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3273a4({'statusCode':0x194,'message':_0xa632('0x14')});}})['catch'](function(_0x539bda){logger[_0xa632('0x16')]('['+[_0x3190ad[_0xa632('0x1f')]()]+']',_0x539bda['message']);_0x3273a4(_0x539bda);});});};}function searchContact(_0x179181,_0x3b4747,_0x5c56d3,_0x1f40e8){return new Promise(function(_0x1c542b,_0x1fd64d){var _0x2b60b0={'method':_0xa632('0xa'),'headers':_0x3b4747,'uri':_0x179181+_0xa632('0x20')+_0x1f40e8+_0xa632('0x21')+_0x5c56d3+_0xa632('0x22'),'json':!![]};rp(_0x2b60b0)[_0xa632('0xf')](function(_0x250203){var _0x1ae50d=_['find'](_0x250203[_0xa632('0x23')][_0xa632('0x23')],[_0x5c56d3,_0x1f40e8]);_0x1c542b(_0x1ae50d);})[_0xa632('0x15')](function(_0x2e55d9){_0x1fd64d(_0x2e55d9);});});}function getEndUser(_0x8d0a88,_0x17a524,_0x35f831){return function(_0x4612c2){return new Promise(function(_0x358172,_0x330a7d){logger[_0xa632('0xd')](util[_0xa632('0x24')](_0xa632('0x25'),_0x4612c2[_0xa632('0x26')]));searchContact(_0x35f831,_0x17a524,'mobile_number',_0x4612c2['contactNumber'])[_0xa632('0xf')](function(_0x1079d0){if(_0x1079d0){_0x4612c2[_0xa632('0x27')]=_0x1079d0['id'];logger[_0xa632('0xd')](_0xa632('0x28'),_0x4612c2[_0xa632('0x27')]);return _0x358172(_0x4612c2);}searchContact(_0x35f831,_0x17a524,'work_number',_0x4612c2[_0xa632('0x26')])[_0xa632('0xf')](function(_0x314797){if(_0x314797){_0x4612c2[_0xa632('0x27')]=_0x314797['id'];logger[_0xa632('0xd')]('Contact\x20found\x20work_number:',_0x4612c2[_0xa632('0x27')]);return _0x358172(_0x4612c2);}createEndUser(_0x4612c2,_0x8d0a88,_0x17a524,_0x35f831)['then'](function(_0x20495d){logger[_0xa632('0xd')](_0xa632('0x29'),_0x20495d['endUserId']);return _0x358172(_0x20495d);});});})[_0xa632('0x15')](function(_0x26e69c){_0x330a7d(_0x26e69c);});});};}function createEndUser(_0x5b2e95,_0x387f46,_0x22e473,_0x3a1c5d){return new Promise(function(_0x51b934,_0x4ab48e){var _0x3ebd1c=moment();var _0x32ad6d={'method':_0xa632('0x2a'),'uri':_0x3a1c5d+'/api/contacts','body':{'contact':{'last_name':_0x5b2e95[_0xa632('0x26')],'work_number':_0x5b2e95[_0xa632('0x26')],'mobile_number':_0x5b2e95['contactNumber'],'owner_id':_0x5b2e95[_0xa632('0x1b')],'created_at':_0x3ebd1c[_0xa632('0x24')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x32ad6d[_0xa632('0xc')]=_0x22e473;logger[_0xa632('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x32ad6d)[_0xa632('0xf')](function(_0x54d2ee){_0x5b2e95[_0xa632('0x27')]=_0x54d2ee['contact']['id'];_0x51b934(_0x5b2e95);})['catch'](function(_0x33e0e6){logger[_0xa632('0x16')]('['+[_0x387f46['toUpperCase']()]+']',_0x33e0e6['message']);_0x4ab48e(_0x33e0e6[_0xa632('0x17')]);});});}function getTicket(_0x2305bc,_0x6b3895,_0x3a3440,_0x4d8640,_0x6c11ff){return function(_0x53b0ac){logger[_0xa632('0xd')](_0xa632('0x2b'));return new Promise(function(_0x21e95d,_0x404a7a){var _0x37eb83=moment();var _0x2470ba={'method':_0xa632('0x2a'),'uri':_0x3a3440+'/api/tasks','body':{'title':intUtil[_0xa632('0x2c')](_0x4d8640[_0xa632('0x2d')],_0x6c11ff,'\x20'),'description':intUtil[_0xa632('0x2c')](_0x4d8640[_0xa632('0x2e')],_0x6c11ff,'\x0a'),'owner_id':_0x53b0ac[_0xa632('0x1b')],'creater_id':_0x53b0ac[_0xa632('0x12')],'targetable_id':_0x53b0ac[_0xa632('0x27')],'targetable_type':'Contact','created_at':_0x37eb83[_0xa632('0x24')](_0xa632('0x2f')),'due_date':_0x37eb83[_0xa632('0x30')](0x1e,'m')[_0xa632('0x24')](_0xa632('0x2f'))},'json':!![]};_0x2470ba[_0xa632('0xc')]=_0x6b3895;return rp(_0x2470ba)['then'](function(_0x22569f){_0x53b0ac['ticketId']=_0x22569f[_0xa632('0x31')]['id'];logger['info'](_0xa632('0x32'),_0x53b0ac['ticketId']);_0x21e95d(_0x53b0ac);})['catch'](function(_0x17c759){logger[_0xa632('0x16')]('['+[_0x2305bc[_0xa632('0x1f')]()]+']',_0x17c759[_0xa632('0x17')]);_0x404a7a(_0x17c759[_0xa632('0x17')]);});});};}function emit(_0x156eee,_0x3df46a,_0x873800){var _0xa4de6d={'uri':_0x156eee+_0xa632('0x33')+_0x873800};io['to'](util['format']('user:%s',_0x3df46a))['emit'](_0xa632('0x34'),_0xa4de6d);}exports['cs']=function(_0x12e6a3,_0x5922ac,_0x4842bf,_0x4a798c,_0x4d5b74,_0x3a2a00,_0xacfe59,_0x3e54b2){var _0x599027={};var _0x3376f5={'Authorization':_0xa632('0x35')+_0x3a2a00[_0xa632('0x36')]};_0x3a2a00[_0xa632('0x37')]=intUtil['stripTrailingSlash'](_0x3a2a00['remoteUri']);_0x3a2a00[_0xa632('0x38')]=intUtil[_0xa632('0x39')](_0x3a2a00[_0xa632('0x38')]);var _0x4b4df4=_0x3a2a00[_0xa632('0x37')];_0x599027['adminEmail']=_0x3a2a00[_0xa632('0x3a')];_0x599027['contactNumber']=_0x3e54b2[_0xa632('0x3b')]()===_0xa632('0x3c')?_0x5922ac[_0xa632('0x3d')]:_0x5922ac[_0xa632('0x3e')];_0x599027[_0xa632('0x3f')]=_0x3e54b2==='queue'||_0x3e54b2===_0xa632('0x40')?_0xa632('0x41'):_0xa632('0x3c');if(_0x4a798c){_0x599027[_0xa632('0x1a')]=_0x4a798c[_0xa632('0x11')];}var _0x59ee0f=util[_0xa632('0x24')](_0xa632('0x42'),_0x3a2a00[_0xa632('0x38')],_0x5922ac[_0xa632('0x43')],md5(_0x5922ac['uniqueid']));if(_0x4d5b74&&_0x4d5b74[_0xa632('0x44')]){logger[_0xa632('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0x5922ac[_0xa632('0x45')]=_0x59ee0f;}else if(_0xacfe59&&_0xacfe59[_0xa632('0x46')]&&_0xacfe59['recordingFormat']!==_0xa632('0x47')){logger[_0xa632('0xd')](_0xa632('0x48'),'Recording\x20is\x20enabled!');_0x5922ac[_0xa632('0x45')]=_0x59ee0f;}else{_0x5922ac[_0xa632('0x45')]='';}return getAdminId(_0x599027,_0x3e54b2,_0x3376f5,_0x4b4df4)['then'](getUser(_0x3e54b2,_0x3376f5,_0x4b4df4))['then'](getEndUser(_0x3e54b2,_0x3376f5,_0x4b4df4))['then'](getTicket(_0x3e54b2,_0x3376f5,_0x4b4df4,_0x4842bf,_0x5922ac))['then'](function(_0x486de9){logger[_0xa632('0xd')](util[_0xa632('0x24')](_0xa632('0x49'),_0x486de9[_0xa632('0x4a')]));if(_0x3e54b2!==_0xa632('0x40')){logger['info']('['+[_0x3e54b2['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x4b4df4,_0x4a798c[_0xa632('0x4b')],_0x486de9[_0xa632('0x27')]);}})[_0xa632('0x15')](function(_0x3dd6f9){logger['error']('['+[_0x3e54b2['toUpperCase']()]+_0xa632('0x4c'),util['inspect'](_0x3dd6f9,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd1c4=['&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','endUserId','Contact\x20found\x20mobile_number:','work_number','contactNumber','Contact\x20created:','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','add','task','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','length','userId','User\x20found:','Admin\x20selected','userEmail','adminEmail','error','/api/lookup?q='];(function(_0x57fea4,_0x20fe14){var _0x1d5621=function(_0x14c27e){while(--_0x14c27e){_0x57fea4['push'](_0x57fea4['shift']());}};_0x1d5621(++_0x20fe14);}(_0xd1c4,0x1da));var _0x4d1c=function(_0x5970ff,_0x18b1c5){_0x5970ff=_0x5970ff-0x0;var _0x186043=_0xd1c4[_0x5970ff];return _0x186043;};'use strict';var _=require(_0x4d1c('0x0'));var rp=require(_0x4d1c('0x1'));var md5=require(_0x4d1c('0x2'));var util=require('util');var moment=require(_0x4d1c('0x3'));var Promise=require(_0x4d1c('0x4'));var Redis=require(_0x4d1c('0x5'));var intUtil=require(_0x4d1c('0x6'));var config=require(_0x4d1c('0x7'));var logger=require(_0x4d1c('0x8'))(_0x4d1c('0x9'));config[_0x4d1c('0xa')]=_[_0x4d1c('0xb')](config[_0x4d1c('0xa')],{'host':_0x4d1c('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4d1c('0xa')]));function getAdminId(_0x4aa71a,_0x37ecfd,_0x2daa96,_0xcf108d){return new Promise(function(_0x27efcd,_0x344404){var _0x435673=![];var _0x5c6815={'method':_0x4d1c('0xd'),'uri':_0xcf108d+_0x4d1c('0xe'),'json':!![]};_0x5c6815[_0x4d1c('0xf')]=_0x2daa96;logger[_0x4d1c('0x10')](_0x4d1c('0x11'));return rp(_0x5c6815)[_0x4d1c('0x12')](function(_0x5d5dcc){if(_0x5d5dcc){var _0x5a2efb=_0x5d5dcc[_0x4d1c('0x13')];var _0xa89a8=null;for(_0xa89a8=0x0;_0xa89a8<_0x5a2efb['length'];_0xa89a8++){if(_0x5a2efb[_0xa89a8][_0x4d1c('0x14')]===_0x4aa71a['adminEmail']){_0x4aa71a[_0x4d1c('0x15')]=_0x5a2efb[_0xa89a8]['id'];_0x435673=!![];}}if(_0x435673){logger[_0x4d1c('0x10')]('Admin\x20found:',_0x4aa71a[_0x4d1c('0x15')]);_0x27efcd(_0x4aa71a);}else{_0x344404({'statusCode':0x194,'message':_0x4d1c('0x16')});}}else{_0x344404({'statusCode':0x194,'message':_0x4d1c('0x16')});}})[_0x4d1c('0x17')](function(_0x3454ac){logger['error']('['+[_0x37ecfd[_0x4d1c('0x18')]()]+']',_0x3454ac[_0x4d1c('0x19')]);_0x344404(_0x3454ac);});});}function getUser(_0x2fb35d,_0x14b3ff,_0x21b234){return function(_0x3d19a4){return new Promise(function(_0x3e968b,_0xb0701){var _0x16f2dc={'method':_0x4d1c('0xd'),'uri':_0x21b234+_0x4d1c('0xe'),'json':!![]};_0x16f2dc[_0x4d1c('0xf')]=_0x14b3ff;logger[_0x4d1c('0x10')]('Getting\x20user\x20list');return rp(_0x16f2dc)[_0x4d1c('0x12')](function(_0xcf8bd0){if(_0xcf8bd0){var _0x4113aa=_0xcf8bd0[_0x4d1c('0x13')];var _0x14008e=![];var _0x2c7da5=null;if(_0x3d19a4[_0x4d1c('0x1a')]!==null){logger[_0x4d1c('0x10')](_0x4d1c('0x1b'),_0x3d19a4[_0x4d1c('0x1a')]);_0x3d19a4['userEmail']=_0x3d19a4[_0x4d1c('0x1a')];for(_0x2c7da5=0x0;_0x2c7da5<_0x4113aa[_0x4d1c('0x1c')];_0x2c7da5++){if(_0x4113aa[_0x2c7da5][_0x4d1c('0x14')]===_0x3d19a4[_0x4d1c('0x1a')]){_0x14008e=!![];_0x3d19a4[_0x4d1c('0x1d')]=_0x4113aa[_0x2c7da5]['id'];logger[_0x4d1c('0x10')](_0x4d1c('0x1e'),_0x3d19a4[_0x4d1c('0x1d')]);}}}if(!_0x14008e){logger[_0x4d1c('0x10')](_0x4d1c('0x1f'));_0x3d19a4[_0x4d1c('0x20')]=_0x3d19a4[_0x4d1c('0x21')];_0x3d19a4['userId']=_0x3d19a4[_0x4d1c('0x15')];_0x14008e=!![];}if(_0x14008e){_0x3e968b(_0x3d19a4);}else{_0xb0701({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0xb0701({'statusCode':0x194,'message':_0x4d1c('0x16')});}})[_0x4d1c('0x17')](function(_0x1066eb){logger[_0x4d1c('0x22')]('['+[_0x2fb35d[_0x4d1c('0x18')]()]+']',_0x1066eb['message']);_0xb0701(_0x1066eb);});});};}function searchContact(_0x43ecea,_0xeb6012,_0x473ae0,_0x32329e){return new Promise(function(_0x2f1a77,_0x289ca9){var _0x5e602d={'method':_0x4d1c('0xd'),'headers':_0xeb6012,'uri':_0x43ecea+_0x4d1c('0x23')+_0x32329e+_0x4d1c('0x24')+_0x473ae0+_0x4d1c('0x25'),'json':!![]};rp(_0x5e602d)[_0x4d1c('0x12')](function(_0x5c99ef){var _0x308501=_[_0x4d1c('0x26')](_0x5c99ef[_0x4d1c('0x27')]['contacts'],[_0x473ae0,_0x32329e]);_0x2f1a77(_0x308501);})[_0x4d1c('0x17')](function(_0x3feedd){_0x289ca9(_0x3feedd);});});}function getEndUser(_0x4afabf,_0x1b0f31,_0x3a9aab){return function(_0x4157fc){return new Promise(function(_0x51bbc6,_0x70a2e9){logger[_0x4d1c('0x10')](util[_0x4d1c('0x28')](_0x4d1c('0x29'),_0x4157fc['contactNumber']));searchContact(_0x3a9aab,_0x1b0f31,'mobile_number',_0x4157fc['contactNumber'])[_0x4d1c('0x12')](function(_0x46db24){if(_0x46db24){_0x4157fc[_0x4d1c('0x2a')]=_0x46db24['id'];logger[_0x4d1c('0x10')](_0x4d1c('0x2b'),_0x4157fc['endUserId']);return _0x51bbc6(_0x4157fc);}searchContact(_0x3a9aab,_0x1b0f31,_0x4d1c('0x2c'),_0x4157fc[_0x4d1c('0x2d')])[_0x4d1c('0x12')](function(_0x6f32f){if(_0x6f32f){_0x4157fc[_0x4d1c('0x2a')]=_0x6f32f['id'];logger[_0x4d1c('0x10')]('Contact\x20found\x20work_number:',_0x4157fc[_0x4d1c('0x2a')]);return _0x51bbc6(_0x4157fc);}createEndUser(_0x4157fc,_0x4afabf,_0x1b0f31,_0x3a9aab)['then'](function(_0x5bd5a6){logger['info'](_0x4d1c('0x2e'),_0x5bd5a6[_0x4d1c('0x2a')]);return _0x51bbc6(_0x5bd5a6);});});})[_0x4d1c('0x17')](function(_0x341d67){_0x70a2e9(_0x341d67);});});};}function createEndUser(_0xef7fc,_0x25ec25,_0x150b06,_0xf2f3f1){return new Promise(function(_0x418f62,_0x2f4ec5){var _0x21eb6d=moment();var _0x7c67ec={'method':'POST','uri':_0xf2f3f1+'/api/contacts','body':{'contact':{'last_name':_0xef7fc[_0x4d1c('0x2d')],'work_number':_0xef7fc[_0x4d1c('0x2d')],'mobile_number':_0xef7fc['contactNumber'],'owner_id':_0xef7fc['userId'],'created_at':_0x21eb6d[_0x4d1c('0x28')](_0x4d1c('0x2f'))}},'json':!![]};_0x7c67ec[_0x4d1c('0xf')]=_0x150b06;logger[_0x4d1c('0x10')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x7c67ec)[_0x4d1c('0x12')](function(_0x33d688){_0xef7fc[_0x4d1c('0x2a')]=_0x33d688[_0x4d1c('0x30')]['id'];_0x418f62(_0xef7fc);})[_0x4d1c('0x17')](function(_0x430d50){logger[_0x4d1c('0x22')]('['+[_0x25ec25[_0x4d1c('0x18')]()]+']',_0x430d50[_0x4d1c('0x19')]);_0x2f4ec5(_0x430d50[_0x4d1c('0x19')]);});});}function getTicket(_0x59625a,_0x2b1e93,_0x534e2a,_0x3d5fa3,_0x1f84b0){return function(_0x277874){logger[_0x4d1c('0x10')](_0x4d1c('0x31'));return new Promise(function(_0x28297f,_0x4cf7b7){var _0x468938=moment();var _0x37008d={'method':_0x4d1c('0x32'),'uri':_0x534e2a+_0x4d1c('0x33'),'body':{'title':intUtil[_0x4d1c('0x34')](_0x3d5fa3[_0x4d1c('0x35')],_0x1f84b0,'\x20'),'description':intUtil['getString'](_0x3d5fa3[_0x4d1c('0x36')],_0x1f84b0,'\x0a'),'owner_id':_0x277874['userId'],'creater_id':_0x277874['adminId'],'targetable_id':_0x277874[_0x4d1c('0x2a')],'targetable_type':'Contact','created_at':_0x468938['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x468938[_0x4d1c('0x37')](0x1e,'m')[_0x4d1c('0x28')](_0x4d1c('0x2f'))},'json':!![]};_0x37008d[_0x4d1c('0xf')]=_0x2b1e93;return rp(_0x37008d)['then'](function(_0x54742c){_0x277874['ticketId']=_0x54742c[_0x4d1c('0x38')]['id'];logger[_0x4d1c('0x10')](_0x4d1c('0x39'),_0x277874[_0x4d1c('0x3a')]);_0x28297f(_0x277874);})['catch'](function(_0x29f876){logger[_0x4d1c('0x22')]('['+[_0x59625a[_0x4d1c('0x18')]()]+']',_0x29f876[_0x4d1c('0x19')]);_0x4cf7b7(_0x29f876[_0x4d1c('0x19')]);});});};}function emit(_0x1f089c,_0x24ad8d,_0x54ceaf){var _0x5f25a3={'uri':_0x1f089c+_0x4d1c('0x3b')+_0x54ceaf};io['to'](util[_0x4d1c('0x28')](_0x4d1c('0x3c'),_0x24ad8d))[_0x4d1c('0x3d')](_0x4d1c('0x3e'),_0x5f25a3);}exports['cs']=function(_0x4654a2,_0x13d33a,_0x2f9c9c,_0x3d19c8,_0x5c939d,_0x28f4b9,_0x46c348,_0xd9dec9){var _0x2aa492={};var _0x41c5c8={'Authorization':'Token\x20token='+_0x28f4b9['apiKey']};_0x28f4b9[_0x4d1c('0x3f')]=intUtil[_0x4d1c('0x40')](_0x28f4b9[_0x4d1c('0x3f')]);_0x28f4b9[_0x4d1c('0x41')]=intUtil[_0x4d1c('0x40')](_0x28f4b9[_0x4d1c('0x41')]);var _0x56bcbc=_0x28f4b9['remoteUri'];_0x2aa492[_0x4d1c('0x21')]=_0x28f4b9[_0x4d1c('0x42')];_0x2aa492[_0x4d1c('0x2d')]=_0xd9dec9[_0x4d1c('0x43')]()===_0x4d1c('0x44')?_0x13d33a[_0x4d1c('0x45')]:_0x13d33a[_0x4d1c('0x46')];_0x2aa492[_0x4d1c('0x47')]=_0xd9dec9==='queue'||_0xd9dec9===_0x4d1c('0x48')?'queue':_0x4d1c('0x44');if(_0x3d19c8){_0x2aa492['agentEmail']=_0x3d19c8[_0x4d1c('0x14')];}var _0x27f8ef=util[_0x4d1c('0x28')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x28f4b9[_0x4d1c('0x41')],_0x13d33a[_0x4d1c('0x49')],md5(_0x13d33a['uniqueid']));if(_0x5c939d&&_0x5c939d[_0x4d1c('0x4a')]){logger[_0x4d1c('0x10')](_0x4d1c('0x4b'),'Recording\x20is\x20enabled!');_0x13d33a[_0x4d1c('0x4c')]=_0x27f8ef;}else if(_0x46c348&&_0x46c348['recordingFormat']&&_0x46c348[_0x4d1c('0x4d')]!==_0x4d1c('0x4e')){logger['info'](_0x4d1c('0x4f'),_0x4d1c('0x50'));_0x13d33a['recordingURL']=_0x27f8ef;}else{_0x13d33a[_0x4d1c('0x4c')]='';}return getAdminId(_0x2aa492,_0xd9dec9,_0x41c5c8,_0x56bcbc)[_0x4d1c('0x12')](getUser(_0xd9dec9,_0x41c5c8,_0x56bcbc))['then'](getEndUser(_0xd9dec9,_0x41c5c8,_0x56bcbc))['then'](getTicket(_0xd9dec9,_0x41c5c8,_0x56bcbc,_0x2f9c9c,_0x13d33a))[_0x4d1c('0x12')](function(_0x547577){logger['info'](util['format'](_0x4d1c('0x51'),_0x547577['ticketId']));if(_0xd9dec9!==_0x4d1c('0x48')){logger['info']('['+[_0xd9dec9[_0x4d1c('0x18')]()]+']',_0x4d1c('0x52'));emit(_0x56bcbc,_0x3d19c8[_0x4d1c('0x53')],_0x547577['endUserId']);}})[_0x4d1c('0x17')](function(_0x32c890){logger[_0x4d1c('0x22')]('['+[_0xd9dec9[_0x4d1c('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x4d1c('0x54')](_0x32c890,{'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 1615e10..65b713f 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 _0xf2a0=['servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','outbound','EVENT\x20UNKNOWN','unmanaged','freshdesk','dynamics365','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./dynamics365','./freshsales','salesforce','sugarcrm','zoho','desk','vtiger','freshsales'];(function(_0x207811,_0x3420a6){var _0x170d56=function(_0x4340b7){while(--_0x4340b7){_0x207811['push'](_0x207811['shift']());}};_0x170d56(++_0x3420a6);}(_0xf2a0,0x7d));var _0x0f2a=function(_0x524bf9,_0x47462b){_0x524bf9=_0x524bf9-0x0;var _0x550148=_0xf2a0[_0x524bf9];return _0x550148;};'use strict';var _=require('lodash');var util=require(_0x0f2a('0x0'));var zendesk=require(_0x0f2a('0x1'));var salesforce=require(_0x0f2a('0x2'));var sugarcrm=require(_0x0f2a('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0x0f2a('0x4'));var desk=require(_0x0f2a('0x5'));var vtiger=require(_0x0f2a('0x6'));var servicenow=require('./servicenow');var dynamics365=require(_0x0f2a('0x7'));var freshsales=require(_0x0f2a('0x8'));var integrations=['zendesk',_0x0f2a('0x9'),_0x0f2a('0xa'),'freshdesk',_0x0f2a('0xb'),_0x0f2a('0xc'),_0x0f2a('0xd'),'dynamics365',_0x0f2a('0xe'),_0x0f2a('0xf')];exports[_0x0f2a('0x10')]=function(_0x11a1ab,_0x41b52c,_0x579b54,_0x306e65,_0x50239b,_0x28051f){if(_0x579b54){if(_[_0x0f2a('0x11')](integrations,_0x11a1ab[_0x0f2a('0x12')][_0x0f2a('0x13')]())){try{var _0x22639f=null;var _0x3378d7='';var _0xb3266b=_0x579b54[_0x11a1ab[_0x0f2a('0x12')][_0x0f2a('0x13')]()];if(_0xb3266b){var _0x3c3828=_0xb3266b[_0x11a1ab[_0x0f2a('0x14')]];if(_0x3c3828){var _0x20ea90=_[_0x0f2a('0x15')](_0x3c3828[_0x0f2a('0x16')],{'id':parseInt(_0x11a1ab[_0x0f2a('0x17')],0xa)});if(_0x20ea90){if(_0x306e65){if(_0x50239b&&_0x41b52c[_0x0f2a('0x18')]){_0x3378d7='queue';}else if(_0x41b52c['routeId']){_0x3378d7=_0x0f2a('0x19');}else{console['log'](_0x0f2a('0x1a'),_0x41b52c);}}else{_0x3378d7=_0x0f2a('0x1b');}switch(_0x11a1ab[_0x0f2a('0x12')][_0x0f2a('0x13')]()){case'zendesk':zendesk[_0x3378d7](_0x11a1ab,_0x41b52c,_0x20ea90,_0x306e65,_0x50239b,_0x3c3828,_0x28051f);break;case _0x0f2a('0x9'):salesforce[_0x3378d7](_0x11a1ab,_0x41b52c,_0x20ea90,_0x306e65,_0x50239b,_0x3c3828,_0x28051f);break;case _0x0f2a('0xa'):sugarcrm[_0x3378d7](_0x11a1ab,_0x41b52c,_0x20ea90,_0x306e65,_0x50239b,_0x3c3828,_0x28051f);break;case _0x0f2a('0x1c'):freshdesk[_0x3378d7](_0x11a1ab,_0x41b52c,_0x20ea90,_0x306e65,_0x50239b,_0x3c3828,_0x28051f);break;case _0x0f2a('0xb'):zoho[_0x3378d7](_0x11a1ab,_0x41b52c,_0x20ea90,_0x306e65,_0x50239b,_0x3c3828,_0x28051f);break;case _0x0f2a('0xc'):desk[_0x3378d7](_0x11a1ab,_0x41b52c,_0x20ea90,_0x306e65,_0x50239b,_0x3c3828,_0x28051f);break;case'vtiger':vtiger[_0x3378d7](_0x11a1ab,_0x41b52c,_0x20ea90,_0x306e65,_0x50239b,_0x3c3828,_0x28051f);break;case _0x0f2a('0xe'):freshsales['cs'](_0x11a1ab,_0x41b52c,_0x20ea90,_0x306e65,_0x50239b,_0x3c3828,_0x28051f,_0x3378d7);break;case'servicenow':servicenow['cs'](_0x11a1ab,_0x41b52c,_0x20ea90,_0x306e65,_0x50239b,_0x3c3828,_0x28051f,_0x3378d7);break;case _0x0f2a('0x1d'):dynamics365['cs'](_0x11a1ab,_0x41b52c,_0x20ea90,_0x306e65,_0x50239b,_0x3c3828,_0x28051f,_0x3378d7);break;default:console['log']('unknown\x20integration');}}else{_0x22639f=require(_0x0f2a('0x1e'))(_0x11a1ab[_0x0f2a('0x12')]['toLowerCase']());_0x22639f[_0x0f2a('0x1f')](_0x0f2a('0x20'),util[_0x0f2a('0x21')](_0x0f2a('0x22'),_0x11a1ab[_0x0f2a('0x12')][_0x0f2a('0x13')](),_0x11a1ab[_0x0f2a('0x17')]));}}else{_0x22639f=require('../../../../config/logger')(_0x11a1ab[_0x0f2a('0x12')][_0x0f2a('0x13')]());_0x22639f[_0x0f2a('0x1f')](_0x0f2a('0x20'),util['format']('%s\x20account\x20#%s\x20not\x20found',_0x11a1ab[_0x0f2a('0x12')][_0x0f2a('0x13')](),_0x11a1ab[_0x0f2a('0x14')]));}}else{}}catch(_0x3cbf6b){console['error'](_0x3cbf6b);}}}}; \ No newline at end of file +var _0x0c4f=['./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','data1','toLowerCase','data2','Configurations','data3','queue','log','unmanaged','salesforce','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow'];(function(_0x5ba991,_0x4e09a7){var _0x55cb66=function(_0xfdfa12){while(--_0xfdfa12){_0x5ba991['push'](_0x5ba991['shift']());}};_0x55cb66(++_0x4e09a7);}(_0x0c4f,0x156));var _0xf0c4=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x0c4f[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0xf0c4('0x0'));var util=require(_0xf0c4('0x1'));var zendesk=require(_0xf0c4('0x2'));var salesforce=require(_0xf0c4('0x3'));var sugarcrm=require(_0xf0c4('0x4'));var freshdesk=require(_0xf0c4('0x5'));var zoho=require(_0xf0c4('0x6'));var desk=require(_0xf0c4('0x7'));var vtiger=require(_0xf0c4('0x8'));var servicenow=require(_0xf0c4('0x9'));var dynamics365=require(_0xf0c4('0xa'));var freshsales=require(_0xf0c4('0xb'));var integrations=[_0xf0c4('0xc'),'salesforce',_0xf0c4('0xd'),_0xf0c4('0xe'),_0xf0c4('0xf'),_0xf0c4('0x10'),_0xf0c4('0x11'),_0xf0c4('0x12'),_0xf0c4('0x13'),'servicenow'];exports['exec']=function(_0x2f3bf3,_0x20423a,_0x48aea3,_0x1d02a1,_0x35c020,_0x4fb11f){if(_0x48aea3){if(_['includes'](integrations,_0x2f3bf3[_0xf0c4('0x14')][_0xf0c4('0x15')]())){try{var _0x3fbc77=null;var _0x50237d='';var _0x37310c=_0x48aea3[_0x2f3bf3['data1'][_0xf0c4('0x15')]()];if(_0x37310c){var _0x5ef6ee=_0x37310c[_0x2f3bf3[_0xf0c4('0x16')]];if(_0x5ef6ee){var _0x549cc7=_['find'](_0x5ef6ee[_0xf0c4('0x17')],{'id':parseInt(_0x2f3bf3[_0xf0c4('0x18')],0xa)});if(_0x549cc7){if(_0x1d02a1){if(_0x35c020&&_0x20423a[_0xf0c4('0x19')]){_0x50237d=_0xf0c4('0x19');}else if(_0x20423a['routeId']){_0x50237d='outbound';}else{console[_0xf0c4('0x1a')]('EVENT\x20UNKNOWN',_0x20423a);}}else{_0x50237d=_0xf0c4('0x1b');}switch(_0x2f3bf3[_0xf0c4('0x14')][_0xf0c4('0x15')]()){case'zendesk':zendesk[_0x50237d](_0x2f3bf3,_0x20423a,_0x549cc7,_0x1d02a1,_0x35c020,_0x5ef6ee,_0x4fb11f);break;case _0xf0c4('0x1c'):salesforce[_0x50237d](_0x2f3bf3,_0x20423a,_0x549cc7,_0x1d02a1,_0x35c020,_0x5ef6ee,_0x4fb11f);break;case'sugarcrm':sugarcrm[_0x50237d](_0x2f3bf3,_0x20423a,_0x549cc7,_0x1d02a1,_0x35c020,_0x5ef6ee,_0x4fb11f);break;case _0xf0c4('0xe'):freshdesk[_0x50237d](_0x2f3bf3,_0x20423a,_0x549cc7,_0x1d02a1,_0x35c020,_0x5ef6ee,_0x4fb11f);break;case _0xf0c4('0xf'):zoho[_0x50237d](_0x2f3bf3,_0x20423a,_0x549cc7,_0x1d02a1,_0x35c020,_0x5ef6ee,_0x4fb11f);break;case _0xf0c4('0x10'):desk[_0x50237d](_0x2f3bf3,_0x20423a,_0x549cc7,_0x1d02a1,_0x35c020,_0x5ef6ee,_0x4fb11f);break;case'vtiger':vtiger[_0x50237d](_0x2f3bf3,_0x20423a,_0x549cc7,_0x1d02a1,_0x35c020,_0x5ef6ee,_0x4fb11f);break;case _0xf0c4('0x13'):freshsales['cs'](_0x2f3bf3,_0x20423a,_0x549cc7,_0x1d02a1,_0x35c020,_0x5ef6ee,_0x4fb11f,_0x50237d);break;case'servicenow':servicenow['cs'](_0x2f3bf3,_0x20423a,_0x549cc7,_0x1d02a1,_0x35c020,_0x5ef6ee,_0x4fb11f,_0x50237d);break;case _0xf0c4('0x12'):dynamics365['cs'](_0x2f3bf3,_0x20423a,_0x549cc7,_0x1d02a1,_0x35c020,_0x5ef6ee,_0x4fb11f,_0x50237d);break;default:console[_0xf0c4('0x1a')]('unknown\x20integration');}}else{_0x3fbc77=require('../../../../config/logger')(_0x2f3bf3['data1']['toLowerCase']());_0x3fbc77['error']('[EXEC]',util[_0xf0c4('0x1d')](_0xf0c4('0x1e'),_0x2f3bf3[_0xf0c4('0x14')][_0xf0c4('0x15')](),_0x2f3bf3['data3']));}}else{_0x3fbc77=require('../../../../config/logger')(_0x2f3bf3[_0xf0c4('0x14')][_0xf0c4('0x15')]());_0x3fbc77['error']('[EXEC]',util[_0xf0c4('0x1d')](_0xf0c4('0x1f'),_0x2f3bf3['data1'][_0xf0c4('0x15')](),_0x2f3bf3[_0xf0c4('0x16')]));}}else{}}catch(_0x51b0fd){console['error'](_0x51b0fd);}}}}; \ 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 055b63c..8f01af6 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 _0x9e7b=['destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','isNil',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','ioredis','../../../../config/logger','defaults','redis','emit','assign','getString','Subjects','ticketType','ActivityDate','utc','IsReminderSet','endUserType','lead','WhoId','account','WhatId','contact','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','find','execute','then','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','upperFirst','forEach','includes','string','idField','content','variable','variableName','customVariable','name','Variable','toLowerCase','toString','password','concat','securityToken','Connection','https://login.salesforce.com','clientSecret','login','username','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]'];(function(_0x2a12fb,_0x97c319){var _0x356ed1=function(_0x2d3788){while(--_0x2d3788){_0x2a12fb['push'](_0x2a12fb['shift']());}};_0x356ed1(++_0x97c319);}(_0x9e7b,0x8b));var _0xb9e7=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x9e7b[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xb9e7('0x0'));var rp=require(_0xb9e7('0x1'));var moment=require(_0xb9e7('0x2'));var BPromise=require(_0xb9e7('0x3'));var md5=require('md5');var jsforce=require(_0xb9e7('0x4'));var util=require('util');var Redis=require(_0xb9e7('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xb9e7('0x6'))('salesforce');config['redis']=_[_0xb9e7('0x7')](config[_0xb9e7('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb9e7('0x8')]));function emit(_0xdc4a6b,_0x58082c,_0x15a95f){io['to'](_0xdc4a6b)[_0xb9e7('0x9')](_0x58082c,_0x15a95f);}function getTicket(_0x2da80c,_0x27c143,_0x44a170,_0xd5f541,_0x1e7d7b,_0x2fd731,_0x4619b0,_0x2097a0){var _0x19c9b7=Object[_0xb9e7('0xa')]({},{'OwnerId':_0x27c143['id'],'Subject':intUtil[_0xb9e7('0xb')](_0xd5f541[_0xb9e7('0xc')],_0x1e7d7b,'\x20'),'Description':intUtil[_0xb9e7('0xb')](_0xd5f541['Descriptions'],_0x1e7d7b,'\x0a')},getCustomFields(_0x2fd731,_0x1e7d7b));if(_0x44a170){if(_0xd5f541[_0xb9e7('0xd')]==='Task'){_0x19c9b7[_0xb9e7('0xe')]=moment[_0xb9e7('0xf')]();_0x19c9b7[_0xb9e7('0x10')]=![];_0x19c9b7['IsRecurrence']=![];if(_0x44a170[_0xb9e7('0x11')]==='contact'||_0x44a170[_0xb9e7('0x11')]===_0xb9e7('0x12')){_0x19c9b7[_0xb9e7('0x13')]=_0x44a170['id'];}else if(_0x44a170[_0xb9e7('0x11')]===_0xb9e7('0x14')){_0x19c9b7[_0xb9e7('0x15')]=_0x44a170['id'];}}else if(_0xd5f541[_0xb9e7('0xd')]==='Case'){if(_0x44a170[_0xb9e7('0x11')]===_0xb9e7('0x16')){_0x19c9b7[_0xb9e7('0x17')]=_0x44a170['id'];}else if(_0x44a170[_0xb9e7('0x11')]==='account'){_0x19c9b7['AccountId']=_0x44a170['id'];}else if(_0x44a170[_0xb9e7('0x11')]===_0xb9e7('0x12')&&_0xd5f541['leadId']){_0x19c9b7[_0xd5f541[_0xb9e7('0x18')]]=_0x44a170['id'];}else{logger[_0xb9e7('0x19')](_0xb9e7('0x1a'));}}}return _0x4619b0[_0xb9e7('0x1b')](_0xd5f541[_0xb9e7('0xd')])[_0xb9e7('0x1c')](_0x19c9b7);}function getUser(_0x566132,_0x338cd3,_0x161c4a){if(!_['isNil'](_0x338cd3)&&intUtil['validateEmail'](_0x338cd3)){var _0x7dd21={'Email':_0x338cd3};var _0x2949d0={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x161c4a[_0xb9e7('0x1b')]('User')[_0xb9e7('0x1d')](_0x7dd21,_0x2949d0)[_0xb9e7('0x1e')]()[_0xb9e7('0x1f')](function(_0x1d59b3){if(_0x1d59b3['length']){var _0x377efa=_[_0xb9e7('0x1d')](_0x1d59b3,function(_0x2044c9){return _0x2044c9[_0xb9e7('0x20')]===_0x338cd3;});if(_0x377efa){logger[_0xb9e7('0x19')](_0xb9e7('0x21'),_0x338cd3);return BPromise['resolve']({'id':_0x377efa['Id'],'name':_0x377efa[_0xb9e7('0x22')]});}}else{logger[_0xb9e7('0x19')](_0xb9e7('0x23'),_0x338cd3);return _0x161c4a[_0xb9e7('0x24')]()['then'](function(_0x2a3c35){return BPromise[_0xb9e7('0x25')]({'id':_0x2a3c35[_0xb9e7('0x26')],'name':_0x2a3c35['display_name']});});}});}else{logger['info'](_0xb9e7('0x23'),_0x338cd3);return _0x161c4a[_0xb9e7('0x24')]()['then'](function(_0x399328){return BPromise[_0xb9e7('0x25')]({'id':_0x399328[_0xb9e7('0x26')],'name':_0x399328[_0xb9e7('0x27')]});});}}function getEndUser(_0x18af04,_0x2e69a0,_0x3f5136,_0x558830,_0x541f03){var _0x248365={'$or':{'Phone':_0x558830}};var _0x487ee3={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xb9e7('0x1f')](function(){logger['info'](_0xb9e7('0x28'),_0x558830,_0x2e69a0[_0xb9e7('0x29')]);switch(_0x2e69a0[_0xb9e7('0x29')]){case _0xb9e7('0x2a'):var _0x5d06b1=_[_0xb9e7('0x2b')](_0x248365);if(_0x2e69a0[_0xb9e7('0x2c')]){var _0x5502aa={};_0x5502aa[_0x2e69a0[_0xb9e7('0x2c')]]=_0x558830;_[_0xb9e7('0x2d')](_0x5d06b1[_0xb9e7('0x2e')],_0x5502aa);}return _0x541f03[_0xb9e7('0x1b')](_0xb9e7('0x2f'))['find'](_0x5d06b1,_0x487ee3)[_0xb9e7('0x1e')]()[_0xb9e7('0x1f')](function(_0x44f671){if(_0x44f671&&_0x44f671[_0xb9e7('0x30')]){return _0x44f671;}else{var _0x232d51=_[_0xb9e7('0x2b')](_0x248365);if(_0x2e69a0[_0xb9e7('0x31')]){var _0x4a35e1={};_0x4a35e1[_0x2e69a0[_0xb9e7('0x31')]]=_0x558830;_[_0xb9e7('0x2d')](_0x232d51['$or'],_0x4a35e1);}return _0x541f03[_0xb9e7('0x1b')](_0xb9e7('0x32'))['find'](_0x232d51,_0x487ee3);}});case _0xb9e7('0x33'):var _0x23d528=_[_0xb9e7('0x2b')](_0x248365);if(_0x2e69a0[_0xb9e7('0x34')]){var _0x5502aa={};_0x5502aa[_0x2e69a0[_0xb9e7('0x34')]]=_0x558830;_[_0xb9e7('0x2d')](_0x23d528['$or'],_0x5502aa);}return _0x541f03[_0xb9e7('0x1b')]('Account')[_0xb9e7('0x1d')](_0x23d528,_0x487ee3)[_0xb9e7('0x1e')]()[_0xb9e7('0x1f')](function(_0x5d08b0){if(_0x5d08b0&&_0x5d08b0[_0xb9e7('0x30')]){return _0x5d08b0;}else{var _0xc9c585=_[_0xb9e7('0x2b')](_0x248365);if(_0x2e69a0[_0xb9e7('0x2c')]){var _0x30f24a={};_0x30f24a[_0x2e69a0[_0xb9e7('0x2c')]]=_0x558830;_['merge'](_0xc9c585[_0xb9e7('0x2e')],_0x30f24a);}return _0x541f03[_0xb9e7('0x1b')](_0xb9e7('0x2f'))[_0xb9e7('0x1d')](_0xc9c585,_0x487ee3)[_0xb9e7('0x1f')](function(_0x335a69){if(_0x335a69&&_0x335a69[_0xb9e7('0x30')]){return _0x335a69;}else{var _0xa4c477=_['cloneDeep'](_0x248365);if(_0x2e69a0[_0xb9e7('0x31')]){var _0x23449e={};_0x23449e[_0x2e69a0[_0xb9e7('0x31')]]=_0x558830;_[_0xb9e7('0x2d')](_0xa4c477[_0xb9e7('0x2e')],_0x23449e);}return _0x541f03[_0xb9e7('0x1b')](_0xb9e7('0x32'))[_0xb9e7('0x1d')](_0xa4c477,_0x487ee3);}});}});case _0xb9e7('0x16'):var _0x5d06b1=_[_0xb9e7('0x2b')](_0x248365);if(_0x2e69a0[_0xb9e7('0x2c')]){var _0x5502aa={};_0x5502aa[_0x2e69a0[_0xb9e7('0x2c')]]=_0x558830;_[_0xb9e7('0x2d')](_0x5d06b1['$or'],_0x5502aa);}return _0x541f03[_0xb9e7('0x1b')](_0xb9e7('0x2f'))[_0xb9e7('0x1d')](_0x5d06b1,_0x487ee3)[_0xb9e7('0x1e')]();case'lead':var _0x37cbb7=_[_0xb9e7('0x2b')](_0x248365);if(_0x2e69a0[_0xb9e7('0x31')]){var _0x5502aa={};_0x5502aa[_0x2e69a0[_0xb9e7('0x31')]]=_0x558830;_['merge'](_0x37cbb7[_0xb9e7('0x2e')],_0x5502aa);}return _0x541f03[_0xb9e7('0x1b')](_0xb9e7('0x32'))[_0xb9e7('0x1d')](_0x37cbb7,_0x487ee3);case _0xb9e7('0x14'):var _0x23d528=_[_0xb9e7('0x2b')](_0x248365);if(_0x2e69a0['additionalSearchAccount']){var _0x5502aa={};_0x5502aa[_0x2e69a0[_0xb9e7('0x34')]]=_0x558830;_[_0xb9e7('0x2d')](_0x23d528[_0xb9e7('0x2e')],_0x5502aa);}return _0x541f03['sobject'](_0xb9e7('0x35'))[_0xb9e7('0x1d')](_0x23d528,_0x487ee3);default:return null;}})[_0xb9e7('0x1f')](function(_0x49e134){if(_0x49e134&&_0x49e134[_0xb9e7('0x30')]){var _0x84c20b=_['first'](_0x49e134);if(_0x84c20b){return BPromise[_0xb9e7('0x25')]({'id':_0x84c20b['Id'],'name':_0x84c20b[_0xb9e7('0x22')],'phone':_0x84c20b[_0xb9e7('0x36')],'endUserType':_0x84c20b[_0xb9e7('0x37')][_0xb9e7('0x38')]['toLowerCase']()});}}})[_0xb9e7('0x1f')](function(_0x132c11){if(_0x132c11){logger[_0xb9e7('0x19')](_0xb9e7('0x39'),_0x132c11[_0xb9e7('0x11')],_0x558830);return BPromise[_0xb9e7('0x25')](_0x132c11);}else{logger['info'](_0xb9e7('0x3a'),_0x558830);var _0x208a06={'Phone':_0x558830};if(_0x2e69a0[_0xb9e7('0x3b')]){if(_0x2e69a0[_0xb9e7('0x3b')]===_0xb9e7('0x16')){logger[_0xb9e7('0x19')](_0xb9e7('0x3c'),_0x558830,_0x2e69a0[_0xb9e7('0x3b')]);_0x208a06['LastName']=_0x3f5136!==_0xb9e7('0x3d')?_0x3f5136:util[_0xb9e7('0x3e')](_0xb9e7('0x3f'),_0x558830);}else if(_0x2e69a0['moduleCreate']===_0xb9e7('0x12')){logger[_0xb9e7('0x19')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x558830,_0x2e69a0['moduleCreate']);_0x208a06[_0xb9e7('0x40')]=_0x3f5136!==_0xb9e7('0x3d')?_0x3f5136:util['format'](_0xb9e7('0x3f'),_0x558830);_0x208a06[_0xb9e7('0x41')]=_0xb9e7('0x42');}else if(_0x2e69a0['moduleCreate']==='account'){logger[_0xb9e7('0x19')](_0xb9e7('0x3c'),_0x558830,_0x2e69a0[_0xb9e7('0x3b')]);_0x208a06[_0xb9e7('0x22')]=_0x3f5136!==_0xb9e7('0x3d')?_0x3f5136:util[_0xb9e7('0x3e')](_0xb9e7('0x3f'),_0x558830);}else{return null;}}return _0x541f03['sobject'](_[_0xb9e7('0x43')](_0x2e69a0['moduleCreate']))[_0xb9e7('0x1c')](_0x208a06)['then'](function(_0x452713){return BPromise['resolve']({'id':_0x452713['id'],'endUserType':_0x2e69a0[_0xb9e7('0x3b')]});});}});}function getCustomFields(_0x281f20,_0x3e20d1){var _0x5e848b={};if(_0x281f20[_0xb9e7('0x30')]>0x0){_[_0xb9e7('0x44')](_0x281f20,function(_0x17109d){if(_[_0xb9e7('0x45')]([_0xb9e7('0x46'),'picklist'],_0x17109d[_0xb9e7('0x38')])&&_0x17109d[_0xb9e7('0x47')]){_0x5e848b[_0x17109d[_0xb9e7('0x47')]]=_0x17109d[_0xb9e7('0x48')]['toString']();}else if(_0x17109d['type']===_0xb9e7('0x49')&&_0x17109d[_0xb9e7('0x4a')]&&_0x17109d['idField']){_0x3e20d1[_0x17109d[_0xb9e7('0x4a')]]&&(_0x5e848b[_0x17109d['idField']]=_0x3e20d1[_0x17109d[_0xb9e7('0x4a')]]['toString']());}else if(_0x17109d['type']===_0xb9e7('0x4b')&&_0x17109d['Variable']&&_0x17109d['Variable'][_0xb9e7('0x4c')]&&_0x17109d[_0xb9e7('0x47')]){_0x3e20d1[_0x17109d[_0xb9e7('0x4d')][_0xb9e7('0x4c')][_0xb9e7('0x4e')]()]&&(_0x5e848b[_0x17109d[_0xb9e7('0x47')]]=_0x3e20d1[_0x17109d['Variable'][_0xb9e7('0x4c')][_0xb9e7('0x4e')]()][_0xb9e7('0x4f')]());}});}return _0x5e848b;}function getConnection(_0x18809c){var _0x5885dc=_0x18809c[_0xb9e7('0x50')][_0xb9e7('0x51')](_0x18809c[_0xb9e7('0x52')]);var _0x2d4e2e=new jsforce[(_0xb9e7('0x53'))]({'oauth2':{'loginUrl':_0x18809c['remoteUri']||_0xb9e7('0x54'),'clientId':_0x18809c['clientId'],'clientSecret':_0x18809c[_0xb9e7('0x55')]}});return _0x2d4e2e[_0xb9e7('0x56')](_0x18809c[_0xb9e7('0x57')],_0x5885dc)[_0xb9e7('0x1f')](function(){logger[_0xb9e7('0x19')]('Connection\x20established.');return _0x2d4e2e;});}exports['queue']=function(_0x10c806,_0xe55e4d,_0x736849,_0x359b85,_0x52482d,_0x19a105){var _0x5454da,_0x3eccb1,_0x206670,_0x2a15ec;_0x19a105[_0xb9e7('0x58')]=intUtil[_0xb9e7('0x59')](_0x19a105[_0xb9e7('0x58')]);_0x19a105['remoteUri']=intUtil[_0xb9e7('0x59')](_0x19a105[_0xb9e7('0x5a')]);if(_0x52482d&&_0x52482d[_0xb9e7('0x5b')]){logger['info'](_0xb9e7('0x5c'),_0xb9e7('0x5d'));_0xe55e4d['recordingURL']=util['format'](_0xb9e7('0x5e'),_0x19a105[_0xb9e7('0x58')],_0xe55e4d[_0xb9e7('0x5f')],md5(_0xe55e4d[_0xb9e7('0x5f')]));}else{_0xe55e4d[_0xb9e7('0x60')]='';}return getConnection(_0x19a105)[_0xb9e7('0x1f')](function(_0x4fbdd4){_0x2a15ec=_0x4fbdd4;return getUser(_0x19a105,_0x359b85[_0xb9e7('0x61')],_0x2a15ec);})['then'](function(_0x3a92b6){_0x5454da=_0x3a92b6;return getEndUser(_0x19a105,_0x736849,_0xe55e4d[_0xb9e7('0x62')],_0xe55e4d[_0xb9e7('0x63')],_0x2a15ec);})[_0xb9e7('0x1f')](function(_0x202964){_0x3eccb1=_0x202964;return getTicket(_0x19a105,_0x5454da,_0x3eccb1,_0x736849,_0xe55e4d,_0x736849[_0xb9e7('0x64')],_0x2a15ec,_0xb9e7('0x65'));})[_0xb9e7('0x1f')](function(_0x541770){_0x206670=_0x541770;logger[_0xb9e7('0x19')](_0xb9e7('0x66'),_0x206670['id']);logger[_0xb9e7('0x19')](_0xb9e7('0x67'),_0x206670['id'],_0x359b85[_0xb9e7('0x4c')],_0x19a105['type']);switch(_0x19a105[_0xb9e7('0x38')]){case _0xb9e7('0x68'):emit(util[_0xb9e7('0x3e')](_0xb9e7('0x69'),_0x359b85['name']),'trigger:salesforce:display',{'recordId':_0x206670['id']});break;case _0xb9e7('0x6a'):emit(util['format'](_0xb9e7('0x69'),_0x359b85[_0xb9e7('0x4c')]),_0xb9e7('0x6b'),{'uri':util[_0xb9e7('0x3e')](_0xb9e7('0x6c'),_0x2a15ec[_0xb9e7('0x6d')],_0x206670['id'])});break;default:logger[_0xb9e7('0x6e')](_0xb9e7('0x6f'));}})[_0xb9e7('0x70')](function(_0x3d4d70){logger[_0xb9e7('0x6e')](_0xb9e7('0x5c'),_0x3d4d70);});};exports[_0xb9e7('0x71')]=function(_0x452282,_0x1c6799,_0x33ffec,_0xa3944c,_0x2d795c,_0x4e5a7e,_0xa869a8){var _0x2f56ea,_0x2ea9b7,_0x1cdee1,_0x4e6548;_0x4e5a7e[_0xb9e7('0x58')]=intUtil['stripTrailingSlash'](_0x4e5a7e['serverUrl']);_0x4e5a7e['remoteUri']=intUtil[_0xb9e7('0x59')](_0x4e5a7e['remoteUri']);if(_0xa869a8&&_0xa869a8[_0xb9e7('0x72')]&&_0xa869a8[_0xb9e7('0x72')]!==_0xb9e7('0x73')){logger[_0xb9e7('0x19')](_0xb9e7('0x74'),_0xb9e7('0x5d'));_0x1c6799[_0xb9e7('0x60')]=util[_0xb9e7('0x3e')](_0xb9e7('0x5e'),_0x4e5a7e[_0xb9e7('0x58')],_0x1c6799[_0xb9e7('0x5f')],md5(_0x1c6799[_0xb9e7('0x5f')]));}return getConnection(_0x4e5a7e)[_0xb9e7('0x1f')](function(_0x54c106){_0x4e6548=_0x54c106;return getUser(_0x4e5a7e,_0xa3944c[_0xb9e7('0x61')],_0x4e6548);})['then'](function(_0x4cab09){_0x2f56ea=_0x4cab09;return getEndUser(_0x4e5a7e,_0x33ffec,_0x1c6799[_0xb9e7('0x75')],_0x1c6799[_0xb9e7('0x76')],_0x4e6548);})[_0xb9e7('0x1f')](function(_0x175e02){_0x2ea9b7=_0x175e02;return getTicket(_0x4e5a7e,_0x2f56ea,_0x2ea9b7,_0x33ffec,_0x1c6799,_0x33ffec['Fields'],_0x4e6548,'outbound');})[_0xb9e7('0x1f')](function(_0x59c000){_0x1cdee1=_0x59c000;logger['info'](_0xb9e7('0x77'),_0x1cdee1['id']);logger[_0xb9e7('0x19')](_0xb9e7('0x78'),_0x1cdee1['id'],_0xa3944c[_0xb9e7('0x4c')],_0x4e5a7e['type']);switch(_0x4e5a7e[_0xb9e7('0x38')]){case _0xb9e7('0x68'):emit(util[_0xb9e7('0x3e')](_0xb9e7('0x69'),_0xa3944c['name']),_0xb9e7('0x79'),{'recordId':_0x1cdee1['id']});break;case _0xb9e7('0x6a'):emit(util[_0xb9e7('0x3e')](_0xb9e7('0x69'),_0xa3944c[_0xb9e7('0x4c')]),'trigger:browser:url',{'uri':util[_0xb9e7('0x3e')](_0xb9e7('0x6c'),_0x4e6548['instanceUrl'],_0x1cdee1['id'])});break;default:logger[_0xb9e7('0x6e')]('[OUTBOUND]',_0xb9e7('0x7a'));}})[_0xb9e7('0x70')](function(_0x163f7d){logger[_0xb9e7('0x6e')](_0xb9e7('0x74'),_0x163f7d);});};exports[_0xb9e7('0x7b')]=function(_0x907c7d,_0x4e4428,_0x3f685d,_0x782d21,_0x3254e7,_0x243caa){var _0x3ee091,_0x56df9b,_0x41d5f9,_0x1a876e;_0x243caa[_0xb9e7('0x58')]=intUtil[_0xb9e7('0x59')](_0x243caa[_0xb9e7('0x58')]);_0x243caa[_0xb9e7('0x5a')]=intUtil[_0xb9e7('0x59')](_0x243caa[_0xb9e7('0x5a')]);if(_0x3254e7&&_0x3254e7[_0xb9e7('0x5b')]){logger[_0xb9e7('0x19')]('['+_0x4e4428[_0xb9e7('0x7c')][_0xb9e7('0x7d')]()+']','Recording\x20is\x20enabled!');_0x4e4428[_0xb9e7('0x60')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x243caa[_0xb9e7('0x58')],_0x4e4428[_0xb9e7('0x5f')],md5(_0x4e4428[_0xb9e7('0x5f')]));}else{_0x4e4428['recordingURL']='';}return getConnection(_0x243caa)['then'](function(_0x2ed847){_0x1a876e=_0x2ed847;if(!_[_0xb9e7('0x7e')](_0x782d21)){return getUser(_0x243caa,_0x782d21[_0xb9e7('0x4c')],_0x1a876e);}else{return getUser(_0x243caa,null,_0x1a876e);}})[_0xb9e7('0x1f')](function(_0x33f56d){_0x3ee091=_0x33f56d;return getEndUser(_0x243caa,_0x3f685d,_0x4e4428['calleridname'],_0x4e4428[_0xb9e7('0x63')],_0x1a876e);})['then'](function(_0x4947b){_0x56df9b=_0x4947b;return getTicket(_0x243caa,_0x3ee091,_0x56df9b,_0x3f685d,_0x4e4428,_0x3f685d[_0xb9e7('0x64')],_0x1a876e);})[_0xb9e7('0x1f')](function(_0x140601){_0x41d5f9=_0x140601;logger[_0xb9e7('0x19')]('['+_0x4e4428['lastevent']['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x41d5f9['id']);logger[_0xb9e7('0x19')]('['+_0x4e4428['lastevent'][_0xb9e7('0x7d')]()+_0xb9e7('0x7f'),_0x243caa[_0xb9e7('0x38')]);})[_0xb9e7('0x70')](function(_0x3ee589){logger[_0xb9e7('0x6e')]('['+_0x4e4428['lastevent']['toUpperCase']()+']',_0x3ee589);});}; \ No newline at end of file +var _0x04ca=['upperFirst','forEach','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','calleridname','toUpperCase',']\x20Ticket\x20%s\x20created.','jsforce','util','ioredis','./util','../../../../config/logger','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','ticketType','Task','ActivityDate','utc','IsRecurrence','contact','endUserType','lead','WhoId','WhatId','Case','ContactId','account','AccountId','leadId','info','sobject','create','validateEmail','User','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','cloneDeep','additionalSearchLead','additionalSearchAccount','Account','Lead','first','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s'];(function(_0xebc29a,_0x8c4f6d){var _0x5b0615=function(_0xa154ac){while(--_0xa154ac){_0xebc29a['push'](_0xebc29a['shift']());}};_0x5b0615(++_0x8c4f6d);}(_0x04ca,0xb8));var _0xa04c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x04ca[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0xa04c('0x0'));var util=require(_0xa04c('0x1'));var Redis=require(_0xa04c('0x2'));var intUtil=require(_0xa04c('0x3'));var config=require('../../../../config/environment');var logger=require(_0xa04c('0x4'))('salesforce');config['redis']=_['defaults'](config[_0xa04c('0x5')],{'host':_0xa04c('0x6'),'port':0x18eb});var io=require(_0xa04c('0x7'))(new Redis(config['redis']));function emit(_0x2e66bc,_0x3951b2,_0x840411){io['to'](_0x2e66bc)[_0xa04c('0x8')](_0x3951b2,_0x840411);}function getTicket(_0x438b89,_0x5d6859,_0x730c04,_0x477f6e,_0x345f16,_0x391e72,_0x8e9765,_0x38f014){var _0x300bb9=Object[_0xa04c('0x9')]({},{'OwnerId':_0x5d6859['id'],'Subject':intUtil[_0xa04c('0xa')](_0x477f6e[_0xa04c('0xb')],_0x345f16,'\x20'),'Description':intUtil[_0xa04c('0xa')](_0x477f6e['Descriptions'],_0x345f16,'\x0a')},getCustomFields(_0x391e72,_0x345f16));if(_0x730c04){if(_0x477f6e[_0xa04c('0xc')]===_0xa04c('0xd')){_0x300bb9[_0xa04c('0xe')]=moment[_0xa04c('0xf')]();_0x300bb9['IsReminderSet']=![];_0x300bb9[_0xa04c('0x10')]=![];if(_0x730c04['endUserType']===_0xa04c('0x11')||_0x730c04[_0xa04c('0x12')]===_0xa04c('0x13')){_0x300bb9[_0xa04c('0x14')]=_0x730c04['id'];}else if(_0x730c04[_0xa04c('0x12')]==='account'){_0x300bb9[_0xa04c('0x15')]=_0x730c04['id'];}}else if(_0x477f6e[_0xa04c('0xc')]===_0xa04c('0x16')){if(_0x730c04[_0xa04c('0x12')]===_0xa04c('0x11')){_0x300bb9[_0xa04c('0x17')]=_0x730c04['id'];}else if(_0x730c04['endUserType']===_0xa04c('0x18')){_0x300bb9[_0xa04c('0x19')]=_0x730c04['id'];}else if(_0x730c04[_0xa04c('0x12')]===_0xa04c('0x13')&&_0x477f6e[_0xa04c('0x1a')]){_0x300bb9[_0x477f6e['leadId']]=_0x730c04['id'];}else{logger[_0xa04c('0x1b')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x8e9765[_0xa04c('0x1c')](_0x477f6e[_0xa04c('0xc')])[_0xa04c('0x1d')](_0x300bb9);}function getUser(_0x1b1abb,_0x121aa8,_0x158b17){if(!_['isNil'](_0x121aa8)&&intUtil[_0xa04c('0x1e')](_0x121aa8)){var _0x4eb0c8={'Email':_0x121aa8};var _0x5bd994={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x158b17[_0xa04c('0x1c')](_0xa04c('0x1f'))[_0xa04c('0x20')](_0x4eb0c8,_0x5bd994)[_0xa04c('0x21')]()[_0xa04c('0x22')](function(_0x33358d){if(_0x33358d[_0xa04c('0x23')]){var _0x4bb65a=_[_0xa04c('0x20')](_0x33358d,function(_0x4f3499){return _0x4f3499['Email']===_0x121aa8;});if(_0x4bb65a){logger['info'](_0xa04c('0x24'),_0x121aa8);return BPromise[_0xa04c('0x25')]({'id':_0x4bb65a['Id'],'name':_0x4bb65a[_0xa04c('0x26')]});}}else{logger[_0xa04c('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x121aa8);return _0x158b17[_0xa04c('0x27')]()[_0xa04c('0x22')](function(_0x40fa9b){return BPromise[_0xa04c('0x25')]({'id':_0x40fa9b[_0xa04c('0x28')],'name':_0x40fa9b[_0xa04c('0x29')]});});}});}else{logger[_0xa04c('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x121aa8);return _0x158b17['identity']()[_0xa04c('0x22')](function(_0x312383){return BPromise[_0xa04c('0x25')]({'id':_0x312383['user_id'],'name':_0x312383[_0xa04c('0x29')]});});}}function getEndUser(_0x368093,_0x56b235,_0x341cc7,_0x5aa6fd,_0x700f93){var _0x4b02fe={'$or':{'Phone':_0x5aa6fd}};var _0xf299f2={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0xa04c('0x1b')](_0xa04c('0x2a'),_0x5aa6fd,_0x56b235['moduleSearch']);switch(_0x56b235[_0xa04c('0x2b')]){case _0xa04c('0x2c'):var _0x53afd8=_['cloneDeep'](_0x4b02fe);if(_0x56b235[_0xa04c('0x2d')]){var _0x44290c={};_0x44290c[_0x56b235['additionalSearchContact']]=_0x5aa6fd;_[_0xa04c('0x2e')](_0x53afd8[_0xa04c('0x2f')],_0x44290c);}return _0x700f93['sobject'](_0xa04c('0x30'))['find'](_0x53afd8,_0xf299f2)['execute']()['then'](function(_0x943589){if(_0x943589&&_0x943589[_0xa04c('0x23')]){return _0x943589;}else{var _0x585acf=_[_0xa04c('0x31')](_0x4b02fe);if(_0x56b235[_0xa04c('0x32')]){var _0x488570={};_0x488570[_0x56b235[_0xa04c('0x32')]]=_0x5aa6fd;_[_0xa04c('0x2e')](_0x585acf[_0xa04c('0x2f')],_0x488570);}return _0x700f93[_0xa04c('0x1c')]('Lead')['find'](_0x585acf,_0xf299f2);}});case'account_contact_lead':var _0x57f82b=_['cloneDeep'](_0x4b02fe);if(_0x56b235[_0xa04c('0x33')]){var _0x44290c={};_0x44290c[_0x56b235['additionalSearchAccount']]=_0x5aa6fd;_[_0xa04c('0x2e')](_0x57f82b['$or'],_0x44290c);}return _0x700f93[_0xa04c('0x1c')](_0xa04c('0x34'))[_0xa04c('0x20')](_0x57f82b,_0xf299f2)[_0xa04c('0x21')]()[_0xa04c('0x22')](function(_0x476b30){if(_0x476b30&&_0x476b30[_0xa04c('0x23')]){return _0x476b30;}else{var _0x279d59=_[_0xa04c('0x31')](_0x4b02fe);if(_0x56b235[_0xa04c('0x2d')]){var _0x4b3df8={};_0x4b3df8[_0x56b235[_0xa04c('0x2d')]]=_0x5aa6fd;_['merge'](_0x279d59[_0xa04c('0x2f')],_0x4b3df8);}return _0x700f93[_0xa04c('0x1c')](_0xa04c('0x30'))[_0xa04c('0x20')](_0x279d59,_0xf299f2)['then'](function(_0x3c998d){if(_0x3c998d&&_0x3c998d[_0xa04c('0x23')]){return _0x3c998d;}else{var _0x5f557c=_[_0xa04c('0x31')](_0x4b02fe);if(_0x56b235[_0xa04c('0x32')]){var _0x588128={};_0x588128[_0x56b235['additionalSearchLead']]=_0x5aa6fd;_[_0xa04c('0x2e')](_0x5f557c['$or'],_0x588128);}return _0x700f93[_0xa04c('0x1c')](_0xa04c('0x35'))[_0xa04c('0x20')](_0x5f557c,_0xf299f2);}});}});case _0xa04c('0x11'):var _0x53afd8=_['cloneDeep'](_0x4b02fe);if(_0x56b235[_0xa04c('0x2d')]){var _0x44290c={};_0x44290c[_0x56b235['additionalSearchContact']]=_0x5aa6fd;_[_0xa04c('0x2e')](_0x53afd8[_0xa04c('0x2f')],_0x44290c);}return _0x700f93[_0xa04c('0x1c')](_0xa04c('0x30'))[_0xa04c('0x20')](_0x53afd8,_0xf299f2)[_0xa04c('0x21')]();case'lead':var _0x349935=_['cloneDeep'](_0x4b02fe);if(_0x56b235[_0xa04c('0x32')]){var _0x44290c={};_0x44290c[_0x56b235[_0xa04c('0x32')]]=_0x5aa6fd;_['merge'](_0x349935[_0xa04c('0x2f')],_0x44290c);}return _0x700f93[_0xa04c('0x1c')]('Lead')[_0xa04c('0x20')](_0x349935,_0xf299f2);case _0xa04c('0x18'):var _0x57f82b=_[_0xa04c('0x31')](_0x4b02fe);if(_0x56b235['additionalSearchAccount']){var _0x44290c={};_0x44290c[_0x56b235[_0xa04c('0x33')]]=_0x5aa6fd;_['merge'](_0x57f82b[_0xa04c('0x2f')],_0x44290c);}return _0x700f93['sobject']('Account')['find'](_0x57f82b,_0xf299f2);default:return null;}})[_0xa04c('0x22')](function(_0x5c5ce7){if(_0x5c5ce7&&_0x5c5ce7['length']){var _0x5a6c26=_[_0xa04c('0x36')](_0x5c5ce7);if(_0x5a6c26){return BPromise[_0xa04c('0x25')]({'id':_0x5a6c26['Id'],'name':_0x5a6c26['Name'],'phone':_0x5a6c26[_0xa04c('0x37')],'endUserType':_0x5a6c26[_0xa04c('0x38')]['type'][_0xa04c('0x39')]()});}}})['then'](function(_0x23a44a){if(_0x23a44a){logger[_0xa04c('0x1b')](_0xa04c('0x3a'),_0x23a44a[_0xa04c('0x12')],_0x5aa6fd);return BPromise[_0xa04c('0x25')](_0x23a44a);}else{logger['info'](_0xa04c('0x3b'),_0x5aa6fd);var _0x12396a={'Phone':_0x5aa6fd};if(_0x56b235[_0xa04c('0x3c')]){if(_0x56b235['moduleCreate']===_0xa04c('0x11')){logger[_0xa04c('0x1b')](_0xa04c('0x3d'),_0x5aa6fd,_0x56b235[_0xa04c('0x3c')]);_0x12396a[_0xa04c('0x3e')]=_0x341cc7!==_0xa04c('0x3f')?_0x341cc7:util[_0xa04c('0x40')](_0xa04c('0x41'),_0x5aa6fd);}else if(_0x56b235[_0xa04c('0x3c')]==='lead'){logger[_0xa04c('0x1b')](_0xa04c('0x3d'),_0x5aa6fd,_0x56b235['moduleCreate']);_0x12396a[_0xa04c('0x3e')]=_0x341cc7!==_0xa04c('0x3f')?_0x341cc7:util[_0xa04c('0x40')](_0xa04c('0x41'),_0x5aa6fd);_0x12396a['Company']='No\x20Company';}else if(_0x56b235[_0xa04c('0x3c')]===_0xa04c('0x18')){logger[_0xa04c('0x1b')](_0xa04c('0x3d'),_0x5aa6fd,_0x56b235['moduleCreate']);_0x12396a[_0xa04c('0x26')]=_0x341cc7!==_0xa04c('0x3f')?_0x341cc7:util[_0xa04c('0x40')](_0xa04c('0x41'),_0x5aa6fd);}else{return null;}}return _0x700f93[_0xa04c('0x1c')](_[_0xa04c('0x42')](_0x56b235['moduleCreate']))[_0xa04c('0x1d')](_0x12396a)[_0xa04c('0x22')](function(_0x3e0509){return BPromise[_0xa04c('0x25')]({'id':_0x3e0509['id'],'endUserType':_0x56b235[_0xa04c('0x3c')]});});}});}function getCustomFields(_0x19b893,_0x43039d){var _0x135302={};if(_0x19b893[_0xa04c('0x23')]>0x0){_[_0xa04c('0x43')](_0x19b893,function(_0x39fef2){if(_['includes']([_0xa04c('0x44'),_0xa04c('0x45')],_0x39fef2[_0xa04c('0x46')])&&_0x39fef2[_0xa04c('0x47')]){_0x135302[_0x39fef2[_0xa04c('0x47')]]=_0x39fef2[_0xa04c('0x48')][_0xa04c('0x49')]();}else if(_0x39fef2['type']==='variable'&&_0x39fef2[_0xa04c('0x4a')]&&_0x39fef2['idField']){_0x43039d[_0x39fef2['variableName']]&&(_0x135302[_0x39fef2[_0xa04c('0x47')]]=_0x43039d[_0x39fef2['variableName']][_0xa04c('0x49')]());}else if(_0x39fef2[_0xa04c('0x46')]===_0xa04c('0x4b')&&_0x39fef2[_0xa04c('0x4c')]&&_0x39fef2['Variable'][_0xa04c('0x4d')]&&_0x39fef2[_0xa04c('0x47')]){_0x43039d[_0x39fef2['Variable'][_0xa04c('0x4d')][_0xa04c('0x39')]()]&&(_0x135302[_0x39fef2[_0xa04c('0x47')]]=_0x43039d[_0x39fef2['Variable'][_0xa04c('0x4d')][_0xa04c('0x39')]()][_0xa04c('0x49')]());}});}return _0x135302;}function getConnection(_0x389e13){var _0x512ed9=_0x389e13[_0xa04c('0x4e')][_0xa04c('0x4f')](_0x389e13[_0xa04c('0x50')]);var _0x25d72b=new jsforce[(_0xa04c('0x51'))]({'oauth2':{'loginUrl':_0x389e13[_0xa04c('0x52')]||_0xa04c('0x53'),'clientId':_0x389e13[_0xa04c('0x54')],'clientSecret':_0x389e13[_0xa04c('0x55')]}});return _0x25d72b[_0xa04c('0x56')](_0x389e13[_0xa04c('0x57')],_0x512ed9)[_0xa04c('0x22')](function(){logger['info'](_0xa04c('0x58'));return _0x25d72b;});}exports[_0xa04c('0x59')]=function(_0x3db2c9,_0x25e456,_0x18b15e,_0x520267,_0x54189d,_0x531752){var _0x653316,_0x233f6c,_0x1dfb44,_0x4cae89;_0x531752[_0xa04c('0x5a')]=intUtil['stripTrailingSlash'](_0x531752[_0xa04c('0x5a')]);_0x531752['remoteUri']=intUtil[_0xa04c('0x5b')](_0x531752[_0xa04c('0x52')]);if(_0x54189d&&_0x54189d[_0xa04c('0x5c')]){logger[_0xa04c('0x1b')](_0xa04c('0x5d'),_0xa04c('0x5e'));_0x25e456[_0xa04c('0x5f')]=util[_0xa04c('0x40')](_0xa04c('0x60'),_0x531752['serverUrl'],_0x25e456[_0xa04c('0x61')],md5(_0x25e456[_0xa04c('0x61')]));}else{_0x25e456[_0xa04c('0x5f')]='';}return getConnection(_0x531752)[_0xa04c('0x22')](function(_0xeeb4c4){_0x4cae89=_0xeeb4c4;return getUser(_0x531752,_0x520267[_0xa04c('0x62')],_0x4cae89);})[_0xa04c('0x22')](function(_0x4d863a){_0x653316=_0x4d863a;return getEndUser(_0x531752,_0x18b15e,_0x25e456['calleridname'],_0x25e456['calleridnum'],_0x4cae89);})[_0xa04c('0x22')](function(_0x35ee62){_0x233f6c=_0x35ee62;return getTicket(_0x531752,_0x653316,_0x233f6c,_0x18b15e,_0x25e456,_0x18b15e[_0xa04c('0x63')],_0x4cae89,_0xa04c('0x59'));})['then'](function(_0x36583d){_0x1dfb44=_0x36583d;logger[_0xa04c('0x1b')](_0xa04c('0x64'),_0x1dfb44['id']);logger['info'](_0xa04c('0x65'),_0x1dfb44['id'],_0x520267['name'],_0x531752['type']);switch(_0x531752['type']){case'integrationTab':emit(util['format']('user:%s',_0x520267[_0xa04c('0x4d')]),_0xa04c('0x66'),{'recordId':_0x1dfb44['id']});break;case _0xa04c('0x67'):emit(util['format'](_0xa04c('0x68'),_0x520267[_0xa04c('0x4d')]),_0xa04c('0x69'),{'uri':util['format'](_0xa04c('0x6a'),_0x4cae89[_0xa04c('0x6b')],_0x1dfb44['id'])});break;default:logger['error'](_0xa04c('0x6c'));}})[_0xa04c('0x6d')](function(_0x14ca95){logger[_0xa04c('0x6e')](_0xa04c('0x5d'),_0x14ca95);});};exports[_0xa04c('0x6f')]=function(_0x51ae22,_0x2dcc2f,_0x496302,_0x460896,_0x50d61f,_0x2963ce,_0x3f79d0){var _0x1f04c3,_0x5b25cc,_0x21eed1,_0x4da0a6;_0x2963ce[_0xa04c('0x5a')]=intUtil[_0xa04c('0x5b')](_0x2963ce[_0xa04c('0x5a')]);_0x2963ce[_0xa04c('0x52')]=intUtil[_0xa04c('0x5b')](_0x2963ce[_0xa04c('0x52')]);if(_0x3f79d0&&_0x3f79d0[_0xa04c('0x70')]&&_0x3f79d0[_0xa04c('0x70')]!==_0xa04c('0x71')){logger[_0xa04c('0x1b')](_0xa04c('0x72'),_0xa04c('0x5e'));_0x2dcc2f[_0xa04c('0x5f')]=util[_0xa04c('0x40')](_0xa04c('0x60'),_0x2963ce[_0xa04c('0x5a')],_0x2dcc2f[_0xa04c('0x61')],md5(_0x2dcc2f['uniqueid']));}return getConnection(_0x2963ce)[_0xa04c('0x22')](function(_0xabfed9){_0x4da0a6=_0xabfed9;return getUser(_0x2963ce,_0x460896['email'],_0x4da0a6);})[_0xa04c('0x22')](function(_0x5e4e30){_0x1f04c3=_0x5e4e30;return getEndUser(_0x2963ce,_0x496302,_0x2dcc2f[_0xa04c('0x73')],_0x2dcc2f['destcalleridnum'],_0x4da0a6);})[_0xa04c('0x22')](function(_0x418780){_0x5b25cc=_0x418780;return getTicket(_0x2963ce,_0x1f04c3,_0x5b25cc,_0x496302,_0x2dcc2f,_0x496302[_0xa04c('0x63')],_0x4da0a6,'outbound');})[_0xa04c('0x22')](function(_0x49a96f){_0x21eed1=_0x49a96f;logger[_0xa04c('0x1b')](_0xa04c('0x74'),_0x21eed1['id']);logger[_0xa04c('0x1b')](_0xa04c('0x75'),_0x21eed1['id'],_0x460896['name'],_0x2963ce[_0xa04c('0x46')]);switch(_0x2963ce[_0xa04c('0x46')]){case _0xa04c('0x76'):emit(util[_0xa04c('0x40')](_0xa04c('0x68'),_0x460896['name']),_0xa04c('0x66'),{'recordId':_0x21eed1['id']});break;case'newTab':emit(util[_0xa04c('0x40')](_0xa04c('0x68'),_0x460896[_0xa04c('0x4d')]),_0xa04c('0x69'),{'uri':util[_0xa04c('0x40')]('%s/%s/e',_0x4da0a6[_0xa04c('0x6b')],_0x21eed1['id'])});break;default:logger['error'](_0xa04c('0x72'),_0xa04c('0x77'));}})[_0xa04c('0x6d')](function(_0x4528c7){logger[_0xa04c('0x6e')]('[OUTBOUND]',_0x4528c7);});};exports[_0xa04c('0x78')]=function(_0x38c953,_0x4cd8bf,_0x579399,_0x50e771,_0x46fa07,_0x28c5a3){var _0x568870,_0x2a0194,_0x5c040a,_0x4a5252;_0x28c5a3[_0xa04c('0x5a')]=intUtil[_0xa04c('0x5b')](_0x28c5a3[_0xa04c('0x5a')]);_0x28c5a3[_0xa04c('0x52')]=intUtil['stripTrailingSlash'](_0x28c5a3[_0xa04c('0x52')]);if(_0x46fa07&&_0x46fa07[_0xa04c('0x5c')]){logger['info']('['+_0x4cd8bf[_0xa04c('0x79')]['toUpperCase']()+']',_0xa04c('0x5e'));_0x4cd8bf[_0xa04c('0x5f')]=util['format'](_0xa04c('0x60'),_0x28c5a3[_0xa04c('0x5a')],_0x4cd8bf[_0xa04c('0x61')],md5(_0x4cd8bf[_0xa04c('0x61')]));}else{_0x4cd8bf[_0xa04c('0x5f')]='';}return getConnection(_0x28c5a3)[_0xa04c('0x22')](function(_0xa09fc0){_0x4a5252=_0xa09fc0;if(!_['isNil'](_0x50e771)){return getUser(_0x28c5a3,_0x50e771['name'],_0x4a5252);}else{return getUser(_0x28c5a3,null,_0x4a5252);}})[_0xa04c('0x22')](function(_0x3f61e5){_0x568870=_0x3f61e5;return getEndUser(_0x28c5a3,_0x579399,_0x4cd8bf[_0xa04c('0x7a')],_0x4cd8bf['calleridnum'],_0x4a5252);})[_0xa04c('0x22')](function(_0x202fe7){_0x2a0194=_0x202fe7;return getTicket(_0x28c5a3,_0x568870,_0x2a0194,_0x579399,_0x4cd8bf,_0x579399[_0xa04c('0x63')],_0x4a5252);})['then'](function(_0x609966){_0x5c040a=_0x609966;logger['info']('['+_0x4cd8bf[_0xa04c('0x79')][_0xa04c('0x7b')]()+_0xa04c('0x7c'),_0x5c040a['id']);logger[_0xa04c('0x1b')]('['+_0x4cd8bf[_0xa04c('0x79')][_0xa04c('0x7b')]()+']\x20Integration\x20account\x20type\x20%s.',_0x28c5a3[_0xa04c('0x46')]);})[_0xa04c('0x6d')](function(_0x5cf3e8){logger['error']('['+_0x4cd8bf['lastevent'][_0xa04c('0x7b')]()+']',_0x5cf3e8);});}; \ 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 fe9628c..ebe9a82 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 _0x24e3=['Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','sysparm_display_value=true','stripTrailingSlash','serverUrl','%s/api/now/table/','remoteUri','isNil','adminEmail','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','servicenow','redis','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','user','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','endUserNumber','forEach','includes','string','nameField','customField','content','toString','picklist','type','idField','toLowerCase','variable','variableName','customVariable','Variable','name','outbound','POST','incident','Subjects','getString','Descriptions'];(function(_0xf6913b,_0x23904b){var _0x28fb2d=function(_0x22ab51){while(--_0x22ab51){_0xf6913b['push'](_0xf6913b['shift']());}};_0x28fb2d(++_0x23904b);}(_0x24e3,0xfe));var _0x324e=function(_0x41004f,_0x477e14){_0x41004f=_0x41004f-0x0;var _0x473e5e=_0x24e3[_0x41004f];return _0x473e5e;};'use strict';var _=require('lodash');var Promise=require(_0x324e('0x0'));var rp=require(_0x324e('0x1'));var util=require(_0x324e('0x2'));var md5=require(_0x324e('0x3'));var Redis=require(_0x324e('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x324e('0x5'));config['redis']=_['defaults'](config[_0x324e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x324e('0x7'))(new Redis(config['redis']));function getAdminUser(_0x532b8,_0x403a0e,_0x38e234,_0xd932a,_0x84d257,_0x456ba8){return new Promise(function(_0x2e5f29,_0x45af51){var _0x31ebe5={'method':'GET','uri':_0xd932a+_0x324e('0x8')+'&'+_0x84d257+'&'+_0x456ba8,'auth':_0x403a0e,'json':!![]};return rp(_0x31ebe5)[_0x324e('0x9')](function(_0x468d37){if(_0x468d37['result'][_0x324e('0xa')]>0x0){_0x38e234[_0x324e('0xb')]=_0x468d37[_0x324e('0xc')][0x0][_0x324e('0xd')];}logger[_0x324e('0xe')]('['+[_0x532b8[_0x324e('0xf')]()]+_0x324e('0x10'),_0x38e234);_0x2e5f29(_0x38e234);})[_0x324e('0x11')](function(_0x2e39d1){logger[_0x324e('0x12')]('['+[_0x532b8[_0x324e('0xf')]()]+']',_0x2e39d1['message']);_0x45af51(_0x2e39d1[_0x324e('0x13')]);});});}function getUser(_0x3a9281,_0x45e728,_0x3238d7,_0x108762,_0x38109a){return function(_0x58e809){logger[_0x324e('0xe')]('['+[_0x3a9281[_0x324e('0xf')]()]+_0x324e('0x14'),_0x58e809);return new Promise(function(_0x12f33e,_0x1346ec){if(intUtil[_0x324e('0x15')](_0x58e809[_0x324e('0x16')])){var _0x1be0df={'method':_0x324e('0x17'),'uri':_0x3238d7+'sys_user?sysparm_query=email%3D'+_0x58e809[_0x324e('0x16')]+'&'+_0x108762+'&'+_0x38109a,'auth':_0x45e728,'json':!![]};logger[_0x324e('0xe')]('['+[_0x3a9281[_0x324e('0xf')]()]+_0x324e('0x18'),_0x1be0df);return rp(_0x1be0df)[_0x324e('0x9')](function(_0x9cf5a3){logger['info']('['+[_0x3a9281[_0x324e('0xf')]()]+_0x324e('0x19'),_0x9cf5a3);if(_0x9cf5a3['result']['length']>0x0&&String(_0x9cf5a3[_0x324e('0xc')][0x0][_0x324e('0x1a')])===_0x324e('0x1b')){_0x58e809[_0x324e('0x1c')]=_0x9cf5a3[_0x324e('0xc')][0x0][_0x324e('0xd')];}else{_0x58e809[_0x324e('0x1c')]=_0x58e809[_0x324e('0xb')];_0x58e809[_0x324e('0x16')]=_0x58e809['adminEmail'];}logger[_0x324e('0xe')]('['+[_0x3a9281[_0x324e('0xf')]()]+_0x324e('0x1d'),_0x58e809);_0x12f33e(_0x58e809);})['catch'](function(_0x487925){logger[_0x324e('0x12')]('['+[_0x3a9281['toUpperCase']()]+']',_0x487925[_0x324e('0x13')]);_0x1346ec(_0x487925[_0x324e('0x13')]);});}else{logger['info']('['+[_0x3a9281['toUpperCase']()]+_0x324e('0x1e'));_0x58e809[_0x324e('0x1c')]=_0x58e809[_0x324e('0xb')];_0x58e809[_0x324e('0x16')]=_0x58e809['adminEmail'];_0x12f33e(_0x58e809);}});};}function createEndUser(_0x52efc5,_0x4ccd02,_0x29577f,_0x374458,_0x566e67){logger['info']('['+[_0x52efc5['toUpperCase']()]+_0x324e('0x1f'),_0x29577f);return new Promise(function(_0xf395a8,_0x53b589){var _0x505705={'method':'POST','uri':_0x374458+_0x324e('0x20')+_0x566e67,'body':{'user_name':_0x29577f['endUserNumber'],'roles':_0x324e('0x21'),'first_name':_0x29577f['endUserNumber'],'active':_0x324e('0x1b'),'date_format':_0x324e('0x22'),'phone':_0x29577f['endUserNumber']},'auth':_0x4ccd02,'json':!![]};return rp(_0x505705)['then'](function(_0x2ce941){logger[_0x324e('0xe')]('['+[_0x52efc5[_0x324e('0xf')]()]+_0x324e('0x23'),_0x2ce941[_0x324e('0xc')]);_0x29577f[_0x324e('0x24')]=_0x2ce941[_0x324e('0xc')][_0x324e('0xd')];_0xf395a8(_0x29577f);})[_0x324e('0x11')](function(_0x3b6af4){logger[_0x324e('0x12')]('['+[_0x52efc5['toUpperCase']()]+']',_0x3b6af4[_0x324e('0x13')]);_0x53b589(_0x3b6af4[_0x324e('0x13')]);});});}function getEndUser(_0xeb5e3b,_0x3dff0b,_0x3a5850,_0x52c486,_0x52b179){return function(_0xc77189){logger[_0x324e('0xe')]('['+[_0xeb5e3b[_0x324e('0xf')]()]+'],\x20getEndUser\x20input\x20crm',_0xc77189);return new Promise(function(_0x26709c,_0x2d1f28){var _0x540496={'method':_0x324e('0x17'),'uri':_0x3a5850+_0x324e('0x25')+_0xc77189[_0x324e('0x26')]+'&'+_0x52c486+'&'+_0x52b179,'auth':_0x3dff0b,'json':!![]};return rp(_0x540496)[_0x324e('0x9')](function(_0x4082b8){if(_0x4082b8['result']['length']>0x0){_0xc77189[_0x324e('0x24')]=_0x4082b8[_0x324e('0xc')][0x0][_0x324e('0xd')];logger[_0x324e('0xe')]('['+[_0xeb5e3b[_0x324e('0xf')]()]+'],\x20getEndUser\x20crm',_0xc77189);_0x26709c(_0xc77189);}else{return createEndUser(_0xeb5e3b,_0x3dff0b,_0xc77189,_0x3a5850,_0x52c486)[_0x324e('0x9')](function(_0x10b94d){logger[_0x324e('0xe')]('['+[_0xeb5e3b['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x10b94d);_0x26709c(_0x10b94d);});}})[_0x324e('0x11')](function(_0x3b5dbf){logger[_0x324e('0x12')]('['+[_0xeb5e3b['toUpperCase']()]+']',_0x3b5dbf[_0x324e('0x13')]);_0x2d1f28(_0x3b5dbf['message']);});});};}function getCustomFields(_0x30ca27,_0x54b601){var _0x555d00={};if(_0x30ca27[_0x324e('0xa')]>0x0){_[_0x324e('0x27')](_0x30ca27,function(_0x1282ea){if(_[_0x324e('0x28')]([_0x324e('0x29'),'picklist'],_0x1282ea['type'])&&_0x1282ea[_0x324e('0x2a')]&&!_0x1282ea[_0x324e('0x2b')]){_0x555d00[_0x1282ea[_0x324e('0x2a')]['toLowerCase']()]=_0x1282ea[_0x324e('0x2c')][_0x324e('0x2d')]();}else if(_[_0x324e('0x28')]([_0x324e('0x29'),_0x324e('0x2e')],_0x1282ea[_0x324e('0x2f')])&&_0x1282ea[_0x324e('0x30')]&&_0x1282ea['customField']){_0x555d00[_0x1282ea[_0x324e('0x30')][_0x324e('0x31')]()]=_0x1282ea[_0x324e('0x2c')][_0x324e('0x2d')]();}else if(_0x1282ea[_0x324e('0x2f')]===_0x324e('0x32')&&_0x1282ea['variableName']&&_0x1282ea[_0x324e('0x30')]&&_0x1282ea[_0x324e('0x2b')]){_0x555d00[_0x1282ea[_0x324e('0x30')][_0x324e('0x31')]()]=_0x54b601[_0x1282ea[_0x324e('0x33')]][_0x324e('0x2d')]();}else if(_0x1282ea[_0x324e('0x2f')]===_0x324e('0x34')&&_0x1282ea[_0x324e('0x35')]&&_0x1282ea[_0x324e('0x35')]['name']&&_0x1282ea['idField']&&_0x1282ea[_0x324e('0x2b')]){_0x555d00[_0x1282ea['idField'][_0x324e('0x31')]()]=_0x54b601[_0x1282ea['Variable'][_0x324e('0x36')][_0x324e('0x31')]()][_0x324e('0x2d')]();}});}return _0x555d00;}function getTicket(_0x4667c6,_0x43df61,_0x207019,_0x51ca8c,_0x500271,_0x5906bd){return function(_0x410006){logger['info']('['+[_0x4667c6[_0x324e('0xf')]()]+']\x20getTicket\x20input\x20crm',_0x410006);return new Promise(function(_0x1e9032,_0x34e6f1){var _0x3eb56e=_0x4667c6[_0x324e('0x31')]()===_0x324e('0x37')?_0x410006[_0x324e('0x1c')]:_0x410006[_0x324e('0x24')];var _0x441aa9={'method':_0x324e('0x38'),'uri':_0x207019+_0x324e('0x39')+'?'+_0x5906bd,'body':Object['assign']({},{'active':'true','caller_id':_0x3eb56e,'assigned_to':_0x410006[_0x324e('0x1c')],'short_description':intUtil['getString'](_0x51ca8c[_0x324e('0x3a')],_0x500271,'\x20'),'description':intUtil[_0x324e('0x3b')](_0x51ca8c[_0x324e('0x3c')],_0x500271,'\x0a')},getCustomFields(_0x51ca8c[_0x324e('0x3d')],_0x500271)),'auth':_0x43df61,'json':!![]};return rp(_0x441aa9)[_0x324e('0x9')](function(_0xbac0c5){logger[_0x324e('0xe')]('['+[_0x4667c6['toUpperCase']()]+_0x324e('0x3e'),_0xbac0c5[_0x324e('0xc')]);_0x410006[_0x324e('0x3f')]=_0xbac0c5['result'][_0x324e('0xd')];_0x410006[_0x324e('0x40')]=_0xbac0c5['result'][_0x324e('0x41')];logger['info']('['+[_0x4667c6[_0x324e('0xf')]()]+_0x324e('0x42'),_0x410006);_0x1e9032(_0x410006);})[_0x324e('0x11')](function(_0x5cf607){logger[_0x324e('0x12')]('['+[_0x4667c6[_0x324e('0xf')]()]+']',_0x5cf607[_0x324e('0x13')]);_0x34e6f1(_0x5cf607[_0x324e('0x13')]);});});};}function createRemoteTag(_0x11fe92,_0x131bfe,_0x5afc95,_0x237811){return new Promise(function(_0x1356ba,_0x253b23){var _0x36f23d={'method':_0x324e('0x38'),'uri':_0x5afc95+_0x324e('0x43')+'?'+_0x237811,'body':{'short_description':_0x11fe92,'global':!![],'active':!![],'name':_0x11fe92},'auth':_0x131bfe,'json':!![]};return rp(_0x36f23d)[_0x324e('0x9')](function(_0x3c3bcc){var _0xd1be10=_0x3c3bcc[_0x324e('0xc')][_0x324e('0xd')];_0x1356ba(_0xd1be10);});});}function getRemoteTag(_0x4655cb,_0x27e63d,_0x2837f3,_0x409da1,_0x23cf7a){return new Promise(function(_0x545f34,_0x420163){var _0x4a116d={'method':_0x324e('0x17'),'uri':_0x2837f3+_0x324e('0x43')+'?sysparm_query=name%3D'+_0x4655cb+'&'+_0x409da1,'auth':_0x27e63d,'json':!![]};return rp(_0x4a116d)[_0x324e('0x9')](function(_0x268e03){if(_0x268e03[_0x324e('0xc')][_0x324e('0xa')]>0x0){var _0x589349=_0x268e03[_0x324e('0xc')][0x0]['sys_id'];_0x545f34(_0x589349);}else{return createRemoteTag(_0x4655cb,_0x27e63d,_0x2837f3,_0x409da1)[_0x324e('0x9')](function(_0x5081c4){_0x545f34(_0x5081c4);});}});});}function assignTagToIncident(_0x1220cb,_0x4c17d6,_0x49993f,_0x3e9a98,_0x659f97){return new Promise(function(_0x31c25a,_0x306097){var _0x551cfc={'method':'POST','uri':_0x49993f+_0x324e('0x44')+'?'+_0x659f97,'body':{'label':_0x1220cb,'table':'incident','id_type':_0x324e('0x45'),'table_key':_0x3e9a98[_0x324e('0x3f')],'title':_0x324e('0x46')+_0x3e9a98['ticketNumber'],'id_display':_0x3e9a98[_0x324e('0x40')]},'auth':_0x4c17d6,'json':!![]};return rp(_0x551cfc)[_0x324e('0x9')](function(_0x37cd7c){_0x31c25a();})[_0x324e('0x11')](function(){_0x31c25a();});});}function manageTags(_0x8f30d9,_0x86f81,_0x356610,_0x361211,_0x59c39d,_0x3ee9ce,_0x601999){return new Promise(function(_0x135051,_0x28e555){var _0x5bb926=[];_0x86f81[_0x324e('0x27')](function(_0x32fcb5){_0x5bb926[_0x324e('0x47')](getRemoteTag(_0x32fcb5,_0x356610,_0x361211,_0x3ee9ce,_0x601999));});return Promise[_0x324e('0x48')](_0x5bb926)[_0x324e('0x9')](function(_0x45da59){if(_0x45da59[_0x324e('0xa')]){logger['info']('['+[_0x8f30d9[_0x324e('0xf')]()]+_0x324e('0x49'),_0x45da59);var _0x22653d=[];_0x45da59[_0x324e('0x27')](function(_0x2ecd7d){_0x22653d[_0x324e('0x47')](assignTagToIncident(_0x2ecd7d,_0x356610,_0x361211,_0x59c39d,_0x3ee9ce));});return Promise[_0x324e('0x48')](_0x22653d)[_0x324e('0x9')](function(){_0x135051();})[_0x324e('0x11')](function(){_0x135051();});}else{_0x135051();}});});}function getTags(_0x2dad9a,_0x57464d,_0x29fe4e,_0x537408,_0xf0a6c9,_0x4ae291){return function(_0x2ff2b9){return new Promise(function(_0x565556,_0xc9ae83){var _0x351cda=[];var _0x11dd14=_0x537408['Tags'];if(_0x11dd14&&_0x11dd14[_0x324e('0xa')]>0x0){_0x351cda=_['map'](_0x11dd14,'name');}if(_0x351cda[_0x324e('0xa')]>0x0){return manageTags(_0x2dad9a,_0x351cda,_0x57464d,_0x29fe4e,_0x2ff2b9,_0xf0a6c9,_0x4ae291)[_0x324e('0x9')](function(){_0x565556(_0x2ff2b9);});}else{_0x565556(_0x2ff2b9);}});};}function emit(_0x1dafec,_0x3278fe,_0x464d95){var _0x2e21a5='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x324e('0x4a')+_0x324e('0x4b');var _0x352087={'uri':_0x1dafec+_0x324e('0x4c')+_0x464d95+_0x2e21a5};io['to'](util[_0x324e('0x4d')](_0x324e('0x4e'),_0x3278fe))[_0x324e('0x4f')]('trigger:browser:url',_0x352087);}exports['cs']=function(_0x6deb74,_0x5471ab,_0x3bf6fc,_0x4749f4,_0x6b7b06,_0x262fa,_0x42bd6a,_0x7a74d1){var _0x5d810c={};var _0x1535fd={'user':_0x262fa[_0x324e('0x50')],'pass':_0x262fa[_0x324e('0x51')]};var _0x44efd0='sysparm_limit=1';var _0x57de60=_0x324e('0x52');_0x262fa['remoteUri']=intUtil[_0x324e('0x53')](_0x262fa['remoteUri']);_0x262fa[_0x324e('0x54')]=intUtil[_0x324e('0x53')](_0x262fa[_0x324e('0x54')]);var _0x205dff=util[_0x324e('0x4d')](_0x324e('0x55'),_0x262fa[_0x324e('0x56')]);_0x5d810c[_0x324e('0x16')]=!_[_0x324e('0x57')](_0x4749f4)?_0x4749f4['email']:null;_0x5d810c[_0x324e('0x58')]=_0x262fa['email'];_0x5d810c['endUserNumber']=_0x7a74d1['toLowerCase']()===_0x324e('0x37')?_0x5471ab['destcalleridnum']:_0x5471ab[_0x324e('0x59')];_0x5d810c[_0x324e('0x5a')]=_0x7a74d1===_0x324e('0x5b')||_0x7a74d1===_0x324e('0x5c')?_0x324e('0x5b'):'outbound';var _0x5be086=util[_0x324e('0x4d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x262fa[_0x324e('0x54')],_0x5471ab[_0x324e('0x5d')],md5(_0x5471ab[_0x324e('0x5d')]));if(_0x6b7b06&&_0x6b7b06[_0x324e('0x5e')]){logger[_0x324e('0xe')](_0x324e('0x5f'),_0x324e('0x60'));_0x5471ab[_0x324e('0x61')]=_0x5be086;}else if(_0x42bd6a&&_0x42bd6a['recordingFormat']&&_0x42bd6a[_0x324e('0x62')]!=='none'){logger[_0x324e('0xe')](_0x324e('0x63'),'Recording\x20is\x20enabled!');_0x5471ab['recordingURL']=_0x5be086;}else{_0x5471ab[_0x324e('0x61')]='';}return getAdminUser(_0x7a74d1,_0x1535fd,_0x5d810c,_0x205dff,_0x57de60,_0x44efd0)[_0x324e('0x9')](getUser(_0x7a74d1,_0x1535fd,_0x205dff,_0x57de60,_0x44efd0))[_0x324e('0x9')](getEndUser(_0x7a74d1,_0x1535fd,_0x205dff,_0x57de60,_0x44efd0))['then'](getTicket(_0x7a74d1,_0x1535fd,_0x205dff,_0x3bf6fc,_0x5471ab,_0x57de60))['then'](function(_0x218f14){logger[_0x324e('0xe')](util[_0x324e('0x4d')](_0x324e('0x64'),_0x218f14['ticketId']));logger[_0x324e('0xe')](util[_0x324e('0x4d')](_0x324e('0x65'),_0x7a74d1));if(_0x7a74d1!=='unmanaged'){logger['info']('['+[_0x7a74d1[_0x324e('0xf')]()]+']',_0x324e('0x66'));emit(_0x262fa['remoteUri'],_0x4749f4[_0x324e('0x36')],_0x218f14[_0x324e('0x3f')]);}})['catch'](function(_0x42e716){logger['error']('['+[_0x7a74d1[_0x324e('0xf')]()]+_0x324e('0x67'),util[_0x324e('0x68')](_0x42e716,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x690a=['push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','then','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','true','adminEmail','],\x20getUser\x20crm','error','userId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string','picklist','nameField','customField','content','toString','type','idField','toLowerCase','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','incident','Incident\x20-\x20'];(function(_0x449f9d,_0x5bf3f5){var _0x5488a0=function(_0xac6406){while(--_0xac6406){_0x449f9d['push'](_0x449f9d['shift']());}};_0x5488a0(++_0x5bf3f5);}(_0x690a,0xfe));var _0xa690=function(_0x28d7c5,_0x1c1d87){_0x28d7c5=_0x28d7c5-0x0;var _0x577cb2=_0x690a[_0x28d7c5];return _0x577cb2;};'use strict';var _=require('lodash');var Promise=require(_0xa690('0x0'));var rp=require(_0xa690('0x1'));var util=require(_0xa690('0x2'));var md5=require(_0xa690('0x3'));var Redis=require(_0xa690('0x4'));var intUtil=require(_0xa690('0x5'));var config=require(_0xa690('0x6'));var logger=require('../../../../config/logger')(_0xa690('0x7'));config[_0xa690('0x8')]=_[_0xa690('0x9')](config[_0xa690('0x8')],{'host':_0xa690('0xa'),'port':0x18eb});var io=require(_0xa690('0xb'))(new Redis(config[_0xa690('0x8')]));function getAdminUser(_0x161591,_0x35a187,_0x427a89,_0x4f6ab1,_0x37eadf,_0x52600d){return new Promise(function(_0x3b19e9,_0x37e884){var _0x5deef0={'method':_0xa690('0xc'),'uri':_0x4f6ab1+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x37eadf+'&'+_0x52600d,'auth':_0x35a187,'json':!![]};return rp(_0x5deef0)[_0xa690('0xd')](function(_0x34fa1d){if(_0x34fa1d[_0xa690('0xe')][_0xa690('0xf')]>0x0){_0x427a89[_0xa690('0x10')]=_0x34fa1d[_0xa690('0xe')][0x0][_0xa690('0x11')];}logger['info']('['+[_0x161591[_0xa690('0x12')]()]+_0xa690('0x13'),_0x427a89);_0x3b19e9(_0x427a89);})[_0xa690('0x14')](function(_0x5bd4b6){logger['error']('['+[_0x161591[_0xa690('0x12')]()]+']',_0x5bd4b6[_0xa690('0x15')]);_0x37e884(_0x5bd4b6['message']);});});}function getUser(_0x886460,_0x339fa6,_0x2b7d96,_0x51d05a,_0x464cbd){return function(_0x324204){logger[_0xa690('0x16')]('['+[_0x886460[_0xa690('0x12')]()]+_0xa690('0x17'),_0x324204);return new Promise(function(_0x5ae1e4,_0x56f177){if(intUtil[_0xa690('0x18')](_0x324204[_0xa690('0x19')])){var _0x580165={'method':'GET','uri':_0x2b7d96+_0xa690('0x1a')+_0x324204['userEmail']+'&'+_0x51d05a+'&'+_0x464cbd,'auth':_0x339fa6,'json':!![]};logger[_0xa690('0x16')]('['+[_0x886460[_0xa690('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x580165);return rp(_0x580165)['then'](function(_0x4da7e7){logger['info']('['+[_0x886460[_0xa690('0x12')]()]+_0xa690('0x1b'),_0x4da7e7);if(_0x4da7e7['result']['length']>0x0&&String(_0x4da7e7[_0xa690('0xe')][0x0]['active'])===_0xa690('0x1c')){_0x324204['userId']=_0x4da7e7[_0xa690('0xe')][0x0]['sys_id'];}else{_0x324204['userId']=_0x324204[_0xa690('0x10')];_0x324204[_0xa690('0x19')]=_0x324204[_0xa690('0x1d')];}logger['info']('['+[_0x886460[_0xa690('0x12')]()]+_0xa690('0x1e'),_0x324204);_0x5ae1e4(_0x324204);})['catch'](function(_0x5ac330){logger[_0xa690('0x1f')]('['+[_0x886460[_0xa690('0x12')]()]+']',_0x5ac330['message']);_0x56f177(_0x5ac330[_0xa690('0x15')]);});}else{logger[_0xa690('0x16')]('['+[_0x886460[_0xa690('0x12')]()]+']\x20using\x20admin\x20profile');_0x324204[_0xa690('0x20')]=_0x324204[_0xa690('0x10')];_0x324204[_0xa690('0x19')]=_0x324204['adminEmail'];_0x5ae1e4(_0x324204);}});};}function createEndUser(_0x54f635,_0x218c05,_0x485236,_0x4cd976,_0xdf2a98){logger[_0xa690('0x16')]('['+[_0x54f635[_0xa690('0x12')]()]+_0xa690('0x21'),_0x485236);return new Promise(function(_0x58c4d7,_0x1764da){var _0x4b2ebb={'method':_0xa690('0x22'),'uri':_0x4cd976+_0xa690('0x23')+_0xdf2a98,'body':{'user_name':_0x485236[_0xa690('0x24')],'roles':_0xa690('0x25'),'first_name':_0x485236[_0xa690('0x24')],'active':'true','date_format':'System','phone':_0x485236['endUserNumber']},'auth':_0x218c05,'json':!![]};return rp(_0x4b2ebb)[_0xa690('0xd')](function(_0xc43ecb){logger['info']('['+[_0x54f635[_0xa690('0x12')]()]+'],\x20EndUser\x20schema',_0xc43ecb['result']);_0x485236[_0xa690('0x26')]=_0xc43ecb[_0xa690('0xe')]['sys_id'];_0x58c4d7(_0x485236);})['catch'](function(_0x50f62c){logger[_0xa690('0x1f')]('['+[_0x54f635[_0xa690('0x12')]()]+']',_0x50f62c[_0xa690('0x15')]);_0x1764da(_0x50f62c[_0xa690('0x15')]);});});}function getEndUser(_0x19e5a6,_0xbce039,_0x4bc1e9,_0x396c76,_0x3a6812){return function(_0x165ff4){logger[_0xa690('0x16')]('['+[_0x19e5a6[_0xa690('0x12')]()]+_0xa690('0x27'),_0x165ff4);return new Promise(function(_0x30f992,_0x420317){var _0x30ba69={'method':_0xa690('0xc'),'uri':_0x4bc1e9+_0xa690('0x28')+_0x165ff4[_0xa690('0x24')]+'&'+_0x396c76+'&'+_0x3a6812,'auth':_0xbce039,'json':!![]};return rp(_0x30ba69)[_0xa690('0xd')](function(_0x598c28){if(_0x598c28[_0xa690('0xe')][_0xa690('0xf')]>0x0){_0x165ff4[_0xa690('0x26')]=_0x598c28[_0xa690('0xe')][0x0][_0xa690('0x11')];logger[_0xa690('0x16')]('['+[_0x19e5a6[_0xa690('0x12')]()]+'],\x20getEndUser\x20crm',_0x165ff4);_0x30f992(_0x165ff4);}else{return createEndUser(_0x19e5a6,_0xbce039,_0x165ff4,_0x4bc1e9,_0x396c76)[_0xa690('0xd')](function(_0x69ccdf){logger[_0xa690('0x16')]('['+[_0x19e5a6[_0xa690('0x12')]()]+_0xa690('0x29'),_0x69ccdf);_0x30f992(_0x69ccdf);});}})[_0xa690('0x14')](function(_0x60b870){logger['error']('['+[_0x19e5a6[_0xa690('0x12')]()]+']',_0x60b870[_0xa690('0x15')]);_0x420317(_0x60b870[_0xa690('0x15')]);});});};}function getCustomFields(_0x510f3b,_0x1acd74){var _0x1e3db2={};if(_0x510f3b[_0xa690('0xf')]>0x0){_[_0xa690('0x2a')](_0x510f3b,function(_0x2b1982){if(_[_0xa690('0x2b')]([_0xa690('0x2c'),_0xa690('0x2d')],_0x2b1982['type'])&&_0x2b1982[_0xa690('0x2e')]&&!_0x2b1982[_0xa690('0x2f')]){_0x1e3db2[_0x2b1982['nameField']['toLowerCase']()]=_0x2b1982[_0xa690('0x30')][_0xa690('0x31')]();}else if(_[_0xa690('0x2b')](['string',_0xa690('0x2d')],_0x2b1982[_0xa690('0x32')])&&_0x2b1982[_0xa690('0x33')]&&_0x2b1982[_0xa690('0x2f')]){_0x1e3db2[_0x2b1982[_0xa690('0x33')][_0xa690('0x34')]()]=_0x2b1982[_0xa690('0x30')][_0xa690('0x31')]();}else if(_0x2b1982[_0xa690('0x32')]===_0xa690('0x35')&&_0x2b1982['variableName']&&_0x2b1982[_0xa690('0x33')]&&_0x2b1982[_0xa690('0x2f')]){_0x1e3db2[_0x2b1982['idField'][_0xa690('0x34')]()]=_0x1acd74[_0x2b1982[_0xa690('0x36')]]['toString']();}else if(_0x2b1982[_0xa690('0x32')]===_0xa690('0x37')&&_0x2b1982[_0xa690('0x38')]&&_0x2b1982[_0xa690('0x38')]['name']&&_0x2b1982[_0xa690('0x33')]&&_0x2b1982[_0xa690('0x2f')]){_0x1e3db2[_0x2b1982[_0xa690('0x33')][_0xa690('0x34')]()]=_0x1acd74[_0x2b1982[_0xa690('0x38')][_0xa690('0x39')][_0xa690('0x34')]()][_0xa690('0x31')]();}});}return _0x1e3db2;}function getTicket(_0x2c09d5,_0x1883e2,_0x1f2d90,_0x1427e9,_0x2be6da,_0x27336){return function(_0x2aafe2){logger[_0xa690('0x16')]('['+[_0x2c09d5[_0xa690('0x12')]()]+_0xa690('0x3a'),_0x2aafe2);return new Promise(function(_0x1c0cf7,_0x16470a){var _0x3f4451=_0x2c09d5['toLowerCase']()===_0xa690('0x3b')?_0x2aafe2['userId']:_0x2aafe2[_0xa690('0x26')];var _0x280e55={'method':_0xa690('0x22'),'uri':_0x1f2d90+'incident'+'?'+_0x27336,'body':Object[_0xa690('0x3c')]({},{'active':_0xa690('0x1c'),'caller_id':_0x3f4451,'assigned_to':_0x2aafe2[_0xa690('0x20')],'short_description':intUtil[_0xa690('0x3d')](_0x1427e9['Subjects'],_0x2be6da,'\x20'),'description':intUtil[_0xa690('0x3d')](_0x1427e9[_0xa690('0x3e')],_0x2be6da,'\x0a')},getCustomFields(_0x1427e9[_0xa690('0x3f')],_0x2be6da)),'auth':_0x1883e2,'json':!![]};return rp(_0x280e55)[_0xa690('0xd')](function(_0x3ce0ac){logger['info']('['+[_0x2c09d5['toUpperCase']()]+_0xa690('0x40'),_0x3ce0ac[_0xa690('0xe')]);_0x2aafe2[_0xa690('0x41')]=_0x3ce0ac[_0xa690('0xe')]['sys_id'];_0x2aafe2[_0xa690('0x42')]=_0x3ce0ac[_0xa690('0xe')][_0xa690('0x43')];logger[_0xa690('0x16')]('['+[_0x2c09d5[_0xa690('0x12')]()]+_0xa690('0x44'),_0x2aafe2);_0x1c0cf7(_0x2aafe2);})['catch'](function(_0xcaf2f2){logger[_0xa690('0x1f')]('['+[_0x2c09d5[_0xa690('0x12')]()]+']',_0xcaf2f2['message']);_0x16470a(_0xcaf2f2[_0xa690('0x15')]);});});};}function createRemoteTag(_0x4328de,_0x37decd,_0x3a3587,_0x9bd088){return new Promise(function(_0x1e4d7b,_0x47a688){var _0x225658={'method':_0xa690('0x22'),'uri':_0x3a3587+_0xa690('0x45')+'?'+_0x9bd088,'body':{'short_description':_0x4328de,'global':!![],'active':!![],'name':_0x4328de},'auth':_0x37decd,'json':!![]};return rp(_0x225658)[_0xa690('0xd')](function(_0x5f03e2){var _0x1e292d=_0x5f03e2[_0xa690('0xe')][_0xa690('0x11')];_0x1e4d7b(_0x1e292d);});});}function getRemoteTag(_0x3dc62a,_0x525bfd,_0xa750e9,_0x516066,_0x54c780){return new Promise(function(_0x4ad317,_0x1201a6){var _0x233897={'method':_0xa690('0xc'),'uri':_0xa750e9+_0xa690('0x45')+_0xa690('0x46')+_0x3dc62a+'&'+_0x516066,'auth':_0x525bfd,'json':!![]};return rp(_0x233897)[_0xa690('0xd')](function(_0x34f410){if(_0x34f410['result']['length']>0x0){var _0x11171c=_0x34f410[_0xa690('0xe')][0x0][_0xa690('0x11')];_0x4ad317(_0x11171c);}else{return createRemoteTag(_0x3dc62a,_0x525bfd,_0xa750e9,_0x516066)[_0xa690('0xd')](function(_0x3f0c8e){_0x4ad317(_0x3f0c8e);});}});});}function assignTagToIncident(_0x1575d8,_0xf15a2a,_0x2e2c3d,_0x3c5ad0,_0x3032a5){return new Promise(function(_0x5035de,_0x5f1d58){var _0x252d58={'method':_0xa690('0x22'),'uri':_0x2e2c3d+'label_entry'+'?'+_0x3032a5,'body':{'label':_0x1575d8,'table':_0xa690('0x47'),'id_type':'Incident','table_key':_0x3c5ad0['ticketId'],'title':_0xa690('0x48')+_0x3c5ad0[_0xa690('0x42')],'id_display':_0x3c5ad0[_0xa690('0x42')]},'auth':_0xf15a2a,'json':!![]};return rp(_0x252d58)['then'](function(_0x50fe49){_0x5035de();})['catch'](function(){_0x5035de();});});}function manageTags(_0x4a71d7,_0x2d5d25,_0x2da594,_0x46d669,_0x529718,_0x102f4a,_0xedde21){return new Promise(function(_0x4c3e2e,_0x498a30){var _0x272e43=[];_0x2d5d25[_0xa690('0x2a')](function(_0x383d39){_0x272e43[_0xa690('0x49')](getRemoteTag(_0x383d39,_0x2da594,_0x46d669,_0x102f4a,_0xedde21));});return Promise[_0xa690('0x4a')](_0x272e43)['then'](function(_0x1ab13e){if(_0x1ab13e[_0xa690('0xf')]){logger[_0xa690('0x16')]('['+[_0x4a71d7[_0xa690('0x12')]()]+_0xa690('0x4b'),_0x1ab13e);var _0x2cd8a7=[];_0x1ab13e['forEach'](function(_0x53ebc4){_0x2cd8a7[_0xa690('0x49')](assignTagToIncident(_0x53ebc4,_0x2da594,_0x46d669,_0x529718,_0x102f4a));});return Promise[_0xa690('0x4a')](_0x2cd8a7)['then'](function(){_0x4c3e2e();})['catch'](function(){_0x4c3e2e();});}else{_0x4c3e2e();}});});}function getTags(_0x5c4d12,_0x5e733b,_0x482e74,_0xf97368,_0x1b57f7,_0x36f23b){return function(_0x3778b8){return new Promise(function(_0x5ee71b,_0x3e33b0){var _0x788edc=[];var _0x5931e4=_0xf97368[_0xa690('0x4c')];if(_0x5931e4&&_0x5931e4[_0xa690('0xf')]>0x0){_0x788edc=_[_0xa690('0x4d')](_0x5931e4,'name');}if(_0x788edc[_0xa690('0xf')]>0x0){return manageTags(_0x5c4d12,_0x788edc,_0x5e733b,_0x482e74,_0x3778b8,_0x1b57f7,_0x36f23b)[_0xa690('0xd')](function(){_0x5ee71b(_0x3778b8);});}else{_0x5ee71b(_0x3778b8);}});};}function emit(_0x368f6c,_0x1b735a,_0x4fe799){var _0x3b20be=_0xa690('0x4e')+_0xa690('0x4f')+_0xa690('0x50')+_0xa690('0x51');var _0x5a9e0d={'uri':_0x368f6c+_0xa690('0x52')+_0x4fe799+_0x3b20be};io['to'](util[_0xa690('0x53')](_0xa690('0x54'),_0x1b735a))[_0xa690('0x55')](_0xa690('0x56'),_0x5a9e0d);}exports['cs']=function(_0x2b91f2,_0x9dc7fe,_0x59debe,_0x55ca9f,_0x141fab,_0xb97fc7,_0x1f21ba,_0x5edf41){var _0x257c7a={};var _0xc02307={'user':_0xb97fc7[_0xa690('0x57')],'pass':_0xb97fc7['password']};var _0x5233bb=_0xa690('0x58');var _0x25156e=_0xa690('0x59');_0xb97fc7[_0xa690('0x5a')]=intUtil[_0xa690('0x5b')](_0xb97fc7[_0xa690('0x5a')]);_0xb97fc7[_0xa690('0x5c')]=intUtil[_0xa690('0x5b')](_0xb97fc7[_0xa690('0x5c')]);var _0x22fae7=util[_0xa690('0x53')](_0xa690('0x5d'),_0xb97fc7['remoteUri']);_0x257c7a[_0xa690('0x19')]=!_['isNil'](_0x55ca9f)?_0x55ca9f[_0xa690('0x5e')]:null;_0x257c7a[_0xa690('0x1d')]=_0xb97fc7[_0xa690('0x5e')];_0x257c7a[_0xa690('0x24')]=_0x5edf41[_0xa690('0x34')]()===_0xa690('0x3b')?_0x9dc7fe[_0xa690('0x5f')]:_0x9dc7fe[_0xa690('0x60')];_0x257c7a['callDirection']=_0x5edf41==='queue'||_0x5edf41===_0xa690('0x61')?'queue':'outbound';var _0x5d6ee9=util[_0xa690('0x53')](_0xa690('0x62'),_0xb97fc7['serverUrl'],_0x9dc7fe[_0xa690('0x63')],md5(_0x9dc7fe['uniqueid']));if(_0x141fab&&_0x141fab['monitor_format']){logger['info']('[QUEUE]',_0xa690('0x64'));_0x9dc7fe['recordingURL']=_0x5d6ee9;}else if(_0x1f21ba&&_0x1f21ba[_0xa690('0x65')]&&_0x1f21ba[_0xa690('0x65')]!=='none'){logger['info'](_0xa690('0x66'),_0xa690('0x64'));_0x9dc7fe[_0xa690('0x67')]=_0x5d6ee9;}else{_0x9dc7fe[_0xa690('0x67')]='';}return getAdminUser(_0x5edf41,_0xc02307,_0x257c7a,_0x22fae7,_0x25156e,_0x5233bb)[_0xa690('0xd')](getUser(_0x5edf41,_0xc02307,_0x22fae7,_0x25156e,_0x5233bb))[_0xa690('0xd')](getEndUser(_0x5edf41,_0xc02307,_0x22fae7,_0x25156e,_0x5233bb))[_0xa690('0xd')](getTicket(_0x5edf41,_0xc02307,_0x22fae7,_0x59debe,_0x9dc7fe,_0x25156e))['then'](function(_0x19d1c2){logger[_0xa690('0x16')](util[_0xa690('0x53')](_0xa690('0x68'),_0x19d1c2[_0xa690('0x41')]));logger[_0xa690('0x16')](util[_0xa690('0x53')](_0xa690('0x69'),_0x5edf41));if(_0x5edf41!==_0xa690('0x61')){logger['info']('['+[_0x5edf41[_0xa690('0x12')]()]+']',_0xa690('0x6a'));emit(_0xb97fc7[_0xa690('0x5a')],_0x55ca9f['name'],_0x19d1c2['ticketId']);}})[_0xa690('0x14')](function(_0xe36975){logger[_0xa690('0x1f')]('['+[_0x5edf41[_0xa690('0x12')]()]+_0xa690('0x6b'),util[_0xa690('0x6c')](_0xe36975,{'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 fa051d5..b24727b 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 _0xaa0d=['%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','catch','error','stripTrailingSlash','recordingFormat','[OUTBOUND]','Outbound','version','charAt','user:%s','unmanaged','monitor_format','lastevent','toUpperCase','calleridname','calleridnum','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','emit','info','name','getString','assigned_user_id','created_by','Descriptions','slice','duration_minutes','parent_type','Contacts','parent_name','variableName','push','idField','JSON','stringify','format','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','phone_home','find','set_entry','first_name','','Caller\x20-\x20%s','debug','[HTTP]','forEach','type','nameField','customField','toLowerCase','content','string','custom_fields','variable','Variable','login','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','uri'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0xaa0d,0x1d8));var _0xdaa0=function(_0x5f1671,_0x5c55b2){_0x5f1671=_0x5f1671-0x0;var _0x17bc35=_0xaa0d[_0x5f1671];return _0x17bc35;};'use strict';var _=require('lodash');var rp=require(_0xdaa0('0x0'));var BPromise=require(_0xdaa0('0x1'));var md5=require(_0xdaa0('0x2'));var util=require(_0xdaa0('0x3'));var Redis=require(_0xdaa0('0x4'));var intUtil=require(_0xdaa0('0x5'));var config=require(_0xdaa0('0x6'));var logger=require('../../../../config/logger')('sugarcrm');config[_0xdaa0('0x7')]=_[_0xdaa0('0x8')](config[_0xdaa0('0x7')],{'host':_0xdaa0('0x9'),'port':0x18eb});var io=require(_0xdaa0('0xa'))(new Redis(config[_0xdaa0('0x7')]));var def={'method':_0xdaa0('0xb'),'json':!![]};function emit(_0x3115be,_0x455ca0,_0x3f287d){io['to'](_0x3115be)[_0xdaa0('0xc')](_0x455ca0,_0x3f287d);}function getTicket(_0x36b403,_0x402d42,_0x226ebc,_0x2764a3,_0x4b6f1c,_0x4d05bc,_0x27a679,_0x2beafe){logger[_0xdaa0('0xd')]('Creating\x20new\x20ticket...');var _0x43e51d=new Date();var _0x591fe6=[{'name':_0xdaa0('0xe'),'value':intUtil[_0xdaa0('0xf')](_0x2764a3['Subjects'],_0x4b6f1c,'\x20')},{'name':_0xdaa0('0x10'),'value':_0x402d42['id']},{'name':_0xdaa0('0x11'),'value':_0x402d42['id']},{'name':'description','value':intUtil[_0xdaa0('0xf')](_0x2764a3[_0xdaa0('0x12')],_0x4b6f1c,'\x0a')},{'name':'date_start','value':_0x43e51d['toISOString']()[_0xdaa0('0x13')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xdaa0('0x14'),'value':'15'},{'name':'parent_id','value':_0x226ebc['id']},{'name':_0xdaa0('0x15'),'value':_0xdaa0('0x16')},{'name':_0xdaa0('0x17'),'value':_0x226ebc[_0xdaa0('0xe')]},{'name':'direction','value':_0x2beafe}];if(_0x4d05bc['length']){_['forEach'](_0x4d05bc,function(_0x5e5cc5){if(_0x4b6f1c[_0x5e5cc5[_0xdaa0('0x18')]]){_0x591fe6[_0xdaa0('0x19')]({'name':_0x5e5cc5[_0xdaa0('0x1a')],'value':_0x4b6f1c[_0x5e5cc5[_0xdaa0('0x18')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xdaa0('0x1b'),'rest_data':JSON[_0xdaa0('0x1c')]({'session':_0x27a679['id'],'module_name':'Calls','name_value_list':_0x591fe6})}});}function getAuth(_0x2b41b5){return util[_0xdaa0('0x1d')]('Basic\x20%s',new Buffer(_0x2b41b5[_0xdaa0('0x1e')]+':X')[_0xdaa0('0x1f')](_0xdaa0('0x20')));}function getServerInfo(_0x4b72e5){return request({'form':{'method':_0xdaa0('0x21'),'input_type':_0xdaa0('0x1b'),'response_type':_0xdaa0('0x1b'),'rest_data':JSON[_0xdaa0('0x1c')]({'session':_0x4b72e5['id']})}});}function getUser(_0x33e003,_0x39e201,_0xd5ccc7){if(!_[_0xdaa0('0x22')](_0x39e201)){logger[_0xdaa0('0xd')](_0xdaa0('0x23'),_0x39e201);return request({'form':{'method':_0xdaa0('0x24'),'input_type':_0xdaa0('0x1b'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0xd5ccc7['id'],'module_name':'Employees','query':util[_0xdaa0('0x1d')](_0xdaa0('0x25'),_0x39e201),'order_by':'','offset':'0','select_fields':['id',_0xdaa0('0xe'),_0xdaa0('0x26')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xdaa0('0x27')](function(_0x203661){if(_0x203661[_0xdaa0('0x28')][_0xdaa0('0x29')]){var _0x347835=_['find'](_0x203661[_0xdaa0('0x28')],function(_0x41a901){return _0x41a901[_0xdaa0('0x2a')][_0xdaa0('0x26')][_0xdaa0('0x2b')]===_0x39e201;});if(_0x347835){logger[_0xdaa0('0xd')](_0xdaa0('0x2c'));return BPromise[_0xdaa0('0x2d')]({'id':_0x347835[_0xdaa0('0x2a')]['id'][_0xdaa0('0x2b')],'name':_0x347835[_0xdaa0('0x2a')][_0xdaa0('0xe')]['value']});}}logger['info'](_0xdaa0('0x2e'));return BPromise[_0xdaa0('0x2d')]({'id':_0xd5ccc7[_0xdaa0('0x2a')]['user_id'][_0xdaa0('0x2b')],'name':_0xd5ccc7[_0xdaa0('0x2a')][_0xdaa0('0x26')]['value']});});}else{logger[_0xdaa0('0xd')](_0xdaa0('0x2f'));return BPromise['resolve']({'id':_0xd5ccc7[_0xdaa0('0x2a')][_0xdaa0('0x30')][_0xdaa0('0x2b')],'name':_0xd5ccc7[_0xdaa0('0x2a')][_0xdaa0('0x26')][_0xdaa0('0x2b')]});}}function getEndUser(_0x3555c9,_0x3beb9e,_0x10597a,_0x384d1a){logger[_0xdaa0('0xd')](_0xdaa0('0x31'),_0x10597a);return request({'form':{'method':_0xdaa0('0x24'),'input_type':_0xdaa0('0x1b'),'response_type':_0xdaa0('0x1b'),'rest_data':JSON['stringify']({'session':_0x384d1a['id'],'module_name':'Contacts','query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x10597a),'order_by':'','offset':'0','select_fields':['id','name',_0xdaa0('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5d3b02){if(_0x5d3b02[_0xdaa0('0x28')][_0xdaa0('0x29')]){var _0x1c9a74=_[_0xdaa0('0x33')](_0x5d3b02['entry_list'],function(_0x4b3a9f){return _0x4b3a9f[_0xdaa0('0x2a')]['phone_home'][_0xdaa0('0x2b')]===_0x10597a;});if(_0x1c9a74){logger[_0xdaa0('0xd')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x1c9a74[_0xdaa0('0x2a')]['id'][_0xdaa0('0x2b')],'name':_0x1c9a74[_0xdaa0('0x2a')][_0xdaa0('0xe')][_0xdaa0('0x2b')],'phone':_0x1c9a74[_0xdaa0('0x2a')][_0xdaa0('0x32')][_0xdaa0('0x2b')]});}}else{logger[_0xdaa0('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xdaa0('0x34'),'input_type':_0xdaa0('0x1b'),'response_type':_0xdaa0('0x1b'),'rest_data':JSON[_0xdaa0('0x1c')]({'session':_0x384d1a['id'],'module_name':'Contacts','name_value_list':[{'name':_0xdaa0('0x35'),'value':_0x3beb9e!==_0xdaa0('0x36')?_0x3beb9e:util['format'](_0xdaa0('0x37'),_0x10597a)},{'name':'phone_home','value':_0x10597a}]})}})[_0xdaa0('0x27')](function(_0xa16486){logger[_0xdaa0('0xd')]('Enduser\x20created.');return BPromise[_0xdaa0('0x2d')]({'id':_0xa16486['id'],'name':_0xa16486[_0xdaa0('0x28')][_0xdaa0('0x35')]['value'],'phone':_0xa16486['entry_list'][_0xdaa0('0x32')]['value']});});}});}function request(_0x4e0eec){logger[_0xdaa0('0x38')](_0xdaa0('0x39'),JSON[_0xdaa0('0x1c')](_0x4e0eec));return rp(_['merge'](def,_0x4e0eec));}function getTags(_0x346696,_0x5e3af8){var _0x763d6b=[];if(_0x346696&&_0x346696[_0xdaa0('0x29')]>0x0){_0x763d6b=_['map'](_0x346696,_0x5e3af8);}return _0x763d6b;}function getCustomFields(_0x379ad9,_0x6865b){var _0x513f57=[];var _0x3d0888={'custom_fields':[]};if(_0x379ad9[_0xdaa0('0x29')]>0x0){_[_0xdaa0('0x3a')](_0x379ad9,function(_0x202891){if(_0x202891[_0xdaa0('0x3b')]==='string'&&_0x202891[_0xdaa0('0x3c')]&&!_0x202891[_0xdaa0('0x3d')]){_0x3d0888[_0x202891[_0xdaa0('0x3c')][_0xdaa0('0x3e')]()]=_0x202891[_0xdaa0('0x3f')]['toString']();}else if(_0x202891[_0xdaa0('0x3b')]===_0xdaa0('0x40')&&_0x202891[_0xdaa0('0x1a')]&&_0x202891[_0xdaa0('0x3d')]){_0x3d0888[_0xdaa0('0x41')]['push']({'id':_0x202891['idField'],'value':_0x202891[_0xdaa0('0x3f')][_0xdaa0('0x1f')]()});}else if(_0x202891[_0xdaa0('0x3b')]===_0xdaa0('0x42')&&_0x202891[_0xdaa0('0x18')]&&_0x202891[_0xdaa0('0x1a')]&&_0x202891[_0xdaa0('0x3d')]){_0x6865b[_0x202891[_0xdaa0('0x18')]]&&_0x3d0888[_0xdaa0('0x41')][_0xdaa0('0x19')]({'id':_0x202891[_0xdaa0('0x1a')],'value':_0x6865b[_0x202891[_0xdaa0('0x18')]][_0xdaa0('0x1f')]()});}else if(_0x202891[_0xdaa0('0x3b')]==='customVariable'&&_0x202891[_0xdaa0('0x43')]&&_0x202891[_0xdaa0('0x43')][_0xdaa0('0xe')]&&_0x202891[_0xdaa0('0x1a')]&&_0x202891[_0xdaa0('0x3d')]){_0x6865b[_0x202891['Variable'][_0xdaa0('0xe')]['toLowerCase']()]&&_0x3d0888[_0xdaa0('0x41')][_0xdaa0('0x19')]({'id':_0x202891[_0xdaa0('0x1a')],'value':_0x6865b[_0x202891['Variable']['name'][_0xdaa0('0x3e')]()][_0xdaa0('0x1f')]()});}});}return _0x3d0888;}function getConnection(_0x313e13){return request({'method':_0xdaa0('0xb'),'form':{'method':_0xdaa0('0x44'),'input_type':_0xdaa0('0x1b'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x313e13['username'],'password':_0x313e13[_0xdaa0('0x45')],'encryption':'PLAIN'},'application':_0xdaa0('0x46')})}})[_0xdaa0('0x27')](function(_0x7e322f){var _0x2e2ff8=_0x7e322f;if(_0x2e2ff8['id']){def[_0xdaa0('0x47')]=_0x2e2ff8['id'];return BPromise[_0xdaa0('0x2d')](_0x2e2ff8);}else{throw new Error(util[_0xdaa0('0x1d')](_0xdaa0('0x48'),_0x313e13['id']));}});}function setRelationship(_0x3f2a41,_0x4bd933,_0x52969d,_0x2b6c0b){return request({'form':{'method':_0xdaa0('0x49'),'input_type':_0xdaa0('0x1b'),'response_type':_0xdaa0('0x1b'),'rest_data':JSON[_0xdaa0('0x1c')]({'session':_0x3f2a41['id'],'module_name':'Calls','module_id':_0x52969d['id'],'link_field_name':_0x2b6c0b,'related_ids':[_0x4bd933['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xdaa0('0x4a')]=function(_0x2a818e,_0x264a6d,_0x9e6533,_0x3f92d0,_0x4c0bd9,_0x27bb68){var _0x23663b,_0x2d14ca,_0x2d2142,_0x58bb62;_0x27bb68[_0xdaa0('0x4b')]=intUtil['stripTrailingSlash'](_0x27bb68[_0xdaa0('0x4b')]);_0x27bb68['serverUrl']=intUtil['stripTrailingSlash'](_0x27bb68[_0xdaa0('0x4c')]);def[_0xdaa0('0x4d')]=util['format'](_0xdaa0('0x4e'),_0x27bb68[_0xdaa0('0x4b')]);if(_0x4c0bd9&&_0x4c0bd9['monitor_format']){logger['info'](_0xdaa0('0x4f'),_0xdaa0('0x50'));_0x264a6d[_0xdaa0('0x51')]=util[_0xdaa0('0x1d')](_0xdaa0('0x52'),_0x27bb68[_0xdaa0('0x4c')],_0x264a6d[_0xdaa0('0x53')],md5(_0x264a6d[_0xdaa0('0x53')]));}else{_0x264a6d[_0xdaa0('0x51')]='';}return getConnection(_0x27bb68)['then'](function(_0x251480){_0x58bb62=_0x251480;return getUser(_0x27bb68,_0x3f92d0['name'],_0x58bb62);})['then'](function(_0x4d4bda){_0x23663b=_0x4d4bda;logger[_0xdaa0('0xd')](_0xdaa0('0x54'),_0x23663b['id']);return getEndUser(_0x27bb68,_0x264a6d['calleridname'],_0x264a6d['calleridnum'],_0x58bb62);})['then'](function(_0x3c54cf){_0x2d14ca=_0x3c54cf;logger['info'](_0xdaa0('0x55'),_0x2d14ca['id']);return getTicket(_0x27bb68,_0x23663b,_0x2d14ca,_0x9e6533,_0x264a6d,_0x9e6533[_0xdaa0('0x56')],_0x58bb62,_0xdaa0('0x57'));})[_0xdaa0('0x27')](function(_0x425062){_0x2d2142=_0x425062;logger[_0xdaa0('0xd')](_0xdaa0('0x58'));logger[_0xdaa0('0xd')](_0xdaa0('0x59'),_0x2d2142['id']);return setRelationship(_0x58bb62,_0x23663b,_0x2d2142,_0xdaa0('0x5a'));})[_0xdaa0('0x27')](function(){return setRelationship(_0x58bb62,_0x2d14ca,_0x2d2142,_0xdaa0('0x5b'));})['then'](function(){return getServerInfo(_0x58bb62);})['then'](function(_0x1dd833){var _0x36f253=parseInt(_0x1dd833['version']['charAt'](0x0));var _0x58fe9d=util[_0xdaa0('0x1d')](_0xdaa0('0x5c'),_0x27bb68[_0xdaa0('0x4b')],_0x2d2142['id']);if(_0x36f253>0x6){_0x58fe9d=util['format'](_0xdaa0('0x5d'),_0x27bb68[_0xdaa0('0x4b')],_0x2d2142['id']);}logger[_0xdaa0('0xd')](_0xdaa0('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdaa0('0x1d')]('user:%s',_0x3f92d0[_0xdaa0('0xe')]),_0xdaa0('0x5e'),{'uri':_0x58fe9d});})[_0xdaa0('0x5f')](function(_0x239b45){logger[_0xdaa0('0x60')]('[QUEUE]',JSON[_0xdaa0('0x1c')](_0x239b45));});};exports['outbound']=function(_0x24485b,_0x3f317b,_0x58a9de,_0x263241,_0x1a3466,_0x2e4d14,_0x521a93){var _0x56c319,_0x2d0340,_0x11e090,_0x25678d;_0x2e4d14[_0xdaa0('0x4b')]=intUtil[_0xdaa0('0x61')](_0x2e4d14[_0xdaa0('0x4b')]);_0x2e4d14['serverUrl']=intUtil[_0xdaa0('0x61')](_0x2e4d14[_0xdaa0('0x4c')]);def[_0xdaa0('0x4d')]=util[_0xdaa0('0x1d')](_0xdaa0('0x4e'),_0x2e4d14[_0xdaa0('0x4b')]);if(_0x521a93&&_0x521a93[_0xdaa0('0x62')]&&_0x521a93['recordingFormat']!=='none'){logger[_0xdaa0('0xd')](_0xdaa0('0x63'),_0xdaa0('0x50'));_0x3f317b[_0xdaa0('0x51')]=util[_0xdaa0('0x1d')](_0xdaa0('0x52'),_0x2e4d14[_0xdaa0('0x4c')],_0x3f317b['uniqueid'],md5(_0x3f317b[_0xdaa0('0x53')]));}return getConnection(_0x2e4d14)[_0xdaa0('0x27')](function(_0x125577){_0x25678d=_0x125577;return getUser(_0x2e4d14,_0x263241[_0xdaa0('0xe')],_0x25678d);})[_0xdaa0('0x27')](function(_0x2ffc7e){_0x56c319=_0x2ffc7e;logger['info'](_0xdaa0('0x54'),_0x56c319['id']);return getEndUser(_0x2e4d14,_0x3f317b['destcalleridname'],_0x3f317b['destcalleridnum'],_0x25678d);})[_0xdaa0('0x27')](function(_0x125a10){_0x2d0340=_0x125a10;logger[_0xdaa0('0xd')]('The\x20Enduser\x20ID\x20is:',_0x2d0340['id']);return getTicket(_0x2e4d14,_0x56c319,_0x2d0340,_0x58a9de,_0x3f317b,_0x58a9de['Fields'],_0x25678d,_0xdaa0('0x64'));})['then'](function(_0x5d0844){_0x11e090=_0x5d0844;logger[_0xdaa0('0xd')](_0xdaa0('0x58'));logger[_0xdaa0('0xd')](_0xdaa0('0x59'),_0x11e090['id']);return setRelationship(_0x25678d,_0x56c319,_0x11e090,_0xdaa0('0x5a'));})[_0xdaa0('0x27')](function(){return setRelationship(_0x25678d,_0x2d0340,_0x11e090,_0xdaa0('0x5b'));})[_0xdaa0('0x27')](function(){return getServerInfo(_0x25678d);})[_0xdaa0('0x27')](function(_0x21770f){var _0x4475a0=parseInt(_0x21770f[_0xdaa0('0x65')][_0xdaa0('0x66')](0x0));var _0x3e4a57=util[_0xdaa0('0x1d')](_0xdaa0('0x5c'),_0x2e4d14[_0xdaa0('0x4b')],_0x11e090['id']);if(_0x4475a0>0x6){_0x3e4a57=util[_0xdaa0('0x1d')](_0xdaa0('0x5d'),_0x2e4d14['remoteUri'],_0x11e090['id']);}logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdaa0('0x1d')](_0xdaa0('0x67'),_0x263241[_0xdaa0('0xe')]),'trigger:browser:url',{'uri':_0x3e4a57});})['catch'](function(_0x145a10){logger[_0xdaa0('0x60')](_0xdaa0('0x63'),JSON[_0xdaa0('0x1c')](_0x145a10));});};exports[_0xdaa0('0x68')]=function(_0x1ec041,_0x1e4f98,_0x142ceb,_0x5aba3d,_0xf23e48,_0x1aba78){var _0x14b56f,_0x441b08,_0xd7b386,_0x44540b;_0x1aba78[_0xdaa0('0x4b')]=intUtil['stripTrailingSlash'](_0x1aba78[_0xdaa0('0x4b')]);_0x1aba78[_0xdaa0('0x4c')]=intUtil[_0xdaa0('0x61')](_0x1aba78['serverUrl']);def[_0xdaa0('0x4d')]=util[_0xdaa0('0x1d')](_0xdaa0('0x4e'),_0x1aba78[_0xdaa0('0x4b')]);if(_0xf23e48&&_0xf23e48[_0xdaa0('0x69')]){logger[_0xdaa0('0xd')]('['+_0x1e4f98[_0xdaa0('0x6a')][_0xdaa0('0x6b')]()+']',_0xdaa0('0x50'));_0x1e4f98[_0xdaa0('0x51')]=util[_0xdaa0('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1aba78[_0xdaa0('0x4c')],_0x1e4f98[_0xdaa0('0x53')],md5(_0x1e4f98[_0xdaa0('0x53')]));}else{_0x1e4f98['recordingURL']='';}return getConnection(_0x1aba78)[_0xdaa0('0x27')](function(_0x118557){_0x44540b=_0x118557;if(!_[_0xdaa0('0x22')](_0x5aba3d)){return getUser(_0x1aba78,_0x5aba3d['name'],_0x44540b);}else{return getUser(_0x1aba78,null,_0x44540b);}})[_0xdaa0('0x27')](function(_0x27c32d){_0x14b56f=_0x27c32d;logger[_0xdaa0('0xd')](_0xdaa0('0x54'),_0x14b56f['id']);return getEndUser(_0x1aba78,_0x1e4f98[_0xdaa0('0x6c')],_0x1e4f98[_0xdaa0('0x6d')],_0x44540b);})['then'](function(_0x597f29){_0x441b08=_0x597f29;logger[_0xdaa0('0xd')](_0xdaa0('0x55'),_0x441b08['id']);return getTicket(_0x1aba78,_0x14b56f,_0x441b08,_0x142ceb,_0x1e4f98,_0x142ceb[_0xdaa0('0x56')],_0x44540b,_0xdaa0('0x57'));})['then'](function(_0x381bfa){_0xd7b386=_0x381bfa;logger[_0xdaa0('0xd')]('Ticket\x20created!');logger[_0xdaa0('0xd')](_0xdaa0('0x59'),_0xd7b386['id']);return setRelationship(_0x44540b,_0x14b56f,_0xd7b386,_0xdaa0('0x5a'));})[_0xdaa0('0x27')](function(){return setRelationship(_0x44540b,_0x441b08,_0xd7b386,_0xdaa0('0x5b'));})['then'](function(){return getServerInfo(_0x44540b);})[_0xdaa0('0x5f')](function(_0x4c62e0){logger[_0xdaa0('0x60')]('['+_0x1e4f98[_0xdaa0('0x6a')][_0xdaa0('0x6b')]()+']',JSON[_0xdaa0('0x1c')](_0x4c62e0));});}; \ No newline at end of file +var _0xbf25=['Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','phone_home','entry_list','find','Enduser\x20found!','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','error','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','unmanaged','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','catch','lastevent','lodash','request-promise','bluebird','util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','toISOString','replace','duration_hours','duration_minutes','parent_type','Contacts','parent_name','length','variableName','push','idField','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','user_name','then','name_value_list','Agent\x20found!','value'];(function(_0x4c3c8b,_0x4c4917){var _0x4a154e=function(_0x3dba08){while(--_0x3dba08){_0x4c3c8b['push'](_0x4c3c8b['shift']());}};_0x4a154e(++_0x4c4917);}(_0xbf25,0x12d));var _0x5bf2=function(_0x4d527e,_0x134704){_0x4d527e=_0x4d527e-0x0;var _0x14c2ad=_0xbf25[_0x4d527e];return _0x14c2ad;};'use strict';var _=require(_0x5bf2('0x0'));var rp=require(_0x5bf2('0x1'));var BPromise=require(_0x5bf2('0x2'));var md5=require('md5');var util=require(_0x5bf2('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x5bf2('0x4'));var logger=require(_0x5bf2('0x5'))('sugarcrm');config['redis']=_[_0x5bf2('0x6')](config[_0x5bf2('0x7')],{'host':_0x5bf2('0x8'),'port':0x18eb});var io=require(_0x5bf2('0x9'))(new Redis(config[_0x5bf2('0x7')]));var def={'method':_0x5bf2('0xa'),'json':!![]};function emit(_0x2affa9,_0x591eed,_0x5f307d){io['to'](_0x2affa9)['emit'](_0x591eed,_0x5f307d);}function getTicket(_0x350011,_0x23bbf8,_0x245f6f,_0x12b8e6,_0x386ad6,_0x1d0414,_0xe1081,_0x31f031){logger[_0x5bf2('0xb')](_0x5bf2('0xc'));var _0x4374fc=new Date();var _0x22fad8=[{'name':_0x5bf2('0xd'),'value':intUtil[_0x5bf2('0xe')](_0x12b8e6[_0x5bf2('0xf')],_0x386ad6,'\x20')},{'name':_0x5bf2('0x10'),'value':_0x23bbf8['id']},{'name':_0x5bf2('0x11'),'value':_0x23bbf8['id']},{'name':'description','value':intUtil[_0x5bf2('0xe')](_0x12b8e6[_0x5bf2('0x12')],_0x386ad6,'\x0a')},{'name':'date_start','value':_0x4374fc[_0x5bf2('0x13')]()['slice'](0x0,0x13)[_0x5bf2('0x14')]('T','\x20')},{'name':_0x5bf2('0x15'),'value':'0'},{'name':_0x5bf2('0x16'),'value':'15'},{'name':'parent_id','value':_0x245f6f['id']},{'name':_0x5bf2('0x17'),'value':_0x5bf2('0x18')},{'name':_0x5bf2('0x19'),'value':_0x245f6f[_0x5bf2('0xd')]},{'name':'direction','value':_0x31f031}];if(_0x1d0414[_0x5bf2('0x1a')]){_['forEach'](_0x1d0414,function(_0x3e436b){if(_0x386ad6[_0x3e436b[_0x5bf2('0x1b')]]){_0x22fad8[_0x5bf2('0x1c')]({'name':_0x3e436b[_0x5bf2('0x1d')],'value':_0x386ad6[_0x3e436b['variableName']]});}});}return request({'form':{'method':_0x5bf2('0x1e'),'input_type':'JSON','response_type':_0x5bf2('0x1f'),'rest_data':JSON[_0x5bf2('0x20')]({'session':_0xe1081['id'],'module_name':_0x5bf2('0x21'),'name_value_list':_0x22fad8})}});}function getAuth(_0x4898f7){return util[_0x5bf2('0x22')]('Basic\x20%s',new Buffer(_0x4898f7[_0x5bf2('0x23')]+':X')[_0x5bf2('0x24')](_0x5bf2('0x25')));}function getServerInfo(_0x85a105){return request({'form':{'method':_0x5bf2('0x26'),'input_type':'JSON','response_type':_0x5bf2('0x1f'),'rest_data':JSON[_0x5bf2('0x20')]({'session':_0x85a105['id']})}});}function getUser(_0x1bca22,_0x5b6d03,_0x11ca0b){if(!_[_0x5bf2('0x27')](_0x5b6d03)){logger['info'](_0x5bf2('0x28'),_0x5b6d03);return request({'form':{'method':_0x5bf2('0x29'),'input_type':_0x5bf2('0x1f'),'response_type':'JSON','rest_data':JSON[_0x5bf2('0x20')]({'session':_0x11ca0b['id'],'module_name':'Employees','query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x5b6d03),'order_by':'','offset':'0','select_fields':['id',_0x5bf2('0xd'),_0x5bf2('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5bf2('0x2b')](function(_0x35e32e){if(_0x35e32e['entry_list'][_0x5bf2('0x1a')]){var _0x463ccf=_['find'](_0x35e32e['entry_list'],function(_0xdae8ee){return _0xdae8ee[_0x5bf2('0x2c')][_0x5bf2('0x2a')]['value']===_0x5b6d03;});if(_0x463ccf){logger['info'](_0x5bf2('0x2d'));return BPromise['resolve']({'id':_0x463ccf[_0x5bf2('0x2c')]['id'][_0x5bf2('0x2e')],'name':_0x463ccf[_0x5bf2('0x2c')][_0x5bf2('0xd')]['value']});}}logger[_0x5bf2('0xb')](_0x5bf2('0x2f'));return BPromise[_0x5bf2('0x30')]({'id':_0x11ca0b[_0x5bf2('0x2c')][_0x5bf2('0x31')]['value'],'name':_0x11ca0b[_0x5bf2('0x2c')][_0x5bf2('0x2a')][_0x5bf2('0x2e')]});});}else{logger[_0x5bf2('0xb')](_0x5bf2('0x32'));return BPromise[_0x5bf2('0x30')]({'id':_0x11ca0b[_0x5bf2('0x2c')]['user_id'][_0x5bf2('0x2e')],'name':_0x11ca0b[_0x5bf2('0x2c')][_0x5bf2('0x2a')]['value']});}}function getEndUser(_0x4d981c,_0x108c7c,_0x13db96,_0x3c8e20){logger[_0x5bf2('0xb')](_0x5bf2('0x33'),_0x13db96);return request({'form':{'method':'get_entry_list','input_type':_0x5bf2('0x1f'),'response_type':_0x5bf2('0x1f'),'rest_data':JSON[_0x5bf2('0x20')]({'session':_0x3c8e20['id'],'module_name':_0x5bf2('0x18'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x13db96),'order_by':'','offset':'0','select_fields':['id',_0x5bf2('0xd'),_0x5bf2('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5bf2('0x2b')](function(_0x58a058){if(_0x58a058[_0x5bf2('0x35')][_0x5bf2('0x1a')]){var _0x180f74=_[_0x5bf2('0x36')](_0x58a058[_0x5bf2('0x35')],function(_0x42ac48){return _0x42ac48[_0x5bf2('0x2c')][_0x5bf2('0x34')][_0x5bf2('0x2e')]===_0x13db96;});if(_0x180f74){logger[_0x5bf2('0xb')](_0x5bf2('0x37'));return BPromise[_0x5bf2('0x30')]({'id':_0x180f74['name_value_list']['id']['value'],'name':_0x180f74[_0x5bf2('0x2c')][_0x5bf2('0xd')][_0x5bf2('0x2e')],'phone':_0x180f74[_0x5bf2('0x2c')]['phone_home']['value']});}}else{logger[_0x5bf2('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':_0x5bf2('0x1f'),'response_type':_0x5bf2('0x1f'),'rest_data':JSON['stringify']({'session':_0x3c8e20['id'],'module_name':_0x5bf2('0x18'),'name_value_list':[{'name':'first_name','value':_0x108c7c!==''?_0x108c7c:util['format'](_0x5bf2('0x38'),_0x13db96)},{'name':_0x5bf2('0x34'),'value':_0x13db96}]})}})[_0x5bf2('0x2b')](function(_0x1a247c){logger[_0x5bf2('0xb')](_0x5bf2('0x39'));return BPromise[_0x5bf2('0x30')]({'id':_0x1a247c['id'],'name':_0x1a247c[_0x5bf2('0x35')][_0x5bf2('0x3a')][_0x5bf2('0x2e')],'phone':_0x1a247c['entry_list'][_0x5bf2('0x34')][_0x5bf2('0x2e')]});});}});}function request(_0x5a7d90){logger[_0x5bf2('0x3b')](_0x5bf2('0x3c'),JSON['stringify'](_0x5a7d90));return rp(_[_0x5bf2('0x3d')](def,_0x5a7d90));}function getTags(_0x211385,_0x489908){var _0x56823b=[];if(_0x211385&&_0x211385['length']>0x0){_0x56823b=_[_0x5bf2('0x3e')](_0x211385,_0x489908);}return _0x56823b;}function getCustomFields(_0x3ca5dc,_0x3cd6f7){var _0x576211=[];var _0x2d242d={'custom_fields':[]};if(_0x3ca5dc[_0x5bf2('0x1a')]>0x0){_[_0x5bf2('0x3f')](_0x3ca5dc,function(_0x400f79){if(_0x400f79[_0x5bf2('0x40')]===_0x5bf2('0x41')&&_0x400f79[_0x5bf2('0x42')]&&!_0x400f79[_0x5bf2('0x43')]){_0x2d242d[_0x400f79[_0x5bf2('0x42')][_0x5bf2('0x44')]()]=_0x400f79[_0x5bf2('0x45')][_0x5bf2('0x24')]();}else if(_0x400f79[_0x5bf2('0x40')]==='string'&&_0x400f79[_0x5bf2('0x1d')]&&_0x400f79[_0x5bf2('0x43')]){_0x2d242d[_0x5bf2('0x46')][_0x5bf2('0x1c')]({'id':_0x400f79[_0x5bf2('0x1d')],'value':_0x400f79[_0x5bf2('0x45')][_0x5bf2('0x24')]()});}else if(_0x400f79[_0x5bf2('0x40')]===_0x5bf2('0x47')&&_0x400f79[_0x5bf2('0x1b')]&&_0x400f79['idField']&&_0x400f79[_0x5bf2('0x43')]){_0x3cd6f7[_0x400f79['variableName']]&&_0x2d242d['custom_fields'][_0x5bf2('0x1c')]({'id':_0x400f79[_0x5bf2('0x1d')],'value':_0x3cd6f7[_0x400f79[_0x5bf2('0x1b')]][_0x5bf2('0x24')]()});}else if(_0x400f79['type']===_0x5bf2('0x48')&&_0x400f79[_0x5bf2('0x49')]&&_0x400f79[_0x5bf2('0x49')]['name']&&_0x400f79[_0x5bf2('0x1d')]&&_0x400f79[_0x5bf2('0x43')]){_0x3cd6f7[_0x400f79['Variable'][_0x5bf2('0xd')]['toLowerCase']()]&&_0x2d242d['custom_fields'][_0x5bf2('0x1c')]({'id':_0x400f79[_0x5bf2('0x1d')],'value':_0x3cd6f7[_0x400f79[_0x5bf2('0x49')][_0x5bf2('0xd')]['toLowerCase']()][_0x5bf2('0x24')]()});}});}return _0x2d242d;}function getConnection(_0x11269b){return request({'method':_0x5bf2('0xa'),'form':{'method':_0x5bf2('0x4a'),'input_type':_0x5bf2('0x1f'),'response_type':_0x5bf2('0x1f'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x11269b['username'],'password':_0x11269b[_0x5bf2('0x4b')],'encryption':_0x5bf2('0x4c')},'application':_0x5bf2('0x4d')})}})[_0x5bf2('0x2b')](function(_0x12fdfe){var _0x2d1bcc=_0x12fdfe;if(_0x2d1bcc['id']){def[_0x5bf2('0x4e')]=_0x2d1bcc['id'];return BPromise[_0x5bf2('0x30')](_0x2d1bcc);}else{throw new Error(util[_0x5bf2('0x22')](_0x5bf2('0x4f'),_0x11269b['id']));}});}function setRelationship(_0x1c2904,_0x11f1d1,_0x1bb044,_0x464905){return request({'form':{'method':'set_relationship','input_type':_0x5bf2('0x1f'),'response_type':'JSON','rest_data':JSON[_0x5bf2('0x20')]({'session':_0x1c2904['id'],'module_name':'Calls','module_id':_0x1bb044['id'],'link_field_name':_0x464905,'related_ids':[_0x11f1d1['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x5bf2('0x50')]=function(_0x328c60,_0x2ca745,_0x4f0bd6,_0x6f402b,_0x291a31,_0x3b17a7){var _0x41142b,_0x1a0ddc,_0x11571a,_0xee1618;_0x3b17a7[_0x5bf2('0x51')]=intUtil['stripTrailingSlash'](_0x3b17a7[_0x5bf2('0x51')]);_0x3b17a7['serverUrl']=intUtil[_0x5bf2('0x52')](_0x3b17a7[_0x5bf2('0x53')]);def[_0x5bf2('0x54')]=util[_0x5bf2('0x22')]('%s/service/v4_1/rest.php',_0x3b17a7['remoteUri']);if(_0x291a31&&_0x291a31['monitor_format']){logger[_0x5bf2('0xb')](_0x5bf2('0x55'),_0x5bf2('0x56'));_0x2ca745[_0x5bf2('0x57')]=util[_0x5bf2('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3b17a7['serverUrl'],_0x2ca745['uniqueid'],md5(_0x2ca745[_0x5bf2('0x58')]));}else{_0x2ca745['recordingURL']='';}return getConnection(_0x3b17a7)[_0x5bf2('0x2b')](function(_0x19ba2c){_0xee1618=_0x19ba2c;return getUser(_0x3b17a7,_0x6f402b['name'],_0xee1618);})[_0x5bf2('0x2b')](function(_0x12de22){_0x41142b=_0x12de22;logger[_0x5bf2('0xb')](_0x5bf2('0x59'),_0x41142b['id']);return getEndUser(_0x3b17a7,_0x2ca745[_0x5bf2('0x5a')],_0x2ca745[_0x5bf2('0x5b')],_0xee1618);})[_0x5bf2('0x2b')](function(_0xbc583c){_0x1a0ddc=_0xbc583c;logger[_0x5bf2('0xb')](_0x5bf2('0x5c'),_0x1a0ddc['id']);return getTicket(_0x3b17a7,_0x41142b,_0x1a0ddc,_0x4f0bd6,_0x2ca745,_0x4f0bd6[_0x5bf2('0x5d')],_0xee1618,_0x5bf2('0x5e'));})[_0x5bf2('0x2b')](function(_0x158800){_0x11571a=_0x158800;logger[_0x5bf2('0xb')](_0x5bf2('0x5f'));logger[_0x5bf2('0xb')](_0x5bf2('0x60'),_0x11571a['id']);return setRelationship(_0xee1618,_0x41142b,_0x11571a,'users');})[_0x5bf2('0x2b')](function(){return setRelationship(_0xee1618,_0x1a0ddc,_0x11571a,_0x5bf2('0x61'));})[_0x5bf2('0x2b')](function(){return getServerInfo(_0xee1618);})[_0x5bf2('0x2b')](function(_0x28d38b){var _0x645fbd=parseInt(_0x28d38b['version']['charAt'](0x0));var _0x25a521=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3b17a7['remoteUri'],_0x11571a['id']);if(_0x645fbd>0x6){_0x25a521=util['format'](_0x5bf2('0x62'),_0x3b17a7['remoteUri'],_0x11571a['id']);}logger[_0x5bf2('0xb')](_0x5bf2('0x55'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5bf2('0x22')]('user:%s',_0x6f402b[_0x5bf2('0xd')]),_0x5bf2('0x63'),{'uri':_0x25a521});})['catch'](function(_0x678113){logger[_0x5bf2('0x64')](_0x5bf2('0x55'),JSON[_0x5bf2('0x20')](_0x678113));});};exports['outbound']=function(_0x407838,_0x17067a,_0x349933,_0x23a638,_0x21022e,_0x35b17c,_0x2db921){var _0xc2826c,_0x1ee352,_0x4d1696,_0x1b6b82;_0x35b17c[_0x5bf2('0x51')]=intUtil['stripTrailingSlash'](_0x35b17c[_0x5bf2('0x51')]);_0x35b17c[_0x5bf2('0x53')]=intUtil[_0x5bf2('0x52')](_0x35b17c[_0x5bf2('0x53')]);def[_0x5bf2('0x54')]=util[_0x5bf2('0x22')](_0x5bf2('0x65'),_0x35b17c[_0x5bf2('0x51')]);if(_0x2db921&&_0x2db921['recordingFormat']&&_0x2db921[_0x5bf2('0x66')]!==_0x5bf2('0x67')){logger[_0x5bf2('0xb')](_0x5bf2('0x68'),'Recording\x20is\x20enabled!');_0x17067a['recordingURL']=util[_0x5bf2('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35b17c[_0x5bf2('0x53')],_0x17067a[_0x5bf2('0x58')],md5(_0x17067a[_0x5bf2('0x58')]));}return getConnection(_0x35b17c)['then'](function(_0x36af7e){_0x1b6b82=_0x36af7e;return getUser(_0x35b17c,_0x23a638[_0x5bf2('0xd')],_0x1b6b82);})['then'](function(_0x10225a){_0xc2826c=_0x10225a;logger[_0x5bf2('0xb')](_0x5bf2('0x59'),_0xc2826c['id']);return getEndUser(_0x35b17c,_0x17067a[_0x5bf2('0x69')],_0x17067a[_0x5bf2('0x6a')],_0x1b6b82);})[_0x5bf2('0x2b')](function(_0x3bc410){_0x1ee352=_0x3bc410;logger[_0x5bf2('0xb')](_0x5bf2('0x5c'),_0x1ee352['id']);return getTicket(_0x35b17c,_0xc2826c,_0x1ee352,_0x349933,_0x17067a,_0x349933[_0x5bf2('0x5d')],_0x1b6b82,'Outbound');})[_0x5bf2('0x2b')](function(_0x4e40f3){_0x4d1696=_0x4e40f3;logger[_0x5bf2('0xb')](_0x5bf2('0x5f'));logger[_0x5bf2('0xb')](_0x5bf2('0x60'),_0x4d1696['id']);return setRelationship(_0x1b6b82,_0xc2826c,_0x4d1696,_0x5bf2('0x6b'));})['then'](function(){return setRelationship(_0x1b6b82,_0x1ee352,_0x4d1696,_0x5bf2('0x61'));})[_0x5bf2('0x2b')](function(){return getServerInfo(_0x1b6b82);})['then'](function(_0x32d7b7){var _0x3132d2=parseInt(_0x32d7b7[_0x5bf2('0x6c')][_0x5bf2('0x6d')](0x0));var _0x4a4044=util['format'](_0x5bf2('0x6e'),_0x35b17c[_0x5bf2('0x51')],_0x4d1696['id']);if(_0x3132d2>0x6){_0x4a4044=util['format'](_0x5bf2('0x62'),_0x35b17c[_0x5bf2('0x51')],_0x4d1696['id']);}logger[_0x5bf2('0xb')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x23a638[_0x5bf2('0xd')]),_0x5bf2('0x63'),{'uri':_0x4a4044});})['catch'](function(_0x585093){logger[_0x5bf2('0x64')](_0x5bf2('0x68'),JSON[_0x5bf2('0x20')](_0x585093));});};exports[_0x5bf2('0x6f')]=function(_0x84f0a1,_0x133132,_0x3bbcc3,_0x338f72,_0x85e305,_0xcfb08d){var _0x370ae5,_0x5c2f27,_0x482eec,_0x585e6e;_0xcfb08d[_0x5bf2('0x51')]=intUtil[_0x5bf2('0x52')](_0xcfb08d[_0x5bf2('0x51')]);_0xcfb08d[_0x5bf2('0x53')]=intUtil[_0x5bf2('0x52')](_0xcfb08d[_0x5bf2('0x53')]);def[_0x5bf2('0x54')]=util[_0x5bf2('0x22')](_0x5bf2('0x65'),_0xcfb08d[_0x5bf2('0x51')]);if(_0x85e305&&_0x85e305['monitor_format']){logger['info']('['+_0x133132['lastevent'][_0x5bf2('0x70')]()+']',_0x5bf2('0x56'));_0x133132['recordingURL']=util[_0x5bf2('0x22')](_0x5bf2('0x71'),_0xcfb08d[_0x5bf2('0x53')],_0x133132[_0x5bf2('0x58')],md5(_0x133132[_0x5bf2('0x58')]));}else{_0x133132[_0x5bf2('0x57')]='';}return getConnection(_0xcfb08d)[_0x5bf2('0x2b')](function(_0x2fcd75){_0x585e6e=_0x2fcd75;if(!_[_0x5bf2('0x27')](_0x338f72)){return getUser(_0xcfb08d,_0x338f72['name'],_0x585e6e);}else{return getUser(_0xcfb08d,null,_0x585e6e);}})['then'](function(_0x13c4b4){_0x370ae5=_0x13c4b4;logger['info']('The\x20User\x20ID\x20is:',_0x370ae5['id']);return getEndUser(_0xcfb08d,_0x133132[_0x5bf2('0x5a')],_0x133132[_0x5bf2('0x5b')],_0x585e6e);})[_0x5bf2('0x2b')](function(_0x14db93){_0x5c2f27=_0x14db93;logger[_0x5bf2('0xb')](_0x5bf2('0x5c'),_0x5c2f27['id']);return getTicket(_0xcfb08d,_0x370ae5,_0x5c2f27,_0x3bbcc3,_0x133132,_0x3bbcc3[_0x5bf2('0x5d')],_0x585e6e,_0x5bf2('0x5e'));})[_0x5bf2('0x2b')](function(_0x3a85ce){_0x482eec=_0x3a85ce;logger[_0x5bf2('0xb')](_0x5bf2('0x5f'));logger[_0x5bf2('0xb')](_0x5bf2('0x60'),_0x482eec['id']);return setRelationship(_0x585e6e,_0x370ae5,_0x482eec,'users');})[_0x5bf2('0x2b')](function(){return setRelationship(_0x585e6e,_0x5c2f27,_0x482eec,_0x5bf2('0x61'));})[_0x5bf2('0x2b')](function(){return getServerInfo(_0x585e6e);})[_0x5bf2('0x72')](function(_0x4be48c){logger[_0x5bf2('0x64')]('['+_0x133132[_0x5bf2('0x73')][_0x5bf2('0x70')]()+']',JSON['stringify'](_0x4be48c));});}; \ 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 c9f6908..bd894e9 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 _0x23e0=['toLowerCase','keyValue','key','format','%s:\x20%s','keyContent','keyType','substring','lastIndexOf','validateEmail','isNil','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name'];(function(_0x148783,_0x1ac458){var _0x85329a=function(_0x52afd8){while(--_0x52afd8){_0x148783['push'](_0x148783['shift']());}};_0x85329a(++_0x1ac458);}(_0x23e0,0x173));var _0x023e=function(_0x472006,_0x1290fc){_0x472006=_0x472006-0x0;var _0x2bd6bd=_0x23e0[_0x472006];return _0x2bd6bd;};'use strict';var _=require('lodash');var util=require('util');exports[_0x023e('0x0')]=function(_0x3df659,_0x474eb2,_0x6f8bf){var _0x272d57=[];if(_0x3df659[_0x023e('0x1')]>0x0){var _0x4011cb=_[_0x023e('0x2')](_0x3df659,['id']);for(var _0x40fde8=0x0;_0x40fde8<_0x4011cb[_0x023e('0x1')];_0x40fde8++){var _0x5d0ec7=_0x4011cb[_0x40fde8];if(_0x5d0ec7[_0x023e('0x3')]===_0x023e('0x4')){_0x272d57[_0x023e('0x5')](_0x5d0ec7[_0x023e('0x6')]);}else if(_0x5d0ec7[_0x023e('0x3')]===_0x023e('0x7')&&_0x5d0ec7[_0x023e('0x8')]){_0x474eb2[_0x5d0ec7[_0x023e('0x8')]]&&_0x272d57[_0x023e('0x5')](_0x474eb2[_0x5d0ec7['variableName']][_0x023e('0x9')]());}else if(_0x5d0ec7[_0x023e('0x3')]===_0x023e('0xa')&&_0x5d0ec7['Variable']&&_0x5d0ec7[_0x023e('0xb')]['name']){_0x474eb2[_0x5d0ec7[_0x023e('0xb')][_0x023e('0xc')]['toLowerCase']()]&&_0x272d57[_0x023e('0x5')](_0x474eb2[_0x5d0ec7[_0x023e('0xb')][_0x023e('0xc')][_0x023e('0xd')]()][_0x023e('0x9')]());}else if(_0x5d0ec7[_0x023e('0x3')]===_0x023e('0xe')){if(_0x5d0ec7['keyType']===_0x023e('0x4')&&_0x5d0ec7[_0x023e('0xf')]){_0x272d57[_0x023e('0x5')](util[_0x023e('0x10')](_0x023e('0x11'),_0x5d0ec7[_0x023e('0xf')],_0x5d0ec7[_0x023e('0x12')]));}else if(_0x5d0ec7[_0x023e('0x13')]===_0x023e('0x7')&&_0x5d0ec7['variableName']&&_0x5d0ec7[_0x023e('0xf')]){_0x474eb2[_0x5d0ec7['variableName']]&&_0x272d57[_0x023e('0x5')](util['format'](_0x023e('0x11'),_0x5d0ec7[_0x023e('0xf')],_0x474eb2[_0x5d0ec7['variableName']]));}else if(_0x5d0ec7[_0x023e('0x13')]===_0x023e('0xa')&&_0x5d0ec7[_0x023e('0xb')]&&_0x5d0ec7[_0x023e('0xb')]['name']&&_0x5d0ec7[_0x023e('0xf')]){_0x474eb2[_0x5d0ec7[_0x023e('0xb')][_0x023e('0xc')][_0x023e('0xd')]()]&&_0x272d57[_0x023e('0x5')](util[_0x023e('0x10')](_0x023e('0x11'),_0x5d0ec7[_0x023e('0xf')],_0x474eb2[_0x5d0ec7[_0x023e('0xb')][_0x023e('0xc')]['toLowerCase']()]));}}}}return _0x272d57['join'](_0x6f8bf);};exports['stripTrailingSlash']=function(_0x1cf454){var _0x299b62=_0x1cf454['slice'](-0x1);if(_0x299b62==='/'){_0x1cf454=_0x1cf454[_0x023e('0x14')](0x0,_0x1cf454[_0x023e('0x15')](_0x299b62));}return _0x1cf454;};exports[_0x023e('0x16')]=function(_0x59a8ac){if(!_[_0x023e('0x17')](_0x59a8ac)&&_0x59a8ac!==''){var _0x46ad2f=/^(([^<>()\[\]\\.,;:\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 _0x46ad2f['test'](String(_0x59a8ac)[_0x023e('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x3b96=['stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','format'];(function(_0x1dd08c,_0x2ffe93){var _0x422d44=function(_0x12e5ba){while(--_0x12e5ba){_0x1dd08c['push'](_0x1dd08c['shift']());}};_0x422d44(++_0x2ffe93);}(_0x3b96,0xae));var _0x63b9=function(_0x101994,_0x27c160){_0x101994=_0x101994-0x0;var _0x370588=_0x3b96[_0x101994];return _0x370588;};'use strict';var _=require(_0x63b9('0x0'));var util=require(_0x63b9('0x1'));exports[_0x63b9('0x2')]=function(_0x5b7b30,_0x6877bc,_0x2056a1){var _0xd3ea2f=[];if(_0x5b7b30[_0x63b9('0x3')]>0x0){var _0x1ecd12=_[_0x63b9('0x4')](_0x5b7b30,['id']);for(var _0x2fd339=0x0;_0x2fd339<_0x1ecd12[_0x63b9('0x3')];_0x2fd339++){var _0x32971a=_0x1ecd12[_0x2fd339];if(_0x32971a[_0x63b9('0x5')]===_0x63b9('0x6')){_0xd3ea2f[_0x63b9('0x7')](_0x32971a[_0x63b9('0x8')]);}else if(_0x32971a['type']===_0x63b9('0x9')&&_0x32971a[_0x63b9('0xa')]){_0x6877bc[_0x32971a[_0x63b9('0xa')]]&&_0xd3ea2f['push'](_0x6877bc[_0x32971a[_0x63b9('0xa')]][_0x63b9('0xb')]());}else if(_0x32971a[_0x63b9('0x5')]===_0x63b9('0xc')&&_0x32971a[_0x63b9('0xd')]&&_0x32971a['Variable'][_0x63b9('0xe')]){_0x6877bc[_0x32971a[_0x63b9('0xd')][_0x63b9('0xe')]['toLowerCase']()]&&_0xd3ea2f[_0x63b9('0x7')](_0x6877bc[_0x32971a[_0x63b9('0xd')]['name'][_0x63b9('0xf')]()]['toString']());}else if(_0x32971a[_0x63b9('0x5')]===_0x63b9('0x10')){if(_0x32971a[_0x63b9('0x11')]===_0x63b9('0x6')&&_0x32971a[_0x63b9('0x12')]){_0xd3ea2f[_0x63b9('0x7')](util['format'](_0x63b9('0x13'),_0x32971a[_0x63b9('0x12')],_0x32971a[_0x63b9('0x14')]));}else if(_0x32971a[_0x63b9('0x11')]===_0x63b9('0x9')&&_0x32971a[_0x63b9('0xa')]&&_0x32971a[_0x63b9('0x12')]){_0x6877bc[_0x32971a['variableName']]&&_0xd3ea2f['push'](util[_0x63b9('0x15')](_0x63b9('0x13'),_0x32971a[_0x63b9('0x12')],_0x6877bc[_0x32971a[_0x63b9('0xa')]]));}else if(_0x32971a['keyType']===_0x63b9('0xc')&&_0x32971a[_0x63b9('0xd')]&&_0x32971a[_0x63b9('0xd')][_0x63b9('0xe')]&&_0x32971a[_0x63b9('0x12')]){_0x6877bc[_0x32971a['Variable']['name'][_0x63b9('0xf')]()]&&_0xd3ea2f[_0x63b9('0x7')](util[_0x63b9('0x15')](_0x63b9('0x13'),_0x32971a[_0x63b9('0x12')],_0x6877bc[_0x32971a['Variable'][_0x63b9('0xe')][_0x63b9('0xf')]()]));}}}}return _0xd3ea2f['join'](_0x2056a1);};exports[_0x63b9('0x16')]=function(_0x4cf749){var _0x187fce=_0x4cf749[_0x63b9('0x17')](-0x1);if(_0x187fce==='/'){_0x4cf749=_0x4cf749['substring'](0x0,_0x4cf749[_0x63b9('0x18')](_0x187fce));}return _0x4cf749;};exports[_0x63b9('0x19')]=function(_0x4f32c1){if(!_[_0x63b9('0x1a')](_0x4f32c1)&&_0x4f32c1!==''){var _0x1457e1=/^(([^<>()\[\]\\.,;:\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 _0x1457e1[_0x63b9('0x1b')](String(_0x4f32c1)[_0x63b9('0xf')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index b5e1ac7..5e7c1da 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x5c7864,_0xe31f2d){var _0x837491=function(_0x2030de){while(--_0x2030de){_0x5c7864['push'](_0x5c7864['shift']());}};_0x837491(++_0xe31f2d);}(_0x34e8,0x12c));var _0x834e=function(_0x5f2980,_0x2e167a){_0x5f2980=_0x5f2980-0x0;var _0xd04d23=_0x34e8[_0x5f2980];return _0xd04d23;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 7339cae..4bb0198 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 _0xcf35=['The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','toUpperCase','calleridname','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','./util','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','Basic\x20%s','toString','base64','debug','stringify','defaults','GET','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','integrationTab','newTab','%s/agent/tickets/%s','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','Authorization'];(function(_0x29450a,_0x488ebb){var _0xd98a6d=function(_0x4b6799){while(--_0x4b6799){_0x29450a['push'](_0x29450a['shift']());}};_0xd98a6d(++_0x488ebb);}(_0xcf35,0x1cc));var _0x5cf3=function(_0x23bb8e,_0x2395f5){_0x23bb8e=_0x23bb8e-0x0;var _0x3e5930=_0xcf35[_0x23bb8e];return _0x3e5930;};'use strict';var _=require('lodash');var rp=require(_0x5cf3('0x0'));var md5=require(_0x5cf3('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x5cf3('0x2'));var config=require('../../../../config/environment');var logger=require(_0x5cf3('0x3'))(_0x5cf3('0x4'));config[_0x5cf3('0x5')]=_['defaults'](config['redis'],{'host':_0x5cf3('0x6'),'port':0x18eb});var io=require(_0x5cf3('0x7'))(new Redis(config[_0x5cf3('0x5')]));function emit(_0x465007,_0x100791,_0xc496ab){io['to'](_0x465007)['emit'](_0x100791,_0xc496ab);}var headers={'Content-Type':_0x5cf3('0x8'),'Accept':_0x5cf3('0x8')};function getTicket(_0x4590b0,_0x331a29,_0x3ff353,_0x30d99a,_0x2a4622){logger[_0x5cf3('0x9')](_0x5cf3('0xa'));return request({'uri':util[_0x5cf3('0xb')](_0x5cf3('0xc'),_0x4590b0[_0x5cf3('0xd')]),'method':'POST','body':{'ticket':_[_0x5cf3('0xe')]({'requester_id':_0x3ff353['id'],'submitter_id':_0x331a29?_0x331a29['id']:undefined,'assignee_id':_0x331a29?_0x331a29['id']:undefined,'tags':getTags(_0x30d99a[_0x5cf3('0xf')],_0x5cf3('0x10')),'subject':intUtil[_0x5cf3('0x11')](_0x30d99a[_0x5cf3('0x12')],_0x2a4622,'\x20'),'description':intUtil[_0x5cf3('0x11')](_0x30d99a['Descriptions'],_0x2a4622,'\x0a'),'comment':{'public':![],'body':intUtil[_0x5cf3('0x11')](_0x30d99a[_0x5cf3('0x13')],_0x2a4622,'\x0a')}},getCustomFields(_0x30d99a[_0x5cf3('0x14')],_0x2a4622))}})[_0x5cf3('0x15')](function(_0x377103){logger[_0x5cf3('0x9')](_0x5cf3('0x16'));return _0x377103[_0x5cf3('0x17')];});}function getUser(_0x3dbb94,_0x366551){if(intUtil[_0x5cf3('0x18')](_0x366551)){logger[_0x5cf3('0x9')](_0x5cf3('0x19'),_0x366551);return request({'uri':util[_0x5cf3('0xb')](_0x5cf3('0x1a'),_0x3dbb94['remoteUri']),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x366551)}})[_0x5cf3('0x15')](function(_0xf171de){if(_0xf171de[_0x5cf3('0x1b')]){logger[_0x5cf3('0x9')]('Agent\x20found!');return _['find'](_0xf171de[_0x5cf3('0x1c')],{'email':_0x366551,'role':'agent'});}else{logger[_0x5cf3('0x9')](_0x5cf3('0x1d'));return request({'uri':util['format'](_0x5cf3('0x1e'),_0x3dbb94[_0x5cf3('0xd')])})[_0x5cf3('0x15')](function(_0x39e832){logger[_0x5cf3('0x9')](_0x5cf3('0x1f'));return _0x39e832['user'];});}});}else{logger[_0x5cf3('0x9')](_0x5cf3('0x1d'));return request({'uri':util['format'](_0x5cf3('0x1e'),_0x3dbb94['remoteUri'])})[_0x5cf3('0x15')](function(_0x167dc0){logger['info'](_0x5cf3('0x1f'));return _0x167dc0[_0x5cf3('0x20')];});}}function getEndUser(_0x4425fa,_0x4b51c3,_0x5493a5){logger[_0x5cf3('0x9')](_0x5cf3('0x21'),_0x5493a5);return request({'uri':util[_0x5cf3('0xb')]('%s/search.json',_0x4425fa[_0x5cf3('0xd')]),'qs':{'query':util[_0x5cf3('0xb')](_0x5cf3('0x22'),_0x5493a5)}})[_0x5cf3('0x15')](function(_0x5d1d2f){var _0x24a315;if(_0x5d1d2f[_0x5cf3('0x1c')][_0x5cf3('0x23')]){_0x5d1d2f[_0x5cf3('0x1c')]=_['filter'](_0x5d1d2f[_0x5cf3('0x1c')],{'suspended':![],'role':_0x5cf3('0x24')});if(_0x5d1d2f[_0x5cf3('0x1c')][_0x5cf3('0x23')]){_0x24a315=_[_0x5cf3('0x25')](_0x5d1d2f[_0x5cf3('0x1c')]);}}if(_0x24a315){logger[_0x5cf3('0x9')](_0x5cf3('0x26'));return _0x24a315;}else{logger[_0x5cf3('0x9')](_0x5cf3('0x27'));return request({'uri':util['format'](_0x5cf3('0x28'),_0x4425fa[_0x5cf3('0xd')]),'method':_0x5cf3('0x29'),'body':{'user':{'role':_0x5cf3('0x24'),'name':util[_0x5cf3('0xb')](_0x5cf3('0x2a'),_0x4b51c3||_0x5493a5),'phone':_0x5493a5}}})[_0x5cf3('0x15')](function(_0x210670){logger[_0x5cf3('0x9')](_0x5cf3('0x2b'));return _0x210670[_0x5cf3('0x20')];});}});}function getAuth(_0xce3d86){var _0x57ce28;if(_0xce3d86[_0x5cf3('0x2c')]===_0x5cf3('0x2d')){_0x57ce28=util[_0x5cf3('0xb')](_0x5cf3('0x2e'),_0xce3d86[_0x5cf3('0x2f')],_0xce3d86[_0x5cf3('0x2d')]);}else if(_0xce3d86[_0x5cf3('0x2c')]==='token'){_0x57ce28=util[_0x5cf3('0xb')]('%s/token:%s',_0xce3d86[_0x5cf3('0x2f')],_0xce3d86[_0x5cf3('0x30')]);}return util[_0x5cf3('0xb')](_0x5cf3('0x31'),new Buffer(_0x57ce28)[_0x5cf3('0x32')](_0x5cf3('0x33')));}function request(_0x418cfd){logger[_0x5cf3('0x34')]('[HTTP]',JSON[_0x5cf3('0x35')](_0x418cfd));return rp(_[_0x5cf3('0x36')](_0x418cfd,{'method':_0x5cf3('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x51a12d,_0x32a1ef){var _0xd7c39f=[];if(_0x51a12d&&_0x51a12d[_0x5cf3('0x23')]>0x0){_0xd7c39f=_[_0x5cf3('0x38')](_0x51a12d,_0x32a1ef);}return _0xd7c39f;}function getCustomFields(_0x370676,_0x230803){var _0x493b68=[];var _0x5f15fa={'custom_fields':[]};if(_0x370676[_0x5cf3('0x23')]>0x0){_[_0x5cf3('0x39')](_0x370676,function(_0x104803){if(_[_0x5cf3('0x3a')]([_0x5cf3('0x3b'),_0x5cf3('0x3c')],_0x104803[_0x5cf3('0x3d')])&&_0x104803[_0x5cf3('0x3e')]&&!_0x104803['customField']){_0x5f15fa[_0x104803[_0x5cf3('0x3e')][_0x5cf3('0x3f')]()]=_0x104803[_0x5cf3('0x40')][_0x5cf3('0x32')]();}else if(_[_0x5cf3('0x3a')]([_0x5cf3('0x3b'),'picklist'],_0x104803[_0x5cf3('0x3d')])&&_0x104803[_0x5cf3('0x41')]&&_0x104803[_0x5cf3('0x42')]){_0x5f15fa[_0x5cf3('0x43')][_0x5cf3('0x44')]({'id':_0x104803[_0x5cf3('0x41')],'value':_0x104803[_0x5cf3('0x40')][_0x5cf3('0x32')]()});}else if(_0x104803[_0x5cf3('0x3d')]===_0x5cf3('0x45')&&_0x104803[_0x5cf3('0x46')]&&_0x104803['idField']&&_0x104803[_0x5cf3('0x42')]){_0x230803[_0x104803[_0x5cf3('0x46')]]&&_0x5f15fa[_0x5cf3('0x43')][_0x5cf3('0x44')]({'id':_0x104803[_0x5cf3('0x41')],'value':_0x230803[_0x104803[_0x5cf3('0x46')]][_0x5cf3('0x32')]()});}else if(_0x104803['type']===_0x5cf3('0x47')&&_0x104803[_0x5cf3('0x48')]&&_0x104803[_0x5cf3('0x48')][_0x5cf3('0x10')]&&_0x104803['idField']&&_0x104803[_0x5cf3('0x42')]){_0x230803[_0x104803[_0x5cf3('0x48')]['name'][_0x5cf3('0x3f')]()]&&_0x5f15fa['custom_fields'][_0x5cf3('0x44')]({'id':_0x104803[_0x5cf3('0x41')],'value':_0x230803[_0x104803[_0x5cf3('0x48')]['name']['toLowerCase']()][_0x5cf3('0x32')]()});}});}return _0x5f15fa;}exports[_0x5cf3('0x49')]=function(_0x15e069,_0xd95580,_0x853217,_0x54a3ab,_0x1a1945,_0x2a09d1){var _0xff2e25,_0x5cf1e;_0x2a09d1['remoteUri']=intUtil[_0x5cf3('0x4a')](_0x2a09d1[_0x5cf3('0xd')]);_0x2a09d1[_0x5cf3('0x4b')]=intUtil[_0x5cf3('0x4a')](_0x2a09d1[_0x5cf3('0x4b')]);if(_0x1a1945&&_0x1a1945[_0x5cf3('0x4c')]){logger['info'](_0x5cf3('0x4d'),_0x5cf3('0x4e'));_0xd95580[_0x5cf3('0x4f')]=util[_0x5cf3('0xb')](_0x5cf3('0x50'),_0x2a09d1[_0x5cf3('0x4b')],_0xd95580[_0x5cf3('0x51')],md5(_0xd95580['uniqueid']));}else{_0xd95580[_0x5cf3('0x4f')]='';}headers['Authorization']=getAuth(_0x2a09d1);return getUser(_0x2a09d1,_0x54a3ab[_0x5cf3('0x52')])[_0x5cf3('0x15')](function(_0x2085c7){_0xff2e25=_0x2085c7;logger[_0x5cf3('0x9')]('The\x20User\x20ID\x20is:',_0xff2e25['id']);return getEndUser(_0x2a09d1,_0xd95580['calleridname'],_0xd95580[_0x5cf3('0x53')]);})[_0x5cf3('0x15')](function(_0x5b787b){_0x5cf1e=_0x5b787b;logger[_0x5cf3('0x9')]('The\x20Enduser\x20ID\x20is:',_0x5cf1e['id']);return getTicket(_0x2a09d1,_0xff2e25,_0x5cf1e,_0x853217,_0xd95580);})[_0x5cf3('0x15')](function(_0x29966f){if(_0x29966f){logger[_0x5cf3('0x9')]('The\x20Ticket\x20ID\x20is:',_0x29966f['id']);switch(_0x2a09d1['type']){case _0x5cf3('0x54'):logger[_0x5cf3('0x9')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x5cf3('0xb')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2a09d1['remoteUri'],_0xff2e25['id'],_0x29966f['id']),'method':_0x5cf3('0x29')});case _0x5cf3('0x55'):logger['info'](_0x5cf3('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5cf3('0xb')]('user:%s',_0x54a3ab[_0x5cf3('0x10')]),'trigger:browser:url',{'uri':util['format'](_0x5cf3('0x56'),_0x2a09d1[_0x5cf3('0xd')]['replace'](_0x5cf3('0x57'),''),_0x29966f['id'])});break;default:logger[_0x5cf3('0x58')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x5cf3('0x59')](function(_0x40faae){logger['error'](_0x5cf3('0x5a'),util['inspect'](_0x40faae,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x5a265b,_0x44c663,_0x204d4a,_0x57aa37,_0xd53604,_0x2a0b69,_0x1e14de){var _0x570fd4,_0x2170f0;_0x2a0b69['remoteUri']=intUtil[_0x5cf3('0x4a')](_0x2a0b69[_0x5cf3('0xd')]);_0x2a0b69[_0x5cf3('0x4b')]=intUtil[_0x5cf3('0x4a')](_0x2a0b69[_0x5cf3('0x4b')]);if(_0x1e14de&&_0x1e14de[_0x5cf3('0x5b')]&&_0x1e14de[_0x5cf3('0x5b')]!==_0x5cf3('0x5c')){logger['info'](_0x5cf3('0x5d'),_0x5cf3('0x4e'));_0x44c663[_0x5cf3('0x4f')]=util[_0x5cf3('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a0b69[_0x5cf3('0x4b')],_0x44c663[_0x5cf3('0x51')],md5(_0x44c663[_0x5cf3('0x51')]));}headers[_0x5cf3('0x5e')]=getAuth(_0x2a0b69);return getUser(_0x2a0b69,_0x57aa37[_0x5cf3('0x52')])[_0x5cf3('0x15')](function(_0x99fcb2){_0x570fd4=_0x99fcb2;logger[_0x5cf3('0x9')](_0x5cf3('0x5f'),_0x570fd4['id']);return getEndUser(_0x2a0b69,_0x44c663[_0x5cf3('0x60')],_0x44c663[_0x5cf3('0x61')]);})[_0x5cf3('0x15')](function(_0x3463f7){_0x2170f0=_0x3463f7;logger[_0x5cf3('0x9')](_0x5cf3('0x62'),_0x2170f0['id']);return getTicket(_0x2a0b69,_0x570fd4,_0x2170f0,_0x204d4a,_0x44c663);})[_0x5cf3('0x15')](function(_0x1d571c){if(_0x1d571c){logger['info'](_0x5cf3('0x63'),_0x1d571c['id']);switch(_0x2a0b69[_0x5cf3('0x3d')]){case'integrationTab':logger['info']('[OUTBOUND]',_0x5cf3('0x64'));return request({'uri':util[_0x5cf3('0xb')](_0x5cf3('0x65'),_0x2a0b69[_0x5cf3('0xd')],_0x570fd4['id'],_0x1d571c['id']),'method':'POST'});case _0x5cf3('0x55'):logger[_0x5cf3('0x9')](_0x5cf3('0x5d'),_0x5cf3('0x66'));emit(util['format']('user:%s',_0x57aa37[_0x5cf3('0x10')]),'trigger:browser:url',{'uri':util[_0x5cf3('0xb')](_0x5cf3('0x56'),_0x2a0b69[_0x5cf3('0xd')]['replace'](_0x5cf3('0x57'),''),_0x1d571c['id'])});break;default:logger['error'](_0x5cf3('0x5d'),_0x5cf3('0x67'));}}})[_0x5cf3('0x59')](function(_0x37aa8a){logger['error'](_0x5cf3('0x68'),util[_0x5cf3('0x69')](_0x37aa8a,{'showHidden':!![],'depth':null}));});};exports[_0x5cf3('0x6a')]=function(_0x1a210f,_0x43fe3f,_0x337b51,_0x1b8a22,_0x361af9,_0x1d67fa){var _0x4debda,_0x1f2823;_0x1d67fa['remoteUri']=intUtil[_0x5cf3('0x4a')](_0x1d67fa[_0x5cf3('0xd')]);_0x1d67fa[_0x5cf3('0x4b')]=intUtil[_0x5cf3('0x4a')](_0x1d67fa[_0x5cf3('0x4b')]);if(_0x361af9&&_0x361af9[_0x5cf3('0x4c')]){logger[_0x5cf3('0x9')]('['+_0x43fe3f['lastevent'][_0x5cf3('0x6b')]()+']','Recording\x20is\x20enabled!');_0x43fe3f[_0x5cf3('0x4f')]=util['format'](_0x5cf3('0x50'),_0x1d67fa[_0x5cf3('0x4b')],_0x43fe3f[_0x5cf3('0x51')],md5(_0x43fe3f[_0x5cf3('0x51')]));}else{_0x43fe3f['recordingURL']='';}headers[_0x5cf3('0x5e')]=getAuth(_0x1d67fa);return getUser(_0x1d67fa)['then'](function(_0x2fd3b3){_0x4debda=_0x2fd3b3;logger[_0x5cf3('0x9')](_0x5cf3('0x5f'),_0x4debda['id']);return getEndUser(_0x1d67fa,_0x43fe3f[_0x5cf3('0x6c')],_0x43fe3f['calleridnum']);})[_0x5cf3('0x15')](function(_0xdb9ff0){_0x1f2823=_0xdb9ff0;logger[_0x5cf3('0x9')](_0x5cf3('0x62'),_0x1f2823['id']);return getTicket(_0x1d67fa,_0x4debda,_0x1f2823,_0x337b51,_0x43fe3f);})['then'](function(_0x51f505){if(_0x51f505){logger[_0x5cf3('0x9')](_0x5cf3('0x63'),_0x51f505['id']);}})['catch'](function(_0x4934c1){logger['error']('['+_0x43fe3f[_0x5cf3('0x6d')]['toUpperCase']()+']'+_0x5cf3('0x6e'),util[_0x5cf3('0x69')](_0x4934c1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x03fd=['includes','string','picklist','type','customField','content','idField','custom_fields','push','variable','variableName','Variable','toLowerCase','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','replace','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','length','first','Enduser\x20found!','%s/users.json','end-user','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','forEach'];(function(_0x30a372,_0x23f270){var _0x1cef84=function(_0x3bfc65){while(--_0x3bfc65){_0x30a372['push'](_0x30a372['shift']());}};_0x1cef84(++_0x23f270);}(_0x03fd,0x11a));var _0xd03f=function(_0x359ffa,_0x140d66){_0x359ffa=_0x359ffa-0x0;var _0x1cc6b9=_0x03fd[_0x359ffa];return _0x1cc6b9;};'use strict';var _=require(_0xd03f('0x0'));var rp=require(_0xd03f('0x1'));var md5=require(_0xd03f('0x2'));var util=require(_0xd03f('0x3'));var Redis=require('ioredis');var intUtil=require(_0xd03f('0x4'));var config=require(_0xd03f('0x5'));var logger=require(_0xd03f('0x6'))(_0xd03f('0x7'));config[_0xd03f('0x8')]=_[_0xd03f('0x9')](config[_0xd03f('0x8')],{'host':_0xd03f('0xa'),'port':0x18eb});var io=require(_0xd03f('0xb'))(new Redis(config[_0xd03f('0x8')]));function emit(_0x4eb449,_0x575330,_0x1e981f){io['to'](_0x4eb449)['emit'](_0x575330,_0x1e981f);}var headers={'Content-Type':_0xd03f('0xc'),'Accept':_0xd03f('0xc')};function getTicket(_0x23ba86,_0xbb0670,_0x30fba5,_0x137cf5,_0x58a65c){logger[_0xd03f('0xd')](_0xd03f('0xe'));return request({'uri':util[_0xd03f('0xf')](_0xd03f('0x10'),_0x23ba86[_0xd03f('0x11')]),'method':_0xd03f('0x12'),'body':{'ticket':_['merge']({'requester_id':_0x30fba5['id'],'submitter_id':_0xbb0670?_0xbb0670['id']:undefined,'assignee_id':_0xbb0670?_0xbb0670['id']:undefined,'tags':getTags(_0x137cf5['Tags'],_0xd03f('0x13')),'subject':intUtil[_0xd03f('0x14')](_0x137cf5[_0xd03f('0x15')],_0x58a65c,'\x20'),'description':intUtil['getString'](_0x137cf5[_0xd03f('0x16')],_0x58a65c,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd03f('0x14')](_0x137cf5[_0xd03f('0x16')],_0x58a65c,'\x0a')}},getCustomFields(_0x137cf5[_0xd03f('0x17')],_0x58a65c))}})[_0xd03f('0x18')](function(_0x301c07){logger[_0xd03f('0xd')](_0xd03f('0x19'));return _0x301c07[_0xd03f('0x1a')];});}function getUser(_0x1c16f5,_0x5b9bc4){if(intUtil[_0xd03f('0x1b')](_0x5b9bc4)){logger['info'](_0xd03f('0x1c'),_0x5b9bc4);return request({'uri':util[_0xd03f('0xf')](_0xd03f('0x1d'),_0x1c16f5[_0xd03f('0x11')]),'qs':{'query':util[_0xd03f('0xf')](_0xd03f('0x1e'),_0x5b9bc4)}})[_0xd03f('0x18')](function(_0x1088aa){if(_0x1088aa[_0xd03f('0x1f')]){logger['info'](_0xd03f('0x20'));return _[_0xd03f('0x21')](_0x1088aa[_0xd03f('0x22')],{'email':_0x5b9bc4,'role':_0xd03f('0x23')});}else{logger[_0xd03f('0xd')](_0xd03f('0x24'));return request({'uri':util[_0xd03f('0xf')](_0xd03f('0x25'),_0x1c16f5[_0xd03f('0x11')])})[_0xd03f('0x18')](function(_0x32d8bd){logger[_0xd03f('0xd')]('Admin\x20account\x20selected.');return _0x32d8bd[_0xd03f('0x26')];});}});}else{logger['info'](_0xd03f('0x24'));return request({'uri':util[_0xd03f('0xf')](_0xd03f('0x25'),_0x1c16f5['remoteUri'])})['then'](function(_0x4210ce){logger['info'](_0xd03f('0x27'));return _0x4210ce[_0xd03f('0x26')];});}}function getEndUser(_0x2ffa1b,_0x3a9267,_0x1f4e0f){logger[_0xd03f('0xd')](_0xd03f('0x28'),_0x1f4e0f);return request({'uri':util[_0xd03f('0xf')]('%s/search.json',_0x2ffa1b[_0xd03f('0x11')]),'qs':{'query':util[_0xd03f('0xf')](_0xd03f('0x29'),_0x1f4e0f)}})[_0xd03f('0x18')](function(_0x419298){var _0x47d50f;if(_0x419298['results']['length']){_0x419298['results']=_[_0xd03f('0x2a')](_0x419298[_0xd03f('0x22')],{'suspended':![],'role':'end-user'});if(_0x419298[_0xd03f('0x22')][_0xd03f('0x2b')]){_0x47d50f=_[_0xd03f('0x2c')](_0x419298['results']);}}if(_0x47d50f){logger[_0xd03f('0xd')](_0xd03f('0x2d'));return _0x47d50f;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xd03f('0xf')](_0xd03f('0x2e'),_0x2ffa1b['remoteUri']),'method':_0xd03f('0x12'),'body':{'user':{'role':_0xd03f('0x2f'),'name':util[_0xd03f('0xf')](_0xd03f('0x30'),_0x3a9267||_0x1f4e0f),'phone':_0x1f4e0f}}})['then'](function(_0x16561c){logger[_0xd03f('0xd')]('Enduser\x20created.');return _0x16561c[_0xd03f('0x26')];});}});}function getAuth(_0x377d25){var _0x2f9905;if(_0x377d25[_0xd03f('0x31')]===_0xd03f('0x32')){_0x2f9905=util[_0xd03f('0xf')](_0xd03f('0x33'),_0x377d25[_0xd03f('0x34')],_0x377d25[_0xd03f('0x32')]);}else if(_0x377d25['authType']===_0xd03f('0x35')){_0x2f9905=util[_0xd03f('0xf')](_0xd03f('0x36'),_0x377d25[_0xd03f('0x34')],_0x377d25[_0xd03f('0x35')]);}return util[_0xd03f('0xf')](_0xd03f('0x37'),new Buffer(_0x2f9905)[_0xd03f('0x38')]('base64'));}function request(_0x2d93d9){logger[_0xd03f('0x39')](_0xd03f('0x3a'),JSON[_0xd03f('0x3b')](_0x2d93d9));return rp(_[_0xd03f('0x9')](_0x2d93d9,{'method':_0xd03f('0x3c'),'headers':headers,'json':!![]}));}function getTags(_0x2059da,_0x22ba7b){var _0x1dcbe8=[];if(_0x2059da&&_0x2059da[_0xd03f('0x2b')]>0x0){_0x1dcbe8=_[_0xd03f('0x3d')](_0x2059da,_0x22ba7b);}return _0x1dcbe8;}function getCustomFields(_0x3819b9,_0x4ef3c0){var _0x5083c5=[];var _0x1472b9={'custom_fields':[]};if(_0x3819b9[_0xd03f('0x2b')]>0x0){_[_0xd03f('0x3e')](_0x3819b9,function(_0x3a331e){if(_[_0xd03f('0x3f')]([_0xd03f('0x40'),_0xd03f('0x41')],_0x3a331e[_0xd03f('0x42')])&&_0x3a331e['nameField']&&!_0x3a331e[_0xd03f('0x43')]){_0x1472b9[_0x3a331e['nameField']['toLowerCase']()]=_0x3a331e[_0xd03f('0x44')][_0xd03f('0x38')]();}else if(_['includes']([_0xd03f('0x40'),_0xd03f('0x41')],_0x3a331e[_0xd03f('0x42')])&&_0x3a331e[_0xd03f('0x45')]&&_0x3a331e[_0xd03f('0x43')]){_0x1472b9[_0xd03f('0x46')][_0xd03f('0x47')]({'id':_0x3a331e['idField'],'value':_0x3a331e[_0xd03f('0x44')][_0xd03f('0x38')]()});}else if(_0x3a331e['type']===_0xd03f('0x48')&&_0x3a331e[_0xd03f('0x49')]&&_0x3a331e[_0xd03f('0x45')]&&_0x3a331e[_0xd03f('0x43')]){_0x4ef3c0[_0x3a331e['variableName']]&&_0x1472b9['custom_fields']['push']({'id':_0x3a331e[_0xd03f('0x45')],'value':_0x4ef3c0[_0x3a331e['variableName']]['toString']()});}else if(_0x3a331e[_0xd03f('0x42')]==='customVariable'&&_0x3a331e[_0xd03f('0x4a')]&&_0x3a331e['Variable']['name']&&_0x3a331e[_0xd03f('0x45')]&&_0x3a331e[_0xd03f('0x43')]){_0x4ef3c0[_0x3a331e[_0xd03f('0x4a')][_0xd03f('0x13')][_0xd03f('0x4b')]()]&&_0x1472b9[_0xd03f('0x46')][_0xd03f('0x47')]({'id':_0x3a331e[_0xd03f('0x45')],'value':_0x4ef3c0[_0x3a331e['Variable']['name'][_0xd03f('0x4b')]()][_0xd03f('0x38')]()});}});}return _0x1472b9;}exports[_0xd03f('0x4c')]=function(_0x436903,_0x348a25,_0x48ed91,_0x4769c6,_0x59708e,_0x2a313c){var _0x1323ed,_0x8c17e2;_0x2a313c['remoteUri']=intUtil['stripTrailingSlash'](_0x2a313c[_0xd03f('0x11')]);_0x2a313c[_0xd03f('0x4d')]=intUtil['stripTrailingSlash'](_0x2a313c['serverUrl']);if(_0x59708e&&_0x59708e[_0xd03f('0x4e')]){logger[_0xd03f('0xd')](_0xd03f('0x4f'),_0xd03f('0x50'));_0x348a25[_0xd03f('0x51')]=util[_0xd03f('0xf')](_0xd03f('0x52'),_0x2a313c[_0xd03f('0x4d')],_0x348a25[_0xd03f('0x53')],md5(_0x348a25[_0xd03f('0x53')]));}else{_0x348a25[_0xd03f('0x51')]='';}headers['Authorization']=getAuth(_0x2a313c);return getUser(_0x2a313c,_0x4769c6[_0xd03f('0x54')])[_0xd03f('0x18')](function(_0x2657df){_0x1323ed=_0x2657df;logger[_0xd03f('0xd')]('The\x20User\x20ID\x20is:',_0x1323ed['id']);return getEndUser(_0x2a313c,_0x348a25[_0xd03f('0x55')],_0x348a25['calleridnum']);})[_0xd03f('0x18')](function(_0x33d1a9){_0x8c17e2=_0x33d1a9;logger['info'](_0xd03f('0x56'),_0x8c17e2['id']);return getTicket(_0x2a313c,_0x1323ed,_0x8c17e2,_0x48ed91,_0x348a25);})[_0xd03f('0x18')](function(_0x2afa5f){if(_0x2afa5f){logger[_0xd03f('0xd')](_0xd03f('0x57'),_0x2afa5f['id']);switch(_0x2a313c[_0xd03f('0x42')]){case'integrationTab':logger[_0xd03f('0xd')](_0xd03f('0x4f'),_0xd03f('0x58'));return request({'uri':util['format'](_0xd03f('0x59'),_0x2a313c[_0xd03f('0x11')],_0x1323ed['id'],_0x2afa5f['id']),'method':'POST'});case _0xd03f('0x5a'):logger[_0xd03f('0xd')](_0xd03f('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xd03f('0x5b'),_0x4769c6[_0xd03f('0x13')]),_0xd03f('0x5c'),{'uri':util[_0xd03f('0xf')](_0xd03f('0x5d'),_0x2a313c[_0xd03f('0x11')]['replace'](_0xd03f('0x5e'),''),_0x2afa5f['id'])});break;default:logger[_0xd03f('0x5f')](_0xd03f('0x4f'),_0xd03f('0x60'));}}})['catch'](function(_0x54b0c7){logger['error'](_0xd03f('0x61'),util[_0xd03f('0x62')](_0x54b0c7,{'showHidden':!![],'depth':null}));});};exports[_0xd03f('0x63')]=function(_0x3da31a,_0xe4ba28,_0x55ee95,_0xe62c43,_0xf8e589,_0x3ed741,_0x501d67){var _0x292049,_0x5861f5;_0x3ed741['remoteUri']=intUtil[_0xd03f('0x64')](_0x3ed741['remoteUri']);_0x3ed741[_0xd03f('0x4d')]=intUtil[_0xd03f('0x64')](_0x3ed741[_0xd03f('0x4d')]);if(_0x501d67&&_0x501d67[_0xd03f('0x65')]&&_0x501d67[_0xd03f('0x65')]!==_0xd03f('0x66')){logger[_0xd03f('0xd')](_0xd03f('0x67'),_0xd03f('0x50'));_0xe4ba28['recordingURL']=util[_0xd03f('0xf')](_0xd03f('0x52'),_0x3ed741[_0xd03f('0x4d')],_0xe4ba28['uniqueid'],md5(_0xe4ba28[_0xd03f('0x53')]));}headers[_0xd03f('0x68')]=getAuth(_0x3ed741);return getUser(_0x3ed741,_0xe62c43[_0xd03f('0x54')])[_0xd03f('0x18')](function(_0xbc162c){_0x292049=_0xbc162c;logger['info'](_0xd03f('0x69'),_0x292049['id']);return getEndUser(_0x3ed741,_0xe4ba28[_0xd03f('0x6a')],_0xe4ba28[_0xd03f('0x6b')]);})['then'](function(_0x3c3fd6){_0x5861f5=_0x3c3fd6;logger[_0xd03f('0xd')](_0xd03f('0x56'),_0x5861f5['id']);return getTicket(_0x3ed741,_0x292049,_0x5861f5,_0x55ee95,_0xe4ba28);})['then'](function(_0x1762f5){if(_0x1762f5){logger['info']('The\x20Ticket\x20ID\x20is:',_0x1762f5['id']);switch(_0x3ed741[_0xd03f('0x42')]){case _0xd03f('0x6c'):logger[_0xd03f('0xd')](_0xd03f('0x67'),_0xd03f('0x58'));return request({'uri':util['format'](_0xd03f('0x59'),_0x3ed741[_0xd03f('0x11')],_0x292049['id'],_0x1762f5['id']),'method':_0xd03f('0x12')});case _0xd03f('0x5a'):logger[_0xd03f('0xd')]('[OUTBOUND]',_0xd03f('0x6d'));emit(util[_0xd03f('0xf')](_0xd03f('0x5b'),_0xe62c43[_0xd03f('0x13')]),_0xd03f('0x5c'),{'uri':util['format'](_0xd03f('0x5d'),_0x3ed741['remoteUri'][_0xd03f('0x6e')](_0xd03f('0x5e'),''),_0x1762f5['id'])});break;default:logger[_0xd03f('0x5f')](_0xd03f('0x67'),_0xd03f('0x60'));}}})['catch'](function(_0x5262b8){logger[_0xd03f('0x5f')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xd03f('0x62')](_0x5262b8,{'showHidden':!![],'depth':null}));});};exports[_0xd03f('0x6f')]=function(_0x3435cb,_0x11d5f2,_0x278ad7,_0xac78ee,_0x3d0a59,_0x456ba9){var _0x312158,_0x782bbd;_0x456ba9[_0xd03f('0x11')]=intUtil['stripTrailingSlash'](_0x456ba9[_0xd03f('0x11')]);_0x456ba9[_0xd03f('0x4d')]=intUtil[_0xd03f('0x64')](_0x456ba9[_0xd03f('0x4d')]);if(_0x3d0a59&&_0x3d0a59[_0xd03f('0x4e')]){logger[_0xd03f('0xd')]('['+_0x11d5f2[_0xd03f('0x70')][_0xd03f('0x71')]()+']',_0xd03f('0x50'));_0x11d5f2[_0xd03f('0x51')]=util[_0xd03f('0xf')](_0xd03f('0x52'),_0x456ba9[_0xd03f('0x4d')],_0x11d5f2['uniqueid'],md5(_0x11d5f2['uniqueid']));}else{_0x11d5f2[_0xd03f('0x51')]='';}headers[_0xd03f('0x68')]=getAuth(_0x456ba9);return getUser(_0x456ba9)['then'](function(_0xcc147b){_0x312158=_0xcc147b;logger[_0xd03f('0xd')](_0xd03f('0x69'),_0x312158['id']);return getEndUser(_0x456ba9,_0x11d5f2[_0xd03f('0x55')],_0x11d5f2['calleridnum']);})[_0xd03f('0x18')](function(_0x1bb568){_0x782bbd=_0x1bb568;logger[_0xd03f('0xd')](_0xd03f('0x56'),_0x782bbd['id']);return getTicket(_0x456ba9,_0x312158,_0x782bbd,_0x278ad7,_0x11d5f2);})[_0xd03f('0x18')](function(_0x3073b2){if(_0x3073b2){logger[_0xd03f('0xd')](_0xd03f('0x57'),_0x3073b2['id']);}})['catch'](function(_0x38a57c){logger[_0xd03f('0x5f')]('['+_0x11d5f2[_0xd03f('0x70')][_0xd03f('0x71')]()+']'+_0xd03f('0x72'),util[_0xd03f('0x62')](_0x38a57c,{'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 f42ccdd..8d4ac82 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 _0x45c8=['contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Owner','last_name','getString','Subjects','Description','Who_Id','Full_Name','Last_Name','What_Id','First_Name','$se_module','startCase','utc','talktime','format','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','code','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','[QUEUE]','recordingFormat','none','zoho.eu','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','user:%s','[OUTBOUND]','unmanaged','monitor_format','toUpperCase','lodash','md5','util','./util','moment','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','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','refresh_token','then','seconds','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email','info','Agent\x20found!','profile','Administrator','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','details','CREATE\x20ERROR','moduleSearch'];(function(_0x5b3e14,_0x3b59db){var _0x373280=function(_0x33fffb){while(--_0x33fffb){_0x5b3e14['push'](_0x5b3e14['shift']());}};_0x373280(++_0x3b59db);}(_0x45c8,0xef));var _0x845c=function(_0xbf9da7,_0x4bee93){_0xbf9da7=_0xbf9da7-0x0;var _0x2acea1=_0x45c8[_0xbf9da7];return _0x2acea1;};'use strict';var _=require(_0x845c('0x0'));var rp=require('request-promise');var md5=require(_0x845c('0x1'));var util=require(_0x845c('0x2'));var intUtil=require(_0x845c('0x3'));var moment=require(_0x845c('0x4'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x845c('0x5'));config[_0x845c('0x6')]=_[_0x845c('0x7')](config['redis'],{'host':_0x845c('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x845c('0x6')]));function emit(_0x4648e1,_0x3075cd,_0x36b3aa){io['to'](_0x4648e1)[_0x845c('0x9')](_0x3075cd,_0x36b3aa);}function request(_0x34a8ae){logger[_0x845c('0xa')](_0x845c('0xb'),JSON[_0x845c('0xc')](_0x34a8ae));return rp(_0x34a8ae);}function getCustomFields(_0x1e6a03,_0x5f452d){var _0x54c2c1={};if(_0x1e6a03[_0x845c('0xd')]>0x0){_[_0x845c('0xe')](_0x1e6a03,function(_0x571283){if(_[_0x845c('0xf')]([_0x845c('0x10'),_0x845c('0x11')],_0x571283[_0x845c('0x12')])&&_0x571283[_0x845c('0x13')]){_0x54c2c1[_0x571283[_0x845c('0x13')]]=_0x571283['content'][_0x845c('0x14')]();}else if(_0x571283[_0x845c('0x12')]==='variable'&&_0x571283[_0x845c('0x15')]&&_0x571283[_0x845c('0x13')]&&_0x5f452d[_0x571283[_0x845c('0x15')]]){_0x54c2c1[_0x571283[_0x845c('0x13')]]=_0x5f452d[_0x571283[_0x845c('0x15')]][_0x845c('0x14')]();}else if(_0x571283[_0x845c('0x12')]==='customVariable'&&_0x571283['Variable']&&_0x571283[_0x845c('0x16')][_0x845c('0x17')]&&_0x571283[_0x845c('0x13')]&&_0x5f452d[_0x571283['Variable'][_0x845c('0x17')][_0x845c('0x18')]()]){_0x54c2c1[_0x571283[_0x845c('0x13')]]=_0x5f452d[_0x571283['Variable']['name']['toLowerCase']()][_0x845c('0x14')]();}});}return _0x54c2c1;}function getName(_0x5171ed){if(_0x5171ed[_0x845c('0x19')]('\x20')>0x0){var _0x1c803f=_0x5171ed[_0x845c('0x1a')](/ (.+)/);if(_0x1c803f[0x1]){return _0x1c803f;}}return[_0x5171ed,_0x5171ed];}var accountsTokens={};function getAccessToken(_0x3a8f19){return new Promise(function(_0x4629d4,_0x55418b){if(!_[_0x845c('0x1b')](accountsTokens[_0x3a8f19['id']])&&!_['isNil'](accountsTokens[_0x3a8f19['id']][_0x845c('0x1c')])){if(moment()['isBefore'](accountsTokens[_0x3a8f19['id']][_0x845c('0x1d')])){_0x4629d4(accountsTokens[_0x3a8f19['id']]['access_token']);}}var _0x18ed7c;switch(_0x3a8f19['zone']){case'US':_0x18ed7c=_0x845c('0x1e');break;case'AU':_0x18ed7c=_0x845c('0x1f');break;case'EU':_0x18ed7c=_0x845c('0x20');break;case'IN':_0x18ed7c=_0x845c('0x21');break;case'CN':_0x18ed7c=_0x845c('0x22');break;default:_0x18ed7c=_0x845c('0x20');break;}var _0x4efe76={'method':_0x845c('0x23'),'uri':_0x18ed7c+'/oauth/v2/token','qs':{'refresh_token':_0x3a8f19[_0x845c('0x24')],'client_id':_0x3a8f19[_0x845c('0x25')],'client_secret':_0x3a8f19['clientSecret'],'grant_type':_0x845c('0x26')},'json':!![]};return rp(_0x4efe76)[_0x845c('0x27')](function(_0x189c19){accountsTokens[_0x3a8f19['id']]={'access_token':_0x189c19['access_token'],'expires_in':moment()['add'](_0x189c19[_0x845c('0x1d')],_0x845c('0x28'))};_0x4629d4(_0x189c19[_0x845c('0x1c')]);})['catch'](function(_0x46bdc9){logger[_0x845c('0x29')](_0x845c('0x2a'),_0x46bdc9[_0x845c('0x2b')]);_0x55418b(_0x46bdc9);});});}function getUser(_0x5d7b58,_0x19a44b,_0x2003f6,_0x32ba01){logger['info'](_0x845c('0x2c'));return request({'method':_0x845c('0x2d'),'uri':util['format'](_0x845c('0x2e'),_0x19a44b),'qs':{'type':_0x845c('0x2f')},'headers':{'Authorization':_0x845c('0x30')+_0x5d7b58},'json':!![]})[_0x845c('0x27')](function(_0x4d2a42){if(_0x4d2a42['users']){var _0x2d734e=-0x1;if(_[_0x845c('0x31')](_0x4d2a42[_0x845c('0x32')])){if(!_[_0x845c('0x1b')](_0x32ba01)){_0x2d734e=_[_0x845c('0x33')](_0x4d2a42[_0x845c('0x32')],function(_0x238de6){return _0x238de6[_0x845c('0x34')]===_0x32ba01;});}if(_0x2d734e>=0x0){logger[_0x845c('0x35')](_0x845c('0x36'));}else{logger[_0x845c('0x35')]('Using\x20the\x20admin\x20account!');_0x2d734e=_[_0x845c('0x33')](_0x4d2a42['users'],function(_0xb8b196){return _0xb8b196[_0x845c('0x37')][_0x845c('0x17')]===_0x845c('0x38');});}return _0x4d2a42[_0x845c('0x32')][_0x2d734e];}else{if(_0x4d2a42['user'][_0x845c('0x37')][_0x845c('0x17')]==='Administrator'){logger['info'](_0x845c('0x39'));user=_0x4d2a42['user'];return user;}else{logger[_0x845c('0x29')]('The\x20failing\x20result\x20is',JSON[_0x845c('0xc')](_0x4d2a42));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x4d2a42));}}}else{logger[_0x845c('0x29')](_0x845c('0x3a'),JSON[_0x845c('0xc')](_0x4d2a42));throw new Error(_0x845c('0x3b')+JSON[_0x845c('0xc')](_0x4d2a42));}})[_0x845c('0x3c')](function(_0x4b53e9){console[_0x845c('0x29')](_0x4b53e9);});}function getZohoUser(_0x4e9550,_0x121e32){return new BPromise(function(_0x10c303,_0x11ca8c){request(_0x4e9550)[_0x845c('0x27')](function(_0x3563e8){var _0x491df=null;if(_0x3563e8){_0x491df=_0x3563e8[_0x845c('0x3d')][0x0];_0x491df[_0x845c('0x3e')]=_0x121e32;}_0x10c303(_0x491df);})[_0x845c('0x3c')](function(_0x58f13d){_0x11ca8c(_0x58f13d);});});}function createEndUser(_0x3625af,_0x856abb,_0x2a9f49,_0x20227d,_0xb6c497,_0x25181d){var _0x2a9f49=getName(_0x2a9f49);return request({'method':_0x845c('0x23'),'uri':_0x845c('0x3f')+_0x856abb+_0x845c('0x40')+_['startCase'](_0x25181d[_0x845c('0x41')])+'s','body':{'data':[{'Last_Name':_0x2a9f49[0x1],'First_Name':_0x2a9f49[0x0],'Phone':_0x20227d,'Owner':{'name':!_[_0x845c('0x1b')](_0xb6c497[_0x845c('0x42')][_0x845c('0x17')])?_0xb6c497['role'][_0x845c('0x17')]:!_['isNil'](_0xb6c497['first_name'])?_0xb6c497[_0x845c('0x43')]+'\x20'+_0xb6c497['last_name']:_0xb6c497['last_name'],'id':_0xb6c497['id']}}]},'headers':{'Authorization':_0x845c('0x30')+_0x3625af},'json':!![]})[_0x845c('0x27')](function(_0x3d0cad){if(_0x3d0cad&&_0x3d0cad[_0x845c('0x3d')][0x0]['code']==='SUCCESS'){var _0x596786=_0x3d0cad[_0x845c('0x3d')][0x0][_0x845c('0x44')];_0x596786['enduserType']=_['startCase'](_0x25181d[_0x845c('0x41')])+'s';return _0x596786;}logger[_0x845c('0x29')](_0x845c('0x3a'),JSON[_0x845c('0xc')](data));throw new Error('Error:\x20'+JSON[_0x845c('0xc')](data));})[_0x845c('0x3c')](function(_0x298b5d){console['log'](_0x845c('0x45'),_0x298b5d);});}function getEndUser(_0x7a611a,_0xa086e1,_0x3d61fc,_0x386d06,_0x4e8b2f,_0x4d23bd,_0x52af6e){var _0xec7813={'method':_0x845c('0x2d'),'uri':'','headers':{'Authorization':_0x845c('0x30')+_0x7a611a},'json':!![]};switch(_0x52af6e[_0x845c('0x46')]){case _0x845c('0x47'):_0xec7813[_0x845c('0x48')]=_0x845c('0x3f')+_0xa086e1+_0x845c('0x49')+_0x4e8b2f+'))';return getZohoUser(_0xec7813,_0x845c('0x4a'))['then'](function(_0xeb86a5){if(_0xeb86a5)return _0xeb86a5;_0xec7813['uri']=_0x845c('0x3f')+_0xa086e1+_0x845c('0x4b')+_0x4e8b2f+'))';return getZohoUser(_0xec7813,_0x845c('0x4c'))[_0x845c('0x27')](function(_0x11b290){if(_0x11b290)return _0x11b290;if(_0x52af6e[_0x845c('0x41')]!=_0x845c('0x4d')){return createEndUser(_0x7a611a,_0xa086e1,_0x386d06,_0x4e8b2f,_0x4d23bd,_0x52af6e);}else{return{};}});});break;case _0x845c('0x4e'):_0xec7813[_0x845c('0x48')]=_0x845c('0x3f')+_0xa086e1+_0x845c('0x49')+_0x4e8b2f+'))';return getZohoUser(_0xec7813,_0x845c('0x4a'))[_0x845c('0x27')](function(_0xc13dba){if(_0xc13dba)return _0xc13dba;if(_0x52af6e[_0x845c('0x41')]!=_0x845c('0x4d')){return createEndUser(_0x7a611a,_0xa086e1,_0x386d06,_0x4e8b2f,_0x4d23bd,_0x52af6e);}else{return{};}});break;case'lead':_0xec7813[_0x845c('0x48')]=_0x845c('0x3f')+_0xa086e1+_0x845c('0x4b')+_0x4e8b2f+'))';return getZohoUser(_0xec7813,_0x845c('0x4c'))[_0x845c('0x27')](function(_0x21cc63){if(_0x21cc63)return _0x21cc63;if(_0x52af6e[_0x845c('0x41')]!='nothing'){return createEndUser(_0x7a611a,_0xa086e1,_0x386d06,_0x4e8b2f,_0x4d23bd,_0x52af6e);}else{return{};}});break;}}function getCall(_0x5ca75e,_0x42e786,_0x3b5059,_0x3a8a67,_0x526dba,_0x4766f2,_0xed4ab2,_0x369ff6){logger['info']('Creating\x20new\x20call...');var _0x2e61c6={};_0x2e61c6[_0x845c('0x4f')]={'name':!_['isNil'](_0x3a8a67[_0x845c('0x42')]['name'])&&!_[_0x845c('0x1b')](_0x3a8a67[_0x845c('0x37')][_0x845c('0x17')])&&_0x3a8a67[_0x845c('0x37')][_0x845c('0x17')]==='administrator'?_0x3a8a67['role'][_0x845c('0x17')]:!_['isNil'](_0x3a8a67[_0x845c('0x43')])?_0x3a8a67[_0x845c('0x43')]+'\x20'+_0x3a8a67[_0x845c('0x50')]:_0x3a8a67[_0x845c('0x50')],'id':_0x3a8a67['id']};_0x2e61c6['Subject']=intUtil[_0x845c('0x51')](_0x4766f2[_0x845c('0x52')],_0xed4ab2,'\x20');_0x2e61c6[_0x845c('0x53')]=intUtil[_0x845c('0x51')](_0x4766f2['Descriptions'],_0xed4ab2,'\x0a');if(_0x526dba[_0x845c('0x3e')]===_0x845c('0x4a')){_0x2e61c6[_0x845c('0x54')]={'name':!_[_0x845c('0x1b')](_0x526dba[_0x845c('0x55')])?_0x526dba[_0x845c('0x55')]:!_['isNil'](_0x526dba['First_Name'])?_0x526dba['First_Name']+'\x20'+_0x526dba['Last_Name']:_0x526dba[_0x845c('0x56')],'id':_0x526dba['id']};}if(_0x526dba[_0x845c('0x3e')]===_0x845c('0x4c')){_0x2e61c6[_0x845c('0x57')]={'name':!_['isNil'](_0x526dba[_0x845c('0x55')])?_0x526dba[_0x845c('0x55')]:!_['isNil'](_0x526dba[_0x845c('0x58')])?_0x526dba['First_Name']+'\x20'+_0x526dba['Last_Name']:_0x526dba[_0x845c('0x56')],'id':_0x526dba['id']};_0x2e61c6[_0x845c('0x59')]=_[_0x845c('0x5a')](_0x526dba[_0x845c('0x3e')]);}if(_0xed4ab2['talktime']){_0x2e61c6['Call_Duration']=moment[_0x845c('0x5b')](parseInt(_0xed4ab2[_0x845c('0x5c')])*0x3e8)[_0x845c('0x5d')]('mm:ss');}else if(_0xed4ab2[_0x845c('0x5e')]&&_0xed4ab2[_0x845c('0x5f')]){_0x2e61c6[_0x845c('0x60')]=moment['utc'](moment(_0xed4ab2[_0x845c('0x5f')],_0x845c('0x61'))[_0x845c('0x62')](moment(_0xed4ab2['starttime'],_0x845c('0x61'))))['format'](_0x845c('0x63'));}switch(_0xed4ab2[_0x845c('0x64')]){case _0x845c('0x65'):_0x2e61c6[_0x845c('0x66')]=_0x845c('0x67');break;case _0x845c('0x68'):case _0x845c('0x69'):_0x2e61c6[_0x845c('0x66')]=_0x845c('0x6a');break;case _0x845c('0x6b'):_0x2e61c6[_0x845c('0x66')]=_0x845c('0x6c');break;case _0x845c('0x6d'):_0x2e61c6['Call_Result']=_0x845c('0x6e');break;case _0x845c('0x6f'):_0x2e61c6['Call_Result']=_0x845c('0x70');default:}_0x2e61c6[_0x845c('0x71')]=(_0x369ff6===_0x845c('0x72')?moment(_0xed4ab2[_0x845c('0x73')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0xed4ab2[_0x845c('0x74')])[_0x845c('0x5d')](_0x845c('0x61')))||moment()['format'](_0x845c('0x61'));_0x2e61c6[_0x845c('0x75')]=_0x369ff6||'Inbound';_0x2e61c6=_[_0x845c('0x76')](_0x2e61c6,getCustomFields(_0x4766f2[_0x845c('0x77')],_0xed4ab2));return request({'method':_0x845c('0x23'),'uri':_0x845c('0x3f')+_0x42e786+_0x845c('0x78'),'headers':{'Authorization':_0x845c('0x30')+_0x5ca75e},'body':{'data':[_0x2e61c6]},'json':!![]})[_0x845c('0x27')](function(_0x3fc993){if(_0x3fc993&&_0x3fc993[_0x845c('0x3d')][0x0][_0x845c('0x79')]===_0x845c('0x7a')){logger[_0x845c('0x35')](_0x845c('0x7b'));return{'id':_0x3fc993[_0x845c('0x3d')][0x0][_0x845c('0x44')]['id']};}})[_0x845c('0x3c')](function(_0x4278e2){logger[_0x845c('0x35')](_0x845c('0x7c'),_0x4278e2[_0x845c('0x2b')]);console['log'](_0x845c('0x7c'),_0x4278e2);});}exports[_0x845c('0x7d')]=function(_0x321574,_0x3c8ff1,_0x248dff,_0x3b6e35,_0x526379,_0x566df9){var _0x4375ab,_0x16c66a,_0x364b65;_0x566df9[_0x845c('0x7e')]=intUtil[_0x845c('0x7f')](_0x566df9[_0x845c('0x7e')]);_0x566df9[_0x845c('0x80')]=intUtil[_0x845c('0x7f')](_0x566df9[_0x845c('0x80')]);if(_0x526379&&_0x526379['monitor_format']){logger[_0x845c('0x35')]('[QUEUE]',_0x845c('0x81'));_0x3c8ff1[_0x845c('0x82')]=_0x566df9[_0x845c('0x80')]+_0x845c('0x83')+_0x3c8ff1[_0x845c('0x84')]+_0x845c('0x85')+md5(_0x3c8ff1[_0x845c('0x84')]);}else{_0x3c8ff1['recordingURL']='';}var _0x52975b=_0x566df9[_0x845c('0x7e')]==='zoho.eu'?'eu':_0x845c('0x86');return getAccessToken(_0x566df9)['then'](function(_0x2f4a7d){_0x364b65=_0x2f4a7d;return getUser(_0x364b65,_0x52975b,_0x566df9,_0x3b6e35['email']);})['then'](function(_0x5bd008){_0x4375ab=_0x5bd008;logger[_0x845c('0x35')](_0x845c('0x87'),_0x4375ab['id']);return getEndUser(_0x364b65,_0x52975b,_0x566df9,_0x3c8ff1[_0x845c('0x88')],_0x3c8ff1[_0x845c('0x89')],_0x4375ab,_0x248dff);})[_0x845c('0x27')](function(_0x1e86d2){_0x16c66a=_0x1e86d2;return getCall(_0x364b65,_0x52975b,_0x566df9,_0x4375ab,_0x16c66a,_0x248dff,_0x3c8ff1,_0x845c('0x8a'));})[_0x845c('0x27')](function(_0x184390){if(_0x184390){logger[_0x845c('0x35')]('The\x20Call\x20ID\x20is:',_0x184390['id']);logger['info']('[QUEUE]',_0x845c('0x8b'));emit(util[_0x845c('0x5d')]('user:%s',_0x3b6e35[_0x845c('0x17')]),_0x845c('0x8c'),{'uri':_0x845c('0x8d')+_0x566df9[_0x845c('0x7e')]+'/crm/EntityInfo.do?module=Calls&id='+_0x184390['id']});}})[_0x845c('0x3c')](function(_0x3f4b9a){logger[_0x845c('0x29')](_0x845c('0x8e'),JSON[_0x845c('0xc')](_0x3f4b9a));});};exports['outbound']=function(_0x5db8db,_0x15f9a7,_0x7bd1ec,_0x2f8b53,_0x1e815d,_0x2765de,_0x22261a){var _0x53d47f,_0x290fea,_0x78b037;_0x2765de[_0x845c('0x7e')]=intUtil['stripTrailingSlash'](_0x2765de[_0x845c('0x7e')]);_0x2765de[_0x845c('0x80')]=intUtil[_0x845c('0x7f')](_0x2765de['serverUrl']);if(_0x22261a&&_0x22261a[_0x845c('0x8f')]&&_0x22261a[_0x845c('0x8f')]!==_0x845c('0x90')){logger['info']('[OUTBOUND]',_0x845c('0x81'));_0x15f9a7[_0x845c('0x82')]=_0x2765de['serverUrl']+_0x845c('0x83')+_0x15f9a7[_0x845c('0x84')]+_0x845c('0x85')+md5(_0x15f9a7[_0x845c('0x84')]);}var _0x3bf3d4=_0x2765de[_0x845c('0x7e')]===_0x845c('0x91')?'eu':_0x845c('0x86');return getAccessToken(_0x2765de)[_0x845c('0x27')](function(_0x4bb260){_0x78b037=_0x4bb260;return getUser(_0x78b037,_0x3bf3d4,_0x2765de,_0x2f8b53[_0x845c('0x34')]);})['then'](function(_0x4877ac){_0x53d47f=_0x4877ac;logger[_0x845c('0x35')](_0x845c('0x87'),_0x53d47f['id']);return getEndUser(_0x78b037,_0x3bf3d4,_0x2765de,_0x15f9a7[_0x845c('0x92')],_0x15f9a7[_0x845c('0x93')],_0x53d47f,_0x7bd1ec);})['then'](function(_0x4f4fc9){_0x290fea=_0x4f4fc9;return getCall(_0x78b037,_0x3bf3d4,_0x2765de,_0x53d47f,_0x290fea,_0x7bd1ec,_0x15f9a7,_0x845c('0x94'));})[_0x845c('0x27')](function(_0x48ea0a){if(_0x48ea0a){logger[_0x845c('0x35')](_0x845c('0x95'),_0x48ea0a['id']);logger[_0x845c('0x35')]('[OUTBOUND]',_0x845c('0x8b'));emit(util['format'](_0x845c('0x96'),_0x2f8b53[_0x845c('0x17')]),'trigger:browser:url',{'uri':'https://crm.'+_0x2765de[_0x845c('0x7e')]+'/crm/EntityInfo.do?module=Calls&id='+_0x48ea0a['id']});}})[_0x845c('0x3c')](function(_0x518ed9){logger[_0x845c('0x29')](_0x845c('0x97'),JSON[_0x845c('0xc')](_0x518ed9));});};exports[_0x845c('0x98')]=function(_0x311d25,_0x5617af,_0x43465f,_0x486bd6,_0x2122f2,_0x39ffe5){var _0x133d95,_0x1bab9c,_0x124a3f;_0x39ffe5[_0x845c('0x7e')]=intUtil[_0x845c('0x7f')](_0x39ffe5[_0x845c('0x7e')]);_0x39ffe5[_0x845c('0x80')]=intUtil[_0x845c('0x7f')](_0x39ffe5[_0x845c('0x80')]);if(_0x2122f2&&_0x2122f2[_0x845c('0x99')]){logger[_0x845c('0x35')]('['+_0x5617af[_0x845c('0x64')][_0x845c('0x9a')]()+']','Recording\x20is\x20enabled!');_0x5617af[_0x845c('0x82')]=_0x39ffe5[_0x845c('0x80')]+'/api/voice/recordings/'+_0x5617af['uniqueid']+_0x845c('0x85')+md5(_0x5617af[_0x845c('0x84')]);}else{_0x5617af['recordingURL']='';}var _0x3649fc=_0x39ffe5[_0x845c('0x7e')]===_0x845c('0x91')?'eu':_0x845c('0x86');return getAccessToken(_0x39ffe5)['then'](function(_0x28b14e){_0x124a3f=_0x28b14e;return getUser(_0x124a3f,_0x3649fc,_0x39ffe5);})[_0x845c('0x27')](function(_0x1a33a2){_0x133d95=_0x1a33a2;logger[_0x845c('0x35')](_0x845c('0x87'),_0x133d95['id']);return getEndUser(_0x124a3f,_0x3649fc,_0x39ffe5,_0x5617af[_0x845c('0x88')],_0x5617af['calleridnum'],_0x133d95,_0x43465f);})[_0x845c('0x27')](function(_0x554d32){_0x1bab9c=_0x554d32;return getCall(_0x124a3f,_0x3649fc,_0x39ffe5,_0x133d95,_0x1bab9c,_0x43465f,_0x5617af,_0x845c('0x8a'));})['then'](function(_0x7b94c7){if(_0x7b94c7){logger['info'](_0x845c('0x95'),_0x7b94c7['id']);}})['catch'](function(_0x34c194){logger['error']('['+_0x5617af['lastevent']['toUpperCase']()+']',JSON[_0x845c('0xc')](_0x34c194));});}; \ No newline at end of file +var _0x9b60=['profile','administrator','Subject','Description','getString','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','utc','mm:ss','answertime','Call_Duration','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','merge','Fields','Call\x20created!','err','queue','stripTrailingSlash','host','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','outbound','[OUTBOUND]','destcalleridname','Outbound','user:%s','unmanaged','monitor_format','toUpperCase','com','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','forEach','includes','string','picklist','idField','content','variableName','type','customVariable','Variable','name','toLowerCase','toString','indexOf','split','isNil','isBefore','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','Administrator','Using\x20the\x20admin\x20account!','user','The\x20failing\x20result\x20is','stringify','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','startCase','Error:\x20','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Owner'];(function(_0x3d75da,_0x372212){var _0x1bd83f=function(_0x3908dd){while(--_0x3908dd){_0x3d75da['push'](_0x3d75da['shift']());}};_0x1bd83f(++_0x372212);}(_0x9b60,0x174));var _0x09b6=function(_0xfd8260,_0x2f6fd0){_0xfd8260=_0xfd8260-0x0;var _0x54d8cb=_0x9b60[_0xfd8260];return _0x54d8cb;};'use strict';var _=require(_0x09b6('0x0'));var rp=require(_0x09b6('0x1'));var md5=require(_0x09b6('0x2'));var util=require(_0x09b6('0x3'));var intUtil=require(_0x09b6('0x4'));var moment=require(_0x09b6('0x5'));var Redis=require(_0x09b6('0x6'));var BPromise=require(_0x09b6('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x09b6('0x8'));config[_0x09b6('0x9')]=_[_0x09b6('0xa')](config[_0x09b6('0x9')],{'host':_0x09b6('0xb'),'port':0x18eb});var io=require(_0x09b6('0xc'))(new Redis(config[_0x09b6('0x9')]));function emit(_0x19f574,_0x3c9222,_0x3040da){io['to'](_0x19f574)[_0x09b6('0xd')](_0x3c9222,_0x3040da);}function request(_0x3df9d2){logger[_0x09b6('0xe')](_0x09b6('0xf'),JSON['stringify'](_0x3df9d2));return rp(_0x3df9d2);}function getCustomFields(_0x36986d,_0x3b9333){var _0x5b1799={};if(_0x36986d['length']>0x0){_[_0x09b6('0x10')](_0x36986d,function(_0x112184){if(_[_0x09b6('0x11')]([_0x09b6('0x12'),_0x09b6('0x13')],_0x112184['type'])&&_0x112184[_0x09b6('0x14')]){_0x5b1799[_0x112184[_0x09b6('0x14')]]=_0x112184[_0x09b6('0x15')]['toString']();}else if(_0x112184['type']==='variable'&&_0x112184[_0x09b6('0x16')]&&_0x112184[_0x09b6('0x14')]&&_0x3b9333[_0x112184[_0x09b6('0x16')]]){_0x5b1799[_0x112184[_0x09b6('0x14')]]=_0x3b9333[_0x112184[_0x09b6('0x16')]]['toString']();}else if(_0x112184[_0x09b6('0x17')]===_0x09b6('0x18')&&_0x112184[_0x09b6('0x19')]&&_0x112184[_0x09b6('0x19')][_0x09b6('0x1a')]&&_0x112184['idField']&&_0x3b9333[_0x112184[_0x09b6('0x19')][_0x09b6('0x1a')][_0x09b6('0x1b')]()]){_0x5b1799[_0x112184[_0x09b6('0x14')]]=_0x3b9333[_0x112184[_0x09b6('0x19')]['name'][_0x09b6('0x1b')]()][_0x09b6('0x1c')]();}});}return _0x5b1799;}function getName(_0x3d2b28){if(_0x3d2b28[_0x09b6('0x1d')]('\x20')>0x0){var _0xff437c=_0x3d2b28[_0x09b6('0x1e')](/ (.+)/);if(_0xff437c[0x1]){return _0xff437c;}}return[_0x3d2b28,_0x3d2b28];}var accountsTokens={};function getAccessToken(_0x4d0903){return new Promise(function(_0x3340b0,_0x4b24de){if(!_[_0x09b6('0x1f')](accountsTokens[_0x4d0903['id']])&&!_[_0x09b6('0x1f')](accountsTokens[_0x4d0903['id']]['access_token'])){if(moment()[_0x09b6('0x20')](accountsTokens[_0x4d0903['id']]['expires_in'])){_0x3340b0(accountsTokens[_0x4d0903['id']][_0x09b6('0x21')]);}}var _0x700746;switch(_0x4d0903[_0x09b6('0x22')]){case'US':_0x700746=_0x09b6('0x23');break;case'AU':_0x700746=_0x09b6('0x24');break;case'EU':_0x700746='https://accounts.zoho.eu';break;case'IN':_0x700746=_0x09b6('0x25');break;case'CN':_0x700746=_0x09b6('0x26');break;default:_0x700746=_0x09b6('0x27');break;}var _0x5c125c={'method':_0x09b6('0x28'),'uri':_0x700746+_0x09b6('0x29'),'qs':{'refresh_token':_0x4d0903[_0x09b6('0x2a')],'client_id':_0x4d0903[_0x09b6('0x2b')],'client_secret':_0x4d0903[_0x09b6('0x2c')],'grant_type':_0x09b6('0x2d')},'json':!![]};return rp(_0x5c125c)[_0x09b6('0x2e')](function(_0x348cdb){accountsTokens[_0x4d0903['id']]={'access_token':_0x348cdb['access_token'],'expires_in':moment()[_0x09b6('0x2f')](_0x348cdb['expires_in'],'seconds')};_0x3340b0(_0x348cdb[_0x09b6('0x21')]);})[_0x09b6('0x30')](function(_0x1a001c){logger[_0x09b6('0x31')](_0x09b6('0x32'),_0x1a001c[_0x09b6('0x33')]);_0x4b24de(_0x1a001c);});});}function getUser(_0x4642ac,_0x5281ff,_0x333b59,_0x3e9fba){logger[_0x09b6('0x34')]('Search\x20user');return request({'method':'GET','uri':util[_0x09b6('0x35')](_0x09b6('0x36'),_0x5281ff),'qs':{'type':_0x09b6('0x37')},'headers':{'Authorization':_0x09b6('0x38')+_0x4642ac},'json':!![]})[_0x09b6('0x2e')](function(_0x420992){if(_0x420992['users']){var _0x38847f=-0x1;if(_[_0x09b6('0x39')](_0x420992[_0x09b6('0x3a')])){if(!_[_0x09b6('0x1f')](_0x3e9fba)){_0x38847f=_[_0x09b6('0x3b')](_0x420992[_0x09b6('0x3a')],function(_0x19b9c9){return _0x19b9c9['email']===_0x3e9fba;});}if(_0x38847f>=0x0){logger[_0x09b6('0x34')]('Agent\x20found!');}else{logger[_0x09b6('0x34')]('Using\x20the\x20admin\x20account!');_0x38847f=_[_0x09b6('0x3b')](_0x420992[_0x09b6('0x3a')],function(_0x282efa){return _0x282efa['profile'][_0x09b6('0x1a')]===_0x09b6('0x3c');});}return _0x420992[_0x09b6('0x3a')][_0x38847f];}else{if(_0x420992['user']['profile'][_0x09b6('0x1a')]===_0x09b6('0x3c')){logger[_0x09b6('0x34')](_0x09b6('0x3d'));user=_0x420992[_0x09b6('0x3e')];return user;}else{logger['error'](_0x09b6('0x3f'),JSON[_0x09b6('0x40')](_0x420992));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x09b6('0x40')](_0x420992));}}}else{logger[_0x09b6('0x31')](_0x09b6('0x3f'),JSON['stringify'](_0x420992));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x420992));}})[_0x09b6('0x30')](function(_0x20a982){console[_0x09b6('0x31')](_0x20a982);});}function getZohoUser(_0x464caf,_0x9cd3c7){return new BPromise(function(_0x58affd,_0x3b7683){request(_0x464caf)[_0x09b6('0x2e')](function(_0x57373d){var _0x47e860=null;if(_0x57373d){_0x47e860=_0x57373d[_0x09b6('0x41')][0x0];_0x47e860[_0x09b6('0x42')]=_0x9cd3c7;}_0x58affd(_0x47e860);})['catch'](function(_0x975812){_0x3b7683(_0x975812);});});}function createEndUser(_0x116b2c,_0x562ec3,_0x370755,_0xb3b12f,_0x5d66f9,_0x1c6d6c){var _0x370755=getName(_0x370755);return request({'method':'POST','uri':_0x09b6('0x43')+_0x562ec3+_0x09b6('0x44')+_['startCase'](_0x1c6d6c[_0x09b6('0x45')])+'s','body':{'data':[{'Last_Name':_0x370755[0x1],'First_Name':_0x370755[0x0],'Phone':_0xb3b12f,'Owner':{'name':!_[_0x09b6('0x1f')](_0x5d66f9[_0x09b6('0x46')][_0x09b6('0x1a')])?_0x5d66f9['role']['name']:!_[_0x09b6('0x1f')](_0x5d66f9[_0x09b6('0x47')])?_0x5d66f9['first_name']+'\x20'+_0x5d66f9[_0x09b6('0x48')]:_0x5d66f9['last_name'],'id':_0x5d66f9['id']}}]},'headers':{'Authorization':_0x09b6('0x38')+_0x116b2c},'json':!![]})[_0x09b6('0x2e')](function(_0x1ca191){if(_0x1ca191&&_0x1ca191[_0x09b6('0x41')][0x0][_0x09b6('0x49')]===_0x09b6('0x4a')){var _0x1a7e1c=_0x1ca191[_0x09b6('0x41')][0x0][_0x09b6('0x4b')];_0x1a7e1c[_0x09b6('0x42')]=_[_0x09b6('0x4c')](_0x1c6d6c[_0x09b6('0x45')])+'s';return _0x1a7e1c;}logger[_0x09b6('0x31')](_0x09b6('0x3f'),JSON['stringify'](data));throw new Error(_0x09b6('0x4d')+JSON[_0x09b6('0x40')](data));})['catch'](function(_0x5e417e){console['log']('CREATE\x20ERROR',_0x5e417e);});}function getEndUser(_0xb6fe69,_0x599b3a,_0x2b2a2c,_0xbb41fc,_0xcaec39,_0x1ba44b,_0x40c810){var _0x34d523={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xb6fe69},'json':!![]};switch(_0x40c810['moduleSearch']){case'contact_lead':_0x34d523['uri']='https://www.zohoapis.'+_0x599b3a+_0x09b6('0x4e')+_0xcaec39+'))';return getZohoUser(_0x34d523,_0x09b6('0x4f'))[_0x09b6('0x2e')](function(_0x5951c8){if(_0x5951c8)return _0x5951c8;_0x34d523[_0x09b6('0x50')]=_0x09b6('0x43')+_0x599b3a+_0x09b6('0x51')+_0xcaec39+'))';return getZohoUser(_0x34d523,_0x09b6('0x52'))[_0x09b6('0x2e')](function(_0x9c2249){if(_0x9c2249)return _0x9c2249;if(_0x40c810[_0x09b6('0x45')]!=_0x09b6('0x53')){return createEndUser(_0xb6fe69,_0x599b3a,_0xbb41fc,_0xcaec39,_0x1ba44b,_0x40c810);}else{return{};}});});break;case _0x09b6('0x54'):_0x34d523[_0x09b6('0x50')]=_0x09b6('0x43')+_0x599b3a+_0x09b6('0x4e')+_0xcaec39+'))';return getZohoUser(_0x34d523,_0x09b6('0x4f'))['then'](function(_0x1d8d21){if(_0x1d8d21)return _0x1d8d21;if(_0x40c810[_0x09b6('0x45')]!=_0x09b6('0x53')){return createEndUser(_0xb6fe69,_0x599b3a,_0xbb41fc,_0xcaec39,_0x1ba44b,_0x40c810);}else{return{};}});break;case _0x09b6('0x55'):_0x34d523[_0x09b6('0x50')]=_0x09b6('0x43')+_0x599b3a+_0x09b6('0x51')+_0xcaec39+'))';return getZohoUser(_0x34d523,'Leads')[_0x09b6('0x2e')](function(_0x4bc8e0){if(_0x4bc8e0)return _0x4bc8e0;if(_0x40c810[_0x09b6('0x45')]!='nothing'){return createEndUser(_0xb6fe69,_0x599b3a,_0xbb41fc,_0xcaec39,_0x1ba44b,_0x40c810);}else{return{};}});break;}}function getCall(_0x1af32d,_0x2a21cb,_0x5a5ac0,_0x55171f,_0x14e2fd,_0x48fd28,_0x26516c,_0x54b015){logger[_0x09b6('0x34')]('Creating\x20new\x20call...');var _0x15fca5={};_0x15fca5[_0x09b6('0x56')]={'name':!_[_0x09b6('0x1f')](_0x55171f[_0x09b6('0x46')][_0x09b6('0x1a')])&&!_['isNil'](_0x55171f['profile'][_0x09b6('0x1a')])&&_0x55171f[_0x09b6('0x57')][_0x09b6('0x1a')]===_0x09b6('0x58')?_0x55171f['role'][_0x09b6('0x1a')]:!_[_0x09b6('0x1f')](_0x55171f[_0x09b6('0x47')])?_0x55171f[_0x09b6('0x47')]+'\x20'+_0x55171f[_0x09b6('0x48')]:_0x55171f['last_name'],'id':_0x55171f['id']};_0x15fca5[_0x09b6('0x59')]=intUtil['getString'](_0x48fd28['Subjects'],_0x26516c,'\x20');_0x15fca5[_0x09b6('0x5a')]=intUtil[_0x09b6('0x5b')](_0x48fd28['Descriptions'],_0x26516c,'\x0a');if(_0x14e2fd[_0x09b6('0x42')]==='Contacts'){_0x15fca5[_0x09b6('0x5c')]={'name':!_[_0x09b6('0x1f')](_0x14e2fd[_0x09b6('0x5d')])?_0x14e2fd[_0x09b6('0x5d')]:!_['isNil'](_0x14e2fd[_0x09b6('0x5e')])?_0x14e2fd[_0x09b6('0x5e')]+'\x20'+_0x14e2fd[_0x09b6('0x5f')]:_0x14e2fd['Last_Name'],'id':_0x14e2fd['id']};}if(_0x14e2fd[_0x09b6('0x42')]==='Leads'){_0x15fca5[_0x09b6('0x60')]={'name':!_[_0x09b6('0x1f')](_0x14e2fd[_0x09b6('0x5d')])?_0x14e2fd['Full_Name']:!_[_0x09b6('0x1f')](_0x14e2fd[_0x09b6('0x5e')])?_0x14e2fd[_0x09b6('0x5e')]+'\x20'+_0x14e2fd[_0x09b6('0x5f')]:_0x14e2fd[_0x09b6('0x5f')],'id':_0x14e2fd['id']};_0x15fca5['$se_module']=_['startCase'](_0x14e2fd[_0x09b6('0x42')]);}if(_0x26516c[_0x09b6('0x61')]){_0x15fca5['Call_Duration']=moment[_0x09b6('0x62')](parseInt(_0x26516c['talktime'])*0x3e8)[_0x09b6('0x35')](_0x09b6('0x63'));}else if(_0x26516c[_0x09b6('0x64')]&&_0x26516c['endtime']){_0x15fca5[_0x09b6('0x65')]=moment[_0x09b6('0x62')](moment(_0x26516c[_0x09b6('0x66')],_0x09b6('0x67'))[_0x09b6('0x68')](moment(_0x26516c[_0x09b6('0x69')],_0x09b6('0x67'))))[_0x09b6('0x35')]('mm:ss');}switch(_0x26516c[_0x09b6('0x6a')]){case'called':_0x15fca5[_0x09b6('0x6b')]=_0x09b6('0x6c');break;case _0x09b6('0x6d'):case _0x09b6('0x6e'):_0x15fca5[_0x09b6('0x6b')]=_0x09b6('0x6f');break;case _0x09b6('0x70'):_0x15fca5['Call_Result']=_0x09b6('0x71');break;case _0x09b6('0x72'):_0x15fca5[_0x09b6('0x6b')]=_0x09b6('0x73');break;case _0x09b6('0x74'):_0x15fca5[_0x09b6('0x6b')]=_0x09b6('0x75');default:}_0x15fca5[_0x09b6('0x76')]=(_0x54b015==='outbound'?moment(_0x26516c[_0x09b6('0x69')])[_0x09b6('0x35')](_0x09b6('0x67')):moment(_0x26516c[_0x09b6('0x77')])[_0x09b6('0x35')](_0x09b6('0x67')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x15fca5[_0x09b6('0x78')]=_0x54b015||'Inbound';_0x15fca5=_[_0x09b6('0x79')](_0x15fca5,getCustomFields(_0x48fd28[_0x09b6('0x7a')],_0x26516c));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x2a21cb+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1af32d},'body':{'data':[_0x15fca5]},'json':!![]})['then'](function(_0x30412a){if(_0x30412a&&_0x30412a[_0x09b6('0x41')][0x0][_0x09b6('0x49')]===_0x09b6('0x4a')){logger[_0x09b6('0x34')](_0x09b6('0x7b'));return{'id':_0x30412a['data'][0x0]['details']['id']};}})['catch'](function(_0x3a4783){logger['info'](_0x09b6('0x7c'),_0x3a4783[_0x09b6('0x33')]);console['log']('err',_0x3a4783);});}exports[_0x09b6('0x7d')]=function(_0x3bf6eb,_0x569c7b,_0x2df3d8,_0x168812,_0x26423e,_0x5550bb){var _0x5722d7,_0x29d385,_0x24cfd4;_0x5550bb['host']=intUtil[_0x09b6('0x7e')](_0x5550bb[_0x09b6('0x7f')]);_0x5550bb[_0x09b6('0x80')]=intUtil[_0x09b6('0x7e')](_0x5550bb[_0x09b6('0x80')]);if(_0x26423e&&_0x26423e['monitor_format']){logger[_0x09b6('0x34')](_0x09b6('0x81'),_0x09b6('0x82'));_0x569c7b[_0x09b6('0x83')]=_0x5550bb[_0x09b6('0x80')]+_0x09b6('0x84')+_0x569c7b[_0x09b6('0x85')]+_0x09b6('0x86')+md5(_0x569c7b[_0x09b6('0x85')]);}else{_0x569c7b[_0x09b6('0x83')]='';}var _0x43f768=_0x5550bb['host']===_0x09b6('0x87')?'eu':'com';return getAccessToken(_0x5550bb)[_0x09b6('0x2e')](function(_0x167ec2){_0x24cfd4=_0x167ec2;return getUser(_0x24cfd4,_0x43f768,_0x5550bb,_0x168812[_0x09b6('0x88')]);})['then'](function(_0x32e5da){_0x5722d7=_0x32e5da;logger[_0x09b6('0x34')](_0x09b6('0x89'),_0x5722d7['id']);return getEndUser(_0x24cfd4,_0x43f768,_0x5550bb,_0x569c7b[_0x09b6('0x8a')],_0x569c7b[_0x09b6('0x8b')],_0x5722d7,_0x2df3d8);})[_0x09b6('0x2e')](function(_0x26b386){_0x29d385=_0x26b386;return getCall(_0x24cfd4,_0x43f768,_0x5550bb,_0x5722d7,_0x29d385,_0x2df3d8,_0x569c7b,_0x09b6('0x8c'));})[_0x09b6('0x2e')](function(_0x393d47){if(_0x393d47){logger[_0x09b6('0x34')](_0x09b6('0x8d'),_0x393d47['id']);logger[_0x09b6('0x34')](_0x09b6('0x81'),_0x09b6('0x8e'));emit(util[_0x09b6('0x35')]('user:%s',_0x168812[_0x09b6('0x1a')]),'trigger:browser:url',{'uri':'https://crm.'+_0x5550bb[_0x09b6('0x7f')]+_0x09b6('0x8f')+_0x393d47['id']});}})['catch'](function(_0x5af218){logger[_0x09b6('0x31')](_0x09b6('0x81'),JSON[_0x09b6('0x40')](_0x5af218));});};exports[_0x09b6('0x90')]=function(_0x36d21b,_0x3be17a,_0x251676,_0x2c2b98,_0x18b2dc,_0x4255cd,_0x223806){var _0xb02a25,_0x4dc471,_0x316125;_0x4255cd[_0x09b6('0x7f')]=intUtil['stripTrailingSlash'](_0x4255cd['host']);_0x4255cd[_0x09b6('0x80')]=intUtil[_0x09b6('0x7e')](_0x4255cd['serverUrl']);if(_0x223806&&_0x223806['recordingFormat']&&_0x223806['recordingFormat']!=='none'){logger[_0x09b6('0x34')](_0x09b6('0x91'),_0x09b6('0x82'));_0x3be17a[_0x09b6('0x83')]=_0x4255cd[_0x09b6('0x80')]+_0x09b6('0x84')+_0x3be17a[_0x09b6('0x85')]+_0x09b6('0x86')+md5(_0x3be17a[_0x09b6('0x85')]);}var _0xe5c702=_0x4255cd['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x4255cd)['then'](function(_0x3f1599){_0x316125=_0x3f1599;return getUser(_0x316125,_0xe5c702,_0x4255cd,_0x2c2b98['email']);})['then'](function(_0x54e415){_0xb02a25=_0x54e415;logger['info']('The\x20User\x20ID\x20is:',_0xb02a25['id']);return getEndUser(_0x316125,_0xe5c702,_0x4255cd,_0x3be17a[_0x09b6('0x92')],_0x3be17a['destcalleridnum'],_0xb02a25,_0x251676);})[_0x09b6('0x2e')](function(_0x6037fa){_0x4dc471=_0x6037fa;return getCall(_0x316125,_0xe5c702,_0x4255cd,_0xb02a25,_0x4dc471,_0x251676,_0x3be17a,_0x09b6('0x93'));})['then'](function(_0x50cdc4){if(_0x50cdc4){logger[_0x09b6('0x34')](_0x09b6('0x8d'),_0x50cdc4['id']);logger[_0x09b6('0x34')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x09b6('0x35')](_0x09b6('0x94'),_0x2c2b98[_0x09b6('0x1a')]),'trigger:browser:url',{'uri':'https://crm.'+_0x4255cd[_0x09b6('0x7f')]+_0x09b6('0x8f')+_0x50cdc4['id']});}})[_0x09b6('0x30')](function(_0x1382f5){logger['error']('[OUTBOUND]',JSON[_0x09b6('0x40')](_0x1382f5));});};exports[_0x09b6('0x95')]=function(_0x5a98fa,_0x32edf6,_0x4969f1,_0x32d283,_0x3f2a10,_0xc676e1){var _0x5376e8,_0x2ad08f,_0x2502a5;_0xc676e1[_0x09b6('0x7f')]=intUtil['stripTrailingSlash'](_0xc676e1[_0x09b6('0x7f')]);_0xc676e1[_0x09b6('0x80')]=intUtil['stripTrailingSlash'](_0xc676e1['serverUrl']);if(_0x3f2a10&&_0x3f2a10[_0x09b6('0x96')]){logger[_0x09b6('0x34')]('['+_0x32edf6['lastevent'][_0x09b6('0x97')]()+']',_0x09b6('0x82'));_0x32edf6[_0x09b6('0x83')]=_0xc676e1[_0x09b6('0x80')]+'/api/voice/recordings/'+_0x32edf6[_0x09b6('0x85')]+_0x09b6('0x86')+md5(_0x32edf6['uniqueid']);}else{_0x32edf6['recordingURL']='';}var _0xcbeede=_0xc676e1['host']===_0x09b6('0x87')?'eu':_0x09b6('0x98');return getAccessToken(_0xc676e1)['then'](function(_0x17e281){_0x2502a5=_0x17e281;return getUser(_0x2502a5,_0xcbeede,_0xc676e1);})[_0x09b6('0x2e')](function(_0x3dfd8b){_0x5376e8=_0x3dfd8b;logger['info'](_0x09b6('0x89'),_0x5376e8['id']);return getEndUser(_0x2502a5,_0xcbeede,_0xc676e1,_0x32edf6[_0x09b6('0x8a')],_0x32edf6[_0x09b6('0x8b')],_0x5376e8,_0x4969f1);})[_0x09b6('0x2e')](function(_0x58a18f){_0x2ad08f=_0x58a18f;return getCall(_0x2502a5,_0xcbeede,_0xc676e1,_0x5376e8,_0x2ad08f,_0x4969f1,_0x32edf6,_0x09b6('0x8c'));})[_0x09b6('0x2e')](function(_0x5604bc){if(_0x5604bc){logger['info'](_0x09b6('0x8d'),_0x5604bc['id']);}})[_0x09b6('0x30')](function(_0x2b1cf3){logger['error']('['+_0x32edf6[_0x09b6('0x6a')]['toUpperCase']()+']',JSON['stringify'](_0x2b1cf3));});}; \ 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 f6986e4..fb9c3fd 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 _0xd5c3=['render','exec','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','Script','data3'];(function(_0x54d95c,_0x2226b1){var _0x3b0ccd=function(_0x19409e){while(--_0x19409e){_0x54d95c['push'](_0x54d95c['shift']());}};_0x3b0ccd(++_0x2226b1);}(_0xd5c3,0x155));var _0x3d5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd5c3[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x3d5c('0x0'));var sh=require(_0x3d5c('0x1'));var Mustache=require(_0x3d5c('0x2'));var logger=require(_0x3d5c('0x3'))(_0x3d5c('0x4'));exports['exec']=function(_0x12aaa9,_0x344b07){var _0x594333=_0x12aaa9['data2']?_0x12aaa9['data2']:_0x3d5c('0x5');var _0xc013a7=_0x12aaa9[_0x3d5c('0x6')]?Mustache[_0x3d5c('0x7')](_0x12aaa9[_0x3d5c('0x6')],_0x344b07):_0x344b07;sh[_0x3d5c('0x8')](_0xc013a7,function(_0x30a050,_0x22672b,_0xb8081d){if(_0x30a050!==0x0){logger['error'](util[_0x3d5c('0x9')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x594333,_0xc013a7,_0x30a050,_0xb8081d));}else{logger[_0x3d5c('0xa')](util[_0x3d5c('0x9')](_0x3d5c('0xb'),_0x594333,_0xc013a7,_0x22672b));}});}; \ No newline at end of file +var _0xb906=['data3','render','error','format','info','shelljs','../../../../config/logger','trigger','exec','data2','Script'];(function(_0x451a11,_0x4b9c54){var _0xd01af2=function(_0x296065){while(--_0x296065){_0x451a11['push'](_0x451a11['shift']());}};_0xd01af2(++_0x4b9c54);}(_0xb906,0xec));var _0x6b90=function(_0x2cd282,_0x531316){_0x2cd282=_0x2cd282-0x0;var _0x18acd4=_0xb906[_0x2cd282];return _0x18acd4;};'use strict';var util=require('util');var sh=require(_0x6b90('0x0'));var Mustache=require('mustache');var logger=require(_0x6b90('0x1'))(_0x6b90('0x2'));exports[_0x6b90('0x3')]=function(_0x1b0ab5,_0x14d066){var _0xb88cc3=_0x1b0ab5[_0x6b90('0x4')]?_0x1b0ab5[_0x6b90('0x4')]:_0x6b90('0x5');var _0x375d8c=_0x1b0ab5[_0x6b90('0x6')]?Mustache[_0x6b90('0x7')](_0x1b0ab5[_0x6b90('0x6')],_0x14d066):_0x14d066;sh[_0x6b90('0x3')](_0x375d8c,function(_0xafeb79,_0x3f6ab6,_0x5512a2){if(_0xafeb79!==0x0){logger[_0x6b90('0x8')](util[_0x6b90('0x9')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0xb88cc3,_0x375d8c,_0xafeb79,_0x5512a2));}else{logger[_0x6b90('0xa')](util[_0x6b90('0x9')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0xb88cc3,_0x375d8c,_0x3f6ab6));}});}; \ 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 d2fdf5b..1df0397 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 _0xf242=['mustache','../../../../config/logger','trigger','toUpperCase','data2','data5','number','headers','data6','render','error','stack','data1','GET','DELETE','POST','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf242,0x105));var _0x2f24=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0xf242[_0x5d61b4];return _0x183fc5;};'use strict';var rp=require(_0x2f24('0x0'));var util=require(_0x2f24('0x1'));var _=require(_0x2f24('0x2'));var Mustache=require(_0x2f24('0x3'));var logger=require(_0x2f24('0x4'))(_0x2f24('0x5'));exports['exec']=function(_0x26978f,_0x3fcfcd){var _0x390f1b,_0x4be3cc;var _0x3189e0={'method':_0x26978f['data1'][_0x2f24('0x6')](),'uri':Mustache['render'](_0x26978f[_0x2f24('0x7')],_0x3fcfcd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x26978f[_0x2f24('0x8')])===_0x2f24('0x9')&&parseInt(_0x26978f[_0x2f24('0x8')])>=0x1&&parseInt(_0x26978f[_0x2f24('0x8')])<=0xa?parseInt(_0x26978f[_0x2f24('0x8')])*0x3e8:0x5*0x3e8};try{_0x3189e0[_0x2f24('0xa')]=_0x26978f[_0x2f24('0xb')]?JSON['parse'](Mustache[_0x2f24('0xc')](_0x26978f['data6'],_0x3fcfcd)):{};}catch(_0x639860){logger[_0x2f24('0xd')](_0x639860[_0x2f24('0xe')]);}switch(_0x26978f[_0x2f24('0xf')][_0x2f24('0x6')]()){case _0x2f24('0x10'):case _0x2f24('0x11'):_0x390f1b=null;_0x3189e0['qs']=_0x3fcfcd;break;case _0x2f24('0x12'):case'PUT':if(_0x26978f[_0x2f24('0x13')]){try{_0x390f1b=JSON['parse'](Mustache['render'](_0x26978f['data7'],_0x3fcfcd));_0x3189e0[_0x2f24('0x14')]=_0x390f1b;}catch(_0x3315ba){logger[_0x2f24('0xd')](_0x3315ba[_0x2f24('0xe')]);logger[_0x2f24('0xd')](_0x2f24('0x15'));}}else{_0x390f1b=_0x3fcfcd;_0x3189e0[_0x2f24('0x14')]=_0x390f1b;}break;}logger[_0x2f24('0x16')](util[_0x2f24('0x17')](_0x2f24('0x18'),_0x26978f['data1'],_0x26978f['data2'],JSON[_0x2f24('0x19')](_0x3189e0)));rp(_0x3189e0)['then'](function(_0x4ade49){_0x390f1b=!_[_0x2f24('0x1a')](_0x390f1b)?_0x2f24('0x1b')+_0x390f1b:'';_0x4be3cc=typeof _0x4ade49['body']==='object'?JSON[_0x2f24('0x19')](_0x4ade49[_0x2f24('0x14')]):_0x4ade49['body'];logger[_0x2f24('0x16')](util[_0x2f24('0x17')](_0x2f24('0x1c'),_0x26978f[_0x2f24('0xf')],_0x26978f[_0x2f24('0x7')],_0x4ade49[_0x2f24('0x1d')],_0x4be3cc));})['catch'](function(_0x57e3b4){logger[_0x2f24('0xd')](util[_0x2f24('0x17')](_0x2f24('0x1e'),_0x26978f[_0x2f24('0xf')],_0x26978f[_0x2f24('0x7')],_0x57e3b4[_0x2f24('0x1d')],_0x57e3b4[_0x2f24('0x1f')],_0x57e3b4[_0x2f24('0x20')]));});}; \ No newline at end of file +var _0x2d58=['data5','headers','data6','parse','error','stack','toUpperCase','DELETE','POST','data7','render','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','util','lodash','mustache','../../../../config/logger','trigger','data1','data2','number'];(function(_0x16e0f5,_0x4ec0f3){var _0x4839d5=function(_0x296b8f){while(--_0x296b8f){_0x16e0f5['push'](_0x16e0f5['shift']());}};_0x4839d5(++_0x4ec0f3);}(_0x2d58,0x1d4));var _0x82d5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2d58[_0x122ef9];return _0x42fba0;};'use strict';var rp=require('request-promise');var util=require(_0x82d5('0x0'));var _=require(_0x82d5('0x1'));var Mustache=require(_0x82d5('0x2'));var logger=require(_0x82d5('0x3'))(_0x82d5('0x4'));exports['exec']=function(_0x33e871,_0x1fe428){var _0x64b957,_0x246d75;var _0x246205={'method':_0x33e871[_0x82d5('0x5')]['toUpperCase'](),'uri':Mustache['render'](_0x33e871[_0x82d5('0x6')],_0x1fe428),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x33e871['data5'])===_0x82d5('0x7')&&parseInt(_0x33e871[_0x82d5('0x8')])>=0x1&&parseInt(_0x33e871[_0x82d5('0x8')])<=0xa?parseInt(_0x33e871[_0x82d5('0x8')])*0x3e8:0x5*0x3e8};try{_0x246205[_0x82d5('0x9')]=_0x33e871[_0x82d5('0xa')]?JSON[_0x82d5('0xb')](Mustache['render'](_0x33e871[_0x82d5('0xa')],_0x1fe428)):{};}catch(_0x3a146b){logger[_0x82d5('0xc')](_0x3a146b[_0x82d5('0xd')]);}switch(_0x33e871[_0x82d5('0x5')][_0x82d5('0xe')]()){case'GET':case _0x82d5('0xf'):_0x64b957=null;_0x246205['qs']=_0x1fe428;break;case _0x82d5('0x10'):case'PUT':if(_0x33e871[_0x82d5('0x11')]){try{_0x64b957=JSON[_0x82d5('0xb')](Mustache[_0x82d5('0x12')](_0x33e871[_0x82d5('0x11')],_0x1fe428));_0x246205['body']=_0x64b957;}catch(_0x4be487){logger['error'](_0x4be487[_0x82d5('0xd')]);logger[_0x82d5('0xc')](_0x82d5('0x13'));}}else{_0x64b957=_0x1fe428;_0x246205[_0x82d5('0x14')]=_0x64b957;}break;}logger[_0x82d5('0x15')](util[_0x82d5('0x16')](_0x82d5('0x17'),_0x33e871['data1'],_0x33e871[_0x82d5('0x6')],JSON[_0x82d5('0x18')](_0x246205)));rp(_0x246205)[_0x82d5('0x19')](function(_0x4982d7){_0x64b957=!_[_0x82d5('0x1a')](_0x64b957)?_0x82d5('0x1b')+_0x64b957:'';_0x246d75=typeof _0x4982d7[_0x82d5('0x14')]===_0x82d5('0x1c')?JSON[_0x82d5('0x18')](_0x4982d7[_0x82d5('0x14')]):_0x4982d7['body'];logger[_0x82d5('0x15')](util[_0x82d5('0x16')](_0x82d5('0x1d'),_0x33e871[_0x82d5('0x5')],_0x33e871['data2'],_0x4982d7['statusCode'],_0x246d75));})['catch'](function(_0x2a5d4f){logger[_0x82d5('0xc')](util['format'](_0x82d5('0x1e'),_0x33e871[_0x82d5('0x5')],_0x33e871[_0x82d5('0x6')],_0x2a5d4f[_0x82d5('0x1f')],_0x2a5d4f[_0x82d5('0x20')],_0x2a5d4f[_0x82d5('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 86af19a..50fd0e6 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 _0xcf0e=['http','Request','request','then','debug','error','rpc','message','result','catch','exports','../../config/logger','routing'];(function(_0x34c644,_0x4d7e72){var _0x3f005c=function(_0x49e012){while(--_0x49e012){_0x34c644['push'](_0x34c644['shift']());}};_0x3f005c(++_0x4d7e72);}(_0xcf0e,0xa7));var _0xecf0=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xcf0e[_0x2a6809];return _0x11c371;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xecf0('0x0'))(_0xecf0('0x1'));var client=jayson['client'][_0xecf0('0x2')]({'port':0x2329});client[_0xecf0('0x3')]=function(_0x2f253f,_0xee99ac){return new BPromise(function(_0x5e6629,_0x13eaea){return client[_0xecf0('0x4')](_0x2f253f,_0xee99ac)[_0xecf0('0x5')](function(_0x5d17ba){logger[_0xecf0('0x6')]('rpc',_0xecf0('0x1'),_0x2f253f,_0xee99ac,_0x5d17ba);if(_0x5d17ba[_0xecf0('0x7')]){logger['error'](_0xecf0('0x8'),_0xecf0('0x1'),_0x2f253f,_0x5d17ba[_0xecf0('0x7')][_0xecf0('0x9')],_0xee99ac);return _0x13eaea(_0x5d17ba['error'][_0xecf0('0x9')]);}else{return _0x5e6629(_0x5d17ba[_0xecf0('0xa')]);}})[_0xecf0('0xb')](function(_0xe922a){logger[_0xecf0('0x7')](_0xecf0('0x8'),_0xecf0('0x1'),_0x2f253f,_0xe922a,_0xee99ac);return _0x13eaea(_0xe922a);});});};module[_0xecf0('0xc')]=client; \ No newline at end of file +var _0xaa3a=['client','Request','request','then','debug','error','rpc','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xaa3a,0x14c));var _0xaaa3=function(_0x8e7772,_0x9d77b0){_0x8e7772=_0x8e7772-0x0;var _0x408200=_0xaa3a[_0x8e7772];return _0x408200;};'use strict';var jayson=require(_0xaaa3('0x0'));var BPromise=require(_0xaaa3('0x1'));var logger=require(_0xaaa3('0x2'))(_0xaaa3('0x3'));var client=jayson[_0xaaa3('0x4')]['http']({'port':0x2329});client[_0xaaa3('0x5')]=function(_0x27d0a9,_0x33ac9b){return new BPromise(function(_0x3d1ac9,_0x57621b){return client[_0xaaa3('0x6')](_0x27d0a9,_0x33ac9b)[_0xaaa3('0x7')](function(_0x228b48){logger[_0xaaa3('0x8')]('rpc',_0xaaa3('0x3'),_0x27d0a9,_0x33ac9b,_0x228b48);if(_0x228b48['error']){logger[_0xaaa3('0x9')](_0xaaa3('0xa'),_0xaaa3('0x3'),_0x27d0a9,_0x228b48['error'][_0xaaa3('0xb')],_0x33ac9b);return _0x57621b(_0x228b48[_0xaaa3('0x9')][_0xaaa3('0xb')]);}else{return _0x3d1ac9(_0x228b48['result']);}})[_0xaaa3('0xc')](function(_0x57a9d4){logger[_0xaaa3('0x9')]('rpc',_0xaaa3('0x3'),_0x27d0a9,_0x57a9d4,_0x33ac9b);return _0x57621b(_0x57a9d4);});});};module[_0xaaa3('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 469df42..5efcaf3 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 _0x8f2e=['resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/setting','../../config/logger','email'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0x8f2e,0xa5));var _0xe8f2=function(_0x41b740,_0x5b8936){_0x41b740=_0x41b740-0x0;var _0x268739=_0x8f2e[_0x41b740];return _0x268739;};'use strict';var server=require('./server');var Realtime=require(_0xe8f2('0x0'));var EmailChannel=require(_0xe8f2('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xe8f2('0x2'));var logger=require(_0xe8f2('0x3'))(_0xe8f2('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xe8f2('0x5')]()[_0xe8f2('0x6')](mailAccount[_0xe8f2('0x7')]())['then'](realtime[_0xe8f2('0x8')]())[_0xe8f2('0x6')](function(){email[_0xe8f2('0x9')](realtime[_0xe8f2('0xa')]);return realtime;});}function main(){return server[_0xe8f2('0xb')](realtime,email)[_0xe8f2('0x6')](function(){return initRealtime();})[_0xe8f2('0x6')](function(){return setting[_0xe8f2('0xc')]();})[_0xe8f2('0x6')](function(_0x98dba6){return setInterval(initRealtime,_0x98dba6[_0xe8f2('0xd')]*0x3e8);})[_0xe8f2('0xe')](function(_0xb7fd80){logger[_0xe8f2('0xf')](_0xe8f2('0x10'),_0xb7fd80);});}main(); \ No newline at end of file +var _0xe96d=['then','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','catch','./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve'];(function(_0x559443,_0x4eb8b6){var _0x246c41=function(_0x2e5eb2){while(--_0x2e5eb2){_0x559443['push'](_0x559443['shift']());}};_0x246c41(++_0x4eb8b6);}(_0xe96d,0xbd));var _0xde96=function(_0x20113b,_0x3c460d){_0x20113b=_0x20113b-0x0;var _0x574908=_0xe96d[_0x20113b];return _0x574908;};'use strict';var server=require('./server');var Realtime=require(_0xde96('0x0'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xde96('0x1'));var setting=require(_0xde96('0x2'));var logger=require(_0xde96('0x3'))(_0xde96('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xde96('0x5')]()[_0xde96('0x6')](mailAccount['getMailAccounts']())[_0xde96('0x6')](realtime[_0xde96('0x7')]())[_0xde96('0x6')](function(){email[_0xde96('0x8')](realtime[_0xde96('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting[_0xde96('0xa')]();})['then'](function(_0x31daec){return setInterval(initRealtime,_0x31daec[_0xde96('0xb')]*0x3e8);})[_0xde96('0xc')](function(_0x29690e){logger['error']('Email\x20service\x20initialization',_0x29690e);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index b2e5955..45a5c8d 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 _0x23d9=['imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','status','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','verifySmtp','Smtp','lastSync','verify','verified','exports','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','email','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts'];(function(_0xb0db87,_0x5c8d71){var _0x4a68e1=function(_0x4a5b17){while(--_0x4a5b17){_0xb0db87['push'](_0xb0db87['shift']());}};_0x4a68e1(++_0x5c8d71);}(_0x23d9,0x113));var _0x923d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x23d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x923d('0x0'));var moment=require(_0x923d('0x1'));var BPromise=require(_0x923d('0x2'));var md5=require('md5');var Redis=require(_0x923d('0x3'));var config=require(_0x923d('0x4'));var logger=require(_0x923d('0x5'))(_0x923d('0x6'));config['redis']=_['defaults'](config[_0x923d('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x923d('0x8'))(new Redis(config[_0x923d('0x7')]));var EmailImap=require(_0x923d('0x9'));var EmailSmtp=require(_0x923d('0xa'));var mailAccount=require(_0x923d('0xb'));var md5Accounts={};function EmailChannel(_0x724936){logger[_0x923d('0xc')](_0x923d('0xd'));this[_0x923d('0xe')]=_0x724936[_0x923d('0xe')];this[_0x923d('0xf')]={};this[_0x923d('0x10')]=new EmailSmtp();}EmailChannel[_0x923d('0x11')][_0x923d('0x12')]=function(_0x470d71){var _0xaa2db=this[_0x923d('0xe')][_0x470d71];var _0x20f63d={'id':_0xaa2db['id'],'name':_0xaa2db[_0x923d('0x13')],'key':_0xaa2db[_0x923d('0x14')],'active':_0xaa2db[_0x923d('0x15')],'Imap':{'status':_0xaa2db[_0x923d('0x16')]['status'],'messageStatus':_0xaa2db[_0x923d('0x16')][_0x923d('0x17')],'total':_0xaa2db[_0x923d('0x16')][_0x923d('0x18')]}};if(_[_0x923d('0x19')](md5Accounts[_0x470d71])){md5Accounts[_0x470d71]={};}var _0x108d57=md5(JSON[_0x923d('0x1a')](_0x20f63d));if(md5Accounts[_0x470d71][_0x923d('0x1b')]!==_0x108d57){md5Accounts[_0x470d71][_0x923d('0x1b')]=_0x108d57;io[_0x923d('0x12')](_0x923d('0x1c'),_0x20f63d);}};EmailChannel['prototype'][_0x923d('0x1d')]=function(_0x4e6321){for(var _0x32c553 in _0x4e6321){if(_0x4e6321[_0x923d('0x1e')](_0x32c553)){if(_0x4e6321[_0x32c553][_0x923d('0x16')]&&_0x4e6321[_0x32c553][_0x923d('0x15')]){var _0x5e113b=_0x4e6321[_0x32c553][_0x923d('0x16')];if(!_0x5e113b[_0x923d('0x1f')]&&_0x4e6321[_0x32c553][_0x923d('0x20')]!==_0x923d('0x21'))_0x5e113b[_0x923d('0x1f')]=_0x4e6321[_0x32c553]['provider'];if(!this[_0x923d('0xf')][_0x923d('0x1e')](_0x5e113b['id'])){this[_0x923d('0xf')][_0x5e113b['id']]=new EmailImap(_0x5e113b,_0x4e6321[_0x32c553][_0x923d('0x6')]);this[_0x923d('0xf')][_0x5e113b['id']]['on'](_0x923d('0x22'),this['handleImapBox'][_0x923d('0x23')](this,_0x32c553));this['imapAccounts'][_0x5e113b['id']]['on'](_0x923d('0x6'),this[_0x923d('0x24')]['bind'](this,_0x32c553));this[_0x923d('0xf')][_0x5e113b['id']]['on'](_0x923d('0x25'),this[_0x923d('0x26')]['bind'](this,_0x32c553));this[_0x923d('0xf')][_0x5e113b['id']]['on'](_0x923d('0x27'),this[_0x923d('0x28')]['bind'](this,_0x32c553));}}else{if(_[_0x923d('0x19')](this[_0x923d('0xe')][_0x32c553][_0x923d('0x16')])){this[_0x923d('0xe')][_0x32c553][_0x923d('0x16')]={};}this[_0x923d('0xe')][_0x32c553][_0x923d('0x16')][_0x923d('0x29')]=_0x923d('0x2a');this[_0x923d('0xe')][_0x32c553][_0x923d('0x16')][_0x923d('0x17')]='';this[_0x923d('0x12')](_0x32c553);}}}};EmailChannel[_0x923d('0x11')]['handleImapBox']=function(_0x431a6e,_0x30196d){if(this[_0x923d('0xe')][_0x431a6e]){this[_0x923d('0xe')][_0x431a6e][_0x923d('0x16')][_0x923d('0x29')]=_0x923d('0x2b');this[_0x923d('0xe')][_0x431a6e][_0x923d('0x16')][_0x923d('0x17')]=_0x30196d['name'];if(_0x30196d[_0x923d('0x2c')]){this['mailAccounts'][_0x431a6e][_0x923d('0x16')][_0x923d('0x18')]=_0x30196d[_0x923d('0x2c')][_0x923d('0x18')];}return this[_0x923d('0x12')](_0x431a6e);}};EmailChannel[_0x923d('0x11')][_0x923d('0x24')]=function(_0x24d59b,_0x43020e){logger[_0x923d('0xc')](_0x923d('0x2d'),_0x43020e['firstName'],_0x43020e[_0x923d('0x2e')],_0x43020e[_0x923d('0x2f')],_0x24d59b);if(this[_0x923d('0xe')][_0x24d59b]){return mailAccount[_0x923d('0x30')](_0x24d59b,_0x43020e)[_0x923d('0x31')](function(_0x15964c){if(_0x15964c){logger[_0x923d('0xc')](_0x923d('0x32'));}})[_0x923d('0x33')](function(_0x1a8b57){logger[_0x923d('0x27')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x923d('0x1a')](_0x1a8b57));});}};EmailChannel[_0x923d('0x11')]['handleImapEnd']=function(_0x28d2e7){if(this[_0x923d('0xe')][_0x28d2e7]&&this[_0x923d('0xe')][_0x28d2e7][_0x923d('0x16')]){if(this[_0x923d('0xf')][this['mailAccounts'][_0x28d2e7][_0x923d('0x16')]['id']]){delete this[_0x923d('0xf')][this[_0x923d('0xe')][_0x28d2e7][_0x923d('0x16')]['id']];}this['mailAccounts'][_0x28d2e7][_0x923d('0x16')]['lastSync']=moment();this[_0x923d('0x12')](_0x28d2e7);}};EmailChannel['prototype'][_0x923d('0x28')]=function(_0xe4525c,_0x3cae8e){if(this[_0x923d('0xe')][_0xe4525c]){this[_0x923d('0xe')][_0xe4525c][_0x923d('0x16')]['status']='error';this[_0x923d('0xe')][_0xe4525c][_0x923d('0x16')][_0x923d('0x17')]=_0x3cae8e;return this[_0x923d('0x12')](_0xe4525c);}};EmailChannel[_0x923d('0x11')]['sendMail']=function(_0x5a2c94,_0x1450bd){return this[_0x923d('0x10')]['send'](_0x5a2c94,_0x1450bd);};EmailChannel[_0x923d('0x11')][_0x923d('0x34')]=function(_0x4ff726){var _0x65704b=this;if(this[_0x923d('0xe')][_0x4ff726['id']]){if(_['isNil'](this[_0x923d('0xe')][_0x4ff726['id']][_0x923d('0x35')])){this[_0x923d('0xe')][_0x4ff726['id']][_0x923d('0x35')]={};}this['mailAccounts'][_0x4ff726['id']][_0x923d('0x35')][_0x923d('0x36')]=moment();return new BPromise(function(_0x595c70,_0x68181d){return _0x65704b[_0x923d('0x10')][_0x923d('0x37')](_0x4ff726)[_0x923d('0x31')](function(_0x272be9){_0x65704b[_0x923d('0xe')][_0x4ff726['id']]['Smtp'][_0x923d('0x29')]=_0x923d('0x38');_0x65704b[_0x923d('0xe')][_0x4ff726['id']][_0x923d('0x35')]['messageStatus']='';_0x65704b['emit'](_0x4ff726['id']);_0x595c70(_0x272be9);})['catch'](function(_0xa9354){_0x65704b[_0x923d('0xe')][_0x4ff726['id']][_0x923d('0x35')][_0x923d('0x29')]='error';_0x65704b['mailAccounts'][_0x4ff726['id']][_0x923d('0x35')][_0x923d('0x17')]=_0xa9354;_0x65704b[_0x923d('0x12')](_0x4ff726['id']);_0x68181d(_0xa9354);});});}return this[_0x923d('0x10')][_0x923d('0x37')](_0x4ff726);};module[_0x923d('0x39')]=EmailChannel; \ No newline at end of file +var _0x3785=['from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','send','verifySmtp','Smtp','lastSync','verify','verified','exports','lodash','moment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','info','mailAccounts','imapAccounts','smtp','prototype','name','active','Imap','status','messageStatus','stringify','md5','emit','refresh','service','custom','provider','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','disabled','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x3785,0x72));var _0x5378=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0x3785[_0x515afd];return _0x536d53;};'use strict';var _=require(_0x5378('0x0'));var moment=require(_0x5378('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x5378('0x2'))(_0x5378('0x3'));config[_0x5378('0x4')]=_['defaults'](config[_0x5378('0x4')],{'host':_0x5378('0x5'),'port':0x18eb});var io=require(_0x5378('0x6'))(new Redis(config['redis']));var EmailImap=require(_0x5378('0x7'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x2ff3a){logger[_0x5378('0x8')]('start\x20email\x20channel');this[_0x5378('0x9')]=_0x2ff3a[_0x5378('0x9')];this[_0x5378('0xa')]={};this[_0x5378('0xb')]=new EmailSmtp();}EmailChannel[_0x5378('0xc')]['emit']=function(_0x3cb352){var _0x5393a5=this['mailAccounts'][_0x3cb352];var _0x198971={'id':_0x5393a5['id'],'name':_0x5393a5[_0x5378('0xd')],'key':_0x5393a5['key'],'active':_0x5393a5[_0x5378('0xe')],'Imap':{'status':_0x5393a5[_0x5378('0xf')][_0x5378('0x10')],'messageStatus':_0x5393a5[_0x5378('0xf')][_0x5378('0x11')],'total':_0x5393a5[_0x5378('0xf')]['total']}};if(_['isNil'](md5Accounts[_0x3cb352])){md5Accounts[_0x3cb352]={};}var _0x26a320=md5(JSON[_0x5378('0x12')](_0x198971));if(md5Accounts[_0x3cb352][_0x5378('0x13')]!==_0x26a320){md5Accounts[_0x3cb352][_0x5378('0x13')]=_0x26a320;io[_0x5378('0x14')]('mailAccount:update',_0x198971);}};EmailChannel[_0x5378('0xc')][_0x5378('0x15')]=function(_0x26bfd1){for(var _0x567768 in _0x26bfd1){if(_0x26bfd1['hasOwnProperty'](_0x567768)){if(_0x26bfd1[_0x567768]['Imap']&&_0x26bfd1[_0x567768]['active']){var _0x45ba7e=_0x26bfd1[_0x567768][_0x5378('0xf')];if(!_0x45ba7e[_0x5378('0x16')]&&_0x26bfd1[_0x567768]['provider']!==_0x5378('0x17'))_0x45ba7e[_0x5378('0x16')]=_0x26bfd1[_0x567768][_0x5378('0x18')];if(!this[_0x5378('0xa')]['hasOwnProperty'](_0x45ba7e['id'])){this[_0x5378('0xa')][_0x45ba7e['id']]=new EmailImap(_0x45ba7e,_0x26bfd1[_0x567768][_0x5378('0x3')]);this[_0x5378('0xa')][_0x45ba7e['id']]['on']('box',this[_0x5378('0x19')][_0x5378('0x1a')](this,_0x567768));this[_0x5378('0xa')][_0x45ba7e['id']]['on'](_0x5378('0x3'),this[_0x5378('0x1b')]['bind'](this,_0x567768));this['imapAccounts'][_0x45ba7e['id']]['on'](_0x5378('0x1c'),this[_0x5378('0x1d')][_0x5378('0x1a')](this,_0x567768));this['imapAccounts'][_0x45ba7e['id']]['on'](_0x5378('0x1e'),this[_0x5378('0x1f')]['bind'](this,_0x567768));}}else{if(_[_0x5378('0x20')](this[_0x5378('0x9')][_0x567768]['Imap'])){this[_0x5378('0x9')][_0x567768][_0x5378('0xf')]={};}this[_0x5378('0x9')][_0x567768][_0x5378('0xf')]['status']=_0x5378('0x21');this[_0x5378('0x9')][_0x567768]['Imap'][_0x5378('0x11')]='';this['emit'](_0x567768);}}}};EmailChannel['prototype'][_0x5378('0x19')]=function(_0x3c3f46,_0x3b54d1){if(this[_0x5378('0x9')][_0x3c3f46]){this[_0x5378('0x9')][_0x3c3f46][_0x5378('0xf')]['status']=_0x5378('0x22');this['mailAccounts'][_0x3c3f46]['Imap'][_0x5378('0x11')]=_0x3b54d1['name'];if(_0x3b54d1[_0x5378('0x23')]){this[_0x5378('0x9')][_0x3c3f46]['Imap'][_0x5378('0x24')]=_0x3b54d1[_0x5378('0x23')][_0x5378('0x24')];}return this[_0x5378('0x14')](_0x3c3f46);}};EmailChannel[_0x5378('0xc')]['handleImapEmail']=function(_0x34c418,_0x930083){logger[_0x5378('0x8')](_0x5378('0x25'),_0x930083['firstName'],_0x930083[_0x5378('0x26')],_0x930083[_0x5378('0x27')],_0x34c418);if(this['mailAccounts'][_0x34c418]){return mailAccount[_0x5378('0x28')](_0x34c418,_0x930083)['then'](function(_0x162ff6){if(_0x162ff6){logger[_0x5378('0x8')](_0x5378('0x29'));}})[_0x5378('0x2a')](function(_0x1bb30e){logger[_0x5378('0x1e')](_0x5378('0x2b'),JSON[_0x5378('0x12')](_0x1bb30e));});}};EmailChannel[_0x5378('0xc')][_0x5378('0x1d')]=function(_0x369e35){if(this[_0x5378('0x9')][_0x369e35]&&this['mailAccounts'][_0x369e35][_0x5378('0xf')]){if(this['imapAccounts'][this['mailAccounts'][_0x369e35][_0x5378('0xf')]['id']]){delete this[_0x5378('0xa')][this[_0x5378('0x9')][_0x369e35]['Imap']['id']];}this[_0x5378('0x9')][_0x369e35][_0x5378('0xf')]['lastSync']=moment();this[_0x5378('0x14')](_0x369e35);}};EmailChannel[_0x5378('0xc')]['handleImapError']=function(_0x2baff6,_0x1c1575){if(this[_0x5378('0x9')][_0x2baff6]){this[_0x5378('0x9')][_0x2baff6][_0x5378('0xf')][_0x5378('0x10')]=_0x5378('0x1e');this[_0x5378('0x9')][_0x2baff6][_0x5378('0xf')]['messageStatus']=_0x1c1575;return this['emit'](_0x2baff6);}};EmailChannel['prototype']['sendMail']=function(_0xc9e6fe,_0x4741cb){return this['smtp'][_0x5378('0x2c')](_0xc9e6fe,_0x4741cb);};EmailChannel['prototype'][_0x5378('0x2d')]=function(_0x37ed93){var _0xe97413=this;if(this['mailAccounts'][_0x37ed93['id']]){if(_['isNil'](this[_0x5378('0x9')][_0x37ed93['id']]['Smtp'])){this[_0x5378('0x9')][_0x37ed93['id']]['Smtp']={};}this[_0x5378('0x9')][_0x37ed93['id']][_0x5378('0x2e')][_0x5378('0x2f')]=moment();return new BPromise(function(_0x45f332,_0x4b0156){return _0xe97413[_0x5378('0xb')][_0x5378('0x30')](_0x37ed93)['then'](function(_0x530d8c){_0xe97413['mailAccounts'][_0x37ed93['id']][_0x5378('0x2e')][_0x5378('0x10')]=_0x5378('0x31');_0xe97413['mailAccounts'][_0x37ed93['id']][_0x5378('0x2e')][_0x5378('0x11')]='';_0xe97413[_0x5378('0x14')](_0x37ed93['id']);_0x45f332(_0x530d8c);})[_0x5378('0x2a')](function(_0x8433c6){_0xe97413[_0x5378('0x9')][_0x37ed93['id']][_0x5378('0x2e')][_0x5378('0x10')]='error';_0xe97413['mailAccounts'][_0x37ed93['id']][_0x5378('0x2e')][_0x5378('0x11')]=_0x8433c6;_0xe97413[_0x5378('0x14')](_0x37ed93['id']);_0x4b0156(_0x8433c6);});});}return this[_0x5378('0xb')][_0x5378('0x30')](_0x37ed93);};module[_0x5378('0x32')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 1c196c5..cb1aa84 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 _0x7096=['util','mailparser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','ready','handleReady','bind','handleEnd','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','authentication','user','host','port','tls','autotls','required','modernAuthentication','xoauth2','CloudProvider','data5','password','getHost','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','end','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','stringify','textCode','hasOwnProperty','upperFirst','exports'];(function(_0x2aa47b,_0x2d19f0){var _0x4b05d5=function(_0xe6e71){while(--_0xe6e71){_0x2aa47b['push'](_0x2aa47b['shift']());}};_0x4b05d5(++_0x2d19f0);}(_0x7096,0x10c));var _0x6709=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x7096[_0x4baae2];return _0x1a2285;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var Imap=require('imap');var simpleParser=require(_0x6709('0x1'))['simpleParser'];var Iconv=require(_0x6709('0x2'))[_0x6709('0x3')];var EventEmitter=require(_0x6709('0x4'))[_0x6709('0x5')];var utils=require(_0x6709('0x6'));var logger=require(_0x6709('0x7'))(_0x6709('0x8'));function EmailImap(_0x9d630f,_0xa35832){this[_0x6709('0x9')]=_0x6709('0xa');this[_0x6709('0xb')]=this[_0x6709('0xc')](_0x9d630f,_0xa35832);this['imap']=new Imap(this['account']);this[_0x6709('0xd')][_0x6709('0xe')](_0x6709('0xf'),this[_0x6709('0x10')][_0x6709('0x11')](this));this[_0x6709('0xd')]['once']('end',this[_0x6709('0x12')][_0x6709('0x11')](this));this[_0x6709('0xd')]['on'](_0x6709('0x13'),this[_0x6709('0x14')][_0x6709('0x11')](this));this[_0x6709('0xd')][_0x6709('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x6709('0x16')][_0x6709('0xc')]=function(_0x4d5255,_0x3706e1){var _0x4e4587={'connTimeout':_0x4d5255[_0x6709('0x17')]?_0x4d5255['connTimeout']*0x3e8:0x2710,'authTimeout':_0x4d5255[_0x6709('0x18')]?_0x4d5255['authTimeout']*0x3e8:0x1388};if(_[_0x6709('0x19')](_0x4d5255[_0x6709('0x1a')])){if(_0x4d5255[_0x6709('0x1b')]){_0x4e4587[_0x6709('0x1c')]=_0x4d5255['user'];_0x4e4587['password']=_0x4d5255['password'];}_0x4e4587[_0x6709('0x1d')]=_0x4d5255[_0x6709('0x1d')];_0x4e4587['port']=_0x4d5255[_0x6709('0x1e')]||0x3e1;if(_0x4d5255[_0x6709('0x1f')]){_0x4e4587[_0x6709('0x1f')]=!![];}else{_0x4e4587['tls']=![];_0x4e4587[_0x6709('0x20')]=_0x6709('0x21');}}else{if(_0x4d5255[_0x6709('0x22')]){_0x4e4587[_0x6709('0x23')]=utils['generateXOAuth2Token'](_0x4d5255[_0x6709('0x24')][_0x6709('0x25')],_0x4d5255[_0x6709('0x1c')]);_0x4e4587[_0x6709('0x1c')]=_0x4d5255[_0x6709('0x1c')];}else{_0x4e4587[_0x6709('0x1c')]=_0x4d5255[_0x6709('0x1c')];_0x4e4587[_0x6709('0x26')]=_0x4d5255[_0x6709('0x26')];}_0x4e4587[_0x6709('0x1d')]=utils[_0x6709('0x27')](_0x4d5255[_0x6709('0x1a')]);_0x4e4587['port']=0x3e1;_0x4e4587[_0x6709('0x1f')]=!![];}_0x4e4587[_0x6709('0x8')]=_0x3706e1||_0x4d5255[_0x6709('0x1c')]||'anonymous@xcally.com';return _0x4e4587;};EmailImap[_0x6709('0x16')][_0x6709('0x10')]=function(){this[_0x6709('0xd')][_0x6709('0x28')](this['mailbox'],![],this[_0x6709('0x29')][_0x6709('0x11')](this));};EmailImap['prototype'][_0x6709('0x29')]=function(_0x39f6a9,_0x5dbb87){if(_0x39f6a9){this[_0x6709('0x14')](_0x39f6a9,!![]);}else{this[_0x6709('0x2a')]('box',_0x5dbb87);this[_0x6709('0x2b')]();}};EmailImap['prototype'][_0x6709('0x2c')]=function(_0x3cd555){if(_0x3cd555){this['handleError'](_0x3cd555,!![]);}else{this[_0x6709('0xd')]['end']();}};EmailImap[_0x6709('0x16')][_0x6709('0x2b')]=function(){this['imap'][_0x6709('0x2d')](['UNSEEN'],this[_0x6709('0x2e')][_0x6709('0x11')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x37b3ce,_0x2a0cb0){if(_0x37b3ce){this[_0x6709('0x14')](_0x37b3ce,!![]);}else{if(_0x2a0cb0[_0x6709('0x2f')]){try{var _0x12db17=this[_0x6709('0xd')][_0x6709('0x30')](_0x2a0cb0,{'bodies':'','markSeen':!![]});_0x12db17['on'](_0x6709('0x31'),this[_0x6709('0x32')]['bind'](this));_0x12db17[_0x6709('0xe')](_0x6709('0x13'),this[_0x6709('0x33')][_0x6709('0x11')](this));_0x12db17['once'](_0x6709('0x34'),this[_0x6709('0x35')][_0x6709('0x11')](this));}catch(_0x1bd075){logger['error'](_0x1bd075);}}else{this[_0x6709('0xd')][_0x6709('0x36')](!![],this['handleCloseBox'][_0x6709('0x11')](this));}}};EmailImap[_0x6709('0x16')]['handleFetchMessage']=function(_0x6863f9){_0x6863f9['on'](_0x6709('0x37'),this[_0x6709('0x38')][_0x6709('0x11')](this));_0x6863f9[_0x6709('0xe')](_0x6709('0x39'),this[_0x6709('0x3a')]['bind'](this));_0x6863f9[_0x6709('0xe')](_0x6709('0x34'),this['handleMessageEnd'][_0x6709('0x11')](this));};EmailImap[_0x6709('0x16')][_0x6709('0x38')]=function(_0x2bb89c){simpleParser(_0x2bb89c,{'Iconv':Iconv},this[_0x6709('0x3b')][_0x6709('0x11')](this));};EmailImap['prototype'][_0x6709('0x3a')]=function(){};EmailImap['prototype'][_0x6709('0x3c')]=function(){};EmailImap[_0x6709('0x16')][_0x6709('0x3b')]=function(_0x48492f,_0x149a7a){if(_0x48492f){logger[_0x6709('0x13')](_0x48492f);}else{var _0x2d9879=this;utils[_0x6709('0x3d')](this[_0x6709('0xb')],_0x149a7a,function(_0x1030ee){_0x2d9879[_0x6709('0x2a')]('email',_0x1030ee);});}};EmailImap[_0x6709('0x16')][_0x6709('0x35')]=function(){this[_0x6709('0xd')][_0x6709('0x36')](!![],this[_0x6709('0x2c')][_0x6709('0x11')](this));};EmailImap[_0x6709('0x16')]['handleFetchError']=function(_0x5abb53){this[_0x6709('0x14')](_0x5abb53);this[_0x6709('0xd')][_0x6709('0x36')](!![],this[_0x6709('0x2c')]['bind'](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x6709('0x2a')](_0x6709('0x34'));};EmailImap['prototype'][_0x6709('0x14')]=function(_0x2ab80f,_0x50d638){logger['error'](_0x6709('0x14'),this[_0x6709('0xb')][_0x6709('0x8')],JSON[_0x6709('0x3e')](_0x2ab80f));var _0x13877a='';if(_0x2ab80f){if(_0x2ab80f['textCode']){_0x13877a=_0x2ab80f[_0x6709('0x3f')];}else{for(var _0x4d93e4 in _0x2ab80f){if(_0x2ab80f[_0x6709('0x40')](_0x4d93e4)){_0x13877a+=_[_0x6709('0x41')](_0x4d93e4)+':\x20'+_0x2ab80f[_0x4d93e4]+'\x0a';}}}}if(_0x50d638){this[_0x6709('0xd')]['end']();}else{this[_0x6709('0x2a')]('error',_0x13877a);this['emit'](_0x6709('0x34'));}};module[_0x6709('0x42')]=EmailImap; \ No newline at end of file +var _0xe2fe=['stringify','textCode','hasOwnProperty','upperFirst','lodash','mailparser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','INBOX','getAccount','account','imap','ready','handleReady','handleEnd','handleError','bind','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','length','fetch','once','error','end','handleFetchEnd','closeBox','handleFetchMessage','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser'];(function(_0x1f4ec3,_0x28207d){var _0x496261=function(_0x47c0ed){while(--_0x47c0ed){_0x1f4ec3['push'](_0x1f4ec3['shift']());}};_0x496261(++_0x28207d);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var Imap=require('imap');var simpleParser=require(_0xee2f('0x1'))['simpleParser'];var Iconv=require(_0xee2f('0x2'))[_0xee2f('0x3')];var EventEmitter=require(_0xee2f('0x4'))[_0xee2f('0x5')];var utils=require(_0xee2f('0x6'));var logger=require('../../../config/logger')(_0xee2f('0x7'));function EmailImap(_0x2b7e7c,_0x49926b){this[_0xee2f('0x8')]=_0xee2f('0x9');this['account']=this[_0xee2f('0xa')](_0x2b7e7c,_0x49926b);this['imap']=new Imap(this[_0xee2f('0xb')]);this[_0xee2f('0xc')]['once'](_0xee2f('0xd'),this[_0xee2f('0xe')]['bind'](this));this['imap']['once']('end',this[_0xee2f('0xf')]['bind'](this));this['imap']['on']('error',this[_0xee2f('0x10')][_0xee2f('0x11')](this));this[_0xee2f('0xc')][_0xee2f('0x12')]();}util[_0xee2f('0x13')](EmailImap,EventEmitter);EmailImap[_0xee2f('0x14')]['getAccount']=function(_0x3861e6,_0x531c3a){var _0x36db10={'connTimeout':_0x3861e6[_0xee2f('0x15')]?_0x3861e6['connTimeout']*0x3e8:0x2710,'authTimeout':_0x3861e6[_0xee2f('0x16')]?_0x3861e6[_0xee2f('0x16')]*0x3e8:0x1388};if(_[_0xee2f('0x17')](_0x3861e6[_0xee2f('0x18')])){if(_0x3861e6[_0xee2f('0x19')]){_0x36db10['user']=_0x3861e6[_0xee2f('0x1a')];_0x36db10['password']=_0x3861e6[_0xee2f('0x1b')];}_0x36db10[_0xee2f('0x1c')]=_0x3861e6['host'];_0x36db10['port']=_0x3861e6[_0xee2f('0x1d')]||0x3e1;if(_0x3861e6['tls']){_0x36db10[_0xee2f('0x1e')]=!![];}else{_0x36db10[_0xee2f('0x1e')]=![];_0x36db10[_0xee2f('0x1f')]='required';}}else{if(_0x3861e6[_0xee2f('0x20')]){_0x36db10[_0xee2f('0x21')]=utils[_0xee2f('0x22')](_0x3861e6[_0xee2f('0x23')][_0xee2f('0x24')],_0x3861e6['user']);_0x36db10['user']=_0x3861e6[_0xee2f('0x1a')];}else{_0x36db10[_0xee2f('0x1a')]=_0x3861e6[_0xee2f('0x1a')];_0x36db10[_0xee2f('0x1b')]=_0x3861e6[_0xee2f('0x1b')];}_0x36db10[_0xee2f('0x1c')]=utils[_0xee2f('0x25')](_0x3861e6['service']);_0x36db10[_0xee2f('0x1d')]=0x3e1;_0x36db10[_0xee2f('0x1e')]=!![];}_0x36db10[_0xee2f('0x7')]=_0x531c3a||_0x3861e6[_0xee2f('0x1a')]||_0xee2f('0x26');return _0x36db10;};EmailImap[_0xee2f('0x14')][_0xee2f('0xe')]=function(){this[_0xee2f('0xc')][_0xee2f('0x27')](this[_0xee2f('0x8')],![],this[_0xee2f('0x28')][_0xee2f('0x11')](this));};EmailImap[_0xee2f('0x14')][_0xee2f('0x28')]=function(_0x53f6ed,_0x4ef690){if(_0x53f6ed){this['handleError'](_0x53f6ed,!![]);}else{this[_0xee2f('0x29')](_0xee2f('0x2a'),_0x4ef690);this[_0xee2f('0x2b')]();}};EmailImap[_0xee2f('0x14')][_0xee2f('0x2c')]=function(_0x3737fd){if(_0x3737fd){this['handleError'](_0x3737fd,!![]);}else{this[_0xee2f('0xc')]['end']();}};EmailImap[_0xee2f('0x14')][_0xee2f('0x2b')]=function(){this[_0xee2f('0xc')][_0xee2f('0x2d')]([_0xee2f('0x2e')],this['handleReadUnseen'][_0xee2f('0x11')](this));};EmailImap[_0xee2f('0x14')]['handleReadUnseen']=function(_0x4ee0e1,_0xd1aaac){if(_0x4ee0e1){this['handleError'](_0x4ee0e1,!![]);}else{if(_0xd1aaac[_0xee2f('0x2f')]){try{var _0xc447e=this['imap'][_0xee2f('0x30')](_0xd1aaac,{'bodies':'','markSeen':!![]});_0xc447e['on']('message',this['handleFetchMessage']['bind'](this));_0xc447e[_0xee2f('0x31')](_0xee2f('0x32'),this['handleFetchError'][_0xee2f('0x11')](this));_0xc447e[_0xee2f('0x31')](_0xee2f('0x33'),this[_0xee2f('0x34')][_0xee2f('0x11')](this));}catch(_0x4e682d){logger[_0xee2f('0x32')](_0x4e682d);}}else{this['imap'][_0xee2f('0x35')](!![],this[_0xee2f('0x2c')][_0xee2f('0x11')](this));}}};EmailImap['prototype'][_0xee2f('0x36')]=function(_0x5ed71e){_0x5ed71e['on'](_0xee2f('0x37'),this['handleMessageBody'][_0xee2f('0x11')](this));_0x5ed71e[_0xee2f('0x31')](_0xee2f('0x38'),this[_0xee2f('0x39')][_0xee2f('0x11')](this));_0x5ed71e[_0xee2f('0x31')](_0xee2f('0x33'),this[_0xee2f('0x3a')][_0xee2f('0x11')](this));};EmailImap[_0xee2f('0x14')][_0xee2f('0x3b')]=function(_0x5ad0a7){simpleParser(_0x5ad0a7,{'Iconv':Iconv},this[_0xee2f('0x3c')]['bind'](this));};EmailImap[_0xee2f('0x14')][_0xee2f('0x39')]=function(){};EmailImap[_0xee2f('0x14')][_0xee2f('0x3a')]=function(){};EmailImap[_0xee2f('0x14')][_0xee2f('0x3c')]=function(_0x694950,_0x130371){if(_0x694950){logger['error'](_0x694950);}else{var _0x562d58=this;utils['parser'](this[_0xee2f('0xb')],_0x130371,function(_0x5483ae){_0x562d58[_0xee2f('0x29')]('email',_0x5483ae);});}};EmailImap['prototype']['handleFetchEnd']=function(){this['imap'][_0xee2f('0x35')](!![],this[_0xee2f('0x2c')][_0xee2f('0x11')](this));};EmailImap[_0xee2f('0x14')]['handleFetchError']=function(_0x5986f4){this[_0xee2f('0x10')](_0x5986f4);this['imap']['closeBox'](!![],this[_0xee2f('0x2c')][_0xee2f('0x11')](this));};EmailImap[_0xee2f('0x14')]['handleEnd']=function(){this[_0xee2f('0x29')](_0xee2f('0x33'));};EmailImap[_0xee2f('0x14')]['handleError']=function(_0x5896f6,_0x137a83){logger[_0xee2f('0x32')](_0xee2f('0x10'),this[_0xee2f('0xb')]['email'],JSON[_0xee2f('0x3d')](_0x5896f6));var _0x1df63d='';if(_0x5896f6){if(_0x5896f6[_0xee2f('0x3e')]){_0x1df63d=_0x5896f6[_0xee2f('0x3e')];}else{for(var _0x214eed in _0x5896f6){if(_0x5896f6[_0xee2f('0x3f')](_0x214eed)){_0x1df63d+=_[_0xee2f('0x40')](_0x214eed)+':\x20'+_0x5896f6[_0x214eed]+'\x0a';}}}}if(_0x137a83){this[_0xee2f('0xc')][_0xee2f('0x33')]();}else{this[_0xee2f('0x29')]('error',_0x1df63d);this['emit']('end');}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 721297c..5968e98 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 _0xbce1=['prototype','send','createTransport','use','sendMail','toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64'];(function(_0x51dc3d,_0x19b510){var _0x1dee76=function(_0x3422d2){while(--_0x3422d2){_0x51dc3d['push'](_0x51dc3d['shift']());}};_0x1dee76(++_0x19b510);}(_0xbce1,0x77));var _0x1bce=function(_0x11cd2b,_0x51e365){_0x11cd2b=_0x11cd2b-0x0;var _0x39b423=_0xbce1[_0x11cd2b];return _0x39b423;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x1bce('0x0'));function EmailSmtp(){}EmailSmtp[_0x1bce('0x1')][_0x1bce('0x2')]=function(_0x4f5939,_0x9a716){return new Promise(function(_0x152197,_0x1dcabf){var _0x5c8199=nodemailer[_0x1bce('0x3')](_0x4f5939);_0x5c8199[_0x1bce('0x4')]('compile',inlineBase64());_0x5c8199[_0x1bce('0x5')](_0x9a716,function(_0x1a847c,_0x2ddb87){if(_0x1a847c){_0x1dcabf(_0x1a847c[_0x1bce('0x6')]());}else{_0x152197(_0x2ddb87);}});});};EmailSmtp[_0x1bce('0x1')][_0x1bce('0x7')]=function(_0x50003c){return new Promise(function(_0x136d91,_0x282500){var _0x4b3531=nodemailer[_0x1bce('0x3')](_0x50003c);_0x4b3531[_0x1bce('0x7')](function(_0xfe7924,_0x41de6b){if(_0xfe7924){_0x282500(_0xfe7924[_0x1bce('0x6')]());}else{if(_0x41de6b){_0x136d91(_0x41de6b);}else{_0x282500(_0x1bce('0x8'));}}});});};module[_0x1bce('0x9')]=EmailSmtp; \ No newline at end of file +var _0x4706=['verify','Not\x20verifired','exports','nodemailer','prototype','send','createTransport','compile','toString'];(function(_0x5f32bc,_0x444942){var _0x29e0a6=function(_0x512106){while(--_0x512106){_0x5f32bc['push'](_0x5f32bc['shift']());}};_0x29e0a6(++_0x444942);}(_0x4706,0x123));var _0x6470=function(_0x2cbe85,_0x545538){_0x2cbe85=_0x2cbe85-0x0;var _0x111261=_0x4706[_0x2cbe85];return _0x111261;};'use strict';var nodemailer=require(_0x6470('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x6470('0x1')][_0x6470('0x2')]=function(_0x5b0039,_0x5cd6f5){return new Promise(function(_0x494db5,_0x23b571){var _0x952eb6=nodemailer[_0x6470('0x3')](_0x5b0039);_0x952eb6['use'](_0x6470('0x4'),inlineBase64());_0x952eb6['sendMail'](_0x5cd6f5,function(_0x31832b,_0x255a4f){if(_0x31832b){_0x23b571(_0x31832b[_0x6470('0x5')]());}else{_0x494db5(_0x255a4f);}});});};EmailSmtp[_0x6470('0x1')][_0x6470('0x6')]=function(_0x1495a7){return new Promise(function(_0x44c297,_0x1e57ec){var _0x3cf34e=nodemailer[_0x6470('0x3')](_0x1495a7);_0x3cf34e[_0x6470('0x6')](function(_0x2f9dca,_0x16b548){if(_0x2f9dca){_0x1e57ec(_0x2f9dca[_0x6470('0x5')]());}else{if(_0x16b548){_0x44c297(_0x16b548);}else{_0x1e57ec(_0x6470('0x7'));}}});});};module[_0x6470('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 046179a..01a50e4 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 _0x2bb5=['line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','Title','getHost','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','generateXOAuth2Token','utf-8','base64','lodash','moment','randomstring','path','email','../../../config/environment','head','value','address','anonymous','substring','name','split','length','slice','join','Anonymous','pop','isEmpty','generate','html','test','includes','attachments','forEach','push','filename','_SRC','replace','body','textAsHtml','0x1?_0x40998e[_0x52bb('0xe')](0x0,-0x1)[_0x52bb('0xf')]('\x20'):_0x164224[_0x52bb('0xb')];}return _0x52bb('0x10');}function getLastName(_0x39d014){var _0x34b2f3=_['head'](_0x39d014[_0x52bb('0x7')]);if(_0x34b2f3&&_0x34b2f3[_0x52bb('0xb')]){var _0x30cab5=_0x34b2f3[_0x52bb('0xb')]['split'](/\s+/);return _0x30cab5[_0x52bb('0xd')]>0x1?_0x30cab5[_0x52bb('0x11')]():'';}return'';}function getMails(_0x45c6ab,_0x149ace){var _0x2589cd='';for(var _0x25d1e9=0x0;_0x25d1e9<_0x149ace['value'][_0x52bb('0xd')];_0x25d1e9+=0x1){if(_0x149ace['value'][_0x25d1e9]['address']!==_0x45c6ab){if(!_[_0x52bb('0x12')](_0x2589cd)){_0x2589cd+=',';}_0x2589cd+=_0x149ace[_0x52bb('0x7')][_0x25d1e9]['name']||_0x149ace[_0x52bb('0x7')][_0x25d1e9]['address']||'';_0x2589cd+='\x20<';_0x2589cd+=_0x149ace[_0x52bb('0x7')][_0x25d1e9][_0x52bb('0x8')]?_0x149ace[_0x52bb('0x7')][_0x25d1e9][_0x52bb('0x8')]:_0x52bb('0x9')+random[_0x52bb('0x13')](0x6)+'@xcally.com';_0x2589cd+='>';}}return _0x2589cd;}function parseEmail(_0x5b5ade,_0xb6dccd,_0x29969a){if(_0xb6dccd[_0x52bb('0x14')]){var _0x294c3b=/)<[^<]*)*<\/script>/gi;while(_0x294c3b[_0x52bb('0x15')](_0xb6dccd[_0x52bb('0x14')])){_0xb6dccd[_0x52bb('0x14')]=_0xb6dccd[_0x52bb('0x14')]['replace'](_0x294c3b,'');}if(_0xb6dccd[_0x52bb('0x14')][_0x52bb('0x16')]('{_0x2dfc84[_0x52bb('0x19')](_0x20dbad[_0x52bb('0x1a')]);});var _0x4ae53b=/]+>/g;var _0x57fe0b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2726f7=_0xb6dccd[_0x52bb('0x14')]['replace'](_0x57fe0b,_0x52bb('0x1b'));var _0x103193=_0x2726f7[_0x52bb('0x1c')](_0x4ae53b,'_IMG');for(let _0x1b8081=0x0;_0x1b8081<_0x2dfc84['length'];_0x1b8081++){var _0x505e55=_0x103193[_0x52bb('0x1c')]('_IMG','\x20[Attachment:\x20'+_0x2dfc84[_0x1b8081]+'\x20]');_0x103193=_0x505e55;}_0xb6dccd[_0x52bb('0x14')]=_0x103193;}_0x29969a[_0x52bb('0x1d')]=_0xb6dccd[_0x52bb('0x14')];}else{_0x29969a[_0x52bb('0x1d')]=_0xb6dccd[_0x52bb('0x1e')];}if(_0x29969a[_0x52bb('0x1d')]){_0x29969a['body']=_0x29969a[_0x52bb('0x1d')][_0x52bb('0x1c')](/0x0){var _0x4d99a3=[_0x52bb('0x30'),_0x52bb('0x31'),'Precedence:\x20auto_reply'];for(var _0xbae24d=0x0;_0xbae24d<_0xb6dccd['headerLines']['length'];_0xbae24d++){var _0x2435a0=_[_0x52bb('0x32')](_0x4d99a3,_0xb6dccd[_0x52bb('0x2f')][_0xbae24d][_0x52bb('0x33')]);if(_0x2435a0>=0x0){_0x29969a[_0x52bb('0x34')]=!![];}}}return _0x29969a;}exports[_0x52bb('0x35')]=function(_0x3c950b,_0x36fd57,_0x85bef8){var _0x489816={'from':getAddress(_0x36fd57['from']),'firstName':getFirstName(_0x36fd57[_0x52bb('0x36')]),'lastName':getLastName(_0x36fd57[_0x52bb('0x36')]),'mapKey':_0x52bb('0x4'),'message':{'from':getMails(_0x3c950b['email'],_0x36fd57['from']),'to':_0x3c950b[_0x52bb('0x4')],'cc':'','subject':_0x36fd57[_0x52bb('0x37')]||'','messageId':_0x36fd57[_0x52bb('0x38')],'inReplyTo':_0x36fd57[_0x52bb('0x39')],'sentAt':moment(_0x36fd57[_0x52bb('0x3a')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x36fd57[_0x52bb('0x14')]&&!_0x36fd57[_0x52bb('0x1e')]){var _0x2efeea=_[_0x52bb('0x3b')](_0x36fd57['attachments'],{'contentType':'application/ms-tnef'});if(_0x2efeea[_0x52bb('0xd')]){logger[_0x52bb('0x3c')](util[_0x52bb('0x28')](_0x52bb('0x3d'),_0x36fd57[_0x52bb('0x38')]));tnef[_0x52bb('0x3e')](_[_0x52bb('0x3f')](_0x2efeea)[_0x52bb('0x2d')],function(_0x468aec,_0x367e1f){if(_0x367e1f){_0x36fd57[_0x52bb('0x14')]=_0x367e1f[_0x52bb('0x40')]||'

Empty\x20message

';if(_0x367e1f[_0x52bb('0x41')]){for(var _0x4b91d5=0x0;_0x4b91d5<_0x367e1f[_0x52bb('0x41')]['length'];_0x4b91d5++){var _0x4ca441=_0x367e1f[_0x52bb('0x41')][_0x4b91d5];_0x489816['message'][_0x52bb('0x17')][_0x52bb('0x19')]({'filename':_0x4ca441[_0x52bb('0x42')],'content':Buffer[_0x52bb('0x36')](_0x4ca441['Data'])});}}}_0x85bef8(parseEmail(_0x3c950b,_0x36fd57,_0x489816));});}else{_0x36fd57[_0x52bb('0x14')]='

Empty\x20message

';_0x85bef8(parseEmail(_0x3c950b,_0x36fd57,_0x489816));}}else{_0x85bef8(parseEmail(_0x3c950b,_0x36fd57,_0x489816));}};exports[_0x52bb('0x43')]=function(_0x4ccfff){switch(_0x4ccfff){case _0x52bb('0x44'):return'imap.gmail.com';case _0x52bb('0x45'):return _0x52bb('0x46');case _0x52bb('0x47'):return _0x52bb('0x48');case'outlook365':return _0x52bb('0x49');}return _0x52bb('0x4a');};exports[_0x52bb('0x4b')]=function(_0x5bea34,_0x21b557){var _0x4d2c75=['user='+(_0x21b557||''),'auth=Bearer\x20'+_0x5bea34,'',''];return Buffer['from'](_0x4d2c75['join'](''),_0x52bb('0x4c'))['toString'](_0x52bb('0x4d'));}; \ No newline at end of file +var _0x3887=['textAsHtml','message','originTo','originCc','bcc','type','attachment','attachment-','format','%s-%s','now','join','root','server/files/attachments/','writeFileSync','push','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','from','subject','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','content','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','generateXOAuth2Token','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','node-tnef','../../../config/logger','email','value','generate','head','name','substring','indexOf','split','length','Anonymous','pop','address','isEmpty','anonymous','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body'];(function(_0x360dc2,_0x843dd0){var _0x32817d=function(_0x427143){while(--_0x427143){_0x360dc2['push'](_0x360dc2['shift']());}};_0x32817d(++_0x843dd0);}(_0x3887,0x85));var _0x7388=function(_0x3945f4,_0x2da4ad){_0x3945f4=_0x3945f4-0x0;var _0x2a1633=_0x3887[_0x3945f4];return _0x2a1633;};'use strict';var _=require(_0x7388('0x0'));var moment=require(_0x7388('0x1'));var random=require(_0x7388('0x2'));var fs=require('fs');var path=require(_0x7388('0x3'));var util=require('util');var tnef=require(_0x7388('0x4'));var logger=require(_0x7388('0x5'))(_0x7388('0x6'));var config=require('../../../config/environment');function getAddress(_0x1f2e9c){var _0x1eaf0e=_['head'](_0x1f2e9c[_0x7388('0x7')]);return _0x1eaf0e&&_0x1eaf0e['address']?_0x1eaf0e['address']:'anonymous'+random[_0x7388('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x430455){var _0x4fa076=_[_0x7388('0x9')](_0x430455[_0x7388('0x7')]);if(_0x4fa076&&_0x4fa076[_0x7388('0xa')]){if(_0x4fa076[_0x7388('0xa')]==_0x4fa076['address']){return _0x4fa076[_0x7388('0xa')][_0x7388('0xb')](0x0,_0x4fa076[_0x7388('0xa')][_0x7388('0xc')]('@'));}var _0x4d76ef=_0x4fa076[_0x7388('0xa')][_0x7388('0xd')](/\s+/);return _0x4d76ef[_0x7388('0xe')]>0x1?_0x4d76ef['slice'](0x0,-0x1)['join']('\x20'):_0x4fa076[_0x7388('0xa')];}return _0x7388('0xf');}function getLastName(_0x1392a2){var _0x455960=_[_0x7388('0x9')](_0x1392a2['value']);if(_0x455960&&_0x455960['name']){var _0x1f55d9=_0x455960[_0x7388('0xa')]['split'](/\s+/);return _0x1f55d9[_0x7388('0xe')]>0x1?_0x1f55d9[_0x7388('0x10')]():'';}return'';}function getMails(_0x5cc294,_0x555b4c){var _0x5ce5eb='';for(var _0x1b3fa3=0x0;_0x1b3fa3<_0x555b4c['value'][_0x7388('0xe')];_0x1b3fa3+=0x1){if(_0x555b4c['value'][_0x1b3fa3][_0x7388('0x11')]!==_0x5cc294){if(!_[_0x7388('0x12')](_0x5ce5eb)){_0x5ce5eb+=',';}_0x5ce5eb+=_0x555b4c['value'][_0x1b3fa3][_0x7388('0xa')]||_0x555b4c[_0x7388('0x7')][_0x1b3fa3][_0x7388('0x11')]||'';_0x5ce5eb+='\x20<';_0x5ce5eb+=_0x555b4c[_0x7388('0x7')][_0x1b3fa3][_0x7388('0x11')]?_0x555b4c['value'][_0x1b3fa3]['address']:_0x7388('0x13')+random['generate'](0x6)+'@xcally.com';_0x5ce5eb+='>';}}return _0x5ce5eb;}function parseEmail(_0x34f958,_0x21dc5c,_0x3ba13c){if(_0x21dc5c[_0x7388('0x14')]){var _0x13b066=/)<[^<]*)*<\/script>/gi;while(_0x13b066[_0x7388('0x15')](_0x21dc5c[_0x7388('0x14')])){_0x21dc5c['html']=_0x21dc5c[_0x7388('0x14')][_0x7388('0x16')](_0x13b066,'');}if(_0x21dc5c[_0x7388('0x14')][_0x7388('0x17')](_0x7388('0x18'))){var _0x11b00a=[];_0x21dc5c[_0x7388('0x19')][_0x7388('0x1a')](_0x41f60c=>{_0x11b00a['push'](_0x41f60c[_0x7388('0x1b')]);});var _0x230300=/]+>/g;var _0x478e92=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x59c107=_0x21dc5c[_0x7388('0x14')][_0x7388('0x16')](_0x478e92,_0x7388('0x1c'));var _0x2f185a=_0x59c107['replace'](_0x230300,_0x7388('0x1d'));for(let _0x54646e=0x0;_0x54646e<_0x11b00a[_0x7388('0xe')];_0x54646e++){var _0x2707e7=_0x2f185a['replace'](_0x7388('0x1d'),_0x7388('0x1e')+_0x11b00a[_0x54646e]+_0x7388('0x1f'));_0x2f185a=_0x2707e7;}_0x21dc5c[_0x7388('0x14')]=_0x2f185a;}_0x3ba13c[_0x7388('0x20')]=_0x21dc5c['html'];}else{_0x3ba13c[_0x7388('0x20')]=_0x21dc5c[_0x7388('0x21')];}if(_0x3ba13c[_0x7388('0x20')]){_0x3ba13c[_0x7388('0x20')]=_0x3ba13c['body']['replace'](/0x0){var _0x387ea9=['Auto-Submitted:\x20auto-replied',_0x7388('0x33'),_0x7388('0x34')];for(var _0x12fd2a=0x0;_0x12fd2a<_0x21dc5c[_0x7388('0x32')][_0x7388('0xe')];_0x12fd2a++){var _0x161d33=_[_0x7388('0xc')](_0x387ea9,_0x21dc5c[_0x7388('0x32')][_0x12fd2a][_0x7388('0x35')]);if(_0x161d33>=0x0){_0x3ba13c[_0x7388('0x36')]=!![];}}}return _0x3ba13c;}exports['parser']=function(_0x53db35,_0x3e8c8d,_0x1ddbd0){var _0x29efe5={'from':getAddress(_0x3e8c8d[_0x7388('0x37')]),'firstName':getFirstName(_0x3e8c8d[_0x7388('0x37')]),'lastName':getLastName(_0x3e8c8d[_0x7388('0x37')]),'mapKey':_0x7388('0x6'),'message':{'from':getMails(_0x53db35[_0x7388('0x6')],_0x3e8c8d[_0x7388('0x37')]),'to':_0x53db35[_0x7388('0x6')],'cc':'','subject':_0x3e8c8d[_0x7388('0x38')]||'','messageId':_0x3e8c8d['messageId'],'inReplyTo':_0x3e8c8d['inReplyTo'],'sentAt':moment(_0x3e8c8d[_0x7388('0x39')])['format'](_0x7388('0x3a')),'attach':![],'attachments':[]}};if(!_0x3e8c8d[_0x7388('0x14')]&&!_0x3e8c8d[_0x7388('0x21')]){var _0xb0065=_[_0x7388('0x3b')](_0x3e8c8d[_0x7388('0x19')],{'contentType':_0x7388('0x3c')});if(_0xb0065['length']){logger['info'](util['format'](_0x7388('0x3d'),_0x3e8c8d[_0x7388('0x3e')]));tnef[_0x7388('0x3f')](_['first'](_0xb0065)[_0x7388('0x40')],function(_0x305268,_0x23a965){if(_0x23a965){_0x3e8c8d['html']=_0x23a965[_0x7388('0x41')]||_0x7388('0x42');if(_0x23a965[_0x7388('0x43')]){for(var _0x87a9b9=0x0;_0x87a9b9<_0x23a965[_0x7388('0x43')][_0x7388('0xe')];_0x87a9b9++){var _0xc0fb15=_0x23a965[_0x7388('0x43')][_0x87a9b9];_0x29efe5['message']['attachments'][_0x7388('0x30')]({'filename':_0xc0fb15[_0x7388('0x44')],'content':Buffer[_0x7388('0x37')](_0xc0fb15[_0x7388('0x45')])});}}}_0x1ddbd0(parseEmail(_0x53db35,_0x3e8c8d,_0x29efe5));});}else{_0x3e8c8d[_0x7388('0x14')]=_0x7388('0x42');_0x1ddbd0(parseEmail(_0x53db35,_0x3e8c8d,_0x29efe5));}}else{_0x1ddbd0(parseEmail(_0x53db35,_0x3e8c8d,_0x29efe5));}};exports[_0x7388('0x46')]=function(_0x54c3f1){switch(_0x54c3f1){case'gmail':return _0x7388('0x47');case _0x7388('0x48'):return _0x7388('0x49');case _0x7388('0x4a'):return'imap-mail.outlook.com';case _0x7388('0x4b'):return _0x7388('0x4c');}return _0x7388('0x4d');};exports[_0x7388('0x4e')]=function(_0x43df67,_0x3db447){var _0x4749d0=['user='+(_0x3db447||''),_0x7388('0x4f')+_0x43df67,'',''];return Buffer[_0x7388('0x37')](_0x4749d0['join'](''),_0x7388('0x50'))[_0x7388('0x51')](_0x7388('0x52'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index a251b3d..a9337d2 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 _0xa4ee=['Service','key','active','Imap','Smtp','lodash','name'];(function(_0x441621,_0x1549ae){var _0x11a9f7=function(_0x447856){while(--_0x447856){_0x441621['push'](_0x441621['shift']());}};_0x11a9f7(++_0x1549ae);}(_0xa4ee,0x194));var _0xea4e=function(_0x173aa0,_0x2d263c){_0x173aa0=_0x173aa0-0x0;var _0x176df9=_0xa4ee[_0x173aa0];return _0x176df9;};'use strict';var _=require(_0xea4e('0x0'));function MailAccount(_0xdc319c){this['id']=_0xdc319c['id']||0x0;this['name']=_0xdc319c[_0xea4e('0x1')]||_0xea4e('0x2');this[_0xea4e('0x3')]=_0xdc319c[_0xea4e('0x3')]||'SERV';this[_0xea4e('0x4')]=_0xdc319c[_0xea4e('0x4')]||![];this[_0xea4e('0x5')]=_0xdc319c[_0xea4e('0x5')]||[];this['Smtp']=_0xdc319c[_0xea4e('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x59cc=['name','key','SERV','active','Imap','Smtp','exports'];(function(_0x372515,_0xdd11f){var _0xa3bf4e=function(_0x212cc8){while(--_0x212cc8){_0x372515['push'](_0x372515['shift']());}};_0xa3bf4e(++_0xdd11f);}(_0x59cc,0x1b2));var _0xc59c=function(_0x4d6449,_0x2a93db){_0x4d6449=_0x4d6449-0x0;var _0x4bfe59=_0x59cc[_0x4d6449];return _0x4bfe59;};'use strict';var _=require('lodash');function MailAccount(_0xb44004){this['id']=_0xb44004['id']||0x0;this[_0xc59c('0x0')]=_0xb44004[_0xc59c('0x0')]||'Service';this[_0xc59c('0x1')]=_0xb44004[_0xc59c('0x1')]||_0xc59c('0x2');this[_0xc59c('0x3')]=_0xb44004[_0xc59c('0x3')]||![];this[_0xc59c('0x4')]=_0xb44004['Imap']||[];this[_0xc59c('0x5')]=_0xb44004[_0xc59c('0x5')]||[];}module[_0xc59c('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index d786ce7..a625550 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 _0x5b82=['lodash','mapKeys','mergeFromDatabase','hasOwnProperty','prototype','initMailAccounts','isUndefined','mailAccounts','merge'];(function(_0x253ee0,_0x51ff32){var _0x456c7c=function(_0x4e3c17){while(--_0x4e3c17){_0x253ee0['push'](_0x253ee0['shift']());}};_0x456c7c(++_0x51ff32);}(_0x5b82,0x1b0));var _0x25b8=function(_0x57f91f,_0x21cf17){_0x57f91f=_0x57f91f-0x0;var _0x4deca6=_0x5b82[_0x57f91f];return _0x4deca6;};'use strict';var _=require(_0x25b8('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x606d68,_0x10d0ad,_0x4f6773){var _0x1490b3=_[_0x25b8('0x1')](_0x606d68,function(_0x41d1ed,_0x417c6d){return _0x41d1ed[_0x4f6773];});for(var _0x588230 in _0x10d0ad){if(_0x10d0ad['hasOwnProperty'](_0x588230)){if(!_0x1490b3[_0x588230]){delete _0x10d0ad[_0x588230];}}}}Realtime['prototype'][_0x25b8('0x2')]=function(_0x58da20,_0x550ca8){for(var _0x4667b3 in _0x550ca8){if(_0x58da20[_0x25b8('0x3')](_0x4667b3)){_0x58da20[_0x4667b3]=_0x550ca8[_0x4667b3];}}};Realtime[_0x25b8('0x4')][_0x25b8('0x5')]=function(){var _0x506bfd=this;return function(_0x34df46){if(_0x34df46){freeIsNotKey(_0x34df46,_0x506bfd['mailAccounts'],'id');for(var _0x478ddb=0x0,_0x2bc04d={},_0xff652d={};_0x478ddb<_0x34df46['length'];_0x478ddb+=0x1){_0x2bc04d=_0x34df46[_0x478ddb];if(_[_0x25b8('0x6')](_0x506bfd[_0x25b8('0x7')][_0x2bc04d['id']])){_0x506bfd[_0x25b8('0x7')][_0x2bc04d['id']]=new MailAccount(_0x2bc04d);}else{_[_0x25b8('0x8')](_0x506bfd[_0x25b8('0x7')][_0x2bc04d['id']],_0x2bc04d);}}}return _0x506bfd[_0x25b8('0x7')];};};module['exports']=Realtime; \ No newline at end of file +var _0x498d=['mergeFromDatabase','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','prototype'];(function(_0xfd55d5,_0x18e3df){var _0x31eb24=function(_0x403a07){while(--_0x403a07){_0xfd55d5['push'](_0xfd55d5['shift']());}};_0x31eb24(++_0x18e3df);}(_0x498d,0x67));var _0xd498=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0x498d[_0x3daa8c];return _0x2b1bd7;};'use strict';var _=require(_0xd498('0x0'));var MailAccount=require(_0xd498('0x1'));var Realtime=function(){this[_0xd498('0x2')]={};};function freeIsNotKey(_0x5f3c2c,_0x1d2f24,_0x2c5092){var _0x138f6d=_[_0xd498('0x3')](_0x5f3c2c,function(_0x13be1c,_0x26994b){return _0x13be1c[_0x2c5092];});for(var _0x169660 in _0x1d2f24){if(_0x1d2f24['hasOwnProperty'](_0x169660)){if(!_0x138f6d[_0x169660]){delete _0x1d2f24[_0x169660];}}}}Realtime[_0xd498('0x4')][_0xd498('0x5')]=function(_0x2c9ff8,_0x329fb6){for(var _0x59cfaf in _0x329fb6){if(_0x2c9ff8['hasOwnProperty'](_0x59cfaf)){_0x2c9ff8[_0x59cfaf]=_0x329fb6[_0x59cfaf];}}};Realtime[_0xd498('0x4')]['initMailAccounts']=function(){var _0x175516=this;return function(_0xdab4e2){if(_0xdab4e2){freeIsNotKey(_0xdab4e2,_0x175516[_0xd498('0x2')],'id');for(var _0x126b81=0x0,_0x32e957={},_0x4ad6f5={};_0x126b81<_0xdab4e2['length'];_0x126b81+=0x1){_0x32e957=_0xdab4e2[_0x126b81];if(_[_0xd498('0x6')](_0x175516[_0xd498('0x2')][_0x32e957['id']])){_0x175516['mailAccounts'][_0x32e957['id']]=new MailAccount(_0x32e957);}else{_[_0xd498('0x7')](_0x175516['mailAccounts'][_0x32e957['id']],_0x32e957);}}}return _0x175516[_0xd498('0x2')];};};module[_0xd498('0x8')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 54e6e01..d00d544 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 _0x0a1c=['ListId','TemplateId','MailServerIn','Imap','CloudProvider','service','type','data5','MailServerOut','Smtp','notify','NotifyMailAccount','Request','GetMailAccount','name','email','active','key'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x4c184d,_0x4278ab){_0x4c184d=_0x4c184d-0x0;var _0x23d997=_0x0a1c[_0x4c184d];return _0x23d997;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0xc0a1('0x0')](_0xc0a1('0x1'),{'options':{'attributes':['id',_0xc0a1('0x2'),'provider','service',_0xc0a1('0x3'),_0xc0a1('0x4'),_0xc0a1('0x5'),_0xc0a1('0x6'),_0xc0a1('0x7')],'raw':![],'include':[{'model':_0xc0a1('0x8'),'as':_0xc0a1('0x9'),'include':[{'model':_0xc0a1('0xa'),'attributes':['id',_0xc0a1('0x2'),_0xc0a1('0xb'),_0xc0a1('0xc'),_0xc0a1('0xd')],'as':_0xc0a1('0xa')}]},{'model':_0xc0a1('0xe'),'as':_0xc0a1('0xf'),'include':[{'model':_0xc0a1('0xa'),'attributes':['id',_0xc0a1('0x2'),'service',_0xc0a1('0xc'),_0xc0a1('0xd')],'as':_0xc0a1('0xa')}]}]},'log':'getMailAccount'});};};exports[_0xc0a1('0x10')]=function(_0x4683ab,_0xd25ae5){return client['Request'](_0xc0a1('0x11'),{'account':{'id':_0x4683ab},'body':_0xd25ae5,'log':_0xc0a1('0x11')});}; \ No newline at end of file +var _0x0618=['GetMailAccount','name','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','service','type','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts'];(function(_0x2c6dd1,_0x4a82a0){var _0x4690b3=function(_0x59f4ec){while(--_0x59f4ec){_0x2c6dd1['push'](_0x2c6dd1['shift']());}};_0x4690b3(++_0x4a82a0);}(_0x0618,0x1c6));var _0x8061=function(_0x568d1a,_0x252354){_0x568d1a=_0x568d1a-0x0;var _0x12f6c1=_0x0618[_0x568d1a];return _0x12f6c1;};'use strict';var client=require(_0x8061('0x0'));exports[_0x8061('0x1')]=function(){return function(){return client['Request'](_0x8061('0x2'),{'options':{'attributes':['id',_0x8061('0x3'),'provider','service',_0x8061('0x4'),_0x8061('0x5'),_0x8061('0x6'),_0x8061('0x7'),_0x8061('0x8')],'raw':![],'include':[{'model':_0x8061('0x9'),'as':_0x8061('0xa'),'include':[{'model':_0x8061('0xb'),'attributes':['id',_0x8061('0x3'),_0x8061('0xc'),_0x8061('0xd'),'data5'],'as':_0x8061('0xb')}]},{'model':'MailServerOut','as':_0x8061('0xe'),'include':[{'model':_0x8061('0xb'),'attributes':['id',_0x8061('0x3'),_0x8061('0xc'),_0x8061('0xd'),'data5'],'as':'CloudProvider'}]}]},'log':_0x8061('0xf')});};};exports[_0x8061('0x10')]=function(_0x593022,_0x50913f){return client[_0x8061('0x11')](_0x8061('0x12'),{'account':{'id':_0x593022},'body':_0x50913f,'log':_0x8061('0x12')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 88e806a..d685b6a 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 _0x37eb=['Request','GetSettings','getSettings'];(function(_0x22df16,_0x4219f9){var _0x58b75b=function(_0x1f02be){while(--_0x1f02be){_0x22df16['push'](_0x22df16['shift']());}};_0x58b75b(++_0x4219f9);}(_0x37eb,0x149));var _0xb37e=function(_0x59bce2,_0x50fd9e){_0x59bce2=_0x59bce2-0x0;var _0x27626e=_0x37eb[_0x59bce2];return _0x27626e;};'use strict';var client=require('../client');exports[_0xb37e('0x0')]=function(){return client[_0xb37e('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xb37e('0x2')});}; \ No newline at end of file +var _0x544c=['Request','ShowSetting','loginMailFrequency','../client','getSettings'];(function(_0x3603bc,_0x590d00){var _0x7fabf1=function(_0xb9e0a9){while(--_0xb9e0a9){_0x3603bc['push'](_0x3603bc['shift']());}};_0x7fabf1(++_0x590d00);}(_0x544c,0xf3));var _0xc544=function(_0x55ba32,_0x3c0cd5){_0x55ba32=_0x55ba32-0x0;var _0x56f1d0=_0x544c[_0x55ba32];return _0x56f1d0;};'use strict';var client=require(_0xc544('0x0'));exports[_0xc544('0x1')]=function(){return client[_0xc544('0x2')](_0xc544('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc544('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 75da0f9..e275935 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 20543ab..0312346 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 _0x6273=['default','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','createServer','timeout','port','socket.io','websocket','polling','defaults','redis','adapter','../../config/triggers','../../config/socketio','../../config/express'];(function(_0x203544,_0x4f6186){var _0x45e9aa=function(_0x367998){while(--_0x367998){_0x203544['push'](_0x203544['shift']());}};_0x45e9aa(++_0x4f6186);}(_0x6273,0xcc));var _0x3627=function(_0x5acbdc,_0x4d6dc8){_0x5acbdc=_0x5acbdc-0x0;var _0x324120=_0x6273[_0x5acbdc];return _0x324120;};'use strict';var _=require(_0x3627('0x0'));var http=require(_0x3627('0x1'));var express=require(_0x3627('0x2'));var sticky=require(_0x3627('0x3'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0x3627('0x4')](app);server[_0x3627('0x5')]=0xdbba0;if(sticky['listen'](server,config[_0x3627('0x6')])){var socketio=require(_0x3627('0x7'))(server,{'transports':[_0x3627('0x8'),_0x3627('0x9')]});config['redis']=_[_0x3627('0xa')](config[_0x3627('0xb')],{'host':'localhost','port':0x18eb});socketio[_0x3627('0xc')](require('socket.io-redis')({'pubClient':new Redis(config[_0x3627('0xb')]),'subClient':new Redis(config['redis'])}));require(_0x3627('0xd'))['default']();require(_0x3627('0xe'))['default'](socketio);require(_0x3627('0xf'))[_0x3627('0x10')](app);require(_0x3627('0x11'))[_0x3627('0x10')](app);}else{server[_0x3627('0x12')](_0x3627('0x13'),function(){console['log'](_0x3627('0x14'),config['port']);});}exports=module[_0x3627('0x15')]=app; \ No newline at end of file +var _0x1bd2=['default','../../config/socketio','../../config/express','../../routes','once','listening','log','exports','lodash','http','express','ioredis','../../config/environment','createServer','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis'];(function(_0x4430ea,_0x1867b7){var _0x431c9d=function(_0x242569){while(--_0x242569){_0x4430ea['push'](_0x4430ea['shift']());}};_0x431c9d(++_0x1867b7);}(_0x1bd2,0x133));var _0x21bd=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x1bd2[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x21bd('0x0'));var http=require(_0x21bd('0x1'));var express=require(_0x21bd('0x2'));var sticky=require('sticky-session');var Redis=require(_0x21bd('0x3'));var config=require(_0x21bd('0x4'));var app=express();var server=http[_0x21bd('0x5')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x21bd('0x6')])){var socketio=require(_0x21bd('0x7'))(server,{'transports':[_0x21bd('0x8'),_0x21bd('0x9')]});config[_0x21bd('0xa')]=_[_0x21bd('0xb')](config['redis'],{'host':_0x21bd('0xc'),'port':0x18eb});socketio[_0x21bd('0xd')](require(_0x21bd('0xe'))({'pubClient':new Redis(config[_0x21bd('0xa')]),'subClient':new Redis(config[_0x21bd('0xa')])}));require('../../config/triggers')[_0x21bd('0xf')]();require(_0x21bd('0x10'))[_0x21bd('0xf')](socketio);require(_0x21bd('0x11'))[_0x21bd('0xf')](app);require(_0x21bd('0x12'))[_0x21bd('0xf')](app);}else{server[_0x21bd('0x13')](_0x21bd('0x14'),function(){console[_0x21bd('0x15')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0x21bd('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 0bc1b4c..fe55fcc 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 _0xbe3e=['error','rpc','message','result','exports','bluebird','routing','client','http','Request','then','debug'];(function(_0x16d389,_0x2cdefc){var _0xa28d44=function(_0x4c9166){while(--_0x4c9166){_0x16d389['push'](_0x16d389['shift']());}};_0xa28d44(++_0x2cdefc);}(_0xbe3e,0x1e5));var _0xebe3=function(_0x3d6f01,_0x27a2f7){_0x3d6f01=_0x3d6f01-0x0;var _0x2d6c1f=_0xbe3e[_0x3d6f01];return _0x2d6c1f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xebe3('0x0'));var logger=require('../../config/logger')(_0xebe3('0x1'));var client=jayson[_0xebe3('0x2')][_0xebe3('0x3')]({'port':0x2329});client[_0xebe3('0x4')]=function(_0x1dfa3b,_0x645fe2){return new BPromise(function(_0xa1dcf6,_0x3f3482){return client['request'](_0x1dfa3b,_0x645fe2)[_0xebe3('0x5')](function(_0x232e31){logger[_0xebe3('0x6')]('rpc',_0xebe3('0x1'),_0x1dfa3b,_0x645fe2,_0x232e31);if(_0x232e31[_0xebe3('0x7')]){logger[_0xebe3('0x7')](_0xebe3('0x8'),_0xebe3('0x1'),_0x1dfa3b,_0x232e31['error'][_0xebe3('0x9')],_0x645fe2);return _0x3f3482(_0x232e31[_0xebe3('0x7')][_0xebe3('0x9')]);}else{return _0xa1dcf6(_0x232e31[_0xebe3('0xa')]);}})['catch'](function(_0x27dd47){logger['error'](_0xebe3('0x8'),'routing',_0x1dfa3b,_0x27dd47,_0x645fe2);return _0x3f3482(_0x27dd47);});});};module[_0xebe3('0xb')]=client; \ No newline at end of file +var _0xe483=['message','result','catch','exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','rpc','error'];(function(_0x294a10,_0xf990e3){var _0x3aea50=function(_0x1cec90){while(--_0x1cec90){_0x294a10['push'](_0x294a10['shift']());}};_0x3aea50(++_0xf990e3);}(_0xe483,0x154));var _0x3e48=function(_0x4f1beb,_0x19d3d9){_0x4f1beb=_0x4f1beb-0x0;var _0x30a38b=_0xe483[_0x4f1beb];return _0x30a38b;};'use strict';var jayson=require(_0x3e48('0x0'));var BPromise=require('bluebird');var logger=require(_0x3e48('0x1'))(_0x3e48('0x2'));var client=jayson[_0x3e48('0x3')][_0x3e48('0x4')]({'port':0x2329});client[_0x3e48('0x5')]=function(_0x3ab618,_0x39f8d6){return new BPromise(function(_0x10570d,_0x2f3150){return client[_0x3e48('0x6')](_0x3ab618,_0x39f8d6)[_0x3e48('0x7')](function(_0x5e8ac2){logger['debug'](_0x3e48('0x8'),_0x3e48('0x2'),_0x3ab618,_0x39f8d6,_0x5e8ac2);if(_0x5e8ac2[_0x3e48('0x9')]){logger[_0x3e48('0x9')](_0x3e48('0x8'),'routing',_0x3ab618,_0x5e8ac2[_0x3e48('0x9')][_0x3e48('0xa')],_0x39f8d6);return _0x2f3150(_0x5e8ac2[_0x3e48('0x9')]['message']);}else{return _0x10570d(_0x5e8ac2[_0x3e48('0xb')]);}})[_0x3e48('0xc')](function(_0x5b1887){logger['error'](_0x3e48('0x8'),_0x3e48('0x2'),_0x3ab618,_0x5b1887,_0x39f8d6);return _0x2f3150(_0x5b1887);});});};module[_0x3e48('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 5fcdf71..642c12a 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 _0x0f7b=['getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','then','getAgents','initAgents'];(function(_0x2ec903,_0x40641b){var _0x5437cd=function(_0x37a0c3){while(--_0x37a0c3){_0x2ec903['push'](_0x2ec903['shift']());}};_0x5437cd(++_0x40641b);}(_0x0f7b,0x69));var _0xb0f7=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x0f7b[_0x2642cb];return _0xe6e41;};'use strict';var BPromise=require(_0xb0f7('0x0'));var server=require(_0xb0f7('0x1'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0xb0f7('0x2'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xb0f7('0x3'));var smsQueue=require(_0xb0f7('0x4'));var mailQueue=require(_0xb0f7('0x5'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xb0f7('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xb0f7('0x7')](user[_0xb0f7('0x8')]())['then'](realtime[_0xb0f7('0x9')]())[_0xb0f7('0x7')](interval[_0xb0f7('0xa')]())['then'](realtime[_0xb0f7('0xb')]())['then'](openchannelQueue[_0xb0f7('0xc')]())[_0xb0f7('0x7')](realtime[_0xb0f7('0xd')]())[_0xb0f7('0x7')](chatQueue[_0xb0f7('0xe')]())['then'](realtime['initChatQueues']())[_0xb0f7('0x7')](smsQueue[_0xb0f7('0xf')]())[_0xb0f7('0x7')](realtime['initSmsQueues']())['then'](mailQueue['getMailQueues']())['then'](realtime['initMailQueues']())[_0xb0f7('0x7')](faxQueue[_0xb0f7('0x10')]())[_0xb0f7('0x7')](realtime[_0xb0f7('0x11')]())[_0xb0f7('0x7')](whatsappQueue[_0xb0f7('0x12')]())[_0xb0f7('0x7')](realtime[_0xb0f7('0x13')]())['then'](function(){return realtime;});}function main(){return server[_0xb0f7('0x14')](realtime)['then'](function(_0x26f8d6){return initRealtime();})[_0xb0f7('0x7')](function(_0x12900c){return setInterval(initRealtime,0x1388);})[_0xb0f7('0x15')](function(_0x1ac192){console[_0xb0f7('0x16')](_0x1ac192);});}main(); \ No newline at end of file +var _0xf429=['./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','./server'];(function(_0x34e466,_0x51b310){var _0x49a385=function(_0x344d7b){while(--_0x344d7b){_0x34e466['push'](_0x34e466['shift']());}};_0x49a385(++_0x51b310);}(_0xf429,0x107));var _0x9f42=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0xf429[_0x29632e];return _0x426e04;};'use strict';var BPromise=require('bluebird');var server=require(_0x9f42('0x0'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0x9f42('0x1'));var openchannelQueue=require(_0x9f42('0x2'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x9f42('0x3'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x9f42('0x4'));var whatsappQueue=require(_0x9f42('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x9f42('0x6')]()[_0x9f42('0x7')](user[_0x9f42('0x8')]())[_0x9f42('0x7')](realtime[_0x9f42('0x9')]())[_0x9f42('0x7')](interval[_0x9f42('0xa')]())[_0x9f42('0x7')](realtime['initIntervals']())[_0x9f42('0x7')](openchannelQueue[_0x9f42('0xb')]())[_0x9f42('0x7')](realtime[_0x9f42('0xc')]())[_0x9f42('0x7')](chatQueue['getChatQueues']())['then'](realtime[_0x9f42('0xd')]())[_0x9f42('0x7')](smsQueue[_0x9f42('0xe')]())[_0x9f42('0x7')](realtime[_0x9f42('0xf')]())[_0x9f42('0x7')](mailQueue[_0x9f42('0x10')]())[_0x9f42('0x7')](realtime['initMailQueues']())[_0x9f42('0x7')](faxQueue[_0x9f42('0x11')]())['then'](realtime[_0x9f42('0x12')]())[_0x9f42('0x7')](whatsappQueue[_0x9f42('0x13')]())['then'](realtime[_0x9f42('0x14')]())[_0x9f42('0x7')](function(){return realtime;});}function main(){return server[_0x9f42('0x15')](realtime)[_0x9f42('0x7')](function(_0x21f477){return initRealtime();})['then'](function(_0x3ab75c){return setInterval(initRealtime,0x1388);})['catch'](function(_0x51df41){console['log'](_0x51df41);});}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 edafae8..cbf407d 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 _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x3b67fb,_0x2bc525){var _0x1d0b61=function(_0x116ffd){while(--_0x116ffd){_0x3b67fb['push'](_0x3b67fb['shift']());}};_0x1d0b61(++_0x2bc525);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0x5fc3[_0x1df7b8];return _0x29d911;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x483985,_0x3bd7d7){var _0x580ad0=function(_0x5477b6){while(--_0x5477b6){_0x483985['push'](_0x483985['shift']());}};_0x580ad0(++_0x3bd7d7);}(_0xe14b,0x93));var _0xbe14=function(_0x13dc93,_0x27d2b4){_0x13dc93=_0x13dc93-0x0;var _0x139ce9=_0xe14b[_0x13dc93];return _0x139ce9;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 1137174..95ca1d9 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 _0x7daa=['message','result','sendMailMessage','SendMail','bluebird','client','http','request','then','error'];(function(_0x4fb1b8,_0x32d98d){var _0x146c71=function(_0x4bb74e){while(--_0x4bb74e){_0x4fb1b8['push'](_0x4fb1b8['shift']());}};_0x146c71(++_0x32d98d);}(_0x7daa,0x11c));var _0xa7da=function(_0x266bd6,_0x29ebb7){_0x266bd6=_0x266bd6-0x0;var _0x361f06=_0x7daa[_0x266bd6];return _0x361f06;};'use strict';var BPromise=require(_0xa7da('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xa7da('0x1')][_0xa7da('0x2')]({'port':0x232b});function request(_0x1511f6,_0x5ea67e){return new BPromise(function(_0x146c16,_0x4f3f89){return client[_0xa7da('0x3')](_0x1511f6,_0x5ea67e)[_0xa7da('0x4')](function(_0x2024ed){if(_0x2024ed[_0xa7da('0x5')]){return _0x4f3f89(_0x2024ed['error'][_0xa7da('0x6')]);}else{return _0x146c16(_0x2024ed[_0xa7da('0x7')]);}})['catch'](function(_0x39641b){return _0x4f3f89(_0x39641b);});});}exports[_0xa7da('0x8')]=function(_0x1c8d4a,_0xe4fb88){return request(_0xa7da('0x9'),{'account':_0x1c8d4a,'message':_0xe4fb88});}; \ No newline at end of file +var _0x6e70=['result','sendMailMessage','bluebird','jayson/promise','client','request','error','message'];(function(_0x4bc9d6,_0x2f0ee4){var _0x319d33=function(_0xa75f89){while(--_0xa75f89){_0x4bc9d6['push'](_0x4bc9d6['shift']());}};_0x319d33(++_0x2f0ee4);}(_0x6e70,0x17a));var _0x06e7=function(_0x36dde7,_0x3ac235){_0x36dde7=_0x36dde7-0x0;var _0x355be4=_0x6e70[_0x36dde7];return _0x355be4;};'use strict';var BPromise=require(_0x06e7('0x0'));var jayson=require(_0x06e7('0x1'));var client=jayson[_0x06e7('0x2')]['http']({'port':0x232b});function request(_0x33a008,_0x14af75){return new BPromise(function(_0x226acb,_0x4a3bc4){return client[_0x06e7('0x3')](_0x33a008,_0x14af75)['then'](function(_0x3ab4b1){if(_0x3ab4b1[_0x06e7('0x4')]){return _0x4a3bc4(_0x3ab4b1['error'][_0x06e7('0x5')]);}else{return _0x226acb(_0x3ab4b1[_0x06e7('0x6')]);}})['catch'](function(_0x46f83a){return _0x4a3bc4(_0x46f83a);});});}exports[_0x06e7('0x7')]=function(_0xa73802,_0x3b89a6){return request('SendMail',{'account':_0xa73802,'message':_0x3b89a6});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 31b9041..3a9c1c4 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 _0xdb51=['redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','chat','openchannel','whatsapp','length','Status','format','whatsappCurrentCapacity','openchannelStatus','stringify','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment'];(function(_0x4ffac9,_0x1737bd){var _0x1be752=function(_0x35738a){while(--_0x35738a){_0x4ffac9['push'](_0x4ffac9['shift']());}};_0x1be752(++_0x1737bd);}(_0xdb51,0x145));var _0x1db5=function(_0x131ab9,_0x1b6bce){_0x131ab9=_0x131ab9-0x0;var _0x5f1dcf=_0xdb51[_0x131ab9];return _0x5f1dcf;};'use strict';var _=require(_0x1db5('0x0'));var moment=require(_0x1db5('0x1'));var md5=require(_0x1db5('0x2'));var Redis=require(_0x1db5('0x3'));var config=require(_0x1db5('0x4'));config[_0x1db5('0x5')]=_['defaults'](config[_0x1db5('0x5')],{'host':_0x1db5('0x6'),'port':0x18eb});var io=require(_0x1db5('0x7'))(new Redis(config[_0x1db5('0x5')]));function Agent(_0x722a68){this['id']=_0x722a68['id']||0x0;this[_0x1db5('0x8')]=_0x722a68[_0x1db5('0x8')]||'';this[_0x1db5('0x9')]=_0x722a68[_0x1db5('0x9')]||!![];this[_0x1db5('0xa')]=_0x722a68[_0x1db5('0xa')]||![];this[_0x1db5('0xb')]=_0x722a68[_0x1db5('0xb')]||![];this[_0x1db5('0xc')]=_0x722a68['mailPause']||![];this[_0x1db5('0xd')]=_0x722a68['faxPause']||![];this[_0x1db5('0xe')]=_0x722a68['smsPause']||![];this[_0x1db5('0xf')]=_0x722a68[_0x1db5('0xf')]||![];this[_0x1db5('0x10')]=_0x1db5('0x11');this[_0x1db5('0x12')]=0x0;this[_0x1db5('0x13')]=_0x722a68[_0x1db5('0x13')]||0x0;this[_0x1db5('0x14')]=0x0;this[_0x1db5('0x15')]=_0x1db5('0x11');this[_0x1db5('0x16')]=0x0;this[_0x1db5('0x17')]=_0x722a68[_0x1db5('0x17')]||0x0;this[_0x1db5('0x18')]=0x0;this[_0x1db5('0x19')]='unknown';this[_0x1db5('0x1a')]=0x0;this['faxCapacity']=_0x722a68[_0x1db5('0x1b')]||0x0;this[_0x1db5('0x1c')]=0x0;this[_0x1db5('0x1d')]=_0x1db5('0x11');this[_0x1db5('0x1e')]=0x0;this[_0x1db5('0x1f')]=_0x722a68['smsCapacity']||0x0;this[_0x1db5('0x20')]=0x0;this[_0x1db5('0x21')]='unknown';this[_0x1db5('0x22')]=0x0;this[_0x1db5('0x23')]=_0x722a68[_0x1db5('0x23')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']='unknown';this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x722a68['openchannelCapacity']||0x0;this[_0x1db5('0x24')]=0x0;this['busy']=![];this[_0x1db5('0x25')]=undefined;this[_0x1db5('0x2')]='';this[_0x1db5('0x26')]();}Agent[_0x1db5('0x27')][_0x1db5('0x28')]=function(_0x53ccff){if(this[_0x53ccff+_0x1db5('0x29')]>0x0){if(this[_0x53ccff+_0x1db5('0x2a')]>0x0&&this[_0x53ccff+_0x1db5('0x29')]>=this[_0x53ccff+'Capacity']){return'maxcapacity';}else{return _0x1db5('0x2b');}}else{return'idle';}};Agent['prototype'][_0x1db5('0x26')]=function(){var _0x188ae4=['mail',_0x1db5('0x2c'),_0x1db5('0x2d'),'fax','sms',_0x1db5('0x2e')];for(var _0x8c217e=0x0;_0x8c217e<_0x188ae4[_0x1db5('0x2f')];_0x8c217e+=0x1){var _0x86b6ca=this[_0x1db5('0x28')](_0x188ae4[_0x8c217e]);if(this[_0x188ae4[_0x8c217e]+_0x1db5('0x30')]!==_0x86b6ca){this[_0x188ae4[_0x8c217e]+'StatusTime']=_['toNumber'](moment()[_0x1db5('0x31')]('x'));}this[_0x188ae4[_0x8c217e]+'Status']=_0x86b6ca;}var _0x252f4f={'id':this['id'],'name':this[_0x1db5('0x8')],'online':this[_0x1db5('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x1db5('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0x1db5('0xe')],'faxPause':this[_0x1db5('0xd')],'openchannelPause':this[_0x1db5('0xf')],'chatStatus':this[_0x1db5('0x10')],'chatStatusTime':this[_0x1db5('0x12')],'chatCapacity':this[_0x1db5('0x13')],'chatCurrentCapacity':this[_0x1db5('0x14')],'mailStatus':this[_0x1db5('0x15')],'mailStatusTime':this[_0x1db5('0x16')],'mailCapacity':this[_0x1db5('0x17')],'mailCurrentCapacity':this[_0x1db5('0x18')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x1db5('0x1a')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x1db5('0x1c')],'smsStatus':this[_0x1db5('0x1d')],'smsStatusTime':this[_0x1db5('0x1e')],'smsCapacity':this[_0x1db5('0x1f')],'smsCurrentCapacity':this[_0x1db5('0x20')],'whatsappStatus':this[_0x1db5('0x21')],'whatsappStatusTime':this[_0x1db5('0x22')],'whatsappCapacity':this[_0x1db5('0x23')],'whatsappCurrentCapacity':this[_0x1db5('0x32')],'openchannelStatus':this[_0x1db5('0x33')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x1db5('0x25')]};var _0x54dd6d=md5(JSON[_0x1db5('0x34')](_0x252f4f));if(this['md5']!==_0x54dd6d){this['md5']=_0x54dd6d;io[_0x1db5('0x35')](_0x1db5('0x36'),_0x252f4f);}};module['exports']=Agent; \ No newline at end of file +var _0x602a=['ioredis','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','unknown','chatStatusTime','chatCapacity','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','getChannelStatus','Status','toNumber','format','chatStatus','chatCurrentCapacity','mailStatus','mailCurrentCapacity','busyQueue','stringify','emit','user:save','exports','lodash','md5'];(function(_0x159818,_0x29c189){var _0x577027=function(_0x22639b){while(--_0x22639b){_0x159818['push'](_0x159818['shift']());}};_0x577027(++_0x29c189);}(_0x602a,0x1de));var _0xa602=function(_0xa14f4e,_0x5be868){_0xa14f4e=_0xa14f4e-0x0;var _0x5a6895=_0x602a[_0xa14f4e];return _0x5a6895;};'use strict';var _=require(_0xa602('0x0'));var moment=require('moment');var md5=require(_0xa602('0x1'));var Redis=require(_0xa602('0x2'));var config=require(_0xa602('0x3'));config[_0xa602('0x4')]=_['defaults'](config[_0xa602('0x4')],{'host':_0xa602('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa602('0x4')]));function Agent(_0x3777ac){this['id']=_0x3777ac['id']||0x0;this[_0xa602('0x6')]=_0x3777ac[_0xa602('0x6')]||'';this['online']=_0x3777ac[_0xa602('0x7')]||!![];this[_0xa602('0x8')]=_0x3777ac[_0xa602('0x8')]||![];this[_0xa602('0x9')]=_0x3777ac[_0xa602('0x9')]||![];this[_0xa602('0xa')]=_0x3777ac['mailPause']||![];this[_0xa602('0xb')]=_0x3777ac[_0xa602('0xb')]||![];this[_0xa602('0xc')]=_0x3777ac['smsPause']||![];this['openchannelPause']=_0x3777ac['openchannelPause']||![];this['chatStatus']=_0xa602('0xd');this[_0xa602('0xe')]=0x0;this[_0xa602('0xf')]=_0x3777ac[_0xa602('0xf')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0xa602('0xd');this[_0xa602('0x10')]=0x0;this[_0xa602('0x11')]=_0x3777ac['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0xa602('0x12')]=_0xa602('0xd');this[_0xa602('0x13')]=0x0;this[_0xa602('0x14')]=_0x3777ac[_0xa602('0x14')]||0x0;this[_0xa602('0x15')]=0x0;this[_0xa602('0x16')]=_0xa602('0xd');this[_0xa602('0x17')]=0x0;this[_0xa602('0x18')]=_0x3777ac[_0xa602('0x18')]||0x0;this[_0xa602('0x19')]=0x0;this[_0xa602('0x1a')]=_0xa602('0xd');this[_0xa602('0x1b')]=0x0;this['whatsappCapacity']=_0x3777ac[_0xa602('0x1c')]||0x0;this[_0xa602('0x1d')]=0x0;this[_0xa602('0x1e')]=_0xa602('0xd');this[_0xa602('0x1f')]=0x0;this[_0xa602('0x20')]=_0x3777ac[_0xa602('0x20')]||0x0;this[_0xa602('0x21')]=0x0;this[_0xa602('0x22')]=![];this['busyQueue']=undefined;this[_0xa602('0x1')]='';this[_0xa602('0x23')]();}Agent['prototype']['getChannelStatus']=function(_0x520a9f){if(this[_0x520a9f+_0xa602('0x24')]>0x0){if(this[_0x520a9f+_0xa602('0x25')]>0x0&&this[_0x520a9f+_0xa602('0x24')]>=this[_0x520a9f+_0xa602('0x25')]){return _0xa602('0x26');}else{return _0xa602('0x27');}}else{return _0xa602('0x28');}};Agent['prototype']['updateRealtime']=function(){var _0x3a9da1=[_0xa602('0x29'),_0xa602('0x2a'),_0xa602('0x2b'),_0xa602('0x2c'),_0xa602('0x2d'),_0xa602('0x2e')];for(var _0xb64b84=0x0;_0xb64b84<_0x3a9da1['length'];_0xb64b84+=0x1){var _0x4ba62d=this[_0xa602('0x2f')](_0x3a9da1[_0xb64b84]);if(this[_0x3a9da1[_0xb64b84]+_0xa602('0x30')]!==_0x4ba62d){this[_0x3a9da1[_0xb64b84]+'StatusTime']=_[_0xa602('0x31')](moment()[_0xa602('0x32')]('x'));}this[_0x3a9da1[_0xb64b84]+_0xa602('0x30')]=_0x4ba62d;}var _0x13f3eb={'id':this['id'],'name':this[_0xa602('0x6')],'online':this[_0xa602('0x7')],'voicePause':this[_0xa602('0x8')],'chatPause':this[_0xa602('0x9')],'mailPause':this[_0xa602('0xa')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xa602('0x33')],'chatStatusTime':this[_0xa602('0xe')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xa602('0x34')],'mailStatus':this[_0xa602('0x35')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xa602('0x11')],'mailCurrentCapacity':this[_0xa602('0x36')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xa602('0x14')],'faxCurrentCapacity':this[_0xa602('0x15')],'smsStatus':this[_0xa602('0x16')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xa602('0x18')],'smsCurrentCapacity':this[_0xa602('0x19')],'whatsappStatus':this[_0xa602('0x1a')],'whatsappStatusTime':this[_0xa602('0x1b')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xa602('0x1e')],'openchannelStatusTime':this[_0xa602('0x1f')],'openchannelCapacity':this[_0xa602('0x20')],'openchannelCurrentCapacity':this[_0xa602('0x21')],'busy':this[_0xa602('0x22')],'busyQueue':this[_0xa602('0x37')]};var _0x54aa60=md5(JSON[_0xa602('0x38')](_0x13f3eb));if(this[_0xa602('0x1')]!==_0x54aa60){this['md5']=_0x54aa60;io[_0xa602('0x39')](_0xa602('0x3a'),_0x13f3eb);}};module[_0xa602('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 4900745..fc83e36 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 _0xd2e2=['beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','paused','online','loggedIn','chatPause','available','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy'];(function(_0x58457c,_0x288599){var _0x20df95=function(_0x492742){while(--_0x492742){_0x58457c['push'](_0x58457c['shift']());}};_0x20df95(++_0x288599);}(_0xd2e2,0x18c));var _0x2d2e=function(_0x57bd16,_0x207bfd){_0x57bd16=_0x57bd16-0x0;var _0x5d99fc=_0xd2e2[_0x57bd16];return _0x5d99fc;};'use strict';var _=require(_0x2d2e('0x0'));var md5=require(_0x2d2e('0x1'));var util=require(_0x2d2e('0x2'));var Redis=require('ioredis');var config=require(_0x2d2e('0x3'));config[_0x2d2e('0x4')]=_[_0x2d2e('0x5')](config[_0x2d2e('0x4')],{'host':_0x2d2e('0x6'),'port':0x18eb});var io=require(_0x2d2e('0x7'))(new Redis(config[_0x2d2e('0x4')]));function ChatQueue(_0x20ee70){this['id']=_0x20ee70['id']||0x0;this['name']=_0x20ee70[_0x2d2e('0x8')]||'';this['timeout']=_0x20ee70['timeout']||0xa;this[_0x2d2e('0x9')]=_0x20ee70['strategy']||_0x2d2e('0xa');this[_0x2d2e('0xb')]=_0x20ee70[_0x2d2e('0xb')];this[_0x2d2e('0xc')]={};this[_0x2d2e('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x2d2e('0xe')]();}ChatQueue[_0x2d2e('0xf')][_0x2d2e('0x10')]=function(){var _0x37b654=this[_0x2d2e('0xc')][_0x2d2e('0x11')];this[_0x2d2e('0xc')]=_[_0x2d2e('0x12')](this[_0x2d2e('0xb')],'id');this['mapAgentsId'][_0x2d2e('0x11')]=_0x37b654;};ChatQueue['prototype'][_0x2d2e('0xe')]=function(){this['loggedIn']=0x0;this[_0x2d2e('0x13')]=0x0;for(var _0x2d86ba=0x0;_0x2d86ba=0x0?this[_0x2d2e('0x17')]:0x0;var _0x164b8f={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2d2e('0x15')],'name':this[_0x2d2e('0x8')],'paused':this[_0x2d2e('0x13')],'waiting':this['waiting']};var _0x3f6c13=md5(JSON[_0x2d2e('0x18')](_0x164b8f));if(this[_0x2d2e('0x1')]!==_0x3f6c13){this[_0x2d2e('0x1')]=_0x3f6c13;io['to'](util['format'](_0x2d2e('0x19'),_0x164b8f[_0x2d2e('0x8')]))[_0x2d2e('0x1a')](_0x2d2e('0x1b'),_0x164b8f);}};module[_0x2d2e('0x1c')]=ChatQueue; \ No newline at end of file +var _0xe721=['strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','Agents','online','available','format','chat:queue:%s','exports','lodash','md5','util','ioredis','redis','defaults','socket.io-emitter','name','timeout'];(function(_0x59486a,_0x44a427){var _0x48e184=function(_0x2b40dc){while(--_0x2b40dc){_0x59486a['push'](_0x59486a['shift']());}};_0x48e184(++_0x44a427);}(_0xe721,0xfb));var _0x1e72=function(_0x415949,_0x414e4e){_0x415949=_0x415949-0x0;var _0x3a7220=_0xe721[_0x415949];return _0x3a7220;};'use strict';var _=require(_0x1e72('0x0'));var md5=require(_0x1e72('0x1'));var util=require(_0x1e72('0x2'));var Redis=require(_0x1e72('0x3'));var config=require('../../../config/environment');config[_0x1e72('0x4')]=_[_0x1e72('0x5')](config[_0x1e72('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x1e72('0x6'))(new Redis(config[_0x1e72('0x4')]));function ChatQueue(_0x58fa96){this['id']=_0x58fa96['id']||0x0;this['name']=_0x58fa96[_0x1e72('0x7')]||'';this[_0x1e72('0x8')]=_0x58fa96[_0x1e72('0x8')]||0xa;this[_0x1e72('0x9')]=_0x58fa96[_0x1e72('0x9')]||_0x1e72('0xa');this['Agents']=_0x58fa96['Agents'];this[_0x1e72('0xb')]={};this[_0x1e72('0xc')]=0x0;this[_0x1e72('0x1')]='';this[_0x1e72('0xd')]();this[_0x1e72('0xe')]();}ChatQueue[_0x1e72('0xf')][_0x1e72('0xd')]=function(){var _0x19bc85=this['mapAgentsId'][_0x1e72('0x10')];this[_0x1e72('0xb')]=_['map'](this['Agents'],'id');this[_0x1e72('0xb')]['_rr']=_0x19bc85;};ChatQueue['prototype'][_0x1e72('0xe')]=function(){this[_0x1e72('0x11')]=0x0;this[_0x1e72('0x12')]=0x0;for(var _0x10f4b3=0x0;_0x10f4b3=0x0?this[_0x1e72('0x16')]:0x0;var _0x47343a={'id':this['id'],'available':this[_0x1e72('0x16')],'loggedIn':this[_0x1e72('0x11')],'name':this[_0x1e72('0x7')],'paused':this[_0x1e72('0x12')],'waiting':this[_0x1e72('0xc')]};var _0x415f16=md5(JSON['stringify'](_0x47343a));if(this[_0x1e72('0x1')]!==_0x415f16){this[_0x1e72('0x1')]=_0x415f16;io['to'](util[_0x1e72('0x17')](_0x1e72('0x18'),_0x47343a[_0x1e72('0x7')]))['emit']('chat_queue:save',_0x47343a);}};module[_0x1e72('0x19')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 77c6b2b..91bea47 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 _0x4344=['name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','faxPause','available','waiting','stringify','format','fax:queue:%s','emit','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost'];(function(_0x134f18,_0x411015){var _0x53a442=function(_0x4ae9c7){while(--_0x4ae9c7){_0x134f18['push'](_0x134f18['shift']());}};_0x53a442(++_0x411015);}(_0x4344,0x149));var _0x4434=function(_0x1044d4,_0x29d03a){_0x1044d4=_0x1044d4-0x0;var _0x233156=_0x4344[_0x1044d4];return _0x233156;};'use strict';var _=require(_0x4434('0x0'));var md5=require(_0x4434('0x1'));var util=require('util');var Redis=require(_0x4434('0x2'));var config=require(_0x4434('0x3'));config['redis']=_[_0x4434('0x4')](config[_0x4434('0x5')],{'host':_0x4434('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4434('0x5')]));function FaxQueue(_0x10c228){this['id']=_0x10c228['id']||0x0;this[_0x4434('0x7')]=_0x10c228[_0x4434('0x7')]||'';this['timeout']=_0x10c228[_0x4434('0x8')]||0xa;this['strategy']=_0x10c228[_0x4434('0x9')]||_0x4434('0xa');this[_0x4434('0xb')]=_0x10c228[_0x4434('0xb')];this[_0x4434('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x4434('0xd')]();this[_0x4434('0xe')]();}FaxQueue[_0x4434('0xf')][_0x4434('0xd')]=function(){var _0x4769fc=this[_0x4434('0xc')][_0x4434('0x10')];this[_0x4434('0xc')]=_[_0x4434('0x11')](this[_0x4434('0xb')],'id');this[_0x4434('0xc')]['_rr']=_0x4769fc;};FaxQueue[_0x4434('0xf')][_0x4434('0xe')]=function(){this[_0x4434('0x12')]=0x0;this[_0x4434('0x13')]=0x0;for(var _0xe9f98b=0x0;_0xe9f98b=0x0?this['available']:0x0;var _0xcc4b38={'id':this['id'],'available':this[_0x4434('0x15')],'loggedIn':this[_0x4434('0x12')],'name':this[_0x4434('0x7')],'paused':this['paused'],'waiting':this[_0x4434('0x16')]};var _0x5e7ac9=md5(JSON[_0x4434('0x17')](_0xcc4b38));if(this['md5']!==_0x5e7ac9){this[_0x4434('0x1')]=_0x5e7ac9;io['to'](util[_0x4434('0x18')](_0x4434('0x19'),_0xcc4b38[_0x4434('0x7')]))[_0x4434('0x1a')]('fax_queue:save',_0xcc4b38);}};module[_0x4434('0x1b')]=FaxQueue; \ No newline at end of file +var _0xf9d7=['updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','faxPause','available','waiting','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x11a372,_0x26d3da){var _0x2943be=function(_0x1f3040){while(--_0x1f3040){_0x11a372['push'](_0x11a372['shift']());}};_0x2943be(++_0x26d3da);}(_0xf9d7,0x132));var _0x7f9d=function(_0x2b7248,_0x17b24e){_0x2b7248=_0x2b7248-0x0;var _0x418838=_0xf9d7[_0x2b7248];return _0x418838;};'use strict';var _=require(_0x7f9d('0x0'));var md5=require(_0x7f9d('0x1'));var util=require(_0x7f9d('0x2'));var Redis=require(_0x7f9d('0x3'));var config=require('../../../config/environment');config[_0x7f9d('0x4')]=_[_0x7f9d('0x5')](config[_0x7f9d('0x4')],{'host':_0x7f9d('0x6'),'port':0x18eb});var io=require(_0x7f9d('0x7'))(new Redis(config[_0x7f9d('0x4')]));function FaxQueue(_0x104d7d){this['id']=_0x104d7d['id']||0x0;this['name']=_0x104d7d[_0x7f9d('0x8')]||'';this[_0x7f9d('0x9')]=_0x104d7d[_0x7f9d('0x9')]||0xa;this['strategy']=_0x104d7d[_0x7f9d('0xa')]||'beepall';this[_0x7f9d('0xb')]=_0x104d7d[_0x7f9d('0xb')];this[_0x7f9d('0xc')]={};this['waiting']=0x0;this[_0x7f9d('0x1')]='';this['updateRouting']();this[_0x7f9d('0xd')]();}FaxQueue[_0x7f9d('0xe')][_0x7f9d('0xf')]=function(){var _0x2d89c6=this[_0x7f9d('0xc')][_0x7f9d('0x10')];this[_0x7f9d('0xc')]=_[_0x7f9d('0x11')](this['Agents'],'id');this[_0x7f9d('0xc')][_0x7f9d('0x10')]=_0x2d89c6;};FaxQueue['prototype'][_0x7f9d('0xd')]=function(){this[_0x7f9d('0x12')]=0x0;this[_0x7f9d('0x13')]=0x0;for(var _0x230891=0x0;_0x230891=0x0?this[_0x7f9d('0x16')]:0x0;var _0x372c88={'id':this['id'],'available':this[_0x7f9d('0x16')],'loggedIn':this[_0x7f9d('0x12')],'name':this['name'],'paused':this[_0x7f9d('0x13')],'waiting':this[_0x7f9d('0x17')]};var _0x2632b3=md5(JSON[_0x7f9d('0x18')](_0x372c88));if(this['md5']!==_0x2632b3){this['md5']=_0x2632b3;io['to'](util[_0x7f9d('0x19')](_0x7f9d('0x1a'),_0x372c88[_0x7f9d('0x8')]))['emit'](_0x7f9d('0x1b'),_0x372c88);}};module[_0x7f9d('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index c3ccbe3..e88e10e 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 _0x7e54=['name','Intervals'];(function(_0xce1b23,_0x1a768c){var _0xee9d1e=function(_0x24898a){while(--_0x24898a){_0xce1b23['push'](_0xce1b23['shift']());}};_0xee9d1e(++_0x1a768c);}(_0x7e54,0x1c0));var _0x47e5=function(_0x476d3b,_0x45a715){_0x476d3b=_0x476d3b-0x0;var _0x241841=_0x7e54[_0x476d3b];return _0x241841;};'use strict';function Interval(_0x3c867b){this['id']=_0x3c867b['id']||0x0;this['name']=_0x3c867b[_0x47e5('0x0')]||'';this[_0x47e5('0x1')]=_0x3c867b['Intervals']||{};}module['exports']=Interval; \ No newline at end of file +var _0x4de5=['exports','name','Intervals'];(function(_0x1c2f29,_0x5a2668){var _0x258465=function(_0x30332f){while(--_0x30332f){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x258465(++_0x5a2668);}(_0x4de5,0xd9));var _0x54de=function(_0x134353,_0x2911b2){_0x134353=_0x134353-0x0;var _0x2ead3c=_0x4de5[_0x134353];return _0x2ead3c;};'use strict';function Interval(_0x728b8a){this['id']=_0x728b8a['id']||0x0;this[_0x54de('0x0')]=_0x728b8a[_0x54de('0x0')]||'';this[_0x54de('0x1')]=_0x728b8a[_0x54de('0x1')]||{};}module[_0x54de('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 4bf8c56..fc28041 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 _0x98d8=['mailPause','paused','available','md5','mail:queue:%s','emit','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','loggedIn','length'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0x98d8,0x14b));var _0x898d=function(_0x5d5373,_0x10cd97){_0x5d5373=_0x5d5373-0x0;var _0x360a4a=_0x98d8[_0x5d5373];return _0x360a4a;};'use strict';var _=require(_0x898d('0x0'));var md5=require('md5');var util=require(_0x898d('0x1'));var Redis=require('ioredis');var config=require(_0x898d('0x2'));config[_0x898d('0x3')]=_[_0x898d('0x4')](config[_0x898d('0x3')],{'host':_0x898d('0x5'),'port':0x18eb});var io=require(_0x898d('0x6'))(new Redis(config[_0x898d('0x3')]));function MailQueue(_0x1136f5){this['id']=_0x1136f5['id']||0x0;this[_0x898d('0x7')]=_0x1136f5[_0x898d('0x7')]||'';this[_0x898d('0x8')]=_0x1136f5[_0x898d('0x8')]||0xa;this['strategy']=_0x1136f5[_0x898d('0x9')]||_0x898d('0xa');this[_0x898d('0xb')]=_0x1136f5[_0x898d('0xb')];this[_0x898d('0xc')]={};this[_0x898d('0xd')]=0x0;this['md5']='';this[_0x898d('0xe')]();this[_0x898d('0xf')]();}MailQueue[_0x898d('0x10')][_0x898d('0xe')]=function(){var _0x203b1c=this[_0x898d('0xc')]['_rr'];this[_0x898d('0xc')]=_[_0x898d('0x11')](this['Agents'],'id');this[_0x898d('0xc')]['_rr']=_0x203b1c;};MailQueue['prototype'][_0x898d('0xf')]=function(){this[_0x898d('0x12')]=0x0;this['paused']=0x0;for(var _0x40e948=0x0;_0x40e948=0x0?this[_0x898d('0x16')]:0x0;var _0x2caac9={'id':this['id'],'available':this[_0x898d('0x16')],'loggedIn':this[_0x898d('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x898d('0xd')]};var _0x3a1bfc=md5(JSON['stringify'](_0x2caac9));if(this[_0x898d('0x17')]!==_0x3a1bfc){this[_0x898d('0x17')]=_0x3a1bfc;io['to'](util['format'](_0x898d('0x18'),_0x2caac9['name']))[_0x898d('0x19')]('mail_queue:save',_0x2caac9);}};module[_0x898d('0x1a')]=MailQueue; \ No newline at end of file +var _0x794e=['beepall','Agents','waiting','updateRouting','mapAgentsId','_rr','loggedIn','paused','length','online','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','md5','util','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x794e,0x93));var _0xe794=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x794e[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var md5=require(_0xe794('0x0'));var util=require(_0xe794('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xe794('0x2')](config[_0xe794('0x3')],{'host':_0xe794('0x4'),'port':0x18eb});var io=require(_0xe794('0x5'))(new Redis(config['redis']));function MailQueue(_0x39109d){this['id']=_0x39109d['id']||0x0;this[_0xe794('0x6')]=_0x39109d[_0xe794('0x6')]||'';this[_0xe794('0x7')]=_0x39109d[_0xe794('0x7')]||0xa;this[_0xe794('0x8')]=_0x39109d[_0xe794('0x8')]||_0xe794('0x9');this['Agents']=_0x39109d[_0xe794('0xa')];this['mapAgentsId']={};this[_0xe794('0xb')]=0x0;this[_0xe794('0x0')]='';this[_0xe794('0xc')]();this['updateRealtime']();}MailQueue['prototype'][_0xe794('0xc')]=function(){var _0x4c917e=this[_0xe794('0xd')]['_rr'];this[_0xe794('0xd')]=_['map'](this[_0xe794('0xa')],'id');this[_0xe794('0xd')][_0xe794('0xe')]=_0x4c917e;};MailQueue['prototype']['updateRealtime']=function(){this[_0xe794('0xf')]=0x0;this[_0xe794('0x10')]=0x0;for(var _0x4392c4=0x0;_0x4392c4=0x0?this[_0xe794('0x14')]:0x0;var _0x4ad73a={'id':this['id'],'available':this[_0xe794('0x14')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xe794('0x10')],'waiting':this[_0xe794('0xb')]};var _0x40bbfa=md5(JSON[_0xe794('0x15')](_0x4ad73a));if(this[_0xe794('0x0')]!==_0x40bbfa){this[_0xe794('0x0')]=_0x40bbfa;io['to'](util['format'](_0xe794('0x16'),_0x4ad73a['name']))[_0xe794('0x17')](_0xe794('0x18'),_0x4ad73a);}};module[_0xe794('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 47e204a..781a74a 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0xa04daf,_0x25e602){var _0x3f7fa6=function(_0x41b149){while(--_0x41b149){_0xa04daf['push'](_0xa04daf['shift']());}};_0x3f7fa6(++_0x25e602);}(_0x5fc3,0xa8));var _0x35fc=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x5fc3[_0x874cf1];return _0x233579;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=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(_0x3ef2d5,_0x423d46){var _0x2fefb2=function(_0x54f82f){while(--_0x54f82f){_0x3ef2d5['push'](_0x3ef2d5['shift']());}};_0x2fefb2(++_0x423d46);}(_0x2ef3,0xba));var _0x32ef=function(_0x578106,_0x36e2a0){_0x578106=_0x578106-0x0;var _0x6ef762=_0x2ef3[_0x578106];return _0x6ef762;};'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 f83b4e0..e0550d4 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 _0xd404=['_rr','map','loggedIn','paused','online','smsPause','available','stringify','sms:queue:%s','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd404,0x15b));var _0x4d40=function(_0x24252f,_0xc37add){_0x24252f=_0x24252f-0x0;var _0x2f00b7=_0xd404[_0x24252f];return _0x2f00b7;};'use strict';var _=require(_0x4d40('0x0'));var md5=require(_0x4d40('0x1'));var util=require('util');var Redis=require(_0x4d40('0x2'));var config=require(_0x4d40('0x3'));config['redis']=_[_0x4d40('0x4')](config[_0x4d40('0x5')],{'host':_0x4d40('0x6'),'port':0x18eb});var io=require(_0x4d40('0x7'))(new Redis(config[_0x4d40('0x5')]));function SmsQueue(_0x1496b3){this['id']=_0x1496b3['id']||0x0;this[_0x4d40('0x8')]=_0x1496b3[_0x4d40('0x8')]||'';this[_0x4d40('0x9')]=_0x1496b3['timeout']||0xa;this[_0x4d40('0xa')]=_0x1496b3[_0x4d40('0xa')]||'beepall';this[_0x4d40('0xb')]=_0x1496b3['Agents'];this['mapAgentsId']={};this[_0x4d40('0xc')]=0x0;this[_0x4d40('0x1')]='';this[_0x4d40('0xd')]();this[_0x4d40('0xe')]();}SmsQueue[_0x4d40('0xf')][_0x4d40('0xd')]=function(){var _0x1cc554=this[_0x4d40('0x10')][_0x4d40('0x11')];this[_0x4d40('0x10')]=_[_0x4d40('0x12')](this[_0x4d40('0xb')],'id');this[_0x4d40('0x10')][_0x4d40('0x11')]=_0x1cc554;};SmsQueue['prototype'][_0x4d40('0xe')]=function(){this[_0x4d40('0x13')]=0x0;this[_0x4d40('0x14')]=0x0;for(var _0x2083bd=0x0;_0x2083bd=0x0?this[_0x4d40('0x17')]:0x0;var _0x1c0cd8={'id':this['id'],'available':this['available'],'loggedIn':this[_0x4d40('0x13')],'name':this[_0x4d40('0x8')],'paused':this['paused'],'waiting':this[_0x4d40('0xc')]};var _0x5a77e0=md5(JSON[_0x4d40('0x18')](_0x1c0cd8));if(this[_0x4d40('0x1')]!==_0x5a77e0){this['md5']=_0x5a77e0;io['to'](util['format'](_0x4d40('0x19'),_0x1c0cd8[_0x4d40('0x8')]))['emit'](_0x4d40('0x1a'),_0x1c0cd8);}};module[_0x4d40('0x1b')]=SmsQueue; \ No newline at end of file +var _0xbe31=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn','available','stringify','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x2a95bb,_0x2e4aab){var _0xcb72ba=function(_0x42f79f){while(--_0x42f79f){_0x2a95bb['push'](_0x2a95bb['shift']());}};_0xcb72ba(++_0x2e4aab);}(_0xbe31,0x83));var _0x1be3=function(_0xfa99ba,_0x4d6ba2){_0xfa99ba=_0xfa99ba-0x0;var _0x3f2c62=_0xbe31[_0xfa99ba];return _0x3f2c62;};'use strict';var _=require('lodash');var md5=require(_0x1be3('0x0'));var util=require(_0x1be3('0x1'));var Redis=require(_0x1be3('0x2'));var config=require(_0x1be3('0x3'));config[_0x1be3('0x4')]=_[_0x1be3('0x5')](config[_0x1be3('0x4')],{'host':_0x1be3('0x6'),'port':0x18eb});var io=require(_0x1be3('0x7'))(new Redis(config['redis']));function SmsQueue(_0x2d4d97){this['id']=_0x2d4d97['id']||0x0;this['name']=_0x2d4d97[_0x1be3('0x8')]||'';this[_0x1be3('0x9')]=_0x2d4d97[_0x1be3('0x9')]||0xa;this[_0x1be3('0xa')]=_0x2d4d97[_0x1be3('0xa')]||_0x1be3('0xb');this[_0x1be3('0xc')]=_0x2d4d97[_0x1be3('0xc')];this[_0x1be3('0xd')]={};this[_0x1be3('0xe')]=0x0;this['md5']='';this[_0x1be3('0xf')]();this[_0x1be3('0x10')]();}SmsQueue[_0x1be3('0x11')][_0x1be3('0xf')]=function(){var _0x1f4ea8=this[_0x1be3('0xd')][_0x1be3('0x12')];this[_0x1be3('0xd')]=_[_0x1be3('0x13')](this['Agents'],'id');this[_0x1be3('0xd')]['_rr']=_0x1f4ea8;};SmsQueue[_0x1be3('0x11')][_0x1be3('0x10')]=function(){this['loggedIn']=0x0;this[_0x1be3('0x14')]=0x0;for(var _0x573684=0x0;_0x573684=0x0?this[_0x1be3('0x18')]:0x0;var _0xaa1d7b={'id':this['id'],'available':this[_0x1be3('0x18')],'loggedIn':this[_0x1be3('0x17')],'name':this[_0x1be3('0x8')],'paused':this[_0x1be3('0x14')],'waiting':this[_0x1be3('0xe')]};var _0x745447=md5(JSON[_0x1be3('0x19')](_0xaa1d7b));if(this[_0x1be3('0x0')]!==_0x745447){this[_0x1be3('0x0')]=_0x745447;io['to'](util['format']('sms:queue:%s',_0xaa1d7b[_0x1be3('0x8')]))['emit'](_0x1be3('0x1a'),_0xaa1d7b);}};module[_0x1be3('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index b9caf8d..e2fab7e 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 _0xd67f=['waiting','stringify','format','emit','exports','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','available'];(function(_0x36b2c5,_0x5eaf9a){var _0x919462=function(_0x54bbbf){while(--_0x54bbbf){_0x36b2c5['push'](_0x36b2c5['shift']());}};_0x919462(++_0x5eaf9a);}(_0xd67f,0x1f3));var _0xfd67=function(_0x5381f6,_0x3bf2d9){_0x5381f6=_0x5381f6-0x0;var _0x534a93=_0xd67f[_0x5381f6];return _0x534a93;};'use strict';var _=require('lodash');var md5=require(_0xfd67('0x0'));var util=require('util');var Redis=require(_0xfd67('0x1'));var config=require(_0xfd67('0x2'));config[_0xfd67('0x3')]=_['defaults'](config[_0xfd67('0x3')],{'host':_0xfd67('0x4'),'port':0x18eb});var io=require(_0xfd67('0x5'))(new Redis(config[_0xfd67('0x3')]));function WhatsappQueue(_0xd9cccc){this['id']=_0xd9cccc['id']||0x0;this[_0xfd67('0x6')]=_0xd9cccc[_0xfd67('0x6')]||'';this['timeout']=_0xd9cccc['timeout']||0xa;this[_0xfd67('0x7')]=_0xd9cccc[_0xfd67('0x7')]||_0xfd67('0x8');this[_0xfd67('0x9')]=_0xd9cccc['Agents'];this[_0xfd67('0xa')]={};this['waiting']=0x0;this['md5']='';this[_0xfd67('0xb')]();this[_0xfd67('0xc')]();}WhatsappQueue[_0xfd67('0xd')][_0xfd67('0xb')]=function(){var _0xc06a8a=this[_0xfd67('0xa')]['_rr'];this[_0xfd67('0xa')]=_[_0xfd67('0xe')](this['Agents'],'id');this[_0xfd67('0xa')][_0xfd67('0xf')]=_0xc06a8a;};WhatsappQueue['prototype'][_0xfd67('0xc')]=function(){this[_0xfd67('0x10')]=0x0;this[_0xfd67('0x11')]=0x0;for(var _0x2497a0=0x0;_0x2497a0=0x0?this['available']:0x0;var _0x3c7579={'id':this['id'],'available':this[_0xfd67('0x14')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xfd67('0x11')],'waiting':this[_0xfd67('0x15')]};var _0x2fffa0=md5(JSON[_0xfd67('0x16')](_0x3c7579));if(this[_0xfd67('0x0')]!==_0x2fffa0){this[_0xfd67('0x0')]=_0x2fffa0;io['to'](util[_0xfd67('0x17')]('whatsapp:queue:%s',_0x3c7579[_0xfd67('0x6')]))[_0xfd67('0x18')]('whatsapp_queue:save',_0x3c7579);}};module[_0xfd67('0x19')]=WhatsappQueue; \ No newline at end of file +var _0x5d5d=['available','paused','stringify','format','emit','whatsapp_queue:save','lodash','util','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','prototype','map','_rr','updateRealtime','loggedIn','length','online'];(function(_0x1568d8,_0x348ecf){var _0x2adbc3=function(_0x3ea328){while(--_0x3ea328){_0x1568d8['push'](_0x1568d8['shift']());}};_0x2adbc3(++_0x348ecf);}(_0x5d5d,0x158));var _0xd5d5=function(_0x1edc60,_0x5bad20){_0x1edc60=_0x1edc60-0x0;var _0x5502c9=_0x5d5d[_0x1edc60];return _0x5502c9;};'use strict';var _=require(_0xd5d5('0x0'));var md5=require('md5');var util=require(_0xd5d5('0x1'));var Redis=require('ioredis');var config=require(_0xd5d5('0x2'));config[_0xd5d5('0x3')]=_['defaults'](config[_0xd5d5('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xd5d5('0x4'))(new Redis(config[_0xd5d5('0x3')]));function WhatsappQueue(_0x1ad122){this['id']=_0x1ad122['id']||0x0;this[_0xd5d5('0x5')]=_0x1ad122[_0xd5d5('0x5')]||'';this[_0xd5d5('0x6')]=_0x1ad122[_0xd5d5('0x6')]||0xa;this[_0xd5d5('0x7')]=_0x1ad122[_0xd5d5('0x7')]||_0xd5d5('0x8');this[_0xd5d5('0x9')]=_0x1ad122[_0xd5d5('0x9')];this[_0xd5d5('0xa')]={};this[_0xd5d5('0xb')]=0x0;this[_0xd5d5('0xc')]='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue[_0xd5d5('0xd')]['updateRouting']=function(){var _0x13c35a=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0xd5d5('0xe')](this['Agents'],'id');this[_0xd5d5('0xa')][_0xd5d5('0xf')]=_0x13c35a;};WhatsappQueue[_0xd5d5('0xd')][_0xd5d5('0x10')]=function(){this[_0xd5d5('0x11')]=0x0;this['paused']=0x0;for(var _0x1862e=0x0;_0x1862e=0x0?this['available']:0x0;var _0x2e1ac6={'id':this['id'],'available':this[_0xd5d5('0x14')],'loggedIn':this[_0xd5d5('0x11')],'name':this[_0xd5d5('0x5')],'paused':this[_0xd5d5('0x15')],'waiting':this[_0xd5d5('0xb')]};var _0x4a9652=md5(JSON[_0xd5d5('0x16')](_0x2e1ac6));if(this[_0xd5d5('0xc')]!==_0x4a9652){this['md5']=_0x4a9652;io['to'](util[_0xd5d5('0x17')]('whatsapp:queue:%s',_0x2e1ac6[_0xd5d5('0x5')]))[_0xd5d5('0x18')](_0xd5d5('0x19'),_0x2e1ac6);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 3959959..b978420 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x286810,_0xf9161d){var _0x303ec8=function(_0x579774){while(--_0x579774){_0x286810['push'](_0x286810['shift']());}};_0x303ec8(++_0xf9161d);}(_0xb10b,0x12a));var _0xbb10=function(_0x58cbc5,_0x3de123){_0x58cbc5=_0x58cbc5-0x0;var _0x38a8d9=_0xb10b[_0x58cbc5];return _0x38a8d9;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index fecdd9b..db10195 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 _0xd537=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x3c8945,_0x3cf497){var _0x2917f3=function(_0x411c3b){while(--_0x411c3b){_0x3c8945['push'](_0x3c8945['shift']());}};_0x2917f3(++_0x3cf497);}(_0xd537,0x15d));var _0x7d53=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xd537[_0x53ccf2];return _0x5a2964;};'use strict';var client=require(_0x7d53('0x0'));exports[_0x7d53('0x1')]=function(_0x2fde4f,_0x28c0c7){return client[_0x7d53('0x2')](_0x7d53('0x3'),{'body':_0x28c0c7,'options':{'where':{'id':_0x2fde4f}},'log':_0x7d53('0x4')});};exports[_0x7d53('0x5')]=function(_0x5a7a1f,_0x4da9f3){return client[_0x7d53('0x2')](_0x7d53('0x6'),{'body':_0x4da9f3,'options':{'where':{'id':_0x5a7a1f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x2ffd=['Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x2ffd,0x123));var _0xd2ff=function(_0x493f77,_0x570eba){_0x493f77=_0x493f77-0x0;var _0x5e7f1d=_0x2ffd[_0x493f77];return _0x5e7f1d;};'use strict';var client=require(_0xd2ff('0x0'));exports['update']=function(_0x2f5c2e,_0x27f386){return client[_0xd2ff('0x1')]('UpdateChatInteraction',{'body':_0x27f386,'options':{'where':{'id':_0x2f5c2e}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x17f062,_0x1268cb){return client[_0xd2ff('0x1')](_0xd2ff('0x2'),{'body':_0x1268cb,'options':{'where':{'id':_0x17f062}},'log':_0xd2ff('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 43222ac..1a66c1d 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 _0x5457=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5457,0x1b6));var _0x7545=function(_0x698a34,_0x53831d){_0x698a34=_0x698a34-0x0;var _0x1c2e01=_0x5457[_0x698a34];return _0x1c2e01;};'use strict';var client=require(_0x7545('0x0'));exports[_0x7545('0x1')]=function(_0x4ea3ff){return client[_0x7545('0x2')](_0x7545('0x3'),{'body':_0x4ea3ff,'log':_0x7545('0x4')});}; \ No newline at end of file +var _0xb502=['Request','createChatMessage','../client','create'];(function(_0x1167d5,_0x4d2d44){var _0x3de7fa=function(_0x4a98de){while(--_0x4a98de){_0x1167d5['push'](_0x1167d5['shift']());}};_0x3de7fa(++_0x4d2d44);}(_0xb502,0x112));var _0x2b50=function(_0x4b2423,_0x45f261){_0x4b2423=_0x4b2423-0x0;var _0x4944b0=_0xb502[_0x4b2423];return _0x4944b0;};'use strict';var client=require(_0x2b50('0x0'));exports[_0x2b50('0x1')]=function(_0xc6ddc0){return client[_0x2b50('0x2')]('CreateChatMessage',{'body':_0xc6ddc0,'log':_0x2b50('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index e8d17f6..45f8b76 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 _0x294b=['User','online','chatPause','getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy'];(function(_0x274584,_0x501942){var _0x3a068=function(_0x292e30){while(--_0x292e30){_0x274584['push'](_0x274584['shift']());}};_0x3a068(++_0x501942);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb294('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xb294('0x1')](_0xb294('0x2'),{'options':{'raw':![],'attributes':['id',_0xb294('0x3'),_0xb294('0x4'),_0xb294('0x5')],'include':[{'model':_0xb294('0x6'),'as':'Agents','attributes':['id','name',_0xb294('0x7'),_0xb294('0x8')]}]},'log':_0xb294('0x9')});};}; \ No newline at end of file +var _0x74f3=['timeout','strategy','User','online','../client','getChatQueues','Request','name'];(function(_0x2573e3,_0x50a36d){var _0x19e6d3=function(_0x39e010){while(--_0x39e010){_0x2573e3['push'](_0x2573e3['shift']());}};_0x19e6d3(++_0x50a36d);}(_0x74f3,0x164));var _0x374f=function(_0x272dc6,_0x56e7be){_0x272dc6=_0x272dc6-0x0;var _0x3102fc=_0x74f3[_0x272dc6];return _0x3102fc;};'use strict';var client=require(_0x374f('0x0'));exports[_0x374f('0x1')]=function(){return function(){return client[_0x374f('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x374f('0x3'),_0x374f('0x4'),_0x374f('0x5')],'include':[{'model':_0x374f('0x6'),'as':'Agents','attributes':['id',_0x374f('0x3'),_0x374f('0x7'),'chatPause']}]},'log':_0x374f('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index e1ea094..5ab6c02 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 _0x255f=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x255f,0x185));var _0xf255=function(_0x2d5e63,_0x4b592b){_0x2d5e63=_0x2d5e63-0x0;var _0x4c9f37=_0x255f[_0x2d5e63];return _0x4c9f37;};'use strict';var client=require(_0xf255('0x0'));exports['create']=function(_0x43ff47){return client[_0xf255('0x1')](_0xf255('0x2'),{'body':_0x43ff47,'log':'CreateChatQueueReport'});};exports[_0xf255('0x3')]=function(_0x3d90e8,_0x474ac5){return client[_0xf255('0x1')](_0xf255('0x4'),{'body':_0x474ac5,'options':{'where':{'uniqueid':_0x3d90e8},'order':[['id',_0xf255('0x5')]],'limit':0x1},'log':_0xf255('0x4')});}; \ No newline at end of file +var _0xf296=['Request','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0xf296,0x94));var _0x6f29=function(_0x5e6d65,_0x5db89c){_0x5e6d65=_0x5e6d65-0x0;var _0x5e1f75=_0xf296[_0x5e6d65];return _0x5e1f75;};'use strict';var client=require(_0x6f29('0x0'));exports[_0x6f29('0x1')]=function(_0x4e5239){return client[_0x6f29('0x2')]('CreateChatQueueReport',{'body':_0x4e5239,'log':'CreateChatQueueReport'});};exports[_0x6f29('0x3')]=function(_0x3cdbee,_0x4cdc12){return client[_0x6f29('0x2')](_0x6f29('0x4'),{'body':_0x4cdc12,'options':{'where':{'uniqueid':_0x3cdbee},'order':[['id',_0x6f29('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index b435bc2..3147681 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0x7a54,0x106));var _0x47a5=function(_0xd15c1,_0x34968d){_0xd15c1=_0xd15c1-0x0;var _0x26fd24=_0x7a54[_0xd15c1];return _0x26fd24;};'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 08ee171..e1cc41b 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 _0x4012=['create','Request','CreateFaxMessage','../client'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0x4012,0x16f));var _0x2401=function(_0x35b0c1,_0x7b76d7){_0x35b0c1=_0x35b0c1-0x0;var _0x26cd6d=_0x4012[_0x35b0c1];return _0x26cd6d;};'use strict';var client=require(_0x2401('0x0'));exports[_0x2401('0x1')]=function(_0x418b23){return client[_0x2401('0x2')](_0x2401('0x3'),{'body':_0x418b23,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xc901=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x4ac5a4,_0x248114){var _0x35e907=function(_0x325bf4){while(--_0x325bf4){_0x4ac5a4['push'](_0x4ac5a4['shift']());}};_0x35e907(++_0x248114);}(_0xc901,0x1cd));var _0x1c90=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc901[_0x40a045];return _0x1a687c;};'use strict';var client=require('../client');exports[_0x1c90('0x0')]=function(_0xa9306f){return client[_0x1c90('0x1')](_0x1c90('0x2'),{'body':_0xa9306f,'log':_0x1c90('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 52bdaa0..5fa7aa6 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 _0xdac1=['Request','timeout','strategy','User','online','faxPause','../client','getFaxQueues'];(function(_0x17e5fe,_0xe060ed){var _0x16fd24=function(_0x2690e3){while(--_0x2690e3){_0x17e5fe['push'](_0x17e5fe['shift']());}};_0x16fd24(++_0xe060ed);}(_0xdac1,0x7e));var _0x1dac=function(_0x15d660,_0x34aa69){_0x15d660=_0x15d660-0x0;var _0x2284e3=_0xdac1[_0x15d660];return _0x2284e3;};'use strict';var client=require(_0x1dac('0x0'));exports[_0x1dac('0x1')]=function(){return function(){return client[_0x1dac('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x1dac('0x3'),_0x1dac('0x4')],'include':[{'model':_0x1dac('0x5'),'as':'Agents','attributes':['id','name',_0x1dac('0x6'),_0x1dac('0x7')]}]},'log':_0x1dac('0x1')});};}; \ No newline at end of file +var _0xbe75=['timeout','strategy','online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name'];(function(_0x26307f,_0x28a0a4){var _0x50e950=function(_0x557639){while(--_0x557639){_0x26307f['push'](_0x26307f['shift']());}};_0x50e950(++_0x28a0a4);}(_0xbe75,0x1b5));var _0x5be7=function(_0x431836,_0x27231c){_0x431836=_0x431836-0x0;var _0x131d0e=_0xbe75[_0x431836];return _0x131d0e;};'use strict';var client=require(_0x5be7('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x5be7('0x1')](_0x5be7('0x2'),{'options':{'raw':![],'attributes':['id',_0x5be7('0x3'),_0x5be7('0x4'),_0x5be7('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x5be7('0x3'),_0x5be7('0x6'),_0x5be7('0x7')]}]},'log':_0x5be7('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index e51a75e..b136e60 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 _0xf0bf=['../client','create','CreateFaxQueueReport','update','Request','UpdateFaxQueueReport'];(function(_0x3164a0,_0x1f30ee){var _0x23ade6=function(_0xb93cd4){while(--_0xb93cd4){_0x3164a0['push'](_0x3164a0['shift']());}};_0x23ade6(++_0x1f30ee);}(_0xf0bf,0xd8));var _0xff0b=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0xf0bf[_0x3bab09];return _0x164376;};'use strict';var client=require(_0xff0b('0x0'));exports[_0xff0b('0x1')]=function(_0x2b2e8c){return client['Request']('CreateFaxQueueReport',{'body':_0x2b2e8c,'log':_0xff0b('0x2')});};exports[_0xff0b('0x3')]=function(_0x2192a6,_0x16c02d){return client[_0xff0b('0x4')](_0xff0b('0x5'),{'body':_0x16c02d,'options':{'where':{'uniqueid':_0x2192a6},'order':[['id','DESC']],'limit':0x1},'log':_0xff0b('0x5')});}; \ No newline at end of file +var _0xe2a3=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','update'];(function(_0x2e001f,_0x512286){var _0x309ae2=function(_0x436b5a){while(--_0x436b5a){_0x2e001f['push'](_0x2e001f['shift']());}};_0x309ae2(++_0x512286);}(_0xe2a3,0xaf));var _0x3e2a=function(_0x3dc473,_0x4b2a0b){_0x3dc473=_0x3dc473-0x0;var _0x4820a6=_0xe2a3[_0x3dc473];return _0x4820a6;};'use strict';var client=require(_0x3e2a('0x0'));exports[_0x3e2a('0x1')]=function(_0x267fe7){return client[_0x3e2a('0x2')](_0x3e2a('0x3'),{'body':_0x267fe7,'log':_0x3e2a('0x3')});};exports[_0x3e2a('0x4')]=function(_0x19925,_0x4d2e25){return client[_0x3e2a('0x2')](_0x3e2a('0x5'),{'body':_0x4d2e25,'options':{'where':{'uniqueid':_0x19925},'order':[['id','DESC']],'limit':0x1},'log':_0x3e2a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 586bdcb..eaa5aa4 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 _0x24be=['getIntervals','Request','name','Interval','interval','../client'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x24be,0x185));var _0xe24b=function(_0x4e7404,_0x39e1c6){_0x4e7404=_0x4e7404-0x0;var _0x118a11=_0x24be[_0x4e7404];return _0x118a11;};'use strict';var client=require(_0xe24b('0x0'));exports[_0xe24b('0x1')]=function(){return function(){return client[_0xe24b('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe24b('0x3')],'include':[{'model':_0xe24b('0x4'),'as':'Intervals','attributes':['id',_0xe24b('0x3'),_0xe24b('0x5')]}]},'log':_0xe24b('0x1')});};}; \ No newline at end of file +var _0x72a6=['interval','getIntervals','Request','GetInterval','name','Interval','Intervals'];(function(_0x40412a,_0xd7d49){var _0x369d36=function(_0x325cb4){while(--_0x325cb4){_0x40412a['push'](_0x40412a['shift']());}};_0x369d36(++_0xd7d49);}(_0x72a6,0x1d6));var _0x672a=function(_0x3949ab,_0x4c06df){_0x3949ab=_0x3949ab-0x0;var _0x66bae2=_0x72a6[_0x3949ab];return _0x66bae2;};'use strict';var client=require('../client');exports[_0x672a('0x0')]=function(){return function(){return client[_0x672a('0x1')](_0x672a('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x672a('0x3')],'include':[{'model':_0x672a('0x4'),'as':_0x672a('0x5'),'attributes':['id',_0x672a('0x3'),_0x672a('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 7110d0c..9ab0d8c 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 _0xd943=['addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x14e8a7,_0x2ec006){var _0x1eb538=function(_0x43b204){while(--_0x43b204){_0x14e8a7['push'](_0x14e8a7['shift']());}};_0x1eb538(++_0x2ec006);}(_0xd943,0x15d));var _0x3d94=function(_0x2b5d19,_0x3f5376){_0x2b5d19=_0x2b5d19-0x0;var _0x3300ba=_0xd943[_0x2b5d19];return _0x3300ba;};'use strict';var client=require(_0x3d94('0x0'));exports[_0x3d94('0x1')]=function(_0x55353d,_0x440dd8){return client['Request'](_0x3d94('0x2'),{'body':_0x440dd8,'options':{'where':{'id':_0x55353d}},'log':_0x3d94('0x3')});};exports[_0x3d94('0x4')]=function(_0xc13b61,_0xaf8962){return client['Request']('AddTagsToMailInteraction',{'body':_0xaf8962,'options':{'where':{'id':_0xc13b61}},'log':_0x3d94('0x5')});}; \ No newline at end of file +var _0x958a=['../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x39b07f,_0x4ef1dd){var _0xe5ae78=function(_0x5b2960){while(--_0x5b2960){_0x39b07f['push'](_0x39b07f['shift']());}};_0xe5ae78(++_0x4ef1dd);}(_0x958a,0x128));var _0xa958=function(_0x25df80,_0x35d058){_0x25df80=_0x25df80-0x0;var _0xfdfe0e=_0x958a[_0x25df80];return _0xfdfe0e;};'use strict';var client=require(_0xa958('0x0'));exports[_0xa958('0x1')]=function(_0x519e66,_0x44a925){return client[_0xa958('0x2')](_0xa958('0x3'),{'body':_0x44a925,'options':{'where':{'id':_0x519e66}},'log':_0xa958('0x4')});};exports[_0xa958('0x5')]=function(_0x5194f8,_0x3424b0){return client['Request'](_0xa958('0x6'),{'body':_0x3424b0,'options':{'where':{'id':_0x5194f8}},'log':_0xa958('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index e0afbf1..1d42a14 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 _0x62fe=['../client','create','createMailMessage'];(function(_0xd333a1,_0x1f61a0){var _0x553a60=function(_0x13761f){while(--_0x13761f){_0xd333a1['push'](_0xd333a1['shift']());}};_0x553a60(++_0x1f61a0);}(_0x62fe,0x150));var _0xe62f=function(_0x36ac34,_0x1f03c4){_0x36ac34=_0x36ac34-0x0;var _0x5ce39f=_0x62fe[_0x36ac34];return _0x5ce39f;};'use strict';var client=require(_0xe62f('0x0'));exports[_0xe62f('0x1')]=function(_0x280bf9){return client['Request']('CreateMailMessage',{'body':_0x280bf9,'log':_0xe62f('0x2')});}; \ No newline at end of file +var _0x058b=['Request','createMailMessage','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x058b,0x6a));var _0xb058=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0x058b[_0x4c1ec2];return _0x3f6f1c;};'use strict';var client=require(_0xb058('0x0'));exports[_0xb058('0x1')]=function(_0x577a84){return client[_0xb058('0x2')]('CreateMailMessage',{'body':_0x577a84,'log':_0xb058('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index f01bf9d..d6aff37 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 _0xb6e5=['getMailQueues','../client','Request','name','timeout','strategy','User','Agents','online','mailPause'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb6e5,0x1c3));var _0x5b6e=function(_0x213048,_0x50ecf5){_0x213048=_0x213048-0x0;var _0x157895=_0xb6e5[_0x213048];return _0x157895;};'use strict';var client=require(_0x5b6e('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x5b6e('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x5b6e('0x2'),_0x5b6e('0x3'),_0x5b6e('0x4')],'include':[{'model':_0x5b6e('0x5'),'as':_0x5b6e('0x6'),'attributes':['id',_0x5b6e('0x2'),_0x5b6e('0x7'),_0x5b6e('0x8')]}]},'log':_0x5b6e('0x9')});};}; \ No newline at end of file +var _0x98d8=['User','Agents','online','mailPause','getMailQueues','../client','Request','GetMailQueue','name','timeout'];(function(_0x12d812,_0x496bb7){var _0x3711ab=function(_0x3259da){while(--_0x3259da){_0x12d812['push'](_0x12d812['shift']());}};_0x3711ab(++_0x496bb7);}(_0x98d8,0xcd));var _0x898d=function(_0x37bab4,_0x4fa85e){_0x37bab4=_0x37bab4-0x0;var _0x336d20=_0x98d8[_0x37bab4];return _0x336d20;};'use strict';var client=require(_0x898d('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x898d('0x1')](_0x898d('0x2'),{'options':{'raw':![],'attributes':['id',_0x898d('0x3'),_0x898d('0x4'),'strategy'],'include':[{'model':_0x898d('0x5'),'as':_0x898d('0x6'),'attributes':['id','name',_0x898d('0x7'),_0x898d('0x8')]}]},'log':_0x898d('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f239777..ebdc476 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 _0x8f07=['Request','CreateMailQueueReport','update','DESC','UpdateMailQueueReport','../client','create'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x8f07,0xec));var _0x78f0=function(_0x330597,_0x51dff7){_0x330597=_0x330597-0x0;var _0x447bb3=_0x8f07[_0x330597];return _0x447bb3;};'use strict';var client=require(_0x78f0('0x0'));exports[_0x78f0('0x1')]=function(_0x1a4f37){return client[_0x78f0('0x2')](_0x78f0('0x3'),{'body':_0x1a4f37,'log':_0x78f0('0x3')});};exports[_0x78f0('0x4')]=function(_0x241267,_0x23f430){return client[_0x78f0('0x2')]('UpdateMailQueueReport',{'body':_0x23f430,'options':{'where':{'uniqueid':_0x241267},'order':[['id',_0x78f0('0x5')]],'limit':0x1},'log':_0x78f0('0x6')});}; \ No newline at end of file +var _0x0604=['update','UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x0604,0x1c5));var _0x4060=function(_0x58ac52,_0x32e668){_0x58ac52=_0x58ac52-0x0;var _0x4cfd12=_0x0604[_0x58ac52];return _0x4cfd12;};'use strict';var client=require(_0x4060('0x0'));exports['create']=function(_0x54c1f9){return client[_0x4060('0x1')](_0x4060('0x2'),{'body':_0x54c1f9,'log':_0x4060('0x2')});};exports[_0x4060('0x3')]=function(_0x389681,_0x1060e8){return client[_0x4060('0x1')](_0x4060('0x4'),{'body':_0x1060e8,'options':{'where':{'uniqueid':_0x389681},'order':[['id',_0x4060('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 4c0777e..080921b 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 _0xf7e0=['addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x15e62a,_0xb3a95f){var _0x5d408c=function(_0x49614a){while(--_0x49614a){_0x15e62a['push'](_0x15e62a['shift']());}};_0x5d408c(++_0xb3a95f);}(_0xf7e0,0x185));var _0x0f7e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xf7e0[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x0f7e('0x0'));exports['update']=function(_0x199356,_0x17b26a){return client['Request'](_0x0f7e('0x1'),{'body':_0x17b26a,'options':{'where':{'id':_0x199356}},'log':_0x0f7e('0x2')});};exports[_0x0f7e('0x3')]=function(_0x4d7002,_0x3e5ef4){return client[_0x0f7e('0x4')](_0x0f7e('0x5'),{'body':_0x3e5ef4,'options':{'where':{'id':_0x4d7002}},'log':_0x0f7e('0x6')});}; \ No newline at end of file +var _0x3380=['update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3380,0x137));var _0x0338=function(_0x2d5c47,_0x5eeb35){_0x2d5c47=_0x2d5c47-0x0;var _0x475bf4=_0x3380[_0x2d5c47];return _0x475bf4;};'use strict';var client=require(_0x0338('0x0'));exports[_0x0338('0x1')]=function(_0x33f903,_0x4b58e7){return client[_0x0338('0x2')](_0x0338('0x3'),{'body':_0x4b58e7,'options':{'where':{'id':_0x33f903}},'log':_0x0338('0x4')});};exports['addTags']=function(_0x24bcb7,_0x32448a){return client[_0x0338('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x32448a,'options':{'where':{'id':_0x24bcb7}},'log':_0x0338('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 65dd1e8..11cba40 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 _0xf97b=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x473a79,_0x5e608b){var _0x5a91b3=function(_0x302411){while(--_0x302411){_0x473a79['push'](_0x473a79['shift']());}};_0x5a91b3(++_0x5e608b);}(_0xf97b,0x10b));var _0xbf97=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xf97b[_0x3e5086];return _0xfeb102;};'use strict';var client=require(_0xbf97('0x0'));exports[_0xbf97('0x1')]=function(_0x3bf7a3){return client[_0xbf97('0x2')](_0xbf97('0x3'),{'body':_0x3bf7a3,'log':_0xbf97('0x4')});}; \ No newline at end of file +var _0x8a01=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x8a01,0xf6));var _0x18a0=function(_0x3a46a8,_0x20e857){_0x3a46a8=_0x3a46a8-0x0;var _0x1976f8=_0x8a01[_0x3a46a8];return _0x1976f8;};'use strict';var client=require(_0x18a0('0x0'));exports[_0x18a0('0x1')]=function(_0x3f4866){return client[_0x18a0('0x2')](_0x18a0('0x3'),{'body':_0x3f4866,'log':_0x18a0('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 7883833..c777d84 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 _0x81a5=['User','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout'];(function(_0x50439d,_0x3aed4c){var _0x5dc279=function(_0x9c78c0){while(--_0x9c78c0){_0x50439d['push'](_0x50439d['shift']());}};_0x5dc279(++_0x3aed4c);}(_0x81a5,0x1c8));var _0x581a=function(_0x128715,_0x32ec4f){_0x128715=_0x128715-0x0;var _0x4666cc=_0x81a5[_0x128715];return _0x4666cc;};'use strict';var client=require(_0x581a('0x0'));exports[_0x581a('0x1')]=function(){return function(){return client[_0x581a('0x2')](_0x581a('0x3'),{'options':{'raw':![],'attributes':['id',_0x581a('0x4'),_0x581a('0x5'),'strategy'],'include':[{'model':_0x581a('0x6'),'as':'Agents','attributes':['id','name','online','openchannelPause']}]},'log':_0x581a('0x1')});};}; \ No newline at end of file +var _0xf4d4=['Request','timeout','strategy','Agents','name','openchannelPause','getOpenchannelQueues','../client'];(function(_0x176ab4,_0x2e6e5e){var _0x361756=function(_0x51a862){while(--_0x51a862){_0x176ab4['push'](_0x176ab4['shift']());}};_0x361756(++_0x2e6e5e);}(_0xf4d4,0x1af));var _0x4f4d=function(_0x1d0041,_0x1a6f9a){_0x1d0041=_0x1d0041-0x0;var _0x5b5a43=_0xf4d4[_0x1d0041];return _0x5b5a43;};'use strict';var client=require(_0x4f4d('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x4f4d('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0x4f4d('0x2'),_0x4f4d('0x3')],'include':[{'model':'User','as':_0x4f4d('0x4'),'attributes':['id',_0x4f4d('0x5'),'online',_0x4f4d('0x6')]}]},'log':_0x4f4d('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 7ebb941..93c899d 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 _0x58fa=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x5666d2,_0x19ee59){var _0x744b3=function(_0x323a88){while(--_0x323a88){_0x5666d2['push'](_0x5666d2['shift']());}};_0x744b3(++_0x19ee59);}(_0x58fa,0x129));var _0xa58f=function(_0x4f02af,_0x3e4f3b){_0x4f02af=_0x4f02af-0x0;var _0xfd9d9d=_0x58fa[_0x4f02af];return _0xfd9d9d;};'use strict';var client=require(_0xa58f('0x0'));exports[_0xa58f('0x1')]=function(_0x1d17c5){return client[_0xa58f('0x2')](_0xa58f('0x3'),{'body':_0x1d17c5,'log':_0xa58f('0x3')});};exports[_0xa58f('0x4')]=function(_0x1f3829,_0x469023){return client[_0xa58f('0x2')](_0xa58f('0x5'),{'body':_0x469023,'options':{'where':{'uniqueid':_0x1f3829},'order':[['id','DESC']],'limit':0x1},'log':_0xa58f('0x5')});}; \ No newline at end of file +var _0xd95d=['UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x34217f,_0x4954d9){var _0x533721=function(_0x5ea689){while(--_0x5ea689){_0x34217f['push'](_0x34217f['shift']());}};_0x533721(++_0x4954d9);}(_0xd95d,0xf2));var _0xdd95=function(_0x292fbe,_0x1148ec){_0x292fbe=_0x292fbe-0x0;var _0x53ddce=_0xd95d[_0x292fbe];return _0x53ddce;};'use strict';var client=require(_0xdd95('0x0'));exports[_0xdd95('0x1')]=function(_0x1f2858){return client[_0xdd95('0x2')]('CreateOpenchannelQueueReport',{'body':_0x1f2858,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x4e81b0,_0x7a23d1){return client[_0xdd95('0x2')](_0xdd95('0x3'),{'body':_0x7a23d1,'options':{'where':{'uniqueid':_0x4e81b0},'order':[['id',_0xdd95('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 7f4a4af..781202a 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 _0x984b=['addTagsToSmsInteraction','Request','UpdateSmsInteraction'];(function(_0x1273d2,_0x5c0965){var _0x421f78=function(_0x2a482b){while(--_0x2a482b){_0x1273d2['push'](_0x1273d2['shift']());}};_0x421f78(++_0x5c0965);}(_0x984b,0xee));var _0xb984=function(_0x5e71ca,_0x1731ec){_0x5e71ca=_0x5e71ca-0x0;var _0x4cdc5e=_0x984b[_0x5e71ca];return _0x4cdc5e;};'use strict';var client=require('../client');exports['update']=function(_0x53aeac,_0x27011b){return client[_0xb984('0x0')](_0xb984('0x1'),{'body':_0x27011b,'options':{'where':{'id':_0x53aeac}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x8384b0,_0x340f2c){return client['Request']('AddTagsToSmsInteraction',{'body':_0x340f2c,'options':{'where':{'id':_0x8384b0}},'log':_0xb984('0x2')});}; \ No newline at end of file +var _0x1e69=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x1e69,0x85));var _0x91e6=function(_0x2af732,_0x852a76){_0x2af732=_0x2af732-0x0;var _0x2f0a55=_0x1e69[_0x2af732];return _0x2f0a55;};'use strict';var client=require('../client');exports[_0x91e6('0x0')]=function(_0x28561c,_0x6605eb){return client[_0x91e6('0x1')]('UpdateSmsInteraction',{'body':_0x6605eb,'options':{'where':{'id':_0x28561c}},'log':'updateSmsInteraction'});};exports[_0x91e6('0x2')]=function(_0x351c1d,_0x2b53b6){return client[_0x91e6('0x1')](_0x91e6('0x3'),{'body':_0x2b53b6,'options':{'where':{'id':_0x351c1d}},'log':_0x91e6('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index e228235..aa4ca7b 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 _0xc238=['Request','CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x356c60,_0x2c7026){var _0xf431c=function(_0x57b05a){while(--_0x57b05a){_0x356c60['push'](_0x356c60['shift']());}};_0xf431c(++_0x2c7026);}(_0xc238,0x6c));var _0x8c23=function(_0x520d84,_0x1a7e0d){_0x520d84=_0x520d84-0x0;var _0x30a99c=_0xc238[_0x520d84];return _0x30a99c;};'use strict';var client=require(_0x8c23('0x0'));exports[_0x8c23('0x1')]=function(_0x2c9c82){return client[_0x8c23('0x2')](_0x8c23('0x3'),{'body':_0x2c9c82,'log':_0x8c23('0x4')});}; \ No newline at end of file +var _0x53b4=['create','CreateSmsMessage'];(function(_0x49ba0a,_0x574ef8){var _0x40b3ad=function(_0x4b5674){while(--_0x4b5674){_0x49ba0a['push'](_0x49ba0a['shift']());}};_0x40b3ad(++_0x574ef8);}(_0x53b4,0x10e));var _0x453b=function(_0x481bdf,_0x231538){_0x481bdf=_0x481bdf-0x0;var _0x281a12=_0x53b4[_0x481bdf];return _0x281a12;};'use strict';var client=require('../client');exports[_0x453b('0x0')]=function(_0x4c0e4e){return client['Request'](_0x453b('0x1'),{'body':_0x4c0e4e,'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 22acd12..1b63897 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x1fd58f,_0x45efdc){var _0x2bdff9=function(_0x22c12b){while(--_0x22c12b){_0x1fd58f['push'](_0x1fd58f['shift']());}};_0x2bdff9(++_0x45efdc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x144b30,_0x77072d){_0x144b30=_0x144b30-0x0;var _0x1bb7bc=_0xcb91[_0x144b30];return _0x1bb7bc;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x170850,_0x2e8c9f){var _0x59c584=function(_0x822b62){while(--_0x822b62){_0x170850['push'](_0x170850['shift']());}};_0x59c584(++_0x2e8c9f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index a4ca1c8..d5738ff 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0xedd9,0xfc));var _0x9edd=function(_0x435792,_0x56d887){_0x435792=_0x435792-0x0;var _0x3a93c4=_0xedd9[_0x435792];return _0x3a93c4;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file +var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x6e17c,_0x3c1fe1){var _0x43ea56=function(_0x2bfed4){while(--_0x2bfed4){_0x6e17c['push'](_0x6e17c['shift']());}};_0x43ea56(++_0x3c1fe1);}(_0x55ca,0x126));var _0xa55c=function(_0x2703cf,_0x526b31){_0x2703cf=_0x2703cf-0x0;var _0x28f18a=_0x55ca[_0x2703cf];return _0x28f18a;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 77b96d3..e265ecd 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(_0x4029ab,_0x59dd71){var _0x492bd5=function(_0x389c31){while(--_0x389c31){_0x4029ab['push'](_0x4029ab['shift']());}};_0x492bd5(++_0x59dd71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x1cca01,_0xb99c4e){var _0x5949f9=function(_0x59dc48){while(--_0x59dc48){_0x1cca01['push'](_0x1cca01['shift']());}};_0x5949f9(++_0xb99c4e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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 41b93ba..5c1aaec 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 _0x8ace=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x8ace[_0x5a95fa];return _0x1a61b8;};'use strict';var client=require(_0xe8ac('0x0'));exports[_0xe8ac('0x1')]=function(_0x2b36fd,_0x17e173){return client[_0xe8ac('0x2')](_0xe8ac('0x3'),{'body':_0x17e173,'options':{'where':{'id':_0x2b36fd}},'log':_0xe8ac('0x4')});};exports[_0xe8ac('0x5')]=function(_0x114351,_0xf6af00){return client[_0xe8ac('0x2')](_0xe8ac('0x6'),{'body':_0xf6af00,'options':{'where':{'id':_0x114351}},'log':_0xe8ac('0x7')});}; \ No newline at end of file +var _0x8d0a=['update','Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x8d0a,0x172));var _0xa8d0=function(_0x264043,_0x1358df){_0x264043=_0x264043-0x0;var _0x2af121=_0x8d0a[_0x264043];return _0x2af121;};'use strict';var client=require(_0xa8d0('0x0'));exports[_0xa8d0('0x1')]=function(_0x42a78b,_0x51c455){return client[_0xa8d0('0x2')](_0xa8d0('0x3'),{'body':_0x51c455,'options':{'where':{'id':_0x42a78b}},'log':'updateWhatsappInteraction'});};exports[_0xa8d0('0x4')]=function(_0x3812b4,_0x33c4b1){return client['Request'](_0xa8d0('0x5'),{'body':_0x33c4b1,'options':{'where':{'id':_0x3812b4}},'log':_0xa8d0('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index d3eda66..1505d3a 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 _0xb148=['create','Request','createWhatsappMessage','../client'];(function(_0x3ed054,_0x4d4f16){var _0x16dd95=function(_0xc0c19c){while(--_0xc0c19c){_0x3ed054['push'](_0x3ed054['shift']());}};_0x16dd95(++_0x4d4f16);}(_0xb148,0x13f));var _0x8b14=function(_0x13ff53,_0x5e1424){_0x13ff53=_0x13ff53-0x0;var _0x290228=_0xb148[_0x13ff53];return _0x290228;};'use strict';var client=require(_0x8b14('0x0'));exports[_0x8b14('0x1')]=function(_0x5c522d){return client[_0x8b14('0x2')]('CreateWhatsappMessage',{'body':_0x5c522d,'log':_0x8b14('0x3')});}; \ No newline at end of file +var _0x1606=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x29abe6,_0x39ef28){var _0x4f91aa=function(_0xc797f2){while(--_0xc797f2){_0x29abe6['push'](_0x29abe6['shift']());}};_0x4f91aa(++_0x39ef28);}(_0x1606,0xf9));var _0x6160=function(_0x310982,_0x353311){_0x310982=_0x310982-0x0;var _0x14f215=_0x1606[_0x310982];return _0x14f215;};'use strict';var client=require(_0x6160('0x0'));exports[_0x6160('0x1')]=function(_0x10fdc7){return client[_0x6160('0x2')](_0x6160('0x3'),{'body':_0x10fdc7,'log':_0x6160('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 7772a2f..3000bf8 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 _0x9528=['Agents','whatsappPause','getWhatsappQueues','GetWhatsappQueue','name','timeout'];(function(_0xa27617,_0x47c5b3){var _0xf8b040=function(_0xf661c2){while(--_0xf661c2){_0xa27617['push'](_0xa27617['shift']());}};_0xf8b040(++_0x47c5b3);}(_0x9528,0x128));var _0x8952=function(_0x20e589,_0x3e9c14){_0x20e589=_0x20e589-0x0;var _0x54276e=_0x9528[_0x20e589];return _0x54276e;};'use strict';var client=require('../client');exports[_0x8952('0x0')]=function(){return function(){return client['Request'](_0x8952('0x1'),{'options':{'raw':![],'attributes':['id',_0x8952('0x2'),_0x8952('0x3'),'strategy'],'include':[{'model':'User','as':_0x8952('0x4'),'attributes':['id',_0x8952('0x2'),'online',_0x8952('0x5')]}]},'log':_0x8952('0x0')});};}; \ No newline at end of file +var _0x1aff=['Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x1aff,0x106));var _0xf1af=function(_0x3a1bd4,_0x5f9b1c){_0x3a1bd4=_0x3a1bd4-0x0;var _0x2efe2b=_0x1aff[_0x3a1bd4];return _0x2efe2b;};'use strict';var client=require(_0xf1af('0x0'));exports[_0xf1af('0x1')]=function(){return function(){return client[_0xf1af('0x2')](_0xf1af('0x3'),{'options':{'raw':![],'attributes':['id',_0xf1af('0x4'),_0xf1af('0x5'),_0xf1af('0x6')],'include':[{'model':_0xf1af('0x7'),'as':_0xf1af('0x8'),'attributes':['id',_0xf1af('0x4'),_0xf1af('0x9'),_0xf1af('0xa')]}]},'log':_0xf1af('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 75ef238..183fec5 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 _0x4df9=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x4605bb,_0x2ecb60){var _0x2eab39=function(_0x3a878e){while(--_0x3a878e){_0x4605bb['push'](_0x4605bb['shift']());}};_0x2eab39(++_0x2ecb60);}(_0x4df9,0x195));var _0x94df=function(_0x21da75,_0x532f61){_0x21da75=_0x21da75-0x0;var _0x5d549d=_0x4df9[_0x21da75];return _0x5d549d;};'use strict';var client=require(_0x94df('0x0'));exports[_0x94df('0x1')]=function(_0x36d531){return client[_0x94df('0x2')](_0x94df('0x3'),{'body':_0x36d531,'log':_0x94df('0x3')});};exports[_0x94df('0x4')]=function(_0x5f2e7e,_0x16fc06){return client[_0x94df('0x2')](_0x94df('0x5'),{'body':_0x16fc06,'options':{'where':{'uniqueid':_0x5f2e7e},'order':[['id',_0x94df('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xdf39=['UpdateWhatsappQueueReport','DESC','create','Request','CreateWhatsappQueueReport','update'];(function(_0x1489a5,_0x1fa1bd){var _0x1350fc=function(_0x2fbbc1){while(--_0x2fbbc1){_0x1489a5['push'](_0x1489a5['shift']());}};_0x1350fc(++_0x1fa1bd);}(_0xdf39,0x128));var _0x9df3=function(_0xef9267,_0x152317){_0xef9267=_0xef9267-0x0;var _0x4372a2=_0xdf39[_0xef9267];return _0x4372a2;};'use strict';var client=require('../client');exports[_0x9df3('0x0')]=function(_0xde52a2){return client[_0x9df3('0x1')](_0x9df3('0x2'),{'body':_0xde52a2,'log':_0x9df3('0x2')});};exports[_0x9df3('0x3')]=function(_0x1c0004,_0xe596eb){return client[_0x9df3('0x1')](_0x9df3('0x4'),{'body':_0xe596eb,'options':{'where':{'uniqueid':_0x1c0004},'order':[['id',_0x9df3('0x5')]],'limit':0x1},'log':_0x9df3('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index fcb85da..ba9b561 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 _0x50a9=['agents','timeout','createQueue','atimeout','channel','format','START:%s','rules','end','info','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','util','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message','join','find'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x50a9,0x1d9));var _0x950a=function(_0x52c258,_0x2e145f){_0x52c258=_0x52c258-0x0;var _0x36d9bf=_0x50a9[_0x52c258];return _0x36d9bf;};'use strict';var schema=require(_0x950a('0x0'));var _=require('lodash');var util=require(_0x950a('0x1'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')(_0x950a('0x2'));var strategy=require(_0x950a('0x3'));var queue=schema({'name':{'type':_0x950a('0x4'),'required':!![],'message':_0x950a('0x5')},'timeout':{'type':_0x950a('0x6'),'message':_0x950a('0x7')}});function writeLog(_0xd7ac,_0x2ba7a9,_0x5a566e){return logger['info'](util['format'](_0x950a('0x8'),_0xd7ac,_0x2ba7a9[_0x950a('0x9')],_0x5a566e));}function handleFindAgent(_0x232043){return function(_0x5a76ea){return _0x5a76ea['name'][_0x950a('0xa')]()===_0x232043[_0x950a('0xa')]();};}exports[_0x950a('0xb')]=function(_0xd27e46,_0x2e89a,_0x1620c3,_0x389cc8){return function(_0x25b696){try{var _0x165874={'name':_0x2e89a[0x0],'timeout':_0x2e89a[0x1]};var _0x841546=queue[_0x950a('0x0')](_0x165874,{'typecast':!![]});if(_0x841546['length']){logger['error'](_0x950a('0xc'),_0xd27e46,_[_0x950a('0xd')](_0x841546,_0x950a('0xe'))[_0x950a('0xf')](',\x20'));_0x25b696['stop']();}else{var _0x32bd90=_[_0x950a('0x10')](_0x1620c3[_0x950a('0x11')],handleFindAgent(_0x165874[_0x950a('0x9')]));if(_0x32bd90){var _0x38e9b1=(_0x165874[_0x950a('0x12')]||0xa)*0x3e8;var _0x22d7e8,_0x1ef5d7;var _0x19b88=seqqueue[_0x950a('0x13')](_0x38e9b1);_0x19b88['id']=_0xd27e46;_0x19b88[_0x950a('0x14')]=_0x38e9b1;_0x19b88[_0x950a('0x15')]=_0x389cc8['channel'];writeLog(_0xd27e46,_0x32bd90,util[_0x950a('0x16')](_0x950a('0x17'),_0x38e9b1));_0x1620c3[_0x950a('0x18')][_0xd27e46]['on'](_0x950a('0x19'),function(){logger[_0x950a('0x1a')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0xd27e46);clearTimeout(_0x1ef5d7);_0x1ef5d7=undefined;_0x19b88['close']();if(_0x1620c3[_0x950a('0x18')][_0xd27e46]){delete _0x1620c3[_0x950a('0x18')][_0xd27e46];}_0x25b696[_0x950a('0x1b')]();});_0x1620c3[_0x950a('0x18')][_0xd27e46]['on'](_0x950a('0x1c'),function(){if(_0x1620c3[_0x950a('0x18')][_0xd27e46]){delete _0x1620c3['rules'][_0xd27e46];}});_0x1ef5d7=setTimeout(function(){logger[_0x950a('0x1a')](_0x950a('0x1d'),_0xd27e46);clearTimeout(_0x1ef5d7);_0x19b88['close']();_0x25b696[_0x950a('0x1e')]();},_0x38e9b1);strategy['agent'](_0x19b88,_0x32bd90,_0x1620c3,_0x389cc8);}else{logger[_0x950a('0x1f')](_0x950a('0x20'),_0xd27e46,_0x165874[_0x950a('0x9')]);_0x25b696[_0x950a('0x1b')]();}}}catch(_0xea8e97){console[_0x950a('0x21')](_0xea8e97);logger['error']('[%s][QUEUE]\x20%s',_0xd27e46,_0xea8e97[_0x950a('0x22')]);_0x25b696['stop']();}};}; \ No newline at end of file +var _0xe8b2=['message','stop','find','agents','name','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','[%s][AGENT]\x20agent\x20not\x20found\x20%s','error','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','[%s][AGENT]\x20%s'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0xe8b2,0x7d));var _0x2e8b=function(_0x5be9c4,_0x5c5059){_0x5be9c4=_0x5be9c4-0x0;var _0x3cbf88=_0xe8b2[_0x5be9c4];return _0x3cbf88;};'use strict';var schema=require(_0x2e8b('0x0'));var _=require(_0x2e8b('0x1'));var util=require(_0x2e8b('0x2'));var seqqueue=require(_0x2e8b('0x3'));var logger=require(_0x2e8b('0x4'))(_0x2e8b('0x5'));var strategy=require(_0x2e8b('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x2e8b('0x7')},'timeout':{'type':_0x2e8b('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x5d808b,_0x34ad0a,_0x4b7462){return logger[_0x2e8b('0x9')](util[_0x2e8b('0xa')](_0x2e8b('0xb'),_0x5d808b,_0x34ad0a['name'],_0x4b7462));}function handleFindAgent(_0x4ae2b9){return function(_0x51c51e){return _0x51c51e['name'][_0x2e8b('0xc')]()===_0x4ae2b9[_0x2e8b('0xc')]();};}exports[_0x2e8b('0xd')]=function(_0x22310b,_0x48f050,_0x486ce2,_0x2c61f0){return function(_0x11bee3){try{var _0x435630={'name':_0x48f050[0x0],'timeout':_0x48f050[0x1]};var _0x2a6993=queue[_0x2e8b('0x0')](_0x435630,{'typecast':!![]});if(_0x2a6993['length']){logger['error'](_0x2e8b('0xe'),_0x22310b,_['map'](_0x2a6993,_0x2e8b('0xf'))['join'](',\x20'));_0x11bee3[_0x2e8b('0x10')]();}else{var _0xa00eff=_[_0x2e8b('0x11')](_0x486ce2[_0x2e8b('0x12')],handleFindAgent(_0x435630[_0x2e8b('0x13')]));if(_0xa00eff){var _0x1a5ee3=(_0x435630[_0x2e8b('0x14')]||0xa)*0x3e8;var _0x1230ae,_0x5b08cd;var _0x59f523=seqqueue[_0x2e8b('0x15')](_0x1a5ee3);_0x59f523['id']=_0x22310b;_0x59f523[_0x2e8b('0x16')]=_0x1a5ee3;_0x59f523[_0x2e8b('0x17')]=_0x2c61f0[_0x2e8b('0x17')];writeLog(_0x22310b,_0xa00eff,util[_0x2e8b('0xa')](_0x2e8b('0x18'),_0x1a5ee3));_0x486ce2[_0x2e8b('0x19')][_0x22310b]['on'](_0x2e8b('0x1a'),function(){logger[_0x2e8b('0x9')](_0x2e8b('0x1b'),_0x22310b);clearTimeout(_0x5b08cd);_0x5b08cd=undefined;_0x59f523[_0x2e8b('0x1c')]();if(_0x486ce2[_0x2e8b('0x19')][_0x22310b]){delete _0x486ce2['rules'][_0x22310b];}_0x11bee3[_0x2e8b('0x10')]();});_0x486ce2['rules'][_0x22310b]['on'](_0x2e8b('0x1d'),function(){if(_0x486ce2['rules'][_0x22310b]){delete _0x486ce2[_0x2e8b('0x19')][_0x22310b];}});_0x5b08cd=setTimeout(function(){logger[_0x2e8b('0x9')](_0x2e8b('0x1e'),_0x22310b);clearTimeout(_0x5b08cd);_0x59f523['close']();_0x11bee3['next']();},_0x1a5ee3);strategy['agent'](_0x59f523,_0xa00eff,_0x486ce2,_0x2c61f0);}else{logger['error'](_0x2e8b('0x1f'),_0x22310b,_0x435630['name']);_0x11bee3[_0x2e8b('0x10')]();}}}catch(_0x19a645){console['log'](_0x19a645);logger[_0x2e8b('0x20')](_0x2e8b('0x21'),_0x22310b,_0x19a645[_0x2e8b('0x22')]);_0x11bee3['stop']();}};}; \ 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 9dd16c2..a37045d 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 _0x555f=['../../rpc/whatsappMessage','isNil','interaction','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','info','catch','error','stringify','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','toString','message','providerName','amazonlex','providerResponse','dialogState','Failed','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x40468f,_0x567919){var _0x34f6e6=function(_0x2fe2cc){while(--_0x2fe2cc){_0x40468f['push'](_0x40468f['shift']());}};_0x34f6e6(++_0x567919);}(_0x555f,0xe8));var _0xf555=function(_0x25d2fa,_0x1d35c6){_0x25d2fa=_0x25d2fa-0x0;var _0x42d4aa=_0x555f[_0x25d2fa];return _0x42d4aa;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0xf555('0x0'));var utils=require(_0xf555('0x1'));var logger=require(_0xf555('0x2'))(_0xf555('0x3'));var rpc={'chatMessage':require(_0xf555('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf555('0x5')),'smsMessage':require(_0xf555('0x6')),'faxMessage':require(_0xf555('0x7')),'whatsappMessage':require(_0xf555('0x8'))};exports['consequence']=function(_0xc8df8c,_0x86355b){return function(_0x41fa9c){try{if(!_[_0xf555('0x9')](this[_0xf555('0xa')]['UserId'])){logger['info'](_0xf555('0xb'),_0xc8df8c,_0xf555('0xc'));return _0x41fa9c[_0xf555('0xd')]();}var _0x463b8f={'ContactId':this[_0xf555('0xe')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xf555('0xf')};if(this[_0xf555('0x10')]==='sms'||this[_0xf555('0x10')]===_0xf555('0x11')){_0x463b8f['phone']=this[_0xf555('0xa')][_0xf555('0x12')];}var _0x5902fa=this[_0xf555('0x10')];if(_0x5902fa==='chat'){_0x463b8f[_0xf555('0x13')]=this['account']['id'];}else{_0x463b8f[_[_0xf555('0x14')](_0x5902fa)+_0xf555('0x15')]=this[_0xf555('0x16')]['id'];}_0x463b8f[_[_0xf555('0x14')](_0x5902fa)+_0xf555('0x17')]=this[_0xf555('0xa')]['id'];if(this[_0xf555('0xa')][_0xf555('0x18')]){var _0x5c78b7=_0x86355b[0x4];if(!_[_0xf555('0x19')](_0x5c78b7)){_0x463b8f[_0xf555('0x1a')]=utils[_0xf555('0x1b')](_0x5c78b7,this);return rpc[_0x5902fa+_0xf555('0x1c')][_0xf555('0x1d')](_0x463b8f)[_0xf555('0x1e')](function(_0x25930f){logger[_0xf555('0x1f')](_0xf555('0xb'),_0xc8df8c,_0x463b8f['body']);})[_0xf555('0x20')](function(_0x822ce4){logger[_0xf555('0x21')](_0xf555('0xb'),_0xc8df8c,JSON[_0xf555('0x22')](_0x822ce4));})[_0xf555('0x23')](function(){logger[_0xf555('0x1f')](_0xf555('0x24'),_0xc8df8c);_0x41fa9c[_0xf555('0x25')]();});}else{logger[_0xf555('0x1f')](_0xf555('0x26'),_0xc8df8c);_0x41fa9c['stop']();}}else{var _0x581f73=this;var _0x7ce20c=new AWS[(_0xf555('0x27'))]({'accessKeyId':_0x86355b[0x0],'secretAccessKey':_0x86355b[0x1],'region':_0x86355b[0x2]});var _0x493769={'botAlias':_0xf555('0x28'),'botName':_0x86355b[0x3],'inputText':this['message'][_0xf555('0x1a')],'userId':this[_0xf555('0x10')]+':'+this[_0xf555('0xa')]['id'][_0xf555('0x29')]()};_0x7ce20c['postText'](_0x493769,function(_0x148478,_0x1220ee){if(_0x148478){logger['error'](_0xf555('0xb'),_0xc8df8c,_0x148478[_0xf555('0x2a')]);_0x41fa9c[_0xf555('0xd')]();}else if(_0x1220ee&&_0x1220ee[_0xf555('0x2a')]){_0x581f73['body']['amazonlex']=_0x1220ee;_0x463b8f[_0xf555('0x1a')]=_0x1220ee[_0xf555('0x2a')];_0x463b8f[_0xf555('0x2b')]=_0xf555('0x2c');_0x463b8f[_0xf555('0x2d')]=JSON[_0xf555('0x22')](_0x1220ee);return rpc[_0x5902fa+_0xf555('0x1c')][_0xf555('0x1d')](_0x463b8f)[_0xf555('0x1e')](function(_0x5cceb0){logger[_0xf555('0x1f')]('[%s][AMAZONLEX]\x20%s',_0xc8df8c,_0x463b8f['body']);if(_0x1220ee[_0xf555('0x2e')]==_0xf555('0x2f')){_0x41fa9c['next']();}else{_0x41fa9c[_0xf555('0x25')]();}})[_0xf555('0x20')](function(_0x6e0e60){logger[_0xf555('0x21')](_0xf555('0xb'),_0xc8df8c,JSON[_0xf555('0x22')](_0x6e0e60));_0x41fa9c[_0xf555('0xd')]();});}else{_0x41fa9c[_0xf555('0xd')]();}});}}catch(_0x4241f2){logger[_0xf555('0x21')](_0xf555('0xb'),_0xc8df8c,JSON[_0xf555('0x22')](_0x4241f2));_0x41fa9c[_0xf555('0x25')]();}};}; \ No newline at end of file +var _0x2f9d=['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','toString','postText','message','amazonlex','providerName','stringify','dialogState','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','account','upperFirst','InteractionId','body','Message','create','then','catch'];(function(_0x100ee1,_0x3d15db){var _0x346151=function(_0x421106){while(--_0x421106){_0x100ee1['push'](_0x100ee1['shift']());}};_0x346151(++_0x3d15db);}(_0x2f9d,0xf4));var _0xd2f9=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x2f9d[_0x5c9307];return _0x373e29;};'use strict';var _=require('lodash');var moment=require(_0xd2f9('0x0'));var AWS=require('aws-sdk');var utils=require(_0xd2f9('0x1'));var logger=require(_0xd2f9('0x2'))(_0xd2f9('0x3'));var rpc={'chatMessage':require(_0xd2f9('0x4')),'openchannelMessage':require(_0xd2f9('0x5')),'mailMessage':require(_0xd2f9('0x6')),'smsMessage':require(_0xd2f9('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xd2f9('0x8'))};exports[_0xd2f9('0x9')]=function(_0x56d878,_0x4a5c91){return function(_0x3dc10a){try{if(!_[_0xd2f9('0xa')](this[_0xd2f9('0xb')][_0xd2f9('0xc')])){logger[_0xd2f9('0xd')](_0xd2f9('0xe'),_0x56d878,_0xd2f9('0xf'));return _0x3dc10a[_0xd2f9('0x10')]();}var _0x367830={'ContactId':this['contact']['id'],'sentAt':moment()[_0xd2f9('0x11')](_0xd2f9('0x12')),'direction':_0xd2f9('0x13')};if(this[_0xd2f9('0x14')]===_0xd2f9('0x15')||this['channel']==='whatsapp'){_0x367830[_0xd2f9('0x16')]=this[_0xd2f9('0xb')][_0xd2f9('0x16')];}var _0x56e61a=this[_0xd2f9('0x14')];if(_0x56e61a===_0xd2f9('0x17')){_0x367830['ChatWebsiteId']=this[_0xd2f9('0x18')]['id'];}else{_0x367830[_[_0xd2f9('0x19')](_0x56e61a)+'AccountId']=this[_0xd2f9('0x18')]['id'];}_0x367830[_[_0xd2f9('0x19')](_0x56e61a)+_0xd2f9('0x1a')]=this[_0xd2f9('0xb')]['id'];if(this['interaction']['created']){var _0x5c2d63=_0x4a5c91[0x4];if(!_['isEmpty'](_0x5c2d63)){_0x367830[_0xd2f9('0x1b')]=utils['getMustacheRender'](_0x5c2d63,this);return rpc[_0x56e61a+_0xd2f9('0x1c')][_0xd2f9('0x1d')](_0x367830)[_0xd2f9('0x1e')](function(_0x4f78f2){logger[_0xd2f9('0xd')]('[%s][AMAZONLEX]\x20%s',_0x56d878,_0x367830['body']);})[_0xd2f9('0x1f')](function(_0x4aa03f){logger[_0xd2f9('0x20')](_0xd2f9('0xe'),_0x56d878,JSON['stringify'](_0x4aa03f));})[_0xd2f9('0x21')](function(){logger[_0xd2f9('0xd')](_0xd2f9('0x22'),_0x56d878);_0x3dc10a[_0xd2f9('0x23')]();});}else{logger['info'](_0xd2f9('0x24'),_0x56d878);_0x3dc10a[_0xd2f9('0x23')]();}}else{var _0x261948=this;var _0x118b94=new AWS[(_0xd2f9('0x25'))]({'accessKeyId':_0x4a5c91[0x0],'secretAccessKey':_0x4a5c91[0x1],'region':_0x4a5c91[0x2]});var _0x361d5e={'botAlias':_0xd2f9('0x26'),'botName':_0x4a5c91[0x3],'inputText':this['message'][_0xd2f9('0x1b')],'userId':this[_0xd2f9('0x14')]+':'+this[_0xd2f9('0xb')]['id'][_0xd2f9('0x27')]()};_0x118b94[_0xd2f9('0x28')](_0x361d5e,function(_0xcbb45d,_0x295c2a){if(_0xcbb45d){logger['error'](_0xd2f9('0xe'),_0x56d878,_0xcbb45d[_0xd2f9('0x29')]);_0x3dc10a['next']();}else if(_0x295c2a&&_0x295c2a[_0xd2f9('0x29')]){_0x261948['body'][_0xd2f9('0x2a')]=_0x295c2a;_0x367830[_0xd2f9('0x1b')]=_0x295c2a[_0xd2f9('0x29')];_0x367830[_0xd2f9('0x2b')]=_0xd2f9('0x2a');_0x367830['providerResponse']=JSON[_0xd2f9('0x2c')](_0x295c2a);return rpc[_0x56e61a+_0xd2f9('0x1c')]['create'](_0x367830)[_0xd2f9('0x1e')](function(_0x5f4c72){logger[_0xd2f9('0xd')](_0xd2f9('0xe'),_0x56d878,_0x367830[_0xd2f9('0x1b')]);if(_0x295c2a[_0xd2f9('0x2d')]=='Failed'){_0x3dc10a['next']();}else{_0x3dc10a[_0xd2f9('0x23')]();}})[_0xd2f9('0x1f')](function(_0x49d045){logger[_0xd2f9('0x20')](_0xd2f9('0xe'),_0x56d878,JSON[_0xd2f9('0x2c')](_0x49d045));_0x3dc10a[_0xd2f9('0x10')]();});}else{_0x3dc10a['next']();}});}}catch(_0x4af889){logger[_0xd2f9('0x20')](_0xd2f9('0xe'),_0x56d878,JSON[_0xd2f9('0x2c')](_0x4af889));_0x3dc10a[_0xd2f9('0x23')]();}};}; \ 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 cafe9fa..3088ddc 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 _0xad52=['chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Smtp','service','host','port','auth','user','pass','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','then','create','stringify','catch','error','finally','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Message','resolve','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../mailRpc','consequence','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','getMustacheRender','message','channel','from','phone','read','subject','startsWith','Re:\x20'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xad52,0x198));var _0x2ad5=function(_0x23e0d6,_0x4f3373){_0x23e0d6=_0x23e0d6-0x0;var _0x2690c7=_0xad52[_0x23e0d6];return _0x2690c7;};'use strict';var _=require(_0x2ad5('0x0'));var moment=require(_0x2ad5('0x1'));var utils=require(_0x2ad5('0x2'));var logger=require(_0x2ad5('0x3'))(_0x2ad5('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2ad5('0x5')),'smsMessage':require(_0x2ad5('0x6')),'faxMessage':require(_0x2ad5('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x2ad5('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x2ad5('0x9')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x2ad5('0xa'));exports[_0x2ad5('0xb')]=function(_0x474987,_0x1349d2,_0x7c02f6,_0x209d1c){return function(_0x5d590e){try{var _0x406ed9=this['channel'];if(_0x406ed9===_0x2ad5('0xc')&&_0x209d1c[_0x2ad5('0xd')][_0x2ad5('0xe')]){logger['info'](_0x2ad5('0xf'),_0x474987,_0x2ad5('0x10'));return _0x5d590e[_0x2ad5('0x11')]();}if(_0x1349d2[0x0]==='1'&&(_[_0x2ad5('0x12')](this[_0x2ad5('0x13')][_0x2ad5('0x14')])||!this[_0x2ad5('0x13')][_0x2ad5('0x14')])){logger[_0x2ad5('0x15')](_0x2ad5('0xf'),_0x474987,_0x2ad5('0x16'));return _0x5d590e[_0x2ad5('0x11')]();}if(_0x1349d2[0x0]==='2'&&this['interaction'][_0x2ad5('0x17')]){logger['info'](_0x2ad5('0x18'),_0x474987,_0x2ad5('0x19'));return _0x5d590e[_0x2ad5('0x11')]();}var _0x4ce1f1={'ContactId':this[_0x2ad5('0x1a')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0x2ad5('0xc')){_0x4ce1f1['body']=utils[_0x2ad5('0x1b')](_0x1349d2[0x2],this);}else{_0x4ce1f1['body']=utils[_0x2ad5('0x1b')](_0x1349d2[0x1],this);}if(this[_0x2ad5('0x1c')]){_0x4ce1f1['to']=this[_0x2ad5('0x1c')]['from']||'';if(this[_0x2ad5('0x1d')]===_0x2ad5('0xc')&&_0x1349d2[0x1]==='1'){_0x4ce1f1['cc']=this[_0x2ad5('0x1c')]['cc']||'';}_0x4ce1f1[_0x2ad5('0x1e')]=this[_0x2ad5('0x1c')]['to']||'';_0x4ce1f1[_0x2ad5('0x1f')]=this[_0x2ad5('0x1c')][_0x2ad5('0x1f')]||'';_0x4ce1f1[_0x2ad5('0x20')]=!![];if(this[_0x2ad5('0x1c')]['subject']){_0x4ce1f1['subject']='';_0x4ce1f1[_0x2ad5('0x21')]+=_[_0x2ad5('0x22')](this[_0x2ad5('0x1c')]['subject'],'Re:')?'':_0x2ad5('0x23');_0x4ce1f1[_0x2ad5('0x21')]+=this[_0x2ad5('0x1c')][_0x2ad5('0x21')];}}if(this[_0x2ad5('0x1d')]===_0x2ad5('0x24')){_0x4ce1f1[_0x2ad5('0x25')]=this[_0x2ad5('0x26')]['id'];}else{_0x4ce1f1[_[_0x2ad5('0x27')](this['channel'])+_0x2ad5('0x28')]=this[_0x2ad5('0x26')]['id'];}_0x4ce1f1[_[_0x2ad5('0x27')](this[_0x2ad5('0x1d')])+_0x2ad5('0x29')]=this[_0x2ad5('0x13')]['id'];var _0x2a9edf=this[_0x2ad5('0x13')];if(rpc[this[_0x2ad5('0x1d')]+'Message']){if(this[_0x2ad5('0x1d')]===_0x2ad5('0xc')){var _0x85799c={'tls':{'rejectUnauthorized':![]}};if(this[_0x2ad5('0x26')][_0x2ad5('0x2a')][_0x2ad5('0x2b')]){_0x85799c[_0x2ad5('0x2b')]=this['account'][_0x2ad5('0x2a')]['service'];}else{_0x85799c['host']=this[_0x2ad5('0x26')][_0x2ad5('0x2a')][_0x2ad5('0x2c')];_0x85799c['port']=this['account'][_0x2ad5('0x2a')][_0x2ad5('0x2d')];_0x85799c['secure']=this[_0x2ad5('0x26')][_0x2ad5('0x2a')]['secure'];}if(this[_0x2ad5('0x26')]['Smtp']['authentication']){_0x85799c[_0x2ad5('0x2e')]={'user':this[_0x2ad5('0x26')][_0x2ad5('0x2a')][_0x2ad5('0x2f')],'pass':this[_0x2ad5('0x26')]['Smtp'][_0x2ad5('0x30')]};}_0x4ce1f1[_0x2ad5('0x31')]=this[_0x2ad5('0x1c')][_0x2ad5('0x32')];_0x4ce1f1[_0x2ad5('0x33')]=_0x2ad5('0x34')+_[_0x2ad5('0x35')](_0x4ce1f1[_0x2ad5('0xd')],_0x2ad5('0x36'),_0x2ad5('0x37'))+_0x2ad5('0x38');_0x4ce1f1[_0x2ad5('0x39')]={'Auto-Submitted':_0x2ad5('0x3a'),'X-Auto-Response-Suppress':_0x2ad5('0x3b'),'Precedence':_0x2ad5('0x3c')};return mailRpc[_0x2ad5('0x3d')](_0x85799c,_0x4ce1f1)[_0x2ad5('0x3e')](function(_0x1c4d22){logger[_0x2ad5('0x15')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x474987);_0x4ce1f1['messageId']=_0x1c4d22[_0x2ad5('0x1c')][_0x2ad5('0x32')];return rpc[_0x406ed9+'Message'][_0x2ad5('0x3f')](_0x4ce1f1);})['then'](function(_0xd827a9){logger['info']('[%s][AUTOREPLY]\x20%s',_0x474987,JSON[_0x2ad5('0x40')](_0xd827a9));})[_0x2ad5('0x41')](function(_0xdc717f){logger[_0x2ad5('0x42')]('[RPC][%s][AUTOREPLY]\x20%s',_0x474987,JSON[_0x2ad5('0x40')](_0xdc717f));})[_0x2ad5('0x43')](function(){Promise['resolve']()[_0x2ad5('0x3e')](function(){if(_0x1349d2[0x0]!=='2'||_0x2a9edf[_0x2ad5('0x17')])return;return rpc[_0x406ed9+_0x2ad5('0x44')][_0x2ad5('0x45')](_0x2a9edf['id'],{'autoreplyExecuted':!![]})[_0x2ad5('0x3e')](function(_0x17313f){logger[_0x2ad5('0x15')](_0x2ad5('0x18'),_0x474987,JSON[_0x2ad5('0x40')](_0x17313f));})[_0x2ad5('0x41')](function(_0xf08e86){logger[_0x2ad5('0x42')](_0x2ad5('0x46'),_0x474987,JSON['stringify'](_0xf08e86));});})[_0x2ad5('0x3e')](function(){_0x5d590e[_0x2ad5('0x11')]();});});}else{return rpc[this[_0x2ad5('0x1d')]+_0x2ad5('0x47')][_0x2ad5('0x3f')](_0x4ce1f1)[_0x2ad5('0x3e')](function(_0x228d82){logger[_0x2ad5('0x15')](_0x2ad5('0xf'),_0x474987,_0x4ce1f1[_0x2ad5('0xd')]);})[_0x2ad5('0x41')](function(_0x8a1d43){logger[_0x2ad5('0x42')]('[%s][AUTOREPLY]\x20%s',_0x474987,JSON[_0x2ad5('0x40')](_0x8a1d43));})[_0x2ad5('0x43')](function(){Promise[_0x2ad5('0x48')]()[_0x2ad5('0x3e')](function(){if(_0x1349d2[0x0]!=='2'||_0x2a9edf['autoreplyExecuted'])return;return rpc[_0x406ed9+_0x2ad5('0x44')][_0x2ad5('0x45')](_0x2a9edf['id'],{'autoreplyExecuted':!![]})[_0x2ad5('0x3e')](function(_0x5918d1){logger[_0x2ad5('0x15')](_0x2ad5('0x18'),_0x474987,JSON['stringify'](_0x5918d1));})['catch'](function(_0xc1fd12){logger[_0x2ad5('0x42')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x474987,JSON[_0x2ad5('0x40')](_0xc1fd12));});})[_0x2ad5('0x3e')](function(){_0x5d590e[_0x2ad5('0x11')]();});});}}}catch(_0x495357){logger[_0x2ad5('0x42')](_0x2ad5('0xf'),_0x474987,JSON[_0x2ad5('0x40')](_0x495357));_0x5d590e[_0x2ad5('0x49')]();}};}; \ No newline at end of file +var _0xdbe8=['format','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','pass','messageId','','replace','','All','auto_reply','sendMailMessage','then','create','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact'];(function(_0x2c3737,_0x4bbb67){var _0x408142=function(_0x5150b1){while(--_0x5150b1){_0x2c3737['push'](_0x2c3737['shift']());}};_0x408142(++_0x4bbb67);}(_0xdbe8,0x15d));var _0x8dbe=function(_0x373c69,_0x15249f){_0x373c69=_0x373c69-0x0;var _0x17c512=_0xdbe8[_0x373c69];return _0x17c512;};'use strict';var _=require(_0x8dbe('0x0'));var moment=require('moment');var utils=require('./utils');var logger=require(_0x8dbe('0x1'))(_0x8dbe('0x2'));var rpc={'chatMessage':require(_0x8dbe('0x3')),'openchannelMessage':require(_0x8dbe('0x4')),'mailMessage':require(_0x8dbe('0x5')),'smsMessage':require(_0x8dbe('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x8dbe('0x7')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x8dbe('0x8')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x8dbe('0x9')),'whatsappInteraction':require(_0x8dbe('0xa'))};var mailRpc=require(_0x8dbe('0xb'));exports['consequence']=function(_0x557036,_0x2c4670,_0x16ee3,_0x45f9e5){return function(_0x14ed79){try{var _0x1253ab=this['channel'];if(_0x1253ab===_0x8dbe('0xc')&&_0x45f9e5[_0x8dbe('0xd')][_0x8dbe('0xe')]){logger[_0x8dbe('0xf')]('[%s][AUTOREPLY]\x20%s',_0x557036,_0x8dbe('0x10'));return _0x14ed79[_0x8dbe('0x11')]();}if(_0x2c4670[0x0]==='1'&&(_['isNil'](this[_0x8dbe('0x12')][_0x8dbe('0x13')])||!this[_0x8dbe('0x12')][_0x8dbe('0x13')])){logger[_0x8dbe('0xf')](_0x8dbe('0x14'),_0x557036,_0x8dbe('0x15'));return _0x14ed79[_0x8dbe('0x11')]();}if(_0x2c4670[0x0]==='2'&&this[_0x8dbe('0x12')][_0x8dbe('0x16')]){logger['info'](_0x8dbe('0x17'),_0x557036,_0x8dbe('0x18'));return _0x14ed79['next']();}var _0x2c637e={'ContactId':this[_0x8dbe('0x19')]['id'],'sentAt':moment()[_0x8dbe('0x1a')](_0x8dbe('0x1b')),'direction':_0x8dbe('0x1c')};if(this[_0x8dbe('0x1d')]===_0x8dbe('0xc')){_0x2c637e[_0x8dbe('0xd')]=utils[_0x8dbe('0x1e')](_0x2c4670[0x2],this);}else{_0x2c637e[_0x8dbe('0xd')]=utils['getMustacheRender'](_0x2c4670[0x1],this);}if(this[_0x8dbe('0x1f')]){_0x2c637e['to']=this[_0x8dbe('0x1f')][_0x8dbe('0x20')]||'';if(this[_0x8dbe('0x1d')]===_0x8dbe('0xc')&&_0x2c4670[0x1]==='1'){_0x2c637e['cc']=this[_0x8dbe('0x1f')]['cc']||'';}_0x2c637e[_0x8dbe('0x20')]=this[_0x8dbe('0x1f')]['to']||'';_0x2c637e[_0x8dbe('0x21')]=this[_0x8dbe('0x1f')][_0x8dbe('0x21')]||'';_0x2c637e[_0x8dbe('0x22')]=!![];if(this[_0x8dbe('0x1f')][_0x8dbe('0x23')]){_0x2c637e[_0x8dbe('0x23')]='';_0x2c637e[_0x8dbe('0x23')]+=_[_0x8dbe('0x24')](this['message'][_0x8dbe('0x23')],'Re:')?'':_0x8dbe('0x25');_0x2c637e[_0x8dbe('0x23')]+=this[_0x8dbe('0x1f')]['subject'];}}if(this[_0x8dbe('0x1d')]===_0x8dbe('0x26')){_0x2c637e[_0x8dbe('0x27')]=this[_0x8dbe('0x28')]['id'];}else{_0x2c637e[_[_0x8dbe('0x29')](this[_0x8dbe('0x1d')])+_0x8dbe('0x2a')]=this[_0x8dbe('0x28')]['id'];}_0x2c637e[_[_0x8dbe('0x29')](this[_0x8dbe('0x1d')])+_0x8dbe('0x2b')]=this['interaction']['id'];var _0x39cd90=this[_0x8dbe('0x12')];if(rpc[this[_0x8dbe('0x1d')]+_0x8dbe('0x2c')]){if(this[_0x8dbe('0x1d')]===_0x8dbe('0xc')){var _0x4be688={'tls':{'rejectUnauthorized':![]}};if(this[_0x8dbe('0x28')][_0x8dbe('0x2d')][_0x8dbe('0x2e')]){_0x4be688[_0x8dbe('0x2e')]=this[_0x8dbe('0x28')]['Smtp']['service'];}else{_0x4be688[_0x8dbe('0x2f')]=this[_0x8dbe('0x28')]['Smtp'][_0x8dbe('0x2f')];_0x4be688['port']=this[_0x8dbe('0x28')][_0x8dbe('0x2d')][_0x8dbe('0x30')];_0x4be688[_0x8dbe('0x31')]=this[_0x8dbe('0x28')][_0x8dbe('0x2d')][_0x8dbe('0x31')];}if(this[_0x8dbe('0x28')][_0x8dbe('0x2d')][_0x8dbe('0x32')]){_0x4be688[_0x8dbe('0x33')]={'user':this[_0x8dbe('0x28')][_0x8dbe('0x2d')][_0x8dbe('0x34')],'pass':this[_0x8dbe('0x28')][_0x8dbe('0x2d')][_0x8dbe('0x35')]};}_0x2c637e['inReplyTo']=this[_0x8dbe('0x1f')][_0x8dbe('0x36')];_0x2c637e['html']=_0x8dbe('0x37')+_[_0x8dbe('0x38')](_0x2c637e[_0x8dbe('0xd')],_0x8dbe('0x39'),_0x8dbe('0x3a'))+_0x8dbe('0x3b');_0x2c637e['headers']={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x8dbe('0x3c'),'Precedence':_0x8dbe('0x3d')};return mailRpc[_0x8dbe('0x3e')](_0x4be688,_0x2c637e)[_0x8dbe('0x3f')](function(_0x62457c){logger[_0x8dbe('0xf')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x557036);_0x2c637e[_0x8dbe('0x36')]=_0x62457c[_0x8dbe('0x1f')][_0x8dbe('0x36')];return rpc[_0x1253ab+_0x8dbe('0x2c')][_0x8dbe('0x40')](_0x2c637e);})['then'](function(_0x17abc6){logger['info'](_0x8dbe('0x14'),_0x557036,JSON['stringify'](_0x17abc6));})['catch'](function(_0xee7eca){logger[_0x8dbe('0x41')](_0x8dbe('0x42'),_0x557036,JSON[_0x8dbe('0x43')](_0xee7eca));})[_0x8dbe('0x44')](function(){Promise[_0x8dbe('0x45')]()['then'](function(){if(_0x2c4670[0x0]!=='2'||_0x39cd90[_0x8dbe('0x16')])return;return rpc[_0x1253ab+_0x8dbe('0x46')][_0x8dbe('0x47')](_0x39cd90['id'],{'autoreplyExecuted':!![]})[_0x8dbe('0x3f')](function(_0x43e0aa){logger[_0x8dbe('0xf')](_0x8dbe('0x17'),_0x557036,JSON[_0x8dbe('0x43')](_0x43e0aa));})[_0x8dbe('0x48')](function(_0x3eb60f){logger[_0x8dbe('0x41')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x557036,JSON[_0x8dbe('0x43')](_0x3eb60f));});})[_0x8dbe('0x3f')](function(){_0x14ed79[_0x8dbe('0x11')]();});});}else{return rpc[this[_0x8dbe('0x1d')]+'Message'][_0x8dbe('0x40')](_0x2c637e)[_0x8dbe('0x3f')](function(_0x1c6306){logger[_0x8dbe('0xf')](_0x8dbe('0x14'),_0x557036,_0x2c637e[_0x8dbe('0xd')]);})[_0x8dbe('0x48')](function(_0xe52f1c){logger['error'](_0x8dbe('0x14'),_0x557036,JSON[_0x8dbe('0x43')](_0xe52f1c));})['finally'](function(){Promise[_0x8dbe('0x45')]()[_0x8dbe('0x3f')](function(){if(_0x2c4670[0x0]!=='2'||_0x39cd90[_0x8dbe('0x16')])return;return rpc[_0x1253ab+_0x8dbe('0x46')][_0x8dbe('0x47')](_0x39cd90['id'],{'autoreplyExecuted':!![]})[_0x8dbe('0x3f')](function(_0x1c6ad5){logger[_0x8dbe('0xf')](_0x8dbe('0x17'),_0x557036,JSON['stringify'](_0x1c6ad5));})['catch'](function(_0x402d38){logger['error'](_0x8dbe('0x49'),_0x557036,JSON['stringify'](_0x402d38));});})['then'](function(){_0x14ed79[_0x8dbe('0x11')]();});});}}}catch(_0x3069c4){logger['error'](_0x8dbe('0x14'),_0x557036,JSON[_0x8dbe('0x43')](_0x3069c4));_0x14ed79[_0x8dbe('0x4a')]();}};}; \ 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 03adca0..fd0ee2a 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 _0x4ce8=['routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../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','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','stringify','finally','[%s][CLOSE]\x20%s','stop','moment','../../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ce8,0x1a7));var _0x84ce=function(_0x426ff5,_0x24bb82){_0x426ff5=_0x426ff5-0x0;var _0x12b3cc=_0x4ce8[_0x426ff5];return _0x12b3cc;};'use strict';var moment=require(_0x84ce('0x0'));var logger=require(_0x84ce('0x1'))(_0x84ce('0x2'));var rpc={'chatInteraction':require(_0x84ce('0x3')),'openchannelInteraction':require(_0x84ce('0x4')),'smsInteraction':require(_0x84ce('0x5')),'mailInteraction':require(_0x84ce('0x6')),'faxInteraction':require(_0x84ce('0x7')),'whatsappInteraction':require(_0x84ce('0x8'))};exports[_0x84ce('0x9')]=function(_0x37b2ac,_0x4ccce1,_0x360da2,_0x25fe40){return function(_0x19f639){try{logger[_0x84ce('0xa')](_0x84ce('0xb'),_0x37b2ac,_0x4ccce1[0x0]);var _0x3ed4e0={'closed':0x1,'closedAt':moment()[_0x84ce('0xc')](_0x84ce('0xd')),'closeReason':'system','disposition':_0x4ccce1[0x0]};if(rpc[_0x25fe40[_0x84ce('0xe')]+'Interaction']){rpc[_0x25fe40[_0x84ce('0xe')]+_0x84ce('0xf')][_0x84ce('0x10')](_0x25fe40[_0x84ce('0x11')]['id'],_0x3ed4e0)['then'](function(_0x1c4571){logger[_0x84ce('0xa')](_0x84ce('0x12'),_0x37b2ac,_0x25fe40[_0x84ce('0x11')]['id']);})[_0x84ce('0x13')](function(_0x2902b5){logger[_0x84ce('0x14')]('[%s][CLOSE]\x20%s',_0x37b2ac,JSON[_0x84ce('0x15')](_0x2902b5));})[_0x84ce('0x16')](function(){_0x19f639['stop']();});}}catch(_0x1a37b2){logger[_0x84ce('0x14')](_0x84ce('0x17'),_0x37b2ac,JSON[_0x84ce('0x15')](_0x1a37b2));_0x19f639[_0x84ce('0x18')]();}};}; \ No newline at end of file +var _0xc513=['stringify','finally','stop','moment','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s'];(function(_0x6efb33,_0x6a6f5f){var _0x30a263=function(_0x4c1dcd){while(--_0x4c1dcd){_0x6efb33['push'](_0x6efb33['shift']());}};_0x30a263(++_0x6a6f5f);}(_0xc513,0x123));var _0x3c51=function(_0x162cd8,_0x1c49eb){_0x162cd8=_0x162cd8-0x0;var _0x4edff3=_0xc513[_0x162cd8];return _0x4edff3;};'use strict';var moment=require(_0x3c51('0x0'));var logger=require('../../../../config/logger')(_0x3c51('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x3c51('0x2')),'smsInteraction':require(_0x3c51('0x3')),'mailInteraction':require(_0x3c51('0x4')),'faxInteraction':require(_0x3c51('0x5')),'whatsappInteraction':require(_0x3c51('0x6'))};exports['consequence']=function(_0x5d76fa,_0x2419f1,_0x24c61d,_0xcba070){return function(_0x3c76a1){try{logger[_0x3c51('0x7')](_0x3c51('0x8'),_0x5d76fa,_0x2419f1[0x0]);var _0x55a9ff={'closed':0x1,'closedAt':moment()[_0x3c51('0x9')](_0x3c51('0xa')),'closeReason':_0x3c51('0xb'),'disposition':_0x2419f1[0x0]};if(rpc[_0xcba070[_0x3c51('0xc')]+_0x3c51('0xd')]){rpc[_0xcba070[_0x3c51('0xc')]+_0x3c51('0xd')][_0x3c51('0xe')](_0xcba070[_0x3c51('0xf')]['id'],_0x55a9ff)[_0x3c51('0x10')](function(_0x111629){logger['info'](_0x3c51('0x11'),_0x5d76fa,_0xcba070[_0x3c51('0xf')]['id']);})[_0x3c51('0x12')](function(_0x475b43){logger[_0x3c51('0x13')](_0x3c51('0x14'),_0x5d76fa,JSON[_0x3c51('0x15')](_0x475b43));})[_0x3c51('0x16')](function(){_0x3c76a1[_0x3c51('0x17')]();});}}catch(_0x5bfbca){logger[_0x3c51('0x13')](_0x3c51('0x14'),_0x5d76fa,JSON[_0x3c51('0x15')](_0x5bfbca));_0x3c76a1[_0x3c51('0x17')]();}};}; \ 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 a3410f3..af45c89 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 _0x6c14=['dialogflow','result','fulfillment','speech','providerName','metadata','next','catch','stringify','lodash','moment','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','error','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'];(function(_0xf58c51,_0x59042b){var _0x4d8f30=function(_0x566ad7){while(--_0x566ad7){_0xf58c51['push'](_0xf58c51['shift']());}};_0x4d8f30(++_0x59042b);}(_0x6c14,0xd1));var _0x46c1=function(_0x4b6b4f,_0x2b6fdd){_0x4b6b4f=_0x4b6b4f-0x0;var _0x4a4165=_0x6c14[_0x4b6b4f];return _0x4a4165;};'use strict';var _=require(_0x46c1('0x0'));var moment=require(_0x46c1('0x1'));var apiai=require(_0x46c1('0x2'));var md5=require(_0x46c1('0x3'));var utils=require(_0x46c1('0x4'));var logger=require('../../../../config/logger')(_0x46c1('0x5'));var rpc={'chatMessage':require(_0x46c1('0x6')),'openchannelMessage':require(_0x46c1('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x46c1('0x8')),'faxMessage':require(_0x46c1('0x9')),'whatsappMessage':require(_0x46c1('0xa'))};exports[_0x46c1('0xb')]=function(_0x29b2d8,_0x10b22d){return function(_0xfaf798){try{if(!_[_0x46c1('0xc')](this[_0x46c1('0xd')]['UserId'])){logger[_0x46c1('0xe')](_0x46c1('0xf'),_0x29b2d8,_0x46c1('0x10'));return _0xfaf798['next']();}var _0x42af02={'ContactId':this[_0x46c1('0x11')]['id'],'sentAt':moment()[_0x46c1('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x46c1('0x13')};if(this[_0x46c1('0x14')]===_0x46c1('0x15')||this[_0x46c1('0x14')]==='whatsapp'){_0x42af02[_0x46c1('0x16')]=this[_0x46c1('0xd')]['phone'];}var _0x4ef906=this[_0x46c1('0x14')];if(_0x4ef906===_0x46c1('0x17')){_0x42af02[_0x46c1('0x18')]=this[_0x46c1('0x19')]['id'];}else{_0x42af02[_[_0x46c1('0x1a')](_0x4ef906)+'AccountId']=this[_0x46c1('0x19')]['id'];}_0x42af02[_[_0x46c1('0x1a')](_0x4ef906)+_0x46c1('0x1b')]=this[_0x46c1('0xd')]['id'];if(this[_0x46c1('0xd')]['created']){var _0x5f1dc1=_0x10b22d[0x2];if(!_[_0x46c1('0x1c')](_0x5f1dc1)){_0x42af02[_0x46c1('0x1d')]=utils[_0x46c1('0x1e')](_0x5f1dc1,this);return rpc[_0x4ef906+_0x46c1('0x1f')][_0x46c1('0x20')](_0x42af02)[_0x46c1('0x21')](function(_0x2ec920){logger['info'](_0x46c1('0xf'),_0x29b2d8,_0x42af02[_0x46c1('0x1d')]);})['catch'](function(_0x50a76c){logger[_0x46c1('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x29b2d8,JSON['stringify'](_0x50a76c));})[_0x46c1('0x23')](function(){logger[_0x46c1('0xe')](_0x46c1('0x24'),_0x29b2d8);_0xfaf798[_0x46c1('0x25')]();});}else{logger[_0x46c1('0xe')](_0x46c1('0x26'),_0x29b2d8);_0xfaf798[_0x46c1('0x25')]();}}else{var _0x21e02d=this;var _0x3db7b1=apiai(_0x10b22d[0x0],{'language':_0x10b22d[0x1]||'en'});return _0x3db7b1[_0x46c1('0x27')](this[_0x46c1('0x28')][_0x46c1('0x1d')],{'sessionId':md5(this[_0x46c1('0xd')]['id'])})[_0x46c1('0x21')](function(_0x37fa8c){_0x21e02d[_0x46c1('0x1d')][_0x46c1('0x29')]=_0x37fa8c;_0x42af02[_0x46c1('0x1d')]=_0x37fa8c[_0x46c1('0x2a')][_0x46c1('0x2b')][_0x46c1('0x2c')];_0x42af02[_0x46c1('0x2d')]=_0x46c1('0x29');_0x42af02['providerResponse']=JSON['stringify'](_0x37fa8c);return rpc[_0x4ef906+_0x46c1('0x1f')][_0x46c1('0x20')](_0x42af02)['then'](function(_0x2b94aa){logger[_0x46c1('0xe')](_0x46c1('0xf'),_0x29b2d8,_0x42af02[_0x46c1('0x1d')]);if(_0x37fa8c[_0x46c1('0x2a')][_0x46c1('0x2e')]['endConversation']){_0xfaf798[_0x46c1('0x2f')]();}else{_0xfaf798[_0x46c1('0x25')]();}})[_0x46c1('0x30')](function(_0x187ecf){logger[_0x46c1('0x22')](_0x46c1('0xf'),_0x29b2d8,JSON[_0x46c1('0x31')](_0x187ecf));_0xfaf798['next']();});})[_0x46c1('0x30')](function(_0x5448f4){logger[_0x46c1('0x22')](_0x46c1('0xf'),_0x29b2d8,_0x5448f4[_0x46c1('0x28')]);_0xfaf798[_0x46c1('0x2f')]();});}}catch(_0x5bb8e1){logger['error'](_0x46c1('0xf'),_0x29b2d8,JSON[_0x46c1('0x31')](_0x5bb8e1));_0xfaf798['stop']();}};}; \ No newline at end of file +var _0x3f8a=['created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','result','fulfillment','speech','providerName','endConversation','lodash','moment','apiai-promise','md5','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account'];(function(_0x1135f8,_0x4f9d46){var _0x195bd3=function(_0x3d56ef){while(--_0x3d56ef){_0x1135f8['push'](_0x1135f8['shift']());}};_0x195bd3(++_0x4f9d46);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4c15f1,_0x2f056c){_0x4c15f1=_0x4c15f1-0x0;var _0xc81295=_0x3f8a[_0x4c15f1];return _0xc81295;};'use strict';var _=require(_0xa3f8('0x0'));var moment=require(_0xa3f8('0x1'));var apiai=require(_0xa3f8('0x2'));var md5=require(_0xa3f8('0x3'));var utils=require('./utils');var logger=require(_0xa3f8('0x4'))(_0xa3f8('0x5'));var rpc={'chatMessage':require(_0xa3f8('0x6')),'openchannelMessage':require(_0xa3f8('0x7')),'mailMessage':require(_0xa3f8('0x8')),'smsMessage':require(_0xa3f8('0x9')),'faxMessage':require(_0xa3f8('0xa')),'whatsappMessage':require(_0xa3f8('0xb'))};exports[_0xa3f8('0xc')]=function(_0xf895d9,_0xcfea5){return function(_0x268332){try{if(!_[_0xa3f8('0xd')](this[_0xa3f8('0xe')][_0xa3f8('0xf')])){logger[_0xa3f8('0x10')](_0xa3f8('0x11'),_0xf895d9,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x268332[_0xa3f8('0x12')]();}var _0x13a082={'ContactId':this[_0xa3f8('0x13')]['id'],'sentAt':moment()[_0xa3f8('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa3f8('0x15')};if(this[_0xa3f8('0x16')]===_0xa3f8('0x17')||this[_0xa3f8('0x16')]===_0xa3f8('0x18')){_0x13a082[_0xa3f8('0x19')]=this[_0xa3f8('0xe')][_0xa3f8('0x19')];}var _0x324aa8=this[_0xa3f8('0x16')];if(_0x324aa8===_0xa3f8('0x1a')){_0x13a082[_0xa3f8('0x1b')]=this['account']['id'];}else{_0x13a082[_[_0xa3f8('0x1c')](_0x324aa8)+_0xa3f8('0x1d')]=this[_0xa3f8('0x1e')]['id'];}_0x13a082[_[_0xa3f8('0x1c')](_0x324aa8)+'InteractionId']=this[_0xa3f8('0xe')]['id'];if(this[_0xa3f8('0xe')][_0xa3f8('0x1f')]){var _0x8cd130=_0xcfea5[0x2];if(!_[_0xa3f8('0x20')](_0x8cd130)){_0x13a082[_0xa3f8('0x21')]=utils[_0xa3f8('0x22')](_0x8cd130,this);return rpc[_0x324aa8+_0xa3f8('0x23')][_0xa3f8('0x24')](_0x13a082)[_0xa3f8('0x25')](function(_0x54b870){logger[_0xa3f8('0x10')]('[%s][DIALOGFLOW]\x20%s',_0xf895d9,_0x13a082[_0xa3f8('0x21')]);})[_0xa3f8('0x26')](function(_0x191f99){logger[_0xa3f8('0x27')]('[%s][DIALOGFLOW]\x20%s',_0xf895d9,JSON[_0xa3f8('0x28')](_0x191f99));})['finally'](function(){logger[_0xa3f8('0x10')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xf895d9);_0x268332[_0xa3f8('0x29')]();});}else{logger[_0xa3f8('0x10')](_0xa3f8('0x2a'),_0xf895d9);_0x268332[_0xa3f8('0x29')]();}}else{var _0x3a6a57=this;var _0x1e5f30=apiai(_0xcfea5[0x0],{'language':_0xcfea5[0x1]||'en'});return _0x1e5f30[_0xa3f8('0x2b')](this['message'][_0xa3f8('0x21')],{'sessionId':md5(this['interaction']['id'])})[_0xa3f8('0x25')](function(_0xa5a697){_0x3a6a57[_0xa3f8('0x21')][_0xa3f8('0x2c')]=_0xa5a697;_0x13a082[_0xa3f8('0x21')]=_0xa5a697[_0xa3f8('0x2d')][_0xa3f8('0x2e')][_0xa3f8('0x2f')];_0x13a082[_0xa3f8('0x30')]=_0xa3f8('0x2c');_0x13a082['providerResponse']=JSON[_0xa3f8('0x28')](_0xa5a697);return rpc[_0x324aa8+_0xa3f8('0x23')][_0xa3f8('0x24')](_0x13a082)['then'](function(_0x40f5cc){logger['info'](_0xa3f8('0x11'),_0xf895d9,_0x13a082[_0xa3f8('0x21')]);if(_0xa5a697[_0xa3f8('0x2d')]['metadata'][_0xa3f8('0x31')]){_0x268332['next']();}else{_0x268332[_0xa3f8('0x29')]();}})[_0xa3f8('0x26')](function(_0x226153){logger[_0xa3f8('0x27')](_0xa3f8('0x11'),_0xf895d9,JSON[_0xa3f8('0x28')](_0x226153));_0x268332[_0xa3f8('0x12')]();});})[_0xa3f8('0x26')](function(_0x25f9f5){logger[_0xa3f8('0x27')](_0xa3f8('0x11'),_0xf895d9,_0x25f9f5['message']);_0x268332[_0xa3f8('0x12')]();});}}catch(_0x29c6b4){logger[_0xa3f8('0x27')](_0xa3f8('0x11'),_0xf895d9,JSON[_0xa3f8('0x28')](_0x29c6b4));_0x268332['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 7867a1a..9990c48 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 _0xd3c2=['queryResult','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','all','lodash','moment','bluebird','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','create','then','info','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','ChatWebsiteId','account','created','Message','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','message','length','dialogflowV2','diagnosticInfo'];(function(_0x32bf6f,_0x51a0dc){var _0x4b5648=function(_0x2ffa89){while(--_0x2ffa89){_0x32bf6f['push'](_0x32bf6f['shift']());}};_0x4b5648(++_0x51a0dc);}(_0xd3c2,0x1e4));var _0x2d3c=function(_0xbba45e,_0x189a4a){_0xbba45e=_0xbba45e-0x0;var _0x575a5d=_0xd3c2[_0xbba45e];return _0x575a5d;};'use strict';var _=require(_0x2d3c('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0x2d3c('0x1'));var Promise=require(_0x2d3c('0x2'));var logger=require('../../../../config/logger')('routing');var utils=require(_0x2d3c('0x3'));var rpc={'chatMessage':require(_0x2d3c('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2d3c('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2d3c('0x6')),'whatsappMessage':require(_0x2d3c('0x7'))};function createMessage(_0x3847cc,_0x2e3745,_0x7fa5b9,_0xaff3aa){return new Promise(function(_0x2f47d1,_0x390a5a){var _0x42a7d8=_['clone'](_0x7fa5b9);_0x42a7d8[_0x2d3c('0x8')]=_0xaff3aa;return rpc[_0x2e3745+'Message'][_0x2d3c('0x9')](_0x42a7d8)[_0x2d3c('0xa')](function(){logger[_0x2d3c('0xb')]('[%s][DIALOGFLOWV2]\x20%s',_0x3847cc,_0x42a7d8[_0x2d3c('0x8')]);_0x2f47d1();})[_0x2d3c('0xc')](function(_0x78d111){logger[_0x2d3c('0xd')](_0x2d3c('0xe'),_0x3847cc,JSON[_0x2d3c('0xf')](_0x78d111));_0x390a5a(_0x78d111);});});}exports[_0x2d3c('0x10')]=function(_0x402672,_0x37d905){return function(_0x290ff7){try{if(!_[_0x2d3c('0x11')](this[_0x2d3c('0x12')]['UserId'])){logger[_0x2d3c('0xb')]('[%s][DIALOGFLOWV2]\x20%s',_0x402672,_0x2d3c('0x13'));return _0x290ff7[_0x2d3c('0x14')]();}var _0x11840b={'ContactId':this[_0x2d3c('0x15')]['id'],'sentAt':moment()[_0x2d3c('0x16')](_0x2d3c('0x17')),'direction':_0x2d3c('0x18')};if(this['channel']===_0x2d3c('0x19')||this[_0x2d3c('0x1a')]===_0x2d3c('0x1b')){_0x11840b[_0x2d3c('0x1c')]=this[_0x2d3c('0x12')][_0x2d3c('0x1c')];}var _0x5bab4a=this[_0x2d3c('0x1a')];if(_0x5bab4a==='chat'){_0x11840b[_0x2d3c('0x1d')]=this[_0x2d3c('0x1e')]['id'];}else{_0x11840b[_['upperFirst'](_0x5bab4a)+'AccountId']=this[_0x2d3c('0x1e')]['id'];}_0x11840b[_['upperFirst'](_0x5bab4a)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0x2d3c('0x1f')]){var _0x3db6b6=_0x37d905[0x4];if(!_['isEmpty'](_0x3db6b6)){_0x11840b[_0x2d3c('0x8')]=utils['getMustacheRender'](_0x3db6b6,this);return rpc[_0x5bab4a+_0x2d3c('0x20')]['create'](_0x11840b)[_0x2d3c('0xa')](function(_0xf22d70){logger['info'](_0x2d3c('0xe'),_0x402672,_0x11840b[_0x2d3c('0x8')]);})[_0x2d3c('0xc')](function(_0x171213){logger[_0x2d3c('0xd')](_0x2d3c('0xe'),_0x402672,JSON['stringify'](_0x171213));})[_0x2d3c('0x21')](function(){logger[_0x2d3c('0xb')](_0x2d3c('0x22'),_0x402672);_0x290ff7[_0x2d3c('0x23')]();});}else{logger[_0x2d3c('0xb')](_0x2d3c('0x24'),_0x402672);_0x290ff7['stop']();}}else{var _0x4dbc17=this;var _0x1568c0=_0x37d905[0x2][_0x2d3c('0x25')](/\\n/g,'\x0a');var _0x2b8656={'credentials':{'private_key':_0x1568c0,'client_email':_0x37d905[0x1]}};var _0x53a752=new dialogflow[(_0x2d3c('0x26'))](_0x2b8656);var _0x5ed2ed=_0x53a752[_0x2d3c('0x27')](_0x37d905[0x0],md5(_0x4dbc17['interaction']['id']));var _0x3039eb={'session':_0x5ed2ed,'queryInput':{'text':{'text':_0x4dbc17[_0x2d3c('0x28')][_0x2d3c('0x8')],'languageCode':_0x37d905[0x3]||'en'}}};return _0x53a752['detectIntent'](_0x3039eb)[_0x2d3c('0xa')](function(_0x3fbf4f){if(_0x3fbf4f&&_0x3fbf4f[_0x2d3c('0x29')]){_0x4dbc17[_0x2d3c('0x8')][_0x2d3c('0x2a')]=_0x3fbf4f;var _0x17d368=_0x3fbf4f[0x0];var _0x3c28b9=_0x17d368['queryResult'][_0x2d3c('0x2b')]&&_0x17d368[_0x2d3c('0x2c')][_0x2d3c('0x2b')][_0x2d3c('0x2d')]?_0x17d368['queryResult'][_0x2d3c('0x2b')][_0x2d3c('0x2d')][_0x2d3c('0x2e')]['boolValue']:![];_0x4dbc17[_0x2d3c('0x8')][_0x2d3c('0x2f')]=_0x17d368[_0x2d3c('0x2c')][_0x2d3c('0x30')];_0x4dbc17[_0x2d3c('0x8')][_0x2d3c('0x31')]=_0x17d368['queryResult'][_0x2d3c('0x32')];_0x4dbc17[_0x2d3c('0x8')][_0x2d3c('0x33')]=_0x17d368['queryResult'][_0x2d3c('0x2b')]&&_0x17d368[_0x2d3c('0x2c')][_0x2d3c('0x2b')][_0x2d3c('0x2d')]?_0x17d368[_0x2d3c('0x2c')]['diagnosticInfo'][_0x2d3c('0x2d')][_0x2d3c('0x2e')][_0x2d3c('0x34')]:![];_0x4dbc17[_0x2d3c('0x8')]['DIALOGFLOWV2_INTENTNAME']=_0x17d368[_0x2d3c('0x2c')][_0x2d3c('0x35')][_0x2d3c('0x36')];_0x4dbc17[_0x2d3c('0x8')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x17d368[_0x2d3c('0x2c')][_0x2d3c('0x35')][_0x2d3c('0x37')];_0x4dbc17[_0x2d3c('0x8')][_0x2d3c('0x38')]=_0x17d368['queryResult']['intent'][_0x2d3c('0x39')];_0x4dbc17[_0x2d3c('0x8')][_0x2d3c('0x3a')]=_0x17d368[_0x2d3c('0x2c')][_0x2d3c('0x3b')];_0x4dbc17['body']['DIALOGFLOWV2_QUERYTEXT']=_0x17d368[_0x2d3c('0x2c')]['queryText'];_0x4dbc17[_0x2d3c('0x8')][_0x2d3c('0x3c')]=_0x17d368[_0x2d3c('0x2c')][_0x2d3c('0x3d')];_0x11840b[_0x2d3c('0x3e')]=_0x2d3c('0x2a');_0x11840b[_0x2d3c('0x3f')]=JSON[_0x2d3c('0xf')](_0x3fbf4f);var _0x7c6c0=[];for(var _0x234998=0x0;_0x234998<_0x3fbf4f[_0x2d3c('0x29')];_0x234998++){var _0x27af0c=_0x3fbf4f[_0x234998];if(_0x27af0c&&_0x27af0c[_0x2d3c('0x2c')]&&_0x27af0c[_0x2d3c('0x2c')][_0x2d3c('0x40')]){_0x7c6c0['push'](createMessage(_0x402672,_0x5bab4a,_0x11840b,_0x27af0c[_0x2d3c('0x2c')]['fulfillmentText']));}}return Promise[_0x2d3c('0x41')](_0x7c6c0)[_0x2d3c('0xa')](function(){if(_0x3c28b9){_0x290ff7['next']();}else{_0x290ff7[_0x2d3c('0x23')]();}})[_0x2d3c('0xc')](function(_0x308c58){logger[_0x2d3c('0xd')](_0x2d3c('0xe'),_0x402672,JSON[_0x2d3c('0xf')](_0x308c58));_0x290ff7[_0x2d3c('0x14')]();});}})[_0x2d3c('0xc')](function(_0xf6057c){logger[_0x2d3c('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x402672,_0xf6057c[_0x2d3c('0x28')]);_0x290ff7[_0x2d3c('0x14')]();});}}catch(_0x2b14ab){logger['error'](_0x2d3c('0xe'),_0x402672,JSON[_0x2d3c('0xf')](_0x2b14ab));_0x290ff7[_0x2d3c('0x23')]();}};}; \ No newline at end of file +var _0xf29c=['next','format','out','sms','whatsapp','phone','channel','chat','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','error','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','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','push','all','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','stringify','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.'];(function(_0x35adb1,_0x290436){var _0x466e8a=function(_0x18403c){while(--_0x18403c){_0x35adb1['push'](_0x35adb1['shift']());}};_0x466e8a(++_0x290436);}(_0xf29c,0xc7));var _0xcf29=function(_0x51e1cb,_0x28b220){_0x51e1cb=_0x51e1cb-0x0;var _0x541d02=_0xf29c[_0x51e1cb];return _0x541d02;};'use strict';var _=require('lodash');var dialogflow=require(_0xcf29('0x0'));var md5=require(_0xcf29('0x1'));var moment=require(_0xcf29('0x2'));var Promise=require(_0xcf29('0x3'));var logger=require(_0xcf29('0x4'))(_0xcf29('0x5'));var utils=require(_0xcf29('0x6'));var rpc={'chatMessage':require(_0xcf29('0x7')),'openchannelMessage':require(_0xcf29('0x8')),'mailMessage':require(_0xcf29('0x9')),'smsMessage':require(_0xcf29('0xa')),'faxMessage':require(_0xcf29('0xb')),'whatsappMessage':require(_0xcf29('0xc'))};function createMessage(_0x157dfe,_0x15ab38,_0x435ced,_0x4e6469){return new Promise(function(_0x5ec45f,_0x1a1c8e){var _0x2694c8=_[_0xcf29('0xd')](_0x435ced);_0x2694c8[_0xcf29('0xe')]=_0x4e6469;return rpc[_0x15ab38+_0xcf29('0xf')][_0xcf29('0x10')](_0x2694c8)[_0xcf29('0x11')](function(){logger[_0xcf29('0x12')](_0xcf29('0x13'),_0x157dfe,_0x2694c8[_0xcf29('0xe')]);_0x5ec45f();})[_0xcf29('0x14')](function(_0x11d304){logger['error'](_0xcf29('0x13'),_0x157dfe,JSON[_0xcf29('0x15')](_0x11d304));_0x1a1c8e(_0x11d304);});});}exports['consequence']=function(_0x2cc788,_0x562c05){return function(_0x381735){try{if(!_[_0xcf29('0x16')](this[_0xcf29('0x17')][_0xcf29('0x18')])){logger[_0xcf29('0x12')](_0xcf29('0x13'),_0x2cc788,_0xcf29('0x19'));return _0x381735[_0xcf29('0x1a')]();}var _0x43ddc8={'ContactId':this['contact']['id'],'sentAt':moment()[_0xcf29('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xcf29('0x1c')};if(this['channel']===_0xcf29('0x1d')||this['channel']===_0xcf29('0x1e')){_0x43ddc8['phone']=this[_0xcf29('0x17')][_0xcf29('0x1f')];}var _0x53669a=this[_0xcf29('0x20')];if(_0x53669a===_0xcf29('0x21')){_0x43ddc8['ChatWebsiteId']=this[_0xcf29('0x22')]['id'];}else{_0x43ddc8[_[_0xcf29('0x23')](_0x53669a)+'AccountId']=this['account']['id'];}_0x43ddc8[_['upperFirst'](_0x53669a)+_0xcf29('0x24')]=this[_0xcf29('0x17')]['id'];if(this[_0xcf29('0x17')][_0xcf29('0x25')]){var _0x2356ae=_0x562c05[0x4];if(!_[_0xcf29('0x26')](_0x2356ae)){_0x43ddc8[_0xcf29('0xe')]=utils[_0xcf29('0x27')](_0x2356ae,this);return rpc[_0x53669a+_0xcf29('0xf')][_0xcf29('0x10')](_0x43ddc8)[_0xcf29('0x11')](function(_0x4573b1){logger['info'](_0xcf29('0x13'),_0x2cc788,_0x43ddc8[_0xcf29('0xe')]);})[_0xcf29('0x14')](function(_0x35d2d7){logger[_0xcf29('0x28')](_0xcf29('0x13'),_0x2cc788,JSON['stringify'](_0x35d2d7));})[_0xcf29('0x29')](function(){logger[_0xcf29('0x12')](_0xcf29('0x2a'),_0x2cc788);_0x381735[_0xcf29('0x2b')]();});}else{logger['info'](_0xcf29('0x2c'),_0x2cc788);_0x381735[_0xcf29('0x2b')]();}}else{var _0x39ebb2=this;var _0x5c06f1=_0x562c05[0x2][_0xcf29('0x2d')](/\\n/g,'\x0a');var _0x38f08a={'credentials':{'private_key':_0x5c06f1,'client_email':_0x562c05[0x1]}};var _0x464b17=new dialogflow[(_0xcf29('0x2e'))](_0x38f08a);var _0x2f6cbf=_0x464b17[_0xcf29('0x2f')](_0x562c05[0x0],md5(_0x39ebb2[_0xcf29('0x17')]['id']));var _0x5e7aaf={'session':_0x2f6cbf,'queryInput':{'text':{'text':_0x39ebb2[_0xcf29('0x30')][_0xcf29('0xe')],'languageCode':_0x562c05[0x3]||'en'}}};return _0x464b17[_0xcf29('0x31')](_0x5e7aaf)[_0xcf29('0x11')](function(_0x2aeee4){if(_0x2aeee4&&_0x2aeee4[_0xcf29('0x32')]){_0x39ebb2[_0xcf29('0xe')][_0xcf29('0x33')]=_0x2aeee4;var _0x5639af=_0x2aeee4[0x0];var _0x231043=_0x5639af[_0xcf29('0x34')][_0xcf29('0x35')]&&_0x5639af[_0xcf29('0x34')][_0xcf29('0x35')][_0xcf29('0x36')]?_0x5639af[_0xcf29('0x34')]['diagnosticInfo']['fields'][_0xcf29('0x37')][_0xcf29('0x38')]:![];_0x39ebb2[_0xcf29('0xe')][_0xcf29('0x39')]=_0x5639af[_0xcf29('0x34')][_0xcf29('0x3a')];_0x39ebb2[_0xcf29('0xe')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x5639af[_0xcf29('0x34')][_0xcf29('0x3b')];_0x39ebb2[_0xcf29('0xe')][_0xcf29('0x3c')]=_0x5639af['queryResult']['diagnosticInfo']&&_0x5639af[_0xcf29('0x34')]['diagnosticInfo'][_0xcf29('0x36')]?_0x5639af[_0xcf29('0x34')][_0xcf29('0x35')][_0xcf29('0x36')]['end_conversation']['boolValue']:![];_0x39ebb2[_0xcf29('0xe')][_0xcf29('0x3d')]=_0x5639af[_0xcf29('0x34')][_0xcf29('0x3e')]['name'];_0x39ebb2['body'][_0xcf29('0x3f')]=_0x5639af['queryResult'][_0xcf29('0x3e')]['displayName'];_0x39ebb2['body'][_0xcf29('0x40')]=_0x5639af[_0xcf29('0x34')]['intent'][_0xcf29('0x41')];_0x39ebb2['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x5639af[_0xcf29('0x34')][_0xcf29('0x42')];_0x39ebb2['body'][_0xcf29('0x43')]=_0x5639af['queryResult'][_0xcf29('0x44')];_0x39ebb2['body'][_0xcf29('0x45')]=_0x5639af['queryResult']['intentDetectionConfidence'];_0x43ddc8[_0xcf29('0x46')]='dialogflowV2';_0x43ddc8[_0xcf29('0x47')]=JSON[_0xcf29('0x15')](_0x2aeee4);var _0x13f0bf=[];for(var _0xabf106=0x0;_0xabf106<_0x2aeee4[_0xcf29('0x32')];_0xabf106++){var _0x4b793a=_0x2aeee4[_0xabf106];if(_0x4b793a&&_0x4b793a[_0xcf29('0x34')]&&_0x4b793a['queryResult'][_0xcf29('0x48')]){_0x13f0bf[_0xcf29('0x49')](createMessage(_0x2cc788,_0x53669a,_0x43ddc8,_0x4b793a['queryResult']['fulfillmentText']));}}return Promise[_0xcf29('0x4a')](_0x13f0bf)[_0xcf29('0x11')](function(){if(_0x231043){_0x381735[_0xcf29('0x1a')]();}else{_0x381735[_0xcf29('0x2b')]();}})[_0xcf29('0x14')](function(_0x267186){logger['error'](_0xcf29('0x13'),_0x2cc788,JSON[_0xcf29('0x15')](_0x267186));_0x381735[_0xcf29('0x1a')]();});}})['catch'](function(_0x43f28b){logger[_0xcf29('0x28')](_0xcf29('0x13'),_0x2cc788,_0x43f28b[_0xcf29('0x30')]);_0x381735['next']();});}}catch(_0xfd63bd){logger['error'](_0xcf29('0x13'),_0x2cc788,JSON['stringify'](_0xfd63bd));_0x381735[_0xcf29('0x2b')]();}};}; \ 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 7dd013c..408bdc7 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 _0x47b4=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','getMustacheRender','length','error','message','join','stop','condition','priorityTrue','info','next','findIndex'];(function(_0x56b883,_0x4eda63){var _0x58db33=function(_0x31a15f){while(--_0x31a15f){_0x56b883['push'](_0x56b883['shift']());}};_0x58db33(++_0x4eda63);}(_0x47b4,0xf5));var _0x447b=function(_0x8c453,_0x57ffe1){_0x8c453=_0x8c453-0x0;var _0xc76889=_0x47b4[_0x8c453];return _0xc76889;};'use strict';var schema=require(_0x447b('0x0'));var _=require('lodash');var htmlToText=require(_0x447b('0x1'));var utils=require(_0x447b('0x2'));var logger=require(_0x447b('0x3'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x447b('0x4')},'priorityTrue':{'type':_0x447b('0x5'),'message':_0x447b('0x6')},'priorityFalse':{'type':_0x447b('0x5'),'message':_0x447b('0x7')}});exports['consequence']=function(_0x451f1f,_0x2d7886){return function(_0x18698f){try{var _0x4b7506={'condition':htmlToText['fromString'](utils[_0x447b('0x8')](_0x2d7886[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2d7886[0x1],'priorityFalse':_0x2d7886[0x2]};var _0x10da00=gotoif[_0x447b('0x0')](_0x4b7506,{'typecast':!![]});if(_0x10da00[_0x447b('0x9')]){logger[_0x447b('0xa')]('[%s][GOTOIF]\x20%s',_0x451f1f,_['map'](_0x10da00,_0x447b('0xb'))[_0x447b('0xc')](',\x20'));_0x18698f[_0x447b('0xd')]();}else{try{var _0x3d6b58=eval('('+_0x4b7506[_0x447b('0xe')]+')');var _0x2bf9d3=_0x3d6b58?_0x4b7506[_0x447b('0xf')]:_0x4b7506['priorityFalse'];logger[_0x447b('0x10')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x451f1f,_0x4b7506['condition'],_0x3d6b58,_0x2bf9d3||_0x447b('0x11'));if(_0x2bf9d3){var _0xf89698=_[_0x447b('0x12')](_0x18698f['rules'](),{'p':_0x2bf9d3});if(_0xf89698>=0x0){logger[_0x447b('0x10')](_0x447b('0x13'),_0x451f1f,_0x2bf9d3||_0x447b('0x11'),_0xf89698);_0x18698f['next'](_0xf89698);}else{logger[_0x447b('0x10')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x451f1f,_0x2bf9d3||_0x447b('0x11'));_0x18698f[_0x447b('0xd')]();}}else{_0x18698f['next']();}}catch(_0x113f8b){logger['error'](_0x447b('0x14'),_0x451f1f,_0x113f8b[_0x447b('0xb')]);_0x18698f['stop']();}}}catch(_0x380f3f){logger['error']('[%s][GOTOIF]\x20%s',_0x451f1f,JSON[_0x447b('0x15')](_0x380f3f));_0x18698f[_0x447b('0xd')]();}};}; \ No newline at end of file +var _0x8fd4=['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','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','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','fromString','length','[%s][GOTOIF]\x20%s'];(function(_0x3e5f15,_0x54f737){var _0x28d69c=function(_0x8bf548){while(--_0x8bf548){_0x3e5f15['push'](_0x3e5f15['shift']());}};_0x28d69c(++_0x54f737);}(_0x8fd4,0x83));var _0x48fd=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x8fd4[_0x2c7618];return _0x5ce3f0;};'use strict';var schema=require(_0x48fd('0x0'));var _=require(_0x48fd('0x1'));var htmlToText=require(_0x48fd('0x2'));var utils=require(_0x48fd('0x3'));var logger=require(_0x48fd('0x4'))(_0x48fd('0x5'));var gotoif=schema({'condition':{'type':_0x48fd('0x6'),'required':!![],'message':_0x48fd('0x7')},'priorityTrue':{'type':_0x48fd('0x8'),'message':_0x48fd('0x9')},'priorityFalse':{'type':'number','message':_0x48fd('0xa')}});exports['consequence']=function(_0xc49db4,_0xb31177){return function(_0x2d4aca){try{var _0x112b9c={'condition':htmlToText[_0x48fd('0xb')](utils['getMustacheRender'](_0xb31177[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xb31177[0x1],'priorityFalse':_0xb31177[0x2]};var _0x5ab54c=gotoif[_0x48fd('0x0')](_0x112b9c,{'typecast':!![]});if(_0x5ab54c[_0x48fd('0xc')]){logger['error'](_0x48fd('0xd'),_0xc49db4,_['map'](_0x5ab54c,_0x48fd('0xe'))[_0x48fd('0xf')](',\x20'));_0x2d4aca[_0x48fd('0x10')]();}else{try{var _0x3a9b99=eval('('+_0x112b9c[_0x48fd('0x11')]+')');var _0x413fa7=_0x3a9b99?_0x112b9c[_0x48fd('0x12')]:_0x112b9c[_0x48fd('0x13')];logger[_0x48fd('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0xc49db4,_0x112b9c[_0x48fd('0x11')],_0x3a9b99,_0x413fa7||_0x48fd('0x15'));if(_0x413fa7){var _0xaaa2ea=_[_0x48fd('0x16')](_0x2d4aca[_0x48fd('0x17')](),{'p':_0x413fa7});if(_0xaaa2ea>=0x0){logger['info'](_0x48fd('0x18'),_0xc49db4,_0x413fa7||_0x48fd('0x15'),_0xaaa2ea);_0x2d4aca[_0x48fd('0x15')](_0xaaa2ea);}else{logger['info'](_0x48fd('0x19'),_0xc49db4,_0x413fa7||'next');_0x2d4aca['stop']();}}else{_0x2d4aca[_0x48fd('0x15')]();}}catch(_0x3725d0){logger[_0x48fd('0x1a')](_0x48fd('0x1b'),_0xc49db4,_0x3725d0[_0x48fd('0xe')]);_0x2d4aca[_0x48fd('0x10')]();}}}catch(_0x586bf7){logger[_0x48fd('0x1a')](_0x48fd('0xd'),_0xc49db4,JSON[_0x48fd('0x1c')](_0x586bf7));_0x2d4aca[_0x48fd('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 03071e4..44b2983 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 _0xcf60=['routing','consequence','length','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','validate','lodash','../../../../config/logger'];(function(_0x5ea33f,_0x1b67a5){var _0x5e4794=function(_0x530d42){while(--_0x530d42){_0x5ea33f['push'](_0x5ea33f['shift']());}};_0x5e4794(++_0x1b67a5);}(_0xcf60,0x9f));var _0x0cf6=function(_0x371e64,_0x258edf){_0x371e64=_0x371e64-0x0;var _0x210571=_0xcf60[_0x371e64];return _0x210571;};'use strict';var schema=require(_0x0cf6('0x0'));var _=require(_0x0cf6('0x1'));var logger=require(_0x0cf6('0x2'))(_0x0cf6('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x0cf6('0x4')]=function(_0x53e3cd,_0x5b9bec){return function(_0x5d831d){try{var _0x3f0814={'priority':_0x5b9bec[0x0]};var _0x39f2a5=gotop['validate'](_0x3f0814,{'typecast':!![]});if(_0x39f2a5[_0x0cf6('0x5')]){logger['error'](_0x0cf6('0x6'),_0x53e3cd,_[_0x0cf6('0x7')](_0x39f2a5,_0x0cf6('0x8'))[_0x0cf6('0x9')](',\x20'));_0x5d831d['stop']();}else{logger[_0x0cf6('0xa')](_0x0cf6('0xb'),_0x53e3cd,_0x3f0814['priority']);if(_0x3f0814[_0x0cf6('0xc')]){var _0x1c1411=_['findIndex'](_0x5d831d[_0x0cf6('0xd')](),{'p':_0x3f0814[_0x0cf6('0xc')]});if(_0x1c1411>=0x0){logger[_0x0cf6('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x53e3cd,_0x3f0814[_0x0cf6('0xc')]||_0x0cf6('0xe'),_0x1c1411);_0x5d831d[_0x0cf6('0xe')](_0x1c1411);}else{logger[_0x0cf6('0xa')](_0x0cf6('0xf'),_0x53e3cd,_0x3f0814['priority']||_0x0cf6('0xe'));_0x5d831d[_0x0cf6('0x10')]();}}else{_0x5d831d[_0x0cf6('0xe')]();}}}catch(_0x3b469a){logger[_0x0cf6('0x11')](_0x0cf6('0x6'),_0x53e3cd,JSON['stringify'](_0x3b469a));_0x5d831d['stop']();}};}; \ No newline at end of file +var _0xff7f=['error','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','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x5a3b97,_0x5354bc){var _0x218b38=function(_0x4c5d0e){while(--_0x4c5d0e){_0x5a3b97['push'](_0x5a3b97['shift']());}};_0x218b38(++_0x5354bc);}(_0xff7f,0x95));var _0xfff7=function(_0x3bc64f,_0x4a9f76){_0x3bc64f=_0x3bc64f-0x0;var _0x3cffde=_0xff7f[_0x3bc64f];return _0x3cffde;};'use strict';var schema=require(_0xfff7('0x0'));var _=require(_0xfff7('0x1'));var logger=require(_0xfff7('0x2'))(_0xfff7('0x3'));var gotop=schema({'priority':{'type':_0xfff7('0x4'),'required':!![],'message':_0xfff7('0x5')}});exports['consequence']=function(_0xf90f6,_0x26f0e0){return function(_0x3b8604){try{var _0x27cc26={'priority':_0x26f0e0[0x0]};var _0x1e7142=gotop['validate'](_0x27cc26,{'typecast':!![]});if(_0x1e7142[_0xfff7('0x6')]){logger['error'](_0xfff7('0x7'),_0xf90f6,_[_0xfff7('0x8')](_0x1e7142,_0xfff7('0x9'))[_0xfff7('0xa')](',\x20'));_0x3b8604[_0xfff7('0xb')]();}else{logger[_0xfff7('0xc')](_0xfff7('0xd'),_0xf90f6,_0x27cc26[_0xfff7('0xe')]);if(_0x27cc26[_0xfff7('0xe')]){var _0x5a23e4=_[_0xfff7('0xf')](_0x3b8604['rules'](),{'p':_0x27cc26[_0xfff7('0xe')]});if(_0x5a23e4>=0x0){logger['info'](_0xfff7('0x10'),_0xf90f6,_0x27cc26['priority']||_0xfff7('0x11'),_0x5a23e4);_0x3b8604[_0xfff7('0x11')](_0x5a23e4);}else{logger[_0xfff7('0xc')](_0xfff7('0x12'),_0xf90f6,_0x27cc26[_0xfff7('0xe')]||_0xfff7('0x11'));_0x3b8604[_0xfff7('0xb')]();}}else{_0x3b8604[_0xfff7('0x11')]();}}}catch(_0x45dc24){logger[_0xfff7('0x13')]('[%s][GOTOP]\x20%s',_0xf90f6,JSON[_0xfff7('0x14')](_0x45dc24));_0x3b8604[_0xfff7('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 c6ce283..9c2e41f 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 _0x98d8=['../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','contact','chat','ChatWebsiteId','account','upperFirst','channel','AccountId','InteractionId','interaction','Message','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stop','stringify','lodash','./utils'];(function(_0x14ab6e,_0x567125){var _0x67bd15=function(_0x2e1128){while(--_0x2e1128){_0x14ab6e['push'](_0x14ab6e['shift']());}};_0x67bd15(++_0x567125);}(_0x98d8,0xce));var _0x898d=function(_0x37cb61,_0xa49d0){_0x37cb61=_0x37cb61-0x0;var _0x4ca1c7=_0x98d8[_0x37cb61];return _0x4ca1c7;};'use strict';var _=require(_0x898d('0x0'));var utils=require(_0x898d('0x1'));var logger=require(_0x898d('0x2'))(_0x898d('0x3'));var rpc={'chatMessage':require(_0x898d('0x4')),'openchannelMessage':require(_0x898d('0x5')),'mailMessage':require(_0x898d('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x898d('0x7'))};exports['consequence']=function(_0x4a1bc3,_0x4047bd){return function(_0x5215bf){try{var _0x16b99a={'body':utils['getMustacheRender'](_0x4047bd[0x0],this),'ContactId':this[_0x898d('0x8')]['id']};if(this['channel']===_0x898d('0x9')){_0x16b99a[_0x898d('0xa')]=this[_0x898d('0xb')]['id'];}else{_0x16b99a[_[_0x898d('0xc')](this[_0x898d('0xd')])+_0x898d('0xe')]=this[_0x898d('0xb')]['id'];}_0x16b99a[_[_0x898d('0xc')](this[_0x898d('0xd')])+_0x898d('0xf')]=this[_0x898d('0x10')]['id'];if(rpc[this[_0x898d('0xd')]+_0x898d('0x11')]){return rpc[this[_0x898d('0xd')]+_0x898d('0x11')]['create'](_0x16b99a)[_0x898d('0x12')](function(_0x2f0844){logger['info'](_0x898d('0x13'),_0x4a1bc3,_0x16b99a[_0x898d('0x14')]);_0x5215bf[_0x898d('0x15')]();})[_0x898d('0x16')](function(_0x8acf64){logger[_0x898d('0x17')](_0x898d('0x13'),_0x4a1bc3,JSON['stringify'](_0x8acf64));_0x5215bf[_0x898d('0x18')]();});}}catch(_0xccd1a9){logger['error']('[%s][MESSAGE]\x20%s',_0x4a1bc3,JSON[_0x898d('0x19')](_0xccd1a9));_0x5215bf[_0x898d('0x18')]();}};}; \ No newline at end of file +var _0xbac2=['stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','create','then','info','body','catch','error','[%s][MESSAGE]\x20%s'];(function(_0xb83baa,_0x3d2d64){var _0x20808e=function(_0x3e963f){while(--_0x3e963f){_0xb83baa['push'](_0xb83baa['shift']());}};_0x20808e(++_0x3d2d64);}(_0xbac2,0xc6));var _0x2bac=function(_0x3eb4a9,_0x359d73){_0x3eb4a9=_0x3eb4a9-0x0;var _0x48dbad=_0xbac2[_0x3eb4a9];return _0x48dbad;};'use strict';var _=require(_0x2bac('0x0'));var utils=require(_0x2bac('0x1'));var logger=require(_0x2bac('0x2'))(_0x2bac('0x3'));var rpc={'chatMessage':require(_0x2bac('0x4')),'openchannelMessage':require(_0x2bac('0x5')),'mailMessage':require(_0x2bac('0x6')),'smsMessage':require(_0x2bac('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x2bac('0x8'))};exports[_0x2bac('0x9')]=function(_0x5bd890,_0x943fc9){return function(_0x40c167){try{var _0x41b237={'body':utils[_0x2bac('0xa')](_0x943fc9[0x0],this),'ContactId':this[_0x2bac('0xb')]['id']};if(this[_0x2bac('0xc')]===_0x2bac('0xd')){_0x41b237[_0x2bac('0xe')]=this[_0x2bac('0xf')]['id'];}else{_0x41b237[_[_0x2bac('0x10')](this[_0x2bac('0xc')])+_0x2bac('0x11')]=this[_0x2bac('0xf')]['id'];}_0x41b237[_['upperFirst'](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this['channel']+_0x2bac('0x12')]){return rpc[this[_0x2bac('0xc')]+_0x2bac('0x12')][_0x2bac('0x13')](_0x41b237)[_0x2bac('0x14')](function(_0x124a93){logger[_0x2bac('0x15')]('[%s][MESSAGE]\x20%s',_0x5bd890,_0x41b237[_0x2bac('0x16')]);_0x40c167['next']();})[_0x2bac('0x17')](function(_0x1ab2a0){logger[_0x2bac('0x18')](_0x2bac('0x19'),_0x5bd890,JSON[_0x2bac('0x1a')](_0x1ab2a0));_0x40c167[_0x2bac('0x1b')]();});}}catch(_0x4f2637){logger['error'](_0x2bac('0x19'),_0x5bd890,JSON[_0x2bac('0x1a')](_0x4f2637));_0x40c167[_0x2bac('0x1b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 3ffecfc..d27c350 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 _0x3e89=['error','stringify','stop','./utils','routing','consequence','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x3e89,0xcb));var _0x93e8=function(_0x5bdb80,_0xa950a8){_0x5bdb80=_0x5bdb80-0x0;var _0x117a92=_0x3e89[_0x5bdb80];return _0x117a92;};'use strict';var utils=require(_0x93e8('0x0'));var logger=require('../../../../config/logger')(_0x93e8('0x1'));exports[_0x93e8('0x2')]=function(_0x5e3c47,_0x34bad0){return function(_0x1a593f){try{logger['info'](_0x93e8('0x3'),_0x5e3c47,utils[_0x93e8('0x4')](_0x34bad0[0x0],this));_0x1a593f['next']();}catch(_0x5f0933){logger[_0x93e8('0x5')](_0x93e8('0x3'),_0x5e3c47,JSON[_0x93e8('0x6')](_0x5f0933));_0x1a593f[_0x93e8('0x7')]();}};}; \ No newline at end of file +var _0x15a4=['stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x5678f8,_0x58f1bf){var _0x16ca87=function(_0x448b77){while(--_0x448b77){_0x5678f8['push'](_0x5678f8['shift']());}};_0x16ca87(++_0x58f1bf);}(_0x15a4,0x178));var _0x415a=function(_0x2340f6,_0x27c0d0){_0x2340f6=_0x2340f6-0x0;var _0x4339ee=_0x15a4[_0x2340f6];return _0x4339ee;};'use strict';var utils=require(_0x415a('0x0'));var logger=require(_0x415a('0x1'))(_0x415a('0x2'));exports[_0x415a('0x3')]=function(_0x237062,_0x4a187f){return function(_0x2db30f){try{logger[_0x415a('0x4')](_0x415a('0x5'),_0x237062,utils[_0x415a('0x6')](_0x4a187f[0x0],this));_0x2db30f[_0x415a('0x7')]();}catch(_0x466c1e){logger[_0x415a('0x8')](_0x415a('0x5'),_0x237062,JSON[_0x415a('0x9')](_0x466c1e));_0x2db30f[_0x415a('0xa')]();}};}; \ 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 cba30a0..4e2425f 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 _0xd574=['validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','queue_id','account','queue','joinAt','emit','clone','%sQueuesWaitingInteractions','pick','format','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','timeout\x20is\x20a\x20number','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','join','stop','find','Queues','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack'];(function(_0x2d36bf,_0x4f5a29){var _0x379df6=function(_0x1b02f6){while(--_0x1b02f6){_0x2d36bf['push'](_0x2d36bf['shift']());}};_0x379df6(++_0x4f5a29);}(_0xd574,0x18b));var _0x4d57=function(_0x26a104,_0x4cbfcf){_0x26a104=_0x26a104-0x0;var _0x2c9475=_0xd574[_0x26a104];return _0x2c9475;};'use strict';var schema=require(_0x4d57('0x0'));var _=require(_0x4d57('0x1'));var util=require(_0x4d57('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x4d57('0x3'));var Redis=require(_0x4d57('0x4'));var config=require(_0x4d57('0x5'));var logger=require(_0x4d57('0x6'))(_0x4d57('0x7'));var strategy=require(_0x4d57('0x8'));config[_0x4d57('0x9')]=_[_0x4d57('0xa')](config[_0x4d57('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x4d57('0xb'))(new Redis(config[_0x4d57('0x9')]));var attributes=['id',_0x4d57('0xc'),_0x4d57('0xd'),_0x4d57('0xe'),'from',_0x4d57('0xf')];function emit(_0x586bda,_0x1cb51f,_0x45504a){io['to'](_0x586bda)[_0x4d57('0x10')](_0x1cb51f,_0x45504a);}function emitChannelQueueInteraction(_0x4de289,_0x3f92f5,_0x4c2b57,_0x3241c8,_0x12e0ad,_0x4ab907,_0x18b349,_0x328c72){var _0x33840d=_[_0x4d57('0x11')](_0x4c2b57);_0x33840d[_0x4d57('0xc')]=_0x328c72;_0x33840d[_0x4d57('0xe')]=_0x3f92f5;_0x33840d[_0x4d57('0xd')]=_0x3241c8;_0x33840d['id']=_0x12e0ad;if(_0x4ab907){_0x18b349[util['format'](_0x4d57('0x12'),_0x4de289)][_0x12e0ad]=_[_0x4d57('0x13')](_0x33840d,attributes);}else{delete _0x18b349[util[_0x4d57('0x14')]('%sQueuesWaitingInteractions',_0x4de289)][_0x12e0ad];}emit(util['format']('%s:queue:%s',_0x4de289,_0x3f92f5),util[_0x4d57('0x14')](_0x4d57('0x15'),_0x4de289,_0x4ab907?_0x4d57('0x16'):_0x4d57('0x17')),_['pick'](_0x33840d,attributes));}var rpc={'openchannelQueueReport':require(_0x4d57('0x18')),'mailQueueReport':require(_0x4d57('0x19')),'chatQueueReport':require(_0x4d57('0x1a')),'smsQueueReport':require(_0x4d57('0x1b')),'faxQueueReport':require(_0x4d57('0x1c')),'whatsappQueueReport':require(_0x4d57('0x1d'))};var queue=schema({'name':{'type':_0x4d57('0x1e'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x4d57('0x1f')}});function startRouting(_0x446005,_0x253774,_0x160bcb,_0x42659){if(_0x446005&&_0x253774&&_0x160bcb){_0x253774['waiting']+=0x1;var _0x200ad9={'uniqueid':_0x446005,'from':_0x160bcb[_0x4d57('0x20')]?_0x160bcb[_0x4d57('0x20')][_0x4d57('0x21')]:'','joinAt':moment()[_0x4d57('0x14')](_0x4d57('0x22')),'ContactId':_0x160bcb[_0x4d57('0x23')]?_0x160bcb[_0x4d57('0x23')]['id']:null,'ListId':_0x160bcb[_0x4d57('0x24')]?_0x160bcb[_0x4d57('0x24')]['id']:null};_0x200ad9[_[_0x4d57('0x25')](_0x160bcb[_0x4d57('0x26')])+_0x4d57('0x27')]=_0x253774['id']||null;_0x200ad9[_[_0x4d57('0x25')](_0x160bcb['channel'])+_0x4d57('0x28')]=_0x160bcb[_0x4d57('0x29')]?_0x160bcb[_0x4d57('0x29')]['id']:null;_0x200ad9[_[_0x4d57('0x25')](_0x160bcb[_0x4d57('0x26')])+_0x4d57('0x2a')]=_0x160bcb[_0x4d57('0x2b')]?_0x160bcb[_0x4d57('0x2b')]['id']:null;_0x200ad9[_['upperFirst'](_0x160bcb[_0x4d57('0x26')])+(_0x160bcb['channel']!=='chat'?_0x4d57('0x2c'):_0x4d57('0x2d'))]=_0x160bcb[_0x4d57('0xd')]?_0x160bcb[_0x4d57('0xd')]['id']:null;logger[_0x4d57('0x2e')](util['format'](_0x4d57('0x2f'),_0x446005,_0x253774[_0x4d57('0x30')]));emitChannelQueueInteraction(_0x160bcb[_0x4d57('0x26')],_0x253774[_0x4d57('0x30')],_0x200ad9,_0x160bcb['account'][_0x4d57('0x30')],_0x160bcb[_0x4d57('0x2b')]['id'],!![],_0x42659,_0x253774['id']);if(rpc[_0x160bcb[_0x4d57('0x26')]+_0x4d57('0x31')]){return rpc[_0x160bcb[_0x4d57('0x26')]+_0x4d57('0x31')][_0x4d57('0x32')](_0x200ad9)[_0x4d57('0x33')](function(_0x3a17c6){logger[_0x4d57('0x34')](_0x4d57('0x35'));});}}}function stopRouting(_0x10b364,_0x442249,_0x3496fb,_0x3bc980){if(_0x10b364&&_0x442249){_0x442249[_0x4d57('0x36')]-=0x1;var _0xd06e5f={'leaveAt':moment()[_0x4d57('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x4d57('0x14')](_0x4d57('0x22')),'reason':'accepted'};logger['info'](util[_0x4d57('0x14')](_0x4d57('0x37'),_0x10b364,_0x442249[_0x4d57('0x30')]));emitChannelQueueInteraction(_0x3496fb[_0x4d57('0x26')],_0x442249['name'],_0x3496fb[_0x4d57('0x20')],_0x3496fb['account'][_0x4d57('0x30')],_0x3496fb[_0x4d57('0x2b')]['id'],![],_0x3bc980,_0x442249['id']);if(rpc[_0x3496fb[_0x4d57('0x26')]+_0x4d57('0x31')]){return rpc[_0x3496fb['channel']+'QueueReport'][_0x4d57('0x38')](_0x10b364,_0xd06e5f)['catch'](function(_0x3e93ee){logger['error'](_0x4d57('0x39'));});}}}function endRouting(_0x2cd774,_0x51eef5,_0x3ebba3,_0x119699){if(_0x2cd774&&_0x51eef5){_0x51eef5[_0x4d57('0x36')]-=0x1;var _0x3ca990={'leaveAt':moment()[_0x4d57('0x14')](_0x4d57('0x22')),'exitAt':moment()[_0x4d57('0x14')](_0x4d57('0x22')),'reason':_0x4d57('0x3a')};logger[_0x4d57('0x2e')](util[_0x4d57('0x14')](_0x4d57('0x3b'),_0x2cd774,_0x51eef5[_0x4d57('0x30')]));emitChannelQueueInteraction(_0x3ebba3[_0x4d57('0x26')],_0x51eef5[_0x4d57('0x30')],_0x3ebba3[_0x4d57('0x20')],_0x3ebba3[_0x4d57('0xd')][_0x4d57('0x30')],_0x3ebba3[_0x4d57('0x2b')]['id'],![],_0x119699);if(rpc[_0x3ebba3[_0x4d57('0x26')]+'QueueReport']){return rpc[_0x3ebba3['channel']+_0x4d57('0x31')][_0x4d57('0x38')](_0x2cd774,_0x3ca990)['catch'](function(_0x50d55b){logger[_0x4d57('0x34')](_0x4d57('0x39'));});}}}function handleFindQueue(_0x3bdc34){return function(_0x20df6d){return _0x20df6d['name']['toLowerCase']()===_0x3bdc34[_0x4d57('0x3c')]();};}exports['consequence']=function(_0x72a11,_0x284e6f,_0x1ded0f,_0x1993d0){return function(_0x41acf1){try{var _0x418ad0={'name':_0x284e6f[0x0],'timeout':_0x284e6f[0x1]};var _0x36d113=queue[_0x4d57('0x0')](_0x418ad0,{'typecast':!![]});if(_0x36d113['length']){logger['error']('[%s][QUEUE]\x20%s',_0x72a11,_['map'](_0x36d113,_0x4d57('0x2b'))[_0x4d57('0x3d')](',\x20'));_0x41acf1[_0x4d57('0x3e')]();}else{var _0x589149=_[_0x4d57('0x3f')](_0x1ded0f[_0x1993d0[_0x4d57('0x26')]+_0x4d57('0x40')],handleFindQueue(_0x418ad0['name']));if(_0x589149){startRouting(_0x72a11,_0x589149,_0x1993d0,_0x1ded0f);var _0x41f67a=(_0x589149['timeout']||0xa)*0x3e8;var _0x3a96c4=(_0x418ad0[_0x4d57('0x3a')]||0x14)*0x3e8;var _0x19f52c,_0x4ad6e9;if(_0x41f67a>_0x3a96c4){_0x3a96c4=_0x41f67a;}var _0x456f04=seqqueue['createQueue'](_0x41f67a);_0x456f04['id']=_0x72a11;_0x456f04['atimeout']=_0x41f67a;_0x456f04[_0x4d57('0x41')]=_0x3a96c4;_0x456f04['channel']=_0x1993d0[_0x4d57('0x26')];_0x1ded0f[_0x4d57('0x42')][_0x72a11]['on'](_0x4d57('0x43'),function(){logger[_0x4d57('0x2e')](_0x4d57('0x44'),_0x72a11);stopRouting(_0x72a11,_0x589149,_0x1993d0,_0x1ded0f);clearTimeout(_0x19f52c);_0x19f52c=undefined;_0x456f04[_0x4d57('0x45')](!![]);if(_0x1ded0f[_0x4d57('0x42')][_0x72a11]){delete _0x1ded0f[_0x4d57('0x42')][_0x72a11];}_0x41acf1[_0x4d57('0x3e')]();});_0x1ded0f[_0x4d57('0x42')][_0x72a11]['on']('complete',function(){if(_0x1ded0f[_0x4d57('0x42')][_0x72a11]){delete _0x1ded0f[_0x4d57('0x42')][_0x72a11];}});_0x19f52c=setTimeout(function(){logger[_0x4d57('0x2e')](_0x4d57('0x46'),_0x72a11);endRouting(_0x72a11,_0x589149,_0x1993d0,_0x1ded0f);clearTimeout(_0x19f52c);_0x456f04[_0x4d57('0x45')](!![]);_0x41acf1[_0x4d57('0x47')]();},_0x3a96c4);switch(_0x589149[_0x4d57('0x48')]){case _0x4d57('0x49'):strategy[_0x4d57('0x49')](_0x456f04,_0x589149,_0x1ded0f,_0x1993d0);break;default:strategy[_0x4d57('0x4a')](_0x456f04,_0x589149,_0x1ded0f,_0x1993d0);}}else{logger[_0x4d57('0x34')](_0x4d57('0x4b'),_0x72a11,_0x418ad0['name']);_0x41acf1['stop']();}}}catch(_0x38e2fe){console[_0x4d57('0x4c')](_0x38e2fe);logger[_0x4d57('0x34')](_0x4d57('0x4d'),_0x72a11,_0x38e2fe[_0x4d57('0x4e')]);_0x41acf1[_0x4d57('0x3e')]();}};}; \ No newline at end of file +var _0xe238=['error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','info','[%s][STOP:QUEUE][NAME:%s]','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','stop','atimeout','rules','end','close','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','redis','defaults','localhost','queue','joinAt','emit','clone','queue_id','account','pick','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create'];(function(_0x4dd99f,_0x225db1){var _0x124fe9=function(_0x48df05){while(--_0x48df05){_0x4dd99f['push'](_0x4dd99f['shift']());}};_0x124fe9(++_0x225db1);}(_0xe238,0x18d));var _0x8e23=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xe238[_0x46e363];return _0x3fb059;};'use strict';var schema=require(_0x8e23('0x0'));var _=require(_0x8e23('0x1'));var util=require(_0x8e23('0x2'));var seqqueue=require(_0x8e23('0x3'));var moment=require(_0x8e23('0x4'));var Redis=require(_0x8e23('0x5'));var config=require('../../../../config/environment');var logger=require(_0x8e23('0x6'))(_0x8e23('0x7'));var strategy=require('./strategy');config[_0x8e23('0x8')]=_[_0x8e23('0x9')](config[_0x8e23('0x8')],{'host':_0x8e23('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8e23('0x8')]));var attributes=['id','queue_id','account',_0x8e23('0xb'),'from',_0x8e23('0xc')];function emit(_0x43d795,_0x27fe8c,_0xb398f1){io['to'](_0x43d795)[_0x8e23('0xd')](_0x27fe8c,_0xb398f1);}function emitChannelQueueInteraction(_0x587da2,_0x3164fe,_0x37fa74,_0xa2bcad,_0x28a9ef,_0x3cd916,_0x153431,_0x595123){var _0x513b3d=_[_0x8e23('0xe')](_0x37fa74);_0x513b3d[_0x8e23('0xf')]=_0x595123;_0x513b3d['queue']=_0x3164fe;_0x513b3d[_0x8e23('0x10')]=_0xa2bcad;_0x513b3d['id']=_0x28a9ef;if(_0x3cd916){_0x153431[util['format']('%sQueuesWaitingInteractions',_0x587da2)][_0x28a9ef]=_[_0x8e23('0x11')](_0x513b3d,attributes);}else{delete _0x153431[util[_0x8e23('0x12')](_0x8e23('0x13'),_0x587da2)][_0x28a9ef];}emit(util[_0x8e23('0x12')](_0x8e23('0x14'),_0x587da2,_0x3164fe),util['format'](_0x8e23('0x15'),_0x587da2,_0x3cd916?_0x8e23('0x16'):'remove'),_[_0x8e23('0x11')](_0x513b3d,attributes));}var rpc={'openchannelQueueReport':require(_0x8e23('0x17')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x8e23('0x18')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x8e23('0x19')),'whatsappQueueReport':require(_0x8e23('0x1a'))};var queue=schema({'name':{'type':_0x8e23('0x1b'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x8e23('0x1c'),'message':_0x8e23('0x1d')}});function startRouting(_0x4e93ab,_0x56f1e4,_0x38e831,_0xdcb70){if(_0x4e93ab&&_0x56f1e4&&_0x38e831){_0x56f1e4[_0x8e23('0x1e')]+=0x1;var _0x2402f7={'uniqueid':_0x4e93ab,'from':_0x38e831[_0x8e23('0x1f')]?_0x38e831[_0x8e23('0x1f')]['from']:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38e831[_0x8e23('0x20')]?_0x38e831['contact']['id']:null,'ListId':_0x38e831[_0x8e23('0x21')]?_0x38e831[_0x8e23('0x21')]['id']:null};_0x2402f7[_[_0x8e23('0x22')](_0x38e831[_0x8e23('0x23')])+_0x8e23('0x24')]=_0x56f1e4['id']||null;_0x2402f7[_['upperFirst'](_0x38e831[_0x8e23('0x23')])+_0x8e23('0x25')]=_0x38e831['interaction']?_0x38e831[_0x8e23('0x26')]['id']:null;_0x2402f7[_['upperFirst'](_0x38e831[_0x8e23('0x23')])+'MessageId']=_0x38e831[_0x8e23('0x27')]?_0x38e831[_0x8e23('0x27')]['id']:null;_0x2402f7[_[_0x8e23('0x22')](_0x38e831[_0x8e23('0x23')])+(_0x38e831[_0x8e23('0x23')]!==_0x8e23('0x28')?_0x8e23('0x29'):_0x8e23('0x2a'))]=_0x38e831[_0x8e23('0x10')]?_0x38e831[_0x8e23('0x10')]['id']:null;logger['info'](util['format'](_0x8e23('0x2b'),_0x4e93ab,_0x56f1e4[_0x8e23('0x2c')]));emitChannelQueueInteraction(_0x38e831[_0x8e23('0x23')],_0x56f1e4[_0x8e23('0x2c')],_0x2402f7,_0x38e831[_0x8e23('0x10')][_0x8e23('0x2c')],_0x38e831[_0x8e23('0x27')]['id'],!![],_0xdcb70,_0x56f1e4['id']);if(rpc[_0x38e831[_0x8e23('0x23')]+'QueueReport']){return rpc[_0x38e831['channel']+_0x8e23('0x2d')][_0x8e23('0x2e')](_0x2402f7)['catch'](function(_0x47c23b){logger[_0x8e23('0x2f')](_0x8e23('0x30'));});}}}function stopRouting(_0x17a601,_0x2a67a6,_0x3c1c51,_0x5cc357){if(_0x17a601&&_0x2a67a6){_0x2a67a6[_0x8e23('0x1e')]-=0x1;var _0xc1b9d1={'leaveAt':moment()[_0x8e23('0x12')](_0x8e23('0x31')),'acceptAt':moment()['format'](_0x8e23('0x31')),'reason':'accepted'};logger[_0x8e23('0x32')](util[_0x8e23('0x12')](_0x8e23('0x33'),_0x17a601,_0x2a67a6['name']));emitChannelQueueInteraction(_0x3c1c51[_0x8e23('0x23')],_0x2a67a6[_0x8e23('0x2c')],_0x3c1c51[_0x8e23('0x1f')],_0x3c1c51[_0x8e23('0x10')][_0x8e23('0x2c')],_0x3c1c51['message']['id'],![],_0x5cc357,_0x2a67a6['id']);if(rpc[_0x3c1c51[_0x8e23('0x23')]+_0x8e23('0x2d')]){return rpc[_0x3c1c51['channel']+_0x8e23('0x2d')]['update'](_0x17a601,_0xc1b9d1)[_0x8e23('0x34')](function(_0x17338b){logger[_0x8e23('0x2f')](_0x8e23('0x35'));});}}}function endRouting(_0x5c450d,_0x38f148,_0x3f2a1d,_0x2ab70f){if(_0x5c450d&&_0x38f148){_0x38f148[_0x8e23('0x1e')]-=0x1;var _0x12c31f={'leaveAt':moment()[_0x8e23('0x12')](_0x8e23('0x31')),'exitAt':moment()[_0x8e23('0x12')](_0x8e23('0x31')),'reason':_0x8e23('0x36')};logger[_0x8e23('0x32')](util[_0x8e23('0x12')](_0x8e23('0x37'),_0x5c450d,_0x38f148[_0x8e23('0x2c')]));emitChannelQueueInteraction(_0x3f2a1d['channel'],_0x38f148[_0x8e23('0x2c')],_0x3f2a1d[_0x8e23('0x1f')],_0x3f2a1d[_0x8e23('0x10')][_0x8e23('0x2c')],_0x3f2a1d[_0x8e23('0x27')]['id'],![],_0x2ab70f);if(rpc[_0x3f2a1d['channel']+_0x8e23('0x2d')]){return rpc[_0x3f2a1d['channel']+_0x8e23('0x2d')][_0x8e23('0x38')](_0x5c450d,_0x12c31f)[_0x8e23('0x34')](function(_0x2d69ff){logger[_0x8e23('0x2f')](_0x8e23('0x35'));});}}}function handleFindQueue(_0x142411){return function(_0x2ba2f4){return _0x2ba2f4[_0x8e23('0x2c')][_0x8e23('0x39')]()===_0x142411[_0x8e23('0x39')]();};}exports['consequence']=function(_0x1b05b3,_0x346b24,_0x41248c,_0x55590f){return function(_0x5dc606){try{var _0x4d7369={'name':_0x346b24[0x0],'timeout':_0x346b24[0x1]};var _0x5b93b0=queue[_0x8e23('0x0')](_0x4d7369,{'typecast':!![]});if(_0x5b93b0[_0x8e23('0x3a')]){logger[_0x8e23('0x2f')](_0x8e23('0x3b'),_0x1b05b3,_[_0x8e23('0x3c')](_0x5b93b0,'message')[_0x8e23('0x3d')](',\x20'));_0x5dc606[_0x8e23('0x3e')]();}else{var _0x1abbda=_['find'](_0x41248c[_0x55590f['channel']+'Queues'],handleFindQueue(_0x4d7369[_0x8e23('0x2c')]));if(_0x1abbda){startRouting(_0x1b05b3,_0x1abbda,_0x55590f,_0x41248c);var _0x32ff43=(_0x1abbda['timeout']||0xa)*0x3e8;var _0x5d0d97=(_0x4d7369[_0x8e23('0x36')]||0x14)*0x3e8;var _0x5a32bc,_0x862540;if(_0x32ff43>_0x5d0d97){_0x5d0d97=_0x32ff43;}var _0x2c3ad8=seqqueue['createQueue'](_0x32ff43);_0x2c3ad8['id']=_0x1b05b3;_0x2c3ad8[_0x8e23('0x3f')]=_0x32ff43;_0x2c3ad8['qtimeout']=_0x5d0d97;_0x2c3ad8[_0x8e23('0x23')]=_0x55590f[_0x8e23('0x23')];_0x41248c[_0x8e23('0x40')][_0x1b05b3]['on'](_0x8e23('0x41'),function(){logger[_0x8e23('0x32')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x1b05b3);stopRouting(_0x1b05b3,_0x1abbda,_0x55590f,_0x41248c);clearTimeout(_0x5a32bc);_0x5a32bc=undefined;_0x2c3ad8[_0x8e23('0x42')](!![]);if(_0x41248c[_0x8e23('0x40')][_0x1b05b3]){delete _0x41248c[_0x8e23('0x40')][_0x1b05b3];}_0x5dc606[_0x8e23('0x3e')]();});_0x41248c['rules'][_0x1b05b3]['on']('complete',function(){if(_0x41248c[_0x8e23('0x40')][_0x1b05b3]){delete _0x41248c[_0x8e23('0x40')][_0x1b05b3];}});_0x5a32bc=setTimeout(function(){logger[_0x8e23('0x32')](_0x8e23('0x43'),_0x1b05b3);endRouting(_0x1b05b3,_0x1abbda,_0x55590f,_0x41248c);clearTimeout(_0x5a32bc);_0x2c3ad8[_0x8e23('0x42')](!![]);_0x5dc606['next']();},_0x5d0d97);switch(_0x1abbda[_0x8e23('0x44')]){case _0x8e23('0x45'):strategy[_0x8e23('0x45')](_0x2c3ad8,_0x1abbda,_0x41248c,_0x55590f);break;default:strategy[_0x8e23('0x46')](_0x2c3ad8,_0x1abbda,_0x41248c,_0x55590f);}}else{logger[_0x8e23('0x2f')](_0x8e23('0x47'),_0x1b05b3,_0x4d7369[_0x8e23('0x2c')]);_0x5dc606[_0x8e23('0x3e')]();}}}catch(_0x40746e){console[_0x8e23('0x48')](_0x40746e);logger['error']('[%s][QUEUE]\x20%s',_0x1b05b3,_0x40746e[_0x8e23('0x49')]);_0x5dc606['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 403ea8c..c3b2fe5 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 _0x08aa=['handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','busy','busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push'];(function(_0xdcbd4c,_0x2c7146){var _0x1b1fe0=function(_0x407fd9){while(--_0x407fd9){_0xdcbd4c['push'](_0xdcbd4c['shift']());}};_0x1b1fe0(++_0x2c7146);}(_0x08aa,0x129));var _0xa08a=function(_0x93e365,_0x34b29d){_0x93e365=_0x93e365-0x0;var _0x354b3f=_0x08aa[_0x93e365];return _0x354b3f;};'use strict';var _=require(_0xa08a('0x0'));var uuid=require(_0xa08a('0x1'));var util=require('./util');var logger=require(_0xa08a('0x2'))(_0xa08a('0x3'));var Agent=function(_0x19027c,_0x2b1601,_0x240b85,_0x1e6396){this[_0xa08a('0x4')]=uuid['v4']();this[_0xa08a('0x5')]=_0x19027c;this[_0xa08a('0x6')]=_0x2b1601;this[_0xa08a('0x7')]=_0x240b85;this[_0xa08a('0x3')]=_0x1e6396;this[_0xa08a('0x5')][_0xa08a('0x8')](this[_0xa08a('0x9')][_0xa08a('0xa')](this),this[_0xa08a('0xb')][_0xa08a('0xa')](this));this[_0xa08a('0x5')]['on'](_0xa08a('0xc'),this[_0xa08a('0xb')][_0xa08a('0xa')](this));this[_0xa08a('0x5')]['on'](_0xa08a('0xd'),this[_0xa08a('0xe')][_0xa08a('0xa')](this));};Agent[_0xa08a('0xf')][_0xa08a('0x8')]=function(){this['squeue'][_0xa08a('0x8')](this[_0xa08a('0x9')][_0xa08a('0xa')](this),this[_0xa08a('0xb')][_0xa08a('0xa')](this));};Agent['prototype'][_0xa08a('0xe')]=function(){this[_0xa08a('0xb')](!![]);};Agent[_0xa08a('0xf')][_0xa08a('0x9')]=function(_0x1b0be){logger['info'](_0xa08a('0x10'),this[_0xa08a('0x5')]['id'],this[_0xa08a('0x6')]['id']);if(_[_0xa08a('0x11')](this['realtime']['agents'][this['agent']['id']])){logger[_0xa08a('0x12')](_0xa08a('0x13'),this['squeue']['id'],this[_0xa08a('0x6')]['id']);setTimeout(this[_0xa08a('0x8')][_0xa08a('0xa')](this),0x3e8);}else{if(this['routing'][_0xa08a('0x14')]||util[_0xa08a('0x15')](this[_0xa08a('0x5')]['id'],this[_0xa08a('0x7')][_0xa08a('0x16')][this[_0xa08a('0x6')]['id']],this[_0xa08a('0x5')]['channel'],![])){this[_0xa08a('0x7')][_0xa08a('0x16')][this[_0xa08a('0x6')]['id']][_0xa08a('0x17')]=!![];this[_0xa08a('0x7')][_0xa08a('0x16')][this[_0xa08a('0x6')]['id']][_0xa08a('0x18')]=undefined;util[_0xa08a('0x19')](this[_0xa08a('0x4')],this[_0xa08a('0x5')]['id'],this[_0xa08a('0x7')]['agents'][this[_0xa08a('0x6')]['id']],null,this['routing']);util[_0xa08a('0x1a')](this[_0xa08a('0x5')]['id'],this[_0xa08a('0x7')][_0xa08a('0x16')][this[_0xa08a('0x6')]['id']],_0xa08a('0x1b')+(this[_0xa08a('0x3')][_0xa08a('0x14')]?':FORCED':''));}else{logger[_0xa08a('0x12')](_0xa08a('0x1c'),this[_0xa08a('0x5')]['id'],this[_0xa08a('0x6')]['id']);setTimeout(this[_0xa08a('0x8')][_0xa08a('0xa')](this),0x3e8);}}};Agent[_0xa08a('0xf')]['handleTimeout']=function(_0x150776){if(_[_0xa08a('0x11')](this[_0xa08a('0x7')][_0xa08a('0x16')][this['agent']['id']])){return logger[_0xa08a('0x12')](_0xa08a('0x13'),this[_0xa08a('0x5')]['id'],this[_0xa08a('0x6')]['id']);}else{logger['info'](_0xa08a('0x1d'),this[_0xa08a('0x5')]['id'],this[_0xa08a('0x6')]['id']);util[_0xa08a('0x1e')](this['notificationId'],this[_0xa08a('0x5')]['id'],this[_0xa08a('0x7')]['agents'][this[_0xa08a('0x6')]['id']],null,this[_0xa08a('0x3')]);this[_0xa08a('0x7')]['agents'][this[_0xa08a('0x6')]['id']][_0xa08a('0x17')]=![];this['realtime']['agents'][this[_0xa08a('0x6')]['id']][_0xa08a('0x18')]=undefined;util[_0xa08a('0x1a')](this[_0xa08a('0x5')]['id'],this['realtime']['agents'][this[_0xa08a('0x6')]['id']],_0x150776?_0xa08a('0x1f'):_0xa08a('0x20'));}if(!_0x150776){setTimeout(this[_0xa08a('0x8')]['bind'](this),0x3e8);}};function agent(_0x2feb60,_0x40c4b8,_0x1f6bf7,_0xa90969){return new Agent(_0x2feb60,_0x40c4b8,_0x1f6bf7,_0xa90969);}module[_0xa08a('0x21')]=agent; \ No newline at end of file +var _0x5e1b=['bind','timeout','handleTimeout','drained','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun'];(function(_0x25ed9e,_0x50714c){var _0x3e15c1=function(_0x26d473){while(--_0x26d473){_0x25ed9e['push'](_0x25ed9e['shift']());}};_0x3e15c1(++_0x50714c);}(_0x5e1b,0x1af));var _0xb5e1=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x5e1b[_0x7d62cb];return _0x3a6266;};'use strict';var _=require(_0xb5e1('0x0'));var uuid=require(_0xb5e1('0x1'));var util=require(_0xb5e1('0x2'));var logger=require(_0xb5e1('0x3'))(_0xb5e1('0x4'));var Agent=function(_0x3a1574,_0x1640ba,_0x273f36,_0x12a6f2){this[_0xb5e1('0x5')]=uuid['v4']();this[_0xb5e1('0x6')]=_0x3a1574;this[_0xb5e1('0x7')]=_0x1640ba;this[_0xb5e1('0x8')]=_0x273f36;this[_0xb5e1('0x4')]=_0x12a6f2;this[_0xb5e1('0x6')][_0xb5e1('0x9')](this[_0xb5e1('0xa')]['bind'](this),this['handleTimeout'][_0xb5e1('0xb')](this));this[_0xb5e1('0x6')]['on'](_0xb5e1('0xc'),this[_0xb5e1('0xd')][_0xb5e1('0xb')](this));this[_0xb5e1('0x6')]['on'](_0xb5e1('0xe'),this['handleDrained'][_0xb5e1('0xb')](this));};Agent[_0xb5e1('0xf')][_0xb5e1('0x9')]=function(){this[_0xb5e1('0x6')][_0xb5e1('0x9')](this[_0xb5e1('0xa')][_0xb5e1('0xb')](this),this[_0xb5e1('0xd')][_0xb5e1('0xb')](this));};Agent[_0xb5e1('0xf')][_0xb5e1('0x10')]=function(){this[_0xb5e1('0xd')](!![]);};Agent[_0xb5e1('0xf')]['handleRun']=function(_0x5d185a){logger[_0xb5e1('0x11')](_0xb5e1('0x12'),this[_0xb5e1('0x6')]['id'],this['agent']['id']);if(_[_0xb5e1('0x13')](this[_0xb5e1('0x8')][_0xb5e1('0x14')][this[_0xb5e1('0x7')]['id']])){logger[_0xb5e1('0x11')](_0xb5e1('0x15'),this[_0xb5e1('0x6')]['id'],this[_0xb5e1('0x7')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this['routing'][_0xb5e1('0x16')]||util['isAgentAvailable'](this[_0xb5e1('0x6')]['id'],this[_0xb5e1('0x8')]['agents'][this[_0xb5e1('0x7')]['id']],this[_0xb5e1('0x6')][_0xb5e1('0x17')],![])){this[_0xb5e1('0x8')][_0xb5e1('0x14')][this[_0xb5e1('0x7')]['id']][_0xb5e1('0x18')]=!![];this['realtime'][_0xb5e1('0x14')][this[_0xb5e1('0x7')]['id']][_0xb5e1('0x19')]=undefined;util['showNotification'](this['notificationId'],this['squeue']['id'],this[_0xb5e1('0x8')][_0xb5e1('0x14')][this[_0xb5e1('0x7')]['id']],null,this[_0xb5e1('0x4')]);util[_0xb5e1('0x1a')](this['squeue']['id'],this[_0xb5e1('0x8')][_0xb5e1('0x14')][this[_0xb5e1('0x7')]['id']],_0xb5e1('0x1b')+(this[_0xb5e1('0x4')]['forcedOwnership']?_0xb5e1('0x1c'):''));}else{logger['info'](_0xb5e1('0x1d'),this[_0xb5e1('0x6')]['id'],this[_0xb5e1('0x7')]['id']);setTimeout(this[_0xb5e1('0x9')][_0xb5e1('0xb')](this),0x3e8);}}};Agent[_0xb5e1('0xf')]['handleTimeout']=function(_0x4afccf){if(_[_0xb5e1('0x13')](this[_0xb5e1('0x8')][_0xb5e1('0x14')][this[_0xb5e1('0x7')]['id']])){return logger['info'](_0xb5e1('0x15'),this[_0xb5e1('0x6')]['id'],this[_0xb5e1('0x7')]['id']);}else{logger['info'](_0xb5e1('0x1e'),this[_0xb5e1('0x6')]['id'],this[_0xb5e1('0x7')]['id']);util[_0xb5e1('0x1f')](this[_0xb5e1('0x5')],this['squeue']['id'],this[_0xb5e1('0x8')][_0xb5e1('0x14')][this[_0xb5e1('0x7')]['id']],null,this[_0xb5e1('0x4')]);this[_0xb5e1('0x8')]['agents'][this['agent']['id']][_0xb5e1('0x18')]=![];this[_0xb5e1('0x8')][_0xb5e1('0x14')][this['agent']['id']]['busyQueue']=undefined;util[_0xb5e1('0x1a')](this[_0xb5e1('0x6')]['id'],this[_0xb5e1('0x8')][_0xb5e1('0x14')][this[_0xb5e1('0x7')]['id']],_0x4afccf?'STOP':_0xb5e1('0x20'));}if(!_0x4afccf){setTimeout(this[_0xb5e1('0x9')][_0xb5e1('0xb')](this),0x3e8);}};function agent(_0x4b6d2c,_0x1e246c,_0x49a9ef,_0x251474){return new Agent(_0x4b6d2c,_0x1e246c,_0x49a9ef,_0x251474);}module[_0xb5e1('0x21')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 8d61f2b..e74add8 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 _0x3468=['hideNotification','routing','STOP','TIMEOUT','exports','lodash','../../../../../config/logger','realtime','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','queue','Agents','length','isNil','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busy','busyQueue','name','showNotification','notificationId','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x3468,0x8d));var _0x8346=function(_0x19656f,_0x4f95f4){_0x19656f=_0x19656f-0x0;var _0x2dcbea=_0x3468[_0x19656f];return _0x2dcbea;};'use strict';var _=require(_0x8346('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x8346('0x1'))('routing');var Beepall=function(_0x47b806,_0x7207cc,_0x1a7eb9,_0x4082b5){this['notificationId']=uuid['v4']();this['squeue']=_0x47b806;this['queue']=_0x7207cc;this[_0x8346('0x2')]=_0x1a7eb9;this['routing']=_0x4082b5;this[_0x8346('0x3')][_0x8346('0x4')](this[_0x8346('0x5')][_0x8346('0x6')](this),this[_0x8346('0x7')][_0x8346('0x6')](this));this[_0x8346('0x3')]['on'](_0x8346('0x8'),this[_0x8346('0x7')][_0x8346('0x6')](this));this[_0x8346('0x3')]['on'](_0x8346('0x9'),this[_0x8346('0xa')]['bind'](this));};Beepall[_0x8346('0xb')][_0x8346('0x4')]=function(){this[_0x8346('0x3')][_0x8346('0x4')](this[_0x8346('0x5')][_0x8346('0x6')](this),this['handleTimeout'][_0x8346('0x6')](this));};Beepall[_0x8346('0xb')][_0x8346('0xa')]=function(_0x242f75){this[_0x8346('0x7')](!![]);};Beepall[_0x8346('0xb')][_0x8346('0x5')]=function(_0x59492e){var _0x1d58d7=!![];if(!_['isNil'](this[_0x8346('0xc')])&&!_['isNil'](this[_0x8346('0xc')]['Agents'])&&this[_0x8346('0xc')]['Agents']['length']>0x0){for(var _0x2909e3=0x0,_0x308f2c;_0x2909e30x0){for(var _0x39b837=0x0,_0x22d0b0;_0x39b8370x0&&_0x53848c[_0x1e5065+'CurrentCapacity']>=_0x53848c[_0x1e5065+_0x0a6b('0x24')]){writeLog(_0x122c19,_0x53848c,_0x1e5065['toUpperCase']()+_0x0a6b('0x25'));return![];}}return!![];};exports[_0x0a6b('0x26')]=function(_0x45ae97,_0x4884a1,_0x526fdc,_0xf1ed3d,_0xe01bba){return sendNotification(!![],_0x45ae97,_0x4884a1,_0x526fdc,_0xf1ed3d,_0xe01bba);};exports[_0x0a6b('0x27')]=function(_0x3d649e,_0x1935a3,_0x2bbcb1,_0x486f0d,_0xa7ab7c){return sendNotification(![],_0x3d649e,_0x1935a3,_0x2bbcb1,_0x486f0d,_0xa7ab7c);};exports[_0x0a6b('0x28')]=writeLog; \ No newline at end of file +var _0x5fab=['user:save','split','account','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','remove','info','isAgentAvailable','busy','online','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','hideNotification','writeLog','lodash','util','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','name'];(function(_0xba95bb,_0x264ebc){var _0x18c2b9=function(_0x4e5840){while(--_0x4e5840){_0xba95bb['push'](_0xba95bb['shift']());}};_0x18c2b9(++_0x264ebc);}(_0x5fab,0x177));var _0xb5fa=function(_0x3c3eb7,_0x55343d){_0x3c3eb7=_0x3c3eb7-0x0;var _0x108733=_0x5fab[_0x3c3eb7];return _0x108733;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var utils=require('../utils');var Mustache=require(_0xb5fa('0x2'));var Redis=require(_0xb5fa('0x3'));var config=require(_0xb5fa('0x4'));var logger=require(_0xb5fa('0x5'))(_0xb5fa('0x6'));config[_0xb5fa('0x7')]=_[_0xb5fa('0x8')](config[_0xb5fa('0x7')],{'host':_0xb5fa('0x9'),'port':0x18eb});var io=require(_0xb5fa('0xa'))(new Redis(config['redis']));function emit(_0x5d70f6,_0x2e3804,_0x1aec3e){io['to'](_0x5d70f6)[_0xb5fa('0xb')](_0x2e3804,_0x1aec3e);}function sendNotification(_0x56d018,_0x410eff,_0x38d9a3,_0x2cf4a5,_0x54c7eb,_0x5b5ea8){io['to'](util[_0xb5fa('0xc')](_0xb5fa('0xd'),_0x2cf4a5[_0xb5fa('0xe')]))[_0xb5fa('0xb')](_0xb5fa('0xf'),_0x2cf4a5);var _0xadef41=_0x5b5ea8||{};var _0x65c6b6=_0x38d9a3[_0xb5fa('0x10')]('.');var _0x309740={'uniqueid':_0x410eff,'channel':_0x65c6b6[0x0],'id':_0x65c6b6[0x1],'title':_0x65c6b6[0x0]+'\x20interaction','interactionId':_0x65c6b6[0x2],'queue':_0x54c7eb?_0x54c7eb[_0xb5fa('0xe')]:null,'sound':_0xadef41[_0xb5fa('0x11')]['notificationSound'],'shake':_0xadef41[_0xb5fa('0x11')]['notificationShake']};try{if(!_0xadef41[_0xb5fa('0x12')]){_0xadef41[_0xb5fa('0x12')]={};}if(_0x54c7eb){_0xadef41[_0xb5fa('0x12')][_0xb5fa('0x13')]=_0x54c7eb;}else if(_0xadef41[_0xb5fa('0x12')]['queue']){delete _0xadef41['body'][_0xb5fa('0x13')];}_0x309740[_0xb5fa('0x14')]=utils[_0xb5fa('0x15')](_0xadef41[_0xb5fa('0x11')]['notificationTemplate'],_0xadef41);}catch(_0x4fabcc){_0x309740[_0xb5fa('0x14')]=_0xb5fa('0x16');logger[_0xb5fa('0x17')](util[_0xb5fa('0xc')](_0xb5fa('0x18'),_0x410eff,_0x4fabcc[_0xb5fa('0x19')]));}io['to'](util[_0xb5fa('0xc')](_0xb5fa('0xd'),_0x2cf4a5[_0xb5fa('0xe')]))[_0xb5fa('0xb')](util[_0xb5fa('0xc')](_0xb5fa('0x1a'),_0x56d018?'save':_0xb5fa('0x1b')),_0x309740);}function writeLog(_0x519e20,_0x37ae06,_0x4a6c04){return logger[_0xb5fa('0x1c')](util[_0xb5fa('0xc')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x519e20,_0x37ae06[_0xb5fa('0xe')],_0x4a6c04));}exports[_0xb5fa('0x1d')]=function(_0x283a56,_0x47f71a,_0x32a85c,_0xec108f){if(_0x47f71a[_0xb5fa('0x1e')]){writeLog(_0x283a56,_0x47f71a,'BUSY');return![];}if(!_0x47f71a[_0xb5fa('0x1f')]){writeLog(_0x283a56,_0x47f71a,'OFFLINE');return![];}if(_0x47f71a[_0x32a85c+_0xb5fa('0x20')]){writeLog(_0x283a56,_0x47f71a,_0xb5fa('0x21'));return![];}if(_0xec108f&&_0x47f71a[_0xb5fa('0x22')](_0x32a85c+_0xb5fa('0x23'))&&_0x47f71a[_0xb5fa('0x22')](_0x32a85c+_0xb5fa('0x24'))){if(_0x47f71a[_0x32a85c+_0xb5fa('0x23')]>0x0&&_0x47f71a[_0x32a85c+_0xb5fa('0x24')]>=_0x47f71a[_0x32a85c+'Capacity']){writeLog(_0x283a56,_0x47f71a,_0x32a85c['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports['showNotification']=function(_0x28a350,_0x460b54,_0x12c0d4,_0x2bdf50,_0x534884){return sendNotification(!![],_0x28a350,_0x460b54,_0x12c0d4,_0x2bdf50,_0x534884);};exports[_0xb5fa('0x25')]=function(_0x358549,_0x353314,_0x409af9,_0x2a5690,_0x142bfa){return sendNotification(![],_0x358549,_0x353314,_0x409af9,_0x2a5690,_0x142bfa);};exports[_0xb5fa('0x26')]=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 cc72fc2..dd0a53d 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 _0x48c6=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','trim','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','./utils','../../../../config/logger','string','consequence','length','error','[%s][SYSTEM]\x20%s','message'];(function(_0x5e17f8,_0x3816ea){var _0x5cc8cf=function(_0x3ec76b){while(--_0x3ec76b){_0x5e17f8['push'](_0x5e17f8['shift']());}};_0x5cc8cf(++_0x3816ea);}(_0x48c6,0x17d));var _0x648c=function(_0x9faff7,_0x59a564){_0x9faff7=_0x9faff7-0x0;var _0x4f8043=_0x48c6[_0x9faff7];return _0x4f8043;};'use strict';var schema=require(_0x648c('0x0'));var sh=require(_0x648c('0x1'));var _=require('lodash');var utils=require(_0x648c('0x2'));var logger=require(_0x648c('0x3'))('routing');var system=schema({'command':{'type':_0x648c('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x648c('0x5')]=function(_0x2346d2,_0x284131){return function(_0x4fb487){try{var _0x5eab0d={'command':_0x284131[0x0]};var _0x5d7b66=system['validate'](_0x5eab0d,{'typecast':!![]});if(_0x5d7b66[_0x648c('0x6')]){logger[_0x648c('0x7')](_0x648c('0x8'),_0x2346d2,_['map'](_0x5d7b66,_0x648c('0x9'))['join'](',\x20'));logger['info'](_0x648c('0xa'),_0x2346d2);_0x4fb487[_0x648c('0xb')]();}else{var _0x323c3e=this;var _0x461a47=utils[_0x648c('0xc')](_0x284131[0x0],this);logger[_0x648c('0xd')](_0x648c('0xe'),_0x2346d2,_0x461a47);sh['exec'](_[_0x648c('0xf')](_0x461a47),function(_0xcb92de,_0x3d87ff){logger[_0x648c('0xd')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x2346d2,_0xcb92de);if(_0xcb92de==0x0){var _0x4d8d0e=_0x3d87ff[_0x648c('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x648c('0x11')](_0x284131[0x1])||_['isEmpty'](_0x284131[0x1])){logger[_0x648c('0xd')](_0x648c('0x12'),_0x2346d2);_0x323c3e[_0x648c('0x13')][_0x284131[0x1]]=_0x4d8d0e;}else{logger[_0x648c('0xd')](_0x648c('0x14'),_0x2346d2,_0x284131[0x1],_0x4d8d0e);_0x323c3e['body'][_0x284131[0x1]]=_0x4d8d0e;}}_0x4fb487[_0x648c('0xb')]();});}}catch(_0x273f07){logger['error'](_0x648c('0x8'),_0x2346d2,_[_0x648c('0x15')](_0x273f07)?JSON[_0x648c('0x16')](_0x273f07):_0x273f07);logger['info'](_0x648c('0xa'),_0x2346d2);_0x4fb487[_0x648c('0xb')]();}};}; \ No newline at end of file +var _0xb223=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify','shelljs','../../../../config/logger','routing','string'];(function(_0x2f60a3,_0x4e4b91){var _0x2ab592=function(_0x2715d0){while(--_0x2715d0){_0x2f60a3['push'](_0x2f60a3['shift']());}};_0x2ab592(++_0x4e4b91);}(_0xb223,0x194));var _0x3b22=function(_0x5b3afb,_0x278363){_0x5b3afb=_0x5b3afb-0x0;var _0x411c77=_0xb223[_0x5b3afb];return _0x411c77;};'use strict';var schema=require('validate');var sh=require(_0x3b22('0x0'));var _=require('lodash');var utils=require('./utils');var logger=require(_0x3b22('0x1'))(_0x3b22('0x2'));var system=schema({'command':{'type':_0x3b22('0x3'),'required':!![],'message':_0x3b22('0x4')}});exports[_0x3b22('0x5')]=function(_0x493144,_0x22f0ba){return function(_0x610298){try{var _0x4d91a8={'command':_0x22f0ba[0x0]};var _0x2d826a=system[_0x3b22('0x6')](_0x4d91a8,{'typecast':!![]});if(_0x2d826a[_0x3b22('0x7')]){logger[_0x3b22('0x8')](_0x3b22('0x9'),_0x493144,_[_0x3b22('0xa')](_0x2d826a,'message')[_0x3b22('0xb')](',\x20'));logger[_0x3b22('0xc')](_0x3b22('0xd'),_0x493144);_0x610298[_0x3b22('0xe')]();}else{var _0x358286=this;var _0x4a244d=utils['getMustacheRender'](_0x22f0ba[0x0],this);logger['info'](_0x3b22('0xf'),_0x493144,_0x4a244d);sh[_0x3b22('0x10')](_[_0x3b22('0x11')](_0x4a244d),function(_0x52f85f,_0xd8ca3){logger[_0x3b22('0xc')](_0x3b22('0x12'),_0x493144,_0x52f85f);if(_0x52f85f==0x0){var _0x1233f6=_0xd8ca3['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x22f0ba[0x1])||_[_0x3b22('0x13')](_0x22f0ba[0x1])){logger[_0x3b22('0xc')](_0x3b22('0x14'),_0x493144);_0x358286[_0x3b22('0x15')][_0x22f0ba[0x1]]=_0x1233f6;}else{logger[_0x3b22('0xc')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x493144,_0x22f0ba[0x1],_0x1233f6);_0x358286['body'][_0x22f0ba[0x1]]=_0x1233f6;}}_0x610298[_0x3b22('0xe')]();});}}catch(_0x2771e8){logger[_0x3b22('0x8')](_0x3b22('0x9'),_0x493144,_[_0x3b22('0x16')](_0x2771e8)?JSON[_0x3b22('0x17')](_0x2771e8):_0x2771e8);logger[_0x3b22('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x493144);_0x610298[_0x3b22('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index ef65833..173a232 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 _0x0906=['channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next'];(function(_0x41afa3,_0x3112d6){var _0x62b3fd=function(_0x20ef9b){while(--_0x20ef9b){_0x41afa3['push'](_0x41afa3['shift']());}};_0x62b3fd(++_0x3112d6);}(_0x0906,0x95));var _0x6090=function(_0x4a5a17,_0x183107){_0x4a5a17=_0x4a5a17-0x0;var _0x34bdd5=_0x0906[_0x4a5a17];return _0x34bdd5;};'use strict';var schema=require(_0x6090('0x0'));var _=require(_0x6090('0x1'));var rpc={'chatInteraction':require(_0x6090('0x2')),'openchannelInteraction':require(_0x6090('0x3')),'smsInteraction':require(_0x6090('0x4')),'mailInteraction':require(_0x6090('0x5')),'faxInteraction':require(_0x6090('0x6')),'whatsappInteraction':require(_0x6090('0x7'))};var logger=require('../../../../config/logger')(_0x6090('0x8'));var tag=schema({'tag':{'type':_0x6090('0x9'),'required':!![],'message':_0x6090('0xa')}});exports['consequence']=function(_0x3ce1d2,_0x58d6e3,_0x281841,_0x87cd9b){return function(_0x587526){try{var _0x524165={'tag':_0x58d6e3[0x0]};var _0x35a277=tag[_0x6090('0x0')](_0x524165,{'typecast':!![]});if(_0x35a277[_0x6090('0xb')]){logger['error'](_0x6090('0xc'),_0x3ce1d2,_[_0x6090('0xd')](_0x35a277,_0x6090('0xe'))[_0x6090('0xf')](',\x20'));logger[_0x6090('0x10')](_0x6090('0x11'),_0x3ce1d2);_0x587526[_0x6090('0x12')]();}else{var _0x16c840={'ids':[_0x58d6e3[0x0]]};if(rpc[_0x87cd9b[_0x6090('0x13')]+'Interaction']){rpc[_0x87cd9b['channel']+_0x6090('0x14')][_0x6090('0x15')](_0x87cd9b['interaction']['id'],_0x16c840)[_0x6090('0x16')](function(_0x4f4f84){logger['info'](_0x6090('0x17'),_0x3ce1d2,_0x58d6e3[0x1],_0x87cd9b['channel'],_0x87cd9b['interaction']['id']);})[_0x6090('0x18')](function(_0x51b1b7){logger[_0x6090('0x19')](_0x6090('0xc'),_0x3ce1d2,JSON[_0x6090('0x1a')](_0x51b1b7));logger[_0x6090('0x10')](_0x6090('0x11'),_0x3ce1d2);})['finally'](function(){_0x587526[_0x6090('0x12')]();});}}}catch(_0x24daf5){logger[_0x6090('0x19')](_0x6090('0xc'),_0x3ce1d2,_[_0x6090('0x1b')](_0x24daf5)?JSON[_0x6090('0x1a')](_0x24daf5):_0x24daf5);logger[_0x6090('0x10')](_0x6090('0x11'),_0x3ce1d2);_0x587526['next']();}};}; \ No newline at end of file +var _0x5ba7=['[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','join','info','next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify'];(function(_0x1eeacc,_0x7e161){var _0x367622=function(_0x37988b){while(--_0x37988b){_0x1eeacc['push'](_0x1eeacc['shift']());}};_0x367622(++_0x7e161);}(_0x5ba7,0x18b));var _0x75ba=function(_0x2ba04b,_0x3fa6b6){_0x2ba04b=_0x2ba04b-0x0;var _0x5c16e3=_0x5ba7[_0x2ba04b];return _0x5c16e3;};'use strict';var schema=require(_0x75ba('0x0'));var _=require(_0x75ba('0x1'));var rpc={'chatInteraction':require(_0x75ba('0x2')),'openchannelInteraction':require(_0x75ba('0x3')),'smsInteraction':require(_0x75ba('0x4')),'mailInteraction':require(_0x75ba('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x75ba('0x6'));var tag=schema({'tag':{'type':_0x75ba('0x7'),'required':!![],'message':_0x75ba('0x8')}});exports[_0x75ba('0x9')]=function(_0x3f8acb,_0x5333d7,_0x12db76,_0x46912d){return function(_0x524bd1){try{var _0x2c9d2f={'tag':_0x5333d7[0x0]};var _0x2abe0e=tag[_0x75ba('0x0')](_0x2c9d2f,{'typecast':!![]});if(_0x2abe0e[_0x75ba('0xa')]){logger[_0x75ba('0xb')](_0x75ba('0xc'),_0x3f8acb,_[_0x75ba('0xd')](_0x2abe0e,'message')[_0x75ba('0xe')](',\x20'));logger[_0x75ba('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3f8acb);_0x524bd1[_0x75ba('0x10')]();}else{var _0x24058d={'ids':[_0x5333d7[0x0]]};if(rpc[_0x46912d[_0x75ba('0x11')]+_0x75ba('0x12')]){rpc[_0x46912d[_0x75ba('0x11')]+_0x75ba('0x12')][_0x75ba('0x13')](_0x46912d['interaction']['id'],_0x24058d)[_0x75ba('0x14')](function(_0x33dd02){logger[_0x75ba('0xf')](_0x75ba('0x15'),_0x3f8acb,_0x5333d7[0x1],_0x46912d[_0x75ba('0x11')],_0x46912d[_0x75ba('0x16')]['id']);})[_0x75ba('0x17')](function(_0x4e439a){logger[_0x75ba('0xb')](_0x75ba('0xc'),_0x3f8acb,JSON[_0x75ba('0x18')](_0x4e439a));logger[_0x75ba('0xf')](_0x75ba('0x19'),_0x3f8acb);})[_0x75ba('0x1a')](function(){_0x524bd1[_0x75ba('0x10')]();});}}}catch(_0x128971){logger['error'](_0x75ba('0xc'),_0x3f8acb,_[_0x75ba('0x1b')](_0x128971)?JSON['stringify'](_0x128971):_0x128971);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3f8acb);_0x524bd1[_0x75ba('0x10')]();}};}; \ 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 52b2157..b003782 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 _0xc401=['then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','stringify','info','error','[%s][TVOX]\x20%s','stop','request-promise','../../../../config/logger','lodash','consequence','replace','\x20-\x20','includes','?params=','urlOnRing','title','jsonrpc','2.0','method','login','push','params','utf8','POST','application/json-rpc'];(function(_0x3b611a,_0x5358bb){var _0x41c633=function(_0x47f9f1){while(--_0x47f9f1){_0x3b611a['push'](_0x3b611a['shift']());}};_0x41c633(++_0x5358bb);}(_0xc401,0xd4));var _0x1c40=function(_0x2fe74e,_0x23edc3){_0x2fe74e=_0x2fe74e-0x0;var _0x2e5d3a=_0xc401[_0x2fe74e];return _0x2e5d3a;};'use strict';var rp=require(_0x1c40('0x0'));var logger=require(_0x1c40('0x1'))('routing');var _=require(_0x1c40('0x2'));var arr=[];exports[_0x1c40('0x3')]=function(_0x90baf1,_0x2ec0c8){return function(_0x26fa81){var _0x130b02=_0x2ec0c8[0xa];var _0x914451=_0x2ec0c8[0xb];var _0xbcafd0=_0x2ec0c8[0xc];var _0x442a8c=_0x2ec0c8[0xd];var _0x26e36c=_0x2ec0c8[0xe];var _0x4005b6=_0x2ec0c8[0xf][_0x1c40('0x4')](/\n/g,_0x1c40('0x5'));var _0x213ae8=_0x2ec0c8[0x10][_0x1c40('0x4')](/\n/g,'\x20');if(!arr[_0x1c40('0x6')](_0x914451)){arr['push'](_0x914451);var _0x3d2d31=_0x2ec0c8[0x3];var _0x16b647=_0x2ec0c8[0x4];var _0x5b48b7=_0x2ec0c8[0x1];var _0x3e786b=_0x2ec0c8[0x0];var _0xb81214={};_0xb81214['urlOnAnswer']=_0x2ec0c8[0x8]+_0x1c40('0x7')+_0xbcafd0+'|'+_0x130b02+'|'+_0x442a8c+'|'+_0x914451+'|'+_0x26e36c;_0xb81214[_0x1c40('0x8')]=_0x2ec0c8[0x7]+'?params='+_0xbcafd0+'|'+_0x130b02+'|'+_0x442a8c+'|'+_0x914451+'|'+_0x26e36c+'|'+_0x4005b6+'|'+_0x213ae8;_0xb81214[_0x1c40('0x9')]=_0x2ec0c8[0x9];var _0x59ce8a={};_0x59ce8a[_0x1c40('0xa')]=_0x1c40('0xb');_0x59ce8a[_0x1c40('0xc')]=_0x1c40('0xd');var _0x272a8b=[];_0x272a8b[_0x1c40('0xe')](_0x2ec0c8[0x2]);_0x272a8b[_0x1c40('0xe')](_0x2ec0c8[0x5]);_0x272a8b[_0x1c40('0xe')](_0x2ec0c8[0x6]);_0x59ce8a[_0x1c40('0xf')]=_0x272a8b;_0x59ce8a['id']=0x1;var _0x38ffc5=JSON['stringify'](_0x59ce8a);var _0x999b4b={'encoding':_0x1c40('0x10'),'method':_0x1c40('0x11'),'timeout':0x2710,'url':_0x3d2d31,'headers':{'Content-Type':_0x1c40('0x12')},'body':_0x38ffc5};return rp(_0x999b4b)[_0x1c40('0x13')](function(_0x247329){const _0x14992f=JSON[_0x1c40('0x14')](_0x247329);if(!_0x14992f[_0x1c40('0x15')][_0x1c40('0x16')]){throw new Error(_0x1c40('0x17'));}var _0x2dcb0e=_0x914451;var _0x1600b2=_0x1c40('0x18')+_0x5b48b7+_0x1c40('0x19')+_0x3e786b+_0x1c40('0x1a')+_0x2dcb0e+_0x1c40('0x1b')+JSON[_0x1c40('0x1c')](_0xb81214);var _0x349a3b=_0x16b647+'?'+_0x1600b2;return rp(_0x349a3b);})[_0x1c40('0x13')](function(_0x1059b6){logger[_0x1c40('0x1d')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x90baf1,_0x1059b6);_0x26fa81['stop']();})['catch'](function(_0x19c321){logger[_0x1c40('0x1e')](_0x1c40('0x1f'),_0x90baf1,_['isObject'](_0x19c321)?JSON[_0x1c40('0x1c')](_0x19c321):_0x19c321);_0x26fa81[_0x1c40('0x20')]();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x90baf1);_0x26fa81['next']();}};}; \ No newline at end of file +var _0xfc72=['lodash','consequence','replace','\x20-\x20','includes','push','?params=','title','jsonrpc','2.0','method','login','params','stringify','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0xfc72,0x1df));var _0x2fc7=function(_0x34331b,_0x22a64c){_0x34331b=_0x34331b-0x0;var _0x1f97c8=_0xfc72[_0x34331b];return _0x1f97c8;};'use strict';var rp=require('request-promise');var logger=require(_0x2fc7('0x0'))('routing');var _=require(_0x2fc7('0x1'));var arr=[];exports[_0x2fc7('0x2')]=function(_0x2c6f61,_0x26fbd0){return function(_0x47525b){var _0x5e6128=_0x26fbd0[0xa];var _0x2833b2=_0x26fbd0[0xb];var _0xd8745b=_0x26fbd0[0xc];var _0x5190ce=_0x26fbd0[0xd];var _0x2e5caa=_0x26fbd0[0xe];var _0x213a34=_0x26fbd0[0xf][_0x2fc7('0x3')](/\n/g,_0x2fc7('0x4'));var _0x41d561=_0x26fbd0[0x10][_0x2fc7('0x3')](/\n/g,'\x20');if(!arr[_0x2fc7('0x5')](_0x2833b2)){arr[_0x2fc7('0x6')](_0x2833b2);var _0x108229=_0x26fbd0[0x3];var _0x589507=_0x26fbd0[0x4];var _0x19267a=_0x26fbd0[0x1];var _0x569d1f=_0x26fbd0[0x0];var _0x174539={};_0x174539['urlOnAnswer']=_0x26fbd0[0x8]+_0x2fc7('0x7')+_0xd8745b+'|'+_0x5e6128+'|'+_0x5190ce+'|'+_0x2833b2+'|'+_0x2e5caa;_0x174539['urlOnRing']=_0x26fbd0[0x7]+_0x2fc7('0x7')+_0xd8745b+'|'+_0x5e6128+'|'+_0x5190ce+'|'+_0x2833b2+'|'+_0x2e5caa+'|'+_0x213a34+'|'+_0x41d561;_0x174539[_0x2fc7('0x8')]=_0x26fbd0[0x9];var _0xdd861c={};_0xdd861c[_0x2fc7('0x9')]=_0x2fc7('0xa');_0xdd861c[_0x2fc7('0xb')]=_0x2fc7('0xc');var _0x18036f=[];_0x18036f[_0x2fc7('0x6')](_0x26fbd0[0x2]);_0x18036f[_0x2fc7('0x6')](_0x26fbd0[0x5]);_0x18036f[_0x2fc7('0x6')](_0x26fbd0[0x6]);_0xdd861c[_0x2fc7('0xd')]=_0x18036f;_0xdd861c['id']=0x1;var _0x267e4a=JSON[_0x2fc7('0xe')](_0xdd861c);var _0x58fc65={'encoding':_0x2fc7('0xf'),'method':_0x2fc7('0x10'),'timeout':0x2710,'url':_0x108229,'headers':{'Content-Type':_0x2fc7('0x11')},'body':_0x267e4a};return rp(_0x58fc65)[_0x2fc7('0x12')](function(_0x466893){const _0xa319ac=JSON[_0x2fc7('0x13')](_0x466893);if(!_0xa319ac[_0x2fc7('0x14')][_0x2fc7('0x15')]){throw new Error(_0x2fc7('0x16'));}var _0x46c665=_0x2833b2;var _0xeb7d9a=_0x2fc7('0x17')+_0x19267a+_0x2fc7('0x18')+_0x569d1f+'&sessionId='+_0x46c665+_0x2fc7('0x19')+JSON['stringify'](_0x174539);var _0x50dbc0=_0x589507+'?'+_0xeb7d9a;return rp(_0x50dbc0);})['then'](function(_0x3d91f5){logger['info'](_0x2fc7('0x1a'),_0x2c6f61,_0x3d91f5);_0x47525b[_0x2fc7('0x1b')]();})['catch'](function(_0x181f4d){logger[_0x2fc7('0x1c')]('[%s][TVOX]\x20%s',_0x2c6f61,_['isObject'](_0x181f4d)?JSON[_0x2fc7('0xe')](_0x181f4d):_0x181f4d);_0x47525b[_0x2fc7('0x1b')]();});}else{logger[_0x2fc7('0x1d')](_0x2fc7('0x1e'),_0x2c6f61);_0x47525b[_0x2fc7('0x1f')]();}};}; \ 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 ec8701d..9f966f9 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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x141d75,_0x5a7373){var _0x517e52=function(_0x5337de){while(--_0x5337de){_0x141d75['push'](_0x141d75['shift']());}};_0x517e52(++_0x5a7373);}(_0xe706,0xa3));var _0x6e70=function(_0x153ab3,_0x5c7acb){_0x153ab3=_0x153ab3-0x0;var _0x4e2455=_0xe706[_0x153ab3];return _0x4e2455;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x2c5c53,_0x272eb5){var _0x7305ee=function(_0x2bccd5){while(--_0x2bccd5){_0x2c5c53['push'](_0x2c5c53['shift']());}};_0x7305ee(++_0x272eb5);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 6a050b6..12306c9 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 _0x58a7=['agent','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','listen','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','applications','isArray','length','existsSync','app','.js','toLowerCase','autoreply','appdata','split','push','slice','join','dialogflow','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty'];(function(_0x557208,_0xb32eb9){var _0x19c8f9=function(_0x52b879){while(--_0x52b879){_0x557208['push'](_0x557208['shift']());}};_0x19c8f9(++_0xb32eb9);}(_0x58a7,0xf7));var _0x758a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x58a7[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x758a('0x0'));var util=require(_0x758a('0x1'));var path=require(_0x758a('0x2'));var fs=require('fs');var jayson=require(_0x758a('0x3'));var BPromise=require(_0x758a('0x4'));var uuid=require(_0x758a('0x5'));var utils=require(_0x758a('0x6'));var config=require(_0x758a('0x7'));var logger=require('../../../config/logger')(_0x758a('0x8'));var rpc={'openchannelQueueReport':require(_0x758a('0x9')),'mailQueueReport':require(_0x758a('0xa')),'chatQueueReport':require(_0x758a('0xb')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x758a('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x227bdb,_0x31311b,_0x189085){return util[_0x758a('0xd')](_0x758a('0xe'),_0x227bdb,_0x31311b||0x0,_0x189085||0x0);}function getIntervals(_0x3620b9,_0x3e5a12){var _0x46b659=[];if(!_[_0x758a('0xf')](_0x3e5a12[_0x758a('0x10')])&&!_[_0x758a('0xf')](_0x3620b9[_0x3e5a12['IntervalId']])&&!_['isNil'](_0x3620b9[_0x3e5a12[_0x758a('0x10')]][_0x758a('0x11')])){_0x46b659=_[_0x758a('0x12')](_0x3620b9[_0x3e5a12['IntervalId']][_0x758a('0x11')],_0x758a('0x13'));}else if(!_[_0x758a('0xf')](_0x3e5a12[_0x758a('0x13')])){_0x46b659=[_0x3e5a12[_0x758a('0x13')]];}return _0x46b659;}exports['listen']=function(_0x4b0b39){_0x4b0b39[_0x758a('0x14')]={};return new BPromise(function(_0x194bb9,_0x1653f1){var _0x54dec5={'Start':function(_0x4e4aee){var _0x5a9512=this;return new Promise(function(_0x5bdbfb,_0x460aa8){if(_0x4e4aee){try{var _0x65523a=[];var _0x520883=getId(_0x4e4aee[_0x758a('0x15')],_0x4e4aee[_0x758a('0x16')]?_0x4e4aee[_0x758a('0x16')]['id']:0x0,_0x4e4aee[_0x758a('0x17')]?_0x4e4aee[_0x758a('0x17')]['id']:0x0);if(_0x4e4aee[_0x758a('0x18')]&&_[_0x758a('0x19')](_0x4e4aee[_0x758a('0x18')])&&_0x4e4aee[_0x758a('0x18')][_0x758a('0x1a')]){for(var _0x317427=0x0;_0x317427<_0x4e4aee[_0x758a('0x18')][_0x758a('0x1a')];_0x317427+=0x1){var _0x2fc93c=_0x4e4aee[_0x758a('0x18')][_0x317427];if(fs[_0x758a('0x1b')](path['join'](__dirname,_0x758a('0x18'),_0x2fc93c[_0x758a('0x1c')]+_0x758a('0x1d')))){var _0x3ba95e=[];switch(_0x2fc93c[_0x758a('0x1c')][_0x758a('0x1e')]()){case _0x758a('0x1f'):var _0x5f4c16=_0x2fc93c[_0x758a('0x20')][_0x758a('0x21')](',');if(_0x4e4aee['channel']==='mail'){_0x3ba95e[_0x758a('0x22')](_0x5f4c16[0x0]);_0x3ba95e[_0x758a('0x22')](_0x5f4c16[0x1]);_0x3ba95e[_0x758a('0x22')](_0x5f4c16[_0x758a('0x23')](0x2,_0x5f4c16[_0x758a('0x1a')])['join'](','));}else{_0x3ba95e[_0x758a('0x22')](_0x5f4c16[0x0]);_0x3ba95e['push'](_0x5f4c16['slice'](0x1,_0x5f4c16[_0x758a('0x1a')])[_0x758a('0x24')](','));}break;case _0x758a('0x25'):var _0x48eee8=_0x2fc93c[_0x758a('0x20')][_0x758a('0x21')](',');_0x3ba95e[_0x758a('0x22')](_0x48eee8[0x0]);_0x3ba95e[_0x758a('0x22')](_0x48eee8[0x1]);_0x3ba95e[_0x758a('0x22')](_0x48eee8[_0x758a('0x23')](0x2,_0x48eee8[_0x758a('0x1a')])[_0x758a('0x24')](','));break;case _0x758a('0x26'):var _0x25418b=_0x2fc93c[_0x758a('0x20')]['split'](',');_0x3ba95e['push'](_0x25418b[0x0]);_0x3ba95e[_0x758a('0x22')](_0x25418b[0x1]);_0x3ba95e[_0x758a('0x22')](_0x25418b[0x2]);_0x3ba95e[_0x758a('0x22')](_0x25418b[0x3]);_0x3ba95e[_0x758a('0x22')](_0x25418b[_0x758a('0x23')](0x4,_0x25418b[_0x758a('0x1a')])[_0x758a('0x24')](','));break;case _0x758a('0x27'):var _0x1e7155=_0x2fc93c[_0x758a('0x20')][_0x758a('0x21')](',');_0x3ba95e[_0x758a('0x22')](_0x1e7155[0x0]);_0x3ba95e[_0x758a('0x22')](_0x1e7155[0x1]);_0x3ba95e['push'](_0x1e7155[0x2]);_0x3ba95e[_0x758a('0x22')](_0x1e7155[0x3]);_0x3ba95e[_0x758a('0x22')](_0x1e7155['slice'](0x4,_0x1e7155[_0x758a('0x1a')])[_0x758a('0x24')](','));break;case _0x758a('0x16'):_0x3ba95e[_0x758a('0x22')](_0x2fc93c['appdata']);break;case'tag':_0x3ba95e[_0x758a('0x22')](_0x2fc93c[_0x758a('0x28')]);_0x3ba95e['push'](_0x2fc93c['appdata']);break;case _0x758a('0x29'):var _0x435299=utils[_0x758a('0x2a')](_0x4e4aee[_0x758a('0x2b')][_0x758a('0x2c')],_0x4e4aee);var _0x571296=_0x2fc93c[_0x758a('0x20')]['split'](',');_0x3ba95e['push'](_0x571296[0x0]);_0x3ba95e[_0x758a('0x22')](_0x571296[0x1]);_0x3ba95e[_0x758a('0x22')](_0x571296[0x2]);_0x3ba95e[_0x758a('0x22')](_0x571296[0x3]);_0x3ba95e[_0x758a('0x22')](_0x571296[0x4]);_0x3ba95e[_0x758a('0x22')](_0x571296[0x5]);_0x3ba95e['push'](_0x571296[0x6]);_0x3ba95e[_0x758a('0x22')](_0x571296[0x7]);_0x3ba95e[_0x758a('0x22')](_0x571296[0x8]);_0x3ba95e[_0x758a('0x22')](_0x571296[0x9]);_0x3ba95e[_0x758a('0x22')](_0x571296[0xa]);_0x3ba95e[_0x758a('0x22')](_0x4e4aee[_0x758a('0x17')]['id']);_0x3ba95e[_0x758a('0x22')](_0x4e4aee['message']['id']);_0x3ba95e[_0x758a('0x22')](_0x2fc93c[_0x758a('0x2d')]);_0x3ba95e[_0x758a('0x22')](_0x4e4aee[_0x758a('0x17')][_0x758a('0x2e')]);_0x3ba95e['push'](_0x4e4aee[_0x758a('0x2f')][_0x758a('0x2f')]);_0x3ba95e[_0x758a('0x22')](_0x435299);break;default:_0x3ba95e=_['isNil'](_0x2fc93c[_0x758a('0x20')])?[]:_0x2fc93c['appdata'][_0x758a('0x21')](',');}var _0x16eed5={'id':util['format'](_0x758a('0x30'),_0x520883,_0x2fc93c['id'],_0x2fc93c[_0x758a('0x1c')]),'condition':require(_0x758a('0x31'))[_0x758a('0x32')](_0x520883,getIntervals(_0x4b0b39[_0x758a('0x33')],_0x2fc93c),_0x4b0b39),'consequence':require(_0x758a('0x34')+_0x2fc93c[_0x758a('0x1c')])[_0x758a('0x35')](_0x520883,_0x3ba95e,_0x4b0b39,_0x4e4aee),'p':_0x2fc93c[_0x758a('0x36')]||0x0};logger[_0x758a('0x37')](_0x758a('0x38'),_0x16eed5['id'],_0x758a('0x39'),getIntervals(_0x4b0b39[_0x758a('0x33')],_0x2fc93c)[_0x758a('0x24')](_0x758a('0x3a')));_0x65523a[_0x758a('0x22')](_0x16eed5);}else{logger[_0x758a('0x3b')](_0x758a('0x3c'),path[_0x758a('0x24')](__dirname,'applications',_0x2fc93c[_0x758a('0x1c')]+_0x758a('0x1d')));}}_0x4b0b39['rules'][_0x520883]=new RuleEngine(_0x65523a);_0x4b0b39['rules'][_0x520883][_0x758a('0x3d')](_0x4e4aee,function(_0x5441ad){logger['info'](_0x758a('0x3e'),JSON[_0x758a('0x3f')](_0x5441ad['matchPath']));if(_0x4b0b39[_0x758a('0x14')][_0x520883]){_0x4b0b39[_0x758a('0x14')][_0x520883][_0x758a('0x40')](_0x758a('0x41'));}});return _0x5bdbfb({'code':0xc8,'message':_0x4e4aee});}else{logger[_0x758a('0x37')](_0x758a('0x42'));return _0x5bdbfb({'code':0xc8,'message':_0x4e4aee});}}catch(_0x210b5f){logger[_0x758a('0x3b')](_0x210b5f['stack']);return _0x460aa8(_0x5a9512['error'](0x1f4,_0x210b5f));}}return _0x460aa8(_0x758a('0x43'));});},'AcceptMessage':function(_0x285173){var _0x32088e=this;return new Promise(function(_0x367fe5,_0x27250b){if(_0x285173[_0x758a('0x44')]&&_0x285173[_0x758a('0x44')]['id']){if(_0x4b0b39[_0x758a('0x45')][_0x285173[_0x758a('0x44')]['id']]){_0x4b0b39['agents'][_0x285173[_0x758a('0x44')]['id']]['busy']=![];_0x4b0b39['agents'][_0x285173[_0x758a('0x44')]['id']][_0x758a('0x46')]=undefined;}}if(_0x285173['message']&&_0x285173[_0x758a('0x16')]['id']){try{var _0x416d90=getId(_0x285173[_0x758a('0x15')],_0x285173[_0x758a('0x16')]?_0x285173[_0x758a('0x16')]['id']:0x0,_0x285173['interaction']?_0x285173[_0x758a('0x17')]['id']:0x0);if(_0x4b0b39[_0x758a('0x14')][_0x416d90]){_0x4b0b39[_0x758a('0x14')][_0x416d90][_0x758a('0x40')](_0x758a('0x47'));if(rpc[_0x285173['channel']+_0x758a('0x48')]){rpc[_0x285173['channel']+_0x758a('0x48')][_0x758a('0x49')](_0x416d90,{'UserId':_0x285173[_0x758a('0x16')][_0x758a('0x4a')]})[_0x758a('0x4b')](function(_0x130abf){logger[_0x758a('0x3b')](_0x758a('0x4c'));});}}return _0x367fe5({'code':0xc8,'message':_0x285173});}catch(_0x1276c5){logger['error'](_0x1276c5[_0x758a('0x4d')]);return _0x27250b(_0x32088e[_0x758a('0x3b')](0x1f4,_0x1276c5));}}logger[_0x758a('0x3b')](_0x758a('0x4e'));return _0x27250b(_0x32088e['error'](0x1f4,_0x758a('0x4e')));});},'RejectMessage':function(_0x2316b3){var _0x1b1b86=this;return new Promise(function(_0xaee57a,_0x33c70a){if(_0x2316b3['agent']&&_0x2316b3['agent']['id']){try{if(_0x4b0b39['agents'][_0x2316b3[_0x758a('0x44')]['id']]){_0x4b0b39[_0x758a('0x45')][_0x2316b3[_0x758a('0x44')]['id']]['busy']=![];_0x4b0b39['agents'][_0x2316b3['agent']['id']]['busyQueue']=undefined;}return _0xaee57a({'code':0xc8,'message':_0x2316b3});}catch(_0x229ccd){logger[_0x758a('0x3b')](_0x229ccd[_0x758a('0x4d')]);return _0x33c70a(_0x1b1b86[_0x758a('0x3b')](0x1f4,_0x229ccd));}}logger[_0x758a('0x3b')](_0x758a('0x4e'));return _0x33c70a(_0x1b1b86[_0x758a('0x3b')](0x1f4,_0x758a('0x4e')));});},'AbandonInteraction':function(_0x45801e){var _0x12cd48=this;return new Promise(function(_0x258e7a,_0x1637c4){if(_0x45801e['channel']&&_0x45801e['interaction']&&_0x45801e[_0x758a('0x17')]['id']){try{var _0x2e69b7=getId(_0x45801e[_0x758a('0x15')],_0x45801e[_0x758a('0x16')]?_0x45801e['message']['id']:0x0,_0x45801e[_0x758a('0x17')]?_0x45801e[_0x758a('0x17')]['id']:0x0);if(_0x4b0b39[_0x758a('0x14')][_0x2e69b7]){_0x4b0b39[_0x758a('0x14')][_0x2e69b7][_0x758a('0x40')](_0x758a('0x47'));}return _0x258e7a({'code':0xc8,'message':_0x45801e});}catch(_0x1275fb){logger['error'](_0x1275fb[_0x758a('0x4d')]);return _0x1637c4(_0x12cd48[_0x758a('0x3b')](0x1f4,_0x1275fb));}}logger[_0x758a('0x3b')]('message\x20is\x20empty');return _0x1637c4(_0x12cd48[_0x758a('0x3b')](0x1f4,_0x758a('0x4e')));});},'AgentCapacity':function(_0x2b1b4e){var _0x3405f8=this;return new Promise(function(_0x251035,_0x4465e3){if(_0x4b0b39[_0x758a('0x45')][_0x758a('0x4f')](_0x2b1b4e['id'])){for(var _0x47559d in _0x2b1b4e[_0x758a('0x50')]){if(_0x2b1b4e['capacity'][_0x758a('0x4f')](_0x47559d)){if(_0x4b0b39['agents'][_0x2b1b4e['id']][_0x758a('0x4f')](_0x47559d+_0x758a('0x51'))){_0x4b0b39[_0x758a('0x45')][_0x2b1b4e['id']][_0x47559d+_0x758a('0x51')]=parseInt(_0x2b1b4e['capacity'][_0x47559d],0xa);}}}_0x4b0b39[_0x758a('0x45')][_0x2b1b4e['id']][_0x758a('0x52')]();return _0x251035({'code':0xc8,'message':_0x4b0b39[_0x758a('0x45')][_0x2b1b4e['id']]});}else{return _0x4465e3(_0x3405f8[_0x758a('0x3b')](0x1f4,_0x758a('0x53')));}});},'Agents':function(_0xcb1cc8){return new Promise(function(_0x1e2554,_0x112624){var _0x25b99c=_[_0x758a('0x54')](_0x4b0b39[_0x758a('0x45')]);_0x1e2554({'count':_0x25b99c['length'],'rows':_0x25b99c});});},'ChatQueues':function(_0x11ca3b){return new Promise(function(_0x846881,_0x2e1045){var _0x867548=[];for(var _0x2ac8ec in _0x4b0b39[_0x758a('0x55')]){if(_0x4b0b39['chatQueues'][_0x758a('0x4f')](_0x2ac8ec)){var _0x22a9b3=_0x4b0b39['chatQueues'][_0x2ac8ec];var _0x71073f={'id':_0x22a9b3['id'],'available':_0x22a9b3[_0x758a('0x56')],'loggedIn':_0x22a9b3[_0x758a('0x57')],'name':_0x22a9b3['name'],'paused':_0x22a9b3[_0x758a('0x58')],'waiting':_0x22a9b3[_0x758a('0x59')]};_0x867548['push'](_0x71073f);}}_0x846881({'count':_0x867548['length'],'rows':_0x867548});});},'MailQueues':function(_0x332650){return new Promise(function(_0x1a4e16,_0x584f31){var _0x2a8ea5=[];for(var _0x5a0c1b in _0x4b0b39['mailQueues']){if(_0x4b0b39['mailQueues']['hasOwnProperty'](_0x5a0c1b)){var _0x138147=_0x4b0b39['mailQueues'][_0x5a0c1b];var _0x579f43={'id':_0x138147['id'],'available':_0x138147[_0x758a('0x56')],'loggedIn':_0x138147[_0x758a('0x57')],'name':_0x138147[_0x758a('0x5a')],'paused':_0x138147['paused'],'waiting':_0x138147[_0x758a('0x59')]};_0x2a8ea5['push'](_0x579f43);}}_0x1a4e16({'count':_0x2a8ea5[_0x758a('0x1a')],'rows':_0x2a8ea5});});},'OpenchannelQueues':function(_0x5b059c){return new Promise(function(_0x36a651,_0x52a120){var _0x54cd6a=[];for(var _0x2f07f0 in _0x4b0b39[_0x758a('0x5b')]){if(_0x4b0b39['openchannelQueues'][_0x758a('0x4f')](_0x2f07f0)){var _0x54b5a7=_0x4b0b39['openchannelQueues'][_0x2f07f0];var _0x1362bf={'id':_0x54b5a7['id'],'available':_0x54b5a7[_0x758a('0x56')],'loggedIn':_0x54b5a7[_0x758a('0x57')],'name':_0x54b5a7['name'],'paused':_0x54b5a7[_0x758a('0x58')],'waiting':_0x54b5a7[_0x758a('0x59')]};_0x54cd6a[_0x758a('0x22')](_0x1362bf);}}_0x36a651({'count':_0x54cd6a[_0x758a('0x1a')],'rows':_0x54cd6a});});},'SmsQueues':function(_0x327988){return new Promise(function(_0x4f50e6,_0x4a7a8d){var _0x101d9c=[];for(var _0x46f27d in _0x4b0b39['smsQueues']){if(_0x4b0b39['smsQueues'][_0x758a('0x4f')](_0x46f27d)){var _0x844cee=_0x4b0b39[_0x758a('0x5c')][_0x46f27d];var _0x2a1531={'id':_0x844cee['id'],'available':_0x844cee['available'],'loggedIn':_0x844cee[_0x758a('0x57')],'name':_0x844cee[_0x758a('0x5a')],'paused':_0x844cee[_0x758a('0x58')],'waiting':_0x844cee['waiting']};_0x101d9c[_0x758a('0x22')](_0x2a1531);}}_0x4f50e6({'count':_0x101d9c[_0x758a('0x1a')],'rows':_0x101d9c});});},'FaxQueues':function(_0x14a18d){return new Promise(function(_0x40ca6b,_0x3cb78f){var _0x47c7f8=[];for(var _0x48029c in _0x4b0b39[_0x758a('0x5d')]){if(_0x4b0b39[_0x758a('0x5d')][_0x758a('0x4f')](_0x48029c)){var _0x4a8c7f=_0x4b0b39[_0x758a('0x5d')][_0x48029c];var _0x3de4b9={'id':_0x4a8c7f['id'],'available':_0x4a8c7f[_0x758a('0x56')],'loggedIn':_0x4a8c7f['loggedIn'],'name':_0x4a8c7f[_0x758a('0x5a')],'paused':_0x4a8c7f[_0x758a('0x58')],'waiting':_0x4a8c7f[_0x758a('0x59')]};_0x47c7f8[_0x758a('0x22')](_0x3de4b9);}}_0x40ca6b({'count':_0x47c7f8[_0x758a('0x1a')],'rows':_0x47c7f8});});},'WhatsappQueues':function(_0x510ad9){return new Promise(function(_0x14fd5f,_0x2a130c){var _0x50d346=[];for(var _0x8a332c in _0x4b0b39[_0x758a('0x5e')]){if(_0x4b0b39['whatsappQueues'][_0x758a('0x4f')](_0x8a332c)){var _0xac5e91=_0x4b0b39['whatsappQueues'][_0x8a332c];var _0x864d4a={'id':_0xac5e91['id'],'available':_0xac5e91[_0x758a('0x56')],'loggedIn':_0xac5e91['loggedIn'],'name':_0xac5e91[_0x758a('0x5a')],'paused':_0xac5e91['paused'],'waiting':_0xac5e91[_0x758a('0x59')]};_0x50d346[_0x758a('0x22')](_0x864d4a);}}_0x14fd5f({'count':_0x50d346[_0x758a('0x1a')],'rows':_0x50d346});});},'ChatQueuesWaitingInteractions':function(_0x369eee){return new Promise(function(_0x23db69,_0x3f88d2){var _0x5ae8f3=_[_0x758a('0x54')](_0x4b0b39[_0x758a('0x5f')]);_0x23db69({'count':_0x5ae8f3[_0x758a('0x1a')],'rows':_0x5ae8f3});});},'MailQueuesWaitingInteractions':function(_0x3378bc){return new Promise(function(_0x2c9cda,_0x2ab323){var _0x430334=_[_0x758a('0x54')](_0x4b0b39['mailQueuesWaitingInteractions']);_0x2c9cda({'count':_0x430334[_0x758a('0x1a')],'rows':_0x430334});});},'OpenchannelQueuesWaitingInteractions':function(_0x596857){return new Promise(function(_0x5e9953,_0x5b0dc4){var _0x48f33e=_[_0x758a('0x54')](_0x4b0b39[_0x758a('0x60')]);_0x5e9953({'count':_0x48f33e[_0x758a('0x1a')],'rows':_0x48f33e});});},'SmsQueuesWaitingInteractions':function(_0x4812aa){return new Promise(function(_0x28caba,_0x48a0d4){var _0x24efd4=_[_0x758a('0x54')](_0x4b0b39[_0x758a('0x61')]);_0x28caba({'count':_0x24efd4[_0x758a('0x1a')],'rows':_0x24efd4});});},'FaxQueuesWaitingInteractions':function(_0xb7c2f4){return new Promise(function(_0x3d2da5,_0x407910){var _0x48fdf7=_[_0x758a('0x54')](_0x4b0b39[_0x758a('0x62')]);_0x3d2da5({'count':_0x48fdf7['length'],'rows':_0x48fdf7});});},'WhatsappQueuesWaitingInteractions':function(_0x2d20a0){return new Promise(function(_0x37a940,_0x1ddb87){var _0x46b618=_[_0x758a('0x54')](_0x4b0b39[_0x758a('0x63')]);_0x37a940({'count':_0x46b618[_0x758a('0x1a')],'rows':_0x46b618});});}};var _0xefb51e=jayson['server'](_0x54dec5)[_0x758a('0x64')]();_0xefb51e['on'](_0x758a('0x3b'),function(_0x2ca807){logger[_0x758a('0x3b')](JSON[_0x758a('0x3f')](_0x2ca807));return _0x1653f1(_0x2ca807);});_0xefb51e[_0x758a('0x65')](0x232c,_0x758a('0x66'),function(){console['log'](_0x758a('0x67'),0x232c);return _0x194bb9(_0x758a('0x68')+0x232c);});});}; \ No newline at end of file +var _0x26c2=['smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','log','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','uuid','./applications/utils','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','interaction','applications','isArray','length','join','app','.js','appdata','mail','push','slice','split','amazonlex','message','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','on\x20interval','\x20|\x20','rules','execute','Applications\x20executed','complete','stack','error','routing\x20is\x20empty','agent','agents','busyQueue','emit','end','QueueReport','update','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','paused','waiting','mailQueues','available','name','openchannelQueues'];(function(_0x90a194,_0x5dccf1){var _0x173c17=function(_0x2bc560){while(--_0x2bc560){_0x90a194['push'](_0x90a194['shift']());}};_0x173c17(++_0x5dccf1);}(_0x26c2,0x130));var _0x226c=function(_0x47d256,_0x20c88c){_0x47d256=_0x47d256-0x0;var _0x4e527b=_0x26c2[_0x47d256];return _0x4e527b;};'use strict';var _=require('lodash');var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x226c('0x0'));var BPromise=require(_0x226c('0x1'));var uuid=require(_0x226c('0x2'));var utils=require(_0x226c('0x3'));var config=require('../../../config/environment');var logger=require(_0x226c('0x4'))(_0x226c('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x226c('0x6')),'chatQueueReport':require(_0x226c('0x7')),'smsQueueReport':require(_0x226c('0x8')),'faxQueueReport':require(_0x226c('0x9')),'whatsappQueueReport':require(_0x226c('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x34cbc3,_0x461773,_0x335cab){return util[_0x226c('0xb')](_0x226c('0xc'),_0x34cbc3,_0x461773||0x0,_0x335cab||0x0);}function getIntervals(_0x51879f,_0x16cbbd){var _0x3280f8=[];if(!_['isNil'](_0x16cbbd['IntervalId'])&&!_[_0x226c('0xd')](_0x51879f[_0x16cbbd[_0x226c('0xe')]])&&!_[_0x226c('0xd')](_0x51879f[_0x16cbbd[_0x226c('0xe')]][_0x226c('0xf')])){_0x3280f8=_[_0x226c('0x10')](_0x51879f[_0x16cbbd[_0x226c('0xe')]]['Intervals'],'interval');}else if(!_[_0x226c('0xd')](_0x16cbbd[_0x226c('0x11')])){_0x3280f8=[_0x16cbbd[_0x226c('0x11')]];}return _0x3280f8;}exports[_0x226c('0x12')]=function(_0x4eb557){_0x4eb557['rules']={};return new BPromise(function(_0x21d61b,_0x3cff57){var _0x15e13b={'Start':function(_0x55697c){var _0x5d6c21=this;return new Promise(function(_0x694eef,_0x2e4a51){if(_0x55697c){try{var _0x30755=[];var _0x45a804=getId(_0x55697c[_0x226c('0x13')],_0x55697c['message']?_0x55697c['message']['id']:0x0,_0x55697c['interaction']?_0x55697c[_0x226c('0x14')]['id']:0x0);if(_0x55697c[_0x226c('0x15')]&&_[_0x226c('0x16')](_0x55697c[_0x226c('0x15')])&&_0x55697c['applications'][_0x226c('0x17')]){for(var _0xb6417f=0x0;_0xb6417f<_0x55697c[_0x226c('0x15')][_0x226c('0x17')];_0xb6417f+=0x1){var _0x11fa82=_0x55697c[_0x226c('0x15')][_0xb6417f];if(fs['existsSync'](path[_0x226c('0x18')](__dirname,_0x226c('0x15'),_0x11fa82[_0x226c('0x19')]+_0x226c('0x1a')))){var _0x272f26=[];switch(_0x11fa82['app']['toLowerCase']()){case'autoreply':var _0x1f1bf2=_0x11fa82[_0x226c('0x1b')]['split'](',');if(_0x55697c[_0x226c('0x13')]===_0x226c('0x1c')){_0x272f26[_0x226c('0x1d')](_0x1f1bf2[0x0]);_0x272f26[_0x226c('0x1d')](_0x1f1bf2[0x1]);_0x272f26[_0x226c('0x1d')](_0x1f1bf2['slice'](0x2,_0x1f1bf2[_0x226c('0x17')])['join'](','));}else{_0x272f26[_0x226c('0x1d')](_0x1f1bf2[0x0]);_0x272f26['push'](_0x1f1bf2[_0x226c('0x1e')](0x1,_0x1f1bf2[_0x226c('0x17')])[_0x226c('0x18')](','));}break;case'dialogflow':var _0x14c49b=_0x11fa82['appdata'][_0x226c('0x1f')](',');_0x272f26['push'](_0x14c49b[0x0]);_0x272f26[_0x226c('0x1d')](_0x14c49b[0x1]);_0x272f26['push'](_0x14c49b[_0x226c('0x1e')](0x2,_0x14c49b[_0x226c('0x17')])['join'](','));break;case'dialogflowv2':var _0x3b1e93=_0x11fa82[_0x226c('0x1b')][_0x226c('0x1f')](',');_0x272f26[_0x226c('0x1d')](_0x3b1e93[0x0]);_0x272f26[_0x226c('0x1d')](_0x3b1e93[0x1]);_0x272f26[_0x226c('0x1d')](_0x3b1e93[0x2]);_0x272f26[_0x226c('0x1d')](_0x3b1e93[0x3]);_0x272f26[_0x226c('0x1d')](_0x3b1e93[_0x226c('0x1e')](0x4,_0x3b1e93[_0x226c('0x17')])[_0x226c('0x18')](','));break;case _0x226c('0x20'):var _0x49e901=_0x11fa82[_0x226c('0x1b')][_0x226c('0x1f')](',');_0x272f26[_0x226c('0x1d')](_0x49e901[0x0]);_0x272f26[_0x226c('0x1d')](_0x49e901[0x1]);_0x272f26[_0x226c('0x1d')](_0x49e901[0x2]);_0x272f26['push'](_0x49e901[0x3]);_0x272f26[_0x226c('0x1d')](_0x49e901[_0x226c('0x1e')](0x4,_0x49e901[_0x226c('0x17')])['join'](','));break;case _0x226c('0x21'):_0x272f26['push'](_0x11fa82[_0x226c('0x1b')]);break;case _0x226c('0x22'):_0x272f26[_0x226c('0x1d')](_0x11fa82[_0x226c('0x23')]);_0x272f26[_0x226c('0x1d')](_0x11fa82[_0x226c('0x1b')]);break;case _0x226c('0x24'):var _0x39e942=utils[_0x226c('0x25')](_0x55697c[_0x226c('0x26')][_0x226c('0x27')],_0x55697c);var _0x3062d7=_0x11fa82[_0x226c('0x1b')][_0x226c('0x1f')](',');_0x272f26['push'](_0x3062d7[0x0]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x1]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x2]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x3]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x4]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x5]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x6]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x7]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x8]);_0x272f26[_0x226c('0x1d')](_0x3062d7[0x9]);_0x272f26['push'](_0x3062d7[0xa]);_0x272f26['push'](_0x55697c[_0x226c('0x14')]['id']);_0x272f26[_0x226c('0x1d')](_0x55697c[_0x226c('0x21')]['id']);_0x272f26[_0x226c('0x1d')](_0x11fa82[_0x226c('0x28')]);_0x272f26[_0x226c('0x1d')](_0x55697c[_0x226c('0x14')][_0x226c('0x29')]);_0x272f26[_0x226c('0x1d')](_0x55697c['body'][_0x226c('0x2a')]);_0x272f26['push'](_0x39e942);break;default:_0x272f26=_[_0x226c('0xd')](_0x11fa82[_0x226c('0x1b')])?[]:_0x11fa82[_0x226c('0x1b')]['split'](',');}var _0x507aa8={'id':util[_0x226c('0xb')](_0x226c('0x2b'),_0x45a804,_0x11fa82['id'],_0x11fa82['app']),'condition':require(_0x226c('0x2c'))[_0x226c('0x2d')](_0x45a804,getIntervals(_0x4eb557[_0x226c('0x2e')],_0x11fa82),_0x4eb557),'consequence':require(_0x226c('0x2f')+_0x11fa82['app'])[_0x226c('0x30')](_0x45a804,_0x272f26,_0x4eb557,_0x55697c),'p':_0x11fa82[_0x226c('0x31')]||0x0};logger[_0x226c('0x32')]('Push\x20new\x20rule',_0x507aa8['id'],_0x226c('0x33'),getIntervals(_0x4eb557[_0x226c('0x2e')],_0x11fa82)[_0x226c('0x18')](_0x226c('0x34')));_0x30755[_0x226c('0x1d')](_0x507aa8);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0x226c('0x15'),_0x11fa82[_0x226c('0x19')]+_0x226c('0x1a')));}}_0x4eb557[_0x226c('0x35')][_0x45a804]=new RuleEngine(_0x30755);_0x4eb557[_0x226c('0x35')][_0x45a804][_0x226c('0x36')](_0x55697c,function(_0x16ae23){logger[_0x226c('0x32')](_0x226c('0x37'),JSON['stringify'](_0x16ae23['matchPath']));if(_0x4eb557[_0x226c('0x35')][_0x45a804]){_0x4eb557[_0x226c('0x35')][_0x45a804]['emit'](_0x226c('0x38'));}});return _0x694eef({'code':0xc8,'message':_0x55697c});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x694eef({'code':0xc8,'message':_0x55697c});}}catch(_0x1b2338){logger['error'](_0x1b2338[_0x226c('0x39')]);return _0x2e4a51(_0x5d6c21[_0x226c('0x3a')](0x1f4,_0x1b2338));}}return _0x2e4a51(_0x226c('0x3b'));});},'AcceptMessage':function(_0x1c6618){var _0x89b599=this;return new Promise(function(_0x1e3cda,_0x4e705c){if(_0x1c6618[_0x226c('0x3c')]&&_0x1c6618['agent']['id']){if(_0x4eb557[_0x226c('0x3d')][_0x1c6618[_0x226c('0x3c')]['id']]){_0x4eb557[_0x226c('0x3d')][_0x1c6618[_0x226c('0x3c')]['id']]['busy']=![];_0x4eb557[_0x226c('0x3d')][_0x1c6618['agent']['id']][_0x226c('0x3e')]=undefined;}}if(_0x1c6618[_0x226c('0x21')]&&_0x1c6618[_0x226c('0x21')]['id']){try{var _0x707957=getId(_0x1c6618[_0x226c('0x13')],_0x1c6618[_0x226c('0x21')]?_0x1c6618['message']['id']:0x0,_0x1c6618[_0x226c('0x14')]?_0x1c6618[_0x226c('0x14')]['id']:0x0);if(_0x4eb557[_0x226c('0x35')][_0x707957]){_0x4eb557[_0x226c('0x35')][_0x707957][_0x226c('0x3f')](_0x226c('0x40'));if(rpc[_0x1c6618[_0x226c('0x13')]+_0x226c('0x41')]){rpc[_0x1c6618[_0x226c('0x13')]+_0x226c('0x41')][_0x226c('0x42')](_0x707957,{'UserId':_0x1c6618[_0x226c('0x21')]['UserId']})['catch'](function(_0x486510){logger[_0x226c('0x3a')](_0x226c('0x43'));});}}return _0x1e3cda({'code':0xc8,'message':_0x1c6618});}catch(_0x1cbf5d){logger['error'](_0x1cbf5d[_0x226c('0x39')]);return _0x4e705c(_0x89b599[_0x226c('0x3a')](0x1f4,_0x1cbf5d));}}logger['error'](_0x226c('0x44'));return _0x4e705c(_0x89b599[_0x226c('0x3a')](0x1f4,_0x226c('0x44')));});},'RejectMessage':function(_0x28d055){var _0x2a1d64=this;return new Promise(function(_0x3c0dfb,_0x3e60bf){if(_0x28d055[_0x226c('0x3c')]&&_0x28d055['agent']['id']){try{if(_0x4eb557[_0x226c('0x3d')][_0x28d055[_0x226c('0x3c')]['id']]){_0x4eb557['agents'][_0x28d055[_0x226c('0x3c')]['id']][_0x226c('0x45')]=![];_0x4eb557[_0x226c('0x3d')][_0x28d055[_0x226c('0x3c')]['id']][_0x226c('0x3e')]=undefined;}return _0x3c0dfb({'code':0xc8,'message':_0x28d055});}catch(_0x2a099a){logger['error'](_0x2a099a[_0x226c('0x39')]);return _0x3e60bf(_0x2a1d64['error'](0x1f4,_0x2a099a));}}logger['error'](_0x226c('0x44'));return _0x3e60bf(_0x2a1d64[_0x226c('0x3a')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x3861be){var _0x17cfc1=this;return new Promise(function(_0x347be6,_0x54b6bc){if(_0x3861be[_0x226c('0x13')]&&_0x3861be[_0x226c('0x14')]&&_0x3861be[_0x226c('0x14')]['id']){try{var _0x24096f=getId(_0x3861be[_0x226c('0x13')],_0x3861be['message']?_0x3861be[_0x226c('0x21')]['id']:0x0,_0x3861be['interaction']?_0x3861be['interaction']['id']:0x0);if(_0x4eb557[_0x226c('0x35')][_0x24096f]){_0x4eb557[_0x226c('0x35')][_0x24096f][_0x226c('0x3f')]('end');}return _0x347be6({'code':0xc8,'message':_0x3861be});}catch(_0xb225d3){logger[_0x226c('0x3a')](_0xb225d3['stack']);return _0x54b6bc(_0x17cfc1[_0x226c('0x3a')](0x1f4,_0xb225d3));}}logger[_0x226c('0x3a')](_0x226c('0x44'));return _0x54b6bc(_0x17cfc1['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x26cfd5){var _0x55db16=this;return new Promise(function(_0x29d34c,_0xfb8c4b){if(_0x4eb557['agents']['hasOwnProperty'](_0x26cfd5['id'])){for(var _0x1790c7 in _0x26cfd5[_0x226c('0x46')]){if(_0x26cfd5[_0x226c('0x46')][_0x226c('0x47')](_0x1790c7)){if(_0x4eb557['agents'][_0x26cfd5['id']][_0x226c('0x47')](_0x1790c7+_0x226c('0x48'))){_0x4eb557[_0x226c('0x3d')][_0x26cfd5['id']][_0x1790c7+'CurrentCapacity']=parseInt(_0x26cfd5[_0x226c('0x46')][_0x1790c7],0xa);}}}_0x4eb557['agents'][_0x26cfd5['id']][_0x226c('0x49')]();return _0x29d34c({'code':0xc8,'message':_0x4eb557[_0x226c('0x3d')][_0x26cfd5['id']]});}else{return _0xfb8c4b(_0x55db16[_0x226c('0x3a')](0x1f4,_0x226c('0x4a')));}});},'Agents':function(_0x30ddc2){return new Promise(function(_0x3711c9,_0x222932){var _0x40ed3a=_[_0x226c('0x4b')](_0x4eb557[_0x226c('0x3d')]);_0x3711c9({'count':_0x40ed3a[_0x226c('0x17')],'rows':_0x40ed3a});});},'ChatQueues':function(_0x2268e6){return new Promise(function(_0x52605b,_0x435c42){var _0x3d128d=[];for(var _0x1c3973 in _0x4eb557[_0x226c('0x4c')]){if(_0x4eb557[_0x226c('0x4c')][_0x226c('0x47')](_0x1c3973)){var _0x29ff98=_0x4eb557['chatQueues'][_0x1c3973];var _0x2856f4={'id':_0x29ff98['id'],'available':_0x29ff98['available'],'loggedIn':_0x29ff98[_0x226c('0x4d')],'name':_0x29ff98['name'],'paused':_0x29ff98[_0x226c('0x4e')],'waiting':_0x29ff98[_0x226c('0x4f')]};_0x3d128d[_0x226c('0x1d')](_0x2856f4);}}_0x52605b({'count':_0x3d128d[_0x226c('0x17')],'rows':_0x3d128d});});},'MailQueues':function(_0x5645a7){return new Promise(function(_0x13a8d6,_0x2d447d){var _0x315ac6=[];for(var _0x57490f in _0x4eb557[_0x226c('0x50')]){if(_0x4eb557[_0x226c('0x50')][_0x226c('0x47')](_0x57490f)){var _0xb580f0=_0x4eb557[_0x226c('0x50')][_0x57490f];var _0x487451={'id':_0xb580f0['id'],'available':_0xb580f0[_0x226c('0x51')],'loggedIn':_0xb580f0['loggedIn'],'name':_0xb580f0[_0x226c('0x52')],'paused':_0xb580f0[_0x226c('0x4e')],'waiting':_0xb580f0[_0x226c('0x4f')]};_0x315ac6[_0x226c('0x1d')](_0x487451);}}_0x13a8d6({'count':_0x315ac6['length'],'rows':_0x315ac6});});},'OpenchannelQueues':function(_0xda4304){return new Promise(function(_0x33cd69,_0x50b481){var _0x19d927=[];for(var _0x3fc153 in _0x4eb557[_0x226c('0x53')]){if(_0x4eb557[_0x226c('0x53')][_0x226c('0x47')](_0x3fc153)){var _0x1a0aca=_0x4eb557['openchannelQueues'][_0x3fc153];var _0x389cb7={'id':_0x1a0aca['id'],'available':_0x1a0aca[_0x226c('0x51')],'loggedIn':_0x1a0aca[_0x226c('0x4d')],'name':_0x1a0aca[_0x226c('0x52')],'paused':_0x1a0aca['paused'],'waiting':_0x1a0aca[_0x226c('0x4f')]};_0x19d927['push'](_0x389cb7);}}_0x33cd69({'count':_0x19d927[_0x226c('0x17')],'rows':_0x19d927});});},'SmsQueues':function(_0xb756b9){return new Promise(function(_0x59c9c3,_0x2a00f9){var _0x501597=[];for(var _0x564d3a in _0x4eb557[_0x226c('0x54')]){if(_0x4eb557[_0x226c('0x54')][_0x226c('0x47')](_0x564d3a)){var _0x41d1fd=_0x4eb557[_0x226c('0x54')][_0x564d3a];var _0x4b7770={'id':_0x41d1fd['id'],'available':_0x41d1fd[_0x226c('0x51')],'loggedIn':_0x41d1fd[_0x226c('0x4d')],'name':_0x41d1fd[_0x226c('0x52')],'paused':_0x41d1fd['paused'],'waiting':_0x41d1fd['waiting']};_0x501597[_0x226c('0x1d')](_0x4b7770);}}_0x59c9c3({'count':_0x501597['length'],'rows':_0x501597});});},'FaxQueues':function(_0x1fb15d){return new Promise(function(_0x5a9c92,_0x4a94ad){var _0x5aa1bb=[];for(var _0x2246fd in _0x4eb557[_0x226c('0x55')]){if(_0x4eb557['faxQueues']['hasOwnProperty'](_0x2246fd)){var _0x5f3051=_0x4eb557['faxQueues'][_0x2246fd];var _0x23ab51={'id':_0x5f3051['id'],'available':_0x5f3051['available'],'loggedIn':_0x5f3051[_0x226c('0x4d')],'name':_0x5f3051[_0x226c('0x52')],'paused':_0x5f3051[_0x226c('0x4e')],'waiting':_0x5f3051[_0x226c('0x4f')]};_0x5aa1bb[_0x226c('0x1d')](_0x23ab51);}}_0x5a9c92({'count':_0x5aa1bb[_0x226c('0x17')],'rows':_0x5aa1bb});});},'WhatsappQueues':function(_0x3517fa){return new Promise(function(_0x882ec8,_0x58c2e1){var _0x3746c1=[];for(var _0x345ad9 in _0x4eb557[_0x226c('0x56')]){if(_0x4eb557[_0x226c('0x56')][_0x226c('0x47')](_0x345ad9)){var _0x3b9403=_0x4eb557[_0x226c('0x56')][_0x345ad9];var _0x3659d8={'id':_0x3b9403['id'],'available':_0x3b9403['available'],'loggedIn':_0x3b9403[_0x226c('0x4d')],'name':_0x3b9403[_0x226c('0x52')],'paused':_0x3b9403[_0x226c('0x4e')],'waiting':_0x3b9403[_0x226c('0x4f')]};_0x3746c1[_0x226c('0x1d')](_0x3659d8);}}_0x882ec8({'count':_0x3746c1[_0x226c('0x17')],'rows':_0x3746c1});});},'ChatQueuesWaitingInteractions':function(_0x2585cf){return new Promise(function(_0x5ef2a2,_0x19a525){var _0x357e86=_[_0x226c('0x4b')](_0x4eb557[_0x226c('0x57')]);_0x5ef2a2({'count':_0x357e86[_0x226c('0x17')],'rows':_0x357e86});});},'MailQueuesWaitingInteractions':function(_0x2ac44b){return new Promise(function(_0x5292cb,_0x2e1c6c){var _0xbf68ea=_[_0x226c('0x4b')](_0x4eb557[_0x226c('0x58')]);_0x5292cb({'count':_0xbf68ea[_0x226c('0x17')],'rows':_0xbf68ea});});},'OpenchannelQueuesWaitingInteractions':function(_0x868257){return new Promise(function(_0x20a47c,_0x5af32e){var _0x52b1c5=_[_0x226c('0x4b')](_0x4eb557[_0x226c('0x59')]);_0x20a47c({'count':_0x52b1c5['length'],'rows':_0x52b1c5});});},'SmsQueuesWaitingInteractions':function(_0xbd31d7){return new Promise(function(_0x5524c5,_0x48e0a6){var _0x2ad739=_[_0x226c('0x4b')](_0x4eb557[_0x226c('0x5a')]);_0x5524c5({'count':_0x2ad739[_0x226c('0x17')],'rows':_0x2ad739});});},'FaxQueuesWaitingInteractions':function(_0x6ef63d){return new Promise(function(_0x2d0155,_0x5aa822){var _0x15f1de=_[_0x226c('0x4b')](_0x4eb557['faxQueuesWaitingInteractions']);_0x2d0155({'count':_0x15f1de[_0x226c('0x17')],'rows':_0x15f1de});});},'WhatsappQueuesWaitingInteractions':function(_0x43088a){return new Promise(function(_0x13f463,_0x1558cc){var _0x454ee0=_[_0x226c('0x4b')](_0x4eb557[_0x226c('0x5b')]);_0x13f463({'count':_0x454ee0[_0x226c('0x17')],'rows':_0x454ee0});});}};var _0x28ede7=jayson[_0x226c('0x5c')](_0x15e13b)[_0x226c('0x5d')]();_0x28ede7['on'](_0x226c('0x3a'),function(_0x27fdbd){logger[_0x226c('0x3a')](JSON[_0x226c('0x5e')](_0x27fdbd));return _0x3cff57(_0x27fdbd);});_0x28ede7['listen'](0x232c,'127.0.0.1',function(){console[_0x226c('0x5f')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x21d61b(_0x226c('0x60')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 7d3cb1f..a322948 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 _0xc5ec=['when','log','stack','jayson/promise','client','http','request','then','error','message','result','catch','condition','rules','stop','length','push','Command','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20'];(function(_0x5954d2,_0x15db93){var _0x316928=function(_0x278bd3){while(--_0x278bd3){_0x5954d2['push'](_0x5954d2['shift']());}};_0x316928(++_0x15db93);}(_0xc5ec,0x11b));var _0xcc5e=function(_0x177157,_0x25db18){_0x177157=_0x177157-0x0;var _0x42c18f=_0xc5ec[_0x177157];return _0x42c18f;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require(_0xcc5e('0x0'));var _=require('lodash');var logger=require('../../../config/logger')('routing');var client=jayson[_0xcc5e('0x1')][_0xcc5e('0x2')]({'port':0x232a});function request(_0x33b663,_0x2d21d1){return new BPromise(function(_0x120029,_0x2d7060){return client[_0xcc5e('0x3')](_0x33b663,_0x2d21d1)[_0xcc5e('0x4')](function(_0x5139a0){if(_0x5139a0[_0xcc5e('0x5')]){return _0x2d7060(_0x5139a0[_0xcc5e('0x5')][_0xcc5e('0x6')]);}else{return _0x120029(_0x5139a0[_0xcc5e('0x7')]);}})[_0xcc5e('0x8')](function(_0x588693){return _0x2d7060(_0x588693);});});}exports[_0xcc5e('0x9')]=function(_0x3699e2,_0x2114fa,_0x373f7d){return function(_0x206fc1){if(_0x373f7d[_0xcc5e('0xa')]&&!_0x373f7d['rules'][_0x3699e2]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x3699e2);return _0x206fc1[_0xcc5e('0xb')]();}var _0x173e35=[];for(var _0x6eb8fc=0x0;_0x6eb8fc<_0x2114fa[_0xcc5e('0xc')];_0x6eb8fc+=0x1){_0x173e35[_0xcc5e('0xd')](request(_0xcc5e('0xe'),{'command':util['format'](_0xcc5e('0xf'),_0x2114fa[_0x6eb8fc])})['then'](function(_0x210ce0){return _0x210ce0&&_0x210ce0[_0xcc5e('0x6')]&&_0x210ce0['message'][_0xcc5e('0x10')](_0xcc5e('0x11'))>=0x0?!![]:![];})['catch'](function(_0x4c915c){logger['error'](_0xcc5e('0x12'),_0x3699e2,_0x2114fa[_0x6eb8fc]);}));}BPromise[_0xcc5e('0x13')](_0x173e35)['then'](function(_0x15e056){var _0x545a5d=_[_0xcc5e('0x14')](_0x15e056);logger[_0xcc5e('0x15')](_0xcc5e('0x16'),_0x3699e2,_0x2114fa[_0xcc5e('0x17')](_0xcc5e('0x18')),_0x545a5d);_0x206fc1[_0xcc5e('0x19')](_0x545a5d);})[_0xcc5e('0x8')](function(_0x1260c5){console[_0xcc5e('0x1a')](_0x1260c5);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x3699e2,_0x2114fa[_0xcc5e('0x17')](_0xcc5e('0x18')),_0x1260c5[_0xcc5e('0x1b')]);_0x206fc1[_0xcc5e('0xb')]();});};}; \ No newline at end of file +var _0x0260=['then','message','indexOf','[%s][INTERVAL]\x20%s','all','join','\x20|\x20','log','[%s][INTERVAL]\x20%s\x20%s','util','bluebird','lodash','routing','request','error','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','iftime\x20%s'];(function(_0x16e33e,_0x4d6a4a){var _0xce79fe=function(_0x2cc6c6){while(--_0x2cc6c6){_0x16e33e['push'](_0x16e33e['shift']());}};_0xce79fe(++_0x4d6a4a);}(_0x0260,0x1d1));var _0x0026=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x0260[_0x4b2436];return _0x4f5ab2;};'use strict';var util=require(_0x0026('0x0'));var BPromise=require(_0x0026('0x1'));var jayson=require('jayson/promise');var _=require(_0x0026('0x2'));var logger=require('../../../config/logger')(_0x0026('0x3'));var client=jayson['client']['http']({'port':0x232a});function request(_0x2dcd99,_0x211587){return new BPromise(function(_0x4dc265,_0x33e3ee){return client[_0x0026('0x4')](_0x2dcd99,_0x211587)['then'](function(_0x517410){if(_0x517410['error']){return _0x33e3ee(_0x517410[_0x0026('0x5')]['message']);}else{return _0x4dc265(_0x517410['result']);}})[_0x0026('0x6')](function(_0x413bcd){return _0x33e3ee(_0x413bcd);});});}exports[_0x0026('0x7')]=function(_0x167908,_0xf8b2bb,_0x10d3d5){return function(_0x4d2f22){if(_0x10d3d5[_0x0026('0x8')]&&!_0x10d3d5[_0x0026('0x8')][_0x167908]){logger[_0x0026('0x9')](_0x0026('0xa'),_0x167908);return _0x4d2f22[_0x0026('0xb')]();}var _0x37c107=[];for(var _0xb5dd24=0x0;_0xb5dd24<_0xf8b2bb[_0x0026('0xc')];_0xb5dd24+=0x1){_0x37c107[_0x0026('0xd')](request('Command',{'command':util['format'](_0x0026('0xe'),_0xf8b2bb[_0xb5dd24])})[_0x0026('0xf')](function(_0x4a15d3){return _0x4a15d3&&_0x4a15d3['message']&&_0x4a15d3[_0x0026('0x10')][_0x0026('0x11')]('true')>=0x0?!![]:![];})[_0x0026('0x6')](function(_0xdb9abe){logger['error'](_0x0026('0x12'),_0x167908,_0xf8b2bb[_0xb5dd24]);}));}BPromise[_0x0026('0x13')](_0x37c107)[_0x0026('0xf')](function(_0x59f817){var _0x29e113=_['some'](_0x59f817);logger[_0x0026('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0x167908,_0xf8b2bb[_0x0026('0x14')](_0x0026('0x15')),_0x29e113);_0x4d2f22['when'](_0x29e113);})[_0x0026('0x6')](function(_0x4a470b){console[_0x0026('0x16')](_0x4a470b);logger['error'](_0x0026('0x17'),_0x167908,_0xf8b2bb[_0x0026('0x14')]('\x20|\x20'),_0x4a470b['stack']);_0x4d2f22[_0x0026('0xb')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 59f1443..2515f63 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 _0xa75b=['agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','origtransfererexten','transfereeuniqueid','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','secondtransfererexten','transfertargetuniqueid','agententerreason','agentcalledAt','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','complete','lodash','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','[%s][agents][agentcalled]','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','isNil','agentringnoanswer','agentringnoanswerAt','timeout','reason','holdtime','talktime','error','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]'];(function(_0x57c7e5,_0x5430c5){var _0x276066=function(_0xeaa954){while(--_0xeaa954){_0x57c7e5['push'](_0x57c7e5['shift']());}};_0x276066(++_0x5430c5);}(_0xa75b,0x170));var _0xba75=function(_0x5b4780,_0x516c27){_0x5b4780=_0x5b4780-0x0;var _0x196813=_0xa75b[_0x5b4780];return _0x196813;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x10c0dd,_0x39dc19){utils[_0xba75('0x1')](util[_0xba75('0x2')](_0xba75('0x3'),_0x10c0dd[_0xba75('0x4')],_0x10c0dd[_0xba75('0x5')],_0x10c0dd[_0xba75('0x6')],_0x10c0dd[_0xba75('0x7')],_0x10c0dd[_0xba75('0x8')],_0x10c0dd[_0xba75('0x9')],_0x10c0dd[_0xba75('0xa')],_0x10c0dd[_0xba75('0xb')]));if(_0x10c0dd['queue']){utils['getVoiceQueueByName'](_0x10c0dd[_0xba75('0x6')])['then'](function(_0x5c5fd7){if(_0x5c5fd7){_0x10c0dd[_0xba75('0xc')]=_0x5c5fd7['type'];_0x10c0dd[_0xba75('0xd')]=_0x10c0dd[_0xba75('0xe')]?_0x5c5fd7[_0xba75('0xf')]:![];_0x10c0dd[_0xba75('0x10')]=_0x10c0dd[_0xba75('0xd')]?_0x5c5fd7[_0xba75('0x11')]:0x0;}utils[_0xba75('0x12')](_0xba75('0x13'),_0x10c0dd);});}else{utils[_0xba75('0x12')](_0xba75('0x13'),_0x10c0dd);}if(_0x39dc19){delete transfers[_0x10c0dd[_0xba75('0x4')]];}else{delete agents[_0x10c0dd[_0xba75('0x14')]];}}exports['agentcalled']=function(_0x55553a){try{utils[_0xba75('0x15')](util['format'](_0xba75('0x16'),_0x55553a[_0xba75('0x4')]),_0x55553a);agents[_0x55553a[_0xba75('0x14')]]=_0x55553a;agents[_0x55553a[_0xba75('0x14')]]['agentcalledAt']=utils[_0xba75('0x17')]();agents[_0x55553a[_0xba75('0x14')]][_0xba75('0xb')]=_0xba75('0x18');agents[_0x55553a[_0xba75('0x14')]]['connectedlinenum']=null;agents[_0x55553a[_0xba75('0x14')]][_0xba75('0x19')]=null;utils[_0xba75('0x1')](util['format'](_0xba75('0x1a'),_0x55553a[_0xba75('0x4')],agents[_0x55553a[_0xba75('0x14')]][_0xba75('0x7')],_0x55553a[_0xba75('0x14')]));}catch(_0x1d1c44){utils['error'](util[_0xba75('0x2')](_0xba75('0x16'),_0x55553a['uniqueid']),_0x1d1c44);}};exports['agentringnoanswer']=function(_0x35ffd2){try{if(!_[_0xba75('0x1b')](agents[_0x35ffd2['destuniqueid']])){utils['debug'](util[_0xba75('0x2')]('[%s][agents][agentringnoanswer]',_0x35ffd2[_0xba75('0x4')]),_0x35ffd2);utils[_0xba75('0x1')](util[_0xba75('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x35ffd2[_0xba75('0x4')],agents[_0x35ffd2[_0xba75('0x14')]][_0xba75('0x7')],_0x35ffd2[_0xba75('0x14')]));agents[_0x35ffd2[_0xba75('0x14')]][_0xba75('0x1c')]=!![];agents[_0x35ffd2['destuniqueid']][_0xba75('0x1d')]=utils[_0xba75('0x17')]();agents[_0x35ffd2[_0xba75('0x14')]][_0xba75('0xb')]=_0xba75('0x1e');agents[_0x35ffd2[_0xba75('0x14')]][_0xba75('0x1f')]=_0xba75('0x1e');agents[_0x35ffd2[_0xba75('0x14')]][_0xba75('0x20')]=_0x35ffd2['ringtime']?parseInt(_0x35ffd2['ringtime'])/0x3e8:0x0;agents[_0x35ffd2['destuniqueid']][_0xba75('0x21')]=0x0;unanswered['push'](_0x35ffd2[_0xba75('0x14')]);}}catch(_0x58ea2d){utils[_0xba75('0x22')](util[_0xba75('0x2')](_0xba75('0x23'),_0x35ffd2['uniqueid']),_0x58ea2d);}};exports[_0xba75('0x24')]=function(_0x62cf49){try{_[_0xba75('0x25')](agents,function(_0x2808f0,_0x5d9f78){if(_0x2808f0['uniqueid']==_0x62cf49[_0xba75('0x4')]&&!_['includes'](unanswered,_0x2808f0[_0xba75('0x14')])){utils[_0xba75('0x15')](util[_0xba75('0x2')](_0xba75('0x26'),_0x62cf49['uniqueid']),_0x62cf49);utils[_0xba75('0x1')](util[_0xba75('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x62cf49[_0xba75('0x4')],_0x2808f0[_0xba75('0x7')],_0x2808f0[_0xba75('0x14')]));_0x2808f0[_0xba75('0x1c')]=!![];_0x2808f0['agentringnoanswerAt']=utils[_0xba75('0x17')]();_0x2808f0[_0xba75('0xb')]='abandoned';_0x2808f0[_0xba75('0x1f')]=_0xba75('0x27');_0x2808f0[_0xba75('0x20')]=_0x62cf49['holdtime'];_0x2808f0[_0xba75('0x21')]=0x0;writeDB(_0x2808f0);}});}catch(_0x282f98){utils[_0xba75('0x22')](util[_0xba75('0x2')](_0xba75('0x26'),_0x62cf49[_0xba75('0x4')]),_0x282f98);}};exports[_0xba75('0x28')]=function(_0x4c9fb2){try{if(agents[_0x4c9fb2['destuniqueid']]){utils[_0xba75('0x15')](util[_0xba75('0x2')](_0xba75('0x29'),_0x4c9fb2['uniqueid']),_0x4c9fb2);utils[_0xba75('0x1')](util[_0xba75('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x4c9fb2['uniqueid'],agents[_0x4c9fb2[_0xba75('0x14')]][_0xba75('0x7')],_0x4c9fb2[_0xba75('0x14')]));agents[_0x4c9fb2[_0xba75('0x14')]][_0xba75('0x2a')]=utils['now']();agents[_0x4c9fb2['destuniqueid']][_0xba75('0xa')]=_0x4c9fb2[_0xba75('0xa')];agents[_0x4c9fb2[_0xba75('0x14')]][_0xba75('0x19')]=_0x4c9fb2[_0xba75('0x19')];agents[_0x4c9fb2[_0xba75('0x14')]][_0xba75('0x20')]=_0x4c9fb2['ringtime'];agents[_0x4c9fb2[_0xba75('0x14')]][_0xba75('0xb')]='connect';_[_0xba75('0x25')](agents,function(_0x3740bd,_0x2d56c0){if(_0x3740bd[_0xba75('0x14')]!=_0x4c9fb2[_0xba75('0x14')]&&_0x3740bd[_0xba75('0x4')]==_0x4c9fb2[_0xba75('0x4')]){_0x3740bd['talktime']=0x0;_0x3740bd[_0xba75('0x20')]=_0x4c9fb2['ringtime'];_0x3740bd[_0xba75('0x1c')]=!![];_0x3740bd['agentringnoanswerAt']=utils[_0xba75('0x17')]();_0x3740bd[_0xba75('0xb')]=_0xba75('0x2b');_0x3740bd[_0xba75('0x1f')]=_0xba75('0x2b');_0x3740bd[_0xba75('0x2c')]=_0x4c9fb2[_0xba75('0x14')];_0x3740bd[_0xba75('0x2d')]=_0x4c9fb2[_0xba75('0x7')];writeDB(_0x3740bd);}});}}catch(_0x5c7c7f){utils[_0xba75('0x22')](util[_0xba75('0x2')]('[%s][agents][agentconnect]',_0x4c9fb2[_0xba75('0x4')]),_0x5c7c7f);}};exports[_0xba75('0xe')]=function(_0x1130ac){try{if(!_['isNil'](agents[_0x1130ac['destuniqueid']])){utils['debug'](util['format'](_0xba75('0x2e'),_0x1130ac['uniqueid']),_0x1130ac);utils[_0xba75('0x1')](util[_0xba75('0x2')](_0xba75('0x2f'),_0x1130ac[_0xba75('0x4')],agents[_0x1130ac[_0xba75('0x14')]]['membername'],_0x1130ac['destuniqueid']));agents[_0x1130ac[_0xba75('0x14')]]['agentcomplete']=!![];agents[_0x1130ac[_0xba75('0x14')]]['agentcompleteAt']=utils[_0xba75('0x17')]();agents[_0x1130ac[_0xba75('0x14')]][_0xba75('0x21')]=utils[_0xba75('0x30')](agents[_0x1130ac['destuniqueid']][_0xba75('0x31')],agents[_0x1130ac[_0xba75('0x14')]][_0xba75('0x2a')]);agents[_0x1130ac[_0xba75('0x14')]][_0xba75('0x1f')]=_0x1130ac[_0xba75('0x1f')];agents[_0x1130ac[_0xba75('0x14')]][_0xba75('0xb')]='complete';writeDB(agents[_0x1130ac[_0xba75('0x14')]]);}}catch(_0x3fe479){utils[_0xba75('0x22')](util[_0xba75('0x2')](_0xba75('0x2e'),_0x1130ac['uniqueid']),_0x3fe479);}};exports[_0xba75('0x32')]=function(_0x25ae33){try{if(!_[_0xba75('0x1b')](agents[_0x25ae33[_0xba75('0x33')]])){utils[_0xba75('0x15')](util[_0xba75('0x2')](_0xba75('0x34'),_0x25ae33['uniqueid']),_0x25ae33);utils[_0xba75('0x1')](util[_0xba75('0x2')](_0xba75('0x35'),_0x25ae33['uniqueid'],agents[_0x25ae33[_0xba75('0x33')]][_0xba75('0x7')],agents[_0x25ae33['transfereruniqueid']]['uniqueid']));agents[_0x25ae33[_0xba75('0x33')]]['transfer']=!![];agents[_0x25ae33['transfereruniqueid']][_0xba75('0x36')]='blind';agents[_0x25ae33[_0xba75('0x33')]][_0xba75('0x37')]=_0x25ae33[_0xba75('0x38')];agents[_0x25ae33[_0xba75('0x33')]][_0xba75('0x39')]=agents[_0x25ae33['transfereruniqueid']][_0xba75('0x4')];}}catch(_0x3dee66){utils['error'](util[_0xba75('0x2')](_0xba75('0x34'),_0x25ae33[_0xba75('0x4')]),_0x3dee66);}};exports[_0xba75('0x3a')]=function(_0x322fdb){try{utils['debug'](util[_0xba75('0x2')](_0xba75('0x3b'),_0x322fdb['origtransfereruniqueid']),_0x322fdb);if(_0x322fdb[_0xba75('0x3c')]==_0x322fdb[_0xba75('0x3d')]){if(!_[_0xba75('0x1b')](agents[_0x322fdb[_0xba75('0x3e')]])){utils[_0xba75('0x1')](util[_0xba75('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x322fdb[_0xba75('0x3c')],agents[_0x322fdb[_0xba75('0x3e')]][_0xba75('0x7')]));agents[_0x322fdb[_0xba75('0x3e')]][_0xba75('0x3f')]=!![];agents[_0x322fdb[_0xba75('0x3e')]]['transfertype']='ATTENDED';agents[_0x322fdb['secondtransfereruniqueid']]['transferexten']=_0x322fdb[_0xba75('0x40')];agents[_0x322fdb[_0xba75('0x3e')]][_0xba75('0x39')]=_0x322fdb[_0xba75('0x3c')];}if(_0x322fdb[_0xba75('0x41')]&&agents[_0x322fdb[_0xba75('0x41')]]){agents[_0x322fdb[_0xba75('0x41')]]['agententerreason']=0x1;transfers[_0x322fdb[_0xba75('0x41')]]=_[_0xba75('0x42')](agents[_0x322fdb[_0xba75('0x41')]]);transfers[_0x322fdb[_0xba75('0x41')]]['calleridnum']=agents[_0x322fdb[_0xba75('0x3e')]][_0xba75('0x9')];transfers[_0x322fdb['transfereeuniqueid']][_0xba75('0x43')]=agents[_0x322fdb['secondtransfereruniqueid']][_0xba75('0x43')];transfers[_0x322fdb[_0xba75('0x41')]]['agentcalledAt']=utils[_0xba75('0x17')]();transfers[_0x322fdb[_0xba75('0x41')]]['agentconnectAt']=utils['now']();transfers[_0x322fdb[_0xba75('0x41')]]['holdtime']=0x0;transfers[_0x322fdb[_0xba75('0x41')]]['agententerreason']=0x2;}}else if(_0x322fdb[_0xba75('0x3e')]==_0x322fdb[_0xba75('0x44')]){if(!_[_0xba75('0x1b')](agents[_0x322fdb[_0xba75('0x3c')]])){utils[_0xba75('0x1')](util['format'](_0xba75('0x45'),_0x322fdb[_0xba75('0x3c')],agents[_0x322fdb['origtransfereruniqueid']][_0xba75('0x7')]));agents[_0x322fdb[_0xba75('0x3c')]][_0xba75('0x3f')]=!![];agents[_0x322fdb[_0xba75('0x3c')]][_0xba75('0x36')]=_0xba75('0x46');agents[_0x322fdb[_0xba75('0x3c')]][_0xba75('0x37')]=_0x322fdb[_0xba75('0x47')];agents[_0x322fdb[_0xba75('0x3c')]][_0xba75('0x39')]=_0x322fdb[_0xba75('0x3e')];}if(_0x322fdb['transfertargetuniqueid']&&agents[_0x322fdb['transfertargetuniqueid']]){agents[_0x322fdb[_0xba75('0x48')]][_0xba75('0x49')]=0x1;transfers[_0x322fdb[_0xba75('0x48')]]=_[_0xba75('0x42')](agents[_0x322fdb[_0xba75('0x48')]]);transfers[_0x322fdb[_0xba75('0x48')]][_0xba75('0x9')]=agents[_0x322fdb[_0xba75('0x3c')]][_0xba75('0x9')];transfers[_0x322fdb[_0xba75('0x48')]][_0xba75('0x43')]=agents[_0x322fdb['origtransfereruniqueid']][_0xba75('0x43')];transfers[_0x322fdb['transfertargetuniqueid']][_0xba75('0x4a')]=utils[_0xba75('0x17')]();transfers[_0x322fdb[_0xba75('0x48')]][_0xba75('0x2a')]=utils[_0xba75('0x17')]();transfers[_0x322fdb[_0xba75('0x48')]]['holdtime']=0x0;transfers[_0x322fdb[_0xba75('0x48')]]['agententerreason']=0x2;}}}catch(_0x8519a1){utils[_0xba75('0x22')](util['format']('[%s][agents][attendedtransfer]',_0x322fdb[_0xba75('0x3c')]),_0x8519a1);}};exports[_0xba75('0x4b')]=function(_0x30ef23){try{utils[_0xba75('0x15')](util[_0xba75('0x2')](_0xba75('0x4c'),_0x30ef23['uniqueid']),_0x30ef23);if(agents[_0x30ef23[_0xba75('0x4')]]&&agents[_0x30ef23[_0xba75('0x4')]]['reason']===_0xba75('0x1e')){if(_0x30ef23[_0xba75('0x4d')]==='21'){agents[_0x30ef23[_0xba75('0x4')]][_0xba75('0x1f')]=_0xba75('0x4e');agents[_0x30ef23['uniqueid']][_0xba75('0xb')]='rejected';}utils[_0xba75('0x1')](util[_0xba75('0x2')](_0xba75('0x4f'),_0x30ef23[_0xba75('0x4')],agents[_0x30ef23[_0xba75('0x4')]][_0xba75('0x7')],agents[_0x30ef23['uniqueid']]['reason'],agents[_0x30ef23[_0xba75('0x4')]]['lastevent']));writeDB(agents[_0x30ef23[_0xba75('0x4')]]);var _0x4707ef=unanswered['indexOf'](_0x30ef23[_0xba75('0x4')]);if(_0x4707ef>-0x1){unanswered[_0xba75('0x50')](_0x4707ef,0x1);}}if(transfers[_0x30ef23[_0xba75('0x4')]]){transfers[_0x30ef23['uniqueid']]['agentcomplete']=!![];transfers[_0x30ef23['uniqueid']]['agentcompleteAt']=utils['now']();transfers[_0x30ef23[_0xba75('0x4')]]['talktime']=utils[_0xba75('0x30')](transfers[_0x30ef23[_0xba75('0x4')]][_0xba75('0x31')],transfers[_0x30ef23[_0xba75('0x4')]][_0xba75('0x2a')]);transfers[_0x30ef23[_0xba75('0x4')]][_0xba75('0x1f')]='agent';transfers[_0x30ef23['uniqueid']][_0xba75('0xb')]=_0xba75('0x51');utils['info'](util[_0xba75('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x30ef23[_0xba75('0x4')],transfers[_0x30ef23[_0xba75('0x4')]]['membername'],transfers[_0x30ef23[_0xba75('0x4')]]['reason'],transfers[_0x30ef23[_0xba75('0x4')]][_0xba75('0xb')]));writeDB(transfers[_0x30ef23['uniqueid']],!![]);}if(agents[_0x30ef23[_0xba75('0x4')]]&&agents[_0x30ef23[_0xba75('0x4')]][_0xba75('0x2a')]){agents[_0x30ef23[_0xba75('0x4')]][_0xba75('0xe')]=!![];agents[_0x30ef23[_0xba75('0x4')]][_0xba75('0x31')]=utils[_0xba75('0x17')]();agents[_0x30ef23['uniqueid']][_0xba75('0x21')]=utils[_0xba75('0x30')](agents[_0x30ef23['uniqueid']]['agentcompleteAt'],agents[_0x30ef23['uniqueid']][_0xba75('0x2a')]);agents[_0x30ef23['uniqueid']][_0xba75('0x1f')]=agents[_0x30ef23['uniqueid']][_0xba75('0x3f')]?'transfer':'agent';agents[_0x30ef23[_0xba75('0x4')]]['lastevent']=_0xba75('0x51');utils['info'](util['format'](_0xba75('0x4f'),_0x30ef23['uniqueid'],agents[_0x30ef23[_0xba75('0x4')]]['membername'],agents[_0x30ef23[_0xba75('0x4')]][_0xba75('0x1f')],agents[_0x30ef23[_0xba75('0x4')]]['lastevent']));writeDB(agents[_0x30ef23[_0xba75('0x4')]]);}}catch(_0x1de4a3){utils['error'](util[_0xba75('0x2')]('[%s][agents][hangup]',_0x30ef23['uniqueid']),_0x1de4a3);}}; \ No newline at end of file +var _0x76dc=['origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','agent','complete','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','format','uniqueid','membername','interface','calleridnum','queue','getVoiceQueueByName','type','agentcomplete','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','now','lastevent','called','connectedlinenum','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','talktime','queuecallerabandon','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','ringtime','connect','answered_elsewhere','answeredelsewheremembername','isNil','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][blindtransfer]','[%s][agents][attendedtransfer]','origtransfereruniqueid'];(function(_0x297acf,_0x530d6c){var _0x2dd757=function(_0x1b7aa9){while(--_0x1b7aa9){_0x297acf['push'](_0x297acf['shift']());}};_0x2dd757(++_0x530d6c);}(_0x76dc,0x1f2));var _0xc76d=function(_0x2e1125,_0x3e0eaa){_0x2e1125=_0x2e1125-0x0;var _0x28fdb6=_0x76dc[_0x2e1125];return _0x28fdb6;};'use strict';var _=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var utils=require(_0xc76d('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x26e85e,_0x49c651){utils[_0xc76d('0x3')](util[_0xc76d('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x26e85e[_0xc76d('0x5')],_0x26e85e['channel'],_0x26e85e['queue'],_0x26e85e[_0xc76d('0x6')],_0x26e85e[_0xc76d('0x7')],_0x26e85e[_0xc76d('0x8')],_0x26e85e['connectedlinenum'],_0x26e85e['lastevent']));if(_0x26e85e[_0xc76d('0x9')]){utils[_0xc76d('0xa')](_0x26e85e[_0xc76d('0x9')])['then'](function(_0x570197){if(_0x570197){_0x26e85e[_0xc76d('0xb')]=_0x570197[_0xc76d('0xb')];_0x26e85e['agentacw']=_0x26e85e[_0xc76d('0xc')]?_0x570197['acw']:![];_0x26e85e[_0xc76d('0xd')]=_0x26e85e[_0xc76d('0xe')]?_0x570197[_0xc76d('0xf')]:0x0;}utils[_0xc76d('0x10')](_0xc76d('0x11'),_0x26e85e);});}else{utils[_0xc76d('0x10')](_0xc76d('0x11'),_0x26e85e);}if(_0x49c651){delete transfers[_0x26e85e[_0xc76d('0x5')]];}else{delete agents[_0x26e85e[_0xc76d('0x12')]];}}exports[_0xc76d('0x13')]=function(_0x1a7b47){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x15'),_0x1a7b47['uniqueid']),_0x1a7b47);agents[_0x1a7b47[_0xc76d('0x12')]]=_0x1a7b47;agents[_0x1a7b47[_0xc76d('0x12')]]['agentcalledAt']=utils[_0xc76d('0x16')]();agents[_0x1a7b47[_0xc76d('0x12')]][_0xc76d('0x17')]=_0xc76d('0x18');agents[_0x1a7b47['destuniqueid']][_0xc76d('0x19')]=null;agents[_0x1a7b47['destuniqueid']]['connectedlinename']=null;utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x1a'),_0x1a7b47[_0xc76d('0x5')],agents[_0x1a7b47[_0xc76d('0x12')]]['membername'],_0x1a7b47[_0xc76d('0x12')]));}catch(_0x361f42){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x15'),_0x1a7b47['uniqueid']),_0x361f42);}};exports[_0xc76d('0x1c')]=function(_0x324db7){try{if(!_['isNil'](agents[_0x324db7[_0xc76d('0x12')]])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x1d'),_0x324db7[_0xc76d('0x5')]),_0x324db7);utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x1e'),_0x324db7[_0xc76d('0x5')],agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x6')],_0x324db7['destuniqueid']));agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x1c')]=!![];agents[_0x324db7['destuniqueid']][_0xc76d('0x1f')]=utils[_0xc76d('0x16')]();agents[_0x324db7['destuniqueid']][_0xc76d('0x17')]=_0xc76d('0x20');agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x21')]=_0xc76d('0x20');agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x22')]=_0x324db7['ringtime']?parseInt(_0x324db7['ringtime'])/0x3e8:0x0;agents[_0x324db7[_0xc76d('0x12')]][_0xc76d('0x23')]=0x0;unanswered['push'](_0x324db7[_0xc76d('0x12')]);}}catch(_0x52a79a){utils[_0xc76d('0x1b')](util['format'](_0xc76d('0x1d'),_0x324db7['uniqueid']),_0x52a79a);}};exports[_0xc76d('0x24')]=function(_0x18a7fa){try{_['forIn'](agents,function(_0x3d4076,_0x1c68f3){if(_0x3d4076[_0xc76d('0x5')]==_0x18a7fa[_0xc76d('0x5')]&&!_['includes'](unanswered,_0x3d4076[_0xc76d('0x12')])){utils['debug'](util[_0xc76d('0x4')]('[%s][agents][queuecallerabandon]',_0x18a7fa[_0xc76d('0x5')]),_0x18a7fa);utils[_0xc76d('0x3')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x18a7fa['uniqueid'],_0x3d4076['membername'],_0x3d4076[_0xc76d('0x12')]));_0x3d4076[_0xc76d('0x1c')]=!![];_0x3d4076[_0xc76d('0x1f')]=utils[_0xc76d('0x16')]();_0x3d4076[_0xc76d('0x17')]='abandoned';_0x3d4076[_0xc76d('0x21')]='abandoned';_0x3d4076[_0xc76d('0x22')]=_0x18a7fa['holdtime'];_0x3d4076[_0xc76d('0x23')]=0x0;writeDB(_0x3d4076);}});}catch(_0x2332f5){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x25'),_0x18a7fa['uniqueid']),_0x2332f5);}};exports[_0xc76d('0x26')]=function(_0x371306){try{if(agents[_0x371306[_0xc76d('0x12')]]){utils['debug'](util[_0xc76d('0x4')](_0xc76d('0x27'),_0x371306[_0xc76d('0x5')]),_0x371306);utils['info'](util[_0xc76d('0x4')](_0xc76d('0x28'),_0x371306[_0xc76d('0x5')],agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x6')],_0x371306[_0xc76d('0x12')]));agents[_0x371306['destuniqueid']]['agentconnectAt']=utils[_0xc76d('0x16')]();agents[_0x371306['destuniqueid']][_0xc76d('0x19')]=_0x371306[_0xc76d('0x19')];agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x29')]=_0x371306['connectedlinename'];agents[_0x371306['destuniqueid']][_0xc76d('0x22')]=_0x371306[_0xc76d('0x2a')];agents[_0x371306[_0xc76d('0x12')]][_0xc76d('0x17')]=_0xc76d('0x2b');_['forIn'](agents,function(_0x42404c,_0xb264b0){if(_0x42404c[_0xc76d('0x12')]!=_0x371306[_0xc76d('0x12')]&&_0x42404c[_0xc76d('0x5')]==_0x371306[_0xc76d('0x5')]){_0x42404c[_0xc76d('0x23')]=0x0;_0x42404c[_0xc76d('0x22')]=_0x371306[_0xc76d('0x2a')];_0x42404c[_0xc76d('0x1c')]=!![];_0x42404c['agentringnoanswerAt']=utils['now']();_0x42404c[_0xc76d('0x17')]=_0xc76d('0x2c');_0x42404c[_0xc76d('0x21')]=_0xc76d('0x2c');_0x42404c['answeredelsewheredestinationuniqueid']=_0x371306['destuniqueid'];_0x42404c[_0xc76d('0x2d')]=_0x371306[_0xc76d('0x6')];writeDB(_0x42404c);}});}}catch(_0x3e471e){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x27'),_0x371306[_0xc76d('0x5')]),_0x3e471e);}};exports[_0xc76d('0xc')]=function(_0x50e922){try{if(!_[_0xc76d('0x2e')](agents[_0x50e922[_0xc76d('0x12')]])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')]('[%s][agents][agentcomplete]',_0x50e922['uniqueid']),_0x50e922);utils['info'](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x50e922['uniqueid'],agents[_0x50e922['destuniqueid']][_0xc76d('0x6')],_0x50e922[_0xc76d('0x12')]));agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0xc')]=!![];agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();agents[_0x50e922[_0xc76d('0x12')]]['talktime']=utils[_0xc76d('0x30')](agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x2f')],agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x31')]);agents[_0x50e922[_0xc76d('0x12')]][_0xc76d('0x21')]=_0x50e922[_0xc76d('0x21')];agents[_0x50e922[_0xc76d('0x12')]]['lastevent']='complete';writeDB(agents[_0x50e922[_0xc76d('0x12')]]);}}catch(_0x170f47){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x32'),_0x50e922['uniqueid']),_0x170f47);}};exports[_0xc76d('0x33')]=function(_0x1ede13){try{if(!_['isNil'](agents[_0x1ede13['transfereruniqueid']])){utils[_0xc76d('0x14')](util[_0xc76d('0x4')]('[%s][agents][blindtransfer]',_0x1ede13[_0xc76d('0x5')]),_0x1ede13);utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x34'),_0x1ede13[_0xc76d('0x5')],agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x6')],agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x5')]));agents[_0x1ede13[_0xc76d('0x35')]]['transfer']=!![];agents[_0x1ede13[_0xc76d('0x35')]][_0xc76d('0x36')]=_0xc76d('0x37');agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x38')]=_0x1ede13[_0xc76d('0x39')];agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x3a')]=agents[_0x1ede13['transfereruniqueid']][_0xc76d('0x5')];}}catch(_0x12c972){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')](_0xc76d('0x3b'),_0x1ede13['uniqueid']),_0x12c972);}};exports['attendedtransfer']=function(_0x5bec6c){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x3c'),_0x5bec6c[_0xc76d('0x3d')]),_0x5bec6c);if(_0x5bec6c[_0xc76d('0x3d')]==_0x5bec6c[_0xc76d('0x3e')]){if(!_['isNil'](agents[_0x5bec6c[_0xc76d('0x3f')]])){utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x40'),_0x5bec6c[_0xc76d('0x3d')],agents[_0x5bec6c['secondtransfereruniqueid']][_0xc76d('0x6')]));agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x41')]=!![];agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x36')]=_0xc76d('0x42');agents[_0x5bec6c['secondtransfereruniqueid']][_0xc76d('0x38')]=_0x5bec6c[_0xc76d('0x43')];agents[_0x5bec6c['secondtransfereruniqueid']]['transferuniqueid']=_0x5bec6c[_0xc76d('0x3d')];}if(_0x5bec6c['transfereeuniqueid']&&agents[_0x5bec6c[_0xc76d('0x44')]]){agents[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x45')]=0x1;transfers[_0x5bec6c[_0xc76d('0x44')]]=_[_0xc76d('0x46')](agents[_0x5bec6c[_0xc76d('0x44')]]);transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x8')]=agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x8')];transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x47')]=agents[_0x5bec6c[_0xc76d('0x3f')]][_0xc76d('0x47')];transfers[_0x5bec6c['transfereeuniqueid']][_0xc76d('0x48')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x44')]][_0xc76d('0x31')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c['transfereeuniqueid']][_0xc76d('0x22')]=0x0;transfers[_0x5bec6c[_0xc76d('0x44')]]['agententerreason']=0x2;}}else if(_0x5bec6c['secondtransfereruniqueid']==_0x5bec6c['secondtransfererlinkedid']){if(!_[_0xc76d('0x2e')](agents[_0x5bec6c[_0xc76d('0x3d')]])){utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x40'),_0x5bec6c[_0xc76d('0x3d')],agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x6')]));agents[_0x5bec6c['origtransfereruniqueid']][_0xc76d('0x41')]=!![];agents[_0x5bec6c['origtransfereruniqueid']]['transfertype']=_0xc76d('0x42');agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x38')]=_0x5bec6c['secondtransfererexten'];agents[_0x5bec6c[_0xc76d('0x3d')]]['transferuniqueid']=_0x5bec6c['secondtransfereruniqueid'];}if(_0x5bec6c['transfertargetuniqueid']&&agents[_0x5bec6c[_0xc76d('0x49')]]){agents[_0x5bec6c[_0xc76d('0x49')]]['agententerreason']=0x1;transfers[_0x5bec6c[_0xc76d('0x49')]]=_[_0xc76d('0x46')](agents[_0x5bec6c[_0xc76d('0x49')]]);transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x8')]=agents[_0x5bec6c[_0xc76d('0x3d')]][_0xc76d('0x8')];transfers[_0x5bec6c['transfertargetuniqueid']]['calleridname']=agents[_0x5bec6c['origtransfereruniqueid']][_0xc76d('0x47')];transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x48')]=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x49')]]['agentconnectAt']=utils[_0xc76d('0x16')]();transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x22')]=0x0;transfers[_0x5bec6c[_0xc76d('0x49')]][_0xc76d('0x45')]=0x2;}}}catch(_0x2af760){utils[_0xc76d('0x1b')](util[_0xc76d('0x4')]('[%s][agents][attendedtransfer]',_0x5bec6c[_0xc76d('0x3d')]),_0x2af760);}};exports['hangup']=function(_0xa9f2e8){try{utils[_0xc76d('0x14')](util[_0xc76d('0x4')](_0xc76d('0x4a'),_0xa9f2e8['uniqueid']),_0xa9f2e8);if(agents[_0xa9f2e8[_0xc76d('0x5')]]&&agents[_0xa9f2e8['uniqueid']]['reason']===_0xc76d('0x20')){if(_0xa9f2e8[_0xc76d('0x4b')]==='21'){agents[_0xa9f2e8['uniqueid']][_0xc76d('0x21')]=_0xc76d('0x4c');agents[_0xa9f2e8['uniqueid']][_0xc76d('0x17')]=_0xc76d('0x4c');}utils['info'](util[_0xc76d('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xa9f2e8[_0xc76d('0x5')],agents[_0xa9f2e8[_0xc76d('0x5')]]['membername'],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],agents[_0xa9f2e8['uniqueid']][_0xc76d('0x17')]));writeDB(agents[_0xa9f2e8[_0xc76d('0x5')]]);var _0x277382=unanswered['indexOf'](_0xa9f2e8[_0xc76d('0x5')]);if(_0x277382>-0x1){unanswered['splice'](_0x277382,0x1);}}if(transfers[_0xa9f2e8['uniqueid']]){transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0xc')]=!![];transfers[_0xa9f2e8['uniqueid']][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x23')]=utils[_0xc76d('0x30')](transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]);transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')]=_0xc76d('0x4d');transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x17')]=_0xc76d('0x4e');utils[_0xc76d('0x3')](util[_0xc76d('0x4')](_0xc76d('0x4f'),_0xa9f2e8[_0xc76d('0x5')],transfers[_0xa9f2e8[_0xc76d('0x5')]]['membername'],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],transfers[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x17')]));writeDB(transfers[_0xa9f2e8[_0xc76d('0x5')]],!![]);}if(agents[_0xa9f2e8[_0xc76d('0x5')]]&&agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]){agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0xc')]=!![];agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')]=utils[_0xc76d('0x16')]();agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x23')]=utils[_0xc76d('0x30')](agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x2f')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x31')]);agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')]=agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x41')]?'transfer':_0xc76d('0x4d');agents[_0xa9f2e8[_0xc76d('0x5')]]['lastevent']=_0xc76d('0x4e');utils[_0xc76d('0x3')](util['format'](_0xc76d('0x4f'),_0xa9f2e8[_0xc76d('0x5')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x6')],agents[_0xa9f2e8[_0xc76d('0x5')]][_0xc76d('0x21')],agents[_0xa9f2e8[_0xc76d('0x5')]]['lastevent']));writeDB(agents[_0xa9f2e8['uniqueid']]);}}catch(_0xe6a1dc){utils[_0xc76d('0x1b')](util['format'](_0xc76d('0x4a'),_0xa9f2e8[_0xc76d('0x5')]),_0xe6a1dc);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 2bbd2a3..3733d86 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 _0x8b0e=['[%s][calls][musiconholdstop]','mohtime','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmcs-queue','xmd-queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','substring','lastIndexOf','includes','noop','gotoif','lastapplication','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','channel','now','DOCUMENTATION','error','newstate','[%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','calleridname','duration','diffTime','endtime','starttime','[%s][calls][hangup]','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','origtransfererchannel','_attended','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop'];(function(_0x508acd,_0x852c77){var _0x4e8524=function(_0x10ea09){while(--_0x10ea09){_0x508acd['push'](_0x508acd['shift']());}};_0x4e8524(++_0x852c77);}(_0x8b0e,0x166));var _0xe8b0=function(_0x4da4ea,_0x2875d3){_0x4da4ea=_0x4da4ea-0x0;var _0x3cc102=_0x8b0e[_0x4da4ea];return _0x3cc102;};'use strict';var _=require(_0xe8b0('0x0'));var util=require(_0xe8b0('0x1'));var utils=require(_0xe8b0('0x2'));var transfers=require(_0xe8b0('0x3'));var dispositions=[_0xe8b0('0x4'),_0xe8b0('0x5'),'FAILED',_0xe8b0('0x4'),'NO\x20ANSWER',_0xe8b0('0x4'),_0xe8b0('0x6'),_0xe8b0('0x7'),_0xe8b0('0x5'),_0xe8b0('0x5'),_0xe8b0('0x5')];var channels={};function writeDB(_0x25faf7){var _0x2e56f4;if(transfers['blinds'][_0x25faf7[_0xe8b0('0x8')]]){_0x2e56f4=_0x25faf7[_0xe8b0('0x8')];_0x25faf7[_0xe8b0('0x8')]=transfers[_0xe8b0('0x9')][_0x25faf7[_0xe8b0('0x8')]][_0xe8b0('0xa')];}utils[_0xe8b0('0xb')](util[_0xe8b0('0xc')](_0xe8b0('0xd'),_0x25faf7['uniqueid'],_0x25faf7['channel'],_0x25faf7[_0xe8b0('0xe')],_0x25faf7[_0xe8b0('0xf')],_0x25faf7[_0xe8b0('0x10')],_0x25faf7['calleridnum'],_0x25faf7[_0xe8b0('0x11')],_0x25faf7[_0xe8b0('0x12')]));if(_0x25faf7[_0xe8b0('0x13')]){utils[_0xe8b0('0x14')](_0x25faf7[_0xe8b0('0x13')])[_0xe8b0('0x15')](function(_0x27c633){if(_0x27c633){_0x25faf7['UserId']=_0x27c633['id'];}utils[_0xe8b0('0x16')](_0xe8b0('0x17'),_0x25faf7);});}else{utils[_0xe8b0('0x16')]('CreateVoiceCallReport',_0x25faf7);}if(channels[_0x25faf7[_0xe8b0('0x8')]]){delete channels[_0x25faf7['uniqueid']];}else if(_0x2e56f4&&channels[_0x2e56f4]){if(!transfers['blinds'][_0x2e56f4]['recording'])delete transfers[_0xe8b0('0x9')][_0x2e56f4];delete channels[_0x2e56f4];}}exports[_0xe8b0('0x18')]=function(_0x4c1447){try{utils[_0xe8b0('0x19')](util[_0xe8b0('0xc')](_0xe8b0('0x1a'),_0x4c1447[_0xe8b0('0x8')]),_0x4c1447);if(_0x4c1447[_0xe8b0('0x8')]==_0x4c1447[_0xe8b0('0x1b')]&&_0x4c1447['channel']!='OutgoingSpoolFailed'){utils[_0xe8b0('0xb')](util[_0xe8b0('0xc')](_0xe8b0('0x1c'),_0x4c1447[_0xe8b0('0x8')],_0x4c1447[_0xe8b0('0x1d')],_0x4c1447[_0xe8b0('0x1e')]));channels[_0x4c1447[_0xe8b0('0x8')]]={'uniqueid':_0x4c1447[_0xe8b0('0x8')],'accountcode':_0x4c1447[_0xe8b0('0x13')],'source':_0x4c1447[_0xe8b0('0x1f')],'destination':_0x4c1447[_0xe8b0('0x1e')],'destinationcontext':_0x4c1447['context'],'channel':_0x4c1447[_0xe8b0('0x20')],'starttime':utils[_0xe8b0('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xe8b0('0x4'),'amaflags':_0xe8b0('0x22')};}}catch(_0x52072e){utils[_0xe8b0('0x23')](util[_0xe8b0('0xc')]('[%s][calls][newchannel]',_0x4c1447[_0xe8b0('0x8')]),_0x52072e);}};exports[_0xe8b0('0x24')]=function(_0x77c4b5){try{utils[_0xe8b0('0x19')](util['format'](_0xe8b0('0x25'),_0x77c4b5[_0xe8b0('0x8')]),_0x77c4b5);if(!_[_0xe8b0('0x26')](channels[_0x77c4b5[_0xe8b0('0x8')]])&&_0x77c4b5[_0xe8b0('0x27')]==0x6){utils[_0xe8b0('0xb')](util[_0xe8b0('0xc')](_0xe8b0('0x28'),_0x77c4b5[_0xe8b0('0x8')],_0x77c4b5[_0xe8b0('0x1d')],_0x77c4b5[_0xe8b0('0x20')]));if(_['isNil'](channels[_0x77c4b5['uniqueid']][_0xe8b0('0x29')])){channels[_0x77c4b5[_0xe8b0('0x8')]][_0xe8b0('0x29')]=utils[_0xe8b0('0x21')]();}}else if(!_[_0xe8b0('0x26')](channels[_0x77c4b5['linkedid']])&&_0x77c4b5[_0xe8b0('0x27')]==0x6&&_0x77c4b5['context']!=_0xe8b0('0x2a')){utils[_0xe8b0('0xb')](util[_0xe8b0('0xc')](_0xe8b0('0x2b'),_0x77c4b5['uniqueid'],_0x77c4b5[_0xe8b0('0x1b')],_0x77c4b5[_0xe8b0('0x1d')],_0x77c4b5[_0xe8b0('0x20')]));channels[_0x77c4b5[_0xe8b0('0x1b')]][_0xe8b0('0x13')]=_0x77c4b5['accountcode'];channels[_0x77c4b5[_0xe8b0('0x1b')]]['destinationchannel']=_0x77c4b5[_0xe8b0('0x20')];if(_[_0xe8b0('0x26')](channels[_0x77c4b5[_0xe8b0('0x1b')]][_0xe8b0('0x2c')])){channels[_0x77c4b5['linkedid']][_0xe8b0('0x2c')]=utils[_0xe8b0('0x21')]();}channels[_0x77c4b5[_0xe8b0('0x1b')]][_0xe8b0('0x2d')]=dispositions[_[_0xe8b0('0x2e')](_0x77c4b5[_0xe8b0('0x27')])]||_0xe8b0('0x6');}}catch(_0x4463fa){utils[_0xe8b0('0x23')](util[_0xe8b0('0xc')](_0xe8b0('0x25'),_0x77c4b5[_0xe8b0('0x8')]),_0x4463fa);}};exports[_0xe8b0('0x2f')]=function(_0x3fb21e){try{if(!_[_0xe8b0('0x26')](channels[_0x3fb21e['uniqueid']])){utils[_0xe8b0('0x19')](util[_0xe8b0('0xc')]('[%s][calls][hangup]',_0x3fb21e[_0xe8b0('0x8')]),_0x3fb21e);if(_[_0xe8b0('0x26')](channels[_0x3fb21e[_0xe8b0('0x8')]][_0xe8b0('0x30')])){channels[_0x3fb21e['uniqueid']]['callerid']=_0x3fb21e[_0xe8b0('0x31')]+'\x20<'+_0x3fb21e['calleridnum']+'>';}utils[_0xe8b0('0xb')](util[_0xe8b0('0xc')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x3fb21e[_0xe8b0('0x8')],channels[_0x3fb21e[_0xe8b0('0x8')]]['callerid'],_0x3fb21e['cause-txt']));channels[_0x3fb21e[_0xe8b0('0x8')]]['endtime']=utils[_0xe8b0('0x21')]();channels[_0x3fb21e[_0xe8b0('0x8')]][_0xe8b0('0x32')]=utils[_0xe8b0('0x33')](channels[_0x3fb21e[_0xe8b0('0x8')]][_0xe8b0('0x34')],channels[_0x3fb21e['uniqueid']][_0xe8b0('0x35')]);channels[_0x3fb21e[_0xe8b0('0x8')]]['billableseconds']=channels[_0x3fb21e[_0xe8b0('0x8')]][_0xe8b0('0x2c')]?utils[_0xe8b0('0x33')](channels[_0x3fb21e[_0xe8b0('0x8')]][_0xe8b0('0x34')],channels[_0x3fb21e[_0xe8b0('0x8')]][_0xe8b0('0x2c')]):0x0;writeDB(channels[_0x3fb21e[_0xe8b0('0x8')]]);}}catch(_0x4751d5){utils['error'](util[_0xe8b0('0xc')](_0xe8b0('0x36'),_0x3fb21e[_0xe8b0('0x8')]),_0x4751d5);}};exports[_0xe8b0('0x37')]=function(_0x476d37){try{if(!_['isNil'](channels[_0x476d37['localtwolinkedid']])){utils[_0xe8b0('0x19')](util[_0xe8b0('0xc')](_0xe8b0('0x38'),_0x476d37[_0xe8b0('0x39')]),_0x476d37);if(channels[_0x476d37[_0xe8b0('0x3a')]][_0xe8b0('0x20')]==_0x476d37[_0xe8b0('0x3b')]){utils[_0xe8b0('0xb')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x476d37[_0xe8b0('0x39')],_0x476d37[_0xe8b0('0x3a')],_0x476d37['secondtransfererchannel']));channels[_0x476d37[_0xe8b0('0x3a')]]['destinationchannel']=_0x476d37[_0xe8b0('0x3c')];channels[_0x476d37[_0xe8b0('0x3a')]][_0xe8b0('0x3d')]='_attended';}else if(channels[_0x476d37[_0xe8b0('0x3a')]]['channel']=_0x476d37['transfertargetchannel']){utils[_0xe8b0('0xb')](util['format'](_0xe8b0('0x3e'),_0x476d37['origtransfereruniqueid'],_0x476d37['localtwolinkedid'],_0x476d37['origtransfererchannel']));channels[_0x476d37[_0xe8b0('0x3a')]][_0xe8b0('0x3f')]=_0x476d37[_0xe8b0('0x40')];channels[_0x476d37[_0xe8b0('0x3a')]][_0xe8b0('0x3d')]=_0xe8b0('0x41');}}}catch(_0x2ea54d){utils['error'](util[_0xe8b0('0xc')](_0xe8b0('0x38'),_0x476d37[_0xe8b0('0x39')]),_0x2ea54d);}};exports['musiconholdstart']=function(_0x3f650b){try{if(!_['isNil'](channels[_0x3f650b[_0xe8b0('0x8')]])){utils[_0xe8b0('0x19')](util['format'](_0xe8b0('0x42'),_0x3f650b[_0xe8b0('0x8')]),_0x3f650b);channels[_0x3f650b[_0xe8b0('0x8')]][_0xe8b0('0x43')]=utils['now']();utils[_0xe8b0('0xb')](util[_0xe8b0('0xc')](_0xe8b0('0x44'),_0x3f650b[_0xe8b0('0x8')],channels[_0x3f650b['uniqueid']][_0xe8b0('0x43')]));}}catch(_0x57b813){utils[_0xe8b0('0x23')](util['format'](_0xe8b0('0x42'),_0x3f650b['uniqueid']),_0x57b813);}};exports[_0xe8b0('0x45')]=function(_0x4d7393){try{if(!_['isNil'](channels[_0x4d7393[_0xe8b0('0x8')]])){utils[_0xe8b0('0x19')](util['format'](_0xe8b0('0x46'),_0x4d7393[_0xe8b0('0x8')]),_0x4d7393);if(!_[_0xe8b0('0x26')](channels[_0x4d7393[_0xe8b0('0x8')]][_0xe8b0('0x43')])){channels[_0x4d7393[_0xe8b0('0x8')]]['mohtime']+=utils['diffTime'](utils[_0xe8b0('0x21')](),channels[_0x4d7393['uniqueid']][_0xe8b0('0x43')]);utils['info'](util[_0xe8b0('0xc')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x4d7393[_0xe8b0('0x8')],channels[_0x4d7393[_0xe8b0('0x8')]][_0xe8b0('0x47')]));delete channels[_0x4d7393['uniqueid']][_0xe8b0('0x43')];}}}catch(_0x1ae8ae){utils[_0xe8b0('0x23')](util[_0xe8b0('0xc')]('[%s][calls][musiconholdstop]',_0x4d7393[_0xe8b0('0x8')]),_0x1ae8ae);}};exports['varset']=function(_0x1daa1c){try{if(!_[_0xe8b0('0x26')](channels[_0x1daa1c[_0xe8b0('0x8')]])){utils[_0xe8b0('0x19')](util[_0xe8b0('0xc')](_0xe8b0('0x48'),_0x1daa1c[_0xe8b0('0x8')]),_0x1daa1c);if(!_[_0xe8b0('0x26')](_0x1daa1c[_0xe8b0('0x49')][_0xe8b0('0x4a')])){utils[_0xe8b0('0xb')](util[_0xe8b0('0xc')](_0xe8b0('0x4b'),_0x1daa1c['uniqueid'],_0x1daa1c[_0xe8b0('0x4c')]));channels[_0x1daa1c[_0xe8b0('0x8')]][_0xe8b0('0x4d')]=_0x1daa1c[_0xe8b0('0x4c')];}if(!_[_0xe8b0('0x26')](_0x1daa1c[_0xe8b0('0x49')]['xmd-phone'])){utils[_0xe8b0('0xb')](util[_0xe8b0('0xc')](_0xe8b0('0x4e'),_0x1daa1c['uniqueid'],_0x1daa1c[_0xe8b0('0x4c')]));channels[_0x1daa1c[_0xe8b0('0x8')]]['destination']=_0x1daa1c['value'];channels[_0x1daa1c[_0xe8b0('0x8')]][_0xe8b0('0x30')]='\x22'+_0x1daa1c['value']+_0xe8b0('0x4f')+_0x1daa1c['value']+'>';}if(!_[_0xe8b0('0x26')](_0x1daa1c[_0xe8b0('0x49')]['xmd-callerid-preview'])||!_[_0xe8b0('0x26')](_0x1daa1c[_0xe8b0('0x49')][_0xe8b0('0x50')])){utils[_0xe8b0('0xb')](util[_0xe8b0('0xc')](_0xe8b0('0x51'),_0x1daa1c[_0xe8b0('0x8')],!_[_0xe8b0('0x26')](_0x1daa1c[_0xe8b0('0x49')][_0xe8b0('0x52')])?_0xe8b0('0x52'):_0xe8b0('0x50'),_0x1daa1c[_0xe8b0('0x4c')]));channels[_0x1daa1c['uniqueid']]['callerid']=_0x1daa1c['value'];}if(!_[_0xe8b0('0x26')](_0x1daa1c[_0xe8b0('0x49')]['xmd-queue'])||!_[_0xe8b0('0x26')](_0x1daa1c[_0xe8b0('0x49')][_0xe8b0('0x53')])){utils[_0xe8b0('0xb')](util[_0xe8b0('0xc')](_0xe8b0('0x51'),_0x1daa1c[_0xe8b0('0x8')],!_['isNil'](_0x1daa1c[_0xe8b0('0x49')][_0xe8b0('0x54')])?_0xe8b0('0x54'):_0xe8b0('0x53'),_0x1daa1c['value']));channels[_0x1daa1c[_0xe8b0('0x8')]]['lastapplication']='Queue';channels[_0x1daa1c['uniqueid']][_0xe8b0('0x55')]=_0x1daa1c['value'];channels[_0x1daa1c[_0xe8b0('0x8')]][_0xe8b0('0xe')]=!![];}if(!_[_0xe8b0('0x26')](_0x1daa1c[_0xe8b0('0x49')][_0xe8b0('0x56')])){utils['info'](util[_0xe8b0('0xc')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x1daa1c[_0xe8b0('0x8')],_0x1daa1c['value']));channels[_0x1daa1c['uniqueid']][_0xe8b0('0x57')]=_0x1daa1c[_0xe8b0('0x4c')];}if(!_[_0xe8b0('0x26')](_0x1daa1c[_0xe8b0('0x49')][_0xe8b0('0x58')])){utils[_0xe8b0('0xb')](util[_0xe8b0('0xc')](_0xe8b0('0x59'),_0x1daa1c[_0xe8b0('0x8')],_0x1daa1c['value']));channels[_0x1daa1c['uniqueid']]['type']=_0x1daa1c[_0xe8b0('0x4c')];}if(!_[_0xe8b0('0x26')](_0x1daa1c[_0xe8b0('0x49')]['outboundrouteid'])){utils[_0xe8b0('0xb')](util[_0xe8b0('0xc')](_0xe8b0('0x5a'),_0x1daa1c['uniqueid'],_0x1daa1c[_0xe8b0('0x4c')]));channels[_0x1daa1c[_0xe8b0('0x8')]][_0xe8b0('0x5b')]=_0x1daa1c[_0xe8b0('0x4c')];}if(!_['isNil'](_0x1daa1c[_0xe8b0('0x49')]['sipcallid'])){utils[_0xe8b0('0xb')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1daa1c['uniqueid'],_0x1daa1c[_0xe8b0('0x4c')]));channels[_0x1daa1c[_0xe8b0('0x8')]][_0xe8b0('0x5c')]=_0x1daa1c[_0xe8b0('0x4c')];}}}catch(_0x46f312){utils[_0xe8b0('0x23')](util[_0xe8b0('0xc')](_0xe8b0('0x48'),_0x1daa1c[_0xe8b0('0x8')]),_0x46f312);}};exports[_0xe8b0('0x5d')]=function(_0x82e0c6){try{if(!_[_0xe8b0('0x26')](channels[_0x82e0c6[_0xe8b0('0x8')]])){utils[_0xe8b0('0x19')](util['format'](_0xe8b0('0x5e'),_0x82e0c6[_0xe8b0('0x8')]),_0x82e0c6);utils['info'](util[_0xe8b0('0xc')](_0xe8b0('0x5f'),_0x82e0c6[_0xe8b0('0x8')],_0x82e0c6[_0xe8b0('0x60')],_0x82e0c6[_0xe8b0('0x61')]));if(_0x82e0c6['application'][_0xe8b0('0x62')]()==_0xe8b0('0x63')&&_['startsWith'](_0x82e0c6[_0xe8b0('0x61')][_0xe8b0('0x62')](),_0xe8b0('0x64'))){var _0x13831e=_0x82e0c6[_0xe8b0('0x61')]['split']('=');var _0x3edffc=_0x13831e[0x0][_0xe8b0('0x65')](_0x13831e[0x0][_0xe8b0('0x66')]('(')+0x1,_0x13831e[0x0][_0xe8b0('0x66')](')'));var _0x47d16f=_0x13831e[0x1];channels[_0x82e0c6[_0xe8b0('0x8')]][_0x3edffc]=_0x47d16f;}if(!_[_0xe8b0('0x67')]([_0xe8b0('0x2f'),_0xe8b0('0x68'),'execif',_0xe8b0('0x63'),_0xe8b0('0x69')],_0x82e0c6[_0xe8b0('0x60')]['toLowerCase']())){channels[_0x82e0c6[_0xe8b0('0x8')]][_0xe8b0('0x6a')]=_0x82e0c6[_0xe8b0('0x60')];channels[_0x82e0c6['uniqueid']][_0xe8b0('0x55')]=_0x82e0c6[_0xe8b0('0x61')];}}}catch(_0x4bff83){utils[_0xe8b0('0x23')](util[_0xe8b0('0xc')](_0xe8b0('0x5e'),_0x82e0c6[_0xe8b0('0x8')]),_0x4bff83);}}; \ No newline at end of file +var _0x639a=['noop','gotoif','[%s][calls][newexten]','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','info','format','channel','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','isNil','systemanswertime','destinationchannel','answertime','disposition','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','localtwolinkedid','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','hangup'];(function(_0x44c23a,_0x95aba7){var _0x1ce6f8=function(_0x3f4065){while(--_0x3f4065){_0x44c23a['push'](_0x44c23a['shift']());}};_0x1ce6f8(++_0x95aba7);}(_0x639a,0x1e8));var _0xa639=function(_0x38ba31,_0x4fe0b6){_0x38ba31=_0x38ba31-0x0;var _0x19e62e=_0x639a[_0x38ba31];return _0x19e62e;};'use strict';var _=require(_0xa639('0x0'));var util=require(_0xa639('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=[_0xa639('0x2'),_0xa639('0x3'),'FAILED',_0xa639('0x2'),_0xa639('0x2'),_0xa639('0x2'),_0xa639('0x4'),'BUSY',_0xa639('0x3'),'FAILED',_0xa639('0x3')];var channels={};function writeDB(_0x38b779){var _0x277b76;if(transfers[_0xa639('0x5')][_0x38b779[_0xa639('0x6')]]){_0x277b76=_0x38b779['uniqueid'];_0x38b779[_0xa639('0x6')]=transfers[_0xa639('0x5')][_0x38b779[_0xa639('0x6')]]['transfereeuniqueid'];}utils[_0xa639('0x7')](util[_0xa639('0x8')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x38b779[_0xa639('0x6')],_0x38b779[_0xa639('0x9')],_0x38b779['queue'],_0x38b779[_0xa639('0xa')],_0x38b779[_0xa639('0xb')],_0x38b779['calleridnum'],_0x38b779[_0xa639('0xc')],_0x38b779[_0xa639('0xd')]));if(_0x38b779[_0xa639('0xe')]){utils[_0xa639('0xf')](_0x38b779[_0xa639('0xe')])[_0xa639('0x10')](function(_0x3dc4b5){if(_0x3dc4b5){_0x38b779['UserId']=_0x3dc4b5['id'];}utils[_0xa639('0x11')](_0xa639('0x12'),_0x38b779);});}else{utils[_0xa639('0x11')](_0xa639('0x12'),_0x38b779);}if(channels[_0x38b779[_0xa639('0x6')]]){delete channels[_0x38b779[_0xa639('0x6')]];}else if(_0x277b76&&channels[_0x277b76]){if(!transfers[_0xa639('0x5')][_0x277b76][_0xa639('0x13')])delete transfers[_0xa639('0x5')][_0x277b76];delete channels[_0x277b76];}}exports['newchannel']=function(_0x3a894c){try{utils[_0xa639('0x14')](util['format'](_0xa639('0x15'),_0x3a894c[_0xa639('0x6')]),_0x3a894c);if(_0x3a894c[_0xa639('0x6')]==_0x3a894c[_0xa639('0x16')]&&_0x3a894c['channel']!=_0xa639('0x17')){utils[_0xa639('0x7')](util[_0xa639('0x8')](_0xa639('0x18'),_0x3a894c['uniqueid'],_0x3a894c[_0xa639('0x19')],_0x3a894c[_0xa639('0x1a')]));channels[_0x3a894c[_0xa639('0x6')]]={'uniqueid':_0x3a894c[_0xa639('0x6')],'accountcode':_0x3a894c[_0xa639('0xe')],'source':_0x3a894c['calleridnum'],'destination':_0x3a894c[_0xa639('0x1a')],'destinationcontext':_0x3a894c[_0xa639('0x19')],'channel':_0x3a894c[_0xa639('0x9')],'starttime':utils[_0xa639('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xa639('0x1c')};}}catch(_0x597397){utils[_0xa639('0x1d')](util[_0xa639('0x8')](_0xa639('0x15'),_0x3a894c['uniqueid']),_0x597397);}};exports[_0xa639('0x1e')]=function(_0x54c7cd){try{utils[_0xa639('0x14')](util[_0xa639('0x8')](_0xa639('0x1f'),_0x54c7cd[_0xa639('0x6')]),_0x54c7cd);if(!_['isNil'](channels[_0x54c7cd[_0xa639('0x6')]])&&_0x54c7cd[_0xa639('0x20')]==0x6){utils[_0xa639('0x7')](util[_0xa639('0x8')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x54c7cd[_0xa639('0x6')],_0x54c7cd[_0xa639('0x19')],_0x54c7cd[_0xa639('0x9')]));if(_[_0xa639('0x21')](channels[_0x54c7cd[_0xa639('0x6')]][_0xa639('0x22')])){channels[_0x54c7cd['uniqueid']]['systemanswertime']=utils[_0xa639('0x1b')]();}}else if(!_[_0xa639('0x21')](channels[_0x54c7cd[_0xa639('0x16')]])&&_0x54c7cd[_0xa639('0x20')]==0x6&&_0x54c7cd[_0xa639('0x19')]!='transfer'){utils['info'](util[_0xa639('0x8')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x54c7cd[_0xa639('0x6')],_0x54c7cd['linkedid'],_0x54c7cd[_0xa639('0x19')],_0x54c7cd[_0xa639('0x9')]));channels[_0x54c7cd[_0xa639('0x16')]][_0xa639('0xe')]=_0x54c7cd[_0xa639('0xe')];channels[_0x54c7cd[_0xa639('0x16')]][_0xa639('0x23')]=_0x54c7cd[_0xa639('0x9')];if(_['isNil'](channels[_0x54c7cd[_0xa639('0x16')]]['answertime'])){channels[_0x54c7cd[_0xa639('0x16')]][_0xa639('0x24')]=utils['now']();}channels[_0x54c7cd[_0xa639('0x16')]][_0xa639('0x25')]=dispositions[_['toNumber'](_0x54c7cd['channelstate'])]||_0xa639('0x4');}}catch(_0xca6d1a){utils[_0xa639('0x1d')](util[_0xa639('0x8')](_0xa639('0x1f'),_0x54c7cd[_0xa639('0x6')]),_0xca6d1a);}};exports['hangup']=function(_0x47905c){try{if(!_[_0xa639('0x21')](channels[_0x47905c[_0xa639('0x6')]])){utils['debug'](util[_0xa639('0x8')](_0xa639('0x26'),_0x47905c[_0xa639('0x6')]),_0x47905c);if(_[_0xa639('0x21')](channels[_0x47905c['uniqueid']][_0xa639('0x27')])){channels[_0x47905c[_0xa639('0x6')]][_0xa639('0x27')]=_0x47905c[_0xa639('0x28')]+'\x20<'+_0x47905c['calleridnum']+'>';}utils[_0xa639('0x7')](util[_0xa639('0x8')](_0xa639('0x29'),_0x47905c[_0xa639('0x6')],channels[_0x47905c[_0xa639('0x6')]][_0xa639('0x27')],_0x47905c[_0xa639('0x2a')]));channels[_0x47905c[_0xa639('0x6')]][_0xa639('0x2b')]=utils[_0xa639('0x1b')]();channels[_0x47905c[_0xa639('0x6')]][_0xa639('0x2c')]=utils[_0xa639('0x2d')](channels[_0x47905c[_0xa639('0x6')]][_0xa639('0x2b')],channels[_0x47905c[_0xa639('0x6')]]['starttime']);channels[_0x47905c[_0xa639('0x6')]][_0xa639('0x2e')]=channels[_0x47905c[_0xa639('0x6')]]['answertime']?utils[_0xa639('0x2d')](channels[_0x47905c[_0xa639('0x6')]][_0xa639('0x2b')],channels[_0x47905c[_0xa639('0x6')]][_0xa639('0x24')]):0x0;writeDB(channels[_0x47905c[_0xa639('0x6')]]);}}catch(_0x404939){utils['error'](util[_0xa639('0x8')](_0xa639('0x26'),_0x47905c[_0xa639('0x6')]),_0x404939);}};exports['attendedtransfer']=function(_0x4db3a1){try{if(!_['isNil'](channels[_0x4db3a1[_0xa639('0x2f')]])){utils[_0xa639('0x14')](util[_0xa639('0x8')]('[%s][calls][attendedtransfer]',_0x4db3a1['origtransfereruniqueid']),_0x4db3a1);if(channels[_0x4db3a1[_0xa639('0x2f')]][_0xa639('0x9')]==_0x4db3a1['transfereechannel']){utils[_0xa639('0x7')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x4db3a1[_0xa639('0x30')],_0x4db3a1[_0xa639('0x2f')],_0x4db3a1['secondtransfererchannel']));channels[_0x4db3a1[_0xa639('0x2f')]][_0xa639('0x23')]=_0x4db3a1[_0xa639('0x31')];channels[_0x4db3a1[_0xa639('0x2f')]][_0xa639('0x32')]=_0xa639('0x33');}else if(channels[_0x4db3a1[_0xa639('0x2f')]][_0xa639('0x9')]=_0x4db3a1[_0xa639('0x34')]){utils[_0xa639('0x7')](util[_0xa639('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x4db3a1[_0xa639('0x30')],_0x4db3a1['localtwolinkedid'],_0x4db3a1[_0xa639('0x35')]));channels[_0x4db3a1[_0xa639('0x2f')]][_0xa639('0x23')]=_0x4db3a1[_0xa639('0x35')];channels[_0x4db3a1[_0xa639('0x2f')]][_0xa639('0x32')]=_0xa639('0x33');}}}catch(_0x48cc80){utils['error'](util['format'](_0xa639('0x36'),_0x4db3a1[_0xa639('0x30')]),_0x48cc80);}};exports[_0xa639('0x37')]=function(_0x4eb95e){try{if(!_[_0xa639('0x21')](channels[_0x4eb95e['uniqueid']])){utils['debug'](util[_0xa639('0x8')](_0xa639('0x38'),_0x4eb95e[_0xa639('0x6')]),_0x4eb95e);channels[_0x4eb95e[_0xa639('0x6')]]['musiconholdstartAt']=utils['now']();utils['info'](util[_0xa639('0x8')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x4eb95e[_0xa639('0x6')],channels[_0x4eb95e[_0xa639('0x6')]][_0xa639('0x39')]));}}catch(_0xd92674){utils[_0xa639('0x1d')](util[_0xa639('0x8')](_0xa639('0x38'),_0x4eb95e[_0xa639('0x6')]),_0xd92674);}};exports['musiconholdstop']=function(_0x11f7c7){try{if(!_[_0xa639('0x21')](channels[_0x11f7c7[_0xa639('0x6')]])){utils[_0xa639('0x14')](util[_0xa639('0x8')]('[%s][calls][musiconholdstop]',_0x11f7c7[_0xa639('0x6')]),_0x11f7c7);if(!_[_0xa639('0x21')](channels[_0x11f7c7['uniqueid']][_0xa639('0x39')])){channels[_0x11f7c7[_0xa639('0x6')]][_0xa639('0x3a')]+=utils['diffTime'](utils[_0xa639('0x1b')](),channels[_0x11f7c7[_0xa639('0x6')]][_0xa639('0x39')]);utils[_0xa639('0x7')](util[_0xa639('0x8')](_0xa639('0x3b'),_0x11f7c7[_0xa639('0x6')],channels[_0x11f7c7[_0xa639('0x6')]][_0xa639('0x3a')]));delete channels[_0x11f7c7[_0xa639('0x6')]][_0xa639('0x39')];}}}catch(_0x44aaae){utils[_0xa639('0x1d')](util[_0xa639('0x8')](_0xa639('0x3c'),_0x11f7c7['uniqueid']),_0x44aaae);}};exports[_0xa639('0x3d')]=function(_0x524114){try{if(!_[_0xa639('0x21')](channels[_0x524114['uniqueid']])){utils['debug'](util[_0xa639('0x8')](_0xa639('0x3e'),_0x524114['uniqueid']),_0x524114);if(!_[_0xa639('0x21')](_0x524114[_0xa639('0x3f')][_0xa639('0x40')])){utils[_0xa639('0x7')](util[_0xa639('0x8')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x524114[_0xa639('0x6')],_0x524114[_0xa639('0x41')]));channels[_0x524114[_0xa639('0x6')]][_0xa639('0x42')]=_0x524114[_0xa639('0x41')];}if(!_['isNil'](_0x524114[_0xa639('0x3f')][_0xa639('0x43')])){utils[_0xa639('0x7')](util[_0xa639('0x8')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x524114[_0xa639('0x6')],_0x524114[_0xa639('0x41')]));channels[_0x524114['uniqueid']][_0xa639('0x44')]=_0x524114[_0xa639('0x41')];channels[_0x524114[_0xa639('0x6')]][_0xa639('0x27')]='\x22'+_0x524114['value']+_0xa639('0x45')+_0x524114[_0xa639('0x41')]+'>';}if(!_[_0xa639('0x21')](_0x524114[_0xa639('0x3f')]['xmd-callerid-preview'])||!_[_0xa639('0x21')](_0x524114[_0xa639('0x3f')]['xmd-callerid'])){utils[_0xa639('0x7')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x524114[_0xa639('0x6')],!_[_0xa639('0x21')](_0x524114[_0xa639('0x3f')][_0xa639('0x46')])?_0xa639('0x46'):_0xa639('0x47'),_0x524114[_0xa639('0x41')]));channels[_0x524114[_0xa639('0x6')]][_0xa639('0x27')]=_0x524114[_0xa639('0x41')];}if(!_['isNil'](_0x524114[_0xa639('0x3f')][_0xa639('0x48')])||!_[_0xa639('0x21')](_0x524114['variable']['xmcs-queue'])){utils[_0xa639('0x7')](util[_0xa639('0x8')](_0xa639('0x49'),_0x524114['uniqueid'],!_['isNil'](_0x524114['variable']['xmd-queue'])?'xmd-queue':'xmcs-queue',_0x524114['value']));channels[_0x524114[_0xa639('0x6')]][_0xa639('0x4a')]='Queue';channels[_0x524114[_0xa639('0x6')]][_0xa639('0x4b')]=_0x524114[_0xa639('0x41')];channels[_0x524114[_0xa639('0x6')]]['queue']=!![];}if(!_[_0xa639('0x21')](_0x524114[_0xa639('0x3f')][_0xa639('0x4c')])){utils[_0xa639('0x7')](util[_0xa639('0x8')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x524114['uniqueid'],_0x524114[_0xa639('0x41')]));channels[_0x524114['uniqueid']]['ContactId']=_0x524114['value'];}if(!_[_0xa639('0x21')](_0x524114[_0xa639('0x3f')]['xmd-cdrtype'])){utils[_0xa639('0x7')](util['format'](_0xa639('0x4d'),_0x524114[_0xa639('0x6')],_0x524114['value']));channels[_0x524114[_0xa639('0x6')]][_0xa639('0x4e')]=_0x524114[_0xa639('0x41')];}if(!_['isNil'](_0x524114[_0xa639('0x3f')]['outboundrouteid'])){utils['info'](util[_0xa639('0x8')](_0xa639('0x4f'),_0x524114[_0xa639('0x6')],_0x524114[_0xa639('0x41')]));channels[_0x524114['uniqueid']][_0xa639('0x50')]=_0x524114[_0xa639('0x41')];}if(!_[_0xa639('0x21')](_0x524114[_0xa639('0x3f')][_0xa639('0x51')])){utils[_0xa639('0x7')](util[_0xa639('0x8')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x524114['uniqueid'],_0x524114[_0xa639('0x41')]));channels[_0x524114['uniqueid']][_0xa639('0x51')]=_0x524114[_0xa639('0x41')];}}}catch(_0xd31491){utils[_0xa639('0x1d')](util[_0xa639('0x8')](_0xa639('0x3e'),_0x524114[_0xa639('0x6')]),_0xd31491);}};exports[_0xa639('0x52')]=function(_0x51055c){try{if(!_[_0xa639('0x21')](channels[_0x51055c[_0xa639('0x6')]])){utils[_0xa639('0x14')](util[_0xa639('0x8')]('[%s][calls][newexten]',_0x51055c['uniqueid']),_0x51055c);utils['info'](util[_0xa639('0x8')](_0xa639('0x53'),_0x51055c[_0xa639('0x6')],_0x51055c['application'],_0x51055c[_0xa639('0x54')]));if(_0x51055c[_0xa639('0x55')][_0xa639('0x56')]()==_0xa639('0x57')&&_[_0xa639('0x58')](_0x51055c[_0xa639('0x54')][_0xa639('0x56')](),_0xa639('0x59'))){var _0x1f6fa9=_0x51055c['appdata'][_0xa639('0x5a')]('=');var _0x10c6fa=_0x1f6fa9[0x0][_0xa639('0x5b')](_0x1f6fa9[0x0]['lastIndexOf']('(')+0x1,_0x1f6fa9[0x0][_0xa639('0x5c')](')'));var _0x1ed3d7=_0x1f6fa9[0x1];channels[_0x51055c[_0xa639('0x6')]][_0x10c6fa]=_0x1ed3d7;}if(!_['includes']([_0xa639('0x5d'),_0xa639('0x5e'),'execif','set',_0xa639('0x5f')],_0x51055c[_0xa639('0x55')][_0xa639('0x56')]())){channels[_0x51055c[_0xa639('0x6')]]['lastapplication']=_0x51055c[_0xa639('0x55')];channels[_0x51055c[_0xa639('0x6')]][_0xa639('0x4b')]=_0x51055c[_0xa639('0x54')];}}}catch(_0x283637){utils[_0xa639('0x1d')](util[_0xa639('0x8')](_0xa639('0x60'),_0x51055c['uniqueid']),_0x283637);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 1c4a1c1..4377d50 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 _0xb20f=['[core]\x20connected','shutdown','info','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','./utils'];(function(_0x25e109,_0x6ab24c){var _0xc0f7d6=function(_0x2fb92b){while(--_0x2fb92b){_0x25e109['push'](_0x25e109['shift']());}};_0xc0f7d6(++_0x6ab24c);}(_0xb20f,0x13f));var _0xfb20=function(_0x33a45c,_0x568762){_0x33a45c=_0x33a45c-0x0;var _0x429d1e=_0xb20f[_0x33a45c];return _0x429d1e;};'use strict';var utils=require(_0xfb20('0x0'));exports['connect']=function(){utils['info'](_0xfb20('0x1'));};exports[_0xfb20('0x2')]=function(){utils[_0xfb20('0x3')]('[core]\x20shutdown');};exports[_0xfb20('0x4')]=function(){utils[_0xfb20('0x3')](_0xfb20('0x5'));};exports[_0xfb20('0x6')]=function(_0x3b0002){utils['error'](_0xfb20('0x7'),_0x3b0002);};exports[_0xfb20('0x8')]=function(){utils[_0xfb20('0x3')](_0xfb20('0x9'));};exports['managerevent']=function(_0x51c2c0){}; \ No newline at end of file +var _0xadc2=['error','close','[core]\x20close','managerevent','./utils','info','[core]\x20connected','[core]\x20shutdown','fullybooted'];(function(_0xf105c1,_0x30dd5e){var _0x450364=function(_0x5af239){while(--_0x5af239){_0xf105c1['push'](_0xf105c1['shift']());}};_0x450364(++_0x30dd5e);}(_0xadc2,0x187));var _0x2adc=function(_0x20a63e,_0xcb0bea){_0x20a63e=_0x20a63e-0x0;var _0x56fe3d=_0xadc2[_0x20a63e];return _0x56fe3d;};'use strict';var utils=require(_0x2adc('0x0'));exports['connect']=function(){utils[_0x2adc('0x1')](_0x2adc('0x2'));};exports['shutdown']=function(){utils[_0x2adc('0x1')](_0x2adc('0x3'));};exports[_0x2adc('0x4')]=function(){utils['info']('[core]\x20fullybooted');};exports[_0x2adc('0x5')]=function(_0x4f5271){utils[_0x2adc('0x5')]('[core]\x20error',_0x4f5271);};exports[_0x2adc('0x6')]=function(){utils[_0x2adc('0x1')](_0x2adc('0x7'));};exports[_0x2adc('0x8')]=function(_0xdfaa02){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index ac6175b..414d751 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 _0x7e4a=['[%s][dials][dialend]','ANSWER','now','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','endtime','holdtime','diffTime','billableseconds','lodash','util','./utils','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','uniqueid','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','toLowerCase','cdr(routeid)','split','error','format','varset','[%s][dials][varset]','isNil','outboundrouteid','info','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','dialbegin','[%s][dials][dialbegin]','assign','starttime','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7e4a,0xdd));var _0xa7e4=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x7e4a[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xa7e4('0x0'));var util=require(_0xa7e4('0x1'));var utils=require(_0xa7e4('0x2'));var dials={};function writeDB(_0x2ef572){utils['info'](util['format'](_0xa7e4('0x3'),_0x2ef572['uniqueid'],_0x2ef572['channel'],_0x2ef572[_0xa7e4('0x4')],_0x2ef572[_0xa7e4('0x5')],_0x2ef572['connectedlinenum'],_0x2ef572[_0xa7e4('0x6')]));utils[_0xa7e4('0x7')](_0xa7e4('0x8'),_0x2ef572);delete dials[_0x2ef572[_0xa7e4('0x9')]];}exports['newexten']=function(_0x3af6d8){try{utils[_0xa7e4('0xa')](util['format'](_0xa7e4('0xb'),_0x3af6d8[_0xa7e4('0x9')]),_0x3af6d8);utils['info'](util['format'](_0xa7e4('0xc'),_0x3af6d8[_0xa7e4('0x9')],_0x3af6d8['application'],_0x3af6d8[_0xa7e4('0xd')]));if(_0x3af6d8[_0xa7e4('0xe')]['toLowerCase']()==_0xa7e4('0xf')&&_[_0xa7e4('0x10')](_0x3af6d8['appdata'][_0xa7e4('0x11')](),_0xa7e4('0x12'))){var _0x1b7173=_0x3af6d8['appdata'][_0xa7e4('0x13')]('=');dials[_0x3af6d8[_0xa7e4('0x9')]]={'routeId':_0x1b7173[0x1]};}}catch(_0x370a95){utils[_0xa7e4('0x14')](util[_0xa7e4('0x15')]('[%s][dials][newexten]',_0x3af6d8[_0xa7e4('0x9')]),_0x370a95);}};exports[_0xa7e4('0x16')]=function(_0x517dd2){try{utils['debug'](util[_0xa7e4('0x15')](_0xa7e4('0x17'),_0x517dd2['uniqueid']),_0x517dd2);if(!_[_0xa7e4('0x18')](_0x517dd2['variable'][_0xa7e4('0x19')])){utils[_0xa7e4('0x1a')](util[_0xa7e4('0x15')](_0xa7e4('0x1b'),_0x517dd2[_0xa7e4('0x9')],_0x517dd2['value']));dials[_0x517dd2[_0xa7e4('0x9')]]={'routeId':_0x517dd2['value']};}}catch(_0xdf748c){utils[_0xa7e4('0x14')](util[_0xa7e4('0x15')](_0xa7e4('0x17'),_0x517dd2[_0xa7e4('0x9')]),_0xdf748c);}};exports[_0xa7e4('0x1c')]=function(_0x1f777c){try{if(!_[_0xa7e4('0x18')](dials[_0x1f777c['uniqueid']])){utils[_0xa7e4('0xa')](util[_0xa7e4('0x15')](_0xa7e4('0x1d'),_0x1f777c[_0xa7e4('0x9')]),_0x1f777c);dials[_0x1f777c[_0xa7e4('0x9')]]=_[_0xa7e4('0x1e')](dials[_0x1f777c[_0xa7e4('0x9')]],_0x1f777c);dials[_0x1f777c[_0xa7e4('0x9')]][_0xa7e4('0x1f')]=utils['now']();dials[_0x1f777c['uniqueid']]['lastevent']=_0xa7e4('0x20');utils[_0xa7e4('0x1a')](util[_0xa7e4('0x15')](_0xa7e4('0x21'),_0x1f777c[_0xa7e4('0x9')],dials[_0x1f777c[_0xa7e4('0x9')]][_0xa7e4('0x1f')]));}}catch(_0x3a79a3){utils['error'](util['format'](_0xa7e4('0x1d'),_0x1f777c[_0xa7e4('0x9')]),_0x3a79a3);}};exports['dialend']=function(_0x475931){try{if(!_['isNil'](dials[_0x475931['uniqueid']])){utils[_0xa7e4('0xa')](util[_0xa7e4('0x15')](_0xa7e4('0x22'),_0x475931[_0xa7e4('0x9')]),_0x475931);dials[_0x475931[_0xa7e4('0x9')]][_0xa7e4('0x6')]=_0x475931[_0xa7e4('0x6')];if(_0x475931[_0xa7e4('0x6')]==_0xa7e4('0x23')){dials[_0x475931[_0xa7e4('0x9')]]=_[_0xa7e4('0x1e')](dials[_0x475931[_0xa7e4('0x9')]],_0x475931);dials[_0x475931[_0xa7e4('0x9')]]['answertime']=utils[_0xa7e4('0x24')]();dials[_0x475931[_0xa7e4('0x9')]][_0xa7e4('0x25')]=_0xa7e4('0x26');utils['info'](util[_0xa7e4('0x15')](_0xa7e4('0x27'),_0x475931['uniqueid'],_0x475931[_0xa7e4('0x6')],dials[_0x475931[_0xa7e4('0x9')]][_0xa7e4('0x28')]));}else{utils[_0xa7e4('0x1a')](util['format'](_0xa7e4('0x29'),_0x475931[_0xa7e4('0x9')],_0x475931[_0xa7e4('0x6')]));}}}catch(_0x4827a9){utils[_0xa7e4('0x14')](util[_0xa7e4('0x15')]('[%s][dials][dialend]',_0x475931['uniqueid']),_0x4827a9);}};exports[_0xa7e4('0x2a')]=function(_0x537a2e){try{if(!_[_0xa7e4('0x18')](dials[_0x537a2e[_0xa7e4('0x9')]])){utils[_0xa7e4('0xa')](util[_0xa7e4('0x15')]('[%s][dials][hangup]',_0x537a2e[_0xa7e4('0x9')]),_0x537a2e);utils[_0xa7e4('0x1a')](util[_0xa7e4('0x15')](_0xa7e4('0x2b'),_0x537a2e[_0xa7e4('0x9')],_0x537a2e[_0xa7e4('0x5')],_0x537a2e[_0xa7e4('0x2c')],_0x537a2e['cause-txt']));dials[_0x537a2e[_0xa7e4('0x9')]]=_[_0xa7e4('0x1e')](dials[_0x537a2e[_0xa7e4('0x9')]],{'endtime':utils[_0xa7e4('0x24')](),'lastevent':_0xa7e4('0x2d')});dials[_0x537a2e[_0xa7e4('0x9')]][_0xa7e4('0x2e')]=utils['diffTime'](dials[_0x537a2e[_0xa7e4('0x9')]][_0xa7e4('0x2f')],dials[_0x537a2e['uniqueid']]['starttime']);dials[_0x537a2e['uniqueid']][_0xa7e4('0x30')]=utils[_0xa7e4('0x31')](dials[_0x537a2e['uniqueid']][_0xa7e4('0x28')]||dials[_0x537a2e[_0xa7e4('0x9')]][_0xa7e4('0x2f')],dials[_0x537a2e['uniqueid']][_0xa7e4('0x1f')]);dials[_0x537a2e['uniqueid']][_0xa7e4('0x32')]=dials[_0x537a2e[_0xa7e4('0x9')]][_0xa7e4('0x28')]?utils[_0xa7e4('0x31')](dials[_0x537a2e['uniqueid']][_0xa7e4('0x2f')],dials[_0x537a2e[_0xa7e4('0x9')]][_0xa7e4('0x28')]):0x0;writeDB(dials[_0x537a2e[_0xa7e4('0x9')]]);}}catch(_0x12b8b4){utils[_0xa7e4('0x14')](util[_0xa7e4('0x15')]('[%s][dials][hangup]',_0x537a2e[_0xa7e4('0x9')]),_0x12b8b4);}}; \ No newline at end of file +var _0x5399=['isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','ANSWER','connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','endtime','holdtime','diffTime','billableseconds','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','dialstatus','request','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]'];(function(_0x3d729b,_0x365ea4){var _0x21f06e=function(_0x729dbf){while(--_0x729dbf){_0x3d729b['push'](_0x3d729b['shift']());}};_0x21f06e(++_0x365ea4);}(_0x5399,0x147));var _0x9539=function(_0x5db0fc,_0x1702bf){_0x5db0fc=_0x5db0fc-0x0;var _0x1cdcf1=_0x5399[_0x5db0fc];return _0x1cdcf1;};'use strict';var _=require('lodash');var util=require(_0x9539('0x0'));var utils=require(_0x9539('0x1'));var dials={};function writeDB(_0x4efec9){utils[_0x9539('0x2')](util[_0x9539('0x3')](_0x9539('0x4'),_0x4efec9[_0x9539('0x5')],_0x4efec9['channel'],_0x4efec9[_0x9539('0x6')],_0x4efec9[_0x9539('0x7')],_0x4efec9['connectedlinenum'],_0x4efec9[_0x9539('0x8')]));utils[_0x9539('0x9')]('CreateVoiceDialReport',_0x4efec9);delete dials[_0x4efec9['uniqueid']];}exports['newexten']=function(_0xc7a7fa){try{utils[_0x9539('0xa')](util[_0x9539('0x3')](_0x9539('0xb'),_0xc7a7fa[_0x9539('0x5')]),_0xc7a7fa);utils[_0x9539('0x2')](util[_0x9539('0x3')](_0x9539('0xc'),_0xc7a7fa[_0x9539('0x5')],_0xc7a7fa[_0x9539('0xd')],_0xc7a7fa[_0x9539('0xe')]));if(_0xc7a7fa[_0x9539('0xd')][_0x9539('0xf')]()==_0x9539('0x10')&&_[_0x9539('0x11')](_0xc7a7fa[_0x9539('0xe')][_0x9539('0xf')](),_0x9539('0x12'))){var _0x228120=_0xc7a7fa[_0x9539('0xe')][_0x9539('0x13')]('=');dials[_0xc7a7fa[_0x9539('0x5')]]={'routeId':_0x228120[0x1]};}}catch(_0x529cc2){utils[_0x9539('0x14')](util[_0x9539('0x3')](_0x9539('0xb'),_0xc7a7fa[_0x9539('0x5')]),_0x529cc2);}};exports[_0x9539('0x15')]=function(_0x5103b9){try{utils[_0x9539('0xa')](util[_0x9539('0x3')](_0x9539('0x16'),_0x5103b9[_0x9539('0x5')]),_0x5103b9);if(!_[_0x9539('0x17')](_0x5103b9[_0x9539('0x18')]['outboundrouteid'])){utils[_0x9539('0x2')](util[_0x9539('0x3')](_0x9539('0x19'),_0x5103b9[_0x9539('0x5')],_0x5103b9[_0x9539('0x1a')]));dials[_0x5103b9[_0x9539('0x5')]]={'routeId':_0x5103b9[_0x9539('0x1a')]};}}catch(_0x2efa10){utils[_0x9539('0x14')](util[_0x9539('0x3')](_0x9539('0x16'),_0x5103b9['uniqueid']),_0x2efa10);}};exports[_0x9539('0x1b')]=function(_0x4ae1f9){try{if(!_['isNil'](dials[_0x4ae1f9['uniqueid']])){utils[_0x9539('0xa')](util[_0x9539('0x3')](_0x9539('0x1c'),_0x4ae1f9[_0x9539('0x5')]),_0x4ae1f9);dials[_0x4ae1f9[_0x9539('0x5')]]=_[_0x9539('0x1d')](dials[_0x4ae1f9[_0x9539('0x5')]],_0x4ae1f9);dials[_0x4ae1f9['uniqueid']][_0x9539('0x1e')]=utils[_0x9539('0x1f')]();dials[_0x4ae1f9['uniqueid']][_0x9539('0x20')]=_0x9539('0x21');utils[_0x9539('0x2')](util[_0x9539('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x4ae1f9[_0x9539('0x5')],dials[_0x4ae1f9['uniqueid']][_0x9539('0x1e')]));}}catch(_0x4c4227){utils[_0x9539('0x14')](util[_0x9539('0x3')]('[%s][dials][dialbegin]',_0x4ae1f9[_0x9539('0x5')]),_0x4c4227);}};exports[_0x9539('0x22')]=function(_0x535018){try{if(!_[_0x9539('0x17')](dials[_0x535018['uniqueid']])){utils[_0x9539('0xa')](util['format']('[%s][dials][dialend]',_0x535018[_0x9539('0x5')]),_0x535018);dials[_0x535018[_0x9539('0x5')]][_0x9539('0x8')]=_0x535018[_0x9539('0x8')];if(_0x535018[_0x9539('0x8')]==_0x9539('0x23')){dials[_0x535018['uniqueid']]=_['assign'](dials[_0x535018[_0x9539('0x5')]],_0x535018);dials[_0x535018[_0x9539('0x5')]]['answertime']=utils[_0x9539('0x1f')]();dials[_0x535018[_0x9539('0x5')]]['lastevent']=_0x9539('0x24');utils[_0x9539('0x2')](util[_0x9539('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x535018[_0x9539('0x5')],_0x535018[_0x9539('0x8')],dials[_0x535018['uniqueid']][_0x9539('0x25')]));}else{utils['info'](util[_0x9539('0x3')](_0x9539('0x26'),_0x535018['uniqueid'],_0x535018['dialstatus']));}}}catch(_0xe52533){utils[_0x9539('0x14')](util[_0x9539('0x3')](_0x9539('0x27'),_0x535018[_0x9539('0x5')]),_0xe52533);}};exports[_0x9539('0x28')]=function(_0x4838ee){try{if(!_[_0x9539('0x17')](dials[_0x4838ee[_0x9539('0x5')]])){utils[_0x9539('0xa')](util[_0x9539('0x3')](_0x9539('0x29'),_0x4838ee[_0x9539('0x5')]),_0x4838ee);utils['info'](util[_0x9539('0x3')](_0x9539('0x2a'),_0x4838ee['uniqueid'],_0x4838ee[_0x9539('0x7')],_0x4838ee[_0x9539('0x2b')],_0x4838ee['cause-txt']));dials[_0x4838ee[_0x9539('0x5')]]=_[_0x9539('0x1d')](dials[_0x4838ee['uniqueid']],{'endtime':utils['now'](),'lastevent':_0x9539('0x2c')});dials[_0x4838ee[_0x9539('0x5')]][_0x9539('0x2d')]=utils['diffTime'](dials[_0x4838ee[_0x9539('0x5')]][_0x9539('0x2e')],dials[_0x4838ee['uniqueid']][_0x9539('0x1e')]);dials[_0x4838ee['uniqueid']][_0x9539('0x2f')]=utils[_0x9539('0x30')](dials[_0x4838ee[_0x9539('0x5')]][_0x9539('0x25')]||dials[_0x4838ee['uniqueid']][_0x9539('0x2e')],dials[_0x4838ee[_0x9539('0x5')]][_0x9539('0x1e')]);dials[_0x4838ee[_0x9539('0x5')]][_0x9539('0x31')]=dials[_0x4838ee[_0x9539('0x5')]][_0x9539('0x25')]?utils[_0x9539('0x30')](dials[_0x4838ee[_0x9539('0x5')]]['endtime'],dials[_0x4838ee['uniqueid']][_0x9539('0x25')]):0x0;writeDB(dials[_0x4838ee[_0x9539('0x5')]]);}}catch(_0x12e92c){utils['error'](util[_0x9539('0x3')](_0x9539('0x29'),_0x4838ee[_0x9539('0x5')]),_0x12e92c);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 46c51a3..181905d 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 _0xdfae=['[%s][index][dialend]','../../config/environment','util','xdr','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','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','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend'];(function(_0x1d04b5,_0x30792c){var _0x161342=function(_0x94ff92){while(--_0x94ff92){_0x1d04b5['push'](_0x1d04b5['shift']());}};_0x161342(++_0x30792c);}(_0xdfae,0x18d));var _0xedfa=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0xdfae[_0x3f2a90];return _0xb46279;};var AsteriskManager=require('asterisk-manager');var config=require(_0xedfa('0x0'));var utils=require('./utils');var util=require(_0xedfa('0x1'));var isXDREnabled=config[_0xedfa('0x2')]&&!config['xdr']['disabled'];var isProduction=config['env']===_0xedfa('0x3')||![];var isLocalAsterisk=config[_0xedfa('0x2')]&&config[_0xedfa('0x2')][_0xedfa('0x4')]===!![]||![];var ami=new AsteriskManager(config[_0xedfa('0x5')][_0xedfa('0x6')],config[_0xedfa('0x5')]['ip'],config[_0xedfa('0x5')][_0xedfa('0x7')],config[_0xedfa('0x5')][_0xedfa('0x8')],!![]);ami[_0xedfa('0x9')]();if(!isXDREnabled){utils[_0xedfa('0xa')](_0xedfa('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xedfa('0xa')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require(_0xedfa('0xc'));var queues=require(_0xedfa('0xd'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0xedfa('0xe'));var core=require(_0xedfa('0xf'));ami['on'](_0xedfa('0x10'),core[_0xedfa('0x10')]);ami['on'](_0xedfa('0x11'),core[_0xedfa('0x11')]);ami['on'](_0xedfa('0x12'),core[_0xedfa('0x12')]);ami['on'](_0xedfa('0x13'),core[_0xedfa('0x13')]);ami['on'](_0xedfa('0x14'),core[_0xedfa('0x14')]);ami['on'](_0xedfa('0x15'),core[_0xedfa('0x15')]);ami['on'](_0xedfa('0x16'),function(_0x51684c){try{utils[_0xedfa('0x17')](util['format']('[%s][index][devicestatechange]',_0x51684c[_0xedfa('0x18')]),_0x51684c);members[_0xedfa('0x16')](_0x51684c);}catch(_0x4da870){utils[_0xedfa('0x13')](util[_0xedfa('0x19')]('[%s][index][devicestatechange]',_0x51684c[_0xedfa('0x18')]),_0x4da870);}});ami['on'](_0xedfa('0x1a'),function(_0x409c45){try{utils[_0xedfa('0x17')](util[_0xedfa('0x19')](_0xedfa('0x1b'),_0x409c45[_0xedfa('0x1c')]),_0x409c45);agents[_0xedfa('0x1a')](_0x409c45);}catch(_0x4acf66){utils[_0xedfa('0x13')](util[_0xedfa('0x19')](_0xedfa('0x1b'),_0x409c45[_0xedfa('0x1c')]),_0x4acf66);}});ami['on'](_0xedfa('0x1d'),function(_0x52c88a){try{utils[_0xedfa('0x17')](util[_0xedfa('0x19')](_0xedfa('0x1e'),_0x52c88a[_0xedfa('0x1c')]),_0x52c88a);agents[_0xedfa('0x1d')](_0x52c88a);}catch(_0x25c300){utils[_0xedfa('0x13')](util['format'](_0xedfa('0x1e'),_0x52c88a[_0xedfa('0x1c')]),_0x25c300);}});ami['on'](_0xedfa('0x1f'),function(_0x210ce1){try{utils['debug'](util[_0xedfa('0x19')](_0xedfa('0x20'),_0x210ce1['uniqueid']),_0x210ce1);agents[_0xedfa('0x1f')](_0x210ce1);queues[_0xedfa('0x1f')](_0x210ce1);}catch(_0x2f7889){utils[_0xedfa('0x13')](util[_0xedfa('0x19')]('[%s][index][agentconnect]',_0x210ce1['uniqueid']),_0x2f7889);}});ami['on']('agentcomplete',function(_0x62a1b){try{utils['debug'](util[_0xedfa('0x19')](_0xedfa('0x21'),_0x62a1b[_0xedfa('0x1c')]),_0x62a1b);agents['agentcomplete'](_0x62a1b);queues[_0xedfa('0x22')](_0x62a1b);members[_0xedfa('0x22')](_0x62a1b);}catch(_0x13c934){utils['error'](util[_0xedfa('0x19')]('[%s][index][agentcomplete]',_0x62a1b[_0xedfa('0x1c')]),_0x13c934);}});ami['on'](_0xedfa('0x23'),function(_0x4c9dbc){try{utils[_0xedfa('0x17')](util[_0xedfa('0x19')](_0xedfa('0x24'),_0x4c9dbc[_0xedfa('0x1c')]),_0x4c9dbc);agents[_0xedfa('0x23')](_0x4c9dbc);queues['queuecallerabandon'](_0x4c9dbc);}catch(_0x318fe2){utils['error'](util[_0xedfa('0x19')](_0xedfa('0x24'),_0x4c9dbc[_0xedfa('0x1c')]),_0x318fe2);}});ami['on'](_0xedfa('0x25'),function(_0x4b7904){try{utils['debug'](util[_0xedfa('0x19')](_0xedfa('0x26'),_0x4b7904[_0xedfa('0x1c')]),_0x4b7904);queues[_0xedfa('0x25')](_0x4b7904);recordings['queuecallerjoin'](_0x4b7904);}catch(_0x3db114){utils[_0xedfa('0x13')](util['format'](_0xedfa('0x26'),_0x4b7904['uniqueid']),_0x3db114);}});ami['on'](_0xedfa('0x27'),function(_0x50a422){try{utils['debug'](util[_0xedfa('0x19')](_0xedfa('0x28'),_0x50a422[_0xedfa('0x1c')]),_0x50a422);queues['queuecallerleave'](_0x50a422);}catch(_0x4a0cef){utils[_0xedfa('0x13')](util['format'](_0xedfa('0x28'),_0x50a422[_0xedfa('0x1c')]),_0x4a0cef);}});ami['on'](_0xedfa('0x29'),function(_0x3f0dbf){try{utils[_0xedfa('0x17')](util[_0xedfa('0x19')](_0xedfa('0x2a'),_0x3f0dbf[_0xedfa('0x1c')]),_0x3f0dbf);queues['musiconholdstart'](_0x3f0dbf);calls['musiconholdstart'](_0x3f0dbf);}catch(_0x51fb6c){utils['error'](util[_0xedfa('0x19')](_0xedfa('0x2a'),_0x3f0dbf[_0xedfa('0x1c')]),_0x51fb6c);}});ami['on']('musiconholdstop',function(_0x5c5fe9){try{utils['debug'](util[_0xedfa('0x19')]('[%s][index][musiconholdstop]',_0x5c5fe9[_0xedfa('0x1c')]),_0x5c5fe9);queues[_0xedfa('0x2b')](_0x5c5fe9);calls[_0xedfa('0x2b')](_0x5c5fe9);}catch(_0x3b66ea){utils[_0xedfa('0x13')](util[_0xedfa('0x19')](_0xedfa('0x2c'),_0x5c5fe9['uniqueid']),_0x3b66ea);}});ami['on'](_0xedfa('0x2d'),function(_0x29a577){try{utils[_0xedfa('0x17')](util[_0xedfa('0x19')](_0xedfa('0x2e'),_0x29a577[_0xedfa('0x1c')]),_0x29a577);calls[_0xedfa('0x2d')](_0x29a577);recordings['newstate'](_0x29a577);}catch(_0x4e095e){utils[_0xedfa('0x13')](util[_0xedfa('0x19')](_0xedfa('0x2e'),_0x29a577[_0xedfa('0x1c')]),_0x4e095e);}});ami['on'](_0xedfa('0x2f'),function(_0x1b4ccc){try{utils['debug'](util[_0xedfa('0x19')]('[%s][index][hangup]',_0x1b4ccc[_0xedfa('0x1c')]),_0x1b4ccc);calls[_0xedfa('0x2f')](_0x1b4ccc);recordings['hangup'](_0x1b4ccc);dials[_0xedfa('0x2f')](_0x1b4ccc);agents[_0xedfa('0x2f')](_0x1b4ccc);queues[_0xedfa('0x2f')](_0x1b4ccc);}catch(_0x3389b9){utils[_0xedfa('0x13')](util[_0xedfa('0x19')]('[%s][index][hangup]',_0x1b4ccc['uniqueid']),_0x3389b9);}});ami['on'](_0xedfa('0x30'),function(_0x5a11c6){try{utils['debug'](util[_0xedfa('0x19')](_0xedfa('0x31'),_0x5a11c6[_0xedfa('0x1c')]),_0x5a11c6);members[_0xedfa('0x30')](_0x5a11c6);}catch(_0x290086){utils[_0xedfa('0x13')](util['format'](_0xedfa('0x31'),_0x5a11c6[_0xedfa('0x1c')]),_0x290086);}});ami['on'](_0xedfa('0x32'),function(_0x58c83d){try{utils[_0xedfa('0x17')](util[_0xedfa('0x19')](_0xedfa('0x33'),_0x58c83d[_0xedfa('0x1c')]),_0x58c83d);queues[_0xedfa('0x32')](_0x58c83d);agents[_0xedfa('0x32')](_0x58c83d);transfers['blindtransfer'](_0x58c83d);recordings[_0xedfa('0x32')](_0x58c83d);}catch(_0x509e28){utils[_0xedfa('0x13')](util[_0xedfa('0x19')]('[%s][index][blindtransfer]',_0x58c83d[_0xedfa('0x1c')]),_0x509e28);}});ami['on'](_0xedfa('0x34'),function(_0x23654c){try{utils[_0xedfa('0x17')](util[_0xedfa('0x19')](_0xedfa('0x35'),_0x23654c[_0xedfa('0x36')]),_0x23654c);queues[_0xedfa('0x34')](_0x23654c);transfers[_0xedfa('0x34')](_0x23654c);agents[_0xedfa('0x34')](_0x23654c);calls[_0xedfa('0x34')](_0x23654c);}catch(_0x331a93){utils[_0xedfa('0x13')](util[_0xedfa('0x19')](_0xedfa('0x35'),_0x23654c[_0xedfa('0x36')]),_0x331a93);}});ami['on'](_0xedfa('0x37'),function(_0x296ef5){try{utils[_0xedfa('0x17')](util[_0xedfa('0x19')](_0xedfa('0x38'),_0x296ef5['uniqueid']),_0x296ef5);queues['varset'](_0x296ef5);recordings['varset'](_0x296ef5);calls[_0xedfa('0x37')](_0x296ef5);dials[_0xedfa('0x37')](_0x296ef5);}catch(_0x397e46){utils[_0xedfa('0x13')](util['format'](_0xedfa('0x38'),_0x296ef5[_0xedfa('0x1c')]),_0x397e46);}});ami['on'](_0xedfa('0x39'),function(_0x4decde){try{utils[_0xedfa('0x17')](util[_0xedfa('0x19')](_0xedfa('0x3a'),_0x4decde['uniqueid']),_0x4decde);calls['newexten'](_0x4decde);recordings[_0xedfa('0x39')](_0x4decde);dials[_0xedfa('0x39')](_0x4decde);}catch(_0x7db36a){utils[_0xedfa('0x13')](util['format'](_0xedfa('0x3a'),_0x4decde[_0xedfa('0x1c')]),_0x7db36a);}});ami['on']('newchannel',function(_0x2a0b58){try{utils['debug'](util[_0xedfa('0x19')](_0xedfa('0x3b'),_0x2a0b58['uniqueid']),_0x2a0b58);calls[_0xedfa('0x3c')](_0x2a0b58);recordings[_0xedfa('0x3c')](_0x2a0b58);}catch(_0x4c09d8){utils['error'](util[_0xedfa('0x19')](_0xedfa('0x3b'),_0x2a0b58[_0xedfa('0x1c')]),_0x4c09d8);}});ami['on']('dialbegin',function(_0x2c3320){try{utils[_0xedfa('0x17')](util[_0xedfa('0x19')](_0xedfa('0x3d'),_0x2c3320[_0xedfa('0x1c')]),_0x2c3320);dials[_0xedfa('0x3e')](_0x2c3320);}catch(_0x2ceae6){utils['error'](util[_0xedfa('0x19')](_0xedfa('0x3f'),_0x2c3320[_0xedfa('0x1c')]),_0x2ceae6);}});ami['on'](_0xedfa('0x40'),function(_0x277835){try{utils[_0xedfa('0x17')](util[_0xedfa('0x19')]('[%s][index][dialend]',_0x277835['uniqueid']),_0x277835);dials['dialend'](_0x277835);}catch(_0x3f3058){utils[_0xedfa('0x13')](util['format'](_0xedfa('0x41'),_0x277835['uniqueid']),_0x3f3058);}});} \ No newline at end of file +var _0xe36e=['port','username','keepConnected','XDR\x20DISABLED','info','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','managerevent','format','device','devicestatechange','[%s][index][devicestatechange]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','debug','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','production','asterisk'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe36e,0xbb));var _0xee36=function(_0x5419f1,_0x33dbe7){_0x5419f1=_0x5419f1-0x0;var _0x2946a8=_0xe36e[_0x5419f1];return _0x2946a8;};var AsteriskManager=require(_0xee36('0x0'));var config=require('../../config/environment');var utils=require(_0xee36('0x1'));var util=require(_0xee36('0x2'));var isXDREnabled=config[_0xee36('0x3')]&&!config[_0xee36('0x3')][_0xee36('0x4')];var isProduction=config[_0xee36('0x5')]===_0xee36('0x6')||![];var isLocalAsterisk=config[_0xee36('0x3')]&&config[_0xee36('0x3')]['local']===!![]||![];var ami=new AsteriskManager(config[_0xee36('0x7')][_0xee36('0x8')],config[_0xee36('0x7')]['ip'],config[_0xee36('0x7')][_0xee36('0x9')],config[_0xee36('0x7')]['password'],!![]);ami[_0xee36('0xa')]();if(!isXDREnabled){utils['info'](_0xee36('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xee36('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xee36('0xd'));var calls=require('./calls.controller');var queues=require(_0xee36('0xe'));var recordings=require(_0xee36('0xf'));var members=require(_0xee36('0x10'));var dials=require(_0xee36('0x11'));var transfers=require('./transfers.controller');var core=require(_0xee36('0x12'));ami['on'](_0xee36('0x13'),core['connect']);ami['on']('shutdown',core[_0xee36('0x14')]);ami['on'](_0xee36('0x15'),core[_0xee36('0x15')]);ami['on'](_0xee36('0x16'),core['error']);ami['on']('close',core['close']);ami['on'](_0xee36('0x17'),core[_0xee36('0x17')]);ami['on']('devicestatechange',function(_0x3231a4){try{utils['debug'](util[_0xee36('0x18')]('[%s][index][devicestatechange]',_0x3231a4[_0xee36('0x19')]),_0x3231a4);members[_0xee36('0x1a')](_0x3231a4);}catch(_0x4a5449){utils['error'](util[_0xee36('0x18')](_0xee36('0x1b'),_0x3231a4[_0xee36('0x19')]),_0x4a5449);}});ami['on']('agentcalled',function(_0x43c208){try{utils['debug'](util[_0xee36('0x18')]('[%s][index][agentcalled]',_0x43c208[_0xee36('0x1c')]),_0x43c208);agents['agentcalled'](_0x43c208);}catch(_0x132cac){utils[_0xee36('0x16')](util['format']('[%s][index][agentcalled]',_0x43c208[_0xee36('0x1c')]),_0x132cac);}});ami['on'](_0xee36('0x1d'),function(_0xceaf42){try{utils['debug'](util[_0xee36('0x18')](_0xee36('0x1e'),_0xceaf42['uniqueid']),_0xceaf42);agents[_0xee36('0x1d')](_0xceaf42);}catch(_0x590f39){utils[_0xee36('0x16')](util[_0xee36('0x18')](_0xee36('0x1e'),_0xceaf42[_0xee36('0x1c')]),_0x590f39);}});ami['on'](_0xee36('0x1f'),function(_0x2332c3){try{utils[_0xee36('0x20')](util[_0xee36('0x18')]('[%s][index][agentconnect]',_0x2332c3[_0xee36('0x1c')]),_0x2332c3);agents[_0xee36('0x1f')](_0x2332c3);queues['agentconnect'](_0x2332c3);}catch(_0x17b54e){utils['error'](util[_0xee36('0x18')](_0xee36('0x21'),_0x2332c3[_0xee36('0x1c')]),_0x17b54e);}});ami['on'](_0xee36('0x22'),function(_0x4bcb33){try{utils['debug'](util['format'](_0xee36('0x23'),_0x4bcb33[_0xee36('0x1c')]),_0x4bcb33);agents['agentcomplete'](_0x4bcb33);queues[_0xee36('0x22')](_0x4bcb33);members['agentcomplete'](_0x4bcb33);}catch(_0x2d9617){utils['error'](util[_0xee36('0x18')]('[%s][index][agentcomplete]',_0x4bcb33['uniqueid']),_0x2d9617);}});ami['on']('queuecallerabandon',function(_0x52b500){try{utils['debug'](util['format'](_0xee36('0x24'),_0x52b500[_0xee36('0x1c')]),_0x52b500);agents[_0xee36('0x25')](_0x52b500);queues[_0xee36('0x25')](_0x52b500);}catch(_0x3d3c86){utils[_0xee36('0x16')](util[_0xee36('0x18')]('[%s][index][queuecallerabandon]',_0x52b500['uniqueid']),_0x3d3c86);}});ami['on']('queuecallerjoin',function(_0x45045f){try{utils['debug'](util[_0xee36('0x18')](_0xee36('0x26'),_0x45045f[_0xee36('0x1c')]),_0x45045f);queues[_0xee36('0x27')](_0x45045f);recordings[_0xee36('0x27')](_0x45045f);}catch(_0x34cb8c){utils[_0xee36('0x16')](util[_0xee36('0x18')](_0xee36('0x26'),_0x45045f[_0xee36('0x1c')]),_0x34cb8c);}});ami['on']('queuecallerleave',function(_0xfb3c34){try{utils[_0xee36('0x20')](util[_0xee36('0x18')]('[%s][index][queuecallerleave]',_0xfb3c34[_0xee36('0x1c')]),_0xfb3c34);queues[_0xee36('0x28')](_0xfb3c34);}catch(_0x50f441){utils['error'](util['format']('[%s][index][queuecallerleave]',_0xfb3c34['uniqueid']),_0x50f441);}});ami['on'](_0xee36('0x29'),function(_0x139841){try{utils[_0xee36('0x20')](util[_0xee36('0x18')](_0xee36('0x2a'),_0x139841['uniqueid']),_0x139841);queues[_0xee36('0x29')](_0x139841);calls[_0xee36('0x29')](_0x139841);}catch(_0x10554e){utils['error'](util[_0xee36('0x18')](_0xee36('0x2a'),_0x139841[_0xee36('0x1c')]),_0x10554e);}});ami['on'](_0xee36('0x2b'),function(_0x5829bf){try{utils[_0xee36('0x20')](util[_0xee36('0x18')](_0xee36('0x2c'),_0x5829bf[_0xee36('0x1c')]),_0x5829bf);queues[_0xee36('0x2b')](_0x5829bf);calls[_0xee36('0x2b')](_0x5829bf);}catch(_0x1d883b){utils['error'](util[_0xee36('0x18')](_0xee36('0x2c'),_0x5829bf[_0xee36('0x1c')]),_0x1d883b);}});ami['on'](_0xee36('0x2d'),function(_0x4cc008){try{utils[_0xee36('0x20')](util[_0xee36('0x18')]('[%s][index][newstate]',_0x4cc008[_0xee36('0x1c')]),_0x4cc008);calls[_0xee36('0x2d')](_0x4cc008);recordings['newstate'](_0x4cc008);}catch(_0x49eefd){utils[_0xee36('0x16')](util[_0xee36('0x18')](_0xee36('0x2e'),_0x4cc008['uniqueid']),_0x49eefd);}});ami['on']('hangup',function(_0x3f2250){try{utils['debug'](util[_0xee36('0x18')](_0xee36('0x2f'),_0x3f2250[_0xee36('0x1c')]),_0x3f2250);calls['hangup'](_0x3f2250);recordings['hangup'](_0x3f2250);dials[_0xee36('0x30')](_0x3f2250);agents[_0xee36('0x30')](_0x3f2250);queues[_0xee36('0x30')](_0x3f2250);}catch(_0x395398){utils[_0xee36('0x16')](util['format']('[%s][index][hangup]',_0x3f2250[_0xee36('0x1c')]),_0x395398);}});ami['on'](_0xee36('0x31'),function(_0x222b11){try{utils[_0xee36('0x20')](util['format'](_0xee36('0x32'),_0x222b11[_0xee36('0x1c')]),_0x222b11);members['cdr'](_0x222b11);}catch(_0x5c464b){utils[_0xee36('0x16')](util[_0xee36('0x18')](_0xee36('0x32'),_0x222b11[_0xee36('0x1c')]),_0x5c464b);}});ami['on'](_0xee36('0x33'),function(_0x4e9031){try{utils[_0xee36('0x20')](util['format'](_0xee36('0x34'),_0x4e9031[_0xee36('0x1c')]),_0x4e9031);queues[_0xee36('0x33')](_0x4e9031);agents['blindtransfer'](_0x4e9031);transfers[_0xee36('0x33')](_0x4e9031);recordings['blindtransfer'](_0x4e9031);}catch(_0x4d9048){utils['error'](util[_0xee36('0x18')](_0xee36('0x34'),_0x4e9031['uniqueid']),_0x4d9048);}});ami['on'](_0xee36('0x35'),function(_0xd85d59){try{utils['debug'](util[_0xee36('0x18')](_0xee36('0x36'),_0xd85d59[_0xee36('0x37')]),_0xd85d59);queues['attendedtransfer'](_0xd85d59);transfers['attendedtransfer'](_0xd85d59);agents['attendedtransfer'](_0xd85d59);calls[_0xee36('0x35')](_0xd85d59);}catch(_0x1bad52){utils[_0xee36('0x16')](util[_0xee36('0x18')]('[%s][index][attendedtransfer]',_0xd85d59[_0xee36('0x37')]),_0x1bad52);}});ami['on'](_0xee36('0x38'),function(_0x4bc0dc){try{utils[_0xee36('0x20')](util['format'](_0xee36('0x39'),_0x4bc0dc['uniqueid']),_0x4bc0dc);queues[_0xee36('0x38')](_0x4bc0dc);recordings['varset'](_0x4bc0dc);calls[_0xee36('0x38')](_0x4bc0dc);dials[_0xee36('0x38')](_0x4bc0dc);}catch(_0x137745){utils[_0xee36('0x16')](util['format']('[%s][index][varset]',_0x4bc0dc[_0xee36('0x1c')]),_0x137745);}});ami['on'](_0xee36('0x3a'),function(_0x38bad1){try{utils[_0xee36('0x20')](util[_0xee36('0x18')](_0xee36('0x3b'),_0x38bad1[_0xee36('0x1c')]),_0x38bad1);calls['newexten'](_0x38bad1);recordings['newexten'](_0x38bad1);dials[_0xee36('0x3a')](_0x38bad1);}catch(_0x35a33f){utils[_0xee36('0x16')](util['format'](_0xee36('0x3b'),_0x38bad1[_0xee36('0x1c')]),_0x35a33f);}});ami['on'](_0xee36('0x3c'),function(_0x5a90f3){try{utils[_0xee36('0x20')](util[_0xee36('0x18')]('[%s][index][newchannel]',_0x5a90f3[_0xee36('0x1c')]),_0x5a90f3);calls['newchannel'](_0x5a90f3);recordings[_0xee36('0x3c')](_0x5a90f3);}catch(_0x4f2069){utils['error'](util[_0xee36('0x18')](_0xee36('0x3d'),_0x5a90f3['uniqueid']),_0x4f2069);}});ami['on']('dialbegin',function(_0x18630e){try{utils[_0xee36('0x20')](util[_0xee36('0x18')]('[%s][index][dialbegin]',_0x18630e[_0xee36('0x1c')]),_0x18630e);dials['dialbegin'](_0x18630e);}catch(_0x490cc5){utils['error'](util[_0xee36('0x18')](_0xee36('0x3e'),_0x18630e[_0xee36('0x1c')]),_0x490cc5);}});ami['on'](_0xee36('0x3f'),function(_0x2a9f91){try{utils[_0xee36('0x20')](util['format'](_0xee36('0x40'),_0x2a9f91[_0xee36('0x1c')]),_0x2a9f91);dials[_0xee36('0x3f')](_0x2a9f91);}catch(_0x463e9d){utils[_0xee36('0x16')](util[_0xee36('0x18')](_0xee36('0x40'),_0x2a9f91['uniqueid']),_0x463e9d);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 0a71bc0..9173e8a 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 _0xbd3b=['[%s][members][cdr]','lodash','util','./utils','Queue:','info','format','uniqueid','interface','data2','type','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','some','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','TALKING','now','agent','isNil','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','channel','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','exitAt','destinationchannel','destination'];(function(_0x57767a,_0x2603ac){var _0x357603=function(_0x2a886b){while(--_0x2a886b){_0x57767a['push'](_0x57767a['shift']());}};_0x357603(++_0x2603ac);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0x1ad279,_0x42d157){_0x1ad279=_0x1ad279-0x0;var _0x272861=_0xbd3b[_0x1ad279];return _0x272861;};'use strict';var _=require(_0xbbd3('0x0'));var util=require(_0xbbd3('0x1'));var utils=require(_0xbbd3('0x2'));var members={};var exclude=['Local/_attended@transfer',_0xbbd3('0x3')];function writeDB(_0xe94b7b){utils[_0xbbd3('0x4')](util[_0xbbd3('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0xe94b7b[_0xbbd3('0x6')],_0xe94b7b[_0xbbd3('0x7')],_0xe94b7b['channel'],_0xe94b7b[_0xbbd3('0x8')],_0xe94b7b['membername'],_0xe94b7b[_0xbbd3('0x9')]));if(_0xe94b7b[_0xbbd3('0x7')]){utils[_0xbbd3('0xa')](_0xe94b7b['interface'])[_0xbbd3('0xb')](function(_0x21be70){if(_0x21be70){_0xe94b7b[_0xbbd3('0xc')]=_0x21be70[_0xbbd3('0xd')];_0xe94b7b['internal']=_0x21be70[_0xbbd3('0xe')];utils[_0xbbd3('0xf')](_0xbbd3('0x10'),_0xe94b7b);}else{utils[_0xbbd3('0x11')](_0xe94b7b['interface'][_0xbbd3('0x12')]('/')[0x1])['then'](function(_0x5e4ae4){if(_0x5e4ae4){_0xe94b7b[_0xbbd3('0xc')]=_0x5e4ae4[_0xbbd3('0xd')];_0xe94b7b[_0xbbd3('0xe')]=_0x5e4ae4[_0xbbd3('0xe')];utils[_0xbbd3('0xf')](_0xbbd3('0x10'),_0xe94b7b);}});}})[_0xbbd3('0x13')](function(_0x41b1fa){utils[_0xbbd3('0x14')](util[_0xbbd3('0x5')]('[%s][members][writeDB]',_0xe94b7b['uniqueid']),_0x41b1fa);});}delete members[_0xe94b7b[_0xbbd3('0x7')]];}function startsWith(_0xda19d6,_0x38b4ba){return _[_0xbbd3('0x15')](_0xda19d6,function(_0xbeeb6b){return _['startsWith'](_0x38b4ba,_0xbeeb6b);});}exports[_0xbbd3('0x16')]=function(_0x49d6b9){try{utils[_0xbbd3('0x17')](util[_0xbbd3('0x5')](_0xbbd3('0x18'),members[_0x49d6b9[_0xbbd3('0x19')]]?members[_0x49d6b9['device']]['uniqueid']:_0x49d6b9[_0xbbd3('0x19')]),_0x49d6b9);utils[_0xbbd3('0x4')](util['format'](_0xbbd3('0x1a'),members[_0x49d6b9['device']]?members[_0x49d6b9[_0xbbd3('0x19')]][_0xbbd3('0x6')]:_0x49d6b9[_0xbbd3('0x19')],_0x49d6b9[_0xbbd3('0x1b')],_0x49d6b9[_0xbbd3('0x19')]));switch(_0x49d6b9[_0xbbd3('0x1b')]){case _0xbbd3('0x1c'):case'BUSY':if(!startsWith(exclude,_0x49d6b9[_0xbbd3('0x19')])){members[_0x49d6b9['device']]={'channel':'voice','interface':_0x49d6b9[_0xbbd3('0x19')],'type':_0xbbd3('0x1d'),'enterAt':utils[_0xbbd3('0x1e')](),'role':_0xbbd3('0x1f')};}break;case'NOT_INUSE':if(!_[_0xbbd3('0x20')](members[_0x49d6b9['device']])){members[_0x49d6b9[_0xbbd3('0x19')]]['exitAt']=utils['now']();members[_0x49d6b9['device']]['duration']=utils[_0xbbd3('0x21')](members[_0x49d6b9[_0xbbd3('0x19')]]['exitAt'],members[_0x49d6b9[_0xbbd3('0x19')]][_0xbbd3('0x22')]);if(members[_0x49d6b9[_0xbbd3('0x19')]][_0xbbd3('0x6')]){writeDB(members[_0x49d6b9['device']]);}}break;default:break;}}catch(_0x34ce0e){utils['error'](util[_0xbbd3('0x5')](_0xbbd3('0x18'),members[_0x49d6b9['device']]?members[_0x49d6b9[_0xbbd3('0x19')]][_0xbbd3('0x6')]:_0x49d6b9[_0xbbd3('0x19')]),_0x34ce0e);}};exports[_0xbbd3('0x23')]=function(_0x3780e4){try{if(!_[_0xbbd3('0x20')](members[_0x3780e4[_0xbbd3('0x7')]])){utils[_0xbbd3('0x17')](util[_0xbbd3('0x5')]('[%s][members][agentcomplete]',_0x3780e4[_0xbbd3('0x6')]),_0x3780e4);utils[_0xbbd3('0x4')](util[_0xbbd3('0x5')](_0xbbd3('0x24'),_0x3780e4['uniqueid'],_0x3780e4['interface'],_0x3780e4[_0xbbd3('0x25')]));members[_0x3780e4[_0xbbd3('0x7')]]=_[_0xbbd3('0x26')](members[_0x3780e4[_0xbbd3('0x7')]],{'data4':_0x3780e4['queue'],'uniqueid':_0x3780e4[_0xbbd3('0x6')]});}}catch(_0x38dbf0){utils[_0xbbd3('0x14')](util['format'](_0xbbd3('0x27'),_0x3780e4[_0xbbd3('0x6')]),_0x38dbf0);}};exports[_0xbbd3('0x28')]=function(_0x46a43e){try{utils[_0xbbd3('0x17')](util[_0xbbd3('0x5')]('[%s][members][cdr]',_0x46a43e['uniqueid']),_0x46a43e);if(_0x46a43e['channel']){var _0x9262d8=_0x46a43e[_0xbbd3('0x29')]['split']('-')[0x0];if(!_['isNil'](members[_0x9262d8])){members[_0x9262d8]=_['assign'](members[_0x9262d8],{'data1':members[_0x9262d8]['data1']||_0x46a43e[_0xbbd3('0x9')],'data2':members[_0x9262d8][_0xbbd3('0x8')]||_0x46a43e[_0xbbd3('0x2a')],'data3':members[_0x9262d8][_0xbbd3('0x2b')]||_0x46a43e['destination'],'uniqueid':members[_0x9262d8][_0xbbd3('0x6')]||_0x46a43e[_0xbbd3('0x6')]});utils['info'](util[_0xbbd3('0x5')](_0xbbd3('0x2c'),_0x46a43e[_0xbbd3('0x6')],members[_0x9262d8][_0xbbd3('0x2d')],members[_0x9262d8]['data2'],members[_0x9262d8][_0xbbd3('0x2b')]));if(members[_0x9262d8][_0xbbd3('0x2e')]){writeDB(members[_0x9262d8]);}}}if(_0x46a43e[_0xbbd3('0x2f')]){var _0x185690=_0x46a43e[_0xbbd3('0x2f')][_0xbbd3('0x12')]('-')[0x0];if(!_[_0xbbd3('0x20')](members[_0x185690])){members[_0x185690]=_[_0xbbd3('0x26')](members[_0x185690],{'data1':members[_0x185690][_0xbbd3('0x2d')]||_0x46a43e[_0xbbd3('0x9')],'data2':members[_0x185690][_0xbbd3('0x8')]||_0x46a43e[_0xbbd3('0x2a')],'data3':members[_0x185690][_0xbbd3('0x2b')]||_0x46a43e[_0xbbd3('0x30')],'uniqueid':members[_0x185690]['uniqueid']||_0x46a43e['uniqueid']});utils[_0xbbd3('0x4')](util[_0xbbd3('0x5')](_0xbbd3('0x2c'),_0x46a43e['uniqueid'],members[_0x185690][_0xbbd3('0x2d')],members[_0x185690][_0xbbd3('0x8')],members[_0x185690][_0xbbd3('0x2b')]));if(members[_0x185690][_0xbbd3('0x2e')]){writeDB(members[_0x185690]);}}}}catch(_0x21ddbb){utils[_0xbbd3('0x14')](util[_0xbbd3('0x5')](_0xbbd3('0x31'),_0x46a43e['uniqueid']),_0x21ddbb);}}; \ No newline at end of file +var _0x5304=['NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','split','assign','data1','type','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','info','format','uniqueid','channel','membername','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','catch','error','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','BUSY','voice','now','agent'];(function(_0x65bb18,_0x281984){var _0x14701e=function(_0x1cfeba){while(--_0x1cfeba){_0x65bb18['push'](_0x65bb18['shift']());}};_0x14701e(++_0x281984);}(_0x5304,0x167));var _0x4530=function(_0xe7281f,_0x2d77c3){_0xe7281f=_0xe7281f-0x0;var _0x90dc99=_0x5304[_0xe7281f];return _0x90dc99;};'use strict';var _=require(_0x4530('0x0'));var util=require(_0x4530('0x1'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x719e6b){utils[_0x4530('0x2')](util[_0x4530('0x3')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x719e6b[_0x4530('0x4')],_0x719e6b['interface'],_0x719e6b[_0x4530('0x5')],_0x719e6b['data2'],_0x719e6b[_0x4530('0x6')],_0x719e6b['type']));if(_0x719e6b[_0x4530('0x7')]){utils[_0x4530('0x8')](_0x719e6b[_0x4530('0x7')])[_0x4530('0x9')](function(_0x230db3){if(_0x230db3){_0x719e6b['membername']=_0x230db3[_0x4530('0xa')];_0x719e6b[_0x4530('0xb')]=_0x230db3[_0x4530('0xb')];utils['request']('CreateMemberReport',_0x719e6b);}else{utils['getUserByName'](_0x719e6b['interface']['split']('/')[0x1])['then'](function(_0x485c63){if(_0x485c63){_0x719e6b['membername']=_0x485c63[_0x4530('0xa')];_0x719e6b[_0x4530('0xb')]=_0x485c63[_0x4530('0xb')];utils[_0x4530('0xc')](_0x4530('0xd'),_0x719e6b);}});}})[_0x4530('0xe')](function(_0x20a07f){utils[_0x4530('0xf')](util[_0x4530('0x3')]('[%s][members][writeDB]',_0x719e6b[_0x4530('0x4')]),_0x20a07f);});}delete members[_0x719e6b[_0x4530('0x7')]];}function startsWith(_0x1ab39b,_0x18b1df){return _['some'](_0x1ab39b,function(_0x31999b){return _[_0x4530('0x10')](_0x18b1df,_0x31999b);});}exports[_0x4530('0x11')]=function(_0x126da1){try{utils[_0x4530('0x12')](util[_0x4530('0x3')]('[%s][members][devicestatechange]',members[_0x126da1[_0x4530('0x13')]]?members[_0x126da1[_0x4530('0x13')]][_0x4530('0x4')]:_0x126da1[_0x4530('0x13')]),_0x126da1);utils[_0x4530('0x2')](util['format'](_0x4530('0x14'),members[_0x126da1['device']]?members[_0x126da1[_0x4530('0x13')]][_0x4530('0x4')]:_0x126da1[_0x4530('0x13')],_0x126da1['state'],_0x126da1['device']));switch(_0x126da1['state']){case'INUSE':case _0x4530('0x15'):if(!startsWith(exclude,_0x126da1['device'])){members[_0x126da1[_0x4530('0x13')]]={'channel':_0x4530('0x16'),'interface':_0x126da1[_0x4530('0x13')],'type':'TALKING','enterAt':utils[_0x4530('0x17')](),'role':_0x4530('0x18')};}break;case _0x4530('0x19'):if(!_[_0x4530('0x1a')](members[_0x126da1[_0x4530('0x13')]])){members[_0x126da1['device']][_0x4530('0x1b')]=utils[_0x4530('0x17')]();members[_0x126da1[_0x4530('0x13')]][_0x4530('0x1c')]=utils[_0x4530('0x1d')](members[_0x126da1[_0x4530('0x13')]][_0x4530('0x1b')],members[_0x126da1[_0x4530('0x13')]][_0x4530('0x1e')]);if(members[_0x126da1[_0x4530('0x13')]]['uniqueid']){writeDB(members[_0x126da1[_0x4530('0x13')]]);}}break;default:break;}}catch(_0x1cbf7e){utils[_0x4530('0xf')](util['format'](_0x4530('0x1f'),members[_0x126da1[_0x4530('0x13')]]?members[_0x126da1['device']]['uniqueid']:_0x126da1['device']),_0x1cbf7e);}};exports[_0x4530('0x20')]=function(_0x235356){try{if(!_[_0x4530('0x1a')](members[_0x235356[_0x4530('0x7')]])){utils['debug'](util['format'](_0x4530('0x21'),_0x235356[_0x4530('0x4')]),_0x235356);utils[_0x4530('0x2')](util[_0x4530('0x3')](_0x4530('0x22'),_0x235356['uniqueid'],_0x235356[_0x4530('0x7')],_0x235356[_0x4530('0x23')]));members[_0x235356['interface']]=_['assign'](members[_0x235356['interface']],{'data4':_0x235356[_0x4530('0x23')],'uniqueid':_0x235356[_0x4530('0x4')]});}}catch(_0x294711){utils[_0x4530('0xf')](util[_0x4530('0x3')](_0x4530('0x21'),_0x235356['uniqueid']),_0x294711);}};exports[_0x4530('0x24')]=function(_0x37df0d){try{utils['debug'](util[_0x4530('0x3')](_0x4530('0x25'),_0x37df0d['uniqueid']),_0x37df0d);if(_0x37df0d[_0x4530('0x5')]){var _0x45a419=_0x37df0d[_0x4530('0x5')][_0x4530('0x26')]('-')[0x0];if(!_[_0x4530('0x1a')](members[_0x45a419])){members[_0x45a419]=_[_0x4530('0x27')](members[_0x45a419],{'data1':members[_0x45a419][_0x4530('0x28')]||_0x37df0d[_0x4530('0x29')],'data2':members[_0x45a419][_0x4530('0x2a')]||_0x37df0d[_0x4530('0x2b')],'data3':members[_0x45a419][_0x4530('0x2c')]||_0x37df0d[_0x4530('0x2d')],'uniqueid':members[_0x45a419]['uniqueid']||_0x37df0d[_0x4530('0x4')]});utils['info'](util['format'](_0x4530('0x2e'),_0x37df0d[_0x4530('0x4')],members[_0x45a419][_0x4530('0x28')],members[_0x45a419][_0x4530('0x2a')],members[_0x45a419]['data3']));if(members[_0x45a419]['exitAt']){writeDB(members[_0x45a419]);}}}if(_0x37df0d['destinationchannel']){var _0x19ad51=_0x37df0d[_0x4530('0x2f')][_0x4530('0x26')]('-')[0x0];if(!_[_0x4530('0x1a')](members[_0x19ad51])){members[_0x19ad51]=_[_0x4530('0x27')](members[_0x19ad51],{'data1':members[_0x19ad51][_0x4530('0x28')]||_0x37df0d[_0x4530('0x29')],'data2':members[_0x19ad51][_0x4530('0x2a')]||_0x37df0d[_0x4530('0x2b')],'data3':members[_0x19ad51][_0x4530('0x2c')]||_0x37df0d[_0x4530('0x2d')],'uniqueid':members[_0x19ad51][_0x4530('0x4')]||_0x37df0d[_0x4530('0x4')]});utils[_0x4530('0x2')](util[_0x4530('0x3')](_0x4530('0x2e'),_0x37df0d[_0x4530('0x4')],members[_0x19ad51][_0x4530('0x28')],members[_0x19ad51][_0x4530('0x2a')],members[_0x19ad51][_0x4530('0x2c')]));if(members[_0x19ad51][_0x4530('0x1b')]){writeDB(members[_0x19ad51]);}}}}catch(_0x386cb5){utils[_0x4530('0xf')](util['format'](_0x4530('0x25'),_0x37df0d[_0x4530('0x4')]),_0x386cb5);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index bf26733..7bfa93b 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 _0xa932=['format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','[%s][queues][queuecallerjoin]','hangup','isNil','debug','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','queuestatus','CONTINUE','queuecallerexitAt','value','toUpperCase','queuecallerabandonAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','queuecallerenterreason','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','lodash','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0xa932,0xb5));var _0x2a93=function(_0xa1f3d9,_0x2a0fa4){_0xa1f3d9=_0xa1f3d9-0x0;var _0x5dcb0a=_0xa932[_0xa1f3d9];return _0x5dcb0a;};'use strict';var _=require(_0x2a93('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x80a698){utils[_0x2a93('0x1')](util['format'](_0x2a93('0x2'),_0x80a698[_0x2a93('0x3')],_0x80a698[_0x2a93('0x4')],_0x80a698[_0x2a93('0x5')],_0x80a698[_0x2a93('0x6')],_0x80a698['calleridnum'],_0x80a698[_0x2a93('0x7')],_0x80a698[_0x2a93('0x8')]));if(_0x80a698[_0x2a93('0x5')]){utils['getVoiceQueueByName'](_0x80a698[_0x2a93('0x5')])[_0x2a93('0x9')](function(_0x19e344){if(_0x19e344){_0x80a698[_0x2a93('0xa')]=_0x19e344['type'];}utils[_0x2a93('0xb')]('CreateVoiceQueueReport',_0x80a698);});}else{utils[_0x2a93('0xb')](_0x2a93('0xc'),_0x80a698);}if(_0x80a698[_0x2a93('0xd')]){delete queues[_0x80a698[_0x2a93('0xd')]];}else{delete queues[_0x80a698[_0x2a93('0x3')]];}}exports[_0x2a93('0xe')]=function(_0x36f12b){try{utils['debug'](util[_0x2a93('0xf')]('[%s][queues][queuecallerjoin]',_0x36f12b[_0x2a93('0x3')]),_0x36f12b);utils['info'](util[_0x2a93('0xf')](_0x2a93('0x10'),_0x36f12b[_0x2a93('0x3')],_0x36f12b[_0x2a93('0x5')],_0x36f12b[_0x2a93('0x11')]));queues[_0x36f12b['uniqueid']]=_[_0x2a93('0x12')](_0x36f12b,{'originalposition':_0x36f12b[_0x2a93('0x11')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x1e1227){utils[_0x2a93('0x13')](util[_0x2a93('0xf')](_0x2a93('0x14'),_0x36f12b[_0x2a93('0x3')]),_0x1e1227);}};exports[_0x2a93('0x15')]=function(_0x37f777){try{if(!_[_0x2a93('0x16')](queues[_0x37f777[_0x2a93('0x3')]])){utils[_0x2a93('0x17')](util[_0x2a93('0xf')](_0x2a93('0x18'),_0x37f777[_0x2a93('0x3')]),_0x37f777);if(queues[_0x37f777[_0x2a93('0x3')]]['queuecallerleaveAt']){if(!queues[_0x37f777['uniqueid']][_0x2a93('0x19')]&&!queues[_0x37f777[_0x2a93('0x3')]][_0x2a93('0x1a')]){queues[_0x37f777['uniqueid']][_0x2a93('0x1b')]=!![];queues[_0x37f777['uniqueid']][_0x2a93('0x1c')]=utils[_0x2a93('0x1d')]();queues[_0x37f777[_0x2a93('0x3')]][_0x2a93('0x8')]='COMPLETEDBYAGENT';}utils[_0x2a93('0x1')](util[_0x2a93('0xf')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x37f777[_0x2a93('0x3')],queues[_0x37f777[_0x2a93('0x3')]][_0x2a93('0x1e')],queues[_0x37f777[_0x2a93('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x37f777[_0x2a93('0x3')]]);}else if(queues[_0x37f777[_0x2a93('0x3')]][_0x2a93('0xd')]){utils[_0x2a93('0x1')](util[_0x2a93('0xf')](_0x2a93('0x1f'),_0x37f777[_0x2a93('0x3')],queues[_0x37f777[_0x2a93('0x3')]][_0x2a93('0x1e')],queues[_0x37f777[_0x2a93('0x3')]][_0x2a93('0xd')]));queues[queues[_0x37f777[_0x2a93('0x3')]][_0x2a93('0xd')]]=queues[_0x37f777[_0x2a93('0x3')]];queues[queues[_0x37f777[_0x2a93('0x3')]][_0x2a93('0xd')]]['queuecallerenterreason']=0x2;delete queues[_0x37f777[_0x2a93('0x3')]];}}}catch(_0x5bc46a){utils[_0x2a93('0x13')](util[_0x2a93('0xf')](_0x2a93('0x18'),_0x37f777[_0x2a93('0x3')]),_0x5bc46a);}};exports[_0x2a93('0x20')]=function(_0x5aec07){try{utils[_0x2a93('0x17')](util['format'](_0x2a93('0x21'),_0x5aec07['uniqueid']),_0x5aec07);if(!_['isNil'](_0x5aec07[_0x2a93('0x22')][_0x2a93('0x23')])&&_0x5aec07['value']['toUpperCase']()!==_0x2a93('0x24')){if(!_['isNil'](queues[_0x5aec07[_0x2a93('0x3')]])){queues[_0x5aec07[_0x2a93('0x3')]][_0x2a93('0x19')]=![];queues[_0x5aec07['uniqueid']]['queuecallerabandonAt']=null;queues[_0x5aec07[_0x2a93('0x3')]][_0x2a93('0x1a')]=!![];queues[_0x5aec07[_0x2a93('0x3')]][_0x2a93('0x25')]=utils[_0x2a93('0x1d')]();queues[_0x5aec07[_0x2a93('0x3')]]['queuecallerexitreason']=_0x5aec07[_0x2a93('0x26')][_0x2a93('0x27')]();utils['info'](util[_0x2a93('0xf')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x5aec07[_0x2a93('0x3')],queues[_0x5aec07[_0x2a93('0x3')]][_0x2a93('0x1e')],_0x5aec07[_0x2a93('0x26')],queues[_0x5aec07[_0x2a93('0x3')]][_0x2a93('0x8')]));writeDB(queues[_0x5aec07[_0x2a93('0x3')]]);}}else if(!_[_0x2a93('0x16')](_0x5aec07[_0x2a93('0x22')]['queueposition'])){if(!_[_0x2a93('0x16')](queues[_0x5aec07[_0x2a93('0x3')]])&&!queues[_0x5aec07[_0x2a93('0x3')]][_0x2a93('0x19')]){queues[_0x5aec07['uniqueid']][_0x2a93('0x19')]=![];queues[_0x5aec07[_0x2a93('0x3')]]['queuecallerabandonAt']=null;queues[_0x5aec07[_0x2a93('0x3')]][_0x2a93('0x1a')]=!![];queues[_0x5aec07[_0x2a93('0x3')]]['queuecallerexitAt']=utils[_0x2a93('0x1d')]();queues[_0x5aec07[_0x2a93('0x3')]]['queuecallerexitreason']='EXITWITHKEY';utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x5aec07[_0x2a93('0x3')],queues[_0x5aec07[_0x2a93('0x3')]][_0x2a93('0x1e')],_0x5aec07[_0x2a93('0x26')],queues[_0x5aec07[_0x2a93('0x3')]][_0x2a93('0x8')]));}}}catch(_0x1c1e5f){utils['error'](util['format'](_0x2a93('0x21'),_0x5aec07['uniqueid']),_0x1c1e5f);}};exports['queuecallerabandon']=function(_0x2a1e34){try{if(!_['isNil'](queues[_0x2a1e34[_0x2a93('0x3')]])){utils[_0x2a93('0x17')](util[_0x2a93('0xf')]('[%s][queues][queuecallerabandon]',_0x2a1e34[_0x2a93('0x3')]),_0x2a1e34);queues[_0x2a1e34[_0x2a93('0x3')]][_0x2a93('0x1a')]=![];queues[_0x2a1e34[_0x2a93('0x3')]][_0x2a93('0x25')]=null;queues[_0x2a1e34[_0x2a93('0x3')]][_0x2a93('0x19')]=!![];queues[_0x2a1e34[_0x2a93('0x3')]][_0x2a93('0x28')]=utils['now']();queues[_0x2a1e34['uniqueid']][_0x2a93('0x8')]=_0x2a93('0x29');utils[_0x2a93('0x1')](util['format'](_0x2a93('0x2a'),_0x2a1e34[_0x2a93('0x3')],queues[_0x2a1e34[_0x2a93('0x3')]][_0x2a93('0x1e')],queues[_0x2a1e34[_0x2a93('0x3')]][_0x2a93('0x8')]));}}catch(_0x15eef7){utils[_0x2a93('0x13')](util[_0x2a93('0xf')](_0x2a93('0x2b'),_0x2a1e34[_0x2a93('0x3')]),_0x15eef7);}};exports['queuecallerleave']=function(_0x509cf7){try{if(!_['isNil'](queues[_0x509cf7[_0x2a93('0x3')]])){utils[_0x2a93('0x17')](util[_0x2a93('0xf')](_0x2a93('0x2c'),_0x509cf7[_0x2a93('0x3')]),_0x509cf7);utils[_0x2a93('0x1')](util[_0x2a93('0xf')](_0x2a93('0x2d'),_0x509cf7['uniqueid'],queues[_0x509cf7[_0x2a93('0x3')]][_0x2a93('0x1e')],_0x509cf7['connectedlinenum'],_0x509cf7['connectedlinename']));queues[_0x509cf7[_0x2a93('0x3')]][_0x2a93('0x2e')]=!![];queues[_0x509cf7[_0x2a93('0x3')]][_0x2a93('0x2f')]=utils[_0x2a93('0x1d')]();queues[_0x509cf7[_0x2a93('0x3')]][_0x2a93('0x30')]=utils[_0x2a93('0x31')](queues[_0x509cf7[_0x2a93('0x3')]]['queuecallerleaveAt'],queues[_0x509cf7[_0x2a93('0x3')]][_0x2a93('0x32')]);queues[_0x509cf7[_0x2a93('0x3')]][_0x2a93('0x11')]=_0x509cf7[_0x2a93('0x11')];queues[_0x509cf7[_0x2a93('0x3')]]['count']=_0x509cf7[_0x2a93('0x33')];queues[_0x509cf7['uniqueid']]['connectedlinenum']=_0x509cf7[_0x2a93('0x34')];queues[_0x509cf7[_0x2a93('0x3')]][_0x2a93('0x35')]=_0x509cf7[_0x2a93('0x35')];}}catch(_0x50155b){utils[_0x2a93('0x13')](util['format'](_0x2a93('0x2c'),_0x509cf7[_0x2a93('0x3')]),_0x50155b);}};exports[_0x2a93('0x36')]=function(_0xafefb7){try{if(!_[_0x2a93('0x16')](queues[_0xafefb7[_0x2a93('0x3')]])){utils[_0x2a93('0x17')](util[_0x2a93('0xf')]('[%s][queues][agentconnect]',_0xafefb7[_0x2a93('0x3')]),_0xafefb7);utils[_0x2a93('0x1')](util[_0x2a93('0xf')](_0x2a93('0x37'),_0xafefb7[_0x2a93('0x3')],queues[_0xafefb7[_0x2a93('0x3')]][_0x2a93('0x1e')],_0xafefb7[_0x2a93('0x38')],_0xafefb7[_0x2a93('0x39')]));queues[_0xafefb7[_0x2a93('0x3')]][_0x2a93('0x19')]=![];queues[_0xafefb7[_0x2a93('0x3')]][_0x2a93('0x19')]=![];queues[_0xafefb7[_0x2a93('0x3')]][_0x2a93('0x28')]=null;queues[_0xafefb7[_0x2a93('0x3')]][_0x2a93('0x1a')]=![];queues[_0xafefb7[_0x2a93('0x3')]][_0x2a93('0x8')]=null;queues[_0xafefb7['uniqueid']]['queuecallerexitAt']=null;queues[_0xafefb7[_0x2a93('0x3')]][_0x2a93('0x3a')]=!![];queues[_0xafefb7[_0x2a93('0x3')]][_0x2a93('0x7')]=_0xafefb7[_0x2a93('0x39')];queues[_0xafefb7['uniqueid']]['lastAssignedTo']=_0xafefb7[_0x2a93('0x38')];}}catch(_0xe4c0f9){utils['error'](util[_0x2a93('0xf')](_0x2a93('0x3b'),_0xafefb7[_0x2a93('0x3')]),_0xe4c0f9);}};exports[_0x2a93('0x3c')]=function(_0x191f54){try{if(!_[_0x2a93('0x16')](queues[_0x191f54[_0x2a93('0x3')]])){if(queues[_0x191f54[_0x2a93('0x3')]][_0x2a93('0x2f')]){utils[_0x2a93('0x17')](util[_0x2a93('0xf')](_0x2a93('0x3d'),_0x191f54['uniqueid']),_0x191f54);queues[_0x191f54[_0x2a93('0x3')]]['queuecallerabandon']=![];queues[_0x191f54[_0x2a93('0x3')]]['queuecallerabandon']=![];queues[_0x191f54[_0x2a93('0x3')]][_0x2a93('0x28')]=null;queues[_0x191f54['uniqueid']][_0x2a93('0x1a')]=![];queues[_0x191f54[_0x2a93('0x3')]][_0x2a93('0x25')]=null;queues[_0x191f54[_0x2a93('0x3')]][_0x2a93('0x3a')]=!![];queues[_0x191f54[_0x2a93('0x3')]][_0x2a93('0x6')]=_0x191f54['membername'];queues[_0x191f54[_0x2a93('0x3')]][_0x2a93('0x1b')]=!![];queues[_0x191f54['uniqueid']]['queuecallercompleteAt']=utils['now']();if(_0x191f54[_0x2a93('0x3e')]==_0x2a93('0x3f')){if(!queues[_0x191f54[_0x2a93('0x3')]][_0x2a93('0x3f')]){queues[_0x191f54[_0x2a93('0x3')]][_0x2a93('0x8')]='TRANSFER';}}else{queues[_0x191f54[_0x2a93('0x3')]][_0x2a93('0x8')]='COMPLETEDBY'+_0x191f54['reason'][_0x2a93('0x27')]();}utils[_0x2a93('0x1')](util[_0x2a93('0xf')](_0x2a93('0x40'),_0x191f54[_0x2a93('0x3')],queues[_0x191f54[_0x2a93('0x3')]][_0x2a93('0x1e')],_0x191f54[_0x2a93('0x38')],queues[_0x191f54[_0x2a93('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x191f54[_0x2a93('0x3')]]);}}}catch(_0x534bdb){utils[_0x2a93('0x13')](util[_0x2a93('0xf')](_0x2a93('0x3d'),_0x191f54[_0x2a93('0x3')]),_0x534bdb);}};exports['blindtransfer']=function(_0x18ea92){try{if(!_[_0x2a93('0x16')](queues[_0x18ea92[_0x2a93('0x41')]])){utils['debug'](util[_0x2a93('0xf')]('[%s][queues][blindtransfer]',_0x18ea92['uniqueid']),_0x18ea92);queues[_0x18ea92[_0x2a93('0x41')]][_0x2a93('0x3f')]=!![];queues[_0x18ea92[_0x2a93('0x41')]][_0x2a93('0x42')]='BLIND';queues[_0x18ea92['transfereeuniqueid']][_0x2a93('0x43')]=_0x18ea92[_0x2a93('0x44')];queues[_0x18ea92[_0x2a93('0x41')]][_0x2a93('0x45')]=_0x18ea92[_0x2a93('0x41')];queues[_0x18ea92[_0x2a93('0x41')]][_0x2a93('0x8')]='BLINDTRANSFER';utils[_0x2a93('0x1')](util[_0x2a93('0xf')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x18ea92[_0x2a93('0x3')],queues[_0x18ea92[_0x2a93('0x41')]][_0x2a93('0x1e')],_0x18ea92['transfereeuniqueid'],_0x18ea92[_0x2a93('0x44')]));}}catch(_0x596e90){utils['error'](util[_0x2a93('0xf')](_0x2a93('0x46'),_0x18ea92['uniqueid']),_0x596e90);}};exports[_0x2a93('0x47')]=function(_0x2278b2){try{utils['debug'](util[_0x2a93('0xf')](_0x2a93('0x48'),_0x2278b2[_0x2a93('0x49')]),_0x2278b2);if(_0x2278b2[_0x2a93('0x49')]==_0x2278b2[_0x2a93('0x4a')]){if(!_[_0x2a93('0x16')](queues[_0x2278b2[_0x2a93('0x4b')]])){utils[_0x2a93('0x1')](util[_0x2a93('0xf')](_0x2a93('0x4c'),_0x2278b2['origtransfereruniqueid'],queues[_0x2278b2[_0x2a93('0x4b')]][_0x2a93('0x1e')],_0x2278b2['origtransfererexten']));queues[_0x2278b2[_0x2a93('0x4b')]][_0x2a93('0x3f')]=!![];queues[_0x2278b2['secondtransfererlinkedid']][_0x2a93('0x42')]=_0x2a93('0x4d');queues[_0x2278b2[_0x2a93('0x4b')]][_0x2a93('0x43')]=_0x2278b2[_0x2a93('0x4e')];queues[_0x2278b2[_0x2a93('0x4b')]][_0x2a93('0x45')]=_0x2278b2[_0x2a93('0x49')];queues[_0x2278b2['secondtransfererlinkedid']][_0x2a93('0x8')]=_0x2a93('0x4f');}if(!_['isNil'](queues[_0x2278b2['origtransfererlinkedid']])){if(_0x2278b2['transfereelinkedid']&&queues[_0x2278b2[_0x2a93('0x50')]]){queues[_0x2278b2[_0x2a93('0x50')]]['queuecallerenterreason']=0x1;queues[_0x2278b2[_0x2a93('0x41')]]=_[_0x2a93('0x51')](queues[_0x2278b2['transfereelinkedid']]);queues[_0x2278b2[_0x2a93('0x41')]][_0x2a93('0xd')]=_0x2278b2[_0x2a93('0x52')];queues[_0x2278b2[_0x2a93('0x41')]][_0x2a93('0x53')]=0x2;queues[_0x2278b2[_0x2a93('0x41')]][_0x2a93('0x54')]=queues[_0x2278b2[_0x2a93('0x4b')]][_0x2a93('0x54')];queues[_0x2278b2[_0x2a93('0x41')]][_0x2a93('0x55')]=queues[_0x2278b2[_0x2a93('0x4b')]][_0x2a93('0x55')];queues[_0x2278b2['transfereeuniqueid']]['queuecallerjoinAt']=utils['now']();queues[_0x2278b2[_0x2a93('0x41')]][_0x2a93('0x2f')]=utils['now']();queues[_0x2278b2['transfereeuniqueid']][_0x2a93('0x30')]=0x0;queues[_0x2278b2['transfereeuniqueid']][_0x2a93('0x56')]=0x0;utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x2278b2[_0x2a93('0x49')],queues[_0x2278b2[_0x2a93('0x41')]][_0x2a93('0x1e')],queues[_0x2278b2[_0x2a93('0x41')]][_0x2a93('0x54')],queues[_0x2278b2[_0x2a93('0x41')]][_0x2a93('0x55')]));}else{utils[_0x2a93('0x1')](util[_0x2a93('0xf')](_0x2a93('0x57'),_0x2278b2['origtransfereruniqueid'],queues[_0x2278b2[_0x2a93('0x4a')]][_0x2a93('0x1e')],_0x2278b2[_0x2a93('0x4b')]));queues[_0x2278b2[_0x2a93('0x4a')]][_0x2a93('0xd')]=_0x2278b2[_0x2a93('0x4b')];}}}else if(_0x2278b2[_0x2a93('0x58')]==_0x2278b2[_0x2a93('0x4b')]){if(!_['isNil'](queues[_0x2278b2['origtransfererlinkedid']])){utils['info'](util['format'](_0x2a93('0x59'),_0x2278b2[_0x2a93('0x49')],queues[_0x2278b2[_0x2a93('0x4a')]][_0x2a93('0x1e')],_0x2278b2['secondtransfereruniqueid'],_0x2278b2[_0x2a93('0x5a')]));queues[_0x2278b2['origtransfererlinkedid']][_0x2a93('0x3f')]=!![];queues[_0x2278b2[_0x2a93('0x4a')]]['transfertype']=_0x2a93('0x4d');queues[_0x2278b2[_0x2a93('0x4a')]]['transferexten']=_0x2278b2[_0x2a93('0x5a')];queues[_0x2278b2[_0x2a93('0x4a')]]['transferuniqueid']=_0x2278b2[_0x2a93('0x58')];queues[_0x2278b2['origtransfererlinkedid']]['queuecallerexitreason']=_0x2a93('0x4f');}if(!_[_0x2a93('0x16')](queues[_0x2278b2[_0x2a93('0x4b')]])){if(_0x2278b2[_0x2a93('0x5b')]&&queues[_0x2278b2['transfertargetlinkedid']]){queues[_0x2278b2['transfertargetlinkedid']][_0x2a93('0x53')]=0x1;queues[_0x2278b2['transfertargetuniqueid']]=_[_0x2a93('0x51')](queues[_0x2278b2[_0x2a93('0x5b')]]);queues[_0x2278b2[_0x2a93('0x52')]][_0x2a93('0xd')]=_0x2278b2[_0x2a93('0x52')];queues[_0x2278b2['transfertargetuniqueid']][_0x2a93('0x53')]=0x2;queues[_0x2278b2[_0x2a93('0x52')]][_0x2a93('0x54')]=queues[_0x2278b2[_0x2a93('0x4a')]][_0x2a93('0x54')];queues[_0x2278b2[_0x2a93('0x52')]][_0x2a93('0x55')]=queues[_0x2278b2[_0x2a93('0x4a')]]['calleridname'];queues[_0x2278b2[_0x2a93('0x52')]][_0x2a93('0x32')]=utils[_0x2a93('0x1d')]();queues[_0x2278b2[_0x2a93('0x52')]]['queuecallerleaveAt']=utils[_0x2a93('0x1d')]();queues[_0x2278b2[_0x2a93('0x52')]][_0x2a93('0x30')]=0x0;queues[_0x2278b2['transfertargetuniqueid']][_0x2a93('0x56')]=0x0;utils[_0x2a93('0x1')](util[_0x2a93('0xf')](_0x2a93('0x5c'),_0x2278b2[_0x2a93('0x49')],queues[_0x2278b2[_0x2a93('0x52')]][_0x2a93('0x1e')],queues[_0x2278b2[_0x2a93('0x52')]][_0x2a93('0xd')],queues[_0x2278b2['transfertargetuniqueid']][_0x2a93('0x54')],queues[_0x2278b2[_0x2a93('0x52')]][_0x2a93('0x55')]));}else{utils[_0x2a93('0x1')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2278b2[_0x2a93('0x49')],queues[_0x2278b2['secondtransfererlinkedid']]['name'],_0x2278b2['origtransfererlinkedid']));queues[_0x2278b2[_0x2a93('0x4b')]][_0x2a93('0xd')]=_0x2278b2[_0x2a93('0x4a')];}}}}catch(_0x204bf4){utils[_0x2a93('0x13')](util[_0x2a93('0xf')](_0x2a93('0x48'),_0x2278b2[_0x2a93('0x49')]),_0x204bf4);}};exports[_0x2a93('0x5d')]=function(_0x2f7077){try{if(!_[_0x2a93('0x16')](queues[_0x2f7077['uniqueid']])){utils[_0x2a93('0x17')](util[_0x2a93('0xf')](_0x2a93('0x5e'),_0x2f7077[_0x2a93('0x3')]),_0x2f7077);queues[_0x2f7077[_0x2a93('0x3')]]['musiconholdstartAt']=utils[_0x2a93('0x1d')]();utils[_0x2a93('0x1')](util[_0x2a93('0xf')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x2f7077[_0x2a93('0x3')],queues[_0x2f7077[_0x2a93('0x3')]]['name'],queues[_0x2f7077[_0x2a93('0x3')]][_0x2a93('0x5f')]));}}catch(_0x112ed2){utils['error'](util[_0x2a93('0xf')](_0x2a93('0x5e'),_0x2f7077[_0x2a93('0x3')]),_0x112ed2);}};exports[_0x2a93('0x60')]=function(_0xccf629){try{if(!_[_0x2a93('0x16')](queues[_0xccf629[_0x2a93('0x3')]])){if(!_[_0x2a93('0x16')](queues[_0xccf629[_0x2a93('0x3')]][_0x2a93('0x5f')])){utils[_0x2a93('0x17')](util[_0x2a93('0xf')]('[%s][queues][musiconholdstop]',_0xccf629[_0x2a93('0x3')]),_0xccf629);queues[_0xccf629[_0x2a93('0x3')]]['mohtime']+=utils[_0x2a93('0x31')](utils[_0x2a93('0x1d')](),queues[_0xccf629[_0x2a93('0x3')]][_0x2a93('0x5f')]);utils['info'](util[_0x2a93('0xf')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0xccf629[_0x2a93('0x3')],queues[_0xccf629[_0x2a93('0x3')]][_0x2a93('0x1e')],queues[_0xccf629[_0x2a93('0x3')]][_0x2a93('0x56')]));delete queues[_0xccf629[_0x2a93('0x3')]][_0x2a93('0x5f')];}}}catch(_0x11298c){utils[_0x2a93('0x13')](util['format'](_0x2a93('0x61'),_0xccf629[_0x2a93('0x3')]),_0x11298c);}}; \ No newline at end of file +var _0x09d2=['[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','[%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','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','accountcode','queuecallerexitreason','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','varset','[%s][queues][varset]','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','name','variable','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09d2,0x152));var _0x209d=function(_0x194d28,_0x268ce5){_0x194d28=_0x194d28-0x0;var _0x101a2a=_0x09d2[_0x194d28];return _0x101a2a;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x62876){utils[_0x209d('0x0')](util['format'](_0x209d('0x1'),_0x62876[_0x209d('0x2')],_0x62876['channel'],_0x62876[_0x209d('0x3')],_0x62876[_0x209d('0x4')],_0x62876['calleridnum'],_0x62876[_0x209d('0x5')],_0x62876[_0x209d('0x6')]));if(_0x62876[_0x209d('0x3')]){utils['getVoiceQueueByName'](_0x62876[_0x209d('0x3')])[_0x209d('0x7')](function(_0x245fab){if(_0x245fab){_0x62876[_0x209d('0x8')]=_0x245fab[_0x209d('0x8')];}utils['request'](_0x209d('0x9'),_0x62876);});}else{utils[_0x209d('0xa')]('CreateVoiceQueueReport',_0x62876);}if(_0x62876[_0x209d('0xb')]){delete queues[_0x62876[_0x209d('0xb')]];}else{delete queues[_0x62876[_0x209d('0x2')]];}}exports[_0x209d('0xc')]=function(_0x46adc4){try{utils['debug'](util[_0x209d('0xd')](_0x209d('0xe'),_0x46adc4['uniqueid']),_0x46adc4);utils[_0x209d('0x0')](util[_0x209d('0xd')](_0x209d('0xf'),_0x46adc4[_0x209d('0x2')],_0x46adc4[_0x209d('0x3')],_0x46adc4['position']));queues[_0x46adc4[_0x209d('0x2')]]=_[_0x209d('0x10')](_0x46adc4,{'originalposition':_0x46adc4[_0x209d('0x11')],'queuecallerjoinAt':utils[_0x209d('0x12')](),'mohtime':0x0});}catch(_0x30058e){utils[_0x209d('0x13')](util[_0x209d('0xd')](_0x209d('0xe'),_0x46adc4[_0x209d('0x2')]),_0x30058e);}};exports['hangup']=function(_0x5be6f8){try{if(!_[_0x209d('0x14')](queues[_0x5be6f8['uniqueid']])){utils[_0x209d('0x15')](util[_0x209d('0xd')](_0x209d('0x16'),_0x5be6f8[_0x209d('0x2')]),_0x5be6f8);if(queues[_0x5be6f8['uniqueid']][_0x209d('0x17')]){if(!queues[_0x5be6f8['uniqueid']][_0x209d('0x18')]&&!queues[_0x5be6f8['uniqueid']][_0x209d('0x19')]){queues[_0x5be6f8[_0x209d('0x2')]][_0x209d('0x1a')]=!![];queues[_0x5be6f8[_0x209d('0x2')]][_0x209d('0x1b')]=utils['now']();queues[_0x5be6f8[_0x209d('0x2')]][_0x209d('0x6')]=_0x209d('0x1c');}utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x5be6f8[_0x209d('0x2')],queues[_0x5be6f8[_0x209d('0x2')]]['name'],queues[_0x5be6f8['uniqueid']][_0x209d('0x6')]));writeDB(queues[_0x5be6f8[_0x209d('0x2')]]);}else if(queues[_0x5be6f8['uniqueid']][_0x209d('0xb')]){utils[_0x209d('0x0')](util[_0x209d('0xd')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x5be6f8['uniqueid'],queues[_0x5be6f8['uniqueid']]['name'],queues[_0x5be6f8[_0x209d('0x2')]][_0x209d('0xb')]));queues[queues[_0x5be6f8[_0x209d('0x2')]][_0x209d('0xb')]]=queues[_0x5be6f8['uniqueid']];queues[queues[_0x5be6f8[_0x209d('0x2')]]['transfereduniqueid']][_0x209d('0x1d')]=0x2;delete queues[_0x5be6f8[_0x209d('0x2')]];}}}catch(_0x3eb2b3){utils[_0x209d('0x13')](util[_0x209d('0xd')](_0x209d('0x16'),_0x5be6f8[_0x209d('0x2')]),_0x3eb2b3);}};exports[_0x209d('0x1e')]=function(_0x36227a){try{utils[_0x209d('0x15')](util[_0x209d('0xd')](_0x209d('0x1f'),_0x36227a[_0x209d('0x2')]),_0x36227a);if(!_['isNil'](_0x36227a['variable'][_0x209d('0x20')])&&_0x36227a[_0x209d('0x21')][_0x209d('0x22')]()!==_0x209d('0x23')){if(!_[_0x209d('0x14')](queues[_0x36227a[_0x209d('0x2')]])){queues[_0x36227a[_0x209d('0x2')]][_0x209d('0x18')]=![];queues[_0x36227a['uniqueid']][_0x209d('0x24')]=null;queues[_0x36227a[_0x209d('0x2')]][_0x209d('0x19')]=!![];queues[_0x36227a[_0x209d('0x2')]]['queuecallerexitAt']=utils[_0x209d('0x12')]();queues[_0x36227a[_0x209d('0x2')]][_0x209d('0x6')]=_0x36227a[_0x209d('0x21')][_0x209d('0x22')]();utils[_0x209d('0x0')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x36227a[_0x209d('0x2')],queues[_0x36227a[_0x209d('0x2')]][_0x209d('0x25')],_0x36227a[_0x209d('0x21')],queues[_0x36227a[_0x209d('0x2')]][_0x209d('0x6')]));writeDB(queues[_0x36227a[_0x209d('0x2')]]);}}else if(!_[_0x209d('0x14')](_0x36227a[_0x209d('0x26')][_0x209d('0x27')])){if(!_[_0x209d('0x14')](queues[_0x36227a[_0x209d('0x2')]])&&!queues[_0x36227a[_0x209d('0x2')]]['queuecallerabandon']){queues[_0x36227a[_0x209d('0x2')]][_0x209d('0x18')]=![];queues[_0x36227a[_0x209d('0x2')]]['queuecallerabandonAt']=null;queues[_0x36227a[_0x209d('0x2')]]['queuecallerexit']=!![];queues[_0x36227a[_0x209d('0x2')]][_0x209d('0x28')]=utils[_0x209d('0x12')]();queues[_0x36227a[_0x209d('0x2')]][_0x209d('0x6')]=_0x209d('0x29');utils[_0x209d('0x0')](util['format'](_0x209d('0x2a'),_0x36227a[_0x209d('0x2')],queues[_0x36227a['uniqueid']][_0x209d('0x25')],_0x36227a[_0x209d('0x21')],queues[_0x36227a['uniqueid']][_0x209d('0x6')]));}}}catch(_0x4f66cb){utils[_0x209d('0x13')](util[_0x209d('0xd')](_0x209d('0x1f'),_0x36227a[_0x209d('0x2')]),_0x4f66cb);}};exports['queuecallerabandon']=function(_0x24aab7){try{if(!_['isNil'](queues[_0x24aab7['uniqueid']])){utils[_0x209d('0x15')](util['format'](_0x209d('0x2b'),_0x24aab7[_0x209d('0x2')]),_0x24aab7);queues[_0x24aab7[_0x209d('0x2')]][_0x209d('0x19')]=![];queues[_0x24aab7[_0x209d('0x2')]]['queuecallerexitAt']=null;queues[_0x24aab7[_0x209d('0x2')]]['queuecallerabandon']=!![];queues[_0x24aab7[_0x209d('0x2')]][_0x209d('0x24')]=utils['now']();queues[_0x24aab7[_0x209d('0x2')]][_0x209d('0x6')]='ABANDONED';utils[_0x209d('0x0')](util[_0x209d('0xd')](_0x209d('0x2c'),_0x24aab7[_0x209d('0x2')],queues[_0x24aab7['uniqueid']][_0x209d('0x25')],queues[_0x24aab7[_0x209d('0x2')]][_0x209d('0x6')]));}}catch(_0x518d60){utils['error'](util[_0x209d('0xd')](_0x209d('0x2b'),_0x24aab7[_0x209d('0x2')]),_0x518d60);}};exports[_0x209d('0x2d')]=function(_0xd04091){try{if(!_[_0x209d('0x14')](queues[_0xd04091[_0x209d('0x2')]])){utils[_0x209d('0x15')](util[_0x209d('0xd')](_0x209d('0x2e'),_0xd04091[_0x209d('0x2')]),_0xd04091);utils[_0x209d('0x0')](util[_0x209d('0xd')](_0x209d('0x2f'),_0xd04091['uniqueid'],queues[_0xd04091['uniqueid']][_0x209d('0x25')],_0xd04091[_0x209d('0x30')],_0xd04091[_0x209d('0x31')]));queues[_0xd04091[_0x209d('0x2')]][_0x209d('0x2d')]=!![];queues[_0xd04091['uniqueid']][_0x209d('0x17')]=utils['now']();queues[_0xd04091[_0x209d('0x2')]][_0x209d('0x32')]=utils[_0x209d('0x33')](queues[_0xd04091[_0x209d('0x2')]]['queuecallerleaveAt'],queues[_0xd04091['uniqueid']][_0x209d('0x34')]);queues[_0xd04091[_0x209d('0x2')]][_0x209d('0x11')]=_0xd04091['position'];queues[_0xd04091[_0x209d('0x2')]][_0x209d('0x35')]=_0xd04091[_0x209d('0x35')];queues[_0xd04091[_0x209d('0x2')]]['connectedlinenum']=_0xd04091[_0x209d('0x30')];queues[_0xd04091['uniqueid']]['connectedlinename']=_0xd04091[_0x209d('0x31')];}}catch(_0x75279d){utils[_0x209d('0x13')](util[_0x209d('0xd')]('[%s][queues][queuecallerleave]',_0xd04091[_0x209d('0x2')]),_0x75279d);}};exports[_0x209d('0x36')]=function(_0x7a5019){try{if(!_[_0x209d('0x14')](queues[_0x7a5019[_0x209d('0x2')]])){utils[_0x209d('0x15')](util[_0x209d('0xd')]('[%s][queues][agentconnect]',_0x7a5019['uniqueid']),_0x7a5019);utils[_0x209d('0x0')](util[_0x209d('0xd')](_0x209d('0x37'),_0x7a5019[_0x209d('0x2')],queues[_0x7a5019[_0x209d('0x2')]][_0x209d('0x25')],_0x7a5019[_0x209d('0x38')],_0x7a5019[_0x209d('0x39')]));queues[_0x7a5019['uniqueid']][_0x209d('0x18')]=![];queues[_0x7a5019[_0x209d('0x2')]][_0x209d('0x18')]=![];queues[_0x7a5019[_0x209d('0x2')]][_0x209d('0x24')]=null;queues[_0x7a5019['uniqueid']]['queuecallerexit']=![];queues[_0x7a5019[_0x209d('0x2')]][_0x209d('0x6')]=null;queues[_0x7a5019[_0x209d('0x2')]]['queuecallerexitAt']=null;queues[_0x7a5019[_0x209d('0x2')]][_0x209d('0x3a')]=!![];queues[_0x7a5019[_0x209d('0x2')]][_0x209d('0x5')]=_0x7a5019[_0x209d('0x39')];queues[_0x7a5019['uniqueid']][_0x209d('0x4')]=_0x7a5019[_0x209d('0x38')];}}catch(_0x4d94a7){utils['error'](util[_0x209d('0xd')](_0x209d('0x3b'),_0x7a5019[_0x209d('0x2')]),_0x4d94a7);}};exports['agentcomplete']=function(_0x3e04f8){try{if(!_[_0x209d('0x14')](queues[_0x3e04f8[_0x209d('0x2')]])){if(queues[_0x3e04f8[_0x209d('0x2')]]['queuecallerleaveAt']){utils[_0x209d('0x15')](util[_0x209d('0xd')](_0x209d('0x3c'),_0x3e04f8[_0x209d('0x2')]),_0x3e04f8);queues[_0x3e04f8[_0x209d('0x2')]][_0x209d('0x18')]=![];queues[_0x3e04f8[_0x209d('0x2')]][_0x209d('0x18')]=![];queues[_0x3e04f8[_0x209d('0x2')]]['queuecallerabandonAt']=null;queues[_0x3e04f8[_0x209d('0x2')]][_0x209d('0x19')]=![];queues[_0x3e04f8['uniqueid']][_0x209d('0x28')]=null;queues[_0x3e04f8[_0x209d('0x2')]][_0x209d('0x3a')]=!![];queues[_0x3e04f8[_0x209d('0x2')]][_0x209d('0x4')]=_0x3e04f8[_0x209d('0x38')];queues[_0x3e04f8[_0x209d('0x2')]][_0x209d('0x1a')]=!![];queues[_0x3e04f8[_0x209d('0x2')]][_0x209d('0x1b')]=utils['now']();if(_0x3e04f8['reason']==_0x209d('0x3d')){if(!queues[_0x3e04f8[_0x209d('0x2')]][_0x209d('0x3d')]){queues[_0x3e04f8[_0x209d('0x2')]]['queuecallerexitreason']=_0x209d('0x3e');}}else{queues[_0x3e04f8[_0x209d('0x2')]][_0x209d('0x6')]=_0x209d('0x3f')+_0x3e04f8['reason'][_0x209d('0x22')]();}utils[_0x209d('0x0')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x3e04f8[_0x209d('0x2')],queues[_0x3e04f8[_0x209d('0x2')]][_0x209d('0x25')],_0x3e04f8[_0x209d('0x38')],queues[_0x3e04f8[_0x209d('0x2')]][_0x209d('0x6')]));writeDB(queues[_0x3e04f8[_0x209d('0x2')]]);}}}catch(_0x40b876){utils[_0x209d('0x13')](util[_0x209d('0xd')](_0x209d('0x3c'),_0x3e04f8[_0x209d('0x2')]),_0x40b876);}};exports[_0x209d('0x40')]=function(_0x169a8b){try{if(!_[_0x209d('0x14')](queues[_0x169a8b[_0x209d('0x41')]])){utils[_0x209d('0x15')](util['format'](_0x209d('0x42'),_0x169a8b[_0x209d('0x2')]),_0x169a8b);queues[_0x169a8b[_0x209d('0x41')]]['transfer']=!![];queues[_0x169a8b[_0x209d('0x41')]][_0x209d('0x43')]=_0x209d('0x44');queues[_0x169a8b[_0x209d('0x41')]][_0x209d('0x45')]=_0x169a8b[_0x209d('0x46')];queues[_0x169a8b[_0x209d('0x41')]][_0x209d('0x47')]=_0x169a8b[_0x209d('0x41')];queues[_0x169a8b['transfereeuniqueid']]['queuecallerexitreason']=_0x209d('0x48');utils[_0x209d('0x0')](util[_0x209d('0xd')](_0x209d('0x49'),_0x169a8b['uniqueid'],queues[_0x169a8b['transfereeuniqueid']][_0x209d('0x25')],_0x169a8b[_0x209d('0x41')],_0x169a8b['extension']));}}catch(_0x1db7ef){utils[_0x209d('0x13')](util['format'](_0x209d('0x42'),_0x169a8b[_0x209d('0x2')]),_0x1db7ef);}};exports[_0x209d('0x4a')]=function(_0x315457){try{utils[_0x209d('0x15')](util['format'](_0x209d('0x4b'),_0x315457[_0x209d('0x4c')]),_0x315457);if(_0x315457[_0x209d('0x4c')]==_0x315457[_0x209d('0x4d')]){if(!_[_0x209d('0x14')](queues[_0x315457[_0x209d('0x4e')]])){utils[_0x209d('0x0')](util[_0x209d('0xd')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x315457[_0x209d('0x4c')],queues[_0x315457[_0x209d('0x4e')]][_0x209d('0x25')],_0x315457['origtransfererexten']));queues[_0x315457[_0x209d('0x4e')]][_0x209d('0x3d')]=!![];queues[_0x315457[_0x209d('0x4e')]][_0x209d('0x43')]=_0x209d('0x4f');queues[_0x315457[_0x209d('0x4e')]][_0x209d('0x45')]=_0x315457[_0x209d('0x50')];queues[_0x315457['secondtransfererlinkedid']]['transferuniqueid']=_0x315457['origtransfereruniqueid'];queues[_0x315457['secondtransfererlinkedid']][_0x209d('0x6')]='ATTENDEDTRANSFER';}if(!_[_0x209d('0x14')](queues[_0x315457[_0x209d('0x4d')]])){if(_0x315457[_0x209d('0x51')]&&queues[_0x315457[_0x209d('0x51')]]){queues[_0x315457[_0x209d('0x51')]][_0x209d('0x1d')]=0x1;queues[_0x315457[_0x209d('0x41')]]=_[_0x209d('0x52')](queues[_0x315457[_0x209d('0x51')]]);queues[_0x315457[_0x209d('0x41')]][_0x209d('0xb')]=_0x315457[_0x209d('0x53')];queues[_0x315457['transfereeuniqueid']][_0x209d('0x1d')]=0x2;queues[_0x315457['transfereeuniqueid']][_0x209d('0x54')]=queues[_0x315457[_0x209d('0x4e')]][_0x209d('0x54')];queues[_0x315457[_0x209d('0x41')]][_0x209d('0x55')]=queues[_0x315457['secondtransfererlinkedid']]['calleridname'];queues[_0x315457[_0x209d('0x41')]]['queuecallerjoinAt']=utils[_0x209d('0x12')]();queues[_0x315457['transfereeuniqueid']][_0x209d('0x17')]=utils[_0x209d('0x12')]();queues[_0x315457[_0x209d('0x41')]][_0x209d('0x32')]=0x0;queues[_0x315457[_0x209d('0x41')]]['mohtime']=0x0;utils['info'](util[_0x209d('0xd')](_0x209d('0x56'),_0x315457['origtransfereruniqueid'],queues[_0x315457[_0x209d('0x41')]]['name'],queues[_0x315457['transfereeuniqueid']][_0x209d('0x54')],queues[_0x315457[_0x209d('0x41')]][_0x209d('0x55')]));}else{utils[_0x209d('0x0')](util['format'](_0x209d('0x57'),_0x315457[_0x209d('0x4c')],queues[_0x315457[_0x209d('0x4d')]][_0x209d('0x25')],_0x315457['secondtransfererlinkedid']));queues[_0x315457['origtransfererlinkedid']][_0x209d('0xb')]=_0x315457[_0x209d('0x4e')];}}}else if(_0x315457[_0x209d('0x58')]==_0x315457[_0x209d('0x4e')]){if(!_[_0x209d('0x14')](queues[_0x315457['origtransfererlinkedid']])){utils[_0x209d('0x0')](util[_0x209d('0xd')](_0x209d('0x59'),_0x315457[_0x209d('0x4c')],queues[_0x315457['origtransfererlinkedid']][_0x209d('0x25')],_0x315457[_0x209d('0x58')],_0x315457[_0x209d('0x5a')]));queues[_0x315457[_0x209d('0x4d')]]['transfer']=!![];queues[_0x315457['origtransfererlinkedid']][_0x209d('0x43')]='ATTENDED';queues[_0x315457[_0x209d('0x4d')]]['transferexten']=_0x315457['secondtransfererexten'];queues[_0x315457[_0x209d('0x4d')]][_0x209d('0x47')]=_0x315457[_0x209d('0x58')];queues[_0x315457[_0x209d('0x4d')]][_0x209d('0x6')]=_0x209d('0x5b');}if(!_[_0x209d('0x14')](queues[_0x315457['secondtransfererlinkedid']])){if(_0x315457[_0x209d('0x5c')]&&queues[_0x315457[_0x209d('0x5c')]]){queues[_0x315457['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x315457[_0x209d('0x53')]]=_[_0x209d('0x52')](queues[_0x315457[_0x209d('0x5c')]]);queues[_0x315457['transfertargetuniqueid']][_0x209d('0xb')]=_0x315457['transfertargetuniqueid'];queues[_0x315457['transfertargetuniqueid']][_0x209d('0x1d')]=0x2;queues[_0x315457['transfertargetuniqueid']][_0x209d('0x54')]=queues[_0x315457['origtransfererlinkedid']][_0x209d('0x54')];queues[_0x315457[_0x209d('0x53')]][_0x209d('0x55')]=queues[_0x315457[_0x209d('0x4d')]][_0x209d('0x55')];queues[_0x315457[_0x209d('0x53')]][_0x209d('0x34')]=utils[_0x209d('0x12')]();queues[_0x315457[_0x209d('0x53')]][_0x209d('0x17')]=utils[_0x209d('0x12')]();queues[_0x315457['transfertargetuniqueid']][_0x209d('0x32')]=0x0;queues[_0x315457[_0x209d('0x53')]][_0x209d('0x5d')]=0x0;utils['info'](util[_0x209d('0xd')](_0x209d('0x5e'),_0x315457[_0x209d('0x4c')],queues[_0x315457[_0x209d('0x53')]][_0x209d('0x25')],queues[_0x315457[_0x209d('0x53')]][_0x209d('0xb')],queues[_0x315457['transfertargetuniqueid']][_0x209d('0x54')],queues[_0x315457['transfertargetuniqueid']][_0x209d('0x55')]));}else{utils[_0x209d('0x0')](util['format'](_0x209d('0x57'),_0x315457[_0x209d('0x4c')],queues[_0x315457[_0x209d('0x4e')]]['name'],_0x315457[_0x209d('0x4d')]));queues[_0x315457['secondtransfererlinkedid']][_0x209d('0xb')]=_0x315457['origtransfererlinkedid'];}}}}catch(_0x48f8c3){utils[_0x209d('0x13')](util[_0x209d('0xd')](_0x209d('0x4b'),_0x315457[_0x209d('0x4c')]),_0x48f8c3);}};exports[_0x209d('0x5f')]=function(_0x53993b){try{if(!_[_0x209d('0x14')](queues[_0x53993b['uniqueid']])){utils[_0x209d('0x15')](util['format']('[%s][queues][musiconholdstart]',_0x53993b[_0x209d('0x2')]),_0x53993b);queues[_0x53993b[_0x209d('0x2')]][_0x209d('0x60')]=utils[_0x209d('0x12')]();utils['info'](util[_0x209d('0xd')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x53993b[_0x209d('0x2')],queues[_0x53993b['uniqueid']][_0x209d('0x25')],queues[_0x53993b[_0x209d('0x2')]][_0x209d('0x60')]));}}catch(_0x59e1c8){utils[_0x209d('0x13')](util['format'](_0x209d('0x61'),_0x53993b[_0x209d('0x2')]),_0x59e1c8);}};exports[_0x209d('0x62')]=function(_0x428f14){try{if(!_[_0x209d('0x14')](queues[_0x428f14[_0x209d('0x2')]])){if(!_['isNil'](queues[_0x428f14['uniqueid']]['musiconholdstartAt'])){utils[_0x209d('0x15')](util[_0x209d('0xd')](_0x209d('0x63'),_0x428f14[_0x209d('0x2')]),_0x428f14);queues[_0x428f14[_0x209d('0x2')]][_0x209d('0x5d')]+=utils[_0x209d('0x33')](utils[_0x209d('0x12')](),queues[_0x428f14[_0x209d('0x2')]][_0x209d('0x60')]);utils['info'](util[_0x209d('0xd')](_0x209d('0x64'),_0x428f14[_0x209d('0x2')],queues[_0x428f14[_0x209d('0x2')]][_0x209d('0x25')],queues[_0x428f14['uniqueid']][_0x209d('0x5d')]));delete queues[_0x428f14['uniqueid']][_0x209d('0x60')];}}}catch(_0x3a8114){utils[_0x209d('0x13')](util[_0x209d('0xd')](_0x209d('0x63'),_0x428f14[_0x209d('0x2')]),_0x3a8114);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 7d9a271..dc1a874 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 _0x5d6c=['variable','mixmonitor_filename','[%s][recordings][varset]','value','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinename','outbound','connectedlinenum','forEach','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','then','membername','name','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','varset'];(function(_0x21a558,_0x1d4096){var _0x47eb26=function(_0x5d0089){while(--_0x5d0089){_0x21a558['push'](_0x21a558['shift']());}};_0x47eb26(++_0x1d4096);}(_0x5d6c,0x69));var _0xc5d6=function(_0x5c0dbe,_0x693f13){_0x5c0dbe=_0x5c0dbe-0x0;var _0xe9c7d7=_0x5d6c[_0x5c0dbe];return _0xe9c7d7;};'use strict';var _=require(_0xc5d6('0x0'));var util=require(_0xc5d6('0x1'));var utils=require('./utils');var transfers=require(_0xc5d6('0x2'));var recordings={};function writeDB(_0xca27a3){var _0x3a11bc;utils[_0xc5d6('0x3')](util[_0xc5d6('0x4')](_0xc5d6('0x5'),_0xca27a3[_0xc5d6('0x6')]));if(transfers[_0xc5d6('0x7')][_0xca27a3[_0xc5d6('0x6')]]){_0x3a11bc=_0xca27a3[_0xc5d6('0x6')];_0xca27a3[_0xc5d6('0x6')]=transfers[_0xc5d6('0x7')][_0xca27a3[_0xc5d6('0x6')]][_0xc5d6('0x8')];}if(_0xca27a3[_0xc5d6('0x9')]){utils['getUserByInternal'](_0xca27a3['accountcode'])[_0xc5d6('0xa')](function(_0x1ea9ec){if(_0x1ea9ec){_0xca27a3[_0xc5d6('0xb')]=_0x1ea9ec[_0xc5d6('0xc')];_0xca27a3['UserId']=_0x1ea9ec['id'];}utils[_0xc5d6('0xd')]('CreateVoiceRecording',_0xca27a3);});}else{utils[_0xc5d6('0xd')]('CreateVoiceRecording',_0xca27a3);}if(_0x3a11bc)delete transfers[_0xc5d6('0x7')][_0x3a11bc];}exports[_0xc5d6('0xe')]=function(_0x2093ba){try{utils[_0xc5d6('0xf')](util['format'](_0xc5d6('0x10'),_0x2093ba[_0xc5d6('0x6')]),_0x2093ba);if(_0x2093ba[_0xc5d6('0x6')]==_0x2093ba[_0xc5d6('0x11')]){utils[_0xc5d6('0x3')](util['format'](_0xc5d6('0x12'),_0x2093ba[_0xc5d6('0x6')],_0x2093ba[_0xc5d6('0x13')],_0x2093ba[_0xc5d6('0x14')]));recordings[_0x2093ba['uniqueid']]={'uniqueid':_0x2093ba[_0xc5d6('0x6')],'accountcode':_0x2093ba[_0xc5d6('0x9')],'exten':_0x2093ba['exten'],'context':_0x2093ba[_0xc5d6('0x13')],'channel':_0x2093ba[_0xc5d6('0x15')],'monitors':[]};}}catch(_0x1fb5ee){utils[_0xc5d6('0x16')](util['format']('[%s][recordings][newchannel]',_0x2093ba[_0xc5d6('0x6')]),_0x1fb5ee);}};exports['newstate']=function(_0xf20104){try{utils[_0xc5d6('0xf')](util['format'](_0xc5d6('0x17'),_0xf20104[_0xc5d6('0x6')]),_0xf20104);if(!_[_0xc5d6('0x18')](recordings[_0xf20104[_0xc5d6('0x6')]])&&_0xf20104[_0xc5d6('0x19')]==0x6){utils[_0xc5d6('0x3')](util[_0xc5d6('0x4')](_0xc5d6('0x1a'),_0xf20104['uniqueid'],_0xf20104[_0xc5d6('0x13')],_0xf20104[_0xc5d6('0x15')]));}else if(!_[_0xc5d6('0x18')](recordings[_0xf20104['linkedid']])&&_0xf20104[_0xc5d6('0x19')]==0x6&&_0xf20104[_0xc5d6('0x13')]!=_0xc5d6('0x1b')){utils[_0xc5d6('0x3')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0xf20104[_0xc5d6('0x6')],_0xf20104[_0xc5d6('0x11')],_0xf20104[_0xc5d6('0x13')],_0xf20104[_0xc5d6('0x15')]));recordings[_0xf20104[_0xc5d6('0x11')]][_0xc5d6('0x9')]=_0xf20104[_0xc5d6('0x9')];}}catch(_0x4b1c93){utils['error'](util[_0xc5d6('0x4')](_0xc5d6('0x17'),_0xf20104[_0xc5d6('0x6')]),_0x4b1c93);}};exports[_0xc5d6('0x1c')]=function(_0x36f736){try{if(!_['isNil'](_0x36f736[_0xc5d6('0x1d')])&&!_[_0xc5d6('0x18')](_0x36f736[_0xc5d6('0x1d')][_0xc5d6('0x1e')])){utils[_0xc5d6('0xf')](util[_0xc5d6('0x4')](_0xc5d6('0x1f'),_0x36f736[_0xc5d6('0x6')]),_0x36f736);utils[_0xc5d6('0x3')](util[_0xc5d6('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x36f736[_0xc5d6('0x6')],_0x36f736['variable'],_0x36f736[_0xc5d6('0x20')]));if(_['endsWith'](_0x36f736[_0xc5d6('0x20')],_0xc5d6('0x21'))){_0x36f736[_0xc5d6('0x20')]=_0x36f736[_0xc5d6('0x20')][_0xc5d6('0x22')]('.wav49','.WAV');}if(recordings[_0x36f736[_0xc5d6('0x11')]]){var _0x593ab8=_[_0xc5d6('0x23')](recordings[_0x36f736['linkedid']][_0xc5d6('0x24')],{'value':_0x36f736[_0xc5d6('0x20')]});if(_[_0xc5d6('0x18')](_0x593ab8)){recordings[_0x36f736['linkedid']][_0xc5d6('0x24')][_0xc5d6('0x25')]({'value':_0x36f736[_0xc5d6('0x20')]});}}}}catch(_0x31e633){utils[_0xc5d6('0x16')](util[_0xc5d6('0x4')]('[%s][recordings][varset]',_0x36f736[_0xc5d6('0x6')]),_0x31e633);}};exports[_0xc5d6('0x26')]=function(_0x368a12){try{if(!_['isNil'](recordings[_0x368a12[_0xc5d6('0x6')]])){utils[_0xc5d6('0xf')](util['format'](_0xc5d6('0x27'),_0x368a12[_0xc5d6('0x6')]),_0x368a12);utils[_0xc5d6('0x3')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x368a12['uniqueid'],_0x368a12[_0xc5d6('0x28')],_0x368a12[_0xc5d6('0x29')],_0x368a12['cause-txt']));recordings[_0x368a12[_0xc5d6('0x6')]]['calleridnum']=_0x368a12[_0xc5d6('0x28')];recordings[_0x368a12[_0xc5d6('0x6')]]['calleridname']=_0x368a12[_0xc5d6('0x29')];recordings[_0x368a12[_0xc5d6('0x6')]]['connectedlinenum']=_0x368a12['connectedlinenum'];recordings[_0x368a12['uniqueid']]['connectedlinename']=_0x368a12[_0xc5d6('0x2a')];if(recordings[_0x368a12[_0xc5d6('0x6')]]['type']==_0xc5d6('0x2b')&&recordings[_0x368a12['uniqueid']]['accountcode']){recordings[_0x368a12[_0xc5d6('0x6')]][_0xc5d6('0x2c')]=recordings[_0x368a12['uniqueid']]['accountcode'];recordings[_0x368a12[_0xc5d6('0x6')]][_0xc5d6('0x2a')]='';}recordings[_0x368a12[_0xc5d6('0x6')]][_0xc5d6('0x24')][_0xc5d6('0x2d')](function(_0x4e16e6){var _0x1898ea=_['clone'](recordings[_0x368a12[_0xc5d6('0x6')]]);_0x1898ea['value']=_0x4e16e6[_0xc5d6('0x20')];writeDB(_0x1898ea);});delete recordings[_0x368a12[_0xc5d6('0x6')]];}}catch(_0x1c29bb){utils[_0xc5d6('0x16')](util['format'](_0xc5d6('0x27'),_0x368a12['uniqueid']),_0x1c29bb);}};exports[_0xc5d6('0x2e')]=function(_0x12aaa2){try{if(!_[_0xc5d6('0x18')](recordings[_0x12aaa2[_0xc5d6('0x6')]])){utils[_0xc5d6('0xf')](util['format'](_0xc5d6('0x2f'),_0x12aaa2[_0xc5d6('0x6')]),_0x12aaa2);utils[_0xc5d6('0x3')](util[_0xc5d6('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x12aaa2['uniqueid'],_0x12aaa2[_0xc5d6('0x30')],_0x12aaa2[_0xc5d6('0x31')]));if(_0x12aaa2[_0xc5d6('0x30')][_0xc5d6('0x32')]()==_0xc5d6('0x33')&&_[_0xc5d6('0x34')](_0x12aaa2[_0xc5d6('0x31')][_0xc5d6('0x32')](),_0xc5d6('0x35'))){var _0x2dc909=_0x12aaa2[_0xc5d6('0x31')]['split']('=');var _0x3d7ce9=_0x2dc909[0x0][_0xc5d6('0x36')](_0x2dc909[0x0]['lastIndexOf']('(')+0x1,_0x2dc909[0x0][_0xc5d6('0x37')](')'));var _0x2acce2=_0x2dc909[0x1];recordings[_0x12aaa2[_0xc5d6('0x6')]][_0x3d7ce9]=_0x2acce2;}}}catch(_0x42de3a){utils['error'](util['format'](_0xc5d6('0x2f'),_0x12aaa2[_0xc5d6('0x6')]),_0x42de3a);}};exports[_0xc5d6('0x38')]=function(_0x372c9c){try{if(!_[_0xc5d6('0x18')](recordings[_0x372c9c['uniqueid']])){utils[_0xc5d6('0xf')](util[_0xc5d6('0x4')](_0xc5d6('0x39'),_0x372c9c['uniqueid']),_0x372c9c);utils[_0xc5d6('0x3')](util[_0xc5d6('0x4')](_0xc5d6('0x3a'),_0x372c9c[_0xc5d6('0x6')],_0x372c9c[_0xc5d6('0x3b')]));recordings[_0x372c9c[_0xc5d6('0x6')]]['queue']=_0x372c9c['queue'];}}catch(_0x247eb3){utils[_0xc5d6('0x16')](util[_0xc5d6('0x4')](_0xc5d6('0x39'),_0x372c9c['uniqueid']),_0x247eb3);}};exports[_0xc5d6('0x3c')]=function(_0x1c7cf4){try{utils[_0xc5d6('0xf')](util[_0xc5d6('0x4')](_0xc5d6('0x3d'),_0x1c7cf4[_0xc5d6('0x6')]),_0x1c7cf4);utils[_0xc5d6('0x3')](util[_0xc5d6('0x4')](_0xc5d6('0x3e'),_0x1c7cf4['uniqueid'],_0x1c7cf4['transferercalleridnum'],_0x1c7cf4[_0xc5d6('0x3f')],_0x1c7cf4[_0xc5d6('0x40')],_0x1c7cf4[_0xc5d6('0x41')]));if(recordings[_0x1c7cf4[_0xc5d6('0x42')]]&&transfers[_0xc5d6('0x7')][_0x1c7cf4[_0xc5d6('0x42')]]){transfers[_0xc5d6('0x7')][_0x1c7cf4[_0xc5d6('0x42')]]['recording']=!![];}}catch(_0x4ba9eb){utils['error'](util[_0xc5d6('0x4')](_0xc5d6('0x3d'),_0x1c7cf4[_0xc5d6('0x6')]),_0x4ba9eb);}}; \ No newline at end of file +var _0x86ba=['[%s][recordings][varset]','value','endsWith','.wav49','replace','.WAV','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','blinds','newchannel','debug','linkedid','context','exten','error','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename'];(function(_0x21f88f,_0x48cfba){var _0x3b9ff5=function(_0x292aee){while(--_0x292aee){_0x21f88f['push'](_0x21f88f['shift']());}};_0x3b9ff5(++_0x48cfba);}(_0x86ba,0xb4));var _0xa86b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x86ba[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xa86b('0x0'));var util=require(_0xa86b('0x1'));var utils=require(_0xa86b('0x2'));var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x307aa3){var _0x208983;utils[_0xa86b('0x3')](util[_0xa86b('0x4')](_0xa86b('0x5'),_0x307aa3[_0xa86b('0x6')]));if(transfers['blinds'][_0x307aa3[_0xa86b('0x6')]]){_0x208983=_0x307aa3[_0xa86b('0x6')];_0x307aa3['uniqueid']=transfers['blinds'][_0x307aa3[_0xa86b('0x6')]]['transfereeuniqueid'];}if(_0x307aa3[_0xa86b('0x7')]){utils[_0xa86b('0x8')](_0x307aa3[_0xa86b('0x7')])[_0xa86b('0x9')](function(_0x181912){if(_0x181912){_0x307aa3['membername']=_0x181912[_0xa86b('0xa')];_0x307aa3[_0xa86b('0xb')]=_0x181912['id'];}utils[_0xa86b('0xc')](_0xa86b('0xd'),_0x307aa3);});}else{utils[_0xa86b('0xc')](_0xa86b('0xd'),_0x307aa3);}if(_0x208983)delete transfers[_0xa86b('0xe')][_0x208983];}exports[_0xa86b('0xf')]=function(_0x438f03){try{utils[_0xa86b('0x10')](util[_0xa86b('0x4')]('[%s][recordings][newchannel]',_0x438f03[_0xa86b('0x6')]),_0x438f03);if(_0x438f03[_0xa86b('0x6')]==_0x438f03[_0xa86b('0x11')]){utils[_0xa86b('0x3')](util[_0xa86b('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x438f03[_0xa86b('0x6')],_0x438f03[_0xa86b('0x12')],_0x438f03[_0xa86b('0x13')]));recordings[_0x438f03['uniqueid']]={'uniqueid':_0x438f03['uniqueid'],'accountcode':_0x438f03[_0xa86b('0x7')],'exten':_0x438f03[_0xa86b('0x13')],'context':_0x438f03[_0xa86b('0x12')],'channel':_0x438f03['channel'],'monitors':[]};}}catch(_0x26c06a){utils[_0xa86b('0x14')](util[_0xa86b('0x4')]('[%s][recordings][newchannel]',_0x438f03[_0xa86b('0x6')]),_0x26c06a);}};exports['newstate']=function(_0x190664){try{utils[_0xa86b('0x10')](util[_0xa86b('0x4')](_0xa86b('0x15'),_0x190664[_0xa86b('0x6')]),_0x190664);if(!_[_0xa86b('0x16')](recordings[_0x190664[_0xa86b('0x6')]])&&_0x190664[_0xa86b('0x17')]==0x6){utils[_0xa86b('0x3')](util['format'](_0xa86b('0x18'),_0x190664['uniqueid'],_0x190664[_0xa86b('0x12')],_0x190664[_0xa86b('0x19')]));}else if(!_[_0xa86b('0x16')](recordings[_0x190664['linkedid']])&&_0x190664['channelstate']==0x6&&_0x190664[_0xa86b('0x12')]!='transfer'){utils[_0xa86b('0x3')](util['format'](_0xa86b('0x1a'),_0x190664['uniqueid'],_0x190664['linkedid'],_0x190664[_0xa86b('0x12')],_0x190664[_0xa86b('0x19')]));recordings[_0x190664['linkedid']][_0xa86b('0x7')]=_0x190664[_0xa86b('0x7')];}}catch(_0x71c39){utils['error'](util[_0xa86b('0x4')]('[%s][recordings][newstate]',_0x190664[_0xa86b('0x6')]),_0x71c39);}};exports[_0xa86b('0x1b')]=function(_0x5e6c1a){try{if(!_[_0xa86b('0x16')](_0x5e6c1a[_0xa86b('0x1c')])&&!_[_0xa86b('0x16')](_0x5e6c1a[_0xa86b('0x1c')][_0xa86b('0x1d')])){utils[_0xa86b('0x10')](util[_0xa86b('0x4')](_0xa86b('0x1e'),_0x5e6c1a[_0xa86b('0x6')]),_0x5e6c1a);utils[_0xa86b('0x3')](util[_0xa86b('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x5e6c1a[_0xa86b('0x6')],_0x5e6c1a[_0xa86b('0x1c')],_0x5e6c1a[_0xa86b('0x1f')]));if(_[_0xa86b('0x20')](_0x5e6c1a[_0xa86b('0x1f')],_0xa86b('0x21'))){_0x5e6c1a['value']=_0x5e6c1a[_0xa86b('0x1f')][_0xa86b('0x22')](_0xa86b('0x21'),_0xa86b('0x23'));}if(recordings[_0x5e6c1a['linkedid']]){var _0x4936c4=_['find'](recordings[_0x5e6c1a[_0xa86b('0x11')]][_0xa86b('0x24')],{'value':_0x5e6c1a[_0xa86b('0x1f')]});if(_[_0xa86b('0x16')](_0x4936c4)){recordings[_0x5e6c1a[_0xa86b('0x11')]]['monitors'][_0xa86b('0x25')]({'value':_0x5e6c1a[_0xa86b('0x1f')]});}}}}catch(_0x151cd6){utils[_0xa86b('0x14')](util[_0xa86b('0x4')]('[%s][recordings][varset]',_0x5e6c1a['uniqueid']),_0x151cd6);}};exports['hangup']=function(_0x5e1459){try{if(!_['isNil'](recordings[_0x5e1459[_0xa86b('0x6')]])){utils[_0xa86b('0x10')](util['format'](_0xa86b('0x26'),_0x5e1459[_0xa86b('0x6')]),_0x5e1459);utils[_0xa86b('0x3')](util[_0xa86b('0x4')](_0xa86b('0x27'),_0x5e1459['uniqueid'],_0x5e1459[_0xa86b('0x28')],_0x5e1459[_0xa86b('0x29')],_0x5e1459[_0xa86b('0x2a')]));recordings[_0x5e1459['uniqueid']][_0xa86b('0x28')]=_0x5e1459[_0xa86b('0x28')];recordings[_0x5e1459[_0xa86b('0x6')]][_0xa86b('0x29')]=_0x5e1459[_0xa86b('0x29')];recordings[_0x5e1459[_0xa86b('0x6')]][_0xa86b('0x2b')]=_0x5e1459['connectedlinenum'];recordings[_0x5e1459[_0xa86b('0x6')]][_0xa86b('0x2c')]=_0x5e1459[_0xa86b('0x2c')];if(recordings[_0x5e1459[_0xa86b('0x6')]][_0xa86b('0x2d')]==_0xa86b('0x2e')&&recordings[_0x5e1459[_0xa86b('0x6')]]['accountcode']){recordings[_0x5e1459[_0xa86b('0x6')]][_0xa86b('0x2b')]=recordings[_0x5e1459[_0xa86b('0x6')]][_0xa86b('0x7')];recordings[_0x5e1459[_0xa86b('0x6')]][_0xa86b('0x2c')]='';}recordings[_0x5e1459[_0xa86b('0x6')]]['monitors']['forEach'](function(_0x24b79e){var _0x29f620=_[_0xa86b('0x2f')](recordings[_0x5e1459[_0xa86b('0x6')]]);_0x29f620[_0xa86b('0x1f')]=_0x24b79e[_0xa86b('0x1f')];writeDB(_0x29f620);});delete recordings[_0x5e1459[_0xa86b('0x6')]];}}catch(_0x2eaf68){utils[_0xa86b('0x14')](util[_0xa86b('0x4')](_0xa86b('0x26'),_0x5e1459[_0xa86b('0x6')]),_0x2eaf68);}};exports[_0xa86b('0x30')]=function(_0x274d4d){try{if(!_[_0xa86b('0x16')](recordings[_0x274d4d[_0xa86b('0x6')]])){utils[_0xa86b('0x10')](util['format'](_0xa86b('0x31'),_0x274d4d[_0xa86b('0x6')]),_0x274d4d);utils['info'](util[_0xa86b('0x4')](_0xa86b('0x32'),_0x274d4d[_0xa86b('0x6')],_0x274d4d['application'],_0x274d4d[_0xa86b('0x33')]));if(_0x274d4d['application'][_0xa86b('0x34')]()==_0xa86b('0x35')&&_[_0xa86b('0x36')](_0x274d4d['appdata'][_0xa86b('0x34')](),_0xa86b('0x37'))){var _0x29787d=_0x274d4d[_0xa86b('0x33')][_0xa86b('0x38')]('=');var _0x3df7e4=_0x29787d[0x0][_0xa86b('0x39')](_0x29787d[0x0][_0xa86b('0x3a')]('(')+0x1,_0x29787d[0x0][_0xa86b('0x3a')](')'));var _0x3cf605=_0x29787d[0x1];recordings[_0x274d4d[_0xa86b('0x6')]][_0x3df7e4]=_0x3cf605;}}}catch(_0x5511ce){utils[_0xa86b('0x14')](util[_0xa86b('0x4')](_0xa86b('0x31'),_0x274d4d[_0xa86b('0x6')]),_0x5511ce);}};exports['queuecallerjoin']=function(_0x4a18cf){try{if(!_[_0xa86b('0x16')](recordings[_0x4a18cf[_0xa86b('0x6')]])){utils[_0xa86b('0x10')](util[_0xa86b('0x4')](_0xa86b('0x3b'),_0x4a18cf['uniqueid']),_0x4a18cf);utils[_0xa86b('0x3')](util['format'](_0xa86b('0x3c'),_0x4a18cf['uniqueid'],_0x4a18cf[_0xa86b('0x3d')]));recordings[_0x4a18cf[_0xa86b('0x6')]][_0xa86b('0x3d')]=_0x4a18cf[_0xa86b('0x3d')];}}catch(_0x10694b){utils[_0xa86b('0x14')](util[_0xa86b('0x4')](_0xa86b('0x3b'),_0x4a18cf[_0xa86b('0x6')]),_0x10694b);}};exports[_0xa86b('0x3e')]=function(_0x3c6a5d){try{utils['debug'](util[_0xa86b('0x4')](_0xa86b('0x3f'),_0x3c6a5d['uniqueid']),_0x3c6a5d);utils[_0xa86b('0x3')](util[_0xa86b('0x4')](_0xa86b('0x40'),_0x3c6a5d[_0xa86b('0x6')],_0x3c6a5d[_0xa86b('0x41')],_0x3c6a5d['transferercalleridname'],_0x3c6a5d[_0xa86b('0x42')],_0x3c6a5d[_0xa86b('0x43')]));if(recordings[_0x3c6a5d[_0xa86b('0x44')]]&&transfers['blinds'][_0x3c6a5d[_0xa86b('0x44')]]){transfers['blinds'][_0x3c6a5d['transfereruniqueid']][_0xa86b('0x45')]=!![];}}catch(_0x336a09){utils[_0xa86b('0x14')](util['format']('[%s][recordings][blindtransfer]',_0x3c6a5d[_0xa86b('0x6')]),_0x336a09);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 68d1883..c930618 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 _0x2f42=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x2f42,0x8e));var _0x22f4=function(_0xebd349,_0xc08820){_0xebd349=_0xebd349-0x0;var _0x2bc545=_0x2f42[_0xebd349];return _0x2bc545;};'use strict';var _=require(_0x22f4('0x0'));var util=require(_0x22f4('0x1'));var utils=require(_0x22f4('0x2'));function writeDB(_0x2fb89a){utils[_0x22f4('0x3')](util[_0x22f4('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x2fb89a[_0x22f4('0x5')]===_0x22f4('0x6')?_0x2fb89a[_0x22f4('0x7')]:_0x2fb89a[_0x22f4('0x8')],_0x2fb89a['type']));utils[_0x22f4('0x9')](_0x22f4('0xa'),_0x2fb89a);}exports['blinds']={};exports[_0x22f4('0xb')]=function(_0x6a9440){try{utils[_0x22f4('0xc')](util[_0x22f4('0x4')](_0x22f4('0xd'),_0x6a9440[_0x22f4('0x8')]),_0x6a9440);utils[_0x22f4('0x3')](util[_0x22f4('0x4')](_0x22f4('0xe'),_0x6a9440['uniqueid'],_0x6a9440[_0x22f4('0xf')],_0x6a9440[_0x22f4('0x10')],_0x6a9440[_0x22f4('0x11')],_0x6a9440[_0x22f4('0x12')]));_0x6a9440[_0x22f4('0x5')]=_0x22f4('0x13');exports[_0x22f4('0x14')][_0x6a9440['transfereruniqueid']]=_0x6a9440;writeDB(_0x6a9440);}catch(_0x3c0685){utils['error'](util['format'](_0x22f4('0xd'),_0x6a9440['uniqueid']),_0x3c0685);}};exports[_0x22f4('0x15')]=function(_0x4a45dc){try{utils[_0x22f4('0xc')](util['format'](_0x22f4('0x16'),_0x4a45dc[_0x22f4('0x7')]),_0x4a45dc);utils['info'](util[_0x22f4('0x4')](_0x22f4('0x17'),_0x4a45dc['origtransfereruniqueid'],_0x4a45dc[_0x22f4('0x18')],_0x4a45dc['origtransferercalleridname'],_0x4a45dc[_0x22f4('0x19')],_0x4a45dc[_0x22f4('0x1a')]));_0x4a45dc=_[_0x22f4('0x1b')](_0x4a45dc,{'transfererchannel':_0x4a45dc['origtransfererchannel'],'transferercalleridnum':_0x4a45dc['origtransferercalleridnum'],'transferercalleridname':_0x4a45dc[_0x22f4('0x1c')],'transfererconnectedlinenum':_0x4a45dc[_0x22f4('0x1d')],'transfererconnectedlinename':_0x4a45dc[_0x22f4('0x1e')],'transfereraccountcode':_0x4a45dc[_0x22f4('0x1f')],'transferercontext':_0x4a45dc[_0x22f4('0x20')],'transfererexten':_0x4a45dc[_0x22f4('0x21')],'transfererlinkedid':_0x4a45dc['origtransfererlinkedid'],'context':_0x4a45dc[_0x22f4('0x22')],'extension':_0x4a45dc[_0x22f4('0x23')],'type':_0x22f4('0x6')});if(_[_0x22f4('0x24')](_0x4a45dc[_0x22f4('0x25')])){_0x4a45dc=_[_0x22f4('0x1b')](_0x4a45dc,{'transfereechannel':_0x4a45dc[_0x22f4('0x26')],'transfereecalleridnum':_0x4a45dc[_0x22f4('0x19')],'transfereecalleridname':_0x4a45dc[_0x22f4('0x1a')],'transfereeconnectedlinenum':_0x4a45dc[_0x22f4('0x27')],'transfereeconnectedlinename':_0x4a45dc[_0x22f4('0x28')],'transfereeaccountcode':_0x4a45dc[_0x22f4('0x29')],'transfereecontext':_0x4a45dc[_0x22f4('0x2a')],'transfereeexten':_0x4a45dc[_0x22f4('0x2b')],'transfereelinkedid':_0x4a45dc[_0x22f4('0x2c')]});}writeDB(_0x4a45dc);}catch(_0x1f705f){utils[_0x22f4('0x2d')](util[_0x22f4('0x4')](_0x22f4('0x16'),_0x4a45dc['origtransfereruniqueid']),_0x1f705f);}}; \ No newline at end of file +var _0x66b6=['format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x66b6,0xfc));var _0x666b=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x66b6[_0x3c504b];return _0x2e5354;};'use strict';var _=require(_0x666b('0x0'));var util=require(_0x666b('0x1'));var utils=require(_0x666b('0x2'));function writeDB(_0x238b1d){utils[_0x666b('0x3')](util['format'](_0x666b('0x4'),_0x238b1d[_0x666b('0x5')]===_0x666b('0x6')?_0x238b1d['origtransfereruniqueid']:_0x238b1d[_0x666b('0x7')],_0x238b1d[_0x666b('0x5')]));utils['request'](_0x666b('0x8'),_0x238b1d);}exports[_0x666b('0x9')]={};exports[_0x666b('0xa')]=function(_0xa4ffd4){try{utils[_0x666b('0xb')](util[_0x666b('0xc')](_0x666b('0xd'),_0xa4ffd4[_0x666b('0x7')]),_0xa4ffd4);utils[_0x666b('0x3')](util[_0x666b('0xc')](_0x666b('0xe'),_0xa4ffd4[_0x666b('0x7')],_0xa4ffd4['transferercalleridnum'],_0xa4ffd4[_0x666b('0xf')],_0xa4ffd4[_0x666b('0x10')],_0xa4ffd4[_0x666b('0x11')]));_0xa4ffd4[_0x666b('0x5')]=_0x666b('0x12');exports[_0x666b('0x9')][_0xa4ffd4[_0x666b('0x13')]]=_0xa4ffd4;writeDB(_0xa4ffd4);}catch(_0x29887c){utils[_0x666b('0x14')](util[_0x666b('0xc')](_0x666b('0xd'),_0xa4ffd4[_0x666b('0x7')]),_0x29887c);}};exports['attendedtransfer']=function(_0x3b9d11){try{utils[_0x666b('0xb')](util[_0x666b('0xc')](_0x666b('0x15'),_0x3b9d11[_0x666b('0x16')]),_0x3b9d11);utils[_0x666b('0x3')](util[_0x666b('0xc')](_0x666b('0x17'),_0x3b9d11[_0x666b('0x16')],_0x3b9d11[_0x666b('0x18')],_0x3b9d11[_0x666b('0x19')],_0x3b9d11[_0x666b('0x1a')],_0x3b9d11[_0x666b('0x1b')]));_0x3b9d11=_['assign'](_0x3b9d11,{'transfererchannel':_0x3b9d11[_0x666b('0x1c')],'transferercalleridnum':_0x3b9d11[_0x666b('0x18')],'transferercalleridname':_0x3b9d11['origtransferercalleridname'],'transfererconnectedlinenum':_0x3b9d11[_0x666b('0x1d')],'transfererconnectedlinename':_0x3b9d11[_0x666b('0x1e')],'transfereraccountcode':_0x3b9d11['origtransfereraccountcode'],'transferercontext':_0x3b9d11[_0x666b('0x1f')],'transfererexten':_0x3b9d11[_0x666b('0x20')],'transfererlinkedid':_0x3b9d11['origtransfererlinkedid'],'context':_0x3b9d11[_0x666b('0x21')],'extension':_0x3b9d11[_0x666b('0x22')],'type':_0x666b('0x6')});if(_[_0x666b('0x23')](_0x3b9d11[_0x666b('0x24')])){_0x3b9d11=_[_0x666b('0x25')](_0x3b9d11,{'transfereechannel':_0x3b9d11[_0x666b('0x26')],'transfereecalleridnum':_0x3b9d11[_0x666b('0x1a')],'transfereecalleridname':_0x3b9d11['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3b9d11[_0x666b('0x27')],'transfereeconnectedlinename':_0x3b9d11[_0x666b('0x28')],'transfereeaccountcode':_0x3b9d11[_0x666b('0x29')],'transfereecontext':_0x3b9d11[_0x666b('0x2a')],'transfereeexten':_0x3b9d11[_0x666b('0x2b')],'transfereelinkedid':_0x3b9d11['transfertargetlinkedid']});}writeDB(_0x3b9d11);}catch(_0x16ff4e){utils[_0x666b('0x14')](util[_0x666b('0xc')](_0x666b('0x15'),_0x3b9d11[_0x666b('0x16')]),_0x16ff4e);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 1310152..2462f30 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 _0xf1bd=['request','then','catch','error','internal','name','interface','[utils][getUser]\x20where:%s','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByName]\x20name:%s\x20%s','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','notfound','length','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','xdr','info','debug','inspect'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xf1bd,0x19a));var _0xdf1b=function(_0x352ab2,_0x569cda){_0x352ab2=_0x352ab2-0x0;var _0x25d055=_0xf1bd[_0x352ab2];return _0x25d055;};'use strict';var BPromise=require(_0xdf1b('0x0'));var jayson=require(_0xdf1b('0x1'));var moment=require(_0xdf1b('0x2'));var util=require('util');var client=jayson[_0xdf1b('0x3')][_0xdf1b('0x4')]({'port':0x2329});var logger=require(_0xdf1b('0x5'))(_0xdf1b('0x6'));exports[_0xdf1b('0x7')]=function(_0x469aac,_0x3eed4e){logger['info'](_0x469aac,_0x3eed4e?util['inspect'](_0x3eed4e,{'showHidden':![],'depth':null}):'');};exports[_0xdf1b('0x8')]=function(_0x402c29,_0xe82fbe){logger[_0xdf1b('0x8')](_0x402c29,_0xe82fbe?util[_0xdf1b('0x9')](_0xe82fbe,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x2fed36,_0x42ef7d){logger['error'](_0x2fed36,_0x42ef7d?util['inspect'](_0x42ef7d,{'showHidden':![],'depth':null}):'');};exports[_0xdf1b('0xa')]=function(_0xa2fcbf,_0x1949f7){return client[_0xdf1b('0xa')](_0xa2fcbf,{'body':_0x1949f7})[_0xdf1b('0xb')](function(_0x4a5706){logger[_0xdf1b('0x8')]('[utils][request]\x20name:%s',_0xa2fcbf,_0x4a5706?util['inspect'](_0x4a5706,{'showHidden':![],'depth':null}):'');})[_0xdf1b('0xc')](function(_0x42f84a){logger[_0xdf1b('0xd')]('[utils][request]\x20name:%s',_0xa2fcbf,_0x42f84a?util[_0xdf1b('0x9')](_0x42f84a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5ba13c){return client[_0xdf1b('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xdf1b('0xe'),_0xdf1b('0xf'),_0xdf1b('0x10')],'where':_0x5ba13c,'limit':0x1}})[_0xdf1b('0xb')](function(_0x564401){logger['debug'](_0xdf1b('0x11'),JSON['stringify'](_0x5ba13c),_0x564401?util[_0xdf1b('0x9')](_0x564401,{'showHidden':![],'depth':null}):'');return _0x564401[_0xdf1b('0x12')]['length']?_0x564401['result'][0x0]:null;});}exports[_0xdf1b('0x13')]=function(_0xbe2cf3){return new BPromise(function(_0x518c1c,_0x3e66f2){if(_0xbe2cf3){return getUser({'internal':_0xbe2cf3})['then'](function(_0x13b315){logger[_0xdf1b('0x7')](_0xdf1b('0x14'),_0xbe2cf3,_0x13b315?_0xdf1b('0x15'):'notfound');return _0x518c1c(_0x13b315);})[_0xdf1b('0xc')](function(_0x2dc371){logger[_0xdf1b('0xd')](_0xdf1b('0x16'),_0x2dc371?util[_0xdf1b('0x9')](_0x2dc371,{'showHidden':![],'depth':null}):'');return _0x518c1c(null);});}return _0x518c1c(null);});};exports[_0xdf1b('0x17')]=function(_0x9ef87){return new BPromise(function(_0x110853,_0x30a13d){if(_0x9ef87){return getUser({'interface':_0x9ef87})[_0xdf1b('0xb')](function(_0x2ee1bb){logger[_0xdf1b('0x7')](_0xdf1b('0x18'),_0x9ef87,_0x2ee1bb?'found':'notfound');return _0x110853(_0x2ee1bb);})['catch'](function(_0x31c14a){logger['error']('[utils][getUserByInterface]',_0x31c14a?util[_0xdf1b('0x9')](_0x31c14a,{'showHidden':![],'depth':null}):'');return _0x110853(null);});}return _0x110853(null);});};exports['getUserByName']=function(_0x5a8c2d){return new BPromise(function(_0x57939a,_0x11c420){if(_0x5a8c2d){return getUser({'name':_0x5a8c2d})[_0xdf1b('0xb')](function(_0x189aa7){logger[_0xdf1b('0x7')](_0xdf1b('0x19'),_0x5a8c2d,_0x189aa7?_0xdf1b('0x15'):'notfound');return _0x57939a(_0x189aa7);})[_0xdf1b('0xc')](function(_0x490e78){logger['error']('[utils][getUserByName]',_0x490e78?util[_0xdf1b('0x9')](_0x490e78,{'showHidden':![],'depth':null}):'');return _0x57939a(null);});}return _0x57939a(null);});};exports['getVoiceQueueByName']=function(_0x1a3dbd){return new BPromise(function(_0x39f5ec,_0x2b8bba){if(_0x1a3dbd){return client[_0xdf1b('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0xdf1b('0x1a'),_0xdf1b('0x1b'),_0xdf1b('0x1c')],'where':{'name':_0x1a3dbd},'limit':0x1}})['then'](function(_0x108759){logger[_0xdf1b('0x8')](_0xdf1b('0x1d'),_0x1a3dbd,_0x108759?util[_0xdf1b('0x9')](_0x108759,{'showHidden':![],'depth':null}):'');logger[_0xdf1b('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x1a3dbd,_0x108759?'found':_0xdf1b('0x1e'));return _0x39f5ec(_0x108759[_0xdf1b('0x12')][_0xdf1b('0x1f')]?_0x108759[_0xdf1b('0x12')][0x0]:null);})[_0xdf1b('0xc')](function(_0x58042d){logger[_0xdf1b('0xd')]('[utils][getVoiceQueueByName]',_0x58042d?util[_0xdf1b('0x9')](_0x58042d,{'showHidden':![],'depth':null}):'');return _0x39f5ec(null);});}return _0x39f5ec(null);});};exports['addTime']=function(_0xc1d5b2,_0xa5c71f){return moment(_0xc1d5b2)['add'](_0xa5c71f,_0xdf1b('0x20'))[_0xdf1b('0x21')](_0xdf1b('0x22'));};exports[_0xdf1b('0x23')]=function(_0x24b114,_0x297ee4){return moment(_0x24b114)[_0xdf1b('0x24')](_0x297ee4,'seconds')[_0xdf1b('0x21')](_0xdf1b('0x22'));};exports[_0xdf1b('0x25')]=function(_0x5860bf,_0x19fc48){return moment(_0x5860bf)[_0xdf1b('0x26')](moment(_0x19fc48),'seconds');};exports['sumTime']=function(_0x409a65,_0x525258){return parseInt(_0x409a65,0xa)+parseInt(_0x525258,0xa);};exports[_0xdf1b('0x27')]=function(){return moment()[_0xdf1b('0x21')](_0xdf1b('0x22'));};exports[_0xdf1b('0x28')]=function(_0xc7fa93,_0xdd4628){if(_0xdd4628){return moment(_0xc7fa93)[_0xdf1b('0x28')](_0xdd4628);}return!![];};exports[_0xdf1b('0x29')]=function(_0x719add,_0x2640a3){if(_0x2640a3){return moment(_0x719add)[_0xdf1b('0x29')](_0x2640a3);}else if(_0x719add){return!![];}return![];}; \ No newline at end of file +var _0x9fe7=['[utils][getVoiceQueueByName]','addTime','add','seconds','format','subtractTime','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','isBefore','bluebird','jayson/promise','util','http','../../config/logger','xdr','info','debug','inspect','error','request','then','catch','[utils][request]\x20name:%s','internal','name','interface','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByName','[utils][getUserByName]','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9fe7,0x1df));var _0x79fe=function(_0x29f587,_0x839db3){_0x29f587=_0x29f587-0x0;var _0x2f84e0=_0x9fe7[_0x29f587];return _0x2f84e0;};'use strict';var BPromise=require(_0x79fe('0x0'));var jayson=require(_0x79fe('0x1'));var moment=require('moment');var util=require(_0x79fe('0x2'));var client=jayson['client'][_0x79fe('0x3')]({'port':0x2329});var logger=require(_0x79fe('0x4'))(_0x79fe('0x5'));exports['info']=function(_0x44c145,_0x627ec4){logger[_0x79fe('0x6')](_0x44c145,_0x627ec4?util['inspect'](_0x627ec4,{'showHidden':![],'depth':null}):'');};exports[_0x79fe('0x7')]=function(_0x2a5aef,_0x2ba246){logger['debug'](_0x2a5aef,_0x2ba246?util[_0x79fe('0x8')](_0x2ba246,{'showHidden':![],'depth':null}):'');};exports[_0x79fe('0x9')]=function(_0x29b317,_0x26d723){logger[_0x79fe('0x9')](_0x29b317,_0x26d723?util['inspect'](_0x26d723,{'showHidden':![],'depth':null}):'');};exports[_0x79fe('0xa')]=function(_0x253f7d,_0x4a3ccf){return client[_0x79fe('0xa')](_0x253f7d,{'body':_0x4a3ccf})[_0x79fe('0xb')](function(_0x33351e){logger[_0x79fe('0x7')]('[utils][request]\x20name:%s',_0x253f7d,_0x33351e?util[_0x79fe('0x8')](_0x33351e,{'showHidden':![],'depth':null}):'');})[_0x79fe('0xc')](function(_0x3e0ad8){logger[_0x79fe('0x9')](_0x79fe('0xd'),_0x253f7d,_0x3e0ad8?util[_0x79fe('0x8')](_0x3e0ad8,{'showHidden':![],'depth':null}):'');});};function getUser(_0x42bbe4){return client[_0x79fe('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x79fe('0xe'),_0x79fe('0xf'),_0x79fe('0x10')],'where':_0x42bbe4,'limit':0x1}})[_0x79fe('0xb')](function(_0x35fb79){logger[_0x79fe('0x7')]('[utils][getUser]\x20where:%s',JSON[_0x79fe('0x11')](_0x42bbe4),_0x35fb79?util[_0x79fe('0x8')](_0x35fb79,{'showHidden':![],'depth':null}):'');return _0x35fb79[_0x79fe('0x12')][_0x79fe('0x13')]?_0x35fb79['result'][0x0]:null;});}exports[_0x79fe('0x14')]=function(_0x16f93a){return new BPromise(function(_0x39be95,_0x40a549){if(_0x16f93a){return getUser({'internal':_0x16f93a})['then'](function(_0x5e2f0b){logger[_0x79fe('0x6')](_0x79fe('0x15'),_0x16f93a,_0x5e2f0b?_0x79fe('0x16'):'notfound');return _0x39be95(_0x5e2f0b);})[_0x79fe('0xc')](function(_0x4141ec){logger[_0x79fe('0x9')]('[utils][getUserByInternal]',_0x4141ec?util[_0x79fe('0x8')](_0x4141ec,{'showHidden':![],'depth':null}):'');return _0x39be95(null);});}return _0x39be95(null);});};exports['getUserByInterface']=function(_0x15f019){return new BPromise(function(_0xde2451,_0x3f1b15){if(_0x15f019){return getUser({'interface':_0x15f019})[_0x79fe('0xb')](function(_0x1ac8d7){logger[_0x79fe('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x15f019,_0x1ac8d7?'found':_0x79fe('0x17'));return _0xde2451(_0x1ac8d7);})['catch'](function(_0x16aa35){logger[_0x79fe('0x9')]('[utils][getUserByInterface]',_0x16aa35?util['inspect'](_0x16aa35,{'showHidden':![],'depth':null}):'');return _0xde2451(null);});}return _0xde2451(null);});};exports[_0x79fe('0x18')]=function(_0x321778){return new BPromise(function(_0x59339b,_0x46d93d){if(_0x321778){return getUser({'name':_0x321778})[_0x79fe('0xb')](function(_0x5c84e0){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x321778,_0x5c84e0?_0x79fe('0x16'):_0x79fe('0x17'));return _0x59339b(_0x5c84e0);})[_0x79fe('0xc')](function(_0x4ac913){logger[_0x79fe('0x9')](_0x79fe('0x19'),_0x4ac913?util[_0x79fe('0x8')](_0x4ac913,{'showHidden':![],'depth':null}):'');return _0x59339b(null);});}return _0x59339b(null);});};exports['getVoiceQueueByName']=function(_0x4e2740){return new BPromise(function(_0x14e055,_0x51200f){if(_0x4e2740){return client[_0x79fe('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name','type','acw',_0x79fe('0x1a')],'where':{'name':_0x4e2740},'limit':0x1}})[_0x79fe('0xb')](function(_0x4dff5f){logger[_0x79fe('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x4e2740,_0x4dff5f?util[_0x79fe('0x8')](_0x4dff5f,{'showHidden':![],'depth':null}):'');logger[_0x79fe('0x6')](_0x79fe('0x1b'),_0x4e2740,_0x4dff5f?_0x79fe('0x16'):_0x79fe('0x17'));return _0x14e055(_0x4dff5f['result'][_0x79fe('0x13')]?_0x4dff5f[_0x79fe('0x12')][0x0]:null);})[_0x79fe('0xc')](function(_0x190202){logger[_0x79fe('0x9')](_0x79fe('0x1c'),_0x190202?util['inspect'](_0x190202,{'showHidden':![],'depth':null}):'');return _0x14e055(null);});}return _0x14e055(null);});};exports[_0x79fe('0x1d')]=function(_0x125226,_0x8ddef3){return moment(_0x125226)[_0x79fe('0x1e')](_0x8ddef3,_0x79fe('0x1f'))[_0x79fe('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x79fe('0x21')]=function(_0x5a917f,_0x2bdf83){return moment(_0x5a917f)['subtract'](_0x2bdf83,_0x79fe('0x1f'))['format'](_0x79fe('0x22'));};exports[_0x79fe('0x23')]=function(_0x41177d,_0x4fb6f4){return moment(_0x41177d)[_0x79fe('0x24')](moment(_0x4fb6f4),_0x79fe('0x1f'));};exports[_0x79fe('0x25')]=function(_0x31b9d6,_0x2b203b){return parseInt(_0x31b9d6,0xa)+parseInt(_0x2b203b,0xa);};exports['now']=function(){return moment()['format'](_0x79fe('0x22'));};exports['isAfter']=function(_0x27de50,_0x44d97e){if(_0x44d97e){return moment(_0x27de50)['isAfter'](_0x44d97e);}return!![];};exports[_0x79fe('0x26')]=function(_0x46da71,_0xfa1cc){if(_0xfa1cc){return moment(_0x46da71)[_0x79fe('0x26')](_0xfa1cc);}else if(_0x46da71){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 e84bee6..559e6fc 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 _0x674d=['lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','maskSensitiveData','join','/var','log','xcally','role','name','then','catch','user','no-user','data','client','error','api','auth','set','client-side-logger','use','logger','isEmpty','body','\x20body=%s','format','method','headers','remoteAddress','url','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','x-forwarded-for','agent_name','test','setupLoggers'];(function(_0x907421,_0x5919c7){var _0x1e2ac7=function(_0x2b20b4){while(--_0x2b20b4){_0x907421['push'](_0x907421['shift']());}};_0x1e2ac7(++_0x5919c7);}(_0x674d,0xdc));var _0xd674=function(_0x482115,_0x5550f5){_0x482115=_0x482115-0x0;var _0x40afb4=_0x674d[_0x482115];return _0x40afb4;};var fs=require('fs-extra');var _=require(_0xd674('0x0'));var ewinston=require('express-winston');var path=require(_0xd674('0x1'));var util=require(_0xd674('0x2'));var fileLogger=require(_0xd674('0x3'))[_0xd674('0x4')];var safeTemplate=require(_0xd674('0x5'))[_0xd674('0x6')];var maskSensitiveData=require('./mask-sensitive-data')[_0xd674('0x7')];function ClientSideLogger(){function _0x4c742b(_0x2a6cdb){var _0x566cf1=path[_0xd674('0x8')](_0xd674('0x9'),_0xd674('0xa'),_0xd674('0xb'));var _0x31dd9b=path[_0xd674('0x8')]('client',_0x2a6cdb[_0xd674('0xc')]+'-'+_0x2a6cdb[_0xd674('0xd')]);return fs['ensureDir'](path[_0xd674('0x8')](_0x566cf1,_0x31dd9b))[_0xd674('0xe')](function(){var _0x1d6a6b=fileLogger('client',path[_0xd674('0x8')](_0x566cf1,_0x31dd9b));return _0x1d6a6b;})[_0xd674('0xf')](function(_0x1155f9){throw _0x1155f9;});}this['log']=function(_0x325816,_0x5d4dcb,_0x49df24,_0x3b0607){return _0x4c742b(_0x325816['user'])[_0xd674('0xe')](function(_0x2da05a){var _0x4e851a=_0x2da05a[_0x5d4dcb];return _0x4e851a;})['then'](function(_0x41307b){var _0x461c06=_0x325816[_0xd674('0x10')]?_0x325816[_0xd674('0x10')]['id']:_0xd674('0x11');var _0x411d00=_0x3b0607[_0xd674('0x12')];var _0x22bc1b=_0x3b0607['timestamp'];var _0x157f78=new Date(Number(_0x22bc1b));return _0x41307b(_0x461c06,_0x157f78,_0x49df24,_0x411d00);})[_0xd674('0xf')](function(_0x2d1015){fileLogger(_0xd674('0x13'))[_0xd674('0x14')](_0x2d1015);});};}function setupLoggers(_0x2fdc3f){return new Promise(function(_0x44770f){var _0x2b5692=new ClientSideLogger();var _0x8c876b=fileLogger(_0xd674('0x15'));var _0x50fd35=fileLogger(_0xd674('0x16'));_0x2fdc3f[_0xd674('0x17')](_0xd674('0x18'),_0x2b5692);_0x2fdc3f[_0xd674('0x19')](ewinston[_0xd674('0x1a')]({'winstonInstance':_0x8c876b,'meta':![],'statusLevels':!![],'msg':function(_0x475c52,_0x3eb219){var _0x57aff4='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xd674('0x1b')](_0x475c52[_0xd674('0x1c')])){_0x57aff4+=_0xd674('0x1d');var _0x31120d=_0x475c52['body'];maskSensitiveData(_0x31120d);}return safeTemplate(util[_0xd674('0x1e')](_0x57aff4,_0x475c52[_0xd674('0x1f')],_0x475c52[_0xd674('0x20')]['x-forwarded-for']?_0x475c52['headers']['x-forwarded-for']:_0x475c52['connection'][_0xd674('0x21')]||_0x475c52['ip'],_0x475c52[_0xd674('0x22')],_0x3eb219['statusCode'],_0x3eb219[_0xd674('0x23')],_0x475c52['user']?_0x475c52[_0xd674('0x10')]['id']:null,_0x475c52[_0xd674('0x10')]?_0x475c52['user'][_0xd674('0xd')]:null,_0x475c52[_0xd674('0x10')]?_0x475c52[_0xd674('0x10')][_0xd674('0xc')]:null,_0x31120d?util[_0xd674('0x24')](_0x31120d,![],null):''));}}));_0x2fdc3f[_0xd674('0x19')](ewinston[_0xd674('0x1a')]({'winstonInstance':_0x50fd35,'meta':![],'statusLevels':!![],'msg':function(_0x59b95e,_0x509ee3){var _0x5caab5=_0xd674('0x25');if(_0x59b95e[_0xd674('0x1c')]&&_0x59b95e[_0xd674('0x1c')][_0xd674('0x26')]&&_0x59b95e[_0xd674('0x1c')][_0xd674('0x27')]){_0x5caab5='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xd674('0x1e')](_0x5caab5,_0x59b95e['method'],_0x59b95e[_0xd674('0x20')][_0xd674('0x28')]?_0x59b95e[_0xd674('0x20')][_0xd674('0x28')]:_0x59b95e['connection'][_0xd674('0x21')]||_0x59b95e['ip'],_0x59b95e['url'],_0x509ee3['statusCode'],_0x509ee3['responseTime'],_0x59b95e[_0xd674('0x10')]?_0x59b95e[_0xd674('0x10')]['id']:null,_0x59b95e['user']?_0x59b95e['user'][_0xd674('0xd')]:null,_0x59b95e[_0xd674('0x10')]?_0x59b95e[_0xd674('0x10')][_0xd674('0xc')]:null,_0x59b95e['body']&&_0x59b95e['body']['device']?_0x59b95e[_0xd674('0x1c')][_0xd674('0x26')]:'other',_0x59b95e[_0xd674('0x1c')]&&_0x59b95e[_0xd674('0x1c')][_0xd674('0x27')]?_0x59b95e[_0xd674('0x1c')][_0xd674('0x27')]:'',_0x59b95e[_0xd674('0x1c')]&&_0x59b95e[_0xd674('0x1c')][_0xd674('0x29')]?_0x59b95e[_0xd674('0x1c')]['agent_name']:'');},'ignoreRoute':function(_0xd66cb){var _0x30e44c=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x30e44c[_0xd674('0x2a')](_0xd66cb['url']);}}));return _0x44770f();});}exports[_0xd674('0x2b')]=setupLoggers; \ No newline at end of file +var _0x6e86=['inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','format','role','other','agent_name','setupLoggers','lodash','express-winston','path','util','./loggers','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','xcally','client','name','ensureDir','log','user','then','no-user','timestamp','catch','error','auth','set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0x6e86,0x1d5));var _0x66e8=function(_0x447ef1,_0x374cd2){_0x447ef1=_0x447ef1-0x0;var _0x3d72ec=_0x6e86[_0x447ef1];return _0x3d72ec;};var fs=require('fs-extra');var _=require(_0x66e8('0x0'));var ewinston=require(_0x66e8('0x1'));var path=require(_0x66e8('0x2'));var util=require(_0x66e8('0x3'));var fileLogger=require(_0x66e8('0x4'))['fileLogger'];var safeTemplate=require('./safe-template')[_0x66e8('0x5')];var maskSensitiveData=require(_0x66e8('0x6'))[_0x66e8('0x7')];function ClientSideLogger(){function _0x1d275e(_0x5a4db7){var _0x265eec=path[_0x66e8('0x8')](_0x66e8('0x9'),'log',_0x66e8('0xa'));var _0x105415=path[_0x66e8('0x8')](_0x66e8('0xb'),_0x5a4db7['role']+'-'+_0x5a4db7[_0x66e8('0xc')]);return fs[_0x66e8('0xd')](path[_0x66e8('0x8')](_0x265eec,_0x105415))['then'](function(){var _0x2bd8c8=fileLogger(_0x66e8('0xb'),path[_0x66e8('0x8')](_0x265eec,_0x105415));return _0x2bd8c8;})['catch'](function(_0x336131){throw _0x336131;});}this[_0x66e8('0xe')]=function(_0x55c9f0,_0x51dd90,_0x323414,_0x3233a3){return _0x1d275e(_0x55c9f0[_0x66e8('0xf')])[_0x66e8('0x10')](function(_0x3d4592){var _0x4ed308=_0x3d4592[_0x51dd90];return _0x4ed308;})[_0x66e8('0x10')](function(_0x5e399f){var _0x27814c=_0x55c9f0['user']?_0x55c9f0[_0x66e8('0xf')]['id']:_0x66e8('0x11');var _0x41eb7d=_0x3233a3['data'];var _0x40008e=_0x3233a3[_0x66e8('0x12')];var _0x188d3c=new Date(Number(_0x40008e));return _0x5e399f(_0x27814c,_0x188d3c,_0x323414,_0x41eb7d);})[_0x66e8('0x13')](function(_0x4a8288){fileLogger(_0x66e8('0xb'))[_0x66e8('0x14')](_0x4a8288);});};}function setupLoggers(_0x11c321){return new Promise(function(_0x427f0e){var _0x572ff2=new ClientSideLogger();var _0xcde583=fileLogger('api');var _0x17f9f5=fileLogger(_0x66e8('0x15'));_0x11c321[_0x66e8('0x16')]('client-side-logger',_0x572ff2);_0x11c321[_0x66e8('0x17')](ewinston[_0x66e8('0x18')]({'winstonInstance':_0xcde583,'meta':![],'statusLevels':!![],'msg':function(_0x317012,_0x202ece){var _0x4b2e14=_0x66e8('0x19');if(!_[_0x66e8('0x1a')](_0x317012[_0x66e8('0x1b')])){_0x4b2e14+=_0x66e8('0x1c');var _0x1e848e=_0x317012[_0x66e8('0x1b')];maskSensitiveData(_0x1e848e);}return safeTemplate(util['format'](_0x4b2e14,_0x317012[_0x66e8('0x1d')],_0x317012[_0x66e8('0x1e')][_0x66e8('0x1f')]?_0x317012[_0x66e8('0x1e')][_0x66e8('0x1f')]:_0x317012[_0x66e8('0x20')][_0x66e8('0x21')]||_0x317012['ip'],_0x317012[_0x66e8('0x22')],_0x202ece[_0x66e8('0x23')],_0x202ece[_0x66e8('0x24')],_0x317012[_0x66e8('0xf')]?_0x317012[_0x66e8('0xf')]['id']:null,_0x317012['user']?_0x317012[_0x66e8('0xf')][_0x66e8('0xc')]:null,_0x317012[_0x66e8('0xf')]?_0x317012[_0x66e8('0xf')]['role']:null,_0x1e848e?util[_0x66e8('0x25')](_0x1e848e,![],null):''));}}));_0x11c321['use'](ewinston[_0x66e8('0x18')]({'winstonInstance':_0x17f9f5,'meta':![],'statusLevels':!![],'msg':function(_0x1ab6aa,_0x1be6c9){var _0xc55415=_0x66e8('0x26');if(_0x1ab6aa[_0x66e8('0x1b')]&&_0x1ab6aa[_0x66e8('0x1b')][_0x66e8('0x27')]&&_0x1ab6aa[_0x66e8('0x1b')][_0x66e8('0x28')]){_0xc55415='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x66e8('0x29')](_0xc55415,_0x1ab6aa['method'],_0x1ab6aa[_0x66e8('0x1e')][_0x66e8('0x1f')]?_0x1ab6aa[_0x66e8('0x1e')][_0x66e8('0x1f')]:_0x1ab6aa[_0x66e8('0x20')][_0x66e8('0x21')]||_0x1ab6aa['ip'],_0x1ab6aa[_0x66e8('0x22')],_0x1be6c9[_0x66e8('0x23')],_0x1be6c9[_0x66e8('0x24')],_0x1ab6aa[_0x66e8('0xf')]?_0x1ab6aa[_0x66e8('0xf')]['id']:null,_0x1ab6aa[_0x66e8('0xf')]?_0x1ab6aa[_0x66e8('0xf')][_0x66e8('0xc')]:null,_0x1ab6aa[_0x66e8('0xf')]?_0x1ab6aa[_0x66e8('0xf')][_0x66e8('0x2a')]:null,_0x1ab6aa[_0x66e8('0x1b')]&&_0x1ab6aa[_0x66e8('0x1b')]['device']?_0x1ab6aa['body'][_0x66e8('0x27')]:_0x66e8('0x2b'),_0x1ab6aa[_0x66e8('0x1b')]&&_0x1ab6aa[_0x66e8('0x1b')][_0x66e8('0x28')]?_0x1ab6aa[_0x66e8('0x1b')][_0x66e8('0x28')]:'',_0x1ab6aa[_0x66e8('0x1b')]&&_0x1ab6aa['body'][_0x66e8('0x2c')]?_0x1ab6aa[_0x66e8('0x1b')][_0x66e8('0x2c')]:'');},'ignoreRoute':function(_0x5d2e90){var _0x67b2e9=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x67b2e9['test'](_0x5d2e90[_0x66e8('0x22')]);}}));return _0x427f0e();});}exports[_0x66e8('0x2d')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 8146f67..a50399b 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59fe=['fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20white','gray','bold\x20magenta','bold\x20cyan','addColors','/var/log/xcally','join','%s-%s.log','message','replace','{{{','}}}','format','toUpperCase','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','Logger','transports','Console','warn','File','error','%s-%s','consoleLogger'];(function(_0x312663,_0x145fc5){var _0x3a0bea=function(_0x56b427){while(--_0x56b427){_0x312663['push'](_0x312663['shift']());}};_0x3a0bea(++_0x145fc5);}(_0x59fe,0xc4));var _0xe59f=function(_0x4cac69,_0x23f7ca){_0x4cac69=_0x4cac69-0x0;var _0x5e8f5c=_0x59fe[_0x4cac69];return _0x5e8f5c;};'use strict';var path=require(_0xe59f('0x0'));var util=require(_0xe59f('0x1'));var moment=require(_0xe59f('0x2'));var winston=require(_0xe59f('0x3'));var config=require(_0xe59f('0x4'));var debugLevel=config[_0xe59f('0x5')]?config[_0xe59f('0x5')][_0xe59f('0x6')]():_0xe59f('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':_0xe59f('0x8'),'error':_0xe59f('0x9'),'warn':'bold\x20yellow','info':'white','print':_0xe59f('0xa'),'success':'bold\x20green','http':_0xe59f('0xb'),'verbose':_0xe59f('0xc'),'debug':'bold\x20blue','silly':_0xe59f('0xd')};winston[_0xe59f('0xe')](XC_LOG_COLORS);function getLogFileName(_0x125644,_0x1d80a9,_0x3c4507){var _0x327811=_0x125644||_0xe59f('0xf');return path[_0xe59f('0x10')](_0x327811,util['format'](_0xe59f('0x11'),_0x1d80a9,_0x3c4507));}function formatter(_0x3c9624,_0x2b88c4){_0x2b88c4['message']=_0x2b88c4[_0xe59f('0x12')][_0xe59f('0x13')](/@@{/g,_0xe59f('0x14'))['replace'](/}@@/g,_0xe59f('0x15'))['replace'](/@{/g,'{{')[_0xe59f('0x13')](/}@/g,'}}');return util[_0xe59f('0x16')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x2b88c4['level'][_0xe59f('0x17')](),_0x3c9624,_0x2b88c4[_0xe59f('0x12')]);}function fileFormat(_0x35f1b7,_0x307c0c){_0x307c0c[_0xe59f('0x12')]=_0x307c0c[_0xe59f('0x12')][_0xe59f('0x13')](/@@{/g,_0xe59f('0x14'))[_0xe59f('0x13')](/}@@/g,_0xe59f('0x15'))[_0xe59f('0x13')](/@{/g,'{{')[_0xe59f('0x13')](/}@/g,'}}');var _0x12f466=_0x307c0c[_0xe59f('0x18')]&&Object[_0xe59f('0x19')](_0x307c0c['meta'])[_0xe59f('0x1a')]?'\x0a\x09'+JSON['stringify'](_0x307c0c[_0xe59f('0x18')]):'';return util[_0xe59f('0x16')](_0xe59f('0x1b'),moment()['format'](_0xe59f('0x1c')),_0x307c0c[_0xe59f('0x1d')]['toUpperCase'](),_0x35f1b7,_0x307c0c[_0xe59f('0x12')],_0x12f466);}function consoleLogger(){var _0x4d0e59=new winston[(_0xe59f('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xe59f('0x1f'))][(_0xe59f('0x20'))]({'level':_0xe59f('0x21'),'json':![],'formatter':function(_0x4f78fd){return formatter('',_0x4f78fd);}})]});return _0x4d0e59;}function fileLogger(_0x1a0808,_0x2dc2a4){var _0xa31bfe=new winston[(_0xe59f('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xe59f('0x1f'))][(_0xe59f('0x22'))]({'name':util[_0xe59f('0x16')]('%s-%s',_0x1a0808,_0xe59f('0x23')),'filename':getLogFileName(_0x2dc2a4,_0x1a0808,_0xe59f('0x23')),'level':_0xe59f('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3a397c){return fileFormat(_0x1a0808,_0x3a397c);}}),new winston[(_0xe59f('0x1f'))]['File']({'name':util[_0xe59f('0x16')](_0xe59f('0x24'),_0x1a0808,debugLevel),'filename':getLogFileName(_0x2dc2a4,_0x1a0808,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4d98e5){return fileFormat(_0x1a0808,_0x4d98e5);}}),new winston[(_0xe59f('0x1f'))][(_0xe59f('0x20'))]({'level':_0xe59f('0x21'),'json':![],'formatter':function(_0x485c12){return fileFormat(_0x1a0808,_0x485c12);}})]});return _0xa31bfe;}exports[_0xe59f('0x25')]=consoleLogger;exports[_0xe59f('0x26')]=fileLogger; \ No newline at end of file +var _0xb54b=['stringify','Logger','transports','Console','warn','File','error','%s-%s','fileLogger','path','util','moment','winston','../config/environment','debugLevel','info','redBG\x20white','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','format','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','}}}','meta','keys'];(function(_0x1f9503,_0x8e450b){var _0xaab94f=function(_0x5b0c4d){while(--_0x5b0c4d){_0x1f9503['push'](_0x1f9503['shift']());}};_0xaab94f(++_0x8e450b);}(_0xb54b,0x14d));var _0xbb54=function(_0x54750c,_0x5759fe){_0x54750c=_0x54750c-0x0;var _0xf85c39=_0xb54b[_0x54750c];return _0xf85c39;};'use strict';var path=require(_0xbb54('0x0'));var util=require(_0xbb54('0x1'));var moment=require(_0xbb54('0x2'));var winston=require(_0xbb54('0x3'));var config=require(_0xbb54('0x4'));var debugLevel=config[_0xbb54('0x5')]?config['debugLevel']['toLowerCase']():_0xbb54('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xbb54('0x7'),'error':'red','warn':'bold\x20yellow','info':_0xbb54('0x8'),'print':_0xbb54('0x9'),'success':_0xbb54('0xa'),'http':_0xbb54('0xb'),'verbose':_0xbb54('0xc'),'debug':_0xbb54('0xd'),'silly':_0xbb54('0xe')};winston[_0xbb54('0xf')](XC_LOG_COLORS);function getLogFileName(_0x3d6bc6,_0xddd395,_0x2620ab){var _0x38c539=_0x3d6bc6||'/var/log/xcally';return path['join'](_0x38c539,util[_0xbb54('0x10')]('%s-%s.log',_0xddd395,_0x2620ab));}function formatter(_0x209093,_0x71ae74){_0x71ae74[_0xbb54('0x11')]=_0x71ae74[_0xbb54('0x11')][_0xbb54('0x12')](/@@{/g,_0xbb54('0x13'))['replace'](/}@@/g,'}}}')[_0xbb54('0x12')](/@{/g,'{{')[_0xbb54('0x12')](/}@/g,'}}');return util[_0xbb54('0x10')](_0xbb54('0x14'),moment()[_0xbb54('0x10')](_0xbb54('0x15')),_0x71ae74[_0xbb54('0x16')][_0xbb54('0x17')](),_0x209093,_0x71ae74['message']);}function fileFormat(_0x4e841f,_0x566048){_0x566048[_0xbb54('0x11')]=_0x566048[_0xbb54('0x11')][_0xbb54('0x12')](/@@{/g,_0xbb54('0x13'))[_0xbb54('0x12')](/}@@/g,_0xbb54('0x18'))[_0xbb54('0x12')](/@{/g,'{{')[_0xbb54('0x12')](/}@/g,'}}');var _0x16b280=_0x566048[_0xbb54('0x19')]&&Object[_0xbb54('0x1a')](_0x566048['meta'])['length']?'\x0a\x09'+JSON[_0xbb54('0x1b')](_0x566048[_0xbb54('0x19')]):'';return util[_0xbb54('0x10')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()['format'](_0xbb54('0x15')),_0x566048[_0xbb54('0x16')][_0xbb54('0x17')](),_0x4e841f,_0x566048[_0xbb54('0x11')],_0x16b280);}function consoleLogger(){var _0x3afc26=new winston[(_0xbb54('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xbb54('0x1d'))][(_0xbb54('0x1e'))]({'level':_0xbb54('0x1f'),'json':![],'formatter':function(_0x281802){return formatter('',_0x281802);}})]});return _0x3afc26;}function fileLogger(_0x2d2891,_0x452ba9){var _0x1ab576=new winston[(_0xbb54('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xbb54('0x1d'))][(_0xbb54('0x20'))]({'name':util[_0xbb54('0x10')]('%s-%s',_0x2d2891,_0xbb54('0x21')),'filename':getLogFileName(_0x452ba9,_0x2d2891,'error'),'level':_0xbb54('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5752b9){return fileFormat(_0x2d2891,_0x5752b9);}}),new winston[(_0xbb54('0x1d'))][(_0xbb54('0x20'))]({'name':util['format'](_0xbb54('0x22'),_0x2d2891,debugLevel),'filename':getLogFileName(_0x452ba9,_0x2d2891,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5a6544){return fileFormat(_0x2d2891,_0x5a6544);}}),new winston['transports'][(_0xbb54('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x3bdf8d){return fileFormat(_0x2d2891,_0x3bdf8d);}})]});return _0x1ab576;}exports['consoleLogger']=consoleLogger;exports[_0xbb54('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 7f36af1..9a92f17 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 _0x0295=['length','isString','replace','}@@','includes','exports','lodash','newPassword','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','token','accessToken','authToken','consumerSecret','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray'];(function(_0x5e8c32,_0x1b1f3f){var _0x595f7b=function(_0x38840e){while(--_0x38840e){_0x5e8c32['push'](_0x5e8c32['shift']());}};_0x595f7b(++_0x1b1f3f);}(_0x0295,0x1f0));var _0x5029=function(_0x5659f4,_0x3a072a){_0x5659f4=_0x5659f4-0x0;var _0x18e9a5=_0x0295[_0x5659f4];return _0x18e9a5;};var _=require(_0x5029('0x0'));var sensitiveFields=['username','password',_0x5029('0x1'),'apiKey','firstName',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7'),_0x5029('0x8'),_0x5029('0x9'),_0x5029('0xa'),'code','accessKey','tenantId',_0x5029('0xb'),'channelSecret',_0x5029('0xc'),'accessTokenSecret',_0x5029('0xd'),'consumerKey',_0x5029('0xe'),_0x5029('0xf'),_0x5029('0x10'),'calleridnum',_0x5029('0x11'),_0x5029('0x12'),_0x5029('0x13'),'privateKey',_0x5029('0x14'),_0x5029('0x15'),'key','user','pass','accountSid',_0x5029('0x16'),_0x5029('0x17'),_0x5029('0x18'),_0x5029('0x19'),_0x5029('0x1a')];function maskSensitiveData(_0x11c24b){const _0xe278b7=/(?!^)[\s\S](?!$)/g;if(_[_0x5029('0x1b')](_0x11c24b)){for(const _0x10bf55 in _0x11c24b){if(_[_0x5029('0x1c')](_0x11c24b[_0x10bf55])){for(let _0x457c73=0x0;_0x457c73<_0x11c24b[_0x10bf55][_0x5029('0x1d')];_0x457c73++){maskSensitiveData(_0x11c24b[_0x10bf55][_0x457c73]);}}else if(_[_0x5029('0x1b')](_0x11c24b[_0x10bf55])){maskSensitiveData(_0x11c24b[_0x10bf55]);}else if(_[_0x5029('0x1e')](_0x11c24b[_0x10bf55])){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](/{{{/g,'@@{')[_0x5029('0x1f')](/}}}/g,_0x5029('0x20'))[_0x5029('0x1f')](/{{/g,'@{')[_0x5029('0x1f')](/}}/g,'}@');if(_[_0x5029('0x21')](sensitiveFields,_0x10bf55)){_0x11c24b[_0x10bf55]=_0x11c24b[_0x10bf55][_0x5029('0x1f')](_0xe278b7,'*');}}}}}module[_0x5029('0x22')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xdb28,0x106));var _0x8db2=function(_0x3dec2b,_0x25424c){_0x3dec2b=_0x3dec2b-0x0;var _0x38ad85=_0xdb28[_0x3dec2b];return _0x38ad85;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index d6802ba..542f41f 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 _0x3266=['\x20}\x20}','string','replace','isArray','keys','reduce','exports','lodash','{\x20{\x20'];(function(_0x44481c,_0x335e8a){var _0x57239a=function(_0x37332e){while(--_0x37332e){_0x44481c['push'](_0x44481c['shift']());}};_0x57239a(++_0x335e8a);}(_0x3266,0x6a));var _0x6326=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x3266[_0x3d42d8];return _0x27fc41;};var _=require(_0x6326('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b328d){return _0x2b328d==='{{'?_0x6326('0x1'):_0x6326('0x2');}function safeTemplate(_0x545df7){var _0x6b67c0=_0x545df7;if(typeof _0x545df7===_0x6326('0x3')){_0x6b67c0=_0x545df7[_0x6326('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x6326('0x5')](_0x545df7)){_0x6b67c0=_0x545df7['map'](function(_0x30b22e){return safeTemplate(_0x30b22e);});}else if(_['isPlainObject'](_0x545df7)){_0x6b67c0=Object[_0x6326('0x6')](_0x545df7)[_0x6326('0x7')](function(_0x14208e,_0x5402e5){_0x14208e[_0x5402e5]=safeTemplate(_0x545df7[_0x5402e5]);return _0x14208e;},{});}return _0x6b67c0;}module[_0x6326('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file +var _0xda2d=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','map','isPlainObject','keys','reduce'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xda2d,0x102));var _0xdda2=function(_0x4b7f21,_0xd216c5){_0x4b7f21=_0x4b7f21-0x0;var _0x11762f=_0xda2d[_0x4b7f21];return _0x11762f;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x14e970){return _0x14e970==='{{'?_0xdda2('0x0'):_0xdda2('0x1');}function safeTemplate(_0x1f1fcc){var _0x329c5e=_0x1f1fcc;if(typeof _0x1f1fcc==='string'){_0x329c5e=_0x1f1fcc['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x1f1fcc)){_0x329c5e=_0x1f1fcc[_0xdda2('0x2')](function(_0x319129){return safeTemplate(_0x319129);});}else if(_[_0xdda2('0x3')](_0x1f1fcc)){_0x329c5e=Object[_0xdda2('0x4')](_0x1f1fcc)[_0xdda2('0x5')](function(_0xf38e58,_0x2f55dc){_0xf38e58[_0x2f55dc]=safeTemplate(_0x1f1fcc[_0x2f55dc]);return _0xf38e58;},{});}return _0x329c5e;}module[_0xdda2('0x6')][_0xdda2('0x7')]=safeTemplate; \ No newline at end of file